diff --git a/packages/osmo-query/package.json b/packages/osmo-query/package.json index afa469191..72bcdf585 100644 --- a/packages/osmo-query/package.json +++ b/packages/osmo-query/package.json @@ -75,7 +75,7 @@ "@confio/relayer": "0.7.0", "@cosmjs/cosmwasm-stargate": "0.29.4", "@cosmjs/crypto": "0.29.4", - "@cosmology/telescope": "0.102.0", + "@cosmology/telescope": "1.4.1", "@protobufs/confio": "^0.0.6", "@protobufs/cosmos": "^0.1.0", "@protobufs/cosmos_proto": "^0.0.10", diff --git a/packages/osmo-query/scripts/codegen.js b/packages/osmo-query/scripts/codegen.js index f6a7737f4..e9c80597c 100644 --- a/packages/osmo-query/scripts/codegen.js +++ b/packages/osmo-query/scripts/codegen.js @@ -22,7 +22,6 @@ telescope({ tsDisable: { patterns: ['**/*amino.ts', '**/*registry.ts'] }, - experimentalGlobalProtoNamespace: true, // [ 'v1beta1' ] concentratedliquidity interfaces: { enabled: true, useUnionTypes: false @@ -109,7 +108,7 @@ telescope({ }, rpcClients: { enabled: true, - camelCase: true + camelCase: true, }, reactQuery: { enabled: true diff --git a/packages/osmo-query/src/codegen/amino/bundle.ts b/packages/osmo-query/src/codegen/amino/bundle.ts index 00d920fc1..0b39af0c5 100644 --- a/packages/osmo-query/src/codegen/amino/bundle.ts +++ b/packages/osmo-query/src/codegen/amino/bundle.ts @@ -1,4 +1,4 @@ -import * as _41 from "./amino"; +import * as _72 from "./amino"; export const amino = { - ..._41 + ..._72 }; \ No newline at end of file diff --git a/packages/osmo-query/src/codegen/binary.ts b/packages/osmo-query/src/codegen/binary.ts index 2e0c41674..377f17250 100644 --- a/packages/osmo-query/src/codegen/binary.ts +++ b/packages/osmo-query/src/codegen/binary.ts @@ -1,5 +1,5 @@ /** -* This file and any referenced files were automatically generated by @cosmology/telescope@0.102.0 +* This file and any referenced files were automatically generated by @cosmology/telescope@1.4.1 * DO NOT MODIFY BY HAND. Instead, download the latest proto files for your chain * and run the transpile command or yarn proto command to regenerate this bundle. */ @@ -68,14 +68,38 @@ export enum WireType { } // Reader +export interface IBinaryReader { + buf: Uint8Array; + pos: number; + type: number; + len: number; + tag(): [number, WireType, number]; + skip(length?: number): this; + skipType(wireType: number): this; + uint32(): number; + int32(): number; + sint32(): number; + fixed32(): number; + sfixed32(): number; + int64(): bigint; + uint64(): bigint; + sint64(): bigint; + fixed64(): bigint; + sfixed64(): bigint; + float(): number; + double(): number; + bool(): boolean; + bytes(): Uint8Array; + string(): string; +} -export class BinaryReader { +export class BinaryReader implements IBinaryReader { buf: Uint8Array; pos: number; type: number; len: number; - protected assertBounds(): void { + assertBounds(): void { if (this.pos > this.len) throw new RangeError("premature EOF"); } @@ -217,35 +241,73 @@ export class BinaryReader { } // Writer +export interface IBinaryWriter { + len: number; + head: IOp; + tail: IOp; + states: State | null; + finish(): Uint8Array; + fork(): IBinaryWriter; + reset(): IBinaryWriter; + ldelim(): IBinaryWriter; + tag(fieldNo: number, type: WireType): IBinaryWriter; + uint32(value: number): IBinaryWriter; + int32(value: number): IBinaryWriter; + sint32(value: number): IBinaryWriter; + int64(value: string | number | bigint): IBinaryWriter; + uint64: (value: string | number | bigint) => IBinaryWriter; + sint64(value: string | number | bigint): IBinaryWriter; + fixed64(value: string | number | bigint): IBinaryWriter; + sfixed64: (value: string | number | bigint) => IBinaryWriter; + bool(value: boolean): IBinaryWriter; + fixed32(value: number): IBinaryWriter; + sfixed32: (value: number) => IBinaryWriter; + float(value: number): IBinaryWriter; + double(value: number): IBinaryWriter; + bytes(value: Uint8Array): IBinaryWriter; + string(value: string): IBinaryWriter; +} -type OpVal = string | number | object | Uint8Array; +interface IOp { + len: number; + next?: IOp; + proceed(buf: Uint8Array | number[], pos: number): void; +} -class Op { - fn?: (val: OpVal, buf: Uint8Array | number[], pos: number) => void; +class Op implements IOp { + fn?: ((val: T, buf: Uint8Array | number[], pos: number) => void) | null; len: number; - val: OpVal; - next?: Op; + val: T; + next?: IOp; constructor( - fn: ( - val: OpVal, - buf: Uint8Array | number[], - pos: number - ) => void | undefined, + fn: + | (( + val: T, + buf: Uint8Array | number[], + pos: number + ) => void | undefined | null) + | null, len: number, - val: OpVal + val: T ) { this.fn = fn; this.len = len; this.val = val; } + + proceed(buf: Uint8Array | number[], pos: number) { + if (this.fn) { + this.fn(this.val, buf, pos); + } + } } class State { - head: Op; - tail: Op; + head: IOp; + tail: IOp; len: number; - next: State; + next: State | null; constructor(writer: BinaryWriter) { this.head = writer.head; @@ -255,11 +317,11 @@ class State { } } -export class BinaryWriter { +export class BinaryWriter implements IBinaryWriter { len = 0; - head: Op; - tail: Op; - states: State; + head: IOp; + tail: IOp; + states: State | null; constructor() { this.head = new Op(null, 0, 0); @@ -282,10 +344,10 @@ export class BinaryWriter { } } - private _push( - fn: (val: OpVal, buf: Uint8Array | number[], pos: number) => void, + private _push( + fn: (val: T, buf: Uint8Array | number[], pos: number) => void, len: number, - val: OpVal + val: T ) { this.tail = this.tail.next = new Op(fn, len, val); this.len += len; @@ -297,7 +359,7 @@ export class BinaryWriter { pos = 0; const buf = BinaryWriter.alloc(this.len); while (head) { - head.fn(head.val, buf, pos); + head.proceed(buf, pos); pos += head.len; head = head.next; } @@ -444,7 +506,7 @@ function pool( ): (size: number) => Uint8Array { const SIZE = size || 8192; const MAX = SIZE >>> 1; - let slab = null; + let slab: Uint8Array | null = null; let offset = SIZE; return function pool_alloc(size): Uint8Array { if (size < 1 || size > MAX) return alloc(size); diff --git a/packages/osmo-query/src/codegen/capability/bundle.ts b/packages/osmo-query/src/codegen/capability/bundle.ts index 486628ae2..4f2672fb7 100644 --- a/packages/osmo-query/src/codegen/capability/bundle.ts +++ b/packages/osmo-query/src/codegen/capability/bundle.ts @@ -1,8 +1,8 @@ -import * as _42 from "./v1/capability"; -import * as _43 from "./v1/genesis"; +import * as _84 from "./v1/capability"; +import * as _85 from "./v1/genesis"; export namespace capability { export const v1 = { - ..._42, - ..._43 + ..._84, + ..._85 }; } \ No newline at end of file diff --git a/packages/osmo-query/src/codegen/capability/v1/capability.ts b/packages/osmo-query/src/codegen/capability/v1/capability.ts index d772feeda..d3744e83b 100644 --- a/packages/osmo-query/src/codegen/capability/v1/capability.ts +++ b/packages/osmo-query/src/codegen/capability/v1/capability.ts @@ -15,7 +15,7 @@ export interface CapabilityProtoMsg { * provided to a Capability must be globally unique. */ export interface CapabilityAmino { - index: string; + index?: string; } export interface CapabilityAminoMsg { type: "/capability.v1.Capability"; @@ -45,8 +45,8 @@ export interface OwnerProtoMsg { * capability and the module name. */ export interface OwnerAmino { - module: string; - name: string; + module?: string; + name?: string; } export interface OwnerAminoMsg { type: "/capability.v1.Owner"; @@ -125,9 +125,11 @@ export const Capability = { return message; }, fromAmino(object: CapabilityAmino): Capability { - return { - index: BigInt(object.index) - }; + const message = createBaseCapability(); + if (object.index !== undefined && object.index !== null) { + message.index = BigInt(object.index); + } + return message; }, toAmino(message: Capability): CapabilityAmino { const obj: any = {}; @@ -194,10 +196,14 @@ export const Owner = { return message; }, fromAmino(object: OwnerAmino): Owner { - return { - module: object.module, - name: object.name - }; + const message = createBaseOwner(); + if (object.module !== undefined && object.module !== null) { + message.module = object.module; + } + if (object.name !== undefined && object.name !== null) { + message.name = object.name; + } + return message; }, toAmino(message: Owner): OwnerAmino { const obj: any = {}; @@ -257,9 +263,9 @@ export const CapabilityOwners = { return message; }, fromAmino(object: CapabilityOwnersAmino): CapabilityOwners { - return { - owners: Array.isArray(object?.owners) ? object.owners.map((e: any) => Owner.fromAmino(e)) : [] - }; + const message = createBaseCapabilityOwners(); + message.owners = object.owners?.map(e => Owner.fromAmino(e)) || []; + return message; }, toAmino(message: CapabilityOwners): CapabilityOwnersAmino { const obj: any = {}; diff --git a/packages/osmo-query/src/codegen/capability/v1/genesis.ts b/packages/osmo-query/src/codegen/capability/v1/genesis.ts index a310f0ac9..6047fc112 100644 --- a/packages/osmo-query/src/codegen/capability/v1/genesis.ts +++ b/packages/osmo-query/src/codegen/capability/v1/genesis.ts @@ -14,9 +14,9 @@ export interface GenesisOwnersProtoMsg { /** GenesisOwners defines the capability owners with their corresponding index. */ export interface GenesisOwnersAmino { /** index is the index of the capability owner. */ - index: string; + index?: string; /** index_owners are the owners at the given index. */ - index_owners?: CapabilityOwnersAmino; + index_owners: CapabilityOwnersAmino; } export interface GenesisOwnersAminoMsg { type: "/capability.v1.GenesisOwners"; @@ -44,7 +44,7 @@ export interface GenesisStateProtoMsg { /** GenesisState defines the capability module's genesis state. */ export interface GenesisStateAmino { /** index is the capability global index. */ - index: string; + index?: string; /** * owners represents a map from index to owners of the capability index * index key is string to allow amino marshalling. @@ -104,15 +104,19 @@ export const GenesisOwners = { return message; }, fromAmino(object: GenesisOwnersAmino): GenesisOwners { - return { - index: BigInt(object.index), - indexOwners: object?.index_owners ? CapabilityOwners.fromAmino(object.index_owners) : undefined - }; + const message = createBaseGenesisOwners(); + if (object.index !== undefined && object.index !== null) { + message.index = BigInt(object.index); + } + if (object.index_owners !== undefined && object.index_owners !== null) { + message.indexOwners = CapabilityOwners.fromAmino(object.index_owners); + } + return message; }, toAmino(message: GenesisOwners): GenesisOwnersAmino { const obj: any = {}; obj.index = message.index ? message.index.toString() : undefined; - obj.index_owners = message.indexOwners ? CapabilityOwners.toAmino(message.indexOwners) : undefined; + obj.index_owners = message.indexOwners ? CapabilityOwners.toAmino(message.indexOwners) : CapabilityOwners.fromPartial({}); return obj; }, fromAminoMsg(object: GenesisOwnersAminoMsg): GenesisOwners { @@ -175,10 +179,12 @@ export const GenesisState = { return message; }, fromAmino(object: GenesisStateAmino): GenesisState { - return { - index: BigInt(object.index), - owners: Array.isArray(object?.owners) ? object.owners.map((e: any) => GenesisOwners.fromAmino(e)) : [] - }; + const message = createBaseGenesisState(); + if (object.index !== undefined && object.index !== null) { + message.index = BigInt(object.index); + } + message.owners = object.owners?.map(e => GenesisOwners.fromAmino(e)) || []; + return message; }, toAmino(message: GenesisState): GenesisStateAmino { const obj: any = {}; diff --git a/packages/osmo-query/src/codegen/confio/proofs.ts b/packages/osmo-query/src/codegen/confio/proofs.ts index 9a98f4ff9..fcf6f0c7b 100644 --- a/packages/osmo-query/src/codegen/confio/proofs.ts +++ b/packages/osmo-query/src/codegen/confio/proofs.ts @@ -1,5 +1,5 @@ import { BinaryReader, BinaryWriter } from "../binary"; -import { isSet } from "../helpers"; +import { bytesFromBase64, base64FromBytes } from "../helpers"; export enum HashOp { /** NO_HASH - NO_HASH is the default if no data passed. Note this is an illegal argument some places. */ NO_HASH = 0, @@ -171,7 +171,7 @@ export function lengthOpToJSON(object: LengthOp): string { export interface ExistenceProof { key: Uint8Array; value: Uint8Array; - leaf: LeafOp; + leaf?: LeafOp; path: InnerOp[]; } export interface ExistenceProofProtoMsg { @@ -200,10 +200,10 @@ export interface ExistenceProofProtoMsg { * length-prefix the data before hashing it. */ export interface ExistenceProofAmino { - key: Uint8Array; - value: Uint8Array; + key?: string; + value?: string; leaf?: LeafOpAmino; - path: InnerOpAmino[]; + path?: InnerOpAmino[]; } export interface ExistenceProofAminoMsg { type: "/ics23.ExistenceProof"; @@ -233,7 +233,7 @@ export interface ExistenceProofAminoMsg { export interface ExistenceProofSDKType { key: Uint8Array; value: Uint8Array; - leaf: LeafOpSDKType; + leaf?: LeafOpSDKType; path: InnerOpSDKType[]; } /** @@ -244,8 +244,8 @@ export interface ExistenceProofSDKType { export interface NonExistenceProof { /** TODO: remove this as unnecessary??? we prove a range */ key: Uint8Array; - left: ExistenceProof; - right: ExistenceProof; + left?: ExistenceProof; + right?: ExistenceProof; } export interface NonExistenceProofProtoMsg { typeUrl: "/ics23.NonExistenceProof"; @@ -258,7 +258,7 @@ export interface NonExistenceProofProtoMsg { */ export interface NonExistenceProofAmino { /** TODO: remove this as unnecessary??? we prove a range */ - key: Uint8Array; + key?: string; left?: ExistenceProofAmino; right?: ExistenceProofAmino; } @@ -273,8 +273,8 @@ export interface NonExistenceProofAminoMsg { */ export interface NonExistenceProofSDKType { key: Uint8Array; - left: ExistenceProofSDKType; - right: ExistenceProofSDKType; + left?: ExistenceProofSDKType; + right?: ExistenceProofSDKType; } /** CommitmentProof is either an ExistenceProof or a NonExistenceProof, or a Batch of such messages */ export interface CommitmentProof { @@ -353,15 +353,15 @@ export interface LeafOpProtoMsg { * output = hash(prefix || length(hkey) || hkey || length(hvalue) || hvalue) */ export interface LeafOpAmino { - hash: HashOp; - prehash_key: HashOp; - prehash_value: HashOp; - length: LengthOp; + hash?: HashOp; + prehash_key?: HashOp; + prehash_value?: 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?: string; } export interface LeafOpAminoMsg { type: "/ics23.LeafOp"; @@ -434,9 +434,9 @@ export interface InnerOpProtoMsg { * If either of prefix or suffix is empty, we just treat it as an empty string */ export interface InnerOpAmino { - hash: HashOp; - prefix: Uint8Array; - suffix: Uint8Array; + hash?: HashOp; + prefix?: string; + suffix?: string; } export interface InnerOpAminoMsg { type: "/ics23.InnerOp"; @@ -481,8 +481,8 @@ 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; /** min_depth (if > 0) is the minimum number of InnerOps allowed (mainly for fixed-depth tries) */ @@ -512,9 +512,9 @@ export interface ProofSpecAmino { leaf_spec?: LeafOpAmino; inner_spec?: InnerSpecAmino; /** max_depth (if > 0) is the maximum number of InnerOps allowed (mainly for fixed-depth tries) */ - max_depth: number; + max_depth?: number; /** min_depth (if > 0) is the minimum number of InnerOps allowed (mainly for fixed-depth tries) */ - min_depth: number; + min_depth?: number; } export interface ProofSpecAminoMsg { type: "/ics23.ProofSpec"; @@ -533,8 +533,8 @@ export interface ProofSpecAminoMsg { * tree format server uses. But not in code, rather a configuration object. */ export interface ProofSpecSDKType { - leaf_spec: LeafOpSDKType; - inner_spec: InnerSpecSDKType; + leaf_spec?: LeafOpSDKType; + inner_spec?: InnerSpecSDKType; max_depth: number; min_depth: number; } @@ -583,14 +583,14 @@ export interface InnerSpecAmino { * iavl tree is [0, 1] (left then right) * merk is [0, 2, 1] (left, right, here) */ - child_order: number[]; - child_size: number; - min_prefix_length: number; - max_prefix_length: number; + child_order?: number[]; + child_size?: number; + min_prefix_length?: number; + max_prefix_length?: number; /** empty child is the prehash image that is used when one child is nil (eg. 20 bytes of 0) */ - empty_child: Uint8Array; + empty_child?: string; /** hash is the algorithm that must be used for each InnerOp */ - hash: HashOp; + hash?: HashOp; } export interface InnerSpecAminoMsg { type: "/ics23.InnerSpec"; @@ -624,7 +624,7 @@ export interface BatchProofProtoMsg { } /** BatchProof is a group of multiple proof types than can be compressed */ export interface BatchProofAmino { - entries: BatchEntryAmino[]; + entries?: BatchEntryAmino[]; } export interface BatchProofAminoMsg { type: "/ics23.BatchProof"; @@ -666,8 +666,8 @@ export interface CompressedBatchProofProtoMsg { value: Uint8Array; } export interface CompressedBatchProofAmino { - entries: CompressedBatchEntryAmino[]; - lookup_inners: InnerOpAmino[]; + entries?: CompressedBatchEntryAmino[]; + lookup_inners?: InnerOpAmino[]; } export interface CompressedBatchProofAminoMsg { type: "/ics23.CompressedBatchProof"; @@ -703,7 +703,7 @@ export interface CompressedBatchEntrySDKType { export interface CompressedExistenceProof { key: Uint8Array; value: Uint8Array; - leaf: LeafOp; + leaf?: LeafOp; /** these are indexes into the lookup_inners table in CompressedBatchProof */ path: number[]; } @@ -712,11 +712,11 @@ export interface CompressedExistenceProofProtoMsg { value: Uint8Array; } export interface CompressedExistenceProofAmino { - key: Uint8Array; - value: Uint8Array; + key?: string; + value?: string; leaf?: LeafOpAmino; /** these are indexes into the lookup_inners table in CompressedBatchProof */ - path: number[]; + path?: number[]; } export interface CompressedExistenceProofAminoMsg { type: "/ics23.CompressedExistenceProof"; @@ -725,14 +725,14 @@ export interface CompressedExistenceProofAminoMsg { export interface CompressedExistenceProofSDKType { key: Uint8Array; value: Uint8Array; - leaf: LeafOpSDKType; + leaf?: LeafOpSDKType; path: number[]; } export interface CompressedNonExistenceProof { /** TODO: remove this as unnecessary??? we prove a range */ key: Uint8Array; - left: CompressedExistenceProof; - right: CompressedExistenceProof; + left?: CompressedExistenceProof; + right?: CompressedExistenceProof; } export interface CompressedNonExistenceProofProtoMsg { typeUrl: "/ics23.CompressedNonExistenceProof"; @@ -740,7 +740,7 @@ export interface CompressedNonExistenceProofProtoMsg { } export interface CompressedNonExistenceProofAmino { /** TODO: remove this as unnecessary??? we prove a range */ - key: Uint8Array; + key?: string; left?: CompressedExistenceProofAmino; right?: CompressedExistenceProofAmino; } @@ -750,14 +750,14 @@ export interface CompressedNonExistenceProofAminoMsg { } export interface CompressedNonExistenceProofSDKType { key: Uint8Array; - left: CompressedExistenceProofSDKType; - right: CompressedExistenceProofSDKType; + left?: CompressedExistenceProofSDKType; + right?: CompressedExistenceProofSDKType; } function createBaseExistenceProof(): ExistenceProof { return { key: new Uint8Array(), value: new Uint8Array(), - leaf: LeafOp.fromPartial({}), + leaf: undefined, path: [] }; } @@ -813,17 +813,23 @@ export const ExistenceProof = { return message; }, fromAmino(object: ExistenceProofAmino): ExistenceProof { - return { - key: object.key, - value: object.value, - leaf: object?.leaf ? LeafOp.fromAmino(object.leaf) : undefined, - path: Array.isArray(object?.path) ? object.path.map((e: any) => InnerOp.fromAmino(e)) : [] - }; + const message = createBaseExistenceProof(); + if (object.key !== undefined && object.key !== null) { + message.key = bytesFromBase64(object.key); + } + if (object.value !== undefined && object.value !== null) { + message.value = bytesFromBase64(object.value); + } + if (object.leaf !== undefined && object.leaf !== null) { + message.leaf = LeafOp.fromAmino(object.leaf); + } + message.path = object.path?.map(e => InnerOp.fromAmino(e)) || []; + return message; }, toAmino(message: ExistenceProof): ExistenceProofAmino { const obj: any = {}; - obj.key = message.key; - obj.value = message.value; + obj.key = message.key ? base64FromBytes(message.key) : undefined; + obj.value = message.value ? base64FromBytes(message.value) : undefined; obj.leaf = message.leaf ? LeafOp.toAmino(message.leaf) : undefined; if (message.path) { obj.path = message.path.map(e => e ? InnerOp.toAmino(e) : undefined); @@ -851,8 +857,8 @@ export const ExistenceProof = { function createBaseNonExistenceProof(): NonExistenceProof { return { key: new Uint8Array(), - left: ExistenceProof.fromPartial({}), - right: ExistenceProof.fromPartial({}) + left: undefined, + right: undefined }; } export const NonExistenceProof = { @@ -900,15 +906,21 @@ export const NonExistenceProof = { return message; }, fromAmino(object: NonExistenceProofAmino): NonExistenceProof { - return { - key: object.key, - left: object?.left ? ExistenceProof.fromAmino(object.left) : undefined, - right: object?.right ? ExistenceProof.fromAmino(object.right) : undefined - }; + const message = createBaseNonExistenceProof(); + if (object.key !== undefined && object.key !== null) { + message.key = bytesFromBase64(object.key); + } + if (object.left !== undefined && object.left !== null) { + message.left = ExistenceProof.fromAmino(object.left); + } + if (object.right !== undefined && object.right !== null) { + message.right = ExistenceProof.fromAmino(object.right); + } + return message; }, toAmino(message: NonExistenceProof): NonExistenceProofAmino { const obj: any = {}; - obj.key = message.key; + obj.key = message.key ? base64FromBytes(message.key) : undefined; obj.left = message.left ? ExistenceProof.toAmino(message.left) : undefined; obj.right = message.right ? ExistenceProof.toAmino(message.right) : undefined; return obj; @@ -989,12 +1001,20 @@ export const CommitmentProof = { return message; }, fromAmino(object: CommitmentProofAmino): CommitmentProof { - return { - exist: object?.exist ? ExistenceProof.fromAmino(object.exist) : undefined, - nonexist: object?.nonexist ? NonExistenceProof.fromAmino(object.nonexist) : undefined, - batch: object?.batch ? BatchProof.fromAmino(object.batch) : undefined, - compressed: object?.compressed ? CompressedBatchProof.fromAmino(object.compressed) : undefined - }; + const message = createBaseCommitmentProof(); + if (object.exist !== undefined && object.exist !== null) { + message.exist = ExistenceProof.fromAmino(object.exist); + } + if (object.nonexist !== undefined && object.nonexist !== null) { + message.nonexist = NonExistenceProof.fromAmino(object.nonexist); + } + if (object.batch !== undefined && object.batch !== null) { + message.batch = BatchProof.fromAmino(object.batch); + } + if (object.compressed !== undefined && object.compressed !== null) { + message.compressed = CompressedBatchProof.fromAmino(object.compressed); + } + return message; }, toAmino(message: CommitmentProof): CommitmentProofAmino { const obj: any = {}; @@ -1088,21 +1108,31 @@ export const LeafOp = { return message; }, fromAmino(object: LeafOpAmino): LeafOp { - return { - hash: isSet(object.hash) ? hashOpFromJSON(object.hash) : -1, - prehashKey: isSet(object.prehash_key) ? hashOpFromJSON(object.prehash_key) : -1, - prehashValue: isSet(object.prehash_value) ? hashOpFromJSON(object.prehash_value) : -1, - length: isSet(object.length) ? lengthOpFromJSON(object.length) : -1, - prefix: object.prefix - }; + const message = createBaseLeafOp(); + if (object.hash !== undefined && object.hash !== null) { + message.hash = hashOpFromJSON(object.hash); + } + if (object.prehash_key !== undefined && object.prehash_key !== null) { + message.prehashKey = hashOpFromJSON(object.prehash_key); + } + if (object.prehash_value !== undefined && object.prehash_value !== null) { + message.prehashValue = hashOpFromJSON(object.prehash_value); + } + if (object.length !== undefined && object.length !== null) { + message.length = lengthOpFromJSON(object.length); + } + if (object.prefix !== undefined && object.prefix !== null) { + message.prefix = bytesFromBase64(object.prefix); + } + return message; }, toAmino(message: LeafOp): LeafOpAmino { const obj: any = {}; - obj.hash = message.hash; - obj.prehash_key = message.prehashKey; - obj.prehash_value = message.prehashValue; - obj.length = message.length; - obj.prefix = message.prefix; + obj.hash = hashOpToJSON(message.hash); + obj.prehash_key = hashOpToJSON(message.prehashKey); + obj.prehash_value = hashOpToJSON(message.prehashValue); + obj.length = lengthOpToJSON(message.length); + obj.prefix = message.prefix ? base64FromBytes(message.prefix) : undefined; return obj; }, fromAminoMsg(object: LeafOpAminoMsg): LeafOp { @@ -1173,17 +1203,23 @@ export const InnerOp = { return message; }, fromAmino(object: InnerOpAmino): InnerOp { - return { - hash: isSet(object.hash) ? hashOpFromJSON(object.hash) : -1, - prefix: object.prefix, - suffix: object.suffix - }; + const message = createBaseInnerOp(); + if (object.hash !== undefined && object.hash !== null) { + message.hash = hashOpFromJSON(object.hash); + } + if (object.prefix !== undefined && object.prefix !== null) { + message.prefix = bytesFromBase64(object.prefix); + } + if (object.suffix !== undefined && object.suffix !== null) { + message.suffix = bytesFromBase64(object.suffix); + } + return message; }, toAmino(message: InnerOp): InnerOpAmino { const obj: any = {}; - obj.hash = message.hash; - obj.prefix = message.prefix; - obj.suffix = message.suffix; + obj.hash = hashOpToJSON(message.hash); + obj.prefix = message.prefix ? base64FromBytes(message.prefix) : undefined; + obj.suffix = message.suffix ? base64FromBytes(message.suffix) : undefined; return obj; }, fromAminoMsg(object: InnerOpAminoMsg): InnerOp { @@ -1204,8 +1240,8 @@ export const InnerOp = { }; function createBaseProofSpec(): ProofSpec { return { - leafSpec: LeafOp.fromPartial({}), - innerSpec: InnerSpec.fromPartial({}), + leafSpec: undefined, + innerSpec: undefined, maxDepth: 0, minDepth: 0 }; @@ -1262,12 +1298,20 @@ export const ProofSpec = { return message; }, fromAmino(object: ProofSpecAmino): ProofSpec { - return { - leafSpec: object?.leaf_spec ? LeafOp.fromAmino(object.leaf_spec) : undefined, - innerSpec: object?.inner_spec ? InnerSpec.fromAmino(object.inner_spec) : undefined, - maxDepth: object.max_depth, - minDepth: object.min_depth - }; + const message = createBaseProofSpec(); + if (object.leaf_spec !== undefined && object.leaf_spec !== null) { + message.leafSpec = LeafOp.fromAmino(object.leaf_spec); + } + if (object.inner_spec !== undefined && object.inner_spec !== null) { + message.innerSpec = InnerSpec.fromAmino(object.inner_spec); + } + if (object.max_depth !== undefined && object.max_depth !== null) { + message.maxDepth = object.max_depth; + } + if (object.min_depth !== undefined && object.min_depth !== null) { + message.minDepth = object.min_depth; + } + return message; }, toAmino(message: ProofSpec): ProofSpecAmino { const obj: any = {}; @@ -1378,14 +1422,24 @@ export const InnerSpec = { return message; }, fromAmino(object: InnerSpecAmino): InnerSpec { - return { - childOrder: Array.isArray(object?.child_order) ? object.child_order.map((e: any) => e) : [], - childSize: object.child_size, - minPrefixLength: object.min_prefix_length, - maxPrefixLength: object.max_prefix_length, - emptyChild: object.empty_child, - hash: isSet(object.hash) ? hashOpFromJSON(object.hash) : -1 - }; + const message = createBaseInnerSpec(); + message.childOrder = object.child_order?.map(e => e) || []; + if (object.child_size !== undefined && object.child_size !== null) { + message.childSize = object.child_size; + } + if (object.min_prefix_length !== undefined && object.min_prefix_length !== null) { + message.minPrefixLength = object.min_prefix_length; + } + if (object.max_prefix_length !== undefined && object.max_prefix_length !== null) { + message.maxPrefixLength = object.max_prefix_length; + } + if (object.empty_child !== undefined && object.empty_child !== null) { + message.emptyChild = bytesFromBase64(object.empty_child); + } + if (object.hash !== undefined && object.hash !== null) { + message.hash = hashOpFromJSON(object.hash); + } + return message; }, toAmino(message: InnerSpec): InnerSpecAmino { const obj: any = {}; @@ -1397,8 +1451,8 @@ export const InnerSpec = { obj.child_size = message.childSize; obj.min_prefix_length = message.minPrefixLength; obj.max_prefix_length = message.maxPrefixLength; - obj.empty_child = message.emptyChild; - obj.hash = message.hash; + obj.empty_child = message.emptyChild ? base64FromBytes(message.emptyChild) : undefined; + obj.hash = hashOpToJSON(message.hash); return obj; }, fromAminoMsg(object: InnerSpecAminoMsg): InnerSpec { @@ -1453,9 +1507,9 @@ export const BatchProof = { return message; }, fromAmino(object: BatchProofAmino): BatchProof { - return { - entries: Array.isArray(object?.entries) ? object.entries.map((e: any) => BatchEntry.fromAmino(e)) : [] - }; + const message = createBaseBatchProof(); + message.entries = object.entries?.map(e => BatchEntry.fromAmino(e)) || []; + return message; }, toAmino(message: BatchProof): BatchProofAmino { const obj: any = {}; @@ -1526,10 +1580,14 @@ export const BatchEntry = { return message; }, fromAmino(object: BatchEntryAmino): BatchEntry { - return { - exist: object?.exist ? ExistenceProof.fromAmino(object.exist) : undefined, - nonexist: object?.nonexist ? NonExistenceProof.fromAmino(object.nonexist) : undefined - }; + const message = createBaseBatchEntry(); + if (object.exist !== undefined && object.exist !== null) { + message.exist = ExistenceProof.fromAmino(object.exist); + } + if (object.nonexist !== undefined && object.nonexist !== null) { + message.nonexist = NonExistenceProof.fromAmino(object.nonexist); + } + return message; }, toAmino(message: BatchEntry): BatchEntryAmino { const obj: any = {}; @@ -1597,10 +1655,10 @@ export const CompressedBatchProof = { return message; }, fromAmino(object: CompressedBatchProofAmino): CompressedBatchProof { - return { - entries: Array.isArray(object?.entries) ? object.entries.map((e: any) => CompressedBatchEntry.fromAmino(e)) : [], - lookupInners: Array.isArray(object?.lookup_inners) ? object.lookup_inners.map((e: any) => InnerOp.fromAmino(e)) : [] - }; + const message = createBaseCompressedBatchProof(); + message.entries = object.entries?.map(e => CompressedBatchEntry.fromAmino(e)) || []; + message.lookupInners = object.lookup_inners?.map(e => InnerOp.fromAmino(e)) || []; + return message; }, toAmino(message: CompressedBatchProof): CompressedBatchProofAmino { const obj: any = {}; @@ -1676,10 +1734,14 @@ export const CompressedBatchEntry = { return message; }, fromAmino(object: CompressedBatchEntryAmino): CompressedBatchEntry { - return { - exist: object?.exist ? CompressedExistenceProof.fromAmino(object.exist) : undefined, - nonexist: object?.nonexist ? CompressedNonExistenceProof.fromAmino(object.nonexist) : undefined - }; + const message = createBaseCompressedBatchEntry(); + if (object.exist !== undefined && object.exist !== null) { + message.exist = CompressedExistenceProof.fromAmino(object.exist); + } + if (object.nonexist !== undefined && object.nonexist !== null) { + message.nonexist = CompressedNonExistenceProof.fromAmino(object.nonexist); + } + return message; }, toAmino(message: CompressedBatchEntry): CompressedBatchEntryAmino { const obj: any = {}; @@ -1707,7 +1769,7 @@ function createBaseCompressedExistenceProof(): CompressedExistenceProof { return { key: new Uint8Array(), value: new Uint8Array(), - leaf: LeafOp.fromPartial({}), + leaf: undefined, path: [] }; } @@ -1772,17 +1834,23 @@ export const CompressedExistenceProof = { return message; }, fromAmino(object: CompressedExistenceProofAmino): CompressedExistenceProof { - return { - key: object.key, - value: object.value, - leaf: object?.leaf ? LeafOp.fromAmino(object.leaf) : undefined, - path: Array.isArray(object?.path) ? object.path.map((e: any) => e) : [] - }; + const message = createBaseCompressedExistenceProof(); + if (object.key !== undefined && object.key !== null) { + message.key = bytesFromBase64(object.key); + } + if (object.value !== undefined && object.value !== null) { + message.value = bytesFromBase64(object.value); + } + if (object.leaf !== undefined && object.leaf !== null) { + message.leaf = LeafOp.fromAmino(object.leaf); + } + message.path = object.path?.map(e => e) || []; + return message; }, toAmino(message: CompressedExistenceProof): CompressedExistenceProofAmino { const obj: any = {}; - obj.key = message.key; - obj.value = message.value; + obj.key = message.key ? base64FromBytes(message.key) : undefined; + obj.value = message.value ? base64FromBytes(message.value) : undefined; obj.leaf = message.leaf ? LeafOp.toAmino(message.leaf) : undefined; if (message.path) { obj.path = message.path.map(e => e); @@ -1810,8 +1878,8 @@ export const CompressedExistenceProof = { function createBaseCompressedNonExistenceProof(): CompressedNonExistenceProof { return { key: new Uint8Array(), - left: CompressedExistenceProof.fromPartial({}), - right: CompressedExistenceProof.fromPartial({}) + left: undefined, + right: undefined }; } export const CompressedNonExistenceProof = { @@ -1859,15 +1927,21 @@ export const CompressedNonExistenceProof = { return message; }, fromAmino(object: CompressedNonExistenceProofAmino): CompressedNonExistenceProof { - return { - key: object.key, - left: object?.left ? CompressedExistenceProof.fromAmino(object.left) : undefined, - right: object?.right ? CompressedExistenceProof.fromAmino(object.right) : undefined - }; + const message = createBaseCompressedNonExistenceProof(); + if (object.key !== undefined && object.key !== null) { + message.key = bytesFromBase64(object.key); + } + if (object.left !== undefined && object.left !== null) { + message.left = CompressedExistenceProof.fromAmino(object.left); + } + if (object.right !== undefined && object.right !== null) { + message.right = CompressedExistenceProof.fromAmino(object.right); + } + return message; }, toAmino(message: CompressedNonExistenceProof): CompressedNonExistenceProofAmino { const obj: any = {}; - obj.key = message.key; + obj.key = message.key ? base64FromBytes(message.key) : undefined; obj.left = message.left ? CompressedExistenceProof.toAmino(message.left) : undefined; obj.right = message.right ? CompressedExistenceProof.toAmino(message.right) : undefined; return obj; diff --git a/packages/osmo-query/src/codegen/cosmos/app/runtime/v1alpha1/module.ts b/packages/osmo-query/src/codegen/cosmos/app/runtime/v1alpha1/module.ts new file mode 100644 index 000000000..a80100ec3 --- /dev/null +++ b/packages/osmo-query/src/codegen/cosmos/app/runtime/v1alpha1/module.ts @@ -0,0 +1,342 @@ +import { BinaryReader, BinaryWriter } from "../../../../binary"; +/** Module is the config object for the runtime module. */ +export interface Module { + /** app_name is the name of the app. */ + appName: string; + /** + * begin_blockers specifies the module names of begin blockers + * to call in the order in which they should be called. If this is left empty + * no begin blocker will be registered. + */ + beginBlockers: string[]; + /** + * end_blockers specifies the module names of the end blockers + * to call in the order in which they should be called. If this is left empty + * no end blocker will be registered. + */ + endBlockers: string[]; + /** + * init_genesis specifies the module names of init genesis functions + * to call in the order in which they should be called. If this is left empty + * no init genesis function will be registered. + */ + initGenesis: string[]; + /** + * export_genesis specifies the order in which to export module genesis data. + * If this is left empty, the init_genesis order will be used for export genesis + * if it is specified. + */ + exportGenesis: string[]; + /** + * override_store_keys is an optional list of overrides for the module store keys + * to be used in keeper construction. + */ + overrideStoreKeys: StoreKeyConfig[]; +} +export interface ModuleProtoMsg { + typeUrl: "/cosmos.app.runtime.v1alpha1.Module"; + value: Uint8Array; +} +/** Module is the config object for the runtime module. */ +export interface ModuleAmino { + /** app_name is the name of the app. */ + app_name?: string; + /** + * begin_blockers specifies the module names of begin blockers + * to call in the order in which they should be called. If this is left empty + * no begin blocker will be registered. + */ + begin_blockers?: string[]; + /** + * end_blockers specifies the module names of the end blockers + * to call in the order in which they should be called. If this is left empty + * no end blocker will be registered. + */ + end_blockers?: string[]; + /** + * init_genesis specifies the module names of init genesis functions + * to call in the order in which they should be called. If this is left empty + * no init genesis function will be registered. + */ + init_genesis?: string[]; + /** + * export_genesis specifies the order in which to export module genesis data. + * If this is left empty, the init_genesis order will be used for export genesis + * if it is specified. + */ + export_genesis?: string[]; + /** + * override_store_keys is an optional list of overrides for the module store keys + * to be used in keeper construction. + */ + override_store_keys?: StoreKeyConfigAmino[]; +} +export interface ModuleAminoMsg { + type: "cosmos-sdk/Module"; + value: ModuleAmino; +} +/** Module is the config object for the runtime module. */ +export interface ModuleSDKType { + app_name: string; + begin_blockers: string[]; + end_blockers: string[]; + init_genesis: string[]; + export_genesis: string[]; + override_store_keys: StoreKeyConfigSDKType[]; +} +/** + * StoreKeyConfig may be supplied to override the default module store key, which + * is the module name. + */ +export interface StoreKeyConfig { + /** name of the module to override the store key of */ + moduleName: string; + /** the kv store key to use instead of the module name. */ + kvStoreKey: string; +} +export interface StoreKeyConfigProtoMsg { + typeUrl: "/cosmos.app.runtime.v1alpha1.StoreKeyConfig"; + value: Uint8Array; +} +/** + * StoreKeyConfig may be supplied to override the default module store key, which + * is the module name. + */ +export interface StoreKeyConfigAmino { + /** name of the module to override the store key of */ + module_name?: string; + /** the kv store key to use instead of the module name. */ + kv_store_key?: string; +} +export interface StoreKeyConfigAminoMsg { + type: "cosmos-sdk/StoreKeyConfig"; + value: StoreKeyConfigAmino; +} +/** + * StoreKeyConfig may be supplied to override the default module store key, which + * is the module name. + */ +export interface StoreKeyConfigSDKType { + module_name: string; + kv_store_key: string; +} +function createBaseModule(): Module { + return { + appName: "", + beginBlockers: [], + endBlockers: [], + initGenesis: [], + exportGenesis: [], + overrideStoreKeys: [] + }; +} +export const Module = { + typeUrl: "/cosmos.app.runtime.v1alpha1.Module", + encode(message: Module, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.appName !== "") { + writer.uint32(10).string(message.appName); + } + for (const v of message.beginBlockers) { + writer.uint32(18).string(v!); + } + for (const v of message.endBlockers) { + writer.uint32(26).string(v!); + } + for (const v of message.initGenesis) { + writer.uint32(34).string(v!); + } + for (const v of message.exportGenesis) { + writer.uint32(42).string(v!); + } + for (const v of message.overrideStoreKeys) { + StoreKeyConfig.encode(v!, writer.uint32(50).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): Module { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseModule(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.appName = reader.string(); + break; + case 2: + message.beginBlockers.push(reader.string()); + break; + case 3: + message.endBlockers.push(reader.string()); + break; + case 4: + message.initGenesis.push(reader.string()); + break; + case 5: + message.exportGenesis.push(reader.string()); + break; + case 6: + message.overrideStoreKeys.push(StoreKeyConfig.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): Module { + const message = createBaseModule(); + message.appName = object.appName ?? ""; + message.beginBlockers = object.beginBlockers?.map(e => e) || []; + message.endBlockers = object.endBlockers?.map(e => e) || []; + message.initGenesis = object.initGenesis?.map(e => e) || []; + message.exportGenesis = object.exportGenesis?.map(e => e) || []; + message.overrideStoreKeys = object.overrideStoreKeys?.map(e => StoreKeyConfig.fromPartial(e)) || []; + return message; + }, + fromAmino(object: ModuleAmino): Module { + const message = createBaseModule(); + if (object.app_name !== undefined && object.app_name !== null) { + message.appName = object.app_name; + } + message.beginBlockers = object.begin_blockers?.map(e => e) || []; + message.endBlockers = object.end_blockers?.map(e => e) || []; + message.initGenesis = object.init_genesis?.map(e => e) || []; + message.exportGenesis = object.export_genesis?.map(e => e) || []; + message.overrideStoreKeys = object.override_store_keys?.map(e => StoreKeyConfig.fromAmino(e)) || []; + return message; + }, + toAmino(message: Module): ModuleAmino { + const obj: any = {}; + obj.app_name = message.appName; + if (message.beginBlockers) { + obj.begin_blockers = message.beginBlockers.map(e => e); + } else { + obj.begin_blockers = []; + } + if (message.endBlockers) { + obj.end_blockers = message.endBlockers.map(e => e); + } else { + obj.end_blockers = []; + } + if (message.initGenesis) { + obj.init_genesis = message.initGenesis.map(e => e); + } else { + obj.init_genesis = []; + } + if (message.exportGenesis) { + obj.export_genesis = message.exportGenesis.map(e => e); + } else { + obj.export_genesis = []; + } + if (message.overrideStoreKeys) { + obj.override_store_keys = message.overrideStoreKeys.map(e => e ? StoreKeyConfig.toAmino(e) : undefined); + } else { + obj.override_store_keys = []; + } + return obj; + }, + fromAminoMsg(object: ModuleAminoMsg): Module { + return Module.fromAmino(object.value); + }, + toAminoMsg(message: Module): ModuleAminoMsg { + return { + type: "cosmos-sdk/Module", + value: Module.toAmino(message) + }; + }, + fromProtoMsg(message: ModuleProtoMsg): Module { + return Module.decode(message.value); + }, + toProto(message: Module): Uint8Array { + return Module.encode(message).finish(); + }, + toProtoMsg(message: Module): ModuleProtoMsg { + return { + typeUrl: "/cosmos.app.runtime.v1alpha1.Module", + value: Module.encode(message).finish() + }; + } +}; +function createBaseStoreKeyConfig(): StoreKeyConfig { + return { + moduleName: "", + kvStoreKey: "" + }; +} +export const StoreKeyConfig = { + typeUrl: "/cosmos.app.runtime.v1alpha1.StoreKeyConfig", + encode(message: StoreKeyConfig, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.moduleName !== "") { + writer.uint32(10).string(message.moduleName); + } + if (message.kvStoreKey !== "") { + writer.uint32(18).string(message.kvStoreKey); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): StoreKeyConfig { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseStoreKeyConfig(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.moduleName = reader.string(); + break; + case 2: + message.kvStoreKey = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): StoreKeyConfig { + const message = createBaseStoreKeyConfig(); + message.moduleName = object.moduleName ?? ""; + message.kvStoreKey = object.kvStoreKey ?? ""; + return message; + }, + fromAmino(object: StoreKeyConfigAmino): StoreKeyConfig { + const message = createBaseStoreKeyConfig(); + if (object.module_name !== undefined && object.module_name !== null) { + message.moduleName = object.module_name; + } + if (object.kv_store_key !== undefined && object.kv_store_key !== null) { + message.kvStoreKey = object.kv_store_key; + } + return message; + }, + toAmino(message: StoreKeyConfig): StoreKeyConfigAmino { + const obj: any = {}; + obj.module_name = message.moduleName; + obj.kv_store_key = message.kvStoreKey; + return obj; + }, + fromAminoMsg(object: StoreKeyConfigAminoMsg): StoreKeyConfig { + return StoreKeyConfig.fromAmino(object.value); + }, + toAminoMsg(message: StoreKeyConfig): StoreKeyConfigAminoMsg { + return { + type: "cosmos-sdk/StoreKeyConfig", + value: StoreKeyConfig.toAmino(message) + }; + }, + fromProtoMsg(message: StoreKeyConfigProtoMsg): StoreKeyConfig { + return StoreKeyConfig.decode(message.value); + }, + toProto(message: StoreKeyConfig): Uint8Array { + return StoreKeyConfig.encode(message).finish(); + }, + toProtoMsg(message: StoreKeyConfig): StoreKeyConfigProtoMsg { + return { + typeUrl: "/cosmos.app.runtime.v1alpha1.StoreKeyConfig", + value: StoreKeyConfig.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/packages/osmo-query/src/codegen/cosmos/app/v1alpha1/module.ts b/packages/osmo-query/src/codegen/cosmos/app/v1alpha1/module.ts new file mode 100644 index 000000000..49b442180 --- /dev/null +++ b/packages/osmo-query/src/codegen/cosmos/app/v1alpha1/module.ts @@ -0,0 +1,450 @@ +import { BinaryReader, BinaryWriter } from "../../../binary"; +/** ModuleDescriptor describes an app module. */ +export interface ModuleDescriptor { + /** + * go_import names the package that should be imported by an app to load the + * module in the runtime module registry. It is required to make debugging + * of configuration errors easier for users. + */ + goImport: string; + /** + * use_package refers to a protobuf package that this module + * uses and exposes to the world. In an app, only one module should "use" + * or own a single protobuf package. It is assumed that the module uses + * all of the .proto files in a single package. + */ + usePackage: PackageReference[]; + /** + * can_migrate_from defines which module versions this module can migrate + * state from. The framework will check that one module version is able to + * migrate from a previous module version before attempting to update its + * config. It is assumed that modules can transitively migrate from earlier + * versions. For instance if v3 declares it can migrate from v2, and v2 + * declares it can migrate from v1, the framework knows how to migrate + * from v1 to v3, assuming all 3 module versions are registered at runtime. + */ + canMigrateFrom: MigrateFromInfo[]; +} +export interface ModuleDescriptorProtoMsg { + typeUrl: "/cosmos.app.v1alpha1.ModuleDescriptor"; + value: Uint8Array; +} +/** ModuleDescriptor describes an app module. */ +export interface ModuleDescriptorAmino { + /** + * go_import names the package that should be imported by an app to load the + * module in the runtime module registry. It is required to make debugging + * of configuration errors easier for users. + */ + go_import?: string; + /** + * use_package refers to a protobuf package that this module + * uses and exposes to the world. In an app, only one module should "use" + * or own a single protobuf package. It is assumed that the module uses + * all of the .proto files in a single package. + */ + use_package?: PackageReferenceAmino[]; + /** + * can_migrate_from defines which module versions this module can migrate + * state from. The framework will check that one module version is able to + * migrate from a previous module version before attempting to update its + * config. It is assumed that modules can transitively migrate from earlier + * versions. For instance if v3 declares it can migrate from v2, and v2 + * declares it can migrate from v1, the framework knows how to migrate + * from v1 to v3, assuming all 3 module versions are registered at runtime. + */ + can_migrate_from?: MigrateFromInfoAmino[]; +} +export interface ModuleDescriptorAminoMsg { + type: "cosmos-sdk/ModuleDescriptor"; + value: ModuleDescriptorAmino; +} +/** ModuleDescriptor describes an app module. */ +export interface ModuleDescriptorSDKType { + go_import: string; + use_package: PackageReferenceSDKType[]; + can_migrate_from: MigrateFromInfoSDKType[]; +} +/** PackageReference is a reference to a protobuf package used by a module. */ +export interface PackageReference { + /** name is the fully-qualified name of the package. */ + name: string; + /** + * revision is the optional revision of the package that is being used. + * Protobuf packages used in Cosmos should generally have a major version + * as the last part of the package name, ex. foo.bar.baz.v1. + * The revision of a package can be thought of as the minor version of a + * package which has additional backwards compatible definitions that weren't + * present in a previous version. + * + * A package should indicate its revision with a source code comment + * above the package declaration in one of its files containing the + * text "Revision N" where N is an integer revision. All packages start + * at revision 0 the first time they are released in a module. + * + * When a new version of a module is released and items are added to existing + * .proto files, these definitions should contain comments of the form + * "Since Revision N" where N is an integer revision. + * + * When the module runtime starts up, it will check the pinned proto + * image and panic if there are runtime protobuf definitions that are not + * in the pinned descriptor which do not have + * a "Since Revision N" comment or have a "Since Revision N" comment where + * N is <= to the revision specified here. This indicates that the protobuf + * files have been updated, but the pinned file descriptor hasn't. + * + * If there are items in the pinned file descriptor with a revision + * greater than the value indicated here, this will also cause a panic + * as it may mean that the pinned descriptor for a legacy module has been + * improperly updated or that there is some other versioning discrepancy. + * Runtime protobuf definitions will also be checked for compatibility + * with pinned file descriptors to make sure there are no incompatible changes. + * + * This behavior ensures that: + * * pinned proto images are up-to-date + * * protobuf files are carefully annotated with revision comments which + * are important good client UX + * * protobuf files are changed in backwards and forwards compatible ways + */ + revision: number; +} +export interface PackageReferenceProtoMsg { + typeUrl: "/cosmos.app.v1alpha1.PackageReference"; + value: Uint8Array; +} +/** PackageReference is a reference to a protobuf package used by a module. */ +export interface PackageReferenceAmino { + /** name is the fully-qualified name of the package. */ + name?: string; + /** + * revision is the optional revision of the package that is being used. + * Protobuf packages used in Cosmos should generally have a major version + * as the last part of the package name, ex. foo.bar.baz.v1. + * The revision of a package can be thought of as the minor version of a + * package which has additional backwards compatible definitions that weren't + * present in a previous version. + * + * A package should indicate its revision with a source code comment + * above the package declaration in one of its files containing the + * text "Revision N" where N is an integer revision. All packages start + * at revision 0 the first time they are released in a module. + * + * When a new version of a module is released and items are added to existing + * .proto files, these definitions should contain comments of the form + * "Since Revision N" where N is an integer revision. + * + * When the module runtime starts up, it will check the pinned proto + * image and panic if there are runtime protobuf definitions that are not + * in the pinned descriptor which do not have + * a "Since Revision N" comment or have a "Since Revision N" comment where + * N is <= to the revision specified here. This indicates that the protobuf + * files have been updated, but the pinned file descriptor hasn't. + * + * If there are items in the pinned file descriptor with a revision + * greater than the value indicated here, this will also cause a panic + * as it may mean that the pinned descriptor for a legacy module has been + * improperly updated or that there is some other versioning discrepancy. + * Runtime protobuf definitions will also be checked for compatibility + * with pinned file descriptors to make sure there are no incompatible changes. + * + * This behavior ensures that: + * * pinned proto images are up-to-date + * * protobuf files are carefully annotated with revision comments which + * are important good client UX + * * protobuf files are changed in backwards and forwards compatible ways + */ + revision?: number; +} +export interface PackageReferenceAminoMsg { + type: "cosmos-sdk/PackageReference"; + value: PackageReferenceAmino; +} +/** PackageReference is a reference to a protobuf package used by a module. */ +export interface PackageReferenceSDKType { + name: string; + revision: number; +} +/** + * MigrateFromInfo is information on a module version that a newer module + * can migrate from. + */ +export interface MigrateFromInfo { + /** + * module is the fully-qualified protobuf name of the module config object + * for the previous module version, ex: "cosmos.group.module.v1.Module". + */ + module: string; +} +export interface MigrateFromInfoProtoMsg { + typeUrl: "/cosmos.app.v1alpha1.MigrateFromInfo"; + value: Uint8Array; +} +/** + * MigrateFromInfo is information on a module version that a newer module + * can migrate from. + */ +export interface MigrateFromInfoAmino { + /** + * module is the fully-qualified protobuf name of the module config object + * for the previous module version, ex: "cosmos.group.module.v1.Module". + */ + module?: string; +} +export interface MigrateFromInfoAminoMsg { + type: "cosmos-sdk/MigrateFromInfo"; + value: MigrateFromInfoAmino; +} +/** + * MigrateFromInfo is information on a module version that a newer module + * can migrate from. + */ +export interface MigrateFromInfoSDKType { + module: string; +} +function createBaseModuleDescriptor(): ModuleDescriptor { + return { + goImport: "", + usePackage: [], + canMigrateFrom: [] + }; +} +export const ModuleDescriptor = { + typeUrl: "/cosmos.app.v1alpha1.ModuleDescriptor", + encode(message: ModuleDescriptor, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.goImport !== "") { + writer.uint32(10).string(message.goImport); + } + for (const v of message.usePackage) { + PackageReference.encode(v!, writer.uint32(18).fork()).ldelim(); + } + for (const v of message.canMigrateFrom) { + MigrateFromInfo.encode(v!, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): ModuleDescriptor { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseModuleDescriptor(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.goImport = reader.string(); + break; + case 2: + message.usePackage.push(PackageReference.decode(reader, reader.uint32())); + break; + case 3: + message.canMigrateFrom.push(MigrateFromInfo.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): ModuleDescriptor { + const message = createBaseModuleDescriptor(); + message.goImport = object.goImport ?? ""; + message.usePackage = object.usePackage?.map(e => PackageReference.fromPartial(e)) || []; + message.canMigrateFrom = object.canMigrateFrom?.map(e => MigrateFromInfo.fromPartial(e)) || []; + return message; + }, + fromAmino(object: ModuleDescriptorAmino): ModuleDescriptor { + const message = createBaseModuleDescriptor(); + if (object.go_import !== undefined && object.go_import !== null) { + message.goImport = object.go_import; + } + message.usePackage = object.use_package?.map(e => PackageReference.fromAmino(e)) || []; + message.canMigrateFrom = object.can_migrate_from?.map(e => MigrateFromInfo.fromAmino(e)) || []; + return message; + }, + toAmino(message: ModuleDescriptor): ModuleDescriptorAmino { + const obj: any = {}; + obj.go_import = message.goImport; + if (message.usePackage) { + obj.use_package = message.usePackage.map(e => e ? PackageReference.toAmino(e) : undefined); + } else { + obj.use_package = []; + } + if (message.canMigrateFrom) { + obj.can_migrate_from = message.canMigrateFrom.map(e => e ? MigrateFromInfo.toAmino(e) : undefined); + } else { + obj.can_migrate_from = []; + } + return obj; + }, + fromAminoMsg(object: ModuleDescriptorAminoMsg): ModuleDescriptor { + return ModuleDescriptor.fromAmino(object.value); + }, + toAminoMsg(message: ModuleDescriptor): ModuleDescriptorAminoMsg { + return { + type: "cosmos-sdk/ModuleDescriptor", + value: ModuleDescriptor.toAmino(message) + }; + }, + fromProtoMsg(message: ModuleDescriptorProtoMsg): ModuleDescriptor { + return ModuleDescriptor.decode(message.value); + }, + toProto(message: ModuleDescriptor): Uint8Array { + return ModuleDescriptor.encode(message).finish(); + }, + toProtoMsg(message: ModuleDescriptor): ModuleDescriptorProtoMsg { + return { + typeUrl: "/cosmos.app.v1alpha1.ModuleDescriptor", + value: ModuleDescriptor.encode(message).finish() + }; + } +}; +function createBasePackageReference(): PackageReference { + return { + name: "", + revision: 0 + }; +} +export const PackageReference = { + typeUrl: "/cosmos.app.v1alpha1.PackageReference", + encode(message: PackageReference, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.name !== "") { + writer.uint32(10).string(message.name); + } + if (message.revision !== 0) { + writer.uint32(16).uint32(message.revision); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): PackageReference { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBasePackageReference(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.revision = reader.uint32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): PackageReference { + const message = createBasePackageReference(); + message.name = object.name ?? ""; + message.revision = object.revision ?? 0; + return message; + }, + fromAmino(object: PackageReferenceAmino): PackageReference { + const message = createBasePackageReference(); + if (object.name !== undefined && object.name !== null) { + message.name = object.name; + } + if (object.revision !== undefined && object.revision !== null) { + message.revision = object.revision; + } + return message; + }, + toAmino(message: PackageReference): PackageReferenceAmino { + const obj: any = {}; + obj.name = message.name; + obj.revision = message.revision; + return obj; + }, + fromAminoMsg(object: PackageReferenceAminoMsg): PackageReference { + return PackageReference.fromAmino(object.value); + }, + toAminoMsg(message: PackageReference): PackageReferenceAminoMsg { + return { + type: "cosmos-sdk/PackageReference", + value: PackageReference.toAmino(message) + }; + }, + fromProtoMsg(message: PackageReferenceProtoMsg): PackageReference { + return PackageReference.decode(message.value); + }, + toProto(message: PackageReference): Uint8Array { + return PackageReference.encode(message).finish(); + }, + toProtoMsg(message: PackageReference): PackageReferenceProtoMsg { + return { + typeUrl: "/cosmos.app.v1alpha1.PackageReference", + value: PackageReference.encode(message).finish() + }; + } +}; +function createBaseMigrateFromInfo(): MigrateFromInfo { + return { + module: "" + }; +} +export const MigrateFromInfo = { + typeUrl: "/cosmos.app.v1alpha1.MigrateFromInfo", + encode(message: MigrateFromInfo, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.module !== "") { + writer.uint32(10).string(message.module); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MigrateFromInfo { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMigrateFromInfo(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.module = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MigrateFromInfo { + const message = createBaseMigrateFromInfo(); + message.module = object.module ?? ""; + return message; + }, + fromAmino(object: MigrateFromInfoAmino): MigrateFromInfo { + const message = createBaseMigrateFromInfo(); + if (object.module !== undefined && object.module !== null) { + message.module = object.module; + } + return message; + }, + toAmino(message: MigrateFromInfo): MigrateFromInfoAmino { + const obj: any = {}; + obj.module = message.module; + return obj; + }, + fromAminoMsg(object: MigrateFromInfoAminoMsg): MigrateFromInfo { + return MigrateFromInfo.fromAmino(object.value); + }, + toAminoMsg(message: MigrateFromInfo): MigrateFromInfoAminoMsg { + return { + type: "cosmos-sdk/MigrateFromInfo", + value: MigrateFromInfo.toAmino(message) + }; + }, + fromProtoMsg(message: MigrateFromInfoProtoMsg): MigrateFromInfo { + return MigrateFromInfo.decode(message.value); + }, + toProto(message: MigrateFromInfo): Uint8Array { + return MigrateFromInfo.encode(message).finish(); + }, + toProtoMsg(message: MigrateFromInfo): MigrateFromInfoProtoMsg { + return { + typeUrl: "/cosmos.app.v1alpha1.MigrateFromInfo", + value: MigrateFromInfo.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/packages/osmo-query/src/codegen/cosmos/auth/v1beta1/auth.ts b/packages/osmo-query/src/codegen/cosmos/auth/v1beta1/auth.ts index a09d9a80a..929d65a25 100644 --- a/packages/osmo-query/src/codegen/cosmos/auth/v1beta1/auth.ts +++ b/packages/osmo-query/src/codegen/cosmos/auth/v1beta1/auth.ts @@ -1,14 +1,15 @@ import { Any, AnyAmino, AnySDKType } from "../../../google/protobuf/any"; import { BinaryReader, BinaryWriter } from "../../../binary"; +import { bytesFromBase64, base64FromBytes } from "../../../helpers"; /** * BaseAccount defines a base account type. It contains all the necessary fields * for basic account functionality. Any custom account type should extend this * type for additional functionality (e.g. vesting). */ export interface BaseAccount { - $typeUrl?: string; + $typeUrl?: "/cosmos.auth.v1beta1.BaseAccount"; address: string; - pubKey: Any; + pubKey?: Any; accountNumber: bigint; sequence: bigint; } @@ -22,10 +23,10 @@ export interface BaseAccountProtoMsg { * type for additional functionality (e.g. vesting). */ export interface BaseAccountAmino { - address: string; + address?: string; pub_key?: AnyAmino; - account_number: string; - sequence: string; + account_number?: string; + sequence?: string; } export interface BaseAccountAminoMsg { type: "cosmos-sdk/BaseAccount"; @@ -37,16 +38,16 @@ export interface BaseAccountAminoMsg { * type for additional functionality (e.g. vesting). */ export interface BaseAccountSDKType { - $typeUrl?: string; + $typeUrl?: "/cosmos.auth.v1beta1.BaseAccount"; address: string; - pub_key: AnySDKType; + pub_key?: AnySDKType; account_number: bigint; sequence: bigint; } /** ModuleAccount defines an account for modules that holds coins on a pool. */ export interface ModuleAccount { - $typeUrl?: string; - baseAccount: BaseAccount; + $typeUrl?: "/cosmos.auth.v1beta1.ModuleAccount"; + baseAccount?: BaseAccount; name: string; permissions: string[]; } @@ -57,8 +58,8 @@ export interface ModuleAccountProtoMsg { /** ModuleAccount defines an account for modules that holds coins on a pool. */ export interface ModuleAccountAmino { base_account?: BaseAccountAmino; - name: string; - permissions: string[]; + name?: string; + permissions?: string[]; } export interface ModuleAccountAminoMsg { type: "cosmos-sdk/ModuleAccount"; @@ -66,11 +67,56 @@ export interface ModuleAccountAminoMsg { } /** ModuleAccount defines an account for modules that holds coins on a pool. */ export interface ModuleAccountSDKType { - $typeUrl?: string; - base_account: BaseAccountSDKType; + $typeUrl?: "/cosmos.auth.v1beta1.ModuleAccount"; + base_account?: BaseAccountSDKType; name: string; permissions: string[]; } +/** + * ModuleCredential represents a unclaimable pubkey for base accounts controlled by modules. + * + * Since: cosmos-sdk 0.47 + */ +export interface ModuleCredential { + /** module_name is the name of the module used for address derivation (passed into address.Module). */ + moduleName: string; + /** + * derivation_keys is for deriving a module account address (passed into address.Module) + * adding more keys creates sub-account addresses (passed into address.Derive) + */ + derivationKeys: Uint8Array[]; +} +export interface ModuleCredentialProtoMsg { + typeUrl: "/cosmos.auth.v1beta1.ModuleCredential"; + value: Uint8Array; +} +/** + * ModuleCredential represents a unclaimable pubkey for base accounts controlled by modules. + * + * Since: cosmos-sdk 0.47 + */ +export interface ModuleCredentialAmino { + /** module_name is the name of the module used for address derivation (passed into address.Module). */ + module_name?: string; + /** + * derivation_keys is for deriving a module account address (passed into address.Module) + * adding more keys creates sub-account addresses (passed into address.Derive) + */ + derivation_keys?: string[]; +} +export interface ModuleCredentialAminoMsg { + type: "cosmos-sdk/ModuleCredential"; + value: ModuleCredentialAmino; +} +/** + * ModuleCredential represents a unclaimable pubkey for base accounts controlled by modules. + * + * Since: cosmos-sdk 0.47 + */ +export interface ModuleCredentialSDKType { + module_name: string; + derivation_keys: Uint8Array[]; +} /** Params defines the parameters for the auth module. */ export interface Params { maxMemoCharacters: bigint; @@ -85,11 +131,11 @@ export interface ParamsProtoMsg { } /** Params defines the parameters for the auth module. */ export interface ParamsAmino { - max_memo_characters: string; - tx_sig_limit: string; - tx_size_cost_per_byte: string; - sig_verify_cost_ed25519: string; - sig_verify_cost_secp256k1: string; + max_memo_characters?: string; + tx_sig_limit?: string; + tx_size_cost_per_byte?: string; + sig_verify_cost_ed25519?: string; + sig_verify_cost_secp256k1?: string; } export interface ParamsAminoMsg { type: "cosmos-sdk/x/auth/Params"; @@ -107,7 +153,7 @@ function createBaseBaseAccount(): BaseAccount { return { $typeUrl: "/cosmos.auth.v1beta1.BaseAccount", address: "", - pubKey: Any.fromPartial({}), + pubKey: undefined, accountNumber: BigInt(0), sequence: BigInt(0) }; @@ -164,12 +210,20 @@ export const BaseAccount = { return message; }, fromAmino(object: BaseAccountAmino): BaseAccount { - return { - address: object.address, - pubKey: object?.pub_key ? Any.fromAmino(object.pub_key) : undefined, - accountNumber: BigInt(object.account_number), - sequence: BigInt(object.sequence) - }; + const message = createBaseBaseAccount(); + if (object.address !== undefined && object.address !== null) { + message.address = object.address; + } + if (object.pub_key !== undefined && object.pub_key !== null) { + message.pubKey = Any.fromAmino(object.pub_key); + } + if (object.account_number !== undefined && object.account_number !== null) { + message.accountNumber = BigInt(object.account_number); + } + if (object.sequence !== undefined && object.sequence !== null) { + message.sequence = BigInt(object.sequence); + } + return message; }, toAmino(message: BaseAccount): BaseAccountAmino { const obj: any = {}; @@ -204,7 +258,7 @@ export const BaseAccount = { function createBaseModuleAccount(): ModuleAccount { return { $typeUrl: "/cosmos.auth.v1beta1.ModuleAccount", - baseAccount: BaseAccount.fromPartial({}), + baseAccount: undefined, name: "", permissions: [] }; @@ -254,11 +308,15 @@ export const ModuleAccount = { return message; }, fromAmino(object: ModuleAccountAmino): ModuleAccount { - return { - baseAccount: object?.base_account ? BaseAccount.fromAmino(object.base_account) : undefined, - name: object.name, - permissions: Array.isArray(object?.permissions) ? object.permissions.map((e: any) => e) : [] - }; + const message = createBaseModuleAccount(); + if (object.base_account !== undefined && object.base_account !== null) { + message.baseAccount = BaseAccount.fromAmino(object.base_account); + } + if (object.name !== undefined && object.name !== null) { + message.name = object.name; + } + message.permissions = object.permissions?.map(e => e) || []; + return message; }, toAmino(message: ModuleAccount): ModuleAccountAmino { const obj: any = {}; @@ -293,6 +351,89 @@ export const ModuleAccount = { }; } }; +function createBaseModuleCredential(): ModuleCredential { + return { + moduleName: "", + derivationKeys: [] + }; +} +export const ModuleCredential = { + typeUrl: "/cosmos.auth.v1beta1.ModuleCredential", + encode(message: ModuleCredential, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.moduleName !== "") { + writer.uint32(10).string(message.moduleName); + } + for (const v of message.derivationKeys) { + writer.uint32(18).bytes(v!); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): ModuleCredential { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseModuleCredential(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.moduleName = reader.string(); + break; + case 2: + message.derivationKeys.push(reader.bytes()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): ModuleCredential { + const message = createBaseModuleCredential(); + message.moduleName = object.moduleName ?? ""; + message.derivationKeys = object.derivationKeys?.map(e => e) || []; + return message; + }, + fromAmino(object: ModuleCredentialAmino): ModuleCredential { + const message = createBaseModuleCredential(); + if (object.module_name !== undefined && object.module_name !== null) { + message.moduleName = object.module_name; + } + message.derivationKeys = object.derivation_keys?.map(e => bytesFromBase64(e)) || []; + return message; + }, + toAmino(message: ModuleCredential): ModuleCredentialAmino { + const obj: any = {}; + obj.module_name = message.moduleName; + if (message.derivationKeys) { + obj.derivation_keys = message.derivationKeys.map(e => base64FromBytes(e)); + } else { + obj.derivation_keys = []; + } + return obj; + }, + fromAminoMsg(object: ModuleCredentialAminoMsg): ModuleCredential { + return ModuleCredential.fromAmino(object.value); + }, + toAminoMsg(message: ModuleCredential): ModuleCredentialAminoMsg { + return { + type: "cosmos-sdk/ModuleCredential", + value: ModuleCredential.toAmino(message) + }; + }, + fromProtoMsg(message: ModuleCredentialProtoMsg): ModuleCredential { + return ModuleCredential.decode(message.value); + }, + toProto(message: ModuleCredential): Uint8Array { + return ModuleCredential.encode(message).finish(); + }, + toProtoMsg(message: ModuleCredential): ModuleCredentialProtoMsg { + return { + typeUrl: "/cosmos.auth.v1beta1.ModuleCredential", + value: ModuleCredential.encode(message).finish() + }; + } +}; function createBaseParams(): Params { return { maxMemoCharacters: BigInt(0), @@ -361,13 +502,23 @@ export const Params = { return message; }, fromAmino(object: ParamsAmino): Params { - return { - maxMemoCharacters: BigInt(object.max_memo_characters), - txSigLimit: BigInt(object.tx_sig_limit), - txSizeCostPerByte: BigInt(object.tx_size_cost_per_byte), - sigVerifyCostEd25519: BigInt(object.sig_verify_cost_ed25519), - sigVerifyCostSecp256k1: BigInt(object.sig_verify_cost_secp256k1) - }; + const message = createBaseParams(); + if (object.max_memo_characters !== undefined && object.max_memo_characters !== null) { + message.maxMemoCharacters = BigInt(object.max_memo_characters); + } + if (object.tx_sig_limit !== undefined && object.tx_sig_limit !== null) { + message.txSigLimit = BigInt(object.tx_sig_limit); + } + if (object.tx_size_cost_per_byte !== undefined && object.tx_size_cost_per_byte !== null) { + message.txSizeCostPerByte = BigInt(object.tx_size_cost_per_byte); + } + if (object.sig_verify_cost_ed25519 !== undefined && object.sig_verify_cost_ed25519 !== null) { + message.sigVerifyCostEd25519 = BigInt(object.sig_verify_cost_ed25519); + } + if (object.sig_verify_cost_secp256k1 !== undefined && object.sig_verify_cost_secp256k1 !== null) { + message.sigVerifyCostSecp256k1 = BigInt(object.sig_verify_cost_secp256k1); + } + return message; }, toAmino(message: Params): ParamsAmino { const obj: any = {}; diff --git a/packages/osmo-query/src/codegen/cosmos/auth/v1beta1/genesis.ts b/packages/osmo-query/src/codegen/cosmos/auth/v1beta1/genesis.ts index e1d6676b5..38ef80438 100644 --- a/packages/osmo-query/src/codegen/cosmos/auth/v1beta1/genesis.ts +++ b/packages/osmo-query/src/codegen/cosmos/auth/v1beta1/genesis.ts @@ -3,7 +3,7 @@ import { Any, AnyAmino, AnySDKType } from "../../../google/protobuf/any"; import { BinaryReader, BinaryWriter } from "../../../binary"; /** GenesisState defines the auth module's genesis state. */ export interface GenesisState { - /** params defines all the paramaters of the module. */ + /** params defines all the parameters of the module. */ params: Params; /** accounts are the accounts present at genesis. */ accounts: Any[]; @@ -14,10 +14,10 @@ export interface GenesisStateProtoMsg { } /** GenesisState defines the auth module's genesis state. */ export interface GenesisStateAmino { - /** params defines all the paramaters of the module. */ - params?: ParamsAmino; + /** params defines all the parameters of the module. */ + params: ParamsAmino; /** accounts are the accounts present at genesis. */ - accounts: AnyAmino[]; + accounts?: AnyAmino[]; } export interface GenesisStateAminoMsg { type: "cosmos-sdk/GenesisState"; @@ -72,14 +72,16 @@ export const GenesisState = { return message; }, fromAmino(object: GenesisStateAmino): GenesisState { - return { - params: object?.params ? Params.fromAmino(object.params) : undefined, - accounts: Array.isArray(object?.accounts) ? object.accounts.map((e: any) => Any.fromAmino(e)) : [] - }; + const message = createBaseGenesisState(); + if (object.params !== undefined && object.params !== null) { + message.params = Params.fromAmino(object.params); + } + message.accounts = object.accounts?.map(e => Any.fromAmino(e)) || []; + return message; }, toAmino(message: GenesisState): GenesisStateAmino { const obj: any = {}; - obj.params = message.params ? Params.toAmino(message.params) : undefined; + obj.params = message.params ? Params.toAmino(message.params) : Params.fromPartial({}); if (message.accounts) { obj.accounts = message.accounts.map(e => e ? Any.toAmino(e) : undefined); } else { diff --git a/packages/osmo-query/src/codegen/cosmos/auth/v1beta1/query.lcd.ts b/packages/osmo-query/src/codegen/cosmos/auth/v1beta1/query.lcd.ts index 46230b530..e6507b9db 100644 --- a/packages/osmo-query/src/codegen/cosmos/auth/v1beta1/query.lcd.ts +++ b/packages/osmo-query/src/codegen/cosmos/auth/v1beta1/query.lcd.ts @@ -1,6 +1,6 @@ import { setPaginationParams } from "../../../helpers"; import { LCDClient } from "@cosmology/lcd"; -import { QueryAccountsRequest, QueryAccountsResponseSDKType, QueryAccountRequest, QueryAccountResponseSDKType, QueryParamsRequest, QueryParamsResponseSDKType, QueryModuleAccountsRequest, QueryModuleAccountsResponseSDKType } from "./query"; +import { QueryAccountsRequest, QueryAccountsResponseSDKType, QueryAccountRequest, QueryAccountResponseSDKType, QueryAccountAddressByIDRequest, QueryAccountAddressByIDResponseSDKType, QueryParamsRequest, QueryParamsResponseSDKType, QueryModuleAccountsRequest, QueryModuleAccountsResponseSDKType, QueryModuleAccountByNameRequest, QueryModuleAccountByNameResponseSDKType, Bech32PrefixRequest, Bech32PrefixResponseSDKType, AddressBytesToStringRequest, AddressBytesToStringResponseSDKType, AddressStringToBytesRequest, AddressStringToBytesResponseSDKType, QueryAccountInfoRequest, QueryAccountInfoResponseSDKType } from "./query"; export class LCDQueryClient { req: LCDClient; constructor({ @@ -11,10 +11,19 @@ export class LCDQueryClient { this.req = requestClient; this.accounts = this.accounts.bind(this); this.account = this.account.bind(this); + this.accountAddressByID = this.accountAddressByID.bind(this); this.params = this.params.bind(this); this.moduleAccounts = this.moduleAccounts.bind(this); + this.moduleAccountByName = this.moduleAccountByName.bind(this); + this.bech32Prefix = this.bech32Prefix.bind(this); + this.addressBytesToString = this.addressBytesToString.bind(this); + this.addressStringToBytes = this.addressStringToBytes.bind(this); + this.accountInfo = this.accountInfo.bind(this); } - /* Accounts returns all the existing accounts + /* Accounts returns all the existing accounts. + + When called from another module, this query might consume a high amount of + gas if the pagination field is incorrectly set. Since: cosmos-sdk 0.43 */ async accounts(params: QueryAccountsRequest = { @@ -34,14 +43,62 @@ export class LCDQueryClient { const endpoint = `cosmos/auth/v1beta1/accounts/${params.address}`; return await this.req.get(endpoint); } + /* AccountAddressByID returns account address based on account number. + + Since: cosmos-sdk 0.46.2 */ + async accountAddressByID(params: QueryAccountAddressByIDRequest): Promise { + const options: any = { + params: {} + }; + if (typeof params?.accountId !== "undefined") { + options.params.account_id = params.accountId; + } + const endpoint = `cosmos/auth/v1beta1/address_by_id/${params.id}`; + return await this.req.get(endpoint, options); + } /* Params queries all parameters. */ async params(_params: QueryParamsRequest = {}): Promise { const endpoint = `cosmos/auth/v1beta1/params`; return await this.req.get(endpoint); } - /* ModuleAccounts returns all the existing module accounts. */ + /* ModuleAccounts returns all the existing module accounts. + + Since: cosmos-sdk 0.46 */ async moduleAccounts(_params: QueryModuleAccountsRequest = {}): Promise { const endpoint = `cosmos/auth/v1beta1/module_accounts`; return await this.req.get(endpoint); } + /* ModuleAccountByName returns the module account info by module name */ + async moduleAccountByName(params: QueryModuleAccountByNameRequest): Promise { + const endpoint = `cosmos/auth/v1beta1/module_accounts/${params.name}`; + return await this.req.get(endpoint); + } + /* Bech32Prefix queries bech32Prefix + + Since: cosmos-sdk 0.46 */ + async bech32Prefix(_params: Bech32PrefixRequest = {}): Promise { + const endpoint = `cosmos/auth/v1beta1/bech32`; + return await this.req.get(endpoint); + } + /* AddressBytesToString converts Account Address bytes to string + + Since: cosmos-sdk 0.46 */ + async addressBytesToString(params: AddressBytesToStringRequest): Promise { + const endpoint = `cosmos/auth/v1beta1/bech32/${params.addressBytes}`; + return await this.req.get(endpoint); + } + /* AddressStringToBytes converts Address string to bytes + + Since: cosmos-sdk 0.46 */ + async addressStringToBytes(params: AddressStringToBytesRequest): Promise { + const endpoint = `cosmos/auth/v1beta1/bech32/${params.addressString}`; + return await this.req.get(endpoint); + } + /* AccountInfo queries account info which is common to all account types. + + Since: cosmos-sdk 0.47 */ + async accountInfo(params: QueryAccountInfoRequest): Promise { + const endpoint = `cosmos/auth/v1beta1/account_info/${params.address}`; + return await this.req.get(endpoint); + } } \ No newline at end of file diff --git a/packages/osmo-query/src/codegen/cosmos/auth/v1beta1/query.rpc.Query.ts b/packages/osmo-query/src/codegen/cosmos/auth/v1beta1/query.rpc.Query.ts index 17e8f01a4..404c87f5b 100644 --- a/packages/osmo-query/src/codegen/cosmos/auth/v1beta1/query.rpc.Query.ts +++ b/packages/osmo-query/src/codegen/cosmos/auth/v1beta1/query.rpc.Query.ts @@ -3,21 +3,60 @@ import { BinaryReader } from "../../../binary"; import { QueryClient, createProtobufRpcClient, ProtobufRpcClient } from "@cosmjs/stargate"; import { ReactQueryParams } from "../../../react-query"; import { useQuery } from "@tanstack/react-query"; -import { QueryAccountsRequest, QueryAccountsResponse, QueryAccountRequest, QueryAccountResponse, QueryParamsRequest, QueryParamsResponse, QueryModuleAccountsRequest, QueryModuleAccountsResponse } from "./query"; +import { QueryAccountsRequest, QueryAccountsResponse, QueryAccountRequest, QueryAccountResponse, QueryAccountAddressByIDRequest, QueryAccountAddressByIDResponse, QueryParamsRequest, QueryParamsResponse, QueryModuleAccountsRequest, QueryModuleAccountsResponse, QueryModuleAccountByNameRequest, QueryModuleAccountByNameResponse, Bech32PrefixRequest, Bech32PrefixResponse, AddressBytesToStringRequest, AddressBytesToStringResponse, AddressStringToBytesRequest, AddressStringToBytesResponse, QueryAccountInfoRequest, QueryAccountInfoResponse } from "./query"; /** Query defines the gRPC querier service. */ export interface Query { /** - * Accounts returns all the existing accounts + * Accounts returns all the existing accounts. + * + * When called from another module, this query might consume a high amount of + * gas if the pagination field is incorrectly set. * * Since: cosmos-sdk 0.43 */ accounts(request?: QueryAccountsRequest): Promise; /** Account returns account details based on address. */ account(request: QueryAccountRequest): Promise; + /** + * AccountAddressByID returns account address based on account number. + * + * Since: cosmos-sdk 0.46.2 + */ + accountAddressByID(request: QueryAccountAddressByIDRequest): Promise; /** Params queries all parameters. */ params(request?: QueryParamsRequest): Promise; - /** ModuleAccounts returns all the existing module accounts. */ + /** + * ModuleAccounts returns all the existing module accounts. + * + * Since: cosmos-sdk 0.46 + */ moduleAccounts(request?: QueryModuleAccountsRequest): Promise; + /** ModuleAccountByName returns the module account info by module name */ + moduleAccountByName(request: QueryModuleAccountByNameRequest): Promise; + /** + * Bech32Prefix queries bech32Prefix + * + * Since: cosmos-sdk 0.46 + */ + bech32Prefix(request?: Bech32PrefixRequest): Promise; + /** + * AddressBytesToString converts Account Address bytes to string + * + * Since: cosmos-sdk 0.46 + */ + addressBytesToString(request: AddressBytesToStringRequest): Promise; + /** + * AddressStringToBytes converts Address string to bytes + * + * Since: cosmos-sdk 0.46 + */ + addressStringToBytes(request: AddressStringToBytesRequest): Promise; + /** + * AccountInfo queries account info which is common to all account types. + * + * Since: cosmos-sdk 0.47 + */ + accountInfo(request: QueryAccountInfoRequest): Promise; } export class QueryClientImpl implements Query { private readonly rpc: Rpc; @@ -25,8 +64,14 @@ export class QueryClientImpl implements Query { this.rpc = rpc; this.accounts = this.accounts.bind(this); this.account = this.account.bind(this); + this.accountAddressByID = this.accountAddressByID.bind(this); this.params = this.params.bind(this); this.moduleAccounts = this.moduleAccounts.bind(this); + this.moduleAccountByName = this.moduleAccountByName.bind(this); + this.bech32Prefix = this.bech32Prefix.bind(this); + this.addressBytesToString = this.addressBytesToString.bind(this); + this.addressStringToBytes = this.addressStringToBytes.bind(this); + this.accountInfo = this.accountInfo.bind(this); } accounts(request: QueryAccountsRequest = { pagination: undefined @@ -40,6 +85,11 @@ export class QueryClientImpl implements Query { const promise = this.rpc.request("cosmos.auth.v1beta1.Query", "Account", data); return promise.then(data => QueryAccountResponse.decode(new BinaryReader(data))); } + accountAddressByID(request: QueryAccountAddressByIDRequest): Promise { + const data = QueryAccountAddressByIDRequest.encode(request).finish(); + const promise = this.rpc.request("cosmos.auth.v1beta1.Query", "AccountAddressByID", data); + return promise.then(data => QueryAccountAddressByIDResponse.decode(new BinaryReader(data))); + } params(request: QueryParamsRequest = {}): Promise { const data = QueryParamsRequest.encode(request).finish(); const promise = this.rpc.request("cosmos.auth.v1beta1.Query", "Params", data); @@ -50,6 +100,31 @@ export class QueryClientImpl implements Query { const promise = this.rpc.request("cosmos.auth.v1beta1.Query", "ModuleAccounts", data); return promise.then(data => QueryModuleAccountsResponse.decode(new BinaryReader(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 BinaryReader(data))); + } + bech32Prefix(request: Bech32PrefixRequest = {}): Promise { + const data = Bech32PrefixRequest.encode(request).finish(); + const promise = this.rpc.request("cosmos.auth.v1beta1.Query", "Bech32Prefix", data); + return promise.then(data => Bech32PrefixResponse.decode(new BinaryReader(data))); + } + addressBytesToString(request: AddressBytesToStringRequest): Promise { + const data = AddressBytesToStringRequest.encode(request).finish(); + const promise = this.rpc.request("cosmos.auth.v1beta1.Query", "AddressBytesToString", data); + return promise.then(data => AddressBytesToStringResponse.decode(new BinaryReader(data))); + } + addressStringToBytes(request: AddressStringToBytesRequest): Promise { + const data = AddressStringToBytesRequest.encode(request).finish(); + const promise = this.rpc.request("cosmos.auth.v1beta1.Query", "AddressStringToBytes", data); + return promise.then(data => AddressStringToBytesResponse.decode(new BinaryReader(data))); + } + accountInfo(request: QueryAccountInfoRequest): Promise { + const data = QueryAccountInfoRequest.encode(request).finish(); + const promise = this.rpc.request("cosmos.auth.v1beta1.Query", "AccountInfo", data); + return promise.then(data => QueryAccountInfoResponse.decode(new BinaryReader(data))); + } } export const createRpcQueryExtension = (base: QueryClient) => { const rpc = createProtobufRpcClient(base); @@ -61,11 +136,29 @@ export const createRpcQueryExtension = (base: QueryClient) => { account(request: QueryAccountRequest): Promise { return queryService.account(request); }, + accountAddressByID(request: QueryAccountAddressByIDRequest): Promise { + return queryService.accountAddressByID(request); + }, params(request?: QueryParamsRequest): Promise { return queryService.params(request); }, moduleAccounts(request?: QueryModuleAccountsRequest): Promise { return queryService.moduleAccounts(request); + }, + moduleAccountByName(request: QueryModuleAccountByNameRequest): Promise { + return queryService.moduleAccountByName(request); + }, + bech32Prefix(request?: Bech32PrefixRequest): Promise { + return queryService.bech32Prefix(request); + }, + addressBytesToString(request: AddressBytesToStringRequest): Promise { + return queryService.addressBytesToString(request); + }, + addressStringToBytes(request: AddressStringToBytesRequest): Promise { + return queryService.addressStringToBytes(request); + }, + accountInfo(request: QueryAccountInfoRequest): Promise { + return queryService.accountInfo(request); } }; }; @@ -75,12 +168,30 @@ export interface UseAccountsQuery extends ReactQueryParams extends ReactQueryParams { request: QueryAccountRequest; } +export interface UseAccountAddressByIDQuery extends ReactQueryParams { + request: QueryAccountAddressByIDRequest; +} export interface UseParamsQuery extends ReactQueryParams { request?: QueryParamsRequest; } export interface UseModuleAccountsQuery extends ReactQueryParams { request?: QueryModuleAccountsRequest; } +export interface UseModuleAccountByNameQuery extends ReactQueryParams { + request: QueryModuleAccountByNameRequest; +} +export interface UseBech32PrefixQuery extends ReactQueryParams { + request?: Bech32PrefixRequest; +} +export interface UseAddressBytesToStringQuery extends ReactQueryParams { + request: AddressBytesToStringRequest; +} +export interface UseAddressStringToBytesQuery extends ReactQueryParams { + request: AddressStringToBytesRequest; +} +export interface UseAccountInfoQuery extends ReactQueryParams { + request: QueryAccountInfoRequest; +} const _queryClients: WeakMap = new WeakMap(); const getQueryService = (rpc: ProtobufRpcClient | undefined): QueryClientImpl | undefined => { if (!rpc) return; @@ -111,6 +222,15 @@ export const createRpcQueryHooks = (rpc: ProtobufRpcClient | undefined) => { return queryService.account(request); }, options); }; + const useAccountAddressByID = ({ + request, + options + }: UseAccountAddressByIDQuery) => { + return useQuery(["accountAddressByIDQuery", request], () => { + if (!queryService) throw new Error("Query Service not initialized"); + return queryService.accountAddressByID(request); + }, options); + }; const useParams = ({ request, options @@ -129,15 +249,99 @@ export const createRpcQueryHooks = (rpc: ProtobufRpcClient | undefined) => { return queryService.moduleAccounts(request); }, options); }; + const useModuleAccountByName = ({ + request, + options + }: UseModuleAccountByNameQuery) => { + return useQuery(["moduleAccountByNameQuery", request], () => { + if (!queryService) throw new Error("Query Service not initialized"); + return queryService.moduleAccountByName(request); + }, options); + }; + const useBech32Prefix = ({ + request, + options + }: UseBech32PrefixQuery) => { + return useQuery(["bech32PrefixQuery", request], () => { + if (!queryService) throw new Error("Query Service not initialized"); + return queryService.bech32Prefix(request); + }, options); + }; + const useAddressBytesToString = ({ + request, + options + }: UseAddressBytesToStringQuery) => { + return useQuery(["addressBytesToStringQuery", request], () => { + if (!queryService) throw new Error("Query Service not initialized"); + return queryService.addressBytesToString(request); + }, options); + }; + const useAddressStringToBytes = ({ + request, + options + }: UseAddressStringToBytesQuery) => { + return useQuery(["addressStringToBytesQuery", request], () => { + if (!queryService) throw new Error("Query Service not initialized"); + return queryService.addressStringToBytes(request); + }, options); + }; + const useAccountInfo = ({ + request, + options + }: UseAccountInfoQuery) => { + return useQuery(["accountInfoQuery", request], () => { + if (!queryService) throw new Error("Query Service not initialized"); + return queryService.accountInfo(request); + }, options); + }; return { /** - * Accounts returns all the existing accounts + * Accounts returns all the existing accounts. + * + * When called from another module, this query might consume a high amount of + * gas if the pagination field is incorrectly set. * * Since: cosmos-sdk 0.43 */ useAccounts, /** Account returns account details based on address. */useAccount, + /** + * AccountAddressByID returns account address based on account number. + * + * Since: cosmos-sdk 0.46.2 + */ + useAccountAddressByID, /** Params queries all parameters. */useParams, - /** ModuleAccounts returns all the existing module accounts. */useModuleAccounts + /** + * ModuleAccounts returns all the existing module accounts. + * + * Since: cosmos-sdk 0.46 + */ + useModuleAccounts, + /** ModuleAccountByName returns the module account info by module name */useModuleAccountByName, + /** + * Bech32Prefix queries bech32Prefix + * + * Since: cosmos-sdk 0.46 + */ + useBech32Prefix, + /** + * AddressBytesToString converts Account Address bytes to string + * + * Since: cosmos-sdk 0.46 + */ + useAddressBytesToString, + /** + * AddressStringToBytes converts Address string to bytes + * + * Since: cosmos-sdk 0.46 + */ + useAddressStringToBytes, + /** + * AccountInfo queries account info which is common to all account types. + * + * Since: cosmos-sdk 0.47 + */ + useAccountInfo }; }; \ No newline at end of file diff --git a/packages/osmo-query/src/codegen/cosmos/auth/v1beta1/query.ts b/packages/osmo-query/src/codegen/cosmos/auth/v1beta1/query.ts index 4c39c5fec..7da9dd08a 100644 --- a/packages/osmo-query/src/codegen/cosmos/auth/v1beta1/query.ts +++ b/packages/osmo-query/src/codegen/cosmos/auth/v1beta1/query.ts @@ -1,7 +1,8 @@ import { PageRequest, PageRequestAmino, PageRequestSDKType, PageResponse, PageResponseAmino, PageResponseSDKType } from "../../base/query/v1beta1/pagination"; import { Any, AnyProtoMsg, AnyAmino, AnySDKType } from "../../../google/protobuf/any"; -import { Params, ParamsAmino, ParamsSDKType, BaseAccount, BaseAccountProtoMsg, BaseAccountSDKType, ModuleAccount, ModuleAccountProtoMsg, ModuleAccountSDKType } from "./auth"; +import { Params, ParamsAmino, ParamsSDKType, BaseAccount, BaseAccountProtoMsg, BaseAccountAmino, BaseAccountSDKType, ModuleAccount, ModuleAccountProtoMsg, ModuleAccountSDKType } from "./auth"; import { BinaryReader, BinaryWriter } from "../../../binary"; +import { bytesFromBase64, base64FromBytes } from "../../../helpers"; /** * QueryAccountsRequest is the request type for the Query/Accounts RPC method. * @@ -9,7 +10,7 @@ import { BinaryReader, BinaryWriter } from "../../../binary"; */ export interface QueryAccountsRequest { /** pagination defines an optional pagination for the request. */ - pagination: PageRequest; + pagination?: PageRequest; } export interface QueryAccountsRequestProtoMsg { typeUrl: "/cosmos.auth.v1beta1.QueryAccountsRequest"; @@ -34,7 +35,7 @@ export interface QueryAccountsRequestAminoMsg { * Since: cosmos-sdk 0.43 */ export interface QueryAccountsRequestSDKType { - pagination: PageRequestSDKType; + pagination?: PageRequestSDKType; } /** * QueryAccountsResponse is the response type for the Query/Accounts RPC method. @@ -45,7 +46,7 @@ export interface QueryAccountsResponse { /** accounts are the existing accounts */ accounts: (BaseAccount & Any)[] | Any[]; /** pagination defines the pagination in the response. */ - pagination: PageResponse; + pagination?: PageResponse; } export interface QueryAccountsResponseProtoMsg { typeUrl: "/cosmos.auth.v1beta1.QueryAccountsResponse"; @@ -61,7 +62,7 @@ export type QueryAccountsResponseEncoded = Omit & { accounts: (ModuleAccountProtoMsg | AnyProtoMsg)[]; }; -/** QueryModuleAccountsResponse is the response type for the Query/ModuleAccounts RPC method. */ +/** + * QueryModuleAccountsResponse is the response type for the Query/ModuleAccounts RPC method. + * + * Since: cosmos-sdk 0.46 + */ export interface QueryModuleAccountsResponseAmino { - accounts: AnyAmino[]; + accounts?: AnyAmino[]; } export interface QueryModuleAccountsResponseAminoMsg { type: "cosmos-sdk/QueryModuleAccountsResponse"; value: QueryModuleAccountsResponseAmino; } -/** QueryModuleAccountsResponse is the response type for the Query/ModuleAccounts RPC method. */ +/** + * QueryModuleAccountsResponse is the response type for the Query/ModuleAccounts RPC method. + * + * Since: cosmos-sdk 0.46 + */ export interface QueryModuleAccountsResponseSDKType { accounts: (ModuleAccountSDKType | AnySDKType)[]; } +/** QueryModuleAccountByNameRequest is the request type for the Query/ModuleAccountByName RPC method. */ +export interface QueryModuleAccountByNameRequest { + name: string; +} +export interface QueryModuleAccountByNameRequestProtoMsg { + typeUrl: "/cosmos.auth.v1beta1.QueryModuleAccountByNameRequest"; + value: Uint8Array; +} +/** QueryModuleAccountByNameRequest is the request type for the Query/ModuleAccountByName RPC method. */ +export interface QueryModuleAccountByNameRequestAmino { + name?: string; +} +export interface QueryModuleAccountByNameRequestAminoMsg { + type: "cosmos-sdk/QueryModuleAccountByNameRequest"; + value: QueryModuleAccountByNameRequestAmino; +} +/** QueryModuleAccountByNameRequest is the request type for the Query/ModuleAccountByName RPC method. */ +export interface QueryModuleAccountByNameRequestSDKType { + name: string; +} +/** QueryModuleAccountByNameResponse is the response type for the Query/ModuleAccountByName RPC method. */ +export interface QueryModuleAccountByNameResponse { + account?: (ModuleAccount & Any) | undefined; +} +export interface QueryModuleAccountByNameResponseProtoMsg { + typeUrl: "/cosmos.auth.v1beta1.QueryModuleAccountByNameResponse"; + value: Uint8Array; +} +export type QueryModuleAccountByNameResponseEncoded = Omit & { + account?: ModuleAccountProtoMsg | AnyProtoMsg | undefined; +}; +/** QueryModuleAccountByNameResponse is the response type for the Query/ModuleAccountByName RPC method. */ +export interface QueryModuleAccountByNameResponseAmino { + account?: AnyAmino; +} +export interface QueryModuleAccountByNameResponseAminoMsg { + type: "cosmos-sdk/QueryModuleAccountByNameResponse"; + value: QueryModuleAccountByNameResponseAmino; +} +/** QueryModuleAccountByNameResponse is the response type for the Query/ModuleAccountByName RPC method. */ +export interface QueryModuleAccountByNameResponseSDKType { + account?: ModuleAccountSDKType | AnySDKType | undefined; +} +/** + * Bech32PrefixRequest is the request type for Bech32Prefix rpc method. + * + * Since: cosmos-sdk 0.46 + */ +export interface Bech32PrefixRequest {} +export interface Bech32PrefixRequestProtoMsg { + typeUrl: "/cosmos.auth.v1beta1.Bech32PrefixRequest"; + value: Uint8Array; +} +/** + * Bech32PrefixRequest is the request type for Bech32Prefix rpc method. + * + * Since: cosmos-sdk 0.46 + */ +export interface Bech32PrefixRequestAmino {} +export interface Bech32PrefixRequestAminoMsg { + type: "cosmos-sdk/Bech32PrefixRequest"; + value: Bech32PrefixRequestAmino; +} +/** + * Bech32PrefixRequest is the request type for Bech32Prefix rpc method. + * + * Since: cosmos-sdk 0.46 + */ +export interface Bech32PrefixRequestSDKType {} +/** + * Bech32PrefixResponse is the response type for Bech32Prefix rpc method. + * + * Since: cosmos-sdk 0.46 + */ +export interface Bech32PrefixResponse { + bech32Prefix: string; +} +export interface Bech32PrefixResponseProtoMsg { + typeUrl: "/cosmos.auth.v1beta1.Bech32PrefixResponse"; + value: Uint8Array; +} +/** + * Bech32PrefixResponse is the response type for Bech32Prefix rpc method. + * + * Since: cosmos-sdk 0.46 + */ +export interface Bech32PrefixResponseAmino { + bech32_prefix?: string; +} +export interface Bech32PrefixResponseAminoMsg { + type: "cosmos-sdk/Bech32PrefixResponse"; + value: Bech32PrefixResponseAmino; +} +/** + * Bech32PrefixResponse is the response type for Bech32Prefix rpc method. + * + * Since: cosmos-sdk 0.46 + */ +export interface Bech32PrefixResponseSDKType { + bech32_prefix: string; +} +/** + * AddressBytesToStringRequest is the request type for AddressString rpc method. + * + * Since: cosmos-sdk 0.46 + */ +export interface AddressBytesToStringRequest { + addressBytes: Uint8Array; +} +export interface AddressBytesToStringRequestProtoMsg { + typeUrl: "/cosmos.auth.v1beta1.AddressBytesToStringRequest"; + value: Uint8Array; +} +/** + * AddressBytesToStringRequest is the request type for AddressString rpc method. + * + * Since: cosmos-sdk 0.46 + */ +export interface AddressBytesToStringRequestAmino { + address_bytes?: string; +} +export interface AddressBytesToStringRequestAminoMsg { + type: "cosmos-sdk/AddressBytesToStringRequest"; + value: AddressBytesToStringRequestAmino; +} +/** + * AddressBytesToStringRequest is the request type for AddressString rpc method. + * + * Since: cosmos-sdk 0.46 + */ +export interface AddressBytesToStringRequestSDKType { + address_bytes: Uint8Array; +} +/** + * AddressBytesToStringResponse is the response type for AddressString rpc method. + * + * Since: cosmos-sdk 0.46 + */ +export interface AddressBytesToStringResponse { + addressString: string; +} +export interface AddressBytesToStringResponseProtoMsg { + typeUrl: "/cosmos.auth.v1beta1.AddressBytesToStringResponse"; + value: Uint8Array; +} +/** + * AddressBytesToStringResponse is the response type for AddressString rpc method. + * + * Since: cosmos-sdk 0.46 + */ +export interface AddressBytesToStringResponseAmino { + address_string?: string; +} +export interface AddressBytesToStringResponseAminoMsg { + type: "cosmos-sdk/AddressBytesToStringResponse"; + value: AddressBytesToStringResponseAmino; +} +/** + * AddressBytesToStringResponse is the response type for AddressString rpc method. + * + * Since: cosmos-sdk 0.46 + */ +export interface AddressBytesToStringResponseSDKType { + address_string: string; +} +/** + * AddressStringToBytesRequest is the request type for AccountBytes rpc method. + * + * Since: cosmos-sdk 0.46 + */ +export interface AddressStringToBytesRequest { + addressString: string; +} +export interface AddressStringToBytesRequestProtoMsg { + typeUrl: "/cosmos.auth.v1beta1.AddressStringToBytesRequest"; + value: Uint8Array; +} +/** + * AddressStringToBytesRequest is the request type for AccountBytes rpc method. + * + * Since: cosmos-sdk 0.46 + */ +export interface AddressStringToBytesRequestAmino { + address_string?: string; +} +export interface AddressStringToBytesRequestAminoMsg { + type: "cosmos-sdk/AddressStringToBytesRequest"; + value: AddressStringToBytesRequestAmino; +} +/** + * AddressStringToBytesRequest is the request type for AccountBytes rpc method. + * + * Since: cosmos-sdk 0.46 + */ +export interface AddressStringToBytesRequestSDKType { + address_string: string; +} +/** + * AddressStringToBytesResponse is the response type for AddressBytes rpc method. + * + * Since: cosmos-sdk 0.46 + */ +export interface AddressStringToBytesResponse { + addressBytes: Uint8Array; +} +export interface AddressStringToBytesResponseProtoMsg { + typeUrl: "/cosmos.auth.v1beta1.AddressStringToBytesResponse"; + value: Uint8Array; +} +/** + * AddressStringToBytesResponse is the response type for AddressBytes rpc method. + * + * Since: cosmos-sdk 0.46 + */ +export interface AddressStringToBytesResponseAmino { + address_bytes?: string; +} +export interface AddressStringToBytesResponseAminoMsg { + type: "cosmos-sdk/AddressStringToBytesResponse"; + value: AddressStringToBytesResponseAmino; +} +/** + * AddressStringToBytesResponse is the response type for AddressBytes rpc method. + * + * Since: cosmos-sdk 0.46 + */ +export interface AddressStringToBytesResponseSDKType { + address_bytes: Uint8Array; +} +/** + * QueryAccountAddressByIDRequest is the request type for AccountAddressByID rpc method + * + * Since: cosmos-sdk 0.46.2 + */ +export interface QueryAccountAddressByIDRequest { + /** + * Deprecated, use account_id instead + * + * id is the account number of the address to be queried. This field + * should have been an uint64 (like all account numbers), and will be + * updated to uint64 in a future version of the auth query. + */ + /** @deprecated */ + id: bigint; + /** + * account_id is the account number of the address to be queried. + * + * Since: cosmos-sdk 0.47 + */ + accountId: bigint; +} +export interface QueryAccountAddressByIDRequestProtoMsg { + typeUrl: "/cosmos.auth.v1beta1.QueryAccountAddressByIDRequest"; + value: Uint8Array; +} +/** + * QueryAccountAddressByIDRequest is the request type for AccountAddressByID rpc method + * + * Since: cosmos-sdk 0.46.2 + */ +export interface QueryAccountAddressByIDRequestAmino { + /** + * Deprecated, use account_id instead + * + * id is the account number of the address to be queried. This field + * should have been an uint64 (like all account numbers), and will be + * updated to uint64 in a future version of the auth query. + */ + /** @deprecated */ + id?: string; + /** + * account_id is the account number of the address to be queried. + * + * Since: cosmos-sdk 0.47 + */ + account_id?: string; +} +export interface QueryAccountAddressByIDRequestAminoMsg { + type: "cosmos-sdk/QueryAccountAddressByIDRequest"; + value: QueryAccountAddressByIDRequestAmino; +} +/** + * QueryAccountAddressByIDRequest is the request type for AccountAddressByID rpc method + * + * Since: cosmos-sdk 0.46.2 + */ +export interface QueryAccountAddressByIDRequestSDKType { + /** @deprecated */ + id: bigint; + account_id: bigint; +} +/** + * QueryAccountAddressByIDResponse is the response type for AccountAddressByID rpc method + * + * Since: cosmos-sdk 0.46.2 + */ +export interface QueryAccountAddressByIDResponse { + accountAddress: string; +} +export interface QueryAccountAddressByIDResponseProtoMsg { + typeUrl: "/cosmos.auth.v1beta1.QueryAccountAddressByIDResponse"; + value: Uint8Array; +} +/** + * QueryAccountAddressByIDResponse is the response type for AccountAddressByID rpc method + * + * Since: cosmos-sdk 0.46.2 + */ +export interface QueryAccountAddressByIDResponseAmino { + account_address?: string; +} +export interface QueryAccountAddressByIDResponseAminoMsg { + type: "cosmos-sdk/QueryAccountAddressByIDResponse"; + value: QueryAccountAddressByIDResponseAmino; +} +/** + * QueryAccountAddressByIDResponse is the response type for AccountAddressByID rpc method + * + * Since: cosmos-sdk 0.46.2 + */ +export interface QueryAccountAddressByIDResponseSDKType { + account_address: string; +} +/** + * QueryAccountInfoRequest is the Query/AccountInfo request type. + * + * Since: cosmos-sdk 0.47 + */ +export interface QueryAccountInfoRequest { + /** address is the account address string. */ + address: string; +} +export interface QueryAccountInfoRequestProtoMsg { + typeUrl: "/cosmos.auth.v1beta1.QueryAccountInfoRequest"; + value: Uint8Array; +} +/** + * QueryAccountInfoRequest is the Query/AccountInfo request type. + * + * Since: cosmos-sdk 0.47 + */ +export interface QueryAccountInfoRequestAmino { + /** address is the account address string. */ + address?: string; +} +export interface QueryAccountInfoRequestAminoMsg { + type: "cosmos-sdk/QueryAccountInfoRequest"; + value: QueryAccountInfoRequestAmino; +} +/** + * QueryAccountInfoRequest is the Query/AccountInfo request type. + * + * Since: cosmos-sdk 0.47 + */ +export interface QueryAccountInfoRequestSDKType { + address: string; +} +/** + * QueryAccountInfoResponse is the Query/AccountInfo response type. + * + * Since: cosmos-sdk 0.47 + */ +export interface QueryAccountInfoResponse { + /** info is the account info which is represented by BaseAccount. */ + info?: BaseAccount; +} +export interface QueryAccountInfoResponseProtoMsg { + typeUrl: "/cosmos.auth.v1beta1.QueryAccountInfoResponse"; + value: Uint8Array; +} +/** + * QueryAccountInfoResponse is the Query/AccountInfo response type. + * + * Since: cosmos-sdk 0.47 + */ +export interface QueryAccountInfoResponseAmino { + /** info is the account info which is represented by BaseAccount. */ + info?: BaseAccountAmino; +} +export interface QueryAccountInfoResponseAminoMsg { + type: "cosmos-sdk/QueryAccountInfoResponse"; + value: QueryAccountInfoResponseAmino; +} +/** + * QueryAccountInfoResponse is the Query/AccountInfo response type. + * + * Since: cosmos-sdk 0.47 + */ +export interface QueryAccountInfoResponseSDKType { + info?: BaseAccountSDKType; +} function createBaseQueryAccountsRequest(): QueryAccountsRequest { return { - pagination: PageRequest.fromPartial({}) + pagination: undefined }; } export const QueryAccountsRequest = { @@ -234,9 +650,11 @@ export const QueryAccountsRequest = { return message; }, fromAmino(object: QueryAccountsRequestAmino): QueryAccountsRequest { - return { - pagination: object?.pagination ? PageRequest.fromAmino(object.pagination) : undefined - }; + const message = createBaseQueryAccountsRequest(); + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromAmino(object.pagination); + } + return message; }, toAmino(message: QueryAccountsRequest): QueryAccountsRequestAmino { const obj: any = {}; @@ -268,7 +686,7 @@ export const QueryAccountsRequest = { function createBaseQueryAccountsResponse(): QueryAccountsResponse { return { accounts: [], - pagination: PageResponse.fromPartial({}) + pagination: undefined }; } export const QueryAccountsResponse = { @@ -290,7 +708,7 @@ export const QueryAccountsResponse = { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.accounts.push((AccountI_InterfaceDecoder(reader) as Any)); + message.accounts.push((Any(reader) as Any)); break; case 2: message.pagination = PageResponse.decode(reader, reader.uint32()); @@ -309,15 +727,17 @@ export const QueryAccountsResponse = { return message; }, fromAmino(object: QueryAccountsResponseAmino): QueryAccountsResponse { - return { - accounts: Array.isArray(object?.accounts) ? object.accounts.map((e: any) => AccountI_FromAmino(e)) : [], - pagination: object?.pagination ? PageResponse.fromAmino(object.pagination) : undefined - }; + const message = createBaseQueryAccountsResponse(); + message.accounts = object.accounts?.map(e => Cosmos_authv1beta1AccountI_FromAmino(e)) || []; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromAmino(object.pagination); + } + return message; }, toAmino(message: QueryAccountsResponse): QueryAccountsResponseAmino { const obj: any = {}; if (message.accounts) { - obj.accounts = message.accounts.map(e => e ? AccountI_ToAmino((e as Any)) : undefined); + obj.accounts = message.accounts.map(e => e ? Cosmos_authv1beta1AccountI_ToAmino((e as Any)) : undefined); } else { obj.accounts = []; } @@ -382,9 +802,11 @@ export const QueryAccountRequest = { return message; }, fromAmino(object: QueryAccountRequestAmino): QueryAccountRequest { - return { - address: object.address - }; + const message = createBaseQueryAccountRequest(); + if (object.address !== undefined && object.address !== null) { + message.address = object.address; + } + return message; }, toAmino(message: QueryAccountRequest): QueryAccountRequestAmino { const obj: any = {}; @@ -415,7 +837,7 @@ export const QueryAccountRequest = { }; function createBaseQueryAccountResponse(): QueryAccountResponse { return { - account: Any.fromPartial({}) + account: undefined }; } export const QueryAccountResponse = { @@ -434,7 +856,7 @@ export const QueryAccountResponse = { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.account = (AccountI_InterfaceDecoder(reader) as Any); + message.account = (Cosmos_authv1beta1AccountI_InterfaceDecoder(reader) as Any); break; default: reader.skipType(tag & 7); @@ -449,13 +871,15 @@ export const QueryAccountResponse = { return message; }, fromAmino(object: QueryAccountResponseAmino): QueryAccountResponse { - return { - account: object?.account ? AccountI_FromAmino(object.account) : undefined - }; + const message = createBaseQueryAccountResponse(); + if (object.account !== undefined && object.account !== null) { + message.account = Cosmos_authv1beta1AccountI_FromAmino(object.account); + } + return message; }, toAmino(message: QueryAccountResponse): QueryAccountResponseAmino { const obj: any = {}; - obj.account = message.account ? AccountI_ToAmino((message.account as Any)) : undefined; + obj.account = message.account ? Cosmos_authv1beta1AccountI_ToAmino((message.account as Any)) : undefined; return obj; }, fromAminoMsg(object: QueryAccountResponseAminoMsg): QueryAccountResponse { @@ -507,7 +931,8 @@ export const QueryParamsRequest = { return message; }, fromAmino(_: QueryParamsRequestAmino): QueryParamsRequest { - return {}; + const message = createBaseQueryParamsRequest(); + return message; }, toAmino(_: QueryParamsRequest): QueryParamsRequestAmino { const obj: any = {}; @@ -571,9 +996,11 @@ export const QueryParamsResponse = { return message; }, fromAmino(object: QueryParamsResponseAmino): QueryParamsResponse { - return { - params: object?.params ? Params.fromAmino(object.params) : undefined - }; + const message = createBaseQueryParamsResponse(); + if (object.params !== undefined && object.params !== null) { + message.params = Params.fromAmino(object.params); + } + return message; }, toAmino(message: QueryParamsResponse): QueryParamsResponseAmino { const obj: any = {}; @@ -629,7 +1056,8 @@ export const QueryModuleAccountsRequest = { return message; }, fromAmino(_: QueryModuleAccountsRequestAmino): QueryModuleAccountsRequest { - return {}; + const message = createBaseQueryModuleAccountsRequest(); + return message; }, toAmino(_: QueryModuleAccountsRequest): QueryModuleAccountsRequestAmino { const obj: any = {}; @@ -678,7 +1106,7 @@ export const QueryModuleAccountsResponse = { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.accounts.push((ModuleAccountI_InterfaceDecoder(reader) as Any)); + message.accounts.push((Any(reader) as Any)); break; default: reader.skipType(tag & 7); @@ -693,14 +1121,14 @@ export const QueryModuleAccountsResponse = { return message; }, fromAmino(object: QueryModuleAccountsResponseAmino): QueryModuleAccountsResponse { - return { - accounts: Array.isArray(object?.accounts) ? object.accounts.map((e: any) => ModuleAccountI_FromAmino(e)) : [] - }; + const message = createBaseQueryModuleAccountsResponse(); + message.accounts = object.accounts?.map(e => Cosmos_authv1beta1ModuleAccountI_FromAmino(e)) || []; + return message; }, toAmino(message: QueryModuleAccountsResponse): QueryModuleAccountsResponseAmino { const obj: any = {}; if (message.accounts) { - obj.accounts = message.accounts.map(e => e ? ModuleAccountI_ToAmino((e as Any)) : undefined); + obj.accounts = message.accounts.map(e => e ? Cosmos_authv1beta1ModuleAccountI_ToAmino((e as Any)) : undefined); } else { obj.accounts = []; } @@ -728,17 +1156,844 @@ export const QueryModuleAccountsResponse = { }; } }; -export const AccountI_InterfaceDecoder = (input: BinaryReader | Uint8Array): BaseAccount | Any => { +function createBaseQueryModuleAccountByNameRequest(): QueryModuleAccountByNameRequest { + return { + name: "" + }; +} +export const QueryModuleAccountByNameRequest = { + typeUrl: "/cosmos.auth.v1beta1.QueryModuleAccountByNameRequest", + encode(message: QueryModuleAccountByNameRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.name !== "") { + writer.uint32(10).string(message.name); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryModuleAccountByNameRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryModuleAccountByNameRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryModuleAccountByNameRequest { + const message = createBaseQueryModuleAccountByNameRequest(); + message.name = object.name ?? ""; + return message; + }, + fromAmino(object: QueryModuleAccountByNameRequestAmino): QueryModuleAccountByNameRequest { + const message = createBaseQueryModuleAccountByNameRequest(); + if (object.name !== undefined && object.name !== null) { + message.name = object.name; + } + return message; + }, + toAmino(message: QueryModuleAccountByNameRequest): QueryModuleAccountByNameRequestAmino { + const obj: any = {}; + obj.name = message.name; + return obj; + }, + fromAminoMsg(object: QueryModuleAccountByNameRequestAminoMsg): QueryModuleAccountByNameRequest { + return QueryModuleAccountByNameRequest.fromAmino(object.value); + }, + toAminoMsg(message: QueryModuleAccountByNameRequest): QueryModuleAccountByNameRequestAminoMsg { + return { + type: "cosmos-sdk/QueryModuleAccountByNameRequest", + value: QueryModuleAccountByNameRequest.toAmino(message) + }; + }, + fromProtoMsg(message: QueryModuleAccountByNameRequestProtoMsg): QueryModuleAccountByNameRequest { + return QueryModuleAccountByNameRequest.decode(message.value); + }, + toProto(message: QueryModuleAccountByNameRequest): Uint8Array { + return QueryModuleAccountByNameRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryModuleAccountByNameRequest): QueryModuleAccountByNameRequestProtoMsg { + return { + typeUrl: "/cosmos.auth.v1beta1.QueryModuleAccountByNameRequest", + value: QueryModuleAccountByNameRequest.encode(message).finish() + }; + } +}; +function createBaseQueryModuleAccountByNameResponse(): QueryModuleAccountByNameResponse { + return { + account: undefined + }; +} +export const QueryModuleAccountByNameResponse = { + typeUrl: "/cosmos.auth.v1beta1.QueryModuleAccountByNameResponse", + encode(message: QueryModuleAccountByNameResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.account !== undefined) { + Any.encode((message.account as Any), writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryModuleAccountByNameResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryModuleAccountByNameResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.account = (Cosmos_authv1beta1ModuleAccountI_InterfaceDecoder(reader) as Any); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryModuleAccountByNameResponse { + const message = createBaseQueryModuleAccountByNameResponse(); + message.account = object.account !== undefined && object.account !== null ? Any.fromPartial(object.account) : undefined; + return message; + }, + fromAmino(object: QueryModuleAccountByNameResponseAmino): QueryModuleAccountByNameResponse { + const message = createBaseQueryModuleAccountByNameResponse(); + if (object.account !== undefined && object.account !== null) { + message.account = Cosmos_authv1beta1ModuleAccountI_FromAmino(object.account); + } + return message; + }, + toAmino(message: QueryModuleAccountByNameResponse): QueryModuleAccountByNameResponseAmino { + const obj: any = {}; + obj.account = message.account ? Cosmos_authv1beta1ModuleAccountI_ToAmino((message.account as Any)) : undefined; + return obj; + }, + fromAminoMsg(object: QueryModuleAccountByNameResponseAminoMsg): QueryModuleAccountByNameResponse { + return QueryModuleAccountByNameResponse.fromAmino(object.value); + }, + toAminoMsg(message: QueryModuleAccountByNameResponse): QueryModuleAccountByNameResponseAminoMsg { + return { + type: "cosmos-sdk/QueryModuleAccountByNameResponse", + value: QueryModuleAccountByNameResponse.toAmino(message) + }; + }, + fromProtoMsg(message: QueryModuleAccountByNameResponseProtoMsg): QueryModuleAccountByNameResponse { + return QueryModuleAccountByNameResponse.decode(message.value); + }, + toProto(message: QueryModuleAccountByNameResponse): Uint8Array { + return QueryModuleAccountByNameResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryModuleAccountByNameResponse): QueryModuleAccountByNameResponseProtoMsg { + return { + typeUrl: "/cosmos.auth.v1beta1.QueryModuleAccountByNameResponse", + value: QueryModuleAccountByNameResponse.encode(message).finish() + }; + } +}; +function createBaseBech32PrefixRequest(): Bech32PrefixRequest { + return {}; +} +export const Bech32PrefixRequest = { + typeUrl: "/cosmos.auth.v1beta1.Bech32PrefixRequest", + encode(_: Bech32PrefixRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): Bech32PrefixRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseBech32PrefixRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): Bech32PrefixRequest { + const message = createBaseBech32PrefixRequest(); + return message; + }, + fromAmino(_: Bech32PrefixRequestAmino): Bech32PrefixRequest { + const message = createBaseBech32PrefixRequest(); + return message; + }, + toAmino(_: Bech32PrefixRequest): Bech32PrefixRequestAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: Bech32PrefixRequestAminoMsg): Bech32PrefixRequest { + return Bech32PrefixRequest.fromAmino(object.value); + }, + toAminoMsg(message: Bech32PrefixRequest): Bech32PrefixRequestAminoMsg { + return { + type: "cosmos-sdk/Bech32PrefixRequest", + value: Bech32PrefixRequest.toAmino(message) + }; + }, + fromProtoMsg(message: Bech32PrefixRequestProtoMsg): Bech32PrefixRequest { + return Bech32PrefixRequest.decode(message.value); + }, + toProto(message: Bech32PrefixRequest): Uint8Array { + return Bech32PrefixRequest.encode(message).finish(); + }, + toProtoMsg(message: Bech32PrefixRequest): Bech32PrefixRequestProtoMsg { + return { + typeUrl: "/cosmos.auth.v1beta1.Bech32PrefixRequest", + value: Bech32PrefixRequest.encode(message).finish() + }; + } +}; +function createBaseBech32PrefixResponse(): Bech32PrefixResponse { + return { + bech32Prefix: "" + }; +} +export const Bech32PrefixResponse = { + typeUrl: "/cosmos.auth.v1beta1.Bech32PrefixResponse", + encode(message: Bech32PrefixResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.bech32Prefix !== "") { + writer.uint32(10).string(message.bech32Prefix); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): Bech32PrefixResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseBech32PrefixResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.bech32Prefix = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): Bech32PrefixResponse { + const message = createBaseBech32PrefixResponse(); + message.bech32Prefix = object.bech32Prefix ?? ""; + return message; + }, + fromAmino(object: Bech32PrefixResponseAmino): Bech32PrefixResponse { + const message = createBaseBech32PrefixResponse(); + if (object.bech32_prefix !== undefined && object.bech32_prefix !== null) { + message.bech32Prefix = object.bech32_prefix; + } + return message; + }, + toAmino(message: Bech32PrefixResponse): Bech32PrefixResponseAmino { + const obj: any = {}; + obj.bech32_prefix = message.bech32Prefix; + return obj; + }, + fromAminoMsg(object: Bech32PrefixResponseAminoMsg): Bech32PrefixResponse { + return Bech32PrefixResponse.fromAmino(object.value); + }, + toAminoMsg(message: Bech32PrefixResponse): Bech32PrefixResponseAminoMsg { + return { + type: "cosmos-sdk/Bech32PrefixResponse", + value: Bech32PrefixResponse.toAmino(message) + }; + }, + fromProtoMsg(message: Bech32PrefixResponseProtoMsg): Bech32PrefixResponse { + return Bech32PrefixResponse.decode(message.value); + }, + toProto(message: Bech32PrefixResponse): Uint8Array { + return Bech32PrefixResponse.encode(message).finish(); + }, + toProtoMsg(message: Bech32PrefixResponse): Bech32PrefixResponseProtoMsg { + return { + typeUrl: "/cosmos.auth.v1beta1.Bech32PrefixResponse", + value: Bech32PrefixResponse.encode(message).finish() + }; + } +}; +function createBaseAddressBytesToStringRequest(): AddressBytesToStringRequest { + return { + addressBytes: new Uint8Array() + }; +} +export const AddressBytesToStringRequest = { + typeUrl: "/cosmos.auth.v1beta1.AddressBytesToStringRequest", + encode(message: AddressBytesToStringRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.addressBytes.length !== 0) { + writer.uint32(10).bytes(message.addressBytes); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): AddressBytesToStringRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseAddressBytesToStringRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.addressBytes = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): AddressBytesToStringRequest { + const message = createBaseAddressBytesToStringRequest(); + message.addressBytes = object.addressBytes ?? new Uint8Array(); + return message; + }, + fromAmino(object: AddressBytesToStringRequestAmino): AddressBytesToStringRequest { + const message = createBaseAddressBytesToStringRequest(); + if (object.address_bytes !== undefined && object.address_bytes !== null) { + message.addressBytes = bytesFromBase64(object.address_bytes); + } + return message; + }, + toAmino(message: AddressBytesToStringRequest): AddressBytesToStringRequestAmino { + const obj: any = {}; + obj.address_bytes = message.addressBytes ? base64FromBytes(message.addressBytes) : undefined; + return obj; + }, + fromAminoMsg(object: AddressBytesToStringRequestAminoMsg): AddressBytesToStringRequest { + return AddressBytesToStringRequest.fromAmino(object.value); + }, + toAminoMsg(message: AddressBytesToStringRequest): AddressBytesToStringRequestAminoMsg { + return { + type: "cosmos-sdk/AddressBytesToStringRequest", + value: AddressBytesToStringRequest.toAmino(message) + }; + }, + fromProtoMsg(message: AddressBytesToStringRequestProtoMsg): AddressBytesToStringRequest { + return AddressBytesToStringRequest.decode(message.value); + }, + toProto(message: AddressBytesToStringRequest): Uint8Array { + return AddressBytesToStringRequest.encode(message).finish(); + }, + toProtoMsg(message: AddressBytesToStringRequest): AddressBytesToStringRequestProtoMsg { + return { + typeUrl: "/cosmos.auth.v1beta1.AddressBytesToStringRequest", + value: AddressBytesToStringRequest.encode(message).finish() + }; + } +}; +function createBaseAddressBytesToStringResponse(): AddressBytesToStringResponse { + return { + addressString: "" + }; +} +export const AddressBytesToStringResponse = { + typeUrl: "/cosmos.auth.v1beta1.AddressBytesToStringResponse", + encode(message: AddressBytesToStringResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.addressString !== "") { + writer.uint32(10).string(message.addressString); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): AddressBytesToStringResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseAddressBytesToStringResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.addressString = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): AddressBytesToStringResponse { + const message = createBaseAddressBytesToStringResponse(); + message.addressString = object.addressString ?? ""; + return message; + }, + fromAmino(object: AddressBytesToStringResponseAmino): AddressBytesToStringResponse { + const message = createBaseAddressBytesToStringResponse(); + if (object.address_string !== undefined && object.address_string !== null) { + message.addressString = object.address_string; + } + return message; + }, + toAmino(message: AddressBytesToStringResponse): AddressBytesToStringResponseAmino { + const obj: any = {}; + obj.address_string = message.addressString; + return obj; + }, + fromAminoMsg(object: AddressBytesToStringResponseAminoMsg): AddressBytesToStringResponse { + return AddressBytesToStringResponse.fromAmino(object.value); + }, + toAminoMsg(message: AddressBytesToStringResponse): AddressBytesToStringResponseAminoMsg { + return { + type: "cosmos-sdk/AddressBytesToStringResponse", + value: AddressBytesToStringResponse.toAmino(message) + }; + }, + fromProtoMsg(message: AddressBytesToStringResponseProtoMsg): AddressBytesToStringResponse { + return AddressBytesToStringResponse.decode(message.value); + }, + toProto(message: AddressBytesToStringResponse): Uint8Array { + return AddressBytesToStringResponse.encode(message).finish(); + }, + toProtoMsg(message: AddressBytesToStringResponse): AddressBytesToStringResponseProtoMsg { + return { + typeUrl: "/cosmos.auth.v1beta1.AddressBytesToStringResponse", + value: AddressBytesToStringResponse.encode(message).finish() + }; + } +}; +function createBaseAddressStringToBytesRequest(): AddressStringToBytesRequest { + return { + addressString: "" + }; +} +export const AddressStringToBytesRequest = { + typeUrl: "/cosmos.auth.v1beta1.AddressStringToBytesRequest", + encode(message: AddressStringToBytesRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.addressString !== "") { + writer.uint32(10).string(message.addressString); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): AddressStringToBytesRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseAddressStringToBytesRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.addressString = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): AddressStringToBytesRequest { + const message = createBaseAddressStringToBytesRequest(); + message.addressString = object.addressString ?? ""; + return message; + }, + fromAmino(object: AddressStringToBytesRequestAmino): AddressStringToBytesRequest { + const message = createBaseAddressStringToBytesRequest(); + if (object.address_string !== undefined && object.address_string !== null) { + message.addressString = object.address_string; + } + return message; + }, + toAmino(message: AddressStringToBytesRequest): AddressStringToBytesRequestAmino { + const obj: any = {}; + obj.address_string = message.addressString; + return obj; + }, + fromAminoMsg(object: AddressStringToBytesRequestAminoMsg): AddressStringToBytesRequest { + return AddressStringToBytesRequest.fromAmino(object.value); + }, + toAminoMsg(message: AddressStringToBytesRequest): AddressStringToBytesRequestAminoMsg { + return { + type: "cosmos-sdk/AddressStringToBytesRequest", + value: AddressStringToBytesRequest.toAmino(message) + }; + }, + fromProtoMsg(message: AddressStringToBytesRequestProtoMsg): AddressStringToBytesRequest { + return AddressStringToBytesRequest.decode(message.value); + }, + toProto(message: AddressStringToBytesRequest): Uint8Array { + return AddressStringToBytesRequest.encode(message).finish(); + }, + toProtoMsg(message: AddressStringToBytesRequest): AddressStringToBytesRequestProtoMsg { + return { + typeUrl: "/cosmos.auth.v1beta1.AddressStringToBytesRequest", + value: AddressStringToBytesRequest.encode(message).finish() + }; + } +}; +function createBaseAddressStringToBytesResponse(): AddressStringToBytesResponse { + return { + addressBytes: new Uint8Array() + }; +} +export const AddressStringToBytesResponse = { + typeUrl: "/cosmos.auth.v1beta1.AddressStringToBytesResponse", + encode(message: AddressStringToBytesResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.addressBytes.length !== 0) { + writer.uint32(10).bytes(message.addressBytes); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): AddressStringToBytesResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseAddressStringToBytesResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.addressBytes = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): AddressStringToBytesResponse { + const message = createBaseAddressStringToBytesResponse(); + message.addressBytes = object.addressBytes ?? new Uint8Array(); + return message; + }, + fromAmino(object: AddressStringToBytesResponseAmino): AddressStringToBytesResponse { + const message = createBaseAddressStringToBytesResponse(); + if (object.address_bytes !== undefined && object.address_bytes !== null) { + message.addressBytes = bytesFromBase64(object.address_bytes); + } + return message; + }, + toAmino(message: AddressStringToBytesResponse): AddressStringToBytesResponseAmino { + const obj: any = {}; + obj.address_bytes = message.addressBytes ? base64FromBytes(message.addressBytes) : undefined; + return obj; + }, + fromAminoMsg(object: AddressStringToBytesResponseAminoMsg): AddressStringToBytesResponse { + return AddressStringToBytesResponse.fromAmino(object.value); + }, + toAminoMsg(message: AddressStringToBytesResponse): AddressStringToBytesResponseAminoMsg { + return { + type: "cosmos-sdk/AddressStringToBytesResponse", + value: AddressStringToBytesResponse.toAmino(message) + }; + }, + fromProtoMsg(message: AddressStringToBytesResponseProtoMsg): AddressStringToBytesResponse { + return AddressStringToBytesResponse.decode(message.value); + }, + toProto(message: AddressStringToBytesResponse): Uint8Array { + return AddressStringToBytesResponse.encode(message).finish(); + }, + toProtoMsg(message: AddressStringToBytesResponse): AddressStringToBytesResponseProtoMsg { + return { + typeUrl: "/cosmos.auth.v1beta1.AddressStringToBytesResponse", + value: AddressStringToBytesResponse.encode(message).finish() + }; + } +}; +function createBaseQueryAccountAddressByIDRequest(): QueryAccountAddressByIDRequest { + return { + id: BigInt(0), + accountId: BigInt(0) + }; +} +export const QueryAccountAddressByIDRequest = { + typeUrl: "/cosmos.auth.v1beta1.QueryAccountAddressByIDRequest", + encode(message: QueryAccountAddressByIDRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.id !== BigInt(0)) { + writer.uint32(8).int64(message.id); + } + if (message.accountId !== BigInt(0)) { + writer.uint32(16).uint64(message.accountId); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryAccountAddressByIDRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryAccountAddressByIDRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.id = reader.int64(); + break; + case 2: + message.accountId = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryAccountAddressByIDRequest { + const message = createBaseQueryAccountAddressByIDRequest(); + message.id = object.id !== undefined && object.id !== null ? BigInt(object.id.toString()) : BigInt(0); + message.accountId = object.accountId !== undefined && object.accountId !== null ? BigInt(object.accountId.toString()) : BigInt(0); + return message; + }, + fromAmino(object: QueryAccountAddressByIDRequestAmino): QueryAccountAddressByIDRequest { + const message = createBaseQueryAccountAddressByIDRequest(); + if (object.id !== undefined && object.id !== null) { + message.id = BigInt(object.id); + } + if (object.account_id !== undefined && object.account_id !== null) { + message.accountId = BigInt(object.account_id); + } + return message; + }, + toAmino(message: QueryAccountAddressByIDRequest): QueryAccountAddressByIDRequestAmino { + const obj: any = {}; + obj.id = message.id ? message.id.toString() : undefined; + obj.account_id = message.accountId ? message.accountId.toString() : undefined; + return obj; + }, + fromAminoMsg(object: QueryAccountAddressByIDRequestAminoMsg): QueryAccountAddressByIDRequest { + return QueryAccountAddressByIDRequest.fromAmino(object.value); + }, + toAminoMsg(message: QueryAccountAddressByIDRequest): QueryAccountAddressByIDRequestAminoMsg { + return { + type: "cosmos-sdk/QueryAccountAddressByIDRequest", + value: QueryAccountAddressByIDRequest.toAmino(message) + }; + }, + fromProtoMsg(message: QueryAccountAddressByIDRequestProtoMsg): QueryAccountAddressByIDRequest { + return QueryAccountAddressByIDRequest.decode(message.value); + }, + toProto(message: QueryAccountAddressByIDRequest): Uint8Array { + return QueryAccountAddressByIDRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryAccountAddressByIDRequest): QueryAccountAddressByIDRequestProtoMsg { + return { + typeUrl: "/cosmos.auth.v1beta1.QueryAccountAddressByIDRequest", + value: QueryAccountAddressByIDRequest.encode(message).finish() + }; + } +}; +function createBaseQueryAccountAddressByIDResponse(): QueryAccountAddressByIDResponse { + return { + accountAddress: "" + }; +} +export const QueryAccountAddressByIDResponse = { + typeUrl: "/cosmos.auth.v1beta1.QueryAccountAddressByIDResponse", + encode(message: QueryAccountAddressByIDResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.accountAddress !== "") { + writer.uint32(10).string(message.accountAddress); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryAccountAddressByIDResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryAccountAddressByIDResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.accountAddress = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryAccountAddressByIDResponse { + const message = createBaseQueryAccountAddressByIDResponse(); + message.accountAddress = object.accountAddress ?? ""; + return message; + }, + fromAmino(object: QueryAccountAddressByIDResponseAmino): QueryAccountAddressByIDResponse { + const message = createBaseQueryAccountAddressByIDResponse(); + if (object.account_address !== undefined && object.account_address !== null) { + message.accountAddress = object.account_address; + } + return message; + }, + toAmino(message: QueryAccountAddressByIDResponse): QueryAccountAddressByIDResponseAmino { + const obj: any = {}; + obj.account_address = message.accountAddress; + return obj; + }, + fromAminoMsg(object: QueryAccountAddressByIDResponseAminoMsg): QueryAccountAddressByIDResponse { + return QueryAccountAddressByIDResponse.fromAmino(object.value); + }, + toAminoMsg(message: QueryAccountAddressByIDResponse): QueryAccountAddressByIDResponseAminoMsg { + return { + type: "cosmos-sdk/QueryAccountAddressByIDResponse", + value: QueryAccountAddressByIDResponse.toAmino(message) + }; + }, + fromProtoMsg(message: QueryAccountAddressByIDResponseProtoMsg): QueryAccountAddressByIDResponse { + return QueryAccountAddressByIDResponse.decode(message.value); + }, + toProto(message: QueryAccountAddressByIDResponse): Uint8Array { + return QueryAccountAddressByIDResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryAccountAddressByIDResponse): QueryAccountAddressByIDResponseProtoMsg { + return { + typeUrl: "/cosmos.auth.v1beta1.QueryAccountAddressByIDResponse", + value: QueryAccountAddressByIDResponse.encode(message).finish() + }; + } +}; +function createBaseQueryAccountInfoRequest(): QueryAccountInfoRequest { + return { + address: "" + }; +} +export const QueryAccountInfoRequest = { + typeUrl: "/cosmos.auth.v1beta1.QueryAccountInfoRequest", + encode(message: QueryAccountInfoRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.address !== "") { + writer.uint32(10).string(message.address); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryAccountInfoRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryAccountInfoRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.address = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryAccountInfoRequest { + const message = createBaseQueryAccountInfoRequest(); + message.address = object.address ?? ""; + return message; + }, + fromAmino(object: QueryAccountInfoRequestAmino): QueryAccountInfoRequest { + const message = createBaseQueryAccountInfoRequest(); + if (object.address !== undefined && object.address !== null) { + message.address = object.address; + } + return message; + }, + toAmino(message: QueryAccountInfoRequest): QueryAccountInfoRequestAmino { + const obj: any = {}; + obj.address = message.address; + return obj; + }, + fromAminoMsg(object: QueryAccountInfoRequestAminoMsg): QueryAccountInfoRequest { + return QueryAccountInfoRequest.fromAmino(object.value); + }, + toAminoMsg(message: QueryAccountInfoRequest): QueryAccountInfoRequestAminoMsg { + return { + type: "cosmos-sdk/QueryAccountInfoRequest", + value: QueryAccountInfoRequest.toAmino(message) + }; + }, + fromProtoMsg(message: QueryAccountInfoRequestProtoMsg): QueryAccountInfoRequest { + return QueryAccountInfoRequest.decode(message.value); + }, + toProto(message: QueryAccountInfoRequest): Uint8Array { + return QueryAccountInfoRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryAccountInfoRequest): QueryAccountInfoRequestProtoMsg { + return { + typeUrl: "/cosmos.auth.v1beta1.QueryAccountInfoRequest", + value: QueryAccountInfoRequest.encode(message).finish() + }; + } +}; +function createBaseQueryAccountInfoResponse(): QueryAccountInfoResponse { + return { + info: undefined + }; +} +export const QueryAccountInfoResponse = { + typeUrl: "/cosmos.auth.v1beta1.QueryAccountInfoResponse", + encode(message: QueryAccountInfoResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.info !== undefined) { + BaseAccount.encode(message.info, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryAccountInfoResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryAccountInfoResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.info = BaseAccount.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryAccountInfoResponse { + const message = createBaseQueryAccountInfoResponse(); + message.info = object.info !== undefined && object.info !== null ? BaseAccount.fromPartial(object.info) : undefined; + return message; + }, + fromAmino(object: QueryAccountInfoResponseAmino): QueryAccountInfoResponse { + const message = createBaseQueryAccountInfoResponse(); + if (object.info !== undefined && object.info !== null) { + message.info = BaseAccount.fromAmino(object.info); + } + return message; + }, + toAmino(message: QueryAccountInfoResponse): QueryAccountInfoResponseAmino { + const obj: any = {}; + obj.info = message.info ? BaseAccount.toAmino(message.info) : undefined; + return obj; + }, + fromAminoMsg(object: QueryAccountInfoResponseAminoMsg): QueryAccountInfoResponse { + return QueryAccountInfoResponse.fromAmino(object.value); + }, + toAminoMsg(message: QueryAccountInfoResponse): QueryAccountInfoResponseAminoMsg { + return { + type: "cosmos-sdk/QueryAccountInfoResponse", + value: QueryAccountInfoResponse.toAmino(message) + }; + }, + fromProtoMsg(message: QueryAccountInfoResponseProtoMsg): QueryAccountInfoResponse { + return QueryAccountInfoResponse.decode(message.value); + }, + toProto(message: QueryAccountInfoResponse): Uint8Array { + return QueryAccountInfoResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryAccountInfoResponse): QueryAccountInfoResponseProtoMsg { + return { + typeUrl: "/cosmos.auth.v1beta1.QueryAccountInfoResponse", + value: QueryAccountInfoResponse.encode(message).finish() + }; + } +}; +export const Cosmos_authv1beta1AccountI_InterfaceDecoder = (input: BinaryReader | Uint8Array): BaseAccount | Any => { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - const data = Any.decode(reader, reader.uint32()); + const data = Any.decode(reader, reader.uint32(), true); switch (data.typeUrl) { case "/cosmos.auth.v1beta1.BaseAccount": - return BaseAccount.decode(data.value); + return BaseAccount.decode(data.value, undefined, true); default: return data; } }; -export const AccountI_FromAmino = (content: AnyAmino) => { +export const Cosmos_authv1beta1AccountI_FromAmino = (content: AnyAmino) => { switch (content.type) { case "cosmos-sdk/BaseAccount": return Any.fromPartial({ @@ -749,28 +2004,28 @@ export const AccountI_FromAmino = (content: AnyAmino) => { return Any.fromAmino(content); } }; -export const AccountI_ToAmino = (content: Any) => { +export const Cosmos_authv1beta1AccountI_ToAmino = (content: Any) => { switch (content.typeUrl) { case "/cosmos.auth.v1beta1.BaseAccount": return { type: "cosmos-sdk/BaseAccount", - value: BaseAccount.toAmino(BaseAccount.decode(content.value)) + value: BaseAccount.toAmino(BaseAccount.decode(content.value, undefined)) }; default: return Any.toAmino(content); } }; -export const ModuleAccountI_InterfaceDecoder = (input: BinaryReader | Uint8Array): ModuleAccount | Any => { +export const Cosmos_authv1beta1ModuleAccountI_InterfaceDecoder = (input: BinaryReader | Uint8Array): ModuleAccount | Any => { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - const data = Any.decode(reader, reader.uint32()); + const data = Any.decode(reader, reader.uint32(), true); switch (data.typeUrl) { case "/cosmos.auth.v1beta1.ModuleAccount": - return ModuleAccount.decode(data.value); + return ModuleAccount.decode(data.value, undefined, true); default: return data; } }; -export const ModuleAccountI_FromAmino = (content: AnyAmino) => { +export const Cosmos_authv1beta1ModuleAccountI_FromAmino = (content: AnyAmino) => { switch (content.type) { case "cosmos-sdk/ModuleAccount": return Any.fromPartial({ @@ -781,12 +2036,12 @@ export const ModuleAccountI_FromAmino = (content: AnyAmino) => { return Any.fromAmino(content); } }; -export const ModuleAccountI_ToAmino = (content: Any) => { +export const Cosmos_authv1beta1ModuleAccountI_ToAmino = (content: Any) => { switch (content.typeUrl) { case "/cosmos.auth.v1beta1.ModuleAccount": return { type: "cosmos-sdk/ModuleAccount", - value: ModuleAccount.toAmino(ModuleAccount.decode(content.value)) + value: ModuleAccount.toAmino(ModuleAccount.decode(content.value, undefined)) }; default: return Any.toAmino(content); diff --git a/packages/osmo-query/src/codegen/cosmos/auth/v1beta1/tx.amino.ts b/packages/osmo-query/src/codegen/cosmos/auth/v1beta1/tx.amino.ts new file mode 100644 index 000000000..54570c3b6 --- /dev/null +++ b/packages/osmo-query/src/codegen/cosmos/auth/v1beta1/tx.amino.ts @@ -0,0 +1,9 @@ +//@ts-nocheck +import { MsgUpdateParams } from "./tx"; +export const AminoConverter = { + "/cosmos.auth.v1beta1.MsgUpdateParams": { + aminoType: "cosmos-sdk/x/auth/MsgUpdateParams", + toAmino: MsgUpdateParams.toAmino, + fromAmino: MsgUpdateParams.fromAmino + } +}; \ No newline at end of file diff --git a/packages/osmo-query/src/codegen/cosmos/auth/v1beta1/tx.registry.ts b/packages/osmo-query/src/codegen/cosmos/auth/v1beta1/tx.registry.ts new file mode 100644 index 000000000..2070e3eaf --- /dev/null +++ b/packages/osmo-query/src/codegen/cosmos/auth/v1beta1/tx.registry.ts @@ -0,0 +1,35 @@ +//@ts-nocheck +import { GeneratedType, Registry } from "@cosmjs/proto-signing"; +import { MsgUpdateParams } from "./tx"; +export const registry: ReadonlyArray<[string, GeneratedType]> = [["/cosmos.auth.v1beta1.MsgUpdateParams", MsgUpdateParams]]; +export const load = (protoRegistry: Registry) => { + registry.forEach(([typeUrl, mod]) => { + protoRegistry.register(typeUrl, mod); + }); +}; +export const MessageComposer = { + encoded: { + updateParams(value: MsgUpdateParams) { + return { + typeUrl: "/cosmos.auth.v1beta1.MsgUpdateParams", + value: MsgUpdateParams.encode(value).finish() + }; + } + }, + withTypeUrl: { + updateParams(value: MsgUpdateParams) { + return { + typeUrl: "/cosmos.auth.v1beta1.MsgUpdateParams", + value + }; + } + }, + fromPartial: { + updateParams(value: MsgUpdateParams) { + return { + typeUrl: "/cosmos.auth.v1beta1.MsgUpdateParams", + value: MsgUpdateParams.fromPartial(value) + }; + } + } +}; \ No newline at end of file diff --git a/packages/osmo-query/src/codegen/cosmos/auth/v1beta1/tx.rpc.msg.ts b/packages/osmo-query/src/codegen/cosmos/auth/v1beta1/tx.rpc.msg.ts new file mode 100644 index 000000000..b9576b397 --- /dev/null +++ b/packages/osmo-query/src/codegen/cosmos/auth/v1beta1/tx.rpc.msg.ts @@ -0,0 +1,25 @@ +import { Rpc } from "../../../helpers"; +import { BinaryReader } from "../../../binary"; +import { MsgUpdateParams, MsgUpdateParamsResponse } from "./tx"; +/** Msg defines the x/auth Msg service. */ +export interface Msg { + /** + * UpdateParams defines a (governance) operation for updating the x/auth module + * parameters. The authority defaults to the x/gov module account. + * + * Since: cosmos-sdk 0.47 + */ + updateParams(request: MsgUpdateParams): Promise; +} +export class MsgClientImpl implements Msg { + private readonly rpc: Rpc; + constructor(rpc: Rpc) { + this.rpc = rpc; + this.updateParams = this.updateParams.bind(this); + } + updateParams(request: MsgUpdateParams): Promise { + const data = MsgUpdateParams.encode(request).finish(); + const promise = this.rpc.request("cosmos.auth.v1beta1.Msg", "UpdateParams", data); + return promise.then(data => MsgUpdateParamsResponse.decode(new BinaryReader(data))); + } +} \ No newline at end of file diff --git a/packages/osmo-query/src/codegen/cosmos/auth/v1beta1/tx.ts b/packages/osmo-query/src/codegen/cosmos/auth/v1beta1/tx.ts new file mode 100644 index 000000000..916c994f3 --- /dev/null +++ b/packages/osmo-query/src/codegen/cosmos/auth/v1beta1/tx.ts @@ -0,0 +1,215 @@ +import { Params, ParamsAmino, ParamsSDKType } from "./auth"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +/** + * MsgUpdateParams is the Msg/UpdateParams request type. + * + * Since: cosmos-sdk 0.47 + */ +export interface MsgUpdateParams { + /** authority is the address that controls the module (defaults to x/gov unless overwritten). */ + authority: string; + /** + * params defines the x/auth parameters to update. + * + * NOTE: All parameters must be supplied. + */ + params: Params; +} +export interface MsgUpdateParamsProtoMsg { + typeUrl: "/cosmos.auth.v1beta1.MsgUpdateParams"; + value: Uint8Array; +} +/** + * MsgUpdateParams is the Msg/UpdateParams request type. + * + * Since: cosmos-sdk 0.47 + */ +export interface MsgUpdateParamsAmino { + /** authority is the address that controls the module (defaults to x/gov unless overwritten). */ + authority?: string; + /** + * params defines the x/auth parameters to update. + * + * NOTE: All parameters must be supplied. + */ + params: ParamsAmino; +} +export interface MsgUpdateParamsAminoMsg { + type: "cosmos-sdk/x/auth/MsgUpdateParams"; + value: MsgUpdateParamsAmino; +} +/** + * MsgUpdateParams is the Msg/UpdateParams request type. + * + * Since: cosmos-sdk 0.47 + */ +export interface MsgUpdateParamsSDKType { + authority: string; + params: ParamsSDKType; +} +/** + * MsgUpdateParamsResponse defines the response structure for executing a + * MsgUpdateParams message. + * + * Since: cosmos-sdk 0.47 + */ +export interface MsgUpdateParamsResponse {} +export interface MsgUpdateParamsResponseProtoMsg { + typeUrl: "/cosmos.auth.v1beta1.MsgUpdateParamsResponse"; + value: Uint8Array; +} +/** + * MsgUpdateParamsResponse defines the response structure for executing a + * MsgUpdateParams message. + * + * Since: cosmos-sdk 0.47 + */ +export interface MsgUpdateParamsResponseAmino {} +export interface MsgUpdateParamsResponseAminoMsg { + type: "cosmos-sdk/MsgUpdateParamsResponse"; + value: MsgUpdateParamsResponseAmino; +} +/** + * MsgUpdateParamsResponse defines the response structure for executing a + * MsgUpdateParams message. + * + * Since: cosmos-sdk 0.47 + */ +export interface MsgUpdateParamsResponseSDKType {} +function createBaseMsgUpdateParams(): MsgUpdateParams { + return { + authority: "", + params: Params.fromPartial({}) + }; +} +export const MsgUpdateParams = { + typeUrl: "/cosmos.auth.v1beta1.MsgUpdateParams", + encode(message: MsgUpdateParams, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.authority !== "") { + writer.uint32(10).string(message.authority); + } + if (message.params !== undefined) { + Params.encode(message.params, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgUpdateParams { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUpdateParams(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.authority = reader.string(); + break; + case 2: + message.params = Params.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgUpdateParams { + const message = createBaseMsgUpdateParams(); + message.authority = object.authority ?? ""; + message.params = object.params !== undefined && object.params !== null ? Params.fromPartial(object.params) : undefined; + return message; + }, + fromAmino(object: MsgUpdateParamsAmino): MsgUpdateParams { + const message = createBaseMsgUpdateParams(); + if (object.authority !== undefined && object.authority !== null) { + message.authority = object.authority; + } + if (object.params !== undefined && object.params !== null) { + message.params = Params.fromAmino(object.params); + } + return message; + }, + toAmino(message: MsgUpdateParams): MsgUpdateParamsAmino { + const obj: any = {}; + obj.authority = message.authority; + obj.params = message.params ? Params.toAmino(message.params) : Params.fromPartial({}); + return obj; + }, + fromAminoMsg(object: MsgUpdateParamsAminoMsg): MsgUpdateParams { + return MsgUpdateParams.fromAmino(object.value); + }, + toAminoMsg(message: MsgUpdateParams): MsgUpdateParamsAminoMsg { + return { + type: "cosmos-sdk/x/auth/MsgUpdateParams", + value: MsgUpdateParams.toAmino(message) + }; + }, + fromProtoMsg(message: MsgUpdateParamsProtoMsg): MsgUpdateParams { + return MsgUpdateParams.decode(message.value); + }, + toProto(message: MsgUpdateParams): Uint8Array { + return MsgUpdateParams.encode(message).finish(); + }, + toProtoMsg(message: MsgUpdateParams): MsgUpdateParamsProtoMsg { + return { + typeUrl: "/cosmos.auth.v1beta1.MsgUpdateParams", + value: MsgUpdateParams.encode(message).finish() + }; + } +}; +function createBaseMsgUpdateParamsResponse(): MsgUpdateParamsResponse { + return {}; +} +export const MsgUpdateParamsResponse = { + typeUrl: "/cosmos.auth.v1beta1.MsgUpdateParamsResponse", + encode(_: MsgUpdateParamsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgUpdateParamsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUpdateParamsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): MsgUpdateParamsResponse { + const message = createBaseMsgUpdateParamsResponse(); + return message; + }, + fromAmino(_: MsgUpdateParamsResponseAmino): MsgUpdateParamsResponse { + const message = createBaseMsgUpdateParamsResponse(); + return message; + }, + toAmino(_: MsgUpdateParamsResponse): MsgUpdateParamsResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgUpdateParamsResponseAminoMsg): MsgUpdateParamsResponse { + return MsgUpdateParamsResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgUpdateParamsResponse): MsgUpdateParamsResponseAminoMsg { + return { + type: "cosmos-sdk/MsgUpdateParamsResponse", + value: MsgUpdateParamsResponse.toAmino(message) + }; + }, + fromProtoMsg(message: MsgUpdateParamsResponseProtoMsg): MsgUpdateParamsResponse { + return MsgUpdateParamsResponse.decode(message.value); + }, + toProto(message: MsgUpdateParamsResponse): Uint8Array { + return MsgUpdateParamsResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgUpdateParamsResponse): MsgUpdateParamsResponseProtoMsg { + return { + typeUrl: "/cosmos.auth.v1beta1.MsgUpdateParamsResponse", + value: MsgUpdateParamsResponse.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/packages/osmo-query/src/codegen/cosmos/authz/v1beta1/authz.ts b/packages/osmo-query/src/codegen/cosmos/authz/v1beta1/authz.ts index ecdccf145..0f6a7d797 100644 --- a/packages/osmo-query/src/codegen/cosmos/authz/v1beta1/authz.ts +++ b/packages/osmo-query/src/codegen/cosmos/authz/v1beta1/authz.ts @@ -2,6 +2,8 @@ import { Any, AnyProtoMsg, AnyAmino, AnySDKType } from "../../../google/protobuf import { Timestamp } from "../../../google/protobuf/timestamp"; import { SendAuthorization, SendAuthorizationProtoMsg, SendAuthorizationSDKType } from "../../bank/v1beta1/authz"; import { StakeAuthorization, StakeAuthorizationProtoMsg, StakeAuthorizationSDKType } from "../../staking/v1beta1/authz"; +import { TransferAuthorization, TransferAuthorizationProtoMsg, TransferAuthorizationSDKType } from "../../../ibc/applications/transfer/v1/authz"; +import { StoreCodeAuthorization, StoreCodeAuthorizationProtoMsg, StoreCodeAuthorizationSDKType, ContractExecutionAuthorization, ContractExecutionAuthorizationProtoMsg, ContractExecutionAuthorizationSDKType, ContractMigrationAuthorization, ContractMigrationAuthorizationProtoMsg, ContractMigrationAuthorizationSDKType } from "../../../cosmwasm/wasm/v1/authz"; import { BinaryReader, BinaryWriter } from "../../../binary"; import { toTimestamp, fromTimestamp } from "../../../helpers"; /** @@ -9,7 +11,7 @@ import { toTimestamp, fromTimestamp } from "../../../helpers"; * the provided method on behalf of the granter's account. */ export interface GenericAuthorization { - $typeUrl?: string; + $typeUrl?: "/cosmos.authz.v1beta1.GenericAuthorization"; /** Msg, identified by it's type URL, to grant unrestricted permissions to execute */ msg: string; } @@ -23,7 +25,7 @@ export interface GenericAuthorizationProtoMsg { */ export interface GenericAuthorizationAmino { /** Msg, identified by it's type URL, to grant unrestricted permissions to execute */ - msg: string; + msg?: string; } export interface GenericAuthorizationAminoMsg { type: "cosmos-sdk/GenericAuthorization"; @@ -34,7 +36,7 @@ export interface GenericAuthorizationAminoMsg { * the provided method on behalf of the granter's account. */ export interface GenericAuthorizationSDKType { - $typeUrl?: string; + $typeUrl?: "/cosmos.authz.v1beta1.GenericAuthorization"; msg: string; } /** @@ -42,15 +44,20 @@ export interface GenericAuthorizationSDKType { * the provide method with expiration time. */ export interface Grant { - authorization: (GenericAuthorization & SendAuthorization & StakeAuthorization & Any) | undefined; - expiration: Date; + authorization?: (GenericAuthorization & SendAuthorization & StakeAuthorization & TransferAuthorization & StoreCodeAuthorization & ContractExecutionAuthorization & ContractMigrationAuthorization & Any) | undefined; + /** + * time when the grant will expire and will be pruned. If null, then the grant + * doesn't have a time expiration (other conditions in `authorization` + * may apply to invalidate the grant) + */ + expiration?: Date; } export interface GrantProtoMsg { typeUrl: "/cosmos.authz.v1beta1.Grant"; value: Uint8Array; } export type GrantEncoded = Omit & { - authorization?: GenericAuthorizationProtoMsg | SendAuthorizationProtoMsg | StakeAuthorizationProtoMsg | AnyProtoMsg | undefined; + authorization?: GenericAuthorizationProtoMsg | SendAuthorizationProtoMsg | StakeAuthorizationProtoMsg | TransferAuthorizationProtoMsg | StoreCodeAuthorizationProtoMsg | ContractExecutionAuthorizationProtoMsg | ContractMigrationAuthorizationProtoMsg | AnyProtoMsg | undefined; }; /** * Grant gives permissions to execute @@ -58,7 +65,12 @@ export type GrantEncoded = Omit & { */ export interface GrantAmino { authorization?: AnyAmino; - expiration?: Date; + /** + * time when the grant will expire and will be pruned. If null, then the grant + * doesn't have a time expiration (other conditions in `authorization` + * may apply to invalidate the grant) + */ + expiration?: string; } export interface GrantAminoMsg { type: "cosmos-sdk/Grant"; @@ -69,8 +81,8 @@ export interface GrantAminoMsg { * the provide method with expiration time. */ export interface GrantSDKType { - authorization: GenericAuthorizationSDKType | SendAuthorizationSDKType | StakeAuthorizationSDKType | AnySDKType | undefined; - expiration: Date; + authorization?: GenericAuthorizationSDKType | SendAuthorizationSDKType | StakeAuthorizationSDKType | TransferAuthorizationSDKType | StoreCodeAuthorizationSDKType | ContractExecutionAuthorizationSDKType | ContractMigrationAuthorizationSDKType | AnySDKType | undefined; + expiration?: Date; } /** * GrantAuthorization extends a grant with both the addresses of the grantee and granter. @@ -79,25 +91,25 @@ export interface GrantSDKType { export interface GrantAuthorization { granter: string; grantee: string; - authorization: (GenericAuthorization & SendAuthorization & StakeAuthorization & Any) | undefined; - expiration: Date; + authorization?: (GenericAuthorization & SendAuthorization & StakeAuthorization & TransferAuthorization & StoreCodeAuthorization & ContractExecutionAuthorization & ContractMigrationAuthorization & Any) | undefined; + expiration?: Date; } export interface GrantAuthorizationProtoMsg { typeUrl: "/cosmos.authz.v1beta1.GrantAuthorization"; value: Uint8Array; } export type GrantAuthorizationEncoded = Omit & { - authorization?: GenericAuthorizationProtoMsg | SendAuthorizationProtoMsg | StakeAuthorizationProtoMsg | AnyProtoMsg | undefined; + authorization?: GenericAuthorizationProtoMsg | SendAuthorizationProtoMsg | StakeAuthorizationProtoMsg | TransferAuthorizationProtoMsg | StoreCodeAuthorizationProtoMsg | ContractExecutionAuthorizationProtoMsg | ContractMigrationAuthorizationProtoMsg | AnyProtoMsg | undefined; }; /** * GrantAuthorization extends a grant with both the addresses of the grantee and granter. * It is used in genesis.proto and query.proto */ export interface GrantAuthorizationAmino { - granter: string; - grantee: string; + granter?: string; + grantee?: string; authorization?: AnyAmino; - expiration?: Date; + expiration?: string; } export interface GrantAuthorizationAminoMsg { type: "cosmos-sdk/GrantAuthorization"; @@ -110,8 +122,30 @@ export interface GrantAuthorizationAminoMsg { export interface GrantAuthorizationSDKType { granter: string; grantee: string; - authorization: GenericAuthorizationSDKType | SendAuthorizationSDKType | StakeAuthorizationSDKType | AnySDKType | undefined; - expiration: Date; + authorization?: GenericAuthorizationSDKType | SendAuthorizationSDKType | StakeAuthorizationSDKType | TransferAuthorizationSDKType | StoreCodeAuthorizationSDKType | ContractExecutionAuthorizationSDKType | ContractMigrationAuthorizationSDKType | AnySDKType | undefined; + expiration?: Date; +} +/** GrantQueueItem contains the list of TypeURL of a sdk.Msg. */ +export interface GrantQueueItem { + /** msg_type_urls contains the list of TypeURL of a sdk.Msg. */ + msgTypeUrls: string[]; +} +export interface GrantQueueItemProtoMsg { + typeUrl: "/cosmos.authz.v1beta1.GrantQueueItem"; + value: Uint8Array; +} +/** GrantQueueItem contains the list of TypeURL of a sdk.Msg. */ +export interface GrantQueueItemAmino { + /** msg_type_urls contains the list of TypeURL of a sdk.Msg. */ + msg_type_urls?: string[]; +} +export interface GrantQueueItemAminoMsg { + type: "cosmos-sdk/GrantQueueItem"; + value: GrantQueueItemAmino; +} +/** GrantQueueItem contains the list of TypeURL of a sdk.Msg. */ +export interface GrantQueueItemSDKType { + msg_type_urls: string[]; } function createBaseGenericAuthorization(): GenericAuthorization { return { @@ -150,9 +184,11 @@ export const GenericAuthorization = { return message; }, fromAmino(object: GenericAuthorizationAmino): GenericAuthorization { - return { - msg: object.msg - }; + const message = createBaseGenericAuthorization(); + if (object.msg !== undefined && object.msg !== null) { + message.msg = object.msg; + } + return message; }, toAmino(message: GenericAuthorization): GenericAuthorizationAmino { const obj: any = {}; @@ -183,8 +219,8 @@ export const GenericAuthorization = { }; function createBaseGrant(): Grant { return { - authorization: Any.fromPartial({}), - expiration: new Date() + authorization: undefined, + expiration: undefined }; } export const Grant = { @@ -206,7 +242,7 @@ export const Grant = { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.authorization = (Authorization_InterfaceDecoder(reader) as Any); + message.authorization = (Cosmos_authzv1beta1Authorization_InterfaceDecoder(reader) as Any); break; case 2: message.expiration = fromTimestamp(Timestamp.decode(reader, reader.uint32())); @@ -225,15 +261,19 @@ export const Grant = { return message; }, fromAmino(object: GrantAmino): Grant { - return { - authorization: object?.authorization ? Authorization_FromAmino(object.authorization) : undefined, - expiration: object.expiration - }; + const message = createBaseGrant(); + if (object.authorization !== undefined && object.authorization !== null) { + message.authorization = Cosmos_authzv1beta1Authorization_FromAmino(object.authorization); + } + if (object.expiration !== undefined && object.expiration !== null) { + message.expiration = fromTimestamp(Timestamp.fromAmino(object.expiration)); + } + return message; }, toAmino(message: Grant): GrantAmino { const obj: any = {}; - obj.authorization = message.authorization ? Authorization_ToAmino((message.authorization as Any)) : undefined; - obj.expiration = message.expiration; + obj.authorization = message.authorization ? Cosmos_authzv1beta1Authorization_ToAmino((message.authorization as Any)) : undefined; + obj.expiration = message.expiration ? Timestamp.toAmino(toTimestamp(message.expiration)) : undefined; return obj; }, fromAminoMsg(object: GrantAminoMsg): Grant { @@ -262,8 +302,8 @@ function createBaseGrantAuthorization(): GrantAuthorization { return { granter: "", grantee: "", - authorization: Any.fromPartial({}), - expiration: new Date() + authorization: undefined, + expiration: undefined }; } export const GrantAuthorization = { @@ -297,7 +337,7 @@ export const GrantAuthorization = { message.grantee = reader.string(); break; case 3: - message.authorization = (Authorization_InterfaceDecoder(reader) as Any); + message.authorization = (Cosmos_authzv1beta1Authorization_InterfaceDecoder(reader) as Any); break; case 4: message.expiration = fromTimestamp(Timestamp.decode(reader, reader.uint32())); @@ -318,19 +358,27 @@ export const GrantAuthorization = { return message; }, fromAmino(object: GrantAuthorizationAmino): GrantAuthorization { - return { - granter: object.granter, - grantee: object.grantee, - authorization: object?.authorization ? Authorization_FromAmino(object.authorization) : undefined, - expiration: object.expiration - }; + const message = createBaseGrantAuthorization(); + if (object.granter !== undefined && object.granter !== null) { + message.granter = object.granter; + } + if (object.grantee !== undefined && object.grantee !== null) { + message.grantee = object.grantee; + } + if (object.authorization !== undefined && object.authorization !== null) { + message.authorization = Cosmos_authzv1beta1Authorization_FromAmino(object.authorization); + } + if (object.expiration !== undefined && object.expiration !== null) { + message.expiration = fromTimestamp(Timestamp.fromAmino(object.expiration)); + } + return message; }, toAmino(message: GrantAuthorization): GrantAuthorizationAmino { const obj: any = {}; obj.granter = message.granter; obj.grantee = message.grantee; - obj.authorization = message.authorization ? Authorization_ToAmino((message.authorization as Any)) : undefined; - obj.expiration = message.expiration; + obj.authorization = message.authorization ? Cosmos_authzv1beta1Authorization_ToAmino((message.authorization as Any)) : undefined; + obj.expiration = message.expiration ? Timestamp.toAmino(toTimestamp(message.expiration)) : undefined; return obj; }, fromAminoMsg(object: GrantAuthorizationAminoMsg): GrantAuthorization { @@ -355,21 +403,100 @@ export const GrantAuthorization = { }; } }; -export const Authorization_InterfaceDecoder = (input: BinaryReader | Uint8Array): GenericAuthorization | SendAuthorization | StakeAuthorization | Any => { +function createBaseGrantQueueItem(): GrantQueueItem { + return { + msgTypeUrls: [] + }; +} +export const GrantQueueItem = { + typeUrl: "/cosmos.authz.v1beta1.GrantQueueItem", + encode(message: GrantQueueItem, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.msgTypeUrls) { + writer.uint32(10).string(v!); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): GrantQueueItem { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGrantQueueItem(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.msgTypeUrls.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): GrantQueueItem { + const message = createBaseGrantQueueItem(); + message.msgTypeUrls = object.msgTypeUrls?.map(e => e) || []; + return message; + }, + fromAmino(object: GrantQueueItemAmino): GrantQueueItem { + const message = createBaseGrantQueueItem(); + message.msgTypeUrls = object.msg_type_urls?.map(e => e) || []; + return message; + }, + toAmino(message: GrantQueueItem): GrantQueueItemAmino { + const obj: any = {}; + if (message.msgTypeUrls) { + obj.msg_type_urls = message.msgTypeUrls.map(e => e); + } else { + obj.msg_type_urls = []; + } + return obj; + }, + fromAminoMsg(object: GrantQueueItemAminoMsg): GrantQueueItem { + return GrantQueueItem.fromAmino(object.value); + }, + toAminoMsg(message: GrantQueueItem): GrantQueueItemAminoMsg { + return { + type: "cosmos-sdk/GrantQueueItem", + value: GrantQueueItem.toAmino(message) + }; + }, + fromProtoMsg(message: GrantQueueItemProtoMsg): GrantQueueItem { + return GrantQueueItem.decode(message.value); + }, + toProto(message: GrantQueueItem): Uint8Array { + return GrantQueueItem.encode(message).finish(); + }, + toProtoMsg(message: GrantQueueItem): GrantQueueItemProtoMsg { + return { + typeUrl: "/cosmos.authz.v1beta1.GrantQueueItem", + value: GrantQueueItem.encode(message).finish() + }; + } +}; +export const Cosmos_authzv1beta1Authorization_InterfaceDecoder = (input: BinaryReader | Uint8Array): GenericAuthorization | SendAuthorization | StakeAuthorization | TransferAuthorization | StoreCodeAuthorization | ContractExecutionAuthorization | ContractMigrationAuthorization | Any => { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - const data = Any.decode(reader, reader.uint32()); + const data = Any.decode(reader, reader.uint32(), true); switch (data.typeUrl) { case "/cosmos.authz.v1beta1.GenericAuthorization": - return GenericAuthorization.decode(data.value); + return GenericAuthorization.decode(data.value, undefined, true); case "/cosmos.bank.v1beta1.SendAuthorization": - return SendAuthorization.decode(data.value); + return SendAuthorization.decode(data.value, undefined, true); case "/cosmos.staking.v1beta1.StakeAuthorization": - return StakeAuthorization.decode(data.value); + return StakeAuthorization.decode(data.value, undefined, true); + case "/ibc.applications.transfer.v1.TransferAuthorization": + return TransferAuthorization.decode(data.value, undefined, true); + case "/cosmwasm.wasm.v1.StoreCodeAuthorization": + return StoreCodeAuthorization.decode(data.value, undefined, true); + case "/cosmwasm.wasm.v1.ContractExecutionAuthorization": + return ContractExecutionAuthorization.decode(data.value, undefined, true); + case "/cosmwasm.wasm.v1.ContractMigrationAuthorization": + return ContractMigrationAuthorization.decode(data.value, undefined, true); default: return data; } }; -export const Authorization_FromAmino = (content: AnyAmino) => { +export const Cosmos_authzv1beta1Authorization_FromAmino = (content: AnyAmino) => { switch (content.type) { case "cosmos-sdk/GenericAuthorization": return Any.fromPartial({ @@ -386,26 +513,66 @@ export const Authorization_FromAmino = (content: AnyAmino) => { typeUrl: "/cosmos.staking.v1beta1.StakeAuthorization", value: StakeAuthorization.encode(StakeAuthorization.fromPartial(StakeAuthorization.fromAmino(content.value))).finish() }); + case "cosmos-sdk/TransferAuthorization": + return Any.fromPartial({ + typeUrl: "/ibc.applications.transfer.v1.TransferAuthorization", + value: TransferAuthorization.encode(TransferAuthorization.fromPartial(TransferAuthorization.fromAmino(content.value))).finish() + }); + case "wasm/StoreCodeAuthorization": + return Any.fromPartial({ + typeUrl: "/cosmwasm.wasm.v1.StoreCodeAuthorization", + value: StoreCodeAuthorization.encode(StoreCodeAuthorization.fromPartial(StoreCodeAuthorization.fromAmino(content.value))).finish() + }); + case "wasm/ContractExecutionAuthorization": + return Any.fromPartial({ + typeUrl: "/cosmwasm.wasm.v1.ContractExecutionAuthorization", + value: ContractExecutionAuthorization.encode(ContractExecutionAuthorization.fromPartial(ContractExecutionAuthorization.fromAmino(content.value))).finish() + }); + case "wasm/ContractMigrationAuthorization": + return Any.fromPartial({ + typeUrl: "/cosmwasm.wasm.v1.ContractMigrationAuthorization", + value: ContractMigrationAuthorization.encode(ContractMigrationAuthorization.fromPartial(ContractMigrationAuthorization.fromAmino(content.value))).finish() + }); default: return Any.fromAmino(content); } }; -export const Authorization_ToAmino = (content: Any) => { +export const Cosmos_authzv1beta1Authorization_ToAmino = (content: Any) => { switch (content.typeUrl) { case "/cosmos.authz.v1beta1.GenericAuthorization": return { type: "cosmos-sdk/GenericAuthorization", - value: GenericAuthorization.toAmino(GenericAuthorization.decode(content.value)) + value: GenericAuthorization.toAmino(GenericAuthorization.decode(content.value, undefined)) }; case "/cosmos.bank.v1beta1.SendAuthorization": return { type: "cosmos-sdk/SendAuthorization", - value: SendAuthorization.toAmino(SendAuthorization.decode(content.value)) + value: SendAuthorization.toAmino(SendAuthorization.decode(content.value, undefined)) }; case "/cosmos.staking.v1beta1.StakeAuthorization": return { type: "cosmos-sdk/StakeAuthorization", - value: StakeAuthorization.toAmino(StakeAuthorization.decode(content.value)) + value: StakeAuthorization.toAmino(StakeAuthorization.decode(content.value, undefined)) + }; + case "/ibc.applications.transfer.v1.TransferAuthorization": + return { + type: "cosmos-sdk/TransferAuthorization", + value: TransferAuthorization.toAmino(TransferAuthorization.decode(content.value, undefined)) + }; + case "/cosmwasm.wasm.v1.StoreCodeAuthorization": + return { + type: "wasm/StoreCodeAuthorization", + value: StoreCodeAuthorization.toAmino(StoreCodeAuthorization.decode(content.value, undefined)) + }; + case "/cosmwasm.wasm.v1.ContractExecutionAuthorization": + return { + type: "wasm/ContractExecutionAuthorization", + value: ContractExecutionAuthorization.toAmino(ContractExecutionAuthorization.decode(content.value, undefined)) + }; + case "/cosmwasm.wasm.v1.ContractMigrationAuthorization": + return { + type: "wasm/ContractMigrationAuthorization", + value: ContractMigrationAuthorization.toAmino(ContractMigrationAuthorization.decode(content.value, undefined)) }; default: return Any.toAmino(content); diff --git a/packages/osmo-query/src/codegen/cosmos/authz/v1beta1/event.ts b/packages/osmo-query/src/codegen/cosmos/authz/v1beta1/event.ts index d5579423e..4b82cc0f3 100644 --- a/packages/osmo-query/src/codegen/cosmos/authz/v1beta1/event.ts +++ b/packages/osmo-query/src/codegen/cosmos/authz/v1beta1/event.ts @@ -15,11 +15,11 @@ export interface EventGrantProtoMsg { /** EventGrant is emitted on Msg/Grant */ export interface EventGrantAmino { /** Msg type URL for which an autorization is granted */ - msg_type_url: string; + msg_type_url?: string; /** Granter account address */ - granter: string; + granter?: string; /** Grantee account address */ - grantee: string; + grantee?: string; } export interface EventGrantAminoMsg { type: "cosmos-sdk/EventGrant"; @@ -47,11 +47,11 @@ export interface EventRevokeProtoMsg { /** EventRevoke is emitted on Msg/Revoke */ export interface EventRevokeAmino { /** Msg type URL for which an autorization is revoked */ - msg_type_url: string; + msg_type_url?: string; /** Granter account address */ - granter: string; + granter?: string; /** Grantee account address */ - grantee: string; + grantee?: string; } export interface EventRevokeAminoMsg { type: "cosmos-sdk/EventRevoke"; @@ -115,11 +115,17 @@ export const EventGrant = { return message; }, fromAmino(object: EventGrantAmino): EventGrant { - return { - msgTypeUrl: object.msg_type_url, - granter: object.granter, - grantee: object.grantee - }; + const message = createBaseEventGrant(); + if (object.msg_type_url !== undefined && object.msg_type_url !== null) { + message.msgTypeUrl = object.msg_type_url; + } + if (object.granter !== undefined && object.granter !== null) { + message.granter = object.granter; + } + if (object.grantee !== undefined && object.grantee !== null) { + message.grantee = object.grantee; + } + return message; }, toAmino(message: EventGrant): EventGrantAmino { const obj: any = {}; @@ -202,11 +208,17 @@ export const EventRevoke = { return message; }, fromAmino(object: EventRevokeAmino): EventRevoke { - return { - msgTypeUrl: object.msg_type_url, - granter: object.granter, - grantee: object.grantee - }; + const message = createBaseEventRevoke(); + if (object.msg_type_url !== undefined && object.msg_type_url !== null) { + message.msgTypeUrl = object.msg_type_url; + } + if (object.granter !== undefined && object.granter !== null) { + message.granter = object.granter; + } + if (object.grantee !== undefined && object.grantee !== null) { + message.grantee = object.grantee; + } + return message; }, toAmino(message: EventRevoke): EventRevokeAmino { const obj: any = {}; diff --git a/packages/osmo-query/src/codegen/cosmos/authz/v1beta1/genesis.ts b/packages/osmo-query/src/codegen/cosmos/authz/v1beta1/genesis.ts index d90f2f199..140846539 100644 --- a/packages/osmo-query/src/codegen/cosmos/authz/v1beta1/genesis.ts +++ b/packages/osmo-query/src/codegen/cosmos/authz/v1beta1/genesis.ts @@ -56,9 +56,9 @@ export const GenesisState = { return message; }, fromAmino(object: GenesisStateAmino): GenesisState { - return { - authorization: Array.isArray(object?.authorization) ? object.authorization.map((e: any) => GrantAuthorization.fromAmino(e)) : [] - }; + const message = createBaseGenesisState(); + message.authorization = object.authorization?.map(e => GrantAuthorization.fromAmino(e)) || []; + return message; }, toAmino(message: GenesisState): GenesisStateAmino { const obj: any = {}; diff --git a/packages/osmo-query/src/codegen/cosmos/authz/v1beta1/query.lcd.ts b/packages/osmo-query/src/codegen/cosmos/authz/v1beta1/query.lcd.ts index 815b4f4b6..e5699e320 100644 --- a/packages/osmo-query/src/codegen/cosmos/authz/v1beta1/query.lcd.ts +++ b/packages/osmo-query/src/codegen/cosmos/authz/v1beta1/query.lcd.ts @@ -33,7 +33,9 @@ export class LCDQueryClient { const endpoint = `cosmos/authz/v1beta1/grants`; return await this.req.get(endpoint, options); } - /* GranterGrants returns list of `Authorization`, granted by granter. */ + /* GranterGrants returns list of `GrantAuthorization`, granted by granter. + + Since: cosmos-sdk 0.46 */ async granterGrants(params: QueryGranterGrantsRequest): Promise { const options: any = { params: {} @@ -44,7 +46,9 @@ export class LCDQueryClient { const endpoint = `cosmos/authz/v1beta1/grants/granter/${params.granter}`; return await this.req.get(endpoint, options); } - /* GranteeGrants returns a list of `GrantAuthorization` by grantee. */ + /* GranteeGrants returns a list of `GrantAuthorization` by grantee. + + Since: cosmos-sdk 0.46 */ async granteeGrants(params: QueryGranteeGrantsRequest): Promise { const options: any = { params: {} diff --git a/packages/osmo-query/src/codegen/cosmos/authz/v1beta1/query.rpc.Query.ts b/packages/osmo-query/src/codegen/cosmos/authz/v1beta1/query.rpc.Query.ts index ae7781075..ae303a4fc 100644 --- a/packages/osmo-query/src/codegen/cosmos/authz/v1beta1/query.rpc.Query.ts +++ b/packages/osmo-query/src/codegen/cosmos/authz/v1beta1/query.rpc.Query.ts @@ -8,9 +8,17 @@ import { QueryGrantsRequest, QueryGrantsResponse, QueryGranterGrantsRequest, Que export interface Query { /** Returns list of `Authorization`, granted to the grantee by the granter. */ grants(request: QueryGrantsRequest): Promise; - /** GranterGrants returns list of `Authorization`, granted by granter. */ + /** + * GranterGrants returns list of `GrantAuthorization`, granted by granter. + * + * Since: cosmos-sdk 0.46 + */ granterGrants(request: QueryGranterGrantsRequest): Promise; - /** GranteeGrants returns a list of `GrantAuthorization` by grantee. */ + /** + * GranteeGrants returns a list of `GrantAuthorization` by grantee. + * + * Since: cosmos-sdk 0.46 + */ granteeGrants(request: QueryGranteeGrantsRequest): Promise; } export class QueryClientImpl implements Query { @@ -102,7 +110,17 @@ export const createRpcQueryHooks = (rpc: ProtobufRpcClient | undefined) => { }; return { /** Returns list of `Authorization`, granted to the grantee by the granter. */useGrants, - /** GranterGrants returns list of `Authorization`, granted by granter. */useGranterGrants, - /** GranteeGrants returns a list of `GrantAuthorization` by grantee. */useGranteeGrants + /** + * GranterGrants returns list of `GrantAuthorization`, granted by granter. + * + * Since: cosmos-sdk 0.46 + */ + useGranterGrants, + /** + * GranteeGrants returns a list of `GrantAuthorization` by grantee. + * + * Since: cosmos-sdk 0.46 + */ + useGranteeGrants }; }; \ No newline at end of file diff --git a/packages/osmo-query/src/codegen/cosmos/authz/v1beta1/query.ts b/packages/osmo-query/src/codegen/cosmos/authz/v1beta1/query.ts index e0a8bfe7d..fd5169376 100644 --- a/packages/osmo-query/src/codegen/cosmos/authz/v1beta1/query.ts +++ b/packages/osmo-query/src/codegen/cosmos/authz/v1beta1/query.ts @@ -8,7 +8,7 @@ export interface QueryGrantsRequest { /** Optional, msg_type_url, when set, will query only grants matching given msg type. */ msgTypeUrl: string; /** pagination defines an pagination for the request. */ - pagination: PageRequest; + pagination?: PageRequest; } export interface QueryGrantsRequestProtoMsg { typeUrl: "/cosmos.authz.v1beta1.QueryGrantsRequest"; @@ -16,10 +16,10 @@ export interface QueryGrantsRequestProtoMsg { } /** QueryGrantsRequest is the request type for the Query/Grants RPC method. */ export interface QueryGrantsRequestAmino { - granter: string; - grantee: string; + granter?: string; + grantee?: string; /** Optional, msg_type_url, when set, will query only grants matching given msg type. */ - msg_type_url: string; + msg_type_url?: string; /** pagination defines an pagination for the request. */ pagination?: PageRequestAmino; } @@ -32,14 +32,14 @@ export interface QueryGrantsRequestSDKType { granter: string; grantee: string; msg_type_url: string; - pagination: PageRequestSDKType; + pagination?: PageRequestSDKType; } /** 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[]; /** pagination defines an pagination for the response. */ - pagination: PageResponse; + pagination?: PageResponse; } export interface QueryGrantsResponseProtoMsg { typeUrl: "/cosmos.authz.v1beta1.QueryGrantsResponse"; @@ -48,7 +48,7 @@ export interface QueryGrantsResponseProtoMsg { /** QueryGrantsResponse is the response type for the Query/Authorizations RPC method. */ export interface QueryGrantsResponseAmino { /** authorizations is a list of grants granted for grantee by granter. */ - grants: GrantAmino[]; + grants?: GrantAmino[]; /** pagination defines an pagination for the response. */ pagination?: PageResponseAmino; } @@ -59,13 +59,13 @@ export interface QueryGrantsResponseAminoMsg { /** QueryGrantsResponse is the response type for the Query/Authorizations RPC method. */ export interface QueryGrantsResponseSDKType { grants: GrantSDKType[]; - pagination: PageResponseSDKType; + pagination?: PageResponseSDKType; } /** QueryGranterGrantsRequest is the request type for the Query/GranterGrants RPC method. */ export interface QueryGranterGrantsRequest { granter: string; /** pagination defines an pagination for the request. */ - pagination: PageRequest; + pagination?: PageRequest; } export interface QueryGranterGrantsRequestProtoMsg { typeUrl: "/cosmos.authz.v1beta1.QueryGranterGrantsRequest"; @@ -73,7 +73,7 @@ export interface QueryGranterGrantsRequestProtoMsg { } /** QueryGranterGrantsRequest is the request type for the Query/GranterGrants RPC method. */ export interface QueryGranterGrantsRequestAmino { - granter: string; + granter?: string; /** pagination defines an pagination for the request. */ pagination?: PageRequestAmino; } @@ -84,14 +84,14 @@ export interface QueryGranterGrantsRequestAminoMsg { /** QueryGranterGrantsRequest is the request type for the Query/GranterGrants RPC method. */ export interface QueryGranterGrantsRequestSDKType { granter: string; - pagination: PageRequestSDKType; + pagination?: PageRequestSDKType; } /** 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[]; /** pagination defines an pagination for the response. */ - pagination: PageResponse; + pagination?: PageResponse; } export interface QueryGranterGrantsResponseProtoMsg { typeUrl: "/cosmos.authz.v1beta1.QueryGranterGrantsResponse"; @@ -100,7 +100,7 @@ export interface QueryGranterGrantsResponseProtoMsg { /** QueryGranterGrantsResponse is the response type for the Query/GranterGrants RPC method. */ export interface QueryGranterGrantsResponseAmino { /** grants is a list of grants granted by the granter. */ - grants: GrantAuthorizationAmino[]; + grants?: GrantAuthorizationAmino[]; /** pagination defines an pagination for the response. */ pagination?: PageResponseAmino; } @@ -111,13 +111,13 @@ export interface QueryGranterGrantsResponseAminoMsg { /** QueryGranterGrantsResponse is the response type for the Query/GranterGrants RPC method. */ export interface QueryGranterGrantsResponseSDKType { grants: GrantAuthorizationSDKType[]; - pagination: PageResponseSDKType; + pagination?: PageResponseSDKType; } /** QueryGranteeGrantsRequest is the request type for the Query/IssuedGrants RPC method. */ export interface QueryGranteeGrantsRequest { grantee: string; /** pagination defines an pagination for the request. */ - pagination: PageRequest; + pagination?: PageRequest; } export interface QueryGranteeGrantsRequestProtoMsg { typeUrl: "/cosmos.authz.v1beta1.QueryGranteeGrantsRequest"; @@ -125,7 +125,7 @@ export interface QueryGranteeGrantsRequestProtoMsg { } /** QueryGranteeGrantsRequest is the request type for the Query/IssuedGrants RPC method. */ export interface QueryGranteeGrantsRequestAmino { - grantee: string; + grantee?: string; /** pagination defines an pagination for the request. */ pagination?: PageRequestAmino; } @@ -136,14 +136,14 @@ export interface QueryGranteeGrantsRequestAminoMsg { /** QueryGranteeGrantsRequest is the request type for the Query/IssuedGrants RPC method. */ export interface QueryGranteeGrantsRequestSDKType { grantee: string; - pagination: PageRequestSDKType; + pagination?: PageRequestSDKType; } /** 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[]; /** pagination defines an pagination for the response. */ - pagination: PageResponse; + pagination?: PageResponse; } export interface QueryGranteeGrantsResponseProtoMsg { typeUrl: "/cosmos.authz.v1beta1.QueryGranteeGrantsResponse"; @@ -152,7 +152,7 @@ export interface QueryGranteeGrantsResponseProtoMsg { /** QueryGranteeGrantsResponse is the response type for the Query/GranteeGrants RPC method. */ export interface QueryGranteeGrantsResponseAmino { /** grants is a list of grants granted to the grantee. */ - grants: GrantAuthorizationAmino[]; + grants?: GrantAuthorizationAmino[]; /** pagination defines an pagination for the response. */ pagination?: PageResponseAmino; } @@ -163,14 +163,14 @@ export interface QueryGranteeGrantsResponseAminoMsg { /** QueryGranteeGrantsResponse is the response type for the Query/GranteeGrants RPC method. */ export interface QueryGranteeGrantsResponseSDKType { grants: GrantAuthorizationSDKType[]; - pagination: PageResponseSDKType; + pagination?: PageResponseSDKType; } function createBaseQueryGrantsRequest(): QueryGrantsRequest { return { granter: "", grantee: "", msgTypeUrl: "", - pagination: PageRequest.fromPartial({}) + pagination: undefined }; } export const QueryGrantsRequest = { @@ -225,12 +225,20 @@ export const QueryGrantsRequest = { return message; }, fromAmino(object: QueryGrantsRequestAmino): QueryGrantsRequest { - return { - granter: object.granter, - grantee: object.grantee, - msgTypeUrl: object.msg_type_url, - pagination: object?.pagination ? PageRequest.fromAmino(object.pagination) : undefined - }; + const message = createBaseQueryGrantsRequest(); + if (object.granter !== undefined && object.granter !== null) { + message.granter = object.granter; + } + if (object.grantee !== undefined && object.grantee !== null) { + message.grantee = object.grantee; + } + if (object.msg_type_url !== undefined && object.msg_type_url !== null) { + message.msgTypeUrl = object.msg_type_url; + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromAmino(object.pagination); + } + return message; }, toAmino(message: QueryGrantsRequest): QueryGrantsRequestAmino { const obj: any = {}; @@ -265,7 +273,7 @@ export const QueryGrantsRequest = { function createBaseQueryGrantsResponse(): QueryGrantsResponse { return { grants: [], - pagination: PageResponse.fromPartial({}) + pagination: undefined }; } export const QueryGrantsResponse = { @@ -306,10 +314,12 @@ export const QueryGrantsResponse = { return message; }, fromAmino(object: QueryGrantsResponseAmino): QueryGrantsResponse { - return { - grants: Array.isArray(object?.grants) ? object.grants.map((e: any) => Grant.fromAmino(e)) : [], - pagination: object?.pagination ? PageResponse.fromAmino(object.pagination) : undefined - }; + const message = createBaseQueryGrantsResponse(); + message.grants = object.grants?.map(e => Grant.fromAmino(e)) || []; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromAmino(object.pagination); + } + return message; }, toAmino(message: QueryGrantsResponse): QueryGrantsResponseAmino { const obj: any = {}; @@ -346,7 +356,7 @@ export const QueryGrantsResponse = { function createBaseQueryGranterGrantsRequest(): QueryGranterGrantsRequest { return { granter: "", - pagination: PageRequest.fromPartial({}) + pagination: undefined }; } export const QueryGranterGrantsRequest = { @@ -387,10 +397,14 @@ export const QueryGranterGrantsRequest = { return message; }, fromAmino(object: QueryGranterGrantsRequestAmino): QueryGranterGrantsRequest { - return { - granter: object.granter, - pagination: object?.pagination ? PageRequest.fromAmino(object.pagination) : undefined - }; + const message = createBaseQueryGranterGrantsRequest(); + if (object.granter !== undefined && object.granter !== null) { + message.granter = object.granter; + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromAmino(object.pagination); + } + return message; }, toAmino(message: QueryGranterGrantsRequest): QueryGranterGrantsRequestAmino { const obj: any = {}; @@ -423,7 +437,7 @@ export const QueryGranterGrantsRequest = { function createBaseQueryGranterGrantsResponse(): QueryGranterGrantsResponse { return { grants: [], - pagination: PageResponse.fromPartial({}) + pagination: undefined }; } export const QueryGranterGrantsResponse = { @@ -464,10 +478,12 @@ export const QueryGranterGrantsResponse = { return message; }, fromAmino(object: QueryGranterGrantsResponseAmino): QueryGranterGrantsResponse { - return { - grants: Array.isArray(object?.grants) ? object.grants.map((e: any) => GrantAuthorization.fromAmino(e)) : [], - pagination: object?.pagination ? PageResponse.fromAmino(object.pagination) : undefined - }; + const message = createBaseQueryGranterGrantsResponse(); + message.grants = object.grants?.map(e => GrantAuthorization.fromAmino(e)) || []; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromAmino(object.pagination); + } + return message; }, toAmino(message: QueryGranterGrantsResponse): QueryGranterGrantsResponseAmino { const obj: any = {}; @@ -504,7 +520,7 @@ export const QueryGranterGrantsResponse = { function createBaseQueryGranteeGrantsRequest(): QueryGranteeGrantsRequest { return { grantee: "", - pagination: PageRequest.fromPartial({}) + pagination: undefined }; } export const QueryGranteeGrantsRequest = { @@ -545,10 +561,14 @@ export const QueryGranteeGrantsRequest = { return message; }, fromAmino(object: QueryGranteeGrantsRequestAmino): QueryGranteeGrantsRequest { - return { - grantee: object.grantee, - pagination: object?.pagination ? PageRequest.fromAmino(object.pagination) : undefined - }; + const message = createBaseQueryGranteeGrantsRequest(); + if (object.grantee !== undefined && object.grantee !== null) { + message.grantee = object.grantee; + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromAmino(object.pagination); + } + return message; }, toAmino(message: QueryGranteeGrantsRequest): QueryGranteeGrantsRequestAmino { const obj: any = {}; @@ -581,7 +601,7 @@ export const QueryGranteeGrantsRequest = { function createBaseQueryGranteeGrantsResponse(): QueryGranteeGrantsResponse { return { grants: [], - pagination: PageResponse.fromPartial({}) + pagination: undefined }; } export const QueryGranteeGrantsResponse = { @@ -622,10 +642,12 @@ export const QueryGranteeGrantsResponse = { return message; }, fromAmino(object: QueryGranteeGrantsResponseAmino): QueryGranteeGrantsResponse { - return { - grants: Array.isArray(object?.grants) ? object.grants.map((e: any) => GrantAuthorization.fromAmino(e)) : [], - pagination: object?.pagination ? PageResponse.fromAmino(object.pagination) : undefined - }; + const message = createBaseQueryGranteeGrantsResponse(); + message.grants = object.grants?.map(e => GrantAuthorization.fromAmino(e)) || []; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromAmino(object.pagination); + } + return message; }, toAmino(message: QueryGranteeGrantsResponse): QueryGranteeGrantsResponseAmino { const obj: any = {}; diff --git a/packages/osmo-query/src/codegen/cosmos/authz/v1beta1/tx.ts b/packages/osmo-query/src/codegen/cosmos/authz/v1beta1/tx.ts index 1bb275fab..72911ab3d 100644 --- a/packages/osmo-query/src/codegen/cosmos/authz/v1beta1/tx.ts +++ b/packages/osmo-query/src/codegen/cosmos/authz/v1beta1/tx.ts @@ -1,6 +1,7 @@ import { Grant, GrantAmino, GrantSDKType } from "./authz"; import { Any, AnyProtoMsg, AnyAmino, AnySDKType } from "../../../google/protobuf/any"; import { BinaryReader, BinaryWriter } from "../../../binary"; +import { bytesFromBase64, base64FromBytes } from "../../../helpers"; /** * MsgGrant is a request type for Grant method. It declares authorization to the grantee * on behalf of the granter with the provided expiration time. @@ -19,9 +20,9 @@ export interface MsgGrantProtoMsg { * on behalf of the granter with the provided expiration time. */ export interface MsgGrantAmino { - granter: string; - grantee: string; - grant?: GrantAmino; + granter?: string; + grantee?: string; + grant: GrantAmino; } export interface MsgGrantAminoMsg { type: "cosmos-sdk/MsgGrant"; @@ -46,7 +47,7 @@ export interface MsgExecResponseProtoMsg { } /** MsgExecResponse defines the Msg/MsgExecResponse response type. */ export interface MsgExecResponseAmino { - results: Uint8Array[]; + results?: string[]; } export interface MsgExecResponseAminoMsg { type: "cosmos-sdk/MsgExecResponse"; @@ -64,7 +65,7 @@ export interface MsgExecResponseSDKType { export interface MsgExec { grantee: string; /** - * Authorization Msg requests to execute. Each msg must implement Authorization interface + * Execute Msg. * The x/authz will try to find a grant matching (msg.signers[0], grantee, MsgTypeURL(msg)) * triple and validate it. */ @@ -76,7 +77,7 @@ export interface MsgExecProtoMsg { } export type MsgExecEncoded = Omit & { /** - * Authorization Msg requests to execute. Each msg must implement Authorization interface + * Execute Msg. * The x/authz will try to find a grant matching (msg.signers[0], grantee, MsgTypeURL(msg)) * triple and validate it. */ @@ -88,13 +89,13 @@ export type MsgExecEncoded = Omit & { * one signer corresponding to the granter of the authorization. */ export interface MsgExecAmino { - grantee: string; + grantee?: string; /** - * Authorization Msg requests to execute. Each msg must implement Authorization interface + * Execute Msg. * The x/authz will try to find a grant matching (msg.signers[0], grantee, MsgTypeURL(msg)) * triple and validate it. */ - msgs: AnyAmino[]; + msgs?: AnyAmino[]; } export interface MsgExecAminoMsg { type: "cosmos-sdk/MsgExec"; @@ -141,9 +142,9 @@ export interface MsgRevokeProtoMsg { * granter's account with that has been granted to the grantee. */ export interface MsgRevokeAmino { - granter: string; - grantee: string; - msg_type_url: string; + granter?: string; + grantee?: string; + msg_type_url?: string; } export interface MsgRevokeAminoMsg { type: "cosmos-sdk/MsgRevoke"; @@ -224,17 +225,23 @@ export const MsgGrant = { return message; }, fromAmino(object: MsgGrantAmino): MsgGrant { - return { - granter: object.granter, - grantee: object.grantee, - grant: object?.grant ? Grant.fromAmino(object.grant) : undefined - }; + const message = createBaseMsgGrant(); + if (object.granter !== undefined && object.granter !== null) { + message.granter = object.granter; + } + if (object.grantee !== undefined && object.grantee !== null) { + message.grantee = object.grantee; + } + if (object.grant !== undefined && object.grant !== null) { + message.grant = Grant.fromAmino(object.grant); + } + return message; }, toAmino(message: MsgGrant): MsgGrantAmino { const obj: any = {}; obj.granter = message.granter; obj.grantee = message.grantee; - obj.grant = message.grant ? Grant.toAmino(message.grant) : undefined; + obj.grant = message.grant ? Grant.toAmino(message.grant) : Grant.fromPartial({}); return obj; }, fromAminoMsg(object: MsgGrantAminoMsg): MsgGrant { @@ -295,14 +302,14 @@ export const MsgExecResponse = { return message; }, fromAmino(object: MsgExecResponseAmino): MsgExecResponse { - return { - results: Array.isArray(object?.results) ? object.results.map((e: any) => e) : [] - }; + const message = createBaseMsgExecResponse(); + message.results = object.results?.map(e => bytesFromBase64(e)) || []; + return message; }, toAmino(message: MsgExecResponse): MsgExecResponseAmino { const obj: any = {}; if (message.results) { - obj.results = message.results.map(e => e); + obj.results = message.results.map(e => base64FromBytes(e)); } else { obj.results = []; } @@ -358,7 +365,7 @@ export const MsgExec = { message.grantee = reader.string(); break; case 2: - message.msgs.push((Sdk_MsgauthzAuthorization_InterfaceDecoder(reader) as Any)); + message.msgs.push((Any(reader) as Any)); break; default: reader.skipType(tag & 7); @@ -374,16 +381,18 @@ export const MsgExec = { return message; }, fromAmino(object: MsgExecAmino): MsgExec { - return { - grantee: object.grantee, - msgs: Array.isArray(object?.msgs) ? object.msgs.map((e: any) => Sdk_MsgauthzAuthorization_FromAmino(e)) : [] - }; + const message = createBaseMsgExec(); + if (object.grantee !== undefined && object.grantee !== null) { + message.grantee = object.grantee; + } + message.msgs = object.msgs?.map(e => Cosmos_basev1beta1Msg_FromAmino(e)) || []; + return message; }, toAmino(message: MsgExec): MsgExecAmino { const obj: any = {}; obj.grantee = message.grantee; if (message.msgs) { - obj.msgs = message.msgs.map(e => e ? Sdk_MsgauthzAuthorization_ToAmino((e as Any)) : undefined); + obj.msgs = message.msgs.map(e => e ? Cosmos_basev1beta1Msg_ToAmino((e as Any)) : undefined); } else { obj.msgs = []; } @@ -438,7 +447,8 @@ export const MsgGrantResponse = { return message; }, fromAmino(_: MsgGrantResponseAmino): MsgGrantResponse { - return {}; + const message = createBaseMsgGrantResponse(); + return message; }, toAmino(_: MsgGrantResponse): MsgGrantResponseAmino { const obj: any = {}; @@ -518,11 +528,17 @@ export const MsgRevoke = { return message; }, fromAmino(object: MsgRevokeAmino): MsgRevoke { - return { - granter: object.granter, - grantee: object.grantee, - msgTypeUrl: object.msg_type_url - }; + const message = createBaseMsgRevoke(); + if (object.granter !== undefined && object.granter !== null) { + message.granter = object.granter; + } + if (object.grantee !== undefined && object.grantee !== null) { + message.grantee = object.grantee; + } + if (object.msg_type_url !== undefined && object.msg_type_url !== null) { + message.msgTypeUrl = object.msg_type_url; + } + return message; }, toAmino(message: MsgRevoke): MsgRevokeAmino { const obj: any = {}; @@ -580,7 +596,8 @@ export const MsgRevokeResponse = { return message; }, fromAmino(_: MsgRevokeResponseAmino): MsgRevokeResponse { - return {}; + const message = createBaseMsgRevokeResponse(); + return message; }, toAmino(_: MsgRevokeResponse): MsgRevokeResponseAmino { const obj: any = {}; @@ -608,31 +625,17 @@ export const MsgRevokeResponse = { }; } }; -export const Sdk_Msg_InterfaceDecoder = (input: BinaryReader | Uint8Array): Any => { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - const data = Any.decode(reader, reader.uint32()); - switch (data.typeUrl) { - default: - return data; - } -}; -export const Sdk_Msg_FromAmino = (content: AnyAmino) => { - return Any.fromAmino(content); -}; -export const Sdk_Msg_ToAmino = (content: Any) => { - return Any.toAmino(content); -}; -export const Authz_Authorization_InterfaceDecoder = (input: BinaryReader | Uint8Array): Any => { +export const Cosmos_basev1beta1Msg_InterfaceDecoder = (input: BinaryReader | Uint8Array): Any => { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - const data = Any.decode(reader, reader.uint32()); + const data = Any.decode(reader, reader.uint32(), true); switch (data.typeUrl) { default: return data; } }; -export const Authz_Authorization_FromAmino = (content: AnyAmino) => { +export const Cosmos_basev1beta1Msg_FromAmino = (content: AnyAmino) => { return Any.fromAmino(content); }; -export const Authz_Authorization_ToAmino = (content: Any) => { +export const Cosmos_basev1beta1Msg_ToAmino = (content: Any) => { return Any.toAmino(content); }; \ No newline at end of file diff --git a/packages/osmo-query/src/codegen/cosmos/bank/v1beta1/authz.ts b/packages/osmo-query/src/codegen/cosmos/bank/v1beta1/authz.ts index 1908259e8..cf297a392 100644 --- a/packages/osmo-query/src/codegen/cosmos/bank/v1beta1/authz.ts +++ b/packages/osmo-query/src/codegen/cosmos/bank/v1beta1/authz.ts @@ -7,8 +7,15 @@ import { BinaryReader, BinaryWriter } from "../../../binary"; * Since: cosmos-sdk 0.43 */ export interface SendAuthorization { - $typeUrl?: string; + $typeUrl?: "/cosmos.bank.v1beta1.SendAuthorization"; spendLimit: Coin[]; + /** + * allow_list specifies an optional list of addresses to whom the grantee can send tokens on behalf of the + * granter. If omitted, any recipient is allowed. + * + * Since: cosmos-sdk 0.47 + */ + allowList: string[]; } export interface SendAuthorizationProtoMsg { typeUrl: "/cosmos.bank.v1beta1.SendAuthorization"; @@ -22,6 +29,13 @@ export interface SendAuthorizationProtoMsg { */ export interface SendAuthorizationAmino { spend_limit: CoinAmino[]; + /** + * allow_list specifies an optional list of addresses to whom the grantee can send tokens on behalf of the + * granter. If omitted, any recipient is allowed. + * + * Since: cosmos-sdk 0.47 + */ + allow_list?: string[]; } export interface SendAuthorizationAminoMsg { type: "cosmos-sdk/SendAuthorization"; @@ -34,13 +48,15 @@ export interface SendAuthorizationAminoMsg { * Since: cosmos-sdk 0.43 */ export interface SendAuthorizationSDKType { - $typeUrl?: string; + $typeUrl?: "/cosmos.bank.v1beta1.SendAuthorization"; spend_limit: CoinSDKType[]; + allow_list: string[]; } function createBaseSendAuthorization(): SendAuthorization { return { $typeUrl: "/cosmos.bank.v1beta1.SendAuthorization", - spendLimit: [] + spendLimit: [], + allowList: [] }; } export const SendAuthorization = { @@ -49,6 +65,9 @@ export const SendAuthorization = { for (const v of message.spendLimit) { Coin.encode(v!, writer.uint32(10).fork()).ldelim(); } + for (const v of message.allowList) { + writer.uint32(18).string(v!); + } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): SendAuthorization { @@ -61,6 +80,9 @@ export const SendAuthorization = { case 1: message.spendLimit.push(Coin.decode(reader, reader.uint32())); break; + case 2: + message.allowList.push(reader.string()); + break; default: reader.skipType(tag & 7); break; @@ -71,12 +93,14 @@ export const SendAuthorization = { fromPartial(object: Partial): SendAuthorization { const message = createBaseSendAuthorization(); message.spendLimit = object.spendLimit?.map(e => Coin.fromPartial(e)) || []; + message.allowList = object.allowList?.map(e => e) || []; return message; }, fromAmino(object: SendAuthorizationAmino): SendAuthorization { - return { - spendLimit: Array.isArray(object?.spend_limit) ? object.spend_limit.map((e: any) => Coin.fromAmino(e)) : [] - }; + const message = createBaseSendAuthorization(); + message.spendLimit = object.spend_limit?.map(e => Coin.fromAmino(e)) || []; + message.allowList = object.allow_list?.map(e => e) || []; + return message; }, toAmino(message: SendAuthorization): SendAuthorizationAmino { const obj: any = {}; @@ -85,6 +109,11 @@ export const SendAuthorization = { } else { obj.spend_limit = []; } + if (message.allowList) { + obj.allow_list = message.allowList.map(e => e); + } else { + obj.allow_list = []; + } return obj; }, fromAminoMsg(object: SendAuthorizationAminoMsg): SendAuthorization { diff --git a/packages/osmo-query/src/codegen/cosmos/bank/v1beta1/bank.ts b/packages/osmo-query/src/codegen/cosmos/bank/v1beta1/bank.ts index 169e67c08..66a9344b6 100644 --- a/packages/osmo-query/src/codegen/cosmos/bank/v1beta1/bank.ts +++ b/packages/osmo-query/src/codegen/cosmos/bank/v1beta1/bank.ts @@ -2,6 +2,14 @@ import { Coin, CoinAmino, CoinSDKType } from "../../base/v1beta1/coin"; import { BinaryReader, BinaryWriter } from "../../../binary"; /** Params defines the parameters for the bank module. */ export interface Params { + /** + * Deprecated: Use of SendEnabled in params is deprecated. + * For genesis, use the newly added send_enabled field in the genesis object. + * Storage, lookup, and manipulation of this information is now in the keeper. + * + * As of cosmos-sdk 0.47, this only exists for backwards compatibility of genesis files. + */ + /** @deprecated */ sendEnabled: SendEnabled[]; defaultSendEnabled: boolean; } @@ -11,8 +19,16 @@ export interface ParamsProtoMsg { } /** Params defines the parameters for the bank module. */ export interface ParamsAmino { - send_enabled: SendEnabledAmino[]; - default_send_enabled: boolean; + /** + * Deprecated: Use of SendEnabled in params is deprecated. + * For genesis, use the newly added send_enabled field in the genesis object. + * Storage, lookup, and manipulation of this information is now in the keeper. + * + * As of cosmos-sdk 0.47, this only exists for backwards compatibility of genesis files. + */ + /** @deprecated */ + send_enabled?: SendEnabledAmino[]; + default_send_enabled?: boolean; } export interface ParamsAminoMsg { type: "cosmos-sdk/x/bank/Params"; @@ -20,6 +36,7 @@ export interface ParamsAminoMsg { } /** Params defines the parameters for the bank module. */ export interface ParamsSDKType { + /** @deprecated */ send_enabled: SendEnabledSDKType[]; default_send_enabled: boolean; } @@ -40,8 +57,8 @@ export interface SendEnabledProtoMsg { * sendable). */ export interface SendEnabledAmino { - denom: string; - enabled: boolean; + denom?: string; + enabled?: boolean; } export interface SendEnabledAminoMsg { type: "cosmos-sdk/SendEnabled"; @@ -66,7 +83,7 @@ export interface InputProtoMsg { } /** Input models transaction input. */ export interface InputAmino { - address: string; + address?: string; coins: CoinAmino[]; } export interface InputAminoMsg { @@ -89,7 +106,7 @@ export interface OutputProtoMsg { } /** Output models transaction outputs. */ export interface OutputAmino { - address: string; + address?: string; coins: CoinAmino[]; } export interface OutputAminoMsg { @@ -108,7 +125,7 @@ export interface OutputSDKType { */ /** @deprecated */ export interface Supply { - $typeUrl?: string; + $typeUrl?: "/cosmos.bank.v1beta1.Supply"; total: Coin[]; } export interface SupplyProtoMsg { @@ -135,7 +152,7 @@ export interface SupplyAminoMsg { */ /** @deprecated */ export interface SupplySDKType { - $typeUrl?: string; + $typeUrl?: "/cosmos.bank.v1beta1.Supply"; total: CoinSDKType[]; } /** @@ -148,7 +165,7 @@ export interface DenomUnit { /** * exponent represents power of 10 exponent that one must * raise the base_denom to in order to equal the given DenomUnit's denom - * 1 denom = 1^exponent base_denom + * 1 denom = 10^exponent base_denom * (e.g. with a base_denom of uatom, one can create a DenomUnit of 'atom' with * exponent = 6, thus: 1 atom = 10^6 uatom). */ @@ -166,17 +183,17 @@ export interface DenomUnitProtoMsg { */ export interface DenomUnitAmino { /** 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 - * 1 denom = 1^exponent base_denom + * 1 denom = 10^exponent base_denom * (e.g. with a base_denom of uatom, one can create a DenomUnit of 'atom' with * exponent = 6, thus: 1 atom = 10^6 uatom). */ - exponent: number; + exponent?: number; /** aliases is a list of string aliases for the given denom */ - aliases: string[]; + aliases?: string[]; } export interface DenomUnitAminoMsg { type: "cosmos-sdk/DenomUnit"; @@ -219,6 +236,19 @@ export interface Metadata { * Since: cosmos-sdk 0.43 */ symbol: string; + /** + * URI to a document (on or off-chain) that contains additional information. Optional. + * + * Since: cosmos-sdk 0.46 + */ + uri: string; + /** + * URIHash is a sha256 hash of a document pointed by URI. It's used to verify that + * the document didn't change. Optional. + * + * Since: cosmos-sdk 0.46 + */ + uriHash: string; } export interface MetadataProtoMsg { typeUrl: "/cosmos.bank.v1beta1.Metadata"; @@ -229,29 +259,42 @@ export interface MetadataProtoMsg { * a basic token. */ export interface MetadataAmino { - description: string; + description?: string; /** denom_units represents the list of DenomUnit's for a given coin */ - denom_units: DenomUnitAmino[]; + denom_units?: DenomUnitAmino[]; /** 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; + /** + * URI to a document (on or off-chain) that contains additional information. Optional. + * + * Since: cosmos-sdk 0.46 + */ + uri?: string; + /** + * URIHash is a sha256 hash of a document pointed by URI. It's used to verify that + * the document didn't change. Optional. + * + * Since: cosmos-sdk 0.46 + */ + uri_hash?: string; } export interface MetadataAminoMsg { type: "cosmos-sdk/Metadata"; @@ -268,6 +311,8 @@ export interface MetadataSDKType { display: string; name: string; symbol: string; + uri: string; + uri_hash: string; } function createBaseParams(): Params { return { @@ -313,10 +358,12 @@ export const Params = { return message; }, fromAmino(object: ParamsAmino): Params { - return { - sendEnabled: Array.isArray(object?.send_enabled) ? object.send_enabled.map((e: any) => SendEnabled.fromAmino(e)) : [], - defaultSendEnabled: object.default_send_enabled - }; + const message = createBaseParams(); + message.sendEnabled = object.send_enabled?.map(e => SendEnabled.fromAmino(e)) || []; + if (object.default_send_enabled !== undefined && object.default_send_enabled !== null) { + message.defaultSendEnabled = object.default_send_enabled; + } + return message; }, toAmino(message: Params): ParamsAmino { const obj: any = {}; @@ -394,10 +441,14 @@ export const SendEnabled = { return message; }, fromAmino(object: SendEnabledAmino): SendEnabled { - return { - denom: object.denom, - enabled: object.enabled - }; + const message = createBaseSendEnabled(); + if (object.denom !== undefined && object.denom !== null) { + message.denom = object.denom; + } + if (object.enabled !== undefined && object.enabled !== null) { + message.enabled = object.enabled; + } + return message; }, toAmino(message: SendEnabled): SendEnabledAmino { const obj: any = {}; @@ -471,10 +522,12 @@ export const Input = { return message; }, fromAmino(object: InputAmino): Input { - return { - address: object.address, - coins: Array.isArray(object?.coins) ? object.coins.map((e: any) => Coin.fromAmino(e)) : [] - }; + const message = createBaseInput(); + if (object.address !== undefined && object.address !== null) { + message.address = object.address; + } + message.coins = object.coins?.map(e => Coin.fromAmino(e)) || []; + return message; }, toAmino(message: Input): InputAmino { const obj: any = {}; @@ -552,10 +605,12 @@ export const Output = { return message; }, fromAmino(object: OutputAmino): Output { - return { - address: object.address, - coins: Array.isArray(object?.coins) ? object.coins.map((e: any) => Coin.fromAmino(e)) : [] - }; + const message = createBaseOutput(); + if (object.address !== undefined && object.address !== null) { + message.address = object.address; + } + message.coins = object.coins?.map(e => Coin.fromAmino(e)) || []; + return message; }, toAmino(message: Output): OutputAmino { const obj: any = {}; @@ -626,9 +681,9 @@ export const Supply = { return message; }, fromAmino(object: SupplyAmino): Supply { - return { - total: Array.isArray(object?.total) ? object.total.map((e: any) => Coin.fromAmino(e)) : [] - }; + const message = createBaseSupply(); + message.total = object.total?.map(e => Coin.fromAmino(e)) || []; + return message; }, toAmino(message: Supply): SupplyAmino { const obj: any = {}; @@ -713,11 +768,15 @@ export const DenomUnit = { return message; }, fromAmino(object: DenomUnitAmino): DenomUnit { - return { - denom: object.denom, - exponent: object.exponent, - aliases: Array.isArray(object?.aliases) ? object.aliases.map((e: any) => e) : [] - }; + const message = createBaseDenomUnit(); + if (object.denom !== undefined && object.denom !== null) { + message.denom = object.denom; + } + if (object.exponent !== undefined && object.exponent !== null) { + message.exponent = object.exponent; + } + message.aliases = object.aliases?.map(e => e) || []; + return message; }, toAmino(message: DenomUnit): DenomUnitAmino { const obj: any = {}; @@ -759,7 +818,9 @@ function createBaseMetadata(): Metadata { base: "", display: "", name: "", - symbol: "" + symbol: "", + uri: "", + uriHash: "" }; } export const Metadata = { @@ -783,6 +844,12 @@ export const Metadata = { if (message.symbol !== "") { writer.uint32(50).string(message.symbol); } + if (message.uri !== "") { + writer.uint32(58).string(message.uri); + } + if (message.uriHash !== "") { + writer.uint32(66).string(message.uriHash); + } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): Metadata { @@ -810,6 +877,12 @@ export const Metadata = { case 6: message.symbol = reader.string(); break; + case 7: + message.uri = reader.string(); + break; + case 8: + message.uriHash = reader.string(); + break; default: reader.skipType(tag & 7); break; @@ -825,17 +898,35 @@ export const Metadata = { message.display = object.display ?? ""; message.name = object.name ?? ""; message.symbol = object.symbol ?? ""; + message.uri = object.uri ?? ""; + message.uriHash = object.uriHash ?? ""; return message; }, fromAmino(object: MetadataAmino): Metadata { - return { - description: object.description, - denomUnits: Array.isArray(object?.denom_units) ? object.denom_units.map((e: any) => DenomUnit.fromAmino(e)) : [], - base: object.base, - display: object.display, - name: object.name, - symbol: object.symbol - }; + const message = createBaseMetadata(); + if (object.description !== undefined && object.description !== null) { + message.description = object.description; + } + message.denomUnits = object.denom_units?.map(e => DenomUnit.fromAmino(e)) || []; + if (object.base !== undefined && object.base !== null) { + message.base = object.base; + } + if (object.display !== undefined && object.display !== null) { + message.display = object.display; + } + if (object.name !== undefined && object.name !== null) { + message.name = object.name; + } + if (object.symbol !== undefined && object.symbol !== null) { + message.symbol = object.symbol; + } + if (object.uri !== undefined && object.uri !== null) { + message.uri = object.uri; + } + if (object.uri_hash !== undefined && object.uri_hash !== null) { + message.uriHash = object.uri_hash; + } + return message; }, toAmino(message: Metadata): MetadataAmino { const obj: any = {}; @@ -849,6 +940,8 @@ export const Metadata = { obj.display = message.display; obj.name = message.name; obj.symbol = message.symbol; + obj.uri = message.uri; + obj.uri_hash = message.uriHash; return obj; }, fromAminoMsg(object: MetadataAminoMsg): Metadata { diff --git a/packages/osmo-query/src/codegen/cosmos/bank/v1beta1/genesis.ts b/packages/osmo-query/src/codegen/cosmos/bank/v1beta1/genesis.ts index 1c22960ac..7a04210fd 100644 --- a/packages/osmo-query/src/codegen/cosmos/bank/v1beta1/genesis.ts +++ b/packages/osmo-query/src/codegen/cosmos/bank/v1beta1/genesis.ts @@ -1,9 +1,9 @@ -import { Params, ParamsAmino, ParamsSDKType, Metadata, MetadataAmino, MetadataSDKType } from "./bank"; +import { Params, ParamsAmino, ParamsSDKType, Metadata, MetadataAmino, MetadataSDKType, SendEnabled, SendEnabledAmino, SendEnabledSDKType } from "./bank"; import { Coin, CoinAmino, CoinSDKType } from "../../base/v1beta1/coin"; import { BinaryReader, BinaryWriter } from "../../../binary"; /** GenesisState defines the bank module's genesis state. */ export interface GenesisState { - /** params defines all the paramaters of the module. */ + /** params defines all the parameters of the module. */ params: Params; /** balances is an array containing the balances of all the accounts. */ balances: Balance[]; @@ -12,10 +12,14 @@ export interface GenesisState { * balances. Otherwise, it will be used to validate that the sum of the balances equals this amount. */ supply: Coin[]; - /** denom_metadata defines the metadata of the differents coins. */ + /** denom_metadata defines the metadata of the different coins. */ denomMetadata: Metadata[]; - /** supply_offsets defines the amount of supply offset. */ - supplyOffsets: GenesisSupplyOffset[]; + /** + * send_enabled defines the denoms where send is enabled or disabled. + * + * Since: cosmos-sdk 0.47 + */ + sendEnabled: SendEnabled[]; } export interface GenesisStateProtoMsg { typeUrl: "/cosmos.bank.v1beta1.GenesisState"; @@ -23,8 +27,8 @@ export interface GenesisStateProtoMsg { } /** GenesisState defines the bank module's genesis state. */ export interface GenesisStateAmino { - /** params defines all the paramaters of the module. */ - params?: ParamsAmino; + /** params defines all the parameters of the module. */ + params: ParamsAmino; /** balances is an array containing the balances of all the accounts. */ balances: BalanceAmino[]; /** @@ -32,10 +36,14 @@ export interface GenesisStateAmino { * balances. Otherwise, it will be used to validate that the sum of the balances equals this amount. */ supply: CoinAmino[]; - /** denom_metadata defines the metadata of the differents coins. */ + /** denom_metadata defines the metadata of the different coins. */ denom_metadata: MetadataAmino[]; - /** supply_offsets defines the amount of supply offset. */ - supply_offsets: GenesisSupplyOffsetAmino[]; + /** + * send_enabled defines the denoms where send is enabled or disabled. + * + * Since: cosmos-sdk 0.47 + */ + send_enabled: SendEnabledAmino[]; } export interface GenesisStateAminoMsg { type: "cosmos-sdk/GenesisState"; @@ -47,7 +55,7 @@ export interface GenesisStateSDKType { balances: BalanceSDKType[]; supply: CoinSDKType[]; denom_metadata: MetadataSDKType[]; - supply_offsets: GenesisSupplyOffsetSDKType[]; + send_enabled: SendEnabledSDKType[]; } /** * Balance defines an account address and balance pair used in the bank module's @@ -69,7 +77,7 @@ export interface BalanceProtoMsg { */ export interface BalanceAmino { /** address is the address of the balance holder. */ - address: string; + address?: string; /** coins defines the different coins this balance holds. */ coins: CoinAmino[]; } @@ -85,49 +93,13 @@ export interface BalanceSDKType { address: string; coins: CoinSDKType[]; } -/** - * GenesisSupplyOffset encodes the supply offsets, just for genesis. - * The offsets are serialized directly by denom in state. - */ -export interface GenesisSupplyOffset { - /** Denom */ - denom: string; - /** SupplyOffset */ - offset: string; -} -export interface GenesisSupplyOffsetProtoMsg { - typeUrl: "/cosmos.bank.v1beta1.GenesisSupplyOffset"; - value: Uint8Array; -} -/** - * GenesisSupplyOffset encodes the supply offsets, just for genesis. - * The offsets are serialized directly by denom in state. - */ -export interface GenesisSupplyOffsetAmino { - /** Denom */ - denom: string; - /** SupplyOffset */ - offset: string; -} -export interface GenesisSupplyOffsetAminoMsg { - type: "cosmos-sdk/GenesisSupplyOffset"; - value: GenesisSupplyOffsetAmino; -} -/** - * GenesisSupplyOffset encodes the supply offsets, just for genesis. - * The offsets are serialized directly by denom in state. - */ -export interface GenesisSupplyOffsetSDKType { - denom: string; - offset: string; -} function createBaseGenesisState(): GenesisState { return { params: Params.fromPartial({}), balances: [], supply: [], denomMetadata: [], - supplyOffsets: [] + sendEnabled: [] }; } export const GenesisState = { @@ -145,8 +117,8 @@ export const GenesisState = { for (const v of message.denomMetadata) { Metadata.encode(v!, writer.uint32(34).fork()).ldelim(); } - for (const v of message.supplyOffsets) { - GenesisSupplyOffset.encode(v!, writer.uint32(42).fork()).ldelim(); + for (const v of message.sendEnabled) { + SendEnabled.encode(v!, writer.uint32(42).fork()).ldelim(); } return writer; }, @@ -170,7 +142,7 @@ export const GenesisState = { message.denomMetadata.push(Metadata.decode(reader, reader.uint32())); break; case 5: - message.supplyOffsets.push(GenesisSupplyOffset.decode(reader, reader.uint32())); + message.sendEnabled.push(SendEnabled.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -185,21 +157,23 @@ export const GenesisState = { 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)) || []; - message.supplyOffsets = object.supplyOffsets?.map(e => GenesisSupplyOffset.fromPartial(e)) || []; + message.sendEnabled = object.sendEnabled?.map(e => SendEnabled.fromPartial(e)) || []; return message; }, fromAmino(object: GenesisStateAmino): GenesisState { - return { - params: object?.params ? Params.fromAmino(object.params) : undefined, - balances: Array.isArray(object?.balances) ? object.balances.map((e: any) => Balance.fromAmino(e)) : [], - supply: Array.isArray(object?.supply) ? object.supply.map((e: any) => Coin.fromAmino(e)) : [], - denomMetadata: Array.isArray(object?.denom_metadata) ? object.denom_metadata.map((e: any) => Metadata.fromAmino(e)) : [], - supplyOffsets: Array.isArray(object?.supply_offsets) ? object.supply_offsets.map((e: any) => GenesisSupplyOffset.fromAmino(e)) : [] - }; + const message = createBaseGenesisState(); + if (object.params !== undefined && object.params !== null) { + message.params = Params.fromAmino(object.params); + } + message.balances = object.balances?.map(e => Balance.fromAmino(e)) || []; + message.supply = object.supply?.map(e => Coin.fromAmino(e)) || []; + message.denomMetadata = object.denom_metadata?.map(e => Metadata.fromAmino(e)) || []; + message.sendEnabled = object.send_enabled?.map(e => SendEnabled.fromAmino(e)) || []; + return message; }, toAmino(message: GenesisState): GenesisStateAmino { const obj: any = {}; - obj.params = message.params ? Params.toAmino(message.params) : undefined; + obj.params = message.params ? Params.toAmino(message.params) : Params.fromPartial({}); if (message.balances) { obj.balances = message.balances.map(e => e ? Balance.toAmino(e) : undefined); } else { @@ -215,10 +189,10 @@ export const GenesisState = { } else { obj.denom_metadata = []; } - if (message.supplyOffsets) { - obj.supply_offsets = message.supplyOffsets.map(e => e ? GenesisSupplyOffset.toAmino(e) : undefined); + if (message.sendEnabled) { + obj.send_enabled = message.sendEnabled.map(e => e ? SendEnabled.toAmino(e) : undefined); } else { - obj.supply_offsets = []; + obj.send_enabled = []; } return obj; }, @@ -288,10 +262,12 @@ export const Balance = { return message; }, fromAmino(object: BalanceAmino): Balance { - return { - address: object.address, - coins: Array.isArray(object?.coins) ? object.coins.map((e: any) => Coin.fromAmino(e)) : [] - }; + const message = createBaseBalance(); + if (object.address !== undefined && object.address !== null) { + message.address = object.address; + } + message.coins = object.coins?.map(e => Coin.fromAmino(e)) || []; + return message; }, toAmino(message: Balance): BalanceAmino { const obj: any = {}; @@ -324,81 +300,4 @@ export const Balance = { value: Balance.encode(message).finish() }; } -}; -function createBaseGenesisSupplyOffset(): GenesisSupplyOffset { - return { - denom: "", - offset: "" - }; -} -export const GenesisSupplyOffset = { - typeUrl: "/cosmos.bank.v1beta1.GenesisSupplyOffset", - encode(message: GenesisSupplyOffset, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { - if (message.denom !== "") { - writer.uint32(10).string(message.denom); - } - if (message.offset !== "") { - writer.uint32(18).string(message.offset); - } - return writer; - }, - decode(input: BinaryReader | Uint8Array, length?: number): GenesisSupplyOffset { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseGenesisSupplyOffset(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.denom = reader.string(); - break; - case 2: - message.offset = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - fromPartial(object: Partial): GenesisSupplyOffset { - const message = createBaseGenesisSupplyOffset(); - message.denom = object.denom ?? ""; - message.offset = object.offset ?? ""; - return message; - }, - fromAmino(object: GenesisSupplyOffsetAmino): GenesisSupplyOffset { - return { - denom: object.denom, - offset: object.offset - }; - }, - toAmino(message: GenesisSupplyOffset): GenesisSupplyOffsetAmino { - const obj: any = {}; - obj.denom = message.denom; - obj.offset = message.offset; - return obj; - }, - fromAminoMsg(object: GenesisSupplyOffsetAminoMsg): GenesisSupplyOffset { - return GenesisSupplyOffset.fromAmino(object.value); - }, - toAminoMsg(message: GenesisSupplyOffset): GenesisSupplyOffsetAminoMsg { - return { - type: "cosmos-sdk/GenesisSupplyOffset", - value: GenesisSupplyOffset.toAmino(message) - }; - }, - fromProtoMsg(message: GenesisSupplyOffsetProtoMsg): GenesisSupplyOffset { - return GenesisSupplyOffset.decode(message.value); - }, - toProto(message: GenesisSupplyOffset): Uint8Array { - return GenesisSupplyOffset.encode(message).finish(); - }, - toProtoMsg(message: GenesisSupplyOffset): GenesisSupplyOffsetProtoMsg { - return { - typeUrl: "/cosmos.bank.v1beta1.GenesisSupplyOffset", - value: GenesisSupplyOffset.encode(message).finish() - }; - } }; \ No newline at end of file diff --git a/packages/osmo-query/src/codegen/cosmos/bank/v1beta1/query.lcd.ts b/packages/osmo-query/src/codegen/cosmos/bank/v1beta1/query.lcd.ts index f0b7f999a..51f71073a 100644 --- a/packages/osmo-query/src/codegen/cosmos/bank/v1beta1/query.lcd.ts +++ b/packages/osmo-query/src/codegen/cosmos/bank/v1beta1/query.lcd.ts @@ -1,6 +1,6 @@ import { setPaginationParams } from "../../../helpers"; import { LCDClient } from "@cosmology/lcd"; -import { QueryBalanceRequest, QueryBalanceResponseSDKType, QueryAllBalancesRequest, QueryAllBalancesResponseSDKType, QueryTotalSupplyRequest, QueryTotalSupplyResponseSDKType, QuerySupplyOfRequest, QuerySupplyOfResponseSDKType, QueryTotalSupplyWithoutOffsetRequest, QueryTotalSupplyWithoutOffsetResponseSDKType, QuerySupplyOfWithoutOffsetRequest, QuerySupplyOfWithoutOffsetResponseSDKType, QueryParamsRequest, QueryParamsResponseSDKType, QueryDenomMetadataRequest, QueryDenomMetadataResponseSDKType, QueryDenomsMetadataRequest, QueryDenomsMetadataResponseSDKType, QueryBaseDenomRequest, QueryBaseDenomResponseSDKType } from "./query"; +import { QueryBalanceRequest, QueryBalanceResponseSDKType, QueryAllBalancesRequest, QueryAllBalancesResponseSDKType, QuerySpendableBalancesRequest, QuerySpendableBalancesResponseSDKType, QuerySpendableBalanceByDenomRequest, QuerySpendableBalanceByDenomResponseSDKType, QueryTotalSupplyRequest, QueryTotalSupplyResponseSDKType, QuerySupplyOfRequest, QuerySupplyOfResponseSDKType, QueryTotalSupplyWithoutOffsetRequest, QueryTotalSupplyWithoutOffsetResponseSDKType, QuerySupplyOfWithoutOffsetRequest, QuerySupplyOfWithoutOffsetResponseSDKType, QueryParamsRequest, QueryParamsResponseSDKType, QueryDenomMetadataRequest, QueryDenomMetadataResponseSDKType, QueryDenomsMetadataRequest, QueryDenomsMetadataResponseSDKType, QueryDenomOwnersRequest, QueryDenomOwnersResponseSDKType, QuerySendEnabledRequest, QuerySendEnabledResponseSDKType } from "./query"; export class LCDQueryClient { req: LCDClient; constructor({ @@ -11,6 +11,8 @@ export class LCDQueryClient { this.req = requestClient; this.balance = this.balance.bind(this); this.allBalances = this.allBalances.bind(this); + this.spendableBalances = this.spendableBalances.bind(this); + this.spendableBalanceByDenom = this.spendableBalanceByDenom.bind(this); this.totalSupply = this.totalSupply.bind(this); this.supplyOf = this.supplyOf.bind(this); this.totalSupplyWithoutOffset = this.totalSupplyWithoutOffset.bind(this); @@ -18,7 +20,8 @@ export class LCDQueryClient { this.params = this.params.bind(this); this.denomMetadata = this.denomMetadata.bind(this); this.denomsMetadata = this.denomsMetadata.bind(this); - this.baseDenom = this.baseDenom.bind(this); + this.denomOwners = this.denomOwners.bind(this); + this.sendEnabled = this.sendEnabled.bind(this); } /* Balance queries the balance of a single coin for a single account. */ async balance(params: QueryBalanceRequest): Promise { @@ -31,7 +34,10 @@ export class LCDQueryClient { const endpoint = `cosmos/bank/v1beta1/balances/${params.address}/by_denom`; return await this.req.get(endpoint, options); } - /* AllBalances queries the balance of all coins for a single account. */ + /* AllBalances queries the balance of all coins for a single account. + + When called from another module, this query might consume a high amount of + gas if the pagination field is incorrectly set. */ async allBalances(params: QueryAllBalancesRequest): Promise { const options: any = { params: {} @@ -42,7 +48,44 @@ export class LCDQueryClient { const endpoint = `cosmos/bank/v1beta1/balances/${params.address}`; return await this.req.get(endpoint, options); } - /* TotalSupply queries the total supply of all coins. */ + /* SpendableBalances queries the spendable balance of all coins for a single + account. + + When called from another module, this query might consume a high amount of + gas if the pagination field is incorrectly set. + + Since: cosmos-sdk 0.46 */ + async spendableBalances(params: QuerySpendableBalancesRequest): Promise { + const options: any = { + params: {} + }; + if (typeof params?.pagination !== "undefined") { + setPaginationParams(options, params.pagination); + } + const endpoint = `cosmos/bank/v1beta1/spendable_balances/${params.address}`; + return await this.req.get(endpoint, options); + } + /* SpendableBalanceByDenom queries the spendable balance of a single denom for + a single account. + + When called from another module, this query might consume a high amount of + gas if the pagination field is incorrectly set. + + Since: cosmos-sdk 0.47 */ + async spendableBalanceByDenom(params: QuerySpendableBalanceByDenomRequest): Promise { + const options: any = { + params: {} + }; + if (typeof params?.denom !== "undefined") { + options.params.denom = params.denom; + } + const endpoint = `cosmos/bank/v1beta1/spendable_balances/${params.address}/by_denom`; + return await this.req.get(endpoint, options); + } + /* TotalSupply queries the total supply of all coins. + + When called from another module, this query might consume a high amount of + gas if the pagination field is incorrectly set. */ async totalSupply(params: QueryTotalSupplyRequest = { pagination: undefined }): Promise { @@ -55,10 +98,19 @@ export class LCDQueryClient { const endpoint = `cosmos/bank/v1beta1/supply`; return await this.req.get(endpoint, options); } - /* SupplyOf queries the supply of a single coin. */ + /* SupplyOf queries the supply of a single coin. + + When called from another module, this query might consume a high amount of + gas if the pagination field is incorrectly set. */ async supplyOf(params: QuerySupplyOfRequest): Promise { - const endpoint = `cosmos/bank/v1beta1/supply/${params.denom}`; - return await this.req.get(endpoint); + const options: any = { + params: {} + }; + if (typeof params?.denom !== "undefined") { + options.params.denom = params.denom; + } + const endpoint = `cosmos/bank/v1beta1/supply/by_denom`; + return await this.req.get(endpoint, options); } /* TotalSupplyWithoutOffset queries the total supply of all coins. */ async totalSupplyWithoutOffset(params: QueryTotalSupplyWithoutOffsetRequest = { @@ -88,7 +140,8 @@ export class LCDQueryClient { const endpoint = `cosmos/bank/v1beta1/denoms_metadata/${params.denom}`; return await this.req.get(endpoint); } - /* DenomsMetadata queries the client metadata for all registered coin denominations. */ + /* DenomsMetadata queries the client metadata for all registered coin + denominations. */ async denomsMetadata(params: QueryDenomsMetadataRequest = { pagination: undefined }): Promise { @@ -101,16 +154,41 @@ export class LCDQueryClient { const endpoint = `cosmos/bank/v1beta1/denoms_metadata`; return await this.req.get(endpoint, options); } - /* BaseDenom queries for a base denomination given a denom that can either be - the base denom itself or a metadata denom unit that maps to the base denom. */ - async baseDenom(params: QueryBaseDenomRequest): Promise { + /* DenomOwners queries for all account addresses that own a particular token + denomination. + + When called from another module, this query might consume a high amount of + gas if the pagination field is incorrectly set. + + Since: cosmos-sdk 0.46 */ + async denomOwners(params: QueryDenomOwnersRequest): Promise { const options: any = { params: {} }; - if (typeof params?.denom !== "undefined") { - options.params.denom = params.denom; + if (typeof params?.pagination !== "undefined") { + setPaginationParams(options, params.pagination); + } + const endpoint = `cosmos/bank/v1beta1/denom_owners/${params.denom}`; + return await this.req.get(endpoint, options); + } + /* SendEnabled queries for SendEnabled entries. + + This query only returns denominations that have specific SendEnabled settings. + Any denomination that does not have a specific setting will use the default + params.default_send_enabled, and will not be returned by this query. + + Since: cosmos-sdk 0.47 */ + async sendEnabled(params: QuerySendEnabledRequest): Promise { + const options: any = { + params: {} + }; + if (typeof params?.denoms !== "undefined") { + options.params.denoms = params.denoms; + } + if (typeof params?.pagination !== "undefined") { + setPaginationParams(options, params.pagination); } - const endpoint = `cosmos/bank/v1beta1/base_denom`; - return await this.req.get(endpoint, options); + const endpoint = `cosmos/bank/v1beta1/send_enabled`; + return await this.req.get(endpoint, options); } } \ No newline at end of file diff --git a/packages/osmo-query/src/codegen/cosmos/bank/v1beta1/query.rpc.Query.ts b/packages/osmo-query/src/codegen/cosmos/bank/v1beta1/query.rpc.Query.ts index 66283f81c..2f4dfe415 100644 --- a/packages/osmo-query/src/codegen/cosmos/bank/v1beta1/query.rpc.Query.ts +++ b/packages/osmo-query/src/codegen/cosmos/bank/v1beta1/query.rpc.Query.ts @@ -3,16 +3,51 @@ import { BinaryReader } from "../../../binary"; import { QueryClient, createProtobufRpcClient, ProtobufRpcClient } from "@cosmjs/stargate"; import { ReactQueryParams } from "../../../react-query"; import { useQuery } from "@tanstack/react-query"; -import { QueryBalanceRequest, QueryBalanceResponse, QueryAllBalancesRequest, QueryAllBalancesResponse, QueryTotalSupplyRequest, QueryTotalSupplyResponse, QuerySupplyOfRequest, QuerySupplyOfResponse, QueryTotalSupplyWithoutOffsetRequest, QueryTotalSupplyWithoutOffsetResponse, QuerySupplyOfWithoutOffsetRequest, QuerySupplyOfWithoutOffsetResponse, QueryParamsRequest, QueryParamsResponse, QueryDenomMetadataRequest, QueryDenomMetadataResponse, QueryDenomsMetadataRequest, QueryDenomsMetadataResponse, QueryBaseDenomRequest, QueryBaseDenomResponse } from "./query"; +import { QueryBalanceRequest, QueryBalanceResponse, QueryAllBalancesRequest, QueryAllBalancesResponse, QuerySpendableBalancesRequest, QuerySpendableBalancesResponse, QuerySpendableBalanceByDenomRequest, QuerySpendableBalanceByDenomResponse, QueryTotalSupplyRequest, QueryTotalSupplyResponse, QuerySupplyOfRequest, QuerySupplyOfResponse, QueryTotalSupplyWithoutOffsetRequest, QueryTotalSupplyWithoutOffsetResponse, QuerySupplyOfWithoutOffsetRequest, QuerySupplyOfWithoutOffsetResponse, QueryParamsRequest, QueryParamsResponse, QueryDenomMetadataRequest, QueryDenomMetadataResponse, QueryDenomsMetadataRequest, QueryDenomsMetadataResponse, QueryDenomOwnersRequest, QueryDenomOwnersResponse, QuerySendEnabledRequest, QuerySendEnabledResponse } from "./query"; /** 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; - /** AllBalances queries the balance of all coins for a single account. */ + /** + * AllBalances queries the balance of all coins for a single account. + * + * When called from another module, this query might consume a high amount of + * gas if the pagination field is incorrectly set. + */ allBalances(request: QueryAllBalancesRequest): Promise; - /** TotalSupply queries the total supply of all coins. */ + /** + * SpendableBalances queries the spendable balance of all coins for a single + * account. + * + * When called from another module, this query might consume a high amount of + * gas if the pagination field is incorrectly set. + * + * Since: cosmos-sdk 0.46 + */ + spendableBalances(request: QuerySpendableBalancesRequest): Promise; + /** + * SpendableBalanceByDenom queries the spendable balance of a single denom for + * a single account. + * + * When called from another module, this query might consume a high amount of + * gas if the pagination field is incorrectly set. + * + * Since: cosmos-sdk 0.47 + */ + spendableBalanceByDenom(request: QuerySpendableBalanceByDenomRequest): Promise; + /** + * TotalSupply queries the total supply of all coins. + * + * When called from another module, this query might consume a high amount of + * gas if the pagination field is incorrectly set. + */ totalSupply(request?: QueryTotalSupplyRequest): Promise; - /** SupplyOf queries the supply of a single coin. */ + /** + * SupplyOf queries the supply of a single coin. + * + * When called from another module, this query might consume a high amount of + * gas if the pagination field is incorrectly set. + */ supplyOf(request: QuerySupplyOfRequest): Promise; /** TotalSupplyWithoutOffset queries the total supply of all coins. */ totalSupplyWithoutOffset(request?: QueryTotalSupplyWithoutOffsetRequest): Promise; @@ -22,13 +57,31 @@ export interface Query { params(request?: QueryParamsRequest): Promise; /** DenomsMetadata queries the client metadata of a given coin denomination. */ denomMetadata(request: QueryDenomMetadataRequest): Promise; - /** DenomsMetadata queries the client metadata for all registered coin denominations. */ + /** + * DenomsMetadata queries the client metadata for all registered coin + * denominations. + */ denomsMetadata(request?: QueryDenomsMetadataRequest): Promise; /** - * BaseDenom queries for a base denomination given a denom that can either be - * the base denom itself or a metadata denom unit that maps to the base denom. + * DenomOwners queries for all account addresses that own a particular token + * denomination. + * + * When called from another module, this query might consume a high amount of + * gas if the pagination field is incorrectly set. + * + * Since: cosmos-sdk 0.46 */ - baseDenom(request: QueryBaseDenomRequest): Promise; + denomOwners(request: QueryDenomOwnersRequest): Promise; + /** + * SendEnabled queries for SendEnabled entries. + * + * This query only returns denominations that have specific SendEnabled settings. + * Any denomination that does not have a specific setting will use the default + * params.default_send_enabled, and will not be returned by this query. + * + * Since: cosmos-sdk 0.47 + */ + sendEnabled(request: QuerySendEnabledRequest): Promise; } export class QueryClientImpl implements Query { private readonly rpc: Rpc; @@ -36,6 +89,8 @@ export class QueryClientImpl implements Query { this.rpc = rpc; this.balance = this.balance.bind(this); this.allBalances = this.allBalances.bind(this); + this.spendableBalances = this.spendableBalances.bind(this); + this.spendableBalanceByDenom = this.spendableBalanceByDenom.bind(this); this.totalSupply = this.totalSupply.bind(this); this.supplyOf = this.supplyOf.bind(this); this.totalSupplyWithoutOffset = this.totalSupplyWithoutOffset.bind(this); @@ -43,7 +98,8 @@ export class QueryClientImpl implements Query { this.params = this.params.bind(this); this.denomMetadata = this.denomMetadata.bind(this); this.denomsMetadata = this.denomsMetadata.bind(this); - this.baseDenom = this.baseDenom.bind(this); + this.denomOwners = this.denomOwners.bind(this); + this.sendEnabled = this.sendEnabled.bind(this); } balance(request: QueryBalanceRequest): Promise { const data = QueryBalanceRequest.encode(request).finish(); @@ -55,6 +111,16 @@ export class QueryClientImpl implements Query { const promise = this.rpc.request("cosmos.bank.v1beta1.Query", "AllBalances", data); return promise.then(data => QueryAllBalancesResponse.decode(new BinaryReader(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 BinaryReader(data))); + } + spendableBalanceByDenom(request: QuerySpendableBalanceByDenomRequest): Promise { + const data = QuerySpendableBalanceByDenomRequest.encode(request).finish(); + const promise = this.rpc.request("cosmos.bank.v1beta1.Query", "SpendableBalanceByDenom", data); + return promise.then(data => QuerySpendableBalanceByDenomResponse.decode(new BinaryReader(data))); + } totalSupply(request: QueryTotalSupplyRequest = { pagination: undefined }): Promise { @@ -96,10 +162,15 @@ export class QueryClientImpl implements Query { const promise = this.rpc.request("cosmos.bank.v1beta1.Query", "DenomsMetadata", data); return promise.then(data => QueryDenomsMetadataResponse.decode(new BinaryReader(data))); } - baseDenom(request: QueryBaseDenomRequest): Promise { - const data = QueryBaseDenomRequest.encode(request).finish(); - const promise = this.rpc.request("cosmos.bank.v1beta1.Query", "BaseDenom", data); - return promise.then(data => QueryBaseDenomResponse.decode(new BinaryReader(data))); + denomOwners(request: QueryDenomOwnersRequest): Promise { + const data = QueryDenomOwnersRequest.encode(request).finish(); + const promise = this.rpc.request("cosmos.bank.v1beta1.Query", "DenomOwners", data); + return promise.then(data => QueryDenomOwnersResponse.decode(new BinaryReader(data))); + } + sendEnabled(request: QuerySendEnabledRequest): Promise { + const data = QuerySendEnabledRequest.encode(request).finish(); + const promise = this.rpc.request("cosmos.bank.v1beta1.Query", "SendEnabled", data); + return promise.then(data => QuerySendEnabledResponse.decode(new BinaryReader(data))); } } export const createRpcQueryExtension = (base: QueryClient) => { @@ -112,6 +183,12 @@ export const createRpcQueryExtension = (base: QueryClient) => { allBalances(request: QueryAllBalancesRequest): Promise { return queryService.allBalances(request); }, + spendableBalances(request: QuerySpendableBalancesRequest): Promise { + return queryService.spendableBalances(request); + }, + spendableBalanceByDenom(request: QuerySpendableBalanceByDenomRequest): Promise { + return queryService.spendableBalanceByDenom(request); + }, totalSupply(request?: QueryTotalSupplyRequest): Promise { return queryService.totalSupply(request); }, @@ -133,8 +210,11 @@ export const createRpcQueryExtension = (base: QueryClient) => { denomsMetadata(request?: QueryDenomsMetadataRequest): Promise { return queryService.denomsMetadata(request); }, - baseDenom(request: QueryBaseDenomRequest): Promise { - return queryService.baseDenom(request); + denomOwners(request: QueryDenomOwnersRequest): Promise { + return queryService.denomOwners(request); + }, + sendEnabled(request: QuerySendEnabledRequest): Promise { + return queryService.sendEnabled(request); } }; }; @@ -144,6 +224,12 @@ export interface UseBalanceQuery extends ReactQueryParams extends ReactQueryParams { request: QueryAllBalancesRequest; } +export interface UseSpendableBalancesQuery extends ReactQueryParams { + request: QuerySpendableBalancesRequest; +} +export interface UseSpendableBalanceByDenomQuery extends ReactQueryParams { + request: QuerySpendableBalanceByDenomRequest; +} export interface UseTotalSupplyQuery extends ReactQueryParams { request?: QueryTotalSupplyRequest; } @@ -165,8 +251,11 @@ export interface UseDenomMetadataQuery extends ReactQueryParams extends ReactQueryParams { request?: QueryDenomsMetadataRequest; } -export interface UseBaseDenomQuery extends ReactQueryParams { - request: QueryBaseDenomRequest; +export interface UseDenomOwnersQuery extends ReactQueryParams { + request: QueryDenomOwnersRequest; +} +export interface UseSendEnabledQuery extends ReactQueryParams { + request: QuerySendEnabledRequest; } const _queryClients: WeakMap = new WeakMap(); const getQueryService = (rpc: ProtobufRpcClient | undefined): QueryClientImpl | undefined => { @@ -198,6 +287,24 @@ export const createRpcQueryHooks = (rpc: ProtobufRpcClient | undefined) => { return queryService.allBalances(request); }, options); }; + const useSpendableBalances = ({ + request, + options + }: UseSpendableBalancesQuery) => { + return useQuery(["spendableBalancesQuery", request], () => { + if (!queryService) throw new Error("Query Service not initialized"); + return queryService.spendableBalances(request); + }, options); + }; + const useSpendableBalanceByDenom = ({ + request, + options + }: UseSpendableBalanceByDenomQuery) => { + return useQuery(["spendableBalanceByDenomQuery", request], () => { + if (!queryService) throw new Error("Query Service not initialized"); + return queryService.spendableBalanceByDenom(request); + }, options); + }; const useTotalSupply = ({ request, options @@ -261,29 +368,95 @@ export const createRpcQueryHooks = (rpc: ProtobufRpcClient | undefined) => { return queryService.denomsMetadata(request); }, options); }; - const useBaseDenom = ({ + const useDenomOwners = ({ request, options - }: UseBaseDenomQuery) => { - return useQuery(["baseDenomQuery", request], () => { + }: UseDenomOwnersQuery) => { + return useQuery(["denomOwnersQuery", request], () => { if (!queryService) throw new Error("Query Service not initialized"); - return queryService.baseDenom(request); + return queryService.denomOwners(request); + }, options); + }; + const useSendEnabled = ({ + request, + options + }: UseSendEnabledQuery) => { + return useQuery(["sendEnabledQuery", request], () => { + if (!queryService) throw new Error("Query Service not initialized"); + return queryService.sendEnabled(request); }, options); }; return { /** Balance queries the balance of a single coin for a single account. */useBalance, - /** AllBalances queries the balance of all coins for a single account. */useAllBalances, - /** TotalSupply queries the total supply of all coins. */useTotalSupply, - /** SupplyOf queries the supply of a single coin. */useSupplyOf, + /** + * AllBalances queries the balance of all coins for a single account. + * + * When called from another module, this query might consume a high amount of + * gas if the pagination field is incorrectly set. + */ + useAllBalances, + /** + * SpendableBalances queries the spendable balance of all coins for a single + * account. + * + * When called from another module, this query might consume a high amount of + * gas if the pagination field is incorrectly set. + * + * Since: cosmos-sdk 0.46 + */ + useSpendableBalances, + /** + * SpendableBalanceByDenom queries the spendable balance of a single denom for + * a single account. + * + * When called from another module, this query might consume a high amount of + * gas if the pagination field is incorrectly set. + * + * Since: cosmos-sdk 0.47 + */ + useSpendableBalanceByDenom, + /** + * TotalSupply queries the total supply of all coins. + * + * When called from another module, this query might consume a high amount of + * gas if the pagination field is incorrectly set. + */ + useTotalSupply, + /** + * SupplyOf queries the supply of a single coin. + * + * When called from another module, this query might consume a high amount of + * gas if the pagination field is incorrectly set. + */ + useSupplyOf, /** TotalSupplyWithoutOffset queries the total supply of all coins. */useTotalSupplyWithoutOffset, /** SupplyOf queries the supply of a single coin. */useSupplyOfWithoutOffset, /** Params queries the parameters of x/bank module. */useParams, /** DenomsMetadata queries the client metadata of a given coin denomination. */useDenomMetadata, - /** DenomsMetadata queries the client metadata for all registered coin denominations. */useDenomsMetadata, /** - * BaseDenom queries for a base denomination given a denom that can either be - * the base denom itself or a metadata denom unit that maps to the base denom. + * DenomsMetadata queries the client metadata for all registered coin + * denominations. + */ + useDenomsMetadata, + /** + * DenomOwners queries for all account addresses that own a particular token + * denomination. + * + * When called from another module, this query might consume a high amount of + * gas if the pagination field is incorrectly set. + * + * Since: cosmos-sdk 0.46 + */ + useDenomOwners, + /** + * SendEnabled queries for SendEnabled entries. + * + * This query only returns denominations that have specific SendEnabled settings. + * Any denomination that does not have a specific setting will use the default + * params.default_send_enabled, and will not be returned by this query. + * + * Since: cosmos-sdk 0.47 */ - useBaseDenom + useSendEnabled }; }; \ No newline at end of file diff --git a/packages/osmo-query/src/codegen/cosmos/bank/v1beta1/query.ts b/packages/osmo-query/src/codegen/cosmos/bank/v1beta1/query.ts index 56fbe3cb8..b1711da1f 100644 --- a/packages/osmo-query/src/codegen/cosmos/bank/v1beta1/query.ts +++ b/packages/osmo-query/src/codegen/cosmos/bank/v1beta1/query.ts @@ -1,6 +1,6 @@ import { PageRequest, PageRequestAmino, PageRequestSDKType, PageResponse, PageResponseAmino, PageResponseSDKType } from "../../base/query/v1beta1/pagination"; import { Coin, CoinAmino, CoinSDKType } from "../../base/v1beta1/coin"; -import { Params, ParamsAmino, ParamsSDKType, Metadata, MetadataAmino, MetadataSDKType } from "./bank"; +import { Params, ParamsAmino, ParamsSDKType, Metadata, MetadataAmino, MetadataSDKType, SendEnabled, SendEnabledAmino, SendEnabledSDKType } from "./bank"; import { BinaryReader, BinaryWriter } from "../../../binary"; /** QueryBalanceRequest is the request type for the Query/Balance RPC method. */ export interface QueryBalanceRequest { @@ -16,9 +16,9 @@ export interface QueryBalanceRequestProtoMsg { /** QueryBalanceRequest is the request type for the Query/Balance RPC method. */ export interface QueryBalanceRequestAmino { /** 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; } export interface QueryBalanceRequestAminoMsg { type: "cosmos-sdk/QueryBalanceRequest"; @@ -32,7 +32,7 @@ export interface QueryBalanceRequestSDKType { /** 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; } export interface QueryBalanceResponseProtoMsg { typeUrl: "/cosmos.bank.v1beta1.QueryBalanceResponse"; @@ -49,14 +49,14 @@ export interface QueryBalanceResponseAminoMsg { } /** QueryBalanceResponse is the response type for the Query/Balance RPC method. */ export interface QueryBalanceResponseSDKType { - balance: CoinSDKType; + balance?: CoinSDKType; } /** QueryBalanceRequest is the request type for the Query/AllBalances RPC method. */ export interface QueryAllBalancesRequest { /** address is the address to query balances for. */ address: string; /** pagination defines an optional pagination for the request. */ - pagination: PageRequest; + pagination?: PageRequest; } export interface QueryAllBalancesRequestProtoMsg { typeUrl: "/cosmos.bank.v1beta1.QueryAllBalancesRequest"; @@ -65,7 +65,7 @@ export interface QueryAllBalancesRequestProtoMsg { /** QueryBalanceRequest is the request type for the Query/AllBalances RPC method. */ export interface QueryAllBalancesRequestAmino { /** address is the address to query balances for. */ - address: string; + address?: string; /** pagination defines an optional pagination for the request. */ pagination?: PageRequestAmino; } @@ -76,7 +76,7 @@ export interface QueryAllBalancesRequestAminoMsg { /** QueryBalanceRequest is the request type for the Query/AllBalances RPC method. */ export interface QueryAllBalancesRequestSDKType { address: string; - pagination: PageRequestSDKType; + pagination?: PageRequestSDKType; } /** * QueryAllBalancesResponse is the response type for the Query/AllBalances RPC @@ -86,7 +86,7 @@ export interface QueryAllBalancesResponse { /** balances is the balances of all the coins. */ balances: Coin[]; /** pagination defines the pagination in the response. */ - pagination: PageResponse; + pagination?: PageResponse; } export interface QueryAllBalancesResponseProtoMsg { typeUrl: "/cosmos.bank.v1beta1.QueryAllBalancesResponse"; @@ -112,7 +112,170 @@ export interface QueryAllBalancesResponseAminoMsg { */ export interface QueryAllBalancesResponseSDKType { balances: CoinSDKType[]; - pagination: PageResponseSDKType; + pagination?: PageResponseSDKType; +} +/** + * QuerySpendableBalancesRequest defines the gRPC request structure for querying + * an account's spendable balances. + * + * Since: cosmos-sdk 0.46 + */ +export interface QuerySpendableBalancesRequest { + /** address is the address to query spendable balances for. */ + address: string; + /** pagination defines an optional pagination for the request. */ + pagination?: PageRequest; +} +export interface QuerySpendableBalancesRequestProtoMsg { + typeUrl: "/cosmos.bank.v1beta1.QuerySpendableBalancesRequest"; + value: Uint8Array; +} +/** + * QuerySpendableBalancesRequest defines the gRPC request structure for querying + * an account's spendable balances. + * + * Since: cosmos-sdk 0.46 + */ +export interface QuerySpendableBalancesRequestAmino { + /** address is the address to query spendable balances for. */ + address?: string; + /** pagination defines an optional pagination for the request. */ + pagination?: PageRequestAmino; +} +export interface QuerySpendableBalancesRequestAminoMsg { + type: "cosmos-sdk/QuerySpendableBalancesRequest"; + value: QuerySpendableBalancesRequestAmino; +} +/** + * QuerySpendableBalancesRequest defines the gRPC request structure for querying + * an account's spendable balances. + * + * Since: cosmos-sdk 0.46 + */ +export interface QuerySpendableBalancesRequestSDKType { + address: string; + pagination?: PageRequestSDKType; +} +/** + * QuerySpendableBalancesResponse defines the gRPC response structure for querying + * an account's spendable balances. + * + * Since: cosmos-sdk 0.46 + */ +export interface QuerySpendableBalancesResponse { + /** balances is the spendable balances of all the coins. */ + balances: Coin[]; + /** pagination defines the pagination in the response. */ + pagination?: PageResponse; +} +export interface QuerySpendableBalancesResponseProtoMsg { + typeUrl: "/cosmos.bank.v1beta1.QuerySpendableBalancesResponse"; + value: Uint8Array; +} +/** + * QuerySpendableBalancesResponse defines the gRPC response structure for querying + * an account's spendable balances. + * + * Since: cosmos-sdk 0.46 + */ +export interface QuerySpendableBalancesResponseAmino { + /** balances is the spendable balances of all the coins. */ + balances: CoinAmino[]; + /** pagination defines the pagination in the response. */ + pagination?: PageResponseAmino; +} +export interface QuerySpendableBalancesResponseAminoMsg { + type: "cosmos-sdk/QuerySpendableBalancesResponse"; + value: QuerySpendableBalancesResponseAmino; +} +/** + * QuerySpendableBalancesResponse defines the gRPC response structure for querying + * an account's spendable balances. + * + * Since: cosmos-sdk 0.46 + */ +export interface QuerySpendableBalancesResponseSDKType { + balances: CoinSDKType[]; + pagination?: PageResponseSDKType; +} +/** + * QuerySpendableBalanceByDenomRequest defines the gRPC request structure for + * querying an account's spendable balance for a specific denom. + * + * Since: cosmos-sdk 0.47 + */ +export interface QuerySpendableBalanceByDenomRequest { + /** address is the address to query balances for. */ + address: string; + /** denom is the coin denom to query balances for. */ + denom: string; +} +export interface QuerySpendableBalanceByDenomRequestProtoMsg { + typeUrl: "/cosmos.bank.v1beta1.QuerySpendableBalanceByDenomRequest"; + value: Uint8Array; +} +/** + * QuerySpendableBalanceByDenomRequest defines the gRPC request structure for + * querying an account's spendable balance for a specific denom. + * + * Since: cosmos-sdk 0.47 + */ +export interface QuerySpendableBalanceByDenomRequestAmino { + /** address is the address to query balances for. */ + address?: string; + /** denom is the coin denom to query balances for. */ + denom?: string; +} +export interface QuerySpendableBalanceByDenomRequestAminoMsg { + type: "cosmos-sdk/QuerySpendableBalanceByDenomRequest"; + value: QuerySpendableBalanceByDenomRequestAmino; +} +/** + * QuerySpendableBalanceByDenomRequest defines the gRPC request structure for + * querying an account's spendable balance for a specific denom. + * + * Since: cosmos-sdk 0.47 + */ +export interface QuerySpendableBalanceByDenomRequestSDKType { + address: string; + denom: string; +} +/** + * QuerySpendableBalanceByDenomResponse defines the gRPC response structure for + * querying an account's spendable balance for a specific denom. + * + * Since: cosmos-sdk 0.47 + */ +export interface QuerySpendableBalanceByDenomResponse { + /** balance is the balance of the coin. */ + balance?: Coin; +} +export interface QuerySpendableBalanceByDenomResponseProtoMsg { + typeUrl: "/cosmos.bank.v1beta1.QuerySpendableBalanceByDenomResponse"; + value: Uint8Array; +} +/** + * QuerySpendableBalanceByDenomResponse defines the gRPC response structure for + * querying an account's spendable balance for a specific denom. + * + * Since: cosmos-sdk 0.47 + */ +export interface QuerySpendableBalanceByDenomResponseAmino { + /** balance is the balance of the coin. */ + balance?: CoinAmino; +} +export interface QuerySpendableBalanceByDenomResponseAminoMsg { + type: "cosmos-sdk/QuerySpendableBalanceByDenomResponse"; + value: QuerySpendableBalanceByDenomResponseAmino; +} +/** + * QuerySpendableBalanceByDenomResponse defines the gRPC response structure for + * querying an account's spendable balance for a specific denom. + * + * Since: cosmos-sdk 0.47 + */ +export interface QuerySpendableBalanceByDenomResponseSDKType { + balance?: CoinSDKType; } /** * QueryTotalSupplyRequest is the request type for the Query/TotalSupply RPC @@ -124,7 +287,7 @@ export interface QueryTotalSupplyRequest { * * Since: cosmos-sdk 0.43 */ - pagination: PageRequest; + pagination?: PageRequest; } export interface QueryTotalSupplyRequestProtoMsg { typeUrl: "/cosmos.bank.v1beta1.QueryTotalSupplyRequest"; @@ -151,7 +314,7 @@ export interface QueryTotalSupplyRequestAminoMsg { * method. */ export interface QueryTotalSupplyRequestSDKType { - pagination: PageRequestSDKType; + pagination?: PageRequestSDKType; } /** * QueryTotalSupplyResponse is the response type for the Query/TotalSupply RPC @@ -165,7 +328,7 @@ export interface QueryTotalSupplyResponse { * * Since: cosmos-sdk 0.43 */ - pagination: PageResponse; + pagination?: PageResponse; } export interface QueryTotalSupplyResponseProtoMsg { typeUrl: "/cosmos.bank.v1beta1.QueryTotalSupplyResponse"; @@ -195,7 +358,7 @@ export interface QueryTotalSupplyResponseAminoMsg { */ export interface QueryTotalSupplyResponseSDKType { supply: CoinSDKType[]; - pagination: PageResponseSDKType; + pagination?: PageResponseSDKType; } /** QuerySupplyOfRequest is the request type for the Query/SupplyOf RPC method. */ export interface QuerySupplyOfRequest { @@ -209,7 +372,7 @@ export interface QuerySupplyOfRequestProtoMsg { /** QuerySupplyOfRequest is the request type for the Query/SupplyOf RPC method. */ export interface QuerySupplyOfRequestAmino { /** denom is the coin denom to query balances for. */ - denom: string; + denom?: string; } export interface QuerySupplyOfRequestAminoMsg { type: "cosmos-sdk/QuerySupplyOfRequest"; @@ -231,7 +394,7 @@ export interface QuerySupplyOfResponseProtoMsg { /** QuerySupplyOfResponse is the response type for the Query/SupplyOf RPC method. */ export interface QuerySupplyOfResponseAmino { /** amount is the supply of the coin. */ - amount?: CoinAmino; + amount: CoinAmino; } export interface QuerySupplyOfResponseAminoMsg { type: "cosmos-sdk/QuerySupplyOfResponse"; @@ -251,7 +414,7 @@ export interface QueryTotalSupplyWithoutOffsetRequest { * * Since: cosmos-sdk 0.43 */ - pagination: PageRequest; + pagination?: PageRequest; } export interface QueryTotalSupplyWithoutOffsetRequestProtoMsg { typeUrl: "/cosmos.bank.v1beta1.QueryTotalSupplyWithoutOffsetRequest"; @@ -278,7 +441,7 @@ export interface QueryTotalSupplyWithoutOffsetRequestAminoMsg { * method. */ export interface QueryTotalSupplyWithoutOffsetRequestSDKType { - pagination: PageRequestSDKType; + pagination?: PageRequestSDKType; } /** * QueryTotalSupplyWithoutOffsetResponse is the response type for the Query/TotalSupplyWithoutOffset RPC @@ -292,7 +455,7 @@ export interface QueryTotalSupplyWithoutOffsetResponse { * * Since: cosmos-sdk 0.43 */ - pagination: PageResponse; + pagination?: PageResponse; } export interface QueryTotalSupplyWithoutOffsetResponseProtoMsg { typeUrl: "/cosmos.bank.v1beta1.QueryTotalSupplyWithoutOffsetResponse"; @@ -304,7 +467,7 @@ export interface QueryTotalSupplyWithoutOffsetResponseProtoMsg { */ export interface QueryTotalSupplyWithoutOffsetResponseAmino { /** supply is the supply of the coins */ - supply: CoinAmino[]; + supply?: CoinAmino[]; /** * pagination defines the pagination in the response. * @@ -322,7 +485,7 @@ export interface QueryTotalSupplyWithoutOffsetResponseAminoMsg { */ export interface QueryTotalSupplyWithoutOffsetResponseSDKType { supply: CoinSDKType[]; - pagination: PageResponseSDKType; + pagination?: PageResponseSDKType; } /** QuerySupplyOfWithoutOffsetRequest is the request type for the Query/SupplyOfWithoutOffset RPC method. */ export interface QuerySupplyOfWithoutOffsetRequest { @@ -336,7 +499,7 @@ export interface QuerySupplyOfWithoutOffsetRequestProtoMsg { /** QuerySupplyOfWithoutOffsetRequest is the request type for the Query/SupplyOfWithoutOffset RPC method. */ export interface QuerySupplyOfWithoutOffsetRequestAmino { /** denom is the coin denom to query balances for. */ - denom: string; + denom?: string; } export interface QuerySupplyOfWithoutOffsetRequestAminoMsg { type: "cosmos-sdk/QuerySupplyOfWithoutOffsetRequest"; @@ -392,7 +555,7 @@ export interface QueryParamsResponseProtoMsg { } /** QueryParamsResponse defines the response type for querying x/bank parameters. */ export interface QueryParamsResponseAmino { - params?: ParamsAmino; + params: ParamsAmino; } export interface QueryParamsResponseAminoMsg { type: "cosmos-sdk/QueryParamsResponse"; @@ -405,7 +568,7 @@ export interface QueryParamsResponseSDKType { /** 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; } export interface QueryDenomsMetadataRequestProtoMsg { typeUrl: "/cosmos.bank.v1beta1.QueryDenomsMetadataRequest"; @@ -422,7 +585,7 @@ export interface QueryDenomsMetadataRequestAminoMsg { } /** QueryDenomsMetadataRequest is the request type for the Query/DenomsMetadata RPC method. */ export interface QueryDenomsMetadataRequestSDKType { - pagination: PageRequestSDKType; + pagination?: PageRequestSDKType; } /** * QueryDenomsMetadataResponse is the response type for the Query/DenomsMetadata RPC @@ -432,7 +595,7 @@ export interface QueryDenomsMetadataResponse { /** metadata provides the client information for all the registered tokens. */ metadatas: Metadata[]; /** pagination defines the pagination in the response. */ - pagination: PageResponse; + pagination?: PageResponse; } export interface QueryDenomsMetadataResponseProtoMsg { typeUrl: "/cosmos.bank.v1beta1.QueryDenomsMetadataResponse"; @@ -458,7 +621,7 @@ export interface QueryDenomsMetadataResponseAminoMsg { */ export interface QueryDenomsMetadataResponseSDKType { metadatas: MetadataSDKType[]; - pagination: PageResponseSDKType; + pagination?: PageResponseSDKType; } /** QueryDenomMetadataRequest is the request type for the Query/DenomMetadata RPC method. */ export interface QueryDenomMetadataRequest { @@ -472,7 +635,7 @@ export interface QueryDenomMetadataRequestProtoMsg { /** QueryDenomMetadataRequest is the request type for the Query/DenomMetadata RPC method. */ export interface QueryDenomMetadataRequestAmino { /** denom is the coin denom to query the metadata for. */ - denom: string; + denom?: string; } export interface QueryDenomMetadataRequestAminoMsg { type: "cosmos-sdk/QueryDenomMetadataRequest"; @@ -500,7 +663,7 @@ export interface QueryDenomMetadataResponseProtoMsg { */ export interface QueryDenomMetadataResponseAmino { /** metadata describes and provides all the client information for the requested token. */ - metadata?: MetadataAmino; + metadata: MetadataAmino; } export interface QueryDenomMetadataResponseAminoMsg { type: "cosmos-sdk/QueryDenomMetadataResponse"; @@ -513,45 +676,214 @@ export interface QueryDenomMetadataResponseAminoMsg { export interface QueryDenomMetadataResponseSDKType { metadata: MetadataSDKType; } -/** QueryBaseDenomRequest defines the request type for the BaseDenom gRPC method. */ -export interface QueryBaseDenomRequest { +/** + * QueryDenomOwnersRequest defines the request type for the DenomOwners RPC query, + * which queries for a paginated set of all account holders of a particular + * denomination. + */ +export interface QueryDenomOwnersRequest { + /** denom defines the coin denomination to query all account holders for. */ denom: string; + /** pagination defines an optional pagination for the request. */ + pagination?: PageRequest; } -export interface QueryBaseDenomRequestProtoMsg { - typeUrl: "/cosmos.bank.v1beta1.QueryBaseDenomRequest"; +export interface QueryDenomOwnersRequestProtoMsg { + typeUrl: "/cosmos.bank.v1beta1.QueryDenomOwnersRequest"; value: Uint8Array; } -/** QueryBaseDenomRequest defines the request type for the BaseDenom gRPC method. */ -export interface QueryBaseDenomRequestAmino { - denom: string; +/** + * QueryDenomOwnersRequest defines the request type for the DenomOwners RPC query, + * which queries for a paginated set of all account holders of a particular + * denomination. + */ +export interface QueryDenomOwnersRequestAmino { + /** denom defines the coin denomination to query all account holders for. */ + denom?: string; + /** pagination defines an optional pagination for the request. */ + pagination?: PageRequestAmino; } -export interface QueryBaseDenomRequestAminoMsg { - type: "cosmos-sdk/QueryBaseDenomRequest"; - value: QueryBaseDenomRequestAmino; +export interface QueryDenomOwnersRequestAminoMsg { + type: "cosmos-sdk/QueryDenomOwnersRequest"; + value: QueryDenomOwnersRequestAmino; } -/** QueryBaseDenomRequest defines the request type for the BaseDenom gRPC method. */ -export interface QueryBaseDenomRequestSDKType { +/** + * QueryDenomOwnersRequest defines the request type for the DenomOwners RPC query, + * which queries for a paginated set of all account holders of a particular + * denomination. + */ +export interface QueryDenomOwnersRequestSDKType { denom: string; + pagination?: PageRequestSDKType; } -/** QueryBaseDenomResponse defines the response type for the BaseDenom gRPC method. */ -export interface QueryBaseDenomResponse { - baseDenom: string; +/** + * DenomOwner defines structure representing an account that owns or holds a + * particular denominated token. It contains the account address and account + * balance of the denominated token. + * + * Since: cosmos-sdk 0.46 + */ +export interface DenomOwner { + /** address defines the address that owns a particular denomination. */ + address: string; + /** balance is the balance of the denominated coin for an account. */ + balance: Coin; } -export interface QueryBaseDenomResponseProtoMsg { - typeUrl: "/cosmos.bank.v1beta1.QueryBaseDenomResponse"; +export interface DenomOwnerProtoMsg { + typeUrl: "/cosmos.bank.v1beta1.DenomOwner"; value: Uint8Array; } -/** QueryBaseDenomResponse defines the response type for the BaseDenom gRPC method. */ -export interface QueryBaseDenomResponseAmino { - base_denom: string; +/** + * DenomOwner defines structure representing an account that owns or holds a + * particular denominated token. It contains the account address and account + * balance of the denominated token. + * + * Since: cosmos-sdk 0.46 + */ +export interface DenomOwnerAmino { + /** address defines the address that owns a particular denomination. */ + address?: string; + /** balance is the balance of the denominated coin for an account. */ + balance: CoinAmino; } -export interface QueryBaseDenomResponseAminoMsg { - type: "cosmos-sdk/QueryBaseDenomResponse"; - value: QueryBaseDenomResponseAmino; +export interface DenomOwnerAminoMsg { + type: "cosmos-sdk/DenomOwner"; + value: DenomOwnerAmino; } -/** QueryBaseDenomResponse defines the response type for the BaseDenom gRPC method. */ -export interface QueryBaseDenomResponseSDKType { - base_denom: string; +/** + * DenomOwner defines structure representing an account that owns or holds a + * particular denominated token. It contains the account address and account + * balance of the denominated token. + * + * Since: cosmos-sdk 0.46 + */ +export interface DenomOwnerSDKType { + address: string; + balance: CoinSDKType; +} +/** + * QueryDenomOwnersResponse defines the RPC response of a DenomOwners RPC query. + * + * Since: cosmos-sdk 0.46 + */ +export interface QueryDenomOwnersResponse { + denomOwners: DenomOwner[]; + /** pagination defines the pagination in the response. */ + pagination?: PageResponse; +} +export interface QueryDenomOwnersResponseProtoMsg { + typeUrl: "/cosmos.bank.v1beta1.QueryDenomOwnersResponse"; + value: Uint8Array; +} +/** + * QueryDenomOwnersResponse defines the RPC response of a DenomOwners RPC query. + * + * Since: cosmos-sdk 0.46 + */ +export interface QueryDenomOwnersResponseAmino { + denom_owners?: DenomOwnerAmino[]; + /** pagination defines the pagination in the response. */ + pagination?: PageResponseAmino; +} +export interface QueryDenomOwnersResponseAminoMsg { + type: "cosmos-sdk/QueryDenomOwnersResponse"; + value: QueryDenomOwnersResponseAmino; +} +/** + * QueryDenomOwnersResponse defines the RPC response of a DenomOwners RPC query. + * + * Since: cosmos-sdk 0.46 + */ +export interface QueryDenomOwnersResponseSDKType { + denom_owners: DenomOwnerSDKType[]; + pagination?: PageResponseSDKType; +} +/** + * QuerySendEnabledRequest defines the RPC request for looking up SendEnabled entries. + * + * Since: cosmos-sdk 0.47 + */ +export interface QuerySendEnabledRequest { + /** denoms is the specific denoms you want look up. Leave empty to get all entries. */ + denoms: string[]; + /** + * pagination defines an optional pagination for the request. This field is + * only read if the denoms field is empty. + */ + pagination?: PageRequest; +} +export interface QuerySendEnabledRequestProtoMsg { + typeUrl: "/cosmos.bank.v1beta1.QuerySendEnabledRequest"; + value: Uint8Array; +} +/** + * QuerySendEnabledRequest defines the RPC request for looking up SendEnabled entries. + * + * Since: cosmos-sdk 0.47 + */ +export interface QuerySendEnabledRequestAmino { + /** denoms is the specific denoms you want look up. Leave empty to get all entries. */ + denoms?: string[]; + /** + * pagination defines an optional pagination for the request. This field is + * only read if the denoms field is empty. + */ + pagination?: PageRequestAmino; +} +export interface QuerySendEnabledRequestAminoMsg { + type: "cosmos-sdk/QuerySendEnabledRequest"; + value: QuerySendEnabledRequestAmino; +} +/** + * QuerySendEnabledRequest defines the RPC request for looking up SendEnabled entries. + * + * Since: cosmos-sdk 0.47 + */ +export interface QuerySendEnabledRequestSDKType { + denoms: string[]; + pagination?: PageRequestSDKType; +} +/** + * QuerySendEnabledResponse defines the RPC response of a SendEnable query. + * + * Since: cosmos-sdk 0.47 + */ +export interface QuerySendEnabledResponse { + sendEnabled: SendEnabled[]; + /** + * pagination defines the pagination in the response. This field is only + * populated if the denoms field in the request is empty. + */ + pagination?: PageResponse; +} +export interface QuerySendEnabledResponseProtoMsg { + typeUrl: "/cosmos.bank.v1beta1.QuerySendEnabledResponse"; + value: Uint8Array; +} +/** + * QuerySendEnabledResponse defines the RPC response of a SendEnable query. + * + * Since: cosmos-sdk 0.47 + */ +export interface QuerySendEnabledResponseAmino { + send_enabled?: SendEnabledAmino[]; + /** + * pagination defines the pagination in the response. This field is only + * populated if the denoms field in the request is empty. + */ + pagination?: PageResponseAmino; +} +export interface QuerySendEnabledResponseAminoMsg { + type: "cosmos-sdk/QuerySendEnabledResponse"; + value: QuerySendEnabledResponseAmino; +} +/** + * QuerySendEnabledResponse defines the RPC response of a SendEnable query. + * + * Since: cosmos-sdk 0.47 + */ +export interface QuerySendEnabledResponseSDKType { + send_enabled: SendEnabledSDKType[]; + pagination?: PageResponseSDKType; } function createBaseQueryBalanceRequest(): QueryBalanceRequest { return { @@ -597,10 +929,14 @@ export const QueryBalanceRequest = { return message; }, fromAmino(object: QueryBalanceRequestAmino): QueryBalanceRequest { - return { - address: object.address, - denom: object.denom - }; + const message = createBaseQueryBalanceRequest(); + if (object.address !== undefined && object.address !== null) { + message.address = object.address; + } + if (object.denom !== undefined && object.denom !== null) { + message.denom = object.denom; + } + return message; }, toAmino(message: QueryBalanceRequest): QueryBalanceRequestAmino { const obj: any = {}; @@ -632,7 +968,7 @@ export const QueryBalanceRequest = { }; function createBaseQueryBalanceResponse(): QueryBalanceResponse { return { - balance: Coin.fromPartial({}) + balance: undefined }; } export const QueryBalanceResponse = { @@ -666,9 +1002,11 @@ export const QueryBalanceResponse = { return message; }, fromAmino(object: QueryBalanceResponseAmino): QueryBalanceResponse { - return { - balance: object?.balance ? Coin.fromAmino(object.balance) : undefined - }; + const message = createBaseQueryBalanceResponse(); + if (object.balance !== undefined && object.balance !== null) { + message.balance = Coin.fromAmino(object.balance); + } + return message; }, toAmino(message: QueryBalanceResponse): QueryBalanceResponseAmino { const obj: any = {}; @@ -700,7 +1038,7 @@ export const QueryBalanceResponse = { function createBaseQueryAllBalancesRequest(): QueryAllBalancesRequest { return { address: "", - pagination: PageRequest.fromPartial({}) + pagination: undefined }; } export const QueryAllBalancesRequest = { @@ -741,10 +1079,14 @@ export const QueryAllBalancesRequest = { return message; }, fromAmino(object: QueryAllBalancesRequestAmino): QueryAllBalancesRequest { - return { - address: object.address, - pagination: object?.pagination ? PageRequest.fromAmino(object.pagination) : undefined - }; + const message = createBaseQueryAllBalancesRequest(); + if (object.address !== undefined && object.address !== null) { + message.address = object.address; + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromAmino(object.pagination); + } + return message; }, toAmino(message: QueryAllBalancesRequest): QueryAllBalancesRequestAmino { const obj: any = {}; @@ -777,7 +1119,7 @@ export const QueryAllBalancesRequest = { function createBaseQueryAllBalancesResponse(): QueryAllBalancesResponse { return { balances: [], - pagination: PageResponse.fromPartial({}) + pagination: undefined }; } export const QueryAllBalancesResponse = { @@ -818,46 +1160,362 @@ export const QueryAllBalancesResponse = { return message; }, fromAmino(object: QueryAllBalancesResponseAmino): QueryAllBalancesResponse { + const message = createBaseQueryAllBalancesResponse(); + message.balances = object.balances?.map(e => Coin.fromAmino(e)) || []; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromAmino(object.pagination); + } + return message; + }, + toAmino(message: QueryAllBalancesResponse): QueryAllBalancesResponseAmino { + const obj: any = {}; + if (message.balances) { + obj.balances = message.balances.map(e => e ? Coin.toAmino(e) : undefined); + } else { + obj.balances = []; + } + obj.pagination = message.pagination ? PageResponse.toAmino(message.pagination) : undefined; + return obj; + }, + fromAminoMsg(object: QueryAllBalancesResponseAminoMsg): QueryAllBalancesResponse { + return QueryAllBalancesResponse.fromAmino(object.value); + }, + toAminoMsg(message: QueryAllBalancesResponse): QueryAllBalancesResponseAminoMsg { + return { + type: "cosmos-sdk/QueryAllBalancesResponse", + value: QueryAllBalancesResponse.toAmino(message) + }; + }, + fromProtoMsg(message: QueryAllBalancesResponseProtoMsg): QueryAllBalancesResponse { + return QueryAllBalancesResponse.decode(message.value); + }, + toProto(message: QueryAllBalancesResponse): Uint8Array { + return QueryAllBalancesResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryAllBalancesResponse): QueryAllBalancesResponseProtoMsg { + return { + typeUrl: "/cosmos.bank.v1beta1.QueryAllBalancesResponse", + value: QueryAllBalancesResponse.encode(message).finish() + }; + } +}; +function createBaseQuerySpendableBalancesRequest(): QuerySpendableBalancesRequest { + return { + address: "", + pagination: undefined + }; +} +export const QuerySpendableBalancesRequest = { + typeUrl: "/cosmos.bank.v1beta1.QuerySpendableBalancesRequest", + encode(message: QuerySpendableBalancesRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.address !== "") { + writer.uint32(10).string(message.address); + } + if (message.pagination !== undefined) { + PageRequest.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QuerySpendableBalancesRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQuerySpendableBalancesRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.address = reader.string(); + break; + case 2: + message.pagination = PageRequest.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QuerySpendableBalancesRequest { + const message = createBaseQuerySpendableBalancesRequest(); + message.address = object.address ?? ""; + message.pagination = object.pagination !== undefined && object.pagination !== null ? PageRequest.fromPartial(object.pagination) : undefined; + return message; + }, + fromAmino(object: QuerySpendableBalancesRequestAmino): QuerySpendableBalancesRequest { + const message = createBaseQuerySpendableBalancesRequest(); + if (object.address !== undefined && object.address !== null) { + message.address = object.address; + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromAmino(object.pagination); + } + return message; + }, + toAmino(message: QuerySpendableBalancesRequest): QuerySpendableBalancesRequestAmino { + const obj: any = {}; + obj.address = message.address; + obj.pagination = message.pagination ? PageRequest.toAmino(message.pagination) : undefined; + return obj; + }, + fromAminoMsg(object: QuerySpendableBalancesRequestAminoMsg): QuerySpendableBalancesRequest { + return QuerySpendableBalancesRequest.fromAmino(object.value); + }, + toAminoMsg(message: QuerySpendableBalancesRequest): QuerySpendableBalancesRequestAminoMsg { return { - balances: Array.isArray(object?.balances) ? object.balances.map((e: any) => Coin.fromAmino(e)) : [], - pagination: object?.pagination ? PageResponse.fromAmino(object.pagination) : undefined + type: "cosmos-sdk/QuerySpendableBalancesRequest", + value: QuerySpendableBalancesRequest.toAmino(message) }; }, - toAmino(message: QueryAllBalancesResponse): QueryAllBalancesResponseAmino { + fromProtoMsg(message: QuerySpendableBalancesRequestProtoMsg): QuerySpendableBalancesRequest { + return QuerySpendableBalancesRequest.decode(message.value); + }, + toProto(message: QuerySpendableBalancesRequest): Uint8Array { + return QuerySpendableBalancesRequest.encode(message).finish(); + }, + toProtoMsg(message: QuerySpendableBalancesRequest): QuerySpendableBalancesRequestProtoMsg { + return { + typeUrl: "/cosmos.bank.v1beta1.QuerySpendableBalancesRequest", + value: QuerySpendableBalancesRequest.encode(message).finish() + }; + } +}; +function createBaseQuerySpendableBalancesResponse(): QuerySpendableBalancesResponse { + return { + balances: [], + pagination: undefined + }; +} +export const QuerySpendableBalancesResponse = { + typeUrl: "/cosmos.bank.v1beta1.QuerySpendableBalancesResponse", + encode(message: QuerySpendableBalancesResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.balances) { + Coin.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.pagination !== undefined) { + PageResponse.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QuerySpendableBalancesResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQuerySpendableBalancesResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.balances.push(Coin.decode(reader, reader.uint32())); + break; + case 2: + message.pagination = PageResponse.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): 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; + }, + fromAmino(object: QuerySpendableBalancesResponseAmino): QuerySpendableBalancesResponse { + const message = createBaseQuerySpendableBalancesResponse(); + message.balances = object.balances?.map(e => Coin.fromAmino(e)) || []; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromAmino(object.pagination); + } + return message; + }, + toAmino(message: QuerySpendableBalancesResponse): QuerySpendableBalancesResponseAmino { + const obj: any = {}; + if (message.balances) { + obj.balances = message.balances.map(e => e ? Coin.toAmino(e) : undefined); + } else { + obj.balances = []; + } + obj.pagination = message.pagination ? PageResponse.toAmino(message.pagination) : undefined; + return obj; + }, + fromAminoMsg(object: QuerySpendableBalancesResponseAminoMsg): QuerySpendableBalancesResponse { + return QuerySpendableBalancesResponse.fromAmino(object.value); + }, + toAminoMsg(message: QuerySpendableBalancesResponse): QuerySpendableBalancesResponseAminoMsg { + return { + type: "cosmos-sdk/QuerySpendableBalancesResponse", + value: QuerySpendableBalancesResponse.toAmino(message) + }; + }, + fromProtoMsg(message: QuerySpendableBalancesResponseProtoMsg): QuerySpendableBalancesResponse { + return QuerySpendableBalancesResponse.decode(message.value); + }, + toProto(message: QuerySpendableBalancesResponse): Uint8Array { + return QuerySpendableBalancesResponse.encode(message).finish(); + }, + toProtoMsg(message: QuerySpendableBalancesResponse): QuerySpendableBalancesResponseProtoMsg { + return { + typeUrl: "/cosmos.bank.v1beta1.QuerySpendableBalancesResponse", + value: QuerySpendableBalancesResponse.encode(message).finish() + }; + } +}; +function createBaseQuerySpendableBalanceByDenomRequest(): QuerySpendableBalanceByDenomRequest { + return { + address: "", + denom: "" + }; +} +export const QuerySpendableBalanceByDenomRequest = { + typeUrl: "/cosmos.bank.v1beta1.QuerySpendableBalanceByDenomRequest", + encode(message: QuerySpendableBalanceByDenomRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.address !== "") { + writer.uint32(10).string(message.address); + } + if (message.denom !== "") { + writer.uint32(18).string(message.denom); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QuerySpendableBalanceByDenomRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQuerySpendableBalanceByDenomRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.address = reader.string(); + break; + case 2: + message.denom = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QuerySpendableBalanceByDenomRequest { + const message = createBaseQuerySpendableBalanceByDenomRequest(); + message.address = object.address ?? ""; + message.denom = object.denom ?? ""; + return message; + }, + fromAmino(object: QuerySpendableBalanceByDenomRequestAmino): QuerySpendableBalanceByDenomRequest { + const message = createBaseQuerySpendableBalanceByDenomRequest(); + if (object.address !== undefined && object.address !== null) { + message.address = object.address; + } + if (object.denom !== undefined && object.denom !== null) { + message.denom = object.denom; + } + return message; + }, + toAmino(message: QuerySpendableBalanceByDenomRequest): QuerySpendableBalanceByDenomRequestAmino { + const obj: any = {}; + obj.address = message.address; + obj.denom = message.denom; + return obj; + }, + fromAminoMsg(object: QuerySpendableBalanceByDenomRequestAminoMsg): QuerySpendableBalanceByDenomRequest { + return QuerySpendableBalanceByDenomRequest.fromAmino(object.value); + }, + toAminoMsg(message: QuerySpendableBalanceByDenomRequest): QuerySpendableBalanceByDenomRequestAminoMsg { + return { + type: "cosmos-sdk/QuerySpendableBalanceByDenomRequest", + value: QuerySpendableBalanceByDenomRequest.toAmino(message) + }; + }, + fromProtoMsg(message: QuerySpendableBalanceByDenomRequestProtoMsg): QuerySpendableBalanceByDenomRequest { + return QuerySpendableBalanceByDenomRequest.decode(message.value); + }, + toProto(message: QuerySpendableBalanceByDenomRequest): Uint8Array { + return QuerySpendableBalanceByDenomRequest.encode(message).finish(); + }, + toProtoMsg(message: QuerySpendableBalanceByDenomRequest): QuerySpendableBalanceByDenomRequestProtoMsg { + return { + typeUrl: "/cosmos.bank.v1beta1.QuerySpendableBalanceByDenomRequest", + value: QuerySpendableBalanceByDenomRequest.encode(message).finish() + }; + } +}; +function createBaseQuerySpendableBalanceByDenomResponse(): QuerySpendableBalanceByDenomResponse { + return { + balance: undefined + }; +} +export const QuerySpendableBalanceByDenomResponse = { + typeUrl: "/cosmos.bank.v1beta1.QuerySpendableBalanceByDenomResponse", + encode(message: QuerySpendableBalanceByDenomResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.balance !== undefined) { + Coin.encode(message.balance, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QuerySpendableBalanceByDenomResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQuerySpendableBalanceByDenomResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.balance = Coin.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QuerySpendableBalanceByDenomResponse { + const message = createBaseQuerySpendableBalanceByDenomResponse(); + message.balance = object.balance !== undefined && object.balance !== null ? Coin.fromPartial(object.balance) : undefined; + return message; + }, + fromAmino(object: QuerySpendableBalanceByDenomResponseAmino): QuerySpendableBalanceByDenomResponse { + const message = createBaseQuerySpendableBalanceByDenomResponse(); + if (object.balance !== undefined && object.balance !== null) { + message.balance = Coin.fromAmino(object.balance); + } + return message; + }, + toAmino(message: QuerySpendableBalanceByDenomResponse): QuerySpendableBalanceByDenomResponseAmino { const obj: any = {}; - if (message.balances) { - obj.balances = message.balances.map(e => e ? Coin.toAmino(e) : undefined); - } else { - obj.balances = []; - } - obj.pagination = message.pagination ? PageResponse.toAmino(message.pagination) : undefined; + obj.balance = message.balance ? Coin.toAmino(message.balance) : undefined; return obj; }, - fromAminoMsg(object: QueryAllBalancesResponseAminoMsg): QueryAllBalancesResponse { - return QueryAllBalancesResponse.fromAmino(object.value); + fromAminoMsg(object: QuerySpendableBalanceByDenomResponseAminoMsg): QuerySpendableBalanceByDenomResponse { + return QuerySpendableBalanceByDenomResponse.fromAmino(object.value); }, - toAminoMsg(message: QueryAllBalancesResponse): QueryAllBalancesResponseAminoMsg { + toAminoMsg(message: QuerySpendableBalanceByDenomResponse): QuerySpendableBalanceByDenomResponseAminoMsg { return { - type: "cosmos-sdk/QueryAllBalancesResponse", - value: QueryAllBalancesResponse.toAmino(message) + type: "cosmos-sdk/QuerySpendableBalanceByDenomResponse", + value: QuerySpendableBalanceByDenomResponse.toAmino(message) }; }, - fromProtoMsg(message: QueryAllBalancesResponseProtoMsg): QueryAllBalancesResponse { - return QueryAllBalancesResponse.decode(message.value); + fromProtoMsg(message: QuerySpendableBalanceByDenomResponseProtoMsg): QuerySpendableBalanceByDenomResponse { + return QuerySpendableBalanceByDenomResponse.decode(message.value); }, - toProto(message: QueryAllBalancesResponse): Uint8Array { - return QueryAllBalancesResponse.encode(message).finish(); + toProto(message: QuerySpendableBalanceByDenomResponse): Uint8Array { + return QuerySpendableBalanceByDenomResponse.encode(message).finish(); }, - toProtoMsg(message: QueryAllBalancesResponse): QueryAllBalancesResponseProtoMsg { + toProtoMsg(message: QuerySpendableBalanceByDenomResponse): QuerySpendableBalanceByDenomResponseProtoMsg { return { - typeUrl: "/cosmos.bank.v1beta1.QueryAllBalancesResponse", - value: QueryAllBalancesResponse.encode(message).finish() + typeUrl: "/cosmos.bank.v1beta1.QuerySpendableBalanceByDenomResponse", + value: QuerySpendableBalanceByDenomResponse.encode(message).finish() }; } }; function createBaseQueryTotalSupplyRequest(): QueryTotalSupplyRequest { return { - pagination: PageRequest.fromPartial({}) + pagination: undefined }; } export const QueryTotalSupplyRequest = { @@ -891,9 +1549,11 @@ export const QueryTotalSupplyRequest = { return message; }, fromAmino(object: QueryTotalSupplyRequestAmino): QueryTotalSupplyRequest { - return { - pagination: object?.pagination ? PageRequest.fromAmino(object.pagination) : undefined - }; + const message = createBaseQueryTotalSupplyRequest(); + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromAmino(object.pagination); + } + return message; }, toAmino(message: QueryTotalSupplyRequest): QueryTotalSupplyRequestAmino { const obj: any = {}; @@ -925,7 +1585,7 @@ export const QueryTotalSupplyRequest = { function createBaseQueryTotalSupplyResponse(): QueryTotalSupplyResponse { return { supply: [], - pagination: PageResponse.fromPartial({}) + pagination: undefined }; } export const QueryTotalSupplyResponse = { @@ -966,10 +1626,12 @@ export const QueryTotalSupplyResponse = { return message; }, fromAmino(object: QueryTotalSupplyResponseAmino): QueryTotalSupplyResponse { - return { - supply: Array.isArray(object?.supply) ? object.supply.map((e: any) => Coin.fromAmino(e)) : [], - pagination: object?.pagination ? PageResponse.fromAmino(object.pagination) : undefined - }; + const message = createBaseQueryTotalSupplyResponse(); + message.supply = object.supply?.map(e => Coin.fromAmino(e)) || []; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromAmino(object.pagination); + } + return message; }, toAmino(message: QueryTotalSupplyResponse): QueryTotalSupplyResponseAmino { const obj: any = {}; @@ -1039,9 +1701,11 @@ export const QuerySupplyOfRequest = { return message; }, fromAmino(object: QuerySupplyOfRequestAmino): QuerySupplyOfRequest { - return { - denom: object.denom - }; + const message = createBaseQuerySupplyOfRequest(); + if (object.denom !== undefined && object.denom !== null) { + message.denom = object.denom; + } + return message; }, toAmino(message: QuerySupplyOfRequest): QuerySupplyOfRequestAmino { const obj: any = {}; @@ -1106,13 +1770,15 @@ export const QuerySupplyOfResponse = { return message; }, fromAmino(object: QuerySupplyOfResponseAmino): QuerySupplyOfResponse { - return { - amount: object?.amount ? Coin.fromAmino(object.amount) : undefined - }; + const message = createBaseQuerySupplyOfResponse(); + if (object.amount !== undefined && object.amount !== null) { + message.amount = Coin.fromAmino(object.amount); + } + return message; }, toAmino(message: QuerySupplyOfResponse): QuerySupplyOfResponseAmino { const obj: any = {}; - obj.amount = message.amount ? Coin.toAmino(message.amount) : undefined; + obj.amount = message.amount ? Coin.toAmino(message.amount) : Coin.fromPartial({}); return obj; }, fromAminoMsg(object: QuerySupplyOfResponseAminoMsg): QuerySupplyOfResponse { @@ -1139,7 +1805,7 @@ export const QuerySupplyOfResponse = { }; function createBaseQueryTotalSupplyWithoutOffsetRequest(): QueryTotalSupplyWithoutOffsetRequest { return { - pagination: PageRequest.fromPartial({}) + pagination: undefined }; } export const QueryTotalSupplyWithoutOffsetRequest = { @@ -1173,9 +1839,11 @@ export const QueryTotalSupplyWithoutOffsetRequest = { return message; }, fromAmino(object: QueryTotalSupplyWithoutOffsetRequestAmino): QueryTotalSupplyWithoutOffsetRequest { - return { - pagination: object?.pagination ? PageRequest.fromAmino(object.pagination) : undefined - }; + const message = createBaseQueryTotalSupplyWithoutOffsetRequest(); + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromAmino(object.pagination); + } + return message; }, toAmino(message: QueryTotalSupplyWithoutOffsetRequest): QueryTotalSupplyWithoutOffsetRequestAmino { const obj: any = {}; @@ -1207,7 +1875,7 @@ export const QueryTotalSupplyWithoutOffsetRequest = { function createBaseQueryTotalSupplyWithoutOffsetResponse(): QueryTotalSupplyWithoutOffsetResponse { return { supply: [], - pagination: PageResponse.fromPartial({}) + pagination: undefined }; } export const QueryTotalSupplyWithoutOffsetResponse = { @@ -1248,10 +1916,12 @@ export const QueryTotalSupplyWithoutOffsetResponse = { return message; }, fromAmino(object: QueryTotalSupplyWithoutOffsetResponseAmino): QueryTotalSupplyWithoutOffsetResponse { - return { - supply: Array.isArray(object?.supply) ? object.supply.map((e: any) => Coin.fromAmino(e)) : [], - pagination: object?.pagination ? PageResponse.fromAmino(object.pagination) : undefined - }; + const message = createBaseQueryTotalSupplyWithoutOffsetResponse(); + message.supply = object.supply?.map(e => Coin.fromAmino(e)) || []; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromAmino(object.pagination); + } + return message; }, toAmino(message: QueryTotalSupplyWithoutOffsetResponse): QueryTotalSupplyWithoutOffsetResponseAmino { const obj: any = {}; @@ -1321,9 +1991,11 @@ export const QuerySupplyOfWithoutOffsetRequest = { return message; }, fromAmino(object: QuerySupplyOfWithoutOffsetRequestAmino): QuerySupplyOfWithoutOffsetRequest { - return { - denom: object.denom - }; + const message = createBaseQuerySupplyOfWithoutOffsetRequest(); + if (object.denom !== undefined && object.denom !== null) { + message.denom = object.denom; + } + return message; }, toAmino(message: QuerySupplyOfWithoutOffsetRequest): QuerySupplyOfWithoutOffsetRequestAmino { const obj: any = {}; @@ -1388,9 +2060,11 @@ export const QuerySupplyOfWithoutOffsetResponse = { return message; }, fromAmino(object: QuerySupplyOfWithoutOffsetResponseAmino): QuerySupplyOfWithoutOffsetResponse { - return { - amount: object?.amount ? Coin.fromAmino(object.amount) : undefined - }; + const message = createBaseQuerySupplyOfWithoutOffsetResponse(); + if (object.amount !== undefined && object.amount !== null) { + message.amount = Coin.fromAmino(object.amount); + } + return message; }, toAmino(message: QuerySupplyOfWithoutOffsetResponse): QuerySupplyOfWithoutOffsetResponseAmino { const obj: any = {}; @@ -1446,7 +2120,8 @@ export const QueryParamsRequest = { return message; }, fromAmino(_: QueryParamsRequestAmino): QueryParamsRequest { - return {}; + const message = createBaseQueryParamsRequest(); + return message; }, toAmino(_: QueryParamsRequest): QueryParamsRequestAmino { const obj: any = {}; @@ -1510,13 +2185,15 @@ export const QueryParamsResponse = { return message; }, fromAmino(object: QueryParamsResponseAmino): QueryParamsResponse { - return { - params: object?.params ? Params.fromAmino(object.params) : undefined - }; + const message = createBaseQueryParamsResponse(); + if (object.params !== undefined && object.params !== null) { + message.params = Params.fromAmino(object.params); + } + return message; }, toAmino(message: QueryParamsResponse): QueryParamsResponseAmino { const obj: any = {}; - obj.params = message.params ? Params.toAmino(message.params) : undefined; + obj.params = message.params ? Params.toAmino(message.params) : Params.fromPartial({}); return obj; }, fromAminoMsg(object: QueryParamsResponseAminoMsg): QueryParamsResponse { @@ -1543,7 +2220,7 @@ export const QueryParamsResponse = { }; function createBaseQueryDenomsMetadataRequest(): QueryDenomsMetadataRequest { return { - pagination: PageRequest.fromPartial({}) + pagination: undefined }; } export const QueryDenomsMetadataRequest = { @@ -1577,9 +2254,11 @@ export const QueryDenomsMetadataRequest = { return message; }, fromAmino(object: QueryDenomsMetadataRequestAmino): QueryDenomsMetadataRequest { - return { - pagination: object?.pagination ? PageRequest.fromAmino(object.pagination) : undefined - }; + const message = createBaseQueryDenomsMetadataRequest(); + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromAmino(object.pagination); + } + return message; }, toAmino(message: QueryDenomsMetadataRequest): QueryDenomsMetadataRequestAmino { const obj: any = {}; @@ -1611,7 +2290,7 @@ export const QueryDenomsMetadataRequest = { function createBaseQueryDenomsMetadataResponse(): QueryDenomsMetadataResponse { return { metadatas: [], - pagination: PageResponse.fromPartial({}) + pagination: undefined }; } export const QueryDenomsMetadataResponse = { @@ -1652,10 +2331,12 @@ export const QueryDenomsMetadataResponse = { return message; }, fromAmino(object: QueryDenomsMetadataResponseAmino): QueryDenomsMetadataResponse { - return { - metadatas: Array.isArray(object?.metadatas) ? object.metadatas.map((e: any) => Metadata.fromAmino(e)) : [], - pagination: object?.pagination ? PageResponse.fromAmino(object.pagination) : undefined - }; + const message = createBaseQueryDenomsMetadataResponse(); + message.metadatas = object.metadatas?.map(e => Metadata.fromAmino(e)) || []; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromAmino(object.pagination); + } + return message; }, toAmino(message: QueryDenomsMetadataResponse): QueryDenomsMetadataResponseAmino { const obj: any = {}; @@ -1725,9 +2406,11 @@ export const QueryDenomMetadataRequest = { return message; }, fromAmino(object: QueryDenomMetadataRequestAmino): QueryDenomMetadataRequest { - return { - denom: object.denom - }; + const message = createBaseQueryDenomMetadataRequest(); + if (object.denom !== undefined && object.denom !== null) { + message.denom = object.denom; + } + return message; }, toAmino(message: QueryDenomMetadataRequest): QueryDenomMetadataRequestAmino { const obj: any = {}; @@ -1792,13 +2475,15 @@ export const QueryDenomMetadataResponse = { return message; }, fromAmino(object: QueryDenomMetadataResponseAmino): QueryDenomMetadataResponse { - return { - metadata: object?.metadata ? Metadata.fromAmino(object.metadata) : undefined - }; + const message = createBaseQueryDenomMetadataResponse(); + if (object.metadata !== undefined && object.metadata !== null) { + message.metadata = Metadata.fromAmino(object.metadata); + } + return message; }, toAmino(message: QueryDenomMetadataResponse): QueryDenomMetadataResponseAmino { const obj: any = {}; - obj.metadata = message.metadata ? Metadata.toAmino(message.metadata) : undefined; + obj.metadata = message.metadata ? Metadata.toAmino(message.metadata) : Metadata.fromPartial({}); return obj; }, fromAminoMsg(object: QueryDenomMetadataResponseAminoMsg): QueryDenomMetadataResponse { @@ -1823,29 +2508,36 @@ export const QueryDenomMetadataResponse = { }; } }; -function createBaseQueryBaseDenomRequest(): QueryBaseDenomRequest { +function createBaseQueryDenomOwnersRequest(): QueryDenomOwnersRequest { return { - denom: "" + denom: "", + pagination: undefined }; } -export const QueryBaseDenomRequest = { - typeUrl: "/cosmos.bank.v1beta1.QueryBaseDenomRequest", - encode(message: QueryBaseDenomRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { +export const QueryDenomOwnersRequest = { + typeUrl: "/cosmos.bank.v1beta1.QueryDenomOwnersRequest", + encode(message: QueryDenomOwnersRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.denom !== "") { writer.uint32(10).string(message.denom); } + if (message.pagination !== undefined) { + PageRequest.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + } return writer; }, - decode(input: BinaryReader | Uint8Array, length?: number): QueryBaseDenomRequest { + decode(input: BinaryReader | Uint8Array, length?: number): QueryDenomOwnersRequest { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQueryBaseDenomRequest(); + const message = createBaseQueryDenomOwnersRequest(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: message.denom = reader.string(); break; + case 2: + message.pagination = PageRequest.decode(reader, reader.uint32()); + break; default: reader.skipType(tag & 7); break; @@ -1853,65 +2545,243 @@ export const QueryBaseDenomRequest = { } return message; }, - fromPartial(object: Partial): QueryBaseDenomRequest { - const message = createBaseQueryBaseDenomRequest(); + fromPartial(object: Partial): QueryDenomOwnersRequest { + const message = createBaseQueryDenomOwnersRequest(); message.denom = object.denom ?? ""; + message.pagination = object.pagination !== undefined && object.pagination !== null ? PageRequest.fromPartial(object.pagination) : undefined; + return message; + }, + fromAmino(object: QueryDenomOwnersRequestAmino): QueryDenomOwnersRequest { + const message = createBaseQueryDenomOwnersRequest(); + if (object.denom !== undefined && object.denom !== null) { + message.denom = object.denom; + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromAmino(object.pagination); + } + return message; + }, + toAmino(message: QueryDenomOwnersRequest): QueryDenomOwnersRequestAmino { + const obj: any = {}; + obj.denom = message.denom; + obj.pagination = message.pagination ? PageRequest.toAmino(message.pagination) : undefined; + return obj; + }, + fromAminoMsg(object: QueryDenomOwnersRequestAminoMsg): QueryDenomOwnersRequest { + return QueryDenomOwnersRequest.fromAmino(object.value); + }, + toAminoMsg(message: QueryDenomOwnersRequest): QueryDenomOwnersRequestAminoMsg { + return { + type: "cosmos-sdk/QueryDenomOwnersRequest", + value: QueryDenomOwnersRequest.toAmino(message) + }; + }, + fromProtoMsg(message: QueryDenomOwnersRequestProtoMsg): QueryDenomOwnersRequest { + return QueryDenomOwnersRequest.decode(message.value); + }, + toProto(message: QueryDenomOwnersRequest): Uint8Array { + return QueryDenomOwnersRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryDenomOwnersRequest): QueryDenomOwnersRequestProtoMsg { + return { + typeUrl: "/cosmos.bank.v1beta1.QueryDenomOwnersRequest", + value: QueryDenomOwnersRequest.encode(message).finish() + }; + } +}; +function createBaseDenomOwner(): DenomOwner { + return { + address: "", + balance: Coin.fromPartial({}) + }; +} +export const DenomOwner = { + typeUrl: "/cosmos.bank.v1beta1.DenomOwner", + encode(message: DenomOwner, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.address !== "") { + writer.uint32(10).string(message.address); + } + if (message.balance !== undefined) { + Coin.encode(message.balance, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): DenomOwner { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseDenomOwner(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.address = reader.string(); + break; + case 2: + message.balance = Coin.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): DenomOwner { + const message = createBaseDenomOwner(); + message.address = object.address ?? ""; + message.balance = object.balance !== undefined && object.balance !== null ? Coin.fromPartial(object.balance) : undefined; + return message; + }, + fromAmino(object: DenomOwnerAmino): DenomOwner { + const message = createBaseDenomOwner(); + if (object.address !== undefined && object.address !== null) { + message.address = object.address; + } + if (object.balance !== undefined && object.balance !== null) { + message.balance = Coin.fromAmino(object.balance); + } return message; }, - fromAmino(object: QueryBaseDenomRequestAmino): QueryBaseDenomRequest { + toAmino(message: DenomOwner): DenomOwnerAmino { + const obj: any = {}; + obj.address = message.address; + obj.balance = message.balance ? Coin.toAmino(message.balance) : Coin.fromPartial({}); + return obj; + }, + fromAminoMsg(object: DenomOwnerAminoMsg): DenomOwner { + return DenomOwner.fromAmino(object.value); + }, + toAminoMsg(message: DenomOwner): DenomOwnerAminoMsg { return { - denom: object.denom + type: "cosmos-sdk/DenomOwner", + value: DenomOwner.toAmino(message) }; }, - toAmino(message: QueryBaseDenomRequest): QueryBaseDenomRequestAmino { + fromProtoMsg(message: DenomOwnerProtoMsg): DenomOwner { + return DenomOwner.decode(message.value); + }, + toProto(message: DenomOwner): Uint8Array { + return DenomOwner.encode(message).finish(); + }, + toProtoMsg(message: DenomOwner): DenomOwnerProtoMsg { + return { + typeUrl: "/cosmos.bank.v1beta1.DenomOwner", + value: DenomOwner.encode(message).finish() + }; + } +}; +function createBaseQueryDenomOwnersResponse(): QueryDenomOwnersResponse { + return { + denomOwners: [], + pagination: undefined + }; +} +export const QueryDenomOwnersResponse = { + typeUrl: "/cosmos.bank.v1beta1.QueryDenomOwnersResponse", + encode(message: QueryDenomOwnersResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.denomOwners) { + DenomOwner.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.pagination !== undefined) { + PageResponse.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryDenomOwnersResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryDenomOwnersResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.denomOwners.push(DenomOwner.decode(reader, reader.uint32())); + break; + case 2: + message.pagination = PageResponse.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryDenomOwnersResponse { + const message = createBaseQueryDenomOwnersResponse(); + message.denomOwners = object.denomOwners?.map(e => DenomOwner.fromPartial(e)) || []; + message.pagination = object.pagination !== undefined && object.pagination !== null ? PageResponse.fromPartial(object.pagination) : undefined; + return message; + }, + fromAmino(object: QueryDenomOwnersResponseAmino): QueryDenomOwnersResponse { + const message = createBaseQueryDenomOwnersResponse(); + message.denomOwners = object.denom_owners?.map(e => DenomOwner.fromAmino(e)) || []; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromAmino(object.pagination); + } + return message; + }, + toAmino(message: QueryDenomOwnersResponse): QueryDenomOwnersResponseAmino { const obj: any = {}; - obj.denom = message.denom; + if (message.denomOwners) { + obj.denom_owners = message.denomOwners.map(e => e ? DenomOwner.toAmino(e) : undefined); + } else { + obj.denom_owners = []; + } + obj.pagination = message.pagination ? PageResponse.toAmino(message.pagination) : undefined; return obj; }, - fromAminoMsg(object: QueryBaseDenomRequestAminoMsg): QueryBaseDenomRequest { - return QueryBaseDenomRequest.fromAmino(object.value); + fromAminoMsg(object: QueryDenomOwnersResponseAminoMsg): QueryDenomOwnersResponse { + return QueryDenomOwnersResponse.fromAmino(object.value); }, - toAminoMsg(message: QueryBaseDenomRequest): QueryBaseDenomRequestAminoMsg { + toAminoMsg(message: QueryDenomOwnersResponse): QueryDenomOwnersResponseAminoMsg { return { - type: "cosmos-sdk/QueryBaseDenomRequest", - value: QueryBaseDenomRequest.toAmino(message) + type: "cosmos-sdk/QueryDenomOwnersResponse", + value: QueryDenomOwnersResponse.toAmino(message) }; }, - fromProtoMsg(message: QueryBaseDenomRequestProtoMsg): QueryBaseDenomRequest { - return QueryBaseDenomRequest.decode(message.value); + fromProtoMsg(message: QueryDenomOwnersResponseProtoMsg): QueryDenomOwnersResponse { + return QueryDenomOwnersResponse.decode(message.value); }, - toProto(message: QueryBaseDenomRequest): Uint8Array { - return QueryBaseDenomRequest.encode(message).finish(); + toProto(message: QueryDenomOwnersResponse): Uint8Array { + return QueryDenomOwnersResponse.encode(message).finish(); }, - toProtoMsg(message: QueryBaseDenomRequest): QueryBaseDenomRequestProtoMsg { + toProtoMsg(message: QueryDenomOwnersResponse): QueryDenomOwnersResponseProtoMsg { return { - typeUrl: "/cosmos.bank.v1beta1.QueryBaseDenomRequest", - value: QueryBaseDenomRequest.encode(message).finish() + typeUrl: "/cosmos.bank.v1beta1.QueryDenomOwnersResponse", + value: QueryDenomOwnersResponse.encode(message).finish() }; } }; -function createBaseQueryBaseDenomResponse(): QueryBaseDenomResponse { +function createBaseQuerySendEnabledRequest(): QuerySendEnabledRequest { return { - baseDenom: "" + denoms: [], + pagination: undefined }; } -export const QueryBaseDenomResponse = { - typeUrl: "/cosmos.bank.v1beta1.QueryBaseDenomResponse", - encode(message: QueryBaseDenomResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { - if (message.baseDenom !== "") { - writer.uint32(10).string(message.baseDenom); +export const QuerySendEnabledRequest = { + typeUrl: "/cosmos.bank.v1beta1.QuerySendEnabledRequest", + encode(message: QuerySendEnabledRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.denoms) { + writer.uint32(10).string(v!); + } + if (message.pagination !== undefined) { + PageRequest.encode(message.pagination, writer.uint32(794).fork()).ldelim(); } return writer; }, - decode(input: BinaryReader | Uint8Array, length?: number): QueryBaseDenomResponse { + decode(input: BinaryReader | Uint8Array, length?: number): QuerySendEnabledRequest { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQueryBaseDenomResponse(); + const message = createBaseQuerySendEnabledRequest(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.baseDenom = reader.string(); + message.denoms.push(reader.string()); + break; + case 99: + message.pagination = PageRequest.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -1920,40 +2790,132 @@ export const QueryBaseDenomResponse = { } return message; }, - fromPartial(object: Partial): QueryBaseDenomResponse { - const message = createBaseQueryBaseDenomResponse(); - message.baseDenom = object.baseDenom ?? ""; + fromPartial(object: Partial): QuerySendEnabledRequest { + const message = createBaseQuerySendEnabledRequest(); + message.denoms = object.denoms?.map(e => e) || []; + message.pagination = object.pagination !== undefined && object.pagination !== null ? PageRequest.fromPartial(object.pagination) : undefined; + return message; + }, + fromAmino(object: QuerySendEnabledRequestAmino): QuerySendEnabledRequest { + const message = createBaseQuerySendEnabledRequest(); + message.denoms = object.denoms?.map(e => e) || []; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromAmino(object.pagination); + } return message; }, - fromAmino(object: QueryBaseDenomResponseAmino): QueryBaseDenomResponse { + toAmino(message: QuerySendEnabledRequest): QuerySendEnabledRequestAmino { + const obj: any = {}; + if (message.denoms) { + obj.denoms = message.denoms.map(e => e); + } else { + obj.denoms = []; + } + obj.pagination = message.pagination ? PageRequest.toAmino(message.pagination) : undefined; + return obj; + }, + fromAminoMsg(object: QuerySendEnabledRequestAminoMsg): QuerySendEnabledRequest { + return QuerySendEnabledRequest.fromAmino(object.value); + }, + toAminoMsg(message: QuerySendEnabledRequest): QuerySendEnabledRequestAminoMsg { + return { + type: "cosmos-sdk/QuerySendEnabledRequest", + value: QuerySendEnabledRequest.toAmino(message) + }; + }, + fromProtoMsg(message: QuerySendEnabledRequestProtoMsg): QuerySendEnabledRequest { + return QuerySendEnabledRequest.decode(message.value); + }, + toProto(message: QuerySendEnabledRequest): Uint8Array { + return QuerySendEnabledRequest.encode(message).finish(); + }, + toProtoMsg(message: QuerySendEnabledRequest): QuerySendEnabledRequestProtoMsg { return { - baseDenom: object.base_denom + typeUrl: "/cosmos.bank.v1beta1.QuerySendEnabledRequest", + value: QuerySendEnabledRequest.encode(message).finish() }; + } +}; +function createBaseQuerySendEnabledResponse(): QuerySendEnabledResponse { + return { + sendEnabled: [], + pagination: undefined + }; +} +export const QuerySendEnabledResponse = { + typeUrl: "/cosmos.bank.v1beta1.QuerySendEnabledResponse", + encode(message: QuerySendEnabledResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.sendEnabled) { + SendEnabled.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.pagination !== undefined) { + PageResponse.encode(message.pagination, writer.uint32(794).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QuerySendEnabledResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQuerySendEnabledResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.sendEnabled.push(SendEnabled.decode(reader, reader.uint32())); + break; + case 99: + message.pagination = PageResponse.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QuerySendEnabledResponse { + const message = createBaseQuerySendEnabledResponse(); + message.sendEnabled = object.sendEnabled?.map(e => SendEnabled.fromPartial(e)) || []; + message.pagination = object.pagination !== undefined && object.pagination !== null ? PageResponse.fromPartial(object.pagination) : undefined; + return message; + }, + fromAmino(object: QuerySendEnabledResponseAmino): QuerySendEnabledResponse { + const message = createBaseQuerySendEnabledResponse(); + message.sendEnabled = object.send_enabled?.map(e => SendEnabled.fromAmino(e)) || []; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromAmino(object.pagination); + } + return message; }, - toAmino(message: QueryBaseDenomResponse): QueryBaseDenomResponseAmino { + toAmino(message: QuerySendEnabledResponse): QuerySendEnabledResponseAmino { const obj: any = {}; - obj.base_denom = message.baseDenom; + if (message.sendEnabled) { + obj.send_enabled = message.sendEnabled.map(e => e ? SendEnabled.toAmino(e) : undefined); + } else { + obj.send_enabled = []; + } + obj.pagination = message.pagination ? PageResponse.toAmino(message.pagination) : undefined; return obj; }, - fromAminoMsg(object: QueryBaseDenomResponseAminoMsg): QueryBaseDenomResponse { - return QueryBaseDenomResponse.fromAmino(object.value); + fromAminoMsg(object: QuerySendEnabledResponseAminoMsg): QuerySendEnabledResponse { + return QuerySendEnabledResponse.fromAmino(object.value); }, - toAminoMsg(message: QueryBaseDenomResponse): QueryBaseDenomResponseAminoMsg { + toAminoMsg(message: QuerySendEnabledResponse): QuerySendEnabledResponseAminoMsg { return { - type: "cosmos-sdk/QueryBaseDenomResponse", - value: QueryBaseDenomResponse.toAmino(message) + type: "cosmos-sdk/QuerySendEnabledResponse", + value: QuerySendEnabledResponse.toAmino(message) }; }, - fromProtoMsg(message: QueryBaseDenomResponseProtoMsg): QueryBaseDenomResponse { - return QueryBaseDenomResponse.decode(message.value); + fromProtoMsg(message: QuerySendEnabledResponseProtoMsg): QuerySendEnabledResponse { + return QuerySendEnabledResponse.decode(message.value); }, - toProto(message: QueryBaseDenomResponse): Uint8Array { - return QueryBaseDenomResponse.encode(message).finish(); + toProto(message: QuerySendEnabledResponse): Uint8Array { + return QuerySendEnabledResponse.encode(message).finish(); }, - toProtoMsg(message: QueryBaseDenomResponse): QueryBaseDenomResponseProtoMsg { + toProtoMsg(message: QuerySendEnabledResponse): QuerySendEnabledResponseProtoMsg { return { - typeUrl: "/cosmos.bank.v1beta1.QueryBaseDenomResponse", - value: QueryBaseDenomResponse.encode(message).finish() + typeUrl: "/cosmos.bank.v1beta1.QuerySendEnabledResponse", + value: QuerySendEnabledResponse.encode(message).finish() }; } }; \ No newline at end of file diff --git a/packages/osmo-query/src/codegen/cosmos/bank/v1beta1/tx.amino.ts b/packages/osmo-query/src/codegen/cosmos/bank/v1beta1/tx.amino.ts index 340a07fc7..e1b950a79 100644 --- a/packages/osmo-query/src/codegen/cosmos/bank/v1beta1/tx.amino.ts +++ b/packages/osmo-query/src/codegen/cosmos/bank/v1beta1/tx.amino.ts @@ -1,5 +1,5 @@ //@ts-nocheck -import { MsgSend, MsgMultiSend } from "./tx"; +import { MsgSend, MsgMultiSend, MsgUpdateParams, MsgSetSendEnabled } from "./tx"; export const AminoConverter = { "/cosmos.bank.v1beta1.MsgSend": { aminoType: "cosmos-sdk/MsgSend", @@ -10,5 +10,15 @@ export const AminoConverter = { aminoType: "cosmos-sdk/MsgMultiSend", toAmino: MsgMultiSend.toAmino, fromAmino: MsgMultiSend.fromAmino + }, + "/cosmos.bank.v1beta1.MsgUpdateParams": { + aminoType: "cosmos-sdk/x/bank/MsgUpdateParams", + toAmino: MsgUpdateParams.toAmino, + fromAmino: MsgUpdateParams.fromAmino + }, + "/cosmos.bank.v1beta1.MsgSetSendEnabled": { + aminoType: "cosmos-sdk/MsgSetSendEnabled", + toAmino: MsgSetSendEnabled.toAmino, + fromAmino: MsgSetSendEnabled.fromAmino } }; \ No newline at end of file diff --git a/packages/osmo-query/src/codegen/cosmos/bank/v1beta1/tx.registry.ts b/packages/osmo-query/src/codegen/cosmos/bank/v1beta1/tx.registry.ts index 716f9d0da..33b6bb81f 100644 --- a/packages/osmo-query/src/codegen/cosmos/bank/v1beta1/tx.registry.ts +++ b/packages/osmo-query/src/codegen/cosmos/bank/v1beta1/tx.registry.ts @@ -1,7 +1,7 @@ //@ts-nocheck import { GeneratedType, Registry } from "@cosmjs/proto-signing"; -import { MsgSend, MsgMultiSend } from "./tx"; -export const registry: ReadonlyArray<[string, GeneratedType]> = [["/cosmos.bank.v1beta1.MsgSend", MsgSend], ["/cosmos.bank.v1beta1.MsgMultiSend", MsgMultiSend]]; +import { MsgSend, MsgMultiSend, MsgUpdateParams, MsgSetSendEnabled } from "./tx"; +export const registry: ReadonlyArray<[string, GeneratedType]> = [["/cosmos.bank.v1beta1.MsgSend", MsgSend], ["/cosmos.bank.v1beta1.MsgMultiSend", MsgMultiSend], ["/cosmos.bank.v1beta1.MsgUpdateParams", MsgUpdateParams], ["/cosmos.bank.v1beta1.MsgSetSendEnabled", MsgSetSendEnabled]]; export const load = (protoRegistry: Registry) => { registry.forEach(([typeUrl, mod]) => { protoRegistry.register(typeUrl, mod); @@ -20,6 +20,18 @@ export const MessageComposer = { typeUrl: "/cosmos.bank.v1beta1.MsgMultiSend", value: MsgMultiSend.encode(value).finish() }; + }, + updateParams(value: MsgUpdateParams) { + return { + typeUrl: "/cosmos.bank.v1beta1.MsgUpdateParams", + value: MsgUpdateParams.encode(value).finish() + }; + }, + setSendEnabled(value: MsgSetSendEnabled) { + return { + typeUrl: "/cosmos.bank.v1beta1.MsgSetSendEnabled", + value: MsgSetSendEnabled.encode(value).finish() + }; } }, withTypeUrl: { @@ -34,6 +46,18 @@ export const MessageComposer = { typeUrl: "/cosmos.bank.v1beta1.MsgMultiSend", value }; + }, + updateParams(value: MsgUpdateParams) { + return { + typeUrl: "/cosmos.bank.v1beta1.MsgUpdateParams", + value + }; + }, + setSendEnabled(value: MsgSetSendEnabled) { + return { + typeUrl: "/cosmos.bank.v1beta1.MsgSetSendEnabled", + value + }; } }, fromPartial: { @@ -48,6 +72,18 @@ export const MessageComposer = { typeUrl: "/cosmos.bank.v1beta1.MsgMultiSend", value: MsgMultiSend.fromPartial(value) }; + }, + updateParams(value: MsgUpdateParams) { + return { + typeUrl: "/cosmos.bank.v1beta1.MsgUpdateParams", + value: MsgUpdateParams.fromPartial(value) + }; + }, + setSendEnabled(value: MsgSetSendEnabled) { + return { + typeUrl: "/cosmos.bank.v1beta1.MsgSetSendEnabled", + value: MsgSetSendEnabled.fromPartial(value) + }; } } }; \ No newline at end of file diff --git a/packages/osmo-query/src/codegen/cosmos/bank/v1beta1/tx.rpc.msg.ts b/packages/osmo-query/src/codegen/cosmos/bank/v1beta1/tx.rpc.msg.ts index 2193a1df2..5433ee10e 100644 --- a/packages/osmo-query/src/codegen/cosmos/bank/v1beta1/tx.rpc.msg.ts +++ b/packages/osmo-query/src/codegen/cosmos/bank/v1beta1/tx.rpc.msg.ts @@ -1,19 +1,28 @@ import { Rpc } from "../../../helpers"; import { BinaryReader } from "../../../binary"; -import { MsgSend, MsgSendResponse, MsgMultiSend, MsgMultiSendResponse } from "./tx"; +import { MsgSend, MsgSendResponse, MsgMultiSend, MsgMultiSendResponse, MsgUpdateParams, MsgUpdateParamsResponse, MsgSetSendEnabled, MsgSetSendEnabledResponse } from "./tx"; /** Msg defines the bank Msg service. */ export interface Msg { + /** Send defines a method for sending coins from one account to another account. */ + send(request: MsgSend): Promise; + /** MultiSend defines a method for sending coins from some accounts to other accounts. */ + multiSend(request: MsgMultiSend): Promise; /** - * Send defines a method for sending coins from one account to another - * account. + * UpdateParams defines a governance operation for updating the x/bank module parameters. + * The authority is defined in the keeper. + * + * Since: cosmos-sdk 0.47 */ - send(request: MsgSend): Promise; + updateParams(request: MsgUpdateParams): Promise; /** - * MultiSend defines a method for sending coins from a single account to - * multiple accounts. It can be seen as a single message representation of - * multiple individual MsgSend messages. + * SetSendEnabled is a governance operation for setting the SendEnabled flag + * on any number of Denoms. Only the entries to add or update should be + * included. Entries that already exist in the store, but that aren't + * included in this message, will be left unchanged. + * + * Since: cosmos-sdk 0.47 */ - multiSend(request: MsgMultiSend): Promise; + setSendEnabled(request: MsgSetSendEnabled): Promise; } export class MsgClientImpl implements Msg { private readonly rpc: Rpc; @@ -21,6 +30,8 @@ export class MsgClientImpl implements Msg { this.rpc = rpc; this.send = this.send.bind(this); this.multiSend = this.multiSend.bind(this); + this.updateParams = this.updateParams.bind(this); + this.setSendEnabled = this.setSendEnabled.bind(this); } send(request: MsgSend): Promise { const data = MsgSend.encode(request).finish(); @@ -32,4 +43,14 @@ export class MsgClientImpl implements Msg { const promise = this.rpc.request("cosmos.bank.v1beta1.Msg", "MultiSend", data); return promise.then(data => MsgMultiSendResponse.decode(new BinaryReader(data))); } + updateParams(request: MsgUpdateParams): Promise { + const data = MsgUpdateParams.encode(request).finish(); + const promise = this.rpc.request("cosmos.bank.v1beta1.Msg", "UpdateParams", data); + return promise.then(data => MsgUpdateParamsResponse.decode(new BinaryReader(data))); + } + setSendEnabled(request: MsgSetSendEnabled): Promise { + const data = MsgSetSendEnabled.encode(request).finish(); + const promise = this.rpc.request("cosmos.bank.v1beta1.Msg", "SetSendEnabled", data); + return promise.then(data => MsgSetSendEnabledResponse.decode(new BinaryReader(data))); + } } \ No newline at end of file diff --git a/packages/osmo-query/src/codegen/cosmos/bank/v1beta1/tx.ts b/packages/osmo-query/src/codegen/cosmos/bank/v1beta1/tx.ts index 139f1166a..60d3c37e6 100644 --- a/packages/osmo-query/src/codegen/cosmos/bank/v1beta1/tx.ts +++ b/packages/osmo-query/src/codegen/cosmos/bank/v1beta1/tx.ts @@ -1,5 +1,5 @@ import { Coin, CoinAmino, CoinSDKType } from "../../base/v1beta1/coin"; -import { Input, InputAmino, InputSDKType, Output, OutputAmino, OutputSDKType } from "./bank"; +import { Input, InputAmino, InputSDKType, Output, OutputAmino, OutputSDKType, Params, ParamsAmino, ParamsSDKType, SendEnabled, SendEnabledAmino, SendEnabledSDKType } from "./bank"; import { BinaryReader, BinaryWriter } from "../../../binary"; /** MsgSend represents a message to send coins from one account to another. */ export interface MsgSend { @@ -13,8 +13,8 @@ export interface MsgSendProtoMsg { } /** MsgSend represents a message to send coins from one account to another. */ export interface MsgSendAmino { - from_address: string; - to_address: string; + from_address?: string; + to_address?: string; amount: CoinAmino[]; } export interface MsgSendAminoMsg { @@ -43,6 +43,10 @@ export interface MsgSendResponseAminoMsg { export interface MsgSendResponseSDKType {} /** MsgMultiSend represents an arbitrary multi-in, multi-out send message. */ export interface MsgMultiSend { + /** + * Inputs, despite being `repeated`, only allows one sender input. This is + * checked in MsgMultiSend's ValidateBasic. + */ inputs: Input[]; outputs: Output[]; } @@ -52,6 +56,10 @@ export interface MsgMultiSendProtoMsg { } /** MsgMultiSend represents an arbitrary multi-in, multi-out send message. */ export interface MsgMultiSendAmino { + /** + * Inputs, despite being `repeated`, only allows one sender input. This is + * checked in MsgMultiSend's ValidateBasic. + */ inputs: InputAmino[]; outputs: OutputAmino[]; } @@ -78,6 +86,172 @@ export interface MsgMultiSendResponseAminoMsg { } /** MsgMultiSendResponse defines the Msg/MultiSend response type. */ export interface MsgMultiSendResponseSDKType {} +/** + * MsgUpdateParams is the Msg/UpdateParams request type. + * + * Since: cosmos-sdk 0.47 + */ +export interface MsgUpdateParams { + /** authority is the address that controls the module (defaults to x/gov unless overwritten). */ + authority: string; + /** + * params defines the x/bank parameters to update. + * + * NOTE: All parameters must be supplied. + */ + params: Params; +} +export interface MsgUpdateParamsProtoMsg { + typeUrl: "/cosmos.bank.v1beta1.MsgUpdateParams"; + value: Uint8Array; +} +/** + * MsgUpdateParams is the Msg/UpdateParams request type. + * + * Since: cosmos-sdk 0.47 + */ +export interface MsgUpdateParamsAmino { + /** authority is the address that controls the module (defaults to x/gov unless overwritten). */ + authority?: string; + /** + * params defines the x/bank parameters to update. + * + * NOTE: All parameters must be supplied. + */ + params: ParamsAmino; +} +export interface MsgUpdateParamsAminoMsg { + type: "cosmos-sdk/x/bank/MsgUpdateParams"; + value: MsgUpdateParamsAmino; +} +/** + * MsgUpdateParams is the Msg/UpdateParams request type. + * + * Since: cosmos-sdk 0.47 + */ +export interface MsgUpdateParamsSDKType { + authority: string; + params: ParamsSDKType; +} +/** + * MsgUpdateParamsResponse defines the response structure for executing a + * MsgUpdateParams message. + * + * Since: cosmos-sdk 0.47 + */ +export interface MsgUpdateParamsResponse {} +export interface MsgUpdateParamsResponseProtoMsg { + typeUrl: "/cosmos.bank.v1beta1.MsgUpdateParamsResponse"; + value: Uint8Array; +} +/** + * MsgUpdateParamsResponse defines the response structure for executing a + * MsgUpdateParams message. + * + * Since: cosmos-sdk 0.47 + */ +export interface MsgUpdateParamsResponseAmino {} +export interface MsgUpdateParamsResponseAminoMsg { + type: "cosmos-sdk/MsgUpdateParamsResponse"; + value: MsgUpdateParamsResponseAmino; +} +/** + * MsgUpdateParamsResponse defines the response structure for executing a + * MsgUpdateParams message. + * + * Since: cosmos-sdk 0.47 + */ +export interface MsgUpdateParamsResponseSDKType {} +/** + * MsgSetSendEnabled is the Msg/SetSendEnabled request type. + * + * Only entries to add/update/delete need to be included. + * Existing SendEnabled entries that are not included in this + * message are left unchanged. + * + * Since: cosmos-sdk 0.47 + */ +export interface MsgSetSendEnabled { + authority: string; + /** send_enabled is the list of entries to add or update. */ + sendEnabled: SendEnabled[]; + /** + * use_default_for is a list of denoms that should use the params.default_send_enabled value. + * Denoms listed here will have their SendEnabled entries deleted. + * If a denom is included that doesn't have a SendEnabled entry, + * it will be ignored. + */ + useDefaultFor: string[]; +} +export interface MsgSetSendEnabledProtoMsg { + typeUrl: "/cosmos.bank.v1beta1.MsgSetSendEnabled"; + value: Uint8Array; +} +/** + * MsgSetSendEnabled is the Msg/SetSendEnabled request type. + * + * Only entries to add/update/delete need to be included. + * Existing SendEnabled entries that are not included in this + * message are left unchanged. + * + * Since: cosmos-sdk 0.47 + */ +export interface MsgSetSendEnabledAmino { + authority?: string; + /** send_enabled is the list of entries to add or update. */ + send_enabled?: SendEnabledAmino[]; + /** + * use_default_for is a list of denoms that should use the params.default_send_enabled value. + * Denoms listed here will have their SendEnabled entries deleted. + * If a denom is included that doesn't have a SendEnabled entry, + * it will be ignored. + */ + use_default_for?: string[]; +} +export interface MsgSetSendEnabledAminoMsg { + type: "cosmos-sdk/MsgSetSendEnabled"; + value: MsgSetSendEnabledAmino; +} +/** + * MsgSetSendEnabled is the Msg/SetSendEnabled request type. + * + * Only entries to add/update/delete need to be included. + * Existing SendEnabled entries that are not included in this + * message are left unchanged. + * + * Since: cosmos-sdk 0.47 + */ +export interface MsgSetSendEnabledSDKType { + authority: string; + send_enabled: SendEnabledSDKType[]; + use_default_for: string[]; +} +/** + * MsgSetSendEnabledResponse defines the Msg/SetSendEnabled response type. + * + * Since: cosmos-sdk 0.47 + */ +export interface MsgSetSendEnabledResponse {} +export interface MsgSetSendEnabledResponseProtoMsg { + typeUrl: "/cosmos.bank.v1beta1.MsgSetSendEnabledResponse"; + value: Uint8Array; +} +/** + * MsgSetSendEnabledResponse defines the Msg/SetSendEnabled response type. + * + * Since: cosmos-sdk 0.47 + */ +export interface MsgSetSendEnabledResponseAmino {} +export interface MsgSetSendEnabledResponseAminoMsg { + type: "cosmos-sdk/MsgSetSendEnabledResponse"; + value: MsgSetSendEnabledResponseAmino; +} +/** + * MsgSetSendEnabledResponse defines the Msg/SetSendEnabled response type. + * + * Since: cosmos-sdk 0.47 + */ +export interface MsgSetSendEnabledResponseSDKType {} function createBaseMsgSend(): MsgSend { return { fromAddress: "", @@ -130,11 +304,15 @@ export const MsgSend = { return message; }, fromAmino(object: MsgSendAmino): MsgSend { - return { - fromAddress: object.from_address, - toAddress: object.to_address, - amount: Array.isArray(object?.amount) ? object.amount.map((e: any) => Coin.fromAmino(e)) : [] - }; + const message = createBaseMsgSend(); + if (object.from_address !== undefined && object.from_address !== null) { + message.fromAddress = object.from_address; + } + if (object.to_address !== undefined && object.to_address !== null) { + message.toAddress = object.to_address; + } + message.amount = object.amount?.map(e => Coin.fromAmino(e)) || []; + return message; }, toAmino(message: MsgSend): MsgSendAmino { const obj: any = {}; @@ -196,7 +374,8 @@ export const MsgSendResponse = { return message; }, fromAmino(_: MsgSendResponseAmino): MsgSendResponse { - return {}; + const message = createBaseMsgSendResponse(); + return message; }, toAmino(_: MsgSendResponse): MsgSendResponseAmino { const obj: any = {}; @@ -268,10 +447,10 @@ export const MsgMultiSend = { return message; }, fromAmino(object: MsgMultiSendAmino): MsgMultiSend { - return { - inputs: Array.isArray(object?.inputs) ? object.inputs.map((e: any) => Input.fromAmino(e)) : [], - outputs: Array.isArray(object?.outputs) ? object.outputs.map((e: any) => Output.fromAmino(e)) : [] - }; + const message = createBaseMsgMultiSend(); + message.inputs = object.inputs?.map(e => Input.fromAmino(e)) || []; + message.outputs = object.outputs?.map(e => Output.fromAmino(e)) || []; + return message; }, toAmino(message: MsgMultiSend): MsgMultiSendAmino { const obj: any = {}; @@ -336,7 +515,8 @@ export const MsgMultiSendResponse = { return message; }, fromAmino(_: MsgMultiSendResponseAmino): MsgMultiSendResponse { - return {}; + const message = createBaseMsgMultiSendResponse(); + return message; }, toAmino(_: MsgMultiSendResponse): MsgMultiSendResponseAmino { const obj: any = {}; @@ -363,4 +543,294 @@ export const MsgMultiSendResponse = { value: MsgMultiSendResponse.encode(message).finish() }; } +}; +function createBaseMsgUpdateParams(): MsgUpdateParams { + return { + authority: "", + params: Params.fromPartial({}) + }; +} +export const MsgUpdateParams = { + typeUrl: "/cosmos.bank.v1beta1.MsgUpdateParams", + encode(message: MsgUpdateParams, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.authority !== "") { + writer.uint32(10).string(message.authority); + } + if (message.params !== undefined) { + Params.encode(message.params, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgUpdateParams { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUpdateParams(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.authority = reader.string(); + break; + case 2: + message.params = Params.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgUpdateParams { + const message = createBaseMsgUpdateParams(); + message.authority = object.authority ?? ""; + message.params = object.params !== undefined && object.params !== null ? Params.fromPartial(object.params) : undefined; + return message; + }, + fromAmino(object: MsgUpdateParamsAmino): MsgUpdateParams { + const message = createBaseMsgUpdateParams(); + if (object.authority !== undefined && object.authority !== null) { + message.authority = object.authority; + } + if (object.params !== undefined && object.params !== null) { + message.params = Params.fromAmino(object.params); + } + return message; + }, + toAmino(message: MsgUpdateParams): MsgUpdateParamsAmino { + const obj: any = {}; + obj.authority = message.authority; + obj.params = message.params ? Params.toAmino(message.params) : Params.fromPartial({}); + return obj; + }, + fromAminoMsg(object: MsgUpdateParamsAminoMsg): MsgUpdateParams { + return MsgUpdateParams.fromAmino(object.value); + }, + toAminoMsg(message: MsgUpdateParams): MsgUpdateParamsAminoMsg { + return { + type: "cosmos-sdk/x/bank/MsgUpdateParams", + value: MsgUpdateParams.toAmino(message) + }; + }, + fromProtoMsg(message: MsgUpdateParamsProtoMsg): MsgUpdateParams { + return MsgUpdateParams.decode(message.value); + }, + toProto(message: MsgUpdateParams): Uint8Array { + return MsgUpdateParams.encode(message).finish(); + }, + toProtoMsg(message: MsgUpdateParams): MsgUpdateParamsProtoMsg { + return { + typeUrl: "/cosmos.bank.v1beta1.MsgUpdateParams", + value: MsgUpdateParams.encode(message).finish() + }; + } +}; +function createBaseMsgUpdateParamsResponse(): MsgUpdateParamsResponse { + return {}; +} +export const MsgUpdateParamsResponse = { + typeUrl: "/cosmos.bank.v1beta1.MsgUpdateParamsResponse", + encode(_: MsgUpdateParamsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgUpdateParamsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUpdateParamsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): MsgUpdateParamsResponse { + const message = createBaseMsgUpdateParamsResponse(); + return message; + }, + fromAmino(_: MsgUpdateParamsResponseAmino): MsgUpdateParamsResponse { + const message = createBaseMsgUpdateParamsResponse(); + return message; + }, + toAmino(_: MsgUpdateParamsResponse): MsgUpdateParamsResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgUpdateParamsResponseAminoMsg): MsgUpdateParamsResponse { + return MsgUpdateParamsResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgUpdateParamsResponse): MsgUpdateParamsResponseAminoMsg { + return { + type: "cosmos-sdk/MsgUpdateParamsResponse", + value: MsgUpdateParamsResponse.toAmino(message) + }; + }, + fromProtoMsg(message: MsgUpdateParamsResponseProtoMsg): MsgUpdateParamsResponse { + return MsgUpdateParamsResponse.decode(message.value); + }, + toProto(message: MsgUpdateParamsResponse): Uint8Array { + return MsgUpdateParamsResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgUpdateParamsResponse): MsgUpdateParamsResponseProtoMsg { + return { + typeUrl: "/cosmos.bank.v1beta1.MsgUpdateParamsResponse", + value: MsgUpdateParamsResponse.encode(message).finish() + }; + } +}; +function createBaseMsgSetSendEnabled(): MsgSetSendEnabled { + return { + authority: "", + sendEnabled: [], + useDefaultFor: [] + }; +} +export const MsgSetSendEnabled = { + typeUrl: "/cosmos.bank.v1beta1.MsgSetSendEnabled", + encode(message: MsgSetSendEnabled, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.authority !== "") { + writer.uint32(10).string(message.authority); + } + for (const v of message.sendEnabled) { + SendEnabled.encode(v!, writer.uint32(18).fork()).ldelim(); + } + for (const v of message.useDefaultFor) { + writer.uint32(26).string(v!); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgSetSendEnabled { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgSetSendEnabled(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.authority = reader.string(); + break; + case 2: + message.sendEnabled.push(SendEnabled.decode(reader, reader.uint32())); + break; + case 3: + message.useDefaultFor.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgSetSendEnabled { + const message = createBaseMsgSetSendEnabled(); + message.authority = object.authority ?? ""; + message.sendEnabled = object.sendEnabled?.map(e => SendEnabled.fromPartial(e)) || []; + message.useDefaultFor = object.useDefaultFor?.map(e => e) || []; + return message; + }, + fromAmino(object: MsgSetSendEnabledAmino): MsgSetSendEnabled { + const message = createBaseMsgSetSendEnabled(); + if (object.authority !== undefined && object.authority !== null) { + message.authority = object.authority; + } + message.sendEnabled = object.send_enabled?.map(e => SendEnabled.fromAmino(e)) || []; + message.useDefaultFor = object.use_default_for?.map(e => e) || []; + return message; + }, + toAmino(message: MsgSetSendEnabled): MsgSetSendEnabledAmino { + const obj: any = {}; + obj.authority = message.authority; + if (message.sendEnabled) { + obj.send_enabled = message.sendEnabled.map(e => e ? SendEnabled.toAmino(e) : undefined); + } else { + obj.send_enabled = []; + } + if (message.useDefaultFor) { + obj.use_default_for = message.useDefaultFor.map(e => e); + } else { + obj.use_default_for = []; + } + return obj; + }, + fromAminoMsg(object: MsgSetSendEnabledAminoMsg): MsgSetSendEnabled { + return MsgSetSendEnabled.fromAmino(object.value); + }, + toAminoMsg(message: MsgSetSendEnabled): MsgSetSendEnabledAminoMsg { + return { + type: "cosmos-sdk/MsgSetSendEnabled", + value: MsgSetSendEnabled.toAmino(message) + }; + }, + fromProtoMsg(message: MsgSetSendEnabledProtoMsg): MsgSetSendEnabled { + return MsgSetSendEnabled.decode(message.value); + }, + toProto(message: MsgSetSendEnabled): Uint8Array { + return MsgSetSendEnabled.encode(message).finish(); + }, + toProtoMsg(message: MsgSetSendEnabled): MsgSetSendEnabledProtoMsg { + return { + typeUrl: "/cosmos.bank.v1beta1.MsgSetSendEnabled", + value: MsgSetSendEnabled.encode(message).finish() + }; + } +}; +function createBaseMsgSetSendEnabledResponse(): MsgSetSendEnabledResponse { + return {}; +} +export const MsgSetSendEnabledResponse = { + typeUrl: "/cosmos.bank.v1beta1.MsgSetSendEnabledResponse", + encode(_: MsgSetSendEnabledResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgSetSendEnabledResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgSetSendEnabledResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): MsgSetSendEnabledResponse { + const message = createBaseMsgSetSendEnabledResponse(); + return message; + }, + fromAmino(_: MsgSetSendEnabledResponseAmino): MsgSetSendEnabledResponse { + const message = createBaseMsgSetSendEnabledResponse(); + return message; + }, + toAmino(_: MsgSetSendEnabledResponse): MsgSetSendEnabledResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgSetSendEnabledResponseAminoMsg): MsgSetSendEnabledResponse { + return MsgSetSendEnabledResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgSetSendEnabledResponse): MsgSetSendEnabledResponseAminoMsg { + return { + type: "cosmos-sdk/MsgSetSendEnabledResponse", + value: MsgSetSendEnabledResponse.toAmino(message) + }; + }, + fromProtoMsg(message: MsgSetSendEnabledResponseProtoMsg): MsgSetSendEnabledResponse { + return MsgSetSendEnabledResponse.decode(message.value); + }, + toProto(message: MsgSetSendEnabledResponse): Uint8Array { + return MsgSetSendEnabledResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgSetSendEnabledResponse): MsgSetSendEnabledResponseProtoMsg { + return { + typeUrl: "/cosmos.bank.v1beta1.MsgSetSendEnabledResponse", + value: MsgSetSendEnabledResponse.encode(message).finish() + }; + } }; \ No newline at end of file diff --git a/packages/osmo-query/src/codegen/cosmos/base/abci/v1beta1/abci.ts b/packages/osmo-query/src/codegen/cosmos/base/abci/v1beta1/abci.ts index 1f4e47233..05b915e3c 100644 --- a/packages/osmo-query/src/codegen/cosmos/base/abci/v1beta1/abci.ts +++ b/packages/osmo-query/src/codegen/cosmos/base/abci/v1beta1/abci.ts @@ -1,6 +1,7 @@ import { Any, AnyAmino, AnySDKType } from "../../../../google/protobuf/any"; import { Event, EventAmino, EventSDKType } from "../../../../tendermint/abci/types"; import { BinaryReader, BinaryWriter } from "../../../../binary"; +import { bytesFromBase64, base64FromBytes } from "../../../../helpers"; /** * TxResponse defines a structure containing relevant tx data and metadata. The * tags are stringified and the log is JSON decoded. @@ -30,7 +31,7 @@ export interface TxResponse { /** Amount of gas consumed by transaction. */ gasUsed: bigint; /** 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, @@ -40,7 +41,7 @@ export interface TxResponse { /** * Events defines all the events emitted by processing a transaction. Note, * these events include those emitted by processing all the messages and those - * emitted from the ante handler. Whereas Logs contains the events, with + * emitted from the ante. Whereas Logs contains the events, with * additional metadata, emitted only by processing the messages. * * Since: cosmos-sdk 0.42.11, 0.44.5, 0.45 @@ -57,28 +58,28 @@ export interface TxResponseProtoMsg { */ export interface TxResponseAmino { /** The block height */ - height: string; + height?: string; /** 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. */ - raw_log: string; + raw_log?: string; /** The output of the application's logger (typed). May be non-deterministic. */ - logs: ABCIMessageLogAmino[]; + logs?: ABCIMessageLogAmino[]; /** Additional information. May be non-deterministic. */ - info: string; + info?: string; /** Amount of gas requested for transaction. */ - gas_wanted: string; + gas_wanted?: string; /** Amount of gas consumed by transaction. */ - gas_used: string; + gas_used?: string; /** The request transaction bytes. */ tx?: AnyAmino; /** @@ -86,16 +87,16 @@ export interface TxResponseAmino { * 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 - * emitted from the ante handler. Whereas Logs contains the events, with + * emitted from the ante. Whereas Logs contains the events, with * additional metadata, emitted only by processing the messages. * * Since: cosmos-sdk 0.42.11, 0.44.5, 0.45 */ - events: EventAmino[]; + events?: EventAmino[]; } export interface TxResponseAminoMsg { type: "cosmos-sdk/TxResponse"; @@ -116,7 +117,7 @@ export interface TxResponseSDKType { info: string; gas_wanted: bigint; gas_used: bigint; - tx: AnySDKType; + tx?: AnySDKType; timestamp: string; events: EventSDKType[]; } @@ -136,13 +137,13 @@ export interface ABCIMessageLogProtoMsg { } /** ABCIMessageLog defines a structure containing an indexed tx ABCI message log. */ export interface ABCIMessageLogAmino { - msg_index: number; - log: string; + msg_index?: number; + log?: string; /** * Events contains a slice of Event objects that were emitted during some * execution. */ - events: StringEventAmino[]; + events?: StringEventAmino[]; } export interface ABCIMessageLogAminoMsg { type: "cosmos-sdk/ABCIMessageLog"; @@ -171,8 +172,8 @@ export interface StringEventProtoMsg { * contain key/value pairs that are strings instead of raw bytes. */ export interface StringEventAmino { - type: string; - attributes: AttributeAmino[]; + type?: string; + attributes?: AttributeAmino[]; } export interface StringEventAminoMsg { type: "cosmos-sdk/StringEvent"; @@ -203,8 +204,8 @@ export interface AttributeProtoMsg { * strings instead of raw bytes. */ export interface AttributeAmino { - key: string; - value: string; + key?: string; + value?: string; } export interface AttributeAminoMsg { type: "cosmos-sdk/Attribute"; @@ -232,9 +233,9 @@ export interface GasInfoProtoMsg { /** GasInfo defines tx execution gas context. */ export interface GasInfoAmino { /** GasWanted is the maximum units of work we allow this tx to perform. */ - gas_wanted: string; + gas_wanted?: string; /** GasUsed is the amount of gas actually consumed. */ - gas_used: string; + gas_used?: string; } export interface GasInfoAminoMsg { type: "cosmos-sdk/GasInfo"; @@ -250,7 +251,10 @@ 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. + * Deprecated. This field is still populated, but prefer msg_response instead + * because it also contains the Msg response typeURL. */ + /** @deprecated */ data: Uint8Array; /** Log contains the log information from message or handler execution. */ log: string; @@ -259,6 +263,12 @@ export interface Result { * or handler execution. */ events: Event[]; + /** + * msg_responses contains the Msg handler responses type packed in Anys. + * + * Since: cosmos-sdk 0.46 + */ + msgResponses: Any[]; } export interface ResultProtoMsg { typeUrl: "/cosmos.base.abci.v1beta1.Result"; @@ -269,15 +279,24 @@ export interface ResultAmino { /** * Data is any data returned from message or handler execution. It MUST be * length prefixed in order to separate data from multiple message executions. + * Deprecated. This field is still populated, but prefer msg_response instead + * because it also contains the Msg response typeURL. */ - data: Uint8Array; + /** @deprecated */ + data?: string; /** 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: EventAmino[]; + events?: EventAmino[]; + /** + * msg_responses contains the Msg handler responses type packed in Anys. + * + * Since: cosmos-sdk 0.46 + */ + msg_responses?: AnyAmino[]; } export interface ResultAminoMsg { type: "cosmos-sdk/Result"; @@ -285,9 +304,11 @@ export interface ResultAminoMsg { } /** Result is the union of ResponseFormat and ResponseCheckTx. */ export interface ResultSDKType { + /** @deprecated */ data: Uint8Array; log: string; events: EventSDKType[]; + msg_responses: AnySDKType[]; } /** * SimulationResponse defines the response generated when a transaction is @@ -295,7 +316,7 @@ export interface ResultSDKType { */ export interface SimulationResponse { gasInfo: GasInfo; - result: Result; + result?: Result; } export interface SimulationResponseProtoMsg { typeUrl: "/cosmos.base.abci.v1beta1.SimulationResponse"; @@ -319,12 +340,13 @@ export interface SimulationResponseAminoMsg { */ export interface SimulationResponseSDKType { gas_info: GasInfoSDKType; - result: ResultSDKType; + result?: ResultSDKType; } /** * MsgData defines the data returned in a Result object during message * execution. */ +/** @deprecated */ export interface MsgData { msgType: string; data: Uint8Array; @@ -337,9 +359,10 @@ export interface MsgDataProtoMsg { * MsgData defines the data returned in a Result object during message * execution. */ +/** @deprecated */ export interface MsgDataAmino { - msg_type: string; - data: Uint8Array; + msg_type?: string; + data?: string; } export interface MsgDataAminoMsg { type: "cosmos-sdk/MsgData"; @@ -349,6 +372,7 @@ export interface MsgDataAminoMsg { * MsgData defines the data returned in a Result object during message * execution. */ +/** @deprecated */ export interface MsgDataSDKType { msg_type: string; data: Uint8Array; @@ -358,7 +382,15 @@ export interface MsgDataSDKType { * for each message. */ export interface TxMsgData { + /** data field is deprecated and not populated. */ + /** @deprecated */ data: MsgData[]; + /** + * msg_responses contains the Msg handler responses packed into Anys. + * + * Since: cosmos-sdk 0.46 + */ + msgResponses: Any[]; } export interface TxMsgDataProtoMsg { typeUrl: "/cosmos.base.abci.v1beta1.TxMsgData"; @@ -369,7 +401,15 @@ export interface TxMsgDataProtoMsg { * for each message. */ export interface TxMsgDataAmino { - data: MsgDataAmino[]; + /** data field is deprecated and not populated. */ + /** @deprecated */ + data?: MsgDataAmino[]; + /** + * msg_responses contains the Msg handler responses packed into Anys. + * + * Since: cosmos-sdk 0.46 + */ + msg_responses?: AnyAmino[]; } export interface TxMsgDataAminoMsg { type: "cosmos-sdk/TxMsgData"; @@ -380,7 +420,9 @@ export interface TxMsgDataAminoMsg { * for each message. */ export interface TxMsgDataSDKType { + /** @deprecated */ data: MsgDataSDKType[]; + msg_responses: AnySDKType[]; } /** SearchTxsResult defines a structure for querying txs pageable */ export interface SearchTxsResult { @@ -404,17 +446,17 @@ export interface SearchTxsResultProtoMsg { /** SearchTxsResult defines a structure for querying txs pageable */ export interface SearchTxsResultAmino { /** Count of all txs */ - total_count: string; + total_count?: string; /** Count of txs in current page */ - count: string; + count?: string; /** Index of current page, start from 1 */ - page_number: string; + page_number?: string; /** Count of total pages */ - page_total: string; + page_total?: string; /** Max count txs per page */ - limit: string; + limit?: string; /** List of txs in current page */ - txs: TxResponseAmino[]; + txs?: TxResponseAmino[]; } export interface SearchTxsResultAminoMsg { type: "cosmos-sdk/SearchTxsResult"; @@ -441,7 +483,7 @@ function createBaseTxResponse(): TxResponse { info: "", gasWanted: BigInt(0), gasUsed: BigInt(0), - tx: Any.fromPartial({}), + tx: undefined, timestamp: "", events: [] }; @@ -561,21 +603,43 @@ export const TxResponse = { return message; }, fromAmino(object: TxResponseAmino): TxResponse { - return { - height: BigInt(object.height), - txhash: object.txhash, - codespace: object.codespace, - code: object.code, - data: object.data, - rawLog: object.raw_log, - logs: Array.isArray(object?.logs) ? object.logs.map((e: any) => ABCIMessageLog.fromAmino(e)) : [], - info: object.info, - gasWanted: BigInt(object.gas_wanted), - gasUsed: BigInt(object.gas_used), - tx: object?.tx ? Any.fromAmino(object.tx) : undefined, - timestamp: object.timestamp, - events: Array.isArray(object?.events) ? object.events.map((e: any) => Event.fromAmino(e)) : [] - }; + const message = createBaseTxResponse(); + if (object.height !== undefined && object.height !== null) { + message.height = BigInt(object.height); + } + if (object.txhash !== undefined && object.txhash !== null) { + message.txhash = object.txhash; + } + if (object.codespace !== undefined && object.codespace !== null) { + message.codespace = object.codespace; + } + if (object.code !== undefined && object.code !== null) { + message.code = object.code; + } + if (object.data !== undefined && object.data !== null) { + message.data = object.data; + } + if (object.raw_log !== undefined && object.raw_log !== null) { + message.rawLog = object.raw_log; + } + message.logs = object.logs?.map(e => ABCIMessageLog.fromAmino(e)) || []; + if (object.info !== undefined && object.info !== null) { + message.info = object.info; + } + if (object.gas_wanted !== undefined && object.gas_wanted !== null) { + message.gasWanted = BigInt(object.gas_wanted); + } + if (object.gas_used !== undefined && object.gas_used !== null) { + message.gasUsed = BigInt(object.gas_used); + } + if (object.tx !== undefined && object.tx !== null) { + message.tx = Any.fromAmino(object.tx); + } + if (object.timestamp !== undefined && object.timestamp !== null) { + message.timestamp = object.timestamp; + } + message.events = object.events?.map(e => Event.fromAmino(e)) || []; + return message; }, toAmino(message: TxResponse): TxResponseAmino { const obj: any = {}; @@ -676,11 +740,15 @@ export const ABCIMessageLog = { return message; }, fromAmino(object: ABCIMessageLogAmino): ABCIMessageLog { - return { - msgIndex: object.msg_index, - log: object.log, - events: Array.isArray(object?.events) ? object.events.map((e: any) => StringEvent.fromAmino(e)) : [] - }; + const message = createBaseABCIMessageLog(); + if (object.msg_index !== undefined && object.msg_index !== null) { + message.msgIndex = object.msg_index; + } + if (object.log !== undefined && object.log !== null) { + message.log = object.log; + } + message.events = object.events?.map(e => StringEvent.fromAmino(e)) || []; + return message; }, toAmino(message: ABCIMessageLog): ABCIMessageLogAmino { const obj: any = {}; @@ -759,10 +827,12 @@ export const StringEvent = { return message; }, fromAmino(object: StringEventAmino): StringEvent { - return { - type: object.type, - attributes: Array.isArray(object?.attributes) ? object.attributes.map((e: any) => Attribute.fromAmino(e)) : [] - }; + const message = createBaseStringEvent(); + if (object.type !== undefined && object.type !== null) { + message.type = object.type; + } + message.attributes = object.attributes?.map(e => Attribute.fromAmino(e)) || []; + return message; }, toAmino(message: StringEvent): StringEventAmino { const obj: any = {}; @@ -840,10 +910,14 @@ export const Attribute = { return message; }, fromAmino(object: AttributeAmino): Attribute { - return { - key: object.key, - value: object.value - }; + const message = createBaseAttribute(); + if (object.key !== undefined && object.key !== null) { + message.key = object.key; + } + if (object.value !== undefined && object.value !== null) { + message.value = object.value; + } + return message; }, toAmino(message: Attribute): AttributeAmino { const obj: any = {}; @@ -917,10 +991,14 @@ export const GasInfo = { return message; }, fromAmino(object: GasInfoAmino): GasInfo { - return { - gasWanted: BigInt(object.gas_wanted), - gasUsed: BigInt(object.gas_used) - }; + const message = createBaseGasInfo(); + if (object.gas_wanted !== undefined && object.gas_wanted !== null) { + message.gasWanted = BigInt(object.gas_wanted); + } + if (object.gas_used !== undefined && object.gas_used !== null) { + message.gasUsed = BigInt(object.gas_used); + } + return message; }, toAmino(message: GasInfo): GasInfoAmino { const obj: any = {}; @@ -954,7 +1032,8 @@ function createBaseResult(): Result { return { data: new Uint8Array(), log: "", - events: [] + events: [], + msgResponses: [] }; } export const Result = { @@ -969,6 +1048,9 @@ export const Result = { for (const v of message.events) { Event.encode(v!, writer.uint32(26).fork()).ldelim(); } + for (const v of message.msgResponses) { + Any.encode(v!, writer.uint32(34).fork()).ldelim(); + } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): Result { @@ -987,6 +1069,9 @@ export const Result = { case 3: message.events.push(Event.decode(reader, reader.uint32())); break; + case 4: + message.msgResponses.push(Any.decode(reader, reader.uint32())); + break; default: reader.skipType(tag & 7); break; @@ -999,24 +1084,35 @@ export const Result = { message.data = object.data ?? new Uint8Array(); message.log = object.log ?? ""; message.events = object.events?.map(e => Event.fromPartial(e)) || []; + message.msgResponses = object.msgResponses?.map(e => Any.fromPartial(e)) || []; return message; }, fromAmino(object: ResultAmino): Result { - return { - data: object.data, - log: object.log, - events: Array.isArray(object?.events) ? object.events.map((e: any) => Event.fromAmino(e)) : [] - }; + const message = createBaseResult(); + if (object.data !== undefined && object.data !== null) { + message.data = bytesFromBase64(object.data); + } + if (object.log !== undefined && object.log !== null) { + message.log = object.log; + } + message.events = object.events?.map(e => Event.fromAmino(e)) || []; + message.msgResponses = object.msg_responses?.map(e => Any.fromAmino(e)) || []; + return message; }, toAmino(message: Result): ResultAmino { const obj: any = {}; - obj.data = message.data; + obj.data = message.data ? base64FromBytes(message.data) : undefined; obj.log = message.log; if (message.events) { obj.events = message.events.map(e => e ? Event.toAmino(e) : undefined); } else { obj.events = []; } + if (message.msgResponses) { + obj.msg_responses = message.msgResponses.map(e => e ? Any.toAmino(e) : undefined); + } else { + obj.msg_responses = []; + } return obj; }, fromAminoMsg(object: ResultAminoMsg): Result { @@ -1044,7 +1140,7 @@ export const Result = { function createBaseSimulationResponse(): SimulationResponse { return { gasInfo: GasInfo.fromPartial({}), - result: Result.fromPartial({}) + result: undefined }; } export const SimulationResponse = { @@ -1085,10 +1181,14 @@ export const SimulationResponse = { return message; }, fromAmino(object: SimulationResponseAmino): SimulationResponse { - return { - gasInfo: object?.gas_info ? GasInfo.fromAmino(object.gas_info) : undefined, - result: object?.result ? Result.fromAmino(object.result) : undefined - }; + const message = createBaseSimulationResponse(); + if (object.gas_info !== undefined && object.gas_info !== null) { + message.gasInfo = GasInfo.fromAmino(object.gas_info); + } + if (object.result !== undefined && object.result !== null) { + message.result = Result.fromAmino(object.result); + } + return message; }, toAmino(message: SimulationResponse): SimulationResponseAmino { const obj: any = {}; @@ -1162,15 +1262,19 @@ export const MsgData = { return message; }, fromAmino(object: MsgDataAmino): MsgData { - return { - msgType: object.msg_type, - data: object.data - }; + const message = createBaseMsgData(); + if (object.msg_type !== undefined && object.msg_type !== null) { + message.msgType = object.msg_type; + } + if (object.data !== undefined && object.data !== null) { + message.data = bytesFromBase64(object.data); + } + return message; }, toAmino(message: MsgData): MsgDataAmino { const obj: any = {}; obj.msg_type = message.msgType; - obj.data = message.data; + obj.data = message.data ? base64FromBytes(message.data) : undefined; return obj; }, fromAminoMsg(object: MsgDataAminoMsg): MsgData { @@ -1197,7 +1301,8 @@ export const MsgData = { }; function createBaseTxMsgData(): TxMsgData { return { - data: [] + data: [], + msgResponses: [] }; } export const TxMsgData = { @@ -1206,6 +1311,9 @@ export const TxMsgData = { for (const v of message.data) { MsgData.encode(v!, writer.uint32(10).fork()).ldelim(); } + for (const v of message.msgResponses) { + Any.encode(v!, writer.uint32(18).fork()).ldelim(); + } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): TxMsgData { @@ -1218,6 +1326,9 @@ export const TxMsgData = { case 1: message.data.push(MsgData.decode(reader, reader.uint32())); break; + case 2: + message.msgResponses.push(Any.decode(reader, reader.uint32())); + break; default: reader.skipType(tag & 7); break; @@ -1228,12 +1339,14 @@ export const TxMsgData = { fromPartial(object: Partial): TxMsgData { const message = createBaseTxMsgData(); message.data = object.data?.map(e => MsgData.fromPartial(e)) || []; + message.msgResponses = object.msgResponses?.map(e => Any.fromPartial(e)) || []; return message; }, fromAmino(object: TxMsgDataAmino): TxMsgData { - return { - data: Array.isArray(object?.data) ? object.data.map((e: any) => MsgData.fromAmino(e)) : [] - }; + const message = createBaseTxMsgData(); + message.data = object.data?.map(e => MsgData.fromAmino(e)) || []; + message.msgResponses = object.msg_responses?.map(e => Any.fromAmino(e)) || []; + return message; }, toAmino(message: TxMsgData): TxMsgDataAmino { const obj: any = {}; @@ -1242,6 +1355,11 @@ export const TxMsgData = { } else { obj.data = []; } + if (message.msgResponses) { + obj.msg_responses = message.msgResponses.map(e => e ? Any.toAmino(e) : undefined); + } else { + obj.msg_responses = []; + } return obj; }, fromAminoMsg(object: TxMsgDataAminoMsg): TxMsgData { @@ -1342,14 +1460,24 @@ export const SearchTxsResult = { return message; }, fromAmino(object: SearchTxsResultAmino): SearchTxsResult { - return { - totalCount: BigInt(object.total_count), - count: BigInt(object.count), - pageNumber: BigInt(object.page_number), - pageTotal: BigInt(object.page_total), - limit: BigInt(object.limit), - txs: Array.isArray(object?.txs) ? object.txs.map((e: any) => TxResponse.fromAmino(e)) : [] - }; + const message = createBaseSearchTxsResult(); + if (object.total_count !== undefined && object.total_count !== null) { + message.totalCount = BigInt(object.total_count); + } + if (object.count !== undefined && object.count !== null) { + message.count = BigInt(object.count); + } + if (object.page_number !== undefined && object.page_number !== null) { + message.pageNumber = BigInt(object.page_number); + } + if (object.page_total !== undefined && object.page_total !== null) { + message.pageTotal = BigInt(object.page_total); + } + if (object.limit !== undefined && object.limit !== null) { + message.limit = BigInt(object.limit); + } + message.txs = object.txs?.map(e => TxResponse.fromAmino(e)) || []; + return message; }, toAmino(message: SearchTxsResult): SearchTxsResultAmino { const obj: any = {}; diff --git a/packages/osmo-query/src/codegen/cosmos/base/node/v1beta1/query.ts b/packages/osmo-query/src/codegen/cosmos/base/node/v1beta1/query.ts index c2c12f623..b57cb1375 100644 --- a/packages/osmo-query/src/codegen/cosmos/base/node/v1beta1/query.ts +++ b/packages/osmo-query/src/codegen/cosmos/base/node/v1beta1/query.ts @@ -23,7 +23,7 @@ export interface ConfigResponseProtoMsg { } /** ConfigResponse defines the response structure for the Config gRPC query. */ export interface ConfigResponseAmino { - minimum_gas_price: string; + minimum_gas_price?: string; } export interface ConfigResponseAminoMsg { type: "cosmos-sdk/ConfigResponse"; @@ -60,7 +60,8 @@ export const ConfigRequest = { return message; }, fromAmino(_: ConfigRequestAmino): ConfigRequest { - return {}; + const message = createBaseConfigRequest(); + return message; }, toAmino(_: ConfigRequest): ConfigRequestAmino { const obj: any = {}; @@ -124,9 +125,11 @@ export const ConfigResponse = { return message; }, fromAmino(object: ConfigResponseAmino): ConfigResponse { - return { - minimumGasPrice: object.minimum_gas_price - }; + const message = createBaseConfigResponse(); + if (object.minimum_gas_price !== undefined && object.minimum_gas_price !== null) { + message.minimumGasPrice = object.minimum_gas_price; + } + return message; }, toAmino(message: ConfigResponse): ConfigResponseAmino { const obj: any = {}; diff --git a/packages/osmo-query/src/codegen/cosmos/base/query/v1beta1/pagination.ts b/packages/osmo-query/src/codegen/cosmos/base/query/v1beta1/pagination.ts index e3f81da30..da442ae1c 100644 --- a/packages/osmo-query/src/codegen/cosmos/base/query/v1beta1/pagination.ts +++ b/packages/osmo-query/src/codegen/cosmos/base/query/v1beta1/pagination.ts @@ -1,4 +1,5 @@ import { BinaryReader, BinaryWriter } from "../../../../binary"; +import { bytesFromBase64, base64FromBytes } from "../../../../helpers"; /** * PageRequest is to be embedded in gRPC request messages for efficient * pagination. Ex: @@ -59,31 +60,31 @@ export interface PageRequestAmino { * querying the next page most efficiently. Only one of offset or key * should be set. */ - key: Uint8Array; + key?: string; /** * 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: string; + offset?: string; /** * 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: string; + limit?: string; /** * 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. */ - count_total: boolean; + count_total?: 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; } export interface PageRequestAminoMsg { type: "cosmos-sdk/PageRequest"; @@ -117,7 +118,8 @@ export interface PageRequestSDKType { export interface PageResponse { /** * next_key is the key to be passed to PageRequest.key to - * query the next page most efficiently + * query the next page most efficiently. It will be empty if + * there are no more results. */ nextKey: Uint8Array; /** @@ -142,14 +144,15 @@ export interface PageResponseProtoMsg { export interface PageResponseAmino { /** * next_key is the key to be passed to PageRequest.key to - * query the next page most efficiently + * query the next page most efficiently. It will be empty if + * there are no more results. */ - next_key: Uint8Array; + next_key?: string; /** * total is total number of results available if PageRequest.count_total * was set, its value is undefined otherwise */ - total: string; + total?: string; } export interface PageResponseAminoMsg { type: "cosmos-sdk/PageResponse"; @@ -236,17 +239,27 @@ export const PageRequest = { return message; }, fromAmino(object: PageRequestAmino): PageRequest { - return { - key: object.key, - offset: BigInt(object.offset), - limit: BigInt(object.limit), - countTotal: object.count_total, - reverse: object.reverse - }; + const message = createBasePageRequest(); + if (object.key !== undefined && object.key !== null) { + message.key = bytesFromBase64(object.key); + } + if (object.offset !== undefined && object.offset !== null) { + message.offset = BigInt(object.offset); + } + if (object.limit !== undefined && object.limit !== null) { + message.limit = BigInt(object.limit); + } + if (object.count_total !== undefined && object.count_total !== null) { + message.countTotal = object.count_total; + } + if (object.reverse !== undefined && object.reverse !== null) { + message.reverse = object.reverse; + } + return message; }, toAmino(message: PageRequest): PageRequestAmino { const obj: any = {}; - obj.key = message.key; + obj.key = message.key ? base64FromBytes(message.key) : undefined; obj.offset = message.offset ? message.offset.toString() : undefined; obj.limit = message.limit ? message.limit.toString() : undefined; obj.count_total = message.countTotal; @@ -319,14 +332,18 @@ export const PageResponse = { return message; }, fromAmino(object: PageResponseAmino): PageResponse { - return { - nextKey: object.next_key, - total: BigInt(object.total) - }; + const message = createBasePageResponse(); + if (object.next_key !== undefined && object.next_key !== null) { + message.nextKey = bytesFromBase64(object.next_key); + } + if (object.total !== undefined && object.total !== null) { + message.total = BigInt(object.total); + } + return message; }, toAmino(message: PageResponse): PageResponseAmino { const obj: any = {}; - obj.next_key = message.nextKey; + obj.next_key = message.nextKey ? base64FromBytes(message.nextKey) : undefined; obj.total = message.total ? message.total.toString() : undefined; return obj; }, diff --git a/packages/osmo-query/src/codegen/cosmos/base/reflection/v2alpha1/reflection.ts b/packages/osmo-query/src/codegen/cosmos/base/reflection/v2alpha1/reflection.ts index e53daa0de..5437561e4 100644 --- a/packages/osmo-query/src/codegen/cosmos/base/reflection/v2alpha1/reflection.ts +++ b/packages/osmo-query/src/codegen/cosmos/base/reflection/v2alpha1/reflection.ts @@ -5,17 +5,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; } export interface AppDescriptorProtoMsg { typeUrl: "/cosmos.base.reflection.v2alpha1.AppDescriptor"; @@ -45,12 +45,12 @@ export interface AppDescriptorAminoMsg { } /** AppDescriptor describes a cosmos-sdk based application */ export interface AppDescriptorSDKType { - authn: AuthnDescriptorSDKType; - chain: ChainDescriptorSDKType; - codec: CodecDescriptorSDKType; - configuration: ConfigurationDescriptorSDKType; - query_services: QueryServicesDescriptorSDKType; - tx: TxDescriptorSDKType; + authn?: AuthnDescriptorSDKType; + chain?: ChainDescriptorSDKType; + codec?: CodecDescriptorSDKType; + configuration?: ConfigurationDescriptorSDKType; + query_services?: QueryServicesDescriptorSDKType; + tx?: TxDescriptorSDKType; } /** TxDescriptor describes the accepted transaction type */ export interface TxDescriptor { @@ -74,9 +74,9 @@ export interface TxDescriptorAmino { * 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: MsgDescriptorAmino[]; + msgs?: MsgDescriptorAmino[]; } export interface TxDescriptorAminoMsg { type: "cosmos-sdk/TxDescriptor"; @@ -105,7 +105,7 @@ export interface AuthnDescriptorProtoMsg { */ export interface AuthnDescriptorAmino { /** sign_modes defines the supported signature algorithm */ - sign_modes: SigningModeDescriptorAmino[]; + sign_modes?: SigningModeDescriptorAmino[]; } export interface AuthnDescriptorAminoMsg { type: "cosmos-sdk/AuthnDescriptor"; @@ -147,14 +147,14 @@ export interface SigningModeDescriptorProtoMsg { */ export interface SigningModeDescriptorAmino { /** 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 */ - authn_info_provider_method_fullname: string; + authn_info_provider_method_fullname?: string; } export interface SigningModeDescriptorAminoMsg { type: "cosmos-sdk/SigningModeDescriptor"; @@ -183,7 +183,7 @@ export interface ChainDescriptorProtoMsg { /** ChainDescriptor describes chain information of the application */ export interface ChainDescriptorAmino { /** id is the chain id */ - id: string; + id?: string; } export interface ChainDescriptorAminoMsg { type: "cosmos-sdk/ChainDescriptor"; @@ -205,7 +205,7 @@ export interface CodecDescriptorProtoMsg { /** CodecDescriptor describes the registered interfaces and provides metadata information on the types */ export interface CodecDescriptorAmino { /** interfaces is a list of the registerted interfaces descriptors */ - interfaces: InterfaceDescriptorAmino[]; + interfaces?: InterfaceDescriptorAmino[]; } export interface CodecDescriptorAminoMsg { type: "cosmos-sdk/CodecDescriptor"; @@ -234,14 +234,14 @@ export interface InterfaceDescriptorProtoMsg { /** InterfaceDescriptor describes the implementation of an interface */ export interface InterfaceDescriptorAmino { /** 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 */ - interface_accepting_messages: InterfaceAcceptingMessageDescriptorAmino[]; + interface_accepting_messages?: InterfaceAcceptingMessageDescriptorAmino[]; /** interface_implementers is a list of the descriptors of the interface implementers */ - interface_implementers: InterfaceImplementerDescriptorAmino[]; + interface_implementers?: InterfaceImplementerDescriptorAmino[]; } export interface InterfaceDescriptorAminoMsg { type: "cosmos-sdk/InterfaceDescriptor"; @@ -272,14 +272,14 @@ export interface InterfaceImplementerDescriptorProtoMsg { /** InterfaceImplementerDescriptor describes an interface implementer */ export interface InterfaceImplementerDescriptorAmino { /** 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 */ - type_url: string; + type_url?: string; } export interface InterfaceImplementerDescriptorAminoMsg { type: "cosmos-sdk/InterfaceImplementerDescriptor"; @@ -314,13 +314,13 @@ export interface InterfaceAcceptingMessageDescriptorProtoMsg { */ export interface InterfaceAcceptingMessageDescriptorAmino { /** 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) */ - field_descriptor_names: string[]; + field_descriptor_names?: string[]; } export interface InterfaceAcceptingMessageDescriptorAminoMsg { type: "cosmos-sdk/InterfaceAcceptingMessageDescriptor"; @@ -346,7 +346,7 @@ export interface ConfigurationDescriptorProtoMsg { /** ConfigurationDescriptor contains metadata information on the sdk.Config */ export interface ConfigurationDescriptorAmino { /** bech32_account_address_prefix is the account address prefix */ - bech32_account_address_prefix: string; + bech32_account_address_prefix?: string; } export interface ConfigurationDescriptorAminoMsg { type: "cosmos-sdk/ConfigurationDescriptor"; @@ -368,7 +368,7 @@ export interface MsgDescriptorProtoMsg { /** MsgDescriptor describes a cosmos-sdk message that can be delivered with a transaction */ export interface MsgDescriptorAmino { /** msg_type_url contains the TypeURL of a sdk.Msg. */ - msg_type_url: string; + msg_type_url?: string; } export interface MsgDescriptorAminoMsg { type: "cosmos-sdk/MsgDescriptor"; @@ -395,7 +395,7 @@ export interface GetAuthnDescriptorRequestSDKType {} /** 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; } export interface GetAuthnDescriptorResponseProtoMsg { typeUrl: "/cosmos.base.reflection.v2alpha1.GetAuthnDescriptorResponse"; @@ -412,7 +412,7 @@ export interface GetAuthnDescriptorResponseAminoMsg { } /** GetAuthnDescriptorResponse is the response returned by the GetAuthnDescriptor RPC */ export interface GetAuthnDescriptorResponseSDKType { - authn: AuthnDescriptorSDKType; + authn?: AuthnDescriptorSDKType; } /** GetChainDescriptorRequest is the request used for the GetChainDescriptor RPC */ export interface GetChainDescriptorRequest {} @@ -431,7 +431,7 @@ export interface GetChainDescriptorRequestSDKType {} /** GetChainDescriptorResponse is the response returned by the GetChainDescriptor RPC */ export interface GetChainDescriptorResponse { /** chain describes application chain information */ - chain: ChainDescriptor; + chain?: ChainDescriptor; } export interface GetChainDescriptorResponseProtoMsg { typeUrl: "/cosmos.base.reflection.v2alpha1.GetChainDescriptorResponse"; @@ -448,7 +448,7 @@ export interface GetChainDescriptorResponseAminoMsg { } /** GetChainDescriptorResponse is the response returned by the GetChainDescriptor RPC */ export interface GetChainDescriptorResponseSDKType { - chain: ChainDescriptorSDKType; + chain?: ChainDescriptorSDKType; } /** GetCodecDescriptorRequest is the request used for the GetCodecDescriptor RPC */ export interface GetCodecDescriptorRequest {} @@ -467,7 +467,7 @@ export interface GetCodecDescriptorRequestSDKType {} /** 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; } export interface GetCodecDescriptorResponseProtoMsg { typeUrl: "/cosmos.base.reflection.v2alpha1.GetCodecDescriptorResponse"; @@ -484,7 +484,7 @@ export interface GetCodecDescriptorResponseAminoMsg { } /** GetCodecDescriptorResponse is the response returned by the GetCodecDescriptor RPC */ export interface GetCodecDescriptorResponseSDKType { - codec: CodecDescriptorSDKType; + codec?: CodecDescriptorSDKType; } /** GetConfigurationDescriptorRequest is the request used for the GetConfigurationDescriptor RPC */ export interface GetConfigurationDescriptorRequest {} @@ -503,7 +503,7 @@ export interface GetConfigurationDescriptorRequestSDKType {} /** GetConfigurationDescriptorResponse is the response returned by the GetConfigurationDescriptor RPC */ export interface GetConfigurationDescriptorResponse { /** config describes the application's sdk.Config */ - config: ConfigurationDescriptor; + config?: ConfigurationDescriptor; } export interface GetConfigurationDescriptorResponseProtoMsg { typeUrl: "/cosmos.base.reflection.v2alpha1.GetConfigurationDescriptorResponse"; @@ -520,7 +520,7 @@ export interface GetConfigurationDescriptorResponseAminoMsg { } /** GetConfigurationDescriptorResponse is the response returned by the GetConfigurationDescriptor RPC */ export interface GetConfigurationDescriptorResponseSDKType { - config: ConfigurationDescriptorSDKType; + config?: ConfigurationDescriptorSDKType; } /** GetQueryServicesDescriptorRequest is the request used for the GetQueryServicesDescriptor RPC */ export interface GetQueryServicesDescriptorRequest {} @@ -539,7 +539,7 @@ export interface GetQueryServicesDescriptorRequestSDKType {} /** GetQueryServicesDescriptorResponse is the response returned by the GetQueryServicesDescriptor RPC */ export interface GetQueryServicesDescriptorResponse { /** queries provides information on the available queryable services */ - queries: QueryServicesDescriptor; + queries?: QueryServicesDescriptor; } export interface GetQueryServicesDescriptorResponseProtoMsg { typeUrl: "/cosmos.base.reflection.v2alpha1.GetQueryServicesDescriptorResponse"; @@ -556,7 +556,7 @@ export interface GetQueryServicesDescriptorResponseAminoMsg { } /** GetQueryServicesDescriptorResponse is the response returned by the GetQueryServicesDescriptor RPC */ export interface GetQueryServicesDescriptorResponseSDKType { - queries: QueryServicesDescriptorSDKType; + queries?: QueryServicesDescriptorSDKType; } /** GetTxDescriptorRequest is the request used for the GetTxDescriptor RPC */ export interface GetTxDescriptorRequest {} @@ -578,7 +578,7 @@ 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; } export interface GetTxDescriptorResponseProtoMsg { typeUrl: "/cosmos.base.reflection.v2alpha1.GetTxDescriptorResponse"; @@ -598,7 +598,7 @@ export interface GetTxDescriptorResponseAminoMsg { } /** GetTxDescriptorResponse is the response returned by the GetTxDescriptor RPC */ export interface GetTxDescriptorResponseSDKType { - tx: TxDescriptorSDKType; + tx?: TxDescriptorSDKType; } /** QueryServicesDescriptor contains the list of cosmos-sdk queriable services */ export interface QueryServicesDescriptor { @@ -612,7 +612,7 @@ export interface QueryServicesDescriptorProtoMsg { /** QueryServicesDescriptor contains the list of cosmos-sdk queriable services */ export interface QueryServicesDescriptorAmino { /** query_services is a list of cosmos-sdk QueryServiceDescriptor */ - query_services: QueryServiceDescriptorAmino[]; + query_services?: QueryServiceDescriptorAmino[]; } export interface QueryServicesDescriptorAminoMsg { type: "cosmos-sdk/QueryServicesDescriptor"; @@ -638,11 +638,11 @@ export interface QueryServiceDescriptorProtoMsg { /** QueryServiceDescriptor describes a cosmos-sdk queryable service */ export interface QueryServiceDescriptorAmino { /** 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 */ - is_module: boolean; + is_module?: boolean; /** methods provides a list of query service methods */ - methods: QueryMethodDescriptorAmino[]; + methods?: QueryMethodDescriptorAmino[]; } export interface QueryServiceDescriptorAminoMsg { type: "cosmos-sdk/QueryServiceDescriptor"; @@ -679,12 +679,12 @@ export interface QueryMethodDescriptorProtoMsg { */ export interface QueryMethodDescriptorAmino { /** 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 */ - full_query_path: string; + full_query_path?: string; } export interface QueryMethodDescriptorAminoMsg { type: "cosmos-sdk/QueryMethodDescriptor"; @@ -701,12 +701,12 @@ export interface QueryMethodDescriptorSDKType { } function createBaseAppDescriptor(): AppDescriptor { return { - authn: AuthnDescriptor.fromPartial({}), - chain: ChainDescriptor.fromPartial({}), - codec: CodecDescriptor.fromPartial({}), - configuration: ConfigurationDescriptor.fromPartial({}), - queryServices: QueryServicesDescriptor.fromPartial({}), - tx: TxDescriptor.fromPartial({}) + authn: undefined, + chain: undefined, + codec: undefined, + configuration: undefined, + queryServices: undefined, + tx: undefined }; } export const AppDescriptor = { @@ -775,14 +775,26 @@ export const AppDescriptor = { return message; }, fromAmino(object: AppDescriptorAmino): AppDescriptor { - return { - authn: object?.authn ? AuthnDescriptor.fromAmino(object.authn) : undefined, - chain: object?.chain ? ChainDescriptor.fromAmino(object.chain) : undefined, - codec: object?.codec ? CodecDescriptor.fromAmino(object.codec) : undefined, - configuration: object?.configuration ? ConfigurationDescriptor.fromAmino(object.configuration) : undefined, - queryServices: object?.query_services ? QueryServicesDescriptor.fromAmino(object.query_services) : undefined, - tx: object?.tx ? TxDescriptor.fromAmino(object.tx) : undefined - }; + const message = createBaseAppDescriptor(); + if (object.authn !== undefined && object.authn !== null) { + message.authn = AuthnDescriptor.fromAmino(object.authn); + } + if (object.chain !== undefined && object.chain !== null) { + message.chain = ChainDescriptor.fromAmino(object.chain); + } + if (object.codec !== undefined && object.codec !== null) { + message.codec = CodecDescriptor.fromAmino(object.codec); + } + if (object.configuration !== undefined && object.configuration !== null) { + message.configuration = ConfigurationDescriptor.fromAmino(object.configuration); + } + if (object.query_services !== undefined && object.query_services !== null) { + message.queryServices = QueryServicesDescriptor.fromAmino(object.query_services); + } + if (object.tx !== undefined && object.tx !== null) { + message.tx = TxDescriptor.fromAmino(object.tx); + } + return message; }, toAmino(message: AppDescriptor): AppDescriptorAmino { const obj: any = {}; @@ -860,10 +872,12 @@ export const TxDescriptor = { return message; }, fromAmino(object: TxDescriptorAmino): TxDescriptor { - return { - fullname: object.fullname, - msgs: Array.isArray(object?.msgs) ? object.msgs.map((e: any) => MsgDescriptor.fromAmino(e)) : [] - }; + const message = createBaseTxDescriptor(); + if (object.fullname !== undefined && object.fullname !== null) { + message.fullname = object.fullname; + } + message.msgs = object.msgs?.map(e => MsgDescriptor.fromAmino(e)) || []; + return message; }, toAmino(message: TxDescriptor): TxDescriptorAmino { const obj: any = {}; @@ -933,9 +947,9 @@ export const AuthnDescriptor = { return message; }, fromAmino(object: AuthnDescriptorAmino): AuthnDescriptor { - return { - signModes: Array.isArray(object?.sign_modes) ? object.sign_modes.map((e: any) => SigningModeDescriptor.fromAmino(e)) : [] - }; + const message = createBaseAuthnDescriptor(); + message.signModes = object.sign_modes?.map(e => SigningModeDescriptor.fromAmino(e)) || []; + return message; }, toAmino(message: AuthnDescriptor): AuthnDescriptorAmino { const obj: any = {}; @@ -1020,11 +1034,17 @@ export const SigningModeDescriptor = { return message; }, fromAmino(object: SigningModeDescriptorAmino): SigningModeDescriptor { - return { - name: object.name, - number: object.number, - authnInfoProviderMethodFullname: object.authn_info_provider_method_fullname - }; + const message = createBaseSigningModeDescriptor(); + if (object.name !== undefined && object.name !== null) { + message.name = object.name; + } + if (object.number !== undefined && object.number !== null) { + message.number = object.number; + } + if (object.authn_info_provider_method_fullname !== undefined && object.authn_info_provider_method_fullname !== null) { + message.authnInfoProviderMethodFullname = object.authn_info_provider_method_fullname; + } + return message; }, toAmino(message: SigningModeDescriptor): SigningModeDescriptorAmino { const obj: any = {}; @@ -1091,9 +1111,11 @@ export const ChainDescriptor = { return message; }, fromAmino(object: ChainDescriptorAmino): ChainDescriptor { - return { - id: object.id - }; + const message = createBaseChainDescriptor(); + if (object.id !== undefined && object.id !== null) { + message.id = object.id; + } + return message; }, toAmino(message: ChainDescriptor): ChainDescriptorAmino { const obj: any = {}; @@ -1158,9 +1180,9 @@ export const CodecDescriptor = { return message; }, fromAmino(object: CodecDescriptorAmino): CodecDescriptor { - return { - interfaces: Array.isArray(object?.interfaces) ? object.interfaces.map((e: any) => InterfaceDescriptor.fromAmino(e)) : [] - }; + const message = createBaseCodecDescriptor(); + message.interfaces = object.interfaces?.map(e => InterfaceDescriptor.fromAmino(e)) || []; + return message; }, toAmino(message: CodecDescriptor): CodecDescriptorAmino { const obj: any = {}; @@ -1245,11 +1267,13 @@ export const InterfaceDescriptor = { return message; }, fromAmino(object: InterfaceDescriptorAmino): InterfaceDescriptor { - return { - fullname: object.fullname, - interfaceAcceptingMessages: Array.isArray(object?.interface_accepting_messages) ? object.interface_accepting_messages.map((e: any) => InterfaceAcceptingMessageDescriptor.fromAmino(e)) : [], - interfaceImplementers: Array.isArray(object?.interface_implementers) ? object.interface_implementers.map((e: any) => InterfaceImplementerDescriptor.fromAmino(e)) : [] - }; + const message = createBaseInterfaceDescriptor(); + if (object.fullname !== undefined && object.fullname !== null) { + message.fullname = object.fullname; + } + message.interfaceAcceptingMessages = object.interface_accepting_messages?.map(e => InterfaceAcceptingMessageDescriptor.fromAmino(e)) || []; + message.interfaceImplementers = object.interface_implementers?.map(e => InterfaceImplementerDescriptor.fromAmino(e)) || []; + return message; }, toAmino(message: InterfaceDescriptor): InterfaceDescriptorAmino { const obj: any = {}; @@ -1332,10 +1356,14 @@ export const InterfaceImplementerDescriptor = { return message; }, fromAmino(object: InterfaceImplementerDescriptorAmino): InterfaceImplementerDescriptor { - return { - fullname: object.fullname, - typeUrl: object.type_url - }; + const message = createBaseInterfaceImplementerDescriptor(); + if (object.fullname !== undefined && object.fullname !== null) { + message.fullname = object.fullname; + } + if (object.type_url !== undefined && object.type_url !== null) { + message.typeUrl = object.type_url; + } + return message; }, toAmino(message: InterfaceImplementerDescriptor): InterfaceImplementerDescriptorAmino { const obj: any = {}; @@ -1409,10 +1437,12 @@ export const InterfaceAcceptingMessageDescriptor = { return message; }, fromAmino(object: InterfaceAcceptingMessageDescriptorAmino): InterfaceAcceptingMessageDescriptor { - return { - fullname: object.fullname, - fieldDescriptorNames: Array.isArray(object?.field_descriptor_names) ? object.field_descriptor_names.map((e: any) => e) : [] - }; + const message = createBaseInterfaceAcceptingMessageDescriptor(); + if (object.fullname !== undefined && object.fullname !== null) { + message.fullname = object.fullname; + } + message.fieldDescriptorNames = object.field_descriptor_names?.map(e => e) || []; + return message; }, toAmino(message: InterfaceAcceptingMessageDescriptor): InterfaceAcceptingMessageDescriptorAmino { const obj: any = {}; @@ -1482,9 +1512,11 @@ export const ConfigurationDescriptor = { return message; }, fromAmino(object: ConfigurationDescriptorAmino): ConfigurationDescriptor { - return { - bech32AccountAddressPrefix: object.bech32_account_address_prefix - }; + const message = createBaseConfigurationDescriptor(); + if (object.bech32_account_address_prefix !== undefined && object.bech32_account_address_prefix !== null) { + message.bech32AccountAddressPrefix = object.bech32_account_address_prefix; + } + return message; }, toAmino(message: ConfigurationDescriptor): ConfigurationDescriptorAmino { const obj: any = {}; @@ -1549,9 +1581,11 @@ export const MsgDescriptor = { return message; }, fromAmino(object: MsgDescriptorAmino): MsgDescriptor { - return { - msgTypeUrl: object.msg_type_url - }; + const message = createBaseMsgDescriptor(); + if (object.msg_type_url !== undefined && object.msg_type_url !== null) { + message.msgTypeUrl = object.msg_type_url; + } + return message; }, toAmino(message: MsgDescriptor): MsgDescriptorAmino { const obj: any = {}; @@ -1607,7 +1641,8 @@ export const GetAuthnDescriptorRequest = { return message; }, fromAmino(_: GetAuthnDescriptorRequestAmino): GetAuthnDescriptorRequest { - return {}; + const message = createBaseGetAuthnDescriptorRequest(); + return message; }, toAmino(_: GetAuthnDescriptorRequest): GetAuthnDescriptorRequestAmino { const obj: any = {}; @@ -1637,7 +1672,7 @@ export const GetAuthnDescriptorRequest = { }; function createBaseGetAuthnDescriptorResponse(): GetAuthnDescriptorResponse { return { - authn: AuthnDescriptor.fromPartial({}) + authn: undefined }; } export const GetAuthnDescriptorResponse = { @@ -1671,9 +1706,11 @@ export const GetAuthnDescriptorResponse = { return message; }, fromAmino(object: GetAuthnDescriptorResponseAmino): GetAuthnDescriptorResponse { - return { - authn: object?.authn ? AuthnDescriptor.fromAmino(object.authn) : undefined - }; + const message = createBaseGetAuthnDescriptorResponse(); + if (object.authn !== undefined && object.authn !== null) { + message.authn = AuthnDescriptor.fromAmino(object.authn); + } + return message; }, toAmino(message: GetAuthnDescriptorResponse): GetAuthnDescriptorResponseAmino { const obj: any = {}; @@ -1729,7 +1766,8 @@ export const GetChainDescriptorRequest = { return message; }, fromAmino(_: GetChainDescriptorRequestAmino): GetChainDescriptorRequest { - return {}; + const message = createBaseGetChainDescriptorRequest(); + return message; }, toAmino(_: GetChainDescriptorRequest): GetChainDescriptorRequestAmino { const obj: any = {}; @@ -1759,7 +1797,7 @@ export const GetChainDescriptorRequest = { }; function createBaseGetChainDescriptorResponse(): GetChainDescriptorResponse { return { - chain: ChainDescriptor.fromPartial({}) + chain: undefined }; } export const GetChainDescriptorResponse = { @@ -1793,9 +1831,11 @@ export const GetChainDescriptorResponse = { return message; }, fromAmino(object: GetChainDescriptorResponseAmino): GetChainDescriptorResponse { - return { - chain: object?.chain ? ChainDescriptor.fromAmino(object.chain) : undefined - }; + const message = createBaseGetChainDescriptorResponse(); + if (object.chain !== undefined && object.chain !== null) { + message.chain = ChainDescriptor.fromAmino(object.chain); + } + return message; }, toAmino(message: GetChainDescriptorResponse): GetChainDescriptorResponseAmino { const obj: any = {}; @@ -1851,7 +1891,8 @@ export const GetCodecDescriptorRequest = { return message; }, fromAmino(_: GetCodecDescriptorRequestAmino): GetCodecDescriptorRequest { - return {}; + const message = createBaseGetCodecDescriptorRequest(); + return message; }, toAmino(_: GetCodecDescriptorRequest): GetCodecDescriptorRequestAmino { const obj: any = {}; @@ -1881,7 +1922,7 @@ export const GetCodecDescriptorRequest = { }; function createBaseGetCodecDescriptorResponse(): GetCodecDescriptorResponse { return { - codec: CodecDescriptor.fromPartial({}) + codec: undefined }; } export const GetCodecDescriptorResponse = { @@ -1915,9 +1956,11 @@ export const GetCodecDescriptorResponse = { return message; }, fromAmino(object: GetCodecDescriptorResponseAmino): GetCodecDescriptorResponse { - return { - codec: object?.codec ? CodecDescriptor.fromAmino(object.codec) : undefined - }; + const message = createBaseGetCodecDescriptorResponse(); + if (object.codec !== undefined && object.codec !== null) { + message.codec = CodecDescriptor.fromAmino(object.codec); + } + return message; }, toAmino(message: GetCodecDescriptorResponse): GetCodecDescriptorResponseAmino { const obj: any = {}; @@ -1973,7 +2016,8 @@ export const GetConfigurationDescriptorRequest = { return message; }, fromAmino(_: GetConfigurationDescriptorRequestAmino): GetConfigurationDescriptorRequest { - return {}; + const message = createBaseGetConfigurationDescriptorRequest(); + return message; }, toAmino(_: GetConfigurationDescriptorRequest): GetConfigurationDescriptorRequestAmino { const obj: any = {}; @@ -2003,7 +2047,7 @@ export const GetConfigurationDescriptorRequest = { }; function createBaseGetConfigurationDescriptorResponse(): GetConfigurationDescriptorResponse { return { - config: ConfigurationDescriptor.fromPartial({}) + config: undefined }; } export const GetConfigurationDescriptorResponse = { @@ -2037,9 +2081,11 @@ export const GetConfigurationDescriptorResponse = { return message; }, fromAmino(object: GetConfigurationDescriptorResponseAmino): GetConfigurationDescriptorResponse { - return { - config: object?.config ? ConfigurationDescriptor.fromAmino(object.config) : undefined - }; + const message = createBaseGetConfigurationDescriptorResponse(); + if (object.config !== undefined && object.config !== null) { + message.config = ConfigurationDescriptor.fromAmino(object.config); + } + return message; }, toAmino(message: GetConfigurationDescriptorResponse): GetConfigurationDescriptorResponseAmino { const obj: any = {}; @@ -2095,7 +2141,8 @@ export const GetQueryServicesDescriptorRequest = { return message; }, fromAmino(_: GetQueryServicesDescriptorRequestAmino): GetQueryServicesDescriptorRequest { - return {}; + const message = createBaseGetQueryServicesDescriptorRequest(); + return message; }, toAmino(_: GetQueryServicesDescriptorRequest): GetQueryServicesDescriptorRequestAmino { const obj: any = {}; @@ -2125,7 +2172,7 @@ export const GetQueryServicesDescriptorRequest = { }; function createBaseGetQueryServicesDescriptorResponse(): GetQueryServicesDescriptorResponse { return { - queries: QueryServicesDescriptor.fromPartial({}) + queries: undefined }; } export const GetQueryServicesDescriptorResponse = { @@ -2159,9 +2206,11 @@ export const GetQueryServicesDescriptorResponse = { return message; }, fromAmino(object: GetQueryServicesDescriptorResponseAmino): GetQueryServicesDescriptorResponse { - return { - queries: object?.queries ? QueryServicesDescriptor.fromAmino(object.queries) : undefined - }; + const message = createBaseGetQueryServicesDescriptorResponse(); + if (object.queries !== undefined && object.queries !== null) { + message.queries = QueryServicesDescriptor.fromAmino(object.queries); + } + return message; }, toAmino(message: GetQueryServicesDescriptorResponse): GetQueryServicesDescriptorResponseAmino { const obj: any = {}; @@ -2217,7 +2266,8 @@ export const GetTxDescriptorRequest = { return message; }, fromAmino(_: GetTxDescriptorRequestAmino): GetTxDescriptorRequest { - return {}; + const message = createBaseGetTxDescriptorRequest(); + return message; }, toAmino(_: GetTxDescriptorRequest): GetTxDescriptorRequestAmino { const obj: any = {}; @@ -2247,7 +2297,7 @@ export const GetTxDescriptorRequest = { }; function createBaseGetTxDescriptorResponse(): GetTxDescriptorResponse { return { - tx: TxDescriptor.fromPartial({}) + tx: undefined }; } export const GetTxDescriptorResponse = { @@ -2281,9 +2331,11 @@ export const GetTxDescriptorResponse = { return message; }, fromAmino(object: GetTxDescriptorResponseAmino): GetTxDescriptorResponse { - return { - tx: object?.tx ? TxDescriptor.fromAmino(object.tx) : undefined - }; + const message = createBaseGetTxDescriptorResponse(); + if (object.tx !== undefined && object.tx !== null) { + message.tx = TxDescriptor.fromAmino(object.tx); + } + return message; }, toAmino(message: GetTxDescriptorResponse): GetTxDescriptorResponseAmino { const obj: any = {}; @@ -2348,9 +2400,9 @@ export const QueryServicesDescriptor = { return message; }, fromAmino(object: QueryServicesDescriptorAmino): QueryServicesDescriptor { - return { - queryServices: Array.isArray(object?.query_services) ? object.query_services.map((e: any) => QueryServiceDescriptor.fromAmino(e)) : [] - }; + const message = createBaseQueryServicesDescriptor(); + message.queryServices = object.query_services?.map(e => QueryServiceDescriptor.fromAmino(e)) || []; + return message; }, toAmino(message: QueryServicesDescriptor): QueryServicesDescriptorAmino { const obj: any = {}; @@ -2435,11 +2487,15 @@ export const QueryServiceDescriptor = { return message; }, fromAmino(object: QueryServiceDescriptorAmino): QueryServiceDescriptor { - return { - fullname: object.fullname, - isModule: object.is_module, - methods: Array.isArray(object?.methods) ? object.methods.map((e: any) => QueryMethodDescriptor.fromAmino(e)) : [] - }; + const message = createBaseQueryServiceDescriptor(); + if (object.fullname !== undefined && object.fullname !== null) { + message.fullname = object.fullname; + } + if (object.is_module !== undefined && object.is_module !== null) { + message.isModule = object.is_module; + } + message.methods = object.methods?.map(e => QueryMethodDescriptor.fromAmino(e)) || []; + return message; }, toAmino(message: QueryServiceDescriptor): QueryServiceDescriptorAmino { const obj: any = {}; @@ -2518,10 +2574,14 @@ export const QueryMethodDescriptor = { return message; }, fromAmino(object: QueryMethodDescriptorAmino): QueryMethodDescriptor { - return { - name: object.name, - fullQueryPath: object.full_query_path - }; + const message = createBaseQueryMethodDescriptor(); + if (object.name !== undefined && object.name !== null) { + message.name = object.name; + } + if (object.full_query_path !== undefined && object.full_query_path !== null) { + message.fullQueryPath = object.full_query_path; + } + return message; }, toAmino(message: QueryMethodDescriptor): QueryMethodDescriptorAmino { const obj: any = {}; diff --git a/packages/osmo-query/src/codegen/cosmos/base/v1beta1/coin.ts b/packages/osmo-query/src/codegen/cosmos/base/v1beta1/coin.ts index 70f7a52e1..12577234b 100644 --- a/packages/osmo-query/src/codegen/cosmos/base/v1beta1/coin.ts +++ b/packages/osmo-query/src/codegen/cosmos/base/v1beta1/coin.ts @@ -20,7 +20,7 @@ export interface CoinProtoMsg { * signatures required by gogoproto. */ export interface CoinAmino { - denom: string; + denom?: string; amount: string; } export interface CoinAminoMsg { @@ -58,8 +58,8 @@ export interface DecCoinProtoMsg { * signatures required by gogoproto. */ export interface DecCoinAmino { - denom: string; - amount: string; + denom?: string; + amount?: string; } export interface DecCoinAminoMsg { type: "cosmos-sdk/DecCoin"; @@ -85,7 +85,7 @@ export interface IntProtoProtoMsg { } /** IntProto defines a Protobuf wrapper around an Int object. */ export interface IntProtoAmino { - int: string; + int?: string; } export interface IntProtoAminoMsg { type: "cosmos-sdk/IntProto"; @@ -105,7 +105,7 @@ export interface DecProtoProtoMsg { } /** DecProto defines a Protobuf wrapper around a Dec object. */ export interface DecProtoAmino { - dec: string; + dec?: string; } export interface DecProtoAminoMsg { type: "cosmos-sdk/DecProto"; @@ -159,15 +159,19 @@ export const Coin = { return message; }, fromAmino(object: CoinAmino): Coin { - return { - denom: object.denom, - amount: object.amount - }; + const message = createBaseCoin(); + if (object.denom !== undefined && object.denom !== null) { + message.denom = object.denom; + } + if (object.amount !== undefined && object.amount !== null) { + message.amount = object.amount; + } + return message; }, toAmino(message: Coin): CoinAmino { const obj: any = {}; obj.denom = message.denom; - obj.amount = message.amount; + obj.amount = message.amount ?? ""; return obj; }, fromAminoMsg(object: CoinAminoMsg): Coin { @@ -236,10 +240,14 @@ export const DecCoin = { return message; }, fromAmino(object: DecCoinAmino): DecCoin { - return { - denom: object.denom, - amount: object.amount - }; + const message = createBaseDecCoin(); + if (object.denom !== undefined && object.denom !== null) { + message.denom = object.denom; + } + if (object.amount !== undefined && object.amount !== null) { + message.amount = object.amount; + } + return message; }, toAmino(message: DecCoin): DecCoinAmino { const obj: any = {}; @@ -305,9 +313,11 @@ export const IntProto = { return message; }, fromAmino(object: IntProtoAmino): IntProto { - return { - int: object.int - }; + const message = createBaseIntProto(); + if (object.int !== undefined && object.int !== null) { + message.int = object.int; + } + return message; }, toAmino(message: IntProto): IntProtoAmino { const obj: any = {}; @@ -372,9 +382,11 @@ export const DecProto = { return message; }, fromAmino(object: DecProtoAmino): DecProto { - return { - dec: object.dec - }; + const message = createBaseDecProto(); + if (object.dec !== undefined && object.dec !== null) { + message.dec = object.dec; + } + return message; }, toAmino(message: DecProto): DecProtoAmino { const obj: any = {}; diff --git a/packages/osmo-query/src/codegen/cosmos/bundle.ts b/packages/osmo-query/src/codegen/cosmos/bundle.ts index 8a55932b2..d5eee9080 100644 --- a/packages/osmo-query/src/codegen/cosmos/bundle.ts +++ b/packages/osmo-query/src/codegen/cosmos/bundle.ts @@ -1,228 +1,452 @@ import * as _0 from "./ics23/v1/proofs"; -import * as _1 from "./auth/v1beta1/auth"; -import * as _2 from "./auth/v1beta1/genesis"; -import * as _3 from "./auth/v1beta1/query"; -import * as _4 from "./authz/v1beta1/authz"; -import * as _5 from "./authz/v1beta1/event"; -import * as _6 from "./authz/v1beta1/genesis"; -import * as _7 from "./authz/v1beta1/query"; -import * as _8 from "./authz/v1beta1/tx"; -import * as _9 from "./bank/v1beta1/authz"; -import * as _10 from "./bank/v1beta1/bank"; -import * as _11 from "./bank/v1beta1/genesis"; -import * as _12 from "./bank/v1beta1/query"; -import * as _13 from "./bank/v1beta1/tx"; -import * as _14 from "./base/abci/v1beta1/abci"; -import * as _15 from "./base/node/v1beta1/query"; -import * as _16 from "./base/query/v1beta1/pagination"; -import * as _17 from "./base/reflection/v2alpha1/reflection"; -import * as _18 from "./base/v1beta1/coin"; -import * as _19 from "./crypto/ed25519/keys"; -import * as _20 from "./crypto/multisig/keys"; -import * as _21 from "./crypto/secp256k1/keys"; -import * as _22 from "./crypto/secp256r1/keys"; -import * as _23 from "./distribution/v1beta1/distribution"; -import * as _24 from "./distribution/v1beta1/genesis"; -import * as _25 from "./distribution/v1beta1/query"; -import * as _26 from "./distribution/v1beta1/tx"; -import * as _27 from "./gov/v1beta1/genesis"; -import * as _28 from "./gov/v1beta1/gov"; -import * as _29 from "./gov/v1beta1/query"; -import * as _30 from "./gov/v1beta1/tx"; -import * as _31 from "./staking/v1beta1/authz"; -import * as _32 from "./staking/v1beta1/genesis"; -import * as _33 from "./staking/v1beta1/query"; -import * as _34 from "./staking/v1beta1/staking"; -import * as _35 from "./staking/v1beta1/tx"; -import * as _36 from "./tx/signing/v1beta1/signing"; -import * as _37 from "./tx/v1beta1/service"; -import * as _38 from "./tx/v1beta1/tx"; -import * as _39 from "./upgrade/v1beta1/query"; -import * as _40 from "./upgrade/v1beta1/upgrade"; -import * as _190 from "./authz/v1beta1/tx.amino"; -import * as _191 from "./bank/v1beta1/tx.amino"; -import * as _192 from "./distribution/v1beta1/tx.amino"; -import * as _193 from "./gov/v1beta1/tx.amino"; -import * as _194 from "./staking/v1beta1/tx.amino"; -import * as _195 from "./authz/v1beta1/tx.registry"; -import * as _196 from "./bank/v1beta1/tx.registry"; -import * as _197 from "./distribution/v1beta1/tx.registry"; -import * as _198 from "./gov/v1beta1/tx.registry"; -import * as _199 from "./staking/v1beta1/tx.registry"; -import * as _200 from "./auth/v1beta1/query.lcd"; -import * as _201 from "./authz/v1beta1/query.lcd"; -import * as _202 from "./bank/v1beta1/query.lcd"; -import * as _203 from "./base/node/v1beta1/query.lcd"; -import * as _204 from "./distribution/v1beta1/query.lcd"; -import * as _205 from "./gov/v1beta1/query.lcd"; -import * as _206 from "./staking/v1beta1/query.lcd"; -import * as _207 from "./tx/v1beta1/service.lcd"; -import * as _208 from "./upgrade/v1beta1/query.lcd"; -import * as _209 from "./auth/v1beta1/query.rpc.Query"; -import * as _210 from "./authz/v1beta1/query.rpc.Query"; -import * as _211 from "./bank/v1beta1/query.rpc.Query"; -import * as _212 from "./base/node/v1beta1/query.rpc.Service"; -import * as _213 from "./distribution/v1beta1/query.rpc.Query"; -import * as _214 from "./gov/v1beta1/query.rpc.Query"; -import * as _215 from "./staking/v1beta1/query.rpc.Query"; -import * as _216 from "./tx/v1beta1/service.rpc.Service"; -import * as _217 from "./upgrade/v1beta1/query.rpc.Query"; -import * as _218 from "./authz/v1beta1/tx.rpc.msg"; -import * as _219 from "./bank/v1beta1/tx.rpc.msg"; -import * as _220 from "./distribution/v1beta1/tx.rpc.msg"; -import * as _221 from "./gov/v1beta1/tx.rpc.msg"; -import * as _222 from "./staking/v1beta1/tx.rpc.msg"; -import * as _332 from "./lcd"; -import * as _333 from "./rpc.query"; -import * as _334 from "./rpc.tx"; +import * as _1 from "./app/runtime/v1alpha1/module"; +import * as _2 from "./auth/module/v1/module"; +import * as _3 from "./auth/v1beta1/auth"; +import * as _4 from "./auth/v1beta1/genesis"; +import * as _5 from "./auth/v1beta1/query"; +import * as _6 from "./auth/v1beta1/tx"; +import * as _7 from "./authz/module/v1/module"; +import * as _8 from "./authz/v1beta1/authz"; +import * as _9 from "./authz/v1beta1/event"; +import * as _10 from "./authz/v1beta1/genesis"; +import * as _11 from "./authz/v1beta1/query"; +import * as _12 from "./authz/v1beta1/tx"; +import * as _13 from "./bank/module/v1/module"; +import * as _14 from "./bank/v1beta1/authz"; +import * as _15 from "./bank/v1beta1/bank"; +import * as _16 from "./bank/v1beta1/genesis"; +import * as _17 from "./bank/v1beta1/query"; +import * as _18 from "./bank/v1beta1/tx"; +import * as _19 from "./base/abci/v1beta1/abci"; +import * as _20 from "./base/node/v1beta1/query"; +import * as _21 from "./base/query/v1beta1/pagination"; +import * as _22 from "./base/reflection/v2alpha1/reflection"; +import * as _23 from "./base/v1beta1/coin"; +import * as _24 from "./capability/module/v1/module"; +import * as _25 from "./consensus/module/v1/module"; +import * as _26 from "./consensus/v1/query"; +import * as _27 from "./consensus/v1/tx"; +import * as _28 from "./crisis/module/v1/module"; +import * as _29 from "./crypto/ed25519/keys"; +import * as _30 from "./crypto/hd/v1/hd"; +import * as _31 from "./crypto/keyring/v1/record"; +import * as _32 from "./crypto/multisig/keys"; +import * as _33 from "./crypto/secp256k1/keys"; +import * as _34 from "./crypto/secp256r1/keys"; +import * as _35 from "./distribution/module/v1/module"; +import * as _36 from "./distribution/v1beta1/distribution"; +import * as _37 from "./distribution/v1beta1/genesis"; +import * as _38 from "./distribution/v1beta1/query"; +import * as _39 from "./distribution/v1beta1/tx"; +import * as _40 from "./evidence/module/v1/module"; +import * as _41 from "./feegrant/module/v1/module"; +import * as _42 from "./genutil/module/v1/module"; +import * as _43 from "./gov/module/v1/module"; +import * as _44 from "./gov/v1beta1/genesis"; +import * as _45 from "./gov/v1beta1/gov"; +import * as _46 from "./gov/v1beta1/query"; +import * as _47 from "./gov/v1beta1/tx"; +import * as _48 from "./group/module/v1/module"; +import * as _49 from "./mint/module/v1/module"; +import * as _50 from "./nft/module/v1/module"; +import * as _51 from "./orm/module/v1alpha1/module"; +import * as _52 from "./orm/query/v1alpha1/query"; +import * as _53 from "./params/module/v1/module"; +import * as _54 from "./query/v1/query"; +import * as _55 from "./reflection/v1/reflection"; +import * as _56 from "./slashing/module/v1/module"; +import * as _57 from "./staking/module/v1/module"; +import * as _58 from "./staking/v1beta1/authz"; +import * as _59 from "./staking/v1beta1/genesis"; +import * as _60 from "./staking/v1beta1/query"; +import * as _61 from "./staking/v1beta1/staking"; +import * as _62 from "./staking/v1beta1/tx"; +import * as _63 from "./tx/config/v1/config"; +import * as _64 from "./tx/signing/v1beta1/signing"; +import * as _65 from "./tx/v1beta1/service"; +import * as _66 from "./tx/v1beta1/tx"; +import * as _67 from "./upgrade/module/v1/module"; +import * as _68 from "./upgrade/v1beta1/query"; +import * as _69 from "./upgrade/v1beta1/tx"; +import * as _70 from "./upgrade/v1beta1/upgrade"; +import * as _71 from "./vesting/module/v1/module"; +import * as _235 from "./auth/v1beta1/tx.amino"; +import * as _236 from "./authz/v1beta1/tx.amino"; +import * as _237 from "./bank/v1beta1/tx.amino"; +import * as _238 from "./consensus/v1/tx.amino"; +import * as _239 from "./distribution/v1beta1/tx.amino"; +import * as _240 from "./gov/v1beta1/tx.amino"; +import * as _241 from "./staking/v1beta1/tx.amino"; +import * as _242 from "./upgrade/v1beta1/tx.amino"; +import * as _243 from "./auth/v1beta1/tx.registry"; +import * as _244 from "./authz/v1beta1/tx.registry"; +import * as _245 from "./bank/v1beta1/tx.registry"; +import * as _246 from "./consensus/v1/tx.registry"; +import * as _247 from "./distribution/v1beta1/tx.registry"; +import * as _248 from "./gov/v1beta1/tx.registry"; +import * as _249 from "./staking/v1beta1/tx.registry"; +import * as _250 from "./upgrade/v1beta1/tx.registry"; +import * as _251 from "./auth/v1beta1/query.lcd"; +import * as _252 from "./authz/v1beta1/query.lcd"; +import * as _253 from "./bank/v1beta1/query.lcd"; +import * as _254 from "./base/node/v1beta1/query.lcd"; +import * as _255 from "./consensus/v1/query.lcd"; +import * as _256 from "./distribution/v1beta1/query.lcd"; +import * as _257 from "./gov/v1beta1/query.lcd"; +import * as _258 from "./staking/v1beta1/query.lcd"; +import * as _259 from "./tx/v1beta1/service.lcd"; +import * as _260 from "./upgrade/v1beta1/query.lcd"; +import * as _261 from "./auth/v1beta1/query.rpc.Query"; +import * as _262 from "./authz/v1beta1/query.rpc.Query"; +import * as _263 from "./bank/v1beta1/query.rpc.Query"; +import * as _264 from "./base/node/v1beta1/query.rpc.Service"; +import * as _265 from "./consensus/v1/query.rpc.Query"; +import * as _266 from "./distribution/v1beta1/query.rpc.Query"; +import * as _267 from "./gov/v1beta1/query.rpc.Query"; +import * as _268 from "./orm/query/v1alpha1/query.rpc.Query"; +import * as _269 from "./staking/v1beta1/query.rpc.Query"; +import * as _270 from "./tx/v1beta1/service.rpc.Service"; +import * as _271 from "./upgrade/v1beta1/query.rpc.Query"; +import * as _272 from "./auth/v1beta1/tx.rpc.msg"; +import * as _273 from "./authz/v1beta1/tx.rpc.msg"; +import * as _274 from "./bank/v1beta1/tx.rpc.msg"; +import * as _275 from "./consensus/v1/tx.rpc.msg"; +import * as _276 from "./distribution/v1beta1/tx.rpc.msg"; +import * as _277 from "./gov/v1beta1/tx.rpc.msg"; +import * as _278 from "./staking/v1beta1/tx.rpc.msg"; +import * as _279 from "./upgrade/v1beta1/tx.rpc.msg"; +import * as _402 from "./lcd"; +import * as _403 from "./rpc.query"; +import * as _404 from "./rpc.tx"; export namespace cosmos { export namespace ics23 { export const v1 = { ..._0 }; } + export namespace app { + export namespace runtime { + export const v1alpha1 = { + ..._1 + }; + } + } export namespace auth { + export namespace module { + export const v1 = { + ..._2 + }; + } export const v1beta1 = { - ..._1, - ..._2, ..._3, - ..._200, - ..._209 - }; - } - export namespace authz { - export const v1beta1 = { ..._4, ..._5, ..._6, - ..._7, - ..._8, - ..._190, - ..._195, - ..._201, - ..._210, - ..._218 + ..._235, + ..._243, + ..._251, + ..._261, + ..._272 }; } - export namespace bank { + export namespace authz { + export namespace module { + export const v1 = { + ..._7 + }; + } export const v1beta1 = { + ..._8, ..._9, ..._10, ..._11, ..._12, - ..._13, - ..._191, - ..._196, - ..._202, - ..._211, - ..._219 + ..._236, + ..._244, + ..._252, + ..._262, + ..._273 + }; + } + export namespace bank { + export namespace module { + export const v1 = { + ..._13 + }; + } + export const v1beta1 = { + ..._14, + ..._15, + ..._16, + ..._17, + ..._18, + ..._237, + ..._245, + ..._253, + ..._263, + ..._274 }; } export namespace base { export namespace abci { export const v1beta1 = { - ..._14 + ..._19 }; } export namespace node { export const v1beta1 = { - ..._15, - ..._203, - ..._212 + ..._20, + ..._254, + ..._264 }; } export namespace query { export const v1beta1 = { - ..._16 + ..._21 }; } export namespace reflection { export const v2alpha1 = { - ..._17 + ..._22 }; } export const v1beta1 = { - ..._18 + ..._23 + }; + } + export namespace capability { + export namespace module { + export const v1 = { + ..._24 + }; + } + } + export namespace consensus { + export namespace module { + export const v1 = { + ..._25 + }; + } + export const v1 = { + ..._26, + ..._27, + ..._238, + ..._246, + ..._255, + ..._265, + ..._275 }; } + export namespace crisis { + export namespace module { + export const v1 = { + ..._28 + }; + } + } export namespace crypto { export const ed25519 = { - ..._19 + ..._29 }; + export namespace hd { + export const v1 = { + ..._30 + }; + } + export namespace keyring { + export const v1 = { + ..._31 + }; + } export const multisig = { - ..._20 + ..._32 }; export const secp256k1 = { - ..._21 + ..._33 }; export const secp256r1 = { - ..._22 + ..._34 }; } export namespace distribution { + export namespace module { + export const v1 = { + ..._35 + }; + } export const v1beta1 = { - ..._23, - ..._24, - ..._25, - ..._26, - ..._192, - ..._197, - ..._204, - ..._213, - ..._220 + ..._36, + ..._37, + ..._38, + ..._39, + ..._239, + ..._247, + ..._256, + ..._266, + ..._276 }; } + export namespace evidence { + export namespace module { + export const v1 = { + ..._40 + }; + } + } + export namespace feegrant { + export namespace module { + export const v1 = { + ..._41 + }; + } + } + export namespace genutil { + export namespace module { + export const v1 = { + ..._42 + }; + } + } export namespace gov { + export namespace module { + export const v1 = { + ..._43 + }; + } export const v1beta1 = { - ..._27, - ..._28, - ..._29, - ..._30, - ..._193, - ..._198, - ..._205, - ..._214, - ..._221 + ..._44, + ..._45, + ..._46, + ..._47, + ..._240, + ..._248, + ..._257, + ..._267, + ..._277 }; } + export namespace group { + export namespace module { + export const v1 = { + ..._48 + }; + } + } + export namespace mint { + export namespace module { + export const v1 = { + ..._49 + }; + } + } + export namespace nft { + export namespace module { + export const v1 = { + ..._50 + }; + } + } + export namespace orm { + export namespace module { + export const v1alpha1 = { + ..._51 + }; + } + export namespace query { + export const v1alpha1 = { + ..._52, + ..._268 + }; + } + } + export namespace params { + export namespace module { + export const v1 = { + ..._53 + }; + } + } + export namespace query { + export const v1 = { + ..._54 + }; + } + export namespace reflection { + export const v1 = { + ..._55 + }; + } + export namespace slashing { + export namespace module { + export const v1 = { + ..._56 + }; + } + } export namespace staking { + export namespace module { + export const v1 = { + ..._57 + }; + } export const v1beta1 = { - ..._31, - ..._32, - ..._33, - ..._34, - ..._35, - ..._194, - ..._199, - ..._206, - ..._215, - ..._222 + ..._58, + ..._59, + ..._60, + ..._61, + ..._62, + ..._241, + ..._249, + ..._258, + ..._269, + ..._278 }; } export namespace tx { + export namespace config { + export const v1 = { + ..._63 + }; + } export namespace signing { export const v1beta1 = { - ..._36 + ..._64 }; } export const v1beta1 = { - ..._37, - ..._38, - ..._207, - ..._216 + ..._65, + ..._66, + ..._259, + ..._270 }; } export namespace upgrade { + export namespace module { + export const v1 = { + ..._67 + }; + } export const v1beta1 = { - ..._39, - ..._40, - ..._208, - ..._217 + ..._68, + ..._69, + ..._70, + ..._242, + ..._250, + ..._260, + ..._271, + ..._279 }; } + export namespace vesting { + export namespace module { + export const v1 = { + ..._71 + }; + } + } export const ClientFactory = { - ..._332, - ..._333, - ..._334 + ..._402, + ..._403, + ..._404 }; } \ No newline at end of file diff --git a/packages/osmo-query/src/codegen/cosmos/client.ts b/packages/osmo-query/src/codegen/cosmos/client.ts index dd1ad8595..278467e8f 100644 --- a/packages/osmo-query/src/codegen/cosmos/client.ts +++ b/packages/osmo-query/src/codegen/cosmos/client.ts @@ -1,24 +1,33 @@ import { GeneratedType, Registry, OfflineSigner } from "@cosmjs/proto-signing"; import { AminoTypes, SigningStargateClient } from "@cosmjs/stargate"; import { HttpEndpoint } from "@cosmjs/tendermint-rpc"; +import * as cosmosAuthV1beta1TxRegistry from "./auth/v1beta1/tx.registry"; import * as cosmosAuthzV1beta1TxRegistry from "./authz/v1beta1/tx.registry"; import * as cosmosBankV1beta1TxRegistry from "./bank/v1beta1/tx.registry"; +import * as cosmosConsensusV1TxRegistry from "./consensus/v1/tx.registry"; import * as cosmosDistributionV1beta1TxRegistry from "./distribution/v1beta1/tx.registry"; import * as cosmosGovV1beta1TxRegistry from "./gov/v1beta1/tx.registry"; import * as cosmosStakingV1beta1TxRegistry from "./staking/v1beta1/tx.registry"; +import * as cosmosUpgradeV1beta1TxRegistry from "./upgrade/v1beta1/tx.registry"; +import * as cosmosAuthV1beta1TxAmino from "./auth/v1beta1/tx.amino"; import * as cosmosAuthzV1beta1TxAmino from "./authz/v1beta1/tx.amino"; import * as cosmosBankV1beta1TxAmino from "./bank/v1beta1/tx.amino"; +import * as cosmosConsensusV1TxAmino from "./consensus/v1/tx.amino"; import * as cosmosDistributionV1beta1TxAmino from "./distribution/v1beta1/tx.amino"; import * as cosmosGovV1beta1TxAmino from "./gov/v1beta1/tx.amino"; import * as cosmosStakingV1beta1TxAmino from "./staking/v1beta1/tx.amino"; +import * as cosmosUpgradeV1beta1TxAmino from "./upgrade/v1beta1/tx.amino"; export const cosmosAminoConverters = { + ...cosmosAuthV1beta1TxAmino.AminoConverter, ...cosmosAuthzV1beta1TxAmino.AminoConverter, ...cosmosBankV1beta1TxAmino.AminoConverter, + ...cosmosConsensusV1TxAmino.AminoConverter, ...cosmosDistributionV1beta1TxAmino.AminoConverter, ...cosmosGovV1beta1TxAmino.AminoConverter, - ...cosmosStakingV1beta1TxAmino.AminoConverter + ...cosmosStakingV1beta1TxAmino.AminoConverter, + ...cosmosUpgradeV1beta1TxAmino.AminoConverter }; -export const cosmosProtoRegistry: ReadonlyArray<[string, GeneratedType]> = [...cosmosAuthzV1beta1TxRegistry.registry, ...cosmosBankV1beta1TxRegistry.registry, ...cosmosDistributionV1beta1TxRegistry.registry, ...cosmosGovV1beta1TxRegistry.registry, ...cosmosStakingV1beta1TxRegistry.registry]; +export const cosmosProtoRegistry: ReadonlyArray<[string, GeneratedType]> = [...cosmosAuthV1beta1TxRegistry.registry, ...cosmosAuthzV1beta1TxRegistry.registry, ...cosmosBankV1beta1TxRegistry.registry, ...cosmosConsensusV1TxRegistry.registry, ...cosmosDistributionV1beta1TxRegistry.registry, ...cosmosGovV1beta1TxRegistry.registry, ...cosmosStakingV1beta1TxRegistry.registry, ...cosmosUpgradeV1beta1TxRegistry.registry]; export const getSigningCosmosClientOptions = (): { registry: Registry; aminoTypes: AminoTypes; diff --git a/packages/osmo-query/src/codegen/cosmos/consensus/v1/query.lcd.ts b/packages/osmo-query/src/codegen/cosmos/consensus/v1/query.lcd.ts new file mode 100644 index 000000000..c792c8d86 --- /dev/null +++ b/packages/osmo-query/src/codegen/cosmos/consensus/v1/query.lcd.ts @@ -0,0 +1,18 @@ +import { LCDClient } from "@cosmology/lcd"; +import { QueryParamsRequest, QueryParamsResponseSDKType } from "./query"; +export class LCDQueryClient { + req: LCDClient; + constructor({ + requestClient + }: { + requestClient: LCDClient; + }) { + this.req = requestClient; + this.params = this.params.bind(this); + } + /* Params queries the parameters of x/consensus_param module. */ + async params(_params: QueryParamsRequest = {}): Promise { + const endpoint = `cosmos/consensus/v1/params`; + return await this.req.get(endpoint); + } +} \ No newline at end of file diff --git a/packages/osmo-query/src/codegen/cosmos/consensus/v1/query.rpc.Query.ts b/packages/osmo-query/src/codegen/cosmos/consensus/v1/query.rpc.Query.ts new file mode 100644 index 000000000..8b127ebb3 --- /dev/null +++ b/packages/osmo-query/src/codegen/cosmos/consensus/v1/query.rpc.Query.ts @@ -0,0 +1,60 @@ +import { Rpc } from "../../../helpers"; +import { BinaryReader } from "../../../binary"; +import { QueryClient, createProtobufRpcClient, ProtobufRpcClient } from "@cosmjs/stargate"; +import { ReactQueryParams } from "../../../react-query"; +import { useQuery } from "@tanstack/react-query"; +import { QueryParamsRequest, QueryParamsResponse } from "./query"; +/** Query defines the gRPC querier service. */ +export interface Query { + /** Params queries the parameters of x/consensus_param module. */ + params(request?: QueryParamsRequest): Promise; +} +export class QueryClientImpl implements Query { + private readonly rpc: Rpc; + constructor(rpc: Rpc) { + 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.consensus.v1.Query", "Params", data); + return promise.then(data => QueryParamsResponse.decode(new BinaryReader(data))); + } +} +export const createRpcQueryExtension = (base: QueryClient) => { + const rpc = createProtobufRpcClient(base); + const queryService = new QueryClientImpl(rpc); + return { + params(request?: QueryParamsRequest): Promise { + return queryService.params(request); + } + }; +}; +export interface UseParamsQuery extends ReactQueryParams { + request?: QueryParamsRequest; +} +const _queryClients: WeakMap = new WeakMap(); +const getQueryService = (rpc: ProtobufRpcClient | undefined): QueryClientImpl | undefined => { + if (!rpc) return; + if (_queryClients.has(rpc)) { + return _queryClients.get(rpc); + } + const queryService = new QueryClientImpl(rpc); + _queryClients.set(rpc, queryService); + return queryService; +}; +export const createRpcQueryHooks = (rpc: ProtobufRpcClient | undefined) => { + const queryService = getQueryService(rpc); + const useParams = ({ + request, + options + }: UseParamsQuery) => { + return useQuery(["paramsQuery", request], () => { + if (!queryService) throw new Error("Query Service not initialized"); + return queryService.params(request); + }, options); + }; + return { + /** Params queries the parameters of x/consensus_param module. */useParams + }; +}; \ No newline at end of file diff --git a/packages/osmo-query/src/codegen/cosmos/consensus/v1/query.ts b/packages/osmo-query/src/codegen/cosmos/consensus/v1/query.ts new file mode 100644 index 000000000..ade123c3c --- /dev/null +++ b/packages/osmo-query/src/codegen/cosmos/consensus/v1/query.ts @@ -0,0 +1,171 @@ +import { ConsensusParams, ConsensusParamsAmino, ConsensusParamsSDKType } from "../../../tendermint/types/params"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +/** QueryParamsRequest defines the request type for querying x/consensus parameters. */ +export interface QueryParamsRequest {} +export interface QueryParamsRequestProtoMsg { + typeUrl: "/cosmos.consensus.v1.QueryParamsRequest"; + value: Uint8Array; +} +/** QueryParamsRequest defines the request type for querying x/consensus parameters. */ +export interface QueryParamsRequestAmino {} +export interface QueryParamsRequestAminoMsg { + type: "cosmos-sdk/QueryParamsRequest"; + value: QueryParamsRequestAmino; +} +/** QueryParamsRequest defines the request type for querying x/consensus parameters. */ +export interface QueryParamsRequestSDKType {} +/** QueryParamsResponse defines the response type for querying x/consensus parameters. */ +export interface QueryParamsResponse { + /** + * params are the tendermint consensus params stored in the consensus module. + * Please note that `params.version` is not populated in this response, it is + * tracked separately in the x/upgrade module. + */ + params?: ConsensusParams; +} +export interface QueryParamsResponseProtoMsg { + typeUrl: "/cosmos.consensus.v1.QueryParamsResponse"; + value: Uint8Array; +} +/** QueryParamsResponse defines the response type for querying x/consensus parameters. */ +export interface QueryParamsResponseAmino { + /** + * params are the tendermint consensus params stored in the consensus module. + * Please note that `params.version` is not populated in this response, it is + * tracked separately in the x/upgrade module. + */ + params?: ConsensusParamsAmino; +} +export interface QueryParamsResponseAminoMsg { + type: "cosmos-sdk/QueryParamsResponse"; + value: QueryParamsResponseAmino; +} +/** QueryParamsResponse defines the response type for querying x/consensus parameters. */ +export interface QueryParamsResponseSDKType { + params?: ConsensusParamsSDKType; +} +function createBaseQueryParamsRequest(): QueryParamsRequest { + return {}; +} +export const QueryParamsRequest = { + typeUrl: "/cosmos.consensus.v1.QueryParamsRequest", + encode(_: QueryParamsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryParamsRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryParamsRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): QueryParamsRequest { + const message = createBaseQueryParamsRequest(); + return message; + }, + fromAmino(_: QueryParamsRequestAmino): QueryParamsRequest { + const message = createBaseQueryParamsRequest(); + return message; + }, + toAmino(_: QueryParamsRequest): QueryParamsRequestAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: QueryParamsRequestAminoMsg): QueryParamsRequest { + return QueryParamsRequest.fromAmino(object.value); + }, + toAminoMsg(message: QueryParamsRequest): QueryParamsRequestAminoMsg { + return { + type: "cosmos-sdk/QueryParamsRequest", + value: QueryParamsRequest.toAmino(message) + }; + }, + fromProtoMsg(message: QueryParamsRequestProtoMsg): QueryParamsRequest { + return QueryParamsRequest.decode(message.value); + }, + toProto(message: QueryParamsRequest): Uint8Array { + return QueryParamsRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryParamsRequest): QueryParamsRequestProtoMsg { + return { + typeUrl: "/cosmos.consensus.v1.QueryParamsRequest", + value: QueryParamsRequest.encode(message).finish() + }; + } +}; +function createBaseQueryParamsResponse(): QueryParamsResponse { + return { + params: undefined + }; +} +export const QueryParamsResponse = { + typeUrl: "/cosmos.consensus.v1.QueryParamsResponse", + encode(message: QueryParamsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.params !== undefined) { + ConsensusParams.encode(message.params, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryParamsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryParamsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.params = ConsensusParams.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryParamsResponse { + const message = createBaseQueryParamsResponse(); + message.params = object.params !== undefined && object.params !== null ? ConsensusParams.fromPartial(object.params) : undefined; + return message; + }, + fromAmino(object: QueryParamsResponseAmino): QueryParamsResponse { + const message = createBaseQueryParamsResponse(); + if (object.params !== undefined && object.params !== null) { + message.params = ConsensusParams.fromAmino(object.params); + } + return message; + }, + toAmino(message: QueryParamsResponse): QueryParamsResponseAmino { + const obj: any = {}; + obj.params = message.params ? ConsensusParams.toAmino(message.params) : undefined; + return obj; + }, + fromAminoMsg(object: QueryParamsResponseAminoMsg): QueryParamsResponse { + return QueryParamsResponse.fromAmino(object.value); + }, + toAminoMsg(message: QueryParamsResponse): QueryParamsResponseAminoMsg { + return { + type: "cosmos-sdk/QueryParamsResponse", + value: QueryParamsResponse.toAmino(message) + }; + }, + fromProtoMsg(message: QueryParamsResponseProtoMsg): QueryParamsResponse { + return QueryParamsResponse.decode(message.value); + }, + toProto(message: QueryParamsResponse): Uint8Array { + return QueryParamsResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryParamsResponse): QueryParamsResponseProtoMsg { + return { + typeUrl: "/cosmos.consensus.v1.QueryParamsResponse", + value: QueryParamsResponse.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/packages/osmo-query/src/codegen/cosmos/consensus/v1/tx.amino.ts b/packages/osmo-query/src/codegen/cosmos/consensus/v1/tx.amino.ts new file mode 100644 index 000000000..b965006c6 --- /dev/null +++ b/packages/osmo-query/src/codegen/cosmos/consensus/v1/tx.amino.ts @@ -0,0 +1,9 @@ +//@ts-nocheck +import { MsgUpdateParams } from "./tx"; +export const AminoConverter = { + "/cosmos.consensus.v1.MsgUpdateParams": { + aminoType: "cosmos-sdk/MsgUpdateParams", + toAmino: MsgUpdateParams.toAmino, + fromAmino: MsgUpdateParams.fromAmino + } +}; \ No newline at end of file diff --git a/packages/osmo-query/src/codegen/cosmos/consensus/v1/tx.registry.ts b/packages/osmo-query/src/codegen/cosmos/consensus/v1/tx.registry.ts new file mode 100644 index 000000000..5dd24e111 --- /dev/null +++ b/packages/osmo-query/src/codegen/cosmos/consensus/v1/tx.registry.ts @@ -0,0 +1,35 @@ +//@ts-nocheck +import { GeneratedType, Registry } from "@cosmjs/proto-signing"; +import { MsgUpdateParams } from "./tx"; +export const registry: ReadonlyArray<[string, GeneratedType]> = [["/cosmos.consensus.v1.MsgUpdateParams", MsgUpdateParams]]; +export const load = (protoRegistry: Registry) => { + registry.forEach(([typeUrl, mod]) => { + protoRegistry.register(typeUrl, mod); + }); +}; +export const MessageComposer = { + encoded: { + updateParams(value: MsgUpdateParams) { + return { + typeUrl: "/cosmos.consensus.v1.MsgUpdateParams", + value: MsgUpdateParams.encode(value).finish() + }; + } + }, + withTypeUrl: { + updateParams(value: MsgUpdateParams) { + return { + typeUrl: "/cosmos.consensus.v1.MsgUpdateParams", + value + }; + } + }, + fromPartial: { + updateParams(value: MsgUpdateParams) { + return { + typeUrl: "/cosmos.consensus.v1.MsgUpdateParams", + value: MsgUpdateParams.fromPartial(value) + }; + } + } +}; \ No newline at end of file diff --git a/packages/osmo-query/src/codegen/cosmos/consensus/v1/tx.rpc.msg.ts b/packages/osmo-query/src/codegen/cosmos/consensus/v1/tx.rpc.msg.ts new file mode 100644 index 000000000..0ded499ff --- /dev/null +++ b/packages/osmo-query/src/codegen/cosmos/consensus/v1/tx.rpc.msg.ts @@ -0,0 +1,25 @@ +import { Rpc } from "../../../helpers"; +import { BinaryReader } from "../../../binary"; +import { MsgUpdateParams, MsgUpdateParamsResponse } from "./tx"; +/** Msg defines the bank Msg service. */ +export interface Msg { + /** + * UpdateParams defines a governance operation for updating the x/consensus_param module parameters. + * The authority is defined in the keeper. + * + * Since: cosmos-sdk 0.47 + */ + updateParams(request: MsgUpdateParams): Promise; +} +export class MsgClientImpl implements Msg { + private readonly rpc: Rpc; + constructor(rpc: Rpc) { + this.rpc = rpc; + this.updateParams = this.updateParams.bind(this); + } + updateParams(request: MsgUpdateParams): Promise { + const data = MsgUpdateParams.encode(request).finish(); + const promise = this.rpc.request("cosmos.consensus.v1.Msg", "UpdateParams", data); + return promise.then(data => MsgUpdateParamsResponse.decode(new BinaryReader(data))); + } +} \ No newline at end of file diff --git a/packages/osmo-query/src/codegen/cosmos/consensus/v1/tx.ts b/packages/osmo-query/src/codegen/cosmos/consensus/v1/tx.ts new file mode 100644 index 000000000..4c500aa9e --- /dev/null +++ b/packages/osmo-query/src/codegen/cosmos/consensus/v1/tx.ts @@ -0,0 +1,231 @@ +import { BlockParams, BlockParamsAmino, BlockParamsSDKType, EvidenceParams, EvidenceParamsAmino, EvidenceParamsSDKType, ValidatorParams, ValidatorParamsAmino, ValidatorParamsSDKType } from "../../../tendermint/types/params"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +/** MsgUpdateParams is the Msg/UpdateParams request type. */ +export interface MsgUpdateParams { + /** authority is the address that controls the module (defaults to x/gov unless overwritten). */ + authority: string; + /** + * params defines the x/consensus parameters to update. + * VersionsParams is not included in this Msg because it is tracked + * separarately in x/upgrade. + * + * NOTE: All parameters must be supplied. + */ + block?: BlockParams; + evidence?: EvidenceParams; + validator?: ValidatorParams; +} +export interface MsgUpdateParamsProtoMsg { + typeUrl: "/cosmos.consensus.v1.MsgUpdateParams"; + value: Uint8Array; +} +/** MsgUpdateParams is the Msg/UpdateParams request type. */ +export interface MsgUpdateParamsAmino { + /** authority is the address that controls the module (defaults to x/gov unless overwritten). */ + authority?: string; + /** + * params defines the x/consensus parameters to update. + * VersionsParams is not included in this Msg because it is tracked + * separarately in x/upgrade. + * + * NOTE: All parameters must be supplied. + */ + block?: BlockParamsAmino; + evidence?: EvidenceParamsAmino; + validator?: ValidatorParamsAmino; +} +export interface MsgUpdateParamsAminoMsg { + type: "cosmos-sdk/MsgUpdateParams"; + value: MsgUpdateParamsAmino; +} +/** MsgUpdateParams is the Msg/UpdateParams request type. */ +export interface MsgUpdateParamsSDKType { + authority: string; + block?: BlockParamsSDKType; + evidence?: EvidenceParamsSDKType; + validator?: ValidatorParamsSDKType; +} +/** + * MsgUpdateParamsResponse defines the response structure for executing a + * MsgUpdateParams message. + */ +export interface MsgUpdateParamsResponse {} +export interface MsgUpdateParamsResponseProtoMsg { + typeUrl: "/cosmos.consensus.v1.MsgUpdateParamsResponse"; + value: Uint8Array; +} +/** + * MsgUpdateParamsResponse defines the response structure for executing a + * MsgUpdateParams message. + */ +export interface MsgUpdateParamsResponseAmino {} +export interface MsgUpdateParamsResponseAminoMsg { + type: "cosmos-sdk/MsgUpdateParamsResponse"; + value: MsgUpdateParamsResponseAmino; +} +/** + * MsgUpdateParamsResponse defines the response structure for executing a + * MsgUpdateParams message. + */ +export interface MsgUpdateParamsResponseSDKType {} +function createBaseMsgUpdateParams(): MsgUpdateParams { + return { + authority: "", + block: undefined, + evidence: undefined, + validator: undefined + }; +} +export const MsgUpdateParams = { + typeUrl: "/cosmos.consensus.v1.MsgUpdateParams", + encode(message: MsgUpdateParams, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.authority !== "") { + writer.uint32(10).string(message.authority); + } + if (message.block !== undefined) { + BlockParams.encode(message.block, writer.uint32(18).fork()).ldelim(); + } + if (message.evidence !== undefined) { + EvidenceParams.encode(message.evidence, writer.uint32(26).fork()).ldelim(); + } + if (message.validator !== undefined) { + ValidatorParams.encode(message.validator, writer.uint32(34).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgUpdateParams { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUpdateParams(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.authority = reader.string(); + break; + case 2: + message.block = BlockParams.decode(reader, reader.uint32()); + break; + case 3: + message.evidence = EvidenceParams.decode(reader, reader.uint32()); + break; + case 4: + message.validator = ValidatorParams.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgUpdateParams { + const message = createBaseMsgUpdateParams(); + message.authority = object.authority ?? ""; + 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; + return message; + }, + fromAmino(object: MsgUpdateParamsAmino): MsgUpdateParams { + const message = createBaseMsgUpdateParams(); + if (object.authority !== undefined && object.authority !== null) { + message.authority = object.authority; + } + if (object.block !== undefined && object.block !== null) { + message.block = BlockParams.fromAmino(object.block); + } + if (object.evidence !== undefined && object.evidence !== null) { + message.evidence = EvidenceParams.fromAmino(object.evidence); + } + if (object.validator !== undefined && object.validator !== null) { + message.validator = ValidatorParams.fromAmino(object.validator); + } + return message; + }, + toAmino(message: MsgUpdateParams): MsgUpdateParamsAmino { + const obj: any = {}; + obj.authority = message.authority; + obj.block = message.block ? BlockParams.toAmino(message.block) : undefined; + obj.evidence = message.evidence ? EvidenceParams.toAmino(message.evidence) : undefined; + obj.validator = message.validator ? ValidatorParams.toAmino(message.validator) : undefined; + return obj; + }, + fromAminoMsg(object: MsgUpdateParamsAminoMsg): MsgUpdateParams { + return MsgUpdateParams.fromAmino(object.value); + }, + toAminoMsg(message: MsgUpdateParams): MsgUpdateParamsAminoMsg { + return { + type: "cosmos-sdk/MsgUpdateParams", + value: MsgUpdateParams.toAmino(message) + }; + }, + fromProtoMsg(message: MsgUpdateParamsProtoMsg): MsgUpdateParams { + return MsgUpdateParams.decode(message.value); + }, + toProto(message: MsgUpdateParams): Uint8Array { + return MsgUpdateParams.encode(message).finish(); + }, + toProtoMsg(message: MsgUpdateParams): MsgUpdateParamsProtoMsg { + return { + typeUrl: "/cosmos.consensus.v1.MsgUpdateParams", + value: MsgUpdateParams.encode(message).finish() + }; + } +}; +function createBaseMsgUpdateParamsResponse(): MsgUpdateParamsResponse { + return {}; +} +export const MsgUpdateParamsResponse = { + typeUrl: "/cosmos.consensus.v1.MsgUpdateParamsResponse", + encode(_: MsgUpdateParamsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgUpdateParamsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUpdateParamsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): MsgUpdateParamsResponse { + const message = createBaseMsgUpdateParamsResponse(); + return message; + }, + fromAmino(_: MsgUpdateParamsResponseAmino): MsgUpdateParamsResponse { + const message = createBaseMsgUpdateParamsResponse(); + return message; + }, + toAmino(_: MsgUpdateParamsResponse): MsgUpdateParamsResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgUpdateParamsResponseAminoMsg): MsgUpdateParamsResponse { + return MsgUpdateParamsResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgUpdateParamsResponse): MsgUpdateParamsResponseAminoMsg { + return { + type: "cosmos-sdk/MsgUpdateParamsResponse", + value: MsgUpdateParamsResponse.toAmino(message) + }; + }, + fromProtoMsg(message: MsgUpdateParamsResponseProtoMsg): MsgUpdateParamsResponse { + return MsgUpdateParamsResponse.decode(message.value); + }, + toProto(message: MsgUpdateParamsResponse): Uint8Array { + return MsgUpdateParamsResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgUpdateParamsResponse): MsgUpdateParamsResponseProtoMsg { + return { + typeUrl: "/cosmos.consensus.v1.MsgUpdateParamsResponse", + value: MsgUpdateParamsResponse.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/packages/osmo-query/src/codegen/cosmos/crypto/ed25519/keys.ts b/packages/osmo-query/src/codegen/cosmos/crypto/ed25519/keys.ts index 41183b75d..cc5ab396a 100644 --- a/packages/osmo-query/src/codegen/cosmos/crypto/ed25519/keys.ts +++ b/packages/osmo-query/src/codegen/cosmos/crypto/ed25519/keys.ts @@ -1,4 +1,5 @@ import { BinaryReader, BinaryWriter } from "../../../binary"; +import { bytesFromBase64, base64FromBytes } from "../../../helpers"; /** * PubKey is an ed25519 public key for handling Tendermint keys in SDK. * It's needed for Any serialization and SDK compatibility. @@ -21,7 +22,7 @@ export interface PubKeyProtoMsg { * then you must create a new proto message and follow ADR-28 for Address construction. */ export interface PubKeyAmino { - key: Uint8Array; + key?: string; } export interface PubKeyAminoMsg { type: "tendermint/PubKeyEd25519"; @@ -53,7 +54,7 @@ export interface PrivKeyProtoMsg { * NOTE: ed25519 keys must not be used in SDK apps except in a tendermint validator context. */ export interface PrivKeyAmino { - key: Uint8Array; + key?: string; } export interface PrivKeyAminoMsg { type: "tendermint/PrivKeyEd25519"; @@ -102,13 +103,15 @@ export const PubKey = { return message; }, fromAmino(object: PubKeyAmino): PubKey { - return { - key: object.key - }; + const message = createBasePubKey(); + if (object.key !== undefined && object.key !== null) { + message.key = bytesFromBase64(object.key); + } + return message; }, toAmino(message: PubKey): PubKeyAmino { const obj: any = {}; - obj.key = message.key; + obj.key = message.key ? base64FromBytes(message.key) : undefined; return obj; }, fromAminoMsg(object: PubKeyAminoMsg): PubKey { @@ -169,13 +172,15 @@ export const PrivKey = { return message; }, fromAmino(object: PrivKeyAmino): PrivKey { - return { - key: object.key - }; + const message = createBasePrivKey(); + if (object.key !== undefined && object.key !== null) { + message.key = bytesFromBase64(object.key); + } + return message; }, toAmino(message: PrivKey): PrivKeyAmino { const obj: any = {}; - obj.key = message.key; + obj.key = message.key ? base64FromBytes(message.key) : undefined; return obj; }, fromAminoMsg(object: PrivKeyAminoMsg): PrivKey { diff --git a/packages/osmo-query/src/codegen/cosmos/crypto/hd/v1/hd.ts b/packages/osmo-query/src/codegen/cosmos/crypto/hd/v1/hd.ts new file mode 100644 index 000000000..ab7cd1654 --- /dev/null +++ b/packages/osmo-query/src/codegen/cosmos/crypto/hd/v1/hd.ts @@ -0,0 +1,166 @@ +import { BinaryReader, BinaryWriter } from "../../../../binary"; +/** BIP44Params is used as path field in ledger item in Record. */ +export interface BIP44Params { + /** purpose is a constant set to 44' (or 0x8000002C) following the BIP43 recommendation */ + purpose: number; + /** coin_type is a constant that improves privacy */ + coinType: number; + /** account splits the key space into independent user identities */ + account: number; + /** + * change is a constant used for public derivation. Constant 0 is used for external chain and constant 1 for internal + * chain. + */ + change: boolean; + /** address_index is used as child index in BIP32 derivation */ + addressIndex: number; +} +export interface BIP44ParamsProtoMsg { + typeUrl: "/cosmos.crypto.hd.v1.BIP44Params"; + value: Uint8Array; +} +/** BIP44Params is used as path field in ledger item in Record. */ +export interface BIP44ParamsAmino { + /** purpose is a constant set to 44' (or 0x8000002C) following the BIP43 recommendation */ + purpose?: number; + /** coin_type is a constant that improves privacy */ + coin_type?: number; + /** account splits the key space into independent user identities */ + account?: number; + /** + * change is a constant used for public derivation. Constant 0 is used for external chain and constant 1 for internal + * chain. + */ + change?: boolean; + /** address_index is used as child index in BIP32 derivation */ + address_index?: number; +} +export interface BIP44ParamsAminoMsg { + type: "crypto/keys/hd/BIP44Params"; + value: BIP44ParamsAmino; +} +/** BIP44Params is used as path field in ledger item in Record. */ +export interface BIP44ParamsSDKType { + purpose: number; + coin_type: number; + account: number; + change: boolean; + address_index: number; +} +function createBaseBIP44Params(): BIP44Params { + return { + purpose: 0, + coinType: 0, + account: 0, + change: false, + addressIndex: 0 + }; +} +export const BIP44Params = { + typeUrl: "/cosmos.crypto.hd.v1.BIP44Params", + encode(message: BIP44Params, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.purpose !== 0) { + writer.uint32(8).uint32(message.purpose); + } + if (message.coinType !== 0) { + writer.uint32(16).uint32(message.coinType); + } + if (message.account !== 0) { + writer.uint32(24).uint32(message.account); + } + if (message.change === true) { + writer.uint32(32).bool(message.change); + } + if (message.addressIndex !== 0) { + writer.uint32(40).uint32(message.addressIndex); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): BIP44Params { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseBIP44Params(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.purpose = reader.uint32(); + break; + case 2: + message.coinType = reader.uint32(); + break; + case 3: + message.account = reader.uint32(); + break; + case 4: + message.change = reader.bool(); + break; + case 5: + message.addressIndex = reader.uint32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): BIP44Params { + const message = createBaseBIP44Params(); + message.purpose = object.purpose ?? 0; + message.coinType = object.coinType ?? 0; + message.account = object.account ?? 0; + message.change = object.change ?? false; + message.addressIndex = object.addressIndex ?? 0; + return message; + }, + fromAmino(object: BIP44ParamsAmino): BIP44Params { + const message = createBaseBIP44Params(); + if (object.purpose !== undefined && object.purpose !== null) { + message.purpose = object.purpose; + } + if (object.coin_type !== undefined && object.coin_type !== null) { + message.coinType = object.coin_type; + } + if (object.account !== undefined && object.account !== null) { + message.account = object.account; + } + if (object.change !== undefined && object.change !== null) { + message.change = object.change; + } + if (object.address_index !== undefined && object.address_index !== null) { + message.addressIndex = object.address_index; + } + return message; + }, + toAmino(message: BIP44Params): BIP44ParamsAmino { + const obj: any = {}; + obj.purpose = message.purpose; + obj.coin_type = message.coinType; + obj.account = message.account; + obj.change = message.change; + obj.address_index = message.addressIndex; + return obj; + }, + fromAminoMsg(object: BIP44ParamsAminoMsg): BIP44Params { + return BIP44Params.fromAmino(object.value); + }, + toAminoMsg(message: BIP44Params): BIP44ParamsAminoMsg { + return { + type: "crypto/keys/hd/BIP44Params", + value: BIP44Params.toAmino(message) + }; + }, + fromProtoMsg(message: BIP44ParamsProtoMsg): BIP44Params { + return BIP44Params.decode(message.value); + }, + toProto(message: BIP44Params): Uint8Array { + return BIP44Params.encode(message).finish(); + }, + toProtoMsg(message: BIP44Params): BIP44ParamsProtoMsg { + return { + typeUrl: "/cosmos.crypto.hd.v1.BIP44Params", + value: BIP44Params.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/packages/osmo-query/src/codegen/cosmos/crypto/keyring/v1/record.ts b/packages/osmo-query/src/codegen/cosmos/crypto/keyring/v1/record.ts new file mode 100644 index 000000000..d67446d08 --- /dev/null +++ b/packages/osmo-query/src/codegen/cosmos/crypto/keyring/v1/record.ts @@ -0,0 +1,506 @@ +import { Any, AnyAmino, AnySDKType } from "../../../../google/protobuf/any"; +import { BIP44Params, BIP44ParamsAmino, BIP44ParamsSDKType } from "../../hd/v1/hd"; +import { BinaryReader, BinaryWriter } from "../../../../binary"; +/** Record is used for representing a key in the keyring. */ +export interface Record { + /** name represents a name of Record */ + name: string; + /** pub_key represents a public key in any format */ + pubKey?: Any; + /** local stores the private key locally. */ + local?: Record_Local; + /** ledger stores the information about a Ledger key. */ + ledger?: Record_Ledger; + /** Multi does not store any other information. */ + multi?: Record_Multi; + /** Offline does not store any other information. */ + offline?: Record_Offline; +} +export interface RecordProtoMsg { + typeUrl: "/cosmos.crypto.keyring.v1.Record"; + value: Uint8Array; +} +/** Record is used for representing a key in the keyring. */ +export interface RecordAmino { + /** name represents a name of Record */ + name?: string; + /** pub_key represents a public key in any format */ + pub_key?: AnyAmino; + /** local stores the private key locally. */ + local?: Record_LocalAmino; + /** ledger stores the information about a Ledger key. */ + ledger?: Record_LedgerAmino; + /** Multi does not store any other information. */ + multi?: Record_MultiAmino; + /** Offline does not store any other information. */ + offline?: Record_OfflineAmino; +} +export interface RecordAminoMsg { + type: "cosmos-sdk/Record"; + value: RecordAmino; +} +/** Record is used for representing a key in the keyring. */ +export interface RecordSDKType { + name: string; + pub_key?: AnySDKType; + local?: Record_LocalSDKType; + ledger?: Record_LedgerSDKType; + multi?: Record_MultiSDKType; + offline?: Record_OfflineSDKType; +} +/** + * Item is a keyring item stored in a keyring backend. + * Local item + */ +export interface Record_Local { + privKey?: Any; +} +export interface Record_LocalProtoMsg { + typeUrl: "/cosmos.crypto.keyring.v1.Local"; + value: Uint8Array; +} +/** + * Item is a keyring item stored in a keyring backend. + * Local item + */ +export interface Record_LocalAmino { + priv_key?: AnyAmino; +} +export interface Record_LocalAminoMsg { + type: "cosmos-sdk/Local"; + value: Record_LocalAmino; +} +/** + * Item is a keyring item stored in a keyring backend. + * Local item + */ +export interface Record_LocalSDKType { + priv_key?: AnySDKType; +} +/** Ledger item */ +export interface Record_Ledger { + path?: BIP44Params; +} +export interface Record_LedgerProtoMsg { + typeUrl: "/cosmos.crypto.keyring.v1.Ledger"; + value: Uint8Array; +} +/** Ledger item */ +export interface Record_LedgerAmino { + path?: BIP44ParamsAmino; +} +export interface Record_LedgerAminoMsg { + type: "cosmos-sdk/Ledger"; + value: Record_LedgerAmino; +} +/** Ledger item */ +export interface Record_LedgerSDKType { + path?: BIP44ParamsSDKType; +} +/** Multi item */ +export interface Record_Multi {} +export interface Record_MultiProtoMsg { + typeUrl: "/cosmos.crypto.keyring.v1.Multi"; + value: Uint8Array; +} +/** Multi item */ +export interface Record_MultiAmino {} +export interface Record_MultiAminoMsg { + type: "cosmos-sdk/Multi"; + value: Record_MultiAmino; +} +/** Multi item */ +export interface Record_MultiSDKType {} +/** Offline item */ +export interface Record_Offline {} +export interface Record_OfflineProtoMsg { + typeUrl: "/cosmos.crypto.keyring.v1.Offline"; + value: Uint8Array; +} +/** Offline item */ +export interface Record_OfflineAmino {} +export interface Record_OfflineAminoMsg { + type: "cosmos-sdk/Offline"; + value: Record_OfflineAmino; +} +/** Offline item */ +export interface Record_OfflineSDKType {} +function createBaseRecord(): Record { + return { + name: "", + pubKey: undefined, + local: undefined, + ledger: undefined, + multi: undefined, + offline: undefined + }; +} +export const Record = { + typeUrl: "/cosmos.crypto.keyring.v1.Record", + encode(message: Record, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.name !== "") { + writer.uint32(10).string(message.name); + } + if (message.pubKey !== undefined) { + Any.encode(message.pubKey, writer.uint32(18).fork()).ldelim(); + } + if (message.local !== undefined) { + Record_Local.encode(message.local, writer.uint32(26).fork()).ldelim(); + } + if (message.ledger !== undefined) { + Record_Ledger.encode(message.ledger, writer.uint32(34).fork()).ldelim(); + } + if (message.multi !== undefined) { + Record_Multi.encode(message.multi, writer.uint32(42).fork()).ldelim(); + } + if (message.offline !== undefined) { + Record_Offline.encode(message.offline, writer.uint32(50).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): Record { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseRecord(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.pubKey = Any.decode(reader, reader.uint32()); + break; + case 3: + message.local = Record_Local.decode(reader, reader.uint32()); + break; + case 4: + message.ledger = Record_Ledger.decode(reader, reader.uint32()); + break; + case 5: + message.multi = Record_Multi.decode(reader, reader.uint32()); + break; + case 6: + message.offline = Record_Offline.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): Record { + const message = createBaseRecord(); + message.name = object.name ?? ""; + message.pubKey = object.pubKey !== undefined && object.pubKey !== null ? Any.fromPartial(object.pubKey) : undefined; + message.local = object.local !== undefined && object.local !== null ? Record_Local.fromPartial(object.local) : undefined; + message.ledger = object.ledger !== undefined && object.ledger !== null ? Record_Ledger.fromPartial(object.ledger) : undefined; + message.multi = object.multi !== undefined && object.multi !== null ? Record_Multi.fromPartial(object.multi) : undefined; + message.offline = object.offline !== undefined && object.offline !== null ? Record_Offline.fromPartial(object.offline) : undefined; + return message; + }, + fromAmino(object: RecordAmino): Record { + const message = createBaseRecord(); + if (object.name !== undefined && object.name !== null) { + message.name = object.name; + } + if (object.pub_key !== undefined && object.pub_key !== null) { + message.pubKey = Any.fromAmino(object.pub_key); + } + if (object.local !== undefined && object.local !== null) { + message.local = Record_Local.fromAmino(object.local); + } + if (object.ledger !== undefined && object.ledger !== null) { + message.ledger = Record_Ledger.fromAmino(object.ledger); + } + if (object.multi !== undefined && object.multi !== null) { + message.multi = Record_Multi.fromAmino(object.multi); + } + if (object.offline !== undefined && object.offline !== null) { + message.offline = Record_Offline.fromAmino(object.offline); + } + return message; + }, + toAmino(message: Record): RecordAmino { + const obj: any = {}; + obj.name = message.name; + obj.pub_key = message.pubKey ? Any.toAmino(message.pubKey) : undefined; + obj.local = message.local ? Record_Local.toAmino(message.local) : undefined; + obj.ledger = message.ledger ? Record_Ledger.toAmino(message.ledger) : undefined; + obj.multi = message.multi ? Record_Multi.toAmino(message.multi) : undefined; + obj.offline = message.offline ? Record_Offline.toAmino(message.offline) : undefined; + return obj; + }, + fromAminoMsg(object: RecordAminoMsg): Record { + return Record.fromAmino(object.value); + }, + toAminoMsg(message: Record): RecordAminoMsg { + return { + type: "cosmos-sdk/Record", + value: Record.toAmino(message) + }; + }, + fromProtoMsg(message: RecordProtoMsg): Record { + return Record.decode(message.value); + }, + toProto(message: Record): Uint8Array { + return Record.encode(message).finish(); + }, + toProtoMsg(message: Record): RecordProtoMsg { + return { + typeUrl: "/cosmos.crypto.keyring.v1.Record", + value: Record.encode(message).finish() + }; + } +}; +function createBaseRecord_Local(): Record_Local { + return { + privKey: undefined + }; +} +export const Record_Local = { + typeUrl: "/cosmos.crypto.keyring.v1.Local", + encode(message: Record_Local, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.privKey !== undefined) { + Any.encode(message.privKey, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): Record_Local { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseRecord_Local(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.privKey = Any.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): Record_Local { + const message = createBaseRecord_Local(); + message.privKey = object.privKey !== undefined && object.privKey !== null ? Any.fromPartial(object.privKey) : undefined; + return message; + }, + fromAmino(object: Record_LocalAmino): Record_Local { + const message = createBaseRecord_Local(); + if (object.priv_key !== undefined && object.priv_key !== null) { + message.privKey = Any.fromAmino(object.priv_key); + } + return message; + }, + toAmino(message: Record_Local): Record_LocalAmino { + const obj: any = {}; + obj.priv_key = message.privKey ? Any.toAmino(message.privKey) : undefined; + return obj; + }, + fromAminoMsg(object: Record_LocalAminoMsg): Record_Local { + return Record_Local.fromAmino(object.value); + }, + toAminoMsg(message: Record_Local): Record_LocalAminoMsg { + return { + type: "cosmos-sdk/Local", + value: Record_Local.toAmino(message) + }; + }, + fromProtoMsg(message: Record_LocalProtoMsg): Record_Local { + return Record_Local.decode(message.value); + }, + toProto(message: Record_Local): Uint8Array { + return Record_Local.encode(message).finish(); + }, + toProtoMsg(message: Record_Local): Record_LocalProtoMsg { + return { + typeUrl: "/cosmos.crypto.keyring.v1.Local", + value: Record_Local.encode(message).finish() + }; + } +}; +function createBaseRecord_Ledger(): Record_Ledger { + return { + path: undefined + }; +} +export const Record_Ledger = { + typeUrl: "/cosmos.crypto.keyring.v1.Ledger", + encode(message: Record_Ledger, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.path !== undefined) { + BIP44Params.encode(message.path, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): Record_Ledger { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseRecord_Ledger(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.path = BIP44Params.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): Record_Ledger { + const message = createBaseRecord_Ledger(); + message.path = object.path !== undefined && object.path !== null ? BIP44Params.fromPartial(object.path) : undefined; + return message; + }, + fromAmino(object: Record_LedgerAmino): Record_Ledger { + const message = createBaseRecord_Ledger(); + if (object.path !== undefined && object.path !== null) { + message.path = BIP44Params.fromAmino(object.path); + } + return message; + }, + toAmino(message: Record_Ledger): Record_LedgerAmino { + const obj: any = {}; + obj.path = message.path ? BIP44Params.toAmino(message.path) : undefined; + return obj; + }, + fromAminoMsg(object: Record_LedgerAminoMsg): Record_Ledger { + return Record_Ledger.fromAmino(object.value); + }, + toAminoMsg(message: Record_Ledger): Record_LedgerAminoMsg { + return { + type: "cosmos-sdk/Ledger", + value: Record_Ledger.toAmino(message) + }; + }, + fromProtoMsg(message: Record_LedgerProtoMsg): Record_Ledger { + return Record_Ledger.decode(message.value); + }, + toProto(message: Record_Ledger): Uint8Array { + return Record_Ledger.encode(message).finish(); + }, + toProtoMsg(message: Record_Ledger): Record_LedgerProtoMsg { + return { + typeUrl: "/cosmos.crypto.keyring.v1.Ledger", + value: Record_Ledger.encode(message).finish() + }; + } +}; +function createBaseRecord_Multi(): Record_Multi { + return {}; +} +export const Record_Multi = { + typeUrl: "/cosmos.crypto.keyring.v1.Multi", + encode(_: Record_Multi, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): Record_Multi { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseRecord_Multi(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): Record_Multi { + const message = createBaseRecord_Multi(); + return message; + }, + fromAmino(_: Record_MultiAmino): Record_Multi { + const message = createBaseRecord_Multi(); + return message; + }, + toAmino(_: Record_Multi): Record_MultiAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: Record_MultiAminoMsg): Record_Multi { + return Record_Multi.fromAmino(object.value); + }, + toAminoMsg(message: Record_Multi): Record_MultiAminoMsg { + return { + type: "cosmos-sdk/Multi", + value: Record_Multi.toAmino(message) + }; + }, + fromProtoMsg(message: Record_MultiProtoMsg): Record_Multi { + return Record_Multi.decode(message.value); + }, + toProto(message: Record_Multi): Uint8Array { + return Record_Multi.encode(message).finish(); + }, + toProtoMsg(message: Record_Multi): Record_MultiProtoMsg { + return { + typeUrl: "/cosmos.crypto.keyring.v1.Multi", + value: Record_Multi.encode(message).finish() + }; + } +}; +function createBaseRecord_Offline(): Record_Offline { + return {}; +} +export const Record_Offline = { + typeUrl: "/cosmos.crypto.keyring.v1.Offline", + encode(_: Record_Offline, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): Record_Offline { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseRecord_Offline(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): Record_Offline { + const message = createBaseRecord_Offline(); + return message; + }, + fromAmino(_: Record_OfflineAmino): Record_Offline { + const message = createBaseRecord_Offline(); + return message; + }, + toAmino(_: Record_Offline): Record_OfflineAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: Record_OfflineAminoMsg): Record_Offline { + return Record_Offline.fromAmino(object.value); + }, + toAminoMsg(message: Record_Offline): Record_OfflineAminoMsg { + return { + type: "cosmos-sdk/Offline", + value: Record_Offline.toAmino(message) + }; + }, + fromProtoMsg(message: Record_OfflineProtoMsg): Record_Offline { + return Record_Offline.decode(message.value); + }, + toProto(message: Record_Offline): Uint8Array { + return Record_Offline.encode(message).finish(); + }, + toProtoMsg(message: Record_Offline): Record_OfflineProtoMsg { + return { + typeUrl: "/cosmos.crypto.keyring.v1.Offline", + value: Record_Offline.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/packages/osmo-query/src/codegen/cosmos/crypto/multisig/keys.ts b/packages/osmo-query/src/codegen/cosmos/crypto/multisig/keys.ts index 0bae8b06f..8c53c2e35 100644 --- a/packages/osmo-query/src/codegen/cosmos/crypto/multisig/keys.ts +++ b/packages/osmo-query/src/codegen/cosmos/crypto/multisig/keys.ts @@ -19,8 +19,8 @@ export interface LegacyAminoPubKeyProtoMsg { * it uses legacy amino address rules. */ export interface LegacyAminoPubKeyAmino { - threshold: number; - public_keys: AnyAmino[]; + threshold?: number; + public_keys?: AnyAmino[]; } export interface LegacyAminoPubKeyAminoMsg { type: "tendermint/PubKeyMultisigThreshold"; @@ -79,10 +79,12 @@ export const LegacyAminoPubKey = { return message; }, fromAmino(object: LegacyAminoPubKeyAmino): LegacyAminoPubKey { - return { - threshold: object.threshold, - publicKeys: Array.isArray(object?.public_keys) ? object.public_keys.map((e: any) => Any.fromAmino(e)) : [] - }; + const message = createBaseLegacyAminoPubKey(); + if (object.threshold !== undefined && object.threshold !== null) { + message.threshold = object.threshold; + } + message.publicKeys = object.public_keys?.map(e => Any.fromAmino(e)) || []; + return message; }, toAmino(message: LegacyAminoPubKey): LegacyAminoPubKeyAmino { const obj: any = {}; diff --git a/packages/osmo-query/src/codegen/cosmos/crypto/multisig/v1beta1/multisig.ts b/packages/osmo-query/src/codegen/cosmos/crypto/multisig/v1beta1/multisig.ts index 9ab89d1dc..ef28ae164 100644 --- a/packages/osmo-query/src/codegen/cosmos/crypto/multisig/v1beta1/multisig.ts +++ b/packages/osmo-query/src/codegen/cosmos/crypto/multisig/v1beta1/multisig.ts @@ -1,4 +1,5 @@ import { BinaryReader, BinaryWriter } from "../../../../binary"; +import { bytesFromBase64, base64FromBytes } from "../../../../helpers"; /** * MultiSignature wraps the signatures from a multisig.LegacyAminoPubKey. * See cosmos.tx.v1betata1.ModeInfo.Multi for how to specify which signers @@ -17,7 +18,7 @@ export interface MultiSignatureProtoMsg { * signed and with which modes. */ export interface MultiSignatureAmino { - signatures: Uint8Array[]; + signatures?: string[]; } export interface MultiSignatureAminoMsg { type: "cosmos-sdk/MultiSignature"; @@ -52,8 +53,8 @@ export interface CompactBitArrayProtoMsg { * This is not thread safe, and is not intended for concurrent usage. */ export interface CompactBitArrayAmino { - extra_bits_stored: number; - elems: Uint8Array; + extra_bits_stored?: number; + elems?: string; } export interface CompactBitArrayAminoMsg { type: "cosmos-sdk/CompactBitArray"; @@ -105,14 +106,14 @@ export const MultiSignature = { return message; }, fromAmino(object: MultiSignatureAmino): MultiSignature { - return { - signatures: Array.isArray(object?.signatures) ? object.signatures.map((e: any) => e) : [] - }; + const message = createBaseMultiSignature(); + message.signatures = object.signatures?.map(e => bytesFromBase64(e)) || []; + return message; }, toAmino(message: MultiSignature): MultiSignatureAmino { const obj: any = {}; if (message.signatures) { - obj.signatures = message.signatures.map(e => e); + obj.signatures = message.signatures.map(e => base64FromBytes(e)); } else { obj.signatures = []; } @@ -184,15 +185,19 @@ export const CompactBitArray = { return message; }, fromAmino(object: CompactBitArrayAmino): CompactBitArray { - return { - extraBitsStored: object.extra_bits_stored, - elems: object.elems - }; + const message = createBaseCompactBitArray(); + if (object.extra_bits_stored !== undefined && object.extra_bits_stored !== null) { + message.extraBitsStored = object.extra_bits_stored; + } + if (object.elems !== undefined && object.elems !== null) { + message.elems = bytesFromBase64(object.elems); + } + return message; }, toAmino(message: CompactBitArray): CompactBitArrayAmino { const obj: any = {}; obj.extra_bits_stored = message.extraBitsStored; - obj.elems = message.elems; + obj.elems = message.elems ? base64FromBytes(message.elems) : undefined; return obj; }, fromAminoMsg(object: CompactBitArrayAminoMsg): CompactBitArray { diff --git a/packages/osmo-query/src/codegen/cosmos/crypto/secp256k1/keys.ts b/packages/osmo-query/src/codegen/cosmos/crypto/secp256k1/keys.ts index 9feac35fb..24433eec6 100644 --- a/packages/osmo-query/src/codegen/cosmos/crypto/secp256k1/keys.ts +++ b/packages/osmo-query/src/codegen/cosmos/crypto/secp256k1/keys.ts @@ -1,4 +1,5 @@ import { BinaryReader, BinaryWriter } from "../../../binary"; +import { bytesFromBase64, base64FromBytes } from "../../../helpers"; /** * PubKey defines a secp256k1 public key * Key is the compressed form of the pubkey. The first byte depends is a 0x02 byte @@ -21,7 +22,7 @@ export interface PubKeyProtoMsg { * This prefix is followed with the x-coordinate. */ export interface PubKeyAmino { - key: Uint8Array; + key?: string; } export interface PubKeyAminoMsg { type: "tendermint/PubKeySecp256k1"; @@ -47,7 +48,7 @@ export interface PrivKeyProtoMsg { } /** PrivKey defines a secp256k1 private key. */ export interface PrivKeyAmino { - key: Uint8Array; + key?: string; } export interface PrivKeyAminoMsg { type: "tendermint/PrivKeySecp256k1"; @@ -93,13 +94,15 @@ export const PubKey = { return message; }, fromAmino(object: PubKeyAmino): PubKey { - return { - key: object.key - }; + const message = createBasePubKey(); + if (object.key !== undefined && object.key !== null) { + message.key = bytesFromBase64(object.key); + } + return message; }, toAmino(message: PubKey): PubKeyAmino { const obj: any = {}; - obj.key = message.key; + obj.key = message.key ? base64FromBytes(message.key) : undefined; return obj; }, fromAminoMsg(object: PubKeyAminoMsg): PubKey { @@ -160,13 +163,15 @@ export const PrivKey = { return message; }, fromAmino(object: PrivKeyAmino): PrivKey { - return { - key: object.key - }; + const message = createBasePrivKey(); + if (object.key !== undefined && object.key !== null) { + message.key = bytesFromBase64(object.key); + } + return message; }, toAmino(message: PrivKey): PrivKeyAmino { const obj: any = {}; - obj.key = message.key; + obj.key = message.key ? base64FromBytes(message.key) : undefined; return obj; }, fromAminoMsg(object: PrivKeyAminoMsg): PrivKey { diff --git a/packages/osmo-query/src/codegen/cosmos/crypto/secp256r1/keys.ts b/packages/osmo-query/src/codegen/cosmos/crypto/secp256r1/keys.ts index 4888b054b..ae95f6140 100644 --- a/packages/osmo-query/src/codegen/cosmos/crypto/secp256r1/keys.ts +++ b/packages/osmo-query/src/codegen/cosmos/crypto/secp256r1/keys.ts @@ -1,4 +1,5 @@ import { BinaryReader, BinaryWriter } from "../../../binary"; +import { bytesFromBase64, base64FromBytes } from "../../../helpers"; /** PubKey defines a secp256r1 ECDSA public key. */ export interface PubKey { /** @@ -17,7 +18,7 @@ export interface PubKeyAmino { * 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?: string; } export interface PubKeyAminoMsg { type: "cosmos-sdk/PubKey"; @@ -39,7 +40,7 @@ export interface PrivKeyProtoMsg { /** PrivKey defines a secp256r1 ECDSA private key. */ export interface PrivKeyAmino { /** secret number serialized using big-endian encoding */ - secret: Uint8Array; + secret?: string; } export interface PrivKeyAminoMsg { type: "cosmos-sdk/PrivKey"; @@ -85,13 +86,15 @@ export const PubKey = { return message; }, fromAmino(object: PubKeyAmino): PubKey { - return { - key: object.key - }; + const message = createBasePubKey(); + if (object.key !== undefined && object.key !== null) { + message.key = bytesFromBase64(object.key); + } + return message; }, toAmino(message: PubKey): PubKeyAmino { const obj: any = {}; - obj.key = message.key; + obj.key = message.key ? base64FromBytes(message.key) : undefined; return obj; }, fromAminoMsg(object: PubKeyAminoMsg): PubKey { @@ -152,13 +155,15 @@ export const PrivKey = { return message; }, fromAmino(object: PrivKeyAmino): PrivKey { - return { - secret: object.secret - }; + const message = createBasePrivKey(); + if (object.secret !== undefined && object.secret !== null) { + message.secret = bytesFromBase64(object.secret); + } + return message; }, toAmino(message: PrivKey): PrivKeyAmino { const obj: any = {}; - obj.secret = message.secret; + obj.secret = message.secret ? base64FromBytes(message.secret) : undefined; return obj; }, fromAminoMsg(object: PrivKeyAminoMsg): PrivKey { diff --git a/packages/osmo-query/src/codegen/cosmos/distribution/v1beta1/distribution.ts b/packages/osmo-query/src/codegen/cosmos/distribution/v1beta1/distribution.ts index cae54cb14..268f8e3dc 100644 --- a/packages/osmo-query/src/codegen/cosmos/distribution/v1beta1/distribution.ts +++ b/packages/osmo-query/src/codegen/cosmos/distribution/v1beta1/distribution.ts @@ -4,7 +4,17 @@ import { Decimal } from "@cosmjs/math"; /** Params defines the set of params for the distribution module. */ export interface Params { communityTax: string; + /** + * Deprecated: The base_proposer_reward field is deprecated and is no longer used + * in the x/distribution module's reward mechanism. + */ + /** @deprecated */ baseProposerReward: string; + /** + * Deprecated: The bonus_proposer_reward field is deprecated and is no longer used + * in the x/distribution module's reward mechanism. + */ + /** @deprecated */ bonusProposerReward: string; withdrawAddrEnabled: boolean; } @@ -14,10 +24,20 @@ export interface ParamsProtoMsg { } /** Params defines the set of params for the distribution module. */ export interface ParamsAmino { - community_tax: string; - base_proposer_reward: string; - bonus_proposer_reward: string; - withdraw_addr_enabled: boolean; + community_tax?: string; + /** + * Deprecated: The base_proposer_reward field is deprecated and is no longer used + * in the x/distribution module's reward mechanism. + */ + /** @deprecated */ + base_proposer_reward?: string; + /** + * Deprecated: The bonus_proposer_reward field is deprecated and is no longer used + * in the x/distribution module's reward mechanism. + */ + /** @deprecated */ + bonus_proposer_reward?: string; + withdraw_addr_enabled?: boolean; } export interface ParamsAminoMsg { type: "cosmos-sdk/x/distribution/Params"; @@ -26,7 +46,9 @@ export interface ParamsAminoMsg { /** Params defines the set of params for the distribution module. */ export interface ParamsSDKType { community_tax: string; + /** @deprecated */ base_proposer_reward: string; + /** @deprecated */ bonus_proposer_reward: string; withdraw_addr_enabled: boolean; } @@ -68,7 +90,7 @@ export interface ValidatorHistoricalRewardsProtoMsg { */ export interface ValidatorHistoricalRewardsAmino { cumulative_reward_ratio: DecCoinAmino[]; - reference_count: number; + reference_count?: number; } export interface ValidatorHistoricalRewardsAminoMsg { type: "cosmos-sdk/ValidatorHistoricalRewards"; @@ -112,7 +134,7 @@ export interface ValidatorCurrentRewardsProtoMsg { */ export interface ValidatorCurrentRewardsAmino { rewards: DecCoinAmino[]; - period: string; + period?: string; } export interface ValidatorCurrentRewardsAminoMsg { type: "cosmos-sdk/ValidatorCurrentRewards"; @@ -206,8 +228,8 @@ export interface ValidatorSlashEventProtoMsg { * for delegations which are withdrawn after a slash has occurred. */ export interface ValidatorSlashEventAmino { - validator_period: string; - fraction: string; + validator_period?: string; + fraction?: string; } export interface ValidatorSlashEventAminoMsg { type: "cosmos-sdk/ValidatorSlashEvent"; @@ -267,8 +289,15 @@ export interface FeePoolSDKType { * CommunityPoolSpendProposal details a proposal for use of community funds, * together with how many coins are proposed to be spent, and to which * recipient account. + * + * Deprecated: Do not use. As of the Cosmos SDK release v0.47.x, there is no + * longer a need for an explicit CommunityPoolSpendProposal. To spend community + * pool funds, a simple MsgCommunityPoolSpend can be invoked from the x/gov + * module via a v1 governance proposal. */ +/** @deprecated */ export interface CommunityPoolSpendProposal { + $typeUrl?: "/cosmos.distribution.v1beta1.CommunityPoolSpendProposal"; title: string; description: string; recipient: string; @@ -282,11 +311,17 @@ export interface CommunityPoolSpendProposalProtoMsg { * CommunityPoolSpendProposal details a proposal for use of community funds, * together with how many coins are proposed to be spent, and to which * recipient account. + * + * Deprecated: Do not use. As of the Cosmos SDK release v0.47.x, there is no + * longer a need for an explicit CommunityPoolSpendProposal. To spend community + * pool funds, a simple MsgCommunityPoolSpend can be invoked from the x/gov + * module via a v1 governance proposal. */ +/** @deprecated */ export interface CommunityPoolSpendProposalAmino { - title: string; - description: string; - recipient: string; + title?: string; + description?: string; + recipient?: string; amount: CoinAmino[]; } export interface CommunityPoolSpendProposalAminoMsg { @@ -297,8 +332,15 @@ export interface CommunityPoolSpendProposalAminoMsg { * CommunityPoolSpendProposal details a proposal for use of community funds, * together with how many coins are proposed to be spent, and to which * recipient account. + * + * Deprecated: Do not use. As of the Cosmos SDK release v0.47.x, there is no + * longer a need for an explicit CommunityPoolSpendProposal. To spend community + * pool funds, a simple MsgCommunityPoolSpend can be invoked from the x/gov + * module via a v1 governance proposal. */ +/** @deprecated */ export interface CommunityPoolSpendProposalSDKType { + $typeUrl?: "/cosmos.distribution.v1beta1.CommunityPoolSpendProposal"; title: string; description: string; recipient: string; @@ -330,8 +372,8 @@ export interface DelegatorStartingInfoProtoMsg { * thus sdk.Dec is used. */ export interface DelegatorStartingInfoAmino { - previous_period: string; - stake: string; + previous_period?: string; + stake?: string; height: string; } export interface DelegatorStartingInfoAminoMsg { @@ -368,7 +410,7 @@ export interface DelegationDelegatorRewardProtoMsg { * of a delegator's delegation reward. */ export interface DelegationDelegatorRewardAmino { - validator_address: string; + validator_address?: string; reward: DecCoinAmino[]; } export interface DelegationDelegatorRewardAminoMsg { @@ -388,6 +430,7 @@ export interface DelegationDelegatorRewardSDKType { * with a deposit */ export interface CommunityPoolSpendProposalWithDeposit { + $typeUrl?: "/cosmos.distribution.v1beta1.CommunityPoolSpendProposalWithDeposit"; title: string; description: string; recipient: string; @@ -403,11 +446,11 @@ export interface CommunityPoolSpendProposalWithDepositProtoMsg { * with a deposit */ export interface CommunityPoolSpendProposalWithDepositAmino { - title: string; - description: string; - recipient: string; - amount: string; - deposit: string; + title?: string; + description?: string; + recipient?: string; + amount?: string; + deposit?: string; } export interface CommunityPoolSpendProposalWithDepositAminoMsg { type: "cosmos-sdk/CommunityPoolSpendProposalWithDeposit"; @@ -418,6 +461,7 @@ export interface CommunityPoolSpendProposalWithDepositAminoMsg { * with a deposit */ export interface CommunityPoolSpendProposalWithDepositSDKType { + $typeUrl?: "/cosmos.distribution.v1beta1.CommunityPoolSpendProposalWithDeposit"; title: string; description: string; recipient: string; @@ -484,12 +528,20 @@ export const Params = { return message; }, fromAmino(object: ParamsAmino): Params { - return { - communityTax: object.community_tax, - baseProposerReward: object.base_proposer_reward, - bonusProposerReward: object.bonus_proposer_reward, - withdrawAddrEnabled: object.withdraw_addr_enabled - }; + const message = createBaseParams(); + if (object.community_tax !== undefined && object.community_tax !== null) { + message.communityTax = object.community_tax; + } + if (object.base_proposer_reward !== undefined && object.base_proposer_reward !== null) { + message.baseProposerReward = object.base_proposer_reward; + } + if (object.bonus_proposer_reward !== undefined && object.bonus_proposer_reward !== null) { + message.bonusProposerReward = object.bonus_proposer_reward; + } + if (object.withdraw_addr_enabled !== undefined && object.withdraw_addr_enabled !== null) { + message.withdrawAddrEnabled = object.withdraw_addr_enabled; + } + return message; }, toAmino(message: Params): ParamsAmino { const obj: any = {}; @@ -565,10 +617,12 @@ export const ValidatorHistoricalRewards = { return message; }, fromAmino(object: ValidatorHistoricalRewardsAmino): ValidatorHistoricalRewards { - return { - cumulativeRewardRatio: Array.isArray(object?.cumulative_reward_ratio) ? object.cumulative_reward_ratio.map((e: any) => DecCoin.fromAmino(e)) : [], - referenceCount: object.reference_count - }; + const message = createBaseValidatorHistoricalRewards(); + message.cumulativeRewardRatio = object.cumulative_reward_ratio?.map(e => DecCoin.fromAmino(e)) || []; + if (object.reference_count !== undefined && object.reference_count !== null) { + message.referenceCount = object.reference_count; + } + return message; }, toAmino(message: ValidatorHistoricalRewards): ValidatorHistoricalRewardsAmino { const obj: any = {}; @@ -646,10 +700,12 @@ export const ValidatorCurrentRewards = { return message; }, fromAmino(object: ValidatorCurrentRewardsAmino): ValidatorCurrentRewards { - return { - rewards: Array.isArray(object?.rewards) ? object.rewards.map((e: any) => DecCoin.fromAmino(e)) : [], - period: BigInt(object.period) - }; + const message = createBaseValidatorCurrentRewards(); + message.rewards = object.rewards?.map(e => DecCoin.fromAmino(e)) || []; + if (object.period !== undefined && object.period !== null) { + message.period = BigInt(object.period); + } + return message; }, toAmino(message: ValidatorCurrentRewards): ValidatorCurrentRewardsAmino { const obj: any = {}; @@ -719,9 +775,9 @@ export const ValidatorAccumulatedCommission = { return message; }, fromAmino(object: ValidatorAccumulatedCommissionAmino): ValidatorAccumulatedCommission { - return { - commission: Array.isArray(object?.commission) ? object.commission.map((e: any) => DecCoin.fromAmino(e)) : [] - }; + const message = createBaseValidatorAccumulatedCommission(); + message.commission = object.commission?.map(e => DecCoin.fromAmino(e)) || []; + return message; }, toAmino(message: ValidatorAccumulatedCommission): ValidatorAccumulatedCommissionAmino { const obj: any = {}; @@ -790,9 +846,9 @@ export const ValidatorOutstandingRewards = { return message; }, fromAmino(object: ValidatorOutstandingRewardsAmino): ValidatorOutstandingRewards { - return { - rewards: Array.isArray(object?.rewards) ? object.rewards.map((e: any) => DecCoin.fromAmino(e)) : [] - }; + const message = createBaseValidatorOutstandingRewards(); + message.rewards = object.rewards?.map(e => DecCoin.fromAmino(e)) || []; + return message; }, toAmino(message: ValidatorOutstandingRewards): ValidatorOutstandingRewardsAmino { const obj: any = {}; @@ -869,10 +925,14 @@ export const ValidatorSlashEvent = { return message; }, fromAmino(object: ValidatorSlashEventAmino): ValidatorSlashEvent { - return { - validatorPeriod: BigInt(object.validator_period), - fraction: object.fraction - }; + const message = createBaseValidatorSlashEvent(); + if (object.validator_period !== undefined && object.validator_period !== null) { + message.validatorPeriod = BigInt(object.validator_period); + } + if (object.fraction !== undefined && object.fraction !== null) { + message.fraction = object.fraction; + } + return message; }, toAmino(message: ValidatorSlashEvent): ValidatorSlashEventAmino { const obj: any = {}; @@ -938,9 +998,9 @@ export const ValidatorSlashEvents = { return message; }, fromAmino(object: ValidatorSlashEventsAmino): ValidatorSlashEvents { - return { - validatorSlashEvents: Array.isArray(object?.validator_slash_events) ? object.validator_slash_events.map((e: any) => ValidatorSlashEvent.fromAmino(e)) : [] - }; + const message = createBaseValidatorSlashEvents(); + message.validatorSlashEvents = object.validator_slash_events?.map(e => ValidatorSlashEvent.fromAmino(e)) || []; + return message; }, toAmino(message: ValidatorSlashEvents): ValidatorSlashEventsAmino { const obj: any = {}; @@ -1009,9 +1069,9 @@ export const FeePool = { return message; }, fromAmino(object: FeePoolAmino): FeePool { - return { - communityPool: Array.isArray(object?.community_pool) ? object.community_pool.map((e: any) => DecCoin.fromAmino(e)) : [] - }; + const message = createBaseFeePool(); + message.communityPool = object.community_pool?.map(e => DecCoin.fromAmino(e)) || []; + return message; }, toAmino(message: FeePool): FeePoolAmino { const obj: any = {}; @@ -1046,6 +1106,7 @@ export const FeePool = { }; function createBaseCommunityPoolSpendProposal(): CommunityPoolSpendProposal { return { + $typeUrl: "/cosmos.distribution.v1beta1.CommunityPoolSpendProposal", title: "", description: "", recipient: "", @@ -1104,12 +1165,18 @@ export const CommunityPoolSpendProposal = { return message; }, fromAmino(object: CommunityPoolSpendProposalAmino): CommunityPoolSpendProposal { - return { - title: object.title, - description: object.description, - recipient: object.recipient, - amount: Array.isArray(object?.amount) ? object.amount.map((e: any) => Coin.fromAmino(e)) : [] - }; + const message = createBaseCommunityPoolSpendProposal(); + if (object.title !== undefined && object.title !== null) { + message.title = object.title; + } + if (object.description !== undefined && object.description !== null) { + message.description = object.description; + } + if (object.recipient !== undefined && object.recipient !== null) { + message.recipient = object.recipient; + } + message.amount = object.amount?.map(e => Coin.fromAmino(e)) || []; + return message; }, toAmino(message: CommunityPoolSpendProposal): CommunityPoolSpendProposalAmino { const obj: any = {}; @@ -1197,17 +1264,23 @@ export const DelegatorStartingInfo = { return message; }, fromAmino(object: DelegatorStartingInfoAmino): DelegatorStartingInfo { - return { - previousPeriod: BigInt(object.previous_period), - stake: object.stake, - height: BigInt(object.height) - }; + const message = createBaseDelegatorStartingInfo(); + if (object.previous_period !== undefined && object.previous_period !== null) { + message.previousPeriod = BigInt(object.previous_period); + } + if (object.stake !== undefined && object.stake !== null) { + message.stake = object.stake; + } + if (object.height !== undefined && object.height !== null) { + message.height = BigInt(object.height); + } + return message; }, toAmino(message: DelegatorStartingInfo): DelegatorStartingInfoAmino { const obj: any = {}; obj.previous_period = message.previousPeriod ? message.previousPeriod.toString() : undefined; obj.stake = message.stake; - obj.height = message.height ? message.height.toString() : undefined; + obj.height = message.height ? message.height.toString() : "0"; return obj; }, fromAminoMsg(object: DelegatorStartingInfoAminoMsg): DelegatorStartingInfo { @@ -1276,10 +1349,12 @@ export const DelegationDelegatorReward = { return message; }, fromAmino(object: DelegationDelegatorRewardAmino): DelegationDelegatorReward { - return { - validatorAddress: object.validator_address, - reward: Array.isArray(object?.reward) ? object.reward.map((e: any) => DecCoin.fromAmino(e)) : [] - }; + const message = createBaseDelegationDelegatorReward(); + if (object.validator_address !== undefined && object.validator_address !== null) { + message.validatorAddress = object.validator_address; + } + message.reward = object.reward?.map(e => DecCoin.fromAmino(e)) || []; + return message; }, toAmino(message: DelegationDelegatorReward): DelegationDelegatorRewardAmino { const obj: any = {}; @@ -1315,6 +1390,7 @@ export const DelegationDelegatorReward = { }; function createBaseCommunityPoolSpendProposalWithDeposit(): CommunityPoolSpendProposalWithDeposit { return { + $typeUrl: "/cosmos.distribution.v1beta1.CommunityPoolSpendProposalWithDeposit", title: "", description: "", recipient: "", @@ -1381,13 +1457,23 @@ export const CommunityPoolSpendProposalWithDeposit = { return message; }, fromAmino(object: CommunityPoolSpendProposalWithDepositAmino): CommunityPoolSpendProposalWithDeposit { - return { - title: object.title, - description: object.description, - recipient: object.recipient, - amount: object.amount, - deposit: object.deposit - }; + const message = createBaseCommunityPoolSpendProposalWithDeposit(); + if (object.title !== undefined && object.title !== null) { + message.title = object.title; + } + if (object.description !== undefined && object.description !== null) { + message.description = object.description; + } + if (object.recipient !== undefined && object.recipient !== null) { + message.recipient = object.recipient; + } + if (object.amount !== undefined && object.amount !== null) { + message.amount = object.amount; + } + if (object.deposit !== undefined && object.deposit !== null) { + message.deposit = object.deposit; + } + return message; }, toAmino(message: CommunityPoolSpendProposalWithDeposit): CommunityPoolSpendProposalWithDepositAmino { const obj: any = {}; diff --git a/packages/osmo-query/src/codegen/cosmos/distribution/v1beta1/genesis.ts b/packages/osmo-query/src/codegen/cosmos/distribution/v1beta1/genesis.ts index 258275e9d..37b5c671e 100644 --- a/packages/osmo-query/src/codegen/cosmos/distribution/v1beta1/genesis.ts +++ b/packages/osmo-query/src/codegen/cosmos/distribution/v1beta1/genesis.ts @@ -23,9 +23,9 @@ export interface DelegatorWithdrawInfoProtoMsg { */ export interface DelegatorWithdrawInfoAmino { /** delegator_address is the address of the delegator. */ - delegator_address: string; + delegator_address?: string; /** withdraw_address is the address to withdraw the delegation rewards to. */ - withdraw_address: string; + withdraw_address?: string; } export interface DelegatorWithdrawInfoAminoMsg { type: "cosmos-sdk/DelegatorWithdrawInfo"; @@ -44,7 +44,7 @@ export interface DelegatorWithdrawInfoSDKType { export interface ValidatorOutstandingRewardsRecord { /** validator_address is the address of the validator. */ validatorAddress: string; - /** outstanding_rewards represents the oustanding rewards of a validator. */ + /** outstanding_rewards represents the outstanding rewards of a validator. */ outstandingRewards: DecCoin[]; } export interface ValidatorOutstandingRewardsRecordProtoMsg { @@ -54,8 +54,8 @@ export interface ValidatorOutstandingRewardsRecordProtoMsg { /** ValidatorOutstandingRewardsRecord is used for import/export via genesis json. */ export interface ValidatorOutstandingRewardsRecordAmino { /** validator_address is the address of the validator. */ - validator_address: string; - /** outstanding_rewards represents the oustanding rewards of a validator. */ + validator_address?: string; + /** outstanding_rewards represents the outstanding rewards of a validator. */ outstanding_rewards: DecCoinAmino[]; } export interface ValidatorOutstandingRewardsRecordAminoMsg { @@ -87,9 +87,9 @@ export interface ValidatorAccumulatedCommissionRecordProtoMsg { */ export interface ValidatorAccumulatedCommissionRecordAmino { /** validator_address is the address of the validator. */ - validator_address: string; + validator_address?: string; /** accumulated is the accumulated commission of a validator. */ - accumulated?: ValidatorAccumulatedCommissionAmino; + accumulated: ValidatorAccumulatedCommissionAmino; } export interface ValidatorAccumulatedCommissionRecordAminoMsg { type: "cosmos-sdk/ValidatorAccumulatedCommissionRecord"; @@ -125,11 +125,11 @@ export interface ValidatorHistoricalRewardsRecordProtoMsg { */ export interface ValidatorHistoricalRewardsRecordAmino { /** validator_address is the address of the validator. */ - validator_address: string; + validator_address?: string; /** period defines the period the historical rewards apply to. */ - period: string; + period?: string; /** rewards defines the historical rewards of a validator. */ - rewards?: ValidatorHistoricalRewardsAmino; + rewards: ValidatorHistoricalRewardsAmino; } export interface ValidatorHistoricalRewardsRecordAminoMsg { type: "cosmos-sdk/ValidatorHistoricalRewardsRecord"; @@ -158,9 +158,9 @@ export interface ValidatorCurrentRewardsRecordProtoMsg { /** ValidatorCurrentRewardsRecord is used for import / export via genesis json. */ export interface ValidatorCurrentRewardsRecordAmino { /** validator_address is the address of the validator. */ - validator_address: string; + validator_address?: string; /** rewards defines the current rewards of a validator. */ - rewards?: ValidatorCurrentRewardsAmino; + rewards: ValidatorCurrentRewardsAmino; } export interface ValidatorCurrentRewardsRecordAminoMsg { type: "cosmos-sdk/ValidatorCurrentRewardsRecord"; @@ -187,11 +187,11 @@ export interface DelegatorStartingInfoRecordProtoMsg { /** DelegatorStartingInfoRecord used for import / export via genesis json. */ export interface DelegatorStartingInfoRecordAmino { /** delegator_address is the address of the delegator. */ - delegator_address: string; + delegator_address?: string; /** validator_address is the address of the validator. */ - validator_address: string; + validator_address?: string; /** starting_info defines the starting info of a delegator. */ - starting_info?: DelegatorStartingInfoAmino; + starting_info: DelegatorStartingInfoAmino; } export interface DelegatorStartingInfoRecordAminoMsg { type: "cosmos-sdk/DelegatorStartingInfoRecord"; @@ -207,7 +207,7 @@ export interface DelegatorStartingInfoRecordSDKType { export interface ValidatorSlashEventRecord { /** validator_address is the address of the validator. */ validatorAddress: string; - /** height defines the block height at which the slash event occured. */ + /** height defines the block height at which the slash event occurred. */ height: bigint; /** period is the period of the slash event. */ period: bigint; @@ -221,13 +221,13 @@ export interface ValidatorSlashEventRecordProtoMsg { /** ValidatorSlashEventRecord is used for import / export via genesis json. */ export interface ValidatorSlashEventRecordAmino { /** validator_address is the address of the validator. */ - validator_address: string; - /** height defines the block height at which the slash event occured. */ - height: string; + validator_address?: string; + /** height defines the block height at which the slash event occurred. */ + height?: string; /** period is the period of the slash event. */ - period: string; + period?: string; /** validator_slash_event describes the slash event. */ - validator_slash_event?: ValidatorSlashEventAmino; + validator_slash_event: ValidatorSlashEventAmino; } export interface ValidatorSlashEventRecordAminoMsg { type: "cosmos-sdk/ValidatorSlashEventRecord"; @@ -242,7 +242,7 @@ export interface ValidatorSlashEventRecordSDKType { } /** GenesisState defines the distribution module's genesis state. */ export interface GenesisState { - /** params defines all the paramaters of the module. */ + /** params defines all the parameters of the module. */ params: Params; /** fee_pool defines the fee pool at genesis. */ feePool: FeePool; @@ -252,7 +252,7 @@ export interface GenesisState { previousProposer: string; /** fee_pool defines the outstanding rewards of all validators at genesis. */ outstandingRewards: ValidatorOutstandingRewardsRecord[]; - /** fee_pool defines the accumulated commisions of all validators at genesis. */ + /** fee_pool defines the accumulated commissions of all validators at genesis. */ validatorAccumulatedCommissions: ValidatorAccumulatedCommissionRecord[]; /** fee_pool defines the historical rewards of all validators at genesis. */ validatorHistoricalRewards: ValidatorHistoricalRewardsRecord[]; @@ -269,17 +269,17 @@ export interface GenesisStateProtoMsg { } /** GenesisState defines the distribution module's genesis state. */ export interface GenesisStateAmino { - /** params defines all the paramaters of the module. */ - params?: ParamsAmino; + /** params defines all the parameters of the module. */ + params: ParamsAmino; /** fee_pool defines the fee pool at genesis. */ - fee_pool?: FeePoolAmino; + fee_pool: FeePoolAmino; /** fee_pool defines the delegator withdraw infos at genesis. */ delegator_withdraw_infos: DelegatorWithdrawInfoAmino[]; /** fee_pool defines the previous proposer at genesis. */ - previous_proposer: string; + previous_proposer?: string; /** fee_pool defines the outstanding rewards of all validators at genesis. */ outstanding_rewards: ValidatorOutstandingRewardsRecordAmino[]; - /** fee_pool defines the accumulated commisions of all validators at genesis. */ + /** fee_pool defines the accumulated commissions of all validators at genesis. */ validator_accumulated_commissions: ValidatorAccumulatedCommissionRecordAmino[]; /** fee_pool defines the historical rewards of all validators at genesis. */ validator_historical_rewards: ValidatorHistoricalRewardsRecordAmino[]; @@ -351,10 +351,14 @@ export const DelegatorWithdrawInfo = { return message; }, fromAmino(object: DelegatorWithdrawInfoAmino): DelegatorWithdrawInfo { - return { - delegatorAddress: object.delegator_address, - withdrawAddress: object.withdraw_address - }; + const message = createBaseDelegatorWithdrawInfo(); + if (object.delegator_address !== undefined && object.delegator_address !== null) { + message.delegatorAddress = object.delegator_address; + } + if (object.withdraw_address !== undefined && object.withdraw_address !== null) { + message.withdrawAddress = object.withdraw_address; + } + return message; }, toAmino(message: DelegatorWithdrawInfo): DelegatorWithdrawInfoAmino { const obj: any = {}; @@ -428,10 +432,12 @@ export const ValidatorOutstandingRewardsRecord = { return message; }, fromAmino(object: ValidatorOutstandingRewardsRecordAmino): ValidatorOutstandingRewardsRecord { - return { - validatorAddress: object.validator_address, - outstandingRewards: Array.isArray(object?.outstanding_rewards) ? object.outstanding_rewards.map((e: any) => DecCoin.fromAmino(e)) : [] - }; + const message = createBaseValidatorOutstandingRewardsRecord(); + if (object.validator_address !== undefined && object.validator_address !== null) { + message.validatorAddress = object.validator_address; + } + message.outstandingRewards = object.outstanding_rewards?.map(e => DecCoin.fromAmino(e)) || []; + return message; }, toAmino(message: ValidatorOutstandingRewardsRecord): ValidatorOutstandingRewardsRecordAmino { const obj: any = {}; @@ -509,15 +515,19 @@ export const ValidatorAccumulatedCommissionRecord = { return message; }, fromAmino(object: ValidatorAccumulatedCommissionRecordAmino): ValidatorAccumulatedCommissionRecord { - return { - validatorAddress: object.validator_address, - accumulated: object?.accumulated ? ValidatorAccumulatedCommission.fromAmino(object.accumulated) : undefined - }; + const message = createBaseValidatorAccumulatedCommissionRecord(); + if (object.validator_address !== undefined && object.validator_address !== null) { + message.validatorAddress = object.validator_address; + } + if (object.accumulated !== undefined && object.accumulated !== null) { + message.accumulated = ValidatorAccumulatedCommission.fromAmino(object.accumulated); + } + return message; }, toAmino(message: ValidatorAccumulatedCommissionRecord): ValidatorAccumulatedCommissionRecordAmino { const obj: any = {}; obj.validator_address = message.validatorAddress; - obj.accumulated = message.accumulated ? ValidatorAccumulatedCommission.toAmino(message.accumulated) : undefined; + obj.accumulated = message.accumulated ? ValidatorAccumulatedCommission.toAmino(message.accumulated) : ValidatorAccumulatedCommission.fromPartial({}); return obj; }, fromAminoMsg(object: ValidatorAccumulatedCommissionRecordAminoMsg): ValidatorAccumulatedCommissionRecord { @@ -594,17 +604,23 @@ export const ValidatorHistoricalRewardsRecord = { return message; }, fromAmino(object: ValidatorHistoricalRewardsRecordAmino): ValidatorHistoricalRewardsRecord { - return { - validatorAddress: object.validator_address, - period: BigInt(object.period), - rewards: object?.rewards ? ValidatorHistoricalRewards.fromAmino(object.rewards) : undefined - }; + const message = createBaseValidatorHistoricalRewardsRecord(); + if (object.validator_address !== undefined && object.validator_address !== null) { + message.validatorAddress = object.validator_address; + } + if (object.period !== undefined && object.period !== null) { + message.period = BigInt(object.period); + } + if (object.rewards !== undefined && object.rewards !== null) { + message.rewards = ValidatorHistoricalRewards.fromAmino(object.rewards); + } + return message; }, toAmino(message: ValidatorHistoricalRewardsRecord): ValidatorHistoricalRewardsRecordAmino { const obj: any = {}; obj.validator_address = message.validatorAddress; obj.period = message.period ? message.period.toString() : undefined; - obj.rewards = message.rewards ? ValidatorHistoricalRewards.toAmino(message.rewards) : undefined; + obj.rewards = message.rewards ? ValidatorHistoricalRewards.toAmino(message.rewards) : ValidatorHistoricalRewards.fromPartial({}); return obj; }, fromAminoMsg(object: ValidatorHistoricalRewardsRecordAminoMsg): ValidatorHistoricalRewardsRecord { @@ -673,15 +689,19 @@ export const ValidatorCurrentRewardsRecord = { return message; }, fromAmino(object: ValidatorCurrentRewardsRecordAmino): ValidatorCurrentRewardsRecord { - return { - validatorAddress: object.validator_address, - rewards: object?.rewards ? ValidatorCurrentRewards.fromAmino(object.rewards) : undefined - }; + const message = createBaseValidatorCurrentRewardsRecord(); + if (object.validator_address !== undefined && object.validator_address !== null) { + message.validatorAddress = object.validator_address; + } + if (object.rewards !== undefined && object.rewards !== null) { + message.rewards = ValidatorCurrentRewards.fromAmino(object.rewards); + } + return message; }, toAmino(message: ValidatorCurrentRewardsRecord): ValidatorCurrentRewardsRecordAmino { const obj: any = {}; obj.validator_address = message.validatorAddress; - obj.rewards = message.rewards ? ValidatorCurrentRewards.toAmino(message.rewards) : undefined; + obj.rewards = message.rewards ? ValidatorCurrentRewards.toAmino(message.rewards) : ValidatorCurrentRewards.fromPartial({}); return obj; }, fromAminoMsg(object: ValidatorCurrentRewardsRecordAminoMsg): ValidatorCurrentRewardsRecord { @@ -758,17 +778,23 @@ export const DelegatorStartingInfoRecord = { return message; }, fromAmino(object: DelegatorStartingInfoRecordAmino): DelegatorStartingInfoRecord { - return { - delegatorAddress: object.delegator_address, - validatorAddress: object.validator_address, - startingInfo: object?.starting_info ? DelegatorStartingInfo.fromAmino(object.starting_info) : undefined - }; + const message = createBaseDelegatorStartingInfoRecord(); + if (object.delegator_address !== undefined && object.delegator_address !== null) { + message.delegatorAddress = object.delegator_address; + } + if (object.validator_address !== undefined && object.validator_address !== null) { + message.validatorAddress = object.validator_address; + } + if (object.starting_info !== undefined && object.starting_info !== null) { + message.startingInfo = DelegatorStartingInfo.fromAmino(object.starting_info); + } + return message; }, toAmino(message: DelegatorStartingInfoRecord): DelegatorStartingInfoRecordAmino { const obj: any = {}; obj.delegator_address = message.delegatorAddress; obj.validator_address = message.validatorAddress; - obj.starting_info = message.startingInfo ? DelegatorStartingInfo.toAmino(message.startingInfo) : undefined; + obj.starting_info = message.startingInfo ? DelegatorStartingInfo.toAmino(message.startingInfo) : DelegatorStartingInfo.fromPartial({}); return obj; }, fromAminoMsg(object: DelegatorStartingInfoRecordAminoMsg): DelegatorStartingInfoRecord { @@ -853,19 +879,27 @@ export const ValidatorSlashEventRecord = { return message; }, fromAmino(object: ValidatorSlashEventRecordAmino): ValidatorSlashEventRecord { - return { - validatorAddress: object.validator_address, - height: BigInt(object.height), - period: BigInt(object.period), - validatorSlashEvent: object?.validator_slash_event ? ValidatorSlashEvent.fromAmino(object.validator_slash_event) : undefined - }; + const message = createBaseValidatorSlashEventRecord(); + if (object.validator_address !== undefined && object.validator_address !== null) { + message.validatorAddress = object.validator_address; + } + if (object.height !== undefined && object.height !== null) { + message.height = BigInt(object.height); + } + if (object.period !== undefined && object.period !== null) { + message.period = BigInt(object.period); + } + if (object.validator_slash_event !== undefined && object.validator_slash_event !== null) { + message.validatorSlashEvent = ValidatorSlashEvent.fromAmino(object.validator_slash_event); + } + return message; }, toAmino(message: ValidatorSlashEventRecord): ValidatorSlashEventRecordAmino { const obj: any = {}; obj.validator_address = message.validatorAddress; obj.height = message.height ? message.height.toString() : undefined; obj.period = message.period ? message.period.toString() : undefined; - obj.validator_slash_event = message.validatorSlashEvent ? ValidatorSlashEvent.toAmino(message.validatorSlashEvent) : undefined; + obj.validator_slash_event = message.validatorSlashEvent ? ValidatorSlashEvent.toAmino(message.validatorSlashEvent) : ValidatorSlashEvent.fromPartial({}); return obj; }, fromAminoMsg(object: ValidatorSlashEventRecordAminoMsg): ValidatorSlashEventRecord { @@ -998,23 +1032,29 @@ export const GenesisState = { return message; }, fromAmino(object: GenesisStateAmino): GenesisState { - return { - params: object?.params ? Params.fromAmino(object.params) : undefined, - feePool: object?.fee_pool ? FeePool.fromAmino(object.fee_pool) : undefined, - delegatorWithdrawInfos: Array.isArray(object?.delegator_withdraw_infos) ? object.delegator_withdraw_infos.map((e: any) => DelegatorWithdrawInfo.fromAmino(e)) : [], - previousProposer: object.previous_proposer, - outstandingRewards: Array.isArray(object?.outstanding_rewards) ? object.outstanding_rewards.map((e: any) => ValidatorOutstandingRewardsRecord.fromAmino(e)) : [], - validatorAccumulatedCommissions: Array.isArray(object?.validator_accumulated_commissions) ? object.validator_accumulated_commissions.map((e: any) => ValidatorAccumulatedCommissionRecord.fromAmino(e)) : [], - validatorHistoricalRewards: Array.isArray(object?.validator_historical_rewards) ? object.validator_historical_rewards.map((e: any) => ValidatorHistoricalRewardsRecord.fromAmino(e)) : [], - validatorCurrentRewards: Array.isArray(object?.validator_current_rewards) ? object.validator_current_rewards.map((e: any) => ValidatorCurrentRewardsRecord.fromAmino(e)) : [], - delegatorStartingInfos: Array.isArray(object?.delegator_starting_infos) ? object.delegator_starting_infos.map((e: any) => DelegatorStartingInfoRecord.fromAmino(e)) : [], - validatorSlashEvents: Array.isArray(object?.validator_slash_events) ? object.validator_slash_events.map((e: any) => ValidatorSlashEventRecord.fromAmino(e)) : [] - }; + const message = createBaseGenesisState(); + if (object.params !== undefined && object.params !== null) { + message.params = Params.fromAmino(object.params); + } + if (object.fee_pool !== undefined && object.fee_pool !== null) { + message.feePool = FeePool.fromAmino(object.fee_pool); + } + message.delegatorWithdrawInfos = object.delegator_withdraw_infos?.map(e => DelegatorWithdrawInfo.fromAmino(e)) || []; + if (object.previous_proposer !== undefined && object.previous_proposer !== null) { + message.previousProposer = object.previous_proposer; + } + message.outstandingRewards = object.outstanding_rewards?.map(e => ValidatorOutstandingRewardsRecord.fromAmino(e)) || []; + message.validatorAccumulatedCommissions = object.validator_accumulated_commissions?.map(e => ValidatorAccumulatedCommissionRecord.fromAmino(e)) || []; + message.validatorHistoricalRewards = object.validator_historical_rewards?.map(e => ValidatorHistoricalRewardsRecord.fromAmino(e)) || []; + message.validatorCurrentRewards = object.validator_current_rewards?.map(e => ValidatorCurrentRewardsRecord.fromAmino(e)) || []; + message.delegatorStartingInfos = object.delegator_starting_infos?.map(e => DelegatorStartingInfoRecord.fromAmino(e)) || []; + message.validatorSlashEvents = object.validator_slash_events?.map(e => ValidatorSlashEventRecord.fromAmino(e)) || []; + return message; }, toAmino(message: GenesisState): GenesisStateAmino { const obj: any = {}; - obj.params = message.params ? Params.toAmino(message.params) : undefined; - obj.fee_pool = message.feePool ? FeePool.toAmino(message.feePool) : undefined; + obj.params = message.params ? Params.toAmino(message.params) : Params.fromPartial({}); + obj.fee_pool = message.feePool ? FeePool.toAmino(message.feePool) : FeePool.fromPartial({}); if (message.delegatorWithdrawInfos) { obj.delegator_withdraw_infos = message.delegatorWithdrawInfos.map(e => e ? DelegatorWithdrawInfo.toAmino(e) : undefined); } else { diff --git a/packages/osmo-query/src/codegen/cosmos/distribution/v1beta1/query.lcd.ts b/packages/osmo-query/src/codegen/cosmos/distribution/v1beta1/query.lcd.ts index 1d0dbb185..abaa343fc 100644 --- a/packages/osmo-query/src/codegen/cosmos/distribution/v1beta1/query.lcd.ts +++ b/packages/osmo-query/src/codegen/cosmos/distribution/v1beta1/query.lcd.ts @@ -1,6 +1,6 @@ import { setPaginationParams } from "../../../helpers"; import { LCDClient } from "@cosmology/lcd"; -import { QueryParamsRequest, QueryParamsResponseSDKType, QueryValidatorOutstandingRewardsRequest, QueryValidatorOutstandingRewardsResponseSDKType, QueryValidatorCommissionRequest, QueryValidatorCommissionResponseSDKType, QueryValidatorSlashesRequest, QueryValidatorSlashesResponseSDKType, QueryDelegationRewardsRequest, QueryDelegationRewardsResponseSDKType, QueryDelegationTotalRewardsRequest, QueryDelegationTotalRewardsResponseSDKType, QueryDelegatorValidatorsRequest, QueryDelegatorValidatorsResponseSDKType, QueryDelegatorWithdrawAddressRequest, QueryDelegatorWithdrawAddressResponseSDKType, QueryCommunityPoolRequest, QueryCommunityPoolResponseSDKType } from "./query"; +import { QueryParamsRequest, QueryParamsResponseSDKType, QueryValidatorDistributionInfoRequest, QueryValidatorDistributionInfoResponseSDKType, QueryValidatorOutstandingRewardsRequest, QueryValidatorOutstandingRewardsResponseSDKType, QueryValidatorCommissionRequest, QueryValidatorCommissionResponseSDKType, QueryValidatorSlashesRequest, QueryValidatorSlashesResponseSDKType, QueryDelegationRewardsRequest, QueryDelegationRewardsResponseSDKType, QueryDelegationTotalRewardsRequest, QueryDelegationTotalRewardsResponseSDKType, QueryDelegatorValidatorsRequest, QueryDelegatorValidatorsResponseSDKType, QueryDelegatorWithdrawAddressRequest, QueryDelegatorWithdrawAddressResponseSDKType, QueryCommunityPoolRequest, QueryCommunityPoolResponseSDKType } from "./query"; export class LCDQueryClient { req: LCDClient; constructor({ @@ -10,6 +10,7 @@ export class LCDQueryClient { }) { this.req = requestClient; this.params = this.params.bind(this); + this.validatorDistributionInfo = this.validatorDistributionInfo.bind(this); this.validatorOutstandingRewards = this.validatorOutstandingRewards.bind(this); this.validatorCommission = this.validatorCommission.bind(this); this.validatorSlashes = this.validatorSlashes.bind(this); @@ -24,6 +25,11 @@ export class LCDQueryClient { const endpoint = `cosmos/distribution/v1beta1/params`; return await this.req.get(endpoint); } + /* ValidatorDistributionInfo queries validator commission and self-delegation rewards for validator */ + async validatorDistributionInfo(params: QueryValidatorDistributionInfoRequest): Promise { + const endpoint = `cosmos/distribution/v1beta1/validators/${params.validatorAddress}`; + return await this.req.get(endpoint); + } /* ValidatorOutstandingRewards queries rewards of a validator address. */ async validatorOutstandingRewards(params: QueryValidatorOutstandingRewardsRequest): Promise { const endpoint = `cosmos/distribution/v1beta1/validators/${params.validatorAddress}/outstanding_rewards`; diff --git a/packages/osmo-query/src/codegen/cosmos/distribution/v1beta1/query.rpc.Query.ts b/packages/osmo-query/src/codegen/cosmos/distribution/v1beta1/query.rpc.Query.ts index 9a14c7758..4dd556cc4 100644 --- a/packages/osmo-query/src/codegen/cosmos/distribution/v1beta1/query.rpc.Query.ts +++ b/packages/osmo-query/src/codegen/cosmos/distribution/v1beta1/query.rpc.Query.ts @@ -3,11 +3,13 @@ import { BinaryReader } from "../../../binary"; import { QueryClient, createProtobufRpcClient, ProtobufRpcClient } from "@cosmjs/stargate"; import { ReactQueryParams } from "../../../react-query"; import { useQuery } from "@tanstack/react-query"; -import { QueryParamsRequest, QueryParamsResponse, QueryValidatorOutstandingRewardsRequest, QueryValidatorOutstandingRewardsResponse, QueryValidatorCommissionRequest, QueryValidatorCommissionResponse, QueryValidatorSlashesRequest, QueryValidatorSlashesResponse, QueryDelegationRewardsRequest, QueryDelegationRewardsResponse, QueryDelegationTotalRewardsRequest, QueryDelegationTotalRewardsResponse, QueryDelegatorValidatorsRequest, QueryDelegatorValidatorsResponse, QueryDelegatorWithdrawAddressRequest, QueryDelegatorWithdrawAddressResponse, QueryCommunityPoolRequest, QueryCommunityPoolResponse } from "./query"; +import { QueryParamsRequest, QueryParamsResponse, QueryValidatorDistributionInfoRequest, QueryValidatorDistributionInfoResponse, QueryValidatorOutstandingRewardsRequest, QueryValidatorOutstandingRewardsResponse, QueryValidatorCommissionRequest, QueryValidatorCommissionResponse, QueryValidatorSlashesRequest, QueryValidatorSlashesResponse, QueryDelegationRewardsRequest, QueryDelegationRewardsResponse, QueryDelegationTotalRewardsRequest, QueryDelegationTotalRewardsResponse, QueryDelegatorValidatorsRequest, QueryDelegatorValidatorsResponse, QueryDelegatorWithdrawAddressRequest, QueryDelegatorWithdrawAddressResponse, QueryCommunityPoolRequest, QueryCommunityPoolResponse } from "./query"; /** Query defines the gRPC querier service for distribution module. */ export interface Query { /** Params queries params of the distribution module. */ params(request?: QueryParamsRequest): Promise; + /** ValidatorDistributionInfo queries validator commission and self-delegation rewards for validator */ + validatorDistributionInfo(request: QueryValidatorDistributionInfoRequest): Promise; /** ValidatorOutstandingRewards queries rewards of a validator address. */ validatorOutstandingRewards(request: QueryValidatorOutstandingRewardsRequest): Promise; /** ValidatorCommission queries accumulated commission for a validator. */ @@ -33,6 +35,7 @@ export class QueryClientImpl implements Query { constructor(rpc: Rpc) { this.rpc = rpc; this.params = this.params.bind(this); + this.validatorDistributionInfo = this.validatorDistributionInfo.bind(this); this.validatorOutstandingRewards = this.validatorOutstandingRewards.bind(this); this.validatorCommission = this.validatorCommission.bind(this); this.validatorSlashes = this.validatorSlashes.bind(this); @@ -47,6 +50,11 @@ export class QueryClientImpl implements Query { const promise = this.rpc.request("cosmos.distribution.v1beta1.Query", "Params", data); return promise.then(data => QueryParamsResponse.decode(new BinaryReader(data))); } + validatorDistributionInfo(request: QueryValidatorDistributionInfoRequest): Promise { + const data = QueryValidatorDistributionInfoRequest.encode(request).finish(); + const promise = this.rpc.request("cosmos.distribution.v1beta1.Query", "ValidatorDistributionInfo", data); + return promise.then(data => QueryValidatorDistributionInfoResponse.decode(new BinaryReader(data))); + } validatorOutstandingRewards(request: QueryValidatorOutstandingRewardsRequest): Promise { const data = QueryValidatorOutstandingRewardsRequest.encode(request).finish(); const promise = this.rpc.request("cosmos.distribution.v1beta1.Query", "ValidatorOutstandingRewards", data); @@ -95,6 +103,9 @@ export const createRpcQueryExtension = (base: QueryClient) => { params(request?: QueryParamsRequest): Promise { return queryService.params(request); }, + validatorDistributionInfo(request: QueryValidatorDistributionInfoRequest): Promise { + return queryService.validatorDistributionInfo(request); + }, validatorOutstandingRewards(request: QueryValidatorOutstandingRewardsRequest): Promise { return queryService.validatorOutstandingRewards(request); }, @@ -124,6 +135,9 @@ export const createRpcQueryExtension = (base: QueryClient) => { export interface UseParamsQuery extends ReactQueryParams { request?: QueryParamsRequest; } +export interface UseValidatorDistributionInfoQuery extends ReactQueryParams { + request: QueryValidatorDistributionInfoRequest; +} export interface UseValidatorOutstandingRewardsQuery extends ReactQueryParams { request: QueryValidatorOutstandingRewardsRequest; } @@ -169,6 +183,15 @@ export const createRpcQueryHooks = (rpc: ProtobufRpcClient | undefined) => { return queryService.params(request); }, options); }; + const useValidatorDistributionInfo = ({ + request, + options + }: UseValidatorDistributionInfoQuery) => { + return useQuery(["validatorDistributionInfoQuery", request], () => { + if (!queryService) throw new Error("Query Service not initialized"); + return queryService.validatorDistributionInfo(request); + }, options); + }; const useValidatorOutstandingRewards = ({ request, options @@ -243,6 +266,7 @@ export const createRpcQueryHooks = (rpc: ProtobufRpcClient | undefined) => { }; return { /** Params queries params of the distribution module. */useParams, + /** ValidatorDistributionInfo queries validator commission and self-delegation rewards for validator */useValidatorDistributionInfo, /** ValidatorOutstandingRewards queries rewards of a validator address. */useValidatorOutstandingRewards, /** ValidatorCommission queries accumulated commission for a validator. */useValidatorCommission, /** ValidatorSlashes queries slash events of a validator. */useValidatorSlashes, diff --git a/packages/osmo-query/src/codegen/cosmos/distribution/v1beta1/query.ts b/packages/osmo-query/src/codegen/cosmos/distribution/v1beta1/query.ts index fa5dd71a3..4745a9ed1 100644 --- a/packages/osmo-query/src/codegen/cosmos/distribution/v1beta1/query.ts +++ b/packages/osmo-query/src/codegen/cosmos/distribution/v1beta1/query.ts @@ -28,7 +28,7 @@ export interface QueryParamsResponseProtoMsg { /** QueryParamsResponse is the response type for the Query/Params RPC method. */ export interface QueryParamsResponseAmino { /** params defines the parameters of the module. */ - params?: ParamsAmino; + params: ParamsAmino; } export interface QueryParamsResponseAminoMsg { type: "cosmos-sdk/QueryParamsResponse"; @@ -38,6 +38,60 @@ export interface QueryParamsResponseAminoMsg { export interface QueryParamsResponseSDKType { params: ParamsSDKType; } +/** QueryValidatorDistributionInfoRequest is the request type for the Query/ValidatorDistributionInfo RPC method. */ +export interface QueryValidatorDistributionInfoRequest { + /** validator_address defines the validator address to query for. */ + validatorAddress: string; +} +export interface QueryValidatorDistributionInfoRequestProtoMsg { + typeUrl: "/cosmos.distribution.v1beta1.QueryValidatorDistributionInfoRequest"; + value: Uint8Array; +} +/** QueryValidatorDistributionInfoRequest is the request type for the Query/ValidatorDistributionInfo RPC method. */ +export interface QueryValidatorDistributionInfoRequestAmino { + /** validator_address defines the validator address to query for. */ + validator_address?: string; +} +export interface QueryValidatorDistributionInfoRequestAminoMsg { + type: "cosmos-sdk/QueryValidatorDistributionInfoRequest"; + value: QueryValidatorDistributionInfoRequestAmino; +} +/** QueryValidatorDistributionInfoRequest is the request type for the Query/ValidatorDistributionInfo RPC method. */ +export interface QueryValidatorDistributionInfoRequestSDKType { + validator_address: string; +} +/** QueryValidatorDistributionInfoResponse is the response type for the Query/ValidatorDistributionInfo RPC method. */ +export interface QueryValidatorDistributionInfoResponse { + /** operator_address defines the validator operator address. */ + operatorAddress: string; + /** self_bond_rewards defines the self delegations rewards. */ + selfBondRewards: DecCoin[]; + /** commission defines the commission the validator received. */ + commission: DecCoin[]; +} +export interface QueryValidatorDistributionInfoResponseProtoMsg { + typeUrl: "/cosmos.distribution.v1beta1.QueryValidatorDistributionInfoResponse"; + value: Uint8Array; +} +/** QueryValidatorDistributionInfoResponse is the response type for the Query/ValidatorDistributionInfo RPC method. */ +export interface QueryValidatorDistributionInfoResponseAmino { + /** operator_address defines the validator operator address. */ + operator_address?: string; + /** self_bond_rewards defines the self delegations rewards. */ + self_bond_rewards: DecCoinAmino[]; + /** commission defines the commission the validator received. */ + commission?: DecCoinAmino[]; +} +export interface QueryValidatorDistributionInfoResponseAminoMsg { + type: "cosmos-sdk/QueryValidatorDistributionInfoResponse"; + value: QueryValidatorDistributionInfoResponseAmino; +} +/** QueryValidatorDistributionInfoResponse is the response type for the Query/ValidatorDistributionInfo RPC method. */ +export interface QueryValidatorDistributionInfoResponseSDKType { + operator_address: string; + self_bond_rewards: DecCoinSDKType[]; + commission: DecCoinSDKType[]; +} /** * QueryValidatorOutstandingRewardsRequest is the request type for the * Query/ValidatorOutstandingRewards RPC method. @@ -56,7 +110,7 @@ export interface QueryValidatorOutstandingRewardsRequestProtoMsg { */ export interface QueryValidatorOutstandingRewardsRequestAmino { /** validator_address defines the validator address to query for. */ - validator_address: string; + validator_address?: string; } export interface QueryValidatorOutstandingRewardsRequestAminoMsg { type: "cosmos-sdk/QueryValidatorOutstandingRewardsRequest"; @@ -85,7 +139,7 @@ export interface QueryValidatorOutstandingRewardsResponseProtoMsg { * Query/ValidatorOutstandingRewards RPC method. */ export interface QueryValidatorOutstandingRewardsResponseAmino { - rewards?: ValidatorOutstandingRewardsAmino; + rewards: ValidatorOutstandingRewardsAmino; } export interface QueryValidatorOutstandingRewardsResponseAminoMsg { type: "cosmos-sdk/QueryValidatorOutstandingRewardsResponse"; @@ -116,7 +170,7 @@ export interface QueryValidatorCommissionRequestProtoMsg { */ export interface QueryValidatorCommissionRequestAmino { /** validator_address defines the validator address to query for. */ - validator_address: string; + validator_address?: string; } export interface QueryValidatorCommissionRequestAminoMsg { type: "cosmos-sdk/QueryValidatorCommissionRequest"; @@ -134,7 +188,7 @@ export interface QueryValidatorCommissionRequestSDKType { * Query/ValidatorCommission RPC method */ export interface QueryValidatorCommissionResponse { - /** commission defines the commision the validator received. */ + /** commission defines the commission the validator received. */ commission: ValidatorAccumulatedCommission; } export interface QueryValidatorCommissionResponseProtoMsg { @@ -146,8 +200,8 @@ export interface QueryValidatorCommissionResponseProtoMsg { * Query/ValidatorCommission RPC method */ export interface QueryValidatorCommissionResponseAmino { - /** commission defines the commision the validator received. */ - commission?: ValidatorAccumulatedCommissionAmino; + /** commission defines the commission the validator received. */ + commission: ValidatorAccumulatedCommissionAmino; } export interface QueryValidatorCommissionResponseAminoMsg { type: "cosmos-sdk/QueryValidatorCommissionResponse"; @@ -172,7 +226,7 @@ export interface QueryValidatorSlashesRequest { /** starting_height defines the optional ending height to query the slashes. */ endingHeight: bigint; /** pagination defines an optional pagination for the request. */ - pagination: PageRequest; + pagination?: PageRequest; } export interface QueryValidatorSlashesRequestProtoMsg { typeUrl: "/cosmos.distribution.v1beta1.QueryValidatorSlashesRequest"; @@ -184,11 +238,11 @@ export interface QueryValidatorSlashesRequestProtoMsg { */ export interface QueryValidatorSlashesRequestAmino { /** validator_address defines the validator address to query for. */ - validator_address: string; + validator_address?: string; /** starting_height defines the optional starting height to query the slashes. */ - starting_height: string; + starting_height?: string; /** starting_height defines the optional ending height to query the slashes. */ - ending_height: string; + ending_height?: string; /** pagination defines an optional pagination for the request. */ pagination?: PageRequestAmino; } @@ -204,7 +258,7 @@ export interface QueryValidatorSlashesRequestSDKType { validator_address: string; starting_height: bigint; ending_height: bigint; - pagination: PageRequestSDKType; + pagination?: PageRequestSDKType; } /** * QueryValidatorSlashesResponse is the response type for the @@ -214,7 +268,7 @@ export interface QueryValidatorSlashesResponse { /** slashes defines the slashes the validator received. */ slashes: ValidatorSlashEvent[]; /** pagination defines the pagination in the response. */ - pagination: PageResponse; + pagination?: PageResponse; } export interface QueryValidatorSlashesResponseProtoMsg { typeUrl: "/cosmos.distribution.v1beta1.QueryValidatorSlashesResponse"; @@ -240,7 +294,7 @@ export interface QueryValidatorSlashesResponseAminoMsg { */ export interface QueryValidatorSlashesResponseSDKType { slashes: ValidatorSlashEventSDKType[]; - pagination: PageResponseSDKType; + pagination?: PageResponseSDKType; } /** * QueryDelegationRewardsRequest is the request type for the @@ -262,9 +316,9 @@ export interface QueryDelegationRewardsRequestProtoMsg { */ export interface QueryDelegationRewardsRequestAmino { /** delegator_address defines the delegator address to query for. */ - delegator_address: string; + delegator_address?: string; /** validator_address defines the validator address to query for. */ - validator_address: string; + validator_address?: string; } export interface QueryDelegationRewardsRequestAminoMsg { type: "cosmos-sdk/QueryDelegationRewardsRequest"; @@ -327,7 +381,7 @@ export interface QueryDelegationTotalRewardsRequestProtoMsg { */ export interface QueryDelegationTotalRewardsRequestAmino { /** delegator_address defines the delegator address to query for. */ - delegator_address: string; + delegator_address?: string; } export interface QueryDelegationTotalRewardsRequestAminoMsg { type: "cosmos-sdk/QueryDelegationTotalRewardsRequest"; @@ -394,7 +448,7 @@ export interface QueryDelegatorValidatorsRequestProtoMsg { */ export interface QueryDelegatorValidatorsRequestAmino { /** delegator_address defines the delegator address to query for. */ - delegator_address: string; + delegator_address?: string; } export interface QueryDelegatorValidatorsRequestAminoMsg { type: "cosmos-sdk/QueryDelegatorValidatorsRequest"; @@ -425,7 +479,7 @@ export interface QueryDelegatorValidatorsResponseProtoMsg { */ export interface QueryDelegatorValidatorsResponseAmino { /** validators defines the validators a delegator is delegating for. */ - validators: string[]; + validators?: string[]; } export interface QueryDelegatorValidatorsResponseAminoMsg { type: "cosmos-sdk/QueryDelegatorValidatorsResponse"; @@ -456,7 +510,7 @@ export interface QueryDelegatorWithdrawAddressRequestProtoMsg { */ export interface QueryDelegatorWithdrawAddressRequestAmino { /** delegator_address defines the delegator address to query for. */ - delegator_address: string; + delegator_address?: string; } export interface QueryDelegatorWithdrawAddressRequestAminoMsg { type: "cosmos-sdk/QueryDelegatorWithdrawAddressRequest"; @@ -487,7 +541,7 @@ export interface QueryDelegatorWithdrawAddressResponseProtoMsg { */ export interface QueryDelegatorWithdrawAddressResponseAmino { /** withdraw_address defines the delegator address to query for. */ - withdraw_address: string; + withdraw_address?: string; } export interface QueryDelegatorWithdrawAddressResponseAminoMsg { type: "cosmos-sdk/QueryDelegatorWithdrawAddressResponse"; @@ -581,7 +635,8 @@ export const QueryParamsRequest = { return message; }, fromAmino(_: QueryParamsRequestAmino): QueryParamsRequest { - return {}; + const message = createBaseQueryParamsRequest(); + return message; }, toAmino(_: QueryParamsRequest): QueryParamsRequestAmino { const obj: any = {}; @@ -645,13 +700,15 @@ export const QueryParamsResponse = { return message; }, fromAmino(object: QueryParamsResponseAmino): QueryParamsResponse { - return { - params: object?.params ? Params.fromAmino(object.params) : undefined - }; + const message = createBaseQueryParamsResponse(); + if (object.params !== undefined && object.params !== null) { + message.params = Params.fromAmino(object.params); + } + return message; }, toAmino(message: QueryParamsResponse): QueryParamsResponseAmino { const obj: any = {}; - obj.params = message.params ? Params.toAmino(message.params) : undefined; + obj.params = message.params ? Params.toAmino(message.params) : Params.fromPartial({}); return obj; }, fromAminoMsg(object: QueryParamsResponseAminoMsg): QueryParamsResponse { @@ -676,6 +733,172 @@ export const QueryParamsResponse = { }; } }; +function createBaseQueryValidatorDistributionInfoRequest(): QueryValidatorDistributionInfoRequest { + return { + validatorAddress: "" + }; +} +export const QueryValidatorDistributionInfoRequest = { + typeUrl: "/cosmos.distribution.v1beta1.QueryValidatorDistributionInfoRequest", + encode(message: QueryValidatorDistributionInfoRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.validatorAddress !== "") { + writer.uint32(10).string(message.validatorAddress); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryValidatorDistributionInfoRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryValidatorDistributionInfoRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.validatorAddress = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryValidatorDistributionInfoRequest { + const message = createBaseQueryValidatorDistributionInfoRequest(); + message.validatorAddress = object.validatorAddress ?? ""; + return message; + }, + fromAmino(object: QueryValidatorDistributionInfoRequestAmino): QueryValidatorDistributionInfoRequest { + const message = createBaseQueryValidatorDistributionInfoRequest(); + if (object.validator_address !== undefined && object.validator_address !== null) { + message.validatorAddress = object.validator_address; + } + return message; + }, + toAmino(message: QueryValidatorDistributionInfoRequest): QueryValidatorDistributionInfoRequestAmino { + const obj: any = {}; + obj.validator_address = message.validatorAddress; + return obj; + }, + fromAminoMsg(object: QueryValidatorDistributionInfoRequestAminoMsg): QueryValidatorDistributionInfoRequest { + return QueryValidatorDistributionInfoRequest.fromAmino(object.value); + }, + toAminoMsg(message: QueryValidatorDistributionInfoRequest): QueryValidatorDistributionInfoRequestAminoMsg { + return { + type: "cosmos-sdk/QueryValidatorDistributionInfoRequest", + value: QueryValidatorDistributionInfoRequest.toAmino(message) + }; + }, + fromProtoMsg(message: QueryValidatorDistributionInfoRequestProtoMsg): QueryValidatorDistributionInfoRequest { + return QueryValidatorDistributionInfoRequest.decode(message.value); + }, + toProto(message: QueryValidatorDistributionInfoRequest): Uint8Array { + return QueryValidatorDistributionInfoRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryValidatorDistributionInfoRequest): QueryValidatorDistributionInfoRequestProtoMsg { + return { + typeUrl: "/cosmos.distribution.v1beta1.QueryValidatorDistributionInfoRequest", + value: QueryValidatorDistributionInfoRequest.encode(message).finish() + }; + } +}; +function createBaseQueryValidatorDistributionInfoResponse(): QueryValidatorDistributionInfoResponse { + return { + operatorAddress: "", + selfBondRewards: [], + commission: [] + }; +} +export const QueryValidatorDistributionInfoResponse = { + typeUrl: "/cosmos.distribution.v1beta1.QueryValidatorDistributionInfoResponse", + encode(message: QueryValidatorDistributionInfoResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.operatorAddress !== "") { + writer.uint32(10).string(message.operatorAddress); + } + for (const v of message.selfBondRewards) { + DecCoin.encode(v!, writer.uint32(18).fork()).ldelim(); + } + for (const v of message.commission) { + DecCoin.encode(v!, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryValidatorDistributionInfoResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryValidatorDistributionInfoResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.operatorAddress = reader.string(); + break; + case 2: + message.selfBondRewards.push(DecCoin.decode(reader, reader.uint32())); + break; + case 3: + message.commission.push(DecCoin.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryValidatorDistributionInfoResponse { + const message = createBaseQueryValidatorDistributionInfoResponse(); + message.operatorAddress = object.operatorAddress ?? ""; + message.selfBondRewards = object.selfBondRewards?.map(e => DecCoin.fromPartial(e)) || []; + message.commission = object.commission?.map(e => DecCoin.fromPartial(e)) || []; + return message; + }, + fromAmino(object: QueryValidatorDistributionInfoResponseAmino): QueryValidatorDistributionInfoResponse { + const message = createBaseQueryValidatorDistributionInfoResponse(); + if (object.operator_address !== undefined && object.operator_address !== null) { + message.operatorAddress = object.operator_address; + } + message.selfBondRewards = object.self_bond_rewards?.map(e => DecCoin.fromAmino(e)) || []; + message.commission = object.commission?.map(e => DecCoin.fromAmino(e)) || []; + return message; + }, + toAmino(message: QueryValidatorDistributionInfoResponse): QueryValidatorDistributionInfoResponseAmino { + const obj: any = {}; + obj.operator_address = message.operatorAddress; + if (message.selfBondRewards) { + obj.self_bond_rewards = message.selfBondRewards.map(e => e ? DecCoin.toAmino(e) : undefined); + } else { + obj.self_bond_rewards = []; + } + if (message.commission) { + obj.commission = message.commission.map(e => e ? DecCoin.toAmino(e) : undefined); + } else { + obj.commission = []; + } + return obj; + }, + fromAminoMsg(object: QueryValidatorDistributionInfoResponseAminoMsg): QueryValidatorDistributionInfoResponse { + return QueryValidatorDistributionInfoResponse.fromAmino(object.value); + }, + toAminoMsg(message: QueryValidatorDistributionInfoResponse): QueryValidatorDistributionInfoResponseAminoMsg { + return { + type: "cosmos-sdk/QueryValidatorDistributionInfoResponse", + value: QueryValidatorDistributionInfoResponse.toAmino(message) + }; + }, + fromProtoMsg(message: QueryValidatorDistributionInfoResponseProtoMsg): QueryValidatorDistributionInfoResponse { + return QueryValidatorDistributionInfoResponse.decode(message.value); + }, + toProto(message: QueryValidatorDistributionInfoResponse): Uint8Array { + return QueryValidatorDistributionInfoResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryValidatorDistributionInfoResponse): QueryValidatorDistributionInfoResponseProtoMsg { + return { + typeUrl: "/cosmos.distribution.v1beta1.QueryValidatorDistributionInfoResponse", + value: QueryValidatorDistributionInfoResponse.encode(message).finish() + }; + } +}; function createBaseQueryValidatorOutstandingRewardsRequest(): QueryValidatorOutstandingRewardsRequest { return { validatorAddress: "" @@ -712,9 +935,11 @@ export const QueryValidatorOutstandingRewardsRequest = { return message; }, fromAmino(object: QueryValidatorOutstandingRewardsRequestAmino): QueryValidatorOutstandingRewardsRequest { - return { - validatorAddress: object.validator_address - }; + const message = createBaseQueryValidatorOutstandingRewardsRequest(); + if (object.validator_address !== undefined && object.validator_address !== null) { + message.validatorAddress = object.validator_address; + } + return message; }, toAmino(message: QueryValidatorOutstandingRewardsRequest): QueryValidatorOutstandingRewardsRequestAmino { const obj: any = {}; @@ -779,13 +1004,15 @@ export const QueryValidatorOutstandingRewardsResponse = { return message; }, fromAmino(object: QueryValidatorOutstandingRewardsResponseAmino): QueryValidatorOutstandingRewardsResponse { - return { - rewards: object?.rewards ? ValidatorOutstandingRewards.fromAmino(object.rewards) : undefined - }; + const message = createBaseQueryValidatorOutstandingRewardsResponse(); + if (object.rewards !== undefined && object.rewards !== null) { + message.rewards = ValidatorOutstandingRewards.fromAmino(object.rewards); + } + return message; }, toAmino(message: QueryValidatorOutstandingRewardsResponse): QueryValidatorOutstandingRewardsResponseAmino { const obj: any = {}; - obj.rewards = message.rewards ? ValidatorOutstandingRewards.toAmino(message.rewards) : undefined; + obj.rewards = message.rewards ? ValidatorOutstandingRewards.toAmino(message.rewards) : ValidatorOutstandingRewards.fromPartial({}); return obj; }, fromAminoMsg(object: QueryValidatorOutstandingRewardsResponseAminoMsg): QueryValidatorOutstandingRewardsResponse { @@ -846,9 +1073,11 @@ export const QueryValidatorCommissionRequest = { return message; }, fromAmino(object: QueryValidatorCommissionRequestAmino): QueryValidatorCommissionRequest { - return { - validatorAddress: object.validator_address - }; + const message = createBaseQueryValidatorCommissionRequest(); + if (object.validator_address !== undefined && object.validator_address !== null) { + message.validatorAddress = object.validator_address; + } + return message; }, toAmino(message: QueryValidatorCommissionRequest): QueryValidatorCommissionRequestAmino { const obj: any = {}; @@ -913,13 +1142,15 @@ export const QueryValidatorCommissionResponse = { return message; }, fromAmino(object: QueryValidatorCommissionResponseAmino): QueryValidatorCommissionResponse { - return { - commission: object?.commission ? ValidatorAccumulatedCommission.fromAmino(object.commission) : undefined - }; + const message = createBaseQueryValidatorCommissionResponse(); + if (object.commission !== undefined && object.commission !== null) { + message.commission = ValidatorAccumulatedCommission.fromAmino(object.commission); + } + return message; }, toAmino(message: QueryValidatorCommissionResponse): QueryValidatorCommissionResponseAmino { const obj: any = {}; - obj.commission = message.commission ? ValidatorAccumulatedCommission.toAmino(message.commission) : undefined; + obj.commission = message.commission ? ValidatorAccumulatedCommission.toAmino(message.commission) : ValidatorAccumulatedCommission.fromPartial({}); return obj; }, fromAminoMsg(object: QueryValidatorCommissionResponseAminoMsg): QueryValidatorCommissionResponse { @@ -949,7 +1180,7 @@ function createBaseQueryValidatorSlashesRequest(): QueryValidatorSlashesRequest validatorAddress: "", startingHeight: BigInt(0), endingHeight: BigInt(0), - pagination: PageRequest.fromPartial({}) + pagination: undefined }; } export const QueryValidatorSlashesRequest = { @@ -1004,12 +1235,20 @@ export const QueryValidatorSlashesRequest = { return message; }, fromAmino(object: QueryValidatorSlashesRequestAmino): QueryValidatorSlashesRequest { - return { - validatorAddress: object.validator_address, - startingHeight: BigInt(object.starting_height), - endingHeight: BigInt(object.ending_height), - pagination: object?.pagination ? PageRequest.fromAmino(object.pagination) : undefined - }; + const message = createBaseQueryValidatorSlashesRequest(); + if (object.validator_address !== undefined && object.validator_address !== null) { + message.validatorAddress = object.validator_address; + } + if (object.starting_height !== undefined && object.starting_height !== null) { + message.startingHeight = BigInt(object.starting_height); + } + if (object.ending_height !== undefined && object.ending_height !== null) { + message.endingHeight = BigInt(object.ending_height); + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromAmino(object.pagination); + } + return message; }, toAmino(message: QueryValidatorSlashesRequest): QueryValidatorSlashesRequestAmino { const obj: any = {}; @@ -1044,7 +1283,7 @@ export const QueryValidatorSlashesRequest = { function createBaseQueryValidatorSlashesResponse(): QueryValidatorSlashesResponse { return { slashes: [], - pagination: PageResponse.fromPartial({}) + pagination: undefined }; } export const QueryValidatorSlashesResponse = { @@ -1085,10 +1324,12 @@ export const QueryValidatorSlashesResponse = { return message; }, fromAmino(object: QueryValidatorSlashesResponseAmino): QueryValidatorSlashesResponse { - return { - slashes: Array.isArray(object?.slashes) ? object.slashes.map((e: any) => ValidatorSlashEvent.fromAmino(e)) : [], - pagination: object?.pagination ? PageResponse.fromAmino(object.pagination) : undefined - }; + const message = createBaseQueryValidatorSlashesResponse(); + message.slashes = object.slashes?.map(e => ValidatorSlashEvent.fromAmino(e)) || []; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromAmino(object.pagination); + } + return message; }, toAmino(message: QueryValidatorSlashesResponse): QueryValidatorSlashesResponseAmino { const obj: any = {}; @@ -1166,10 +1407,14 @@ export const QueryDelegationRewardsRequest = { return message; }, fromAmino(object: QueryDelegationRewardsRequestAmino): QueryDelegationRewardsRequest { - return { - delegatorAddress: object.delegator_address, - validatorAddress: object.validator_address - }; + const message = createBaseQueryDelegationRewardsRequest(); + if (object.delegator_address !== undefined && object.delegator_address !== null) { + message.delegatorAddress = object.delegator_address; + } + if (object.validator_address !== undefined && object.validator_address !== null) { + message.validatorAddress = object.validator_address; + } + return message; }, toAmino(message: QueryDelegationRewardsRequest): QueryDelegationRewardsRequestAmino { const obj: any = {}; @@ -1235,9 +1480,9 @@ export const QueryDelegationRewardsResponse = { return message; }, fromAmino(object: QueryDelegationRewardsResponseAmino): QueryDelegationRewardsResponse { - return { - rewards: Array.isArray(object?.rewards) ? object.rewards.map((e: any) => DecCoin.fromAmino(e)) : [] - }; + const message = createBaseQueryDelegationRewardsResponse(); + message.rewards = object.rewards?.map(e => DecCoin.fromAmino(e)) || []; + return message; }, toAmino(message: QueryDelegationRewardsResponse): QueryDelegationRewardsResponseAmino { const obj: any = {}; @@ -1306,9 +1551,11 @@ export const QueryDelegationTotalRewardsRequest = { return message; }, fromAmino(object: QueryDelegationTotalRewardsRequestAmino): QueryDelegationTotalRewardsRequest { - return { - delegatorAddress: object.delegator_address - }; + const message = createBaseQueryDelegationTotalRewardsRequest(); + if (object.delegator_address !== undefined && object.delegator_address !== null) { + message.delegatorAddress = object.delegator_address; + } + return message; }, toAmino(message: QueryDelegationTotalRewardsRequest): QueryDelegationTotalRewardsRequestAmino { const obj: any = {}; @@ -1381,10 +1628,10 @@ export const QueryDelegationTotalRewardsResponse = { return message; }, fromAmino(object: QueryDelegationTotalRewardsResponseAmino): QueryDelegationTotalRewardsResponse { - return { - rewards: Array.isArray(object?.rewards) ? object.rewards.map((e: any) => DelegationDelegatorReward.fromAmino(e)) : [], - total: Array.isArray(object?.total) ? object.total.map((e: any) => DecCoin.fromAmino(e)) : [] - }; + const message = createBaseQueryDelegationTotalRewardsResponse(); + message.rewards = object.rewards?.map(e => DelegationDelegatorReward.fromAmino(e)) || []; + message.total = object.total?.map(e => DecCoin.fromAmino(e)) || []; + return message; }, toAmino(message: QueryDelegationTotalRewardsResponse): QueryDelegationTotalRewardsResponseAmino { const obj: any = {}; @@ -1458,9 +1705,11 @@ export const QueryDelegatorValidatorsRequest = { return message; }, fromAmino(object: QueryDelegatorValidatorsRequestAmino): QueryDelegatorValidatorsRequest { - return { - delegatorAddress: object.delegator_address - }; + const message = createBaseQueryDelegatorValidatorsRequest(); + if (object.delegator_address !== undefined && object.delegator_address !== null) { + message.delegatorAddress = object.delegator_address; + } + return message; }, toAmino(message: QueryDelegatorValidatorsRequest): QueryDelegatorValidatorsRequestAmino { const obj: any = {}; @@ -1525,9 +1774,9 @@ export const QueryDelegatorValidatorsResponse = { return message; }, fromAmino(object: QueryDelegatorValidatorsResponseAmino): QueryDelegatorValidatorsResponse { - return { - validators: Array.isArray(object?.validators) ? object.validators.map((e: any) => e) : [] - }; + const message = createBaseQueryDelegatorValidatorsResponse(); + message.validators = object.validators?.map(e => e) || []; + return message; }, toAmino(message: QueryDelegatorValidatorsResponse): QueryDelegatorValidatorsResponseAmino { const obj: any = {}; @@ -1596,9 +1845,11 @@ export const QueryDelegatorWithdrawAddressRequest = { return message; }, fromAmino(object: QueryDelegatorWithdrawAddressRequestAmino): QueryDelegatorWithdrawAddressRequest { - return { - delegatorAddress: object.delegator_address - }; + const message = createBaseQueryDelegatorWithdrawAddressRequest(); + if (object.delegator_address !== undefined && object.delegator_address !== null) { + message.delegatorAddress = object.delegator_address; + } + return message; }, toAmino(message: QueryDelegatorWithdrawAddressRequest): QueryDelegatorWithdrawAddressRequestAmino { const obj: any = {}; @@ -1663,9 +1914,11 @@ export const QueryDelegatorWithdrawAddressResponse = { return message; }, fromAmino(object: QueryDelegatorWithdrawAddressResponseAmino): QueryDelegatorWithdrawAddressResponse { - return { - withdrawAddress: object.withdraw_address - }; + const message = createBaseQueryDelegatorWithdrawAddressResponse(); + if (object.withdraw_address !== undefined && object.withdraw_address !== null) { + message.withdrawAddress = object.withdraw_address; + } + return message; }, toAmino(message: QueryDelegatorWithdrawAddressResponse): QueryDelegatorWithdrawAddressResponseAmino { const obj: any = {}; @@ -1721,7 +1974,8 @@ export const QueryCommunityPoolRequest = { return message; }, fromAmino(_: QueryCommunityPoolRequestAmino): QueryCommunityPoolRequest { - return {}; + const message = createBaseQueryCommunityPoolRequest(); + return message; }, toAmino(_: QueryCommunityPoolRequest): QueryCommunityPoolRequestAmino { const obj: any = {}; @@ -1785,9 +2039,9 @@ export const QueryCommunityPoolResponse = { return message; }, fromAmino(object: QueryCommunityPoolResponseAmino): QueryCommunityPoolResponse { - return { - pool: Array.isArray(object?.pool) ? object.pool.map((e: any) => DecCoin.fromAmino(e)) : [] - }; + const message = createBaseQueryCommunityPoolResponse(); + message.pool = object.pool?.map(e => DecCoin.fromAmino(e)) || []; + return message; }, toAmino(message: QueryCommunityPoolResponse): QueryCommunityPoolResponseAmino { const obj: any = {}; diff --git a/packages/osmo-query/src/codegen/cosmos/distribution/v1beta1/tx.amino.ts b/packages/osmo-query/src/codegen/cosmos/distribution/v1beta1/tx.amino.ts index a55f1e3f2..1e9b2effd 100644 --- a/packages/osmo-query/src/codegen/cosmos/distribution/v1beta1/tx.amino.ts +++ b/packages/osmo-query/src/codegen/cosmos/distribution/v1beta1/tx.amino.ts @@ -1,5 +1,5 @@ //@ts-nocheck -import { MsgSetWithdrawAddress, MsgWithdrawDelegatorReward, MsgWithdrawValidatorCommission, MsgFundCommunityPool } from "./tx"; +import { MsgSetWithdrawAddress, MsgWithdrawDelegatorReward, MsgWithdrawValidatorCommission, MsgFundCommunityPool, MsgUpdateParams, MsgCommunityPoolSpend } from "./tx"; export const AminoConverter = { "/cosmos.distribution.v1beta1.MsgSetWithdrawAddress": { aminoType: "cosmos-sdk/MsgModifyWithdrawAddress", @@ -20,5 +20,15 @@ export const AminoConverter = { aminoType: "cosmos-sdk/MsgFundCommunityPool", toAmino: MsgFundCommunityPool.toAmino, fromAmino: MsgFundCommunityPool.fromAmino + }, + "/cosmos.distribution.v1beta1.MsgUpdateParams": { + aminoType: "cosmos-sdk/distribution/MsgUpdateParams", + toAmino: MsgUpdateParams.toAmino, + fromAmino: MsgUpdateParams.fromAmino + }, + "/cosmos.distribution.v1beta1.MsgCommunityPoolSpend": { + aminoType: "cosmos-sdk/distr/MsgCommunityPoolSpend", + toAmino: MsgCommunityPoolSpend.toAmino, + fromAmino: MsgCommunityPoolSpend.fromAmino } }; \ No newline at end of file diff --git a/packages/osmo-query/src/codegen/cosmos/distribution/v1beta1/tx.registry.ts b/packages/osmo-query/src/codegen/cosmos/distribution/v1beta1/tx.registry.ts index 52151ed59..76932c04c 100644 --- a/packages/osmo-query/src/codegen/cosmos/distribution/v1beta1/tx.registry.ts +++ b/packages/osmo-query/src/codegen/cosmos/distribution/v1beta1/tx.registry.ts @@ -1,7 +1,7 @@ //@ts-nocheck import { GeneratedType, Registry } from "@cosmjs/proto-signing"; -import { MsgSetWithdrawAddress, MsgWithdrawDelegatorReward, MsgWithdrawValidatorCommission, MsgFundCommunityPool } from "./tx"; -export const registry: ReadonlyArray<[string, GeneratedType]> = [["/cosmos.distribution.v1beta1.MsgSetWithdrawAddress", MsgSetWithdrawAddress], ["/cosmos.distribution.v1beta1.MsgWithdrawDelegatorReward", MsgWithdrawDelegatorReward], ["/cosmos.distribution.v1beta1.MsgWithdrawValidatorCommission", MsgWithdrawValidatorCommission], ["/cosmos.distribution.v1beta1.MsgFundCommunityPool", MsgFundCommunityPool]]; +import { MsgSetWithdrawAddress, MsgWithdrawDelegatorReward, MsgWithdrawValidatorCommission, MsgFundCommunityPool, MsgUpdateParams, MsgCommunityPoolSpend } from "./tx"; +export const registry: ReadonlyArray<[string, GeneratedType]> = [["/cosmos.distribution.v1beta1.MsgSetWithdrawAddress", MsgSetWithdrawAddress], ["/cosmos.distribution.v1beta1.MsgWithdrawDelegatorReward", MsgWithdrawDelegatorReward], ["/cosmos.distribution.v1beta1.MsgWithdrawValidatorCommission", MsgWithdrawValidatorCommission], ["/cosmos.distribution.v1beta1.MsgFundCommunityPool", MsgFundCommunityPool], ["/cosmos.distribution.v1beta1.MsgUpdateParams", MsgUpdateParams], ["/cosmos.distribution.v1beta1.MsgCommunityPoolSpend", MsgCommunityPoolSpend]]; export const load = (protoRegistry: Registry) => { registry.forEach(([typeUrl, mod]) => { protoRegistry.register(typeUrl, mod); @@ -32,6 +32,18 @@ export const MessageComposer = { typeUrl: "/cosmos.distribution.v1beta1.MsgFundCommunityPool", value: MsgFundCommunityPool.encode(value).finish() }; + }, + updateParams(value: MsgUpdateParams) { + return { + typeUrl: "/cosmos.distribution.v1beta1.MsgUpdateParams", + value: MsgUpdateParams.encode(value).finish() + }; + }, + communityPoolSpend(value: MsgCommunityPoolSpend) { + return { + typeUrl: "/cosmos.distribution.v1beta1.MsgCommunityPoolSpend", + value: MsgCommunityPoolSpend.encode(value).finish() + }; } }, withTypeUrl: { @@ -58,6 +70,18 @@ export const MessageComposer = { typeUrl: "/cosmos.distribution.v1beta1.MsgFundCommunityPool", value }; + }, + updateParams(value: MsgUpdateParams) { + return { + typeUrl: "/cosmos.distribution.v1beta1.MsgUpdateParams", + value + }; + }, + communityPoolSpend(value: MsgCommunityPoolSpend) { + return { + typeUrl: "/cosmos.distribution.v1beta1.MsgCommunityPoolSpend", + value + }; } }, fromPartial: { @@ -84,6 +108,18 @@ export const MessageComposer = { typeUrl: "/cosmos.distribution.v1beta1.MsgFundCommunityPool", value: MsgFundCommunityPool.fromPartial(value) }; + }, + updateParams(value: MsgUpdateParams) { + return { + typeUrl: "/cosmos.distribution.v1beta1.MsgUpdateParams", + value: MsgUpdateParams.fromPartial(value) + }; + }, + communityPoolSpend(value: MsgCommunityPoolSpend) { + return { + typeUrl: "/cosmos.distribution.v1beta1.MsgCommunityPoolSpend", + value: MsgCommunityPoolSpend.fromPartial(value) + }; } } }; \ No newline at end of file diff --git a/packages/osmo-query/src/codegen/cosmos/distribution/v1beta1/tx.rpc.msg.ts b/packages/osmo-query/src/codegen/cosmos/distribution/v1beta1/tx.rpc.msg.ts index c66ec3e0b..f3ac60c47 100644 --- a/packages/osmo-query/src/codegen/cosmos/distribution/v1beta1/tx.rpc.msg.ts +++ b/packages/osmo-query/src/codegen/cosmos/distribution/v1beta1/tx.rpc.msg.ts @@ -1,6 +1,6 @@ import { Rpc } from "../../../helpers"; import { BinaryReader } from "../../../binary"; -import { MsgSetWithdrawAddress, MsgSetWithdrawAddressResponse, MsgWithdrawDelegatorReward, MsgWithdrawDelegatorRewardResponse, MsgWithdrawValidatorCommission, MsgWithdrawValidatorCommissionResponse, MsgFundCommunityPool, MsgFundCommunityPoolResponse } from "./tx"; +import { MsgSetWithdrawAddress, MsgSetWithdrawAddressResponse, MsgWithdrawDelegatorReward, MsgWithdrawDelegatorRewardResponse, MsgWithdrawValidatorCommission, MsgWithdrawValidatorCommissionResponse, MsgFundCommunityPool, MsgFundCommunityPoolResponse, MsgUpdateParams, MsgUpdateParamsResponse, MsgCommunityPoolSpend, MsgCommunityPoolSpendResponse } from "./tx"; /** Msg defines the distribution Msg service. */ export interface Msg { /** @@ -23,6 +23,22 @@ export interface Msg { * fund the community pool. */ fundCommunityPool(request: MsgFundCommunityPool): Promise; + /** + * UpdateParams defines a governance operation for updating the x/distribution + * module parameters. The authority is defined in the keeper. + * + * Since: cosmos-sdk 0.47 + */ + updateParams(request: MsgUpdateParams): Promise; + /** + * CommunityPoolSpend defines a governance operation for sending tokens from + * the community pool in the x/distribution module to another account, which + * could be the governance module itself. The authority is defined in the + * keeper. + * + * Since: cosmos-sdk 0.47 + */ + communityPoolSpend(request: MsgCommunityPoolSpend): Promise; } export class MsgClientImpl implements Msg { private readonly rpc: Rpc; @@ -32,6 +48,8 @@ export class MsgClientImpl implements Msg { this.withdrawDelegatorReward = this.withdrawDelegatorReward.bind(this); this.withdrawValidatorCommission = this.withdrawValidatorCommission.bind(this); this.fundCommunityPool = this.fundCommunityPool.bind(this); + this.updateParams = this.updateParams.bind(this); + this.communityPoolSpend = this.communityPoolSpend.bind(this); } setWithdrawAddress(request: MsgSetWithdrawAddress): Promise { const data = MsgSetWithdrawAddress.encode(request).finish(); @@ -53,4 +71,14 @@ export class MsgClientImpl implements Msg { const promise = this.rpc.request("cosmos.distribution.v1beta1.Msg", "FundCommunityPool", data); return promise.then(data => MsgFundCommunityPoolResponse.decode(new BinaryReader(data))); } + updateParams(request: MsgUpdateParams): Promise { + const data = MsgUpdateParams.encode(request).finish(); + const promise = this.rpc.request("cosmos.distribution.v1beta1.Msg", "UpdateParams", data); + return promise.then(data => MsgUpdateParamsResponse.decode(new BinaryReader(data))); + } + communityPoolSpend(request: MsgCommunityPoolSpend): Promise { + const data = MsgCommunityPoolSpend.encode(request).finish(); + const promise = this.rpc.request("cosmos.distribution.v1beta1.Msg", "CommunityPoolSpend", data); + return promise.then(data => MsgCommunityPoolSpendResponse.decode(new BinaryReader(data))); + } } \ No newline at end of file diff --git a/packages/osmo-query/src/codegen/cosmos/distribution/v1beta1/tx.ts b/packages/osmo-query/src/codegen/cosmos/distribution/v1beta1/tx.ts index ba3020536..d8cb24be9 100644 --- a/packages/osmo-query/src/codegen/cosmos/distribution/v1beta1/tx.ts +++ b/packages/osmo-query/src/codegen/cosmos/distribution/v1beta1/tx.ts @@ -1,4 +1,5 @@ import { Coin, CoinAmino, CoinSDKType } from "../../base/v1beta1/coin"; +import { Params, ParamsAmino, ParamsSDKType } from "./distribution"; import { BinaryReader, BinaryWriter } from "../../../binary"; /** * MsgSetWithdrawAddress sets the withdraw address for @@ -17,8 +18,8 @@ export interface MsgSetWithdrawAddressProtoMsg { * a delegator (or validator self-delegation). */ export interface MsgSetWithdrawAddressAmino { - delegator_address: string; - withdraw_address: string; + delegator_address?: string; + withdraw_address?: string; } export interface MsgSetWithdrawAddressAminoMsg { type: "cosmos-sdk/MsgModifyWithdrawAddress"; @@ -32,19 +33,28 @@ export interface MsgSetWithdrawAddressSDKType { delegator_address: string; withdraw_address: string; } -/** MsgSetWithdrawAddressResponse defines the Msg/SetWithdrawAddress response type. */ +/** + * MsgSetWithdrawAddressResponse defines the Msg/SetWithdrawAddress response + * type. + */ export interface MsgSetWithdrawAddressResponse {} export interface MsgSetWithdrawAddressResponseProtoMsg { typeUrl: "/cosmos.distribution.v1beta1.MsgSetWithdrawAddressResponse"; value: Uint8Array; } -/** MsgSetWithdrawAddressResponse defines the Msg/SetWithdrawAddress response type. */ +/** + * MsgSetWithdrawAddressResponse defines the Msg/SetWithdrawAddress response + * type. + */ export interface MsgSetWithdrawAddressResponseAmino {} export interface MsgSetWithdrawAddressResponseAminoMsg { type: "cosmos-sdk/MsgSetWithdrawAddressResponse"; value: MsgSetWithdrawAddressResponseAmino; } -/** MsgSetWithdrawAddressResponse defines the Msg/SetWithdrawAddress response type. */ +/** + * MsgSetWithdrawAddressResponse defines the Msg/SetWithdrawAddress response + * type. + */ export interface MsgSetWithdrawAddressResponseSDKType {} /** * MsgWithdrawDelegatorReward represents delegation withdrawal to a delegator @@ -63,8 +73,8 @@ export interface MsgWithdrawDelegatorRewardProtoMsg { * from a single validator. */ export interface MsgWithdrawDelegatorRewardAmino { - delegator_address: string; - validator_address: string; + delegator_address?: string; + validator_address?: string; } export interface MsgWithdrawDelegatorRewardAminoMsg { type: "cosmos-sdk/MsgWithdrawDelegationReward"; @@ -78,20 +88,37 @@ export interface MsgWithdrawDelegatorRewardSDKType { delegator_address: string; validator_address: string; } -/** MsgWithdrawDelegatorRewardResponse defines the Msg/WithdrawDelegatorReward response type. */ -export interface MsgWithdrawDelegatorRewardResponse {} +/** + * MsgWithdrawDelegatorRewardResponse defines the Msg/WithdrawDelegatorReward + * response type. + */ +export interface MsgWithdrawDelegatorRewardResponse { + /** Since: cosmos-sdk 0.46 */ + amount: Coin[]; +} export interface MsgWithdrawDelegatorRewardResponseProtoMsg { typeUrl: "/cosmos.distribution.v1beta1.MsgWithdrawDelegatorRewardResponse"; value: Uint8Array; } -/** MsgWithdrawDelegatorRewardResponse defines the Msg/WithdrawDelegatorReward response type. */ -export interface MsgWithdrawDelegatorRewardResponseAmino {} +/** + * MsgWithdrawDelegatorRewardResponse defines the Msg/WithdrawDelegatorReward + * response type. + */ +export interface MsgWithdrawDelegatorRewardResponseAmino { + /** Since: cosmos-sdk 0.46 */ + amount: CoinAmino[]; +} export interface MsgWithdrawDelegatorRewardResponseAminoMsg { type: "cosmos-sdk/MsgWithdrawDelegatorRewardResponse"; value: MsgWithdrawDelegatorRewardResponseAmino; } -/** MsgWithdrawDelegatorRewardResponse defines the Msg/WithdrawDelegatorReward response type. */ -export interface MsgWithdrawDelegatorRewardResponseSDKType {} +/** + * MsgWithdrawDelegatorRewardResponse defines the Msg/WithdrawDelegatorReward + * response type. + */ +export interface MsgWithdrawDelegatorRewardResponseSDKType { + amount: CoinSDKType[]; +} /** * MsgWithdrawValidatorCommission withdraws the full commission to the validator * address. @@ -108,7 +135,7 @@ export interface MsgWithdrawValidatorCommissionProtoMsg { * address. */ export interface MsgWithdrawValidatorCommissionAmino { - validator_address: string; + validator_address?: string; } export interface MsgWithdrawValidatorCommissionAminoMsg { type: "cosmos-sdk/MsgWithdrawValidatorCommission"; @@ -121,20 +148,37 @@ export interface MsgWithdrawValidatorCommissionAminoMsg { export interface MsgWithdrawValidatorCommissionSDKType { validator_address: string; } -/** MsgWithdrawValidatorCommissionResponse defines the Msg/WithdrawValidatorCommission response type. */ -export interface MsgWithdrawValidatorCommissionResponse {} +/** + * MsgWithdrawValidatorCommissionResponse defines the + * Msg/WithdrawValidatorCommission response type. + */ +export interface MsgWithdrawValidatorCommissionResponse { + /** Since: cosmos-sdk 0.46 */ + amount: Coin[]; +} export interface MsgWithdrawValidatorCommissionResponseProtoMsg { typeUrl: "/cosmos.distribution.v1beta1.MsgWithdrawValidatorCommissionResponse"; value: Uint8Array; } -/** MsgWithdrawValidatorCommissionResponse defines the Msg/WithdrawValidatorCommission response type. */ -export interface MsgWithdrawValidatorCommissionResponseAmino {} +/** + * MsgWithdrawValidatorCommissionResponse defines the + * Msg/WithdrawValidatorCommission response type. + */ +export interface MsgWithdrawValidatorCommissionResponseAmino { + /** Since: cosmos-sdk 0.46 */ + amount: CoinAmino[]; +} export interface MsgWithdrawValidatorCommissionResponseAminoMsg { type: "cosmos-sdk/MsgWithdrawValidatorCommissionResponse"; value: MsgWithdrawValidatorCommissionResponseAmino; } -/** MsgWithdrawValidatorCommissionResponse defines the Msg/WithdrawValidatorCommission response type. */ -export interface MsgWithdrawValidatorCommissionResponseSDKType {} +/** + * MsgWithdrawValidatorCommissionResponse defines the + * Msg/WithdrawValidatorCommission response type. + */ +export interface MsgWithdrawValidatorCommissionResponseSDKType { + amount: CoinSDKType[]; +} /** * MsgFundCommunityPool allows an account to directly * fund the community pool. @@ -153,7 +197,7 @@ export interface MsgFundCommunityPoolProtoMsg { */ export interface MsgFundCommunityPoolAmino { amount: CoinAmino[]; - depositor: string; + depositor?: string; } export interface MsgFundCommunityPoolAminoMsg { type: "cosmos-sdk/MsgFundCommunityPool"; @@ -181,6 +225,157 @@ export interface MsgFundCommunityPoolResponseAminoMsg { } /** MsgFundCommunityPoolResponse defines the Msg/FundCommunityPool response type. */ export interface MsgFundCommunityPoolResponseSDKType {} +/** + * MsgUpdateParams is the Msg/UpdateParams request type. + * + * Since: cosmos-sdk 0.47 + */ +export interface MsgUpdateParams { + /** authority is the address that controls the module (defaults to x/gov unless overwritten). */ + authority: string; + /** + * params defines the x/distribution parameters to update. + * + * NOTE: All parameters must be supplied. + */ + params: Params; +} +export interface MsgUpdateParamsProtoMsg { + typeUrl: "/cosmos.distribution.v1beta1.MsgUpdateParams"; + value: Uint8Array; +} +/** + * MsgUpdateParams is the Msg/UpdateParams request type. + * + * Since: cosmos-sdk 0.47 + */ +export interface MsgUpdateParamsAmino { + /** authority is the address that controls the module (defaults to x/gov unless overwritten). */ + authority?: string; + /** + * params defines the x/distribution parameters to update. + * + * NOTE: All parameters must be supplied. + */ + params: ParamsAmino; +} +export interface MsgUpdateParamsAminoMsg { + type: "cosmos-sdk/distribution/MsgUpdateParams"; + value: MsgUpdateParamsAmino; +} +/** + * MsgUpdateParams is the Msg/UpdateParams request type. + * + * Since: cosmos-sdk 0.47 + */ +export interface MsgUpdateParamsSDKType { + authority: string; + params: ParamsSDKType; +} +/** + * MsgUpdateParamsResponse defines the response structure for executing a + * MsgUpdateParams message. + * + * Since: cosmos-sdk 0.47 + */ +export interface MsgUpdateParamsResponse {} +export interface MsgUpdateParamsResponseProtoMsg { + typeUrl: "/cosmos.distribution.v1beta1.MsgUpdateParamsResponse"; + value: Uint8Array; +} +/** + * MsgUpdateParamsResponse defines the response structure for executing a + * MsgUpdateParams message. + * + * Since: cosmos-sdk 0.47 + */ +export interface MsgUpdateParamsResponseAmino {} +export interface MsgUpdateParamsResponseAminoMsg { + type: "cosmos-sdk/MsgUpdateParamsResponse"; + value: MsgUpdateParamsResponseAmino; +} +/** + * MsgUpdateParamsResponse defines the response structure for executing a + * MsgUpdateParams message. + * + * Since: cosmos-sdk 0.47 + */ +export interface MsgUpdateParamsResponseSDKType {} +/** + * MsgCommunityPoolSpend defines a message for sending tokens from the community + * pool to another account. This message is typically executed via a governance + * proposal with the governance module being the executing authority. + * + * Since: cosmos-sdk 0.47 + */ +export interface MsgCommunityPoolSpend { + /** authority is the address that controls the module (defaults to x/gov unless overwritten). */ + authority: string; + recipient: string; + amount: Coin[]; +} +export interface MsgCommunityPoolSpendProtoMsg { + typeUrl: "/cosmos.distribution.v1beta1.MsgCommunityPoolSpend"; + value: Uint8Array; +} +/** + * MsgCommunityPoolSpend defines a message for sending tokens from the community + * pool to another account. This message is typically executed via a governance + * proposal with the governance module being the executing authority. + * + * Since: cosmos-sdk 0.47 + */ +export interface MsgCommunityPoolSpendAmino { + /** authority is the address that controls the module (defaults to x/gov unless overwritten). */ + authority?: string; + recipient?: string; + amount: CoinAmino[]; +} +export interface MsgCommunityPoolSpendAminoMsg { + type: "cosmos-sdk/distr/MsgCommunityPoolSpend"; + value: MsgCommunityPoolSpendAmino; +} +/** + * MsgCommunityPoolSpend defines a message for sending tokens from the community + * pool to another account. This message is typically executed via a governance + * proposal with the governance module being the executing authority. + * + * Since: cosmos-sdk 0.47 + */ +export interface MsgCommunityPoolSpendSDKType { + authority: string; + recipient: string; + amount: CoinSDKType[]; +} +/** + * MsgCommunityPoolSpendResponse defines the response to executing a + * MsgCommunityPoolSpend message. + * + * Since: cosmos-sdk 0.47 + */ +export interface MsgCommunityPoolSpendResponse {} +export interface MsgCommunityPoolSpendResponseProtoMsg { + typeUrl: "/cosmos.distribution.v1beta1.MsgCommunityPoolSpendResponse"; + value: Uint8Array; +} +/** + * MsgCommunityPoolSpendResponse defines the response to executing a + * MsgCommunityPoolSpend message. + * + * Since: cosmos-sdk 0.47 + */ +export interface MsgCommunityPoolSpendResponseAmino {} +export interface MsgCommunityPoolSpendResponseAminoMsg { + type: "cosmos-sdk/MsgCommunityPoolSpendResponse"; + value: MsgCommunityPoolSpendResponseAmino; +} +/** + * MsgCommunityPoolSpendResponse defines the response to executing a + * MsgCommunityPoolSpend message. + * + * Since: cosmos-sdk 0.47 + */ +export interface MsgCommunityPoolSpendResponseSDKType {} function createBaseMsgSetWithdrawAddress(): MsgSetWithdrawAddress { return { delegatorAddress: "", @@ -225,10 +420,14 @@ export const MsgSetWithdrawAddress = { return message; }, fromAmino(object: MsgSetWithdrawAddressAmino): MsgSetWithdrawAddress { - return { - delegatorAddress: object.delegator_address, - withdrawAddress: object.withdraw_address - }; + const message = createBaseMsgSetWithdrawAddress(); + if (object.delegator_address !== undefined && object.delegator_address !== null) { + message.delegatorAddress = object.delegator_address; + } + if (object.withdraw_address !== undefined && object.withdraw_address !== null) { + message.withdrawAddress = object.withdraw_address; + } + return message; }, toAmino(message: MsgSetWithdrawAddress): MsgSetWithdrawAddressAmino { const obj: any = {}; @@ -285,7 +484,8 @@ export const MsgSetWithdrawAddressResponse = { return message; }, fromAmino(_: MsgSetWithdrawAddressResponseAmino): MsgSetWithdrawAddressResponse { - return {}; + const message = createBaseMsgSetWithdrawAddressResponse(); + return message; }, toAmino(_: MsgSetWithdrawAddressResponse): MsgSetWithdrawAddressResponseAmino { const obj: any = {}; @@ -357,10 +557,14 @@ export const MsgWithdrawDelegatorReward = { return message; }, fromAmino(object: MsgWithdrawDelegatorRewardAmino): MsgWithdrawDelegatorReward { - return { - delegatorAddress: object.delegator_address, - validatorAddress: object.validator_address - }; + const message = createBaseMsgWithdrawDelegatorReward(); + if (object.delegator_address !== undefined && object.delegator_address !== null) { + message.delegatorAddress = object.delegator_address; + } + if (object.validator_address !== undefined && object.validator_address !== null) { + message.validatorAddress = object.validator_address; + } + return message; }, toAmino(message: MsgWithdrawDelegatorReward): MsgWithdrawDelegatorRewardAmino { const obj: any = {}; @@ -391,11 +595,16 @@ export const MsgWithdrawDelegatorReward = { } }; function createBaseMsgWithdrawDelegatorRewardResponse(): MsgWithdrawDelegatorRewardResponse { - return {}; + return { + amount: [] + }; } export const MsgWithdrawDelegatorRewardResponse = { typeUrl: "/cosmos.distribution.v1beta1.MsgWithdrawDelegatorRewardResponse", - encode(_: MsgWithdrawDelegatorRewardResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + encode(message: MsgWithdrawDelegatorRewardResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.amount) { + Coin.encode(v!, writer.uint32(10).fork()).ldelim(); + } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): MsgWithdrawDelegatorRewardResponse { @@ -405,6 +614,9 @@ export const MsgWithdrawDelegatorRewardResponse = { while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { + case 1: + message.amount.push(Coin.decode(reader, reader.uint32())); + break; default: reader.skipType(tag & 7); break; @@ -412,15 +624,23 @@ export const MsgWithdrawDelegatorRewardResponse = { } return message; }, - fromPartial(_: Partial): MsgWithdrawDelegatorRewardResponse { + fromPartial(object: Partial): MsgWithdrawDelegatorRewardResponse { const message = createBaseMsgWithdrawDelegatorRewardResponse(); + message.amount = object.amount?.map(e => Coin.fromPartial(e)) || []; return message; }, - fromAmino(_: MsgWithdrawDelegatorRewardResponseAmino): MsgWithdrawDelegatorRewardResponse { - return {}; + fromAmino(object: MsgWithdrawDelegatorRewardResponseAmino): MsgWithdrawDelegatorRewardResponse { + const message = createBaseMsgWithdrawDelegatorRewardResponse(); + message.amount = object.amount?.map(e => Coin.fromAmino(e)) || []; + return message; }, - toAmino(_: MsgWithdrawDelegatorRewardResponse): MsgWithdrawDelegatorRewardResponseAmino { + toAmino(message: MsgWithdrawDelegatorRewardResponse): MsgWithdrawDelegatorRewardResponseAmino { const obj: any = {}; + if (message.amount) { + obj.amount = message.amount.map(e => e ? Coin.toAmino(e) : undefined); + } else { + obj.amount = []; + } return obj; }, fromAminoMsg(object: MsgWithdrawDelegatorRewardResponseAminoMsg): MsgWithdrawDelegatorRewardResponse { @@ -481,9 +701,11 @@ export const MsgWithdrawValidatorCommission = { return message; }, fromAmino(object: MsgWithdrawValidatorCommissionAmino): MsgWithdrawValidatorCommission { - return { - validatorAddress: object.validator_address - }; + const message = createBaseMsgWithdrawValidatorCommission(); + if (object.validator_address !== undefined && object.validator_address !== null) { + message.validatorAddress = object.validator_address; + } + return message; }, toAmino(message: MsgWithdrawValidatorCommission): MsgWithdrawValidatorCommissionAmino { const obj: any = {}; @@ -513,11 +735,16 @@ export const MsgWithdrawValidatorCommission = { } }; function createBaseMsgWithdrawValidatorCommissionResponse(): MsgWithdrawValidatorCommissionResponse { - return {}; + return { + amount: [] + }; } export const MsgWithdrawValidatorCommissionResponse = { typeUrl: "/cosmos.distribution.v1beta1.MsgWithdrawValidatorCommissionResponse", - encode(_: MsgWithdrawValidatorCommissionResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + encode(message: MsgWithdrawValidatorCommissionResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.amount) { + Coin.encode(v!, writer.uint32(10).fork()).ldelim(); + } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): MsgWithdrawValidatorCommissionResponse { @@ -527,6 +754,9 @@ export const MsgWithdrawValidatorCommissionResponse = { while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { + case 1: + message.amount.push(Coin.decode(reader, reader.uint32())); + break; default: reader.skipType(tag & 7); break; @@ -534,15 +764,23 @@ export const MsgWithdrawValidatorCommissionResponse = { } return message; }, - fromPartial(_: Partial): MsgWithdrawValidatorCommissionResponse { + fromPartial(object: Partial): MsgWithdrawValidatorCommissionResponse { const message = createBaseMsgWithdrawValidatorCommissionResponse(); + message.amount = object.amount?.map(e => Coin.fromPartial(e)) || []; return message; }, - fromAmino(_: MsgWithdrawValidatorCommissionResponseAmino): MsgWithdrawValidatorCommissionResponse { - return {}; + fromAmino(object: MsgWithdrawValidatorCommissionResponseAmino): MsgWithdrawValidatorCommissionResponse { + const message = createBaseMsgWithdrawValidatorCommissionResponse(); + message.amount = object.amount?.map(e => Coin.fromAmino(e)) || []; + return message; }, - toAmino(_: MsgWithdrawValidatorCommissionResponse): MsgWithdrawValidatorCommissionResponseAmino { + toAmino(message: MsgWithdrawValidatorCommissionResponse): MsgWithdrawValidatorCommissionResponseAmino { const obj: any = {}; + if (message.amount) { + obj.amount = message.amount.map(e => e ? Coin.toAmino(e) : undefined); + } else { + obj.amount = []; + } return obj; }, fromAminoMsg(object: MsgWithdrawValidatorCommissionResponseAminoMsg): MsgWithdrawValidatorCommissionResponse { @@ -611,10 +849,12 @@ export const MsgFundCommunityPool = { return message; }, fromAmino(object: MsgFundCommunityPoolAmino): MsgFundCommunityPool { - return { - amount: Array.isArray(object?.amount) ? object.amount.map((e: any) => Coin.fromAmino(e)) : [], - depositor: object.depositor - }; + const message = createBaseMsgFundCommunityPool(); + message.amount = object.amount?.map(e => Coin.fromAmino(e)) || []; + if (object.depositor !== undefined && object.depositor !== null) { + message.depositor = object.depositor; + } + return message; }, toAmino(message: MsgFundCommunityPool): MsgFundCommunityPoolAmino { const obj: any = {}; @@ -675,7 +915,8 @@ export const MsgFundCommunityPoolResponse = { return message; }, fromAmino(_: MsgFundCommunityPoolResponseAmino): MsgFundCommunityPoolResponse { - return {}; + const message = createBaseMsgFundCommunityPoolResponse(); + return message; }, toAmino(_: MsgFundCommunityPoolResponse): MsgFundCommunityPoolResponseAmino { const obj: any = {}; @@ -702,4 +943,292 @@ export const MsgFundCommunityPoolResponse = { value: MsgFundCommunityPoolResponse.encode(message).finish() }; } +}; +function createBaseMsgUpdateParams(): MsgUpdateParams { + return { + authority: "", + params: Params.fromPartial({}) + }; +} +export const MsgUpdateParams = { + typeUrl: "/cosmos.distribution.v1beta1.MsgUpdateParams", + encode(message: MsgUpdateParams, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.authority !== "") { + writer.uint32(10).string(message.authority); + } + if (message.params !== undefined) { + Params.encode(message.params, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgUpdateParams { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUpdateParams(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.authority = reader.string(); + break; + case 2: + message.params = Params.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgUpdateParams { + const message = createBaseMsgUpdateParams(); + message.authority = object.authority ?? ""; + message.params = object.params !== undefined && object.params !== null ? Params.fromPartial(object.params) : undefined; + return message; + }, + fromAmino(object: MsgUpdateParamsAmino): MsgUpdateParams { + const message = createBaseMsgUpdateParams(); + if (object.authority !== undefined && object.authority !== null) { + message.authority = object.authority; + } + if (object.params !== undefined && object.params !== null) { + message.params = Params.fromAmino(object.params); + } + return message; + }, + toAmino(message: MsgUpdateParams): MsgUpdateParamsAmino { + const obj: any = {}; + obj.authority = message.authority; + obj.params = message.params ? Params.toAmino(message.params) : Params.fromPartial({}); + return obj; + }, + fromAminoMsg(object: MsgUpdateParamsAminoMsg): MsgUpdateParams { + return MsgUpdateParams.fromAmino(object.value); + }, + toAminoMsg(message: MsgUpdateParams): MsgUpdateParamsAminoMsg { + return { + type: "cosmos-sdk/distribution/MsgUpdateParams", + value: MsgUpdateParams.toAmino(message) + }; + }, + fromProtoMsg(message: MsgUpdateParamsProtoMsg): MsgUpdateParams { + return MsgUpdateParams.decode(message.value); + }, + toProto(message: MsgUpdateParams): Uint8Array { + return MsgUpdateParams.encode(message).finish(); + }, + toProtoMsg(message: MsgUpdateParams): MsgUpdateParamsProtoMsg { + return { + typeUrl: "/cosmos.distribution.v1beta1.MsgUpdateParams", + value: MsgUpdateParams.encode(message).finish() + }; + } +}; +function createBaseMsgUpdateParamsResponse(): MsgUpdateParamsResponse { + return {}; +} +export const MsgUpdateParamsResponse = { + typeUrl: "/cosmos.distribution.v1beta1.MsgUpdateParamsResponse", + encode(_: MsgUpdateParamsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgUpdateParamsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUpdateParamsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): MsgUpdateParamsResponse { + const message = createBaseMsgUpdateParamsResponse(); + return message; + }, + fromAmino(_: MsgUpdateParamsResponseAmino): MsgUpdateParamsResponse { + const message = createBaseMsgUpdateParamsResponse(); + return message; + }, + toAmino(_: MsgUpdateParamsResponse): MsgUpdateParamsResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgUpdateParamsResponseAminoMsg): MsgUpdateParamsResponse { + return MsgUpdateParamsResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgUpdateParamsResponse): MsgUpdateParamsResponseAminoMsg { + return { + type: "cosmos-sdk/MsgUpdateParamsResponse", + value: MsgUpdateParamsResponse.toAmino(message) + }; + }, + fromProtoMsg(message: MsgUpdateParamsResponseProtoMsg): MsgUpdateParamsResponse { + return MsgUpdateParamsResponse.decode(message.value); + }, + toProto(message: MsgUpdateParamsResponse): Uint8Array { + return MsgUpdateParamsResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgUpdateParamsResponse): MsgUpdateParamsResponseProtoMsg { + return { + typeUrl: "/cosmos.distribution.v1beta1.MsgUpdateParamsResponse", + value: MsgUpdateParamsResponse.encode(message).finish() + }; + } +}; +function createBaseMsgCommunityPoolSpend(): MsgCommunityPoolSpend { + return { + authority: "", + recipient: "", + amount: [] + }; +} +export const MsgCommunityPoolSpend = { + typeUrl: "/cosmos.distribution.v1beta1.MsgCommunityPoolSpend", + encode(message: MsgCommunityPoolSpend, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.authority !== "") { + writer.uint32(10).string(message.authority); + } + if (message.recipient !== "") { + writer.uint32(18).string(message.recipient); + } + for (const v of message.amount) { + Coin.encode(v!, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgCommunityPoolSpend { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgCommunityPoolSpend(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.authority = reader.string(); + break; + case 2: + message.recipient = reader.string(); + break; + case 3: + message.amount.push(Coin.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgCommunityPoolSpend { + const message = createBaseMsgCommunityPoolSpend(); + message.authority = object.authority ?? ""; + message.recipient = object.recipient ?? ""; + message.amount = object.amount?.map(e => Coin.fromPartial(e)) || []; + return message; + }, + fromAmino(object: MsgCommunityPoolSpendAmino): MsgCommunityPoolSpend { + const message = createBaseMsgCommunityPoolSpend(); + if (object.authority !== undefined && object.authority !== null) { + message.authority = object.authority; + } + if (object.recipient !== undefined && object.recipient !== null) { + message.recipient = object.recipient; + } + message.amount = object.amount?.map(e => Coin.fromAmino(e)) || []; + return message; + }, + toAmino(message: MsgCommunityPoolSpend): MsgCommunityPoolSpendAmino { + const obj: any = {}; + obj.authority = message.authority; + obj.recipient = message.recipient; + if (message.amount) { + obj.amount = message.amount.map(e => e ? Coin.toAmino(e) : undefined); + } else { + obj.amount = []; + } + return obj; + }, + fromAminoMsg(object: MsgCommunityPoolSpendAminoMsg): MsgCommunityPoolSpend { + return MsgCommunityPoolSpend.fromAmino(object.value); + }, + toAminoMsg(message: MsgCommunityPoolSpend): MsgCommunityPoolSpendAminoMsg { + return { + type: "cosmos-sdk/distr/MsgCommunityPoolSpend", + value: MsgCommunityPoolSpend.toAmino(message) + }; + }, + fromProtoMsg(message: MsgCommunityPoolSpendProtoMsg): MsgCommunityPoolSpend { + return MsgCommunityPoolSpend.decode(message.value); + }, + toProto(message: MsgCommunityPoolSpend): Uint8Array { + return MsgCommunityPoolSpend.encode(message).finish(); + }, + toProtoMsg(message: MsgCommunityPoolSpend): MsgCommunityPoolSpendProtoMsg { + return { + typeUrl: "/cosmos.distribution.v1beta1.MsgCommunityPoolSpend", + value: MsgCommunityPoolSpend.encode(message).finish() + }; + } +}; +function createBaseMsgCommunityPoolSpendResponse(): MsgCommunityPoolSpendResponse { + return {}; +} +export const MsgCommunityPoolSpendResponse = { + typeUrl: "/cosmos.distribution.v1beta1.MsgCommunityPoolSpendResponse", + encode(_: MsgCommunityPoolSpendResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgCommunityPoolSpendResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgCommunityPoolSpendResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): MsgCommunityPoolSpendResponse { + const message = createBaseMsgCommunityPoolSpendResponse(); + return message; + }, + fromAmino(_: MsgCommunityPoolSpendResponseAmino): MsgCommunityPoolSpendResponse { + const message = createBaseMsgCommunityPoolSpendResponse(); + return message; + }, + toAmino(_: MsgCommunityPoolSpendResponse): MsgCommunityPoolSpendResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgCommunityPoolSpendResponseAminoMsg): MsgCommunityPoolSpendResponse { + return MsgCommunityPoolSpendResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgCommunityPoolSpendResponse): MsgCommunityPoolSpendResponseAminoMsg { + return { + type: "cosmos-sdk/MsgCommunityPoolSpendResponse", + value: MsgCommunityPoolSpendResponse.toAmino(message) + }; + }, + fromProtoMsg(message: MsgCommunityPoolSpendResponseProtoMsg): MsgCommunityPoolSpendResponse { + return MsgCommunityPoolSpendResponse.decode(message.value); + }, + toProto(message: MsgCommunityPoolSpendResponse): Uint8Array { + return MsgCommunityPoolSpendResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgCommunityPoolSpendResponse): MsgCommunityPoolSpendResponseProtoMsg { + return { + typeUrl: "/cosmos.distribution.v1beta1.MsgCommunityPoolSpendResponse", + value: MsgCommunityPoolSpendResponse.encode(message).finish() + }; + } }; \ No newline at end of file diff --git a/packages/osmo-query/src/codegen/cosmos/gov/v1beta1/genesis.ts b/packages/osmo-query/src/codegen/cosmos/gov/v1beta1/genesis.ts index 78acffccf..48166585d 100644 --- a/packages/osmo-query/src/codegen/cosmos/gov/v1beta1/genesis.ts +++ b/packages/osmo-query/src/codegen/cosmos/gov/v1beta1/genesis.ts @@ -10,11 +10,11 @@ export interface GenesisState { votes: Vote[]; /** proposals defines all the proposals present at genesis. */ proposals: Proposal[]; - /** params defines all the paramaters of related to deposit. */ + /** params defines all the parameters of related to deposit. */ depositParams: DepositParams; - /** params defines all the paramaters of related to voting. */ + /** params defines all the parameters of related to voting. */ votingParams: VotingParams; - /** params defines all the paramaters of related to tally. */ + /** params defines all the parameters of related to tally. */ tallyParams: TallyParams; } export interface GenesisStateProtoMsg { @@ -24,19 +24,19 @@ export interface GenesisStateProtoMsg { /** GenesisState defines the gov module's genesis state. */ export interface GenesisStateAmino { /** starting_proposal_id is the ID of the starting proposal. */ - starting_proposal_id: string; + starting_proposal_id?: string; /** deposits defines all the deposits present at genesis. */ deposits: DepositAmino[]; /** votes defines all the votes present at genesis. */ votes: VoteAmino[]; /** proposals defines all the proposals present at genesis. */ proposals: ProposalAmino[]; - /** params defines all the paramaters of related to deposit. */ - deposit_params?: DepositParamsAmino; - /** params defines all the paramaters of related to voting. */ - voting_params?: VotingParamsAmino; - /** params defines all the paramaters of related to tally. */ - tally_params?: TallyParamsAmino; + /** params defines all the parameters of related to deposit. */ + deposit_params: DepositParamsAmino; + /** params defines all the parameters of related to voting. */ + voting_params: VotingParamsAmino; + /** params defines all the parameters of related to tally. */ + tally_params: TallyParamsAmino; } export interface GenesisStateAminoMsg { type: "cosmos-sdk/GenesisState"; @@ -136,15 +136,23 @@ export const GenesisState = { return message; }, fromAmino(object: GenesisStateAmino): GenesisState { - return { - startingProposalId: BigInt(object.starting_proposal_id), - deposits: Array.isArray(object?.deposits) ? object.deposits.map((e: any) => Deposit.fromAmino(e)) : [], - votes: Array.isArray(object?.votes) ? object.votes.map((e: any) => Vote.fromAmino(e)) : [], - proposals: Array.isArray(object?.proposals) ? object.proposals.map((e: any) => Proposal.fromAmino(e)) : [], - depositParams: object?.deposit_params ? DepositParams.fromAmino(object.deposit_params) : undefined, - votingParams: object?.voting_params ? VotingParams.fromAmino(object.voting_params) : undefined, - tallyParams: object?.tally_params ? TallyParams.fromAmino(object.tally_params) : undefined - }; + const message = createBaseGenesisState(); + if (object.starting_proposal_id !== undefined && object.starting_proposal_id !== null) { + message.startingProposalId = BigInt(object.starting_proposal_id); + } + message.deposits = object.deposits?.map(e => Deposit.fromAmino(e)) || []; + message.votes = object.votes?.map(e => Vote.fromAmino(e)) || []; + message.proposals = object.proposals?.map(e => Proposal.fromAmino(e)) || []; + if (object.deposit_params !== undefined && object.deposit_params !== null) { + message.depositParams = DepositParams.fromAmino(object.deposit_params); + } + if (object.voting_params !== undefined && object.voting_params !== null) { + message.votingParams = VotingParams.fromAmino(object.voting_params); + } + if (object.tally_params !== undefined && object.tally_params !== null) { + message.tallyParams = TallyParams.fromAmino(object.tally_params); + } + return message; }, toAmino(message: GenesisState): GenesisStateAmino { const obj: any = {}; @@ -164,9 +172,9 @@ export const GenesisState = { } else { obj.proposals = []; } - obj.deposit_params = message.depositParams ? DepositParams.toAmino(message.depositParams) : undefined; - obj.voting_params = message.votingParams ? VotingParams.toAmino(message.votingParams) : undefined; - obj.tally_params = message.tallyParams ? TallyParams.toAmino(message.tallyParams) : undefined; + obj.deposit_params = message.depositParams ? DepositParams.toAmino(message.depositParams) : DepositParams.fromPartial({}); + obj.voting_params = message.votingParams ? VotingParams.toAmino(message.votingParams) : VotingParams.fromPartial({}); + obj.tally_params = message.tallyParams ? TallyParams.toAmino(message.tallyParams) : TallyParams.fromPartial({}); return obj; }, fromAminoMsg(object: GenesisStateAminoMsg): GenesisState { diff --git a/packages/osmo-query/src/codegen/cosmos/gov/v1beta1/gov.ts b/packages/osmo-query/src/codegen/cosmos/gov/v1beta1/gov.ts index 7d36a8f65..5ac610f02 100644 --- a/packages/osmo-query/src/codegen/cosmos/gov/v1beta1/gov.ts +++ b/packages/osmo-query/src/codegen/cosmos/gov/v1beta1/gov.ts @@ -2,9 +2,19 @@ import { Coin, CoinAmino, CoinSDKType } from "../../base/v1beta1/coin"; import { Any, AnyProtoMsg, AnyAmino, AnySDKType } from "../../../google/protobuf/any"; import { Timestamp } from "../../../google/protobuf/timestamp"; import { Duration, DurationAmino, DurationSDKType } from "../../../google/protobuf/duration"; +import { CommunityPoolSpendProposal, CommunityPoolSpendProposalProtoMsg, CommunityPoolSpendProposalSDKType, CommunityPoolSpendProposalWithDeposit, CommunityPoolSpendProposalWithDepositProtoMsg, CommunityPoolSpendProposalWithDepositSDKType } from "../../distribution/v1beta1/distribution"; +import { ParameterChangeProposal } from "../../params/v1beta1/params"; +import { SoftwareUpgradeProposal, CancelSoftwareUpgradeProposal } from "../../upgrade/v1beta1/upgrade"; +import { ClientUpdateProposal, UpgradeProposal } from "../../../ibc/core/client/v1/client"; +import { StoreCodeProposal, InstantiateContractProposal, InstantiateContract2Proposal, MigrateContractProposal, SudoContractProposal, ExecuteContractProposal, UpdateAdminProposal, ClearAdminProposal, PinCodesProposal, UnpinCodesProposal, UpdateInstantiateConfigProposal, StoreAndInstantiateContractProposal } from "../../../cosmwasm/wasm/v1/proposal_legacy"; +import { ReplaceMigrationRecordsProposal, UpdateMigrationRecordsProposal, CreateConcentratedLiquidityPoolsAndLinktoCFMMProposal, SetScalingFactorControllerProposal } from "../../../osmosis/gamm/v1beta1/gov"; +import { ReplacePoolIncentivesProposal, UpdatePoolIncentivesProposal } from "../../../osmosis/poolincentives/v1beta1/gov"; +import { SetProtoRevEnabledProposal, SetProtoRevAdminAccountProposal } from "../../../osmosis/protorev/v1beta1/gov"; +import { SetSuperfluidAssetsProposal, RemoveSuperfluidAssetsProposal, UpdateUnpoolWhiteListProposal } from "../../../osmosis/superfluid/v1beta1/gov"; +import { UpdateFeeTokenProposal } from "../../../osmosis/txfees/v1beta1/gov"; import { BinaryReader, BinaryWriter } from "../../../binary"; import { Decimal } from "@cosmjs/math"; -import { isSet, toTimestamp, fromTimestamp } from "../../../helpers"; +import { toTimestamp, fromTimestamp, bytesFromBase64, base64FromBytes } from "../../../helpers"; /** VoteOption enumerates the valid vote options for a given governance proposal. */ export enum VoteOption { /** VOTE_OPTION_UNSPECIFIED - VOTE_OPTION_UNSPECIFIED defines a no-op vote option. */ @@ -63,7 +73,7 @@ export function voteOptionToJSON(object: VoteOption): string { } /** ProposalStatus enumerates the valid statuses of a proposal. */ export enum ProposalStatus { - /** PROPOSAL_STATUS_UNSPECIFIED - PROPOSAL_STATUS_UNSPECIFIED defines the default propopsal status. */ + /** PROPOSAL_STATUS_UNSPECIFIED - PROPOSAL_STATUS_UNSPECIFIED defines the default proposal status. */ PROPOSAL_STATUS_UNSPECIFIED = 0, /** * PROPOSAL_STATUS_DEPOSIT_PERIOD - PROPOSAL_STATUS_DEPOSIT_PERIOD defines a proposal status during the deposit @@ -145,7 +155,9 @@ export function proposalStatusToJSON(object: ProposalStatus): string { * Since: cosmos-sdk 0.43 */ export interface WeightedVoteOption { + /** option defines the valid vote options, it must not contain duplicate vote options. */ option: VoteOption; + /** weight is the vote weight associated with the vote option. */ weight: string; } export interface WeightedVoteOptionProtoMsg { @@ -158,8 +170,10 @@ export interface WeightedVoteOptionProtoMsg { * Since: cosmos-sdk 0.43 */ export interface WeightedVoteOptionAmino { - option: VoteOption; - weight: string; + /** option defines the valid vote options, it must not contain duplicate vote options. */ + option?: VoteOption; + /** weight is the vote weight associated with the vote option. */ + weight?: string; } export interface WeightedVoteOptionAminoMsg { type: "cosmos-sdk/WeightedVoteOption"; @@ -179,8 +193,10 @@ export interface WeightedVoteOptionSDKType { * manually updated in case of approval. */ export interface TextProposal { - $typeUrl?: string; + $typeUrl?: "/cosmos.gov.v1beta1.TextProposal"; + /** title of the proposal. */ title: string; + /** description associated with the proposal. */ description: string; } export interface TextProposalProtoMsg { @@ -192,8 +208,10 @@ export interface TextProposalProtoMsg { * manually updated in case of approval. */ export interface TextProposalAmino { - title: string; - description: string; + /** title of the proposal. */ + title?: string; + /** description associated with the proposal. */ + description?: string; } export interface TextProposalAminoMsg { type: "cosmos-sdk/TextProposal"; @@ -204,7 +222,7 @@ export interface TextProposalAminoMsg { * manually updated in case of approval. */ export interface TextProposalSDKType { - $typeUrl?: string; + $typeUrl?: "/cosmos.gov.v1beta1.TextProposal"; title: string; description: string; } @@ -213,8 +231,11 @@ export interface TextProposalSDKType { * proposal. */ export interface Deposit { + /** proposal_id defines the unique id of the proposal. */ proposalId: bigint; + /** depositor defines the deposit addresses from the proposals. */ depositor: string; + /** amount to be deposited by depositor. */ amount: Coin[]; } export interface DepositProtoMsg { @@ -226,8 +247,11 @@ export interface DepositProtoMsg { * proposal. */ export interface DepositAmino { - proposal_id: string; - depositor: string; + /** proposal_id defines the unique id of the proposal. */ + proposal_id?: string; + /** depositor defines the deposit addresses from the proposals. */ + depositor?: string; + /** amount to be deposited by depositor. */ amount: CoinAmino[]; } export interface DepositAminoMsg { @@ -245,36 +269,60 @@ export interface DepositSDKType { } /** Proposal defines the core field members of a governance proposal. */ export interface Proposal { + /** proposal_id defines the unique id of the proposal. */ proposalId: bigint; - content: (TextProposal & Any) | undefined; + /** content is the proposal's content. */ + content?: (TextProposal & CommunityPoolSpendProposal & CommunityPoolSpendProposalWithDeposit & ParameterChangeProposal & SoftwareUpgradeProposal & CancelSoftwareUpgradeProposal & ClientUpdateProposal & UpgradeProposal & StoreCodeProposal & InstantiateContractProposal & InstantiateContract2Proposal & MigrateContractProposal & SudoContractProposal & ExecuteContractProposal & UpdateAdminProposal & ClearAdminProposal & PinCodesProposal & UnpinCodesProposal & UpdateInstantiateConfigProposal & StoreAndInstantiateContractProposal & ReplaceMigrationRecordsProposal & UpdateMigrationRecordsProposal & CreateConcentratedLiquidityPoolsAndLinktoCFMMProposal & SetScalingFactorControllerProposal & ReplacePoolIncentivesProposal & UpdatePoolIncentivesProposal & SetProtoRevEnabledProposal & SetProtoRevAdminAccountProposal & SetSuperfluidAssetsProposal & RemoveSuperfluidAssetsProposal & UpdateUnpoolWhiteListProposal & UpdateFeeTokenProposal & Any) | undefined; + /** status defines the proposal status. */ status: ProposalStatus; + /** + * final_tally_result is the final tally result of the proposal. When + * querying a proposal via gRPC, this field is not populated until the + * proposal's voting period has ended. + */ finalTallyResult: TallyResult; + /** submit_time is the time of proposal submission. */ submitTime: Date; + /** deposit_end_time is the end time for deposition. */ depositEndTime: Date; + /** total_deposit is the total deposit on the proposal. */ totalDeposit: Coin[]; + /** voting_start_time is the starting time to vote on a proposal. */ votingStartTime: Date; + /** voting_end_time is the end time of voting on a proposal. */ votingEndTime: Date; - isExpedited: boolean; } export interface ProposalProtoMsg { typeUrl: "/cosmos.gov.v1beta1.Proposal"; value: Uint8Array; } export type ProposalEncoded = Omit & { - content?: TextProposalProtoMsg | AnyProtoMsg | undefined; + /** content is the proposal's content. */content?: TextProposalProtoMsg | CommunityPoolSpendProposalProtoMsg | CommunityPoolSpendProposalWithDepositProtoMsg | ParameterChangeProposalProtoMsg | SoftwareUpgradeProposalProtoMsg | CancelSoftwareUpgradeProposalProtoMsg | ClientUpdateProposalProtoMsg | UpgradeProposalProtoMsg | StoreCodeProposalProtoMsg | InstantiateContractProposalProtoMsg | InstantiateContract2ProposalProtoMsg | MigrateContractProposalProtoMsg | SudoContractProposalProtoMsg | ExecuteContractProposalProtoMsg | UpdateAdminProposalProtoMsg | ClearAdminProposalProtoMsg | PinCodesProposalProtoMsg | UnpinCodesProposalProtoMsg | UpdateInstantiateConfigProposalProtoMsg | StoreAndInstantiateContractProposalProtoMsg | ReplaceMigrationRecordsProposalProtoMsg | UpdateMigrationRecordsProposalProtoMsg | CreateConcentratedLiquidityPoolsAndLinktoCFMMProposalProtoMsg | SetScalingFactorControllerProposalProtoMsg | ReplacePoolIncentivesProposalProtoMsg | UpdatePoolIncentivesProposalProtoMsg | SetProtoRevEnabledProposalProtoMsg | SetProtoRevAdminAccountProposalProtoMsg | SetSuperfluidAssetsProposalProtoMsg | RemoveSuperfluidAssetsProposalProtoMsg | UpdateUnpoolWhiteListProposalProtoMsg | UpdateFeeTokenProposalProtoMsg | AnyProtoMsg | undefined; }; /** Proposal defines the core field members of a governance proposal. */ export interface ProposalAmino { - proposal_id: string; + /** proposal_id defines the unique id of the proposal. */ + proposal_id?: string; + /** content is the proposal's content. */ content?: AnyAmino; - status: ProposalStatus; - final_tally_result?: TallyResultAmino; - submit_time?: Date; - deposit_end_time?: Date; + /** status defines the proposal status. */ + status?: ProposalStatus; + /** + * final_tally_result is the final tally result of the proposal. When + * querying a proposal via gRPC, this field is not populated until the + * proposal's voting period has ended. + */ + final_tally_result: TallyResultAmino; + /** submit_time is the time of proposal submission. */ + submit_time: string; + /** deposit_end_time is the end time for deposition. */ + deposit_end_time: string; + /** total_deposit is the total deposit on the proposal. */ total_deposit: CoinAmino[]; - voting_start_time?: Date; - voting_end_time?: Date; - is_expedited: boolean; + /** voting_start_time is the starting time to vote on a proposal. */ + voting_start_time: string; + /** voting_end_time is the end time of voting on a proposal. */ + voting_end_time: string; } export interface ProposalAminoMsg { type: "cosmos-sdk/Proposal"; @@ -283,7 +331,7 @@ export interface ProposalAminoMsg { /** Proposal defines the core field members of a governance proposal. */ export interface ProposalSDKType { proposal_id: bigint; - content: TextProposalSDKType | AnySDKType | undefined; + content?: TextProposalSDKType | CommunityPoolSpendProposalSDKType | CommunityPoolSpendProposalWithDepositSDKType | ParameterChangeProposalSDKType | SoftwareUpgradeProposalSDKType | CancelSoftwareUpgradeProposalSDKType | ClientUpdateProposalSDKType | UpgradeProposalSDKType | StoreCodeProposalSDKType | InstantiateContractProposalSDKType | InstantiateContract2ProposalSDKType | MigrateContractProposalSDKType | SudoContractProposalSDKType | ExecuteContractProposalSDKType | UpdateAdminProposalSDKType | ClearAdminProposalSDKType | PinCodesProposalSDKType | UnpinCodesProposalSDKType | UpdateInstantiateConfigProposalSDKType | StoreAndInstantiateContractProposalSDKType | ReplaceMigrationRecordsProposalSDKType | UpdateMigrationRecordsProposalSDKType | CreateConcentratedLiquidityPoolsAndLinktoCFMMProposalSDKType | SetScalingFactorControllerProposalSDKType | ReplacePoolIncentivesProposalSDKType | UpdatePoolIncentivesProposalSDKType | SetProtoRevEnabledProposalSDKType | SetProtoRevAdminAccountProposalSDKType | SetSuperfluidAssetsProposalSDKType | RemoveSuperfluidAssetsProposalSDKType | UpdateUnpoolWhiteListProposalSDKType | UpdateFeeTokenProposalSDKType | AnySDKType | undefined; status: ProposalStatus; final_tally_result: TallyResultSDKType; submit_time: Date; @@ -291,13 +339,16 @@ export interface ProposalSDKType { total_deposit: CoinSDKType[]; voting_start_time: Date; voting_end_time: Date; - is_expedited: boolean; } /** TallyResult defines a standard tally for a governance proposal. */ export interface TallyResult { + /** yes is the number of yes votes on a proposal. */ yes: string; + /** abstain is the number of abstain votes on a proposal. */ abstain: string; + /** no is the number of no votes on a proposal. */ no: string; + /** no_with_veto is the number of no with veto votes on a proposal. */ noWithVeto: string; } export interface TallyResultProtoMsg { @@ -306,10 +357,14 @@ export interface TallyResultProtoMsg { } /** TallyResult defines a standard tally for a governance proposal. */ export interface TallyResultAmino { - yes: string; - abstain: string; - no: string; - no_with_veto: string; + /** yes is the number of yes votes on a proposal. */ + yes?: string; + /** abstain is the number of abstain votes on a proposal. */ + abstain?: string; + /** no is the number of no votes on a proposal. */ + no?: string; + /** no_with_veto is the number of no with veto votes on a proposal. */ + no_with_veto?: string; } export interface TallyResultAminoMsg { type: "cosmos-sdk/TallyResult"; @@ -327,7 +382,9 @@ export interface TallyResultSDKType { * A Vote consists of a proposal ID, the voter, and the vote option. */ export interface Vote { + /** proposal_id defines the unique id of the proposal. */ proposalId: bigint; + /** voter is the voter address of the proposal. */ voter: string; /** * Deprecated: Prefer to use `options` instead. This field is set in queries @@ -336,7 +393,11 @@ export interface Vote { */ /** @deprecated */ option: VoteOption; - /** Since: cosmos-sdk 0.43 */ + /** + * options is the weighted vote options. + * + * Since: cosmos-sdk 0.43 + */ options: WeightedVoteOption[]; } export interface VoteProtoMsg { @@ -348,16 +409,22 @@ export interface VoteProtoMsg { * A Vote consists of a proposal ID, the voter, and the vote option. */ export interface VoteAmino { + /** proposal_id defines the unique id of the proposal. */ proposal_id: string; - voter: string; + /** voter is the voter address of the proposal. */ + 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 * other cases, this field will default to VOTE_OPTION_UNSPECIFIED. */ /** @deprecated */ - option: VoteOption; - /** Since: cosmos-sdk 0.43 */ + option?: VoteOption; + /** + * options is the weighted vote options. + * + * Since: cosmos-sdk 0.43 + */ options: WeightedVoteOptionAmino[]; } export interface VoteAminoMsg { @@ -381,13 +448,9 @@ export interface DepositParams { minDeposit: Coin[]; /** * Maximum period for Atom holders to deposit on a proposal. Initial value: 2 - * months. + * months. */ maxDepositPeriod: Duration; - /** Minimum expedited deposit for a proposal to enter voting period. */ - minExpeditedDeposit: Coin[]; - /** The ratio representing the proportion of the deposit value that must be paid at proposal submission. */ - minInitialDepositRatio: string; } export interface DepositParamsProtoMsg { typeUrl: "/cosmos.gov.v1beta1.DepositParams"; @@ -396,16 +459,12 @@ export interface DepositParamsProtoMsg { /** DepositParams defines the params for deposits on governance proposals. */ export interface DepositParamsAmino { /** Minimum deposit for a proposal to enter voting period. */ - min_deposit: CoinAmino[]; + min_deposit?: CoinAmino[]; /** * Maximum period for Atom holders to deposit on a proposal. Initial value: 2 - * months. + * months. */ max_deposit_period?: DurationAmino; - /** Minimum expedited deposit for a proposal to enter voting period. */ - min_expedited_deposit: CoinAmino[]; - /** The ratio representing the proportion of the deposit value that must be paid at proposal submission. */ - min_initial_deposit_ratio: string; } export interface DepositParamsAminoMsg { type: "cosmos-sdk/DepositParams"; @@ -415,17 +474,11 @@ export interface DepositParamsAminoMsg { export interface DepositParamsSDKType { min_deposit: CoinSDKType[]; max_deposit_period: DurationSDKType; - min_expedited_deposit: CoinSDKType[]; - min_initial_deposit_ratio: string; } /** VotingParams defines the params for voting on governance proposals. */ export interface VotingParams { - /** voting_period defines the length of the voting period. */ + /** Duration of the voting period. */ votingPeriod: Duration; - /** proposal_voting_periods defines custom voting periods for proposal types. */ - proposalVotingPeriods: ProposalVotingPeriod[]; - /** Length of the expedited voting period. */ - expeditedVotingPeriod: Duration; } export interface VotingParamsProtoMsg { typeUrl: "/cosmos.gov.v1beta1.VotingParams"; @@ -433,12 +486,8 @@ export interface VotingParamsProtoMsg { } /** VotingParams defines the params for voting on governance proposals. */ export interface VotingParamsAmino { - /** voting_period defines the length of the voting period. */ + /** Duration of the voting period. */ voting_period?: DurationAmino; - /** proposal_voting_periods defines custom voting periods for proposal types. */ - proposal_voting_periods: ProposalVotingPeriodAmino[]; - /** Length of the expedited voting period. */ - expedited_voting_period?: DurationAmino; } export interface VotingParamsAminoMsg { type: "cosmos-sdk/VotingParams"; @@ -447,27 +496,21 @@ export interface VotingParamsAminoMsg { /** VotingParams defines the params for voting on governance proposals. */ export interface VotingParamsSDKType { voting_period: DurationSDKType; - proposal_voting_periods: ProposalVotingPeriodSDKType[]; - expedited_voting_period: DurationSDKType; } /** TallyParams defines the params for tallying votes on governance proposals. */ export interface TallyParams { /** * Minimum percentage of total stake needed to vote for a result to be - * considered valid. + * considered valid. */ quorum: Uint8Array; /** Minimum proportion of Yes votes for proposal to pass. Default value: 0.5. */ threshold: Uint8Array; /** * Minimum value of Veto votes to Total votes ratio for proposal to be - * vetoed. Default value: 1/3. + * vetoed. Default value: 1/3. */ vetoThreshold: Uint8Array; - /** Minimum proportion of Yes votes for an expedited proposal to pass. Default value: 0.67. */ - expeditedThreshold: Uint8Array; - /** Minimum proportion of Yes votes for an expedited proposal to reach quorum. Default value: 0.67. */ - expeditedQuorum: Uint8Array; } export interface TallyParamsProtoMsg { typeUrl: "/cosmos.gov.v1beta1.TallyParams"; @@ -477,20 +520,16 @@ export interface TallyParamsProtoMsg { export interface TallyParamsAmino { /** * Minimum percentage of total stake needed to vote for a result to be - * considered valid. + * considered valid. */ - quorum: Uint8Array; + quorum?: string; /** Minimum proportion of Yes votes for proposal to pass. Default value: 0.5. */ - threshold: Uint8Array; + threshold?: string; /** * Minimum value of Veto votes to Total votes ratio for proposal to be - * vetoed. Default value: 1/3. + * vetoed. Default value: 1/3. */ - veto_threshold: Uint8Array; - /** Minimum proportion of Yes votes for an expedited proposal to pass. Default value: 0.67. */ - expedited_threshold: Uint8Array; - /** Minimum proportion of Yes votes for an expedited proposal to reach quorum. Default value: 0.67. */ - expedited_quorum: Uint8Array; + veto_threshold?: string; } export interface TallyParamsAminoMsg { type: "cosmos-sdk/TallyParams"; @@ -501,42 +540,6 @@ export interface TallyParamsSDKType { quorum: Uint8Array; threshold: Uint8Array; veto_threshold: Uint8Array; - expedited_threshold: Uint8Array; - expedited_quorum: Uint8Array; -} -/** - * ProposalVotingPeriod defines custom voting periods for a unique governance - * proposal type. - */ -export interface ProposalVotingPeriod { - /** e.g. "cosmos.params.v1beta1.ParameterChangeProposal" */ - proposalType: string; - votingPeriod: Duration; -} -export interface ProposalVotingPeriodProtoMsg { - typeUrl: "/cosmos.gov.v1beta1.ProposalVotingPeriod"; - value: Uint8Array; -} -/** - * ProposalVotingPeriod defines custom voting periods for a unique governance - * proposal type. - */ -export interface ProposalVotingPeriodAmino { - /** e.g. "cosmos.params.v1beta1.ParameterChangeProposal" */ - proposal_type: string; - voting_period?: DurationAmino; -} -export interface ProposalVotingPeriodAminoMsg { - type: "cosmos-sdk/ProposalVotingPeriod"; - value: ProposalVotingPeriodAmino; -} -/** - * ProposalVotingPeriod defines custom voting periods for a unique governance - * proposal type. - */ -export interface ProposalVotingPeriodSDKType { - proposal_type: string; - voting_period: DurationSDKType; } function createBaseWeightedVoteOption(): WeightedVoteOption { return { @@ -582,14 +585,18 @@ export const WeightedVoteOption = { return message; }, fromAmino(object: WeightedVoteOptionAmino): WeightedVoteOption { - return { - option: isSet(object.option) ? voteOptionFromJSON(object.option) : -1, - weight: object.weight - }; + const message = createBaseWeightedVoteOption(); + if (object.option !== undefined && object.option !== null) { + message.option = voteOptionFromJSON(object.option); + } + if (object.weight !== undefined && object.weight !== null) { + message.weight = object.weight; + } + return message; }, toAmino(message: WeightedVoteOption): WeightedVoteOptionAmino { const obj: any = {}; - obj.option = message.option; + obj.option = voteOptionToJSON(message.option); obj.weight = message.weight; return obj; }, @@ -660,10 +667,14 @@ export const TextProposal = { return message; }, fromAmino(object: TextProposalAmino): TextProposal { - return { - title: object.title, - description: object.description - }; + const message = createBaseTextProposal(); + if (object.title !== undefined && object.title !== null) { + message.title = object.title; + } + if (object.description !== undefined && object.description !== null) { + message.description = object.description; + } + return message; }, toAmino(message: TextProposal): TextProposalAmino { const obj: any = {}; @@ -745,11 +756,15 @@ export const Deposit = { return message; }, fromAmino(object: DepositAmino): Deposit { - return { - proposalId: BigInt(object.proposal_id), - depositor: object.depositor, - amount: Array.isArray(object?.amount) ? object.amount.map((e: any) => Coin.fromAmino(e)) : [] - }; + const message = createBaseDeposit(); + if (object.proposal_id !== undefined && object.proposal_id !== null) { + message.proposalId = BigInt(object.proposal_id); + } + if (object.depositor !== undefined && object.depositor !== null) { + message.depositor = object.depositor; + } + message.amount = object.amount?.map(e => Coin.fromAmino(e)) || []; + return message; }, toAmino(message: Deposit): DepositAmino { const obj: any = {}; @@ -787,15 +802,14 @@ export const Deposit = { function createBaseProposal(): Proposal { return { proposalId: BigInt(0), - content: Any.fromPartial({}), + content: undefined, status: 0, finalTallyResult: TallyResult.fromPartial({}), submitTime: new Date(), depositEndTime: new Date(), totalDeposit: [], votingStartTime: new Date(), - votingEndTime: new Date(), - isExpedited: false + votingEndTime: new Date() }; } export const Proposal = { @@ -828,9 +842,6 @@ export const Proposal = { if (message.votingEndTime !== undefined) { Timestamp.encode(toTimestamp(message.votingEndTime), writer.uint32(74).fork()).ldelim(); } - if (message.isExpedited === true) { - writer.uint32(80).bool(message.isExpedited); - } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): Proposal { @@ -844,7 +855,7 @@ export const Proposal = { message.proposalId = reader.uint64(); break; case 2: - message.content = (Content_InterfaceDecoder(reader) as Any); + message.content = (Cosmos_govv1beta1Content_InterfaceDecoder(reader) as Any); break; case 3: message.status = (reader.int32() as any); @@ -867,9 +878,6 @@ export const Proposal = { case 9: message.votingEndTime = fromTimestamp(Timestamp.decode(reader, reader.uint32())); break; - case 10: - message.isExpedited = reader.bool(); - break; default: reader.skipType(tag & 7); break; @@ -888,39 +896,52 @@ export const Proposal = { message.totalDeposit = object.totalDeposit?.map(e => Coin.fromPartial(e)) || []; message.votingStartTime = object.votingStartTime ?? undefined; message.votingEndTime = object.votingEndTime ?? undefined; - message.isExpedited = object.isExpedited ?? false; return message; }, fromAmino(object: ProposalAmino): Proposal { - return { - proposalId: BigInt(object.proposal_id), - content: object?.content ? Content_FromAmino(object.content) : undefined, - status: isSet(object.status) ? proposalStatusFromJSON(object.status) : -1, - finalTallyResult: object?.final_tally_result ? TallyResult.fromAmino(object.final_tally_result) : undefined, - submitTime: object.submit_time, - depositEndTime: object.deposit_end_time, - totalDeposit: Array.isArray(object?.total_deposit) ? object.total_deposit.map((e: any) => Coin.fromAmino(e)) : [], - votingStartTime: object.voting_start_time, - votingEndTime: object.voting_end_time, - isExpedited: object.is_expedited - }; + const message = createBaseProposal(); + if (object.proposal_id !== undefined && object.proposal_id !== null) { + message.proposalId = BigInt(object.proposal_id); + } + if (object.content !== undefined && object.content !== null) { + message.content = Cosmos_govv1beta1Content_FromAmino(object.content); + } + if (object.status !== undefined && object.status !== null) { + message.status = proposalStatusFromJSON(object.status); + } + if (object.final_tally_result !== undefined && object.final_tally_result !== null) { + message.finalTallyResult = TallyResult.fromAmino(object.final_tally_result); + } + if (object.submit_time !== undefined && object.submit_time !== null) { + message.submitTime = fromTimestamp(Timestamp.fromAmino(object.submit_time)); + } + if (object.deposit_end_time !== undefined && object.deposit_end_time !== null) { + message.depositEndTime = fromTimestamp(Timestamp.fromAmino(object.deposit_end_time)); + } + message.totalDeposit = object.total_deposit?.map(e => Coin.fromAmino(e)) || []; + if (object.voting_start_time !== undefined && object.voting_start_time !== null) { + message.votingStartTime = fromTimestamp(Timestamp.fromAmino(object.voting_start_time)); + } + if (object.voting_end_time !== undefined && object.voting_end_time !== null) { + message.votingEndTime = fromTimestamp(Timestamp.fromAmino(object.voting_end_time)); + } + return message; }, toAmino(message: Proposal): ProposalAmino { const obj: any = {}; obj.proposal_id = message.proposalId ? message.proposalId.toString() : undefined; - obj.content = message.content ? Content_ToAmino((message.content as Any)) : undefined; - obj.status = message.status; - obj.final_tally_result = message.finalTallyResult ? TallyResult.toAmino(message.finalTallyResult) : undefined; - obj.submit_time = message.submitTime; - obj.deposit_end_time = message.depositEndTime; + obj.content = message.content ? Cosmos_govv1beta1Content_ToAmino((message.content as Any)) : undefined; + obj.status = proposalStatusToJSON(message.status); + obj.final_tally_result = message.finalTallyResult ? TallyResult.toAmino(message.finalTallyResult) : TallyResult.fromPartial({}); + obj.submit_time = message.submitTime ? Timestamp.toAmino(toTimestamp(message.submitTime)) : new Date(); + obj.deposit_end_time = message.depositEndTime ? Timestamp.toAmino(toTimestamp(message.depositEndTime)) : new Date(); if (message.totalDeposit) { obj.total_deposit = message.totalDeposit.map(e => e ? Coin.toAmino(e) : undefined); } else { obj.total_deposit = []; } - obj.voting_start_time = message.votingStartTime; - obj.voting_end_time = message.votingEndTime; - obj.is_expedited = message.isExpedited; + obj.voting_start_time = message.votingStartTime ? Timestamp.toAmino(toTimestamp(message.votingStartTime)) : new Date(); + obj.voting_end_time = message.votingEndTime ? Timestamp.toAmino(toTimestamp(message.votingEndTime)) : new Date(); return obj; }, fromAminoMsg(object: ProposalAminoMsg): Proposal { @@ -1005,12 +1026,20 @@ export const TallyResult = { return message; }, fromAmino(object: TallyResultAmino): TallyResult { - return { - yes: object.yes, - abstain: object.abstain, - no: object.no, - noWithVeto: object.no_with_veto - }; + const message = createBaseTallyResult(); + if (object.yes !== undefined && object.yes !== null) { + message.yes = object.yes; + } + if (object.abstain !== undefined && object.abstain !== null) { + message.abstain = object.abstain; + } + if (object.no !== undefined && object.no !== null) { + message.no = object.no; + } + if (object.no_with_veto !== undefined && object.no_with_veto !== null) { + message.noWithVeto = object.no_with_veto; + } + return message; }, toAmino(message: TallyResult): TallyResultAmino { const obj: any = {}; @@ -1102,18 +1131,24 @@ export const Vote = { return message; }, fromAmino(object: VoteAmino): Vote { - return { - proposalId: BigInt(object.proposal_id), - voter: object.voter, - option: isSet(object.option) ? voteOptionFromJSON(object.option) : -1, - options: Array.isArray(object?.options) ? object.options.map((e: any) => WeightedVoteOption.fromAmino(e)) : [] - }; + const message = createBaseVote(); + if (object.proposal_id !== undefined && object.proposal_id !== null) { + message.proposalId = BigInt(object.proposal_id); + } + if (object.voter !== undefined && object.voter !== null) { + message.voter = object.voter; + } + if (object.option !== undefined && object.option !== null) { + message.option = voteOptionFromJSON(object.option); + } + message.options = object.options?.map(e => WeightedVoteOption.fromAmino(e)) || []; + return message; }, toAmino(message: Vote): VoteAmino { const obj: any = {}; - obj.proposal_id = message.proposalId ? message.proposalId.toString() : undefined; + obj.proposal_id = message.proposalId ? message.proposalId.toString() : "0"; obj.voter = message.voter; - obj.option = message.option; + obj.option = voteOptionToJSON(message.option); if (message.options) { obj.options = message.options.map(e => e ? WeightedVoteOption.toAmino(e) : undefined); } else { @@ -1146,9 +1181,7 @@ export const Vote = { function createBaseDepositParams(): DepositParams { return { minDeposit: [], - maxDepositPeriod: Duration.fromPartial({}), - minExpeditedDeposit: [], - minInitialDepositRatio: "" + maxDepositPeriod: Duration.fromPartial({}) }; } export const DepositParams = { @@ -1160,12 +1193,6 @@ export const DepositParams = { if (message.maxDepositPeriod !== undefined) { Duration.encode(message.maxDepositPeriod, writer.uint32(18).fork()).ldelim(); } - for (const v of message.minExpeditedDeposit) { - Coin.encode(v!, writer.uint32(26).fork()).ldelim(); - } - if (message.minInitialDepositRatio !== "") { - writer.uint32(34).string(Decimal.fromUserInput(message.minInitialDepositRatio, 18).atomics); - } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): DepositParams { @@ -1181,12 +1208,6 @@ export const DepositParams = { case 2: message.maxDepositPeriod = Duration.decode(reader, reader.uint32()); break; - case 3: - message.minExpeditedDeposit.push(Coin.decode(reader, reader.uint32())); - break; - case 4: - message.minInitialDepositRatio = Decimal.fromAtomics(reader.string(), 18).toString(); - break; default: reader.skipType(tag & 7); break; @@ -1198,17 +1219,15 @@ export const 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; - message.minExpeditedDeposit = object.minExpeditedDeposit?.map(e => Coin.fromPartial(e)) || []; - message.minInitialDepositRatio = object.minInitialDepositRatio ?? ""; return message; }, fromAmino(object: DepositParamsAmino): DepositParams { - return { - minDeposit: Array.isArray(object?.min_deposit) ? object.min_deposit.map((e: any) => Coin.fromAmino(e)) : [], - maxDepositPeriod: object?.max_deposit_period ? Duration.fromAmino(object.max_deposit_period) : undefined, - minExpeditedDeposit: Array.isArray(object?.min_expedited_deposit) ? object.min_expedited_deposit.map((e: any) => Coin.fromAmino(e)) : [], - minInitialDepositRatio: object.min_initial_deposit_ratio - }; + const message = createBaseDepositParams(); + message.minDeposit = object.min_deposit?.map(e => Coin.fromAmino(e)) || []; + if (object.max_deposit_period !== undefined && object.max_deposit_period !== null) { + message.maxDepositPeriod = Duration.fromAmino(object.max_deposit_period); + } + return message; }, toAmino(message: DepositParams): DepositParamsAmino { const obj: any = {}; @@ -1218,12 +1237,6 @@ export const DepositParams = { obj.min_deposit = []; } obj.max_deposit_period = message.maxDepositPeriod ? Duration.toAmino(message.maxDepositPeriod) : undefined; - if (message.minExpeditedDeposit) { - obj.min_expedited_deposit = message.minExpeditedDeposit.map(e => e ? Coin.toAmino(e) : undefined); - } else { - obj.min_expedited_deposit = []; - } - obj.min_initial_deposit_ratio = message.minInitialDepositRatio; return obj; }, fromAminoMsg(object: DepositParamsAminoMsg): DepositParams { @@ -1250,9 +1263,7 @@ export const DepositParams = { }; function createBaseVotingParams(): VotingParams { return { - votingPeriod: Duration.fromPartial({}), - proposalVotingPeriods: [], - expeditedVotingPeriod: Duration.fromPartial({}) + votingPeriod: Duration.fromPartial({}) }; } export const VotingParams = { @@ -1261,12 +1272,6 @@ export const VotingParams = { if (message.votingPeriod !== undefined) { Duration.encode(message.votingPeriod, writer.uint32(10).fork()).ldelim(); } - for (const v of message.proposalVotingPeriods) { - ProposalVotingPeriod.encode(v!, writer.uint32(18).fork()).ldelim(); - } - if (message.expeditedVotingPeriod !== undefined) { - Duration.encode(message.expeditedVotingPeriod, writer.uint32(26).fork()).ldelim(); - } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): VotingParams { @@ -1279,12 +1284,6 @@ export const VotingParams = { case 1: message.votingPeriod = Duration.decode(reader, reader.uint32()); break; - case 2: - message.proposalVotingPeriods.push(ProposalVotingPeriod.decode(reader, reader.uint32())); - break; - case 3: - message.expeditedVotingPeriod = Duration.decode(reader, reader.uint32()); - break; default: reader.skipType(tag & 7); break; @@ -1295,26 +1294,18 @@ export const VotingParams = { fromPartial(object: Partial): VotingParams { const message = createBaseVotingParams(); message.votingPeriod = object.votingPeriod !== undefined && object.votingPeriod !== null ? Duration.fromPartial(object.votingPeriod) : undefined; - message.proposalVotingPeriods = object.proposalVotingPeriods?.map(e => ProposalVotingPeriod.fromPartial(e)) || []; - message.expeditedVotingPeriod = object.expeditedVotingPeriod !== undefined && object.expeditedVotingPeriod !== null ? Duration.fromPartial(object.expeditedVotingPeriod) : undefined; return message; }, fromAmino(object: VotingParamsAmino): VotingParams { - return { - votingPeriod: object?.voting_period ? Duration.fromAmino(object.voting_period) : undefined, - proposalVotingPeriods: Array.isArray(object?.proposal_voting_periods) ? object.proposal_voting_periods.map((e: any) => ProposalVotingPeriod.fromAmino(e)) : [], - expeditedVotingPeriod: object?.expedited_voting_period ? Duration.fromAmino(object.expedited_voting_period) : undefined - }; + const message = createBaseVotingParams(); + if (object.voting_period !== undefined && object.voting_period !== null) { + message.votingPeriod = Duration.fromAmino(object.voting_period); + } + return message; }, toAmino(message: VotingParams): VotingParamsAmino { const obj: any = {}; obj.voting_period = message.votingPeriod ? Duration.toAmino(message.votingPeriod) : undefined; - if (message.proposalVotingPeriods) { - obj.proposal_voting_periods = message.proposalVotingPeriods.map(e => e ? ProposalVotingPeriod.toAmino(e) : undefined); - } else { - obj.proposal_voting_periods = []; - } - obj.expedited_voting_period = message.expeditedVotingPeriod ? Duration.toAmino(message.expeditedVotingPeriod) : undefined; return obj; }, fromAminoMsg(object: VotingParamsAminoMsg): VotingParams { @@ -1343,9 +1334,7 @@ function createBaseTallyParams(): TallyParams { return { quorum: new Uint8Array(), threshold: new Uint8Array(), - vetoThreshold: new Uint8Array(), - expeditedThreshold: new Uint8Array(), - expeditedQuorum: new Uint8Array() + vetoThreshold: new Uint8Array() }; } export const TallyParams = { @@ -1360,12 +1349,6 @@ export const TallyParams = { if (message.vetoThreshold.length !== 0) { writer.uint32(26).bytes(message.vetoThreshold); } - if (message.expeditedThreshold.length !== 0) { - writer.uint32(34).bytes(message.expeditedThreshold); - } - if (message.expeditedQuorum.length !== 0) { - writer.uint32(42).bytes(message.expeditedQuorum); - } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): TallyParams { @@ -1384,12 +1367,6 @@ export const TallyParams = { case 3: message.vetoThreshold = reader.bytes(); break; - case 4: - message.expeditedThreshold = reader.bytes(); - break; - case 5: - message.expeditedQuorum = reader.bytes(); - break; default: reader.skipType(tag & 7); break; @@ -1402,26 +1379,26 @@ export const TallyParams = { message.quorum = object.quorum ?? new Uint8Array(); message.threshold = object.threshold ?? new Uint8Array(); message.vetoThreshold = object.vetoThreshold ?? new Uint8Array(); - message.expeditedThreshold = object.expeditedThreshold ?? new Uint8Array(); - message.expeditedQuorum = object.expeditedQuorum ?? new Uint8Array(); return message; }, fromAmino(object: TallyParamsAmino): TallyParams { - return { - quorum: object.quorum, - threshold: object.threshold, - vetoThreshold: object.veto_threshold, - expeditedThreshold: object.expedited_threshold, - expeditedQuorum: object.expedited_quorum - }; + const message = createBaseTallyParams(); + if (object.quorum !== undefined && object.quorum !== null) { + message.quorum = bytesFromBase64(object.quorum); + } + if (object.threshold !== undefined && object.threshold !== null) { + message.threshold = bytesFromBase64(object.threshold); + } + if (object.veto_threshold !== undefined && object.veto_threshold !== null) { + message.vetoThreshold = bytesFromBase64(object.veto_threshold); + } + return message; }, toAmino(message: TallyParams): TallyParamsAmino { const obj: any = {}; - obj.quorum = message.quorum; - obj.threshold = message.threshold; - obj.veto_threshold = message.vetoThreshold; - obj.expedited_threshold = message.expeditedThreshold; - obj.expedited_quorum = message.expeditedQuorum; + obj.quorum = message.quorum ? base64FromBytes(message.quorum) : undefined; + obj.threshold = message.threshold ? base64FromBytes(message.threshold) : undefined; + obj.veto_threshold = message.vetoThreshold ? base64FromBytes(message.vetoThreshold) : undefined; return obj; }, fromAminoMsg(object: TallyParamsAminoMsg): TallyParams { @@ -1446,110 +1423,393 @@ export const TallyParams = { }; } }; -function createBaseProposalVotingPeriod(): ProposalVotingPeriod { - return { - proposalType: "", - votingPeriod: Duration.fromPartial({}) - }; -} -export const ProposalVotingPeriod = { - typeUrl: "/cosmos.gov.v1beta1.ProposalVotingPeriod", - encode(message: ProposalVotingPeriod, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { - if (message.proposalType !== "") { - writer.uint32(10).string(message.proposalType); - } - if (message.votingPeriod !== undefined) { - Duration.encode(message.votingPeriod, writer.uint32(18).fork()).ldelim(); - } - return writer; - }, - decode(input: BinaryReader | Uint8Array, length?: number): ProposalVotingPeriod { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseProposalVotingPeriod(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.proposalType = reader.string(); - break; - case 2: - message.votingPeriod = Duration.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - fromPartial(object: Partial): ProposalVotingPeriod { - const message = createBaseProposalVotingPeriod(); - message.proposalType = object.proposalType ?? ""; - message.votingPeriod = object.votingPeriod !== undefined && object.votingPeriod !== null ? Duration.fromPartial(object.votingPeriod) : undefined; - return message; - }, - fromAmino(object: ProposalVotingPeriodAmino): ProposalVotingPeriod { - return { - proposalType: object.proposal_type, - votingPeriod: object?.voting_period ? Duration.fromAmino(object.voting_period) : undefined - }; - }, - toAmino(message: ProposalVotingPeriod): ProposalVotingPeriodAmino { - const obj: any = {}; - obj.proposal_type = message.proposalType; - obj.voting_period = message.votingPeriod ? Duration.toAmino(message.votingPeriod) : undefined; - return obj; - }, - fromAminoMsg(object: ProposalVotingPeriodAminoMsg): ProposalVotingPeriod { - return ProposalVotingPeriod.fromAmino(object.value); - }, - toAminoMsg(message: ProposalVotingPeriod): ProposalVotingPeriodAminoMsg { - return { - type: "cosmos-sdk/ProposalVotingPeriod", - value: ProposalVotingPeriod.toAmino(message) - }; - }, - fromProtoMsg(message: ProposalVotingPeriodProtoMsg): ProposalVotingPeriod { - return ProposalVotingPeriod.decode(message.value); - }, - toProto(message: ProposalVotingPeriod): Uint8Array { - return ProposalVotingPeriod.encode(message).finish(); - }, - toProtoMsg(message: ProposalVotingPeriod): ProposalVotingPeriodProtoMsg { - return { - typeUrl: "/cosmos.gov.v1beta1.ProposalVotingPeriod", - value: ProposalVotingPeriod.encode(message).finish() - }; - } -}; -export const Content_InterfaceDecoder = (input: BinaryReader | Uint8Array): TextProposal | Any => { +export const Cosmos_govv1beta1Content_InterfaceDecoder = (input: BinaryReader | Uint8Array): CommunityPoolSpendProposal | CommunityPoolSpendProposalWithDeposit | TextProposal | SoftwareUpgradeProposal | CancelSoftwareUpgradeProposal | ClientUpdateProposal | UpgradeProposal | StoreCodeProposal | InstantiateContractProposal | InstantiateContract2Proposal | MigrateContractProposal | SudoContractProposal | ExecuteContractProposal | UpdateAdminProposal | ClearAdminProposal | PinCodesProposal | UnpinCodesProposal | UpdateInstantiateConfigProposal | StoreAndInstantiateContractProposal | ReplaceMigrationRecordsProposal | UpdateMigrationRecordsProposal | CreateConcentratedLiquidityPoolsAndLinktoCFMMProposal | SetScalingFactorControllerProposal | ReplacePoolIncentivesProposal | UpdatePoolIncentivesProposal | SetProtoRevEnabledProposal | SetProtoRevAdminAccountProposal | SetSuperfluidAssetsProposal | RemoveSuperfluidAssetsProposal | UpdateUnpoolWhiteListProposal | UpdateFeeTokenProposal | Any => { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - const data = Any.decode(reader, reader.uint32()); + const data = Any.decode(reader, reader.uint32(), true); switch (data.typeUrl) { + case "/cosmos.distribution.v1beta1.CommunityPoolSpendProposal": + return CommunityPoolSpendProposal.decode(data.value, undefined, true); + case "/cosmos.distribution.v1beta1.CommunityPoolSpendProposalWithDeposit": + return CommunityPoolSpendProposalWithDeposit.decode(data.value, undefined, true); case "/cosmos.gov.v1beta1.TextProposal": - return TextProposal.decode(data.value); + return TextProposal.decode(data.value, undefined, true); + case "/cosmos.upgrade.v1beta1.SoftwareUpgradeProposal": + return SoftwareUpgradeProposal.decode(data.value, undefined, true); + case "/cosmos.upgrade.v1beta1.CancelSoftwareUpgradeProposal": + return CancelSoftwareUpgradeProposal.decode(data.value, undefined, true); + case "/ibc.core.client.v1.ClientUpdateProposal": + return ClientUpdateProposal.decode(data.value, undefined, true); + case "/ibc.core.client.v1.UpgradeProposal": + return UpgradeProposal.decode(data.value, undefined, true); + case "/cosmwasm.wasm.v1.StoreCodeProposal": + return StoreCodeProposal.decode(data.value, undefined, true); + case "/cosmwasm.wasm.v1.InstantiateContractProposal": + return InstantiateContractProposal.decode(data.value, undefined, true); + case "/cosmwasm.wasm.v1.InstantiateContract2Proposal": + return InstantiateContract2Proposal.decode(data.value, undefined, true); + case "/cosmwasm.wasm.v1.MigrateContractProposal": + return MigrateContractProposal.decode(data.value, undefined, true); + case "/cosmwasm.wasm.v1.SudoContractProposal": + return SudoContractProposal.decode(data.value, undefined, true); + case "/cosmwasm.wasm.v1.ExecuteContractProposal": + return ExecuteContractProposal.decode(data.value, undefined, true); + case "/cosmwasm.wasm.v1.UpdateAdminProposal": + return UpdateAdminProposal.decode(data.value, undefined, true); + case "/cosmwasm.wasm.v1.ClearAdminProposal": + return ClearAdminProposal.decode(data.value, undefined, true); + case "/cosmwasm.wasm.v1.PinCodesProposal": + return PinCodesProposal.decode(data.value, undefined, true); + case "/cosmwasm.wasm.v1.UnpinCodesProposal": + return UnpinCodesProposal.decode(data.value, undefined, true); + case "/cosmwasm.wasm.v1.UpdateInstantiateConfigProposal": + return UpdateInstantiateConfigProposal.decode(data.value, undefined, true); + case "/cosmwasm.wasm.v1.StoreAndInstantiateContractProposal": + return StoreAndInstantiateContractProposal.decode(data.value, undefined, true); + case "/osmosis.gamm.v1beta1.ReplaceMigrationRecordsProposal": + return ReplaceMigrationRecordsProposal.decode(data.value, undefined, true); + case "/osmosis.gamm.v1beta1.UpdateMigrationRecordsProposal": + return UpdateMigrationRecordsProposal.decode(data.value, undefined, true); + case "/osmosis.gamm.v1beta1.CreateConcentratedLiquidityPoolsAndLinktoCFMMProposal": + return CreateConcentratedLiquidityPoolsAndLinktoCFMMProposal.decode(data.value, undefined, true); + case "/osmosis.gamm.v1beta1.SetScalingFactorControllerProposal": + return SetScalingFactorControllerProposal.decode(data.value, undefined, true); + case "/osmosis.poolincentives.v1beta1.ReplacePoolIncentivesProposal": + return ReplacePoolIncentivesProposal.decode(data.value, undefined, true); + case "/osmosis.poolincentives.v1beta1.UpdatePoolIncentivesProposal": + return UpdatePoolIncentivesProposal.decode(data.value, undefined, true); + case "/osmosis.protorev.v1beta1.SetProtoRevEnabledProposal": + return SetProtoRevEnabledProposal.decode(data.value, undefined, true); + case "/osmosis.protorev.v1beta1.SetProtoRevAdminAccountProposal": + return SetProtoRevAdminAccountProposal.decode(data.value, undefined, true); + case "/osmosis.superfluid.v1beta1.SetSuperfluidAssetsProposal": + return SetSuperfluidAssetsProposal.decode(data.value, undefined, true); + case "/osmosis.superfluid.v1beta1.RemoveSuperfluidAssetsProposal": + return RemoveSuperfluidAssetsProposal.decode(data.value, undefined, true); + case "/osmosis.superfluid.v1beta1.UpdateUnpoolWhiteListProposal": + return UpdateUnpoolWhiteListProposal.decode(data.value, undefined, true); + case "/osmosis.txfees.v1beta1.UpdateFeeTokenProposal": + return UpdateFeeTokenProposal.decode(data.value, undefined, true); default: return data; } }; -export const Content_FromAmino = (content: AnyAmino) => { +export const Cosmos_govv1beta1Content_FromAmino = (content: AnyAmino) => { switch (content.type) { + case "cosmos-sdk/CommunityPoolSpendProposal": + return Any.fromPartial({ + typeUrl: "/cosmos.distribution.v1beta1.CommunityPoolSpendProposal", + value: CommunityPoolSpendProposal.encode(CommunityPoolSpendProposal.fromPartial(CommunityPoolSpendProposal.fromAmino(content.value))).finish() + }); + case "cosmos-sdk/CommunityPoolSpendProposalWithDeposit": + return Any.fromPartial({ + typeUrl: "/cosmos.distribution.v1beta1.CommunityPoolSpendProposalWithDeposit", + value: CommunityPoolSpendProposalWithDeposit.encode(CommunityPoolSpendProposalWithDeposit.fromPartial(CommunityPoolSpendProposalWithDeposit.fromAmino(content.value))).finish() + }); case "cosmos-sdk/TextProposal": return Any.fromPartial({ typeUrl: "/cosmos.gov.v1beta1.TextProposal", value: TextProposal.encode(TextProposal.fromPartial(TextProposal.fromAmino(content.value))).finish() }); + case "cosmos-sdk/SoftwareUpgradeProposal": + return Any.fromPartial({ + typeUrl: "/cosmos.upgrade.v1beta1.SoftwareUpgradeProposal", + value: SoftwareUpgradeProposal.encode(SoftwareUpgradeProposal.fromPartial(SoftwareUpgradeProposal.fromAmino(content.value))).finish() + }); + case "cosmos-sdk/CancelSoftwareUpgradeProposal": + return Any.fromPartial({ + typeUrl: "/cosmos.upgrade.v1beta1.CancelSoftwareUpgradeProposal", + value: CancelSoftwareUpgradeProposal.encode(CancelSoftwareUpgradeProposal.fromPartial(CancelSoftwareUpgradeProposal.fromAmino(content.value))).finish() + }); + case "cosmos-sdk/ClientUpdateProposal": + return Any.fromPartial({ + typeUrl: "/ibc.core.client.v1.ClientUpdateProposal", + value: ClientUpdateProposal.encode(ClientUpdateProposal.fromPartial(ClientUpdateProposal.fromAmino(content.value))).finish() + }); + case "cosmos-sdk/UpgradeProposal": + return Any.fromPartial({ + typeUrl: "/ibc.core.client.v1.UpgradeProposal", + value: UpgradeProposal.encode(UpgradeProposal.fromPartial(UpgradeProposal.fromAmino(content.value))).finish() + }); + case "wasm/StoreCodeProposal": + return Any.fromPartial({ + typeUrl: "/cosmwasm.wasm.v1.StoreCodeProposal", + value: StoreCodeProposal.encode(StoreCodeProposal.fromPartial(StoreCodeProposal.fromAmino(content.value))).finish() + }); + case "wasm/InstantiateContractProposal": + return Any.fromPartial({ + typeUrl: "/cosmwasm.wasm.v1.InstantiateContractProposal", + value: InstantiateContractProposal.encode(InstantiateContractProposal.fromPartial(InstantiateContractProposal.fromAmino(content.value))).finish() + }); + case "wasm/InstantiateContract2Proposal": + return Any.fromPartial({ + typeUrl: "/cosmwasm.wasm.v1.InstantiateContract2Proposal", + value: InstantiateContract2Proposal.encode(InstantiateContract2Proposal.fromPartial(InstantiateContract2Proposal.fromAmino(content.value))).finish() + }); + case "wasm/MigrateContractProposal": + return Any.fromPartial({ + typeUrl: "/cosmwasm.wasm.v1.MigrateContractProposal", + value: MigrateContractProposal.encode(MigrateContractProposal.fromPartial(MigrateContractProposal.fromAmino(content.value))).finish() + }); + case "wasm/SudoContractProposal": + return Any.fromPartial({ + typeUrl: "/cosmwasm.wasm.v1.SudoContractProposal", + value: SudoContractProposal.encode(SudoContractProposal.fromPartial(SudoContractProposal.fromAmino(content.value))).finish() + }); + case "wasm/ExecuteContractProposal": + return Any.fromPartial({ + typeUrl: "/cosmwasm.wasm.v1.ExecuteContractProposal", + value: ExecuteContractProposal.encode(ExecuteContractProposal.fromPartial(ExecuteContractProposal.fromAmino(content.value))).finish() + }); + case "wasm/UpdateAdminProposal": + return Any.fromPartial({ + typeUrl: "/cosmwasm.wasm.v1.UpdateAdminProposal", + value: UpdateAdminProposal.encode(UpdateAdminProposal.fromPartial(UpdateAdminProposal.fromAmino(content.value))).finish() + }); + case "wasm/ClearAdminProposal": + return Any.fromPartial({ + typeUrl: "/cosmwasm.wasm.v1.ClearAdminProposal", + value: ClearAdminProposal.encode(ClearAdminProposal.fromPartial(ClearAdminProposal.fromAmino(content.value))).finish() + }); + case "wasm/PinCodesProposal": + return Any.fromPartial({ + typeUrl: "/cosmwasm.wasm.v1.PinCodesProposal", + value: PinCodesProposal.encode(PinCodesProposal.fromPartial(PinCodesProposal.fromAmino(content.value))).finish() + }); + case "wasm/UnpinCodesProposal": + return Any.fromPartial({ + typeUrl: "/cosmwasm.wasm.v1.UnpinCodesProposal", + value: UnpinCodesProposal.encode(UnpinCodesProposal.fromPartial(UnpinCodesProposal.fromAmino(content.value))).finish() + }); + case "wasm/UpdateInstantiateConfigProposal": + return Any.fromPartial({ + typeUrl: "/cosmwasm.wasm.v1.UpdateInstantiateConfigProposal", + value: UpdateInstantiateConfigProposal.encode(UpdateInstantiateConfigProposal.fromPartial(UpdateInstantiateConfigProposal.fromAmino(content.value))).finish() + }); + case "wasm/StoreAndInstantiateContractProposal": + return Any.fromPartial({ + typeUrl: "/cosmwasm.wasm.v1.StoreAndInstantiateContractProposal", + value: StoreAndInstantiateContractProposal.encode(StoreAndInstantiateContractProposal.fromPartial(StoreAndInstantiateContractProposal.fromAmino(content.value))).finish() + }); + case "osmosis/ReplaceMigrationRecordsProposal": + return Any.fromPartial({ + typeUrl: "/osmosis.gamm.v1beta1.ReplaceMigrationRecordsProposal", + value: ReplaceMigrationRecordsProposal.encode(ReplaceMigrationRecordsProposal.fromPartial(ReplaceMigrationRecordsProposal.fromAmino(content.value))).finish() + }); + case "osmosis/UpdateMigrationRecordsProposal": + return Any.fromPartial({ + typeUrl: "/osmosis.gamm.v1beta1.UpdateMigrationRecordsProposal", + value: UpdateMigrationRecordsProposal.encode(UpdateMigrationRecordsProposal.fromPartial(UpdateMigrationRecordsProposal.fromAmino(content.value))).finish() + }); + case "osmosis/CreateConcentratedLiquidityPoolsAndLinktoCFMMProposal": + return Any.fromPartial({ + typeUrl: "/osmosis.gamm.v1beta1.CreateConcentratedLiquidityPoolsAndLinktoCFMMProposal", + value: CreateConcentratedLiquidityPoolsAndLinktoCFMMProposal.encode(CreateConcentratedLiquidityPoolsAndLinktoCFMMProposal.fromPartial(CreateConcentratedLiquidityPoolsAndLinktoCFMMProposal.fromAmino(content.value))).finish() + }); + case "osmosis/SetScalingFactorControllerProposal": + return Any.fromPartial({ + typeUrl: "/osmosis.gamm.v1beta1.SetScalingFactorControllerProposal", + value: SetScalingFactorControllerProposal.encode(SetScalingFactorControllerProposal.fromPartial(SetScalingFactorControllerProposal.fromAmino(content.value))).finish() + }); + case "osmosis/ReplacePoolIncentivesProposal": + return Any.fromPartial({ + typeUrl: "/osmosis.poolincentives.v1beta1.ReplacePoolIncentivesProposal", + value: ReplacePoolIncentivesProposal.encode(ReplacePoolIncentivesProposal.fromPartial(ReplacePoolIncentivesProposal.fromAmino(content.value))).finish() + }); + case "osmosis/UpdatePoolIncentivesProposal": + return Any.fromPartial({ + typeUrl: "/osmosis.poolincentives.v1beta1.UpdatePoolIncentivesProposal", + value: UpdatePoolIncentivesProposal.encode(UpdatePoolIncentivesProposal.fromPartial(UpdatePoolIncentivesProposal.fromAmino(content.value))).finish() + }); + case "osmosis/SetProtoRevEnabledProposal": + return Any.fromPartial({ + typeUrl: "/osmosis.protorev.v1beta1.SetProtoRevEnabledProposal", + value: SetProtoRevEnabledProposal.encode(SetProtoRevEnabledProposal.fromPartial(SetProtoRevEnabledProposal.fromAmino(content.value))).finish() + }); + case "osmosis/SetProtoRevAdminAccountProposal": + return Any.fromPartial({ + typeUrl: "/osmosis.protorev.v1beta1.SetProtoRevAdminAccountProposal", + value: SetProtoRevAdminAccountProposal.encode(SetProtoRevAdminAccountProposal.fromPartial(SetProtoRevAdminAccountProposal.fromAmino(content.value))).finish() + }); + case "osmosis/set-superfluid-assets-proposal": + return Any.fromPartial({ + typeUrl: "/osmosis.superfluid.v1beta1.SetSuperfluidAssetsProposal", + value: SetSuperfluidAssetsProposal.encode(SetSuperfluidAssetsProposal.fromPartial(SetSuperfluidAssetsProposal.fromAmino(content.value))).finish() + }); + case "osmosis/del-superfluid-assets-proposal": + return Any.fromPartial({ + typeUrl: "/osmosis.superfluid.v1beta1.RemoveSuperfluidAssetsProposal", + value: RemoveSuperfluidAssetsProposal.encode(RemoveSuperfluidAssetsProposal.fromPartial(RemoveSuperfluidAssetsProposal.fromAmino(content.value))).finish() + }); + case "osmosis/update-unpool-whitelist": + return Any.fromPartial({ + typeUrl: "/osmosis.superfluid.v1beta1.UpdateUnpoolWhiteListProposal", + value: UpdateUnpoolWhiteListProposal.encode(UpdateUnpoolWhiteListProposal.fromPartial(UpdateUnpoolWhiteListProposal.fromAmino(content.value))).finish() + }); + case "osmosis/UpdateFeeTokenProposal": + return Any.fromPartial({ + typeUrl: "/osmosis.txfees.v1beta1.UpdateFeeTokenProposal", + value: UpdateFeeTokenProposal.encode(UpdateFeeTokenProposal.fromPartial(UpdateFeeTokenProposal.fromAmino(content.value))).finish() + }); default: return Any.fromAmino(content); } }; -export const Content_ToAmino = (content: Any) => { +export const Cosmos_govv1beta1Content_ToAmino = (content: Any) => { switch (content.typeUrl) { + case "/cosmos.distribution.v1beta1.CommunityPoolSpendProposal": + return { + type: "cosmos-sdk/CommunityPoolSpendProposal", + value: CommunityPoolSpendProposal.toAmino(CommunityPoolSpendProposal.decode(content.value, undefined)) + }; + case "/cosmos.distribution.v1beta1.CommunityPoolSpendProposalWithDeposit": + return { + type: "cosmos-sdk/CommunityPoolSpendProposalWithDeposit", + value: CommunityPoolSpendProposalWithDeposit.toAmino(CommunityPoolSpendProposalWithDeposit.decode(content.value, undefined)) + }; case "/cosmos.gov.v1beta1.TextProposal": return { type: "cosmos-sdk/TextProposal", - value: TextProposal.toAmino(TextProposal.decode(content.value)) + value: TextProposal.toAmino(TextProposal.decode(content.value, undefined)) + }; + case "/cosmos.upgrade.v1beta1.SoftwareUpgradeProposal": + return { + type: "cosmos-sdk/SoftwareUpgradeProposal", + value: SoftwareUpgradeProposal.toAmino(SoftwareUpgradeProposal.decode(content.value, undefined)) + }; + case "/cosmos.upgrade.v1beta1.CancelSoftwareUpgradeProposal": + return { + type: "cosmos-sdk/CancelSoftwareUpgradeProposal", + value: CancelSoftwareUpgradeProposal.toAmino(CancelSoftwareUpgradeProposal.decode(content.value, undefined)) + }; + case "/ibc.core.client.v1.ClientUpdateProposal": + return { + type: "cosmos-sdk/ClientUpdateProposal", + value: ClientUpdateProposal.toAmino(ClientUpdateProposal.decode(content.value, undefined)) + }; + case "/ibc.core.client.v1.UpgradeProposal": + return { + type: "cosmos-sdk/UpgradeProposal", + value: UpgradeProposal.toAmino(UpgradeProposal.decode(content.value, undefined)) + }; + case "/cosmwasm.wasm.v1.StoreCodeProposal": + return { + type: "wasm/StoreCodeProposal", + value: StoreCodeProposal.toAmino(StoreCodeProposal.decode(content.value, undefined)) + }; + case "/cosmwasm.wasm.v1.InstantiateContractProposal": + return { + type: "wasm/InstantiateContractProposal", + value: InstantiateContractProposal.toAmino(InstantiateContractProposal.decode(content.value, undefined)) + }; + case "/cosmwasm.wasm.v1.InstantiateContract2Proposal": + return { + type: "wasm/InstantiateContract2Proposal", + value: InstantiateContract2Proposal.toAmino(InstantiateContract2Proposal.decode(content.value, undefined)) + }; + case "/cosmwasm.wasm.v1.MigrateContractProposal": + return { + type: "wasm/MigrateContractProposal", + value: MigrateContractProposal.toAmino(MigrateContractProposal.decode(content.value, undefined)) + }; + case "/cosmwasm.wasm.v1.SudoContractProposal": + return { + type: "wasm/SudoContractProposal", + value: SudoContractProposal.toAmino(SudoContractProposal.decode(content.value, undefined)) + }; + case "/cosmwasm.wasm.v1.ExecuteContractProposal": + return { + type: "wasm/ExecuteContractProposal", + value: ExecuteContractProposal.toAmino(ExecuteContractProposal.decode(content.value, undefined)) + }; + case "/cosmwasm.wasm.v1.UpdateAdminProposal": + return { + type: "wasm/UpdateAdminProposal", + value: UpdateAdminProposal.toAmino(UpdateAdminProposal.decode(content.value, undefined)) + }; + case "/cosmwasm.wasm.v1.ClearAdminProposal": + return { + type: "wasm/ClearAdminProposal", + value: ClearAdminProposal.toAmino(ClearAdminProposal.decode(content.value, undefined)) + }; + case "/cosmwasm.wasm.v1.PinCodesProposal": + return { + type: "wasm/PinCodesProposal", + value: PinCodesProposal.toAmino(PinCodesProposal.decode(content.value, undefined)) + }; + case "/cosmwasm.wasm.v1.UnpinCodesProposal": + return { + type: "wasm/UnpinCodesProposal", + value: UnpinCodesProposal.toAmino(UnpinCodesProposal.decode(content.value, undefined)) + }; + case "/cosmwasm.wasm.v1.UpdateInstantiateConfigProposal": + return { + type: "wasm/UpdateInstantiateConfigProposal", + value: UpdateInstantiateConfigProposal.toAmino(UpdateInstantiateConfigProposal.decode(content.value, undefined)) + }; + case "/cosmwasm.wasm.v1.StoreAndInstantiateContractProposal": + return { + type: "wasm/StoreAndInstantiateContractProposal", + value: StoreAndInstantiateContractProposal.toAmino(StoreAndInstantiateContractProposal.decode(content.value, undefined)) + }; + case "/osmosis.gamm.v1beta1.ReplaceMigrationRecordsProposal": + return { + type: "osmosis/ReplaceMigrationRecordsProposal", + value: ReplaceMigrationRecordsProposal.toAmino(ReplaceMigrationRecordsProposal.decode(content.value, undefined)) + }; + case "/osmosis.gamm.v1beta1.UpdateMigrationRecordsProposal": + return { + type: "osmosis/UpdateMigrationRecordsProposal", + value: UpdateMigrationRecordsProposal.toAmino(UpdateMigrationRecordsProposal.decode(content.value, undefined)) + }; + case "/osmosis.gamm.v1beta1.CreateConcentratedLiquidityPoolsAndLinktoCFMMProposal": + return { + type: "osmosis/CreateConcentratedLiquidityPoolsAndLinktoCFMMProposal", + value: CreateConcentratedLiquidityPoolsAndLinktoCFMMProposal.toAmino(CreateConcentratedLiquidityPoolsAndLinktoCFMMProposal.decode(content.value, undefined)) + }; + case "/osmosis.gamm.v1beta1.SetScalingFactorControllerProposal": + return { + type: "osmosis/SetScalingFactorControllerProposal", + value: SetScalingFactorControllerProposal.toAmino(SetScalingFactorControllerProposal.decode(content.value, undefined)) + }; + case "/osmosis.poolincentives.v1beta1.ReplacePoolIncentivesProposal": + return { + type: "osmosis/ReplacePoolIncentivesProposal", + value: ReplacePoolIncentivesProposal.toAmino(ReplacePoolIncentivesProposal.decode(content.value, undefined)) + }; + case "/osmosis.poolincentives.v1beta1.UpdatePoolIncentivesProposal": + return { + type: "osmosis/UpdatePoolIncentivesProposal", + value: UpdatePoolIncentivesProposal.toAmino(UpdatePoolIncentivesProposal.decode(content.value, undefined)) + }; + case "/osmosis.protorev.v1beta1.SetProtoRevEnabledProposal": + return { + type: "osmosis/SetProtoRevEnabledProposal", + value: SetProtoRevEnabledProposal.toAmino(SetProtoRevEnabledProposal.decode(content.value, undefined)) + }; + case "/osmosis.protorev.v1beta1.SetProtoRevAdminAccountProposal": + return { + type: "osmosis/SetProtoRevAdminAccountProposal", + value: SetProtoRevAdminAccountProposal.toAmino(SetProtoRevAdminAccountProposal.decode(content.value, undefined)) + }; + case "/osmosis.superfluid.v1beta1.SetSuperfluidAssetsProposal": + return { + type: "osmosis/set-superfluid-assets-proposal", + value: SetSuperfluidAssetsProposal.toAmino(SetSuperfluidAssetsProposal.decode(content.value, undefined)) + }; + case "/osmosis.superfluid.v1beta1.RemoveSuperfluidAssetsProposal": + return { + type: "osmosis/del-superfluid-assets-proposal", + value: RemoveSuperfluidAssetsProposal.toAmino(RemoveSuperfluidAssetsProposal.decode(content.value, undefined)) + }; + case "/osmosis.superfluid.v1beta1.UpdateUnpoolWhiteListProposal": + return { + type: "osmosis/update-unpool-whitelist", + value: UpdateUnpoolWhiteListProposal.toAmino(UpdateUnpoolWhiteListProposal.decode(content.value, undefined)) + }; + case "/osmosis.txfees.v1beta1.UpdateFeeTokenProposal": + return { + type: "osmosis/UpdateFeeTokenProposal", + value: UpdateFeeTokenProposal.toAmino(UpdateFeeTokenProposal.decode(content.value, undefined)) }; default: return Any.toAmino(content); diff --git a/packages/osmo-query/src/codegen/cosmos/gov/v1beta1/query.ts b/packages/osmo-query/src/codegen/cosmos/gov/v1beta1/query.ts index b747105da..37a1d6274 100644 --- a/packages/osmo-query/src/codegen/cosmos/gov/v1beta1/query.ts +++ b/packages/osmo-query/src/codegen/cosmos/gov/v1beta1/query.ts @@ -1,7 +1,6 @@ -import { ProposalStatus, Proposal, ProposalAmino, ProposalSDKType, Vote, VoteAmino, VoteSDKType, VotingParams, VotingParamsAmino, VotingParamsSDKType, DepositParams, DepositParamsAmino, DepositParamsSDKType, TallyParams, TallyParamsAmino, TallyParamsSDKType, Deposit, DepositAmino, DepositSDKType, TallyResult, TallyResultAmino, TallyResultSDKType, proposalStatusFromJSON } from "./gov"; +import { ProposalStatus, Proposal, ProposalAmino, ProposalSDKType, Vote, VoteAmino, VoteSDKType, VotingParams, VotingParamsAmino, VotingParamsSDKType, DepositParams, DepositParamsAmino, DepositParamsSDKType, TallyParams, TallyParamsAmino, TallyParamsSDKType, Deposit, DepositAmino, DepositSDKType, TallyResult, TallyResultAmino, TallyResultSDKType, proposalStatusFromJSON, proposalStatusToJSON } from "./gov"; import { PageRequest, PageRequestAmino, PageRequestSDKType, PageResponse, PageResponseAmino, PageResponseSDKType } from "../../base/query/v1beta1/pagination"; import { BinaryReader, BinaryWriter } from "../../../binary"; -import { isSet } from "../../../helpers"; /** QueryProposalRequest is the request type for the Query/Proposal RPC method. */ export interface QueryProposalRequest { /** proposal_id defines the unique id of the proposal. */ @@ -14,7 +13,7 @@ export interface QueryProposalRequestProtoMsg { /** QueryProposalRequest is the request type for the Query/Proposal RPC method. */ export interface QueryProposalRequestAmino { /** proposal_id defines the unique id of the proposal. */ - proposal_id: string; + proposal_id?: string; } export interface QueryProposalRequestAminoMsg { type: "cosmos-sdk/QueryProposalRequest"; @@ -34,7 +33,7 @@ export interface QueryProposalResponseProtoMsg { } /** QueryProposalResponse is the response type for the Query/Proposal RPC method. */ export interface QueryProposalResponseAmino { - proposal?: ProposalAmino; + proposal: ProposalAmino; } export interface QueryProposalResponseAminoMsg { type: "cosmos-sdk/QueryProposalResponse"; @@ -53,7 +52,7 @@ export interface QueryProposalsRequest { /** depositor defines the deposit addresses from the proposals. */ depositor: string; /** pagination defines an optional pagination for the request. */ - pagination: PageRequest; + pagination?: PageRequest; } export interface QueryProposalsRequestProtoMsg { typeUrl: "/cosmos.gov.v1beta1.QueryProposalsRequest"; @@ -62,11 +61,11 @@ export interface QueryProposalsRequestProtoMsg { /** QueryProposalsRequest is the request type for the Query/Proposals RPC method. */ export interface QueryProposalsRequestAmino { /** proposal_status defines the status of the proposals. */ - proposal_status: ProposalStatus; + proposal_status?: 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?: PageRequestAmino; } @@ -79,16 +78,17 @@ export interface QueryProposalsRequestSDKType { proposal_status: ProposalStatus; voter: string; depositor: string; - pagination: PageRequestSDKType; + pagination?: PageRequestSDKType; } /** * QueryProposalsResponse is the response type for the Query/Proposals RPC * method. */ export interface QueryProposalsResponse { + /** proposals defines all the requested governance proposals. */ proposals: Proposal[]; /** pagination defines the pagination in the response. */ - pagination: PageResponse; + pagination?: PageResponse; } export interface QueryProposalsResponseProtoMsg { typeUrl: "/cosmos.gov.v1beta1.QueryProposalsResponse"; @@ -99,6 +99,7 @@ export interface QueryProposalsResponseProtoMsg { * method. */ export interface QueryProposalsResponseAmino { + /** proposals defines all the requested governance proposals. */ proposals: ProposalAmino[]; /** pagination defines the pagination in the response. */ pagination?: PageResponseAmino; @@ -113,13 +114,13 @@ export interface QueryProposalsResponseAminoMsg { */ export interface QueryProposalsResponseSDKType { proposals: ProposalSDKType[]; - pagination: PageResponseSDKType; + pagination?: PageResponseSDKType; } /** QueryVoteRequest is the request type for the Query/Vote RPC method. */ export interface QueryVoteRequest { /** proposal_id defines the unique id of the proposal. */ proposalId: bigint; - /** voter defines the oter address for the proposals. */ + /** voter defines the voter address for the proposals. */ voter: string; } export interface QueryVoteRequestProtoMsg { @@ -129,9 +130,9 @@ export interface QueryVoteRequestProtoMsg { /** QueryVoteRequest is the request type for the Query/Vote RPC method. */ export interface QueryVoteRequestAmino { /** proposal_id defines the unique id of the proposal. */ - proposal_id: string; - /** voter defines the oter address for the proposals. */ - voter: string; + proposal_id?: string; + /** voter defines the voter address for the proposals. */ + voter?: string; } export interface QueryVoteRequestAminoMsg { type: "cosmos-sdk/QueryVoteRequest"; @@ -144,7 +145,7 @@ export interface QueryVoteRequestSDKType { } /** QueryVoteResponse is the response type for the Query/Vote RPC method. */ export interface QueryVoteResponse { - /** vote defined the queried vote. */ + /** vote defines the queried vote. */ vote: Vote; } export interface QueryVoteResponseProtoMsg { @@ -153,8 +154,8 @@ export interface QueryVoteResponseProtoMsg { } /** QueryVoteResponse is the response type for the Query/Vote RPC method. */ export interface QueryVoteResponseAmino { - /** vote defined the queried vote. */ - vote?: VoteAmino; + /** vote defines the queried vote. */ + vote: VoteAmino; } export interface QueryVoteResponseAminoMsg { type: "cosmos-sdk/QueryVoteResponse"; @@ -169,7 +170,7 @@ export interface QueryVotesRequest { /** proposal_id defines the unique id of the proposal. */ proposalId: bigint; /** pagination defines an optional pagination for the request. */ - pagination: PageRequest; + pagination?: PageRequest; } export interface QueryVotesRequestProtoMsg { typeUrl: "/cosmos.gov.v1beta1.QueryVotesRequest"; @@ -178,7 +179,7 @@ export interface QueryVotesRequestProtoMsg { /** QueryVotesRequest is the request type for the Query/Votes RPC method. */ export interface QueryVotesRequestAmino { /** proposal_id defines the unique id of the proposal. */ - proposal_id: string; + proposal_id?: string; /** pagination defines an optional pagination for the request. */ pagination?: PageRequestAmino; } @@ -189,14 +190,14 @@ export interface QueryVotesRequestAminoMsg { /** QueryVotesRequest is the request type for the Query/Votes RPC method. */ export interface QueryVotesRequestSDKType { proposal_id: bigint; - pagination: PageRequestSDKType; + pagination?: PageRequestSDKType; } /** QueryVotesResponse is the response type for the Query/Votes RPC method. */ export interface QueryVotesResponse { - /** votes defined the queried votes. */ + /** votes defines the queried votes. */ votes: Vote[]; /** pagination defines the pagination in the response. */ - pagination: PageResponse; + pagination?: PageResponse; } export interface QueryVotesResponseProtoMsg { typeUrl: "/cosmos.gov.v1beta1.QueryVotesResponse"; @@ -204,7 +205,7 @@ export interface QueryVotesResponseProtoMsg { } /** QueryVotesResponse is the response type for the Query/Votes RPC method. */ export interface QueryVotesResponseAmino { - /** votes defined the queried votes. */ + /** votes defines the queried votes. */ votes: VoteAmino[]; /** pagination defines the pagination in the response. */ pagination?: PageResponseAmino; @@ -216,7 +217,7 @@ export interface QueryVotesResponseAminoMsg { /** QueryVotesResponse is the response type for the Query/Votes RPC method. */ export interface QueryVotesResponseSDKType { votes: VoteSDKType[]; - pagination: PageResponseSDKType; + pagination?: PageResponseSDKType; } /** QueryParamsRequest is the request type for the Query/Params RPC method. */ export interface QueryParamsRequest { @@ -236,7 +237,7 @@ export interface QueryParamsRequestAmino { * params_type defines which parameters to query for, can be one of "voting", * "tallying" or "deposit". */ - params_type: string; + params_type?: string; } export interface QueryParamsRequestAminoMsg { type: "cosmos-sdk/QueryParamsRequest"; @@ -262,11 +263,11 @@ export interface QueryParamsResponseProtoMsg { /** QueryParamsResponse is the response type for the Query/Params RPC method. */ export interface QueryParamsResponseAmino { /** voting_params defines the parameters related to voting. */ - voting_params?: VotingParamsAmino; + voting_params: VotingParamsAmino; /** deposit_params defines the parameters related to deposit. */ - deposit_params?: DepositParamsAmino; + deposit_params: DepositParamsAmino; /** tally_params defines the parameters related to tally. */ - tally_params?: TallyParamsAmino; + tally_params: TallyParamsAmino; } export interface QueryParamsResponseAminoMsg { type: "cosmos-sdk/QueryParamsResponse"; @@ -292,9 +293,9 @@ export interface QueryDepositRequestProtoMsg { /** QueryDepositRequest is the request type for the Query/Deposit RPC method. */ export interface QueryDepositRequestAmino { /** proposal_id defines the unique id of the proposal. */ - proposal_id: string; + proposal_id?: string; /** depositor defines the deposit addresses from the proposals. */ - depositor: string; + depositor?: string; } export interface QueryDepositRequestAminoMsg { type: "cosmos-sdk/QueryDepositRequest"; @@ -317,7 +318,7 @@ export interface QueryDepositResponseProtoMsg { /** QueryDepositResponse is the response type for the Query/Deposit RPC method. */ export interface QueryDepositResponseAmino { /** deposit defines the requested deposit. */ - deposit?: DepositAmino; + deposit: DepositAmino; } export interface QueryDepositResponseAminoMsg { type: "cosmos-sdk/QueryDepositResponse"; @@ -332,7 +333,7 @@ export interface QueryDepositsRequest { /** proposal_id defines the unique id of the proposal. */ proposalId: bigint; /** pagination defines an optional pagination for the request. */ - pagination: PageRequest; + pagination?: PageRequest; } export interface QueryDepositsRequestProtoMsg { typeUrl: "/cosmos.gov.v1beta1.QueryDepositsRequest"; @@ -341,7 +342,7 @@ export interface QueryDepositsRequestProtoMsg { /** QueryDepositsRequest is the request type for the Query/Deposits RPC method. */ export interface QueryDepositsRequestAmino { /** proposal_id defines the unique id of the proposal. */ - proposal_id: string; + proposal_id?: string; /** pagination defines an optional pagination for the request. */ pagination?: PageRequestAmino; } @@ -352,13 +353,14 @@ export interface QueryDepositsRequestAminoMsg { /** QueryDepositsRequest is the request type for the Query/Deposits RPC method. */ export interface QueryDepositsRequestSDKType { proposal_id: bigint; - pagination: PageRequestSDKType; + pagination?: PageRequestSDKType; } /** QueryDepositsResponse is the response type for the Query/Deposits RPC method. */ export interface QueryDepositsResponse { + /** deposits defines the requested deposits. */ deposits: Deposit[]; /** pagination defines the pagination in the response. */ - pagination: PageResponse; + pagination?: PageResponse; } export interface QueryDepositsResponseProtoMsg { typeUrl: "/cosmos.gov.v1beta1.QueryDepositsResponse"; @@ -366,6 +368,7 @@ export interface QueryDepositsResponseProtoMsg { } /** QueryDepositsResponse is the response type for the Query/Deposits RPC method. */ export interface QueryDepositsResponseAmino { + /** deposits defines the requested deposits. */ deposits: DepositAmino[]; /** pagination defines the pagination in the response. */ pagination?: PageResponseAmino; @@ -377,7 +380,7 @@ export interface QueryDepositsResponseAminoMsg { /** QueryDepositsResponse is the response type for the Query/Deposits RPC method. */ export interface QueryDepositsResponseSDKType { deposits: DepositSDKType[]; - pagination: PageResponseSDKType; + pagination?: PageResponseSDKType; } /** QueryTallyResultRequest is the request type for the Query/Tally RPC method. */ export interface QueryTallyResultRequest { @@ -391,7 +394,7 @@ export interface QueryTallyResultRequestProtoMsg { /** QueryTallyResultRequest is the request type for the Query/Tally RPC method. */ export interface QueryTallyResultRequestAmino { /** proposal_id defines the unique id of the proposal. */ - proposal_id: string; + proposal_id?: string; } export interface QueryTallyResultRequestAminoMsg { type: "cosmos-sdk/QueryTallyResultRequest"; @@ -413,7 +416,7 @@ export interface QueryTallyResultResponseProtoMsg { /** QueryTallyResultResponse is the response type for the Query/Tally RPC method. */ export interface QueryTallyResultResponseAmino { /** tally defines the requested tally. */ - tally?: TallyResultAmino; + tally: TallyResultAmino; } export interface QueryTallyResultResponseAminoMsg { type: "cosmos-sdk/QueryTallyResultResponse"; @@ -459,9 +462,11 @@ export const QueryProposalRequest = { return message; }, fromAmino(object: QueryProposalRequestAmino): QueryProposalRequest { - return { - proposalId: BigInt(object.proposal_id) - }; + const message = createBaseQueryProposalRequest(); + if (object.proposal_id !== undefined && object.proposal_id !== null) { + message.proposalId = BigInt(object.proposal_id); + } + return message; }, toAmino(message: QueryProposalRequest): QueryProposalRequestAmino { const obj: any = {}; @@ -526,13 +531,15 @@ export const QueryProposalResponse = { return message; }, fromAmino(object: QueryProposalResponseAmino): QueryProposalResponse { - return { - proposal: object?.proposal ? Proposal.fromAmino(object.proposal) : undefined - }; + const message = createBaseQueryProposalResponse(); + if (object.proposal !== undefined && object.proposal !== null) { + message.proposal = Proposal.fromAmino(object.proposal); + } + return message; }, toAmino(message: QueryProposalResponse): QueryProposalResponseAmino { const obj: any = {}; - obj.proposal = message.proposal ? Proposal.toAmino(message.proposal) : undefined; + obj.proposal = message.proposal ? Proposal.toAmino(message.proposal) : Proposal.fromPartial({}); return obj; }, fromAminoMsg(object: QueryProposalResponseAminoMsg): QueryProposalResponse { @@ -562,7 +569,7 @@ function createBaseQueryProposalsRequest(): QueryProposalsRequest { proposalStatus: 0, voter: "", depositor: "", - pagination: PageRequest.fromPartial({}) + pagination: undefined }; } export const QueryProposalsRequest = { @@ -617,16 +624,24 @@ export const QueryProposalsRequest = { return message; }, fromAmino(object: QueryProposalsRequestAmino): QueryProposalsRequest { - return { - proposalStatus: isSet(object.proposal_status) ? proposalStatusFromJSON(object.proposal_status) : -1, - voter: object.voter, - depositor: object.depositor, - pagination: object?.pagination ? PageRequest.fromAmino(object.pagination) : undefined - }; + const message = createBaseQueryProposalsRequest(); + if (object.proposal_status !== undefined && object.proposal_status !== null) { + message.proposalStatus = proposalStatusFromJSON(object.proposal_status); + } + if (object.voter !== undefined && object.voter !== null) { + message.voter = object.voter; + } + if (object.depositor !== undefined && object.depositor !== null) { + message.depositor = object.depositor; + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromAmino(object.pagination); + } + return message; }, toAmino(message: QueryProposalsRequest): QueryProposalsRequestAmino { const obj: any = {}; - obj.proposal_status = message.proposalStatus; + obj.proposal_status = proposalStatusToJSON(message.proposalStatus); obj.voter = message.voter; obj.depositor = message.depositor; obj.pagination = message.pagination ? PageRequest.toAmino(message.pagination) : undefined; @@ -657,7 +672,7 @@ export const QueryProposalsRequest = { function createBaseQueryProposalsResponse(): QueryProposalsResponse { return { proposals: [], - pagination: PageResponse.fromPartial({}) + pagination: undefined }; } export const QueryProposalsResponse = { @@ -698,10 +713,12 @@ export const QueryProposalsResponse = { return message; }, fromAmino(object: QueryProposalsResponseAmino): QueryProposalsResponse { - return { - proposals: Array.isArray(object?.proposals) ? object.proposals.map((e: any) => Proposal.fromAmino(e)) : [], - pagination: object?.pagination ? PageResponse.fromAmino(object.pagination) : undefined - }; + const message = createBaseQueryProposalsResponse(); + message.proposals = object.proposals?.map(e => Proposal.fromAmino(e)) || []; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromAmino(object.pagination); + } + return message; }, toAmino(message: QueryProposalsResponse): QueryProposalsResponseAmino { const obj: any = {}; @@ -779,10 +796,14 @@ export const QueryVoteRequest = { return message; }, fromAmino(object: QueryVoteRequestAmino): QueryVoteRequest { - return { - proposalId: BigInt(object.proposal_id), - voter: object.voter - }; + const message = createBaseQueryVoteRequest(); + if (object.proposal_id !== undefined && object.proposal_id !== null) { + message.proposalId = BigInt(object.proposal_id); + } + if (object.voter !== undefined && object.voter !== null) { + message.voter = object.voter; + } + return message; }, toAmino(message: QueryVoteRequest): QueryVoteRequestAmino { const obj: any = {}; @@ -848,13 +869,15 @@ export const QueryVoteResponse = { return message; }, fromAmino(object: QueryVoteResponseAmino): QueryVoteResponse { - return { - vote: object?.vote ? Vote.fromAmino(object.vote) : undefined - }; + const message = createBaseQueryVoteResponse(); + if (object.vote !== undefined && object.vote !== null) { + message.vote = Vote.fromAmino(object.vote); + } + return message; }, toAmino(message: QueryVoteResponse): QueryVoteResponseAmino { const obj: any = {}; - obj.vote = message.vote ? Vote.toAmino(message.vote) : undefined; + obj.vote = message.vote ? Vote.toAmino(message.vote) : Vote.fromPartial({}); return obj; }, fromAminoMsg(object: QueryVoteResponseAminoMsg): QueryVoteResponse { @@ -882,7 +905,7 @@ export const QueryVoteResponse = { function createBaseQueryVotesRequest(): QueryVotesRequest { return { proposalId: BigInt(0), - pagination: PageRequest.fromPartial({}) + pagination: undefined }; } export const QueryVotesRequest = { @@ -923,10 +946,14 @@ export const QueryVotesRequest = { return message; }, fromAmino(object: QueryVotesRequestAmino): QueryVotesRequest { - return { - proposalId: BigInt(object.proposal_id), - pagination: object?.pagination ? PageRequest.fromAmino(object.pagination) : undefined - }; + const message = createBaseQueryVotesRequest(); + if (object.proposal_id !== undefined && object.proposal_id !== null) { + message.proposalId = BigInt(object.proposal_id); + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromAmino(object.pagination); + } + return message; }, toAmino(message: QueryVotesRequest): QueryVotesRequestAmino { const obj: any = {}; @@ -959,7 +986,7 @@ export const QueryVotesRequest = { function createBaseQueryVotesResponse(): QueryVotesResponse { return { votes: [], - pagination: PageResponse.fromPartial({}) + pagination: undefined }; } export const QueryVotesResponse = { @@ -1000,10 +1027,12 @@ export const QueryVotesResponse = { return message; }, fromAmino(object: QueryVotesResponseAmino): QueryVotesResponse { - return { - votes: Array.isArray(object?.votes) ? object.votes.map((e: any) => Vote.fromAmino(e)) : [], - pagination: object?.pagination ? PageResponse.fromAmino(object.pagination) : undefined - }; + const message = createBaseQueryVotesResponse(); + message.votes = object.votes?.map(e => Vote.fromAmino(e)) || []; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromAmino(object.pagination); + } + return message; }, toAmino(message: QueryVotesResponse): QueryVotesResponseAmino { const obj: any = {}; @@ -1073,9 +1102,11 @@ export const QueryParamsRequest = { return message; }, fromAmino(object: QueryParamsRequestAmino): QueryParamsRequest { - return { - paramsType: object.params_type - }; + const message = createBaseQueryParamsRequest(); + if (object.params_type !== undefined && object.params_type !== null) { + message.paramsType = object.params_type; + } + return message; }, toAmino(message: QueryParamsRequest): QueryParamsRequestAmino { const obj: any = {}; @@ -1156,17 +1187,23 @@ export const QueryParamsResponse = { return message; }, fromAmino(object: QueryParamsResponseAmino): QueryParamsResponse { - return { - votingParams: object?.voting_params ? VotingParams.fromAmino(object.voting_params) : undefined, - depositParams: object?.deposit_params ? DepositParams.fromAmino(object.deposit_params) : undefined, - tallyParams: object?.tally_params ? TallyParams.fromAmino(object.tally_params) : undefined - }; + const message = createBaseQueryParamsResponse(); + if (object.voting_params !== undefined && object.voting_params !== null) { + message.votingParams = VotingParams.fromAmino(object.voting_params); + } + if (object.deposit_params !== undefined && object.deposit_params !== null) { + message.depositParams = DepositParams.fromAmino(object.deposit_params); + } + if (object.tally_params !== undefined && object.tally_params !== null) { + message.tallyParams = TallyParams.fromAmino(object.tally_params); + } + return message; }, toAmino(message: QueryParamsResponse): QueryParamsResponseAmino { const obj: any = {}; - obj.voting_params = message.votingParams ? VotingParams.toAmino(message.votingParams) : undefined; - obj.deposit_params = message.depositParams ? DepositParams.toAmino(message.depositParams) : undefined; - obj.tally_params = message.tallyParams ? TallyParams.toAmino(message.tallyParams) : undefined; + obj.voting_params = message.votingParams ? VotingParams.toAmino(message.votingParams) : VotingParams.fromPartial({}); + obj.deposit_params = message.depositParams ? DepositParams.toAmino(message.depositParams) : DepositParams.fromPartial({}); + obj.tally_params = message.tallyParams ? TallyParams.toAmino(message.tallyParams) : TallyParams.fromPartial({}); return obj; }, fromAminoMsg(object: QueryParamsResponseAminoMsg): QueryParamsResponse { @@ -1235,10 +1272,14 @@ export const QueryDepositRequest = { return message; }, fromAmino(object: QueryDepositRequestAmino): QueryDepositRequest { - return { - proposalId: BigInt(object.proposal_id), - depositor: object.depositor - }; + const message = createBaseQueryDepositRequest(); + if (object.proposal_id !== undefined && object.proposal_id !== null) { + message.proposalId = BigInt(object.proposal_id); + } + if (object.depositor !== undefined && object.depositor !== null) { + message.depositor = object.depositor; + } + return message; }, toAmino(message: QueryDepositRequest): QueryDepositRequestAmino { const obj: any = {}; @@ -1304,13 +1345,15 @@ export const QueryDepositResponse = { return message; }, fromAmino(object: QueryDepositResponseAmino): QueryDepositResponse { - return { - deposit: object?.deposit ? Deposit.fromAmino(object.deposit) : undefined - }; + const message = createBaseQueryDepositResponse(); + if (object.deposit !== undefined && object.deposit !== null) { + message.deposit = Deposit.fromAmino(object.deposit); + } + return message; }, toAmino(message: QueryDepositResponse): QueryDepositResponseAmino { const obj: any = {}; - obj.deposit = message.deposit ? Deposit.toAmino(message.deposit) : undefined; + obj.deposit = message.deposit ? Deposit.toAmino(message.deposit) : Deposit.fromPartial({}); return obj; }, fromAminoMsg(object: QueryDepositResponseAminoMsg): QueryDepositResponse { @@ -1338,7 +1381,7 @@ export const QueryDepositResponse = { function createBaseQueryDepositsRequest(): QueryDepositsRequest { return { proposalId: BigInt(0), - pagination: PageRequest.fromPartial({}) + pagination: undefined }; } export const QueryDepositsRequest = { @@ -1379,10 +1422,14 @@ export const QueryDepositsRequest = { return message; }, fromAmino(object: QueryDepositsRequestAmino): QueryDepositsRequest { - return { - proposalId: BigInt(object.proposal_id), - pagination: object?.pagination ? PageRequest.fromAmino(object.pagination) : undefined - }; + const message = createBaseQueryDepositsRequest(); + if (object.proposal_id !== undefined && object.proposal_id !== null) { + message.proposalId = BigInt(object.proposal_id); + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromAmino(object.pagination); + } + return message; }, toAmino(message: QueryDepositsRequest): QueryDepositsRequestAmino { const obj: any = {}; @@ -1415,7 +1462,7 @@ export const QueryDepositsRequest = { function createBaseQueryDepositsResponse(): QueryDepositsResponse { return { deposits: [], - pagination: PageResponse.fromPartial({}) + pagination: undefined }; } export const QueryDepositsResponse = { @@ -1456,10 +1503,12 @@ export const QueryDepositsResponse = { return message; }, fromAmino(object: QueryDepositsResponseAmino): QueryDepositsResponse { - return { - deposits: Array.isArray(object?.deposits) ? object.deposits.map((e: any) => Deposit.fromAmino(e)) : [], - pagination: object?.pagination ? PageResponse.fromAmino(object.pagination) : undefined - }; + const message = createBaseQueryDepositsResponse(); + message.deposits = object.deposits?.map(e => Deposit.fromAmino(e)) || []; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromAmino(object.pagination); + } + return message; }, toAmino(message: QueryDepositsResponse): QueryDepositsResponseAmino { const obj: any = {}; @@ -1529,9 +1578,11 @@ export const QueryTallyResultRequest = { return message; }, fromAmino(object: QueryTallyResultRequestAmino): QueryTallyResultRequest { - return { - proposalId: BigInt(object.proposal_id) - }; + const message = createBaseQueryTallyResultRequest(); + if (object.proposal_id !== undefined && object.proposal_id !== null) { + message.proposalId = BigInt(object.proposal_id); + } + return message; }, toAmino(message: QueryTallyResultRequest): QueryTallyResultRequestAmino { const obj: any = {}; @@ -1596,13 +1647,15 @@ export const QueryTallyResultResponse = { return message; }, fromAmino(object: QueryTallyResultResponseAmino): QueryTallyResultResponse { - return { - tally: object?.tally ? TallyResult.fromAmino(object.tally) : undefined - }; + const message = createBaseQueryTallyResultResponse(); + if (object.tally !== undefined && object.tally !== null) { + message.tally = TallyResult.fromAmino(object.tally); + } + return message; }, toAmino(message: QueryTallyResultResponse): QueryTallyResultResponseAmino { const obj: any = {}; - obj.tally = message.tally ? TallyResult.toAmino(message.tally) : undefined; + obj.tally = message.tally ? TallyResult.toAmino(message.tally) : TallyResult.fromPartial({}); return obj; }, fromAminoMsg(object: QueryTallyResultResponseAminoMsg): QueryTallyResultResponse { diff --git a/packages/osmo-query/src/codegen/cosmos/gov/v1beta1/tx.amino.ts b/packages/osmo-query/src/codegen/cosmos/gov/v1beta1/tx.amino.ts index 1fe457708..933c1663d 100644 --- a/packages/osmo-query/src/codegen/cosmos/gov/v1beta1/tx.amino.ts +++ b/packages/osmo-query/src/codegen/cosmos/gov/v1beta1/tx.amino.ts @@ -2,7 +2,7 @@ import { MsgSubmitProposal, MsgVote, MsgVoteWeighted, MsgDeposit } from "./tx"; export const AminoConverter = { "/cosmos.gov.v1beta1.MsgSubmitProposal": { - aminoType: "cosmos-sdk/v1/MsgSubmitProposal", + aminoType: "cosmos-sdk/MsgSubmitProposal", toAmino: MsgSubmitProposal.toAmino, fromAmino: MsgSubmitProposal.fromAmino }, @@ -12,12 +12,12 @@ export const AminoConverter = { fromAmino: MsgVote.fromAmino }, "/cosmos.gov.v1beta1.MsgVoteWeighted": { - aminoType: "cosmos-sdk/v1/MsgVoteWeighted", + aminoType: "cosmos-sdk/MsgVoteWeighted", toAmino: MsgVoteWeighted.toAmino, fromAmino: MsgVoteWeighted.fromAmino }, "/cosmos.gov.v1beta1.MsgDeposit": { - aminoType: "cosmos-sdk/v1/MsgDeposit", + aminoType: "cosmos-sdk/MsgDeposit", toAmino: MsgDeposit.toAmino, fromAmino: MsgDeposit.fromAmino } diff --git a/packages/osmo-query/src/codegen/cosmos/gov/v1beta1/tx.ts b/packages/osmo-query/src/codegen/cosmos/gov/v1beta1/tx.ts index 678d77782..cb61f961b 100644 --- a/packages/osmo-query/src/codegen/cosmos/gov/v1beta1/tx.ts +++ b/packages/osmo-query/src/codegen/cosmos/gov/v1beta1/tx.ts @@ -1,37 +1,50 @@ import { Any, AnyProtoMsg, AnyAmino, AnySDKType } from "../../../google/protobuf/any"; import { Coin, CoinAmino, CoinSDKType } from "../../base/v1beta1/coin"; -import { VoteOption, WeightedVoteOption, WeightedVoteOptionAmino, WeightedVoteOptionSDKType, TextProposal, TextProposalProtoMsg, TextProposalSDKType, voteOptionFromJSON } from "./gov"; +import { VoteOption, WeightedVoteOption, WeightedVoteOptionAmino, WeightedVoteOptionSDKType, TextProposal, TextProposalProtoMsg, TextProposalSDKType, voteOptionFromJSON, voteOptionToJSON } from "./gov"; +import { CommunityPoolSpendProposal, CommunityPoolSpendProposalProtoMsg, CommunityPoolSpendProposalSDKType, CommunityPoolSpendProposalWithDeposit, CommunityPoolSpendProposalWithDepositProtoMsg, CommunityPoolSpendProposalWithDepositSDKType } from "../../distribution/v1beta1/distribution"; +import { ParameterChangeProposal } from "../../params/v1beta1/params"; +import { SoftwareUpgradeProposal, CancelSoftwareUpgradeProposal } from "../../upgrade/v1beta1/upgrade"; +import { ClientUpdateProposal, UpgradeProposal } from "../../../ibc/core/client/v1/client"; +import { StoreCodeProposal, InstantiateContractProposal, InstantiateContract2Proposal, MigrateContractProposal, SudoContractProposal, ExecuteContractProposal, UpdateAdminProposal, ClearAdminProposal, PinCodesProposal, UnpinCodesProposal, UpdateInstantiateConfigProposal, StoreAndInstantiateContractProposal } from "../../../cosmwasm/wasm/v1/proposal_legacy"; +import { ReplaceMigrationRecordsProposal, UpdateMigrationRecordsProposal, CreateConcentratedLiquidityPoolsAndLinktoCFMMProposal, SetScalingFactorControllerProposal } from "../../../osmosis/gamm/v1beta1/gov"; +import { ReplacePoolIncentivesProposal, UpdatePoolIncentivesProposal } from "../../../osmosis/poolincentives/v1beta1/gov"; +import { SetProtoRevEnabledProposal, SetProtoRevAdminAccountProposal } from "../../../osmosis/protorev/v1beta1/gov"; +import { SetSuperfluidAssetsProposal, RemoveSuperfluidAssetsProposal, UpdateUnpoolWhiteListProposal } from "../../../osmosis/superfluid/v1beta1/gov"; +import { UpdateFeeTokenProposal } from "../../../osmosis/txfees/v1beta1/gov"; import { BinaryReader, BinaryWriter } from "../../../binary"; -import { isSet } from "../../../helpers"; /** * MsgSubmitProposal defines an sdk.Msg type that supports submitting arbitrary * proposal Content. */ export interface MsgSubmitProposal { - content: (TextProposal & Any) | undefined; + /** content is the proposal's content. */ + content?: (CommunityPoolSpendProposal & CommunityPoolSpendProposalWithDeposit & TextProposal & ParameterChangeProposal & SoftwareUpgradeProposal & CancelSoftwareUpgradeProposal & ClientUpdateProposal & UpgradeProposal & StoreCodeProposal & InstantiateContractProposal & InstantiateContract2Proposal & MigrateContractProposal & SudoContractProposal & ExecuteContractProposal & UpdateAdminProposal & ClearAdminProposal & PinCodesProposal & UnpinCodesProposal & UpdateInstantiateConfigProposal & StoreAndInstantiateContractProposal & ReplaceMigrationRecordsProposal & UpdateMigrationRecordsProposal & CreateConcentratedLiquidityPoolsAndLinktoCFMMProposal & SetScalingFactorControllerProposal & ReplacePoolIncentivesProposal & UpdatePoolIncentivesProposal & SetProtoRevEnabledProposal & SetProtoRevAdminAccountProposal & SetSuperfluidAssetsProposal & RemoveSuperfluidAssetsProposal & UpdateUnpoolWhiteListProposal & UpdateFeeTokenProposal & Any) | undefined; + /** initial_deposit is the deposit value that must be paid at proposal submission. */ initialDeposit: Coin[]; + /** proposer is the account address of the proposer. */ proposer: string; - isExpedited: boolean; } export interface MsgSubmitProposalProtoMsg { typeUrl: "/cosmos.gov.v1beta1.MsgSubmitProposal"; value: Uint8Array; } export type MsgSubmitProposalEncoded = Omit & { - content?: TextProposalProtoMsg | AnyProtoMsg | undefined; + /** content is the proposal's content. */content?: CommunityPoolSpendProposalProtoMsg | CommunityPoolSpendProposalWithDepositProtoMsg | TextProposalProtoMsg | ParameterChangeProposalProtoMsg | SoftwareUpgradeProposalProtoMsg | CancelSoftwareUpgradeProposalProtoMsg | ClientUpdateProposalProtoMsg | UpgradeProposalProtoMsg | StoreCodeProposalProtoMsg | InstantiateContractProposalProtoMsg | InstantiateContract2ProposalProtoMsg | MigrateContractProposalProtoMsg | SudoContractProposalProtoMsg | ExecuteContractProposalProtoMsg | UpdateAdminProposalProtoMsg | ClearAdminProposalProtoMsg | PinCodesProposalProtoMsg | UnpinCodesProposalProtoMsg | UpdateInstantiateConfigProposalProtoMsg | StoreAndInstantiateContractProposalProtoMsg | ReplaceMigrationRecordsProposalProtoMsg | UpdateMigrationRecordsProposalProtoMsg | CreateConcentratedLiquidityPoolsAndLinktoCFMMProposalProtoMsg | SetScalingFactorControllerProposalProtoMsg | ReplacePoolIncentivesProposalProtoMsg | UpdatePoolIncentivesProposalProtoMsg | SetProtoRevEnabledProposalProtoMsg | SetProtoRevAdminAccountProposalProtoMsg | SetSuperfluidAssetsProposalProtoMsg | RemoveSuperfluidAssetsProposalProtoMsg | UpdateUnpoolWhiteListProposalProtoMsg | UpdateFeeTokenProposalProtoMsg | AnyProtoMsg | undefined; }; /** * MsgSubmitProposal defines an sdk.Msg type that supports submitting arbitrary * proposal Content. */ export interface MsgSubmitProposalAmino { + /** content is the proposal's content. */ content?: AnyAmino; + /** initial_deposit is the deposit value that must be paid at proposal submission. */ initial_deposit: CoinAmino[]; - proposer: string; - is_expedited: boolean; + /** proposer is the account address of the proposer. */ + proposer?: string; } export interface MsgSubmitProposalAminoMsg { - type: "cosmos-sdk/v1/MsgSubmitProposal"; + type: "cosmos-sdk/MsgSubmitProposal"; value: MsgSubmitProposalAmino; } /** @@ -39,13 +52,13 @@ export interface MsgSubmitProposalAminoMsg { * proposal Content. */ export interface MsgSubmitProposalSDKType { - content: TextProposalSDKType | AnySDKType | undefined; + content?: CommunityPoolSpendProposalSDKType | CommunityPoolSpendProposalWithDepositSDKType | TextProposalSDKType | ParameterChangeProposalSDKType | SoftwareUpgradeProposalSDKType | CancelSoftwareUpgradeProposalSDKType | ClientUpdateProposalSDKType | UpgradeProposalSDKType | StoreCodeProposalSDKType | InstantiateContractProposalSDKType | InstantiateContract2ProposalSDKType | MigrateContractProposalSDKType | SudoContractProposalSDKType | ExecuteContractProposalSDKType | UpdateAdminProposalSDKType | ClearAdminProposalSDKType | PinCodesProposalSDKType | UnpinCodesProposalSDKType | UpdateInstantiateConfigProposalSDKType | StoreAndInstantiateContractProposalSDKType | ReplaceMigrationRecordsProposalSDKType | UpdateMigrationRecordsProposalSDKType | CreateConcentratedLiquidityPoolsAndLinktoCFMMProposalSDKType | SetScalingFactorControllerProposalSDKType | ReplacePoolIncentivesProposalSDKType | UpdatePoolIncentivesProposalSDKType | SetProtoRevEnabledProposalSDKType | SetProtoRevAdminAccountProposalSDKType | SetSuperfluidAssetsProposalSDKType | RemoveSuperfluidAssetsProposalSDKType | UpdateUnpoolWhiteListProposalSDKType | UpdateFeeTokenProposalSDKType | AnySDKType | undefined; initial_deposit: CoinSDKType[]; proposer: string; - is_expedited: boolean; } /** MsgSubmitProposalResponse defines the Msg/SubmitProposal response type. */ export interface MsgSubmitProposalResponse { + /** proposal_id defines the unique id of the proposal. */ proposalId: bigint; } export interface MsgSubmitProposalResponseProtoMsg { @@ -54,6 +67,7 @@ export interface MsgSubmitProposalResponseProtoMsg { } /** MsgSubmitProposalResponse defines the Msg/SubmitProposal response type. */ export interface MsgSubmitProposalResponseAmino { + /** proposal_id defines the unique id of the proposal. */ proposal_id: string; } export interface MsgSubmitProposalResponseAminoMsg { @@ -66,8 +80,11 @@ export interface MsgSubmitProposalResponseSDKType { } /** MsgVote defines a message to cast a vote. */ export interface MsgVote { + /** proposal_id defines the unique id of the proposal. */ proposalId: bigint; + /** voter is the voter address for the proposal. */ voter: string; + /** option defines the vote option. */ option: VoteOption; } export interface MsgVoteProtoMsg { @@ -76,9 +93,12 @@ export interface MsgVoteProtoMsg { } /** MsgVote defines a message to cast a vote. */ export interface MsgVoteAmino { - proposal_id: string; - voter: string; - option: VoteOption; + /** proposal_id defines the unique id of the proposal. */ + proposal_id?: string; + /** voter is the voter address for the proposal. */ + voter?: string; + /** option defines the vote option. */ + option?: VoteOption; } export interface MsgVoteAminoMsg { type: "cosmos-sdk/MsgVote"; @@ -110,8 +130,11 @@ export interface MsgVoteResponseSDKType {} * Since: cosmos-sdk 0.43 */ export interface MsgVoteWeighted { + /** proposal_id defines the unique id of the proposal. */ proposalId: bigint; + /** voter is the voter address for the proposal. */ voter: string; + /** options defines the weighted vote options. */ options: WeightedVoteOption[]; } export interface MsgVoteWeightedProtoMsg { @@ -124,12 +147,15 @@ export interface MsgVoteWeightedProtoMsg { * Since: cosmos-sdk 0.43 */ export interface MsgVoteWeightedAmino { + /** proposal_id defines the unique id of the proposal. */ proposal_id: string; - voter: string; + /** voter is the voter address for the proposal. */ + voter?: string; + /** options defines the weighted vote options. */ options: WeightedVoteOptionAmino[]; } export interface MsgVoteWeightedAminoMsg { - type: "cosmos-sdk/v1/MsgVoteWeighted"; + type: "cosmos-sdk/MsgVoteWeighted"; value: MsgVoteWeightedAmino; } /** @@ -170,8 +196,11 @@ export interface MsgVoteWeightedResponseAminoMsg { export interface MsgVoteWeightedResponseSDKType {} /** MsgDeposit defines a message to submit a deposit to an existing proposal. */ export interface MsgDeposit { + /** proposal_id defines the unique id of the proposal. */ proposalId: bigint; + /** depositor defines the deposit addresses from the proposals. */ depositor: string; + /** amount to be deposited by depositor. */ amount: Coin[]; } export interface MsgDepositProtoMsg { @@ -180,12 +209,15 @@ export interface MsgDepositProtoMsg { } /** MsgDeposit defines a message to submit a deposit to an existing proposal. */ export interface MsgDepositAmino { + /** proposal_id defines the unique id of the proposal. */ proposal_id: string; - depositor: string; + /** depositor defines the deposit addresses from the proposals. */ + depositor?: string; + /** amount to be deposited by depositor. */ amount: CoinAmino[]; } export interface MsgDepositAminoMsg { - type: "cosmos-sdk/v1/MsgDeposit"; + type: "cosmos-sdk/MsgDeposit"; value: MsgDepositAmino; } /** MsgDeposit defines a message to submit a deposit to an existing proposal. */ @@ -210,10 +242,9 @@ export interface MsgDepositResponseAminoMsg { export interface MsgDepositResponseSDKType {} function createBaseMsgSubmitProposal(): MsgSubmitProposal { return { - content: Any.fromPartial({}), + content: undefined, initialDeposit: [], - proposer: "", - isExpedited: false + proposer: "" }; } export const MsgSubmitProposal = { @@ -228,9 +259,6 @@ export const MsgSubmitProposal = { if (message.proposer !== "") { writer.uint32(26).string(message.proposer); } - if (message.isExpedited === true) { - writer.uint32(32).bool(message.isExpedited); - } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): MsgSubmitProposal { @@ -241,7 +269,7 @@ export const MsgSubmitProposal = { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.content = (Content_InterfaceDecoder(reader) as Any); + message.content = (Cosmos_govv1beta1Content_InterfaceDecoder(reader) as Any); break; case 2: message.initialDeposit.push(Coin.decode(reader, reader.uint32())); @@ -249,9 +277,6 @@ export const MsgSubmitProposal = { case 3: message.proposer = reader.string(); break; - case 4: - message.isExpedited = reader.bool(); - break; default: reader.skipType(tag & 7); break; @@ -264,27 +289,28 @@ export const MsgSubmitProposal = { 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 ?? ""; - message.isExpedited = object.isExpedited ?? false; return message; }, fromAmino(object: MsgSubmitProposalAmino): MsgSubmitProposal { - return { - content: object?.content ? Content_FromAmino(object.content) : undefined, - initialDeposit: Array.isArray(object?.initial_deposit) ? object.initial_deposit.map((e: any) => Coin.fromAmino(e)) : [], - proposer: object.proposer, - isExpedited: object.is_expedited - }; + const message = createBaseMsgSubmitProposal(); + if (object.content !== undefined && object.content !== null) { + message.content = Cosmos_govv1beta1Content_FromAmino(object.content); + } + message.initialDeposit = object.initial_deposit?.map(e => Coin.fromAmino(e)) || []; + if (object.proposer !== undefined && object.proposer !== null) { + message.proposer = object.proposer; + } + return message; }, toAmino(message: MsgSubmitProposal): MsgSubmitProposalAmino { const obj: any = {}; - obj.content = message.content ? Content_ToAmino((message.content as Any)) : undefined; + obj.content = message.content ? Cosmos_govv1beta1Content_ToAmino((message.content as Any)) : undefined; if (message.initialDeposit) { obj.initial_deposit = message.initialDeposit.map(e => e ? Coin.toAmino(e) : undefined); } else { obj.initial_deposit = []; } obj.proposer = message.proposer; - obj.is_expedited = message.isExpedited; return obj; }, fromAminoMsg(object: MsgSubmitProposalAminoMsg): MsgSubmitProposal { @@ -292,7 +318,7 @@ export const MsgSubmitProposal = { }, toAminoMsg(message: MsgSubmitProposal): MsgSubmitProposalAminoMsg { return { - type: "cosmos-sdk/v1/MsgSubmitProposal", + type: "cosmos-sdk/MsgSubmitProposal", value: MsgSubmitProposal.toAmino(message) }; }, @@ -345,13 +371,15 @@ export const MsgSubmitProposalResponse = { return message; }, fromAmino(object: MsgSubmitProposalResponseAmino): MsgSubmitProposalResponse { - return { - proposalId: BigInt(object.proposal_id) - }; + const message = createBaseMsgSubmitProposalResponse(); + if (object.proposal_id !== undefined && object.proposal_id !== null) { + message.proposalId = BigInt(object.proposal_id); + } + return message; }, toAmino(message: MsgSubmitProposalResponse): MsgSubmitProposalResponseAmino { const obj: any = {}; - obj.proposal_id = message.proposalId ? message.proposalId.toString() : undefined; + obj.proposal_id = message.proposalId ? message.proposalId.toString() : "0"; return obj; }, fromAminoMsg(object: MsgSubmitProposalResponseAminoMsg): MsgSubmitProposalResponse { @@ -428,17 +456,23 @@ export const MsgVote = { return message; }, fromAmino(object: MsgVoteAmino): MsgVote { - return { - proposalId: BigInt(object.proposal_id), - voter: object.voter, - option: isSet(object.option) ? voteOptionFromJSON(object.option) : -1 - }; + const message = createBaseMsgVote(); + if (object.proposal_id !== undefined && object.proposal_id !== null) { + message.proposalId = BigInt(object.proposal_id); + } + if (object.voter !== undefined && object.voter !== null) { + message.voter = object.voter; + } + if (object.option !== undefined && object.option !== null) { + message.option = voteOptionFromJSON(object.option); + } + return message; }, toAmino(message: MsgVote): MsgVoteAmino { const obj: any = {}; obj.proposal_id = message.proposalId ? message.proposalId.toString() : undefined; obj.voter = message.voter; - obj.option = message.option; + obj.option = voteOptionToJSON(message.option); return obj; }, fromAminoMsg(object: MsgVoteAminoMsg): MsgVote { @@ -490,7 +524,8 @@ export const MsgVoteResponse = { return message; }, fromAmino(_: MsgVoteResponseAmino): MsgVoteResponse { - return {}; + const message = createBaseMsgVoteResponse(); + return message; }, toAmino(_: MsgVoteResponse): MsgVoteResponseAmino { const obj: any = {}; @@ -570,15 +605,19 @@ export const MsgVoteWeighted = { return message; }, fromAmino(object: MsgVoteWeightedAmino): MsgVoteWeighted { - return { - proposalId: BigInt(object.proposal_id), - voter: object.voter, - options: Array.isArray(object?.options) ? object.options.map((e: any) => WeightedVoteOption.fromAmino(e)) : [] - }; + const message = createBaseMsgVoteWeighted(); + if (object.proposal_id !== undefined && object.proposal_id !== null) { + message.proposalId = BigInt(object.proposal_id); + } + if (object.voter !== undefined && object.voter !== null) { + message.voter = object.voter; + } + message.options = object.options?.map(e => WeightedVoteOption.fromAmino(e)) || []; + return message; }, toAmino(message: MsgVoteWeighted): MsgVoteWeightedAmino { const obj: any = {}; - obj.proposal_id = message.proposalId ? message.proposalId.toString() : undefined; + obj.proposal_id = message.proposalId ? message.proposalId.toString() : "0"; obj.voter = message.voter; if (message.options) { obj.options = message.options.map(e => e ? WeightedVoteOption.toAmino(e) : undefined); @@ -592,7 +631,7 @@ export const MsgVoteWeighted = { }, toAminoMsg(message: MsgVoteWeighted): MsgVoteWeightedAminoMsg { return { - type: "cosmos-sdk/v1/MsgVoteWeighted", + type: "cosmos-sdk/MsgVoteWeighted", value: MsgVoteWeighted.toAmino(message) }; }, @@ -636,7 +675,8 @@ export const MsgVoteWeightedResponse = { return message; }, fromAmino(_: MsgVoteWeightedResponseAmino): MsgVoteWeightedResponse { - return {}; + const message = createBaseMsgVoteWeightedResponse(); + return message; }, toAmino(_: MsgVoteWeightedResponse): MsgVoteWeightedResponseAmino { const obj: any = {}; @@ -716,15 +756,19 @@ export const MsgDeposit = { return message; }, fromAmino(object: MsgDepositAmino): MsgDeposit { - return { - proposalId: BigInt(object.proposal_id), - depositor: object.depositor, - amount: Array.isArray(object?.amount) ? object.amount.map((e: any) => Coin.fromAmino(e)) : [] - }; + const message = createBaseMsgDeposit(); + if (object.proposal_id !== undefined && object.proposal_id !== null) { + message.proposalId = BigInt(object.proposal_id); + } + if (object.depositor !== undefined && object.depositor !== null) { + message.depositor = object.depositor; + } + message.amount = object.amount?.map(e => Coin.fromAmino(e)) || []; + return message; }, toAmino(message: MsgDeposit): MsgDepositAmino { const obj: any = {}; - obj.proposal_id = message.proposalId ? message.proposalId.toString() : undefined; + obj.proposal_id = message.proposalId ? message.proposalId.toString() : "0"; obj.depositor = message.depositor; if (message.amount) { obj.amount = message.amount.map(e => e ? Coin.toAmino(e) : undefined); @@ -738,7 +782,7 @@ export const MsgDeposit = { }, toAminoMsg(message: MsgDeposit): MsgDepositAminoMsg { return { - type: "cosmos-sdk/v1/MsgDeposit", + type: "cosmos-sdk/MsgDeposit", value: MsgDeposit.toAmino(message) }; }, @@ -782,7 +826,8 @@ export const MsgDepositResponse = { return message; }, fromAmino(_: MsgDepositResponseAmino): MsgDepositResponse { - return {}; + const message = createBaseMsgDepositResponse(); + return message; }, toAmino(_: MsgDepositResponse): MsgDepositResponseAmino { const obj: any = {}; @@ -810,33 +855,393 @@ export const MsgDepositResponse = { }; } }; -export const Content_InterfaceDecoder = (input: BinaryReader | Uint8Array): TextProposal | Any => { +export const Cosmos_govv1beta1Content_InterfaceDecoder = (input: BinaryReader | Uint8Array): CommunityPoolSpendProposal | CommunityPoolSpendProposalWithDeposit | TextProposal | SoftwareUpgradeProposal | CancelSoftwareUpgradeProposal | ClientUpdateProposal | UpgradeProposal | StoreCodeProposal | InstantiateContractProposal | InstantiateContract2Proposal | MigrateContractProposal | SudoContractProposal | ExecuteContractProposal | UpdateAdminProposal | ClearAdminProposal | PinCodesProposal | UnpinCodesProposal | UpdateInstantiateConfigProposal | StoreAndInstantiateContractProposal | ReplaceMigrationRecordsProposal | UpdateMigrationRecordsProposal | CreateConcentratedLiquidityPoolsAndLinktoCFMMProposal | SetScalingFactorControllerProposal | ReplacePoolIncentivesProposal | UpdatePoolIncentivesProposal | SetProtoRevEnabledProposal | SetProtoRevAdminAccountProposal | SetSuperfluidAssetsProposal | RemoveSuperfluidAssetsProposal | UpdateUnpoolWhiteListProposal | UpdateFeeTokenProposal | Any => { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - const data = Any.decode(reader, reader.uint32()); + const data = Any.decode(reader, reader.uint32(), true); switch (data.typeUrl) { + case "/cosmos.distribution.v1beta1.CommunityPoolSpendProposal": + return CommunityPoolSpendProposal.decode(data.value, undefined, true); + case "/cosmos.distribution.v1beta1.CommunityPoolSpendProposalWithDeposit": + return CommunityPoolSpendProposalWithDeposit.decode(data.value, undefined, true); case "/cosmos.gov.v1beta1.TextProposal": - return TextProposal.decode(data.value); + return TextProposal.decode(data.value, undefined, true); + case "/cosmos.upgrade.v1beta1.SoftwareUpgradeProposal": + return SoftwareUpgradeProposal.decode(data.value, undefined, true); + case "/cosmos.upgrade.v1beta1.CancelSoftwareUpgradeProposal": + return CancelSoftwareUpgradeProposal.decode(data.value, undefined, true); + case "/ibc.core.client.v1.ClientUpdateProposal": + return ClientUpdateProposal.decode(data.value, undefined, true); + case "/ibc.core.client.v1.UpgradeProposal": + return UpgradeProposal.decode(data.value, undefined, true); + case "/cosmwasm.wasm.v1.StoreCodeProposal": + return StoreCodeProposal.decode(data.value, undefined, true); + case "/cosmwasm.wasm.v1.InstantiateContractProposal": + return InstantiateContractProposal.decode(data.value, undefined, true); + case "/cosmwasm.wasm.v1.InstantiateContract2Proposal": + return InstantiateContract2Proposal.decode(data.value, undefined, true); + case "/cosmwasm.wasm.v1.MigrateContractProposal": + return MigrateContractProposal.decode(data.value, undefined, true); + case "/cosmwasm.wasm.v1.SudoContractProposal": + return SudoContractProposal.decode(data.value, undefined, true); + case "/cosmwasm.wasm.v1.ExecuteContractProposal": + return ExecuteContractProposal.decode(data.value, undefined, true); + case "/cosmwasm.wasm.v1.UpdateAdminProposal": + return UpdateAdminProposal.decode(data.value, undefined, true); + case "/cosmwasm.wasm.v1.ClearAdminProposal": + return ClearAdminProposal.decode(data.value, undefined, true); + case "/cosmwasm.wasm.v1.PinCodesProposal": + return PinCodesProposal.decode(data.value, undefined, true); + case "/cosmwasm.wasm.v1.UnpinCodesProposal": + return UnpinCodesProposal.decode(data.value, undefined, true); + case "/cosmwasm.wasm.v1.UpdateInstantiateConfigProposal": + return UpdateInstantiateConfigProposal.decode(data.value, undefined, true); + case "/cosmwasm.wasm.v1.StoreAndInstantiateContractProposal": + return StoreAndInstantiateContractProposal.decode(data.value, undefined, true); + case "/osmosis.gamm.v1beta1.ReplaceMigrationRecordsProposal": + return ReplaceMigrationRecordsProposal.decode(data.value, undefined, true); + case "/osmosis.gamm.v1beta1.UpdateMigrationRecordsProposal": + return UpdateMigrationRecordsProposal.decode(data.value, undefined, true); + case "/osmosis.gamm.v1beta1.CreateConcentratedLiquidityPoolsAndLinktoCFMMProposal": + return CreateConcentratedLiquidityPoolsAndLinktoCFMMProposal.decode(data.value, undefined, true); + case "/osmosis.gamm.v1beta1.SetScalingFactorControllerProposal": + return SetScalingFactorControllerProposal.decode(data.value, undefined, true); + case "/osmosis.poolincentives.v1beta1.ReplacePoolIncentivesProposal": + return ReplacePoolIncentivesProposal.decode(data.value, undefined, true); + case "/osmosis.poolincentives.v1beta1.UpdatePoolIncentivesProposal": + return UpdatePoolIncentivesProposal.decode(data.value, undefined, true); + case "/osmosis.protorev.v1beta1.SetProtoRevEnabledProposal": + return SetProtoRevEnabledProposal.decode(data.value, undefined, true); + case "/osmosis.protorev.v1beta1.SetProtoRevAdminAccountProposal": + return SetProtoRevAdminAccountProposal.decode(data.value, undefined, true); + case "/osmosis.superfluid.v1beta1.SetSuperfluidAssetsProposal": + return SetSuperfluidAssetsProposal.decode(data.value, undefined, true); + case "/osmosis.superfluid.v1beta1.RemoveSuperfluidAssetsProposal": + return RemoveSuperfluidAssetsProposal.decode(data.value, undefined, true); + case "/osmosis.superfluid.v1beta1.UpdateUnpoolWhiteListProposal": + return UpdateUnpoolWhiteListProposal.decode(data.value, undefined, true); + case "/osmosis.txfees.v1beta1.UpdateFeeTokenProposal": + return UpdateFeeTokenProposal.decode(data.value, undefined, true); default: return data; } }; -export const Content_FromAmino = (content: AnyAmino) => { +export const Cosmos_govv1beta1Content_FromAmino = (content: AnyAmino) => { switch (content.type) { + case "cosmos-sdk/CommunityPoolSpendProposal": + return Any.fromPartial({ + typeUrl: "/cosmos.distribution.v1beta1.CommunityPoolSpendProposal", + value: CommunityPoolSpendProposal.encode(CommunityPoolSpendProposal.fromPartial(CommunityPoolSpendProposal.fromAmino(content.value))).finish() + }); + case "cosmos-sdk/CommunityPoolSpendProposalWithDeposit": + return Any.fromPartial({ + typeUrl: "/cosmos.distribution.v1beta1.CommunityPoolSpendProposalWithDeposit", + value: CommunityPoolSpendProposalWithDeposit.encode(CommunityPoolSpendProposalWithDeposit.fromPartial(CommunityPoolSpendProposalWithDeposit.fromAmino(content.value))).finish() + }); case "cosmos-sdk/TextProposal": return Any.fromPartial({ typeUrl: "/cosmos.gov.v1beta1.TextProposal", value: TextProposal.encode(TextProposal.fromPartial(TextProposal.fromAmino(content.value))).finish() }); + case "cosmos-sdk/SoftwareUpgradeProposal": + return Any.fromPartial({ + typeUrl: "/cosmos.upgrade.v1beta1.SoftwareUpgradeProposal", + value: SoftwareUpgradeProposal.encode(SoftwareUpgradeProposal.fromPartial(SoftwareUpgradeProposal.fromAmino(content.value))).finish() + }); + case "cosmos-sdk/CancelSoftwareUpgradeProposal": + return Any.fromPartial({ + typeUrl: "/cosmos.upgrade.v1beta1.CancelSoftwareUpgradeProposal", + value: CancelSoftwareUpgradeProposal.encode(CancelSoftwareUpgradeProposal.fromPartial(CancelSoftwareUpgradeProposal.fromAmino(content.value))).finish() + }); + case "cosmos-sdk/ClientUpdateProposal": + return Any.fromPartial({ + typeUrl: "/ibc.core.client.v1.ClientUpdateProposal", + value: ClientUpdateProposal.encode(ClientUpdateProposal.fromPartial(ClientUpdateProposal.fromAmino(content.value))).finish() + }); + case "cosmos-sdk/UpgradeProposal": + return Any.fromPartial({ + typeUrl: "/ibc.core.client.v1.UpgradeProposal", + value: UpgradeProposal.encode(UpgradeProposal.fromPartial(UpgradeProposal.fromAmino(content.value))).finish() + }); + case "wasm/StoreCodeProposal": + return Any.fromPartial({ + typeUrl: "/cosmwasm.wasm.v1.StoreCodeProposal", + value: StoreCodeProposal.encode(StoreCodeProposal.fromPartial(StoreCodeProposal.fromAmino(content.value))).finish() + }); + case "wasm/InstantiateContractProposal": + return Any.fromPartial({ + typeUrl: "/cosmwasm.wasm.v1.InstantiateContractProposal", + value: InstantiateContractProposal.encode(InstantiateContractProposal.fromPartial(InstantiateContractProposal.fromAmino(content.value))).finish() + }); + case "wasm/InstantiateContract2Proposal": + return Any.fromPartial({ + typeUrl: "/cosmwasm.wasm.v1.InstantiateContract2Proposal", + value: InstantiateContract2Proposal.encode(InstantiateContract2Proposal.fromPartial(InstantiateContract2Proposal.fromAmino(content.value))).finish() + }); + case "wasm/MigrateContractProposal": + return Any.fromPartial({ + typeUrl: "/cosmwasm.wasm.v1.MigrateContractProposal", + value: MigrateContractProposal.encode(MigrateContractProposal.fromPartial(MigrateContractProposal.fromAmino(content.value))).finish() + }); + case "wasm/SudoContractProposal": + return Any.fromPartial({ + typeUrl: "/cosmwasm.wasm.v1.SudoContractProposal", + value: SudoContractProposal.encode(SudoContractProposal.fromPartial(SudoContractProposal.fromAmino(content.value))).finish() + }); + case "wasm/ExecuteContractProposal": + return Any.fromPartial({ + typeUrl: "/cosmwasm.wasm.v1.ExecuteContractProposal", + value: ExecuteContractProposal.encode(ExecuteContractProposal.fromPartial(ExecuteContractProposal.fromAmino(content.value))).finish() + }); + case "wasm/UpdateAdminProposal": + return Any.fromPartial({ + typeUrl: "/cosmwasm.wasm.v1.UpdateAdminProposal", + value: UpdateAdminProposal.encode(UpdateAdminProposal.fromPartial(UpdateAdminProposal.fromAmino(content.value))).finish() + }); + case "wasm/ClearAdminProposal": + return Any.fromPartial({ + typeUrl: "/cosmwasm.wasm.v1.ClearAdminProposal", + value: ClearAdminProposal.encode(ClearAdminProposal.fromPartial(ClearAdminProposal.fromAmino(content.value))).finish() + }); + case "wasm/PinCodesProposal": + return Any.fromPartial({ + typeUrl: "/cosmwasm.wasm.v1.PinCodesProposal", + value: PinCodesProposal.encode(PinCodesProposal.fromPartial(PinCodesProposal.fromAmino(content.value))).finish() + }); + case "wasm/UnpinCodesProposal": + return Any.fromPartial({ + typeUrl: "/cosmwasm.wasm.v1.UnpinCodesProposal", + value: UnpinCodesProposal.encode(UnpinCodesProposal.fromPartial(UnpinCodesProposal.fromAmino(content.value))).finish() + }); + case "wasm/UpdateInstantiateConfigProposal": + return Any.fromPartial({ + typeUrl: "/cosmwasm.wasm.v1.UpdateInstantiateConfigProposal", + value: UpdateInstantiateConfigProposal.encode(UpdateInstantiateConfigProposal.fromPartial(UpdateInstantiateConfigProposal.fromAmino(content.value))).finish() + }); + case "wasm/StoreAndInstantiateContractProposal": + return Any.fromPartial({ + typeUrl: "/cosmwasm.wasm.v1.StoreAndInstantiateContractProposal", + value: StoreAndInstantiateContractProposal.encode(StoreAndInstantiateContractProposal.fromPartial(StoreAndInstantiateContractProposal.fromAmino(content.value))).finish() + }); + case "osmosis/ReplaceMigrationRecordsProposal": + return Any.fromPartial({ + typeUrl: "/osmosis.gamm.v1beta1.ReplaceMigrationRecordsProposal", + value: ReplaceMigrationRecordsProposal.encode(ReplaceMigrationRecordsProposal.fromPartial(ReplaceMigrationRecordsProposal.fromAmino(content.value))).finish() + }); + case "osmosis/UpdateMigrationRecordsProposal": + return Any.fromPartial({ + typeUrl: "/osmosis.gamm.v1beta1.UpdateMigrationRecordsProposal", + value: UpdateMigrationRecordsProposal.encode(UpdateMigrationRecordsProposal.fromPartial(UpdateMigrationRecordsProposal.fromAmino(content.value))).finish() + }); + case "osmosis/CreateConcentratedLiquidityPoolsAndLinktoCFMMProposal": + return Any.fromPartial({ + typeUrl: "/osmosis.gamm.v1beta1.CreateConcentratedLiquidityPoolsAndLinktoCFMMProposal", + value: CreateConcentratedLiquidityPoolsAndLinktoCFMMProposal.encode(CreateConcentratedLiquidityPoolsAndLinktoCFMMProposal.fromPartial(CreateConcentratedLiquidityPoolsAndLinktoCFMMProposal.fromAmino(content.value))).finish() + }); + case "osmosis/SetScalingFactorControllerProposal": + return Any.fromPartial({ + typeUrl: "/osmosis.gamm.v1beta1.SetScalingFactorControllerProposal", + value: SetScalingFactorControllerProposal.encode(SetScalingFactorControllerProposal.fromPartial(SetScalingFactorControllerProposal.fromAmino(content.value))).finish() + }); + case "osmosis/ReplacePoolIncentivesProposal": + return Any.fromPartial({ + typeUrl: "/osmosis.poolincentives.v1beta1.ReplacePoolIncentivesProposal", + value: ReplacePoolIncentivesProposal.encode(ReplacePoolIncentivesProposal.fromPartial(ReplacePoolIncentivesProposal.fromAmino(content.value))).finish() + }); + case "osmosis/UpdatePoolIncentivesProposal": + return Any.fromPartial({ + typeUrl: "/osmosis.poolincentives.v1beta1.UpdatePoolIncentivesProposal", + value: UpdatePoolIncentivesProposal.encode(UpdatePoolIncentivesProposal.fromPartial(UpdatePoolIncentivesProposal.fromAmino(content.value))).finish() + }); + case "osmosis/SetProtoRevEnabledProposal": + return Any.fromPartial({ + typeUrl: "/osmosis.protorev.v1beta1.SetProtoRevEnabledProposal", + value: SetProtoRevEnabledProposal.encode(SetProtoRevEnabledProposal.fromPartial(SetProtoRevEnabledProposal.fromAmino(content.value))).finish() + }); + case "osmosis/SetProtoRevAdminAccountProposal": + return Any.fromPartial({ + typeUrl: "/osmosis.protorev.v1beta1.SetProtoRevAdminAccountProposal", + value: SetProtoRevAdminAccountProposal.encode(SetProtoRevAdminAccountProposal.fromPartial(SetProtoRevAdminAccountProposal.fromAmino(content.value))).finish() + }); + case "osmosis/set-superfluid-assets-proposal": + return Any.fromPartial({ + typeUrl: "/osmosis.superfluid.v1beta1.SetSuperfluidAssetsProposal", + value: SetSuperfluidAssetsProposal.encode(SetSuperfluidAssetsProposal.fromPartial(SetSuperfluidAssetsProposal.fromAmino(content.value))).finish() + }); + case "osmosis/del-superfluid-assets-proposal": + return Any.fromPartial({ + typeUrl: "/osmosis.superfluid.v1beta1.RemoveSuperfluidAssetsProposal", + value: RemoveSuperfluidAssetsProposal.encode(RemoveSuperfluidAssetsProposal.fromPartial(RemoveSuperfluidAssetsProposal.fromAmino(content.value))).finish() + }); + case "osmosis/update-unpool-whitelist": + return Any.fromPartial({ + typeUrl: "/osmosis.superfluid.v1beta1.UpdateUnpoolWhiteListProposal", + value: UpdateUnpoolWhiteListProposal.encode(UpdateUnpoolWhiteListProposal.fromPartial(UpdateUnpoolWhiteListProposal.fromAmino(content.value))).finish() + }); + case "osmosis/UpdateFeeTokenProposal": + return Any.fromPartial({ + typeUrl: "/osmosis.txfees.v1beta1.UpdateFeeTokenProposal", + value: UpdateFeeTokenProposal.encode(UpdateFeeTokenProposal.fromPartial(UpdateFeeTokenProposal.fromAmino(content.value))).finish() + }); default: return Any.fromAmino(content); } }; -export const Content_ToAmino = (content: Any) => { +export const Cosmos_govv1beta1Content_ToAmino = (content: Any) => { switch (content.typeUrl) { + case "/cosmos.distribution.v1beta1.CommunityPoolSpendProposal": + return { + type: "cosmos-sdk/CommunityPoolSpendProposal", + value: CommunityPoolSpendProposal.toAmino(CommunityPoolSpendProposal.decode(content.value, undefined)) + }; + case "/cosmos.distribution.v1beta1.CommunityPoolSpendProposalWithDeposit": + return { + type: "cosmos-sdk/CommunityPoolSpendProposalWithDeposit", + value: CommunityPoolSpendProposalWithDeposit.toAmino(CommunityPoolSpendProposalWithDeposit.decode(content.value, undefined)) + }; case "/cosmos.gov.v1beta1.TextProposal": return { type: "cosmos-sdk/TextProposal", - value: TextProposal.toAmino(TextProposal.decode(content.value)) + value: TextProposal.toAmino(TextProposal.decode(content.value, undefined)) + }; + case "/cosmos.upgrade.v1beta1.SoftwareUpgradeProposal": + return { + type: "cosmos-sdk/SoftwareUpgradeProposal", + value: SoftwareUpgradeProposal.toAmino(SoftwareUpgradeProposal.decode(content.value, undefined)) + }; + case "/cosmos.upgrade.v1beta1.CancelSoftwareUpgradeProposal": + return { + type: "cosmos-sdk/CancelSoftwareUpgradeProposal", + value: CancelSoftwareUpgradeProposal.toAmino(CancelSoftwareUpgradeProposal.decode(content.value, undefined)) + }; + case "/ibc.core.client.v1.ClientUpdateProposal": + return { + type: "cosmos-sdk/ClientUpdateProposal", + value: ClientUpdateProposal.toAmino(ClientUpdateProposal.decode(content.value, undefined)) + }; + case "/ibc.core.client.v1.UpgradeProposal": + return { + type: "cosmos-sdk/UpgradeProposal", + value: UpgradeProposal.toAmino(UpgradeProposal.decode(content.value, undefined)) + }; + case "/cosmwasm.wasm.v1.StoreCodeProposal": + return { + type: "wasm/StoreCodeProposal", + value: StoreCodeProposal.toAmino(StoreCodeProposal.decode(content.value, undefined)) + }; + case "/cosmwasm.wasm.v1.InstantiateContractProposal": + return { + type: "wasm/InstantiateContractProposal", + value: InstantiateContractProposal.toAmino(InstantiateContractProposal.decode(content.value, undefined)) + }; + case "/cosmwasm.wasm.v1.InstantiateContract2Proposal": + return { + type: "wasm/InstantiateContract2Proposal", + value: InstantiateContract2Proposal.toAmino(InstantiateContract2Proposal.decode(content.value, undefined)) + }; + case "/cosmwasm.wasm.v1.MigrateContractProposal": + return { + type: "wasm/MigrateContractProposal", + value: MigrateContractProposal.toAmino(MigrateContractProposal.decode(content.value, undefined)) + }; + case "/cosmwasm.wasm.v1.SudoContractProposal": + return { + type: "wasm/SudoContractProposal", + value: SudoContractProposal.toAmino(SudoContractProposal.decode(content.value, undefined)) + }; + case "/cosmwasm.wasm.v1.ExecuteContractProposal": + return { + type: "wasm/ExecuteContractProposal", + value: ExecuteContractProposal.toAmino(ExecuteContractProposal.decode(content.value, undefined)) + }; + case "/cosmwasm.wasm.v1.UpdateAdminProposal": + return { + type: "wasm/UpdateAdminProposal", + value: UpdateAdminProposal.toAmino(UpdateAdminProposal.decode(content.value, undefined)) + }; + case "/cosmwasm.wasm.v1.ClearAdminProposal": + return { + type: "wasm/ClearAdminProposal", + value: ClearAdminProposal.toAmino(ClearAdminProposal.decode(content.value, undefined)) + }; + case "/cosmwasm.wasm.v1.PinCodesProposal": + return { + type: "wasm/PinCodesProposal", + value: PinCodesProposal.toAmino(PinCodesProposal.decode(content.value, undefined)) + }; + case "/cosmwasm.wasm.v1.UnpinCodesProposal": + return { + type: "wasm/UnpinCodesProposal", + value: UnpinCodesProposal.toAmino(UnpinCodesProposal.decode(content.value, undefined)) + }; + case "/cosmwasm.wasm.v1.UpdateInstantiateConfigProposal": + return { + type: "wasm/UpdateInstantiateConfigProposal", + value: UpdateInstantiateConfigProposal.toAmino(UpdateInstantiateConfigProposal.decode(content.value, undefined)) + }; + case "/cosmwasm.wasm.v1.StoreAndInstantiateContractProposal": + return { + type: "wasm/StoreAndInstantiateContractProposal", + value: StoreAndInstantiateContractProposal.toAmino(StoreAndInstantiateContractProposal.decode(content.value, undefined)) + }; + case "/osmosis.gamm.v1beta1.ReplaceMigrationRecordsProposal": + return { + type: "osmosis/ReplaceMigrationRecordsProposal", + value: ReplaceMigrationRecordsProposal.toAmino(ReplaceMigrationRecordsProposal.decode(content.value, undefined)) + }; + case "/osmosis.gamm.v1beta1.UpdateMigrationRecordsProposal": + return { + type: "osmosis/UpdateMigrationRecordsProposal", + value: UpdateMigrationRecordsProposal.toAmino(UpdateMigrationRecordsProposal.decode(content.value, undefined)) + }; + case "/osmosis.gamm.v1beta1.CreateConcentratedLiquidityPoolsAndLinktoCFMMProposal": + return { + type: "osmosis/CreateConcentratedLiquidityPoolsAndLinktoCFMMProposal", + value: CreateConcentratedLiquidityPoolsAndLinktoCFMMProposal.toAmino(CreateConcentratedLiquidityPoolsAndLinktoCFMMProposal.decode(content.value, undefined)) + }; + case "/osmosis.gamm.v1beta1.SetScalingFactorControllerProposal": + return { + type: "osmosis/SetScalingFactorControllerProposal", + value: SetScalingFactorControllerProposal.toAmino(SetScalingFactorControllerProposal.decode(content.value, undefined)) + }; + case "/osmosis.poolincentives.v1beta1.ReplacePoolIncentivesProposal": + return { + type: "osmosis/ReplacePoolIncentivesProposal", + value: ReplacePoolIncentivesProposal.toAmino(ReplacePoolIncentivesProposal.decode(content.value, undefined)) + }; + case "/osmosis.poolincentives.v1beta1.UpdatePoolIncentivesProposal": + return { + type: "osmosis/UpdatePoolIncentivesProposal", + value: UpdatePoolIncentivesProposal.toAmino(UpdatePoolIncentivesProposal.decode(content.value, undefined)) + }; + case "/osmosis.protorev.v1beta1.SetProtoRevEnabledProposal": + return { + type: "osmosis/SetProtoRevEnabledProposal", + value: SetProtoRevEnabledProposal.toAmino(SetProtoRevEnabledProposal.decode(content.value, undefined)) + }; + case "/osmosis.protorev.v1beta1.SetProtoRevAdminAccountProposal": + return { + type: "osmosis/SetProtoRevAdminAccountProposal", + value: SetProtoRevAdminAccountProposal.toAmino(SetProtoRevAdminAccountProposal.decode(content.value, undefined)) + }; + case "/osmosis.superfluid.v1beta1.SetSuperfluidAssetsProposal": + return { + type: "osmosis/set-superfluid-assets-proposal", + value: SetSuperfluidAssetsProposal.toAmino(SetSuperfluidAssetsProposal.decode(content.value, undefined)) + }; + case "/osmosis.superfluid.v1beta1.RemoveSuperfluidAssetsProposal": + return { + type: "osmosis/del-superfluid-assets-proposal", + value: RemoveSuperfluidAssetsProposal.toAmino(RemoveSuperfluidAssetsProposal.decode(content.value, undefined)) + }; + case "/osmosis.superfluid.v1beta1.UpdateUnpoolWhiteListProposal": + return { + type: "osmosis/update-unpool-whitelist", + value: UpdateUnpoolWhiteListProposal.toAmino(UpdateUnpoolWhiteListProposal.decode(content.value, undefined)) + }; + case "/osmosis.txfees.v1beta1.UpdateFeeTokenProposal": + return { + type: "osmosis/UpdateFeeTokenProposal", + value: UpdateFeeTokenProposal.toAmino(UpdateFeeTokenProposal.decode(content.value, undefined)) }; default: return Any.toAmino(content); diff --git a/packages/osmo-query/src/codegen/cosmos/ics23/v1/proofs.ts b/packages/osmo-query/src/codegen/cosmos/ics23/v1/proofs.ts index b9babf701..2a4b6c254 100644 --- a/packages/osmo-query/src/codegen/cosmos/ics23/v1/proofs.ts +++ b/packages/osmo-query/src/codegen/cosmos/ics23/v1/proofs.ts @@ -1,15 +1,18 @@ import { BinaryReader, BinaryWriter } from "../../../binary"; -import { isSet } from "../../../helpers"; +import { bytesFromBase64, base64FromBytes } from "../../../helpers"; export enum HashOp { /** NO_HASH - NO_HASH is the default if no data passed. Note this is an illegal argument some places. */ NO_HASH = 0, SHA256 = 1, SHA512 = 2, - KECCAK = 3, + KECCAK256 = 3, RIPEMD160 = 4, /** BITCOIN - ripemd160(sha256(x)) */ BITCOIN = 5, SHA512_256 = 6, + BLAKE2B_512 = 7, + BLAKE2S_256 = 8, + BLAKE3 = 9, UNRECOGNIZED = -1, } export const HashOpSDKType = HashOp; @@ -26,8 +29,8 @@ export function hashOpFromJSON(object: any): HashOp { case "SHA512": return HashOp.SHA512; case 3: - case "KECCAK": - return HashOp.KECCAK; + case "KECCAK256": + return HashOp.KECCAK256; case 4: case "RIPEMD160": return HashOp.RIPEMD160; @@ -37,6 +40,15 @@ export function hashOpFromJSON(object: any): HashOp { case 6: case "SHA512_256": return HashOp.SHA512_256; + case 7: + case "BLAKE2B_512": + return HashOp.BLAKE2B_512; + case 8: + case "BLAKE2S_256": + return HashOp.BLAKE2S_256; + case 9: + case "BLAKE3": + return HashOp.BLAKE3; case -1: case "UNRECOGNIZED": default: @@ -51,14 +63,20 @@ export function hashOpToJSON(object: HashOp): string { return "SHA256"; case HashOp.SHA512: return "SHA512"; - case HashOp.KECCAK: - return "KECCAK"; + case HashOp.KECCAK256: + return "KECCAK256"; case HashOp.RIPEMD160: return "RIPEMD160"; case HashOp.BITCOIN: return "BITCOIN"; case HashOp.SHA512_256: return "SHA512_256"; + case HashOp.BLAKE2B_512: + return "BLAKE2B_512"; + case HashOp.BLAKE2S_256: + return "BLAKE2S_256"; + case HashOp.BLAKE3: + return "BLAKE3"; case HashOp.UNRECOGNIZED: default: return "UNRECOGNIZED"; @@ -177,7 +195,7 @@ export function lengthOpToJSON(object: LengthOp): string { export interface ExistenceProof { key: Uint8Array; value: Uint8Array; - leaf: LeafOp; + leaf?: LeafOp; path: InnerOp[]; } export interface ExistenceProofProtoMsg { @@ -206,10 +224,10 @@ export interface ExistenceProofProtoMsg { * length-prefix the data before hashing it. */ export interface ExistenceProofAmino { - key: Uint8Array; - value: Uint8Array; + key?: string; + value?: string; leaf?: LeafOpAmino; - path: InnerOpAmino[]; + path?: InnerOpAmino[]; } export interface ExistenceProofAminoMsg { type: "cosmos-sdk/ExistenceProof"; @@ -239,7 +257,7 @@ export interface ExistenceProofAminoMsg { export interface ExistenceProofSDKType { key: Uint8Array; value: Uint8Array; - leaf: LeafOpSDKType; + leaf?: LeafOpSDKType; path: InnerOpSDKType[]; } /** @@ -250,8 +268,8 @@ export interface ExistenceProofSDKType { export interface NonExistenceProof { /** TODO: remove this as unnecessary??? we prove a range */ key: Uint8Array; - left: ExistenceProof; - right: ExistenceProof; + left?: ExistenceProof; + right?: ExistenceProof; } export interface NonExistenceProofProtoMsg { typeUrl: "/cosmos.ics23.v1.NonExistenceProof"; @@ -264,7 +282,7 @@ export interface NonExistenceProofProtoMsg { */ export interface NonExistenceProofAmino { /** TODO: remove this as unnecessary??? we prove a range */ - key: Uint8Array; + key?: string; left?: ExistenceProofAmino; right?: ExistenceProofAmino; } @@ -279,8 +297,8 @@ export interface NonExistenceProofAminoMsg { */ export interface NonExistenceProofSDKType { key: Uint8Array; - left: ExistenceProofSDKType; - right: ExistenceProofSDKType; + left?: ExistenceProofSDKType; + right?: ExistenceProofSDKType; } /** CommitmentProof is either an ExistenceProof or a NonExistenceProof, or a Batch of such messages */ export interface CommitmentProof { @@ -359,15 +377,15 @@ export interface LeafOpProtoMsg { * output = hash(prefix || length(hkey) || hkey || length(hvalue) || hvalue) */ export interface LeafOpAmino { - hash: HashOp; - prehash_key: HashOp; - prehash_value: HashOp; - length: LengthOp; + hash?: HashOp; + prehash_key?: HashOp; + prehash_value?: 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?: string; } export interface LeafOpAminoMsg { type: "cosmos-sdk/LeafOp"; @@ -440,9 +458,9 @@ export interface InnerOpProtoMsg { * If either of prefix or suffix is empty, we just treat it as an empty string */ export interface InnerOpAmino { - hash: HashOp; - prefix: Uint8Array; - suffix: Uint8Array; + hash?: HashOp; + prefix?: string; + suffix?: string; } export interface InnerOpAminoMsg { type: "cosmos-sdk/InnerOp"; @@ -487,12 +505,18 @@ 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; /** min_depth (if > 0) is the minimum number of InnerOps allowed (mainly for fixed-depth tries) */ minDepth: number; + /** + * prehash_key_before_comparison is a flag that indicates whether to use the + * prehash_key specified by LeafOp to compare lexical ordering of keys for + * non-existence proofs. + */ + prehashKeyBeforeComparison: boolean; } export interface ProofSpecProtoMsg { typeUrl: "/cosmos.ics23.v1.ProofSpec"; @@ -518,9 +542,15 @@ export interface ProofSpecAmino { leaf_spec?: LeafOpAmino; inner_spec?: InnerSpecAmino; /** max_depth (if > 0) is the maximum number of InnerOps allowed (mainly for fixed-depth tries) */ - max_depth: number; + max_depth?: number; /** min_depth (if > 0) is the minimum number of InnerOps allowed (mainly for fixed-depth tries) */ - min_depth: number; + min_depth?: number; + /** + * prehash_key_before_comparison is a flag that indicates whether to use the + * prehash_key specified by LeafOp to compare lexical ordering of keys for + * non-existence proofs. + */ + prehash_key_before_comparison?: boolean; } export interface ProofSpecAminoMsg { type: "cosmos-sdk/ProofSpec"; @@ -539,10 +569,11 @@ export interface ProofSpecAminoMsg { * tree format server uses. But not in code, rather a configuration object. */ export interface ProofSpecSDKType { - leaf_spec: LeafOpSDKType; - inner_spec: InnerSpecSDKType; + leaf_spec?: LeafOpSDKType; + inner_spec?: InnerSpecSDKType; max_depth: number; min_depth: number; + prehash_key_before_comparison: boolean; } /** * InnerSpec contains all store-specific structure info to determine if two proofs from a @@ -589,14 +620,14 @@ export interface InnerSpecAmino { * iavl tree is [0, 1] (left then right) * merk is [0, 2, 1] (left, right, here) */ - child_order: number[]; - child_size: number; - min_prefix_length: number; - max_prefix_length: number; + child_order?: number[]; + child_size?: number; + min_prefix_length?: number; + max_prefix_length?: number; /** empty child is the prehash image that is used when one child is nil (eg. 20 bytes of 0) */ - empty_child: Uint8Array; + empty_child?: string; /** hash is the algorithm that must be used for each InnerOp */ - hash: HashOp; + hash?: HashOp; } export interface InnerSpecAminoMsg { type: "cosmos-sdk/InnerSpec"; @@ -630,7 +661,7 @@ export interface BatchProofProtoMsg { } /** BatchProof is a group of multiple proof types than can be compressed */ export interface BatchProofAmino { - entries: BatchEntryAmino[]; + entries?: BatchEntryAmino[]; } export interface BatchProofAminoMsg { type: "cosmos-sdk/BatchProof"; @@ -672,8 +703,8 @@ export interface CompressedBatchProofProtoMsg { value: Uint8Array; } export interface CompressedBatchProofAmino { - entries: CompressedBatchEntryAmino[]; - lookup_inners: InnerOpAmino[]; + entries?: CompressedBatchEntryAmino[]; + lookup_inners?: InnerOpAmino[]; } export interface CompressedBatchProofAminoMsg { type: "cosmos-sdk/CompressedBatchProof"; @@ -709,7 +740,7 @@ export interface CompressedBatchEntrySDKType { export interface CompressedExistenceProof { key: Uint8Array; value: Uint8Array; - leaf: LeafOp; + leaf?: LeafOp; /** these are indexes into the lookup_inners table in CompressedBatchProof */ path: number[]; } @@ -718,11 +749,11 @@ export interface CompressedExistenceProofProtoMsg { value: Uint8Array; } export interface CompressedExistenceProofAmino { - key: Uint8Array; - value: Uint8Array; + key?: string; + value?: string; leaf?: LeafOpAmino; /** these are indexes into the lookup_inners table in CompressedBatchProof */ - path: number[]; + path?: number[]; } export interface CompressedExistenceProofAminoMsg { type: "cosmos-sdk/CompressedExistenceProof"; @@ -731,14 +762,14 @@ export interface CompressedExistenceProofAminoMsg { export interface CompressedExistenceProofSDKType { key: Uint8Array; value: Uint8Array; - leaf: LeafOpSDKType; + leaf?: LeafOpSDKType; path: number[]; } export interface CompressedNonExistenceProof { /** TODO: remove this as unnecessary??? we prove a range */ key: Uint8Array; - left: CompressedExistenceProof; - right: CompressedExistenceProof; + left?: CompressedExistenceProof; + right?: CompressedExistenceProof; } export interface CompressedNonExistenceProofProtoMsg { typeUrl: "/cosmos.ics23.v1.CompressedNonExistenceProof"; @@ -746,7 +777,7 @@ export interface CompressedNonExistenceProofProtoMsg { } export interface CompressedNonExistenceProofAmino { /** TODO: remove this as unnecessary??? we prove a range */ - key: Uint8Array; + key?: string; left?: CompressedExistenceProofAmino; right?: CompressedExistenceProofAmino; } @@ -756,14 +787,14 @@ export interface CompressedNonExistenceProofAminoMsg { } export interface CompressedNonExistenceProofSDKType { key: Uint8Array; - left: CompressedExistenceProofSDKType; - right: CompressedExistenceProofSDKType; + left?: CompressedExistenceProofSDKType; + right?: CompressedExistenceProofSDKType; } function createBaseExistenceProof(): ExistenceProof { return { key: new Uint8Array(), value: new Uint8Array(), - leaf: LeafOp.fromPartial({}), + leaf: undefined, path: [] }; } @@ -819,17 +850,23 @@ export const ExistenceProof = { return message; }, fromAmino(object: ExistenceProofAmino): ExistenceProof { - return { - key: object.key, - value: object.value, - leaf: object?.leaf ? LeafOp.fromAmino(object.leaf) : undefined, - path: Array.isArray(object?.path) ? object.path.map((e: any) => InnerOp.fromAmino(e)) : [] - }; + const message = createBaseExistenceProof(); + if (object.key !== undefined && object.key !== null) { + message.key = bytesFromBase64(object.key); + } + if (object.value !== undefined && object.value !== null) { + message.value = bytesFromBase64(object.value); + } + if (object.leaf !== undefined && object.leaf !== null) { + message.leaf = LeafOp.fromAmino(object.leaf); + } + message.path = object.path?.map(e => InnerOp.fromAmino(e)) || []; + return message; }, toAmino(message: ExistenceProof): ExistenceProofAmino { const obj: any = {}; - obj.key = message.key; - obj.value = message.value; + obj.key = message.key ? base64FromBytes(message.key) : undefined; + obj.value = message.value ? base64FromBytes(message.value) : undefined; obj.leaf = message.leaf ? LeafOp.toAmino(message.leaf) : undefined; if (message.path) { obj.path = message.path.map(e => e ? InnerOp.toAmino(e) : undefined); @@ -863,8 +900,8 @@ export const ExistenceProof = { function createBaseNonExistenceProof(): NonExistenceProof { return { key: new Uint8Array(), - left: ExistenceProof.fromPartial({}), - right: ExistenceProof.fromPartial({}) + left: undefined, + right: undefined }; } export const NonExistenceProof = { @@ -912,15 +949,21 @@ export const NonExistenceProof = { return message; }, fromAmino(object: NonExistenceProofAmino): NonExistenceProof { - return { - key: object.key, - left: object?.left ? ExistenceProof.fromAmino(object.left) : undefined, - right: object?.right ? ExistenceProof.fromAmino(object.right) : undefined - }; + const message = createBaseNonExistenceProof(); + if (object.key !== undefined && object.key !== null) { + message.key = bytesFromBase64(object.key); + } + if (object.left !== undefined && object.left !== null) { + message.left = ExistenceProof.fromAmino(object.left); + } + if (object.right !== undefined && object.right !== null) { + message.right = ExistenceProof.fromAmino(object.right); + } + return message; }, toAmino(message: NonExistenceProof): NonExistenceProofAmino { const obj: any = {}; - obj.key = message.key; + obj.key = message.key ? base64FromBytes(message.key) : undefined; obj.left = message.left ? ExistenceProof.toAmino(message.left) : undefined; obj.right = message.right ? ExistenceProof.toAmino(message.right) : undefined; return obj; @@ -1007,12 +1050,20 @@ export const CommitmentProof = { return message; }, fromAmino(object: CommitmentProofAmino): CommitmentProof { - return { - exist: object?.exist ? ExistenceProof.fromAmino(object.exist) : undefined, - nonexist: object?.nonexist ? NonExistenceProof.fromAmino(object.nonexist) : undefined, - batch: object?.batch ? BatchProof.fromAmino(object.batch) : undefined, - compressed: object?.compressed ? CompressedBatchProof.fromAmino(object.compressed) : undefined - }; + const message = createBaseCommitmentProof(); + if (object.exist !== undefined && object.exist !== null) { + message.exist = ExistenceProof.fromAmino(object.exist); + } + if (object.nonexist !== undefined && object.nonexist !== null) { + message.nonexist = NonExistenceProof.fromAmino(object.nonexist); + } + if (object.batch !== undefined && object.batch !== null) { + message.batch = BatchProof.fromAmino(object.batch); + } + if (object.compressed !== undefined && object.compressed !== null) { + message.compressed = CompressedBatchProof.fromAmino(object.compressed); + } + return message; }, toAmino(message: CommitmentProof): CommitmentProofAmino { const obj: any = {}; @@ -1112,21 +1163,31 @@ export const LeafOp = { return message; }, fromAmino(object: LeafOpAmino): LeafOp { - return { - hash: isSet(object.hash) ? hashOpFromJSON(object.hash) : -1, - prehashKey: isSet(object.prehash_key) ? hashOpFromJSON(object.prehash_key) : -1, - prehashValue: isSet(object.prehash_value) ? hashOpFromJSON(object.prehash_value) : -1, - length: isSet(object.length) ? lengthOpFromJSON(object.length) : -1, - prefix: object.prefix - }; + const message = createBaseLeafOp(); + if (object.hash !== undefined && object.hash !== null) { + message.hash = hashOpFromJSON(object.hash); + } + if (object.prehash_key !== undefined && object.prehash_key !== null) { + message.prehashKey = hashOpFromJSON(object.prehash_key); + } + if (object.prehash_value !== undefined && object.prehash_value !== null) { + message.prehashValue = hashOpFromJSON(object.prehash_value); + } + if (object.length !== undefined && object.length !== null) { + message.length = lengthOpFromJSON(object.length); + } + if (object.prefix !== undefined && object.prefix !== null) { + message.prefix = bytesFromBase64(object.prefix); + } + return message; }, toAmino(message: LeafOp): LeafOpAmino { const obj: any = {}; - obj.hash = message.hash; - obj.prehash_key = message.prehashKey; - obj.prehash_value = message.prehashValue; - obj.length = message.length; - obj.prefix = message.prefix; + obj.hash = hashOpToJSON(message.hash); + obj.prehash_key = hashOpToJSON(message.prehashKey); + obj.prehash_value = hashOpToJSON(message.prehashValue); + obj.length = lengthOpToJSON(message.length); + obj.prefix = message.prefix ? base64FromBytes(message.prefix) : undefined; return obj; }, fromAminoMsg(object: LeafOpAminoMsg): LeafOp { @@ -1203,17 +1264,23 @@ export const InnerOp = { return message; }, fromAmino(object: InnerOpAmino): InnerOp { - return { - hash: isSet(object.hash) ? hashOpFromJSON(object.hash) : -1, - prefix: object.prefix, - suffix: object.suffix - }; + const message = createBaseInnerOp(); + if (object.hash !== undefined && object.hash !== null) { + message.hash = hashOpFromJSON(object.hash); + } + if (object.prefix !== undefined && object.prefix !== null) { + message.prefix = bytesFromBase64(object.prefix); + } + if (object.suffix !== undefined && object.suffix !== null) { + message.suffix = bytesFromBase64(object.suffix); + } + return message; }, toAmino(message: InnerOp): InnerOpAmino { const obj: any = {}; - obj.hash = message.hash; - obj.prefix = message.prefix; - obj.suffix = message.suffix; + obj.hash = hashOpToJSON(message.hash); + obj.prefix = message.prefix ? base64FromBytes(message.prefix) : undefined; + obj.suffix = message.suffix ? base64FromBytes(message.suffix) : undefined; return obj; }, fromAminoMsg(object: InnerOpAminoMsg): InnerOp { @@ -1240,10 +1307,11 @@ export const InnerOp = { }; function createBaseProofSpec(): ProofSpec { return { - leafSpec: LeafOp.fromPartial({}), - innerSpec: InnerSpec.fromPartial({}), + leafSpec: undefined, + innerSpec: undefined, maxDepth: 0, - minDepth: 0 + minDepth: 0, + prehashKeyBeforeComparison: false }; } export const ProofSpec = { @@ -1261,6 +1329,9 @@ export const ProofSpec = { if (message.minDepth !== 0) { writer.uint32(32).int32(message.minDepth); } + if (message.prehashKeyBeforeComparison === true) { + writer.uint32(40).bool(message.prehashKeyBeforeComparison); + } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): ProofSpec { @@ -1282,6 +1353,9 @@ export const ProofSpec = { case 4: message.minDepth = reader.int32(); break; + case 5: + message.prehashKeyBeforeComparison = reader.bool(); + break; default: reader.skipType(tag & 7); break; @@ -1295,15 +1369,27 @@ export const ProofSpec = { message.innerSpec = object.innerSpec !== undefined && object.innerSpec !== null ? InnerSpec.fromPartial(object.innerSpec) : undefined; message.maxDepth = object.maxDepth ?? 0; message.minDepth = object.minDepth ?? 0; + message.prehashKeyBeforeComparison = object.prehashKeyBeforeComparison ?? false; return message; }, fromAmino(object: ProofSpecAmino): ProofSpec { - return { - leafSpec: object?.leaf_spec ? LeafOp.fromAmino(object.leaf_spec) : undefined, - innerSpec: object?.inner_spec ? InnerSpec.fromAmino(object.inner_spec) : undefined, - maxDepth: object.max_depth, - minDepth: object.min_depth - }; + const message = createBaseProofSpec(); + if (object.leaf_spec !== undefined && object.leaf_spec !== null) { + message.leafSpec = LeafOp.fromAmino(object.leaf_spec); + } + if (object.inner_spec !== undefined && object.inner_spec !== null) { + message.innerSpec = InnerSpec.fromAmino(object.inner_spec); + } + if (object.max_depth !== undefined && object.max_depth !== null) { + message.maxDepth = object.max_depth; + } + if (object.min_depth !== undefined && object.min_depth !== null) { + message.minDepth = object.min_depth; + } + if (object.prehash_key_before_comparison !== undefined && object.prehash_key_before_comparison !== null) { + message.prehashKeyBeforeComparison = object.prehash_key_before_comparison; + } + return message; }, toAmino(message: ProofSpec): ProofSpecAmino { const obj: any = {}; @@ -1311,6 +1397,7 @@ export const ProofSpec = { obj.inner_spec = message.innerSpec ? InnerSpec.toAmino(message.innerSpec) : undefined; obj.max_depth = message.maxDepth; obj.min_depth = message.minDepth; + obj.prehash_key_before_comparison = message.prehashKeyBeforeComparison; return obj; }, fromAminoMsg(object: ProofSpecAminoMsg): ProofSpec { @@ -1420,14 +1507,24 @@ export const InnerSpec = { return message; }, fromAmino(object: InnerSpecAmino): InnerSpec { - return { - childOrder: Array.isArray(object?.child_order) ? object.child_order.map((e: any) => e) : [], - childSize: object.child_size, - minPrefixLength: object.min_prefix_length, - maxPrefixLength: object.max_prefix_length, - emptyChild: object.empty_child, - hash: isSet(object.hash) ? hashOpFromJSON(object.hash) : -1 - }; + const message = createBaseInnerSpec(); + message.childOrder = object.child_order?.map(e => e) || []; + if (object.child_size !== undefined && object.child_size !== null) { + message.childSize = object.child_size; + } + if (object.min_prefix_length !== undefined && object.min_prefix_length !== null) { + message.minPrefixLength = object.min_prefix_length; + } + if (object.max_prefix_length !== undefined && object.max_prefix_length !== null) { + message.maxPrefixLength = object.max_prefix_length; + } + if (object.empty_child !== undefined && object.empty_child !== null) { + message.emptyChild = bytesFromBase64(object.empty_child); + } + if (object.hash !== undefined && object.hash !== null) { + message.hash = hashOpFromJSON(object.hash); + } + return message; }, toAmino(message: InnerSpec): InnerSpecAmino { const obj: any = {}; @@ -1439,8 +1536,8 @@ export const InnerSpec = { obj.child_size = message.childSize; obj.min_prefix_length = message.minPrefixLength; obj.max_prefix_length = message.maxPrefixLength; - obj.empty_child = message.emptyChild; - obj.hash = message.hash; + obj.empty_child = message.emptyChild ? base64FromBytes(message.emptyChild) : undefined; + obj.hash = hashOpToJSON(message.hash); return obj; }, fromAminoMsg(object: InnerSpecAminoMsg): InnerSpec { @@ -1501,9 +1598,9 @@ export const BatchProof = { return message; }, fromAmino(object: BatchProofAmino): BatchProof { - return { - entries: Array.isArray(object?.entries) ? object.entries.map((e: any) => BatchEntry.fromAmino(e)) : [] - }; + const message = createBaseBatchProof(); + message.entries = object.entries?.map(e => BatchEntry.fromAmino(e)) || []; + return message; }, toAmino(message: BatchProof): BatchProofAmino { const obj: any = {}; @@ -1580,10 +1677,14 @@ export const BatchEntry = { return message; }, fromAmino(object: BatchEntryAmino): BatchEntry { - return { - exist: object?.exist ? ExistenceProof.fromAmino(object.exist) : undefined, - nonexist: object?.nonexist ? NonExistenceProof.fromAmino(object.nonexist) : undefined - }; + const message = createBaseBatchEntry(); + if (object.exist !== undefined && object.exist !== null) { + message.exist = ExistenceProof.fromAmino(object.exist); + } + if (object.nonexist !== undefined && object.nonexist !== null) { + message.nonexist = NonExistenceProof.fromAmino(object.nonexist); + } + return message; }, toAmino(message: BatchEntry): BatchEntryAmino { const obj: any = {}; @@ -1657,10 +1758,10 @@ export const CompressedBatchProof = { return message; }, fromAmino(object: CompressedBatchProofAmino): CompressedBatchProof { - return { - entries: Array.isArray(object?.entries) ? object.entries.map((e: any) => CompressedBatchEntry.fromAmino(e)) : [], - lookupInners: Array.isArray(object?.lookup_inners) ? object.lookup_inners.map((e: any) => InnerOp.fromAmino(e)) : [] - }; + const message = createBaseCompressedBatchProof(); + message.entries = object.entries?.map(e => CompressedBatchEntry.fromAmino(e)) || []; + message.lookupInners = object.lookup_inners?.map(e => InnerOp.fromAmino(e)) || []; + return message; }, toAmino(message: CompressedBatchProof): CompressedBatchProofAmino { const obj: any = {}; @@ -1742,10 +1843,14 @@ export const CompressedBatchEntry = { return message; }, fromAmino(object: CompressedBatchEntryAmino): CompressedBatchEntry { - return { - exist: object?.exist ? CompressedExistenceProof.fromAmino(object.exist) : undefined, - nonexist: object?.nonexist ? CompressedNonExistenceProof.fromAmino(object.nonexist) : undefined - }; + const message = createBaseCompressedBatchEntry(); + if (object.exist !== undefined && object.exist !== null) { + message.exist = CompressedExistenceProof.fromAmino(object.exist); + } + if (object.nonexist !== undefined && object.nonexist !== null) { + message.nonexist = CompressedNonExistenceProof.fromAmino(object.nonexist); + } + return message; }, toAmino(message: CompressedBatchEntry): CompressedBatchEntryAmino { const obj: any = {}; @@ -1779,7 +1884,7 @@ function createBaseCompressedExistenceProof(): CompressedExistenceProof { return { key: new Uint8Array(), value: new Uint8Array(), - leaf: LeafOp.fromPartial({}), + leaf: undefined, path: [] }; } @@ -1844,17 +1949,23 @@ export const CompressedExistenceProof = { return message; }, fromAmino(object: CompressedExistenceProofAmino): CompressedExistenceProof { - return { - key: object.key, - value: object.value, - leaf: object?.leaf ? LeafOp.fromAmino(object.leaf) : undefined, - path: Array.isArray(object?.path) ? object.path.map((e: any) => e) : [] - }; + const message = createBaseCompressedExistenceProof(); + if (object.key !== undefined && object.key !== null) { + message.key = bytesFromBase64(object.key); + } + if (object.value !== undefined && object.value !== null) { + message.value = bytesFromBase64(object.value); + } + if (object.leaf !== undefined && object.leaf !== null) { + message.leaf = LeafOp.fromAmino(object.leaf); + } + message.path = object.path?.map(e => e) || []; + return message; }, toAmino(message: CompressedExistenceProof): CompressedExistenceProofAmino { const obj: any = {}; - obj.key = message.key; - obj.value = message.value; + obj.key = message.key ? base64FromBytes(message.key) : undefined; + obj.value = message.value ? base64FromBytes(message.value) : undefined; obj.leaf = message.leaf ? LeafOp.toAmino(message.leaf) : undefined; if (message.path) { obj.path = message.path.map(e => e); @@ -1888,8 +1999,8 @@ export const CompressedExistenceProof = { function createBaseCompressedNonExistenceProof(): CompressedNonExistenceProof { return { key: new Uint8Array(), - left: CompressedExistenceProof.fromPartial({}), - right: CompressedExistenceProof.fromPartial({}) + left: undefined, + right: undefined }; } export const CompressedNonExistenceProof = { @@ -1937,15 +2048,21 @@ export const CompressedNonExistenceProof = { return message; }, fromAmino(object: CompressedNonExistenceProofAmino): CompressedNonExistenceProof { - return { - key: object.key, - left: object?.left ? CompressedExistenceProof.fromAmino(object.left) : undefined, - right: object?.right ? CompressedExistenceProof.fromAmino(object.right) : undefined - }; + const message = createBaseCompressedNonExistenceProof(); + if (object.key !== undefined && object.key !== null) { + message.key = bytesFromBase64(object.key); + } + if (object.left !== undefined && object.left !== null) { + message.left = CompressedExistenceProof.fromAmino(object.left); + } + if (object.right !== undefined && object.right !== null) { + message.right = CompressedExistenceProof.fromAmino(object.right); + } + return message; }, toAmino(message: CompressedNonExistenceProof): CompressedNonExistenceProofAmino { const obj: any = {}; - obj.key = message.key; + obj.key = message.key ? base64FromBytes(message.key) : undefined; obj.left = message.left ? CompressedExistenceProof.toAmino(message.left) : undefined; obj.right = message.right ? CompressedExistenceProof.toAmino(message.right) : undefined; return obj; diff --git a/packages/osmo-query/src/codegen/cosmos/lcd.ts b/packages/osmo-query/src/codegen/cosmos/lcd.ts index cc9676119..f1046ed58 100644 --- a/packages/osmo-query/src/codegen/cosmos/lcd.ts +++ b/packages/osmo-query/src/codegen/cosmos/lcd.ts @@ -31,6 +31,11 @@ export const createLCDClient = async ({ }) } }, + consensus: { + v1: new (await import("./consensus/v1/query.lcd")).LCDQueryClient({ + requestClient + }) + }, distribution: { v1beta1: new (await import("./distribution/v1beta1/query.lcd")).LCDQueryClient({ requestClient diff --git a/packages/osmo-query/src/codegen/cosmos/msg/v1/msg.ts b/packages/osmo-query/src/codegen/cosmos/msg/v1/msg.ts new file mode 100644 index 000000000..693da49fc --- /dev/null +++ b/packages/osmo-query/src/codegen/cosmos/msg/v1/msg.ts @@ -0,0 +1 @@ +export {} \ No newline at end of file diff --git a/packages/osmo-query/src/codegen/cosmos/orm/query/v1alpha1/query.rpc.Query.ts b/packages/osmo-query/src/codegen/cosmos/orm/query/v1alpha1/query.rpc.Query.ts new file mode 100644 index 000000000..990468cf0 --- /dev/null +++ b/packages/osmo-query/src/codegen/cosmos/orm/query/v1alpha1/query.rpc.Query.ts @@ -0,0 +1,84 @@ +import { Rpc } from "../../../../helpers"; +import { BinaryReader } from "../../../../binary"; +import { QueryClient, createProtobufRpcClient, ProtobufRpcClient } from "@cosmjs/stargate"; +import { ReactQueryParams } from "../../../../react-query"; +import { useQuery } from "@tanstack/react-query"; +import { GetRequest, GetResponse, ListRequest, ListResponse } from "./query"; +/** Query is a generic gRPC service for querying ORM data. */ +export interface Query { + /** Get queries an ORM table against an unique index. */ + get(request: GetRequest): Promise; + /** List queries an ORM table against an index. */ + list(request: ListRequest): Promise; +} +export class QueryClientImpl implements Query { + private readonly rpc: Rpc; + constructor(rpc: Rpc) { + this.rpc = rpc; + this.get = this.get.bind(this); + this.list = this.list.bind(this); + } + get(request: GetRequest): Promise { + const data = GetRequest.encode(request).finish(); + const promise = this.rpc.request("cosmos.orm.query.v1alpha1.Query", "Get", data); + return promise.then(data => GetResponse.decode(new BinaryReader(data))); + } + list(request: ListRequest): Promise { + const data = ListRequest.encode(request).finish(); + const promise = this.rpc.request("cosmos.orm.query.v1alpha1.Query", "List", data); + return promise.then(data => ListResponse.decode(new BinaryReader(data))); + } +} +export const createRpcQueryExtension = (base: QueryClient) => { + const rpc = createProtobufRpcClient(base); + const queryService = new QueryClientImpl(rpc); + return { + get(request: GetRequest): Promise { + return queryService.get(request); + }, + list(request: ListRequest): Promise { + return queryService.list(request); + } + }; +}; +export interface UseGetQuery extends ReactQueryParams { + request: GetRequest; +} +export interface UseListQuery extends ReactQueryParams { + request: ListRequest; +} +const _queryClients: WeakMap = new WeakMap(); +const getQueryService = (rpc: ProtobufRpcClient | undefined): QueryClientImpl | undefined => { + if (!rpc) return; + if (_queryClients.has(rpc)) { + return _queryClients.get(rpc); + } + const queryService = new QueryClientImpl(rpc); + _queryClients.set(rpc, queryService); + return queryService; +}; +export const createRpcQueryHooks = (rpc: ProtobufRpcClient | undefined) => { + const queryService = getQueryService(rpc); + const useGet = ({ + request, + options + }: UseGetQuery) => { + return useQuery(["getQuery", request], () => { + if (!queryService) throw new Error("Query Service not initialized"); + return queryService.get(request); + }, options); + }; + const useList = ({ + request, + options + }: UseListQuery) => { + return useQuery(["listQuery", request], () => { + if (!queryService) throw new Error("Query Service not initialized"); + return queryService.list(request); + }, options); + }; + return { + /** Get queries an ORM table against an unique index. */useGet, + /** List queries an ORM table against an index. */useList + }; +}; \ No newline at end of file diff --git a/packages/osmo-query/src/codegen/cosmos/orm/query/v1alpha1/query.ts b/packages/osmo-query/src/codegen/cosmos/orm/query/v1alpha1/query.ts new file mode 100644 index 000000000..b578aa34c --- /dev/null +++ b/packages/osmo-query/src/codegen/cosmos/orm/query/v1alpha1/query.ts @@ -0,0 +1,972 @@ +import { PageRequest, PageRequestAmino, PageRequestSDKType, PageResponse, PageResponseAmino, PageResponseSDKType } from "../../../base/query/v1beta1/pagination"; +import { Any, AnyAmino, AnySDKType } from "../../../../google/protobuf/any"; +import { Timestamp } from "../../../../google/protobuf/timestamp"; +import { Duration, DurationAmino, DurationSDKType } from "../../../../google/protobuf/duration"; +import { BinaryReader, BinaryWriter } from "../../../../binary"; +import { toTimestamp, fromTimestamp, bytesFromBase64, base64FromBytes } from "../../../../helpers"; +/** GetRequest is the Query/Get request type. */ +export interface GetRequest { + /** message_name is the fully-qualified message name of the ORM table being queried. */ + messageName: string; + /** + * index is the index fields expression used in orm definitions. If it + * is empty, the table's primary key is assumed. If it is non-empty, it must + * refer to an unique index. + */ + index: string; + /** + * values are the values of the fields corresponding to the requested index. + * There must be as many values provided as there are fields in the index and + * these values must correspond to the index field types. + */ + values: IndexValue[]; +} +export interface GetRequestProtoMsg { + typeUrl: "/cosmos.orm.query.v1alpha1.GetRequest"; + value: Uint8Array; +} +/** GetRequest is the Query/Get request type. */ +export interface GetRequestAmino { + /** message_name is the fully-qualified message name of the ORM table being queried. */ + message_name?: string; + /** + * index is the index fields expression used in orm definitions. If it + * is empty, the table's primary key is assumed. If it is non-empty, it must + * refer to an unique index. + */ + index?: string; + /** + * values are the values of the fields corresponding to the requested index. + * There must be as many values provided as there are fields in the index and + * these values must correspond to the index field types. + */ + values?: IndexValueAmino[]; +} +export interface GetRequestAminoMsg { + type: "cosmos-sdk/GetRequest"; + value: GetRequestAmino; +} +/** GetRequest is the Query/Get request type. */ +export interface GetRequestSDKType { + message_name: string; + index: string; + values: IndexValueSDKType[]; +} +/** GetResponse is the Query/Get response type. */ +export interface GetResponse { + /** + * result is the result of the get query. If no value is found, the gRPC + * status code NOT_FOUND will be returned. + */ + result?: Any; +} +export interface GetResponseProtoMsg { + typeUrl: "/cosmos.orm.query.v1alpha1.GetResponse"; + value: Uint8Array; +} +/** GetResponse is the Query/Get response type. */ +export interface GetResponseAmino { + /** + * result is the result of the get query. If no value is found, the gRPC + * status code NOT_FOUND will be returned. + */ + result?: AnyAmino; +} +export interface GetResponseAminoMsg { + type: "cosmos-sdk/GetResponse"; + value: GetResponseAmino; +} +/** GetResponse is the Query/Get response type. */ +export interface GetResponseSDKType { + result?: AnySDKType; +} +/** ListRequest is the Query/List request type. */ +export interface ListRequest { + /** message_name is the fully-qualified message name of the ORM table being queried. */ + messageName: string; + /** + * index is the index fields expression used in orm definitions. If it + * is empty, the table's primary key is assumed. + */ + index: string; + /** prefix defines a prefix query. */ + prefix?: ListRequest_Prefix; + /** range defines a range query. */ + range?: ListRequest_Range; + /** pagination is the pagination request. */ + pagination?: PageRequest; +} +export interface ListRequestProtoMsg { + typeUrl: "/cosmos.orm.query.v1alpha1.ListRequest"; + value: Uint8Array; +} +/** ListRequest is the Query/List request type. */ +export interface ListRequestAmino { + /** message_name is the fully-qualified message name of the ORM table being queried. */ + message_name?: string; + /** + * index is the index fields expression used in orm definitions. If it + * is empty, the table's primary key is assumed. + */ + index?: string; + /** prefix defines a prefix query. */ + prefix?: ListRequest_PrefixAmino; + /** range defines a range query. */ + range?: ListRequest_RangeAmino; + /** pagination is the pagination request. */ + pagination?: PageRequestAmino; +} +export interface ListRequestAminoMsg { + type: "cosmos-sdk/ListRequest"; + value: ListRequestAmino; +} +/** ListRequest is the Query/List request type. */ +export interface ListRequestSDKType { + message_name: string; + index: string; + prefix?: ListRequest_PrefixSDKType; + range?: ListRequest_RangeSDKType; + pagination?: PageRequestSDKType; +} +/** Prefix specifies the arguments to a prefix query. */ +export interface ListRequest_Prefix { + /** + * values specifies the index values for the prefix query. + * It is valid to special a partial prefix with fewer values than + * the number of fields in the index. + */ + values: IndexValue[]; +} +export interface ListRequest_PrefixProtoMsg { + typeUrl: "/cosmos.orm.query.v1alpha1.Prefix"; + value: Uint8Array; +} +/** Prefix specifies the arguments to a prefix query. */ +export interface ListRequest_PrefixAmino { + /** + * values specifies the index values for the prefix query. + * It is valid to special a partial prefix with fewer values than + * the number of fields in the index. + */ + values?: IndexValueAmino[]; +} +export interface ListRequest_PrefixAminoMsg { + type: "cosmos-sdk/Prefix"; + value: ListRequest_PrefixAmino; +} +/** Prefix specifies the arguments to a prefix query. */ +export interface ListRequest_PrefixSDKType { + values: IndexValueSDKType[]; +} +/** Range specifies the arguments to a range query. */ +export interface ListRequest_Range { + /** + * start specifies the starting index values for the range query. + * It is valid to provide fewer values than the number of fields in the + * index. + */ + start: IndexValue[]; + /** + * end specifies the inclusive ending index values for the range query. + * It is valid to provide fewer values than the number of fields in the + * index. + */ + end: IndexValue[]; +} +export interface ListRequest_RangeProtoMsg { + typeUrl: "/cosmos.orm.query.v1alpha1.Range"; + value: Uint8Array; +} +/** Range specifies the arguments to a range query. */ +export interface ListRequest_RangeAmino { + /** + * start specifies the starting index values for the range query. + * It is valid to provide fewer values than the number of fields in the + * index. + */ + start?: IndexValueAmino[]; + /** + * end specifies the inclusive ending index values for the range query. + * It is valid to provide fewer values than the number of fields in the + * index. + */ + end?: IndexValueAmino[]; +} +export interface ListRequest_RangeAminoMsg { + type: "cosmos-sdk/Range"; + value: ListRequest_RangeAmino; +} +/** Range specifies the arguments to a range query. */ +export interface ListRequest_RangeSDKType { + start: IndexValueSDKType[]; + end: IndexValueSDKType[]; +} +/** ListResponse is the Query/List response type. */ +export interface ListResponse { + /** results are the results of the query. */ + results: Any[]; + /** pagination is the pagination response. */ + pagination?: PageResponse; +} +export interface ListResponseProtoMsg { + typeUrl: "/cosmos.orm.query.v1alpha1.ListResponse"; + value: Uint8Array; +} +/** ListResponse is the Query/List response type. */ +export interface ListResponseAmino { + /** results are the results of the query. */ + results?: AnyAmino[]; + /** pagination is the pagination response. */ + pagination?: PageResponseAmino; +} +export interface ListResponseAminoMsg { + type: "cosmos-sdk/ListResponse"; + value: ListResponseAmino; +} +/** ListResponse is the Query/List response type. */ +export interface ListResponseSDKType { + results: AnySDKType[]; + pagination?: PageResponseSDKType; +} +/** IndexValue represents the value of a field in an ORM index expression. */ +export interface IndexValue { + /** + * uint specifies a value for an uint32, fixed32, uint64, or fixed64 + * index field. + */ + uint?: bigint; + /** + * int64 specifies a value for an int32, sfixed32, int64, or sfixed64 + * index field. + */ + int?: bigint; + /** str specifies a value for a string index field. */ + str?: string; + /** bytes specifies a value for a bytes index field. */ + bytes?: Uint8Array; + /** enum specifies a value for an enum index field. */ + enum?: string; + /** bool specifies a value for a bool index field. */ + bool?: boolean; + /** timestamp specifies a value for a timestamp index field. */ + timestamp?: Date; + /** duration specifies a value for a duration index field. */ + duration?: Duration; +} +export interface IndexValueProtoMsg { + typeUrl: "/cosmos.orm.query.v1alpha1.IndexValue"; + value: Uint8Array; +} +/** IndexValue represents the value of a field in an ORM index expression. */ +export interface IndexValueAmino { + /** + * uint specifies a value for an uint32, fixed32, uint64, or fixed64 + * index field. + */ + uint?: string; + /** + * int64 specifies a value for an int32, sfixed32, int64, or sfixed64 + * index field. + */ + int?: string; + /** str specifies a value for a string index field. */ + str?: string; + /** bytes specifies a value for a bytes index field. */ + bytes?: string; + /** enum specifies a value for an enum index field. */ + enum?: string; + /** bool specifies a value for a bool index field. */ + bool?: boolean; + /** timestamp specifies a value for a timestamp index field. */ + timestamp?: string; + /** duration specifies a value for a duration index field. */ + duration?: DurationAmino; +} +export interface IndexValueAminoMsg { + type: "cosmos-sdk/IndexValue"; + value: IndexValueAmino; +} +/** IndexValue represents the value of a field in an ORM index expression. */ +export interface IndexValueSDKType { + uint?: bigint; + int?: bigint; + str?: string; + bytes?: Uint8Array; + enum?: string; + bool?: boolean; + timestamp?: Date; + duration?: DurationSDKType; +} +function createBaseGetRequest(): GetRequest { + return { + messageName: "", + index: "", + values: [] + }; +} +export const GetRequest = { + typeUrl: "/cosmos.orm.query.v1alpha1.GetRequest", + encode(message: GetRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.messageName !== "") { + writer.uint32(10).string(message.messageName); + } + if (message.index !== "") { + writer.uint32(18).string(message.index); + } + for (const v of message.values) { + IndexValue.encode(v!, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): GetRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGetRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.messageName = reader.string(); + break; + case 2: + message.index = reader.string(); + break; + case 3: + message.values.push(IndexValue.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): GetRequest { + const message = createBaseGetRequest(); + message.messageName = object.messageName ?? ""; + message.index = object.index ?? ""; + message.values = object.values?.map(e => IndexValue.fromPartial(e)) || []; + return message; + }, + fromAmino(object: GetRequestAmino): GetRequest { + const message = createBaseGetRequest(); + if (object.message_name !== undefined && object.message_name !== null) { + message.messageName = object.message_name; + } + if (object.index !== undefined && object.index !== null) { + message.index = object.index; + } + message.values = object.values?.map(e => IndexValue.fromAmino(e)) || []; + return message; + }, + toAmino(message: GetRequest): GetRequestAmino { + const obj: any = {}; + obj.message_name = message.messageName; + obj.index = message.index; + if (message.values) { + obj.values = message.values.map(e => e ? IndexValue.toAmino(e) : undefined); + } else { + obj.values = []; + } + return obj; + }, + fromAminoMsg(object: GetRequestAminoMsg): GetRequest { + return GetRequest.fromAmino(object.value); + }, + toAminoMsg(message: GetRequest): GetRequestAminoMsg { + return { + type: "cosmos-sdk/GetRequest", + value: GetRequest.toAmino(message) + }; + }, + fromProtoMsg(message: GetRequestProtoMsg): GetRequest { + return GetRequest.decode(message.value); + }, + toProto(message: GetRequest): Uint8Array { + return GetRequest.encode(message).finish(); + }, + toProtoMsg(message: GetRequest): GetRequestProtoMsg { + return { + typeUrl: "/cosmos.orm.query.v1alpha1.GetRequest", + value: GetRequest.encode(message).finish() + }; + } +}; +function createBaseGetResponse(): GetResponse { + return { + result: undefined + }; +} +export const GetResponse = { + typeUrl: "/cosmos.orm.query.v1alpha1.GetResponse", + encode(message: GetResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.result !== undefined) { + Any.encode(message.result, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): GetResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGetResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.result = Any.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): GetResponse { + const message = createBaseGetResponse(); + message.result = object.result !== undefined && object.result !== null ? Any.fromPartial(object.result) : undefined; + return message; + }, + fromAmino(object: GetResponseAmino): GetResponse { + const message = createBaseGetResponse(); + if (object.result !== undefined && object.result !== null) { + message.result = Any.fromAmino(object.result); + } + return message; + }, + toAmino(message: GetResponse): GetResponseAmino { + const obj: any = {}; + obj.result = message.result ? Any.toAmino(message.result) : undefined; + return obj; + }, + fromAminoMsg(object: GetResponseAminoMsg): GetResponse { + return GetResponse.fromAmino(object.value); + }, + toAminoMsg(message: GetResponse): GetResponseAminoMsg { + return { + type: "cosmos-sdk/GetResponse", + value: GetResponse.toAmino(message) + }; + }, + fromProtoMsg(message: GetResponseProtoMsg): GetResponse { + return GetResponse.decode(message.value); + }, + toProto(message: GetResponse): Uint8Array { + return GetResponse.encode(message).finish(); + }, + toProtoMsg(message: GetResponse): GetResponseProtoMsg { + return { + typeUrl: "/cosmos.orm.query.v1alpha1.GetResponse", + value: GetResponse.encode(message).finish() + }; + } +}; +function createBaseListRequest(): ListRequest { + return { + messageName: "", + index: "", + prefix: undefined, + range: undefined, + pagination: undefined + }; +} +export const ListRequest = { + typeUrl: "/cosmos.orm.query.v1alpha1.ListRequest", + encode(message: ListRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.messageName !== "") { + writer.uint32(10).string(message.messageName); + } + if (message.index !== "") { + writer.uint32(18).string(message.index); + } + if (message.prefix !== undefined) { + ListRequest_Prefix.encode(message.prefix, writer.uint32(26).fork()).ldelim(); + } + if (message.range !== undefined) { + ListRequest_Range.encode(message.range, writer.uint32(34).fork()).ldelim(); + } + if (message.pagination !== undefined) { + PageRequest.encode(message.pagination, writer.uint32(42).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): ListRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseListRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.messageName = reader.string(); + break; + case 2: + message.index = reader.string(); + break; + case 3: + message.prefix = ListRequest_Prefix.decode(reader, reader.uint32()); + break; + case 4: + message.range = ListRequest_Range.decode(reader, reader.uint32()); + break; + case 5: + message.pagination = PageRequest.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): ListRequest { + const message = createBaseListRequest(); + message.messageName = object.messageName ?? ""; + message.index = object.index ?? ""; + message.prefix = object.prefix !== undefined && object.prefix !== null ? ListRequest_Prefix.fromPartial(object.prefix) : undefined; + message.range = object.range !== undefined && object.range !== null ? ListRequest_Range.fromPartial(object.range) : undefined; + message.pagination = object.pagination !== undefined && object.pagination !== null ? PageRequest.fromPartial(object.pagination) : undefined; + return message; + }, + fromAmino(object: ListRequestAmino): ListRequest { + const message = createBaseListRequest(); + if (object.message_name !== undefined && object.message_name !== null) { + message.messageName = object.message_name; + } + if (object.index !== undefined && object.index !== null) { + message.index = object.index; + } + if (object.prefix !== undefined && object.prefix !== null) { + message.prefix = ListRequest_Prefix.fromAmino(object.prefix); + } + if (object.range !== undefined && object.range !== null) { + message.range = ListRequest_Range.fromAmino(object.range); + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromAmino(object.pagination); + } + return message; + }, + toAmino(message: ListRequest): ListRequestAmino { + const obj: any = {}; + obj.message_name = message.messageName; + obj.index = message.index; + obj.prefix = message.prefix ? ListRequest_Prefix.toAmino(message.prefix) : undefined; + obj.range = message.range ? ListRequest_Range.toAmino(message.range) : undefined; + obj.pagination = message.pagination ? PageRequest.toAmino(message.pagination) : undefined; + return obj; + }, + fromAminoMsg(object: ListRequestAminoMsg): ListRequest { + return ListRequest.fromAmino(object.value); + }, + toAminoMsg(message: ListRequest): ListRequestAminoMsg { + return { + type: "cosmos-sdk/ListRequest", + value: ListRequest.toAmino(message) + }; + }, + fromProtoMsg(message: ListRequestProtoMsg): ListRequest { + return ListRequest.decode(message.value); + }, + toProto(message: ListRequest): Uint8Array { + return ListRequest.encode(message).finish(); + }, + toProtoMsg(message: ListRequest): ListRequestProtoMsg { + return { + typeUrl: "/cosmos.orm.query.v1alpha1.ListRequest", + value: ListRequest.encode(message).finish() + }; + } +}; +function createBaseListRequest_Prefix(): ListRequest_Prefix { + return { + values: [] + }; +} +export const ListRequest_Prefix = { + typeUrl: "/cosmos.orm.query.v1alpha1.Prefix", + encode(message: ListRequest_Prefix, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.values) { + IndexValue.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): ListRequest_Prefix { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseListRequest_Prefix(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.values.push(IndexValue.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): ListRequest_Prefix { + const message = createBaseListRequest_Prefix(); + message.values = object.values?.map(e => IndexValue.fromPartial(e)) || []; + return message; + }, + fromAmino(object: ListRequest_PrefixAmino): ListRequest_Prefix { + const message = createBaseListRequest_Prefix(); + message.values = object.values?.map(e => IndexValue.fromAmino(e)) || []; + return message; + }, + toAmino(message: ListRequest_Prefix): ListRequest_PrefixAmino { + const obj: any = {}; + if (message.values) { + obj.values = message.values.map(e => e ? IndexValue.toAmino(e) : undefined); + } else { + obj.values = []; + } + return obj; + }, + fromAminoMsg(object: ListRequest_PrefixAminoMsg): ListRequest_Prefix { + return ListRequest_Prefix.fromAmino(object.value); + }, + toAminoMsg(message: ListRequest_Prefix): ListRequest_PrefixAminoMsg { + return { + type: "cosmos-sdk/Prefix", + value: ListRequest_Prefix.toAmino(message) + }; + }, + fromProtoMsg(message: ListRequest_PrefixProtoMsg): ListRequest_Prefix { + return ListRequest_Prefix.decode(message.value); + }, + toProto(message: ListRequest_Prefix): Uint8Array { + return ListRequest_Prefix.encode(message).finish(); + }, + toProtoMsg(message: ListRequest_Prefix): ListRequest_PrefixProtoMsg { + return { + typeUrl: "/cosmos.orm.query.v1alpha1.Prefix", + value: ListRequest_Prefix.encode(message).finish() + }; + } +}; +function createBaseListRequest_Range(): ListRequest_Range { + return { + start: [], + end: [] + }; +} +export const ListRequest_Range = { + typeUrl: "/cosmos.orm.query.v1alpha1.Range", + encode(message: ListRequest_Range, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.start) { + IndexValue.encode(v!, writer.uint32(10).fork()).ldelim(); + } + for (const v of message.end) { + IndexValue.encode(v!, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): ListRequest_Range { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseListRequest_Range(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.start.push(IndexValue.decode(reader, reader.uint32())); + break; + case 2: + message.end.push(IndexValue.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): ListRequest_Range { + const message = createBaseListRequest_Range(); + message.start = object.start?.map(e => IndexValue.fromPartial(e)) || []; + message.end = object.end?.map(e => IndexValue.fromPartial(e)) || []; + return message; + }, + fromAmino(object: ListRequest_RangeAmino): ListRequest_Range { + const message = createBaseListRequest_Range(); + message.start = object.start?.map(e => IndexValue.fromAmino(e)) || []; + message.end = object.end?.map(e => IndexValue.fromAmino(e)) || []; + return message; + }, + toAmino(message: ListRequest_Range): ListRequest_RangeAmino { + const obj: any = {}; + if (message.start) { + obj.start = message.start.map(e => e ? IndexValue.toAmino(e) : undefined); + } else { + obj.start = []; + } + if (message.end) { + obj.end = message.end.map(e => e ? IndexValue.toAmino(e) : undefined); + } else { + obj.end = []; + } + return obj; + }, + fromAminoMsg(object: ListRequest_RangeAminoMsg): ListRequest_Range { + return ListRequest_Range.fromAmino(object.value); + }, + toAminoMsg(message: ListRequest_Range): ListRequest_RangeAminoMsg { + return { + type: "cosmos-sdk/Range", + value: ListRequest_Range.toAmino(message) + }; + }, + fromProtoMsg(message: ListRequest_RangeProtoMsg): ListRequest_Range { + return ListRequest_Range.decode(message.value); + }, + toProto(message: ListRequest_Range): Uint8Array { + return ListRequest_Range.encode(message).finish(); + }, + toProtoMsg(message: ListRequest_Range): ListRequest_RangeProtoMsg { + return { + typeUrl: "/cosmos.orm.query.v1alpha1.Range", + value: ListRequest_Range.encode(message).finish() + }; + } +}; +function createBaseListResponse(): ListResponse { + return { + results: [], + pagination: undefined + }; +} +export const ListResponse = { + typeUrl: "/cosmos.orm.query.v1alpha1.ListResponse", + encode(message: ListResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.results) { + Any.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.pagination !== undefined) { + PageResponse.encode(message.pagination, writer.uint32(42).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): ListResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseListResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.results.push(Any.decode(reader, reader.uint32())); + break; + case 5: + message.pagination = PageResponse.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): ListResponse { + const message = createBaseListResponse(); + message.results = object.results?.map(e => Any.fromPartial(e)) || []; + message.pagination = object.pagination !== undefined && object.pagination !== null ? PageResponse.fromPartial(object.pagination) : undefined; + return message; + }, + fromAmino(object: ListResponseAmino): ListResponse { + const message = createBaseListResponse(); + message.results = object.results?.map(e => Any.fromAmino(e)) || []; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromAmino(object.pagination); + } + return message; + }, + toAmino(message: ListResponse): ListResponseAmino { + const obj: any = {}; + if (message.results) { + obj.results = message.results.map(e => e ? Any.toAmino(e) : undefined); + } else { + obj.results = []; + } + obj.pagination = message.pagination ? PageResponse.toAmino(message.pagination) : undefined; + return obj; + }, + fromAminoMsg(object: ListResponseAminoMsg): ListResponse { + return ListResponse.fromAmino(object.value); + }, + toAminoMsg(message: ListResponse): ListResponseAminoMsg { + return { + type: "cosmos-sdk/ListResponse", + value: ListResponse.toAmino(message) + }; + }, + fromProtoMsg(message: ListResponseProtoMsg): ListResponse { + return ListResponse.decode(message.value); + }, + toProto(message: ListResponse): Uint8Array { + return ListResponse.encode(message).finish(); + }, + toProtoMsg(message: ListResponse): ListResponseProtoMsg { + return { + typeUrl: "/cosmos.orm.query.v1alpha1.ListResponse", + value: ListResponse.encode(message).finish() + }; + } +}; +function createBaseIndexValue(): IndexValue { + return { + uint: undefined, + int: undefined, + str: undefined, + bytes: undefined, + enum: undefined, + bool: undefined, + timestamp: undefined, + duration: undefined + }; +} +export const IndexValue = { + typeUrl: "/cosmos.orm.query.v1alpha1.IndexValue", + encode(message: IndexValue, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.uint !== undefined) { + writer.uint32(8).uint64(message.uint); + } + if (message.int !== undefined) { + writer.uint32(16).int64(message.int); + } + if (message.str !== undefined) { + writer.uint32(26).string(message.str); + } + if (message.bytes !== undefined) { + writer.uint32(34).bytes(message.bytes); + } + if (message.enum !== undefined) { + writer.uint32(42).string(message.enum); + } + if (message.bool !== undefined) { + writer.uint32(48).bool(message.bool); + } + if (message.timestamp !== undefined) { + Timestamp.encode(toTimestamp(message.timestamp), writer.uint32(58).fork()).ldelim(); + } + if (message.duration !== undefined) { + Duration.encode(message.duration, writer.uint32(66).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): IndexValue { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseIndexValue(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.uint = reader.uint64(); + break; + case 2: + message.int = reader.int64(); + break; + case 3: + message.str = reader.string(); + break; + case 4: + message.bytes = reader.bytes(); + break; + case 5: + message.enum = reader.string(); + break; + case 6: + message.bool = reader.bool(); + break; + case 7: + message.timestamp = fromTimestamp(Timestamp.decode(reader, reader.uint32())); + break; + case 8: + message.duration = Duration.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): IndexValue { + const message = createBaseIndexValue(); + message.uint = object.uint !== undefined && object.uint !== null ? BigInt(object.uint.toString()) : undefined; + message.int = object.int !== undefined && object.int !== null ? BigInt(object.int.toString()) : undefined; + message.str = object.str ?? undefined; + message.bytes = object.bytes ?? undefined; + message.enum = object.enum ?? undefined; + message.bool = object.bool ?? undefined; + message.timestamp = object.timestamp ?? undefined; + message.duration = object.duration !== undefined && object.duration !== null ? Duration.fromPartial(object.duration) : undefined; + return message; + }, + fromAmino(object: IndexValueAmino): IndexValue { + const message = createBaseIndexValue(); + if (object.uint !== undefined && object.uint !== null) { + message.uint = BigInt(object.uint); + } + if (object.int !== undefined && object.int !== null) { + message.int = BigInt(object.int); + } + if (object.str !== undefined && object.str !== null) { + message.str = object.str; + } + if (object.bytes !== undefined && object.bytes !== null) { + message.bytes = bytesFromBase64(object.bytes); + } + if (object.enum !== undefined && object.enum !== null) { + message.enum = object.enum; + } + if (object.bool !== undefined && object.bool !== null) { + message.bool = object.bool; + } + if (object.timestamp !== undefined && object.timestamp !== null) { + message.timestamp = fromTimestamp(Timestamp.fromAmino(object.timestamp)); + } + if (object.duration !== undefined && object.duration !== null) { + message.duration = Duration.fromAmino(object.duration); + } + return message; + }, + toAmino(message: IndexValue): IndexValueAmino { + const obj: any = {}; + obj.uint = message.uint ? message.uint.toString() : undefined; + obj.int = message.int ? message.int.toString() : undefined; + obj.str = message.str; + obj.bytes = message.bytes ? base64FromBytes(message.bytes) : undefined; + obj.enum = message.enum; + obj.bool = message.bool; + obj.timestamp = message.timestamp ? Timestamp.toAmino(toTimestamp(message.timestamp)) : undefined; + obj.duration = message.duration ? Duration.toAmino(message.duration) : undefined; + return obj; + }, + fromAminoMsg(object: IndexValueAminoMsg): IndexValue { + return IndexValue.fromAmino(object.value); + }, + toAminoMsg(message: IndexValue): IndexValueAminoMsg { + return { + type: "cosmos-sdk/IndexValue", + value: IndexValue.toAmino(message) + }; + }, + fromProtoMsg(message: IndexValueProtoMsg): IndexValue { + return IndexValue.decode(message.value); + }, + toProto(message: IndexValue): Uint8Array { + return IndexValue.encode(message).finish(); + }, + toProtoMsg(message: IndexValue): IndexValueProtoMsg { + return { + typeUrl: "/cosmos.orm.query.v1alpha1.IndexValue", + value: IndexValue.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/packages/osmo-query/src/codegen/cosmos/query/v1/query.ts b/packages/osmo-query/src/codegen/cosmos/query/v1/query.ts new file mode 100644 index 000000000..693da49fc --- /dev/null +++ b/packages/osmo-query/src/codegen/cosmos/query/v1/query.ts @@ -0,0 +1 @@ +export {} \ No newline at end of file diff --git a/packages/osmo-query/src/codegen/cosmos/reflection/v1/reflection.ts b/packages/osmo-query/src/codegen/cosmos/reflection/v1/reflection.ts new file mode 100644 index 000000000..f6ec8c4f0 --- /dev/null +++ b/packages/osmo-query/src/codegen/cosmos/reflection/v1/reflection.ts @@ -0,0 +1,165 @@ +import { FileDescriptorProto, FileDescriptorProtoAmino, FileDescriptorProtoSDKType } from "../../../google/protobuf/descriptor"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +/** FileDescriptorsRequest is the Query/FileDescriptors request type. */ +export interface FileDescriptorsRequest {} +export interface FileDescriptorsRequestProtoMsg { + typeUrl: "/cosmos.reflection.v1.FileDescriptorsRequest"; + value: Uint8Array; +} +/** FileDescriptorsRequest is the Query/FileDescriptors request type. */ +export interface FileDescriptorsRequestAmino {} +export interface FileDescriptorsRequestAminoMsg { + type: "cosmos-sdk/FileDescriptorsRequest"; + value: FileDescriptorsRequestAmino; +} +/** FileDescriptorsRequest is the Query/FileDescriptors request type. */ +export interface FileDescriptorsRequestSDKType {} +/** FileDescriptorsResponse is the Query/FileDescriptors response type. */ +export interface FileDescriptorsResponse { + /** files is the file descriptors. */ + files: FileDescriptorProto[]; +} +export interface FileDescriptorsResponseProtoMsg { + typeUrl: "/cosmos.reflection.v1.FileDescriptorsResponse"; + value: Uint8Array; +} +/** FileDescriptorsResponse is the Query/FileDescriptors response type. */ +export interface FileDescriptorsResponseAmino { + /** files is the file descriptors. */ + files?: FileDescriptorProtoAmino[]; +} +export interface FileDescriptorsResponseAminoMsg { + type: "cosmos-sdk/FileDescriptorsResponse"; + value: FileDescriptorsResponseAmino; +} +/** FileDescriptorsResponse is the Query/FileDescriptors response type. */ +export interface FileDescriptorsResponseSDKType { + files: FileDescriptorProtoSDKType[]; +} +function createBaseFileDescriptorsRequest(): FileDescriptorsRequest { + return {}; +} +export const FileDescriptorsRequest = { + typeUrl: "/cosmos.reflection.v1.FileDescriptorsRequest", + encode(_: FileDescriptorsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): FileDescriptorsRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseFileDescriptorsRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): FileDescriptorsRequest { + const message = createBaseFileDescriptorsRequest(); + return message; + }, + fromAmino(_: FileDescriptorsRequestAmino): FileDescriptorsRequest { + const message = createBaseFileDescriptorsRequest(); + return message; + }, + toAmino(_: FileDescriptorsRequest): FileDescriptorsRequestAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: FileDescriptorsRequestAminoMsg): FileDescriptorsRequest { + return FileDescriptorsRequest.fromAmino(object.value); + }, + toAminoMsg(message: FileDescriptorsRequest): FileDescriptorsRequestAminoMsg { + return { + type: "cosmos-sdk/FileDescriptorsRequest", + value: FileDescriptorsRequest.toAmino(message) + }; + }, + fromProtoMsg(message: FileDescriptorsRequestProtoMsg): FileDescriptorsRequest { + return FileDescriptorsRequest.decode(message.value); + }, + toProto(message: FileDescriptorsRequest): Uint8Array { + return FileDescriptorsRequest.encode(message).finish(); + }, + toProtoMsg(message: FileDescriptorsRequest): FileDescriptorsRequestProtoMsg { + return { + typeUrl: "/cosmos.reflection.v1.FileDescriptorsRequest", + value: FileDescriptorsRequest.encode(message).finish() + }; + } +}; +function createBaseFileDescriptorsResponse(): FileDescriptorsResponse { + return { + files: [] + }; +} +export const FileDescriptorsResponse = { + typeUrl: "/cosmos.reflection.v1.FileDescriptorsResponse", + encode(message: FileDescriptorsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.files) { + FileDescriptorProto.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): FileDescriptorsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseFileDescriptorsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.files.push(FileDescriptorProto.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): FileDescriptorsResponse { + const message = createBaseFileDescriptorsResponse(); + message.files = object.files?.map(e => FileDescriptorProto.fromPartial(e)) || []; + return message; + }, + fromAmino(object: FileDescriptorsResponseAmino): FileDescriptorsResponse { + const message = createBaseFileDescriptorsResponse(); + message.files = object.files?.map(e => FileDescriptorProto.fromAmino(e)) || []; + return message; + }, + toAmino(message: FileDescriptorsResponse): FileDescriptorsResponseAmino { + const obj: any = {}; + if (message.files) { + obj.files = message.files.map(e => e ? FileDescriptorProto.toAmino(e) : undefined); + } else { + obj.files = []; + } + return obj; + }, + fromAminoMsg(object: FileDescriptorsResponseAminoMsg): FileDescriptorsResponse { + return FileDescriptorsResponse.fromAmino(object.value); + }, + toAminoMsg(message: FileDescriptorsResponse): FileDescriptorsResponseAminoMsg { + return { + type: "cosmos-sdk/FileDescriptorsResponse", + value: FileDescriptorsResponse.toAmino(message) + }; + }, + fromProtoMsg(message: FileDescriptorsResponseProtoMsg): FileDescriptorsResponse { + return FileDescriptorsResponse.decode(message.value); + }, + toProto(message: FileDescriptorsResponse): Uint8Array { + return FileDescriptorsResponse.encode(message).finish(); + }, + toProtoMsg(message: FileDescriptorsResponse): FileDescriptorsResponseProtoMsg { + return { + typeUrl: "/cosmos.reflection.v1.FileDescriptorsResponse", + value: FileDescriptorsResponse.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/packages/osmo-query/src/codegen/cosmos/rpc.query.ts b/packages/osmo-query/src/codegen/cosmos/rpc.query.ts index fac7811fe..1e5ce15c6 100644 --- a/packages/osmo-query/src/codegen/cosmos/rpc.query.ts +++ b/packages/osmo-query/src/codegen/cosmos/rpc.query.ts @@ -1,11 +1,11 @@ -import { HttpEndpoint, connectComet } from "@cosmjs/tendermint-rpc"; +import { Tendermint34Client, HttpEndpoint } from "@cosmjs/tendermint-rpc"; import { QueryClient } from "@cosmjs/stargate"; export const createRPCQueryClient = async ({ rpcEndpoint }: { rpcEndpoint: string | HttpEndpoint; }) => { - const tmClient = await connectComet(rpcEndpoint); + const tmClient = await Tendermint34Client.connect(rpcEndpoint); const client = new QueryClient(tmClient); return { cosmos: { @@ -23,12 +23,20 @@ export const createRPCQueryClient = async ({ v1beta1: (await import("./base/node/v1beta1/query.rpc.Service")).createRpcQueryExtension(client) } }, + consensus: { + v1: (await import("./consensus/v1/query.rpc.Query")).createRpcQueryExtension(client) + }, distribution: { v1beta1: (await import("./distribution/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) }, gov: { v1beta1: (await import("./gov/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) }, + orm: { + query: { + v1alpha1: (await import("./orm/query/v1alpha1/query.rpc.Query")).createRpcQueryExtension(client) + } + }, staking: { v1beta1: (await import("./staking/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) }, diff --git a/packages/osmo-query/src/codegen/cosmos/rpc.tx.ts b/packages/osmo-query/src/codegen/cosmos/rpc.tx.ts index 61ff2464b..8587d8013 100644 --- a/packages/osmo-query/src/codegen/cosmos/rpc.tx.ts +++ b/packages/osmo-query/src/codegen/cosmos/rpc.tx.ts @@ -5,12 +5,18 @@ export const createRPCMsgClient = async ({ rpc: Rpc; }) => ({ cosmos: { + auth: { + v1beta1: new (await import("./auth/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) + }, authz: { v1beta1: new (await import("./authz/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) }, bank: { v1beta1: new (await import("./bank/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) }, + consensus: { + v1: new (await import("./consensus/v1/tx.rpc.msg")).MsgClientImpl(rpc) + }, distribution: { v1beta1: new (await import("./distribution/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) }, @@ -19,6 +25,9 @@ export const createRPCMsgClient = async ({ }, staking: { v1beta1: new (await import("./staking/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) + }, + upgrade: { + v1beta1: new (await import("./upgrade/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) } } }); \ No newline at end of file diff --git a/packages/osmo-query/src/codegen/cosmos/staking/v1beta1/authz.ts b/packages/osmo-query/src/codegen/cosmos/staking/v1beta1/authz.ts index 5d83ee3b3..a50ff6a3b 100644 --- a/packages/osmo-query/src/codegen/cosmos/staking/v1beta1/authz.ts +++ b/packages/osmo-query/src/codegen/cosmos/staking/v1beta1/authz.ts @@ -1,6 +1,5 @@ import { Coin, CoinAmino, CoinSDKType } from "../../base/v1beta1/coin"; import { BinaryReader, BinaryWriter } from "../../../binary"; -import { isSet } from "../../../helpers"; /** * AuthorizationType defines the type of staking module authorization type * @@ -60,12 +59,12 @@ export function authorizationTypeToJSON(object: AuthorizationType): string { * Since: cosmos-sdk 0.43 */ export interface StakeAuthorization { - $typeUrl?: string; + $typeUrl?: "/cosmos.staking.v1beta1.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. @@ -99,7 +98,7 @@ export interface StakeAuthorizationAmino { /** deny_list specifies list of validator addresses to whom grantee can not delegate tokens. */ deny_list?: StakeAuthorization_ValidatorsAmino; /** authorization_type defines one of AuthorizationType. */ - authorization_type: AuthorizationType; + authorization_type?: AuthorizationType; } export interface StakeAuthorizationAminoMsg { type: "cosmos-sdk/StakeAuthorization"; @@ -111,8 +110,8 @@ export interface StakeAuthorizationAminoMsg { * Since: cosmos-sdk 0.43 */ export interface StakeAuthorizationSDKType { - $typeUrl?: string; - max_tokens: CoinSDKType; + $typeUrl?: "/cosmos.staking.v1beta1.StakeAuthorization"; + max_tokens?: CoinSDKType; allow_list?: StakeAuthorization_ValidatorsSDKType; deny_list?: StakeAuthorization_ValidatorsSDKType; authorization_type: AuthorizationType; @@ -127,7 +126,7 @@ export interface StakeAuthorization_ValidatorsProtoMsg { } /** Validators defines list of validator addresses. */ export interface StakeAuthorization_ValidatorsAmino { - address: string[]; + address?: string[]; } export interface StakeAuthorization_ValidatorsAminoMsg { type: "cosmos-sdk/Validators"; @@ -140,7 +139,7 @@ export interface StakeAuthorization_ValidatorsSDKType { function createBaseStakeAuthorization(): StakeAuthorization { return { $typeUrl: "/cosmos.staking.v1beta1.StakeAuthorization", - maxTokens: Coin.fromPartial({}), + maxTokens: undefined, allowList: undefined, denyList: undefined, authorizationType: 0 @@ -198,19 +197,27 @@ export const StakeAuthorization = { return message; }, fromAmino(object: StakeAuthorizationAmino): StakeAuthorization { - return { - maxTokens: object?.max_tokens ? Coin.fromAmino(object.max_tokens) : undefined, - allowList: object?.allow_list ? StakeAuthorization_Validators.fromAmino(object.allow_list) : undefined, - denyList: object?.deny_list ? StakeAuthorization_Validators.fromAmino(object.deny_list) : undefined, - authorizationType: isSet(object.authorization_type) ? authorizationTypeFromJSON(object.authorization_type) : -1 - }; + const message = createBaseStakeAuthorization(); + if (object.max_tokens !== undefined && object.max_tokens !== null) { + message.maxTokens = Coin.fromAmino(object.max_tokens); + } + if (object.allow_list !== undefined && object.allow_list !== null) { + message.allowList = StakeAuthorization_Validators.fromAmino(object.allow_list); + } + if (object.deny_list !== undefined && object.deny_list !== null) { + message.denyList = StakeAuthorization_Validators.fromAmino(object.deny_list); + } + if (object.authorization_type !== undefined && object.authorization_type !== null) { + message.authorizationType = authorizationTypeFromJSON(object.authorization_type); + } + return message; }, toAmino(message: StakeAuthorization): StakeAuthorizationAmino { const obj: any = {}; obj.max_tokens = message.maxTokens ? Coin.toAmino(message.maxTokens) : undefined; obj.allow_list = message.allowList ? StakeAuthorization_Validators.toAmino(message.allowList) : undefined; obj.deny_list = message.denyList ? StakeAuthorization_Validators.toAmino(message.denyList) : undefined; - obj.authorization_type = message.authorizationType; + obj.authorization_type = authorizationTypeToJSON(message.authorizationType); return obj; }, fromAminoMsg(object: StakeAuthorizationAminoMsg): StakeAuthorization { @@ -271,9 +278,9 @@ export const StakeAuthorization_Validators = { return message; }, fromAmino(object: StakeAuthorization_ValidatorsAmino): StakeAuthorization_Validators { - return { - address: Array.isArray(object?.address) ? object.address.map((e: any) => e) : [] - }; + const message = createBaseStakeAuthorization_Validators(); + message.address = object.address?.map(e => e) || []; + return message; }, toAmino(message: StakeAuthorization_Validators): StakeAuthorization_ValidatorsAmino { const obj: any = {}; diff --git a/packages/osmo-query/src/codegen/cosmos/staking/v1beta1/genesis.ts b/packages/osmo-query/src/codegen/cosmos/staking/v1beta1/genesis.ts index 9470bea30..81afe7753 100644 --- a/packages/osmo-query/src/codegen/cosmos/staking/v1beta1/genesis.ts +++ b/packages/osmo-query/src/codegen/cosmos/staking/v1beta1/genesis.ts @@ -1,8 +1,9 @@ import { Params, ParamsAmino, ParamsSDKType, Validator, ValidatorAmino, ValidatorSDKType, Delegation, DelegationAmino, DelegationSDKType, UnbondingDelegation, UnbondingDelegationAmino, UnbondingDelegationSDKType, Redelegation, RedelegationAmino, RedelegationSDKType } from "./staking"; import { BinaryReader, BinaryWriter } from "../../../binary"; +import { bytesFromBase64, base64FromBytes } from "../../../helpers"; /** GenesisState defines the staking module's genesis state. */ export interface GenesisState { - /** params defines all the paramaters of related to deposit. */ + /** params defines all the parameters of related to deposit. */ params: Params; /** * last_total_power tracks the total amounts of bonded tokens recorded during @@ -30,13 +31,13 @@ export interface GenesisStateProtoMsg { } /** GenesisState defines the staking module's genesis state. */ export interface GenesisStateAmino { - /** params defines all the paramaters of related to deposit. */ - params?: ParamsAmino; + /** params defines all the parameters of related to deposit. */ + params: ParamsAmino; /** * last_total_power tracks the total amounts of bonded tokens recorded during * the previous end block. */ - last_total_power: Uint8Array; + last_total_power: string; /** * last_validator_powers is a special index that provides a historical list * of the last-block's bonded validators. @@ -50,7 +51,7 @@ export interface GenesisStateAmino { unbonding_delegations: UnbondingDelegationAmino[]; /** redelegations defines the redelegations active at genesis. */ redelegations: RedelegationAmino[]; - exported: boolean; + exported?: boolean; } export interface GenesisStateAminoMsg { type: "cosmos-sdk/GenesisState"; @@ -81,9 +82,9 @@ export interface LastValidatorPowerProtoMsg { /** LastValidatorPower required for validator set update logic. */ export interface LastValidatorPowerAmino { /** address is the address of the validator. */ - address: string; + address?: string; /** power defines the power of the validator. */ - power: string; + power?: string; } export interface LastValidatorPowerAminoMsg { type: "cosmos-sdk/LastValidatorPower"; @@ -186,21 +187,27 @@ export const GenesisState = { return message; }, fromAmino(object: GenesisStateAmino): GenesisState { - return { - params: object?.params ? Params.fromAmino(object.params) : undefined, - lastTotalPower: object.last_total_power, - lastValidatorPowers: Array.isArray(object?.last_validator_powers) ? object.last_validator_powers.map((e: any) => LastValidatorPower.fromAmino(e)) : [], - validators: Array.isArray(object?.validators) ? object.validators.map((e: any) => Validator.fromAmino(e)) : [], - delegations: Array.isArray(object?.delegations) ? object.delegations.map((e: any) => Delegation.fromAmino(e)) : [], - unbondingDelegations: Array.isArray(object?.unbonding_delegations) ? object.unbonding_delegations.map((e: any) => UnbondingDelegation.fromAmino(e)) : [], - redelegations: Array.isArray(object?.redelegations) ? object.redelegations.map((e: any) => Redelegation.fromAmino(e)) : [], - exported: object.exported - }; + const message = createBaseGenesisState(); + if (object.params !== undefined && object.params !== null) { + message.params = Params.fromAmino(object.params); + } + if (object.last_total_power !== undefined && object.last_total_power !== null) { + message.lastTotalPower = bytesFromBase64(object.last_total_power); + } + message.lastValidatorPowers = object.last_validator_powers?.map(e => LastValidatorPower.fromAmino(e)) || []; + message.validators = object.validators?.map(e => Validator.fromAmino(e)) || []; + message.delegations = object.delegations?.map(e => Delegation.fromAmino(e)) || []; + message.unbondingDelegations = object.unbonding_delegations?.map(e => UnbondingDelegation.fromAmino(e)) || []; + message.redelegations = object.redelegations?.map(e => Redelegation.fromAmino(e)) || []; + if (object.exported !== undefined && object.exported !== null) { + message.exported = object.exported; + } + return message; }, toAmino(message: GenesisState): GenesisStateAmino { const obj: any = {}; - obj.params = message.params ? Params.toAmino(message.params) : undefined; - obj.last_total_power = message.lastTotalPower; + obj.params = message.params ? Params.toAmino(message.params) : Params.fromPartial({}); + obj.last_total_power = message.lastTotalPower ? base64FromBytes(message.lastTotalPower) : ""; if (message.lastValidatorPowers) { obj.last_validator_powers = message.lastValidatorPowers.map(e => e ? LastValidatorPower.toAmino(e) : undefined); } else { @@ -295,10 +302,14 @@ export const LastValidatorPower = { return message; }, fromAmino(object: LastValidatorPowerAmino): LastValidatorPower { - return { - address: object.address, - power: BigInt(object.power) - }; + const message = createBaseLastValidatorPower(); + if (object.address !== undefined && object.address !== null) { + message.address = object.address; + } + if (object.power !== undefined && object.power !== null) { + message.power = BigInt(object.power); + } + return message; }, toAmino(message: LastValidatorPower): LastValidatorPowerAmino { const obj: any = {}; diff --git a/packages/osmo-query/src/codegen/cosmos/staking/v1beta1/query.lcd.ts b/packages/osmo-query/src/codegen/cosmos/staking/v1beta1/query.lcd.ts index 4ba0b0222..24291aab7 100644 --- a/packages/osmo-query/src/codegen/cosmos/staking/v1beta1/query.lcd.ts +++ b/packages/osmo-query/src/codegen/cosmos/staking/v1beta1/query.lcd.ts @@ -24,7 +24,10 @@ export class LCDQueryClient { this.pool = this.pool.bind(this); this.params = this.params.bind(this); } - /* Validators queries all validators that match the given status. */ + /* Validators queries all validators that match the given status. + + When called from another module, this query might consume a high amount of + gas if the pagination field is incorrectly set. */ async validators(params: QueryValidatorsRequest): Promise { const options: any = { params: {} @@ -43,7 +46,10 @@ export class LCDQueryClient { const endpoint = `cosmos/staking/v1beta1/validators/${params.validatorAddr}`; return await this.req.get(endpoint); } - /* ValidatorDelegations queries delegate info for given validator. */ + /* ValidatorDelegations queries delegate info for given validator. + + When called from another module, this query might consume a high amount of + gas if the pagination field is incorrectly set. */ async validatorDelegations(params: QueryValidatorDelegationsRequest): Promise { const options: any = { params: {} @@ -54,7 +60,10 @@ export class LCDQueryClient { const endpoint = `cosmos/staking/v1beta1/validators/${params.validatorAddr}/delegations`; return await this.req.get(endpoint, options); } - /* ValidatorUnbondingDelegations queries unbonding delegations of a validator. */ + /* ValidatorUnbondingDelegations queries unbonding delegations of a validator. + + When called from another module, this query might consume a high amount of + gas if the pagination field is incorrectly set. */ async validatorUnbondingDelegations(params: QueryValidatorUnbondingDelegationsRequest): Promise { const options: any = { params: {} @@ -76,7 +85,10 @@ export class LCDQueryClient { const endpoint = `cosmos/staking/v1beta1/validators/${params.validatorAddr}/delegations/${params.delegatorAddr}/unbonding_delegation`; return await this.req.get(endpoint); } - /* DelegatorDelegations queries all delegations of a given delegator address. */ + /* DelegatorDelegations queries all delegations of a given delegator address. + + When called from another module, this query might consume a high amount of + gas if the pagination field is incorrectly set. */ async delegatorDelegations(params: QueryDelegatorDelegationsRequest): Promise { const options: any = { params: {} @@ -88,7 +100,10 @@ export class LCDQueryClient { return await this.req.get(endpoint, options); } /* DelegatorUnbondingDelegations queries all unbonding delegations of a given - delegator address. */ + delegator address. + + When called from another module, this query might consume a high amount of + gas if the pagination field is incorrectly set. */ async delegatorUnbondingDelegations(params: QueryDelegatorUnbondingDelegationsRequest): Promise { const options: any = { params: {} @@ -99,7 +114,10 @@ export class LCDQueryClient { const endpoint = `cosmos/staking/v1beta1/delegators/${params.delegatorAddr}/unbonding_delegations`; return await this.req.get(endpoint, options); } - /* Redelegations queries redelegations of given address. */ + /* Redelegations queries redelegations of given address. + + When called from another module, this query might consume a high amount of + gas if the pagination field is incorrectly set. */ async redelegations(params: QueryRedelegationsRequest): Promise { const options: any = { params: {} @@ -117,7 +135,10 @@ export class LCDQueryClient { return await this.req.get(endpoint, options); } /* DelegatorValidators queries all validators info for given delegator - address. */ + address. + + When called from another module, this query might consume a high amount of + gas if the pagination field is incorrectly set. */ async delegatorValidators(params: QueryDelegatorValidatorsRequest): Promise { const options: any = { params: {} diff --git a/packages/osmo-query/src/codegen/cosmos/staking/v1beta1/query.rpc.Query.ts b/packages/osmo-query/src/codegen/cosmos/staking/v1beta1/query.rpc.Query.ts index a51f39d47..c62105ac2 100644 --- a/packages/osmo-query/src/codegen/cosmos/staking/v1beta1/query.rpc.Query.ts +++ b/packages/osmo-query/src/codegen/cosmos/staking/v1beta1/query.rpc.Query.ts @@ -6,13 +6,28 @@ import { useQuery } from "@tanstack/react-query"; import { QueryValidatorsRequest, QueryValidatorsResponse, QueryValidatorRequest, QueryValidatorResponse, QueryValidatorDelegationsRequest, QueryValidatorDelegationsResponse, QueryValidatorUnbondingDelegationsRequest, QueryValidatorUnbondingDelegationsResponse, QueryDelegationRequest, QueryDelegationResponse, QueryUnbondingDelegationRequest, QueryUnbondingDelegationResponse, QueryDelegatorDelegationsRequest, QueryDelegatorDelegationsResponse, QueryDelegatorUnbondingDelegationsRequest, QueryDelegatorUnbondingDelegationsResponse, QueryRedelegationsRequest, QueryRedelegationsResponse, QueryDelegatorValidatorsRequest, QueryDelegatorValidatorsResponse, QueryDelegatorValidatorRequest, QueryDelegatorValidatorResponse, QueryHistoricalInfoRequest, QueryHistoricalInfoResponse, QueryPoolRequest, QueryPoolResponse, QueryParamsRequest, QueryParamsResponse } from "./query"; /** Query defines the gRPC querier service. */ export interface Query { - /** Validators queries all validators that match the given status. */ + /** + * Validators queries all validators that match the given status. + * + * When called from another module, this query might consume a high amount of + * gas if the pagination field is incorrectly set. + */ validators(request: QueryValidatorsRequest): Promise; /** Validator queries validator info for given validator address. */ validator(request: QueryValidatorRequest): Promise; - /** ValidatorDelegations queries delegate info for given validator. */ + /** + * ValidatorDelegations queries delegate info for given validator. + * + * When called from another module, this query might consume a high amount of + * gas if the pagination field is incorrectly set. + */ validatorDelegations(request: QueryValidatorDelegationsRequest): Promise; - /** ValidatorUnbondingDelegations queries unbonding delegations of a validator. */ + /** + * ValidatorUnbondingDelegations queries unbonding delegations of a validator. + * + * When called from another module, this query might consume a high amount of + * gas if the pagination field is incorrectly set. + */ validatorUnbondingDelegations(request: QueryValidatorUnbondingDelegationsRequest): Promise; /** Delegation queries delegate info for given validator delegator pair. */ delegation(request: QueryDelegationRequest): Promise; @@ -21,18 +36,34 @@ export interface Query { * pair. */ unbondingDelegation(request: QueryUnbondingDelegationRequest): Promise; - /** DelegatorDelegations queries all delegations of a given delegator address. */ + /** + * DelegatorDelegations queries all delegations of a given delegator address. + * + * When called from another module, this query might consume a high amount of + * gas if the pagination field is incorrectly set. + */ delegatorDelegations(request: QueryDelegatorDelegationsRequest): Promise; /** * DelegatorUnbondingDelegations queries all unbonding delegations of a given * delegator address. + * + * When called from another module, this query might consume a high amount of + * gas if the pagination field is incorrectly set. */ delegatorUnbondingDelegations(request: QueryDelegatorUnbondingDelegationsRequest): Promise; - /** Redelegations queries redelegations of given address. */ + /** + * Redelegations queries redelegations of given address. + * + * When called from another module, this query might consume a high amount of + * gas if the pagination field is incorrectly set. + */ redelegations(request: QueryRedelegationsRequest): Promise; /** * DelegatorValidators queries all validators info for given delegator * address. + * + * When called from another module, this query might consume a high amount of + * gas if the pagination field is incorrectly set. */ delegatorValidators(request: QueryDelegatorValidatorsRequest): Promise; /** @@ -366,26 +397,62 @@ export const createRpcQueryHooks = (rpc: ProtobufRpcClient | undefined) => { }, options); }; return { - /** Validators queries all validators that match the given status. */useValidators, + /** + * Validators queries all validators that match the given status. + * + * When called from another module, this query might consume a high amount of + * gas if the pagination field is incorrectly set. + */ + useValidators, /** Validator queries validator info for given validator address. */useValidator, - /** ValidatorDelegations queries delegate info for given validator. */useValidatorDelegations, - /** ValidatorUnbondingDelegations queries unbonding delegations of a validator. */useValidatorUnbondingDelegations, + /** + * ValidatorDelegations queries delegate info for given validator. + * + * When called from another module, this query might consume a high amount of + * gas if the pagination field is incorrectly set. + */ + useValidatorDelegations, + /** + * ValidatorUnbondingDelegations queries unbonding delegations of a validator. + * + * When called from another module, this query might consume a high amount of + * gas if the pagination field is incorrectly set. + */ + useValidatorUnbondingDelegations, /** Delegation queries delegate info for given validator delegator pair. */useDelegation, /** * UnbondingDelegation queries unbonding info for given validator delegator * pair. */ useUnbondingDelegation, - /** DelegatorDelegations queries all delegations of a given delegator address. */useDelegatorDelegations, + /** + * DelegatorDelegations queries all delegations of a given delegator address. + * + * When called from another module, this query might consume a high amount of + * gas if the pagination field is incorrectly set. + */ + useDelegatorDelegations, /** * DelegatorUnbondingDelegations queries all unbonding delegations of a given * delegator address. + * + * When called from another module, this query might consume a high amount of + * gas if the pagination field is incorrectly set. */ useDelegatorUnbondingDelegations, - /** Redelegations queries redelegations of given address. */useRedelegations, + /** + * Redelegations queries redelegations of given address. + * + * When called from another module, this query might consume a high amount of + * gas if the pagination field is incorrectly set. + */ + useRedelegations, /** * DelegatorValidators queries all validators info for given delegator * address. + * + * When called from another module, this query might consume a high amount of + * gas if the pagination field is incorrectly set. */ useDelegatorValidators, /** diff --git a/packages/osmo-query/src/codegen/cosmos/staking/v1beta1/query.ts b/packages/osmo-query/src/codegen/cosmos/staking/v1beta1/query.ts index d9e00c6fc..c3f30a028 100644 --- a/packages/osmo-query/src/codegen/cosmos/staking/v1beta1/query.ts +++ b/packages/osmo-query/src/codegen/cosmos/staking/v1beta1/query.ts @@ -6,7 +6,7 @@ export interface QueryValidatorsRequest { /** status enables to query for validators matching a given status. */ status: string; /** pagination defines an optional pagination for the request. */ - pagination: PageRequest; + pagination?: PageRequest; } export interface QueryValidatorsRequestProtoMsg { typeUrl: "/cosmos.staking.v1beta1.QueryValidatorsRequest"; @@ -15,7 +15,7 @@ export interface QueryValidatorsRequestProtoMsg { /** QueryValidatorsRequest is request type for Query/Validators RPC method. */ export interface QueryValidatorsRequestAmino { /** status enables to query for validators matching a given status. */ - status: string; + status?: string; /** pagination defines an optional pagination for the request. */ pagination?: PageRequestAmino; } @@ -26,14 +26,14 @@ export interface QueryValidatorsRequestAminoMsg { /** QueryValidatorsRequest is request type for Query/Validators RPC method. */ export interface QueryValidatorsRequestSDKType { status: string; - pagination: PageRequestSDKType; + pagination?: PageRequestSDKType; } /** QueryValidatorsResponse is response type for the Query/Validators RPC method */ export interface QueryValidatorsResponse { /** validators contains all the queried validators. */ validators: Validator[]; /** pagination defines the pagination in the response. */ - pagination: PageResponse; + pagination?: PageResponse; } export interface QueryValidatorsResponseProtoMsg { typeUrl: "/cosmos.staking.v1beta1.QueryValidatorsResponse"; @@ -53,7 +53,7 @@ export interface QueryValidatorsResponseAminoMsg { /** QueryValidatorsResponse is response type for the Query/Validators RPC method */ export interface QueryValidatorsResponseSDKType { validators: ValidatorSDKType[]; - pagination: PageResponseSDKType; + pagination?: PageResponseSDKType; } /** QueryValidatorRequest is response type for the Query/Validator RPC method */ export interface QueryValidatorRequest { @@ -67,7 +67,7 @@ export interface QueryValidatorRequestProtoMsg { /** QueryValidatorRequest is response type for the Query/Validator RPC method */ export interface QueryValidatorRequestAmino { /** validator_addr defines the validator address to query for. */ - validator_addr: string; + validator_addr?: string; } export interface QueryValidatorRequestAminoMsg { type: "cosmos-sdk/QueryValidatorRequest"; @@ -79,7 +79,7 @@ export interface QueryValidatorRequestSDKType { } /** QueryValidatorResponse is response type for the Query/Validator RPC method */ export interface QueryValidatorResponse { - /** validator defines the the validator info. */ + /** validator defines the validator info. */ validator: Validator; } export interface QueryValidatorResponseProtoMsg { @@ -88,8 +88,8 @@ export interface QueryValidatorResponseProtoMsg { } /** QueryValidatorResponse is response type for the Query/Validator RPC method */ export interface QueryValidatorResponseAmino { - /** validator defines the the validator info. */ - validator?: ValidatorAmino; + /** validator defines the validator info. */ + validator: ValidatorAmino; } export interface QueryValidatorResponseAminoMsg { type: "cosmos-sdk/QueryValidatorResponse"; @@ -107,7 +107,7 @@ export interface QueryValidatorDelegationsRequest { /** validator_addr defines the validator address to query for. */ validatorAddr: string; /** pagination defines an optional pagination for the request. */ - pagination: PageRequest; + pagination?: PageRequest; } export interface QueryValidatorDelegationsRequestProtoMsg { typeUrl: "/cosmos.staking.v1beta1.QueryValidatorDelegationsRequest"; @@ -119,7 +119,7 @@ export interface QueryValidatorDelegationsRequestProtoMsg { */ export interface QueryValidatorDelegationsRequestAmino { /** validator_addr defines the validator address to query for. */ - validator_addr: string; + validator_addr?: string; /** pagination defines an optional pagination for the request. */ pagination?: PageRequestAmino; } @@ -133,7 +133,7 @@ export interface QueryValidatorDelegationsRequestAminoMsg { */ export interface QueryValidatorDelegationsRequestSDKType { validator_addr: string; - pagination: PageRequestSDKType; + pagination?: PageRequestSDKType; } /** * QueryValidatorDelegationsResponse is response type for the @@ -142,7 +142,7 @@ export interface QueryValidatorDelegationsRequestSDKType { export interface QueryValidatorDelegationsResponse { delegationResponses: DelegationResponse[]; /** pagination defines the pagination in the response. */ - pagination: PageResponse; + pagination?: PageResponse; } export interface QueryValidatorDelegationsResponseProtoMsg { typeUrl: "/cosmos.staking.v1beta1.QueryValidatorDelegationsResponse"; @@ -167,7 +167,7 @@ export interface QueryValidatorDelegationsResponseAminoMsg { */ export interface QueryValidatorDelegationsResponseSDKType { delegation_responses: DelegationResponseSDKType[]; - pagination: PageResponseSDKType; + pagination?: PageResponseSDKType; } /** * QueryValidatorUnbondingDelegationsRequest is required type for the @@ -177,7 +177,7 @@ export interface QueryValidatorUnbondingDelegationsRequest { /** validator_addr defines the validator address to query for. */ validatorAddr: string; /** pagination defines an optional pagination for the request. */ - pagination: PageRequest; + pagination?: PageRequest; } export interface QueryValidatorUnbondingDelegationsRequestProtoMsg { typeUrl: "/cosmos.staking.v1beta1.QueryValidatorUnbondingDelegationsRequest"; @@ -189,7 +189,7 @@ export interface QueryValidatorUnbondingDelegationsRequestProtoMsg { */ export interface QueryValidatorUnbondingDelegationsRequestAmino { /** validator_addr defines the validator address to query for. */ - validator_addr: string; + validator_addr?: string; /** pagination defines an optional pagination for the request. */ pagination?: PageRequestAmino; } @@ -203,7 +203,7 @@ export interface QueryValidatorUnbondingDelegationsRequestAminoMsg { */ export interface QueryValidatorUnbondingDelegationsRequestSDKType { validator_addr: string; - pagination: PageRequestSDKType; + pagination?: PageRequestSDKType; } /** * QueryValidatorUnbondingDelegationsResponse is response type for the @@ -212,7 +212,7 @@ export interface QueryValidatorUnbondingDelegationsRequestSDKType { export interface QueryValidatorUnbondingDelegationsResponse { unbondingResponses: UnbondingDelegation[]; /** pagination defines the pagination in the response. */ - pagination: PageResponse; + pagination?: PageResponse; } export interface QueryValidatorUnbondingDelegationsResponseProtoMsg { typeUrl: "/cosmos.staking.v1beta1.QueryValidatorUnbondingDelegationsResponse"; @@ -237,7 +237,7 @@ export interface QueryValidatorUnbondingDelegationsResponseAminoMsg { */ export interface QueryValidatorUnbondingDelegationsResponseSDKType { unbonding_responses: UnbondingDelegationSDKType[]; - pagination: PageResponseSDKType; + pagination?: PageResponseSDKType; } /** QueryDelegationRequest is request type for the Query/Delegation RPC method. */ export interface QueryDelegationRequest { @@ -253,9 +253,9 @@ export interface QueryDelegationRequestProtoMsg { /** QueryDelegationRequest is request type for the Query/Delegation RPC method. */ export interface QueryDelegationRequestAmino { /** delegator_addr defines the delegator address to query for. */ - delegator_addr: string; + delegator_addr?: string; /** validator_addr defines the validator address to query for. */ - validator_addr: string; + validator_addr?: string; } export interface QueryDelegationRequestAminoMsg { type: "cosmos-sdk/QueryDelegationRequest"; @@ -269,7 +269,7 @@ export interface QueryDelegationRequestSDKType { /** 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; } export interface QueryDelegationResponseProtoMsg { typeUrl: "/cosmos.staking.v1beta1.QueryDelegationResponse"; @@ -286,7 +286,7 @@ export interface QueryDelegationResponseAminoMsg { } /** QueryDelegationResponse is response type for the Query/Delegation RPC method. */ export interface QueryDelegationResponseSDKType { - delegation_response: DelegationResponseSDKType; + delegation_response?: DelegationResponseSDKType; } /** * QueryUnbondingDelegationRequest is request type for the @@ -308,9 +308,9 @@ export interface QueryUnbondingDelegationRequestProtoMsg { */ export interface QueryUnbondingDelegationRequestAmino { /** delegator_addr defines the delegator address to query for. */ - delegator_addr: string; + delegator_addr?: string; /** validator_addr defines the validator address to query for. */ - validator_addr: string; + validator_addr?: string; } export interface QueryUnbondingDelegationRequestAminoMsg { type: "cosmos-sdk/QueryUnbondingDelegationRequest"; @@ -342,7 +342,7 @@ export interface QueryUnbondingDelegationResponseProtoMsg { */ export interface QueryUnbondingDelegationResponseAmino { /** unbond defines the unbonding information of a delegation. */ - unbond?: UnbondingDelegationAmino; + unbond: UnbondingDelegationAmino; } export interface QueryUnbondingDelegationResponseAminoMsg { type: "cosmos-sdk/QueryUnbondingDelegationResponse"; @@ -363,7 +363,7 @@ export interface QueryDelegatorDelegationsRequest { /** delegator_addr defines the delegator address to query for. */ delegatorAddr: string; /** pagination defines an optional pagination for the request. */ - pagination: PageRequest; + pagination?: PageRequest; } export interface QueryDelegatorDelegationsRequestProtoMsg { typeUrl: "/cosmos.staking.v1beta1.QueryDelegatorDelegationsRequest"; @@ -375,7 +375,7 @@ export interface QueryDelegatorDelegationsRequestProtoMsg { */ export interface QueryDelegatorDelegationsRequestAmino { /** delegator_addr defines the delegator address to query for. */ - delegator_addr: string; + delegator_addr?: string; /** pagination defines an optional pagination for the request. */ pagination?: PageRequestAmino; } @@ -389,7 +389,7 @@ export interface QueryDelegatorDelegationsRequestAminoMsg { */ export interface QueryDelegatorDelegationsRequestSDKType { delegator_addr: string; - pagination: PageRequestSDKType; + pagination?: PageRequestSDKType; } /** * QueryDelegatorDelegationsResponse is response type for the @@ -399,7 +399,7 @@ export interface QueryDelegatorDelegationsResponse { /** delegation_responses defines all the delegations' info of a delegator. */ delegationResponses: DelegationResponse[]; /** pagination defines the pagination in the response. */ - pagination: PageResponse; + pagination?: PageResponse; } export interface QueryDelegatorDelegationsResponseProtoMsg { typeUrl: "/cosmos.staking.v1beta1.QueryDelegatorDelegationsResponse"; @@ -425,7 +425,7 @@ export interface QueryDelegatorDelegationsResponseAminoMsg { */ export interface QueryDelegatorDelegationsResponseSDKType { delegation_responses: DelegationResponseSDKType[]; - pagination: PageResponseSDKType; + pagination?: PageResponseSDKType; } /** * QueryDelegatorUnbondingDelegationsRequest is request type for the @@ -435,7 +435,7 @@ export interface QueryDelegatorUnbondingDelegationsRequest { /** delegator_addr defines the delegator address to query for. */ delegatorAddr: string; /** pagination defines an optional pagination for the request. */ - pagination: PageRequest; + pagination?: PageRequest; } export interface QueryDelegatorUnbondingDelegationsRequestProtoMsg { typeUrl: "/cosmos.staking.v1beta1.QueryDelegatorUnbondingDelegationsRequest"; @@ -447,7 +447,7 @@ export interface QueryDelegatorUnbondingDelegationsRequestProtoMsg { */ export interface QueryDelegatorUnbondingDelegationsRequestAmino { /** delegator_addr defines the delegator address to query for. */ - delegator_addr: string; + delegator_addr?: string; /** pagination defines an optional pagination for the request. */ pagination?: PageRequestAmino; } @@ -461,7 +461,7 @@ export interface QueryDelegatorUnbondingDelegationsRequestAminoMsg { */ export interface QueryDelegatorUnbondingDelegationsRequestSDKType { delegator_addr: string; - pagination: PageRequestSDKType; + pagination?: PageRequestSDKType; } /** * QueryUnbondingDelegatorDelegationsResponse is response type for the @@ -470,7 +470,7 @@ export interface QueryDelegatorUnbondingDelegationsRequestSDKType { export interface QueryDelegatorUnbondingDelegationsResponse { unbondingResponses: UnbondingDelegation[]; /** pagination defines the pagination in the response. */ - pagination: PageResponse; + pagination?: PageResponse; } export interface QueryDelegatorUnbondingDelegationsResponseProtoMsg { typeUrl: "/cosmos.staking.v1beta1.QueryDelegatorUnbondingDelegationsResponse"; @@ -495,7 +495,7 @@ export interface QueryDelegatorUnbondingDelegationsResponseAminoMsg { */ export interface QueryDelegatorUnbondingDelegationsResponseSDKType { unbonding_responses: UnbondingDelegationSDKType[]; - pagination: PageResponseSDKType; + pagination?: PageResponseSDKType; } /** * QueryRedelegationsRequest is request type for the Query/Redelegations RPC @@ -509,7 +509,7 @@ export interface QueryRedelegationsRequest { /** dst_validator_addr defines the validator address to redelegate to. */ dstValidatorAddr: string; /** pagination defines an optional pagination for the request. */ - pagination: PageRequest; + pagination?: PageRequest; } export interface QueryRedelegationsRequestProtoMsg { typeUrl: "/cosmos.staking.v1beta1.QueryRedelegationsRequest"; @@ -521,11 +521,11 @@ export interface QueryRedelegationsRequestProtoMsg { */ export interface QueryRedelegationsRequestAmino { /** delegator_addr defines the delegator address to query for. */ - delegator_addr: string; + delegator_addr?: string; /** src_validator_addr defines the validator address to redelegate from. */ - src_validator_addr: string; + src_validator_addr?: string; /** dst_validator_addr defines the validator address to redelegate to. */ - dst_validator_addr: string; + dst_validator_addr?: string; /** pagination defines an optional pagination for the request. */ pagination?: PageRequestAmino; } @@ -541,7 +541,7 @@ export interface QueryRedelegationsRequestSDKType { delegator_addr: string; src_validator_addr: string; dst_validator_addr: string; - pagination: PageRequestSDKType; + pagination?: PageRequestSDKType; } /** * QueryRedelegationsResponse is response type for the Query/Redelegations RPC @@ -550,7 +550,7 @@ export interface QueryRedelegationsRequestSDKType { export interface QueryRedelegationsResponse { redelegationResponses: RedelegationResponse[]; /** pagination defines the pagination in the response. */ - pagination: PageResponse; + pagination?: PageResponse; } export interface QueryRedelegationsResponseProtoMsg { typeUrl: "/cosmos.staking.v1beta1.QueryRedelegationsResponse"; @@ -575,7 +575,7 @@ export interface QueryRedelegationsResponseAminoMsg { */ export interface QueryRedelegationsResponseSDKType { redelegation_responses: RedelegationResponseSDKType[]; - pagination: PageResponseSDKType; + pagination?: PageResponseSDKType; } /** * QueryDelegatorValidatorsRequest is request type for the @@ -585,7 +585,7 @@ export interface QueryDelegatorValidatorsRequest { /** delegator_addr defines the delegator address to query for. */ delegatorAddr: string; /** pagination defines an optional pagination for the request. */ - pagination: PageRequest; + pagination?: PageRequest; } export interface QueryDelegatorValidatorsRequestProtoMsg { typeUrl: "/cosmos.staking.v1beta1.QueryDelegatorValidatorsRequest"; @@ -597,7 +597,7 @@ export interface QueryDelegatorValidatorsRequestProtoMsg { */ export interface QueryDelegatorValidatorsRequestAmino { /** delegator_addr defines the delegator address to query for. */ - delegator_addr: string; + delegator_addr?: string; /** pagination defines an optional pagination for the request. */ pagination?: PageRequestAmino; } @@ -611,17 +611,17 @@ export interface QueryDelegatorValidatorsRequestAminoMsg { */ export interface QueryDelegatorValidatorsRequestSDKType { delegator_addr: string; - pagination: PageRequestSDKType; + pagination?: PageRequestSDKType; } /** * QueryDelegatorValidatorsResponse is response type for the * Query/DelegatorValidators RPC method. */ export interface QueryDelegatorValidatorsResponse { - /** validators defines the the validators' info of a delegator. */ + /** validators defines the validators' info of a delegator. */ validators: Validator[]; /** pagination defines the pagination in the response. */ - pagination: PageResponse; + pagination?: PageResponse; } export interface QueryDelegatorValidatorsResponseProtoMsg { typeUrl: "/cosmos.staking.v1beta1.QueryDelegatorValidatorsResponse"; @@ -632,7 +632,7 @@ export interface QueryDelegatorValidatorsResponseProtoMsg { * Query/DelegatorValidators RPC method. */ export interface QueryDelegatorValidatorsResponseAmino { - /** validators defines the the validators' info of a delegator. */ + /** validators defines the validators' info of a delegator. */ validators: ValidatorAmino[]; /** pagination defines the pagination in the response. */ pagination?: PageResponseAmino; @@ -647,7 +647,7 @@ export interface QueryDelegatorValidatorsResponseAminoMsg { */ export interface QueryDelegatorValidatorsResponseSDKType { validators: ValidatorSDKType[]; - pagination: PageResponseSDKType; + pagination?: PageResponseSDKType; } /** * QueryDelegatorValidatorRequest is request type for the @@ -669,9 +669,9 @@ export interface QueryDelegatorValidatorRequestProtoMsg { */ export interface QueryDelegatorValidatorRequestAmino { /** delegator_addr defines the delegator address to query for. */ - delegator_addr: string; + delegator_addr?: string; /** validator_addr defines the validator address to query for. */ - validator_addr: string; + validator_addr?: string; } export interface QueryDelegatorValidatorRequestAminoMsg { type: "cosmos-sdk/QueryDelegatorValidatorRequest"; @@ -690,7 +690,7 @@ export interface QueryDelegatorValidatorRequestSDKType { * Query/DelegatorValidator RPC method. */ export interface QueryDelegatorValidatorResponse { - /** validator defines the the validator info. */ + /** validator defines the validator info. */ validator: Validator; } export interface QueryDelegatorValidatorResponseProtoMsg { @@ -702,8 +702,8 @@ export interface QueryDelegatorValidatorResponseProtoMsg { * Query/DelegatorValidator RPC method. */ export interface QueryDelegatorValidatorResponseAmino { - /** validator defines the the validator info. */ - validator?: ValidatorAmino; + /** validator defines the validator info. */ + validator: ValidatorAmino; } export interface QueryDelegatorValidatorResponseAminoMsg { type: "cosmos-sdk/QueryDelegatorValidatorResponse"; @@ -734,7 +734,7 @@ export interface QueryHistoricalInfoRequestProtoMsg { */ export interface QueryHistoricalInfoRequestAmino { /** height defines at which height to query the historical info. */ - height: string; + height?: string; } export interface QueryHistoricalInfoRequestAminoMsg { type: "cosmos-sdk/QueryHistoricalInfoRequest"; @@ -753,7 +753,7 @@ export interface QueryHistoricalInfoRequestSDKType { */ export interface QueryHistoricalInfoResponse { /** hist defines the historical info at the given height. */ - hist: HistoricalInfo; + hist?: HistoricalInfo; } export interface QueryHistoricalInfoResponseProtoMsg { typeUrl: "/cosmos.staking.v1beta1.QueryHistoricalInfoResponse"; @@ -776,7 +776,7 @@ export interface QueryHistoricalInfoResponseAminoMsg { * method. */ export interface QueryHistoricalInfoResponseSDKType { - hist: HistoricalInfoSDKType; + hist?: HistoricalInfoSDKType; } /** QueryPoolRequest is request type for the Query/Pool RPC method. */ export interface QueryPoolRequest {} @@ -804,7 +804,7 @@ export interface QueryPoolResponseProtoMsg { /** QueryPoolResponse is response type for the Query/Pool RPC method. */ export interface QueryPoolResponseAmino { /** pool defines the pool info. */ - pool?: PoolAmino; + pool: PoolAmino; } export interface QueryPoolResponseAminoMsg { type: "cosmos-sdk/QueryPoolResponse"; @@ -840,7 +840,7 @@ export interface QueryParamsResponseProtoMsg { /** QueryParamsResponse is response type for the Query/Params RPC method. */ export interface QueryParamsResponseAmino { /** params holds all the parameters of this module. */ - params?: ParamsAmino; + params: ParamsAmino; } export interface QueryParamsResponseAminoMsg { type: "cosmos-sdk/QueryParamsResponse"; @@ -853,7 +853,7 @@ export interface QueryParamsResponseSDKType { function createBaseQueryValidatorsRequest(): QueryValidatorsRequest { return { status: "", - pagination: PageRequest.fromPartial({}) + pagination: undefined }; } export const QueryValidatorsRequest = { @@ -894,10 +894,14 @@ export const QueryValidatorsRequest = { return message; }, fromAmino(object: QueryValidatorsRequestAmino): QueryValidatorsRequest { - return { - status: object.status, - pagination: object?.pagination ? PageRequest.fromAmino(object.pagination) : undefined - }; + const message = createBaseQueryValidatorsRequest(); + if (object.status !== undefined && object.status !== null) { + message.status = object.status; + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromAmino(object.pagination); + } + return message; }, toAmino(message: QueryValidatorsRequest): QueryValidatorsRequestAmino { const obj: any = {}; @@ -930,7 +934,7 @@ export const QueryValidatorsRequest = { function createBaseQueryValidatorsResponse(): QueryValidatorsResponse { return { validators: [], - pagination: PageResponse.fromPartial({}) + pagination: undefined }; } export const QueryValidatorsResponse = { @@ -971,10 +975,12 @@ export const QueryValidatorsResponse = { return message; }, fromAmino(object: QueryValidatorsResponseAmino): QueryValidatorsResponse { - return { - validators: Array.isArray(object?.validators) ? object.validators.map((e: any) => Validator.fromAmino(e)) : [], - pagination: object?.pagination ? PageResponse.fromAmino(object.pagination) : undefined - }; + const message = createBaseQueryValidatorsResponse(); + message.validators = object.validators?.map(e => Validator.fromAmino(e)) || []; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromAmino(object.pagination); + } + return message; }, toAmino(message: QueryValidatorsResponse): QueryValidatorsResponseAmino { const obj: any = {}; @@ -1044,9 +1050,11 @@ export const QueryValidatorRequest = { return message; }, fromAmino(object: QueryValidatorRequestAmino): QueryValidatorRequest { - return { - validatorAddr: object.validator_addr - }; + const message = createBaseQueryValidatorRequest(); + if (object.validator_addr !== undefined && object.validator_addr !== null) { + message.validatorAddr = object.validator_addr; + } + return message; }, toAmino(message: QueryValidatorRequest): QueryValidatorRequestAmino { const obj: any = {}; @@ -1111,13 +1119,15 @@ export const QueryValidatorResponse = { return message; }, fromAmino(object: QueryValidatorResponseAmino): QueryValidatorResponse { - return { - validator: object?.validator ? Validator.fromAmino(object.validator) : undefined - }; + const message = createBaseQueryValidatorResponse(); + if (object.validator !== undefined && object.validator !== null) { + message.validator = Validator.fromAmino(object.validator); + } + return message; }, toAmino(message: QueryValidatorResponse): QueryValidatorResponseAmino { const obj: any = {}; - obj.validator = message.validator ? Validator.toAmino(message.validator) : undefined; + obj.validator = message.validator ? Validator.toAmino(message.validator) : Validator.fromPartial({}); return obj; }, fromAminoMsg(object: QueryValidatorResponseAminoMsg): QueryValidatorResponse { @@ -1145,7 +1155,7 @@ export const QueryValidatorResponse = { function createBaseQueryValidatorDelegationsRequest(): QueryValidatorDelegationsRequest { return { validatorAddr: "", - pagination: PageRequest.fromPartial({}) + pagination: undefined }; } export const QueryValidatorDelegationsRequest = { @@ -1186,10 +1196,14 @@ export const QueryValidatorDelegationsRequest = { return message; }, fromAmino(object: QueryValidatorDelegationsRequestAmino): QueryValidatorDelegationsRequest { - return { - validatorAddr: object.validator_addr, - pagination: object?.pagination ? PageRequest.fromAmino(object.pagination) : undefined - }; + const message = createBaseQueryValidatorDelegationsRequest(); + if (object.validator_addr !== undefined && object.validator_addr !== null) { + message.validatorAddr = object.validator_addr; + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromAmino(object.pagination); + } + return message; }, toAmino(message: QueryValidatorDelegationsRequest): QueryValidatorDelegationsRequestAmino { const obj: any = {}; @@ -1222,7 +1236,7 @@ export const QueryValidatorDelegationsRequest = { function createBaseQueryValidatorDelegationsResponse(): QueryValidatorDelegationsResponse { return { delegationResponses: [], - pagination: PageResponse.fromPartial({}) + pagination: undefined }; } export const QueryValidatorDelegationsResponse = { @@ -1263,10 +1277,12 @@ export const QueryValidatorDelegationsResponse = { return message; }, fromAmino(object: QueryValidatorDelegationsResponseAmino): QueryValidatorDelegationsResponse { - return { - delegationResponses: Array.isArray(object?.delegation_responses) ? object.delegation_responses.map((e: any) => DelegationResponse.fromAmino(e)) : [], - pagination: object?.pagination ? PageResponse.fromAmino(object.pagination) : undefined - }; + const message = createBaseQueryValidatorDelegationsResponse(); + message.delegationResponses = object.delegation_responses?.map(e => DelegationResponse.fromAmino(e)) || []; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromAmino(object.pagination); + } + return message; }, toAmino(message: QueryValidatorDelegationsResponse): QueryValidatorDelegationsResponseAmino { const obj: any = {}; @@ -1303,7 +1319,7 @@ export const QueryValidatorDelegationsResponse = { function createBaseQueryValidatorUnbondingDelegationsRequest(): QueryValidatorUnbondingDelegationsRequest { return { validatorAddr: "", - pagination: PageRequest.fromPartial({}) + pagination: undefined }; } export const QueryValidatorUnbondingDelegationsRequest = { @@ -1344,10 +1360,14 @@ export const QueryValidatorUnbondingDelegationsRequest = { return message; }, fromAmino(object: QueryValidatorUnbondingDelegationsRequestAmino): QueryValidatorUnbondingDelegationsRequest { - return { - validatorAddr: object.validator_addr, - pagination: object?.pagination ? PageRequest.fromAmino(object.pagination) : undefined - }; + const message = createBaseQueryValidatorUnbondingDelegationsRequest(); + if (object.validator_addr !== undefined && object.validator_addr !== null) { + message.validatorAddr = object.validator_addr; + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromAmino(object.pagination); + } + return message; }, toAmino(message: QueryValidatorUnbondingDelegationsRequest): QueryValidatorUnbondingDelegationsRequestAmino { const obj: any = {}; @@ -1380,7 +1400,7 @@ export const QueryValidatorUnbondingDelegationsRequest = { function createBaseQueryValidatorUnbondingDelegationsResponse(): QueryValidatorUnbondingDelegationsResponse { return { unbondingResponses: [], - pagination: PageResponse.fromPartial({}) + pagination: undefined }; } export const QueryValidatorUnbondingDelegationsResponse = { @@ -1421,10 +1441,12 @@ export const QueryValidatorUnbondingDelegationsResponse = { return message; }, fromAmino(object: QueryValidatorUnbondingDelegationsResponseAmino): QueryValidatorUnbondingDelegationsResponse { - return { - unbondingResponses: Array.isArray(object?.unbonding_responses) ? object.unbonding_responses.map((e: any) => UnbondingDelegation.fromAmino(e)) : [], - pagination: object?.pagination ? PageResponse.fromAmino(object.pagination) : undefined - }; + const message = createBaseQueryValidatorUnbondingDelegationsResponse(); + message.unbondingResponses = object.unbonding_responses?.map(e => UnbondingDelegation.fromAmino(e)) || []; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromAmino(object.pagination); + } + return message; }, toAmino(message: QueryValidatorUnbondingDelegationsResponse): QueryValidatorUnbondingDelegationsResponseAmino { const obj: any = {}; @@ -1502,10 +1524,14 @@ export const QueryDelegationRequest = { return message; }, fromAmino(object: QueryDelegationRequestAmino): QueryDelegationRequest { - return { - delegatorAddr: object.delegator_addr, - validatorAddr: object.validator_addr - }; + const message = createBaseQueryDelegationRequest(); + if (object.delegator_addr !== undefined && object.delegator_addr !== null) { + message.delegatorAddr = object.delegator_addr; + } + if (object.validator_addr !== undefined && object.validator_addr !== null) { + message.validatorAddr = object.validator_addr; + } + return message; }, toAmino(message: QueryDelegationRequest): QueryDelegationRequestAmino { const obj: any = {}; @@ -1537,7 +1563,7 @@ export const QueryDelegationRequest = { }; function createBaseQueryDelegationResponse(): QueryDelegationResponse { return { - delegationResponse: DelegationResponse.fromPartial({}) + delegationResponse: undefined }; } export const QueryDelegationResponse = { @@ -1571,9 +1597,11 @@ export const QueryDelegationResponse = { return message; }, fromAmino(object: QueryDelegationResponseAmino): QueryDelegationResponse { - return { - delegationResponse: object?.delegation_response ? DelegationResponse.fromAmino(object.delegation_response) : undefined - }; + const message = createBaseQueryDelegationResponse(); + if (object.delegation_response !== undefined && object.delegation_response !== null) { + message.delegationResponse = DelegationResponse.fromAmino(object.delegation_response); + } + return message; }, toAmino(message: QueryDelegationResponse): QueryDelegationResponseAmino { const obj: any = {}; @@ -1646,10 +1674,14 @@ export const QueryUnbondingDelegationRequest = { return message; }, fromAmino(object: QueryUnbondingDelegationRequestAmino): QueryUnbondingDelegationRequest { - return { - delegatorAddr: object.delegator_addr, - validatorAddr: object.validator_addr - }; + const message = createBaseQueryUnbondingDelegationRequest(); + if (object.delegator_addr !== undefined && object.delegator_addr !== null) { + message.delegatorAddr = object.delegator_addr; + } + if (object.validator_addr !== undefined && object.validator_addr !== null) { + message.validatorAddr = object.validator_addr; + } + return message; }, toAmino(message: QueryUnbondingDelegationRequest): QueryUnbondingDelegationRequestAmino { const obj: any = {}; @@ -1715,13 +1747,15 @@ export const QueryUnbondingDelegationResponse = { return message; }, fromAmino(object: QueryUnbondingDelegationResponseAmino): QueryUnbondingDelegationResponse { - return { - unbond: object?.unbond ? UnbondingDelegation.fromAmino(object.unbond) : undefined - }; + const message = createBaseQueryUnbondingDelegationResponse(); + if (object.unbond !== undefined && object.unbond !== null) { + message.unbond = UnbondingDelegation.fromAmino(object.unbond); + } + return message; }, toAmino(message: QueryUnbondingDelegationResponse): QueryUnbondingDelegationResponseAmino { const obj: any = {}; - obj.unbond = message.unbond ? UnbondingDelegation.toAmino(message.unbond) : undefined; + obj.unbond = message.unbond ? UnbondingDelegation.toAmino(message.unbond) : UnbondingDelegation.fromPartial({}); return obj; }, fromAminoMsg(object: QueryUnbondingDelegationResponseAminoMsg): QueryUnbondingDelegationResponse { @@ -1749,7 +1783,7 @@ export const QueryUnbondingDelegationResponse = { function createBaseQueryDelegatorDelegationsRequest(): QueryDelegatorDelegationsRequest { return { delegatorAddr: "", - pagination: PageRequest.fromPartial({}) + pagination: undefined }; } export const QueryDelegatorDelegationsRequest = { @@ -1790,10 +1824,14 @@ export const QueryDelegatorDelegationsRequest = { return message; }, fromAmino(object: QueryDelegatorDelegationsRequestAmino): QueryDelegatorDelegationsRequest { - return { - delegatorAddr: object.delegator_addr, - pagination: object?.pagination ? PageRequest.fromAmino(object.pagination) : undefined - }; + const message = createBaseQueryDelegatorDelegationsRequest(); + if (object.delegator_addr !== undefined && object.delegator_addr !== null) { + message.delegatorAddr = object.delegator_addr; + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromAmino(object.pagination); + } + return message; }, toAmino(message: QueryDelegatorDelegationsRequest): QueryDelegatorDelegationsRequestAmino { const obj: any = {}; @@ -1826,7 +1864,7 @@ export const QueryDelegatorDelegationsRequest = { function createBaseQueryDelegatorDelegationsResponse(): QueryDelegatorDelegationsResponse { return { delegationResponses: [], - pagination: PageResponse.fromPartial({}) + pagination: undefined }; } export const QueryDelegatorDelegationsResponse = { @@ -1867,10 +1905,12 @@ export const QueryDelegatorDelegationsResponse = { return message; }, fromAmino(object: QueryDelegatorDelegationsResponseAmino): QueryDelegatorDelegationsResponse { - return { - delegationResponses: Array.isArray(object?.delegation_responses) ? object.delegation_responses.map((e: any) => DelegationResponse.fromAmino(e)) : [], - pagination: object?.pagination ? PageResponse.fromAmino(object.pagination) : undefined - }; + const message = createBaseQueryDelegatorDelegationsResponse(); + message.delegationResponses = object.delegation_responses?.map(e => DelegationResponse.fromAmino(e)) || []; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromAmino(object.pagination); + } + return message; }, toAmino(message: QueryDelegatorDelegationsResponse): QueryDelegatorDelegationsResponseAmino { const obj: any = {}; @@ -1907,7 +1947,7 @@ export const QueryDelegatorDelegationsResponse = { function createBaseQueryDelegatorUnbondingDelegationsRequest(): QueryDelegatorUnbondingDelegationsRequest { return { delegatorAddr: "", - pagination: PageRequest.fromPartial({}) + pagination: undefined }; } export const QueryDelegatorUnbondingDelegationsRequest = { @@ -1948,10 +1988,14 @@ export const QueryDelegatorUnbondingDelegationsRequest = { return message; }, fromAmino(object: QueryDelegatorUnbondingDelegationsRequestAmino): QueryDelegatorUnbondingDelegationsRequest { - return { - delegatorAddr: object.delegator_addr, - pagination: object?.pagination ? PageRequest.fromAmino(object.pagination) : undefined - }; + const message = createBaseQueryDelegatorUnbondingDelegationsRequest(); + if (object.delegator_addr !== undefined && object.delegator_addr !== null) { + message.delegatorAddr = object.delegator_addr; + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromAmino(object.pagination); + } + return message; }, toAmino(message: QueryDelegatorUnbondingDelegationsRequest): QueryDelegatorUnbondingDelegationsRequestAmino { const obj: any = {}; @@ -1984,7 +2028,7 @@ export const QueryDelegatorUnbondingDelegationsRequest = { function createBaseQueryDelegatorUnbondingDelegationsResponse(): QueryDelegatorUnbondingDelegationsResponse { return { unbondingResponses: [], - pagination: PageResponse.fromPartial({}) + pagination: undefined }; } export const QueryDelegatorUnbondingDelegationsResponse = { @@ -2025,10 +2069,12 @@ export const QueryDelegatorUnbondingDelegationsResponse = { return message; }, fromAmino(object: QueryDelegatorUnbondingDelegationsResponseAmino): QueryDelegatorUnbondingDelegationsResponse { - return { - unbondingResponses: Array.isArray(object?.unbonding_responses) ? object.unbonding_responses.map((e: any) => UnbondingDelegation.fromAmino(e)) : [], - pagination: object?.pagination ? PageResponse.fromAmino(object.pagination) : undefined - }; + const message = createBaseQueryDelegatorUnbondingDelegationsResponse(); + message.unbondingResponses = object.unbonding_responses?.map(e => UnbondingDelegation.fromAmino(e)) || []; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromAmino(object.pagination); + } + return message; }, toAmino(message: QueryDelegatorUnbondingDelegationsResponse): QueryDelegatorUnbondingDelegationsResponseAmino { const obj: any = {}; @@ -2067,7 +2113,7 @@ function createBaseQueryRedelegationsRequest(): QueryRedelegationsRequest { delegatorAddr: "", srcValidatorAddr: "", dstValidatorAddr: "", - pagination: PageRequest.fromPartial({}) + pagination: undefined }; } export const QueryRedelegationsRequest = { @@ -2122,12 +2168,20 @@ export const QueryRedelegationsRequest = { return message; }, fromAmino(object: QueryRedelegationsRequestAmino): QueryRedelegationsRequest { - return { - delegatorAddr: object.delegator_addr, - srcValidatorAddr: object.src_validator_addr, - dstValidatorAddr: object.dst_validator_addr, - pagination: object?.pagination ? PageRequest.fromAmino(object.pagination) : undefined - }; + const message = createBaseQueryRedelegationsRequest(); + if (object.delegator_addr !== undefined && object.delegator_addr !== null) { + message.delegatorAddr = object.delegator_addr; + } + if (object.src_validator_addr !== undefined && object.src_validator_addr !== null) { + message.srcValidatorAddr = object.src_validator_addr; + } + if (object.dst_validator_addr !== undefined && object.dst_validator_addr !== null) { + message.dstValidatorAddr = object.dst_validator_addr; + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromAmino(object.pagination); + } + return message; }, toAmino(message: QueryRedelegationsRequest): QueryRedelegationsRequestAmino { const obj: any = {}; @@ -2162,7 +2216,7 @@ export const QueryRedelegationsRequest = { function createBaseQueryRedelegationsResponse(): QueryRedelegationsResponse { return { redelegationResponses: [], - pagination: PageResponse.fromPartial({}) + pagination: undefined }; } export const QueryRedelegationsResponse = { @@ -2203,10 +2257,12 @@ export const QueryRedelegationsResponse = { return message; }, fromAmino(object: QueryRedelegationsResponseAmino): QueryRedelegationsResponse { - return { - redelegationResponses: Array.isArray(object?.redelegation_responses) ? object.redelegation_responses.map((e: any) => RedelegationResponse.fromAmino(e)) : [], - pagination: object?.pagination ? PageResponse.fromAmino(object.pagination) : undefined - }; + const message = createBaseQueryRedelegationsResponse(); + message.redelegationResponses = object.redelegation_responses?.map(e => RedelegationResponse.fromAmino(e)) || []; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromAmino(object.pagination); + } + return message; }, toAmino(message: QueryRedelegationsResponse): QueryRedelegationsResponseAmino { const obj: any = {}; @@ -2243,7 +2299,7 @@ export const QueryRedelegationsResponse = { function createBaseQueryDelegatorValidatorsRequest(): QueryDelegatorValidatorsRequest { return { delegatorAddr: "", - pagination: PageRequest.fromPartial({}) + pagination: undefined }; } export const QueryDelegatorValidatorsRequest = { @@ -2284,10 +2340,14 @@ export const QueryDelegatorValidatorsRequest = { return message; }, fromAmino(object: QueryDelegatorValidatorsRequestAmino): QueryDelegatorValidatorsRequest { - return { - delegatorAddr: object.delegator_addr, - pagination: object?.pagination ? PageRequest.fromAmino(object.pagination) : undefined - }; + const message = createBaseQueryDelegatorValidatorsRequest(); + if (object.delegator_addr !== undefined && object.delegator_addr !== null) { + message.delegatorAddr = object.delegator_addr; + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromAmino(object.pagination); + } + return message; }, toAmino(message: QueryDelegatorValidatorsRequest): QueryDelegatorValidatorsRequestAmino { const obj: any = {}; @@ -2320,7 +2380,7 @@ export const QueryDelegatorValidatorsRequest = { function createBaseQueryDelegatorValidatorsResponse(): QueryDelegatorValidatorsResponse { return { validators: [], - pagination: PageResponse.fromPartial({}) + pagination: undefined }; } export const QueryDelegatorValidatorsResponse = { @@ -2361,10 +2421,12 @@ export const QueryDelegatorValidatorsResponse = { return message; }, fromAmino(object: QueryDelegatorValidatorsResponseAmino): QueryDelegatorValidatorsResponse { - return { - validators: Array.isArray(object?.validators) ? object.validators.map((e: any) => Validator.fromAmino(e)) : [], - pagination: object?.pagination ? PageResponse.fromAmino(object.pagination) : undefined - }; + const message = createBaseQueryDelegatorValidatorsResponse(); + message.validators = object.validators?.map(e => Validator.fromAmino(e)) || []; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromAmino(object.pagination); + } + return message; }, toAmino(message: QueryDelegatorValidatorsResponse): QueryDelegatorValidatorsResponseAmino { const obj: any = {}; @@ -2442,10 +2504,14 @@ export const QueryDelegatorValidatorRequest = { return message; }, fromAmino(object: QueryDelegatorValidatorRequestAmino): QueryDelegatorValidatorRequest { - return { - delegatorAddr: object.delegator_addr, - validatorAddr: object.validator_addr - }; + const message = createBaseQueryDelegatorValidatorRequest(); + if (object.delegator_addr !== undefined && object.delegator_addr !== null) { + message.delegatorAddr = object.delegator_addr; + } + if (object.validator_addr !== undefined && object.validator_addr !== null) { + message.validatorAddr = object.validator_addr; + } + return message; }, toAmino(message: QueryDelegatorValidatorRequest): QueryDelegatorValidatorRequestAmino { const obj: any = {}; @@ -2511,13 +2577,15 @@ export const QueryDelegatorValidatorResponse = { return message; }, fromAmino(object: QueryDelegatorValidatorResponseAmino): QueryDelegatorValidatorResponse { - return { - validator: object?.validator ? Validator.fromAmino(object.validator) : undefined - }; + const message = createBaseQueryDelegatorValidatorResponse(); + if (object.validator !== undefined && object.validator !== null) { + message.validator = Validator.fromAmino(object.validator); + } + return message; }, toAmino(message: QueryDelegatorValidatorResponse): QueryDelegatorValidatorResponseAmino { const obj: any = {}; - obj.validator = message.validator ? Validator.toAmino(message.validator) : undefined; + obj.validator = message.validator ? Validator.toAmino(message.validator) : Validator.fromPartial({}); return obj; }, fromAminoMsg(object: QueryDelegatorValidatorResponseAminoMsg): QueryDelegatorValidatorResponse { @@ -2578,9 +2646,11 @@ export const QueryHistoricalInfoRequest = { return message; }, fromAmino(object: QueryHistoricalInfoRequestAmino): QueryHistoricalInfoRequest { - return { - height: BigInt(object.height) - }; + const message = createBaseQueryHistoricalInfoRequest(); + if (object.height !== undefined && object.height !== null) { + message.height = BigInt(object.height); + } + return message; }, toAmino(message: QueryHistoricalInfoRequest): QueryHistoricalInfoRequestAmino { const obj: any = {}; @@ -2611,7 +2681,7 @@ export const QueryHistoricalInfoRequest = { }; function createBaseQueryHistoricalInfoResponse(): QueryHistoricalInfoResponse { return { - hist: HistoricalInfo.fromPartial({}) + hist: undefined }; } export const QueryHistoricalInfoResponse = { @@ -2645,9 +2715,11 @@ export const QueryHistoricalInfoResponse = { return message; }, fromAmino(object: QueryHistoricalInfoResponseAmino): QueryHistoricalInfoResponse { - return { - hist: object?.hist ? HistoricalInfo.fromAmino(object.hist) : undefined - }; + const message = createBaseQueryHistoricalInfoResponse(); + if (object.hist !== undefined && object.hist !== null) { + message.hist = HistoricalInfo.fromAmino(object.hist); + } + return message; }, toAmino(message: QueryHistoricalInfoResponse): QueryHistoricalInfoResponseAmino { const obj: any = {}; @@ -2703,7 +2775,8 @@ export const QueryPoolRequest = { return message; }, fromAmino(_: QueryPoolRequestAmino): QueryPoolRequest { - return {}; + const message = createBaseQueryPoolRequest(); + return message; }, toAmino(_: QueryPoolRequest): QueryPoolRequestAmino { const obj: any = {}; @@ -2767,13 +2840,15 @@ export const QueryPoolResponse = { return message; }, fromAmino(object: QueryPoolResponseAmino): QueryPoolResponse { - return { - pool: object?.pool ? Pool.fromAmino(object.pool) : undefined - }; + const message = createBaseQueryPoolResponse(); + if (object.pool !== undefined && object.pool !== null) { + message.pool = Pool.fromAmino(object.pool); + } + return message; }, toAmino(message: QueryPoolResponse): QueryPoolResponseAmino { const obj: any = {}; - obj.pool = message.pool ? Pool.toAmino(message.pool) : undefined; + obj.pool = message.pool ? Pool.toAmino(message.pool) : Pool.fromPartial({}); return obj; }, fromAminoMsg(object: QueryPoolResponseAminoMsg): QueryPoolResponse { @@ -2825,7 +2900,8 @@ export const QueryParamsRequest = { return message; }, fromAmino(_: QueryParamsRequestAmino): QueryParamsRequest { - return {}; + const message = createBaseQueryParamsRequest(); + return message; }, toAmino(_: QueryParamsRequest): QueryParamsRequestAmino { const obj: any = {}; @@ -2889,13 +2965,15 @@ export const QueryParamsResponse = { return message; }, fromAmino(object: QueryParamsResponseAmino): QueryParamsResponse { - return { - params: object?.params ? Params.fromAmino(object.params) : undefined - }; + const message = createBaseQueryParamsResponse(); + if (object.params !== undefined && object.params !== null) { + message.params = Params.fromAmino(object.params); + } + return message; }, toAmino(message: QueryParamsResponse): QueryParamsResponseAmino { const obj: any = {}; - obj.params = message.params ? Params.toAmino(message.params) : undefined; + obj.params = message.params ? Params.toAmino(message.params) : Params.fromPartial({}); return obj; }, fromAminoMsg(object: QueryParamsResponseAminoMsg): QueryParamsResponse { diff --git a/packages/osmo-query/src/codegen/cosmos/staking/v1beta1/staking.ts b/packages/osmo-query/src/codegen/cosmos/staking/v1beta1/staking.ts index e0b5e8967..cbc9ec7b2 100644 --- a/packages/osmo-query/src/codegen/cosmos/staking/v1beta1/staking.ts +++ b/packages/osmo-query/src/codegen/cosmos/staking/v1beta1/staking.ts @@ -3,11 +3,12 @@ import { Timestamp } from "../../../google/protobuf/timestamp"; import { Any, AnyProtoMsg, AnyAmino, AnySDKType } from "../../../google/protobuf/any"; import { Duration, DurationAmino, DurationSDKType } from "../../../google/protobuf/duration"; import { Coin, CoinAmino, CoinSDKType } from "../../base/v1beta1/coin"; +import { ValidatorUpdate, ValidatorUpdateAmino, ValidatorUpdateSDKType } from "../../../tendermint/abci/types"; import { BinaryReader, BinaryWriter } from "../../../binary"; import { Decimal } from "@cosmjs/math"; -import { toTimestamp, fromTimestamp, isSet } from "../../../helpers"; -import { toBase64, fromBase64 } from "@cosmjs/encoding"; -import { encodeBech32Pubkey, decodeBech32Pubkey } from "@cosmjs/amino"; +import { toTimestamp, fromTimestamp } from "../../../helpers"; +import { encodePubkey, decodePubkey } from "@cosmjs/proto-signing"; +import { Pubkey } from "@cosmjs/amino"; /** BondStatus is the status of a validator. */ export enum BondStatus { /** BOND_STATUS_UNSPECIFIED - UNSPECIFIED defines an invalid validator status. */ @@ -57,6 +58,48 @@ export function bondStatusToJSON(object: BondStatus): string { return "UNRECOGNIZED"; } } +/** Infraction indicates the infraction a validator commited. */ +export enum Infraction { + /** INFRACTION_UNSPECIFIED - UNSPECIFIED defines an empty infraction. */ + INFRACTION_UNSPECIFIED = 0, + /** INFRACTION_DOUBLE_SIGN - DOUBLE_SIGN defines a validator that double-signs a block. */ + INFRACTION_DOUBLE_SIGN = 1, + /** INFRACTION_DOWNTIME - DOWNTIME defines a validator that missed signing too many blocks. */ + INFRACTION_DOWNTIME = 2, + UNRECOGNIZED = -1, +} +export const InfractionSDKType = Infraction; +export const InfractionAmino = Infraction; +export function infractionFromJSON(object: any): Infraction { + switch (object) { + case 0: + case "INFRACTION_UNSPECIFIED": + return Infraction.INFRACTION_UNSPECIFIED; + case 1: + case "INFRACTION_DOUBLE_SIGN": + return Infraction.INFRACTION_DOUBLE_SIGN; + case 2: + case "INFRACTION_DOWNTIME": + return Infraction.INFRACTION_DOWNTIME; + case -1: + case "UNRECOGNIZED": + default: + return Infraction.UNRECOGNIZED; + } +} +export function infractionToJSON(object: Infraction): string { + switch (object) { + case Infraction.INFRACTION_UNSPECIFIED: + return "INFRACTION_UNSPECIFIED"; + case Infraction.INFRACTION_DOUBLE_SIGN: + return "INFRACTION_DOUBLE_SIGN"; + case Infraction.INFRACTION_DOWNTIME: + return "INFRACTION_DOWNTIME"; + case Infraction.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} /** * HistoricalInfo contains header and validator information for a given block. * It is stored as part of staking module's state, which persists the `n` most @@ -78,7 +121,7 @@ export interface HistoricalInfoProtoMsg { * (`n` is set by the staking module's `historical_entries` parameter). */ export interface HistoricalInfoAmino { - header?: HeaderAmino; + header: HeaderAmino; valset: ValidatorAmino[]; } export interface HistoricalInfoAminoMsg { @@ -117,11 +160,11 @@ export interface CommissionRatesProtoMsg { */ export interface CommissionRatesAmino { /** 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. */ - max_rate: string; + max_rate?: string; /** max_change_rate defines the maximum daily increase of the validator commission, as a fraction. */ - max_change_rate: string; + max_change_rate?: string; } export interface CommissionRatesAminoMsg { type: "cosmos-sdk/CommissionRates"; @@ -150,9 +193,9 @@ export interface CommissionProtoMsg { /** Commission defines commission parameters for a given validator. */ export interface CommissionAmino { /** commission_rates defines the initial commission rates to be used for creating a validator. */ - commission_rates?: CommissionRatesAmino; + commission_rates: CommissionRatesAmino; /** update_time is the last time the commission rate was changed. */ - update_time?: Date; + update_time: string; } export interface CommissionAminoMsg { type: "cosmos-sdk/Commission"; @@ -183,15 +226,15 @@ export interface DescriptionProtoMsg { /** Description defines a validator description. */ export interface DescriptionAmino { /** 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. */ - security_contact: string; + security_contact?: string; /** details define other optional details. */ - details: string; + details?: string; } export interface DescriptionAminoMsg { type: "cosmos-sdk/Description"; @@ -219,7 +262,7 @@ export interface Validator { /** operator_address defines the address of the validator's operator; bech encoded in JSON. */ operatorAddress: string; /** consensus_pubkey is the consensus public key of the validator, as a Protobuf Any. */ - consensusPubkey: (Any) | undefined; + consensusPubkey?: (Any) | undefined; /** jailed defined whether the validator has been jailed from bonded status or not. */ jailed: boolean; /** status is the validator status (bonded/unbonding/unbonded). */ @@ -236,8 +279,16 @@ export interface Validator { unbondingTime: Date; /** commission defines the commission parameters. */ commission: Commission; - /** min_self_delegation is the validator's self declared minimum self delegation. */ + /** + * min_self_delegation is the validator's self declared minimum self delegation. + * + * Since: cosmos-sdk 0.46 + */ minSelfDelegation: string; + /** strictly positive if this validator's unbonding has been stopped by external modules */ + unbondingOnHoldRefCount: bigint; + /** list of unbonding ids, each uniquely identifing an unbonding of this validator */ + unbondingIds: bigint[]; } export interface ValidatorProtoMsg { typeUrl: "/cosmos.staking.v1beta1.Validator"; @@ -258,27 +309,35 @@ export type ValidatorEncoded = Omit & { */ export interface ValidatorAmino { /** operator_address defines the address of the validator's operator; bech encoded in JSON. */ - operator_address: string; + operator_address?: string; /** consensus_pubkey is the consensus public key of the validator, as a Protobuf Any. */ consensus_pubkey?: AnyAmino; /** 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. */ - delegator_shares: string; + delegator_shares?: string; /** description defines the description terms for the validator. */ - description?: DescriptionAmino; + description: DescriptionAmino; /** unbonding_height defines, if unbonding, the height at which this validator has begun unbonding. */ - unbonding_height: string; + unbonding_height?: string; /** unbonding_time defines, if unbonding, the min time for the validator to complete unbonding. */ - unbonding_time?: Date; + unbonding_time: string; /** commission defines the commission parameters. */ - commission?: CommissionAmino; - /** min_self_delegation is the validator's self declared minimum self delegation. */ - min_self_delegation: string; + commission: CommissionAmino; + /** + * min_self_delegation is the validator's self declared minimum self delegation. + * + * Since: cosmos-sdk 0.46 + */ + min_self_delegation?: string; + /** strictly positive if this validator's unbonding has been stopped by external modules */ + unbonding_on_hold_ref_count?: string; + /** list of unbonding ids, each uniquely identifing an unbonding of this validator */ + unbonding_ids?: string[]; } export interface ValidatorAminoMsg { type: "cosmos-sdk/Validator"; @@ -296,7 +355,7 @@ export interface ValidatorAminoMsg { */ export interface ValidatorSDKType { operator_address: string; - consensus_pubkey: AnySDKType | undefined; + consensus_pubkey?: AnySDKType | undefined; jailed: boolean; status: BondStatus; tokens: string; @@ -306,6 +365,8 @@ export interface ValidatorSDKType { unbonding_time: Date; commission: CommissionSDKType; min_self_delegation: string; + unbonding_on_hold_ref_count: bigint; + unbonding_ids: bigint[]; } /** ValAddresses defines a repeated set of validator addresses. */ export interface ValAddresses { @@ -317,7 +378,7 @@ export interface ValAddressesProtoMsg { } /** ValAddresses defines a repeated set of validator addresses. */ export interface ValAddressesAmino { - addresses: string[]; + addresses?: string[]; } export interface ValAddressesAminoMsg { type: "cosmos-sdk/ValAddresses"; @@ -346,8 +407,8 @@ export interface DVPairProtoMsg { * be used to construct the key to getting an UnbondingDelegation from state. */ export interface DVPairAmino { - delegator_address: string; - validator_address: string; + delegator_address?: string; + validator_address?: string; } export interface DVPairAminoMsg { type: "cosmos-sdk/DVPair"; @@ -404,9 +465,9 @@ export interface DVVTripletProtoMsg { * Redelegation from state. */ export interface DVVTripletAmino { - delegator_address: string; - validator_src_address: string; - validator_dst_address: string; + delegator_address?: string; + validator_src_address?: string; + validator_dst_address?: string; } export interface DVVTripletAminoMsg { type: "cosmos-sdk/DVVTriplet"; @@ -467,11 +528,11 @@ export interface DelegationProtoMsg { */ export interface DelegationAmino { /** delegator_address is the bech32-encoded address of the delegator. */ - delegator_address: string; + delegator_address?: string; /** validator_address is the bech32-encoded address of the validator. */ - validator_address: string; + validator_address?: string; /** shares define the delegation shares received. */ - shares: string; + shares?: string; } export interface DelegationAminoMsg { type: "cosmos-sdk/Delegation"; @@ -509,9 +570,9 @@ export interface UnbondingDelegationProtoMsg { */ export interface UnbondingDelegationAmino { /** delegator_address is the bech32-encoded address of the delegator. */ - delegator_address: string; + delegator_address?: string; /** validator_address is the bech32-encoded address of the validator. */ - validator_address: string; + validator_address?: string; /** entries are the unbonding delegation entries. */ entries: UnbondingDelegationEntryAmino[]; } @@ -538,6 +599,10 @@ export interface UnbondingDelegationEntry { initialBalance: string; /** balance defines the tokens to receive at completion. */ balance: string; + /** Incrementing id that uniquely identifies this entry */ + unbondingId: bigint; + /** Strictly positive if this entry's unbonding has been stopped by external modules */ + unbondingOnHoldRefCount: bigint; } export interface UnbondingDelegationEntryProtoMsg { typeUrl: "/cosmos.staking.v1beta1.UnbondingDelegationEntry"; @@ -546,13 +611,17 @@ export interface UnbondingDelegationEntryProtoMsg { /** UnbondingDelegationEntry defines an unbonding object with relevant metadata. */ export interface UnbondingDelegationEntryAmino { /** creation_height is the height which the unbonding took place. */ - creation_height: string; + creation_height?: string; /** completion_time is the unix time for unbonding completion. */ - completion_time?: Date; + completion_time: string; /** initial_balance defines the tokens initially scheduled to receive at completion. */ - initial_balance: string; + initial_balance?: string; /** balance defines the tokens to receive at completion. */ - balance: string; + balance?: string; + /** Incrementing id that uniquely identifies this entry */ + unbonding_id?: string; + /** Strictly positive if this entry's unbonding has been stopped by external modules */ + unbonding_on_hold_ref_count?: string; } export interface UnbondingDelegationEntryAminoMsg { type: "cosmos-sdk/UnbondingDelegationEntry"; @@ -564,6 +633,8 @@ export interface UnbondingDelegationEntrySDKType { completion_time: Date; initial_balance: string; balance: string; + unbonding_id: bigint; + unbonding_on_hold_ref_count: bigint; } /** RedelegationEntry defines a redelegation object with relevant metadata. */ export interface RedelegationEntry { @@ -575,6 +646,10 @@ export interface RedelegationEntry { initialBalance: string; /** shares_dst is the amount of destination-validator shares created by redelegation. */ sharesDst: string; + /** Incrementing id that uniquely identifies this entry */ + unbondingId: bigint; + /** Strictly positive if this entry's unbonding has been stopped by external modules */ + unbondingOnHoldRefCount: bigint; } export interface RedelegationEntryProtoMsg { typeUrl: "/cosmos.staking.v1beta1.RedelegationEntry"; @@ -583,13 +658,17 @@ export interface RedelegationEntryProtoMsg { /** RedelegationEntry defines a redelegation object with relevant metadata. */ export interface RedelegationEntryAmino { /** creation_height defines the height which the redelegation took place. */ - creation_height: string; + creation_height?: string; /** completion_time defines the unix time for redelegation completion. */ - completion_time?: Date; + completion_time: string; /** initial_balance defines the initial balance when redelegation started. */ - initial_balance: string; + initial_balance?: string; /** shares_dst is the amount of destination-validator shares created by redelegation. */ - shares_dst: string; + shares_dst?: string; + /** Incrementing id that uniquely identifies this entry */ + unbonding_id?: string; + /** Strictly positive if this entry's unbonding has been stopped by external modules */ + unbonding_on_hold_ref_count?: string; } export interface RedelegationEntryAminoMsg { type: "cosmos-sdk/RedelegationEntry"; @@ -601,6 +680,8 @@ export interface RedelegationEntrySDKType { completion_time: Date; initial_balance: string; shares_dst: string; + unbonding_id: bigint; + unbonding_on_hold_ref_count: bigint; } /** * Redelegation contains the list of a particular delegator's redelegating bonds @@ -626,11 +707,11 @@ export interface RedelegationProtoMsg { */ export interface RedelegationAmino { /** delegator_address is the bech32-encoded address of the delegator. */ - delegator_address: string; + delegator_address?: string; /** validator_src_address is the validator redelegation source operator address. */ - validator_src_address: string; + validator_src_address?: string; /** validator_dst_address is the validator redelegation destination operator address. */ - validator_dst_address: string; + validator_dst_address?: string; /** entries are the redelegation entries. */ entries: RedelegationEntryAmino[]; } @@ -648,7 +729,7 @@ export interface RedelegationSDKType { validator_dst_address: string; entries: RedelegationEntrySDKType[]; } -/** Params defines the parameters for the staking module. */ +/** Params defines the parameters for the x/staking module. */ export interface Params { /** unbonding_time is the time duration of unbonding. */ unbondingTime: Duration; @@ -662,35 +743,31 @@ export interface Params { bondDenom: string; /** min_commission_rate is the chain-wide minimum commission rate that a validator can charge their delegators */ minCommissionRate: string; - /** min_self_delegation is the chain-wide minimum amount that a validator has to self delegate */ - minSelfDelegation: string; } export interface ParamsProtoMsg { typeUrl: "/cosmos.staking.v1beta1.Params"; value: Uint8Array; } -/** Params defines the parameters for the staking module. */ +/** Params defines the parameters for the x/staking module. */ export interface ParamsAmino { /** unbonding_time is the time duration of unbonding. */ - unbonding_time?: DurationAmino; + unbonding_time: DurationAmino; /** max_validators is the maximum number of validators. */ - max_validators: number; + max_validators?: number; /** max_entries is the max entries for either unbonding delegation or redelegation (per pair/trio). */ - max_entries: number; + max_entries?: number; /** historical_entries is the number of historical entries to persist. */ - historical_entries: number; + historical_entries?: number; /** bond_denom defines the bondable coin denomination. */ - bond_denom: string; + bond_denom?: string; /** min_commission_rate is the chain-wide minimum commission rate that a validator can charge their delegators */ - min_commission_rate: string; - /** min_self_delegation is the chain-wide minimum amount that a validator has to self delegate */ - min_self_delegation: string; + min_commission_rate?: string; } export interface ParamsAminoMsg { type: "cosmos-sdk/x/staking/Params"; value: ParamsAmino; } -/** Params defines the parameters for the staking module. */ +/** Params defines the parameters for the x/staking module. */ export interface ParamsSDKType { unbonding_time: DurationSDKType; max_validators: number; @@ -698,7 +775,6 @@ export interface ParamsSDKType { historical_entries: number; bond_denom: string; min_commission_rate: string; - min_self_delegation: string; } /** * DelegationResponse is equivalent to Delegation except that it contains a @@ -717,8 +793,8 @@ export interface DelegationResponseProtoMsg { * balance in addition to shares which is more suitable for client responses. */ export interface DelegationResponseAmino { - delegation?: DelegationAmino; - balance?: CoinAmino; + delegation: DelegationAmino; + balance: CoinAmino; } export interface DelegationResponseAminoMsg { type: "cosmos-sdk/DelegationResponse"; @@ -751,8 +827,8 @@ export interface RedelegationEntryResponseProtoMsg { * responses. */ export interface RedelegationEntryResponseAmino { - redelegation_entry?: RedelegationEntryAmino; - balance: string; + redelegation_entry: RedelegationEntryAmino; + balance?: string; } export interface RedelegationEntryResponseAminoMsg { type: "cosmos-sdk/RedelegationEntryResponse"; @@ -786,7 +862,7 @@ export interface RedelegationResponseProtoMsg { * responses. */ export interface RedelegationResponseAmino { - redelegation?: RedelegationAmino; + redelegation: RedelegationAmino; entries: RedelegationEntryResponseAmino[]; } export interface RedelegationResponseAminoMsg { @@ -834,6 +910,35 @@ export interface PoolSDKType { not_bonded_tokens: string; bonded_tokens: string; } +/** + * ValidatorUpdates defines an array of abci.ValidatorUpdate objects. + * TODO: explore moving this to proto/cosmos/base to separate modules from tendermint dependence + */ +export interface ValidatorUpdates { + updates: ValidatorUpdate[]; +} +export interface ValidatorUpdatesProtoMsg { + typeUrl: "/cosmos.staking.v1beta1.ValidatorUpdates"; + value: Uint8Array; +} +/** + * ValidatorUpdates defines an array of abci.ValidatorUpdate objects. + * TODO: explore moving this to proto/cosmos/base to separate modules from tendermint dependence + */ +export interface ValidatorUpdatesAmino { + updates: ValidatorUpdateAmino[]; +} +export interface ValidatorUpdatesAminoMsg { + type: "cosmos-sdk/ValidatorUpdates"; + value: ValidatorUpdatesAmino; +} +/** + * ValidatorUpdates defines an array of abci.ValidatorUpdate objects. + * TODO: explore moving this to proto/cosmos/base to separate modules from tendermint dependence + */ +export interface ValidatorUpdatesSDKType { + updates: ValidatorUpdateSDKType[]; +} function createBaseHistoricalInfo(): HistoricalInfo { return { header: Header.fromPartial({}), @@ -878,14 +983,16 @@ export const HistoricalInfo = { return message; }, fromAmino(object: HistoricalInfoAmino): HistoricalInfo { - return { - header: object?.header ? Header.fromAmino(object.header) : undefined, - valset: Array.isArray(object?.valset) ? object.valset.map((e: any) => Validator.fromAmino(e)) : [] - }; + const message = createBaseHistoricalInfo(); + if (object.header !== undefined && object.header !== null) { + message.header = Header.fromAmino(object.header); + } + message.valset = object.valset?.map(e => Validator.fromAmino(e)) || []; + return message; }, toAmino(message: HistoricalInfo): HistoricalInfoAmino { const obj: any = {}; - obj.header = message.header ? Header.toAmino(message.header) : undefined; + obj.header = message.header ? Header.toAmino(message.header) : Header.fromPartial({}); if (message.valset) { obj.valset = message.valset.map(e => e ? Validator.toAmino(e) : undefined); } else { @@ -967,11 +1074,17 @@ export const CommissionRates = { return message; }, fromAmino(object: CommissionRatesAmino): CommissionRates { - return { - rate: object.rate, - maxRate: object.max_rate, - maxChangeRate: object.max_change_rate - }; + const message = createBaseCommissionRates(); + if (object.rate !== undefined && object.rate !== null) { + message.rate = object.rate; + } + if (object.max_rate !== undefined && object.max_rate !== null) { + message.maxRate = object.max_rate; + } + if (object.max_change_rate !== undefined && object.max_change_rate !== null) { + message.maxChangeRate = object.max_change_rate; + } + return message; }, toAmino(message: CommissionRates): CommissionRatesAmino { const obj: any = {}; @@ -1046,15 +1159,19 @@ export const Commission = { return message; }, fromAmino(object: CommissionAmino): Commission { - return { - commissionRates: object?.commission_rates ? CommissionRates.fromAmino(object.commission_rates) : undefined, - updateTime: object.update_time - }; + const message = createBaseCommission(); + if (object.commission_rates !== undefined && object.commission_rates !== null) { + message.commissionRates = CommissionRates.fromAmino(object.commission_rates); + } + if (object.update_time !== undefined && object.update_time !== null) { + message.updateTime = fromTimestamp(Timestamp.fromAmino(object.update_time)); + } + return message; }, toAmino(message: Commission): CommissionAmino { const obj: any = {}; - obj.commission_rates = message.commissionRates ? CommissionRates.toAmino(message.commissionRates) : undefined; - obj.update_time = message.updateTime; + obj.commission_rates = message.commissionRates ? CommissionRates.toAmino(message.commissionRates) : CommissionRates.fromPartial({}); + obj.update_time = message.updateTime ? Timestamp.toAmino(toTimestamp(message.updateTime)) : new Date(); return obj; }, fromAminoMsg(object: CommissionAminoMsg): Commission { @@ -1147,13 +1264,23 @@ export const Description = { return message; }, fromAmino(object: DescriptionAmino): Description { - return { - moniker: object.moniker, - identity: object.identity, - website: object.website, - securityContact: object.security_contact, - details: object.details - }; + const message = createBaseDescription(); + if (object.moniker !== undefined && object.moniker !== null) { + message.moniker = object.moniker; + } + if (object.identity !== undefined && object.identity !== null) { + message.identity = object.identity; + } + if (object.website !== undefined && object.website !== null) { + message.website = object.website; + } + if (object.security_contact !== undefined && object.security_contact !== null) { + message.securityContact = object.security_contact; + } + if (object.details !== undefined && object.details !== null) { + message.details = object.details; + } + return message; }, toAmino(message: Description): DescriptionAmino { const obj: any = {}; @@ -1189,7 +1316,7 @@ export const Description = { function createBaseValidator(): Validator { return { operatorAddress: "", - consensusPubkey: Any.fromPartial({}), + consensusPubkey: undefined, jailed: false, status: 0, tokens: "", @@ -1198,7 +1325,9 @@ function createBaseValidator(): Validator { unbondingHeight: BigInt(0), unbondingTime: new Date(), commission: Commission.fromPartial({}), - minSelfDelegation: "" + minSelfDelegation: "", + unbondingOnHoldRefCount: BigInt(0), + unbondingIds: [] }; } export const Validator = { @@ -1237,6 +1366,14 @@ export const Validator = { if (message.minSelfDelegation !== "") { writer.uint32(90).string(message.minSelfDelegation); } + if (message.unbondingOnHoldRefCount !== BigInt(0)) { + writer.uint32(96).int64(message.unbondingOnHoldRefCount); + } + writer.uint32(106).fork(); + for (const v of message.unbondingIds) { + writer.uint64(v); + } + writer.ldelim(); return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): Validator { @@ -1279,6 +1416,19 @@ export const Validator = { case 11: message.minSelfDelegation = reader.string(); break; + case 12: + message.unbondingOnHoldRefCount = reader.int64(); + break; + case 13: + if ((tag & 7) === 2) { + const end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) { + message.unbondingIds.push(reader.uint64()); + } + } else { + message.unbondingIds.push(reader.uint64()); + } + break; default: reader.skipType(tag & 7); break; @@ -1299,42 +1449,70 @@ export const Validator = { message.unbondingTime = object.unbondingTime ?? undefined; message.commission = object.commission !== undefined && object.commission !== null ? Commission.fromPartial(object.commission) : undefined; message.minSelfDelegation = object.minSelfDelegation ?? ""; + message.unbondingOnHoldRefCount = object.unbondingOnHoldRefCount !== undefined && object.unbondingOnHoldRefCount !== null ? BigInt(object.unbondingOnHoldRefCount.toString()) : BigInt(0); + message.unbondingIds = object.unbondingIds?.map(e => BigInt(e.toString())) || []; return message; }, fromAmino(object: ValidatorAmino): Validator { - return { - operatorAddress: object.operator_address, - consensusPubkey: encodeBech32Pubkey({ - type: "tendermint/PubKeySecp256k1", - value: toBase64(object.consensus_pubkey.value) - }, "cosmos"), - jailed: object.jailed, - status: isSet(object.status) ? bondStatusFromJSON(object.status) : -1, - tokens: object.tokens, - delegatorShares: object.delegator_shares, - description: object?.description ? Description.fromAmino(object.description) : undefined, - unbondingHeight: BigInt(object.unbonding_height), - unbondingTime: object.unbonding_time, - commission: object?.commission ? Commission.fromAmino(object.commission) : undefined, - minSelfDelegation: object.min_self_delegation - }; + const message = createBaseValidator(); + if (object.operator_address !== undefined && object.operator_address !== null) { + message.operatorAddress = object.operator_address; + } + if (object.consensus_pubkey !== undefined && object.consensus_pubkey !== null) { + message.consensusPubkey = encodePubkey(object.consensus_pubkey); + } + if (object.jailed !== undefined && object.jailed !== null) { + message.jailed = object.jailed; + } + if (object.status !== undefined && object.status !== null) { + message.status = bondStatusFromJSON(object.status); + } + if (object.tokens !== undefined && object.tokens !== null) { + message.tokens = object.tokens; + } + if (object.delegator_shares !== undefined && object.delegator_shares !== null) { + message.delegatorShares = object.delegator_shares; + } + if (object.description !== undefined && object.description !== null) { + message.description = Description.fromAmino(object.description); + } + if (object.unbonding_height !== undefined && object.unbonding_height !== null) { + message.unbondingHeight = BigInt(object.unbonding_height); + } + if (object.unbonding_time !== undefined && object.unbonding_time !== null) { + message.unbondingTime = fromTimestamp(Timestamp.fromAmino(object.unbonding_time)); + } + if (object.commission !== undefined && object.commission !== null) { + message.commission = Commission.fromAmino(object.commission); + } + if (object.min_self_delegation !== undefined && object.min_self_delegation !== null) { + message.minSelfDelegation = object.min_self_delegation; + } + if (object.unbonding_on_hold_ref_count !== undefined && object.unbonding_on_hold_ref_count !== null) { + message.unbondingOnHoldRefCount = BigInt(object.unbonding_on_hold_ref_count); + } + message.unbondingIds = object.unbonding_ids?.map(e => BigInt(e)) || []; + return message; }, toAmino(message: Validator): ValidatorAmino { const obj: any = {}; obj.operator_address = message.operatorAddress; - obj.consensus_pubkey = message.consensusPubkey ? { - typeUrl: "/cosmos.crypto.secp256k1.PubKey", - value: fromBase64(decodeBech32Pubkey(message.consensusPubkey).value) - } : undefined; + obj.consensus_pubkey = message.consensusPubkey ? decodePubkey(message.consensusPubkey) : undefined; obj.jailed = message.jailed; - obj.status = message.status; + obj.status = bondStatusToJSON(message.status); obj.tokens = message.tokens; obj.delegator_shares = message.delegatorShares; - obj.description = message.description ? Description.toAmino(message.description) : undefined; + obj.description = message.description ? Description.toAmino(message.description) : Description.fromPartial({}); obj.unbonding_height = message.unbondingHeight ? message.unbondingHeight.toString() : undefined; - obj.unbonding_time = message.unbondingTime; - obj.commission = message.commission ? Commission.toAmino(message.commission) : undefined; + obj.unbonding_time = message.unbondingTime ? Timestamp.toAmino(toTimestamp(message.unbondingTime)) : new Date(); + obj.commission = message.commission ? Commission.toAmino(message.commission) : Commission.fromPartial({}); obj.min_self_delegation = message.minSelfDelegation; + obj.unbonding_on_hold_ref_count = message.unbondingOnHoldRefCount ? message.unbondingOnHoldRefCount.toString() : undefined; + if (message.unbondingIds) { + obj.unbonding_ids = message.unbondingIds.map(e => e.toString()); + } else { + obj.unbonding_ids = []; + } return obj; }, fromAminoMsg(object: ValidatorAminoMsg): Validator { @@ -1395,9 +1573,9 @@ export const ValAddresses = { return message; }, fromAmino(object: ValAddressesAmino): ValAddresses { - return { - addresses: Array.isArray(object?.addresses) ? object.addresses.map((e: any) => e) : [] - }; + const message = createBaseValAddresses(); + message.addresses = object.addresses?.map(e => e) || []; + return message; }, toAmino(message: ValAddresses): ValAddressesAmino { const obj: any = {}; @@ -1474,10 +1652,14 @@ export const DVPair = { return message; }, fromAmino(object: DVPairAmino): DVPair { - return { - delegatorAddress: object.delegator_address, - validatorAddress: object.validator_address - }; + const message = createBaseDVPair(); + if (object.delegator_address !== undefined && object.delegator_address !== null) { + message.delegatorAddress = object.delegator_address; + } + if (object.validator_address !== undefined && object.validator_address !== null) { + message.validatorAddress = object.validator_address; + } + return message; }, toAmino(message: DVPair): DVPairAmino { const obj: any = {}; @@ -1543,9 +1725,9 @@ export const DVPairs = { return message; }, fromAmino(object: DVPairsAmino): DVPairs { - return { - pairs: Array.isArray(object?.pairs) ? object.pairs.map((e: any) => DVPair.fromAmino(e)) : [] - }; + const message = createBaseDVPairs(); + message.pairs = object.pairs?.map(e => DVPair.fromAmino(e)) || []; + return message; }, toAmino(message: DVPairs): DVPairsAmino { const obj: any = {}; @@ -1630,11 +1812,17 @@ export const DVVTriplet = { return message; }, fromAmino(object: DVVTripletAmino): DVVTriplet { - return { - delegatorAddress: object.delegator_address, - validatorSrcAddress: object.validator_src_address, - validatorDstAddress: object.validator_dst_address - }; + const message = createBaseDVVTriplet(); + if (object.delegator_address !== undefined && object.delegator_address !== null) { + message.delegatorAddress = object.delegator_address; + } + if (object.validator_src_address !== undefined && object.validator_src_address !== null) { + message.validatorSrcAddress = object.validator_src_address; + } + if (object.validator_dst_address !== undefined && object.validator_dst_address !== null) { + message.validatorDstAddress = object.validator_dst_address; + } + return message; }, toAmino(message: DVVTriplet): DVVTripletAmino { const obj: any = {}; @@ -1701,9 +1889,9 @@ export const DVVTriplets = { return message; }, fromAmino(object: DVVTripletsAmino): DVVTriplets { - return { - triplets: Array.isArray(object?.triplets) ? object.triplets.map((e: any) => DVVTriplet.fromAmino(e)) : [] - }; + const message = createBaseDVVTriplets(); + message.triplets = object.triplets?.map(e => DVVTriplet.fromAmino(e)) || []; + return message; }, toAmino(message: DVVTriplets): DVVTripletsAmino { const obj: any = {}; @@ -1788,11 +1976,17 @@ export const Delegation = { return message; }, fromAmino(object: DelegationAmino): Delegation { - return { - delegatorAddress: object.delegator_address, - validatorAddress: object.validator_address, - shares: object.shares - }; + const message = createBaseDelegation(); + if (object.delegator_address !== undefined && object.delegator_address !== null) { + message.delegatorAddress = object.delegator_address; + } + if (object.validator_address !== undefined && object.validator_address !== null) { + message.validatorAddress = object.validator_address; + } + if (object.shares !== undefined && object.shares !== null) { + message.shares = object.shares; + } + return message; }, toAmino(message: Delegation): DelegationAmino { const obj: any = {}; @@ -1875,11 +2069,15 @@ export const UnbondingDelegation = { return message; }, fromAmino(object: UnbondingDelegationAmino): UnbondingDelegation { - return { - delegatorAddress: object.delegator_address, - validatorAddress: object.validator_address, - entries: Array.isArray(object?.entries) ? object.entries.map((e: any) => UnbondingDelegationEntry.fromAmino(e)) : [] - }; + const message = createBaseUnbondingDelegation(); + if (object.delegator_address !== undefined && object.delegator_address !== null) { + message.delegatorAddress = object.delegator_address; + } + if (object.validator_address !== undefined && object.validator_address !== null) { + message.validatorAddress = object.validator_address; + } + message.entries = object.entries?.map(e => UnbondingDelegationEntry.fromAmino(e)) || []; + return message; }, toAmino(message: UnbondingDelegation): UnbondingDelegationAmino { const obj: any = {}; @@ -1919,7 +2117,9 @@ function createBaseUnbondingDelegationEntry(): UnbondingDelegationEntry { creationHeight: BigInt(0), completionTime: new Date(), initialBalance: "", - balance: "" + balance: "", + unbondingId: BigInt(0), + unbondingOnHoldRefCount: BigInt(0) }; } export const UnbondingDelegationEntry = { @@ -1937,6 +2137,12 @@ export const UnbondingDelegationEntry = { if (message.balance !== "") { writer.uint32(34).string(message.balance); } + if (message.unbondingId !== BigInt(0)) { + writer.uint32(40).uint64(message.unbondingId); + } + if (message.unbondingOnHoldRefCount !== BigInt(0)) { + writer.uint32(48).int64(message.unbondingOnHoldRefCount); + } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): UnbondingDelegationEntry { @@ -1958,6 +2164,12 @@ export const UnbondingDelegationEntry = { case 4: message.balance = reader.string(); break; + case 5: + message.unbondingId = reader.uint64(); + break; + case 6: + message.unbondingOnHoldRefCount = reader.int64(); + break; default: reader.skipType(tag & 7); break; @@ -1971,22 +2183,40 @@ export const UnbondingDelegationEntry = { message.completionTime = object.completionTime ?? undefined; message.initialBalance = object.initialBalance ?? ""; message.balance = object.balance ?? ""; + message.unbondingId = object.unbondingId !== undefined && object.unbondingId !== null ? BigInt(object.unbondingId.toString()) : BigInt(0); + message.unbondingOnHoldRefCount = object.unbondingOnHoldRefCount !== undefined && object.unbondingOnHoldRefCount !== null ? BigInt(object.unbondingOnHoldRefCount.toString()) : BigInt(0); return message; }, fromAmino(object: UnbondingDelegationEntryAmino): UnbondingDelegationEntry { - return { - creationHeight: BigInt(object.creation_height), - completionTime: object.completion_time, - initialBalance: object.initial_balance, - balance: object.balance - }; + const message = createBaseUnbondingDelegationEntry(); + if (object.creation_height !== undefined && object.creation_height !== null) { + message.creationHeight = BigInt(object.creation_height); + } + if (object.completion_time !== undefined && object.completion_time !== null) { + message.completionTime = fromTimestamp(Timestamp.fromAmino(object.completion_time)); + } + if (object.initial_balance !== undefined && object.initial_balance !== null) { + message.initialBalance = object.initial_balance; + } + if (object.balance !== undefined && object.balance !== null) { + message.balance = object.balance; + } + if (object.unbonding_id !== undefined && object.unbonding_id !== null) { + message.unbondingId = BigInt(object.unbonding_id); + } + if (object.unbonding_on_hold_ref_count !== undefined && object.unbonding_on_hold_ref_count !== null) { + message.unbondingOnHoldRefCount = BigInt(object.unbonding_on_hold_ref_count); + } + return message; }, toAmino(message: UnbondingDelegationEntry): UnbondingDelegationEntryAmino { const obj: any = {}; obj.creation_height = message.creationHeight ? message.creationHeight.toString() : undefined; - obj.completion_time = message.completionTime; + obj.completion_time = message.completionTime ? Timestamp.toAmino(toTimestamp(message.completionTime)) : new Date(); obj.initial_balance = message.initialBalance; obj.balance = message.balance; + obj.unbonding_id = message.unbondingId ? message.unbondingId.toString() : undefined; + obj.unbonding_on_hold_ref_count = message.unbondingOnHoldRefCount ? message.unbondingOnHoldRefCount.toString() : undefined; return obj; }, fromAminoMsg(object: UnbondingDelegationEntryAminoMsg): UnbondingDelegationEntry { @@ -2016,7 +2246,9 @@ function createBaseRedelegationEntry(): RedelegationEntry { creationHeight: BigInt(0), completionTime: new Date(), initialBalance: "", - sharesDst: "" + sharesDst: "", + unbondingId: BigInt(0), + unbondingOnHoldRefCount: BigInt(0) }; } export const RedelegationEntry = { @@ -2034,6 +2266,12 @@ export const RedelegationEntry = { if (message.sharesDst !== "") { writer.uint32(34).string(Decimal.fromUserInput(message.sharesDst, 18).atomics); } + if (message.unbondingId !== BigInt(0)) { + writer.uint32(40).uint64(message.unbondingId); + } + if (message.unbondingOnHoldRefCount !== BigInt(0)) { + writer.uint32(48).int64(message.unbondingOnHoldRefCount); + } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): RedelegationEntry { @@ -2055,6 +2293,12 @@ export const RedelegationEntry = { case 4: message.sharesDst = Decimal.fromAtomics(reader.string(), 18).toString(); break; + case 5: + message.unbondingId = reader.uint64(); + break; + case 6: + message.unbondingOnHoldRefCount = reader.int64(); + break; default: reader.skipType(tag & 7); break; @@ -2068,22 +2312,40 @@ export const RedelegationEntry = { message.completionTime = object.completionTime ?? undefined; message.initialBalance = object.initialBalance ?? ""; message.sharesDst = object.sharesDst ?? ""; + message.unbondingId = object.unbondingId !== undefined && object.unbondingId !== null ? BigInt(object.unbondingId.toString()) : BigInt(0); + message.unbondingOnHoldRefCount = object.unbondingOnHoldRefCount !== undefined && object.unbondingOnHoldRefCount !== null ? BigInt(object.unbondingOnHoldRefCount.toString()) : BigInt(0); return message; }, fromAmino(object: RedelegationEntryAmino): RedelegationEntry { - return { - creationHeight: BigInt(object.creation_height), - completionTime: object.completion_time, - initialBalance: object.initial_balance, - sharesDst: object.shares_dst - }; + const message = createBaseRedelegationEntry(); + if (object.creation_height !== undefined && object.creation_height !== null) { + message.creationHeight = BigInt(object.creation_height); + } + if (object.completion_time !== undefined && object.completion_time !== null) { + message.completionTime = fromTimestamp(Timestamp.fromAmino(object.completion_time)); + } + if (object.initial_balance !== undefined && object.initial_balance !== null) { + message.initialBalance = object.initial_balance; + } + if (object.shares_dst !== undefined && object.shares_dst !== null) { + message.sharesDst = object.shares_dst; + } + if (object.unbonding_id !== undefined && object.unbonding_id !== null) { + message.unbondingId = BigInt(object.unbonding_id); + } + if (object.unbonding_on_hold_ref_count !== undefined && object.unbonding_on_hold_ref_count !== null) { + message.unbondingOnHoldRefCount = BigInt(object.unbonding_on_hold_ref_count); + } + return message; }, toAmino(message: RedelegationEntry): RedelegationEntryAmino { const obj: any = {}; obj.creation_height = message.creationHeight ? message.creationHeight.toString() : undefined; - obj.completion_time = message.completionTime; + obj.completion_time = message.completionTime ? Timestamp.toAmino(toTimestamp(message.completionTime)) : new Date(); obj.initial_balance = message.initialBalance; obj.shares_dst = message.sharesDst; + obj.unbonding_id = message.unbondingId ? message.unbondingId.toString() : undefined; + obj.unbonding_on_hold_ref_count = message.unbondingOnHoldRefCount ? message.unbondingOnHoldRefCount.toString() : undefined; return obj; }, fromAminoMsg(object: RedelegationEntryAminoMsg): RedelegationEntry { @@ -2168,12 +2430,18 @@ export const Redelegation = { return message; }, fromAmino(object: RedelegationAmino): Redelegation { - return { - delegatorAddress: object.delegator_address, - validatorSrcAddress: object.validator_src_address, - validatorDstAddress: object.validator_dst_address, - entries: Array.isArray(object?.entries) ? object.entries.map((e: any) => RedelegationEntry.fromAmino(e)) : [] - }; + const message = createBaseRedelegation(); + if (object.delegator_address !== undefined && object.delegator_address !== null) { + message.delegatorAddress = object.delegator_address; + } + if (object.validator_src_address !== undefined && object.validator_src_address !== null) { + message.validatorSrcAddress = object.validator_src_address; + } + if (object.validator_dst_address !== undefined && object.validator_dst_address !== null) { + message.validatorDstAddress = object.validator_dst_address; + } + message.entries = object.entries?.map(e => RedelegationEntry.fromAmino(e)) || []; + return message; }, toAmino(message: Redelegation): RedelegationAmino { const obj: any = {}; @@ -2216,8 +2484,7 @@ function createBaseParams(): Params { maxEntries: 0, historicalEntries: 0, bondDenom: "", - minCommissionRate: "", - minSelfDelegation: "" + minCommissionRate: "" }; } export const Params = { @@ -2241,9 +2508,6 @@ export const Params = { if (message.minCommissionRate !== "") { writer.uint32(50).string(Decimal.fromUserInput(message.minCommissionRate, 18).atomics); } - if (message.minSelfDelegation !== "") { - writer.uint32(58).string(message.minSelfDelegation); - } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): Params { @@ -2271,9 +2535,6 @@ export const Params = { case 6: message.minCommissionRate = Decimal.fromAtomics(reader.string(), 18).toString(); break; - case 7: - message.minSelfDelegation = reader.string(); - break; default: reader.skipType(tag & 7); break; @@ -2289,29 +2550,38 @@ export const Params = { message.historicalEntries = object.historicalEntries ?? 0; message.bondDenom = object.bondDenom ?? ""; message.minCommissionRate = object.minCommissionRate ?? ""; - message.minSelfDelegation = object.minSelfDelegation ?? ""; return message; }, fromAmino(object: ParamsAmino): Params { - return { - unbondingTime: object?.unbonding_time ? Duration.fromAmino(object.unbonding_time) : undefined, - maxValidators: object.max_validators, - maxEntries: object.max_entries, - historicalEntries: object.historical_entries, - bondDenom: object.bond_denom, - minCommissionRate: object.min_commission_rate, - minSelfDelegation: object.min_self_delegation - }; + const message = createBaseParams(); + if (object.unbonding_time !== undefined && object.unbonding_time !== null) { + message.unbondingTime = Duration.fromAmino(object.unbonding_time); + } + if (object.max_validators !== undefined && object.max_validators !== null) { + message.maxValidators = object.max_validators; + } + if (object.max_entries !== undefined && object.max_entries !== null) { + message.maxEntries = object.max_entries; + } + if (object.historical_entries !== undefined && object.historical_entries !== null) { + message.historicalEntries = object.historical_entries; + } + if (object.bond_denom !== undefined && object.bond_denom !== null) { + message.bondDenom = object.bond_denom; + } + if (object.min_commission_rate !== undefined && object.min_commission_rate !== null) { + message.minCommissionRate = object.min_commission_rate; + } + return message; }, toAmino(message: Params): ParamsAmino { const obj: any = {}; - obj.unbonding_time = message.unbondingTime ? Duration.toAmino(message.unbondingTime) : undefined; + obj.unbonding_time = message.unbondingTime ? Duration.toAmino(message.unbondingTime) : Duration.fromPartial({}); obj.max_validators = message.maxValidators; obj.max_entries = message.maxEntries; obj.historical_entries = message.historicalEntries; obj.bond_denom = message.bondDenom; obj.min_commission_rate = message.minCommissionRate; - obj.min_self_delegation = message.minSelfDelegation; return obj; }, fromAminoMsg(object: ParamsAminoMsg): Params { @@ -2380,15 +2650,19 @@ export const DelegationResponse = { return message; }, fromAmino(object: DelegationResponseAmino): DelegationResponse { - return { - delegation: object?.delegation ? Delegation.fromAmino(object.delegation) : undefined, - balance: object?.balance ? Coin.fromAmino(object.balance) : undefined - }; + const message = createBaseDelegationResponse(); + if (object.delegation !== undefined && object.delegation !== null) { + message.delegation = Delegation.fromAmino(object.delegation); + } + if (object.balance !== undefined && object.balance !== null) { + message.balance = Coin.fromAmino(object.balance); + } + return message; }, toAmino(message: DelegationResponse): DelegationResponseAmino { const obj: any = {}; - obj.delegation = message.delegation ? Delegation.toAmino(message.delegation) : undefined; - obj.balance = message.balance ? Coin.toAmino(message.balance) : undefined; + obj.delegation = message.delegation ? Delegation.toAmino(message.delegation) : Delegation.fromPartial({}); + obj.balance = message.balance ? Coin.toAmino(message.balance) : Coin.fromPartial({}); return obj; }, fromAminoMsg(object: DelegationResponseAminoMsg): DelegationResponse { @@ -2457,14 +2731,18 @@ export const RedelegationEntryResponse = { return message; }, fromAmino(object: RedelegationEntryResponseAmino): RedelegationEntryResponse { - return { - redelegationEntry: object?.redelegation_entry ? RedelegationEntry.fromAmino(object.redelegation_entry) : undefined, - balance: object.balance - }; + const message = createBaseRedelegationEntryResponse(); + if (object.redelegation_entry !== undefined && object.redelegation_entry !== null) { + message.redelegationEntry = RedelegationEntry.fromAmino(object.redelegation_entry); + } + if (object.balance !== undefined && object.balance !== null) { + message.balance = object.balance; + } + return message; }, toAmino(message: RedelegationEntryResponse): RedelegationEntryResponseAmino { const obj: any = {}; - obj.redelegation_entry = message.redelegationEntry ? RedelegationEntry.toAmino(message.redelegationEntry) : undefined; + obj.redelegation_entry = message.redelegationEntry ? RedelegationEntry.toAmino(message.redelegationEntry) : RedelegationEntry.fromPartial({}); obj.balance = message.balance; return obj; }, @@ -2534,14 +2812,16 @@ export const RedelegationResponse = { return message; }, fromAmino(object: RedelegationResponseAmino): RedelegationResponse { - return { - redelegation: object?.redelegation ? Redelegation.fromAmino(object.redelegation) : undefined, - entries: Array.isArray(object?.entries) ? object.entries.map((e: any) => RedelegationEntryResponse.fromAmino(e)) : [] - }; + const message = createBaseRedelegationResponse(); + if (object.redelegation !== undefined && object.redelegation !== null) { + message.redelegation = Redelegation.fromAmino(object.redelegation); + } + message.entries = object.entries?.map(e => RedelegationEntryResponse.fromAmino(e)) || []; + return message; }, toAmino(message: RedelegationResponse): RedelegationResponseAmino { const obj: any = {}; - obj.redelegation = message.redelegation ? Redelegation.toAmino(message.redelegation) : undefined; + obj.redelegation = message.redelegation ? Redelegation.toAmino(message.redelegation) : Redelegation.fromPartial({}); if (message.entries) { obj.entries = message.entries.map(e => e ? RedelegationEntryResponse.toAmino(e) : undefined); } else { @@ -2615,15 +2895,19 @@ export const Pool = { return message; }, fromAmino(object: PoolAmino): Pool { - return { - notBondedTokens: object.not_bonded_tokens, - bondedTokens: object.bonded_tokens - }; + const message = createBasePool(); + if (object.not_bonded_tokens !== undefined && object.not_bonded_tokens !== null) { + message.notBondedTokens = object.not_bonded_tokens; + } + if (object.bonded_tokens !== undefined && object.bonded_tokens !== null) { + message.bondedTokens = object.bonded_tokens; + } + return message; }, toAmino(message: Pool): PoolAmino { const obj: any = {}; - obj.not_bonded_tokens = message.notBondedTokens; - obj.bonded_tokens = message.bondedTokens; + obj.not_bonded_tokens = message.notBondedTokens ?? ""; + obj.bonded_tokens = message.bondedTokens ?? ""; return obj; }, fromAminoMsg(object: PoolAminoMsg): Pool { @@ -2648,23 +2932,88 @@ export const Pool = { }; } }; +function createBaseValidatorUpdates(): ValidatorUpdates { + return { + updates: [] + }; +} +export const ValidatorUpdates = { + typeUrl: "/cosmos.staking.v1beta1.ValidatorUpdates", + encode(message: ValidatorUpdates, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.updates) { + ValidatorUpdate.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): ValidatorUpdates { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseValidatorUpdates(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.updates.push(ValidatorUpdate.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): ValidatorUpdates { + const message = createBaseValidatorUpdates(); + message.updates = object.updates?.map(e => ValidatorUpdate.fromPartial(e)) || []; + return message; + }, + fromAmino(object: ValidatorUpdatesAmino): ValidatorUpdates { + const message = createBaseValidatorUpdates(); + message.updates = object.updates?.map(e => ValidatorUpdate.fromAmino(e)) || []; + return message; + }, + toAmino(message: ValidatorUpdates): ValidatorUpdatesAmino { + const obj: any = {}; + if (message.updates) { + obj.updates = message.updates.map(e => e ? ValidatorUpdate.toAmino(e) : undefined); + } else { + obj.updates = []; + } + return obj; + }, + fromAminoMsg(object: ValidatorUpdatesAminoMsg): ValidatorUpdates { + return ValidatorUpdates.fromAmino(object.value); + }, + toAminoMsg(message: ValidatorUpdates): ValidatorUpdatesAminoMsg { + return { + type: "cosmos-sdk/ValidatorUpdates", + value: ValidatorUpdates.toAmino(message) + }; + }, + fromProtoMsg(message: ValidatorUpdatesProtoMsg): ValidatorUpdates { + return ValidatorUpdates.decode(message.value); + }, + toProto(message: ValidatorUpdates): Uint8Array { + return ValidatorUpdates.encode(message).finish(); + }, + toProtoMsg(message: ValidatorUpdates): ValidatorUpdatesProtoMsg { + return { + typeUrl: "/cosmos.staking.v1beta1.ValidatorUpdates", + value: ValidatorUpdates.encode(message).finish() + }; + } +}; export const Cosmos_cryptoPubKey_InterfaceDecoder = (input: BinaryReader | Uint8Array): Any => { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - const data = Any.decode(reader, reader.uint32()); + const data = Any.decode(reader, reader.uint32(), true); switch (data.typeUrl) { default: return data; } }; export const Cosmos_cryptoPubKey_FromAmino = (content: AnyAmino) => { - return encodeBech32Pubkey({ - type: "tendermint/PubKeySecp256k1", - value: toBase64(content.value) - }, "cosmos"); + return encodePubkey(content); }; -export const Cosmos_cryptoPubKey_ToAmino = (content: Any) => { - return { - typeUrl: "/cosmos.crypto.secp256k1.PubKey", - value: fromBase64(decodeBech32Pubkey(content).value) - }; +export const Cosmos_cryptoPubKey_ToAmino = (content: Any): Pubkey | null => { + return decodePubkey(content); }; \ No newline at end of file diff --git a/packages/osmo-query/src/codegen/cosmos/staking/v1beta1/tx.amino.ts b/packages/osmo-query/src/codegen/cosmos/staking/v1beta1/tx.amino.ts index 159426720..9d017906e 100644 --- a/packages/osmo-query/src/codegen/cosmos/staking/v1beta1/tx.amino.ts +++ b/packages/osmo-query/src/codegen/cosmos/staking/v1beta1/tx.amino.ts @@ -1,5 +1,5 @@ //@ts-nocheck -import { MsgCreateValidator, MsgEditValidator, MsgDelegate, MsgBeginRedelegate, MsgUndelegate } from "./tx"; +import { MsgCreateValidator, MsgEditValidator, MsgDelegate, MsgBeginRedelegate, MsgUndelegate, MsgCancelUnbondingDelegation, MsgUpdateParams } from "./tx"; export const AminoConverter = { "/cosmos.staking.v1beta1.MsgCreateValidator": { aminoType: "cosmos-sdk/MsgCreateValidator", @@ -25,5 +25,15 @@ export const AminoConverter = { aminoType: "cosmos-sdk/MsgUndelegate", toAmino: MsgUndelegate.toAmino, fromAmino: MsgUndelegate.fromAmino + }, + "/cosmos.staking.v1beta1.MsgCancelUnbondingDelegation": { + aminoType: "cosmos-sdk/MsgCancelUnbondingDelegation", + toAmino: MsgCancelUnbondingDelegation.toAmino, + fromAmino: MsgCancelUnbondingDelegation.fromAmino + }, + "/cosmos.staking.v1beta1.MsgUpdateParams": { + aminoType: "cosmos-sdk/x/staking/MsgUpdateParams", + toAmino: MsgUpdateParams.toAmino, + fromAmino: MsgUpdateParams.fromAmino } }; \ No newline at end of file diff --git a/packages/osmo-query/src/codegen/cosmos/staking/v1beta1/tx.registry.ts b/packages/osmo-query/src/codegen/cosmos/staking/v1beta1/tx.registry.ts index a8e1a9d0e..813c4faf7 100644 --- a/packages/osmo-query/src/codegen/cosmos/staking/v1beta1/tx.registry.ts +++ b/packages/osmo-query/src/codegen/cosmos/staking/v1beta1/tx.registry.ts @@ -1,7 +1,7 @@ //@ts-nocheck import { GeneratedType, Registry } from "@cosmjs/proto-signing"; -import { MsgCreateValidator, MsgEditValidator, MsgDelegate, MsgBeginRedelegate, MsgUndelegate } from "./tx"; -export const registry: ReadonlyArray<[string, GeneratedType]> = [["/cosmos.staking.v1beta1.MsgCreateValidator", MsgCreateValidator], ["/cosmos.staking.v1beta1.MsgEditValidator", MsgEditValidator], ["/cosmos.staking.v1beta1.MsgDelegate", MsgDelegate], ["/cosmos.staking.v1beta1.MsgBeginRedelegate", MsgBeginRedelegate], ["/cosmos.staking.v1beta1.MsgUndelegate", MsgUndelegate]]; +import { MsgCreateValidator, MsgEditValidator, MsgDelegate, MsgBeginRedelegate, MsgUndelegate, MsgCancelUnbondingDelegation, MsgUpdateParams } from "./tx"; +export const registry: ReadonlyArray<[string, GeneratedType]> = [["/cosmos.staking.v1beta1.MsgCreateValidator", MsgCreateValidator], ["/cosmos.staking.v1beta1.MsgEditValidator", MsgEditValidator], ["/cosmos.staking.v1beta1.MsgDelegate", MsgDelegate], ["/cosmos.staking.v1beta1.MsgBeginRedelegate", MsgBeginRedelegate], ["/cosmos.staking.v1beta1.MsgUndelegate", MsgUndelegate], ["/cosmos.staking.v1beta1.MsgCancelUnbondingDelegation", MsgCancelUnbondingDelegation], ["/cosmos.staking.v1beta1.MsgUpdateParams", MsgUpdateParams]]; export const load = (protoRegistry: Registry) => { registry.forEach(([typeUrl, mod]) => { protoRegistry.register(typeUrl, mod); @@ -38,6 +38,18 @@ export const MessageComposer = { typeUrl: "/cosmos.staking.v1beta1.MsgUndelegate", value: MsgUndelegate.encode(value).finish() }; + }, + cancelUnbondingDelegation(value: MsgCancelUnbondingDelegation) { + return { + typeUrl: "/cosmos.staking.v1beta1.MsgCancelUnbondingDelegation", + value: MsgCancelUnbondingDelegation.encode(value).finish() + }; + }, + updateParams(value: MsgUpdateParams) { + return { + typeUrl: "/cosmos.staking.v1beta1.MsgUpdateParams", + value: MsgUpdateParams.encode(value).finish() + }; } }, withTypeUrl: { @@ -70,6 +82,18 @@ export const MessageComposer = { typeUrl: "/cosmos.staking.v1beta1.MsgUndelegate", value }; + }, + cancelUnbondingDelegation(value: MsgCancelUnbondingDelegation) { + return { + typeUrl: "/cosmos.staking.v1beta1.MsgCancelUnbondingDelegation", + value + }; + }, + updateParams(value: MsgUpdateParams) { + return { + typeUrl: "/cosmos.staking.v1beta1.MsgUpdateParams", + value + }; } }, fromPartial: { @@ -102,6 +126,18 @@ export const MessageComposer = { typeUrl: "/cosmos.staking.v1beta1.MsgUndelegate", value: MsgUndelegate.fromPartial(value) }; + }, + cancelUnbondingDelegation(value: MsgCancelUnbondingDelegation) { + return { + typeUrl: "/cosmos.staking.v1beta1.MsgCancelUnbondingDelegation", + value: MsgCancelUnbondingDelegation.fromPartial(value) + }; + }, + updateParams(value: MsgUpdateParams) { + return { + typeUrl: "/cosmos.staking.v1beta1.MsgUpdateParams", + value: MsgUpdateParams.fromPartial(value) + }; } } }; \ No newline at end of file diff --git a/packages/osmo-query/src/codegen/cosmos/staking/v1beta1/tx.rpc.msg.ts b/packages/osmo-query/src/codegen/cosmos/staking/v1beta1/tx.rpc.msg.ts index bc68ae5b6..f7d4061c9 100644 --- a/packages/osmo-query/src/codegen/cosmos/staking/v1beta1/tx.rpc.msg.ts +++ b/packages/osmo-query/src/codegen/cosmos/staking/v1beta1/tx.rpc.msg.ts @@ -1,6 +1,6 @@ import { Rpc } from "../../../helpers"; import { BinaryReader } from "../../../binary"; -import { MsgCreateValidator, MsgCreateValidatorResponse, MsgEditValidator, MsgEditValidatorResponse, MsgDelegate, MsgDelegateResponse, MsgBeginRedelegate, MsgBeginRedelegateResponse, MsgUndelegate, MsgUndelegateResponse } from "./tx"; +import { MsgCreateValidator, MsgCreateValidatorResponse, MsgEditValidator, MsgEditValidatorResponse, MsgDelegate, MsgDelegateResponse, MsgBeginRedelegate, MsgBeginRedelegateResponse, MsgUndelegate, MsgUndelegateResponse, MsgCancelUnbondingDelegation, MsgCancelUnbondingDelegationResponse, MsgUpdateParams, MsgUpdateParamsResponse } from "./tx"; /** Msg defines the staking Msg service. */ export interface Msg { /** CreateValidator defines a method for creating a new validator. */ @@ -22,6 +22,19 @@ export interface Msg { * delegate and a validator. */ undelegate(request: MsgUndelegate): Promise; + /** + * CancelUnbondingDelegation defines a method for performing canceling the unbonding delegation + * and delegate back to previous validator. + * + * Since: cosmos-sdk 0.46 + */ + cancelUnbondingDelegation(request: MsgCancelUnbondingDelegation): Promise; + /** + * UpdateParams defines an operation for updating the x/staking module + * parameters. + * Since: cosmos-sdk 0.47 + */ + updateParams(request: MsgUpdateParams): Promise; } export class MsgClientImpl implements Msg { private readonly rpc: Rpc; @@ -32,6 +45,8 @@ export class MsgClientImpl implements Msg { this.delegate = this.delegate.bind(this); this.beginRedelegate = this.beginRedelegate.bind(this); this.undelegate = this.undelegate.bind(this); + this.cancelUnbondingDelegation = this.cancelUnbondingDelegation.bind(this); + this.updateParams = this.updateParams.bind(this); } createValidator(request: MsgCreateValidator): Promise { const data = MsgCreateValidator.encode(request).finish(); @@ -58,4 +73,14 @@ export class MsgClientImpl implements Msg { const promise = this.rpc.request("cosmos.staking.v1beta1.Msg", "Undelegate", data); return promise.then(data => MsgUndelegateResponse.decode(new BinaryReader(data))); } + cancelUnbondingDelegation(request: MsgCancelUnbondingDelegation): Promise { + const data = MsgCancelUnbondingDelegation.encode(request).finish(); + const promise = this.rpc.request("cosmos.staking.v1beta1.Msg", "CancelUnbondingDelegation", data); + return promise.then(data => MsgCancelUnbondingDelegationResponse.decode(new BinaryReader(data))); + } + updateParams(request: MsgUpdateParams): Promise { + const data = MsgUpdateParams.encode(request).finish(); + const promise = this.rpc.request("cosmos.staking.v1beta1.Msg", "UpdateParams", data); + return promise.then(data => MsgUpdateParamsResponse.decode(new BinaryReader(data))); + } } \ No newline at end of file diff --git a/packages/osmo-query/src/codegen/cosmos/staking/v1beta1/tx.ts b/packages/osmo-query/src/codegen/cosmos/staking/v1beta1/tx.ts index bbbe427f3..fc07f8170 100644 --- a/packages/osmo-query/src/codegen/cosmos/staking/v1beta1/tx.ts +++ b/packages/osmo-query/src/codegen/cosmos/staking/v1beta1/tx.ts @@ -1,12 +1,12 @@ -import { Description, DescriptionAmino, DescriptionSDKType, CommissionRates, CommissionRatesAmino, CommissionRatesSDKType } from "./staking"; +import { Description, DescriptionAmino, DescriptionSDKType, CommissionRates, CommissionRatesAmino, CommissionRatesSDKType, Params, ParamsAmino, ParamsSDKType } from "./staking"; import { Any, AnyProtoMsg, AnyAmino, AnySDKType } from "../../../google/protobuf/any"; import { Coin, CoinAmino, CoinSDKType } from "../../base/v1beta1/coin"; import { Timestamp } from "../../../google/protobuf/timestamp"; import { BinaryReader, BinaryWriter } from "../../../binary"; -import { toBase64, fromBase64 } from "@cosmjs/encoding"; -import { encodeBech32Pubkey, decodeBech32Pubkey } from "@cosmjs/amino"; +import { encodePubkey, decodePubkey } from "@cosmjs/proto-signing"; import { Decimal } from "@cosmjs/math"; import { toTimestamp, fromTimestamp } from "../../../helpers"; +import { Pubkey } from "@cosmjs/amino"; /** MsgCreateValidator defines a SDK message for creating a new validator. */ export interface MsgCreateValidator { description: Description; @@ -14,7 +14,7 @@ export interface MsgCreateValidator { minSelfDelegation: string; delegatorAddress: string; validatorAddress: string; - pubkey: (Any) | undefined; + pubkey?: (Any) | undefined; value: Coin; } export interface MsgCreateValidatorProtoMsg { @@ -26,13 +26,13 @@ export type MsgCreateValidatorEncoded = Omit & { }; /** MsgCreateValidator defines a SDK message for creating a new validator. */ export interface MsgCreateValidatorAmino { - description?: DescriptionAmino; - commission?: CommissionRatesAmino; - min_self_delegation: string; - delegator_address: string; - validator_address: string; + description: DescriptionAmino; + commission: CommissionRatesAmino; + min_self_delegation?: string; + delegator_address?: string; + validator_address?: string; pubkey?: AnyAmino; - value?: CoinAmino; + value: CoinAmino; } export interface MsgCreateValidatorAminoMsg { type: "cosmos-sdk/MsgCreateValidator"; @@ -45,7 +45,7 @@ export interface MsgCreateValidatorSDKType { min_self_delegation: string; delegator_address: string; validator_address: string; - pubkey: AnySDKType | undefined; + pubkey?: AnySDKType | undefined; value: CoinSDKType; } /** MsgCreateValidatorResponse defines the Msg/CreateValidator response type. */ @@ -81,16 +81,16 @@ export interface MsgEditValidatorProtoMsg { } /** MsgEditValidator defines a SDK message for editing an existing validator. */ export interface MsgEditValidatorAmino { - description?: DescriptionAmino; - validator_address: string; + description: DescriptionAmino; + validator_address?: 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 */ - commission_rate: string; - min_self_delegation: string; + commission_rate?: string; + min_self_delegation?: string; } export interface MsgEditValidatorAminoMsg { type: "cosmos-sdk/MsgEditValidator"; @@ -135,9 +135,9 @@ export interface MsgDelegateProtoMsg { * from a delegator to a validator. */ export interface MsgDelegateAmino { - delegator_address: string; - validator_address: string; - amount?: CoinAmino; + delegator_address?: string; + validator_address?: string; + amount: CoinAmino; } export interface MsgDelegateAminoMsg { type: "cosmos-sdk/MsgDelegate"; @@ -185,10 +185,10 @@ export interface MsgBeginRedelegateProtoMsg { * of coins from a delegator and source validator to a destination validator. */ export interface MsgBeginRedelegateAmino { - delegator_address: string; - validator_src_address: string; - validator_dst_address: string; - amount?: CoinAmino; + delegator_address?: string; + validator_src_address?: string; + validator_dst_address?: string; + amount: CoinAmino; } export interface MsgBeginRedelegateAminoMsg { type: "cosmos-sdk/MsgBeginRedelegate"; @@ -214,7 +214,7 @@ export interface MsgBeginRedelegateResponseProtoMsg { } /** MsgBeginRedelegateResponse defines the Msg/BeginRedelegate response type. */ export interface MsgBeginRedelegateResponseAmino { - completion_time?: Date; + completion_time: string; } export interface MsgBeginRedelegateResponseAminoMsg { type: "cosmos-sdk/MsgBeginRedelegateResponse"; @@ -242,9 +242,9 @@ export interface MsgUndelegateProtoMsg { * delegate and a validator. */ export interface MsgUndelegateAmino { - delegator_address: string; - validator_address: string; - amount?: CoinAmino; + delegator_address?: string; + validator_address?: string; + amount: CoinAmino; } export interface MsgUndelegateAminoMsg { type: "cosmos-sdk/MsgUndelegate"; @@ -269,7 +269,7 @@ export interface MsgUndelegateResponseProtoMsg { } /** MsgUndelegateResponse defines the Msg/Undelegate response type. */ export interface MsgUndelegateResponseAmino { - completion_time?: Date; + completion_time: string; } export interface MsgUndelegateResponseAminoMsg { type: "cosmos-sdk/MsgUndelegateResponse"; @@ -279,6 +279,153 @@ export interface MsgUndelegateResponseAminoMsg { export interface MsgUndelegateResponseSDKType { completion_time: Date; } +/** + * MsgCancelUnbondingDelegation defines the SDK message for performing a cancel unbonding delegation for delegator + * + * Since: cosmos-sdk 0.46 + */ +export interface MsgCancelUnbondingDelegation { + delegatorAddress: string; + validatorAddress: string; + /** amount is always less than or equal to unbonding delegation entry balance */ + amount: Coin; + /** creation_height is the height which the unbonding took place. */ + creationHeight: bigint; +} +export interface MsgCancelUnbondingDelegationProtoMsg { + typeUrl: "/cosmos.staking.v1beta1.MsgCancelUnbondingDelegation"; + value: Uint8Array; +} +/** + * MsgCancelUnbondingDelegation defines the SDK message for performing a cancel unbonding delegation for delegator + * + * Since: cosmos-sdk 0.46 + */ +export interface MsgCancelUnbondingDelegationAmino { + delegator_address?: string; + validator_address?: string; + /** amount is always less than or equal to unbonding delegation entry balance */ + amount: CoinAmino; + /** creation_height is the height which the unbonding took place. */ + creation_height?: string; +} +export interface MsgCancelUnbondingDelegationAminoMsg { + type: "cosmos-sdk/MsgCancelUnbondingDelegation"; + value: MsgCancelUnbondingDelegationAmino; +} +/** + * MsgCancelUnbondingDelegation defines the SDK message for performing a cancel unbonding delegation for delegator + * + * Since: cosmos-sdk 0.46 + */ +export interface MsgCancelUnbondingDelegationSDKType { + delegator_address: string; + validator_address: string; + amount: CoinSDKType; + creation_height: bigint; +} +/** + * MsgCancelUnbondingDelegationResponse + * + * Since: cosmos-sdk 0.46 + */ +export interface MsgCancelUnbondingDelegationResponse {} +export interface MsgCancelUnbondingDelegationResponseProtoMsg { + typeUrl: "/cosmos.staking.v1beta1.MsgCancelUnbondingDelegationResponse"; + value: Uint8Array; +} +/** + * MsgCancelUnbondingDelegationResponse + * + * Since: cosmos-sdk 0.46 + */ +export interface MsgCancelUnbondingDelegationResponseAmino {} +export interface MsgCancelUnbondingDelegationResponseAminoMsg { + type: "cosmos-sdk/MsgCancelUnbondingDelegationResponse"; + value: MsgCancelUnbondingDelegationResponseAmino; +} +/** + * MsgCancelUnbondingDelegationResponse + * + * Since: cosmos-sdk 0.46 + */ +export interface MsgCancelUnbondingDelegationResponseSDKType {} +/** + * MsgUpdateParams is the Msg/UpdateParams request type. + * + * Since: cosmos-sdk 0.47 + */ +export interface MsgUpdateParams { + /** authority is the address that controls the module (defaults to x/gov unless overwritten). */ + authority: string; + /** + * params defines the x/staking parameters to update. + * + * NOTE: All parameters must be supplied. + */ + params: Params; +} +export interface MsgUpdateParamsProtoMsg { + typeUrl: "/cosmos.staking.v1beta1.MsgUpdateParams"; + value: Uint8Array; +} +/** + * MsgUpdateParams is the Msg/UpdateParams request type. + * + * Since: cosmos-sdk 0.47 + */ +export interface MsgUpdateParamsAmino { + /** authority is the address that controls the module (defaults to x/gov unless overwritten). */ + authority?: string; + /** + * params defines the x/staking parameters to update. + * + * NOTE: All parameters must be supplied. + */ + params: ParamsAmino; +} +export interface MsgUpdateParamsAminoMsg { + type: "cosmos-sdk/x/staking/MsgUpdateParams"; + value: MsgUpdateParamsAmino; +} +/** + * MsgUpdateParams is the Msg/UpdateParams request type. + * + * Since: cosmos-sdk 0.47 + */ +export interface MsgUpdateParamsSDKType { + authority: string; + params: ParamsSDKType; +} +/** + * MsgUpdateParamsResponse defines the response structure for executing a + * MsgUpdateParams message. + * + * Since: cosmos-sdk 0.47 + */ +export interface MsgUpdateParamsResponse {} +export interface MsgUpdateParamsResponseProtoMsg { + typeUrl: "/cosmos.staking.v1beta1.MsgUpdateParamsResponse"; + value: Uint8Array; +} +/** + * MsgUpdateParamsResponse defines the response structure for executing a + * MsgUpdateParams message. + * + * Since: cosmos-sdk 0.47 + */ +export interface MsgUpdateParamsResponseAmino {} +export interface MsgUpdateParamsResponseAminoMsg { + type: "cosmos-sdk/MsgUpdateParamsResponse"; + value: MsgUpdateParamsResponseAmino; +} +/** + * MsgUpdateParamsResponse defines the response structure for executing a + * MsgUpdateParams message. + * + * Since: cosmos-sdk 0.47 + */ +export interface MsgUpdateParamsResponseSDKType {} function createBaseMsgCreateValidator(): MsgCreateValidator { return { description: Description.fromPartial({}), @@ -286,7 +433,7 @@ function createBaseMsgCreateValidator(): MsgCreateValidator { minSelfDelegation: "", delegatorAddress: "", validatorAddress: "", - pubkey: Any.fromPartial({}), + pubkey: undefined, value: Coin.fromPartial({}) }; } @@ -363,31 +510,39 @@ export const MsgCreateValidator = { return message; }, fromAmino(object: MsgCreateValidatorAmino): MsgCreateValidator { - return { - description: object?.description ? Description.fromAmino(object.description) : undefined, - commission: object?.commission ? CommissionRates.fromAmino(object.commission) : undefined, - minSelfDelegation: object.min_self_delegation, - delegatorAddress: object.delegator_address, - validatorAddress: object.validator_address, - pubkey: encodeBech32Pubkey({ - type: "tendermint/PubKeySecp256k1", - value: toBase64(object.pubkey.value) - }, "cosmos"), - value: object?.value ? Coin.fromAmino(object.value) : undefined - }; + const message = createBaseMsgCreateValidator(); + if (object.description !== undefined && object.description !== null) { + message.description = Description.fromAmino(object.description); + } + if (object.commission !== undefined && object.commission !== null) { + message.commission = CommissionRates.fromAmino(object.commission); + } + if (object.min_self_delegation !== undefined && object.min_self_delegation !== null) { + message.minSelfDelegation = object.min_self_delegation; + } + if (object.delegator_address !== undefined && object.delegator_address !== null) { + message.delegatorAddress = object.delegator_address; + } + if (object.validator_address !== undefined && object.validator_address !== null) { + message.validatorAddress = object.validator_address; + } + if (object.pubkey !== undefined && object.pubkey !== null) { + message.pubkey = encodePubkey(object.pubkey); + } + if (object.value !== undefined && object.value !== null) { + message.value = Coin.fromAmino(object.value); + } + return message; }, toAmino(message: MsgCreateValidator): MsgCreateValidatorAmino { const obj: any = {}; - obj.description = message.description ? Description.toAmino(message.description) : undefined; - obj.commission = message.commission ? CommissionRates.toAmino(message.commission) : undefined; + obj.description = message.description ? Description.toAmino(message.description) : Description.fromPartial({}); + obj.commission = message.commission ? CommissionRates.toAmino(message.commission) : CommissionRates.fromPartial({}); obj.min_self_delegation = message.minSelfDelegation; obj.delegator_address = message.delegatorAddress; obj.validator_address = message.validatorAddress; - obj.pubkey = message.pubkey ? { - typeUrl: "/cosmos.crypto.secp256k1.PubKey", - value: fromBase64(decodeBech32Pubkey(message.pubkey).value) - } : undefined; - obj.value = message.value ? Coin.toAmino(message.value) : undefined; + obj.pubkey = message.pubkey ? decodePubkey(message.pubkey) : undefined; + obj.value = message.value ? Coin.toAmino(message.value) : Coin.fromPartial({}); return obj; }, fromAminoMsg(object: MsgCreateValidatorAminoMsg): MsgCreateValidator { @@ -439,7 +594,8 @@ export const MsgCreateValidatorResponse = { return message; }, fromAmino(_: MsgCreateValidatorResponseAmino): MsgCreateValidatorResponse { - return {}; + const message = createBaseMsgCreateValidatorResponse(); + return message; }, toAmino(_: MsgCreateValidatorResponse): MsgCreateValidatorResponseAmino { const obj: any = {}; @@ -527,16 +683,24 @@ export const MsgEditValidator = { return message; }, fromAmino(object: MsgEditValidatorAmino): MsgEditValidator { - return { - description: object?.description ? Description.fromAmino(object.description) : undefined, - validatorAddress: object.validator_address, - commissionRate: object.commission_rate, - minSelfDelegation: object.min_self_delegation - }; + const message = createBaseMsgEditValidator(); + if (object.description !== undefined && object.description !== null) { + message.description = Description.fromAmino(object.description); + } + if (object.validator_address !== undefined && object.validator_address !== null) { + message.validatorAddress = object.validator_address; + } + if (object.commission_rate !== undefined && object.commission_rate !== null) { + message.commissionRate = object.commission_rate; + } + if (object.min_self_delegation !== undefined && object.min_self_delegation !== null) { + message.minSelfDelegation = object.min_self_delegation; + } + return message; }, toAmino(message: MsgEditValidator): MsgEditValidatorAmino { const obj: any = {}; - obj.description = message.description ? Description.toAmino(message.description) : undefined; + obj.description = message.description ? Description.toAmino(message.description) : Description.fromPartial({}); obj.validator_address = message.validatorAddress; obj.commission_rate = message.commissionRate; obj.min_self_delegation = message.minSelfDelegation; @@ -591,7 +755,8 @@ export const MsgEditValidatorResponse = { return message; }, fromAmino(_: MsgEditValidatorResponseAmino): MsgEditValidatorResponse { - return {}; + const message = createBaseMsgEditValidatorResponse(); + return message; }, toAmino(_: MsgEditValidatorResponse): MsgEditValidatorResponseAmino { const obj: any = {}; @@ -671,17 +836,23 @@ export const MsgDelegate = { return message; }, fromAmino(object: MsgDelegateAmino): MsgDelegate { - return { - delegatorAddress: object.delegator_address, - validatorAddress: object.validator_address, - amount: object?.amount ? Coin.fromAmino(object.amount) : undefined - }; + const message = createBaseMsgDelegate(); + if (object.delegator_address !== undefined && object.delegator_address !== null) { + message.delegatorAddress = object.delegator_address; + } + if (object.validator_address !== undefined && object.validator_address !== null) { + message.validatorAddress = object.validator_address; + } + if (object.amount !== undefined && object.amount !== null) { + message.amount = Coin.fromAmino(object.amount); + } + return message; }, toAmino(message: MsgDelegate): MsgDelegateAmino { const obj: any = {}; obj.delegator_address = message.delegatorAddress; obj.validator_address = message.validatorAddress; - obj.amount = message.amount ? Coin.toAmino(message.amount) : undefined; + obj.amount = message.amount ? Coin.toAmino(message.amount) : Coin.fromPartial({}); return obj; }, fromAminoMsg(object: MsgDelegateAminoMsg): MsgDelegate { @@ -733,7 +904,8 @@ export const MsgDelegateResponse = { return message; }, fromAmino(_: MsgDelegateResponseAmino): MsgDelegateResponse { - return {}; + const message = createBaseMsgDelegateResponse(); + return message; }, toAmino(_: MsgDelegateResponse): MsgDelegateResponseAmino { const obj: any = {}; @@ -821,19 +993,27 @@ export const MsgBeginRedelegate = { return message; }, fromAmino(object: MsgBeginRedelegateAmino): MsgBeginRedelegate { - return { - delegatorAddress: object.delegator_address, - validatorSrcAddress: object.validator_src_address, - validatorDstAddress: object.validator_dst_address, - amount: object?.amount ? Coin.fromAmino(object.amount) : undefined - }; + const message = createBaseMsgBeginRedelegate(); + if (object.delegator_address !== undefined && object.delegator_address !== null) { + message.delegatorAddress = object.delegator_address; + } + if (object.validator_src_address !== undefined && object.validator_src_address !== null) { + message.validatorSrcAddress = object.validator_src_address; + } + if (object.validator_dst_address !== undefined && object.validator_dst_address !== null) { + message.validatorDstAddress = object.validator_dst_address; + } + if (object.amount !== undefined && object.amount !== null) { + message.amount = Coin.fromAmino(object.amount); + } + return message; }, toAmino(message: MsgBeginRedelegate): MsgBeginRedelegateAmino { const obj: any = {}; obj.delegator_address = message.delegatorAddress; obj.validator_src_address = message.validatorSrcAddress; obj.validator_dst_address = message.validatorDstAddress; - obj.amount = message.amount ? Coin.toAmino(message.amount) : undefined; + obj.amount = message.amount ? Coin.toAmino(message.amount) : Coin.fromPartial({}); return obj; }, fromAminoMsg(object: MsgBeginRedelegateAminoMsg): MsgBeginRedelegate { @@ -894,13 +1074,15 @@ export const MsgBeginRedelegateResponse = { return message; }, fromAmino(object: MsgBeginRedelegateResponseAmino): MsgBeginRedelegateResponse { - return { - completionTime: object.completion_time - }; + const message = createBaseMsgBeginRedelegateResponse(); + if (object.completion_time !== undefined && object.completion_time !== null) { + message.completionTime = fromTimestamp(Timestamp.fromAmino(object.completion_time)); + } + return message; }, toAmino(message: MsgBeginRedelegateResponse): MsgBeginRedelegateResponseAmino { const obj: any = {}; - obj.completion_time = message.completionTime; + obj.completion_time = message.completionTime ? Timestamp.toAmino(toTimestamp(message.completionTime)) : new Date(); return obj; }, fromAminoMsg(object: MsgBeginRedelegateResponseAminoMsg): MsgBeginRedelegateResponse { @@ -977,17 +1159,23 @@ export const MsgUndelegate = { return message; }, fromAmino(object: MsgUndelegateAmino): MsgUndelegate { - return { - delegatorAddress: object.delegator_address, - validatorAddress: object.validator_address, - amount: object?.amount ? Coin.fromAmino(object.amount) : undefined - }; + const message = createBaseMsgUndelegate(); + if (object.delegator_address !== undefined && object.delegator_address !== null) { + message.delegatorAddress = object.delegator_address; + } + if (object.validator_address !== undefined && object.validator_address !== null) { + message.validatorAddress = object.validator_address; + } + if (object.amount !== undefined && object.amount !== null) { + message.amount = Coin.fromAmino(object.amount); + } + return message; }, toAmino(message: MsgUndelegate): MsgUndelegateAmino { const obj: any = {}; obj.delegator_address = message.delegatorAddress; obj.validator_address = message.validatorAddress; - obj.amount = message.amount ? Coin.toAmino(message.amount) : undefined; + obj.amount = message.amount ? Coin.toAmino(message.amount) : Coin.fromPartial({}); return obj; }, fromAminoMsg(object: MsgUndelegateAminoMsg): MsgUndelegate { @@ -1048,13 +1236,15 @@ export const MsgUndelegateResponse = { return message; }, fromAmino(object: MsgUndelegateResponseAmino): MsgUndelegateResponse { - return { - completionTime: object.completion_time - }; + const message = createBaseMsgUndelegateResponse(); + if (object.completion_time !== undefined && object.completion_time !== null) { + message.completionTime = fromTimestamp(Timestamp.fromAmino(object.completion_time)); + } + return message; }, toAmino(message: MsgUndelegateResponse): MsgUndelegateResponseAmino { const obj: any = {}; - obj.completion_time = message.completionTime; + obj.completion_time = message.completionTime ? Timestamp.toAmino(toTimestamp(message.completionTime)) : new Date(); return obj; }, fromAminoMsg(object: MsgUndelegateResponseAminoMsg): MsgUndelegateResponse { @@ -1079,23 +1269,315 @@ export const MsgUndelegateResponse = { }; } }; +function createBaseMsgCancelUnbondingDelegation(): MsgCancelUnbondingDelegation { + return { + delegatorAddress: "", + validatorAddress: "", + amount: Coin.fromPartial({}), + creationHeight: BigInt(0) + }; +} +export const MsgCancelUnbondingDelegation = { + typeUrl: "/cosmos.staking.v1beta1.MsgCancelUnbondingDelegation", + encode(message: MsgCancelUnbondingDelegation, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.delegatorAddress !== "") { + writer.uint32(10).string(message.delegatorAddress); + } + if (message.validatorAddress !== "") { + writer.uint32(18).string(message.validatorAddress); + } + if (message.amount !== undefined) { + Coin.encode(message.amount, writer.uint32(26).fork()).ldelim(); + } + if (message.creationHeight !== BigInt(0)) { + writer.uint32(32).int64(message.creationHeight); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgCancelUnbondingDelegation { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgCancelUnbondingDelegation(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.delegatorAddress = reader.string(); + break; + case 2: + message.validatorAddress = reader.string(); + break; + case 3: + message.amount = Coin.decode(reader, reader.uint32()); + break; + case 4: + message.creationHeight = reader.int64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgCancelUnbondingDelegation { + const message = createBaseMsgCancelUnbondingDelegation(); + message.delegatorAddress = object.delegatorAddress ?? ""; + message.validatorAddress = object.validatorAddress ?? ""; + message.amount = object.amount !== undefined && object.amount !== null ? Coin.fromPartial(object.amount) : undefined; + message.creationHeight = object.creationHeight !== undefined && object.creationHeight !== null ? BigInt(object.creationHeight.toString()) : BigInt(0); + return message; + }, + fromAmino(object: MsgCancelUnbondingDelegationAmino): MsgCancelUnbondingDelegation { + const message = createBaseMsgCancelUnbondingDelegation(); + if (object.delegator_address !== undefined && object.delegator_address !== null) { + message.delegatorAddress = object.delegator_address; + } + if (object.validator_address !== undefined && object.validator_address !== null) { + message.validatorAddress = object.validator_address; + } + if (object.amount !== undefined && object.amount !== null) { + message.amount = Coin.fromAmino(object.amount); + } + if (object.creation_height !== undefined && object.creation_height !== null) { + message.creationHeight = BigInt(object.creation_height); + } + return message; + }, + toAmino(message: MsgCancelUnbondingDelegation): MsgCancelUnbondingDelegationAmino { + const obj: any = {}; + obj.delegator_address = message.delegatorAddress; + obj.validator_address = message.validatorAddress; + obj.amount = message.amount ? Coin.toAmino(message.amount) : Coin.fromPartial({}); + obj.creation_height = message.creationHeight ? message.creationHeight.toString() : undefined; + return obj; + }, + fromAminoMsg(object: MsgCancelUnbondingDelegationAminoMsg): MsgCancelUnbondingDelegation { + return MsgCancelUnbondingDelegation.fromAmino(object.value); + }, + toAminoMsg(message: MsgCancelUnbondingDelegation): MsgCancelUnbondingDelegationAminoMsg { + return { + type: "cosmos-sdk/MsgCancelUnbondingDelegation", + value: MsgCancelUnbondingDelegation.toAmino(message) + }; + }, + fromProtoMsg(message: MsgCancelUnbondingDelegationProtoMsg): MsgCancelUnbondingDelegation { + return MsgCancelUnbondingDelegation.decode(message.value); + }, + toProto(message: MsgCancelUnbondingDelegation): Uint8Array { + return MsgCancelUnbondingDelegation.encode(message).finish(); + }, + toProtoMsg(message: MsgCancelUnbondingDelegation): MsgCancelUnbondingDelegationProtoMsg { + return { + typeUrl: "/cosmos.staking.v1beta1.MsgCancelUnbondingDelegation", + value: MsgCancelUnbondingDelegation.encode(message).finish() + }; + } +}; +function createBaseMsgCancelUnbondingDelegationResponse(): MsgCancelUnbondingDelegationResponse { + return {}; +} +export const MsgCancelUnbondingDelegationResponse = { + typeUrl: "/cosmos.staking.v1beta1.MsgCancelUnbondingDelegationResponse", + encode(_: MsgCancelUnbondingDelegationResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgCancelUnbondingDelegationResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgCancelUnbondingDelegationResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): MsgCancelUnbondingDelegationResponse { + const message = createBaseMsgCancelUnbondingDelegationResponse(); + return message; + }, + fromAmino(_: MsgCancelUnbondingDelegationResponseAmino): MsgCancelUnbondingDelegationResponse { + const message = createBaseMsgCancelUnbondingDelegationResponse(); + return message; + }, + toAmino(_: MsgCancelUnbondingDelegationResponse): MsgCancelUnbondingDelegationResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgCancelUnbondingDelegationResponseAminoMsg): MsgCancelUnbondingDelegationResponse { + return MsgCancelUnbondingDelegationResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgCancelUnbondingDelegationResponse): MsgCancelUnbondingDelegationResponseAminoMsg { + return { + type: "cosmos-sdk/MsgCancelUnbondingDelegationResponse", + value: MsgCancelUnbondingDelegationResponse.toAmino(message) + }; + }, + fromProtoMsg(message: MsgCancelUnbondingDelegationResponseProtoMsg): MsgCancelUnbondingDelegationResponse { + return MsgCancelUnbondingDelegationResponse.decode(message.value); + }, + toProto(message: MsgCancelUnbondingDelegationResponse): Uint8Array { + return MsgCancelUnbondingDelegationResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgCancelUnbondingDelegationResponse): MsgCancelUnbondingDelegationResponseProtoMsg { + return { + typeUrl: "/cosmos.staking.v1beta1.MsgCancelUnbondingDelegationResponse", + value: MsgCancelUnbondingDelegationResponse.encode(message).finish() + }; + } +}; +function createBaseMsgUpdateParams(): MsgUpdateParams { + return { + authority: "", + params: Params.fromPartial({}) + }; +} +export const MsgUpdateParams = { + typeUrl: "/cosmos.staking.v1beta1.MsgUpdateParams", + encode(message: MsgUpdateParams, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.authority !== "") { + writer.uint32(10).string(message.authority); + } + if (message.params !== undefined) { + Params.encode(message.params, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgUpdateParams { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUpdateParams(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.authority = reader.string(); + break; + case 2: + message.params = Params.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgUpdateParams { + const message = createBaseMsgUpdateParams(); + message.authority = object.authority ?? ""; + message.params = object.params !== undefined && object.params !== null ? Params.fromPartial(object.params) : undefined; + return message; + }, + fromAmino(object: MsgUpdateParamsAmino): MsgUpdateParams { + const message = createBaseMsgUpdateParams(); + if (object.authority !== undefined && object.authority !== null) { + message.authority = object.authority; + } + if (object.params !== undefined && object.params !== null) { + message.params = Params.fromAmino(object.params); + } + return message; + }, + toAmino(message: MsgUpdateParams): MsgUpdateParamsAmino { + const obj: any = {}; + obj.authority = message.authority; + obj.params = message.params ? Params.toAmino(message.params) : Params.fromPartial({}); + return obj; + }, + fromAminoMsg(object: MsgUpdateParamsAminoMsg): MsgUpdateParams { + return MsgUpdateParams.fromAmino(object.value); + }, + toAminoMsg(message: MsgUpdateParams): MsgUpdateParamsAminoMsg { + return { + type: "cosmos-sdk/x/staking/MsgUpdateParams", + value: MsgUpdateParams.toAmino(message) + }; + }, + fromProtoMsg(message: MsgUpdateParamsProtoMsg): MsgUpdateParams { + return MsgUpdateParams.decode(message.value); + }, + toProto(message: MsgUpdateParams): Uint8Array { + return MsgUpdateParams.encode(message).finish(); + }, + toProtoMsg(message: MsgUpdateParams): MsgUpdateParamsProtoMsg { + return { + typeUrl: "/cosmos.staking.v1beta1.MsgUpdateParams", + value: MsgUpdateParams.encode(message).finish() + }; + } +}; +function createBaseMsgUpdateParamsResponse(): MsgUpdateParamsResponse { + return {}; +} +export const MsgUpdateParamsResponse = { + typeUrl: "/cosmos.staking.v1beta1.MsgUpdateParamsResponse", + encode(_: MsgUpdateParamsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgUpdateParamsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUpdateParamsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): MsgUpdateParamsResponse { + const message = createBaseMsgUpdateParamsResponse(); + return message; + }, + fromAmino(_: MsgUpdateParamsResponseAmino): MsgUpdateParamsResponse { + const message = createBaseMsgUpdateParamsResponse(); + return message; + }, + toAmino(_: MsgUpdateParamsResponse): MsgUpdateParamsResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgUpdateParamsResponseAminoMsg): MsgUpdateParamsResponse { + return MsgUpdateParamsResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgUpdateParamsResponse): MsgUpdateParamsResponseAminoMsg { + return { + type: "cosmos-sdk/MsgUpdateParamsResponse", + value: MsgUpdateParamsResponse.toAmino(message) + }; + }, + fromProtoMsg(message: MsgUpdateParamsResponseProtoMsg): MsgUpdateParamsResponse { + return MsgUpdateParamsResponse.decode(message.value); + }, + toProto(message: MsgUpdateParamsResponse): Uint8Array { + return MsgUpdateParamsResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgUpdateParamsResponse): MsgUpdateParamsResponseProtoMsg { + return { + typeUrl: "/cosmos.staking.v1beta1.MsgUpdateParamsResponse", + value: MsgUpdateParamsResponse.encode(message).finish() + }; + } +}; export const Cosmos_cryptoPubKey_InterfaceDecoder = (input: BinaryReader | Uint8Array): Any => { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - const data = Any.decode(reader, reader.uint32()); + const data = Any.decode(reader, reader.uint32(), true); switch (data.typeUrl) { default: return data; } }; export const Cosmos_cryptoPubKey_FromAmino = (content: AnyAmino) => { - return encodeBech32Pubkey({ - type: "tendermint/PubKeySecp256k1", - value: toBase64(content.value) - }, "cosmos"); + return encodePubkey(content); }; -export const Cosmos_cryptoPubKey_ToAmino = (content: Any) => { - return { - typeUrl: "/cosmos.crypto.secp256k1.PubKey", - value: fromBase64(decodeBech32Pubkey(content).value) - }; +export const Cosmos_cryptoPubKey_ToAmino = (content: Any): Pubkey | null => { + return decodePubkey(content); }; \ No newline at end of file diff --git a/packages/osmo-query/src/codegen/cosmos/tx/config/v1/config.ts b/packages/osmo-query/src/codegen/cosmos/tx/config/v1/config.ts new file mode 100644 index 000000000..ab9615c90 --- /dev/null +++ b/packages/osmo-query/src/codegen/cosmos/tx/config/v1/config.ts @@ -0,0 +1,121 @@ +import { BinaryReader, BinaryWriter } from "../../../../binary"; +/** Config is the config object of the x/auth/tx package. */ +export interface Config { + /** + * skip_ante_handler defines whether the ante handler registration should be skipped in case an app wants to override + * this functionality. + */ + skipAnteHandler: boolean; + /** + * skip_post_handler defines whether the post handler registration should be skipped in case an app wants to override + * this functionality. + */ + skipPostHandler: boolean; +} +export interface ConfigProtoMsg { + typeUrl: "/cosmos.tx.config.v1.Config"; + value: Uint8Array; +} +/** Config is the config object of the x/auth/tx package. */ +export interface ConfigAmino { + /** + * skip_ante_handler defines whether the ante handler registration should be skipped in case an app wants to override + * this functionality. + */ + skip_ante_handler?: boolean; + /** + * skip_post_handler defines whether the post handler registration should be skipped in case an app wants to override + * this functionality. + */ + skip_post_handler?: boolean; +} +export interface ConfigAminoMsg { + type: "cosmos-sdk/Config"; + value: ConfigAmino; +} +/** Config is the config object of the x/auth/tx package. */ +export interface ConfigSDKType { + skip_ante_handler: boolean; + skip_post_handler: boolean; +} +function createBaseConfig(): Config { + return { + skipAnteHandler: false, + skipPostHandler: false + }; +} +export const Config = { + typeUrl: "/cosmos.tx.config.v1.Config", + encode(message: Config, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.skipAnteHandler === true) { + writer.uint32(8).bool(message.skipAnteHandler); + } + if (message.skipPostHandler === true) { + writer.uint32(16).bool(message.skipPostHandler); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): Config { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseConfig(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.skipAnteHandler = reader.bool(); + break; + case 2: + message.skipPostHandler = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): Config { + const message = createBaseConfig(); + message.skipAnteHandler = object.skipAnteHandler ?? false; + message.skipPostHandler = object.skipPostHandler ?? false; + return message; + }, + fromAmino(object: ConfigAmino): Config { + const message = createBaseConfig(); + if (object.skip_ante_handler !== undefined && object.skip_ante_handler !== null) { + message.skipAnteHandler = object.skip_ante_handler; + } + if (object.skip_post_handler !== undefined && object.skip_post_handler !== null) { + message.skipPostHandler = object.skip_post_handler; + } + return message; + }, + toAmino(message: Config): ConfigAmino { + const obj: any = {}; + obj.skip_ante_handler = message.skipAnteHandler; + obj.skip_post_handler = message.skipPostHandler; + return obj; + }, + fromAminoMsg(object: ConfigAminoMsg): Config { + return Config.fromAmino(object.value); + }, + toAminoMsg(message: Config): ConfigAminoMsg { + return { + type: "cosmos-sdk/Config", + value: Config.toAmino(message) + }; + }, + fromProtoMsg(message: ConfigProtoMsg): Config { + return Config.decode(message.value); + }, + toProto(message: Config): Uint8Array { + return Config.encode(message).finish(); + }, + toProtoMsg(message: Config): ConfigProtoMsg { + return { + typeUrl: "/cosmos.tx.config.v1.Config", + value: Config.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/packages/osmo-query/src/codegen/cosmos/tx/signing/v1beta1/signing.ts b/packages/osmo-query/src/codegen/cosmos/tx/signing/v1beta1/signing.ts index 684a7be97..505245e6c 100644 --- a/packages/osmo-query/src/codegen/cosmos/tx/signing/v1beta1/signing.ts +++ b/packages/osmo-query/src/codegen/cosmos/tx/signing/v1beta1/signing.ts @@ -1,28 +1,46 @@ import { CompactBitArray, CompactBitArrayAmino, CompactBitArraySDKType } from "../../../crypto/multisig/v1beta1/multisig"; import { Any, AnyAmino, AnySDKType } from "../../../../google/protobuf/any"; import { BinaryReader, BinaryWriter } from "../../../../binary"; -import { isSet } from "../../../../helpers"; -/** SignMode represents a signing mode with its own security guarantees. */ +import { bytesFromBase64, base64FromBytes } from "../../../../helpers"; +/** + * SignMode represents a signing mode with its own security guarantees. + * + * This enum should be considered a registry of all known sign modes + * in the Cosmos ecosystem. Apps are not expected to support all known + * sign modes. Apps that would like to support custom sign modes are + * encouraged to open a small PR against this file to add a new case + * to this SignMode enum describing their sign mode so that different + * apps have a consistent version of this enum. + */ export enum SignMode { /** * SIGN_MODE_UNSPECIFIED - SIGN_MODE_UNSPECIFIED specifies an unknown signing mode and will be - * rejected + * rejected. */ SIGN_MODE_UNSPECIFIED = 0, /** * SIGN_MODE_DIRECT - SIGN_MODE_DIRECT specifies a signing mode which uses SignDoc and is - * verified with raw bytes from Tx + * verified with raw bytes from Tx. */ SIGN_MODE_DIRECT = 1, /** * SIGN_MODE_TEXTUAL - SIGN_MODE_TEXTUAL is a future signing mode that will verify some * human-readable textual representation on top of the binary representation - * from SIGN_MODE_DIRECT + * from SIGN_MODE_DIRECT. It is currently not supported. */ SIGN_MODE_TEXTUAL = 2, + /** + * SIGN_MODE_DIRECT_AUX - SIGN_MODE_DIRECT_AUX specifies a signing mode which uses + * SignDocDirectAux. As opposed to SIGN_MODE_DIRECT, this sign mode does not + * require signers signing over other signers' `signer_info`. It also allows + * for adding Tips in transactions. + * + * Since: cosmos-sdk 0.46 + */ + SIGN_MODE_DIRECT_AUX = 3, /** * SIGN_MODE_LEGACY_AMINO_JSON - SIGN_MODE_LEGACY_AMINO_JSON is a backwards compatibility mode which uses - * Amino JSON and will be removed in the future + * Amino JSON and will be removed in the future. */ SIGN_MODE_LEGACY_AMINO_JSON = 127, /** @@ -53,6 +71,9 @@ export function signModeFromJSON(object: any): SignMode { case 2: case "SIGN_MODE_TEXTUAL": return SignMode.SIGN_MODE_TEXTUAL; + case 3: + case "SIGN_MODE_DIRECT_AUX": + return SignMode.SIGN_MODE_DIRECT_AUX; case 127: case "SIGN_MODE_LEGACY_AMINO_JSON": return SignMode.SIGN_MODE_LEGACY_AMINO_JSON; @@ -73,6 +94,8 @@ export function signModeToJSON(object: SignMode): string { return "SIGN_MODE_DIRECT"; case SignMode.SIGN_MODE_TEXTUAL: return "SIGN_MODE_TEXTUAL"; + case SignMode.SIGN_MODE_DIRECT_AUX: + return "SIGN_MODE_DIRECT_AUX"; case SignMode.SIGN_MODE_LEGACY_AMINO_JSON: return "SIGN_MODE_LEGACY_AMINO_JSON"; case SignMode.SIGN_MODE_EIP_191: @@ -94,7 +117,7 @@ export interface SignatureDescriptorsProtoMsg { /** SignatureDescriptors wraps multiple SignatureDescriptor's. */ export interface SignatureDescriptorsAmino { /** signatures are the signature descriptors */ - signatures: SignatureDescriptorAmino[]; + signatures?: SignatureDescriptorAmino[]; } export interface SignatureDescriptorsAminoMsg { type: "cosmos-sdk/SignatureDescriptors"; @@ -112,8 +135,8 @@ export interface SignatureDescriptorsSDKType { */ 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 @@ -140,7 +163,7 @@ export interface SignatureDescriptorAmino { * number of committed transactions signed by a given address. It is used to prevent * replay attacks. */ - sequence: string; + sequence?: string; } export interface SignatureDescriptorAminoMsg { type: "cosmos-sdk/SignatureDescriptor"; @@ -153,8 +176,8 @@ export interface SignatureDescriptorAminoMsg { * clients. */ export interface SignatureDescriptorSDKType { - public_key: AnySDKType; - data: SignatureDescriptor_DataSDKType; + public_key?: AnySDKType; + data?: SignatureDescriptor_DataSDKType; sequence: bigint; } /** Data represents signature data */ @@ -198,9 +221,9 @@ export interface SignatureDescriptor_Data_SingleProtoMsg { /** Single is the signature data for a single signer */ export interface SignatureDescriptor_Data_SingleAmino { /** mode is the signing mode of the single signer */ - mode: SignMode; + mode?: SignMode; /** signature is the raw signature bytes */ - signature: Uint8Array; + signature?: string; } export interface SignatureDescriptor_Data_SingleAminoMsg { type: "cosmos-sdk/Single"; @@ -214,7 +237,7 @@ export interface SignatureDescriptor_Data_SingleSDKType { /** 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[]; } @@ -227,7 +250,7 @@ export interface SignatureDescriptor_Data_MultiAmino { /** bitarray specifies which keys within the multisig are signing */ bitarray?: CompactBitArrayAmino; /** signatures is the signatures of the multi-signature */ - signatures: SignatureDescriptor_DataAmino[]; + signatures?: SignatureDescriptor_DataAmino[]; } export interface SignatureDescriptor_Data_MultiAminoMsg { type: "cosmos-sdk/Multi"; @@ -235,7 +258,7 @@ export interface SignatureDescriptor_Data_MultiAminoMsg { } /** Multi is the signature data for a multisig public key */ export interface SignatureDescriptor_Data_MultiSDKType { - bitarray: CompactBitArraySDKType; + bitarray?: CompactBitArraySDKType; signatures: SignatureDescriptor_DataSDKType[]; } function createBaseSignatureDescriptors(): SignatureDescriptors { @@ -274,9 +297,9 @@ export const SignatureDescriptors = { return message; }, fromAmino(object: SignatureDescriptorsAmino): SignatureDescriptors { - return { - signatures: Array.isArray(object?.signatures) ? object.signatures.map((e: any) => SignatureDescriptor.fromAmino(e)) : [] - }; + const message = createBaseSignatureDescriptors(); + message.signatures = object.signatures?.map(e => SignatureDescriptor.fromAmino(e)) || []; + return message; }, toAmino(message: SignatureDescriptors): SignatureDescriptorsAmino { const obj: any = {}; @@ -311,8 +334,8 @@ export const SignatureDescriptors = { }; function createBaseSignatureDescriptor(): SignatureDescriptor { return { - publicKey: Any.fromPartial({}), - data: Data.fromPartial({}), + publicKey: undefined, + data: undefined, sequence: BigInt(0) }; } @@ -361,11 +384,17 @@ export const SignatureDescriptor = { return message; }, fromAmino(object: SignatureDescriptorAmino): SignatureDescriptor { - return { - publicKey: object?.public_key ? Any.fromAmino(object.public_key) : undefined, - data: object?.data ? SignatureDescriptor_Data.fromAmino(object.data) : undefined, - sequence: BigInt(object.sequence) - }; + const message = createBaseSignatureDescriptor(); + if (object.public_key !== undefined && object.public_key !== null) { + message.publicKey = Any.fromAmino(object.public_key); + } + if (object.data !== undefined && object.data !== null) { + message.data = SignatureDescriptor_Data.fromAmino(object.data); + } + if (object.sequence !== undefined && object.sequence !== null) { + message.sequence = BigInt(object.sequence); + } + return message; }, toAmino(message: SignatureDescriptor): SignatureDescriptorAmino { const obj: any = {}; @@ -440,10 +469,14 @@ export const SignatureDescriptor_Data = { return message; }, fromAmino(object: SignatureDescriptor_DataAmino): SignatureDescriptor_Data { - return { - single: object?.single ? SignatureDescriptor_Data_Single.fromAmino(object.single) : undefined, - multi: object?.multi ? SignatureDescriptor_Data_Multi.fromAmino(object.multi) : undefined - }; + const message = createBaseSignatureDescriptor_Data(); + if (object.single !== undefined && object.single !== null) { + message.single = SignatureDescriptor_Data_Single.fromAmino(object.single); + } + if (object.multi !== undefined && object.multi !== null) { + message.multi = SignatureDescriptor_Data_Multi.fromAmino(object.multi); + } + return message; }, toAmino(message: SignatureDescriptor_Data): SignatureDescriptor_DataAmino { const obj: any = {}; @@ -517,15 +550,19 @@ export const SignatureDescriptor_Data_Single = { return message; }, fromAmino(object: SignatureDescriptor_Data_SingleAmino): SignatureDescriptor_Data_Single { - return { - mode: isSet(object.mode) ? signModeFromJSON(object.mode) : -1, - signature: object.signature - }; + const message = createBaseSignatureDescriptor_Data_Single(); + if (object.mode !== undefined && object.mode !== null) { + message.mode = signModeFromJSON(object.mode); + } + if (object.signature !== undefined && object.signature !== null) { + message.signature = bytesFromBase64(object.signature); + } + return message; }, toAmino(message: SignatureDescriptor_Data_Single): SignatureDescriptor_Data_SingleAmino { const obj: any = {}; - obj.mode = message.mode; - obj.signature = message.signature; + obj.mode = signModeToJSON(message.mode); + obj.signature = message.signature ? base64FromBytes(message.signature) : undefined; return obj; }, fromAminoMsg(object: SignatureDescriptor_Data_SingleAminoMsg): SignatureDescriptor_Data_Single { @@ -552,7 +589,7 @@ export const SignatureDescriptor_Data_Single = { }; function createBaseSignatureDescriptor_Data_Multi(): SignatureDescriptor_Data_Multi { return { - bitarray: CompactBitArray.fromPartial({}), + bitarray: undefined, signatures: [] }; } @@ -594,10 +631,12 @@ export const SignatureDescriptor_Data_Multi = { return message; }, fromAmino(object: SignatureDescriptor_Data_MultiAmino): SignatureDescriptor_Data_Multi { - return { - bitarray: object?.bitarray ? CompactBitArray.fromAmino(object.bitarray) : undefined, - signatures: Array.isArray(object?.signatures) ? object.signatures.map((e: any) => SignatureDescriptor_Data.fromAmino(e)) : [] - }; + const message = createBaseSignatureDescriptor_Data_Multi(); + if (object.bitarray !== undefined && object.bitarray !== null) { + message.bitarray = CompactBitArray.fromAmino(object.bitarray); + } + message.signatures = object.signatures?.map(e => SignatureDescriptor_Data.fromAmino(e)) || []; + return message; }, toAmino(message: SignatureDescriptor_Data_Multi): SignatureDescriptor_Data_MultiAmino { const obj: any = {}; diff --git a/packages/osmo-query/src/codegen/cosmos/tx/v1beta1/service.lcd.ts b/packages/osmo-query/src/codegen/cosmos/tx/v1beta1/service.lcd.ts index 2ae7a7b58..185943478 100644 --- a/packages/osmo-query/src/codegen/cosmos/tx/v1beta1/service.lcd.ts +++ b/packages/osmo-query/src/codegen/cosmos/tx/v1beta1/service.lcd.ts @@ -1,6 +1,6 @@ import { setPaginationParams } from "../../../helpers"; import { LCDClient } from "@cosmology/lcd"; -import { GetTxRequest, GetTxResponseSDKType, GetTxsEventRequest, GetTxsEventResponseSDKType } from "./service"; +import { GetTxRequest, GetTxResponseSDKType, GetTxsEventRequest, GetTxsEventResponseSDKType, GetBlockWithTxsRequest, GetBlockWithTxsResponseSDKType } from "./service"; export class LCDQueryClient { req: LCDClient; constructor({ @@ -11,6 +11,7 @@ export class LCDQueryClient { this.req = requestClient; this.getTx = this.getTx.bind(this); this.getTxsEvent = this.getTxsEvent.bind(this); + this.getBlockWithTxs = this.getBlockWithTxs.bind(this); } /* GetTx fetches a tx by hash. */ async getTx(params: GetTxRequest): Promise { @@ -31,7 +32,26 @@ export class LCDQueryClient { if (typeof params?.orderBy !== "undefined") { options.params.order_by = params.orderBy; } + if (typeof params?.page !== "undefined") { + options.params.page = params.page; + } + if (typeof params?.limit !== "undefined") { + options.params.limit = params.limit; + } const endpoint = `cosmos/tx/v1beta1/txs`; return await this.req.get(endpoint, options); } + /* GetBlockWithTxs fetches a block with decoded txs. + + Since: cosmos-sdk 0.45.2 */ + async getBlockWithTxs(params: GetBlockWithTxsRequest): Promise { + const options: any = { + params: {} + }; + if (typeof params?.pagination !== "undefined") { + setPaginationParams(options, params.pagination); + } + const endpoint = `cosmos/tx/v1beta1/txs/block/${params.height}`; + return await this.req.get(endpoint, options); + } } \ No newline at end of file diff --git a/packages/osmo-query/src/codegen/cosmos/tx/v1beta1/service.rpc.Service.ts b/packages/osmo-query/src/codegen/cosmos/tx/v1beta1/service.rpc.Service.ts index 351973dd3..8475acdf3 100644 --- a/packages/osmo-query/src/codegen/cosmos/tx/v1beta1/service.rpc.Service.ts +++ b/packages/osmo-query/src/codegen/cosmos/tx/v1beta1/service.rpc.Service.ts @@ -3,7 +3,7 @@ import { BinaryReader } from "../../../binary"; import { QueryClient, createProtobufRpcClient, ProtobufRpcClient } from "@cosmjs/stargate"; import { ReactQueryParams } from "../../../react-query"; import { useQuery } from "@tanstack/react-query"; -import { SimulateRequest, SimulateResponse, GetTxRequest, GetTxResponse, BroadcastTxRequest, BroadcastTxResponse, GetTxsEventRequest, GetTxsEventResponse } from "./service"; +import { SimulateRequest, SimulateResponse, GetTxRequest, GetTxResponse, BroadcastTxRequest, BroadcastTxResponse, GetTxsEventRequest, GetTxsEventResponse, GetBlockWithTxsRequest, GetBlockWithTxsResponse, TxDecodeRequest, TxDecodeResponse, TxEncodeRequest, TxEncodeResponse, TxEncodeAminoRequest, TxEncodeAminoResponse, TxDecodeAminoRequest, TxDecodeAminoResponse } from "./service"; /** Service defines a gRPC service for interacting with transactions. */ export interface Service { /** Simulate simulates executing a transaction for estimating gas usage. */ @@ -14,6 +14,36 @@ export interface Service { broadcastTx(request: BroadcastTxRequest): Promise; /** GetTxsEvent fetches txs by event. */ getTxsEvent(request: GetTxsEventRequest): Promise; + /** + * GetBlockWithTxs fetches a block with decoded txs. + * + * Since: cosmos-sdk 0.45.2 + */ + getBlockWithTxs(request: GetBlockWithTxsRequest): Promise; + /** + * TxDecode decodes the transaction. + * + * Since: cosmos-sdk 0.47 + */ + txDecode(request: TxDecodeRequest): Promise; + /** + * TxEncode encodes the transaction. + * + * Since: cosmos-sdk 0.47 + */ + txEncode(request: TxEncodeRequest): Promise; + /** + * TxEncodeAmino encodes an Amino transaction from JSON to encoded bytes. + * + * Since: cosmos-sdk 0.47 + */ + txEncodeAmino(request: TxEncodeAminoRequest): Promise; + /** + * TxDecodeAmino decodes an Amino transaction from encoded bytes to JSON. + * + * Since: cosmos-sdk 0.47 + */ + txDecodeAmino(request: TxDecodeAminoRequest): Promise; } export class ServiceClientImpl implements Service { private readonly rpc: Rpc; @@ -23,6 +53,11 @@ export class ServiceClientImpl implements Service { 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.txDecode = this.txDecode.bind(this); + this.txEncode = this.txEncode.bind(this); + this.txEncodeAmino = this.txEncodeAmino.bind(this); + this.txDecodeAmino = this.txDecodeAmino.bind(this); } simulate(request: SimulateRequest): Promise { const data = SimulateRequest.encode(request).finish(); @@ -44,6 +79,31 @@ export class ServiceClientImpl implements Service { const promise = this.rpc.request("cosmos.tx.v1beta1.Service", "GetTxsEvent", data); return promise.then(data => GetTxsEventResponse.decode(new BinaryReader(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 BinaryReader(data))); + } + txDecode(request: TxDecodeRequest): Promise { + const data = TxDecodeRequest.encode(request).finish(); + const promise = this.rpc.request("cosmos.tx.v1beta1.Service", "TxDecode", data); + return promise.then(data => TxDecodeResponse.decode(new BinaryReader(data))); + } + txEncode(request: TxEncodeRequest): Promise { + const data = TxEncodeRequest.encode(request).finish(); + const promise = this.rpc.request("cosmos.tx.v1beta1.Service", "TxEncode", data); + return promise.then(data => TxEncodeResponse.decode(new BinaryReader(data))); + } + txEncodeAmino(request: TxEncodeAminoRequest): Promise { + const data = TxEncodeAminoRequest.encode(request).finish(); + const promise = this.rpc.request("cosmos.tx.v1beta1.Service", "TxEncodeAmino", data); + return promise.then(data => TxEncodeAminoResponse.decode(new BinaryReader(data))); + } + txDecodeAmino(request: TxDecodeAminoRequest): Promise { + const data = TxDecodeAminoRequest.encode(request).finish(); + const promise = this.rpc.request("cosmos.tx.v1beta1.Service", "TxDecodeAmino", data); + return promise.then(data => TxDecodeAminoResponse.decode(new BinaryReader(data))); + } } export const createRpcQueryExtension = (base: QueryClient) => { const rpc = createProtobufRpcClient(base); @@ -60,6 +120,21 @@ export const createRpcQueryExtension = (base: QueryClient) => { }, getTxsEvent(request: GetTxsEventRequest): Promise { return queryService.getTxsEvent(request); + }, + getBlockWithTxs(request: GetBlockWithTxsRequest): Promise { + return queryService.getBlockWithTxs(request); + }, + txDecode(request: TxDecodeRequest): Promise { + return queryService.txDecode(request); + }, + txEncode(request: TxEncodeRequest): Promise { + return queryService.txEncode(request); + }, + txEncodeAmino(request: TxEncodeAminoRequest): Promise { + return queryService.txEncodeAmino(request); + }, + txDecodeAmino(request: TxDecodeAminoRequest): Promise { + return queryService.txDecodeAmino(request); } }; }; @@ -75,6 +150,21 @@ export interface UseBroadcastTxQuery extends ReactQueryParams extends ReactQueryParams { request: GetTxsEventRequest; } +export interface UseGetBlockWithTxsQuery extends ReactQueryParams { + request: GetBlockWithTxsRequest; +} +export interface UseTxDecodeQuery extends ReactQueryParams { + request: TxDecodeRequest; +} +export interface UseTxEncodeQuery extends ReactQueryParams { + request: TxEncodeRequest; +} +export interface UseTxEncodeAminoQuery extends ReactQueryParams { + request: TxEncodeAminoRequest; +} +export interface UseTxDecodeAminoQuery extends ReactQueryParams { + request: TxDecodeAminoRequest; +} const _queryClients: WeakMap = new WeakMap(); const getQueryService = (rpc: ProtobufRpcClient | undefined): ServiceClientImpl | undefined => { if (!rpc) return; @@ -123,10 +213,85 @@ export const createRpcQueryHooks = (rpc: ProtobufRpcClient | undefined) => { return queryService.getTxsEvent(request); }, options); }; + const useGetBlockWithTxs = ({ + request, + options + }: UseGetBlockWithTxsQuery) => { + return useQuery(["getBlockWithTxsQuery", request], () => { + if (!queryService) throw new Error("Query Service not initialized"); + return queryService.getBlockWithTxs(request); + }, options); + }; + const useTxDecode = ({ + request, + options + }: UseTxDecodeQuery) => { + return useQuery(["txDecodeQuery", request], () => { + if (!queryService) throw new Error("Query Service not initialized"); + return queryService.txDecode(request); + }, options); + }; + const useTxEncode = ({ + request, + options + }: UseTxEncodeQuery) => { + return useQuery(["txEncodeQuery", request], () => { + if (!queryService) throw new Error("Query Service not initialized"); + return queryService.txEncode(request); + }, options); + }; + const useTxEncodeAmino = ({ + request, + options + }: UseTxEncodeAminoQuery) => { + return useQuery(["txEncodeAminoQuery", request], () => { + if (!queryService) throw new Error("Query Service not initialized"); + return queryService.txEncodeAmino(request); + }, options); + }; + const useTxDecodeAmino = ({ + request, + options + }: UseTxDecodeAminoQuery) => { + return useQuery(["txDecodeAminoQuery", request], () => { + if (!queryService) throw new Error("Query Service not initialized"); + return queryService.txDecodeAmino(request); + }, options); + }; return { /** Simulate simulates executing a transaction for estimating gas usage. */useSimulate, /** GetTx fetches a tx by hash. */useGetTx, /** BroadcastTx broadcast transaction. */useBroadcastTx, - /** GetTxsEvent fetches txs by event. */useGetTxsEvent + /** GetTxsEvent fetches txs by event. */useGetTxsEvent, + /** + * GetBlockWithTxs fetches a block with decoded txs. + * + * Since: cosmos-sdk 0.45.2 + */ + useGetBlockWithTxs, + /** + * TxDecode decodes the transaction. + * + * Since: cosmos-sdk 0.47 + */ + useTxDecode, + /** + * TxEncode encodes the transaction. + * + * Since: cosmos-sdk 0.47 + */ + useTxEncode, + /** + * TxEncodeAmino encodes an Amino transaction from JSON to encoded bytes. + * + * Since: cosmos-sdk 0.47 + */ + useTxEncodeAmino, + /** + * TxDecodeAmino decodes an Amino transaction from encoded bytes to JSON. + * + * Since: cosmos-sdk 0.47 + */ + useTxDecodeAmino }; }; \ No newline at end of file diff --git a/packages/osmo-query/src/codegen/cosmos/tx/v1beta1/service.ts b/packages/osmo-query/src/codegen/cosmos/tx/v1beta1/service.ts index 911233eaf..d40d4a4bb 100644 --- a/packages/osmo-query/src/codegen/cosmos/tx/v1beta1/service.ts +++ b/packages/osmo-query/src/codegen/cosmos/tx/v1beta1/service.ts @@ -1,8 +1,10 @@ import { Tx, TxAmino, TxSDKType } from "./tx"; import { PageRequest, PageRequestAmino, PageRequestSDKType, PageResponse, PageResponseAmino, PageResponseSDKType } from "../../base/query/v1beta1/pagination"; import { TxResponse, TxResponseAmino, TxResponseSDKType, GasInfo, GasInfoAmino, GasInfoSDKType, Result, ResultAmino, ResultSDKType } from "../../base/abci/v1beta1/abci"; +import { BlockID, BlockIDAmino, BlockIDSDKType } from "../../../tendermint/types/types"; +import { Block, BlockAmino, BlockSDKType } from "../../../tendermint/types/block"; import { BinaryReader, BinaryWriter } from "../../../binary"; -import { isSet } from "../../../helpers"; +import { bytesFromBase64, base64FromBytes } from "../../../helpers"; /** OrderBy defines the sorting order */ export enum OrderBy { /** ORDER_BY_UNSPECIFIED - ORDER_BY_UNSPECIFIED specifies an unknown sorting order. OrderBy defaults to ASC in this case. */ @@ -50,8 +52,8 @@ export enum BroadcastMode { /** BROADCAST_MODE_UNSPECIFIED - zero-value for mode ordering */ BROADCAST_MODE_UNSPECIFIED = 0, /** - * BROADCAST_MODE_BLOCK - BROADCAST_MODE_BLOCK defines a tx broadcasting mode where the client waits for - * the tx to be committed in a block. + * BROADCAST_MODE_BLOCK - DEPRECATED: use BROADCAST_MODE_SYNC instead, + * BROADCAST_MODE_BLOCK is not supported by the SDK from v0.47.x onwards. */ BROADCAST_MODE_BLOCK = 1, /** @@ -110,9 +112,20 @@ export function broadcastModeToJSON(object: BroadcastMode): string { export interface GetTxsEventRequest { /** events is the list of transaction event type. */ events: string[]; - /** pagination defines an pagination for the request. */ - pagination: PageRequest; + /** + * pagination defines a pagination for the request. + * Deprecated post v0.46.x: use page and limit instead. + */ + /** @deprecated */ + pagination?: PageRequest; orderBy: OrderBy; + /** page is the page number to query, starts at 1. If not provided, will default to first page. */ + page: bigint; + /** + * 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: bigint; } export interface GetTxsEventRequestProtoMsg { typeUrl: "/cosmos.tx.v1beta1.GetTxsEventRequest"; @@ -124,10 +137,21 @@ export interface GetTxsEventRequestProtoMsg { */ export interface GetTxsEventRequestAmino { /** events is the list of transaction event type. */ - events: string[]; - /** pagination defines an pagination for the request. */ + events?: string[]; + /** + * pagination defines a pagination for the request. + * Deprecated post v0.46.x: use page and limit instead. + */ + /** @deprecated */ pagination?: PageRequestAmino; - order_by: OrderBy; + order_by?: OrderBy; + /** page is the page number to query, starts at 1. If not provided, will default to first page. */ + page?: string; + /** + * 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?: string; } export interface GetTxsEventRequestAminoMsg { type: "cosmos-sdk/GetTxsEventRequest"; @@ -139,8 +163,11 @@ export interface GetTxsEventRequestAminoMsg { */ export interface GetTxsEventRequestSDKType { events: string[]; - pagination: PageRequestSDKType; + /** @deprecated */ + pagination?: PageRequestSDKType; order_by: OrderBy; + page: bigint; + limit: bigint; } /** * GetTxsEventResponse is the response type for the Service.TxsByEvents @@ -151,8 +178,14 @@ export interface GetTxsEventResponse { txs: Tx[]; /** tx_responses is the list of queried TxResponses. */ txResponses: TxResponse[]; - /** pagination defines an pagination for the response. */ - pagination: PageResponse; + /** + * pagination defines a pagination for the response. + * Deprecated post v0.46.x: use total instead. + */ + /** @deprecated */ + pagination?: PageResponse; + /** total is total number of results available */ + total: bigint; } export interface GetTxsEventResponseProtoMsg { typeUrl: "/cosmos.tx.v1beta1.GetTxsEventResponse"; @@ -164,11 +197,17 @@ export interface GetTxsEventResponseProtoMsg { */ export interface GetTxsEventResponseAmino { /** txs is the list of queried transactions. */ - txs: TxAmino[]; + txs?: TxAmino[]; /** tx_responses is the list of queried TxResponses. */ - tx_responses: TxResponseAmino[]; - /** pagination defines an pagination for the response. */ + tx_responses?: TxResponseAmino[]; + /** + * pagination defines a pagination for the response. + * Deprecated post v0.46.x: use total instead. + */ + /** @deprecated */ pagination?: PageResponseAmino; + /** total is total number of results available */ + total?: string; } export interface GetTxsEventResponseAminoMsg { type: "cosmos-sdk/GetTxsEventResponse"; @@ -181,7 +220,9 @@ export interface GetTxsEventResponseAminoMsg { export interface GetTxsEventResponseSDKType { txs: TxSDKType[]; tx_responses: TxResponseSDKType[]; - pagination: PageResponseSDKType; + /** @deprecated */ + pagination?: PageResponseSDKType; + total: bigint; } /** * BroadcastTxRequest is the request type for the Service.BroadcastTxRequest @@ -202,8 +243,8 @@ export interface BroadcastTxRequestProtoMsg { */ export interface BroadcastTxRequestAmino { /** tx_bytes is the raw transaction. */ - tx_bytes: Uint8Array; - mode: BroadcastMode; + tx_bytes?: string; + mode?: BroadcastMode; } export interface BroadcastTxRequestAminoMsg { type: "cosmos-sdk/BroadcastTxRequest"; @@ -223,7 +264,7 @@ export interface BroadcastTxRequestSDKType { */ export interface BroadcastTxResponse { /** tx_response is the queried TxResponses. */ - txResponse: TxResponse; + txResponse?: TxResponse; } export interface BroadcastTxResponseProtoMsg { typeUrl: "/cosmos.tx.v1beta1.BroadcastTxResponse"; @@ -246,7 +287,7 @@ export interface BroadcastTxResponseAminoMsg { * Service.BroadcastTx method. */ export interface BroadcastTxResponseSDKType { - tx_response: TxResponseSDKType; + tx_response?: TxResponseSDKType; } /** * SimulateRequest is the request type for the Service.Simulate @@ -258,7 +299,7 @@ export interface SimulateRequest { * Deprecated. Send raw tx bytes instead. */ /** @deprecated */ - tx: Tx; + tx?: Tx; /** * tx_bytes is the raw transaction. * @@ -286,7 +327,7 @@ export interface SimulateRequestAmino { * * Since: cosmos-sdk 0.43 */ - tx_bytes: Uint8Array; + tx_bytes?: string; } export interface SimulateRequestAminoMsg { type: "cosmos-sdk/SimulateRequest"; @@ -298,7 +339,7 @@ export interface SimulateRequestAminoMsg { */ export interface SimulateRequestSDKType { /** @deprecated */ - tx: TxSDKType; + tx?: TxSDKType; tx_bytes: Uint8Array; } /** @@ -307,9 +348,9 @@ export interface SimulateRequestSDKType { */ 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; } export interface SimulateResponseProtoMsg { typeUrl: "/cosmos.tx.v1beta1.SimulateResponse"; @@ -334,8 +375,8 @@ export interface SimulateResponseAminoMsg { * Service.SimulateRPC method. */ export interface SimulateResponseSDKType { - gas_info: GasInfoSDKType; - result: ResultSDKType; + gas_info?: GasInfoSDKType; + result?: ResultSDKType; } /** * GetTxRequest is the request type for the Service.GetTx @@ -355,7 +396,7 @@ export interface GetTxRequestProtoMsg { */ export interface GetTxRequestAmino { /** hash is the tx hash to query, encoded as a hex string. */ - hash: string; + hash?: string; } export interface GetTxRequestAminoMsg { type: "cosmos-sdk/GetTxRequest"; @@ -371,9 +412,9 @@ export interface GetTxRequestSDKType { /** 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; } export interface GetTxResponseProtoMsg { typeUrl: "/cosmos.tx.v1beta1.GetTxResponse"; @@ -392,14 +433,391 @@ export interface GetTxResponseAminoMsg { } /** GetTxResponse is the response type for the Service.GetTx method. */ export interface GetTxResponseSDKType { - tx: TxSDKType; - tx_response: TxResponseSDKType; + tx?: TxSDKType; + tx_response?: TxResponseSDKType; +} +/** + * GetBlockWithTxsRequest is the request type for the Service.GetBlockWithTxs + * RPC method. + * + * Since: cosmos-sdk 0.45.2 + */ +export interface GetBlockWithTxsRequest { + /** height is the height of the block to query. */ + height: bigint; + /** pagination defines a pagination for the request. */ + pagination?: PageRequest; +} +export interface GetBlockWithTxsRequestProtoMsg { + typeUrl: "/cosmos.tx.v1beta1.GetBlockWithTxsRequest"; + value: Uint8Array; +} +/** + * GetBlockWithTxsRequest is the request type for the Service.GetBlockWithTxs + * RPC method. + * + * Since: cosmos-sdk 0.45.2 + */ +export interface GetBlockWithTxsRequestAmino { + /** height is the height of the block to query. */ + height?: string; + /** pagination defines a pagination for the request. */ + pagination?: PageRequestAmino; +} +export interface GetBlockWithTxsRequestAminoMsg { + type: "cosmos-sdk/GetBlockWithTxsRequest"; + value: GetBlockWithTxsRequestAmino; +} +/** + * GetBlockWithTxsRequest is the request type for the Service.GetBlockWithTxs + * RPC method. + * + * Since: cosmos-sdk 0.45.2 + */ +export interface GetBlockWithTxsRequestSDKType { + height: bigint; + pagination?: PageRequestSDKType; +} +/** + * GetBlockWithTxsResponse is the response type for the Service.GetBlockWithTxs method. + * + * Since: cosmos-sdk 0.45.2 + */ +export interface GetBlockWithTxsResponse { + /** txs are the transactions in the block. */ + txs: Tx[]; + blockId?: BlockID; + block?: Block; + /** pagination defines a pagination for the response. */ + pagination?: PageResponse; +} +export interface GetBlockWithTxsResponseProtoMsg { + typeUrl: "/cosmos.tx.v1beta1.GetBlockWithTxsResponse"; + value: Uint8Array; +} +/** + * GetBlockWithTxsResponse is the response type for the Service.GetBlockWithTxs method. + * + * Since: cosmos-sdk 0.45.2 + */ +export interface GetBlockWithTxsResponseAmino { + /** txs are the transactions in the block. */ + txs?: TxAmino[]; + block_id?: BlockIDAmino; + block?: BlockAmino; + /** pagination defines a pagination for the response. */ + pagination?: PageResponseAmino; +} +export interface GetBlockWithTxsResponseAminoMsg { + type: "cosmos-sdk/GetBlockWithTxsResponse"; + value: GetBlockWithTxsResponseAmino; +} +/** + * GetBlockWithTxsResponse is the response type for the Service.GetBlockWithTxs method. + * + * Since: cosmos-sdk 0.45.2 + */ +export interface GetBlockWithTxsResponseSDKType { + txs: TxSDKType[]; + block_id?: BlockIDSDKType; + block?: BlockSDKType; + pagination?: PageResponseSDKType; +} +/** + * TxDecodeRequest is the request type for the Service.TxDecode + * RPC method. + * + * Since: cosmos-sdk 0.47 + */ +export interface TxDecodeRequest { + /** tx_bytes is the raw transaction. */ + txBytes: Uint8Array; +} +export interface TxDecodeRequestProtoMsg { + typeUrl: "/cosmos.tx.v1beta1.TxDecodeRequest"; + value: Uint8Array; +} +/** + * TxDecodeRequest is the request type for the Service.TxDecode + * RPC method. + * + * Since: cosmos-sdk 0.47 + */ +export interface TxDecodeRequestAmino { + /** tx_bytes is the raw transaction. */ + tx_bytes?: string; +} +export interface TxDecodeRequestAminoMsg { + type: "cosmos-sdk/TxDecodeRequest"; + value: TxDecodeRequestAmino; +} +/** + * TxDecodeRequest is the request type for the Service.TxDecode + * RPC method. + * + * Since: cosmos-sdk 0.47 + */ +export interface TxDecodeRequestSDKType { + tx_bytes: Uint8Array; +} +/** + * TxDecodeResponse is the response type for the + * Service.TxDecode method. + * + * Since: cosmos-sdk 0.47 + */ +export interface TxDecodeResponse { + /** tx is the decoded transaction. */ + tx?: Tx; +} +export interface TxDecodeResponseProtoMsg { + typeUrl: "/cosmos.tx.v1beta1.TxDecodeResponse"; + value: Uint8Array; +} +/** + * TxDecodeResponse is the response type for the + * Service.TxDecode method. + * + * Since: cosmos-sdk 0.47 + */ +export interface TxDecodeResponseAmino { + /** tx is the decoded transaction. */ + tx?: TxAmino; +} +export interface TxDecodeResponseAminoMsg { + type: "cosmos-sdk/TxDecodeResponse"; + value: TxDecodeResponseAmino; +} +/** + * TxDecodeResponse is the response type for the + * Service.TxDecode method. + * + * Since: cosmos-sdk 0.47 + */ +export interface TxDecodeResponseSDKType { + tx?: TxSDKType; +} +/** + * TxEncodeRequest is the request type for the Service.TxEncode + * RPC method. + * + * Since: cosmos-sdk 0.47 + */ +export interface TxEncodeRequest { + /** tx is the transaction to encode. */ + tx?: Tx; +} +export interface TxEncodeRequestProtoMsg { + typeUrl: "/cosmos.tx.v1beta1.TxEncodeRequest"; + value: Uint8Array; +} +/** + * TxEncodeRequest is the request type for the Service.TxEncode + * RPC method. + * + * Since: cosmos-sdk 0.47 + */ +export interface TxEncodeRequestAmino { + /** tx is the transaction to encode. */ + tx?: TxAmino; +} +export interface TxEncodeRequestAminoMsg { + type: "cosmos-sdk/TxEncodeRequest"; + value: TxEncodeRequestAmino; +} +/** + * TxEncodeRequest is the request type for the Service.TxEncode + * RPC method. + * + * Since: cosmos-sdk 0.47 + */ +export interface TxEncodeRequestSDKType { + tx?: TxSDKType; +} +/** + * TxEncodeResponse is the response type for the + * Service.TxEncode method. + * + * Since: cosmos-sdk 0.47 + */ +export interface TxEncodeResponse { + /** tx_bytes is the encoded transaction bytes. */ + txBytes: Uint8Array; +} +export interface TxEncodeResponseProtoMsg { + typeUrl: "/cosmos.tx.v1beta1.TxEncodeResponse"; + value: Uint8Array; +} +/** + * TxEncodeResponse is the response type for the + * Service.TxEncode method. + * + * Since: cosmos-sdk 0.47 + */ +export interface TxEncodeResponseAmino { + /** tx_bytes is the encoded transaction bytes. */ + tx_bytes?: string; +} +export interface TxEncodeResponseAminoMsg { + type: "cosmos-sdk/TxEncodeResponse"; + value: TxEncodeResponseAmino; +} +/** + * TxEncodeResponse is the response type for the + * Service.TxEncode method. + * + * Since: cosmos-sdk 0.47 + */ +export interface TxEncodeResponseSDKType { + tx_bytes: Uint8Array; +} +/** + * TxEncodeAminoRequest is the request type for the Service.TxEncodeAmino + * RPC method. + * + * Since: cosmos-sdk 0.47 + */ +export interface TxEncodeAminoRequest { + aminoJson: string; +} +export interface TxEncodeAminoRequestProtoMsg { + typeUrl: "/cosmos.tx.v1beta1.TxEncodeAminoRequest"; + value: Uint8Array; +} +/** + * TxEncodeAminoRequest is the request type for the Service.TxEncodeAmino + * RPC method. + * + * Since: cosmos-sdk 0.47 + */ +export interface TxEncodeAminoRequestAmino { + amino_json?: string; +} +export interface TxEncodeAminoRequestAminoMsg { + type: "cosmos-sdk/TxEncodeAminoRequest"; + value: TxEncodeAminoRequestAmino; +} +/** + * TxEncodeAminoRequest is the request type for the Service.TxEncodeAmino + * RPC method. + * + * Since: cosmos-sdk 0.47 + */ +export interface TxEncodeAminoRequestSDKType { + amino_json: string; +} +/** + * TxEncodeAminoResponse is the response type for the Service.TxEncodeAmino + * RPC method. + * + * Since: cosmos-sdk 0.47 + */ +export interface TxEncodeAminoResponse { + aminoBinary: Uint8Array; +} +export interface TxEncodeAminoResponseProtoMsg { + typeUrl: "/cosmos.tx.v1beta1.TxEncodeAminoResponse"; + value: Uint8Array; +} +/** + * TxEncodeAminoResponse is the response type for the Service.TxEncodeAmino + * RPC method. + * + * Since: cosmos-sdk 0.47 + */ +export interface TxEncodeAminoResponseAmino { + amino_binary?: string; +} +export interface TxEncodeAminoResponseAminoMsg { + type: "cosmos-sdk/TxEncodeAminoResponse"; + value: TxEncodeAminoResponseAmino; +} +/** + * TxEncodeAminoResponse is the response type for the Service.TxEncodeAmino + * RPC method. + * + * Since: cosmos-sdk 0.47 + */ +export interface TxEncodeAminoResponseSDKType { + amino_binary: Uint8Array; +} +/** + * TxDecodeAminoRequest is the request type for the Service.TxDecodeAmino + * RPC method. + * + * Since: cosmos-sdk 0.47 + */ +export interface TxDecodeAminoRequest { + aminoBinary: Uint8Array; +} +export interface TxDecodeAminoRequestProtoMsg { + typeUrl: "/cosmos.tx.v1beta1.TxDecodeAminoRequest"; + value: Uint8Array; +} +/** + * TxDecodeAminoRequest is the request type for the Service.TxDecodeAmino + * RPC method. + * + * Since: cosmos-sdk 0.47 + */ +export interface TxDecodeAminoRequestAmino { + amino_binary?: string; +} +export interface TxDecodeAminoRequestAminoMsg { + type: "cosmos-sdk/TxDecodeAminoRequest"; + value: TxDecodeAminoRequestAmino; +} +/** + * TxDecodeAminoRequest is the request type for the Service.TxDecodeAmino + * RPC method. + * + * Since: cosmos-sdk 0.47 + */ +export interface TxDecodeAminoRequestSDKType { + amino_binary: Uint8Array; +} +/** + * TxDecodeAminoResponse is the response type for the Service.TxDecodeAmino + * RPC method. + * + * Since: cosmos-sdk 0.47 + */ +export interface TxDecodeAminoResponse { + aminoJson: string; +} +export interface TxDecodeAminoResponseProtoMsg { + typeUrl: "/cosmos.tx.v1beta1.TxDecodeAminoResponse"; + value: Uint8Array; +} +/** + * TxDecodeAminoResponse is the response type for the Service.TxDecodeAmino + * RPC method. + * + * Since: cosmos-sdk 0.47 + */ +export interface TxDecodeAminoResponseAmino { + amino_json?: string; +} +export interface TxDecodeAminoResponseAminoMsg { + type: "cosmos-sdk/TxDecodeAminoResponse"; + value: TxDecodeAminoResponseAmino; +} +/** + * TxDecodeAminoResponse is the response type for the Service.TxDecodeAmino + * RPC method. + * + * Since: cosmos-sdk 0.47 + */ +export interface TxDecodeAminoResponseSDKType { + amino_json: string; } function createBaseGetTxsEventRequest(): GetTxsEventRequest { return { events: [], - pagination: PageRequest.fromPartial({}), - orderBy: 0 + pagination: undefined, + orderBy: 0, + page: BigInt(0), + limit: BigInt(0) }; } export const GetTxsEventRequest = { @@ -414,6 +832,12 @@ export const GetTxsEventRequest = { if (message.orderBy !== 0) { writer.uint32(24).int32(message.orderBy); } + if (message.page !== BigInt(0)) { + writer.uint32(32).uint64(message.page); + } + if (message.limit !== BigInt(0)) { + writer.uint32(40).uint64(message.limit); + } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): GetTxsEventRequest { @@ -432,6 +856,12 @@ export const GetTxsEventRequest = { case 3: message.orderBy = (reader.int32() as any); break; + case 4: + message.page = reader.uint64(); + break; + case 5: + message.limit = reader.uint64(); + break; default: reader.skipType(tag & 7); break; @@ -444,14 +874,26 @@ export const GetTxsEventRequest = { 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; + message.page = object.page !== undefined && object.page !== null ? BigInt(object.page.toString()) : BigInt(0); + message.limit = object.limit !== undefined && object.limit !== null ? BigInt(object.limit.toString()) : BigInt(0); return message; }, fromAmino(object: GetTxsEventRequestAmino): GetTxsEventRequest { - return { - events: Array.isArray(object?.events) ? object.events.map((e: any) => e) : [], - pagination: object?.pagination ? PageRequest.fromAmino(object.pagination) : undefined, - orderBy: isSet(object.order_by) ? orderByFromJSON(object.order_by) : -1 - }; + const message = createBaseGetTxsEventRequest(); + message.events = object.events?.map(e => e) || []; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromAmino(object.pagination); + } + if (object.order_by !== undefined && object.order_by !== null) { + message.orderBy = orderByFromJSON(object.order_by); + } + if (object.page !== undefined && object.page !== null) { + message.page = BigInt(object.page); + } + if (object.limit !== undefined && object.limit !== null) { + message.limit = BigInt(object.limit); + } + return message; }, toAmino(message: GetTxsEventRequest): GetTxsEventRequestAmino { const obj: any = {}; @@ -461,7 +903,9 @@ export const GetTxsEventRequest = { obj.events = []; } obj.pagination = message.pagination ? PageRequest.toAmino(message.pagination) : undefined; - obj.order_by = message.orderBy; + obj.order_by = orderByToJSON(message.orderBy); + obj.page = message.page ? message.page.toString() : undefined; + obj.limit = message.limit ? message.limit.toString() : undefined; return obj; }, fromAminoMsg(object: GetTxsEventRequestAminoMsg): GetTxsEventRequest { @@ -490,7 +934,8 @@ function createBaseGetTxsEventResponse(): GetTxsEventResponse { return { txs: [], txResponses: [], - pagination: PageResponse.fromPartial({}) + pagination: undefined, + total: BigInt(0) }; } export const GetTxsEventResponse = { @@ -505,6 +950,9 @@ export const GetTxsEventResponse = { if (message.pagination !== undefined) { PageResponse.encode(message.pagination, writer.uint32(26).fork()).ldelim(); } + if (message.total !== BigInt(0)) { + writer.uint32(32).uint64(message.total); + } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): GetTxsEventResponse { @@ -523,6 +971,9 @@ export const GetTxsEventResponse = { case 3: message.pagination = PageResponse.decode(reader, reader.uint32()); break; + case 4: + message.total = reader.uint64(); + break; default: reader.skipType(tag & 7); break; @@ -535,14 +986,20 @@ export const GetTxsEventResponse = { 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; + message.total = object.total !== undefined && object.total !== null ? BigInt(object.total.toString()) : BigInt(0); return message; }, fromAmino(object: GetTxsEventResponseAmino): GetTxsEventResponse { - return { - txs: Array.isArray(object?.txs) ? object.txs.map((e: any) => Tx.fromAmino(e)) : [], - txResponses: Array.isArray(object?.tx_responses) ? object.tx_responses.map((e: any) => TxResponse.fromAmino(e)) : [], - pagination: object?.pagination ? PageResponse.fromAmino(object.pagination) : undefined - }; + const message = createBaseGetTxsEventResponse(); + message.txs = object.txs?.map(e => Tx.fromAmino(e)) || []; + message.txResponses = object.tx_responses?.map(e => TxResponse.fromAmino(e)) || []; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromAmino(object.pagination); + } + if (object.total !== undefined && object.total !== null) { + message.total = BigInt(object.total); + } + return message; }, toAmino(message: GetTxsEventResponse): GetTxsEventResponseAmino { const obj: any = {}; @@ -557,6 +1014,7 @@ export const GetTxsEventResponse = { obj.tx_responses = []; } obj.pagination = message.pagination ? PageResponse.toAmino(message.pagination) : undefined; + obj.total = message.total ? message.total.toString() : undefined; return obj; }, fromAminoMsg(object: GetTxsEventResponseAminoMsg): GetTxsEventResponse { @@ -625,15 +1083,19 @@ export const BroadcastTxRequest = { return message; }, fromAmino(object: BroadcastTxRequestAmino): BroadcastTxRequest { - return { - txBytes: object.tx_bytes, - mode: isSet(object.mode) ? broadcastModeFromJSON(object.mode) : -1 - }; + const message = createBaseBroadcastTxRequest(); + if (object.tx_bytes !== undefined && object.tx_bytes !== null) { + message.txBytes = bytesFromBase64(object.tx_bytes); + } + if (object.mode !== undefined && object.mode !== null) { + message.mode = broadcastModeFromJSON(object.mode); + } + return message; }, toAmino(message: BroadcastTxRequest): BroadcastTxRequestAmino { const obj: any = {}; - obj.tx_bytes = message.txBytes; - obj.mode = message.mode; + obj.tx_bytes = message.txBytes ? base64FromBytes(message.txBytes) : undefined; + obj.mode = broadcastModeToJSON(message.mode); return obj; }, fromAminoMsg(object: BroadcastTxRequestAminoMsg): BroadcastTxRequest { @@ -660,7 +1122,7 @@ export const BroadcastTxRequest = { }; function createBaseBroadcastTxResponse(): BroadcastTxResponse { return { - txResponse: TxResponse.fromPartial({}) + txResponse: undefined }; } export const BroadcastTxResponse = { @@ -694,9 +1156,11 @@ export const BroadcastTxResponse = { return message; }, fromAmino(object: BroadcastTxResponseAmino): BroadcastTxResponse { - return { - txResponse: object?.tx_response ? TxResponse.fromAmino(object.tx_response) : undefined - }; + const message = createBaseBroadcastTxResponse(); + if (object.tx_response !== undefined && object.tx_response !== null) { + message.txResponse = TxResponse.fromAmino(object.tx_response); + } + return message; }, toAmino(message: BroadcastTxResponse): BroadcastTxResponseAmino { const obj: any = {}; @@ -727,7 +1191,7 @@ export const BroadcastTxResponse = { }; function createBaseSimulateRequest(): SimulateRequest { return { - tx: Tx.fromPartial({}), + tx: undefined, txBytes: new Uint8Array() }; } @@ -769,15 +1233,19 @@ export const SimulateRequest = { return message; }, fromAmino(object: SimulateRequestAmino): SimulateRequest { - return { - tx: object?.tx ? Tx.fromAmino(object.tx) : undefined, - txBytes: object.tx_bytes - }; + const message = createBaseSimulateRequest(); + if (object.tx !== undefined && object.tx !== null) { + message.tx = Tx.fromAmino(object.tx); + } + if (object.tx_bytes !== undefined && object.tx_bytes !== null) { + message.txBytes = bytesFromBase64(object.tx_bytes); + } + return message; }, toAmino(message: SimulateRequest): SimulateRequestAmino { const obj: any = {}; obj.tx = message.tx ? Tx.toAmino(message.tx) : undefined; - obj.tx_bytes = message.txBytes; + obj.tx_bytes = message.txBytes ? base64FromBytes(message.txBytes) : undefined; return obj; }, fromAminoMsg(object: SimulateRequestAminoMsg): SimulateRequest { @@ -804,8 +1272,8 @@ export const SimulateRequest = { }; function createBaseSimulateResponse(): SimulateResponse { return { - gasInfo: GasInfo.fromPartial({}), - result: Result.fromPartial({}) + gasInfo: undefined, + result: undefined }; } export const SimulateResponse = { @@ -846,10 +1314,14 @@ export const SimulateResponse = { return message; }, fromAmino(object: SimulateResponseAmino): SimulateResponse { - return { - gasInfo: object?.gas_info ? GasInfo.fromAmino(object.gas_info) : undefined, - result: object?.result ? Result.fromAmino(object.result) : undefined - }; + const message = createBaseSimulateResponse(); + if (object.gas_info !== undefined && object.gas_info !== null) { + message.gasInfo = GasInfo.fromAmino(object.gas_info); + } + if (object.result !== undefined && object.result !== null) { + message.result = Result.fromAmino(object.result); + } + return message; }, toAmino(message: SimulateResponse): SimulateResponseAmino { const obj: any = {}; @@ -915,9 +1387,11 @@ export const GetTxRequest = { return message; }, fromAmino(object: GetTxRequestAmino): GetTxRequest { - return { - hash: object.hash - }; + const message = createBaseGetTxRequest(); + if (object.hash !== undefined && object.hash !== null) { + message.hash = object.hash; + } + return message; }, toAmino(message: GetTxRequest): GetTxRequestAmino { const obj: any = {}; @@ -948,8 +1422,8 @@ export const GetTxRequest = { }; function createBaseGetTxResponse(): GetTxResponse { return { - tx: Tx.fromPartial({}), - txResponse: TxResponse.fromPartial({}) + tx: undefined, + txResponse: undefined }; } export const GetTxResponse = { @@ -990,10 +1464,14 @@ export const GetTxResponse = { return message; }, fromAmino(object: GetTxResponseAmino): GetTxResponse { - return { - tx: object?.tx ? Tx.fromAmino(object.tx) : undefined, - txResponse: object?.tx_response ? TxResponse.fromAmino(object.tx_response) : undefined - }; + const message = createBaseGetTxResponse(); + if (object.tx !== undefined && object.tx !== null) { + message.tx = Tx.fromAmino(object.tx); + } + if (object.tx_response !== undefined && object.tx_response !== null) { + message.txResponse = TxResponse.fromAmino(object.tx_response); + } + return message; }, toAmino(message: GetTxResponse): GetTxResponseAmino { const obj: any = {}; @@ -1022,4 +1500,744 @@ export const GetTxResponse = { value: GetTxResponse.encode(message).finish() }; } +}; +function createBaseGetBlockWithTxsRequest(): GetBlockWithTxsRequest { + return { + height: BigInt(0), + pagination: undefined + }; +} +export const GetBlockWithTxsRequest = { + typeUrl: "/cosmos.tx.v1beta1.GetBlockWithTxsRequest", + encode(message: GetBlockWithTxsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.height !== BigInt(0)) { + writer.uint32(8).int64(message.height); + } + if (message.pagination !== undefined) { + PageRequest.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): GetBlockWithTxsRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGetBlockWithTxsRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.height = reader.int64(); + break; + case 2: + message.pagination = PageRequest.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): GetBlockWithTxsRequest { + const message = createBaseGetBlockWithTxsRequest(); + message.height = object.height !== undefined && object.height !== null ? BigInt(object.height.toString()) : BigInt(0); + message.pagination = object.pagination !== undefined && object.pagination !== null ? PageRequest.fromPartial(object.pagination) : undefined; + return message; + }, + fromAmino(object: GetBlockWithTxsRequestAmino): GetBlockWithTxsRequest { + const message = createBaseGetBlockWithTxsRequest(); + if (object.height !== undefined && object.height !== null) { + message.height = BigInt(object.height); + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromAmino(object.pagination); + } + return message; + }, + toAmino(message: GetBlockWithTxsRequest): GetBlockWithTxsRequestAmino { + const obj: any = {}; + obj.height = message.height ? message.height.toString() : undefined; + obj.pagination = message.pagination ? PageRequest.toAmino(message.pagination) : undefined; + return obj; + }, + fromAminoMsg(object: GetBlockWithTxsRequestAminoMsg): GetBlockWithTxsRequest { + return GetBlockWithTxsRequest.fromAmino(object.value); + }, + toAminoMsg(message: GetBlockWithTxsRequest): GetBlockWithTxsRequestAminoMsg { + return { + type: "cosmos-sdk/GetBlockWithTxsRequest", + value: GetBlockWithTxsRequest.toAmino(message) + }; + }, + fromProtoMsg(message: GetBlockWithTxsRequestProtoMsg): GetBlockWithTxsRequest { + return GetBlockWithTxsRequest.decode(message.value); + }, + toProto(message: GetBlockWithTxsRequest): Uint8Array { + return GetBlockWithTxsRequest.encode(message).finish(); + }, + toProtoMsg(message: GetBlockWithTxsRequest): GetBlockWithTxsRequestProtoMsg { + return { + typeUrl: "/cosmos.tx.v1beta1.GetBlockWithTxsRequest", + value: GetBlockWithTxsRequest.encode(message).finish() + }; + } +}; +function createBaseGetBlockWithTxsResponse(): GetBlockWithTxsResponse { + return { + txs: [], + blockId: undefined, + block: undefined, + pagination: undefined + }; +} +export const GetBlockWithTxsResponse = { + typeUrl: "/cosmos.tx.v1beta1.GetBlockWithTxsResponse", + encode(message: GetBlockWithTxsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.txs) { + Tx.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.blockId !== undefined) { + BlockID.encode(message.blockId, writer.uint32(18).fork()).ldelim(); + } + if (message.block !== undefined) { + Block.encode(message.block, writer.uint32(26).fork()).ldelim(); + } + if (message.pagination !== undefined) { + PageResponse.encode(message.pagination, writer.uint32(34).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): GetBlockWithTxsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGetBlockWithTxsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.txs.push(Tx.decode(reader, reader.uint32())); + break; + case 2: + message.blockId = BlockID.decode(reader, reader.uint32()); + break; + case 3: + message.block = Block.decode(reader, reader.uint32()); + break; + case 4: + message.pagination = PageResponse.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): 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; + }, + fromAmino(object: GetBlockWithTxsResponseAmino): GetBlockWithTxsResponse { + const message = createBaseGetBlockWithTxsResponse(); + message.txs = object.txs?.map(e => Tx.fromAmino(e)) || []; + if (object.block_id !== undefined && object.block_id !== null) { + message.blockId = BlockID.fromAmino(object.block_id); + } + if (object.block !== undefined && object.block !== null) { + message.block = Block.fromAmino(object.block); + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromAmino(object.pagination); + } + return message; + }, + toAmino(message: GetBlockWithTxsResponse): GetBlockWithTxsResponseAmino { + const obj: any = {}; + if (message.txs) { + obj.txs = message.txs.map(e => e ? Tx.toAmino(e) : undefined); + } else { + obj.txs = []; + } + obj.block_id = message.blockId ? BlockID.toAmino(message.blockId) : undefined; + obj.block = message.block ? Block.toAmino(message.block) : undefined; + obj.pagination = message.pagination ? PageResponse.toAmino(message.pagination) : undefined; + return obj; + }, + fromAminoMsg(object: GetBlockWithTxsResponseAminoMsg): GetBlockWithTxsResponse { + return GetBlockWithTxsResponse.fromAmino(object.value); + }, + toAminoMsg(message: GetBlockWithTxsResponse): GetBlockWithTxsResponseAminoMsg { + return { + type: "cosmos-sdk/GetBlockWithTxsResponse", + value: GetBlockWithTxsResponse.toAmino(message) + }; + }, + fromProtoMsg(message: GetBlockWithTxsResponseProtoMsg): GetBlockWithTxsResponse { + return GetBlockWithTxsResponse.decode(message.value); + }, + toProto(message: GetBlockWithTxsResponse): Uint8Array { + return GetBlockWithTxsResponse.encode(message).finish(); + }, + toProtoMsg(message: GetBlockWithTxsResponse): GetBlockWithTxsResponseProtoMsg { + return { + typeUrl: "/cosmos.tx.v1beta1.GetBlockWithTxsResponse", + value: GetBlockWithTxsResponse.encode(message).finish() + }; + } +}; +function createBaseTxDecodeRequest(): TxDecodeRequest { + return { + txBytes: new Uint8Array() + }; +} +export const TxDecodeRequest = { + typeUrl: "/cosmos.tx.v1beta1.TxDecodeRequest", + encode(message: TxDecodeRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.txBytes.length !== 0) { + writer.uint32(10).bytes(message.txBytes); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): TxDecodeRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseTxDecodeRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.txBytes = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): TxDecodeRequest { + const message = createBaseTxDecodeRequest(); + message.txBytes = object.txBytes ?? new Uint8Array(); + return message; + }, + fromAmino(object: TxDecodeRequestAmino): TxDecodeRequest { + const message = createBaseTxDecodeRequest(); + if (object.tx_bytes !== undefined && object.tx_bytes !== null) { + message.txBytes = bytesFromBase64(object.tx_bytes); + } + return message; + }, + toAmino(message: TxDecodeRequest): TxDecodeRequestAmino { + const obj: any = {}; + obj.tx_bytes = message.txBytes ? base64FromBytes(message.txBytes) : undefined; + return obj; + }, + fromAminoMsg(object: TxDecodeRequestAminoMsg): TxDecodeRequest { + return TxDecodeRequest.fromAmino(object.value); + }, + toAminoMsg(message: TxDecodeRequest): TxDecodeRequestAminoMsg { + return { + type: "cosmos-sdk/TxDecodeRequest", + value: TxDecodeRequest.toAmino(message) + }; + }, + fromProtoMsg(message: TxDecodeRequestProtoMsg): TxDecodeRequest { + return TxDecodeRequest.decode(message.value); + }, + toProto(message: TxDecodeRequest): Uint8Array { + return TxDecodeRequest.encode(message).finish(); + }, + toProtoMsg(message: TxDecodeRequest): TxDecodeRequestProtoMsg { + return { + typeUrl: "/cosmos.tx.v1beta1.TxDecodeRequest", + value: TxDecodeRequest.encode(message).finish() + }; + } +}; +function createBaseTxDecodeResponse(): TxDecodeResponse { + return { + tx: undefined + }; +} +export const TxDecodeResponse = { + typeUrl: "/cosmos.tx.v1beta1.TxDecodeResponse", + encode(message: TxDecodeResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.tx !== undefined) { + Tx.encode(message.tx, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): TxDecodeResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseTxDecodeResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.tx = Tx.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): TxDecodeResponse { + const message = createBaseTxDecodeResponse(); + message.tx = object.tx !== undefined && object.tx !== null ? Tx.fromPartial(object.tx) : undefined; + return message; + }, + fromAmino(object: TxDecodeResponseAmino): TxDecodeResponse { + const message = createBaseTxDecodeResponse(); + if (object.tx !== undefined && object.tx !== null) { + message.tx = Tx.fromAmino(object.tx); + } + return message; + }, + toAmino(message: TxDecodeResponse): TxDecodeResponseAmino { + const obj: any = {}; + obj.tx = message.tx ? Tx.toAmino(message.tx) : undefined; + return obj; + }, + fromAminoMsg(object: TxDecodeResponseAminoMsg): TxDecodeResponse { + return TxDecodeResponse.fromAmino(object.value); + }, + toAminoMsg(message: TxDecodeResponse): TxDecodeResponseAminoMsg { + return { + type: "cosmos-sdk/TxDecodeResponse", + value: TxDecodeResponse.toAmino(message) + }; + }, + fromProtoMsg(message: TxDecodeResponseProtoMsg): TxDecodeResponse { + return TxDecodeResponse.decode(message.value); + }, + toProto(message: TxDecodeResponse): Uint8Array { + return TxDecodeResponse.encode(message).finish(); + }, + toProtoMsg(message: TxDecodeResponse): TxDecodeResponseProtoMsg { + return { + typeUrl: "/cosmos.tx.v1beta1.TxDecodeResponse", + value: TxDecodeResponse.encode(message).finish() + }; + } +}; +function createBaseTxEncodeRequest(): TxEncodeRequest { + return { + tx: undefined + }; +} +export const TxEncodeRequest = { + typeUrl: "/cosmos.tx.v1beta1.TxEncodeRequest", + encode(message: TxEncodeRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.tx !== undefined) { + Tx.encode(message.tx, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): TxEncodeRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseTxEncodeRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.tx = Tx.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): TxEncodeRequest { + const message = createBaseTxEncodeRequest(); + message.tx = object.tx !== undefined && object.tx !== null ? Tx.fromPartial(object.tx) : undefined; + return message; + }, + fromAmino(object: TxEncodeRequestAmino): TxEncodeRequest { + const message = createBaseTxEncodeRequest(); + if (object.tx !== undefined && object.tx !== null) { + message.tx = Tx.fromAmino(object.tx); + } + return message; + }, + toAmino(message: TxEncodeRequest): TxEncodeRequestAmino { + const obj: any = {}; + obj.tx = message.tx ? Tx.toAmino(message.tx) : undefined; + return obj; + }, + fromAminoMsg(object: TxEncodeRequestAminoMsg): TxEncodeRequest { + return TxEncodeRequest.fromAmino(object.value); + }, + toAminoMsg(message: TxEncodeRequest): TxEncodeRequestAminoMsg { + return { + type: "cosmos-sdk/TxEncodeRequest", + value: TxEncodeRequest.toAmino(message) + }; + }, + fromProtoMsg(message: TxEncodeRequestProtoMsg): TxEncodeRequest { + return TxEncodeRequest.decode(message.value); + }, + toProto(message: TxEncodeRequest): Uint8Array { + return TxEncodeRequest.encode(message).finish(); + }, + toProtoMsg(message: TxEncodeRequest): TxEncodeRequestProtoMsg { + return { + typeUrl: "/cosmos.tx.v1beta1.TxEncodeRequest", + value: TxEncodeRequest.encode(message).finish() + }; + } +}; +function createBaseTxEncodeResponse(): TxEncodeResponse { + return { + txBytes: new Uint8Array() + }; +} +export const TxEncodeResponse = { + typeUrl: "/cosmos.tx.v1beta1.TxEncodeResponse", + encode(message: TxEncodeResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.txBytes.length !== 0) { + writer.uint32(10).bytes(message.txBytes); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): TxEncodeResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseTxEncodeResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.txBytes = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): TxEncodeResponse { + const message = createBaseTxEncodeResponse(); + message.txBytes = object.txBytes ?? new Uint8Array(); + return message; + }, + fromAmino(object: TxEncodeResponseAmino): TxEncodeResponse { + const message = createBaseTxEncodeResponse(); + if (object.tx_bytes !== undefined && object.tx_bytes !== null) { + message.txBytes = bytesFromBase64(object.tx_bytes); + } + return message; + }, + toAmino(message: TxEncodeResponse): TxEncodeResponseAmino { + const obj: any = {}; + obj.tx_bytes = message.txBytes ? base64FromBytes(message.txBytes) : undefined; + return obj; + }, + fromAminoMsg(object: TxEncodeResponseAminoMsg): TxEncodeResponse { + return TxEncodeResponse.fromAmino(object.value); + }, + toAminoMsg(message: TxEncodeResponse): TxEncodeResponseAminoMsg { + return { + type: "cosmos-sdk/TxEncodeResponse", + value: TxEncodeResponse.toAmino(message) + }; + }, + fromProtoMsg(message: TxEncodeResponseProtoMsg): TxEncodeResponse { + return TxEncodeResponse.decode(message.value); + }, + toProto(message: TxEncodeResponse): Uint8Array { + return TxEncodeResponse.encode(message).finish(); + }, + toProtoMsg(message: TxEncodeResponse): TxEncodeResponseProtoMsg { + return { + typeUrl: "/cosmos.tx.v1beta1.TxEncodeResponse", + value: TxEncodeResponse.encode(message).finish() + }; + } +}; +function createBaseTxEncodeAminoRequest(): TxEncodeAminoRequest { + return { + aminoJson: "" + }; +} +export const TxEncodeAminoRequest = { + typeUrl: "/cosmos.tx.v1beta1.TxEncodeAminoRequest", + encode(message: TxEncodeAminoRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.aminoJson !== "") { + writer.uint32(10).string(message.aminoJson); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): TxEncodeAminoRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseTxEncodeAminoRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.aminoJson = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): TxEncodeAminoRequest { + const message = createBaseTxEncodeAminoRequest(); + message.aminoJson = object.aminoJson ?? ""; + return message; + }, + fromAmino(object: TxEncodeAminoRequestAmino): TxEncodeAminoRequest { + const message = createBaseTxEncodeAminoRequest(); + if (object.amino_json !== undefined && object.amino_json !== null) { + message.aminoJson = object.amino_json; + } + return message; + }, + toAmino(message: TxEncodeAminoRequest): TxEncodeAminoRequestAmino { + const obj: any = {}; + obj.amino_json = message.aminoJson; + return obj; + }, + fromAminoMsg(object: TxEncodeAminoRequestAminoMsg): TxEncodeAminoRequest { + return TxEncodeAminoRequest.fromAmino(object.value); + }, + toAminoMsg(message: TxEncodeAminoRequest): TxEncodeAminoRequestAminoMsg { + return { + type: "cosmos-sdk/TxEncodeAminoRequest", + value: TxEncodeAminoRequest.toAmino(message) + }; + }, + fromProtoMsg(message: TxEncodeAminoRequestProtoMsg): TxEncodeAminoRequest { + return TxEncodeAminoRequest.decode(message.value); + }, + toProto(message: TxEncodeAminoRequest): Uint8Array { + return TxEncodeAminoRequest.encode(message).finish(); + }, + toProtoMsg(message: TxEncodeAminoRequest): TxEncodeAminoRequestProtoMsg { + return { + typeUrl: "/cosmos.tx.v1beta1.TxEncodeAminoRequest", + value: TxEncodeAminoRequest.encode(message).finish() + }; + } +}; +function createBaseTxEncodeAminoResponse(): TxEncodeAminoResponse { + return { + aminoBinary: new Uint8Array() + }; +} +export const TxEncodeAminoResponse = { + typeUrl: "/cosmos.tx.v1beta1.TxEncodeAminoResponse", + encode(message: TxEncodeAminoResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.aminoBinary.length !== 0) { + writer.uint32(10).bytes(message.aminoBinary); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): TxEncodeAminoResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseTxEncodeAminoResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.aminoBinary = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): TxEncodeAminoResponse { + const message = createBaseTxEncodeAminoResponse(); + message.aminoBinary = object.aminoBinary ?? new Uint8Array(); + return message; + }, + fromAmino(object: TxEncodeAminoResponseAmino): TxEncodeAminoResponse { + const message = createBaseTxEncodeAminoResponse(); + if (object.amino_binary !== undefined && object.amino_binary !== null) { + message.aminoBinary = bytesFromBase64(object.amino_binary); + } + return message; + }, + toAmino(message: TxEncodeAminoResponse): TxEncodeAminoResponseAmino { + const obj: any = {}; + obj.amino_binary = message.aminoBinary ? base64FromBytes(message.aminoBinary) : undefined; + return obj; + }, + fromAminoMsg(object: TxEncodeAminoResponseAminoMsg): TxEncodeAminoResponse { + return TxEncodeAminoResponse.fromAmino(object.value); + }, + toAminoMsg(message: TxEncodeAminoResponse): TxEncodeAminoResponseAminoMsg { + return { + type: "cosmos-sdk/TxEncodeAminoResponse", + value: TxEncodeAminoResponse.toAmino(message) + }; + }, + fromProtoMsg(message: TxEncodeAminoResponseProtoMsg): TxEncodeAminoResponse { + return TxEncodeAminoResponse.decode(message.value); + }, + toProto(message: TxEncodeAminoResponse): Uint8Array { + return TxEncodeAminoResponse.encode(message).finish(); + }, + toProtoMsg(message: TxEncodeAminoResponse): TxEncodeAminoResponseProtoMsg { + return { + typeUrl: "/cosmos.tx.v1beta1.TxEncodeAminoResponse", + value: TxEncodeAminoResponse.encode(message).finish() + }; + } +}; +function createBaseTxDecodeAminoRequest(): TxDecodeAminoRequest { + return { + aminoBinary: new Uint8Array() + }; +} +export const TxDecodeAminoRequest = { + typeUrl: "/cosmos.tx.v1beta1.TxDecodeAminoRequest", + encode(message: TxDecodeAminoRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.aminoBinary.length !== 0) { + writer.uint32(10).bytes(message.aminoBinary); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): TxDecodeAminoRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseTxDecodeAminoRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.aminoBinary = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): TxDecodeAminoRequest { + const message = createBaseTxDecodeAminoRequest(); + message.aminoBinary = object.aminoBinary ?? new Uint8Array(); + return message; + }, + fromAmino(object: TxDecodeAminoRequestAmino): TxDecodeAminoRequest { + const message = createBaseTxDecodeAminoRequest(); + if (object.amino_binary !== undefined && object.amino_binary !== null) { + message.aminoBinary = bytesFromBase64(object.amino_binary); + } + return message; + }, + toAmino(message: TxDecodeAminoRequest): TxDecodeAminoRequestAmino { + const obj: any = {}; + obj.amino_binary = message.aminoBinary ? base64FromBytes(message.aminoBinary) : undefined; + return obj; + }, + fromAminoMsg(object: TxDecodeAminoRequestAminoMsg): TxDecodeAminoRequest { + return TxDecodeAminoRequest.fromAmino(object.value); + }, + toAminoMsg(message: TxDecodeAminoRequest): TxDecodeAminoRequestAminoMsg { + return { + type: "cosmos-sdk/TxDecodeAminoRequest", + value: TxDecodeAminoRequest.toAmino(message) + }; + }, + fromProtoMsg(message: TxDecodeAminoRequestProtoMsg): TxDecodeAminoRequest { + return TxDecodeAminoRequest.decode(message.value); + }, + toProto(message: TxDecodeAminoRequest): Uint8Array { + return TxDecodeAminoRequest.encode(message).finish(); + }, + toProtoMsg(message: TxDecodeAminoRequest): TxDecodeAminoRequestProtoMsg { + return { + typeUrl: "/cosmos.tx.v1beta1.TxDecodeAminoRequest", + value: TxDecodeAminoRequest.encode(message).finish() + }; + } +}; +function createBaseTxDecodeAminoResponse(): TxDecodeAminoResponse { + return { + aminoJson: "" + }; +} +export const TxDecodeAminoResponse = { + typeUrl: "/cosmos.tx.v1beta1.TxDecodeAminoResponse", + encode(message: TxDecodeAminoResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.aminoJson !== "") { + writer.uint32(10).string(message.aminoJson); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): TxDecodeAminoResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseTxDecodeAminoResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.aminoJson = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): TxDecodeAminoResponse { + const message = createBaseTxDecodeAminoResponse(); + message.aminoJson = object.aminoJson ?? ""; + return message; + }, + fromAmino(object: TxDecodeAminoResponseAmino): TxDecodeAminoResponse { + const message = createBaseTxDecodeAminoResponse(); + if (object.amino_json !== undefined && object.amino_json !== null) { + message.aminoJson = object.amino_json; + } + return message; + }, + toAmino(message: TxDecodeAminoResponse): TxDecodeAminoResponseAmino { + const obj: any = {}; + obj.amino_json = message.aminoJson; + return obj; + }, + fromAminoMsg(object: TxDecodeAminoResponseAminoMsg): TxDecodeAminoResponse { + return TxDecodeAminoResponse.fromAmino(object.value); + }, + toAminoMsg(message: TxDecodeAminoResponse): TxDecodeAminoResponseAminoMsg { + return { + type: "cosmos-sdk/TxDecodeAminoResponse", + value: TxDecodeAminoResponse.toAmino(message) + }; + }, + fromProtoMsg(message: TxDecodeAminoResponseProtoMsg): TxDecodeAminoResponse { + return TxDecodeAminoResponse.decode(message.value); + }, + toProto(message: TxDecodeAminoResponse): Uint8Array { + return TxDecodeAminoResponse.encode(message).finish(); + }, + toProtoMsg(message: TxDecodeAminoResponse): TxDecodeAminoResponseProtoMsg { + return { + typeUrl: "/cosmos.tx.v1beta1.TxDecodeAminoResponse", + value: TxDecodeAminoResponse.encode(message).finish() + }; + } }; \ No newline at end of file diff --git a/packages/osmo-query/src/codegen/cosmos/tx/v1beta1/tx.ts b/packages/osmo-query/src/codegen/cosmos/tx/v1beta1/tx.ts index 856b8f3a1..77e93d106 100644 --- a/packages/osmo-query/src/codegen/cosmos/tx/v1beta1/tx.ts +++ b/packages/osmo-query/src/codegen/cosmos/tx/v1beta1/tx.ts @@ -1,18 +1,18 @@ import { Any, AnyAmino, AnySDKType } from "../../../google/protobuf/any"; -import { SignMode, signModeFromJSON } from "../signing/v1beta1/signing"; +import { SignMode, signModeFromJSON, signModeToJSON } from "../signing/v1beta1/signing"; import { CompactBitArray, CompactBitArrayAmino, CompactBitArraySDKType } from "../../crypto/multisig/v1beta1/multisig"; import { Coin, CoinAmino, CoinSDKType } from "../../base/v1beta1/coin"; import { BinaryReader, BinaryWriter } from "../../../binary"; -import { isSet } from "../../../helpers"; +import { bytesFromBase64, base64FromBytes } from "../../../helpers"; /** 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 @@ -38,7 +38,7 @@ export interface TxAmino { * AuthInfo's signer_infos to allow connecting signature meta information like * public key and signing mode by position. */ - signatures: Uint8Array[]; + signatures?: string[]; } export interface TxAminoMsg { type: "cosmos-sdk/Tx"; @@ -46,8 +46,8 @@ export interface TxAminoMsg { } /** Tx is the standard type used for broadcasting transactions. */ export interface TxSDKType { - body: TxBodySDKType; - auth_info: AuthInfoSDKType; + body?: TxBodySDKType; + auth_info?: AuthInfoSDKType; signatures: Uint8Array[]; } /** @@ -91,18 +91,18 @@ export interface TxRawAmino { * body_bytes is a protobuf serialization of a TxBody that matches the * representation in SignDoc. */ - body_bytes: Uint8Array; + body_bytes?: string; /** * auth_info_bytes is a protobuf serialization of an AuthInfo that matches the * representation in SignDoc. */ - auth_info_bytes: Uint8Array; + auth_info_bytes?: string; /** * 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?: string[]; } export interface TxRawAminoMsg { type: "cosmos-sdk/TxRaw"; @@ -151,20 +151,20 @@ export interface SignDocAmino { * body_bytes is protobuf serialization of a TxBody that matches the * representation in TxRaw. */ - body_bytes: Uint8Array; + body_bytes?: string; /** * auth_info_bytes is a protobuf serialization of an AuthInfo that matches the * representation in TxRaw. */ - auth_info_bytes: Uint8Array; + auth_info_bytes?: string; /** * 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 */ - chain_id: string; + chain_id?: string; /** account_number is the account number of the account in state */ - account_number: string; + account_number?: string; } export interface SignDocAminoMsg { type: "cosmos-sdk/SignDoc"; @@ -177,6 +177,96 @@ export interface SignDocSDKType { chain_id: string; account_number: bigint; } +/** + * SignDocDirectAux is the type used for generating sign bytes for + * SIGN_MODE_DIRECT_AUX. + * + * Since: cosmos-sdk 0.46 + */ +export interface SignDocDirectAux { + /** + * body_bytes is protobuf serialization of a TxBody that matches the + * representation in TxRaw. + */ + bodyBytes: Uint8Array; + /** public_key is the public key of the signing account. */ + publicKey?: Any; + /** + * chain_id is the identifier of the chain this transaction targets. + * It prevents signed transactions from being used on another chain by an + * attacker. + */ + chainId: string; + /** account_number is the account number of the account in state. */ + accountNumber: bigint; + /** sequence is the sequence number of the signing account. */ + sequence: bigint; + /** + * Tip is the optional tip used for transactions fees paid in another denom. + * It should be left empty if the signer is not the tipper for this + * transaction. + * + * This field is ignored if the chain didn't enable tips, i.e. didn't add the + * `TipDecorator` in its posthandler. + */ + tip?: Tip; +} +export interface SignDocDirectAuxProtoMsg { + typeUrl: "/cosmos.tx.v1beta1.SignDocDirectAux"; + value: Uint8Array; +} +/** + * SignDocDirectAux is the type used for generating sign bytes for + * SIGN_MODE_DIRECT_AUX. + * + * Since: cosmos-sdk 0.46 + */ +export interface SignDocDirectAuxAmino { + /** + * body_bytes is protobuf serialization of a TxBody that matches the + * representation in TxRaw. + */ + body_bytes?: string; + /** public_key is the public key of the signing account. */ + public_key?: AnyAmino; + /** + * chain_id is the identifier of the chain this transaction targets. + * It prevents signed transactions from being used on another chain by an + * attacker. + */ + chain_id?: string; + /** account_number is the account number of the account in state. */ + account_number?: string; + /** sequence is the sequence number of the signing account. */ + sequence?: string; + /** + * Tip is the optional tip used for transactions fees paid in another denom. + * It should be left empty if the signer is not the tipper for this + * transaction. + * + * This field is ignored if the chain didn't enable tips, i.e. didn't add the + * `TipDecorator` in its posthandler. + */ + tip?: TipAmino; +} +export interface SignDocDirectAuxAminoMsg { + type: "cosmos-sdk/SignDocDirectAux"; + value: SignDocDirectAuxAmino; +} +/** + * SignDocDirectAux is the type used for generating sign bytes for + * SIGN_MODE_DIRECT_AUX. + * + * Since: cosmos-sdk 0.46 + */ +export interface SignDocDirectAuxSDKType { + body_bytes: Uint8Array; + public_key?: AnySDKType; + chain_id: string; + account_number: bigint; + sequence: bigint; + tip?: TipSDKType; +} /** TxBody is the body of a transaction that all signers sign over. */ export interface TxBody { /** @@ -228,30 +318,30 @@ export interface TxBodyAmino { * is referred to as the primary signer and pays the fee for the whole * transaction. */ - messages: AnyAmino[]; + messages?: AnyAmino[]; /** * 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 */ - timeout_height: string; + timeout_height?: string; /** * 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 */ - extension_options: AnyAmino[]; + extension_options?: AnyAmino[]; /** * 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 */ - non_critical_extension_options: AnyAmino[]; + non_critical_extension_options?: AnyAmino[]; } export interface TxBodyAminoMsg { type: "cosmos-sdk/TxBody"; @@ -283,7 +373,16 @@ export interface AuthInfo { * 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; + /** + * Tip is the optional tip used for transactions fees paid in another denom. + * + * This field is ignored if the chain didn't enable tips, i.e. didn't add the + * `TipDecorator` in its posthandler. + * + * Since: cosmos-sdk 0.46 + */ + tip?: Tip; } export interface AuthInfoProtoMsg { typeUrl: "/cosmos.tx.v1beta1.AuthInfo"; @@ -300,7 +399,7 @@ export interface AuthInfoAmino { * messages. The first element is the primary signer and the one which pays * the fee. */ - signer_infos: SignerInfoAmino[]; + signer_infos?: SignerInfoAmino[]; /** * 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 @@ -308,6 +407,15 @@ export interface AuthInfoAmino { * of the signers. This can be estimated via simulation. */ fee?: FeeAmino; + /** + * Tip is the optional tip used for transactions fees paid in another denom. + * + * This field is ignored if the chain didn't enable tips, i.e. didn't add the + * `TipDecorator` in its posthandler. + * + * Since: cosmos-sdk 0.46 + */ + tip?: TipAmino; } export interface AuthInfoAminoMsg { type: "cosmos-sdk/AuthInfo"; @@ -319,7 +427,8 @@ export interface AuthInfoAminoMsg { */ export interface AuthInfoSDKType { signer_infos: SignerInfoSDKType[]; - fee: FeeSDKType; + fee?: FeeSDKType; + tip?: TipSDKType; } /** * SignerInfo describes the public key and signing mode of a single top-level @@ -331,12 +440,12 @@ 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 @@ -369,7 +478,7 @@ export interface SignerInfoAmino { * number of committed transactions signed by a given address. It is used to * prevent replay attacks. */ - sequence: string; + sequence?: string; } export interface SignerInfoAminoMsg { type: "cosmos-sdk/SignerInfo"; @@ -380,8 +489,8 @@ export interface SignerInfoAminoMsg { * signer. */ export interface SignerInfoSDKType { - public_key: AnySDKType; - mode_info: ModeInfoSDKType; + public_key?: AnySDKType; + mode_info?: ModeInfoSDKType; sequence: bigint; } /** ModeInfo describes the signing mode of a single or nested multisig signer. */ @@ -431,7 +540,7 @@ export interface ModeInfo_SingleProtoMsg { */ export interface ModeInfo_SingleAmino { /** mode is the signing mode of the single signer */ - mode: SignMode; + mode?: SignMode; } export interface ModeInfo_SingleAminoMsg { type: "cosmos-sdk/Single"; @@ -448,7 +557,7 @@ export interface ModeInfo_SingleSDKType { /** 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 @@ -467,7 +576,7 @@ export interface ModeInfo_MultiAmino { * mode_infos is the corresponding modes of the signers of the multisig * which could include nested multisig public keys */ - mode_infos: ModeInfoAmino[]; + mode_infos?: ModeInfoAmino[]; } export interface ModeInfo_MultiAminoMsg { type: "cosmos-sdk/Multi"; @@ -475,7 +584,7 @@ export interface ModeInfo_MultiAminoMsg { } /** Multi is the mode info for a multisig public key */ export interface ModeInfo_MultiSDKType { - bitarray: CompactBitArraySDKType; + bitarray?: CompactBitArraySDKType; mode_infos: ModeInfoSDKType[]; } /** @@ -515,24 +624,24 @@ export interface FeeProtoMsg { */ export interface FeeAmino { /** amount is the amount of coins to be paid as a fee */ - amount: CoinAmino[]; + amount?: CoinAmino[]; /** * gas_limit is the maximum gas that can be used in transaction processing * before an out of gas error occurs */ - gas_limit: string; + gas_limit?: string; /** * 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; } export interface FeeAminoMsg { type: "cosmos-sdk/Fee"; @@ -549,10 +658,123 @@ export interface FeeSDKType { payer: string; granter: string; } +/** + * Tip is the tip used for meta-transactions. + * + * Since: cosmos-sdk 0.46 + */ +export interface Tip { + /** amount is the amount of the tip */ + amount: Coin[]; + /** tipper is the address of the account paying for the tip */ + tipper: string; +} +export interface TipProtoMsg { + typeUrl: "/cosmos.tx.v1beta1.Tip"; + value: Uint8Array; +} +/** + * Tip is the tip used for meta-transactions. + * + * Since: cosmos-sdk 0.46 + */ +export interface TipAmino { + /** amount is the amount of the tip */ + amount?: CoinAmino[]; + /** tipper is the address of the account paying for the tip */ + tipper?: string; +} +export interface TipAminoMsg { + type: "cosmos-sdk/Tip"; + value: TipAmino; +} +/** + * Tip is the tip used for meta-transactions. + * + * Since: cosmos-sdk 0.46 + */ +export interface TipSDKType { + amount: CoinSDKType[]; + tipper: string; +} +/** + * AuxSignerData is the intermediary format that an auxiliary signer (e.g. a + * tipper) builds and sends to the fee payer (who will build and broadcast the + * actual tx). AuxSignerData is not a valid tx in itself, and will be rejected + * by the node if sent directly as-is. + * + * Since: cosmos-sdk 0.46 + */ +export interface AuxSignerData { + /** + * address is the bech32-encoded address of the auxiliary signer. If using + * AuxSignerData across different chains, the bech32 prefix of the target + * chain (where the final transaction is broadcasted) should be used. + */ + address: string; + /** + * sign_doc is the SIGN_MODE_DIRECT_AUX sign doc that the auxiliary signer + * signs. Note: we use the same sign doc even if we're signing with + * LEGACY_AMINO_JSON. + */ + signDoc?: SignDocDirectAux; + /** mode is the signing mode of the single signer. */ + mode: SignMode; + /** sig is the signature of the sign doc. */ + sig: Uint8Array; +} +export interface AuxSignerDataProtoMsg { + typeUrl: "/cosmos.tx.v1beta1.AuxSignerData"; + value: Uint8Array; +} +/** + * AuxSignerData is the intermediary format that an auxiliary signer (e.g. a + * tipper) builds and sends to the fee payer (who will build and broadcast the + * actual tx). AuxSignerData is not a valid tx in itself, and will be rejected + * by the node if sent directly as-is. + * + * Since: cosmos-sdk 0.46 + */ +export interface AuxSignerDataAmino { + /** + * address is the bech32-encoded address of the auxiliary signer. If using + * AuxSignerData across different chains, the bech32 prefix of the target + * chain (where the final transaction is broadcasted) should be used. + */ + address?: string; + /** + * sign_doc is the SIGN_MODE_DIRECT_AUX sign doc that the auxiliary signer + * signs. Note: we use the same sign doc even if we're signing with + * LEGACY_AMINO_JSON. + */ + sign_doc?: SignDocDirectAuxAmino; + /** mode is the signing mode of the single signer. */ + mode?: SignMode; + /** sig is the signature of the sign doc. */ + sig?: string; +} +export interface AuxSignerDataAminoMsg { + type: "cosmos-sdk/AuxSignerData"; + value: AuxSignerDataAmino; +} +/** + * AuxSignerData is the intermediary format that an auxiliary signer (e.g. a + * tipper) builds and sends to the fee payer (who will build and broadcast the + * actual tx). AuxSignerData is not a valid tx in itself, and will be rejected + * by the node if sent directly as-is. + * + * Since: cosmos-sdk 0.46 + */ +export interface AuxSignerDataSDKType { + address: string; + sign_doc?: SignDocDirectAuxSDKType; + mode: SignMode; + sig: Uint8Array; +} function createBaseTx(): Tx { return { - body: TxBody.fromPartial({}), - authInfo: AuthInfo.fromPartial({}), + body: undefined, + authInfo: undefined, signatures: [] }; } @@ -601,18 +823,22 @@ export const Tx = { return message; }, fromAmino(object: TxAmino): Tx { - return { - body: object?.body ? TxBody.fromAmino(object.body) : undefined, - authInfo: object?.auth_info ? AuthInfo.fromAmino(object.auth_info) : undefined, - signatures: Array.isArray(object?.signatures) ? object.signatures.map((e: any) => e) : [] - }; + const message = createBaseTx(); + if (object.body !== undefined && object.body !== null) { + message.body = TxBody.fromAmino(object.body); + } + if (object.auth_info !== undefined && object.auth_info !== null) { + message.authInfo = AuthInfo.fromAmino(object.auth_info); + } + message.signatures = object.signatures?.map(e => bytesFromBase64(e)) || []; + return message; }, toAmino(message: Tx): TxAmino { const obj: any = {}; obj.body = message.body ? TxBody.toAmino(message.body) : undefined; obj.auth_info = message.authInfo ? AuthInfo.toAmino(message.authInfo) : undefined; if (message.signatures) { - obj.signatures = message.signatures.map(e => e); + obj.signatures = message.signatures.map(e => base64FromBytes(e)); } else { obj.signatures = []; } @@ -692,18 +918,22 @@ export const TxRaw = { return message; }, fromAmino(object: TxRawAmino): TxRaw { - return { - bodyBytes: object.body_bytes, - authInfoBytes: object.auth_info_bytes, - signatures: Array.isArray(object?.signatures) ? object.signatures.map((e: any) => e) : [] - }; + const message = createBaseTxRaw(); + if (object.body_bytes !== undefined && object.body_bytes !== null) { + message.bodyBytes = bytesFromBase64(object.body_bytes); + } + if (object.auth_info_bytes !== undefined && object.auth_info_bytes !== null) { + message.authInfoBytes = bytesFromBase64(object.auth_info_bytes); + } + message.signatures = object.signatures?.map(e => bytesFromBase64(e)) || []; + return message; }, toAmino(message: TxRaw): TxRawAmino { const obj: any = {}; - obj.body_bytes = message.bodyBytes; - obj.auth_info_bytes = message.authInfoBytes; + obj.body_bytes = message.bodyBytes ? base64FromBytes(message.bodyBytes) : undefined; + obj.auth_info_bytes = message.authInfoBytes ? base64FromBytes(message.authInfoBytes) : undefined; if (message.signatures) { - obj.signatures = message.signatures.map(e => e); + obj.signatures = message.signatures.map(e => base64FromBytes(e)); } else { obj.signatures = []; } @@ -791,17 +1021,25 @@ export const SignDoc = { return message; }, fromAmino(object: SignDocAmino): SignDoc { - return { - bodyBytes: object.body_bytes, - authInfoBytes: object.auth_info_bytes, - chainId: object.chain_id, - accountNumber: BigInt(object.account_number) - }; + const message = createBaseSignDoc(); + if (object.body_bytes !== undefined && object.body_bytes !== null) { + message.bodyBytes = bytesFromBase64(object.body_bytes); + } + if (object.auth_info_bytes !== undefined && object.auth_info_bytes !== null) { + message.authInfoBytes = bytesFromBase64(object.auth_info_bytes); + } + if (object.chain_id !== undefined && object.chain_id !== null) { + message.chainId = object.chain_id; + } + if (object.account_number !== undefined && object.account_number !== null) { + message.accountNumber = BigInt(object.account_number); + } + return message; }, toAmino(message: SignDoc): SignDocAmino { const obj: any = {}; - obj.body_bytes = message.bodyBytes; - obj.auth_info_bytes = message.authInfoBytes; + obj.body_bytes = message.bodyBytes ? base64FromBytes(message.bodyBytes) : undefined; + obj.auth_info_bytes = message.authInfoBytes ? base64FromBytes(message.authInfoBytes) : undefined; obj.chain_id = message.chainId; obj.account_number = message.accountNumber ? message.accountNumber.toString() : undefined; return obj; @@ -828,6 +1066,135 @@ export const SignDoc = { }; } }; +function createBaseSignDocDirectAux(): SignDocDirectAux { + return { + bodyBytes: new Uint8Array(), + publicKey: undefined, + chainId: "", + accountNumber: BigInt(0), + sequence: BigInt(0), + tip: undefined + }; +} +export const SignDocDirectAux = { + typeUrl: "/cosmos.tx.v1beta1.SignDocDirectAux", + encode(message: SignDocDirectAux, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.bodyBytes.length !== 0) { + writer.uint32(10).bytes(message.bodyBytes); + } + if (message.publicKey !== undefined) { + Any.encode(message.publicKey, writer.uint32(18).fork()).ldelim(); + } + if (message.chainId !== "") { + writer.uint32(26).string(message.chainId); + } + if (message.accountNumber !== BigInt(0)) { + writer.uint32(32).uint64(message.accountNumber); + } + if (message.sequence !== BigInt(0)) { + writer.uint32(40).uint64(message.sequence); + } + if (message.tip !== undefined) { + Tip.encode(message.tip, writer.uint32(50).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): SignDocDirectAux { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSignDocDirectAux(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.bodyBytes = reader.bytes(); + break; + case 2: + message.publicKey = Any.decode(reader, reader.uint32()); + break; + case 3: + message.chainId = reader.string(); + break; + case 4: + message.accountNumber = reader.uint64(); + break; + case 5: + message.sequence = reader.uint64(); + break; + case 6: + message.tip = Tip.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): SignDocDirectAux { + const message = createBaseSignDocDirectAux(); + message.bodyBytes = object.bodyBytes ?? new Uint8Array(); + message.publicKey = object.publicKey !== undefined && object.publicKey !== null ? Any.fromPartial(object.publicKey) : undefined; + message.chainId = object.chainId ?? ""; + message.accountNumber = object.accountNumber !== undefined && object.accountNumber !== null ? BigInt(object.accountNumber.toString()) : BigInt(0); + message.sequence = object.sequence !== undefined && object.sequence !== null ? BigInt(object.sequence.toString()) : BigInt(0); + message.tip = object.tip !== undefined && object.tip !== null ? Tip.fromPartial(object.tip) : undefined; + return message; + }, + fromAmino(object: SignDocDirectAuxAmino): SignDocDirectAux { + const message = createBaseSignDocDirectAux(); + if (object.body_bytes !== undefined && object.body_bytes !== null) { + message.bodyBytes = bytesFromBase64(object.body_bytes); + } + if (object.public_key !== undefined && object.public_key !== null) { + message.publicKey = Any.fromAmino(object.public_key); + } + if (object.chain_id !== undefined && object.chain_id !== null) { + message.chainId = object.chain_id; + } + if (object.account_number !== undefined && object.account_number !== null) { + message.accountNumber = BigInt(object.account_number); + } + if (object.sequence !== undefined && object.sequence !== null) { + message.sequence = BigInt(object.sequence); + } + if (object.tip !== undefined && object.tip !== null) { + message.tip = Tip.fromAmino(object.tip); + } + return message; + }, + toAmino(message: SignDocDirectAux): SignDocDirectAuxAmino { + const obj: any = {}; + obj.body_bytes = message.bodyBytes ? base64FromBytes(message.bodyBytes) : undefined; + obj.public_key = message.publicKey ? Any.toAmino(message.publicKey) : undefined; + obj.chain_id = message.chainId; + obj.account_number = message.accountNumber ? message.accountNumber.toString() : undefined; + obj.sequence = message.sequence ? message.sequence.toString() : undefined; + obj.tip = message.tip ? Tip.toAmino(message.tip) : undefined; + return obj; + }, + fromAminoMsg(object: SignDocDirectAuxAminoMsg): SignDocDirectAux { + return SignDocDirectAux.fromAmino(object.value); + }, + toAminoMsg(message: SignDocDirectAux): SignDocDirectAuxAminoMsg { + return { + type: "cosmos-sdk/SignDocDirectAux", + value: SignDocDirectAux.toAmino(message) + }; + }, + fromProtoMsg(message: SignDocDirectAuxProtoMsg): SignDocDirectAux { + return SignDocDirectAux.decode(message.value); + }, + toProto(message: SignDocDirectAux): Uint8Array { + return SignDocDirectAux.encode(message).finish(); + }, + toProtoMsg(message: SignDocDirectAux): SignDocDirectAuxProtoMsg { + return { + typeUrl: "/cosmos.tx.v1beta1.SignDocDirectAux", + value: SignDocDirectAux.encode(message).finish() + }; + } +}; function createBaseTxBody(): TxBody { return { messages: [], @@ -896,13 +1263,17 @@ export const TxBody = { return message; }, fromAmino(object: TxBodyAmino): TxBody { - return { - messages: Array.isArray(object?.messages) ? object.messages.map((e: any) => Any.fromAmino(e)) : [], - memo: object.memo, - timeoutHeight: BigInt(object.timeout_height), - extensionOptions: Array.isArray(object?.extension_options) ? object.extension_options.map((e: any) => Any.fromAmino(e)) : [], - nonCriticalExtensionOptions: Array.isArray(object?.non_critical_extension_options) ? object.non_critical_extension_options.map((e: any) => Any.fromAmino(e)) : [] - }; + const message = createBaseTxBody(); + message.messages = object.messages?.map(e => Any.fromAmino(e)) || []; + if (object.memo !== undefined && object.memo !== null) { + message.memo = object.memo; + } + if (object.timeout_height !== undefined && object.timeout_height !== null) { + message.timeoutHeight = BigInt(object.timeout_height); + } + message.extensionOptions = object.extension_options?.map(e => Any.fromAmino(e)) || []; + message.nonCriticalExtensionOptions = object.non_critical_extension_options?.map(e => Any.fromAmino(e)) || []; + return message; }, toAmino(message: TxBody): TxBodyAmino { const obj: any = {}; @@ -950,7 +1321,8 @@ export const TxBody = { function createBaseAuthInfo(): AuthInfo { return { signerInfos: [], - fee: Fee.fromPartial({}) + fee: undefined, + tip: undefined }; } export const AuthInfo = { @@ -962,6 +1334,9 @@ export const AuthInfo = { if (message.fee !== undefined) { Fee.encode(message.fee, writer.uint32(18).fork()).ldelim(); } + if (message.tip !== undefined) { + Tip.encode(message.tip, writer.uint32(26).fork()).ldelim(); + } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): AuthInfo { @@ -977,6 +1352,9 @@ export const AuthInfo = { case 2: message.fee = Fee.decode(reader, reader.uint32()); break; + case 3: + message.tip = Tip.decode(reader, reader.uint32()); + break; default: reader.skipType(tag & 7); break; @@ -988,13 +1366,19 @@ export const 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; + message.tip = object.tip !== undefined && object.tip !== null ? Tip.fromPartial(object.tip) : undefined; return message; }, fromAmino(object: AuthInfoAmino): AuthInfo { - return { - signerInfos: Array.isArray(object?.signer_infos) ? object.signer_infos.map((e: any) => SignerInfo.fromAmino(e)) : [], - fee: object?.fee ? Fee.fromAmino(object.fee) : undefined - }; + const message = createBaseAuthInfo(); + message.signerInfos = object.signer_infos?.map(e => SignerInfo.fromAmino(e)) || []; + if (object.fee !== undefined && object.fee !== null) { + message.fee = Fee.fromAmino(object.fee); + } + if (object.tip !== undefined && object.tip !== null) { + message.tip = Tip.fromAmino(object.tip); + } + return message; }, toAmino(message: AuthInfo): AuthInfoAmino { const obj: any = {}; @@ -1004,6 +1388,7 @@ export const AuthInfo = { obj.signer_infos = []; } obj.fee = message.fee ? Fee.toAmino(message.fee) : undefined; + obj.tip = message.tip ? Tip.toAmino(message.tip) : undefined; return obj; }, fromAminoMsg(object: AuthInfoAminoMsg): AuthInfo { @@ -1030,8 +1415,8 @@ export const AuthInfo = { }; function createBaseSignerInfo(): SignerInfo { return { - publicKey: Any.fromPartial({}), - modeInfo: ModeInfo.fromPartial({}), + publicKey: undefined, + modeInfo: undefined, sequence: BigInt(0) }; } @@ -1080,11 +1465,17 @@ export const SignerInfo = { return message; }, fromAmino(object: SignerInfoAmino): SignerInfo { - return { - publicKey: object?.public_key ? Any.fromAmino(object.public_key) : undefined, - modeInfo: object?.mode_info ? ModeInfo.fromAmino(object.mode_info) : undefined, - sequence: BigInt(object.sequence) - }; + const message = createBaseSignerInfo(); + if (object.public_key !== undefined && object.public_key !== null) { + message.publicKey = Any.fromAmino(object.public_key); + } + if (object.mode_info !== undefined && object.mode_info !== null) { + message.modeInfo = ModeInfo.fromAmino(object.mode_info); + } + if (object.sequence !== undefined && object.sequence !== null) { + message.sequence = BigInt(object.sequence); + } + return message; }, toAmino(message: SignerInfo): SignerInfoAmino { const obj: any = {}; @@ -1159,10 +1550,14 @@ export const ModeInfo = { return message; }, fromAmino(object: ModeInfoAmino): ModeInfo { - return { - single: object?.single ? ModeInfo_Single.fromAmino(object.single) : undefined, - multi: object?.multi ? ModeInfo_Multi.fromAmino(object.multi) : undefined - }; + const message = createBaseModeInfo(); + if (object.single !== undefined && object.single !== null) { + message.single = ModeInfo_Single.fromAmino(object.single); + } + if (object.multi !== undefined && object.multi !== null) { + message.multi = ModeInfo_Multi.fromAmino(object.multi); + } + return message; }, toAmino(message: ModeInfo): ModeInfoAmino { const obj: any = {}; @@ -1228,13 +1623,15 @@ export const ModeInfo_Single = { return message; }, fromAmino(object: ModeInfo_SingleAmino): ModeInfo_Single { - return { - mode: isSet(object.mode) ? signModeFromJSON(object.mode) : -1 - }; + const message = createBaseModeInfo_Single(); + if (object.mode !== undefined && object.mode !== null) { + message.mode = signModeFromJSON(object.mode); + } + return message; }, toAmino(message: ModeInfo_Single): ModeInfo_SingleAmino { const obj: any = {}; - obj.mode = message.mode; + obj.mode = signModeToJSON(message.mode); return obj; }, fromAminoMsg(object: ModeInfo_SingleAminoMsg): ModeInfo_Single { @@ -1261,7 +1658,7 @@ export const ModeInfo_Single = { }; function createBaseModeInfo_Multi(): ModeInfo_Multi { return { - bitarray: CompactBitArray.fromPartial({}), + bitarray: undefined, modeInfos: [] }; } @@ -1303,10 +1700,12 @@ export const ModeInfo_Multi = { return message; }, fromAmino(object: ModeInfo_MultiAmino): ModeInfo_Multi { - return { - bitarray: object?.bitarray ? CompactBitArray.fromAmino(object.bitarray) : undefined, - modeInfos: Array.isArray(object?.mode_infos) ? object.mode_infos.map((e: any) => ModeInfo.fromAmino(e)) : [] - }; + const message = createBaseModeInfo_Multi(); + if (object.bitarray !== undefined && object.bitarray !== null) { + message.bitarray = CompactBitArray.fromAmino(object.bitarray); + } + message.modeInfos = object.mode_infos?.map(e => ModeInfo.fromAmino(e)) || []; + return message; }, toAmino(message: ModeInfo_Multi): ModeInfo_MultiAmino { const obj: any = {}; @@ -1400,12 +1799,18 @@ export const Fee = { return message; }, fromAmino(object: FeeAmino): Fee { - return { - amount: Array.isArray(object?.amount) ? object.amount.map((e: any) => Coin.fromAmino(e)) : [], - gasLimit: BigInt(object.gas_limit), - payer: object.payer, - granter: object.granter - }; + const message = createBaseFee(); + message.amount = object.amount?.map(e => Coin.fromAmino(e)) || []; + if (object.gas_limit !== undefined && object.gas_limit !== null) { + message.gasLimit = BigInt(object.gas_limit); + } + if (object.payer !== undefined && object.payer !== null) { + message.payer = object.payer; + } + if (object.granter !== undefined && object.granter !== null) { + message.granter = object.granter; + } + return message; }, toAmino(message: Fee): FeeAmino { const obj: any = {}; @@ -1440,4 +1845,192 @@ export const Fee = { value: Fee.encode(message).finish() }; } +}; +function createBaseTip(): Tip { + return { + amount: [], + tipper: "" + }; +} +export const Tip = { + typeUrl: "/cosmos.tx.v1beta1.Tip", + encode(message: Tip, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.amount) { + Coin.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.tipper !== "") { + writer.uint32(18).string(message.tipper); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): Tip { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseTip(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.amount.push(Coin.decode(reader, reader.uint32())); + break; + case 2: + message.tipper = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): Tip { + const message = createBaseTip(); + message.amount = object.amount?.map(e => Coin.fromPartial(e)) || []; + message.tipper = object.tipper ?? ""; + return message; + }, + fromAmino(object: TipAmino): Tip { + const message = createBaseTip(); + message.amount = object.amount?.map(e => Coin.fromAmino(e)) || []; + if (object.tipper !== undefined && object.tipper !== null) { + message.tipper = object.tipper; + } + return message; + }, + toAmino(message: Tip): TipAmino { + const obj: any = {}; + if (message.amount) { + obj.amount = message.amount.map(e => e ? Coin.toAmino(e) : undefined); + } else { + obj.amount = []; + } + obj.tipper = message.tipper; + return obj; + }, + fromAminoMsg(object: TipAminoMsg): Tip { + return Tip.fromAmino(object.value); + }, + toAminoMsg(message: Tip): TipAminoMsg { + return { + type: "cosmos-sdk/Tip", + value: Tip.toAmino(message) + }; + }, + fromProtoMsg(message: TipProtoMsg): Tip { + return Tip.decode(message.value); + }, + toProto(message: Tip): Uint8Array { + return Tip.encode(message).finish(); + }, + toProtoMsg(message: Tip): TipProtoMsg { + return { + typeUrl: "/cosmos.tx.v1beta1.Tip", + value: Tip.encode(message).finish() + }; + } +}; +function createBaseAuxSignerData(): AuxSignerData { + return { + address: "", + signDoc: undefined, + mode: 0, + sig: new Uint8Array() + }; +} +export const AuxSignerData = { + typeUrl: "/cosmos.tx.v1beta1.AuxSignerData", + encode(message: AuxSignerData, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.address !== "") { + writer.uint32(10).string(message.address); + } + if (message.signDoc !== undefined) { + SignDocDirectAux.encode(message.signDoc, writer.uint32(18).fork()).ldelim(); + } + if (message.mode !== 0) { + writer.uint32(24).int32(message.mode); + } + if (message.sig.length !== 0) { + writer.uint32(34).bytes(message.sig); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): AuxSignerData { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseAuxSignerData(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.address = reader.string(); + break; + case 2: + message.signDoc = SignDocDirectAux.decode(reader, reader.uint32()); + break; + case 3: + message.mode = (reader.int32() as any); + break; + case 4: + message.sig = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): AuxSignerData { + const message = createBaseAuxSignerData(); + message.address = object.address ?? ""; + message.signDoc = object.signDoc !== undefined && object.signDoc !== null ? SignDocDirectAux.fromPartial(object.signDoc) : undefined; + message.mode = object.mode ?? 0; + message.sig = object.sig ?? new Uint8Array(); + return message; + }, + fromAmino(object: AuxSignerDataAmino): AuxSignerData { + const message = createBaseAuxSignerData(); + if (object.address !== undefined && object.address !== null) { + message.address = object.address; + } + if (object.sign_doc !== undefined && object.sign_doc !== null) { + message.signDoc = SignDocDirectAux.fromAmino(object.sign_doc); + } + if (object.mode !== undefined && object.mode !== null) { + message.mode = signModeFromJSON(object.mode); + } + if (object.sig !== undefined && object.sig !== null) { + message.sig = bytesFromBase64(object.sig); + } + return message; + }, + toAmino(message: AuxSignerData): AuxSignerDataAmino { + const obj: any = {}; + obj.address = message.address; + obj.sign_doc = message.signDoc ? SignDocDirectAux.toAmino(message.signDoc) : undefined; + obj.mode = signModeToJSON(message.mode); + obj.sig = message.sig ? base64FromBytes(message.sig) : undefined; + return obj; + }, + fromAminoMsg(object: AuxSignerDataAminoMsg): AuxSignerData { + return AuxSignerData.fromAmino(object.value); + }, + toAminoMsg(message: AuxSignerData): AuxSignerDataAminoMsg { + return { + type: "cosmos-sdk/AuxSignerData", + value: AuxSignerData.toAmino(message) + }; + }, + fromProtoMsg(message: AuxSignerDataProtoMsg): AuxSignerData { + return AuxSignerData.decode(message.value); + }, + toProto(message: AuxSignerData): Uint8Array { + return AuxSignerData.encode(message).finish(); + }, + toProtoMsg(message: AuxSignerData): AuxSignerDataProtoMsg { + return { + typeUrl: "/cosmos.tx.v1beta1.AuxSignerData", + value: AuxSignerData.encode(message).finish() + }; + } }; \ No newline at end of file diff --git a/packages/osmo-query/src/codegen/cosmos/upgrade/v1beta1/query.lcd.ts b/packages/osmo-query/src/codegen/cosmos/upgrade/v1beta1/query.lcd.ts index 49a57f788..40543d689 100644 --- a/packages/osmo-query/src/codegen/cosmos/upgrade/v1beta1/query.lcd.ts +++ b/packages/osmo-query/src/codegen/cosmos/upgrade/v1beta1/query.lcd.ts @@ -1,5 +1,5 @@ import { LCDClient } from "@cosmology/lcd"; -import { QueryCurrentPlanRequest, QueryCurrentPlanResponseSDKType, QueryAppliedPlanRequest, QueryAppliedPlanResponseSDKType, QueryUpgradedConsensusStateRequest, QueryUpgradedConsensusStateResponseSDKType, QueryModuleVersionsRequest, QueryModuleVersionsResponseSDKType } from "./query"; +import { QueryCurrentPlanRequest, QueryCurrentPlanResponseSDKType, QueryAppliedPlanRequest, QueryAppliedPlanResponseSDKType, QueryUpgradedConsensusStateRequest, QueryUpgradedConsensusStateResponseSDKType, QueryModuleVersionsRequest, QueryModuleVersionsResponseSDKType, QueryAuthorityRequest, QueryAuthorityResponseSDKType } from "./query"; export class LCDQueryClient { req: LCDClient; constructor({ @@ -12,6 +12,7 @@ export class LCDQueryClient { this.appliedPlan = this.appliedPlan.bind(this); this.upgradedConsensusState = this.upgradedConsensusState.bind(this); this.moduleVersions = this.moduleVersions.bind(this); + this.authority = this.authority.bind(this); } /* CurrentPlan queries the current upgrade plan. */ async currentPlan(_params: QueryCurrentPlanRequest = {}): Promise { @@ -46,4 +47,11 @@ export class LCDQueryClient { const endpoint = `cosmos/upgrade/v1beta1/module_versions`; return await this.req.get(endpoint, options); } + /* Returns the account with authority to conduct upgrades + + Since: cosmos-sdk 0.46 */ + async authority(_params: QueryAuthorityRequest = {}): Promise { + const endpoint = `cosmos/upgrade/v1beta1/authority`; + return await this.req.get(endpoint); + } } \ No newline at end of file diff --git a/packages/osmo-query/src/codegen/cosmos/upgrade/v1beta1/query.rpc.Query.ts b/packages/osmo-query/src/codegen/cosmos/upgrade/v1beta1/query.rpc.Query.ts index a9d038516..ba76c17a0 100644 --- a/packages/osmo-query/src/codegen/cosmos/upgrade/v1beta1/query.rpc.Query.ts +++ b/packages/osmo-query/src/codegen/cosmos/upgrade/v1beta1/query.rpc.Query.ts @@ -3,7 +3,7 @@ import { BinaryReader } from "../../../binary"; import { QueryClient, createProtobufRpcClient, ProtobufRpcClient } from "@cosmjs/stargate"; import { ReactQueryParams } from "../../../react-query"; import { useQuery } from "@tanstack/react-query"; -import { QueryCurrentPlanRequest, QueryCurrentPlanResponse, QueryAppliedPlanRequest, QueryAppliedPlanResponse, QueryUpgradedConsensusStateRequest, QueryUpgradedConsensusStateResponse, QueryModuleVersionsRequest, QueryModuleVersionsResponse } from "./query"; +import { QueryCurrentPlanRequest, QueryCurrentPlanResponse, QueryAppliedPlanRequest, QueryAppliedPlanResponse, QueryUpgradedConsensusStateRequest, QueryUpgradedConsensusStateResponse, QueryModuleVersionsRequest, QueryModuleVersionsResponse, QueryAuthorityRequest, QueryAuthorityResponse } from "./query"; /** Query defines the gRPC upgrade querier service. */ export interface Query { /** CurrentPlan queries the current upgrade plan. */ @@ -25,6 +25,12 @@ export interface Query { * Since: cosmos-sdk 0.43 */ moduleVersions(request: QueryModuleVersionsRequest): Promise; + /** + * Returns the account with authority to conduct upgrades + * + * Since: cosmos-sdk 0.46 + */ + authority(request?: QueryAuthorityRequest): Promise; } export class QueryClientImpl implements Query { private readonly rpc: Rpc; @@ -34,6 +40,7 @@ export class QueryClientImpl implements Query { this.appliedPlan = this.appliedPlan.bind(this); this.upgradedConsensusState = this.upgradedConsensusState.bind(this); this.moduleVersions = this.moduleVersions.bind(this); + this.authority = this.authority.bind(this); } currentPlan(request: QueryCurrentPlanRequest = {}): Promise { const data = QueryCurrentPlanRequest.encode(request).finish(); @@ -55,6 +62,11 @@ export class QueryClientImpl implements Query { const promise = this.rpc.request("cosmos.upgrade.v1beta1.Query", "ModuleVersions", data); return promise.then(data => QueryModuleVersionsResponse.decode(new BinaryReader(data))); } + authority(request: QueryAuthorityRequest = {}): Promise { + const data = QueryAuthorityRequest.encode(request).finish(); + const promise = this.rpc.request("cosmos.upgrade.v1beta1.Query", "Authority", data); + return promise.then(data => QueryAuthorityResponse.decode(new BinaryReader(data))); + } } export const createRpcQueryExtension = (base: QueryClient) => { const rpc = createProtobufRpcClient(base); @@ -71,6 +83,9 @@ export const createRpcQueryExtension = (base: QueryClient) => { }, moduleVersions(request: QueryModuleVersionsRequest): Promise { return queryService.moduleVersions(request); + }, + authority(request?: QueryAuthorityRequest): Promise { + return queryService.authority(request); } }; }; @@ -86,6 +101,9 @@ export interface UseUpgradedConsensusStateQuery extends ReactQueryParams< export interface UseModuleVersionsQuery extends ReactQueryParams { request: QueryModuleVersionsRequest; } +export interface UseAuthorityQuery extends ReactQueryParams { + request?: QueryAuthorityRequest; +} const _queryClients: WeakMap = new WeakMap(); const getQueryService = (rpc: ProtobufRpcClient | undefined): QueryClientImpl | undefined => { if (!rpc) return; @@ -134,6 +152,15 @@ export const createRpcQueryHooks = (rpc: ProtobufRpcClient | undefined) => { return queryService.moduleVersions(request); }, options); }; + const useAuthority = ({ + request, + options + }: UseAuthorityQuery) => { + return useQuery(["authorityQuery", request], () => { + if (!queryService) throw new Error("Query Service not initialized"); + return queryService.authority(request); + }, options); + }; return { /** CurrentPlan queries the current upgrade plan. */useCurrentPlan, /** AppliedPlan queries a previously applied upgrade plan by its name. */useAppliedPlan, @@ -151,6 +178,12 @@ export const createRpcQueryHooks = (rpc: ProtobufRpcClient | undefined) => { * * Since: cosmos-sdk 0.43 */ - useModuleVersions + useModuleVersions, + /** + * Returns the account with authority to conduct upgrades + * + * Since: cosmos-sdk 0.46 + */ + useAuthority }; }; \ No newline at end of file diff --git a/packages/osmo-query/src/codegen/cosmos/upgrade/v1beta1/query.ts b/packages/osmo-query/src/codegen/cosmos/upgrade/v1beta1/query.ts index ef453f174..ee043dca9 100644 --- a/packages/osmo-query/src/codegen/cosmos/upgrade/v1beta1/query.ts +++ b/packages/osmo-query/src/codegen/cosmos/upgrade/v1beta1/query.ts @@ -1,5 +1,6 @@ import { Plan, PlanAmino, PlanSDKType, ModuleVersion, ModuleVersionAmino, ModuleVersionSDKType } from "./upgrade"; import { BinaryReader, BinaryWriter } from "../../../binary"; +import { bytesFromBase64, base64FromBytes } from "../../../helpers"; /** * QueryCurrentPlanRequest is the request type for the Query/CurrentPlan RPC * method. @@ -29,7 +30,7 @@ export interface QueryCurrentPlanRequestSDKType {} */ export interface QueryCurrentPlanResponse { /** plan is the current upgrade plan. */ - plan: Plan; + plan?: Plan; } export interface QueryCurrentPlanResponseProtoMsg { typeUrl: "/cosmos.upgrade.v1beta1.QueryCurrentPlanResponse"; @@ -52,7 +53,7 @@ export interface QueryCurrentPlanResponseAminoMsg { * method. */ export interface QueryCurrentPlanResponseSDKType { - plan: PlanSDKType; + plan?: PlanSDKType; } /** * QueryCurrentPlanRequest is the request type for the Query/AppliedPlan RPC @@ -72,7 +73,7 @@ export interface QueryAppliedPlanRequestProtoMsg { */ export interface QueryAppliedPlanRequestAmino { /** name is the name of the applied plan to query for. */ - name: string; + name?: string; } export interface QueryAppliedPlanRequestAminoMsg { type: "cosmos-sdk/QueryAppliedPlanRequest"; @@ -103,7 +104,7 @@ export interface QueryAppliedPlanResponseProtoMsg { */ export interface QueryAppliedPlanResponseAmino { /** height is the block height at which the plan was applied. */ - height: string; + height?: string; } export interface QueryAppliedPlanResponseAminoMsg { type: "cosmos-sdk/QueryAppliedPlanResponse"; @@ -142,7 +143,7 @@ export interface QueryUpgradedConsensusStateRequestAmino { * last height of the current chain must be sent in request * as this is the height under which next consensus state is stored */ - last_height: string; + last_height?: string; } export interface QueryUpgradedConsensusStateRequestAminoMsg { type: "cosmos-sdk/QueryUpgradedConsensusStateRequest"; @@ -176,7 +177,7 @@ export interface QueryUpgradedConsensusStateResponseProtoMsg { /** @deprecated */ export interface QueryUpgradedConsensusStateResponseAmino { /** Since: cosmos-sdk 0.43 */ - upgraded_consensus_state: Uint8Array; + upgraded_consensus_state?: string; } export interface QueryUpgradedConsensusStateResponseAminoMsg { type: "cosmos-sdk/QueryUpgradedConsensusStateResponse"; @@ -220,7 +221,7 @@ export interface QueryModuleVersionsRequestAmino { * consensus version from state. Leaving this empty will * fetch the full list of module versions from state */ - module_name: string; + module_name?: string; } export interface QueryModuleVersionsRequestAminoMsg { type: "cosmos-sdk/QueryModuleVersionsRequest"; @@ -257,7 +258,7 @@ export interface QueryModuleVersionsResponseProtoMsg { */ export interface QueryModuleVersionsResponseAmino { /** module_versions is a list of module names with their consensus versions. */ - module_versions: ModuleVersionAmino[]; + module_versions?: ModuleVersionAmino[]; } export interface QueryModuleVersionsResponseAminoMsg { type: "cosmos-sdk/QueryModuleVersionsResponse"; @@ -272,6 +273,64 @@ export interface QueryModuleVersionsResponseAminoMsg { export interface QueryModuleVersionsResponseSDKType { module_versions: ModuleVersionSDKType[]; } +/** + * QueryAuthorityRequest is the request type for Query/Authority + * + * Since: cosmos-sdk 0.46 + */ +export interface QueryAuthorityRequest {} +export interface QueryAuthorityRequestProtoMsg { + typeUrl: "/cosmos.upgrade.v1beta1.QueryAuthorityRequest"; + value: Uint8Array; +} +/** + * QueryAuthorityRequest is the request type for Query/Authority + * + * Since: cosmos-sdk 0.46 + */ +export interface QueryAuthorityRequestAmino {} +export interface QueryAuthorityRequestAminoMsg { + type: "cosmos-sdk/QueryAuthorityRequest"; + value: QueryAuthorityRequestAmino; +} +/** + * QueryAuthorityRequest is the request type for Query/Authority + * + * Since: cosmos-sdk 0.46 + */ +export interface QueryAuthorityRequestSDKType {} +/** + * QueryAuthorityResponse is the response type for Query/Authority + * + * Since: cosmos-sdk 0.46 + */ +export interface QueryAuthorityResponse { + address: string; +} +export interface QueryAuthorityResponseProtoMsg { + typeUrl: "/cosmos.upgrade.v1beta1.QueryAuthorityResponse"; + value: Uint8Array; +} +/** + * QueryAuthorityResponse is the response type for Query/Authority + * + * Since: cosmos-sdk 0.46 + */ +export interface QueryAuthorityResponseAmino { + address?: string; +} +export interface QueryAuthorityResponseAminoMsg { + type: "cosmos-sdk/QueryAuthorityResponse"; + value: QueryAuthorityResponseAmino; +} +/** + * QueryAuthorityResponse is the response type for Query/Authority + * + * Since: cosmos-sdk 0.46 + */ +export interface QueryAuthorityResponseSDKType { + address: string; +} function createBaseQueryCurrentPlanRequest(): QueryCurrentPlanRequest { return {}; } @@ -299,7 +358,8 @@ export const QueryCurrentPlanRequest = { return message; }, fromAmino(_: QueryCurrentPlanRequestAmino): QueryCurrentPlanRequest { - return {}; + const message = createBaseQueryCurrentPlanRequest(); + return message; }, toAmino(_: QueryCurrentPlanRequest): QueryCurrentPlanRequestAmino { const obj: any = {}; @@ -329,7 +389,7 @@ export const QueryCurrentPlanRequest = { }; function createBaseQueryCurrentPlanResponse(): QueryCurrentPlanResponse { return { - plan: Plan.fromPartial({}) + plan: undefined }; } export const QueryCurrentPlanResponse = { @@ -363,9 +423,11 @@ export const QueryCurrentPlanResponse = { return message; }, fromAmino(object: QueryCurrentPlanResponseAmino): QueryCurrentPlanResponse { - return { - plan: object?.plan ? Plan.fromAmino(object.plan) : undefined - }; + const message = createBaseQueryCurrentPlanResponse(); + if (object.plan !== undefined && object.plan !== null) { + message.plan = Plan.fromAmino(object.plan); + } + return message; }, toAmino(message: QueryCurrentPlanResponse): QueryCurrentPlanResponseAmino { const obj: any = {}; @@ -430,9 +492,11 @@ export const QueryAppliedPlanRequest = { return message; }, fromAmino(object: QueryAppliedPlanRequestAmino): QueryAppliedPlanRequest { - return { - name: object.name - }; + const message = createBaseQueryAppliedPlanRequest(); + if (object.name !== undefined && object.name !== null) { + message.name = object.name; + } + return message; }, toAmino(message: QueryAppliedPlanRequest): QueryAppliedPlanRequestAmino { const obj: any = {}; @@ -497,9 +561,11 @@ export const QueryAppliedPlanResponse = { return message; }, fromAmino(object: QueryAppliedPlanResponseAmino): QueryAppliedPlanResponse { - return { - height: BigInt(object.height) - }; + const message = createBaseQueryAppliedPlanResponse(); + if (object.height !== undefined && object.height !== null) { + message.height = BigInt(object.height); + } + return message; }, toAmino(message: QueryAppliedPlanResponse): QueryAppliedPlanResponseAmino { const obj: any = {}; @@ -564,9 +630,11 @@ export const QueryUpgradedConsensusStateRequest = { return message; }, fromAmino(object: QueryUpgradedConsensusStateRequestAmino): QueryUpgradedConsensusStateRequest { - return { - lastHeight: BigInt(object.last_height) - }; + const message = createBaseQueryUpgradedConsensusStateRequest(); + if (object.last_height !== undefined && object.last_height !== null) { + message.lastHeight = BigInt(object.last_height); + } + return message; }, toAmino(message: QueryUpgradedConsensusStateRequest): QueryUpgradedConsensusStateRequestAmino { const obj: any = {}; @@ -631,13 +699,15 @@ export const QueryUpgradedConsensusStateResponse = { return message; }, fromAmino(object: QueryUpgradedConsensusStateResponseAmino): QueryUpgradedConsensusStateResponse { - return { - upgradedConsensusState: object.upgraded_consensus_state - }; + const message = createBaseQueryUpgradedConsensusStateResponse(); + if (object.upgraded_consensus_state !== undefined && object.upgraded_consensus_state !== null) { + message.upgradedConsensusState = bytesFromBase64(object.upgraded_consensus_state); + } + return message; }, toAmino(message: QueryUpgradedConsensusStateResponse): QueryUpgradedConsensusStateResponseAmino { const obj: any = {}; - obj.upgraded_consensus_state = message.upgradedConsensusState; + obj.upgraded_consensus_state = message.upgradedConsensusState ? base64FromBytes(message.upgradedConsensusState) : undefined; return obj; }, fromAminoMsg(object: QueryUpgradedConsensusStateResponseAminoMsg): QueryUpgradedConsensusStateResponse { @@ -698,9 +768,11 @@ export const QueryModuleVersionsRequest = { return message; }, fromAmino(object: QueryModuleVersionsRequestAmino): QueryModuleVersionsRequest { - return { - moduleName: object.module_name - }; + const message = createBaseQueryModuleVersionsRequest(); + if (object.module_name !== undefined && object.module_name !== null) { + message.moduleName = object.module_name; + } + return message; }, toAmino(message: QueryModuleVersionsRequest): QueryModuleVersionsRequestAmino { const obj: any = {}; @@ -765,9 +837,9 @@ export const QueryModuleVersionsResponse = { return message; }, fromAmino(object: QueryModuleVersionsResponseAmino): QueryModuleVersionsResponse { - return { - moduleVersions: Array.isArray(object?.module_versions) ? object.module_versions.map((e: any) => ModuleVersion.fromAmino(e)) : [] - }; + const message = createBaseQueryModuleVersionsResponse(); + message.moduleVersions = object.module_versions?.map(e => ModuleVersion.fromAmino(e)) || []; + return message; }, toAmino(message: QueryModuleVersionsResponse): QueryModuleVersionsResponseAmino { const obj: any = {}; @@ -799,4 +871,129 @@ export const QueryModuleVersionsResponse = { value: QueryModuleVersionsResponse.encode(message).finish() }; } +}; +function createBaseQueryAuthorityRequest(): QueryAuthorityRequest { + return {}; +} +export const QueryAuthorityRequest = { + typeUrl: "/cosmos.upgrade.v1beta1.QueryAuthorityRequest", + encode(_: QueryAuthorityRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryAuthorityRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryAuthorityRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): QueryAuthorityRequest { + const message = createBaseQueryAuthorityRequest(); + return message; + }, + fromAmino(_: QueryAuthorityRequestAmino): QueryAuthorityRequest { + const message = createBaseQueryAuthorityRequest(); + return message; + }, + toAmino(_: QueryAuthorityRequest): QueryAuthorityRequestAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: QueryAuthorityRequestAminoMsg): QueryAuthorityRequest { + return QueryAuthorityRequest.fromAmino(object.value); + }, + toAminoMsg(message: QueryAuthorityRequest): QueryAuthorityRequestAminoMsg { + return { + type: "cosmos-sdk/QueryAuthorityRequest", + value: QueryAuthorityRequest.toAmino(message) + }; + }, + fromProtoMsg(message: QueryAuthorityRequestProtoMsg): QueryAuthorityRequest { + return QueryAuthorityRequest.decode(message.value); + }, + toProto(message: QueryAuthorityRequest): Uint8Array { + return QueryAuthorityRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryAuthorityRequest): QueryAuthorityRequestProtoMsg { + return { + typeUrl: "/cosmos.upgrade.v1beta1.QueryAuthorityRequest", + value: QueryAuthorityRequest.encode(message).finish() + }; + } +}; +function createBaseQueryAuthorityResponse(): QueryAuthorityResponse { + return { + address: "" + }; +} +export const QueryAuthorityResponse = { + typeUrl: "/cosmos.upgrade.v1beta1.QueryAuthorityResponse", + encode(message: QueryAuthorityResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.address !== "") { + writer.uint32(10).string(message.address); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryAuthorityResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryAuthorityResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.address = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryAuthorityResponse { + const message = createBaseQueryAuthorityResponse(); + message.address = object.address ?? ""; + return message; + }, + fromAmino(object: QueryAuthorityResponseAmino): QueryAuthorityResponse { + const message = createBaseQueryAuthorityResponse(); + if (object.address !== undefined && object.address !== null) { + message.address = object.address; + } + return message; + }, + toAmino(message: QueryAuthorityResponse): QueryAuthorityResponseAmino { + const obj: any = {}; + obj.address = message.address; + return obj; + }, + fromAminoMsg(object: QueryAuthorityResponseAminoMsg): QueryAuthorityResponse { + return QueryAuthorityResponse.fromAmino(object.value); + }, + toAminoMsg(message: QueryAuthorityResponse): QueryAuthorityResponseAminoMsg { + return { + type: "cosmos-sdk/QueryAuthorityResponse", + value: QueryAuthorityResponse.toAmino(message) + }; + }, + fromProtoMsg(message: QueryAuthorityResponseProtoMsg): QueryAuthorityResponse { + return QueryAuthorityResponse.decode(message.value); + }, + toProto(message: QueryAuthorityResponse): Uint8Array { + return QueryAuthorityResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryAuthorityResponse): QueryAuthorityResponseProtoMsg { + return { + typeUrl: "/cosmos.upgrade.v1beta1.QueryAuthorityResponse", + value: QueryAuthorityResponse.encode(message).finish() + }; + } }; \ No newline at end of file diff --git a/packages/osmo-query/src/codegen/cosmos/upgrade/v1beta1/tx.amino.ts b/packages/osmo-query/src/codegen/cosmos/upgrade/v1beta1/tx.amino.ts new file mode 100644 index 000000000..59e87c086 --- /dev/null +++ b/packages/osmo-query/src/codegen/cosmos/upgrade/v1beta1/tx.amino.ts @@ -0,0 +1,14 @@ +//@ts-nocheck +import { MsgSoftwareUpgrade, MsgCancelUpgrade } from "./tx"; +export const AminoConverter = { + "/cosmos.upgrade.v1beta1.MsgSoftwareUpgrade": { + aminoType: "cosmos-sdk/MsgSoftwareUpgrade", + toAmino: MsgSoftwareUpgrade.toAmino, + fromAmino: MsgSoftwareUpgrade.fromAmino + }, + "/cosmos.upgrade.v1beta1.MsgCancelUpgrade": { + aminoType: "cosmos-sdk/MsgCancelUpgrade", + toAmino: MsgCancelUpgrade.toAmino, + fromAmino: MsgCancelUpgrade.fromAmino + } +}; \ No newline at end of file diff --git a/packages/osmo-query/src/codegen/cosmos/upgrade/v1beta1/tx.registry.ts b/packages/osmo-query/src/codegen/cosmos/upgrade/v1beta1/tx.registry.ts new file mode 100644 index 000000000..019dde52b --- /dev/null +++ b/packages/osmo-query/src/codegen/cosmos/upgrade/v1beta1/tx.registry.ts @@ -0,0 +1,53 @@ +//@ts-nocheck +import { GeneratedType, Registry } from "@cosmjs/proto-signing"; +import { MsgSoftwareUpgrade, MsgCancelUpgrade } from "./tx"; +export const registry: ReadonlyArray<[string, GeneratedType]> = [["/cosmos.upgrade.v1beta1.MsgSoftwareUpgrade", MsgSoftwareUpgrade], ["/cosmos.upgrade.v1beta1.MsgCancelUpgrade", MsgCancelUpgrade]]; +export const load = (protoRegistry: Registry) => { + registry.forEach(([typeUrl, mod]) => { + protoRegistry.register(typeUrl, mod); + }); +}; +export const MessageComposer = { + encoded: { + softwareUpgrade(value: MsgSoftwareUpgrade) { + return { + typeUrl: "/cosmos.upgrade.v1beta1.MsgSoftwareUpgrade", + value: MsgSoftwareUpgrade.encode(value).finish() + }; + }, + cancelUpgrade(value: MsgCancelUpgrade) { + return { + typeUrl: "/cosmos.upgrade.v1beta1.MsgCancelUpgrade", + value: MsgCancelUpgrade.encode(value).finish() + }; + } + }, + withTypeUrl: { + softwareUpgrade(value: MsgSoftwareUpgrade) { + return { + typeUrl: "/cosmos.upgrade.v1beta1.MsgSoftwareUpgrade", + value + }; + }, + cancelUpgrade(value: MsgCancelUpgrade) { + return { + typeUrl: "/cosmos.upgrade.v1beta1.MsgCancelUpgrade", + value + }; + } + }, + fromPartial: { + softwareUpgrade(value: MsgSoftwareUpgrade) { + return { + typeUrl: "/cosmos.upgrade.v1beta1.MsgSoftwareUpgrade", + value: MsgSoftwareUpgrade.fromPartial(value) + }; + }, + cancelUpgrade(value: MsgCancelUpgrade) { + return { + typeUrl: "/cosmos.upgrade.v1beta1.MsgCancelUpgrade", + value: MsgCancelUpgrade.fromPartial(value) + }; + } + } +}; \ No newline at end of file diff --git a/packages/osmo-query/src/codegen/cosmos/upgrade/v1beta1/tx.rpc.msg.ts b/packages/osmo-query/src/codegen/cosmos/upgrade/v1beta1/tx.rpc.msg.ts new file mode 100644 index 000000000..04f8d624b --- /dev/null +++ b/packages/osmo-query/src/codegen/cosmos/upgrade/v1beta1/tx.rpc.msg.ts @@ -0,0 +1,37 @@ +import { Rpc } from "../../../helpers"; +import { BinaryReader } from "../../../binary"; +import { MsgSoftwareUpgrade, MsgSoftwareUpgradeResponse, MsgCancelUpgrade, MsgCancelUpgradeResponse } from "./tx"; +/** Msg defines the upgrade Msg service. */ +export interface Msg { + /** + * SoftwareUpgrade is a governance operation for initiating a software upgrade. + * + * Since: cosmos-sdk 0.46 + */ + softwareUpgrade(request: MsgSoftwareUpgrade): Promise; + /** + * CancelUpgrade is a governance operation for cancelling a previously + * approved software upgrade. + * + * Since: cosmos-sdk 0.46 + */ + cancelUpgrade(request: MsgCancelUpgrade): Promise; +} +export class MsgClientImpl implements Msg { + private readonly rpc: Rpc; + constructor(rpc: Rpc) { + this.rpc = rpc; + this.softwareUpgrade = this.softwareUpgrade.bind(this); + this.cancelUpgrade = this.cancelUpgrade.bind(this); + } + softwareUpgrade(request: MsgSoftwareUpgrade): Promise { + const data = MsgSoftwareUpgrade.encode(request).finish(); + const promise = this.rpc.request("cosmos.upgrade.v1beta1.Msg", "SoftwareUpgrade", data); + return promise.then(data => MsgSoftwareUpgradeResponse.decode(new BinaryReader(data))); + } + cancelUpgrade(request: MsgCancelUpgrade): Promise { + const data = MsgCancelUpgrade.encode(request).finish(); + const promise = this.rpc.request("cosmos.upgrade.v1beta1.Msg", "CancelUpgrade", data); + return promise.then(data => MsgCancelUpgradeResponse.decode(new BinaryReader(data))); + } +} \ No newline at end of file diff --git a/packages/osmo-query/src/codegen/cosmos/upgrade/v1beta1/tx.ts b/packages/osmo-query/src/codegen/cosmos/upgrade/v1beta1/tx.ts new file mode 100644 index 000000000..59b54b90e --- /dev/null +++ b/packages/osmo-query/src/codegen/cosmos/upgrade/v1beta1/tx.ts @@ -0,0 +1,389 @@ +import { Plan, PlanAmino, PlanSDKType } from "./upgrade"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +/** + * MsgSoftwareUpgrade is the Msg/SoftwareUpgrade request type. + * + * Since: cosmos-sdk 0.46 + */ +export interface MsgSoftwareUpgrade { + /** authority is the address that controls the module (defaults to x/gov unless overwritten). */ + authority: string; + /** plan is the upgrade plan. */ + plan: Plan; +} +export interface MsgSoftwareUpgradeProtoMsg { + typeUrl: "/cosmos.upgrade.v1beta1.MsgSoftwareUpgrade"; + value: Uint8Array; +} +/** + * MsgSoftwareUpgrade is the Msg/SoftwareUpgrade request type. + * + * Since: cosmos-sdk 0.46 + */ +export interface MsgSoftwareUpgradeAmino { + /** authority is the address that controls the module (defaults to x/gov unless overwritten). */ + authority?: string; + /** plan is the upgrade plan. */ + plan: PlanAmino; +} +export interface MsgSoftwareUpgradeAminoMsg { + type: "cosmos-sdk/MsgSoftwareUpgrade"; + value: MsgSoftwareUpgradeAmino; +} +/** + * MsgSoftwareUpgrade is the Msg/SoftwareUpgrade request type. + * + * Since: cosmos-sdk 0.46 + */ +export interface MsgSoftwareUpgradeSDKType { + authority: string; + plan: PlanSDKType; +} +/** + * MsgSoftwareUpgradeResponse is the Msg/SoftwareUpgrade response type. + * + * Since: cosmos-sdk 0.46 + */ +export interface MsgSoftwareUpgradeResponse {} +export interface MsgSoftwareUpgradeResponseProtoMsg { + typeUrl: "/cosmos.upgrade.v1beta1.MsgSoftwareUpgradeResponse"; + value: Uint8Array; +} +/** + * MsgSoftwareUpgradeResponse is the Msg/SoftwareUpgrade response type. + * + * Since: cosmos-sdk 0.46 + */ +export interface MsgSoftwareUpgradeResponseAmino {} +export interface MsgSoftwareUpgradeResponseAminoMsg { + type: "cosmos-sdk/MsgSoftwareUpgradeResponse"; + value: MsgSoftwareUpgradeResponseAmino; +} +/** + * MsgSoftwareUpgradeResponse is the Msg/SoftwareUpgrade response type. + * + * Since: cosmos-sdk 0.46 + */ +export interface MsgSoftwareUpgradeResponseSDKType {} +/** + * MsgCancelUpgrade is the Msg/CancelUpgrade request type. + * + * Since: cosmos-sdk 0.46 + */ +export interface MsgCancelUpgrade { + /** authority is the address that controls the module (defaults to x/gov unless overwritten). */ + authority: string; +} +export interface MsgCancelUpgradeProtoMsg { + typeUrl: "/cosmos.upgrade.v1beta1.MsgCancelUpgrade"; + value: Uint8Array; +} +/** + * MsgCancelUpgrade is the Msg/CancelUpgrade request type. + * + * Since: cosmos-sdk 0.46 + */ +export interface MsgCancelUpgradeAmino { + /** authority is the address that controls the module (defaults to x/gov unless overwritten). */ + authority?: string; +} +export interface MsgCancelUpgradeAminoMsg { + type: "cosmos-sdk/MsgCancelUpgrade"; + value: MsgCancelUpgradeAmino; +} +/** + * MsgCancelUpgrade is the Msg/CancelUpgrade request type. + * + * Since: cosmos-sdk 0.46 + */ +export interface MsgCancelUpgradeSDKType { + authority: string; +} +/** + * MsgCancelUpgradeResponse is the Msg/CancelUpgrade response type. + * + * Since: cosmos-sdk 0.46 + */ +export interface MsgCancelUpgradeResponse {} +export interface MsgCancelUpgradeResponseProtoMsg { + typeUrl: "/cosmos.upgrade.v1beta1.MsgCancelUpgradeResponse"; + value: Uint8Array; +} +/** + * MsgCancelUpgradeResponse is the Msg/CancelUpgrade response type. + * + * Since: cosmos-sdk 0.46 + */ +export interface MsgCancelUpgradeResponseAmino {} +export interface MsgCancelUpgradeResponseAminoMsg { + type: "cosmos-sdk/MsgCancelUpgradeResponse"; + value: MsgCancelUpgradeResponseAmino; +} +/** + * MsgCancelUpgradeResponse is the Msg/CancelUpgrade response type. + * + * Since: cosmos-sdk 0.46 + */ +export interface MsgCancelUpgradeResponseSDKType {} +function createBaseMsgSoftwareUpgrade(): MsgSoftwareUpgrade { + return { + authority: "", + plan: Plan.fromPartial({}) + }; +} +export const MsgSoftwareUpgrade = { + typeUrl: "/cosmos.upgrade.v1beta1.MsgSoftwareUpgrade", + encode(message: MsgSoftwareUpgrade, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.authority !== "") { + writer.uint32(10).string(message.authority); + } + if (message.plan !== undefined) { + Plan.encode(message.plan, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgSoftwareUpgrade { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgSoftwareUpgrade(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.authority = reader.string(); + break; + case 2: + message.plan = Plan.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgSoftwareUpgrade { + const message = createBaseMsgSoftwareUpgrade(); + message.authority = object.authority ?? ""; + message.plan = object.plan !== undefined && object.plan !== null ? Plan.fromPartial(object.plan) : undefined; + return message; + }, + fromAmino(object: MsgSoftwareUpgradeAmino): MsgSoftwareUpgrade { + const message = createBaseMsgSoftwareUpgrade(); + if (object.authority !== undefined && object.authority !== null) { + message.authority = object.authority; + } + if (object.plan !== undefined && object.plan !== null) { + message.plan = Plan.fromAmino(object.plan); + } + return message; + }, + toAmino(message: MsgSoftwareUpgrade): MsgSoftwareUpgradeAmino { + const obj: any = {}; + obj.authority = message.authority; + obj.plan = message.plan ? Plan.toAmino(message.plan) : Plan.fromPartial({}); + return obj; + }, + fromAminoMsg(object: MsgSoftwareUpgradeAminoMsg): MsgSoftwareUpgrade { + return MsgSoftwareUpgrade.fromAmino(object.value); + }, + toAminoMsg(message: MsgSoftwareUpgrade): MsgSoftwareUpgradeAminoMsg { + return { + type: "cosmos-sdk/MsgSoftwareUpgrade", + value: MsgSoftwareUpgrade.toAmino(message) + }; + }, + fromProtoMsg(message: MsgSoftwareUpgradeProtoMsg): MsgSoftwareUpgrade { + return MsgSoftwareUpgrade.decode(message.value); + }, + toProto(message: MsgSoftwareUpgrade): Uint8Array { + return MsgSoftwareUpgrade.encode(message).finish(); + }, + toProtoMsg(message: MsgSoftwareUpgrade): MsgSoftwareUpgradeProtoMsg { + return { + typeUrl: "/cosmos.upgrade.v1beta1.MsgSoftwareUpgrade", + value: MsgSoftwareUpgrade.encode(message).finish() + }; + } +}; +function createBaseMsgSoftwareUpgradeResponse(): MsgSoftwareUpgradeResponse { + return {}; +} +export const MsgSoftwareUpgradeResponse = { + typeUrl: "/cosmos.upgrade.v1beta1.MsgSoftwareUpgradeResponse", + encode(_: MsgSoftwareUpgradeResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgSoftwareUpgradeResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgSoftwareUpgradeResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): MsgSoftwareUpgradeResponse { + const message = createBaseMsgSoftwareUpgradeResponse(); + return message; + }, + fromAmino(_: MsgSoftwareUpgradeResponseAmino): MsgSoftwareUpgradeResponse { + const message = createBaseMsgSoftwareUpgradeResponse(); + return message; + }, + toAmino(_: MsgSoftwareUpgradeResponse): MsgSoftwareUpgradeResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgSoftwareUpgradeResponseAminoMsg): MsgSoftwareUpgradeResponse { + return MsgSoftwareUpgradeResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgSoftwareUpgradeResponse): MsgSoftwareUpgradeResponseAminoMsg { + return { + type: "cosmos-sdk/MsgSoftwareUpgradeResponse", + value: MsgSoftwareUpgradeResponse.toAmino(message) + }; + }, + fromProtoMsg(message: MsgSoftwareUpgradeResponseProtoMsg): MsgSoftwareUpgradeResponse { + return MsgSoftwareUpgradeResponse.decode(message.value); + }, + toProto(message: MsgSoftwareUpgradeResponse): Uint8Array { + return MsgSoftwareUpgradeResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgSoftwareUpgradeResponse): MsgSoftwareUpgradeResponseProtoMsg { + return { + typeUrl: "/cosmos.upgrade.v1beta1.MsgSoftwareUpgradeResponse", + value: MsgSoftwareUpgradeResponse.encode(message).finish() + }; + } +}; +function createBaseMsgCancelUpgrade(): MsgCancelUpgrade { + return { + authority: "" + }; +} +export const MsgCancelUpgrade = { + typeUrl: "/cosmos.upgrade.v1beta1.MsgCancelUpgrade", + encode(message: MsgCancelUpgrade, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.authority !== "") { + writer.uint32(10).string(message.authority); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgCancelUpgrade { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgCancelUpgrade(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.authority = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgCancelUpgrade { + const message = createBaseMsgCancelUpgrade(); + message.authority = object.authority ?? ""; + return message; + }, + fromAmino(object: MsgCancelUpgradeAmino): MsgCancelUpgrade { + const message = createBaseMsgCancelUpgrade(); + if (object.authority !== undefined && object.authority !== null) { + message.authority = object.authority; + } + return message; + }, + toAmino(message: MsgCancelUpgrade): MsgCancelUpgradeAmino { + const obj: any = {}; + obj.authority = message.authority; + return obj; + }, + fromAminoMsg(object: MsgCancelUpgradeAminoMsg): MsgCancelUpgrade { + return MsgCancelUpgrade.fromAmino(object.value); + }, + toAminoMsg(message: MsgCancelUpgrade): MsgCancelUpgradeAminoMsg { + return { + type: "cosmos-sdk/MsgCancelUpgrade", + value: MsgCancelUpgrade.toAmino(message) + }; + }, + fromProtoMsg(message: MsgCancelUpgradeProtoMsg): MsgCancelUpgrade { + return MsgCancelUpgrade.decode(message.value); + }, + toProto(message: MsgCancelUpgrade): Uint8Array { + return MsgCancelUpgrade.encode(message).finish(); + }, + toProtoMsg(message: MsgCancelUpgrade): MsgCancelUpgradeProtoMsg { + return { + typeUrl: "/cosmos.upgrade.v1beta1.MsgCancelUpgrade", + value: MsgCancelUpgrade.encode(message).finish() + }; + } +}; +function createBaseMsgCancelUpgradeResponse(): MsgCancelUpgradeResponse { + return {}; +} +export const MsgCancelUpgradeResponse = { + typeUrl: "/cosmos.upgrade.v1beta1.MsgCancelUpgradeResponse", + encode(_: MsgCancelUpgradeResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgCancelUpgradeResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgCancelUpgradeResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): MsgCancelUpgradeResponse { + const message = createBaseMsgCancelUpgradeResponse(); + return message; + }, + fromAmino(_: MsgCancelUpgradeResponseAmino): MsgCancelUpgradeResponse { + const message = createBaseMsgCancelUpgradeResponse(); + return message; + }, + toAmino(_: MsgCancelUpgradeResponse): MsgCancelUpgradeResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgCancelUpgradeResponseAminoMsg): MsgCancelUpgradeResponse { + return MsgCancelUpgradeResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgCancelUpgradeResponse): MsgCancelUpgradeResponseAminoMsg { + return { + type: "cosmos-sdk/MsgCancelUpgradeResponse", + value: MsgCancelUpgradeResponse.toAmino(message) + }; + }, + fromProtoMsg(message: MsgCancelUpgradeResponseProtoMsg): MsgCancelUpgradeResponse { + return MsgCancelUpgradeResponse.decode(message.value); + }, + toProto(message: MsgCancelUpgradeResponse): Uint8Array { + return MsgCancelUpgradeResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgCancelUpgradeResponse): MsgCancelUpgradeResponseProtoMsg { + return { + typeUrl: "/cosmos.upgrade.v1beta1.MsgCancelUpgradeResponse", + value: MsgCancelUpgradeResponse.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/packages/osmo-query/src/codegen/cosmos/upgrade/v1beta1/upgrade.ts b/packages/osmo-query/src/codegen/cosmos/upgrade/v1beta1/upgrade.ts index 0b344875a..f652fc363 100644 --- a/packages/osmo-query/src/codegen/cosmos/upgrade/v1beta1/upgrade.ts +++ b/packages/osmo-query/src/codegen/cosmos/upgrade/v1beta1/upgrade.ts @@ -21,10 +21,7 @@ export interface Plan { */ /** @deprecated */ time: Date; - /** - * The height at which the upgrade must be performed. - * Only used if Time is not set. - */ + /** The height at which the upgrade must be performed. */ height: bigint; /** * Any application specific upgrade info to be included on-chain @@ -37,7 +34,7 @@ export interface Plan { * If this field is not empty, an error will be thrown. */ /** @deprecated */ - upgradedClientState: Any; + upgradedClientState?: Any; } export interface PlanProtoMsg { typeUrl: "/cosmos.upgrade.v1beta1.Plan"; @@ -54,24 +51,21 @@ export interface PlanAmino { * 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. * If this field is not empty, an error will be thrown. */ /** @deprecated */ - time?: Date; - /** - * The height at which the upgrade must be performed. - * Only used if Time is not set. - */ - height: string; + time: string; + /** The height at which the upgrade must be performed. */ + height?: string; /** * 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. @@ -92,15 +86,22 @@ export interface PlanSDKType { height: bigint; info: string; /** @deprecated */ - upgraded_client_state: AnySDKType; + upgraded_client_state?: AnySDKType; } /** * SoftwareUpgradeProposal is a gov Content type for initiating a software * upgrade. + * Deprecated: This legacy proposal is deprecated in favor of Msg-based gov + * proposals, see MsgSoftwareUpgrade. */ +/** @deprecated */ export interface SoftwareUpgradeProposal { + $typeUrl?: "/cosmos.upgrade.v1beta1.SoftwareUpgradeProposal"; + /** title of the proposal */ title: string; + /** description of the proposal */ description: string; + /** plan of the proposal */ plan: Plan; } export interface SoftwareUpgradeProposalProtoMsg { @@ -110,11 +111,17 @@ export interface SoftwareUpgradeProposalProtoMsg { /** * SoftwareUpgradeProposal is a gov Content type for initiating a software * upgrade. + * Deprecated: This legacy proposal is deprecated in favor of Msg-based gov + * proposals, see MsgSoftwareUpgrade. */ +/** @deprecated */ export interface SoftwareUpgradeProposalAmino { - title: string; - description: string; - plan?: PlanAmino; + /** title of the proposal */ + title?: string; + /** description of the proposal */ + description?: string; + /** plan of the proposal */ + plan: PlanAmino; } export interface SoftwareUpgradeProposalAminoMsg { type: "cosmos-sdk/SoftwareUpgradeProposal"; @@ -123,8 +130,12 @@ export interface SoftwareUpgradeProposalAminoMsg { /** * SoftwareUpgradeProposal is a gov Content type for initiating a software * upgrade. + * Deprecated: This legacy proposal is deprecated in favor of Msg-based gov + * proposals, see MsgSoftwareUpgrade. */ +/** @deprecated */ export interface SoftwareUpgradeProposalSDKType { + $typeUrl?: "/cosmos.upgrade.v1beta1.SoftwareUpgradeProposal"; title: string; description: string; plan: PlanSDKType; @@ -132,9 +143,15 @@ export interface SoftwareUpgradeProposalSDKType { /** * CancelSoftwareUpgradeProposal is a gov Content type for cancelling a software * upgrade. + * Deprecated: This legacy proposal is deprecated in favor of Msg-based gov + * proposals, see MsgCancelUpgrade. */ +/** @deprecated */ export interface CancelSoftwareUpgradeProposal { + $typeUrl?: "/cosmos.upgrade.v1beta1.CancelSoftwareUpgradeProposal"; + /** title of the proposal */ title: string; + /** description of the proposal */ description: string; } export interface CancelSoftwareUpgradeProposalProtoMsg { @@ -144,10 +161,15 @@ export interface CancelSoftwareUpgradeProposalProtoMsg { /** * CancelSoftwareUpgradeProposal is a gov Content type for cancelling a software * upgrade. + * Deprecated: This legacy proposal is deprecated in favor of Msg-based gov + * proposals, see MsgCancelUpgrade. */ +/** @deprecated */ export interface CancelSoftwareUpgradeProposalAmino { - title: string; - description: string; + /** title of the proposal */ + title?: string; + /** description of the proposal */ + description?: string; } export interface CancelSoftwareUpgradeProposalAminoMsg { type: "cosmos-sdk/CancelSoftwareUpgradeProposal"; @@ -156,8 +178,12 @@ export interface CancelSoftwareUpgradeProposalAminoMsg { /** * CancelSoftwareUpgradeProposal is a gov Content type for cancelling a software * upgrade. + * Deprecated: This legacy proposal is deprecated in favor of Msg-based gov + * proposals, see MsgCancelUpgrade. */ +/** @deprecated */ export interface CancelSoftwareUpgradeProposalSDKType { + $typeUrl?: "/cosmos.upgrade.v1beta1.CancelSoftwareUpgradeProposal"; title: string; description: string; } @@ -183,9 +209,9 @@ export interface ModuleVersionProtoMsg { */ export interface ModuleVersionAmino { /** name of the app module */ - name: string; + name?: string; /** consensus version of the app module */ - version: string; + version?: string; } export interface ModuleVersionAminoMsg { type: "cosmos-sdk/ModuleVersion"; @@ -206,7 +232,7 @@ function createBasePlan(): Plan { time: new Date(), height: BigInt(0), info: "", - upgradedClientState: Any.fromPartial({}) + upgradedClientState: undefined }; } export const Plan = { @@ -268,18 +294,28 @@ export const Plan = { return message; }, fromAmino(object: PlanAmino): Plan { - return { - name: object.name, - time: object.time, - height: BigInt(object.height), - info: object.info, - upgradedClientState: object?.upgraded_client_state ? Any.fromAmino(object.upgraded_client_state) : undefined - }; + const message = createBasePlan(); + if (object.name !== undefined && object.name !== null) { + message.name = object.name; + } + if (object.time !== undefined && object.time !== null) { + message.time = fromTimestamp(Timestamp.fromAmino(object.time)); + } + if (object.height !== undefined && object.height !== null) { + message.height = BigInt(object.height); + } + if (object.info !== undefined && object.info !== null) { + message.info = object.info; + } + if (object.upgraded_client_state !== undefined && object.upgraded_client_state !== null) { + message.upgradedClientState = Any.fromAmino(object.upgraded_client_state); + } + return message; }, toAmino(message: Plan): PlanAmino { const obj: any = {}; obj.name = message.name; - obj.time = message.time; + obj.time = message.time ? Timestamp.toAmino(toTimestamp(message.time)) : new Date(); obj.height = message.height ? message.height.toString() : undefined; obj.info = message.info; obj.upgraded_client_state = message.upgradedClientState ? Any.toAmino(message.upgradedClientState) : undefined; @@ -309,6 +345,7 @@ export const Plan = { }; function createBaseSoftwareUpgradeProposal(): SoftwareUpgradeProposal { return { + $typeUrl: "/cosmos.upgrade.v1beta1.SoftwareUpgradeProposal", title: "", description: "", plan: Plan.fromPartial({}) @@ -359,17 +396,23 @@ export const SoftwareUpgradeProposal = { return message; }, fromAmino(object: SoftwareUpgradeProposalAmino): SoftwareUpgradeProposal { - return { - title: object.title, - description: object.description, - plan: object?.plan ? Plan.fromAmino(object.plan) : undefined - }; + const message = createBaseSoftwareUpgradeProposal(); + if (object.title !== undefined && object.title !== null) { + message.title = object.title; + } + if (object.description !== undefined && object.description !== null) { + message.description = object.description; + } + if (object.plan !== undefined && object.plan !== null) { + message.plan = Plan.fromAmino(object.plan); + } + return message; }, toAmino(message: SoftwareUpgradeProposal): SoftwareUpgradeProposalAmino { const obj: any = {}; obj.title = message.title; obj.description = message.description; - obj.plan = message.plan ? Plan.toAmino(message.plan) : undefined; + obj.plan = message.plan ? Plan.toAmino(message.plan) : Plan.fromPartial({}); return obj; }, fromAminoMsg(object: SoftwareUpgradeProposalAminoMsg): SoftwareUpgradeProposal { @@ -396,6 +439,7 @@ export const SoftwareUpgradeProposal = { }; function createBaseCancelSoftwareUpgradeProposal(): CancelSoftwareUpgradeProposal { return { + $typeUrl: "/cosmos.upgrade.v1beta1.CancelSoftwareUpgradeProposal", title: "", description: "" }; @@ -438,10 +482,14 @@ export const CancelSoftwareUpgradeProposal = { return message; }, fromAmino(object: CancelSoftwareUpgradeProposalAmino): CancelSoftwareUpgradeProposal { - return { - title: object.title, - description: object.description - }; + const message = createBaseCancelSoftwareUpgradeProposal(); + if (object.title !== undefined && object.title !== null) { + message.title = object.title; + } + if (object.description !== undefined && object.description !== null) { + message.description = object.description; + } + return message; }, toAmino(message: CancelSoftwareUpgradeProposal): CancelSoftwareUpgradeProposalAmino { const obj: any = {}; @@ -515,10 +563,14 @@ export const ModuleVersion = { return message; }, fromAmino(object: ModuleVersionAmino): ModuleVersion { - return { - name: object.name, - version: BigInt(object.version) - }; + const message = createBaseModuleVersion(); + if (object.name !== undefined && object.name !== null) { + message.name = object.name; + } + if (object.version !== undefined && object.version !== null) { + message.version = BigInt(object.version); + } + return message; }, toAmino(message: ModuleVersion): ModuleVersionAmino { const obj: any = {}; diff --git a/packages/osmo-query/src/codegen/cosmos_proto/bundle.ts b/packages/osmo-query/src/codegen/cosmos_proto/bundle.ts index b1006fb9c..3b2697f91 100644 --- a/packages/osmo-query/src/codegen/cosmos_proto/bundle.ts +++ b/packages/osmo-query/src/codegen/cosmos_proto/bundle.ts @@ -1,4 +1,4 @@ -import * as _172 from "./cosmos"; +import * as _228 from "./cosmos"; export const cosmos_proto = { - ..._172 + ..._228 }; \ No newline at end of file diff --git a/packages/osmo-query/src/codegen/cosmos_proto/cosmos.ts b/packages/osmo-query/src/codegen/cosmos_proto/cosmos.ts index 52b443e99..7d20287a5 100644 --- a/packages/osmo-query/src/codegen/cosmos_proto/cosmos.ts +++ b/packages/osmo-query/src/codegen/cosmos_proto/cosmos.ts @@ -70,12 +70,12 @@ export interface InterfaceDescriptorAmino { * package.name, ex. for the package a.b and interface named C, the * fully-qualified name will be a.b.C. */ - name: string; + name?: string; /** * description is a human-readable description of the interface and its * purpose. */ - description: string; + description?: string; } export interface InterfaceDescriptorAminoMsg { type: "/cosmos_proto.InterfaceDescriptor"; @@ -140,20 +140,20 @@ export interface ScalarDescriptorAmino { * package.name, ex. for the package a.b and scalar named C, the * fully-qualified name will be a.b.C. */ - name: string; + name?: string; /** * description is a human-readable description of the scalar and its * encoding format. For instance a big integer or decimal scalar should * specify precisely the expected encoding format. */ - description: string; + description?: string; /** * field_type is the type of field with which this scalar can be used. * Scalars can be used with one and only one type of field so that * encoding standards and simple and clear. Currently only string and * bytes fields are supported for scalars. */ - field_type: ScalarType[]; + field_type?: ScalarType[]; } export interface ScalarDescriptorAminoMsg { type: "/cosmos_proto.ScalarDescriptor"; @@ -217,10 +217,14 @@ export const InterfaceDescriptor = { return message; }, fromAmino(object: InterfaceDescriptorAmino): InterfaceDescriptor { - return { - name: object.name, - description: object.description - }; + const message = createBaseInterfaceDescriptor(); + if (object.name !== undefined && object.name !== null) { + message.name = object.name; + } + if (object.description !== undefined && object.description !== null) { + message.description = object.description; + } + return message; }, toAmino(message: InterfaceDescriptor): InterfaceDescriptorAmino { const obj: any = {}; @@ -305,11 +309,15 @@ export const ScalarDescriptor = { return message; }, fromAmino(object: ScalarDescriptorAmino): ScalarDescriptor { - return { - name: object.name, - description: object.description, - fieldType: Array.isArray(object?.field_type) ? object.field_type.map((e: any) => scalarTypeFromJSON(e)) : [] - }; + const message = createBaseScalarDescriptor(); + if (object.name !== undefined && object.name !== null) { + message.name = object.name; + } + if (object.description !== undefined && object.description !== null) { + message.description = object.description; + } + message.fieldType = object.field_type?.map(e => scalarTypeFromJSON(e)) || []; + return message; }, toAmino(message: ScalarDescriptor): ScalarDescriptorAmino { const obj: any = {}; diff --git a/packages/osmo-query/src/codegen/cosmwasm/bundle.ts b/packages/osmo-query/src/codegen/cosmwasm/bundle.ts index ce8e13222..4c60cdfa2 100644 --- a/packages/osmo-query/src/codegen/cosmwasm/bundle.ts +++ b/packages/osmo-query/src/codegen/cosmwasm/bundle.ts @@ -1,38 +1,38 @@ -import * as _82 from "./wasm/v1/authz"; -import * as _83 from "./wasm/v1/genesis"; -import * as _84 from "./wasm/v1/ibc"; -import * as _85 from "./wasm/v1/proposal"; -import * as _86 from "./wasm/v1/query"; -import * as _87 from "./wasm/v1/tx"; -import * as _88 from "./wasm/v1/types"; -import * as _255 from "./wasm/v1/tx.amino"; -import * as _256 from "./wasm/v1/tx.registry"; -import * as _257 from "./wasm/v1/query.lcd"; -import * as _258 from "./wasm/v1/query.rpc.Query"; -import * as _259 from "./wasm/v1/tx.rpc.msg"; -import * as _338 from "./lcd"; -import * as _339 from "./rpc.query"; -import * as _340 from "./rpc.tx"; +import * as _130 from "./wasm/v1/authz"; +import * as _131 from "./wasm/v1/genesis"; +import * as _132 from "./wasm/v1/ibc"; +import * as _133 from "./wasm/v1/proposal_legacy"; +import * as _134 from "./wasm/v1/query"; +import * as _135 from "./wasm/v1/tx"; +import * as _136 from "./wasm/v1/types"; +import * as _320 from "./wasm/v1/tx.amino"; +import * as _321 from "./wasm/v1/tx.registry"; +import * as _322 from "./wasm/v1/query.lcd"; +import * as _323 from "./wasm/v1/query.rpc.Query"; +import * as _324 from "./wasm/v1/tx.rpc.msg"; +import * as _408 from "./lcd"; +import * as _409 from "./rpc.query"; +import * as _410 from "./rpc.tx"; export namespace cosmwasm { export namespace wasm { export const v1 = { - ..._82, - ..._83, - ..._84, - ..._85, - ..._86, - ..._87, - ..._88, - ..._255, - ..._256, - ..._257, - ..._258, - ..._259 + ..._130, + ..._131, + ..._132, + ..._133, + ..._134, + ..._135, + ..._136, + ..._320, + ..._321, + ..._322, + ..._323, + ..._324 }; } export const ClientFactory = { - ..._338, - ..._339, - ..._340 + ..._408, + ..._409, + ..._410 }; } \ No newline at end of file diff --git a/packages/osmo-query/src/codegen/cosmwasm/lcd.ts b/packages/osmo-query/src/codegen/cosmwasm/lcd.ts index 9903c8950..75c189320 100644 --- a/packages/osmo-query/src/codegen/cosmwasm/lcd.ts +++ b/packages/osmo-query/src/codegen/cosmwasm/lcd.ts @@ -31,6 +31,11 @@ export const createLCDClient = async ({ }) } }, + consensus: { + v1: new (await import("../cosmos/consensus/v1/query.lcd")).LCDQueryClient({ + requestClient + }) + }, distribution: { v1beta1: new (await import("../cosmos/distribution/v1beta1/query.lcd")).LCDQueryClient({ requestClient diff --git a/packages/osmo-query/src/codegen/cosmwasm/rpc.query.ts b/packages/osmo-query/src/codegen/cosmwasm/rpc.query.ts index d4d5bbabc..fbb1b94b4 100644 --- a/packages/osmo-query/src/codegen/cosmwasm/rpc.query.ts +++ b/packages/osmo-query/src/codegen/cosmwasm/rpc.query.ts @@ -1,11 +1,11 @@ -import { HttpEndpoint, connectComet } from "@cosmjs/tendermint-rpc"; +import { Tendermint34Client, HttpEndpoint } from "@cosmjs/tendermint-rpc"; import { QueryClient } from "@cosmjs/stargate"; export const createRPCQueryClient = async ({ rpcEndpoint }: { rpcEndpoint: string | HttpEndpoint; }) => { - const tmClient = await connectComet(rpcEndpoint); + const tmClient = await Tendermint34Client.connect(rpcEndpoint); const client = new QueryClient(tmClient); return { cosmos: { @@ -23,12 +23,20 @@ export const createRPCQueryClient = async ({ v1beta1: (await import("../cosmos/base/node/v1beta1/query.rpc.Service")).createRpcQueryExtension(client) } }, + consensus: { + v1: (await import("../cosmos/consensus/v1/query.rpc.Query")).createRpcQueryExtension(client) + }, distribution: { v1beta1: (await import("../cosmos/distribution/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) }, gov: { v1beta1: (await import("../cosmos/gov/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) }, + orm: { + query: { + v1alpha1: (await import("../cosmos/orm/query/v1alpha1/query.rpc.Query")).createRpcQueryExtension(client) + } + }, staking: { v1beta1: (await import("../cosmos/staking/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) }, diff --git a/packages/osmo-query/src/codegen/cosmwasm/rpc.tx.ts b/packages/osmo-query/src/codegen/cosmwasm/rpc.tx.ts index 7e0c81782..7c8765105 100644 --- a/packages/osmo-query/src/codegen/cosmwasm/rpc.tx.ts +++ b/packages/osmo-query/src/codegen/cosmwasm/rpc.tx.ts @@ -5,12 +5,18 @@ export const createRPCMsgClient = async ({ rpc: Rpc; }) => ({ cosmos: { + auth: { + v1beta1: new (await import("../cosmos/auth/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) + }, authz: { v1beta1: new (await import("../cosmos/authz/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) }, bank: { v1beta1: new (await import("../cosmos/bank/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) }, + consensus: { + v1: new (await import("../cosmos/consensus/v1/tx.rpc.msg")).MsgClientImpl(rpc) + }, distribution: { v1beta1: new (await import("../cosmos/distribution/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) }, @@ -19,6 +25,9 @@ export const createRPCMsgClient = async ({ }, staking: { v1beta1: new (await import("../cosmos/staking/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) + }, + upgrade: { + v1beta1: new (await import("../cosmos/upgrade/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) } }, cosmwasm: { diff --git a/packages/osmo-query/src/codegen/cosmwasm/wasm/v1/authz.ts b/packages/osmo-query/src/codegen/cosmwasm/wasm/v1/authz.ts index 353cfae73..377ed995e 100644 --- a/packages/osmo-query/src/codegen/cosmwasm/wasm/v1/authz.ts +++ b/packages/osmo-query/src/codegen/cosmwasm/wasm/v1/authz.ts @@ -1,12 +1,48 @@ +import { AccessConfig, AccessConfigAmino, AccessConfigSDKType } from "./types"; import { Any, AnyProtoMsg, AnyAmino, AnySDKType } from "../../../google/protobuf/any"; import { Coin, CoinAmino, CoinSDKType } from "../../../cosmos/base/v1beta1/coin"; import { BinaryReader, BinaryWriter } from "../../../binary"; +import { bytesFromBase64, base64FromBytes } from "../../../helpers"; +import { toUtf8, fromUtf8 } from "@cosmjs/encoding"; +/** + * StoreCodeAuthorization defines authorization for wasm code upload. + * Since: wasmd 0.42 + */ +export interface StoreCodeAuthorization { + $typeUrl?: "/cosmwasm.wasm.v1.StoreCodeAuthorization"; + /** Grants for code upload */ + grants: CodeGrant[]; +} +export interface StoreCodeAuthorizationProtoMsg { + typeUrl: "/cosmwasm.wasm.v1.StoreCodeAuthorization"; + value: Uint8Array; +} +/** + * StoreCodeAuthorization defines authorization for wasm code upload. + * Since: wasmd 0.42 + */ +export interface StoreCodeAuthorizationAmino { + /** Grants for code upload */ + grants: CodeGrantAmino[]; +} +export interface StoreCodeAuthorizationAminoMsg { + type: "wasm/StoreCodeAuthorization"; + value: StoreCodeAuthorizationAmino; +} +/** + * StoreCodeAuthorization defines authorization for wasm code upload. + * Since: wasmd 0.42 + */ +export interface StoreCodeAuthorizationSDKType { + $typeUrl?: "/cosmwasm.wasm.v1.StoreCodeAuthorization"; + grants: CodeGrantSDKType[]; +} /** * ContractExecutionAuthorization defines authorization for wasm execute. * Since: wasmd 0.30 */ export interface ContractExecutionAuthorization { - $typeUrl?: string; + $typeUrl?: "/cosmwasm.wasm.v1.ContractExecutionAuthorization"; /** Grants for contract executions */ grants: ContractGrant[]; } @@ -31,7 +67,7 @@ export interface ContractExecutionAuthorizationAminoMsg { * Since: wasmd 0.30 */ export interface ContractExecutionAuthorizationSDKType { - $typeUrl?: string; + $typeUrl?: "/cosmwasm.wasm.v1.ContractExecutionAuthorization"; grants: ContractGrantSDKType[]; } /** @@ -39,7 +75,7 @@ export interface ContractExecutionAuthorizationSDKType { * migration. Since: wasmd 0.30 */ export interface ContractMigrationAuthorization { - $typeUrl?: string; + $typeUrl?: "/cosmwasm.wasm.v1.ContractMigrationAuthorization"; /** Grants for contract migrations */ grants: ContractGrant[]; } @@ -64,9 +100,50 @@ export interface ContractMigrationAuthorizationAminoMsg { * migration. Since: wasmd 0.30 */ export interface ContractMigrationAuthorizationSDKType { - $typeUrl?: string; + $typeUrl?: "/cosmwasm.wasm.v1.ContractMigrationAuthorization"; grants: ContractGrantSDKType[]; } +/** CodeGrant a granted permission for a single code */ +export interface CodeGrant { + /** + * CodeHash is the unique identifier created by wasmvm + * Wildcard "*" is used to specify any kind of grant. + */ + codeHash: Uint8Array; + /** + * InstantiatePermission is the superset access control to apply + * on contract creation. + * Optional + */ + instantiatePermission?: AccessConfig; +} +export interface CodeGrantProtoMsg { + typeUrl: "/cosmwasm.wasm.v1.CodeGrant"; + value: Uint8Array; +} +/** CodeGrant a granted permission for a single code */ +export interface CodeGrantAmino { + /** + * CodeHash is the unique identifier created by wasmvm + * Wildcard "*" is used to specify any kind of grant. + */ + code_hash?: string; + /** + * InstantiatePermission is the superset access control to apply + * on contract creation. + * Optional + */ + instantiate_permission?: AccessConfigAmino; +} +export interface CodeGrantAminoMsg { + type: "wasm/CodeGrant"; + value: CodeGrantAmino; +} +/** CodeGrant a granted permission for a single code */ +export interface CodeGrantSDKType { + code_hash: Uint8Array; + instantiate_permission?: AccessConfigSDKType; +} /** * ContractGrant a granted permission for a single contract * Since: wasmd 0.30 @@ -78,13 +155,13 @@ export interface ContractGrant { * Limit defines execution limits that are enforced and updated when the grant * is applied. When the limit lapsed the grant is removed. */ - limit: (MaxCallsLimit & MaxFundsLimit & CombinedLimit & Any) | undefined; + limit?: (MaxCallsLimit & MaxFundsLimit & CombinedLimit & Any) | undefined; /** * Filter define more fine-grained control on the message payload passed * to the contract in the operation. When no filter applies on execution, the * operation is prohibited. */ - filter: (AllowAllMessagesFilter & AcceptedMessageKeysFilter & AcceptedMessagesFilter & Any) | undefined; + filter?: (AllowAllMessagesFilter & AcceptedMessageKeysFilter & AcceptedMessagesFilter & Any) | undefined; } export interface ContractGrantProtoMsg { typeUrl: "/cosmwasm.wasm.v1.ContractGrant"; @@ -109,7 +186,7 @@ export type ContractGrantEncoded = Omit & { */ export interface ContractGrantAmino { /** Contract is the bech32 address of the smart contract */ - contract: string; + contract?: string; /** * Limit defines execution limits that are enforced and updated when the grant * is applied. When the limit lapsed the grant is removed. @@ -132,15 +209,15 @@ export interface ContractGrantAminoMsg { */ export interface ContractGrantSDKType { contract: string; - limit: MaxCallsLimitSDKType | MaxFundsLimitSDKType | CombinedLimitSDKType | AnySDKType | undefined; - filter: AllowAllMessagesFilterSDKType | AcceptedMessageKeysFilterSDKType | AcceptedMessagesFilterSDKType | AnySDKType | undefined; + limit?: MaxCallsLimitSDKType | MaxFundsLimitSDKType | CombinedLimitSDKType | AnySDKType | undefined; + filter?: AllowAllMessagesFilterSDKType | AcceptedMessageKeysFilterSDKType | AcceptedMessagesFilterSDKType | AnySDKType | undefined; } /** * MaxCallsLimit limited number of calls to the contract. No funds transferable. * Since: wasmd 0.30 */ export interface MaxCallsLimit { - $typeUrl?: string; + $typeUrl?: "/cosmwasm.wasm.v1.MaxCallsLimit"; /** Remaining number that is decremented on each execution */ remaining: bigint; } @@ -154,7 +231,7 @@ export interface MaxCallsLimitProtoMsg { */ export interface MaxCallsLimitAmino { /** Remaining number that is decremented on each execution */ - remaining: string; + remaining?: string; } export interface MaxCallsLimitAminoMsg { type: "wasm/MaxCallsLimit"; @@ -165,7 +242,7 @@ export interface MaxCallsLimitAminoMsg { * Since: wasmd 0.30 */ export interface MaxCallsLimitSDKType { - $typeUrl?: string; + $typeUrl?: "/cosmwasm.wasm.v1.MaxCallsLimit"; remaining: bigint; } /** @@ -173,7 +250,7 @@ export interface MaxCallsLimitSDKType { * Since: wasmd 0.30 */ export interface MaxFundsLimit { - $typeUrl?: string; + $typeUrl?: "/cosmwasm.wasm.v1.MaxFundsLimit"; /** Amounts is the maximal amount of tokens transferable to the contract. */ amounts: Coin[]; } @@ -198,7 +275,7 @@ export interface MaxFundsLimitAminoMsg { * Since: wasmd 0.30 */ export interface MaxFundsLimitSDKType { - $typeUrl?: string; + $typeUrl?: "/cosmwasm.wasm.v1.MaxFundsLimit"; amounts: CoinSDKType[]; } /** @@ -207,7 +284,7 @@ export interface MaxFundsLimitSDKType { * Since: wasmd 0.30 */ export interface CombinedLimit { - $typeUrl?: string; + $typeUrl?: "/cosmwasm.wasm.v1.CombinedLimit"; /** Remaining number that is decremented on each execution */ callsRemaining: bigint; /** Amounts is the maximal amount of tokens transferable to the contract. */ @@ -224,7 +301,7 @@ export interface CombinedLimitProtoMsg { */ export interface CombinedLimitAmino { /** Remaining number that is decremented on each execution */ - calls_remaining: string; + calls_remaining?: string; /** Amounts is the maximal amount of tokens transferable to the contract. */ amounts: CoinAmino[]; } @@ -238,7 +315,7 @@ export interface CombinedLimitAminoMsg { * Since: wasmd 0.30 */ export interface CombinedLimitSDKType { - $typeUrl?: string; + $typeUrl?: "/cosmwasm.wasm.v1.CombinedLimit"; calls_remaining: bigint; amounts: CoinSDKType[]; } @@ -248,7 +325,7 @@ export interface CombinedLimitSDKType { * Since: wasmd 0.30 */ export interface AllowAllMessagesFilter { - $typeUrl?: string; + $typeUrl?: "/cosmwasm.wasm.v1.AllowAllMessagesFilter"; } export interface AllowAllMessagesFilterProtoMsg { typeUrl: "/cosmwasm.wasm.v1.AllowAllMessagesFilter"; @@ -270,7 +347,7 @@ export interface AllowAllMessagesFilterAminoMsg { * Since: wasmd 0.30 */ export interface AllowAllMessagesFilterSDKType { - $typeUrl?: string; + $typeUrl?: "/cosmwasm.wasm.v1.AllowAllMessagesFilter"; } /** * AcceptedMessageKeysFilter accept only the specific contract message keys in @@ -278,7 +355,7 @@ export interface AllowAllMessagesFilterSDKType { * Since: wasmd 0.30 */ export interface AcceptedMessageKeysFilter { - $typeUrl?: string; + $typeUrl?: "/cosmwasm.wasm.v1.AcceptedMessageKeysFilter"; /** Messages is the list of unique keys */ keys: string[]; } @@ -293,7 +370,7 @@ export interface AcceptedMessageKeysFilterProtoMsg { */ export interface AcceptedMessageKeysFilterAmino { /** Messages is the list of unique keys */ - keys: string[]; + keys?: string[]; } export interface AcceptedMessageKeysFilterAminoMsg { type: "wasm/AcceptedMessageKeysFilter"; @@ -305,7 +382,7 @@ export interface AcceptedMessageKeysFilterAminoMsg { * Since: wasmd 0.30 */ export interface AcceptedMessageKeysFilterSDKType { - $typeUrl?: string; + $typeUrl?: "/cosmwasm.wasm.v1.AcceptedMessageKeysFilter"; keys: string[]; } /** @@ -314,7 +391,7 @@ export interface AcceptedMessageKeysFilterSDKType { * Since: wasmd 0.30 */ export interface AcceptedMessagesFilter { - $typeUrl?: string; + $typeUrl?: "/cosmwasm.wasm.v1.AcceptedMessagesFilter"; /** Messages is the list of raw contract messages */ messages: Uint8Array[]; } @@ -329,7 +406,7 @@ export interface AcceptedMessagesFilterProtoMsg { */ export interface AcceptedMessagesFilterAmino { /** Messages is the list of raw contract messages */ - messages: Uint8Array[]; + messages?: any[]; } export interface AcceptedMessagesFilterAminoMsg { type: "wasm/AcceptedMessagesFilter"; @@ -341,9 +418,81 @@ export interface AcceptedMessagesFilterAminoMsg { * Since: wasmd 0.30 */ export interface AcceptedMessagesFilterSDKType { - $typeUrl?: string; + $typeUrl?: "/cosmwasm.wasm.v1.AcceptedMessagesFilter"; messages: Uint8Array[]; } +function createBaseStoreCodeAuthorization(): StoreCodeAuthorization { + return { + $typeUrl: "/cosmwasm.wasm.v1.StoreCodeAuthorization", + grants: [] + }; +} +export const StoreCodeAuthorization = { + typeUrl: "/cosmwasm.wasm.v1.StoreCodeAuthorization", + encode(message: StoreCodeAuthorization, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.grants) { + CodeGrant.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): StoreCodeAuthorization { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseStoreCodeAuthorization(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.grants.push(CodeGrant.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): StoreCodeAuthorization { + const message = createBaseStoreCodeAuthorization(); + message.grants = object.grants?.map(e => CodeGrant.fromPartial(e)) || []; + return message; + }, + fromAmino(object: StoreCodeAuthorizationAmino): StoreCodeAuthorization { + const message = createBaseStoreCodeAuthorization(); + message.grants = object.grants?.map(e => CodeGrant.fromAmino(e)) || []; + return message; + }, + toAmino(message: StoreCodeAuthorization): StoreCodeAuthorizationAmino { + const obj: any = {}; + if (message.grants) { + obj.grants = message.grants.map(e => e ? CodeGrant.toAmino(e) : undefined); + } else { + obj.grants = []; + } + return obj; + }, + fromAminoMsg(object: StoreCodeAuthorizationAminoMsg): StoreCodeAuthorization { + return StoreCodeAuthorization.fromAmino(object.value); + }, + toAminoMsg(message: StoreCodeAuthorization): StoreCodeAuthorizationAminoMsg { + return { + type: "wasm/StoreCodeAuthorization", + value: StoreCodeAuthorization.toAmino(message) + }; + }, + fromProtoMsg(message: StoreCodeAuthorizationProtoMsg): StoreCodeAuthorization { + return StoreCodeAuthorization.decode(message.value); + }, + toProto(message: StoreCodeAuthorization): Uint8Array { + return StoreCodeAuthorization.encode(message).finish(); + }, + toProtoMsg(message: StoreCodeAuthorization): StoreCodeAuthorizationProtoMsg { + return { + typeUrl: "/cosmwasm.wasm.v1.StoreCodeAuthorization", + value: StoreCodeAuthorization.encode(message).finish() + }; + } +}; function createBaseContractExecutionAuthorization(): ContractExecutionAuthorization { return { $typeUrl: "/cosmwasm.wasm.v1.ContractExecutionAuthorization", @@ -381,9 +530,9 @@ export const ContractExecutionAuthorization = { return message; }, fromAmino(object: ContractExecutionAuthorizationAmino): ContractExecutionAuthorization { - return { - grants: Array.isArray(object?.grants) ? object.grants.map((e: any) => ContractGrant.fromAmino(e)) : [] - }; + const message = createBaseContractExecutionAuthorization(); + message.grants = object.grants?.map(e => ContractGrant.fromAmino(e)) || []; + return message; }, toAmino(message: ContractExecutionAuthorization): ContractExecutionAuthorizationAmino { const obj: any = {}; @@ -453,9 +602,9 @@ export const ContractMigrationAuthorization = { return message; }, fromAmino(object: ContractMigrationAuthorizationAmino): ContractMigrationAuthorization { - return { - grants: Array.isArray(object?.grants) ? object.grants.map((e: any) => ContractGrant.fromAmino(e)) : [] - }; + const message = createBaseContractMigrationAuthorization(); + message.grants = object.grants?.map(e => ContractGrant.fromAmino(e)) || []; + return message; }, toAmino(message: ContractMigrationAuthorization): ContractMigrationAuthorizationAmino { const obj: any = {}; @@ -488,11 +637,92 @@ export const ContractMigrationAuthorization = { }; } }; +function createBaseCodeGrant(): CodeGrant { + return { + codeHash: new Uint8Array(), + instantiatePermission: undefined + }; +} +export const CodeGrant = { + typeUrl: "/cosmwasm.wasm.v1.CodeGrant", + encode(message: CodeGrant, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.codeHash.length !== 0) { + writer.uint32(10).bytes(message.codeHash); + } + if (message.instantiatePermission !== undefined) { + AccessConfig.encode(message.instantiatePermission, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): CodeGrant { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseCodeGrant(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.codeHash = reader.bytes(); + break; + case 2: + message.instantiatePermission = AccessConfig.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): CodeGrant { + const message = createBaseCodeGrant(); + message.codeHash = object.codeHash ?? new Uint8Array(); + message.instantiatePermission = object.instantiatePermission !== undefined && object.instantiatePermission !== null ? AccessConfig.fromPartial(object.instantiatePermission) : undefined; + return message; + }, + fromAmino(object: CodeGrantAmino): CodeGrant { + const message = createBaseCodeGrant(); + if (object.code_hash !== undefined && object.code_hash !== null) { + message.codeHash = bytesFromBase64(object.code_hash); + } + if (object.instantiate_permission !== undefined && object.instantiate_permission !== null) { + message.instantiatePermission = AccessConfig.fromAmino(object.instantiate_permission); + } + return message; + }, + toAmino(message: CodeGrant): CodeGrantAmino { + const obj: any = {}; + obj.code_hash = message.codeHash ? base64FromBytes(message.codeHash) : undefined; + obj.instantiate_permission = message.instantiatePermission ? AccessConfig.toAmino(message.instantiatePermission) : undefined; + return obj; + }, + fromAminoMsg(object: CodeGrantAminoMsg): CodeGrant { + return CodeGrant.fromAmino(object.value); + }, + toAminoMsg(message: CodeGrant): CodeGrantAminoMsg { + return { + type: "wasm/CodeGrant", + value: CodeGrant.toAmino(message) + }; + }, + fromProtoMsg(message: CodeGrantProtoMsg): CodeGrant { + return CodeGrant.decode(message.value); + }, + toProto(message: CodeGrant): Uint8Array { + return CodeGrant.encode(message).finish(); + }, + toProtoMsg(message: CodeGrant): CodeGrantProtoMsg { + return { + typeUrl: "/cosmwasm.wasm.v1.CodeGrant", + value: CodeGrant.encode(message).finish() + }; + } +}; function createBaseContractGrant(): ContractGrant { return { contract: "", - limit: Any.fromPartial({}), - filter: Any.fromPartial({}) + limit: undefined, + filter: undefined }; } export const ContractGrant = { @@ -540,11 +770,17 @@ export const ContractGrant = { return message; }, fromAmino(object: ContractGrantAmino): ContractGrant { - return { - contract: object.contract, - limit: object?.limit ? Cosmwasm_wasmv1ContractAuthzLimitX_FromAmino(object.limit) : undefined, - filter: object?.filter ? Cosmwasm_wasmv1ContractAuthzFilterX_FromAmino(object.filter) : undefined - }; + const message = createBaseContractGrant(); + if (object.contract !== undefined && object.contract !== null) { + message.contract = object.contract; + } + if (object.limit !== undefined && object.limit !== null) { + message.limit = Cosmwasm_wasmv1ContractAuthzLimitX_FromAmino(object.limit); + } + if (object.filter !== undefined && object.filter !== null) { + message.filter = Cosmwasm_wasmv1ContractAuthzFilterX_FromAmino(object.filter); + } + return message; }, toAmino(message: ContractGrant): ContractGrantAmino { const obj: any = {}; @@ -612,9 +848,11 @@ export const MaxCallsLimit = { return message; }, fromAmino(object: MaxCallsLimitAmino): MaxCallsLimit { - return { - remaining: BigInt(object.remaining) - }; + const message = createBaseMaxCallsLimit(); + if (object.remaining !== undefined && object.remaining !== null) { + message.remaining = BigInt(object.remaining); + } + return message; }, toAmino(message: MaxCallsLimit): MaxCallsLimitAmino { const obj: any = {}; @@ -680,9 +918,9 @@ export const MaxFundsLimit = { return message; }, fromAmino(object: MaxFundsLimitAmino): MaxFundsLimit { - return { - amounts: Array.isArray(object?.amounts) ? object.amounts.map((e: any) => Coin.fromAmino(e)) : [] - }; + const message = createBaseMaxFundsLimit(); + message.amounts = object.amounts?.map(e => Coin.fromAmino(e)) || []; + return message; }, toAmino(message: MaxFundsLimit): MaxFundsLimitAmino { const obj: any = {}; @@ -760,10 +998,12 @@ export const CombinedLimit = { return message; }, fromAmino(object: CombinedLimitAmino): CombinedLimit { - return { - callsRemaining: BigInt(object.calls_remaining), - amounts: Array.isArray(object?.amounts) ? object.amounts.map((e: any) => Coin.fromAmino(e)) : [] - }; + const message = createBaseCombinedLimit(); + if (object.calls_remaining !== undefined && object.calls_remaining !== null) { + message.callsRemaining = BigInt(object.calls_remaining); + } + message.amounts = object.amounts?.map(e => Coin.fromAmino(e)) || []; + return message; }, toAmino(message: CombinedLimit): CombinedLimitAmino { const obj: any = {}; @@ -826,7 +1066,8 @@ export const AllowAllMessagesFilter = { return message; }, fromAmino(_: AllowAllMessagesFilterAmino): AllowAllMessagesFilter { - return {}; + const message = createBaseAllowAllMessagesFilter(); + return message; }, toAmino(_: AllowAllMessagesFilter): AllowAllMessagesFilterAmino { const obj: any = {}; @@ -891,9 +1132,9 @@ export const AcceptedMessageKeysFilter = { return message; }, fromAmino(object: AcceptedMessageKeysFilterAmino): AcceptedMessageKeysFilter { - return { - keys: Array.isArray(object?.keys) ? object.keys.map((e: any) => e) : [] - }; + const message = createBaseAcceptedMessageKeysFilter(); + message.keys = object.keys?.map(e => e) || []; + return message; }, toAmino(message: AcceptedMessageKeysFilter): AcceptedMessageKeysFilterAmino { const obj: any = {}; @@ -963,14 +1204,14 @@ export const AcceptedMessagesFilter = { return message; }, fromAmino(object: AcceptedMessagesFilterAmino): AcceptedMessagesFilter { - return { - messages: Array.isArray(object?.messages) ? object.messages.map((e: any) => e) : [] - }; + const message = createBaseAcceptedMessagesFilter(); + message.messages = object.messages?.map(e => toUtf8(JSON.stringify(e))) || []; + return message; }, toAmino(message: AcceptedMessagesFilter): AcceptedMessagesFilterAmino { const obj: any = {}; if (message.messages) { - obj.messages = message.messages.map(e => e); + obj.messages = message.messages.map(e => JSON.parse(fromUtf8(e))); } else { obj.messages = []; } @@ -1000,14 +1241,14 @@ export const AcceptedMessagesFilter = { }; export const Cosmwasm_wasmv1ContractAuthzLimitX_InterfaceDecoder = (input: BinaryReader | Uint8Array): MaxCallsLimit | MaxFundsLimit | CombinedLimit | Any => { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - const data = Any.decode(reader, reader.uint32()); + const data = Any.decode(reader, reader.uint32(), true); switch (data.typeUrl) { case "/cosmwasm.wasm.v1.MaxCallsLimit": - return MaxCallsLimit.decode(data.value); + return MaxCallsLimit.decode(data.value, undefined, true); case "/cosmwasm.wasm.v1.MaxFundsLimit": - return MaxFundsLimit.decode(data.value); + return MaxFundsLimit.decode(data.value, undefined, true); case "/cosmwasm.wasm.v1.CombinedLimit": - return CombinedLimit.decode(data.value); + return CombinedLimit.decode(data.value, undefined, true); default: return data; } @@ -1038,17 +1279,17 @@ export const Cosmwasm_wasmv1ContractAuthzLimitX_ToAmino = (content: Any) => { case "/cosmwasm.wasm.v1.MaxCallsLimit": return { type: "wasm/MaxCallsLimit", - value: MaxCallsLimit.toAmino(MaxCallsLimit.decode(content.value)) + value: MaxCallsLimit.toAmino(MaxCallsLimit.decode(content.value, undefined)) }; case "/cosmwasm.wasm.v1.MaxFundsLimit": return { type: "wasm/MaxFundsLimit", - value: MaxFundsLimit.toAmino(MaxFundsLimit.decode(content.value)) + value: MaxFundsLimit.toAmino(MaxFundsLimit.decode(content.value, undefined)) }; case "/cosmwasm.wasm.v1.CombinedLimit": return { type: "wasm/CombinedLimit", - value: CombinedLimit.toAmino(CombinedLimit.decode(content.value)) + value: CombinedLimit.toAmino(CombinedLimit.decode(content.value, undefined)) }; default: return Any.toAmino(content); @@ -1056,14 +1297,14 @@ export const Cosmwasm_wasmv1ContractAuthzLimitX_ToAmino = (content: Any) => { }; export const Cosmwasm_wasmv1ContractAuthzFilterX_InterfaceDecoder = (input: BinaryReader | Uint8Array): AllowAllMessagesFilter | AcceptedMessageKeysFilter | AcceptedMessagesFilter | Any => { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - const data = Any.decode(reader, reader.uint32()); + const data = Any.decode(reader, reader.uint32(), true); switch (data.typeUrl) { case "/cosmwasm.wasm.v1.AllowAllMessagesFilter": - return AllowAllMessagesFilter.decode(data.value); + return AllowAllMessagesFilter.decode(data.value, undefined, true); case "/cosmwasm.wasm.v1.AcceptedMessageKeysFilter": - return AcceptedMessageKeysFilter.decode(data.value); + return AcceptedMessageKeysFilter.decode(data.value, undefined, true); case "/cosmwasm.wasm.v1.AcceptedMessagesFilter": - return AcceptedMessagesFilter.decode(data.value); + return AcceptedMessagesFilter.decode(data.value, undefined, true); default: return data; } @@ -1094,17 +1335,17 @@ export const Cosmwasm_wasmv1ContractAuthzFilterX_ToAmino = (content: Any) => { case "/cosmwasm.wasm.v1.AllowAllMessagesFilter": return { type: "wasm/AllowAllMessagesFilter", - value: AllowAllMessagesFilter.toAmino(AllowAllMessagesFilter.decode(content.value)) + value: AllowAllMessagesFilter.toAmino(AllowAllMessagesFilter.decode(content.value, undefined)) }; case "/cosmwasm.wasm.v1.AcceptedMessageKeysFilter": return { type: "wasm/AcceptedMessageKeysFilter", - value: AcceptedMessageKeysFilter.toAmino(AcceptedMessageKeysFilter.decode(content.value)) + value: AcceptedMessageKeysFilter.toAmino(AcceptedMessageKeysFilter.decode(content.value, undefined)) }; case "/cosmwasm.wasm.v1.AcceptedMessagesFilter": return { type: "wasm/AcceptedMessagesFilter", - value: AcceptedMessagesFilter.toAmino(AcceptedMessagesFilter.decode(content.value)) + value: AcceptedMessagesFilter.toAmino(AcceptedMessagesFilter.decode(content.value, undefined)) }; default: return Any.toAmino(content); diff --git a/packages/osmo-query/src/codegen/cosmwasm/wasm/v1/genesis.ts b/packages/osmo-query/src/codegen/cosmwasm/wasm/v1/genesis.ts index acdfef68a..43780c51a 100644 --- a/packages/osmo-query/src/codegen/cosmwasm/wasm/v1/genesis.ts +++ b/packages/osmo-query/src/codegen/cosmwasm/wasm/v1/genesis.ts @@ -1,5 +1,6 @@ import { Params, ParamsAmino, ParamsSDKType, CodeInfo, CodeInfoAmino, CodeInfoSDKType, ContractInfo, ContractInfoAmino, ContractInfoSDKType, Model, ModelAmino, ModelSDKType, ContractCodeHistoryEntry, ContractCodeHistoryEntryAmino, ContractCodeHistoryEntrySDKType } from "./types"; import { BinaryReader, BinaryWriter } from "../../../binary"; +import { bytesFromBase64, base64FromBytes } from "../../../helpers"; /** GenesisState - genesis state of x/wasm */ export interface GenesisState { params: Params; @@ -13,7 +14,7 @@ export interface GenesisStateProtoMsg { } /** GenesisState - genesis state of x/wasm */ export interface GenesisStateAmino { - params?: ParamsAmino; + params: ParamsAmino; codes: CodeAmino[]; contracts: ContractAmino[]; sequences: SequenceAmino[]; @@ -43,11 +44,11 @@ export interface CodeProtoMsg { } /** Code struct encompasses CodeInfo and CodeBytes */ export interface CodeAmino { - code_id: string; - code_info?: CodeInfoAmino; - code_bytes: Uint8Array; + code_id?: string; + code_info: CodeInfoAmino; + code_bytes?: string; /** Pinned to wasmvm cache */ - pinned: boolean; + pinned?: boolean; } export interface CodeAminoMsg { type: "wasm/Code"; @@ -73,8 +74,8 @@ export interface ContractProtoMsg { } /** Contract struct encompasses ContractAddress, ContractInfo, and ContractState */ export interface ContractAmino { - contract_address: string; - contract_info?: ContractInfoAmino; + contract_address?: string; + contract_info: ContractInfoAmino; contract_state: ModelAmino[]; contract_code_history: ContractCodeHistoryEntryAmino[]; } @@ -100,8 +101,8 @@ export interface SequenceProtoMsg { } /** Sequence key and value of an id generation counter */ export interface SequenceAmino { - id_key: Uint8Array; - value: string; + id_key?: string; + value?: string; } export interface SequenceAminoMsg { type: "wasm/Sequence"; @@ -172,16 +173,18 @@ export const GenesisState = { return message; }, fromAmino(object: GenesisStateAmino): GenesisState { - return { - params: object?.params ? Params.fromAmino(object.params) : undefined, - codes: Array.isArray(object?.codes) ? object.codes.map((e: any) => Code.fromAmino(e)) : [], - contracts: Array.isArray(object?.contracts) ? object.contracts.map((e: any) => Contract.fromAmino(e)) : [], - sequences: Array.isArray(object?.sequences) ? object.sequences.map((e: any) => Sequence.fromAmino(e)) : [] - }; + const message = createBaseGenesisState(); + if (object.params !== undefined && object.params !== null) { + message.params = Params.fromAmino(object.params); + } + message.codes = object.codes?.map(e => Code.fromAmino(e)) || []; + message.contracts = object.contracts?.map(e => Contract.fromAmino(e)) || []; + message.sequences = object.sequences?.map(e => Sequence.fromAmino(e)) || []; + return message; }, toAmino(message: GenesisState): GenesisStateAmino { const obj: any = {}; - obj.params = message.params ? Params.toAmino(message.params) : undefined; + obj.params = message.params ? Params.toAmino(message.params) : Params.fromPartial({}); if (message.codes) { obj.codes = message.codes.map(e => e ? Code.toAmino(e) : undefined); } else { @@ -281,18 +284,26 @@ export const Code = { return message; }, fromAmino(object: CodeAmino): Code { - return { - codeId: BigInt(object.code_id), - codeInfo: object?.code_info ? CodeInfo.fromAmino(object.code_info) : undefined, - codeBytes: object.code_bytes, - pinned: object.pinned - }; + const message = createBaseCode(); + if (object.code_id !== undefined && object.code_id !== null) { + message.codeId = BigInt(object.code_id); + } + if (object.code_info !== undefined && object.code_info !== null) { + message.codeInfo = CodeInfo.fromAmino(object.code_info); + } + if (object.code_bytes !== undefined && object.code_bytes !== null) { + message.codeBytes = bytesFromBase64(object.code_bytes); + } + if (object.pinned !== undefined && object.pinned !== null) { + message.pinned = object.pinned; + } + return message; }, toAmino(message: Code): CodeAmino { const obj: any = {}; obj.code_id = message.codeId ? message.codeId.toString() : undefined; - obj.code_info = message.codeInfo ? CodeInfo.toAmino(message.codeInfo) : undefined; - obj.code_bytes = message.codeBytes; + obj.code_info = message.codeInfo ? CodeInfo.toAmino(message.codeInfo) : CodeInfo.fromPartial({}); + obj.code_bytes = message.codeBytes ? base64FromBytes(message.codeBytes) : undefined; obj.pinned = message.pinned; return obj; }, @@ -378,17 +389,21 @@ export const Contract = { return message; }, fromAmino(object: ContractAmino): Contract { - return { - contractAddress: object.contract_address, - contractInfo: object?.contract_info ? ContractInfo.fromAmino(object.contract_info) : undefined, - contractState: Array.isArray(object?.contract_state) ? object.contract_state.map((e: any) => Model.fromAmino(e)) : [], - contractCodeHistory: Array.isArray(object?.contract_code_history) ? object.contract_code_history.map((e: any) => ContractCodeHistoryEntry.fromAmino(e)) : [] - }; + const message = createBaseContract(); + if (object.contract_address !== undefined && object.contract_address !== null) { + message.contractAddress = object.contract_address; + } + if (object.contract_info !== undefined && object.contract_info !== null) { + message.contractInfo = ContractInfo.fromAmino(object.contract_info); + } + message.contractState = object.contract_state?.map(e => Model.fromAmino(e)) || []; + message.contractCodeHistory = object.contract_code_history?.map(e => ContractCodeHistoryEntry.fromAmino(e)) || []; + return message; }, toAmino(message: Contract): ContractAmino { const obj: any = {}; obj.contract_address = message.contractAddress; - obj.contract_info = message.contractInfo ? ContractInfo.toAmino(message.contractInfo) : undefined; + obj.contract_info = message.contractInfo ? ContractInfo.toAmino(message.contractInfo) : ContractInfo.fromPartial({}); if (message.contractState) { obj.contract_state = message.contractState.map(e => e ? Model.toAmino(e) : undefined); } else { @@ -467,14 +482,18 @@ export const Sequence = { return message; }, fromAmino(object: SequenceAmino): Sequence { - return { - idKey: object.id_key, - value: BigInt(object.value) - }; + const message = createBaseSequence(); + if (object.id_key !== undefined && object.id_key !== null) { + message.idKey = bytesFromBase64(object.id_key); + } + if (object.value !== undefined && object.value !== null) { + message.value = BigInt(object.value); + } + return message; }, toAmino(message: Sequence): SequenceAmino { const obj: any = {}; - obj.id_key = message.idKey; + obj.id_key = message.idKey ? base64FromBytes(message.idKey) : undefined; obj.value = message.value ? message.value.toString() : undefined; return obj; }, diff --git a/packages/osmo-query/src/codegen/cosmwasm/wasm/v1/ibc.ts b/packages/osmo-query/src/codegen/cosmwasm/wasm/v1/ibc.ts index 628b26b46..ccdfaa02c 100644 --- a/packages/osmo-query/src/codegen/cosmwasm/wasm/v1/ibc.ts +++ b/packages/osmo-query/src/codegen/cosmwasm/wasm/v1/ibc.ts @@ -1,4 +1,5 @@ import { BinaryReader, BinaryWriter } from "../../../binary"; +import { bytesFromBase64, base64FromBytes } from "../../../helpers"; /** MsgIBCSend */ export interface MsgIBCSend { /** the channel by which the packet will be sent */ @@ -26,22 +27,22 @@ export interface MsgIBCSendProtoMsg { /** MsgIBCSend */ export interface MsgIBCSendAmino { /** the channel by which the packet will be sent */ - channel: string; + channel?: string; /** * Timeout height relative to the current block height. * The timeout is disabled when set to 0. */ - timeout_height: string; + timeout_height?: string; /** * Timeout timestamp (in nanoseconds) relative to the current block timestamp. * The timeout is disabled when set to 0. */ - timeout_timestamp: string; + timeout_timestamp?: string; /** * Data is the payload to transfer. We must not make assumption what format or * content is in here. */ - data: Uint8Array; + data?: string; } export interface MsgIBCSendAminoMsg { type: "wasm/MsgIBCSend"; @@ -66,7 +67,7 @@ export interface MsgIBCSendResponseProtoMsg { /** MsgIBCSendResponse */ export interface MsgIBCSendResponseAmino { /** Sequence number of the IBC packet sent */ - sequence: string; + sequence?: string; } export interface MsgIBCSendResponseAminoMsg { type: "wasm/MsgIBCSendResponse"; @@ -86,7 +87,7 @@ export interface MsgIBCCloseChannelProtoMsg { } /** MsgIBCCloseChannel port and channel need to be owned by the contract */ export interface MsgIBCCloseChannelAmino { - channel: string; + channel?: string; } export interface MsgIBCCloseChannelAminoMsg { type: "wasm/MsgIBCCloseChannel"; @@ -156,19 +157,27 @@ export const MsgIBCSend = { return message; }, fromAmino(object: MsgIBCSendAmino): MsgIBCSend { - return { - channel: object.channel, - timeoutHeight: BigInt(object.timeout_height), - timeoutTimestamp: BigInt(object.timeout_timestamp), - data: object.data - }; + const message = createBaseMsgIBCSend(); + if (object.channel !== undefined && object.channel !== null) { + message.channel = object.channel; + } + if (object.timeout_height !== undefined && object.timeout_height !== null) { + message.timeoutHeight = BigInt(object.timeout_height); + } + if (object.timeout_timestamp !== undefined && object.timeout_timestamp !== null) { + message.timeoutTimestamp = BigInt(object.timeout_timestamp); + } + if (object.data !== undefined && object.data !== null) { + message.data = bytesFromBase64(object.data); + } + return message; }, toAmino(message: MsgIBCSend): MsgIBCSendAmino { const obj: any = {}; obj.channel = message.channel; obj.timeout_height = message.timeoutHeight ? message.timeoutHeight.toString() : undefined; obj.timeout_timestamp = message.timeoutTimestamp ? message.timeoutTimestamp.toString() : undefined; - obj.data = message.data; + obj.data = message.data ? base64FromBytes(message.data) : undefined; return obj; }, fromAminoMsg(object: MsgIBCSendAminoMsg): MsgIBCSend { @@ -229,9 +238,11 @@ export const MsgIBCSendResponse = { return message; }, fromAmino(object: MsgIBCSendResponseAmino): MsgIBCSendResponse { - return { - sequence: BigInt(object.sequence) - }; + const message = createBaseMsgIBCSendResponse(); + if (object.sequence !== undefined && object.sequence !== null) { + message.sequence = BigInt(object.sequence); + } + return message; }, toAmino(message: MsgIBCSendResponse): MsgIBCSendResponseAmino { const obj: any = {}; @@ -296,9 +307,11 @@ export const MsgIBCCloseChannel = { return message; }, fromAmino(object: MsgIBCCloseChannelAmino): MsgIBCCloseChannel { - return { - channel: object.channel - }; + const message = createBaseMsgIBCCloseChannel(); + if (object.channel !== undefined && object.channel !== null) { + message.channel = object.channel; + } + return message; }, toAmino(message: MsgIBCCloseChannel): MsgIBCCloseChannelAmino { const obj: any = {}; diff --git a/packages/osmo-query/src/codegen/cosmwasm/wasm/v1/proposal.ts b/packages/osmo-query/src/codegen/cosmwasm/wasm/v1/proposal_legacy.ts similarity index 75% rename from packages/osmo-query/src/codegen/cosmwasm/wasm/v1/proposal.ts rename to packages/osmo-query/src/codegen/cosmwasm/wasm/v1/proposal_legacy.ts index 4266f68fa..097422b81 100644 --- a/packages/osmo-query/src/codegen/cosmwasm/wasm/v1/proposal.ts +++ b/packages/osmo-query/src/codegen/cosmwasm/wasm/v1/proposal_legacy.ts @@ -2,9 +2,16 @@ import { AccessConfig, AccessConfigAmino, AccessConfigSDKType } from "./types"; import { Coin, CoinAmino, CoinSDKType } from "../../../cosmos/base/v1beta1/coin"; import { BinaryReader, BinaryWriter } from "../../../binary"; import { fromBase64, toBase64, toUtf8, fromUtf8 } from "@cosmjs/encoding"; -/** StoreCodeProposal gov proposal content type to submit WASM code to the system */ +import { bytesFromBase64, base64FromBytes } from "../../../helpers"; +/** + * Deprecated: Do not use. Since wasmd v0.40, there is no longer a need for + * an explicit StoreCodeProposal. To submit WASM code to the system, + * a simple MsgStoreCode can be invoked from the x/gov module via + * a v1 governance proposal. + */ +/** @deprecated */ export interface StoreCodeProposal { - $typeUrl?: string; + $typeUrl?: "/cosmwasm.wasm.v1.StoreCodeProposal"; /** Title is a short summary */ title: string; /** Description is a human readable text */ @@ -14,7 +21,7 @@ export interface StoreCodeProposal { /** WASMByteCode can be raw or gzip compressed */ wasmByteCode: Uint8Array; /** InstantiatePermission to apply on contract creation, optional */ - instantiatePermission: AccessConfig; + instantiatePermission?: AccessConfig; /** UnpinCode code on upload, optional */ unpinCode: boolean; /** Source is the URL where the code is hosted */ @@ -34,56 +41,71 @@ export interface StoreCodeProposalProtoMsg { typeUrl: "/cosmwasm.wasm.v1.StoreCodeProposal"; value: Uint8Array; } -/** StoreCodeProposal gov proposal content type to submit WASM code to the system */ +/** + * Deprecated: Do not use. Since wasmd v0.40, there is no longer a need for + * an explicit StoreCodeProposal. To submit WASM code to the system, + * a simple MsgStoreCode can be invoked from the x/gov module via + * a v1 governance proposal. + */ +/** @deprecated */ export interface StoreCodeProposalAmino { /** Title is a short summary */ - title: string; + title?: string; /** Description is a human readable text */ - description: string; + description?: string; /** RunAs is the address that is passed to the contract's environment as sender */ - run_as: string; + run_as?: string; /** WASMByteCode can be raw or gzip compressed */ - wasm_byte_code: string; + wasm_byte_code?: string; /** InstantiatePermission to apply on contract creation, optional */ instantiate_permission?: AccessConfigAmino; /** UnpinCode code on upload, optional */ - unpin_code: boolean; + unpin_code?: boolean; /** Source is the URL where the code is hosted */ - source: string; + source?: string; /** * Builder is the docker image used to build the code deterministically, used * for smart contract verification */ - builder: string; + builder?: string; /** * CodeHash is the SHA256 sum of the code outputted by builder, used for smart * contract verification */ - code_hash: Uint8Array; + code_hash?: string; } export interface StoreCodeProposalAminoMsg { type: "wasm/StoreCodeProposal"; value: StoreCodeProposalAmino; } -/** StoreCodeProposal gov proposal content type to submit WASM code to the system */ +/** + * Deprecated: Do not use. Since wasmd v0.40, there is no longer a need for + * an explicit StoreCodeProposal. To submit WASM code to the system, + * a simple MsgStoreCode can be invoked from the x/gov module via + * a v1 governance proposal. + */ +/** @deprecated */ export interface StoreCodeProposalSDKType { - $typeUrl?: string; + $typeUrl?: "/cosmwasm.wasm.v1.StoreCodeProposal"; title: string; description: string; run_as: string; wasm_byte_code: Uint8Array; - instantiate_permission: AccessConfigSDKType; + instantiate_permission?: AccessConfigSDKType; unpin_code: boolean; source: string; builder: string; code_hash: Uint8Array; } /** - * InstantiateContractProposal gov proposal content type to instantiate a - * contract. + * Deprecated: Do not use. Since wasmd v0.40, there is no longer a need for + * an explicit InstantiateContractProposal. To instantiate a contract, + * a simple MsgInstantiateContract can be invoked from the x/gov module via + * a v1 governance proposal. */ +/** @deprecated */ export interface InstantiateContractProposal { - $typeUrl?: string; + $typeUrl?: "/cosmwasm.wasm.v1.InstantiateContractProposal"; /** Title is a short summary */ title: string; /** Description is a human readable text */ @@ -106,24 +128,27 @@ export interface InstantiateContractProposalProtoMsg { value: Uint8Array; } /** - * InstantiateContractProposal gov proposal content type to instantiate a - * contract. + * Deprecated: Do not use. Since wasmd v0.40, there is no longer a need for + * an explicit InstantiateContractProposal. To instantiate a contract, + * a simple MsgInstantiateContract can be invoked from the x/gov module via + * a v1 governance proposal. */ +/** @deprecated */ export interface InstantiateContractProposalAmino { /** Title is a short summary */ - title: string; + title?: string; /** Description is a human readable text */ - description: string; + description?: string; /** RunAs is the address that is passed to the contract's environment as sender */ - run_as: string; + run_as?: string; /** Admin is an optional address that can execute migrations */ - admin: string; + admin?: string; /** CodeID is the reference to the stored WASM code */ - code_id: string; + code_id?: string; /** Label is optional metadata to be stored with a constract instance. */ - label: string; + label?: string; /** Msg json encoded message to be passed to the contract on instantiation */ - msg: Uint8Array; + msg?: any; /** Funds coins that are transferred to the contract on instantiation */ funds: CoinAmino[]; } @@ -132,11 +157,14 @@ export interface InstantiateContractProposalAminoMsg { value: InstantiateContractProposalAmino; } /** - * InstantiateContractProposal gov proposal content type to instantiate a - * contract. + * Deprecated: Do not use. Since wasmd v0.40, there is no longer a need for + * an explicit InstantiateContractProposal. To instantiate a contract, + * a simple MsgInstantiateContract can be invoked from the x/gov module via + * a v1 governance proposal. */ +/** @deprecated */ export interface InstantiateContractProposalSDKType { - $typeUrl?: string; + $typeUrl?: "/cosmwasm.wasm.v1.InstantiateContractProposal"; title: string; description: string; run_as: string; @@ -147,11 +175,14 @@ export interface InstantiateContractProposalSDKType { funds: CoinSDKType[]; } /** - * InstantiateContract2Proposal gov proposal content type to instantiate - * contract 2 + * Deprecated: Do not use. Since wasmd v0.40, there is no longer a need for + * an explicit InstantiateContract2Proposal. To instantiate contract 2, + * a simple MsgInstantiateContract2 can be invoked from the x/gov module via + * a v1 governance proposal. */ +/** @deprecated */ export interface InstantiateContract2Proposal { - $typeUrl?: string; + $typeUrl?: "/cosmwasm.wasm.v1.InstantiateContract2Proposal"; /** Title is a short summary */ title: string; /** Description is a human readable text */ @@ -181,44 +212,50 @@ export interface InstantiateContract2ProposalProtoMsg { value: Uint8Array; } /** - * InstantiateContract2Proposal gov proposal content type to instantiate - * contract 2 + * Deprecated: Do not use. Since wasmd v0.40, there is no longer a need for + * an explicit InstantiateContract2Proposal. To instantiate contract 2, + * a simple MsgInstantiateContract2 can be invoked from the x/gov module via + * a v1 governance proposal. */ +/** @deprecated */ export interface InstantiateContract2ProposalAmino { /** Title is a short summary */ - title: string; + title?: string; /** Description is a human readable text */ - description: string; + description?: string; /** RunAs is the address that is passed to the contract's enviroment as sender */ - run_as: string; + run_as?: string; /** Admin is an optional address that can execute migrations */ - admin: string; + admin?: string; /** CodeID is the reference to the stored WASM code */ - code_id: string; + code_id?: string; /** Label is optional metadata to be stored with a constract instance. */ - label: string; + label?: string; /** Msg json encode message to be passed to the contract on instantiation */ - msg: Uint8Array; + msg?: any; /** Funds coins that are transferred to the contract on instantiation */ funds: CoinAmino[]; /** Salt is an arbitrary value provided by the sender. Size can be 1 to 64. */ - salt: Uint8Array; + salt?: string; /** * FixMsg include the msg value into the hash for the predictable address. * Default is false */ - fix_msg: boolean; + fix_msg?: boolean; } export interface InstantiateContract2ProposalAminoMsg { type: "wasm/InstantiateContract2Proposal"; value: InstantiateContract2ProposalAmino; } /** - * InstantiateContract2Proposal gov proposal content type to instantiate - * contract 2 + * Deprecated: Do not use. Since wasmd v0.40, there is no longer a need for + * an explicit InstantiateContract2Proposal. To instantiate contract 2, + * a simple MsgInstantiateContract2 can be invoked from the x/gov module via + * a v1 governance proposal. */ +/** @deprecated */ export interface InstantiateContract2ProposalSDKType { - $typeUrl?: string; + $typeUrl?: "/cosmwasm.wasm.v1.InstantiateContract2Proposal"; title: string; description: string; run_as: string; @@ -230,9 +267,15 @@ export interface InstantiateContract2ProposalSDKType { salt: Uint8Array; fix_msg: boolean; } -/** MigrateContractProposal gov proposal content type to migrate a contract. */ +/** + * Deprecated: Do not use. Since wasmd v0.40, there is no longer a need for + * an explicit MigrateContractProposal. To migrate a contract, + * a simple MsgMigrateContract can be invoked from the x/gov module via + * a v1 governance proposal. + */ +/** @deprecated */ export interface MigrateContractProposal { - $typeUrl?: string; + $typeUrl?: "/cosmwasm.wasm.v1.MigrateContractProposal"; /** Title is a short summary */ title: string; /** Description is a human readable text */ @@ -248,35 +291,53 @@ export interface MigrateContractProposalProtoMsg { typeUrl: "/cosmwasm.wasm.v1.MigrateContractProposal"; value: Uint8Array; } -/** MigrateContractProposal gov proposal content type to migrate a contract. */ +/** + * Deprecated: Do not use. Since wasmd v0.40, there is no longer a need for + * an explicit MigrateContractProposal. To migrate a contract, + * a simple MsgMigrateContract can be invoked from the x/gov module via + * a v1 governance proposal. + */ +/** @deprecated */ export interface MigrateContractProposalAmino { /** Title is a short summary */ - title: string; + title?: string; /** Description is a human readable text */ - description: string; + description?: string; /** Contract is the address of the smart contract */ - contract: string; + contract?: string; /** CodeID references the new WASM code */ - code_id: string; + code_id?: string; /** Msg json encoded message to be passed to the contract on migration */ - msg: Uint8Array; + msg?: any; } export interface MigrateContractProposalAminoMsg { type: "wasm/MigrateContractProposal"; value: MigrateContractProposalAmino; } -/** MigrateContractProposal gov proposal content type to migrate a contract. */ +/** + * Deprecated: Do not use. Since wasmd v0.40, there is no longer a need for + * an explicit MigrateContractProposal. To migrate a contract, + * a simple MsgMigrateContract can be invoked from the x/gov module via + * a v1 governance proposal. + */ +/** @deprecated */ export interface MigrateContractProposalSDKType { - $typeUrl?: string; + $typeUrl?: "/cosmwasm.wasm.v1.MigrateContractProposal"; title: string; description: string; contract: string; code_id: bigint; msg: Uint8Array; } -/** SudoContractProposal gov proposal content type to call sudo on a contract. */ +/** + * Deprecated: Do not use. Since wasmd v0.40, there is no longer a need for + * an explicit SudoContractProposal. To call sudo on a contract, + * a simple MsgSudoContract can be invoked from the x/gov module via + * a v1 governance proposal. + */ +/** @deprecated */ export interface SudoContractProposal { - $typeUrl?: string; + $typeUrl?: "/cosmwasm.wasm.v1.SudoContractProposal"; /** Title is a short summary */ title: string; /** Description is a human readable text */ @@ -290,35 +351,50 @@ export interface SudoContractProposalProtoMsg { typeUrl: "/cosmwasm.wasm.v1.SudoContractProposal"; value: Uint8Array; } -/** SudoContractProposal gov proposal content type to call sudo on a contract. */ +/** + * Deprecated: Do not use. Since wasmd v0.40, there is no longer a need for + * an explicit SudoContractProposal. To call sudo on a contract, + * a simple MsgSudoContract can be invoked from the x/gov module via + * a v1 governance proposal. + */ +/** @deprecated */ export interface SudoContractProposalAmino { /** Title is a short summary */ - title: string; + title?: string; /** Description is a human readable text */ - description: string; + description?: string; /** Contract is the address of the smart contract */ - contract: string; + contract?: string; /** Msg json encoded message to be passed to the contract as sudo */ - msg: Uint8Array; + msg?: any; } export interface SudoContractProposalAminoMsg { type: "wasm/SudoContractProposal"; value: SudoContractProposalAmino; } -/** SudoContractProposal gov proposal content type to call sudo on a contract. */ +/** + * Deprecated: Do not use. Since wasmd v0.40, there is no longer a need for + * an explicit SudoContractProposal. To call sudo on a contract, + * a simple MsgSudoContract can be invoked from the x/gov module via + * a v1 governance proposal. + */ +/** @deprecated */ export interface SudoContractProposalSDKType { - $typeUrl?: string; + $typeUrl?: "/cosmwasm.wasm.v1.SudoContractProposal"; title: string; description: string; contract: string; msg: Uint8Array; } /** - * ExecuteContractProposal gov proposal content type to call execute on a - * contract. + * Deprecated: Do not use. Since wasmd v0.40, there is no longer a need for + * an explicit ExecuteContractProposal. To call execute on a contract, + * a simple MsgExecuteContract can be invoked from the x/gov module via + * a v1 governance proposal. */ +/** @deprecated */ export interface ExecuteContractProposal { - $typeUrl?: string; + $typeUrl?: "/cosmwasm.wasm.v1.ExecuteContractProposal"; /** Title is a short summary */ title: string; /** Description is a human readable text */ @@ -337,20 +413,23 @@ export interface ExecuteContractProposalProtoMsg { value: Uint8Array; } /** - * ExecuteContractProposal gov proposal content type to call execute on a - * contract. + * Deprecated: Do not use. Since wasmd v0.40, there is no longer a need for + * an explicit ExecuteContractProposal. To call execute on a contract, + * a simple MsgExecuteContract can be invoked from the x/gov module via + * a v1 governance proposal. */ +/** @deprecated */ export interface ExecuteContractProposalAmino { /** Title is a short summary */ - title: string; + title?: string; /** Description is a human readable text */ - description: string; + description?: string; /** RunAs is the address that is passed to the contract's environment as sender */ - run_as: string; + run_as?: string; /** Contract is the address of the smart contract */ - contract: string; + contract?: string; /** Msg json encoded message to be passed to the contract as execute */ - msg: Uint8Array; + msg?: any; /** Funds coins that are transferred to the contract on instantiation */ funds: CoinAmino[]; } @@ -359,11 +438,14 @@ export interface ExecuteContractProposalAminoMsg { value: ExecuteContractProposalAmino; } /** - * ExecuteContractProposal gov proposal content type to call execute on a - * contract. + * Deprecated: Do not use. Since wasmd v0.40, there is no longer a need for + * an explicit ExecuteContractProposal. To call execute on a contract, + * a simple MsgExecuteContract can be invoked from the x/gov module via + * a v1 governance proposal. */ +/** @deprecated */ export interface ExecuteContractProposalSDKType { - $typeUrl?: string; + $typeUrl?: "/cosmwasm.wasm.v1.ExecuteContractProposal"; title: string; description: string; run_as: string; @@ -371,9 +453,15 @@ export interface ExecuteContractProposalSDKType { msg: Uint8Array; funds: CoinSDKType[]; } -/** UpdateAdminProposal gov proposal content type to set an admin for a contract. */ +/** + * Deprecated: Do not use. Since wasmd v0.40, there is no longer a need for + * an explicit UpdateAdminProposal. To set an admin for a contract, + * a simple MsgUpdateAdmin can be invoked from the x/gov module via + * a v1 governance proposal. + */ +/** @deprecated */ export interface UpdateAdminProposal { - $typeUrl?: string; + $typeUrl?: "/cosmwasm.wasm.v1.UpdateAdminProposal"; /** Title is a short summary */ title: string; /** Description is a human readable text */ @@ -387,35 +475,50 @@ export interface UpdateAdminProposalProtoMsg { typeUrl: "/cosmwasm.wasm.v1.UpdateAdminProposal"; value: Uint8Array; } -/** UpdateAdminProposal gov proposal content type to set an admin for a contract. */ +/** + * Deprecated: Do not use. Since wasmd v0.40, there is no longer a need for + * an explicit UpdateAdminProposal. To set an admin for a contract, + * a simple MsgUpdateAdmin can be invoked from the x/gov module via + * a v1 governance proposal. + */ +/** @deprecated */ export interface UpdateAdminProposalAmino { /** Title is a short summary */ - title: string; + title?: string; /** Description is a human readable text */ - description: string; + description?: string; /** NewAdmin address to be set */ - new_admin: string; + new_admin?: string; /** Contract is the address of the smart contract */ - contract: string; + contract?: string; } export interface UpdateAdminProposalAminoMsg { type: "wasm/UpdateAdminProposal"; value: UpdateAdminProposalAmino; } -/** UpdateAdminProposal gov proposal content type to set an admin for a contract. */ +/** + * Deprecated: Do not use. Since wasmd v0.40, there is no longer a need for + * an explicit UpdateAdminProposal. To set an admin for a contract, + * a simple MsgUpdateAdmin can be invoked from the x/gov module via + * a v1 governance proposal. + */ +/** @deprecated */ export interface UpdateAdminProposalSDKType { - $typeUrl?: string; + $typeUrl?: "/cosmwasm.wasm.v1.UpdateAdminProposal"; title: string; description: string; new_admin: string; contract: string; } /** - * ClearAdminProposal gov proposal content type to clear the admin of a - * contract. + * Deprecated: Do not use. Since wasmd v0.40, there is no longer a need for + * an explicit ClearAdminProposal. To clear the admin of a contract, + * a simple MsgClearAdmin can be invoked from the x/gov module via + * a v1 governance proposal. */ +/** @deprecated */ export interface ClearAdminProposal { - $typeUrl?: string; + $typeUrl?: "/cosmwasm.wasm.v1.ClearAdminProposal"; /** Title is a short summary */ title: string; /** Description is a human readable text */ @@ -428,37 +531,46 @@ export interface ClearAdminProposalProtoMsg { value: Uint8Array; } /** - * ClearAdminProposal gov proposal content type to clear the admin of a - * contract. + * Deprecated: Do not use. Since wasmd v0.40, there is no longer a need for + * an explicit ClearAdminProposal. To clear the admin of a contract, + * a simple MsgClearAdmin can be invoked from the x/gov module via + * a v1 governance proposal. */ +/** @deprecated */ export interface ClearAdminProposalAmino { /** Title is a short summary */ - title: string; + title?: string; /** Description is a human readable text */ - description: string; + description?: string; /** Contract is the address of the smart contract */ - contract: string; + contract?: string; } export interface ClearAdminProposalAminoMsg { type: "wasm/ClearAdminProposal"; value: ClearAdminProposalAmino; } /** - * ClearAdminProposal gov proposal content type to clear the admin of a - * contract. + * Deprecated: Do not use. Since wasmd v0.40, there is no longer a need for + * an explicit ClearAdminProposal. To clear the admin of a contract, + * a simple MsgClearAdmin can be invoked from the x/gov module via + * a v1 governance proposal. */ +/** @deprecated */ export interface ClearAdminProposalSDKType { - $typeUrl?: string; + $typeUrl?: "/cosmwasm.wasm.v1.ClearAdminProposal"; title: string; description: string; contract: string; } /** - * PinCodesProposal gov proposal content type to pin a set of code ids in the - * wasmvm cache. + * Deprecated: Do not use. Since wasmd v0.40, there is no longer a need for + * an explicit PinCodesProposal. To pin a set of code ids in the wasmvm + * cache, a simple MsgPinCodes can be invoked from the x/gov module via + * a v1 governance proposal. */ +/** @deprecated */ export interface PinCodesProposal { - $typeUrl?: string; + $typeUrl?: "/cosmwasm.wasm.v1.PinCodesProposal"; /** Title is a short summary */ title: string; /** Description is a human readable text */ @@ -471,37 +583,46 @@ export interface PinCodesProposalProtoMsg { value: Uint8Array; } /** - * PinCodesProposal gov proposal content type to pin a set of code ids in the - * wasmvm cache. + * Deprecated: Do not use. Since wasmd v0.40, there is no longer a need for + * an explicit PinCodesProposal. To pin a set of code ids in the wasmvm + * cache, a simple MsgPinCodes can be invoked from the x/gov module via + * a v1 governance proposal. */ +/** @deprecated */ export interface PinCodesProposalAmino { /** Title is a short summary */ - title: string; + title?: string; /** Description is a human readable text */ - description: string; + description?: string; /** CodeIDs references the new WASM codes */ - code_ids: string[]; + code_ids?: string[]; } export interface PinCodesProposalAminoMsg { type: "wasm/PinCodesProposal"; value: PinCodesProposalAmino; } /** - * PinCodesProposal gov proposal content type to pin a set of code ids in the - * wasmvm cache. + * Deprecated: Do not use. Since wasmd v0.40, there is no longer a need for + * an explicit PinCodesProposal. To pin a set of code ids in the wasmvm + * cache, a simple MsgPinCodes can be invoked from the x/gov module via + * a v1 governance proposal. */ +/** @deprecated */ export interface PinCodesProposalSDKType { - $typeUrl?: string; + $typeUrl?: "/cosmwasm.wasm.v1.PinCodesProposal"; title: string; description: string; code_ids: bigint[]; } /** - * UnpinCodesProposal gov proposal content type to unpin a set of code ids in - * the wasmvm cache. + * Deprecated: Do not use. Since wasmd v0.40, there is no longer a need for + * an explicit UnpinCodesProposal. To unpin a set of code ids in the wasmvm + * cache, a simple MsgUnpinCodes can be invoked from the x/gov module via + * a v1 governance proposal. */ +/** @deprecated */ export interface UnpinCodesProposal { - $typeUrl?: string; + $typeUrl?: "/cosmwasm.wasm.v1.UnpinCodesProposal"; /** Title is a short summary */ title: string; /** Description is a human readable text */ @@ -514,27 +635,33 @@ export interface UnpinCodesProposalProtoMsg { value: Uint8Array; } /** - * UnpinCodesProposal gov proposal content type to unpin a set of code ids in - * the wasmvm cache. + * Deprecated: Do not use. Since wasmd v0.40, there is no longer a need for + * an explicit UnpinCodesProposal. To unpin a set of code ids in the wasmvm + * cache, a simple MsgUnpinCodes can be invoked from the x/gov module via + * a v1 governance proposal. */ +/** @deprecated */ export interface UnpinCodesProposalAmino { /** Title is a short summary */ - title: string; + title?: string; /** Description is a human readable text */ - description: string; + description?: string; /** CodeIDs references the WASM codes */ - code_ids: string[]; + code_ids?: string[]; } export interface UnpinCodesProposalAminoMsg { type: "wasm/UnpinCodesProposal"; value: UnpinCodesProposalAmino; } /** - * UnpinCodesProposal gov proposal content type to unpin a set of code ids in - * the wasmvm cache. + * Deprecated: Do not use. Since wasmd v0.40, there is no longer a need for + * an explicit UnpinCodesProposal. To unpin a set of code ids in the wasmvm + * cache, a simple MsgUnpinCodes can be invoked from the x/gov module via + * a v1 governance proposal. */ +/** @deprecated */ export interface UnpinCodesProposalSDKType { - $typeUrl?: string; + $typeUrl?: "/cosmwasm.wasm.v1.UnpinCodesProposal"; title: string; description: string; code_ids: bigint[]; @@ -559,9 +686,9 @@ export interface AccessConfigUpdateProtoMsg { */ export interface AccessConfigUpdateAmino { /** CodeID is the reference to the stored WASM code to be updated */ - code_id: string; + code_id?: string; /** InstantiatePermission to apply to the set of code ids */ - instantiate_permission?: AccessConfigAmino; + instantiate_permission: AccessConfigAmino; } export interface AccessConfigUpdateAminoMsg { type: "wasm/AccessConfigUpdate"; @@ -576,11 +703,14 @@ export interface AccessConfigUpdateSDKType { instantiate_permission: AccessConfigSDKType; } /** - * UpdateInstantiateConfigProposal gov proposal content type to update - * instantiate config to a set of code ids. + * Deprecated: Do not use. Since wasmd v0.40, there is no longer a need for + * an explicit UpdateInstantiateConfigProposal. To update instantiate config + * to a set of code ids, a simple MsgUpdateInstantiateConfig can be invoked from + * the x/gov module via a v1 governance proposal. */ +/** @deprecated */ export interface UpdateInstantiateConfigProposal { - $typeUrl?: string; + $typeUrl?: "/cosmwasm.wasm.v1.UpdateInstantiateConfigProposal"; /** Title is a short summary */ title: string; /** Description is a human readable text */ @@ -596,14 +726,17 @@ export interface UpdateInstantiateConfigProposalProtoMsg { value: Uint8Array; } /** - * UpdateInstantiateConfigProposal gov proposal content type to update - * instantiate config to a set of code ids. + * Deprecated: Do not use. Since wasmd v0.40, there is no longer a need for + * an explicit UpdateInstantiateConfigProposal. To update instantiate config + * to a set of code ids, a simple MsgUpdateInstantiateConfig can be invoked from + * the x/gov module via a v1 governance proposal. */ +/** @deprecated */ export interface UpdateInstantiateConfigProposalAmino { /** Title is a short summary */ - title: string; + title?: string; /** Description is a human readable text */ - description: string; + description?: string; /** * AccessConfigUpdate contains the list of code ids and the access config * to be applied. @@ -615,21 +748,27 @@ export interface UpdateInstantiateConfigProposalAminoMsg { value: UpdateInstantiateConfigProposalAmino; } /** - * UpdateInstantiateConfigProposal gov proposal content type to update - * instantiate config to a set of code ids. + * Deprecated: Do not use. Since wasmd v0.40, there is no longer a need for + * an explicit UpdateInstantiateConfigProposal. To update instantiate config + * to a set of code ids, a simple MsgUpdateInstantiateConfig can be invoked from + * the x/gov module via a v1 governance proposal. */ +/** @deprecated */ export interface UpdateInstantiateConfigProposalSDKType { - $typeUrl?: string; + $typeUrl?: "/cosmwasm.wasm.v1.UpdateInstantiateConfigProposal"; title: string; description: string; access_config_updates: AccessConfigUpdateSDKType[]; } /** - * StoreAndInstantiateContractProposal gov proposal content type to store - * and instantiate the contract. + * Deprecated: Do not use. Since wasmd v0.40, there is no longer a need for + * an explicit StoreAndInstantiateContractProposal. To store and instantiate + * the contract, a simple MsgStoreAndInstantiateContract can be invoked from + * the x/gov module via a v1 governance proposal. */ +/** @deprecated */ export interface StoreAndInstantiateContractProposal { - $typeUrl?: string; + $typeUrl?: "/cosmwasm.wasm.v1.StoreAndInstantiateContractProposal"; /** Title is a short summary */ title: string; /** Description is a human readable text */ @@ -639,7 +778,7 @@ export interface StoreAndInstantiateContractProposal { /** WASMByteCode can be raw or gzip compressed */ wasmByteCode: Uint8Array; /** InstantiatePermission to apply on contract creation, optional */ - instantiatePermission: AccessConfig; + instantiatePermission?: AccessConfig; /** UnpinCode code on upload, optional */ unpinCode: boolean; /** Admin is an optional address that can execute migrations */ @@ -668,58 +807,64 @@ export interface StoreAndInstantiateContractProposalProtoMsg { value: Uint8Array; } /** - * StoreAndInstantiateContractProposal gov proposal content type to store - * and instantiate the contract. + * Deprecated: Do not use. Since wasmd v0.40, there is no longer a need for + * an explicit StoreAndInstantiateContractProposal. To store and instantiate + * the contract, a simple MsgStoreAndInstantiateContract can be invoked from + * the x/gov module via a v1 governance proposal. */ +/** @deprecated */ export interface StoreAndInstantiateContractProposalAmino { /** Title is a short summary */ - title: string; + title?: string; /** Description is a human readable text */ - description: string; + description?: string; /** RunAs is the address that is passed to the contract's environment as sender */ - run_as: string; + run_as?: string; /** WASMByteCode can be raw or gzip compressed */ - wasm_byte_code: string; + wasm_byte_code?: string; /** InstantiatePermission to apply on contract creation, optional */ instantiate_permission?: AccessConfigAmino; /** UnpinCode code on upload, optional */ - unpin_code: boolean; + unpin_code?: boolean; /** Admin is an optional address that can execute migrations */ - admin: string; + admin?: string; /** Label is optional metadata to be stored with a constract instance. */ - label: string; + label?: string; /** Msg json encoded message to be passed to the contract on instantiation */ - msg: Uint8Array; + msg?: any; /** Funds coins that are transferred to the contract on instantiation */ funds: CoinAmino[]; /** Source is the URL where the code is hosted */ - source: string; + source?: string; /** * Builder is the docker image used to build the code deterministically, used * for smart contract verification */ - builder: string; + builder?: string; /** * CodeHash is the SHA256 sum of the code outputted by builder, used for smart * contract verification */ - code_hash: Uint8Array; + code_hash?: string; } export interface StoreAndInstantiateContractProposalAminoMsg { type: "wasm/StoreAndInstantiateContractProposal"; value: StoreAndInstantiateContractProposalAmino; } /** - * StoreAndInstantiateContractProposal gov proposal content type to store - * and instantiate the contract. + * Deprecated: Do not use. Since wasmd v0.40, there is no longer a need for + * an explicit StoreAndInstantiateContractProposal. To store and instantiate + * the contract, a simple MsgStoreAndInstantiateContract can be invoked from + * the x/gov module via a v1 governance proposal. */ +/** @deprecated */ export interface StoreAndInstantiateContractProposalSDKType { - $typeUrl?: string; + $typeUrl?: "/cosmwasm.wasm.v1.StoreAndInstantiateContractProposal"; title: string; description: string; run_as: string; wasm_byte_code: Uint8Array; - instantiate_permission: AccessConfigSDKType; + instantiate_permission?: AccessConfigSDKType; unpin_code: boolean; admin: string; label: string; @@ -736,7 +881,7 @@ function createBaseStoreCodeProposal(): StoreCodeProposal { description: "", runAs: "", wasmByteCode: new Uint8Array(), - instantiatePermission: AccessConfig.fromPartial({}), + instantiatePermission: undefined, unpinCode: false, source: "", builder: "", @@ -830,17 +975,35 @@ export const StoreCodeProposal = { return message; }, fromAmino(object: StoreCodeProposalAmino): StoreCodeProposal { - return { - title: object.title, - description: object.description, - runAs: object.run_as, - wasmByteCode: fromBase64(object.wasm_byte_code), - instantiatePermission: object?.instantiate_permission ? AccessConfig.fromAmino(object.instantiate_permission) : undefined, - unpinCode: object.unpin_code, - source: object.source, - builder: object.builder, - codeHash: object.code_hash - }; + const message = createBaseStoreCodeProposal(); + if (object.title !== undefined && object.title !== null) { + message.title = object.title; + } + if (object.description !== undefined && object.description !== null) { + message.description = object.description; + } + if (object.run_as !== undefined && object.run_as !== null) { + message.runAs = object.run_as; + } + if (object.wasm_byte_code !== undefined && object.wasm_byte_code !== null) { + message.wasmByteCode = fromBase64(object.wasm_byte_code); + } + if (object.instantiate_permission !== undefined && object.instantiate_permission !== null) { + message.instantiatePermission = AccessConfig.fromAmino(object.instantiate_permission); + } + if (object.unpin_code !== undefined && object.unpin_code !== null) { + message.unpinCode = object.unpin_code; + } + if (object.source !== undefined && object.source !== null) { + message.source = object.source; + } + if (object.builder !== undefined && object.builder !== null) { + message.builder = object.builder; + } + if (object.code_hash !== undefined && object.code_hash !== null) { + message.codeHash = bytesFromBase64(object.code_hash); + } + return message; }, toAmino(message: StoreCodeProposal): StoreCodeProposalAmino { const obj: any = {}; @@ -852,7 +1015,7 @@ export const StoreCodeProposal = { obj.unpin_code = message.unpinCode; obj.source = message.source; obj.builder = message.builder; - obj.code_hash = message.codeHash; + obj.code_hash = message.codeHash ? base64FromBytes(message.codeHash) : undefined; return obj; }, fromAminoMsg(object: StoreCodeProposalAminoMsg): StoreCodeProposal { @@ -970,16 +1133,30 @@ export const InstantiateContractProposal = { return message; }, fromAmino(object: InstantiateContractProposalAmino): InstantiateContractProposal { - return { - title: object.title, - description: object.description, - runAs: object.run_as, - admin: object.admin, - codeId: BigInt(object.code_id), - label: object.label, - msg: toUtf8(JSON.stringify(object.msg)), - funds: Array.isArray(object?.funds) ? object.funds.map((e: any) => Coin.fromAmino(e)) : [] - }; + const message = createBaseInstantiateContractProposal(); + if (object.title !== undefined && object.title !== null) { + message.title = object.title; + } + if (object.description !== undefined && object.description !== null) { + message.description = object.description; + } + if (object.run_as !== undefined && object.run_as !== null) { + message.runAs = object.run_as; + } + if (object.admin !== undefined && object.admin !== null) { + message.admin = object.admin; + } + if (object.code_id !== undefined && object.code_id !== null) { + message.codeId = BigInt(object.code_id); + } + if (object.label !== undefined && object.label !== null) { + message.label = object.label; + } + if (object.msg !== undefined && object.msg !== null) { + message.msg = toUtf8(JSON.stringify(object.msg)); + } + message.funds = object.funds?.map(e => Coin.fromAmino(e)) || []; + return message; }, toAmino(message: InstantiateContractProposal): InstantiateContractProposalAmino { const obj: any = {}; @@ -1128,18 +1305,36 @@ export const InstantiateContract2Proposal = { return message; }, fromAmino(object: InstantiateContract2ProposalAmino): InstantiateContract2Proposal { - return { - title: object.title, - description: object.description, - runAs: object.run_as, - admin: object.admin, - codeId: BigInt(object.code_id), - label: object.label, - msg: toUtf8(JSON.stringify(object.msg)), - funds: Array.isArray(object?.funds) ? object.funds.map((e: any) => Coin.fromAmino(e)) : [], - salt: object.salt, - fixMsg: object.fix_msg - }; + const message = createBaseInstantiateContract2Proposal(); + if (object.title !== undefined && object.title !== null) { + message.title = object.title; + } + if (object.description !== undefined && object.description !== null) { + message.description = object.description; + } + if (object.run_as !== undefined && object.run_as !== null) { + message.runAs = object.run_as; + } + if (object.admin !== undefined && object.admin !== null) { + message.admin = object.admin; + } + if (object.code_id !== undefined && object.code_id !== null) { + message.codeId = BigInt(object.code_id); + } + if (object.label !== undefined && object.label !== null) { + message.label = object.label; + } + if (object.msg !== undefined && object.msg !== null) { + message.msg = toUtf8(JSON.stringify(object.msg)); + } + message.funds = object.funds?.map(e => Coin.fromAmino(e)) || []; + if (object.salt !== undefined && object.salt !== null) { + message.salt = bytesFromBase64(object.salt); + } + if (object.fix_msg !== undefined && object.fix_msg !== null) { + message.fixMsg = object.fix_msg; + } + return message; }, toAmino(message: InstantiateContract2Proposal): InstantiateContract2ProposalAmino { const obj: any = {}; @@ -1155,7 +1350,7 @@ export const InstantiateContract2Proposal = { } else { obj.funds = []; } - obj.salt = message.salt; + obj.salt = message.salt ? base64FromBytes(message.salt) : undefined; obj.fix_msg = message.fixMsg; return obj; }, @@ -1250,13 +1445,23 @@ export const MigrateContractProposal = { return message; }, fromAmino(object: MigrateContractProposalAmino): MigrateContractProposal { - return { - title: object.title, - description: object.description, - contract: object.contract, - codeId: BigInt(object.code_id), - msg: toUtf8(JSON.stringify(object.msg)) - }; + const message = createBaseMigrateContractProposal(); + if (object.title !== undefined && object.title !== null) { + message.title = object.title; + } + if (object.description !== undefined && object.description !== null) { + message.description = object.description; + } + if (object.contract !== undefined && object.contract !== null) { + message.contract = object.contract; + } + if (object.code_id !== undefined && object.code_id !== null) { + message.codeId = BigInt(object.code_id); + } + if (object.msg !== undefined && object.msg !== null) { + message.msg = toUtf8(JSON.stringify(object.msg)); + } + return message; }, toAmino(message: MigrateContractProposal): MigrateContractProposalAmino { const obj: any = {}; @@ -1350,12 +1555,20 @@ export const SudoContractProposal = { return message; }, fromAmino(object: SudoContractProposalAmino): SudoContractProposal { - return { - title: object.title, - description: object.description, - contract: object.contract, - msg: toUtf8(JSON.stringify(object.msg)) - }; + const message = createBaseSudoContractProposal(); + if (object.title !== undefined && object.title !== null) { + message.title = object.title; + } + if (object.description !== undefined && object.description !== null) { + message.description = object.description; + } + if (object.contract !== undefined && object.contract !== null) { + message.contract = object.contract; + } + if (object.msg !== undefined && object.msg !== null) { + message.msg = toUtf8(JSON.stringify(object.msg)); + } + return message; }, toAmino(message: SudoContractProposal): SudoContractProposalAmino { const obj: any = {}; @@ -1464,14 +1677,24 @@ export const ExecuteContractProposal = { return message; }, fromAmino(object: ExecuteContractProposalAmino): ExecuteContractProposal { - return { - title: object.title, - description: object.description, - runAs: object.run_as, - contract: object.contract, - msg: toUtf8(JSON.stringify(object.msg)), - funds: Array.isArray(object?.funds) ? object.funds.map((e: any) => Coin.fromAmino(e)) : [] - }; + const message = createBaseExecuteContractProposal(); + if (object.title !== undefined && object.title !== null) { + message.title = object.title; + } + if (object.description !== undefined && object.description !== null) { + message.description = object.description; + } + if (object.run_as !== undefined && object.run_as !== null) { + message.runAs = object.run_as; + } + if (object.contract !== undefined && object.contract !== null) { + message.contract = object.contract; + } + if (object.msg !== undefined && object.msg !== null) { + message.msg = toUtf8(JSON.stringify(object.msg)); + } + message.funds = object.funds?.map(e => Coin.fromAmino(e)) || []; + return message; }, toAmino(message: ExecuteContractProposal): ExecuteContractProposalAmino { const obj: any = {}; @@ -1570,12 +1793,20 @@ export const UpdateAdminProposal = { return message; }, fromAmino(object: UpdateAdminProposalAmino): UpdateAdminProposal { - return { - title: object.title, - description: object.description, - newAdmin: object.new_admin, - contract: object.contract - }; + const message = createBaseUpdateAdminProposal(); + if (object.title !== undefined && object.title !== null) { + message.title = object.title; + } + if (object.description !== undefined && object.description !== null) { + message.description = object.description; + } + if (object.new_admin !== undefined && object.new_admin !== null) { + message.newAdmin = object.new_admin; + } + if (object.contract !== undefined && object.contract !== null) { + message.contract = object.contract; + } + return message; }, toAmino(message: UpdateAdminProposal): UpdateAdminProposalAmino { const obj: any = {}; @@ -1660,11 +1891,17 @@ export const ClearAdminProposal = { return message; }, fromAmino(object: ClearAdminProposalAmino): ClearAdminProposal { - return { - title: object.title, - description: object.description, - contract: object.contract - }; + const message = createBaseClearAdminProposal(); + if (object.title !== undefined && object.title !== null) { + message.title = object.title; + } + if (object.description !== undefined && object.description !== null) { + message.description = object.description; + } + if (object.contract !== undefined && object.contract !== null) { + message.contract = object.contract; + } + return message; }, toAmino(message: ClearAdminProposal): ClearAdminProposalAmino { const obj: any = {}; @@ -1757,11 +1994,15 @@ export const PinCodesProposal = { return message; }, fromAmino(object: PinCodesProposalAmino): PinCodesProposal { - return { - title: object.title, - description: object.description, - codeIds: Array.isArray(object?.code_ids) ? object.code_ids.map((e: any) => BigInt(e)) : [] - }; + const message = createBasePinCodesProposal(); + if (object.title !== undefined && object.title !== null) { + message.title = object.title; + } + if (object.description !== undefined && object.description !== null) { + message.description = object.description; + } + message.codeIds = object.code_ids?.map(e => BigInt(e)) || []; + return message; }, toAmino(message: PinCodesProposal): PinCodesProposalAmino { const obj: any = {}; @@ -1858,11 +2099,15 @@ export const UnpinCodesProposal = { return message; }, fromAmino(object: UnpinCodesProposalAmino): UnpinCodesProposal { - return { - title: object.title, - description: object.description, - codeIds: Array.isArray(object?.code_ids) ? object.code_ids.map((e: any) => BigInt(e)) : [] - }; + const message = createBaseUnpinCodesProposal(); + if (object.title !== undefined && object.title !== null) { + message.title = object.title; + } + if (object.description !== undefined && object.description !== null) { + message.description = object.description; + } + message.codeIds = object.code_ids?.map(e => BigInt(e)) || []; + return message; }, toAmino(message: UnpinCodesProposal): UnpinCodesProposalAmino { const obj: any = {}; @@ -1941,15 +2186,19 @@ export const AccessConfigUpdate = { return message; }, fromAmino(object: AccessConfigUpdateAmino): AccessConfigUpdate { - return { - codeId: BigInt(object.code_id), - instantiatePermission: object?.instantiate_permission ? AccessConfig.fromAmino(object.instantiate_permission) : undefined - }; + const message = createBaseAccessConfigUpdate(); + if (object.code_id !== undefined && object.code_id !== null) { + message.codeId = BigInt(object.code_id); + } + if (object.instantiate_permission !== undefined && object.instantiate_permission !== null) { + message.instantiatePermission = AccessConfig.fromAmino(object.instantiate_permission); + } + return message; }, toAmino(message: AccessConfigUpdate): AccessConfigUpdateAmino { const obj: any = {}; obj.code_id = message.codeId ? message.codeId.toString() : undefined; - obj.instantiate_permission = message.instantiatePermission ? AccessConfig.toAmino(message.instantiatePermission) : undefined; + obj.instantiate_permission = message.instantiatePermission ? AccessConfig.toAmino(message.instantiatePermission) : AccessConfig.fromPartial({}); return obj; }, fromAminoMsg(object: AccessConfigUpdateAminoMsg): AccessConfigUpdate { @@ -2027,11 +2276,15 @@ export const UpdateInstantiateConfigProposal = { return message; }, fromAmino(object: UpdateInstantiateConfigProposalAmino): UpdateInstantiateConfigProposal { - return { - title: object.title, - description: object.description, - accessConfigUpdates: Array.isArray(object?.access_config_updates) ? object.access_config_updates.map((e: any) => AccessConfigUpdate.fromAmino(e)) : [] - }; + const message = createBaseUpdateInstantiateConfigProposal(); + if (object.title !== undefined && object.title !== null) { + message.title = object.title; + } + if (object.description !== undefined && object.description !== null) { + message.description = object.description; + } + message.accessConfigUpdates = object.access_config_updates?.map(e => AccessConfigUpdate.fromAmino(e)) || []; + return message; }, toAmino(message: UpdateInstantiateConfigProposal): UpdateInstantiateConfigProposalAmino { const obj: any = {}; @@ -2073,7 +2326,7 @@ function createBaseStoreAndInstantiateContractProposal(): StoreAndInstantiateCon description: "", runAs: "", wasmByteCode: new Uint8Array(), - instantiatePermission: AccessConfig.fromPartial({}), + instantiatePermission: undefined, unpinCode: false, admin: "", label: "", @@ -2199,21 +2452,45 @@ export const StoreAndInstantiateContractProposal = { return message; }, fromAmino(object: StoreAndInstantiateContractProposalAmino): StoreAndInstantiateContractProposal { - return { - title: object.title, - description: object.description, - runAs: object.run_as, - wasmByteCode: fromBase64(object.wasm_byte_code), - instantiatePermission: object?.instantiate_permission ? AccessConfig.fromAmino(object.instantiate_permission) : undefined, - unpinCode: object.unpin_code, - admin: object.admin, - label: object.label, - msg: toUtf8(JSON.stringify(object.msg)), - funds: Array.isArray(object?.funds) ? object.funds.map((e: any) => Coin.fromAmino(e)) : [], - source: object.source, - builder: object.builder, - codeHash: object.code_hash - }; + const message = createBaseStoreAndInstantiateContractProposal(); + if (object.title !== undefined && object.title !== null) { + message.title = object.title; + } + if (object.description !== undefined && object.description !== null) { + message.description = object.description; + } + if (object.run_as !== undefined && object.run_as !== null) { + message.runAs = object.run_as; + } + if (object.wasm_byte_code !== undefined && object.wasm_byte_code !== null) { + message.wasmByteCode = fromBase64(object.wasm_byte_code); + } + if (object.instantiate_permission !== undefined && object.instantiate_permission !== null) { + message.instantiatePermission = AccessConfig.fromAmino(object.instantiate_permission); + } + if (object.unpin_code !== undefined && object.unpin_code !== null) { + message.unpinCode = object.unpin_code; + } + if (object.admin !== undefined && object.admin !== null) { + message.admin = object.admin; + } + if (object.label !== undefined && object.label !== null) { + message.label = object.label; + } + if (object.msg !== undefined && object.msg !== null) { + message.msg = toUtf8(JSON.stringify(object.msg)); + } + message.funds = object.funds?.map(e => Coin.fromAmino(e)) || []; + if (object.source !== undefined && object.source !== null) { + message.source = object.source; + } + if (object.builder !== undefined && object.builder !== null) { + message.builder = object.builder; + } + if (object.code_hash !== undefined && object.code_hash !== null) { + message.codeHash = bytesFromBase64(object.code_hash); + } + return message; }, toAmino(message: StoreAndInstantiateContractProposal): StoreAndInstantiateContractProposalAmino { const obj: any = {}; @@ -2233,7 +2510,7 @@ export const StoreAndInstantiateContractProposal = { } obj.source = message.source; obj.builder = message.builder; - obj.code_hash = message.codeHash; + obj.code_hash = message.codeHash ? base64FromBytes(message.codeHash) : undefined; return obj; }, fromAminoMsg(object: StoreAndInstantiateContractProposalAminoMsg): StoreAndInstantiateContractProposal { diff --git a/packages/osmo-query/src/codegen/cosmwasm/wasm/v1/query.ts b/packages/osmo-query/src/codegen/cosmwasm/wasm/v1/query.ts index b32812dd3..8d4c90704 100644 --- a/packages/osmo-query/src/codegen/cosmwasm/wasm/v1/query.ts +++ b/packages/osmo-query/src/codegen/cosmwasm/wasm/v1/query.ts @@ -1,6 +1,7 @@ import { PageRequest, PageRequestAmino, PageRequestSDKType, PageResponse, PageResponseAmino, PageResponseSDKType } from "../../../cosmos/base/query/v1beta1/pagination"; import { ContractInfo, ContractInfoAmino, ContractInfoSDKType, ContractCodeHistoryEntry, ContractCodeHistoryEntryAmino, ContractCodeHistoryEntrySDKType, Model, ModelAmino, ModelSDKType, AccessConfig, AccessConfigAmino, AccessConfigSDKType, Params, ParamsAmino, ParamsSDKType } from "./types"; import { BinaryReader, BinaryWriter } from "../../../binary"; +import { bytesFromBase64, base64FromBytes } from "../../../helpers"; import { toUtf8, fromUtf8 } from "@cosmjs/encoding"; /** * QueryContractInfoRequest is the request type for the Query/ContractInfo RPC @@ -20,7 +21,7 @@ export interface QueryContractInfoRequestProtoMsg { */ export interface QueryContractInfoRequestAmino { /** address is the address of the contract to query */ - address: string; + address?: string; } export interface QueryContractInfoRequestAminoMsg { type: "wasm/QueryContractInfoRequest"; @@ -52,8 +53,8 @@ export interface QueryContractInfoResponseProtoMsg { */ export interface QueryContractInfoResponseAmino { /** address is the address of the contract */ - address: string; - contract_info?: ContractInfoAmino; + address?: string; + contract_info: ContractInfoAmino; } export interface QueryContractInfoResponseAminoMsg { type: "wasm/QueryContractInfoResponse"; @@ -75,7 +76,7 @@ export interface QueryContractHistoryRequest { /** address is the address of the contract to query */ address: string; /** pagination defines an optional pagination for the request. */ - pagination: PageRequest; + pagination?: PageRequest; } export interface QueryContractHistoryRequestProtoMsg { typeUrl: "/cosmwasm.wasm.v1.QueryContractHistoryRequest"; @@ -87,7 +88,7 @@ export interface QueryContractHistoryRequestProtoMsg { */ export interface QueryContractHistoryRequestAmino { /** address is the address of the contract to query */ - address: string; + address?: string; /** pagination defines an optional pagination for the request. */ pagination?: PageRequestAmino; } @@ -101,7 +102,7 @@ export interface QueryContractHistoryRequestAminoMsg { */ export interface QueryContractHistoryRequestSDKType { address: string; - pagination: PageRequestSDKType; + pagination?: PageRequestSDKType; } /** * QueryContractHistoryResponse is the response type for the @@ -110,7 +111,7 @@ export interface QueryContractHistoryRequestSDKType { export interface QueryContractHistoryResponse { entries: ContractCodeHistoryEntry[]; /** pagination defines the pagination in the response. */ - pagination: PageResponse; + pagination?: PageResponse; } export interface QueryContractHistoryResponseProtoMsg { typeUrl: "/cosmwasm.wasm.v1.QueryContractHistoryResponse"; @@ -135,7 +136,7 @@ export interface QueryContractHistoryResponseAminoMsg { */ export interface QueryContractHistoryResponseSDKType { entries: ContractCodeHistoryEntrySDKType[]; - pagination: PageResponseSDKType; + pagination?: PageResponseSDKType; } /** * QueryContractsByCodeRequest is the request type for the Query/ContractsByCode @@ -147,7 +148,7 @@ export interface QueryContractsByCodeRequest { * pagination defines an optional pagination for the request. */ codeId: bigint; - pagination: PageRequest; + pagination?: PageRequest; } export interface QueryContractsByCodeRequestProtoMsg { typeUrl: "/cosmwasm.wasm.v1.QueryContractsByCodeRequest"; @@ -162,7 +163,7 @@ export interface QueryContractsByCodeRequestAmino { * grpc-gateway_out does not support Go style CodID * pagination defines an optional pagination for the request. */ - code_id: string; + code_id?: string; pagination?: PageRequestAmino; } export interface QueryContractsByCodeRequestAminoMsg { @@ -175,7 +176,7 @@ export interface QueryContractsByCodeRequestAminoMsg { */ export interface QueryContractsByCodeRequestSDKType { code_id: bigint; - pagination: PageRequestSDKType; + pagination?: PageRequestSDKType; } /** * QueryContractsByCodeResponse is the response type for the @@ -185,7 +186,7 @@ export interface QueryContractsByCodeResponse { /** contracts are a set of contract addresses */ contracts: string[]; /** pagination defines the pagination in the response. */ - pagination: PageResponse; + pagination?: PageResponse; } export interface QueryContractsByCodeResponseProtoMsg { typeUrl: "/cosmwasm.wasm.v1.QueryContractsByCodeResponse"; @@ -197,7 +198,7 @@ export interface QueryContractsByCodeResponseProtoMsg { */ export interface QueryContractsByCodeResponseAmino { /** contracts are a set of contract addresses */ - contracts: string[]; + contracts?: string[]; /** pagination defines the pagination in the response. */ pagination?: PageResponseAmino; } @@ -211,7 +212,7 @@ export interface QueryContractsByCodeResponseAminoMsg { */ export interface QueryContractsByCodeResponseSDKType { contracts: string[]; - pagination: PageResponseSDKType; + pagination?: PageResponseSDKType; } /** * QueryAllContractStateRequest is the request type for the @@ -221,7 +222,7 @@ export interface QueryAllContractStateRequest { /** address is the address of the contract */ address: string; /** pagination defines an optional pagination for the request. */ - pagination: PageRequest; + pagination?: PageRequest; } export interface QueryAllContractStateRequestProtoMsg { typeUrl: "/cosmwasm.wasm.v1.QueryAllContractStateRequest"; @@ -233,7 +234,7 @@ export interface QueryAllContractStateRequestProtoMsg { */ export interface QueryAllContractStateRequestAmino { /** address is the address of the contract */ - address: string; + address?: string; /** pagination defines an optional pagination for the request. */ pagination?: PageRequestAmino; } @@ -247,7 +248,7 @@ export interface QueryAllContractStateRequestAminoMsg { */ export interface QueryAllContractStateRequestSDKType { address: string; - pagination: PageRequestSDKType; + pagination?: PageRequestSDKType; } /** * QueryAllContractStateResponse is the response type for the @@ -256,7 +257,7 @@ export interface QueryAllContractStateRequestSDKType { export interface QueryAllContractStateResponse { models: Model[]; /** pagination defines the pagination in the response. */ - pagination: PageResponse; + pagination?: PageResponse; } export interface QueryAllContractStateResponseProtoMsg { typeUrl: "/cosmwasm.wasm.v1.QueryAllContractStateResponse"; @@ -281,7 +282,7 @@ export interface QueryAllContractStateResponseAminoMsg { */ export interface QueryAllContractStateResponseSDKType { models: ModelSDKType[]; - pagination: PageResponseSDKType; + pagination?: PageResponseSDKType; } /** * QueryRawContractStateRequest is the request type for the @@ -302,8 +303,8 @@ export interface QueryRawContractStateRequestProtoMsg { */ export interface QueryRawContractStateRequestAmino { /** address is the address of the contract */ - address: string; - query_data: Uint8Array; + address?: string; + query_data?: string; } export interface QueryRawContractStateRequestAminoMsg { type: "wasm/QueryRawContractStateRequest"; @@ -335,7 +336,7 @@ export interface QueryRawContractStateResponseProtoMsg { */ export interface QueryRawContractStateResponseAmino { /** Data contains the raw store data */ - data: Uint8Array; + data?: string; } export interface QueryRawContractStateResponseAminoMsg { type: "wasm/QueryRawContractStateResponse"; @@ -368,9 +369,9 @@ export interface QuerySmartContractStateRequestProtoMsg { */ export interface QuerySmartContractStateRequestAmino { /** address is the address of the contract */ - address: string; + address?: string; /** QueryData contains the query data passed to the contract */ - query_data: Uint8Array; + query_data?: any; } export interface QuerySmartContractStateRequestAminoMsg { type: "wasm/QuerySmartContractStateRequest"; @@ -402,7 +403,7 @@ export interface QuerySmartContractStateResponseProtoMsg { */ export interface QuerySmartContractStateResponseAmino { /** Data contains the json data returned from the smart contract */ - data: Uint8Array; + data?: any; } export interface QuerySmartContractStateResponseAminoMsg { type: "wasm/QuerySmartContractStateResponse"; @@ -427,7 +428,7 @@ export interface QueryCodeRequestProtoMsg { /** QueryCodeRequest is the request type for the Query/Code RPC method */ export interface QueryCodeRequestAmino { /** grpc-gateway_out does not support Go style CodID */ - code_id: string; + code_id?: string; } export interface QueryCodeRequestAminoMsg { type: "wasm/QueryCodeRequest"; @@ -450,10 +451,10 @@ export interface CodeInfoResponseProtoMsg { } /** CodeInfoResponse contains code meta data from CodeInfo */ export interface CodeInfoResponseAmino { - code_id: string; - creator: string; - data_hash: Uint8Array; - instantiate_permission?: AccessConfigAmino; + code_id?: string; + creator?: string; + data_hash?: string; + instantiate_permission: AccessConfigAmino; } export interface CodeInfoResponseAminoMsg { type: "wasm/CodeInfoResponse"; @@ -468,7 +469,7 @@ export interface CodeInfoResponseSDKType { } /** QueryCodeResponse is the response type for the Query/Code RPC method */ export interface QueryCodeResponse { - codeInfo: CodeInfoResponse; + codeInfo?: CodeInfoResponse; data: Uint8Array; } export interface QueryCodeResponseProtoMsg { @@ -478,7 +479,7 @@ export interface QueryCodeResponseProtoMsg { /** QueryCodeResponse is the response type for the Query/Code RPC method */ export interface QueryCodeResponseAmino { code_info?: CodeInfoResponseAmino; - data: Uint8Array; + data?: string; } export interface QueryCodeResponseAminoMsg { type: "wasm/QueryCodeResponse"; @@ -486,13 +487,13 @@ export interface QueryCodeResponseAminoMsg { } /** QueryCodeResponse is the response type for the Query/Code RPC method */ export interface QueryCodeResponseSDKType { - code_info: CodeInfoResponseSDKType; + code_info?: CodeInfoResponseSDKType; data: Uint8Array; } /** QueryCodesRequest is the request type for the Query/Codes RPC method */ export interface QueryCodesRequest { /** pagination defines an optional pagination for the request. */ - pagination: PageRequest; + pagination?: PageRequest; } export interface QueryCodesRequestProtoMsg { typeUrl: "/cosmwasm.wasm.v1.QueryCodesRequest"; @@ -509,13 +510,13 @@ export interface QueryCodesRequestAminoMsg { } /** QueryCodesRequest is the request type for the Query/Codes RPC method */ export interface QueryCodesRequestSDKType { - pagination: PageRequestSDKType; + pagination?: PageRequestSDKType; } /** QueryCodesResponse is the response type for the Query/Codes RPC method */ export interface QueryCodesResponse { codeInfos: CodeInfoResponse[]; /** pagination defines the pagination in the response. */ - pagination: PageResponse; + pagination?: PageResponse; } export interface QueryCodesResponseProtoMsg { typeUrl: "/cosmwasm.wasm.v1.QueryCodesResponse"; @@ -534,7 +535,7 @@ export interface QueryCodesResponseAminoMsg { /** QueryCodesResponse is the response type for the Query/Codes RPC method */ export interface QueryCodesResponseSDKType { code_infos: CodeInfoResponseSDKType[]; - pagination: PageResponseSDKType; + pagination?: PageResponseSDKType; } /** * QueryPinnedCodesRequest is the request type for the Query/PinnedCodes @@ -542,7 +543,7 @@ export interface QueryCodesResponseSDKType { */ export interface QueryPinnedCodesRequest { /** pagination defines an optional pagination for the request. */ - pagination: PageRequest; + pagination?: PageRequest; } export interface QueryPinnedCodesRequestProtoMsg { typeUrl: "/cosmwasm.wasm.v1.QueryPinnedCodesRequest"; @@ -565,7 +566,7 @@ export interface QueryPinnedCodesRequestAminoMsg { * RPC method */ export interface QueryPinnedCodesRequestSDKType { - pagination: PageRequestSDKType; + pagination?: PageRequestSDKType; } /** * QueryPinnedCodesResponse is the response type for the @@ -574,7 +575,7 @@ export interface QueryPinnedCodesRequestSDKType { export interface QueryPinnedCodesResponse { codeIds: bigint[]; /** pagination defines the pagination in the response. */ - pagination: PageResponse; + pagination?: PageResponse; } export interface QueryPinnedCodesResponseProtoMsg { typeUrl: "/cosmwasm.wasm.v1.QueryPinnedCodesResponse"; @@ -585,7 +586,7 @@ export interface QueryPinnedCodesResponseProtoMsg { * Query/PinnedCodes RPC method */ export interface QueryPinnedCodesResponseAmino { - code_ids: string[]; + code_ids?: string[]; /** pagination defines the pagination in the response. */ pagination?: PageResponseAmino; } @@ -599,7 +600,7 @@ export interface QueryPinnedCodesResponseAminoMsg { */ export interface QueryPinnedCodesResponseSDKType { code_ids: bigint[]; - pagination: PageResponseSDKType; + pagination?: PageResponseSDKType; } /** QueryParamsRequest is the request type for the Query/Params RPC method. */ export interface QueryParamsRequest {} @@ -627,7 +628,7 @@ export interface QueryParamsResponseProtoMsg { /** QueryParamsResponse is the response type for the Query/Params RPC method. */ export interface QueryParamsResponseAmino { /** params defines the parameters of the module. */ - params?: ParamsAmino; + params: ParamsAmino; } export interface QueryParamsResponseAminoMsg { type: "wasm/QueryParamsResponse"; @@ -645,7 +646,7 @@ export interface QueryContractsByCreatorRequest { /** CreatorAddress is the address of contract creator */ creatorAddress: string; /** Pagination defines an optional pagination for the request. */ - pagination: PageRequest; + pagination?: PageRequest; } export interface QueryContractsByCreatorRequestProtoMsg { typeUrl: "/cosmwasm.wasm.v1.QueryContractsByCreatorRequest"; @@ -657,7 +658,7 @@ export interface QueryContractsByCreatorRequestProtoMsg { */ export interface QueryContractsByCreatorRequestAmino { /** CreatorAddress is the address of contract creator */ - creator_address: string; + creator_address?: string; /** Pagination defines an optional pagination for the request. */ pagination?: PageRequestAmino; } @@ -671,7 +672,7 @@ export interface QueryContractsByCreatorRequestAminoMsg { */ export interface QueryContractsByCreatorRequestSDKType { creator_address: string; - pagination: PageRequestSDKType; + pagination?: PageRequestSDKType; } /** * QueryContractsByCreatorResponse is the response type for the @@ -681,7 +682,7 @@ export interface QueryContractsByCreatorResponse { /** ContractAddresses result set */ contractAddresses: string[]; /** Pagination defines the pagination in the response. */ - pagination: PageResponse; + pagination?: PageResponse; } export interface QueryContractsByCreatorResponseProtoMsg { typeUrl: "/cosmwasm.wasm.v1.QueryContractsByCreatorResponse"; @@ -693,7 +694,7 @@ export interface QueryContractsByCreatorResponseProtoMsg { */ export interface QueryContractsByCreatorResponseAmino { /** ContractAddresses result set */ - contract_addresses: string[]; + contract_addresses?: string[]; /** Pagination defines the pagination in the response. */ pagination?: PageResponseAmino; } @@ -707,7 +708,7 @@ export interface QueryContractsByCreatorResponseAminoMsg { */ export interface QueryContractsByCreatorResponseSDKType { contract_addresses: string[]; - pagination: PageResponseSDKType; + pagination?: PageResponseSDKType; } function createBaseQueryContractInfoRequest(): QueryContractInfoRequest { return { @@ -745,9 +746,11 @@ export const QueryContractInfoRequest = { return message; }, fromAmino(object: QueryContractInfoRequestAmino): QueryContractInfoRequest { - return { - address: object.address - }; + const message = createBaseQueryContractInfoRequest(); + if (object.address !== undefined && object.address !== null) { + message.address = object.address; + } + return message; }, toAmino(message: QueryContractInfoRequest): QueryContractInfoRequestAmino { const obj: any = {}; @@ -820,15 +823,19 @@ export const QueryContractInfoResponse = { return message; }, fromAmino(object: QueryContractInfoResponseAmino): QueryContractInfoResponse { - return { - address: object.address, - contractInfo: object?.contract_info ? ContractInfo.fromAmino(object.contract_info) : undefined - }; + const message = createBaseQueryContractInfoResponse(); + if (object.address !== undefined && object.address !== null) { + message.address = object.address; + } + if (object.contract_info !== undefined && object.contract_info !== null) { + message.contractInfo = ContractInfo.fromAmino(object.contract_info); + } + return message; }, toAmino(message: QueryContractInfoResponse): QueryContractInfoResponseAmino { const obj: any = {}; obj.address = message.address; - obj.contract_info = message.contractInfo ? ContractInfo.toAmino(message.contractInfo) : undefined; + obj.contract_info = message.contractInfo ? ContractInfo.toAmino(message.contractInfo) : ContractInfo.fromPartial({}); return obj; }, fromAminoMsg(object: QueryContractInfoResponseAminoMsg): QueryContractInfoResponse { @@ -856,7 +863,7 @@ export const QueryContractInfoResponse = { function createBaseQueryContractHistoryRequest(): QueryContractHistoryRequest { return { address: "", - pagination: PageRequest.fromPartial({}) + pagination: undefined }; } export const QueryContractHistoryRequest = { @@ -897,10 +904,14 @@ export const QueryContractHistoryRequest = { return message; }, fromAmino(object: QueryContractHistoryRequestAmino): QueryContractHistoryRequest { - return { - address: object.address, - pagination: object?.pagination ? PageRequest.fromAmino(object.pagination) : undefined - }; + const message = createBaseQueryContractHistoryRequest(); + if (object.address !== undefined && object.address !== null) { + message.address = object.address; + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromAmino(object.pagination); + } + return message; }, toAmino(message: QueryContractHistoryRequest): QueryContractHistoryRequestAmino { const obj: any = {}; @@ -933,7 +944,7 @@ export const QueryContractHistoryRequest = { function createBaseQueryContractHistoryResponse(): QueryContractHistoryResponse { return { entries: [], - pagination: PageResponse.fromPartial({}) + pagination: undefined }; } export const QueryContractHistoryResponse = { @@ -974,10 +985,12 @@ export const QueryContractHistoryResponse = { return message; }, fromAmino(object: QueryContractHistoryResponseAmino): QueryContractHistoryResponse { - return { - entries: Array.isArray(object?.entries) ? object.entries.map((e: any) => ContractCodeHistoryEntry.fromAmino(e)) : [], - pagination: object?.pagination ? PageResponse.fromAmino(object.pagination) : undefined - }; + const message = createBaseQueryContractHistoryResponse(); + message.entries = object.entries?.map(e => ContractCodeHistoryEntry.fromAmino(e)) || []; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromAmino(object.pagination); + } + return message; }, toAmino(message: QueryContractHistoryResponse): QueryContractHistoryResponseAmino { const obj: any = {}; @@ -1014,7 +1027,7 @@ export const QueryContractHistoryResponse = { function createBaseQueryContractsByCodeRequest(): QueryContractsByCodeRequest { return { codeId: BigInt(0), - pagination: PageRequest.fromPartial({}) + pagination: undefined }; } export const QueryContractsByCodeRequest = { @@ -1055,10 +1068,14 @@ export const QueryContractsByCodeRequest = { return message; }, fromAmino(object: QueryContractsByCodeRequestAmino): QueryContractsByCodeRequest { - return { - codeId: BigInt(object.code_id), - pagination: object?.pagination ? PageRequest.fromAmino(object.pagination) : undefined - }; + const message = createBaseQueryContractsByCodeRequest(); + if (object.code_id !== undefined && object.code_id !== null) { + message.codeId = BigInt(object.code_id); + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromAmino(object.pagination); + } + return message; }, toAmino(message: QueryContractsByCodeRequest): QueryContractsByCodeRequestAmino { const obj: any = {}; @@ -1091,7 +1108,7 @@ export const QueryContractsByCodeRequest = { function createBaseQueryContractsByCodeResponse(): QueryContractsByCodeResponse { return { contracts: [], - pagination: PageResponse.fromPartial({}) + pagination: undefined }; } export const QueryContractsByCodeResponse = { @@ -1132,10 +1149,12 @@ export const QueryContractsByCodeResponse = { return message; }, fromAmino(object: QueryContractsByCodeResponseAmino): QueryContractsByCodeResponse { - return { - contracts: Array.isArray(object?.contracts) ? object.contracts.map((e: any) => e) : [], - pagination: object?.pagination ? PageResponse.fromAmino(object.pagination) : undefined - }; + const message = createBaseQueryContractsByCodeResponse(); + message.contracts = object.contracts?.map(e => e) || []; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromAmino(object.pagination); + } + return message; }, toAmino(message: QueryContractsByCodeResponse): QueryContractsByCodeResponseAmino { const obj: any = {}; @@ -1172,7 +1191,7 @@ export const QueryContractsByCodeResponse = { function createBaseQueryAllContractStateRequest(): QueryAllContractStateRequest { return { address: "", - pagination: PageRequest.fromPartial({}) + pagination: undefined }; } export const QueryAllContractStateRequest = { @@ -1213,10 +1232,14 @@ export const QueryAllContractStateRequest = { return message; }, fromAmino(object: QueryAllContractStateRequestAmino): QueryAllContractStateRequest { - return { - address: object.address, - pagination: object?.pagination ? PageRequest.fromAmino(object.pagination) : undefined - }; + const message = createBaseQueryAllContractStateRequest(); + if (object.address !== undefined && object.address !== null) { + message.address = object.address; + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromAmino(object.pagination); + } + return message; }, toAmino(message: QueryAllContractStateRequest): QueryAllContractStateRequestAmino { const obj: any = {}; @@ -1249,7 +1272,7 @@ export const QueryAllContractStateRequest = { function createBaseQueryAllContractStateResponse(): QueryAllContractStateResponse { return { models: [], - pagination: PageResponse.fromPartial({}) + pagination: undefined }; } export const QueryAllContractStateResponse = { @@ -1290,10 +1313,12 @@ export const QueryAllContractStateResponse = { return message; }, fromAmino(object: QueryAllContractStateResponseAmino): QueryAllContractStateResponse { - return { - models: Array.isArray(object?.models) ? object.models.map((e: any) => Model.fromAmino(e)) : [], - pagination: object?.pagination ? PageResponse.fromAmino(object.pagination) : undefined - }; + const message = createBaseQueryAllContractStateResponse(); + message.models = object.models?.map(e => Model.fromAmino(e)) || []; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromAmino(object.pagination); + } + return message; }, toAmino(message: QueryAllContractStateResponse): QueryAllContractStateResponseAmino { const obj: any = {}; @@ -1371,15 +1396,19 @@ export const QueryRawContractStateRequest = { return message; }, fromAmino(object: QueryRawContractStateRequestAmino): QueryRawContractStateRequest { - return { - address: object.address, - queryData: object.query_data - }; + const message = createBaseQueryRawContractStateRequest(); + if (object.address !== undefined && object.address !== null) { + message.address = object.address; + } + if (object.query_data !== undefined && object.query_data !== null) { + message.queryData = bytesFromBase64(object.query_data); + } + return message; }, toAmino(message: QueryRawContractStateRequest): QueryRawContractStateRequestAmino { const obj: any = {}; obj.address = message.address; - obj.query_data = message.queryData; + obj.query_data = message.queryData ? base64FromBytes(message.queryData) : undefined; return obj; }, fromAminoMsg(object: QueryRawContractStateRequestAminoMsg): QueryRawContractStateRequest { @@ -1440,13 +1469,15 @@ export const QueryRawContractStateResponse = { return message; }, fromAmino(object: QueryRawContractStateResponseAmino): QueryRawContractStateResponse { - return { - data: object.data - }; + const message = createBaseQueryRawContractStateResponse(); + if (object.data !== undefined && object.data !== null) { + message.data = bytesFromBase64(object.data); + } + return message; }, toAmino(message: QueryRawContractStateResponse): QueryRawContractStateResponseAmino { const obj: any = {}; - obj.data = message.data; + obj.data = message.data ? base64FromBytes(message.data) : undefined; return obj; }, fromAminoMsg(object: QueryRawContractStateResponseAminoMsg): QueryRawContractStateResponse { @@ -1515,10 +1546,14 @@ export const QuerySmartContractStateRequest = { return message; }, fromAmino(object: QuerySmartContractStateRequestAmino): QuerySmartContractStateRequest { - return { - address: object.address, - queryData: toUtf8(JSON.stringify(object.query_data)) - }; + const message = createBaseQuerySmartContractStateRequest(); + if (object.address !== undefined && object.address !== null) { + message.address = object.address; + } + if (object.query_data !== undefined && object.query_data !== null) { + message.queryData = toUtf8(JSON.stringify(object.query_data)); + } + return message; }, toAmino(message: QuerySmartContractStateRequest): QuerySmartContractStateRequestAmino { const obj: any = {}; @@ -1584,9 +1619,11 @@ export const QuerySmartContractStateResponse = { return message; }, fromAmino(object: QuerySmartContractStateResponseAmino): QuerySmartContractStateResponse { - return { - data: toUtf8(JSON.stringify(object.data)) - }; + const message = createBaseQuerySmartContractStateResponse(); + if (object.data !== undefined && object.data !== null) { + message.data = toUtf8(JSON.stringify(object.data)); + } + return message; }, toAmino(message: QuerySmartContractStateResponse): QuerySmartContractStateResponseAmino { const obj: any = {}; @@ -1651,9 +1688,11 @@ export const QueryCodeRequest = { return message; }, fromAmino(object: QueryCodeRequestAmino): QueryCodeRequest { - return { - codeId: BigInt(object.code_id) - }; + const message = createBaseQueryCodeRequest(); + if (object.code_id !== undefined && object.code_id !== null) { + message.codeId = BigInt(object.code_id); + } + return message; }, toAmino(message: QueryCodeRequest): QueryCodeRequestAmino { const obj: any = {}; @@ -1742,19 +1781,27 @@ export const CodeInfoResponse = { return message; }, fromAmino(object: CodeInfoResponseAmino): CodeInfoResponse { - return { - codeId: BigInt(object.code_id), - creator: object.creator, - dataHash: object.data_hash, - instantiatePermission: object?.instantiate_permission ? AccessConfig.fromAmino(object.instantiate_permission) : undefined - }; + const message = createBaseCodeInfoResponse(); + if (object.code_id !== undefined && object.code_id !== null) { + message.codeId = BigInt(object.code_id); + } + if (object.creator !== undefined && object.creator !== null) { + message.creator = object.creator; + } + if (object.data_hash !== undefined && object.data_hash !== null) { + message.dataHash = bytesFromBase64(object.data_hash); + } + if (object.instantiate_permission !== undefined && object.instantiate_permission !== null) { + message.instantiatePermission = AccessConfig.fromAmino(object.instantiate_permission); + } + return message; }, toAmino(message: CodeInfoResponse): CodeInfoResponseAmino { const obj: any = {}; obj.code_id = message.codeId ? message.codeId.toString() : undefined; obj.creator = message.creator; - obj.data_hash = message.dataHash; - obj.instantiate_permission = message.instantiatePermission ? AccessConfig.toAmino(message.instantiatePermission) : undefined; + obj.data_hash = message.dataHash ? base64FromBytes(message.dataHash) : undefined; + obj.instantiate_permission = message.instantiatePermission ? AccessConfig.toAmino(message.instantiatePermission) : AccessConfig.fromPartial({}); return obj; }, fromAminoMsg(object: CodeInfoResponseAminoMsg): CodeInfoResponse { @@ -1781,7 +1828,7 @@ export const CodeInfoResponse = { }; function createBaseQueryCodeResponse(): QueryCodeResponse { return { - codeInfo: CodeInfoResponse.fromPartial({}), + codeInfo: undefined, data: new Uint8Array() }; } @@ -1823,15 +1870,19 @@ export const QueryCodeResponse = { return message; }, fromAmino(object: QueryCodeResponseAmino): QueryCodeResponse { - return { - codeInfo: object?.code_info ? CodeInfoResponse.fromAmino(object.code_info) : undefined, - data: object.data - }; + const message = createBaseQueryCodeResponse(); + if (object.code_info !== undefined && object.code_info !== null) { + message.codeInfo = CodeInfoResponse.fromAmino(object.code_info); + } + if (object.data !== undefined && object.data !== null) { + message.data = bytesFromBase64(object.data); + } + return message; }, toAmino(message: QueryCodeResponse): QueryCodeResponseAmino { const obj: any = {}; obj.code_info = message.codeInfo ? CodeInfoResponse.toAmino(message.codeInfo) : undefined; - obj.data = message.data; + obj.data = message.data ? base64FromBytes(message.data) : undefined; return obj; }, fromAminoMsg(object: QueryCodeResponseAminoMsg): QueryCodeResponse { @@ -1858,7 +1909,7 @@ export const QueryCodeResponse = { }; function createBaseQueryCodesRequest(): QueryCodesRequest { return { - pagination: PageRequest.fromPartial({}) + pagination: undefined }; } export const QueryCodesRequest = { @@ -1892,9 +1943,11 @@ export const QueryCodesRequest = { return message; }, fromAmino(object: QueryCodesRequestAmino): QueryCodesRequest { - return { - pagination: object?.pagination ? PageRequest.fromAmino(object.pagination) : undefined - }; + const message = createBaseQueryCodesRequest(); + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromAmino(object.pagination); + } + return message; }, toAmino(message: QueryCodesRequest): QueryCodesRequestAmino { const obj: any = {}; @@ -1926,7 +1979,7 @@ export const QueryCodesRequest = { function createBaseQueryCodesResponse(): QueryCodesResponse { return { codeInfos: [], - pagination: PageResponse.fromPartial({}) + pagination: undefined }; } export const QueryCodesResponse = { @@ -1967,10 +2020,12 @@ export const QueryCodesResponse = { return message; }, fromAmino(object: QueryCodesResponseAmino): QueryCodesResponse { - return { - codeInfos: Array.isArray(object?.code_infos) ? object.code_infos.map((e: any) => CodeInfoResponse.fromAmino(e)) : [], - pagination: object?.pagination ? PageResponse.fromAmino(object.pagination) : undefined - }; + const message = createBaseQueryCodesResponse(); + message.codeInfos = object.code_infos?.map(e => CodeInfoResponse.fromAmino(e)) || []; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromAmino(object.pagination); + } + return message; }, toAmino(message: QueryCodesResponse): QueryCodesResponseAmino { const obj: any = {}; @@ -2006,7 +2061,7 @@ export const QueryCodesResponse = { }; function createBaseQueryPinnedCodesRequest(): QueryPinnedCodesRequest { return { - pagination: PageRequest.fromPartial({}) + pagination: undefined }; } export const QueryPinnedCodesRequest = { @@ -2040,9 +2095,11 @@ export const QueryPinnedCodesRequest = { return message; }, fromAmino(object: QueryPinnedCodesRequestAmino): QueryPinnedCodesRequest { - return { - pagination: object?.pagination ? PageRequest.fromAmino(object.pagination) : undefined - }; + const message = createBaseQueryPinnedCodesRequest(); + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromAmino(object.pagination); + } + return message; }, toAmino(message: QueryPinnedCodesRequest): QueryPinnedCodesRequestAmino { const obj: any = {}; @@ -2074,7 +2131,7 @@ export const QueryPinnedCodesRequest = { function createBaseQueryPinnedCodesResponse(): QueryPinnedCodesResponse { return { codeIds: [], - pagination: PageResponse.fromPartial({}) + pagination: undefined }; } export const QueryPinnedCodesResponse = { @@ -2124,10 +2181,12 @@ export const QueryPinnedCodesResponse = { return message; }, fromAmino(object: QueryPinnedCodesResponseAmino): QueryPinnedCodesResponse { - return { - codeIds: Array.isArray(object?.code_ids) ? object.code_ids.map((e: any) => BigInt(e)) : [], - pagination: object?.pagination ? PageResponse.fromAmino(object.pagination) : undefined - }; + const message = createBaseQueryPinnedCodesResponse(); + message.codeIds = object.code_ids?.map(e => BigInt(e)) || []; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromAmino(object.pagination); + } + return message; }, toAmino(message: QueryPinnedCodesResponse): QueryPinnedCodesResponseAmino { const obj: any = {}; @@ -2188,7 +2247,8 @@ export const QueryParamsRequest = { return message; }, fromAmino(_: QueryParamsRequestAmino): QueryParamsRequest { - return {}; + const message = createBaseQueryParamsRequest(); + return message; }, toAmino(_: QueryParamsRequest): QueryParamsRequestAmino { const obj: any = {}; @@ -2252,13 +2312,15 @@ export const QueryParamsResponse = { return message; }, fromAmino(object: QueryParamsResponseAmino): QueryParamsResponse { - return { - params: object?.params ? Params.fromAmino(object.params) : undefined - }; + const message = createBaseQueryParamsResponse(); + if (object.params !== undefined && object.params !== null) { + message.params = Params.fromAmino(object.params); + } + return message; }, toAmino(message: QueryParamsResponse): QueryParamsResponseAmino { const obj: any = {}; - obj.params = message.params ? Params.toAmino(message.params) : undefined; + obj.params = message.params ? Params.toAmino(message.params) : Params.fromPartial({}); return obj; }, fromAminoMsg(object: QueryParamsResponseAminoMsg): QueryParamsResponse { @@ -2286,7 +2348,7 @@ export const QueryParamsResponse = { function createBaseQueryContractsByCreatorRequest(): QueryContractsByCreatorRequest { return { creatorAddress: "", - pagination: PageRequest.fromPartial({}) + pagination: undefined }; } export const QueryContractsByCreatorRequest = { @@ -2327,10 +2389,14 @@ export const QueryContractsByCreatorRequest = { return message; }, fromAmino(object: QueryContractsByCreatorRequestAmino): QueryContractsByCreatorRequest { - return { - creatorAddress: object.creator_address, - pagination: object?.pagination ? PageRequest.fromAmino(object.pagination) : undefined - }; + const message = createBaseQueryContractsByCreatorRequest(); + if (object.creator_address !== undefined && object.creator_address !== null) { + message.creatorAddress = object.creator_address; + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromAmino(object.pagination); + } + return message; }, toAmino(message: QueryContractsByCreatorRequest): QueryContractsByCreatorRequestAmino { const obj: any = {}; @@ -2363,7 +2429,7 @@ export const QueryContractsByCreatorRequest = { function createBaseQueryContractsByCreatorResponse(): QueryContractsByCreatorResponse { return { contractAddresses: [], - pagination: PageResponse.fromPartial({}) + pagination: undefined }; } export const QueryContractsByCreatorResponse = { @@ -2404,10 +2470,12 @@ export const QueryContractsByCreatorResponse = { return message; }, fromAmino(object: QueryContractsByCreatorResponseAmino): QueryContractsByCreatorResponse { - return { - contractAddresses: Array.isArray(object?.contract_addresses) ? object.contract_addresses.map((e: any) => e) : [], - pagination: object?.pagination ? PageResponse.fromAmino(object.pagination) : undefined - }; + const message = createBaseQueryContractsByCreatorResponse(); + message.contractAddresses = object.contract_addresses?.map(e => e) || []; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromAmino(object.pagination); + } + return message; }, toAmino(message: QueryContractsByCreatorResponse): QueryContractsByCreatorResponseAmino { const obj: any = {}; diff --git a/packages/osmo-query/src/codegen/cosmwasm/wasm/v1/tx.amino.ts b/packages/osmo-query/src/codegen/cosmwasm/wasm/v1/tx.amino.ts index 2b9cd59b2..83c7a1ab9 100644 --- a/packages/osmo-query/src/codegen/cosmwasm/wasm/v1/tx.amino.ts +++ b/packages/osmo-query/src/codegen/cosmwasm/wasm/v1/tx.amino.ts @@ -1,5 +1,5 @@ //@ts-nocheck -import { MsgStoreCode, MsgInstantiateContract, MsgInstantiateContract2, MsgExecuteContract, MsgMigrateContract, MsgUpdateAdmin, MsgClearAdmin, MsgUpdateInstantiateConfig } from "./tx"; +import { MsgStoreCode, MsgInstantiateContract, MsgInstantiateContract2, MsgExecuteContract, MsgMigrateContract, MsgUpdateAdmin, MsgClearAdmin, MsgUpdateInstantiateConfig, MsgUpdateParams, MsgSudoContract, MsgPinCodes, MsgUnpinCodes, MsgStoreAndInstantiateContract, MsgRemoveCodeUploadParamsAddresses, MsgAddCodeUploadParamsAddresses, MsgStoreAndMigrateContract, MsgUpdateContractLabel } from "./tx"; export const AminoConverter = { "/cosmwasm.wasm.v1.MsgStoreCode": { aminoType: "wasm/MsgStoreCode", @@ -40,5 +40,50 @@ export const AminoConverter = { aminoType: "wasm/MsgUpdateInstantiateConfig", toAmino: MsgUpdateInstantiateConfig.toAmino, fromAmino: MsgUpdateInstantiateConfig.fromAmino + }, + "/cosmwasm.wasm.v1.MsgUpdateParams": { + aminoType: "wasm/MsgUpdateParams", + toAmino: MsgUpdateParams.toAmino, + fromAmino: MsgUpdateParams.fromAmino + }, + "/cosmwasm.wasm.v1.MsgSudoContract": { + aminoType: "wasm/MsgSudoContract", + toAmino: MsgSudoContract.toAmino, + fromAmino: MsgSudoContract.fromAmino + }, + "/cosmwasm.wasm.v1.MsgPinCodes": { + aminoType: "wasm/MsgPinCodes", + toAmino: MsgPinCodes.toAmino, + fromAmino: MsgPinCodes.fromAmino + }, + "/cosmwasm.wasm.v1.MsgUnpinCodes": { + aminoType: "wasm/MsgUnpinCodes", + toAmino: MsgUnpinCodes.toAmino, + fromAmino: MsgUnpinCodes.fromAmino + }, + "/cosmwasm.wasm.v1.MsgStoreAndInstantiateContract": { + aminoType: "wasm/MsgStoreAndInstantiateContract", + toAmino: MsgStoreAndInstantiateContract.toAmino, + fromAmino: MsgStoreAndInstantiateContract.fromAmino + }, + "/cosmwasm.wasm.v1.MsgRemoveCodeUploadParamsAddresses": { + aminoType: "wasm/MsgRemoveCodeUploadParamsAddresses", + toAmino: MsgRemoveCodeUploadParamsAddresses.toAmino, + fromAmino: MsgRemoveCodeUploadParamsAddresses.fromAmino + }, + "/cosmwasm.wasm.v1.MsgAddCodeUploadParamsAddresses": { + aminoType: "wasm/MsgAddCodeUploadParamsAddresses", + toAmino: MsgAddCodeUploadParamsAddresses.toAmino, + fromAmino: MsgAddCodeUploadParamsAddresses.fromAmino + }, + "/cosmwasm.wasm.v1.MsgStoreAndMigrateContract": { + aminoType: "wasm/MsgStoreAndMigrateContract", + toAmino: MsgStoreAndMigrateContract.toAmino, + fromAmino: MsgStoreAndMigrateContract.fromAmino + }, + "/cosmwasm.wasm.v1.MsgUpdateContractLabel": { + aminoType: "wasm/MsgUpdateContractLabel", + toAmino: MsgUpdateContractLabel.toAmino, + fromAmino: MsgUpdateContractLabel.fromAmino } }; \ No newline at end of file diff --git a/packages/osmo-query/src/codegen/cosmwasm/wasm/v1/tx.registry.ts b/packages/osmo-query/src/codegen/cosmwasm/wasm/v1/tx.registry.ts index 16b45c68b..dc20b1aaf 100644 --- a/packages/osmo-query/src/codegen/cosmwasm/wasm/v1/tx.registry.ts +++ b/packages/osmo-query/src/codegen/cosmwasm/wasm/v1/tx.registry.ts @@ -1,7 +1,7 @@ //@ts-nocheck import { GeneratedType, Registry } from "@cosmjs/proto-signing"; -import { MsgStoreCode, MsgInstantiateContract, MsgInstantiateContract2, MsgExecuteContract, MsgMigrateContract, MsgUpdateAdmin, MsgClearAdmin, MsgUpdateInstantiateConfig } from "./tx"; -export const registry: ReadonlyArray<[string, GeneratedType]> = [["/cosmwasm.wasm.v1.MsgStoreCode", MsgStoreCode], ["/cosmwasm.wasm.v1.MsgInstantiateContract", MsgInstantiateContract], ["/cosmwasm.wasm.v1.MsgInstantiateContract2", MsgInstantiateContract2], ["/cosmwasm.wasm.v1.MsgExecuteContract", MsgExecuteContract], ["/cosmwasm.wasm.v1.MsgMigrateContract", MsgMigrateContract], ["/cosmwasm.wasm.v1.MsgUpdateAdmin", MsgUpdateAdmin], ["/cosmwasm.wasm.v1.MsgClearAdmin", MsgClearAdmin], ["/cosmwasm.wasm.v1.MsgUpdateInstantiateConfig", MsgUpdateInstantiateConfig]]; +import { MsgStoreCode, MsgInstantiateContract, MsgInstantiateContract2, MsgExecuteContract, MsgMigrateContract, MsgUpdateAdmin, MsgClearAdmin, MsgUpdateInstantiateConfig, MsgUpdateParams, MsgSudoContract, MsgPinCodes, MsgUnpinCodes, MsgStoreAndInstantiateContract, MsgRemoveCodeUploadParamsAddresses, MsgAddCodeUploadParamsAddresses, MsgStoreAndMigrateContract, MsgUpdateContractLabel } from "./tx"; +export const registry: ReadonlyArray<[string, GeneratedType]> = [["/cosmwasm.wasm.v1.MsgStoreCode", MsgStoreCode], ["/cosmwasm.wasm.v1.MsgInstantiateContract", MsgInstantiateContract], ["/cosmwasm.wasm.v1.MsgInstantiateContract2", MsgInstantiateContract2], ["/cosmwasm.wasm.v1.MsgExecuteContract", MsgExecuteContract], ["/cosmwasm.wasm.v1.MsgMigrateContract", MsgMigrateContract], ["/cosmwasm.wasm.v1.MsgUpdateAdmin", MsgUpdateAdmin], ["/cosmwasm.wasm.v1.MsgClearAdmin", MsgClearAdmin], ["/cosmwasm.wasm.v1.MsgUpdateInstantiateConfig", MsgUpdateInstantiateConfig], ["/cosmwasm.wasm.v1.MsgUpdateParams", MsgUpdateParams], ["/cosmwasm.wasm.v1.MsgSudoContract", MsgSudoContract], ["/cosmwasm.wasm.v1.MsgPinCodes", MsgPinCodes], ["/cosmwasm.wasm.v1.MsgUnpinCodes", MsgUnpinCodes], ["/cosmwasm.wasm.v1.MsgStoreAndInstantiateContract", MsgStoreAndInstantiateContract], ["/cosmwasm.wasm.v1.MsgRemoveCodeUploadParamsAddresses", MsgRemoveCodeUploadParamsAddresses], ["/cosmwasm.wasm.v1.MsgAddCodeUploadParamsAddresses", MsgAddCodeUploadParamsAddresses], ["/cosmwasm.wasm.v1.MsgStoreAndMigrateContract", MsgStoreAndMigrateContract], ["/cosmwasm.wasm.v1.MsgUpdateContractLabel", MsgUpdateContractLabel]]; export const load = (protoRegistry: Registry) => { registry.forEach(([typeUrl, mod]) => { protoRegistry.register(typeUrl, mod); @@ -56,6 +56,60 @@ export const MessageComposer = { typeUrl: "/cosmwasm.wasm.v1.MsgUpdateInstantiateConfig", value: MsgUpdateInstantiateConfig.encode(value).finish() }; + }, + updateParams(value: MsgUpdateParams) { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgUpdateParams", + value: MsgUpdateParams.encode(value).finish() + }; + }, + sudoContract(value: MsgSudoContract) { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgSudoContract", + value: MsgSudoContract.encode(value).finish() + }; + }, + pinCodes(value: MsgPinCodes) { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgPinCodes", + value: MsgPinCodes.encode(value).finish() + }; + }, + unpinCodes(value: MsgUnpinCodes) { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgUnpinCodes", + value: MsgUnpinCodes.encode(value).finish() + }; + }, + storeAndInstantiateContract(value: MsgStoreAndInstantiateContract) { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgStoreAndInstantiateContract", + value: MsgStoreAndInstantiateContract.encode(value).finish() + }; + }, + removeCodeUploadParamsAddresses(value: MsgRemoveCodeUploadParamsAddresses) { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgRemoveCodeUploadParamsAddresses", + value: MsgRemoveCodeUploadParamsAddresses.encode(value).finish() + }; + }, + addCodeUploadParamsAddresses(value: MsgAddCodeUploadParamsAddresses) { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgAddCodeUploadParamsAddresses", + value: MsgAddCodeUploadParamsAddresses.encode(value).finish() + }; + }, + storeAndMigrateContract(value: MsgStoreAndMigrateContract) { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgStoreAndMigrateContract", + value: MsgStoreAndMigrateContract.encode(value).finish() + }; + }, + updateContractLabel(value: MsgUpdateContractLabel) { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgUpdateContractLabel", + value: MsgUpdateContractLabel.encode(value).finish() + }; } }, withTypeUrl: { @@ -106,6 +160,60 @@ export const MessageComposer = { typeUrl: "/cosmwasm.wasm.v1.MsgUpdateInstantiateConfig", value }; + }, + updateParams(value: MsgUpdateParams) { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgUpdateParams", + value + }; + }, + sudoContract(value: MsgSudoContract) { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgSudoContract", + value + }; + }, + pinCodes(value: MsgPinCodes) { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgPinCodes", + value + }; + }, + unpinCodes(value: MsgUnpinCodes) { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgUnpinCodes", + value + }; + }, + storeAndInstantiateContract(value: MsgStoreAndInstantiateContract) { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgStoreAndInstantiateContract", + value + }; + }, + removeCodeUploadParamsAddresses(value: MsgRemoveCodeUploadParamsAddresses) { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgRemoveCodeUploadParamsAddresses", + value + }; + }, + addCodeUploadParamsAddresses(value: MsgAddCodeUploadParamsAddresses) { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgAddCodeUploadParamsAddresses", + value + }; + }, + storeAndMigrateContract(value: MsgStoreAndMigrateContract) { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgStoreAndMigrateContract", + value + }; + }, + updateContractLabel(value: MsgUpdateContractLabel) { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgUpdateContractLabel", + value + }; } }, fromPartial: { @@ -156,6 +264,60 @@ export const MessageComposer = { typeUrl: "/cosmwasm.wasm.v1.MsgUpdateInstantiateConfig", value: MsgUpdateInstantiateConfig.fromPartial(value) }; + }, + updateParams(value: MsgUpdateParams) { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgUpdateParams", + value: MsgUpdateParams.fromPartial(value) + }; + }, + sudoContract(value: MsgSudoContract) { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgSudoContract", + value: MsgSudoContract.fromPartial(value) + }; + }, + pinCodes(value: MsgPinCodes) { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgPinCodes", + value: MsgPinCodes.fromPartial(value) + }; + }, + unpinCodes(value: MsgUnpinCodes) { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgUnpinCodes", + value: MsgUnpinCodes.fromPartial(value) + }; + }, + storeAndInstantiateContract(value: MsgStoreAndInstantiateContract) { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgStoreAndInstantiateContract", + value: MsgStoreAndInstantiateContract.fromPartial(value) + }; + }, + removeCodeUploadParamsAddresses(value: MsgRemoveCodeUploadParamsAddresses) { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgRemoveCodeUploadParamsAddresses", + value: MsgRemoveCodeUploadParamsAddresses.fromPartial(value) + }; + }, + addCodeUploadParamsAddresses(value: MsgAddCodeUploadParamsAddresses) { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgAddCodeUploadParamsAddresses", + value: MsgAddCodeUploadParamsAddresses.fromPartial(value) + }; + }, + storeAndMigrateContract(value: MsgStoreAndMigrateContract) { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgStoreAndMigrateContract", + value: MsgStoreAndMigrateContract.fromPartial(value) + }; + }, + updateContractLabel(value: MsgUpdateContractLabel) { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgUpdateContractLabel", + value: MsgUpdateContractLabel.fromPartial(value) + }; } } }; \ No newline at end of file diff --git a/packages/osmo-query/src/codegen/cosmwasm/wasm/v1/tx.rpc.msg.ts b/packages/osmo-query/src/codegen/cosmwasm/wasm/v1/tx.rpc.msg.ts index 7fdd8a748..b01cae2f4 100644 --- a/packages/osmo-query/src/codegen/cosmwasm/wasm/v1/tx.rpc.msg.ts +++ b/packages/osmo-query/src/codegen/cosmwasm/wasm/v1/tx.rpc.msg.ts @@ -1,6 +1,6 @@ import { Rpc } from "../../../helpers"; import { BinaryReader } from "../../../binary"; -import { MsgStoreCode, MsgStoreCodeResponse, MsgInstantiateContract, MsgInstantiateContractResponse, MsgInstantiateContract2, MsgInstantiateContract2Response, MsgExecuteContract, MsgExecuteContractResponse, MsgMigrateContract, MsgMigrateContractResponse, MsgUpdateAdmin, MsgUpdateAdminResponse, MsgClearAdmin, MsgClearAdminResponse, MsgUpdateInstantiateConfig, MsgUpdateInstantiateConfigResponse } from "./tx"; +import { MsgStoreCode, MsgStoreCodeResponse, MsgInstantiateContract, MsgInstantiateContractResponse, MsgInstantiateContract2, MsgInstantiateContract2Response, MsgExecuteContract, MsgExecuteContractResponse, MsgMigrateContract, MsgMigrateContractResponse, MsgUpdateAdmin, MsgUpdateAdminResponse, MsgClearAdmin, MsgClearAdminResponse, MsgUpdateInstantiateConfig, MsgUpdateInstantiateConfigResponse, MsgUpdateParams, MsgUpdateParamsResponse, MsgSudoContract, MsgSudoContractResponse, MsgPinCodes, MsgPinCodesResponse, MsgUnpinCodes, MsgUnpinCodesResponse, MsgStoreAndInstantiateContract, MsgStoreAndInstantiateContractResponse, MsgRemoveCodeUploadParamsAddresses, MsgRemoveCodeUploadParamsAddressesResponse, MsgAddCodeUploadParamsAddresses, MsgAddCodeUploadParamsAddressesResponse, MsgStoreAndMigrateContract, MsgStoreAndMigrateContractResponse, MsgUpdateContractLabel, MsgUpdateContractLabelResponse } from "./tx"; /** Msg defines the wasm Msg service. */ export interface Msg { /** StoreCode to submit Wasm code to the system */ @@ -19,12 +19,72 @@ export interface Msg { executeContract(request: MsgExecuteContract): Promise; /** Migrate runs a code upgrade/ downgrade for a smart contract */ migrateContract(request: MsgMigrateContract): Promise; - /** UpdateAdmin sets a new admin for a smart contract */ + /** UpdateAdmin sets a new admin for a smart contract */ updateAdmin(request: MsgUpdateAdmin): Promise; /** ClearAdmin removes any admin stored for a smart contract */ clearAdmin(request: MsgClearAdmin): Promise; /** UpdateInstantiateConfig updates instantiate config for a smart contract */ updateInstantiateConfig(request: MsgUpdateInstantiateConfig): Promise; + /** + * UpdateParams defines a governance operation for updating the x/wasm + * module parameters. The authority is defined in the keeper. + * + * Since: 0.40 + */ + updateParams(request: MsgUpdateParams): Promise; + /** + * SudoContract defines a governance operation for calling sudo + * on a contract. The authority is defined in the keeper. + * + * Since: 0.40 + */ + sudoContract(request: MsgSudoContract): Promise; + /** + * PinCodes defines a governance operation for pinning a set of + * code ids in the wasmvm cache. The authority is defined in the keeper. + * + * Since: 0.40 + */ + pinCodes(request: MsgPinCodes): Promise; + /** + * UnpinCodes defines a governance operation for unpinning a set of + * code ids in the wasmvm cache. The authority is defined in the keeper. + * + * Since: 0.40 + */ + unpinCodes(request: MsgUnpinCodes): Promise; + /** + * StoreAndInstantiateContract defines a governance operation for storing + * and instantiating the contract. The authority is defined in the keeper. + * + * Since: 0.40 + */ + storeAndInstantiateContract(request: MsgStoreAndInstantiateContract): Promise; + /** + * RemoveCodeUploadParamsAddresses defines a governance operation for + * removing addresses from code upload params. + * The authority is defined in the keeper. + */ + removeCodeUploadParamsAddresses(request: MsgRemoveCodeUploadParamsAddresses): Promise; + /** + * AddCodeUploadParamsAddresses defines a governance operation for + * adding addresses to code upload params. + * The authority is defined in the keeper. + */ + addCodeUploadParamsAddresses(request: MsgAddCodeUploadParamsAddresses): Promise; + /** + * StoreAndMigrateContract defines a governance operation for storing + * and migrating the contract. The authority is defined in the keeper. + * + * Since: 0.42 + */ + storeAndMigrateContract(request: MsgStoreAndMigrateContract): Promise; + /** + * UpdateContractLabel sets a new label for a smart contract + * + * Since: 0.43 + */ + updateContractLabel(request: MsgUpdateContractLabel): Promise; } export class MsgClientImpl implements Msg { private readonly rpc: Rpc; @@ -38,6 +98,15 @@ export class MsgClientImpl implements Msg { this.updateAdmin = this.updateAdmin.bind(this); this.clearAdmin = this.clearAdmin.bind(this); this.updateInstantiateConfig = this.updateInstantiateConfig.bind(this); + this.updateParams = this.updateParams.bind(this); + this.sudoContract = this.sudoContract.bind(this); + this.pinCodes = this.pinCodes.bind(this); + this.unpinCodes = this.unpinCodes.bind(this); + this.storeAndInstantiateContract = this.storeAndInstantiateContract.bind(this); + this.removeCodeUploadParamsAddresses = this.removeCodeUploadParamsAddresses.bind(this); + this.addCodeUploadParamsAddresses = this.addCodeUploadParamsAddresses.bind(this); + this.storeAndMigrateContract = this.storeAndMigrateContract.bind(this); + this.updateContractLabel = this.updateContractLabel.bind(this); } storeCode(request: MsgStoreCode): Promise { const data = MsgStoreCode.encode(request).finish(); @@ -79,4 +148,49 @@ export class MsgClientImpl implements Msg { const promise = this.rpc.request("cosmwasm.wasm.v1.Msg", "UpdateInstantiateConfig", data); return promise.then(data => MsgUpdateInstantiateConfigResponse.decode(new BinaryReader(data))); } + updateParams(request: MsgUpdateParams): Promise { + const data = MsgUpdateParams.encode(request).finish(); + const promise = this.rpc.request("cosmwasm.wasm.v1.Msg", "UpdateParams", data); + return promise.then(data => MsgUpdateParamsResponse.decode(new BinaryReader(data))); + } + sudoContract(request: MsgSudoContract): Promise { + const data = MsgSudoContract.encode(request).finish(); + const promise = this.rpc.request("cosmwasm.wasm.v1.Msg", "SudoContract", data); + return promise.then(data => MsgSudoContractResponse.decode(new BinaryReader(data))); + } + pinCodes(request: MsgPinCodes): Promise { + const data = MsgPinCodes.encode(request).finish(); + const promise = this.rpc.request("cosmwasm.wasm.v1.Msg", "PinCodes", data); + return promise.then(data => MsgPinCodesResponse.decode(new BinaryReader(data))); + } + unpinCodes(request: MsgUnpinCodes): Promise { + const data = MsgUnpinCodes.encode(request).finish(); + const promise = this.rpc.request("cosmwasm.wasm.v1.Msg", "UnpinCodes", data); + return promise.then(data => MsgUnpinCodesResponse.decode(new BinaryReader(data))); + } + storeAndInstantiateContract(request: MsgStoreAndInstantiateContract): Promise { + const data = MsgStoreAndInstantiateContract.encode(request).finish(); + const promise = this.rpc.request("cosmwasm.wasm.v1.Msg", "StoreAndInstantiateContract", data); + return promise.then(data => MsgStoreAndInstantiateContractResponse.decode(new BinaryReader(data))); + } + removeCodeUploadParamsAddresses(request: MsgRemoveCodeUploadParamsAddresses): Promise { + const data = MsgRemoveCodeUploadParamsAddresses.encode(request).finish(); + const promise = this.rpc.request("cosmwasm.wasm.v1.Msg", "RemoveCodeUploadParamsAddresses", data); + return promise.then(data => MsgRemoveCodeUploadParamsAddressesResponse.decode(new BinaryReader(data))); + } + addCodeUploadParamsAddresses(request: MsgAddCodeUploadParamsAddresses): Promise { + const data = MsgAddCodeUploadParamsAddresses.encode(request).finish(); + const promise = this.rpc.request("cosmwasm.wasm.v1.Msg", "AddCodeUploadParamsAddresses", data); + return promise.then(data => MsgAddCodeUploadParamsAddressesResponse.decode(new BinaryReader(data))); + } + storeAndMigrateContract(request: MsgStoreAndMigrateContract): Promise { + const data = MsgStoreAndMigrateContract.encode(request).finish(); + const promise = this.rpc.request("cosmwasm.wasm.v1.Msg", "StoreAndMigrateContract", data); + return promise.then(data => MsgStoreAndMigrateContractResponse.decode(new BinaryReader(data))); + } + updateContractLabel(request: MsgUpdateContractLabel): Promise { + const data = MsgUpdateContractLabel.encode(request).finish(); + const promise = this.rpc.request("cosmwasm.wasm.v1.Msg", "UpdateContractLabel", data); + return promise.then(data => MsgUpdateContractLabelResponse.decode(new BinaryReader(data))); + } } \ No newline at end of file diff --git a/packages/osmo-query/src/codegen/cosmwasm/wasm/v1/tx.ts b/packages/osmo-query/src/codegen/cosmwasm/wasm/v1/tx.ts index e5e760aab..8585a3620 100644 --- a/packages/osmo-query/src/codegen/cosmwasm/wasm/v1/tx.ts +++ b/packages/osmo-query/src/codegen/cosmwasm/wasm/v1/tx.ts @@ -1,7 +1,8 @@ -import { AccessConfig, AccessConfigAmino, AccessConfigSDKType } from "./types"; +import { AccessConfig, AccessConfigAmino, AccessConfigSDKType, Params, ParamsAmino, ParamsSDKType } from "./types"; import { Coin, CoinAmino, CoinSDKType } from "../../../cosmos/base/v1beta1/coin"; import { BinaryReader, BinaryWriter } from "../../../binary"; import { fromBase64, toBase64, toUtf8, fromUtf8 } from "@cosmjs/encoding"; +import { bytesFromBase64, base64FromBytes } from "../../../helpers"; /** MsgStoreCode submit Wasm code to the system */ export interface MsgStoreCode { /** Sender is the actor that signed the messages */ @@ -12,7 +13,7 @@ export interface MsgStoreCode { * InstantiatePermission access control to apply on contract creation, * optional */ - instantiatePermission: AccessConfig; + instantiatePermission?: AccessConfig; } export interface MsgStoreCodeProtoMsg { typeUrl: "/cosmwasm.wasm.v1.MsgStoreCode"; @@ -21,9 +22,9 @@ export interface MsgStoreCodeProtoMsg { /** MsgStoreCode submit Wasm code to the system */ export interface MsgStoreCodeAmino { /** Sender is the actor that signed the messages */ - sender: string; + sender?: string; /** WASMByteCode can be raw or gzip compressed */ - wasm_byte_code: string; + wasm_byte_code?: string; /** * InstantiatePermission access control to apply on contract creation, * optional @@ -38,7 +39,7 @@ export interface MsgStoreCodeAminoMsg { export interface MsgStoreCodeSDKType { sender: string; wasm_byte_code: Uint8Array; - instantiate_permission: AccessConfigSDKType; + instantiate_permission?: AccessConfigSDKType; } /** MsgStoreCodeResponse returns store result data. */ export interface MsgStoreCodeResponse { @@ -54,9 +55,9 @@ export interface MsgStoreCodeResponseProtoMsg { /** MsgStoreCodeResponse returns store result data. */ export interface MsgStoreCodeResponseAmino { /** CodeID is the reference to the stored WASM code */ - code_id: string; + code_id?: string; /** Checksum is the sha256 hash of the stored code */ - checksum: Uint8Array; + checksum?: string; } export interface MsgStoreCodeResponseAminoMsg { type: "wasm/MsgStoreCodeResponse"; @@ -95,15 +96,15 @@ export interface MsgInstantiateContractProtoMsg { */ export interface MsgInstantiateContractAmino { /** Sender is the that actor that signed the messages */ - sender: string; + sender?: string; /** Admin is an optional address that can execute migrations */ - admin: string; + admin?: string; /** CodeID is the reference to the stored WASM code */ - code_id: string; + code_id?: string; /** Label is optional metadata to be stored with a contract instance. */ - label: string; + label?: string; /** Msg json encoded message to be passed to the contract on instantiation */ - msg: Uint8Array; + msg?: any; /** Funds coins that are transferred to the contract on instantiation */ funds: CoinAmino[]; } @@ -123,6 +124,33 @@ export interface MsgInstantiateContractSDKType { msg: Uint8Array; funds: CoinSDKType[]; } +/** MsgInstantiateContractResponse return instantiation result data */ +export interface MsgInstantiateContractResponse { + /** Address is the bech32 address of the new contract instance. */ + address: string; + /** Data contains bytes to returned from the contract */ + data: Uint8Array; +} +export interface MsgInstantiateContractResponseProtoMsg { + typeUrl: "/cosmwasm.wasm.v1.MsgInstantiateContractResponse"; + value: Uint8Array; +} +/** MsgInstantiateContractResponse return instantiation result data */ +export interface MsgInstantiateContractResponseAmino { + /** Address is the bech32 address of the new contract instance. */ + address?: string; + /** Data contains bytes to returned from the contract */ + data?: string; +} +export interface MsgInstantiateContractResponseAminoMsg { + type: "wasm/MsgInstantiateContractResponse"; + value: MsgInstantiateContractResponseAmino; +} +/** MsgInstantiateContractResponse return instantiation result data */ +export interface MsgInstantiateContractResponseSDKType { + address: string; + data: Uint8Array; +} /** * MsgInstantiateContract2 create a new smart contract instance for the given * code id with a predicable address. @@ -158,24 +186,24 @@ export interface MsgInstantiateContract2ProtoMsg { */ export interface MsgInstantiateContract2Amino { /** Sender is the that actor that signed the messages */ - sender: string; + sender?: string; /** Admin is an optional address that can execute migrations */ - admin: string; + admin?: string; /** CodeID is the reference to the stored WASM code */ - code_id: string; + code_id?: string; /** Label is optional metadata to be stored with a contract instance. */ - label: string; + label?: string; /** Msg json encoded message to be passed to the contract on instantiation */ - msg: Uint8Array; + msg?: any; /** Funds coins that are transferred to the contract on instantiation */ funds: CoinAmino[]; /** Salt is an arbitrary value provided by the sender. Size can be 1 to 64. */ - salt: Uint8Array; + salt?: string; /** * FixMsg include the msg value into the hash for the predictable address. * Default is false */ - fix_msg: boolean; + fix_msg?: boolean; } export interface MsgInstantiateContract2AminoMsg { type: "wasm/MsgInstantiateContract2"; @@ -195,33 +223,6 @@ export interface MsgInstantiateContract2SDKType { salt: Uint8Array; fix_msg: boolean; } -/** MsgInstantiateContractResponse return instantiation result data */ -export interface MsgInstantiateContractResponse { - /** Address is the bech32 address of the new contract instance. */ - address: string; - /** Data contains bytes to returned from the contract */ - data: Uint8Array; -} -export interface MsgInstantiateContractResponseProtoMsg { - typeUrl: "/cosmwasm.wasm.v1.MsgInstantiateContractResponse"; - value: Uint8Array; -} -/** MsgInstantiateContractResponse return instantiation result data */ -export interface MsgInstantiateContractResponseAmino { - /** Address is the bech32 address of the new contract instance. */ - address: string; - /** Data contains bytes to returned from the contract */ - data: Uint8Array; -} -export interface MsgInstantiateContractResponseAminoMsg { - type: "wasm/MsgInstantiateContractResponse"; - value: MsgInstantiateContractResponseAmino; -} -/** MsgInstantiateContractResponse return instantiation result data */ -export interface MsgInstantiateContractResponseSDKType { - address: string; - data: Uint8Array; -} /** MsgInstantiateContract2Response return instantiation result data */ export interface MsgInstantiateContract2Response { /** Address is the bech32 address of the new contract instance. */ @@ -236,9 +237,9 @@ export interface MsgInstantiateContract2ResponseProtoMsg { /** MsgInstantiateContract2Response return instantiation result data */ export interface MsgInstantiateContract2ResponseAmino { /** Address is the bech32 address of the new contract instance. */ - address: string; + address?: string; /** Data contains bytes to returned from the contract */ - data: Uint8Array; + data?: string; } export interface MsgInstantiateContract2ResponseAminoMsg { type: "wasm/MsgInstantiateContract2Response"; @@ -267,11 +268,11 @@ export interface MsgExecuteContractProtoMsg { /** MsgExecuteContract submits the given message data to a smart contract */ export interface MsgExecuteContractAmino { /** Sender is the that actor that signed the messages */ - sender: string; + sender?: string; /** Contract is the address of the smart contract */ - contract: string; + contract?: string; /** Msg json encoded message to be passed to the contract */ - msg: Uint8Array; + msg?: any; /** Funds coins that are transferred to the contract on execution */ funds: CoinAmino[]; } @@ -298,7 +299,7 @@ export interface MsgExecuteContractResponseProtoMsg { /** MsgExecuteContractResponse returns execution result data. */ export interface MsgExecuteContractResponseAmino { /** Data contains bytes to returned from the contract */ - data: Uint8Array; + data?: string; } export interface MsgExecuteContractResponseAminoMsg { type: "wasm/MsgExecuteContractResponse"; @@ -326,13 +327,13 @@ export interface MsgMigrateContractProtoMsg { /** MsgMigrateContract runs a code upgrade/ downgrade for a smart contract */ export interface MsgMigrateContractAmino { /** Sender is the that actor that signed the messages */ - sender: string; + sender?: string; /** Contract is the address of the smart contract */ - contract: string; + contract?: string; /** CodeID references the new WASM code */ - code_id: string; + code_id?: string; /** Msg json encoded message to be passed to the contract on migration */ - msg: Uint8Array; + msg?: any; } export interface MsgMigrateContractAminoMsg { type: "wasm/MsgMigrateContract"; @@ -363,7 +364,7 @@ export interface MsgMigrateContractResponseAmino { * Data contains same raw bytes returned as data from the wasm contract. * (May be empty) */ - data: Uint8Array; + data?: string; } export interface MsgMigrateContractResponseAminoMsg { type: "wasm/MsgMigrateContractResponse"; @@ -389,11 +390,11 @@ export interface MsgUpdateAdminProtoMsg { /** MsgUpdateAdmin sets a new admin for a smart contract */ export interface MsgUpdateAdminAmino { /** Sender is the that actor that signed the messages */ - sender: string; + sender?: string; /** NewAdmin address to be set */ - new_admin: string; + new_admin?: string; /** Contract is the address of the smart contract */ - contract: string; + contract?: string; } export interface MsgUpdateAdminAminoMsg { type: "wasm/MsgUpdateAdmin"; @@ -433,9 +434,9 @@ export interface MsgClearAdminProtoMsg { /** MsgClearAdmin removes any admin stored for a smart contract */ export interface MsgClearAdminAmino { /** Sender is the actor that signed the messages */ - sender: string; + sender?: string; /** Contract is the address of the smart contract */ - contract: string; + contract?: string; } export interface MsgClearAdminAminoMsg { type: "wasm/MsgClearAdmin"; @@ -467,7 +468,7 @@ export interface MsgUpdateInstantiateConfig { /** CodeID references the stored WASM code */ codeId: bigint; /** NewInstantiatePermission is the new access control */ - newInstantiatePermission: AccessConfig; + newInstantiatePermission?: AccessConfig; } export interface MsgUpdateInstantiateConfigProtoMsg { typeUrl: "/cosmwasm.wasm.v1.MsgUpdateInstantiateConfig"; @@ -476,9 +477,9 @@ export interface MsgUpdateInstantiateConfigProtoMsg { /** MsgUpdateInstantiateConfig updates instantiate config for a smart contract */ export interface MsgUpdateInstantiateConfigAmino { /** Sender is the that actor that signed the messages */ - sender: string; + sender?: string; /** CodeID references the stored WASM code */ - code_id: string; + code_id?: string; /** NewInstantiatePermission is the new access control */ new_instantiate_permission?: AccessConfigAmino; } @@ -490,7 +491,7 @@ export interface MsgUpdateInstantiateConfigAminoMsg { export interface MsgUpdateInstantiateConfigSDKType { sender: string; code_id: bigint; - new_instantiate_permission: AccessConfigSDKType; + new_instantiate_permission?: AccessConfigSDKType; } /** MsgUpdateInstantiateConfigResponse returns empty data */ export interface MsgUpdateInstantiateConfigResponse {} @@ -506,227 +507,2375 @@ export interface MsgUpdateInstantiateConfigResponseAminoMsg { } /** MsgUpdateInstantiateConfigResponse returns empty data */ export interface MsgUpdateInstantiateConfigResponseSDKType {} -function createBaseMsgStoreCode(): MsgStoreCode { - return { - sender: "", - wasmByteCode: new Uint8Array(), - instantiatePermission: AccessConfig.fromPartial({}) - }; +/** + * MsgUpdateParams is the MsgUpdateParams request type. + * + * Since: 0.40 + */ +export interface MsgUpdateParams { + /** Authority is the address of the governance account. */ + authority: string; + /** + * params defines the x/wasm parameters to update. + * + * NOTE: All parameters must be supplied. + */ + params: Params; } -export const MsgStoreCode = { - typeUrl: "/cosmwasm.wasm.v1.MsgStoreCode", - encode(message: MsgStoreCode, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { - if (message.sender !== "") { - writer.uint32(10).string(message.sender); - } - if (message.wasmByteCode.length !== 0) { - writer.uint32(18).bytes(message.wasmByteCode); - } - if (message.instantiatePermission !== undefined) { - AccessConfig.encode(message.instantiatePermission, writer.uint32(42).fork()).ldelim(); - } - return writer; - }, - decode(input: BinaryReader | Uint8Array, length?: number): MsgStoreCode { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseMsgStoreCode(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.sender = reader.string(); - break; - case 2: - message.wasmByteCode = reader.bytes(); - break; - case 5: - message.instantiatePermission = AccessConfig.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - fromPartial(object: Partial): MsgStoreCode { - const message = createBaseMsgStoreCode(); - message.sender = object.sender ?? ""; - message.wasmByteCode = object.wasmByteCode ?? new Uint8Array(); - message.instantiatePermission = object.instantiatePermission !== undefined && object.instantiatePermission !== null ? AccessConfig.fromPartial(object.instantiatePermission) : undefined; - return message; - }, - fromAmino(object: MsgStoreCodeAmino): MsgStoreCode { - return { - sender: object.sender, - wasmByteCode: fromBase64(object.wasm_byte_code), - instantiatePermission: object?.instantiate_permission ? AccessConfig.fromAmino(object.instantiate_permission) : undefined - }; - }, - toAmino(message: MsgStoreCode): MsgStoreCodeAmino { - const obj: any = {}; - obj.sender = message.sender; - obj.wasm_byte_code = message.wasmByteCode ? toBase64(message.wasmByteCode) : undefined; - obj.instantiate_permission = message.instantiatePermission ? AccessConfig.toAmino(message.instantiatePermission) : undefined; - return obj; - }, - fromAminoMsg(object: MsgStoreCodeAminoMsg): MsgStoreCode { - return MsgStoreCode.fromAmino(object.value); - }, - toAminoMsg(message: MsgStoreCode): MsgStoreCodeAminoMsg { - return { - type: "wasm/MsgStoreCode", - value: MsgStoreCode.toAmino(message) - }; - }, - fromProtoMsg(message: MsgStoreCodeProtoMsg): MsgStoreCode { - return MsgStoreCode.decode(message.value); - }, - toProto(message: MsgStoreCode): Uint8Array { - return MsgStoreCode.encode(message).finish(); - }, - toProtoMsg(message: MsgStoreCode): MsgStoreCodeProtoMsg { - return { - typeUrl: "/cosmwasm.wasm.v1.MsgStoreCode", - value: MsgStoreCode.encode(message).finish() - }; - } -}; -function createBaseMsgStoreCodeResponse(): MsgStoreCodeResponse { - return { - codeId: BigInt(0), - checksum: new Uint8Array() - }; +export interface MsgUpdateParamsProtoMsg { + typeUrl: "/cosmwasm.wasm.v1.MsgUpdateParams"; + value: Uint8Array; } -export const MsgStoreCodeResponse = { - typeUrl: "/cosmwasm.wasm.v1.MsgStoreCodeResponse", - encode(message: MsgStoreCodeResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { - if (message.codeId !== BigInt(0)) { - writer.uint32(8).uint64(message.codeId); - } - if (message.checksum.length !== 0) { - writer.uint32(18).bytes(message.checksum); - } - return writer; - }, - decode(input: BinaryReader | Uint8Array, length?: number): MsgStoreCodeResponse { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseMsgStoreCodeResponse(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.codeId = reader.uint64(); - break; - case 2: - message.checksum = reader.bytes(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - fromPartial(object: Partial): MsgStoreCodeResponse { - const message = createBaseMsgStoreCodeResponse(); - message.codeId = object.codeId !== undefined && object.codeId !== null ? BigInt(object.codeId.toString()) : BigInt(0); - message.checksum = object.checksum ?? new Uint8Array(); - return message; - }, - fromAmino(object: MsgStoreCodeResponseAmino): MsgStoreCodeResponse { - return { - codeId: BigInt(object.code_id), - checksum: object.checksum - }; - }, - toAmino(message: MsgStoreCodeResponse): MsgStoreCodeResponseAmino { - const obj: any = {}; - obj.code_id = message.codeId ? message.codeId.toString() : undefined; - obj.checksum = message.checksum; - return obj; - }, - fromAminoMsg(object: MsgStoreCodeResponseAminoMsg): MsgStoreCodeResponse { - return MsgStoreCodeResponse.fromAmino(object.value); - }, - toAminoMsg(message: MsgStoreCodeResponse): MsgStoreCodeResponseAminoMsg { - return { - type: "wasm/MsgStoreCodeResponse", - value: MsgStoreCodeResponse.toAmino(message) - }; - }, - fromProtoMsg(message: MsgStoreCodeResponseProtoMsg): MsgStoreCodeResponse { - return MsgStoreCodeResponse.decode(message.value); - }, - toProto(message: MsgStoreCodeResponse): Uint8Array { - return MsgStoreCodeResponse.encode(message).finish(); - }, - toProtoMsg(message: MsgStoreCodeResponse): MsgStoreCodeResponseProtoMsg { - return { - typeUrl: "/cosmwasm.wasm.v1.MsgStoreCodeResponse", - value: MsgStoreCodeResponse.encode(message).finish() - }; - } -}; -function createBaseMsgInstantiateContract(): MsgInstantiateContract { - return { - sender: "", - admin: "", - codeId: BigInt(0), - label: "", - msg: new Uint8Array(), - funds: [] - }; +/** + * MsgUpdateParams is the MsgUpdateParams request type. + * + * Since: 0.40 + */ +export interface MsgUpdateParamsAmino { + /** Authority is the address of the governance account. */ + authority?: string; + /** + * params defines the x/wasm parameters to update. + * + * NOTE: All parameters must be supplied. + */ + params: ParamsAmino; } -export const MsgInstantiateContract = { - typeUrl: "/cosmwasm.wasm.v1.MsgInstantiateContract", - encode(message: MsgInstantiateContract, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { +export interface MsgUpdateParamsAminoMsg { + type: "wasm/MsgUpdateParams"; + value: MsgUpdateParamsAmino; +} +/** + * MsgUpdateParams is the MsgUpdateParams request type. + * + * Since: 0.40 + */ +export interface MsgUpdateParamsSDKType { + authority: string; + params: ParamsSDKType; +} +/** + * MsgUpdateParamsResponse defines the response structure for executing a + * MsgUpdateParams message. + * + * Since: 0.40 + */ +export interface MsgUpdateParamsResponse {} +export interface MsgUpdateParamsResponseProtoMsg { + typeUrl: "/cosmwasm.wasm.v1.MsgUpdateParamsResponse"; + value: Uint8Array; +} +/** + * MsgUpdateParamsResponse defines the response structure for executing a + * MsgUpdateParams message. + * + * Since: 0.40 + */ +export interface MsgUpdateParamsResponseAmino {} +export interface MsgUpdateParamsResponseAminoMsg { + type: "wasm/MsgUpdateParamsResponse"; + value: MsgUpdateParamsResponseAmino; +} +/** + * MsgUpdateParamsResponse defines the response structure for executing a + * MsgUpdateParams message. + * + * Since: 0.40 + */ +export interface MsgUpdateParamsResponseSDKType {} +/** + * MsgSudoContract is the MsgSudoContract request type. + * + * Since: 0.40 + */ +export interface MsgSudoContract { + /** Authority is the address of the governance account. */ + authority: string; + /** Contract is the address of the smart contract */ + contract: string; + /** Msg json encoded message to be passed to the contract as sudo */ + msg: Uint8Array; +} +export interface MsgSudoContractProtoMsg { + typeUrl: "/cosmwasm.wasm.v1.MsgSudoContract"; + value: Uint8Array; +} +/** + * MsgSudoContract is the MsgSudoContract request type. + * + * Since: 0.40 + */ +export interface MsgSudoContractAmino { + /** Authority is the address of the governance account. */ + authority?: string; + /** Contract is the address of the smart contract */ + contract?: string; + /** Msg json encoded message to be passed to the contract as sudo */ + msg?: any; +} +export interface MsgSudoContractAminoMsg { + type: "wasm/MsgSudoContract"; + value: MsgSudoContractAmino; +} +/** + * MsgSudoContract is the MsgSudoContract request type. + * + * Since: 0.40 + */ +export interface MsgSudoContractSDKType { + authority: string; + contract: string; + msg: Uint8Array; +} +/** + * MsgSudoContractResponse defines the response structure for executing a + * MsgSudoContract message. + * + * Since: 0.40 + */ +export interface MsgSudoContractResponse { + /** Data contains bytes to returned from the contract */ + data: Uint8Array; +} +export interface MsgSudoContractResponseProtoMsg { + typeUrl: "/cosmwasm.wasm.v1.MsgSudoContractResponse"; + value: Uint8Array; +} +/** + * MsgSudoContractResponse defines the response structure for executing a + * MsgSudoContract message. + * + * Since: 0.40 + */ +export interface MsgSudoContractResponseAmino { + /** Data contains bytes to returned from the contract */ + data?: string; +} +export interface MsgSudoContractResponseAminoMsg { + type: "wasm/MsgSudoContractResponse"; + value: MsgSudoContractResponseAmino; +} +/** + * MsgSudoContractResponse defines the response structure for executing a + * MsgSudoContract message. + * + * Since: 0.40 + */ +export interface MsgSudoContractResponseSDKType { + data: Uint8Array; +} +/** + * MsgPinCodes is the MsgPinCodes request type. + * + * Since: 0.40 + */ +export interface MsgPinCodes { + /** Authority is the address of the governance account. */ + authority: string; + /** CodeIDs references the new WASM codes */ + codeIds: bigint[]; +} +export interface MsgPinCodesProtoMsg { + typeUrl: "/cosmwasm.wasm.v1.MsgPinCodes"; + value: Uint8Array; +} +/** + * MsgPinCodes is the MsgPinCodes request type. + * + * Since: 0.40 + */ +export interface MsgPinCodesAmino { + /** Authority is the address of the governance account. */ + authority?: string; + /** CodeIDs references the new WASM codes */ + code_ids?: string[]; +} +export interface MsgPinCodesAminoMsg { + type: "wasm/MsgPinCodes"; + value: MsgPinCodesAmino; +} +/** + * MsgPinCodes is the MsgPinCodes request type. + * + * Since: 0.40 + */ +export interface MsgPinCodesSDKType { + authority: string; + code_ids: bigint[]; +} +/** + * MsgPinCodesResponse defines the response structure for executing a + * MsgPinCodes message. + * + * Since: 0.40 + */ +export interface MsgPinCodesResponse {} +export interface MsgPinCodesResponseProtoMsg { + typeUrl: "/cosmwasm.wasm.v1.MsgPinCodesResponse"; + value: Uint8Array; +} +/** + * MsgPinCodesResponse defines the response structure for executing a + * MsgPinCodes message. + * + * Since: 0.40 + */ +export interface MsgPinCodesResponseAmino {} +export interface MsgPinCodesResponseAminoMsg { + type: "wasm/MsgPinCodesResponse"; + value: MsgPinCodesResponseAmino; +} +/** + * MsgPinCodesResponse defines the response structure for executing a + * MsgPinCodes message. + * + * Since: 0.40 + */ +export interface MsgPinCodesResponseSDKType {} +/** + * MsgUnpinCodes is the MsgUnpinCodes request type. + * + * Since: 0.40 + */ +export interface MsgUnpinCodes { + /** Authority is the address of the governance account. */ + authority: string; + /** CodeIDs references the WASM codes */ + codeIds: bigint[]; +} +export interface MsgUnpinCodesProtoMsg { + typeUrl: "/cosmwasm.wasm.v1.MsgUnpinCodes"; + value: Uint8Array; +} +/** + * MsgUnpinCodes is the MsgUnpinCodes request type. + * + * Since: 0.40 + */ +export interface MsgUnpinCodesAmino { + /** Authority is the address of the governance account. */ + authority?: string; + /** CodeIDs references the WASM codes */ + code_ids?: string[]; +} +export interface MsgUnpinCodesAminoMsg { + type: "wasm/MsgUnpinCodes"; + value: MsgUnpinCodesAmino; +} +/** + * MsgUnpinCodes is the MsgUnpinCodes request type. + * + * Since: 0.40 + */ +export interface MsgUnpinCodesSDKType { + authority: string; + code_ids: bigint[]; +} +/** + * MsgUnpinCodesResponse defines the response structure for executing a + * MsgUnpinCodes message. + * + * Since: 0.40 + */ +export interface MsgUnpinCodesResponse {} +export interface MsgUnpinCodesResponseProtoMsg { + typeUrl: "/cosmwasm.wasm.v1.MsgUnpinCodesResponse"; + value: Uint8Array; +} +/** + * MsgUnpinCodesResponse defines the response structure for executing a + * MsgUnpinCodes message. + * + * Since: 0.40 + */ +export interface MsgUnpinCodesResponseAmino {} +export interface MsgUnpinCodesResponseAminoMsg { + type: "wasm/MsgUnpinCodesResponse"; + value: MsgUnpinCodesResponseAmino; +} +/** + * MsgUnpinCodesResponse defines the response structure for executing a + * MsgUnpinCodes message. + * + * Since: 0.40 + */ +export interface MsgUnpinCodesResponseSDKType {} +/** + * MsgStoreAndInstantiateContract is the MsgStoreAndInstantiateContract + * request type. + * + * Since: 0.40 + */ +export interface MsgStoreAndInstantiateContract { + /** Authority is the address of the governance account. */ + authority: string; + /** WASMByteCode can be raw or gzip compressed */ + wasmByteCode: Uint8Array; + /** InstantiatePermission to apply on contract creation, optional */ + instantiatePermission?: AccessConfig; + /** + * UnpinCode code on upload, optional. As default the uploaded contract is + * pinned to cache. + */ + unpinCode: boolean; + /** Admin is an optional address that can execute migrations */ + admin: string; + /** Label is optional metadata to be stored with a constract instance. */ + label: string; + /** Msg json encoded message to be passed to the contract on instantiation */ + msg: Uint8Array; + /** + * Funds coins that are transferred from the authority account to the contract + * on instantiation + */ + funds: Coin[]; + /** Source is the URL where the code is hosted */ + source: string; + /** + * Builder is the docker image used to build the code deterministically, used + * for smart contract verification + */ + builder: string; + /** + * CodeHash is the SHA256 sum of the code outputted by builder, used for smart + * contract verification + */ + codeHash: Uint8Array; +} +export interface MsgStoreAndInstantiateContractProtoMsg { + typeUrl: "/cosmwasm.wasm.v1.MsgStoreAndInstantiateContract"; + value: Uint8Array; +} +/** + * MsgStoreAndInstantiateContract is the MsgStoreAndInstantiateContract + * request type. + * + * Since: 0.40 + */ +export interface MsgStoreAndInstantiateContractAmino { + /** Authority is the address of the governance account. */ + authority?: string; + /** WASMByteCode can be raw or gzip compressed */ + wasm_byte_code?: string; + /** InstantiatePermission to apply on contract creation, optional */ + instantiate_permission?: AccessConfigAmino; + /** + * UnpinCode code on upload, optional. As default the uploaded contract is + * pinned to cache. + */ + unpin_code?: boolean; + /** Admin is an optional address that can execute migrations */ + admin?: string; + /** Label is optional metadata to be stored with a constract instance. */ + label?: string; + /** Msg json encoded message to be passed to the contract on instantiation */ + msg?: any; + /** + * Funds coins that are transferred from the authority account to the contract + * on instantiation + */ + funds: CoinAmino[]; + /** Source is the URL where the code is hosted */ + source?: string; + /** + * Builder is the docker image used to build the code deterministically, used + * for smart contract verification + */ + builder?: string; + /** + * CodeHash is the SHA256 sum of the code outputted by builder, used for smart + * contract verification + */ + code_hash?: string; +} +export interface MsgStoreAndInstantiateContractAminoMsg { + type: "wasm/MsgStoreAndInstantiateContract"; + value: MsgStoreAndInstantiateContractAmino; +} +/** + * MsgStoreAndInstantiateContract is the MsgStoreAndInstantiateContract + * request type. + * + * Since: 0.40 + */ +export interface MsgStoreAndInstantiateContractSDKType { + authority: string; + wasm_byte_code: Uint8Array; + instantiate_permission?: AccessConfigSDKType; + unpin_code: boolean; + admin: string; + label: string; + msg: Uint8Array; + funds: CoinSDKType[]; + source: string; + builder: string; + code_hash: Uint8Array; +} +/** + * MsgStoreAndInstantiateContractResponse defines the response structure + * for executing a MsgStoreAndInstantiateContract message. + * + * Since: 0.40 + */ +export interface MsgStoreAndInstantiateContractResponse { + /** Address is the bech32 address of the new contract instance. */ + address: string; + /** Data contains bytes to returned from the contract */ + data: Uint8Array; +} +export interface MsgStoreAndInstantiateContractResponseProtoMsg { + typeUrl: "/cosmwasm.wasm.v1.MsgStoreAndInstantiateContractResponse"; + value: Uint8Array; +} +/** + * MsgStoreAndInstantiateContractResponse defines the response structure + * for executing a MsgStoreAndInstantiateContract message. + * + * Since: 0.40 + */ +export interface MsgStoreAndInstantiateContractResponseAmino { + /** Address is the bech32 address of the new contract instance. */ + address?: string; + /** Data contains bytes to returned from the contract */ + data?: string; +} +export interface MsgStoreAndInstantiateContractResponseAminoMsg { + type: "wasm/MsgStoreAndInstantiateContractResponse"; + value: MsgStoreAndInstantiateContractResponseAmino; +} +/** + * MsgStoreAndInstantiateContractResponse defines the response structure + * for executing a MsgStoreAndInstantiateContract message. + * + * Since: 0.40 + */ +export interface MsgStoreAndInstantiateContractResponseSDKType { + address: string; + data: Uint8Array; +} +/** + * MsgAddCodeUploadParamsAddresses is the + * MsgAddCodeUploadParamsAddresses request type. + */ +export interface MsgAddCodeUploadParamsAddresses { + /** Authority is the address of the governance account. */ + authority: string; + addresses: string[]; +} +export interface MsgAddCodeUploadParamsAddressesProtoMsg { + typeUrl: "/cosmwasm.wasm.v1.MsgAddCodeUploadParamsAddresses"; + value: Uint8Array; +} +/** + * MsgAddCodeUploadParamsAddresses is the + * MsgAddCodeUploadParamsAddresses request type. + */ +export interface MsgAddCodeUploadParamsAddressesAmino { + /** Authority is the address of the governance account. */ + authority?: string; + addresses?: string[]; +} +export interface MsgAddCodeUploadParamsAddressesAminoMsg { + type: "wasm/MsgAddCodeUploadParamsAddresses"; + value: MsgAddCodeUploadParamsAddressesAmino; +} +/** + * MsgAddCodeUploadParamsAddresses is the + * MsgAddCodeUploadParamsAddresses request type. + */ +export interface MsgAddCodeUploadParamsAddressesSDKType { + authority: string; + addresses: string[]; +} +/** + * MsgAddCodeUploadParamsAddressesResponse defines the response + * structure for executing a MsgAddCodeUploadParamsAddresses message. + */ +export interface MsgAddCodeUploadParamsAddressesResponse {} +export interface MsgAddCodeUploadParamsAddressesResponseProtoMsg { + typeUrl: "/cosmwasm.wasm.v1.MsgAddCodeUploadParamsAddressesResponse"; + value: Uint8Array; +} +/** + * MsgAddCodeUploadParamsAddressesResponse defines the response + * structure for executing a MsgAddCodeUploadParamsAddresses message. + */ +export interface MsgAddCodeUploadParamsAddressesResponseAmino {} +export interface MsgAddCodeUploadParamsAddressesResponseAminoMsg { + type: "wasm/MsgAddCodeUploadParamsAddressesResponse"; + value: MsgAddCodeUploadParamsAddressesResponseAmino; +} +/** + * MsgAddCodeUploadParamsAddressesResponse defines the response + * structure for executing a MsgAddCodeUploadParamsAddresses message. + */ +export interface MsgAddCodeUploadParamsAddressesResponseSDKType {} +/** + * MsgRemoveCodeUploadParamsAddresses is the + * MsgRemoveCodeUploadParamsAddresses request type. + */ +export interface MsgRemoveCodeUploadParamsAddresses { + /** Authority is the address of the governance account. */ + authority: string; + addresses: string[]; +} +export interface MsgRemoveCodeUploadParamsAddressesProtoMsg { + typeUrl: "/cosmwasm.wasm.v1.MsgRemoveCodeUploadParamsAddresses"; + value: Uint8Array; +} +/** + * MsgRemoveCodeUploadParamsAddresses is the + * MsgRemoveCodeUploadParamsAddresses request type. + */ +export interface MsgRemoveCodeUploadParamsAddressesAmino { + /** Authority is the address of the governance account. */ + authority?: string; + addresses?: string[]; +} +export interface MsgRemoveCodeUploadParamsAddressesAminoMsg { + type: "wasm/MsgRemoveCodeUploadParamsAddresses"; + value: MsgRemoveCodeUploadParamsAddressesAmino; +} +/** + * MsgRemoveCodeUploadParamsAddresses is the + * MsgRemoveCodeUploadParamsAddresses request type. + */ +export interface MsgRemoveCodeUploadParamsAddressesSDKType { + authority: string; + addresses: string[]; +} +/** + * MsgRemoveCodeUploadParamsAddressesResponse defines the response + * structure for executing a MsgRemoveCodeUploadParamsAddresses message. + */ +export interface MsgRemoveCodeUploadParamsAddressesResponse {} +export interface MsgRemoveCodeUploadParamsAddressesResponseProtoMsg { + typeUrl: "/cosmwasm.wasm.v1.MsgRemoveCodeUploadParamsAddressesResponse"; + value: Uint8Array; +} +/** + * MsgRemoveCodeUploadParamsAddressesResponse defines the response + * structure for executing a MsgRemoveCodeUploadParamsAddresses message. + */ +export interface MsgRemoveCodeUploadParamsAddressesResponseAmino {} +export interface MsgRemoveCodeUploadParamsAddressesResponseAminoMsg { + type: "wasm/MsgRemoveCodeUploadParamsAddressesResponse"; + value: MsgRemoveCodeUploadParamsAddressesResponseAmino; +} +/** + * MsgRemoveCodeUploadParamsAddressesResponse defines the response + * structure for executing a MsgRemoveCodeUploadParamsAddresses message. + */ +export interface MsgRemoveCodeUploadParamsAddressesResponseSDKType {} +/** + * MsgStoreAndMigrateContract is the MsgStoreAndMigrateContract + * request type. + * + * Since: 0.42 + */ +export interface MsgStoreAndMigrateContract { + /** Authority is the address of the governance account. */ + authority: string; + /** WASMByteCode can be raw or gzip compressed */ + wasmByteCode: Uint8Array; + /** InstantiatePermission to apply on contract creation, optional */ + instantiatePermission?: AccessConfig; + /** Contract is the address of the smart contract */ + contract: string; + /** Msg json encoded message to be passed to the contract on migration */ + msg: Uint8Array; +} +export interface MsgStoreAndMigrateContractProtoMsg { + typeUrl: "/cosmwasm.wasm.v1.MsgStoreAndMigrateContract"; + value: Uint8Array; +} +/** + * MsgStoreAndMigrateContract is the MsgStoreAndMigrateContract + * request type. + * + * Since: 0.42 + */ +export interface MsgStoreAndMigrateContractAmino { + /** Authority is the address of the governance account. */ + authority?: string; + /** WASMByteCode can be raw or gzip compressed */ + wasm_byte_code?: string; + /** InstantiatePermission to apply on contract creation, optional */ + instantiate_permission?: AccessConfigAmino; + /** Contract is the address of the smart contract */ + contract?: string; + /** Msg json encoded message to be passed to the contract on migration */ + msg?: any; +} +export interface MsgStoreAndMigrateContractAminoMsg { + type: "wasm/MsgStoreAndMigrateContract"; + value: MsgStoreAndMigrateContractAmino; +} +/** + * MsgStoreAndMigrateContract is the MsgStoreAndMigrateContract + * request type. + * + * Since: 0.42 + */ +export interface MsgStoreAndMigrateContractSDKType { + authority: string; + wasm_byte_code: Uint8Array; + instantiate_permission?: AccessConfigSDKType; + contract: string; + msg: Uint8Array; +} +/** + * MsgStoreAndMigrateContractResponse defines the response structure + * for executing a MsgStoreAndMigrateContract message. + * + * Since: 0.42 + */ +export interface MsgStoreAndMigrateContractResponse { + /** CodeID is the reference to the stored WASM code */ + codeId: bigint; + /** Checksum is the sha256 hash of the stored code */ + checksum: Uint8Array; + /** Data contains bytes to returned from the contract */ + data: Uint8Array; +} +export interface MsgStoreAndMigrateContractResponseProtoMsg { + typeUrl: "/cosmwasm.wasm.v1.MsgStoreAndMigrateContractResponse"; + value: Uint8Array; +} +/** + * MsgStoreAndMigrateContractResponse defines the response structure + * for executing a MsgStoreAndMigrateContract message. + * + * Since: 0.42 + */ +export interface MsgStoreAndMigrateContractResponseAmino { + /** CodeID is the reference to the stored WASM code */ + code_id?: string; + /** Checksum is the sha256 hash of the stored code */ + checksum?: string; + /** Data contains bytes to returned from the contract */ + data?: string; +} +export interface MsgStoreAndMigrateContractResponseAminoMsg { + type: "wasm/MsgStoreAndMigrateContractResponse"; + value: MsgStoreAndMigrateContractResponseAmino; +} +/** + * MsgStoreAndMigrateContractResponse defines the response structure + * for executing a MsgStoreAndMigrateContract message. + * + * Since: 0.42 + */ +export interface MsgStoreAndMigrateContractResponseSDKType { + code_id: bigint; + checksum: Uint8Array; + data: Uint8Array; +} +/** MsgUpdateContractLabel sets a new label for a smart contract */ +export interface MsgUpdateContractLabel { + /** Sender is the that actor that signed the messages */ + sender: string; + /** NewLabel string to be set */ + newLabel: string; + /** Contract is the address of the smart contract */ + contract: string; +} +export interface MsgUpdateContractLabelProtoMsg { + typeUrl: "/cosmwasm.wasm.v1.MsgUpdateContractLabel"; + value: Uint8Array; +} +/** MsgUpdateContractLabel sets a new label for a smart contract */ +export interface MsgUpdateContractLabelAmino { + /** Sender is the that actor that signed the messages */ + sender?: string; + /** NewLabel string to be set */ + new_label?: string; + /** Contract is the address of the smart contract */ + contract?: string; +} +export interface MsgUpdateContractLabelAminoMsg { + type: "wasm/MsgUpdateContractLabel"; + value: MsgUpdateContractLabelAmino; +} +/** MsgUpdateContractLabel sets a new label for a smart contract */ +export interface MsgUpdateContractLabelSDKType { + sender: string; + new_label: string; + contract: string; +} +/** MsgUpdateContractLabelResponse returns empty data */ +export interface MsgUpdateContractLabelResponse {} +export interface MsgUpdateContractLabelResponseProtoMsg { + typeUrl: "/cosmwasm.wasm.v1.MsgUpdateContractLabelResponse"; + value: Uint8Array; +} +/** MsgUpdateContractLabelResponse returns empty data */ +export interface MsgUpdateContractLabelResponseAmino {} +export interface MsgUpdateContractLabelResponseAminoMsg { + type: "wasm/MsgUpdateContractLabelResponse"; + value: MsgUpdateContractLabelResponseAmino; +} +/** MsgUpdateContractLabelResponse returns empty data */ +export interface MsgUpdateContractLabelResponseSDKType {} +function createBaseMsgStoreCode(): MsgStoreCode { + return { + sender: "", + wasmByteCode: new Uint8Array(), + instantiatePermission: undefined + }; +} +export const MsgStoreCode = { + typeUrl: "/cosmwasm.wasm.v1.MsgStoreCode", + encode(message: MsgStoreCode, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.sender !== "") { + writer.uint32(10).string(message.sender); + } + if (message.wasmByteCode.length !== 0) { + writer.uint32(18).bytes(message.wasmByteCode); + } + if (message.instantiatePermission !== undefined) { + AccessConfig.encode(message.instantiatePermission, writer.uint32(42).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgStoreCode { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgStoreCode(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.sender = reader.string(); + break; + case 2: + message.wasmByteCode = reader.bytes(); + break; + case 5: + message.instantiatePermission = AccessConfig.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgStoreCode { + const message = createBaseMsgStoreCode(); + message.sender = object.sender ?? ""; + message.wasmByteCode = object.wasmByteCode ?? new Uint8Array(); + message.instantiatePermission = object.instantiatePermission !== undefined && object.instantiatePermission !== null ? AccessConfig.fromPartial(object.instantiatePermission) : undefined; + return message; + }, + fromAmino(object: MsgStoreCodeAmino): MsgStoreCode { + const message = createBaseMsgStoreCode(); + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + if (object.wasm_byte_code !== undefined && object.wasm_byte_code !== null) { + message.wasmByteCode = fromBase64(object.wasm_byte_code); + } + if (object.instantiate_permission !== undefined && object.instantiate_permission !== null) { + message.instantiatePermission = AccessConfig.fromAmino(object.instantiate_permission); + } + return message; + }, + toAmino(message: MsgStoreCode): MsgStoreCodeAmino { + const obj: any = {}; + obj.sender = message.sender; + obj.wasm_byte_code = message.wasmByteCode ? toBase64(message.wasmByteCode) : undefined; + obj.instantiate_permission = message.instantiatePermission ? AccessConfig.toAmino(message.instantiatePermission) : undefined; + return obj; + }, + fromAminoMsg(object: MsgStoreCodeAminoMsg): MsgStoreCode { + return MsgStoreCode.fromAmino(object.value); + }, + toAminoMsg(message: MsgStoreCode): MsgStoreCodeAminoMsg { + return { + type: "wasm/MsgStoreCode", + value: MsgStoreCode.toAmino(message) + }; + }, + fromProtoMsg(message: MsgStoreCodeProtoMsg): MsgStoreCode { + return MsgStoreCode.decode(message.value); + }, + toProto(message: MsgStoreCode): Uint8Array { + return MsgStoreCode.encode(message).finish(); + }, + toProtoMsg(message: MsgStoreCode): MsgStoreCodeProtoMsg { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgStoreCode", + value: MsgStoreCode.encode(message).finish() + }; + } +}; +function createBaseMsgStoreCodeResponse(): MsgStoreCodeResponse { + return { + codeId: BigInt(0), + checksum: new Uint8Array() + }; +} +export const MsgStoreCodeResponse = { + typeUrl: "/cosmwasm.wasm.v1.MsgStoreCodeResponse", + encode(message: MsgStoreCodeResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.codeId !== BigInt(0)) { + writer.uint32(8).uint64(message.codeId); + } + if (message.checksum.length !== 0) { + writer.uint32(18).bytes(message.checksum); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgStoreCodeResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgStoreCodeResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.codeId = reader.uint64(); + break; + case 2: + message.checksum = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgStoreCodeResponse { + const message = createBaseMsgStoreCodeResponse(); + message.codeId = object.codeId !== undefined && object.codeId !== null ? BigInt(object.codeId.toString()) : BigInt(0); + message.checksum = object.checksum ?? new Uint8Array(); + return message; + }, + fromAmino(object: MsgStoreCodeResponseAmino): MsgStoreCodeResponse { + const message = createBaseMsgStoreCodeResponse(); + if (object.code_id !== undefined && object.code_id !== null) { + message.codeId = BigInt(object.code_id); + } + if (object.checksum !== undefined && object.checksum !== null) { + message.checksum = bytesFromBase64(object.checksum); + } + return message; + }, + toAmino(message: MsgStoreCodeResponse): MsgStoreCodeResponseAmino { + const obj: any = {}; + obj.code_id = message.codeId ? message.codeId.toString() : undefined; + obj.checksum = message.checksum ? base64FromBytes(message.checksum) : undefined; + return obj; + }, + fromAminoMsg(object: MsgStoreCodeResponseAminoMsg): MsgStoreCodeResponse { + return MsgStoreCodeResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgStoreCodeResponse): MsgStoreCodeResponseAminoMsg { + return { + type: "wasm/MsgStoreCodeResponse", + value: MsgStoreCodeResponse.toAmino(message) + }; + }, + fromProtoMsg(message: MsgStoreCodeResponseProtoMsg): MsgStoreCodeResponse { + return MsgStoreCodeResponse.decode(message.value); + }, + toProto(message: MsgStoreCodeResponse): Uint8Array { + return MsgStoreCodeResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgStoreCodeResponse): MsgStoreCodeResponseProtoMsg { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgStoreCodeResponse", + value: MsgStoreCodeResponse.encode(message).finish() + }; + } +}; +function createBaseMsgInstantiateContract(): MsgInstantiateContract { + return { + sender: "", + admin: "", + codeId: BigInt(0), + label: "", + msg: new Uint8Array(), + funds: [] + }; +} +export const MsgInstantiateContract = { + typeUrl: "/cosmwasm.wasm.v1.MsgInstantiateContract", + encode(message: MsgInstantiateContract, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.sender !== "") { + writer.uint32(10).string(message.sender); + } + if (message.admin !== "") { + writer.uint32(18).string(message.admin); + } + if (message.codeId !== BigInt(0)) { + writer.uint32(24).uint64(message.codeId); + } + if (message.label !== "") { + writer.uint32(34).string(message.label); + } + if (message.msg.length !== 0) { + writer.uint32(42).bytes(message.msg); + } + for (const v of message.funds) { + Coin.encode(v!, writer.uint32(50).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgInstantiateContract { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgInstantiateContract(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.sender = reader.string(); + break; + case 2: + message.admin = reader.string(); + break; + case 3: + message.codeId = reader.uint64(); + break; + case 4: + message.label = reader.string(); + break; + case 5: + message.msg = reader.bytes(); + break; + case 6: + message.funds.push(Coin.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgInstantiateContract { + const message = createBaseMsgInstantiateContract(); + message.sender = object.sender ?? ""; + message.admin = object.admin ?? ""; + message.codeId = object.codeId !== undefined && object.codeId !== null ? BigInt(object.codeId.toString()) : BigInt(0); + message.label = object.label ?? ""; + message.msg = object.msg ?? new Uint8Array(); + message.funds = object.funds?.map(e => Coin.fromPartial(e)) || []; + return message; + }, + fromAmino(object: MsgInstantiateContractAmino): MsgInstantiateContract { + const message = createBaseMsgInstantiateContract(); + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + if (object.admin !== undefined && object.admin !== null) { + message.admin = object.admin; + } + if (object.code_id !== undefined && object.code_id !== null) { + message.codeId = BigInt(object.code_id); + } + if (object.label !== undefined && object.label !== null) { + message.label = object.label; + } + if (object.msg !== undefined && object.msg !== null) { + message.msg = toUtf8(JSON.stringify(object.msg)); + } + message.funds = object.funds?.map(e => Coin.fromAmino(e)) || []; + return message; + }, + toAmino(message: MsgInstantiateContract): MsgInstantiateContractAmino { + const obj: any = {}; + obj.sender = message.sender; + obj.admin = message.admin; + obj.code_id = message.codeId ? message.codeId.toString() : undefined; + obj.label = message.label; + obj.msg = message.msg ? JSON.parse(fromUtf8(message.msg)) : undefined; + if (message.funds) { + obj.funds = message.funds.map(e => e ? Coin.toAmino(e) : undefined); + } else { + obj.funds = []; + } + return obj; + }, + fromAminoMsg(object: MsgInstantiateContractAminoMsg): MsgInstantiateContract { + return MsgInstantiateContract.fromAmino(object.value); + }, + toAminoMsg(message: MsgInstantiateContract): MsgInstantiateContractAminoMsg { + return { + type: "wasm/MsgInstantiateContract", + value: MsgInstantiateContract.toAmino(message) + }; + }, + fromProtoMsg(message: MsgInstantiateContractProtoMsg): MsgInstantiateContract { + return MsgInstantiateContract.decode(message.value); + }, + toProto(message: MsgInstantiateContract): Uint8Array { + return MsgInstantiateContract.encode(message).finish(); + }, + toProtoMsg(message: MsgInstantiateContract): MsgInstantiateContractProtoMsg { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgInstantiateContract", + value: MsgInstantiateContract.encode(message).finish() + }; + } +}; +function createBaseMsgInstantiateContractResponse(): MsgInstantiateContractResponse { + return { + address: "", + data: new Uint8Array() + }; +} +export const MsgInstantiateContractResponse = { + typeUrl: "/cosmwasm.wasm.v1.MsgInstantiateContractResponse", + encode(message: MsgInstantiateContractResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.address !== "") { + writer.uint32(10).string(message.address); + } + if (message.data.length !== 0) { + writer.uint32(18).bytes(message.data); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgInstantiateContractResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgInstantiateContractResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.address = reader.string(); + break; + case 2: + message.data = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgInstantiateContractResponse { + const message = createBaseMsgInstantiateContractResponse(); + message.address = object.address ?? ""; + message.data = object.data ?? new Uint8Array(); + return message; + }, + fromAmino(object: MsgInstantiateContractResponseAmino): MsgInstantiateContractResponse { + const message = createBaseMsgInstantiateContractResponse(); + if (object.address !== undefined && object.address !== null) { + message.address = object.address; + } + if (object.data !== undefined && object.data !== null) { + message.data = bytesFromBase64(object.data); + } + return message; + }, + toAmino(message: MsgInstantiateContractResponse): MsgInstantiateContractResponseAmino { + const obj: any = {}; + obj.address = message.address; + obj.data = message.data ? base64FromBytes(message.data) : undefined; + return obj; + }, + fromAminoMsg(object: MsgInstantiateContractResponseAminoMsg): MsgInstantiateContractResponse { + return MsgInstantiateContractResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgInstantiateContractResponse): MsgInstantiateContractResponseAminoMsg { + return { + type: "wasm/MsgInstantiateContractResponse", + value: MsgInstantiateContractResponse.toAmino(message) + }; + }, + fromProtoMsg(message: MsgInstantiateContractResponseProtoMsg): MsgInstantiateContractResponse { + return MsgInstantiateContractResponse.decode(message.value); + }, + toProto(message: MsgInstantiateContractResponse): Uint8Array { + return MsgInstantiateContractResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgInstantiateContractResponse): MsgInstantiateContractResponseProtoMsg { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgInstantiateContractResponse", + value: MsgInstantiateContractResponse.encode(message).finish() + }; + } +}; +function createBaseMsgInstantiateContract2(): MsgInstantiateContract2 { + return { + sender: "", + admin: "", + codeId: BigInt(0), + label: "", + msg: new Uint8Array(), + funds: [], + salt: new Uint8Array(), + fixMsg: false + }; +} +export const MsgInstantiateContract2 = { + typeUrl: "/cosmwasm.wasm.v1.MsgInstantiateContract2", + encode(message: MsgInstantiateContract2, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.sender !== "") { + writer.uint32(10).string(message.sender); + } + if (message.admin !== "") { + writer.uint32(18).string(message.admin); + } + if (message.codeId !== BigInt(0)) { + writer.uint32(24).uint64(message.codeId); + } + if (message.label !== "") { + writer.uint32(34).string(message.label); + } + if (message.msg.length !== 0) { + writer.uint32(42).bytes(message.msg); + } + for (const v of message.funds) { + Coin.encode(v!, writer.uint32(50).fork()).ldelim(); + } + if (message.salt.length !== 0) { + writer.uint32(58).bytes(message.salt); + } + if (message.fixMsg === true) { + writer.uint32(64).bool(message.fixMsg); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgInstantiateContract2 { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgInstantiateContract2(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.sender = reader.string(); + break; + case 2: + message.admin = reader.string(); + break; + case 3: + message.codeId = reader.uint64(); + break; + case 4: + message.label = reader.string(); + break; + case 5: + message.msg = reader.bytes(); + break; + case 6: + message.funds.push(Coin.decode(reader, reader.uint32())); + break; + case 7: + message.salt = reader.bytes(); + break; + case 8: + message.fixMsg = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgInstantiateContract2 { + const message = createBaseMsgInstantiateContract2(); + message.sender = object.sender ?? ""; + message.admin = object.admin ?? ""; + message.codeId = object.codeId !== undefined && object.codeId !== null ? BigInt(object.codeId.toString()) : BigInt(0); + message.label = object.label ?? ""; + message.msg = object.msg ?? new Uint8Array(); + message.funds = object.funds?.map(e => Coin.fromPartial(e)) || []; + message.salt = object.salt ?? new Uint8Array(); + message.fixMsg = object.fixMsg ?? false; + return message; + }, + fromAmino(object: MsgInstantiateContract2Amino): MsgInstantiateContract2 { + const message = createBaseMsgInstantiateContract2(); + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + if (object.admin !== undefined && object.admin !== null) { + message.admin = object.admin; + } + if (object.code_id !== undefined && object.code_id !== null) { + message.codeId = BigInt(object.code_id); + } + if (object.label !== undefined && object.label !== null) { + message.label = object.label; + } + if (object.msg !== undefined && object.msg !== null) { + message.msg = toUtf8(JSON.stringify(object.msg)); + } + message.funds = object.funds?.map(e => Coin.fromAmino(e)) || []; + if (object.salt !== undefined && object.salt !== null) { + message.salt = bytesFromBase64(object.salt); + } + if (object.fix_msg !== undefined && object.fix_msg !== null) { + message.fixMsg = object.fix_msg; + } + return message; + }, + toAmino(message: MsgInstantiateContract2): MsgInstantiateContract2Amino { + const obj: any = {}; + obj.sender = message.sender; + obj.admin = message.admin; + obj.code_id = message.codeId ? message.codeId.toString() : undefined; + obj.label = message.label; + obj.msg = message.msg ? JSON.parse(fromUtf8(message.msg)) : undefined; + if (message.funds) { + obj.funds = message.funds.map(e => e ? Coin.toAmino(e) : undefined); + } else { + obj.funds = []; + } + obj.salt = message.salt ? base64FromBytes(message.salt) : undefined; + obj.fix_msg = message.fixMsg; + return obj; + }, + fromAminoMsg(object: MsgInstantiateContract2AminoMsg): MsgInstantiateContract2 { + return MsgInstantiateContract2.fromAmino(object.value); + }, + toAminoMsg(message: MsgInstantiateContract2): MsgInstantiateContract2AminoMsg { + return { + type: "wasm/MsgInstantiateContract2", + value: MsgInstantiateContract2.toAmino(message) + }; + }, + fromProtoMsg(message: MsgInstantiateContract2ProtoMsg): MsgInstantiateContract2 { + return MsgInstantiateContract2.decode(message.value); + }, + toProto(message: MsgInstantiateContract2): Uint8Array { + return MsgInstantiateContract2.encode(message).finish(); + }, + toProtoMsg(message: MsgInstantiateContract2): MsgInstantiateContract2ProtoMsg { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgInstantiateContract2", + value: MsgInstantiateContract2.encode(message).finish() + }; + } +}; +function createBaseMsgInstantiateContract2Response(): MsgInstantiateContract2Response { + return { + address: "", + data: new Uint8Array() + }; +} +export const MsgInstantiateContract2Response = { + typeUrl: "/cosmwasm.wasm.v1.MsgInstantiateContract2Response", + encode(message: MsgInstantiateContract2Response, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.address !== "") { + writer.uint32(10).string(message.address); + } + if (message.data.length !== 0) { + writer.uint32(18).bytes(message.data); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgInstantiateContract2Response { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgInstantiateContract2Response(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.address = reader.string(); + break; + case 2: + message.data = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgInstantiateContract2Response { + const message = createBaseMsgInstantiateContract2Response(); + message.address = object.address ?? ""; + message.data = object.data ?? new Uint8Array(); + return message; + }, + fromAmino(object: MsgInstantiateContract2ResponseAmino): MsgInstantiateContract2Response { + const message = createBaseMsgInstantiateContract2Response(); + if (object.address !== undefined && object.address !== null) { + message.address = object.address; + } + if (object.data !== undefined && object.data !== null) { + message.data = bytesFromBase64(object.data); + } + return message; + }, + toAmino(message: MsgInstantiateContract2Response): MsgInstantiateContract2ResponseAmino { + const obj: any = {}; + obj.address = message.address; + obj.data = message.data ? base64FromBytes(message.data) : undefined; + return obj; + }, + fromAminoMsg(object: MsgInstantiateContract2ResponseAminoMsg): MsgInstantiateContract2Response { + return MsgInstantiateContract2Response.fromAmino(object.value); + }, + toAminoMsg(message: MsgInstantiateContract2Response): MsgInstantiateContract2ResponseAminoMsg { + return { + type: "wasm/MsgInstantiateContract2Response", + value: MsgInstantiateContract2Response.toAmino(message) + }; + }, + fromProtoMsg(message: MsgInstantiateContract2ResponseProtoMsg): MsgInstantiateContract2Response { + return MsgInstantiateContract2Response.decode(message.value); + }, + toProto(message: MsgInstantiateContract2Response): Uint8Array { + return MsgInstantiateContract2Response.encode(message).finish(); + }, + toProtoMsg(message: MsgInstantiateContract2Response): MsgInstantiateContract2ResponseProtoMsg { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgInstantiateContract2Response", + value: MsgInstantiateContract2Response.encode(message).finish() + }; + } +}; +function createBaseMsgExecuteContract(): MsgExecuteContract { + return { + sender: "", + contract: "", + msg: new Uint8Array(), + funds: [] + }; +} +export const MsgExecuteContract = { + typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", + encode(message: MsgExecuteContract, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.sender !== "") { + writer.uint32(10).string(message.sender); + } + if (message.contract !== "") { + writer.uint32(18).string(message.contract); + } + if (message.msg.length !== 0) { + writer.uint32(26).bytes(message.msg); + } + for (const v of message.funds) { + Coin.encode(v!, writer.uint32(42).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgExecuteContract { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgExecuteContract(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.sender = reader.string(); + break; + case 2: + message.contract = reader.string(); + break; + case 3: + message.msg = reader.bytes(); + break; + case 5: + message.funds.push(Coin.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgExecuteContract { + const message = createBaseMsgExecuteContract(); + message.sender = object.sender ?? ""; + message.contract = object.contract ?? ""; + message.msg = object.msg ?? new Uint8Array(); + message.funds = object.funds?.map(e => Coin.fromPartial(e)) || []; + return message; + }, + fromAmino(object: MsgExecuteContractAmino): MsgExecuteContract { + const message = createBaseMsgExecuteContract(); + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + if (object.contract !== undefined && object.contract !== null) { + message.contract = object.contract; + } + if (object.msg !== undefined && object.msg !== null) { + message.msg = toUtf8(JSON.stringify(object.msg)); + } + message.funds = object.funds?.map(e => Coin.fromAmino(e)) || []; + return message; + }, + toAmino(message: MsgExecuteContract): MsgExecuteContractAmino { + const obj: any = {}; + obj.sender = message.sender; + obj.contract = message.contract; + obj.msg = message.msg ? JSON.parse(fromUtf8(message.msg)) : undefined; + if (message.funds) { + obj.funds = message.funds.map(e => e ? Coin.toAmino(e) : undefined); + } else { + obj.funds = []; + } + return obj; + }, + fromAminoMsg(object: MsgExecuteContractAminoMsg): MsgExecuteContract { + return MsgExecuteContract.fromAmino(object.value); + }, + toAminoMsg(message: MsgExecuteContract): MsgExecuteContractAminoMsg { + return { + type: "wasm/MsgExecuteContract", + value: MsgExecuteContract.toAmino(message) + }; + }, + fromProtoMsg(message: MsgExecuteContractProtoMsg): MsgExecuteContract { + return MsgExecuteContract.decode(message.value); + }, + toProto(message: MsgExecuteContract): Uint8Array { + return MsgExecuteContract.encode(message).finish(); + }, + toProtoMsg(message: MsgExecuteContract): MsgExecuteContractProtoMsg { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", + value: MsgExecuteContract.encode(message).finish() + }; + } +}; +function createBaseMsgExecuteContractResponse(): MsgExecuteContractResponse { + return { + data: new Uint8Array() + }; +} +export const MsgExecuteContractResponse = { + typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContractResponse", + encode(message: MsgExecuteContractResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.data.length !== 0) { + writer.uint32(10).bytes(message.data); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgExecuteContractResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgExecuteContractResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.data = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgExecuteContractResponse { + const message = createBaseMsgExecuteContractResponse(); + message.data = object.data ?? new Uint8Array(); + return message; + }, + fromAmino(object: MsgExecuteContractResponseAmino): MsgExecuteContractResponse { + const message = createBaseMsgExecuteContractResponse(); + if (object.data !== undefined && object.data !== null) { + message.data = bytesFromBase64(object.data); + } + return message; + }, + toAmino(message: MsgExecuteContractResponse): MsgExecuteContractResponseAmino { + const obj: any = {}; + obj.data = message.data ? base64FromBytes(message.data) : undefined; + return obj; + }, + fromAminoMsg(object: MsgExecuteContractResponseAminoMsg): MsgExecuteContractResponse { + return MsgExecuteContractResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgExecuteContractResponse): MsgExecuteContractResponseAminoMsg { + return { + type: "wasm/MsgExecuteContractResponse", + value: MsgExecuteContractResponse.toAmino(message) + }; + }, + fromProtoMsg(message: MsgExecuteContractResponseProtoMsg): MsgExecuteContractResponse { + return MsgExecuteContractResponse.decode(message.value); + }, + toProto(message: MsgExecuteContractResponse): Uint8Array { + return MsgExecuteContractResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgExecuteContractResponse): MsgExecuteContractResponseProtoMsg { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContractResponse", + value: MsgExecuteContractResponse.encode(message).finish() + }; + } +}; +function createBaseMsgMigrateContract(): MsgMigrateContract { + return { + sender: "", + contract: "", + codeId: BigInt(0), + msg: new Uint8Array() + }; +} +export const MsgMigrateContract = { + typeUrl: "/cosmwasm.wasm.v1.MsgMigrateContract", + encode(message: MsgMigrateContract, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.sender !== "") { + writer.uint32(10).string(message.sender); + } + if (message.contract !== "") { + writer.uint32(18).string(message.contract); + } + if (message.codeId !== BigInt(0)) { + writer.uint32(24).uint64(message.codeId); + } + if (message.msg.length !== 0) { + writer.uint32(34).bytes(message.msg); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgMigrateContract { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgMigrateContract(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.sender = reader.string(); + break; + case 2: + message.contract = reader.string(); + break; + case 3: + message.codeId = reader.uint64(); + break; + case 4: + message.msg = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgMigrateContract { + const message = createBaseMsgMigrateContract(); + message.sender = object.sender ?? ""; + message.contract = object.contract ?? ""; + message.codeId = object.codeId !== undefined && object.codeId !== null ? BigInt(object.codeId.toString()) : BigInt(0); + message.msg = object.msg ?? new Uint8Array(); + return message; + }, + fromAmino(object: MsgMigrateContractAmino): MsgMigrateContract { + const message = createBaseMsgMigrateContract(); + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + if (object.contract !== undefined && object.contract !== null) { + message.contract = object.contract; + } + if (object.code_id !== undefined && object.code_id !== null) { + message.codeId = BigInt(object.code_id); + } + if (object.msg !== undefined && object.msg !== null) { + message.msg = toUtf8(JSON.stringify(object.msg)); + } + return message; + }, + toAmino(message: MsgMigrateContract): MsgMigrateContractAmino { + const obj: any = {}; + obj.sender = message.sender; + obj.contract = message.contract; + obj.code_id = message.codeId ? message.codeId.toString() : undefined; + obj.msg = message.msg ? JSON.parse(fromUtf8(message.msg)) : undefined; + return obj; + }, + fromAminoMsg(object: MsgMigrateContractAminoMsg): MsgMigrateContract { + return MsgMigrateContract.fromAmino(object.value); + }, + toAminoMsg(message: MsgMigrateContract): MsgMigrateContractAminoMsg { + return { + type: "wasm/MsgMigrateContract", + value: MsgMigrateContract.toAmino(message) + }; + }, + fromProtoMsg(message: MsgMigrateContractProtoMsg): MsgMigrateContract { + return MsgMigrateContract.decode(message.value); + }, + toProto(message: MsgMigrateContract): Uint8Array { + return MsgMigrateContract.encode(message).finish(); + }, + toProtoMsg(message: MsgMigrateContract): MsgMigrateContractProtoMsg { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgMigrateContract", + value: MsgMigrateContract.encode(message).finish() + }; + } +}; +function createBaseMsgMigrateContractResponse(): MsgMigrateContractResponse { + return { + data: new Uint8Array() + }; +} +export const MsgMigrateContractResponse = { + typeUrl: "/cosmwasm.wasm.v1.MsgMigrateContractResponse", + encode(message: MsgMigrateContractResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.data.length !== 0) { + writer.uint32(10).bytes(message.data); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgMigrateContractResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgMigrateContractResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.data = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgMigrateContractResponse { + const message = createBaseMsgMigrateContractResponse(); + message.data = object.data ?? new Uint8Array(); + return message; + }, + fromAmino(object: MsgMigrateContractResponseAmino): MsgMigrateContractResponse { + const message = createBaseMsgMigrateContractResponse(); + if (object.data !== undefined && object.data !== null) { + message.data = bytesFromBase64(object.data); + } + return message; + }, + toAmino(message: MsgMigrateContractResponse): MsgMigrateContractResponseAmino { + const obj: any = {}; + obj.data = message.data ? base64FromBytes(message.data) : undefined; + return obj; + }, + fromAminoMsg(object: MsgMigrateContractResponseAminoMsg): MsgMigrateContractResponse { + return MsgMigrateContractResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgMigrateContractResponse): MsgMigrateContractResponseAminoMsg { + return { + type: "wasm/MsgMigrateContractResponse", + value: MsgMigrateContractResponse.toAmino(message) + }; + }, + fromProtoMsg(message: MsgMigrateContractResponseProtoMsg): MsgMigrateContractResponse { + return MsgMigrateContractResponse.decode(message.value); + }, + toProto(message: MsgMigrateContractResponse): Uint8Array { + return MsgMigrateContractResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgMigrateContractResponse): MsgMigrateContractResponseProtoMsg { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgMigrateContractResponse", + value: MsgMigrateContractResponse.encode(message).finish() + }; + } +}; +function createBaseMsgUpdateAdmin(): MsgUpdateAdmin { + return { + sender: "", + newAdmin: "", + contract: "" + }; +} +export const MsgUpdateAdmin = { + typeUrl: "/cosmwasm.wasm.v1.MsgUpdateAdmin", + encode(message: MsgUpdateAdmin, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.sender !== "") { + writer.uint32(10).string(message.sender); + } + if (message.newAdmin !== "") { + writer.uint32(18).string(message.newAdmin); + } + if (message.contract !== "") { + writer.uint32(26).string(message.contract); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgUpdateAdmin { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUpdateAdmin(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.sender = reader.string(); + break; + case 2: + message.newAdmin = reader.string(); + break; + case 3: + message.contract = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgUpdateAdmin { + const message = createBaseMsgUpdateAdmin(); + message.sender = object.sender ?? ""; + message.newAdmin = object.newAdmin ?? ""; + message.contract = object.contract ?? ""; + return message; + }, + fromAmino(object: MsgUpdateAdminAmino): MsgUpdateAdmin { + const message = createBaseMsgUpdateAdmin(); + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + if (object.new_admin !== undefined && object.new_admin !== null) { + message.newAdmin = object.new_admin; + } + if (object.contract !== undefined && object.contract !== null) { + message.contract = object.contract; + } + return message; + }, + toAmino(message: MsgUpdateAdmin): MsgUpdateAdminAmino { + const obj: any = {}; + obj.sender = message.sender; + obj.new_admin = message.newAdmin; + obj.contract = message.contract; + return obj; + }, + fromAminoMsg(object: MsgUpdateAdminAminoMsg): MsgUpdateAdmin { + return MsgUpdateAdmin.fromAmino(object.value); + }, + toAminoMsg(message: MsgUpdateAdmin): MsgUpdateAdminAminoMsg { + return { + type: "wasm/MsgUpdateAdmin", + value: MsgUpdateAdmin.toAmino(message) + }; + }, + fromProtoMsg(message: MsgUpdateAdminProtoMsg): MsgUpdateAdmin { + return MsgUpdateAdmin.decode(message.value); + }, + toProto(message: MsgUpdateAdmin): Uint8Array { + return MsgUpdateAdmin.encode(message).finish(); + }, + toProtoMsg(message: MsgUpdateAdmin): MsgUpdateAdminProtoMsg { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgUpdateAdmin", + value: MsgUpdateAdmin.encode(message).finish() + }; + } +}; +function createBaseMsgUpdateAdminResponse(): MsgUpdateAdminResponse { + return {}; +} +export const MsgUpdateAdminResponse = { + typeUrl: "/cosmwasm.wasm.v1.MsgUpdateAdminResponse", + encode(_: MsgUpdateAdminResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgUpdateAdminResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUpdateAdminResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): MsgUpdateAdminResponse { + const message = createBaseMsgUpdateAdminResponse(); + return message; + }, + fromAmino(_: MsgUpdateAdminResponseAmino): MsgUpdateAdminResponse { + const message = createBaseMsgUpdateAdminResponse(); + return message; + }, + toAmino(_: MsgUpdateAdminResponse): MsgUpdateAdminResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgUpdateAdminResponseAminoMsg): MsgUpdateAdminResponse { + return MsgUpdateAdminResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgUpdateAdminResponse): MsgUpdateAdminResponseAminoMsg { + return { + type: "wasm/MsgUpdateAdminResponse", + value: MsgUpdateAdminResponse.toAmino(message) + }; + }, + fromProtoMsg(message: MsgUpdateAdminResponseProtoMsg): MsgUpdateAdminResponse { + return MsgUpdateAdminResponse.decode(message.value); + }, + toProto(message: MsgUpdateAdminResponse): Uint8Array { + return MsgUpdateAdminResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgUpdateAdminResponse): MsgUpdateAdminResponseProtoMsg { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgUpdateAdminResponse", + value: MsgUpdateAdminResponse.encode(message).finish() + }; + } +}; +function createBaseMsgClearAdmin(): MsgClearAdmin { + return { + sender: "", + contract: "" + }; +} +export const MsgClearAdmin = { + typeUrl: "/cosmwasm.wasm.v1.MsgClearAdmin", + encode(message: MsgClearAdmin, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.sender !== "") { + writer.uint32(10).string(message.sender); + } + if (message.contract !== "") { + writer.uint32(26).string(message.contract); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgClearAdmin { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgClearAdmin(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.sender = reader.string(); + break; + case 3: + message.contract = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgClearAdmin { + const message = createBaseMsgClearAdmin(); + message.sender = object.sender ?? ""; + message.contract = object.contract ?? ""; + return message; + }, + fromAmino(object: MsgClearAdminAmino): MsgClearAdmin { + const message = createBaseMsgClearAdmin(); + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + if (object.contract !== undefined && object.contract !== null) { + message.contract = object.contract; + } + return message; + }, + toAmino(message: MsgClearAdmin): MsgClearAdminAmino { + const obj: any = {}; + obj.sender = message.sender; + obj.contract = message.contract; + return obj; + }, + fromAminoMsg(object: MsgClearAdminAminoMsg): MsgClearAdmin { + return MsgClearAdmin.fromAmino(object.value); + }, + toAminoMsg(message: MsgClearAdmin): MsgClearAdminAminoMsg { + return { + type: "wasm/MsgClearAdmin", + value: MsgClearAdmin.toAmino(message) + }; + }, + fromProtoMsg(message: MsgClearAdminProtoMsg): MsgClearAdmin { + return MsgClearAdmin.decode(message.value); + }, + toProto(message: MsgClearAdmin): Uint8Array { + return MsgClearAdmin.encode(message).finish(); + }, + toProtoMsg(message: MsgClearAdmin): MsgClearAdminProtoMsg { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgClearAdmin", + value: MsgClearAdmin.encode(message).finish() + }; + } +}; +function createBaseMsgClearAdminResponse(): MsgClearAdminResponse { + return {}; +} +export const MsgClearAdminResponse = { + typeUrl: "/cosmwasm.wasm.v1.MsgClearAdminResponse", + encode(_: MsgClearAdminResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgClearAdminResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgClearAdminResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): MsgClearAdminResponse { + const message = createBaseMsgClearAdminResponse(); + return message; + }, + fromAmino(_: MsgClearAdminResponseAmino): MsgClearAdminResponse { + const message = createBaseMsgClearAdminResponse(); + return message; + }, + toAmino(_: MsgClearAdminResponse): MsgClearAdminResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgClearAdminResponseAminoMsg): MsgClearAdminResponse { + return MsgClearAdminResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgClearAdminResponse): MsgClearAdminResponseAminoMsg { + return { + type: "wasm/MsgClearAdminResponse", + value: MsgClearAdminResponse.toAmino(message) + }; + }, + fromProtoMsg(message: MsgClearAdminResponseProtoMsg): MsgClearAdminResponse { + return MsgClearAdminResponse.decode(message.value); + }, + toProto(message: MsgClearAdminResponse): Uint8Array { + return MsgClearAdminResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgClearAdminResponse): MsgClearAdminResponseProtoMsg { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgClearAdminResponse", + value: MsgClearAdminResponse.encode(message).finish() + }; + } +}; +function createBaseMsgUpdateInstantiateConfig(): MsgUpdateInstantiateConfig { + return { + sender: "", + codeId: BigInt(0), + newInstantiatePermission: undefined + }; +} +export const MsgUpdateInstantiateConfig = { + typeUrl: "/cosmwasm.wasm.v1.MsgUpdateInstantiateConfig", + encode(message: MsgUpdateInstantiateConfig, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.sender !== "") { writer.uint32(10).string(message.sender); } - if (message.admin !== "") { - writer.uint32(18).string(message.admin); - } if (message.codeId !== BigInt(0)) { - writer.uint32(24).uint64(message.codeId); + writer.uint32(16).uint64(message.codeId); } - if (message.label !== "") { - writer.uint32(34).string(message.label); + if (message.newInstantiatePermission !== undefined) { + AccessConfig.encode(message.newInstantiatePermission, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgUpdateInstantiateConfig { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUpdateInstantiateConfig(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.sender = reader.string(); + break; + case 2: + message.codeId = reader.uint64(); + break; + case 3: + message.newInstantiatePermission = AccessConfig.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgUpdateInstantiateConfig { + const message = createBaseMsgUpdateInstantiateConfig(); + message.sender = object.sender ?? ""; + message.codeId = object.codeId !== undefined && object.codeId !== null ? BigInt(object.codeId.toString()) : BigInt(0); + message.newInstantiatePermission = object.newInstantiatePermission !== undefined && object.newInstantiatePermission !== null ? AccessConfig.fromPartial(object.newInstantiatePermission) : undefined; + return message; + }, + fromAmino(object: MsgUpdateInstantiateConfigAmino): MsgUpdateInstantiateConfig { + const message = createBaseMsgUpdateInstantiateConfig(); + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + if (object.code_id !== undefined && object.code_id !== null) { + message.codeId = BigInt(object.code_id); + } + if (object.new_instantiate_permission !== undefined && object.new_instantiate_permission !== null) { + message.newInstantiatePermission = AccessConfig.fromAmino(object.new_instantiate_permission); + } + return message; + }, + toAmino(message: MsgUpdateInstantiateConfig): MsgUpdateInstantiateConfigAmino { + const obj: any = {}; + obj.sender = message.sender; + obj.code_id = message.codeId ? message.codeId.toString() : undefined; + obj.new_instantiate_permission = message.newInstantiatePermission ? AccessConfig.toAmino(message.newInstantiatePermission) : undefined; + return obj; + }, + fromAminoMsg(object: MsgUpdateInstantiateConfigAminoMsg): MsgUpdateInstantiateConfig { + return MsgUpdateInstantiateConfig.fromAmino(object.value); + }, + toAminoMsg(message: MsgUpdateInstantiateConfig): MsgUpdateInstantiateConfigAminoMsg { + return { + type: "wasm/MsgUpdateInstantiateConfig", + value: MsgUpdateInstantiateConfig.toAmino(message) + }; + }, + fromProtoMsg(message: MsgUpdateInstantiateConfigProtoMsg): MsgUpdateInstantiateConfig { + return MsgUpdateInstantiateConfig.decode(message.value); + }, + toProto(message: MsgUpdateInstantiateConfig): Uint8Array { + return MsgUpdateInstantiateConfig.encode(message).finish(); + }, + toProtoMsg(message: MsgUpdateInstantiateConfig): MsgUpdateInstantiateConfigProtoMsg { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgUpdateInstantiateConfig", + value: MsgUpdateInstantiateConfig.encode(message).finish() + }; + } +}; +function createBaseMsgUpdateInstantiateConfigResponse(): MsgUpdateInstantiateConfigResponse { + return {}; +} +export const MsgUpdateInstantiateConfigResponse = { + typeUrl: "/cosmwasm.wasm.v1.MsgUpdateInstantiateConfigResponse", + encode(_: MsgUpdateInstantiateConfigResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgUpdateInstantiateConfigResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUpdateInstantiateConfigResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): MsgUpdateInstantiateConfigResponse { + const message = createBaseMsgUpdateInstantiateConfigResponse(); + return message; + }, + fromAmino(_: MsgUpdateInstantiateConfigResponseAmino): MsgUpdateInstantiateConfigResponse { + const message = createBaseMsgUpdateInstantiateConfigResponse(); + return message; + }, + toAmino(_: MsgUpdateInstantiateConfigResponse): MsgUpdateInstantiateConfigResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgUpdateInstantiateConfigResponseAminoMsg): MsgUpdateInstantiateConfigResponse { + return MsgUpdateInstantiateConfigResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgUpdateInstantiateConfigResponse): MsgUpdateInstantiateConfigResponseAminoMsg { + return { + type: "wasm/MsgUpdateInstantiateConfigResponse", + value: MsgUpdateInstantiateConfigResponse.toAmino(message) + }; + }, + fromProtoMsg(message: MsgUpdateInstantiateConfigResponseProtoMsg): MsgUpdateInstantiateConfigResponse { + return MsgUpdateInstantiateConfigResponse.decode(message.value); + }, + toProto(message: MsgUpdateInstantiateConfigResponse): Uint8Array { + return MsgUpdateInstantiateConfigResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgUpdateInstantiateConfigResponse): MsgUpdateInstantiateConfigResponseProtoMsg { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgUpdateInstantiateConfigResponse", + value: MsgUpdateInstantiateConfigResponse.encode(message).finish() + }; + } +}; +function createBaseMsgUpdateParams(): MsgUpdateParams { + return { + authority: "", + params: Params.fromPartial({}) + }; +} +export const MsgUpdateParams = { + typeUrl: "/cosmwasm.wasm.v1.MsgUpdateParams", + encode(message: MsgUpdateParams, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.authority !== "") { + writer.uint32(10).string(message.authority); + } + if (message.params !== undefined) { + Params.encode(message.params, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgUpdateParams { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUpdateParams(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.authority = reader.string(); + break; + case 2: + message.params = Params.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgUpdateParams { + const message = createBaseMsgUpdateParams(); + message.authority = object.authority ?? ""; + message.params = object.params !== undefined && object.params !== null ? Params.fromPartial(object.params) : undefined; + return message; + }, + fromAmino(object: MsgUpdateParamsAmino): MsgUpdateParams { + const message = createBaseMsgUpdateParams(); + if (object.authority !== undefined && object.authority !== null) { + message.authority = object.authority; + } + if (object.params !== undefined && object.params !== null) { + message.params = Params.fromAmino(object.params); + } + return message; + }, + toAmino(message: MsgUpdateParams): MsgUpdateParamsAmino { + const obj: any = {}; + obj.authority = message.authority; + obj.params = message.params ? Params.toAmino(message.params) : Params.fromPartial({}); + return obj; + }, + fromAminoMsg(object: MsgUpdateParamsAminoMsg): MsgUpdateParams { + return MsgUpdateParams.fromAmino(object.value); + }, + toAminoMsg(message: MsgUpdateParams): MsgUpdateParamsAminoMsg { + return { + type: "wasm/MsgUpdateParams", + value: MsgUpdateParams.toAmino(message) + }; + }, + fromProtoMsg(message: MsgUpdateParamsProtoMsg): MsgUpdateParams { + return MsgUpdateParams.decode(message.value); + }, + toProto(message: MsgUpdateParams): Uint8Array { + return MsgUpdateParams.encode(message).finish(); + }, + toProtoMsg(message: MsgUpdateParams): MsgUpdateParamsProtoMsg { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgUpdateParams", + value: MsgUpdateParams.encode(message).finish() + }; + } +}; +function createBaseMsgUpdateParamsResponse(): MsgUpdateParamsResponse { + return {}; +} +export const MsgUpdateParamsResponse = { + typeUrl: "/cosmwasm.wasm.v1.MsgUpdateParamsResponse", + encode(_: MsgUpdateParamsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgUpdateParamsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUpdateParamsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): MsgUpdateParamsResponse { + const message = createBaseMsgUpdateParamsResponse(); + return message; + }, + fromAmino(_: MsgUpdateParamsResponseAmino): MsgUpdateParamsResponse { + const message = createBaseMsgUpdateParamsResponse(); + return message; + }, + toAmino(_: MsgUpdateParamsResponse): MsgUpdateParamsResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgUpdateParamsResponseAminoMsg): MsgUpdateParamsResponse { + return MsgUpdateParamsResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgUpdateParamsResponse): MsgUpdateParamsResponseAminoMsg { + return { + type: "wasm/MsgUpdateParamsResponse", + value: MsgUpdateParamsResponse.toAmino(message) + }; + }, + fromProtoMsg(message: MsgUpdateParamsResponseProtoMsg): MsgUpdateParamsResponse { + return MsgUpdateParamsResponse.decode(message.value); + }, + toProto(message: MsgUpdateParamsResponse): Uint8Array { + return MsgUpdateParamsResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgUpdateParamsResponse): MsgUpdateParamsResponseProtoMsg { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgUpdateParamsResponse", + value: MsgUpdateParamsResponse.encode(message).finish() + }; + } +}; +function createBaseMsgSudoContract(): MsgSudoContract { + return { + authority: "", + contract: "", + msg: new Uint8Array() + }; +} +export const MsgSudoContract = { + typeUrl: "/cosmwasm.wasm.v1.MsgSudoContract", + encode(message: MsgSudoContract, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.authority !== "") { + writer.uint32(10).string(message.authority); + } + if (message.contract !== "") { + writer.uint32(18).string(message.contract); } if (message.msg.length !== 0) { - writer.uint32(42).bytes(message.msg); + writer.uint32(26).bytes(message.msg); } - for (const v of message.funds) { - Coin.encode(v!, writer.uint32(50).fork()).ldelim(); + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgSudoContract { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgSudoContract(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.authority = reader.string(); + break; + case 2: + message.contract = reader.string(); + break; + case 3: + message.msg = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgSudoContract { + const message = createBaseMsgSudoContract(); + message.authority = object.authority ?? ""; + message.contract = object.contract ?? ""; + message.msg = object.msg ?? new Uint8Array(); + return message; + }, + fromAmino(object: MsgSudoContractAmino): MsgSudoContract { + const message = createBaseMsgSudoContract(); + if (object.authority !== undefined && object.authority !== null) { + message.authority = object.authority; + } + if (object.contract !== undefined && object.contract !== null) { + message.contract = object.contract; + } + if (object.msg !== undefined && object.msg !== null) { + message.msg = toUtf8(JSON.stringify(object.msg)); + } + return message; + }, + toAmino(message: MsgSudoContract): MsgSudoContractAmino { + const obj: any = {}; + obj.authority = message.authority; + obj.contract = message.contract; + obj.msg = message.msg ? JSON.parse(fromUtf8(message.msg)) : undefined; + return obj; + }, + fromAminoMsg(object: MsgSudoContractAminoMsg): MsgSudoContract { + return MsgSudoContract.fromAmino(object.value); + }, + toAminoMsg(message: MsgSudoContract): MsgSudoContractAminoMsg { + return { + type: "wasm/MsgSudoContract", + value: MsgSudoContract.toAmino(message) + }; + }, + fromProtoMsg(message: MsgSudoContractProtoMsg): MsgSudoContract { + return MsgSudoContract.decode(message.value); + }, + toProto(message: MsgSudoContract): Uint8Array { + return MsgSudoContract.encode(message).finish(); + }, + toProtoMsg(message: MsgSudoContract): MsgSudoContractProtoMsg { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgSudoContract", + value: MsgSudoContract.encode(message).finish() + }; + } +}; +function createBaseMsgSudoContractResponse(): MsgSudoContractResponse { + return { + data: new Uint8Array() + }; +} +export const MsgSudoContractResponse = { + typeUrl: "/cosmwasm.wasm.v1.MsgSudoContractResponse", + encode(message: MsgSudoContractResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.data.length !== 0) { + writer.uint32(10).bytes(message.data); } return writer; }, - decode(input: BinaryReader | Uint8Array, length?: number): MsgInstantiateContract { + decode(input: BinaryReader | Uint8Array, length?: number): MsgSudoContractResponse { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseMsgInstantiateContract(); + const message = createBaseMsgSudoContractResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.sender = reader.string(); - break; - case 2: - message.admin = reader.string(); - break; - case 3: - message.codeId = reader.uint64(); - break; - case 4: - message.label = reader.string(); - break; - case 5: - message.msg = reader.bytes(); - break; - case 6: - message.funds.push(Coin.decode(reader, reader.uint32())); + message.data = reader.bytes(); break; default: reader.skipType(tag & 7); @@ -735,133 +2884,83 @@ export const MsgInstantiateContract = { } return message; }, - fromPartial(object: Partial): MsgInstantiateContract { - const message = createBaseMsgInstantiateContract(); - message.sender = object.sender ?? ""; - message.admin = object.admin ?? ""; - message.codeId = object.codeId !== undefined && object.codeId !== null ? BigInt(object.codeId.toString()) : BigInt(0); - message.label = object.label ?? ""; - message.msg = object.msg ?? new Uint8Array(); - message.funds = object.funds?.map(e => Coin.fromPartial(e)) || []; + fromPartial(object: Partial): MsgSudoContractResponse { + const message = createBaseMsgSudoContractResponse(); + message.data = object.data ?? new Uint8Array(); return message; }, - fromAmino(object: MsgInstantiateContractAmino): MsgInstantiateContract { - return { - sender: object.sender, - admin: object.admin, - codeId: BigInt(object.code_id), - label: object.label, - msg: toUtf8(JSON.stringify(object.msg)), - funds: Array.isArray(object?.funds) ? object.funds.map((e: any) => Coin.fromAmino(e)) : [] - }; + fromAmino(object: MsgSudoContractResponseAmino): MsgSudoContractResponse { + const message = createBaseMsgSudoContractResponse(); + if (object.data !== undefined && object.data !== null) { + message.data = bytesFromBase64(object.data); + } + return message; }, - toAmino(message: MsgInstantiateContract): MsgInstantiateContractAmino { + toAmino(message: MsgSudoContractResponse): MsgSudoContractResponseAmino { const obj: any = {}; - obj.sender = message.sender; - obj.admin = message.admin; - obj.code_id = message.codeId ? message.codeId.toString() : undefined; - obj.label = message.label; - obj.msg = message.msg ? JSON.parse(fromUtf8(message.msg)) : undefined; - if (message.funds) { - obj.funds = message.funds.map(e => e ? Coin.toAmino(e) : undefined); - } else { - obj.funds = []; - } + obj.data = message.data ? base64FromBytes(message.data) : undefined; return obj; }, - fromAminoMsg(object: MsgInstantiateContractAminoMsg): MsgInstantiateContract { - return MsgInstantiateContract.fromAmino(object.value); + fromAminoMsg(object: MsgSudoContractResponseAminoMsg): MsgSudoContractResponse { + return MsgSudoContractResponse.fromAmino(object.value); }, - toAminoMsg(message: MsgInstantiateContract): MsgInstantiateContractAminoMsg { + toAminoMsg(message: MsgSudoContractResponse): MsgSudoContractResponseAminoMsg { return { - type: "wasm/MsgInstantiateContract", - value: MsgInstantiateContract.toAmino(message) + type: "wasm/MsgSudoContractResponse", + value: MsgSudoContractResponse.toAmino(message) }; }, - fromProtoMsg(message: MsgInstantiateContractProtoMsg): MsgInstantiateContract { - return MsgInstantiateContract.decode(message.value); + fromProtoMsg(message: MsgSudoContractResponseProtoMsg): MsgSudoContractResponse { + return MsgSudoContractResponse.decode(message.value); }, - toProto(message: MsgInstantiateContract): Uint8Array { - return MsgInstantiateContract.encode(message).finish(); + toProto(message: MsgSudoContractResponse): Uint8Array { + return MsgSudoContractResponse.encode(message).finish(); }, - toProtoMsg(message: MsgInstantiateContract): MsgInstantiateContractProtoMsg { + toProtoMsg(message: MsgSudoContractResponse): MsgSudoContractResponseProtoMsg { return { - typeUrl: "/cosmwasm.wasm.v1.MsgInstantiateContract", - value: MsgInstantiateContract.encode(message).finish() + typeUrl: "/cosmwasm.wasm.v1.MsgSudoContractResponse", + value: MsgSudoContractResponse.encode(message).finish() }; } }; -function createBaseMsgInstantiateContract2(): MsgInstantiateContract2 { +function createBaseMsgPinCodes(): MsgPinCodes { return { - sender: "", - admin: "", - codeId: BigInt(0), - label: "", - msg: new Uint8Array(), - funds: [], - salt: new Uint8Array(), - fixMsg: false + authority: "", + codeIds: [] }; } -export const MsgInstantiateContract2 = { - typeUrl: "/cosmwasm.wasm.v1.MsgInstantiateContract2", - encode(message: MsgInstantiateContract2, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { - if (message.sender !== "") { - writer.uint32(10).string(message.sender); - } - if (message.admin !== "") { - writer.uint32(18).string(message.admin); - } - if (message.codeId !== BigInt(0)) { - writer.uint32(24).uint64(message.codeId); - } - if (message.label !== "") { - writer.uint32(34).string(message.label); - } - if (message.msg.length !== 0) { - writer.uint32(42).bytes(message.msg); - } - for (const v of message.funds) { - Coin.encode(v!, writer.uint32(50).fork()).ldelim(); +export const MsgPinCodes = { + typeUrl: "/cosmwasm.wasm.v1.MsgPinCodes", + encode(message: MsgPinCodes, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.authority !== "") { + writer.uint32(10).string(message.authority); } - if (message.salt.length !== 0) { - writer.uint32(58).bytes(message.salt); - } - if (message.fixMsg === true) { - writer.uint32(64).bool(message.fixMsg); + writer.uint32(18).fork(); + for (const v of message.codeIds) { + writer.uint64(v); } + writer.ldelim(); return writer; }, - decode(input: BinaryReader | Uint8Array, length?: number): MsgInstantiateContract2 { + decode(input: BinaryReader | Uint8Array, length?: number): MsgPinCodes { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseMsgInstantiateContract2(); + const message = createBaseMsgPinCodes(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.sender = reader.string(); + message.authority = reader.string(); break; case 2: - message.admin = reader.string(); - break; - case 3: - message.codeId = reader.uint64(); - break; - case 4: - message.label = reader.string(); - break; - case 5: - message.msg = reader.bytes(); - break; - case 6: - message.funds.push(Coin.decode(reader, reader.uint32())); - break; - case 7: - message.salt = reader.bytes(); - break; - case 8: - message.fixMsg = reader.bool(); + if ((tag & 7) === 2) { + const end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) { + message.codeIds.push(reader.uint64()); + } + } else { + message.codeIds.push(reader.uint64()); + } break; default: reader.skipType(tag & 7); @@ -870,97 +2969,146 @@ export const MsgInstantiateContract2 = { } return message; }, - fromPartial(object: Partial): MsgInstantiateContract2 { - const message = createBaseMsgInstantiateContract2(); - message.sender = object.sender ?? ""; - message.admin = object.admin ?? ""; - message.codeId = object.codeId !== undefined && object.codeId !== null ? BigInt(object.codeId.toString()) : BigInt(0); - message.label = object.label ?? ""; - message.msg = object.msg ?? new Uint8Array(); - message.funds = object.funds?.map(e => Coin.fromPartial(e)) || []; - message.salt = object.salt ?? new Uint8Array(); - message.fixMsg = object.fixMsg ?? false; + fromPartial(object: Partial): MsgPinCodes { + const message = createBaseMsgPinCodes(); + message.authority = object.authority ?? ""; + message.codeIds = object.codeIds?.map(e => BigInt(e.toString())) || []; return message; }, - fromAmino(object: MsgInstantiateContract2Amino): MsgInstantiateContract2 { - return { - sender: object.sender, - admin: object.admin, - codeId: BigInt(object.code_id), - label: object.label, - msg: toUtf8(JSON.stringify(object.msg)), - funds: Array.isArray(object?.funds) ? object.funds.map((e: any) => Coin.fromAmino(e)) : [], - salt: object.salt, - fixMsg: object.fix_msg - }; + fromAmino(object: MsgPinCodesAmino): MsgPinCodes { + const message = createBaseMsgPinCodes(); + if (object.authority !== undefined && object.authority !== null) { + message.authority = object.authority; + } + message.codeIds = object.code_ids?.map(e => BigInt(e)) || []; + return message; }, - toAmino(message: MsgInstantiateContract2): MsgInstantiateContract2Amino { + toAmino(message: MsgPinCodes): MsgPinCodesAmino { const obj: any = {}; - obj.sender = message.sender; - obj.admin = message.admin; - obj.code_id = message.codeId ? message.codeId.toString() : undefined; - obj.label = message.label; - obj.msg = message.msg ? JSON.parse(fromUtf8(message.msg)) : undefined; - if (message.funds) { - obj.funds = message.funds.map(e => e ? Coin.toAmino(e) : undefined); + obj.authority = message.authority; + if (message.codeIds) { + obj.code_ids = message.codeIds.map(e => e.toString()); } else { - obj.funds = []; + obj.code_ids = []; } - obj.salt = message.salt; - obj.fix_msg = message.fixMsg; return obj; }, - fromAminoMsg(object: MsgInstantiateContract2AminoMsg): MsgInstantiateContract2 { - return MsgInstantiateContract2.fromAmino(object.value); + fromAminoMsg(object: MsgPinCodesAminoMsg): MsgPinCodes { + return MsgPinCodes.fromAmino(object.value); }, - toAminoMsg(message: MsgInstantiateContract2): MsgInstantiateContract2AminoMsg { + toAminoMsg(message: MsgPinCodes): MsgPinCodesAminoMsg { return { - type: "wasm/MsgInstantiateContract2", - value: MsgInstantiateContract2.toAmino(message) + type: "wasm/MsgPinCodes", + value: MsgPinCodes.toAmino(message) }; }, - fromProtoMsg(message: MsgInstantiateContract2ProtoMsg): MsgInstantiateContract2 { - return MsgInstantiateContract2.decode(message.value); + fromProtoMsg(message: MsgPinCodesProtoMsg): MsgPinCodes { + return MsgPinCodes.decode(message.value); }, - toProto(message: MsgInstantiateContract2): Uint8Array { - return MsgInstantiateContract2.encode(message).finish(); + toProto(message: MsgPinCodes): Uint8Array { + return MsgPinCodes.encode(message).finish(); }, - toProtoMsg(message: MsgInstantiateContract2): MsgInstantiateContract2ProtoMsg { + toProtoMsg(message: MsgPinCodes): MsgPinCodesProtoMsg { return { - typeUrl: "/cosmwasm.wasm.v1.MsgInstantiateContract2", - value: MsgInstantiateContract2.encode(message).finish() + typeUrl: "/cosmwasm.wasm.v1.MsgPinCodes", + value: MsgPinCodes.encode(message).finish() }; } }; -function createBaseMsgInstantiateContractResponse(): MsgInstantiateContractResponse { +function createBaseMsgPinCodesResponse(): MsgPinCodesResponse { + return {}; +} +export const MsgPinCodesResponse = { + typeUrl: "/cosmwasm.wasm.v1.MsgPinCodesResponse", + encode(_: MsgPinCodesResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgPinCodesResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgPinCodesResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): MsgPinCodesResponse { + const message = createBaseMsgPinCodesResponse(); + return message; + }, + fromAmino(_: MsgPinCodesResponseAmino): MsgPinCodesResponse { + const message = createBaseMsgPinCodesResponse(); + return message; + }, + toAmino(_: MsgPinCodesResponse): MsgPinCodesResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgPinCodesResponseAminoMsg): MsgPinCodesResponse { + return MsgPinCodesResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgPinCodesResponse): MsgPinCodesResponseAminoMsg { + return { + type: "wasm/MsgPinCodesResponse", + value: MsgPinCodesResponse.toAmino(message) + }; + }, + fromProtoMsg(message: MsgPinCodesResponseProtoMsg): MsgPinCodesResponse { + return MsgPinCodesResponse.decode(message.value); + }, + toProto(message: MsgPinCodesResponse): Uint8Array { + return MsgPinCodesResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgPinCodesResponse): MsgPinCodesResponseProtoMsg { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgPinCodesResponse", + value: MsgPinCodesResponse.encode(message).finish() + }; + } +}; +function createBaseMsgUnpinCodes(): MsgUnpinCodes { return { - address: "", - data: new Uint8Array() + authority: "", + codeIds: [] }; } -export const MsgInstantiateContractResponse = { - typeUrl: "/cosmwasm.wasm.v1.MsgInstantiateContractResponse", - encode(message: MsgInstantiateContractResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { - if (message.address !== "") { - writer.uint32(10).string(message.address); +export const MsgUnpinCodes = { + typeUrl: "/cosmwasm.wasm.v1.MsgUnpinCodes", + encode(message: MsgUnpinCodes, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.authority !== "") { + writer.uint32(10).string(message.authority); } - if (message.data.length !== 0) { - writer.uint32(18).bytes(message.data); + writer.uint32(18).fork(); + for (const v of message.codeIds) { + writer.uint64(v); } + writer.ldelim(); return writer; }, - decode(input: BinaryReader | Uint8Array, length?: number): MsgInstantiateContractResponse { + decode(input: BinaryReader | Uint8Array, length?: number): MsgUnpinCodes { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseMsgInstantiateContractResponse(); + const message = createBaseMsgUnpinCodes(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.address = reader.string(); + message.authority = reader.string(); break; case 2: - message.data = reader.bytes(); + if ((tag & 7) === 2) { + const end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) { + message.codeIds.push(reader.uint64()); + } + } else { + message.codeIds.push(reader.uint64()); + } break; default: reader.skipType(tag & 7); @@ -969,76 +3117,67 @@ export const MsgInstantiateContractResponse = { } return message; }, - fromPartial(object: Partial): MsgInstantiateContractResponse { - const message = createBaseMsgInstantiateContractResponse(); - message.address = object.address ?? ""; - message.data = object.data ?? new Uint8Array(); + fromPartial(object: Partial): MsgUnpinCodes { + const message = createBaseMsgUnpinCodes(); + message.authority = object.authority ?? ""; + message.codeIds = object.codeIds?.map(e => BigInt(e.toString())) || []; return message; }, - fromAmino(object: MsgInstantiateContractResponseAmino): MsgInstantiateContractResponse { - return { - address: object.address, - data: object.data - }; + fromAmino(object: MsgUnpinCodesAmino): MsgUnpinCodes { + const message = createBaseMsgUnpinCodes(); + if (object.authority !== undefined && object.authority !== null) { + message.authority = object.authority; + } + message.codeIds = object.code_ids?.map(e => BigInt(e)) || []; + return message; }, - toAmino(message: MsgInstantiateContractResponse): MsgInstantiateContractResponseAmino { + toAmino(message: MsgUnpinCodes): MsgUnpinCodesAmino { const obj: any = {}; - obj.address = message.address; - obj.data = message.data; + obj.authority = message.authority; + if (message.codeIds) { + obj.code_ids = message.codeIds.map(e => e.toString()); + } else { + obj.code_ids = []; + } return obj; }, - fromAminoMsg(object: MsgInstantiateContractResponseAminoMsg): MsgInstantiateContractResponse { - return MsgInstantiateContractResponse.fromAmino(object.value); + fromAminoMsg(object: MsgUnpinCodesAminoMsg): MsgUnpinCodes { + return MsgUnpinCodes.fromAmino(object.value); }, - toAminoMsg(message: MsgInstantiateContractResponse): MsgInstantiateContractResponseAminoMsg { + toAminoMsg(message: MsgUnpinCodes): MsgUnpinCodesAminoMsg { return { - type: "wasm/MsgInstantiateContractResponse", - value: MsgInstantiateContractResponse.toAmino(message) + type: "wasm/MsgUnpinCodes", + value: MsgUnpinCodes.toAmino(message) }; }, - fromProtoMsg(message: MsgInstantiateContractResponseProtoMsg): MsgInstantiateContractResponse { - return MsgInstantiateContractResponse.decode(message.value); + fromProtoMsg(message: MsgUnpinCodesProtoMsg): MsgUnpinCodes { + return MsgUnpinCodes.decode(message.value); }, - toProto(message: MsgInstantiateContractResponse): Uint8Array { - return MsgInstantiateContractResponse.encode(message).finish(); + toProto(message: MsgUnpinCodes): Uint8Array { + return MsgUnpinCodes.encode(message).finish(); }, - toProtoMsg(message: MsgInstantiateContractResponse): MsgInstantiateContractResponseProtoMsg { + toProtoMsg(message: MsgUnpinCodes): MsgUnpinCodesProtoMsg { return { - typeUrl: "/cosmwasm.wasm.v1.MsgInstantiateContractResponse", - value: MsgInstantiateContractResponse.encode(message).finish() + typeUrl: "/cosmwasm.wasm.v1.MsgUnpinCodes", + value: MsgUnpinCodes.encode(message).finish() }; } }; -function createBaseMsgInstantiateContract2Response(): MsgInstantiateContract2Response { - return { - address: "", - data: new Uint8Array() - }; -} -export const MsgInstantiateContract2Response = { - typeUrl: "/cosmwasm.wasm.v1.MsgInstantiateContract2Response", - encode(message: MsgInstantiateContract2Response, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { - if (message.address !== "") { - writer.uint32(10).string(message.address); - } - if (message.data.length !== 0) { - writer.uint32(18).bytes(message.data); - } +function createBaseMsgUnpinCodesResponse(): MsgUnpinCodesResponse { + return {}; +} +export const MsgUnpinCodesResponse = { + typeUrl: "/cosmwasm.wasm.v1.MsgUnpinCodesResponse", + encode(_: MsgUnpinCodesResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, - decode(input: BinaryReader | Uint8Array, length?: number): MsgInstantiateContract2Response { + decode(input: BinaryReader | Uint8Array, length?: number): MsgUnpinCodesResponse { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseMsgInstantiateContract2Response(); + const message = createBaseMsgUnpinCodesResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.address = reader.string(); - break; - case 2: - message.data = reader.bytes(); - break; default: reader.skipType(tag & 7); break; @@ -1046,90 +3185,133 @@ export const MsgInstantiateContract2Response = { } return message; }, - fromPartial(object: Partial): MsgInstantiateContract2Response { - const message = createBaseMsgInstantiateContract2Response(); - message.address = object.address ?? ""; - message.data = object.data ?? new Uint8Array(); + fromPartial(_: Partial): MsgUnpinCodesResponse { + const message = createBaseMsgUnpinCodesResponse(); return message; }, - fromAmino(object: MsgInstantiateContract2ResponseAmino): MsgInstantiateContract2Response { - return { - address: object.address, - data: object.data - }; + fromAmino(_: MsgUnpinCodesResponseAmino): MsgUnpinCodesResponse { + const message = createBaseMsgUnpinCodesResponse(); + return message; }, - toAmino(message: MsgInstantiateContract2Response): MsgInstantiateContract2ResponseAmino { + toAmino(_: MsgUnpinCodesResponse): MsgUnpinCodesResponseAmino { const obj: any = {}; - obj.address = message.address; - obj.data = message.data; return obj; }, - fromAminoMsg(object: MsgInstantiateContract2ResponseAminoMsg): MsgInstantiateContract2Response { - return MsgInstantiateContract2Response.fromAmino(object.value); + fromAminoMsg(object: MsgUnpinCodesResponseAminoMsg): MsgUnpinCodesResponse { + return MsgUnpinCodesResponse.fromAmino(object.value); }, - toAminoMsg(message: MsgInstantiateContract2Response): MsgInstantiateContract2ResponseAminoMsg { + toAminoMsg(message: MsgUnpinCodesResponse): MsgUnpinCodesResponseAminoMsg { return { - type: "wasm/MsgInstantiateContract2Response", - value: MsgInstantiateContract2Response.toAmino(message) + type: "wasm/MsgUnpinCodesResponse", + value: MsgUnpinCodesResponse.toAmino(message) }; }, - fromProtoMsg(message: MsgInstantiateContract2ResponseProtoMsg): MsgInstantiateContract2Response { - return MsgInstantiateContract2Response.decode(message.value); + fromProtoMsg(message: MsgUnpinCodesResponseProtoMsg): MsgUnpinCodesResponse { + return MsgUnpinCodesResponse.decode(message.value); }, - toProto(message: MsgInstantiateContract2Response): Uint8Array { - return MsgInstantiateContract2Response.encode(message).finish(); + toProto(message: MsgUnpinCodesResponse): Uint8Array { + return MsgUnpinCodesResponse.encode(message).finish(); }, - toProtoMsg(message: MsgInstantiateContract2Response): MsgInstantiateContract2ResponseProtoMsg { + toProtoMsg(message: MsgUnpinCodesResponse): MsgUnpinCodesResponseProtoMsg { return { - typeUrl: "/cosmwasm.wasm.v1.MsgInstantiateContract2Response", - value: MsgInstantiateContract2Response.encode(message).finish() + typeUrl: "/cosmwasm.wasm.v1.MsgUnpinCodesResponse", + value: MsgUnpinCodesResponse.encode(message).finish() }; } }; -function createBaseMsgExecuteContract(): MsgExecuteContract { +function createBaseMsgStoreAndInstantiateContract(): MsgStoreAndInstantiateContract { return { - sender: "", - contract: "", + authority: "", + wasmByteCode: new Uint8Array(), + instantiatePermission: undefined, + unpinCode: false, + admin: "", + label: "", msg: new Uint8Array(), - funds: [] + funds: [], + source: "", + builder: "", + codeHash: new Uint8Array() }; } -export const MsgExecuteContract = { - typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", - encode(message: MsgExecuteContract, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { - if (message.sender !== "") { - writer.uint32(10).string(message.sender); +export const MsgStoreAndInstantiateContract = { + typeUrl: "/cosmwasm.wasm.v1.MsgStoreAndInstantiateContract", + encode(message: MsgStoreAndInstantiateContract, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.authority !== "") { + writer.uint32(10).string(message.authority); } - if (message.contract !== "") { - writer.uint32(18).string(message.contract); + if (message.wasmByteCode.length !== 0) { + writer.uint32(26).bytes(message.wasmByteCode); + } + if (message.instantiatePermission !== undefined) { + AccessConfig.encode(message.instantiatePermission, writer.uint32(34).fork()).ldelim(); + } + if (message.unpinCode === true) { + writer.uint32(40).bool(message.unpinCode); + } + if (message.admin !== "") { + writer.uint32(50).string(message.admin); + } + if (message.label !== "") { + writer.uint32(58).string(message.label); } if (message.msg.length !== 0) { - writer.uint32(26).bytes(message.msg); + writer.uint32(66).bytes(message.msg); } for (const v of message.funds) { - Coin.encode(v!, writer.uint32(42).fork()).ldelim(); + Coin.encode(v!, writer.uint32(74).fork()).ldelim(); + } + if (message.source !== "") { + writer.uint32(82).string(message.source); + } + if (message.builder !== "") { + writer.uint32(90).string(message.builder); + } + if (message.codeHash.length !== 0) { + writer.uint32(98).bytes(message.codeHash); } return writer; }, - decode(input: BinaryReader | Uint8Array, length?: number): MsgExecuteContract { + decode(input: BinaryReader | Uint8Array, length?: number): MsgStoreAndInstantiateContract { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseMsgExecuteContract(); + const message = createBaseMsgStoreAndInstantiateContract(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.sender = reader.string(); - break; - case 2: - message.contract = reader.string(); + message.authority = reader.string(); break; case 3: - message.msg = reader.bytes(); + message.wasmByteCode = reader.bytes(); + break; + case 4: + message.instantiatePermission = AccessConfig.decode(reader, reader.uint32()); break; case 5: + message.unpinCode = reader.bool(); + break; + case 6: + message.admin = reader.string(); + break; + case 7: + message.label = reader.string(); + break; + case 8: + message.msg = reader.bytes(); + break; + case 9: message.funds.push(Coin.decode(reader, reader.uint32())); break; + case 10: + message.source = reader.string(); + break; + case 11: + message.builder = reader.string(); + break; + case 12: + message.codeHash = reader.bytes(); + break; default: reader.skipType(tag & 7); break; @@ -1137,77 +3319,125 @@ export const MsgExecuteContract = { } return message; }, - fromPartial(object: Partial): MsgExecuteContract { - const message = createBaseMsgExecuteContract(); - message.sender = object.sender ?? ""; - message.contract = object.contract ?? ""; + fromPartial(object: Partial): MsgStoreAndInstantiateContract { + const message = createBaseMsgStoreAndInstantiateContract(); + message.authority = object.authority ?? ""; + message.wasmByteCode = object.wasmByteCode ?? new Uint8Array(); + message.instantiatePermission = object.instantiatePermission !== undefined && object.instantiatePermission !== null ? AccessConfig.fromPartial(object.instantiatePermission) : undefined; + message.unpinCode = object.unpinCode ?? false; + message.admin = object.admin ?? ""; + message.label = object.label ?? ""; message.msg = object.msg ?? new Uint8Array(); message.funds = object.funds?.map(e => Coin.fromPartial(e)) || []; + message.source = object.source ?? ""; + message.builder = object.builder ?? ""; + message.codeHash = object.codeHash ?? new Uint8Array(); return message; }, - fromAmino(object: MsgExecuteContractAmino): MsgExecuteContract { - return { - sender: object.sender, - contract: object.contract, - msg: toUtf8(JSON.stringify(object.msg)), - funds: Array.isArray(object?.funds) ? object.funds.map((e: any) => Coin.fromAmino(e)) : [] - }; + fromAmino(object: MsgStoreAndInstantiateContractAmino): MsgStoreAndInstantiateContract { + const message = createBaseMsgStoreAndInstantiateContract(); + if (object.authority !== undefined && object.authority !== null) { + message.authority = object.authority; + } + if (object.wasm_byte_code !== undefined && object.wasm_byte_code !== null) { + message.wasmByteCode = fromBase64(object.wasm_byte_code); + } + if (object.instantiate_permission !== undefined && object.instantiate_permission !== null) { + message.instantiatePermission = AccessConfig.fromAmino(object.instantiate_permission); + } + if (object.unpin_code !== undefined && object.unpin_code !== null) { + message.unpinCode = object.unpin_code; + } + if (object.admin !== undefined && object.admin !== null) { + message.admin = object.admin; + } + if (object.label !== undefined && object.label !== null) { + message.label = object.label; + } + if (object.msg !== undefined && object.msg !== null) { + message.msg = toUtf8(JSON.stringify(object.msg)); + } + message.funds = object.funds?.map(e => Coin.fromAmino(e)) || []; + if (object.source !== undefined && object.source !== null) { + message.source = object.source; + } + if (object.builder !== undefined && object.builder !== null) { + message.builder = object.builder; + } + if (object.code_hash !== undefined && object.code_hash !== null) { + message.codeHash = bytesFromBase64(object.code_hash); + } + return message; }, - toAmino(message: MsgExecuteContract): MsgExecuteContractAmino { + toAmino(message: MsgStoreAndInstantiateContract): MsgStoreAndInstantiateContractAmino { const obj: any = {}; - obj.sender = message.sender; - obj.contract = message.contract; + obj.authority = message.authority; + obj.wasm_byte_code = message.wasmByteCode ? toBase64(message.wasmByteCode) : undefined; + obj.instantiate_permission = message.instantiatePermission ? AccessConfig.toAmino(message.instantiatePermission) : undefined; + obj.unpin_code = message.unpinCode; + obj.admin = message.admin; + obj.label = message.label; obj.msg = message.msg ? JSON.parse(fromUtf8(message.msg)) : undefined; if (message.funds) { obj.funds = message.funds.map(e => e ? Coin.toAmino(e) : undefined); } else { obj.funds = []; } + obj.source = message.source; + obj.builder = message.builder; + obj.code_hash = message.codeHash ? base64FromBytes(message.codeHash) : undefined; return obj; }, - fromAminoMsg(object: MsgExecuteContractAminoMsg): MsgExecuteContract { - return MsgExecuteContract.fromAmino(object.value); + fromAminoMsg(object: MsgStoreAndInstantiateContractAminoMsg): MsgStoreAndInstantiateContract { + return MsgStoreAndInstantiateContract.fromAmino(object.value); }, - toAminoMsg(message: MsgExecuteContract): MsgExecuteContractAminoMsg { + toAminoMsg(message: MsgStoreAndInstantiateContract): MsgStoreAndInstantiateContractAminoMsg { return { - type: "wasm/MsgExecuteContract", - value: MsgExecuteContract.toAmino(message) + type: "wasm/MsgStoreAndInstantiateContract", + value: MsgStoreAndInstantiateContract.toAmino(message) }; }, - fromProtoMsg(message: MsgExecuteContractProtoMsg): MsgExecuteContract { - return MsgExecuteContract.decode(message.value); + fromProtoMsg(message: MsgStoreAndInstantiateContractProtoMsg): MsgStoreAndInstantiateContract { + return MsgStoreAndInstantiateContract.decode(message.value); }, - toProto(message: MsgExecuteContract): Uint8Array { - return MsgExecuteContract.encode(message).finish(); + toProto(message: MsgStoreAndInstantiateContract): Uint8Array { + return MsgStoreAndInstantiateContract.encode(message).finish(); }, - toProtoMsg(message: MsgExecuteContract): MsgExecuteContractProtoMsg { + toProtoMsg(message: MsgStoreAndInstantiateContract): MsgStoreAndInstantiateContractProtoMsg { return { - typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", - value: MsgExecuteContract.encode(message).finish() + typeUrl: "/cosmwasm.wasm.v1.MsgStoreAndInstantiateContract", + value: MsgStoreAndInstantiateContract.encode(message).finish() }; } }; -function createBaseMsgExecuteContractResponse(): MsgExecuteContractResponse { +function createBaseMsgStoreAndInstantiateContractResponse(): MsgStoreAndInstantiateContractResponse { return { + address: "", data: new Uint8Array() }; } -export const MsgExecuteContractResponse = { - typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContractResponse", - encode(message: MsgExecuteContractResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { +export const MsgStoreAndInstantiateContractResponse = { + typeUrl: "/cosmwasm.wasm.v1.MsgStoreAndInstantiateContractResponse", + encode(message: MsgStoreAndInstantiateContractResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.address !== "") { + writer.uint32(10).string(message.address); + } if (message.data.length !== 0) { - writer.uint32(10).bytes(message.data); + writer.uint32(18).bytes(message.data); } return writer; }, - decode(input: BinaryReader | Uint8Array, length?: number): MsgExecuteContractResponse { + decode(input: BinaryReader | Uint8Array, length?: number): MsgStoreAndInstantiateContractResponse { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseMsgExecuteContractResponse(); + const message = createBaseMsgStoreAndInstantiateContractResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: + message.address = reader.string(); + break; + case 2: message.data = reader.bytes(); break; default: @@ -1217,86 +3447,79 @@ export const MsgExecuteContractResponse = { } return message; }, - fromPartial(object: Partial): MsgExecuteContractResponse { - const message = createBaseMsgExecuteContractResponse(); + fromPartial(object: Partial): MsgStoreAndInstantiateContractResponse { + const message = createBaseMsgStoreAndInstantiateContractResponse(); + message.address = object.address ?? ""; message.data = object.data ?? new Uint8Array(); return message; }, - fromAmino(object: MsgExecuteContractResponseAmino): MsgExecuteContractResponse { - return { - data: object.data - }; + fromAmino(object: MsgStoreAndInstantiateContractResponseAmino): MsgStoreAndInstantiateContractResponse { + const message = createBaseMsgStoreAndInstantiateContractResponse(); + if (object.address !== undefined && object.address !== null) { + message.address = object.address; + } + if (object.data !== undefined && object.data !== null) { + message.data = bytesFromBase64(object.data); + } + return message; }, - toAmino(message: MsgExecuteContractResponse): MsgExecuteContractResponseAmino { + toAmino(message: MsgStoreAndInstantiateContractResponse): MsgStoreAndInstantiateContractResponseAmino { const obj: any = {}; - obj.data = message.data; + obj.address = message.address; + obj.data = message.data ? base64FromBytes(message.data) : undefined; return obj; }, - fromAminoMsg(object: MsgExecuteContractResponseAminoMsg): MsgExecuteContractResponse { - return MsgExecuteContractResponse.fromAmino(object.value); + fromAminoMsg(object: MsgStoreAndInstantiateContractResponseAminoMsg): MsgStoreAndInstantiateContractResponse { + return MsgStoreAndInstantiateContractResponse.fromAmino(object.value); }, - toAminoMsg(message: MsgExecuteContractResponse): MsgExecuteContractResponseAminoMsg { + toAminoMsg(message: MsgStoreAndInstantiateContractResponse): MsgStoreAndInstantiateContractResponseAminoMsg { return { - type: "wasm/MsgExecuteContractResponse", - value: MsgExecuteContractResponse.toAmino(message) + type: "wasm/MsgStoreAndInstantiateContractResponse", + value: MsgStoreAndInstantiateContractResponse.toAmino(message) }; }, - fromProtoMsg(message: MsgExecuteContractResponseProtoMsg): MsgExecuteContractResponse { - return MsgExecuteContractResponse.decode(message.value); + fromProtoMsg(message: MsgStoreAndInstantiateContractResponseProtoMsg): MsgStoreAndInstantiateContractResponse { + return MsgStoreAndInstantiateContractResponse.decode(message.value); }, - toProto(message: MsgExecuteContractResponse): Uint8Array { - return MsgExecuteContractResponse.encode(message).finish(); + toProto(message: MsgStoreAndInstantiateContractResponse): Uint8Array { + return MsgStoreAndInstantiateContractResponse.encode(message).finish(); }, - toProtoMsg(message: MsgExecuteContractResponse): MsgExecuteContractResponseProtoMsg { + toProtoMsg(message: MsgStoreAndInstantiateContractResponse): MsgStoreAndInstantiateContractResponseProtoMsg { return { - typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContractResponse", - value: MsgExecuteContractResponse.encode(message).finish() + typeUrl: "/cosmwasm.wasm.v1.MsgStoreAndInstantiateContractResponse", + value: MsgStoreAndInstantiateContractResponse.encode(message).finish() }; } }; -function createBaseMsgMigrateContract(): MsgMigrateContract { +function createBaseMsgAddCodeUploadParamsAddresses(): MsgAddCodeUploadParamsAddresses { return { - sender: "", - contract: "", - codeId: BigInt(0), - msg: new Uint8Array() + authority: "", + addresses: [] }; } -export const MsgMigrateContract = { - typeUrl: "/cosmwasm.wasm.v1.MsgMigrateContract", - encode(message: MsgMigrateContract, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { - if (message.sender !== "") { - writer.uint32(10).string(message.sender); - } - if (message.contract !== "") { - writer.uint32(18).string(message.contract); - } - if (message.codeId !== BigInt(0)) { - writer.uint32(24).uint64(message.codeId); +export const MsgAddCodeUploadParamsAddresses = { + typeUrl: "/cosmwasm.wasm.v1.MsgAddCodeUploadParamsAddresses", + encode(message: MsgAddCodeUploadParamsAddresses, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.authority !== "") { + writer.uint32(10).string(message.authority); } - if (message.msg.length !== 0) { - writer.uint32(34).bytes(message.msg); + for (const v of message.addresses) { + writer.uint32(18).string(v!); } return writer; }, - decode(input: BinaryReader | Uint8Array, length?: number): MsgMigrateContract { + decode(input: BinaryReader | Uint8Array, length?: number): MsgAddCodeUploadParamsAddresses { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseMsgMigrateContract(); + const message = createBaseMsgAddCodeUploadParamsAddresses(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.sender = reader.string(); + message.authority = reader.string(); break; case 2: - message.contract = reader.string(); - break; - case 3: - message.codeId = reader.uint64(); - break; - case 4: - message.msg = reader.bytes(); + message.addresses.push(reader.string()); break; default: reader.skipType(tag & 7); @@ -1305,75 +3528,67 @@ export const MsgMigrateContract = { } return message; }, - fromPartial(object: Partial): MsgMigrateContract { - const message = createBaseMsgMigrateContract(); - message.sender = object.sender ?? ""; - message.contract = object.contract ?? ""; - message.codeId = object.codeId !== undefined && object.codeId !== null ? BigInt(object.codeId.toString()) : BigInt(0); - message.msg = object.msg ?? new Uint8Array(); + fromPartial(object: Partial): MsgAddCodeUploadParamsAddresses { + const message = createBaseMsgAddCodeUploadParamsAddresses(); + message.authority = object.authority ?? ""; + message.addresses = object.addresses?.map(e => e) || []; return message; }, - fromAmino(object: MsgMigrateContractAmino): MsgMigrateContract { - return { - sender: object.sender, - contract: object.contract, - codeId: BigInt(object.code_id), - msg: toUtf8(JSON.stringify(object.msg)) - }; + fromAmino(object: MsgAddCodeUploadParamsAddressesAmino): MsgAddCodeUploadParamsAddresses { + const message = createBaseMsgAddCodeUploadParamsAddresses(); + if (object.authority !== undefined && object.authority !== null) { + message.authority = object.authority; + } + message.addresses = object.addresses?.map(e => e) || []; + return message; }, - toAmino(message: MsgMigrateContract): MsgMigrateContractAmino { + toAmino(message: MsgAddCodeUploadParamsAddresses): MsgAddCodeUploadParamsAddressesAmino { const obj: any = {}; - obj.sender = message.sender; - obj.contract = message.contract; - obj.code_id = message.codeId ? message.codeId.toString() : undefined; - obj.msg = message.msg ? JSON.parse(fromUtf8(message.msg)) : undefined; + obj.authority = message.authority; + if (message.addresses) { + obj.addresses = message.addresses.map(e => e); + } else { + obj.addresses = []; + } return obj; }, - fromAminoMsg(object: MsgMigrateContractAminoMsg): MsgMigrateContract { - return MsgMigrateContract.fromAmino(object.value); + fromAminoMsg(object: MsgAddCodeUploadParamsAddressesAminoMsg): MsgAddCodeUploadParamsAddresses { + return MsgAddCodeUploadParamsAddresses.fromAmino(object.value); }, - toAminoMsg(message: MsgMigrateContract): MsgMigrateContractAminoMsg { + toAminoMsg(message: MsgAddCodeUploadParamsAddresses): MsgAddCodeUploadParamsAddressesAminoMsg { return { - type: "wasm/MsgMigrateContract", - value: MsgMigrateContract.toAmino(message) + type: "wasm/MsgAddCodeUploadParamsAddresses", + value: MsgAddCodeUploadParamsAddresses.toAmino(message) }; }, - fromProtoMsg(message: MsgMigrateContractProtoMsg): MsgMigrateContract { - return MsgMigrateContract.decode(message.value); + fromProtoMsg(message: MsgAddCodeUploadParamsAddressesProtoMsg): MsgAddCodeUploadParamsAddresses { + return MsgAddCodeUploadParamsAddresses.decode(message.value); }, - toProto(message: MsgMigrateContract): Uint8Array { - return MsgMigrateContract.encode(message).finish(); + toProto(message: MsgAddCodeUploadParamsAddresses): Uint8Array { + return MsgAddCodeUploadParamsAddresses.encode(message).finish(); }, - toProtoMsg(message: MsgMigrateContract): MsgMigrateContractProtoMsg { + toProtoMsg(message: MsgAddCodeUploadParamsAddresses): MsgAddCodeUploadParamsAddressesProtoMsg { return { - typeUrl: "/cosmwasm.wasm.v1.MsgMigrateContract", - value: MsgMigrateContract.encode(message).finish() + typeUrl: "/cosmwasm.wasm.v1.MsgAddCodeUploadParamsAddresses", + value: MsgAddCodeUploadParamsAddresses.encode(message).finish() }; } }; -function createBaseMsgMigrateContractResponse(): MsgMigrateContractResponse { - return { - data: new Uint8Array() - }; +function createBaseMsgAddCodeUploadParamsAddressesResponse(): MsgAddCodeUploadParamsAddressesResponse { + return {}; } -export const MsgMigrateContractResponse = { - typeUrl: "/cosmwasm.wasm.v1.MsgMigrateContractResponse", - encode(message: MsgMigrateContractResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { - if (message.data.length !== 0) { - writer.uint32(10).bytes(message.data); - } +export const MsgAddCodeUploadParamsAddressesResponse = { + typeUrl: "/cosmwasm.wasm.v1.MsgAddCodeUploadParamsAddressesResponse", + encode(_: MsgAddCodeUploadParamsAddressesResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, - decode(input: BinaryReader | Uint8Array, length?: number): MsgMigrateContractResponse { + decode(input: BinaryReader | Uint8Array, length?: number): MsgAddCodeUploadParamsAddressesResponse { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseMsgMigrateContractResponse(); + const message = createBaseMsgAddCodeUploadParamsAddressesResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.data = reader.bytes(); - break; default: reader.skipType(tag & 7); break; @@ -1381,79 +3596,69 @@ export const MsgMigrateContractResponse = { } return message; }, - fromPartial(object: Partial): MsgMigrateContractResponse { - const message = createBaseMsgMigrateContractResponse(); - message.data = object.data ?? new Uint8Array(); + fromPartial(_: Partial): MsgAddCodeUploadParamsAddressesResponse { + const message = createBaseMsgAddCodeUploadParamsAddressesResponse(); return message; }, - fromAmino(object: MsgMigrateContractResponseAmino): MsgMigrateContractResponse { - return { - data: object.data - }; + fromAmino(_: MsgAddCodeUploadParamsAddressesResponseAmino): MsgAddCodeUploadParamsAddressesResponse { + const message = createBaseMsgAddCodeUploadParamsAddressesResponse(); + return message; }, - toAmino(message: MsgMigrateContractResponse): MsgMigrateContractResponseAmino { + toAmino(_: MsgAddCodeUploadParamsAddressesResponse): MsgAddCodeUploadParamsAddressesResponseAmino { const obj: any = {}; - obj.data = message.data; return obj; }, - fromAminoMsg(object: MsgMigrateContractResponseAminoMsg): MsgMigrateContractResponse { - return MsgMigrateContractResponse.fromAmino(object.value); + fromAminoMsg(object: MsgAddCodeUploadParamsAddressesResponseAminoMsg): MsgAddCodeUploadParamsAddressesResponse { + return MsgAddCodeUploadParamsAddressesResponse.fromAmino(object.value); }, - toAminoMsg(message: MsgMigrateContractResponse): MsgMigrateContractResponseAminoMsg { + toAminoMsg(message: MsgAddCodeUploadParamsAddressesResponse): MsgAddCodeUploadParamsAddressesResponseAminoMsg { return { - type: "wasm/MsgMigrateContractResponse", - value: MsgMigrateContractResponse.toAmino(message) + type: "wasm/MsgAddCodeUploadParamsAddressesResponse", + value: MsgAddCodeUploadParamsAddressesResponse.toAmino(message) }; }, - fromProtoMsg(message: MsgMigrateContractResponseProtoMsg): MsgMigrateContractResponse { - return MsgMigrateContractResponse.decode(message.value); + fromProtoMsg(message: MsgAddCodeUploadParamsAddressesResponseProtoMsg): MsgAddCodeUploadParamsAddressesResponse { + return MsgAddCodeUploadParamsAddressesResponse.decode(message.value); }, - toProto(message: MsgMigrateContractResponse): Uint8Array { - return MsgMigrateContractResponse.encode(message).finish(); + toProto(message: MsgAddCodeUploadParamsAddressesResponse): Uint8Array { + return MsgAddCodeUploadParamsAddressesResponse.encode(message).finish(); }, - toProtoMsg(message: MsgMigrateContractResponse): MsgMigrateContractResponseProtoMsg { + toProtoMsg(message: MsgAddCodeUploadParamsAddressesResponse): MsgAddCodeUploadParamsAddressesResponseProtoMsg { return { - typeUrl: "/cosmwasm.wasm.v1.MsgMigrateContractResponse", - value: MsgMigrateContractResponse.encode(message).finish() + typeUrl: "/cosmwasm.wasm.v1.MsgAddCodeUploadParamsAddressesResponse", + value: MsgAddCodeUploadParamsAddressesResponse.encode(message).finish() }; } }; -function createBaseMsgUpdateAdmin(): MsgUpdateAdmin { +function createBaseMsgRemoveCodeUploadParamsAddresses(): MsgRemoveCodeUploadParamsAddresses { return { - sender: "", - newAdmin: "", - contract: "" + authority: "", + addresses: [] }; } -export const MsgUpdateAdmin = { - typeUrl: "/cosmwasm.wasm.v1.MsgUpdateAdmin", - encode(message: MsgUpdateAdmin, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { - if (message.sender !== "") { - writer.uint32(10).string(message.sender); - } - if (message.newAdmin !== "") { - writer.uint32(18).string(message.newAdmin); +export const MsgRemoveCodeUploadParamsAddresses = { + typeUrl: "/cosmwasm.wasm.v1.MsgRemoveCodeUploadParamsAddresses", + encode(message: MsgRemoveCodeUploadParamsAddresses, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.authority !== "") { + writer.uint32(10).string(message.authority); } - if (message.contract !== "") { - writer.uint32(26).string(message.contract); + for (const v of message.addresses) { + writer.uint32(18).string(v!); } return writer; }, - decode(input: BinaryReader | Uint8Array, length?: number): MsgUpdateAdmin { + decode(input: BinaryReader | Uint8Array, length?: number): MsgRemoveCodeUploadParamsAddresses { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseMsgUpdateAdmin(); + const message = createBaseMsgRemoveCodeUploadParamsAddresses(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.sender = reader.string(); + message.authority = reader.string(); break; case 2: - message.newAdmin = reader.string(); - break; - case 3: - message.contract = reader.string(); + message.addresses.push(reader.string()); break; default: reader.skipType(tag & 7); @@ -1462,61 +3667,64 @@ export const MsgUpdateAdmin = { } return message; }, - fromPartial(object: Partial): MsgUpdateAdmin { - const message = createBaseMsgUpdateAdmin(); - message.sender = object.sender ?? ""; - message.newAdmin = object.newAdmin ?? ""; - message.contract = object.contract ?? ""; + fromPartial(object: Partial): MsgRemoveCodeUploadParamsAddresses { + const message = createBaseMsgRemoveCodeUploadParamsAddresses(); + message.authority = object.authority ?? ""; + message.addresses = object.addresses?.map(e => e) || []; return message; }, - fromAmino(object: MsgUpdateAdminAmino): MsgUpdateAdmin { - return { - sender: object.sender, - newAdmin: object.new_admin, - contract: object.contract - }; + fromAmino(object: MsgRemoveCodeUploadParamsAddressesAmino): MsgRemoveCodeUploadParamsAddresses { + const message = createBaseMsgRemoveCodeUploadParamsAddresses(); + if (object.authority !== undefined && object.authority !== null) { + message.authority = object.authority; + } + message.addresses = object.addresses?.map(e => e) || []; + return message; }, - toAmino(message: MsgUpdateAdmin): MsgUpdateAdminAmino { + toAmino(message: MsgRemoveCodeUploadParamsAddresses): MsgRemoveCodeUploadParamsAddressesAmino { const obj: any = {}; - obj.sender = message.sender; - obj.new_admin = message.newAdmin; - obj.contract = message.contract; + obj.authority = message.authority; + if (message.addresses) { + obj.addresses = message.addresses.map(e => e); + } else { + obj.addresses = []; + } return obj; }, - fromAminoMsg(object: MsgUpdateAdminAminoMsg): MsgUpdateAdmin { - return MsgUpdateAdmin.fromAmino(object.value); + fromAminoMsg(object: MsgRemoveCodeUploadParamsAddressesAminoMsg): MsgRemoveCodeUploadParamsAddresses { + return MsgRemoveCodeUploadParamsAddresses.fromAmino(object.value); }, - toAminoMsg(message: MsgUpdateAdmin): MsgUpdateAdminAminoMsg { + toAminoMsg(message: MsgRemoveCodeUploadParamsAddresses): MsgRemoveCodeUploadParamsAddressesAminoMsg { return { - type: "wasm/MsgUpdateAdmin", - value: MsgUpdateAdmin.toAmino(message) + type: "wasm/MsgRemoveCodeUploadParamsAddresses", + value: MsgRemoveCodeUploadParamsAddresses.toAmino(message) }; }, - fromProtoMsg(message: MsgUpdateAdminProtoMsg): MsgUpdateAdmin { - return MsgUpdateAdmin.decode(message.value); + fromProtoMsg(message: MsgRemoveCodeUploadParamsAddressesProtoMsg): MsgRemoveCodeUploadParamsAddresses { + return MsgRemoveCodeUploadParamsAddresses.decode(message.value); }, - toProto(message: MsgUpdateAdmin): Uint8Array { - return MsgUpdateAdmin.encode(message).finish(); + toProto(message: MsgRemoveCodeUploadParamsAddresses): Uint8Array { + return MsgRemoveCodeUploadParamsAddresses.encode(message).finish(); }, - toProtoMsg(message: MsgUpdateAdmin): MsgUpdateAdminProtoMsg { + toProtoMsg(message: MsgRemoveCodeUploadParamsAddresses): MsgRemoveCodeUploadParamsAddressesProtoMsg { return { - typeUrl: "/cosmwasm.wasm.v1.MsgUpdateAdmin", - value: MsgUpdateAdmin.encode(message).finish() + typeUrl: "/cosmwasm.wasm.v1.MsgRemoveCodeUploadParamsAddresses", + value: MsgRemoveCodeUploadParamsAddresses.encode(message).finish() }; } }; -function createBaseMsgUpdateAdminResponse(): MsgUpdateAdminResponse { +function createBaseMsgRemoveCodeUploadParamsAddressesResponse(): MsgRemoveCodeUploadParamsAddressesResponse { return {}; } -export const MsgUpdateAdminResponse = { - typeUrl: "/cosmwasm.wasm.v1.MsgUpdateAdminResponse", - encode(_: MsgUpdateAdminResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { +export const MsgRemoveCodeUploadParamsAddressesResponse = { + typeUrl: "/cosmwasm.wasm.v1.MsgRemoveCodeUploadParamsAddressesResponse", + encode(_: MsgRemoveCodeUploadParamsAddressesResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, - decode(input: BinaryReader | Uint8Array, length?: number): MsgUpdateAdminResponse { + decode(input: BinaryReader | Uint8Array, length?: number): MsgRemoveCodeUploadParamsAddressesResponse { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseMsgUpdateAdminResponse(); + const message = createBaseMsgRemoveCodeUploadParamsAddressesResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -1527,69 +3735,91 @@ export const MsgUpdateAdminResponse = { } return message; }, - fromPartial(_: Partial): MsgUpdateAdminResponse { - const message = createBaseMsgUpdateAdminResponse(); + fromPartial(_: Partial): MsgRemoveCodeUploadParamsAddressesResponse { + const message = createBaseMsgRemoveCodeUploadParamsAddressesResponse(); return message; }, - fromAmino(_: MsgUpdateAdminResponseAmino): MsgUpdateAdminResponse { - return {}; + fromAmino(_: MsgRemoveCodeUploadParamsAddressesResponseAmino): MsgRemoveCodeUploadParamsAddressesResponse { + const message = createBaseMsgRemoveCodeUploadParamsAddressesResponse(); + return message; }, - toAmino(_: MsgUpdateAdminResponse): MsgUpdateAdminResponseAmino { + toAmino(_: MsgRemoveCodeUploadParamsAddressesResponse): MsgRemoveCodeUploadParamsAddressesResponseAmino { const obj: any = {}; return obj; }, - fromAminoMsg(object: MsgUpdateAdminResponseAminoMsg): MsgUpdateAdminResponse { - return MsgUpdateAdminResponse.fromAmino(object.value); + fromAminoMsg(object: MsgRemoveCodeUploadParamsAddressesResponseAminoMsg): MsgRemoveCodeUploadParamsAddressesResponse { + return MsgRemoveCodeUploadParamsAddressesResponse.fromAmino(object.value); }, - toAminoMsg(message: MsgUpdateAdminResponse): MsgUpdateAdminResponseAminoMsg { + toAminoMsg(message: MsgRemoveCodeUploadParamsAddressesResponse): MsgRemoveCodeUploadParamsAddressesResponseAminoMsg { return { - type: "wasm/MsgUpdateAdminResponse", - value: MsgUpdateAdminResponse.toAmino(message) + type: "wasm/MsgRemoveCodeUploadParamsAddressesResponse", + value: MsgRemoveCodeUploadParamsAddressesResponse.toAmino(message) }; }, - fromProtoMsg(message: MsgUpdateAdminResponseProtoMsg): MsgUpdateAdminResponse { - return MsgUpdateAdminResponse.decode(message.value); + fromProtoMsg(message: MsgRemoveCodeUploadParamsAddressesResponseProtoMsg): MsgRemoveCodeUploadParamsAddressesResponse { + return MsgRemoveCodeUploadParamsAddressesResponse.decode(message.value); }, - toProto(message: MsgUpdateAdminResponse): Uint8Array { - return MsgUpdateAdminResponse.encode(message).finish(); + toProto(message: MsgRemoveCodeUploadParamsAddressesResponse): Uint8Array { + return MsgRemoveCodeUploadParamsAddressesResponse.encode(message).finish(); }, - toProtoMsg(message: MsgUpdateAdminResponse): MsgUpdateAdminResponseProtoMsg { + toProtoMsg(message: MsgRemoveCodeUploadParamsAddressesResponse): MsgRemoveCodeUploadParamsAddressesResponseProtoMsg { return { - typeUrl: "/cosmwasm.wasm.v1.MsgUpdateAdminResponse", - value: MsgUpdateAdminResponse.encode(message).finish() + typeUrl: "/cosmwasm.wasm.v1.MsgRemoveCodeUploadParamsAddressesResponse", + value: MsgRemoveCodeUploadParamsAddressesResponse.encode(message).finish() }; } }; -function createBaseMsgClearAdmin(): MsgClearAdmin { +function createBaseMsgStoreAndMigrateContract(): MsgStoreAndMigrateContract { return { - sender: "", - contract: "" + authority: "", + wasmByteCode: new Uint8Array(), + instantiatePermission: undefined, + contract: "", + msg: new Uint8Array() }; } -export const MsgClearAdmin = { - typeUrl: "/cosmwasm.wasm.v1.MsgClearAdmin", - encode(message: MsgClearAdmin, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { - if (message.sender !== "") { - writer.uint32(10).string(message.sender); +export const MsgStoreAndMigrateContract = { + typeUrl: "/cosmwasm.wasm.v1.MsgStoreAndMigrateContract", + encode(message: MsgStoreAndMigrateContract, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.authority !== "") { + writer.uint32(10).string(message.authority); + } + if (message.wasmByteCode.length !== 0) { + writer.uint32(18).bytes(message.wasmByteCode); + } + if (message.instantiatePermission !== undefined) { + AccessConfig.encode(message.instantiatePermission, writer.uint32(26).fork()).ldelim(); } if (message.contract !== "") { - writer.uint32(26).string(message.contract); + writer.uint32(34).string(message.contract); + } + if (message.msg.length !== 0) { + writer.uint32(42).bytes(message.msg); } return writer; }, - decode(input: BinaryReader | Uint8Array, length?: number): MsgClearAdmin { + decode(input: BinaryReader | Uint8Array, length?: number): MsgStoreAndMigrateContract { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseMsgClearAdmin(); + const message = createBaseMsgStoreAndMigrateContract(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.sender = reader.string(); + message.authority = reader.string(); + break; + case 2: + message.wasmByteCode = reader.bytes(); break; case 3: + message.instantiatePermission = AccessConfig.decode(reader, reader.uint32()); + break; + case 4: message.contract = reader.string(); break; + case 5: + message.msg = reader.bytes(); + break; default: reader.skipType(tag & 7); break; @@ -1597,61 +3827,102 @@ export const MsgClearAdmin = { } return message; }, - fromPartial(object: Partial): MsgClearAdmin { - const message = createBaseMsgClearAdmin(); - message.sender = object.sender ?? ""; + fromPartial(object: Partial): MsgStoreAndMigrateContract { + const message = createBaseMsgStoreAndMigrateContract(); + message.authority = object.authority ?? ""; + message.wasmByteCode = object.wasmByteCode ?? new Uint8Array(); + message.instantiatePermission = object.instantiatePermission !== undefined && object.instantiatePermission !== null ? AccessConfig.fromPartial(object.instantiatePermission) : undefined; message.contract = object.contract ?? ""; + message.msg = object.msg ?? new Uint8Array(); return message; }, - fromAmino(object: MsgClearAdminAmino): MsgClearAdmin { - return { - sender: object.sender, - contract: object.contract - }; + fromAmino(object: MsgStoreAndMigrateContractAmino): MsgStoreAndMigrateContract { + const message = createBaseMsgStoreAndMigrateContract(); + if (object.authority !== undefined && object.authority !== null) { + message.authority = object.authority; + } + if (object.wasm_byte_code !== undefined && object.wasm_byte_code !== null) { + message.wasmByteCode = fromBase64(object.wasm_byte_code); + } + if (object.instantiate_permission !== undefined && object.instantiate_permission !== null) { + message.instantiatePermission = AccessConfig.fromAmino(object.instantiate_permission); + } + if (object.contract !== undefined && object.contract !== null) { + message.contract = object.contract; + } + if (object.msg !== undefined && object.msg !== null) { + message.msg = toUtf8(JSON.stringify(object.msg)); + } + return message; }, - toAmino(message: MsgClearAdmin): MsgClearAdminAmino { + toAmino(message: MsgStoreAndMigrateContract): MsgStoreAndMigrateContractAmino { const obj: any = {}; - obj.sender = message.sender; + obj.authority = message.authority; + obj.wasm_byte_code = message.wasmByteCode ? toBase64(message.wasmByteCode) : undefined; + obj.instantiate_permission = message.instantiatePermission ? AccessConfig.toAmino(message.instantiatePermission) : undefined; obj.contract = message.contract; + obj.msg = message.msg ? JSON.parse(fromUtf8(message.msg)) : undefined; return obj; }, - fromAminoMsg(object: MsgClearAdminAminoMsg): MsgClearAdmin { - return MsgClearAdmin.fromAmino(object.value); + fromAminoMsg(object: MsgStoreAndMigrateContractAminoMsg): MsgStoreAndMigrateContract { + return MsgStoreAndMigrateContract.fromAmino(object.value); }, - toAminoMsg(message: MsgClearAdmin): MsgClearAdminAminoMsg { + toAminoMsg(message: MsgStoreAndMigrateContract): MsgStoreAndMigrateContractAminoMsg { return { - type: "wasm/MsgClearAdmin", - value: MsgClearAdmin.toAmino(message) + type: "wasm/MsgStoreAndMigrateContract", + value: MsgStoreAndMigrateContract.toAmino(message) }; }, - fromProtoMsg(message: MsgClearAdminProtoMsg): MsgClearAdmin { - return MsgClearAdmin.decode(message.value); + fromProtoMsg(message: MsgStoreAndMigrateContractProtoMsg): MsgStoreAndMigrateContract { + return MsgStoreAndMigrateContract.decode(message.value); }, - toProto(message: MsgClearAdmin): Uint8Array { - return MsgClearAdmin.encode(message).finish(); + toProto(message: MsgStoreAndMigrateContract): Uint8Array { + return MsgStoreAndMigrateContract.encode(message).finish(); }, - toProtoMsg(message: MsgClearAdmin): MsgClearAdminProtoMsg { + toProtoMsg(message: MsgStoreAndMigrateContract): MsgStoreAndMigrateContractProtoMsg { return { - typeUrl: "/cosmwasm.wasm.v1.MsgClearAdmin", - value: MsgClearAdmin.encode(message).finish() + typeUrl: "/cosmwasm.wasm.v1.MsgStoreAndMigrateContract", + value: MsgStoreAndMigrateContract.encode(message).finish() }; } }; -function createBaseMsgClearAdminResponse(): MsgClearAdminResponse { - return {}; +function createBaseMsgStoreAndMigrateContractResponse(): MsgStoreAndMigrateContractResponse { + return { + codeId: BigInt(0), + checksum: new Uint8Array(), + data: new Uint8Array() + }; } -export const MsgClearAdminResponse = { - typeUrl: "/cosmwasm.wasm.v1.MsgClearAdminResponse", - encode(_: MsgClearAdminResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { +export const MsgStoreAndMigrateContractResponse = { + typeUrl: "/cosmwasm.wasm.v1.MsgStoreAndMigrateContractResponse", + encode(message: MsgStoreAndMigrateContractResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.codeId !== BigInt(0)) { + writer.uint32(8).uint64(message.codeId); + } + if (message.checksum.length !== 0) { + writer.uint32(18).bytes(message.checksum); + } + if (message.data.length !== 0) { + writer.uint32(26).bytes(message.data); + } return writer; }, - decode(input: BinaryReader | Uint8Array, length?: number): MsgClearAdminResponse { + decode(input: BinaryReader | Uint8Array, length?: number): MsgStoreAndMigrateContractResponse { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseMsgClearAdminResponse(); + const message = createBaseMsgStoreAndMigrateContractResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { + case 1: + message.codeId = reader.uint64(); + break; + case 2: + message.checksum = reader.bytes(); + break; + case 3: + message.data = reader.bytes(); + break; default: reader.skipType(tag & 7); break; @@ -1659,64 +3930,80 @@ export const MsgClearAdminResponse = { } return message; }, - fromPartial(_: Partial): MsgClearAdminResponse { - const message = createBaseMsgClearAdminResponse(); + fromPartial(object: Partial): MsgStoreAndMigrateContractResponse { + const message = createBaseMsgStoreAndMigrateContractResponse(); + message.codeId = object.codeId !== undefined && object.codeId !== null ? BigInt(object.codeId.toString()) : BigInt(0); + message.checksum = object.checksum ?? new Uint8Array(); + message.data = object.data ?? new Uint8Array(); return message; }, - fromAmino(_: MsgClearAdminResponseAmino): MsgClearAdminResponse { - return {}; + fromAmino(object: MsgStoreAndMigrateContractResponseAmino): MsgStoreAndMigrateContractResponse { + const message = createBaseMsgStoreAndMigrateContractResponse(); + if (object.code_id !== undefined && object.code_id !== null) { + message.codeId = BigInt(object.code_id); + } + if (object.checksum !== undefined && object.checksum !== null) { + message.checksum = bytesFromBase64(object.checksum); + } + if (object.data !== undefined && object.data !== null) { + message.data = bytesFromBase64(object.data); + } + return message; }, - toAmino(_: MsgClearAdminResponse): MsgClearAdminResponseAmino { + toAmino(message: MsgStoreAndMigrateContractResponse): MsgStoreAndMigrateContractResponseAmino { const obj: any = {}; + obj.code_id = message.codeId ? message.codeId.toString() : undefined; + obj.checksum = message.checksum ? base64FromBytes(message.checksum) : undefined; + obj.data = message.data ? base64FromBytes(message.data) : undefined; return obj; }, - fromAminoMsg(object: MsgClearAdminResponseAminoMsg): MsgClearAdminResponse { - return MsgClearAdminResponse.fromAmino(object.value); + fromAminoMsg(object: MsgStoreAndMigrateContractResponseAminoMsg): MsgStoreAndMigrateContractResponse { + return MsgStoreAndMigrateContractResponse.fromAmino(object.value); }, - toAminoMsg(message: MsgClearAdminResponse): MsgClearAdminResponseAminoMsg { + toAminoMsg(message: MsgStoreAndMigrateContractResponse): MsgStoreAndMigrateContractResponseAminoMsg { return { - type: "wasm/MsgClearAdminResponse", - value: MsgClearAdminResponse.toAmino(message) + type: "wasm/MsgStoreAndMigrateContractResponse", + value: MsgStoreAndMigrateContractResponse.toAmino(message) }; }, - fromProtoMsg(message: MsgClearAdminResponseProtoMsg): MsgClearAdminResponse { - return MsgClearAdminResponse.decode(message.value); + fromProtoMsg(message: MsgStoreAndMigrateContractResponseProtoMsg): MsgStoreAndMigrateContractResponse { + return MsgStoreAndMigrateContractResponse.decode(message.value); }, - toProto(message: MsgClearAdminResponse): Uint8Array { - return MsgClearAdminResponse.encode(message).finish(); + toProto(message: MsgStoreAndMigrateContractResponse): Uint8Array { + return MsgStoreAndMigrateContractResponse.encode(message).finish(); }, - toProtoMsg(message: MsgClearAdminResponse): MsgClearAdminResponseProtoMsg { + toProtoMsg(message: MsgStoreAndMigrateContractResponse): MsgStoreAndMigrateContractResponseProtoMsg { return { - typeUrl: "/cosmwasm.wasm.v1.MsgClearAdminResponse", - value: MsgClearAdminResponse.encode(message).finish() + typeUrl: "/cosmwasm.wasm.v1.MsgStoreAndMigrateContractResponse", + value: MsgStoreAndMigrateContractResponse.encode(message).finish() }; } }; -function createBaseMsgUpdateInstantiateConfig(): MsgUpdateInstantiateConfig { +function createBaseMsgUpdateContractLabel(): MsgUpdateContractLabel { return { sender: "", - codeId: BigInt(0), - newInstantiatePermission: AccessConfig.fromPartial({}) + newLabel: "", + contract: "" }; } -export const MsgUpdateInstantiateConfig = { - typeUrl: "/cosmwasm.wasm.v1.MsgUpdateInstantiateConfig", - encode(message: MsgUpdateInstantiateConfig, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { +export const MsgUpdateContractLabel = { + typeUrl: "/cosmwasm.wasm.v1.MsgUpdateContractLabel", + encode(message: MsgUpdateContractLabel, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.sender !== "") { writer.uint32(10).string(message.sender); } - if (message.codeId !== BigInt(0)) { - writer.uint32(16).uint64(message.codeId); + if (message.newLabel !== "") { + writer.uint32(18).string(message.newLabel); } - if (message.newInstantiatePermission !== undefined) { - AccessConfig.encode(message.newInstantiatePermission, writer.uint32(26).fork()).ldelim(); + if (message.contract !== "") { + writer.uint32(26).string(message.contract); } return writer; }, - decode(input: BinaryReader | Uint8Array, length?: number): MsgUpdateInstantiateConfig { + decode(input: BinaryReader | Uint8Array, length?: number): MsgUpdateContractLabel { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseMsgUpdateInstantiateConfig(); + const message = createBaseMsgUpdateContractLabel(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -1724,10 +4011,10 @@ export const MsgUpdateInstantiateConfig = { message.sender = reader.string(); break; case 2: - message.codeId = reader.uint64(); + message.newLabel = reader.string(); break; case 3: - message.newInstantiatePermission = AccessConfig.decode(reader, reader.uint32()); + message.contract = reader.string(); break; default: reader.skipType(tag & 7); @@ -1736,61 +4023,67 @@ export const MsgUpdateInstantiateConfig = { } return message; }, - fromPartial(object: Partial): MsgUpdateInstantiateConfig { - const message = createBaseMsgUpdateInstantiateConfig(); + fromPartial(object: Partial): MsgUpdateContractLabel { + const message = createBaseMsgUpdateContractLabel(); message.sender = object.sender ?? ""; - message.codeId = object.codeId !== undefined && object.codeId !== null ? BigInt(object.codeId.toString()) : BigInt(0); - message.newInstantiatePermission = object.newInstantiatePermission !== undefined && object.newInstantiatePermission !== null ? AccessConfig.fromPartial(object.newInstantiatePermission) : undefined; + message.newLabel = object.newLabel ?? ""; + message.contract = object.contract ?? ""; return message; }, - fromAmino(object: MsgUpdateInstantiateConfigAmino): MsgUpdateInstantiateConfig { - return { - sender: object.sender, - codeId: BigInt(object.code_id), - newInstantiatePermission: object?.new_instantiate_permission ? AccessConfig.fromAmino(object.new_instantiate_permission) : undefined - }; + fromAmino(object: MsgUpdateContractLabelAmino): MsgUpdateContractLabel { + const message = createBaseMsgUpdateContractLabel(); + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + if (object.new_label !== undefined && object.new_label !== null) { + message.newLabel = object.new_label; + } + if (object.contract !== undefined && object.contract !== null) { + message.contract = object.contract; + } + return message; }, - toAmino(message: MsgUpdateInstantiateConfig): MsgUpdateInstantiateConfigAmino { + toAmino(message: MsgUpdateContractLabel): MsgUpdateContractLabelAmino { const obj: any = {}; obj.sender = message.sender; - obj.code_id = message.codeId ? message.codeId.toString() : undefined; - obj.new_instantiate_permission = message.newInstantiatePermission ? AccessConfig.toAmino(message.newInstantiatePermission) : undefined; + obj.new_label = message.newLabel; + obj.contract = message.contract; return obj; }, - fromAminoMsg(object: MsgUpdateInstantiateConfigAminoMsg): MsgUpdateInstantiateConfig { - return MsgUpdateInstantiateConfig.fromAmino(object.value); + fromAminoMsg(object: MsgUpdateContractLabelAminoMsg): MsgUpdateContractLabel { + return MsgUpdateContractLabel.fromAmino(object.value); }, - toAminoMsg(message: MsgUpdateInstantiateConfig): MsgUpdateInstantiateConfigAminoMsg { + toAminoMsg(message: MsgUpdateContractLabel): MsgUpdateContractLabelAminoMsg { return { - type: "wasm/MsgUpdateInstantiateConfig", - value: MsgUpdateInstantiateConfig.toAmino(message) + type: "wasm/MsgUpdateContractLabel", + value: MsgUpdateContractLabel.toAmino(message) }; }, - fromProtoMsg(message: MsgUpdateInstantiateConfigProtoMsg): MsgUpdateInstantiateConfig { - return MsgUpdateInstantiateConfig.decode(message.value); + fromProtoMsg(message: MsgUpdateContractLabelProtoMsg): MsgUpdateContractLabel { + return MsgUpdateContractLabel.decode(message.value); }, - toProto(message: MsgUpdateInstantiateConfig): Uint8Array { - return MsgUpdateInstantiateConfig.encode(message).finish(); + toProto(message: MsgUpdateContractLabel): Uint8Array { + return MsgUpdateContractLabel.encode(message).finish(); }, - toProtoMsg(message: MsgUpdateInstantiateConfig): MsgUpdateInstantiateConfigProtoMsg { + toProtoMsg(message: MsgUpdateContractLabel): MsgUpdateContractLabelProtoMsg { return { - typeUrl: "/cosmwasm.wasm.v1.MsgUpdateInstantiateConfig", - value: MsgUpdateInstantiateConfig.encode(message).finish() + typeUrl: "/cosmwasm.wasm.v1.MsgUpdateContractLabel", + value: MsgUpdateContractLabel.encode(message).finish() }; } }; -function createBaseMsgUpdateInstantiateConfigResponse(): MsgUpdateInstantiateConfigResponse { +function createBaseMsgUpdateContractLabelResponse(): MsgUpdateContractLabelResponse { return {}; } -export const MsgUpdateInstantiateConfigResponse = { - typeUrl: "/cosmwasm.wasm.v1.MsgUpdateInstantiateConfigResponse", - encode(_: MsgUpdateInstantiateConfigResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { +export const MsgUpdateContractLabelResponse = { + typeUrl: "/cosmwasm.wasm.v1.MsgUpdateContractLabelResponse", + encode(_: MsgUpdateContractLabelResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, - decode(input: BinaryReader | Uint8Array, length?: number): MsgUpdateInstantiateConfigResponse { + decode(input: BinaryReader | Uint8Array, length?: number): MsgUpdateContractLabelResponse { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseMsgUpdateInstantiateConfigResponse(); + const message = createBaseMsgUpdateContractLabelResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -1801,36 +4094,37 @@ export const MsgUpdateInstantiateConfigResponse = { } return message; }, - fromPartial(_: Partial): MsgUpdateInstantiateConfigResponse { - const message = createBaseMsgUpdateInstantiateConfigResponse(); + fromPartial(_: Partial): MsgUpdateContractLabelResponse { + const message = createBaseMsgUpdateContractLabelResponse(); return message; }, - fromAmino(_: MsgUpdateInstantiateConfigResponseAmino): MsgUpdateInstantiateConfigResponse { - return {}; + fromAmino(_: MsgUpdateContractLabelResponseAmino): MsgUpdateContractLabelResponse { + const message = createBaseMsgUpdateContractLabelResponse(); + return message; }, - toAmino(_: MsgUpdateInstantiateConfigResponse): MsgUpdateInstantiateConfigResponseAmino { + toAmino(_: MsgUpdateContractLabelResponse): MsgUpdateContractLabelResponseAmino { const obj: any = {}; return obj; }, - fromAminoMsg(object: MsgUpdateInstantiateConfigResponseAminoMsg): MsgUpdateInstantiateConfigResponse { - return MsgUpdateInstantiateConfigResponse.fromAmino(object.value); + fromAminoMsg(object: MsgUpdateContractLabelResponseAminoMsg): MsgUpdateContractLabelResponse { + return MsgUpdateContractLabelResponse.fromAmino(object.value); }, - toAminoMsg(message: MsgUpdateInstantiateConfigResponse): MsgUpdateInstantiateConfigResponseAminoMsg { + toAminoMsg(message: MsgUpdateContractLabelResponse): MsgUpdateContractLabelResponseAminoMsg { return { - type: "wasm/MsgUpdateInstantiateConfigResponse", - value: MsgUpdateInstantiateConfigResponse.toAmino(message) + type: "wasm/MsgUpdateContractLabelResponse", + value: MsgUpdateContractLabelResponse.toAmino(message) }; }, - fromProtoMsg(message: MsgUpdateInstantiateConfigResponseProtoMsg): MsgUpdateInstantiateConfigResponse { - return MsgUpdateInstantiateConfigResponse.decode(message.value); + fromProtoMsg(message: MsgUpdateContractLabelResponseProtoMsg): MsgUpdateContractLabelResponse { + return MsgUpdateContractLabelResponse.decode(message.value); }, - toProto(message: MsgUpdateInstantiateConfigResponse): Uint8Array { - return MsgUpdateInstantiateConfigResponse.encode(message).finish(); + toProto(message: MsgUpdateContractLabelResponse): Uint8Array { + return MsgUpdateContractLabelResponse.encode(message).finish(); }, - toProtoMsg(message: MsgUpdateInstantiateConfigResponse): MsgUpdateInstantiateConfigResponseProtoMsg { + toProtoMsg(message: MsgUpdateContractLabelResponse): MsgUpdateContractLabelResponseProtoMsg { return { - typeUrl: "/cosmwasm.wasm.v1.MsgUpdateInstantiateConfigResponse", - value: MsgUpdateInstantiateConfigResponse.encode(message).finish() + typeUrl: "/cosmwasm.wasm.v1.MsgUpdateContractLabelResponse", + value: MsgUpdateContractLabelResponse.encode(message).finish() }; } }; \ No newline at end of file diff --git a/packages/osmo-query/src/codegen/cosmwasm/wasm/v1/types.ts b/packages/osmo-query/src/codegen/cosmwasm/wasm/v1/types.ts index a104e119a..c4936a551 100644 --- a/packages/osmo-query/src/codegen/cosmwasm/wasm/v1/types.ts +++ b/packages/osmo-query/src/codegen/cosmwasm/wasm/v1/types.ts @@ -1,6 +1,6 @@ import { Any, AnyProtoMsg, AnyAmino, AnySDKType } from "../../../google/protobuf/any"; import { BinaryReader, BinaryWriter } from "../../../binary"; -import { isSet } from "../../../helpers"; +import { bytesFromBase64, base64FromBytes } from "../../../helpers"; import { toUtf8, fromUtf8 } from "@cosmjs/encoding"; /** AccessType permission types */ export enum AccessType { @@ -8,11 +8,6 @@ export enum AccessType { ACCESS_TYPE_UNSPECIFIED = 0, /** ACCESS_TYPE_NOBODY - AccessTypeNobody forbidden */ ACCESS_TYPE_NOBODY = 1, - /** - * ACCESS_TYPE_ONLY_ADDRESS - AccessTypeOnlyAddress restricted to a single address - * Deprecated: use AccessTypeAnyOfAddresses instead - */ - ACCESS_TYPE_ONLY_ADDRESS = 2, /** ACCESS_TYPE_EVERYBODY - AccessTypeEverybody unrestricted */ ACCESS_TYPE_EVERYBODY = 3, /** ACCESS_TYPE_ANY_OF_ADDRESSES - AccessTypeAnyOfAddresses allow any of the addresses */ @@ -29,9 +24,6 @@ export function accessTypeFromJSON(object: any): AccessType { case 1: case "ACCESS_TYPE_NOBODY": return AccessType.ACCESS_TYPE_NOBODY; - case 2: - case "ACCESS_TYPE_ONLY_ADDRESS": - return AccessType.ACCESS_TYPE_ONLY_ADDRESS; case 3: case "ACCESS_TYPE_EVERYBODY": return AccessType.ACCESS_TYPE_EVERYBODY; @@ -50,8 +42,6 @@ export function accessTypeToJSON(object: AccessType): string { return "ACCESS_TYPE_UNSPECIFIED"; case AccessType.ACCESS_TYPE_NOBODY: return "ACCESS_TYPE_NOBODY"; - case AccessType.ACCESS_TYPE_ONLY_ADDRESS: - return "ACCESS_TYPE_ONLY_ADDRESS"; case AccessType.ACCESS_TYPE_EVERYBODY: return "ACCESS_TYPE_EVERYBODY"; case AccessType.ACCESS_TYPE_ANY_OF_ADDRESSES: @@ -120,7 +110,7 @@ export interface AccessTypeParamProtoMsg { } /** AccessTypeParam */ export interface AccessTypeParamAmino { - value: AccessType; + value?: AccessType; } export interface AccessTypeParamAminoMsg { type: "wasm/AccessTypeParam"; @@ -133,11 +123,6 @@ export interface AccessTypeParamSDKType { /** AccessConfig access control type. */ export interface AccessConfig { permission: AccessType; - /** - * Address - * Deprecated: replaced by addresses - */ - address: string; addresses: string[]; } export interface AccessConfigProtoMsg { @@ -146,13 +131,8 @@ export interface AccessConfigProtoMsg { } /** AccessConfig access control type. */ export interface AccessConfigAmino { - permission: AccessType; - /** - * Address - * Deprecated: replaced by addresses - */ - address: string; - addresses: string[]; + permission?: AccessType; + addresses?: string[]; } export interface AccessConfigAminoMsg { type: "wasm/AccessConfig"; @@ -161,7 +141,6 @@ export interface AccessConfigAminoMsg { /** AccessConfig access control type. */ export interface AccessConfigSDKType { permission: AccessType; - address: string; addresses: string[]; } /** Params defines the set of wasm parameters. */ @@ -175,8 +154,8 @@ export interface ParamsProtoMsg { } /** Params defines the set of wasm parameters. */ export interface ParamsAmino { - code_upload_access?: AccessConfigAmino; - instantiate_default_permission: AccessType; + code_upload_access: AccessConfigAmino; + instantiate_default_permission?: AccessType; } export interface ParamsAminoMsg { type: "wasm/Params"; @@ -203,11 +182,11 @@ export interface CodeInfoProtoMsg { /** CodeInfo is data for the uploaded contract WASM code */ export interface CodeInfoAmino { /** CodeHash is the unique identifier created by wasmvm */ - code_hash: Uint8Array; + code_hash?: string; /** Creator address who initially stored the code */ - creator: string; + creator?: string; /** InstantiateConfig access control to apply on contract creation, optional */ - instantiate_config?: AccessConfigAmino; + instantiate_config: AccessConfigAmino; } export interface CodeInfoAminoMsg { type: "wasm/CodeInfo"; @@ -230,13 +209,13 @@ export interface ContractInfo { /** Label is optional metadata to be stored with a contract instance. */ label: string; /** Created Tx position when the contract was instantiated. */ - created: AbsoluteTxPosition; + created?: AbsoluteTxPosition; ibcPortId: string; /** * Extension is an extension point to store custom metadata within the * persistence model. */ - extension: (Any) | undefined; + extension?: (Any) | undefined; } export interface ContractInfoProtoMsg { typeUrl: "/cosmwasm.wasm.v1.ContractInfo"; @@ -252,16 +231,16 @@ export type ContractInfoEncoded = Omit & { /** ContractInfo stores a WASM contract instance */ export interface ContractInfoAmino { /** CodeID is the reference to the stored Wasm code */ - code_id: string; + code_id?: string; /** Creator address who initially instantiated the contract */ - creator: string; + creator?: string; /** Admin is an optional address that can execute migrations */ - admin: string; + admin?: string; /** Label is optional metadata to be stored with a contract instance. */ - label: string; + label?: string; /** Created Tx position when the contract was instantiated. */ created?: AbsoluteTxPositionAmino; - ibc_port_id: string; + ibc_port_id?: string; /** * Extension is an extension point to store custom metadata within the * persistence model. @@ -278,9 +257,9 @@ export interface ContractInfoSDKType { creator: string; admin: string; label: string; - created: AbsoluteTxPositionSDKType; + created?: AbsoluteTxPositionSDKType; ibc_port_id: string; - extension: AnySDKType | undefined; + extension?: AnySDKType | undefined; } /** ContractCodeHistoryEntry metadata to a contract. */ export interface ContractCodeHistoryEntry { @@ -288,7 +267,7 @@ export interface ContractCodeHistoryEntry { /** CodeID is the reference to the stored WASM code */ codeId: bigint; /** Updated Tx position when the operation was executed. */ - updated: AbsoluteTxPosition; + updated?: AbsoluteTxPosition; msg: Uint8Array; } export interface ContractCodeHistoryEntryProtoMsg { @@ -297,12 +276,12 @@ export interface ContractCodeHistoryEntryProtoMsg { } /** ContractCodeHistoryEntry metadata to a contract. */ export interface ContractCodeHistoryEntryAmino { - operation: ContractCodeHistoryOperationType; + operation?: ContractCodeHistoryOperationType; /** CodeID is the reference to the stored WASM code */ - code_id: string; + code_id?: string; /** Updated Tx position when the operation was executed. */ updated?: AbsoluteTxPositionAmino; - msg: Uint8Array; + msg?: any; } export interface ContractCodeHistoryEntryAminoMsg { type: "wasm/ContractCodeHistoryEntry"; @@ -312,7 +291,7 @@ export interface ContractCodeHistoryEntryAminoMsg { export interface ContractCodeHistoryEntrySDKType { operation: ContractCodeHistoryOperationType; code_id: bigint; - updated: AbsoluteTxPositionSDKType; + updated?: AbsoluteTxPositionSDKType; msg: Uint8Array; } /** @@ -338,12 +317,12 @@ export interface AbsoluteTxPositionProtoMsg { */ export interface AbsoluteTxPositionAmino { /** BlockHeight is the block the contract was created at */ - block_height: string; + block_height?: string; /** * TxIndex is a monotonic counter within the block (actual transaction index, * or gas consumed) */ - tx_index: string; + tx_index?: string; } export interface AbsoluteTxPositionAminoMsg { type: "wasm/AbsoluteTxPosition"; @@ -371,9 +350,9 @@ export interface ModelProtoMsg { /** Model is a struct that holds a KV pair */ export interface ModelAmino { /** hex-encode key to read it better (this is often ascii) */ - key: Uint8Array; + key?: string; /** base64-encode raw value */ - value: Uint8Array; + value?: string; } export interface ModelAminoMsg { type: "wasm/Model"; @@ -420,13 +399,15 @@ export const AccessTypeParam = { return message; }, fromAmino(object: AccessTypeParamAmino): AccessTypeParam { - return { - value: isSet(object.value) ? accessTypeFromJSON(object.value) : -1 - }; + const message = createBaseAccessTypeParam(); + if (object.value !== undefined && object.value !== null) { + message.value = accessTypeFromJSON(object.value); + } + return message; }, toAmino(message: AccessTypeParam): AccessTypeParamAmino { const obj: any = {}; - obj.value = message.value; + obj.value = accessTypeToJSON(message.value); return obj; }, fromAminoMsg(object: AccessTypeParamAminoMsg): AccessTypeParam { @@ -454,7 +435,6 @@ export const AccessTypeParam = { function createBaseAccessConfig(): AccessConfig { return { permission: 0, - address: "", addresses: [] }; } @@ -464,9 +444,6 @@ export const AccessConfig = { if (message.permission !== 0) { writer.uint32(8).int32(message.permission); } - if (message.address !== "") { - writer.uint32(18).string(message.address); - } for (const v of message.addresses) { writer.uint32(26).string(v!); } @@ -482,9 +459,6 @@ export const AccessConfig = { case 1: message.permission = (reader.int32() as any); break; - case 2: - message.address = reader.string(); - break; case 3: message.addresses.push(reader.string()); break; @@ -498,21 +472,20 @@ export const AccessConfig = { fromPartial(object: Partial): AccessConfig { const message = createBaseAccessConfig(); message.permission = object.permission ?? 0; - message.address = object.address ?? ""; message.addresses = object.addresses?.map(e => e) || []; return message; }, fromAmino(object: AccessConfigAmino): AccessConfig { - return { - permission: isSet(object.permission) ? accessTypeFromJSON(object.permission) : -1, - address: object.address, - addresses: Array.isArray(object?.addresses) ? object.addresses.map((e: any) => e) : [] - }; + const message = createBaseAccessConfig(); + if (object.permission !== undefined && object.permission !== null) { + message.permission = accessTypeFromJSON(object.permission); + } + message.addresses = object.addresses?.map(e => e) || []; + return message; }, toAmino(message: AccessConfig): AccessConfigAmino { const obj: any = {}; - obj.permission = message.permission; - obj.address = message.address; + obj.permission = accessTypeToJSON(message.permission); if (message.addresses) { obj.addresses = message.addresses.map(e => e); } else { @@ -586,15 +559,19 @@ export const Params = { return message; }, fromAmino(object: ParamsAmino): Params { - return { - codeUploadAccess: object?.code_upload_access ? AccessConfig.fromAmino(object.code_upload_access) : undefined, - instantiateDefaultPermission: isSet(object.instantiate_default_permission) ? accessTypeFromJSON(object.instantiate_default_permission) : -1 - }; + const message = createBaseParams(); + if (object.code_upload_access !== undefined && object.code_upload_access !== null) { + message.codeUploadAccess = AccessConfig.fromAmino(object.code_upload_access); + } + if (object.instantiate_default_permission !== undefined && object.instantiate_default_permission !== null) { + message.instantiateDefaultPermission = accessTypeFromJSON(object.instantiate_default_permission); + } + return message; }, toAmino(message: Params): ParamsAmino { const obj: any = {}; - obj.code_upload_access = message.codeUploadAccess ? AccessConfig.toAmino(message.codeUploadAccess) : undefined; - obj.instantiate_default_permission = message.instantiateDefaultPermission; + obj.code_upload_access = message.codeUploadAccess ? AccessConfig.toAmino(message.codeUploadAccess) : AccessConfig.fromPartial({}); + obj.instantiate_default_permission = accessTypeToJSON(message.instantiateDefaultPermission); return obj; }, fromAminoMsg(object: ParamsAminoMsg): Params { @@ -671,17 +648,23 @@ export const CodeInfo = { return message; }, fromAmino(object: CodeInfoAmino): CodeInfo { - return { - codeHash: object.code_hash, - creator: object.creator, - instantiateConfig: object?.instantiate_config ? AccessConfig.fromAmino(object.instantiate_config) : undefined - }; + const message = createBaseCodeInfo(); + if (object.code_hash !== undefined && object.code_hash !== null) { + message.codeHash = bytesFromBase64(object.code_hash); + } + if (object.creator !== undefined && object.creator !== null) { + message.creator = object.creator; + } + if (object.instantiate_config !== undefined && object.instantiate_config !== null) { + message.instantiateConfig = AccessConfig.fromAmino(object.instantiate_config); + } + return message; }, toAmino(message: CodeInfo): CodeInfoAmino { const obj: any = {}; - obj.code_hash = message.codeHash; + obj.code_hash = message.codeHash ? base64FromBytes(message.codeHash) : undefined; obj.creator = message.creator; - obj.instantiate_config = message.instantiateConfig ? AccessConfig.toAmino(message.instantiateConfig) : undefined; + obj.instantiate_config = message.instantiateConfig ? AccessConfig.toAmino(message.instantiateConfig) : AccessConfig.fromPartial({}); return obj; }, fromAminoMsg(object: CodeInfoAminoMsg): CodeInfo { @@ -712,9 +695,9 @@ function createBaseContractInfo(): ContractInfo { creator: "", admin: "", label: "", - created: AbsoluteTxPosition.fromPartial({}), + created: undefined, ibcPortId: "", - extension: Any.fromPartial({}) + extension: undefined }; } export const ContractInfo = { @@ -790,15 +773,29 @@ export const ContractInfo = { return message; }, fromAmino(object: ContractInfoAmino): ContractInfo { - return { - codeId: BigInt(object.code_id), - creator: object.creator, - admin: object.admin, - label: object.label, - created: object?.created ? AbsoluteTxPosition.fromAmino(object.created) : undefined, - ibcPortId: object.ibc_port_id, - extension: object?.extension ? Cosmwasm_wasmv1ContractInfoExtension_FromAmino(object.extension) : undefined - }; + const message = createBaseContractInfo(); + if (object.code_id !== undefined && object.code_id !== null) { + message.codeId = BigInt(object.code_id); + } + if (object.creator !== undefined && object.creator !== null) { + message.creator = object.creator; + } + if (object.admin !== undefined && object.admin !== null) { + message.admin = object.admin; + } + if (object.label !== undefined && object.label !== null) { + message.label = object.label; + } + if (object.created !== undefined && object.created !== null) { + message.created = AbsoluteTxPosition.fromAmino(object.created); + } + if (object.ibc_port_id !== undefined && object.ibc_port_id !== null) { + message.ibcPortId = object.ibc_port_id; + } + if (object.extension !== undefined && object.extension !== null) { + message.extension = Cosmwasm_wasmv1ContractInfoExtension_FromAmino(object.extension); + } + return message; }, toAmino(message: ContractInfo): ContractInfoAmino { const obj: any = {}; @@ -837,7 +834,7 @@ function createBaseContractCodeHistoryEntry(): ContractCodeHistoryEntry { return { operation: 0, codeId: BigInt(0), - updated: AbsoluteTxPosition.fromPartial({}), + updated: undefined, msg: new Uint8Array() }; } @@ -893,16 +890,24 @@ export const ContractCodeHistoryEntry = { return message; }, fromAmino(object: ContractCodeHistoryEntryAmino): ContractCodeHistoryEntry { - return { - operation: isSet(object.operation) ? contractCodeHistoryOperationTypeFromJSON(object.operation) : -1, - codeId: BigInt(object.code_id), - updated: object?.updated ? AbsoluteTxPosition.fromAmino(object.updated) : undefined, - msg: toUtf8(JSON.stringify(object.msg)) - }; + const message = createBaseContractCodeHistoryEntry(); + if (object.operation !== undefined && object.operation !== null) { + message.operation = contractCodeHistoryOperationTypeFromJSON(object.operation); + } + if (object.code_id !== undefined && object.code_id !== null) { + message.codeId = BigInt(object.code_id); + } + if (object.updated !== undefined && object.updated !== null) { + message.updated = AbsoluteTxPosition.fromAmino(object.updated); + } + if (object.msg !== undefined && object.msg !== null) { + message.msg = toUtf8(JSON.stringify(object.msg)); + } + return message; }, toAmino(message: ContractCodeHistoryEntry): ContractCodeHistoryEntryAmino { const obj: any = {}; - obj.operation = message.operation; + obj.operation = contractCodeHistoryOperationTypeToJSON(message.operation); obj.code_id = message.codeId ? message.codeId.toString() : undefined; obj.updated = message.updated ? AbsoluteTxPosition.toAmino(message.updated) : undefined; obj.msg = message.msg ? JSON.parse(fromUtf8(message.msg)) : undefined; @@ -974,10 +979,14 @@ export const AbsoluteTxPosition = { return message; }, fromAmino(object: AbsoluteTxPositionAmino): AbsoluteTxPosition { - return { - blockHeight: BigInt(object.block_height), - txIndex: BigInt(object.tx_index) - }; + const message = createBaseAbsoluteTxPosition(); + if (object.block_height !== undefined && object.block_height !== null) { + message.blockHeight = BigInt(object.block_height); + } + if (object.tx_index !== undefined && object.tx_index !== null) { + message.txIndex = BigInt(object.tx_index); + } + return message; }, toAmino(message: AbsoluteTxPosition): AbsoluteTxPositionAmino { const obj: any = {}; @@ -1051,15 +1060,19 @@ export const Model = { return message; }, fromAmino(object: ModelAmino): Model { - return { - key: object.key, - value: object.value - }; + const message = createBaseModel(); + if (object.key !== undefined && object.key !== null) { + message.key = bytesFromBase64(object.key); + } + if (object.value !== undefined && object.value !== null) { + message.value = bytesFromBase64(object.value); + } + return message; }, toAmino(message: Model): ModelAmino { const obj: any = {}; - obj.key = message.key; - obj.value = message.value; + obj.key = message.key ? base64FromBytes(message.key) : undefined; + obj.value = message.value ? base64FromBytes(message.value) : undefined; return obj; }, fromAminoMsg(object: ModelAminoMsg): Model { @@ -1086,7 +1099,7 @@ export const Model = { }; export const Cosmwasm_wasmv1ContractInfoExtension_InterfaceDecoder = (input: BinaryReader | Uint8Array): Any => { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - const data = Any.decode(reader, reader.uint32()); + const data = Any.decode(reader, reader.uint32(), true); switch (data.typeUrl) { default: return data; diff --git a/packages/osmo-query/src/codegen/extern.ts b/packages/osmo-query/src/codegen/extern.ts index c0357383d..0bdd0ece6 100644 --- a/packages/osmo-query/src/codegen/extern.ts +++ b/packages/osmo-query/src/codegen/extern.ts @@ -1,11 +1,11 @@ /** -* This file and any referenced files were automatically generated by @cosmology/telescope@0.102.0 +* This file and any referenced files were automatically generated by @cosmology/telescope@1.4.1 * DO NOT MODIFY BY HAND. Instead, download the latest proto files for your chain * and run the transpile command or yarn proto command to regenerate this bundle. */ import { QueryClient, createProtobufRpcClient, ProtobufRpcClient } from '@cosmjs/stargate' -import { HttpEndpoint, connectComet } from "@cosmjs/tendermint-rpc"; +import { Tendermint34Client, HttpEndpoint } from "@cosmjs/tendermint-rpc"; const _rpcClients: Record = {}; @@ -24,7 +24,7 @@ export const getRpcClient = async (rpcEndpoint: string | HttpEndpoint) => { if (_rpcClients.hasOwnProperty(key)) { return _rpcClients[key]; } - const tmClient = await connectComet(rpcEndpoint); + const tmClient = await Tendermint34Client.connect(rpcEndpoint); //@ts-ignore const client = new QueryClient(tmClient); const rpc = createProtobufRpcClient(client); diff --git a/packages/osmo-query/src/codegen/gogoproto/bundle.ts b/packages/osmo-query/src/codegen/gogoproto/bundle.ts index 17083f96a..434018959 100644 --- a/packages/osmo-query/src/codegen/gogoproto/bundle.ts +++ b/packages/osmo-query/src/codegen/gogoproto/bundle.ts @@ -1,4 +1,4 @@ -import * as _173 from "./gogo"; +import * as _229 from "./gogo"; export const gogoproto = { - ..._173 + ..._229 }; \ No newline at end of file diff --git a/packages/osmo-query/src/codegen/google/api/http.ts b/packages/osmo-query/src/codegen/google/api/http.ts index d91fd573f..a3dbb7639 100644 --- a/packages/osmo-query/src/codegen/google/api/http.ts +++ b/packages/osmo-query/src/codegen/google/api/http.ts @@ -36,7 +36,7 @@ export interface HttpAmino { * * **NOTE:** All service configuration rules follow "last one wins" order. */ - rules: HttpRuleAmino[]; + rules?: HttpRuleAmino[]; /** * When set to true, URL path parameters will be fully URI-decoded except in * cases of single segment matches in reserved expansion, where "%2F" will be @@ -45,7 +45,7 @@ export interface HttpAmino { * The default behavior is to not decode RFC 6570 reserved characters in multi * segment matches. */ - fully_decode_reserved_expansion: boolean; + fully_decode_reserved_expansion?: boolean; } export interface HttpAminoMsg { type: "/google.api.Http"; @@ -664,7 +664,7 @@ export interface HttpRuleAmino { * * Refer to [selector][google.api.DocumentationRule.selector] for syntax details. */ - selector: string; + selector?: string; /** * Maps to HTTP GET. Used for listing and getting information about * resources. @@ -693,7 +693,7 @@ export interface HttpRuleAmino { * NOTE: the referred field must be present at the top-level of the request * message type. */ - body: string; + body?: string; /** * Optional. The name of the response field whose value is mapped to the HTTP * response body. When omitted, the entire response message will be used @@ -702,13 +702,13 @@ export interface HttpRuleAmino { * NOTE: The referred field must be present at the top-level of the response * message type. */ - response_body: string; + response_body?: 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). */ - additional_bindings: HttpRuleAmino[]; + additional_bindings?: HttpRuleAmino[]; } export interface HttpRuleAminoMsg { type: "/google.api.HttpRule"; @@ -1011,9 +1011,9 @@ export interface CustomHttpPatternProtoMsg { /** A custom pattern is used for defining custom HTTP verb. */ export interface CustomHttpPatternAmino { /** The name of this custom HTTP verb. */ - kind: string; + kind?: string; /** The path matched by this custom verb. */ - path: string; + path?: string; } export interface CustomHttpPatternAminoMsg { type: "/google.api.CustomHttpPattern"; @@ -1068,10 +1068,12 @@ export const Http = { return message; }, fromAmino(object: HttpAmino): Http { - return { - rules: Array.isArray(object?.rules) ? object.rules.map((e: any) => HttpRule.fromAmino(e)) : [], - fullyDecodeReservedExpansion: object.fully_decode_reserved_expansion - }; + const message = createBaseHttp(); + message.rules = object.rules?.map(e => HttpRule.fromAmino(e)) || []; + if (object.fully_decode_reserved_expansion !== undefined && object.fully_decode_reserved_expansion !== null) { + message.fullyDecodeReservedExpansion = object.fully_decode_reserved_expansion; + } + return message; }, toAmino(message: Http): HttpAmino { const obj: any = {}; @@ -1207,18 +1209,36 @@ export const HttpRule = { return message; }, fromAmino(object: HttpRuleAmino): HttpRule { - return { - selector: object.selector, - get: object?.get, - put: object?.put, - post: object?.post, - delete: object?.delete, - patch: object?.patch, - custom: object?.custom ? CustomHttpPattern.fromAmino(object.custom) : undefined, - body: object.body, - responseBody: object.response_body, - additionalBindings: Array.isArray(object?.additional_bindings) ? object.additional_bindings.map((e: any) => HttpRule.fromAmino(e)) : [] - }; + const message = createBaseHttpRule(); + if (object.selector !== undefined && object.selector !== null) { + message.selector = object.selector; + } + if (object.get !== undefined && object.get !== null) { + message.get = object.get; + } + if (object.put !== undefined && object.put !== null) { + message.put = object.put; + } + if (object.post !== undefined && object.post !== null) { + message.post = object.post; + } + if (object.delete !== undefined && object.delete !== null) { + message.delete = object.delete; + } + if (object.patch !== undefined && object.patch !== null) { + message.patch = object.patch; + } + if (object.custom !== undefined && object.custom !== null) { + message.custom = CustomHttpPattern.fromAmino(object.custom); + } + if (object.body !== undefined && object.body !== null) { + message.body = object.body; + } + if (object.response_body !== undefined && object.response_body !== null) { + message.responseBody = object.response_body; + } + message.additionalBindings = object.additional_bindings?.map(e => HttpRule.fromAmino(e)) || []; + return message; }, toAmino(message: HttpRule): HttpRuleAmino { const obj: any = {}; @@ -1298,10 +1318,14 @@ export const CustomHttpPattern = { return message; }, fromAmino(object: CustomHttpPatternAmino): CustomHttpPattern { - return { - kind: object.kind, - path: object.path - }; + const message = createBaseCustomHttpPattern(); + if (object.kind !== undefined && object.kind !== null) { + message.kind = object.kind; + } + if (object.path !== undefined && object.path !== null) { + message.path = object.path; + } + return message; }, toAmino(message: CustomHttpPattern): CustomHttpPatternAmino { const obj: any = {}; diff --git a/packages/osmo-query/src/codegen/google/bundle.ts b/packages/osmo-query/src/codegen/google/bundle.ts index b198fe56a..75a74ca66 100644 --- a/packages/osmo-query/src/codegen/google/bundle.ts +++ b/packages/osmo-query/src/codegen/google/bundle.ts @@ -1,14 +1,14 @@ -import * as _174 from "./protobuf/any"; -import * as _175 from "./protobuf/descriptor"; -import * as _176 from "./protobuf/duration"; -import * as _177 from "./protobuf/empty"; -import * as _178 from "./protobuf/timestamp"; +import * as _230 from "./protobuf/any"; +import * as _231 from "./protobuf/descriptor"; +import * as _232 from "./protobuf/duration"; +import * as _233 from "./protobuf/empty"; +import * as _234 from "./protobuf/timestamp"; export namespace google { export const protobuf = { - ..._174, - ..._175, - ..._176, - ..._177, - ..._178 + ..._230, + ..._231, + ..._232, + ..._233, + ..._234 }; } \ No newline at end of file diff --git a/packages/osmo-query/src/codegen/google/protobuf/any.ts b/packages/osmo-query/src/codegen/google/protobuf/any.ts index 6c8e97ada..44e619ee0 100644 --- a/packages/osmo-query/src/codegen/google/protobuf/any.ts +++ b/packages/osmo-query/src/codegen/google/protobuf/any.ts @@ -81,7 +81,7 @@ import { BinaryReader, BinaryWriter } from "../../binary"; * } */ export interface Any { - $typeUrl?: string; + $typeUrl?: "/google.protobuf.Any"; /** * A URL/resource name that uniquely identifies the type of the serialized * protocol buffer message. This string must contain at least @@ -320,7 +320,7 @@ export interface AnyAminoMsg { * } */ export interface AnySDKType { - $typeUrl?: string; + $typeUrl?: "/google.protobuf.Any"; type_url: string; value: Uint8Array; } diff --git a/packages/osmo-query/src/codegen/google/protobuf/descriptor.ts b/packages/osmo-query/src/codegen/google/protobuf/descriptor.ts index d350846c4..4b74d803f 100644 --- a/packages/osmo-query/src/codegen/google/protobuf/descriptor.ts +++ b/packages/osmo-query/src/codegen/google/protobuf/descriptor.ts @@ -1,5 +1,5 @@ import { BinaryReader, BinaryWriter } from "../../binary"; -import { isSet } from "../../helpers"; +import { bytesFromBase64, base64FromBytes } from "../../helpers"; export enum FieldDescriptorProto_Type { /** * TYPE_DOUBLE - 0 is reserved for errors. @@ -374,7 +374,7 @@ export interface FileDescriptorSetProtoMsg { * files it parses. */ export interface FileDescriptorSetAmino { - file: FileDescriptorProtoAmino[]; + file?: FileDescriptorProtoAmino[]; } export interface FileDescriptorSetAminoMsg { type: "/google.protobuf.FileDescriptorSet"; @@ -406,14 +406,14 @@ export interface FileDescriptorProto { enumType: EnumDescriptorProto[]; service: ServiceDescriptorProto[]; extension: FieldDescriptorProto[]; - options: FileOptions; + 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". @@ -427,22 +427,22 @@ export interface FileDescriptorProtoProtoMsg { /** Describes a complete .proto file. */ export interface FileDescriptorProtoAmino { /** file name, relative to root of source tree */ - name: string; - package: string; + name?: 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. */ - public_dependency: number[]; + public_dependency?: number[]; /** * Indexes of the weak imported files in the dependency list. * For Google-internal migration only. Do not use. */ - weak_dependency: number[]; + weak_dependency?: number[]; /** All top-level definitions in this file. */ - message_type: DescriptorProtoAmino[]; - enum_type: EnumDescriptorProtoAmino[]; - service: ServiceDescriptorProtoAmino[]; - extension: FieldDescriptorProtoAmino[]; + message_type?: DescriptorProtoAmino[]; + enum_type?: EnumDescriptorProtoAmino[]; + service?: ServiceDescriptorProtoAmino[]; + extension?: FieldDescriptorProtoAmino[]; options?: FileOptionsAmino; /** * This field contains optional information about the original source code. @@ -455,7 +455,7 @@ export interface FileDescriptorProtoAmino { * The syntax of the proto file. * The supported values are "proto2" and "proto3". */ - syntax: string; + syntax?: string; } export interface FileDescriptorProtoAminoMsg { type: "/google.protobuf.FileDescriptorProto"; @@ -472,8 +472,8 @@ export interface FileDescriptorProtoSDKType { enum_type: EnumDescriptorProtoSDKType[]; service: ServiceDescriptorProtoSDKType[]; extension: FieldDescriptorProtoSDKType[]; - options: FileOptionsSDKType; - source_code_info: SourceCodeInfoSDKType; + options?: FileOptionsSDKType; + source_code_info?: SourceCodeInfoSDKType; syntax: string; } /** Describes a message type. */ @@ -485,7 +485,7 @@ export interface DescriptorProto { enumType: EnumDescriptorProto[]; extensionRange: DescriptorProto_ExtensionRange[]; oneofDecl: OneofDescriptorProto[]; - options: MessageOptions; + options?: MessageOptions; reservedRange: DescriptorProto_ReservedRange[]; /** * Reserved field names, which may not be used by fields in the same message. @@ -499,20 +499,20 @@ export interface DescriptorProtoProtoMsg { } /** Describes a message type. */ export interface DescriptorProtoAmino { - name: string; - field: FieldDescriptorProtoAmino[]; - extension: FieldDescriptorProtoAmino[]; - nested_type: DescriptorProtoAmino[]; - enum_type: EnumDescriptorProtoAmino[]; - extension_range: DescriptorProto_ExtensionRangeAmino[]; - oneof_decl: OneofDescriptorProtoAmino[]; + name?: string; + field?: FieldDescriptorProtoAmino[]; + extension?: FieldDescriptorProtoAmino[]; + nested_type?: DescriptorProtoAmino[]; + enum_type?: EnumDescriptorProtoAmino[]; + extension_range?: DescriptorProto_ExtensionRangeAmino[]; + oneof_decl?: OneofDescriptorProtoAmino[]; options?: MessageOptionsAmino; - reserved_range: DescriptorProto_ReservedRangeAmino[]; + reserved_range?: DescriptorProto_ReservedRangeAmino[]; /** * Reserved field names, which may not be used by fields in the same message. * A given name may only be reserved once. */ - reserved_name: string[]; + reserved_name?: string[]; } export interface DescriptorProtoAminoMsg { type: "/google.protobuf.DescriptorProto"; @@ -527,7 +527,7 @@ export interface DescriptorProtoSDKType { enum_type: EnumDescriptorProtoSDKType[]; extension_range: DescriptorProto_ExtensionRangeSDKType[]; oneof_decl: OneofDescriptorProtoSDKType[]; - options: MessageOptionsSDKType; + options?: MessageOptionsSDKType; reserved_range: DescriptorProto_ReservedRangeSDKType[]; reserved_name: string[]; } @@ -536,7 +536,7 @@ export interface DescriptorProto_ExtensionRange { start: number; /** Exclusive. */ end: number; - options: ExtensionRangeOptions; + options?: ExtensionRangeOptions; } export interface DescriptorProto_ExtensionRangeProtoMsg { typeUrl: "/google.protobuf.ExtensionRange"; @@ -544,9 +544,9 @@ export interface DescriptorProto_ExtensionRangeProtoMsg { } export interface DescriptorProto_ExtensionRangeAmino { /** Inclusive. */ - start: number; + start?: number; /** Exclusive. */ - end: number; + end?: number; options?: ExtensionRangeOptionsAmino; } export interface DescriptorProto_ExtensionRangeAminoMsg { @@ -556,7 +556,7 @@ export interface DescriptorProto_ExtensionRangeAminoMsg { export interface DescriptorProto_ExtensionRangeSDKType { start: number; end: number; - options: ExtensionRangeOptionsSDKType; + options?: ExtensionRangeOptionsSDKType; } /** * Range of reserved tag numbers. Reserved tag numbers may not be used by @@ -580,9 +580,9 @@ export interface DescriptorProto_ReservedRangeProtoMsg { */ export interface DescriptorProto_ReservedRangeAmino { /** Inclusive. */ - start: number; + start?: number; /** Exclusive. */ - end: number; + end?: number; } export interface DescriptorProto_ReservedRangeAminoMsg { type: "/google.protobuf.ReservedRange"; @@ -607,7 +607,7 @@ export interface ExtensionRangeOptionsProtoMsg { } export interface ExtensionRangeOptionsAmino { /** The parser stores options it doesn't recognize here. See above. */ - uninterpreted_option: UninterpretedOptionAmino[]; + uninterpreted_option?: UninterpretedOptionAmino[]; } export interface ExtensionRangeOptionsAminoMsg { type: "/google.protobuf.ExtensionRangeOptions"; @@ -659,7 +659,7 @@ export interface FieldDescriptorProto { * it to camelCase. */ jsonName: string; - options: FieldOptions; + options?: FieldOptions; } export interface FieldDescriptorProtoProtoMsg { typeUrl: "/google.protobuf.FieldDescriptorProto"; @@ -667,14 +667,14 @@ export interface FieldDescriptorProtoProtoMsg { } /** Describes a field within a message. */ export interface FieldDescriptorProtoAmino { - 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 @@ -682,12 +682,12 @@ export interface FieldDescriptorProtoAmino { * message are searched, then within the parent, on up to the root * namespace). */ - type_name: string; + type_name?: 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". @@ -695,19 +695,19 @@ export interface FieldDescriptorProtoAmino { * For bytes, contains the C escaped value. All bytes >= 128 are escaped. * TODO(kenton): Base-64 encode? */ - default_value: string; + default_value?: 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. */ - oneof_index: number; + oneof_index?: 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. */ - json_name: string; + json_name?: string; options?: FieldOptionsAmino; } export interface FieldDescriptorProtoAminoMsg { @@ -725,12 +725,12 @@ export interface FieldDescriptorProtoSDKType { default_value: string; oneof_index: number; json_name: string; - options: FieldOptionsSDKType; + options?: FieldOptionsSDKType; } /** Describes a oneof. */ export interface OneofDescriptorProto { name: string; - options: OneofOptions; + options?: OneofOptions; } export interface OneofDescriptorProtoProtoMsg { typeUrl: "/google.protobuf.OneofDescriptorProto"; @@ -738,7 +738,7 @@ export interface OneofDescriptorProtoProtoMsg { } /** Describes a oneof. */ export interface OneofDescriptorProtoAmino { - name: string; + name?: string; options?: OneofOptionsAmino; } export interface OneofDescriptorProtoAminoMsg { @@ -748,13 +748,13 @@ export interface OneofDescriptorProtoAminoMsg { /** Describes a oneof. */ export interface OneofDescriptorProtoSDKType { name: string; - options: OneofOptionsSDKType; + options?: OneofOptionsSDKType; } /** Describes an enum type. */ export interface EnumDescriptorProto { name: string; value: EnumValueDescriptorProto[]; - options: EnumOptions; + 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 @@ -773,20 +773,20 @@ export interface EnumDescriptorProtoProtoMsg { } /** Describes an enum type. */ export interface EnumDescriptorProtoAmino { - name: string; - value: EnumValueDescriptorProtoAmino[]; + name?: string; + value?: EnumValueDescriptorProtoAmino[]; options?: EnumOptionsAmino; /** * 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. */ - reserved_range: EnumDescriptorProto_EnumReservedRangeAmino[]; + reserved_range?: EnumDescriptorProto_EnumReservedRangeAmino[]; /** * Reserved enum value names, which may not be reused. A given name may only * be reserved once. */ - reserved_name: string[]; + reserved_name?: string[]; } export interface EnumDescriptorProtoAminoMsg { type: "/google.protobuf.EnumDescriptorProto"; @@ -796,7 +796,7 @@ export interface EnumDescriptorProtoAminoMsg { export interface EnumDescriptorProtoSDKType { name: string; value: EnumValueDescriptorProtoSDKType[]; - options: EnumOptionsSDKType; + options?: EnumOptionsSDKType; reserved_range: EnumDescriptorProto_EnumReservedRangeSDKType[]; reserved_name: string[]; } @@ -828,9 +828,9 @@ export interface EnumDescriptorProto_EnumReservedRangeProtoMsg { */ export interface EnumDescriptorProto_EnumReservedRangeAmino { /** Inclusive. */ - start: number; + start?: number; /** Inclusive. */ - end: number; + end?: number; } export interface EnumDescriptorProto_EnumReservedRangeAminoMsg { type: "/google.protobuf.EnumReservedRange"; @@ -852,7 +852,7 @@ export interface EnumDescriptorProto_EnumReservedRangeSDKType { export interface EnumValueDescriptorProto { name: string; number: number; - options: EnumValueOptions; + options?: EnumValueOptions; } export interface EnumValueDescriptorProtoProtoMsg { typeUrl: "/google.protobuf.EnumValueDescriptorProto"; @@ -860,8 +860,8 @@ export interface EnumValueDescriptorProtoProtoMsg { } /** Describes a value within an enum. */ export interface EnumValueDescriptorProtoAmino { - name: string; - number: number; + name?: string; + number?: number; options?: EnumValueOptionsAmino; } export interface EnumValueDescriptorProtoAminoMsg { @@ -872,13 +872,13 @@ export interface EnumValueDescriptorProtoAminoMsg { export interface EnumValueDescriptorProtoSDKType { name: string; number: number; - options: EnumValueOptionsSDKType; + options?: EnumValueOptionsSDKType; } /** Describes a service. */ export interface ServiceDescriptorProto { name: string; method: MethodDescriptorProto[]; - options: ServiceOptions; + options?: ServiceOptions; } export interface ServiceDescriptorProtoProtoMsg { typeUrl: "/google.protobuf.ServiceDescriptorProto"; @@ -886,8 +886,8 @@ export interface ServiceDescriptorProtoProtoMsg { } /** Describes a service. */ export interface ServiceDescriptorProtoAmino { - name: string; - method: MethodDescriptorProtoAmino[]; + name?: string; + method?: MethodDescriptorProtoAmino[]; options?: ServiceOptionsAmino; } export interface ServiceDescriptorProtoAminoMsg { @@ -898,7 +898,7 @@ export interface ServiceDescriptorProtoAminoMsg { export interface ServiceDescriptorProtoSDKType { name: string; method: MethodDescriptorProtoSDKType[]; - options: ServiceOptionsSDKType; + options?: ServiceOptionsSDKType; } /** Describes a method of a service. */ export interface MethodDescriptorProto { @@ -909,7 +909,7 @@ export interface MethodDescriptorProto { */ inputType: string; outputType: string; - options: MethodOptions; + options?: MethodOptions; /** Identifies if client streams multiple client messages */ clientStreaming: boolean; /** Identifies if server streams multiple server messages */ @@ -921,18 +921,18 @@ export interface MethodDescriptorProtoProtoMsg { } /** Describes a method of a service. */ export interface MethodDescriptorProtoAmino { - 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. */ - input_type: string; - output_type: string; + input_type?: string; + output_type?: string; options?: MethodOptionsAmino; /** Identifies if client streams multiple client messages */ - client_streaming: boolean; + client_streaming?: boolean; /** Identifies if server streams multiple server messages */ - server_streaming: boolean; + server_streaming?: boolean; } export interface MethodDescriptorProtoAminoMsg { type: "/google.protobuf.MethodDescriptorProto"; @@ -943,7 +943,7 @@ export interface MethodDescriptorProtoSDKType { name: string; input_type: string; output_type: string; - options: MethodOptionsSDKType; + options?: MethodOptionsSDKType; client_streaming: boolean; server_streaming: boolean; } @@ -1075,7 +1075,7 @@ export interface FileOptionsAmino { * inappropriate because proto packages do not normally start with backwards * domain names. */ - java_package: string; + java_package?: 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 @@ -1083,7 +1083,7 @@ export interface FileOptionsAmino { * a .proto always translates to a single class, but you may want to * explicitly choose the class name). */ - java_outer_classname: string; + java_outer_classname?: string; /** * If set true, then the Java code generator will generate a separate .java * file for each top-level message, enum, and service defined in the .proto @@ -1092,10 +1092,10 @@ export interface FileOptionsAmino { * generated to contain the file's getDescriptor() method as well as any * top-level extensions defined in the file. */ - java_multiple_files: boolean; + java_multiple_files?: boolean; /** This option does nothing. */ /** @deprecated */ - java_generate_equals_and_hash: boolean; + java_generate_equals_and_hash?: 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 @@ -1104,8 +1104,8 @@ export interface FileOptionsAmino { * However, an extension field still accepts non-UTF-8 byte sequences. * This option has no effect on when used with the lite runtime. */ - java_string_check_utf8: boolean; - optimize_for: FileOptions_OptimizeMode; + java_string_check_utf8?: boolean; + optimize_for?: 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: @@ -1113,7 +1113,7 @@ export interface FileOptionsAmino { * - Otherwise, the package statement in the .proto file, if present. * - Otherwise, the basename of the .proto file, without extension. */ - go_package: string; + go_package?: string; /** * Should generic services be generated in each language? "Generic" services * are not specific to any particular RPC system. They are generated by the @@ -1126,64 +1126,64 @@ export interface FileOptionsAmino { * these default to false. Old code which depends on generic services should * explicitly set them to true. */ - cc_generic_services: boolean; - java_generic_services: boolean; - py_generic_services: boolean; - php_generic_services: boolean; + cc_generic_services?: boolean; + java_generic_services?: boolean; + py_generic_services?: boolean; + php_generic_services?: 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++. */ - cc_enable_arenas: boolean; + cc_enable_arenas?: boolean; /** * Sets the objective c class prefix which is prepended to all objective c * generated classes from this .proto. There is no default. */ - objc_class_prefix: string; + objc_class_prefix?: string; /** Namespace for generated classes; defaults to the package. */ - csharp_namespace: string; + csharp_namespace?: 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. */ - swift_prefix: string; + swift_prefix?: string; /** * Sets the php class prefix which is prepended to all php generated classes * from this .proto. Default is empty. */ - php_class_prefix: string; + php_class_prefix?: 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. */ - php_namespace: string; + php_namespace?: 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. */ - php_metadata_namespace: string; + php_metadata_namespace?: 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. */ - ruby_package: string; + ruby_package?: string; /** * The parser stores options it doesn't recognize here. * See the documentation for the "Options" section above. */ - uninterpreted_option: UninterpretedOptionAmino[]; + uninterpreted_option?: UninterpretedOptionAmino[]; } export interface FileOptionsAminoMsg { type: "/google.protobuf.FileOptions"; @@ -1300,20 +1300,20 @@ export interface MessageOptionsAmino { * Because this is an option, the above two restrictions are not enforced by * the protocol compiler. */ - message_set_wire_format: boolean; + message_set_wire_format?: 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". */ - no_standard_descriptor_accessor: boolean; + no_standard_descriptor_accessor?: 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. @@ -1337,9 +1337,9 @@ export interface MessageOptionsAmino { * instead. The option should only be implicitly set by the proto compiler * parser. */ - map_entry: boolean; + map_entry?: boolean; /** The parser stores options it doesn't recognize here. See above. */ - uninterpreted_option: UninterpretedOptionAmino[]; + uninterpreted_option?: UninterpretedOptionAmino[]; } export interface MessageOptionsAminoMsg { type: "/google.protobuf.MessageOptions"; @@ -1436,7 +1436,7 @@ export interface FieldOptionsAmino { * 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 @@ -1444,7 +1444,7 @@ export interface FieldOptionsAmino { * 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 @@ -1458,7 +1458,7 @@ export interface FieldOptionsAmino { * 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 @@ -1489,18 +1489,18 @@ export interface FieldOptionsAmino { * check its required fields, regardless of whether or not the message has * been parsed. */ - lazy: boolean; + lazy?: boolean; /** * Is this field deprecated? * Depending on the target platform, this can emit Deprecated annotations * for accessors, or it will be completely ignored; in the very least, this * is a formalization for deprecating fields. */ - deprecated: boolean; + 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. */ - uninterpreted_option: UninterpretedOptionAmino[]; + uninterpreted_option?: UninterpretedOptionAmino[]; } export interface FieldOptionsAminoMsg { type: "/google.protobuf.FieldOptions"; @@ -1525,7 +1525,7 @@ export interface OneofOptionsProtoMsg { } export interface OneofOptionsAmino { /** The parser stores options it doesn't recognize here. See above. */ - uninterpreted_option: UninterpretedOptionAmino[]; + uninterpreted_option?: UninterpretedOptionAmino[]; } export interface OneofOptionsAminoMsg { type: "/google.protobuf.OneofOptions"; @@ -1559,16 +1559,16 @@ export interface EnumOptionsAmino { * Set this option to true to allow mapping different tag names to the same * value. */ - allow_alias: boolean; + allow_alias?: 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. */ - uninterpreted_option: UninterpretedOptionAmino[]; + uninterpreted_option?: UninterpretedOptionAmino[]; } export interface EnumOptionsAminoMsg { type: "/google.protobuf.EnumOptions"; @@ -1601,9 +1601,9 @@ export interface EnumValueOptionsAmino { * 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. */ - uninterpreted_option: UninterpretedOptionAmino[]; + uninterpreted_option?: UninterpretedOptionAmino[]; } export interface EnumValueOptionsAminoMsg { type: "/google.protobuf.EnumValueOptions"; @@ -1635,9 +1635,9 @@ export interface ServiceOptionsAmino { * 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. */ - uninterpreted_option: UninterpretedOptionAmino[]; + uninterpreted_option?: UninterpretedOptionAmino[]; } export interface ServiceOptionsAminoMsg { type: "/google.protobuf.ServiceOptions"; @@ -1670,10 +1670,10 @@ export interface MethodOptionsAmino { * for the method, or it will be completely ignored; in the very least, * this is a formalization for deprecating methods. */ - deprecated: boolean; - idempotency_level: MethodOptions_IdempotencyLevel; + deprecated?: boolean; + idempotency_level?: MethodOptions_IdempotencyLevel; /** The parser stores options it doesn't recognize here. See above. */ - uninterpreted_option: UninterpretedOptionAmino[]; + uninterpreted_option?: UninterpretedOptionAmino[]; } export interface MethodOptionsAminoMsg { type: "/google.protobuf.MethodOptions"; @@ -1718,17 +1718,17 @@ export interface UninterpretedOptionProtoMsg { * in them. */ export interface UninterpretedOptionAmino { - name: UninterpretedOption_NamePartAmino[]; + name?: UninterpretedOption_NamePartAmino[]; /** * The value of the uninterpreted option, in whatever type the tokenizer * identified it as during parsing. Exactly one of these should be set. */ - identifier_value: string; - positive_int_value: string; - negative_int_value: string; - double_value: number; - string_value: Uint8Array; - aggregate_value: string; + identifier_value?: string; + positive_int_value?: string; + negative_int_value?: string; + double_value?: number; + string_value?: string; + aggregate_value?: string; } export interface UninterpretedOptionAminoMsg { type: "/google.protobuf.UninterpretedOption"; @@ -1774,8 +1774,8 @@ export interface UninterpretedOption_NamePartProtoMsg { * "foo.(bar.baz).qux". */ export interface UninterpretedOption_NamePartAmino { - name_part: string; - is_extension: boolean; + name_part?: string; + is_extension?: boolean; } export interface UninterpretedOption_NamePartAminoMsg { type: "/google.protobuf.NamePart"; @@ -1898,7 +1898,7 @@ export interface SourceCodeInfoAmino { * ignore those that it doesn't understand, as more types of locations could * be recorded in the future. */ - location: SourceCodeInfo_LocationAmino[]; + location?: SourceCodeInfo_LocationAmino[]; } export interface SourceCodeInfoAminoMsg { type: "/google.protobuf.SourceCodeInfo"; @@ -2029,7 +2029,7 @@ export interface SourceCodeInfo_LocationAmino { * 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. @@ -2037,7 +2037,7 @@ export interface SourceCodeInfo_LocationAmino { * 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 @@ -2087,9 +2087,9 @@ export interface SourceCodeInfo_LocationAmino { * * // ignored detached comments. */ - leading_comments: string; - trailing_comments: string; - leading_detached_comments: string[]; + leading_comments?: string; + trailing_comments?: string; + leading_detached_comments?: string[]; } export interface SourceCodeInfo_LocationAminoMsg { type: "/google.protobuf.Location"; @@ -2128,7 +2128,7 @@ export interface GeneratedCodeInfoAmino { * An Annotation connects some span of text in generated code to an element * of its generating .proto file. */ - annotation: GeneratedCodeInfo_AnnotationAmino[]; + annotation?: GeneratedCodeInfo_AnnotationAmino[]; } export interface GeneratedCodeInfoAminoMsg { type: "/google.protobuf.GeneratedCodeInfo"; @@ -2171,20 +2171,20 @@ export interface GeneratedCodeInfo_AnnotationAmino { * 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. */ - source_file: string; + source_file?: 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; } export interface GeneratedCodeInfo_AnnotationAminoMsg { type: "/google.protobuf.Annotation"; @@ -2232,9 +2232,9 @@ export const FileDescriptorSet = { return message; }, fromAmino(object: FileDescriptorSetAmino): FileDescriptorSet { - return { - file: Array.isArray(object?.file) ? object.file.map((e: any) => FileDescriptorProto.fromAmino(e)) : [] - }; + const message = createBaseFileDescriptorSet(); + message.file = object.file?.map(e => FileDescriptorProto.fromAmino(e)) || []; + return message; }, toAmino(message: FileDescriptorSet): FileDescriptorSetAmino { const obj: any = {}; @@ -2272,8 +2272,8 @@ function createBaseFileDescriptorProto(): FileDescriptorProto { enumType: [], service: [], extension: [], - options: FileOptions.fromPartial({}), - sourceCodeInfo: SourceCodeInfo.fromPartial({}), + options: undefined, + sourceCodeInfo: undefined, syntax: "" }; } @@ -2403,20 +2403,30 @@ export const FileDescriptorProto = { return message; }, fromAmino(object: FileDescriptorProtoAmino): FileDescriptorProto { - return { - name: object.name, - package: object.package, - dependency: Array.isArray(object?.dependency) ? object.dependency.map((e: any) => e) : [], - publicDependency: Array.isArray(object?.public_dependency) ? object.public_dependency.map((e: any) => e) : [], - weakDependency: Array.isArray(object?.weak_dependency) ? object.weak_dependency.map((e: any) => e) : [], - messageType: Array.isArray(object?.message_type) ? object.message_type.map((e: any) => DescriptorProto.fromAmino(e)) : [], - enumType: Array.isArray(object?.enum_type) ? object.enum_type.map((e: any) => EnumDescriptorProto.fromAmino(e)) : [], - service: Array.isArray(object?.service) ? object.service.map((e: any) => ServiceDescriptorProto.fromAmino(e)) : [], - extension: Array.isArray(object?.extension) ? object.extension.map((e: any) => FieldDescriptorProto.fromAmino(e)) : [], - options: object?.options ? FileOptions.fromAmino(object.options) : undefined, - sourceCodeInfo: object?.source_code_info ? SourceCodeInfo.fromAmino(object.source_code_info) : undefined, - syntax: object.syntax - }; + const message = createBaseFileDescriptorProto(); + if (object.name !== undefined && object.name !== null) { + message.name = object.name; + } + if (object.package !== undefined && object.package !== null) { + message.package = object.package; + } + message.dependency = object.dependency?.map(e => e) || []; + message.publicDependency = object.public_dependency?.map(e => e) || []; + message.weakDependency = object.weak_dependency?.map(e => e) || []; + message.messageType = object.message_type?.map(e => DescriptorProto.fromAmino(e)) || []; + message.enumType = object.enum_type?.map(e => EnumDescriptorProto.fromAmino(e)) || []; + message.service = object.service?.map(e => ServiceDescriptorProto.fromAmino(e)) || []; + message.extension = object.extension?.map(e => FieldDescriptorProto.fromAmino(e)) || []; + if (object.options !== undefined && object.options !== null) { + message.options = FileOptions.fromAmino(object.options); + } + if (object.source_code_info !== undefined && object.source_code_info !== null) { + message.sourceCodeInfo = SourceCodeInfo.fromAmino(object.source_code_info); + } + if (object.syntax !== undefined && object.syntax !== null) { + message.syntax = object.syntax; + } + return message; }, toAmino(message: FileDescriptorProto): FileDescriptorProtoAmino { const obj: any = {}; @@ -2487,7 +2497,7 @@ function createBaseDescriptorProto(): DescriptorProto { enumType: [], extensionRange: [], oneofDecl: [], - options: MessageOptions.fromPartial({}), + options: undefined, reservedRange: [], reservedName: [] }; @@ -2586,18 +2596,22 @@ export const DescriptorProto = { return message; }, fromAmino(object: DescriptorProtoAmino): DescriptorProto { - return { - name: object.name, - field: Array.isArray(object?.field) ? object.field.map((e: any) => FieldDescriptorProto.fromAmino(e)) : [], - extension: Array.isArray(object?.extension) ? object.extension.map((e: any) => FieldDescriptorProto.fromAmino(e)) : [], - nestedType: Array.isArray(object?.nested_type) ? object.nested_type.map((e: any) => DescriptorProto.fromAmino(e)) : [], - enumType: Array.isArray(object?.enum_type) ? object.enum_type.map((e: any) => EnumDescriptorProto.fromAmino(e)) : [], - extensionRange: Array.isArray(object?.extension_range) ? object.extension_range.map((e: any) => DescriptorProto_ExtensionRange.fromAmino(e)) : [], - oneofDecl: Array.isArray(object?.oneof_decl) ? object.oneof_decl.map((e: any) => OneofDescriptorProto.fromAmino(e)) : [], - options: object?.options ? MessageOptions.fromAmino(object.options) : undefined, - reservedRange: Array.isArray(object?.reserved_range) ? object.reserved_range.map((e: any) => DescriptorProto_ReservedRange.fromAmino(e)) : [], - reservedName: Array.isArray(object?.reserved_name) ? object.reserved_name.map((e: any) => e) : [] - }; + const message = createBaseDescriptorProto(); + if (object.name !== undefined && object.name !== null) { + message.name = object.name; + } + message.field = object.field?.map(e => FieldDescriptorProto.fromAmino(e)) || []; + message.extension = object.extension?.map(e => FieldDescriptorProto.fromAmino(e)) || []; + message.nestedType = object.nested_type?.map(e => DescriptorProto.fromAmino(e)) || []; + message.enumType = object.enum_type?.map(e => EnumDescriptorProto.fromAmino(e)) || []; + message.extensionRange = object.extension_range?.map(e => DescriptorProto_ExtensionRange.fromAmino(e)) || []; + message.oneofDecl = object.oneof_decl?.map(e => OneofDescriptorProto.fromAmino(e)) || []; + if (object.options !== undefined && object.options !== null) { + message.options = MessageOptions.fromAmino(object.options); + } + message.reservedRange = object.reserved_range?.map(e => DescriptorProto_ReservedRange.fromAmino(e)) || []; + message.reservedName = object.reserved_name?.map(e => e) || []; + return message; }, toAmino(message: DescriptorProto): DescriptorProtoAmino { const obj: any = {}; @@ -2665,7 +2679,7 @@ function createBaseDescriptorProto_ExtensionRange(): DescriptorProto_ExtensionRa return { start: 0, end: 0, - options: ExtensionRangeOptions.fromPartial({}) + options: undefined }; } export const DescriptorProto_ExtensionRange = { @@ -2713,11 +2727,17 @@ export const DescriptorProto_ExtensionRange = { return message; }, fromAmino(object: DescriptorProto_ExtensionRangeAmino): DescriptorProto_ExtensionRange { - return { - start: object.start, - end: object.end, - options: object?.options ? ExtensionRangeOptions.fromAmino(object.options) : undefined - }; + const message = createBaseDescriptorProto_ExtensionRange(); + if (object.start !== undefined && object.start !== null) { + message.start = object.start; + } + if (object.end !== undefined && object.end !== null) { + message.end = object.end; + } + if (object.options !== undefined && object.options !== null) { + message.options = ExtensionRangeOptions.fromAmino(object.options); + } + return message; }, toAmino(message: DescriptorProto_ExtensionRange): DescriptorProto_ExtensionRangeAmino { const obj: any = {}; @@ -2786,10 +2806,14 @@ export const DescriptorProto_ReservedRange = { return message; }, fromAmino(object: DescriptorProto_ReservedRangeAmino): DescriptorProto_ReservedRange { - return { - start: object.start, - end: object.end - }; + const message = createBaseDescriptorProto_ReservedRange(); + if (object.start !== undefined && object.start !== null) { + message.start = object.start; + } + if (object.end !== undefined && object.end !== null) { + message.end = object.end; + } + return message; }, toAmino(message: DescriptorProto_ReservedRange): DescriptorProto_ReservedRangeAmino { const obj: any = {}; @@ -2849,9 +2873,9 @@ export const ExtensionRangeOptions = { return message; }, fromAmino(object: ExtensionRangeOptionsAmino): ExtensionRangeOptions { - return { - uninterpretedOption: Array.isArray(object?.uninterpreted_option) ? object.uninterpreted_option.map((e: any) => UninterpretedOption.fromAmino(e)) : [] - }; + const message = createBaseExtensionRangeOptions(); + message.uninterpretedOption = object.uninterpreted_option?.map(e => UninterpretedOption.fromAmino(e)) || []; + return message; }, toAmino(message: ExtensionRangeOptions): ExtensionRangeOptionsAmino { const obj: any = {}; @@ -2889,7 +2913,7 @@ function createBaseFieldDescriptorProto(): FieldDescriptorProto { defaultValue: "", oneofIndex: 0, jsonName: "", - options: FieldOptions.fromPartial({}) + options: undefined }; } export const FieldDescriptorProto = { @@ -2986,25 +3010,45 @@ export const FieldDescriptorProto = { return message; }, fromAmino(object: FieldDescriptorProtoAmino): FieldDescriptorProto { - return { - name: object.name, - number: object.number, - label: isSet(object.label) ? fieldDescriptorProto_LabelFromJSON(object.label) : -1, - type: isSet(object.type) ? fieldDescriptorProto_TypeFromJSON(object.type) : -1, - typeName: object.type_name, - extendee: object.extendee, - defaultValue: object.default_value, - oneofIndex: object.oneof_index, - jsonName: object.json_name, - options: object?.options ? FieldOptions.fromAmino(object.options) : undefined - }; + const message = createBaseFieldDescriptorProto(); + if (object.name !== undefined && object.name !== null) { + message.name = object.name; + } + if (object.number !== undefined && object.number !== null) { + message.number = object.number; + } + if (object.label !== undefined && object.label !== null) { + message.label = fieldDescriptorProto_LabelFromJSON(object.label); + } + if (object.type !== undefined && object.type !== null) { + message.type = fieldDescriptorProto_TypeFromJSON(object.type); + } + if (object.type_name !== undefined && object.type_name !== null) { + message.typeName = object.type_name; + } + if (object.extendee !== undefined && object.extendee !== null) { + message.extendee = object.extendee; + } + if (object.default_value !== undefined && object.default_value !== null) { + message.defaultValue = object.default_value; + } + if (object.oneof_index !== undefined && object.oneof_index !== null) { + message.oneofIndex = object.oneof_index; + } + if (object.json_name !== undefined && object.json_name !== null) { + message.jsonName = object.json_name; + } + if (object.options !== undefined && object.options !== null) { + message.options = FieldOptions.fromAmino(object.options); + } + return message; }, toAmino(message: FieldDescriptorProto): FieldDescriptorProtoAmino { const obj: any = {}; obj.name = message.name; obj.number = message.number; - obj.label = message.label; - obj.type = message.type; + obj.label = fieldDescriptorProto_LabelToJSON(message.label); + obj.type = fieldDescriptorProto_TypeToJSON(message.type); obj.type_name = message.typeName; obj.extendee = message.extendee; obj.default_value = message.defaultValue; @@ -3032,7 +3076,7 @@ export const FieldDescriptorProto = { function createBaseOneofDescriptorProto(): OneofDescriptorProto { return { name: "", - options: OneofOptions.fromPartial({}) + options: undefined }; } export const OneofDescriptorProto = { @@ -3073,10 +3117,14 @@ export const OneofDescriptorProto = { return message; }, fromAmino(object: OneofDescriptorProtoAmino): OneofDescriptorProto { - return { - name: object.name, - options: object?.options ? OneofOptions.fromAmino(object.options) : undefined - }; + const message = createBaseOneofDescriptorProto(); + if (object.name !== undefined && object.name !== null) { + message.name = object.name; + } + if (object.options !== undefined && object.options !== null) { + message.options = OneofOptions.fromAmino(object.options); + } + return message; }, toAmino(message: OneofDescriptorProto): OneofDescriptorProtoAmino { const obj: any = {}; @@ -3104,7 +3152,7 @@ function createBaseEnumDescriptorProto(): EnumDescriptorProto { return { name: "", value: [], - options: EnumOptions.fromPartial({}), + options: undefined, reservedRange: [], reservedName: [] }; @@ -3168,13 +3216,17 @@ export const EnumDescriptorProto = { return message; }, fromAmino(object: EnumDescriptorProtoAmino): EnumDescriptorProto { - return { - name: object.name, - value: Array.isArray(object?.value) ? object.value.map((e: any) => EnumValueDescriptorProto.fromAmino(e)) : [], - options: object?.options ? EnumOptions.fromAmino(object.options) : undefined, - reservedRange: Array.isArray(object?.reserved_range) ? object.reserved_range.map((e: any) => EnumDescriptorProto_EnumReservedRange.fromAmino(e)) : [], - reservedName: Array.isArray(object?.reserved_name) ? object.reserved_name.map((e: any) => e) : [] - }; + const message = createBaseEnumDescriptorProto(); + if (object.name !== undefined && object.name !== null) { + message.name = object.name; + } + message.value = object.value?.map(e => EnumValueDescriptorProto.fromAmino(e)) || []; + if (object.options !== undefined && object.options !== null) { + message.options = EnumOptions.fromAmino(object.options); + } + message.reservedRange = object.reserved_range?.map(e => EnumDescriptorProto_EnumReservedRange.fromAmino(e)) || []; + message.reservedName = object.reserved_name?.map(e => e) || []; + return message; }, toAmino(message: EnumDescriptorProto): EnumDescriptorProtoAmino { const obj: any = {}; @@ -3257,10 +3309,14 @@ export const EnumDescriptorProto_EnumReservedRange = { return message; }, fromAmino(object: EnumDescriptorProto_EnumReservedRangeAmino): EnumDescriptorProto_EnumReservedRange { - return { - start: object.start, - end: object.end - }; + const message = createBaseEnumDescriptorProto_EnumReservedRange(); + if (object.start !== undefined && object.start !== null) { + message.start = object.start; + } + if (object.end !== undefined && object.end !== null) { + message.end = object.end; + } + return message; }, toAmino(message: EnumDescriptorProto_EnumReservedRange): EnumDescriptorProto_EnumReservedRangeAmino { const obj: any = {}; @@ -3288,7 +3344,7 @@ function createBaseEnumValueDescriptorProto(): EnumValueDescriptorProto { return { name: "", number: 0, - options: EnumValueOptions.fromPartial({}) + options: undefined }; } export const EnumValueDescriptorProto = { @@ -3336,11 +3392,17 @@ export const EnumValueDescriptorProto = { return message; }, fromAmino(object: EnumValueDescriptorProtoAmino): EnumValueDescriptorProto { - return { - name: object.name, - number: object.number, - options: object?.options ? EnumValueOptions.fromAmino(object.options) : undefined - }; + const message = createBaseEnumValueDescriptorProto(); + if (object.name !== undefined && object.name !== null) { + message.name = object.name; + } + if (object.number !== undefined && object.number !== null) { + message.number = object.number; + } + if (object.options !== undefined && object.options !== null) { + message.options = EnumValueOptions.fromAmino(object.options); + } + return message; }, toAmino(message: EnumValueDescriptorProto): EnumValueDescriptorProtoAmino { const obj: any = {}; @@ -3369,7 +3431,7 @@ function createBaseServiceDescriptorProto(): ServiceDescriptorProto { return { name: "", method: [], - options: ServiceOptions.fromPartial({}) + options: undefined }; } export const ServiceDescriptorProto = { @@ -3417,11 +3479,15 @@ export const ServiceDescriptorProto = { return message; }, fromAmino(object: ServiceDescriptorProtoAmino): ServiceDescriptorProto { - return { - name: object.name, - method: Array.isArray(object?.method) ? object.method.map((e: any) => MethodDescriptorProto.fromAmino(e)) : [], - options: object?.options ? ServiceOptions.fromAmino(object.options) : undefined - }; + const message = createBaseServiceDescriptorProto(); + if (object.name !== undefined && object.name !== null) { + message.name = object.name; + } + message.method = object.method?.map(e => MethodDescriptorProto.fromAmino(e)) || []; + if (object.options !== undefined && object.options !== null) { + message.options = ServiceOptions.fromAmino(object.options); + } + return message; }, toAmino(message: ServiceDescriptorProto): ServiceDescriptorProtoAmino { const obj: any = {}; @@ -3455,7 +3521,7 @@ function createBaseMethodDescriptorProto(): MethodDescriptorProto { name: "", inputType: "", outputType: "", - options: MethodOptions.fromPartial({}), + options: undefined, clientStreaming: false, serverStreaming: false }; @@ -3526,14 +3592,26 @@ export const MethodDescriptorProto = { return message; }, fromAmino(object: MethodDescriptorProtoAmino): MethodDescriptorProto { - return { - name: object.name, - inputType: object.input_type, - outputType: object.output_type, - options: object?.options ? MethodOptions.fromAmino(object.options) : undefined, - clientStreaming: object.client_streaming, - serverStreaming: object.server_streaming - }; + const message = createBaseMethodDescriptorProto(); + if (object.name !== undefined && object.name !== null) { + message.name = object.name; + } + if (object.input_type !== undefined && object.input_type !== null) { + message.inputType = object.input_type; + } + if (object.output_type !== undefined && object.output_type !== null) { + message.outputType = object.output_type; + } + if (object.options !== undefined && object.options !== null) { + message.options = MethodOptions.fromAmino(object.options); + } + if (object.client_streaming !== undefined && object.client_streaming !== null) { + message.clientStreaming = object.client_streaming; + } + if (object.server_streaming !== undefined && object.server_streaming !== null) { + message.serverStreaming = object.server_streaming; + } + return message; }, toAmino(message: MethodDescriptorProto): MethodDescriptorProtoAmino { const obj: any = {}; @@ -3757,29 +3835,69 @@ export const FileOptions = { return message; }, fromAmino(object: FileOptionsAmino): FileOptions { - return { - javaPackage: object.java_package, - javaOuterClassname: object.java_outer_classname, - javaMultipleFiles: object.java_multiple_files, - javaGenerateEqualsAndHash: object.java_generate_equals_and_hash, - javaStringCheckUtf8: object.java_string_check_utf8, - optimizeFor: isSet(object.optimize_for) ? fileOptions_OptimizeModeFromJSON(object.optimize_for) : -1, - goPackage: object.go_package, - ccGenericServices: object.cc_generic_services, - javaGenericServices: object.java_generic_services, - pyGenericServices: object.py_generic_services, - phpGenericServices: object.php_generic_services, - deprecated: object.deprecated, - ccEnableArenas: object.cc_enable_arenas, - objcClassPrefix: object.objc_class_prefix, - csharpNamespace: object.csharp_namespace, - swiftPrefix: object.swift_prefix, - phpClassPrefix: object.php_class_prefix, - phpNamespace: object.php_namespace, - phpMetadataNamespace: object.php_metadata_namespace, - rubyPackage: object.ruby_package, - uninterpretedOption: Array.isArray(object?.uninterpreted_option) ? object.uninterpreted_option.map((e: any) => UninterpretedOption.fromAmino(e)) : [] - }; + const message = createBaseFileOptions(); + if (object.java_package !== undefined && object.java_package !== null) { + message.javaPackage = object.java_package; + } + if (object.java_outer_classname !== undefined && object.java_outer_classname !== null) { + message.javaOuterClassname = object.java_outer_classname; + } + if (object.java_multiple_files !== undefined && object.java_multiple_files !== null) { + message.javaMultipleFiles = object.java_multiple_files; + } + if (object.java_generate_equals_and_hash !== undefined && object.java_generate_equals_and_hash !== null) { + message.javaGenerateEqualsAndHash = object.java_generate_equals_and_hash; + } + if (object.java_string_check_utf8 !== undefined && object.java_string_check_utf8 !== null) { + message.javaStringCheckUtf8 = object.java_string_check_utf8; + } + if (object.optimize_for !== undefined && object.optimize_for !== null) { + message.optimizeFor = fileOptions_OptimizeModeFromJSON(object.optimize_for); + } + if (object.go_package !== undefined && object.go_package !== null) { + message.goPackage = object.go_package; + } + if (object.cc_generic_services !== undefined && object.cc_generic_services !== null) { + message.ccGenericServices = object.cc_generic_services; + } + if (object.java_generic_services !== undefined && object.java_generic_services !== null) { + message.javaGenericServices = object.java_generic_services; + } + if (object.py_generic_services !== undefined && object.py_generic_services !== null) { + message.pyGenericServices = object.py_generic_services; + } + if (object.php_generic_services !== undefined && object.php_generic_services !== null) { + message.phpGenericServices = object.php_generic_services; + } + if (object.deprecated !== undefined && object.deprecated !== null) { + message.deprecated = object.deprecated; + } + if (object.cc_enable_arenas !== undefined && object.cc_enable_arenas !== null) { + message.ccEnableArenas = object.cc_enable_arenas; + } + if (object.objc_class_prefix !== undefined && object.objc_class_prefix !== null) { + message.objcClassPrefix = object.objc_class_prefix; + } + if (object.csharp_namespace !== undefined && object.csharp_namespace !== null) { + message.csharpNamespace = object.csharp_namespace; + } + if (object.swift_prefix !== undefined && object.swift_prefix !== null) { + message.swiftPrefix = object.swift_prefix; + } + if (object.php_class_prefix !== undefined && object.php_class_prefix !== null) { + message.phpClassPrefix = object.php_class_prefix; + } + if (object.php_namespace !== undefined && object.php_namespace !== null) { + message.phpNamespace = object.php_namespace; + } + if (object.php_metadata_namespace !== undefined && object.php_metadata_namespace !== null) { + message.phpMetadataNamespace = object.php_metadata_namespace; + } + if (object.ruby_package !== undefined && object.ruby_package !== null) { + message.rubyPackage = object.ruby_package; + } + message.uninterpretedOption = object.uninterpreted_option?.map(e => UninterpretedOption.fromAmino(e)) || []; + return message; }, toAmino(message: FileOptions): FileOptionsAmino { const obj: any = {}; @@ -3788,7 +3906,7 @@ export const FileOptions = { obj.java_multiple_files = message.javaMultipleFiles; obj.java_generate_equals_and_hash = message.javaGenerateEqualsAndHash; obj.java_string_check_utf8 = message.javaStringCheckUtf8; - obj.optimize_for = message.optimizeFor; + obj.optimize_for = fileOptions_OptimizeModeToJSON(message.optimizeFor); obj.go_package = message.goPackage; obj.cc_generic_services = message.ccGenericServices; obj.java_generic_services = message.javaGenericServices; @@ -3894,13 +4012,21 @@ export const MessageOptions = { return message; }, fromAmino(object: MessageOptionsAmino): MessageOptions { - return { - messageSetWireFormat: object.message_set_wire_format, - noStandardDescriptorAccessor: object.no_standard_descriptor_accessor, - deprecated: object.deprecated, - mapEntry: object.map_entry, - uninterpretedOption: Array.isArray(object?.uninterpreted_option) ? object.uninterpreted_option.map((e: any) => UninterpretedOption.fromAmino(e)) : [] - }; + const message = createBaseMessageOptions(); + if (object.message_set_wire_format !== undefined && object.message_set_wire_format !== null) { + message.messageSetWireFormat = object.message_set_wire_format; + } + if (object.no_standard_descriptor_accessor !== undefined && object.no_standard_descriptor_accessor !== null) { + message.noStandardDescriptorAccessor = object.no_standard_descriptor_accessor; + } + if (object.deprecated !== undefined && object.deprecated !== null) { + message.deprecated = object.deprecated; + } + if (object.map_entry !== undefined && object.map_entry !== null) { + message.mapEntry = object.map_entry; + } + message.uninterpretedOption = object.uninterpreted_option?.map(e => UninterpretedOption.fromAmino(e)) || []; + return message; }, toAmino(message: MessageOptions): MessageOptionsAmino { const obj: any = {}; @@ -4015,21 +4141,33 @@ export const FieldOptions = { return message; }, fromAmino(object: FieldOptionsAmino): FieldOptions { - return { - ctype: isSet(object.ctype) ? fieldOptions_CTypeFromJSON(object.ctype) : -1, - packed: object.packed, - jstype: isSet(object.jstype) ? fieldOptions_JSTypeFromJSON(object.jstype) : -1, - lazy: object.lazy, - deprecated: object.deprecated, - weak: object.weak, - uninterpretedOption: Array.isArray(object?.uninterpreted_option) ? object.uninterpreted_option.map((e: any) => UninterpretedOption.fromAmino(e)) : [] - }; + const message = createBaseFieldOptions(); + if (object.ctype !== undefined && object.ctype !== null) { + message.ctype = fieldOptions_CTypeFromJSON(object.ctype); + } + if (object.packed !== undefined && object.packed !== null) { + message.packed = object.packed; + } + if (object.jstype !== undefined && object.jstype !== null) { + message.jstype = fieldOptions_JSTypeFromJSON(object.jstype); + } + if (object.lazy !== undefined && object.lazy !== null) { + message.lazy = object.lazy; + } + if (object.deprecated !== undefined && object.deprecated !== null) { + message.deprecated = object.deprecated; + } + if (object.weak !== undefined && object.weak !== null) { + message.weak = object.weak; + } + message.uninterpretedOption = object.uninterpreted_option?.map(e => UninterpretedOption.fromAmino(e)) || []; + return message; }, toAmino(message: FieldOptions): FieldOptionsAmino { const obj: any = {}; - obj.ctype = message.ctype; + obj.ctype = fieldOptions_CTypeToJSON(message.ctype); obj.packed = message.packed; - obj.jstype = message.jstype; + obj.jstype = fieldOptions_JSTypeToJSON(message.jstype); obj.lazy = message.lazy; obj.deprecated = message.deprecated; obj.weak = message.weak; @@ -4092,9 +4230,9 @@ export const OneofOptions = { return message; }, fromAmino(object: OneofOptionsAmino): OneofOptions { - return { - uninterpretedOption: Array.isArray(object?.uninterpreted_option) ? object.uninterpreted_option.map((e: any) => UninterpretedOption.fromAmino(e)) : [] - }; + const message = createBaseOneofOptions(); + message.uninterpretedOption = object.uninterpreted_option?.map(e => UninterpretedOption.fromAmino(e)) || []; + return message; }, toAmino(message: OneofOptions): OneofOptionsAmino { const obj: any = {}; @@ -4173,11 +4311,15 @@ export const EnumOptions = { return message; }, fromAmino(object: EnumOptionsAmino): EnumOptions { - return { - allowAlias: object.allow_alias, - deprecated: object.deprecated, - uninterpretedOption: Array.isArray(object?.uninterpreted_option) ? object.uninterpreted_option.map((e: any) => UninterpretedOption.fromAmino(e)) : [] - }; + const message = createBaseEnumOptions(); + if (object.allow_alias !== undefined && object.allow_alias !== null) { + message.allowAlias = object.allow_alias; + } + if (object.deprecated !== undefined && object.deprecated !== null) { + message.deprecated = object.deprecated; + } + message.uninterpretedOption = object.uninterpreted_option?.map(e => UninterpretedOption.fromAmino(e)) || []; + return message; }, toAmino(message: EnumOptions): EnumOptionsAmino { const obj: any = {}; @@ -4250,10 +4392,12 @@ export const EnumValueOptions = { return message; }, fromAmino(object: EnumValueOptionsAmino): EnumValueOptions { - return { - deprecated: object.deprecated, - uninterpretedOption: Array.isArray(object?.uninterpreted_option) ? object.uninterpreted_option.map((e: any) => UninterpretedOption.fromAmino(e)) : [] - }; + const message = createBaseEnumValueOptions(); + if (object.deprecated !== undefined && object.deprecated !== null) { + message.deprecated = object.deprecated; + } + message.uninterpretedOption = object.uninterpreted_option?.map(e => UninterpretedOption.fromAmino(e)) || []; + return message; }, toAmino(message: EnumValueOptions): EnumValueOptionsAmino { const obj: any = {}; @@ -4325,10 +4469,12 @@ export const ServiceOptions = { return message; }, fromAmino(object: ServiceOptionsAmino): ServiceOptions { - return { - deprecated: object.deprecated, - uninterpretedOption: Array.isArray(object?.uninterpreted_option) ? object.uninterpreted_option.map((e: any) => UninterpretedOption.fromAmino(e)) : [] - }; + const message = createBaseServiceOptions(); + if (object.deprecated !== undefined && object.deprecated !== null) { + message.deprecated = object.deprecated; + } + message.uninterpretedOption = object.uninterpreted_option?.map(e => UninterpretedOption.fromAmino(e)) || []; + return message; }, toAmino(message: ServiceOptions): ServiceOptionsAmino { const obj: any = {}; @@ -4408,16 +4554,20 @@ export const MethodOptions = { return message; }, fromAmino(object: MethodOptionsAmino): MethodOptions { - return { - deprecated: object.deprecated, - idempotencyLevel: isSet(object.idempotency_level) ? methodOptions_IdempotencyLevelFromJSON(object.idempotency_level) : -1, - uninterpretedOption: Array.isArray(object?.uninterpreted_option) ? object.uninterpreted_option.map((e: any) => UninterpretedOption.fromAmino(e)) : [] - }; + const message = createBaseMethodOptions(); + if (object.deprecated !== undefined && object.deprecated !== null) { + message.deprecated = object.deprecated; + } + if (object.idempotency_level !== undefined && object.idempotency_level !== null) { + message.idempotencyLevel = methodOptions_IdempotencyLevelFromJSON(object.idempotency_level); + } + message.uninterpretedOption = object.uninterpreted_option?.map(e => UninterpretedOption.fromAmino(e)) || []; + return message; }, toAmino(message: MethodOptions): MethodOptionsAmino { const obj: any = {}; obj.deprecated = message.deprecated; - obj.idempotency_level = message.idempotencyLevel; + obj.idempotency_level = methodOptions_IdempotencyLevelToJSON(message.idempotencyLevel); if (message.uninterpretedOption) { obj.uninterpreted_option = message.uninterpretedOption.map(e => e ? UninterpretedOption.toAmino(e) : undefined); } else { @@ -4525,15 +4675,27 @@ export const UninterpretedOption = { return message; }, fromAmino(object: UninterpretedOptionAmino): UninterpretedOption { - return { - name: Array.isArray(object?.name) ? object.name.map((e: any) => UninterpretedOption_NamePart.fromAmino(e)) : [], - identifierValue: object.identifier_value, - positiveIntValue: BigInt(object.positive_int_value), - negativeIntValue: BigInt(object.negative_int_value), - doubleValue: object.double_value, - stringValue: object.string_value, - aggregateValue: object.aggregate_value - }; + const message = createBaseUninterpretedOption(); + message.name = object.name?.map(e => UninterpretedOption_NamePart.fromAmino(e)) || []; + if (object.identifier_value !== undefined && object.identifier_value !== null) { + message.identifierValue = object.identifier_value; + } + if (object.positive_int_value !== undefined && object.positive_int_value !== null) { + message.positiveIntValue = BigInt(object.positive_int_value); + } + if (object.negative_int_value !== undefined && object.negative_int_value !== null) { + message.negativeIntValue = BigInt(object.negative_int_value); + } + if (object.double_value !== undefined && object.double_value !== null) { + message.doubleValue = object.double_value; + } + if (object.string_value !== undefined && object.string_value !== null) { + message.stringValue = bytesFromBase64(object.string_value); + } + if (object.aggregate_value !== undefined && object.aggregate_value !== null) { + message.aggregateValue = object.aggregate_value; + } + return message; }, toAmino(message: UninterpretedOption): UninterpretedOptionAmino { const obj: any = {}; @@ -4546,7 +4708,7 @@ export const UninterpretedOption = { obj.positive_int_value = message.positiveIntValue ? message.positiveIntValue.toString() : undefined; obj.negative_int_value = message.negativeIntValue ? message.negativeIntValue.toString() : undefined; obj.double_value = message.doubleValue; - obj.string_value = message.stringValue; + obj.string_value = message.stringValue ? base64FromBytes(message.stringValue) : undefined; obj.aggregate_value = message.aggregateValue; return obj; }, @@ -4610,10 +4772,14 @@ export const UninterpretedOption_NamePart = { return message; }, fromAmino(object: UninterpretedOption_NamePartAmino): UninterpretedOption_NamePart { - return { - namePart: object.name_part, - isExtension: object.is_extension - }; + const message = createBaseUninterpretedOption_NamePart(); + if (object.name_part !== undefined && object.name_part !== null) { + message.namePart = object.name_part; + } + if (object.is_extension !== undefined && object.is_extension !== null) { + message.isExtension = object.is_extension; + } + return message; }, toAmino(message: UninterpretedOption_NamePart): UninterpretedOption_NamePartAmino { const obj: any = {}; @@ -4673,9 +4839,9 @@ export const SourceCodeInfo = { return message; }, fromAmino(object: SourceCodeInfoAmino): SourceCodeInfo { - return { - location: Array.isArray(object?.location) ? object.location.map((e: any) => SourceCodeInfo_Location.fromAmino(e)) : [] - }; + const message = createBaseSourceCodeInfo(); + message.location = object.location?.map(e => SourceCodeInfo_Location.fromAmino(e)) || []; + return message; }, toAmino(message: SourceCodeInfo): SourceCodeInfoAmino { const obj: any = {}; @@ -4788,13 +4954,17 @@ export const SourceCodeInfo_Location = { return message; }, fromAmino(object: SourceCodeInfo_LocationAmino): SourceCodeInfo_Location { - return { - path: Array.isArray(object?.path) ? object.path.map((e: any) => e) : [], - span: Array.isArray(object?.span) ? object.span.map((e: any) => e) : [], - leadingComments: object.leading_comments, - trailingComments: object.trailing_comments, - leadingDetachedComments: Array.isArray(object?.leading_detached_comments) ? object.leading_detached_comments.map((e: any) => e) : [] - }; + const message = createBaseSourceCodeInfo_Location(); + message.path = object.path?.map(e => e) || []; + message.span = object.span?.map(e => e) || []; + if (object.leading_comments !== undefined && object.leading_comments !== null) { + message.leadingComments = object.leading_comments; + } + if (object.trailing_comments !== undefined && object.trailing_comments !== null) { + message.trailingComments = object.trailing_comments; + } + message.leadingDetachedComments = object.leading_detached_comments?.map(e => e) || []; + return message; }, toAmino(message: SourceCodeInfo_Location): SourceCodeInfo_LocationAmino { const obj: any = {}; @@ -4869,9 +5039,9 @@ export const GeneratedCodeInfo = { return message; }, fromAmino(object: GeneratedCodeInfoAmino): GeneratedCodeInfo { - return { - annotation: Array.isArray(object?.annotation) ? object.annotation.map((e: any) => GeneratedCodeInfo_Annotation.fromAmino(e)) : [] - }; + const message = createBaseGeneratedCodeInfo(); + message.annotation = object.annotation?.map(e => GeneratedCodeInfo_Annotation.fromAmino(e)) || []; + return message; }, toAmino(message: GeneratedCodeInfo): GeneratedCodeInfoAmino { const obj: any = {}; @@ -4967,12 +5137,18 @@ export const GeneratedCodeInfo_Annotation = { return message; }, fromAmino(object: GeneratedCodeInfo_AnnotationAmino): GeneratedCodeInfo_Annotation { - return { - path: Array.isArray(object?.path) ? object.path.map((e: any) => e) : [], - sourceFile: object.source_file, - begin: object.begin, - end: object.end - }; + const message = createBaseGeneratedCodeInfo_Annotation(); + message.path = object.path?.map(e => e) || []; + if (object.source_file !== undefined && object.source_file !== null) { + message.sourceFile = object.source_file; + } + if (object.begin !== undefined && object.begin !== null) { + message.begin = object.begin; + } + if (object.end !== undefined && object.end !== null) { + message.end = object.end; + } + return message; }, toAmino(message: GeneratedCodeInfo_Annotation): GeneratedCodeInfo_AnnotationAmino { const obj: any = {}; diff --git a/packages/osmo-query/src/codegen/google/protobuf/empty.ts b/packages/osmo-query/src/codegen/google/protobuf/empty.ts index 90da59cee..334735896 100644 --- a/packages/osmo-query/src/codegen/google/protobuf/empty.ts +++ b/packages/osmo-query/src/codegen/google/protobuf/empty.ts @@ -70,7 +70,8 @@ export const Empty = { return message; }, fromAmino(_: EmptyAmino): Empty { - return {}; + const message = createBaseEmpty(); + return message; }, toAmino(_: Empty): EmptyAmino { const obj: any = {}; diff --git a/packages/osmo-query/src/codegen/google/protobuf/timestamp.ts b/packages/osmo-query/src/codegen/google/protobuf/timestamp.ts index 9b9b5f23d..43d45be8e 100644 --- a/packages/osmo-query/src/codegen/google/protobuf/timestamp.ts +++ b/packages/osmo-query/src/codegen/google/protobuf/timestamp.ts @@ -327,7 +327,7 @@ export const Timestamp = { return fromJsonTimestamp(object); }, toAmino(message: Timestamp): TimestampAmino { - return fromTimestamp(message).toString(); + return fromTimestamp(message).toISOString().replace(/\.\d+Z$/, "Z"); }, fromAminoMsg(object: TimestampAminoMsg): Timestamp { return Timestamp.fromAmino(object.value); diff --git a/packages/osmo-query/src/codegen/helpers.ts b/packages/osmo-query/src/codegen/helpers.ts index 001bf14de..26b89dece 100644 --- a/packages/osmo-query/src/codegen/helpers.ts +++ b/packages/osmo-query/src/codegen/helpers.ts @@ -1,5 +1,5 @@ /** -* This file and any referenced files were automatically generated by @cosmology/telescope@0.102.0 +* This file and any referenced files were automatically generated by @cosmology/telescope@1.4.1 * DO NOT MODIFY BY HAND. Instead, download the latest proto files for your chain * and run the transpile command or yarn proto command to regenerate this bundle. */ @@ -226,13 +226,6 @@ export function fromTimestamp(t: Timestamp): Date { return new Date(millis); } -const fromJSON = (object: any): Timestamp => { - return { - seconds: isSet(object.seconds) ? BigInt(object.seconds) : BigInt(0), - nanos: isSet(object.nanos) ? Number(object.nanos) : 0 - }; -}; - const timestampFromJSON = (object: any): Timestamp => { return { seconds: isSet(object.seconds) @@ -253,5 +246,5 @@ export function fromJsonTimestamp(o: any): Timestamp { } function numberToLong(number: number) { - return BigInt(number); + return BigInt(Math.trunc(number)); } diff --git a/packages/osmo-query/src/codegen/hooks.ts b/packages/osmo-query/src/codegen/hooks.ts index 45e25719e..02ffafa4e 100644 --- a/packages/osmo-query/src/codegen/hooks.ts +++ b/packages/osmo-query/src/codegen/hooks.ts @@ -3,8 +3,10 @@ import * as _CosmosAuthV1beta1Queryrpc from "./cosmos/auth/v1beta1/query.rpc.Que import * as _CosmosAuthzV1beta1Queryrpc from "./cosmos/authz/v1beta1/query.rpc.Query"; import * as _CosmosBankV1beta1Queryrpc from "./cosmos/bank/v1beta1/query.rpc.Query"; import * as _CosmosBaseNodeV1beta1Queryrpc from "./cosmos/base/node/v1beta1/query.rpc.Service"; +import * as _CosmosConsensusV1Queryrpc from "./cosmos/consensus/v1/query.rpc.Query"; import * as _CosmosDistributionV1beta1Queryrpc from "./cosmos/distribution/v1beta1/query.rpc.Query"; import * as _CosmosGovV1beta1Queryrpc from "./cosmos/gov/v1beta1/query.rpc.Query"; +import * as _CosmosOrmQueryV1alpha1Queryrpc from "./cosmos/orm/query/v1alpha1/query.rpc.Query"; import * as _CosmosStakingV1beta1Queryrpc from "./cosmos/staking/v1beta1/query.rpc.Query"; import * as _CosmosTxV1beta1Servicerpc from "./cosmos/tx/v1beta1/service.rpc.Service"; import * as _CosmosUpgradeV1beta1Queryrpc from "./cosmos/upgrade/v1beta1/query.rpc.Query"; @@ -15,25 +17,27 @@ import * as _IbcApplicationsTransferV1Queryrpc from "./ibc/applications/transfer import * as _IbcCoreChannelV1Queryrpc from "./ibc/core/channel/v1/query.rpc.Query"; import * as _IbcCoreClientV1Queryrpc from "./ibc/core/client/v1/query.rpc.Query"; import * as _IbcCoreConnectionV1Queryrpc from "./ibc/core/connection/v1/query.rpc.Query"; +import * as _IbcLightclientsWasmV1Queryrpc from "./ibc/lightclients/wasm/v1/query.rpc.Query"; import * as _CosmwasmWasmV1Queryrpc from "./cosmwasm/wasm/v1/query.rpc.Query"; -import * as _OsmosisConcentratedliquidityQueryrpc from "./osmosis/concentrated-liquidity/query.rpc.Query"; +import * as _OsmosisConcentratedliquidityV1beta1Queryrpc from "./osmosis/concentratedliquidity/v1beta1/query.rpc.Query"; import * as _OsmosisCosmwasmpoolV1beta1Queryrpc from "./osmosis/cosmwasmpool/v1beta1/query.rpc.Query"; -import * as _OsmosisDowntimedetectorV1beta1Queryrpc from "./osmosis/downtime-detector/v1beta1/query.rpc.Query"; -import * as _OsmosisEpochsQueryrpc from "./osmosis/epochs/query.rpc.Query"; +import * as _OsmosisDowntimedetectorV1beta1Queryrpc from "./osmosis/downtimedetector/v1beta1/query.rpc.Query"; +import * as _OsmosisEpochsV1beta1Queryrpc from "./osmosis/epochs/v1beta1/query.rpc.Query"; import * as _OsmosisGammV1beta1Queryrpc from "./osmosis/gamm/v1beta1/query.rpc.Query"; import * as _OsmosisGammV2Queryrpc from "./osmosis/gamm/v2/query.rpc.Query"; -import * as _OsmosisIbcratelimitV1beta1Queryrpc from "./osmosis/ibc-rate-limit/v1beta1/query.rpc.Query"; +import * as _OsmosisIbcratelimitV1beta1Queryrpc from "./osmosis/ibcratelimit/v1beta1/query.rpc.Query"; import * as _OsmosisIncentivesQueryrpc from "./osmosis/incentives/query.rpc.Query"; import * as _OsmosisLockupQueryrpc from "./osmosis/lockup/query.rpc.Query"; import * as _OsmosisMintV1beta1Queryrpc from "./osmosis/mint/v1beta1/query.rpc.Query"; -import * as _OsmosisPoolincentivesV1beta1Queryrpc from "./osmosis/pool-incentives/v1beta1/query.rpc.Query"; +import * as _OsmosisPoolincentivesV1beta1Queryrpc from "./osmosis/poolincentives/v1beta1/query.rpc.Query"; import * as _OsmosisPoolmanagerV1beta1Queryrpc from "./osmosis/poolmanager/v1beta1/query.rpc.Query"; +import * as _OsmosisPoolmanagerV2Queryrpc from "./osmosis/poolmanager/v2/query.rpc.Query"; import * as _OsmosisProtorevV1beta1Queryrpc from "./osmosis/protorev/v1beta1/query.rpc.Query"; import * as _OsmosisSuperfluidQueryrpc from "./osmosis/superfluid/query.rpc.Query"; import * as _OsmosisTokenfactoryV1beta1Queryrpc from "./osmosis/tokenfactory/v1beta1/query.rpc.Query"; import * as _OsmosisTwapV1beta1Queryrpc from "./osmosis/twap/v1beta1/query.rpc.Query"; import * as _OsmosisTxfeesV1beta1Queryrpc from "./osmosis/txfees/v1beta1/query.rpc.Query"; -import * as _OsmosisValsetprefV1beta1Queryrpc from "./osmosis/valset-pref/v1beta1/query.rpc.Query"; +import * as _OsmosisValsetprefV1beta1Queryrpc from "./osmosis/valsetpref/v1beta1/query.rpc.Query"; export const createRpcQueryHooks = ({ rpc }: { @@ -55,12 +59,20 @@ export const createRpcQueryHooks = ({ v1beta1: _CosmosBaseNodeV1beta1Queryrpc.createRpcQueryHooks(rpc) } }, + consensus: { + v1: _CosmosConsensusV1Queryrpc.createRpcQueryHooks(rpc) + }, distribution: { v1beta1: _CosmosDistributionV1beta1Queryrpc.createRpcQueryHooks(rpc) }, gov: { v1beta1: _CosmosGovV1beta1Queryrpc.createRpcQueryHooks(rpc) }, + orm: { + query: { + v1alpha1: _CosmosOrmQueryV1alpha1Queryrpc.createRpcQueryHooks(rpc) + } + }, staking: { v1beta1: _CosmosStakingV1beta1Queryrpc.createRpcQueryHooks(rpc) }, @@ -98,6 +110,11 @@ export const createRpcQueryHooks = ({ connection: { v1: _IbcCoreConnectionV1Queryrpc.createRpcQueryHooks(rpc) } + }, + lightclients: { + wasm: { + v1: _IbcLightclientsWasmV1Queryrpc.createRpcQueryHooks(rpc) + } } }, cosmwasm: { @@ -107,7 +124,7 @@ export const createRpcQueryHooks = ({ }, osmosis: { concentratedliquidity: { - v1beta1: _OsmosisConcentratedliquidityQueryrpc.createRpcQueryHooks(rpc) + v1beta1: _OsmosisConcentratedliquidityV1beta1Queryrpc.createRpcQueryHooks(rpc) }, cosmwasmpool: { v1beta1: _OsmosisCosmwasmpoolV1beta1Queryrpc.createRpcQueryHooks(rpc) @@ -116,7 +133,7 @@ export const createRpcQueryHooks = ({ v1beta1: _OsmosisDowntimedetectorV1beta1Queryrpc.createRpcQueryHooks(rpc) }, epochs: { - v1beta1: _OsmosisEpochsQueryrpc.createRpcQueryHooks(rpc) + v1beta1: _OsmosisEpochsV1beta1Queryrpc.createRpcQueryHooks(rpc) }, gamm: { v1beta1: _OsmosisGammV1beta1Queryrpc.createRpcQueryHooks(rpc), @@ -134,7 +151,8 @@ export const createRpcQueryHooks = ({ v1beta1: _OsmosisPoolincentivesV1beta1Queryrpc.createRpcQueryHooks(rpc) }, poolmanager: { - v1beta1: _OsmosisPoolmanagerV1beta1Queryrpc.createRpcQueryHooks(rpc) + v1beta1: _OsmosisPoolmanagerV1beta1Queryrpc.createRpcQueryHooks(rpc), + v2: _OsmosisPoolmanagerV2Queryrpc.createRpcQueryHooks(rpc) }, protorev: { v1beta1: _OsmosisProtorevV1beta1Queryrpc.createRpcQueryHooks(rpc) diff --git a/packages/osmo-query/src/codegen/ibc/applications/fee/v1/ack.ts b/packages/osmo-query/src/codegen/ibc/applications/fee/v1/ack.ts index e7999c409..5f009c87e 100644 --- a/packages/osmo-query/src/codegen/ibc/applications/fee/v1/ack.ts +++ b/packages/osmo-query/src/codegen/ibc/applications/fee/v1/ack.ts @@ -1,4 +1,5 @@ import { BinaryReader, BinaryWriter } from "../../../../binary"; +import { bytesFromBase64, base64FromBytes } from "../../../../helpers"; /** IncentivizedAcknowledgement is the acknowledgement format to be used by applications wrapped in the fee middleware */ export interface IncentivizedAcknowledgement { /** the underlying app acknowledgement bytes */ @@ -15,11 +16,11 @@ export interface IncentivizedAcknowledgementProtoMsg { /** IncentivizedAcknowledgement is the acknowledgement format to be used by applications wrapped in the fee middleware */ export interface IncentivizedAcknowledgementAmino { /** the underlying app acknowledgement bytes */ - app_acknowledgement: Uint8Array; + app_acknowledgement?: string; /** the relayer address which submits the recv packet message */ - forward_relayer_address: string; + forward_relayer_address?: string; /** success flag of the base application callback */ - underlying_app_success: boolean; + underlying_app_success?: boolean; } export interface IncentivizedAcknowledgementAminoMsg { type: "cosmos-sdk/IncentivizedAcknowledgement"; @@ -83,15 +84,21 @@ export const IncentivizedAcknowledgement = { return message; }, fromAmino(object: IncentivizedAcknowledgementAmino): IncentivizedAcknowledgement { - return { - appAcknowledgement: object.app_acknowledgement, - forwardRelayerAddress: object.forward_relayer_address, - underlyingAppSuccess: object.underlying_app_success - }; + const message = createBaseIncentivizedAcknowledgement(); + if (object.app_acknowledgement !== undefined && object.app_acknowledgement !== null) { + message.appAcknowledgement = bytesFromBase64(object.app_acknowledgement); + } + if (object.forward_relayer_address !== undefined && object.forward_relayer_address !== null) { + message.forwardRelayerAddress = object.forward_relayer_address; + } + if (object.underlying_app_success !== undefined && object.underlying_app_success !== null) { + message.underlyingAppSuccess = object.underlying_app_success; + } + return message; }, toAmino(message: IncentivizedAcknowledgement): IncentivizedAcknowledgementAmino { const obj: any = {}; - obj.app_acknowledgement = message.appAcknowledgement; + obj.app_acknowledgement = message.appAcknowledgement ? base64FromBytes(message.appAcknowledgement) : undefined; obj.forward_relayer_address = message.forwardRelayerAddress; obj.underlying_app_success = message.underlyingAppSuccess; return obj; diff --git a/packages/osmo-query/src/codegen/ibc/applications/fee/v1/fee.ts b/packages/osmo-query/src/codegen/ibc/applications/fee/v1/fee.ts index 0bd6561e0..f47a92e2c 100644 --- a/packages/osmo-query/src/codegen/ibc/applications/fee/v1/fee.ts +++ b/packages/osmo-query/src/codegen/ibc/applications/fee/v1/fee.ts @@ -17,11 +17,11 @@ export interface FeeProtoMsg { /** Fee defines the ICS29 receive, acknowledgement and timeout fees */ export interface FeeAmino { /** the packet receive fee */ - recv_fee: CoinAmino[]; + recv_fee?: CoinAmino[]; /** the packet acknowledgement fee */ - ack_fee: CoinAmino[]; + ack_fee?: CoinAmino[]; /** the packet timeout fee */ - timeout_fee: CoinAmino[]; + timeout_fee?: CoinAmino[]; } export interface FeeAminoMsg { type: "cosmos-sdk/Fee"; @@ -51,9 +51,9 @@ export interface PacketFeeAmino { /** fee encapsulates the recv, ack and timeout fees associated with an IBC packet */ fee?: FeeAmino; /** the refund address for unspent fees */ - refund_address: string; + refund_address?: string; /** optional list of relayers permitted to receive fees */ - relayers: string[]; + relayers?: string[]; } export interface PacketFeeAminoMsg { type: "cosmos-sdk/PacketFee"; @@ -77,7 +77,7 @@ export interface PacketFeesProtoMsg { /** PacketFees contains a list of type PacketFee */ export interface PacketFeesAmino { /** list of packet fees */ - packet_fees: PacketFeeAmino[]; + packet_fees?: PacketFeeAmino[]; } export interface PacketFeesAminoMsg { type: "cosmos-sdk/PacketFees"; @@ -103,7 +103,7 @@ export interface IdentifiedPacketFeesAmino { /** unique packet identifier comprised of the channel ID, port ID and sequence */ packet_id?: PacketIdAmino; /** list of packet fees */ - packet_fees: PacketFeeAmino[]; + packet_fees?: PacketFeeAmino[]; } export interface IdentifiedPacketFeesAminoMsg { type: "cosmos-sdk/IdentifiedPacketFees"; @@ -166,11 +166,11 @@ export const Fee = { return message; }, fromAmino(object: FeeAmino): Fee { - return { - recvFee: Array.isArray(object?.recv_fee) ? object.recv_fee.map((e: any) => Coin.fromAmino(e)) : [], - ackFee: Array.isArray(object?.ack_fee) ? object.ack_fee.map((e: any) => Coin.fromAmino(e)) : [], - timeoutFee: Array.isArray(object?.timeout_fee) ? object.timeout_fee.map((e: any) => Coin.fromAmino(e)) : [] - }; + const message = createBaseFee(); + message.recvFee = object.recv_fee?.map(e => Coin.fromAmino(e)) || []; + message.ackFee = object.ack_fee?.map(e => Coin.fromAmino(e)) || []; + message.timeoutFee = object.timeout_fee?.map(e => Coin.fromAmino(e)) || []; + return message; }, toAmino(message: Fee): FeeAmino { const obj: any = {}; @@ -265,11 +265,15 @@ export const PacketFee = { return message; }, fromAmino(object: PacketFeeAmino): PacketFee { - return { - fee: object?.fee ? Fee.fromAmino(object.fee) : undefined, - refundAddress: object.refund_address, - relayers: Array.isArray(object?.relayers) ? object.relayers.map((e: any) => e) : [] - }; + const message = createBasePacketFee(); + if (object.fee !== undefined && object.fee !== null) { + message.fee = Fee.fromAmino(object.fee); + } + if (object.refund_address !== undefined && object.refund_address !== null) { + message.refundAddress = object.refund_address; + } + message.relayers = object.relayers?.map(e => e) || []; + return message; }, toAmino(message: PacketFee): PacketFeeAmino { const obj: any = {}; @@ -340,9 +344,9 @@ export const PacketFees = { return message; }, fromAmino(object: PacketFeesAmino): PacketFees { - return { - packetFees: Array.isArray(object?.packet_fees) ? object.packet_fees.map((e: any) => PacketFee.fromAmino(e)) : [] - }; + const message = createBasePacketFees(); + message.packetFees = object.packet_fees?.map(e => PacketFee.fromAmino(e)) || []; + return message; }, toAmino(message: PacketFees): PacketFeesAmino { const obj: any = {}; @@ -419,10 +423,12 @@ export const IdentifiedPacketFees = { return message; }, fromAmino(object: IdentifiedPacketFeesAmino): IdentifiedPacketFees { - return { - packetId: object?.packet_id ? PacketId.fromAmino(object.packet_id) : undefined, - packetFees: Array.isArray(object?.packet_fees) ? object.packet_fees.map((e: any) => PacketFee.fromAmino(e)) : [] - }; + const message = createBaseIdentifiedPacketFees(); + if (object.packet_id !== undefined && object.packet_id !== null) { + message.packetId = PacketId.fromAmino(object.packet_id); + } + message.packetFees = object.packet_fees?.map(e => PacketFee.fromAmino(e)) || []; + return message; }, toAmino(message: IdentifiedPacketFees): IdentifiedPacketFeesAmino { const obj: any = {}; diff --git a/packages/osmo-query/src/codegen/ibc/applications/fee/v1/genesis.ts b/packages/osmo-query/src/codegen/ibc/applications/fee/v1/genesis.ts index 98ffcbecc..abf8c0b8d 100644 --- a/packages/osmo-query/src/codegen/ibc/applications/fee/v1/genesis.ts +++ b/packages/osmo-query/src/codegen/ibc/applications/fee/v1/genesis.ts @@ -21,15 +21,15 @@ export interface GenesisStateProtoMsg { /** GenesisState defines the ICS29 fee middleware genesis state */ export interface GenesisStateAmino { /** list of identified packet fees */ - identified_fees: IdentifiedPacketFeesAmino[]; + identified_fees?: IdentifiedPacketFeesAmino[]; /** list of fee enabled channels */ - fee_enabled_channels: FeeEnabledChannelAmino[]; + fee_enabled_channels?: FeeEnabledChannelAmino[]; /** list of registered payees */ - registered_payees: RegisteredPayeeAmino[]; + registered_payees?: RegisteredPayeeAmino[]; /** list of registered counterparty payees */ - registered_counterparty_payees: RegisteredCounterpartyPayeeAmino[]; + registered_counterparty_payees?: RegisteredCounterpartyPayeeAmino[]; /** list of forward relayer addresses */ - forward_relayers: ForwardRelayerAddressAmino[]; + forward_relayers?: ForwardRelayerAddressAmino[]; } export interface GenesisStateAminoMsg { type: "cosmos-sdk/GenesisState"; @@ -57,9 +57,9 @@ export interface FeeEnabledChannelProtoMsg { /** FeeEnabledChannel contains the PortID & ChannelID for a fee enabled channel */ export interface FeeEnabledChannelAmino { /** unique port identifier */ - port_id: string; + port_id?: string; /** unique channel identifier */ - channel_id: string; + channel_id?: string; } export interface FeeEnabledChannelAminoMsg { type: "cosmos-sdk/FeeEnabledChannel"; @@ -86,11 +86,11 @@ export interface RegisteredPayeeProtoMsg { /** RegisteredPayee contains the relayer address and payee address for a specific channel */ export interface RegisteredPayeeAmino { /** unique channel identifier */ - channel_id: string; + channel_id?: string; /** the relayer address */ - relayer: string; + relayer?: string; /** the payee address */ - payee: string; + payee?: string; } export interface RegisteredPayeeAminoMsg { type: "cosmos-sdk/RegisteredPayee"; @@ -124,11 +124,11 @@ export interface RegisteredCounterpartyPayeeProtoMsg { */ export interface RegisteredCounterpartyPayeeAmino { /** unique channel identifier */ - channel_id: string; + channel_id?: string; /** the relayer address */ - relayer: string; + relayer?: string; /** the counterparty payee address */ - counterparty_payee: string; + counterparty_payee?: string; } export interface RegisteredCounterpartyPayeeAminoMsg { type: "cosmos-sdk/RegisteredCounterpartyPayee"; @@ -147,7 +147,7 @@ export interface RegisteredCounterpartyPayeeSDKType { export interface ForwardRelayerAddress { /** the forward relayer address */ address: string; - /** unique packet identifer comprised of the channel ID, port ID and sequence */ + /** unique packet identifier comprised of the channel ID, port ID and sequence */ packetId: PacketId; } export interface ForwardRelayerAddressProtoMsg { @@ -157,8 +157,8 @@ export interface ForwardRelayerAddressProtoMsg { /** ForwardRelayerAddress contains the forward relayer address and PacketId used for async acknowledgements */ export interface ForwardRelayerAddressAmino { /** the forward relayer address */ - address: string; - /** unique packet identifer comprised of the channel ID, port ID and sequence */ + address?: string; + /** unique packet identifier comprised of the channel ID, port ID and sequence */ packet_id?: PacketIdAmino; } export interface ForwardRelayerAddressAminoMsg { @@ -238,13 +238,13 @@ export const GenesisState = { return message; }, fromAmino(object: GenesisStateAmino): GenesisState { - return { - identifiedFees: Array.isArray(object?.identified_fees) ? object.identified_fees.map((e: any) => IdentifiedPacketFees.fromAmino(e)) : [], - feeEnabledChannels: Array.isArray(object?.fee_enabled_channels) ? object.fee_enabled_channels.map((e: any) => FeeEnabledChannel.fromAmino(e)) : [], - registeredPayees: Array.isArray(object?.registered_payees) ? object.registered_payees.map((e: any) => RegisteredPayee.fromAmino(e)) : [], - registeredCounterpartyPayees: Array.isArray(object?.registered_counterparty_payees) ? object.registered_counterparty_payees.map((e: any) => RegisteredCounterpartyPayee.fromAmino(e)) : [], - forwardRelayers: Array.isArray(object?.forward_relayers) ? object.forward_relayers.map((e: any) => ForwardRelayerAddress.fromAmino(e)) : [] - }; + const message = createBaseGenesisState(); + message.identifiedFees = object.identified_fees?.map(e => IdentifiedPacketFees.fromAmino(e)) || []; + message.feeEnabledChannels = object.fee_enabled_channels?.map(e => FeeEnabledChannel.fromAmino(e)) || []; + message.registeredPayees = object.registered_payees?.map(e => RegisteredPayee.fromAmino(e)) || []; + message.registeredCounterpartyPayees = object.registered_counterparty_payees?.map(e => RegisteredCounterpartyPayee.fromAmino(e)) || []; + message.forwardRelayers = object.forward_relayers?.map(e => ForwardRelayerAddress.fromAmino(e)) || []; + return message; }, toAmino(message: GenesisState): GenesisStateAmino { const obj: any = {}; @@ -341,10 +341,14 @@ export const FeeEnabledChannel = { return message; }, fromAmino(object: FeeEnabledChannelAmino): FeeEnabledChannel { - return { - portId: object.port_id, - channelId: object.channel_id - }; + const message = createBaseFeeEnabledChannel(); + if (object.port_id !== undefined && object.port_id !== null) { + message.portId = object.port_id; + } + if (object.channel_id !== undefined && object.channel_id !== null) { + message.channelId = object.channel_id; + } + return message; }, toAmino(message: FeeEnabledChannel): FeeEnabledChannelAmino { const obj: any = {}; @@ -426,11 +430,17 @@ export const RegisteredPayee = { return message; }, fromAmino(object: RegisteredPayeeAmino): RegisteredPayee { - return { - channelId: object.channel_id, - relayer: object.relayer, - payee: object.payee - }; + const message = createBaseRegisteredPayee(); + if (object.channel_id !== undefined && object.channel_id !== null) { + message.channelId = object.channel_id; + } + if (object.relayer !== undefined && object.relayer !== null) { + message.relayer = object.relayer; + } + if (object.payee !== undefined && object.payee !== null) { + message.payee = object.payee; + } + return message; }, toAmino(message: RegisteredPayee): RegisteredPayeeAmino { const obj: any = {}; @@ -513,11 +523,17 @@ export const RegisteredCounterpartyPayee = { return message; }, fromAmino(object: RegisteredCounterpartyPayeeAmino): RegisteredCounterpartyPayee { - return { - channelId: object.channel_id, - relayer: object.relayer, - counterpartyPayee: object.counterparty_payee - }; + const message = createBaseRegisteredCounterpartyPayee(); + if (object.channel_id !== undefined && object.channel_id !== null) { + message.channelId = object.channel_id; + } + if (object.relayer !== undefined && object.relayer !== null) { + message.relayer = object.relayer; + } + if (object.counterparty_payee !== undefined && object.counterparty_payee !== null) { + message.counterpartyPayee = object.counterparty_payee; + } + return message; }, toAmino(message: RegisteredCounterpartyPayee): RegisteredCounterpartyPayeeAmino { const obj: any = {}; @@ -592,10 +608,14 @@ export const ForwardRelayerAddress = { return message; }, fromAmino(object: ForwardRelayerAddressAmino): ForwardRelayerAddress { - return { - address: object.address, - packetId: object?.packet_id ? PacketId.fromAmino(object.packet_id) : undefined - }; + const message = createBaseForwardRelayerAddress(); + if (object.address !== undefined && object.address !== null) { + message.address = object.address; + } + if (object.packet_id !== undefined && object.packet_id !== null) { + message.packetId = PacketId.fromAmino(object.packet_id); + } + return message; }, toAmino(message: ForwardRelayerAddress): ForwardRelayerAddressAmino { const obj: any = {}; diff --git a/packages/osmo-query/src/codegen/ibc/applications/fee/v1/metadata.ts b/packages/osmo-query/src/codegen/ibc/applications/fee/v1/metadata.ts index f552a2e2e..a82459c85 100644 --- a/packages/osmo-query/src/codegen/ibc/applications/fee/v1/metadata.ts +++ b/packages/osmo-query/src/codegen/ibc/applications/fee/v1/metadata.ts @@ -19,9 +19,9 @@ export interface MetadataProtoMsg { */ export interface MetadataAmino { /** fee_version defines the ICS29 fee version */ - fee_version: string; + fee_version?: string; /** app_version defines the underlying application version, which may or may not be a JSON encoded bytestring */ - app_version: string; + app_version?: string; } export interface MetadataAminoMsg { type: "cosmos-sdk/Metadata"; @@ -79,10 +79,14 @@ export const Metadata = { return message; }, fromAmino(object: MetadataAmino): Metadata { - return { - feeVersion: object.fee_version, - appVersion: object.app_version - }; + const message = createBaseMetadata(); + if (object.fee_version !== undefined && object.fee_version !== null) { + message.feeVersion = object.fee_version; + } + if (object.app_version !== undefined && object.app_version !== null) { + message.appVersion = object.app_version; + } + return message; }, toAmino(message: Metadata): MetadataAmino { const obj: any = {}; diff --git a/packages/osmo-query/src/codegen/ibc/applications/fee/v1/query.ts b/packages/osmo-query/src/codegen/ibc/applications/fee/v1/query.ts index e7593dd86..ec5fd9bd3 100644 --- a/packages/osmo-query/src/codegen/ibc/applications/fee/v1/query.ts +++ b/packages/osmo-query/src/codegen/ibc/applications/fee/v1/query.ts @@ -7,7 +7,7 @@ import { BinaryReader, BinaryWriter } from "../../../../binary"; /** QueryIncentivizedPacketsRequest defines the request type for the IncentivizedPackets rpc */ export interface QueryIncentivizedPacketsRequest { /** pagination defines an optional pagination for the request. */ - pagination: PageRequest; + pagination?: PageRequest; /** block height at which to query */ queryHeight: bigint; } @@ -20,7 +20,7 @@ export interface QueryIncentivizedPacketsRequestAmino { /** pagination defines an optional pagination for the request. */ pagination?: PageRequestAmino; /** block height at which to query */ - query_height: string; + query_height?: string; } export interface QueryIncentivizedPacketsRequestAminoMsg { type: "cosmos-sdk/QueryIncentivizedPacketsRequest"; @@ -28,7 +28,7 @@ export interface QueryIncentivizedPacketsRequestAminoMsg { } /** QueryIncentivizedPacketsRequest defines the request type for the IncentivizedPackets rpc */ export interface QueryIncentivizedPacketsRequestSDKType { - pagination: PageRequestSDKType; + pagination?: PageRequestSDKType; query_height: bigint; } /** QueryIncentivizedPacketsResponse defines the response type for the IncentivizedPackets rpc */ @@ -36,7 +36,7 @@ export interface QueryIncentivizedPacketsResponse { /** list of identified fees for incentivized packets */ incentivizedPackets: IdentifiedPacketFees[]; /** pagination defines the pagination in the response. */ - pagination: PageResponse; + pagination?: PageResponse; } export interface QueryIncentivizedPacketsResponseProtoMsg { typeUrl: "/ibc.applications.fee.v1.QueryIncentivizedPacketsResponse"; @@ -45,7 +45,7 @@ export interface QueryIncentivizedPacketsResponseProtoMsg { /** QueryIncentivizedPacketsResponse defines the response type for the IncentivizedPackets rpc */ export interface QueryIncentivizedPacketsResponseAmino { /** list of identified fees for incentivized packets */ - incentivized_packets: IdentifiedPacketFeesAmino[]; + incentivized_packets?: IdentifiedPacketFeesAmino[]; /** pagination defines the pagination in the response. */ pagination?: PageResponseAmino; } @@ -56,7 +56,7 @@ export interface QueryIncentivizedPacketsResponseAminoMsg { /** QueryIncentivizedPacketsResponse defines the response type for the IncentivizedPackets rpc */ export interface QueryIncentivizedPacketsResponseSDKType { incentivized_packets: IdentifiedPacketFeesSDKType[]; - pagination: PageResponseSDKType; + pagination?: PageResponseSDKType; } /** QueryIncentivizedPacketRequest defines the request type for the IncentivizedPacket rpc */ export interface QueryIncentivizedPacketRequest { @@ -74,7 +74,7 @@ export interface QueryIncentivizedPacketRequestAmino { /** unique packet identifier comprised of channel ID, port ID and sequence */ packet_id?: PacketIdAmino; /** block height at which to query */ - query_height: string; + query_height?: string; } export interface QueryIncentivizedPacketRequestAminoMsg { type: "cosmos-sdk/QueryIncentivizedPacketRequest"; @@ -113,7 +113,7 @@ export interface QueryIncentivizedPacketResponseSDKType { */ export interface QueryIncentivizedPacketsForChannelRequest { /** pagination defines an optional pagination for the request. */ - pagination: PageRequest; + pagination?: PageRequest; portId: string; channelId: string; /** Height to query at */ @@ -130,10 +130,10 @@ export interface QueryIncentivizedPacketsForChannelRequestProtoMsg { export interface QueryIncentivizedPacketsForChannelRequestAmino { /** pagination defines an optional pagination for the request. */ pagination?: PageRequestAmino; - port_id: string; - channel_id: string; + port_id?: string; + channel_id?: string; /** Height to query at */ - query_height: string; + query_height?: string; } export interface QueryIncentivizedPacketsForChannelRequestAminoMsg { type: "cosmos-sdk/QueryIncentivizedPacketsForChannelRequest"; @@ -144,7 +144,7 @@ export interface QueryIncentivizedPacketsForChannelRequestAminoMsg { * for a specific channel */ export interface QueryIncentivizedPacketsForChannelRequestSDKType { - pagination: PageRequestSDKType; + pagination?: PageRequestSDKType; port_id: string; channel_id: string; query_height: bigint; @@ -154,7 +154,7 @@ export interface QueryIncentivizedPacketsForChannelResponse { /** Map of all incentivized_packets */ incentivizedPackets: IdentifiedPacketFees[]; /** pagination defines the pagination in the response. */ - pagination: PageResponse; + pagination?: PageResponse; } export interface QueryIncentivizedPacketsForChannelResponseProtoMsg { typeUrl: "/ibc.applications.fee.v1.QueryIncentivizedPacketsForChannelResponse"; @@ -163,7 +163,7 @@ export interface QueryIncentivizedPacketsForChannelResponseProtoMsg { /** QueryIncentivizedPacketsResponse defines the response type for the incentivized packets RPC */ export interface QueryIncentivizedPacketsForChannelResponseAmino { /** Map of all incentivized_packets */ - incentivized_packets: IdentifiedPacketFeesAmino[]; + incentivized_packets?: IdentifiedPacketFeesAmino[]; /** pagination defines the pagination in the response. */ pagination?: PageResponseAmino; } @@ -174,7 +174,7 @@ export interface QueryIncentivizedPacketsForChannelResponseAminoMsg { /** QueryIncentivizedPacketsResponse defines the response type for the incentivized packets RPC */ export interface QueryIncentivizedPacketsForChannelResponseSDKType { incentivized_packets: IdentifiedPacketFeesSDKType[]; - pagination: PageResponseSDKType; + pagination?: PageResponseSDKType; } /** QueryTotalRecvFeesRequest defines the request type for the TotalRecvFees rpc */ export interface QueryTotalRecvFeesRequest { @@ -210,7 +210,7 @@ export interface QueryTotalRecvFeesResponseProtoMsg { /** QueryTotalRecvFeesResponse defines the response type for the TotalRecvFees rpc */ export interface QueryTotalRecvFeesResponseAmino { /** the total packet receive fees */ - recv_fees: CoinAmino[]; + recv_fees?: CoinAmino[]; } export interface QueryTotalRecvFeesResponseAminoMsg { type: "cosmos-sdk/QueryTotalRecvFeesResponse"; @@ -254,7 +254,7 @@ export interface QueryTotalAckFeesResponseProtoMsg { /** QueryTotalAckFeesResponse defines the response type for the TotalAckFees rpc */ export interface QueryTotalAckFeesResponseAmino { /** the total packet acknowledgement fees */ - ack_fees: CoinAmino[]; + ack_fees?: CoinAmino[]; } export interface QueryTotalAckFeesResponseAminoMsg { type: "cosmos-sdk/QueryTotalAckFeesResponse"; @@ -298,7 +298,7 @@ export interface QueryTotalTimeoutFeesResponseProtoMsg { /** QueryTotalTimeoutFeesResponse defines the response type for the TotalTimeoutFees rpc */ export interface QueryTotalTimeoutFeesResponseAmino { /** the total packet timeout fees */ - timeout_fees: CoinAmino[]; + timeout_fees?: CoinAmino[]; } export interface QueryTotalTimeoutFeesResponseAminoMsg { type: "cosmos-sdk/QueryTotalTimeoutFeesResponse"; @@ -322,9 +322,9 @@ export interface QueryPayeeRequestProtoMsg { /** QueryPayeeRequest defines the request type for the Payee rpc */ export interface QueryPayeeRequestAmino { /** unique channel identifier */ - channel_id: string; + channel_id?: string; /** the relayer address to which the distribution address is registered */ - relayer: string; + relayer?: string; } export interface QueryPayeeRequestAminoMsg { type: "cosmos-sdk/QueryPayeeRequest"; @@ -347,7 +347,7 @@ export interface QueryPayeeResponseProtoMsg { /** QueryPayeeResponse defines the response type for the Payee rpc */ export interface QueryPayeeResponseAmino { /** the payee address to which packet fees are paid out */ - payee_address: string; + payee_address?: string; } export interface QueryPayeeResponseAminoMsg { type: "cosmos-sdk/QueryPayeeResponse"; @@ -371,9 +371,9 @@ export interface QueryCounterpartyPayeeRequestProtoMsg { /** QueryCounterpartyPayeeRequest defines the request type for the CounterpartyPayee rpc */ export interface QueryCounterpartyPayeeRequestAmino { /** unique channel identifier */ - channel_id: string; + channel_id?: string; /** the relayer address to which the counterparty is registered */ - relayer: string; + relayer?: string; } export interface QueryCounterpartyPayeeRequestAminoMsg { type: "cosmos-sdk/QueryCounterpartyPayeeRequest"; @@ -396,7 +396,7 @@ export interface QueryCounterpartyPayeeResponseProtoMsg { /** QueryCounterpartyPayeeResponse defines the response type for the CounterpartyPayee rpc */ export interface QueryCounterpartyPayeeResponseAmino { /** the counterparty payee address used to compensate forward relaying */ - counterparty_payee: string; + counterparty_payee?: string; } export interface QueryCounterpartyPayeeResponseAminoMsg { type: "cosmos-sdk/QueryCounterpartyPayeeResponse"; @@ -409,7 +409,7 @@ export interface QueryCounterpartyPayeeResponseSDKType { /** QueryFeeEnabledChannelsRequest defines the request type for the FeeEnabledChannels rpc */ export interface QueryFeeEnabledChannelsRequest { /** pagination defines an optional pagination for the request. */ - pagination: PageRequest; + pagination?: PageRequest; /** block height at which to query */ queryHeight: bigint; } @@ -422,7 +422,7 @@ export interface QueryFeeEnabledChannelsRequestAmino { /** pagination defines an optional pagination for the request. */ pagination?: PageRequestAmino; /** block height at which to query */ - query_height: string; + query_height?: string; } export interface QueryFeeEnabledChannelsRequestAminoMsg { type: "cosmos-sdk/QueryFeeEnabledChannelsRequest"; @@ -430,7 +430,7 @@ export interface QueryFeeEnabledChannelsRequestAminoMsg { } /** QueryFeeEnabledChannelsRequest defines the request type for the FeeEnabledChannels rpc */ export interface QueryFeeEnabledChannelsRequestSDKType { - pagination: PageRequestSDKType; + pagination?: PageRequestSDKType; query_height: bigint; } /** QueryFeeEnabledChannelsResponse defines the response type for the FeeEnabledChannels rpc */ @@ -438,7 +438,7 @@ export interface QueryFeeEnabledChannelsResponse { /** list of fee enabled channels */ feeEnabledChannels: FeeEnabledChannel[]; /** pagination defines the pagination in the response. */ - pagination: PageResponse; + pagination?: PageResponse; } export interface QueryFeeEnabledChannelsResponseProtoMsg { typeUrl: "/ibc.applications.fee.v1.QueryFeeEnabledChannelsResponse"; @@ -447,7 +447,7 @@ export interface QueryFeeEnabledChannelsResponseProtoMsg { /** QueryFeeEnabledChannelsResponse defines the response type for the FeeEnabledChannels rpc */ export interface QueryFeeEnabledChannelsResponseAmino { /** list of fee enabled channels */ - fee_enabled_channels: FeeEnabledChannelAmino[]; + fee_enabled_channels?: FeeEnabledChannelAmino[]; /** pagination defines the pagination in the response. */ pagination?: PageResponseAmino; } @@ -458,7 +458,7 @@ export interface QueryFeeEnabledChannelsResponseAminoMsg { /** QueryFeeEnabledChannelsResponse defines the response type for the FeeEnabledChannels rpc */ export interface QueryFeeEnabledChannelsResponseSDKType { fee_enabled_channels: FeeEnabledChannelSDKType[]; - pagination: PageResponseSDKType; + pagination?: PageResponseSDKType; } /** QueryFeeEnabledChannelRequest defines the request type for the FeeEnabledChannel rpc */ export interface QueryFeeEnabledChannelRequest { @@ -474,9 +474,9 @@ export interface QueryFeeEnabledChannelRequestProtoMsg { /** QueryFeeEnabledChannelRequest defines the request type for the FeeEnabledChannel rpc */ export interface QueryFeeEnabledChannelRequestAmino { /** unique port identifier */ - port_id: string; + port_id?: string; /** unique channel identifier */ - channel_id: string; + channel_id?: string; } export interface QueryFeeEnabledChannelRequestAminoMsg { type: "cosmos-sdk/QueryFeeEnabledChannelRequest"; @@ -499,7 +499,7 @@ export interface QueryFeeEnabledChannelResponseProtoMsg { /** QueryFeeEnabledChannelResponse defines the response type for the FeeEnabledChannel rpc */ export interface QueryFeeEnabledChannelResponseAmino { /** boolean flag representing the fee enabled channel status */ - fee_enabled: boolean; + fee_enabled?: boolean; } export interface QueryFeeEnabledChannelResponseAminoMsg { type: "cosmos-sdk/QueryFeeEnabledChannelResponse"; @@ -511,7 +511,7 @@ export interface QueryFeeEnabledChannelResponseSDKType { } function createBaseQueryIncentivizedPacketsRequest(): QueryIncentivizedPacketsRequest { return { - pagination: PageRequest.fromPartial({}), + pagination: undefined, queryHeight: BigInt(0) }; } @@ -553,10 +553,14 @@ export const QueryIncentivizedPacketsRequest = { return message; }, fromAmino(object: QueryIncentivizedPacketsRequestAmino): QueryIncentivizedPacketsRequest { - return { - pagination: object?.pagination ? PageRequest.fromAmino(object.pagination) : undefined, - queryHeight: BigInt(object.query_height) - }; + const message = createBaseQueryIncentivizedPacketsRequest(); + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromAmino(object.pagination); + } + if (object.query_height !== undefined && object.query_height !== null) { + message.queryHeight = BigInt(object.query_height); + } + return message; }, toAmino(message: QueryIncentivizedPacketsRequest): QueryIncentivizedPacketsRequestAmino { const obj: any = {}; @@ -589,7 +593,7 @@ export const QueryIncentivizedPacketsRequest = { function createBaseQueryIncentivizedPacketsResponse(): QueryIncentivizedPacketsResponse { return { incentivizedPackets: [], - pagination: PageResponse.fromPartial({}) + pagination: undefined }; } export const QueryIncentivizedPacketsResponse = { @@ -630,10 +634,12 @@ export const QueryIncentivizedPacketsResponse = { return message; }, fromAmino(object: QueryIncentivizedPacketsResponseAmino): QueryIncentivizedPacketsResponse { - return { - incentivizedPackets: Array.isArray(object?.incentivized_packets) ? object.incentivized_packets.map((e: any) => IdentifiedPacketFees.fromAmino(e)) : [], - pagination: object?.pagination ? PageResponse.fromAmino(object.pagination) : undefined - }; + const message = createBaseQueryIncentivizedPacketsResponse(); + message.incentivizedPackets = object.incentivized_packets?.map(e => IdentifiedPacketFees.fromAmino(e)) || []; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromAmino(object.pagination); + } + return message; }, toAmino(message: QueryIncentivizedPacketsResponse): QueryIncentivizedPacketsResponseAmino { const obj: any = {}; @@ -711,10 +717,14 @@ export const QueryIncentivizedPacketRequest = { return message; }, fromAmino(object: QueryIncentivizedPacketRequestAmino): QueryIncentivizedPacketRequest { - return { - packetId: object?.packet_id ? PacketId.fromAmino(object.packet_id) : undefined, - queryHeight: BigInt(object.query_height) - }; + const message = createBaseQueryIncentivizedPacketRequest(); + if (object.packet_id !== undefined && object.packet_id !== null) { + message.packetId = PacketId.fromAmino(object.packet_id); + } + if (object.query_height !== undefined && object.query_height !== null) { + message.queryHeight = BigInt(object.query_height); + } + return message; }, toAmino(message: QueryIncentivizedPacketRequest): QueryIncentivizedPacketRequestAmino { const obj: any = {}; @@ -780,9 +790,11 @@ export const QueryIncentivizedPacketResponse = { return message; }, fromAmino(object: QueryIncentivizedPacketResponseAmino): QueryIncentivizedPacketResponse { - return { - incentivizedPacket: object?.incentivized_packet ? IdentifiedPacketFees.fromAmino(object.incentivized_packet) : undefined - }; + const message = createBaseQueryIncentivizedPacketResponse(); + if (object.incentivized_packet !== undefined && object.incentivized_packet !== null) { + message.incentivizedPacket = IdentifiedPacketFees.fromAmino(object.incentivized_packet); + } + return message; }, toAmino(message: QueryIncentivizedPacketResponse): QueryIncentivizedPacketResponseAmino { const obj: any = {}; @@ -813,7 +825,7 @@ export const QueryIncentivizedPacketResponse = { }; function createBaseQueryIncentivizedPacketsForChannelRequest(): QueryIncentivizedPacketsForChannelRequest { return { - pagination: PageRequest.fromPartial({}), + pagination: undefined, portId: "", channelId: "", queryHeight: BigInt(0) @@ -871,12 +883,20 @@ export const QueryIncentivizedPacketsForChannelRequest = { return message; }, fromAmino(object: QueryIncentivizedPacketsForChannelRequestAmino): QueryIncentivizedPacketsForChannelRequest { - return { - pagination: object?.pagination ? PageRequest.fromAmino(object.pagination) : undefined, - portId: object.port_id, - channelId: object.channel_id, - queryHeight: BigInt(object.query_height) - }; + const message = createBaseQueryIncentivizedPacketsForChannelRequest(); + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromAmino(object.pagination); + } + if (object.port_id !== undefined && object.port_id !== null) { + message.portId = object.port_id; + } + if (object.channel_id !== undefined && object.channel_id !== null) { + message.channelId = object.channel_id; + } + if (object.query_height !== undefined && object.query_height !== null) { + message.queryHeight = BigInt(object.query_height); + } + return message; }, toAmino(message: QueryIncentivizedPacketsForChannelRequest): QueryIncentivizedPacketsForChannelRequestAmino { const obj: any = {}; @@ -911,7 +931,7 @@ export const QueryIncentivizedPacketsForChannelRequest = { function createBaseQueryIncentivizedPacketsForChannelResponse(): QueryIncentivizedPacketsForChannelResponse { return { incentivizedPackets: [], - pagination: PageResponse.fromPartial({}) + pagination: undefined }; } export const QueryIncentivizedPacketsForChannelResponse = { @@ -952,10 +972,12 @@ export const QueryIncentivizedPacketsForChannelResponse = { return message; }, fromAmino(object: QueryIncentivizedPacketsForChannelResponseAmino): QueryIncentivizedPacketsForChannelResponse { - return { - incentivizedPackets: Array.isArray(object?.incentivized_packets) ? object.incentivized_packets.map((e: any) => IdentifiedPacketFees.fromAmino(e)) : [], - pagination: object?.pagination ? PageResponse.fromAmino(object.pagination) : undefined - }; + const message = createBaseQueryIncentivizedPacketsForChannelResponse(); + message.incentivizedPackets = object.incentivized_packets?.map(e => IdentifiedPacketFees.fromAmino(e)) || []; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromAmino(object.pagination); + } + return message; }, toAmino(message: QueryIncentivizedPacketsForChannelResponse): QueryIncentivizedPacketsForChannelResponseAmino { const obj: any = {}; @@ -1025,9 +1047,11 @@ export const QueryTotalRecvFeesRequest = { return message; }, fromAmino(object: QueryTotalRecvFeesRequestAmino): QueryTotalRecvFeesRequest { - return { - packetId: object?.packet_id ? PacketId.fromAmino(object.packet_id) : undefined - }; + const message = createBaseQueryTotalRecvFeesRequest(); + if (object.packet_id !== undefined && object.packet_id !== null) { + message.packetId = PacketId.fromAmino(object.packet_id); + } + return message; }, toAmino(message: QueryTotalRecvFeesRequest): QueryTotalRecvFeesRequestAmino { const obj: any = {}; @@ -1092,9 +1116,9 @@ export const QueryTotalRecvFeesResponse = { return message; }, fromAmino(object: QueryTotalRecvFeesResponseAmino): QueryTotalRecvFeesResponse { - return { - recvFees: Array.isArray(object?.recv_fees) ? object.recv_fees.map((e: any) => Coin.fromAmino(e)) : [] - }; + const message = createBaseQueryTotalRecvFeesResponse(); + message.recvFees = object.recv_fees?.map(e => Coin.fromAmino(e)) || []; + return message; }, toAmino(message: QueryTotalRecvFeesResponse): QueryTotalRecvFeesResponseAmino { const obj: any = {}; @@ -1163,9 +1187,11 @@ export const QueryTotalAckFeesRequest = { return message; }, fromAmino(object: QueryTotalAckFeesRequestAmino): QueryTotalAckFeesRequest { - return { - packetId: object?.packet_id ? PacketId.fromAmino(object.packet_id) : undefined - }; + const message = createBaseQueryTotalAckFeesRequest(); + if (object.packet_id !== undefined && object.packet_id !== null) { + message.packetId = PacketId.fromAmino(object.packet_id); + } + return message; }, toAmino(message: QueryTotalAckFeesRequest): QueryTotalAckFeesRequestAmino { const obj: any = {}; @@ -1230,9 +1256,9 @@ export const QueryTotalAckFeesResponse = { return message; }, fromAmino(object: QueryTotalAckFeesResponseAmino): QueryTotalAckFeesResponse { - return { - ackFees: Array.isArray(object?.ack_fees) ? object.ack_fees.map((e: any) => Coin.fromAmino(e)) : [] - }; + const message = createBaseQueryTotalAckFeesResponse(); + message.ackFees = object.ack_fees?.map(e => Coin.fromAmino(e)) || []; + return message; }, toAmino(message: QueryTotalAckFeesResponse): QueryTotalAckFeesResponseAmino { const obj: any = {}; @@ -1301,9 +1327,11 @@ export const QueryTotalTimeoutFeesRequest = { return message; }, fromAmino(object: QueryTotalTimeoutFeesRequestAmino): QueryTotalTimeoutFeesRequest { - return { - packetId: object?.packet_id ? PacketId.fromAmino(object.packet_id) : undefined - }; + const message = createBaseQueryTotalTimeoutFeesRequest(); + if (object.packet_id !== undefined && object.packet_id !== null) { + message.packetId = PacketId.fromAmino(object.packet_id); + } + return message; }, toAmino(message: QueryTotalTimeoutFeesRequest): QueryTotalTimeoutFeesRequestAmino { const obj: any = {}; @@ -1368,9 +1396,9 @@ export const QueryTotalTimeoutFeesResponse = { return message; }, fromAmino(object: QueryTotalTimeoutFeesResponseAmino): QueryTotalTimeoutFeesResponse { - return { - timeoutFees: Array.isArray(object?.timeout_fees) ? object.timeout_fees.map((e: any) => Coin.fromAmino(e)) : [] - }; + const message = createBaseQueryTotalTimeoutFeesResponse(); + message.timeoutFees = object.timeout_fees?.map(e => Coin.fromAmino(e)) || []; + return message; }, toAmino(message: QueryTotalTimeoutFeesResponse): QueryTotalTimeoutFeesResponseAmino { const obj: any = {}; @@ -1447,10 +1475,14 @@ export const QueryPayeeRequest = { return message; }, fromAmino(object: QueryPayeeRequestAmino): QueryPayeeRequest { - return { - channelId: object.channel_id, - relayer: object.relayer - }; + const message = createBaseQueryPayeeRequest(); + if (object.channel_id !== undefined && object.channel_id !== null) { + message.channelId = object.channel_id; + } + if (object.relayer !== undefined && object.relayer !== null) { + message.relayer = object.relayer; + } + return message; }, toAmino(message: QueryPayeeRequest): QueryPayeeRequestAmino { const obj: any = {}; @@ -1516,9 +1548,11 @@ export const QueryPayeeResponse = { return message; }, fromAmino(object: QueryPayeeResponseAmino): QueryPayeeResponse { - return { - payeeAddress: object.payee_address - }; + const message = createBaseQueryPayeeResponse(); + if (object.payee_address !== undefined && object.payee_address !== null) { + message.payeeAddress = object.payee_address; + } + return message; }, toAmino(message: QueryPayeeResponse): QueryPayeeResponseAmino { const obj: any = {}; @@ -1591,10 +1625,14 @@ export const QueryCounterpartyPayeeRequest = { return message; }, fromAmino(object: QueryCounterpartyPayeeRequestAmino): QueryCounterpartyPayeeRequest { - return { - channelId: object.channel_id, - relayer: object.relayer - }; + const message = createBaseQueryCounterpartyPayeeRequest(); + if (object.channel_id !== undefined && object.channel_id !== null) { + message.channelId = object.channel_id; + } + if (object.relayer !== undefined && object.relayer !== null) { + message.relayer = object.relayer; + } + return message; }, toAmino(message: QueryCounterpartyPayeeRequest): QueryCounterpartyPayeeRequestAmino { const obj: any = {}; @@ -1660,9 +1698,11 @@ export const QueryCounterpartyPayeeResponse = { return message; }, fromAmino(object: QueryCounterpartyPayeeResponseAmino): QueryCounterpartyPayeeResponse { - return { - counterpartyPayee: object.counterparty_payee - }; + const message = createBaseQueryCounterpartyPayeeResponse(); + if (object.counterparty_payee !== undefined && object.counterparty_payee !== null) { + message.counterpartyPayee = object.counterparty_payee; + } + return message; }, toAmino(message: QueryCounterpartyPayeeResponse): QueryCounterpartyPayeeResponseAmino { const obj: any = {}; @@ -1693,7 +1733,7 @@ export const QueryCounterpartyPayeeResponse = { }; function createBaseQueryFeeEnabledChannelsRequest(): QueryFeeEnabledChannelsRequest { return { - pagination: PageRequest.fromPartial({}), + pagination: undefined, queryHeight: BigInt(0) }; } @@ -1735,10 +1775,14 @@ export const QueryFeeEnabledChannelsRequest = { return message; }, fromAmino(object: QueryFeeEnabledChannelsRequestAmino): QueryFeeEnabledChannelsRequest { - return { - pagination: object?.pagination ? PageRequest.fromAmino(object.pagination) : undefined, - queryHeight: BigInt(object.query_height) - }; + const message = createBaseQueryFeeEnabledChannelsRequest(); + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromAmino(object.pagination); + } + if (object.query_height !== undefined && object.query_height !== null) { + message.queryHeight = BigInt(object.query_height); + } + return message; }, toAmino(message: QueryFeeEnabledChannelsRequest): QueryFeeEnabledChannelsRequestAmino { const obj: any = {}; @@ -1771,7 +1815,7 @@ export const QueryFeeEnabledChannelsRequest = { function createBaseQueryFeeEnabledChannelsResponse(): QueryFeeEnabledChannelsResponse { return { feeEnabledChannels: [], - pagination: PageResponse.fromPartial({}) + pagination: undefined }; } export const QueryFeeEnabledChannelsResponse = { @@ -1812,10 +1856,12 @@ export const QueryFeeEnabledChannelsResponse = { return message; }, fromAmino(object: QueryFeeEnabledChannelsResponseAmino): QueryFeeEnabledChannelsResponse { - return { - feeEnabledChannels: Array.isArray(object?.fee_enabled_channels) ? object.fee_enabled_channels.map((e: any) => FeeEnabledChannel.fromAmino(e)) : [], - pagination: object?.pagination ? PageResponse.fromAmino(object.pagination) : undefined - }; + const message = createBaseQueryFeeEnabledChannelsResponse(); + message.feeEnabledChannels = object.fee_enabled_channels?.map(e => FeeEnabledChannel.fromAmino(e)) || []; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromAmino(object.pagination); + } + return message; }, toAmino(message: QueryFeeEnabledChannelsResponse): QueryFeeEnabledChannelsResponseAmino { const obj: any = {}; @@ -1893,10 +1939,14 @@ export const QueryFeeEnabledChannelRequest = { return message; }, fromAmino(object: QueryFeeEnabledChannelRequestAmino): QueryFeeEnabledChannelRequest { - return { - portId: object.port_id, - channelId: object.channel_id - }; + const message = createBaseQueryFeeEnabledChannelRequest(); + if (object.port_id !== undefined && object.port_id !== null) { + message.portId = object.port_id; + } + if (object.channel_id !== undefined && object.channel_id !== null) { + message.channelId = object.channel_id; + } + return message; }, toAmino(message: QueryFeeEnabledChannelRequest): QueryFeeEnabledChannelRequestAmino { const obj: any = {}; @@ -1962,9 +2012,11 @@ export const QueryFeeEnabledChannelResponse = { return message; }, fromAmino(object: QueryFeeEnabledChannelResponseAmino): QueryFeeEnabledChannelResponse { - return { - feeEnabled: object.fee_enabled - }; + const message = createBaseQueryFeeEnabledChannelResponse(); + if (object.fee_enabled !== undefined && object.fee_enabled !== null) { + message.feeEnabled = object.fee_enabled; + } + return message; }, toAmino(message: QueryFeeEnabledChannelResponse): QueryFeeEnabledChannelResponseAmino { const obj: any = {}; diff --git a/packages/osmo-query/src/codegen/ibc/applications/fee/v1/tx.ts b/packages/osmo-query/src/codegen/ibc/applications/fee/v1/tx.ts index 86b99e0f8..991ce86e1 100644 --- a/packages/osmo-query/src/codegen/ibc/applications/fee/v1/tx.ts +++ b/packages/osmo-query/src/codegen/ibc/applications/fee/v1/tx.ts @@ -19,13 +19,13 @@ export interface MsgRegisterPayeeProtoMsg { /** MsgRegisterPayee defines the request type for the RegisterPayee rpc */ export interface MsgRegisterPayeeAmino { /** unique port identifier */ - port_id: string; + port_id?: string; /** unique channel identifier */ - channel_id: string; + channel_id?: string; /** the relayer address */ - relayer: string; + relayer?: string; /** the payee address */ - payee: string; + payee?: string; } export interface MsgRegisterPayeeAminoMsg { type: "cosmos-sdk/MsgRegisterPayee"; @@ -70,13 +70,13 @@ export interface MsgRegisterCounterpartyPayeeProtoMsg { /** MsgRegisterCounterpartyPayee defines the request type for the RegisterCounterpartyPayee rpc */ export interface MsgRegisterCounterpartyPayeeAmino { /** unique port identifier */ - port_id: string; + port_id?: string; /** unique channel identifier */ - channel_id: string; + channel_id?: string; /** the relayer address */ - relayer: string; + relayer?: string; /** the counterparty payee address */ - counterparty_payee: string; + counterparty_payee?: string; } export interface MsgRegisterCounterpartyPayeeAminoMsg { type: "cosmos-sdk/MsgRegisterCounterpartyPayee"; @@ -113,7 +113,7 @@ export interface MsgPayPacketFee { fee: Fee; /** the source port unique identifier */ sourcePortId: string; - /** the source channel unique identifer */ + /** the source channel unique identifier */ sourceChannelId: string; /** account address to refund fee if necessary */ signer: string; @@ -131,15 +131,15 @@ export interface MsgPayPacketFeeProtoMsg { */ export interface MsgPayPacketFeeAmino { /** fee encapsulates the recv, ack and timeout fees associated with an IBC packet */ - fee?: FeeAmino; + fee: FeeAmino; /** the source port unique identifier */ - source_port_id: string; - /** the source channel unique identifer */ - source_channel_id: string; + source_port_id?: string; + /** the source channel unique identifier */ + source_channel_id?: string; /** account address to refund fee if necessary */ - signer: string; + signer?: string; /** optional list of relayers permitted to the receive packet fees */ - relayers: string[]; + relayers?: string[]; } export interface MsgPayPacketFeeAminoMsg { type: "cosmos-sdk/MsgPayPacketFee"; @@ -191,9 +191,9 @@ export interface MsgPayPacketFeeAsyncProtoMsg { */ export interface MsgPayPacketFeeAsyncAmino { /** unique packet identifier comprised of the channel ID, port ID and sequence */ - packet_id?: PacketIdAmino; + packet_id: PacketIdAmino; /** the packet fee associated with a particular IBC packet */ - packet_fee?: PacketFeeAmino; + packet_fee: PacketFeeAmino; } export interface MsgPayPacketFeeAsyncAminoMsg { type: "cosmos-sdk/MsgPayPacketFeeAsync"; @@ -281,12 +281,20 @@ export const MsgRegisterPayee = { return message; }, fromAmino(object: MsgRegisterPayeeAmino): MsgRegisterPayee { - return { - portId: object.port_id, - channelId: object.channel_id, - relayer: object.relayer, - payee: object.payee - }; + const message = createBaseMsgRegisterPayee(); + if (object.port_id !== undefined && object.port_id !== null) { + message.portId = object.port_id; + } + if (object.channel_id !== undefined && object.channel_id !== null) { + message.channelId = object.channel_id; + } + if (object.relayer !== undefined && object.relayer !== null) { + message.relayer = object.relayer; + } + if (object.payee !== undefined && object.payee !== null) { + message.payee = object.payee; + } + return message; }, toAmino(message: MsgRegisterPayee): MsgRegisterPayeeAmino { const obj: any = {}; @@ -345,7 +353,8 @@ export const MsgRegisterPayeeResponse = { return message; }, fromAmino(_: MsgRegisterPayeeResponseAmino): MsgRegisterPayeeResponse { - return {}; + const message = createBaseMsgRegisterPayeeResponse(); + return message; }, toAmino(_: MsgRegisterPayeeResponse): MsgRegisterPayeeResponseAmino { const obj: any = {}; @@ -433,12 +442,20 @@ export const MsgRegisterCounterpartyPayee = { return message; }, fromAmino(object: MsgRegisterCounterpartyPayeeAmino): MsgRegisterCounterpartyPayee { - return { - portId: object.port_id, - channelId: object.channel_id, - relayer: object.relayer, - counterpartyPayee: object.counterparty_payee - }; + const message = createBaseMsgRegisterCounterpartyPayee(); + if (object.port_id !== undefined && object.port_id !== null) { + message.portId = object.port_id; + } + if (object.channel_id !== undefined && object.channel_id !== null) { + message.channelId = object.channel_id; + } + if (object.relayer !== undefined && object.relayer !== null) { + message.relayer = object.relayer; + } + if (object.counterparty_payee !== undefined && object.counterparty_payee !== null) { + message.counterpartyPayee = object.counterparty_payee; + } + return message; }, toAmino(message: MsgRegisterCounterpartyPayee): MsgRegisterCounterpartyPayeeAmino { const obj: any = {}; @@ -497,7 +514,8 @@ export const MsgRegisterCounterpartyPayeeResponse = { return message; }, fromAmino(_: MsgRegisterCounterpartyPayeeResponseAmino): MsgRegisterCounterpartyPayeeResponse { - return {}; + const message = createBaseMsgRegisterCounterpartyPayeeResponse(); + return message; }, toAmino(_: MsgRegisterCounterpartyPayeeResponse): MsgRegisterCounterpartyPayeeResponseAmino { const obj: any = {}; @@ -593,17 +611,25 @@ export const MsgPayPacketFee = { return message; }, fromAmino(object: MsgPayPacketFeeAmino): MsgPayPacketFee { - return { - fee: object?.fee ? Fee.fromAmino(object.fee) : undefined, - sourcePortId: object.source_port_id, - sourceChannelId: object.source_channel_id, - signer: object.signer, - relayers: Array.isArray(object?.relayers) ? object.relayers.map((e: any) => e) : [] - }; + const message = createBaseMsgPayPacketFee(); + if (object.fee !== undefined && object.fee !== null) { + message.fee = Fee.fromAmino(object.fee); + } + if (object.source_port_id !== undefined && object.source_port_id !== null) { + message.sourcePortId = object.source_port_id; + } + if (object.source_channel_id !== undefined && object.source_channel_id !== null) { + message.sourceChannelId = object.source_channel_id; + } + if (object.signer !== undefined && object.signer !== null) { + message.signer = object.signer; + } + message.relayers = object.relayers?.map(e => e) || []; + return message; }, toAmino(message: MsgPayPacketFee): MsgPayPacketFeeAmino { const obj: any = {}; - obj.fee = message.fee ? Fee.toAmino(message.fee) : undefined; + obj.fee = message.fee ? Fee.toAmino(message.fee) : Fee.fromPartial({}); obj.source_port_id = message.sourcePortId; obj.source_channel_id = message.sourceChannelId; obj.signer = message.signer; @@ -663,7 +689,8 @@ export const MsgPayPacketFeeResponse = { return message; }, fromAmino(_: MsgPayPacketFeeResponseAmino): MsgPayPacketFeeResponse { - return {}; + const message = createBaseMsgPayPacketFeeResponse(); + return message; }, toAmino(_: MsgPayPacketFeeResponse): MsgPayPacketFeeResponseAmino { const obj: any = {}; @@ -735,15 +762,19 @@ export const MsgPayPacketFeeAsync = { return message; }, fromAmino(object: MsgPayPacketFeeAsyncAmino): MsgPayPacketFeeAsync { - return { - packetId: object?.packet_id ? PacketId.fromAmino(object.packet_id) : undefined, - packetFee: object?.packet_fee ? PacketFee.fromAmino(object.packet_fee) : undefined - }; + const message = createBaseMsgPayPacketFeeAsync(); + if (object.packet_id !== undefined && object.packet_id !== null) { + message.packetId = PacketId.fromAmino(object.packet_id); + } + if (object.packet_fee !== undefined && object.packet_fee !== null) { + message.packetFee = PacketFee.fromAmino(object.packet_fee); + } + return message; }, toAmino(message: MsgPayPacketFeeAsync): MsgPayPacketFeeAsyncAmino { const obj: any = {}; - obj.packet_id = message.packetId ? PacketId.toAmino(message.packetId) : undefined; - obj.packet_fee = message.packetFee ? PacketFee.toAmino(message.packetFee) : undefined; + obj.packet_id = message.packetId ? PacketId.toAmino(message.packetId) : PacketId.fromPartial({}); + obj.packet_fee = message.packetFee ? PacketFee.toAmino(message.packetFee) : PacketFee.fromPartial({}); return obj; }, fromAminoMsg(object: MsgPayPacketFeeAsyncAminoMsg): MsgPayPacketFeeAsync { @@ -795,7 +826,8 @@ export const MsgPayPacketFeeAsyncResponse = { return message; }, fromAmino(_: MsgPayPacketFeeAsyncResponseAmino): MsgPayPacketFeeAsyncResponse { - return {}; + const message = createBaseMsgPayPacketFeeAsyncResponse(); + return message; }, toAmino(_: MsgPayPacketFeeAsyncResponse): MsgPayPacketFeeAsyncResponseAmino { const obj: any = {}; diff --git a/packages/osmo-query/src/codegen/ibc/applications/interchain_accounts/controller/v1/controller.ts b/packages/osmo-query/src/codegen/ibc/applications/interchain_accounts/controller/v1/controller.ts index c07167950..54633f82e 100644 --- a/packages/osmo-query/src/codegen/ibc/applications/interchain_accounts/controller/v1/controller.ts +++ b/packages/osmo-query/src/codegen/ibc/applications/interchain_accounts/controller/v1/controller.ts @@ -17,7 +17,7 @@ export interface ParamsProtoMsg { */ export interface ParamsAmino { /** controller_enabled enables or disables the controller submodule. */ - controller_enabled: boolean; + controller_enabled?: boolean; } export interface ParamsAminoMsg { type: "cosmos-sdk/Params"; @@ -66,9 +66,11 @@ export const Params = { return message; }, fromAmino(object: ParamsAmino): Params { - return { - controllerEnabled: object.controller_enabled - }; + const message = createBaseParams(); + if (object.controller_enabled !== undefined && object.controller_enabled !== null) { + message.controllerEnabled = object.controller_enabled; + } + return message; }, toAmino(message: Params): ParamsAmino { const obj: any = {}; diff --git a/packages/osmo-query/src/codegen/ibc/applications/interchain_accounts/controller/v1/query.ts b/packages/osmo-query/src/codegen/ibc/applications/interchain_accounts/controller/v1/query.ts index 218435d41..2c32b30ad 100644 --- a/packages/osmo-query/src/codegen/ibc/applications/interchain_accounts/controller/v1/query.ts +++ b/packages/osmo-query/src/codegen/ibc/applications/interchain_accounts/controller/v1/query.ts @@ -11,8 +11,8 @@ export interface QueryInterchainAccountRequestProtoMsg { } /** QueryInterchainAccountRequest is the request type for the Query/InterchainAccount RPC method. */ export interface QueryInterchainAccountRequestAmino { - owner: string; - connection_id: string; + owner?: string; + connection_id?: string; } export interface QueryInterchainAccountRequestAminoMsg { type: "cosmos-sdk/QueryInterchainAccountRequest"; @@ -33,7 +33,7 @@ export interface QueryInterchainAccountResponseProtoMsg { } /** QueryInterchainAccountResponse the response type for the Query/InterchainAccount RPC method. */ export interface QueryInterchainAccountResponseAmino { - address: string; + address?: string; } export interface QueryInterchainAccountResponseAminoMsg { type: "cosmos-sdk/QueryInterchainAccountResponse"; @@ -60,7 +60,7 @@ export interface QueryParamsRequestSDKType {} /** 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; } export interface QueryParamsResponseProtoMsg { typeUrl: "/ibc.applications.interchain_accounts.controller.v1.QueryParamsResponse"; @@ -77,7 +77,7 @@ export interface QueryParamsResponseAminoMsg { } /** QueryParamsResponse is the response type for the Query/Params RPC method. */ export interface QueryParamsResponseSDKType { - params: ParamsSDKType; + params?: ParamsSDKType; } function createBaseQueryInterchainAccountRequest(): QueryInterchainAccountRequest { return { @@ -123,10 +123,14 @@ export const QueryInterchainAccountRequest = { return message; }, fromAmino(object: QueryInterchainAccountRequestAmino): QueryInterchainAccountRequest { - return { - owner: object.owner, - connectionId: object.connection_id - }; + const message = createBaseQueryInterchainAccountRequest(); + if (object.owner !== undefined && object.owner !== null) { + message.owner = object.owner; + } + if (object.connection_id !== undefined && object.connection_id !== null) { + message.connectionId = object.connection_id; + } + return message; }, toAmino(message: QueryInterchainAccountRequest): QueryInterchainAccountRequestAmino { const obj: any = {}; @@ -192,9 +196,11 @@ export const QueryInterchainAccountResponse = { return message; }, fromAmino(object: QueryInterchainAccountResponseAmino): QueryInterchainAccountResponse { - return { - address: object.address - }; + const message = createBaseQueryInterchainAccountResponse(); + if (object.address !== undefined && object.address !== null) { + message.address = object.address; + } + return message; }, toAmino(message: QueryInterchainAccountResponse): QueryInterchainAccountResponseAmino { const obj: any = {}; @@ -250,7 +256,8 @@ export const QueryParamsRequest = { return message; }, fromAmino(_: QueryParamsRequestAmino): QueryParamsRequest { - return {}; + const message = createBaseQueryParamsRequest(); + return message; }, toAmino(_: QueryParamsRequest): QueryParamsRequestAmino { const obj: any = {}; @@ -280,7 +287,7 @@ export const QueryParamsRequest = { }; function createBaseQueryParamsResponse(): QueryParamsResponse { return { - params: Params.fromPartial({}) + params: undefined }; } export const QueryParamsResponse = { @@ -314,9 +321,11 @@ export const QueryParamsResponse = { return message; }, fromAmino(object: QueryParamsResponseAmino): QueryParamsResponse { - return { - params: object?.params ? Params.fromAmino(object.params) : undefined - }; + const message = createBaseQueryParamsResponse(); + if (object.params !== undefined && object.params !== null) { + message.params = Params.fromAmino(object.params); + } + return message; }, toAmino(message: QueryParamsResponse): QueryParamsResponseAmino { const obj: any = {}; diff --git a/packages/osmo-query/src/codegen/ibc/applications/interchain_accounts/controller/v1/tx.amino.ts b/packages/osmo-query/src/codegen/ibc/applications/interchain_accounts/controller/v1/tx.amino.ts index 52a890cd7..2632e412a 100644 --- a/packages/osmo-query/src/codegen/ibc/applications/interchain_accounts/controller/v1/tx.amino.ts +++ b/packages/osmo-query/src/codegen/ibc/applications/interchain_accounts/controller/v1/tx.amino.ts @@ -1,5 +1,5 @@ //@ts-nocheck -import { MsgRegisterInterchainAccount, MsgSendTx } from "./tx"; +import { MsgRegisterInterchainAccount, MsgSendTx, MsgUpdateParams } from "./tx"; export const AminoConverter = { "/ibc.applications.interchain_accounts.controller.v1.MsgRegisterInterchainAccount": { aminoType: "cosmos-sdk/MsgRegisterInterchainAccount", @@ -10,5 +10,10 @@ export const AminoConverter = { aminoType: "cosmos-sdk/MsgSendTx", toAmino: MsgSendTx.toAmino, fromAmino: MsgSendTx.fromAmino + }, + "/ibc.applications.interchain_accounts.controller.v1.MsgUpdateParams": { + aminoType: "cosmos-sdk/MsgUpdateParams", + toAmino: MsgUpdateParams.toAmino, + fromAmino: MsgUpdateParams.fromAmino } }; \ No newline at end of file diff --git a/packages/osmo-query/src/codegen/ibc/applications/interchain_accounts/controller/v1/tx.registry.ts b/packages/osmo-query/src/codegen/ibc/applications/interchain_accounts/controller/v1/tx.registry.ts index eaeddc0b3..6b85e7be3 100644 --- a/packages/osmo-query/src/codegen/ibc/applications/interchain_accounts/controller/v1/tx.registry.ts +++ b/packages/osmo-query/src/codegen/ibc/applications/interchain_accounts/controller/v1/tx.registry.ts @@ -1,7 +1,7 @@ //@ts-nocheck import { GeneratedType, Registry } from "@cosmjs/proto-signing"; -import { MsgRegisterInterchainAccount, MsgSendTx } from "./tx"; -export const registry: ReadonlyArray<[string, GeneratedType]> = [["/ibc.applications.interchain_accounts.controller.v1.MsgRegisterInterchainAccount", MsgRegisterInterchainAccount], ["/ibc.applications.interchain_accounts.controller.v1.MsgSendTx", MsgSendTx]]; +import { MsgRegisterInterchainAccount, MsgSendTx, MsgUpdateParams } from "./tx"; +export const registry: ReadonlyArray<[string, GeneratedType]> = [["/ibc.applications.interchain_accounts.controller.v1.MsgRegisterInterchainAccount", MsgRegisterInterchainAccount], ["/ibc.applications.interchain_accounts.controller.v1.MsgSendTx", MsgSendTx], ["/ibc.applications.interchain_accounts.controller.v1.MsgUpdateParams", MsgUpdateParams]]; export const load = (protoRegistry: Registry) => { registry.forEach(([typeUrl, mod]) => { protoRegistry.register(typeUrl, mod); @@ -20,6 +20,12 @@ export const MessageComposer = { typeUrl: "/ibc.applications.interchain_accounts.controller.v1.MsgSendTx", value: MsgSendTx.encode(value).finish() }; + }, + updateParams(value: MsgUpdateParams) { + return { + typeUrl: "/ibc.applications.interchain_accounts.controller.v1.MsgUpdateParams", + value: MsgUpdateParams.encode(value).finish() + }; } }, withTypeUrl: { @@ -34,6 +40,12 @@ export const MessageComposer = { typeUrl: "/ibc.applications.interchain_accounts.controller.v1.MsgSendTx", value }; + }, + updateParams(value: MsgUpdateParams) { + return { + typeUrl: "/ibc.applications.interchain_accounts.controller.v1.MsgUpdateParams", + value + }; } }, fromPartial: { @@ -48,6 +60,12 @@ export const MessageComposer = { typeUrl: "/ibc.applications.interchain_accounts.controller.v1.MsgSendTx", value: MsgSendTx.fromPartial(value) }; + }, + updateParams(value: MsgUpdateParams) { + return { + typeUrl: "/ibc.applications.interchain_accounts.controller.v1.MsgUpdateParams", + value: MsgUpdateParams.fromPartial(value) + }; } } }; \ No newline at end of file diff --git a/packages/osmo-query/src/codegen/ibc/applications/interchain_accounts/controller/v1/tx.rpc.msg.ts b/packages/osmo-query/src/codegen/ibc/applications/interchain_accounts/controller/v1/tx.rpc.msg.ts index a9ff2ceba..c2d828b77 100644 --- a/packages/osmo-query/src/codegen/ibc/applications/interchain_accounts/controller/v1/tx.rpc.msg.ts +++ b/packages/osmo-query/src/codegen/ibc/applications/interchain_accounts/controller/v1/tx.rpc.msg.ts @@ -1,12 +1,14 @@ import { Rpc } from "../../../../../helpers"; import { BinaryReader } from "../../../../../binary"; -import { MsgRegisterInterchainAccount, MsgRegisterInterchainAccountResponse, MsgSendTx, MsgSendTxResponse } from "./tx"; +import { MsgRegisterInterchainAccount, MsgRegisterInterchainAccountResponse, MsgSendTx, MsgSendTxResponse, MsgUpdateParams, MsgUpdateParamsResponse } from "./tx"; /** Msg defines the 27-interchain-accounts/controller Msg service. */ export interface Msg { /** RegisterInterchainAccount defines a rpc handler for MsgRegisterInterchainAccount. */ registerInterchainAccount(request: MsgRegisterInterchainAccount): Promise; /** SendTx defines a rpc handler for MsgSendTx. */ sendTx(request: MsgSendTx): Promise; + /** UpdateParams defines a rpc handler for MsgUpdateParams. */ + updateParams(request: MsgUpdateParams): Promise; } export class MsgClientImpl implements Msg { private readonly rpc: Rpc; @@ -14,6 +16,7 @@ export class MsgClientImpl implements Msg { this.rpc = rpc; this.registerInterchainAccount = this.registerInterchainAccount.bind(this); this.sendTx = this.sendTx.bind(this); + this.updateParams = this.updateParams.bind(this); } registerInterchainAccount(request: MsgRegisterInterchainAccount): Promise { const data = MsgRegisterInterchainAccount.encode(request).finish(); @@ -25,4 +28,9 @@ export class MsgClientImpl implements Msg { const promise = this.rpc.request("ibc.applications.interchain_accounts.controller.v1.Msg", "SendTx", data); return promise.then(data => MsgSendTxResponse.decode(new BinaryReader(data))); } + updateParams(request: MsgUpdateParams): Promise { + const data = MsgUpdateParams.encode(request).finish(); + const promise = this.rpc.request("ibc.applications.interchain_accounts.controller.v1.Msg", "UpdateParams", data); + return promise.then(data => MsgUpdateParamsResponse.decode(new BinaryReader(data))); + } } \ No newline at end of file diff --git a/packages/osmo-query/src/codegen/ibc/applications/interchain_accounts/controller/v1/tx.ts b/packages/osmo-query/src/codegen/ibc/applications/interchain_accounts/controller/v1/tx.ts index da390f23c..b2782f741 100644 --- a/packages/osmo-query/src/codegen/ibc/applications/interchain_accounts/controller/v1/tx.ts +++ b/packages/osmo-query/src/codegen/ibc/applications/interchain_accounts/controller/v1/tx.ts @@ -1,4 +1,5 @@ import { InterchainAccountPacketData, InterchainAccountPacketDataAmino, InterchainAccountPacketDataSDKType } from "../../v1/packet"; +import { Params, ParamsAmino, ParamsSDKType } from "./controller"; import { BinaryReader, BinaryWriter } from "../../../../../binary"; /** MsgRegisterInterchainAccount defines the payload for Msg/RegisterAccount */ export interface MsgRegisterInterchainAccount { @@ -12,9 +13,9 @@ export interface MsgRegisterInterchainAccountProtoMsg { } /** MsgRegisterInterchainAccount defines the payload for Msg/RegisterAccount */ export interface MsgRegisterInterchainAccountAmino { - owner: string; - connection_id: string; - version: string; + owner?: string; + connection_id?: string; + version?: string; } export interface MsgRegisterInterchainAccountAminoMsg { type: "cosmos-sdk/MsgRegisterInterchainAccount"; @@ -37,8 +38,8 @@ export interface MsgRegisterInterchainAccountResponseProtoMsg { } /** MsgRegisterInterchainAccountResponse defines the response for Msg/RegisterAccount */ export interface MsgRegisterInterchainAccountResponseAmino { - channel_id: string; - port_id: string; + channel_id?: string; + port_id?: string; } export interface MsgRegisterInterchainAccountResponseAminoMsg { type: "cosmos-sdk/MsgRegisterInterchainAccountResponse"; @@ -66,14 +67,14 @@ export interface MsgSendTxProtoMsg { } /** MsgSendTx defines the payload for Msg/SendTx */ export interface MsgSendTxAmino { - owner: string; - connection_id: string; + owner?: string; + connection_id?: string; packet_data?: InterchainAccountPacketDataAmino; /** * Relative timeout timestamp provided will be added to the current block time during transaction execution. * The timeout timestamp must be non-zero. */ - relative_timeout: string; + relative_timeout?: string; } export interface MsgSendTxAminoMsg { type: "cosmos-sdk/MsgSendTx"; @@ -96,7 +97,7 @@ export interface MsgSendTxResponseProtoMsg { } /** MsgSendTxResponse defines the response for MsgSendTx */ export interface MsgSendTxResponseAmino { - sequence: string; + sequence?: string; } export interface MsgSendTxResponseAminoMsg { type: "cosmos-sdk/MsgSendTxResponse"; @@ -106,6 +107,55 @@ export interface MsgSendTxResponseAminoMsg { export interface MsgSendTxResponseSDKType { sequence: bigint; } +/** MsgUpdateParams defines the payload for Msg/UpdateParams */ +export interface MsgUpdateParams { + /** signer address */ + signer: string; + /** + * params defines the 27-interchain-accounts/controller parameters to update. + * + * NOTE: All parameters must be supplied. + */ + params: Params; +} +export interface MsgUpdateParamsProtoMsg { + typeUrl: "/ibc.applications.interchain_accounts.controller.v1.MsgUpdateParams"; + value: Uint8Array; +} +/** MsgUpdateParams defines the payload for Msg/UpdateParams */ +export interface MsgUpdateParamsAmino { + /** signer address */ + signer?: string; + /** + * params defines the 27-interchain-accounts/controller parameters to update. + * + * NOTE: All parameters must be supplied. + */ + params?: ParamsAmino; +} +export interface MsgUpdateParamsAminoMsg { + type: "cosmos-sdk/MsgUpdateParams"; + value: MsgUpdateParamsAmino; +} +/** MsgUpdateParams defines the payload for Msg/UpdateParams */ +export interface MsgUpdateParamsSDKType { + signer: string; + params: ParamsSDKType; +} +/** MsgUpdateParamsResponse defines the response for Msg/UpdateParams */ +export interface MsgUpdateParamsResponse {} +export interface MsgUpdateParamsResponseProtoMsg { + typeUrl: "/ibc.applications.interchain_accounts.controller.v1.MsgUpdateParamsResponse"; + value: Uint8Array; +} +/** MsgUpdateParamsResponse defines the response for Msg/UpdateParams */ +export interface MsgUpdateParamsResponseAmino {} +export interface MsgUpdateParamsResponseAminoMsg { + type: "cosmos-sdk/MsgUpdateParamsResponse"; + value: MsgUpdateParamsResponseAmino; +} +/** MsgUpdateParamsResponse defines the response for Msg/UpdateParams */ +export interface MsgUpdateParamsResponseSDKType {} function createBaseMsgRegisterInterchainAccount(): MsgRegisterInterchainAccount { return { owner: "", @@ -158,11 +208,17 @@ export const MsgRegisterInterchainAccount = { return message; }, fromAmino(object: MsgRegisterInterchainAccountAmino): MsgRegisterInterchainAccount { - return { - owner: object.owner, - connectionId: object.connection_id, - version: object.version - }; + const message = createBaseMsgRegisterInterchainAccount(); + if (object.owner !== undefined && object.owner !== null) { + message.owner = object.owner; + } + if (object.connection_id !== undefined && object.connection_id !== null) { + message.connectionId = object.connection_id; + } + if (object.version !== undefined && object.version !== null) { + message.version = object.version; + } + return message; }, toAmino(message: MsgRegisterInterchainAccount): MsgRegisterInterchainAccountAmino { const obj: any = {}; @@ -237,10 +293,14 @@ export const MsgRegisterInterchainAccountResponse = { return message; }, fromAmino(object: MsgRegisterInterchainAccountResponseAmino): MsgRegisterInterchainAccountResponse { - return { - channelId: object.channel_id, - portId: object.port_id - }; + const message = createBaseMsgRegisterInterchainAccountResponse(); + if (object.channel_id !== undefined && object.channel_id !== null) { + message.channelId = object.channel_id; + } + if (object.port_id !== undefined && object.port_id !== null) { + message.portId = object.port_id; + } + return message; }, toAmino(message: MsgRegisterInterchainAccountResponse): MsgRegisterInterchainAccountResponseAmino { const obj: any = {}; @@ -330,12 +390,20 @@ export const MsgSendTx = { return message; }, fromAmino(object: MsgSendTxAmino): MsgSendTx { - return { - owner: object.owner, - connectionId: object.connection_id, - packetData: object?.packet_data ? InterchainAccountPacketData.fromAmino(object.packet_data) : undefined, - relativeTimeout: BigInt(object.relative_timeout) - }; + const message = createBaseMsgSendTx(); + if (object.owner !== undefined && object.owner !== null) { + message.owner = object.owner; + } + if (object.connection_id !== undefined && object.connection_id !== null) { + message.connectionId = object.connection_id; + } + if (object.packet_data !== undefined && object.packet_data !== null) { + message.packetData = InterchainAccountPacketData.fromAmino(object.packet_data); + } + if (object.relative_timeout !== undefined && object.relative_timeout !== null) { + message.relativeTimeout = BigInt(object.relative_timeout); + } + return message; }, toAmino(message: MsgSendTx): MsgSendTxAmino { const obj: any = {}; @@ -403,9 +471,11 @@ export const MsgSendTxResponse = { return message; }, fromAmino(object: MsgSendTxResponseAmino): MsgSendTxResponse { - return { - sequence: BigInt(object.sequence) - }; + const message = createBaseMsgSendTxResponse(); + if (object.sequence !== undefined && object.sequence !== null) { + message.sequence = BigInt(object.sequence); + } + return message; }, toAmino(message: MsgSendTxResponse): MsgSendTxResponseAmino { const obj: any = {}; @@ -433,4 +503,141 @@ export const MsgSendTxResponse = { value: MsgSendTxResponse.encode(message).finish() }; } +}; +function createBaseMsgUpdateParams(): MsgUpdateParams { + return { + signer: "", + params: Params.fromPartial({}) + }; +} +export const MsgUpdateParams = { + typeUrl: "/ibc.applications.interchain_accounts.controller.v1.MsgUpdateParams", + encode(message: MsgUpdateParams, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.signer !== "") { + writer.uint32(10).string(message.signer); + } + if (message.params !== undefined) { + Params.encode(message.params, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgUpdateParams { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUpdateParams(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.signer = reader.string(); + break; + case 2: + message.params = Params.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgUpdateParams { + const message = createBaseMsgUpdateParams(); + message.signer = object.signer ?? ""; + message.params = object.params !== undefined && object.params !== null ? Params.fromPartial(object.params) : undefined; + return message; + }, + fromAmino(object: MsgUpdateParamsAmino): MsgUpdateParams { + const message = createBaseMsgUpdateParams(); + if (object.signer !== undefined && object.signer !== null) { + message.signer = object.signer; + } + if (object.params !== undefined && object.params !== null) { + message.params = Params.fromAmino(object.params); + } + return message; + }, + toAmino(message: MsgUpdateParams): MsgUpdateParamsAmino { + const obj: any = {}; + obj.signer = message.signer; + obj.params = message.params ? Params.toAmino(message.params) : undefined; + return obj; + }, + fromAminoMsg(object: MsgUpdateParamsAminoMsg): MsgUpdateParams { + return MsgUpdateParams.fromAmino(object.value); + }, + toAminoMsg(message: MsgUpdateParams): MsgUpdateParamsAminoMsg { + return { + type: "cosmos-sdk/MsgUpdateParams", + value: MsgUpdateParams.toAmino(message) + }; + }, + fromProtoMsg(message: MsgUpdateParamsProtoMsg): MsgUpdateParams { + return MsgUpdateParams.decode(message.value); + }, + toProto(message: MsgUpdateParams): Uint8Array { + return MsgUpdateParams.encode(message).finish(); + }, + toProtoMsg(message: MsgUpdateParams): MsgUpdateParamsProtoMsg { + return { + typeUrl: "/ibc.applications.interchain_accounts.controller.v1.MsgUpdateParams", + value: MsgUpdateParams.encode(message).finish() + }; + } +}; +function createBaseMsgUpdateParamsResponse(): MsgUpdateParamsResponse { + return {}; +} +export const MsgUpdateParamsResponse = { + typeUrl: "/ibc.applications.interchain_accounts.controller.v1.MsgUpdateParamsResponse", + encode(_: MsgUpdateParamsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgUpdateParamsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUpdateParamsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): MsgUpdateParamsResponse { + const message = createBaseMsgUpdateParamsResponse(); + return message; + }, + fromAmino(_: MsgUpdateParamsResponseAmino): MsgUpdateParamsResponse { + const message = createBaseMsgUpdateParamsResponse(); + return message; + }, + toAmino(_: MsgUpdateParamsResponse): MsgUpdateParamsResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgUpdateParamsResponseAminoMsg): MsgUpdateParamsResponse { + return MsgUpdateParamsResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgUpdateParamsResponse): MsgUpdateParamsResponseAminoMsg { + return { + type: "cosmos-sdk/MsgUpdateParamsResponse", + value: MsgUpdateParamsResponse.toAmino(message) + }; + }, + fromProtoMsg(message: MsgUpdateParamsResponseProtoMsg): MsgUpdateParamsResponse { + return MsgUpdateParamsResponse.decode(message.value); + }, + toProto(message: MsgUpdateParamsResponse): Uint8Array { + return MsgUpdateParamsResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgUpdateParamsResponse): MsgUpdateParamsResponseProtoMsg { + return { + typeUrl: "/ibc.applications.interchain_accounts.controller.v1.MsgUpdateParamsResponse", + value: MsgUpdateParamsResponse.encode(message).finish() + }; + } }; \ No newline at end of file diff --git a/packages/osmo-query/src/codegen/ibc/applications/interchain_accounts/genesis/v1/genesis.ts b/packages/osmo-query/src/codegen/ibc/applications/interchain_accounts/genesis/v1/genesis.ts index d2ffd0c39..3162728f1 100644 --- a/packages/osmo-query/src/codegen/ibc/applications/interchain_accounts/genesis/v1/genesis.ts +++ b/packages/osmo-query/src/codegen/ibc/applications/interchain_accounts/genesis/v1/genesis.ts @@ -41,9 +41,9 @@ export interface ControllerGenesisStateProtoMsg { } /** ControllerGenesisState defines the interchain accounts controller genesis state */ export interface ControllerGenesisStateAmino { - active_channels: ActiveChannelAmino[]; - interchain_accounts: RegisteredInterchainAccountAmino[]; - ports: string[]; + active_channels?: ActiveChannelAmino[]; + interchain_accounts?: RegisteredInterchainAccountAmino[]; + ports?: string[]; params?: Params1Amino; } export interface ControllerGenesisStateAminoMsg { @@ -70,9 +70,9 @@ export interface HostGenesisStateProtoMsg { } /** HostGenesisState defines the interchain accounts host genesis state */ export interface HostGenesisStateAmino { - active_channels: ActiveChannelAmino[]; - interchain_accounts: RegisteredInterchainAccountAmino[]; - port: string; + active_channels?: ActiveChannelAmino[]; + interchain_accounts?: RegisteredInterchainAccountAmino[]; + port?: string; params?: Params2Amino; } export interface HostGenesisStateAminoMsg { @@ -105,10 +105,10 @@ export interface ActiveChannelProtoMsg { * indicate if the channel is middleware enabled */ export interface ActiveChannelAmino { - connection_id: string; - port_id: string; - channel_id: string; - is_middleware_enabled: boolean; + connection_id?: string; + port_id?: string; + channel_id?: string; + is_middleware_enabled?: boolean; } export interface ActiveChannelAminoMsg { type: "cosmos-sdk/ActiveChannel"; @@ -136,9 +136,9 @@ export interface RegisteredInterchainAccountProtoMsg { } /** RegisteredInterchainAccount contains a connection ID, port ID and associated interchain account address */ export interface RegisteredInterchainAccountAmino { - connection_id: string; - port_id: string; - account_address: string; + connection_id?: string; + port_id?: string; + account_address?: string; } export interface RegisteredInterchainAccountAminoMsg { type: "cosmos-sdk/RegisteredInterchainAccount"; @@ -194,10 +194,14 @@ export const GenesisState = { return message; }, fromAmino(object: GenesisStateAmino): GenesisState { - return { - controllerGenesisState: object?.controller_genesis_state ? ControllerGenesisState.fromAmino(object.controller_genesis_state) : undefined, - hostGenesisState: object?.host_genesis_state ? HostGenesisState.fromAmino(object.host_genesis_state) : undefined - }; + const message = createBaseGenesisState(); + if (object.controller_genesis_state !== undefined && object.controller_genesis_state !== null) { + message.controllerGenesisState = ControllerGenesisState.fromAmino(object.controller_genesis_state); + } + if (object.host_genesis_state !== undefined && object.host_genesis_state !== null) { + message.hostGenesisState = HostGenesisState.fromAmino(object.host_genesis_state); + } + return message; }, toAmino(message: GenesisState): GenesisStateAmino { const obj: any = {}; @@ -232,7 +236,7 @@ function createBaseControllerGenesisState(): ControllerGenesisState { activeChannels: [], interchainAccounts: [], ports: [], - params: Params.fromPartial({}) + params: Params1.fromPartial({}) }; } export const ControllerGenesisState = { @@ -287,12 +291,14 @@ export const ControllerGenesisState = { return message; }, fromAmino(object: ControllerGenesisStateAmino): ControllerGenesisState { - return { - activeChannels: Array.isArray(object?.active_channels) ? object.active_channels.map((e: any) => ActiveChannel.fromAmino(e)) : [], - interchainAccounts: Array.isArray(object?.interchain_accounts) ? object.interchain_accounts.map((e: any) => RegisteredInterchainAccount.fromAmino(e)) : [], - ports: Array.isArray(object?.ports) ? object.ports.map((e: any) => e) : [], - params: object?.params ? Params1.fromAmino(object.params) : undefined - }; + const message = createBaseControllerGenesisState(); + message.activeChannels = object.active_channels?.map(e => ActiveChannel.fromAmino(e)) || []; + message.interchainAccounts = object.interchain_accounts?.map(e => RegisteredInterchainAccount.fromAmino(e)) || []; + message.ports = object.ports?.map(e => e) || []; + if (object.params !== undefined && object.params !== null) { + message.params = Params1.fromAmino(object.params); + } + return message; }, toAmino(message: ControllerGenesisState): ControllerGenesisStateAmino { const obj: any = {}; @@ -341,7 +347,7 @@ function createBaseHostGenesisState(): HostGenesisState { activeChannels: [], interchainAccounts: [], port: "", - params: Params.fromPartial({}) + params: Params2.fromPartial({}) }; } export const HostGenesisState = { @@ -396,12 +402,16 @@ export const HostGenesisState = { return message; }, fromAmino(object: HostGenesisStateAmino): HostGenesisState { - return { - activeChannels: Array.isArray(object?.active_channels) ? object.active_channels.map((e: any) => ActiveChannel.fromAmino(e)) : [], - interchainAccounts: Array.isArray(object?.interchain_accounts) ? object.interchain_accounts.map((e: any) => RegisteredInterchainAccount.fromAmino(e)) : [], - port: object.port, - params: object?.params ? Params2.fromAmino(object.params) : undefined - }; + const message = createBaseHostGenesisState(); + message.activeChannels = object.active_channels?.map(e => ActiveChannel.fromAmino(e)) || []; + message.interchainAccounts = object.interchain_accounts?.map(e => RegisteredInterchainAccount.fromAmino(e)) || []; + if (object.port !== undefined && object.port !== null) { + message.port = object.port; + } + if (object.params !== undefined && object.params !== null) { + message.params = Params2.fromAmino(object.params); + } + return message; }, toAmino(message: HostGenesisState): HostGenesisStateAmino { const obj: any = {}; @@ -501,12 +511,20 @@ export const ActiveChannel = { return message; }, fromAmino(object: ActiveChannelAmino): ActiveChannel { - return { - connectionId: object.connection_id, - portId: object.port_id, - channelId: object.channel_id, - isMiddlewareEnabled: object.is_middleware_enabled - }; + const message = createBaseActiveChannel(); + if (object.connection_id !== undefined && object.connection_id !== null) { + message.connectionId = object.connection_id; + } + if (object.port_id !== undefined && object.port_id !== null) { + message.portId = object.port_id; + } + if (object.channel_id !== undefined && object.channel_id !== null) { + message.channelId = object.channel_id; + } + if (object.is_middleware_enabled !== undefined && object.is_middleware_enabled !== null) { + message.isMiddlewareEnabled = object.is_middleware_enabled; + } + return message; }, toAmino(message: ActiveChannel): ActiveChannelAmino { const obj: any = {}; @@ -590,11 +608,17 @@ export const RegisteredInterchainAccount = { return message; }, fromAmino(object: RegisteredInterchainAccountAmino): RegisteredInterchainAccount { - return { - connectionId: object.connection_id, - portId: object.port_id, - accountAddress: object.account_address - }; + const message = createBaseRegisteredInterchainAccount(); + if (object.connection_id !== undefined && object.connection_id !== null) { + message.connectionId = object.connection_id; + } + if (object.port_id !== undefined && object.port_id !== null) { + message.portId = object.port_id; + } + if (object.account_address !== undefined && object.account_address !== null) { + message.accountAddress = object.account_address; + } + return message; }, toAmino(message: RegisteredInterchainAccount): RegisteredInterchainAccountAmino { const obj: any = {}; diff --git a/packages/osmo-query/src/codegen/ibc/applications/interchain_accounts/host/v1/host.ts b/packages/osmo-query/src/codegen/ibc/applications/interchain_accounts/host/v1/host.ts index 4448c9dcd..d81c5ca98 100644 --- a/packages/osmo-query/src/codegen/ibc/applications/interchain_accounts/host/v1/host.ts +++ b/packages/osmo-query/src/codegen/ibc/applications/interchain_accounts/host/v1/host.ts @@ -19,9 +19,9 @@ export interface ParamsProtoMsg { */ export interface ParamsAmino { /** host_enabled enables or disables the host submodule. */ - host_enabled: boolean; + host_enabled?: boolean; /** allow_messages defines a list of sdk message typeURLs allowed to be executed on a host chain. */ - allow_messages: string[]; + allow_messages?: string[]; } export interface ParamsAminoMsg { type: "cosmos-sdk/Params"; @@ -79,10 +79,12 @@ export const Params = { return message; }, fromAmino(object: ParamsAmino): Params { - return { - hostEnabled: object.host_enabled, - allowMessages: Array.isArray(object?.allow_messages) ? object.allow_messages.map((e: any) => e) : [] - }; + const message = createBaseParams(); + if (object.host_enabled !== undefined && object.host_enabled !== null) { + message.hostEnabled = object.host_enabled; + } + message.allowMessages = object.allow_messages?.map(e => e) || []; + return message; }, toAmino(message: Params): ParamsAmino { const obj: any = {}; diff --git a/packages/osmo-query/src/codegen/ibc/applications/interchain_accounts/host/v1/query.ts b/packages/osmo-query/src/codegen/ibc/applications/interchain_accounts/host/v1/query.ts index 58675be2c..a67bf2159 100644 --- a/packages/osmo-query/src/codegen/ibc/applications/interchain_accounts/host/v1/query.ts +++ b/packages/osmo-query/src/codegen/ibc/applications/interchain_accounts/host/v1/query.ts @@ -17,7 +17,7 @@ export interface QueryParamsRequestSDKType {} /** 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; } export interface QueryParamsResponseProtoMsg { typeUrl: "/ibc.applications.interchain_accounts.host.v1.QueryParamsResponse"; @@ -34,7 +34,7 @@ export interface QueryParamsResponseAminoMsg { } /** QueryParamsResponse is the response type for the Query/Params RPC method. */ export interface QueryParamsResponseSDKType { - params: ParamsSDKType; + params?: ParamsSDKType; } function createBaseQueryParamsRequest(): QueryParamsRequest { return {}; @@ -63,7 +63,8 @@ export const QueryParamsRequest = { return message; }, fromAmino(_: QueryParamsRequestAmino): QueryParamsRequest { - return {}; + const message = createBaseQueryParamsRequest(); + return message; }, toAmino(_: QueryParamsRequest): QueryParamsRequestAmino { const obj: any = {}; @@ -93,7 +94,7 @@ export const QueryParamsRequest = { }; function createBaseQueryParamsResponse(): QueryParamsResponse { return { - params: Params.fromPartial({}) + params: undefined }; } export const QueryParamsResponse = { @@ -127,9 +128,11 @@ export const QueryParamsResponse = { return message; }, fromAmino(object: QueryParamsResponseAmino): QueryParamsResponse { - return { - params: object?.params ? Params.fromAmino(object.params) : undefined - }; + const message = createBaseQueryParamsResponse(); + if (object.params !== undefined && object.params !== null) { + message.params = Params.fromAmino(object.params); + } + return message; }, toAmino(message: QueryParamsResponse): QueryParamsResponseAmino { const obj: any = {}; diff --git a/packages/osmo-query/src/codegen/ibc/applications/interchain_accounts/host/v1/tx.amino.ts b/packages/osmo-query/src/codegen/ibc/applications/interchain_accounts/host/v1/tx.amino.ts new file mode 100644 index 000000000..638601b21 --- /dev/null +++ b/packages/osmo-query/src/codegen/ibc/applications/interchain_accounts/host/v1/tx.amino.ts @@ -0,0 +1,9 @@ +//@ts-nocheck +import { MsgUpdateParams } from "./tx"; +export const AminoConverter = { + "/ibc.applications.interchain_accounts.host.v1.MsgUpdateParams": { + aminoType: "cosmos-sdk/MsgUpdateParams", + toAmino: MsgUpdateParams.toAmino, + fromAmino: MsgUpdateParams.fromAmino + } +}; \ No newline at end of file diff --git a/packages/osmo-query/src/codegen/ibc/applications/interchain_accounts/host/v1/tx.registry.ts b/packages/osmo-query/src/codegen/ibc/applications/interchain_accounts/host/v1/tx.registry.ts new file mode 100644 index 000000000..659bb9b24 --- /dev/null +++ b/packages/osmo-query/src/codegen/ibc/applications/interchain_accounts/host/v1/tx.registry.ts @@ -0,0 +1,35 @@ +//@ts-nocheck +import { GeneratedType, Registry } from "@cosmjs/proto-signing"; +import { MsgUpdateParams } from "./tx"; +export const registry: ReadonlyArray<[string, GeneratedType]> = [["/ibc.applications.interchain_accounts.host.v1.MsgUpdateParams", MsgUpdateParams]]; +export const load = (protoRegistry: Registry) => { + registry.forEach(([typeUrl, mod]) => { + protoRegistry.register(typeUrl, mod); + }); +}; +export const MessageComposer = { + encoded: { + updateParams(value: MsgUpdateParams) { + return { + typeUrl: "/ibc.applications.interchain_accounts.host.v1.MsgUpdateParams", + value: MsgUpdateParams.encode(value).finish() + }; + } + }, + withTypeUrl: { + updateParams(value: MsgUpdateParams) { + return { + typeUrl: "/ibc.applications.interchain_accounts.host.v1.MsgUpdateParams", + value + }; + } + }, + fromPartial: { + updateParams(value: MsgUpdateParams) { + return { + typeUrl: "/ibc.applications.interchain_accounts.host.v1.MsgUpdateParams", + value: MsgUpdateParams.fromPartial(value) + }; + } + } +}; \ No newline at end of file diff --git a/packages/osmo-query/src/codegen/ibc/applications/interchain_accounts/host/v1/tx.rpc.msg.ts b/packages/osmo-query/src/codegen/ibc/applications/interchain_accounts/host/v1/tx.rpc.msg.ts new file mode 100644 index 000000000..09e091f35 --- /dev/null +++ b/packages/osmo-query/src/codegen/ibc/applications/interchain_accounts/host/v1/tx.rpc.msg.ts @@ -0,0 +1,20 @@ +import { Rpc } from "../../../../../helpers"; +import { BinaryReader } from "../../../../../binary"; +import { MsgUpdateParams, MsgUpdateParamsResponse } from "./tx"; +/** Msg defines the 27-interchain-accounts/host Msg service. */ +export interface Msg { + /** UpdateParams defines a rpc handler for MsgUpdateParams. */ + updateParams(request: MsgUpdateParams): Promise; +} +export class MsgClientImpl implements Msg { + private readonly rpc: Rpc; + constructor(rpc: Rpc) { + this.rpc = rpc; + this.updateParams = this.updateParams.bind(this); + } + updateParams(request: MsgUpdateParams): Promise { + const data = MsgUpdateParams.encode(request).finish(); + const promise = this.rpc.request("ibc.applications.interchain_accounts.host.v1.Msg", "UpdateParams", data); + return promise.then(data => MsgUpdateParamsResponse.decode(new BinaryReader(data))); + } +} \ No newline at end of file diff --git a/packages/osmo-query/src/codegen/ibc/applications/interchain_accounts/host/v1/tx.ts b/packages/osmo-query/src/codegen/ibc/applications/interchain_accounts/host/v1/tx.ts new file mode 100644 index 000000000..82f9cee45 --- /dev/null +++ b/packages/osmo-query/src/codegen/ibc/applications/interchain_accounts/host/v1/tx.ts @@ -0,0 +1,188 @@ +import { Params, ParamsAmino, ParamsSDKType } from "./host"; +import { BinaryReader, BinaryWriter } from "../../../../../binary"; +/** MsgUpdateParams defines the payload for Msg/UpdateParams */ +export interface MsgUpdateParams { + /** signer address */ + signer: string; + /** + * params defines the 27-interchain-accounts/host parameters to update. + * + * NOTE: All parameters must be supplied. + */ + params: Params; +} +export interface MsgUpdateParamsProtoMsg { + typeUrl: "/ibc.applications.interchain_accounts.host.v1.MsgUpdateParams"; + value: Uint8Array; +} +/** MsgUpdateParams defines the payload for Msg/UpdateParams */ +export interface MsgUpdateParamsAmino { + /** signer address */ + signer?: string; + /** + * params defines the 27-interchain-accounts/host parameters to update. + * + * NOTE: All parameters must be supplied. + */ + params?: ParamsAmino; +} +export interface MsgUpdateParamsAminoMsg { + type: "cosmos-sdk/MsgUpdateParams"; + value: MsgUpdateParamsAmino; +} +/** MsgUpdateParams defines the payload for Msg/UpdateParams */ +export interface MsgUpdateParamsSDKType { + signer: string; + params: ParamsSDKType; +} +/** MsgUpdateParamsResponse defines the response for Msg/UpdateParams */ +export interface MsgUpdateParamsResponse {} +export interface MsgUpdateParamsResponseProtoMsg { + typeUrl: "/ibc.applications.interchain_accounts.host.v1.MsgUpdateParamsResponse"; + value: Uint8Array; +} +/** MsgUpdateParamsResponse defines the response for Msg/UpdateParams */ +export interface MsgUpdateParamsResponseAmino {} +export interface MsgUpdateParamsResponseAminoMsg { + type: "cosmos-sdk/MsgUpdateParamsResponse"; + value: MsgUpdateParamsResponseAmino; +} +/** MsgUpdateParamsResponse defines the response for Msg/UpdateParams */ +export interface MsgUpdateParamsResponseSDKType {} +function createBaseMsgUpdateParams(): MsgUpdateParams { + return { + signer: "", + params: Params.fromPartial({}) + }; +} +export const MsgUpdateParams = { + typeUrl: "/ibc.applications.interchain_accounts.host.v1.MsgUpdateParams", + encode(message: MsgUpdateParams, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.signer !== "") { + writer.uint32(10).string(message.signer); + } + if (message.params !== undefined) { + Params.encode(message.params, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgUpdateParams { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUpdateParams(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.signer = reader.string(); + break; + case 2: + message.params = Params.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgUpdateParams { + const message = createBaseMsgUpdateParams(); + message.signer = object.signer ?? ""; + message.params = object.params !== undefined && object.params !== null ? Params.fromPartial(object.params) : undefined; + return message; + }, + fromAmino(object: MsgUpdateParamsAmino): MsgUpdateParams { + const message = createBaseMsgUpdateParams(); + if (object.signer !== undefined && object.signer !== null) { + message.signer = object.signer; + } + if (object.params !== undefined && object.params !== null) { + message.params = Params.fromAmino(object.params); + } + return message; + }, + toAmino(message: MsgUpdateParams): MsgUpdateParamsAmino { + const obj: any = {}; + obj.signer = message.signer; + obj.params = message.params ? Params.toAmino(message.params) : undefined; + return obj; + }, + fromAminoMsg(object: MsgUpdateParamsAminoMsg): MsgUpdateParams { + return MsgUpdateParams.fromAmino(object.value); + }, + toAminoMsg(message: MsgUpdateParams): MsgUpdateParamsAminoMsg { + return { + type: "cosmos-sdk/MsgUpdateParams", + value: MsgUpdateParams.toAmino(message) + }; + }, + fromProtoMsg(message: MsgUpdateParamsProtoMsg): MsgUpdateParams { + return MsgUpdateParams.decode(message.value); + }, + toProto(message: MsgUpdateParams): Uint8Array { + return MsgUpdateParams.encode(message).finish(); + }, + toProtoMsg(message: MsgUpdateParams): MsgUpdateParamsProtoMsg { + return { + typeUrl: "/ibc.applications.interchain_accounts.host.v1.MsgUpdateParams", + value: MsgUpdateParams.encode(message).finish() + }; + } +}; +function createBaseMsgUpdateParamsResponse(): MsgUpdateParamsResponse { + return {}; +} +export const MsgUpdateParamsResponse = { + typeUrl: "/ibc.applications.interchain_accounts.host.v1.MsgUpdateParamsResponse", + encode(_: MsgUpdateParamsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgUpdateParamsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUpdateParamsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): MsgUpdateParamsResponse { + const message = createBaseMsgUpdateParamsResponse(); + return message; + }, + fromAmino(_: MsgUpdateParamsResponseAmino): MsgUpdateParamsResponse { + const message = createBaseMsgUpdateParamsResponse(); + return message; + }, + toAmino(_: MsgUpdateParamsResponse): MsgUpdateParamsResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgUpdateParamsResponseAminoMsg): MsgUpdateParamsResponse { + return MsgUpdateParamsResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgUpdateParamsResponse): MsgUpdateParamsResponseAminoMsg { + return { + type: "cosmos-sdk/MsgUpdateParamsResponse", + value: MsgUpdateParamsResponse.toAmino(message) + }; + }, + fromProtoMsg(message: MsgUpdateParamsResponseProtoMsg): MsgUpdateParamsResponse { + return MsgUpdateParamsResponse.decode(message.value); + }, + toProto(message: MsgUpdateParamsResponse): Uint8Array { + return MsgUpdateParamsResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgUpdateParamsResponse): MsgUpdateParamsResponseProtoMsg { + return { + typeUrl: "/ibc.applications.interchain_accounts.host.v1.MsgUpdateParamsResponse", + value: MsgUpdateParamsResponse.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/packages/osmo-query/src/codegen/ibc/applications/interchain_accounts/v1/account.ts b/packages/osmo-query/src/codegen/ibc/applications/interchain_accounts/v1/account.ts index 9ad94f144..9635ea14a 100644 --- a/packages/osmo-query/src/codegen/ibc/applications/interchain_accounts/v1/account.ts +++ b/packages/osmo-query/src/codegen/ibc/applications/interchain_accounts/v1/account.ts @@ -2,8 +2,8 @@ import { BaseAccount, BaseAccountAmino, BaseAccountSDKType } from "../../../../c import { BinaryReader, BinaryWriter } from "../../../../binary"; /** An InterchainAccount is defined as a BaseAccount & the address of the account owner on the controller chain */ export interface InterchainAccount { - $typeUrl?: string; - baseAccount: BaseAccount; + $typeUrl?: "/ibc.applications.interchain_accounts.v1.InterchainAccount"; + baseAccount?: BaseAccount; accountOwner: string; } export interface InterchainAccountProtoMsg { @@ -13,7 +13,7 @@ export interface InterchainAccountProtoMsg { /** An InterchainAccount is defined as a BaseAccount & the address of the account owner on the controller chain */ export interface InterchainAccountAmino { base_account?: BaseAccountAmino; - account_owner: string; + account_owner?: string; } export interface InterchainAccountAminoMsg { type: "cosmos-sdk/InterchainAccount"; @@ -21,14 +21,14 @@ export interface InterchainAccountAminoMsg { } /** An InterchainAccount is defined as a BaseAccount & the address of the account owner on the controller chain */ export interface InterchainAccountSDKType { - $typeUrl?: string; - base_account: BaseAccountSDKType; + $typeUrl?: "/ibc.applications.interchain_accounts.v1.InterchainAccount"; + base_account?: BaseAccountSDKType; account_owner: string; } function createBaseInterchainAccount(): InterchainAccount { return { $typeUrl: "/ibc.applications.interchain_accounts.v1.InterchainAccount", - baseAccount: BaseAccount.fromPartial({}), + baseAccount: undefined, accountOwner: "" }; } @@ -70,10 +70,14 @@ export const InterchainAccount = { return message; }, fromAmino(object: InterchainAccountAmino): InterchainAccount { - return { - baseAccount: object?.base_account ? BaseAccount.fromAmino(object.base_account) : undefined, - accountOwner: object.account_owner - }; + const message = createBaseInterchainAccount(); + if (object.base_account !== undefined && object.base_account !== null) { + message.baseAccount = BaseAccount.fromAmino(object.base_account); + } + if (object.account_owner !== undefined && object.account_owner !== null) { + message.accountOwner = object.account_owner; + } + return message; }, toAmino(message: InterchainAccount): InterchainAccountAmino { const obj: any = {}; diff --git a/packages/osmo-query/src/codegen/ibc/applications/interchain_accounts/v1/metadata.ts b/packages/osmo-query/src/codegen/ibc/applications/interchain_accounts/v1/metadata.ts index 9849975d7..60f73946e 100644 --- a/packages/osmo-query/src/codegen/ibc/applications/interchain_accounts/v1/metadata.ts +++ b/packages/osmo-query/src/codegen/ibc/applications/interchain_accounts/v1/metadata.ts @@ -30,20 +30,20 @@ export interface MetadataProtoMsg { */ export interface MetadataAmino { /** version defines the ICS27 protocol version */ - version: string; + version?: string; /** controller_connection_id is the connection identifier associated with the controller chain */ - controller_connection_id: string; + controller_connection_id?: string; /** host_connection_id is the connection identifier associated with the host chain */ - host_connection_id: string; + host_connection_id?: string; /** * address defines the interchain account address to be fulfilled upon the OnChanOpenTry handshake step * NOTE: the address field is empty on the OnChanOpenInit handshake step */ - address: string; + address?: string; /** encoding defines the supported codec format */ - encoding: string; + encoding?: string; /** tx_type defines the type of transactions the interchain account can execute */ - tx_type: string; + tx_type?: string; } export interface MetadataAminoMsg { type: "cosmos-sdk/Metadata"; @@ -137,14 +137,26 @@ export const Metadata = { return message; }, fromAmino(object: MetadataAmino): Metadata { - return { - version: object.version, - controllerConnectionId: object.controller_connection_id, - hostConnectionId: object.host_connection_id, - address: object.address, - encoding: object.encoding, - txType: object.tx_type - }; + const message = createBaseMetadata(); + if (object.version !== undefined && object.version !== null) { + message.version = object.version; + } + if (object.controller_connection_id !== undefined && object.controller_connection_id !== null) { + message.controllerConnectionId = object.controller_connection_id; + } + if (object.host_connection_id !== undefined && object.host_connection_id !== null) { + message.hostConnectionId = object.host_connection_id; + } + if (object.address !== undefined && object.address !== null) { + message.address = object.address; + } + if (object.encoding !== undefined && object.encoding !== null) { + message.encoding = object.encoding; + } + if (object.tx_type !== undefined && object.tx_type !== null) { + message.txType = object.tx_type; + } + return message; }, toAmino(message: Metadata): MetadataAmino { const obj: any = {}; diff --git a/packages/osmo-query/src/codegen/ibc/applications/interchain_accounts/v1/packet.ts b/packages/osmo-query/src/codegen/ibc/applications/interchain_accounts/v1/packet.ts index caef90e6a..b245f8897 100644 --- a/packages/osmo-query/src/codegen/ibc/applications/interchain_accounts/v1/packet.ts +++ b/packages/osmo-query/src/codegen/ibc/applications/interchain_accounts/v1/packet.ts @@ -1,6 +1,6 @@ import { Any, AnyAmino, AnySDKType } from "../../../../google/protobuf/any"; import { BinaryReader, BinaryWriter } from "../../../../binary"; -import { isSet } from "../../../../helpers"; +import { bytesFromBase64, base64FromBytes } from "../../../../helpers"; /** * Type defines a classification of message issued from a controller chain to its associated interchain accounts * host @@ -51,9 +51,9 @@ export interface InterchainAccountPacketDataProtoMsg { } /** InterchainAccountPacketData is comprised of a raw transaction, type of transaction and optional memo field. */ export interface InterchainAccountPacketDataAmino { - type: Type; - data: Uint8Array; - memo: string; + type?: Type; + data?: string; + memo?: string; } export interface InterchainAccountPacketDataAminoMsg { type: "cosmos-sdk/InterchainAccountPacketData"; @@ -75,7 +75,7 @@ export interface CosmosTxProtoMsg { } /** CosmosTx contains a list of sdk.Msg's. It should be used when sending transactions to an SDK host chain. */ export interface CosmosTxAmino { - messages: AnyAmino[]; + messages?: AnyAmino[]; } export interface CosmosTxAminoMsg { type: "cosmos-sdk/CosmosTx"; @@ -137,16 +137,22 @@ export const InterchainAccountPacketData = { return message; }, fromAmino(object: InterchainAccountPacketDataAmino): InterchainAccountPacketData { - return { - type: isSet(object.type) ? typeFromJSON(object.type) : -1, - data: object.data, - memo: object.memo - }; + const message = createBaseInterchainAccountPacketData(); + if (object.type !== undefined && object.type !== null) { + message.type = typeFromJSON(object.type); + } + if (object.data !== undefined && object.data !== null) { + message.data = bytesFromBase64(object.data); + } + if (object.memo !== undefined && object.memo !== null) { + message.memo = object.memo; + } + return message; }, toAmino(message: InterchainAccountPacketData): InterchainAccountPacketDataAmino { const obj: any = {}; - obj.type = message.type; - obj.data = message.data; + obj.type = typeToJSON(message.type); + obj.data = message.data ? base64FromBytes(message.data) : undefined; obj.memo = message.memo; return obj; }, @@ -208,9 +214,9 @@ export const CosmosTx = { return message; }, fromAmino(object: CosmosTxAmino): CosmosTx { - return { - messages: Array.isArray(object?.messages) ? object.messages.map((e: any) => Any.fromAmino(e)) : [] - }; + const message = createBaseCosmosTx(); + message.messages = object.messages?.map(e => Any.fromAmino(e)) || []; + return message; }, toAmino(message: CosmosTx): CosmosTxAmino { const obj: any = {}; diff --git a/packages/osmo-query/src/codegen/ibc/applications/transfer/v1/authz.ts b/packages/osmo-query/src/codegen/ibc/applications/transfer/v1/authz.ts index 9f6c3ce47..0c3589fc2 100644 --- a/packages/osmo-query/src/codegen/ibc/applications/transfer/v1/authz.ts +++ b/packages/osmo-query/src/codegen/ibc/applications/transfer/v1/authz.ts @@ -10,6 +10,11 @@ export interface Allocation { spendLimit: Coin[]; /** allow list of receivers, an empty allow list permits any receiver address */ allowList: string[]; + /** + * allow list of packet data keys, an empty list prohibits all packet data keys; + * a list only with "*" permits any packet data key + */ + allowedPacketData: string[]; } export interface AllocationProtoMsg { typeUrl: "/ibc.applications.transfer.v1.Allocation"; @@ -18,13 +23,18 @@ export interface AllocationProtoMsg { /** Allocation defines the spend limit for a particular port and channel */ export interface AllocationAmino { /** the port on which the packet will be sent */ - source_port: string; + source_port?: string; /** the channel by which the packet will be sent */ - source_channel: string; + source_channel?: string; /** spend limitation on the channel */ - spend_limit: CoinAmino[]; + spend_limit?: CoinAmino[]; /** allow list of receivers, an empty allow list permits any receiver address */ - allow_list: string[]; + allow_list?: string[]; + /** + * allow list of packet data keys, an empty list prohibits all packet data keys; + * a list only with "*" permits any packet data key + */ + allowed_packet_data?: string[]; } export interface AllocationAminoMsg { type: "cosmos-sdk/Allocation"; @@ -36,13 +46,14 @@ export interface AllocationSDKType { source_channel: string; spend_limit: CoinSDKType[]; allow_list: string[]; + allowed_packet_data: string[]; } /** * TransferAuthorization allows the grantee to spend up to spend_limit coins from * the granter's account for ibc transfer on a specific channel */ export interface TransferAuthorization { - $typeUrl?: string; + $typeUrl?: "/ibc.applications.transfer.v1.TransferAuthorization"; /** port and channel amounts */ allocations: Allocation[]; } @@ -56,7 +67,7 @@ export interface TransferAuthorizationProtoMsg { */ export interface TransferAuthorizationAmino { /** port and channel amounts */ - allocations: AllocationAmino[]; + allocations?: AllocationAmino[]; } export interface TransferAuthorizationAminoMsg { type: "cosmos-sdk/TransferAuthorization"; @@ -67,7 +78,7 @@ export interface TransferAuthorizationAminoMsg { * the granter's account for ibc transfer on a specific channel */ export interface TransferAuthorizationSDKType { - $typeUrl?: string; + $typeUrl?: "/ibc.applications.transfer.v1.TransferAuthorization"; allocations: AllocationSDKType[]; } function createBaseAllocation(): Allocation { @@ -75,7 +86,8 @@ function createBaseAllocation(): Allocation { sourcePort: "", sourceChannel: "", spendLimit: [], - allowList: [] + allowList: [], + allowedPacketData: [] }; } export const Allocation = { @@ -93,6 +105,9 @@ export const Allocation = { for (const v of message.allowList) { writer.uint32(34).string(v!); } + for (const v of message.allowedPacketData) { + writer.uint32(42).string(v!); + } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): Allocation { @@ -114,6 +129,9 @@ export const Allocation = { case 4: message.allowList.push(reader.string()); break; + case 5: + message.allowedPacketData.push(reader.string()); + break; default: reader.skipType(tag & 7); break; @@ -127,15 +145,21 @@ export const Allocation = { message.sourceChannel = object.sourceChannel ?? ""; message.spendLimit = object.spendLimit?.map(e => Coin.fromPartial(e)) || []; message.allowList = object.allowList?.map(e => e) || []; + message.allowedPacketData = object.allowedPacketData?.map(e => e) || []; return message; }, fromAmino(object: AllocationAmino): Allocation { - return { - sourcePort: object.source_port, - sourceChannel: object.source_channel, - spendLimit: Array.isArray(object?.spend_limit) ? object.spend_limit.map((e: any) => Coin.fromAmino(e)) : [], - allowList: Array.isArray(object?.allow_list) ? object.allow_list.map((e: any) => e) : [] - }; + const message = createBaseAllocation(); + if (object.source_port !== undefined && object.source_port !== null) { + message.sourcePort = object.source_port; + } + if (object.source_channel !== undefined && object.source_channel !== null) { + message.sourceChannel = object.source_channel; + } + message.spendLimit = object.spend_limit?.map(e => Coin.fromAmino(e)) || []; + message.allowList = object.allow_list?.map(e => e) || []; + message.allowedPacketData = object.allowed_packet_data?.map(e => e) || []; + return message; }, toAmino(message: Allocation): AllocationAmino { const obj: any = {}; @@ -151,6 +175,11 @@ export const Allocation = { } else { obj.allow_list = []; } + if (message.allowedPacketData) { + obj.allowed_packet_data = message.allowedPacketData.map(e => e); + } else { + obj.allowed_packet_data = []; + } return obj; }, fromAminoMsg(object: AllocationAminoMsg): Allocation { @@ -212,9 +241,9 @@ export const TransferAuthorization = { return message; }, fromAmino(object: TransferAuthorizationAmino): TransferAuthorization { - return { - allocations: Array.isArray(object?.allocations) ? object.allocations.map((e: any) => Allocation.fromAmino(e)) : [] - }; + const message = createBaseTransferAuthorization(); + message.allocations = object.allocations?.map(e => Allocation.fromAmino(e)) || []; + return message; }, toAmino(message: TransferAuthorization): TransferAuthorizationAmino { const obj: any = {}; diff --git a/packages/osmo-query/src/codegen/ibc/applications/transfer/v1/genesis.ts b/packages/osmo-query/src/codegen/ibc/applications/transfer/v1/genesis.ts index 087006140..d7d0375d8 100644 --- a/packages/osmo-query/src/codegen/ibc/applications/transfer/v1/genesis.ts +++ b/packages/osmo-query/src/codegen/ibc/applications/transfer/v1/genesis.ts @@ -1,10 +1,16 @@ import { DenomTrace, DenomTraceAmino, DenomTraceSDKType, Params, ParamsAmino, ParamsSDKType } from "./transfer"; +import { Coin, CoinAmino, CoinSDKType } from "../../../../cosmos/base/v1beta1/coin"; import { BinaryReader, BinaryWriter } from "../../../../binary"; /** GenesisState defines the ibc-transfer genesis state */ export interface GenesisState { portId: string; denomTraces: DenomTrace[]; params: Params; + /** + * total_escrowed contains the total amount of tokens escrowed + * by the transfer module + */ + totalEscrowed: Coin[]; } export interface GenesisStateProtoMsg { typeUrl: "/ibc.applications.transfer.v1.GenesisState"; @@ -12,9 +18,14 @@ export interface GenesisStateProtoMsg { } /** GenesisState defines the ibc-transfer genesis state */ export interface GenesisStateAmino { - port_id: string; - denom_traces: DenomTraceAmino[]; + port_id?: string; + denom_traces?: DenomTraceAmino[]; params?: ParamsAmino; + /** + * total_escrowed contains the total amount of tokens escrowed + * by the transfer module + */ + total_escrowed?: CoinAmino[]; } export interface GenesisStateAminoMsg { type: "cosmos-sdk/GenesisState"; @@ -25,12 +36,14 @@ export interface GenesisStateSDKType { port_id: string; denom_traces: DenomTraceSDKType[]; params: ParamsSDKType; + total_escrowed: CoinSDKType[]; } function createBaseGenesisState(): GenesisState { return { portId: "", denomTraces: [], - params: Params.fromPartial({}) + params: Params.fromPartial({}), + totalEscrowed: [] }; } export const GenesisState = { @@ -45,6 +58,9 @@ export const GenesisState = { if (message.params !== undefined) { Params.encode(message.params, writer.uint32(26).fork()).ldelim(); } + for (const v of message.totalEscrowed) { + Coin.encode(v!, writer.uint32(34).fork()).ldelim(); + } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): GenesisState { @@ -63,6 +79,9 @@ export const GenesisState = { case 3: message.params = Params.decode(reader, reader.uint32()); break; + case 4: + message.totalEscrowed.push(Coin.decode(reader, reader.uint32())); + break; default: reader.skipType(tag & 7); break; @@ -75,14 +94,20 @@ export const GenesisState = { message.portId = object.portId ?? ""; message.denomTraces = object.denomTraces?.map(e => DenomTrace.fromPartial(e)) || []; message.params = object.params !== undefined && object.params !== null ? Params.fromPartial(object.params) : undefined; + message.totalEscrowed = object.totalEscrowed?.map(e => Coin.fromPartial(e)) || []; return message; }, fromAmino(object: GenesisStateAmino): GenesisState { - return { - portId: object.port_id, - denomTraces: Array.isArray(object?.denom_traces) ? object.denom_traces.map((e: any) => DenomTrace.fromAmino(e)) : [], - params: object?.params ? Params.fromAmino(object.params) : undefined - }; + const message = createBaseGenesisState(); + if (object.port_id !== undefined && object.port_id !== null) { + message.portId = object.port_id; + } + message.denomTraces = object.denom_traces?.map(e => DenomTrace.fromAmino(e)) || []; + if (object.params !== undefined && object.params !== null) { + message.params = Params.fromAmino(object.params); + } + message.totalEscrowed = object.total_escrowed?.map(e => Coin.fromAmino(e)) || []; + return message; }, toAmino(message: GenesisState): GenesisStateAmino { const obj: any = {}; @@ -93,6 +118,11 @@ export const GenesisState = { obj.denom_traces = []; } obj.params = message.params ? Params.toAmino(message.params) : undefined; + if (message.totalEscrowed) { + obj.total_escrowed = message.totalEscrowed.map(e => e ? Coin.toAmino(e) : undefined); + } else { + obj.total_escrowed = []; + } return obj; }, fromAminoMsg(object: GenesisStateAminoMsg): GenesisState { diff --git a/packages/osmo-query/src/codegen/ibc/applications/transfer/v1/query.lcd.ts b/packages/osmo-query/src/codegen/ibc/applications/transfer/v1/query.lcd.ts index e5c67d3fc..28cf41a68 100644 --- a/packages/osmo-query/src/codegen/ibc/applications/transfer/v1/query.lcd.ts +++ b/packages/osmo-query/src/codegen/ibc/applications/transfer/v1/query.lcd.ts @@ -1,6 +1,6 @@ import { setPaginationParams } from "../../../../helpers"; import { LCDClient } from "@cosmology/lcd"; -import { QueryDenomTraceRequest, QueryDenomTraceResponseSDKType, QueryDenomTracesRequest, QueryDenomTracesResponseSDKType, QueryParamsRequest, QueryParamsResponseSDKType, QueryDenomHashRequest, QueryDenomHashResponseSDKType, QueryEscrowAddressRequest, QueryEscrowAddressResponseSDKType } from "./query"; +import { QueryDenomTracesRequest, QueryDenomTracesResponseSDKType, QueryDenomTraceRequest, QueryDenomTraceResponseSDKType, QueryParamsRequest, QueryParamsResponseSDKType, QueryDenomHashRequest, QueryDenomHashResponseSDKType, QueryEscrowAddressRequest, QueryEscrowAddressResponseSDKType, QueryTotalEscrowForDenomRequest, QueryTotalEscrowForDenomResponseSDKType } from "./query"; export class LCDQueryClient { req: LCDClient; constructor({ @@ -9,22 +9,12 @@ export class LCDQueryClient { requestClient: LCDClient; }) { this.req = requestClient; - this.denomTrace = this.denomTrace.bind(this); this.denomTraces = this.denomTraces.bind(this); + this.denomTrace = this.denomTrace.bind(this); this.params = this.params.bind(this); this.denomHash = this.denomHash.bind(this); this.escrowAddress = this.escrowAddress.bind(this); - } - /* DenomTrace queries a denomination trace information. */ - async denomTrace(params: QueryDenomTraceRequest): Promise { - const options: any = { - params: {} - }; - if (typeof params?.hash !== "undefined") { - options.params.hash = params.hash; - } - const endpoint = `ibc/apps/transfer/v1/denom_traces/${params.hash}`; - return await this.req.get(endpoint, options); + this.totalEscrowForDenom = this.totalEscrowForDenom.bind(this); } /* DenomTraces queries all denomination traces. */ async denomTraces(params: QueryDenomTracesRequest = { @@ -39,6 +29,17 @@ export class LCDQueryClient { const endpoint = `ibc/apps/transfer/v1/denom_traces`; return await this.req.get(endpoint, options); } + /* DenomTrace queries a denomination trace information. */ + async denomTrace(params: QueryDenomTraceRequest): Promise { + const options: any = { + params: {} + }; + if (typeof params?.hash !== "undefined") { + options.params.hash = params.hash; + } + const endpoint = `ibc/apps/transfer/v1/denom_traces/${params.hash}`; + return await this.req.get(endpoint, options); + } /* Params queries all parameters of the ibc-transfer module. */ async params(_params: QueryParamsRequest = {}): Promise { const endpoint = `ibc/apps/transfer/v1/params`; @@ -60,4 +61,15 @@ export class LCDQueryClient { const endpoint = `ibc/apps/transfer/v1/channels/${params.channelId}/ports/${params.portId}/escrow_address`; return await this.req.get(endpoint); } + /* TotalEscrowForDenom returns the total amount of tokens in escrow based on the denom. */ + async totalEscrowForDenom(params: QueryTotalEscrowForDenomRequest): Promise { + const options: any = { + params: {} + }; + if (typeof params?.denom !== "undefined") { + options.params.denom = params.denom; + } + const endpoint = `ibc/apps/transfer/v1/denoms/${params.denom}/total_escrow`; + return await this.req.get(endpoint, options); + } } \ No newline at end of file diff --git a/packages/osmo-query/src/codegen/ibc/applications/transfer/v1/query.rpc.Query.ts b/packages/osmo-query/src/codegen/ibc/applications/transfer/v1/query.rpc.Query.ts index e3ca86fb1..40b60024d 100644 --- a/packages/osmo-query/src/codegen/ibc/applications/transfer/v1/query.rpc.Query.ts +++ b/packages/osmo-query/src/codegen/ibc/applications/transfer/v1/query.rpc.Query.ts @@ -3,34 +3,32 @@ import { BinaryReader } from "../../../../binary"; import { QueryClient, createProtobufRpcClient, ProtobufRpcClient } from "@cosmjs/stargate"; import { ReactQueryParams } from "../../../../react-query"; import { useQuery } from "@tanstack/react-query"; -import { QueryDenomTraceRequest, QueryDenomTraceResponse, QueryDenomTracesRequest, QueryDenomTracesResponse, QueryParamsRequest, QueryParamsResponse, QueryDenomHashRequest, QueryDenomHashResponse, QueryEscrowAddressRequest, QueryEscrowAddressResponse } from "./query"; +import { QueryDenomTracesRequest, QueryDenomTracesResponse, QueryDenomTraceRequest, QueryDenomTraceResponse, QueryParamsRequest, QueryParamsResponse, QueryDenomHashRequest, QueryDenomHashResponse, QueryEscrowAddressRequest, QueryEscrowAddressResponse, QueryTotalEscrowForDenomRequest, QueryTotalEscrowForDenomResponse } from "./query"; /** Query provides defines the gRPC querier service. */ export interface Query { - /** DenomTrace queries a denomination trace information. */ - denomTrace(request: QueryDenomTraceRequest): Promise; /** DenomTraces queries all denomination traces. */ denomTraces(request?: QueryDenomTracesRequest): Promise; + /** DenomTrace queries a denomination trace information. */ + denomTrace(request: QueryDenomTraceRequest): Promise; /** Params queries all parameters of the ibc-transfer module. */ params(request?: QueryParamsRequest): Promise; /** DenomHash queries a denomination hash information. */ denomHash(request: QueryDenomHashRequest): Promise; /** EscrowAddress returns the escrow address for a particular port and channel id. */ escrowAddress(request: QueryEscrowAddressRequest): Promise; + /** TotalEscrowForDenom returns the total amount of tokens in escrow based on the denom. */ + totalEscrowForDenom(request: QueryTotalEscrowForDenomRequest): Promise; } export class QueryClientImpl implements Query { private readonly rpc: Rpc; constructor(rpc: Rpc) { this.rpc = rpc; - this.denomTrace = this.denomTrace.bind(this); this.denomTraces = this.denomTraces.bind(this); + this.denomTrace = this.denomTrace.bind(this); this.params = this.params.bind(this); this.denomHash = this.denomHash.bind(this); this.escrowAddress = this.escrowAddress.bind(this); - } - denomTrace(request: QueryDenomTraceRequest): Promise { - const data = QueryDenomTraceRequest.encode(request).finish(); - const promise = this.rpc.request("ibc.applications.transfer.v1.Query", "DenomTrace", data); - return promise.then(data => QueryDenomTraceResponse.decode(new BinaryReader(data))); + this.totalEscrowForDenom = this.totalEscrowForDenom.bind(this); } denomTraces(request: QueryDenomTracesRequest = { pagination: undefined @@ -39,6 +37,11 @@ export class QueryClientImpl implements Query { const promise = this.rpc.request("ibc.applications.transfer.v1.Query", "DenomTraces", data); return promise.then(data => QueryDenomTracesResponse.decode(new BinaryReader(data))); } + denomTrace(request: QueryDenomTraceRequest): Promise { + const data = QueryDenomTraceRequest.encode(request).finish(); + const promise = this.rpc.request("ibc.applications.transfer.v1.Query", "DenomTrace", data); + return promise.then(data => QueryDenomTraceResponse.decode(new BinaryReader(data))); + } params(request: QueryParamsRequest = {}): Promise { const data = QueryParamsRequest.encode(request).finish(); const promise = this.rpc.request("ibc.applications.transfer.v1.Query", "Params", data); @@ -54,17 +57,22 @@ export class QueryClientImpl implements Query { const promise = this.rpc.request("ibc.applications.transfer.v1.Query", "EscrowAddress", data); return promise.then(data => QueryEscrowAddressResponse.decode(new BinaryReader(data))); } + totalEscrowForDenom(request: QueryTotalEscrowForDenomRequest): Promise { + const data = QueryTotalEscrowForDenomRequest.encode(request).finish(); + const promise = this.rpc.request("ibc.applications.transfer.v1.Query", "TotalEscrowForDenom", data); + return promise.then(data => QueryTotalEscrowForDenomResponse.decode(new BinaryReader(data))); + } } export const createRpcQueryExtension = (base: QueryClient) => { const rpc = createProtobufRpcClient(base); const queryService = new QueryClientImpl(rpc); return { - denomTrace(request: QueryDenomTraceRequest): Promise { - return queryService.denomTrace(request); - }, denomTraces(request?: QueryDenomTracesRequest): Promise { return queryService.denomTraces(request); }, + denomTrace(request: QueryDenomTraceRequest): Promise { + return queryService.denomTrace(request); + }, params(request?: QueryParamsRequest): Promise { return queryService.params(request); }, @@ -73,15 +81,18 @@ export const createRpcQueryExtension = (base: QueryClient) => { }, escrowAddress(request: QueryEscrowAddressRequest): Promise { return queryService.escrowAddress(request); + }, + totalEscrowForDenom(request: QueryTotalEscrowForDenomRequest): Promise { + return queryService.totalEscrowForDenom(request); } }; }; -export interface UseDenomTraceQuery extends ReactQueryParams { - request: QueryDenomTraceRequest; -} export interface UseDenomTracesQuery extends ReactQueryParams { request?: QueryDenomTracesRequest; } +export interface UseDenomTraceQuery extends ReactQueryParams { + request: QueryDenomTraceRequest; +} export interface UseParamsQuery extends ReactQueryParams { request?: QueryParamsRequest; } @@ -91,6 +102,9 @@ export interface UseDenomHashQuery extends ReactQueryParams extends ReactQueryParams { request: QueryEscrowAddressRequest; } +export interface UseTotalEscrowForDenomQuery extends ReactQueryParams { + request: QueryTotalEscrowForDenomRequest; +} const _queryClients: WeakMap = new WeakMap(); const getQueryService = (rpc: ProtobufRpcClient | undefined): QueryClientImpl | undefined => { if (!rpc) return; @@ -103,22 +117,22 @@ const getQueryService = (rpc: ProtobufRpcClient | undefined): QueryClientImpl | }; export const createRpcQueryHooks = (rpc: ProtobufRpcClient | undefined) => { const queryService = getQueryService(rpc); - const useDenomTrace = ({ + const useDenomTraces = ({ request, options - }: UseDenomTraceQuery) => { - return useQuery(["denomTraceQuery", request], () => { + }: UseDenomTracesQuery) => { + return useQuery(["denomTracesQuery", request], () => { if (!queryService) throw new Error("Query Service not initialized"); - return queryService.denomTrace(request); + return queryService.denomTraces(request); }, options); }; - const useDenomTraces = ({ + const useDenomTrace = ({ request, options - }: UseDenomTracesQuery) => { - return useQuery(["denomTracesQuery", request], () => { + }: UseDenomTraceQuery) => { + return useQuery(["denomTraceQuery", request], () => { if (!queryService) throw new Error("Query Service not initialized"); - return queryService.denomTraces(request); + return queryService.denomTrace(request); }, options); }; const useParams = ({ @@ -148,11 +162,21 @@ export const createRpcQueryHooks = (rpc: ProtobufRpcClient | undefined) => { return queryService.escrowAddress(request); }, options); }; + const useTotalEscrowForDenom = ({ + request, + options + }: UseTotalEscrowForDenomQuery) => { + return useQuery(["totalEscrowForDenomQuery", request], () => { + if (!queryService) throw new Error("Query Service not initialized"); + return queryService.totalEscrowForDenom(request); + }, options); + }; return { - /** DenomTrace queries a denomination trace information. */useDenomTrace, /** DenomTraces queries all denomination traces. */useDenomTraces, + /** DenomTrace queries a denomination trace information. */useDenomTrace, /** Params queries all parameters of the ibc-transfer module. */useParams, /** DenomHash queries a denomination hash information. */useDenomHash, - /** EscrowAddress returns the escrow address for a particular port and channel id. */useEscrowAddress + /** EscrowAddress returns the escrow address for a particular port and channel id. */useEscrowAddress, + /** TotalEscrowForDenom returns the total amount of tokens in escrow based on the denom. */useTotalEscrowForDenom }; }; \ No newline at end of file diff --git a/packages/osmo-query/src/codegen/ibc/applications/transfer/v1/query.ts b/packages/osmo-query/src/codegen/ibc/applications/transfer/v1/query.ts index 4f6510614..de9aef602 100644 --- a/packages/osmo-query/src/codegen/ibc/applications/transfer/v1/query.ts +++ b/packages/osmo-query/src/codegen/ibc/applications/transfer/v1/query.ts @@ -1,5 +1,6 @@ import { PageRequest, PageRequestAmino, PageRequestSDKType, PageResponse, PageResponseAmino, PageResponseSDKType } from "../../../../cosmos/base/query/v1beta1/pagination"; import { DenomTrace, DenomTraceAmino, DenomTraceSDKType, Params, ParamsAmino, ParamsSDKType } from "./transfer"; +import { Coin, CoinAmino, CoinSDKType } from "../../../../cosmos/base/v1beta1/coin"; import { BinaryReader, BinaryWriter } from "../../../../binary"; /** * QueryDenomTraceRequest is the request type for the Query/DenomTrace RPC @@ -19,7 +20,7 @@ export interface QueryDenomTraceRequestProtoMsg { */ export interface QueryDenomTraceRequestAmino { /** hash (in hex format) or denom (full denom with ibc prefix) of the denomination trace information. */ - hash: string; + hash?: string; } export interface QueryDenomTraceRequestAminoMsg { type: "cosmos-sdk/QueryDenomTraceRequest"; @@ -38,7 +39,7 @@ export interface QueryDenomTraceRequestSDKType { */ export interface QueryDenomTraceResponse { /** denom_trace returns the requested denomination trace information. */ - denomTrace: DenomTrace; + denomTrace?: DenomTrace; } export interface QueryDenomTraceResponseProtoMsg { typeUrl: "/ibc.applications.transfer.v1.QueryDenomTraceResponse"; @@ -61,7 +62,7 @@ export interface QueryDenomTraceResponseAminoMsg { * method. */ export interface QueryDenomTraceResponseSDKType { - denom_trace: DenomTraceSDKType; + denom_trace?: DenomTraceSDKType; } /** * QueryConnectionsRequest is the request type for the Query/DenomTraces RPC @@ -69,7 +70,7 @@ export interface QueryDenomTraceResponseSDKType { */ export interface QueryDenomTracesRequest { /** pagination defines an optional pagination for the request. */ - pagination: PageRequest; + pagination?: PageRequest; } export interface QueryDenomTracesRequestProtoMsg { typeUrl: "/ibc.applications.transfer.v1.QueryDenomTracesRequest"; @@ -92,7 +93,7 @@ export interface QueryDenomTracesRequestAminoMsg { * method */ export interface QueryDenomTracesRequestSDKType { - pagination: PageRequestSDKType; + pagination?: PageRequestSDKType; } /** * QueryConnectionsResponse is the response type for the Query/DenomTraces RPC @@ -102,7 +103,7 @@ export interface QueryDenomTracesResponse { /** denom_traces returns all denominations trace information. */ denomTraces: DenomTrace[]; /** pagination defines the pagination in the response. */ - pagination: PageResponse; + pagination?: PageResponse; } export interface QueryDenomTracesResponseProtoMsg { typeUrl: "/ibc.applications.transfer.v1.QueryDenomTracesResponse"; @@ -114,7 +115,7 @@ export interface QueryDenomTracesResponseProtoMsg { */ export interface QueryDenomTracesResponseAmino { /** denom_traces returns all denominations trace information. */ - denom_traces: DenomTraceAmino[]; + denom_traces?: DenomTraceAmino[]; /** pagination defines the pagination in the response. */ pagination?: PageResponseAmino; } @@ -128,7 +129,7 @@ export interface QueryDenomTracesResponseAminoMsg { */ export interface QueryDenomTracesResponseSDKType { denom_traces: DenomTraceSDKType[]; - pagination: PageResponseSDKType; + pagination?: PageResponseSDKType; } /** QueryParamsRequest is the request type for the Query/Params RPC method. */ export interface QueryParamsRequest {} @@ -147,7 +148,7 @@ export interface QueryParamsRequestSDKType {} /** 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; } export interface QueryParamsResponseProtoMsg { typeUrl: "/ibc.applications.transfer.v1.QueryParamsResponse"; @@ -164,7 +165,7 @@ export interface QueryParamsResponseAminoMsg { } /** QueryParamsResponse is the response type for the Query/Params RPC method. */ export interface QueryParamsResponseSDKType { - params: ParamsSDKType; + params?: ParamsSDKType; } /** * QueryDenomHashRequest is the request type for the Query/DenomHash RPC @@ -184,7 +185,7 @@ export interface QueryDenomHashRequestProtoMsg { */ export interface QueryDenomHashRequestAmino { /** The denomination trace ([port_id]/[channel_id])+/[denom] */ - trace: string; + trace?: string; } export interface QueryDenomHashRequestAminoMsg { type: "cosmos-sdk/QueryDenomHashRequest"; @@ -215,7 +216,7 @@ export interface QueryDenomHashResponseProtoMsg { */ export interface QueryDenomHashResponseAmino { /** hash (in hex format) of the denomination trace information. */ - hash: string; + hash?: string; } export interface QueryDenomHashResponseAminoMsg { type: "cosmos-sdk/QueryDenomHashResponse"; @@ -242,9 +243,9 @@ export interface QueryEscrowAddressRequestProtoMsg { /** QueryEscrowAddressRequest is the request type for the EscrowAddress RPC method. */ export interface QueryEscrowAddressRequestAmino { /** unique port identifier */ - port_id: string; + port_id?: string; /** unique channel identifier */ - channel_id: string; + channel_id?: string; } export interface QueryEscrowAddressRequestAminoMsg { type: "cosmos-sdk/QueryEscrowAddressRequest"; @@ -267,7 +268,7 @@ export interface QueryEscrowAddressResponseProtoMsg { /** QueryEscrowAddressResponse is the response type of the EscrowAddress RPC method. */ export interface QueryEscrowAddressResponseAmino { /** the escrow account address */ - escrow_address: string; + escrow_address?: string; } export interface QueryEscrowAddressResponseAminoMsg { type: "cosmos-sdk/QueryEscrowAddressResponse"; @@ -277,6 +278,46 @@ export interface QueryEscrowAddressResponseAminoMsg { export interface QueryEscrowAddressResponseSDKType { escrow_address: string; } +/** QueryTotalEscrowForDenomRequest is the request type for TotalEscrowForDenom RPC method. */ +export interface QueryTotalEscrowForDenomRequest { + denom: string; +} +export interface QueryTotalEscrowForDenomRequestProtoMsg { + typeUrl: "/ibc.applications.transfer.v1.QueryTotalEscrowForDenomRequest"; + value: Uint8Array; +} +/** QueryTotalEscrowForDenomRequest is the request type for TotalEscrowForDenom RPC method. */ +export interface QueryTotalEscrowForDenomRequestAmino { + denom?: string; +} +export interface QueryTotalEscrowForDenomRequestAminoMsg { + type: "cosmos-sdk/QueryTotalEscrowForDenomRequest"; + value: QueryTotalEscrowForDenomRequestAmino; +} +/** QueryTotalEscrowForDenomRequest is the request type for TotalEscrowForDenom RPC method. */ +export interface QueryTotalEscrowForDenomRequestSDKType { + denom: string; +} +/** QueryTotalEscrowForDenomResponse is the response type for TotalEscrowForDenom RPC method. */ +export interface QueryTotalEscrowForDenomResponse { + amount: Coin; +} +export interface QueryTotalEscrowForDenomResponseProtoMsg { + typeUrl: "/ibc.applications.transfer.v1.QueryTotalEscrowForDenomResponse"; + value: Uint8Array; +} +/** QueryTotalEscrowForDenomResponse is the response type for TotalEscrowForDenom RPC method. */ +export interface QueryTotalEscrowForDenomResponseAmino { + amount?: CoinAmino; +} +export interface QueryTotalEscrowForDenomResponseAminoMsg { + type: "cosmos-sdk/QueryTotalEscrowForDenomResponse"; + value: QueryTotalEscrowForDenomResponseAmino; +} +/** QueryTotalEscrowForDenomResponse is the response type for TotalEscrowForDenom RPC method. */ +export interface QueryTotalEscrowForDenomResponseSDKType { + amount: CoinSDKType; +} function createBaseQueryDenomTraceRequest(): QueryDenomTraceRequest { return { hash: "" @@ -313,9 +354,11 @@ export const QueryDenomTraceRequest = { return message; }, fromAmino(object: QueryDenomTraceRequestAmino): QueryDenomTraceRequest { - return { - hash: object.hash - }; + const message = createBaseQueryDenomTraceRequest(); + if (object.hash !== undefined && object.hash !== null) { + message.hash = object.hash; + } + return message; }, toAmino(message: QueryDenomTraceRequest): QueryDenomTraceRequestAmino { const obj: any = {}; @@ -346,7 +389,7 @@ export const QueryDenomTraceRequest = { }; function createBaseQueryDenomTraceResponse(): QueryDenomTraceResponse { return { - denomTrace: DenomTrace.fromPartial({}) + denomTrace: undefined }; } export const QueryDenomTraceResponse = { @@ -380,9 +423,11 @@ export const QueryDenomTraceResponse = { return message; }, fromAmino(object: QueryDenomTraceResponseAmino): QueryDenomTraceResponse { - return { - denomTrace: object?.denom_trace ? DenomTrace.fromAmino(object.denom_trace) : undefined - }; + const message = createBaseQueryDenomTraceResponse(); + if (object.denom_trace !== undefined && object.denom_trace !== null) { + message.denomTrace = DenomTrace.fromAmino(object.denom_trace); + } + return message; }, toAmino(message: QueryDenomTraceResponse): QueryDenomTraceResponseAmino { const obj: any = {}; @@ -413,7 +458,7 @@ export const QueryDenomTraceResponse = { }; function createBaseQueryDenomTracesRequest(): QueryDenomTracesRequest { return { - pagination: PageRequest.fromPartial({}) + pagination: undefined }; } export const QueryDenomTracesRequest = { @@ -447,9 +492,11 @@ export const QueryDenomTracesRequest = { return message; }, fromAmino(object: QueryDenomTracesRequestAmino): QueryDenomTracesRequest { - return { - pagination: object?.pagination ? PageRequest.fromAmino(object.pagination) : undefined - }; + const message = createBaseQueryDenomTracesRequest(); + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromAmino(object.pagination); + } + return message; }, toAmino(message: QueryDenomTracesRequest): QueryDenomTracesRequestAmino { const obj: any = {}; @@ -481,7 +528,7 @@ export const QueryDenomTracesRequest = { function createBaseQueryDenomTracesResponse(): QueryDenomTracesResponse { return { denomTraces: [], - pagination: PageResponse.fromPartial({}) + pagination: undefined }; } export const QueryDenomTracesResponse = { @@ -522,10 +569,12 @@ export const QueryDenomTracesResponse = { return message; }, fromAmino(object: QueryDenomTracesResponseAmino): QueryDenomTracesResponse { - return { - denomTraces: Array.isArray(object?.denom_traces) ? object.denom_traces.map((e: any) => DenomTrace.fromAmino(e)) : [], - pagination: object?.pagination ? PageResponse.fromAmino(object.pagination) : undefined - }; + const message = createBaseQueryDenomTracesResponse(); + message.denomTraces = object.denom_traces?.map(e => DenomTrace.fromAmino(e)) || []; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromAmino(object.pagination); + } + return message; }, toAmino(message: QueryDenomTracesResponse): QueryDenomTracesResponseAmino { const obj: any = {}; @@ -586,7 +635,8 @@ export const QueryParamsRequest = { return message; }, fromAmino(_: QueryParamsRequestAmino): QueryParamsRequest { - return {}; + const message = createBaseQueryParamsRequest(); + return message; }, toAmino(_: QueryParamsRequest): QueryParamsRequestAmino { const obj: any = {}; @@ -616,7 +666,7 @@ export const QueryParamsRequest = { }; function createBaseQueryParamsResponse(): QueryParamsResponse { return { - params: Params.fromPartial({}) + params: undefined }; } export const QueryParamsResponse = { @@ -650,9 +700,11 @@ export const QueryParamsResponse = { return message; }, fromAmino(object: QueryParamsResponseAmino): QueryParamsResponse { - return { - params: object?.params ? Params.fromAmino(object.params) : undefined - }; + const message = createBaseQueryParamsResponse(); + if (object.params !== undefined && object.params !== null) { + message.params = Params.fromAmino(object.params); + } + return message; }, toAmino(message: QueryParamsResponse): QueryParamsResponseAmino { const obj: any = {}; @@ -717,9 +769,11 @@ export const QueryDenomHashRequest = { return message; }, fromAmino(object: QueryDenomHashRequestAmino): QueryDenomHashRequest { - return { - trace: object.trace - }; + const message = createBaseQueryDenomHashRequest(); + if (object.trace !== undefined && object.trace !== null) { + message.trace = object.trace; + } + return message; }, toAmino(message: QueryDenomHashRequest): QueryDenomHashRequestAmino { const obj: any = {}; @@ -784,9 +838,11 @@ export const QueryDenomHashResponse = { return message; }, fromAmino(object: QueryDenomHashResponseAmino): QueryDenomHashResponse { - return { - hash: object.hash - }; + const message = createBaseQueryDenomHashResponse(); + if (object.hash !== undefined && object.hash !== null) { + message.hash = object.hash; + } + return message; }, toAmino(message: QueryDenomHashResponse): QueryDenomHashResponseAmino { const obj: any = {}; @@ -859,10 +915,14 @@ export const QueryEscrowAddressRequest = { return message; }, fromAmino(object: QueryEscrowAddressRequestAmino): QueryEscrowAddressRequest { - return { - portId: object.port_id, - channelId: object.channel_id - }; + const message = createBaseQueryEscrowAddressRequest(); + if (object.port_id !== undefined && object.port_id !== null) { + message.portId = object.port_id; + } + if (object.channel_id !== undefined && object.channel_id !== null) { + message.channelId = object.channel_id; + } + return message; }, toAmino(message: QueryEscrowAddressRequest): QueryEscrowAddressRequestAmino { const obj: any = {}; @@ -928,9 +988,11 @@ export const QueryEscrowAddressResponse = { return message; }, fromAmino(object: QueryEscrowAddressResponseAmino): QueryEscrowAddressResponse { - return { - escrowAddress: object.escrow_address - }; + const message = createBaseQueryEscrowAddressResponse(); + if (object.escrow_address !== undefined && object.escrow_address !== null) { + message.escrowAddress = object.escrow_address; + } + return message; }, toAmino(message: QueryEscrowAddressResponse): QueryEscrowAddressResponseAmino { const obj: any = {}; @@ -958,4 +1020,142 @@ export const QueryEscrowAddressResponse = { value: QueryEscrowAddressResponse.encode(message).finish() }; } +}; +function createBaseQueryTotalEscrowForDenomRequest(): QueryTotalEscrowForDenomRequest { + return { + denom: "" + }; +} +export const QueryTotalEscrowForDenomRequest = { + typeUrl: "/ibc.applications.transfer.v1.QueryTotalEscrowForDenomRequest", + encode(message: QueryTotalEscrowForDenomRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.denom !== "") { + writer.uint32(10).string(message.denom); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryTotalEscrowForDenomRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryTotalEscrowForDenomRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.denom = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryTotalEscrowForDenomRequest { + const message = createBaseQueryTotalEscrowForDenomRequest(); + message.denom = object.denom ?? ""; + return message; + }, + fromAmino(object: QueryTotalEscrowForDenomRequestAmino): QueryTotalEscrowForDenomRequest { + const message = createBaseQueryTotalEscrowForDenomRequest(); + if (object.denom !== undefined && object.denom !== null) { + message.denom = object.denom; + } + return message; + }, + toAmino(message: QueryTotalEscrowForDenomRequest): QueryTotalEscrowForDenomRequestAmino { + const obj: any = {}; + obj.denom = message.denom; + return obj; + }, + fromAminoMsg(object: QueryTotalEscrowForDenomRequestAminoMsg): QueryTotalEscrowForDenomRequest { + return QueryTotalEscrowForDenomRequest.fromAmino(object.value); + }, + toAminoMsg(message: QueryTotalEscrowForDenomRequest): QueryTotalEscrowForDenomRequestAminoMsg { + return { + type: "cosmos-sdk/QueryTotalEscrowForDenomRequest", + value: QueryTotalEscrowForDenomRequest.toAmino(message) + }; + }, + fromProtoMsg(message: QueryTotalEscrowForDenomRequestProtoMsg): QueryTotalEscrowForDenomRequest { + return QueryTotalEscrowForDenomRequest.decode(message.value); + }, + toProto(message: QueryTotalEscrowForDenomRequest): Uint8Array { + return QueryTotalEscrowForDenomRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryTotalEscrowForDenomRequest): QueryTotalEscrowForDenomRequestProtoMsg { + return { + typeUrl: "/ibc.applications.transfer.v1.QueryTotalEscrowForDenomRequest", + value: QueryTotalEscrowForDenomRequest.encode(message).finish() + }; + } +}; +function createBaseQueryTotalEscrowForDenomResponse(): QueryTotalEscrowForDenomResponse { + return { + amount: Coin.fromPartial({}) + }; +} +export const QueryTotalEscrowForDenomResponse = { + typeUrl: "/ibc.applications.transfer.v1.QueryTotalEscrowForDenomResponse", + encode(message: QueryTotalEscrowForDenomResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.amount !== undefined) { + Coin.encode(message.amount, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryTotalEscrowForDenomResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryTotalEscrowForDenomResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.amount = Coin.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryTotalEscrowForDenomResponse { + const message = createBaseQueryTotalEscrowForDenomResponse(); + message.amount = object.amount !== undefined && object.amount !== null ? Coin.fromPartial(object.amount) : undefined; + return message; + }, + fromAmino(object: QueryTotalEscrowForDenomResponseAmino): QueryTotalEscrowForDenomResponse { + const message = createBaseQueryTotalEscrowForDenomResponse(); + if (object.amount !== undefined && object.amount !== null) { + message.amount = Coin.fromAmino(object.amount); + } + return message; + }, + toAmino(message: QueryTotalEscrowForDenomResponse): QueryTotalEscrowForDenomResponseAmino { + const obj: any = {}; + obj.amount = message.amount ? Coin.toAmino(message.amount) : undefined; + return obj; + }, + fromAminoMsg(object: QueryTotalEscrowForDenomResponseAminoMsg): QueryTotalEscrowForDenomResponse { + return QueryTotalEscrowForDenomResponse.fromAmino(object.value); + }, + toAminoMsg(message: QueryTotalEscrowForDenomResponse): QueryTotalEscrowForDenomResponseAminoMsg { + return { + type: "cosmos-sdk/QueryTotalEscrowForDenomResponse", + value: QueryTotalEscrowForDenomResponse.toAmino(message) + }; + }, + fromProtoMsg(message: QueryTotalEscrowForDenomResponseProtoMsg): QueryTotalEscrowForDenomResponse { + return QueryTotalEscrowForDenomResponse.decode(message.value); + }, + toProto(message: QueryTotalEscrowForDenomResponse): Uint8Array { + return QueryTotalEscrowForDenomResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryTotalEscrowForDenomResponse): QueryTotalEscrowForDenomResponseProtoMsg { + return { + typeUrl: "/ibc.applications.transfer.v1.QueryTotalEscrowForDenomResponse", + value: QueryTotalEscrowForDenomResponse.encode(message).finish() + }; + } }; \ No newline at end of file diff --git a/packages/osmo-query/src/codegen/ibc/applications/transfer/v1/transfer.ts b/packages/osmo-query/src/codegen/ibc/applications/transfer/v1/transfer.ts index 5c9105ebe..07d32f1ee 100644 --- a/packages/osmo-query/src/codegen/ibc/applications/transfer/v1/transfer.ts +++ b/packages/osmo-query/src/codegen/ibc/applications/transfer/v1/transfer.ts @@ -25,9 +25,9 @@ export interface DenomTraceAmino { * path defines the chain of port/channel identifiers used for tracing the * source of the fungible token. */ - path: string; + path?: string; /** base denomination of the relayed fungible token. */ - base_denom: string; + base_denom?: string; } export interface DenomTraceAminoMsg { type: "cosmos-sdk/DenomTrace"; @@ -74,12 +74,12 @@ export interface ParamsAmino { * send_enabled enables or disables all cross-chain token transfers from this * chain. */ - send_enabled: boolean; + send_enabled?: boolean; /** * receive_enabled enables or disables all cross-chain token transfers to this * chain. */ - receive_enabled: boolean; + receive_enabled?: boolean; } export interface ParamsAminoMsg { type: "cosmos-sdk/Params"; @@ -139,10 +139,14 @@ export const DenomTrace = { return message; }, fromAmino(object: DenomTraceAmino): DenomTrace { - return { - path: object.path, - baseDenom: object.base_denom - }; + const message = createBaseDenomTrace(); + if (object.path !== undefined && object.path !== null) { + message.path = object.path; + } + if (object.base_denom !== undefined && object.base_denom !== null) { + message.baseDenom = object.base_denom; + } + return message; }, toAmino(message: DenomTrace): DenomTraceAmino { const obj: any = {}; @@ -216,10 +220,14 @@ export const Params = { return message; }, fromAmino(object: ParamsAmino): Params { - return { - sendEnabled: object.send_enabled, - receiveEnabled: object.receive_enabled - }; + const message = createBaseParams(); + if (object.send_enabled !== undefined && object.send_enabled !== null) { + message.sendEnabled = object.send_enabled; + } + if (object.receive_enabled !== undefined && object.receive_enabled !== null) { + message.receiveEnabled = object.receive_enabled; + } + return message; }, toAmino(message: Params): ParamsAmino { const obj: any = {}; diff --git a/packages/osmo-query/src/codegen/ibc/applications/transfer/v1/tx.amino.ts b/packages/osmo-query/src/codegen/ibc/applications/transfer/v1/tx.amino.ts index 7295985b5..f220cd069 100644 --- a/packages/osmo-query/src/codegen/ibc/applications/transfer/v1/tx.amino.ts +++ b/packages/osmo-query/src/codegen/ibc/applications/transfer/v1/tx.amino.ts @@ -1,9 +1,14 @@ //@ts-nocheck -import { MsgTransfer } from "./tx"; +import { MsgTransfer, MsgUpdateParams } from "./tx"; export const AminoConverter = { "/ibc.applications.transfer.v1.MsgTransfer": { aminoType: "cosmos-sdk/MsgTransfer", toAmino: MsgTransfer.toAmino, fromAmino: MsgTransfer.fromAmino + }, + "/ibc.applications.transfer.v1.MsgUpdateParams": { + aminoType: "cosmos-sdk/MsgUpdateParams", + toAmino: MsgUpdateParams.toAmino, + fromAmino: MsgUpdateParams.fromAmino } }; \ No newline at end of file diff --git a/packages/osmo-query/src/codegen/ibc/applications/transfer/v1/tx.registry.ts b/packages/osmo-query/src/codegen/ibc/applications/transfer/v1/tx.registry.ts index dae96a3a7..3789a3cb1 100644 --- a/packages/osmo-query/src/codegen/ibc/applications/transfer/v1/tx.registry.ts +++ b/packages/osmo-query/src/codegen/ibc/applications/transfer/v1/tx.registry.ts @@ -1,7 +1,7 @@ //@ts-nocheck import { GeneratedType, Registry } from "@cosmjs/proto-signing"; -import { MsgTransfer } from "./tx"; -export const registry: ReadonlyArray<[string, GeneratedType]> = [["/ibc.applications.transfer.v1.MsgTransfer", MsgTransfer]]; +import { MsgTransfer, MsgUpdateParams } from "./tx"; +export const registry: ReadonlyArray<[string, GeneratedType]> = [["/ibc.applications.transfer.v1.MsgTransfer", MsgTransfer], ["/ibc.applications.transfer.v1.MsgUpdateParams", MsgUpdateParams]]; export const load = (protoRegistry: Registry) => { registry.forEach(([typeUrl, mod]) => { protoRegistry.register(typeUrl, mod); @@ -14,6 +14,12 @@ export const MessageComposer = { typeUrl: "/ibc.applications.transfer.v1.MsgTransfer", value: MsgTransfer.encode(value).finish() }; + }, + updateParams(value: MsgUpdateParams) { + return { + typeUrl: "/ibc.applications.transfer.v1.MsgUpdateParams", + value: MsgUpdateParams.encode(value).finish() + }; } }, withTypeUrl: { @@ -22,6 +28,12 @@ export const MessageComposer = { typeUrl: "/ibc.applications.transfer.v1.MsgTransfer", value }; + }, + updateParams(value: MsgUpdateParams) { + return { + typeUrl: "/ibc.applications.transfer.v1.MsgUpdateParams", + value + }; } }, fromPartial: { @@ -30,6 +42,12 @@ export const MessageComposer = { typeUrl: "/ibc.applications.transfer.v1.MsgTransfer", value: MsgTransfer.fromPartial(value) }; + }, + updateParams(value: MsgUpdateParams) { + return { + typeUrl: "/ibc.applications.transfer.v1.MsgUpdateParams", + value: MsgUpdateParams.fromPartial(value) + }; } } }; \ No newline at end of file diff --git a/packages/osmo-query/src/codegen/ibc/applications/transfer/v1/tx.rpc.msg.ts b/packages/osmo-query/src/codegen/ibc/applications/transfer/v1/tx.rpc.msg.ts index c4f28579a..20d9f8a7d 100644 --- a/packages/osmo-query/src/codegen/ibc/applications/transfer/v1/tx.rpc.msg.ts +++ b/packages/osmo-query/src/codegen/ibc/applications/transfer/v1/tx.rpc.msg.ts @@ -1,20 +1,28 @@ import { Rpc } from "../../../../helpers"; import { BinaryReader } from "../../../../binary"; -import { MsgTransfer, MsgTransferResponse } from "./tx"; +import { MsgTransfer, MsgTransferResponse, MsgUpdateParams, MsgUpdateParamsResponse } from "./tx"; /** Msg defines the ibc/transfer Msg service. */ export interface Msg { /** Transfer defines a rpc handler method for MsgTransfer. */ transfer(request: MsgTransfer): Promise; + /** UpdateParams defines a rpc handler for MsgUpdateParams. */ + updateParams(request: MsgUpdateParams): Promise; } export class MsgClientImpl implements Msg { private readonly rpc: Rpc; constructor(rpc: Rpc) { this.rpc = rpc; this.transfer = this.transfer.bind(this); + this.updateParams = this.updateParams.bind(this); } transfer(request: MsgTransfer): Promise { const data = MsgTransfer.encode(request).finish(); const promise = this.rpc.request("ibc.applications.transfer.v1.Msg", "Transfer", data); return promise.then(data => MsgTransferResponse.decode(new BinaryReader(data))); } + updateParams(request: MsgUpdateParams): Promise { + const data = MsgUpdateParams.encode(request).finish(); + const promise = this.rpc.request("ibc.applications.transfer.v1.Msg", "UpdateParams", data); + return promise.then(data => MsgUpdateParamsResponse.decode(new BinaryReader(data))); + } } \ No newline at end of file diff --git a/packages/osmo-query/src/codegen/ibc/applications/transfer/v1/tx.ts b/packages/osmo-query/src/codegen/ibc/applications/transfer/v1/tx.ts index b87014f4f..995d25c93 100644 --- a/packages/osmo-query/src/codegen/ibc/applications/transfer/v1/tx.ts +++ b/packages/osmo-query/src/codegen/ibc/applications/transfer/v1/tx.ts @@ -1,5 +1,5 @@ import { Coin, CoinAmino, CoinSDKType } from "../../../../cosmos/base/v1beta1/coin"; -import { Height, HeightAmino, HeightSDKType } from "../../../core/client/v1/client"; +import { Height, HeightAmino, HeightSDKType, Params, ParamsAmino, ParamsSDKType } from "../../../core/client/v1/client"; import { BinaryReader, BinaryWriter } from "../../../../binary"; /** * MsgTransfer defines a msg to transfer fungible tokens (i.e Coins) between @@ -41,27 +41,27 @@ export interface MsgTransferProtoMsg { */ export interface MsgTransferAmino { /** the port on which the packet will be sent */ - source_port: string; + source_port?: string; /** the channel by which the packet will be sent */ - source_channel: string; + source_channel?: string; /** the tokens to be transferred */ - token?: CoinAmino; + token: CoinAmino; /** the sender address */ - sender: string; + sender?: string; /** the recipient address on the destination chain */ - receiver: string; + receiver?: string; /** * Timeout height relative to the current block height. * The timeout is disabled when set to 0. */ - timeout_height?: HeightAmino; + timeout_height: HeightAmino; /** * Timeout timestamp in absolute nanoseconds since unix epoch. * The timeout is disabled when set to 0. */ - timeout_timestamp: string; + timeout_timestamp?: string; /** optional memo */ - memo: string; + memo?: string; } export interface MsgTransferAminoMsg { type: "cosmos-sdk/MsgTransfer"; @@ -94,7 +94,7 @@ export interface MsgTransferResponseProtoMsg { /** MsgTransferResponse defines the Msg/Transfer response type. */ export interface MsgTransferResponseAmino { /** sequence number of the transfer packet sent */ - sequence: string; + sequence?: string; } export interface MsgTransferResponseAminoMsg { type: "cosmos-sdk/MsgTransferResponse"; @@ -104,6 +104,64 @@ export interface MsgTransferResponseAminoMsg { export interface MsgTransferResponseSDKType { sequence: bigint; } +/** MsgUpdateParams is the Msg/UpdateParams request type. */ +export interface MsgUpdateParams { + /** signer address */ + signer: string; + /** + * params defines the transfer parameters to update. + * + * NOTE: All parameters must be supplied. + */ + params: Params; +} +export interface MsgUpdateParamsProtoMsg { + typeUrl: "/ibc.applications.transfer.v1.MsgUpdateParams"; + value: Uint8Array; +} +/** MsgUpdateParams is the Msg/UpdateParams request type. */ +export interface MsgUpdateParamsAmino { + /** signer address */ + signer?: string; + /** + * params defines the transfer parameters to update. + * + * NOTE: All parameters must be supplied. + */ + params?: ParamsAmino; +} +export interface MsgUpdateParamsAminoMsg { + type: "cosmos-sdk/MsgUpdateParams"; + value: MsgUpdateParamsAmino; +} +/** MsgUpdateParams is the Msg/UpdateParams request type. */ +export interface MsgUpdateParamsSDKType { + signer: string; + params: ParamsSDKType; +} +/** + * MsgUpdateParamsResponse defines the response structure for executing a + * MsgUpdateParams message. + */ +export interface MsgUpdateParamsResponse {} +export interface MsgUpdateParamsResponseProtoMsg { + typeUrl: "/ibc.applications.transfer.v1.MsgUpdateParamsResponse"; + value: Uint8Array; +} +/** + * MsgUpdateParamsResponse defines the response structure for executing a + * MsgUpdateParams message. + */ +export interface MsgUpdateParamsResponseAmino {} +export interface MsgUpdateParamsResponseAminoMsg { + type: "cosmos-sdk/MsgUpdateParamsResponse"; + value: MsgUpdateParamsResponseAmino; +} +/** + * MsgUpdateParamsResponse defines the response structure for executing a + * MsgUpdateParams message. + */ +export interface MsgUpdateParamsResponseSDKType {} function createBaseMsgTransfer(): MsgTransfer { return { sourcePort: "", @@ -196,22 +254,38 @@ export const MsgTransfer = { return message; }, fromAmino(object: MsgTransferAmino): MsgTransfer { - return { - sourcePort: object.source_port, - sourceChannel: object.source_channel, - token: object?.token ? Coin.fromAmino(object.token) : undefined, - sender: object.sender, - receiver: object.receiver, - timeoutHeight: object?.timeout_height ? Height.fromAmino(object.timeout_height) : undefined, - timeoutTimestamp: BigInt(object.timeout_timestamp), - memo: object.memo - }; + const message = createBaseMsgTransfer(); + if (object.source_port !== undefined && object.source_port !== null) { + message.sourcePort = object.source_port; + } + if (object.source_channel !== undefined && object.source_channel !== null) { + message.sourceChannel = object.source_channel; + } + if (object.token !== undefined && object.token !== null) { + message.token = Coin.fromAmino(object.token); + } + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + if (object.receiver !== undefined && object.receiver !== null) { + message.receiver = object.receiver; + } + if (object.timeout_height !== undefined && object.timeout_height !== null) { + message.timeoutHeight = Height.fromAmino(object.timeout_height); + } + if (object.timeout_timestamp !== undefined && object.timeout_timestamp !== null) { + message.timeoutTimestamp = BigInt(object.timeout_timestamp); + } + if (object.memo !== undefined && object.memo !== null) { + message.memo = object.memo; + } + return message; }, toAmino(message: MsgTransfer): MsgTransferAmino { const obj: any = {}; obj.source_port = message.sourcePort; obj.source_channel = message.sourceChannel; - obj.token = message.token ? Coin.toAmino(message.token) : undefined; + obj.token = message.token ? Coin.toAmino(message.token) : Coin.fromPartial({}); obj.sender = message.sender; obj.receiver = message.receiver; obj.timeout_height = message.timeoutHeight ? Height.toAmino(message.timeoutHeight) : {}; @@ -277,9 +351,11 @@ export const MsgTransferResponse = { return message; }, fromAmino(object: MsgTransferResponseAmino): MsgTransferResponse { - return { - sequence: BigInt(object.sequence) - }; + const message = createBaseMsgTransferResponse(); + if (object.sequence !== undefined && object.sequence !== null) { + message.sequence = BigInt(object.sequence); + } + return message; }, toAmino(message: MsgTransferResponse): MsgTransferResponseAmino { const obj: any = {}; @@ -307,4 +383,141 @@ export const MsgTransferResponse = { value: MsgTransferResponse.encode(message).finish() }; } +}; +function createBaseMsgUpdateParams(): MsgUpdateParams { + return { + signer: "", + params: Params.fromPartial({}) + }; +} +export const MsgUpdateParams = { + typeUrl: "/ibc.applications.transfer.v1.MsgUpdateParams", + encode(message: MsgUpdateParams, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.signer !== "") { + writer.uint32(10).string(message.signer); + } + if (message.params !== undefined) { + Params.encode(message.params, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgUpdateParams { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUpdateParams(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.signer = reader.string(); + break; + case 2: + message.params = Params.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgUpdateParams { + const message = createBaseMsgUpdateParams(); + message.signer = object.signer ?? ""; + message.params = object.params !== undefined && object.params !== null ? Params.fromPartial(object.params) : undefined; + return message; + }, + fromAmino(object: MsgUpdateParamsAmino): MsgUpdateParams { + const message = createBaseMsgUpdateParams(); + if (object.signer !== undefined && object.signer !== null) { + message.signer = object.signer; + } + if (object.params !== undefined && object.params !== null) { + message.params = Params.fromAmino(object.params); + } + return message; + }, + toAmino(message: MsgUpdateParams): MsgUpdateParamsAmino { + const obj: any = {}; + obj.signer = message.signer; + obj.params = message.params ? Params.toAmino(message.params) : undefined; + return obj; + }, + fromAminoMsg(object: MsgUpdateParamsAminoMsg): MsgUpdateParams { + return MsgUpdateParams.fromAmino(object.value); + }, + toAminoMsg(message: MsgUpdateParams): MsgUpdateParamsAminoMsg { + return { + type: "cosmos-sdk/MsgUpdateParams", + value: MsgUpdateParams.toAmino(message) + }; + }, + fromProtoMsg(message: MsgUpdateParamsProtoMsg): MsgUpdateParams { + return MsgUpdateParams.decode(message.value); + }, + toProto(message: MsgUpdateParams): Uint8Array { + return MsgUpdateParams.encode(message).finish(); + }, + toProtoMsg(message: MsgUpdateParams): MsgUpdateParamsProtoMsg { + return { + typeUrl: "/ibc.applications.transfer.v1.MsgUpdateParams", + value: MsgUpdateParams.encode(message).finish() + }; + } +}; +function createBaseMsgUpdateParamsResponse(): MsgUpdateParamsResponse { + return {}; +} +export const MsgUpdateParamsResponse = { + typeUrl: "/ibc.applications.transfer.v1.MsgUpdateParamsResponse", + encode(_: MsgUpdateParamsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgUpdateParamsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUpdateParamsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): MsgUpdateParamsResponse { + const message = createBaseMsgUpdateParamsResponse(); + return message; + }, + fromAmino(_: MsgUpdateParamsResponseAmino): MsgUpdateParamsResponse { + const message = createBaseMsgUpdateParamsResponse(); + return message; + }, + toAmino(_: MsgUpdateParamsResponse): MsgUpdateParamsResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgUpdateParamsResponseAminoMsg): MsgUpdateParamsResponse { + return MsgUpdateParamsResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgUpdateParamsResponse): MsgUpdateParamsResponseAminoMsg { + return { + type: "cosmos-sdk/MsgUpdateParamsResponse", + value: MsgUpdateParamsResponse.toAmino(message) + }; + }, + fromProtoMsg(message: MsgUpdateParamsResponseProtoMsg): MsgUpdateParamsResponse { + return MsgUpdateParamsResponse.decode(message.value); + }, + toProto(message: MsgUpdateParamsResponse): Uint8Array { + return MsgUpdateParamsResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgUpdateParamsResponse): MsgUpdateParamsResponseProtoMsg { + return { + typeUrl: "/ibc.applications.transfer.v1.MsgUpdateParamsResponse", + value: MsgUpdateParamsResponse.encode(message).finish() + }; + } }; \ No newline at end of file diff --git a/packages/osmo-query/src/codegen/ibc/applications/transfer/v2/packet.ts b/packages/osmo-query/src/codegen/ibc/applications/transfer/v2/packet.ts index a056a5f1d..f8325524c 100644 --- a/packages/osmo-query/src/codegen/ibc/applications/transfer/v2/packet.ts +++ b/packages/osmo-query/src/codegen/ibc/applications/transfer/v2/packet.ts @@ -27,15 +27,15 @@ export interface FungibleTokenPacketDataProtoMsg { */ export interface FungibleTokenPacketDataAmino { /** the token denomination to be transferred */ - denom: string; + denom?: string; /** the token amount to be transferred */ - amount: string; + amount?: string; /** the sender address */ - sender: string; + sender?: string; /** the recipient address on the destination chain */ - receiver: string; + receiver?: string; /** optional memo */ - memo: string; + memo?: string; } export interface FungibleTokenPacketDataAminoMsg { type: "cosmos-sdk/FungibleTokenPacketData"; @@ -121,13 +121,23 @@ export const FungibleTokenPacketData = { return message; }, fromAmino(object: FungibleTokenPacketDataAmino): FungibleTokenPacketData { - return { - denom: object.denom, - amount: object.amount, - sender: object.sender, - receiver: object.receiver, - memo: object.memo - }; + const message = createBaseFungibleTokenPacketData(); + if (object.denom !== undefined && object.denom !== null) { + message.denom = object.denom; + } + if (object.amount !== undefined && object.amount !== null) { + message.amount = object.amount; + } + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + if (object.receiver !== undefined && object.receiver !== null) { + message.receiver = object.receiver; + } + if (object.memo !== undefined && object.memo !== null) { + message.memo = object.memo; + } + return message; }, toAmino(message: FungibleTokenPacketData): FungibleTokenPacketDataAmino { const obj: any = {}; diff --git a/packages/osmo-query/src/codegen/ibc/bundle.ts b/packages/osmo-query/src/codegen/ibc/bundle.ts index a4fb5c624..6155f5a7d 100644 --- a/packages/osmo-query/src/codegen/ibc/bundle.ts +++ b/packages/osmo-query/src/codegen/ibc/bundle.ts @@ -1,212 +1,244 @@ -import * as _44 from "./applications/fee/v1/ack"; -import * as _45 from "./applications/fee/v1/fee"; -import * as _46 from "./applications/fee/v1/genesis"; -import * as _47 from "./applications/fee/v1/metadata"; -import * as _48 from "./applications/fee/v1/query"; -import * as _49 from "./applications/fee/v1/tx"; -import * as _50 from "./applications/interchain_accounts/controller/v1/controller"; -import * as _51 from "./applications/interchain_accounts/controller/v1/query"; -import * as _52 from "./applications/interchain_accounts/controller/v1/tx"; -import * as _53 from "./applications/interchain_accounts/genesis/v1/genesis"; -import * as _54 from "./applications/interchain_accounts/host/v1/host"; -import * as _55 from "./applications/interchain_accounts/host/v1/query"; -import * as _56 from "./applications/interchain_accounts/v1/account"; -import * as _57 from "./applications/interchain_accounts/v1/metadata"; -import * as _58 from "./applications/interchain_accounts/v1/packet"; -import * as _59 from "./applications/transfer/v1/authz"; -import * as _60 from "./applications/transfer/v1/genesis"; -import * as _61 from "./applications/transfer/v1/query"; -import * as _62 from "./applications/transfer/v1/transfer"; -import * as _63 from "./applications/transfer/v1/tx"; -import * as _64 from "./applications/transfer/v2/packet"; -import * as _65 from "./core/channel/v1/channel"; -import * as _66 from "./core/channel/v1/genesis"; -import * as _67 from "./core/channel/v1/query"; -import * as _68 from "./core/channel/v1/tx"; -import * as _69 from "./core/client/v1/client"; -import * as _70 from "./core/client/v1/genesis"; -import * as _71 from "./core/client/v1/query"; -import * as _72 from "./core/client/v1/tx"; -import * as _73 from "./core/commitment/v1/commitment"; -import * as _74 from "./core/connection/v1/connection"; -import * as _75 from "./core/connection/v1/genesis"; -import * as _76 from "./core/connection/v1/query"; -import * as _77 from "./core/connection/v1/tx"; -import * as _78 from "./lightclients/localhost/v2/localhost"; -import * as _79 from "./lightclients/solomachine/v2/solomachine"; -import * as _80 from "./lightclients/solomachine/v3/solomachine"; -import * as _81 from "./lightclients/tendermint/v1/tendermint"; -import * as _223 from "./applications/fee/v1/tx.amino"; -import * as _224 from "./applications/interchain_accounts/controller/v1/tx.amino"; -import * as _225 from "./applications/transfer/v1/tx.amino"; -import * as _226 from "./core/channel/v1/tx.amino"; -import * as _227 from "./core/client/v1/tx.amino"; -import * as _228 from "./core/connection/v1/tx.amino"; -import * as _229 from "./applications/fee/v1/tx.registry"; -import * as _230 from "./applications/interchain_accounts/controller/v1/tx.registry"; -import * as _231 from "./applications/transfer/v1/tx.registry"; -import * as _232 from "./core/channel/v1/tx.registry"; -import * as _233 from "./core/client/v1/tx.registry"; -import * as _234 from "./core/connection/v1/tx.registry"; -import * as _235 from "./applications/fee/v1/query.lcd"; -import * as _236 from "./applications/interchain_accounts/controller/v1/query.lcd"; -import * as _237 from "./applications/interchain_accounts/host/v1/query.lcd"; -import * as _238 from "./applications/transfer/v1/query.lcd"; -import * as _239 from "./core/channel/v1/query.lcd"; -import * as _240 from "./core/client/v1/query.lcd"; -import * as _241 from "./core/connection/v1/query.lcd"; -import * as _242 from "./applications/fee/v1/query.rpc.Query"; -import * as _243 from "./applications/interchain_accounts/controller/v1/query.rpc.Query"; -import * as _244 from "./applications/interchain_accounts/host/v1/query.rpc.Query"; -import * as _245 from "./applications/transfer/v1/query.rpc.Query"; -import * as _246 from "./core/channel/v1/query.rpc.Query"; -import * as _247 from "./core/client/v1/query.rpc.Query"; -import * as _248 from "./core/connection/v1/query.rpc.Query"; -import * as _249 from "./applications/fee/v1/tx.rpc.msg"; -import * as _250 from "./applications/interchain_accounts/controller/v1/tx.rpc.msg"; -import * as _251 from "./applications/transfer/v1/tx.rpc.msg"; -import * as _252 from "./core/channel/v1/tx.rpc.msg"; -import * as _253 from "./core/client/v1/tx.rpc.msg"; -import * as _254 from "./core/connection/v1/tx.rpc.msg"; -import * as _335 from "./lcd"; -import * as _336 from "./rpc.query"; -import * as _337 from "./rpc.tx"; +import * as _86 from "./applications/fee/v1/ack"; +import * as _87 from "./applications/fee/v1/fee"; +import * as _88 from "./applications/fee/v1/genesis"; +import * as _89 from "./applications/fee/v1/metadata"; +import * as _90 from "./applications/fee/v1/query"; +import * as _91 from "./applications/fee/v1/tx"; +import * as _92 from "./applications/interchain_accounts/controller/v1/controller"; +import * as _93 from "./applications/interchain_accounts/controller/v1/query"; +import * as _94 from "./applications/interchain_accounts/controller/v1/tx"; +import * as _95 from "./applications/interchain_accounts/genesis/v1/genesis"; +import * as _96 from "./applications/interchain_accounts/host/v1/host"; +import * as _97 from "./applications/interchain_accounts/host/v1/query"; +import * as _98 from "./applications/interchain_accounts/host/v1/tx"; +import * as _99 from "./applications/interchain_accounts/v1/account"; +import * as _100 from "./applications/interchain_accounts/v1/metadata"; +import * as _101 from "./applications/interchain_accounts/v1/packet"; +import * as _102 from "./applications/transfer/v1/authz"; +import * as _103 from "./applications/transfer/v1/genesis"; +import * as _104 from "./applications/transfer/v1/query"; +import * as _105 from "./applications/transfer/v1/transfer"; +import * as _106 from "./applications/transfer/v1/tx"; +import * as _107 from "./applications/transfer/v2/packet"; +import * as _108 from "./core/channel/v1/channel"; +import * as _109 from "./core/channel/v1/genesis"; +import * as _110 from "./core/channel/v1/query"; +import * as _111 from "./core/channel/v1/tx"; +import * as _112 from "./core/channel/v1/upgrade"; +import * as _113 from "./core/client/v1/client"; +import * as _114 from "./core/client/v1/genesis"; +import * as _115 from "./core/client/v1/query"; +import * as _116 from "./core/client/v1/tx"; +import * as _117 from "./core/commitment/v1/commitment"; +import * as _118 from "./core/connection/v1/connection"; +import * as _119 from "./core/connection/v1/genesis"; +import * as _120 from "./core/connection/v1/query"; +import * as _121 from "./core/connection/v1/tx"; +import * as _122 from "./lightclients/localhost/v2/localhost"; +import * as _123 from "./lightclients/solomachine/v2/solomachine"; +import * as _124 from "./lightclients/solomachine/v3/solomachine"; +import * as _125 from "./lightclients/tendermint/v1/tendermint"; +import * as _126 from "./lightclients/wasm/v1/genesis"; +import * as _127 from "./lightclients/wasm/v1/query"; +import * as _128 from "./lightclients/wasm/v1/tx"; +import * as _129 from "./lightclients/wasm/v1/wasm"; +import * as _280 from "./applications/fee/v1/tx.amino"; +import * as _281 from "./applications/interchain_accounts/controller/v1/tx.amino"; +import * as _282 from "./applications/interchain_accounts/host/v1/tx.amino"; +import * as _283 from "./applications/transfer/v1/tx.amino"; +import * as _284 from "./core/channel/v1/tx.amino"; +import * as _285 from "./core/client/v1/tx.amino"; +import * as _286 from "./core/connection/v1/tx.amino"; +import * as _287 from "./lightclients/wasm/v1/tx.amino"; +import * as _288 from "./applications/fee/v1/tx.registry"; +import * as _289 from "./applications/interchain_accounts/controller/v1/tx.registry"; +import * as _290 from "./applications/interchain_accounts/host/v1/tx.registry"; +import * as _291 from "./applications/transfer/v1/tx.registry"; +import * as _292 from "./core/channel/v1/tx.registry"; +import * as _293 from "./core/client/v1/tx.registry"; +import * as _294 from "./core/connection/v1/tx.registry"; +import * as _295 from "./lightclients/wasm/v1/tx.registry"; +import * as _296 from "./applications/fee/v1/query.lcd"; +import * as _297 from "./applications/interchain_accounts/controller/v1/query.lcd"; +import * as _298 from "./applications/interchain_accounts/host/v1/query.lcd"; +import * as _299 from "./applications/transfer/v1/query.lcd"; +import * as _300 from "./core/channel/v1/query.lcd"; +import * as _301 from "./core/client/v1/query.lcd"; +import * as _302 from "./core/connection/v1/query.lcd"; +import * as _303 from "./lightclients/wasm/v1/query.lcd"; +import * as _304 from "./applications/fee/v1/query.rpc.Query"; +import * as _305 from "./applications/interchain_accounts/controller/v1/query.rpc.Query"; +import * as _306 from "./applications/interchain_accounts/host/v1/query.rpc.Query"; +import * as _307 from "./applications/transfer/v1/query.rpc.Query"; +import * as _308 from "./core/channel/v1/query.rpc.Query"; +import * as _309 from "./core/client/v1/query.rpc.Query"; +import * as _310 from "./core/connection/v1/query.rpc.Query"; +import * as _311 from "./lightclients/wasm/v1/query.rpc.Query"; +import * as _312 from "./applications/fee/v1/tx.rpc.msg"; +import * as _313 from "./applications/interchain_accounts/controller/v1/tx.rpc.msg"; +import * as _314 from "./applications/interchain_accounts/host/v1/tx.rpc.msg"; +import * as _315 from "./applications/transfer/v1/tx.rpc.msg"; +import * as _316 from "./core/channel/v1/tx.rpc.msg"; +import * as _317 from "./core/client/v1/tx.rpc.msg"; +import * as _318 from "./core/connection/v1/tx.rpc.msg"; +import * as _319 from "./lightclients/wasm/v1/tx.rpc.msg"; +import * as _405 from "./lcd"; +import * as _406 from "./rpc.query"; +import * as _407 from "./rpc.tx"; export namespace ibc { export namespace applications { export namespace fee { export const v1 = { - ..._44, - ..._45, - ..._46, - ..._47, - ..._48, - ..._49, - ..._223, - ..._229, - ..._235, - ..._242, - ..._249 + ..._86, + ..._87, + ..._88, + ..._89, + ..._90, + ..._91, + ..._280, + ..._288, + ..._296, + ..._304, + ..._312 }; } export namespace interchain_accounts { export namespace controller { export const v1 = { - ..._50, - ..._51, - ..._52, - ..._224, - ..._230, - ..._236, - ..._243, - ..._250 + ..._92, + ..._93, + ..._94, + ..._281, + ..._289, + ..._297, + ..._305, + ..._313 }; } export namespace genesis { export const v1 = { - ..._53 + ..._95 }; } export namespace host { export const v1 = { - ..._54, - ..._55, - ..._237, - ..._244 + ..._96, + ..._97, + ..._98, + ..._282, + ..._290, + ..._298, + ..._306, + ..._314 }; } export const v1 = { - ..._56, - ..._57, - ..._58 + ..._99, + ..._100, + ..._101 }; } export namespace transfer { export const v1 = { - ..._59, - ..._60, - ..._61, - ..._62, - ..._63, - ..._225, - ..._231, - ..._238, - ..._245, - ..._251 + ..._102, + ..._103, + ..._104, + ..._105, + ..._106, + ..._283, + ..._291, + ..._299, + ..._307, + ..._315 }; export const v2 = { - ..._64 + ..._107 }; } } export namespace core { export namespace channel { export const v1 = { - ..._65, - ..._66, - ..._67, - ..._68, - ..._226, - ..._232, - ..._239, - ..._246, - ..._252 + ..._108, + ..._109, + ..._110, + ..._111, + ..._112, + ..._284, + ..._292, + ..._300, + ..._308, + ..._316 }; } export namespace client { export const v1 = { - ..._69, - ..._70, - ..._71, - ..._72, - ..._227, - ..._233, - ..._240, - ..._247, - ..._253 + ..._113, + ..._114, + ..._115, + ..._116, + ..._285, + ..._293, + ..._301, + ..._309, + ..._317 }; } export namespace commitment { export const v1 = { - ..._73 + ..._117 }; } export namespace connection { export const v1 = { - ..._74, - ..._75, - ..._76, - ..._77, - ..._228, - ..._234, - ..._241, - ..._248, - ..._254 + ..._118, + ..._119, + ..._120, + ..._121, + ..._286, + ..._294, + ..._302, + ..._310, + ..._318 }; } } export namespace lightclients { export namespace localhost { export const v2 = { - ..._78 + ..._122 }; } export namespace solomachine { export const v2 = { - ..._79 + ..._123 }; export const v3 = { - ..._80 + ..._124 }; } export namespace tendermint { export const v1 = { - ..._81 + ..._125 + }; + } + export namespace wasm { + export const v1 = { + ..._126, + ..._127, + ..._128, + ..._129, + ..._287, + ..._295, + ..._303, + ..._311, + ..._319 }; } } export const ClientFactory = { - ..._335, - ..._336, - ..._337 + ..._405, + ..._406, + ..._407 }; } \ No newline at end of file diff --git a/packages/osmo-query/src/codegen/ibc/client.ts b/packages/osmo-query/src/codegen/ibc/client.ts index 434d025d9..5b1c2f68a 100644 --- a/packages/osmo-query/src/codegen/ibc/client.ts +++ b/packages/osmo-query/src/codegen/ibc/client.ts @@ -3,25 +3,31 @@ import { defaultRegistryTypes, AminoTypes, SigningStargateClient } from "@cosmjs import { HttpEndpoint } from "@cosmjs/tendermint-rpc"; import * as ibcApplicationsFeeV1TxRegistry from "./applications/fee/v1/tx.registry"; import * as ibcApplicationsInterchainAccountsControllerV1TxRegistry from "./applications/interchain_accounts/controller/v1/tx.registry"; +import * as ibcApplicationsInterchainAccountsHostV1TxRegistry from "./applications/interchain_accounts/host/v1/tx.registry"; import * as ibcApplicationsTransferV1TxRegistry from "./applications/transfer/v1/tx.registry"; import * as ibcCoreChannelV1TxRegistry from "./core/channel/v1/tx.registry"; import * as ibcCoreClientV1TxRegistry from "./core/client/v1/tx.registry"; import * as ibcCoreConnectionV1TxRegistry from "./core/connection/v1/tx.registry"; +import * as ibcLightclientsWasmV1TxRegistry from "./lightclients/wasm/v1/tx.registry"; import * as ibcApplicationsFeeV1TxAmino from "./applications/fee/v1/tx.amino"; import * as ibcApplicationsInterchainAccountsControllerV1TxAmino from "./applications/interchain_accounts/controller/v1/tx.amino"; +import * as ibcApplicationsInterchainAccountsHostV1TxAmino from "./applications/interchain_accounts/host/v1/tx.amino"; import * as ibcApplicationsTransferV1TxAmino from "./applications/transfer/v1/tx.amino"; import * as ibcCoreChannelV1TxAmino from "./core/channel/v1/tx.amino"; import * as ibcCoreClientV1TxAmino from "./core/client/v1/tx.amino"; import * as ibcCoreConnectionV1TxAmino from "./core/connection/v1/tx.amino"; +import * as ibcLightclientsWasmV1TxAmino from "./lightclients/wasm/v1/tx.amino"; export const ibcAminoConverters = { ...ibcApplicationsFeeV1TxAmino.AminoConverter, ...ibcApplicationsInterchainAccountsControllerV1TxAmino.AminoConverter, + ...ibcApplicationsInterchainAccountsHostV1TxAmino.AminoConverter, ...ibcApplicationsTransferV1TxAmino.AminoConverter, ...ibcCoreChannelV1TxAmino.AminoConverter, ...ibcCoreClientV1TxAmino.AminoConverter, - ...ibcCoreConnectionV1TxAmino.AminoConverter + ...ibcCoreConnectionV1TxAmino.AminoConverter, + ...ibcLightclientsWasmV1TxAmino.AminoConverter }; -export const ibcProtoRegistry: ReadonlyArray<[string, GeneratedType]> = [...ibcApplicationsFeeV1TxRegistry.registry, ...ibcApplicationsInterchainAccountsControllerV1TxRegistry.registry, ...ibcApplicationsTransferV1TxRegistry.registry, ...ibcCoreChannelV1TxRegistry.registry, ...ibcCoreClientV1TxRegistry.registry, ...ibcCoreConnectionV1TxRegistry.registry]; +export const ibcProtoRegistry: ReadonlyArray<[string, GeneratedType]> = [...ibcApplicationsFeeV1TxRegistry.registry, ...ibcApplicationsInterchainAccountsControllerV1TxRegistry.registry, ...ibcApplicationsInterchainAccountsHostV1TxRegistry.registry, ...ibcApplicationsTransferV1TxRegistry.registry, ...ibcCoreChannelV1TxRegistry.registry, ...ibcCoreClientV1TxRegistry.registry, ...ibcCoreConnectionV1TxRegistry.registry, ...ibcLightclientsWasmV1TxRegistry.registry]; export const getSigningIbcClientOptions = ({ defaultTypes = defaultRegistryTypes }: { diff --git a/packages/osmo-query/src/codegen/ibc/core/channel/v1/channel.ts b/packages/osmo-query/src/codegen/ibc/core/channel/v1/channel.ts index cb4f9cded..092ee52a1 100644 --- a/packages/osmo-query/src/codegen/ibc/core/channel/v1/channel.ts +++ b/packages/osmo-query/src/codegen/ibc/core/channel/v1/channel.ts @@ -1,9 +1,9 @@ import { Height, HeightAmino, HeightSDKType } from "../../client/v1/client"; import { BinaryReader, BinaryWriter } from "../../../../binary"; -import { isSet } from "../../../../helpers"; +import { bytesFromBase64, base64FromBytes } from "../../../../helpers"; /** * State defines if a channel is in one of the following states: - * CLOSED, INIT, TRYOPEN, OPEN or UNINITIALIZED. + * CLOSED, INIT, TRYOPEN, OPEN, FLUSHING, FLUSHCOMPLETE or UNINITIALIZED. */ export enum State { /** STATE_UNINITIALIZED_UNSPECIFIED - Default State */ @@ -22,6 +22,10 @@ export enum State { * packets. */ STATE_CLOSED = 4, + /** STATE_FLUSHING - A channel has just accepted the upgrade handshake attempt and is flushing in-flight packets. */ + STATE_FLUSHING = 5, + /** STATE_FLUSHCOMPLETE - A channel has just completed flushing any in-flight packets. */ + STATE_FLUSHCOMPLETE = 6, UNRECOGNIZED = -1, } export const StateSDKType = State; @@ -43,6 +47,12 @@ export function stateFromJSON(object: any): State { case 4: case "STATE_CLOSED": return State.STATE_CLOSED; + case 5: + case "STATE_FLUSHING": + return State.STATE_FLUSHING; + case 6: + case "STATE_FLUSHCOMPLETE": + return State.STATE_FLUSHCOMPLETE; case -1: case "UNRECOGNIZED": default: @@ -61,6 +71,10 @@ export function stateToJSON(object: State): string { return "STATE_OPEN"; case State.STATE_CLOSED: return "STATE_CLOSED"; + case State.STATE_FLUSHING: + return "STATE_FLUSHING"; + case State.STATE_FLUSHCOMPLETE: + return "STATE_FLUSHCOMPLETE"; case State.UNRECOGNIZED: default: return "UNRECOGNIZED"; @@ -130,6 +144,11 @@ export interface Channel { connectionHops: string[]; /** opaque channel version, which is agreed upon during the handshake */ version: string; + /** + * upgrade sequence indicates the latest upgrade attempt performed by this channel + * the value of 0 indicates the channel has never been upgraded + */ + upgradeSequence: bigint; } export interface ChannelProtoMsg { typeUrl: "/ibc.core.channel.v1.Channel"; @@ -142,18 +161,23 @@ export interface ChannelProtoMsg { */ export interface ChannelAmino { /** current state of the channel end */ - state: State; + state?: State; /** whether the channel is ordered or unordered */ - ordering: Order; + ordering?: Order; /** counterparty channel end */ counterparty?: CounterpartyAmino; /** * list of connection identifiers, in order, along which packets sent on * this channel will travel */ - connection_hops: string[]; + connection_hops?: string[]; /** opaque channel version, which is agreed upon during the handshake */ - version: string; + version?: string; + /** + * upgrade sequence indicates the latest upgrade attempt performed by this channel + * the value of 0 indicates the channel has never been upgraded + */ + upgrade_sequence?: string; } export interface ChannelAminoMsg { type: "cosmos-sdk/Channel"; @@ -170,6 +194,7 @@ export interface ChannelSDKType { counterparty: CounterpartySDKType; connection_hops: string[]; version: string; + upgrade_sequence: bigint; } /** * IdentifiedChannel defines a channel with additional port and channel @@ -193,6 +218,11 @@ export interface IdentifiedChannel { portId: string; /** channel identifier */ channelId: string; + /** + * upgrade sequence indicates the latest upgrade attempt performed by this channel + * the value of 0 indicates the channel has never been upgraded + */ + upgradeSequence: bigint; } export interface IdentifiedChannelProtoMsg { typeUrl: "/ibc.core.channel.v1.IdentifiedChannel"; @@ -204,22 +234,27 @@ export interface IdentifiedChannelProtoMsg { */ export interface IdentifiedChannelAmino { /** current state of the channel end */ - state: State; + state?: State; /** whether the channel is ordered or unordered */ - ordering: Order; + ordering?: Order; /** counterparty channel end */ counterparty?: CounterpartyAmino; /** * list of connection identifiers, in order, along which packets sent on * this channel will travel */ - connection_hops: string[]; + connection_hops?: string[]; /** opaque channel version, which is agreed upon during the handshake */ - version: string; + version?: string; /** port identifier */ - port_id: string; + port_id?: string; /** channel identifier */ - channel_id: string; + channel_id?: string; + /** + * upgrade sequence indicates the latest upgrade attempt performed by this channel + * the value of 0 indicates the channel has never been upgraded + */ + upgrade_sequence?: string; } export interface IdentifiedChannelAminoMsg { type: "cosmos-sdk/IdentifiedChannel"; @@ -237,6 +272,7 @@ export interface IdentifiedChannelSDKType { version: string; port_id: string; channel_id: string; + upgrade_sequence: bigint; } /** Counterparty defines a channel end counterparty */ export interface Counterparty { @@ -252,9 +288,9 @@ export interface CounterpartyProtoMsg { /** Counterparty defines a channel end counterparty */ export interface CounterpartyAmino { /** port on the counterparty chain which owns the other end of the channel. */ - port_id: string; + port_id?: string; /** channel end on the counterparty chain */ - channel_id: string; + channel_id?: string; } export interface CounterpartyAminoMsg { type: "cosmos-sdk/Counterparty"; @@ -299,21 +335,21 @@ export interface PacketAmino { * with an earlier sequence number must be sent and received before a Packet * with a later sequence number. */ - sequence: string; + sequence?: string; /** identifies the port on the sending chain. */ - source_port: string; + source_port?: string; /** identifies the channel end on the sending chain. */ - source_channel: string; + source_channel?: string; /** identifies the port on the receiving chain. */ - destination_port: string; + destination_port?: string; /** identifies the channel end on the receiving chain. */ - destination_channel: string; + destination_channel?: string; /** actual opaque bytes transferred directly to the application module */ - data: Uint8Array; + data?: string; /** block height after which the packet times out */ timeout_height?: HeightAmino; /** block timestamp (in nanoseconds) after which the packet times out */ - timeout_timestamp: string; + timeout_timestamp?: string; } export interface PacketAminoMsg { type: "cosmos-sdk/Packet"; @@ -358,13 +394,13 @@ export interface PacketStateProtoMsg { */ export interface PacketStateAmino { /** channel port identifier. */ - port_id: string; + port_id?: string; /** channel unique identifier. */ - channel_id: string; + channel_id?: string; /** packet sequence. */ - sequence: string; + sequence?: string; /** embedded data that represents packet state. */ - data: Uint8Array; + data?: string; } export interface PacketStateAminoMsg { type: "cosmos-sdk/PacketState"; @@ -383,7 +419,7 @@ export interface PacketStateSDKType { data: Uint8Array; } /** - * PacketId is an identifer for a unique Packet + * PacketId is an identifier for a unique Packet * Source chains refer to packets by source port/channel * Destination chains refer to packets by destination port/channel */ @@ -400,24 +436,24 @@ export interface PacketIdProtoMsg { value: Uint8Array; } /** - * PacketId is an identifer for a unique Packet + * PacketId is an identifier for a unique Packet * Source chains refer to packets by source port/channel * Destination chains refer to packets by destination port/channel */ export interface PacketIdAmino { /** channel port identifier */ - port_id: string; + port_id?: string; /** channel unique identifier */ - channel_id: string; + channel_id?: string; /** packet sequence */ - sequence: string; + sequence?: string; } export interface PacketIdAminoMsg { type: "cosmos-sdk/PacketId"; value: PacketIdAmino; } /** - * PacketId is an identifer for a unique Packet + * PacketId is an identifier for a unique Packet * Source chains refer to packets by source port/channel * Destination chains refer to packets by destination port/channel */ @@ -453,7 +489,7 @@ export interface AcknowledgementProtoMsg { * https://github.com/cosmos/ibc/tree/master/spec/core/ics-004-channel-and-packet-semantics#acknowledgement-envelope */ export interface AcknowledgementAmino { - result?: Uint8Array; + result?: string; error?: string; } export interface AcknowledgementAminoMsg { @@ -473,13 +509,75 @@ export interface AcknowledgementSDKType { result?: Uint8Array; error?: string; } +/** + * Timeout defines an execution deadline structure for 04-channel handlers. + * This includes packet lifecycle handlers as well as the upgrade handshake handlers. + * A valid Timeout contains either one or both of a timestamp and block height (sequence). + */ +export interface Timeout { + /** block height after which the packet or upgrade times out */ + height: Height; + /** block timestamp (in nanoseconds) after which the packet or upgrade times out */ + timestamp: bigint; +} +export interface TimeoutProtoMsg { + typeUrl: "/ibc.core.channel.v1.Timeout"; + value: Uint8Array; +} +/** + * Timeout defines an execution deadline structure for 04-channel handlers. + * This includes packet lifecycle handlers as well as the upgrade handshake handlers. + * A valid Timeout contains either one or both of a timestamp and block height (sequence). + */ +export interface TimeoutAmino { + /** block height after which the packet or upgrade times out */ + height?: HeightAmino; + /** block timestamp (in nanoseconds) after which the packet or upgrade times out */ + timestamp?: string; +} +export interface TimeoutAminoMsg { + type: "cosmos-sdk/Timeout"; + value: TimeoutAmino; +} +/** + * Timeout defines an execution deadline structure for 04-channel handlers. + * This includes packet lifecycle handlers as well as the upgrade handshake handlers. + * A valid Timeout contains either one or both of a timestamp and block height (sequence). + */ +export interface TimeoutSDKType { + height: HeightSDKType; + timestamp: bigint; +} +/** Params defines the set of IBC channel parameters. */ +export interface Params { + /** the relative timeout after which channel upgrades will time out. */ + upgradeTimeout: Timeout; +} +export interface ParamsProtoMsg { + typeUrl: "/ibc.core.channel.v1.Params"; + value: Uint8Array; +} +/** Params defines the set of IBC channel parameters. */ +export interface ParamsAmino { + /** the relative timeout after which channel upgrades will time out. */ + upgrade_timeout?: TimeoutAmino; +} +export interface ParamsAminoMsg { + type: "cosmos-sdk/Params"; + value: ParamsAmino; +} +/** Params defines the set of IBC channel parameters. */ +export interface ParamsSDKType { + upgrade_timeout: TimeoutSDKType; +} function createBaseChannel(): Channel { return { state: 0, ordering: 0, counterparty: Counterparty.fromPartial({}), connectionHops: [], - version: "" + version: "", + upgradeSequence: BigInt(0) }; } export const Channel = { @@ -500,6 +598,9 @@ export const Channel = { if (message.version !== "") { writer.uint32(42).string(message.version); } + if (message.upgradeSequence !== BigInt(0)) { + writer.uint32(48).uint64(message.upgradeSequence); + } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): Channel { @@ -524,6 +625,9 @@ export const Channel = { case 5: message.version = reader.string(); break; + case 6: + message.upgradeSequence = reader.uint64(); + break; default: reader.skipType(tag & 7); break; @@ -538,21 +642,33 @@ export const Channel = { message.counterparty = object.counterparty !== undefined && object.counterparty !== null ? Counterparty.fromPartial(object.counterparty) : undefined; message.connectionHops = object.connectionHops?.map(e => e) || []; message.version = object.version ?? ""; + message.upgradeSequence = object.upgradeSequence !== undefined && object.upgradeSequence !== null ? BigInt(object.upgradeSequence.toString()) : BigInt(0); return message; }, fromAmino(object: ChannelAmino): Channel { - return { - state: isSet(object.state) ? stateFromJSON(object.state) : -1, - ordering: isSet(object.ordering) ? orderFromJSON(object.ordering) : -1, - counterparty: object?.counterparty ? Counterparty.fromAmino(object.counterparty) : undefined, - connectionHops: Array.isArray(object?.connection_hops) ? object.connection_hops.map((e: any) => e) : [], - version: object.version - }; + const message = createBaseChannel(); + if (object.state !== undefined && object.state !== null) { + message.state = stateFromJSON(object.state); + } + if (object.ordering !== undefined && object.ordering !== null) { + message.ordering = orderFromJSON(object.ordering); + } + if (object.counterparty !== undefined && object.counterparty !== null) { + message.counterparty = Counterparty.fromAmino(object.counterparty); + } + message.connectionHops = object.connection_hops?.map(e => e) || []; + if (object.version !== undefined && object.version !== null) { + message.version = object.version; + } + if (object.upgrade_sequence !== undefined && object.upgrade_sequence !== null) { + message.upgradeSequence = BigInt(object.upgrade_sequence); + } + return message; }, toAmino(message: Channel): ChannelAmino { const obj: any = {}; - obj.state = message.state; - obj.ordering = message.ordering; + obj.state = stateToJSON(message.state); + obj.ordering = orderToJSON(message.ordering); obj.counterparty = message.counterparty ? Counterparty.toAmino(message.counterparty) : undefined; if (message.connectionHops) { obj.connection_hops = message.connectionHops.map(e => e); @@ -560,6 +676,7 @@ export const Channel = { obj.connection_hops = []; } obj.version = message.version; + obj.upgrade_sequence = message.upgradeSequence ? message.upgradeSequence.toString() : undefined; return obj; }, fromAminoMsg(object: ChannelAminoMsg): Channel { @@ -592,7 +709,8 @@ function createBaseIdentifiedChannel(): IdentifiedChannel { connectionHops: [], version: "", portId: "", - channelId: "" + channelId: "", + upgradeSequence: BigInt(0) }; } export const IdentifiedChannel = { @@ -619,6 +737,9 @@ export const IdentifiedChannel = { if (message.channelId !== "") { writer.uint32(58).string(message.channelId); } + if (message.upgradeSequence !== BigInt(0)) { + writer.uint32(64).uint64(message.upgradeSequence); + } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): IdentifiedChannel { @@ -649,6 +770,9 @@ export const IdentifiedChannel = { case 7: message.channelId = reader.string(); break; + case 8: + message.upgradeSequence = reader.uint64(); + break; default: reader.skipType(tag & 7); break; @@ -665,23 +789,39 @@ export const IdentifiedChannel = { message.version = object.version ?? ""; message.portId = object.portId ?? ""; message.channelId = object.channelId ?? ""; + message.upgradeSequence = object.upgradeSequence !== undefined && object.upgradeSequence !== null ? BigInt(object.upgradeSequence.toString()) : BigInt(0); return message; }, fromAmino(object: IdentifiedChannelAmino): IdentifiedChannel { - return { - state: isSet(object.state) ? stateFromJSON(object.state) : -1, - ordering: isSet(object.ordering) ? orderFromJSON(object.ordering) : -1, - counterparty: object?.counterparty ? Counterparty.fromAmino(object.counterparty) : undefined, - connectionHops: Array.isArray(object?.connection_hops) ? object.connection_hops.map((e: any) => e) : [], - version: object.version, - portId: object.port_id, - channelId: object.channel_id - }; + const message = createBaseIdentifiedChannel(); + if (object.state !== undefined && object.state !== null) { + message.state = stateFromJSON(object.state); + } + if (object.ordering !== undefined && object.ordering !== null) { + message.ordering = orderFromJSON(object.ordering); + } + if (object.counterparty !== undefined && object.counterparty !== null) { + message.counterparty = Counterparty.fromAmino(object.counterparty); + } + message.connectionHops = object.connection_hops?.map(e => e) || []; + if (object.version !== undefined && object.version !== null) { + message.version = object.version; + } + if (object.port_id !== undefined && object.port_id !== null) { + message.portId = object.port_id; + } + if (object.channel_id !== undefined && object.channel_id !== null) { + message.channelId = object.channel_id; + } + if (object.upgrade_sequence !== undefined && object.upgrade_sequence !== null) { + message.upgradeSequence = BigInt(object.upgrade_sequence); + } + return message; }, toAmino(message: IdentifiedChannel): IdentifiedChannelAmino { const obj: any = {}; - obj.state = message.state; - obj.ordering = message.ordering; + obj.state = stateToJSON(message.state); + obj.ordering = orderToJSON(message.ordering); obj.counterparty = message.counterparty ? Counterparty.toAmino(message.counterparty) : undefined; if (message.connectionHops) { obj.connection_hops = message.connectionHops.map(e => e); @@ -691,6 +831,7 @@ export const IdentifiedChannel = { obj.version = message.version; obj.port_id = message.portId; obj.channel_id = message.channelId; + obj.upgrade_sequence = message.upgradeSequence ? message.upgradeSequence.toString() : undefined; return obj; }, fromAminoMsg(object: IdentifiedChannelAminoMsg): IdentifiedChannel { @@ -759,10 +900,14 @@ export const Counterparty = { return message; }, fromAmino(object: CounterpartyAmino): Counterparty { - return { - portId: object.port_id, - channelId: object.channel_id - }; + const message = createBaseCounterparty(); + if (object.port_id !== undefined && object.port_id !== null) { + message.portId = object.port_id; + } + if (object.channel_id !== undefined && object.channel_id !== null) { + message.channelId = object.channel_id; + } + return message; }, toAmino(message: Counterparty): CounterpartyAmino { const obj: any = {}; @@ -884,16 +1029,32 @@ export const Packet = { return message; }, fromAmino(object: PacketAmino): Packet { - return { - sequence: BigInt(object.sequence), - sourcePort: object.source_port, - sourceChannel: object.source_channel, - destinationPort: object.destination_port, - destinationChannel: object.destination_channel, - data: object.data, - timeoutHeight: object?.timeout_height ? Height.fromAmino(object.timeout_height) : undefined, - timeoutTimestamp: BigInt(object.timeout_timestamp) - }; + const message = createBasePacket(); + if (object.sequence !== undefined && object.sequence !== null) { + message.sequence = BigInt(object.sequence); + } + if (object.source_port !== undefined && object.source_port !== null) { + message.sourcePort = object.source_port; + } + if (object.source_channel !== undefined && object.source_channel !== null) { + message.sourceChannel = object.source_channel; + } + if (object.destination_port !== undefined && object.destination_port !== null) { + message.destinationPort = object.destination_port; + } + if (object.destination_channel !== undefined && object.destination_channel !== null) { + message.destinationChannel = object.destination_channel; + } + if (object.data !== undefined && object.data !== null) { + message.data = bytesFromBase64(object.data); + } + if (object.timeout_height !== undefined && object.timeout_height !== null) { + message.timeoutHeight = Height.fromAmino(object.timeout_height); + } + if (object.timeout_timestamp !== undefined && object.timeout_timestamp !== null) { + message.timeoutTimestamp = BigInt(object.timeout_timestamp); + } + return message; }, toAmino(message: Packet): PacketAmino { const obj: any = {}; @@ -902,7 +1063,7 @@ export const Packet = { obj.source_channel = message.sourceChannel; obj.destination_port = message.destinationPort; obj.destination_channel = message.destinationChannel; - obj.data = message.data; + obj.data = message.data ? base64FromBytes(message.data) : undefined; obj.timeout_height = message.timeoutHeight ? Height.toAmino(message.timeoutHeight) : {}; obj.timeout_timestamp = message.timeoutTimestamp ? message.timeoutTimestamp.toString() : undefined; return obj; @@ -989,19 +1150,27 @@ export const PacketState = { return message; }, fromAmino(object: PacketStateAmino): PacketState { - return { - portId: object.port_id, - channelId: object.channel_id, - sequence: BigInt(object.sequence), - data: object.data - }; + const message = createBasePacketState(); + if (object.port_id !== undefined && object.port_id !== null) { + message.portId = object.port_id; + } + if (object.channel_id !== undefined && object.channel_id !== null) { + message.channelId = object.channel_id; + } + if (object.sequence !== undefined && object.sequence !== null) { + message.sequence = BigInt(object.sequence); + } + if (object.data !== undefined && object.data !== null) { + message.data = bytesFromBase64(object.data); + } + return message; }, toAmino(message: PacketState): PacketStateAmino { const obj: any = {}; obj.port_id = message.portId; obj.channel_id = message.channelId; obj.sequence = message.sequence ? message.sequence.toString() : undefined; - obj.data = message.data; + obj.data = message.data ? base64FromBytes(message.data) : undefined; return obj; }, fromAminoMsg(object: PacketStateAminoMsg): PacketState { @@ -1078,11 +1247,17 @@ export const PacketId = { return message; }, fromAmino(object: PacketIdAmino): PacketId { - return { - portId: object.port_id, - channelId: object.channel_id, - sequence: BigInt(object.sequence) - }; + const message = createBasePacketId(); + if (object.port_id !== undefined && object.port_id !== null) { + message.portId = object.port_id; + } + if (object.channel_id !== undefined && object.channel_id !== null) { + message.channelId = object.channel_id; + } + if (object.sequence !== undefined && object.sequence !== null) { + message.sequence = BigInt(object.sequence); + } + return message; }, toAmino(message: PacketId): PacketIdAmino { const obj: any = {}; @@ -1157,14 +1332,18 @@ export const Acknowledgement = { return message; }, fromAmino(object: AcknowledgementAmino): Acknowledgement { - return { - result: object?.result, - error: object?.error - }; + const message = createBaseAcknowledgement(); + if (object.result !== undefined && object.result !== null) { + message.result = bytesFromBase64(object.result); + } + if (object.error !== undefined && object.error !== null) { + message.error = object.error; + } + return message; }, toAmino(message: Acknowledgement): AcknowledgementAmino { const obj: any = {}; - obj.result = message.result; + obj.result = message.result ? base64FromBytes(message.result) : undefined; obj.error = message.error; return obj; }, @@ -1189,4 +1368,154 @@ export const Acknowledgement = { value: Acknowledgement.encode(message).finish() }; } +}; +function createBaseTimeout(): Timeout { + return { + height: Height.fromPartial({}), + timestamp: BigInt(0) + }; +} +export const Timeout = { + typeUrl: "/ibc.core.channel.v1.Timeout", + encode(message: Timeout, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.height !== undefined) { + Height.encode(message.height, writer.uint32(10).fork()).ldelim(); + } + if (message.timestamp !== BigInt(0)) { + writer.uint32(16).uint64(message.timestamp); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): Timeout { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseTimeout(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.height = Height.decode(reader, reader.uint32()); + break; + case 2: + message.timestamp = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): Timeout { + const message = createBaseTimeout(); + message.height = object.height !== undefined && object.height !== null ? Height.fromPartial(object.height) : undefined; + message.timestamp = object.timestamp !== undefined && object.timestamp !== null ? BigInt(object.timestamp.toString()) : BigInt(0); + return message; + }, + fromAmino(object: TimeoutAmino): Timeout { + const message = createBaseTimeout(); + if (object.height !== undefined && object.height !== null) { + message.height = Height.fromAmino(object.height); + } + if (object.timestamp !== undefined && object.timestamp !== null) { + message.timestamp = BigInt(object.timestamp); + } + return message; + }, + toAmino(message: Timeout): TimeoutAmino { + const obj: any = {}; + obj.height = message.height ? Height.toAmino(message.height) : {}; + obj.timestamp = message.timestamp ? message.timestamp.toString() : undefined; + return obj; + }, + fromAminoMsg(object: TimeoutAminoMsg): Timeout { + return Timeout.fromAmino(object.value); + }, + toAminoMsg(message: Timeout): TimeoutAminoMsg { + return { + type: "cosmos-sdk/Timeout", + value: Timeout.toAmino(message) + }; + }, + fromProtoMsg(message: TimeoutProtoMsg): Timeout { + return Timeout.decode(message.value); + }, + toProto(message: Timeout): Uint8Array { + return Timeout.encode(message).finish(); + }, + toProtoMsg(message: Timeout): TimeoutProtoMsg { + return { + typeUrl: "/ibc.core.channel.v1.Timeout", + value: Timeout.encode(message).finish() + }; + } +}; +function createBaseParams(): Params { + return { + upgradeTimeout: Timeout.fromPartial({}) + }; +} +export const Params = { + typeUrl: "/ibc.core.channel.v1.Params", + encode(message: Params, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.upgradeTimeout !== undefined) { + Timeout.encode(message.upgradeTimeout, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): Params { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseParams(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.upgradeTimeout = Timeout.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): Params { + const message = createBaseParams(); + message.upgradeTimeout = object.upgradeTimeout !== undefined && object.upgradeTimeout !== null ? Timeout.fromPartial(object.upgradeTimeout) : undefined; + return message; + }, + fromAmino(object: ParamsAmino): Params { + const message = createBaseParams(); + if (object.upgrade_timeout !== undefined && object.upgrade_timeout !== null) { + message.upgradeTimeout = Timeout.fromAmino(object.upgrade_timeout); + } + return message; + }, + toAmino(message: Params): ParamsAmino { + const obj: any = {}; + obj.upgrade_timeout = message.upgradeTimeout ? Timeout.toAmino(message.upgradeTimeout) : undefined; + return obj; + }, + fromAminoMsg(object: ParamsAminoMsg): Params { + return Params.fromAmino(object.value); + }, + toAminoMsg(message: Params): ParamsAminoMsg { + return { + type: "cosmos-sdk/Params", + value: Params.toAmino(message) + }; + }, + fromProtoMsg(message: ParamsProtoMsg): Params { + return Params.decode(message.value); + }, + toProto(message: Params): Uint8Array { + return Params.encode(message).finish(); + }, + toProtoMsg(message: Params): ParamsProtoMsg { + return { + typeUrl: "/ibc.core.channel.v1.Params", + value: Params.encode(message).finish() + }; + } }; \ No newline at end of file diff --git a/packages/osmo-query/src/codegen/ibc/core/channel/v1/genesis.ts b/packages/osmo-query/src/codegen/ibc/core/channel/v1/genesis.ts index 122d887b8..d34112e7b 100644 --- a/packages/osmo-query/src/codegen/ibc/core/channel/v1/genesis.ts +++ b/packages/osmo-query/src/codegen/ibc/core/channel/v1/genesis.ts @@ -1,4 +1,4 @@ -import { IdentifiedChannel, IdentifiedChannelAmino, IdentifiedChannelSDKType, PacketState, PacketStateAmino, PacketStateSDKType } from "./channel"; +import { IdentifiedChannel, IdentifiedChannelAmino, IdentifiedChannelSDKType, PacketState, PacketStateAmino, PacketStateSDKType, Params, ParamsAmino, ParamsSDKType } from "./channel"; import { BinaryReader, BinaryWriter } from "../../../../binary"; /** GenesisState defines the ibc channel submodule's genesis state. */ export interface GenesisState { @@ -11,6 +11,7 @@ export interface GenesisState { ackSequences: PacketSequence[]; /** the sequence for the next generated channel identifier */ nextChannelSequence: bigint; + params: Params; } export interface GenesisStateProtoMsg { typeUrl: "/ibc.core.channel.v1.GenesisState"; @@ -18,15 +19,16 @@ export interface GenesisStateProtoMsg { } /** GenesisState defines the ibc channel submodule's genesis state. */ export interface GenesisStateAmino { - channels: IdentifiedChannelAmino[]; - acknowledgements: PacketStateAmino[]; - commitments: PacketStateAmino[]; - receipts: PacketStateAmino[]; - send_sequences: PacketSequenceAmino[]; - recv_sequences: PacketSequenceAmino[]; - ack_sequences: PacketSequenceAmino[]; + channels?: IdentifiedChannelAmino[]; + acknowledgements?: PacketStateAmino[]; + commitments?: PacketStateAmino[]; + receipts?: PacketStateAmino[]; + send_sequences?: PacketSequenceAmino[]; + recv_sequences?: PacketSequenceAmino[]; + ack_sequences?: PacketSequenceAmino[]; /** the sequence for the next generated channel identifier */ - next_channel_sequence: string; + next_channel_sequence?: string; + params?: ParamsAmino; } export interface GenesisStateAminoMsg { type: "cosmos-sdk/GenesisState"; @@ -42,6 +44,7 @@ export interface GenesisStateSDKType { recv_sequences: PacketSequenceSDKType[]; ack_sequences: PacketSequenceSDKType[]; next_channel_sequence: bigint; + params: ParamsSDKType; } /** * PacketSequence defines the genesis type necessary to retrieve and store @@ -61,9 +64,9 @@ export interface PacketSequenceProtoMsg { * next send and receive sequences. */ export interface PacketSequenceAmino { - port_id: string; - channel_id: string; - sequence: string; + port_id?: string; + channel_id?: string; + sequence?: string; } export interface PacketSequenceAminoMsg { type: "cosmos-sdk/PacketSequence"; @@ -87,7 +90,8 @@ function createBaseGenesisState(): GenesisState { sendSequences: [], recvSequences: [], ackSequences: [], - nextChannelSequence: BigInt(0) + nextChannelSequence: BigInt(0), + params: Params.fromPartial({}) }; } export const GenesisState = { @@ -117,6 +121,9 @@ export const GenesisState = { if (message.nextChannelSequence !== BigInt(0)) { writer.uint32(64).uint64(message.nextChannelSequence); } + if (message.params !== undefined) { + Params.encode(message.params, writer.uint32(74).fork()).ldelim(); + } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): GenesisState { @@ -150,6 +157,9 @@ export const GenesisState = { case 8: message.nextChannelSequence = reader.uint64(); break; + case 9: + message.params = Params.decode(reader, reader.uint32()); + break; default: reader.skipType(tag & 7); break; @@ -167,19 +177,25 @@ export const GenesisState = { message.recvSequences = object.recvSequences?.map(e => PacketSequence.fromPartial(e)) || []; message.ackSequences = object.ackSequences?.map(e => PacketSequence.fromPartial(e)) || []; message.nextChannelSequence = object.nextChannelSequence !== undefined && object.nextChannelSequence !== null ? BigInt(object.nextChannelSequence.toString()) : BigInt(0); + message.params = object.params !== undefined && object.params !== null ? Params.fromPartial(object.params) : undefined; return message; }, fromAmino(object: GenesisStateAmino): GenesisState { - return { - channels: Array.isArray(object?.channels) ? object.channels.map((e: any) => IdentifiedChannel.fromAmino(e)) : [], - acknowledgements: Array.isArray(object?.acknowledgements) ? object.acknowledgements.map((e: any) => PacketState.fromAmino(e)) : [], - commitments: Array.isArray(object?.commitments) ? object.commitments.map((e: any) => PacketState.fromAmino(e)) : [], - receipts: Array.isArray(object?.receipts) ? object.receipts.map((e: any) => PacketState.fromAmino(e)) : [], - sendSequences: Array.isArray(object?.send_sequences) ? object.send_sequences.map((e: any) => PacketSequence.fromAmino(e)) : [], - recvSequences: Array.isArray(object?.recv_sequences) ? object.recv_sequences.map((e: any) => PacketSequence.fromAmino(e)) : [], - ackSequences: Array.isArray(object?.ack_sequences) ? object.ack_sequences.map((e: any) => PacketSequence.fromAmino(e)) : [], - nextChannelSequence: BigInt(object.next_channel_sequence) - }; + const message = createBaseGenesisState(); + message.channels = object.channels?.map(e => IdentifiedChannel.fromAmino(e)) || []; + message.acknowledgements = object.acknowledgements?.map(e => PacketState.fromAmino(e)) || []; + message.commitments = object.commitments?.map(e => PacketState.fromAmino(e)) || []; + message.receipts = object.receipts?.map(e => PacketState.fromAmino(e)) || []; + message.sendSequences = object.send_sequences?.map(e => PacketSequence.fromAmino(e)) || []; + message.recvSequences = object.recv_sequences?.map(e => PacketSequence.fromAmino(e)) || []; + message.ackSequences = object.ack_sequences?.map(e => PacketSequence.fromAmino(e)) || []; + if (object.next_channel_sequence !== undefined && object.next_channel_sequence !== null) { + message.nextChannelSequence = BigInt(object.next_channel_sequence); + } + if (object.params !== undefined && object.params !== null) { + message.params = Params.fromAmino(object.params); + } + return message; }, toAmino(message: GenesisState): GenesisStateAmino { const obj: any = {}; @@ -219,6 +235,7 @@ export const GenesisState = { obj.ack_sequences = []; } obj.next_channel_sequence = message.nextChannelSequence ? message.nextChannelSequence.toString() : undefined; + obj.params = message.params ? Params.toAmino(message.params) : undefined; return obj; }, fromAminoMsg(object: GenesisStateAminoMsg): GenesisState { @@ -295,11 +312,17 @@ export const PacketSequence = { return message; }, fromAmino(object: PacketSequenceAmino): PacketSequence { - return { - portId: object.port_id, - channelId: object.channel_id, - sequence: BigInt(object.sequence) - }; + const message = createBasePacketSequence(); + if (object.port_id !== undefined && object.port_id !== null) { + message.portId = object.port_id; + } + if (object.channel_id !== undefined && object.channel_id !== null) { + message.channelId = object.channel_id; + } + if (object.sequence !== undefined && object.sequence !== null) { + message.sequence = BigInt(object.sequence); + } + return message; }, toAmino(message: PacketSequence): PacketSequenceAmino { const obj: any = {}; diff --git a/packages/osmo-query/src/codegen/ibc/core/channel/v1/query.lcd.ts b/packages/osmo-query/src/codegen/ibc/core/channel/v1/query.lcd.ts index 758cdbf1d..d94588a3e 100644 --- a/packages/osmo-query/src/codegen/ibc/core/channel/v1/query.lcd.ts +++ b/packages/osmo-query/src/codegen/ibc/core/channel/v1/query.lcd.ts @@ -1,6 +1,6 @@ import { setPaginationParams } from "../../../../helpers"; import { LCDClient } from "@cosmology/lcd"; -import { QueryChannelRequest, QueryChannelResponseSDKType, QueryChannelsRequest, QueryChannelsResponseSDKType, QueryConnectionChannelsRequest, QueryConnectionChannelsResponseSDKType, QueryChannelClientStateRequest, QueryChannelClientStateResponseSDKType, QueryChannelConsensusStateRequest, QueryChannelConsensusStateResponseSDKType, QueryPacketCommitmentRequest, QueryPacketCommitmentResponseSDKType, QueryPacketCommitmentsRequest, QueryPacketCommitmentsResponseSDKType, QueryPacketReceiptRequest, QueryPacketReceiptResponseSDKType, QueryPacketAcknowledgementRequest, QueryPacketAcknowledgementResponseSDKType, QueryPacketAcknowledgementsRequest, QueryPacketAcknowledgementsResponseSDKType, QueryUnreceivedPacketsRequest, QueryUnreceivedPacketsResponseSDKType, QueryUnreceivedAcksRequest, QueryUnreceivedAcksResponseSDKType, QueryNextSequenceReceiveRequest, QueryNextSequenceReceiveResponseSDKType } from "./query"; +import { QueryChannelRequest, QueryChannelResponseSDKType, QueryChannelsRequest, QueryChannelsResponseSDKType, QueryConnectionChannelsRequest, QueryConnectionChannelsResponseSDKType, QueryChannelClientStateRequest, QueryChannelClientStateResponseSDKType, QueryChannelConsensusStateRequest, QueryChannelConsensusStateResponseSDKType, QueryPacketCommitmentRequest, QueryPacketCommitmentResponseSDKType, QueryPacketCommitmentsRequest, QueryPacketCommitmentsResponseSDKType, QueryPacketReceiptRequest, QueryPacketReceiptResponseSDKType, QueryPacketAcknowledgementRequest, QueryPacketAcknowledgementResponseSDKType, QueryPacketAcknowledgementsRequest, QueryPacketAcknowledgementsResponseSDKType, QueryUnreceivedPacketsRequest, QueryUnreceivedPacketsResponseSDKType, QueryUnreceivedAcksRequest, QueryUnreceivedAcksResponseSDKType, QueryNextSequenceReceiveRequest, QueryNextSequenceReceiveResponseSDKType, QueryNextSequenceSendRequest, QueryNextSequenceSendResponseSDKType, QueryUpgradeErrorRequest, QueryUpgradeErrorResponseSDKType, QueryUpgradeRequest, QueryUpgradeResponseSDKType, QueryChannelParamsRequest, QueryChannelParamsResponseSDKType } from "./query"; export class LCDQueryClient { req: LCDClient; constructor({ @@ -22,6 +22,10 @@ export class LCDQueryClient { this.unreceivedPackets = this.unreceivedPackets.bind(this); this.unreceivedAcks = this.unreceivedAcks.bind(this); this.nextSequenceReceive = this.nextSequenceReceive.bind(this); + this.nextSequenceSend = this.nextSequenceSend.bind(this); + this.upgradeError = this.upgradeError.bind(this); + this.upgrade = this.upgrade.bind(this); + this.channelParams = this.channelParams.bind(this); } /* Channel queries an IBC Channel. */ async channel(params: QueryChannelRequest): Promise { @@ -125,4 +129,24 @@ export class LCDQueryClient { const endpoint = `ibc/core/channel/v1/channels/${params.channelId}/ports/${params.portId}/next_sequence`; return await this.req.get(endpoint); } + /* NextSequenceSend returns the next send sequence for a given channel. */ + async nextSequenceSend(params: QueryNextSequenceSendRequest): Promise { + const endpoint = `ibc/core/channel/v1/channels/${params.channelId}/ports/${params.portId}/next_sequence_send`; + return await this.req.get(endpoint); + } + /* UpgradeError returns the error receipt if the upgrade handshake failed. */ + async upgradeError(params: QueryUpgradeErrorRequest): Promise { + const endpoint = `ibc/core/channel/v1/channels/${params.channelId}/ports/${params.portId}/upgrade_error`; + return await this.req.get(endpoint); + } + /* Upgrade returns the upgrade for a given port and channel id. */ + async upgrade(params: QueryUpgradeRequest): Promise { + const endpoint = `ibc/core/channel/v1/channels/${params.channelId}/ports/${params.portId}/upgrade`; + return await this.req.get(endpoint); + } + /* ChannelParams queries all parameters of the ibc channel submodule. */ + async channelParams(_params: QueryChannelParamsRequest = {}): Promise { + const endpoint = `ibc/core/channel/v1/params`; + return await this.req.get(endpoint); + } } \ No newline at end of file diff --git a/packages/osmo-query/src/codegen/ibc/core/channel/v1/query.rpc.Query.ts b/packages/osmo-query/src/codegen/ibc/core/channel/v1/query.rpc.Query.ts index d0e52dd25..e7af6713c 100644 --- a/packages/osmo-query/src/codegen/ibc/core/channel/v1/query.rpc.Query.ts +++ b/packages/osmo-query/src/codegen/ibc/core/channel/v1/query.rpc.Query.ts @@ -3,7 +3,7 @@ import { BinaryReader } from "../../../../binary"; import { QueryClient, createProtobufRpcClient, ProtobufRpcClient } from "@cosmjs/stargate"; import { ReactQueryParams } from "../../../../react-query"; import { useQuery } from "@tanstack/react-query"; -import { QueryChannelRequest, QueryChannelResponse, QueryChannelsRequest, QueryChannelsResponse, QueryConnectionChannelsRequest, QueryConnectionChannelsResponse, QueryChannelClientStateRequest, QueryChannelClientStateResponse, QueryChannelConsensusStateRequest, QueryChannelConsensusStateResponse, QueryPacketCommitmentRequest, QueryPacketCommitmentResponse, QueryPacketCommitmentsRequest, QueryPacketCommitmentsResponse, QueryPacketReceiptRequest, QueryPacketReceiptResponse, QueryPacketAcknowledgementRequest, QueryPacketAcknowledgementResponse, QueryPacketAcknowledgementsRequest, QueryPacketAcknowledgementsResponse, QueryUnreceivedPacketsRequest, QueryUnreceivedPacketsResponse, QueryUnreceivedAcksRequest, QueryUnreceivedAcksResponse, QueryNextSequenceReceiveRequest, QueryNextSequenceReceiveResponse } from "./query"; +import { QueryChannelRequest, QueryChannelResponse, QueryChannelsRequest, QueryChannelsResponse, QueryConnectionChannelsRequest, QueryConnectionChannelsResponse, QueryChannelClientStateRequest, QueryChannelClientStateResponse, QueryChannelConsensusStateRequest, QueryChannelConsensusStateResponse, QueryPacketCommitmentRequest, QueryPacketCommitmentResponse, QueryPacketCommitmentsRequest, QueryPacketCommitmentsResponse, QueryPacketReceiptRequest, QueryPacketReceiptResponse, QueryPacketAcknowledgementRequest, QueryPacketAcknowledgementResponse, QueryPacketAcknowledgementsRequest, QueryPacketAcknowledgementsResponse, QueryUnreceivedPacketsRequest, QueryUnreceivedPacketsResponse, QueryUnreceivedAcksRequest, QueryUnreceivedAcksResponse, QueryNextSequenceReceiveRequest, QueryNextSequenceReceiveResponse, QueryNextSequenceSendRequest, QueryNextSequenceSendResponse, QueryUpgradeErrorRequest, QueryUpgradeErrorResponse, QueryUpgradeRequest, QueryUpgradeResponse, QueryChannelParamsRequest, QueryChannelParamsResponse } from "./query"; /** Query provides defines the gRPC querier service */ export interface Query { /** Channel queries an IBC Channel. */ @@ -56,6 +56,14 @@ export interface Query { unreceivedAcks(request: QueryUnreceivedAcksRequest): Promise; /** NextSequenceReceive returns the next receive sequence for a given channel. */ nextSequenceReceive(request: QueryNextSequenceReceiveRequest): Promise; + /** NextSequenceSend returns the next send sequence for a given channel. */ + nextSequenceSend(request: QueryNextSequenceSendRequest): Promise; + /** UpgradeError returns the error receipt if the upgrade handshake failed. */ + upgradeError(request: QueryUpgradeErrorRequest): Promise; + /** Upgrade returns the upgrade for a given port and channel id. */ + upgrade(request: QueryUpgradeRequest): Promise; + /** ChannelParams queries all parameters of the ibc channel submodule. */ + channelParams(request?: QueryChannelParamsRequest): Promise; } export class QueryClientImpl implements Query { private readonly rpc: Rpc; @@ -74,6 +82,10 @@ export class QueryClientImpl implements Query { this.unreceivedPackets = this.unreceivedPackets.bind(this); this.unreceivedAcks = this.unreceivedAcks.bind(this); this.nextSequenceReceive = this.nextSequenceReceive.bind(this); + this.nextSequenceSend = this.nextSequenceSend.bind(this); + this.upgradeError = this.upgradeError.bind(this); + this.upgrade = this.upgrade.bind(this); + this.channelParams = this.channelParams.bind(this); } channel(request: QueryChannelRequest): Promise { const data = QueryChannelRequest.encode(request).finish(); @@ -142,6 +154,26 @@ export class QueryClientImpl implements Query { const promise = this.rpc.request("ibc.core.channel.v1.Query", "NextSequenceReceive", data); return promise.then(data => QueryNextSequenceReceiveResponse.decode(new BinaryReader(data))); } + nextSequenceSend(request: QueryNextSequenceSendRequest): Promise { + const data = QueryNextSequenceSendRequest.encode(request).finish(); + const promise = this.rpc.request("ibc.core.channel.v1.Query", "NextSequenceSend", data); + return promise.then(data => QueryNextSequenceSendResponse.decode(new BinaryReader(data))); + } + upgradeError(request: QueryUpgradeErrorRequest): Promise { + const data = QueryUpgradeErrorRequest.encode(request).finish(); + const promise = this.rpc.request("ibc.core.channel.v1.Query", "UpgradeError", data); + return promise.then(data => QueryUpgradeErrorResponse.decode(new BinaryReader(data))); + } + upgrade(request: QueryUpgradeRequest): Promise { + const data = QueryUpgradeRequest.encode(request).finish(); + const promise = this.rpc.request("ibc.core.channel.v1.Query", "Upgrade", data); + return promise.then(data => QueryUpgradeResponse.decode(new BinaryReader(data))); + } + channelParams(request: QueryChannelParamsRequest = {}): Promise { + const data = QueryChannelParamsRequest.encode(request).finish(); + const promise = this.rpc.request("ibc.core.channel.v1.Query", "ChannelParams", data); + return promise.then(data => QueryChannelParamsResponse.decode(new BinaryReader(data))); + } } export const createRpcQueryExtension = (base: QueryClient) => { const rpc = createProtobufRpcClient(base); @@ -185,6 +217,18 @@ export const createRpcQueryExtension = (base: QueryClient) => { }, nextSequenceReceive(request: QueryNextSequenceReceiveRequest): Promise { return queryService.nextSequenceReceive(request); + }, + nextSequenceSend(request: QueryNextSequenceSendRequest): Promise { + return queryService.nextSequenceSend(request); + }, + upgradeError(request: QueryUpgradeErrorRequest): Promise { + return queryService.upgradeError(request); + }, + upgrade(request: QueryUpgradeRequest): Promise { + return queryService.upgrade(request); + }, + channelParams(request?: QueryChannelParamsRequest): Promise { + return queryService.channelParams(request); } }; }; @@ -227,6 +271,18 @@ export interface UseUnreceivedAcksQuery extends ReactQueryParams extends ReactQueryParams { request: QueryNextSequenceReceiveRequest; } +export interface UseNextSequenceSendQuery extends ReactQueryParams { + request: QueryNextSequenceSendRequest; +} +export interface UseUpgradeErrorQuery extends ReactQueryParams { + request: QueryUpgradeErrorRequest; +} +export interface UseUpgradeQuery extends ReactQueryParams { + request: QueryUpgradeRequest; +} +export interface UseChannelParamsQuery extends ReactQueryParams { + request?: QueryChannelParamsRequest; +} const _queryClients: WeakMap = new WeakMap(); const getQueryService = (rpc: ProtobufRpcClient | undefined): QueryClientImpl | undefined => { if (!rpc) return; @@ -356,6 +412,42 @@ export const createRpcQueryHooks = (rpc: ProtobufRpcClient | undefined) => { return queryService.nextSequenceReceive(request); }, options); }; + const useNextSequenceSend = ({ + request, + options + }: UseNextSequenceSendQuery) => { + return useQuery(["nextSequenceSendQuery", request], () => { + if (!queryService) throw new Error("Query Service not initialized"); + return queryService.nextSequenceSend(request); + }, options); + }; + const useUpgradeError = ({ + request, + options + }: UseUpgradeErrorQuery) => { + return useQuery(["upgradeErrorQuery", request], () => { + if (!queryService) throw new Error("Query Service not initialized"); + return queryService.upgradeError(request); + }, options); + }; + const useUpgrade = ({ + request, + options + }: UseUpgradeQuery) => { + return useQuery(["upgradeQuery", request], () => { + if (!queryService) throw new Error("Query Service not initialized"); + return queryService.upgrade(request); + }, options); + }; + const useChannelParams = ({ + request, + options + }: UseChannelParamsQuery) => { + return useQuery(["channelParamsQuery", request], () => { + if (!queryService) throw new Error("Query Service not initialized"); + return queryService.channelParams(request); + }, options); + }; return { /** Channel queries an IBC Channel. */useChannel, /** Channels queries all the IBC channels of a chain. */useChannels, @@ -401,6 +493,10 @@ export const createRpcQueryHooks = (rpc: ProtobufRpcClient | undefined) => { * with a channel and sequences. */ useUnreceivedAcks, - /** NextSequenceReceive returns the next receive sequence for a given channel. */useNextSequenceReceive + /** NextSequenceReceive returns the next receive sequence for a given channel. */useNextSequenceReceive, + /** NextSequenceSend returns the next send sequence for a given channel. */useNextSequenceSend, + /** UpgradeError returns the error receipt if the upgrade handshake failed. */useUpgradeError, + /** Upgrade returns the upgrade for a given port and channel id. */useUpgrade, + /** ChannelParams queries all parameters of the ibc channel submodule. */useChannelParams }; }; \ No newline at end of file diff --git a/packages/osmo-query/src/codegen/ibc/core/channel/v1/query.ts b/packages/osmo-query/src/codegen/ibc/core/channel/v1/query.ts index 7ef1ca489..5d2351893 100644 --- a/packages/osmo-query/src/codegen/ibc/core/channel/v1/query.ts +++ b/packages/osmo-query/src/codegen/ibc/core/channel/v1/query.ts @@ -1,8 +1,10 @@ import { PageRequest, PageRequestAmino, PageRequestSDKType, PageResponse, PageResponseAmino, PageResponseSDKType } from "../../../../cosmos/base/query/v1beta1/pagination"; import { Channel, ChannelAmino, ChannelSDKType, IdentifiedChannel, IdentifiedChannelAmino, IdentifiedChannelSDKType, PacketState, PacketStateAmino, PacketStateSDKType } from "./channel"; -import { Height, HeightAmino, HeightSDKType, IdentifiedClientState, IdentifiedClientStateAmino, IdentifiedClientStateSDKType } from "../../client/v1/client"; +import { Height, HeightAmino, HeightSDKType, IdentifiedClientState, IdentifiedClientStateAmino, IdentifiedClientStateSDKType, Params, ParamsAmino, ParamsSDKType } from "../../client/v1/client"; import { Any, AnyAmino, AnySDKType } from "../../../../google/protobuf/any"; +import { ErrorReceipt, ErrorReceiptAmino, ErrorReceiptSDKType, Upgrade, UpgradeAmino, UpgradeSDKType } from "./upgrade"; import { BinaryReader, BinaryWriter } from "../../../../binary"; +import { bytesFromBase64, base64FromBytes } from "../../../../helpers"; /** QueryChannelRequest is the request type for the Query/Channel RPC method */ export interface QueryChannelRequest { /** port unique identifier */ @@ -17,9 +19,9 @@ export interface QueryChannelRequestProtoMsg { /** QueryChannelRequest is the request type for the Query/Channel RPC method */ export interface QueryChannelRequestAmino { /** port unique identifier */ - port_id: string; + port_id?: string; /** channel unique identifier */ - channel_id: string; + channel_id?: string; } export interface QueryChannelRequestAminoMsg { type: "cosmos-sdk/QueryChannelRequest"; @@ -37,7 +39,7 @@ export interface QueryChannelRequestSDKType { */ export interface QueryChannelResponse { /** channel associated with the request identifiers */ - channel: Channel; + channel?: Channel; /** merkle proof of existence */ proof: Uint8Array; /** height at which the proof was retrieved */ @@ -56,7 +58,7 @@ export interface QueryChannelResponseAmino { /** channel associated with the request identifiers */ channel?: ChannelAmino; /** merkle proof of existence */ - proof: Uint8Array; + proof?: string; /** height at which the proof was retrieved */ proof_height?: HeightAmino; } @@ -70,14 +72,14 @@ export interface QueryChannelResponseAminoMsg { * proof was retrieved. */ export interface QueryChannelResponseSDKType { - channel: ChannelSDKType; + channel?: ChannelSDKType; proof: Uint8Array; proof_height: HeightSDKType; } /** QueryChannelsRequest is the request type for the Query/Channels RPC method */ export interface QueryChannelsRequest { /** pagination request */ - pagination: PageRequest; + pagination?: PageRequest; } export interface QueryChannelsRequestProtoMsg { typeUrl: "/ibc.core.channel.v1.QueryChannelsRequest"; @@ -94,14 +96,14 @@ export interface QueryChannelsRequestAminoMsg { } /** QueryChannelsRequest is the request type for the Query/Channels RPC method */ export interface QueryChannelsRequestSDKType { - pagination: PageRequestSDKType; + pagination?: PageRequestSDKType; } /** QueryChannelsResponse is the response type for the Query/Channels RPC method. */ export interface QueryChannelsResponse { /** list of stored channels of the chain. */ channels: IdentifiedChannel[]; /** pagination response */ - pagination: PageResponse; + pagination?: PageResponse; /** query block height */ height: Height; } @@ -112,7 +114,7 @@ export interface QueryChannelsResponseProtoMsg { /** QueryChannelsResponse is the response type for the Query/Channels RPC method. */ export interface QueryChannelsResponseAmino { /** list of stored channels of the chain. */ - channels: IdentifiedChannelAmino[]; + channels?: IdentifiedChannelAmino[]; /** pagination response */ pagination?: PageResponseAmino; /** query block height */ @@ -125,7 +127,7 @@ export interface QueryChannelsResponseAminoMsg { /** QueryChannelsResponse is the response type for the Query/Channels RPC method. */ export interface QueryChannelsResponseSDKType { channels: IdentifiedChannelSDKType[]; - pagination: PageResponseSDKType; + pagination?: PageResponseSDKType; height: HeightSDKType; } /** @@ -136,7 +138,7 @@ export interface QueryConnectionChannelsRequest { /** connection unique identifier */ connection: string; /** pagination request */ - pagination: PageRequest; + pagination?: PageRequest; } export interface QueryConnectionChannelsRequestProtoMsg { typeUrl: "/ibc.core.channel.v1.QueryConnectionChannelsRequest"; @@ -148,7 +150,7 @@ export interface QueryConnectionChannelsRequestProtoMsg { */ export interface QueryConnectionChannelsRequestAmino { /** connection unique identifier */ - connection: string; + connection?: string; /** pagination request */ pagination?: PageRequestAmino; } @@ -162,7 +164,7 @@ export interface QueryConnectionChannelsRequestAminoMsg { */ export interface QueryConnectionChannelsRequestSDKType { connection: string; - pagination: PageRequestSDKType; + pagination?: PageRequestSDKType; } /** * QueryConnectionChannelsResponse is the Response type for the @@ -172,7 +174,7 @@ export interface QueryConnectionChannelsResponse { /** list of channels associated with a connection. */ channels: IdentifiedChannel[]; /** pagination response */ - pagination: PageResponse; + pagination?: PageResponse; /** query block height */ height: Height; } @@ -186,7 +188,7 @@ export interface QueryConnectionChannelsResponseProtoMsg { */ export interface QueryConnectionChannelsResponseAmino { /** list of channels associated with a connection. */ - channels: IdentifiedChannelAmino[]; + channels?: IdentifiedChannelAmino[]; /** pagination response */ pagination?: PageResponseAmino; /** query block height */ @@ -202,7 +204,7 @@ export interface QueryConnectionChannelsResponseAminoMsg { */ export interface QueryConnectionChannelsResponseSDKType { channels: IdentifiedChannelSDKType[]; - pagination: PageResponseSDKType; + pagination?: PageResponseSDKType; height: HeightSDKType; } /** @@ -225,9 +227,9 @@ export interface QueryChannelClientStateRequestProtoMsg { */ export interface QueryChannelClientStateRequestAmino { /** port unique identifier */ - port_id: string; + port_id?: string; /** channel unique identifier */ - channel_id: string; + channel_id?: string; } export interface QueryChannelClientStateRequestAminoMsg { type: "cosmos-sdk/QueryChannelClientStateRequest"; @@ -247,7 +249,7 @@ export interface QueryChannelClientStateRequestSDKType { */ export interface QueryChannelClientStateResponse { /** client state associated with the channel */ - identifiedClientState: IdentifiedClientState; + identifiedClientState?: IdentifiedClientState; /** merkle proof of existence */ proof: Uint8Array; /** height at which the proof was retrieved */ @@ -265,7 +267,7 @@ export interface QueryChannelClientStateResponseAmino { /** client state associated with the channel */ identified_client_state?: IdentifiedClientStateAmino; /** merkle proof of existence */ - proof: Uint8Array; + proof?: string; /** height at which the proof was retrieved */ proof_height?: HeightAmino; } @@ -278,7 +280,7 @@ export interface QueryChannelClientStateResponseAminoMsg { * Query/QueryChannelClientState RPC method */ export interface QueryChannelClientStateResponseSDKType { - identified_client_state: IdentifiedClientStateSDKType; + identified_client_state?: IdentifiedClientStateSDKType; proof: Uint8Array; proof_height: HeightSDKType; } @@ -306,13 +308,13 @@ export interface QueryChannelConsensusStateRequestProtoMsg { */ export interface QueryChannelConsensusStateRequestAmino { /** port unique identifier */ - port_id: string; + port_id?: string; /** channel unique identifier */ - channel_id: string; + channel_id?: string; /** revision number of the consensus state */ - revision_number: string; + revision_number?: string; /** revision height of the consensus state */ - revision_height: string; + revision_height?: string; } export interface QueryChannelConsensusStateRequestAminoMsg { type: "cosmos-sdk/QueryChannelConsensusStateRequest"; @@ -334,7 +336,7 @@ export interface QueryChannelConsensusStateRequestSDKType { */ export interface QueryChannelConsensusStateResponse { /** consensus state associated with the channel */ - consensusState: Any; + consensusState?: Any; /** client ID associated with the consensus state */ clientId: string; /** merkle proof of existence */ @@ -354,9 +356,9 @@ export interface QueryChannelConsensusStateResponseAmino { /** consensus state associated with the channel */ consensus_state?: AnyAmino; /** client ID associated with the consensus state */ - client_id: string; + client_id?: string; /** merkle proof of existence */ - proof: Uint8Array; + proof?: string; /** height at which the proof was retrieved */ proof_height?: HeightAmino; } @@ -369,7 +371,7 @@ export interface QueryChannelConsensusStateResponseAminoMsg { * Query/QueryChannelClientState RPC method */ export interface QueryChannelConsensusStateResponseSDKType { - consensus_state: AnySDKType; + consensus_state?: AnySDKType; client_id: string; proof: Uint8Array; proof_height: HeightSDKType; @@ -396,11 +398,11 @@ export interface QueryPacketCommitmentRequestProtoMsg { */ export interface QueryPacketCommitmentRequestAmino { /** port unique identifier */ - port_id: string; + port_id?: string; /** channel unique identifier */ - channel_id: string; + channel_id?: string; /** packet sequence */ - sequence: string; + sequence?: string; } export interface QueryPacketCommitmentRequestAminoMsg { type: "cosmos-sdk/QueryPacketCommitmentRequest"; @@ -439,9 +441,9 @@ export interface QueryPacketCommitmentResponseProtoMsg { */ export interface QueryPacketCommitmentResponseAmino { /** packet associated with the request fields */ - commitment: Uint8Array; + commitment?: string; /** merkle proof of existence */ - proof: Uint8Array; + proof?: string; /** height at which the proof was retrieved */ proof_height?: HeightAmino; } @@ -469,7 +471,7 @@ export interface QueryPacketCommitmentsRequest { /** channel unique identifier */ channelId: string; /** pagination request */ - pagination: PageRequest; + pagination?: PageRequest; } export interface QueryPacketCommitmentsRequestProtoMsg { typeUrl: "/ibc.core.channel.v1.QueryPacketCommitmentsRequest"; @@ -481,9 +483,9 @@ export interface QueryPacketCommitmentsRequestProtoMsg { */ export interface QueryPacketCommitmentsRequestAmino { /** port unique identifier */ - port_id: string; + port_id?: string; /** channel unique identifier */ - channel_id: string; + channel_id?: string; /** pagination request */ pagination?: PageRequestAmino; } @@ -498,7 +500,7 @@ export interface QueryPacketCommitmentsRequestAminoMsg { export interface QueryPacketCommitmentsRequestSDKType { port_id: string; channel_id: string; - pagination: PageRequestSDKType; + pagination?: PageRequestSDKType; } /** * QueryPacketCommitmentsResponse is the request type for the @@ -507,7 +509,7 @@ export interface QueryPacketCommitmentsRequestSDKType { export interface QueryPacketCommitmentsResponse { commitments: PacketState[]; /** pagination response */ - pagination: PageResponse; + pagination?: PageResponse; /** query block height */ height: Height; } @@ -520,7 +522,7 @@ export interface QueryPacketCommitmentsResponseProtoMsg { * Query/QueryPacketCommitments RPC method */ export interface QueryPacketCommitmentsResponseAmino { - commitments: PacketStateAmino[]; + commitments?: PacketStateAmino[]; /** pagination response */ pagination?: PageResponseAmino; /** query block height */ @@ -536,7 +538,7 @@ export interface QueryPacketCommitmentsResponseAminoMsg { */ export interface QueryPacketCommitmentsResponseSDKType { commitments: PacketStateSDKType[]; - pagination: PageResponseSDKType; + pagination?: PageResponseSDKType; height: HeightSDKType; } /** @@ -561,11 +563,11 @@ export interface QueryPacketReceiptRequestProtoMsg { */ export interface QueryPacketReceiptRequestAmino { /** port unique identifier */ - port_id: string; + port_id?: string; /** channel unique identifier */ - channel_id: string; + channel_id?: string; /** packet sequence */ - sequence: string; + sequence?: string; } export interface QueryPacketReceiptRequestAminoMsg { type: "cosmos-sdk/QueryPacketReceiptRequest"; @@ -604,9 +606,9 @@ export interface QueryPacketReceiptResponseProtoMsg { */ export interface QueryPacketReceiptResponseAmino { /** success flag for if receipt exists */ - received: boolean; + received?: boolean; /** merkle proof of existence */ - proof: Uint8Array; + proof?: string; /** height at which the proof was retrieved */ proof_height?: HeightAmino; } @@ -646,11 +648,11 @@ export interface QueryPacketAcknowledgementRequestProtoMsg { */ export interface QueryPacketAcknowledgementRequestAmino { /** port unique identifier */ - port_id: string; + port_id?: string; /** channel unique identifier */ - channel_id: string; + channel_id?: string; /** packet sequence */ - sequence: string; + sequence?: string; } export interface QueryPacketAcknowledgementRequestAminoMsg { type: "cosmos-sdk/QueryPacketAcknowledgementRequest"; @@ -689,9 +691,9 @@ export interface QueryPacketAcknowledgementResponseProtoMsg { */ export interface QueryPacketAcknowledgementResponseAmino { /** packet associated with the request fields */ - acknowledgement: Uint8Array; + acknowledgement?: string; /** merkle proof of existence */ - proof: Uint8Array; + proof?: string; /** height at which the proof was retrieved */ proof_height?: HeightAmino; } @@ -719,7 +721,7 @@ export interface QueryPacketAcknowledgementsRequest { /** channel unique identifier */ channelId: string; /** pagination request */ - pagination: PageRequest; + pagination?: PageRequest; /** list of packet sequences */ packetCommitmentSequences: bigint[]; } @@ -733,13 +735,13 @@ export interface QueryPacketAcknowledgementsRequestProtoMsg { */ export interface QueryPacketAcknowledgementsRequestAmino { /** port unique identifier */ - port_id: string; + port_id?: string; /** channel unique identifier */ - channel_id: string; + channel_id?: string; /** pagination request */ pagination?: PageRequestAmino; /** list of packet sequences */ - packet_commitment_sequences: string[]; + packet_commitment_sequences?: string[]; } export interface QueryPacketAcknowledgementsRequestAminoMsg { type: "cosmos-sdk/QueryPacketAcknowledgementsRequest"; @@ -752,7 +754,7 @@ export interface QueryPacketAcknowledgementsRequestAminoMsg { export interface QueryPacketAcknowledgementsRequestSDKType { port_id: string; channel_id: string; - pagination: PageRequestSDKType; + pagination?: PageRequestSDKType; packet_commitment_sequences: bigint[]; } /** @@ -762,7 +764,7 @@ export interface QueryPacketAcknowledgementsRequestSDKType { export interface QueryPacketAcknowledgementsResponse { acknowledgements: PacketState[]; /** pagination response */ - pagination: PageResponse; + pagination?: PageResponse; /** query block height */ height: Height; } @@ -775,7 +777,7 @@ export interface QueryPacketAcknowledgementsResponseProtoMsg { * Query/QueryPacketAcknowledgements RPC method */ export interface QueryPacketAcknowledgementsResponseAmino { - acknowledgements: PacketStateAmino[]; + acknowledgements?: PacketStateAmino[]; /** pagination response */ pagination?: PageResponseAmino; /** query block height */ @@ -791,7 +793,7 @@ export interface QueryPacketAcknowledgementsResponseAminoMsg { */ export interface QueryPacketAcknowledgementsResponseSDKType { acknowledgements: PacketStateSDKType[]; - pagination: PageResponseSDKType; + pagination?: PageResponseSDKType; height: HeightSDKType; } /** @@ -816,11 +818,11 @@ export interface QueryUnreceivedPacketsRequestProtoMsg { */ export interface QueryUnreceivedPacketsRequestAmino { /** port unique identifier */ - port_id: string; + port_id?: string; /** channel unique identifier */ - channel_id: string; + channel_id?: string; /** list of packet sequences */ - packet_commitment_sequences: string[]; + packet_commitment_sequences?: string[]; } export interface QueryUnreceivedPacketsRequestAminoMsg { type: "cosmos-sdk/QueryUnreceivedPacketsRequest"; @@ -855,7 +857,7 @@ export interface QueryUnreceivedPacketsResponseProtoMsg { */ export interface QueryUnreceivedPacketsResponseAmino { /** list of unreceived packet sequences */ - sequences: string[]; + sequences?: string[]; /** query block height */ height?: HeightAmino; } @@ -893,11 +895,11 @@ export interface QueryUnreceivedAcksRequestProtoMsg { */ export interface QueryUnreceivedAcksRequestAmino { /** port unique identifier */ - port_id: string; + port_id?: string; /** channel unique identifier */ - channel_id: string; + channel_id?: string; /** list of acknowledgement sequences */ - packet_ack_sequences: string[]; + packet_ack_sequences?: string[]; } export interface QueryUnreceivedAcksRequestAminoMsg { type: "cosmos-sdk/QueryUnreceivedAcksRequest"; @@ -932,7 +934,7 @@ export interface QueryUnreceivedAcksResponseProtoMsg { */ export interface QueryUnreceivedAcksResponseAmino { /** list of unreceived acknowledgement sequences */ - sequences: string[]; + sequences?: string[]; /** query block height */ height?: HeightAmino; } @@ -968,9 +970,9 @@ export interface QueryNextSequenceReceiveRequestProtoMsg { */ export interface QueryNextSequenceReceiveRequestAmino { /** port unique identifier */ - port_id: string; + port_id?: string; /** channel unique identifier */ - channel_id: string; + channel_id?: string; } export interface QueryNextSequenceReceiveRequestAminoMsg { type: "cosmos-sdk/QueryNextSequenceReceiveRequest"; @@ -985,7 +987,7 @@ export interface QueryNextSequenceReceiveRequestSDKType { channel_id: string; } /** - * QuerySequenceResponse is the request type for the + * QuerySequenceResponse is the response type for the * Query/QueryNextSequenceReceiveResponse RPC method */ export interface QueryNextSequenceReceiveResponse { @@ -1001,14 +1003,14 @@ export interface QueryNextSequenceReceiveResponseProtoMsg { value: Uint8Array; } /** - * QuerySequenceResponse is the request type for the + * QuerySequenceResponse is the response type for the * Query/QueryNextSequenceReceiveResponse RPC method */ export interface QueryNextSequenceReceiveResponseAmino { /** next sequence receive number */ - next_sequence_receive: string; + next_sequence_receive?: string; /** merkle proof of existence */ - proof: Uint8Array; + proof?: string; /** height at which the proof was retrieved */ proof_height?: HeightAmino; } @@ -1017,7 +1019,7 @@ export interface QueryNextSequenceReceiveResponseAminoMsg { value: QueryNextSequenceReceiveResponseAmino; } /** - * QuerySequenceResponse is the request type for the + * QuerySequenceResponse is the response type for the * Query/QueryNextSequenceReceiveResponse RPC method */ export interface QueryNextSequenceReceiveResponseSDKType { @@ -1025,6 +1027,225 @@ export interface QueryNextSequenceReceiveResponseSDKType { proof: Uint8Array; proof_height: HeightSDKType; } +/** + * QueryNextSequenceSendRequest is the request type for the + * Query/QueryNextSequenceSend RPC method + */ +export interface QueryNextSequenceSendRequest { + /** port unique identifier */ + portId: string; + /** channel unique identifier */ + channelId: string; +} +export interface QueryNextSequenceSendRequestProtoMsg { + typeUrl: "/ibc.core.channel.v1.QueryNextSequenceSendRequest"; + value: Uint8Array; +} +/** + * QueryNextSequenceSendRequest is the request type for the + * Query/QueryNextSequenceSend RPC method + */ +export interface QueryNextSequenceSendRequestAmino { + /** port unique identifier */ + port_id?: string; + /** channel unique identifier */ + channel_id?: string; +} +export interface QueryNextSequenceSendRequestAminoMsg { + type: "cosmos-sdk/QueryNextSequenceSendRequest"; + value: QueryNextSequenceSendRequestAmino; +} +/** + * QueryNextSequenceSendRequest is the request type for the + * Query/QueryNextSequenceSend RPC method + */ +export interface QueryNextSequenceSendRequestSDKType { + port_id: string; + channel_id: string; +} +/** + * QueryNextSequenceSendResponse is the request type for the + * Query/QueryNextSequenceSend RPC method + */ +export interface QueryNextSequenceSendResponse { + /** next sequence send number */ + nextSequenceSend: bigint; + /** merkle proof of existence */ + proof: Uint8Array; + /** height at which the proof was retrieved */ + proofHeight: Height; +} +export interface QueryNextSequenceSendResponseProtoMsg { + typeUrl: "/ibc.core.channel.v1.QueryNextSequenceSendResponse"; + value: Uint8Array; +} +/** + * QueryNextSequenceSendResponse is the request type for the + * Query/QueryNextSequenceSend RPC method + */ +export interface QueryNextSequenceSendResponseAmino { + /** next sequence send number */ + next_sequence_send?: string; + /** merkle proof of existence */ + proof?: string; + /** height at which the proof was retrieved */ + proof_height?: HeightAmino; +} +export interface QueryNextSequenceSendResponseAminoMsg { + type: "cosmos-sdk/QueryNextSequenceSendResponse"; + value: QueryNextSequenceSendResponseAmino; +} +/** + * QueryNextSequenceSendResponse is the request type for the + * Query/QueryNextSequenceSend RPC method + */ +export interface QueryNextSequenceSendResponseSDKType { + next_sequence_send: bigint; + proof: Uint8Array; + proof_height: HeightSDKType; +} +/** QueryUpgradeErrorRequest is the request type for the Query/QueryUpgradeError RPC method */ +export interface QueryUpgradeErrorRequest { + portId: string; + channelId: string; +} +export interface QueryUpgradeErrorRequestProtoMsg { + typeUrl: "/ibc.core.channel.v1.QueryUpgradeErrorRequest"; + value: Uint8Array; +} +/** QueryUpgradeErrorRequest is the request type for the Query/QueryUpgradeError RPC method */ +export interface QueryUpgradeErrorRequestAmino { + port_id?: string; + channel_id?: string; +} +export interface QueryUpgradeErrorRequestAminoMsg { + type: "cosmos-sdk/QueryUpgradeErrorRequest"; + value: QueryUpgradeErrorRequestAmino; +} +/** QueryUpgradeErrorRequest is the request type for the Query/QueryUpgradeError RPC method */ +export interface QueryUpgradeErrorRequestSDKType { + port_id: string; + channel_id: string; +} +/** QueryUpgradeErrorResponse is the response type for the Query/QueryUpgradeError RPC method */ +export interface QueryUpgradeErrorResponse { + errorReceipt: ErrorReceipt; + /** merkle proof of existence */ + proof: Uint8Array; + /** height at which the proof was retrieved */ + proofHeight: Height; +} +export interface QueryUpgradeErrorResponseProtoMsg { + typeUrl: "/ibc.core.channel.v1.QueryUpgradeErrorResponse"; + value: Uint8Array; +} +/** QueryUpgradeErrorResponse is the response type for the Query/QueryUpgradeError RPC method */ +export interface QueryUpgradeErrorResponseAmino { + error_receipt?: ErrorReceiptAmino; + /** merkle proof of existence */ + proof?: string; + /** height at which the proof was retrieved */ + proof_height?: HeightAmino; +} +export interface QueryUpgradeErrorResponseAminoMsg { + type: "cosmos-sdk/QueryUpgradeErrorResponse"; + value: QueryUpgradeErrorResponseAmino; +} +/** QueryUpgradeErrorResponse is the response type for the Query/QueryUpgradeError RPC method */ +export interface QueryUpgradeErrorResponseSDKType { + error_receipt: ErrorReceiptSDKType; + proof: Uint8Array; + proof_height: HeightSDKType; +} +/** QueryUpgradeRequest is the request type for the QueryUpgradeRequest RPC method */ +export interface QueryUpgradeRequest { + portId: string; + channelId: string; +} +export interface QueryUpgradeRequestProtoMsg { + typeUrl: "/ibc.core.channel.v1.QueryUpgradeRequest"; + value: Uint8Array; +} +/** QueryUpgradeRequest is the request type for the QueryUpgradeRequest RPC method */ +export interface QueryUpgradeRequestAmino { + port_id?: string; + channel_id?: string; +} +export interface QueryUpgradeRequestAminoMsg { + type: "cosmos-sdk/QueryUpgradeRequest"; + value: QueryUpgradeRequestAmino; +} +/** QueryUpgradeRequest is the request type for the QueryUpgradeRequest RPC method */ +export interface QueryUpgradeRequestSDKType { + port_id: string; + channel_id: string; +} +/** QueryUpgradeResponse is the response type for the QueryUpgradeResponse RPC method */ +export interface QueryUpgradeResponse { + upgrade: Upgrade; + /** merkle proof of existence */ + proof: Uint8Array; + /** height at which the proof was retrieved */ + proofHeight: Height; +} +export interface QueryUpgradeResponseProtoMsg { + typeUrl: "/ibc.core.channel.v1.QueryUpgradeResponse"; + value: Uint8Array; +} +/** QueryUpgradeResponse is the response type for the QueryUpgradeResponse RPC method */ +export interface QueryUpgradeResponseAmino { + upgrade?: UpgradeAmino; + /** merkle proof of existence */ + proof?: string; + /** height at which the proof was retrieved */ + proof_height?: HeightAmino; +} +export interface QueryUpgradeResponseAminoMsg { + type: "cosmos-sdk/QueryUpgradeResponse"; + value: QueryUpgradeResponseAmino; +} +/** QueryUpgradeResponse is the response type for the QueryUpgradeResponse RPC method */ +export interface QueryUpgradeResponseSDKType { + upgrade: UpgradeSDKType; + proof: Uint8Array; + proof_height: HeightSDKType; +} +/** QueryChannelParamsRequest is the request type for the Query/ChannelParams RPC method. */ +export interface QueryChannelParamsRequest {} +export interface QueryChannelParamsRequestProtoMsg { + typeUrl: "/ibc.core.channel.v1.QueryChannelParamsRequest"; + value: Uint8Array; +} +/** QueryChannelParamsRequest is the request type for the Query/ChannelParams RPC method. */ +export interface QueryChannelParamsRequestAmino {} +export interface QueryChannelParamsRequestAminoMsg { + type: "cosmos-sdk/QueryChannelParamsRequest"; + value: QueryChannelParamsRequestAmino; +} +/** QueryChannelParamsRequest is the request type for the Query/ChannelParams RPC method. */ +export interface QueryChannelParamsRequestSDKType {} +/** QueryChannelParamsResponse is the response type for the Query/ChannelParams RPC method. */ +export interface QueryChannelParamsResponse { + /** params defines the parameters of the module. */ + params?: Params; +} +export interface QueryChannelParamsResponseProtoMsg { + typeUrl: "/ibc.core.channel.v1.QueryChannelParamsResponse"; + value: Uint8Array; +} +/** QueryChannelParamsResponse is the response type for the Query/ChannelParams RPC method. */ +export interface QueryChannelParamsResponseAmino { + /** params defines the parameters of the module. */ + params?: ParamsAmino; +} +export interface QueryChannelParamsResponseAminoMsg { + type: "cosmos-sdk/QueryChannelParamsResponse"; + value: QueryChannelParamsResponseAmino; +} +/** QueryChannelParamsResponse is the response type for the Query/ChannelParams RPC method. */ +export interface QueryChannelParamsResponseSDKType { + params?: ParamsSDKType; +} function createBaseQueryChannelRequest(): QueryChannelRequest { return { portId: "", @@ -1069,10 +1290,14 @@ export const QueryChannelRequest = { return message; }, fromAmino(object: QueryChannelRequestAmino): QueryChannelRequest { - return { - portId: object.port_id, - channelId: object.channel_id - }; + const message = createBaseQueryChannelRequest(); + if (object.port_id !== undefined && object.port_id !== null) { + message.portId = object.port_id; + } + if (object.channel_id !== undefined && object.channel_id !== null) { + message.channelId = object.channel_id; + } + return message; }, toAmino(message: QueryChannelRequest): QueryChannelRequestAmino { const obj: any = {}; @@ -1104,7 +1329,7 @@ export const QueryChannelRequest = { }; function createBaseQueryChannelResponse(): QueryChannelResponse { return { - channel: Channel.fromPartial({}), + channel: undefined, proof: new Uint8Array(), proofHeight: Height.fromPartial({}) }; @@ -1154,16 +1379,22 @@ export const QueryChannelResponse = { return message; }, fromAmino(object: QueryChannelResponseAmino): QueryChannelResponse { - return { - channel: object?.channel ? Channel.fromAmino(object.channel) : undefined, - proof: object.proof, - proofHeight: object?.proof_height ? Height.fromAmino(object.proof_height) : undefined - }; + const message = createBaseQueryChannelResponse(); + if (object.channel !== undefined && object.channel !== null) { + message.channel = Channel.fromAmino(object.channel); + } + if (object.proof !== undefined && object.proof !== null) { + message.proof = bytesFromBase64(object.proof); + } + if (object.proof_height !== undefined && object.proof_height !== null) { + message.proofHeight = Height.fromAmino(object.proof_height); + } + return message; }, toAmino(message: QueryChannelResponse): QueryChannelResponseAmino { const obj: any = {}; obj.channel = message.channel ? Channel.toAmino(message.channel) : undefined; - obj.proof = message.proof; + obj.proof = message.proof ? base64FromBytes(message.proof) : undefined; obj.proof_height = message.proofHeight ? Height.toAmino(message.proofHeight) : {}; return obj; }, @@ -1191,7 +1422,7 @@ export const QueryChannelResponse = { }; function createBaseQueryChannelsRequest(): QueryChannelsRequest { return { - pagination: PageRequest.fromPartial({}) + pagination: undefined }; } export const QueryChannelsRequest = { @@ -1225,9 +1456,11 @@ export const QueryChannelsRequest = { return message; }, fromAmino(object: QueryChannelsRequestAmino): QueryChannelsRequest { - return { - pagination: object?.pagination ? PageRequest.fromAmino(object.pagination) : undefined - }; + const message = createBaseQueryChannelsRequest(); + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromAmino(object.pagination); + } + return message; }, toAmino(message: QueryChannelsRequest): QueryChannelsRequestAmino { const obj: any = {}; @@ -1259,7 +1492,7 @@ export const QueryChannelsRequest = { function createBaseQueryChannelsResponse(): QueryChannelsResponse { return { channels: [], - pagination: PageResponse.fromPartial({}), + pagination: undefined, height: Height.fromPartial({}) }; } @@ -1308,11 +1541,15 @@ export const QueryChannelsResponse = { return message; }, fromAmino(object: QueryChannelsResponseAmino): QueryChannelsResponse { - return { - channels: Array.isArray(object?.channels) ? object.channels.map((e: any) => IdentifiedChannel.fromAmino(e)) : [], - pagination: object?.pagination ? PageResponse.fromAmino(object.pagination) : undefined, - height: object?.height ? Height.fromAmino(object.height) : undefined - }; + const message = createBaseQueryChannelsResponse(); + message.channels = object.channels?.map(e => IdentifiedChannel.fromAmino(e)) || []; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromAmino(object.pagination); + } + if (object.height !== undefined && object.height !== null) { + message.height = Height.fromAmino(object.height); + } + return message; }, toAmino(message: QueryChannelsResponse): QueryChannelsResponseAmino { const obj: any = {}; @@ -1350,7 +1587,7 @@ export const QueryChannelsResponse = { function createBaseQueryConnectionChannelsRequest(): QueryConnectionChannelsRequest { return { connection: "", - pagination: PageRequest.fromPartial({}) + pagination: undefined }; } export const QueryConnectionChannelsRequest = { @@ -1391,10 +1628,14 @@ export const QueryConnectionChannelsRequest = { return message; }, fromAmino(object: QueryConnectionChannelsRequestAmino): QueryConnectionChannelsRequest { - return { - connection: object.connection, - pagination: object?.pagination ? PageRequest.fromAmino(object.pagination) : undefined - }; + const message = createBaseQueryConnectionChannelsRequest(); + if (object.connection !== undefined && object.connection !== null) { + message.connection = object.connection; + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromAmino(object.pagination); + } + return message; }, toAmino(message: QueryConnectionChannelsRequest): QueryConnectionChannelsRequestAmino { const obj: any = {}; @@ -1427,7 +1668,7 @@ export const QueryConnectionChannelsRequest = { function createBaseQueryConnectionChannelsResponse(): QueryConnectionChannelsResponse { return { channels: [], - pagination: PageResponse.fromPartial({}), + pagination: undefined, height: Height.fromPartial({}) }; } @@ -1476,11 +1717,15 @@ export const QueryConnectionChannelsResponse = { return message; }, fromAmino(object: QueryConnectionChannelsResponseAmino): QueryConnectionChannelsResponse { - return { - channels: Array.isArray(object?.channels) ? object.channels.map((e: any) => IdentifiedChannel.fromAmino(e)) : [], - pagination: object?.pagination ? PageResponse.fromAmino(object.pagination) : undefined, - height: object?.height ? Height.fromAmino(object.height) : undefined - }; + const message = createBaseQueryConnectionChannelsResponse(); + message.channels = object.channels?.map(e => IdentifiedChannel.fromAmino(e)) || []; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromAmino(object.pagination); + } + if (object.height !== undefined && object.height !== null) { + message.height = Height.fromAmino(object.height); + } + return message; }, toAmino(message: QueryConnectionChannelsResponse): QueryConnectionChannelsResponseAmino { const obj: any = {}; @@ -1559,10 +1804,14 @@ export const QueryChannelClientStateRequest = { return message; }, fromAmino(object: QueryChannelClientStateRequestAmino): QueryChannelClientStateRequest { - return { - portId: object.port_id, - channelId: object.channel_id - }; + const message = createBaseQueryChannelClientStateRequest(); + if (object.port_id !== undefined && object.port_id !== null) { + message.portId = object.port_id; + } + if (object.channel_id !== undefined && object.channel_id !== null) { + message.channelId = object.channel_id; + } + return message; }, toAmino(message: QueryChannelClientStateRequest): QueryChannelClientStateRequestAmino { const obj: any = {}; @@ -1594,7 +1843,7 @@ export const QueryChannelClientStateRequest = { }; function createBaseQueryChannelClientStateResponse(): QueryChannelClientStateResponse { return { - identifiedClientState: IdentifiedClientState.fromPartial({}), + identifiedClientState: undefined, proof: new Uint8Array(), proofHeight: Height.fromPartial({}) }; @@ -1644,16 +1893,22 @@ export const QueryChannelClientStateResponse = { return message; }, fromAmino(object: QueryChannelClientStateResponseAmino): QueryChannelClientStateResponse { - return { - identifiedClientState: object?.identified_client_state ? IdentifiedClientState.fromAmino(object.identified_client_state) : undefined, - proof: object.proof, - proofHeight: object?.proof_height ? Height.fromAmino(object.proof_height) : undefined - }; + const message = createBaseQueryChannelClientStateResponse(); + if (object.identified_client_state !== undefined && object.identified_client_state !== null) { + message.identifiedClientState = IdentifiedClientState.fromAmino(object.identified_client_state); + } + if (object.proof !== undefined && object.proof !== null) { + message.proof = bytesFromBase64(object.proof); + } + if (object.proof_height !== undefined && object.proof_height !== null) { + message.proofHeight = Height.fromAmino(object.proof_height); + } + return message; }, toAmino(message: QueryChannelClientStateResponse): QueryChannelClientStateResponseAmino { const obj: any = {}; obj.identified_client_state = message.identifiedClientState ? IdentifiedClientState.toAmino(message.identifiedClientState) : undefined; - obj.proof = message.proof; + obj.proof = message.proof ? base64FromBytes(message.proof) : undefined; obj.proof_height = message.proofHeight ? Height.toAmino(message.proofHeight) : {}; return obj; }, @@ -1739,12 +1994,20 @@ export const QueryChannelConsensusStateRequest = { return message; }, fromAmino(object: QueryChannelConsensusStateRequestAmino): QueryChannelConsensusStateRequest { - return { - portId: object.port_id, - channelId: object.channel_id, - revisionNumber: BigInt(object.revision_number), - revisionHeight: BigInt(object.revision_height) - }; + const message = createBaseQueryChannelConsensusStateRequest(); + if (object.port_id !== undefined && object.port_id !== null) { + message.portId = object.port_id; + } + if (object.channel_id !== undefined && object.channel_id !== null) { + message.channelId = object.channel_id; + } + if (object.revision_number !== undefined && object.revision_number !== null) { + message.revisionNumber = BigInt(object.revision_number); + } + if (object.revision_height !== undefined && object.revision_height !== null) { + message.revisionHeight = BigInt(object.revision_height); + } + return message; }, toAmino(message: QueryChannelConsensusStateRequest): QueryChannelConsensusStateRequestAmino { const obj: any = {}; @@ -1778,7 +2041,7 @@ export const QueryChannelConsensusStateRequest = { }; function createBaseQueryChannelConsensusStateResponse(): QueryChannelConsensusStateResponse { return { - consensusState: Any.fromPartial({}), + consensusState: undefined, clientId: "", proof: new Uint8Array(), proofHeight: Height.fromPartial({}) @@ -1836,18 +2099,26 @@ export const QueryChannelConsensusStateResponse = { return message; }, fromAmino(object: QueryChannelConsensusStateResponseAmino): QueryChannelConsensusStateResponse { - return { - consensusState: object?.consensus_state ? Any.fromAmino(object.consensus_state) : undefined, - clientId: object.client_id, - proof: object.proof, - proofHeight: object?.proof_height ? Height.fromAmino(object.proof_height) : undefined - }; + const message = createBaseQueryChannelConsensusStateResponse(); + if (object.consensus_state !== undefined && object.consensus_state !== null) { + message.consensusState = Any.fromAmino(object.consensus_state); + } + if (object.client_id !== undefined && object.client_id !== null) { + message.clientId = object.client_id; + } + if (object.proof !== undefined && object.proof !== null) { + message.proof = bytesFromBase64(object.proof); + } + if (object.proof_height !== undefined && object.proof_height !== null) { + message.proofHeight = Height.fromAmino(object.proof_height); + } + return message; }, toAmino(message: QueryChannelConsensusStateResponse): QueryChannelConsensusStateResponseAmino { const obj: any = {}; obj.consensus_state = message.consensusState ? Any.toAmino(message.consensusState) : undefined; obj.client_id = message.clientId; - obj.proof = message.proof; + obj.proof = message.proof ? base64FromBytes(message.proof) : undefined; obj.proof_height = message.proofHeight ? Height.toAmino(message.proofHeight) : {}; return obj; }, @@ -1925,11 +2196,17 @@ export const QueryPacketCommitmentRequest = { return message; }, fromAmino(object: QueryPacketCommitmentRequestAmino): QueryPacketCommitmentRequest { - return { - portId: object.port_id, - channelId: object.channel_id, - sequence: BigInt(object.sequence) - }; + const message = createBaseQueryPacketCommitmentRequest(); + if (object.port_id !== undefined && object.port_id !== null) { + message.portId = object.port_id; + } + if (object.channel_id !== undefined && object.channel_id !== null) { + message.channelId = object.channel_id; + } + if (object.sequence !== undefined && object.sequence !== null) { + message.sequence = BigInt(object.sequence); + } + return message; }, toAmino(message: QueryPacketCommitmentRequest): QueryPacketCommitmentRequestAmino { const obj: any = {}; @@ -2012,16 +2289,22 @@ export const QueryPacketCommitmentResponse = { return message; }, fromAmino(object: QueryPacketCommitmentResponseAmino): QueryPacketCommitmentResponse { - return { - commitment: object.commitment, - proof: object.proof, - proofHeight: object?.proof_height ? Height.fromAmino(object.proof_height) : undefined - }; + const message = createBaseQueryPacketCommitmentResponse(); + if (object.commitment !== undefined && object.commitment !== null) { + message.commitment = bytesFromBase64(object.commitment); + } + if (object.proof !== undefined && object.proof !== null) { + message.proof = bytesFromBase64(object.proof); + } + if (object.proof_height !== undefined && object.proof_height !== null) { + message.proofHeight = Height.fromAmino(object.proof_height); + } + return message; }, toAmino(message: QueryPacketCommitmentResponse): QueryPacketCommitmentResponseAmino { const obj: any = {}; - obj.commitment = message.commitment; - obj.proof = message.proof; + obj.commitment = message.commitment ? base64FromBytes(message.commitment) : undefined; + obj.proof = message.proof ? base64FromBytes(message.proof) : undefined; obj.proof_height = message.proofHeight ? Height.toAmino(message.proofHeight) : {}; return obj; }, @@ -2051,7 +2334,7 @@ function createBaseQueryPacketCommitmentsRequest(): QueryPacketCommitmentsReques return { portId: "", channelId: "", - pagination: PageRequest.fromPartial({}) + pagination: undefined }; } export const QueryPacketCommitmentsRequest = { @@ -2099,11 +2382,17 @@ export const QueryPacketCommitmentsRequest = { return message; }, fromAmino(object: QueryPacketCommitmentsRequestAmino): QueryPacketCommitmentsRequest { - return { - portId: object.port_id, - channelId: object.channel_id, - pagination: object?.pagination ? PageRequest.fromAmino(object.pagination) : undefined - }; + const message = createBaseQueryPacketCommitmentsRequest(); + if (object.port_id !== undefined && object.port_id !== null) { + message.portId = object.port_id; + } + if (object.channel_id !== undefined && object.channel_id !== null) { + message.channelId = object.channel_id; + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromAmino(object.pagination); + } + return message; }, toAmino(message: QueryPacketCommitmentsRequest): QueryPacketCommitmentsRequestAmino { const obj: any = {}; @@ -2137,7 +2426,7 @@ export const QueryPacketCommitmentsRequest = { function createBaseQueryPacketCommitmentsResponse(): QueryPacketCommitmentsResponse { return { commitments: [], - pagination: PageResponse.fromPartial({}), + pagination: undefined, height: Height.fromPartial({}) }; } @@ -2186,11 +2475,15 @@ export const QueryPacketCommitmentsResponse = { return message; }, fromAmino(object: QueryPacketCommitmentsResponseAmino): QueryPacketCommitmentsResponse { - return { - commitments: Array.isArray(object?.commitments) ? object.commitments.map((e: any) => PacketState.fromAmino(e)) : [], - pagination: object?.pagination ? PageResponse.fromAmino(object.pagination) : undefined, - height: object?.height ? Height.fromAmino(object.height) : undefined - }; + const message = createBaseQueryPacketCommitmentsResponse(); + message.commitments = object.commitments?.map(e => PacketState.fromAmino(e)) || []; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromAmino(object.pagination); + } + if (object.height !== undefined && object.height !== null) { + message.height = Height.fromAmino(object.height); + } + return message; }, toAmino(message: QueryPacketCommitmentsResponse): QueryPacketCommitmentsResponseAmino { const obj: any = {}; @@ -2277,11 +2570,17 @@ export const QueryPacketReceiptRequest = { return message; }, fromAmino(object: QueryPacketReceiptRequestAmino): QueryPacketReceiptRequest { - return { - portId: object.port_id, - channelId: object.channel_id, - sequence: BigInt(object.sequence) - }; + const message = createBaseQueryPacketReceiptRequest(); + if (object.port_id !== undefined && object.port_id !== null) { + message.portId = object.port_id; + } + if (object.channel_id !== undefined && object.channel_id !== null) { + message.channelId = object.channel_id; + } + if (object.sequence !== undefined && object.sequence !== null) { + message.sequence = BigInt(object.sequence); + } + return message; }, toAmino(message: QueryPacketReceiptRequest): QueryPacketReceiptRequestAmino { const obj: any = {}; @@ -2364,16 +2663,22 @@ export const QueryPacketReceiptResponse = { return message; }, fromAmino(object: QueryPacketReceiptResponseAmino): QueryPacketReceiptResponse { - return { - received: object.received, - proof: object.proof, - proofHeight: object?.proof_height ? Height.fromAmino(object.proof_height) : undefined - }; + const message = createBaseQueryPacketReceiptResponse(); + if (object.received !== undefined && object.received !== null) { + message.received = object.received; + } + if (object.proof !== undefined && object.proof !== null) { + message.proof = bytesFromBase64(object.proof); + } + if (object.proof_height !== undefined && object.proof_height !== null) { + message.proofHeight = Height.fromAmino(object.proof_height); + } + return message; }, toAmino(message: QueryPacketReceiptResponse): QueryPacketReceiptResponseAmino { const obj: any = {}; obj.received = message.received; - obj.proof = message.proof; + obj.proof = message.proof ? base64FromBytes(message.proof) : undefined; obj.proof_height = message.proofHeight ? Height.toAmino(message.proofHeight) : {}; return obj; }, @@ -2451,11 +2756,17 @@ export const QueryPacketAcknowledgementRequest = { return message; }, fromAmino(object: QueryPacketAcknowledgementRequestAmino): QueryPacketAcknowledgementRequest { - return { - portId: object.port_id, - channelId: object.channel_id, - sequence: BigInt(object.sequence) - }; + const message = createBaseQueryPacketAcknowledgementRequest(); + if (object.port_id !== undefined && object.port_id !== null) { + message.portId = object.port_id; + } + if (object.channel_id !== undefined && object.channel_id !== null) { + message.channelId = object.channel_id; + } + if (object.sequence !== undefined && object.sequence !== null) { + message.sequence = BigInt(object.sequence); + } + return message; }, toAmino(message: QueryPacketAcknowledgementRequest): QueryPacketAcknowledgementRequestAmino { const obj: any = {}; @@ -2538,16 +2849,22 @@ export const QueryPacketAcknowledgementResponse = { return message; }, fromAmino(object: QueryPacketAcknowledgementResponseAmino): QueryPacketAcknowledgementResponse { - return { - acknowledgement: object.acknowledgement, - proof: object.proof, - proofHeight: object?.proof_height ? Height.fromAmino(object.proof_height) : undefined - }; + const message = createBaseQueryPacketAcknowledgementResponse(); + if (object.acknowledgement !== undefined && object.acknowledgement !== null) { + message.acknowledgement = bytesFromBase64(object.acknowledgement); + } + if (object.proof !== undefined && object.proof !== null) { + message.proof = bytesFromBase64(object.proof); + } + if (object.proof_height !== undefined && object.proof_height !== null) { + message.proofHeight = Height.fromAmino(object.proof_height); + } + return message; }, toAmino(message: QueryPacketAcknowledgementResponse): QueryPacketAcknowledgementResponseAmino { const obj: any = {}; - obj.acknowledgement = message.acknowledgement; - obj.proof = message.proof; + obj.acknowledgement = message.acknowledgement ? base64FromBytes(message.acknowledgement) : undefined; + obj.proof = message.proof ? base64FromBytes(message.proof) : undefined; obj.proof_height = message.proofHeight ? Height.toAmino(message.proofHeight) : {}; return obj; }, @@ -2577,7 +2894,7 @@ function createBaseQueryPacketAcknowledgementsRequest(): QueryPacketAcknowledgem return { portId: "", channelId: "", - pagination: PageRequest.fromPartial({}), + pagination: undefined, packetCommitmentSequences: [] }; } @@ -2642,14 +2959,20 @@ export const QueryPacketAcknowledgementsRequest = { return message; }, fromAmino(object: QueryPacketAcknowledgementsRequestAmino): QueryPacketAcknowledgementsRequest { - return { - portId: object.port_id, - channelId: object.channel_id, - pagination: object?.pagination ? PageRequest.fromAmino(object.pagination) : undefined, - packetCommitmentSequences: Array.isArray(object?.packet_commitment_sequences) ? object.packet_commitment_sequences.map((e: any) => BigInt(e)) : [] - }; - }, - toAmino(message: QueryPacketAcknowledgementsRequest): QueryPacketAcknowledgementsRequestAmino { + const message = createBaseQueryPacketAcknowledgementsRequest(); + if (object.port_id !== undefined && object.port_id !== null) { + message.portId = object.port_id; + } + if (object.channel_id !== undefined && object.channel_id !== null) { + message.channelId = object.channel_id; + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromAmino(object.pagination); + } + message.packetCommitmentSequences = object.packet_commitment_sequences?.map(e => BigInt(e)) || []; + return message; + }, + toAmino(message: QueryPacketAcknowledgementsRequest): QueryPacketAcknowledgementsRequestAmino { const obj: any = {}; obj.port_id = message.portId; obj.channel_id = message.channelId; @@ -2686,7 +3009,7 @@ export const QueryPacketAcknowledgementsRequest = { function createBaseQueryPacketAcknowledgementsResponse(): QueryPacketAcknowledgementsResponse { return { acknowledgements: [], - pagination: PageResponse.fromPartial({}), + pagination: undefined, height: Height.fromPartial({}) }; } @@ -2735,11 +3058,15 @@ export const QueryPacketAcknowledgementsResponse = { return message; }, fromAmino(object: QueryPacketAcknowledgementsResponseAmino): QueryPacketAcknowledgementsResponse { - return { - acknowledgements: Array.isArray(object?.acknowledgements) ? object.acknowledgements.map((e: any) => PacketState.fromAmino(e)) : [], - pagination: object?.pagination ? PageResponse.fromAmino(object.pagination) : undefined, - height: object?.height ? Height.fromAmino(object.height) : undefined - }; + const message = createBaseQueryPacketAcknowledgementsResponse(); + message.acknowledgements = object.acknowledgements?.map(e => PacketState.fromAmino(e)) || []; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromAmino(object.pagination); + } + if (object.height !== undefined && object.height !== null) { + message.height = Height.fromAmino(object.height); + } + return message; }, toAmino(message: QueryPacketAcknowledgementsResponse): QueryPacketAcknowledgementsResponseAmino { const obj: any = {}; @@ -2835,11 +3162,15 @@ export const QueryUnreceivedPacketsRequest = { return message; }, fromAmino(object: QueryUnreceivedPacketsRequestAmino): QueryUnreceivedPacketsRequest { - return { - portId: object.port_id, - channelId: object.channel_id, - packetCommitmentSequences: Array.isArray(object?.packet_commitment_sequences) ? object.packet_commitment_sequences.map((e: any) => BigInt(e)) : [] - }; + const message = createBaseQueryUnreceivedPacketsRequest(); + if (object.port_id !== undefined && object.port_id !== null) { + message.portId = object.port_id; + } + if (object.channel_id !== undefined && object.channel_id !== null) { + message.channelId = object.channel_id; + } + message.packetCommitmentSequences = object.packet_commitment_sequences?.map(e => BigInt(e)) || []; + return message; }, toAmino(message: QueryUnreceivedPacketsRequest): QueryUnreceivedPacketsRequestAmino { const obj: any = {}; @@ -2927,10 +3258,12 @@ export const QueryUnreceivedPacketsResponse = { return message; }, fromAmino(object: QueryUnreceivedPacketsResponseAmino): QueryUnreceivedPacketsResponse { - return { - sequences: Array.isArray(object?.sequences) ? object.sequences.map((e: any) => BigInt(e)) : [], - height: object?.height ? Height.fromAmino(object.height) : undefined - }; + const message = createBaseQueryUnreceivedPacketsResponse(); + message.sequences = object.sequences?.map(e => BigInt(e)) || []; + if (object.height !== undefined && object.height !== null) { + message.height = Height.fromAmino(object.height); + } + return message; }, toAmino(message: QueryUnreceivedPacketsResponse): QueryUnreceivedPacketsResponseAmino { const obj: any = {}; @@ -3025,11 +3358,15 @@ export const QueryUnreceivedAcksRequest = { return message; }, fromAmino(object: QueryUnreceivedAcksRequestAmino): QueryUnreceivedAcksRequest { - return { - portId: object.port_id, - channelId: object.channel_id, - packetAckSequences: Array.isArray(object?.packet_ack_sequences) ? object.packet_ack_sequences.map((e: any) => BigInt(e)) : [] - }; + const message = createBaseQueryUnreceivedAcksRequest(); + if (object.port_id !== undefined && object.port_id !== null) { + message.portId = object.port_id; + } + if (object.channel_id !== undefined && object.channel_id !== null) { + message.channelId = object.channel_id; + } + message.packetAckSequences = object.packet_ack_sequences?.map(e => BigInt(e)) || []; + return message; }, toAmino(message: QueryUnreceivedAcksRequest): QueryUnreceivedAcksRequestAmino { const obj: any = {}; @@ -3117,10 +3454,12 @@ export const QueryUnreceivedAcksResponse = { return message; }, fromAmino(object: QueryUnreceivedAcksResponseAmino): QueryUnreceivedAcksResponse { - return { - sequences: Array.isArray(object?.sequences) ? object.sequences.map((e: any) => BigInt(e)) : [], - height: object?.height ? Height.fromAmino(object.height) : undefined - }; + const message = createBaseQueryUnreceivedAcksResponse(); + message.sequences = object.sequences?.map(e => BigInt(e)) || []; + if (object.height !== undefined && object.height !== null) { + message.height = Height.fromAmino(object.height); + } + return message; }, toAmino(message: QueryUnreceivedAcksResponse): QueryUnreceivedAcksResponseAmino { const obj: any = {}; @@ -3198,10 +3537,14 @@ export const QueryNextSequenceReceiveRequest = { return message; }, fromAmino(object: QueryNextSequenceReceiveRequestAmino): QueryNextSequenceReceiveRequest { - return { - portId: object.port_id, - channelId: object.channel_id - }; + const message = createBaseQueryNextSequenceReceiveRequest(); + if (object.port_id !== undefined && object.port_id !== null) { + message.portId = object.port_id; + } + if (object.channel_id !== undefined && object.channel_id !== null) { + message.channelId = object.channel_id; + } + return message; }, toAmino(message: QueryNextSequenceReceiveRequest): QueryNextSequenceReceiveRequestAmino { const obj: any = {}; @@ -3283,16 +3626,22 @@ export const QueryNextSequenceReceiveResponse = { return message; }, fromAmino(object: QueryNextSequenceReceiveResponseAmino): QueryNextSequenceReceiveResponse { - return { - nextSequenceReceive: BigInt(object.next_sequence_receive), - proof: object.proof, - proofHeight: object?.proof_height ? Height.fromAmino(object.proof_height) : undefined - }; + const message = createBaseQueryNextSequenceReceiveResponse(); + if (object.next_sequence_receive !== undefined && object.next_sequence_receive !== null) { + message.nextSequenceReceive = BigInt(object.next_sequence_receive); + } + if (object.proof !== undefined && object.proof !== null) { + message.proof = bytesFromBase64(object.proof); + } + if (object.proof_height !== undefined && object.proof_height !== null) { + message.proofHeight = Height.fromAmino(object.proof_height); + } + return message; }, toAmino(message: QueryNextSequenceReceiveResponse): QueryNextSequenceReceiveResponseAmino { const obj: any = {}; obj.next_sequence_receive = message.nextSequenceReceive ? message.nextSequenceReceive.toString() : undefined; - obj.proof = message.proof; + obj.proof = message.proof ? base64FromBytes(message.proof) : undefined; obj.proof_height = message.proofHeight ? Height.toAmino(message.proofHeight) : {}; return obj; }, @@ -3317,4 +3666,651 @@ export const QueryNextSequenceReceiveResponse = { value: QueryNextSequenceReceiveResponse.encode(message).finish() }; } +}; +function createBaseQueryNextSequenceSendRequest(): QueryNextSequenceSendRequest { + return { + portId: "", + channelId: "" + }; +} +export const QueryNextSequenceSendRequest = { + typeUrl: "/ibc.core.channel.v1.QueryNextSequenceSendRequest", + encode(message: QueryNextSequenceSendRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.portId !== "") { + writer.uint32(10).string(message.portId); + } + if (message.channelId !== "") { + writer.uint32(18).string(message.channelId); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryNextSequenceSendRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryNextSequenceSendRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.portId = reader.string(); + break; + case 2: + message.channelId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryNextSequenceSendRequest { + const message = createBaseQueryNextSequenceSendRequest(); + message.portId = object.portId ?? ""; + message.channelId = object.channelId ?? ""; + return message; + }, + fromAmino(object: QueryNextSequenceSendRequestAmino): QueryNextSequenceSendRequest { + const message = createBaseQueryNextSequenceSendRequest(); + if (object.port_id !== undefined && object.port_id !== null) { + message.portId = object.port_id; + } + if (object.channel_id !== undefined && object.channel_id !== null) { + message.channelId = object.channel_id; + } + return message; + }, + toAmino(message: QueryNextSequenceSendRequest): QueryNextSequenceSendRequestAmino { + const obj: any = {}; + obj.port_id = message.portId; + obj.channel_id = message.channelId; + return obj; + }, + fromAminoMsg(object: QueryNextSequenceSendRequestAminoMsg): QueryNextSequenceSendRequest { + return QueryNextSequenceSendRequest.fromAmino(object.value); + }, + toAminoMsg(message: QueryNextSequenceSendRequest): QueryNextSequenceSendRequestAminoMsg { + return { + type: "cosmos-sdk/QueryNextSequenceSendRequest", + value: QueryNextSequenceSendRequest.toAmino(message) + }; + }, + fromProtoMsg(message: QueryNextSequenceSendRequestProtoMsg): QueryNextSequenceSendRequest { + return QueryNextSequenceSendRequest.decode(message.value); + }, + toProto(message: QueryNextSequenceSendRequest): Uint8Array { + return QueryNextSequenceSendRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryNextSequenceSendRequest): QueryNextSequenceSendRequestProtoMsg { + return { + typeUrl: "/ibc.core.channel.v1.QueryNextSequenceSendRequest", + value: QueryNextSequenceSendRequest.encode(message).finish() + }; + } +}; +function createBaseQueryNextSequenceSendResponse(): QueryNextSequenceSendResponse { + return { + nextSequenceSend: BigInt(0), + proof: new Uint8Array(), + proofHeight: Height.fromPartial({}) + }; +} +export const QueryNextSequenceSendResponse = { + typeUrl: "/ibc.core.channel.v1.QueryNextSequenceSendResponse", + encode(message: QueryNextSequenceSendResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.nextSequenceSend !== BigInt(0)) { + writer.uint32(8).uint64(message.nextSequenceSend); + } + if (message.proof.length !== 0) { + writer.uint32(18).bytes(message.proof); + } + if (message.proofHeight !== undefined) { + Height.encode(message.proofHeight, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryNextSequenceSendResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryNextSequenceSendResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.nextSequenceSend = reader.uint64(); + break; + case 2: + message.proof = reader.bytes(); + break; + case 3: + message.proofHeight = Height.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryNextSequenceSendResponse { + const message = createBaseQueryNextSequenceSendResponse(); + message.nextSequenceSend = object.nextSequenceSend !== undefined && object.nextSequenceSend !== null ? BigInt(object.nextSequenceSend.toString()) : BigInt(0); + message.proof = object.proof ?? new Uint8Array(); + message.proofHeight = object.proofHeight !== undefined && object.proofHeight !== null ? Height.fromPartial(object.proofHeight) : undefined; + return message; + }, + fromAmino(object: QueryNextSequenceSendResponseAmino): QueryNextSequenceSendResponse { + const message = createBaseQueryNextSequenceSendResponse(); + if (object.next_sequence_send !== undefined && object.next_sequence_send !== null) { + message.nextSequenceSend = BigInt(object.next_sequence_send); + } + if (object.proof !== undefined && object.proof !== null) { + message.proof = bytesFromBase64(object.proof); + } + if (object.proof_height !== undefined && object.proof_height !== null) { + message.proofHeight = Height.fromAmino(object.proof_height); + } + return message; + }, + toAmino(message: QueryNextSequenceSendResponse): QueryNextSequenceSendResponseAmino { + const obj: any = {}; + obj.next_sequence_send = message.nextSequenceSend ? message.nextSequenceSend.toString() : undefined; + obj.proof = message.proof ? base64FromBytes(message.proof) : undefined; + obj.proof_height = message.proofHeight ? Height.toAmino(message.proofHeight) : {}; + return obj; + }, + fromAminoMsg(object: QueryNextSequenceSendResponseAminoMsg): QueryNextSequenceSendResponse { + return QueryNextSequenceSendResponse.fromAmino(object.value); + }, + toAminoMsg(message: QueryNextSequenceSendResponse): QueryNextSequenceSendResponseAminoMsg { + return { + type: "cosmos-sdk/QueryNextSequenceSendResponse", + value: QueryNextSequenceSendResponse.toAmino(message) + }; + }, + fromProtoMsg(message: QueryNextSequenceSendResponseProtoMsg): QueryNextSequenceSendResponse { + return QueryNextSequenceSendResponse.decode(message.value); + }, + toProto(message: QueryNextSequenceSendResponse): Uint8Array { + return QueryNextSequenceSendResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryNextSequenceSendResponse): QueryNextSequenceSendResponseProtoMsg { + return { + typeUrl: "/ibc.core.channel.v1.QueryNextSequenceSendResponse", + value: QueryNextSequenceSendResponse.encode(message).finish() + }; + } +}; +function createBaseQueryUpgradeErrorRequest(): QueryUpgradeErrorRequest { + return { + portId: "", + channelId: "" + }; +} +export const QueryUpgradeErrorRequest = { + typeUrl: "/ibc.core.channel.v1.QueryUpgradeErrorRequest", + encode(message: QueryUpgradeErrorRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.portId !== "") { + writer.uint32(10).string(message.portId); + } + if (message.channelId !== "") { + writer.uint32(18).string(message.channelId); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryUpgradeErrorRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryUpgradeErrorRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.portId = reader.string(); + break; + case 2: + message.channelId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryUpgradeErrorRequest { + const message = createBaseQueryUpgradeErrorRequest(); + message.portId = object.portId ?? ""; + message.channelId = object.channelId ?? ""; + return message; + }, + fromAmino(object: QueryUpgradeErrorRequestAmino): QueryUpgradeErrorRequest { + const message = createBaseQueryUpgradeErrorRequest(); + if (object.port_id !== undefined && object.port_id !== null) { + message.portId = object.port_id; + } + if (object.channel_id !== undefined && object.channel_id !== null) { + message.channelId = object.channel_id; + } + return message; + }, + toAmino(message: QueryUpgradeErrorRequest): QueryUpgradeErrorRequestAmino { + const obj: any = {}; + obj.port_id = message.portId; + obj.channel_id = message.channelId; + return obj; + }, + fromAminoMsg(object: QueryUpgradeErrorRequestAminoMsg): QueryUpgradeErrorRequest { + return QueryUpgradeErrorRequest.fromAmino(object.value); + }, + toAminoMsg(message: QueryUpgradeErrorRequest): QueryUpgradeErrorRequestAminoMsg { + return { + type: "cosmos-sdk/QueryUpgradeErrorRequest", + value: QueryUpgradeErrorRequest.toAmino(message) + }; + }, + fromProtoMsg(message: QueryUpgradeErrorRequestProtoMsg): QueryUpgradeErrorRequest { + return QueryUpgradeErrorRequest.decode(message.value); + }, + toProto(message: QueryUpgradeErrorRequest): Uint8Array { + return QueryUpgradeErrorRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryUpgradeErrorRequest): QueryUpgradeErrorRequestProtoMsg { + return { + typeUrl: "/ibc.core.channel.v1.QueryUpgradeErrorRequest", + value: QueryUpgradeErrorRequest.encode(message).finish() + }; + } +}; +function createBaseQueryUpgradeErrorResponse(): QueryUpgradeErrorResponse { + return { + errorReceipt: ErrorReceipt.fromPartial({}), + proof: new Uint8Array(), + proofHeight: Height.fromPartial({}) + }; +} +export const QueryUpgradeErrorResponse = { + typeUrl: "/ibc.core.channel.v1.QueryUpgradeErrorResponse", + encode(message: QueryUpgradeErrorResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.errorReceipt !== undefined) { + ErrorReceipt.encode(message.errorReceipt, writer.uint32(10).fork()).ldelim(); + } + if (message.proof.length !== 0) { + writer.uint32(18).bytes(message.proof); + } + if (message.proofHeight !== undefined) { + Height.encode(message.proofHeight, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryUpgradeErrorResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryUpgradeErrorResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.errorReceipt = ErrorReceipt.decode(reader, reader.uint32()); + break; + case 2: + message.proof = reader.bytes(); + break; + case 3: + message.proofHeight = Height.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryUpgradeErrorResponse { + const message = createBaseQueryUpgradeErrorResponse(); + message.errorReceipt = object.errorReceipt !== undefined && object.errorReceipt !== null ? ErrorReceipt.fromPartial(object.errorReceipt) : undefined; + message.proof = object.proof ?? new Uint8Array(); + message.proofHeight = object.proofHeight !== undefined && object.proofHeight !== null ? Height.fromPartial(object.proofHeight) : undefined; + return message; + }, + fromAmino(object: QueryUpgradeErrorResponseAmino): QueryUpgradeErrorResponse { + const message = createBaseQueryUpgradeErrorResponse(); + if (object.error_receipt !== undefined && object.error_receipt !== null) { + message.errorReceipt = ErrorReceipt.fromAmino(object.error_receipt); + } + if (object.proof !== undefined && object.proof !== null) { + message.proof = bytesFromBase64(object.proof); + } + if (object.proof_height !== undefined && object.proof_height !== null) { + message.proofHeight = Height.fromAmino(object.proof_height); + } + return message; + }, + toAmino(message: QueryUpgradeErrorResponse): QueryUpgradeErrorResponseAmino { + const obj: any = {}; + obj.error_receipt = message.errorReceipt ? ErrorReceipt.toAmino(message.errorReceipt) : undefined; + obj.proof = message.proof ? base64FromBytes(message.proof) : undefined; + obj.proof_height = message.proofHeight ? Height.toAmino(message.proofHeight) : {}; + return obj; + }, + fromAminoMsg(object: QueryUpgradeErrorResponseAminoMsg): QueryUpgradeErrorResponse { + return QueryUpgradeErrorResponse.fromAmino(object.value); + }, + toAminoMsg(message: QueryUpgradeErrorResponse): QueryUpgradeErrorResponseAminoMsg { + return { + type: "cosmos-sdk/QueryUpgradeErrorResponse", + value: QueryUpgradeErrorResponse.toAmino(message) + }; + }, + fromProtoMsg(message: QueryUpgradeErrorResponseProtoMsg): QueryUpgradeErrorResponse { + return QueryUpgradeErrorResponse.decode(message.value); + }, + toProto(message: QueryUpgradeErrorResponse): Uint8Array { + return QueryUpgradeErrorResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryUpgradeErrorResponse): QueryUpgradeErrorResponseProtoMsg { + return { + typeUrl: "/ibc.core.channel.v1.QueryUpgradeErrorResponse", + value: QueryUpgradeErrorResponse.encode(message).finish() + }; + } +}; +function createBaseQueryUpgradeRequest(): QueryUpgradeRequest { + return { + portId: "", + channelId: "" + }; +} +export const QueryUpgradeRequest = { + typeUrl: "/ibc.core.channel.v1.QueryUpgradeRequest", + encode(message: QueryUpgradeRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.portId !== "") { + writer.uint32(10).string(message.portId); + } + if (message.channelId !== "") { + writer.uint32(18).string(message.channelId); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryUpgradeRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryUpgradeRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.portId = reader.string(); + break; + case 2: + message.channelId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryUpgradeRequest { + const message = createBaseQueryUpgradeRequest(); + message.portId = object.portId ?? ""; + message.channelId = object.channelId ?? ""; + return message; + }, + fromAmino(object: QueryUpgradeRequestAmino): QueryUpgradeRequest { + const message = createBaseQueryUpgradeRequest(); + if (object.port_id !== undefined && object.port_id !== null) { + message.portId = object.port_id; + } + if (object.channel_id !== undefined && object.channel_id !== null) { + message.channelId = object.channel_id; + } + return message; + }, + toAmino(message: QueryUpgradeRequest): QueryUpgradeRequestAmino { + const obj: any = {}; + obj.port_id = message.portId; + obj.channel_id = message.channelId; + return obj; + }, + fromAminoMsg(object: QueryUpgradeRequestAminoMsg): QueryUpgradeRequest { + return QueryUpgradeRequest.fromAmino(object.value); + }, + toAminoMsg(message: QueryUpgradeRequest): QueryUpgradeRequestAminoMsg { + return { + type: "cosmos-sdk/QueryUpgradeRequest", + value: QueryUpgradeRequest.toAmino(message) + }; + }, + fromProtoMsg(message: QueryUpgradeRequestProtoMsg): QueryUpgradeRequest { + return QueryUpgradeRequest.decode(message.value); + }, + toProto(message: QueryUpgradeRequest): Uint8Array { + return QueryUpgradeRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryUpgradeRequest): QueryUpgradeRequestProtoMsg { + return { + typeUrl: "/ibc.core.channel.v1.QueryUpgradeRequest", + value: QueryUpgradeRequest.encode(message).finish() + }; + } +}; +function createBaseQueryUpgradeResponse(): QueryUpgradeResponse { + return { + upgrade: Upgrade.fromPartial({}), + proof: new Uint8Array(), + proofHeight: Height.fromPartial({}) + }; +} +export const QueryUpgradeResponse = { + typeUrl: "/ibc.core.channel.v1.QueryUpgradeResponse", + encode(message: QueryUpgradeResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.upgrade !== undefined) { + Upgrade.encode(message.upgrade, writer.uint32(10).fork()).ldelim(); + } + if (message.proof.length !== 0) { + writer.uint32(18).bytes(message.proof); + } + if (message.proofHeight !== undefined) { + Height.encode(message.proofHeight, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryUpgradeResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryUpgradeResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.upgrade = Upgrade.decode(reader, reader.uint32()); + break; + case 2: + message.proof = reader.bytes(); + break; + case 3: + message.proofHeight = Height.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryUpgradeResponse { + const message = createBaseQueryUpgradeResponse(); + message.upgrade = object.upgrade !== undefined && object.upgrade !== null ? Upgrade.fromPartial(object.upgrade) : undefined; + message.proof = object.proof ?? new Uint8Array(); + message.proofHeight = object.proofHeight !== undefined && object.proofHeight !== null ? Height.fromPartial(object.proofHeight) : undefined; + return message; + }, + fromAmino(object: QueryUpgradeResponseAmino): QueryUpgradeResponse { + const message = createBaseQueryUpgradeResponse(); + if (object.upgrade !== undefined && object.upgrade !== null) { + message.upgrade = Upgrade.fromAmino(object.upgrade); + } + if (object.proof !== undefined && object.proof !== null) { + message.proof = bytesFromBase64(object.proof); + } + if (object.proof_height !== undefined && object.proof_height !== null) { + message.proofHeight = Height.fromAmino(object.proof_height); + } + return message; + }, + toAmino(message: QueryUpgradeResponse): QueryUpgradeResponseAmino { + const obj: any = {}; + obj.upgrade = message.upgrade ? Upgrade.toAmino(message.upgrade) : undefined; + obj.proof = message.proof ? base64FromBytes(message.proof) : undefined; + obj.proof_height = message.proofHeight ? Height.toAmino(message.proofHeight) : {}; + return obj; + }, + fromAminoMsg(object: QueryUpgradeResponseAminoMsg): QueryUpgradeResponse { + return QueryUpgradeResponse.fromAmino(object.value); + }, + toAminoMsg(message: QueryUpgradeResponse): QueryUpgradeResponseAminoMsg { + return { + type: "cosmos-sdk/QueryUpgradeResponse", + value: QueryUpgradeResponse.toAmino(message) + }; + }, + fromProtoMsg(message: QueryUpgradeResponseProtoMsg): QueryUpgradeResponse { + return QueryUpgradeResponse.decode(message.value); + }, + toProto(message: QueryUpgradeResponse): Uint8Array { + return QueryUpgradeResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryUpgradeResponse): QueryUpgradeResponseProtoMsg { + return { + typeUrl: "/ibc.core.channel.v1.QueryUpgradeResponse", + value: QueryUpgradeResponse.encode(message).finish() + }; + } +}; +function createBaseQueryChannelParamsRequest(): QueryChannelParamsRequest { + return {}; +} +export const QueryChannelParamsRequest = { + typeUrl: "/ibc.core.channel.v1.QueryChannelParamsRequest", + encode(_: QueryChannelParamsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryChannelParamsRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryChannelParamsRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): QueryChannelParamsRequest { + const message = createBaseQueryChannelParamsRequest(); + return message; + }, + fromAmino(_: QueryChannelParamsRequestAmino): QueryChannelParamsRequest { + const message = createBaseQueryChannelParamsRequest(); + return message; + }, + toAmino(_: QueryChannelParamsRequest): QueryChannelParamsRequestAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: QueryChannelParamsRequestAminoMsg): QueryChannelParamsRequest { + return QueryChannelParamsRequest.fromAmino(object.value); + }, + toAminoMsg(message: QueryChannelParamsRequest): QueryChannelParamsRequestAminoMsg { + return { + type: "cosmos-sdk/QueryChannelParamsRequest", + value: QueryChannelParamsRequest.toAmino(message) + }; + }, + fromProtoMsg(message: QueryChannelParamsRequestProtoMsg): QueryChannelParamsRequest { + return QueryChannelParamsRequest.decode(message.value); + }, + toProto(message: QueryChannelParamsRequest): Uint8Array { + return QueryChannelParamsRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryChannelParamsRequest): QueryChannelParamsRequestProtoMsg { + return { + typeUrl: "/ibc.core.channel.v1.QueryChannelParamsRequest", + value: QueryChannelParamsRequest.encode(message).finish() + }; + } +}; +function createBaseQueryChannelParamsResponse(): QueryChannelParamsResponse { + return { + params: undefined + }; +} +export const QueryChannelParamsResponse = { + typeUrl: "/ibc.core.channel.v1.QueryChannelParamsResponse", + encode(message: QueryChannelParamsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.params !== undefined) { + Params.encode(message.params, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryChannelParamsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryChannelParamsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.params = Params.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryChannelParamsResponse { + const message = createBaseQueryChannelParamsResponse(); + message.params = object.params !== undefined && object.params !== null ? Params.fromPartial(object.params) : undefined; + return message; + }, + fromAmino(object: QueryChannelParamsResponseAmino): QueryChannelParamsResponse { + const message = createBaseQueryChannelParamsResponse(); + if (object.params !== undefined && object.params !== null) { + message.params = Params.fromAmino(object.params); + } + return message; + }, + toAmino(message: QueryChannelParamsResponse): QueryChannelParamsResponseAmino { + const obj: any = {}; + obj.params = message.params ? Params.toAmino(message.params) : undefined; + return obj; + }, + fromAminoMsg(object: QueryChannelParamsResponseAminoMsg): QueryChannelParamsResponse { + return QueryChannelParamsResponse.fromAmino(object.value); + }, + toAminoMsg(message: QueryChannelParamsResponse): QueryChannelParamsResponseAminoMsg { + return { + type: "cosmos-sdk/QueryChannelParamsResponse", + value: QueryChannelParamsResponse.toAmino(message) + }; + }, + fromProtoMsg(message: QueryChannelParamsResponseProtoMsg): QueryChannelParamsResponse { + return QueryChannelParamsResponse.decode(message.value); + }, + toProto(message: QueryChannelParamsResponse): Uint8Array { + return QueryChannelParamsResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryChannelParamsResponse): QueryChannelParamsResponseProtoMsg { + return { + typeUrl: "/ibc.core.channel.v1.QueryChannelParamsResponse", + value: QueryChannelParamsResponse.encode(message).finish() + }; + } }; \ No newline at end of file diff --git a/packages/osmo-query/src/codegen/ibc/core/channel/v1/tx.amino.ts b/packages/osmo-query/src/codegen/ibc/core/channel/v1/tx.amino.ts index 1e278a9dc..99a75e608 100644 --- a/packages/osmo-query/src/codegen/ibc/core/channel/v1/tx.amino.ts +++ b/packages/osmo-query/src/codegen/ibc/core/channel/v1/tx.amino.ts @@ -1,5 +1,5 @@ //@ts-nocheck -import { MsgChannelOpenInit, MsgChannelOpenTry, MsgChannelOpenAck, MsgChannelOpenConfirm, MsgChannelCloseInit, MsgChannelCloseConfirm, MsgRecvPacket, MsgTimeout, MsgTimeoutOnClose, MsgAcknowledgement } from "./tx"; +import { MsgChannelOpenInit, MsgChannelOpenTry, MsgChannelOpenAck, MsgChannelOpenConfirm, MsgChannelCloseInit, MsgChannelCloseConfirm, MsgRecvPacket, MsgTimeout, MsgTimeoutOnClose, MsgAcknowledgement, MsgChannelUpgradeInit, MsgChannelUpgradeTry, MsgChannelUpgradeAck, MsgChannelUpgradeConfirm, MsgChannelUpgradeOpen, MsgChannelUpgradeTimeout, MsgChannelUpgradeCancel, MsgUpdateParams, MsgPruneAcknowledgements } from "./tx"; export const AminoConverter = { "/ibc.core.channel.v1.MsgChannelOpenInit": { aminoType: "cosmos-sdk/MsgChannelOpenInit", @@ -50,5 +50,50 @@ export const AminoConverter = { aminoType: "cosmos-sdk/MsgAcknowledgement", toAmino: MsgAcknowledgement.toAmino, fromAmino: MsgAcknowledgement.fromAmino + }, + "/ibc.core.channel.v1.MsgChannelUpgradeInit": { + aminoType: "cosmos-sdk/MsgChannelUpgradeInit", + toAmino: MsgChannelUpgradeInit.toAmino, + fromAmino: MsgChannelUpgradeInit.fromAmino + }, + "/ibc.core.channel.v1.MsgChannelUpgradeTry": { + aminoType: "cosmos-sdk/MsgChannelUpgradeTry", + toAmino: MsgChannelUpgradeTry.toAmino, + fromAmino: MsgChannelUpgradeTry.fromAmino + }, + "/ibc.core.channel.v1.MsgChannelUpgradeAck": { + aminoType: "cosmos-sdk/MsgChannelUpgradeAck", + toAmino: MsgChannelUpgradeAck.toAmino, + fromAmino: MsgChannelUpgradeAck.fromAmino + }, + "/ibc.core.channel.v1.MsgChannelUpgradeConfirm": { + aminoType: "cosmos-sdk/MsgChannelUpgradeConfirm", + toAmino: MsgChannelUpgradeConfirm.toAmino, + fromAmino: MsgChannelUpgradeConfirm.fromAmino + }, + "/ibc.core.channel.v1.MsgChannelUpgradeOpen": { + aminoType: "cosmos-sdk/MsgChannelUpgradeOpen", + toAmino: MsgChannelUpgradeOpen.toAmino, + fromAmino: MsgChannelUpgradeOpen.fromAmino + }, + "/ibc.core.channel.v1.MsgChannelUpgradeTimeout": { + aminoType: "cosmos-sdk/MsgChannelUpgradeTimeout", + toAmino: MsgChannelUpgradeTimeout.toAmino, + fromAmino: MsgChannelUpgradeTimeout.fromAmino + }, + "/ibc.core.channel.v1.MsgChannelUpgradeCancel": { + aminoType: "cosmos-sdk/MsgChannelUpgradeCancel", + toAmino: MsgChannelUpgradeCancel.toAmino, + fromAmino: MsgChannelUpgradeCancel.fromAmino + }, + "/ibc.core.channel.v1.MsgUpdateParams": { + aminoType: "cosmos-sdk/MsgUpdateParams", + toAmino: MsgUpdateParams.toAmino, + fromAmino: MsgUpdateParams.fromAmino + }, + "/ibc.core.channel.v1.MsgPruneAcknowledgements": { + aminoType: "cosmos-sdk/MsgPruneAcknowledgements", + toAmino: MsgPruneAcknowledgements.toAmino, + fromAmino: MsgPruneAcknowledgements.fromAmino } }; \ No newline at end of file diff --git a/packages/osmo-query/src/codegen/ibc/core/channel/v1/tx.registry.ts b/packages/osmo-query/src/codegen/ibc/core/channel/v1/tx.registry.ts index dbcbbecd7..f53ffbd95 100644 --- a/packages/osmo-query/src/codegen/ibc/core/channel/v1/tx.registry.ts +++ b/packages/osmo-query/src/codegen/ibc/core/channel/v1/tx.registry.ts @@ -1,7 +1,7 @@ //@ts-nocheck import { GeneratedType, Registry } from "@cosmjs/proto-signing"; -import { MsgChannelOpenInit, MsgChannelOpenTry, MsgChannelOpenAck, MsgChannelOpenConfirm, MsgChannelCloseInit, MsgChannelCloseConfirm, MsgRecvPacket, MsgTimeout, MsgTimeoutOnClose, MsgAcknowledgement } from "./tx"; -export const registry: ReadonlyArray<[string, GeneratedType]> = [["/ibc.core.channel.v1.MsgChannelOpenInit", MsgChannelOpenInit], ["/ibc.core.channel.v1.MsgChannelOpenTry", MsgChannelOpenTry], ["/ibc.core.channel.v1.MsgChannelOpenAck", MsgChannelOpenAck], ["/ibc.core.channel.v1.MsgChannelOpenConfirm", MsgChannelOpenConfirm], ["/ibc.core.channel.v1.MsgChannelCloseInit", MsgChannelCloseInit], ["/ibc.core.channel.v1.MsgChannelCloseConfirm", MsgChannelCloseConfirm], ["/ibc.core.channel.v1.MsgRecvPacket", MsgRecvPacket], ["/ibc.core.channel.v1.MsgTimeout", MsgTimeout], ["/ibc.core.channel.v1.MsgTimeoutOnClose", MsgTimeoutOnClose], ["/ibc.core.channel.v1.MsgAcknowledgement", MsgAcknowledgement]]; +import { MsgChannelOpenInit, MsgChannelOpenTry, MsgChannelOpenAck, MsgChannelOpenConfirm, MsgChannelCloseInit, MsgChannelCloseConfirm, MsgRecvPacket, MsgTimeout, MsgTimeoutOnClose, MsgAcknowledgement, MsgChannelUpgradeInit, MsgChannelUpgradeTry, MsgChannelUpgradeAck, MsgChannelUpgradeConfirm, MsgChannelUpgradeOpen, MsgChannelUpgradeTimeout, MsgChannelUpgradeCancel, MsgUpdateParams, MsgPruneAcknowledgements } from "./tx"; +export const registry: ReadonlyArray<[string, GeneratedType]> = [["/ibc.core.channel.v1.MsgChannelOpenInit", MsgChannelOpenInit], ["/ibc.core.channel.v1.MsgChannelOpenTry", MsgChannelOpenTry], ["/ibc.core.channel.v1.MsgChannelOpenAck", MsgChannelOpenAck], ["/ibc.core.channel.v1.MsgChannelOpenConfirm", MsgChannelOpenConfirm], ["/ibc.core.channel.v1.MsgChannelCloseInit", MsgChannelCloseInit], ["/ibc.core.channel.v1.MsgChannelCloseConfirm", MsgChannelCloseConfirm], ["/ibc.core.channel.v1.MsgRecvPacket", MsgRecvPacket], ["/ibc.core.channel.v1.MsgTimeout", MsgTimeout], ["/ibc.core.channel.v1.MsgTimeoutOnClose", MsgTimeoutOnClose], ["/ibc.core.channel.v1.MsgAcknowledgement", MsgAcknowledgement], ["/ibc.core.channel.v1.MsgChannelUpgradeInit", MsgChannelUpgradeInit], ["/ibc.core.channel.v1.MsgChannelUpgradeTry", MsgChannelUpgradeTry], ["/ibc.core.channel.v1.MsgChannelUpgradeAck", MsgChannelUpgradeAck], ["/ibc.core.channel.v1.MsgChannelUpgradeConfirm", MsgChannelUpgradeConfirm], ["/ibc.core.channel.v1.MsgChannelUpgradeOpen", MsgChannelUpgradeOpen], ["/ibc.core.channel.v1.MsgChannelUpgradeTimeout", MsgChannelUpgradeTimeout], ["/ibc.core.channel.v1.MsgChannelUpgradeCancel", MsgChannelUpgradeCancel], ["/ibc.core.channel.v1.MsgUpdateParams", MsgUpdateParams], ["/ibc.core.channel.v1.MsgPruneAcknowledgements", MsgPruneAcknowledgements]]; export const load = (protoRegistry: Registry) => { registry.forEach(([typeUrl, mod]) => { protoRegistry.register(typeUrl, mod); @@ -68,6 +68,60 @@ export const MessageComposer = { typeUrl: "/ibc.core.channel.v1.MsgAcknowledgement", value: MsgAcknowledgement.encode(value).finish() }; + }, + channelUpgradeInit(value: MsgChannelUpgradeInit) { + return { + typeUrl: "/ibc.core.channel.v1.MsgChannelUpgradeInit", + value: MsgChannelUpgradeInit.encode(value).finish() + }; + }, + channelUpgradeTry(value: MsgChannelUpgradeTry) { + return { + typeUrl: "/ibc.core.channel.v1.MsgChannelUpgradeTry", + value: MsgChannelUpgradeTry.encode(value).finish() + }; + }, + channelUpgradeAck(value: MsgChannelUpgradeAck) { + return { + typeUrl: "/ibc.core.channel.v1.MsgChannelUpgradeAck", + value: MsgChannelUpgradeAck.encode(value).finish() + }; + }, + channelUpgradeConfirm(value: MsgChannelUpgradeConfirm) { + return { + typeUrl: "/ibc.core.channel.v1.MsgChannelUpgradeConfirm", + value: MsgChannelUpgradeConfirm.encode(value).finish() + }; + }, + channelUpgradeOpen(value: MsgChannelUpgradeOpen) { + return { + typeUrl: "/ibc.core.channel.v1.MsgChannelUpgradeOpen", + value: MsgChannelUpgradeOpen.encode(value).finish() + }; + }, + channelUpgradeTimeout(value: MsgChannelUpgradeTimeout) { + return { + typeUrl: "/ibc.core.channel.v1.MsgChannelUpgradeTimeout", + value: MsgChannelUpgradeTimeout.encode(value).finish() + }; + }, + channelUpgradeCancel(value: MsgChannelUpgradeCancel) { + return { + typeUrl: "/ibc.core.channel.v1.MsgChannelUpgradeCancel", + value: MsgChannelUpgradeCancel.encode(value).finish() + }; + }, + updateChannelParams(value: MsgUpdateParams) { + return { + typeUrl: "/ibc.core.channel.v1.MsgUpdateParams", + value: MsgUpdateParams.encode(value).finish() + }; + }, + pruneAcknowledgements(value: MsgPruneAcknowledgements) { + return { + typeUrl: "/ibc.core.channel.v1.MsgPruneAcknowledgements", + value: MsgPruneAcknowledgements.encode(value).finish() + }; } }, withTypeUrl: { @@ -130,6 +184,60 @@ export const MessageComposer = { typeUrl: "/ibc.core.channel.v1.MsgAcknowledgement", value }; + }, + channelUpgradeInit(value: MsgChannelUpgradeInit) { + return { + typeUrl: "/ibc.core.channel.v1.MsgChannelUpgradeInit", + value + }; + }, + channelUpgradeTry(value: MsgChannelUpgradeTry) { + return { + typeUrl: "/ibc.core.channel.v1.MsgChannelUpgradeTry", + value + }; + }, + channelUpgradeAck(value: MsgChannelUpgradeAck) { + return { + typeUrl: "/ibc.core.channel.v1.MsgChannelUpgradeAck", + value + }; + }, + channelUpgradeConfirm(value: MsgChannelUpgradeConfirm) { + return { + typeUrl: "/ibc.core.channel.v1.MsgChannelUpgradeConfirm", + value + }; + }, + channelUpgradeOpen(value: MsgChannelUpgradeOpen) { + return { + typeUrl: "/ibc.core.channel.v1.MsgChannelUpgradeOpen", + value + }; + }, + channelUpgradeTimeout(value: MsgChannelUpgradeTimeout) { + return { + typeUrl: "/ibc.core.channel.v1.MsgChannelUpgradeTimeout", + value + }; + }, + channelUpgradeCancel(value: MsgChannelUpgradeCancel) { + return { + typeUrl: "/ibc.core.channel.v1.MsgChannelUpgradeCancel", + value + }; + }, + updateChannelParams(value: MsgUpdateParams) { + return { + typeUrl: "/ibc.core.channel.v1.MsgUpdateParams", + value + }; + }, + pruneAcknowledgements(value: MsgPruneAcknowledgements) { + return { + typeUrl: "/ibc.core.channel.v1.MsgPruneAcknowledgements", + value + }; } }, fromPartial: { @@ -192,6 +300,60 @@ export const MessageComposer = { typeUrl: "/ibc.core.channel.v1.MsgAcknowledgement", value: MsgAcknowledgement.fromPartial(value) }; + }, + channelUpgradeInit(value: MsgChannelUpgradeInit) { + return { + typeUrl: "/ibc.core.channel.v1.MsgChannelUpgradeInit", + value: MsgChannelUpgradeInit.fromPartial(value) + }; + }, + channelUpgradeTry(value: MsgChannelUpgradeTry) { + return { + typeUrl: "/ibc.core.channel.v1.MsgChannelUpgradeTry", + value: MsgChannelUpgradeTry.fromPartial(value) + }; + }, + channelUpgradeAck(value: MsgChannelUpgradeAck) { + return { + typeUrl: "/ibc.core.channel.v1.MsgChannelUpgradeAck", + value: MsgChannelUpgradeAck.fromPartial(value) + }; + }, + channelUpgradeConfirm(value: MsgChannelUpgradeConfirm) { + return { + typeUrl: "/ibc.core.channel.v1.MsgChannelUpgradeConfirm", + value: MsgChannelUpgradeConfirm.fromPartial(value) + }; + }, + channelUpgradeOpen(value: MsgChannelUpgradeOpen) { + return { + typeUrl: "/ibc.core.channel.v1.MsgChannelUpgradeOpen", + value: MsgChannelUpgradeOpen.fromPartial(value) + }; + }, + channelUpgradeTimeout(value: MsgChannelUpgradeTimeout) { + return { + typeUrl: "/ibc.core.channel.v1.MsgChannelUpgradeTimeout", + value: MsgChannelUpgradeTimeout.fromPartial(value) + }; + }, + channelUpgradeCancel(value: MsgChannelUpgradeCancel) { + return { + typeUrl: "/ibc.core.channel.v1.MsgChannelUpgradeCancel", + value: MsgChannelUpgradeCancel.fromPartial(value) + }; + }, + updateChannelParams(value: MsgUpdateParams) { + return { + typeUrl: "/ibc.core.channel.v1.MsgUpdateParams", + value: MsgUpdateParams.fromPartial(value) + }; + }, + pruneAcknowledgements(value: MsgPruneAcknowledgements) { + return { + typeUrl: "/ibc.core.channel.v1.MsgPruneAcknowledgements", + value: MsgPruneAcknowledgements.fromPartial(value) + }; } } }; \ No newline at end of file diff --git a/packages/osmo-query/src/codegen/ibc/core/channel/v1/tx.rpc.msg.ts b/packages/osmo-query/src/codegen/ibc/core/channel/v1/tx.rpc.msg.ts index 1429bd672..f014ed56b 100644 --- a/packages/osmo-query/src/codegen/ibc/core/channel/v1/tx.rpc.msg.ts +++ b/packages/osmo-query/src/codegen/ibc/core/channel/v1/tx.rpc.msg.ts @@ -1,6 +1,6 @@ import { Rpc } from "../../../../helpers"; import { BinaryReader } from "../../../../binary"; -import { MsgChannelOpenInit, MsgChannelOpenInitResponse, MsgChannelOpenTry, MsgChannelOpenTryResponse, MsgChannelOpenAck, MsgChannelOpenAckResponse, MsgChannelOpenConfirm, MsgChannelOpenConfirmResponse, MsgChannelCloseInit, MsgChannelCloseInitResponse, MsgChannelCloseConfirm, MsgChannelCloseConfirmResponse, MsgRecvPacket, MsgRecvPacketResponse, MsgTimeout, MsgTimeoutResponse, MsgTimeoutOnClose, MsgTimeoutOnCloseResponse, MsgAcknowledgement, MsgAcknowledgementResponse } from "./tx"; +import { MsgChannelOpenInit, MsgChannelOpenInitResponse, MsgChannelOpenTry, MsgChannelOpenTryResponse, MsgChannelOpenAck, MsgChannelOpenAckResponse, MsgChannelOpenConfirm, MsgChannelOpenConfirmResponse, MsgChannelCloseInit, MsgChannelCloseInitResponse, MsgChannelCloseConfirm, MsgChannelCloseConfirmResponse, MsgRecvPacket, MsgRecvPacketResponse, MsgTimeout, MsgTimeoutResponse, MsgTimeoutOnClose, MsgTimeoutOnCloseResponse, MsgAcknowledgement, MsgAcknowledgementResponse, MsgChannelUpgradeInit, MsgChannelUpgradeInitResponse, MsgChannelUpgradeTry, MsgChannelUpgradeTryResponse, MsgChannelUpgradeAck, MsgChannelUpgradeAckResponse, MsgChannelUpgradeConfirm, MsgChannelUpgradeConfirmResponse, MsgChannelUpgradeOpen, MsgChannelUpgradeOpenResponse, MsgChannelUpgradeTimeout, MsgChannelUpgradeTimeoutResponse, MsgChannelUpgradeCancel, MsgChannelUpgradeCancelResponse, MsgUpdateParams, MsgUpdateParamsResponse, MsgPruneAcknowledgements, MsgPruneAcknowledgementsResponse } from "./tx"; /** Msg defines the ibc/channel Msg service. */ export interface Msg { /** ChannelOpenInit defines a rpc handler method for MsgChannelOpenInit. */ @@ -26,6 +26,24 @@ export interface Msg { timeoutOnClose(request: MsgTimeoutOnClose): Promise; /** Acknowledgement defines a rpc handler method for MsgAcknowledgement. */ acknowledgement(request: MsgAcknowledgement): Promise; + /** ChannelUpgradeInit defines a rpc handler method for MsgChannelUpgradeInit. */ + channelUpgradeInit(request: MsgChannelUpgradeInit): Promise; + /** ChannelUpgradeTry defines a rpc handler method for MsgChannelUpgradeTry. */ + channelUpgradeTry(request: MsgChannelUpgradeTry): Promise; + /** ChannelUpgradeAck defines a rpc handler method for MsgChannelUpgradeAck. */ + channelUpgradeAck(request: MsgChannelUpgradeAck): Promise; + /** ChannelUpgradeConfirm defines a rpc handler method for MsgChannelUpgradeConfirm. */ + channelUpgradeConfirm(request: MsgChannelUpgradeConfirm): Promise; + /** ChannelUpgradeOpen defines a rpc handler method for MsgChannelUpgradeOpen. */ + channelUpgradeOpen(request: MsgChannelUpgradeOpen): Promise; + /** ChannelUpgradeTimeout defines a rpc handler method for MsgChannelUpgradeTimeout. */ + channelUpgradeTimeout(request: MsgChannelUpgradeTimeout): Promise; + /** ChannelUpgradeCancel defines a rpc handler method for MsgChannelUpgradeCancel. */ + channelUpgradeCancel(request: MsgChannelUpgradeCancel): Promise; + /** UpdateChannelParams defines a rpc handler method for MsgUpdateParams. */ + updateChannelParams(request: MsgUpdateParams): Promise; + /** PruneAcknowledgements defines a rpc handler method for MsgPruneAcknowledgements. */ + pruneAcknowledgements(request: MsgPruneAcknowledgements): Promise; } export class MsgClientImpl implements Msg { private readonly rpc: Rpc; @@ -41,6 +59,15 @@ export class MsgClientImpl implements Msg { this.timeout = this.timeout.bind(this); this.timeoutOnClose = this.timeoutOnClose.bind(this); this.acknowledgement = this.acknowledgement.bind(this); + this.channelUpgradeInit = this.channelUpgradeInit.bind(this); + this.channelUpgradeTry = this.channelUpgradeTry.bind(this); + this.channelUpgradeAck = this.channelUpgradeAck.bind(this); + this.channelUpgradeConfirm = this.channelUpgradeConfirm.bind(this); + this.channelUpgradeOpen = this.channelUpgradeOpen.bind(this); + this.channelUpgradeTimeout = this.channelUpgradeTimeout.bind(this); + this.channelUpgradeCancel = this.channelUpgradeCancel.bind(this); + this.updateChannelParams = this.updateChannelParams.bind(this); + this.pruneAcknowledgements = this.pruneAcknowledgements.bind(this); } channelOpenInit(request: MsgChannelOpenInit): Promise { const data = MsgChannelOpenInit.encode(request).finish(); @@ -92,4 +119,49 @@ export class MsgClientImpl implements Msg { const promise = this.rpc.request("ibc.core.channel.v1.Msg", "Acknowledgement", data); return promise.then(data => MsgAcknowledgementResponse.decode(new BinaryReader(data))); } + channelUpgradeInit(request: MsgChannelUpgradeInit): Promise { + const data = MsgChannelUpgradeInit.encode(request).finish(); + const promise = this.rpc.request("ibc.core.channel.v1.Msg", "ChannelUpgradeInit", data); + return promise.then(data => MsgChannelUpgradeInitResponse.decode(new BinaryReader(data))); + } + channelUpgradeTry(request: MsgChannelUpgradeTry): Promise { + const data = MsgChannelUpgradeTry.encode(request).finish(); + const promise = this.rpc.request("ibc.core.channel.v1.Msg", "ChannelUpgradeTry", data); + return promise.then(data => MsgChannelUpgradeTryResponse.decode(new BinaryReader(data))); + } + channelUpgradeAck(request: MsgChannelUpgradeAck): Promise { + const data = MsgChannelUpgradeAck.encode(request).finish(); + const promise = this.rpc.request("ibc.core.channel.v1.Msg", "ChannelUpgradeAck", data); + return promise.then(data => MsgChannelUpgradeAckResponse.decode(new BinaryReader(data))); + } + channelUpgradeConfirm(request: MsgChannelUpgradeConfirm): Promise { + const data = MsgChannelUpgradeConfirm.encode(request).finish(); + const promise = this.rpc.request("ibc.core.channel.v1.Msg", "ChannelUpgradeConfirm", data); + return promise.then(data => MsgChannelUpgradeConfirmResponse.decode(new BinaryReader(data))); + } + channelUpgradeOpen(request: MsgChannelUpgradeOpen): Promise { + const data = MsgChannelUpgradeOpen.encode(request).finish(); + const promise = this.rpc.request("ibc.core.channel.v1.Msg", "ChannelUpgradeOpen", data); + return promise.then(data => MsgChannelUpgradeOpenResponse.decode(new BinaryReader(data))); + } + channelUpgradeTimeout(request: MsgChannelUpgradeTimeout): Promise { + const data = MsgChannelUpgradeTimeout.encode(request).finish(); + const promise = this.rpc.request("ibc.core.channel.v1.Msg", "ChannelUpgradeTimeout", data); + return promise.then(data => MsgChannelUpgradeTimeoutResponse.decode(new BinaryReader(data))); + } + channelUpgradeCancel(request: MsgChannelUpgradeCancel): Promise { + const data = MsgChannelUpgradeCancel.encode(request).finish(); + const promise = this.rpc.request("ibc.core.channel.v1.Msg", "ChannelUpgradeCancel", data); + return promise.then(data => MsgChannelUpgradeCancelResponse.decode(new BinaryReader(data))); + } + updateChannelParams(request: MsgUpdateParams): Promise { + const data = MsgUpdateParams.encode(request).finish(); + const promise = this.rpc.request("ibc.core.channel.v1.Msg", "UpdateChannelParams", data); + return promise.then(data => MsgUpdateParamsResponse.decode(new BinaryReader(data))); + } + pruneAcknowledgements(request: MsgPruneAcknowledgements): Promise { + const data = MsgPruneAcknowledgements.encode(request).finish(); + const promise = this.rpc.request("ibc.core.channel.v1.Msg", "PruneAcknowledgements", data); + return promise.then(data => MsgPruneAcknowledgementsResponse.decode(new BinaryReader(data))); + } } \ No newline at end of file diff --git a/packages/osmo-query/src/codegen/ibc/core/channel/v1/tx.ts b/packages/osmo-query/src/codegen/ibc/core/channel/v1/tx.ts index f6f7344ca..eda8349a2 100644 --- a/packages/osmo-query/src/codegen/ibc/core/channel/v1/tx.ts +++ b/packages/osmo-query/src/codegen/ibc/core/channel/v1/tx.ts @@ -1,7 +1,8 @@ -import { Channel, ChannelAmino, ChannelSDKType, Packet, PacketAmino, PacketSDKType } from "./channel"; -import { Height, HeightAmino, HeightSDKType } from "../../client/v1/client"; +import { Channel, ChannelAmino, ChannelSDKType, Packet, PacketAmino, PacketSDKType, State, stateFromJSON, stateToJSON } from "./channel"; +import { Height, HeightAmino, HeightSDKType, Params, ParamsAmino, ParamsSDKType } from "../../client/v1/client"; +import { UpgradeFields, UpgradeFieldsAmino, UpgradeFieldsSDKType, Upgrade, UpgradeAmino, UpgradeSDKType, ErrorReceipt, ErrorReceiptAmino, ErrorReceiptSDKType } from "./upgrade"; import { BinaryReader, BinaryWriter } from "../../../../binary"; -import { isSet } from "../../../../helpers"; +import { bytesFromBase64, base64FromBytes } from "../../../../helpers"; /** ResponseResultType defines the possible outcomes of the execution of a message */ export enum ResponseResultType { /** RESPONSE_RESULT_TYPE_UNSPECIFIED - Default zero value enumeration */ @@ -10,6 +11,8 @@ export enum ResponseResultType { RESPONSE_RESULT_TYPE_NOOP = 1, /** RESPONSE_RESULT_TYPE_SUCCESS - The message was executed successfully */ RESPONSE_RESULT_TYPE_SUCCESS = 2, + /** RESPONSE_RESULT_TYPE_FAILURE - The message was executed unsuccessfully */ + RESPONSE_RESULT_TYPE_FAILURE = 3, UNRECOGNIZED = -1, } export const ResponseResultTypeSDKType = ResponseResultType; @@ -25,6 +28,9 @@ export function responseResultTypeFromJSON(object: any): ResponseResultType { case 2: case "RESPONSE_RESULT_TYPE_SUCCESS": return ResponseResultType.RESPONSE_RESULT_TYPE_SUCCESS; + case 3: + case "RESPONSE_RESULT_TYPE_FAILURE": + return ResponseResultType.RESPONSE_RESULT_TYPE_FAILURE; case -1: case "UNRECOGNIZED": default: @@ -39,6 +45,8 @@ export function responseResultTypeToJSON(object: ResponseResultType): string { return "RESPONSE_RESULT_TYPE_NOOP"; case ResponseResultType.RESPONSE_RESULT_TYPE_SUCCESS: return "RESPONSE_RESULT_TYPE_SUCCESS"; + case ResponseResultType.RESPONSE_RESULT_TYPE_FAILURE: + return "RESPONSE_RESULT_TYPE_FAILURE"; case ResponseResultType.UNRECOGNIZED: default: return "UNRECOGNIZED"; @@ -62,9 +70,9 @@ export interface MsgChannelOpenInitProtoMsg { * is called by a relayer on Chain A. */ export interface MsgChannelOpenInitAmino { - port_id: string; + port_id?: string; channel?: ChannelAmino; - signer: string; + signer?: string; } export interface MsgChannelOpenInitAminoMsg { type: "cosmos-sdk/MsgChannelOpenInit"; @@ -90,8 +98,8 @@ export interface MsgChannelOpenInitResponseProtoMsg { } /** MsgChannelOpenInitResponse defines the Msg/ChannelOpenInit response type. */ export interface MsgChannelOpenInitResponseAmino { - channel_id: string; - version: string; + channel_id?: string; + version?: string; } export interface MsgChannelOpenInitResponseAminoMsg { type: "cosmos-sdk/MsgChannelOpenInitResponse"; @@ -129,16 +137,16 @@ export interface MsgChannelOpenTryProtoMsg { * value will be ignored by core IBC. */ export interface MsgChannelOpenTryAmino { - port_id: string; + port_id?: string; /** Deprecated: this field is unused. Crossing hello's are no longer supported in core IBC. */ /** @deprecated */ - previous_channel_id: string; + previous_channel_id?: string; /** NOTE: the version field within the channel has been deprecated. Its value will be ignored by core IBC. */ channel?: ChannelAmino; - counterparty_version: string; - proof_init: Uint8Array; + counterparty_version?: string; + proof_init?: string; proof_height?: HeightAmino; - signer: string; + signer?: string; } export interface MsgChannelOpenTryAminoMsg { type: "cosmos-sdk/MsgChannelOpenTry"; @@ -170,8 +178,8 @@ export interface MsgChannelOpenTryResponseProtoMsg { } /** MsgChannelOpenTryResponse defines the Msg/ChannelOpenTry response type. */ export interface MsgChannelOpenTryResponseAmino { - version: string; - channel_id: string; + version?: string; + channel_id?: string; } export interface MsgChannelOpenTryResponseAminoMsg { type: "cosmos-sdk/MsgChannelOpenTryResponse"; @@ -204,13 +212,13 @@ export interface MsgChannelOpenAckProtoMsg { * the change of channel state to TRYOPEN on Chain B. */ export interface MsgChannelOpenAckAmino { - port_id: string; - channel_id: string; - counterparty_channel_id: string; - counterparty_version: string; - proof_try: Uint8Array; + port_id?: string; + channel_id?: string; + counterparty_channel_id?: string; + counterparty_version?: string; + proof_try?: string; proof_height?: HeightAmino; - signer: string; + signer?: string; } export interface MsgChannelOpenAckAminoMsg { type: "cosmos-sdk/MsgChannelOpenAck"; @@ -263,11 +271,11 @@ export interface MsgChannelOpenConfirmProtoMsg { * acknowledge the change of channel state to OPEN on Chain A. */ export interface MsgChannelOpenConfirmAmino { - port_id: string; - channel_id: string; - proof_ack: Uint8Array; + port_id?: string; + channel_id?: string; + proof_ack?: string; proof_height?: HeightAmino; - signer: string; + signer?: string; } export interface MsgChannelOpenConfirmAminoMsg { type: "cosmos-sdk/MsgChannelOpenConfirm"; @@ -325,9 +333,9 @@ export interface MsgChannelCloseInitProtoMsg { * to close a channel with Chain B. */ export interface MsgChannelCloseInitAmino { - port_id: string; - channel_id: string; - signer: string; + port_id?: string; + channel_id?: string; + signer?: string; } export interface MsgChannelCloseInitAminoMsg { type: "cosmos-sdk/MsgChannelCloseInit"; @@ -366,6 +374,7 @@ export interface MsgChannelCloseConfirm { proofInit: Uint8Array; proofHeight: Height; signer: string; + counterpartyUpgradeSequence: bigint; } export interface MsgChannelCloseConfirmProtoMsg { typeUrl: "/ibc.core.channel.v1.MsgChannelCloseConfirm"; @@ -376,11 +385,12 @@ export interface MsgChannelCloseConfirmProtoMsg { * to acknowledge the change of channel state to CLOSED on Chain A. */ export interface MsgChannelCloseConfirmAmino { - port_id: string; - channel_id: string; - proof_init: Uint8Array; + port_id?: string; + channel_id?: string; + proof_init?: string; proof_height?: HeightAmino; - signer: string; + signer?: string; + counterparty_upgrade_sequence?: string; } export interface MsgChannelCloseConfirmAminoMsg { type: "cosmos-sdk/MsgChannelCloseConfirm"; @@ -396,6 +406,7 @@ export interface MsgChannelCloseConfirmSDKType { proof_init: Uint8Array; proof_height: HeightSDKType; signer: string; + counterparty_upgrade_sequence: bigint; } /** * MsgChannelCloseConfirmResponse defines the Msg/ChannelCloseConfirm response @@ -434,9 +445,9 @@ export interface MsgRecvPacketProtoMsg { /** MsgRecvPacket receives incoming IBC packet */ export interface MsgRecvPacketAmino { packet?: PacketAmino; - proof_commitment: Uint8Array; + proof_commitment?: string; proof_height?: HeightAmino; - signer: string; + signer?: string; } export interface MsgRecvPacketAminoMsg { type: "cosmos-sdk/MsgRecvPacket"; @@ -459,7 +470,7 @@ export interface MsgRecvPacketResponseProtoMsg { } /** MsgRecvPacketResponse defines the Msg/RecvPacket response type. */ export interface MsgRecvPacketResponseAmino { - result: ResponseResultType; + result?: ResponseResultType; } export interface MsgRecvPacketResponseAminoMsg { type: "cosmos-sdk/MsgRecvPacketResponse"; @@ -484,10 +495,10 @@ export interface MsgTimeoutProtoMsg { /** MsgTimeout receives timed-out packet */ export interface MsgTimeoutAmino { packet?: PacketAmino; - proof_unreceived: Uint8Array; + proof_unreceived?: string; proof_height?: HeightAmino; - next_sequence_recv: string; - signer: string; + next_sequence_recv?: string; + signer?: string; } export interface MsgTimeoutAminoMsg { type: "cosmos-sdk/MsgTimeout"; @@ -511,7 +522,7 @@ export interface MsgTimeoutResponseProtoMsg { } /** MsgTimeoutResponse defines the Msg/Timeout response type. */ export interface MsgTimeoutResponseAmino { - result: ResponseResultType; + result?: ResponseResultType; } export interface MsgTimeoutResponseAminoMsg { type: "cosmos-sdk/MsgTimeoutResponse"; @@ -529,6 +540,7 @@ export interface MsgTimeoutOnClose { proofHeight: Height; nextSequenceRecv: bigint; signer: string; + counterpartyUpgradeSequence: bigint; } export interface MsgTimeoutOnCloseProtoMsg { typeUrl: "/ibc.core.channel.v1.MsgTimeoutOnClose"; @@ -537,11 +549,12 @@ export interface MsgTimeoutOnCloseProtoMsg { /** MsgTimeoutOnClose timed-out packet upon counterparty channel closure. */ export interface MsgTimeoutOnCloseAmino { packet?: PacketAmino; - proof_unreceived: Uint8Array; - proof_close: Uint8Array; + proof_unreceived?: string; + proof_close?: string; proof_height?: HeightAmino; - next_sequence_recv: string; - signer: string; + next_sequence_recv?: string; + signer?: string; + counterparty_upgrade_sequence?: string; } export interface MsgTimeoutOnCloseAminoMsg { type: "cosmos-sdk/MsgTimeoutOnClose"; @@ -555,6 +568,7 @@ export interface MsgTimeoutOnCloseSDKType { proof_height: HeightSDKType; next_sequence_recv: bigint; signer: string; + counterparty_upgrade_sequence: bigint; } /** MsgTimeoutOnCloseResponse defines the Msg/TimeoutOnClose response type. */ export interface MsgTimeoutOnCloseResponse { @@ -566,7 +580,7 @@ export interface MsgTimeoutOnCloseResponseProtoMsg { } /** MsgTimeoutOnCloseResponse defines the Msg/TimeoutOnClose response type. */ export interface MsgTimeoutOnCloseResponseAmino { - result: ResponseResultType; + result?: ResponseResultType; } export interface MsgTimeoutOnCloseResponseAminoMsg { type: "cosmos-sdk/MsgTimeoutOnCloseResponse"; @@ -591,10 +605,10 @@ export interface MsgAcknowledgementProtoMsg { /** MsgAcknowledgement receives incoming IBC acknowledgement */ export interface MsgAcknowledgementAmino { packet?: PacketAmino; - acknowledgement: Uint8Array; - proof_acked: Uint8Array; + acknowledgement?: string; + proof_acked?: string; proof_height?: HeightAmino; - signer: string; + signer?: string; } export interface MsgAcknowledgementAminoMsg { type: "cosmos-sdk/MsgAcknowledgement"; @@ -618,7 +632,7 @@ export interface MsgAcknowledgementResponseProtoMsg { } /** MsgAcknowledgementResponse defines the Msg/Acknowledgement response type. */ export interface MsgAcknowledgementResponseAmino { - result: ResponseResultType; + result?: ResponseResultType; } export interface MsgAcknowledgementResponseAminoMsg { type: "cosmos-sdk/MsgAcknowledgementResponse"; @@ -628,6 +642,499 @@ export interface MsgAcknowledgementResponseAminoMsg { export interface MsgAcknowledgementResponseSDKType { result: ResponseResultType; } +/** MsgChannelUpgradeInit defines the request type for the ChannelUpgradeInit rpc */ +export interface MsgChannelUpgradeInit { + portId: string; + channelId: string; + fields: UpgradeFields; + signer: string; +} +export interface MsgChannelUpgradeInitProtoMsg { + typeUrl: "/ibc.core.channel.v1.MsgChannelUpgradeInit"; + value: Uint8Array; +} +/** MsgChannelUpgradeInit defines the request type for the ChannelUpgradeInit rpc */ +export interface MsgChannelUpgradeInitAmino { + port_id?: string; + channel_id?: string; + fields?: UpgradeFieldsAmino; + signer?: string; +} +export interface MsgChannelUpgradeInitAminoMsg { + type: "cosmos-sdk/MsgChannelUpgradeInit"; + value: MsgChannelUpgradeInitAmino; +} +/** MsgChannelUpgradeInit defines the request type for the ChannelUpgradeInit rpc */ +export interface MsgChannelUpgradeInitSDKType { + port_id: string; + channel_id: string; + fields: UpgradeFieldsSDKType; + signer: string; +} +/** MsgChannelUpgradeInitResponse defines the MsgChannelUpgradeInit response type */ +export interface MsgChannelUpgradeInitResponse { + upgrade: Upgrade; + upgradeSequence: bigint; +} +export interface MsgChannelUpgradeInitResponseProtoMsg { + typeUrl: "/ibc.core.channel.v1.MsgChannelUpgradeInitResponse"; + value: Uint8Array; +} +/** MsgChannelUpgradeInitResponse defines the MsgChannelUpgradeInit response type */ +export interface MsgChannelUpgradeInitResponseAmino { + upgrade?: UpgradeAmino; + upgrade_sequence?: string; +} +export interface MsgChannelUpgradeInitResponseAminoMsg { + type: "cosmos-sdk/MsgChannelUpgradeInitResponse"; + value: MsgChannelUpgradeInitResponseAmino; +} +/** MsgChannelUpgradeInitResponse defines the MsgChannelUpgradeInit response type */ +export interface MsgChannelUpgradeInitResponseSDKType { + upgrade: UpgradeSDKType; + upgrade_sequence: bigint; +} +/** MsgChannelUpgradeTry defines the request type for the ChannelUpgradeTry rpc */ +export interface MsgChannelUpgradeTry { + portId: string; + channelId: string; + proposedUpgradeConnectionHops: string[]; + counterpartyUpgradeFields: UpgradeFields; + counterpartyUpgradeSequence: bigint; + proofChannel: Uint8Array; + proofUpgrade: Uint8Array; + proofHeight: Height; + signer: string; +} +export interface MsgChannelUpgradeTryProtoMsg { + typeUrl: "/ibc.core.channel.v1.MsgChannelUpgradeTry"; + value: Uint8Array; +} +/** MsgChannelUpgradeTry defines the request type for the ChannelUpgradeTry rpc */ +export interface MsgChannelUpgradeTryAmino { + port_id?: string; + channel_id?: string; + proposed_upgrade_connection_hops?: string[]; + counterparty_upgrade_fields?: UpgradeFieldsAmino; + counterparty_upgrade_sequence?: string; + proof_channel?: string; + proof_upgrade?: string; + proof_height?: HeightAmino; + signer?: string; +} +export interface MsgChannelUpgradeTryAminoMsg { + type: "cosmos-sdk/MsgChannelUpgradeTry"; + value: MsgChannelUpgradeTryAmino; +} +/** MsgChannelUpgradeTry defines the request type for the ChannelUpgradeTry rpc */ +export interface MsgChannelUpgradeTrySDKType { + port_id: string; + channel_id: string; + proposed_upgrade_connection_hops: string[]; + counterparty_upgrade_fields: UpgradeFieldsSDKType; + counterparty_upgrade_sequence: bigint; + proof_channel: Uint8Array; + proof_upgrade: Uint8Array; + proof_height: HeightSDKType; + signer: string; +} +/** MsgChannelUpgradeTryResponse defines the MsgChannelUpgradeTry response type */ +export interface MsgChannelUpgradeTryResponse { + upgrade: Upgrade; + upgradeSequence: bigint; + result: ResponseResultType; +} +export interface MsgChannelUpgradeTryResponseProtoMsg { + typeUrl: "/ibc.core.channel.v1.MsgChannelUpgradeTryResponse"; + value: Uint8Array; +} +/** MsgChannelUpgradeTryResponse defines the MsgChannelUpgradeTry response type */ +export interface MsgChannelUpgradeTryResponseAmino { + upgrade?: UpgradeAmino; + upgrade_sequence?: string; + result?: ResponseResultType; +} +export interface MsgChannelUpgradeTryResponseAminoMsg { + type: "cosmos-sdk/MsgChannelUpgradeTryResponse"; + value: MsgChannelUpgradeTryResponseAmino; +} +/** MsgChannelUpgradeTryResponse defines the MsgChannelUpgradeTry response type */ +export interface MsgChannelUpgradeTryResponseSDKType { + upgrade: UpgradeSDKType; + upgrade_sequence: bigint; + result: ResponseResultType; +} +/** MsgChannelUpgradeAck defines the request type for the ChannelUpgradeAck rpc */ +export interface MsgChannelUpgradeAck { + portId: string; + channelId: string; + counterpartyUpgrade: Upgrade; + proofChannel: Uint8Array; + proofUpgrade: Uint8Array; + proofHeight: Height; + signer: string; +} +export interface MsgChannelUpgradeAckProtoMsg { + typeUrl: "/ibc.core.channel.v1.MsgChannelUpgradeAck"; + value: Uint8Array; +} +/** MsgChannelUpgradeAck defines the request type for the ChannelUpgradeAck rpc */ +export interface MsgChannelUpgradeAckAmino { + port_id?: string; + channel_id?: string; + counterparty_upgrade?: UpgradeAmino; + proof_channel?: string; + proof_upgrade?: string; + proof_height?: HeightAmino; + signer?: string; +} +export interface MsgChannelUpgradeAckAminoMsg { + type: "cosmos-sdk/MsgChannelUpgradeAck"; + value: MsgChannelUpgradeAckAmino; +} +/** MsgChannelUpgradeAck defines the request type for the ChannelUpgradeAck rpc */ +export interface MsgChannelUpgradeAckSDKType { + port_id: string; + channel_id: string; + counterparty_upgrade: UpgradeSDKType; + proof_channel: Uint8Array; + proof_upgrade: Uint8Array; + proof_height: HeightSDKType; + signer: string; +} +/** MsgChannelUpgradeAckResponse defines MsgChannelUpgradeAck response type */ +export interface MsgChannelUpgradeAckResponse { + result: ResponseResultType; +} +export interface MsgChannelUpgradeAckResponseProtoMsg { + typeUrl: "/ibc.core.channel.v1.MsgChannelUpgradeAckResponse"; + value: Uint8Array; +} +/** MsgChannelUpgradeAckResponse defines MsgChannelUpgradeAck response type */ +export interface MsgChannelUpgradeAckResponseAmino { + result?: ResponseResultType; +} +export interface MsgChannelUpgradeAckResponseAminoMsg { + type: "cosmos-sdk/MsgChannelUpgradeAckResponse"; + value: MsgChannelUpgradeAckResponseAmino; +} +/** MsgChannelUpgradeAckResponse defines MsgChannelUpgradeAck response type */ +export interface MsgChannelUpgradeAckResponseSDKType { + result: ResponseResultType; +} +/** MsgChannelUpgradeConfirm defines the request type for the ChannelUpgradeConfirm rpc */ +export interface MsgChannelUpgradeConfirm { + portId: string; + channelId: string; + counterpartyChannelState: State; + counterpartyUpgrade: Upgrade; + proofChannel: Uint8Array; + proofUpgrade: Uint8Array; + proofHeight: Height; + signer: string; +} +export interface MsgChannelUpgradeConfirmProtoMsg { + typeUrl: "/ibc.core.channel.v1.MsgChannelUpgradeConfirm"; + value: Uint8Array; +} +/** MsgChannelUpgradeConfirm defines the request type for the ChannelUpgradeConfirm rpc */ +export interface MsgChannelUpgradeConfirmAmino { + port_id?: string; + channel_id?: string; + counterparty_channel_state?: State; + counterparty_upgrade?: UpgradeAmino; + proof_channel?: string; + proof_upgrade?: string; + proof_height?: HeightAmino; + signer?: string; +} +export interface MsgChannelUpgradeConfirmAminoMsg { + type: "cosmos-sdk/MsgChannelUpgradeConfirm"; + value: MsgChannelUpgradeConfirmAmino; +} +/** MsgChannelUpgradeConfirm defines the request type for the ChannelUpgradeConfirm rpc */ +export interface MsgChannelUpgradeConfirmSDKType { + port_id: string; + channel_id: string; + counterparty_channel_state: State; + counterparty_upgrade: UpgradeSDKType; + proof_channel: Uint8Array; + proof_upgrade: Uint8Array; + proof_height: HeightSDKType; + signer: string; +} +/** MsgChannelUpgradeConfirmResponse defines MsgChannelUpgradeConfirm response type */ +export interface MsgChannelUpgradeConfirmResponse { + result: ResponseResultType; +} +export interface MsgChannelUpgradeConfirmResponseProtoMsg { + typeUrl: "/ibc.core.channel.v1.MsgChannelUpgradeConfirmResponse"; + value: Uint8Array; +} +/** MsgChannelUpgradeConfirmResponse defines MsgChannelUpgradeConfirm response type */ +export interface MsgChannelUpgradeConfirmResponseAmino { + result?: ResponseResultType; +} +export interface MsgChannelUpgradeConfirmResponseAminoMsg { + type: "cosmos-sdk/MsgChannelUpgradeConfirmResponse"; + value: MsgChannelUpgradeConfirmResponseAmino; +} +/** MsgChannelUpgradeConfirmResponse defines MsgChannelUpgradeConfirm response type */ +export interface MsgChannelUpgradeConfirmResponseSDKType { + result: ResponseResultType; +} +/** MsgChannelUpgradeOpen defines the request type for the ChannelUpgradeOpen rpc */ +export interface MsgChannelUpgradeOpen { + portId: string; + channelId: string; + counterpartyChannelState: State; + proofChannel: Uint8Array; + proofHeight: Height; + signer: string; +} +export interface MsgChannelUpgradeOpenProtoMsg { + typeUrl: "/ibc.core.channel.v1.MsgChannelUpgradeOpen"; + value: Uint8Array; +} +/** MsgChannelUpgradeOpen defines the request type for the ChannelUpgradeOpen rpc */ +export interface MsgChannelUpgradeOpenAmino { + port_id?: string; + channel_id?: string; + counterparty_channel_state?: State; + proof_channel?: string; + proof_height?: HeightAmino; + signer?: string; +} +export interface MsgChannelUpgradeOpenAminoMsg { + type: "cosmos-sdk/MsgChannelUpgradeOpen"; + value: MsgChannelUpgradeOpenAmino; +} +/** MsgChannelUpgradeOpen defines the request type for the ChannelUpgradeOpen rpc */ +export interface MsgChannelUpgradeOpenSDKType { + port_id: string; + channel_id: string; + counterparty_channel_state: State; + proof_channel: Uint8Array; + proof_height: HeightSDKType; + signer: string; +} +/** MsgChannelUpgradeOpenResponse defines the MsgChannelUpgradeOpen response type */ +export interface MsgChannelUpgradeOpenResponse {} +export interface MsgChannelUpgradeOpenResponseProtoMsg { + typeUrl: "/ibc.core.channel.v1.MsgChannelUpgradeOpenResponse"; + value: Uint8Array; +} +/** MsgChannelUpgradeOpenResponse defines the MsgChannelUpgradeOpen response type */ +export interface MsgChannelUpgradeOpenResponseAmino {} +export interface MsgChannelUpgradeOpenResponseAminoMsg { + type: "cosmos-sdk/MsgChannelUpgradeOpenResponse"; + value: MsgChannelUpgradeOpenResponseAmino; +} +/** MsgChannelUpgradeOpenResponse defines the MsgChannelUpgradeOpen response type */ +export interface MsgChannelUpgradeOpenResponseSDKType {} +/** MsgChannelUpgradeTimeout defines the request type for the ChannelUpgradeTimeout rpc */ +export interface MsgChannelUpgradeTimeout { + portId: string; + channelId: string; + counterpartyChannel: Channel; + proofChannel: Uint8Array; + proofHeight: Height; + signer: string; +} +export interface MsgChannelUpgradeTimeoutProtoMsg { + typeUrl: "/ibc.core.channel.v1.MsgChannelUpgradeTimeout"; + value: Uint8Array; +} +/** MsgChannelUpgradeTimeout defines the request type for the ChannelUpgradeTimeout rpc */ +export interface MsgChannelUpgradeTimeoutAmino { + port_id?: string; + channel_id?: string; + counterparty_channel?: ChannelAmino; + proof_channel?: string; + proof_height?: HeightAmino; + signer?: string; +} +export interface MsgChannelUpgradeTimeoutAminoMsg { + type: "cosmos-sdk/MsgChannelUpgradeTimeout"; + value: MsgChannelUpgradeTimeoutAmino; +} +/** MsgChannelUpgradeTimeout defines the request type for the ChannelUpgradeTimeout rpc */ +export interface MsgChannelUpgradeTimeoutSDKType { + port_id: string; + channel_id: string; + counterparty_channel: ChannelSDKType; + proof_channel: Uint8Array; + proof_height: HeightSDKType; + signer: string; +} +/** MsgChannelUpgradeTimeoutRepsonse defines the MsgChannelUpgradeTimeout response type */ +export interface MsgChannelUpgradeTimeoutResponse {} +export interface MsgChannelUpgradeTimeoutResponseProtoMsg { + typeUrl: "/ibc.core.channel.v1.MsgChannelUpgradeTimeoutResponse"; + value: Uint8Array; +} +/** MsgChannelUpgradeTimeoutRepsonse defines the MsgChannelUpgradeTimeout response type */ +export interface MsgChannelUpgradeTimeoutResponseAmino {} +export interface MsgChannelUpgradeTimeoutResponseAminoMsg { + type: "cosmos-sdk/MsgChannelUpgradeTimeoutResponse"; + value: MsgChannelUpgradeTimeoutResponseAmino; +} +/** MsgChannelUpgradeTimeoutRepsonse defines the MsgChannelUpgradeTimeout response type */ +export interface MsgChannelUpgradeTimeoutResponseSDKType {} +/** MsgChannelUpgradeCancel defines the request type for the ChannelUpgradeCancel rpc */ +export interface MsgChannelUpgradeCancel { + portId: string; + channelId: string; + errorReceipt: ErrorReceipt; + proofErrorReceipt: Uint8Array; + proofHeight: Height; + signer: string; +} +export interface MsgChannelUpgradeCancelProtoMsg { + typeUrl: "/ibc.core.channel.v1.MsgChannelUpgradeCancel"; + value: Uint8Array; +} +/** MsgChannelUpgradeCancel defines the request type for the ChannelUpgradeCancel rpc */ +export interface MsgChannelUpgradeCancelAmino { + port_id?: string; + channel_id?: string; + error_receipt?: ErrorReceiptAmino; + proof_error_receipt?: string; + proof_height?: HeightAmino; + signer?: string; +} +export interface MsgChannelUpgradeCancelAminoMsg { + type: "cosmos-sdk/MsgChannelUpgradeCancel"; + value: MsgChannelUpgradeCancelAmino; +} +/** MsgChannelUpgradeCancel defines the request type for the ChannelUpgradeCancel rpc */ +export interface MsgChannelUpgradeCancelSDKType { + port_id: string; + channel_id: string; + error_receipt: ErrorReceiptSDKType; + proof_error_receipt: Uint8Array; + proof_height: HeightSDKType; + signer: string; +} +/** MsgChannelUpgradeCancelResponse defines the MsgChannelUpgradeCancel response type */ +export interface MsgChannelUpgradeCancelResponse {} +export interface MsgChannelUpgradeCancelResponseProtoMsg { + typeUrl: "/ibc.core.channel.v1.MsgChannelUpgradeCancelResponse"; + value: Uint8Array; +} +/** MsgChannelUpgradeCancelResponse defines the MsgChannelUpgradeCancel response type */ +export interface MsgChannelUpgradeCancelResponseAmino {} +export interface MsgChannelUpgradeCancelResponseAminoMsg { + type: "cosmos-sdk/MsgChannelUpgradeCancelResponse"; + value: MsgChannelUpgradeCancelResponseAmino; +} +/** MsgChannelUpgradeCancelResponse defines the MsgChannelUpgradeCancel response type */ +export interface MsgChannelUpgradeCancelResponseSDKType {} +/** MsgUpdateParams is the MsgUpdateParams request type. */ +export interface MsgUpdateParams { + /** authority is the address that controls the module (defaults to x/gov unless overwritten). */ + authority: string; + /** + * params defines the channel parameters to update. + * + * NOTE: All parameters must be supplied. + */ + params: Params; +} +export interface MsgUpdateParamsProtoMsg { + typeUrl: "/ibc.core.channel.v1.MsgUpdateParams"; + value: Uint8Array; +} +/** MsgUpdateParams is the MsgUpdateParams request type. */ +export interface MsgUpdateParamsAmino { + /** authority is the address that controls the module (defaults to x/gov unless overwritten). */ + authority?: string; + /** + * params defines the channel parameters to update. + * + * NOTE: All parameters must be supplied. + */ + params?: ParamsAmino; +} +export interface MsgUpdateParamsAminoMsg { + type: "cosmos-sdk/MsgUpdateParams"; + value: MsgUpdateParamsAmino; +} +/** MsgUpdateParams is the MsgUpdateParams request type. */ +export interface MsgUpdateParamsSDKType { + authority: string; + params: ParamsSDKType; +} +/** MsgUpdateParamsResponse defines the MsgUpdateParams response type. */ +export interface MsgUpdateParamsResponse {} +export interface MsgUpdateParamsResponseProtoMsg { + typeUrl: "/ibc.core.channel.v1.MsgUpdateParamsResponse"; + value: Uint8Array; +} +/** MsgUpdateParamsResponse defines the MsgUpdateParams response type. */ +export interface MsgUpdateParamsResponseAmino {} +export interface MsgUpdateParamsResponseAminoMsg { + type: "cosmos-sdk/MsgUpdateParamsResponse"; + value: MsgUpdateParamsResponseAmino; +} +/** MsgUpdateParamsResponse defines the MsgUpdateParams response type. */ +export interface MsgUpdateParamsResponseSDKType {} +/** MsgPruneAcknowledgements defines the request type for the PruneAcknowledgements rpc. */ +export interface MsgPruneAcknowledgements { + portId: string; + channelId: string; + limit: bigint; + signer: string; +} +export interface MsgPruneAcknowledgementsProtoMsg { + typeUrl: "/ibc.core.channel.v1.MsgPruneAcknowledgements"; + value: Uint8Array; +} +/** MsgPruneAcknowledgements defines the request type for the PruneAcknowledgements rpc. */ +export interface MsgPruneAcknowledgementsAmino { + port_id?: string; + channel_id?: string; + limit?: string; + signer?: string; +} +export interface MsgPruneAcknowledgementsAminoMsg { + type: "cosmos-sdk/MsgPruneAcknowledgements"; + value: MsgPruneAcknowledgementsAmino; +} +/** MsgPruneAcknowledgements defines the request type for the PruneAcknowledgements rpc. */ +export interface MsgPruneAcknowledgementsSDKType { + port_id: string; + channel_id: string; + limit: bigint; + signer: string; +} +/** MsgPruneAcknowledgementsResponse defines the response type for the PruneAcknowledgements rpc. */ +export interface MsgPruneAcknowledgementsResponse { + /** Number of sequences pruned (includes both packet acknowledgements and packet receipts where appropriate). */ + totalPrunedSequences: bigint; + /** Number of sequences left after pruning. */ + totalRemainingSequences: bigint; +} +export interface MsgPruneAcknowledgementsResponseProtoMsg { + typeUrl: "/ibc.core.channel.v1.MsgPruneAcknowledgementsResponse"; + value: Uint8Array; +} +/** MsgPruneAcknowledgementsResponse defines the response type for the PruneAcknowledgements rpc. */ +export interface MsgPruneAcknowledgementsResponseAmino { + /** Number of sequences pruned (includes both packet acknowledgements and packet receipts where appropriate). */ + total_pruned_sequences?: string; + /** Number of sequences left after pruning. */ + total_remaining_sequences?: string; +} +export interface MsgPruneAcknowledgementsResponseAminoMsg { + type: "cosmos-sdk/MsgPruneAcknowledgementsResponse"; + value: MsgPruneAcknowledgementsResponseAmino; +} +/** MsgPruneAcknowledgementsResponse defines the response type for the PruneAcknowledgements rpc. */ +export interface MsgPruneAcknowledgementsResponseSDKType { + total_pruned_sequences: bigint; + total_remaining_sequences: bigint; +} function createBaseMsgChannelOpenInit(): MsgChannelOpenInit { return { portId: "", @@ -680,11 +1187,17 @@ export const MsgChannelOpenInit = { return message; }, fromAmino(object: MsgChannelOpenInitAmino): MsgChannelOpenInit { - return { - portId: object.port_id, - channel: object?.channel ? Channel.fromAmino(object.channel) : undefined, - signer: object.signer - }; + const message = createBaseMsgChannelOpenInit(); + if (object.port_id !== undefined && object.port_id !== null) { + message.portId = object.port_id; + } + if (object.channel !== undefined && object.channel !== null) { + message.channel = Channel.fromAmino(object.channel); + } + if (object.signer !== undefined && object.signer !== null) { + message.signer = object.signer; + } + return message; }, toAmino(message: MsgChannelOpenInit): MsgChannelOpenInitAmino { const obj: any = {}; @@ -759,10 +1272,14 @@ export const MsgChannelOpenInitResponse = { return message; }, fromAmino(object: MsgChannelOpenInitResponseAmino): MsgChannelOpenInitResponse { - return { - channelId: object.channel_id, - version: object.version - }; + const message = createBaseMsgChannelOpenInitResponse(); + if (object.channel_id !== undefined && object.channel_id !== null) { + message.channelId = object.channel_id; + } + if (object.version !== undefined && object.version !== null) { + message.version = object.version; + } + return message; }, toAmino(message: MsgChannelOpenInitResponse): MsgChannelOpenInitResponseAmino { const obj: any = {}; @@ -876,15 +1393,29 @@ export const MsgChannelOpenTry = { return message; }, fromAmino(object: MsgChannelOpenTryAmino): MsgChannelOpenTry { - return { - portId: object.port_id, - previousChannelId: object.previous_channel_id, - channel: object?.channel ? Channel.fromAmino(object.channel) : undefined, - counterpartyVersion: object.counterparty_version, - proofInit: object.proof_init, - proofHeight: object?.proof_height ? Height.fromAmino(object.proof_height) : undefined, - signer: object.signer - }; + const message = createBaseMsgChannelOpenTry(); + if (object.port_id !== undefined && object.port_id !== null) { + message.portId = object.port_id; + } + if (object.previous_channel_id !== undefined && object.previous_channel_id !== null) { + message.previousChannelId = object.previous_channel_id; + } + if (object.channel !== undefined && object.channel !== null) { + message.channel = Channel.fromAmino(object.channel); + } + if (object.counterparty_version !== undefined && object.counterparty_version !== null) { + message.counterpartyVersion = object.counterparty_version; + } + if (object.proof_init !== undefined && object.proof_init !== null) { + message.proofInit = bytesFromBase64(object.proof_init); + } + if (object.proof_height !== undefined && object.proof_height !== null) { + message.proofHeight = Height.fromAmino(object.proof_height); + } + if (object.signer !== undefined && object.signer !== null) { + message.signer = object.signer; + } + return message; }, toAmino(message: MsgChannelOpenTry): MsgChannelOpenTryAmino { const obj: any = {}; @@ -892,7 +1423,7 @@ export const MsgChannelOpenTry = { obj.previous_channel_id = message.previousChannelId; obj.channel = message.channel ? Channel.toAmino(message.channel) : undefined; obj.counterparty_version = message.counterpartyVersion; - obj.proof_init = message.proofInit; + obj.proof_init = message.proofInit ? base64FromBytes(message.proofInit) : undefined; obj.proof_height = message.proofHeight ? Height.toAmino(message.proofHeight) : {}; obj.signer = message.signer; return obj; @@ -963,10 +1494,14 @@ export const MsgChannelOpenTryResponse = { return message; }, fromAmino(object: MsgChannelOpenTryResponseAmino): MsgChannelOpenTryResponse { - return { - version: object.version, - channelId: object.channel_id - }; + const message = createBaseMsgChannelOpenTryResponse(); + if (object.version !== undefined && object.version !== null) { + message.version = object.version; + } + if (object.channel_id !== undefined && object.channel_id !== null) { + message.channelId = object.channel_id; + } + return message; }, toAmino(message: MsgChannelOpenTryResponse): MsgChannelOpenTryResponseAmino { const obj: any = {}; @@ -1080,15 +1615,29 @@ export const MsgChannelOpenAck = { return message; }, fromAmino(object: MsgChannelOpenAckAmino): MsgChannelOpenAck { - return { - portId: object.port_id, - channelId: object.channel_id, - counterpartyChannelId: object.counterparty_channel_id, - counterpartyVersion: object.counterparty_version, - proofTry: object.proof_try, - proofHeight: object?.proof_height ? Height.fromAmino(object.proof_height) : undefined, - signer: object.signer - }; + const message = createBaseMsgChannelOpenAck(); + if (object.port_id !== undefined && object.port_id !== null) { + message.portId = object.port_id; + } + if (object.channel_id !== undefined && object.channel_id !== null) { + message.channelId = object.channel_id; + } + if (object.counterparty_channel_id !== undefined && object.counterparty_channel_id !== null) { + message.counterpartyChannelId = object.counterparty_channel_id; + } + if (object.counterparty_version !== undefined && object.counterparty_version !== null) { + message.counterpartyVersion = object.counterparty_version; + } + if (object.proof_try !== undefined && object.proof_try !== null) { + message.proofTry = bytesFromBase64(object.proof_try); + } + if (object.proof_height !== undefined && object.proof_height !== null) { + message.proofHeight = Height.fromAmino(object.proof_height); + } + if (object.signer !== undefined && object.signer !== null) { + message.signer = object.signer; + } + return message; }, toAmino(message: MsgChannelOpenAck): MsgChannelOpenAckAmino { const obj: any = {}; @@ -1096,7 +1645,7 @@ export const MsgChannelOpenAck = { obj.channel_id = message.channelId; obj.counterparty_channel_id = message.counterpartyChannelId; obj.counterparty_version = message.counterpartyVersion; - obj.proof_try = message.proofTry; + obj.proof_try = message.proofTry ? base64FromBytes(message.proofTry) : undefined; obj.proof_height = message.proofHeight ? Height.toAmino(message.proofHeight) : {}; obj.signer = message.signer; return obj; @@ -1150,7 +1699,8 @@ export const MsgChannelOpenAckResponse = { return message; }, fromAmino(_: MsgChannelOpenAckResponseAmino): MsgChannelOpenAckResponse { - return {}; + const message = createBaseMsgChannelOpenAckResponse(); + return message; }, toAmino(_: MsgChannelOpenAckResponse): MsgChannelOpenAckResponseAmino { const obj: any = {}; @@ -1246,19 +1796,29 @@ export const MsgChannelOpenConfirm = { return message; }, fromAmino(object: MsgChannelOpenConfirmAmino): MsgChannelOpenConfirm { - return { - portId: object.port_id, - channelId: object.channel_id, - proofAck: object.proof_ack, - proofHeight: object?.proof_height ? Height.fromAmino(object.proof_height) : undefined, - signer: object.signer - }; - }, + const message = createBaseMsgChannelOpenConfirm(); + if (object.port_id !== undefined && object.port_id !== null) { + message.portId = object.port_id; + } + if (object.channel_id !== undefined && object.channel_id !== null) { + message.channelId = object.channel_id; + } + if (object.proof_ack !== undefined && object.proof_ack !== null) { + message.proofAck = bytesFromBase64(object.proof_ack); + } + if (object.proof_height !== undefined && object.proof_height !== null) { + message.proofHeight = Height.fromAmino(object.proof_height); + } + if (object.signer !== undefined && object.signer !== null) { + message.signer = object.signer; + } + return message; + }, toAmino(message: MsgChannelOpenConfirm): MsgChannelOpenConfirmAmino { const obj: any = {}; obj.port_id = message.portId; obj.channel_id = message.channelId; - obj.proof_ack = message.proofAck; + obj.proof_ack = message.proofAck ? base64FromBytes(message.proofAck) : undefined; obj.proof_height = message.proofHeight ? Height.toAmino(message.proofHeight) : {}; obj.signer = message.signer; return obj; @@ -1312,7 +1872,8 @@ export const MsgChannelOpenConfirmResponse = { return message; }, fromAmino(_: MsgChannelOpenConfirmResponseAmino): MsgChannelOpenConfirmResponse { - return {}; + const message = createBaseMsgChannelOpenConfirmResponse(); + return message; }, toAmino(_: MsgChannelOpenConfirmResponse): MsgChannelOpenConfirmResponseAmino { const obj: any = {}; @@ -1392,11 +1953,17 @@ export const MsgChannelCloseInit = { return message; }, fromAmino(object: MsgChannelCloseInitAmino): MsgChannelCloseInit { - return { - portId: object.port_id, - channelId: object.channel_id, - signer: object.signer - }; + const message = createBaseMsgChannelCloseInit(); + if (object.port_id !== undefined && object.port_id !== null) { + message.portId = object.port_id; + } + if (object.channel_id !== undefined && object.channel_id !== null) { + message.channelId = object.channel_id; + } + if (object.signer !== undefined && object.signer !== null) { + message.signer = object.signer; + } + return message; }, toAmino(message: MsgChannelCloseInit): MsgChannelCloseInitAmino { const obj: any = {}; @@ -1454,7 +2021,8 @@ export const MsgChannelCloseInitResponse = { return message; }, fromAmino(_: MsgChannelCloseInitResponseAmino): MsgChannelCloseInitResponse { - return {}; + const message = createBaseMsgChannelCloseInitResponse(); + return message; }, toAmino(_: MsgChannelCloseInitResponse): MsgChannelCloseInitResponseAmino { const obj: any = {}; @@ -1488,7 +2056,8 @@ function createBaseMsgChannelCloseConfirm(): MsgChannelCloseConfirm { channelId: "", proofInit: new Uint8Array(), proofHeight: Height.fromPartial({}), - signer: "" + signer: "", + counterpartyUpgradeSequence: BigInt(0) }; } export const MsgChannelCloseConfirm = { @@ -1509,6 +2078,9 @@ export const MsgChannelCloseConfirm = { if (message.signer !== "") { writer.uint32(42).string(message.signer); } + if (message.counterpartyUpgradeSequence !== BigInt(0)) { + writer.uint32(48).uint64(message.counterpartyUpgradeSequence); + } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): MsgChannelCloseConfirm { @@ -1533,6 +2105,9 @@ export const MsgChannelCloseConfirm = { case 5: message.signer = reader.string(); break; + case 6: + message.counterpartyUpgradeSequence = reader.uint64(); + break; default: reader.skipType(tag & 7); break; @@ -1547,24 +2122,39 @@ export const MsgChannelCloseConfirm = { message.proofInit = object.proofInit ?? new Uint8Array(); message.proofHeight = object.proofHeight !== undefined && object.proofHeight !== null ? Height.fromPartial(object.proofHeight) : undefined; message.signer = object.signer ?? ""; + message.counterpartyUpgradeSequence = object.counterpartyUpgradeSequence !== undefined && object.counterpartyUpgradeSequence !== null ? BigInt(object.counterpartyUpgradeSequence.toString()) : BigInt(0); return message; }, fromAmino(object: MsgChannelCloseConfirmAmino): MsgChannelCloseConfirm { - return { - portId: object.port_id, - channelId: object.channel_id, - proofInit: object.proof_init, - proofHeight: object?.proof_height ? Height.fromAmino(object.proof_height) : undefined, - signer: object.signer - }; + const message = createBaseMsgChannelCloseConfirm(); + if (object.port_id !== undefined && object.port_id !== null) { + message.portId = object.port_id; + } + if (object.channel_id !== undefined && object.channel_id !== null) { + message.channelId = object.channel_id; + } + if (object.proof_init !== undefined && object.proof_init !== null) { + message.proofInit = bytesFromBase64(object.proof_init); + } + if (object.proof_height !== undefined && object.proof_height !== null) { + message.proofHeight = Height.fromAmino(object.proof_height); + } + if (object.signer !== undefined && object.signer !== null) { + message.signer = object.signer; + } + if (object.counterparty_upgrade_sequence !== undefined && object.counterparty_upgrade_sequence !== null) { + message.counterpartyUpgradeSequence = BigInt(object.counterparty_upgrade_sequence); + } + return message; }, toAmino(message: MsgChannelCloseConfirm): MsgChannelCloseConfirmAmino { const obj: any = {}; obj.port_id = message.portId; obj.channel_id = message.channelId; - obj.proof_init = message.proofInit; + obj.proof_init = message.proofInit ? base64FromBytes(message.proofInit) : undefined; obj.proof_height = message.proofHeight ? Height.toAmino(message.proofHeight) : {}; obj.signer = message.signer; + obj.counterparty_upgrade_sequence = message.counterpartyUpgradeSequence ? message.counterpartyUpgradeSequence.toString() : undefined; return obj; }, fromAminoMsg(object: MsgChannelCloseConfirmAminoMsg): MsgChannelCloseConfirm { @@ -1616,7 +2206,8 @@ export const MsgChannelCloseConfirmResponse = { return message; }, fromAmino(_: MsgChannelCloseConfirmResponseAmino): MsgChannelCloseConfirmResponse { - return {}; + const message = createBaseMsgChannelCloseConfirmResponse(); + return message; }, toAmino(_: MsgChannelCloseConfirmResponse): MsgChannelCloseConfirmResponseAmino { const obj: any = {}; @@ -1704,17 +2295,25 @@ export const MsgRecvPacket = { return message; }, fromAmino(object: MsgRecvPacketAmino): MsgRecvPacket { - return { - packet: object?.packet ? Packet.fromAmino(object.packet) : undefined, - proofCommitment: object.proof_commitment, - proofHeight: object?.proof_height ? Height.fromAmino(object.proof_height) : undefined, - signer: object.signer - }; + const message = createBaseMsgRecvPacket(); + if (object.packet !== undefined && object.packet !== null) { + message.packet = Packet.fromAmino(object.packet); + } + if (object.proof_commitment !== undefined && object.proof_commitment !== null) { + message.proofCommitment = bytesFromBase64(object.proof_commitment); + } + if (object.proof_height !== undefined && object.proof_height !== null) { + message.proofHeight = Height.fromAmino(object.proof_height); + } + if (object.signer !== undefined && object.signer !== null) { + message.signer = object.signer; + } + return message; }, toAmino(message: MsgRecvPacket): MsgRecvPacketAmino { const obj: any = {}; obj.packet = message.packet ? Packet.toAmino(message.packet) : undefined; - obj.proof_commitment = message.proofCommitment; + obj.proof_commitment = message.proofCommitment ? base64FromBytes(message.proofCommitment) : undefined; obj.proof_height = message.proofHeight ? Height.toAmino(message.proofHeight) : {}; obj.signer = message.signer; return obj; @@ -1777,13 +2376,15 @@ export const MsgRecvPacketResponse = { return message; }, fromAmino(object: MsgRecvPacketResponseAmino): MsgRecvPacketResponse { - return { - result: isSet(object.result) ? responseResultTypeFromJSON(object.result) : -1 - }; + const message = createBaseMsgRecvPacketResponse(); + if (object.result !== undefined && object.result !== null) { + message.result = responseResultTypeFromJSON(object.result); + } + return message; }, toAmino(message: MsgRecvPacketResponse): MsgRecvPacketResponseAmino { const obj: any = {}; - obj.result = message.result; + obj.result = responseResultTypeToJSON(message.result); return obj; }, fromAminoMsg(object: MsgRecvPacketResponseAminoMsg): MsgRecvPacketResponse { @@ -1876,18 +2477,28 @@ export const MsgTimeout = { return message; }, fromAmino(object: MsgTimeoutAmino): MsgTimeout { - return { - packet: object?.packet ? Packet.fromAmino(object.packet) : undefined, - proofUnreceived: object.proof_unreceived, - proofHeight: object?.proof_height ? Height.fromAmino(object.proof_height) : undefined, - nextSequenceRecv: BigInt(object.next_sequence_recv), - signer: object.signer - }; + const message = createBaseMsgTimeout(); + if (object.packet !== undefined && object.packet !== null) { + message.packet = Packet.fromAmino(object.packet); + } + if (object.proof_unreceived !== undefined && object.proof_unreceived !== null) { + message.proofUnreceived = bytesFromBase64(object.proof_unreceived); + } + if (object.proof_height !== undefined && object.proof_height !== null) { + message.proofHeight = Height.fromAmino(object.proof_height); + } + if (object.next_sequence_recv !== undefined && object.next_sequence_recv !== null) { + message.nextSequenceRecv = BigInt(object.next_sequence_recv); + } + if (object.signer !== undefined && object.signer !== null) { + message.signer = object.signer; + } + return message; }, toAmino(message: MsgTimeout): MsgTimeoutAmino { const obj: any = {}; obj.packet = message.packet ? Packet.toAmino(message.packet) : undefined; - obj.proof_unreceived = message.proofUnreceived; + obj.proof_unreceived = message.proofUnreceived ? base64FromBytes(message.proofUnreceived) : undefined; obj.proof_height = message.proofHeight ? Height.toAmino(message.proofHeight) : {}; obj.next_sequence_recv = message.nextSequenceRecv ? message.nextSequenceRecv.toString() : undefined; obj.signer = message.signer; @@ -1951,13 +2562,15 @@ export const MsgTimeoutResponse = { return message; }, fromAmino(object: MsgTimeoutResponseAmino): MsgTimeoutResponse { - return { - result: isSet(object.result) ? responseResultTypeFromJSON(object.result) : -1 - }; + const message = createBaseMsgTimeoutResponse(); + if (object.result !== undefined && object.result !== null) { + message.result = responseResultTypeFromJSON(object.result); + } + return message; }, toAmino(message: MsgTimeoutResponse): MsgTimeoutResponseAmino { const obj: any = {}; - obj.result = message.result; + obj.result = responseResultTypeToJSON(message.result); return obj; }, fromAminoMsg(object: MsgTimeoutResponseAminoMsg): MsgTimeoutResponse { @@ -1989,7 +2602,8 @@ function createBaseMsgTimeoutOnClose(): MsgTimeoutOnClose { proofClose: new Uint8Array(), proofHeight: Height.fromPartial({}), nextSequenceRecv: BigInt(0), - signer: "" + signer: "", + counterpartyUpgradeSequence: BigInt(0) }; } export const MsgTimeoutOnClose = { @@ -2013,6 +2627,9 @@ export const MsgTimeoutOnClose = { if (message.signer !== "") { writer.uint32(50).string(message.signer); } + if (message.counterpartyUpgradeSequence !== BigInt(0)) { + writer.uint32(56).uint64(message.counterpartyUpgradeSequence); + } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): MsgTimeoutOnClose { @@ -2040,6 +2657,9 @@ export const MsgTimeoutOnClose = { case 6: message.signer = reader.string(); break; + case 7: + message.counterpartyUpgradeSequence = reader.uint64(); + break; default: reader.skipType(tag & 7); break; @@ -2055,26 +2675,43 @@ export const MsgTimeoutOnClose = { message.proofHeight = object.proofHeight !== undefined && object.proofHeight !== null ? Height.fromPartial(object.proofHeight) : undefined; message.nextSequenceRecv = object.nextSequenceRecv !== undefined && object.nextSequenceRecv !== null ? BigInt(object.nextSequenceRecv.toString()) : BigInt(0); message.signer = object.signer ?? ""; + message.counterpartyUpgradeSequence = object.counterpartyUpgradeSequence !== undefined && object.counterpartyUpgradeSequence !== null ? BigInt(object.counterpartyUpgradeSequence.toString()) : BigInt(0); return message; }, fromAmino(object: MsgTimeoutOnCloseAmino): MsgTimeoutOnClose { - return { - packet: object?.packet ? Packet.fromAmino(object.packet) : undefined, - proofUnreceived: object.proof_unreceived, - proofClose: object.proof_close, - proofHeight: object?.proof_height ? Height.fromAmino(object.proof_height) : undefined, - nextSequenceRecv: BigInt(object.next_sequence_recv), - signer: object.signer - }; + const message = createBaseMsgTimeoutOnClose(); + if (object.packet !== undefined && object.packet !== null) { + message.packet = Packet.fromAmino(object.packet); + } + if (object.proof_unreceived !== undefined && object.proof_unreceived !== null) { + message.proofUnreceived = bytesFromBase64(object.proof_unreceived); + } + if (object.proof_close !== undefined && object.proof_close !== null) { + message.proofClose = bytesFromBase64(object.proof_close); + } + if (object.proof_height !== undefined && object.proof_height !== null) { + message.proofHeight = Height.fromAmino(object.proof_height); + } + if (object.next_sequence_recv !== undefined && object.next_sequence_recv !== null) { + message.nextSequenceRecv = BigInt(object.next_sequence_recv); + } + if (object.signer !== undefined && object.signer !== null) { + message.signer = object.signer; + } + if (object.counterparty_upgrade_sequence !== undefined && object.counterparty_upgrade_sequence !== null) { + message.counterpartyUpgradeSequence = BigInt(object.counterparty_upgrade_sequence); + } + return message; }, toAmino(message: MsgTimeoutOnClose): MsgTimeoutOnCloseAmino { const obj: any = {}; obj.packet = message.packet ? Packet.toAmino(message.packet) : undefined; - obj.proof_unreceived = message.proofUnreceived; - obj.proof_close = message.proofClose; + obj.proof_unreceived = message.proofUnreceived ? base64FromBytes(message.proofUnreceived) : undefined; + obj.proof_close = message.proofClose ? base64FromBytes(message.proofClose) : undefined; obj.proof_height = message.proofHeight ? Height.toAmino(message.proofHeight) : {}; obj.next_sequence_recv = message.nextSequenceRecv ? message.nextSequenceRecv.toString() : undefined; obj.signer = message.signer; + obj.counterparty_upgrade_sequence = message.counterpartyUpgradeSequence ? message.counterpartyUpgradeSequence.toString() : undefined; return obj; }, fromAminoMsg(object: MsgTimeoutOnCloseAminoMsg): MsgTimeoutOnClose { @@ -2135,13 +2772,15 @@ export const MsgTimeoutOnCloseResponse = { return message; }, fromAmino(object: MsgTimeoutOnCloseResponseAmino): MsgTimeoutOnCloseResponse { - return { - result: isSet(object.result) ? responseResultTypeFromJSON(object.result) : -1 - }; + const message = createBaseMsgTimeoutOnCloseResponse(); + if (object.result !== undefined && object.result !== null) { + message.result = responseResultTypeFromJSON(object.result); + } + return message; }, toAmino(message: MsgTimeoutOnCloseResponse): MsgTimeoutOnCloseResponseAmino { const obj: any = {}; - obj.result = message.result; + obj.result = responseResultTypeToJSON(message.result); return obj; }, fromAminoMsg(object: MsgTimeoutOnCloseResponseAminoMsg): MsgTimeoutOnCloseResponse { @@ -2234,19 +2873,29 @@ export const MsgAcknowledgement = { return message; }, fromAmino(object: MsgAcknowledgementAmino): MsgAcknowledgement { - return { - packet: object?.packet ? Packet.fromAmino(object.packet) : undefined, - acknowledgement: object.acknowledgement, - proofAcked: object.proof_acked, - proofHeight: object?.proof_height ? Height.fromAmino(object.proof_height) : undefined, - signer: object.signer - }; + const message = createBaseMsgAcknowledgement(); + if (object.packet !== undefined && object.packet !== null) { + message.packet = Packet.fromAmino(object.packet); + } + if (object.acknowledgement !== undefined && object.acknowledgement !== null) { + message.acknowledgement = bytesFromBase64(object.acknowledgement); + } + if (object.proof_acked !== undefined && object.proof_acked !== null) { + message.proofAcked = bytesFromBase64(object.proof_acked); + } + if (object.proof_height !== undefined && object.proof_height !== null) { + message.proofHeight = Height.fromAmino(object.proof_height); + } + if (object.signer !== undefined && object.signer !== null) { + message.signer = object.signer; + } + return message; }, toAmino(message: MsgAcknowledgement): MsgAcknowledgementAmino { const obj: any = {}; obj.packet = message.packet ? Packet.toAmino(message.packet) : undefined; - obj.acknowledgement = message.acknowledgement; - obj.proof_acked = message.proofAcked; + obj.acknowledgement = message.acknowledgement ? base64FromBytes(message.acknowledgement) : undefined; + obj.proof_acked = message.proofAcked ? base64FromBytes(message.proofAcked) : undefined; obj.proof_height = message.proofHeight ? Height.toAmino(message.proofHeight) : {}; obj.signer = message.signer; return obj; @@ -2309,13 +2958,15 @@ export const MsgAcknowledgementResponse = { return message; }, fromAmino(object: MsgAcknowledgementResponseAmino): MsgAcknowledgementResponse { - return { - result: isSet(object.result) ? responseResultTypeFromJSON(object.result) : -1 - }; + const message = createBaseMsgAcknowledgementResponse(); + if (object.result !== undefined && object.result !== null) { + message.result = responseResultTypeFromJSON(object.result); + } + return message; }, toAmino(message: MsgAcknowledgementResponse): MsgAcknowledgementResponseAmino { const obj: any = {}; - obj.result = message.result; + obj.result = responseResultTypeToJSON(message.result); return obj; }, fromAminoMsg(object: MsgAcknowledgementResponseAminoMsg): MsgAcknowledgementResponse { @@ -2339,4 +2990,1760 @@ export const MsgAcknowledgementResponse = { value: MsgAcknowledgementResponse.encode(message).finish() }; } +}; +function createBaseMsgChannelUpgradeInit(): MsgChannelUpgradeInit { + return { + portId: "", + channelId: "", + fields: UpgradeFields.fromPartial({}), + signer: "" + }; +} +export const MsgChannelUpgradeInit = { + typeUrl: "/ibc.core.channel.v1.MsgChannelUpgradeInit", + encode(message: MsgChannelUpgradeInit, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.portId !== "") { + writer.uint32(10).string(message.portId); + } + if (message.channelId !== "") { + writer.uint32(18).string(message.channelId); + } + if (message.fields !== undefined) { + UpgradeFields.encode(message.fields, writer.uint32(26).fork()).ldelim(); + } + if (message.signer !== "") { + writer.uint32(34).string(message.signer); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgChannelUpgradeInit { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgChannelUpgradeInit(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.portId = reader.string(); + break; + case 2: + message.channelId = reader.string(); + break; + case 3: + message.fields = UpgradeFields.decode(reader, reader.uint32()); + break; + case 4: + message.signer = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgChannelUpgradeInit { + const message = createBaseMsgChannelUpgradeInit(); + message.portId = object.portId ?? ""; + message.channelId = object.channelId ?? ""; + message.fields = object.fields !== undefined && object.fields !== null ? UpgradeFields.fromPartial(object.fields) : undefined; + message.signer = object.signer ?? ""; + return message; + }, + fromAmino(object: MsgChannelUpgradeInitAmino): MsgChannelUpgradeInit { + const message = createBaseMsgChannelUpgradeInit(); + if (object.port_id !== undefined && object.port_id !== null) { + message.portId = object.port_id; + } + if (object.channel_id !== undefined && object.channel_id !== null) { + message.channelId = object.channel_id; + } + if (object.fields !== undefined && object.fields !== null) { + message.fields = UpgradeFields.fromAmino(object.fields); + } + if (object.signer !== undefined && object.signer !== null) { + message.signer = object.signer; + } + return message; + }, + toAmino(message: MsgChannelUpgradeInit): MsgChannelUpgradeInitAmino { + const obj: any = {}; + obj.port_id = message.portId; + obj.channel_id = message.channelId; + obj.fields = message.fields ? UpgradeFields.toAmino(message.fields) : undefined; + obj.signer = message.signer; + return obj; + }, + fromAminoMsg(object: MsgChannelUpgradeInitAminoMsg): MsgChannelUpgradeInit { + return MsgChannelUpgradeInit.fromAmino(object.value); + }, + toAminoMsg(message: MsgChannelUpgradeInit): MsgChannelUpgradeInitAminoMsg { + return { + type: "cosmos-sdk/MsgChannelUpgradeInit", + value: MsgChannelUpgradeInit.toAmino(message) + }; + }, + fromProtoMsg(message: MsgChannelUpgradeInitProtoMsg): MsgChannelUpgradeInit { + return MsgChannelUpgradeInit.decode(message.value); + }, + toProto(message: MsgChannelUpgradeInit): Uint8Array { + return MsgChannelUpgradeInit.encode(message).finish(); + }, + toProtoMsg(message: MsgChannelUpgradeInit): MsgChannelUpgradeInitProtoMsg { + return { + typeUrl: "/ibc.core.channel.v1.MsgChannelUpgradeInit", + value: MsgChannelUpgradeInit.encode(message).finish() + }; + } +}; +function createBaseMsgChannelUpgradeInitResponse(): MsgChannelUpgradeInitResponse { + return { + upgrade: Upgrade.fromPartial({}), + upgradeSequence: BigInt(0) + }; +} +export const MsgChannelUpgradeInitResponse = { + typeUrl: "/ibc.core.channel.v1.MsgChannelUpgradeInitResponse", + encode(message: MsgChannelUpgradeInitResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.upgrade !== undefined) { + Upgrade.encode(message.upgrade, writer.uint32(10).fork()).ldelim(); + } + if (message.upgradeSequence !== BigInt(0)) { + writer.uint32(16).uint64(message.upgradeSequence); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgChannelUpgradeInitResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgChannelUpgradeInitResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.upgrade = Upgrade.decode(reader, reader.uint32()); + break; + case 2: + message.upgradeSequence = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgChannelUpgradeInitResponse { + const message = createBaseMsgChannelUpgradeInitResponse(); + message.upgrade = object.upgrade !== undefined && object.upgrade !== null ? Upgrade.fromPartial(object.upgrade) : undefined; + message.upgradeSequence = object.upgradeSequence !== undefined && object.upgradeSequence !== null ? BigInt(object.upgradeSequence.toString()) : BigInt(0); + return message; + }, + fromAmino(object: MsgChannelUpgradeInitResponseAmino): MsgChannelUpgradeInitResponse { + const message = createBaseMsgChannelUpgradeInitResponse(); + if (object.upgrade !== undefined && object.upgrade !== null) { + message.upgrade = Upgrade.fromAmino(object.upgrade); + } + if (object.upgrade_sequence !== undefined && object.upgrade_sequence !== null) { + message.upgradeSequence = BigInt(object.upgrade_sequence); + } + return message; + }, + toAmino(message: MsgChannelUpgradeInitResponse): MsgChannelUpgradeInitResponseAmino { + const obj: any = {}; + obj.upgrade = message.upgrade ? Upgrade.toAmino(message.upgrade) : undefined; + obj.upgrade_sequence = message.upgradeSequence ? message.upgradeSequence.toString() : undefined; + return obj; + }, + fromAminoMsg(object: MsgChannelUpgradeInitResponseAminoMsg): MsgChannelUpgradeInitResponse { + return MsgChannelUpgradeInitResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgChannelUpgradeInitResponse): MsgChannelUpgradeInitResponseAminoMsg { + return { + type: "cosmos-sdk/MsgChannelUpgradeInitResponse", + value: MsgChannelUpgradeInitResponse.toAmino(message) + }; + }, + fromProtoMsg(message: MsgChannelUpgradeInitResponseProtoMsg): MsgChannelUpgradeInitResponse { + return MsgChannelUpgradeInitResponse.decode(message.value); + }, + toProto(message: MsgChannelUpgradeInitResponse): Uint8Array { + return MsgChannelUpgradeInitResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgChannelUpgradeInitResponse): MsgChannelUpgradeInitResponseProtoMsg { + return { + typeUrl: "/ibc.core.channel.v1.MsgChannelUpgradeInitResponse", + value: MsgChannelUpgradeInitResponse.encode(message).finish() + }; + } +}; +function createBaseMsgChannelUpgradeTry(): MsgChannelUpgradeTry { + return { + portId: "", + channelId: "", + proposedUpgradeConnectionHops: [], + counterpartyUpgradeFields: UpgradeFields.fromPartial({}), + counterpartyUpgradeSequence: BigInt(0), + proofChannel: new Uint8Array(), + proofUpgrade: new Uint8Array(), + proofHeight: Height.fromPartial({}), + signer: "" + }; +} +export const MsgChannelUpgradeTry = { + typeUrl: "/ibc.core.channel.v1.MsgChannelUpgradeTry", + encode(message: MsgChannelUpgradeTry, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.portId !== "") { + writer.uint32(10).string(message.portId); + } + if (message.channelId !== "") { + writer.uint32(18).string(message.channelId); + } + for (const v of message.proposedUpgradeConnectionHops) { + writer.uint32(26).string(v!); + } + if (message.counterpartyUpgradeFields !== undefined) { + UpgradeFields.encode(message.counterpartyUpgradeFields, writer.uint32(34).fork()).ldelim(); + } + if (message.counterpartyUpgradeSequence !== BigInt(0)) { + writer.uint32(40).uint64(message.counterpartyUpgradeSequence); + } + if (message.proofChannel.length !== 0) { + writer.uint32(50).bytes(message.proofChannel); + } + if (message.proofUpgrade.length !== 0) { + writer.uint32(58).bytes(message.proofUpgrade); + } + if (message.proofHeight !== undefined) { + Height.encode(message.proofHeight, writer.uint32(66).fork()).ldelim(); + } + if (message.signer !== "") { + writer.uint32(74).string(message.signer); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgChannelUpgradeTry { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgChannelUpgradeTry(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.portId = reader.string(); + break; + case 2: + message.channelId = reader.string(); + break; + case 3: + message.proposedUpgradeConnectionHops.push(reader.string()); + break; + case 4: + message.counterpartyUpgradeFields = UpgradeFields.decode(reader, reader.uint32()); + break; + case 5: + message.counterpartyUpgradeSequence = reader.uint64(); + break; + case 6: + message.proofChannel = reader.bytes(); + break; + case 7: + message.proofUpgrade = reader.bytes(); + break; + case 8: + message.proofHeight = Height.decode(reader, reader.uint32()); + break; + case 9: + message.signer = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgChannelUpgradeTry { + const message = createBaseMsgChannelUpgradeTry(); + message.portId = object.portId ?? ""; + message.channelId = object.channelId ?? ""; + message.proposedUpgradeConnectionHops = object.proposedUpgradeConnectionHops?.map(e => e) || []; + message.counterpartyUpgradeFields = object.counterpartyUpgradeFields !== undefined && object.counterpartyUpgradeFields !== null ? UpgradeFields.fromPartial(object.counterpartyUpgradeFields) : undefined; + message.counterpartyUpgradeSequence = object.counterpartyUpgradeSequence !== undefined && object.counterpartyUpgradeSequence !== null ? BigInt(object.counterpartyUpgradeSequence.toString()) : BigInt(0); + message.proofChannel = object.proofChannel ?? new Uint8Array(); + message.proofUpgrade = object.proofUpgrade ?? new Uint8Array(); + message.proofHeight = object.proofHeight !== undefined && object.proofHeight !== null ? Height.fromPartial(object.proofHeight) : undefined; + message.signer = object.signer ?? ""; + return message; + }, + fromAmino(object: MsgChannelUpgradeTryAmino): MsgChannelUpgradeTry { + const message = createBaseMsgChannelUpgradeTry(); + if (object.port_id !== undefined && object.port_id !== null) { + message.portId = object.port_id; + } + if (object.channel_id !== undefined && object.channel_id !== null) { + message.channelId = object.channel_id; + } + message.proposedUpgradeConnectionHops = object.proposed_upgrade_connection_hops?.map(e => e) || []; + if (object.counterparty_upgrade_fields !== undefined && object.counterparty_upgrade_fields !== null) { + message.counterpartyUpgradeFields = UpgradeFields.fromAmino(object.counterparty_upgrade_fields); + } + if (object.counterparty_upgrade_sequence !== undefined && object.counterparty_upgrade_sequence !== null) { + message.counterpartyUpgradeSequence = BigInt(object.counterparty_upgrade_sequence); + } + if (object.proof_channel !== undefined && object.proof_channel !== null) { + message.proofChannel = bytesFromBase64(object.proof_channel); + } + if (object.proof_upgrade !== undefined && object.proof_upgrade !== null) { + message.proofUpgrade = bytesFromBase64(object.proof_upgrade); + } + if (object.proof_height !== undefined && object.proof_height !== null) { + message.proofHeight = Height.fromAmino(object.proof_height); + } + if (object.signer !== undefined && object.signer !== null) { + message.signer = object.signer; + } + return message; + }, + toAmino(message: MsgChannelUpgradeTry): MsgChannelUpgradeTryAmino { + const obj: any = {}; + obj.port_id = message.portId; + obj.channel_id = message.channelId; + if (message.proposedUpgradeConnectionHops) { + obj.proposed_upgrade_connection_hops = message.proposedUpgradeConnectionHops.map(e => e); + } else { + obj.proposed_upgrade_connection_hops = []; + } + obj.counterparty_upgrade_fields = message.counterpartyUpgradeFields ? UpgradeFields.toAmino(message.counterpartyUpgradeFields) : undefined; + obj.counterparty_upgrade_sequence = message.counterpartyUpgradeSequence ? message.counterpartyUpgradeSequence.toString() : undefined; + obj.proof_channel = message.proofChannel ? base64FromBytes(message.proofChannel) : undefined; + obj.proof_upgrade = message.proofUpgrade ? base64FromBytes(message.proofUpgrade) : undefined; + obj.proof_height = message.proofHeight ? Height.toAmino(message.proofHeight) : {}; + obj.signer = message.signer; + return obj; + }, + fromAminoMsg(object: MsgChannelUpgradeTryAminoMsg): MsgChannelUpgradeTry { + return MsgChannelUpgradeTry.fromAmino(object.value); + }, + toAminoMsg(message: MsgChannelUpgradeTry): MsgChannelUpgradeTryAminoMsg { + return { + type: "cosmos-sdk/MsgChannelUpgradeTry", + value: MsgChannelUpgradeTry.toAmino(message) + }; + }, + fromProtoMsg(message: MsgChannelUpgradeTryProtoMsg): MsgChannelUpgradeTry { + return MsgChannelUpgradeTry.decode(message.value); + }, + toProto(message: MsgChannelUpgradeTry): Uint8Array { + return MsgChannelUpgradeTry.encode(message).finish(); + }, + toProtoMsg(message: MsgChannelUpgradeTry): MsgChannelUpgradeTryProtoMsg { + return { + typeUrl: "/ibc.core.channel.v1.MsgChannelUpgradeTry", + value: MsgChannelUpgradeTry.encode(message).finish() + }; + } +}; +function createBaseMsgChannelUpgradeTryResponse(): MsgChannelUpgradeTryResponse { + return { + upgrade: Upgrade.fromPartial({}), + upgradeSequence: BigInt(0), + result: 0 + }; +} +export const MsgChannelUpgradeTryResponse = { + typeUrl: "/ibc.core.channel.v1.MsgChannelUpgradeTryResponse", + encode(message: MsgChannelUpgradeTryResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.upgrade !== undefined) { + Upgrade.encode(message.upgrade, writer.uint32(10).fork()).ldelim(); + } + if (message.upgradeSequence !== BigInt(0)) { + writer.uint32(16).uint64(message.upgradeSequence); + } + if (message.result !== 0) { + writer.uint32(24).int32(message.result); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgChannelUpgradeTryResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgChannelUpgradeTryResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.upgrade = Upgrade.decode(reader, reader.uint32()); + break; + case 2: + message.upgradeSequence = reader.uint64(); + break; + case 3: + message.result = (reader.int32() as any); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgChannelUpgradeTryResponse { + const message = createBaseMsgChannelUpgradeTryResponse(); + message.upgrade = object.upgrade !== undefined && object.upgrade !== null ? Upgrade.fromPartial(object.upgrade) : undefined; + message.upgradeSequence = object.upgradeSequence !== undefined && object.upgradeSequence !== null ? BigInt(object.upgradeSequence.toString()) : BigInt(0); + message.result = object.result ?? 0; + return message; + }, + fromAmino(object: MsgChannelUpgradeTryResponseAmino): MsgChannelUpgradeTryResponse { + const message = createBaseMsgChannelUpgradeTryResponse(); + if (object.upgrade !== undefined && object.upgrade !== null) { + message.upgrade = Upgrade.fromAmino(object.upgrade); + } + if (object.upgrade_sequence !== undefined && object.upgrade_sequence !== null) { + message.upgradeSequence = BigInt(object.upgrade_sequence); + } + if (object.result !== undefined && object.result !== null) { + message.result = responseResultTypeFromJSON(object.result); + } + return message; + }, + toAmino(message: MsgChannelUpgradeTryResponse): MsgChannelUpgradeTryResponseAmino { + const obj: any = {}; + obj.upgrade = message.upgrade ? Upgrade.toAmino(message.upgrade) : undefined; + obj.upgrade_sequence = message.upgradeSequence ? message.upgradeSequence.toString() : undefined; + obj.result = responseResultTypeToJSON(message.result); + return obj; + }, + fromAminoMsg(object: MsgChannelUpgradeTryResponseAminoMsg): MsgChannelUpgradeTryResponse { + return MsgChannelUpgradeTryResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgChannelUpgradeTryResponse): MsgChannelUpgradeTryResponseAminoMsg { + return { + type: "cosmos-sdk/MsgChannelUpgradeTryResponse", + value: MsgChannelUpgradeTryResponse.toAmino(message) + }; + }, + fromProtoMsg(message: MsgChannelUpgradeTryResponseProtoMsg): MsgChannelUpgradeTryResponse { + return MsgChannelUpgradeTryResponse.decode(message.value); + }, + toProto(message: MsgChannelUpgradeTryResponse): Uint8Array { + return MsgChannelUpgradeTryResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgChannelUpgradeTryResponse): MsgChannelUpgradeTryResponseProtoMsg { + return { + typeUrl: "/ibc.core.channel.v1.MsgChannelUpgradeTryResponse", + value: MsgChannelUpgradeTryResponse.encode(message).finish() + }; + } +}; +function createBaseMsgChannelUpgradeAck(): MsgChannelUpgradeAck { + return { + portId: "", + channelId: "", + counterpartyUpgrade: Upgrade.fromPartial({}), + proofChannel: new Uint8Array(), + proofUpgrade: new Uint8Array(), + proofHeight: Height.fromPartial({}), + signer: "" + }; +} +export const MsgChannelUpgradeAck = { + typeUrl: "/ibc.core.channel.v1.MsgChannelUpgradeAck", + encode(message: MsgChannelUpgradeAck, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.portId !== "") { + writer.uint32(10).string(message.portId); + } + if (message.channelId !== "") { + writer.uint32(18).string(message.channelId); + } + if (message.counterpartyUpgrade !== undefined) { + Upgrade.encode(message.counterpartyUpgrade, writer.uint32(26).fork()).ldelim(); + } + if (message.proofChannel.length !== 0) { + writer.uint32(34).bytes(message.proofChannel); + } + if (message.proofUpgrade.length !== 0) { + writer.uint32(42).bytes(message.proofUpgrade); + } + if (message.proofHeight !== undefined) { + Height.encode(message.proofHeight, writer.uint32(50).fork()).ldelim(); + } + if (message.signer !== "") { + writer.uint32(58).string(message.signer); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgChannelUpgradeAck { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgChannelUpgradeAck(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.portId = reader.string(); + break; + case 2: + message.channelId = reader.string(); + break; + case 3: + message.counterpartyUpgrade = Upgrade.decode(reader, reader.uint32()); + break; + case 4: + message.proofChannel = reader.bytes(); + break; + case 5: + message.proofUpgrade = reader.bytes(); + break; + case 6: + message.proofHeight = Height.decode(reader, reader.uint32()); + break; + case 7: + message.signer = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgChannelUpgradeAck { + const message = createBaseMsgChannelUpgradeAck(); + message.portId = object.portId ?? ""; + message.channelId = object.channelId ?? ""; + message.counterpartyUpgrade = object.counterpartyUpgrade !== undefined && object.counterpartyUpgrade !== null ? Upgrade.fromPartial(object.counterpartyUpgrade) : undefined; + message.proofChannel = object.proofChannel ?? new Uint8Array(); + message.proofUpgrade = object.proofUpgrade ?? new Uint8Array(); + message.proofHeight = object.proofHeight !== undefined && object.proofHeight !== null ? Height.fromPartial(object.proofHeight) : undefined; + message.signer = object.signer ?? ""; + return message; + }, + fromAmino(object: MsgChannelUpgradeAckAmino): MsgChannelUpgradeAck { + const message = createBaseMsgChannelUpgradeAck(); + if (object.port_id !== undefined && object.port_id !== null) { + message.portId = object.port_id; + } + if (object.channel_id !== undefined && object.channel_id !== null) { + message.channelId = object.channel_id; + } + if (object.counterparty_upgrade !== undefined && object.counterparty_upgrade !== null) { + message.counterpartyUpgrade = Upgrade.fromAmino(object.counterparty_upgrade); + } + if (object.proof_channel !== undefined && object.proof_channel !== null) { + message.proofChannel = bytesFromBase64(object.proof_channel); + } + if (object.proof_upgrade !== undefined && object.proof_upgrade !== null) { + message.proofUpgrade = bytesFromBase64(object.proof_upgrade); + } + if (object.proof_height !== undefined && object.proof_height !== null) { + message.proofHeight = Height.fromAmino(object.proof_height); + } + if (object.signer !== undefined && object.signer !== null) { + message.signer = object.signer; + } + return message; + }, + toAmino(message: MsgChannelUpgradeAck): MsgChannelUpgradeAckAmino { + const obj: any = {}; + obj.port_id = message.portId; + obj.channel_id = message.channelId; + obj.counterparty_upgrade = message.counterpartyUpgrade ? Upgrade.toAmino(message.counterpartyUpgrade) : undefined; + obj.proof_channel = message.proofChannel ? base64FromBytes(message.proofChannel) : undefined; + obj.proof_upgrade = message.proofUpgrade ? base64FromBytes(message.proofUpgrade) : undefined; + obj.proof_height = message.proofHeight ? Height.toAmino(message.proofHeight) : {}; + obj.signer = message.signer; + return obj; + }, + fromAminoMsg(object: MsgChannelUpgradeAckAminoMsg): MsgChannelUpgradeAck { + return MsgChannelUpgradeAck.fromAmino(object.value); + }, + toAminoMsg(message: MsgChannelUpgradeAck): MsgChannelUpgradeAckAminoMsg { + return { + type: "cosmos-sdk/MsgChannelUpgradeAck", + value: MsgChannelUpgradeAck.toAmino(message) + }; + }, + fromProtoMsg(message: MsgChannelUpgradeAckProtoMsg): MsgChannelUpgradeAck { + return MsgChannelUpgradeAck.decode(message.value); + }, + toProto(message: MsgChannelUpgradeAck): Uint8Array { + return MsgChannelUpgradeAck.encode(message).finish(); + }, + toProtoMsg(message: MsgChannelUpgradeAck): MsgChannelUpgradeAckProtoMsg { + return { + typeUrl: "/ibc.core.channel.v1.MsgChannelUpgradeAck", + value: MsgChannelUpgradeAck.encode(message).finish() + }; + } +}; +function createBaseMsgChannelUpgradeAckResponse(): MsgChannelUpgradeAckResponse { + return { + result: 0 + }; +} +export const MsgChannelUpgradeAckResponse = { + typeUrl: "/ibc.core.channel.v1.MsgChannelUpgradeAckResponse", + encode(message: MsgChannelUpgradeAckResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.result !== 0) { + writer.uint32(8).int32(message.result); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgChannelUpgradeAckResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgChannelUpgradeAckResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.result = (reader.int32() as any); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgChannelUpgradeAckResponse { + const message = createBaseMsgChannelUpgradeAckResponse(); + message.result = object.result ?? 0; + return message; + }, + fromAmino(object: MsgChannelUpgradeAckResponseAmino): MsgChannelUpgradeAckResponse { + const message = createBaseMsgChannelUpgradeAckResponse(); + if (object.result !== undefined && object.result !== null) { + message.result = responseResultTypeFromJSON(object.result); + } + return message; + }, + toAmino(message: MsgChannelUpgradeAckResponse): MsgChannelUpgradeAckResponseAmino { + const obj: any = {}; + obj.result = responseResultTypeToJSON(message.result); + return obj; + }, + fromAminoMsg(object: MsgChannelUpgradeAckResponseAminoMsg): MsgChannelUpgradeAckResponse { + return MsgChannelUpgradeAckResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgChannelUpgradeAckResponse): MsgChannelUpgradeAckResponseAminoMsg { + return { + type: "cosmos-sdk/MsgChannelUpgradeAckResponse", + value: MsgChannelUpgradeAckResponse.toAmino(message) + }; + }, + fromProtoMsg(message: MsgChannelUpgradeAckResponseProtoMsg): MsgChannelUpgradeAckResponse { + return MsgChannelUpgradeAckResponse.decode(message.value); + }, + toProto(message: MsgChannelUpgradeAckResponse): Uint8Array { + return MsgChannelUpgradeAckResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgChannelUpgradeAckResponse): MsgChannelUpgradeAckResponseProtoMsg { + return { + typeUrl: "/ibc.core.channel.v1.MsgChannelUpgradeAckResponse", + value: MsgChannelUpgradeAckResponse.encode(message).finish() + }; + } +}; +function createBaseMsgChannelUpgradeConfirm(): MsgChannelUpgradeConfirm { + return { + portId: "", + channelId: "", + counterpartyChannelState: 0, + counterpartyUpgrade: Upgrade.fromPartial({}), + proofChannel: new Uint8Array(), + proofUpgrade: new Uint8Array(), + proofHeight: Height.fromPartial({}), + signer: "" + }; +} +export const MsgChannelUpgradeConfirm = { + typeUrl: "/ibc.core.channel.v1.MsgChannelUpgradeConfirm", + encode(message: MsgChannelUpgradeConfirm, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.portId !== "") { + writer.uint32(10).string(message.portId); + } + if (message.channelId !== "") { + writer.uint32(18).string(message.channelId); + } + if (message.counterpartyChannelState !== 0) { + writer.uint32(24).int32(message.counterpartyChannelState); + } + if (message.counterpartyUpgrade !== undefined) { + Upgrade.encode(message.counterpartyUpgrade, writer.uint32(34).fork()).ldelim(); + } + if (message.proofChannel.length !== 0) { + writer.uint32(42).bytes(message.proofChannel); + } + if (message.proofUpgrade.length !== 0) { + writer.uint32(50).bytes(message.proofUpgrade); + } + if (message.proofHeight !== undefined) { + Height.encode(message.proofHeight, writer.uint32(58).fork()).ldelim(); + } + if (message.signer !== "") { + writer.uint32(66).string(message.signer); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgChannelUpgradeConfirm { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgChannelUpgradeConfirm(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.portId = reader.string(); + break; + case 2: + message.channelId = reader.string(); + break; + case 3: + message.counterpartyChannelState = (reader.int32() as any); + break; + case 4: + message.counterpartyUpgrade = Upgrade.decode(reader, reader.uint32()); + break; + case 5: + message.proofChannel = reader.bytes(); + break; + case 6: + message.proofUpgrade = reader.bytes(); + break; + case 7: + message.proofHeight = Height.decode(reader, reader.uint32()); + break; + case 8: + message.signer = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgChannelUpgradeConfirm { + const message = createBaseMsgChannelUpgradeConfirm(); + message.portId = object.portId ?? ""; + message.channelId = object.channelId ?? ""; + message.counterpartyChannelState = object.counterpartyChannelState ?? 0; + message.counterpartyUpgrade = object.counterpartyUpgrade !== undefined && object.counterpartyUpgrade !== null ? Upgrade.fromPartial(object.counterpartyUpgrade) : undefined; + message.proofChannel = object.proofChannel ?? new Uint8Array(); + message.proofUpgrade = object.proofUpgrade ?? new Uint8Array(); + message.proofHeight = object.proofHeight !== undefined && object.proofHeight !== null ? Height.fromPartial(object.proofHeight) : undefined; + message.signer = object.signer ?? ""; + return message; + }, + fromAmino(object: MsgChannelUpgradeConfirmAmino): MsgChannelUpgradeConfirm { + const message = createBaseMsgChannelUpgradeConfirm(); + if (object.port_id !== undefined && object.port_id !== null) { + message.portId = object.port_id; + } + if (object.channel_id !== undefined && object.channel_id !== null) { + message.channelId = object.channel_id; + } + if (object.counterparty_channel_state !== undefined && object.counterparty_channel_state !== null) { + message.counterpartyChannelState = stateFromJSON(object.counterparty_channel_state); + } + if (object.counterparty_upgrade !== undefined && object.counterparty_upgrade !== null) { + message.counterpartyUpgrade = Upgrade.fromAmino(object.counterparty_upgrade); + } + if (object.proof_channel !== undefined && object.proof_channel !== null) { + message.proofChannel = bytesFromBase64(object.proof_channel); + } + if (object.proof_upgrade !== undefined && object.proof_upgrade !== null) { + message.proofUpgrade = bytesFromBase64(object.proof_upgrade); + } + if (object.proof_height !== undefined && object.proof_height !== null) { + message.proofHeight = Height.fromAmino(object.proof_height); + } + if (object.signer !== undefined && object.signer !== null) { + message.signer = object.signer; + } + return message; + }, + toAmino(message: MsgChannelUpgradeConfirm): MsgChannelUpgradeConfirmAmino { + const obj: any = {}; + obj.port_id = message.portId; + obj.channel_id = message.channelId; + obj.counterparty_channel_state = stateToJSON(message.counterpartyChannelState); + obj.counterparty_upgrade = message.counterpartyUpgrade ? Upgrade.toAmino(message.counterpartyUpgrade) : undefined; + obj.proof_channel = message.proofChannel ? base64FromBytes(message.proofChannel) : undefined; + obj.proof_upgrade = message.proofUpgrade ? base64FromBytes(message.proofUpgrade) : undefined; + obj.proof_height = message.proofHeight ? Height.toAmino(message.proofHeight) : {}; + obj.signer = message.signer; + return obj; + }, + fromAminoMsg(object: MsgChannelUpgradeConfirmAminoMsg): MsgChannelUpgradeConfirm { + return MsgChannelUpgradeConfirm.fromAmino(object.value); + }, + toAminoMsg(message: MsgChannelUpgradeConfirm): MsgChannelUpgradeConfirmAminoMsg { + return { + type: "cosmos-sdk/MsgChannelUpgradeConfirm", + value: MsgChannelUpgradeConfirm.toAmino(message) + }; + }, + fromProtoMsg(message: MsgChannelUpgradeConfirmProtoMsg): MsgChannelUpgradeConfirm { + return MsgChannelUpgradeConfirm.decode(message.value); + }, + toProto(message: MsgChannelUpgradeConfirm): Uint8Array { + return MsgChannelUpgradeConfirm.encode(message).finish(); + }, + toProtoMsg(message: MsgChannelUpgradeConfirm): MsgChannelUpgradeConfirmProtoMsg { + return { + typeUrl: "/ibc.core.channel.v1.MsgChannelUpgradeConfirm", + value: MsgChannelUpgradeConfirm.encode(message).finish() + }; + } +}; +function createBaseMsgChannelUpgradeConfirmResponse(): MsgChannelUpgradeConfirmResponse { + return { + result: 0 + }; +} +export const MsgChannelUpgradeConfirmResponse = { + typeUrl: "/ibc.core.channel.v1.MsgChannelUpgradeConfirmResponse", + encode(message: MsgChannelUpgradeConfirmResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.result !== 0) { + writer.uint32(8).int32(message.result); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgChannelUpgradeConfirmResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgChannelUpgradeConfirmResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.result = (reader.int32() as any); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgChannelUpgradeConfirmResponse { + const message = createBaseMsgChannelUpgradeConfirmResponse(); + message.result = object.result ?? 0; + return message; + }, + fromAmino(object: MsgChannelUpgradeConfirmResponseAmino): MsgChannelUpgradeConfirmResponse { + const message = createBaseMsgChannelUpgradeConfirmResponse(); + if (object.result !== undefined && object.result !== null) { + message.result = responseResultTypeFromJSON(object.result); + } + return message; + }, + toAmino(message: MsgChannelUpgradeConfirmResponse): MsgChannelUpgradeConfirmResponseAmino { + const obj: any = {}; + obj.result = responseResultTypeToJSON(message.result); + return obj; + }, + fromAminoMsg(object: MsgChannelUpgradeConfirmResponseAminoMsg): MsgChannelUpgradeConfirmResponse { + return MsgChannelUpgradeConfirmResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgChannelUpgradeConfirmResponse): MsgChannelUpgradeConfirmResponseAminoMsg { + return { + type: "cosmos-sdk/MsgChannelUpgradeConfirmResponse", + value: MsgChannelUpgradeConfirmResponse.toAmino(message) + }; + }, + fromProtoMsg(message: MsgChannelUpgradeConfirmResponseProtoMsg): MsgChannelUpgradeConfirmResponse { + return MsgChannelUpgradeConfirmResponse.decode(message.value); + }, + toProto(message: MsgChannelUpgradeConfirmResponse): Uint8Array { + return MsgChannelUpgradeConfirmResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgChannelUpgradeConfirmResponse): MsgChannelUpgradeConfirmResponseProtoMsg { + return { + typeUrl: "/ibc.core.channel.v1.MsgChannelUpgradeConfirmResponse", + value: MsgChannelUpgradeConfirmResponse.encode(message).finish() + }; + } +}; +function createBaseMsgChannelUpgradeOpen(): MsgChannelUpgradeOpen { + return { + portId: "", + channelId: "", + counterpartyChannelState: 0, + proofChannel: new Uint8Array(), + proofHeight: Height.fromPartial({}), + signer: "" + }; +} +export const MsgChannelUpgradeOpen = { + typeUrl: "/ibc.core.channel.v1.MsgChannelUpgradeOpen", + encode(message: MsgChannelUpgradeOpen, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.portId !== "") { + writer.uint32(10).string(message.portId); + } + if (message.channelId !== "") { + writer.uint32(18).string(message.channelId); + } + if (message.counterpartyChannelState !== 0) { + writer.uint32(24).int32(message.counterpartyChannelState); + } + if (message.proofChannel.length !== 0) { + writer.uint32(34).bytes(message.proofChannel); + } + if (message.proofHeight !== undefined) { + Height.encode(message.proofHeight, writer.uint32(42).fork()).ldelim(); + } + if (message.signer !== "") { + writer.uint32(50).string(message.signer); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgChannelUpgradeOpen { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgChannelUpgradeOpen(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.portId = reader.string(); + break; + case 2: + message.channelId = reader.string(); + break; + case 3: + message.counterpartyChannelState = (reader.int32() as any); + break; + case 4: + message.proofChannel = reader.bytes(); + break; + case 5: + message.proofHeight = Height.decode(reader, reader.uint32()); + break; + case 6: + message.signer = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgChannelUpgradeOpen { + const message = createBaseMsgChannelUpgradeOpen(); + message.portId = object.portId ?? ""; + message.channelId = object.channelId ?? ""; + message.counterpartyChannelState = object.counterpartyChannelState ?? 0; + message.proofChannel = object.proofChannel ?? new Uint8Array(); + message.proofHeight = object.proofHeight !== undefined && object.proofHeight !== null ? Height.fromPartial(object.proofHeight) : undefined; + message.signer = object.signer ?? ""; + return message; + }, + fromAmino(object: MsgChannelUpgradeOpenAmino): MsgChannelUpgradeOpen { + const message = createBaseMsgChannelUpgradeOpen(); + if (object.port_id !== undefined && object.port_id !== null) { + message.portId = object.port_id; + } + if (object.channel_id !== undefined && object.channel_id !== null) { + message.channelId = object.channel_id; + } + if (object.counterparty_channel_state !== undefined && object.counterparty_channel_state !== null) { + message.counterpartyChannelState = stateFromJSON(object.counterparty_channel_state); + } + if (object.proof_channel !== undefined && object.proof_channel !== null) { + message.proofChannel = bytesFromBase64(object.proof_channel); + } + if (object.proof_height !== undefined && object.proof_height !== null) { + message.proofHeight = Height.fromAmino(object.proof_height); + } + if (object.signer !== undefined && object.signer !== null) { + message.signer = object.signer; + } + return message; + }, + toAmino(message: MsgChannelUpgradeOpen): MsgChannelUpgradeOpenAmino { + const obj: any = {}; + obj.port_id = message.portId; + obj.channel_id = message.channelId; + obj.counterparty_channel_state = stateToJSON(message.counterpartyChannelState); + obj.proof_channel = message.proofChannel ? base64FromBytes(message.proofChannel) : undefined; + obj.proof_height = message.proofHeight ? Height.toAmino(message.proofHeight) : {}; + obj.signer = message.signer; + return obj; + }, + fromAminoMsg(object: MsgChannelUpgradeOpenAminoMsg): MsgChannelUpgradeOpen { + return MsgChannelUpgradeOpen.fromAmino(object.value); + }, + toAminoMsg(message: MsgChannelUpgradeOpen): MsgChannelUpgradeOpenAminoMsg { + return { + type: "cosmos-sdk/MsgChannelUpgradeOpen", + value: MsgChannelUpgradeOpen.toAmino(message) + }; + }, + fromProtoMsg(message: MsgChannelUpgradeOpenProtoMsg): MsgChannelUpgradeOpen { + return MsgChannelUpgradeOpen.decode(message.value); + }, + toProto(message: MsgChannelUpgradeOpen): Uint8Array { + return MsgChannelUpgradeOpen.encode(message).finish(); + }, + toProtoMsg(message: MsgChannelUpgradeOpen): MsgChannelUpgradeOpenProtoMsg { + return { + typeUrl: "/ibc.core.channel.v1.MsgChannelUpgradeOpen", + value: MsgChannelUpgradeOpen.encode(message).finish() + }; + } +}; +function createBaseMsgChannelUpgradeOpenResponse(): MsgChannelUpgradeOpenResponse { + return {}; +} +export const MsgChannelUpgradeOpenResponse = { + typeUrl: "/ibc.core.channel.v1.MsgChannelUpgradeOpenResponse", + encode(_: MsgChannelUpgradeOpenResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgChannelUpgradeOpenResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgChannelUpgradeOpenResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): MsgChannelUpgradeOpenResponse { + const message = createBaseMsgChannelUpgradeOpenResponse(); + return message; + }, + fromAmino(_: MsgChannelUpgradeOpenResponseAmino): MsgChannelUpgradeOpenResponse { + const message = createBaseMsgChannelUpgradeOpenResponse(); + return message; + }, + toAmino(_: MsgChannelUpgradeOpenResponse): MsgChannelUpgradeOpenResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgChannelUpgradeOpenResponseAminoMsg): MsgChannelUpgradeOpenResponse { + return MsgChannelUpgradeOpenResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgChannelUpgradeOpenResponse): MsgChannelUpgradeOpenResponseAminoMsg { + return { + type: "cosmos-sdk/MsgChannelUpgradeOpenResponse", + value: MsgChannelUpgradeOpenResponse.toAmino(message) + }; + }, + fromProtoMsg(message: MsgChannelUpgradeOpenResponseProtoMsg): MsgChannelUpgradeOpenResponse { + return MsgChannelUpgradeOpenResponse.decode(message.value); + }, + toProto(message: MsgChannelUpgradeOpenResponse): Uint8Array { + return MsgChannelUpgradeOpenResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgChannelUpgradeOpenResponse): MsgChannelUpgradeOpenResponseProtoMsg { + return { + typeUrl: "/ibc.core.channel.v1.MsgChannelUpgradeOpenResponse", + value: MsgChannelUpgradeOpenResponse.encode(message).finish() + }; + } +}; +function createBaseMsgChannelUpgradeTimeout(): MsgChannelUpgradeTimeout { + return { + portId: "", + channelId: "", + counterpartyChannel: Channel.fromPartial({}), + proofChannel: new Uint8Array(), + proofHeight: Height.fromPartial({}), + signer: "" + }; +} +export const MsgChannelUpgradeTimeout = { + typeUrl: "/ibc.core.channel.v1.MsgChannelUpgradeTimeout", + encode(message: MsgChannelUpgradeTimeout, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.portId !== "") { + writer.uint32(10).string(message.portId); + } + if (message.channelId !== "") { + writer.uint32(18).string(message.channelId); + } + if (message.counterpartyChannel !== undefined) { + Channel.encode(message.counterpartyChannel, writer.uint32(26).fork()).ldelim(); + } + if (message.proofChannel.length !== 0) { + writer.uint32(34).bytes(message.proofChannel); + } + if (message.proofHeight !== undefined) { + Height.encode(message.proofHeight, writer.uint32(42).fork()).ldelim(); + } + if (message.signer !== "") { + writer.uint32(50).string(message.signer); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgChannelUpgradeTimeout { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgChannelUpgradeTimeout(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.portId = reader.string(); + break; + case 2: + message.channelId = reader.string(); + break; + case 3: + message.counterpartyChannel = Channel.decode(reader, reader.uint32()); + break; + case 4: + message.proofChannel = reader.bytes(); + break; + case 5: + message.proofHeight = Height.decode(reader, reader.uint32()); + break; + case 6: + message.signer = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgChannelUpgradeTimeout { + const message = createBaseMsgChannelUpgradeTimeout(); + message.portId = object.portId ?? ""; + message.channelId = object.channelId ?? ""; + message.counterpartyChannel = object.counterpartyChannel !== undefined && object.counterpartyChannel !== null ? Channel.fromPartial(object.counterpartyChannel) : undefined; + message.proofChannel = object.proofChannel ?? new Uint8Array(); + message.proofHeight = object.proofHeight !== undefined && object.proofHeight !== null ? Height.fromPartial(object.proofHeight) : undefined; + message.signer = object.signer ?? ""; + return message; + }, + fromAmino(object: MsgChannelUpgradeTimeoutAmino): MsgChannelUpgradeTimeout { + const message = createBaseMsgChannelUpgradeTimeout(); + if (object.port_id !== undefined && object.port_id !== null) { + message.portId = object.port_id; + } + if (object.channel_id !== undefined && object.channel_id !== null) { + message.channelId = object.channel_id; + } + if (object.counterparty_channel !== undefined && object.counterparty_channel !== null) { + message.counterpartyChannel = Channel.fromAmino(object.counterparty_channel); + } + if (object.proof_channel !== undefined && object.proof_channel !== null) { + message.proofChannel = bytesFromBase64(object.proof_channel); + } + if (object.proof_height !== undefined && object.proof_height !== null) { + message.proofHeight = Height.fromAmino(object.proof_height); + } + if (object.signer !== undefined && object.signer !== null) { + message.signer = object.signer; + } + return message; + }, + toAmino(message: MsgChannelUpgradeTimeout): MsgChannelUpgradeTimeoutAmino { + const obj: any = {}; + obj.port_id = message.portId; + obj.channel_id = message.channelId; + obj.counterparty_channel = message.counterpartyChannel ? Channel.toAmino(message.counterpartyChannel) : undefined; + obj.proof_channel = message.proofChannel ? base64FromBytes(message.proofChannel) : undefined; + obj.proof_height = message.proofHeight ? Height.toAmino(message.proofHeight) : {}; + obj.signer = message.signer; + return obj; + }, + fromAminoMsg(object: MsgChannelUpgradeTimeoutAminoMsg): MsgChannelUpgradeTimeout { + return MsgChannelUpgradeTimeout.fromAmino(object.value); + }, + toAminoMsg(message: MsgChannelUpgradeTimeout): MsgChannelUpgradeTimeoutAminoMsg { + return { + type: "cosmos-sdk/MsgChannelUpgradeTimeout", + value: MsgChannelUpgradeTimeout.toAmino(message) + }; + }, + fromProtoMsg(message: MsgChannelUpgradeTimeoutProtoMsg): MsgChannelUpgradeTimeout { + return MsgChannelUpgradeTimeout.decode(message.value); + }, + toProto(message: MsgChannelUpgradeTimeout): Uint8Array { + return MsgChannelUpgradeTimeout.encode(message).finish(); + }, + toProtoMsg(message: MsgChannelUpgradeTimeout): MsgChannelUpgradeTimeoutProtoMsg { + return { + typeUrl: "/ibc.core.channel.v1.MsgChannelUpgradeTimeout", + value: MsgChannelUpgradeTimeout.encode(message).finish() + }; + } +}; +function createBaseMsgChannelUpgradeTimeoutResponse(): MsgChannelUpgradeTimeoutResponse { + return {}; +} +export const MsgChannelUpgradeTimeoutResponse = { + typeUrl: "/ibc.core.channel.v1.MsgChannelUpgradeTimeoutResponse", + encode(_: MsgChannelUpgradeTimeoutResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgChannelUpgradeTimeoutResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgChannelUpgradeTimeoutResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): MsgChannelUpgradeTimeoutResponse { + const message = createBaseMsgChannelUpgradeTimeoutResponse(); + return message; + }, + fromAmino(_: MsgChannelUpgradeTimeoutResponseAmino): MsgChannelUpgradeTimeoutResponse { + const message = createBaseMsgChannelUpgradeTimeoutResponse(); + return message; + }, + toAmino(_: MsgChannelUpgradeTimeoutResponse): MsgChannelUpgradeTimeoutResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgChannelUpgradeTimeoutResponseAminoMsg): MsgChannelUpgradeTimeoutResponse { + return MsgChannelUpgradeTimeoutResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgChannelUpgradeTimeoutResponse): MsgChannelUpgradeTimeoutResponseAminoMsg { + return { + type: "cosmos-sdk/MsgChannelUpgradeTimeoutResponse", + value: MsgChannelUpgradeTimeoutResponse.toAmino(message) + }; + }, + fromProtoMsg(message: MsgChannelUpgradeTimeoutResponseProtoMsg): MsgChannelUpgradeTimeoutResponse { + return MsgChannelUpgradeTimeoutResponse.decode(message.value); + }, + toProto(message: MsgChannelUpgradeTimeoutResponse): Uint8Array { + return MsgChannelUpgradeTimeoutResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgChannelUpgradeTimeoutResponse): MsgChannelUpgradeTimeoutResponseProtoMsg { + return { + typeUrl: "/ibc.core.channel.v1.MsgChannelUpgradeTimeoutResponse", + value: MsgChannelUpgradeTimeoutResponse.encode(message).finish() + }; + } +}; +function createBaseMsgChannelUpgradeCancel(): MsgChannelUpgradeCancel { + return { + portId: "", + channelId: "", + errorReceipt: ErrorReceipt.fromPartial({}), + proofErrorReceipt: new Uint8Array(), + proofHeight: Height.fromPartial({}), + signer: "" + }; +} +export const MsgChannelUpgradeCancel = { + typeUrl: "/ibc.core.channel.v1.MsgChannelUpgradeCancel", + encode(message: MsgChannelUpgradeCancel, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.portId !== "") { + writer.uint32(10).string(message.portId); + } + if (message.channelId !== "") { + writer.uint32(18).string(message.channelId); + } + if (message.errorReceipt !== undefined) { + ErrorReceipt.encode(message.errorReceipt, writer.uint32(26).fork()).ldelim(); + } + if (message.proofErrorReceipt.length !== 0) { + writer.uint32(34).bytes(message.proofErrorReceipt); + } + if (message.proofHeight !== undefined) { + Height.encode(message.proofHeight, writer.uint32(42).fork()).ldelim(); + } + if (message.signer !== "") { + writer.uint32(50).string(message.signer); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgChannelUpgradeCancel { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgChannelUpgradeCancel(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.portId = reader.string(); + break; + case 2: + message.channelId = reader.string(); + break; + case 3: + message.errorReceipt = ErrorReceipt.decode(reader, reader.uint32()); + break; + case 4: + message.proofErrorReceipt = reader.bytes(); + break; + case 5: + message.proofHeight = Height.decode(reader, reader.uint32()); + break; + case 6: + message.signer = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgChannelUpgradeCancel { + const message = createBaseMsgChannelUpgradeCancel(); + message.portId = object.portId ?? ""; + message.channelId = object.channelId ?? ""; + message.errorReceipt = object.errorReceipt !== undefined && object.errorReceipt !== null ? ErrorReceipt.fromPartial(object.errorReceipt) : undefined; + message.proofErrorReceipt = object.proofErrorReceipt ?? new Uint8Array(); + message.proofHeight = object.proofHeight !== undefined && object.proofHeight !== null ? Height.fromPartial(object.proofHeight) : undefined; + message.signer = object.signer ?? ""; + return message; + }, + fromAmino(object: MsgChannelUpgradeCancelAmino): MsgChannelUpgradeCancel { + const message = createBaseMsgChannelUpgradeCancel(); + if (object.port_id !== undefined && object.port_id !== null) { + message.portId = object.port_id; + } + if (object.channel_id !== undefined && object.channel_id !== null) { + message.channelId = object.channel_id; + } + if (object.error_receipt !== undefined && object.error_receipt !== null) { + message.errorReceipt = ErrorReceipt.fromAmino(object.error_receipt); + } + if (object.proof_error_receipt !== undefined && object.proof_error_receipt !== null) { + message.proofErrorReceipt = bytesFromBase64(object.proof_error_receipt); + } + if (object.proof_height !== undefined && object.proof_height !== null) { + message.proofHeight = Height.fromAmino(object.proof_height); + } + if (object.signer !== undefined && object.signer !== null) { + message.signer = object.signer; + } + return message; + }, + toAmino(message: MsgChannelUpgradeCancel): MsgChannelUpgradeCancelAmino { + const obj: any = {}; + obj.port_id = message.portId; + obj.channel_id = message.channelId; + obj.error_receipt = message.errorReceipt ? ErrorReceipt.toAmino(message.errorReceipt) : undefined; + obj.proof_error_receipt = message.proofErrorReceipt ? base64FromBytes(message.proofErrorReceipt) : undefined; + obj.proof_height = message.proofHeight ? Height.toAmino(message.proofHeight) : {}; + obj.signer = message.signer; + return obj; + }, + fromAminoMsg(object: MsgChannelUpgradeCancelAminoMsg): MsgChannelUpgradeCancel { + return MsgChannelUpgradeCancel.fromAmino(object.value); + }, + toAminoMsg(message: MsgChannelUpgradeCancel): MsgChannelUpgradeCancelAminoMsg { + return { + type: "cosmos-sdk/MsgChannelUpgradeCancel", + value: MsgChannelUpgradeCancel.toAmino(message) + }; + }, + fromProtoMsg(message: MsgChannelUpgradeCancelProtoMsg): MsgChannelUpgradeCancel { + return MsgChannelUpgradeCancel.decode(message.value); + }, + toProto(message: MsgChannelUpgradeCancel): Uint8Array { + return MsgChannelUpgradeCancel.encode(message).finish(); + }, + toProtoMsg(message: MsgChannelUpgradeCancel): MsgChannelUpgradeCancelProtoMsg { + return { + typeUrl: "/ibc.core.channel.v1.MsgChannelUpgradeCancel", + value: MsgChannelUpgradeCancel.encode(message).finish() + }; + } +}; +function createBaseMsgChannelUpgradeCancelResponse(): MsgChannelUpgradeCancelResponse { + return {}; +} +export const MsgChannelUpgradeCancelResponse = { + typeUrl: "/ibc.core.channel.v1.MsgChannelUpgradeCancelResponse", + encode(_: MsgChannelUpgradeCancelResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgChannelUpgradeCancelResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgChannelUpgradeCancelResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): MsgChannelUpgradeCancelResponse { + const message = createBaseMsgChannelUpgradeCancelResponse(); + return message; + }, + fromAmino(_: MsgChannelUpgradeCancelResponseAmino): MsgChannelUpgradeCancelResponse { + const message = createBaseMsgChannelUpgradeCancelResponse(); + return message; + }, + toAmino(_: MsgChannelUpgradeCancelResponse): MsgChannelUpgradeCancelResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgChannelUpgradeCancelResponseAminoMsg): MsgChannelUpgradeCancelResponse { + return MsgChannelUpgradeCancelResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgChannelUpgradeCancelResponse): MsgChannelUpgradeCancelResponseAminoMsg { + return { + type: "cosmos-sdk/MsgChannelUpgradeCancelResponse", + value: MsgChannelUpgradeCancelResponse.toAmino(message) + }; + }, + fromProtoMsg(message: MsgChannelUpgradeCancelResponseProtoMsg): MsgChannelUpgradeCancelResponse { + return MsgChannelUpgradeCancelResponse.decode(message.value); + }, + toProto(message: MsgChannelUpgradeCancelResponse): Uint8Array { + return MsgChannelUpgradeCancelResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgChannelUpgradeCancelResponse): MsgChannelUpgradeCancelResponseProtoMsg { + return { + typeUrl: "/ibc.core.channel.v1.MsgChannelUpgradeCancelResponse", + value: MsgChannelUpgradeCancelResponse.encode(message).finish() + }; + } +}; +function createBaseMsgUpdateParams(): MsgUpdateParams { + return { + authority: "", + params: Params.fromPartial({}) + }; +} +export const MsgUpdateParams = { + typeUrl: "/ibc.core.channel.v1.MsgUpdateParams", + encode(message: MsgUpdateParams, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.authority !== "") { + writer.uint32(10).string(message.authority); + } + if (message.params !== undefined) { + Params.encode(message.params, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgUpdateParams { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUpdateParams(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.authority = reader.string(); + break; + case 2: + message.params = Params.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgUpdateParams { + const message = createBaseMsgUpdateParams(); + message.authority = object.authority ?? ""; + message.params = object.params !== undefined && object.params !== null ? Params.fromPartial(object.params) : undefined; + return message; + }, + fromAmino(object: MsgUpdateParamsAmino): MsgUpdateParams { + const message = createBaseMsgUpdateParams(); + if (object.authority !== undefined && object.authority !== null) { + message.authority = object.authority; + } + if (object.params !== undefined && object.params !== null) { + message.params = Params.fromAmino(object.params); + } + return message; + }, + toAmino(message: MsgUpdateParams): MsgUpdateParamsAmino { + const obj: any = {}; + obj.authority = message.authority; + obj.params = message.params ? Params.toAmino(message.params) : undefined; + return obj; + }, + fromAminoMsg(object: MsgUpdateParamsAminoMsg): MsgUpdateParams { + return MsgUpdateParams.fromAmino(object.value); + }, + toAminoMsg(message: MsgUpdateParams): MsgUpdateParamsAminoMsg { + return { + type: "cosmos-sdk/MsgUpdateParams", + value: MsgUpdateParams.toAmino(message) + }; + }, + fromProtoMsg(message: MsgUpdateParamsProtoMsg): MsgUpdateParams { + return MsgUpdateParams.decode(message.value); + }, + toProto(message: MsgUpdateParams): Uint8Array { + return MsgUpdateParams.encode(message).finish(); + }, + toProtoMsg(message: MsgUpdateParams): MsgUpdateParamsProtoMsg { + return { + typeUrl: "/ibc.core.channel.v1.MsgUpdateParams", + value: MsgUpdateParams.encode(message).finish() + }; + } +}; +function createBaseMsgUpdateParamsResponse(): MsgUpdateParamsResponse { + return {}; +} +export const MsgUpdateParamsResponse = { + typeUrl: "/ibc.core.channel.v1.MsgUpdateParamsResponse", + encode(_: MsgUpdateParamsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgUpdateParamsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUpdateParamsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): MsgUpdateParamsResponse { + const message = createBaseMsgUpdateParamsResponse(); + return message; + }, + fromAmino(_: MsgUpdateParamsResponseAmino): MsgUpdateParamsResponse { + const message = createBaseMsgUpdateParamsResponse(); + return message; + }, + toAmino(_: MsgUpdateParamsResponse): MsgUpdateParamsResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgUpdateParamsResponseAminoMsg): MsgUpdateParamsResponse { + return MsgUpdateParamsResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgUpdateParamsResponse): MsgUpdateParamsResponseAminoMsg { + return { + type: "cosmos-sdk/MsgUpdateParamsResponse", + value: MsgUpdateParamsResponse.toAmino(message) + }; + }, + fromProtoMsg(message: MsgUpdateParamsResponseProtoMsg): MsgUpdateParamsResponse { + return MsgUpdateParamsResponse.decode(message.value); + }, + toProto(message: MsgUpdateParamsResponse): Uint8Array { + return MsgUpdateParamsResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgUpdateParamsResponse): MsgUpdateParamsResponseProtoMsg { + return { + typeUrl: "/ibc.core.channel.v1.MsgUpdateParamsResponse", + value: MsgUpdateParamsResponse.encode(message).finish() + }; + } +}; +function createBaseMsgPruneAcknowledgements(): MsgPruneAcknowledgements { + return { + portId: "", + channelId: "", + limit: BigInt(0), + signer: "" + }; +} +export const MsgPruneAcknowledgements = { + typeUrl: "/ibc.core.channel.v1.MsgPruneAcknowledgements", + encode(message: MsgPruneAcknowledgements, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.portId !== "") { + writer.uint32(10).string(message.portId); + } + if (message.channelId !== "") { + writer.uint32(18).string(message.channelId); + } + if (message.limit !== BigInt(0)) { + writer.uint32(24).uint64(message.limit); + } + if (message.signer !== "") { + writer.uint32(34).string(message.signer); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgPruneAcknowledgements { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgPruneAcknowledgements(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.portId = reader.string(); + break; + case 2: + message.channelId = reader.string(); + break; + case 3: + message.limit = reader.uint64(); + break; + case 4: + message.signer = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgPruneAcknowledgements { + const message = createBaseMsgPruneAcknowledgements(); + message.portId = object.portId ?? ""; + message.channelId = object.channelId ?? ""; + message.limit = object.limit !== undefined && object.limit !== null ? BigInt(object.limit.toString()) : BigInt(0); + message.signer = object.signer ?? ""; + return message; + }, + fromAmino(object: MsgPruneAcknowledgementsAmino): MsgPruneAcknowledgements { + const message = createBaseMsgPruneAcknowledgements(); + if (object.port_id !== undefined && object.port_id !== null) { + message.portId = object.port_id; + } + if (object.channel_id !== undefined && object.channel_id !== null) { + message.channelId = object.channel_id; + } + if (object.limit !== undefined && object.limit !== null) { + message.limit = BigInt(object.limit); + } + if (object.signer !== undefined && object.signer !== null) { + message.signer = object.signer; + } + return message; + }, + toAmino(message: MsgPruneAcknowledgements): MsgPruneAcknowledgementsAmino { + const obj: any = {}; + obj.port_id = message.portId; + obj.channel_id = message.channelId; + obj.limit = message.limit ? message.limit.toString() : undefined; + obj.signer = message.signer; + return obj; + }, + fromAminoMsg(object: MsgPruneAcknowledgementsAminoMsg): MsgPruneAcknowledgements { + return MsgPruneAcknowledgements.fromAmino(object.value); + }, + toAminoMsg(message: MsgPruneAcknowledgements): MsgPruneAcknowledgementsAminoMsg { + return { + type: "cosmos-sdk/MsgPruneAcknowledgements", + value: MsgPruneAcknowledgements.toAmino(message) + }; + }, + fromProtoMsg(message: MsgPruneAcknowledgementsProtoMsg): MsgPruneAcknowledgements { + return MsgPruneAcknowledgements.decode(message.value); + }, + toProto(message: MsgPruneAcknowledgements): Uint8Array { + return MsgPruneAcknowledgements.encode(message).finish(); + }, + toProtoMsg(message: MsgPruneAcknowledgements): MsgPruneAcknowledgementsProtoMsg { + return { + typeUrl: "/ibc.core.channel.v1.MsgPruneAcknowledgements", + value: MsgPruneAcknowledgements.encode(message).finish() + }; + } +}; +function createBaseMsgPruneAcknowledgementsResponse(): MsgPruneAcknowledgementsResponse { + return { + totalPrunedSequences: BigInt(0), + totalRemainingSequences: BigInt(0) + }; +} +export const MsgPruneAcknowledgementsResponse = { + typeUrl: "/ibc.core.channel.v1.MsgPruneAcknowledgementsResponse", + encode(message: MsgPruneAcknowledgementsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.totalPrunedSequences !== BigInt(0)) { + writer.uint32(8).uint64(message.totalPrunedSequences); + } + if (message.totalRemainingSequences !== BigInt(0)) { + writer.uint32(16).uint64(message.totalRemainingSequences); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgPruneAcknowledgementsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgPruneAcknowledgementsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.totalPrunedSequences = reader.uint64(); + break; + case 2: + message.totalRemainingSequences = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgPruneAcknowledgementsResponse { + const message = createBaseMsgPruneAcknowledgementsResponse(); + message.totalPrunedSequences = object.totalPrunedSequences !== undefined && object.totalPrunedSequences !== null ? BigInt(object.totalPrunedSequences.toString()) : BigInt(0); + message.totalRemainingSequences = object.totalRemainingSequences !== undefined && object.totalRemainingSequences !== null ? BigInt(object.totalRemainingSequences.toString()) : BigInt(0); + return message; + }, + fromAmino(object: MsgPruneAcknowledgementsResponseAmino): MsgPruneAcknowledgementsResponse { + const message = createBaseMsgPruneAcknowledgementsResponse(); + if (object.total_pruned_sequences !== undefined && object.total_pruned_sequences !== null) { + message.totalPrunedSequences = BigInt(object.total_pruned_sequences); + } + if (object.total_remaining_sequences !== undefined && object.total_remaining_sequences !== null) { + message.totalRemainingSequences = BigInt(object.total_remaining_sequences); + } + return message; + }, + toAmino(message: MsgPruneAcknowledgementsResponse): MsgPruneAcknowledgementsResponseAmino { + const obj: any = {}; + obj.total_pruned_sequences = message.totalPrunedSequences ? message.totalPrunedSequences.toString() : undefined; + obj.total_remaining_sequences = message.totalRemainingSequences ? message.totalRemainingSequences.toString() : undefined; + return obj; + }, + fromAminoMsg(object: MsgPruneAcknowledgementsResponseAminoMsg): MsgPruneAcknowledgementsResponse { + return MsgPruneAcknowledgementsResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgPruneAcknowledgementsResponse): MsgPruneAcknowledgementsResponseAminoMsg { + return { + type: "cosmos-sdk/MsgPruneAcknowledgementsResponse", + value: MsgPruneAcknowledgementsResponse.toAmino(message) + }; + }, + fromProtoMsg(message: MsgPruneAcknowledgementsResponseProtoMsg): MsgPruneAcknowledgementsResponse { + return MsgPruneAcknowledgementsResponse.decode(message.value); + }, + toProto(message: MsgPruneAcknowledgementsResponse): Uint8Array { + return MsgPruneAcknowledgementsResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgPruneAcknowledgementsResponse): MsgPruneAcknowledgementsResponseProtoMsg { + return { + typeUrl: "/ibc.core.channel.v1.MsgPruneAcknowledgementsResponse", + value: MsgPruneAcknowledgementsResponse.encode(message).finish() + }; + } }; \ No newline at end of file diff --git a/packages/osmo-query/src/codegen/ibc/core/channel/v1/upgrade.ts b/packages/osmo-query/src/codegen/ibc/core/channel/v1/upgrade.ts new file mode 100644 index 000000000..d2e2e57ab --- /dev/null +++ b/packages/osmo-query/src/codegen/ibc/core/channel/v1/upgrade.ts @@ -0,0 +1,389 @@ +import { Timeout, TimeoutAmino, TimeoutSDKType, Order, orderFromJSON, orderToJSON } from "./channel"; +import { BinaryReader, BinaryWriter } from "../../../../binary"; +/** + * Upgrade is a verifiable type which contains the relevant information + * for an attempted upgrade. It provides the proposed changes to the channel + * end, the timeout for this upgrade attempt and the next packet sequence + * which allows the counterparty to efficiently know the highest sequence it has received. + * The next sequence send is used for pruning and upgrading from unordered to ordered channels. + */ +export interface Upgrade { + fields: UpgradeFields; + timeout: Timeout; + nextSequenceSend: bigint; +} +export interface UpgradeProtoMsg { + typeUrl: "/ibc.core.channel.v1.Upgrade"; + value: Uint8Array; +} +/** + * Upgrade is a verifiable type which contains the relevant information + * for an attempted upgrade. It provides the proposed changes to the channel + * end, the timeout for this upgrade attempt and the next packet sequence + * which allows the counterparty to efficiently know the highest sequence it has received. + * The next sequence send is used for pruning and upgrading from unordered to ordered channels. + */ +export interface UpgradeAmino { + fields?: UpgradeFieldsAmino; + timeout?: TimeoutAmino; + next_sequence_send?: string; +} +export interface UpgradeAminoMsg { + type: "cosmos-sdk/Upgrade"; + value: UpgradeAmino; +} +/** + * Upgrade is a verifiable type which contains the relevant information + * for an attempted upgrade. It provides the proposed changes to the channel + * end, the timeout for this upgrade attempt and the next packet sequence + * which allows the counterparty to efficiently know the highest sequence it has received. + * The next sequence send is used for pruning and upgrading from unordered to ordered channels. + */ +export interface UpgradeSDKType { + fields: UpgradeFieldsSDKType; + timeout: TimeoutSDKType; + next_sequence_send: bigint; +} +/** + * UpgradeFields are the fields in a channel end which may be changed + * during a channel upgrade. + */ +export interface UpgradeFields { + ordering: Order; + connectionHops: string[]; + version: string; +} +export interface UpgradeFieldsProtoMsg { + typeUrl: "/ibc.core.channel.v1.UpgradeFields"; + value: Uint8Array; +} +/** + * UpgradeFields are the fields in a channel end which may be changed + * during a channel upgrade. + */ +export interface UpgradeFieldsAmino { + ordering?: Order; + connection_hops?: string[]; + version?: string; +} +export interface UpgradeFieldsAminoMsg { + type: "cosmos-sdk/UpgradeFields"; + value: UpgradeFieldsAmino; +} +/** + * UpgradeFields are the fields in a channel end which may be changed + * during a channel upgrade. + */ +export interface UpgradeFieldsSDKType { + ordering: Order; + connection_hops: string[]; + version: string; +} +/** + * ErrorReceipt defines a type which encapsulates the upgrade sequence and error associated with the + * upgrade handshake failure. When a channel upgrade handshake is aborted both chains are expected to increment to the + * next sequence. + */ +export interface ErrorReceipt { + /** the channel upgrade sequence */ + sequence: bigint; + /** the error message detailing the cause of failure */ + message: string; +} +export interface ErrorReceiptProtoMsg { + typeUrl: "/ibc.core.channel.v1.ErrorReceipt"; + value: Uint8Array; +} +/** + * ErrorReceipt defines a type which encapsulates the upgrade sequence and error associated with the + * upgrade handshake failure. When a channel upgrade handshake is aborted both chains are expected to increment to the + * next sequence. + */ +export interface ErrorReceiptAmino { + /** the channel upgrade sequence */ + sequence?: string; + /** the error message detailing the cause of failure */ + message?: string; +} +export interface ErrorReceiptAminoMsg { + type: "cosmos-sdk/ErrorReceipt"; + value: ErrorReceiptAmino; +} +/** + * ErrorReceipt defines a type which encapsulates the upgrade sequence and error associated with the + * upgrade handshake failure. When a channel upgrade handshake is aborted both chains are expected to increment to the + * next sequence. + */ +export interface ErrorReceiptSDKType { + sequence: bigint; + message: string; +} +function createBaseUpgrade(): Upgrade { + return { + fields: UpgradeFields.fromPartial({}), + timeout: Timeout.fromPartial({}), + nextSequenceSend: BigInt(0) + }; +} +export const Upgrade = { + typeUrl: "/ibc.core.channel.v1.Upgrade", + encode(message: Upgrade, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.fields !== undefined) { + UpgradeFields.encode(message.fields, writer.uint32(10).fork()).ldelim(); + } + if (message.timeout !== undefined) { + Timeout.encode(message.timeout, writer.uint32(18).fork()).ldelim(); + } + if (message.nextSequenceSend !== BigInt(0)) { + writer.uint32(24).uint64(message.nextSequenceSend); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): Upgrade { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseUpgrade(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.fields = UpgradeFields.decode(reader, reader.uint32()); + break; + case 2: + message.timeout = Timeout.decode(reader, reader.uint32()); + break; + case 3: + message.nextSequenceSend = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): Upgrade { + const message = createBaseUpgrade(); + message.fields = object.fields !== undefined && object.fields !== null ? UpgradeFields.fromPartial(object.fields) : undefined; + message.timeout = object.timeout !== undefined && object.timeout !== null ? Timeout.fromPartial(object.timeout) : undefined; + message.nextSequenceSend = object.nextSequenceSend !== undefined && object.nextSequenceSend !== null ? BigInt(object.nextSequenceSend.toString()) : BigInt(0); + return message; + }, + fromAmino(object: UpgradeAmino): Upgrade { + const message = createBaseUpgrade(); + if (object.fields !== undefined && object.fields !== null) { + message.fields = UpgradeFields.fromAmino(object.fields); + } + if (object.timeout !== undefined && object.timeout !== null) { + message.timeout = Timeout.fromAmino(object.timeout); + } + if (object.next_sequence_send !== undefined && object.next_sequence_send !== null) { + message.nextSequenceSend = BigInt(object.next_sequence_send); + } + return message; + }, + toAmino(message: Upgrade): UpgradeAmino { + const obj: any = {}; + obj.fields = message.fields ? UpgradeFields.toAmino(message.fields) : undefined; + obj.timeout = message.timeout ? Timeout.toAmino(message.timeout) : undefined; + obj.next_sequence_send = message.nextSequenceSend ? message.nextSequenceSend.toString() : undefined; + return obj; + }, + fromAminoMsg(object: UpgradeAminoMsg): Upgrade { + return Upgrade.fromAmino(object.value); + }, + toAminoMsg(message: Upgrade): UpgradeAminoMsg { + return { + type: "cosmos-sdk/Upgrade", + value: Upgrade.toAmino(message) + }; + }, + fromProtoMsg(message: UpgradeProtoMsg): Upgrade { + return Upgrade.decode(message.value); + }, + toProto(message: Upgrade): Uint8Array { + return Upgrade.encode(message).finish(); + }, + toProtoMsg(message: Upgrade): UpgradeProtoMsg { + return { + typeUrl: "/ibc.core.channel.v1.Upgrade", + value: Upgrade.encode(message).finish() + }; + } +}; +function createBaseUpgradeFields(): UpgradeFields { + return { + ordering: 0, + connectionHops: [], + version: "" + }; +} +export const UpgradeFields = { + typeUrl: "/ibc.core.channel.v1.UpgradeFields", + encode(message: UpgradeFields, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.ordering !== 0) { + writer.uint32(8).int32(message.ordering); + } + for (const v of message.connectionHops) { + writer.uint32(18).string(v!); + } + if (message.version !== "") { + writer.uint32(26).string(message.version); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): UpgradeFields { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseUpgradeFields(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.ordering = (reader.int32() as any); + break; + case 2: + message.connectionHops.push(reader.string()); + break; + case 3: + message.version = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): UpgradeFields { + const message = createBaseUpgradeFields(); + message.ordering = object.ordering ?? 0; + message.connectionHops = object.connectionHops?.map(e => e) || []; + message.version = object.version ?? ""; + return message; + }, + fromAmino(object: UpgradeFieldsAmino): UpgradeFields { + const message = createBaseUpgradeFields(); + if (object.ordering !== undefined && object.ordering !== null) { + message.ordering = orderFromJSON(object.ordering); + } + message.connectionHops = object.connection_hops?.map(e => e) || []; + if (object.version !== undefined && object.version !== null) { + message.version = object.version; + } + return message; + }, + toAmino(message: UpgradeFields): UpgradeFieldsAmino { + const obj: any = {}; + obj.ordering = orderToJSON(message.ordering); + if (message.connectionHops) { + obj.connection_hops = message.connectionHops.map(e => e); + } else { + obj.connection_hops = []; + } + obj.version = message.version; + return obj; + }, + fromAminoMsg(object: UpgradeFieldsAminoMsg): UpgradeFields { + return UpgradeFields.fromAmino(object.value); + }, + toAminoMsg(message: UpgradeFields): UpgradeFieldsAminoMsg { + return { + type: "cosmos-sdk/UpgradeFields", + value: UpgradeFields.toAmino(message) + }; + }, + fromProtoMsg(message: UpgradeFieldsProtoMsg): UpgradeFields { + return UpgradeFields.decode(message.value); + }, + toProto(message: UpgradeFields): Uint8Array { + return UpgradeFields.encode(message).finish(); + }, + toProtoMsg(message: UpgradeFields): UpgradeFieldsProtoMsg { + return { + typeUrl: "/ibc.core.channel.v1.UpgradeFields", + value: UpgradeFields.encode(message).finish() + }; + } +}; +function createBaseErrorReceipt(): ErrorReceipt { + return { + sequence: BigInt(0), + message: "" + }; +} +export const ErrorReceipt = { + typeUrl: "/ibc.core.channel.v1.ErrorReceipt", + encode(message: ErrorReceipt, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.sequence !== BigInt(0)) { + writer.uint32(8).uint64(message.sequence); + } + if (message.message !== "") { + writer.uint32(18).string(message.message); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): ErrorReceipt { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseErrorReceipt(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.sequence = reader.uint64(); + break; + case 2: + message.message = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): ErrorReceipt { + const message = createBaseErrorReceipt(); + message.sequence = object.sequence !== undefined && object.sequence !== null ? BigInt(object.sequence.toString()) : BigInt(0); + message.message = object.message ?? ""; + return message; + }, + fromAmino(object: ErrorReceiptAmino): ErrorReceipt { + const message = createBaseErrorReceipt(); + if (object.sequence !== undefined && object.sequence !== null) { + message.sequence = BigInt(object.sequence); + } + if (object.message !== undefined && object.message !== null) { + message.message = object.message; + } + return message; + }, + toAmino(message: ErrorReceipt): ErrorReceiptAmino { + const obj: any = {}; + obj.sequence = message.sequence ? message.sequence.toString() : undefined; + obj.message = message.message; + return obj; + }, + fromAminoMsg(object: ErrorReceiptAminoMsg): ErrorReceipt { + return ErrorReceipt.fromAmino(object.value); + }, + toAminoMsg(message: ErrorReceipt): ErrorReceiptAminoMsg { + return { + type: "cosmos-sdk/ErrorReceipt", + value: ErrorReceipt.toAmino(message) + }; + }, + fromProtoMsg(message: ErrorReceiptProtoMsg): ErrorReceipt { + return ErrorReceipt.decode(message.value); + }, + toProto(message: ErrorReceipt): Uint8Array { + return ErrorReceipt.encode(message).finish(); + }, + toProtoMsg(message: ErrorReceipt): ErrorReceiptProtoMsg { + return { + typeUrl: "/ibc.core.channel.v1.ErrorReceipt", + value: ErrorReceipt.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/packages/osmo-query/src/codegen/ibc/core/client/v1/client.ts b/packages/osmo-query/src/codegen/ibc/core/client/v1/client.ts index 4f97407c3..17f5e6e4a 100644 --- a/packages/osmo-query/src/codegen/ibc/core/client/v1/client.ts +++ b/packages/osmo-query/src/codegen/ibc/core/client/v1/client.ts @@ -9,7 +9,7 @@ export interface IdentifiedClientState { /** client identifier */ clientId: string; /** client state */ - clientState: Any; + clientState?: Any; } export interface IdentifiedClientStateProtoMsg { typeUrl: "/ibc.core.client.v1.IdentifiedClientState"; @@ -21,7 +21,7 @@ export interface IdentifiedClientStateProtoMsg { */ export interface IdentifiedClientStateAmino { /** client identifier */ - client_id: string; + client_id?: string; /** client state */ client_state?: AnyAmino; } @@ -35,7 +35,7 @@ export interface IdentifiedClientStateAminoMsg { */ export interface IdentifiedClientStateSDKType { client_id: string; - client_state: AnySDKType; + client_state?: AnySDKType; } /** * ConsensusStateWithHeight defines a consensus state with an additional height @@ -45,7 +45,7 @@ export interface ConsensusStateWithHeight { /** consensus state height */ height: Height; /** consensus state */ - consensusState: Any; + consensusState?: Any; } export interface ConsensusStateWithHeightProtoMsg { typeUrl: "/ibc.core.client.v1.ConsensusStateWithHeight"; @@ -71,7 +71,7 @@ export interface ConsensusStateWithHeightAminoMsg { */ export interface ConsensusStateWithHeightSDKType { height: HeightSDKType; - consensus_state: AnySDKType; + consensus_state?: AnySDKType; } /** * ClientConsensusStates defines all the stored consensus states for a given @@ -93,9 +93,9 @@ export interface ClientConsensusStatesProtoMsg { */ export interface ClientConsensusStatesAmino { /** client identifier */ - client_id: string; + client_id?: string; /** consensus states and their heights associated with the client */ - consensus_states: ConsensusStateWithHeightAmino[]; + consensus_states?: ConsensusStateWithHeightAmino[]; } export interface ClientConsensusStatesAminoMsg { type: "cosmos-sdk/ClientConsensusStates"; @@ -110,13 +110,106 @@ export interface ClientConsensusStatesSDKType { consensus_states: ConsensusStateWithHeightSDKType[]; } /** - * ClientUpdateProposal is a governance proposal. If it passes, the substitute + * Height is a monotonically increasing data type + * that can be compared against another Height for the purposes of updating and + * freezing clients + * + * Normally the RevisionHeight is incremented at each height while keeping + * RevisionNumber the same. However some consensus algorithms may choose to + * reset the height in certain conditions e.g. hard forks, state-machine + * breaking changes In these cases, the RevisionNumber is incremented so that + * height continues to be monitonically increasing even as the RevisionHeight + * gets reset + */ +export interface Height { + /** the revision that the client is currently on */ + revisionNumber: bigint; + /** the height within the given revision */ + revisionHeight: bigint; +} +export interface HeightProtoMsg { + typeUrl: "/ibc.core.client.v1.Height"; + value: Uint8Array; +} +/** + * Height is a monotonically increasing data type + * that can be compared against another Height for the purposes of updating and + * freezing clients + * + * Normally the RevisionHeight is incremented at each height while keeping + * RevisionNumber the same. However some consensus algorithms may choose to + * reset the height in certain conditions e.g. hard forks, state-machine + * breaking changes In these cases, the RevisionNumber is incremented so that + * height continues to be monitonically increasing even as the RevisionHeight + * gets reset + */ +export interface HeightAmino { + /** the revision that the client is currently on */ + revision_number?: string; + /** the height within the given revision */ + revision_height?: string; +} +export interface HeightAminoMsg { + type: "cosmos-sdk/Height"; + value: HeightAmino; +} +/** + * Height is a monotonically increasing data type + * that can be compared against another Height for the purposes of updating and + * freezing clients + * + * Normally the RevisionHeight is incremented at each height while keeping + * RevisionNumber the same. However some consensus algorithms may choose to + * reset the height in certain conditions e.g. hard forks, state-machine + * breaking changes In these cases, the RevisionNumber is incremented so that + * height continues to be monitonically increasing even as the RevisionHeight + * gets reset + */ +export interface HeightSDKType { + revision_number: bigint; + revision_height: bigint; +} +/** Params defines the set of IBC light client parameters. */ +export interface Params { + /** + * allowed_clients defines the list of allowed client state types which can be created + * and interacted with. If a client type is removed from the allowed clients list, usage + * of this client will be disabled until it is added again to the list. + */ + allowedClients: string[]; +} +export interface ParamsProtoMsg { + typeUrl: "/ibc.core.client.v1.Params"; + value: Uint8Array; +} +/** Params defines the set of IBC light client parameters. */ +export interface ParamsAmino { + /** + * allowed_clients defines the list of allowed client state types which can be created + * and interacted with. If a client type is removed from the allowed clients list, usage + * of this client will be disabled until it is added again to the list. + */ + allowed_clients?: string[]; +} +export interface ParamsAminoMsg { + type: "cosmos-sdk/Params"; + value: ParamsAmino; +} +/** Params defines the set of IBC light client parameters. */ +export interface ParamsSDKType { + allowed_clients: string[]; +} +/** + * ClientUpdateProposal is a legacy governance proposal. If it passes, the substitute * client's latest consensus state is copied over to the subject client. The proposal * handler may fail if the subject and the substitute do not match in client and * chain parameters (with exception to latest height, frozen height, and chain-id). + * + * Deprecated: Please use MsgRecoverClient in favour of this message type. */ +/** @deprecated */ export interface ClientUpdateProposal { - $typeUrl?: string; + $typeUrl?: "/ibc.core.client.v1.ClientUpdateProposal"; /** the title of the update proposal */ title: string; /** the description of the proposal */ @@ -134,36 +227,42 @@ export interface ClientUpdateProposalProtoMsg { value: Uint8Array; } /** - * ClientUpdateProposal is a governance proposal. If it passes, the substitute + * ClientUpdateProposal is a legacy governance proposal. If it passes, the substitute * client's latest consensus state is copied over to the subject client. The proposal * handler may fail if the subject and the substitute do not match in client and * chain parameters (with exception to latest height, frozen height, and chain-id). + * + * Deprecated: Please use MsgRecoverClient in favour of this message type. */ +/** @deprecated */ export interface ClientUpdateProposalAmino { /** the title of the update proposal */ - title: string; + title?: string; /** the description of the proposal */ - description: string; + description?: string; /** the client identifier for the client to be updated if the proposal passes */ - subject_client_id: string; + subject_client_id?: string; /** * the substitute client identifier for the client standing in for the subject * client */ - substitute_client_id: string; + substitute_client_id?: string; } export interface ClientUpdateProposalAminoMsg { type: "cosmos-sdk/ClientUpdateProposal"; value: ClientUpdateProposalAmino; } /** - * ClientUpdateProposal is a governance proposal. If it passes, the substitute + * ClientUpdateProposal is a legacy governance proposal. If it passes, the substitute * client's latest consensus state is copied over to the subject client. The proposal * handler may fail if the subject and the substitute do not match in client and * chain parameters (with exception to latest height, frozen height, and chain-id). + * + * Deprecated: Please use MsgRecoverClient in favour of this message type. */ +/** @deprecated */ export interface ClientUpdateProposalSDKType { - $typeUrl?: string; + $typeUrl?: "/ibc.core.client.v1.ClientUpdateProposal"; title: string; description: string; subject_client_id: string; @@ -172,9 +271,12 @@ export interface ClientUpdateProposalSDKType { /** * UpgradeProposal is a gov Content type for initiating an IBC breaking * upgrade. + * + * Deprecated: Please use MsgIBCSoftwareUpgrade in favour of this message type. */ +/** @deprecated */ export interface UpgradeProposal { - $typeUrl?: string; + $typeUrl?: "/ibc.core.client.v1.UpgradeProposal"; title: string; description: string; plan: Plan; @@ -186,7 +288,7 @@ export interface UpgradeProposal { * of the chain. This will allow IBC connections to persist smoothly across * planned chain upgrades */ - upgradedClientState: Any; + upgradedClientState?: Any; } export interface UpgradeProposalProtoMsg { typeUrl: "/ibc.core.client.v1.UpgradeProposal"; @@ -195,10 +297,13 @@ export interface UpgradeProposalProtoMsg { /** * UpgradeProposal is a gov Content type for initiating an IBC breaking * upgrade. + * + * Deprecated: Please use MsgIBCSoftwareUpgrade in favour of this message type. */ +/** @deprecated */ export interface UpgradeProposalAmino { - title: string; - description: string; + title?: string; + description?: string; plan?: PlanAmino; /** * An UpgradedClientState must be provided to perform an IBC breaking upgrade. @@ -217,108 +322,21 @@ export interface UpgradeProposalAminoMsg { /** * UpgradeProposal is a gov Content type for initiating an IBC breaking * upgrade. + * + * Deprecated: Please use MsgIBCSoftwareUpgrade in favour of this message type. */ +/** @deprecated */ export interface UpgradeProposalSDKType { - $typeUrl?: string; + $typeUrl?: "/ibc.core.client.v1.UpgradeProposal"; title: string; description: string; plan: PlanSDKType; - upgraded_client_state: AnySDKType; -} -/** - * Height is a monotonically increasing data type - * that can be compared against another Height for the purposes of updating and - * freezing clients - * - * Normally the RevisionHeight is incremented at each height while keeping - * RevisionNumber the same. However some consensus algorithms may choose to - * reset the height in certain conditions e.g. hard forks, state-machine - * breaking changes In these cases, the RevisionNumber is incremented so that - * height continues to be monitonically increasing even as the RevisionHeight - * gets reset - */ -export interface Height { - /** the revision that the client is currently on */ - revisionNumber: bigint; - /** the height within the given revision */ - revisionHeight: bigint; -} -export interface HeightProtoMsg { - typeUrl: "/ibc.core.client.v1.Height"; - value: Uint8Array; -} -/** - * Height is a monotonically increasing data type - * that can be compared against another Height for the purposes of updating and - * freezing clients - * - * Normally the RevisionHeight is incremented at each height while keeping - * RevisionNumber the same. However some consensus algorithms may choose to - * reset the height in certain conditions e.g. hard forks, state-machine - * breaking changes In these cases, the RevisionNumber is incremented so that - * height continues to be monitonically increasing even as the RevisionHeight - * gets reset - */ -export interface HeightAmino { - /** the revision that the client is currently on */ - revision_number: string; - /** the height within the given revision */ - revision_height: string; -} -export interface HeightAminoMsg { - type: "cosmos-sdk/Height"; - value: HeightAmino; -} -/** - * Height is a monotonically increasing data type - * that can be compared against another Height for the purposes of updating and - * freezing clients - * - * Normally the RevisionHeight is incremented at each height while keeping - * RevisionNumber the same. However some consensus algorithms may choose to - * reset the height in certain conditions e.g. hard forks, state-machine - * breaking changes In these cases, the RevisionNumber is incremented so that - * height continues to be monitonically increasing even as the RevisionHeight - * gets reset - */ -export interface HeightSDKType { - revision_number: bigint; - revision_height: bigint; -} -/** Params defines the set of IBC light client parameters. */ -export interface Params { - /** - * allowed_clients defines the list of allowed client state types which can be created - * and interacted with. If a client type is removed from the allowed clients list, usage - * of this client will be disabled until it is added again to the list. - */ - allowedClients: string[]; -} -export interface ParamsProtoMsg { - typeUrl: "/ibc.core.client.v1.Params"; - value: Uint8Array; -} -/** Params defines the set of IBC light client parameters. */ -export interface ParamsAmino { - /** - * allowed_clients defines the list of allowed client state types which can be created - * and interacted with. If a client type is removed from the allowed clients list, usage - * of this client will be disabled until it is added again to the list. - */ - allowed_clients: string[]; -} -export interface ParamsAminoMsg { - type: "cosmos-sdk/Params"; - value: ParamsAmino; -} -/** Params defines the set of IBC light client parameters. */ -export interface ParamsSDKType { - allowed_clients: string[]; + upgraded_client_state?: AnySDKType; } function createBaseIdentifiedClientState(): IdentifiedClientState { return { clientId: "", - clientState: Any.fromPartial({}) + clientState: undefined }; } export const IdentifiedClientState = { @@ -359,10 +377,14 @@ export const IdentifiedClientState = { return message; }, fromAmino(object: IdentifiedClientStateAmino): IdentifiedClientState { - return { - clientId: object.client_id, - clientState: object?.client_state ? Any.fromAmino(object.client_state) : undefined - }; + const message = createBaseIdentifiedClientState(); + if (object.client_id !== undefined && object.client_id !== null) { + message.clientId = object.client_id; + } + if (object.client_state !== undefined && object.client_state !== null) { + message.clientState = Any.fromAmino(object.client_state); + } + return message; }, toAmino(message: IdentifiedClientState): IdentifiedClientStateAmino { const obj: any = {}; @@ -395,7 +417,7 @@ export const IdentifiedClientState = { function createBaseConsensusStateWithHeight(): ConsensusStateWithHeight { return { height: Height.fromPartial({}), - consensusState: Any.fromPartial({}) + consensusState: undefined }; } export const ConsensusStateWithHeight = { @@ -436,10 +458,14 @@ export const ConsensusStateWithHeight = { return message; }, fromAmino(object: ConsensusStateWithHeightAmino): ConsensusStateWithHeight { - return { - height: object?.height ? Height.fromAmino(object.height) : undefined, - consensusState: object?.consensus_state ? Any.fromAmino(object.consensus_state) : undefined - }; + const message = createBaseConsensusStateWithHeight(); + if (object.height !== undefined && object.height !== null) { + message.height = Height.fromAmino(object.height); + } + if (object.consensus_state !== undefined && object.consensus_state !== null) { + message.consensusState = Any.fromAmino(object.consensus_state); + } + return message; }, toAmino(message: ConsensusStateWithHeight): ConsensusStateWithHeightAmino { const obj: any = {}; @@ -513,10 +539,12 @@ export const ClientConsensusStates = { return message; }, fromAmino(object: ClientConsensusStatesAmino): ClientConsensusStates { - return { - clientId: object.client_id, - consensusStates: Array.isArray(object?.consensus_states) ? object.consensus_states.map((e: any) => ConsensusStateWithHeight.fromAmino(e)) : [] - }; + const message = createBaseClientConsensusStates(); + if (object.client_id !== undefined && object.client_id !== null) { + message.clientId = object.client_id; + } + message.consensusStates = object.consensus_states?.map(e => ConsensusStateWithHeight.fromAmino(e)) || []; + return message; }, toAmino(message: ClientConsensusStates): ClientConsensusStatesAmino { const obj: any = {}; @@ -550,50 +578,35 @@ export const ClientConsensusStates = { }; } }; -function createBaseClientUpdateProposal(): ClientUpdateProposal { +function createBaseHeight(): Height { return { - $typeUrl: "/ibc.core.client.v1.ClientUpdateProposal", - title: "", - description: "", - subjectClientId: "", - substituteClientId: "" + revisionNumber: BigInt(0), + revisionHeight: BigInt(0) }; } -export const ClientUpdateProposal = { - typeUrl: "/ibc.core.client.v1.ClientUpdateProposal", - encode(message: ClientUpdateProposal, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { - if (message.title !== "") { - writer.uint32(10).string(message.title); - } - if (message.description !== "") { - writer.uint32(18).string(message.description); - } - if (message.subjectClientId !== "") { - writer.uint32(26).string(message.subjectClientId); +export const Height = { + typeUrl: "/ibc.core.client.v1.Height", + encode(message: Height, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.revisionNumber !== BigInt(0)) { + writer.uint32(8).uint64(message.revisionNumber); } - if (message.substituteClientId !== "") { - writer.uint32(34).string(message.substituteClientId); + if (message.revisionHeight !== BigInt(0)) { + writer.uint32(16).uint64(message.revisionHeight); } return writer; }, - decode(input: BinaryReader | Uint8Array, length?: number): ClientUpdateProposal { + decode(input: BinaryReader | Uint8Array, length?: number): Height { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseClientUpdateProposal(); + const message = createBaseHeight(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.title = reader.string(); + message.revisionNumber = reader.uint64(); break; case 2: - message.description = reader.string(); - break; - case 3: - message.subjectClientId = reader.string(); - break; - case 4: - message.substituteClientId = reader.string(); + message.revisionHeight = reader.uint64(); break; default: reader.skipType(tag & 7); @@ -602,96 +615,68 @@ export const ClientUpdateProposal = { } return message; }, - fromPartial(object: Partial): ClientUpdateProposal { - const message = createBaseClientUpdateProposal(); - message.title = object.title ?? ""; - message.description = object.description ?? ""; - message.subjectClientId = object.subjectClientId ?? ""; - message.substituteClientId = object.substituteClientId ?? ""; - return message; + fromPartial(object: Partial): Height { + const message = createBaseHeight(); + message.revisionNumber = object.revisionNumber !== undefined && object.revisionNumber !== null ? BigInt(object.revisionNumber.toString()) : BigInt(0); + message.revisionHeight = object.revisionHeight !== undefined && object.revisionHeight !== null ? BigInt(object.revisionHeight.toString()) : BigInt(0); + return message; }, - fromAmino(object: ClientUpdateProposalAmino): ClientUpdateProposal { + fromAmino(object: HeightAmino): Height { return { - title: object.title, - description: object.description, - subjectClientId: object.subject_client_id, - substituteClientId: object.substitute_client_id + revisionNumber: BigInt(object.revision_number || "0"), + revisionHeight: BigInt(object.revision_height || "0") }; }, - toAmino(message: ClientUpdateProposal): ClientUpdateProposalAmino { + toAmino(message: Height): HeightAmino { const obj: any = {}; - obj.title = message.title; - obj.description = message.description; - obj.subject_client_id = message.subjectClientId; - obj.substitute_client_id = message.substituteClientId; + obj.revision_number = message.revisionNumber ? message.revisionNumber.toString() : undefined; + obj.revision_height = message.revisionHeight ? message.revisionHeight.toString() : undefined; return obj; }, - fromAminoMsg(object: ClientUpdateProposalAminoMsg): ClientUpdateProposal { - return ClientUpdateProposal.fromAmino(object.value); + fromAminoMsg(object: HeightAminoMsg): Height { + return Height.fromAmino(object.value); }, - toAminoMsg(message: ClientUpdateProposal): ClientUpdateProposalAminoMsg { + toAminoMsg(message: Height): HeightAminoMsg { return { - type: "cosmos-sdk/ClientUpdateProposal", - value: ClientUpdateProposal.toAmino(message) + type: "cosmos-sdk/Height", + value: Height.toAmino(message) }; }, - fromProtoMsg(message: ClientUpdateProposalProtoMsg): ClientUpdateProposal { - return ClientUpdateProposal.decode(message.value); + fromProtoMsg(message: HeightProtoMsg): Height { + return Height.decode(message.value); }, - toProto(message: ClientUpdateProposal): Uint8Array { - return ClientUpdateProposal.encode(message).finish(); + toProto(message: Height): Uint8Array { + return Height.encode(message).finish(); }, - toProtoMsg(message: ClientUpdateProposal): ClientUpdateProposalProtoMsg { + toProtoMsg(message: Height): HeightProtoMsg { return { - typeUrl: "/ibc.core.client.v1.ClientUpdateProposal", - value: ClientUpdateProposal.encode(message).finish() + typeUrl: "/ibc.core.client.v1.Height", + value: Height.encode(message).finish() }; } }; -function createBaseUpgradeProposal(): UpgradeProposal { +function createBaseParams(): Params { return { - $typeUrl: "/ibc.core.client.v1.UpgradeProposal", - title: "", - description: "", - plan: Plan.fromPartial({}), - upgradedClientState: Any.fromPartial({}) + allowedClients: [] }; } -export const UpgradeProposal = { - typeUrl: "/ibc.core.client.v1.UpgradeProposal", - encode(message: UpgradeProposal, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { - if (message.title !== "") { - writer.uint32(10).string(message.title); - } - if (message.description !== "") { - writer.uint32(18).string(message.description); - } - if (message.plan !== undefined) { - Plan.encode(message.plan, writer.uint32(26).fork()).ldelim(); - } - if (message.upgradedClientState !== undefined) { - Any.encode(message.upgradedClientState, writer.uint32(34).fork()).ldelim(); +export const Params = { + typeUrl: "/ibc.core.client.v1.Params", + encode(message: Params, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.allowedClients) { + writer.uint32(10).string(v!); } return writer; }, - decode(input: BinaryReader | Uint8Array, length?: number): UpgradeProposal { + decode(input: BinaryReader | Uint8Array, length?: number): Params { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseUpgradeProposal(); + const message = createBaseParams(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.title = reader.string(); - break; - case 2: - message.description = reader.string(); - break; - case 3: - message.plan = Plan.decode(reader, reader.uint32()); - break; - case 4: - message.upgradedClientState = Any.decode(reader, reader.uint32()); + message.allowedClients.push(reader.string()); break; default: reader.skipType(tag & 7); @@ -700,81 +685,91 @@ export const UpgradeProposal = { } return message; }, - fromPartial(object: Partial): UpgradeProposal { - const message = createBaseUpgradeProposal(); - message.title = object.title ?? ""; - message.description = object.description ?? ""; - message.plan = object.plan !== undefined && object.plan !== null ? Plan.fromPartial(object.plan) : undefined; - message.upgradedClientState = object.upgradedClientState !== undefined && object.upgradedClientState !== null ? Any.fromPartial(object.upgradedClientState) : undefined; + fromPartial(object: Partial): Params { + const message = createBaseParams(); + message.allowedClients = object.allowedClients?.map(e => e) || []; return message; }, - fromAmino(object: UpgradeProposalAmino): UpgradeProposal { - return { - title: object.title, - description: object.description, - plan: object?.plan ? Plan.fromAmino(object.plan) : undefined, - upgradedClientState: object?.upgraded_client_state ? Any.fromAmino(object.upgraded_client_state) : undefined - }; + fromAmino(object: ParamsAmino): Params { + const message = createBaseParams(); + message.allowedClients = object.allowed_clients?.map(e => e) || []; + return message; }, - toAmino(message: UpgradeProposal): UpgradeProposalAmino { + toAmino(message: Params): ParamsAmino { const obj: any = {}; - obj.title = message.title; - obj.description = message.description; - obj.plan = message.plan ? Plan.toAmino(message.plan) : undefined; - obj.upgraded_client_state = message.upgradedClientState ? Any.toAmino(message.upgradedClientState) : undefined; + if (message.allowedClients) { + obj.allowed_clients = message.allowedClients.map(e => e); + } else { + obj.allowed_clients = []; + } return obj; }, - fromAminoMsg(object: UpgradeProposalAminoMsg): UpgradeProposal { - return UpgradeProposal.fromAmino(object.value); + fromAminoMsg(object: ParamsAminoMsg): Params { + return Params.fromAmino(object.value); }, - toAminoMsg(message: UpgradeProposal): UpgradeProposalAminoMsg { + toAminoMsg(message: Params): ParamsAminoMsg { return { - type: "cosmos-sdk/UpgradeProposal", - value: UpgradeProposal.toAmino(message) + type: "cosmos-sdk/Params", + value: Params.toAmino(message) }; }, - fromProtoMsg(message: UpgradeProposalProtoMsg): UpgradeProposal { - return UpgradeProposal.decode(message.value); + fromProtoMsg(message: ParamsProtoMsg): Params { + return Params.decode(message.value); }, - toProto(message: UpgradeProposal): Uint8Array { - return UpgradeProposal.encode(message).finish(); + toProto(message: Params): Uint8Array { + return Params.encode(message).finish(); }, - toProtoMsg(message: UpgradeProposal): UpgradeProposalProtoMsg { + toProtoMsg(message: Params): ParamsProtoMsg { return { - typeUrl: "/ibc.core.client.v1.UpgradeProposal", - value: UpgradeProposal.encode(message).finish() + typeUrl: "/ibc.core.client.v1.Params", + value: Params.encode(message).finish() }; } }; -function createBaseHeight(): Height { +function createBaseClientUpdateProposal(): ClientUpdateProposal { return { - revisionNumber: BigInt(0), - revisionHeight: BigInt(0) + $typeUrl: "/ibc.core.client.v1.ClientUpdateProposal", + title: "", + description: "", + subjectClientId: "", + substituteClientId: "" }; } -export const Height = { - typeUrl: "/ibc.core.client.v1.Height", - encode(message: Height, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { - if (message.revisionNumber !== BigInt(0)) { - writer.uint32(8).uint64(message.revisionNumber); +export const ClientUpdateProposal = { + typeUrl: "/ibc.core.client.v1.ClientUpdateProposal", + encode(message: ClientUpdateProposal, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.title !== "") { + writer.uint32(10).string(message.title); } - if (message.revisionHeight !== BigInt(0)) { - writer.uint32(16).uint64(message.revisionHeight); + if (message.description !== "") { + writer.uint32(18).string(message.description); + } + if (message.subjectClientId !== "") { + writer.uint32(26).string(message.subjectClientId); + } + if (message.substituteClientId !== "") { + writer.uint32(34).string(message.substituteClientId); } return writer; }, - decode(input: BinaryReader | Uint8Array, length?: number): Height { + decode(input: BinaryReader | Uint8Array, length?: number): ClientUpdateProposal { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseHeight(); + const message = createBaseClientUpdateProposal(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.revisionNumber = reader.uint64(); + message.title = reader.string(); break; case 2: - message.revisionHeight = reader.uint64(); + message.description = reader.string(); + break; + case 3: + message.subjectClientId = reader.string(); + break; + case 4: + message.substituteClientId = reader.string(); break; default: reader.skipType(tag & 7); @@ -783,68 +778,104 @@ export const Height = { } return message; }, - fromPartial(object: Partial): Height { - const message = createBaseHeight(); - message.revisionNumber = object.revisionNumber !== undefined && object.revisionNumber !== null ? BigInt(object.revisionNumber.toString()) : BigInt(0); - message.revisionHeight = object.revisionHeight !== undefined && object.revisionHeight !== null ? BigInt(object.revisionHeight.toString()) : BigInt(0); + fromPartial(object: Partial): ClientUpdateProposal { + const message = createBaseClientUpdateProposal(); + message.title = object.title ?? ""; + message.description = object.description ?? ""; + message.subjectClientId = object.subjectClientId ?? ""; + message.substituteClientId = object.substituteClientId ?? ""; return message; }, - fromAmino(object: HeightAmino): Height { - return { - revisionNumber: BigInt(object.revision_number || "0"), - revisionHeight: BigInt(object.revision_height || "0") - }; + fromAmino(object: ClientUpdateProposalAmino): ClientUpdateProposal { + const message = createBaseClientUpdateProposal(); + if (object.title !== undefined && object.title !== null) { + message.title = object.title; + } + if (object.description !== undefined && object.description !== null) { + message.description = object.description; + } + if (object.subject_client_id !== undefined && object.subject_client_id !== null) { + message.subjectClientId = object.subject_client_id; + } + if (object.substitute_client_id !== undefined && object.substitute_client_id !== null) { + message.substituteClientId = object.substitute_client_id; + } + return message; }, - toAmino(message: Height): HeightAmino { + toAmino(message: ClientUpdateProposal): ClientUpdateProposalAmino { const obj: any = {}; - obj.revision_number = message.revisionNumber ? message.revisionNumber.toString() : undefined; - obj.revision_height = message.revisionHeight ? message.revisionHeight.toString() : undefined; + obj.title = message.title; + obj.description = message.description; + obj.subject_client_id = message.subjectClientId; + obj.substitute_client_id = message.substituteClientId; return obj; }, - fromAminoMsg(object: HeightAminoMsg): Height { - return Height.fromAmino(object.value); + fromAminoMsg(object: ClientUpdateProposalAminoMsg): ClientUpdateProposal { + return ClientUpdateProposal.fromAmino(object.value); }, - toAminoMsg(message: Height): HeightAminoMsg { + toAminoMsg(message: ClientUpdateProposal): ClientUpdateProposalAminoMsg { return { - type: "cosmos-sdk/Height", - value: Height.toAmino(message) + type: "cosmos-sdk/ClientUpdateProposal", + value: ClientUpdateProposal.toAmino(message) }; }, - fromProtoMsg(message: HeightProtoMsg): Height { - return Height.decode(message.value); + fromProtoMsg(message: ClientUpdateProposalProtoMsg): ClientUpdateProposal { + return ClientUpdateProposal.decode(message.value); }, - toProto(message: Height): Uint8Array { - return Height.encode(message).finish(); + toProto(message: ClientUpdateProposal): Uint8Array { + return ClientUpdateProposal.encode(message).finish(); }, - toProtoMsg(message: Height): HeightProtoMsg { + toProtoMsg(message: ClientUpdateProposal): ClientUpdateProposalProtoMsg { return { - typeUrl: "/ibc.core.client.v1.Height", - value: Height.encode(message).finish() + typeUrl: "/ibc.core.client.v1.ClientUpdateProposal", + value: ClientUpdateProposal.encode(message).finish() }; } }; -function createBaseParams(): Params { +function createBaseUpgradeProposal(): UpgradeProposal { return { - allowedClients: [] + $typeUrl: "/ibc.core.client.v1.UpgradeProposal", + title: "", + description: "", + plan: Plan.fromPartial({}), + upgradedClientState: undefined }; } -export const Params = { - typeUrl: "/ibc.core.client.v1.Params", - encode(message: Params, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { - for (const v of message.allowedClients) { - writer.uint32(10).string(v!); +export const UpgradeProposal = { + typeUrl: "/ibc.core.client.v1.UpgradeProposal", + encode(message: UpgradeProposal, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.title !== "") { + writer.uint32(10).string(message.title); + } + if (message.description !== "") { + writer.uint32(18).string(message.description); + } + if (message.plan !== undefined) { + Plan.encode(message.plan, writer.uint32(26).fork()).ldelim(); + } + if (message.upgradedClientState !== undefined) { + Any.encode(message.upgradedClientState, writer.uint32(34).fork()).ldelim(); } return writer; }, - decode(input: BinaryReader | Uint8Array, length?: number): Params { + decode(input: BinaryReader | Uint8Array, length?: number): UpgradeProposal { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseParams(); + const message = createBaseUpgradeProposal(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.allowedClients.push(reader.string()); + message.title = reader.string(); + break; + case 2: + message.description = reader.string(); + break; + case 3: + message.plan = Plan.decode(reader, reader.uint32()); + break; + case 4: + message.upgradedClientState = Any.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -853,44 +884,57 @@ export const Params = { } return message; }, - fromPartial(object: Partial): Params { - const message = createBaseParams(); - message.allowedClients = object.allowedClients?.map(e => e) || []; + fromPartial(object: Partial): UpgradeProposal { + const message = createBaseUpgradeProposal(); + message.title = object.title ?? ""; + message.description = object.description ?? ""; + message.plan = object.plan !== undefined && object.plan !== null ? Plan.fromPartial(object.plan) : undefined; + message.upgradedClientState = object.upgradedClientState !== undefined && object.upgradedClientState !== null ? Any.fromPartial(object.upgradedClientState) : undefined; return message; }, - fromAmino(object: ParamsAmino): Params { - return { - allowedClients: Array.isArray(object?.allowed_clients) ? object.allowed_clients.map((e: any) => e) : [] - }; + fromAmino(object: UpgradeProposalAmino): UpgradeProposal { + const message = createBaseUpgradeProposal(); + if (object.title !== undefined && object.title !== null) { + message.title = object.title; + } + if (object.description !== undefined && object.description !== null) { + message.description = object.description; + } + if (object.plan !== undefined && object.plan !== null) { + message.plan = Plan.fromAmino(object.plan); + } + if (object.upgraded_client_state !== undefined && object.upgraded_client_state !== null) { + message.upgradedClientState = Any.fromAmino(object.upgraded_client_state); + } + return message; }, - toAmino(message: Params): ParamsAmino { + toAmino(message: UpgradeProposal): UpgradeProposalAmino { const obj: any = {}; - if (message.allowedClients) { - obj.allowed_clients = message.allowedClients.map(e => e); - } else { - obj.allowed_clients = []; - } + obj.title = message.title; + obj.description = message.description; + obj.plan = message.plan ? Plan.toAmino(message.plan) : undefined; + obj.upgraded_client_state = message.upgradedClientState ? Any.toAmino(message.upgradedClientState) : undefined; return obj; }, - fromAminoMsg(object: ParamsAminoMsg): Params { - return Params.fromAmino(object.value); + fromAminoMsg(object: UpgradeProposalAminoMsg): UpgradeProposal { + return UpgradeProposal.fromAmino(object.value); }, - toAminoMsg(message: Params): ParamsAminoMsg { + toAminoMsg(message: UpgradeProposal): UpgradeProposalAminoMsg { return { - type: "cosmos-sdk/Params", - value: Params.toAmino(message) + type: "cosmos-sdk/UpgradeProposal", + value: UpgradeProposal.toAmino(message) }; }, - fromProtoMsg(message: ParamsProtoMsg): Params { - return Params.decode(message.value); + fromProtoMsg(message: UpgradeProposalProtoMsg): UpgradeProposal { + return UpgradeProposal.decode(message.value); }, - toProto(message: Params): Uint8Array { - return Params.encode(message).finish(); + toProto(message: UpgradeProposal): Uint8Array { + return UpgradeProposal.encode(message).finish(); }, - toProtoMsg(message: Params): ParamsProtoMsg { + toProtoMsg(message: UpgradeProposal): UpgradeProposalProtoMsg { return { - typeUrl: "/ibc.core.client.v1.Params", - value: Params.encode(message).finish() + typeUrl: "/ibc.core.client.v1.UpgradeProposal", + value: UpgradeProposal.encode(message).finish() }; } }; \ No newline at end of file diff --git a/packages/osmo-query/src/codegen/ibc/core/client/v1/genesis.ts b/packages/osmo-query/src/codegen/ibc/core/client/v1/genesis.ts index 1d0f80ada..e8cc363d2 100644 --- a/packages/osmo-query/src/codegen/ibc/core/client/v1/genesis.ts +++ b/packages/osmo-query/src/codegen/ibc/core/client/v1/genesis.ts @@ -1,5 +1,6 @@ import { IdentifiedClientState, IdentifiedClientStateAmino, IdentifiedClientStateSDKType, ClientConsensusStates, ClientConsensusStatesAmino, ClientConsensusStatesSDKType, Params, ParamsAmino, ParamsSDKType } from "./client"; import { BinaryReader, BinaryWriter } from "../../../../binary"; +import { bytesFromBase64, base64FromBytes } from "../../../../helpers"; /** GenesisState defines the ibc client submodule's genesis state. */ export interface GenesisState { /** client states with their corresponding identifiers */ @@ -9,7 +10,11 @@ export interface GenesisState { /** metadata from each client */ clientsMetadata: IdentifiedGenesisMetadata[]; params: Params; - /** create localhost on initialization */ + /** + * Deprecated: create_localhost has been deprecated. + * The localhost client is automatically created at genesis. + */ + /** @deprecated */ createLocalhost: boolean; /** the sequence for the next generated client identifier */ nextClientSequence: bigint; @@ -21,16 +26,20 @@ export interface GenesisStateProtoMsg { /** GenesisState defines the ibc client submodule's genesis state. */ export interface GenesisStateAmino { /** client states with their corresponding identifiers */ - clients: IdentifiedClientStateAmino[]; + clients?: IdentifiedClientStateAmino[]; /** consensus states from each client */ - clients_consensus: ClientConsensusStatesAmino[]; + clients_consensus?: ClientConsensusStatesAmino[]; /** metadata from each client */ - clients_metadata: IdentifiedGenesisMetadataAmino[]; + clients_metadata?: IdentifiedGenesisMetadataAmino[]; params?: ParamsAmino; - /** create localhost on initialization */ - create_localhost: boolean; + /** + * Deprecated: create_localhost has been deprecated. + * The localhost client is automatically created at genesis. + */ + /** @deprecated */ + create_localhost?: boolean; /** the sequence for the next generated client identifier */ - next_client_sequence: string; + next_client_sequence?: string; } export interface GenesisStateAminoMsg { type: "cosmos-sdk/GenesisState"; @@ -42,6 +51,7 @@ export interface GenesisStateSDKType { clients_consensus: ClientConsensusStatesSDKType[]; clients_metadata: IdentifiedGenesisMetadataSDKType[]; params: ParamsSDKType; + /** @deprecated */ create_localhost: boolean; next_client_sequence: bigint; } @@ -65,9 +75,9 @@ export interface GenesisMetadataProtoMsg { */ export interface GenesisMetadataAmino { /** store key of metadata without clientID-prefix */ - key: Uint8Array; + key?: string; /** metadata value */ - value: Uint8Array; + value?: string; } export interface GenesisMetadataAminoMsg { type: "cosmos-sdk/GenesisMetadata"; @@ -98,8 +108,8 @@ export interface IdentifiedGenesisMetadataProtoMsg { * client id. */ export interface IdentifiedGenesisMetadataAmino { - client_id: string; - client_metadata: GenesisMetadataAmino[]; + client_id?: string; + client_metadata?: GenesisMetadataAmino[]; } export interface IdentifiedGenesisMetadataAminoMsg { type: "cosmos-sdk/IdentifiedGenesisMetadata"; @@ -189,14 +199,20 @@ export const GenesisState = { return message; }, fromAmino(object: GenesisStateAmino): GenesisState { - return { - clients: Array.isArray(object?.clients) ? object.clients.map((e: any) => IdentifiedClientState.fromAmino(e)) : [], - clientsConsensus: Array.isArray(object?.clients_consensus) ? object.clients_consensus.map((e: any) => ClientConsensusStates.fromAmino(e)) : [], - clientsMetadata: Array.isArray(object?.clients_metadata) ? object.clients_metadata.map((e: any) => IdentifiedGenesisMetadata.fromAmino(e)) : [], - params: object?.params ? Params.fromAmino(object.params) : undefined, - createLocalhost: object.create_localhost, - nextClientSequence: BigInt(object.next_client_sequence) - }; + const message = createBaseGenesisState(); + message.clients = object.clients?.map(e => IdentifiedClientState.fromAmino(e)) || []; + message.clientsConsensus = object.clients_consensus?.map(e => ClientConsensusStates.fromAmino(e)) || []; + message.clientsMetadata = object.clients_metadata?.map(e => IdentifiedGenesisMetadata.fromAmino(e)) || []; + if (object.params !== undefined && object.params !== null) { + message.params = Params.fromAmino(object.params); + } + if (object.create_localhost !== undefined && object.create_localhost !== null) { + message.createLocalhost = object.create_localhost; + } + if (object.next_client_sequence !== undefined && object.next_client_sequence !== null) { + message.nextClientSequence = BigInt(object.next_client_sequence); + } + return message; }, toAmino(message: GenesisState): GenesisStateAmino { const obj: any = {}; @@ -286,15 +302,19 @@ export const GenesisMetadata = { return message; }, fromAmino(object: GenesisMetadataAmino): GenesisMetadata { - return { - key: object.key, - value: object.value - }; + const message = createBaseGenesisMetadata(); + if (object.key !== undefined && object.key !== null) { + message.key = bytesFromBase64(object.key); + } + if (object.value !== undefined && object.value !== null) { + message.value = bytesFromBase64(object.value); + } + return message; }, toAmino(message: GenesisMetadata): GenesisMetadataAmino { const obj: any = {}; - obj.key = message.key; - obj.value = message.value; + obj.key = message.key ? base64FromBytes(message.key) : undefined; + obj.value = message.value ? base64FromBytes(message.value) : undefined; return obj; }, fromAminoMsg(object: GenesisMetadataAminoMsg): GenesisMetadata { @@ -363,10 +383,12 @@ export const IdentifiedGenesisMetadata = { return message; }, fromAmino(object: IdentifiedGenesisMetadataAmino): IdentifiedGenesisMetadata { - return { - clientId: object.client_id, - clientMetadata: Array.isArray(object?.client_metadata) ? object.client_metadata.map((e: any) => GenesisMetadata.fromAmino(e)) : [] - }; + const message = createBaseIdentifiedGenesisMetadata(); + if (object.client_id !== undefined && object.client_id !== null) { + message.clientId = object.client_id; + } + message.clientMetadata = object.client_metadata?.map(e => GenesisMetadata.fromAmino(e)) || []; + return message; }, toAmino(message: IdentifiedGenesisMetadata): IdentifiedGenesisMetadataAmino { const obj: any = {}; diff --git a/packages/osmo-query/src/codegen/ibc/core/client/v1/query.ts b/packages/osmo-query/src/codegen/ibc/core/client/v1/query.ts index 67ace4443..f4012b03b 100644 --- a/packages/osmo-query/src/codegen/ibc/core/client/v1/query.ts +++ b/packages/osmo-query/src/codegen/ibc/core/client/v1/query.ts @@ -2,6 +2,7 @@ import { PageRequest, PageRequestAmino, PageRequestSDKType, PageResponse, PageRe import { Any, AnyAmino, AnySDKType } from "../../../../google/protobuf/any"; import { Height, HeightAmino, HeightSDKType, IdentifiedClientState, IdentifiedClientStateAmino, IdentifiedClientStateSDKType, ConsensusStateWithHeight, ConsensusStateWithHeightAmino, ConsensusStateWithHeightSDKType, Params, ParamsAmino, ParamsSDKType } from "./client"; import { BinaryReader, BinaryWriter } from "../../../../binary"; +import { bytesFromBase64, base64FromBytes } from "../../../../helpers"; /** * QueryClientStateRequest is the request type for the Query/ClientState RPC * method @@ -20,7 +21,7 @@ export interface QueryClientStateRequestProtoMsg { */ export interface QueryClientStateRequestAmino { /** client state unique identifier */ - client_id: string; + client_id?: string; } export interface QueryClientStateRequestAminoMsg { type: "cosmos-sdk/QueryClientStateRequest"; @@ -40,7 +41,7 @@ export interface QueryClientStateRequestSDKType { */ export interface QueryClientStateResponse { /** client state associated with the request identifier */ - clientState: Any; + clientState?: Any; /** merkle proof of existence */ proof: Uint8Array; /** height at which the proof was retrieved */ @@ -59,7 +60,7 @@ export interface QueryClientStateResponseAmino { /** client state associated with the request identifier */ client_state?: AnyAmino; /** merkle proof of existence */ - proof: Uint8Array; + proof?: string; /** height at which the proof was retrieved */ proof_height?: HeightAmino; } @@ -73,7 +74,7 @@ export interface QueryClientStateResponseAminoMsg { * which the proof was retrieved. */ export interface QueryClientStateResponseSDKType { - client_state: AnySDKType; + client_state?: AnySDKType; proof: Uint8Array; proof_height: HeightSDKType; } @@ -83,7 +84,7 @@ export interface QueryClientStateResponseSDKType { */ export interface QueryClientStatesRequest { /** pagination request */ - pagination: PageRequest; + pagination?: PageRequest; } export interface QueryClientStatesRequestProtoMsg { typeUrl: "/ibc.core.client.v1.QueryClientStatesRequest"; @@ -106,7 +107,7 @@ export interface QueryClientStatesRequestAminoMsg { * method */ export interface QueryClientStatesRequestSDKType { - pagination: PageRequestSDKType; + pagination?: PageRequestSDKType; } /** * QueryClientStatesResponse is the response type for the Query/ClientStates RPC @@ -116,7 +117,7 @@ export interface QueryClientStatesResponse { /** list of stored ClientStates of the chain. */ clientStates: IdentifiedClientState[]; /** pagination response */ - pagination: PageResponse; + pagination?: PageResponse; } export interface QueryClientStatesResponseProtoMsg { typeUrl: "/ibc.core.client.v1.QueryClientStatesResponse"; @@ -128,7 +129,7 @@ export interface QueryClientStatesResponseProtoMsg { */ export interface QueryClientStatesResponseAmino { /** list of stored ClientStates of the chain. */ - client_states: IdentifiedClientStateAmino[]; + client_states?: IdentifiedClientStateAmino[]; /** pagination response */ pagination?: PageResponseAmino; } @@ -142,7 +143,7 @@ export interface QueryClientStatesResponseAminoMsg { */ export interface QueryClientStatesResponseSDKType { client_states: IdentifiedClientStateSDKType[]; - pagination: PageResponseSDKType; + pagination?: PageResponseSDKType; } /** * QueryConsensusStateRequest is the request type for the Query/ConsensusState @@ -157,7 +158,7 @@ export interface QueryConsensusStateRequest { /** consensus state revision height */ revisionHeight: bigint; /** - * latest_height overrrides the height field and queries the latest stored + * latest_height overrides the height field and queries the latest stored * ConsensusState */ latestHeight: boolean; @@ -173,16 +174,16 @@ export interface QueryConsensusStateRequestProtoMsg { */ export interface QueryConsensusStateRequestAmino { /** client identifier */ - client_id: string; + client_id?: string; /** consensus state revision number */ - revision_number: string; + revision_number?: string; /** consensus state revision height */ - revision_height: string; + revision_height?: string; /** - * latest_height overrrides the height field and queries the latest stored + * latest_height overrides the height field and queries the latest stored * ConsensusState */ - latest_height: boolean; + latest_height?: boolean; } export interface QueryConsensusStateRequestAminoMsg { type: "cosmos-sdk/QueryConsensusStateRequest"; @@ -205,7 +206,7 @@ export interface QueryConsensusStateRequestSDKType { */ export interface QueryConsensusStateResponse { /** consensus state associated with the client identifier at the given height */ - consensusState: Any; + consensusState?: Any; /** merkle proof of existence */ proof: Uint8Array; /** height at which the proof was retrieved */ @@ -223,7 +224,7 @@ export interface QueryConsensusStateResponseAmino { /** consensus state associated with the client identifier at the given height */ consensus_state?: AnyAmino; /** merkle proof of existence */ - proof: Uint8Array; + proof?: string; /** height at which the proof was retrieved */ proof_height?: HeightAmino; } @@ -236,7 +237,7 @@ export interface QueryConsensusStateResponseAminoMsg { * RPC method */ export interface QueryConsensusStateResponseSDKType { - consensus_state: AnySDKType; + consensus_state?: AnySDKType; proof: Uint8Array; proof_height: HeightSDKType; } @@ -248,7 +249,7 @@ export interface QueryConsensusStatesRequest { /** client identifier */ clientId: string; /** pagination request */ - pagination: PageRequest; + pagination?: PageRequest; } export interface QueryConsensusStatesRequestProtoMsg { typeUrl: "/ibc.core.client.v1.QueryConsensusStatesRequest"; @@ -260,7 +261,7 @@ export interface QueryConsensusStatesRequestProtoMsg { */ export interface QueryConsensusStatesRequestAmino { /** client identifier */ - client_id: string; + client_id?: string; /** pagination request */ pagination?: PageRequestAmino; } @@ -274,7 +275,7 @@ export interface QueryConsensusStatesRequestAminoMsg { */ export interface QueryConsensusStatesRequestSDKType { client_id: string; - pagination: PageRequestSDKType; + pagination?: PageRequestSDKType; } /** * QueryConsensusStatesResponse is the response type for the @@ -284,7 +285,7 @@ export interface QueryConsensusStatesResponse { /** consensus states associated with the identifier */ consensusStates: ConsensusStateWithHeight[]; /** pagination response */ - pagination: PageResponse; + pagination?: PageResponse; } export interface QueryConsensusStatesResponseProtoMsg { typeUrl: "/ibc.core.client.v1.QueryConsensusStatesResponse"; @@ -296,7 +297,7 @@ export interface QueryConsensusStatesResponseProtoMsg { */ export interface QueryConsensusStatesResponseAmino { /** consensus states associated with the identifier */ - consensus_states: ConsensusStateWithHeightAmino[]; + consensus_states?: ConsensusStateWithHeightAmino[]; /** pagination response */ pagination?: PageResponseAmino; } @@ -310,7 +311,7 @@ export interface QueryConsensusStatesResponseAminoMsg { */ export interface QueryConsensusStatesResponseSDKType { consensus_states: ConsensusStateWithHeightSDKType[]; - pagination: PageResponseSDKType; + pagination?: PageResponseSDKType; } /** * QueryConsensusStateHeightsRequest is the request type for Query/ConsensusStateHeights @@ -320,7 +321,7 @@ export interface QueryConsensusStateHeightsRequest { /** client identifier */ clientId: string; /** pagination request */ - pagination: PageRequest; + pagination?: PageRequest; } export interface QueryConsensusStateHeightsRequestProtoMsg { typeUrl: "/ibc.core.client.v1.QueryConsensusStateHeightsRequest"; @@ -332,7 +333,7 @@ export interface QueryConsensusStateHeightsRequestProtoMsg { */ export interface QueryConsensusStateHeightsRequestAmino { /** client identifier */ - client_id: string; + client_id?: string; /** pagination request */ pagination?: PageRequestAmino; } @@ -346,7 +347,7 @@ export interface QueryConsensusStateHeightsRequestAminoMsg { */ export interface QueryConsensusStateHeightsRequestSDKType { client_id: string; - pagination: PageRequestSDKType; + pagination?: PageRequestSDKType; } /** * QueryConsensusStateHeightsResponse is the response type for the @@ -356,7 +357,7 @@ export interface QueryConsensusStateHeightsResponse { /** consensus state heights */ consensusStateHeights: Height[]; /** pagination response */ - pagination: PageResponse; + pagination?: PageResponse; } export interface QueryConsensusStateHeightsResponseProtoMsg { typeUrl: "/ibc.core.client.v1.QueryConsensusStateHeightsResponse"; @@ -368,7 +369,7 @@ export interface QueryConsensusStateHeightsResponseProtoMsg { */ export interface QueryConsensusStateHeightsResponseAmino { /** consensus state heights */ - consensus_state_heights: HeightAmino[]; + consensus_state_heights?: HeightAmino[]; /** pagination response */ pagination?: PageResponseAmino; } @@ -382,7 +383,7 @@ export interface QueryConsensusStateHeightsResponseAminoMsg { */ export interface QueryConsensusStateHeightsResponseSDKType { consensus_state_heights: HeightSDKType[]; - pagination: PageResponseSDKType; + pagination?: PageResponseSDKType; } /** * QueryClientStatusRequest is the request type for the Query/ClientStatus RPC @@ -402,7 +403,7 @@ export interface QueryClientStatusRequestProtoMsg { */ export interface QueryClientStatusRequestAmino { /** client unique identifier */ - client_id: string; + client_id?: string; } export interface QueryClientStatusRequestAminoMsg { type: "cosmos-sdk/QueryClientStatusRequest"; @@ -431,7 +432,7 @@ export interface QueryClientStatusResponseProtoMsg { * method. It returns the current status of the IBC client. */ export interface QueryClientStatusResponseAmino { - status: string; + status?: string; } export interface QueryClientStatusResponseAminoMsg { type: "cosmos-sdk/QueryClientStatusResponse"; @@ -473,7 +474,7 @@ export interface QueryClientParamsRequestSDKType {} */ export interface QueryClientParamsResponse { /** params defines the parameters of the module. */ - params: Params; + params?: Params; } export interface QueryClientParamsResponseProtoMsg { typeUrl: "/ibc.core.client.v1.QueryClientParamsResponse"; @@ -496,7 +497,7 @@ export interface QueryClientParamsResponseAminoMsg { * method. */ export interface QueryClientParamsResponseSDKType { - params: ParamsSDKType; + params?: ParamsSDKType; } /** * QueryUpgradedClientStateRequest is the request type for the @@ -527,7 +528,7 @@ export interface QueryUpgradedClientStateRequestSDKType {} */ export interface QueryUpgradedClientStateResponse { /** client state associated with the request identifier */ - upgradedClientState: Any; + upgradedClientState?: Any; } export interface QueryUpgradedClientStateResponseProtoMsg { typeUrl: "/ibc.core.client.v1.QueryUpgradedClientStateResponse"; @@ -550,7 +551,7 @@ export interface QueryUpgradedClientStateResponseAminoMsg { * Query/UpgradedClientState RPC method. */ export interface QueryUpgradedClientStateResponseSDKType { - upgraded_client_state: AnySDKType; + upgraded_client_state?: AnySDKType; } /** * QueryUpgradedConsensusStateRequest is the request type for the @@ -581,7 +582,7 @@ export interface QueryUpgradedConsensusStateRequestSDKType {} */ export interface QueryUpgradedConsensusStateResponse { /** Consensus state associated with the request identifier */ - upgradedConsensusState: Any; + upgradedConsensusState?: Any; } export interface QueryUpgradedConsensusStateResponseProtoMsg { typeUrl: "/ibc.core.client.v1.QueryUpgradedConsensusStateResponse"; @@ -604,7 +605,7 @@ export interface QueryUpgradedConsensusStateResponseAminoMsg { * Query/UpgradedConsensusState RPC method. */ export interface QueryUpgradedConsensusStateResponseSDKType { - upgraded_consensus_state: AnySDKType; + upgraded_consensus_state?: AnySDKType; } function createBaseQueryClientStateRequest(): QueryClientStateRequest { return { @@ -642,9 +643,11 @@ export const QueryClientStateRequest = { return message; }, fromAmino(object: QueryClientStateRequestAmino): QueryClientStateRequest { - return { - clientId: object.client_id - }; + const message = createBaseQueryClientStateRequest(); + if (object.client_id !== undefined && object.client_id !== null) { + message.clientId = object.client_id; + } + return message; }, toAmino(message: QueryClientStateRequest): QueryClientStateRequestAmino { const obj: any = {}; @@ -675,7 +678,7 @@ export const QueryClientStateRequest = { }; function createBaseQueryClientStateResponse(): QueryClientStateResponse { return { - clientState: Any.fromPartial({}), + clientState: undefined, proof: new Uint8Array(), proofHeight: Height.fromPartial({}) }; @@ -725,16 +728,22 @@ export const QueryClientStateResponse = { return message; }, fromAmino(object: QueryClientStateResponseAmino): QueryClientStateResponse { - return { - clientState: object?.client_state ? Any.fromAmino(object.client_state) : undefined, - proof: object.proof, - proofHeight: object?.proof_height ? Height.fromAmino(object.proof_height) : undefined - }; + const message = createBaseQueryClientStateResponse(); + if (object.client_state !== undefined && object.client_state !== null) { + message.clientState = Any.fromAmino(object.client_state); + } + if (object.proof !== undefined && object.proof !== null) { + message.proof = bytesFromBase64(object.proof); + } + if (object.proof_height !== undefined && object.proof_height !== null) { + message.proofHeight = Height.fromAmino(object.proof_height); + } + return message; }, toAmino(message: QueryClientStateResponse): QueryClientStateResponseAmino { const obj: any = {}; obj.client_state = message.clientState ? Any.toAmino(message.clientState) : undefined; - obj.proof = message.proof; + obj.proof = message.proof ? base64FromBytes(message.proof) : undefined; obj.proof_height = message.proofHeight ? Height.toAmino(message.proofHeight) : {}; return obj; }, @@ -762,7 +771,7 @@ export const QueryClientStateResponse = { }; function createBaseQueryClientStatesRequest(): QueryClientStatesRequest { return { - pagination: PageRequest.fromPartial({}) + pagination: undefined }; } export const QueryClientStatesRequest = { @@ -796,9 +805,11 @@ export const QueryClientStatesRequest = { return message; }, fromAmino(object: QueryClientStatesRequestAmino): QueryClientStatesRequest { - return { - pagination: object?.pagination ? PageRequest.fromAmino(object.pagination) : undefined - }; + const message = createBaseQueryClientStatesRequest(); + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromAmino(object.pagination); + } + return message; }, toAmino(message: QueryClientStatesRequest): QueryClientStatesRequestAmino { const obj: any = {}; @@ -830,7 +841,7 @@ export const QueryClientStatesRequest = { function createBaseQueryClientStatesResponse(): QueryClientStatesResponse { return { clientStates: [], - pagination: PageResponse.fromPartial({}) + pagination: undefined }; } export const QueryClientStatesResponse = { @@ -871,10 +882,12 @@ export const QueryClientStatesResponse = { return message; }, fromAmino(object: QueryClientStatesResponseAmino): QueryClientStatesResponse { - return { - clientStates: Array.isArray(object?.client_states) ? object.client_states.map((e: any) => IdentifiedClientState.fromAmino(e)) : [], - pagination: object?.pagination ? PageResponse.fromAmino(object.pagination) : undefined - }; + const message = createBaseQueryClientStatesResponse(); + message.clientStates = object.client_states?.map(e => IdentifiedClientState.fromAmino(e)) || []; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromAmino(object.pagination); + } + return message; }, toAmino(message: QueryClientStatesResponse): QueryClientStatesResponseAmino { const obj: any = {}; @@ -968,12 +981,20 @@ export const QueryConsensusStateRequest = { return message; }, fromAmino(object: QueryConsensusStateRequestAmino): QueryConsensusStateRequest { - return { - clientId: object.client_id, - revisionNumber: BigInt(object.revision_number), - revisionHeight: BigInt(object.revision_height), - latestHeight: object.latest_height - }; + const message = createBaseQueryConsensusStateRequest(); + if (object.client_id !== undefined && object.client_id !== null) { + message.clientId = object.client_id; + } + if (object.revision_number !== undefined && object.revision_number !== null) { + message.revisionNumber = BigInt(object.revision_number); + } + if (object.revision_height !== undefined && object.revision_height !== null) { + message.revisionHeight = BigInt(object.revision_height); + } + if (object.latest_height !== undefined && object.latest_height !== null) { + message.latestHeight = object.latest_height; + } + return message; }, toAmino(message: QueryConsensusStateRequest): QueryConsensusStateRequestAmino { const obj: any = {}; @@ -1007,7 +1028,7 @@ export const QueryConsensusStateRequest = { }; function createBaseQueryConsensusStateResponse(): QueryConsensusStateResponse { return { - consensusState: Any.fromPartial({}), + consensusState: undefined, proof: new Uint8Array(), proofHeight: Height.fromPartial({}) }; @@ -1057,16 +1078,22 @@ export const QueryConsensusStateResponse = { return message; }, fromAmino(object: QueryConsensusStateResponseAmino): QueryConsensusStateResponse { - return { - consensusState: object?.consensus_state ? Any.fromAmino(object.consensus_state) : undefined, - proof: object.proof, - proofHeight: object?.proof_height ? Height.fromAmino(object.proof_height) : undefined - }; + const message = createBaseQueryConsensusStateResponse(); + if (object.consensus_state !== undefined && object.consensus_state !== null) { + message.consensusState = Any.fromAmino(object.consensus_state); + } + if (object.proof !== undefined && object.proof !== null) { + message.proof = bytesFromBase64(object.proof); + } + if (object.proof_height !== undefined && object.proof_height !== null) { + message.proofHeight = Height.fromAmino(object.proof_height); + } + return message; }, toAmino(message: QueryConsensusStateResponse): QueryConsensusStateResponseAmino { const obj: any = {}; obj.consensus_state = message.consensusState ? Any.toAmino(message.consensusState) : undefined; - obj.proof = message.proof; + obj.proof = message.proof ? base64FromBytes(message.proof) : undefined; obj.proof_height = message.proofHeight ? Height.toAmino(message.proofHeight) : {}; return obj; }, @@ -1095,7 +1122,7 @@ export const QueryConsensusStateResponse = { function createBaseQueryConsensusStatesRequest(): QueryConsensusStatesRequest { return { clientId: "", - pagination: PageRequest.fromPartial({}) + pagination: undefined }; } export const QueryConsensusStatesRequest = { @@ -1136,10 +1163,14 @@ export const QueryConsensusStatesRequest = { return message; }, fromAmino(object: QueryConsensusStatesRequestAmino): QueryConsensusStatesRequest { - return { - clientId: object.client_id, - pagination: object?.pagination ? PageRequest.fromAmino(object.pagination) : undefined - }; + const message = createBaseQueryConsensusStatesRequest(); + if (object.client_id !== undefined && object.client_id !== null) { + message.clientId = object.client_id; + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromAmino(object.pagination); + } + return message; }, toAmino(message: QueryConsensusStatesRequest): QueryConsensusStatesRequestAmino { const obj: any = {}; @@ -1172,7 +1203,7 @@ export const QueryConsensusStatesRequest = { function createBaseQueryConsensusStatesResponse(): QueryConsensusStatesResponse { return { consensusStates: [], - pagination: PageResponse.fromPartial({}) + pagination: undefined }; } export const QueryConsensusStatesResponse = { @@ -1213,10 +1244,12 @@ export const QueryConsensusStatesResponse = { return message; }, fromAmino(object: QueryConsensusStatesResponseAmino): QueryConsensusStatesResponse { - return { - consensusStates: Array.isArray(object?.consensus_states) ? object.consensus_states.map((e: any) => ConsensusStateWithHeight.fromAmino(e)) : [], - pagination: object?.pagination ? PageResponse.fromAmino(object.pagination) : undefined - }; + const message = createBaseQueryConsensusStatesResponse(); + message.consensusStates = object.consensus_states?.map(e => ConsensusStateWithHeight.fromAmino(e)) || []; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromAmino(object.pagination); + } + return message; }, toAmino(message: QueryConsensusStatesResponse): QueryConsensusStatesResponseAmino { const obj: any = {}; @@ -1253,7 +1286,7 @@ export const QueryConsensusStatesResponse = { function createBaseQueryConsensusStateHeightsRequest(): QueryConsensusStateHeightsRequest { return { clientId: "", - pagination: PageRequest.fromPartial({}) + pagination: undefined }; } export const QueryConsensusStateHeightsRequest = { @@ -1294,10 +1327,14 @@ export const QueryConsensusStateHeightsRequest = { return message; }, fromAmino(object: QueryConsensusStateHeightsRequestAmino): QueryConsensusStateHeightsRequest { - return { - clientId: object.client_id, - pagination: object?.pagination ? PageRequest.fromAmino(object.pagination) : undefined - }; + const message = createBaseQueryConsensusStateHeightsRequest(); + if (object.client_id !== undefined && object.client_id !== null) { + message.clientId = object.client_id; + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromAmino(object.pagination); + } + return message; }, toAmino(message: QueryConsensusStateHeightsRequest): QueryConsensusStateHeightsRequestAmino { const obj: any = {}; @@ -1330,7 +1367,7 @@ export const QueryConsensusStateHeightsRequest = { function createBaseQueryConsensusStateHeightsResponse(): QueryConsensusStateHeightsResponse { return { consensusStateHeights: [], - pagination: PageResponse.fromPartial({}) + pagination: undefined }; } export const QueryConsensusStateHeightsResponse = { @@ -1371,10 +1408,12 @@ export const QueryConsensusStateHeightsResponse = { return message; }, fromAmino(object: QueryConsensusStateHeightsResponseAmino): QueryConsensusStateHeightsResponse { - return { - consensusStateHeights: Array.isArray(object?.consensus_state_heights) ? object.consensus_state_heights.map((e: any) => Height.fromAmino(e)) : [], - pagination: object?.pagination ? PageResponse.fromAmino(object.pagination) : undefined - }; + const message = createBaseQueryConsensusStateHeightsResponse(); + message.consensusStateHeights = object.consensus_state_heights?.map(e => Height.fromAmino(e)) || []; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromAmino(object.pagination); + } + return message; }, toAmino(message: QueryConsensusStateHeightsResponse): QueryConsensusStateHeightsResponseAmino { const obj: any = {}; @@ -1444,9 +1483,11 @@ export const QueryClientStatusRequest = { return message; }, fromAmino(object: QueryClientStatusRequestAmino): QueryClientStatusRequest { - return { - clientId: object.client_id - }; + const message = createBaseQueryClientStatusRequest(); + if (object.client_id !== undefined && object.client_id !== null) { + message.clientId = object.client_id; + } + return message; }, toAmino(message: QueryClientStatusRequest): QueryClientStatusRequestAmino { const obj: any = {}; @@ -1511,9 +1552,11 @@ export const QueryClientStatusResponse = { return message; }, fromAmino(object: QueryClientStatusResponseAmino): QueryClientStatusResponse { - return { - status: object.status - }; + const message = createBaseQueryClientStatusResponse(); + if (object.status !== undefined && object.status !== null) { + message.status = object.status; + } + return message; }, toAmino(message: QueryClientStatusResponse): QueryClientStatusResponseAmino { const obj: any = {}; @@ -1569,7 +1612,8 @@ export const QueryClientParamsRequest = { return message; }, fromAmino(_: QueryClientParamsRequestAmino): QueryClientParamsRequest { - return {}; + const message = createBaseQueryClientParamsRequest(); + return message; }, toAmino(_: QueryClientParamsRequest): QueryClientParamsRequestAmino { const obj: any = {}; @@ -1599,7 +1643,7 @@ export const QueryClientParamsRequest = { }; function createBaseQueryClientParamsResponse(): QueryClientParamsResponse { return { - params: Params.fromPartial({}) + params: undefined }; } export const QueryClientParamsResponse = { @@ -1633,9 +1677,11 @@ export const QueryClientParamsResponse = { return message; }, fromAmino(object: QueryClientParamsResponseAmino): QueryClientParamsResponse { - return { - params: object?.params ? Params.fromAmino(object.params) : undefined - }; + const message = createBaseQueryClientParamsResponse(); + if (object.params !== undefined && object.params !== null) { + message.params = Params.fromAmino(object.params); + } + return message; }, toAmino(message: QueryClientParamsResponse): QueryClientParamsResponseAmino { const obj: any = {}; @@ -1691,7 +1737,8 @@ export const QueryUpgradedClientStateRequest = { return message; }, fromAmino(_: QueryUpgradedClientStateRequestAmino): QueryUpgradedClientStateRequest { - return {}; + const message = createBaseQueryUpgradedClientStateRequest(); + return message; }, toAmino(_: QueryUpgradedClientStateRequest): QueryUpgradedClientStateRequestAmino { const obj: any = {}; @@ -1721,7 +1768,7 @@ export const QueryUpgradedClientStateRequest = { }; function createBaseQueryUpgradedClientStateResponse(): QueryUpgradedClientStateResponse { return { - upgradedClientState: Any.fromPartial({}) + upgradedClientState: undefined }; } export const QueryUpgradedClientStateResponse = { @@ -1755,9 +1802,11 @@ export const QueryUpgradedClientStateResponse = { return message; }, fromAmino(object: QueryUpgradedClientStateResponseAmino): QueryUpgradedClientStateResponse { - return { - upgradedClientState: object?.upgraded_client_state ? Any.fromAmino(object.upgraded_client_state) : undefined - }; + const message = createBaseQueryUpgradedClientStateResponse(); + if (object.upgraded_client_state !== undefined && object.upgraded_client_state !== null) { + message.upgradedClientState = Any.fromAmino(object.upgraded_client_state); + } + return message; }, toAmino(message: QueryUpgradedClientStateResponse): QueryUpgradedClientStateResponseAmino { const obj: any = {}; @@ -1813,7 +1862,8 @@ export const QueryUpgradedConsensusStateRequest = { return message; }, fromAmino(_: QueryUpgradedConsensusStateRequestAmino): QueryUpgradedConsensusStateRequest { - return {}; + const message = createBaseQueryUpgradedConsensusStateRequest(); + return message; }, toAmino(_: QueryUpgradedConsensusStateRequest): QueryUpgradedConsensusStateRequestAmino { const obj: any = {}; @@ -1843,7 +1893,7 @@ export const QueryUpgradedConsensusStateRequest = { }; function createBaseQueryUpgradedConsensusStateResponse(): QueryUpgradedConsensusStateResponse { return { - upgradedConsensusState: Any.fromPartial({}) + upgradedConsensusState: undefined }; } export const QueryUpgradedConsensusStateResponse = { @@ -1877,9 +1927,11 @@ export const QueryUpgradedConsensusStateResponse = { return message; }, fromAmino(object: QueryUpgradedConsensusStateResponseAmino): QueryUpgradedConsensusStateResponse { - return { - upgradedConsensusState: object?.upgraded_consensus_state ? Any.fromAmino(object.upgraded_consensus_state) : undefined - }; + const message = createBaseQueryUpgradedConsensusStateResponse(); + if (object.upgraded_consensus_state !== undefined && object.upgraded_consensus_state !== null) { + message.upgradedConsensusState = Any.fromAmino(object.upgraded_consensus_state); + } + return message; }, toAmino(message: QueryUpgradedConsensusStateResponse): QueryUpgradedConsensusStateResponseAmino { const obj: any = {}; diff --git a/packages/osmo-query/src/codegen/ibc/core/client/v1/tx.amino.ts b/packages/osmo-query/src/codegen/ibc/core/client/v1/tx.amino.ts index 1e8e1dca1..b299f61d0 100644 --- a/packages/osmo-query/src/codegen/ibc/core/client/v1/tx.amino.ts +++ b/packages/osmo-query/src/codegen/ibc/core/client/v1/tx.amino.ts @@ -1,5 +1,5 @@ //@ts-nocheck -import { MsgCreateClient, MsgUpdateClient, MsgUpgradeClient, MsgSubmitMisbehaviour } from "./tx"; +import { MsgCreateClient, MsgUpdateClient, MsgUpgradeClient, MsgSubmitMisbehaviour, MsgRecoverClient, MsgIBCSoftwareUpgrade, MsgUpdateParams } from "./tx"; export const AminoConverter = { "/ibc.core.client.v1.MsgCreateClient": { aminoType: "cosmos-sdk/MsgCreateClient", @@ -20,5 +20,20 @@ export const AminoConverter = { aminoType: "cosmos-sdk/MsgSubmitMisbehaviour", toAmino: MsgSubmitMisbehaviour.toAmino, fromAmino: MsgSubmitMisbehaviour.fromAmino + }, + "/ibc.core.client.v1.MsgRecoverClient": { + aminoType: "cosmos-sdk/MsgRecoverClient", + toAmino: MsgRecoverClient.toAmino, + fromAmino: MsgRecoverClient.fromAmino + }, + "/ibc.core.client.v1.MsgIBCSoftwareUpgrade": { + aminoType: "cosmos-sdk/MsgIBCSoftwareUpgrade", + toAmino: MsgIBCSoftwareUpgrade.toAmino, + fromAmino: MsgIBCSoftwareUpgrade.fromAmino + }, + "/ibc.core.client.v1.MsgUpdateParams": { + aminoType: "cosmos-sdk/MsgUpdateParams", + toAmino: MsgUpdateParams.toAmino, + fromAmino: MsgUpdateParams.fromAmino } }; \ No newline at end of file diff --git a/packages/osmo-query/src/codegen/ibc/core/client/v1/tx.registry.ts b/packages/osmo-query/src/codegen/ibc/core/client/v1/tx.registry.ts index fe83153f9..d2ef262dc 100644 --- a/packages/osmo-query/src/codegen/ibc/core/client/v1/tx.registry.ts +++ b/packages/osmo-query/src/codegen/ibc/core/client/v1/tx.registry.ts @@ -1,7 +1,7 @@ //@ts-nocheck import { GeneratedType, Registry } from "@cosmjs/proto-signing"; -import { MsgCreateClient, MsgUpdateClient, MsgUpgradeClient, MsgSubmitMisbehaviour } from "./tx"; -export const registry: ReadonlyArray<[string, GeneratedType]> = [["/ibc.core.client.v1.MsgCreateClient", MsgCreateClient], ["/ibc.core.client.v1.MsgUpdateClient", MsgUpdateClient], ["/ibc.core.client.v1.MsgUpgradeClient", MsgUpgradeClient], ["/ibc.core.client.v1.MsgSubmitMisbehaviour", MsgSubmitMisbehaviour]]; +import { MsgCreateClient, MsgUpdateClient, MsgUpgradeClient, MsgSubmitMisbehaviour, MsgRecoverClient, MsgIBCSoftwareUpgrade, MsgUpdateParams } from "./tx"; +export const registry: ReadonlyArray<[string, GeneratedType]> = [["/ibc.core.client.v1.MsgCreateClient", MsgCreateClient], ["/ibc.core.client.v1.MsgUpdateClient", MsgUpdateClient], ["/ibc.core.client.v1.MsgUpgradeClient", MsgUpgradeClient], ["/ibc.core.client.v1.MsgSubmitMisbehaviour", MsgSubmitMisbehaviour], ["/ibc.core.client.v1.MsgRecoverClient", MsgRecoverClient], ["/ibc.core.client.v1.MsgIBCSoftwareUpgrade", MsgIBCSoftwareUpgrade], ["/ibc.core.client.v1.MsgUpdateParams", MsgUpdateParams]]; export const load = (protoRegistry: Registry) => { registry.forEach(([typeUrl, mod]) => { protoRegistry.register(typeUrl, mod); @@ -32,6 +32,24 @@ export const MessageComposer = { typeUrl: "/ibc.core.client.v1.MsgSubmitMisbehaviour", value: MsgSubmitMisbehaviour.encode(value).finish() }; + }, + recoverClient(value: MsgRecoverClient) { + return { + typeUrl: "/ibc.core.client.v1.MsgRecoverClient", + value: MsgRecoverClient.encode(value).finish() + }; + }, + iBCSoftwareUpgrade(value: MsgIBCSoftwareUpgrade) { + return { + typeUrl: "/ibc.core.client.v1.MsgIBCSoftwareUpgrade", + value: MsgIBCSoftwareUpgrade.encode(value).finish() + }; + }, + updateClientParams(value: MsgUpdateParams) { + return { + typeUrl: "/ibc.core.client.v1.MsgUpdateParams", + value: MsgUpdateParams.encode(value).finish() + }; } }, withTypeUrl: { @@ -58,6 +76,24 @@ export const MessageComposer = { typeUrl: "/ibc.core.client.v1.MsgSubmitMisbehaviour", value }; + }, + recoverClient(value: MsgRecoverClient) { + return { + typeUrl: "/ibc.core.client.v1.MsgRecoverClient", + value + }; + }, + iBCSoftwareUpgrade(value: MsgIBCSoftwareUpgrade) { + return { + typeUrl: "/ibc.core.client.v1.MsgIBCSoftwareUpgrade", + value + }; + }, + updateClientParams(value: MsgUpdateParams) { + return { + typeUrl: "/ibc.core.client.v1.MsgUpdateParams", + value + }; } }, fromPartial: { @@ -84,6 +120,24 @@ export const MessageComposer = { typeUrl: "/ibc.core.client.v1.MsgSubmitMisbehaviour", value: MsgSubmitMisbehaviour.fromPartial(value) }; + }, + recoverClient(value: MsgRecoverClient) { + return { + typeUrl: "/ibc.core.client.v1.MsgRecoverClient", + value: MsgRecoverClient.fromPartial(value) + }; + }, + iBCSoftwareUpgrade(value: MsgIBCSoftwareUpgrade) { + return { + typeUrl: "/ibc.core.client.v1.MsgIBCSoftwareUpgrade", + value: MsgIBCSoftwareUpgrade.fromPartial(value) + }; + }, + updateClientParams(value: MsgUpdateParams) { + return { + typeUrl: "/ibc.core.client.v1.MsgUpdateParams", + value: MsgUpdateParams.fromPartial(value) + }; } } }; \ No newline at end of file diff --git a/packages/osmo-query/src/codegen/ibc/core/client/v1/tx.rpc.msg.ts b/packages/osmo-query/src/codegen/ibc/core/client/v1/tx.rpc.msg.ts index 29890ac80..2b884de04 100644 --- a/packages/osmo-query/src/codegen/ibc/core/client/v1/tx.rpc.msg.ts +++ b/packages/osmo-query/src/codegen/ibc/core/client/v1/tx.rpc.msg.ts @@ -1,6 +1,6 @@ import { Rpc } from "../../../../helpers"; import { BinaryReader } from "../../../../binary"; -import { MsgCreateClient, MsgCreateClientResponse, MsgUpdateClient, MsgUpdateClientResponse, MsgUpgradeClient, MsgUpgradeClientResponse, MsgSubmitMisbehaviour, MsgSubmitMisbehaviourResponse } from "./tx"; +import { MsgCreateClient, MsgCreateClientResponse, MsgUpdateClient, MsgUpdateClientResponse, MsgUpgradeClient, MsgUpgradeClientResponse, MsgSubmitMisbehaviour, MsgSubmitMisbehaviourResponse, MsgRecoverClient, MsgRecoverClientResponse, MsgIBCSoftwareUpgrade, MsgIBCSoftwareUpgradeResponse, MsgUpdateParams, MsgUpdateParamsResponse } from "./tx"; /** Msg defines the ibc/client Msg service. */ export interface Msg { /** CreateClient defines a rpc handler method for MsgCreateClient. */ @@ -11,6 +11,12 @@ export interface Msg { upgradeClient(request: MsgUpgradeClient): Promise; /** SubmitMisbehaviour defines a rpc handler method for MsgSubmitMisbehaviour. */ submitMisbehaviour(request: MsgSubmitMisbehaviour): Promise; + /** RecoverClient defines a rpc handler method for MsgRecoverClient. */ + recoverClient(request: MsgRecoverClient): Promise; + /** IBCSoftwareUpgrade defines a rpc handler method for MsgIBCSoftwareUpgrade. */ + iBCSoftwareUpgrade(request: MsgIBCSoftwareUpgrade): Promise; + /** UpdateClientParams defines a rpc handler method for MsgUpdateParams. */ + updateClientParams(request: MsgUpdateParams): Promise; } export class MsgClientImpl implements Msg { private readonly rpc: Rpc; @@ -20,6 +26,9 @@ export class MsgClientImpl implements Msg { this.updateClient = this.updateClient.bind(this); this.upgradeClient = this.upgradeClient.bind(this); this.submitMisbehaviour = this.submitMisbehaviour.bind(this); + this.recoverClient = this.recoverClient.bind(this); + this.iBCSoftwareUpgrade = this.iBCSoftwareUpgrade.bind(this); + this.updateClientParams = this.updateClientParams.bind(this); } createClient(request: MsgCreateClient): Promise { const data = MsgCreateClient.encode(request).finish(); @@ -41,4 +50,19 @@ export class MsgClientImpl implements Msg { const promise = this.rpc.request("ibc.core.client.v1.Msg", "SubmitMisbehaviour", data); return promise.then(data => MsgSubmitMisbehaviourResponse.decode(new BinaryReader(data))); } + recoverClient(request: MsgRecoverClient): Promise { + const data = MsgRecoverClient.encode(request).finish(); + const promise = this.rpc.request("ibc.core.client.v1.Msg", "RecoverClient", data); + return promise.then(data => MsgRecoverClientResponse.decode(new BinaryReader(data))); + } + iBCSoftwareUpgrade(request: MsgIBCSoftwareUpgrade): Promise { + const data = MsgIBCSoftwareUpgrade.encode(request).finish(); + const promise = this.rpc.request("ibc.core.client.v1.Msg", "IBCSoftwareUpgrade", data); + return promise.then(data => MsgIBCSoftwareUpgradeResponse.decode(new BinaryReader(data))); + } + updateClientParams(request: MsgUpdateParams): Promise { + const data = MsgUpdateParams.encode(request).finish(); + const promise = this.rpc.request("ibc.core.client.v1.Msg", "UpdateClientParams", data); + return promise.then(data => MsgUpdateParamsResponse.decode(new BinaryReader(data))); + } } \ No newline at end of file diff --git a/packages/osmo-query/src/codegen/ibc/core/client/v1/tx.ts b/packages/osmo-query/src/codegen/ibc/core/client/v1/tx.ts index 9560f7ed7..fad4579af 100644 --- a/packages/osmo-query/src/codegen/ibc/core/client/v1/tx.ts +++ b/packages/osmo-query/src/codegen/ibc/core/client/v1/tx.ts @@ -1,14 +1,17 @@ import { Any, AnyAmino, AnySDKType } from "../../../../google/protobuf/any"; +import { Plan, PlanAmino, PlanSDKType } from "../../../../cosmos/upgrade/v1beta1/upgrade"; +import { Params, ParamsAmino, ParamsSDKType } from "./client"; import { BinaryReader, BinaryWriter } from "../../../../binary"; +import { bytesFromBase64, base64FromBytes } from "../../../../helpers"; /** MsgCreateClient defines a message to create an IBC client */ export interface MsgCreateClient { /** light client state */ - clientState: Any; + clientState?: Any; /** * consensus state associated with the client that corresponds to a given * height. */ - consensusState: Any; + consensusState?: Any; /** signer address */ signer: string; } @@ -26,7 +29,7 @@ export interface MsgCreateClientAmino { */ consensus_state?: AnyAmino; /** signer address */ - signer: string; + signer?: string; } export interface MsgCreateClientAminoMsg { type: "cosmos-sdk/MsgCreateClient"; @@ -34,8 +37,8 @@ export interface MsgCreateClientAminoMsg { } /** MsgCreateClient defines a message to create an IBC client */ export interface MsgCreateClientSDKType { - client_state: AnySDKType; - consensus_state: AnySDKType; + client_state?: AnySDKType; + consensus_state?: AnySDKType; signer: string; } /** MsgCreateClientResponse defines the Msg/CreateClient response type. */ @@ -60,7 +63,7 @@ export interface MsgUpdateClient { /** client unique identifier */ clientId: string; /** client message to update the light client */ - clientMessage: Any; + clientMessage?: Any; /** signer address */ signer: string; } @@ -74,11 +77,11 @@ export interface MsgUpdateClientProtoMsg { */ export interface MsgUpdateClientAmino { /** client unique identifier */ - client_id: string; + client_id?: string; /** client message to update the light client */ client_message?: AnyAmino; /** signer address */ - signer: string; + signer?: string; } export interface MsgUpdateClientAminoMsg { type: "cosmos-sdk/MsgUpdateClient"; @@ -90,7 +93,7 @@ export interface MsgUpdateClientAminoMsg { */ export interface MsgUpdateClientSDKType { client_id: string; - client_message: AnySDKType; + client_message?: AnySDKType; signer: string; } /** MsgUpdateClientResponse defines the Msg/UpdateClient response type. */ @@ -115,12 +118,12 @@ export interface MsgUpgradeClient { /** client unique identifier */ clientId: string; /** upgraded client state */ - clientState: Any; + clientState?: Any; /** * upgraded consensus state, only contains enough information to serve as a * basis of trust in update logic */ - consensusState: Any; + consensusState?: Any; /** proof that old chain committed to new client */ proofUpgradeClient: Uint8Array; /** proof that old chain committed to new consensus state */ @@ -138,7 +141,7 @@ export interface MsgUpgradeClientProtoMsg { */ export interface MsgUpgradeClientAmino { /** client unique identifier */ - client_id: string; + client_id?: string; /** upgraded client state */ client_state?: AnyAmino; /** @@ -147,11 +150,11 @@ export interface MsgUpgradeClientAmino { */ consensus_state?: AnyAmino; /** proof that old chain committed to new client */ - proof_upgrade_client: Uint8Array; + proof_upgrade_client?: string; /** proof that old chain committed to new consensus state */ - proof_upgrade_consensus_state: Uint8Array; + proof_upgrade_consensus_state?: string; /** signer address */ - signer: string; + signer?: string; } export interface MsgUpgradeClientAminoMsg { type: "cosmos-sdk/MsgUpgradeClient"; @@ -163,8 +166,8 @@ export interface MsgUpgradeClientAminoMsg { */ export interface MsgUpgradeClientSDKType { client_id: string; - client_state: AnySDKType; - consensus_state: AnySDKType; + client_state?: AnySDKType; + consensus_state?: AnySDKType; proof_upgrade_client: Uint8Array; proof_upgrade_consensus_state: Uint8Array; signer: string; @@ -186,17 +189,15 @@ export interface MsgUpgradeClientResponseSDKType {} /** * MsgSubmitMisbehaviour defines an sdk.Msg type that submits Evidence for * light client misbehaviour. - * Warning: DEPRECATED + * This message has been deprecated. Use MsgUpdateClient instead. */ +/** @deprecated */ export interface MsgSubmitMisbehaviour { /** client unique identifier */ - /** @deprecated */ clientId: string; /** misbehaviour used for freezing the light client */ - /** @deprecated */ - misbehaviour: Any; + misbehaviour?: Any; /** signer address */ - /** @deprecated */ signer: string; } export interface MsgSubmitMisbehaviourProtoMsg { @@ -206,18 +207,16 @@ export interface MsgSubmitMisbehaviourProtoMsg { /** * MsgSubmitMisbehaviour defines an sdk.Msg type that submits Evidence for * light client misbehaviour. - * Warning: DEPRECATED + * This message has been deprecated. Use MsgUpdateClient instead. */ +/** @deprecated */ export interface MsgSubmitMisbehaviourAmino { /** client unique identifier */ - /** @deprecated */ - client_id: string; + client_id?: string; /** misbehaviour used for freezing the light client */ - /** @deprecated */ misbehaviour?: AnyAmino; /** signer address */ - /** @deprecated */ - signer: string; + signer?: string; } export interface MsgSubmitMisbehaviourAminoMsg { type: "cosmos-sdk/MsgSubmitMisbehaviour"; @@ -226,14 +225,12 @@ export interface MsgSubmitMisbehaviourAminoMsg { /** * MsgSubmitMisbehaviour defines an sdk.Msg type that submits Evidence for * light client misbehaviour. - * Warning: DEPRECATED + * This message has been deprecated. Use MsgUpdateClient instead. */ +/** @deprecated */ export interface MsgSubmitMisbehaviourSDKType { - /** @deprecated */ client_id: string; - /** @deprecated */ - misbehaviour: AnySDKType; - /** @deprecated */ + misbehaviour?: AnySDKType; signer: string; } /** @@ -259,10 +256,173 @@ export interface MsgSubmitMisbehaviourResponseAminoMsg { * type. */ export interface MsgSubmitMisbehaviourResponseSDKType {} +/** MsgRecoverClient defines the message used to recover a frozen or expired client. */ +export interface MsgRecoverClient { + /** the client identifier for the client to be updated if the proposal passes */ + subjectClientId: string; + /** + * the substitute client identifier for the client which will replace the subject + * client + */ + substituteClientId: string; + /** signer address */ + signer: string; +} +export interface MsgRecoverClientProtoMsg { + typeUrl: "/ibc.core.client.v1.MsgRecoverClient"; + value: Uint8Array; +} +/** MsgRecoverClient defines the message used to recover a frozen or expired client. */ +export interface MsgRecoverClientAmino { + /** the client identifier for the client to be updated if the proposal passes */ + subject_client_id?: string; + /** + * the substitute client identifier for the client which will replace the subject + * client + */ + substitute_client_id?: string; + /** signer address */ + signer?: string; +} +export interface MsgRecoverClientAminoMsg { + type: "cosmos-sdk/MsgRecoverClient"; + value: MsgRecoverClientAmino; +} +/** MsgRecoverClient defines the message used to recover a frozen or expired client. */ +export interface MsgRecoverClientSDKType { + subject_client_id: string; + substitute_client_id: string; + signer: string; +} +/** MsgRecoverClientResponse defines the Msg/RecoverClient response type. */ +export interface MsgRecoverClientResponse {} +export interface MsgRecoverClientResponseProtoMsg { + typeUrl: "/ibc.core.client.v1.MsgRecoverClientResponse"; + value: Uint8Array; +} +/** MsgRecoverClientResponse defines the Msg/RecoverClient response type. */ +export interface MsgRecoverClientResponseAmino {} +export interface MsgRecoverClientResponseAminoMsg { + type: "cosmos-sdk/MsgRecoverClientResponse"; + value: MsgRecoverClientResponseAmino; +} +/** MsgRecoverClientResponse defines the Msg/RecoverClient response type. */ +export interface MsgRecoverClientResponseSDKType {} +/** MsgIBCSoftwareUpgrade defines the message used to schedule an upgrade of an IBC client using a v1 governance proposal */ +export interface MsgIBCSoftwareUpgrade { + plan: Plan; + /** + * An UpgradedClientState must be provided to perform an IBC breaking upgrade. + * This will make the chain commit to the correct upgraded (self) client state + * before the upgrade occurs, so that connecting chains can verify that the + * new upgraded client is valid by verifying a proof on the previous version + * of the chain. This will allow IBC connections to persist smoothly across + * planned chain upgrades. Correspondingly, the UpgradedClientState field has been + * deprecated in the Cosmos SDK to allow for this logic to exist solely in + * the 02-client module. + */ + upgradedClientState?: Any; + /** signer address */ + signer: string; +} +export interface MsgIBCSoftwareUpgradeProtoMsg { + typeUrl: "/ibc.core.client.v1.MsgIBCSoftwareUpgrade"; + value: Uint8Array; +} +/** MsgIBCSoftwareUpgrade defines the message used to schedule an upgrade of an IBC client using a v1 governance proposal */ +export interface MsgIBCSoftwareUpgradeAmino { + plan?: PlanAmino; + /** + * An UpgradedClientState must be provided to perform an IBC breaking upgrade. + * This will make the chain commit to the correct upgraded (self) client state + * before the upgrade occurs, so that connecting chains can verify that the + * new upgraded client is valid by verifying a proof on the previous version + * of the chain. This will allow IBC connections to persist smoothly across + * planned chain upgrades. Correspondingly, the UpgradedClientState field has been + * deprecated in the Cosmos SDK to allow for this logic to exist solely in + * the 02-client module. + */ + upgraded_client_state?: AnyAmino; + /** signer address */ + signer?: string; +} +export interface MsgIBCSoftwareUpgradeAminoMsg { + type: "cosmos-sdk/MsgIBCSoftwareUpgrade"; + value: MsgIBCSoftwareUpgradeAmino; +} +/** MsgIBCSoftwareUpgrade defines the message used to schedule an upgrade of an IBC client using a v1 governance proposal */ +export interface MsgIBCSoftwareUpgradeSDKType { + plan: PlanSDKType; + upgraded_client_state?: AnySDKType; + signer: string; +} +/** MsgIBCSoftwareUpgradeResponse defines the Msg/IBCSoftwareUpgrade response type. */ +export interface MsgIBCSoftwareUpgradeResponse {} +export interface MsgIBCSoftwareUpgradeResponseProtoMsg { + typeUrl: "/ibc.core.client.v1.MsgIBCSoftwareUpgradeResponse"; + value: Uint8Array; +} +/** MsgIBCSoftwareUpgradeResponse defines the Msg/IBCSoftwareUpgrade response type. */ +export interface MsgIBCSoftwareUpgradeResponseAmino {} +export interface MsgIBCSoftwareUpgradeResponseAminoMsg { + type: "cosmos-sdk/MsgIBCSoftwareUpgradeResponse"; + value: MsgIBCSoftwareUpgradeResponseAmino; +} +/** MsgIBCSoftwareUpgradeResponse defines the Msg/IBCSoftwareUpgrade response type. */ +export interface MsgIBCSoftwareUpgradeResponseSDKType {} +/** MsgUpdateParams defines the sdk.Msg type to update the client parameters. */ +export interface MsgUpdateParams { + /** signer address */ + signer: string; + /** + * params defines the client parameters to update. + * + * NOTE: All parameters must be supplied. + */ + params: Params; +} +export interface MsgUpdateParamsProtoMsg { + typeUrl: "/ibc.core.client.v1.MsgUpdateParams"; + value: Uint8Array; +} +/** MsgUpdateParams defines the sdk.Msg type to update the client parameters. */ +export interface MsgUpdateParamsAmino { + /** signer address */ + signer?: string; + /** + * params defines the client parameters to update. + * + * NOTE: All parameters must be supplied. + */ + params?: ParamsAmino; +} +export interface MsgUpdateParamsAminoMsg { + type: "cosmos-sdk/MsgUpdateParams"; + value: MsgUpdateParamsAmino; +} +/** MsgUpdateParams defines the sdk.Msg type to update the client parameters. */ +export interface MsgUpdateParamsSDKType { + signer: string; + params: ParamsSDKType; +} +/** MsgUpdateParamsResponse defines the MsgUpdateParams response type. */ +export interface MsgUpdateParamsResponse {} +export interface MsgUpdateParamsResponseProtoMsg { + typeUrl: "/ibc.core.client.v1.MsgUpdateParamsResponse"; + value: Uint8Array; +} +/** MsgUpdateParamsResponse defines the MsgUpdateParams response type. */ +export interface MsgUpdateParamsResponseAmino {} +export interface MsgUpdateParamsResponseAminoMsg { + type: "cosmos-sdk/MsgUpdateParamsResponse"; + value: MsgUpdateParamsResponseAmino; +} +/** MsgUpdateParamsResponse defines the MsgUpdateParams response type. */ +export interface MsgUpdateParamsResponseSDKType {} function createBaseMsgCreateClient(): MsgCreateClient { return { - clientState: Any.fromPartial({}), - consensusState: Any.fromPartial({}), + clientState: undefined, + consensusState: undefined, signer: "" }; } @@ -311,11 +471,17 @@ export const MsgCreateClient = { return message; }, fromAmino(object: MsgCreateClientAmino): MsgCreateClient { - return { - clientState: object?.client_state ? Any.fromAmino(object.client_state) : undefined, - consensusState: object?.consensus_state ? Any.fromAmino(object.consensus_state) : undefined, - signer: object.signer - }; + const message = createBaseMsgCreateClient(); + if (object.client_state !== undefined && object.client_state !== null) { + message.clientState = Any.fromAmino(object.client_state); + } + if (object.consensus_state !== undefined && object.consensus_state !== null) { + message.consensusState = Any.fromAmino(object.consensus_state); + } + if (object.signer !== undefined && object.signer !== null) { + message.signer = object.signer; + } + return message; }, toAmino(message: MsgCreateClient): MsgCreateClientAmino { const obj: any = {}; @@ -373,7 +539,8 @@ export const MsgCreateClientResponse = { return message; }, fromAmino(_: MsgCreateClientResponseAmino): MsgCreateClientResponse { - return {}; + const message = createBaseMsgCreateClientResponse(); + return message; }, toAmino(_: MsgCreateClientResponse): MsgCreateClientResponseAmino { const obj: any = {}; @@ -404,7 +571,7 @@ export const MsgCreateClientResponse = { function createBaseMsgUpdateClient(): MsgUpdateClient { return { clientId: "", - clientMessage: Any.fromPartial({}), + clientMessage: undefined, signer: "" }; } @@ -453,11 +620,17 @@ export const MsgUpdateClient = { return message; }, fromAmino(object: MsgUpdateClientAmino): MsgUpdateClient { - return { - clientId: object.client_id, - clientMessage: object?.client_message ? Any.fromAmino(object.client_message) : undefined, - signer: object.signer - }; + const message = createBaseMsgUpdateClient(); + if (object.client_id !== undefined && object.client_id !== null) { + message.clientId = object.client_id; + } + if (object.client_message !== undefined && object.client_message !== null) { + message.clientMessage = Any.fromAmino(object.client_message); + } + if (object.signer !== undefined && object.signer !== null) { + message.signer = object.signer; + } + return message; }, toAmino(message: MsgUpdateClient): MsgUpdateClientAmino { const obj: any = {}; @@ -515,7 +688,8 @@ export const MsgUpdateClientResponse = { return message; }, fromAmino(_: MsgUpdateClientResponseAmino): MsgUpdateClientResponse { - return {}; + const message = createBaseMsgUpdateClientResponse(); + return message; }, toAmino(_: MsgUpdateClientResponse): MsgUpdateClientResponseAmino { const obj: any = {}; @@ -546,8 +720,8 @@ export const MsgUpdateClientResponse = { function createBaseMsgUpgradeClient(): MsgUpgradeClient { return { clientId: "", - clientState: Any.fromPartial({}), - consensusState: Any.fromPartial({}), + clientState: undefined, + consensusState: undefined, proofUpgradeClient: new Uint8Array(), proofUpgradeConsensusState: new Uint8Array(), signer: "" @@ -619,22 +793,34 @@ export const MsgUpgradeClient = { return message; }, fromAmino(object: MsgUpgradeClientAmino): MsgUpgradeClient { - return { - clientId: object.client_id, - clientState: object?.client_state ? Any.fromAmino(object.client_state) : undefined, - consensusState: object?.consensus_state ? Any.fromAmino(object.consensus_state) : undefined, - proofUpgradeClient: object.proof_upgrade_client, - proofUpgradeConsensusState: object.proof_upgrade_consensus_state, - signer: object.signer - }; + const message = createBaseMsgUpgradeClient(); + if (object.client_id !== undefined && object.client_id !== null) { + message.clientId = object.client_id; + } + if (object.client_state !== undefined && object.client_state !== null) { + message.clientState = Any.fromAmino(object.client_state); + } + if (object.consensus_state !== undefined && object.consensus_state !== null) { + message.consensusState = Any.fromAmino(object.consensus_state); + } + if (object.proof_upgrade_client !== undefined && object.proof_upgrade_client !== null) { + message.proofUpgradeClient = bytesFromBase64(object.proof_upgrade_client); + } + if (object.proof_upgrade_consensus_state !== undefined && object.proof_upgrade_consensus_state !== null) { + message.proofUpgradeConsensusState = bytesFromBase64(object.proof_upgrade_consensus_state); + } + if (object.signer !== undefined && object.signer !== null) { + message.signer = object.signer; + } + return message; }, toAmino(message: MsgUpgradeClient): MsgUpgradeClientAmino { const obj: any = {}; obj.client_id = message.clientId; obj.client_state = message.clientState ? Any.toAmino(message.clientState) : undefined; obj.consensus_state = message.consensusState ? Any.toAmino(message.consensusState) : undefined; - obj.proof_upgrade_client = message.proofUpgradeClient; - obj.proof_upgrade_consensus_state = message.proofUpgradeConsensusState; + obj.proof_upgrade_client = message.proofUpgradeClient ? base64FromBytes(message.proofUpgradeClient) : undefined; + obj.proof_upgrade_consensus_state = message.proofUpgradeConsensusState ? base64FromBytes(message.proofUpgradeConsensusState) : undefined; obj.signer = message.signer; return obj; }, @@ -687,7 +873,8 @@ export const MsgUpgradeClientResponse = { return message; }, fromAmino(_: MsgUpgradeClientResponseAmino): MsgUpgradeClientResponse { - return {}; + const message = createBaseMsgUpgradeClientResponse(); + return message; }, toAmino(_: MsgUpgradeClientResponse): MsgUpgradeClientResponseAmino { const obj: any = {}; @@ -718,7 +905,7 @@ export const MsgUpgradeClientResponse = { function createBaseMsgSubmitMisbehaviour(): MsgSubmitMisbehaviour { return { clientId: "", - misbehaviour: Any.fromPartial({}), + misbehaviour: undefined, signer: "" }; } @@ -767,11 +954,17 @@ export const MsgSubmitMisbehaviour = { return message; }, fromAmino(object: MsgSubmitMisbehaviourAmino): MsgSubmitMisbehaviour { - return { - clientId: object.client_id, - misbehaviour: object?.misbehaviour ? Any.fromAmino(object.misbehaviour) : undefined, - signer: object.signer - }; + const message = createBaseMsgSubmitMisbehaviour(); + if (object.client_id !== undefined && object.client_id !== null) { + message.clientId = object.client_id; + } + if (object.misbehaviour !== undefined && object.misbehaviour !== null) { + message.misbehaviour = Any.fromAmino(object.misbehaviour); + } + if (object.signer !== undefined && object.signer !== null) { + message.signer = object.signer; + } + return message; }, toAmino(message: MsgSubmitMisbehaviour): MsgSubmitMisbehaviourAmino { const obj: any = {}; @@ -829,7 +1022,8 @@ export const MsgSubmitMisbehaviourResponse = { return message; }, fromAmino(_: MsgSubmitMisbehaviourResponseAmino): MsgSubmitMisbehaviourResponse { - return {}; + const message = createBaseMsgSubmitMisbehaviourResponse(); + return message; }, toAmino(_: MsgSubmitMisbehaviourResponse): MsgSubmitMisbehaviourResponseAmino { const obj: any = {}; @@ -856,4 +1050,439 @@ export const MsgSubmitMisbehaviourResponse = { value: MsgSubmitMisbehaviourResponse.encode(message).finish() }; } +}; +function createBaseMsgRecoverClient(): MsgRecoverClient { + return { + subjectClientId: "", + substituteClientId: "", + signer: "" + }; +} +export const MsgRecoverClient = { + typeUrl: "/ibc.core.client.v1.MsgRecoverClient", + encode(message: MsgRecoverClient, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.subjectClientId !== "") { + writer.uint32(10).string(message.subjectClientId); + } + if (message.substituteClientId !== "") { + writer.uint32(18).string(message.substituteClientId); + } + if (message.signer !== "") { + writer.uint32(26).string(message.signer); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgRecoverClient { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgRecoverClient(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.subjectClientId = reader.string(); + break; + case 2: + message.substituteClientId = reader.string(); + break; + case 3: + message.signer = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgRecoverClient { + const message = createBaseMsgRecoverClient(); + message.subjectClientId = object.subjectClientId ?? ""; + message.substituteClientId = object.substituteClientId ?? ""; + message.signer = object.signer ?? ""; + return message; + }, + fromAmino(object: MsgRecoverClientAmino): MsgRecoverClient { + const message = createBaseMsgRecoverClient(); + if (object.subject_client_id !== undefined && object.subject_client_id !== null) { + message.subjectClientId = object.subject_client_id; + } + if (object.substitute_client_id !== undefined && object.substitute_client_id !== null) { + message.substituteClientId = object.substitute_client_id; + } + if (object.signer !== undefined && object.signer !== null) { + message.signer = object.signer; + } + return message; + }, + toAmino(message: MsgRecoverClient): MsgRecoverClientAmino { + const obj: any = {}; + obj.subject_client_id = message.subjectClientId; + obj.substitute_client_id = message.substituteClientId; + obj.signer = message.signer; + return obj; + }, + fromAminoMsg(object: MsgRecoverClientAminoMsg): MsgRecoverClient { + return MsgRecoverClient.fromAmino(object.value); + }, + toAminoMsg(message: MsgRecoverClient): MsgRecoverClientAminoMsg { + return { + type: "cosmos-sdk/MsgRecoverClient", + value: MsgRecoverClient.toAmino(message) + }; + }, + fromProtoMsg(message: MsgRecoverClientProtoMsg): MsgRecoverClient { + return MsgRecoverClient.decode(message.value); + }, + toProto(message: MsgRecoverClient): Uint8Array { + return MsgRecoverClient.encode(message).finish(); + }, + toProtoMsg(message: MsgRecoverClient): MsgRecoverClientProtoMsg { + return { + typeUrl: "/ibc.core.client.v1.MsgRecoverClient", + value: MsgRecoverClient.encode(message).finish() + }; + } +}; +function createBaseMsgRecoverClientResponse(): MsgRecoverClientResponse { + return {}; +} +export const MsgRecoverClientResponse = { + typeUrl: "/ibc.core.client.v1.MsgRecoverClientResponse", + encode(_: MsgRecoverClientResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgRecoverClientResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgRecoverClientResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): MsgRecoverClientResponse { + const message = createBaseMsgRecoverClientResponse(); + return message; + }, + fromAmino(_: MsgRecoverClientResponseAmino): MsgRecoverClientResponse { + const message = createBaseMsgRecoverClientResponse(); + return message; + }, + toAmino(_: MsgRecoverClientResponse): MsgRecoverClientResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgRecoverClientResponseAminoMsg): MsgRecoverClientResponse { + return MsgRecoverClientResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgRecoverClientResponse): MsgRecoverClientResponseAminoMsg { + return { + type: "cosmos-sdk/MsgRecoverClientResponse", + value: MsgRecoverClientResponse.toAmino(message) + }; + }, + fromProtoMsg(message: MsgRecoverClientResponseProtoMsg): MsgRecoverClientResponse { + return MsgRecoverClientResponse.decode(message.value); + }, + toProto(message: MsgRecoverClientResponse): Uint8Array { + return MsgRecoverClientResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgRecoverClientResponse): MsgRecoverClientResponseProtoMsg { + return { + typeUrl: "/ibc.core.client.v1.MsgRecoverClientResponse", + value: MsgRecoverClientResponse.encode(message).finish() + }; + } +}; +function createBaseMsgIBCSoftwareUpgrade(): MsgIBCSoftwareUpgrade { + return { + plan: Plan.fromPartial({}), + upgradedClientState: undefined, + signer: "" + }; +} +export const MsgIBCSoftwareUpgrade = { + typeUrl: "/ibc.core.client.v1.MsgIBCSoftwareUpgrade", + encode(message: MsgIBCSoftwareUpgrade, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.plan !== undefined) { + Plan.encode(message.plan, writer.uint32(10).fork()).ldelim(); + } + if (message.upgradedClientState !== undefined) { + Any.encode(message.upgradedClientState, writer.uint32(18).fork()).ldelim(); + } + if (message.signer !== "") { + writer.uint32(26).string(message.signer); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgIBCSoftwareUpgrade { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgIBCSoftwareUpgrade(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.plan = Plan.decode(reader, reader.uint32()); + break; + case 2: + message.upgradedClientState = Any.decode(reader, reader.uint32()); + break; + case 3: + message.signer = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgIBCSoftwareUpgrade { + const message = createBaseMsgIBCSoftwareUpgrade(); + message.plan = object.plan !== undefined && object.plan !== null ? Plan.fromPartial(object.plan) : undefined; + message.upgradedClientState = object.upgradedClientState !== undefined && object.upgradedClientState !== null ? Any.fromPartial(object.upgradedClientState) : undefined; + message.signer = object.signer ?? ""; + return message; + }, + fromAmino(object: MsgIBCSoftwareUpgradeAmino): MsgIBCSoftwareUpgrade { + const message = createBaseMsgIBCSoftwareUpgrade(); + if (object.plan !== undefined && object.plan !== null) { + message.plan = Plan.fromAmino(object.plan); + } + if (object.upgraded_client_state !== undefined && object.upgraded_client_state !== null) { + message.upgradedClientState = Any.fromAmino(object.upgraded_client_state); + } + if (object.signer !== undefined && object.signer !== null) { + message.signer = object.signer; + } + return message; + }, + toAmino(message: MsgIBCSoftwareUpgrade): MsgIBCSoftwareUpgradeAmino { + const obj: any = {}; + obj.plan = message.plan ? Plan.toAmino(message.plan) : undefined; + obj.upgraded_client_state = message.upgradedClientState ? Any.toAmino(message.upgradedClientState) : undefined; + obj.signer = message.signer; + return obj; + }, + fromAminoMsg(object: MsgIBCSoftwareUpgradeAminoMsg): MsgIBCSoftwareUpgrade { + return MsgIBCSoftwareUpgrade.fromAmino(object.value); + }, + toAminoMsg(message: MsgIBCSoftwareUpgrade): MsgIBCSoftwareUpgradeAminoMsg { + return { + type: "cosmos-sdk/MsgIBCSoftwareUpgrade", + value: MsgIBCSoftwareUpgrade.toAmino(message) + }; + }, + fromProtoMsg(message: MsgIBCSoftwareUpgradeProtoMsg): MsgIBCSoftwareUpgrade { + return MsgIBCSoftwareUpgrade.decode(message.value); + }, + toProto(message: MsgIBCSoftwareUpgrade): Uint8Array { + return MsgIBCSoftwareUpgrade.encode(message).finish(); + }, + toProtoMsg(message: MsgIBCSoftwareUpgrade): MsgIBCSoftwareUpgradeProtoMsg { + return { + typeUrl: "/ibc.core.client.v1.MsgIBCSoftwareUpgrade", + value: MsgIBCSoftwareUpgrade.encode(message).finish() + }; + } +}; +function createBaseMsgIBCSoftwareUpgradeResponse(): MsgIBCSoftwareUpgradeResponse { + return {}; +} +export const MsgIBCSoftwareUpgradeResponse = { + typeUrl: "/ibc.core.client.v1.MsgIBCSoftwareUpgradeResponse", + encode(_: MsgIBCSoftwareUpgradeResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgIBCSoftwareUpgradeResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgIBCSoftwareUpgradeResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): MsgIBCSoftwareUpgradeResponse { + const message = createBaseMsgIBCSoftwareUpgradeResponse(); + return message; + }, + fromAmino(_: MsgIBCSoftwareUpgradeResponseAmino): MsgIBCSoftwareUpgradeResponse { + const message = createBaseMsgIBCSoftwareUpgradeResponse(); + return message; + }, + toAmino(_: MsgIBCSoftwareUpgradeResponse): MsgIBCSoftwareUpgradeResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgIBCSoftwareUpgradeResponseAminoMsg): MsgIBCSoftwareUpgradeResponse { + return MsgIBCSoftwareUpgradeResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgIBCSoftwareUpgradeResponse): MsgIBCSoftwareUpgradeResponseAminoMsg { + return { + type: "cosmos-sdk/MsgIBCSoftwareUpgradeResponse", + value: MsgIBCSoftwareUpgradeResponse.toAmino(message) + }; + }, + fromProtoMsg(message: MsgIBCSoftwareUpgradeResponseProtoMsg): MsgIBCSoftwareUpgradeResponse { + return MsgIBCSoftwareUpgradeResponse.decode(message.value); + }, + toProto(message: MsgIBCSoftwareUpgradeResponse): Uint8Array { + return MsgIBCSoftwareUpgradeResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgIBCSoftwareUpgradeResponse): MsgIBCSoftwareUpgradeResponseProtoMsg { + return { + typeUrl: "/ibc.core.client.v1.MsgIBCSoftwareUpgradeResponse", + value: MsgIBCSoftwareUpgradeResponse.encode(message).finish() + }; + } +}; +function createBaseMsgUpdateParams(): MsgUpdateParams { + return { + signer: "", + params: Params.fromPartial({}) + }; +} +export const MsgUpdateParams = { + typeUrl: "/ibc.core.client.v1.MsgUpdateParams", + encode(message: MsgUpdateParams, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.signer !== "") { + writer.uint32(10).string(message.signer); + } + if (message.params !== undefined) { + Params.encode(message.params, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgUpdateParams { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUpdateParams(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.signer = reader.string(); + break; + case 2: + message.params = Params.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgUpdateParams { + const message = createBaseMsgUpdateParams(); + message.signer = object.signer ?? ""; + message.params = object.params !== undefined && object.params !== null ? Params.fromPartial(object.params) : undefined; + return message; + }, + fromAmino(object: MsgUpdateParamsAmino): MsgUpdateParams { + const message = createBaseMsgUpdateParams(); + if (object.signer !== undefined && object.signer !== null) { + message.signer = object.signer; + } + if (object.params !== undefined && object.params !== null) { + message.params = Params.fromAmino(object.params); + } + return message; + }, + toAmino(message: MsgUpdateParams): MsgUpdateParamsAmino { + const obj: any = {}; + obj.signer = message.signer; + obj.params = message.params ? Params.toAmino(message.params) : undefined; + return obj; + }, + fromAminoMsg(object: MsgUpdateParamsAminoMsg): MsgUpdateParams { + return MsgUpdateParams.fromAmino(object.value); + }, + toAminoMsg(message: MsgUpdateParams): MsgUpdateParamsAminoMsg { + return { + type: "cosmos-sdk/MsgUpdateParams", + value: MsgUpdateParams.toAmino(message) + }; + }, + fromProtoMsg(message: MsgUpdateParamsProtoMsg): MsgUpdateParams { + return MsgUpdateParams.decode(message.value); + }, + toProto(message: MsgUpdateParams): Uint8Array { + return MsgUpdateParams.encode(message).finish(); + }, + toProtoMsg(message: MsgUpdateParams): MsgUpdateParamsProtoMsg { + return { + typeUrl: "/ibc.core.client.v1.MsgUpdateParams", + value: MsgUpdateParams.encode(message).finish() + }; + } +}; +function createBaseMsgUpdateParamsResponse(): MsgUpdateParamsResponse { + return {}; +} +export const MsgUpdateParamsResponse = { + typeUrl: "/ibc.core.client.v1.MsgUpdateParamsResponse", + encode(_: MsgUpdateParamsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgUpdateParamsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUpdateParamsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): MsgUpdateParamsResponse { + const message = createBaseMsgUpdateParamsResponse(); + return message; + }, + fromAmino(_: MsgUpdateParamsResponseAmino): MsgUpdateParamsResponse { + const message = createBaseMsgUpdateParamsResponse(); + return message; + }, + toAmino(_: MsgUpdateParamsResponse): MsgUpdateParamsResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgUpdateParamsResponseAminoMsg): MsgUpdateParamsResponse { + return MsgUpdateParamsResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgUpdateParamsResponse): MsgUpdateParamsResponseAminoMsg { + return { + type: "cosmos-sdk/MsgUpdateParamsResponse", + value: MsgUpdateParamsResponse.toAmino(message) + }; + }, + fromProtoMsg(message: MsgUpdateParamsResponseProtoMsg): MsgUpdateParamsResponse { + return MsgUpdateParamsResponse.decode(message.value); + }, + toProto(message: MsgUpdateParamsResponse): Uint8Array { + return MsgUpdateParamsResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgUpdateParamsResponse): MsgUpdateParamsResponseProtoMsg { + return { + typeUrl: "/ibc.core.client.v1.MsgUpdateParamsResponse", + value: MsgUpdateParamsResponse.encode(message).finish() + }; + } }; \ No newline at end of file diff --git a/packages/osmo-query/src/codegen/ibc/core/commitment/v1/commitment.ts b/packages/osmo-query/src/codegen/ibc/core/commitment/v1/commitment.ts index 2d958d44e..c0a145c64 100644 --- a/packages/osmo-query/src/codegen/ibc/core/commitment/v1/commitment.ts +++ b/packages/osmo-query/src/codegen/ibc/core/commitment/v1/commitment.ts @@ -1,5 +1,6 @@ import { CommitmentProof, CommitmentProofAmino, CommitmentProofSDKType } from "../../../../cosmos/ics23/v1/proofs"; import { BinaryReader, BinaryWriter } from "../../../../binary"; +import { bytesFromBase64, base64FromBytes } from "../../../../helpers"; /** * MerkleRoot defines a merkle root hash. * In the Cosmos SDK, the AppHash of a block header becomes the root. @@ -16,7 +17,7 @@ export interface MerkleRootProtoMsg { * In the Cosmos SDK, the AppHash of a block header becomes the root. */ export interface MerkleRootAmino { - hash: Uint8Array; + hash?: string; } export interface MerkleRootAminoMsg { type: "cosmos-sdk/MerkleRoot"; @@ -47,7 +48,7 @@ export interface MerklePrefixProtoMsg { * append(Path.KeyPrefix, key...)) */ export interface MerklePrefixAmino { - key_prefix: Uint8Array; + key_prefix?: string; } export interface MerklePrefixAminoMsg { type: "cosmos-sdk/MerklePrefix"; @@ -79,7 +80,7 @@ export interface MerklePathProtoMsg { * MerklePath is represented from root-to-leaf */ export interface MerklePathAmino { - key_path: string[]; + key_path?: string[]; } export interface MerklePathAminoMsg { type: "cosmos-sdk/MerklePath"; @@ -115,7 +116,7 @@ export interface MerkleProofProtoMsg { * MerkleProofs are ordered from leaf-to-root */ export interface MerkleProofAmino { - proofs: CommitmentProofAmino[]; + proofs?: CommitmentProofAmino[]; } export interface MerkleProofAminoMsg { type: "cosmos-sdk/MerkleProof"; @@ -167,13 +168,15 @@ export const MerkleRoot = { return message; }, fromAmino(object: MerkleRootAmino): MerkleRoot { - return { - hash: object.hash - }; + const message = createBaseMerkleRoot(); + if (object.hash !== undefined && object.hash !== null) { + message.hash = bytesFromBase64(object.hash); + } + return message; }, toAmino(message: MerkleRoot): MerkleRootAmino { const obj: any = {}; - obj.hash = message.hash; + obj.hash = message.hash ? base64FromBytes(message.hash) : undefined; return obj; }, fromAminoMsg(object: MerkleRootAminoMsg): MerkleRoot { @@ -234,13 +237,15 @@ export const MerklePrefix = { return message; }, fromAmino(object: MerklePrefixAmino): MerklePrefix { - return { - keyPrefix: object.key_prefix - }; + const message = createBaseMerklePrefix(); + if (object.key_prefix !== undefined && object.key_prefix !== null) { + message.keyPrefix = bytesFromBase64(object.key_prefix); + } + return message; }, toAmino(message: MerklePrefix): MerklePrefixAmino { const obj: any = {}; - obj.key_prefix = message.keyPrefix; + obj.key_prefix = message.keyPrefix ? base64FromBytes(message.keyPrefix) : undefined; return obj; }, fromAminoMsg(object: MerklePrefixAminoMsg): MerklePrefix { @@ -301,9 +306,9 @@ export const MerklePath = { return message; }, fromAmino(object: MerklePathAmino): MerklePath { - return { - keyPath: Array.isArray(object?.key_path) ? object.key_path.map((e: any) => e) : [] - }; + const message = createBaseMerklePath(); + message.keyPath = object.key_path?.map(e => e) || []; + return message; }, toAmino(message: MerklePath): MerklePathAmino { const obj: any = {}; @@ -372,9 +377,9 @@ export const MerkleProof = { return message; }, fromAmino(object: MerkleProofAmino): MerkleProof { - return { - proofs: Array.isArray(object?.proofs) ? object.proofs.map((e: any) => CommitmentProof.fromAmino(e)) : [] - }; + const message = createBaseMerkleProof(); + message.proofs = object.proofs?.map(e => CommitmentProof.fromAmino(e)) || []; + return message; }, toAmino(message: MerkleProof): MerkleProofAmino { const obj: any = {}; diff --git a/packages/osmo-query/src/codegen/ibc/core/connection/v1/connection.ts b/packages/osmo-query/src/codegen/ibc/core/connection/v1/connection.ts index b156a0925..d007a0cf9 100644 --- a/packages/osmo-query/src/codegen/ibc/core/connection/v1/connection.ts +++ b/packages/osmo-query/src/codegen/ibc/core/connection/v1/connection.ts @@ -1,6 +1,5 @@ import { MerklePrefix, MerklePrefixAmino, MerklePrefixSDKType } from "../../commitment/v1/commitment"; import { BinaryReader, BinaryWriter } from "../../../../binary"; -import { isSet } from "../../../../helpers"; /** * State defines if a connection is in one of the following states: * INIT, TRYOPEN, OPEN or UNINITIALIZED. @@ -93,14 +92,14 @@ export interface ConnectionEndProtoMsg { */ export interface ConnectionEndAmino { /** client associated with this connection. */ - client_id: string; + client_id?: string; /** * IBC version which can be utilised to determine encodings or protocols for * channels or packets utilising this connection. */ - versions: VersionAmino[]; + versions?: VersionAmino[]; /** current state of the connection end. */ - state: State; + state?: State; /** counterparty chain associated with this connection. */ counterparty?: CounterpartyAmino; /** @@ -108,7 +107,7 @@ export interface ConnectionEndAmino { * packet-verification NOTE: delay period logic is only implemented by some * clients. */ - delay_period: string; + delay_period?: string; } export interface ConnectionEndAminoMsg { type: "cosmos-sdk/ConnectionEnd"; @@ -158,20 +157,20 @@ export interface IdentifiedConnectionProtoMsg { */ export interface IdentifiedConnectionAmino { /** connection identifier. */ - id: string; + id?: string; /** client associated with this connection. */ - client_id: string; + client_id?: string; /** * IBC version which can be utilised to determine encodings or protocols for * channels or packets utilising this connection */ - versions: VersionAmino[]; + versions?: VersionAmino[]; /** current state of the connection end. */ - state: State; + state?: State; /** counterparty chain associated with this connection. */ counterparty?: CounterpartyAmino; /** delay period associated with this connection. */ - delay_period: string; + delay_period?: string; } export interface IdentifiedConnectionAminoMsg { type: "cosmos-sdk/IdentifiedConnection"; @@ -214,12 +213,12 @@ export interface CounterpartyAmino { * identifies the client on the counterparty chain associated with a given * connection. */ - client_id: string; + client_id?: string; /** * identifies the connection end on the counterparty chain associated with a * given connection. */ - connection_id: string; + connection_id?: string; /** commitment merkle prefix of the counterparty chain. */ prefix?: MerklePrefixAmino; } @@ -245,7 +244,7 @@ export interface ClientPathsProtoMsg { /** ClientPaths define all the connection paths for a client state. */ export interface ClientPathsAmino { /** list of connection paths */ - paths: string[]; + paths?: string[]; } export interface ClientPathsAminoMsg { type: "cosmos-sdk/ClientPaths"; @@ -269,9 +268,9 @@ export interface ConnectionPathsProtoMsg { /** ConnectionPaths define all the connection paths for a given client state. */ export interface ConnectionPathsAmino { /** client state unique identifier */ - client_id: string; + client_id?: string; /** list of connection paths */ - paths: string[]; + paths?: string[]; } export interface ConnectionPathsAminoMsg { type: "cosmos-sdk/ConnectionPaths"; @@ -283,7 +282,7 @@ export interface ConnectionPathsSDKType { paths: string[]; } /** - * Version defines the versioning scheme used to negotiate the IBC verison in + * Version defines the versioning scheme used to negotiate the IBC version in * the connection handshake. */ export interface Version { @@ -297,21 +296,21 @@ export interface VersionProtoMsg { value: Uint8Array; } /** - * Version defines the versioning scheme used to negotiate the IBC verison in + * Version defines the versioning scheme used to negotiate the IBC version in * the connection handshake. */ export interface VersionAmino { /** unique version identifier */ - identifier: string; + identifier?: string; /** list of features compatible with the specified identifier */ - features: string[]; + features?: string[]; } export interface VersionAminoMsg { type: "cosmos-sdk/Version"; value: VersionAmino; } /** - * Version defines the versioning scheme used to negotiate the IBC verison in + * Version defines the versioning scheme used to negotiate the IBC version in * the connection handshake. */ export interface VersionSDKType { @@ -338,7 +337,7 @@ export interface ParamsAmino { * largest amount of time that the chain might reasonably take to produce the next block under normal operating * conditions. A safe choice is 3-5x the expected time per block. */ - max_expected_time_per_block: string; + max_expected_time_per_block?: string; } export interface ParamsAminoMsg { type: "cosmos-sdk/Params"; @@ -416,13 +415,21 @@ export const ConnectionEnd = { return message; }, fromAmino(object: ConnectionEndAmino): ConnectionEnd { - return { - clientId: object.client_id, - versions: Array.isArray(object?.versions) ? object.versions.map((e: any) => Version.fromAmino(e)) : [], - state: isSet(object.state) ? stateFromJSON(object.state) : -1, - counterparty: object?.counterparty ? Counterparty.fromAmino(object.counterparty) : undefined, - delayPeriod: BigInt(object.delay_period) - }; + const message = createBaseConnectionEnd(); + if (object.client_id !== undefined && object.client_id !== null) { + message.clientId = object.client_id; + } + message.versions = object.versions?.map(e => Version.fromAmino(e)) || []; + if (object.state !== undefined && object.state !== null) { + message.state = stateFromJSON(object.state); + } + if (object.counterparty !== undefined && object.counterparty !== null) { + message.counterparty = Counterparty.fromAmino(object.counterparty); + } + if (object.delay_period !== undefined && object.delay_period !== null) { + message.delayPeriod = BigInt(object.delay_period); + } + return message; }, toAmino(message: ConnectionEnd): ConnectionEndAmino { const obj: any = {}; @@ -432,7 +439,7 @@ export const ConnectionEnd = { } else { obj.versions = []; } - obj.state = message.state; + obj.state = stateToJSON(message.state); obj.counterparty = message.counterparty ? Counterparty.toAmino(message.counterparty) : undefined; obj.delay_period = message.delayPeriod ? message.delayPeriod.toString() : undefined; return obj; @@ -535,14 +542,24 @@ export const IdentifiedConnection = { return message; }, fromAmino(object: IdentifiedConnectionAmino): IdentifiedConnection { - return { - id: object.id, - clientId: object.client_id, - versions: Array.isArray(object?.versions) ? object.versions.map((e: any) => Version.fromAmino(e)) : [], - state: isSet(object.state) ? stateFromJSON(object.state) : -1, - counterparty: object?.counterparty ? Counterparty.fromAmino(object.counterparty) : undefined, - delayPeriod: BigInt(object.delay_period) - }; + const message = createBaseIdentifiedConnection(); + if (object.id !== undefined && object.id !== null) { + message.id = object.id; + } + if (object.client_id !== undefined && object.client_id !== null) { + message.clientId = object.client_id; + } + message.versions = object.versions?.map(e => Version.fromAmino(e)) || []; + if (object.state !== undefined && object.state !== null) { + message.state = stateFromJSON(object.state); + } + if (object.counterparty !== undefined && object.counterparty !== null) { + message.counterparty = Counterparty.fromAmino(object.counterparty); + } + if (object.delay_period !== undefined && object.delay_period !== null) { + message.delayPeriod = BigInt(object.delay_period); + } + return message; }, toAmino(message: IdentifiedConnection): IdentifiedConnectionAmino { const obj: any = {}; @@ -553,7 +570,7 @@ export const IdentifiedConnection = { } else { obj.versions = []; } - obj.state = message.state; + obj.state = stateToJSON(message.state); obj.counterparty = message.counterparty ? Counterparty.toAmino(message.counterparty) : undefined; obj.delay_period = message.delayPeriod ? message.delayPeriod.toString() : undefined; return obj; @@ -632,11 +649,17 @@ export const Counterparty = { return message; }, fromAmino(object: CounterpartyAmino): Counterparty { - return { - clientId: object.client_id, - connectionId: object.connection_id, - prefix: object?.prefix ? MerklePrefix.fromAmino(object.prefix) : undefined - }; + const message = createBaseCounterparty(); + if (object.client_id !== undefined && object.client_id !== null) { + message.clientId = object.client_id; + } + if (object.connection_id !== undefined && object.connection_id !== null) { + message.connectionId = object.connection_id; + } + if (object.prefix !== undefined && object.prefix !== null) { + message.prefix = MerklePrefix.fromAmino(object.prefix); + } + return message; }, toAmino(message: Counterparty): CounterpartyAmino { const obj: any = {}; @@ -703,9 +726,9 @@ export const ClientPaths = { return message; }, fromAmino(object: ClientPathsAmino): ClientPaths { - return { - paths: Array.isArray(object?.paths) ? object.paths.map((e: any) => e) : [] - }; + const message = createBaseClientPaths(); + message.paths = object.paths?.map(e => e) || []; + return message; }, toAmino(message: ClientPaths): ClientPathsAmino { const obj: any = {}; @@ -782,10 +805,12 @@ export const ConnectionPaths = { return message; }, fromAmino(object: ConnectionPathsAmino): ConnectionPaths { - return { - clientId: object.client_id, - paths: Array.isArray(object?.paths) ? object.paths.map((e: any) => e) : [] - }; + const message = createBaseConnectionPaths(); + if (object.client_id !== undefined && object.client_id !== null) { + message.clientId = object.client_id; + } + message.paths = object.paths?.map(e => e) || []; + return message; }, toAmino(message: ConnectionPaths): ConnectionPathsAmino { const obj: any = {}; @@ -863,10 +888,12 @@ export const Version = { return message; }, fromAmino(object: VersionAmino): Version { - return { - identifier: object.identifier, - features: Array.isArray(object?.features) ? object.features.map((e: any) => e) : [] - }; + const message = createBaseVersion(); + if (object.identifier !== undefined && object.identifier !== null) { + message.identifier = object.identifier; + } + message.features = object.features?.map(e => e) || []; + return message; }, toAmino(message: Version): VersionAmino { const obj: any = {}; @@ -936,9 +963,11 @@ export const Params = { return message; }, fromAmino(object: ParamsAmino): Params { - return { - maxExpectedTimePerBlock: BigInt(object.max_expected_time_per_block) - }; + const message = createBaseParams(); + if (object.max_expected_time_per_block !== undefined && object.max_expected_time_per_block !== null) { + message.maxExpectedTimePerBlock = BigInt(object.max_expected_time_per_block); + } + return message; }, toAmino(message: Params): ParamsAmino { const obj: any = {}; diff --git a/packages/osmo-query/src/codegen/ibc/core/connection/v1/genesis.ts b/packages/osmo-query/src/codegen/ibc/core/connection/v1/genesis.ts index eb6e911a3..4c5f20d09 100644 --- a/packages/osmo-query/src/codegen/ibc/core/connection/v1/genesis.ts +++ b/packages/osmo-query/src/codegen/ibc/core/connection/v1/genesis.ts @@ -14,10 +14,10 @@ export interface GenesisStateProtoMsg { } /** GenesisState defines the ibc connection submodule's genesis state. */ export interface GenesisStateAmino { - connections: IdentifiedConnectionAmino[]; - client_connection_paths: ConnectionPathsAmino[]; + connections?: IdentifiedConnectionAmino[]; + client_connection_paths?: ConnectionPathsAmino[]; /** the sequence for the next generated connection identifier */ - next_connection_sequence: string; + next_connection_sequence?: string; params?: ParamsAmino; } export interface GenesisStateAminoMsg { @@ -91,12 +91,16 @@ export const GenesisState = { return message; }, fromAmino(object: GenesisStateAmino): GenesisState { - return { - connections: Array.isArray(object?.connections) ? object.connections.map((e: any) => IdentifiedConnection.fromAmino(e)) : [], - clientConnectionPaths: Array.isArray(object?.client_connection_paths) ? object.client_connection_paths.map((e: any) => ConnectionPaths.fromAmino(e)) : [], - nextConnectionSequence: BigInt(object.next_connection_sequence), - params: object?.params ? Params.fromAmino(object.params) : undefined - }; + const message = createBaseGenesisState(); + message.connections = object.connections?.map(e => IdentifiedConnection.fromAmino(e)) || []; + message.clientConnectionPaths = object.client_connection_paths?.map(e => ConnectionPaths.fromAmino(e)) || []; + if (object.next_connection_sequence !== undefined && object.next_connection_sequence !== null) { + message.nextConnectionSequence = BigInt(object.next_connection_sequence); + } + if (object.params !== undefined && object.params !== null) { + message.params = Params.fromAmino(object.params); + } + return message; }, toAmino(message: GenesisState): GenesisStateAmino { const obj: any = {}; diff --git a/packages/osmo-query/src/codegen/ibc/core/connection/v1/query.ts b/packages/osmo-query/src/codegen/ibc/core/connection/v1/query.ts index 50042e399..38bb373d7 100644 --- a/packages/osmo-query/src/codegen/ibc/core/connection/v1/query.ts +++ b/packages/osmo-query/src/codegen/ibc/core/connection/v1/query.ts @@ -3,6 +3,7 @@ import { ConnectionEnd, ConnectionEndAmino, ConnectionEndSDKType, IdentifiedConn import { Height, HeightAmino, HeightSDKType, IdentifiedClientState, IdentifiedClientStateAmino, IdentifiedClientStateSDKType, Params, ParamsAmino, ParamsSDKType } from "../../client/v1/client"; import { Any, AnyAmino, AnySDKType } from "../../../../google/protobuf/any"; import { BinaryReader, BinaryWriter } from "../../../../binary"; +import { bytesFromBase64, base64FromBytes } from "../../../../helpers"; /** * QueryConnectionRequest is the request type for the Query/Connection RPC * method @@ -21,7 +22,7 @@ export interface QueryConnectionRequestProtoMsg { */ export interface QueryConnectionRequestAmino { /** connection unique identifier */ - connection_id: string; + connection_id?: string; } export interface QueryConnectionRequestAminoMsg { type: "cosmos-sdk/QueryConnectionRequest"; @@ -41,7 +42,7 @@ export interface QueryConnectionRequestSDKType { */ export interface QueryConnectionResponse { /** connection associated with the request identifier */ - connection: ConnectionEnd; + connection?: ConnectionEnd; /** merkle proof of existence */ proof: Uint8Array; /** height at which the proof was retrieved */ @@ -60,7 +61,7 @@ export interface QueryConnectionResponseAmino { /** connection associated with the request identifier */ connection?: ConnectionEndAmino; /** merkle proof of existence */ - proof: Uint8Array; + proof?: string; /** height at which the proof was retrieved */ proof_height?: HeightAmino; } @@ -74,7 +75,7 @@ export interface QueryConnectionResponseAminoMsg { * which the proof was retrieved. */ export interface QueryConnectionResponseSDKType { - connection: ConnectionEndSDKType; + connection?: ConnectionEndSDKType; proof: Uint8Array; proof_height: HeightSDKType; } @@ -83,7 +84,7 @@ export interface QueryConnectionResponseSDKType { * method */ export interface QueryConnectionsRequest { - pagination: PageRequest; + pagination?: PageRequest; } export interface QueryConnectionsRequestProtoMsg { typeUrl: "/ibc.core.connection.v1.QueryConnectionsRequest"; @@ -105,7 +106,7 @@ export interface QueryConnectionsRequestAminoMsg { * method */ export interface QueryConnectionsRequestSDKType { - pagination: PageRequestSDKType; + pagination?: PageRequestSDKType; } /** * QueryConnectionsResponse is the response type for the Query/Connections RPC @@ -115,7 +116,7 @@ export interface QueryConnectionsResponse { /** list of stored connections of the chain. */ connections: IdentifiedConnection[]; /** pagination response */ - pagination: PageResponse; + pagination?: PageResponse; /** query block height */ height: Height; } @@ -129,7 +130,7 @@ export interface QueryConnectionsResponseProtoMsg { */ export interface QueryConnectionsResponseAmino { /** list of stored connections of the chain. */ - connections: IdentifiedConnectionAmino[]; + connections?: IdentifiedConnectionAmino[]; /** pagination response */ pagination?: PageResponseAmino; /** query block height */ @@ -145,7 +146,7 @@ export interface QueryConnectionsResponseAminoMsg { */ export interface QueryConnectionsResponseSDKType { connections: IdentifiedConnectionSDKType[]; - pagination: PageResponseSDKType; + pagination?: PageResponseSDKType; height: HeightSDKType; } /** @@ -166,7 +167,7 @@ export interface QueryClientConnectionsRequestProtoMsg { */ export interface QueryClientConnectionsRequestAmino { /** client identifier associated with a connection */ - client_id: string; + client_id?: string; } export interface QueryClientConnectionsRequestAminoMsg { type: "cosmos-sdk/QueryClientConnectionsRequest"; @@ -201,9 +202,9 @@ export interface QueryClientConnectionsResponseProtoMsg { */ export interface QueryClientConnectionsResponseAmino { /** slice of all the connection paths associated with a client. */ - connection_paths: string[]; + connection_paths?: string[]; /** merkle proof of existence */ - proof: Uint8Array; + proof?: string; /** height at which the proof was generated */ proof_height?: HeightAmino; } @@ -238,7 +239,7 @@ export interface QueryConnectionClientStateRequestProtoMsg { */ export interface QueryConnectionClientStateRequestAmino { /** connection identifier */ - connection_id: string; + connection_id?: string; } export interface QueryConnectionClientStateRequestAminoMsg { type: "cosmos-sdk/QueryConnectionClientStateRequest"; @@ -257,7 +258,7 @@ export interface QueryConnectionClientStateRequestSDKType { */ export interface QueryConnectionClientStateResponse { /** client state associated with the channel */ - identifiedClientState: IdentifiedClientState; + identifiedClientState?: IdentifiedClientState; /** merkle proof of existence */ proof: Uint8Array; /** height at which the proof was retrieved */ @@ -275,7 +276,7 @@ export interface QueryConnectionClientStateResponseAmino { /** client state associated with the channel */ identified_client_state?: IdentifiedClientStateAmino; /** merkle proof of existence */ - proof: Uint8Array; + proof?: string; /** height at which the proof was retrieved */ proof_height?: HeightAmino; } @@ -288,7 +289,7 @@ export interface QueryConnectionClientStateResponseAminoMsg { * Query/ConnectionClientState RPC method */ export interface QueryConnectionClientStateResponseSDKType { - identified_client_state: IdentifiedClientStateSDKType; + identified_client_state?: IdentifiedClientStateSDKType; proof: Uint8Array; proof_height: HeightSDKType; } @@ -312,9 +313,9 @@ export interface QueryConnectionConsensusStateRequestProtoMsg { */ export interface QueryConnectionConsensusStateRequestAmino { /** connection identifier */ - connection_id: string; - revision_number: string; - revision_height: string; + connection_id?: string; + revision_number?: string; + revision_height?: string; } export interface QueryConnectionConsensusStateRequestAminoMsg { type: "cosmos-sdk/QueryConnectionConsensusStateRequest"; @@ -335,7 +336,7 @@ export interface QueryConnectionConsensusStateRequestSDKType { */ export interface QueryConnectionConsensusStateResponse { /** consensus state associated with the channel */ - consensusState: Any; + consensusState?: Any; /** client ID associated with the consensus state */ clientId: string; /** merkle proof of existence */ @@ -355,9 +356,9 @@ export interface QueryConnectionConsensusStateResponseAmino { /** consensus state associated with the channel */ consensus_state?: AnyAmino; /** client ID associated with the consensus state */ - client_id: string; + client_id?: string; /** merkle proof of existence */ - proof: Uint8Array; + proof?: string; /** height at which the proof was retrieved */ proof_height?: HeightAmino; } @@ -370,7 +371,7 @@ export interface QueryConnectionConsensusStateResponseAminoMsg { * Query/ConnectionConsensusState RPC method */ export interface QueryConnectionConsensusStateResponseSDKType { - consensus_state: AnySDKType; + consensus_state?: AnySDKType; client_id: string; proof: Uint8Array; proof_height: HeightSDKType; @@ -392,7 +393,7 @@ export interface QueryConnectionParamsRequestSDKType {} /** QueryConnectionParamsResponse is the response type for the Query/ConnectionParams RPC method. */ export interface QueryConnectionParamsResponse { /** params defines the parameters of the module. */ - params: Params; + params?: Params; } export interface QueryConnectionParamsResponseProtoMsg { typeUrl: "/ibc.core.connection.v1.QueryConnectionParamsResponse"; @@ -409,7 +410,7 @@ export interface QueryConnectionParamsResponseAminoMsg { } /** QueryConnectionParamsResponse is the response type for the Query/ConnectionParams RPC method. */ export interface QueryConnectionParamsResponseSDKType { - params: ParamsSDKType; + params?: ParamsSDKType; } function createBaseQueryConnectionRequest(): QueryConnectionRequest { return { @@ -447,9 +448,11 @@ export const QueryConnectionRequest = { return message; }, fromAmino(object: QueryConnectionRequestAmino): QueryConnectionRequest { - return { - connectionId: object.connection_id - }; + const message = createBaseQueryConnectionRequest(); + if (object.connection_id !== undefined && object.connection_id !== null) { + message.connectionId = object.connection_id; + } + return message; }, toAmino(message: QueryConnectionRequest): QueryConnectionRequestAmino { const obj: any = {}; @@ -480,7 +483,7 @@ export const QueryConnectionRequest = { }; function createBaseQueryConnectionResponse(): QueryConnectionResponse { return { - connection: ConnectionEnd.fromPartial({}), + connection: undefined, proof: new Uint8Array(), proofHeight: Height.fromPartial({}) }; @@ -530,16 +533,22 @@ export const QueryConnectionResponse = { return message; }, fromAmino(object: QueryConnectionResponseAmino): QueryConnectionResponse { - return { - connection: object?.connection ? ConnectionEnd.fromAmino(object.connection) : undefined, - proof: object.proof, - proofHeight: object?.proof_height ? Height.fromAmino(object.proof_height) : undefined - }; + const message = createBaseQueryConnectionResponse(); + if (object.connection !== undefined && object.connection !== null) { + message.connection = ConnectionEnd.fromAmino(object.connection); + } + if (object.proof !== undefined && object.proof !== null) { + message.proof = bytesFromBase64(object.proof); + } + if (object.proof_height !== undefined && object.proof_height !== null) { + message.proofHeight = Height.fromAmino(object.proof_height); + } + return message; }, toAmino(message: QueryConnectionResponse): QueryConnectionResponseAmino { const obj: any = {}; obj.connection = message.connection ? ConnectionEnd.toAmino(message.connection) : undefined; - obj.proof = message.proof; + obj.proof = message.proof ? base64FromBytes(message.proof) : undefined; obj.proof_height = message.proofHeight ? Height.toAmino(message.proofHeight) : {}; return obj; }, @@ -567,7 +576,7 @@ export const QueryConnectionResponse = { }; function createBaseQueryConnectionsRequest(): QueryConnectionsRequest { return { - pagination: PageRequest.fromPartial({}) + pagination: undefined }; } export const QueryConnectionsRequest = { @@ -601,9 +610,11 @@ export const QueryConnectionsRequest = { return message; }, fromAmino(object: QueryConnectionsRequestAmino): QueryConnectionsRequest { - return { - pagination: object?.pagination ? PageRequest.fromAmino(object.pagination) : undefined - }; + const message = createBaseQueryConnectionsRequest(); + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromAmino(object.pagination); + } + return message; }, toAmino(message: QueryConnectionsRequest): QueryConnectionsRequestAmino { const obj: any = {}; @@ -635,7 +646,7 @@ export const QueryConnectionsRequest = { function createBaseQueryConnectionsResponse(): QueryConnectionsResponse { return { connections: [], - pagination: PageResponse.fromPartial({}), + pagination: undefined, height: Height.fromPartial({}) }; } @@ -684,11 +695,15 @@ export const QueryConnectionsResponse = { return message; }, fromAmino(object: QueryConnectionsResponseAmino): QueryConnectionsResponse { - return { - connections: Array.isArray(object?.connections) ? object.connections.map((e: any) => IdentifiedConnection.fromAmino(e)) : [], - pagination: object?.pagination ? PageResponse.fromAmino(object.pagination) : undefined, - height: object?.height ? Height.fromAmino(object.height) : undefined - }; + const message = createBaseQueryConnectionsResponse(); + message.connections = object.connections?.map(e => IdentifiedConnection.fromAmino(e)) || []; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromAmino(object.pagination); + } + if (object.height !== undefined && object.height !== null) { + message.height = Height.fromAmino(object.height); + } + return message; }, toAmino(message: QueryConnectionsResponse): QueryConnectionsResponseAmino { const obj: any = {}; @@ -759,9 +774,11 @@ export const QueryClientConnectionsRequest = { return message; }, fromAmino(object: QueryClientConnectionsRequestAmino): QueryClientConnectionsRequest { - return { - clientId: object.client_id - }; + const message = createBaseQueryClientConnectionsRequest(); + if (object.client_id !== undefined && object.client_id !== null) { + message.clientId = object.client_id; + } + return message; }, toAmino(message: QueryClientConnectionsRequest): QueryClientConnectionsRequestAmino { const obj: any = {}; @@ -842,11 +859,15 @@ export const QueryClientConnectionsResponse = { return message; }, fromAmino(object: QueryClientConnectionsResponseAmino): QueryClientConnectionsResponse { - return { - connectionPaths: Array.isArray(object?.connection_paths) ? object.connection_paths.map((e: any) => e) : [], - proof: object.proof, - proofHeight: object?.proof_height ? Height.fromAmino(object.proof_height) : undefined - }; + const message = createBaseQueryClientConnectionsResponse(); + message.connectionPaths = object.connection_paths?.map(e => e) || []; + if (object.proof !== undefined && object.proof !== null) { + message.proof = bytesFromBase64(object.proof); + } + if (object.proof_height !== undefined && object.proof_height !== null) { + message.proofHeight = Height.fromAmino(object.proof_height); + } + return message; }, toAmino(message: QueryClientConnectionsResponse): QueryClientConnectionsResponseAmino { const obj: any = {}; @@ -855,7 +876,7 @@ export const QueryClientConnectionsResponse = { } else { obj.connection_paths = []; } - obj.proof = message.proof; + obj.proof = message.proof ? base64FromBytes(message.proof) : undefined; obj.proof_height = message.proofHeight ? Height.toAmino(message.proofHeight) : {}; return obj; }, @@ -917,9 +938,11 @@ export const QueryConnectionClientStateRequest = { return message; }, fromAmino(object: QueryConnectionClientStateRequestAmino): QueryConnectionClientStateRequest { - return { - connectionId: object.connection_id - }; + const message = createBaseQueryConnectionClientStateRequest(); + if (object.connection_id !== undefined && object.connection_id !== null) { + message.connectionId = object.connection_id; + } + return message; }, toAmino(message: QueryConnectionClientStateRequest): QueryConnectionClientStateRequestAmino { const obj: any = {}; @@ -950,7 +973,7 @@ export const QueryConnectionClientStateRequest = { }; function createBaseQueryConnectionClientStateResponse(): QueryConnectionClientStateResponse { return { - identifiedClientState: IdentifiedClientState.fromPartial({}), + identifiedClientState: undefined, proof: new Uint8Array(), proofHeight: Height.fromPartial({}) }; @@ -1000,16 +1023,22 @@ export const QueryConnectionClientStateResponse = { return message; }, fromAmino(object: QueryConnectionClientStateResponseAmino): QueryConnectionClientStateResponse { - return { - identifiedClientState: object?.identified_client_state ? IdentifiedClientState.fromAmino(object.identified_client_state) : undefined, - proof: object.proof, - proofHeight: object?.proof_height ? Height.fromAmino(object.proof_height) : undefined - }; + const message = createBaseQueryConnectionClientStateResponse(); + if (object.identified_client_state !== undefined && object.identified_client_state !== null) { + message.identifiedClientState = IdentifiedClientState.fromAmino(object.identified_client_state); + } + if (object.proof !== undefined && object.proof !== null) { + message.proof = bytesFromBase64(object.proof); + } + if (object.proof_height !== undefined && object.proof_height !== null) { + message.proofHeight = Height.fromAmino(object.proof_height); + } + return message; }, toAmino(message: QueryConnectionClientStateResponse): QueryConnectionClientStateResponseAmino { const obj: any = {}; obj.identified_client_state = message.identifiedClientState ? IdentifiedClientState.toAmino(message.identifiedClientState) : undefined; - obj.proof = message.proof; + obj.proof = message.proof ? base64FromBytes(message.proof) : undefined; obj.proof_height = message.proofHeight ? Height.toAmino(message.proofHeight) : {}; return obj; }, @@ -1087,11 +1116,17 @@ export const QueryConnectionConsensusStateRequest = { return message; }, fromAmino(object: QueryConnectionConsensusStateRequestAmino): QueryConnectionConsensusStateRequest { - return { - connectionId: object.connection_id, - revisionNumber: BigInt(object.revision_number), - revisionHeight: BigInt(object.revision_height) - }; + const message = createBaseQueryConnectionConsensusStateRequest(); + if (object.connection_id !== undefined && object.connection_id !== null) { + message.connectionId = object.connection_id; + } + if (object.revision_number !== undefined && object.revision_number !== null) { + message.revisionNumber = BigInt(object.revision_number); + } + if (object.revision_height !== undefined && object.revision_height !== null) { + message.revisionHeight = BigInt(object.revision_height); + } + return message; }, toAmino(message: QueryConnectionConsensusStateRequest): QueryConnectionConsensusStateRequestAmino { const obj: any = {}; @@ -1124,7 +1159,7 @@ export const QueryConnectionConsensusStateRequest = { }; function createBaseQueryConnectionConsensusStateResponse(): QueryConnectionConsensusStateResponse { return { - consensusState: Any.fromPartial({}), + consensusState: undefined, clientId: "", proof: new Uint8Array(), proofHeight: Height.fromPartial({}) @@ -1182,18 +1217,26 @@ export const QueryConnectionConsensusStateResponse = { return message; }, fromAmino(object: QueryConnectionConsensusStateResponseAmino): QueryConnectionConsensusStateResponse { - return { - consensusState: object?.consensus_state ? Any.fromAmino(object.consensus_state) : undefined, - clientId: object.client_id, - proof: object.proof, - proofHeight: object?.proof_height ? Height.fromAmino(object.proof_height) : undefined - }; + const message = createBaseQueryConnectionConsensusStateResponse(); + if (object.consensus_state !== undefined && object.consensus_state !== null) { + message.consensusState = Any.fromAmino(object.consensus_state); + } + if (object.client_id !== undefined && object.client_id !== null) { + message.clientId = object.client_id; + } + if (object.proof !== undefined && object.proof !== null) { + message.proof = bytesFromBase64(object.proof); + } + if (object.proof_height !== undefined && object.proof_height !== null) { + message.proofHeight = Height.fromAmino(object.proof_height); + } + return message; }, toAmino(message: QueryConnectionConsensusStateResponse): QueryConnectionConsensusStateResponseAmino { const obj: any = {}; obj.consensus_state = message.consensusState ? Any.toAmino(message.consensusState) : undefined; obj.client_id = message.clientId; - obj.proof = message.proof; + obj.proof = message.proof ? base64FromBytes(message.proof) : undefined; obj.proof_height = message.proofHeight ? Height.toAmino(message.proofHeight) : {}; return obj; }, @@ -1246,7 +1289,8 @@ export const QueryConnectionParamsRequest = { return message; }, fromAmino(_: QueryConnectionParamsRequestAmino): QueryConnectionParamsRequest { - return {}; + const message = createBaseQueryConnectionParamsRequest(); + return message; }, toAmino(_: QueryConnectionParamsRequest): QueryConnectionParamsRequestAmino { const obj: any = {}; @@ -1276,7 +1320,7 @@ export const QueryConnectionParamsRequest = { }; function createBaseQueryConnectionParamsResponse(): QueryConnectionParamsResponse { return { - params: Params.fromPartial({}) + params: undefined }; } export const QueryConnectionParamsResponse = { @@ -1310,9 +1354,11 @@ export const QueryConnectionParamsResponse = { return message; }, fromAmino(object: QueryConnectionParamsResponseAmino): QueryConnectionParamsResponse { - return { - params: object?.params ? Params.fromAmino(object.params) : undefined - }; + const message = createBaseQueryConnectionParamsResponse(); + if (object.params !== undefined && object.params !== null) { + message.params = Params.fromAmino(object.params); + } + return message; }, toAmino(message: QueryConnectionParamsResponse): QueryConnectionParamsResponseAmino { const obj: any = {}; diff --git a/packages/osmo-query/src/codegen/ibc/core/connection/v1/tx.amino.ts b/packages/osmo-query/src/codegen/ibc/core/connection/v1/tx.amino.ts index d30beafa3..ecfa448ce 100644 --- a/packages/osmo-query/src/codegen/ibc/core/connection/v1/tx.amino.ts +++ b/packages/osmo-query/src/codegen/ibc/core/connection/v1/tx.amino.ts @@ -1,5 +1,5 @@ //@ts-nocheck -import { MsgConnectionOpenInit, MsgConnectionOpenTry, MsgConnectionOpenAck, MsgConnectionOpenConfirm } from "./tx"; +import { MsgConnectionOpenInit, MsgConnectionOpenTry, MsgConnectionOpenAck, MsgConnectionOpenConfirm, MsgUpdateParams } from "./tx"; export const AminoConverter = { "/ibc.core.connection.v1.MsgConnectionOpenInit": { aminoType: "cosmos-sdk/MsgConnectionOpenInit", @@ -20,5 +20,10 @@ export const AminoConverter = { aminoType: "cosmos-sdk/MsgConnectionOpenConfirm", toAmino: MsgConnectionOpenConfirm.toAmino, fromAmino: MsgConnectionOpenConfirm.fromAmino + }, + "/ibc.core.connection.v1.MsgUpdateParams": { + aminoType: "cosmos-sdk/MsgUpdateParams", + toAmino: MsgUpdateParams.toAmino, + fromAmino: MsgUpdateParams.fromAmino } }; \ No newline at end of file diff --git a/packages/osmo-query/src/codegen/ibc/core/connection/v1/tx.registry.ts b/packages/osmo-query/src/codegen/ibc/core/connection/v1/tx.registry.ts index ea9df730a..29451ea3d 100644 --- a/packages/osmo-query/src/codegen/ibc/core/connection/v1/tx.registry.ts +++ b/packages/osmo-query/src/codegen/ibc/core/connection/v1/tx.registry.ts @@ -1,7 +1,7 @@ //@ts-nocheck import { GeneratedType, Registry } from "@cosmjs/proto-signing"; -import { MsgConnectionOpenInit, MsgConnectionOpenTry, MsgConnectionOpenAck, MsgConnectionOpenConfirm } from "./tx"; -export const registry: ReadonlyArray<[string, GeneratedType]> = [["/ibc.core.connection.v1.MsgConnectionOpenInit", MsgConnectionOpenInit], ["/ibc.core.connection.v1.MsgConnectionOpenTry", MsgConnectionOpenTry], ["/ibc.core.connection.v1.MsgConnectionOpenAck", MsgConnectionOpenAck], ["/ibc.core.connection.v1.MsgConnectionOpenConfirm", MsgConnectionOpenConfirm]]; +import { MsgConnectionOpenInit, MsgConnectionOpenTry, MsgConnectionOpenAck, MsgConnectionOpenConfirm, MsgUpdateParams } from "./tx"; +export const registry: ReadonlyArray<[string, GeneratedType]> = [["/ibc.core.connection.v1.MsgConnectionOpenInit", MsgConnectionOpenInit], ["/ibc.core.connection.v1.MsgConnectionOpenTry", MsgConnectionOpenTry], ["/ibc.core.connection.v1.MsgConnectionOpenAck", MsgConnectionOpenAck], ["/ibc.core.connection.v1.MsgConnectionOpenConfirm", MsgConnectionOpenConfirm], ["/ibc.core.connection.v1.MsgUpdateParams", MsgUpdateParams]]; export const load = (protoRegistry: Registry) => { registry.forEach(([typeUrl, mod]) => { protoRegistry.register(typeUrl, mod); @@ -32,6 +32,12 @@ export const MessageComposer = { typeUrl: "/ibc.core.connection.v1.MsgConnectionOpenConfirm", value: MsgConnectionOpenConfirm.encode(value).finish() }; + }, + updateConnectionParams(value: MsgUpdateParams) { + return { + typeUrl: "/ibc.core.connection.v1.MsgUpdateParams", + value: MsgUpdateParams.encode(value).finish() + }; } }, withTypeUrl: { @@ -58,6 +64,12 @@ export const MessageComposer = { typeUrl: "/ibc.core.connection.v1.MsgConnectionOpenConfirm", value }; + }, + updateConnectionParams(value: MsgUpdateParams) { + return { + typeUrl: "/ibc.core.connection.v1.MsgUpdateParams", + value + }; } }, fromPartial: { @@ -84,6 +96,12 @@ export const MessageComposer = { typeUrl: "/ibc.core.connection.v1.MsgConnectionOpenConfirm", value: MsgConnectionOpenConfirm.fromPartial(value) }; + }, + updateConnectionParams(value: MsgUpdateParams) { + return { + typeUrl: "/ibc.core.connection.v1.MsgUpdateParams", + value: MsgUpdateParams.fromPartial(value) + }; } } }; \ No newline at end of file diff --git a/packages/osmo-query/src/codegen/ibc/core/connection/v1/tx.rpc.msg.ts b/packages/osmo-query/src/codegen/ibc/core/connection/v1/tx.rpc.msg.ts index d5a212793..7344961a5 100644 --- a/packages/osmo-query/src/codegen/ibc/core/connection/v1/tx.rpc.msg.ts +++ b/packages/osmo-query/src/codegen/ibc/core/connection/v1/tx.rpc.msg.ts @@ -1,6 +1,6 @@ import { Rpc } from "../../../../helpers"; import { BinaryReader } from "../../../../binary"; -import { MsgConnectionOpenInit, MsgConnectionOpenInitResponse, MsgConnectionOpenTry, MsgConnectionOpenTryResponse, MsgConnectionOpenAck, MsgConnectionOpenAckResponse, MsgConnectionOpenConfirm, MsgConnectionOpenConfirmResponse } from "./tx"; +import { MsgConnectionOpenInit, MsgConnectionOpenInitResponse, MsgConnectionOpenTry, MsgConnectionOpenTryResponse, MsgConnectionOpenAck, MsgConnectionOpenAckResponse, MsgConnectionOpenConfirm, MsgConnectionOpenConfirmResponse, MsgUpdateParams, MsgUpdateParamsResponse } from "./tx"; /** Msg defines the ibc/connection Msg service. */ export interface Msg { /** ConnectionOpenInit defines a rpc handler method for MsgConnectionOpenInit. */ @@ -14,6 +14,11 @@ export interface Msg { * MsgConnectionOpenConfirm. */ connectionOpenConfirm(request: MsgConnectionOpenConfirm): Promise; + /** + * UpdateConnectionParams defines a rpc handler method for + * MsgUpdateParams. + */ + updateConnectionParams(request: MsgUpdateParams): Promise; } export class MsgClientImpl implements Msg { private readonly rpc: Rpc; @@ -23,6 +28,7 @@ export class MsgClientImpl implements Msg { this.connectionOpenTry = this.connectionOpenTry.bind(this); this.connectionOpenAck = this.connectionOpenAck.bind(this); this.connectionOpenConfirm = this.connectionOpenConfirm.bind(this); + this.updateConnectionParams = this.updateConnectionParams.bind(this); } connectionOpenInit(request: MsgConnectionOpenInit): Promise { const data = MsgConnectionOpenInit.encode(request).finish(); @@ -44,4 +50,9 @@ export class MsgClientImpl implements Msg { const promise = this.rpc.request("ibc.core.connection.v1.Msg", "ConnectionOpenConfirm", data); return promise.then(data => MsgConnectionOpenConfirmResponse.decode(new BinaryReader(data))); } + updateConnectionParams(request: MsgUpdateParams): Promise { + const data = MsgUpdateParams.encode(request).finish(); + const promise = this.rpc.request("ibc.core.connection.v1.Msg", "UpdateConnectionParams", data); + return promise.then(data => MsgUpdateParamsResponse.decode(new BinaryReader(data))); + } } \ No newline at end of file diff --git a/packages/osmo-query/src/codegen/ibc/core/connection/v1/tx.ts b/packages/osmo-query/src/codegen/ibc/core/connection/v1/tx.ts index 08d415551..1030b6723 100644 --- a/packages/osmo-query/src/codegen/ibc/core/connection/v1/tx.ts +++ b/packages/osmo-query/src/codegen/ibc/core/connection/v1/tx.ts @@ -1,7 +1,8 @@ import { Counterparty, CounterpartyAmino, CounterpartySDKType, Version, VersionAmino, VersionSDKType } from "./connection"; import { Any, AnyAmino, AnySDKType } from "../../../../google/protobuf/any"; -import { Height, HeightAmino, HeightSDKType } from "../../client/v1/client"; +import { Height, HeightAmino, HeightSDKType, Params, ParamsAmino, ParamsSDKType } from "../../client/v1/client"; import { BinaryReader, BinaryWriter } from "../../../../binary"; +import { bytesFromBase64, base64FromBytes } from "../../../../helpers"; /** * MsgConnectionOpenInit defines the msg sent by an account on Chain A to * initialize a connection with Chain B. @@ -9,7 +10,7 @@ import { BinaryReader, BinaryWriter } from "../../../../binary"; export interface MsgConnectionOpenInit { clientId: string; counterparty: Counterparty; - version: Version; + version?: Version; delayPeriod: bigint; signer: string; } @@ -22,11 +23,11 @@ export interface MsgConnectionOpenInitProtoMsg { * initialize a connection with Chain B. */ export interface MsgConnectionOpenInitAmino { - client_id: string; + client_id?: string; counterparty?: CounterpartyAmino; version?: VersionAmino; - delay_period: string; - signer: string; + delay_period?: string; + signer?: string; } export interface MsgConnectionOpenInitAminoMsg { type: "cosmos-sdk/MsgConnectionOpenInit"; @@ -39,7 +40,7 @@ export interface MsgConnectionOpenInitAminoMsg { export interface MsgConnectionOpenInitSDKType { client_id: string; counterparty: CounterpartySDKType; - version: VersionSDKType; + version?: VersionSDKType; delay_period: bigint; signer: string; } @@ -75,13 +76,13 @@ export interface MsgConnectionOpenTry { /** Deprecated: this field is unused. Crossing hellos are no longer supported in core IBC. */ /** @deprecated */ previousConnectionId: string; - clientState: Any; + clientState?: Any; counterparty: Counterparty; delayPeriod: bigint; counterpartyVersions: Version[]; proofHeight: Height; /** - * proof of the initialization the connection on Chain A: `UNITIALIZED -> + * proof of the initialization the connection on Chain A: `UNINITIALIZED -> * INIT` */ proofInit: Uint8Array; @@ -103,28 +104,28 @@ export interface MsgConnectionOpenTryProtoMsg { * connection on Chain B. */ export interface MsgConnectionOpenTryAmino { - client_id: string; + client_id?: string; /** Deprecated: this field is unused. Crossing hellos are no longer supported in core IBC. */ /** @deprecated */ - previous_connection_id: string; + previous_connection_id?: string; client_state?: AnyAmino; counterparty?: CounterpartyAmino; - delay_period: string; - counterparty_versions: VersionAmino[]; + delay_period?: string; + counterparty_versions?: VersionAmino[]; proof_height?: HeightAmino; /** - * proof of the initialization the connection on Chain A: `UNITIALIZED -> + * proof of the initialization the connection on Chain A: `UNINITIALIZED -> * INIT` */ - proof_init: Uint8Array; + proof_init?: string; /** proof of client state included in message */ - proof_client: Uint8Array; + proof_client?: string; /** proof of client consensus state */ - proof_consensus: Uint8Array; + proof_consensus?: string; consensus_height?: HeightAmino; - signer: string; + signer?: string; /** optional proof data for host state machines that are unable to introspect their own consensus state */ - host_consensus_state_proof: Uint8Array; + host_consensus_state_proof?: string; } export interface MsgConnectionOpenTryAminoMsg { type: "cosmos-sdk/MsgConnectionOpenTry"; @@ -138,7 +139,7 @@ export interface MsgConnectionOpenTrySDKType { client_id: string; /** @deprecated */ previous_connection_id: string; - client_state: AnySDKType; + client_state?: AnySDKType; counterparty: CounterpartySDKType; delay_period: bigint; counterparty_versions: VersionSDKType[]; @@ -171,11 +172,11 @@ export interface MsgConnectionOpenTryResponseSDKType {} export interface MsgConnectionOpenAck { connectionId: string; counterpartyConnectionId: string; - version: Version; - clientState: Any; + version?: Version; + clientState?: Any; proofHeight: Height; /** - * proof of the initialization the connection on Chain B: `UNITIALIZED -> + * proof of the initialization the connection on Chain B: `UNINITIALIZED -> * TRYOPEN` */ proofTry: Uint8Array; @@ -197,24 +198,24 @@ export interface MsgConnectionOpenAckProtoMsg { * acknowledge the change of connection state to TRYOPEN on Chain B. */ export interface MsgConnectionOpenAckAmino { - connection_id: string; - counterparty_connection_id: string; + connection_id?: string; + counterparty_connection_id?: string; version?: VersionAmino; client_state?: AnyAmino; proof_height?: HeightAmino; /** - * proof of the initialization the connection on Chain B: `UNITIALIZED -> + * proof of the initialization the connection on Chain B: `UNINITIALIZED -> * TRYOPEN` */ - proof_try: Uint8Array; + proof_try?: string; /** proof of client state included in message */ - proof_client: Uint8Array; + proof_client?: string; /** proof of client consensus state */ - proof_consensus: Uint8Array; + proof_consensus?: string; consensus_height?: HeightAmino; - signer: string; + signer?: string; /** optional proof data for host state machines that are unable to introspect their own consensus state */ - host_consensus_state_proof: Uint8Array; + host_consensus_state_proof?: string; } export interface MsgConnectionOpenAckAminoMsg { type: "cosmos-sdk/MsgConnectionOpenAck"; @@ -227,8 +228,8 @@ export interface MsgConnectionOpenAckAminoMsg { export interface MsgConnectionOpenAckSDKType { connection_id: string; counterparty_connection_id: string; - version: VersionSDKType; - client_state: AnySDKType; + version?: VersionSDKType; + client_state?: AnySDKType; proof_height: HeightSDKType; proof_try: Uint8Array; proof_client: Uint8Array; @@ -271,11 +272,11 @@ export interface MsgConnectionOpenConfirmProtoMsg { * acknowledge the change of connection state to OPEN on Chain A. */ export interface MsgConnectionOpenConfirmAmino { - connection_id: string; + connection_id?: string; /** proof for the change of the connection state on Chain A: `INIT -> OPEN` */ - proof_ack: Uint8Array; + proof_ack?: string; proof_height?: HeightAmino; - signer: string; + signer?: string; } export interface MsgConnectionOpenConfirmAminoMsg { type: "cosmos-sdk/MsgConnectionOpenConfirm"; @@ -314,11 +315,60 @@ export interface MsgConnectionOpenConfirmResponseAminoMsg { * response type. */ export interface MsgConnectionOpenConfirmResponseSDKType {} +/** MsgUpdateParams defines the sdk.Msg type to update the connection parameters. */ +export interface MsgUpdateParams { + /** signer address */ + signer: string; + /** + * params defines the connection parameters to update. + * + * NOTE: All parameters must be supplied. + */ + params: Params; +} +export interface MsgUpdateParamsProtoMsg { + typeUrl: "/ibc.core.connection.v1.MsgUpdateParams"; + value: Uint8Array; +} +/** MsgUpdateParams defines the sdk.Msg type to update the connection parameters. */ +export interface MsgUpdateParamsAmino { + /** signer address */ + signer?: string; + /** + * params defines the connection parameters to update. + * + * NOTE: All parameters must be supplied. + */ + params?: ParamsAmino; +} +export interface MsgUpdateParamsAminoMsg { + type: "cosmos-sdk/MsgUpdateParams"; + value: MsgUpdateParamsAmino; +} +/** MsgUpdateParams defines the sdk.Msg type to update the connection parameters. */ +export interface MsgUpdateParamsSDKType { + signer: string; + params: ParamsSDKType; +} +/** MsgUpdateParamsResponse defines the MsgUpdateParams response type. */ +export interface MsgUpdateParamsResponse {} +export interface MsgUpdateParamsResponseProtoMsg { + typeUrl: "/ibc.core.connection.v1.MsgUpdateParamsResponse"; + value: Uint8Array; +} +/** MsgUpdateParamsResponse defines the MsgUpdateParams response type. */ +export interface MsgUpdateParamsResponseAmino {} +export interface MsgUpdateParamsResponseAminoMsg { + type: "cosmos-sdk/MsgUpdateParamsResponse"; + value: MsgUpdateParamsResponseAmino; +} +/** MsgUpdateParamsResponse defines the MsgUpdateParams response type. */ +export interface MsgUpdateParamsResponseSDKType {} function createBaseMsgConnectionOpenInit(): MsgConnectionOpenInit { return { clientId: "", counterparty: Counterparty.fromPartial({}), - version: Version.fromPartial({}), + version: undefined, delayPeriod: BigInt(0), signer: "" }; @@ -382,13 +432,23 @@ export const MsgConnectionOpenInit = { return message; }, fromAmino(object: MsgConnectionOpenInitAmino): MsgConnectionOpenInit { - return { - clientId: object.client_id, - counterparty: object?.counterparty ? Counterparty.fromAmino(object.counterparty) : undefined, - version: object?.version ? Version.fromAmino(object.version) : undefined, - delayPeriod: BigInt(object.delay_period), - signer: object.signer - }; + const message = createBaseMsgConnectionOpenInit(); + if (object.client_id !== undefined && object.client_id !== null) { + message.clientId = object.client_id; + } + if (object.counterparty !== undefined && object.counterparty !== null) { + message.counterparty = Counterparty.fromAmino(object.counterparty); + } + if (object.version !== undefined && object.version !== null) { + message.version = Version.fromAmino(object.version); + } + if (object.delay_period !== undefined && object.delay_period !== null) { + message.delayPeriod = BigInt(object.delay_period); + } + if (object.signer !== undefined && object.signer !== null) { + message.signer = object.signer; + } + return message; }, toAmino(message: MsgConnectionOpenInit): MsgConnectionOpenInitAmino { const obj: any = {}; @@ -448,7 +508,8 @@ export const MsgConnectionOpenInitResponse = { return message; }, fromAmino(_: MsgConnectionOpenInitResponseAmino): MsgConnectionOpenInitResponse { - return {}; + const message = createBaseMsgConnectionOpenInitResponse(); + return message; }, toAmino(_: MsgConnectionOpenInitResponse): MsgConnectionOpenInitResponseAmino { const obj: any = {}; @@ -480,7 +541,7 @@ function createBaseMsgConnectionOpenTry(): MsgConnectionOpenTry { return { clientId: "", previousConnectionId: "", - clientState: Any.fromPartial({}), + clientState: undefined, counterparty: Counterparty.fromPartial({}), delayPeriod: BigInt(0), counterpartyVersions: [], @@ -608,21 +669,45 @@ export const MsgConnectionOpenTry = { return message; }, fromAmino(object: MsgConnectionOpenTryAmino): MsgConnectionOpenTry { - return { - clientId: object.client_id, - previousConnectionId: object.previous_connection_id, - clientState: object?.client_state ? Any.fromAmino(object.client_state) : undefined, - counterparty: object?.counterparty ? Counterparty.fromAmino(object.counterparty) : undefined, - delayPeriod: BigInt(object.delay_period), - counterpartyVersions: Array.isArray(object?.counterparty_versions) ? object.counterparty_versions.map((e: any) => Version.fromAmino(e)) : [], - proofHeight: object?.proof_height ? Height.fromAmino(object.proof_height) : undefined, - proofInit: object.proof_init, - proofClient: object.proof_client, - proofConsensus: object.proof_consensus, - consensusHeight: object?.consensus_height ? Height.fromAmino(object.consensus_height) : undefined, - signer: object.signer, - hostConsensusStateProof: object.host_consensus_state_proof - }; + const message = createBaseMsgConnectionOpenTry(); + if (object.client_id !== undefined && object.client_id !== null) { + message.clientId = object.client_id; + } + if (object.previous_connection_id !== undefined && object.previous_connection_id !== null) { + message.previousConnectionId = object.previous_connection_id; + } + if (object.client_state !== undefined && object.client_state !== null) { + message.clientState = Any.fromAmino(object.client_state); + } + if (object.counterparty !== undefined && object.counterparty !== null) { + message.counterparty = Counterparty.fromAmino(object.counterparty); + } + if (object.delay_period !== undefined && object.delay_period !== null) { + message.delayPeriod = BigInt(object.delay_period); + } + message.counterpartyVersions = object.counterparty_versions?.map(e => Version.fromAmino(e)) || []; + if (object.proof_height !== undefined && object.proof_height !== null) { + message.proofHeight = Height.fromAmino(object.proof_height); + } + if (object.proof_init !== undefined && object.proof_init !== null) { + message.proofInit = bytesFromBase64(object.proof_init); + } + if (object.proof_client !== undefined && object.proof_client !== null) { + message.proofClient = bytesFromBase64(object.proof_client); + } + if (object.proof_consensus !== undefined && object.proof_consensus !== null) { + message.proofConsensus = bytesFromBase64(object.proof_consensus); + } + if (object.consensus_height !== undefined && object.consensus_height !== null) { + message.consensusHeight = Height.fromAmino(object.consensus_height); + } + if (object.signer !== undefined && object.signer !== null) { + message.signer = object.signer; + } + if (object.host_consensus_state_proof !== undefined && object.host_consensus_state_proof !== null) { + message.hostConsensusStateProof = bytesFromBase64(object.host_consensus_state_proof); + } + return message; }, toAmino(message: MsgConnectionOpenTry): MsgConnectionOpenTryAmino { const obj: any = {}; @@ -637,12 +722,12 @@ export const MsgConnectionOpenTry = { obj.counterparty_versions = []; } obj.proof_height = message.proofHeight ? Height.toAmino(message.proofHeight) : {}; - obj.proof_init = message.proofInit; - obj.proof_client = message.proofClient; - obj.proof_consensus = message.proofConsensus; + obj.proof_init = message.proofInit ? base64FromBytes(message.proofInit) : undefined; + obj.proof_client = message.proofClient ? base64FromBytes(message.proofClient) : undefined; + obj.proof_consensus = message.proofConsensus ? base64FromBytes(message.proofConsensus) : undefined; obj.consensus_height = message.consensusHeight ? Height.toAmino(message.consensusHeight) : {}; obj.signer = message.signer; - obj.host_consensus_state_proof = message.hostConsensusStateProof; + obj.host_consensus_state_proof = message.hostConsensusStateProof ? base64FromBytes(message.hostConsensusStateProof) : undefined; return obj; }, fromAminoMsg(object: MsgConnectionOpenTryAminoMsg): MsgConnectionOpenTry { @@ -694,7 +779,8 @@ export const MsgConnectionOpenTryResponse = { return message; }, fromAmino(_: MsgConnectionOpenTryResponseAmino): MsgConnectionOpenTryResponse { - return {}; + const message = createBaseMsgConnectionOpenTryResponse(); + return message; }, toAmino(_: MsgConnectionOpenTryResponse): MsgConnectionOpenTryResponseAmino { const obj: any = {}; @@ -726,8 +812,8 @@ function createBaseMsgConnectionOpenAck(): MsgConnectionOpenAck { return { connectionId: "", counterpartyConnectionId: "", - version: Version.fromPartial({}), - clientState: Any.fromPartial({}), + version: undefined, + clientState: undefined, proofHeight: Height.fromPartial({}), proofTry: new Uint8Array(), proofClient: new Uint8Array(), @@ -838,19 +924,41 @@ export const MsgConnectionOpenAck = { return message; }, fromAmino(object: MsgConnectionOpenAckAmino): MsgConnectionOpenAck { - return { - connectionId: object.connection_id, - counterpartyConnectionId: object.counterparty_connection_id, - version: object?.version ? Version.fromAmino(object.version) : undefined, - clientState: object?.client_state ? Any.fromAmino(object.client_state) : undefined, - proofHeight: object?.proof_height ? Height.fromAmino(object.proof_height) : undefined, - proofTry: object.proof_try, - proofClient: object.proof_client, - proofConsensus: object.proof_consensus, - consensusHeight: object?.consensus_height ? Height.fromAmino(object.consensus_height) : undefined, - signer: object.signer, - hostConsensusStateProof: object.host_consensus_state_proof - }; + const message = createBaseMsgConnectionOpenAck(); + if (object.connection_id !== undefined && object.connection_id !== null) { + message.connectionId = object.connection_id; + } + if (object.counterparty_connection_id !== undefined && object.counterparty_connection_id !== null) { + message.counterpartyConnectionId = object.counterparty_connection_id; + } + if (object.version !== undefined && object.version !== null) { + message.version = Version.fromAmino(object.version); + } + if (object.client_state !== undefined && object.client_state !== null) { + message.clientState = Any.fromAmino(object.client_state); + } + if (object.proof_height !== undefined && object.proof_height !== null) { + message.proofHeight = Height.fromAmino(object.proof_height); + } + if (object.proof_try !== undefined && object.proof_try !== null) { + message.proofTry = bytesFromBase64(object.proof_try); + } + if (object.proof_client !== undefined && object.proof_client !== null) { + message.proofClient = bytesFromBase64(object.proof_client); + } + if (object.proof_consensus !== undefined && object.proof_consensus !== null) { + message.proofConsensus = bytesFromBase64(object.proof_consensus); + } + if (object.consensus_height !== undefined && object.consensus_height !== null) { + message.consensusHeight = Height.fromAmino(object.consensus_height); + } + if (object.signer !== undefined && object.signer !== null) { + message.signer = object.signer; + } + if (object.host_consensus_state_proof !== undefined && object.host_consensus_state_proof !== null) { + message.hostConsensusStateProof = bytesFromBase64(object.host_consensus_state_proof); + } + return message; }, toAmino(message: MsgConnectionOpenAck): MsgConnectionOpenAckAmino { const obj: any = {}; @@ -859,12 +967,12 @@ export const MsgConnectionOpenAck = { obj.version = message.version ? Version.toAmino(message.version) : undefined; obj.client_state = message.clientState ? Any.toAmino(message.clientState) : undefined; obj.proof_height = message.proofHeight ? Height.toAmino(message.proofHeight) : {}; - obj.proof_try = message.proofTry; - obj.proof_client = message.proofClient; - obj.proof_consensus = message.proofConsensus; + obj.proof_try = message.proofTry ? base64FromBytes(message.proofTry) : undefined; + obj.proof_client = message.proofClient ? base64FromBytes(message.proofClient) : undefined; + obj.proof_consensus = message.proofConsensus ? base64FromBytes(message.proofConsensus) : undefined; obj.consensus_height = message.consensusHeight ? Height.toAmino(message.consensusHeight) : {}; obj.signer = message.signer; - obj.host_consensus_state_proof = message.hostConsensusStateProof; + obj.host_consensus_state_proof = message.hostConsensusStateProof ? base64FromBytes(message.hostConsensusStateProof) : undefined; return obj; }, fromAminoMsg(object: MsgConnectionOpenAckAminoMsg): MsgConnectionOpenAck { @@ -916,7 +1024,8 @@ export const MsgConnectionOpenAckResponse = { return message; }, fromAmino(_: MsgConnectionOpenAckResponseAmino): MsgConnectionOpenAckResponse { - return {}; + const message = createBaseMsgConnectionOpenAckResponse(); + return message; }, toAmino(_: MsgConnectionOpenAckResponse): MsgConnectionOpenAckResponseAmino { const obj: any = {}; @@ -1004,17 +1113,25 @@ export const MsgConnectionOpenConfirm = { return message; }, fromAmino(object: MsgConnectionOpenConfirmAmino): MsgConnectionOpenConfirm { - return { - connectionId: object.connection_id, - proofAck: object.proof_ack, - proofHeight: object?.proof_height ? Height.fromAmino(object.proof_height) : undefined, - signer: object.signer - }; + const message = createBaseMsgConnectionOpenConfirm(); + if (object.connection_id !== undefined && object.connection_id !== null) { + message.connectionId = object.connection_id; + } + if (object.proof_ack !== undefined && object.proof_ack !== null) { + message.proofAck = bytesFromBase64(object.proof_ack); + } + if (object.proof_height !== undefined && object.proof_height !== null) { + message.proofHeight = Height.fromAmino(object.proof_height); + } + if (object.signer !== undefined && object.signer !== null) { + message.signer = object.signer; + } + return message; }, toAmino(message: MsgConnectionOpenConfirm): MsgConnectionOpenConfirmAmino { const obj: any = {}; obj.connection_id = message.connectionId; - obj.proof_ack = message.proofAck; + obj.proof_ack = message.proofAck ? base64FromBytes(message.proofAck) : undefined; obj.proof_height = message.proofHeight ? Height.toAmino(message.proofHeight) : {}; obj.signer = message.signer; return obj; @@ -1068,7 +1185,8 @@ export const MsgConnectionOpenConfirmResponse = { return message; }, fromAmino(_: MsgConnectionOpenConfirmResponseAmino): MsgConnectionOpenConfirmResponse { - return {}; + const message = createBaseMsgConnectionOpenConfirmResponse(); + return message; }, toAmino(_: MsgConnectionOpenConfirmResponse): MsgConnectionOpenConfirmResponseAmino { const obj: any = {}; @@ -1095,4 +1213,141 @@ export const MsgConnectionOpenConfirmResponse = { value: MsgConnectionOpenConfirmResponse.encode(message).finish() }; } +}; +function createBaseMsgUpdateParams(): MsgUpdateParams { + return { + signer: "", + params: Params.fromPartial({}) + }; +} +export const MsgUpdateParams = { + typeUrl: "/ibc.core.connection.v1.MsgUpdateParams", + encode(message: MsgUpdateParams, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.signer !== "") { + writer.uint32(10).string(message.signer); + } + if (message.params !== undefined) { + Params.encode(message.params, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgUpdateParams { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUpdateParams(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.signer = reader.string(); + break; + case 2: + message.params = Params.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgUpdateParams { + const message = createBaseMsgUpdateParams(); + message.signer = object.signer ?? ""; + message.params = object.params !== undefined && object.params !== null ? Params.fromPartial(object.params) : undefined; + return message; + }, + fromAmino(object: MsgUpdateParamsAmino): MsgUpdateParams { + const message = createBaseMsgUpdateParams(); + if (object.signer !== undefined && object.signer !== null) { + message.signer = object.signer; + } + if (object.params !== undefined && object.params !== null) { + message.params = Params.fromAmino(object.params); + } + return message; + }, + toAmino(message: MsgUpdateParams): MsgUpdateParamsAmino { + const obj: any = {}; + obj.signer = message.signer; + obj.params = message.params ? Params.toAmino(message.params) : undefined; + return obj; + }, + fromAminoMsg(object: MsgUpdateParamsAminoMsg): MsgUpdateParams { + return MsgUpdateParams.fromAmino(object.value); + }, + toAminoMsg(message: MsgUpdateParams): MsgUpdateParamsAminoMsg { + return { + type: "cosmos-sdk/MsgUpdateParams", + value: MsgUpdateParams.toAmino(message) + }; + }, + fromProtoMsg(message: MsgUpdateParamsProtoMsg): MsgUpdateParams { + return MsgUpdateParams.decode(message.value); + }, + toProto(message: MsgUpdateParams): Uint8Array { + return MsgUpdateParams.encode(message).finish(); + }, + toProtoMsg(message: MsgUpdateParams): MsgUpdateParamsProtoMsg { + return { + typeUrl: "/ibc.core.connection.v1.MsgUpdateParams", + value: MsgUpdateParams.encode(message).finish() + }; + } +}; +function createBaseMsgUpdateParamsResponse(): MsgUpdateParamsResponse { + return {}; +} +export const MsgUpdateParamsResponse = { + typeUrl: "/ibc.core.connection.v1.MsgUpdateParamsResponse", + encode(_: MsgUpdateParamsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgUpdateParamsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUpdateParamsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): MsgUpdateParamsResponse { + const message = createBaseMsgUpdateParamsResponse(); + return message; + }, + fromAmino(_: MsgUpdateParamsResponseAmino): MsgUpdateParamsResponse { + const message = createBaseMsgUpdateParamsResponse(); + return message; + }, + toAmino(_: MsgUpdateParamsResponse): MsgUpdateParamsResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgUpdateParamsResponseAminoMsg): MsgUpdateParamsResponse { + return MsgUpdateParamsResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgUpdateParamsResponse): MsgUpdateParamsResponseAminoMsg { + return { + type: "cosmos-sdk/MsgUpdateParamsResponse", + value: MsgUpdateParamsResponse.toAmino(message) + }; + }, + fromProtoMsg(message: MsgUpdateParamsResponseProtoMsg): MsgUpdateParamsResponse { + return MsgUpdateParamsResponse.decode(message.value); + }, + toProto(message: MsgUpdateParamsResponse): Uint8Array { + return MsgUpdateParamsResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgUpdateParamsResponse): MsgUpdateParamsResponseProtoMsg { + return { + typeUrl: "/ibc.core.connection.v1.MsgUpdateParamsResponse", + value: MsgUpdateParamsResponse.encode(message).finish() + }; + } }; \ No newline at end of file diff --git a/packages/osmo-query/src/codegen/ibc/lcd.ts b/packages/osmo-query/src/codegen/ibc/lcd.ts index 182d85ab6..8956261ca 100644 --- a/packages/osmo-query/src/codegen/ibc/lcd.ts +++ b/packages/osmo-query/src/codegen/ibc/lcd.ts @@ -31,6 +31,11 @@ export const createLCDClient = async ({ }) } }, + consensus: { + v1: new (await import("../cosmos/consensus/v1/query.lcd")).LCDQueryClient({ + requestClient + }) + }, distribution: { v1beta1: new (await import("../cosmos/distribution/v1beta1/query.lcd")).LCDQueryClient({ requestClient @@ -98,6 +103,13 @@ export const createLCDClient = async ({ requestClient }) } + }, + lightclients: { + wasm: { + v1: new (await import("./lightclients/wasm/v1/query.lcd")).LCDQueryClient({ + requestClient + }) + } } } }; diff --git a/packages/osmo-query/src/codegen/ibc/lightclients/localhost/v2/localhost.ts b/packages/osmo-query/src/codegen/ibc/lightclients/localhost/v2/localhost.ts index 617f7b4d1..98f1fcc8f 100644 --- a/packages/osmo-query/src/codegen/ibc/lightclients/localhost/v2/localhost.ts +++ b/packages/osmo-query/src/codegen/ibc/lightclients/localhost/v2/localhost.ts @@ -58,9 +58,11 @@ export const ClientState = { return message; }, fromAmino(object: ClientStateAmino): ClientState { - return { - latestHeight: object?.latest_height ? Height.fromAmino(object.latest_height) : undefined - }; + const message = createBaseClientState(); + if (object.latest_height !== undefined && object.latest_height !== null) { + message.latestHeight = Height.fromAmino(object.latest_height); + } + return message; }, toAmino(message: ClientState): ClientStateAmino { const obj: any = {}; diff --git a/packages/osmo-query/src/codegen/ibc/lightclients/solomachine/v2/solomachine.ts b/packages/osmo-query/src/codegen/ibc/lightclients/solomachine/v2/solomachine.ts index a368d7bac..0e0605057 100644 --- a/packages/osmo-query/src/codegen/ibc/lightclients/solomachine/v2/solomachine.ts +++ b/packages/osmo-query/src/codegen/ibc/lightclients/solomachine/v2/solomachine.ts @@ -2,7 +2,7 @@ import { Any, AnyAmino, AnySDKType } from "../../../../google/protobuf/any"; import { ConnectionEnd, ConnectionEndAmino, ConnectionEndSDKType } from "../../../core/connection/v1/connection"; import { Channel, ChannelAmino, ChannelSDKType } from "../../../core/channel/v1/channel"; import { BinaryReader, BinaryWriter } from "../../../../binary"; -import { isSet } from "../../../../helpers"; +import { bytesFromBase64, base64FromBytes } from "../../../../helpers"; /** * DataType defines the type of solo machine proof being created. This is done * to preserve uniqueness of different data sign byte encodings. @@ -106,7 +106,7 @@ export interface ClientState { sequence: bigint; /** frozen sequence of the solo machine */ isFrozen: boolean; - consensusState: ConsensusState; + consensusState?: ConsensusState; /** * when set to true, will allow governance to update a solo machine client. * The client will be unfrozen if it is frozen. @@ -123,15 +123,15 @@ export interface ClientStateProtoMsg { */ export interface ClientStateAmino { /** latest sequence of the client state */ - sequence: string; + sequence?: string; /** frozen sequence of the solo machine */ - is_frozen: boolean; + is_frozen?: boolean; consensus_state?: ConsensusStateAmino; /** * when set to true, will allow governance to update a solo machine client. * The client will be unfrozen if it is frozen. */ - allow_update_after_proposal: boolean; + allow_update_after_proposal?: boolean; } export interface ClientStateAminoMsg { type: "cosmos-sdk/ClientState"; @@ -144,7 +144,7 @@ export interface ClientStateAminoMsg { export interface ClientStateSDKType { sequence: bigint; is_frozen: boolean; - consensus_state: ConsensusStateSDKType; + consensus_state?: ConsensusStateSDKType; allow_update_after_proposal: boolean; } /** @@ -154,7 +154,7 @@ export interface ClientStateSDKType { */ export interface ConsensusState { /** public key of the solo machine */ - publicKey: Any; + publicKey?: Any; /** * diversifier allows the same public key to be re-used across different solo * machine clients (potentially on different chains) without being considered @@ -180,8 +180,8 @@ export interface ConsensusStateAmino { * machine clients (potentially on different chains) without being considered * misbehaviour. */ - diversifier: string; - timestamp: string; + diversifier?: string; + timestamp?: string; } export interface ConsensusStateAminoMsg { type: "cosmos-sdk/ConsensusState"; @@ -193,7 +193,7 @@ export interface ConsensusStateAminoMsg { * consensus state. */ export interface ConsensusStateSDKType { - public_key: AnySDKType; + public_key?: AnySDKType; diversifier: string; timestamp: bigint; } @@ -203,7 +203,7 @@ export interface Header { sequence: bigint; timestamp: bigint; signature: Uint8Array; - newPublicKey: Any; + newPublicKey?: Any; newDiversifier: string; } export interface HeaderProtoMsg { @@ -213,11 +213,11 @@ export interface HeaderProtoMsg { /** Header defines a solo machine consensus header */ export interface HeaderAmino { /** sequence to update solo machine public key at */ - sequence: string; - timestamp: string; - signature: Uint8Array; + sequence?: string; + timestamp?: string; + signature?: string; new_public_key?: AnyAmino; - new_diversifier: string; + new_diversifier?: string; } export interface HeaderAminoMsg { type: "cosmos-sdk/Header"; @@ -228,7 +228,7 @@ export interface HeaderSDKType { sequence: bigint; timestamp: bigint; signature: Uint8Array; - new_public_key: AnySDKType; + new_public_key?: AnySDKType; new_diversifier: string; } /** @@ -238,8 +238,8 @@ export interface HeaderSDKType { export interface Misbehaviour { clientId: string; sequence: bigint; - signatureOne: SignatureAndData; - signatureTwo: SignatureAndData; + signatureOne?: SignatureAndData; + signatureTwo?: SignatureAndData; } export interface MisbehaviourProtoMsg { typeUrl: "/ibc.lightclients.solomachine.v2.Misbehaviour"; @@ -250,8 +250,8 @@ export interface MisbehaviourProtoMsg { * of a sequence and two signatures over different messages at that sequence. */ export interface MisbehaviourAmino { - client_id: string; - sequence: string; + client_id?: string; + sequence?: string; signature_one?: SignatureAndDataAmino; signature_two?: SignatureAndDataAmino; } @@ -266,8 +266,8 @@ export interface MisbehaviourAminoMsg { export interface MisbehaviourSDKType { client_id: string; sequence: bigint; - signature_one: SignatureAndDataSDKType; - signature_two: SignatureAndDataSDKType; + signature_one?: SignatureAndDataSDKType; + signature_two?: SignatureAndDataSDKType; } /** * SignatureAndData contains a signature and the data signed over to create that @@ -288,10 +288,10 @@ export interface SignatureAndDataProtoMsg { * signature. */ export interface SignatureAndDataAmino { - signature: Uint8Array; - data_type: DataType; - data: Uint8Array; - timestamp: string; + signature?: string; + data_type?: DataType; + data?: string; + timestamp?: string; } export interface SignatureAndDataAminoMsg { type: "cosmos-sdk/SignatureAndData"; @@ -324,8 +324,8 @@ export interface TimestampedSignatureDataProtoMsg { * signature. */ export interface TimestampedSignatureDataAmino { - signature_data: Uint8Array; - timestamp: string; + signature_data?: string; + timestamp?: string; } export interface TimestampedSignatureDataAminoMsg { type: "cosmos-sdk/TimestampedSignatureData"; @@ -355,13 +355,13 @@ export interface SignBytesProtoMsg { } /** SignBytes defines the signed bytes used for signature verification. */ export interface SignBytesAmino { - sequence: string; - timestamp: string; - diversifier: string; + sequence?: string; + timestamp?: string; + diversifier?: string; /** type of the data used */ - data_type: DataType; + data_type?: DataType; /** marshaled data */ - data: Uint8Array; + data?: string; } export interface SignBytesAminoMsg { type: "cosmos-sdk/SignBytes"; @@ -378,7 +378,7 @@ export interface SignBytesSDKType { /** HeaderData returns the SignBytes data for update verification. */ export interface HeaderData { /** header public key */ - newPubKey: Any; + newPubKey?: Any; /** header diversifier */ newDiversifier: string; } @@ -391,7 +391,7 @@ export interface HeaderDataAmino { /** header public key */ new_pub_key?: AnyAmino; /** header diversifier */ - new_diversifier: string; + new_diversifier?: string; } export interface HeaderDataAminoMsg { type: "cosmos-sdk/HeaderData"; @@ -399,13 +399,13 @@ export interface HeaderDataAminoMsg { } /** HeaderData returns the SignBytes data for update verification. */ export interface HeaderDataSDKType { - new_pub_key: AnySDKType; + new_pub_key?: AnySDKType; new_diversifier: string; } /** ClientStateData returns the SignBytes data for client state verification. */ export interface ClientStateData { path: Uint8Array; - clientState: Any; + clientState?: Any; } export interface ClientStateDataProtoMsg { typeUrl: "/ibc.lightclients.solomachine.v2.ClientStateData"; @@ -413,7 +413,7 @@ export interface ClientStateDataProtoMsg { } /** ClientStateData returns the SignBytes data for client state verification. */ export interface ClientStateDataAmino { - path: Uint8Array; + path?: string; client_state?: AnyAmino; } export interface ClientStateDataAminoMsg { @@ -423,7 +423,7 @@ export interface ClientStateDataAminoMsg { /** ClientStateData returns the SignBytes data for client state verification. */ export interface ClientStateDataSDKType { path: Uint8Array; - client_state: AnySDKType; + client_state?: AnySDKType; } /** * ConsensusStateData returns the SignBytes data for consensus state @@ -431,7 +431,7 @@ export interface ClientStateDataSDKType { */ export interface ConsensusStateData { path: Uint8Array; - consensusState: Any; + consensusState?: Any; } export interface ConsensusStateDataProtoMsg { typeUrl: "/ibc.lightclients.solomachine.v2.ConsensusStateData"; @@ -442,7 +442,7 @@ export interface ConsensusStateDataProtoMsg { * verification. */ export interface ConsensusStateDataAmino { - path: Uint8Array; + path?: string; consensus_state?: AnyAmino; } export interface ConsensusStateDataAminoMsg { @@ -455,7 +455,7 @@ export interface ConsensusStateDataAminoMsg { */ export interface ConsensusStateDataSDKType { path: Uint8Array; - consensus_state: AnySDKType; + consensus_state?: AnySDKType; } /** * ConnectionStateData returns the SignBytes data for connection state @@ -463,7 +463,7 @@ export interface ConsensusStateDataSDKType { */ export interface ConnectionStateData { path: Uint8Array; - connection: ConnectionEnd; + connection?: ConnectionEnd; } export interface ConnectionStateDataProtoMsg { typeUrl: "/ibc.lightclients.solomachine.v2.ConnectionStateData"; @@ -474,7 +474,7 @@ export interface ConnectionStateDataProtoMsg { * verification. */ export interface ConnectionStateDataAmino { - path: Uint8Array; + path?: string; connection?: ConnectionEndAmino; } export interface ConnectionStateDataAminoMsg { @@ -487,7 +487,7 @@ export interface ConnectionStateDataAminoMsg { */ export interface ConnectionStateDataSDKType { path: Uint8Array; - connection: ConnectionEndSDKType; + connection?: ConnectionEndSDKType; } /** * ChannelStateData returns the SignBytes data for channel state @@ -495,7 +495,7 @@ export interface ConnectionStateDataSDKType { */ export interface ChannelStateData { path: Uint8Array; - channel: Channel; + channel?: Channel; } export interface ChannelStateDataProtoMsg { typeUrl: "/ibc.lightclients.solomachine.v2.ChannelStateData"; @@ -506,7 +506,7 @@ export interface ChannelStateDataProtoMsg { * verification. */ export interface ChannelStateDataAmino { - path: Uint8Array; + path?: string; channel?: ChannelAmino; } export interface ChannelStateDataAminoMsg { @@ -519,7 +519,7 @@ export interface ChannelStateDataAminoMsg { */ export interface ChannelStateDataSDKType { path: Uint8Array; - channel: ChannelSDKType; + channel?: ChannelSDKType; } /** * PacketCommitmentData returns the SignBytes data for packet commitment @@ -538,8 +538,8 @@ export interface PacketCommitmentDataProtoMsg { * verification. */ export interface PacketCommitmentDataAmino { - path: Uint8Array; - commitment: Uint8Array; + path?: string; + commitment?: string; } export interface PacketCommitmentDataAminoMsg { type: "cosmos-sdk/PacketCommitmentData"; @@ -570,8 +570,8 @@ export interface PacketAcknowledgementDataProtoMsg { * verification. */ export interface PacketAcknowledgementDataAmino { - path: Uint8Array; - acknowledgement: Uint8Array; + path?: string; + acknowledgement?: string; } export interface PacketAcknowledgementDataAminoMsg { type: "cosmos-sdk/PacketAcknowledgementData"; @@ -601,7 +601,7 @@ export interface PacketReceiptAbsenceDataProtoMsg { * packet receipt absence verification. */ export interface PacketReceiptAbsenceDataAmino { - path: Uint8Array; + path?: string; } export interface PacketReceiptAbsenceDataAminoMsg { type: "cosmos-sdk/PacketReceiptAbsenceData"; @@ -631,8 +631,8 @@ export interface NextSequenceRecvDataProtoMsg { * sequence to be received. */ export interface NextSequenceRecvDataAmino { - path: Uint8Array; - next_seq_recv: string; + path?: string; + next_seq_recv?: string; } export interface NextSequenceRecvDataAminoMsg { type: "cosmos-sdk/NextSequenceRecvData"; @@ -650,7 +650,7 @@ function createBaseClientState(): ClientState { return { sequence: BigInt(0), isFrozen: false, - consensusState: ConsensusState.fromPartial({}), + consensusState: undefined, allowUpdateAfterProposal: false }; } @@ -706,12 +706,20 @@ export const ClientState = { return message; }, fromAmino(object: ClientStateAmino): ClientState { - return { - sequence: BigInt(object.sequence), - isFrozen: object.is_frozen, - consensusState: object?.consensus_state ? ConsensusState.fromAmino(object.consensus_state) : undefined, - allowUpdateAfterProposal: object.allow_update_after_proposal - }; + const message = createBaseClientState(); + if (object.sequence !== undefined && object.sequence !== null) { + message.sequence = BigInt(object.sequence); + } + if (object.is_frozen !== undefined && object.is_frozen !== null) { + message.isFrozen = object.is_frozen; + } + if (object.consensus_state !== undefined && object.consensus_state !== null) { + message.consensusState = ConsensusState.fromAmino(object.consensus_state); + } + if (object.allow_update_after_proposal !== undefined && object.allow_update_after_proposal !== null) { + message.allowUpdateAfterProposal = object.allow_update_after_proposal; + } + return message; }, toAmino(message: ClientState): ClientStateAmino { const obj: any = {}; @@ -745,7 +753,7 @@ export const ClientState = { }; function createBaseConsensusState(): ConsensusState { return { - publicKey: Any.fromPartial({}), + publicKey: undefined, diversifier: "", timestamp: BigInt(0) }; @@ -795,11 +803,17 @@ export const ConsensusState = { return message; }, fromAmino(object: ConsensusStateAmino): ConsensusState { - return { - publicKey: object?.public_key ? Any.fromAmino(object.public_key) : undefined, - diversifier: object.diversifier, - timestamp: BigInt(object.timestamp) - }; + const message = createBaseConsensusState(); + if (object.public_key !== undefined && object.public_key !== null) { + message.publicKey = Any.fromAmino(object.public_key); + } + if (object.diversifier !== undefined && object.diversifier !== null) { + message.diversifier = object.diversifier; + } + if (object.timestamp !== undefined && object.timestamp !== null) { + message.timestamp = BigInt(object.timestamp); + } + return message; }, toAmino(message: ConsensusState): ConsensusStateAmino { const obj: any = {}; @@ -835,7 +849,7 @@ function createBaseHeader(): Header { sequence: BigInt(0), timestamp: BigInt(0), signature: new Uint8Array(), - newPublicKey: Any.fromPartial({}), + newPublicKey: undefined, newDiversifier: "" }; } @@ -898,19 +912,29 @@ export const Header = { return message; }, fromAmino(object: HeaderAmino): Header { - return { - sequence: BigInt(object.sequence), - timestamp: BigInt(object.timestamp), - signature: object.signature, - newPublicKey: object?.new_public_key ? Any.fromAmino(object.new_public_key) : undefined, - newDiversifier: object.new_diversifier - }; + const message = createBaseHeader(); + if (object.sequence !== undefined && object.sequence !== null) { + message.sequence = BigInt(object.sequence); + } + if (object.timestamp !== undefined && object.timestamp !== null) { + message.timestamp = BigInt(object.timestamp); + } + if (object.signature !== undefined && object.signature !== null) { + message.signature = bytesFromBase64(object.signature); + } + if (object.new_public_key !== undefined && object.new_public_key !== null) { + message.newPublicKey = Any.fromAmino(object.new_public_key); + } + if (object.new_diversifier !== undefined && object.new_diversifier !== null) { + message.newDiversifier = object.new_diversifier; + } + return message; }, toAmino(message: Header): HeaderAmino { const obj: any = {}; obj.sequence = message.sequence ? message.sequence.toString() : undefined; obj.timestamp = message.timestamp ? message.timestamp.toString() : undefined; - obj.signature = message.signature; + obj.signature = message.signature ? base64FromBytes(message.signature) : undefined; obj.new_public_key = message.newPublicKey ? Any.toAmino(message.newPublicKey) : undefined; obj.new_diversifier = message.newDiversifier; return obj; @@ -941,8 +965,8 @@ function createBaseMisbehaviour(): Misbehaviour { return { clientId: "", sequence: BigInt(0), - signatureOne: SignatureAndData.fromPartial({}), - signatureTwo: SignatureAndData.fromPartial({}) + signatureOne: undefined, + signatureTwo: undefined }; } export const Misbehaviour = { @@ -997,12 +1021,20 @@ export const Misbehaviour = { return message; }, fromAmino(object: MisbehaviourAmino): Misbehaviour { - return { - clientId: object.client_id, - sequence: BigInt(object.sequence), - signatureOne: object?.signature_one ? SignatureAndData.fromAmino(object.signature_one) : undefined, - signatureTwo: object?.signature_two ? SignatureAndData.fromAmino(object.signature_two) : undefined - }; + const message = createBaseMisbehaviour(); + if (object.client_id !== undefined && object.client_id !== null) { + message.clientId = object.client_id; + } + if (object.sequence !== undefined && object.sequence !== null) { + message.sequence = BigInt(object.sequence); + } + if (object.signature_one !== undefined && object.signature_one !== null) { + message.signatureOne = SignatureAndData.fromAmino(object.signature_one); + } + if (object.signature_two !== undefined && object.signature_two !== null) { + message.signatureTwo = SignatureAndData.fromAmino(object.signature_two); + } + return message; }, toAmino(message: Misbehaviour): MisbehaviourAmino { const obj: any = {}; @@ -1094,18 +1126,26 @@ export const SignatureAndData = { return message; }, fromAmino(object: SignatureAndDataAmino): SignatureAndData { - return { - signature: object.signature, - dataType: isSet(object.data_type) ? dataTypeFromJSON(object.data_type) : -1, - data: object.data, - timestamp: BigInt(object.timestamp) - }; + const message = createBaseSignatureAndData(); + if (object.signature !== undefined && object.signature !== null) { + message.signature = bytesFromBase64(object.signature); + } + if (object.data_type !== undefined && object.data_type !== null) { + message.dataType = dataTypeFromJSON(object.data_type); + } + if (object.data !== undefined && object.data !== null) { + message.data = bytesFromBase64(object.data); + } + if (object.timestamp !== undefined && object.timestamp !== null) { + message.timestamp = BigInt(object.timestamp); + } + return message; }, toAmino(message: SignatureAndData): SignatureAndDataAmino { const obj: any = {}; - obj.signature = message.signature; - obj.data_type = message.dataType; - obj.data = message.data; + obj.signature = message.signature ? base64FromBytes(message.signature) : undefined; + obj.data_type = dataTypeToJSON(message.dataType); + obj.data = message.data ? base64FromBytes(message.data) : undefined; obj.timestamp = message.timestamp ? message.timestamp.toString() : undefined; return obj; }, @@ -1175,14 +1215,18 @@ export const TimestampedSignatureData = { return message; }, fromAmino(object: TimestampedSignatureDataAmino): TimestampedSignatureData { - return { - signatureData: object.signature_data, - timestamp: BigInt(object.timestamp) - }; + const message = createBaseTimestampedSignatureData(); + if (object.signature_data !== undefined && object.signature_data !== null) { + message.signatureData = bytesFromBase64(object.signature_data); + } + if (object.timestamp !== undefined && object.timestamp !== null) { + message.timestamp = BigInt(object.timestamp); + } + return message; }, toAmino(message: TimestampedSignatureData): TimestampedSignatureDataAmino { const obj: any = {}; - obj.signature_data = message.signatureData; + obj.signature_data = message.signatureData ? base64FromBytes(message.signatureData) : undefined; obj.timestamp = message.timestamp ? message.timestamp.toString() : undefined; return obj; }, @@ -1276,21 +1320,31 @@ export const SignBytes = { return message; }, fromAmino(object: SignBytesAmino): SignBytes { - return { - sequence: BigInt(object.sequence), - timestamp: BigInt(object.timestamp), - diversifier: object.diversifier, - dataType: isSet(object.data_type) ? dataTypeFromJSON(object.data_type) : -1, - data: object.data - }; + const message = createBaseSignBytes(); + if (object.sequence !== undefined && object.sequence !== null) { + message.sequence = BigInt(object.sequence); + } + if (object.timestamp !== undefined && object.timestamp !== null) { + message.timestamp = BigInt(object.timestamp); + } + if (object.diversifier !== undefined && object.diversifier !== null) { + message.diversifier = object.diversifier; + } + if (object.data_type !== undefined && object.data_type !== null) { + message.dataType = dataTypeFromJSON(object.data_type); + } + if (object.data !== undefined && object.data !== null) { + message.data = bytesFromBase64(object.data); + } + return message; }, toAmino(message: SignBytes): SignBytesAmino { const obj: any = {}; obj.sequence = message.sequence ? message.sequence.toString() : undefined; obj.timestamp = message.timestamp ? message.timestamp.toString() : undefined; obj.diversifier = message.diversifier; - obj.data_type = message.dataType; - obj.data = message.data; + obj.data_type = dataTypeToJSON(message.dataType); + obj.data = message.data ? base64FromBytes(message.data) : undefined; return obj; }, fromAminoMsg(object: SignBytesAminoMsg): SignBytes { @@ -1317,7 +1371,7 @@ export const SignBytes = { }; function createBaseHeaderData(): HeaderData { return { - newPubKey: Any.fromPartial({}), + newPubKey: undefined, newDiversifier: "" }; } @@ -1359,10 +1413,14 @@ export const HeaderData = { return message; }, fromAmino(object: HeaderDataAmino): HeaderData { - return { - newPubKey: object?.new_pub_key ? Any.fromAmino(object.new_pub_key) : undefined, - newDiversifier: object.new_diversifier - }; + const message = createBaseHeaderData(); + if (object.new_pub_key !== undefined && object.new_pub_key !== null) { + message.newPubKey = Any.fromAmino(object.new_pub_key); + } + if (object.new_diversifier !== undefined && object.new_diversifier !== null) { + message.newDiversifier = object.new_diversifier; + } + return message; }, toAmino(message: HeaderData): HeaderDataAmino { const obj: any = {}; @@ -1395,7 +1453,7 @@ export const HeaderData = { function createBaseClientStateData(): ClientStateData { return { path: new Uint8Array(), - clientState: Any.fromPartial({}) + clientState: undefined }; } export const ClientStateData = { @@ -1436,14 +1494,18 @@ export const ClientStateData = { return message; }, fromAmino(object: ClientStateDataAmino): ClientStateData { - return { - path: object.path, - clientState: object?.client_state ? Any.fromAmino(object.client_state) : undefined - }; + const message = createBaseClientStateData(); + if (object.path !== undefined && object.path !== null) { + message.path = bytesFromBase64(object.path); + } + if (object.client_state !== undefined && object.client_state !== null) { + message.clientState = Any.fromAmino(object.client_state); + } + return message; }, toAmino(message: ClientStateData): ClientStateDataAmino { const obj: any = {}; - obj.path = message.path; + obj.path = message.path ? base64FromBytes(message.path) : undefined; obj.client_state = message.clientState ? Any.toAmino(message.clientState) : undefined; return obj; }, @@ -1472,7 +1534,7 @@ export const ClientStateData = { function createBaseConsensusStateData(): ConsensusStateData { return { path: new Uint8Array(), - consensusState: Any.fromPartial({}) + consensusState: undefined }; } export const ConsensusStateData = { @@ -1513,14 +1575,18 @@ export const ConsensusStateData = { return message; }, fromAmino(object: ConsensusStateDataAmino): ConsensusStateData { - return { - path: object.path, - consensusState: object?.consensus_state ? Any.fromAmino(object.consensus_state) : undefined - }; + const message = createBaseConsensusStateData(); + if (object.path !== undefined && object.path !== null) { + message.path = bytesFromBase64(object.path); + } + if (object.consensus_state !== undefined && object.consensus_state !== null) { + message.consensusState = Any.fromAmino(object.consensus_state); + } + return message; }, toAmino(message: ConsensusStateData): ConsensusStateDataAmino { const obj: any = {}; - obj.path = message.path; + obj.path = message.path ? base64FromBytes(message.path) : undefined; obj.consensus_state = message.consensusState ? Any.toAmino(message.consensusState) : undefined; return obj; }, @@ -1549,7 +1615,7 @@ export const ConsensusStateData = { function createBaseConnectionStateData(): ConnectionStateData { return { path: new Uint8Array(), - connection: ConnectionEnd.fromPartial({}) + connection: undefined }; } export const ConnectionStateData = { @@ -1590,14 +1656,18 @@ export const ConnectionStateData = { return message; }, fromAmino(object: ConnectionStateDataAmino): ConnectionStateData { - return { - path: object.path, - connection: object?.connection ? ConnectionEnd.fromAmino(object.connection) : undefined - }; + const message = createBaseConnectionStateData(); + if (object.path !== undefined && object.path !== null) { + message.path = bytesFromBase64(object.path); + } + if (object.connection !== undefined && object.connection !== null) { + message.connection = ConnectionEnd.fromAmino(object.connection); + } + return message; }, toAmino(message: ConnectionStateData): ConnectionStateDataAmino { const obj: any = {}; - obj.path = message.path; + obj.path = message.path ? base64FromBytes(message.path) : undefined; obj.connection = message.connection ? ConnectionEnd.toAmino(message.connection) : undefined; return obj; }, @@ -1626,7 +1696,7 @@ export const ConnectionStateData = { function createBaseChannelStateData(): ChannelStateData { return { path: new Uint8Array(), - channel: Channel.fromPartial({}) + channel: undefined }; } export const ChannelStateData = { @@ -1667,14 +1737,18 @@ export const ChannelStateData = { return message; }, fromAmino(object: ChannelStateDataAmino): ChannelStateData { - return { - path: object.path, - channel: object?.channel ? Channel.fromAmino(object.channel) : undefined - }; + const message = createBaseChannelStateData(); + if (object.path !== undefined && object.path !== null) { + message.path = bytesFromBase64(object.path); + } + if (object.channel !== undefined && object.channel !== null) { + message.channel = Channel.fromAmino(object.channel); + } + return message; }, toAmino(message: ChannelStateData): ChannelStateDataAmino { const obj: any = {}; - obj.path = message.path; + obj.path = message.path ? base64FromBytes(message.path) : undefined; obj.channel = message.channel ? Channel.toAmino(message.channel) : undefined; return obj; }, @@ -1744,15 +1818,19 @@ export const PacketCommitmentData = { return message; }, fromAmino(object: PacketCommitmentDataAmino): PacketCommitmentData { - return { - path: object.path, - commitment: object.commitment - }; + const message = createBasePacketCommitmentData(); + if (object.path !== undefined && object.path !== null) { + message.path = bytesFromBase64(object.path); + } + if (object.commitment !== undefined && object.commitment !== null) { + message.commitment = bytesFromBase64(object.commitment); + } + return message; }, toAmino(message: PacketCommitmentData): PacketCommitmentDataAmino { const obj: any = {}; - obj.path = message.path; - obj.commitment = message.commitment; + obj.path = message.path ? base64FromBytes(message.path) : undefined; + obj.commitment = message.commitment ? base64FromBytes(message.commitment) : undefined; return obj; }, fromAminoMsg(object: PacketCommitmentDataAminoMsg): PacketCommitmentData { @@ -1821,15 +1899,19 @@ export const PacketAcknowledgementData = { return message; }, fromAmino(object: PacketAcknowledgementDataAmino): PacketAcknowledgementData { - return { - path: object.path, - acknowledgement: object.acknowledgement - }; + const message = createBasePacketAcknowledgementData(); + if (object.path !== undefined && object.path !== null) { + message.path = bytesFromBase64(object.path); + } + if (object.acknowledgement !== undefined && object.acknowledgement !== null) { + message.acknowledgement = bytesFromBase64(object.acknowledgement); + } + return message; }, toAmino(message: PacketAcknowledgementData): PacketAcknowledgementDataAmino { const obj: any = {}; - obj.path = message.path; - obj.acknowledgement = message.acknowledgement; + obj.path = message.path ? base64FromBytes(message.path) : undefined; + obj.acknowledgement = message.acknowledgement ? base64FromBytes(message.acknowledgement) : undefined; return obj; }, fromAminoMsg(object: PacketAcknowledgementDataAminoMsg): PacketAcknowledgementData { @@ -1890,13 +1972,15 @@ export const PacketReceiptAbsenceData = { return message; }, fromAmino(object: PacketReceiptAbsenceDataAmino): PacketReceiptAbsenceData { - return { - path: object.path - }; + const message = createBasePacketReceiptAbsenceData(); + if (object.path !== undefined && object.path !== null) { + message.path = bytesFromBase64(object.path); + } + return message; }, toAmino(message: PacketReceiptAbsenceData): PacketReceiptAbsenceDataAmino { const obj: any = {}; - obj.path = message.path; + obj.path = message.path ? base64FromBytes(message.path) : undefined; return obj; }, fromAminoMsg(object: PacketReceiptAbsenceDataAminoMsg): PacketReceiptAbsenceData { @@ -1965,14 +2049,18 @@ export const NextSequenceRecvData = { return message; }, fromAmino(object: NextSequenceRecvDataAmino): NextSequenceRecvData { - return { - path: object.path, - nextSeqRecv: BigInt(object.next_seq_recv) - }; + const message = createBaseNextSequenceRecvData(); + if (object.path !== undefined && object.path !== null) { + message.path = bytesFromBase64(object.path); + } + if (object.next_seq_recv !== undefined && object.next_seq_recv !== null) { + message.nextSeqRecv = BigInt(object.next_seq_recv); + } + return message; }, toAmino(message: NextSequenceRecvData): NextSequenceRecvDataAmino { const obj: any = {}; - obj.path = message.path; + obj.path = message.path ? base64FromBytes(message.path) : undefined; obj.next_seq_recv = message.nextSeqRecv ? message.nextSeqRecv.toString() : undefined; return obj; }, diff --git a/packages/osmo-query/src/codegen/ibc/lightclients/solomachine/v3/solomachine.ts b/packages/osmo-query/src/codegen/ibc/lightclients/solomachine/v3/solomachine.ts index bd9c489bf..6dc1e4427 100644 --- a/packages/osmo-query/src/codegen/ibc/lightclients/solomachine/v3/solomachine.ts +++ b/packages/osmo-query/src/codegen/ibc/lightclients/solomachine/v3/solomachine.ts @@ -1,5 +1,6 @@ import { Any, AnyAmino, AnySDKType } from "../../../../google/protobuf/any"; import { BinaryReader, BinaryWriter } from "../../../../binary"; +import { bytesFromBase64, base64FromBytes } from "../../../../helpers"; /** * ClientState defines a solo machine client that tracks the current consensus * state and if the client is frozen. @@ -9,7 +10,7 @@ export interface ClientState { sequence: bigint; /** frozen sequence of the solo machine */ isFrozen: boolean; - consensusState: ConsensusState; + consensusState?: ConsensusState; } export interface ClientStateProtoMsg { typeUrl: "/ibc.lightclients.solomachine.v3.ClientState"; @@ -21,9 +22,9 @@ export interface ClientStateProtoMsg { */ export interface ClientStateAmino { /** latest sequence of the client state */ - sequence: string; + sequence?: string; /** frozen sequence of the solo machine */ - is_frozen: boolean; + is_frozen?: boolean; consensus_state?: ConsensusStateAmino; } export interface ClientStateAminoMsg { @@ -37,7 +38,7 @@ export interface ClientStateAminoMsg { export interface ClientStateSDKType { sequence: bigint; is_frozen: boolean; - consensus_state: ConsensusStateSDKType; + consensus_state?: ConsensusStateSDKType; } /** * ConsensusState defines a solo machine consensus state. The sequence of a @@ -46,7 +47,7 @@ export interface ClientStateSDKType { */ export interface ConsensusState { /** public key of the solo machine */ - publicKey: Any; + publicKey?: Any; /** * diversifier allows the same public key to be re-used across different solo * machine clients (potentially on different chains) without being considered @@ -72,8 +73,8 @@ export interface ConsensusStateAmino { * machine clients (potentially on different chains) without being considered * misbehaviour. */ - diversifier: string; - timestamp: string; + diversifier?: string; + timestamp?: string; } export interface ConsensusStateAminoMsg { type: "cosmos-sdk/ConsensusState"; @@ -85,7 +86,7 @@ export interface ConsensusStateAminoMsg { * consensus state. */ export interface ConsensusStateSDKType { - public_key: AnySDKType; + public_key?: AnySDKType; diversifier: string; timestamp: bigint; } @@ -93,7 +94,7 @@ export interface ConsensusStateSDKType { export interface Header { timestamp: bigint; signature: Uint8Array; - newPublicKey: Any; + newPublicKey?: Any; newDiversifier: string; } export interface HeaderProtoMsg { @@ -102,10 +103,10 @@ export interface HeaderProtoMsg { } /** Header defines a solo machine consensus header */ export interface HeaderAmino { - timestamp: string; - signature: Uint8Array; + timestamp?: string; + signature?: string; new_public_key?: AnyAmino; - new_diversifier: string; + new_diversifier?: string; } export interface HeaderAminoMsg { type: "cosmos-sdk/Header"; @@ -115,7 +116,7 @@ export interface HeaderAminoMsg { export interface HeaderSDKType { timestamp: bigint; signature: Uint8Array; - new_public_key: AnySDKType; + new_public_key?: AnySDKType; new_diversifier: string; } /** @@ -124,8 +125,8 @@ export interface HeaderSDKType { */ export interface Misbehaviour { sequence: bigint; - signatureOne: SignatureAndData; - signatureTwo: SignatureAndData; + signatureOne?: SignatureAndData; + signatureTwo?: SignatureAndData; } export interface MisbehaviourProtoMsg { typeUrl: "/ibc.lightclients.solomachine.v3.Misbehaviour"; @@ -136,7 +137,7 @@ export interface MisbehaviourProtoMsg { * of a sequence and two signatures over different messages at that sequence. */ export interface MisbehaviourAmino { - sequence: string; + sequence?: string; signature_one?: SignatureAndDataAmino; signature_two?: SignatureAndDataAmino; } @@ -150,8 +151,8 @@ export interface MisbehaviourAminoMsg { */ export interface MisbehaviourSDKType { sequence: bigint; - signature_one: SignatureAndDataSDKType; - signature_two: SignatureAndDataSDKType; + signature_one?: SignatureAndDataSDKType; + signature_two?: SignatureAndDataSDKType; } /** * SignatureAndData contains a signature and the data signed over to create that @@ -172,10 +173,10 @@ export interface SignatureAndDataProtoMsg { * signature. */ export interface SignatureAndDataAmino { - signature: Uint8Array; - path: Uint8Array; - data: Uint8Array; - timestamp: string; + signature?: string; + path?: string; + data?: string; + timestamp?: string; } export interface SignatureAndDataAminoMsg { type: "cosmos-sdk/SignatureAndData"; @@ -208,8 +209,8 @@ export interface TimestampedSignatureDataProtoMsg { * signature. */ export interface TimestampedSignatureDataAmino { - signature_data: Uint8Array; - timestamp: string; + signature_data?: string; + timestamp?: string; } export interface TimestampedSignatureDataAminoMsg { type: "cosmos-sdk/TimestampedSignatureData"; @@ -243,15 +244,15 @@ export interface SignBytesProtoMsg { /** SignBytes defines the signed bytes used for signature verification. */ export interface SignBytesAmino { /** the sequence number */ - sequence: string; + sequence?: string; /** the proof timestamp */ - timestamp: string; + timestamp?: string; /** the public key diversifier */ - diversifier: string; + diversifier?: string; /** the standardised path bytes */ - path: Uint8Array; + path?: string; /** the marshaled data bytes */ - data: Uint8Array; + data?: string; } export interface SignBytesAminoMsg { type: "cosmos-sdk/SignBytes"; @@ -268,7 +269,7 @@ export interface SignBytesSDKType { /** HeaderData returns the SignBytes data for update verification. */ export interface HeaderData { /** header public key */ - newPubKey: Any; + newPubKey?: Any; /** header diversifier */ newDiversifier: string; } @@ -281,7 +282,7 @@ export interface HeaderDataAmino { /** header public key */ new_pub_key?: AnyAmino; /** header diversifier */ - new_diversifier: string; + new_diversifier?: string; } export interface HeaderDataAminoMsg { type: "cosmos-sdk/HeaderData"; @@ -289,14 +290,14 @@ export interface HeaderDataAminoMsg { } /** HeaderData returns the SignBytes data for update verification. */ export interface HeaderDataSDKType { - new_pub_key: AnySDKType; + new_pub_key?: AnySDKType; new_diversifier: string; } function createBaseClientState(): ClientState { return { sequence: BigInt(0), isFrozen: false, - consensusState: ConsensusState.fromPartial({}) + consensusState: undefined }; } export const ClientState = { @@ -344,11 +345,17 @@ export const ClientState = { return message; }, fromAmino(object: ClientStateAmino): ClientState { - return { - sequence: BigInt(object.sequence), - isFrozen: object.is_frozen, - consensusState: object?.consensus_state ? ConsensusState.fromAmino(object.consensus_state) : undefined - }; + const message = createBaseClientState(); + if (object.sequence !== undefined && object.sequence !== null) { + message.sequence = BigInt(object.sequence); + } + if (object.is_frozen !== undefined && object.is_frozen !== null) { + message.isFrozen = object.is_frozen; + } + if (object.consensus_state !== undefined && object.consensus_state !== null) { + message.consensusState = ConsensusState.fromAmino(object.consensus_state); + } + return message; }, toAmino(message: ClientState): ClientStateAmino { const obj: any = {}; @@ -381,7 +388,7 @@ export const ClientState = { }; function createBaseConsensusState(): ConsensusState { return { - publicKey: Any.fromPartial({}), + publicKey: undefined, diversifier: "", timestamp: BigInt(0) }; @@ -431,11 +438,17 @@ export const ConsensusState = { return message; }, fromAmino(object: ConsensusStateAmino): ConsensusState { - return { - publicKey: object?.public_key ? Any.fromAmino(object.public_key) : undefined, - diversifier: object.diversifier, - timestamp: BigInt(object.timestamp) - }; + const message = createBaseConsensusState(); + if (object.public_key !== undefined && object.public_key !== null) { + message.publicKey = Any.fromAmino(object.public_key); + } + if (object.diversifier !== undefined && object.diversifier !== null) { + message.diversifier = object.diversifier; + } + if (object.timestamp !== undefined && object.timestamp !== null) { + message.timestamp = BigInt(object.timestamp); + } + return message; }, toAmino(message: ConsensusState): ConsensusStateAmino { const obj: any = {}; @@ -470,7 +483,7 @@ function createBaseHeader(): Header { return { timestamp: BigInt(0), signature: new Uint8Array(), - newPublicKey: Any.fromPartial({}), + newPublicKey: undefined, newDiversifier: "" }; } @@ -526,17 +539,25 @@ export const Header = { return message; }, fromAmino(object: HeaderAmino): Header { - return { - timestamp: BigInt(object.timestamp), - signature: object.signature, - newPublicKey: object?.new_public_key ? Any.fromAmino(object.new_public_key) : undefined, - newDiversifier: object.new_diversifier - }; + const message = createBaseHeader(); + if (object.timestamp !== undefined && object.timestamp !== null) { + message.timestamp = BigInt(object.timestamp); + } + if (object.signature !== undefined && object.signature !== null) { + message.signature = bytesFromBase64(object.signature); + } + if (object.new_public_key !== undefined && object.new_public_key !== null) { + message.newPublicKey = Any.fromAmino(object.new_public_key); + } + if (object.new_diversifier !== undefined && object.new_diversifier !== null) { + message.newDiversifier = object.new_diversifier; + } + return message; }, toAmino(message: Header): HeaderAmino { const obj: any = {}; obj.timestamp = message.timestamp ? message.timestamp.toString() : undefined; - obj.signature = message.signature; + obj.signature = message.signature ? base64FromBytes(message.signature) : undefined; obj.new_public_key = message.newPublicKey ? Any.toAmino(message.newPublicKey) : undefined; obj.new_diversifier = message.newDiversifier; return obj; @@ -566,8 +587,8 @@ export const Header = { function createBaseMisbehaviour(): Misbehaviour { return { sequence: BigInt(0), - signatureOne: SignatureAndData.fromPartial({}), - signatureTwo: SignatureAndData.fromPartial({}) + signatureOne: undefined, + signatureTwo: undefined }; } export const Misbehaviour = { @@ -615,11 +636,17 @@ export const Misbehaviour = { return message; }, fromAmino(object: MisbehaviourAmino): Misbehaviour { - return { - sequence: BigInt(object.sequence), - signatureOne: object?.signature_one ? SignatureAndData.fromAmino(object.signature_one) : undefined, - signatureTwo: object?.signature_two ? SignatureAndData.fromAmino(object.signature_two) : undefined - }; + const message = createBaseMisbehaviour(); + if (object.sequence !== undefined && object.sequence !== null) { + message.sequence = BigInt(object.sequence); + } + if (object.signature_one !== undefined && object.signature_one !== null) { + message.signatureOne = SignatureAndData.fromAmino(object.signature_one); + } + if (object.signature_two !== undefined && object.signature_two !== null) { + message.signatureTwo = SignatureAndData.fromAmino(object.signature_two); + } + return message; }, toAmino(message: Misbehaviour): MisbehaviourAmino { const obj: any = {}; @@ -710,18 +737,26 @@ export const SignatureAndData = { return message; }, fromAmino(object: SignatureAndDataAmino): SignatureAndData { - return { - signature: object.signature, - path: object.path, - data: object.data, - timestamp: BigInt(object.timestamp) - }; + const message = createBaseSignatureAndData(); + if (object.signature !== undefined && object.signature !== null) { + message.signature = bytesFromBase64(object.signature); + } + if (object.path !== undefined && object.path !== null) { + message.path = bytesFromBase64(object.path); + } + if (object.data !== undefined && object.data !== null) { + message.data = bytesFromBase64(object.data); + } + if (object.timestamp !== undefined && object.timestamp !== null) { + message.timestamp = BigInt(object.timestamp); + } + return message; }, toAmino(message: SignatureAndData): SignatureAndDataAmino { const obj: any = {}; - obj.signature = message.signature; - obj.path = message.path; - obj.data = message.data; + obj.signature = message.signature ? base64FromBytes(message.signature) : undefined; + obj.path = message.path ? base64FromBytes(message.path) : undefined; + obj.data = message.data ? base64FromBytes(message.data) : undefined; obj.timestamp = message.timestamp ? message.timestamp.toString() : undefined; return obj; }, @@ -791,14 +826,18 @@ export const TimestampedSignatureData = { return message; }, fromAmino(object: TimestampedSignatureDataAmino): TimestampedSignatureData { - return { - signatureData: object.signature_data, - timestamp: BigInt(object.timestamp) - }; + const message = createBaseTimestampedSignatureData(); + if (object.signature_data !== undefined && object.signature_data !== null) { + message.signatureData = bytesFromBase64(object.signature_data); + } + if (object.timestamp !== undefined && object.timestamp !== null) { + message.timestamp = BigInt(object.timestamp); + } + return message; }, toAmino(message: TimestampedSignatureData): TimestampedSignatureDataAmino { const obj: any = {}; - obj.signature_data = message.signatureData; + obj.signature_data = message.signatureData ? base64FromBytes(message.signatureData) : undefined; obj.timestamp = message.timestamp ? message.timestamp.toString() : undefined; return obj; }, @@ -892,21 +931,31 @@ export const SignBytes = { return message; }, fromAmino(object: SignBytesAmino): SignBytes { - return { - sequence: BigInt(object.sequence), - timestamp: BigInt(object.timestamp), - diversifier: object.diversifier, - path: object.path, - data: object.data - }; + const message = createBaseSignBytes(); + if (object.sequence !== undefined && object.sequence !== null) { + message.sequence = BigInt(object.sequence); + } + if (object.timestamp !== undefined && object.timestamp !== null) { + message.timestamp = BigInt(object.timestamp); + } + if (object.diversifier !== undefined && object.diversifier !== null) { + message.diversifier = object.diversifier; + } + if (object.path !== undefined && object.path !== null) { + message.path = bytesFromBase64(object.path); + } + if (object.data !== undefined && object.data !== null) { + message.data = bytesFromBase64(object.data); + } + return message; }, toAmino(message: SignBytes): SignBytesAmino { const obj: any = {}; obj.sequence = message.sequence ? message.sequence.toString() : undefined; obj.timestamp = message.timestamp ? message.timestamp.toString() : undefined; obj.diversifier = message.diversifier; - obj.path = message.path; - obj.data = message.data; + obj.path = message.path ? base64FromBytes(message.path) : undefined; + obj.data = message.data ? base64FromBytes(message.data) : undefined; return obj; }, fromAminoMsg(object: SignBytesAminoMsg): SignBytes { @@ -933,7 +982,7 @@ export const SignBytes = { }; function createBaseHeaderData(): HeaderData { return { - newPubKey: Any.fromPartial({}), + newPubKey: undefined, newDiversifier: "" }; } @@ -975,10 +1024,14 @@ export const HeaderData = { return message; }, fromAmino(object: HeaderDataAmino): HeaderData { - return { - newPubKey: object?.new_pub_key ? Any.fromAmino(object.new_pub_key) : undefined, - newDiversifier: object.new_diversifier - }; + const message = createBaseHeaderData(); + if (object.new_pub_key !== undefined && object.new_pub_key !== null) { + message.newPubKey = Any.fromAmino(object.new_pub_key); + } + if (object.new_diversifier !== undefined && object.new_diversifier !== null) { + message.newDiversifier = object.new_diversifier; + } + return message; }, toAmino(message: HeaderData): HeaderDataAmino { const obj: any = {}; diff --git a/packages/osmo-query/src/codegen/ibc/lightclients/tendermint/v1/tendermint.ts b/packages/osmo-query/src/codegen/ibc/lightclients/tendermint/v1/tendermint.ts index 2c2a798e1..3ed348525 100644 --- a/packages/osmo-query/src/codegen/ibc/lightclients/tendermint/v1/tendermint.ts +++ b/packages/osmo-query/src/codegen/ibc/lightclients/tendermint/v1/tendermint.ts @@ -6,7 +6,7 @@ import { MerkleRoot, MerkleRootAmino, MerkleRootSDKType } from "../../../core/co import { SignedHeader, SignedHeaderAmino, SignedHeaderSDKType } from "../../../../tendermint/types/types"; import { ValidatorSet, ValidatorSetAmino, ValidatorSetSDKType } from "../../../../tendermint/types/validator"; import { BinaryReader, BinaryWriter } from "../../../../binary"; -import { toTimestamp, fromTimestamp } from "../../../../helpers"; +import { toTimestamp, fromTimestamp, bytesFromBase64, base64FromBytes } from "../../../../helpers"; /** * ClientState from Tendermint tracks the current validator set, latest height, * and a possible frozen height. @@ -55,7 +55,7 @@ export interface ClientStateProtoMsg { * and a possible frozen height. */ export interface ClientStateAmino { - chain_id: string; + chain_id?: string; trust_level?: FractionAmino; /** * duration of the period since the LastestTimestamp during which the @@ -71,7 +71,7 @@ export interface ClientStateAmino { /** Latest height the client was updated to */ latest_height?: HeightAmino; /** Proof specifications used in verifying counterparty state */ - proof_specs: ProofSpecAmino[]; + proof_specs?: ProofSpecAmino[]; /** * Path at which next upgraded client will be committed. * Each element corresponds to the key for a single CommitmentProof in the @@ -81,13 +81,13 @@ export interface ClientStateAmino { * the default upgrade module, upgrade_path should be []string{"upgrade", * "upgradedIBCState"}` */ - upgrade_path: string[]; + upgrade_path?: string[]; /** allow_update_after_expiry is deprecated */ /** @deprecated */ - allow_update_after_expiry: boolean; + allow_update_after_expiry?: boolean; /** allow_update_after_misbehaviour is deprecated */ /** @deprecated */ - allow_update_after_misbehaviour: boolean; + allow_update_after_misbehaviour?: boolean; } export interface ClientStateAminoMsg { type: "cosmos-sdk/ClientState"; @@ -133,10 +133,10 @@ export interface ConsensusStateAmino { * timestamp that corresponds to the block height in which the ConsensusState * was stored. */ - timestamp?: Date; + timestamp?: string; /** commitment root (i.e app hash) */ root?: MerkleRootAmino; - next_validators_hash: Uint8Array; + next_validators_hash?: string; } export interface ConsensusStateAminoMsg { type: "cosmos-sdk/ConsensusState"; @@ -156,8 +156,8 @@ export interface Misbehaviour { /** ClientID is deprecated */ /** @deprecated */ clientId: string; - header1: Header; - header2: Header; + header1?: Header; + header2?: Header; } export interface MisbehaviourProtoMsg { typeUrl: "/ibc.lightclients.tendermint.v1.Misbehaviour"; @@ -170,7 +170,7 @@ export interface MisbehaviourProtoMsg { export interface MisbehaviourAmino { /** ClientID is deprecated */ /** @deprecated */ - client_id: string; + client_id?: string; header_1?: HeaderAmino; header_2?: HeaderAmino; } @@ -185,8 +185,8 @@ export interface MisbehaviourAminoMsg { export interface MisbehaviourSDKType { /** @deprecated */ client_id: string; - header_1: HeaderSDKType; - header_2: HeaderSDKType; + header_1?: HeaderSDKType; + header_2?: HeaderSDKType; } /** * Header defines the Tendermint client consensus Header. @@ -203,10 +203,10 @@ export interface MisbehaviourSDKType { * trusted validator set at the TrustedHeight. */ export interface Header { - signedHeader: SignedHeader; - validatorSet: ValidatorSet; + signedHeader?: SignedHeader; + validatorSet?: ValidatorSet; trustedHeight: Height; - trustedValidators: ValidatorSet; + trustedValidators?: ValidatorSet; } export interface HeaderProtoMsg { typeUrl: "/ibc.lightclients.tendermint.v1.Header"; @@ -251,10 +251,10 @@ export interface HeaderAminoMsg { * trusted validator set at the TrustedHeight. */ export interface HeaderSDKType { - signed_header: SignedHeaderSDKType; - validator_set: ValidatorSetSDKType; + signed_header?: SignedHeaderSDKType; + validator_set?: ValidatorSetSDKType; trusted_height: HeightSDKType; - trusted_validators: ValidatorSetSDKType; + trusted_validators?: ValidatorSetSDKType; } /** * Fraction defines the protobuf message type for tmmath.Fraction that only @@ -273,8 +273,8 @@ export interface FractionProtoMsg { * supports positive values. */ export interface FractionAmino { - numerator: string; - denominator: string; + numerator?: string; + denominator?: string; } export interface FractionAminoMsg { type: "cosmos-sdk/Fraction"; @@ -404,19 +404,37 @@ export const ClientState = { return message; }, fromAmino(object: ClientStateAmino): ClientState { - return { - chainId: object.chain_id, - trustLevel: object?.trust_level ? Fraction.fromAmino(object.trust_level) : undefined, - trustingPeriod: object?.trusting_period ? Duration.fromAmino(object.trusting_period) : undefined, - unbondingPeriod: object?.unbonding_period ? Duration.fromAmino(object.unbonding_period) : undefined, - maxClockDrift: object?.max_clock_drift ? Duration.fromAmino(object.max_clock_drift) : undefined, - frozenHeight: object?.frozen_height ? Height.fromAmino(object.frozen_height) : undefined, - latestHeight: object?.latest_height ? Height.fromAmino(object.latest_height) : undefined, - proofSpecs: Array.isArray(object?.proof_specs) ? object.proof_specs.map((e: any) => ProofSpec.fromAmino(e)) : [], - upgradePath: Array.isArray(object?.upgrade_path) ? object.upgrade_path.map((e: any) => e) : [], - allowUpdateAfterExpiry: object.allow_update_after_expiry, - allowUpdateAfterMisbehaviour: object.allow_update_after_misbehaviour - }; + const message = createBaseClientState(); + if (object.chain_id !== undefined && object.chain_id !== null) { + message.chainId = object.chain_id; + } + if (object.trust_level !== undefined && object.trust_level !== null) { + message.trustLevel = Fraction.fromAmino(object.trust_level); + } + if (object.trusting_period !== undefined && object.trusting_period !== null) { + message.trustingPeriod = Duration.fromAmino(object.trusting_period); + } + if (object.unbonding_period !== undefined && object.unbonding_period !== null) { + message.unbondingPeriod = Duration.fromAmino(object.unbonding_period); + } + if (object.max_clock_drift !== undefined && object.max_clock_drift !== null) { + message.maxClockDrift = Duration.fromAmino(object.max_clock_drift); + } + if (object.frozen_height !== undefined && object.frozen_height !== null) { + message.frozenHeight = Height.fromAmino(object.frozen_height); + } + if (object.latest_height !== undefined && object.latest_height !== null) { + message.latestHeight = Height.fromAmino(object.latest_height); + } + message.proofSpecs = object.proof_specs?.map(e => ProofSpec.fromAmino(e)) || []; + message.upgradePath = object.upgrade_path?.map(e => e) || []; + if (object.allow_update_after_expiry !== undefined && object.allow_update_after_expiry !== null) { + message.allowUpdateAfterExpiry = object.allow_update_after_expiry; + } + if (object.allow_update_after_misbehaviour !== undefined && object.allow_update_after_misbehaviour !== null) { + message.allowUpdateAfterMisbehaviour = object.allow_update_after_misbehaviour; + } + return message; }, toAmino(message: ClientState): ClientStateAmino { const obj: any = {}; @@ -515,17 +533,23 @@ export const ConsensusState = { return message; }, fromAmino(object: ConsensusStateAmino): ConsensusState { - return { - timestamp: object.timestamp, - root: object?.root ? MerkleRoot.fromAmino(object.root) : undefined, - nextValidatorsHash: object.next_validators_hash - }; + const message = createBaseConsensusState(); + if (object.timestamp !== undefined && object.timestamp !== null) { + message.timestamp = fromTimestamp(Timestamp.fromAmino(object.timestamp)); + } + if (object.root !== undefined && object.root !== null) { + message.root = MerkleRoot.fromAmino(object.root); + } + if (object.next_validators_hash !== undefined && object.next_validators_hash !== null) { + message.nextValidatorsHash = bytesFromBase64(object.next_validators_hash); + } + return message; }, toAmino(message: ConsensusState): ConsensusStateAmino { const obj: any = {}; - obj.timestamp = message.timestamp; + obj.timestamp = message.timestamp ? Timestamp.toAmino(toTimestamp(message.timestamp)) : undefined; obj.root = message.root ? MerkleRoot.toAmino(message.root) : undefined; - obj.next_validators_hash = message.nextValidatorsHash; + obj.next_validators_hash = message.nextValidatorsHash ? base64FromBytes(message.nextValidatorsHash) : undefined; return obj; }, fromAminoMsg(object: ConsensusStateAminoMsg): ConsensusState { @@ -553,8 +577,8 @@ export const ConsensusState = { function createBaseMisbehaviour(): Misbehaviour { return { clientId: "", - header1: Header.fromPartial({}), - header2: Header.fromPartial({}) + header1: undefined, + header2: undefined }; } export const Misbehaviour = { @@ -602,11 +626,17 @@ export const Misbehaviour = { return message; }, fromAmino(object: MisbehaviourAmino): Misbehaviour { - return { - clientId: object.client_id, - header1: object?.header_1 ? Header.fromAmino(object.header_1) : undefined, - header2: object?.header_2 ? Header.fromAmino(object.header_2) : undefined - }; + const message = createBaseMisbehaviour(); + if (object.client_id !== undefined && object.client_id !== null) { + message.clientId = object.client_id; + } + if (object.header_1 !== undefined && object.header_1 !== null) { + message.header1 = Header.fromAmino(object.header_1); + } + if (object.header_2 !== undefined && object.header_2 !== null) { + message.header2 = Header.fromAmino(object.header_2); + } + return message; }, toAmino(message: Misbehaviour): MisbehaviourAmino { const obj: any = {}; @@ -639,10 +669,10 @@ export const Misbehaviour = { }; function createBaseHeader(): Header { return { - signedHeader: SignedHeader.fromPartial({}), - validatorSet: ValidatorSet.fromPartial({}), + signedHeader: undefined, + validatorSet: undefined, trustedHeight: Height.fromPartial({}), - trustedValidators: ValidatorSet.fromPartial({}) + trustedValidators: undefined }; } export const Header = { @@ -697,12 +727,20 @@ export const Header = { return message; }, fromAmino(object: HeaderAmino): Header { - return { - signedHeader: object?.signed_header ? SignedHeader.fromAmino(object.signed_header) : undefined, - validatorSet: object?.validator_set ? ValidatorSet.fromAmino(object.validator_set) : undefined, - trustedHeight: object?.trusted_height ? Height.fromAmino(object.trusted_height) : undefined, - trustedValidators: object?.trusted_validators ? ValidatorSet.fromAmino(object.trusted_validators) : undefined - }; + const message = createBaseHeader(); + if (object.signed_header !== undefined && object.signed_header !== null) { + message.signedHeader = SignedHeader.fromAmino(object.signed_header); + } + if (object.validator_set !== undefined && object.validator_set !== null) { + message.validatorSet = ValidatorSet.fromAmino(object.validator_set); + } + if (object.trusted_height !== undefined && object.trusted_height !== null) { + message.trustedHeight = Height.fromAmino(object.trusted_height); + } + if (object.trusted_validators !== undefined && object.trusted_validators !== null) { + message.trustedValidators = ValidatorSet.fromAmino(object.trusted_validators); + } + return message; }, toAmino(message: Header): HeaderAmino { const obj: any = {}; @@ -778,10 +816,14 @@ export const Fraction = { return message; }, fromAmino(object: FractionAmino): Fraction { - return { - numerator: BigInt(object.numerator), - denominator: BigInt(object.denominator) - }; + const message = createBaseFraction(); + if (object.numerator !== undefined && object.numerator !== null) { + message.numerator = BigInt(object.numerator); + } + if (object.denominator !== undefined && object.denominator !== null) { + message.denominator = BigInt(object.denominator); + } + return message; }, toAmino(message: Fraction): FractionAmino { const obj: any = {}; diff --git a/packages/osmo-query/src/codegen/ibc/lightclients/wasm/v1/genesis.ts b/packages/osmo-query/src/codegen/ibc/lightclients/wasm/v1/genesis.ts new file mode 100644 index 000000000..8670e1d93 --- /dev/null +++ b/packages/osmo-query/src/codegen/ibc/lightclients/wasm/v1/genesis.ts @@ -0,0 +1,186 @@ +import { BinaryReader, BinaryWriter } from "../../../../binary"; +import { bytesFromBase64, base64FromBytes } from "../../../../helpers"; +/** GenesisState defines 08-wasm's keeper genesis state */ +export interface GenesisState { + /** uploaded light client wasm contracts */ + contracts: Contract[]; +} +export interface GenesisStateProtoMsg { + typeUrl: "/ibc.lightclients.wasm.v1.GenesisState"; + value: Uint8Array; +} +/** GenesisState defines 08-wasm's keeper genesis state */ +export interface GenesisStateAmino { + /** uploaded light client wasm contracts */ + contracts?: ContractAmino[]; +} +export interface GenesisStateAminoMsg { + type: "cosmos-sdk/GenesisState"; + value: GenesisStateAmino; +} +/** GenesisState defines 08-wasm's keeper genesis state */ +export interface GenesisStateSDKType { + contracts: ContractSDKType[]; +} +/** Contract stores contract code */ +export interface Contract { + /** contract byte code */ + codeBytes: Uint8Array; +} +export interface ContractProtoMsg { + typeUrl: "/ibc.lightclients.wasm.v1.Contract"; + value: Uint8Array; +} +/** Contract stores contract code */ +export interface ContractAmino { + /** contract byte code */ + code_bytes?: string; +} +export interface ContractAminoMsg { + type: "cosmos-sdk/Contract"; + value: ContractAmino; +} +/** Contract stores contract code */ +export interface ContractSDKType { + code_bytes: Uint8Array; +} +function createBaseGenesisState(): GenesisState { + return { + contracts: [] + }; +} +export const GenesisState = { + typeUrl: "/ibc.lightclients.wasm.v1.GenesisState", + encode(message: GenesisState, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.contracts) { + Contract.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): GenesisState { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGenesisState(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.contracts.push(Contract.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): GenesisState { + const message = createBaseGenesisState(); + message.contracts = object.contracts?.map(e => Contract.fromPartial(e)) || []; + return message; + }, + fromAmino(object: GenesisStateAmino): GenesisState { + const message = createBaseGenesisState(); + message.contracts = object.contracts?.map(e => Contract.fromAmino(e)) || []; + return message; + }, + toAmino(message: GenesisState): GenesisStateAmino { + const obj: any = {}; + if (message.contracts) { + obj.contracts = message.contracts.map(e => e ? Contract.toAmino(e) : undefined); + } else { + obj.contracts = []; + } + return obj; + }, + fromAminoMsg(object: GenesisStateAminoMsg): GenesisState { + return GenesisState.fromAmino(object.value); + }, + toAminoMsg(message: GenesisState): GenesisStateAminoMsg { + return { + type: "cosmos-sdk/GenesisState", + value: GenesisState.toAmino(message) + }; + }, + fromProtoMsg(message: GenesisStateProtoMsg): GenesisState { + return GenesisState.decode(message.value); + }, + toProto(message: GenesisState): Uint8Array { + return GenesisState.encode(message).finish(); + }, + toProtoMsg(message: GenesisState): GenesisStateProtoMsg { + return { + typeUrl: "/ibc.lightclients.wasm.v1.GenesisState", + value: GenesisState.encode(message).finish() + }; + } +}; +function createBaseContract(): Contract { + return { + codeBytes: new Uint8Array() + }; +} +export const Contract = { + typeUrl: "/ibc.lightclients.wasm.v1.Contract", + encode(message: Contract, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.codeBytes.length !== 0) { + writer.uint32(10).bytes(message.codeBytes); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): Contract { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseContract(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.codeBytes = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): Contract { + const message = createBaseContract(); + message.codeBytes = object.codeBytes ?? new Uint8Array(); + return message; + }, + fromAmino(object: ContractAmino): Contract { + const message = createBaseContract(); + if (object.code_bytes !== undefined && object.code_bytes !== null) { + message.codeBytes = bytesFromBase64(object.code_bytes); + } + return message; + }, + toAmino(message: Contract): ContractAmino { + const obj: any = {}; + obj.code_bytes = message.codeBytes ? base64FromBytes(message.codeBytes) : undefined; + return obj; + }, + fromAminoMsg(object: ContractAminoMsg): Contract { + return Contract.fromAmino(object.value); + }, + toAminoMsg(message: Contract): ContractAminoMsg { + return { + type: "cosmos-sdk/Contract", + value: Contract.toAmino(message) + }; + }, + fromProtoMsg(message: ContractProtoMsg): Contract { + return Contract.decode(message.value); + }, + toProto(message: Contract): Uint8Array { + return Contract.encode(message).finish(); + }, + toProtoMsg(message: Contract): ContractProtoMsg { + return { + typeUrl: "/ibc.lightclients.wasm.v1.Contract", + value: Contract.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/packages/osmo-query/src/codegen/ibc/lightclients/wasm/v1/query.lcd.ts b/packages/osmo-query/src/codegen/ibc/lightclients/wasm/v1/query.lcd.ts new file mode 100644 index 000000000..df9dd94a1 --- /dev/null +++ b/packages/osmo-query/src/codegen/ibc/lightclients/wasm/v1/query.lcd.ts @@ -0,0 +1,33 @@ +import { setPaginationParams } from "../../../../helpers"; +import { LCDClient } from "@cosmology/lcd"; +import { QueryChecksumsRequest, QueryChecksumsResponseSDKType, QueryCodeRequest, QueryCodeResponseSDKType } from "./query"; +export class LCDQueryClient { + req: LCDClient; + constructor({ + requestClient + }: { + requestClient: LCDClient; + }) { + this.req = requestClient; + this.checksums = this.checksums.bind(this); + this.code = this.code.bind(this); + } + /* Get all Wasm checksums */ + async checksums(params: QueryChecksumsRequest = { + pagination: undefined + }): Promise { + const options: any = { + params: {} + }; + if (typeof params?.pagination !== "undefined") { + setPaginationParams(options, params.pagination); + } + const endpoint = `ibc/lightclients/wasm/v1/checksums`; + return await this.req.get(endpoint, options); + } + /* Get Wasm code for given checksum */ + async code(params: QueryCodeRequest): Promise { + const endpoint = `ibc/lightclients/wasm/v1/checksums/${params.checksum}/code`; + return await this.req.get(endpoint); + } +} \ No newline at end of file diff --git a/packages/osmo-query/src/codegen/ibc/lightclients/wasm/v1/query.rpc.Query.ts b/packages/osmo-query/src/codegen/ibc/lightclients/wasm/v1/query.rpc.Query.ts new file mode 100644 index 000000000..41f09d62d --- /dev/null +++ b/packages/osmo-query/src/codegen/ibc/lightclients/wasm/v1/query.rpc.Query.ts @@ -0,0 +1,86 @@ +import { Rpc } from "../../../../helpers"; +import { BinaryReader } from "../../../../binary"; +import { QueryClient, createProtobufRpcClient, ProtobufRpcClient } from "@cosmjs/stargate"; +import { ReactQueryParams } from "../../../../react-query"; +import { useQuery } from "@tanstack/react-query"; +import { QueryChecksumsRequest, QueryChecksumsResponse, QueryCodeRequest, QueryCodeResponse } from "./query"; +/** Query service for wasm module */ +export interface Query { + /** Get all Wasm checksums */ + checksums(request?: QueryChecksumsRequest): Promise; + /** Get Wasm code for given checksum */ + code(request: QueryCodeRequest): Promise; +} +export class QueryClientImpl implements Query { + private readonly rpc: Rpc; + constructor(rpc: Rpc) { + this.rpc = rpc; + this.checksums = this.checksums.bind(this); + this.code = this.code.bind(this); + } + checksums(request: QueryChecksumsRequest = { + pagination: undefined + }): Promise { + const data = QueryChecksumsRequest.encode(request).finish(); + const promise = this.rpc.request("ibc.lightclients.wasm.v1.Query", "Checksums", data); + return promise.then(data => QueryChecksumsResponse.decode(new BinaryReader(data))); + } + code(request: QueryCodeRequest): Promise { + const data = QueryCodeRequest.encode(request).finish(); + const promise = this.rpc.request("ibc.lightclients.wasm.v1.Query", "Code", data); + return promise.then(data => QueryCodeResponse.decode(new BinaryReader(data))); + } +} +export const createRpcQueryExtension = (base: QueryClient) => { + const rpc = createProtobufRpcClient(base); + const queryService = new QueryClientImpl(rpc); + return { + checksums(request?: QueryChecksumsRequest): Promise { + return queryService.checksums(request); + }, + code(request: QueryCodeRequest): Promise { + return queryService.code(request); + } + }; +}; +export interface UseChecksumsQuery extends ReactQueryParams { + request?: QueryChecksumsRequest; +} +export interface UseCodeQuery extends ReactQueryParams { + request: QueryCodeRequest; +} +const _queryClients: WeakMap = new WeakMap(); +const getQueryService = (rpc: ProtobufRpcClient | undefined): QueryClientImpl | undefined => { + if (!rpc) return; + if (_queryClients.has(rpc)) { + return _queryClients.get(rpc); + } + const queryService = new QueryClientImpl(rpc); + _queryClients.set(rpc, queryService); + return queryService; +}; +export const createRpcQueryHooks = (rpc: ProtobufRpcClient | undefined) => { + const queryService = getQueryService(rpc); + const useChecksums = ({ + request, + options + }: UseChecksumsQuery) => { + return useQuery(["checksumsQuery", request], () => { + if (!queryService) throw new Error("Query Service not initialized"); + return queryService.checksums(request); + }, options); + }; + const useCode = ({ + request, + options + }: UseCodeQuery) => { + return useQuery(["codeQuery", request], () => { + if (!queryService) throw new Error("Query Service not initialized"); + return queryService.code(request); + }, options); + }; + return { + /** Get all Wasm checksums */useChecksums, + /** Get Wasm code for given checksum */useCode + }; +}; \ No newline at end of file diff --git a/packages/osmo-query/src/codegen/ibc/lightclients/wasm/v1/query.ts b/packages/osmo-query/src/codegen/ibc/lightclients/wasm/v1/query.ts new file mode 100644 index 000000000..a6ad6ae1b --- /dev/null +++ b/packages/osmo-query/src/codegen/ibc/lightclients/wasm/v1/query.ts @@ -0,0 +1,384 @@ +import { PageRequest, PageRequestAmino, PageRequestSDKType, PageResponse, PageResponseAmino, PageResponseSDKType } from "../../../../cosmos/base/query/v1beta1/pagination"; +import { BinaryReader, BinaryWriter } from "../../../../binary"; +import { bytesFromBase64, base64FromBytes } from "../../../../helpers"; +/** QueryChecksumsRequest is the request type for the Query/Checksums RPC method. */ +export interface QueryChecksumsRequest { + /** pagination defines an optional pagination for the request. */ + pagination?: PageRequest; +} +export interface QueryChecksumsRequestProtoMsg { + typeUrl: "/ibc.lightclients.wasm.v1.QueryChecksumsRequest"; + value: Uint8Array; +} +/** QueryChecksumsRequest is the request type for the Query/Checksums RPC method. */ +export interface QueryChecksumsRequestAmino { + /** pagination defines an optional pagination for the request. */ + pagination?: PageRequestAmino; +} +export interface QueryChecksumsRequestAminoMsg { + type: "cosmos-sdk/QueryChecksumsRequest"; + value: QueryChecksumsRequestAmino; +} +/** QueryChecksumsRequest is the request type for the Query/Checksums RPC method. */ +export interface QueryChecksumsRequestSDKType { + pagination?: PageRequestSDKType; +} +/** QueryChecksumsResponse is the response type for the Query/Checksums RPC method. */ +export interface QueryChecksumsResponse { + /** checksums is a list of the hex encoded checksums of all wasm codes stored. */ + checksums: string[]; + /** pagination defines the pagination in the response. */ + pagination?: PageResponse; +} +export interface QueryChecksumsResponseProtoMsg { + typeUrl: "/ibc.lightclients.wasm.v1.QueryChecksumsResponse"; + value: Uint8Array; +} +/** QueryChecksumsResponse is the response type for the Query/Checksums RPC method. */ +export interface QueryChecksumsResponseAmino { + /** checksums is a list of the hex encoded checksums of all wasm codes stored. */ + checksums?: string[]; + /** pagination defines the pagination in the response. */ + pagination?: PageResponseAmino; +} +export interface QueryChecksumsResponseAminoMsg { + type: "cosmos-sdk/QueryChecksumsResponse"; + value: QueryChecksumsResponseAmino; +} +/** QueryChecksumsResponse is the response type for the Query/Checksums RPC method. */ +export interface QueryChecksumsResponseSDKType { + checksums: string[]; + pagination?: PageResponseSDKType; +} +/** QueryCodeRequest is the request type for the Query/Code RPC method. */ +export interface QueryCodeRequest { + /** checksum is a hex encoded string of the code stored. */ + checksum: string; +} +export interface QueryCodeRequestProtoMsg { + typeUrl: "/ibc.lightclients.wasm.v1.QueryCodeRequest"; + value: Uint8Array; +} +/** QueryCodeRequest is the request type for the Query/Code RPC method. */ +export interface QueryCodeRequestAmino { + /** checksum is a hex encoded string of the code stored. */ + checksum?: string; +} +export interface QueryCodeRequestAminoMsg { + type: "cosmos-sdk/QueryCodeRequest"; + value: QueryCodeRequestAmino; +} +/** QueryCodeRequest is the request type for the Query/Code RPC method. */ +export interface QueryCodeRequestSDKType { + checksum: string; +} +/** QueryCodeResponse is the response type for the Query/Code RPC method. */ +export interface QueryCodeResponse { + data: Uint8Array; +} +export interface QueryCodeResponseProtoMsg { + typeUrl: "/ibc.lightclients.wasm.v1.QueryCodeResponse"; + value: Uint8Array; +} +/** QueryCodeResponse is the response type for the Query/Code RPC method. */ +export interface QueryCodeResponseAmino { + data?: string; +} +export interface QueryCodeResponseAminoMsg { + type: "cosmos-sdk/QueryCodeResponse"; + value: QueryCodeResponseAmino; +} +/** QueryCodeResponse is the response type for the Query/Code RPC method. */ +export interface QueryCodeResponseSDKType { + data: Uint8Array; +} +function createBaseQueryChecksumsRequest(): QueryChecksumsRequest { + return { + pagination: undefined + }; +} +export const QueryChecksumsRequest = { + typeUrl: "/ibc.lightclients.wasm.v1.QueryChecksumsRequest", + encode(message: QueryChecksumsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.pagination !== undefined) { + PageRequest.encode(message.pagination, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryChecksumsRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryChecksumsRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.pagination = PageRequest.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryChecksumsRequest { + const message = createBaseQueryChecksumsRequest(); + message.pagination = object.pagination !== undefined && object.pagination !== null ? PageRequest.fromPartial(object.pagination) : undefined; + return message; + }, + fromAmino(object: QueryChecksumsRequestAmino): QueryChecksumsRequest { + const message = createBaseQueryChecksumsRequest(); + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromAmino(object.pagination); + } + return message; + }, + toAmino(message: QueryChecksumsRequest): QueryChecksumsRequestAmino { + const obj: any = {}; + obj.pagination = message.pagination ? PageRequest.toAmino(message.pagination) : undefined; + return obj; + }, + fromAminoMsg(object: QueryChecksumsRequestAminoMsg): QueryChecksumsRequest { + return QueryChecksumsRequest.fromAmino(object.value); + }, + toAminoMsg(message: QueryChecksumsRequest): QueryChecksumsRequestAminoMsg { + return { + type: "cosmos-sdk/QueryChecksumsRequest", + value: QueryChecksumsRequest.toAmino(message) + }; + }, + fromProtoMsg(message: QueryChecksumsRequestProtoMsg): QueryChecksumsRequest { + return QueryChecksumsRequest.decode(message.value); + }, + toProto(message: QueryChecksumsRequest): Uint8Array { + return QueryChecksumsRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryChecksumsRequest): QueryChecksumsRequestProtoMsg { + return { + typeUrl: "/ibc.lightclients.wasm.v1.QueryChecksumsRequest", + value: QueryChecksumsRequest.encode(message).finish() + }; + } +}; +function createBaseQueryChecksumsResponse(): QueryChecksumsResponse { + return { + checksums: [], + pagination: undefined + }; +} +export const QueryChecksumsResponse = { + typeUrl: "/ibc.lightclients.wasm.v1.QueryChecksumsResponse", + encode(message: QueryChecksumsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.checksums) { + writer.uint32(10).string(v!); + } + if (message.pagination !== undefined) { + PageResponse.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryChecksumsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryChecksumsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.checksums.push(reader.string()); + break; + case 2: + message.pagination = PageResponse.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryChecksumsResponse { + const message = createBaseQueryChecksumsResponse(); + message.checksums = object.checksums?.map(e => e) || []; + message.pagination = object.pagination !== undefined && object.pagination !== null ? PageResponse.fromPartial(object.pagination) : undefined; + return message; + }, + fromAmino(object: QueryChecksumsResponseAmino): QueryChecksumsResponse { + const message = createBaseQueryChecksumsResponse(); + message.checksums = object.checksums?.map(e => e) || []; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromAmino(object.pagination); + } + return message; + }, + toAmino(message: QueryChecksumsResponse): QueryChecksumsResponseAmino { + const obj: any = {}; + if (message.checksums) { + obj.checksums = message.checksums.map(e => e); + } else { + obj.checksums = []; + } + obj.pagination = message.pagination ? PageResponse.toAmino(message.pagination) : undefined; + return obj; + }, + fromAminoMsg(object: QueryChecksumsResponseAminoMsg): QueryChecksumsResponse { + return QueryChecksumsResponse.fromAmino(object.value); + }, + toAminoMsg(message: QueryChecksumsResponse): QueryChecksumsResponseAminoMsg { + return { + type: "cosmos-sdk/QueryChecksumsResponse", + value: QueryChecksumsResponse.toAmino(message) + }; + }, + fromProtoMsg(message: QueryChecksumsResponseProtoMsg): QueryChecksumsResponse { + return QueryChecksumsResponse.decode(message.value); + }, + toProto(message: QueryChecksumsResponse): Uint8Array { + return QueryChecksumsResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryChecksumsResponse): QueryChecksumsResponseProtoMsg { + return { + typeUrl: "/ibc.lightclients.wasm.v1.QueryChecksumsResponse", + value: QueryChecksumsResponse.encode(message).finish() + }; + } +}; +function createBaseQueryCodeRequest(): QueryCodeRequest { + return { + checksum: "" + }; +} +export const QueryCodeRequest = { + typeUrl: "/ibc.lightclients.wasm.v1.QueryCodeRequest", + encode(message: QueryCodeRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.checksum !== "") { + writer.uint32(10).string(message.checksum); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryCodeRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryCodeRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.checksum = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryCodeRequest { + const message = createBaseQueryCodeRequest(); + message.checksum = object.checksum ?? ""; + return message; + }, + fromAmino(object: QueryCodeRequestAmino): QueryCodeRequest { + const message = createBaseQueryCodeRequest(); + if (object.checksum !== undefined && object.checksum !== null) { + message.checksum = object.checksum; + } + return message; + }, + toAmino(message: QueryCodeRequest): QueryCodeRequestAmino { + const obj: any = {}; + obj.checksum = message.checksum; + return obj; + }, + fromAminoMsg(object: QueryCodeRequestAminoMsg): QueryCodeRequest { + return QueryCodeRequest.fromAmino(object.value); + }, + toAminoMsg(message: QueryCodeRequest): QueryCodeRequestAminoMsg { + return { + type: "cosmos-sdk/QueryCodeRequest", + value: QueryCodeRequest.toAmino(message) + }; + }, + fromProtoMsg(message: QueryCodeRequestProtoMsg): QueryCodeRequest { + return QueryCodeRequest.decode(message.value); + }, + toProto(message: QueryCodeRequest): Uint8Array { + return QueryCodeRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryCodeRequest): QueryCodeRequestProtoMsg { + return { + typeUrl: "/ibc.lightclients.wasm.v1.QueryCodeRequest", + value: QueryCodeRequest.encode(message).finish() + }; + } +}; +function createBaseQueryCodeResponse(): QueryCodeResponse { + return { + data: new Uint8Array() + }; +} +export const QueryCodeResponse = { + typeUrl: "/ibc.lightclients.wasm.v1.QueryCodeResponse", + encode(message: QueryCodeResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.data.length !== 0) { + writer.uint32(10).bytes(message.data); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryCodeResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryCodeResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.data = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryCodeResponse { + const message = createBaseQueryCodeResponse(); + message.data = object.data ?? new Uint8Array(); + return message; + }, + fromAmino(object: QueryCodeResponseAmino): QueryCodeResponse { + const message = createBaseQueryCodeResponse(); + if (object.data !== undefined && object.data !== null) { + message.data = bytesFromBase64(object.data); + } + return message; + }, + toAmino(message: QueryCodeResponse): QueryCodeResponseAmino { + const obj: any = {}; + obj.data = message.data ? base64FromBytes(message.data) : undefined; + return obj; + }, + fromAminoMsg(object: QueryCodeResponseAminoMsg): QueryCodeResponse { + return QueryCodeResponse.fromAmino(object.value); + }, + toAminoMsg(message: QueryCodeResponse): QueryCodeResponseAminoMsg { + return { + type: "cosmos-sdk/QueryCodeResponse", + value: QueryCodeResponse.toAmino(message) + }; + }, + fromProtoMsg(message: QueryCodeResponseProtoMsg): QueryCodeResponse { + return QueryCodeResponse.decode(message.value); + }, + toProto(message: QueryCodeResponse): Uint8Array { + return QueryCodeResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryCodeResponse): QueryCodeResponseProtoMsg { + return { + typeUrl: "/ibc.lightclients.wasm.v1.QueryCodeResponse", + value: QueryCodeResponse.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/packages/osmo-query/src/codegen/ibc/lightclients/wasm/v1/tx.amino.ts b/packages/osmo-query/src/codegen/ibc/lightclients/wasm/v1/tx.amino.ts new file mode 100644 index 000000000..09e56fb66 --- /dev/null +++ b/packages/osmo-query/src/codegen/ibc/lightclients/wasm/v1/tx.amino.ts @@ -0,0 +1,19 @@ +//@ts-nocheck +import { MsgStoreCode, MsgRemoveChecksum, MsgMigrateContract } from "./tx"; +export const AminoConverter = { + "/ibc.lightclients.wasm.v1.MsgStoreCode": { + aminoType: "cosmos-sdk/MsgStoreCode", + toAmino: MsgStoreCode.toAmino, + fromAmino: MsgStoreCode.fromAmino + }, + "/ibc.lightclients.wasm.v1.MsgRemoveChecksum": { + aminoType: "cosmos-sdk/MsgRemoveChecksum", + toAmino: MsgRemoveChecksum.toAmino, + fromAmino: MsgRemoveChecksum.fromAmino + }, + "/ibc.lightclients.wasm.v1.MsgMigrateContract": { + aminoType: "cosmos-sdk/MsgMigrateContract", + toAmino: MsgMigrateContract.toAmino, + fromAmino: MsgMigrateContract.fromAmino + } +}; \ No newline at end of file diff --git a/packages/osmo-query/src/codegen/ibc/lightclients/wasm/v1/tx.registry.ts b/packages/osmo-query/src/codegen/ibc/lightclients/wasm/v1/tx.registry.ts new file mode 100644 index 000000000..deff6739f --- /dev/null +++ b/packages/osmo-query/src/codegen/ibc/lightclients/wasm/v1/tx.registry.ts @@ -0,0 +1,71 @@ +//@ts-nocheck +import { GeneratedType, Registry } from "@cosmjs/proto-signing"; +import { MsgStoreCode, MsgRemoveChecksum, MsgMigrateContract } from "./tx"; +export const registry: ReadonlyArray<[string, GeneratedType]> = [["/ibc.lightclients.wasm.v1.MsgStoreCode", MsgStoreCode], ["/ibc.lightclients.wasm.v1.MsgRemoveChecksum", MsgRemoveChecksum], ["/ibc.lightclients.wasm.v1.MsgMigrateContract", MsgMigrateContract]]; +export const load = (protoRegistry: Registry) => { + registry.forEach(([typeUrl, mod]) => { + protoRegistry.register(typeUrl, mod); + }); +}; +export const MessageComposer = { + encoded: { + storeCode(value: MsgStoreCode) { + return { + typeUrl: "/ibc.lightclients.wasm.v1.MsgStoreCode", + value: MsgStoreCode.encode(value).finish() + }; + }, + removeChecksum(value: MsgRemoveChecksum) { + return { + typeUrl: "/ibc.lightclients.wasm.v1.MsgRemoveChecksum", + value: MsgRemoveChecksum.encode(value).finish() + }; + }, + migrateContract(value: MsgMigrateContract) { + return { + typeUrl: "/ibc.lightclients.wasm.v1.MsgMigrateContract", + value: MsgMigrateContract.encode(value).finish() + }; + } + }, + withTypeUrl: { + storeCode(value: MsgStoreCode) { + return { + typeUrl: "/ibc.lightclients.wasm.v1.MsgStoreCode", + value + }; + }, + removeChecksum(value: MsgRemoveChecksum) { + return { + typeUrl: "/ibc.lightclients.wasm.v1.MsgRemoveChecksum", + value + }; + }, + migrateContract(value: MsgMigrateContract) { + return { + typeUrl: "/ibc.lightclients.wasm.v1.MsgMigrateContract", + value + }; + } + }, + fromPartial: { + storeCode(value: MsgStoreCode) { + return { + typeUrl: "/ibc.lightclients.wasm.v1.MsgStoreCode", + value: MsgStoreCode.fromPartial(value) + }; + }, + removeChecksum(value: MsgRemoveChecksum) { + return { + typeUrl: "/ibc.lightclients.wasm.v1.MsgRemoveChecksum", + value: MsgRemoveChecksum.fromPartial(value) + }; + }, + migrateContract(value: MsgMigrateContract) { + return { + typeUrl: "/ibc.lightclients.wasm.v1.MsgMigrateContract", + value: MsgMigrateContract.fromPartial(value) + }; + } + } +}; \ No newline at end of file diff --git a/packages/osmo-query/src/codegen/ibc/lightclients/wasm/v1/tx.rpc.msg.ts b/packages/osmo-query/src/codegen/ibc/lightclients/wasm/v1/tx.rpc.msg.ts new file mode 100644 index 000000000..401918682 --- /dev/null +++ b/packages/osmo-query/src/codegen/ibc/lightclients/wasm/v1/tx.rpc.msg.ts @@ -0,0 +1,36 @@ +import { Rpc } from "../../../../helpers"; +import { BinaryReader } from "../../../../binary"; +import { MsgStoreCode, MsgStoreCodeResponse, MsgRemoveChecksum, MsgRemoveChecksumResponse, MsgMigrateContract, MsgMigrateContractResponse } from "./tx"; +/** Msg defines the ibc/08-wasm Msg service. */ +export interface Msg { + /** StoreCode defines a rpc handler method for MsgStoreCode. */ + storeCode(request: MsgStoreCode): Promise; + /** RemoveChecksum defines a rpc handler method for MsgRemoveChecksum. */ + removeChecksum(request: MsgRemoveChecksum): Promise; + /** MigrateContract defines a rpc handler method for MsgMigrateContract. */ + migrateContract(request: MsgMigrateContract): Promise; +} +export class MsgClientImpl implements Msg { + private readonly rpc: Rpc; + constructor(rpc: Rpc) { + this.rpc = rpc; + this.storeCode = this.storeCode.bind(this); + this.removeChecksum = this.removeChecksum.bind(this); + this.migrateContract = this.migrateContract.bind(this); + } + storeCode(request: MsgStoreCode): Promise { + const data = MsgStoreCode.encode(request).finish(); + const promise = this.rpc.request("ibc.lightclients.wasm.v1.Msg", "StoreCode", data); + return promise.then(data => MsgStoreCodeResponse.decode(new BinaryReader(data))); + } + removeChecksum(request: MsgRemoveChecksum): Promise { + const data = MsgRemoveChecksum.encode(request).finish(); + const promise = this.rpc.request("ibc.lightclients.wasm.v1.Msg", "RemoveChecksum", data); + return promise.then(data => MsgRemoveChecksumResponse.decode(new BinaryReader(data))); + } + migrateContract(request: MsgMigrateContract): Promise { + const data = MsgMigrateContract.encode(request).finish(); + const promise = this.rpc.request("ibc.lightclients.wasm.v1.Msg", "MigrateContract", data); + return promise.then(data => MsgMigrateContractResponse.decode(new BinaryReader(data))); + } +} \ No newline at end of file diff --git a/packages/osmo-query/src/codegen/ibc/lightclients/wasm/v1/tx.ts b/packages/osmo-query/src/codegen/ibc/lightclients/wasm/v1/tx.ts new file mode 100644 index 000000000..c3bfb930f --- /dev/null +++ b/packages/osmo-query/src/codegen/ibc/lightclients/wasm/v1/tx.ts @@ -0,0 +1,591 @@ +import { BinaryReader, BinaryWriter } from "../../../../binary"; +import { bytesFromBase64, base64FromBytes } from "../../../../helpers"; +/** MsgStoreCode defines the request type for the StoreCode rpc. */ +export interface MsgStoreCode { + /** signer address */ + signer: string; + /** wasm byte code of light client contract. It can be raw or gzip compressed */ + wasmByteCode: Uint8Array; +} +export interface MsgStoreCodeProtoMsg { + typeUrl: "/ibc.lightclients.wasm.v1.MsgStoreCode"; + value: Uint8Array; +} +/** MsgStoreCode defines the request type for the StoreCode rpc. */ +export interface MsgStoreCodeAmino { + /** signer address */ + signer?: string; + /** wasm byte code of light client contract. It can be raw or gzip compressed */ + wasm_byte_code?: string; +} +export interface MsgStoreCodeAminoMsg { + type: "cosmos-sdk/MsgStoreCode"; + value: MsgStoreCodeAmino; +} +/** MsgStoreCode defines the request type for the StoreCode rpc. */ +export interface MsgStoreCodeSDKType { + signer: string; + wasm_byte_code: Uint8Array; +} +/** MsgStoreCodeResponse defines the response type for the StoreCode rpc */ +export interface MsgStoreCodeResponse { + /** checksum is the sha256 hash of the stored code */ + checksum: Uint8Array; +} +export interface MsgStoreCodeResponseProtoMsg { + typeUrl: "/ibc.lightclients.wasm.v1.MsgStoreCodeResponse"; + value: Uint8Array; +} +/** MsgStoreCodeResponse defines the response type for the StoreCode rpc */ +export interface MsgStoreCodeResponseAmino { + /** checksum is the sha256 hash of the stored code */ + checksum?: string; +} +export interface MsgStoreCodeResponseAminoMsg { + type: "cosmos-sdk/MsgStoreCodeResponse"; + value: MsgStoreCodeResponseAmino; +} +/** MsgStoreCodeResponse defines the response type for the StoreCode rpc */ +export interface MsgStoreCodeResponseSDKType { + checksum: Uint8Array; +} +/** MsgRemoveChecksum defines the request type for the MsgRemoveChecksum rpc. */ +export interface MsgRemoveChecksum { + /** signer address */ + signer: string; + /** checksum is the sha256 hash to be removed from the store */ + checksum: Uint8Array; +} +export interface MsgRemoveChecksumProtoMsg { + typeUrl: "/ibc.lightclients.wasm.v1.MsgRemoveChecksum"; + value: Uint8Array; +} +/** MsgRemoveChecksum defines the request type for the MsgRemoveChecksum rpc. */ +export interface MsgRemoveChecksumAmino { + /** signer address */ + signer?: string; + /** checksum is the sha256 hash to be removed from the store */ + checksum?: string; +} +export interface MsgRemoveChecksumAminoMsg { + type: "cosmos-sdk/MsgRemoveChecksum"; + value: MsgRemoveChecksumAmino; +} +/** MsgRemoveChecksum defines the request type for the MsgRemoveChecksum rpc. */ +export interface MsgRemoveChecksumSDKType { + signer: string; + checksum: Uint8Array; +} +/** MsgStoreChecksumResponse defines the response type for the StoreCode rpc */ +export interface MsgRemoveChecksumResponse {} +export interface MsgRemoveChecksumResponseProtoMsg { + typeUrl: "/ibc.lightclients.wasm.v1.MsgRemoveChecksumResponse"; + value: Uint8Array; +} +/** MsgStoreChecksumResponse defines the response type for the StoreCode rpc */ +export interface MsgRemoveChecksumResponseAmino {} +export interface MsgRemoveChecksumResponseAminoMsg { + type: "cosmos-sdk/MsgRemoveChecksumResponse"; + value: MsgRemoveChecksumResponseAmino; +} +/** MsgStoreChecksumResponse defines the response type for the StoreCode rpc */ +export interface MsgRemoveChecksumResponseSDKType {} +/** MsgMigrateContract defines the request type for the MigrateContract rpc. */ +export interface MsgMigrateContract { + /** signer address */ + signer: string; + /** the client id of the contract */ + clientId: string; + /** checksum is the sha256 hash of the new wasm byte code for the contract */ + checksum: Uint8Array; + /** the json encoded message to be passed to the contract on migration */ + msg: Uint8Array; +} +export interface MsgMigrateContractProtoMsg { + typeUrl: "/ibc.lightclients.wasm.v1.MsgMigrateContract"; + value: Uint8Array; +} +/** MsgMigrateContract defines the request type for the MigrateContract rpc. */ +export interface MsgMigrateContractAmino { + /** signer address */ + signer?: string; + /** the client id of the contract */ + client_id?: string; + /** checksum is the sha256 hash of the new wasm byte code for the contract */ + checksum?: string; + /** the json encoded message to be passed to the contract on migration */ + msg?: string; +} +export interface MsgMigrateContractAminoMsg { + type: "cosmos-sdk/MsgMigrateContract"; + value: MsgMigrateContractAmino; +} +/** MsgMigrateContract defines the request type for the MigrateContract rpc. */ +export interface MsgMigrateContractSDKType { + signer: string; + client_id: string; + checksum: Uint8Array; + msg: Uint8Array; +} +/** MsgMigrateContractResponse defines the response type for the MigrateContract rpc */ +export interface MsgMigrateContractResponse {} +export interface MsgMigrateContractResponseProtoMsg { + typeUrl: "/ibc.lightclients.wasm.v1.MsgMigrateContractResponse"; + value: Uint8Array; +} +/** MsgMigrateContractResponse defines the response type for the MigrateContract rpc */ +export interface MsgMigrateContractResponseAmino {} +export interface MsgMigrateContractResponseAminoMsg { + type: "cosmos-sdk/MsgMigrateContractResponse"; + value: MsgMigrateContractResponseAmino; +} +/** MsgMigrateContractResponse defines the response type for the MigrateContract rpc */ +export interface MsgMigrateContractResponseSDKType {} +function createBaseMsgStoreCode(): MsgStoreCode { + return { + signer: "", + wasmByteCode: new Uint8Array() + }; +} +export const MsgStoreCode = { + typeUrl: "/ibc.lightclients.wasm.v1.MsgStoreCode", + encode(message: MsgStoreCode, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.signer !== "") { + writer.uint32(10).string(message.signer); + } + if (message.wasmByteCode.length !== 0) { + writer.uint32(18).bytes(message.wasmByteCode); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgStoreCode { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgStoreCode(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.signer = reader.string(); + break; + case 2: + message.wasmByteCode = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgStoreCode { + const message = createBaseMsgStoreCode(); + message.signer = object.signer ?? ""; + message.wasmByteCode = object.wasmByteCode ?? new Uint8Array(); + return message; + }, + fromAmino(object: MsgStoreCodeAmino): MsgStoreCode { + const message = createBaseMsgStoreCode(); + if (object.signer !== undefined && object.signer !== null) { + message.signer = object.signer; + } + if (object.wasm_byte_code !== undefined && object.wasm_byte_code !== null) { + message.wasmByteCode = bytesFromBase64(object.wasm_byte_code); + } + return message; + }, + toAmino(message: MsgStoreCode): MsgStoreCodeAmino { + const obj: any = {}; + obj.signer = message.signer; + obj.wasm_byte_code = message.wasmByteCode ? base64FromBytes(message.wasmByteCode) : undefined; + return obj; + }, + fromAminoMsg(object: MsgStoreCodeAminoMsg): MsgStoreCode { + return MsgStoreCode.fromAmino(object.value); + }, + toAminoMsg(message: MsgStoreCode): MsgStoreCodeAminoMsg { + return { + type: "cosmos-sdk/MsgStoreCode", + value: MsgStoreCode.toAmino(message) + }; + }, + fromProtoMsg(message: MsgStoreCodeProtoMsg): MsgStoreCode { + return MsgStoreCode.decode(message.value); + }, + toProto(message: MsgStoreCode): Uint8Array { + return MsgStoreCode.encode(message).finish(); + }, + toProtoMsg(message: MsgStoreCode): MsgStoreCodeProtoMsg { + return { + typeUrl: "/ibc.lightclients.wasm.v1.MsgStoreCode", + value: MsgStoreCode.encode(message).finish() + }; + } +}; +function createBaseMsgStoreCodeResponse(): MsgStoreCodeResponse { + return { + checksum: new Uint8Array() + }; +} +export const MsgStoreCodeResponse = { + typeUrl: "/ibc.lightclients.wasm.v1.MsgStoreCodeResponse", + encode(message: MsgStoreCodeResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.checksum.length !== 0) { + writer.uint32(10).bytes(message.checksum); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgStoreCodeResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgStoreCodeResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.checksum = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgStoreCodeResponse { + const message = createBaseMsgStoreCodeResponse(); + message.checksum = object.checksum ?? new Uint8Array(); + return message; + }, + fromAmino(object: MsgStoreCodeResponseAmino): MsgStoreCodeResponse { + const message = createBaseMsgStoreCodeResponse(); + if (object.checksum !== undefined && object.checksum !== null) { + message.checksum = bytesFromBase64(object.checksum); + } + return message; + }, + toAmino(message: MsgStoreCodeResponse): MsgStoreCodeResponseAmino { + const obj: any = {}; + obj.checksum = message.checksum ? base64FromBytes(message.checksum) : undefined; + return obj; + }, + fromAminoMsg(object: MsgStoreCodeResponseAminoMsg): MsgStoreCodeResponse { + return MsgStoreCodeResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgStoreCodeResponse): MsgStoreCodeResponseAminoMsg { + return { + type: "cosmos-sdk/MsgStoreCodeResponse", + value: MsgStoreCodeResponse.toAmino(message) + }; + }, + fromProtoMsg(message: MsgStoreCodeResponseProtoMsg): MsgStoreCodeResponse { + return MsgStoreCodeResponse.decode(message.value); + }, + toProto(message: MsgStoreCodeResponse): Uint8Array { + return MsgStoreCodeResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgStoreCodeResponse): MsgStoreCodeResponseProtoMsg { + return { + typeUrl: "/ibc.lightclients.wasm.v1.MsgStoreCodeResponse", + value: MsgStoreCodeResponse.encode(message).finish() + }; + } +}; +function createBaseMsgRemoveChecksum(): MsgRemoveChecksum { + return { + signer: "", + checksum: new Uint8Array() + }; +} +export const MsgRemoveChecksum = { + typeUrl: "/ibc.lightclients.wasm.v1.MsgRemoveChecksum", + encode(message: MsgRemoveChecksum, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.signer !== "") { + writer.uint32(10).string(message.signer); + } + if (message.checksum.length !== 0) { + writer.uint32(18).bytes(message.checksum); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgRemoveChecksum { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgRemoveChecksum(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.signer = reader.string(); + break; + case 2: + message.checksum = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgRemoveChecksum { + const message = createBaseMsgRemoveChecksum(); + message.signer = object.signer ?? ""; + message.checksum = object.checksum ?? new Uint8Array(); + return message; + }, + fromAmino(object: MsgRemoveChecksumAmino): MsgRemoveChecksum { + const message = createBaseMsgRemoveChecksum(); + if (object.signer !== undefined && object.signer !== null) { + message.signer = object.signer; + } + if (object.checksum !== undefined && object.checksum !== null) { + message.checksum = bytesFromBase64(object.checksum); + } + return message; + }, + toAmino(message: MsgRemoveChecksum): MsgRemoveChecksumAmino { + const obj: any = {}; + obj.signer = message.signer; + obj.checksum = message.checksum ? base64FromBytes(message.checksum) : undefined; + return obj; + }, + fromAminoMsg(object: MsgRemoveChecksumAminoMsg): MsgRemoveChecksum { + return MsgRemoveChecksum.fromAmino(object.value); + }, + toAminoMsg(message: MsgRemoveChecksum): MsgRemoveChecksumAminoMsg { + return { + type: "cosmos-sdk/MsgRemoveChecksum", + value: MsgRemoveChecksum.toAmino(message) + }; + }, + fromProtoMsg(message: MsgRemoveChecksumProtoMsg): MsgRemoveChecksum { + return MsgRemoveChecksum.decode(message.value); + }, + toProto(message: MsgRemoveChecksum): Uint8Array { + return MsgRemoveChecksum.encode(message).finish(); + }, + toProtoMsg(message: MsgRemoveChecksum): MsgRemoveChecksumProtoMsg { + return { + typeUrl: "/ibc.lightclients.wasm.v1.MsgRemoveChecksum", + value: MsgRemoveChecksum.encode(message).finish() + }; + } +}; +function createBaseMsgRemoveChecksumResponse(): MsgRemoveChecksumResponse { + return {}; +} +export const MsgRemoveChecksumResponse = { + typeUrl: "/ibc.lightclients.wasm.v1.MsgRemoveChecksumResponse", + encode(_: MsgRemoveChecksumResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgRemoveChecksumResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgRemoveChecksumResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): MsgRemoveChecksumResponse { + const message = createBaseMsgRemoveChecksumResponse(); + return message; + }, + fromAmino(_: MsgRemoveChecksumResponseAmino): MsgRemoveChecksumResponse { + const message = createBaseMsgRemoveChecksumResponse(); + return message; + }, + toAmino(_: MsgRemoveChecksumResponse): MsgRemoveChecksumResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgRemoveChecksumResponseAminoMsg): MsgRemoveChecksumResponse { + return MsgRemoveChecksumResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgRemoveChecksumResponse): MsgRemoveChecksumResponseAminoMsg { + return { + type: "cosmos-sdk/MsgRemoveChecksumResponse", + value: MsgRemoveChecksumResponse.toAmino(message) + }; + }, + fromProtoMsg(message: MsgRemoveChecksumResponseProtoMsg): MsgRemoveChecksumResponse { + return MsgRemoveChecksumResponse.decode(message.value); + }, + toProto(message: MsgRemoveChecksumResponse): Uint8Array { + return MsgRemoveChecksumResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgRemoveChecksumResponse): MsgRemoveChecksumResponseProtoMsg { + return { + typeUrl: "/ibc.lightclients.wasm.v1.MsgRemoveChecksumResponse", + value: MsgRemoveChecksumResponse.encode(message).finish() + }; + } +}; +function createBaseMsgMigrateContract(): MsgMigrateContract { + return { + signer: "", + clientId: "", + checksum: new Uint8Array(), + msg: new Uint8Array() + }; +} +export const MsgMigrateContract = { + typeUrl: "/ibc.lightclients.wasm.v1.MsgMigrateContract", + encode(message: MsgMigrateContract, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.signer !== "") { + writer.uint32(10).string(message.signer); + } + if (message.clientId !== "") { + writer.uint32(18).string(message.clientId); + } + if (message.checksum.length !== 0) { + writer.uint32(26).bytes(message.checksum); + } + if (message.msg.length !== 0) { + writer.uint32(34).bytes(message.msg); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgMigrateContract { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgMigrateContract(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.signer = reader.string(); + break; + case 2: + message.clientId = reader.string(); + break; + case 3: + message.checksum = reader.bytes(); + break; + case 4: + message.msg = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgMigrateContract { + const message = createBaseMsgMigrateContract(); + message.signer = object.signer ?? ""; + message.clientId = object.clientId ?? ""; + message.checksum = object.checksum ?? new Uint8Array(); + message.msg = object.msg ?? new Uint8Array(); + return message; + }, + fromAmino(object: MsgMigrateContractAmino): MsgMigrateContract { + const message = createBaseMsgMigrateContract(); + if (object.signer !== undefined && object.signer !== null) { + message.signer = object.signer; + } + if (object.client_id !== undefined && object.client_id !== null) { + message.clientId = object.client_id; + } + if (object.checksum !== undefined && object.checksum !== null) { + message.checksum = bytesFromBase64(object.checksum); + } + if (object.msg !== undefined && object.msg !== null) { + message.msg = bytesFromBase64(object.msg); + } + return message; + }, + toAmino(message: MsgMigrateContract): MsgMigrateContractAmino { + const obj: any = {}; + obj.signer = message.signer; + obj.client_id = message.clientId; + obj.checksum = message.checksum ? base64FromBytes(message.checksum) : undefined; + obj.msg = message.msg ? base64FromBytes(message.msg) : undefined; + return obj; + }, + fromAminoMsg(object: MsgMigrateContractAminoMsg): MsgMigrateContract { + return MsgMigrateContract.fromAmino(object.value); + }, + toAminoMsg(message: MsgMigrateContract): MsgMigrateContractAminoMsg { + return { + type: "cosmos-sdk/MsgMigrateContract", + value: MsgMigrateContract.toAmino(message) + }; + }, + fromProtoMsg(message: MsgMigrateContractProtoMsg): MsgMigrateContract { + return MsgMigrateContract.decode(message.value); + }, + toProto(message: MsgMigrateContract): Uint8Array { + return MsgMigrateContract.encode(message).finish(); + }, + toProtoMsg(message: MsgMigrateContract): MsgMigrateContractProtoMsg { + return { + typeUrl: "/ibc.lightclients.wasm.v1.MsgMigrateContract", + value: MsgMigrateContract.encode(message).finish() + }; + } +}; +function createBaseMsgMigrateContractResponse(): MsgMigrateContractResponse { + return {}; +} +export const MsgMigrateContractResponse = { + typeUrl: "/ibc.lightclients.wasm.v1.MsgMigrateContractResponse", + encode(_: MsgMigrateContractResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgMigrateContractResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgMigrateContractResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): MsgMigrateContractResponse { + const message = createBaseMsgMigrateContractResponse(); + return message; + }, + fromAmino(_: MsgMigrateContractResponseAmino): MsgMigrateContractResponse { + const message = createBaseMsgMigrateContractResponse(); + return message; + }, + toAmino(_: MsgMigrateContractResponse): MsgMigrateContractResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgMigrateContractResponseAminoMsg): MsgMigrateContractResponse { + return MsgMigrateContractResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgMigrateContractResponse): MsgMigrateContractResponseAminoMsg { + return { + type: "cosmos-sdk/MsgMigrateContractResponse", + value: MsgMigrateContractResponse.toAmino(message) + }; + }, + fromProtoMsg(message: MsgMigrateContractResponseProtoMsg): MsgMigrateContractResponse { + return MsgMigrateContractResponse.decode(message.value); + }, + toProto(message: MsgMigrateContractResponse): Uint8Array { + return MsgMigrateContractResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgMigrateContractResponse): MsgMigrateContractResponseProtoMsg { + return { + typeUrl: "/ibc.lightclients.wasm.v1.MsgMigrateContractResponse", + value: MsgMigrateContractResponse.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/packages/osmo-query/src/codegen/ibc/lightclients/wasm/v1/wasm.ts b/packages/osmo-query/src/codegen/ibc/lightclients/wasm/v1/wasm.ts new file mode 100644 index 000000000..c738dd193 --- /dev/null +++ b/packages/osmo-query/src/codegen/ibc/lightclients/wasm/v1/wasm.ts @@ -0,0 +1,425 @@ +import { Height, HeightAmino, HeightSDKType } from "../../../core/client/v1/client"; +import { BinaryReader, BinaryWriter } from "../../../../binary"; +import { bytesFromBase64, base64FromBytes } from "../../../../helpers"; +/** Wasm light client's Client state */ +export interface ClientState { + /** + * bytes encoding the client state of the underlying light client + * implemented as a Wasm contract. + */ + data: Uint8Array; + checksum: Uint8Array; + latestHeight: Height; +} +export interface ClientStateProtoMsg { + typeUrl: "/ibc.lightclients.wasm.v1.ClientState"; + value: Uint8Array; +} +/** Wasm light client's Client state */ +export interface ClientStateAmino { + /** + * bytes encoding the client state of the underlying light client + * implemented as a Wasm contract. + */ + data?: string; + checksum?: string; + latest_height?: HeightAmino; +} +export interface ClientStateAminoMsg { + type: "cosmos-sdk/ClientState"; + value: ClientStateAmino; +} +/** Wasm light client's Client state */ +export interface ClientStateSDKType { + data: Uint8Array; + checksum: Uint8Array; + latest_height: HeightSDKType; +} +/** Wasm light client's ConsensusState */ +export interface ConsensusState { + /** + * bytes encoding the consensus state of the underlying light client + * implemented as a Wasm contract. + */ + data: Uint8Array; +} +export interface ConsensusStateProtoMsg { + typeUrl: "/ibc.lightclients.wasm.v1.ConsensusState"; + value: Uint8Array; +} +/** Wasm light client's ConsensusState */ +export interface ConsensusStateAmino { + /** + * bytes encoding the consensus state of the underlying light client + * implemented as a Wasm contract. + */ + data?: string; +} +export interface ConsensusStateAminoMsg { + type: "cosmos-sdk/ConsensusState"; + value: ConsensusStateAmino; +} +/** Wasm light client's ConsensusState */ +export interface ConsensusStateSDKType { + data: Uint8Array; +} +/** Wasm light client message (either header(s) or misbehaviour) */ +export interface ClientMessage { + data: Uint8Array; +} +export interface ClientMessageProtoMsg { + typeUrl: "/ibc.lightclients.wasm.v1.ClientMessage"; + value: Uint8Array; +} +/** Wasm light client message (either header(s) or misbehaviour) */ +export interface ClientMessageAmino { + data?: string; +} +export interface ClientMessageAminoMsg { + type: "cosmos-sdk/ClientMessage"; + value: ClientMessageAmino; +} +/** Wasm light client message (either header(s) or misbehaviour) */ +export interface ClientMessageSDKType { + data: Uint8Array; +} +/** + * Checksums defines a list of all checksums that are stored + * + * Deprecated: This message is deprecated in favor of storing the checksums + * using a Collections.KeySet. + */ +/** @deprecated */ +export interface Checksums { + checksums: Uint8Array[]; +} +export interface ChecksumsProtoMsg { + typeUrl: "/ibc.lightclients.wasm.v1.Checksums"; + value: Uint8Array; +} +/** + * Checksums defines a list of all checksums that are stored + * + * Deprecated: This message is deprecated in favor of storing the checksums + * using a Collections.KeySet. + */ +/** @deprecated */ +export interface ChecksumsAmino { + checksums?: string[]; +} +export interface ChecksumsAminoMsg { + type: "cosmos-sdk/Checksums"; + value: ChecksumsAmino; +} +/** + * Checksums defines a list of all checksums that are stored + * + * Deprecated: This message is deprecated in favor of storing the checksums + * using a Collections.KeySet. + */ +/** @deprecated */ +export interface ChecksumsSDKType { + checksums: Uint8Array[]; +} +function createBaseClientState(): ClientState { + return { + data: new Uint8Array(), + checksum: new Uint8Array(), + latestHeight: Height.fromPartial({}) + }; +} +export const ClientState = { + typeUrl: "/ibc.lightclients.wasm.v1.ClientState", + encode(message: ClientState, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.data.length !== 0) { + writer.uint32(10).bytes(message.data); + } + if (message.checksum.length !== 0) { + writer.uint32(18).bytes(message.checksum); + } + if (message.latestHeight !== undefined) { + Height.encode(message.latestHeight, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): ClientState { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseClientState(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.data = reader.bytes(); + break; + case 2: + message.checksum = reader.bytes(); + break; + case 3: + message.latestHeight = Height.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): ClientState { + const message = createBaseClientState(); + message.data = object.data ?? new Uint8Array(); + message.checksum = object.checksum ?? new Uint8Array(); + message.latestHeight = object.latestHeight !== undefined && object.latestHeight !== null ? Height.fromPartial(object.latestHeight) : undefined; + return message; + }, + fromAmino(object: ClientStateAmino): ClientState { + const message = createBaseClientState(); + if (object.data !== undefined && object.data !== null) { + message.data = bytesFromBase64(object.data); + } + if (object.checksum !== undefined && object.checksum !== null) { + message.checksum = bytesFromBase64(object.checksum); + } + if (object.latest_height !== undefined && object.latest_height !== null) { + message.latestHeight = Height.fromAmino(object.latest_height); + } + return message; + }, + toAmino(message: ClientState): ClientStateAmino { + const obj: any = {}; + obj.data = message.data ? base64FromBytes(message.data) : undefined; + obj.checksum = message.checksum ? base64FromBytes(message.checksum) : undefined; + obj.latest_height = message.latestHeight ? Height.toAmino(message.latestHeight) : {}; + return obj; + }, + fromAminoMsg(object: ClientStateAminoMsg): ClientState { + return ClientState.fromAmino(object.value); + }, + toAminoMsg(message: ClientState): ClientStateAminoMsg { + return { + type: "cosmos-sdk/ClientState", + value: ClientState.toAmino(message) + }; + }, + fromProtoMsg(message: ClientStateProtoMsg): ClientState { + return ClientState.decode(message.value); + }, + toProto(message: ClientState): Uint8Array { + return ClientState.encode(message).finish(); + }, + toProtoMsg(message: ClientState): ClientStateProtoMsg { + return { + typeUrl: "/ibc.lightclients.wasm.v1.ClientState", + value: ClientState.encode(message).finish() + }; + } +}; +function createBaseConsensusState(): ConsensusState { + return { + data: new Uint8Array() + }; +} +export const ConsensusState = { + typeUrl: "/ibc.lightclients.wasm.v1.ConsensusState", + encode(message: ConsensusState, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.data.length !== 0) { + writer.uint32(10).bytes(message.data); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): ConsensusState { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseConsensusState(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.data = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): ConsensusState { + const message = createBaseConsensusState(); + message.data = object.data ?? new Uint8Array(); + return message; + }, + fromAmino(object: ConsensusStateAmino): ConsensusState { + const message = createBaseConsensusState(); + if (object.data !== undefined && object.data !== null) { + message.data = bytesFromBase64(object.data); + } + return message; + }, + toAmino(message: ConsensusState): ConsensusStateAmino { + const obj: any = {}; + obj.data = message.data ? base64FromBytes(message.data) : undefined; + return obj; + }, + fromAminoMsg(object: ConsensusStateAminoMsg): ConsensusState { + return ConsensusState.fromAmino(object.value); + }, + toAminoMsg(message: ConsensusState): ConsensusStateAminoMsg { + return { + type: "cosmos-sdk/ConsensusState", + value: ConsensusState.toAmino(message) + }; + }, + fromProtoMsg(message: ConsensusStateProtoMsg): ConsensusState { + return ConsensusState.decode(message.value); + }, + toProto(message: ConsensusState): Uint8Array { + return ConsensusState.encode(message).finish(); + }, + toProtoMsg(message: ConsensusState): ConsensusStateProtoMsg { + return { + typeUrl: "/ibc.lightclients.wasm.v1.ConsensusState", + value: ConsensusState.encode(message).finish() + }; + } +}; +function createBaseClientMessage(): ClientMessage { + return { + data: new Uint8Array() + }; +} +export const ClientMessage = { + typeUrl: "/ibc.lightclients.wasm.v1.ClientMessage", + encode(message: ClientMessage, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.data.length !== 0) { + writer.uint32(10).bytes(message.data); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): ClientMessage { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseClientMessage(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.data = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): ClientMessage { + const message = createBaseClientMessage(); + message.data = object.data ?? new Uint8Array(); + return message; + }, + fromAmino(object: ClientMessageAmino): ClientMessage { + const message = createBaseClientMessage(); + if (object.data !== undefined && object.data !== null) { + message.data = bytesFromBase64(object.data); + } + return message; + }, + toAmino(message: ClientMessage): ClientMessageAmino { + const obj: any = {}; + obj.data = message.data ? base64FromBytes(message.data) : undefined; + return obj; + }, + fromAminoMsg(object: ClientMessageAminoMsg): ClientMessage { + return ClientMessage.fromAmino(object.value); + }, + toAminoMsg(message: ClientMessage): ClientMessageAminoMsg { + return { + type: "cosmos-sdk/ClientMessage", + value: ClientMessage.toAmino(message) + }; + }, + fromProtoMsg(message: ClientMessageProtoMsg): ClientMessage { + return ClientMessage.decode(message.value); + }, + toProto(message: ClientMessage): Uint8Array { + return ClientMessage.encode(message).finish(); + }, + toProtoMsg(message: ClientMessage): ClientMessageProtoMsg { + return { + typeUrl: "/ibc.lightclients.wasm.v1.ClientMessage", + value: ClientMessage.encode(message).finish() + }; + } +}; +function createBaseChecksums(): Checksums { + return { + checksums: [] + }; +} +export const Checksums = { + typeUrl: "/ibc.lightclients.wasm.v1.Checksums", + encode(message: Checksums, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.checksums) { + writer.uint32(10).bytes(v!); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): Checksums { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseChecksums(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.checksums.push(reader.bytes()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): Checksums { + const message = createBaseChecksums(); + message.checksums = object.checksums?.map(e => e) || []; + return message; + }, + fromAmino(object: ChecksumsAmino): Checksums { + const message = createBaseChecksums(); + message.checksums = object.checksums?.map(e => bytesFromBase64(e)) || []; + return message; + }, + toAmino(message: Checksums): ChecksumsAmino { + const obj: any = {}; + if (message.checksums) { + obj.checksums = message.checksums.map(e => base64FromBytes(e)); + } else { + obj.checksums = []; + } + return obj; + }, + fromAminoMsg(object: ChecksumsAminoMsg): Checksums { + return Checksums.fromAmino(object.value); + }, + toAminoMsg(message: Checksums): ChecksumsAminoMsg { + return { + type: "cosmos-sdk/Checksums", + value: Checksums.toAmino(message) + }; + }, + fromProtoMsg(message: ChecksumsProtoMsg): Checksums { + return Checksums.decode(message.value); + }, + toProto(message: Checksums): Uint8Array { + return Checksums.encode(message).finish(); + }, + toProtoMsg(message: Checksums): ChecksumsProtoMsg { + return { + typeUrl: "/ibc.lightclients.wasm.v1.Checksums", + value: Checksums.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/packages/osmo-query/src/codegen/ibc/rpc.query.ts b/packages/osmo-query/src/codegen/ibc/rpc.query.ts index bcecd61eb..2c36c6444 100644 --- a/packages/osmo-query/src/codegen/ibc/rpc.query.ts +++ b/packages/osmo-query/src/codegen/ibc/rpc.query.ts @@ -1,11 +1,11 @@ -import { HttpEndpoint, connectComet } from "@cosmjs/tendermint-rpc"; +import { Tendermint34Client, HttpEndpoint } from "@cosmjs/tendermint-rpc"; import { QueryClient } from "@cosmjs/stargate"; export const createRPCQueryClient = async ({ rpcEndpoint }: { rpcEndpoint: string | HttpEndpoint; }) => { - const tmClient = await connectComet(rpcEndpoint); + const tmClient = await Tendermint34Client.connect(rpcEndpoint); const client = new QueryClient(tmClient); return { cosmos: { @@ -23,12 +23,20 @@ export const createRPCQueryClient = async ({ v1beta1: (await import("../cosmos/base/node/v1beta1/query.rpc.Service")).createRpcQueryExtension(client) } }, + consensus: { + v1: (await import("../cosmos/consensus/v1/query.rpc.Query")).createRpcQueryExtension(client) + }, distribution: { v1beta1: (await import("../cosmos/distribution/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) }, gov: { v1beta1: (await import("../cosmos/gov/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) }, + orm: { + query: { + v1alpha1: (await import("../cosmos/orm/query/v1alpha1/query.rpc.Query")).createRpcQueryExtension(client) + } + }, staking: { v1beta1: (await import("../cosmos/staking/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) }, @@ -66,6 +74,11 @@ export const createRPCQueryClient = async ({ connection: { v1: (await import("./core/connection/v1/query.rpc.Query")).createRpcQueryExtension(client) } + }, + lightclients: { + wasm: { + v1: (await import("./lightclients/wasm/v1/query.rpc.Query")).createRpcQueryExtension(client) + } } } }; diff --git a/packages/osmo-query/src/codegen/ibc/rpc.tx.ts b/packages/osmo-query/src/codegen/ibc/rpc.tx.ts index 1672f4018..b9f444d4f 100644 --- a/packages/osmo-query/src/codegen/ibc/rpc.tx.ts +++ b/packages/osmo-query/src/codegen/ibc/rpc.tx.ts @@ -5,12 +5,18 @@ export const createRPCMsgClient = async ({ rpc: Rpc; }) => ({ cosmos: { + auth: { + v1beta1: new (await import("../cosmos/auth/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) + }, authz: { v1beta1: new (await import("../cosmos/authz/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) }, bank: { v1beta1: new (await import("../cosmos/bank/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) }, + consensus: { + v1: new (await import("../cosmos/consensus/v1/tx.rpc.msg")).MsgClientImpl(rpc) + }, distribution: { v1beta1: new (await import("../cosmos/distribution/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) }, @@ -19,6 +25,9 @@ export const createRPCMsgClient = async ({ }, staking: { v1beta1: new (await import("../cosmos/staking/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) + }, + upgrade: { + v1beta1: new (await import("../cosmos/upgrade/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) } }, ibc: { @@ -29,6 +38,9 @@ export const createRPCMsgClient = async ({ interchain_accounts: { controller: { v1: new (await import("./applications/interchain_accounts/controller/v1/tx.rpc.msg")).MsgClientImpl(rpc) + }, + host: { + v1: new (await import("./applications/interchain_accounts/host/v1/tx.rpc.msg")).MsgClientImpl(rpc) } }, transfer: { @@ -45,6 +57,11 @@ export const createRPCMsgClient = async ({ connection: { v1: new (await import("./core/connection/v1/tx.rpc.msg")).MsgClientImpl(rpc) } + }, + lightclients: { + wasm: { + v1: new (await import("./lightclients/wasm/v1/tx.rpc.msg")).MsgClientImpl(rpc) + } } } }); \ No newline at end of file diff --git a/packages/osmo-query/src/codegen/ics23/bundle.ts b/packages/osmo-query/src/codegen/ics23/bundle.ts index ed4d55aef..3f0cb538e 100644 --- a/packages/osmo-query/src/codegen/ics23/bundle.ts +++ b/packages/osmo-query/src/codegen/ics23/bundle.ts @@ -1,4 +1,4 @@ -import * as _171 from "../confio/proofs"; +import * as _227 from "../confio/proofs"; export const ics23 = { - ..._171 + ..._227 }; \ No newline at end of file diff --git a/packages/osmo-query/src/codegen/index.ts b/packages/osmo-query/src/codegen/index.ts index 79ce91fe5..dd38ab259 100644 --- a/packages/osmo-query/src/codegen/index.ts +++ b/packages/osmo-query/src/codegen/index.ts @@ -1,5 +1,5 @@ /** - * This file and any referenced files were automatically generated by @cosmology/telescope@0.102.0 + * This file and any referenced files were automatically generated by @cosmology/telescope@1.4.1 * DO NOT MODIFY BY HAND. Instead, download the latest proto files for your chain * and run the transpile command or yarn proto command to regenerate this bundle. */ @@ -7,6 +7,7 @@ export * from "./cosmos/bundle"; export * from "./cosmos/client"; export * from "./amino/bundle"; +export * from "./tendermint/bundle"; export * from "./capability/bundle"; export * from "./ibc/bundle"; export * from "./ibc/client"; @@ -18,7 +19,6 @@ export * from "./ics23/bundle"; export * from "./cosmos_proto/bundle"; export * from "./gogoproto/bundle"; export * from "./google/bundle"; -export * from "./tendermint/bundle"; export * from "./hooks"; export * from "./extern"; export * from "./react-query"; diff --git a/packages/osmo-query/src/codegen/osmosis/accum/v1beta1/accum.ts b/packages/osmo-query/src/codegen/osmosis/accum/v1beta1/accum.ts index f1cc04c8b..631e8f5de 100644 --- a/packages/osmo-query/src/codegen/osmosis/accum/v1beta1/accum.ts +++ b/packages/osmo-query/src/codegen/osmosis/accum/v1beta1/accum.ts @@ -20,8 +20,8 @@ export interface AccumulatorContentProtoMsg { * shares belonging to it from all positions. */ export interface AccumulatorContentAmino { - accum_value: DecCoinAmino[]; - total_shares: string; + accum_value?: DecCoinAmino[]; + total_shares?: string; } export interface AccumulatorContentAminoMsg { type: "osmosis/accum/accumulator-content"; @@ -85,7 +85,7 @@ export interface Record { * into a single one. */ unclaimedRewardsTotal: DecCoin[]; - options: Options; + options?: Options; } export interface RecordProtoMsg { typeUrl: "/osmosis.accum.v1beta1.Record"; @@ -100,7 +100,7 @@ export interface RecordAmino { * num_shares is the number of shares belonging to the position associated * with this record. */ - num_shares: string; + num_shares?: string; /** * accum_value_per_share is the subset of coins per shar of the global * accumulator value that allows to infer how much a position is entitled to @@ -120,7 +120,7 @@ export interface RecordAmino { * get the growth inside the interval from the time of last update up until * the current block time. */ - accum_value_per_share: DecCoinAmino[]; + accum_value_per_share?: DecCoinAmino[]; /** * unclaimed_rewards_total is the total amount of unclaimed rewards that the * position is entitled to. This value is updated whenever shares are added or @@ -128,7 +128,7 @@ export interface RecordAmino { * this value for some custom use cases such as merging pre-existing positions * into a single one. */ - unclaimed_rewards_total: DecCoinAmino[]; + unclaimed_rewards_total?: DecCoinAmino[]; options?: OptionsAmino; } export interface RecordAminoMsg { @@ -143,7 +143,7 @@ export interface RecordSDKType { num_shares: string; accum_value_per_share: DecCoinSDKType[]; unclaimed_rewards_total: DecCoinSDKType[]; - options: OptionsSDKType; + options?: OptionsSDKType; } function createBaseAccumulatorContent(): AccumulatorContent { return { @@ -189,10 +189,12 @@ export const AccumulatorContent = { return message; }, fromAmino(object: AccumulatorContentAmino): AccumulatorContent { - return { - accumValue: Array.isArray(object?.accum_value) ? object.accum_value.map((e: any) => DecCoin.fromAmino(e)) : [], - totalShares: object.total_shares - }; + const message = createBaseAccumulatorContent(); + message.accumValue = object.accum_value?.map(e => DecCoin.fromAmino(e)) || []; + if (object.total_shares !== undefined && object.total_shares !== null) { + message.totalShares = object.total_shares; + } + return message; }, toAmino(message: AccumulatorContent): AccumulatorContentAmino { const obj: any = {}; @@ -253,7 +255,8 @@ export const Options = { return message; }, fromAmino(_: OptionsAmino): Options { - return {}; + const message = createBaseOptions(); + return message; }, toAmino(_: Options): OptionsAmino { const obj: any = {}; @@ -286,7 +289,7 @@ function createBaseRecord(): Record { numShares: "", accumValuePerShare: [], unclaimedRewardsTotal: [], - options: Options.fromPartial({}) + options: undefined }; } export const Record = { @@ -341,12 +344,16 @@ export const Record = { return message; }, fromAmino(object: RecordAmino): Record { - return { - numShares: object.num_shares, - accumValuePerShare: Array.isArray(object?.accum_value_per_share) ? object.accum_value_per_share.map((e: any) => DecCoin.fromAmino(e)) : [], - unclaimedRewardsTotal: Array.isArray(object?.unclaimed_rewards_total) ? object.unclaimed_rewards_total.map((e: any) => DecCoin.fromAmino(e)) : [], - options: object?.options ? Options.fromAmino(object.options) : undefined - }; + const message = createBaseRecord(); + if (object.num_shares !== undefined && object.num_shares !== null) { + message.numShares = object.num_shares; + } + message.accumValuePerShare = object.accum_value_per_share?.map(e => DecCoin.fromAmino(e)) || []; + message.unclaimedRewardsTotal = object.unclaimed_rewards_total?.map(e => DecCoin.fromAmino(e)) || []; + if (object.options !== undefined && object.options !== null) { + message.options = Options.fromAmino(object.options); + } + return message; }, toAmino(message: Record): RecordAmino { const obj: any = {}; diff --git a/packages/osmo-query/src/codegen/osmosis/bundle.ts b/packages/osmo-query/src/codegen/osmosis/bundle.ts index ae8d24f63..215918275 100644 --- a/packages/osmo-query/src/codegen/osmosis/bundle.ts +++ b/packages/osmo-query/src/codegen/osmosis/bundle.ts @@ -1,406 +1,436 @@ -import * as _89 from "./accum/v1beta1/accum"; -import * as _90 from "./concentrated-liquidity/params"; -import * as _91 from "./cosmwasmpool/v1beta1/genesis"; -import * as _92 from "./cosmwasmpool/v1beta1/gov"; -import * as _93 from "./cosmwasmpool/v1beta1/model/instantiate_msg"; -import * as _94 from "./cosmwasmpool/v1beta1/model/module_query_msg"; -import * as _95 from "./cosmwasmpool/v1beta1/model/module_sudo_msg"; -import * as _96 from "./cosmwasmpool/v1beta1/model/pool_query_msg"; -import * as _97 from "./cosmwasmpool/v1beta1/model/pool"; -import * as _98 from "./cosmwasmpool/v1beta1/model/transmuter_msgs"; -import * as _99 from "./cosmwasmpool/v1beta1/model/tx"; -import * as _100 from "./cosmwasmpool/v1beta1/params"; -import * as _101 from "./cosmwasmpool/v1beta1/query"; -import * as _102 from "./cosmwasmpool/v1beta1/tx"; -import * as _103 from "./downtime-detector/v1beta1/downtime_duration"; -import * as _104 from "./downtime-detector/v1beta1/genesis"; -import * as _105 from "./downtime-detector/v1beta1/query"; -import * as _106 from "./epochs/genesis"; -import * as _107 from "./epochs/query"; -import * as _108 from "./gamm/pool-models/balancer/balancerPool"; -import * as _109 from "./gamm/v1beta1/genesis"; -import * as _110 from "./gamm/v1beta1/gov"; -import * as _111 from "./gamm/v1beta1/query"; -import * as _112 from "./gamm/v1beta1/shared"; -import * as _113 from "./gamm/v1beta1/tx"; -import * as _114 from "./gamm/pool-models/balancer/tx/tx"; -import * as _115 from "./gamm/pool-models/stableswap/stableswap_pool"; -import * as _116 from "./gamm/pool-models/stableswap/tx"; -import * as _117 from "./gamm/v2/query"; -import * as _118 from "./ibc-rate-limit/v1beta1/genesis"; -import * as _119 from "./ibc-rate-limit/v1beta1/params"; -import * as _120 from "./ibc-rate-limit/v1beta1/query"; -import * as _121 from "./incentives/gauge"; -import * as _122 from "./incentives/genesis"; -import * as _123 from "./incentives/params"; -import * as _124 from "./incentives/query"; -import * as _125 from "./incentives/tx"; -import * as _126 from "./lockup/genesis"; -import * as _127 from "./lockup/lock"; -import * as _128 from "./lockup/params"; -import * as _129 from "./lockup/query"; -import * as _130 from "./lockup/tx"; -import * as _131 from "./mint/v1beta1/genesis"; -import * as _132 from "./mint/v1beta1/mint"; -import * as _133 from "./mint/v1beta1/query"; -import * as _134 from "./pool-incentives/v1beta1/genesis"; -import * as _135 from "./pool-incentives/v1beta1/gov"; -import * as _136 from "./pool-incentives/v1beta1/incentives"; -import * as _137 from "./pool-incentives/v1beta1/query"; -import * as _138 from "./pool-incentives/v1beta1/shared"; -import * as _139 from "./poolmanager/v1beta1/genesis"; -import * as _140 from "./poolmanager/v1beta1/module_route"; -import * as _141 from "./poolmanager/v1beta1/query"; -import * as _142 from "./poolmanager/v1beta1/swap_route"; -import * as _143 from "./poolmanager/v1beta1/tx"; -import * as _144 from "./protorev/v1beta1/genesis"; -import * as _145 from "./protorev/v1beta1/gov"; -import * as _146 from "./protorev/v1beta1/params"; -import * as _147 from "./protorev/v1beta1/protorev"; -import * as _148 from "./protorev/v1beta1/query"; -import * as _149 from "./protorev/v1beta1/tx"; -import * as _150 from "./sumtree/v1beta1/tree"; -import * as _151 from "./superfluid/genesis"; -import * as _152 from "./superfluid/params"; -import * as _153 from "./superfluid/query"; -import * as _154 from "./superfluid/superfluid"; -import * as _155 from "./superfluid/tx"; -import * as _156 from "./tokenfactory/v1beta1/authorityMetadata"; -import * as _157 from "./tokenfactory/v1beta1/genesis"; -import * as _158 from "./tokenfactory/v1beta1/params"; -import * as _159 from "./tokenfactory/v1beta1/query"; -import * as _160 from "./tokenfactory/v1beta1/tx"; -import * as _161 from "./twap/v1beta1/genesis"; -import * as _162 from "./twap/v1beta1/query"; -import * as _163 from "./twap/v1beta1/twap_record"; -import * as _164 from "./txfees/v1beta1/feetoken"; -import * as _165 from "./txfees/v1beta1/genesis"; -import * as _166 from "./txfees/v1beta1/gov"; -import * as _167 from "./txfees/v1beta1/query"; -import * as _168 from "./valset-pref/v1beta1/query"; -import * as _169 from "./valset-pref/v1beta1/state"; -import * as _170 from "./valset-pref/v1beta1/tx"; -import * as _260 from "./concentrated-liquidity/pool-model/concentrated/tx.amino"; -import * as _261 from "./concentrated-liquidity/tx.amino"; -import * as _262 from "./gamm/pool-models/balancer/tx/tx.amino"; -import * as _263 from "./gamm/pool-models/stableswap/tx.amino"; -import * as _264 from "./gamm/v1beta1/tx.amino"; -import * as _265 from "./incentives/tx.amino"; -import * as _266 from "./lockup/tx.amino"; -import * as _267 from "./poolmanager/v1beta1/tx.amino"; -import * as _268 from "./protorev/v1beta1/tx.amino"; -import * as _269 from "./superfluid/tx.amino"; -import * as _270 from "./tokenfactory/v1beta1/tx.amino"; -import * as _271 from "./valset-pref/v1beta1/tx.amino"; -import * as _272 from "./concentrated-liquidity/pool-model/concentrated/tx.registry"; -import * as _273 from "./concentrated-liquidity/tx.registry"; -import * as _274 from "./gamm/pool-models/balancer/tx/tx.registry"; -import * as _275 from "./gamm/pool-models/stableswap/tx.registry"; -import * as _276 from "./gamm/v1beta1/tx.registry"; -import * as _277 from "./incentives/tx.registry"; -import * as _278 from "./lockup/tx.registry"; -import * as _279 from "./poolmanager/v1beta1/tx.registry"; -import * as _280 from "./protorev/v1beta1/tx.registry"; -import * as _281 from "./superfluid/tx.registry"; -import * as _282 from "./tokenfactory/v1beta1/tx.registry"; -import * as _283 from "./valset-pref/v1beta1/tx.registry"; -import * as _284 from "./concentrated-liquidity/query.lcd"; -import * as _285 from "./cosmwasmpool/v1beta1/query.lcd"; -import * as _286 from "./downtime-detector/v1beta1/query.lcd"; -import * as _287 from "./epochs/query.lcd"; -import * as _288 from "./gamm/v1beta1/query.lcd"; -import * as _289 from "./gamm/v2/query.lcd"; -import * as _290 from "./ibc-rate-limit/v1beta1/query.lcd"; -import * as _291 from "./incentives/query.lcd"; -import * as _292 from "./lockup/query.lcd"; -import * as _293 from "./mint/v1beta1/query.lcd"; -import * as _294 from "./pool-incentives/v1beta1/query.lcd"; -import * as _295 from "./poolmanager/v1beta1/query.lcd"; -import * as _296 from "./protorev/v1beta1/query.lcd"; -import * as _297 from "./superfluid/query.lcd"; -import * as _298 from "./tokenfactory/v1beta1/query.lcd"; -import * as _299 from "./twap/v1beta1/query.lcd"; -import * as _300 from "./txfees/v1beta1/query.lcd"; -import * as _301 from "./valset-pref/v1beta1/query.lcd"; -import * as _302 from "./concentrated-liquidity/query.rpc.Query"; -import * as _303 from "./cosmwasmpool/v1beta1/query.rpc.Query"; -import * as _304 from "./downtime-detector/v1beta1/query.rpc.Query"; -import * as _305 from "./epochs/query.rpc.Query"; -import * as _306 from "./gamm/v1beta1/query.rpc.Query"; -import * as _307 from "./gamm/v2/query.rpc.Query"; -import * as _308 from "./ibc-rate-limit/v1beta1/query.rpc.Query"; -import * as _309 from "./incentives/query.rpc.Query"; -import * as _310 from "./lockup/query.rpc.Query"; -import * as _311 from "./mint/v1beta1/query.rpc.Query"; -import * as _312 from "./pool-incentives/v1beta1/query.rpc.Query"; -import * as _313 from "./poolmanager/v1beta1/query.rpc.Query"; -import * as _314 from "./protorev/v1beta1/query.rpc.Query"; -import * as _315 from "./superfluid/query.rpc.Query"; -import * as _316 from "./tokenfactory/v1beta1/query.rpc.Query"; -import * as _317 from "./twap/v1beta1/query.rpc.Query"; -import * as _318 from "./txfees/v1beta1/query.rpc.Query"; -import * as _319 from "./valset-pref/v1beta1/query.rpc.Query"; -import * as _320 from "./concentrated-liquidity/pool-model/concentrated/tx.rpc.msg"; -import * as _321 from "./concentrated-liquidity/tx.rpc.msg"; -import * as _322 from "./gamm/pool-models/balancer/tx/tx.rpc.msg"; -import * as _323 from "./gamm/pool-models/stableswap/tx.rpc.msg"; -import * as _324 from "./gamm/v1beta1/tx.rpc.msg"; -import * as _325 from "./incentives/tx.rpc.msg"; -import * as _326 from "./lockup/tx.rpc.msg"; -import * as _327 from "./poolmanager/v1beta1/tx.rpc.msg"; -import * as _328 from "./protorev/v1beta1/tx.rpc.msg"; -import * as _329 from "./superfluid/tx.rpc.msg"; -import * as _330 from "./tokenfactory/v1beta1/tx.rpc.msg"; -import * as _331 from "./valset-pref/v1beta1/tx.rpc.msg"; -import * as _341 from "./lcd"; -import * as _342 from "./rpc.query"; -import * as _343 from "./rpc.tx"; +import * as _137 from "./accum/v1beta1/accum"; +import * as _138 from "./concentratedliquidity/params"; +import * as _139 from "./cosmwasmpool/v1beta1/genesis"; +import * as _140 from "./cosmwasmpool/v1beta1/gov"; +import * as _141 from "./cosmwasmpool/v1beta1/model/instantiate_msg"; +import * as _142 from "./cosmwasmpool/v1beta1/model/module_query_msg"; +import * as _143 from "./cosmwasmpool/v1beta1/model/module_sudo_msg"; +import * as _144 from "./cosmwasmpool/v1beta1/model/pool_query_msg"; +import * as _145 from "./cosmwasmpool/v1beta1/model/pool"; +import * as _146 from "./cosmwasmpool/v1beta1/model/transmuter_msgs"; +import * as _147 from "./cosmwasmpool/v1beta1/model/tx"; +import * as _148 from "./cosmwasmpool/v1beta1/params"; +import * as _149 from "./cosmwasmpool/v1beta1/query"; +import * as _150 from "./cosmwasmpool/v1beta1/tx"; +import * as _151 from "./downtimedetector/v1beta1/downtime_duration"; +import * as _152 from "./downtimedetector/v1beta1/genesis"; +import * as _153 from "./downtimedetector/v1beta1/query"; +import * as _154 from "./epochs/v1beta1/genesis"; +import * as _155 from "./epochs/v1beta1/query"; +import * as _156 from "./gamm/poolmodels/balancer/v1beta1/tx"; +import * as _157 from "./gamm/poolmodels/stableswap/v1beta1/stableswap_pool"; +import * as _158 from "./gamm/poolmodels/stableswap/v1beta1/tx"; +import * as _159 from "./gamm/v1beta1/balancerPool"; +import * as _160 from "./gamm/v1beta1/genesis"; +import * as _161 from "./gamm/v1beta1/gov"; +import * as _162 from "./gamm/v1beta1/query"; +import * as _163 from "./gamm/v1beta1/shared"; +import * as _164 from "./gamm/v1beta1/tx"; +import * as _165 from "./gamm/v2/query"; +import * as _166 from "./ibchooks/genesis"; +import * as _167 from "./ibchooks/params"; +import * as _168 from "./ibchooks/tx"; +import * as _169 from "./ibcratelimit/v1beta1/genesis"; +import * as _170 from "./ibcratelimit/v1beta1/params"; +import * as _171 from "./ibcratelimit/v1beta1/query"; +import * as _172 from "./incentives/gauge"; +import * as _173 from "./incentives/genesis"; +import * as _174 from "./incentives/gov"; +import * as _175 from "./incentives/group"; +import * as _176 from "./incentives/params"; +import * as _177 from "./incentives/query"; +import * as _178 from "./incentives/tx"; +import * as _179 from "./lockup/genesis"; +import * as _180 from "./lockup/lock"; +import * as _181 from "./lockup/params"; +import * as _182 from "./lockup/query"; +import * as _183 from "./lockup/tx"; +import * as _184 from "./mint/v1beta1/genesis"; +import * as _185 from "./mint/v1beta1/mint"; +import * as _186 from "./mint/v1beta1/query"; +import * as _187 from "./poolincentives/v1beta1/genesis"; +import * as _188 from "./poolincentives/v1beta1/gov"; +import * as _189 from "./poolincentives/v1beta1/incentives"; +import * as _190 from "./poolincentives/v1beta1/query"; +import * as _191 from "./poolincentives/v1beta1/shared"; +import * as _192 from "./poolmanager/v1beta1/genesis"; +import * as _193 from "./poolmanager/v1beta1/gov"; +import * as _194 from "./poolmanager/v1beta1/module_route"; +import * as _195 from "./poolmanager/v1beta1/query"; +import * as _196 from "./poolmanager/v1beta1/swap_route"; +import * as _197 from "./poolmanager/v1beta1/tracked_volume"; +import * as _198 from "./poolmanager/v1beta1/tx"; +import * as _199 from "./poolmanager/v2/query"; +import * as _200 from "./protorev/v1beta1/genesis"; +import * as _201 from "./protorev/v1beta1/gov"; +import * as _202 from "./protorev/v1beta1/params"; +import * as _203 from "./protorev/v1beta1/protorev"; +import * as _204 from "./protorev/v1beta1/query"; +import * as _205 from "./protorev/v1beta1/tx"; +import * as _206 from "./store/v1beta1/tree"; +import * as _207 from "./superfluid/genesis"; +import * as _208 from "./superfluid/params"; +import * as _209 from "./superfluid/query"; +import * as _210 from "./superfluid/superfluid"; +import * as _211 from "./superfluid/tx"; +import * as _212 from "./tokenfactory/v1beta1/authorityMetadata"; +import * as _213 from "./tokenfactory/v1beta1/genesis"; +import * as _214 from "./tokenfactory/v1beta1/params"; +import * as _215 from "./tokenfactory/v1beta1/query"; +import * as _216 from "./tokenfactory/v1beta1/tx"; +import * as _217 from "./twap/v1beta1/genesis"; +import * as _218 from "./twap/v1beta1/query"; +import * as _219 from "./twap/v1beta1/twap_record"; +import * as _220 from "./txfees/v1beta1/feetoken"; +import * as _221 from "./txfees/v1beta1/genesis"; +import * as _222 from "./txfees/v1beta1/gov"; +import * as _223 from "./txfees/v1beta1/query"; +import * as _224 from "./valsetpref/v1beta1/query"; +import * as _225 from "./valsetpref/v1beta1/state"; +import * as _226 from "./valsetpref/v1beta1/tx"; +import * as _325 from "./concentratedliquidity/poolmodel/concentrated/v1beta1/tx.amino"; +import * as _326 from "./concentratedliquidity/v1beta1/tx.amino"; +import * as _327 from "./gamm/poolmodels/balancer/v1beta1/tx.amino"; +import * as _328 from "./gamm/poolmodels/stableswap/v1beta1/tx.amino"; +import * as _329 from "./gamm/v1beta1/tx.amino"; +import * as _330 from "./ibchooks/tx.amino"; +import * as _331 from "./incentives/tx.amino"; +import * as _332 from "./lockup/tx.amino"; +import * as _333 from "./poolmanager/v1beta1/tx.amino"; +import * as _334 from "./protorev/v1beta1/tx.amino"; +import * as _335 from "./superfluid/tx.amino"; +import * as _336 from "./tokenfactory/v1beta1/tx.amino"; +import * as _337 from "./valsetpref/v1beta1/tx.amino"; +import * as _338 from "./concentratedliquidity/poolmodel/concentrated/v1beta1/tx.registry"; +import * as _339 from "./concentratedliquidity/v1beta1/tx.registry"; +import * as _340 from "./gamm/poolmodels/balancer/v1beta1/tx.registry"; +import * as _341 from "./gamm/poolmodels/stableswap/v1beta1/tx.registry"; +import * as _342 from "./gamm/v1beta1/tx.registry"; +import * as _343 from "./ibchooks/tx.registry"; +import * as _344 from "./incentives/tx.registry"; +import * as _345 from "./lockup/tx.registry"; +import * as _346 from "./poolmanager/v1beta1/tx.registry"; +import * as _347 from "./protorev/v1beta1/tx.registry"; +import * as _348 from "./superfluid/tx.registry"; +import * as _349 from "./tokenfactory/v1beta1/tx.registry"; +import * as _350 from "./valsetpref/v1beta1/tx.registry"; +import * as _351 from "./concentratedliquidity/v1beta1/query.lcd"; +import * as _352 from "./cosmwasmpool/v1beta1/query.lcd"; +import * as _353 from "./downtimedetector/v1beta1/query.lcd"; +import * as _354 from "./epochs/v1beta1/query.lcd"; +import * as _355 from "./gamm/v1beta1/query.lcd"; +import * as _356 from "./gamm/v2/query.lcd"; +import * as _357 from "./ibcratelimit/v1beta1/query.lcd"; +import * as _358 from "./incentives/query.lcd"; +import * as _359 from "./lockup/query.lcd"; +import * as _360 from "./mint/v1beta1/query.lcd"; +import * as _361 from "./poolincentives/v1beta1/query.lcd"; +import * as _362 from "./poolmanager/v1beta1/query.lcd"; +import * as _363 from "./poolmanager/v2/query.lcd"; +import * as _364 from "./protorev/v1beta1/query.lcd"; +import * as _365 from "./superfluid/query.lcd"; +import * as _366 from "./tokenfactory/v1beta1/query.lcd"; +import * as _367 from "./twap/v1beta1/query.lcd"; +import * as _368 from "./txfees/v1beta1/query.lcd"; +import * as _369 from "./valsetpref/v1beta1/query.lcd"; +import * as _370 from "./concentratedliquidity/v1beta1/query.rpc.Query"; +import * as _371 from "./cosmwasmpool/v1beta1/query.rpc.Query"; +import * as _372 from "./downtimedetector/v1beta1/query.rpc.Query"; +import * as _373 from "./epochs/v1beta1/query.rpc.Query"; +import * as _374 from "./gamm/v1beta1/query.rpc.Query"; +import * as _375 from "./gamm/v2/query.rpc.Query"; +import * as _376 from "./ibcratelimit/v1beta1/query.rpc.Query"; +import * as _377 from "./incentives/query.rpc.Query"; +import * as _378 from "./lockup/query.rpc.Query"; +import * as _379 from "./mint/v1beta1/query.rpc.Query"; +import * as _380 from "./poolincentives/v1beta1/query.rpc.Query"; +import * as _381 from "./poolmanager/v1beta1/query.rpc.Query"; +import * as _382 from "./poolmanager/v2/query.rpc.Query"; +import * as _383 from "./protorev/v1beta1/query.rpc.Query"; +import * as _384 from "./superfluid/query.rpc.Query"; +import * as _385 from "./tokenfactory/v1beta1/query.rpc.Query"; +import * as _386 from "./twap/v1beta1/query.rpc.Query"; +import * as _387 from "./txfees/v1beta1/query.rpc.Query"; +import * as _388 from "./valsetpref/v1beta1/query.rpc.Query"; +import * as _389 from "./concentratedliquidity/poolmodel/concentrated/v1beta1/tx.rpc.msg"; +import * as _390 from "./concentratedliquidity/v1beta1/tx.rpc.msg"; +import * as _391 from "./gamm/poolmodels/balancer/v1beta1/tx.rpc.msg"; +import * as _392 from "./gamm/poolmodels/stableswap/v1beta1/tx.rpc.msg"; +import * as _393 from "./gamm/v1beta1/tx.rpc.msg"; +import * as _394 from "./ibchooks/tx.rpc.msg"; +import * as _395 from "./incentives/tx.rpc.msg"; +import * as _396 from "./lockup/tx.rpc.msg"; +import * as _397 from "./poolmanager/v1beta1/tx.rpc.msg"; +import * as _398 from "./protorev/v1beta1/tx.rpc.msg"; +import * as _399 from "./superfluid/tx.rpc.msg"; +import * as _400 from "./tokenfactory/v1beta1/tx.rpc.msg"; +import * as _401 from "./valsetpref/v1beta1/tx.rpc.msg"; +import * as _411 from "./lcd"; +import * as _412 from "./rpc.query"; +import * as _413 from "./rpc.tx"; export namespace osmosis { export namespace accum { export const v1beta1 = { - ..._89 + ..._137 }; } export const concentratedliquidity = { - ..._90, + ..._138, poolmodel: { concentrated: { v1beta1: { - ..._260, - ..._272, - ..._320 + ..._325, + ..._338, + ..._389 } } }, v1beta1: { - ..._261, - ..._273, - ..._284, - ..._302, - ..._321 + ..._326, + ..._339, + ..._351, + ..._370, + ..._390 } }; export namespace cosmwasmpool { export const v1beta1 = { - ..._91, - ..._92, - ..._93, - ..._94, - ..._95, - ..._96, - ..._97, - ..._98, - ..._99, - ..._100, - ..._101, - ..._102, - ..._285, - ..._303 + ..._139, + ..._140, + ..._141, + ..._142, + ..._143, + ..._144, + ..._145, + ..._146, + ..._147, + ..._148, + ..._149, + ..._150, + ..._352, + ..._371 }; } export namespace downtimedetector { export const v1beta1 = { - ..._103, - ..._104, - ..._105, - ..._286, - ..._304 + ..._151, + ..._152, + ..._153, + ..._353, + ..._372 }; } export namespace epochs { export const v1beta1 = { - ..._106, - ..._107, - ..._287, - ..._305 + ..._154, + ..._155, + ..._354, + ..._373 }; } export namespace gamm { - export const v1beta1 = { - ..._108, - ..._109, - ..._110, - ..._111, - ..._112, - ..._113, - ..._264, - ..._276, - ..._288, - ..._306, - ..._324 - }; export namespace poolmodels { export namespace balancer { export const v1beta1 = { - ..._114, - ..._262, - ..._274, - ..._322 + ..._156, + ..._327, + ..._340, + ..._391 }; } export namespace stableswap { export const v1beta1 = { - ..._115, - ..._116, - ..._263, - ..._275, - ..._323 + ..._157, + ..._158, + ..._328, + ..._341, + ..._392 }; } } + export const v1beta1 = { + ..._159, + ..._160, + ..._161, + ..._162, + ..._163, + ..._164, + ..._329, + ..._342, + ..._355, + ..._374, + ..._393 + }; export const v2 = { - ..._117, - ..._289, - ..._307 + ..._165, + ..._356, + ..._375 }; } + export const ibchooks = { + ..._166, + ..._167, + ..._168, + ..._330, + ..._343, + ..._394 + }; export namespace ibcratelimit { export const v1beta1 = { - ..._118, - ..._119, - ..._120, - ..._290, - ..._308 + ..._169, + ..._170, + ..._171, + ..._357, + ..._376 }; } export const incentives = { - ..._121, - ..._122, - ..._123, - ..._124, - ..._125, - ..._265, - ..._277, - ..._291, - ..._309, - ..._325 + ..._172, + ..._173, + ..._174, + ..._175, + ..._176, + ..._177, + ..._178, + ..._331, + ..._344, + ..._358, + ..._377, + ..._395 }; export const lockup = { - ..._126, - ..._127, - ..._128, - ..._129, - ..._130, - ..._266, - ..._278, - ..._292, - ..._310, - ..._326 + ..._179, + ..._180, + ..._181, + ..._182, + ..._183, + ..._332, + ..._345, + ..._359, + ..._378, + ..._396 }; export namespace mint { export const v1beta1 = { - ..._131, - ..._132, - ..._133, - ..._293, - ..._311 + ..._184, + ..._185, + ..._186, + ..._360, + ..._379 }; } export namespace poolincentives { export const v1beta1 = { - ..._134, - ..._135, - ..._136, - ..._137, - ..._138, - ..._294, - ..._312 + ..._187, + ..._188, + ..._189, + ..._190, + ..._191, + ..._361, + ..._380 }; } export namespace poolmanager { export const v1beta1 = { - ..._139, - ..._140, - ..._141, - ..._142, - ..._143, - ..._267, - ..._279, - ..._295, - ..._313, - ..._327 + ..._192, + ..._193, + ..._194, + ..._195, + ..._196, + ..._197, + ..._198, + ..._333, + ..._346, + ..._362, + ..._381, + ..._397 + }; + export const v2 = { + ..._199, + ..._363, + ..._382 }; } export namespace protorev { export const v1beta1 = { - ..._144, - ..._145, - ..._146, - ..._147, - ..._148, - ..._149, - ..._268, - ..._280, - ..._296, - ..._314, - ..._328 + ..._200, + ..._201, + ..._202, + ..._203, + ..._204, + ..._205, + ..._334, + ..._347, + ..._364, + ..._383, + ..._398 }; } export namespace store { export const v1beta1 = { - ..._150 + ..._206 }; } export const superfluid = { - ..._151, - ..._152, - ..._153, - ..._154, - ..._155, - ..._269, - ..._281, - ..._297, - ..._315, - ..._329 + ..._207, + ..._208, + ..._209, + ..._210, + ..._211, + ..._335, + ..._348, + ..._365, + ..._384, + ..._399 }; export namespace tokenfactory { export const v1beta1 = { - ..._156, - ..._157, - ..._158, - ..._159, - ..._160, - ..._270, - ..._282, - ..._298, - ..._316, - ..._330 + ..._212, + ..._213, + ..._214, + ..._215, + ..._216, + ..._336, + ..._349, + ..._366, + ..._385, + ..._400 }; } export namespace twap { export const v1beta1 = { - ..._161, - ..._162, - ..._163, - ..._299, - ..._317 + ..._217, + ..._218, + ..._219, + ..._367, + ..._386 }; } export namespace txfees { export const v1beta1 = { - ..._164, - ..._165, - ..._166, - ..._167, - ..._300, - ..._318 + ..._220, + ..._221, + ..._222, + ..._223, + ..._368, + ..._387 }; } export namespace valsetpref { export const v1beta1 = { - ..._168, - ..._169, - ..._170, - ..._271, - ..._283, - ..._301, - ..._319, - ..._331 + ..._224, + ..._225, + ..._226, + ..._337, + ..._350, + ..._369, + ..._388, + ..._401 }; } export const ClientFactory = { - ..._341, - ..._342, - ..._343 + ..._411, + ..._412, + ..._413 }; } \ No newline at end of file diff --git a/packages/osmo-query/src/codegen/osmosis/client.ts b/packages/osmo-query/src/codegen/osmosis/client.ts index 7caa9f0bc..4d6be5300 100644 --- a/packages/osmo-query/src/codegen/osmosis/client.ts +++ b/packages/osmo-query/src/codegen/osmosis/client.ts @@ -1,36 +1,39 @@ import { GeneratedType, Registry, OfflineSigner } from "@cosmjs/proto-signing"; import { defaultRegistryTypes, AminoTypes, SigningStargateClient } from "@cosmjs/stargate"; import { HttpEndpoint } from "@cosmjs/tendermint-rpc"; -import * as osmosisConcentratedliquidityPoolmodelConcentratedTxRegistry from "./concentrated-liquidity/pool-model/concentrated/tx.registry"; -import * as osmosisConcentratedliquidityTxRegistry from "./concentrated-liquidity/tx.registry"; -import * as osmosisGammPoolmodelsBalancerTxTxRegistry from "./gamm/pool-models/balancer/tx/tx.registry"; -import * as osmosisGammPoolmodelsStableswapTxRegistry from "./gamm/pool-models/stableswap/tx.registry"; +import * as osmosisConcentratedliquidityPoolmodelConcentratedV1beta1TxRegistry from "./concentratedliquidity/poolmodel/concentrated/v1beta1/tx.registry"; +import * as osmosisConcentratedliquidityV1beta1TxRegistry from "./concentratedliquidity/v1beta1/tx.registry"; +import * as osmosisGammPoolmodelsBalancerV1beta1TxRegistry from "./gamm/poolmodels/balancer/v1beta1/tx.registry"; +import * as osmosisGammPoolmodelsStableswapV1beta1TxRegistry from "./gamm/poolmodels/stableswap/v1beta1/tx.registry"; import * as osmosisGammV1beta1TxRegistry from "./gamm/v1beta1/tx.registry"; +import * as osmosisIbchooksTxRegistry from "./ibchooks/tx.registry"; import * as osmosisIncentivesTxRegistry from "./incentives/tx.registry"; import * as osmosisLockupTxRegistry from "./lockup/tx.registry"; import * as osmosisPoolmanagerV1beta1TxRegistry from "./poolmanager/v1beta1/tx.registry"; import * as osmosisProtorevV1beta1TxRegistry from "./protorev/v1beta1/tx.registry"; import * as osmosisSuperfluidTxRegistry from "./superfluid/tx.registry"; import * as osmosisTokenfactoryV1beta1TxRegistry from "./tokenfactory/v1beta1/tx.registry"; -import * as osmosisValsetprefV1beta1TxRegistry from "./valset-pref/v1beta1/tx.registry"; -import * as osmosisConcentratedliquidityPoolmodelConcentratedTxAmino from "./concentrated-liquidity/pool-model/concentrated/tx.amino"; -import * as osmosisConcentratedliquidityTxAmino from "./concentrated-liquidity/tx.amino"; -import * as osmosisGammPoolmodelsBalancerTxTxAmino from "./gamm/pool-models/balancer/tx/tx.amino"; -import * as osmosisGammPoolmodelsStableswapTxAmino from "./gamm/pool-models/stableswap/tx.amino"; +import * as osmosisValsetprefV1beta1TxRegistry from "./valsetpref/v1beta1/tx.registry"; +import * as osmosisConcentratedliquidityPoolmodelConcentratedV1beta1TxAmino from "./concentratedliquidity/poolmodel/concentrated/v1beta1/tx.amino"; +import * as osmosisConcentratedliquidityV1beta1TxAmino from "./concentratedliquidity/v1beta1/tx.amino"; +import * as osmosisGammPoolmodelsBalancerV1beta1TxAmino from "./gamm/poolmodels/balancer/v1beta1/tx.amino"; +import * as osmosisGammPoolmodelsStableswapV1beta1TxAmino from "./gamm/poolmodels/stableswap/v1beta1/tx.amino"; import * as osmosisGammV1beta1TxAmino from "./gamm/v1beta1/tx.amino"; +import * as osmosisIbchooksTxAmino from "./ibchooks/tx.amino"; import * as osmosisIncentivesTxAmino from "./incentives/tx.amino"; import * as osmosisLockupTxAmino from "./lockup/tx.amino"; import * as osmosisPoolmanagerV1beta1TxAmino from "./poolmanager/v1beta1/tx.amino"; import * as osmosisProtorevV1beta1TxAmino from "./protorev/v1beta1/tx.amino"; import * as osmosisSuperfluidTxAmino from "./superfluid/tx.amino"; import * as osmosisTokenfactoryV1beta1TxAmino from "./tokenfactory/v1beta1/tx.amino"; -import * as osmosisValsetprefV1beta1TxAmino from "./valset-pref/v1beta1/tx.amino"; +import * as osmosisValsetprefV1beta1TxAmino from "./valsetpref/v1beta1/tx.amino"; export const osmosisAminoConverters = { - ...osmosisConcentratedliquidityPoolmodelConcentratedTxAmino.AminoConverter, - ...osmosisConcentratedliquidityTxAmino.AminoConverter, - ...osmosisGammPoolmodelsBalancerTxTxAmino.AminoConverter, - ...osmosisGammPoolmodelsStableswapTxAmino.AminoConverter, + ...osmosisConcentratedliquidityPoolmodelConcentratedV1beta1TxAmino.AminoConverter, + ...osmosisConcentratedliquidityV1beta1TxAmino.AminoConverter, + ...osmosisGammPoolmodelsBalancerV1beta1TxAmino.AminoConverter, + ...osmosisGammPoolmodelsStableswapV1beta1TxAmino.AminoConverter, ...osmosisGammV1beta1TxAmino.AminoConverter, + ...osmosisIbchooksTxAmino.AminoConverter, ...osmosisIncentivesTxAmino.AminoConverter, ...osmosisLockupTxAmino.AminoConverter, ...osmosisPoolmanagerV1beta1TxAmino.AminoConverter, @@ -39,7 +42,7 @@ export const osmosisAminoConverters = { ...osmosisTokenfactoryV1beta1TxAmino.AminoConverter, ...osmosisValsetprefV1beta1TxAmino.AminoConverter }; -export const osmosisProtoRegistry: ReadonlyArray<[string, GeneratedType]> = [...osmosisConcentratedliquidityPoolmodelConcentratedTxRegistry.registry, ...osmosisConcentratedliquidityTxRegistry.registry, ...osmosisGammPoolmodelsBalancerTxTxRegistry.registry, ...osmosisGammPoolmodelsStableswapTxRegistry.registry, ...osmosisGammV1beta1TxRegistry.registry, ...osmosisIncentivesTxRegistry.registry, ...osmosisLockupTxRegistry.registry, ...osmosisPoolmanagerV1beta1TxRegistry.registry, ...osmosisProtorevV1beta1TxRegistry.registry, ...osmosisSuperfluidTxRegistry.registry, ...osmosisTokenfactoryV1beta1TxRegistry.registry, ...osmosisValsetprefV1beta1TxRegistry.registry]; +export const osmosisProtoRegistry: ReadonlyArray<[string, GeneratedType]> = [...osmosisConcentratedliquidityPoolmodelConcentratedV1beta1TxRegistry.registry, ...osmosisConcentratedliquidityV1beta1TxRegistry.registry, ...osmosisGammPoolmodelsBalancerV1beta1TxRegistry.registry, ...osmosisGammPoolmodelsStableswapV1beta1TxRegistry.registry, ...osmosisGammV1beta1TxRegistry.registry, ...osmosisIbchooksTxRegistry.registry, ...osmosisIncentivesTxRegistry.registry, ...osmosisLockupTxRegistry.registry, ...osmosisPoolmanagerV1beta1TxRegistry.registry, ...osmosisProtorevV1beta1TxRegistry.registry, ...osmosisSuperfluidTxRegistry.registry, ...osmosisTokenfactoryV1beta1TxRegistry.registry, ...osmosisValsetprefV1beta1TxRegistry.registry]; export const getSigningOsmosisClientOptions = ({ defaultTypes = defaultRegistryTypes }: { diff --git a/packages/osmo-query/src/codegen/osmosis/concentrated-liquidity/params.ts b/packages/osmo-query/src/codegen/osmosis/concentratedliquidity/params.ts similarity index 72% rename from packages/osmo-query/src/codegen/osmosis/concentrated-liquidity/params.ts rename to packages/osmo-query/src/codegen/osmosis/concentratedliquidity/params.ts index 9078bd9ab..9984d1ae6 100644 --- a/packages/osmo-query/src/codegen/osmosis/concentrated-liquidity/params.ts +++ b/packages/osmo-query/src/codegen/osmosis/concentratedliquidity/params.ts @@ -22,7 +22,7 @@ export interface Params { /** * authorized_quote_denoms is a list of quote denoms that can be used as * token1 when creating a pool. We limit the quote assets to a small set for - * the purposes of having convinient price increments stemming from tick to + * the purposes of having convenient price increments stemming from tick to * price conversion. These increments are in a human readable magnitude only * for token1 as a quote. For limit orders in the future, this will be a * desirable property in terms of UX as to allow users to set limit orders at @@ -38,6 +38,14 @@ export interface Params { * with a governance proposal. */ isPermissionlessPoolCreationEnabled: boolean; + /** + * unrestricted_pool_creator_whitelist is a list of addresses that are + * allowed to bypass restrictions on permissionless supercharged pool + * creation, like pool_creation_enabled, restricted quote assets, no + * double creation of pools, etc. + */ + unrestrictedPoolCreatorWhitelist: string[]; + hookGasLimit: bigint; } export interface ParamsProtoMsg { typeUrl: "/osmosis.concentratedliquidity.Params"; @@ -50,8 +58,8 @@ export interface ParamsAmino { * example, an authorized_tick_spacing of [1, 10, 30] allows for pools * to be created with tick spacing of 1, 10, or 30. */ - authorized_tick_spacing: string[]; - authorized_spread_factors: string[]; + authorized_tick_spacing?: string[]; + authorized_spread_factors?: string[]; /** * balancer_shares_reward_discount is the rate by which incentives flowing * from CL to Balancer pools will be discounted to encourage LPs to migrate. @@ -60,18 +68,18 @@ export interface ParamsAmino { * This field can range from (0,1]. If set to 1, it indicates that all * incentives stay at cl pool. */ - balancer_shares_reward_discount: string; + balancer_shares_reward_discount?: string; /** * authorized_quote_denoms is a list of quote denoms that can be used as * token1 when creating a pool. We limit the quote assets to a small set for - * the purposes of having convinient price increments stemming from tick to + * the purposes of having convenient price increments stemming from tick to * price conversion. These increments are in a human readable magnitude only * for token1 as a quote. For limit orders in the future, this will be a * desirable property in terms of UX as to allow users to set limit orders at * prices in terms of token1 (quote asset) that are easy to reason about. */ - authorized_quote_denoms: string[]; - authorized_uptimes: DurationAmino[]; + authorized_quote_denoms?: string[]; + authorized_uptimes?: DurationAmino[]; /** * is_permissionless_pool_creation_enabled is a boolean that determines if * concentrated liquidity pools can be created via message. At launch, @@ -79,7 +87,15 @@ export interface ParamsAmino { * allowing permissionless pool creation by switching this flag to true * with a governance proposal. */ - is_permissionless_pool_creation_enabled: boolean; + is_permissionless_pool_creation_enabled?: boolean; + /** + * unrestricted_pool_creator_whitelist is a list of addresses that are + * allowed to bypass restrictions on permissionless supercharged pool + * creation, like pool_creation_enabled, restricted quote assets, no + * double creation of pools, etc. + */ + unrestricted_pool_creator_whitelist?: string[]; + hook_gas_limit?: string; } export interface ParamsAminoMsg { type: "osmosis/concentratedliquidity/params"; @@ -92,6 +108,8 @@ export interface ParamsSDKType { authorized_quote_denoms: string[]; authorized_uptimes: DurationSDKType[]; is_permissionless_pool_creation_enabled: boolean; + unrestricted_pool_creator_whitelist: string[]; + hook_gas_limit: bigint; } function createBaseParams(): Params { return { @@ -100,7 +118,9 @@ function createBaseParams(): Params { balancerSharesRewardDiscount: "", authorizedQuoteDenoms: [], authorizedUptimes: [], - isPermissionlessPoolCreationEnabled: false + isPermissionlessPoolCreationEnabled: false, + unrestrictedPoolCreatorWhitelist: [], + hookGasLimit: BigInt(0) }; } export const Params = { @@ -126,6 +146,12 @@ export const Params = { if (message.isPermissionlessPoolCreationEnabled === true) { writer.uint32(48).bool(message.isPermissionlessPoolCreationEnabled); } + for (const v of message.unrestrictedPoolCreatorWhitelist) { + writer.uint32(58).string(v!); + } + if (message.hookGasLimit !== BigInt(0)) { + writer.uint32(64).uint64(message.hookGasLimit); + } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): Params { @@ -160,6 +186,12 @@ export const Params = { case 6: message.isPermissionlessPoolCreationEnabled = reader.bool(); break; + case 7: + message.unrestrictedPoolCreatorWhitelist.push(reader.string()); + break; + case 8: + message.hookGasLimit = reader.uint64(); + break; default: reader.skipType(tag & 7); break; @@ -175,17 +207,27 @@ export const Params = { message.authorizedQuoteDenoms = object.authorizedQuoteDenoms?.map(e => e) || []; message.authorizedUptimes = object.authorizedUptimes?.map(e => Duration.fromPartial(e)) || []; message.isPermissionlessPoolCreationEnabled = object.isPermissionlessPoolCreationEnabled ?? false; + message.unrestrictedPoolCreatorWhitelist = object.unrestrictedPoolCreatorWhitelist?.map(e => e) || []; + message.hookGasLimit = object.hookGasLimit !== undefined && object.hookGasLimit !== null ? BigInt(object.hookGasLimit.toString()) : BigInt(0); return message; }, fromAmino(object: ParamsAmino): Params { - return { - authorizedTickSpacing: Array.isArray(object?.authorized_tick_spacing) ? object.authorized_tick_spacing.map((e: any) => BigInt(e)) : [], - authorizedSpreadFactors: Array.isArray(object?.authorized_spread_factors) ? object.authorized_spread_factors.map((e: any) => e) : [], - balancerSharesRewardDiscount: object.balancer_shares_reward_discount, - authorizedQuoteDenoms: Array.isArray(object?.authorized_quote_denoms) ? object.authorized_quote_denoms.map((e: any) => e) : [], - authorizedUptimes: Array.isArray(object?.authorized_uptimes) ? object.authorized_uptimes.map((e: any) => Duration.fromAmino(e)) : [], - isPermissionlessPoolCreationEnabled: object.is_permissionless_pool_creation_enabled - }; + const message = createBaseParams(); + message.authorizedTickSpacing = object.authorized_tick_spacing?.map(e => BigInt(e)) || []; + message.authorizedSpreadFactors = object.authorized_spread_factors?.map(e => e) || []; + if (object.balancer_shares_reward_discount !== undefined && object.balancer_shares_reward_discount !== null) { + message.balancerSharesRewardDiscount = object.balancer_shares_reward_discount; + } + message.authorizedQuoteDenoms = object.authorized_quote_denoms?.map(e => e) || []; + message.authorizedUptimes = object.authorized_uptimes?.map(e => Duration.fromAmino(e)) || []; + if (object.is_permissionless_pool_creation_enabled !== undefined && object.is_permissionless_pool_creation_enabled !== null) { + message.isPermissionlessPoolCreationEnabled = object.is_permissionless_pool_creation_enabled; + } + message.unrestrictedPoolCreatorWhitelist = object.unrestricted_pool_creator_whitelist?.map(e => e) || []; + if (object.hook_gas_limit !== undefined && object.hook_gas_limit !== null) { + message.hookGasLimit = BigInt(object.hook_gas_limit); + } + return message; }, toAmino(message: Params): ParamsAmino { const obj: any = {}; @@ -211,6 +253,12 @@ export const Params = { obj.authorized_uptimes = []; } obj.is_permissionless_pool_creation_enabled = message.isPermissionlessPoolCreationEnabled; + if (message.unrestrictedPoolCreatorWhitelist) { + obj.unrestricted_pool_creator_whitelist = message.unrestrictedPoolCreatorWhitelist.map(e => e); + } else { + obj.unrestricted_pool_creator_whitelist = []; + } + obj.hook_gas_limit = message.hookGasLimit ? message.hookGasLimit.toString() : undefined; return obj; }, fromAminoMsg(object: ParamsAminoMsg): Params { diff --git a/packages/osmo-query/src/codegen/osmosis/concentrated-liquidity/pool-model/concentrated/tx.amino.ts b/packages/osmo-query/src/codegen/osmosis/concentratedliquidity/poolmodel/concentrated/v1beta1/tx.amino.ts similarity index 100% rename from packages/osmo-query/src/codegen/osmosis/concentrated-liquidity/pool-model/concentrated/tx.amino.ts rename to packages/osmo-query/src/codegen/osmosis/concentratedliquidity/poolmodel/concentrated/v1beta1/tx.amino.ts diff --git a/packages/osmo-query/src/codegen/osmosis/concentrated-liquidity/pool-model/concentrated/tx.registry.ts b/packages/osmo-query/src/codegen/osmosis/concentratedliquidity/poolmodel/concentrated/v1beta1/tx.registry.ts similarity index 100% rename from packages/osmo-query/src/codegen/osmosis/concentrated-liquidity/pool-model/concentrated/tx.registry.ts rename to packages/osmo-query/src/codegen/osmosis/concentratedliquidity/poolmodel/concentrated/v1beta1/tx.registry.ts diff --git a/packages/osmo-query/src/codegen/osmosis/concentrated-liquidity/pool-model/concentrated/tx.rpc.msg.ts b/packages/osmo-query/src/codegen/osmosis/concentratedliquidity/poolmodel/concentrated/v1beta1/tx.rpc.msg.ts similarity index 89% rename from packages/osmo-query/src/codegen/osmosis/concentrated-liquidity/pool-model/concentrated/tx.rpc.msg.ts rename to packages/osmo-query/src/codegen/osmosis/concentratedliquidity/poolmodel/concentrated/v1beta1/tx.rpc.msg.ts index 237bcb718..e74c524ea 100644 --- a/packages/osmo-query/src/codegen/osmosis/concentrated-liquidity/pool-model/concentrated/tx.rpc.msg.ts +++ b/packages/osmo-query/src/codegen/osmosis/concentratedliquidity/poolmodel/concentrated/v1beta1/tx.rpc.msg.ts @@ -1,5 +1,5 @@ -import { Rpc } from "../../../../helpers"; -import { BinaryReader } from "../../../../binary"; +import { Rpc } from "../../../../../helpers"; +import { BinaryReader } from "../../../../../binary"; import { MsgCreateConcentratedPool, MsgCreateConcentratedPoolResponse } from "./tx"; export interface Msg { createConcentratedPool(request: MsgCreateConcentratedPool): Promise; diff --git a/packages/osmo-query/src/codegen/osmosis/concentrated-liquidity/pool-model/concentrated/tx.ts b/packages/osmo-query/src/codegen/osmosis/concentratedliquidity/poolmodel/concentrated/v1beta1/tx.ts similarity index 88% rename from packages/osmo-query/src/codegen/osmosis/concentrated-liquidity/pool-model/concentrated/tx.ts rename to packages/osmo-query/src/codegen/osmosis/concentratedliquidity/poolmodel/concentrated/v1beta1/tx.ts index 772fa37c5..b1b5cffcb 100644 --- a/packages/osmo-query/src/codegen/osmosis/concentrated-liquidity/pool-model/concentrated/tx.ts +++ b/packages/osmo-query/src/codegen/osmosis/concentratedliquidity/poolmodel/concentrated/v1beta1/tx.ts @@ -1,4 +1,4 @@ -import { BinaryReader, BinaryWriter } from "../../../../binary"; +import { BinaryReader, BinaryWriter } from "../../../../../binary"; import { Decimal } from "@cosmjs/math"; /** ===================== MsgCreateConcentratedPool */ export interface MsgCreateConcentratedPool { @@ -14,11 +14,11 @@ export interface MsgCreateConcentratedPoolProtoMsg { } /** ===================== MsgCreateConcentratedPool */ export interface MsgCreateConcentratedPoolAmino { - sender: string; - denom0: string; - denom1: string; - tick_spacing: string; - spread_factor: string; + sender?: string; + denom0?: string; + denom1?: string; + tick_spacing?: string; + spread_factor?: string; } export interface MsgCreateConcentratedPoolAminoMsg { type: "osmosis/concentratedliquidity/poolmodel/concentrated/create-concentrated-pool"; @@ -42,7 +42,7 @@ export interface MsgCreateConcentratedPoolResponseProtoMsg { } /** Returns a unique poolID to identify the pool with. */ export interface MsgCreateConcentratedPoolResponseAmino { - pool_id: string; + pool_id?: string; } export interface MsgCreateConcentratedPoolResponseAminoMsg { type: "osmosis/concentratedliquidity/poolmodel/concentrated/create-concentrated-pool-response"; @@ -120,13 +120,23 @@ export const MsgCreateConcentratedPool = { return message; }, fromAmino(object: MsgCreateConcentratedPoolAmino): MsgCreateConcentratedPool { - return { - sender: object.sender, - denom0: object.denom0, - denom1: object.denom1, - tickSpacing: BigInt(object.tick_spacing), - spreadFactor: object.spread_factor - }; + const message = createBaseMsgCreateConcentratedPool(); + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + if (object.denom0 !== undefined && object.denom0 !== null) { + message.denom0 = object.denom0; + } + if (object.denom1 !== undefined && object.denom1 !== null) { + message.denom1 = object.denom1; + } + if (object.tick_spacing !== undefined && object.tick_spacing !== null) { + message.tickSpacing = BigInt(object.tick_spacing); + } + if (object.spread_factor !== undefined && object.spread_factor !== null) { + message.spreadFactor = object.spread_factor; + } + return message; }, toAmino(message: MsgCreateConcentratedPool): MsgCreateConcentratedPoolAmino { const obj: any = {}; @@ -195,9 +205,11 @@ export const MsgCreateConcentratedPoolResponse = { return message; }, fromAmino(object: MsgCreateConcentratedPoolResponseAmino): MsgCreateConcentratedPoolResponse { - return { - poolId: BigInt(object.pool_id) - }; + const message = createBaseMsgCreateConcentratedPoolResponse(); + if (object.pool_id !== undefined && object.pool_id !== null) { + message.poolId = BigInt(object.pool_id); + } + return message; }, toAmino(message: MsgCreateConcentratedPoolResponse): MsgCreateConcentratedPoolResponseAmino { const obj: any = {}; diff --git a/packages/osmojs/src/codegen/osmosis/concentrated-liquidity/genesis.ts b/packages/osmo-query/src/codegen/osmosis/concentratedliquidity/v1beta1/genesis.ts similarity index 83% rename from packages/osmojs/src/codegen/osmosis/concentrated-liquidity/genesis.ts rename to packages/osmo-query/src/codegen/osmosis/concentratedliquidity/v1beta1/genesis.ts index ed8dbb1c7..cde5e84ab 100644 --- a/packages/osmojs/src/codegen/osmosis/concentrated-liquidity/genesis.ts +++ b/packages/osmo-query/src/codegen/osmosis/concentratedliquidity/v1beta1/genesis.ts @@ -1,20 +1,20 @@ import { TickInfo, TickInfoAmino, TickInfoSDKType } from "./tickInfo"; -import { Any, AnyProtoMsg, AnyAmino, AnySDKType } from "../../google/protobuf/any"; +import { Any, AnyProtoMsg, AnyAmino, AnySDKType } from "../../../google/protobuf/any"; import { IncentiveRecord, IncentiveRecordAmino, IncentiveRecordSDKType } from "./incentive_record"; import { Position, PositionAmino, PositionSDKType } from "./position"; -import { Record, RecordAmino, RecordSDKType, AccumulatorContent, AccumulatorContentAmino, AccumulatorContentSDKType } from "../accum/v1beta1/accum"; -import { Params, ParamsAmino, ParamsSDKType } from "./params"; +import { Record, RecordAmino, RecordSDKType, AccumulatorContent, AccumulatorContentAmino, AccumulatorContentSDKType } from "../../accum/v1beta1/accum"; +import { Params, ParamsAmino, ParamsSDKType } from "../params"; import { Pool as Pool1 } from "./pool"; import { PoolProtoMsg as Pool1ProtoMsg } from "./pool"; import { PoolSDKType as Pool1SDKType } from "./pool"; -import { CosmWasmPool, CosmWasmPoolProtoMsg, CosmWasmPoolSDKType } from "../cosmwasmpool/v1beta1/model/pool"; -import { Pool as Pool2 } from "../gamm/pool-models/balancer/balancerPool"; -import { PoolProtoMsg as Pool2ProtoMsg } from "../gamm/pool-models/balancer/balancerPool"; -import { PoolSDKType as Pool2SDKType } from "../gamm/pool-models/balancer/balancerPool"; -import { Pool as Pool3 } from "../gamm/pool-models/stableswap/stableswap_pool"; -import { PoolProtoMsg as Pool3ProtoMsg } from "../gamm/pool-models/stableswap/stableswap_pool"; -import { PoolSDKType as Pool3SDKType } from "../gamm/pool-models/stableswap/stableswap_pool"; -import { BinaryReader, BinaryWriter } from "../../binary"; +import { CosmWasmPool, CosmWasmPoolProtoMsg, CosmWasmPoolSDKType } from "../../cosmwasmpool/v1beta1/model/pool"; +import { Pool as Pool2 } from "../../gamm/poolmodels/stableswap/v1beta1/stableswap_pool"; +import { PoolProtoMsg as Pool2ProtoMsg } from "../../gamm/poolmodels/stableswap/v1beta1/stableswap_pool"; +import { PoolSDKType as Pool2SDKType } from "../../gamm/poolmodels/stableswap/v1beta1/stableswap_pool"; +import { Pool as Pool3 } from "../../gamm/v1beta1/balancerPool"; +import { PoolProtoMsg as Pool3ProtoMsg } from "../../gamm/v1beta1/balancerPool"; +import { PoolSDKType as Pool3SDKType } from "../../gamm/v1beta1/balancerPool"; +import { BinaryReader, BinaryWriter } from "../../../binary"; /** * FullTick contains tick index and pool id along with other tick model * information. @@ -37,9 +37,9 @@ export interface FullTickProtoMsg { */ export interface FullTickAmino { /** pool id associated with the tick. */ - pool_id: string; + pool_id?: string; /** tick's index. */ - tick_index: string; + tick_index?: string; /** tick's info. */ info?: TickInfoAmino; } @@ -62,7 +62,7 @@ export interface FullTickSDKType { */ export interface PoolData { /** pool struct */ - pool: (Pool1 & CosmWasmPool & Pool2 & Pool3 & Any) | undefined; + pool?: (Pool1 & CosmWasmPool & Pool2 & Pool3 & Any) | undefined; /** pool's ticks */ ticks: FullTick[]; spreadRewardAccumulator: AccumObject; @@ -85,11 +85,11 @@ export interface PoolDataAmino { /** pool struct */ pool?: AnyAmino; /** pool's ticks */ - ticks: FullTickAmino[]; + ticks?: FullTickAmino[]; spread_reward_accumulator?: AccumObjectAmino; - incentives_accumulators: AccumObjectAmino[]; + incentives_accumulators?: AccumObjectAmino[]; /** incentive records to be set */ - incentive_records: IncentiveRecordAmino[]; + incentive_records?: IncentiveRecordAmino[]; } export interface PoolDataAminoMsg { type: "osmosis/concentratedliquidity/pool-data"; @@ -100,14 +100,14 @@ export interface PoolDataAminoMsg { * for genesis state. */ export interface PoolDataSDKType { - pool: Pool1SDKType | CosmWasmPoolSDKType | Pool2SDKType | Pool3SDKType | AnySDKType | undefined; + pool?: Pool1SDKType | CosmWasmPoolSDKType | Pool2SDKType | Pool3SDKType | AnySDKType | undefined; ticks: FullTickSDKType[]; spread_reward_accumulator: AccumObjectSDKType; incentives_accumulators: AccumObjectSDKType[]; incentive_records: IncentiveRecordSDKType[]; } export interface PositionData { - position: Position; + position?: Position; lockId: bigint; spreadRewardAccumRecord: Record; uptimeAccumRecords: Record[]; @@ -118,16 +118,16 @@ export interface PositionDataProtoMsg { } export interface PositionDataAmino { position?: PositionAmino; - lock_id: string; + lock_id?: string; spread_reward_accum_record?: RecordAmino; - uptime_accum_records: RecordAmino[]; + uptime_accum_records?: RecordAmino[]; } export interface PositionDataAminoMsg { type: "osmosis/concentratedliquidity/position-data"; value: PositionDataAmino; } export interface PositionDataSDKType { - position: PositionSDKType; + position?: PositionSDKType; lock_id: bigint; spread_reward_accum_record: RecordSDKType; uptime_accum_records: RecordSDKType[]; @@ -136,7 +136,7 @@ export interface PositionDataSDKType { export interface GenesisState { /** params are all the parameters of the module */ params: Params; - /** pool data containining serialized pool struct and ticks. */ + /** pool data containing serialized pool struct and ticks. */ poolData: PoolData[]; positionData: PositionData[]; nextPositionId: bigint; @@ -150,11 +150,11 @@ export interface GenesisStateProtoMsg { export interface GenesisStateAmino { /** params are all the parameters of the module */ params?: ParamsAmino; - /** pool data containining serialized pool struct and ticks. */ - pool_data: PoolDataAmino[]; - position_data: PositionDataAmino[]; - next_position_id: string; - next_incentive_record_id: string; + /** pool data containing serialized pool struct and ticks. */ + pool_data?: PoolDataAmino[]; + position_data?: PositionDataAmino[]; + next_position_id?: string; + next_incentive_record_id?: string; } export interface GenesisStateAminoMsg { type: "osmosis/concentratedliquidity/genesis-state"; @@ -171,7 +171,7 @@ export interface GenesisStateSDKType { export interface AccumObject { /** Accumulator's name (pulled from AccumulatorContent) */ name: string; - accumContent: AccumulatorContent; + accumContent?: AccumulatorContent; } export interface AccumObjectProtoMsg { typeUrl: "/osmosis.concentratedliquidity.v1beta1.AccumObject"; @@ -179,7 +179,7 @@ export interface AccumObjectProtoMsg { } export interface AccumObjectAmino { /** Accumulator's name (pulled from AccumulatorContent) */ - name: string; + name?: string; accum_content?: AccumulatorContentAmino; } export interface AccumObjectAminoMsg { @@ -188,7 +188,7 @@ export interface AccumObjectAminoMsg { } export interface AccumObjectSDKType { name: string; - accum_content: AccumulatorContentSDKType; + accum_content?: AccumulatorContentSDKType; } function createBaseFullTick(): FullTick { return { @@ -242,11 +242,17 @@ export const FullTick = { return message; }, fromAmino(object: FullTickAmino): FullTick { - return { - poolId: BigInt(object.pool_id), - tickIndex: BigInt(object.tick_index), - info: object?.info ? TickInfo.fromAmino(object.info) : undefined - }; + const message = createBaseFullTick(); + if (object.pool_id !== undefined && object.pool_id !== null) { + message.poolId = BigInt(object.pool_id); + } + if (object.tick_index !== undefined && object.tick_index !== null) { + message.tickIndex = BigInt(object.tick_index); + } + if (object.info !== undefined && object.info !== null) { + message.info = TickInfo.fromAmino(object.info); + } + return message; }, toAmino(message: FullTick): FullTickAmino { const obj: any = {}; @@ -345,13 +351,17 @@ export const PoolData = { return message; }, fromAmino(object: PoolDataAmino): PoolData { - return { - pool: object?.pool ? PoolI_FromAmino(object.pool) : undefined, - ticks: Array.isArray(object?.ticks) ? object.ticks.map((e: any) => FullTick.fromAmino(e)) : [], - spreadRewardAccumulator: object?.spread_reward_accumulator ? AccumObject.fromAmino(object.spread_reward_accumulator) : undefined, - incentivesAccumulators: Array.isArray(object?.incentives_accumulators) ? object.incentives_accumulators.map((e: any) => AccumObject.fromAmino(e)) : [], - incentiveRecords: Array.isArray(object?.incentive_records) ? object.incentive_records.map((e: any) => IncentiveRecord.fromAmino(e)) : [] - }; + const message = createBasePoolData(); + if (object.pool !== undefined && object.pool !== null) { + message.pool = PoolI_FromAmino(object.pool); + } + message.ticks = object.ticks?.map(e => FullTick.fromAmino(e)) || []; + if (object.spread_reward_accumulator !== undefined && object.spread_reward_accumulator !== null) { + message.spreadRewardAccumulator = AccumObject.fromAmino(object.spread_reward_accumulator); + } + message.incentivesAccumulators = object.incentives_accumulators?.map(e => AccumObject.fromAmino(e)) || []; + message.incentiveRecords = object.incentive_records?.map(e => IncentiveRecord.fromAmino(e)) || []; + return message; }, toAmino(message: PoolData): PoolDataAmino { const obj: any = {}; @@ -398,7 +408,7 @@ export const PoolData = { }; function createBasePositionData(): PositionData { return { - position: Position.fromPartial({}), + position: undefined, lockId: BigInt(0), spreadRewardAccumRecord: Record.fromPartial({}), uptimeAccumRecords: [] @@ -456,12 +466,18 @@ export const PositionData = { return message; }, fromAmino(object: PositionDataAmino): PositionData { - return { - position: object?.position ? Position.fromAmino(object.position) : undefined, - lockId: BigInt(object.lock_id), - spreadRewardAccumRecord: object?.spread_reward_accum_record ? Record.fromAmino(object.spread_reward_accum_record) : undefined, - uptimeAccumRecords: Array.isArray(object?.uptime_accum_records) ? object.uptime_accum_records.map((e: any) => Record.fromAmino(e)) : [] - }; + const message = createBasePositionData(); + if (object.position !== undefined && object.position !== null) { + message.position = Position.fromAmino(object.position); + } + if (object.lock_id !== undefined && object.lock_id !== null) { + message.lockId = BigInt(object.lock_id); + } + if (object.spread_reward_accum_record !== undefined && object.spread_reward_accum_record !== null) { + message.spreadRewardAccumRecord = Record.fromAmino(object.spread_reward_accum_record); + } + message.uptimeAccumRecords = object.uptime_accum_records?.map(e => Record.fromAmino(e)) || []; + return message; }, toAmino(message: PositionData): PositionDataAmino { const obj: any = {}; @@ -565,13 +581,19 @@ export const GenesisState = { return message; }, fromAmino(object: GenesisStateAmino): GenesisState { - return { - params: object?.params ? Params.fromAmino(object.params) : undefined, - poolData: Array.isArray(object?.pool_data) ? object.pool_data.map((e: any) => PoolData.fromAmino(e)) : [], - positionData: Array.isArray(object?.position_data) ? object.position_data.map((e: any) => PositionData.fromAmino(e)) : [], - nextPositionId: BigInt(object.next_position_id), - nextIncentiveRecordId: BigInt(object.next_incentive_record_id) - }; + const message = createBaseGenesisState(); + if (object.params !== undefined && object.params !== null) { + message.params = Params.fromAmino(object.params); + } + message.poolData = object.pool_data?.map(e => PoolData.fromAmino(e)) || []; + message.positionData = object.position_data?.map(e => PositionData.fromAmino(e)) || []; + if (object.next_position_id !== undefined && object.next_position_id !== null) { + message.nextPositionId = BigInt(object.next_position_id); + } + if (object.next_incentive_record_id !== undefined && object.next_incentive_record_id !== null) { + message.nextIncentiveRecordId = BigInt(object.next_incentive_record_id); + } + return message; }, toAmino(message: GenesisState): GenesisStateAmino { const obj: any = {}; @@ -615,7 +637,7 @@ export const GenesisState = { function createBaseAccumObject(): AccumObject { return { name: "", - accumContent: AccumulatorContent.fromPartial({}) + accumContent: undefined }; } export const AccumObject = { @@ -656,10 +678,14 @@ export const AccumObject = { return message; }, fromAmino(object: AccumObjectAmino): AccumObject { - return { - name: object.name, - accumContent: object?.accum_content ? AccumulatorContent.fromAmino(object.accum_content) : undefined - }; + const message = createBaseAccumObject(); + if (object.name !== undefined && object.name !== null) { + message.name = object.name; + } + if (object.accum_content !== undefined && object.accum_content !== null) { + message.accumContent = AccumulatorContent.fromAmino(object.accum_content); + } + return message; }, toAmino(message: AccumObject): AccumObjectAmino { const obj: any = {}; @@ -691,16 +717,16 @@ export const AccumObject = { }; export const PoolI_InterfaceDecoder = (input: BinaryReader | Uint8Array): Pool1 | CosmWasmPool | Pool2 | Pool3 | Any => { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - const data = Any.decode(reader, reader.uint32()); + const data = Any.decode(reader, reader.uint32(), true); switch (data.typeUrl) { case "/osmosis.concentratedliquidity.v1beta1.Pool": - return Pool1.decode(data.value); + return Pool1.decode(data.value, undefined, true); case "/osmosis.cosmwasmpool.v1beta1.CosmWasmPool": - return CosmWasmPool.decode(data.value); - case "/osmosis.gamm.v1beta1.Pool": - return Pool2.decode(data.value); + return CosmWasmPool.decode(data.value, undefined, true); case "/osmosis.gamm.poolmodels.stableswap.v1beta1.Pool": - return Pool3.decode(data.value); + return Pool2.decode(data.value, undefined, true); + case "/osmosis.gamm.v1beta1.Pool": + return Pool3.decode(data.value, undefined, true); default: return data; } @@ -717,14 +743,14 @@ export const PoolI_FromAmino = (content: AnyAmino) => { typeUrl: "/osmosis.cosmwasmpool.v1beta1.CosmWasmPool", value: CosmWasmPool.encode(CosmWasmPool.fromPartial(CosmWasmPool.fromAmino(content.value))).finish() }); - case "osmosis/gamm/BalancerPool": + case "osmosis/gamm/StableswapPool": return Any.fromPartial({ - typeUrl: "/osmosis.gamm.v1beta1.Pool", + typeUrl: "/osmosis.gamm.poolmodels.stableswap.v1beta1.Pool", value: Pool2.encode(Pool2.fromPartial(Pool2.fromAmino(content.value))).finish() }); - case "osmosis/gamm/StableswapPool": + case "osmosis/gamm/BalancerPool": return Any.fromPartial({ - typeUrl: "/osmosis.gamm.poolmodels.stableswap.v1beta1.Pool", + typeUrl: "/osmosis.gamm.v1beta1.Pool", value: Pool3.encode(Pool3.fromPartial(Pool3.fromAmino(content.value))).finish() }); default: @@ -736,22 +762,22 @@ export const PoolI_ToAmino = (content: Any) => { case "/osmosis.concentratedliquidity.v1beta1.Pool": return { type: "osmosis/concentratedliquidity/pool", - value: Pool1.toAmino(Pool1.decode(content.value)) + value: Pool1.toAmino(Pool1.decode(content.value, undefined)) }; case "/osmosis.cosmwasmpool.v1beta1.CosmWasmPool": return { type: "osmosis/cosmwasmpool/cosm-wasm-pool", - value: CosmWasmPool.toAmino(CosmWasmPool.decode(content.value)) - }; - case "/osmosis.gamm.v1beta1.Pool": - return { - type: "osmosis/gamm/BalancerPool", - value: Pool2.toAmino(Pool2.decode(content.value)) + value: CosmWasmPool.toAmino(CosmWasmPool.decode(content.value, undefined)) }; case "/osmosis.gamm.poolmodels.stableswap.v1beta1.Pool": return { type: "osmosis/gamm/StableswapPool", - value: Pool3.toAmino(Pool3.decode(content.value)) + value: Pool2.toAmino(Pool2.decode(content.value, undefined)) + }; + case "/osmosis.gamm.v1beta1.Pool": + return { + type: "osmosis/gamm/BalancerPool", + value: Pool3.toAmino(Pool3.decode(content.value, undefined)) }; default: return Any.toAmino(content); diff --git a/packages/osmojs/src/codegen/osmosis/concentrated-liquidity/gov.ts b/packages/osmo-query/src/codegen/osmosis/concentratedliquidity/v1beta1/gov.ts similarity index 89% rename from packages/osmojs/src/codegen/osmosis/concentrated-liquidity/gov.ts rename to packages/osmo-query/src/codegen/osmosis/concentratedliquidity/v1beta1/gov.ts index 9c7f2cf7b..520b8be60 100644 --- a/packages/osmojs/src/codegen/osmosis/concentrated-liquidity/gov.ts +++ b/packages/osmo-query/src/codegen/osmosis/concentratedliquidity/v1beta1/gov.ts @@ -1,4 +1,4 @@ -import { BinaryReader, BinaryWriter } from "../../binary"; +import { BinaryReader, BinaryWriter } from "../../../binary"; import { Decimal } from "@cosmjs/math"; /** * CreateConcentratedLiquidityPoolsProposal is a gov Content type for creating @@ -20,9 +20,9 @@ export interface CreateConcentratedLiquidityPoolsProposalProtoMsg { * passes, the pools are created via pool manager module account. */ export interface CreateConcentratedLiquidityPoolsProposalAmino { - title: string; - description: string; - pool_records: PoolRecordAmino[]; + title?: string; + description?: string; + pool_records?: PoolRecordAmino[]; } export interface CreateConcentratedLiquidityPoolsProposalAminoMsg { type: "osmosis/concentratedliquidity/create-concentrated-liquidity-pools-proposal"; @@ -60,9 +60,9 @@ export interface TickSpacingDecreaseProposalProtoMsg { * spacing. */ export interface TickSpacingDecreaseProposalAmino { - title: string; - description: string; - pool_id_to_tick_spacing_records: PoolIdToTickSpacingRecordAmino[]; + title?: string; + description?: string; + pool_id_to_tick_spacing_records?: PoolIdToTickSpacingRecordAmino[]; } export interface TickSpacingDecreaseProposalAminoMsg { type: "osmosis/concentratedliquidity/tick-spacing-decrease-proposal"; @@ -96,8 +96,8 @@ export interface PoolIdToTickSpacingRecordProtoMsg { * spacing pair. */ export interface PoolIdToTickSpacingRecordAmino { - pool_id: string; - new_tick_spacing: string; + pool_id?: string; + new_tick_spacing?: string; } export interface PoolIdToTickSpacingRecordAminoMsg { type: "osmosis/concentratedliquidity/pool-id-to-tick-spacing-record"; @@ -115,7 +115,6 @@ export interface PoolRecord { denom0: string; denom1: string; tickSpacing: bigint; - exponentAtPriceOne: string; spreadFactor: string; } export interface PoolRecordProtoMsg { @@ -123,11 +122,10 @@ export interface PoolRecordProtoMsg { value: Uint8Array; } export interface PoolRecordAmino { - denom0: string; - denom1: string; - tick_spacing: string; - exponent_at_price_one: string; - spread_factor: string; + denom0?: string; + denom1?: string; + tick_spacing?: string; + spread_factor?: string; } export interface PoolRecordAminoMsg { type: "osmosis/concentratedliquidity/pool-record"; @@ -137,7 +135,6 @@ export interface PoolRecordSDKType { denom0: string; denom1: string; tick_spacing: bigint; - exponent_at_price_one: string; spread_factor: string; } function createBaseCreateConcentratedLiquidityPoolsProposal(): CreateConcentratedLiquidityPoolsProposal { @@ -192,11 +189,15 @@ export const CreateConcentratedLiquidityPoolsProposal = { return message; }, fromAmino(object: CreateConcentratedLiquidityPoolsProposalAmino): CreateConcentratedLiquidityPoolsProposal { - return { - title: object.title, - description: object.description, - poolRecords: Array.isArray(object?.pool_records) ? object.pool_records.map((e: any) => PoolRecord.fromAmino(e)) : [] - }; + const message = createBaseCreateConcentratedLiquidityPoolsProposal(); + if (object.title !== undefined && object.title !== null) { + message.title = object.title; + } + if (object.description !== undefined && object.description !== null) { + message.description = object.description; + } + message.poolRecords = object.pool_records?.map(e => PoolRecord.fromAmino(e)) || []; + return message; }, toAmino(message: CreateConcentratedLiquidityPoolsProposal): CreateConcentratedLiquidityPoolsProposalAmino { const obj: any = {}; @@ -283,11 +284,15 @@ export const TickSpacingDecreaseProposal = { return message; }, fromAmino(object: TickSpacingDecreaseProposalAmino): TickSpacingDecreaseProposal { - return { - title: object.title, - description: object.description, - poolIdToTickSpacingRecords: Array.isArray(object?.pool_id_to_tick_spacing_records) ? object.pool_id_to_tick_spacing_records.map((e: any) => PoolIdToTickSpacingRecord.fromAmino(e)) : [] - }; + const message = createBaseTickSpacingDecreaseProposal(); + if (object.title !== undefined && object.title !== null) { + message.title = object.title; + } + if (object.description !== undefined && object.description !== null) { + message.description = object.description; + } + message.poolIdToTickSpacingRecords = object.pool_id_to_tick_spacing_records?.map(e => PoolIdToTickSpacingRecord.fromAmino(e)) || []; + return message; }, toAmino(message: TickSpacingDecreaseProposal): TickSpacingDecreaseProposalAmino { const obj: any = {}; @@ -366,10 +371,14 @@ export const PoolIdToTickSpacingRecord = { return message; }, fromAmino(object: PoolIdToTickSpacingRecordAmino): PoolIdToTickSpacingRecord { - return { - poolId: BigInt(object.pool_id), - newTickSpacing: BigInt(object.new_tick_spacing) - }; + const message = createBasePoolIdToTickSpacingRecord(); + if (object.pool_id !== undefined && object.pool_id !== null) { + message.poolId = BigInt(object.pool_id); + } + if (object.new_tick_spacing !== undefined && object.new_tick_spacing !== null) { + message.newTickSpacing = BigInt(object.new_tick_spacing); + } + return message; }, toAmino(message: PoolIdToTickSpacingRecord): PoolIdToTickSpacingRecordAmino { const obj: any = {}; @@ -404,7 +413,6 @@ function createBasePoolRecord(): PoolRecord { denom0: "", denom1: "", tickSpacing: BigInt(0), - exponentAtPriceOne: "", spreadFactor: "" }; } @@ -420,9 +428,6 @@ export const PoolRecord = { if (message.tickSpacing !== BigInt(0)) { writer.uint32(24).uint64(message.tickSpacing); } - if (message.exponentAtPriceOne !== "") { - writer.uint32(34).string(message.exponentAtPriceOne); - } if (message.spreadFactor !== "") { writer.uint32(42).string(Decimal.fromUserInput(message.spreadFactor, 18).atomics); } @@ -444,9 +449,6 @@ export const PoolRecord = { case 3: message.tickSpacing = reader.uint64(); break; - case 4: - message.exponentAtPriceOne = reader.string(); - break; case 5: message.spreadFactor = Decimal.fromAtomics(reader.string(), 18).toString(); break; @@ -462,25 +464,30 @@ export const PoolRecord = { message.denom0 = object.denom0 ?? ""; message.denom1 = object.denom1 ?? ""; message.tickSpacing = object.tickSpacing !== undefined && object.tickSpacing !== null ? BigInt(object.tickSpacing.toString()) : BigInt(0); - message.exponentAtPriceOne = object.exponentAtPriceOne ?? ""; message.spreadFactor = object.spreadFactor ?? ""; return message; }, fromAmino(object: PoolRecordAmino): PoolRecord { - return { - denom0: object.denom0, - denom1: object.denom1, - tickSpacing: BigInt(object.tick_spacing), - exponentAtPriceOne: object.exponent_at_price_one, - spreadFactor: object.spread_factor - }; + const message = createBasePoolRecord(); + if (object.denom0 !== undefined && object.denom0 !== null) { + message.denom0 = object.denom0; + } + if (object.denom1 !== undefined && object.denom1 !== null) { + message.denom1 = object.denom1; + } + if (object.tick_spacing !== undefined && object.tick_spacing !== null) { + message.tickSpacing = BigInt(object.tick_spacing); + } + if (object.spread_factor !== undefined && object.spread_factor !== null) { + message.spreadFactor = object.spread_factor; + } + return message; }, toAmino(message: PoolRecord): PoolRecordAmino { const obj: any = {}; obj.denom0 = message.denom0; obj.denom1 = message.denom1; obj.tick_spacing = message.tickSpacing ? message.tickSpacing.toString() : undefined; - obj.exponent_at_price_one = message.exponentAtPriceOne; obj.spread_factor = message.spreadFactor; return obj; }, diff --git a/packages/osmo-query/src/codegen/osmosis/concentrated-liquidity/incentive_record.ts b/packages/osmo-query/src/codegen/osmosis/concentratedliquidity/v1beta1/incentive_record.ts similarity index 86% rename from packages/osmo-query/src/codegen/osmosis/concentrated-liquidity/incentive_record.ts rename to packages/osmo-query/src/codegen/osmosis/concentratedliquidity/v1beta1/incentive_record.ts index 21096159d..baac116ee 100644 --- a/packages/osmo-query/src/codegen/osmosis/concentrated-liquidity/incentive_record.ts +++ b/packages/osmo-query/src/codegen/osmosis/concentratedliquidity/v1beta1/incentive_record.ts @@ -1,9 +1,9 @@ -import { Duration, DurationAmino, DurationSDKType } from "../../google/protobuf/duration"; -import { DecCoin, DecCoinAmino, DecCoinSDKType } from "../../cosmos/base/v1beta1/coin"; -import { Timestamp } from "../../google/protobuf/timestamp"; -import { BinaryReader, BinaryWriter } from "../../binary"; +import { Duration, DurationAmino, DurationSDKType } from "../../../google/protobuf/duration"; +import { DecCoin, DecCoinAmino, DecCoinSDKType } from "../../../cosmos/base/v1beta1/coin"; +import { Timestamp } from "../../../google/protobuf/timestamp"; +import { BinaryReader, BinaryWriter } from "../../../binary"; import { Decimal } from "@cosmjs/math"; -import { toTimestamp, fromTimestamp } from "../../helpers"; +import { toTimestamp, fromTimestamp } from "../../../helpers"; /** * IncentiveRecord is the high-level struct we use to deal with an independent * incentive being distributed on a pool. Note that PoolId, Denom, and MinUptime @@ -35,8 +35,8 @@ export interface IncentiveRecordProtoMsg { */ export interface IncentiveRecordAmino { /** incentive_id is the id uniquely identifying this incentive record. */ - incentive_id: string; - pool_id: string; + incentive_id?: string; + pool_id?: string; /** incentive record body holds necessary */ incentive_record_body?: IncentiveRecordBodyAmino; /** @@ -86,9 +86,9 @@ export interface IncentiveRecordBodyAmino { /** remaining_coin is the total amount of incentives to be distributed */ remaining_coin?: DecCoinAmino; /** emission_rate is the incentive emission rate per second */ - emission_rate: string; + emission_rate?: string; /** start_time is the time when the incentive starts distributing */ - start_time?: Date; + start_time?: string; } export interface IncentiveRecordBodyAminoMsg { type: "osmosis/concentratedliquidity/incentive-record-body"; @@ -163,12 +163,20 @@ export const IncentiveRecord = { return message; }, fromAmino(object: IncentiveRecordAmino): IncentiveRecord { - return { - incentiveId: BigInt(object.incentive_id), - poolId: BigInt(object.pool_id), - incentiveRecordBody: object?.incentive_record_body ? IncentiveRecordBody.fromAmino(object.incentive_record_body) : undefined, - minUptime: object?.min_uptime ? Duration.fromAmino(object.min_uptime) : undefined - }; + const message = createBaseIncentiveRecord(); + if (object.incentive_id !== undefined && object.incentive_id !== null) { + message.incentiveId = BigInt(object.incentive_id); + } + if (object.pool_id !== undefined && object.pool_id !== null) { + message.poolId = BigInt(object.pool_id); + } + if (object.incentive_record_body !== undefined && object.incentive_record_body !== null) { + message.incentiveRecordBody = IncentiveRecordBody.fromAmino(object.incentive_record_body); + } + if (object.min_uptime !== undefined && object.min_uptime !== null) { + message.minUptime = Duration.fromAmino(object.min_uptime); + } + return message; }, toAmino(message: IncentiveRecord): IncentiveRecordAmino { const obj: any = {}; @@ -252,17 +260,23 @@ export const IncentiveRecordBody = { return message; }, fromAmino(object: IncentiveRecordBodyAmino): IncentiveRecordBody { - return { - remainingCoin: object?.remaining_coin ? DecCoin.fromAmino(object.remaining_coin) : undefined, - emissionRate: object.emission_rate, - startTime: object.start_time - }; + const message = createBaseIncentiveRecordBody(); + if (object.remaining_coin !== undefined && object.remaining_coin !== null) { + message.remainingCoin = DecCoin.fromAmino(object.remaining_coin); + } + if (object.emission_rate !== undefined && object.emission_rate !== null) { + message.emissionRate = object.emission_rate; + } + if (object.start_time !== undefined && object.start_time !== null) { + message.startTime = fromTimestamp(Timestamp.fromAmino(object.start_time)); + } + return message; }, toAmino(message: IncentiveRecordBody): IncentiveRecordBodyAmino { const obj: any = {}; obj.remaining_coin = message.remainingCoin ? DecCoin.toAmino(message.remainingCoin) : undefined; obj.emission_rate = message.emissionRate; - obj.start_time = message.startTime; + obj.start_time = message.startTime ? Timestamp.toAmino(toTimestamp(message.startTime)) : undefined; return obj; }, fromAminoMsg(object: IncentiveRecordBodyAminoMsg): IncentiveRecordBody { diff --git a/packages/osmo-query/src/codegen/osmosis/concentrated-liquidity/pool.ts b/packages/osmo-query/src/codegen/osmosis/concentratedliquidity/v1beta1/pool.ts similarity index 75% rename from packages/osmo-query/src/codegen/osmosis/concentrated-liquidity/pool.ts rename to packages/osmo-query/src/codegen/osmosis/concentratedliquidity/v1beta1/pool.ts index a3ca162d4..4d4c2b49a 100644 --- a/packages/osmo-query/src/codegen/osmosis/concentrated-liquidity/pool.ts +++ b/packages/osmo-query/src/codegen/osmosis/concentratedliquidity/v1beta1/pool.ts @@ -1,9 +1,9 @@ -import { Timestamp } from "../../google/protobuf/timestamp"; -import { BinaryReader, BinaryWriter } from "../../binary"; +import { Timestamp } from "../../../google/protobuf/timestamp"; +import { BinaryReader, BinaryWriter } from "../../../binary"; import { Decimal } from "@cosmjs/math"; -import { toTimestamp, fromTimestamp } from "../../helpers"; +import { toTimestamp, fromTimestamp } from "../../../helpers"; export interface Pool { - $typeUrl?: string; + $typeUrl?: "/osmosis.concentratedliquidity.v1beta1.Pool"; /** pool's address holding all liquidity tokens. */ address: string; /** address holding the incentives liquidity. */ @@ -37,38 +37,38 @@ export interface PoolProtoMsg { } export interface PoolAmino { /** pool's address holding all liquidity tokens. */ - address: string; + address?: string; /** address holding the incentives liquidity. */ - incentives_address: string; + incentives_address?: string; /** address holding spread rewards from swaps. */ - spread_rewards_address: string; - id: string; + spread_rewards_address?: string; + id?: string; /** Amount of total liquidity */ - current_tick_liquidity: string; - token0: string; - token1: string; - current_sqrt_price: string; - current_tick: string; + current_tick_liquidity?: string; + token0?: string; + token1?: string; + current_sqrt_price?: string; + current_tick?: string; /** * tick_spacing must be one of the authorized_tick_spacing values set in the * concentrated-liquidity parameters */ - tick_spacing: string; - exponent_at_price_one: string; + tick_spacing?: string; + exponent_at_price_one?: string; /** spread_factor is the ratio that is charged on the amount of token in. */ - spread_factor: string; + spread_factor?: string; /** * last_liquidity_update is the last time either the pool liquidity or the * active tick changed */ - last_liquidity_update?: Date; + last_liquidity_update?: string; } export interface PoolAminoMsg { type: "osmosis/concentratedliquidity/pool"; value: PoolAmino; } export interface PoolSDKType { - $typeUrl?: string; + $typeUrl?: "/osmosis.concentratedliquidity.v1beta1.Pool"; address: string; incentives_address: string; spread_rewards_address: string; @@ -216,21 +216,47 @@ export const Pool = { return message; }, fromAmino(object: PoolAmino): Pool { - return { - address: object.address, - incentivesAddress: object.incentives_address, - spreadRewardsAddress: object.spread_rewards_address, - id: BigInt(object.id), - currentTickLiquidity: object.current_tick_liquidity, - token0: object.token0, - token1: object.token1, - currentSqrtPrice: object.current_sqrt_price, - currentTick: BigInt(object.current_tick), - tickSpacing: BigInt(object.tick_spacing), - exponentAtPriceOne: BigInt(object.exponent_at_price_one), - spreadFactor: object.spread_factor, - lastLiquidityUpdate: object.last_liquidity_update - }; + const message = createBasePool(); + if (object.address !== undefined && object.address !== null) { + message.address = object.address; + } + if (object.incentives_address !== undefined && object.incentives_address !== null) { + message.incentivesAddress = object.incentives_address; + } + if (object.spread_rewards_address !== undefined && object.spread_rewards_address !== null) { + message.spreadRewardsAddress = object.spread_rewards_address; + } + if (object.id !== undefined && object.id !== null) { + message.id = BigInt(object.id); + } + if (object.current_tick_liquidity !== undefined && object.current_tick_liquidity !== null) { + message.currentTickLiquidity = object.current_tick_liquidity; + } + if (object.token0 !== undefined && object.token0 !== null) { + message.token0 = object.token0; + } + if (object.token1 !== undefined && object.token1 !== null) { + message.token1 = object.token1; + } + if (object.current_sqrt_price !== undefined && object.current_sqrt_price !== null) { + message.currentSqrtPrice = object.current_sqrt_price; + } + if (object.current_tick !== undefined && object.current_tick !== null) { + message.currentTick = BigInt(object.current_tick); + } + if (object.tick_spacing !== undefined && object.tick_spacing !== null) { + message.tickSpacing = BigInt(object.tick_spacing); + } + if (object.exponent_at_price_one !== undefined && object.exponent_at_price_one !== null) { + message.exponentAtPriceOne = BigInt(object.exponent_at_price_one); + } + if (object.spread_factor !== undefined && object.spread_factor !== null) { + message.spreadFactor = object.spread_factor; + } + if (object.last_liquidity_update !== undefined && object.last_liquidity_update !== null) { + message.lastLiquidityUpdate = fromTimestamp(Timestamp.fromAmino(object.last_liquidity_update)); + } + return message; }, toAmino(message: Pool): PoolAmino { const obj: any = {}; @@ -246,7 +272,7 @@ export const Pool = { obj.tick_spacing = message.tickSpacing ? message.tickSpacing.toString() : undefined; obj.exponent_at_price_one = message.exponentAtPriceOne ? message.exponentAtPriceOne.toString() : undefined; obj.spread_factor = message.spreadFactor; - obj.last_liquidity_update = message.lastLiquidityUpdate; + obj.last_liquidity_update = message.lastLiquidityUpdate ? Timestamp.toAmino(toTimestamp(message.lastLiquidityUpdate)) : undefined; return obj; }, fromAminoMsg(object: PoolAminoMsg): Pool { diff --git a/packages/osmo-query/src/codegen/osmosis/concentrated-liquidity/position.ts b/packages/osmo-query/src/codegen/osmosis/concentratedliquidity/v1beta1/position.ts similarity index 85% rename from packages/osmo-query/src/codegen/osmosis/concentrated-liquidity/position.ts rename to packages/osmo-query/src/codegen/osmosis/concentratedliquidity/v1beta1/position.ts index 8e9ca5901..ae295c823 100644 --- a/packages/osmo-query/src/codegen/osmosis/concentrated-liquidity/position.ts +++ b/packages/osmo-query/src/codegen/osmosis/concentratedliquidity/v1beta1/position.ts @@ -1,8 +1,8 @@ -import { Timestamp } from "../../google/protobuf/timestamp"; -import { Coin, CoinAmino, CoinSDKType } from "../../cosmos/base/v1beta1/coin"; -import { PeriodLock, PeriodLockAmino, PeriodLockSDKType } from "../lockup/lock"; -import { BinaryReader, BinaryWriter } from "../../binary"; -import { toTimestamp, fromTimestamp } from "../../helpers"; +import { Timestamp } from "../../../google/protobuf/timestamp"; +import { Coin, CoinAmino, CoinSDKType } from "../../../cosmos/base/v1beta1/coin"; +import { PeriodLock, PeriodLockAmino, PeriodLockSDKType } from "../../lockup/lock"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { toTimestamp, fromTimestamp } from "../../../helpers"; import { Decimal } from "@cosmjs/math"; /** * Position contains position's id, address, pool id, lower tick, upper tick @@ -26,13 +26,13 @@ export interface PositionProtoMsg { * join time, and liquidity. */ export interface PositionAmino { - position_id: string; - address: string; - pool_id: string; - lower_tick: string; - upper_tick: string; - join_time?: Date; - liquidity: string; + position_id?: string; + address?: string; + pool_id?: string; + lower_tick?: string; + upper_tick?: string; + join_time?: string; + liquidity?: string; } export interface PositionAminoMsg { type: "osmosis/concentratedliquidity/position"; @@ -85,9 +85,9 @@ export interface FullPositionBreakdownAmino { position?: PositionAmino; asset0?: CoinAmino; asset1?: CoinAmino; - claimable_spread_rewards: CoinAmino[]; - claimable_incentives: CoinAmino[]; - forfeited_incentives: CoinAmino[]; + claimable_spread_rewards?: CoinAmino[]; + claimable_incentives?: CoinAmino[]; + forfeited_incentives?: CoinAmino[]; } export interface FullPositionBreakdownAminoMsg { type: "osmosis/concentratedliquidity/full-position-breakdown"; @@ -214,15 +214,29 @@ export const Position = { return message; }, fromAmino(object: PositionAmino): Position { - return { - positionId: BigInt(object.position_id), - address: object.address, - poolId: BigInt(object.pool_id), - lowerTick: BigInt(object.lower_tick), - upperTick: BigInt(object.upper_tick), - joinTime: object.join_time, - liquidity: object.liquidity - }; + const message = createBasePosition(); + if (object.position_id !== undefined && object.position_id !== null) { + message.positionId = BigInt(object.position_id); + } + if (object.address !== undefined && object.address !== null) { + message.address = object.address; + } + if (object.pool_id !== undefined && object.pool_id !== null) { + message.poolId = BigInt(object.pool_id); + } + if (object.lower_tick !== undefined && object.lower_tick !== null) { + message.lowerTick = BigInt(object.lower_tick); + } + if (object.upper_tick !== undefined && object.upper_tick !== null) { + message.upperTick = BigInt(object.upper_tick); + } + if (object.join_time !== undefined && object.join_time !== null) { + message.joinTime = fromTimestamp(Timestamp.fromAmino(object.join_time)); + } + if (object.liquidity !== undefined && object.liquidity !== null) { + message.liquidity = object.liquidity; + } + return message; }, toAmino(message: Position): PositionAmino { const obj: any = {}; @@ -231,7 +245,7 @@ export const Position = { obj.pool_id = message.poolId ? message.poolId.toString() : undefined; obj.lower_tick = message.lowerTick ? message.lowerTick.toString() : undefined; obj.upper_tick = message.upperTick ? message.upperTick.toString() : undefined; - obj.join_time = message.joinTime; + obj.join_time = message.joinTime ? Timestamp.toAmino(toTimestamp(message.joinTime)) : undefined; obj.liquidity = message.liquidity; return obj; }, @@ -333,14 +347,20 @@ export const FullPositionBreakdown = { return message; }, fromAmino(object: FullPositionBreakdownAmino): FullPositionBreakdown { - return { - position: object?.position ? Position.fromAmino(object.position) : undefined, - asset0: object?.asset0 ? Coin.fromAmino(object.asset0) : undefined, - asset1: object?.asset1 ? Coin.fromAmino(object.asset1) : undefined, - claimableSpreadRewards: Array.isArray(object?.claimable_spread_rewards) ? object.claimable_spread_rewards.map((e: any) => Coin.fromAmino(e)) : [], - claimableIncentives: Array.isArray(object?.claimable_incentives) ? object.claimable_incentives.map((e: any) => Coin.fromAmino(e)) : [], - forfeitedIncentives: Array.isArray(object?.forfeited_incentives) ? object.forfeited_incentives.map((e: any) => Coin.fromAmino(e)) : [] - }; + const message = createBaseFullPositionBreakdown(); + if (object.position !== undefined && object.position !== null) { + message.position = Position.fromAmino(object.position); + } + if (object.asset0 !== undefined && object.asset0 !== null) { + message.asset0 = Coin.fromAmino(object.asset0); + } + if (object.asset1 !== undefined && object.asset1 !== null) { + message.asset1 = Coin.fromAmino(object.asset1); + } + message.claimableSpreadRewards = object.claimable_spread_rewards?.map(e => Coin.fromAmino(e)) || []; + message.claimableIncentives = object.claimable_incentives?.map(e => Coin.fromAmino(e)) || []; + message.forfeitedIncentives = object.forfeited_incentives?.map(e => Coin.fromAmino(e)) || []; + return message; }, toAmino(message: FullPositionBreakdown): FullPositionBreakdownAmino { const obj: any = {}; @@ -430,10 +450,14 @@ export const PositionWithPeriodLock = { return message; }, fromAmino(object: PositionWithPeriodLockAmino): PositionWithPeriodLock { - return { - position: object?.position ? Position.fromAmino(object.position) : undefined, - locks: object?.locks ? PeriodLock.fromAmino(object.locks) : undefined - }; + const message = createBasePositionWithPeriodLock(); + if (object.position !== undefined && object.position !== null) { + message.position = Position.fromAmino(object.position); + } + if (object.locks !== undefined && object.locks !== null) { + message.locks = PeriodLock.fromAmino(object.locks); + } + return message; }, toAmino(message: PositionWithPeriodLock): PositionWithPeriodLockAmino { const obj: any = {}; diff --git a/packages/osmo-query/src/codegen/osmosis/concentrated-liquidity/query.lcd.ts b/packages/osmo-query/src/codegen/osmosis/concentratedliquidity/v1beta1/query.lcd.ts similarity index 88% rename from packages/osmo-query/src/codegen/osmosis/concentrated-liquidity/query.lcd.ts rename to packages/osmo-query/src/codegen/osmosis/concentratedliquidity/v1beta1/query.lcd.ts index 327955ea6..e375ea5f0 100644 --- a/packages/osmo-query/src/codegen/osmosis/concentrated-liquidity/query.lcd.ts +++ b/packages/osmo-query/src/codegen/osmosis/concentratedliquidity/v1beta1/query.lcd.ts @@ -1,6 +1,6 @@ -import { setPaginationParams } from "../../helpers"; +import { setPaginationParams } from "../../../helpers"; import { LCDClient } from "@cosmology/lcd"; -import { PoolsRequest, PoolsResponseSDKType, ParamsRequest, ParamsResponseSDKType, UserPositionsRequest, UserPositionsResponseSDKType, LiquidityPerTickRangeRequest, LiquidityPerTickRangeResponseSDKType, LiquidityNetInDirectionRequest, LiquidityNetInDirectionResponseSDKType, ClaimableSpreadRewardsRequest, ClaimableSpreadRewardsResponseSDKType, ClaimableIncentivesRequest, ClaimableIncentivesResponseSDKType, PositionByIdRequest, PositionByIdResponseSDKType, PoolAccumulatorRewardsRequest, PoolAccumulatorRewardsResponseSDKType, IncentiveRecordsRequest, IncentiveRecordsResponseSDKType, TickAccumulatorTrackersRequest, TickAccumulatorTrackersResponseSDKType, CFMMPoolIdLinkFromConcentratedPoolIdRequest, CFMMPoolIdLinkFromConcentratedPoolIdResponseSDKType, UserUnbondingPositionsRequest, UserUnbondingPositionsResponseSDKType, GetTotalLiquidityRequest, GetTotalLiquidityResponseSDKType } from "./query"; +import { PoolsRequest, PoolsResponseSDKType, ParamsRequest, ParamsResponseSDKType, UserPositionsRequest, UserPositionsResponseSDKType, LiquidityPerTickRangeRequest, LiquidityPerTickRangeResponseSDKType, LiquidityNetInDirectionRequest, LiquidityNetInDirectionResponseSDKType, ClaimableSpreadRewardsRequest, ClaimableSpreadRewardsResponseSDKType, ClaimableIncentivesRequest, ClaimableIncentivesResponseSDKType, PositionByIdRequest, PositionByIdResponseSDKType, PoolAccumulatorRewardsRequest, PoolAccumulatorRewardsResponseSDKType, IncentiveRecordsRequest, IncentiveRecordsResponseSDKType, TickAccumulatorTrackersRequest, TickAccumulatorTrackersResponseSDKType, CFMMPoolIdLinkFromConcentratedPoolIdRequest, CFMMPoolIdLinkFromConcentratedPoolIdResponseSDKType, UserUnbondingPositionsRequest, UserUnbondingPositionsResponseSDKType, GetTotalLiquidityRequest, GetTotalLiquidityResponseSDKType, NumNextInitializedTicksRequest, NumNextInitializedTicksResponseSDKType } from "./query"; export class LCDQueryClient { req: LCDClient; constructor({ @@ -23,6 +23,7 @@ export class LCDQueryClient { this.cFMMPoolIdLinkFromConcentratedPoolId = this.cFMMPoolIdLinkFromConcentratedPoolId.bind(this); this.userUnbondingPositions = this.userUnbondingPositions.bind(this); this.getTotalLiquidity = this.getTotalLiquidity.bind(this); + this.numNextInitializedTicks = this.numNextInitializedTicks.bind(this); } /* Pools returns all concentrated liquidity pools */ async pools(params: PoolsRequest = { @@ -42,7 +43,7 @@ export class LCDQueryClient { const endpoint = `osmosis/concentratedliquidity/v1beta1/params`; return await this.req.get(endpoint); } - /* UserPositions returns all concentrated postitions of some address. */ + /* UserPositions returns all concentrated positions of some address. */ async userPositions(params: UserPositionsRequest): Promise { const options: any = { params: {} @@ -189,4 +190,22 @@ export class LCDQueryClient { const endpoint = `osmosis/concentratedliquidity/v1beta1/get_total_liquidity`; return await this.req.get(endpoint); } + /* NumNextInitializedTicks returns the provided number of next initialized + ticks in the direction of swapping the token in denom. */ + async numNextInitializedTicks(params: NumNextInitializedTicksRequest): Promise { + const options: any = { + params: {} + }; + if (typeof params?.poolId !== "undefined") { + options.params.pool_id = params.poolId; + } + if (typeof params?.tokenInDenom !== "undefined") { + options.params.token_in_denom = params.tokenInDenom; + } + if (typeof params?.numNextInitializedTicks !== "undefined") { + options.params.num_next_initialized_ticks = params.numNextInitializedTicks; + } + const endpoint = `osmosis/concentratedliquidity/v1beta1/num_next_initialized_ticks`; + return await this.req.get(endpoint, options); + } } \ No newline at end of file diff --git a/packages/osmo-query/src/codegen/osmosis/concentrated-liquidity/query.rpc.Query.ts b/packages/osmo-query/src/codegen/osmosis/concentratedliquidity/v1beta1/query.rpc.Query.ts similarity index 91% rename from packages/osmo-query/src/codegen/osmosis/concentrated-liquidity/query.rpc.Query.ts rename to packages/osmo-query/src/codegen/osmosis/concentratedliquidity/v1beta1/query.rpc.Query.ts index 5790bfb95..5ba0790f6 100644 --- a/packages/osmo-query/src/codegen/osmosis/concentrated-liquidity/query.rpc.Query.ts +++ b/packages/osmo-query/src/codegen/osmosis/concentratedliquidity/v1beta1/query.rpc.Query.ts @@ -1,15 +1,15 @@ -import { Rpc } from "../../helpers"; -import { BinaryReader } from "../../binary"; +import { Rpc } from "../../../helpers"; +import { BinaryReader } from "../../../binary"; import { QueryClient, createProtobufRpcClient, ProtobufRpcClient } from "@cosmjs/stargate"; -import { ReactQueryParams } from "../../react-query"; +import { ReactQueryParams } from "../../../react-query"; import { useQuery } from "@tanstack/react-query"; -import { PoolsRequest, PoolsResponse, ParamsRequest, ParamsResponse, UserPositionsRequest, UserPositionsResponse, LiquidityPerTickRangeRequest, LiquidityPerTickRangeResponse, LiquidityNetInDirectionRequest, LiquidityNetInDirectionResponse, ClaimableSpreadRewardsRequest, ClaimableSpreadRewardsResponse, ClaimableIncentivesRequest, ClaimableIncentivesResponse, PositionByIdRequest, PositionByIdResponse, PoolAccumulatorRewardsRequest, PoolAccumulatorRewardsResponse, IncentiveRecordsRequest, IncentiveRecordsResponse, TickAccumulatorTrackersRequest, TickAccumulatorTrackersResponse, CFMMPoolIdLinkFromConcentratedPoolIdRequest, CFMMPoolIdLinkFromConcentratedPoolIdResponse, UserUnbondingPositionsRequest, UserUnbondingPositionsResponse, GetTotalLiquidityRequest, GetTotalLiquidityResponse } from "./query"; +import { PoolsRequest, PoolsResponse, ParamsRequest, ParamsResponse, UserPositionsRequest, UserPositionsResponse, LiquidityPerTickRangeRequest, LiquidityPerTickRangeResponse, LiquidityNetInDirectionRequest, LiquidityNetInDirectionResponse, ClaimableSpreadRewardsRequest, ClaimableSpreadRewardsResponse, ClaimableIncentivesRequest, ClaimableIncentivesResponse, PositionByIdRequest, PositionByIdResponse, PoolAccumulatorRewardsRequest, PoolAccumulatorRewardsResponse, IncentiveRecordsRequest, IncentiveRecordsResponse, TickAccumulatorTrackersRequest, TickAccumulatorTrackersResponse, CFMMPoolIdLinkFromConcentratedPoolIdRequest, CFMMPoolIdLinkFromConcentratedPoolIdResponse, UserUnbondingPositionsRequest, UserUnbondingPositionsResponse, GetTotalLiquidityRequest, GetTotalLiquidityResponse, NumNextInitializedTicksRequest, NumNextInitializedTicksResponse } from "./query"; export interface Query { /** Pools returns all concentrated liquidity pools */ pools(request?: PoolsRequest): Promise; /** Params returns concentrated liquidity module params. */ params(request?: ParamsRequest): Promise; - /** UserPositions returns all concentrated postitions of some address. */ + /** UserPositions returns all concentrated positions of some address. */ userPositions(request: UserPositionsRequest): Promise; /** * LiquidityPerTickRange returns the amount of liquidity per every tick range @@ -58,6 +58,11 @@ export interface Query { userUnbondingPositions(request: UserUnbondingPositionsRequest): Promise; /** GetTotalLiquidity returns total liquidity across all cl pools. */ getTotalLiquidity(request?: GetTotalLiquidityRequest): Promise; + /** + * NumNextInitializedTicks returns the provided number of next initialized + * ticks in the direction of swapping the token in denom. + */ + numNextInitializedTicks(request: NumNextInitializedTicksRequest): Promise; } export class QueryClientImpl implements Query { private readonly rpc: Rpc; @@ -77,6 +82,7 @@ export class QueryClientImpl implements Query { this.cFMMPoolIdLinkFromConcentratedPoolId = this.cFMMPoolIdLinkFromConcentratedPoolId.bind(this); this.userUnbondingPositions = this.userUnbondingPositions.bind(this); this.getTotalLiquidity = this.getTotalLiquidity.bind(this); + this.numNextInitializedTicks = this.numNextInitializedTicks.bind(this); } pools(request: PoolsRequest = { pagination: undefined @@ -150,6 +156,11 @@ export class QueryClientImpl implements Query { const promise = this.rpc.request("osmosis.concentratedliquidity.v1beta1.Query", "GetTotalLiquidity", data); return promise.then(data => GetTotalLiquidityResponse.decode(new BinaryReader(data))); } + numNextInitializedTicks(request: NumNextInitializedTicksRequest): Promise { + const data = NumNextInitializedTicksRequest.encode(request).finish(); + const promise = this.rpc.request("osmosis.concentratedliquidity.v1beta1.Query", "NumNextInitializedTicks", data); + return promise.then(data => NumNextInitializedTicksResponse.decode(new BinaryReader(data))); + } } export const createRpcQueryExtension = (base: QueryClient) => { const rpc = createProtobufRpcClient(base); @@ -196,6 +207,9 @@ export const createRpcQueryExtension = (base: QueryClient) => { }, getTotalLiquidity(request?: GetTotalLiquidityRequest): Promise { return queryService.getTotalLiquidity(request); + }, + numNextInitializedTicks(request: NumNextInitializedTicksRequest): Promise { + return queryService.numNextInitializedTicks(request); } }; }; @@ -241,6 +255,9 @@ export interface UseUserUnbondingPositionsQuery extends ReactQueryParams< export interface UseGetTotalLiquidityQuery extends ReactQueryParams { request?: GetTotalLiquidityRequest; } +export interface UseNumNextInitializedTicksQuery extends ReactQueryParams { + request: NumNextInitializedTicksRequest; +} const _queryClients: WeakMap = new WeakMap(); const getQueryService = (rpc: ProtobufRpcClient | undefined): QueryClientImpl | undefined => { if (!rpc) return; @@ -379,10 +396,19 @@ export const createRpcQueryHooks = (rpc: ProtobufRpcClient | undefined) => { return queryService.getTotalLiquidity(request); }, options); }; + const useNumNextInitializedTicks = ({ + request, + options + }: UseNumNextInitializedTicksQuery) => { + return useQuery(["numNextInitializedTicksQuery", request], () => { + if (!queryService) throw new Error("Query Service not initialized"); + return queryService.numNextInitializedTicks(request); + }, options); + }; return { /** Pools returns all concentrated liquidity pools */usePools, /** Params returns concentrated liquidity module params. */useParams, - /** UserPositions returns all concentrated postitions of some address. */useUserPositions, + /** UserPositions returns all concentrated positions of some address. */useUserPositions, /** * LiquidityPerTickRange returns the amount of liquidity per every tick range * existing within the given pool @@ -426,6 +452,11 @@ export const createRpcQueryHooks = (rpc: ProtobufRpcClient | undefined) => { * positions of the given address. */ useUserUnbondingPositions, - /** GetTotalLiquidity returns total liquidity across all cl pools. */useGetTotalLiquidity + /** GetTotalLiquidity returns total liquidity across all cl pools. */useGetTotalLiquidity, + /** + * NumNextInitializedTicks returns the provided number of next initialized + * ticks in the direction of swapping the token in denom. + */ + useNumNextInitializedTicks }; }; \ No newline at end of file diff --git a/packages/osmo-query/src/codegen/osmosis/concentrated-liquidity/query.ts b/packages/osmo-query/src/codegen/osmosis/concentratedliquidity/v1beta1/query.ts similarity index 82% rename from packages/osmo-query/src/codegen/osmosis/concentrated-liquidity/query.ts rename to packages/osmo-query/src/codegen/osmosis/concentratedliquidity/v1beta1/query.ts index 690888652..37a70bfe4 100644 --- a/packages/osmo-query/src/codegen/osmosis/concentrated-liquidity/query.ts +++ b/packages/osmo-query/src/codegen/osmosis/concentratedliquidity/v1beta1/query.ts @@ -1,27 +1,27 @@ -import { PageRequest, PageRequestAmino, PageRequestSDKType, PageResponse, PageResponseAmino, PageResponseSDKType } from "../../cosmos/base/query/v1beta1/pagination"; +import { PageRequest, PageRequestAmino, PageRequestSDKType, PageResponse, PageResponseAmino, PageResponseSDKType } from "../../../cosmos/base/query/v1beta1/pagination"; import { FullPositionBreakdown, FullPositionBreakdownAmino, FullPositionBreakdownSDKType, PositionWithPeriodLock, PositionWithPeriodLockAmino, PositionWithPeriodLockSDKType } from "./position"; -import { Any, AnyProtoMsg, AnyAmino, AnySDKType } from "../../google/protobuf/any"; -import { Params, ParamsAmino, ParamsSDKType } from "./params"; -import { Coin, CoinAmino, CoinSDKType, DecCoin, DecCoinAmino, DecCoinSDKType } from "../../cosmos/base/v1beta1/coin"; +import { Any, AnyProtoMsg, AnyAmino, AnySDKType } from "../../../google/protobuf/any"; +import { Params, ParamsAmino, ParamsSDKType } from "../params"; +import { Coin, CoinAmino, CoinSDKType, DecCoin, DecCoinAmino, DecCoinSDKType } from "../../../cosmos/base/v1beta1/coin"; import { UptimeTracker, UptimeTrackerAmino, UptimeTrackerSDKType } from "./tickInfo"; import { IncentiveRecord, IncentiveRecordAmino, IncentiveRecordSDKType } from "./incentive_record"; import { Pool as Pool1 } from "./pool"; import { PoolProtoMsg as Pool1ProtoMsg } from "./pool"; import { PoolSDKType as Pool1SDKType } from "./pool"; -import { CosmWasmPool, CosmWasmPoolProtoMsg, CosmWasmPoolSDKType } from "../cosmwasmpool/v1beta1/model/pool"; -import { Pool as Pool2 } from "../gamm/pool-models/balancer/balancerPool"; -import { PoolProtoMsg as Pool2ProtoMsg } from "../gamm/pool-models/balancer/balancerPool"; -import { PoolSDKType as Pool2SDKType } from "../gamm/pool-models/balancer/balancerPool"; -import { Pool as Pool3 } from "../gamm/pool-models/stableswap/stableswap_pool"; -import { PoolProtoMsg as Pool3ProtoMsg } from "../gamm/pool-models/stableswap/stableswap_pool"; -import { PoolSDKType as Pool3SDKType } from "../gamm/pool-models/stableswap/stableswap_pool"; -import { BinaryReader, BinaryWriter } from "../../binary"; +import { CosmWasmPool, CosmWasmPoolProtoMsg, CosmWasmPoolSDKType } from "../../cosmwasmpool/v1beta1/model/pool"; +import { Pool as Pool2 } from "../../gamm/poolmodels/stableswap/v1beta1/stableswap_pool"; +import { PoolProtoMsg as Pool2ProtoMsg } from "../../gamm/poolmodels/stableswap/v1beta1/stableswap_pool"; +import { PoolSDKType as Pool2SDKType } from "../../gamm/poolmodels/stableswap/v1beta1/stableswap_pool"; +import { Pool as Pool3 } from "../../gamm/v1beta1/balancerPool"; +import { PoolProtoMsg as Pool3ProtoMsg } from "../../gamm/v1beta1/balancerPool"; +import { PoolSDKType as Pool3SDKType } from "../../gamm/v1beta1/balancerPool"; +import { BinaryReader, BinaryWriter } from "../../../binary"; import { Decimal } from "@cosmjs/math"; /** =============================== UserPositions */ export interface UserPositionsRequest { address: string; poolId: bigint; - pagination: PageRequest; + pagination?: PageRequest; } export interface UserPositionsRequestProtoMsg { typeUrl: "/osmosis.concentratedliquidity.v1beta1.UserPositionsRequest"; @@ -29,8 +29,8 @@ export interface UserPositionsRequestProtoMsg { } /** =============================== UserPositions */ export interface UserPositionsRequestAmino { - address: string; - pool_id: string; + address?: string; + pool_id?: string; pagination?: PageRequestAmino; } export interface UserPositionsRequestAminoMsg { @@ -41,18 +41,18 @@ export interface UserPositionsRequestAminoMsg { export interface UserPositionsRequestSDKType { address: string; pool_id: bigint; - pagination: PageRequestSDKType; + pagination?: PageRequestSDKType; } export interface UserPositionsResponse { positions: FullPositionBreakdown[]; - pagination: PageResponse; + pagination?: PageResponse; } export interface UserPositionsResponseProtoMsg { typeUrl: "/osmosis.concentratedliquidity.v1beta1.UserPositionsResponse"; value: Uint8Array; } export interface UserPositionsResponseAmino { - positions: FullPositionBreakdownAmino[]; + positions?: FullPositionBreakdownAmino[]; pagination?: PageResponseAmino; } export interface UserPositionsResponseAminoMsg { @@ -61,7 +61,7 @@ export interface UserPositionsResponseAminoMsg { } export interface UserPositionsResponseSDKType { positions: FullPositionBreakdownSDKType[]; - pagination: PageResponseSDKType; + pagination?: PageResponseSDKType; } /** =============================== PositionById */ export interface PositionByIdRequest { @@ -73,7 +73,7 @@ export interface PositionByIdRequestProtoMsg { } /** =============================== PositionById */ export interface PositionByIdRequestAmino { - position_id: string; + position_id?: string; } export interface PositionByIdRequestAminoMsg { type: "osmosis/concentratedliquidity/position-by-id-request"; @@ -103,7 +103,7 @@ export interface PositionByIdResponseSDKType { /** =============================== Pools */ export interface PoolsRequest { /** pagination defines an optional pagination for the request. */ - pagination: PageRequest; + pagination?: PageRequest; } export interface PoolsRequestProtoMsg { typeUrl: "/osmosis.concentratedliquidity.v1beta1.PoolsRequest"; @@ -120,12 +120,12 @@ export interface PoolsRequestAminoMsg { } /** =============================== Pools */ export interface PoolsRequestSDKType { - pagination: PageRequestSDKType; + pagination?: PageRequestSDKType; } export interface PoolsResponse { pools: (Pool1 & CosmWasmPool & Pool2 & Pool3 & Any)[] | Any[]; /** pagination defines the pagination in the response. */ - pagination: PageResponse; + pagination?: PageResponse; } export interface PoolsResponseProtoMsg { typeUrl: "/osmosis.concentratedliquidity.v1beta1.PoolsResponse"; @@ -135,7 +135,7 @@ export type PoolsResponseEncoded = Omit & { pools: (Pool1ProtoMsg | CosmWasmPoolProtoMsg | Pool2ProtoMsg | Pool3ProtoMsg | AnyProtoMsg)[]; }; export interface PoolsResponseAmino { - pools: AnyAmino[]; + pools?: AnyAmino[]; /** pagination defines the pagination in the response. */ pagination?: PageResponseAmino; } @@ -145,7 +145,7 @@ export interface PoolsResponseAminoMsg { } export interface PoolsResponseSDKType { pools: (Pool1SDKType | CosmWasmPoolSDKType | Pool2SDKType | Pool3SDKType | AnySDKType)[]; - pagination: PageResponseSDKType; + pagination?: PageResponseSDKType; } /** =============================== ModuleParams */ export interface ParamsRequest {} @@ -187,8 +187,8 @@ export interface TickLiquidityNetProtoMsg { value: Uint8Array; } export interface TickLiquidityNetAmino { - liquidity_net: string; - tick_index: string; + liquidity_net?: string; + tick_index?: string; } export interface TickLiquidityNetAminoMsg { type: "osmosis/concentratedliquidity/tick-liquidity-net"; @@ -208,9 +208,9 @@ export interface LiquidityDepthWithRangeProtoMsg { value: Uint8Array; } export interface LiquidityDepthWithRangeAmino { - liquidity_amount: string; - lower_tick: string; - upper_tick: string; + liquidity_amount?: string; + lower_tick?: string; + upper_tick?: string; } export interface LiquidityDepthWithRangeAminoMsg { type: "osmosis/concentratedliquidity/liquidity-depth-with-range"; @@ -236,12 +236,12 @@ export interface LiquidityNetInDirectionRequestProtoMsg { } /** =============================== LiquidityNetInDirection */ export interface LiquidityNetInDirectionRequestAmino { - pool_id: string; - token_in: string; - start_tick: string; - use_cur_tick: boolean; - bound_tick: string; - use_no_bound: boolean; + pool_id?: string; + token_in?: string; + start_tick?: string; + use_cur_tick?: boolean; + bound_tick?: string; + use_no_bound?: boolean; } export interface LiquidityNetInDirectionRequestAminoMsg { type: "osmosis/concentratedliquidity/liquidity-net-in-direction-request"; @@ -260,15 +260,17 @@ export interface LiquidityNetInDirectionResponse { liquidityDepths: TickLiquidityNet[]; currentTick: bigint; currentLiquidity: string; + currentSqrtPrice: string; } export interface LiquidityNetInDirectionResponseProtoMsg { typeUrl: "/osmosis.concentratedliquidity.v1beta1.LiquidityNetInDirectionResponse"; value: Uint8Array; } export interface LiquidityNetInDirectionResponseAmino { - liquidity_depths: TickLiquidityNetAmino[]; - current_tick: string; - current_liquidity: string; + liquidity_depths?: TickLiquidityNetAmino[]; + current_tick?: string; + current_liquidity?: string; + current_sqrt_price?: string; } export interface LiquidityNetInDirectionResponseAminoMsg { type: "osmosis/concentratedliquidity/liquidity-net-in-direction-response"; @@ -278,6 +280,7 @@ export interface LiquidityNetInDirectionResponseSDKType { liquidity_depths: TickLiquidityNetSDKType[]; current_tick: bigint; current_liquidity: string; + current_sqrt_price: string; } /** =============================== LiquidityPerTickRange */ export interface LiquidityPerTickRangeRequest { @@ -289,7 +292,7 @@ export interface LiquidityPerTickRangeRequestProtoMsg { } /** =============================== LiquidityPerTickRange */ export interface LiquidityPerTickRangeRequestAmino { - pool_id: string; + pool_id?: string; } export interface LiquidityPerTickRangeRequestAminoMsg { type: "osmosis/concentratedliquidity/liquidity-per-tick-range-request"; @@ -301,13 +304,15 @@ export interface LiquidityPerTickRangeRequestSDKType { } export interface LiquidityPerTickRangeResponse { liquidity: LiquidityDepthWithRange[]; + bucketIndex: bigint; } export interface LiquidityPerTickRangeResponseProtoMsg { typeUrl: "/osmosis.concentratedliquidity.v1beta1.LiquidityPerTickRangeResponse"; value: Uint8Array; } export interface LiquidityPerTickRangeResponseAmino { - liquidity: LiquidityDepthWithRangeAmino[]; + liquidity?: LiquidityDepthWithRangeAmino[]; + bucket_index?: string; } export interface LiquidityPerTickRangeResponseAminoMsg { type: "osmosis/concentratedliquidity/liquidity-per-tick-range-response"; @@ -315,6 +320,7 @@ export interface LiquidityPerTickRangeResponseAminoMsg { } export interface LiquidityPerTickRangeResponseSDKType { liquidity: LiquidityDepthWithRangeSDKType[]; + bucket_index: bigint; } /** ===================== QueryClaimableSpreadRewards */ export interface ClaimableSpreadRewardsRequest { @@ -326,7 +332,7 @@ export interface ClaimableSpreadRewardsRequestProtoMsg { } /** ===================== QueryClaimableSpreadRewards */ export interface ClaimableSpreadRewardsRequestAmino { - position_id: string; + position_id?: string; } export interface ClaimableSpreadRewardsRequestAminoMsg { type: "osmosis/concentratedliquidity/claimable-spread-rewards-request"; @@ -344,7 +350,7 @@ export interface ClaimableSpreadRewardsResponseProtoMsg { value: Uint8Array; } export interface ClaimableSpreadRewardsResponseAmino { - claimable_spread_rewards: CoinAmino[]; + claimable_spread_rewards?: CoinAmino[]; } export interface ClaimableSpreadRewardsResponseAminoMsg { type: "osmosis/concentratedliquidity/claimable-spread-rewards-response"; @@ -363,7 +369,7 @@ export interface ClaimableIncentivesRequestProtoMsg { } /** ===================== QueryClaimableIncentives */ export interface ClaimableIncentivesRequestAmino { - position_id: string; + position_id?: string; } export interface ClaimableIncentivesRequestAminoMsg { type: "osmosis/concentratedliquidity/claimable-incentives-request"; @@ -382,8 +388,8 @@ export interface ClaimableIncentivesResponseProtoMsg { value: Uint8Array; } export interface ClaimableIncentivesResponseAmino { - claimable_incentives: CoinAmino[]; - forfeited_incentives: CoinAmino[]; + claimable_incentives?: CoinAmino[]; + forfeited_incentives?: CoinAmino[]; } export interface ClaimableIncentivesResponseAminoMsg { type: "osmosis/concentratedliquidity/claimable-incentives-response"; @@ -403,7 +409,7 @@ export interface PoolAccumulatorRewardsRequestProtoMsg { } /** ===================== QueryPoolAccumulatorRewards */ export interface PoolAccumulatorRewardsRequestAmino { - pool_id: string; + pool_id?: string; } export interface PoolAccumulatorRewardsRequestAminoMsg { type: "osmosis/concentratedliquidity/pool-accumulator-rewards-request"; @@ -422,8 +428,8 @@ export interface PoolAccumulatorRewardsResponseProtoMsg { value: Uint8Array; } export interface PoolAccumulatorRewardsResponseAmino { - spread_reward_growth_global: DecCoinAmino[]; - uptime_growth_global: UptimeTrackerAmino[]; + spread_reward_growth_global?: DecCoinAmino[]; + uptime_growth_global?: UptimeTrackerAmino[]; } export interface PoolAccumulatorRewardsResponseAminoMsg { type: "osmosis/concentratedliquidity/pool-accumulator-rewards-response"; @@ -444,8 +450,8 @@ export interface TickAccumulatorTrackersRequestProtoMsg { } /** ===================== QueryTickAccumulatorTrackers */ export interface TickAccumulatorTrackersRequestAmino { - pool_id: string; - tick_index: string; + pool_id?: string; + tick_index?: string; } export interface TickAccumulatorTrackersRequestAminoMsg { type: "osmosis/concentratedliquidity/tick-accumulator-trackers-request"; @@ -465,8 +471,8 @@ export interface TickAccumulatorTrackersResponseProtoMsg { value: Uint8Array; } export interface TickAccumulatorTrackersResponseAmino { - spread_reward_growth_opposite_direction_of_last_traversal: DecCoinAmino[]; - uptime_trackers: UptimeTrackerAmino[]; + spread_reward_growth_opposite_direction_of_last_traversal?: DecCoinAmino[]; + uptime_trackers?: UptimeTrackerAmino[]; } export interface TickAccumulatorTrackersResponseAminoMsg { type: "osmosis/concentratedliquidity/tick-accumulator-trackers-response"; @@ -479,7 +485,7 @@ export interface TickAccumulatorTrackersResponseSDKType { /** ===================== QueryIncentiveRecords */ export interface IncentiveRecordsRequest { poolId: bigint; - pagination: PageRequest; + pagination?: PageRequest; } export interface IncentiveRecordsRequestProtoMsg { typeUrl: "/osmosis.concentratedliquidity.v1beta1.IncentiveRecordsRequest"; @@ -487,7 +493,7 @@ export interface IncentiveRecordsRequestProtoMsg { } /** ===================== QueryIncentiveRecords */ export interface IncentiveRecordsRequestAmino { - pool_id: string; + pool_id?: string; pagination?: PageRequestAmino; } export interface IncentiveRecordsRequestAminoMsg { @@ -497,19 +503,19 @@ export interface IncentiveRecordsRequestAminoMsg { /** ===================== QueryIncentiveRecords */ export interface IncentiveRecordsRequestSDKType { pool_id: bigint; - pagination: PageRequestSDKType; + pagination?: PageRequestSDKType; } export interface IncentiveRecordsResponse { incentiveRecords: IncentiveRecord[]; /** pagination defines the pagination in the response. */ - pagination: PageResponse; + pagination?: PageResponse; } export interface IncentiveRecordsResponseProtoMsg { typeUrl: "/osmosis.concentratedliquidity.v1beta1.IncentiveRecordsResponse"; value: Uint8Array; } export interface IncentiveRecordsResponseAmino { - incentive_records: IncentiveRecordAmino[]; + incentive_records?: IncentiveRecordAmino[]; /** pagination defines the pagination in the response. */ pagination?: PageResponseAmino; } @@ -519,7 +525,7 @@ export interface IncentiveRecordsResponseAminoMsg { } export interface IncentiveRecordsResponseSDKType { incentive_records: IncentiveRecordSDKType[]; - pagination: PageResponseSDKType; + pagination?: PageResponseSDKType; } /** =============================== CFMMPoolIdLinkFromConcentratedPoolId */ export interface CFMMPoolIdLinkFromConcentratedPoolIdRequest { @@ -531,7 +537,7 @@ export interface CFMMPoolIdLinkFromConcentratedPoolIdRequestProtoMsg { } /** =============================== CFMMPoolIdLinkFromConcentratedPoolId */ export interface CFMMPoolIdLinkFromConcentratedPoolIdRequestAmino { - concentrated_pool_id: string; + concentrated_pool_id?: string; } export interface CFMMPoolIdLinkFromConcentratedPoolIdRequestAminoMsg { type: "osmosis/concentratedliquidity/cfmmpool-id-link-from-concentrated-pool-id-request"; @@ -549,7 +555,7 @@ export interface CFMMPoolIdLinkFromConcentratedPoolIdResponseProtoMsg { value: Uint8Array; } export interface CFMMPoolIdLinkFromConcentratedPoolIdResponseAmino { - cfmm_pool_id: string; + cfmm_pool_id?: string; } export interface CFMMPoolIdLinkFromConcentratedPoolIdResponseAminoMsg { type: "osmosis/concentratedliquidity/cfmmpool-id-link-from-concentrated-pool-id-response"; @@ -568,7 +574,7 @@ export interface UserUnbondingPositionsRequestProtoMsg { } /** =============================== UserUnbondingPositions */ export interface UserUnbondingPositionsRequestAmino { - address: string; + address?: string; } export interface UserUnbondingPositionsRequestAminoMsg { type: "osmosis/concentratedliquidity/user-unbonding-positions-request"; @@ -586,7 +592,7 @@ export interface UserUnbondingPositionsResponseProtoMsg { value: Uint8Array; } export interface UserUnbondingPositionsResponseAmino { - positions_with_period_lock: PositionWithPeriodLockAmino[]; + positions_with_period_lock?: PositionWithPeriodLockAmino[]; } export interface UserUnbondingPositionsResponseAminoMsg { type: "osmosis/concentratedliquidity/user-unbonding-positions-response"; @@ -617,7 +623,7 @@ export interface GetTotalLiquidityResponseProtoMsg { value: Uint8Array; } export interface GetTotalLiquidityResponseAmino { - total_liquidity: CoinAmino[]; + total_liquidity?: CoinAmino[]; } export interface GetTotalLiquidityResponseAminoMsg { type: "osmosis/concentratedliquidity/get-total-liquidity-response"; @@ -626,11 +632,60 @@ export interface GetTotalLiquidityResponseAminoMsg { export interface GetTotalLiquidityResponseSDKType { total_liquidity: CoinSDKType[]; } +/** =============================== NumNextInitializedTicks */ +export interface NumNextInitializedTicksRequest { + poolId: bigint; + tokenInDenom: string; + numNextInitializedTicks: bigint; +} +export interface NumNextInitializedTicksRequestProtoMsg { + typeUrl: "/osmosis.concentratedliquidity.v1beta1.NumNextInitializedTicksRequest"; + value: Uint8Array; +} +/** =============================== NumNextInitializedTicks */ +export interface NumNextInitializedTicksRequestAmino { + pool_id?: string; + token_in_denom?: string; + num_next_initialized_ticks?: string; +} +export interface NumNextInitializedTicksRequestAminoMsg { + type: "osmosis/concentratedliquidity/num-next-initialized-ticks-request"; + value: NumNextInitializedTicksRequestAmino; +} +/** =============================== NumNextInitializedTicks */ +export interface NumNextInitializedTicksRequestSDKType { + pool_id: bigint; + token_in_denom: string; + num_next_initialized_ticks: bigint; +} +export interface NumNextInitializedTicksResponse { + liquidityDepths: TickLiquidityNet[]; + currentTick: bigint; + currentLiquidity: string; +} +export interface NumNextInitializedTicksResponseProtoMsg { + typeUrl: "/osmosis.concentratedliquidity.v1beta1.NumNextInitializedTicksResponse"; + value: Uint8Array; +} +export interface NumNextInitializedTicksResponseAmino { + liquidity_depths?: TickLiquidityNetAmino[]; + current_tick?: string; + current_liquidity?: string; +} +export interface NumNextInitializedTicksResponseAminoMsg { + type: "osmosis/concentratedliquidity/num-next-initialized-ticks-response"; + value: NumNextInitializedTicksResponseAmino; +} +export interface NumNextInitializedTicksResponseSDKType { + liquidity_depths: TickLiquidityNetSDKType[]; + current_tick: bigint; + current_liquidity: string; +} function createBaseUserPositionsRequest(): UserPositionsRequest { return { address: "", poolId: BigInt(0), - pagination: PageRequest.fromPartial({}) + pagination: undefined }; } export const UserPositionsRequest = { @@ -678,11 +733,17 @@ export const UserPositionsRequest = { return message; }, fromAmino(object: UserPositionsRequestAmino): UserPositionsRequest { - return { - address: object.address, - poolId: BigInt(object.pool_id), - pagination: object?.pagination ? PageRequest.fromAmino(object.pagination) : undefined - }; + const message = createBaseUserPositionsRequest(); + if (object.address !== undefined && object.address !== null) { + message.address = object.address; + } + if (object.pool_id !== undefined && object.pool_id !== null) { + message.poolId = BigInt(object.pool_id); + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromAmino(object.pagination); + } + return message; }, toAmino(message: UserPositionsRequest): UserPositionsRequestAmino { const obj: any = {}; @@ -716,7 +777,7 @@ export const UserPositionsRequest = { function createBaseUserPositionsResponse(): UserPositionsResponse { return { positions: [], - pagination: PageResponse.fromPartial({}) + pagination: undefined }; } export const UserPositionsResponse = { @@ -757,10 +818,12 @@ export const UserPositionsResponse = { return message; }, fromAmino(object: UserPositionsResponseAmino): UserPositionsResponse { - return { - positions: Array.isArray(object?.positions) ? object.positions.map((e: any) => FullPositionBreakdown.fromAmino(e)) : [], - pagination: object?.pagination ? PageResponse.fromAmino(object.pagination) : undefined - }; + const message = createBaseUserPositionsResponse(); + message.positions = object.positions?.map(e => FullPositionBreakdown.fromAmino(e)) || []; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromAmino(object.pagination); + } + return message; }, toAmino(message: UserPositionsResponse): UserPositionsResponseAmino { const obj: any = {}; @@ -830,9 +893,11 @@ export const PositionByIdRequest = { return message; }, fromAmino(object: PositionByIdRequestAmino): PositionByIdRequest { - return { - positionId: BigInt(object.position_id) - }; + const message = createBasePositionByIdRequest(); + if (object.position_id !== undefined && object.position_id !== null) { + message.positionId = BigInt(object.position_id); + } + return message; }, toAmino(message: PositionByIdRequest): PositionByIdRequestAmino { const obj: any = {}; @@ -897,9 +962,11 @@ export const PositionByIdResponse = { return message; }, fromAmino(object: PositionByIdResponseAmino): PositionByIdResponse { - return { - position: object?.position ? FullPositionBreakdown.fromAmino(object.position) : undefined - }; + const message = createBasePositionByIdResponse(); + if (object.position !== undefined && object.position !== null) { + message.position = FullPositionBreakdown.fromAmino(object.position); + } + return message; }, toAmino(message: PositionByIdResponse): PositionByIdResponseAmino { const obj: any = {}; @@ -930,7 +997,7 @@ export const PositionByIdResponse = { }; function createBasePoolsRequest(): PoolsRequest { return { - pagination: PageRequest.fromPartial({}) + pagination: undefined }; } export const PoolsRequest = { @@ -964,9 +1031,11 @@ export const PoolsRequest = { return message; }, fromAmino(object: PoolsRequestAmino): PoolsRequest { - return { - pagination: object?.pagination ? PageRequest.fromAmino(object.pagination) : undefined - }; + const message = createBasePoolsRequest(); + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromAmino(object.pagination); + } + return message; }, toAmino(message: PoolsRequest): PoolsRequestAmino { const obj: any = {}; @@ -998,7 +1067,7 @@ export const PoolsRequest = { function createBasePoolsResponse(): PoolsResponse { return { pools: [], - pagination: PageResponse.fromPartial({}) + pagination: undefined }; } export const PoolsResponse = { @@ -1020,7 +1089,7 @@ export const PoolsResponse = { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.pools.push((PoolI_InterfaceDecoder(reader) as Any)); + message.pools.push((Any(reader) as Any)); break; case 2: message.pagination = PageResponse.decode(reader, reader.uint32()); @@ -1039,10 +1108,12 @@ export const PoolsResponse = { return message; }, fromAmino(object: PoolsResponseAmino): PoolsResponse { - return { - pools: Array.isArray(object?.pools) ? object.pools.map((e: any) => PoolI_FromAmino(e)) : [], - pagination: object?.pagination ? PageResponse.fromAmino(object.pagination) : undefined - }; + const message = createBasePoolsResponse(); + message.pools = object.pools?.map(e => PoolI_FromAmino(e)) || []; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromAmino(object.pagination); + } + return message; }, toAmino(message: PoolsResponse): PoolsResponseAmino { const obj: any = {}; @@ -1103,7 +1174,8 @@ export const ParamsRequest = { return message; }, fromAmino(_: ParamsRequestAmino): ParamsRequest { - return {}; + const message = createBaseParamsRequest(); + return message; }, toAmino(_: ParamsRequest): ParamsRequestAmino { const obj: any = {}; @@ -1167,9 +1239,11 @@ export const ParamsResponse = { return message; }, fromAmino(object: ParamsResponseAmino): ParamsResponse { - return { - params: object?.params ? Params.fromAmino(object.params) : undefined - }; + const message = createBaseParamsResponse(); + if (object.params !== undefined && object.params !== null) { + message.params = Params.fromAmino(object.params); + } + return message; }, toAmino(message: ParamsResponse): ParamsResponseAmino { const obj: any = {}; @@ -1242,10 +1316,14 @@ export const TickLiquidityNet = { return message; }, fromAmino(object: TickLiquidityNetAmino): TickLiquidityNet { - return { - liquidityNet: object.liquidity_net, - tickIndex: BigInt(object.tick_index) - }; + const message = createBaseTickLiquidityNet(); + if (object.liquidity_net !== undefined && object.liquidity_net !== null) { + message.liquidityNet = object.liquidity_net; + } + if (object.tick_index !== undefined && object.tick_index !== null) { + message.tickIndex = BigInt(object.tick_index); + } + return message; }, toAmino(message: TickLiquidityNet): TickLiquidityNetAmino { const obj: any = {}; @@ -1327,11 +1405,17 @@ export const LiquidityDepthWithRange = { return message; }, fromAmino(object: LiquidityDepthWithRangeAmino): LiquidityDepthWithRange { - return { - liquidityAmount: object.liquidity_amount, - lowerTick: BigInt(object.lower_tick), - upperTick: BigInt(object.upper_tick) - }; + const message = createBaseLiquidityDepthWithRange(); + if (object.liquidity_amount !== undefined && object.liquidity_amount !== null) { + message.liquidityAmount = object.liquidity_amount; + } + if (object.lower_tick !== undefined && object.lower_tick !== null) { + message.lowerTick = BigInt(object.lower_tick); + } + if (object.upper_tick !== undefined && object.upper_tick !== null) { + message.upperTick = BigInt(object.upper_tick); + } + return message; }, toAmino(message: LiquidityDepthWithRange): LiquidityDepthWithRangeAmino { const obj: any = {}; @@ -1438,14 +1522,26 @@ export const LiquidityNetInDirectionRequest = { return message; }, fromAmino(object: LiquidityNetInDirectionRequestAmino): LiquidityNetInDirectionRequest { - return { - poolId: BigInt(object.pool_id), - tokenIn: object.token_in, - startTick: BigInt(object.start_tick), - useCurTick: object.use_cur_tick, - boundTick: BigInt(object.bound_tick), - useNoBound: object.use_no_bound - }; + const message = createBaseLiquidityNetInDirectionRequest(); + if (object.pool_id !== undefined && object.pool_id !== null) { + message.poolId = BigInt(object.pool_id); + } + if (object.token_in !== undefined && object.token_in !== null) { + message.tokenIn = object.token_in; + } + if (object.start_tick !== undefined && object.start_tick !== null) { + message.startTick = BigInt(object.start_tick); + } + if (object.use_cur_tick !== undefined && object.use_cur_tick !== null) { + message.useCurTick = object.use_cur_tick; + } + if (object.bound_tick !== undefined && object.bound_tick !== null) { + message.boundTick = BigInt(object.bound_tick); + } + if (object.use_no_bound !== undefined && object.use_no_bound !== null) { + message.useNoBound = object.use_no_bound; + } + return message; }, toAmino(message: LiquidityNetInDirectionRequest): LiquidityNetInDirectionRequestAmino { const obj: any = {}; @@ -1483,7 +1579,8 @@ function createBaseLiquidityNetInDirectionResponse(): LiquidityNetInDirectionRes return { liquidityDepths: [], currentTick: BigInt(0), - currentLiquidity: "" + currentLiquidity: "", + currentSqrtPrice: "" }; } export const LiquidityNetInDirectionResponse = { @@ -1498,6 +1595,9 @@ export const LiquidityNetInDirectionResponse = { if (message.currentLiquidity !== "") { writer.uint32(26).string(Decimal.fromUserInput(message.currentLiquidity, 18).atomics); } + if (message.currentSqrtPrice !== "") { + writer.uint32(34).string(message.currentSqrtPrice); + } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): LiquidityNetInDirectionResponse { @@ -1516,6 +1616,9 @@ export const LiquidityNetInDirectionResponse = { case 3: message.currentLiquidity = Decimal.fromAtomics(reader.string(), 18).toString(); break; + case 4: + message.currentSqrtPrice = reader.string(); + break; default: reader.skipType(tag & 7); break; @@ -1528,14 +1631,22 @@ export const LiquidityNetInDirectionResponse = { message.liquidityDepths = object.liquidityDepths?.map(e => TickLiquidityNet.fromPartial(e)) || []; message.currentTick = object.currentTick !== undefined && object.currentTick !== null ? BigInt(object.currentTick.toString()) : BigInt(0); message.currentLiquidity = object.currentLiquidity ?? ""; + message.currentSqrtPrice = object.currentSqrtPrice ?? ""; return message; }, fromAmino(object: LiquidityNetInDirectionResponseAmino): LiquidityNetInDirectionResponse { - return { - liquidityDepths: Array.isArray(object?.liquidity_depths) ? object.liquidity_depths.map((e: any) => TickLiquidityNet.fromAmino(e)) : [], - currentTick: BigInt(object.current_tick), - currentLiquidity: object.current_liquidity - }; + const message = createBaseLiquidityNetInDirectionResponse(); + message.liquidityDepths = object.liquidity_depths?.map(e => TickLiquidityNet.fromAmino(e)) || []; + if (object.current_tick !== undefined && object.current_tick !== null) { + message.currentTick = BigInt(object.current_tick); + } + if (object.current_liquidity !== undefined && object.current_liquidity !== null) { + message.currentLiquidity = object.current_liquidity; + } + if (object.current_sqrt_price !== undefined && object.current_sqrt_price !== null) { + message.currentSqrtPrice = object.current_sqrt_price; + } + return message; }, toAmino(message: LiquidityNetInDirectionResponse): LiquidityNetInDirectionResponseAmino { const obj: any = {}; @@ -1546,6 +1657,7 @@ export const LiquidityNetInDirectionResponse = { } obj.current_tick = message.currentTick ? message.currentTick.toString() : undefined; obj.current_liquidity = message.currentLiquidity; + obj.current_sqrt_price = message.currentSqrtPrice; return obj; }, fromAminoMsg(object: LiquidityNetInDirectionResponseAminoMsg): LiquidityNetInDirectionResponse { @@ -1606,9 +1718,11 @@ export const LiquidityPerTickRangeRequest = { return message; }, fromAmino(object: LiquidityPerTickRangeRequestAmino): LiquidityPerTickRangeRequest { - return { - poolId: BigInt(object.pool_id) - }; + const message = createBaseLiquidityPerTickRangeRequest(); + if (object.pool_id !== undefined && object.pool_id !== null) { + message.poolId = BigInt(object.pool_id); + } + return message; }, toAmino(message: LiquidityPerTickRangeRequest): LiquidityPerTickRangeRequestAmino { const obj: any = {}; @@ -1639,7 +1753,8 @@ export const LiquidityPerTickRangeRequest = { }; function createBaseLiquidityPerTickRangeResponse(): LiquidityPerTickRangeResponse { return { - liquidity: [] + liquidity: [], + bucketIndex: BigInt(0) }; } export const LiquidityPerTickRangeResponse = { @@ -1648,6 +1763,9 @@ export const LiquidityPerTickRangeResponse = { for (const v of message.liquidity) { LiquidityDepthWithRange.encode(v!, writer.uint32(10).fork()).ldelim(); } + if (message.bucketIndex !== BigInt(0)) { + writer.uint32(16).int64(message.bucketIndex); + } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): LiquidityPerTickRangeResponse { @@ -1660,6 +1778,9 @@ export const LiquidityPerTickRangeResponse = { case 1: message.liquidity.push(LiquidityDepthWithRange.decode(reader, reader.uint32())); break; + case 2: + message.bucketIndex = reader.int64(); + break; default: reader.skipType(tag & 7); break; @@ -1670,12 +1791,16 @@ export const LiquidityPerTickRangeResponse = { fromPartial(object: Partial): LiquidityPerTickRangeResponse { const message = createBaseLiquidityPerTickRangeResponse(); message.liquidity = object.liquidity?.map(e => LiquidityDepthWithRange.fromPartial(e)) || []; + message.bucketIndex = object.bucketIndex !== undefined && object.bucketIndex !== null ? BigInt(object.bucketIndex.toString()) : BigInt(0); return message; }, fromAmino(object: LiquidityPerTickRangeResponseAmino): LiquidityPerTickRangeResponse { - return { - liquidity: Array.isArray(object?.liquidity) ? object.liquidity.map((e: any) => LiquidityDepthWithRange.fromAmino(e)) : [] - }; + const message = createBaseLiquidityPerTickRangeResponse(); + message.liquidity = object.liquidity?.map(e => LiquidityDepthWithRange.fromAmino(e)) || []; + if (object.bucket_index !== undefined && object.bucket_index !== null) { + message.bucketIndex = BigInt(object.bucket_index); + } + return message; }, toAmino(message: LiquidityPerTickRangeResponse): LiquidityPerTickRangeResponseAmino { const obj: any = {}; @@ -1684,6 +1809,7 @@ export const LiquidityPerTickRangeResponse = { } else { obj.liquidity = []; } + obj.bucket_index = message.bucketIndex ? message.bucketIndex.toString() : undefined; return obj; }, fromAminoMsg(object: LiquidityPerTickRangeResponseAminoMsg): LiquidityPerTickRangeResponse { @@ -1744,9 +1870,11 @@ export const ClaimableSpreadRewardsRequest = { return message; }, fromAmino(object: ClaimableSpreadRewardsRequestAmino): ClaimableSpreadRewardsRequest { - return { - positionId: BigInt(object.position_id) - }; + const message = createBaseClaimableSpreadRewardsRequest(); + if (object.position_id !== undefined && object.position_id !== null) { + message.positionId = BigInt(object.position_id); + } + return message; }, toAmino(message: ClaimableSpreadRewardsRequest): ClaimableSpreadRewardsRequestAmino { const obj: any = {}; @@ -1811,9 +1939,9 @@ export const ClaimableSpreadRewardsResponse = { return message; }, fromAmino(object: ClaimableSpreadRewardsResponseAmino): ClaimableSpreadRewardsResponse { - return { - claimableSpreadRewards: Array.isArray(object?.claimable_spread_rewards) ? object.claimable_spread_rewards.map((e: any) => Coin.fromAmino(e)) : [] - }; + const message = createBaseClaimableSpreadRewardsResponse(); + message.claimableSpreadRewards = object.claimable_spread_rewards?.map(e => Coin.fromAmino(e)) || []; + return message; }, toAmino(message: ClaimableSpreadRewardsResponse): ClaimableSpreadRewardsResponseAmino { const obj: any = {}; @@ -1882,9 +2010,11 @@ export const ClaimableIncentivesRequest = { return message; }, fromAmino(object: ClaimableIncentivesRequestAmino): ClaimableIncentivesRequest { - return { - positionId: BigInt(object.position_id) - }; + const message = createBaseClaimableIncentivesRequest(); + if (object.position_id !== undefined && object.position_id !== null) { + message.positionId = BigInt(object.position_id); + } + return message; }, toAmino(message: ClaimableIncentivesRequest): ClaimableIncentivesRequestAmino { const obj: any = {}; @@ -1957,10 +2087,10 @@ export const ClaimableIncentivesResponse = { return message; }, fromAmino(object: ClaimableIncentivesResponseAmino): ClaimableIncentivesResponse { - return { - claimableIncentives: Array.isArray(object?.claimable_incentives) ? object.claimable_incentives.map((e: any) => Coin.fromAmino(e)) : [], - forfeitedIncentives: Array.isArray(object?.forfeited_incentives) ? object.forfeited_incentives.map((e: any) => Coin.fromAmino(e)) : [] - }; + const message = createBaseClaimableIncentivesResponse(); + message.claimableIncentives = object.claimable_incentives?.map(e => Coin.fromAmino(e)) || []; + message.forfeitedIncentives = object.forfeited_incentives?.map(e => Coin.fromAmino(e)) || []; + return message; }, toAmino(message: ClaimableIncentivesResponse): ClaimableIncentivesResponseAmino { const obj: any = {}; @@ -2034,9 +2164,11 @@ export const PoolAccumulatorRewardsRequest = { return message; }, fromAmino(object: PoolAccumulatorRewardsRequestAmino): PoolAccumulatorRewardsRequest { - return { - poolId: BigInt(object.pool_id) - }; + const message = createBasePoolAccumulatorRewardsRequest(); + if (object.pool_id !== undefined && object.pool_id !== null) { + message.poolId = BigInt(object.pool_id); + } + return message; }, toAmino(message: PoolAccumulatorRewardsRequest): PoolAccumulatorRewardsRequestAmino { const obj: any = {}; @@ -2109,10 +2241,10 @@ export const PoolAccumulatorRewardsResponse = { return message; }, fromAmino(object: PoolAccumulatorRewardsResponseAmino): PoolAccumulatorRewardsResponse { - return { - spreadRewardGrowthGlobal: Array.isArray(object?.spread_reward_growth_global) ? object.spread_reward_growth_global.map((e: any) => DecCoin.fromAmino(e)) : [], - uptimeGrowthGlobal: Array.isArray(object?.uptime_growth_global) ? object.uptime_growth_global.map((e: any) => UptimeTracker.fromAmino(e)) : [] - }; + const message = createBasePoolAccumulatorRewardsResponse(); + message.spreadRewardGrowthGlobal = object.spread_reward_growth_global?.map(e => DecCoin.fromAmino(e)) || []; + message.uptimeGrowthGlobal = object.uptime_growth_global?.map(e => UptimeTracker.fromAmino(e)) || []; + return message; }, toAmino(message: PoolAccumulatorRewardsResponse): PoolAccumulatorRewardsResponseAmino { const obj: any = {}; @@ -2194,10 +2326,14 @@ export const TickAccumulatorTrackersRequest = { return message; }, fromAmino(object: TickAccumulatorTrackersRequestAmino): TickAccumulatorTrackersRequest { - return { - poolId: BigInt(object.pool_id), - tickIndex: BigInt(object.tick_index) - }; + const message = createBaseTickAccumulatorTrackersRequest(); + if (object.pool_id !== undefined && object.pool_id !== null) { + message.poolId = BigInt(object.pool_id); + } + if (object.tick_index !== undefined && object.tick_index !== null) { + message.tickIndex = BigInt(object.tick_index); + } + return message; }, toAmino(message: TickAccumulatorTrackersRequest): TickAccumulatorTrackersRequestAmino { const obj: any = {}; @@ -2271,10 +2407,10 @@ export const TickAccumulatorTrackersResponse = { return message; }, fromAmino(object: TickAccumulatorTrackersResponseAmino): TickAccumulatorTrackersResponse { - return { - spreadRewardGrowthOppositeDirectionOfLastTraversal: Array.isArray(object?.spread_reward_growth_opposite_direction_of_last_traversal) ? object.spread_reward_growth_opposite_direction_of_last_traversal.map((e: any) => DecCoin.fromAmino(e)) : [], - uptimeTrackers: Array.isArray(object?.uptime_trackers) ? object.uptime_trackers.map((e: any) => UptimeTracker.fromAmino(e)) : [] - }; + const message = createBaseTickAccumulatorTrackersResponse(); + message.spreadRewardGrowthOppositeDirectionOfLastTraversal = object.spread_reward_growth_opposite_direction_of_last_traversal?.map(e => DecCoin.fromAmino(e)) || []; + message.uptimeTrackers = object.uptime_trackers?.map(e => UptimeTracker.fromAmino(e)) || []; + return message; }, toAmino(message: TickAccumulatorTrackersResponse): TickAccumulatorTrackersResponseAmino { const obj: any = {}; @@ -2315,7 +2451,7 @@ export const TickAccumulatorTrackersResponse = { function createBaseIncentiveRecordsRequest(): IncentiveRecordsRequest { return { poolId: BigInt(0), - pagination: PageRequest.fromPartial({}) + pagination: undefined }; } export const IncentiveRecordsRequest = { @@ -2356,10 +2492,14 @@ export const IncentiveRecordsRequest = { return message; }, fromAmino(object: IncentiveRecordsRequestAmino): IncentiveRecordsRequest { - return { - poolId: BigInt(object.pool_id), - pagination: object?.pagination ? PageRequest.fromAmino(object.pagination) : undefined - }; + const message = createBaseIncentiveRecordsRequest(); + if (object.pool_id !== undefined && object.pool_id !== null) { + message.poolId = BigInt(object.pool_id); + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromAmino(object.pagination); + } + return message; }, toAmino(message: IncentiveRecordsRequest): IncentiveRecordsRequestAmino { const obj: any = {}; @@ -2392,7 +2532,7 @@ export const IncentiveRecordsRequest = { function createBaseIncentiveRecordsResponse(): IncentiveRecordsResponse { return { incentiveRecords: [], - pagination: PageResponse.fromPartial({}) + pagination: undefined }; } export const IncentiveRecordsResponse = { @@ -2433,10 +2573,12 @@ export const IncentiveRecordsResponse = { return message; }, fromAmino(object: IncentiveRecordsResponseAmino): IncentiveRecordsResponse { - return { - incentiveRecords: Array.isArray(object?.incentive_records) ? object.incentive_records.map((e: any) => IncentiveRecord.fromAmino(e)) : [], - pagination: object?.pagination ? PageResponse.fromAmino(object.pagination) : undefined - }; + const message = createBaseIncentiveRecordsResponse(); + message.incentiveRecords = object.incentive_records?.map(e => IncentiveRecord.fromAmino(e)) || []; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromAmino(object.pagination); + } + return message; }, toAmino(message: IncentiveRecordsResponse): IncentiveRecordsResponseAmino { const obj: any = {}; @@ -2506,9 +2648,11 @@ export const CFMMPoolIdLinkFromConcentratedPoolIdRequest = { return message; }, fromAmino(object: CFMMPoolIdLinkFromConcentratedPoolIdRequestAmino): CFMMPoolIdLinkFromConcentratedPoolIdRequest { - return { - concentratedPoolId: BigInt(object.concentrated_pool_id) - }; + const message = createBaseCFMMPoolIdLinkFromConcentratedPoolIdRequest(); + if (object.concentrated_pool_id !== undefined && object.concentrated_pool_id !== null) { + message.concentratedPoolId = BigInt(object.concentrated_pool_id); + } + return message; }, toAmino(message: CFMMPoolIdLinkFromConcentratedPoolIdRequest): CFMMPoolIdLinkFromConcentratedPoolIdRequestAmino { const obj: any = {}; @@ -2573,9 +2717,11 @@ export const CFMMPoolIdLinkFromConcentratedPoolIdResponse = { return message; }, fromAmino(object: CFMMPoolIdLinkFromConcentratedPoolIdResponseAmino): CFMMPoolIdLinkFromConcentratedPoolIdResponse { - return { - cfmmPoolId: BigInt(object.cfmm_pool_id) - }; + const message = createBaseCFMMPoolIdLinkFromConcentratedPoolIdResponse(); + if (object.cfmm_pool_id !== undefined && object.cfmm_pool_id !== null) { + message.cfmmPoolId = BigInt(object.cfmm_pool_id); + } + return message; }, toAmino(message: CFMMPoolIdLinkFromConcentratedPoolIdResponse): CFMMPoolIdLinkFromConcentratedPoolIdResponseAmino { const obj: any = {}; @@ -2640,9 +2786,11 @@ export const UserUnbondingPositionsRequest = { return message; }, fromAmino(object: UserUnbondingPositionsRequestAmino): UserUnbondingPositionsRequest { - return { - address: object.address - }; + const message = createBaseUserUnbondingPositionsRequest(); + if (object.address !== undefined && object.address !== null) { + message.address = object.address; + } + return message; }, toAmino(message: UserUnbondingPositionsRequest): UserUnbondingPositionsRequestAmino { const obj: any = {}; @@ -2707,9 +2855,9 @@ export const UserUnbondingPositionsResponse = { return message; }, fromAmino(object: UserUnbondingPositionsResponseAmino): UserUnbondingPositionsResponse { - return { - positionsWithPeriodLock: Array.isArray(object?.positions_with_period_lock) ? object.positions_with_period_lock.map((e: any) => PositionWithPeriodLock.fromAmino(e)) : [] - }; + const message = createBaseUserUnbondingPositionsResponse(); + message.positionsWithPeriodLock = object.positions_with_period_lock?.map(e => PositionWithPeriodLock.fromAmino(e)) || []; + return message; }, toAmino(message: UserUnbondingPositionsResponse): UserUnbondingPositionsResponseAmino { const obj: any = {}; @@ -2769,7 +2917,8 @@ export const GetTotalLiquidityRequest = { return message; }, fromAmino(_: GetTotalLiquidityRequestAmino): GetTotalLiquidityRequest { - return {}; + const message = createBaseGetTotalLiquidityRequest(); + return message; }, toAmino(_: GetTotalLiquidityRequest): GetTotalLiquidityRequestAmino { const obj: any = {}; @@ -2833,9 +2982,9 @@ export const GetTotalLiquidityResponse = { return message; }, fromAmino(object: GetTotalLiquidityResponseAmino): GetTotalLiquidityResponse { - return { - totalLiquidity: Array.isArray(object?.total_liquidity) ? object.total_liquidity.map((e: any) => Coin.fromAmino(e)) : [] - }; + const message = createBaseGetTotalLiquidityResponse(); + message.totalLiquidity = object.total_liquidity?.map(e => Coin.fromAmino(e)) || []; + return message; }, toAmino(message: GetTotalLiquidityResponse): GetTotalLiquidityResponseAmino { const obj: any = {}; @@ -2868,18 +3017,206 @@ export const GetTotalLiquidityResponse = { }; } }; +function createBaseNumNextInitializedTicksRequest(): NumNextInitializedTicksRequest { + return { + poolId: BigInt(0), + tokenInDenom: "", + numNextInitializedTicks: BigInt(0) + }; +} +export const NumNextInitializedTicksRequest = { + typeUrl: "/osmosis.concentratedliquidity.v1beta1.NumNextInitializedTicksRequest", + encode(message: NumNextInitializedTicksRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.poolId !== BigInt(0)) { + writer.uint32(8).uint64(message.poolId); + } + if (message.tokenInDenom !== "") { + writer.uint32(18).string(message.tokenInDenom); + } + if (message.numNextInitializedTicks !== BigInt(0)) { + writer.uint32(24).uint64(message.numNextInitializedTicks); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): NumNextInitializedTicksRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseNumNextInitializedTicksRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.poolId = reader.uint64(); + break; + case 2: + message.tokenInDenom = reader.string(); + break; + case 3: + message.numNextInitializedTicks = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): NumNextInitializedTicksRequest { + const message = createBaseNumNextInitializedTicksRequest(); + message.poolId = object.poolId !== undefined && object.poolId !== null ? BigInt(object.poolId.toString()) : BigInt(0); + message.tokenInDenom = object.tokenInDenom ?? ""; + message.numNextInitializedTicks = object.numNextInitializedTicks !== undefined && object.numNextInitializedTicks !== null ? BigInt(object.numNextInitializedTicks.toString()) : BigInt(0); + return message; + }, + fromAmino(object: NumNextInitializedTicksRequestAmino): NumNextInitializedTicksRequest { + const message = createBaseNumNextInitializedTicksRequest(); + if (object.pool_id !== undefined && object.pool_id !== null) { + message.poolId = BigInt(object.pool_id); + } + if (object.token_in_denom !== undefined && object.token_in_denom !== null) { + message.tokenInDenom = object.token_in_denom; + } + if (object.num_next_initialized_ticks !== undefined && object.num_next_initialized_ticks !== null) { + message.numNextInitializedTicks = BigInt(object.num_next_initialized_ticks); + } + return message; + }, + toAmino(message: NumNextInitializedTicksRequest): NumNextInitializedTicksRequestAmino { + const obj: any = {}; + obj.pool_id = message.poolId ? message.poolId.toString() : undefined; + obj.token_in_denom = message.tokenInDenom; + obj.num_next_initialized_ticks = message.numNextInitializedTicks ? message.numNextInitializedTicks.toString() : undefined; + return obj; + }, + fromAminoMsg(object: NumNextInitializedTicksRequestAminoMsg): NumNextInitializedTicksRequest { + return NumNextInitializedTicksRequest.fromAmino(object.value); + }, + toAminoMsg(message: NumNextInitializedTicksRequest): NumNextInitializedTicksRequestAminoMsg { + return { + type: "osmosis/concentratedliquidity/num-next-initialized-ticks-request", + value: NumNextInitializedTicksRequest.toAmino(message) + }; + }, + fromProtoMsg(message: NumNextInitializedTicksRequestProtoMsg): NumNextInitializedTicksRequest { + return NumNextInitializedTicksRequest.decode(message.value); + }, + toProto(message: NumNextInitializedTicksRequest): Uint8Array { + return NumNextInitializedTicksRequest.encode(message).finish(); + }, + toProtoMsg(message: NumNextInitializedTicksRequest): NumNextInitializedTicksRequestProtoMsg { + return { + typeUrl: "/osmosis.concentratedliquidity.v1beta1.NumNextInitializedTicksRequest", + value: NumNextInitializedTicksRequest.encode(message).finish() + }; + } +}; +function createBaseNumNextInitializedTicksResponse(): NumNextInitializedTicksResponse { + return { + liquidityDepths: [], + currentTick: BigInt(0), + currentLiquidity: "" + }; +} +export const NumNextInitializedTicksResponse = { + typeUrl: "/osmosis.concentratedliquidity.v1beta1.NumNextInitializedTicksResponse", + encode(message: NumNextInitializedTicksResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.liquidityDepths) { + TickLiquidityNet.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.currentTick !== BigInt(0)) { + writer.uint32(16).int64(message.currentTick); + } + if (message.currentLiquidity !== "") { + writer.uint32(26).string(Decimal.fromUserInput(message.currentLiquidity, 18).atomics); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): NumNextInitializedTicksResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseNumNextInitializedTicksResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.liquidityDepths.push(TickLiquidityNet.decode(reader, reader.uint32())); + break; + case 2: + message.currentTick = reader.int64(); + break; + case 3: + message.currentLiquidity = Decimal.fromAtomics(reader.string(), 18).toString(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): NumNextInitializedTicksResponse { + const message = createBaseNumNextInitializedTicksResponse(); + message.liquidityDepths = object.liquidityDepths?.map(e => TickLiquidityNet.fromPartial(e)) || []; + message.currentTick = object.currentTick !== undefined && object.currentTick !== null ? BigInt(object.currentTick.toString()) : BigInt(0); + message.currentLiquidity = object.currentLiquidity ?? ""; + return message; + }, + fromAmino(object: NumNextInitializedTicksResponseAmino): NumNextInitializedTicksResponse { + const message = createBaseNumNextInitializedTicksResponse(); + message.liquidityDepths = object.liquidity_depths?.map(e => TickLiquidityNet.fromAmino(e)) || []; + if (object.current_tick !== undefined && object.current_tick !== null) { + message.currentTick = BigInt(object.current_tick); + } + if (object.current_liquidity !== undefined && object.current_liquidity !== null) { + message.currentLiquidity = object.current_liquidity; + } + return message; + }, + toAmino(message: NumNextInitializedTicksResponse): NumNextInitializedTicksResponseAmino { + const obj: any = {}; + if (message.liquidityDepths) { + obj.liquidity_depths = message.liquidityDepths.map(e => e ? TickLiquidityNet.toAmino(e) : undefined); + } else { + obj.liquidity_depths = []; + } + obj.current_tick = message.currentTick ? message.currentTick.toString() : undefined; + obj.current_liquidity = message.currentLiquidity; + return obj; + }, + fromAminoMsg(object: NumNextInitializedTicksResponseAminoMsg): NumNextInitializedTicksResponse { + return NumNextInitializedTicksResponse.fromAmino(object.value); + }, + toAminoMsg(message: NumNextInitializedTicksResponse): NumNextInitializedTicksResponseAminoMsg { + return { + type: "osmosis/concentratedliquidity/num-next-initialized-ticks-response", + value: NumNextInitializedTicksResponse.toAmino(message) + }; + }, + fromProtoMsg(message: NumNextInitializedTicksResponseProtoMsg): NumNextInitializedTicksResponse { + return NumNextInitializedTicksResponse.decode(message.value); + }, + toProto(message: NumNextInitializedTicksResponse): Uint8Array { + return NumNextInitializedTicksResponse.encode(message).finish(); + }, + toProtoMsg(message: NumNextInitializedTicksResponse): NumNextInitializedTicksResponseProtoMsg { + return { + typeUrl: "/osmosis.concentratedliquidity.v1beta1.NumNextInitializedTicksResponse", + value: NumNextInitializedTicksResponse.encode(message).finish() + }; + } +}; export const PoolI_InterfaceDecoder = (input: BinaryReader | Uint8Array): Pool1 | CosmWasmPool | Pool2 | Pool3 | Any => { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - const data = Any.decode(reader, reader.uint32()); + const data = Any.decode(reader, reader.uint32(), true); switch (data.typeUrl) { case "/osmosis.concentratedliquidity.v1beta1.Pool": - return Pool1.decode(data.value); + return Pool1.decode(data.value, undefined, true); case "/osmosis.cosmwasmpool.v1beta1.CosmWasmPool": - return CosmWasmPool.decode(data.value); - case "/osmosis.gamm.v1beta1.Pool": - return Pool2.decode(data.value); + return CosmWasmPool.decode(data.value, undefined, true); case "/osmosis.gamm.poolmodels.stableswap.v1beta1.Pool": - return Pool3.decode(data.value); + return Pool2.decode(data.value, undefined, true); + case "/osmosis.gamm.v1beta1.Pool": + return Pool3.decode(data.value, undefined, true); default: return data; } @@ -2896,14 +3233,14 @@ export const PoolI_FromAmino = (content: AnyAmino) => { typeUrl: "/osmosis.cosmwasmpool.v1beta1.CosmWasmPool", value: CosmWasmPool.encode(CosmWasmPool.fromPartial(CosmWasmPool.fromAmino(content.value))).finish() }); - case "osmosis/gamm/BalancerPool": + case "osmosis/gamm/StableswapPool": return Any.fromPartial({ - typeUrl: "/osmosis.gamm.v1beta1.Pool", + typeUrl: "/osmosis.gamm.poolmodels.stableswap.v1beta1.Pool", value: Pool2.encode(Pool2.fromPartial(Pool2.fromAmino(content.value))).finish() }); - case "osmosis/gamm/StableswapPool": + case "osmosis/gamm/BalancerPool": return Any.fromPartial({ - typeUrl: "/osmosis.gamm.poolmodels.stableswap.v1beta1.Pool", + typeUrl: "/osmosis.gamm.v1beta1.Pool", value: Pool3.encode(Pool3.fromPartial(Pool3.fromAmino(content.value))).finish() }); default: @@ -2915,22 +3252,22 @@ export const PoolI_ToAmino = (content: Any) => { case "/osmosis.concentratedliquidity.v1beta1.Pool": return { type: "osmosis/concentratedliquidity/pool", - value: Pool1.toAmino(Pool1.decode(content.value)) + value: Pool1.toAmino(Pool1.decode(content.value, undefined)) }; case "/osmosis.cosmwasmpool.v1beta1.CosmWasmPool": return { type: "osmosis/cosmwasmpool/cosm-wasm-pool", - value: CosmWasmPool.toAmino(CosmWasmPool.decode(content.value)) - }; - case "/osmosis.gamm.v1beta1.Pool": - return { - type: "osmosis/gamm/BalancerPool", - value: Pool2.toAmino(Pool2.decode(content.value)) + value: CosmWasmPool.toAmino(CosmWasmPool.decode(content.value, undefined)) }; case "/osmosis.gamm.poolmodels.stableswap.v1beta1.Pool": return { type: "osmosis/gamm/StableswapPool", - value: Pool3.toAmino(Pool3.decode(content.value)) + value: Pool2.toAmino(Pool2.decode(content.value, undefined)) + }; + case "/osmosis.gamm.v1beta1.Pool": + return { + type: "osmosis/gamm/BalancerPool", + value: Pool3.toAmino(Pool3.decode(content.value, undefined)) }; default: return Any.toAmino(content); diff --git a/packages/osmo-query/src/codegen/osmosis/concentrated-liquidity/tickInfo.ts b/packages/osmo-query/src/codegen/osmosis/concentratedliquidity/v1beta1/tickInfo.ts similarity index 88% rename from packages/osmo-query/src/codegen/osmosis/concentrated-liquidity/tickInfo.ts rename to packages/osmo-query/src/codegen/osmosis/concentratedliquidity/v1beta1/tickInfo.ts index ac30bbbd9..2ce31816e 100644 --- a/packages/osmo-query/src/codegen/osmosis/concentrated-liquidity/tickInfo.ts +++ b/packages/osmo-query/src/codegen/osmosis/concentratedliquidity/v1beta1/tickInfo.ts @@ -1,5 +1,5 @@ -import { DecCoin, DecCoinAmino, DecCoinSDKType } from "../../cosmos/base/v1beta1/coin"; -import { BinaryReader, BinaryWriter } from "../../binary"; +import { DecCoin, DecCoinAmino, DecCoinSDKType } from "../../../cosmos/base/v1beta1/coin"; +import { BinaryReader, BinaryWriter } from "../../../binary"; import { Decimal } from "@cosmjs/math"; export interface TickInfo { liquidityGross: string; @@ -18,9 +18,9 @@ export interface TickInfoProtoMsg { value: Uint8Array; } export interface TickInfoAmino { - liquidity_gross: string; - liquidity_net: string; - spread_reward_growth_opposite_direction_of_last_traversal: DecCoinAmino[]; + liquidity_gross?: string; + liquidity_net?: string; + spread_reward_growth_opposite_direction_of_last_traversal?: DecCoinAmino[]; /** * uptime_trackers is a container encapsulating the uptime trackers. * We use a container instead of a "repeated UptimeTracker" directly @@ -47,7 +47,7 @@ export interface UptimeTrackersProtoMsg { value: Uint8Array; } export interface UptimeTrackersAmino { - list: UptimeTrackerAmino[]; + list?: UptimeTrackerAmino[]; } export interface UptimeTrackersAminoMsg { type: "osmosis/concentratedliquidity/uptime-trackers"; @@ -64,7 +64,7 @@ export interface UptimeTrackerProtoMsg { value: Uint8Array; } export interface UptimeTrackerAmino { - uptime_growth_outside: DecCoinAmino[]; + uptime_growth_outside?: DecCoinAmino[]; } export interface UptimeTrackerAminoMsg { type: "osmosis/concentratedliquidity/uptime-tracker"; @@ -133,12 +133,18 @@ export const TickInfo = { return message; }, fromAmino(object: TickInfoAmino): TickInfo { - return { - liquidityGross: object.liquidity_gross, - liquidityNet: object.liquidity_net, - spreadRewardGrowthOppositeDirectionOfLastTraversal: Array.isArray(object?.spread_reward_growth_opposite_direction_of_last_traversal) ? object.spread_reward_growth_opposite_direction_of_last_traversal.map((e: any) => DecCoin.fromAmino(e)) : [], - uptimeTrackers: object?.uptime_trackers ? UptimeTrackers.fromAmino(object.uptime_trackers) : undefined - }; + const message = createBaseTickInfo(); + if (object.liquidity_gross !== undefined && object.liquidity_gross !== null) { + message.liquidityGross = object.liquidity_gross; + } + if (object.liquidity_net !== undefined && object.liquidity_net !== null) { + message.liquidityNet = object.liquidity_net; + } + message.spreadRewardGrowthOppositeDirectionOfLastTraversal = object.spread_reward_growth_opposite_direction_of_last_traversal?.map(e => DecCoin.fromAmino(e)) || []; + if (object.uptime_trackers !== undefined && object.uptime_trackers !== null) { + message.uptimeTrackers = UptimeTrackers.fromAmino(object.uptime_trackers); + } + return message; }, toAmino(message: TickInfo): TickInfoAmino { const obj: any = {}; @@ -210,9 +216,9 @@ export const UptimeTrackers = { return message; }, fromAmino(object: UptimeTrackersAmino): UptimeTrackers { - return { - list: Array.isArray(object?.list) ? object.list.map((e: any) => UptimeTracker.fromAmino(e)) : [] - }; + const message = createBaseUptimeTrackers(); + message.list = object.list?.map(e => UptimeTracker.fromAmino(e)) || []; + return message; }, toAmino(message: UptimeTrackers): UptimeTrackersAmino { const obj: any = {}; @@ -281,9 +287,9 @@ export const UptimeTracker = { return message; }, fromAmino(object: UptimeTrackerAmino): UptimeTracker { - return { - uptimeGrowthOutside: Array.isArray(object?.uptime_growth_outside) ? object.uptime_growth_outside.map((e: any) => DecCoin.fromAmino(e)) : [] - }; + const message = createBaseUptimeTracker(); + message.uptimeGrowthOutside = object.uptime_growth_outside?.map(e => DecCoin.fromAmino(e)) || []; + return message; }, toAmino(message: UptimeTracker): UptimeTrackerAmino { const obj: any = {}; diff --git a/packages/osmo-query/src/codegen/osmosis/concentrated-liquidity/tx.amino.ts b/packages/osmo-query/src/codegen/osmosis/concentratedliquidity/v1beta1/tx.amino.ts similarity index 63% rename from packages/osmo-query/src/codegen/osmosis/concentrated-liquidity/tx.amino.ts rename to packages/osmo-query/src/codegen/osmosis/concentratedliquidity/v1beta1/tx.amino.ts index 42b960a5a..9a1747e83 100644 --- a/packages/osmo-query/src/codegen/osmosis/concentrated-liquidity/tx.amino.ts +++ b/packages/osmo-query/src/codegen/osmosis/concentratedliquidity/v1beta1/tx.amino.ts @@ -1,29 +1,34 @@ //@ts-nocheck -import { MsgCreatePosition, MsgWithdrawPosition, MsgAddToPosition, MsgCollectSpreadRewards, MsgCollectIncentives } from "./tx"; +import { MsgCreatePosition, MsgWithdrawPosition, MsgAddToPosition, MsgCollectSpreadRewards, MsgCollectIncentives, MsgTransferPositions } from "./tx"; export const AminoConverter = { "/osmosis.concentratedliquidity.v1beta1.MsgCreatePosition": { - aminoType: "osmosis/concentratedliquidity/create-position", + aminoType: "osmosis/cl-create-position", toAmino: MsgCreatePosition.toAmino, fromAmino: MsgCreatePosition.fromAmino }, "/osmosis.concentratedliquidity.v1beta1.MsgWithdrawPosition": { - aminoType: "osmosis/concentratedliquidity/withdraw-position", + aminoType: "osmosis/cl-withdraw-position", toAmino: MsgWithdrawPosition.toAmino, fromAmino: MsgWithdrawPosition.fromAmino }, "/osmosis.concentratedliquidity.v1beta1.MsgAddToPosition": { - aminoType: "osmosis/concentratedliquidity/add-to-position", + aminoType: "osmosis/cl-add-to-position", toAmino: MsgAddToPosition.toAmino, fromAmino: MsgAddToPosition.fromAmino }, "/osmosis.concentratedliquidity.v1beta1.MsgCollectSpreadRewards": { - aminoType: "osmosis/concentratedliquidity/collect-spread-rewards", + aminoType: "osmosis/cl-col-sp-rewards", toAmino: MsgCollectSpreadRewards.toAmino, fromAmino: MsgCollectSpreadRewards.fromAmino }, "/osmosis.concentratedliquidity.v1beta1.MsgCollectIncentives": { - aminoType: "osmosis/concentratedliquidity/collect-incentives", + aminoType: "osmosis/cl-collect-incentives", toAmino: MsgCollectIncentives.toAmino, fromAmino: MsgCollectIncentives.fromAmino + }, + "/osmosis.concentratedliquidity.v1beta1.MsgTransferPositions": { + aminoType: "osmosis/cl-transfer-positions", + toAmino: MsgTransferPositions.toAmino, + fromAmino: MsgTransferPositions.fromAmino } }; \ No newline at end of file diff --git a/packages/osmo-query/src/codegen/osmosis/concentrated-liquidity/tx.registry.ts b/packages/osmo-query/src/codegen/osmosis/concentratedliquidity/v1beta1/tx.registry.ts similarity index 82% rename from packages/osmo-query/src/codegen/osmosis/concentrated-liquidity/tx.registry.ts rename to packages/osmo-query/src/codegen/osmosis/concentratedliquidity/v1beta1/tx.registry.ts index 965fa2714..a47623ee6 100644 --- a/packages/osmo-query/src/codegen/osmosis/concentrated-liquidity/tx.registry.ts +++ b/packages/osmo-query/src/codegen/osmosis/concentratedliquidity/v1beta1/tx.registry.ts @@ -1,7 +1,7 @@ //@ts-nocheck import { GeneratedType, Registry } from "@cosmjs/proto-signing"; -import { MsgCreatePosition, MsgWithdrawPosition, MsgAddToPosition, MsgCollectSpreadRewards, MsgCollectIncentives } from "./tx"; -export const registry: ReadonlyArray<[string, GeneratedType]> = [["/osmosis.concentratedliquidity.v1beta1.MsgCreatePosition", MsgCreatePosition], ["/osmosis.concentratedliquidity.v1beta1.MsgWithdrawPosition", MsgWithdrawPosition], ["/osmosis.concentratedliquidity.v1beta1.MsgAddToPosition", MsgAddToPosition], ["/osmosis.concentratedliquidity.v1beta1.MsgCollectSpreadRewards", MsgCollectSpreadRewards], ["/osmosis.concentratedliquidity.v1beta1.MsgCollectIncentives", MsgCollectIncentives]]; +import { MsgCreatePosition, MsgWithdrawPosition, MsgAddToPosition, MsgCollectSpreadRewards, MsgCollectIncentives, MsgTransferPositions } from "./tx"; +export const registry: ReadonlyArray<[string, GeneratedType]> = [["/osmosis.concentratedliquidity.v1beta1.MsgCreatePosition", MsgCreatePosition], ["/osmosis.concentratedliquidity.v1beta1.MsgWithdrawPosition", MsgWithdrawPosition], ["/osmosis.concentratedliquidity.v1beta1.MsgAddToPosition", MsgAddToPosition], ["/osmosis.concentratedliquidity.v1beta1.MsgCollectSpreadRewards", MsgCollectSpreadRewards], ["/osmosis.concentratedliquidity.v1beta1.MsgCollectIncentives", MsgCollectIncentives], ["/osmosis.concentratedliquidity.v1beta1.MsgTransferPositions", MsgTransferPositions]]; export const load = (protoRegistry: Registry) => { registry.forEach(([typeUrl, mod]) => { protoRegistry.register(typeUrl, mod); @@ -38,6 +38,12 @@ export const MessageComposer = { typeUrl: "/osmosis.concentratedliquidity.v1beta1.MsgCollectIncentives", value: MsgCollectIncentives.encode(value).finish() }; + }, + transferPositions(value: MsgTransferPositions) { + return { + typeUrl: "/osmosis.concentratedliquidity.v1beta1.MsgTransferPositions", + value: MsgTransferPositions.encode(value).finish() + }; } }, withTypeUrl: { @@ -70,6 +76,12 @@ export const MessageComposer = { typeUrl: "/osmosis.concentratedliquidity.v1beta1.MsgCollectIncentives", value }; + }, + transferPositions(value: MsgTransferPositions) { + return { + typeUrl: "/osmosis.concentratedliquidity.v1beta1.MsgTransferPositions", + value + }; } }, fromPartial: { @@ -102,6 +114,12 @@ export const MessageComposer = { typeUrl: "/osmosis.concentratedliquidity.v1beta1.MsgCollectIncentives", value: MsgCollectIncentives.fromPartial(value) }; + }, + transferPositions(value: MsgTransferPositions) { + return { + typeUrl: "/osmosis.concentratedliquidity.v1beta1.MsgTransferPositions", + value: MsgTransferPositions.fromPartial(value) + }; } } }; \ No newline at end of file diff --git a/packages/osmo-query/src/codegen/osmosis/concentrated-liquidity/tx.rpc.msg.ts b/packages/osmo-query/src/codegen/osmosis/concentratedliquidity/v1beta1/tx.rpc.msg.ts similarity index 80% rename from packages/osmo-query/src/codegen/osmosis/concentrated-liquidity/tx.rpc.msg.ts rename to packages/osmo-query/src/codegen/osmosis/concentratedliquidity/v1beta1/tx.rpc.msg.ts index 0de3af954..217f715c8 100644 --- a/packages/osmo-query/src/codegen/osmosis/concentrated-liquidity/tx.rpc.msg.ts +++ b/packages/osmo-query/src/codegen/osmosis/concentratedliquidity/v1beta1/tx.rpc.msg.ts @@ -1,6 +1,6 @@ -import { Rpc } from "../../helpers"; -import { BinaryReader } from "../../binary"; -import { MsgCreatePosition, MsgCreatePositionResponse, MsgWithdrawPosition, MsgWithdrawPositionResponse, MsgAddToPosition, MsgAddToPositionResponse, MsgCollectSpreadRewards, MsgCollectSpreadRewardsResponse, MsgCollectIncentives, MsgCollectIncentivesResponse } from "./tx"; +import { Rpc } from "../../../helpers"; +import { BinaryReader } from "../../../binary"; +import { MsgCreatePosition, MsgCreatePositionResponse, MsgWithdrawPosition, MsgWithdrawPositionResponse, MsgAddToPosition, MsgAddToPositionResponse, MsgCollectSpreadRewards, MsgCollectSpreadRewardsResponse, MsgCollectIncentives, MsgCollectIncentivesResponse, MsgTransferPositions, MsgTransferPositionsResponse } from "./tx"; export interface Msg { createPosition(request: MsgCreatePosition): Promise; withdrawPosition(request: MsgWithdrawPosition): Promise; @@ -14,6 +14,11 @@ export interface Msg { addToPosition(request: MsgAddToPosition): Promise; collectSpreadRewards(request: MsgCollectSpreadRewards): Promise; collectIncentives(request: MsgCollectIncentives): Promise; + /** + * TransferPositions transfers ownership of a set of one or more positions + * from a sender to a recipient. + */ + transferPositions(request: MsgTransferPositions): Promise; } export class MsgClientImpl implements Msg { private readonly rpc: Rpc; @@ -24,6 +29,7 @@ export class MsgClientImpl implements Msg { this.addToPosition = this.addToPosition.bind(this); this.collectSpreadRewards = this.collectSpreadRewards.bind(this); this.collectIncentives = this.collectIncentives.bind(this); + this.transferPositions = this.transferPositions.bind(this); } createPosition(request: MsgCreatePosition): Promise { const data = MsgCreatePosition.encode(request).finish(); @@ -50,4 +56,9 @@ export class MsgClientImpl implements Msg { const promise = this.rpc.request("osmosis.concentratedliquidity.v1beta1.Msg", "CollectIncentives", data); return promise.then(data => MsgCollectIncentivesResponse.decode(new BinaryReader(data))); } + transferPositions(request: MsgTransferPositions): Promise { + const data = MsgTransferPositions.encode(request).finish(); + const promise = this.rpc.request("osmosis.concentratedliquidity.v1beta1.Msg", "TransferPositions", data); + return promise.then(data => MsgTransferPositionsResponse.decode(new BinaryReader(data))); + } } \ No newline at end of file diff --git a/packages/osmojs/src/codegen/osmosis/concentrated-liquidity/tx.ts b/packages/osmo-query/src/codegen/osmosis/concentratedliquidity/v1beta1/tx.ts similarity index 78% rename from packages/osmojs/src/codegen/osmosis/concentrated-liquidity/tx.ts rename to packages/osmo-query/src/codegen/osmosis/concentratedliquidity/v1beta1/tx.ts index 52a00f6b5..26942cc99 100644 --- a/packages/osmojs/src/codegen/osmosis/concentrated-liquidity/tx.ts +++ b/packages/osmo-query/src/codegen/osmosis/concentratedliquidity/v1beta1/tx.ts @@ -1,5 +1,5 @@ -import { Coin, CoinAmino, CoinSDKType } from "../../cosmos/base/v1beta1/coin"; -import { BinaryReader, BinaryWriter } from "../../binary"; +import { Coin, CoinAmino, CoinSDKType } from "../../../cosmos/base/v1beta1/coin"; +import { BinaryReader, BinaryWriter } from "../../../binary"; import { Decimal } from "@cosmjs/math"; /** ===================== MsgCreatePosition */ export interface MsgCreatePosition { @@ -23,22 +23,22 @@ export interface MsgCreatePositionProtoMsg { } /** ===================== MsgCreatePosition */ export interface MsgCreatePositionAmino { - pool_id: string; - sender: string; - lower_tick: string; - upper_tick: string; + pool_id?: string; + sender?: string; + lower_tick?: string; + upper_tick?: string; /** * tokens_provided is the amount of tokens provided for the position. * It must at a minimum be of length 1 (for a single sided position) * and at a maximum be of length 2 (for a position that straddles the current * tick). */ - tokens_provided: CoinAmino[]; - token_min_amount0: string; - token_min_amount1: string; + tokens_provided?: CoinAmino[]; + token_min_amount0?: string; + token_min_amount1?: string; } export interface MsgCreatePositionAminoMsg { - type: "osmosis/concentratedliquidity/create-position"; + type: "osmosis/cl-create-position"; value: MsgCreatePositionAmino; } /** ===================== MsgCreatePosition */ @@ -70,18 +70,18 @@ export interface MsgCreatePositionResponseProtoMsg { value: Uint8Array; } export interface MsgCreatePositionResponseAmino { - position_id: string; - amount0: string; - amount1: string; - liquidity_created: string; + position_id?: string; + amount0?: string; + amount1?: string; + liquidity_created?: string; /** * the lower and upper tick are in the response because there are * instances in which multiple ticks represent the same price, so * we may move their provided tick to the canonical tick that represents * the same price. */ - lower_tick: string; - upper_tick: string; + lower_tick?: string; + upper_tick?: string; } export interface MsgCreatePositionResponseAminoMsg { type: "osmosis/concentratedliquidity/create-position-response"; @@ -124,29 +124,29 @@ export interface MsgAddToPositionProtoMsg { } /** ===================== MsgAddToPosition */ export interface MsgAddToPositionAmino { - position_id: string; - sender: string; + position_id?: string; + sender?: string; /** amount0 represents the amount of token0 willing to put in. */ - amount0: string; + amount0?: string; /** amount1 represents the amount of token1 willing to put in. */ - amount1: string; + amount1?: string; /** * token_min_amount0 represents the minimum amount of token0 desired from the * new position being created. Note that this field indicates the min amount0 * corresponding to the liquidity that is being added, not the total * liquidity of the position. */ - token_min_amount0: string; + token_min_amount0?: string; /** * token_min_amount1 represents the minimum amount of token1 desired from the * new position being created. Note that this field indicates the min amount1 * corresponding to the liquidity that is being added, not the total * liquidity of the position. */ - token_min_amount1: string; + token_min_amount1?: string; } export interface MsgAddToPositionAminoMsg { - type: "osmosis/concentratedliquidity/add-to-position"; + type: "osmosis/cl-add-to-position"; value: MsgAddToPositionAmino; } /** ===================== MsgAddToPosition */ @@ -168,9 +168,9 @@ export interface MsgAddToPositionResponseProtoMsg { value: Uint8Array; } export interface MsgAddToPositionResponseAmino { - position_id: string; - amount0: string; - amount1: string; + position_id?: string; + amount0?: string; + amount1?: string; } export interface MsgAddToPositionResponseAminoMsg { type: "osmosis/concentratedliquidity/add-to-position-response"; @@ -193,12 +193,12 @@ export interface MsgWithdrawPositionProtoMsg { } /** ===================== MsgWithdrawPosition */ export interface MsgWithdrawPositionAmino { - position_id: string; - sender: string; - liquidity_amount: string; + position_id?: string; + sender?: string; + liquidity_amount?: string; } export interface MsgWithdrawPositionAminoMsg { - type: "osmosis/concentratedliquidity/withdraw-position"; + type: "osmosis/cl-withdraw-position"; value: MsgWithdrawPositionAmino; } /** ===================== MsgWithdrawPosition */ @@ -216,8 +216,8 @@ export interface MsgWithdrawPositionResponseProtoMsg { value: Uint8Array; } export interface MsgWithdrawPositionResponseAmino { - amount0: string; - amount1: string; + amount0?: string; + amount1?: string; } export interface MsgWithdrawPositionResponseAminoMsg { type: "osmosis/concentratedliquidity/withdraw-position-response"; @@ -238,11 +238,11 @@ export interface MsgCollectSpreadRewardsProtoMsg { } /** ===================== MsgCollectSpreadRewards */ export interface MsgCollectSpreadRewardsAmino { - position_ids: string[]; - sender: string; + position_ids?: string[]; + sender?: string; } export interface MsgCollectSpreadRewardsAminoMsg { - type: "osmosis/concentratedliquidity/collect-spread-rewards"; + type: "osmosis/cl-col-sp-rewards"; value: MsgCollectSpreadRewardsAmino; } /** ===================== MsgCollectSpreadRewards */ @@ -258,7 +258,7 @@ export interface MsgCollectSpreadRewardsResponseProtoMsg { value: Uint8Array; } export interface MsgCollectSpreadRewardsResponseAmino { - collected_spread_rewards: CoinAmino[]; + collected_spread_rewards?: CoinAmino[]; } export interface MsgCollectSpreadRewardsResponseAminoMsg { type: "osmosis/concentratedliquidity/collect-spread-rewards-response"; @@ -278,11 +278,11 @@ export interface MsgCollectIncentivesProtoMsg { } /** ===================== MsgCollectIncentives */ export interface MsgCollectIncentivesAmino { - position_ids: string[]; - sender: string; + position_ids?: string[]; + sender?: string; } export interface MsgCollectIncentivesAminoMsg { - type: "osmosis/concentratedliquidity/collect-incentives"; + type: "osmosis/cl-collect-incentives"; value: MsgCollectIncentivesAmino; } /** ===================== MsgCollectIncentives */ @@ -299,8 +299,8 @@ export interface MsgCollectIncentivesResponseProtoMsg { value: Uint8Array; } export interface MsgCollectIncentivesResponseAmino { - collected_incentives: CoinAmino[]; - forfeited_incentives: CoinAmino[]; + collected_incentives?: CoinAmino[]; + forfeited_incentives?: CoinAmino[]; } export interface MsgCollectIncentivesResponseAminoMsg { type: "osmosis/concentratedliquidity/collect-incentives-response"; @@ -321,11 +321,11 @@ export interface MsgFungifyChargedPositionsProtoMsg { } /** ===================== MsgFungifyChargedPositions */ export interface MsgFungifyChargedPositionsAmino { - position_ids: string[]; - sender: string; + position_ids?: string[]; + sender?: string; } export interface MsgFungifyChargedPositionsAminoMsg { - type: "osmosis/concentratedliquidity/fungify-charged-positions"; + type: "osmosis/cl-fungify-charged-positions"; value: MsgFungifyChargedPositionsAmino; } /** ===================== MsgFungifyChargedPositions */ @@ -341,7 +341,7 @@ export interface MsgFungifyChargedPositionsResponseProtoMsg { value: Uint8Array; } export interface MsgFungifyChargedPositionsResponseAmino { - new_position_id: string; + new_position_id?: string; } export interface MsgFungifyChargedPositionsResponseAminoMsg { type: "osmosis/concentratedliquidity/fungify-charged-positions-response"; @@ -350,6 +350,43 @@ export interface MsgFungifyChargedPositionsResponseAminoMsg { export interface MsgFungifyChargedPositionsResponseSDKType { new_position_id: bigint; } +/** ===================== MsgTransferPositions */ +export interface MsgTransferPositions { + positionIds: bigint[]; + sender: string; + newOwner: string; +} +export interface MsgTransferPositionsProtoMsg { + typeUrl: "/osmosis.concentratedliquidity.v1beta1.MsgTransferPositions"; + value: Uint8Array; +} +/** ===================== MsgTransferPositions */ +export interface MsgTransferPositionsAmino { + position_ids?: string[]; + sender?: string; + new_owner?: string; +} +export interface MsgTransferPositionsAminoMsg { + type: "osmosis/cl-transfer-positions"; + value: MsgTransferPositionsAmino; +} +/** ===================== MsgTransferPositions */ +export interface MsgTransferPositionsSDKType { + position_ids: bigint[]; + sender: string; + new_owner: string; +} +export interface MsgTransferPositionsResponse {} +export interface MsgTransferPositionsResponseProtoMsg { + typeUrl: "/osmosis.concentratedliquidity.v1beta1.MsgTransferPositionsResponse"; + value: Uint8Array; +} +export interface MsgTransferPositionsResponseAmino {} +export interface MsgTransferPositionsResponseAminoMsg { + type: "osmosis/concentratedliquidity/transfer-positions-response"; + value: MsgTransferPositionsResponseAmino; +} +export interface MsgTransferPositionsResponseSDKType {} function createBaseMsgCreatePosition(): MsgCreatePosition { return { poolId: BigInt(0), @@ -434,15 +471,27 @@ export const MsgCreatePosition = { return message; }, fromAmino(object: MsgCreatePositionAmino): MsgCreatePosition { - return { - poolId: BigInt(object.pool_id), - sender: object.sender, - lowerTick: BigInt(object.lower_tick), - upperTick: BigInt(object.upper_tick), - tokensProvided: Array.isArray(object?.tokens_provided) ? object.tokens_provided.map((e: any) => Coin.fromAmino(e)) : [], - tokenMinAmount0: object.token_min_amount0, - tokenMinAmount1: object.token_min_amount1 - }; + const message = createBaseMsgCreatePosition(); + if (object.pool_id !== undefined && object.pool_id !== null) { + message.poolId = BigInt(object.pool_id); + } + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + if (object.lower_tick !== undefined && object.lower_tick !== null) { + message.lowerTick = BigInt(object.lower_tick); + } + if (object.upper_tick !== undefined && object.upper_tick !== null) { + message.upperTick = BigInt(object.upper_tick); + } + message.tokensProvided = object.tokens_provided?.map(e => Coin.fromAmino(e)) || []; + if (object.token_min_amount0 !== undefined && object.token_min_amount0 !== null) { + message.tokenMinAmount0 = object.token_min_amount0; + } + if (object.token_min_amount1 !== undefined && object.token_min_amount1 !== null) { + message.tokenMinAmount1 = object.token_min_amount1; + } + return message; }, toAmino(message: MsgCreatePosition): MsgCreatePositionAmino { const obj: any = {}; @@ -464,7 +513,7 @@ export const MsgCreatePosition = { }, toAminoMsg(message: MsgCreatePosition): MsgCreatePositionAminoMsg { return { - type: "osmosis/concentratedliquidity/create-position", + type: "osmosis/cl-create-position", value: MsgCreatePosition.toAmino(message) }; }, @@ -557,14 +606,26 @@ export const MsgCreatePositionResponse = { return message; }, fromAmino(object: MsgCreatePositionResponseAmino): MsgCreatePositionResponse { - return { - positionId: BigInt(object.position_id), - amount0: object.amount0, - amount1: object.amount1, - liquidityCreated: object.liquidity_created, - lowerTick: BigInt(object.lower_tick), - upperTick: BigInt(object.upper_tick) - }; + const message = createBaseMsgCreatePositionResponse(); + if (object.position_id !== undefined && object.position_id !== null) { + message.positionId = BigInt(object.position_id); + } + if (object.amount0 !== undefined && object.amount0 !== null) { + message.amount0 = object.amount0; + } + if (object.amount1 !== undefined && object.amount1 !== null) { + message.amount1 = object.amount1; + } + if (object.liquidity_created !== undefined && object.liquidity_created !== null) { + message.liquidityCreated = object.liquidity_created; + } + if (object.lower_tick !== undefined && object.lower_tick !== null) { + message.lowerTick = BigInt(object.lower_tick); + } + if (object.upper_tick !== undefined && object.upper_tick !== null) { + message.upperTick = BigInt(object.upper_tick); + } + return message; }, toAmino(message: MsgCreatePositionResponse): MsgCreatePositionResponseAmino { const obj: any = {}; @@ -674,14 +735,26 @@ export const MsgAddToPosition = { return message; }, fromAmino(object: MsgAddToPositionAmino): MsgAddToPosition { - return { - positionId: BigInt(object.position_id), - sender: object.sender, - amount0: object.amount0, - amount1: object.amount1, - tokenMinAmount0: object.token_min_amount0, - tokenMinAmount1: object.token_min_amount1 - }; + const message = createBaseMsgAddToPosition(); + if (object.position_id !== undefined && object.position_id !== null) { + message.positionId = BigInt(object.position_id); + } + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + if (object.amount0 !== undefined && object.amount0 !== null) { + message.amount0 = object.amount0; + } + if (object.amount1 !== undefined && object.amount1 !== null) { + message.amount1 = object.amount1; + } + if (object.token_min_amount0 !== undefined && object.token_min_amount0 !== null) { + message.tokenMinAmount0 = object.token_min_amount0; + } + if (object.token_min_amount1 !== undefined && object.token_min_amount1 !== null) { + message.tokenMinAmount1 = object.token_min_amount1; + } + return message; }, toAmino(message: MsgAddToPosition): MsgAddToPositionAmino { const obj: any = {}; @@ -698,7 +771,7 @@ export const MsgAddToPosition = { }, toAminoMsg(message: MsgAddToPosition): MsgAddToPositionAminoMsg { return { - type: "osmosis/concentratedliquidity/add-to-position", + type: "osmosis/cl-add-to-position", value: MsgAddToPosition.toAmino(message) }; }, @@ -767,11 +840,17 @@ export const MsgAddToPositionResponse = { return message; }, fromAmino(object: MsgAddToPositionResponseAmino): MsgAddToPositionResponse { - return { - positionId: BigInt(object.position_id), - amount0: object.amount0, - amount1: object.amount1 - }; + const message = createBaseMsgAddToPositionResponse(); + if (object.position_id !== undefined && object.position_id !== null) { + message.positionId = BigInt(object.position_id); + } + if (object.amount0 !== undefined && object.amount0 !== null) { + message.amount0 = object.amount0; + } + if (object.amount1 !== undefined && object.amount1 !== null) { + message.amount1 = object.amount1; + } + return message; }, toAmino(message: MsgAddToPositionResponse): MsgAddToPositionResponseAmino { const obj: any = {}; @@ -854,11 +933,17 @@ export const MsgWithdrawPosition = { return message; }, fromAmino(object: MsgWithdrawPositionAmino): MsgWithdrawPosition { - return { - positionId: BigInt(object.position_id), - sender: object.sender, - liquidityAmount: object.liquidity_amount - }; + const message = createBaseMsgWithdrawPosition(); + if (object.position_id !== undefined && object.position_id !== null) { + message.positionId = BigInt(object.position_id); + } + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + if (object.liquidity_amount !== undefined && object.liquidity_amount !== null) { + message.liquidityAmount = object.liquidity_amount; + } + return message; }, toAmino(message: MsgWithdrawPosition): MsgWithdrawPositionAmino { const obj: any = {}; @@ -872,7 +957,7 @@ export const MsgWithdrawPosition = { }, toAminoMsg(message: MsgWithdrawPosition): MsgWithdrawPositionAminoMsg { return { - type: "osmosis/concentratedliquidity/withdraw-position", + type: "osmosis/cl-withdraw-position", value: MsgWithdrawPosition.toAmino(message) }; }, @@ -933,10 +1018,14 @@ export const MsgWithdrawPositionResponse = { return message; }, fromAmino(object: MsgWithdrawPositionResponseAmino): MsgWithdrawPositionResponse { - return { - amount0: object.amount0, - amount1: object.amount1 - }; + const message = createBaseMsgWithdrawPositionResponse(); + if (object.amount0 !== undefined && object.amount0 !== null) { + message.amount0 = object.amount0; + } + if (object.amount1 !== undefined && object.amount1 !== null) { + message.amount1 = object.amount1; + } + return message; }, toAmino(message: MsgWithdrawPositionResponse): MsgWithdrawPositionResponseAmino { const obj: any = {}; @@ -1019,10 +1108,12 @@ export const MsgCollectSpreadRewards = { return message; }, fromAmino(object: MsgCollectSpreadRewardsAmino): MsgCollectSpreadRewards { - return { - positionIds: Array.isArray(object?.position_ids) ? object.position_ids.map((e: any) => BigInt(e)) : [], - sender: object.sender - }; + const message = createBaseMsgCollectSpreadRewards(); + message.positionIds = object.position_ids?.map(e => BigInt(e)) || []; + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + return message; }, toAmino(message: MsgCollectSpreadRewards): MsgCollectSpreadRewardsAmino { const obj: any = {}; @@ -1039,7 +1130,7 @@ export const MsgCollectSpreadRewards = { }, toAminoMsg(message: MsgCollectSpreadRewards): MsgCollectSpreadRewardsAminoMsg { return { - type: "osmosis/concentratedliquidity/collect-spread-rewards", + type: "osmosis/cl-col-sp-rewards", value: MsgCollectSpreadRewards.toAmino(message) }; }, @@ -1092,9 +1183,9 @@ export const MsgCollectSpreadRewardsResponse = { return message; }, fromAmino(object: MsgCollectSpreadRewardsResponseAmino): MsgCollectSpreadRewardsResponse { - return { - collectedSpreadRewards: Array.isArray(object?.collected_spread_rewards) ? object.collected_spread_rewards.map((e: any) => Coin.fromAmino(e)) : [] - }; + const message = createBaseMsgCollectSpreadRewardsResponse(); + message.collectedSpreadRewards = object.collected_spread_rewards?.map(e => Coin.fromAmino(e)) || []; + return message; }, toAmino(message: MsgCollectSpreadRewardsResponse): MsgCollectSpreadRewardsResponseAmino { const obj: any = {}; @@ -1180,10 +1271,12 @@ export const MsgCollectIncentives = { return message; }, fromAmino(object: MsgCollectIncentivesAmino): MsgCollectIncentives { - return { - positionIds: Array.isArray(object?.position_ids) ? object.position_ids.map((e: any) => BigInt(e)) : [], - sender: object.sender - }; + const message = createBaseMsgCollectIncentives(); + message.positionIds = object.position_ids?.map(e => BigInt(e)) || []; + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + return message; }, toAmino(message: MsgCollectIncentives): MsgCollectIncentivesAmino { const obj: any = {}; @@ -1200,7 +1293,7 @@ export const MsgCollectIncentives = { }, toAminoMsg(message: MsgCollectIncentives): MsgCollectIncentivesAminoMsg { return { - type: "osmosis/concentratedliquidity/collect-incentives", + type: "osmosis/cl-collect-incentives", value: MsgCollectIncentives.toAmino(message) }; }, @@ -1261,10 +1354,10 @@ export const MsgCollectIncentivesResponse = { return message; }, fromAmino(object: MsgCollectIncentivesResponseAmino): MsgCollectIncentivesResponse { - return { - collectedIncentives: Array.isArray(object?.collected_incentives) ? object.collected_incentives.map((e: any) => Coin.fromAmino(e)) : [], - forfeitedIncentives: Array.isArray(object?.forfeited_incentives) ? object.forfeited_incentives.map((e: any) => Coin.fromAmino(e)) : [] - }; + const message = createBaseMsgCollectIncentivesResponse(); + message.collectedIncentives = object.collected_incentives?.map(e => Coin.fromAmino(e)) || []; + message.forfeitedIncentives = object.forfeited_incentives?.map(e => Coin.fromAmino(e)) || []; + return message; }, toAmino(message: MsgCollectIncentivesResponse): MsgCollectIncentivesResponseAmino { const obj: any = {}; @@ -1355,10 +1448,12 @@ export const MsgFungifyChargedPositions = { return message; }, fromAmino(object: MsgFungifyChargedPositionsAmino): MsgFungifyChargedPositions { - return { - positionIds: Array.isArray(object?.position_ids) ? object.position_ids.map((e: any) => BigInt(e)) : [], - sender: object.sender - }; + const message = createBaseMsgFungifyChargedPositions(); + message.positionIds = object.position_ids?.map(e => BigInt(e)) || []; + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + return message; }, toAmino(message: MsgFungifyChargedPositions): MsgFungifyChargedPositionsAmino { const obj: any = {}; @@ -1375,7 +1470,7 @@ export const MsgFungifyChargedPositions = { }, toAminoMsg(message: MsgFungifyChargedPositions): MsgFungifyChargedPositionsAminoMsg { return { - type: "osmosis/concentratedliquidity/fungify-charged-positions", + type: "osmosis/cl-fungify-charged-positions", value: MsgFungifyChargedPositions.toAmino(message) }; }, @@ -1428,9 +1523,11 @@ export const MsgFungifyChargedPositionsResponse = { return message; }, fromAmino(object: MsgFungifyChargedPositionsResponseAmino): MsgFungifyChargedPositionsResponse { - return { - newPositionId: BigInt(object.new_position_id) - }; + const message = createBaseMsgFungifyChargedPositionsResponse(); + if (object.new_position_id !== undefined && object.new_position_id !== null) { + message.newPositionId = BigInt(object.new_position_id); + } + return message; }, toAmino(message: MsgFungifyChargedPositionsResponse): MsgFungifyChargedPositionsResponseAmino { const obj: any = {}; @@ -1458,4 +1555,164 @@ export const MsgFungifyChargedPositionsResponse = { value: MsgFungifyChargedPositionsResponse.encode(message).finish() }; } +}; +function createBaseMsgTransferPositions(): MsgTransferPositions { + return { + positionIds: [], + sender: "", + newOwner: "" + }; +} +export const MsgTransferPositions = { + typeUrl: "/osmosis.concentratedliquidity.v1beta1.MsgTransferPositions", + encode(message: MsgTransferPositions, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + writer.uint32(10).fork(); + for (const v of message.positionIds) { + writer.uint64(v); + } + writer.ldelim(); + if (message.sender !== "") { + writer.uint32(18).string(message.sender); + } + if (message.newOwner !== "") { + writer.uint32(26).string(message.newOwner); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgTransferPositions { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgTransferPositions(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if ((tag & 7) === 2) { + const end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) { + message.positionIds.push(reader.uint64()); + } + } else { + message.positionIds.push(reader.uint64()); + } + break; + case 2: + message.sender = reader.string(); + break; + case 3: + message.newOwner = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgTransferPositions { + const message = createBaseMsgTransferPositions(); + message.positionIds = object.positionIds?.map(e => BigInt(e.toString())) || []; + message.sender = object.sender ?? ""; + message.newOwner = object.newOwner ?? ""; + return message; + }, + fromAmino(object: MsgTransferPositionsAmino): MsgTransferPositions { + const message = createBaseMsgTransferPositions(); + message.positionIds = object.position_ids?.map(e => BigInt(e)) || []; + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + if (object.new_owner !== undefined && object.new_owner !== null) { + message.newOwner = object.new_owner; + } + return message; + }, + toAmino(message: MsgTransferPositions): MsgTransferPositionsAmino { + const obj: any = {}; + if (message.positionIds) { + obj.position_ids = message.positionIds.map(e => e.toString()); + } else { + obj.position_ids = []; + } + obj.sender = message.sender; + obj.new_owner = message.newOwner; + return obj; + }, + fromAminoMsg(object: MsgTransferPositionsAminoMsg): MsgTransferPositions { + return MsgTransferPositions.fromAmino(object.value); + }, + toAminoMsg(message: MsgTransferPositions): MsgTransferPositionsAminoMsg { + return { + type: "osmosis/cl-transfer-positions", + value: MsgTransferPositions.toAmino(message) + }; + }, + fromProtoMsg(message: MsgTransferPositionsProtoMsg): MsgTransferPositions { + return MsgTransferPositions.decode(message.value); + }, + toProto(message: MsgTransferPositions): Uint8Array { + return MsgTransferPositions.encode(message).finish(); + }, + toProtoMsg(message: MsgTransferPositions): MsgTransferPositionsProtoMsg { + return { + typeUrl: "/osmosis.concentratedliquidity.v1beta1.MsgTransferPositions", + value: MsgTransferPositions.encode(message).finish() + }; + } +}; +function createBaseMsgTransferPositionsResponse(): MsgTransferPositionsResponse { + return {}; +} +export const MsgTransferPositionsResponse = { + typeUrl: "/osmosis.concentratedliquidity.v1beta1.MsgTransferPositionsResponse", + encode(_: MsgTransferPositionsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgTransferPositionsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgTransferPositionsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): MsgTransferPositionsResponse { + const message = createBaseMsgTransferPositionsResponse(); + return message; + }, + fromAmino(_: MsgTransferPositionsResponseAmino): MsgTransferPositionsResponse { + const message = createBaseMsgTransferPositionsResponse(); + return message; + }, + toAmino(_: MsgTransferPositionsResponse): MsgTransferPositionsResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgTransferPositionsResponseAminoMsg): MsgTransferPositionsResponse { + return MsgTransferPositionsResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgTransferPositionsResponse): MsgTransferPositionsResponseAminoMsg { + return { + type: "osmosis/concentratedliquidity/transfer-positions-response", + value: MsgTransferPositionsResponse.toAmino(message) + }; + }, + fromProtoMsg(message: MsgTransferPositionsResponseProtoMsg): MsgTransferPositionsResponse { + return MsgTransferPositionsResponse.decode(message.value); + }, + toProto(message: MsgTransferPositionsResponse): Uint8Array { + return MsgTransferPositionsResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgTransferPositionsResponse): MsgTransferPositionsResponseProtoMsg { + return { + typeUrl: "/osmosis.concentratedliquidity.v1beta1.MsgTransferPositionsResponse", + value: MsgTransferPositionsResponse.encode(message).finish() + }; + } }; \ No newline at end of file diff --git a/packages/osmo-query/src/codegen/osmosis/cosmwasmpool/v1beta1/genesis.ts b/packages/osmo-query/src/codegen/osmosis/cosmwasmpool/v1beta1/genesis.ts index d19703641..a935acd86 100644 --- a/packages/osmo-query/src/codegen/osmosis/cosmwasmpool/v1beta1/genesis.ts +++ b/packages/osmo-query/src/codegen/osmosis/cosmwasmpool/v1beta1/genesis.ts @@ -1,15 +1,15 @@ import { Params, ParamsAmino, ParamsSDKType } from "./params"; import { Any, AnyProtoMsg, AnyAmino, AnySDKType } from "../../../google/protobuf/any"; -import { Pool as Pool1 } from "../../concentrated-liquidity/pool"; -import { PoolProtoMsg as Pool1ProtoMsg } from "../../concentrated-liquidity/pool"; -import { PoolSDKType as Pool1SDKType } from "../../concentrated-liquidity/pool"; +import { Pool as Pool1 } from "../../concentratedliquidity/v1beta1/pool"; +import { PoolProtoMsg as Pool1ProtoMsg } from "../../concentratedliquidity/v1beta1/pool"; +import { PoolSDKType as Pool1SDKType } from "../../concentratedliquidity/v1beta1/pool"; import { CosmWasmPool, CosmWasmPoolProtoMsg, CosmWasmPoolSDKType } from "./model/pool"; -import { Pool as Pool2 } from "../../gamm/pool-models/balancer/balancerPool"; -import { PoolProtoMsg as Pool2ProtoMsg } from "../../gamm/pool-models/balancer/balancerPool"; -import { PoolSDKType as Pool2SDKType } from "../../gamm/pool-models/balancer/balancerPool"; -import { Pool as Pool3 } from "../../gamm/pool-models/stableswap/stableswap_pool"; -import { PoolProtoMsg as Pool3ProtoMsg } from "../../gamm/pool-models/stableswap/stableswap_pool"; -import { PoolSDKType as Pool3SDKType } from "../../gamm/pool-models/stableswap/stableswap_pool"; +import { Pool as Pool2 } from "../../gamm/poolmodels/stableswap/v1beta1/stableswap_pool"; +import { PoolProtoMsg as Pool2ProtoMsg } from "../../gamm/poolmodels/stableswap/v1beta1/stableswap_pool"; +import { PoolSDKType as Pool2SDKType } from "../../gamm/poolmodels/stableswap/v1beta1/stableswap_pool"; +import { Pool as Pool3 } from "../../gamm/v1beta1/balancerPool"; +import { PoolProtoMsg as Pool3ProtoMsg } from "../../gamm/v1beta1/balancerPool"; +import { PoolSDKType as Pool3SDKType } from "../../gamm/v1beta1/balancerPool"; import { BinaryReader, BinaryWriter } from "../../../binary"; /** GenesisState defines the cosmwasmpool module's genesis state. */ export interface GenesisState { @@ -28,7 +28,7 @@ export type GenesisStateEncoded = Omit & { export interface GenesisStateAmino { /** params is the container of cosmwasmpool parameters. */ params?: ParamsAmino; - pools: AnyAmino[]; + pools?: AnyAmino[]; } export interface GenesisStateAminoMsg { type: "osmosis/cosmwasmpool/genesis-state"; @@ -67,7 +67,7 @@ export const GenesisState = { message.params = Params.decode(reader, reader.uint32()); break; case 2: - message.pools.push((PoolI_InterfaceDecoder(reader) as Any)); + message.pools.push((Any(reader) as Any)); break; default: reader.skipType(tag & 7); @@ -83,10 +83,12 @@ export const GenesisState = { return message; }, fromAmino(object: GenesisStateAmino): GenesisState { - return { - params: object?.params ? Params.fromAmino(object.params) : undefined, - pools: Array.isArray(object?.pools) ? object.pools.map((e: any) => PoolI_FromAmino(e)) : [] - }; + const message = createBaseGenesisState(); + if (object.params !== undefined && object.params !== null) { + message.params = Params.fromAmino(object.params); + } + message.pools = object.pools?.map(e => PoolI_FromAmino(e)) || []; + return message; }, toAmino(message: GenesisState): GenesisStateAmino { const obj: any = {}; @@ -122,16 +124,16 @@ export const GenesisState = { }; export const PoolI_InterfaceDecoder = (input: BinaryReader | Uint8Array): Pool1 | CosmWasmPool | Pool2 | Pool3 | Any => { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - const data = Any.decode(reader, reader.uint32()); + const data = Any.decode(reader, reader.uint32(), true); switch (data.typeUrl) { case "/osmosis.concentratedliquidity.v1beta1.Pool": - return Pool1.decode(data.value); + return Pool1.decode(data.value, undefined, true); case "/osmosis.cosmwasmpool.v1beta1.CosmWasmPool": - return CosmWasmPool.decode(data.value); - case "/osmosis.gamm.v1beta1.Pool": - return Pool2.decode(data.value); + return CosmWasmPool.decode(data.value, undefined, true); case "/osmosis.gamm.poolmodels.stableswap.v1beta1.Pool": - return Pool3.decode(data.value); + return Pool2.decode(data.value, undefined, true); + case "/osmosis.gamm.v1beta1.Pool": + return Pool3.decode(data.value, undefined, true); default: return data; } @@ -148,14 +150,14 @@ export const PoolI_FromAmino = (content: AnyAmino) => { typeUrl: "/osmosis.cosmwasmpool.v1beta1.CosmWasmPool", value: CosmWasmPool.encode(CosmWasmPool.fromPartial(CosmWasmPool.fromAmino(content.value))).finish() }); - case "osmosis/gamm/BalancerPool": + case "osmosis/gamm/StableswapPool": return Any.fromPartial({ - typeUrl: "/osmosis.gamm.v1beta1.Pool", + typeUrl: "/osmosis.gamm.poolmodels.stableswap.v1beta1.Pool", value: Pool2.encode(Pool2.fromPartial(Pool2.fromAmino(content.value))).finish() }); - case "osmosis/gamm/StableswapPool": + case "osmosis/gamm/BalancerPool": return Any.fromPartial({ - typeUrl: "/osmosis.gamm.poolmodels.stableswap.v1beta1.Pool", + typeUrl: "/osmosis.gamm.v1beta1.Pool", value: Pool3.encode(Pool3.fromPartial(Pool3.fromAmino(content.value))).finish() }); default: @@ -167,22 +169,22 @@ export const PoolI_ToAmino = (content: Any) => { case "/osmosis.concentratedliquidity.v1beta1.Pool": return { type: "osmosis/concentratedliquidity/pool", - value: Pool1.toAmino(Pool1.decode(content.value)) + value: Pool1.toAmino(Pool1.decode(content.value, undefined)) }; case "/osmosis.cosmwasmpool.v1beta1.CosmWasmPool": return { type: "osmosis/cosmwasmpool/cosm-wasm-pool", - value: CosmWasmPool.toAmino(CosmWasmPool.decode(content.value)) - }; - case "/osmosis.gamm.v1beta1.Pool": - return { - type: "osmosis/gamm/BalancerPool", - value: Pool2.toAmino(Pool2.decode(content.value)) + value: CosmWasmPool.toAmino(CosmWasmPool.decode(content.value, undefined)) }; case "/osmosis.gamm.poolmodels.stableswap.v1beta1.Pool": return { type: "osmosis/gamm/StableswapPool", - value: Pool3.toAmino(Pool3.decode(content.value)) + value: Pool2.toAmino(Pool2.decode(content.value, undefined)) + }; + case "/osmosis.gamm.v1beta1.Pool": + return { + type: "osmosis/gamm/BalancerPool", + value: Pool3.toAmino(Pool3.decode(content.value, undefined)) }; default: return Any.toAmino(content); diff --git a/packages/osmo-query/src/codegen/osmosis/cosmwasmpool/v1beta1/gov.ts b/packages/osmo-query/src/codegen/osmosis/cosmwasmpool/v1beta1/gov.ts index ec833f7f9..c733fa038 100644 --- a/packages/osmo-query/src/codegen/osmosis/cosmwasmpool/v1beta1/gov.ts +++ b/packages/osmo-query/src/codegen/osmosis/cosmwasmpool/v1beta1/gov.ts @@ -1,5 +1,6 @@ import { BinaryReader, BinaryWriter } from "../../../binary"; import { fromBase64, toBase64 } from "@cosmjs/encoding"; +import { bytesFromBase64, base64FromBytes } from "../../../helpers"; /** * UploadCosmWasmPoolCodeAndWhiteListProposal is a gov Content type for * uploading coswasm pool code and adding it to internal whitelist. Only the @@ -21,10 +22,10 @@ export interface UploadCosmWasmPoolCodeAndWhiteListProposalProtoMsg { * code ids created by this message are eligible for being x/cosmwasmpool pools. */ export interface UploadCosmWasmPoolCodeAndWhiteListProposalAmino { - title: string; - description: string; + title?: string; + description?: string; /** WASMByteCode can be raw or gzip compressed */ - wasm_byte_code: string; + wasm_byte_code?: string; } export interface UploadCosmWasmPoolCodeAndWhiteListProposalAminoMsg { type: "osmosis/cosmwasmpool/upload-cosm-wasm-pool-code-and-white-list-proposal"; @@ -125,28 +126,28 @@ export interface MigratePoolContractsProposalProtoMsg { * be configured by a module parameter so it can be changed by a constant. */ export interface MigratePoolContractsProposalAmino { - title: string; - description: string; + title?: string; + description?: string; /** * pool_ids are the pool ids of the contracts to be migrated * either to the new_code_id that is already uploaded to chain or to * the given wasm_byte_code. */ - pool_ids: string[]; + pool_ids?: string[]; /** * new_code_id is the code id of the contract code to migrate to. * Assumes that the code is already uploaded to chain. Only one of * new_code_id and wasm_byte_code should be set. */ - new_code_id: string; + new_code_id?: string; /** * WASMByteCode can be raw or gzip compressed. Assumes that the code id * has not been uploaded yet so uploads the given code and migrates to it. * Only one of new_code_id and wasm_byte_code should be set. */ - wasm_byte_code: string; + wasm_byte_code?: string; /** MigrateMsg migrate message to be used for migrating the pool contracts. */ - migrate_msg: Uint8Array; + migrate_msg?: string; } export interface MigratePoolContractsProposalAminoMsg { type: "osmosis/cosmwasmpool/migrate-pool-contracts-proposal"; @@ -240,11 +241,17 @@ export const UploadCosmWasmPoolCodeAndWhiteListProposal = { return message; }, fromAmino(object: UploadCosmWasmPoolCodeAndWhiteListProposalAmino): UploadCosmWasmPoolCodeAndWhiteListProposal { - return { - title: object.title, - description: object.description, - wasmByteCode: fromBase64(object.wasm_byte_code) - }; + const message = createBaseUploadCosmWasmPoolCodeAndWhiteListProposal(); + if (object.title !== undefined && object.title !== null) { + message.title = object.title; + } + if (object.description !== undefined && object.description !== null) { + message.description = object.description; + } + if (object.wasm_byte_code !== undefined && object.wasm_byte_code !== null) { + message.wasmByteCode = fromBase64(object.wasm_byte_code); + } + return message; }, toAmino(message: UploadCosmWasmPoolCodeAndWhiteListProposal): UploadCosmWasmPoolCodeAndWhiteListProposalAmino { const obj: any = {}; @@ -360,14 +367,24 @@ export const MigratePoolContractsProposal = { return message; }, fromAmino(object: MigratePoolContractsProposalAmino): MigratePoolContractsProposal { - return { - title: object.title, - description: object.description, - poolIds: Array.isArray(object?.pool_ids) ? object.pool_ids.map((e: any) => BigInt(e)) : [], - newCodeId: BigInt(object.new_code_id), - wasmByteCode: fromBase64(object.wasm_byte_code), - migrateMsg: object.migrate_msg - }; + const message = createBaseMigratePoolContractsProposal(); + if (object.title !== undefined && object.title !== null) { + message.title = object.title; + } + if (object.description !== undefined && object.description !== null) { + message.description = object.description; + } + message.poolIds = object.pool_ids?.map(e => BigInt(e)) || []; + if (object.new_code_id !== undefined && object.new_code_id !== null) { + message.newCodeId = BigInt(object.new_code_id); + } + if (object.wasm_byte_code !== undefined && object.wasm_byte_code !== null) { + message.wasmByteCode = fromBase64(object.wasm_byte_code); + } + if (object.migrate_msg !== undefined && object.migrate_msg !== null) { + message.migrateMsg = bytesFromBase64(object.migrate_msg); + } + return message; }, toAmino(message: MigratePoolContractsProposal): MigratePoolContractsProposalAmino { const obj: any = {}; @@ -380,7 +397,7 @@ export const MigratePoolContractsProposal = { } obj.new_code_id = message.newCodeId ? message.newCodeId.toString() : undefined; obj.wasm_byte_code = message.wasmByteCode ? toBase64(message.wasmByteCode) : undefined; - obj.migrate_msg = message.migrateMsg; + obj.migrate_msg = message.migrateMsg ? base64FromBytes(message.migrateMsg) : undefined; return obj; }, fromAminoMsg(object: MigratePoolContractsProposalAminoMsg): MigratePoolContractsProposal { diff --git a/packages/osmo-query/src/codegen/osmosis/cosmwasmpool/v1beta1/model/instantiate_msg.ts b/packages/osmo-query/src/codegen/osmosis/cosmwasmpool/v1beta1/model/instantiate_msg.ts index 800b249c4..4d3e2396c 100644 --- a/packages/osmo-query/src/codegen/osmosis/cosmwasmpool/v1beta1/model/instantiate_msg.ts +++ b/packages/osmo-query/src/codegen/osmosis/cosmwasmpool/v1beta1/model/instantiate_msg.ts @@ -17,7 +17,7 @@ export interface InstantiateMsgAmino { * pool_asset_denoms is the list of asset denoms that are initialized * at pool creation time. */ - pool_asset_denoms: string[]; + pool_asset_denoms?: string[]; } export interface InstantiateMsgAminoMsg { type: "osmosis/cosmwasmpool/instantiate-msg"; @@ -63,9 +63,9 @@ export const InstantiateMsg = { return message; }, fromAmino(object: InstantiateMsgAmino): InstantiateMsg { - return { - poolAssetDenoms: Array.isArray(object?.pool_asset_denoms) ? object.pool_asset_denoms.map((e: any) => e) : [] - }; + const message = createBaseInstantiateMsg(); + message.poolAssetDenoms = object.pool_asset_denoms?.map(e => e) || []; + return message; }, toAmino(message: InstantiateMsg): InstantiateMsgAmino { const obj: any = {}; diff --git a/packages/osmo-query/src/codegen/osmosis/cosmwasmpool/v1beta1/model/module_query_msg.ts b/packages/osmo-query/src/codegen/osmosis/cosmwasmpool/v1beta1/model/module_query_msg.ts index eb7805d59..377bed3dd 100644 --- a/packages/osmo-query/src/codegen/osmosis/cosmwasmpool/v1beta1/model/module_query_msg.ts +++ b/packages/osmo-query/src/codegen/osmosis/cosmwasmpool/v1beta1/model/module_query_msg.ts @@ -19,9 +19,9 @@ export interface CalcOutAmtGivenInAmino { /** token_in is the token to be sent to the pool. */ token_in?: CoinAmino; /** token_out_denom is the token denom to be received from the pool. */ - token_out_denom: string; + token_out_denom?: string; /** swap_fee is the swap fee for this swap estimate. */ - swap_fee: string; + swap_fee?: string; } export interface CalcOutAmtGivenInAminoMsg { type: "osmosis/cosmwasmpool/calc-out-amt-given-in"; @@ -95,9 +95,9 @@ export interface CalcInAmtGivenOutAmino { /** token_out is the token out to be receoved from the pool. */ token_out?: CoinAmino; /** token_in_denom is the token denom to be sentt to the pool. */ - token_in_denom: string; + token_in_denom?: string; /** swap_fee is the swap fee for this swap estimate. */ - swap_fee: string; + swap_fee?: string; } export interface CalcInAmtGivenOutAminoMsg { type: "osmosis/cosmwasmpool/calc-in-amt-given-out"; @@ -205,11 +205,17 @@ export const CalcOutAmtGivenIn = { return message; }, fromAmino(object: CalcOutAmtGivenInAmino): CalcOutAmtGivenIn { - return { - tokenIn: object?.token_in ? Coin.fromAmino(object.token_in) : undefined, - tokenOutDenom: object.token_out_denom, - swapFee: object.swap_fee - }; + const message = createBaseCalcOutAmtGivenIn(); + if (object.token_in !== undefined && object.token_in !== null) { + message.tokenIn = Coin.fromAmino(object.token_in); + } + if (object.token_out_denom !== undefined && object.token_out_denom !== null) { + message.tokenOutDenom = object.token_out_denom; + } + if (object.swap_fee !== undefined && object.swap_fee !== null) { + message.swapFee = object.swap_fee; + } + return message; }, toAmino(message: CalcOutAmtGivenIn): CalcOutAmtGivenInAmino { const obj: any = {}; @@ -276,9 +282,11 @@ export const CalcOutAmtGivenInRequest = { return message; }, fromAmino(object: CalcOutAmtGivenInRequestAmino): CalcOutAmtGivenInRequest { - return { - calcOutAmtGivenIn: object?.calc_out_amt_given_in ? CalcOutAmtGivenIn.fromAmino(object.calc_out_amt_given_in) : undefined - }; + const message = createBaseCalcOutAmtGivenInRequest(); + if (object.calc_out_amt_given_in !== undefined && object.calc_out_amt_given_in !== null) { + message.calcOutAmtGivenIn = CalcOutAmtGivenIn.fromAmino(object.calc_out_amt_given_in); + } + return message; }, toAmino(message: CalcOutAmtGivenInRequest): CalcOutAmtGivenInRequestAmino { const obj: any = {}; @@ -343,9 +351,11 @@ export const CalcOutAmtGivenInResponse = { return message; }, fromAmino(object: CalcOutAmtGivenInResponseAmino): CalcOutAmtGivenInResponse { - return { - tokenOut: object?.token_out ? Coin.fromAmino(object.token_out) : undefined - }; + const message = createBaseCalcOutAmtGivenInResponse(); + if (object.token_out !== undefined && object.token_out !== null) { + message.tokenOut = Coin.fromAmino(object.token_out); + } + return message; }, toAmino(message: CalcOutAmtGivenInResponse): CalcOutAmtGivenInResponseAmino { const obj: any = {}; @@ -426,11 +436,17 @@ export const CalcInAmtGivenOut = { return message; }, fromAmino(object: CalcInAmtGivenOutAmino): CalcInAmtGivenOut { - return { - tokenOut: object?.token_out ? Coin.fromAmino(object.token_out) : undefined, - tokenInDenom: object.token_in_denom, - swapFee: object.swap_fee - }; + const message = createBaseCalcInAmtGivenOut(); + if (object.token_out !== undefined && object.token_out !== null) { + message.tokenOut = Coin.fromAmino(object.token_out); + } + if (object.token_in_denom !== undefined && object.token_in_denom !== null) { + message.tokenInDenom = object.token_in_denom; + } + if (object.swap_fee !== undefined && object.swap_fee !== null) { + message.swapFee = object.swap_fee; + } + return message; }, toAmino(message: CalcInAmtGivenOut): CalcInAmtGivenOutAmino { const obj: any = {}; @@ -497,9 +513,11 @@ export const CalcInAmtGivenOutRequest = { return message; }, fromAmino(object: CalcInAmtGivenOutRequestAmino): CalcInAmtGivenOutRequest { - return { - calcInAmtGivenOut: object?.calc_in_amt_given_out ? CalcInAmtGivenOut.fromAmino(object.calc_in_amt_given_out) : undefined - }; + const message = createBaseCalcInAmtGivenOutRequest(); + if (object.calc_in_amt_given_out !== undefined && object.calc_in_amt_given_out !== null) { + message.calcInAmtGivenOut = CalcInAmtGivenOut.fromAmino(object.calc_in_amt_given_out); + } + return message; }, toAmino(message: CalcInAmtGivenOutRequest): CalcInAmtGivenOutRequestAmino { const obj: any = {}; @@ -564,9 +582,11 @@ export const CalcInAmtGivenOutResponse = { return message; }, fromAmino(object: CalcInAmtGivenOutResponseAmino): CalcInAmtGivenOutResponse { - return { - tokenIn: object?.token_in ? Coin.fromAmino(object.token_in) : undefined - }; + const message = createBaseCalcInAmtGivenOutResponse(); + if (object.token_in !== undefined && object.token_in !== null) { + message.tokenIn = Coin.fromAmino(object.token_in); + } + return message; }, toAmino(message: CalcInAmtGivenOutResponse): CalcInAmtGivenOutResponseAmino { const obj: any = {}; diff --git a/packages/osmo-query/src/codegen/osmosis/cosmwasmpool/v1beta1/model/module_sudo_msg.ts b/packages/osmo-query/src/codegen/osmosis/cosmwasmpool/v1beta1/model/module_sudo_msg.ts index 856edb0ad..00a19ffd1 100644 --- a/packages/osmo-query/src/codegen/osmosis/cosmwasmpool/v1beta1/model/module_sudo_msg.ts +++ b/packages/osmo-query/src/codegen/osmosis/cosmwasmpool/v1beta1/model/module_sudo_msg.ts @@ -22,18 +22,18 @@ export interface SwapExactAmountInProtoMsg { } /** ===================== SwapExactAmountIn */ export interface SwapExactAmountInAmino { - sender: string; + sender?: string; /** token_in is the token to be sent to the pool. */ token_in?: CoinAmino; /** token_out_denom is the token denom to be received from the pool. */ - token_out_denom: string; + token_out_denom?: string; /** * token_out_min_amount is the minimum amount of token_out to be received from * the pool. */ - token_out_min_amount: string; + token_out_min_amount?: string; /** swap_fee is the swap fee for this swap estimate. */ - swap_fee: string; + swap_fee?: string; } export interface SwapExactAmountInAminoMsg { type: "osmosis/cosmwasmpool/swap-exact-amount-in"; @@ -82,7 +82,7 @@ export interface SwapExactAmountInSudoMsgResponseProtoMsg { } export interface SwapExactAmountInSudoMsgResponseAmino { /** token_out_amount is the token out computed from this swap estimate call. */ - token_out_amount: string; + token_out_amount?: string; } export interface SwapExactAmountInSudoMsgResponseAminoMsg { type: "osmosis/cosmwasmpool/swap-exact-amount-in-sudo-msg-response"; @@ -112,18 +112,18 @@ export interface SwapExactAmountOutProtoMsg { } /** ===================== SwapExactAmountOut */ export interface SwapExactAmountOutAmino { - sender: string; + sender?: string; /** token_out is the token to be sent out of the pool. */ token_out?: CoinAmino; /** token_in_denom is the token denom to be sent too the pool. */ - token_in_denom: string; + token_in_denom?: string; /** * token_in_max_amount is the maximum amount of token_in to be sent to the * pool. */ - token_in_max_amount: string; + token_in_max_amount?: string; /** swap_fee is the swap fee for this swap estimate. */ - swap_fee: string; + swap_fee?: string; } export interface SwapExactAmountOutAminoMsg { type: "osmosis/cosmwasmpool/swap-exact-amount-out"; @@ -172,7 +172,7 @@ export interface SwapExactAmountOutSudoMsgResponseProtoMsg { } export interface SwapExactAmountOutSudoMsgResponseAmino { /** token_in_amount is the token in computed from this swap estimate call. */ - token_in_amount: string; + token_in_amount?: string; } export interface SwapExactAmountOutSudoMsgResponseAminoMsg { type: "osmosis/cosmwasmpool/swap-exact-amount-out-sudo-msg-response"; @@ -249,13 +249,23 @@ export const SwapExactAmountIn = { return message; }, fromAmino(object: SwapExactAmountInAmino): SwapExactAmountIn { - return { - sender: object.sender, - tokenIn: object?.token_in ? Coin.fromAmino(object.token_in) : undefined, - tokenOutDenom: object.token_out_denom, - tokenOutMinAmount: object.token_out_min_amount, - swapFee: object.swap_fee - }; + const message = createBaseSwapExactAmountIn(); + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + if (object.token_in !== undefined && object.token_in !== null) { + message.tokenIn = Coin.fromAmino(object.token_in); + } + if (object.token_out_denom !== undefined && object.token_out_denom !== null) { + message.tokenOutDenom = object.token_out_denom; + } + if (object.token_out_min_amount !== undefined && object.token_out_min_amount !== null) { + message.tokenOutMinAmount = object.token_out_min_amount; + } + if (object.swap_fee !== undefined && object.swap_fee !== null) { + message.swapFee = object.swap_fee; + } + return message; }, toAmino(message: SwapExactAmountIn): SwapExactAmountInAmino { const obj: any = {}; @@ -324,9 +334,11 @@ export const SwapExactAmountInSudoMsg = { return message; }, fromAmino(object: SwapExactAmountInSudoMsgAmino): SwapExactAmountInSudoMsg { - return { - swapExactAmountIn: object?.swap_exact_amount_in ? SwapExactAmountIn.fromAmino(object.swap_exact_amount_in) : undefined - }; + const message = createBaseSwapExactAmountInSudoMsg(); + if (object.swap_exact_amount_in !== undefined && object.swap_exact_amount_in !== null) { + message.swapExactAmountIn = SwapExactAmountIn.fromAmino(object.swap_exact_amount_in); + } + return message; }, toAmino(message: SwapExactAmountInSudoMsg): SwapExactAmountInSudoMsgAmino { const obj: any = {}; @@ -391,9 +403,11 @@ export const SwapExactAmountInSudoMsgResponse = { return message; }, fromAmino(object: SwapExactAmountInSudoMsgResponseAmino): SwapExactAmountInSudoMsgResponse { - return { - tokenOutAmount: object.token_out_amount - }; + const message = createBaseSwapExactAmountInSudoMsgResponse(); + if (object.token_out_amount !== undefined && object.token_out_amount !== null) { + message.tokenOutAmount = object.token_out_amount; + } + return message; }, toAmino(message: SwapExactAmountInSudoMsgResponse): SwapExactAmountInSudoMsgResponseAmino { const obj: any = {}; @@ -490,13 +504,23 @@ export const SwapExactAmountOut = { return message; }, fromAmino(object: SwapExactAmountOutAmino): SwapExactAmountOut { - return { - sender: object.sender, - tokenOut: object?.token_out ? Coin.fromAmino(object.token_out) : undefined, - tokenInDenom: object.token_in_denom, - tokenInMaxAmount: object.token_in_max_amount, - swapFee: object.swap_fee - }; + const message = createBaseSwapExactAmountOut(); + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + if (object.token_out !== undefined && object.token_out !== null) { + message.tokenOut = Coin.fromAmino(object.token_out); + } + if (object.token_in_denom !== undefined && object.token_in_denom !== null) { + message.tokenInDenom = object.token_in_denom; + } + if (object.token_in_max_amount !== undefined && object.token_in_max_amount !== null) { + message.tokenInMaxAmount = object.token_in_max_amount; + } + if (object.swap_fee !== undefined && object.swap_fee !== null) { + message.swapFee = object.swap_fee; + } + return message; }, toAmino(message: SwapExactAmountOut): SwapExactAmountOutAmino { const obj: any = {}; @@ -565,9 +589,11 @@ export const SwapExactAmountOutSudoMsg = { return message; }, fromAmino(object: SwapExactAmountOutSudoMsgAmino): SwapExactAmountOutSudoMsg { - return { - swapExactAmountOut: object?.swap_exact_amount_out ? SwapExactAmountOut.fromAmino(object.swap_exact_amount_out) : undefined - }; + const message = createBaseSwapExactAmountOutSudoMsg(); + if (object.swap_exact_amount_out !== undefined && object.swap_exact_amount_out !== null) { + message.swapExactAmountOut = SwapExactAmountOut.fromAmino(object.swap_exact_amount_out); + } + return message; }, toAmino(message: SwapExactAmountOutSudoMsg): SwapExactAmountOutSudoMsgAmino { const obj: any = {}; @@ -632,9 +658,11 @@ export const SwapExactAmountOutSudoMsgResponse = { return message; }, fromAmino(object: SwapExactAmountOutSudoMsgResponseAmino): SwapExactAmountOutSudoMsgResponse { - return { - tokenInAmount: object.token_in_amount - }; + const message = createBaseSwapExactAmountOutSudoMsgResponse(); + if (object.token_in_amount !== undefined && object.token_in_amount !== null) { + message.tokenInAmount = object.token_in_amount; + } + return message; }, toAmino(message: SwapExactAmountOutSudoMsgResponse): SwapExactAmountOutSudoMsgResponseAmino { const obj: any = {}; diff --git a/packages/osmo-query/src/codegen/osmosis/cosmwasmpool/v1beta1/model/pool.ts b/packages/osmo-query/src/codegen/osmosis/cosmwasmpool/v1beta1/model/pool.ts index 4e044f4b1..57c654fb8 100644 --- a/packages/osmo-query/src/codegen/osmosis/cosmwasmpool/v1beta1/model/pool.ts +++ b/packages/osmo-query/src/codegen/osmosis/cosmwasmpool/v1beta1/model/pool.ts @@ -1,6 +1,25 @@ import { BinaryReader, BinaryWriter } from "../../../../binary"; +import { bytesFromBase64, base64FromBytes } from "../../../../helpers"; +/** + * CosmWasmPool represents the data serialized into state for each CW pool. + * + * Note: CW Pool has 2 pool models: + * - CosmWasmPool which is a proto-generated store model used for serialization + * into state. + * - Pool struct that encapsulates the CosmWasmPool and wasmKeeper for calling + * the contract. + * + * CosmWasmPool implements the poolmanager.PoolI interface but it panics on all + * methods. The reason is that access to wasmKeeper is required to call the + * contract. + * + * Instead, all interactions and poolmanager.PoolI methods are to be performed + * on the Pool struct. The reason why we cannot have a Pool struct only is + * because it cannot be serialized into state due to having a non-serializable + * wasmKeeper field. + */ export interface CosmWasmPool { - $typeUrl?: string; + $typeUrl?: "/osmosis.cosmwasmpool.v1beta1.CosmWasmPool"; contractAddress: string; poolId: bigint; codeId: bigint; @@ -10,18 +29,54 @@ export interface CosmWasmPoolProtoMsg { typeUrl: "/osmosis.cosmwasmpool.v1beta1.CosmWasmPool"; value: Uint8Array; } +/** + * CosmWasmPool represents the data serialized into state for each CW pool. + * + * Note: CW Pool has 2 pool models: + * - CosmWasmPool which is a proto-generated store model used for serialization + * into state. + * - Pool struct that encapsulates the CosmWasmPool and wasmKeeper for calling + * the contract. + * + * CosmWasmPool implements the poolmanager.PoolI interface but it panics on all + * methods. The reason is that access to wasmKeeper is required to call the + * contract. + * + * Instead, all interactions and poolmanager.PoolI methods are to be performed + * on the Pool struct. The reason why we cannot have a Pool struct only is + * because it cannot be serialized into state due to having a non-serializable + * wasmKeeper field. + */ export interface CosmWasmPoolAmino { - contract_address: string; - pool_id: string; - code_id: string; - instantiate_msg: Uint8Array; + contract_address?: string; + pool_id?: string; + code_id?: string; + instantiate_msg?: string; } export interface CosmWasmPoolAminoMsg { type: "osmosis/cosmwasmpool/cosm-wasm-pool"; value: CosmWasmPoolAmino; } +/** + * CosmWasmPool represents the data serialized into state for each CW pool. + * + * Note: CW Pool has 2 pool models: + * - CosmWasmPool which is a proto-generated store model used for serialization + * into state. + * - Pool struct that encapsulates the CosmWasmPool and wasmKeeper for calling + * the contract. + * + * CosmWasmPool implements the poolmanager.PoolI interface but it panics on all + * methods. The reason is that access to wasmKeeper is required to call the + * contract. + * + * Instead, all interactions and poolmanager.PoolI methods are to be performed + * on the Pool struct. The reason why we cannot have a Pool struct only is + * because it cannot be serialized into state due to having a non-serializable + * wasmKeeper field. + */ export interface CosmWasmPoolSDKType { - $typeUrl?: string; + $typeUrl?: "/osmosis.cosmwasmpool.v1beta1.CosmWasmPool"; contract_address: string; pool_id: bigint; code_id: bigint; @@ -88,19 +143,27 @@ export const CosmWasmPool = { return message; }, fromAmino(object: CosmWasmPoolAmino): CosmWasmPool { - return { - contractAddress: object.contract_address, - poolId: BigInt(object.pool_id), - codeId: BigInt(object.code_id), - instantiateMsg: object.instantiate_msg - }; + const message = createBaseCosmWasmPool(); + if (object.contract_address !== undefined && object.contract_address !== null) { + message.contractAddress = object.contract_address; + } + if (object.pool_id !== undefined && object.pool_id !== null) { + message.poolId = BigInt(object.pool_id); + } + if (object.code_id !== undefined && object.code_id !== null) { + message.codeId = BigInt(object.code_id); + } + if (object.instantiate_msg !== undefined && object.instantiate_msg !== null) { + message.instantiateMsg = bytesFromBase64(object.instantiate_msg); + } + return message; }, toAmino(message: CosmWasmPool): CosmWasmPoolAmino { const obj: any = {}; obj.contract_address = message.contractAddress; obj.pool_id = message.poolId ? message.poolId.toString() : undefined; obj.code_id = message.codeId ? message.codeId.toString() : undefined; - obj.instantiate_msg = message.instantiateMsg; + obj.instantiate_msg = message.instantiateMsg ? base64FromBytes(message.instantiateMsg) : undefined; return obj; }, fromAminoMsg(object: CosmWasmPoolAminoMsg): CosmWasmPool { diff --git a/packages/osmo-query/src/codegen/osmosis/cosmwasmpool/v1beta1/model/pool_query_msg.ts b/packages/osmo-query/src/codegen/osmosis/cosmwasmpool/v1beta1/model/pool_query_msg.ts index 4f6f9eb22..7e15063a9 100644 --- a/packages/osmo-query/src/codegen/osmosis/cosmwasmpool/v1beta1/model/pool_query_msg.ts +++ b/packages/osmo-query/src/codegen/osmosis/cosmwasmpool/v1beta1/model/pool_query_msg.ts @@ -3,7 +3,7 @@ import { BinaryReader, BinaryWriter } from "../../../../binary"; import { Decimal } from "@cosmjs/math"; /** ===================== GetSwapFeeQueryMsg */ export interface GetSwapFeeQueryMsg { - /** get_swap_fee is the query strcuture to get swap fee. */ + /** get_swap_fee is the query structure to get swap fee. */ getSwapFee: EmptyStruct; } export interface GetSwapFeeQueryMsgProtoMsg { @@ -12,7 +12,7 @@ export interface GetSwapFeeQueryMsgProtoMsg { } /** ===================== GetSwapFeeQueryMsg */ export interface GetSwapFeeQueryMsgAmino { - /** get_swap_fee is the query strcuture to get swap fee. */ + /** get_swap_fee is the query structure to get swap fee. */ get_swap_fee?: EmptyStructAmino; } export interface GetSwapFeeQueryMsgAminoMsg { @@ -33,7 +33,7 @@ export interface GetSwapFeeQueryMsgResponseProtoMsg { } export interface GetSwapFeeQueryMsgResponseAmino { /** swap_fee is the swap fee for this swap estimate. */ - swap_fee: string; + swap_fee?: string; } export interface GetSwapFeeQueryMsgResponseAminoMsg { type: "osmosis/cosmwasmpool/get-swap-fee-query-msg-response"; @@ -56,9 +56,9 @@ export interface SpotPriceProtoMsg { /** ===================== SpotPriceQueryMsg */ export interface SpotPriceAmino { /** quote_asset_denom is the quote asset of the spot query. */ - quote_asset_denom: string; + quote_asset_denom?: string; /** base_asset_denom is the base asset of the spot query. */ - base_asset_denom: string; + base_asset_denom?: string; } export interface SpotPriceAminoMsg { type: "osmosis/cosmwasmpool/spot-price"; @@ -104,7 +104,7 @@ export interface SpotPriceQueryMsgResponseProtoMsg { } export interface SpotPriceQueryMsgResponseAmino { /** spot_price is the spot price returned. */ - spot_price: string; + spot_price?: string; } export interface SpotPriceQueryMsgResponseAminoMsg { type: "osmosis/cosmwasmpool/spot-price-query-msg-response"; @@ -168,7 +168,7 @@ export interface GetTotalPoolLiquidityQueryMsgResponseAmino { * total_pool_liquidity is the total liquidity in the pool denominated in * coins. */ - total_pool_liquidity: CoinAmino[]; + total_pool_liquidity?: CoinAmino[]; } export interface GetTotalPoolLiquidityQueryMsgResponseAminoMsg { type: "osmosis/cosmwasmpool/get-total-pool-liquidity-query-msg-response"; @@ -215,7 +215,7 @@ export interface GetTotalSharesQueryMsgResponseProtoMsg { } export interface GetTotalSharesQueryMsgResponseAmino { /** total_shares is the amount of shares returned. */ - total_shares: string; + total_shares?: string; } export interface GetTotalSharesQueryMsgResponseAminoMsg { type: "osmosis/cosmwasmpool/get-total-shares-query-msg-response"; @@ -260,9 +260,11 @@ export const GetSwapFeeQueryMsg = { return message; }, fromAmino(object: GetSwapFeeQueryMsgAmino): GetSwapFeeQueryMsg { - return { - getSwapFee: object?.get_swap_fee ? EmptyStruct.fromAmino(object.get_swap_fee) : undefined - }; + const message = createBaseGetSwapFeeQueryMsg(); + if (object.get_swap_fee !== undefined && object.get_swap_fee !== null) { + message.getSwapFee = EmptyStruct.fromAmino(object.get_swap_fee); + } + return message; }, toAmino(message: GetSwapFeeQueryMsg): GetSwapFeeQueryMsgAmino { const obj: any = {}; @@ -327,9 +329,11 @@ export const GetSwapFeeQueryMsgResponse = { return message; }, fromAmino(object: GetSwapFeeQueryMsgResponseAmino): GetSwapFeeQueryMsgResponse { - return { - swapFee: object.swap_fee - }; + const message = createBaseGetSwapFeeQueryMsgResponse(); + if (object.swap_fee !== undefined && object.swap_fee !== null) { + message.swapFee = object.swap_fee; + } + return message; }, toAmino(message: GetSwapFeeQueryMsgResponse): GetSwapFeeQueryMsgResponseAmino { const obj: any = {}; @@ -402,10 +406,14 @@ export const SpotPrice = { return message; }, fromAmino(object: SpotPriceAmino): SpotPrice { - return { - quoteAssetDenom: object.quote_asset_denom, - baseAssetDenom: object.base_asset_denom - }; + const message = createBaseSpotPrice(); + if (object.quote_asset_denom !== undefined && object.quote_asset_denom !== null) { + message.quoteAssetDenom = object.quote_asset_denom; + } + if (object.base_asset_denom !== undefined && object.base_asset_denom !== null) { + message.baseAssetDenom = object.base_asset_denom; + } + return message; }, toAmino(message: SpotPrice): SpotPriceAmino { const obj: any = {}; @@ -471,9 +479,11 @@ export const SpotPriceQueryMsg = { return message; }, fromAmino(object: SpotPriceQueryMsgAmino): SpotPriceQueryMsg { - return { - spotPrice: object?.spot_price ? SpotPrice.fromAmino(object.spot_price) : undefined - }; + const message = createBaseSpotPriceQueryMsg(); + if (object.spot_price !== undefined && object.spot_price !== null) { + message.spotPrice = SpotPrice.fromAmino(object.spot_price); + } + return message; }, toAmino(message: SpotPriceQueryMsg): SpotPriceQueryMsgAmino { const obj: any = {}; @@ -538,9 +548,11 @@ export const SpotPriceQueryMsgResponse = { return message; }, fromAmino(object: SpotPriceQueryMsgResponseAmino): SpotPriceQueryMsgResponse { - return { - spotPrice: object.spot_price - }; + const message = createBaseSpotPriceQueryMsgResponse(); + if (object.spot_price !== undefined && object.spot_price !== null) { + message.spotPrice = object.spot_price; + } + return message; }, toAmino(message: SpotPriceQueryMsgResponse): SpotPriceQueryMsgResponseAmino { const obj: any = {}; @@ -596,7 +608,8 @@ export const EmptyStruct = { return message; }, fromAmino(_: EmptyStructAmino): EmptyStruct { - return {}; + const message = createBaseEmptyStruct(); + return message; }, toAmino(_: EmptyStruct): EmptyStructAmino { const obj: any = {}; @@ -660,9 +673,11 @@ export const GetTotalPoolLiquidityQueryMsg = { return message; }, fromAmino(object: GetTotalPoolLiquidityQueryMsgAmino): GetTotalPoolLiquidityQueryMsg { - return { - getTotalPoolLiquidity: object?.get_total_pool_liquidity ? EmptyStruct.fromAmino(object.get_total_pool_liquidity) : undefined - }; + const message = createBaseGetTotalPoolLiquidityQueryMsg(); + if (object.get_total_pool_liquidity !== undefined && object.get_total_pool_liquidity !== null) { + message.getTotalPoolLiquidity = EmptyStruct.fromAmino(object.get_total_pool_liquidity); + } + return message; }, toAmino(message: GetTotalPoolLiquidityQueryMsg): GetTotalPoolLiquidityQueryMsgAmino { const obj: any = {}; @@ -727,9 +742,9 @@ export const GetTotalPoolLiquidityQueryMsgResponse = { return message; }, fromAmino(object: GetTotalPoolLiquidityQueryMsgResponseAmino): GetTotalPoolLiquidityQueryMsgResponse { - return { - totalPoolLiquidity: Array.isArray(object?.total_pool_liquidity) ? object.total_pool_liquidity.map((e: any) => Coin.fromAmino(e)) : [] - }; + const message = createBaseGetTotalPoolLiquidityQueryMsgResponse(); + message.totalPoolLiquidity = object.total_pool_liquidity?.map(e => Coin.fromAmino(e)) || []; + return message; }, toAmino(message: GetTotalPoolLiquidityQueryMsgResponse): GetTotalPoolLiquidityQueryMsgResponseAmino { const obj: any = {}; @@ -798,9 +813,11 @@ export const GetTotalSharesQueryMsg = { return message; }, fromAmino(object: GetTotalSharesQueryMsgAmino): GetTotalSharesQueryMsg { - return { - getTotalShares: object?.get_total_shares ? EmptyStruct.fromAmino(object.get_total_shares) : undefined - }; + const message = createBaseGetTotalSharesQueryMsg(); + if (object.get_total_shares !== undefined && object.get_total_shares !== null) { + message.getTotalShares = EmptyStruct.fromAmino(object.get_total_shares); + } + return message; }, toAmino(message: GetTotalSharesQueryMsg): GetTotalSharesQueryMsgAmino { const obj: any = {}; @@ -865,9 +882,11 @@ export const GetTotalSharesQueryMsgResponse = { return message; }, fromAmino(object: GetTotalSharesQueryMsgResponseAmino): GetTotalSharesQueryMsgResponse { - return { - totalShares: object.total_shares - }; + const message = createBaseGetTotalSharesQueryMsgResponse(); + if (object.total_shares !== undefined && object.total_shares !== null) { + message.totalShares = object.total_shares; + } + return message; }, toAmino(message: GetTotalSharesQueryMsgResponse): GetTotalSharesQueryMsgResponseAmino { const obj: any = {}; diff --git a/packages/osmo-query/src/codegen/osmosis/cosmwasmpool/v1beta1/model/transmuter_msgs.ts b/packages/osmo-query/src/codegen/osmosis/cosmwasmpool/v1beta1/model/transmuter_msgs.ts index 11c03681b..a17e3eb96 100644 --- a/packages/osmo-query/src/codegen/osmosis/cosmwasmpool/v1beta1/model/transmuter_msgs.ts +++ b/packages/osmo-query/src/codegen/osmosis/cosmwasmpool/v1beta1/model/transmuter_msgs.ts @@ -115,7 +115,8 @@ export const EmptyRequest = { return message; }, fromAmino(_: EmptyRequestAmino): EmptyRequest { - return {}; + const message = createBaseEmptyRequest(); + return message; }, toAmino(_: EmptyRequest): EmptyRequestAmino { const obj: any = {}; @@ -179,9 +180,11 @@ export const JoinPoolExecuteMsgRequest = { return message; }, fromAmino(object: JoinPoolExecuteMsgRequestAmino): JoinPoolExecuteMsgRequest { - return { - joinPool: object?.join_pool ? EmptyRequest.fromAmino(object.join_pool) : undefined - }; + const message = createBaseJoinPoolExecuteMsgRequest(); + if (object.join_pool !== undefined && object.join_pool !== null) { + message.joinPool = EmptyRequest.fromAmino(object.join_pool); + } + return message; }, toAmino(message: JoinPoolExecuteMsgRequest): JoinPoolExecuteMsgRequestAmino { const obj: any = {}; @@ -237,7 +240,8 @@ export const JoinPoolExecuteMsgResponse = { return message; }, fromAmino(_: JoinPoolExecuteMsgResponseAmino): JoinPoolExecuteMsgResponse { - return {}; + const message = createBaseJoinPoolExecuteMsgResponse(); + return message; }, toAmino(_: JoinPoolExecuteMsgResponse): JoinPoolExecuteMsgResponseAmino { const obj: any = {}; @@ -301,9 +305,11 @@ export const ExitPoolExecuteMsgRequest = { return message; }, fromAmino(object: ExitPoolExecuteMsgRequestAmino): ExitPoolExecuteMsgRequest { - return { - exitPool: object?.exit_pool ? EmptyRequest.fromAmino(object.exit_pool) : undefined - }; + const message = createBaseExitPoolExecuteMsgRequest(); + if (object.exit_pool !== undefined && object.exit_pool !== null) { + message.exitPool = EmptyRequest.fromAmino(object.exit_pool); + } + return message; }, toAmino(message: ExitPoolExecuteMsgRequest): ExitPoolExecuteMsgRequestAmino { const obj: any = {}; @@ -359,7 +365,8 @@ export const ExitPoolExecuteMsgResponse = { return message; }, fromAmino(_: ExitPoolExecuteMsgResponseAmino): ExitPoolExecuteMsgResponse { - return {}; + const message = createBaseExitPoolExecuteMsgResponse(); + return message; }, toAmino(_: ExitPoolExecuteMsgResponse): ExitPoolExecuteMsgResponseAmino { const obj: any = {}; diff --git a/packages/osmo-query/src/codegen/osmosis/cosmwasmpool/v1beta1/model/tx.ts b/packages/osmo-query/src/codegen/osmosis/cosmwasmpool/v1beta1/model/tx.ts index 7d95dd6ec..317e3fefe 100644 --- a/packages/osmo-query/src/codegen/osmosis/cosmwasmpool/v1beta1/model/tx.ts +++ b/packages/osmo-query/src/codegen/osmosis/cosmwasmpool/v1beta1/model/tx.ts @@ -1,4 +1,5 @@ import { BinaryReader, BinaryWriter } from "../../../../binary"; +import { bytesFromBase64, base64FromBytes } from "../../../../helpers"; /** ===================== MsgCreateCosmwasmPool */ export interface MsgCreateCosmWasmPool { codeId: bigint; @@ -11,9 +12,9 @@ export interface MsgCreateCosmWasmPoolProtoMsg { } /** ===================== MsgCreateCosmwasmPool */ export interface MsgCreateCosmWasmPoolAmino { - code_id: string; - instantiate_msg: Uint8Array; - sender: string; + code_id?: string; + instantiate_msg?: string; + sender?: string; } export interface MsgCreateCosmWasmPoolAminoMsg { type: "osmosis/cosmwasmpool/create-cosm-wasm-pool"; @@ -35,7 +36,7 @@ export interface MsgCreateCosmWasmPoolResponseProtoMsg { } /** Returns a unique poolID to identify the pool with. */ export interface MsgCreateCosmWasmPoolResponseAmino { - pool_id: string; + pool_id?: string; } export interface MsgCreateCosmWasmPoolResponseAminoMsg { type: "osmosis/cosmwasmpool/create-cosm-wasm-pool-response"; @@ -97,16 +98,22 @@ export const MsgCreateCosmWasmPool = { return message; }, fromAmino(object: MsgCreateCosmWasmPoolAmino): MsgCreateCosmWasmPool { - return { - codeId: BigInt(object.code_id), - instantiateMsg: object.instantiate_msg, - sender: object.sender - }; + const message = createBaseMsgCreateCosmWasmPool(); + if (object.code_id !== undefined && object.code_id !== null) { + message.codeId = BigInt(object.code_id); + } + if (object.instantiate_msg !== undefined && object.instantiate_msg !== null) { + message.instantiateMsg = bytesFromBase64(object.instantiate_msg); + } + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + return message; }, toAmino(message: MsgCreateCosmWasmPool): MsgCreateCosmWasmPoolAmino { const obj: any = {}; obj.code_id = message.codeId ? message.codeId.toString() : undefined; - obj.instantiate_msg = message.instantiateMsg; + obj.instantiate_msg = message.instantiateMsg ? base64FromBytes(message.instantiateMsg) : undefined; obj.sender = message.sender; return obj; }, @@ -168,9 +175,11 @@ export const MsgCreateCosmWasmPoolResponse = { return message; }, fromAmino(object: MsgCreateCosmWasmPoolResponseAmino): MsgCreateCosmWasmPoolResponse { - return { - poolId: BigInt(object.pool_id) - }; + const message = createBaseMsgCreateCosmWasmPoolResponse(); + if (object.pool_id !== undefined && object.pool_id !== null) { + message.poolId = BigInt(object.pool_id); + } + return message; }, toAmino(message: MsgCreateCosmWasmPoolResponse): MsgCreateCosmWasmPoolResponseAmino { const obj: any = {}; diff --git a/packages/osmo-query/src/codegen/osmosis/cosmwasmpool/v1beta1/params.ts b/packages/osmo-query/src/codegen/osmosis/cosmwasmpool/v1beta1/params.ts index ab972baa2..4415e0ccf 100644 --- a/packages/osmo-query/src/codegen/osmosis/cosmwasmpool/v1beta1/params.ts +++ b/packages/osmo-query/src/codegen/osmosis/cosmwasmpool/v1beta1/params.ts @@ -22,14 +22,14 @@ export interface ParamsAmino { * code_ide_whitelist contains the list of code ids that are allowed to be * instantiated. */ - code_id_whitelist: string[]; + code_id_whitelist?: string[]; /** * pool_migration_limit is the maximum number of pools that can be migrated * at once via governance proposal. This is to have a constant bound on the * number of pools that can be migrated at once and remove the possibility * of an unlikely scenario of causing a chain halt due to a large migration. */ - pool_migration_limit: string; + pool_migration_limit?: string; } export interface ParamsAminoMsg { type: "osmosis/cosmwasmpool/params"; @@ -92,10 +92,12 @@ export const Params = { return message; }, fromAmino(object: ParamsAmino): Params { - return { - codeIdWhitelist: Array.isArray(object?.code_id_whitelist) ? object.code_id_whitelist.map((e: any) => BigInt(e)) : [], - poolMigrationLimit: BigInt(object.pool_migration_limit) - }; + const message = createBaseParams(); + message.codeIdWhitelist = object.code_id_whitelist?.map(e => BigInt(e)) || []; + if (object.pool_migration_limit !== undefined && object.pool_migration_limit !== null) { + message.poolMigrationLimit = BigInt(object.pool_migration_limit); + } + return message; }, toAmino(message: Params): ParamsAmino { const obj: any = {}; diff --git a/packages/osmo-query/src/codegen/osmosis/cosmwasmpool/v1beta1/query.ts b/packages/osmo-query/src/codegen/osmosis/cosmwasmpool/v1beta1/query.ts index b158bbae1..4f4a402a0 100644 --- a/packages/osmo-query/src/codegen/osmosis/cosmwasmpool/v1beta1/query.ts +++ b/packages/osmo-query/src/codegen/osmosis/cosmwasmpool/v1beta1/query.ts @@ -1,16 +1,16 @@ import { PageRequest, PageRequestAmino, PageRequestSDKType, PageResponse, PageResponseAmino, PageResponseSDKType } from "../../../cosmos/base/query/v1beta1/pagination"; import { Params, ParamsAmino, ParamsSDKType } from "./params"; import { Any, AnyProtoMsg, AnyAmino, AnySDKType } from "../../../google/protobuf/any"; -import { Pool as Pool1 } from "../../concentrated-liquidity/pool"; -import { PoolProtoMsg as Pool1ProtoMsg } from "../../concentrated-liquidity/pool"; -import { PoolSDKType as Pool1SDKType } from "../../concentrated-liquidity/pool"; +import { Pool as Pool1 } from "../../concentratedliquidity/v1beta1/pool"; +import { PoolProtoMsg as Pool1ProtoMsg } from "../../concentratedliquidity/v1beta1/pool"; +import { PoolSDKType as Pool1SDKType } from "../../concentratedliquidity/v1beta1/pool"; import { CosmWasmPool, CosmWasmPoolProtoMsg, CosmWasmPoolSDKType } from "./model/pool"; -import { Pool as Pool2 } from "../../gamm/pool-models/balancer/balancerPool"; -import { PoolProtoMsg as Pool2ProtoMsg } from "../../gamm/pool-models/balancer/balancerPool"; -import { PoolSDKType as Pool2SDKType } from "../../gamm/pool-models/balancer/balancerPool"; -import { Pool as Pool3 } from "../../gamm/pool-models/stableswap/stableswap_pool"; -import { PoolProtoMsg as Pool3ProtoMsg } from "../../gamm/pool-models/stableswap/stableswap_pool"; -import { PoolSDKType as Pool3SDKType } from "../../gamm/pool-models/stableswap/stableswap_pool"; +import { Pool as Pool2 } from "../../gamm/poolmodels/stableswap/v1beta1/stableswap_pool"; +import { PoolProtoMsg as Pool2ProtoMsg } from "../../gamm/poolmodels/stableswap/v1beta1/stableswap_pool"; +import { PoolSDKType as Pool2SDKType } from "../../gamm/poolmodels/stableswap/v1beta1/stableswap_pool"; +import { Pool as Pool3 } from "../../gamm/v1beta1/balancerPool"; +import { PoolProtoMsg as Pool3ProtoMsg } from "../../gamm/v1beta1/balancerPool"; +import { PoolSDKType as Pool3SDKType } from "../../gamm/v1beta1/balancerPool"; import { BinaryReader, BinaryWriter } from "../../../binary"; /** =============================== ContractInfoByPoolId */ export interface ParamsRequest {} @@ -46,7 +46,7 @@ export interface ParamsResponseSDKType { /** =============================== Pools */ export interface PoolsRequest { /** pagination defines an optional pagination for the request. */ - pagination: PageRequest; + pagination?: PageRequest; } export interface PoolsRequestProtoMsg { typeUrl: "/osmosis.cosmwasmpool.v1beta1.PoolsRequest"; @@ -63,12 +63,12 @@ export interface PoolsRequestAminoMsg { } /** =============================== Pools */ export interface PoolsRequestSDKType { - pagination: PageRequestSDKType; + pagination?: PageRequestSDKType; } export interface PoolsResponse { pools: (Pool1 & CosmWasmPool & Pool2 & Pool3 & Any)[] | Any[]; /** pagination defines the pagination in the response. */ - pagination: PageResponse; + pagination?: PageResponse; } export interface PoolsResponseProtoMsg { typeUrl: "/osmosis.cosmwasmpool.v1beta1.PoolsResponse"; @@ -78,7 +78,7 @@ export type PoolsResponseEncoded = Omit & { pools: (Pool1ProtoMsg | CosmWasmPoolProtoMsg | Pool2ProtoMsg | Pool3ProtoMsg | AnyProtoMsg)[]; }; export interface PoolsResponseAmino { - pools: AnyAmino[]; + pools?: AnyAmino[]; /** pagination defines the pagination in the response. */ pagination?: PageResponseAmino; } @@ -88,7 +88,7 @@ export interface PoolsResponseAminoMsg { } export interface PoolsResponseSDKType { pools: (Pool1SDKType | CosmWasmPoolSDKType | Pool2SDKType | Pool3SDKType | AnySDKType)[]; - pagination: PageResponseSDKType; + pagination?: PageResponseSDKType; } /** =============================== ContractInfoByPoolId */ export interface ContractInfoByPoolIdRequest { @@ -102,7 +102,7 @@ export interface ContractInfoByPoolIdRequestProtoMsg { /** =============================== ContractInfoByPoolId */ export interface ContractInfoByPoolIdRequestAmino { /** pool_id is the pool id of the requested pool. */ - pool_id: string; + pool_id?: string; } export interface ContractInfoByPoolIdRequestAminoMsg { type: "osmosis/cosmwasmpool/contract-info-by-pool-id-request"; @@ -130,9 +130,9 @@ export interface ContractInfoByPoolIdResponseAmino { * contract_address is the pool address and contract address * of the requested pool id. */ - contract_address: string; + contract_address?: string; /** code_id is the code id of the requested pool id. */ - code_id: string; + code_id?: string; } export interface ContractInfoByPoolIdResponseAminoMsg { type: "osmosis/cosmwasmpool/contract-info-by-pool-id-response"; @@ -169,7 +169,8 @@ export const ParamsRequest = { return message; }, fromAmino(_: ParamsRequestAmino): ParamsRequest { - return {}; + const message = createBaseParamsRequest(); + return message; }, toAmino(_: ParamsRequest): ParamsRequestAmino { const obj: any = {}; @@ -233,9 +234,11 @@ export const ParamsResponse = { return message; }, fromAmino(object: ParamsResponseAmino): ParamsResponse { - return { - params: object?.params ? Params.fromAmino(object.params) : undefined - }; + const message = createBaseParamsResponse(); + if (object.params !== undefined && object.params !== null) { + message.params = Params.fromAmino(object.params); + } + return message; }, toAmino(message: ParamsResponse): ParamsResponseAmino { const obj: any = {}; @@ -266,7 +269,7 @@ export const ParamsResponse = { }; function createBasePoolsRequest(): PoolsRequest { return { - pagination: PageRequest.fromPartial({}) + pagination: undefined }; } export const PoolsRequest = { @@ -300,9 +303,11 @@ export const PoolsRequest = { return message; }, fromAmino(object: PoolsRequestAmino): PoolsRequest { - return { - pagination: object?.pagination ? PageRequest.fromAmino(object.pagination) : undefined - }; + const message = createBasePoolsRequest(); + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromAmino(object.pagination); + } + return message; }, toAmino(message: PoolsRequest): PoolsRequestAmino { const obj: any = {}; @@ -334,7 +339,7 @@ export const PoolsRequest = { function createBasePoolsResponse(): PoolsResponse { return { pools: [], - pagination: PageResponse.fromPartial({}) + pagination: undefined }; } export const PoolsResponse = { @@ -356,7 +361,7 @@ export const PoolsResponse = { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.pools.push((PoolI_InterfaceDecoder(reader) as Any)); + message.pools.push((Any(reader) as Any)); break; case 2: message.pagination = PageResponse.decode(reader, reader.uint32()); @@ -375,10 +380,12 @@ export const PoolsResponse = { return message; }, fromAmino(object: PoolsResponseAmino): PoolsResponse { - return { - pools: Array.isArray(object?.pools) ? object.pools.map((e: any) => PoolI_FromAmino(e)) : [], - pagination: object?.pagination ? PageResponse.fromAmino(object.pagination) : undefined - }; + const message = createBasePoolsResponse(); + message.pools = object.pools?.map(e => PoolI_FromAmino(e)) || []; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromAmino(object.pagination); + } + return message; }, toAmino(message: PoolsResponse): PoolsResponseAmino { const obj: any = {}; @@ -448,9 +455,11 @@ export const ContractInfoByPoolIdRequest = { return message; }, fromAmino(object: ContractInfoByPoolIdRequestAmino): ContractInfoByPoolIdRequest { - return { - poolId: BigInt(object.pool_id) - }; + const message = createBaseContractInfoByPoolIdRequest(); + if (object.pool_id !== undefined && object.pool_id !== null) { + message.poolId = BigInt(object.pool_id); + } + return message; }, toAmino(message: ContractInfoByPoolIdRequest): ContractInfoByPoolIdRequestAmino { const obj: any = {}; @@ -523,10 +532,14 @@ export const ContractInfoByPoolIdResponse = { return message; }, fromAmino(object: ContractInfoByPoolIdResponseAmino): ContractInfoByPoolIdResponse { - return { - contractAddress: object.contract_address, - codeId: BigInt(object.code_id) - }; + const message = createBaseContractInfoByPoolIdResponse(); + if (object.contract_address !== undefined && object.contract_address !== null) { + message.contractAddress = object.contract_address; + } + if (object.code_id !== undefined && object.code_id !== null) { + message.codeId = BigInt(object.code_id); + } + return message; }, toAmino(message: ContractInfoByPoolIdResponse): ContractInfoByPoolIdResponseAmino { const obj: any = {}; @@ -558,16 +571,16 @@ export const ContractInfoByPoolIdResponse = { }; export const PoolI_InterfaceDecoder = (input: BinaryReader | Uint8Array): Pool1 | CosmWasmPool | Pool2 | Pool3 | Any => { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - const data = Any.decode(reader, reader.uint32()); + const data = Any.decode(reader, reader.uint32(), true); switch (data.typeUrl) { case "/osmosis.concentratedliquidity.v1beta1.Pool": - return Pool1.decode(data.value); + return Pool1.decode(data.value, undefined, true); case "/osmosis.cosmwasmpool.v1beta1.CosmWasmPool": - return CosmWasmPool.decode(data.value); - case "/osmosis.gamm.v1beta1.Pool": - return Pool2.decode(data.value); + return CosmWasmPool.decode(data.value, undefined, true); case "/osmosis.gamm.poolmodels.stableswap.v1beta1.Pool": - return Pool3.decode(data.value); + return Pool2.decode(data.value, undefined, true); + case "/osmosis.gamm.v1beta1.Pool": + return Pool3.decode(data.value, undefined, true); default: return data; } @@ -584,14 +597,14 @@ export const PoolI_FromAmino = (content: AnyAmino) => { typeUrl: "/osmosis.cosmwasmpool.v1beta1.CosmWasmPool", value: CosmWasmPool.encode(CosmWasmPool.fromPartial(CosmWasmPool.fromAmino(content.value))).finish() }); - case "osmosis/gamm/BalancerPool": + case "osmosis/gamm/StableswapPool": return Any.fromPartial({ - typeUrl: "/osmosis.gamm.v1beta1.Pool", + typeUrl: "/osmosis.gamm.poolmodels.stableswap.v1beta1.Pool", value: Pool2.encode(Pool2.fromPartial(Pool2.fromAmino(content.value))).finish() }); - case "osmosis/gamm/StableswapPool": + case "osmosis/gamm/BalancerPool": return Any.fromPartial({ - typeUrl: "/osmosis.gamm.poolmodels.stableswap.v1beta1.Pool", + typeUrl: "/osmosis.gamm.v1beta1.Pool", value: Pool3.encode(Pool3.fromPartial(Pool3.fromAmino(content.value))).finish() }); default: @@ -603,22 +616,22 @@ export const PoolI_ToAmino = (content: Any) => { case "/osmosis.concentratedliquidity.v1beta1.Pool": return { type: "osmosis/concentratedliquidity/pool", - value: Pool1.toAmino(Pool1.decode(content.value)) + value: Pool1.toAmino(Pool1.decode(content.value, undefined)) }; case "/osmosis.cosmwasmpool.v1beta1.CosmWasmPool": return { type: "osmosis/cosmwasmpool/cosm-wasm-pool", - value: CosmWasmPool.toAmino(CosmWasmPool.decode(content.value)) - }; - case "/osmosis.gamm.v1beta1.Pool": - return { - type: "osmosis/gamm/BalancerPool", - value: Pool2.toAmino(Pool2.decode(content.value)) + value: CosmWasmPool.toAmino(CosmWasmPool.decode(content.value, undefined)) }; case "/osmosis.gamm.poolmodels.stableswap.v1beta1.Pool": return { type: "osmosis/gamm/StableswapPool", - value: Pool3.toAmino(Pool3.decode(content.value)) + value: Pool2.toAmino(Pool2.decode(content.value, undefined)) + }; + case "/osmosis.gamm.v1beta1.Pool": + return { + type: "osmosis/gamm/BalancerPool", + value: Pool3.toAmino(Pool3.decode(content.value, undefined)) }; default: return Any.toAmino(content); diff --git a/packages/osmo-query/src/codegen/osmosis/downtime-detector/v1beta1/downtime_duration.ts b/packages/osmo-query/src/codegen/osmosis/downtimedetector/v1beta1/downtime_duration.ts similarity index 100% rename from packages/osmo-query/src/codegen/osmosis/downtime-detector/v1beta1/downtime_duration.ts rename to packages/osmo-query/src/codegen/osmosis/downtimedetector/v1beta1/downtime_duration.ts diff --git a/packages/osmo-query/src/codegen/osmosis/downtime-detector/v1beta1/genesis.ts b/packages/osmo-query/src/codegen/osmosis/downtimedetector/v1beta1/genesis.ts similarity index 83% rename from packages/osmo-query/src/codegen/osmosis/downtime-detector/v1beta1/genesis.ts rename to packages/osmo-query/src/codegen/osmosis/downtimedetector/v1beta1/genesis.ts index c7089e35f..2e4210d64 100644 --- a/packages/osmo-query/src/codegen/osmosis/downtime-detector/v1beta1/genesis.ts +++ b/packages/osmo-query/src/codegen/osmosis/downtimedetector/v1beta1/genesis.ts @@ -1,7 +1,7 @@ -import { Downtime, downtimeFromJSON } from "./downtime_duration"; +import { Downtime, downtimeFromJSON, downtimeToJSON } from "./downtime_duration"; import { Timestamp } from "../../../google/protobuf/timestamp"; import { BinaryReader, BinaryWriter } from "../../../binary"; -import { toTimestamp, fromTimestamp, isSet } from "../../../helpers"; +import { toTimestamp, fromTimestamp } from "../../../helpers"; export interface GenesisDowntimeEntry { duration: Downtime; lastDowntime: Date; @@ -11,8 +11,8 @@ export interface GenesisDowntimeEntryProtoMsg { value: Uint8Array; } export interface GenesisDowntimeEntryAmino { - duration: Downtime; - last_downtime?: Date; + duration?: Downtime; + last_downtime?: string; } export interface GenesisDowntimeEntryAminoMsg { type: "osmosis/downtimedetector/genesis-downtime-entry"; @@ -33,8 +33,8 @@ export interface GenesisStateProtoMsg { } /** GenesisState defines the twap module's genesis state. */ export interface GenesisStateAmino { - downtimes: GenesisDowntimeEntryAmino[]; - last_block_time?: Date; + downtimes?: GenesisDowntimeEntryAmino[]; + last_block_time?: string; } export interface GenesisStateAminoMsg { type: "osmosis/downtimedetector/genesis-state"; @@ -89,15 +89,19 @@ export const GenesisDowntimeEntry = { return message; }, fromAmino(object: GenesisDowntimeEntryAmino): GenesisDowntimeEntry { - return { - duration: isSet(object.duration) ? downtimeFromJSON(object.duration) : -1, - lastDowntime: object.last_downtime - }; + const message = createBaseGenesisDowntimeEntry(); + if (object.duration !== undefined && object.duration !== null) { + message.duration = downtimeFromJSON(object.duration); + } + if (object.last_downtime !== undefined && object.last_downtime !== null) { + message.lastDowntime = fromTimestamp(Timestamp.fromAmino(object.last_downtime)); + } + return message; }, toAmino(message: GenesisDowntimeEntry): GenesisDowntimeEntryAmino { const obj: any = {}; - obj.duration = message.duration; - obj.last_downtime = message.lastDowntime; + obj.duration = downtimeToJSON(message.duration); + obj.last_downtime = message.lastDowntime ? Timestamp.toAmino(toTimestamp(message.lastDowntime)) : undefined; return obj; }, fromAminoMsg(object: GenesisDowntimeEntryAminoMsg): GenesisDowntimeEntry { @@ -166,10 +170,12 @@ export const GenesisState = { return message; }, fromAmino(object: GenesisStateAmino): GenesisState { - return { - downtimes: Array.isArray(object?.downtimes) ? object.downtimes.map((e: any) => GenesisDowntimeEntry.fromAmino(e)) : [], - lastBlockTime: object.last_block_time - }; + const message = createBaseGenesisState(); + message.downtimes = object.downtimes?.map(e => GenesisDowntimeEntry.fromAmino(e)) || []; + if (object.last_block_time !== undefined && object.last_block_time !== null) { + message.lastBlockTime = fromTimestamp(Timestamp.fromAmino(object.last_block_time)); + } + return message; }, toAmino(message: GenesisState): GenesisStateAmino { const obj: any = {}; @@ -178,7 +184,7 @@ export const GenesisState = { } else { obj.downtimes = []; } - obj.last_block_time = message.lastBlockTime; + obj.last_block_time = message.lastBlockTime ? Timestamp.toAmino(toTimestamp(message.lastBlockTime)) : undefined; return obj; }, fromAminoMsg(object: GenesisStateAminoMsg): GenesisState { diff --git a/packages/osmo-query/src/codegen/osmosis/downtime-detector/v1beta1/query.lcd.ts b/packages/osmo-query/src/codegen/osmosis/downtimedetector/v1beta1/query.lcd.ts similarity index 100% rename from packages/osmo-query/src/codegen/osmosis/downtime-detector/v1beta1/query.lcd.ts rename to packages/osmo-query/src/codegen/osmosis/downtimedetector/v1beta1/query.lcd.ts diff --git a/packages/osmo-query/src/codegen/osmosis/downtime-detector/v1beta1/query.rpc.Query.ts b/packages/osmo-query/src/codegen/osmosis/downtimedetector/v1beta1/query.rpc.Query.ts similarity index 100% rename from packages/osmo-query/src/codegen/osmosis/downtime-detector/v1beta1/query.rpc.Query.ts rename to packages/osmo-query/src/codegen/osmosis/downtimedetector/v1beta1/query.rpc.Query.ts diff --git a/packages/osmo-query/src/codegen/osmosis/downtime-detector/v1beta1/query.ts b/packages/osmo-query/src/codegen/osmosis/downtimedetector/v1beta1/query.ts similarity index 90% rename from packages/osmo-query/src/codegen/osmosis/downtime-detector/v1beta1/query.ts rename to packages/osmo-query/src/codegen/osmosis/downtimedetector/v1beta1/query.ts index 7a2980e27..375925138 100644 --- a/packages/osmo-query/src/codegen/osmosis/downtime-detector/v1beta1/query.ts +++ b/packages/osmo-query/src/codegen/osmosis/downtimedetector/v1beta1/query.ts @@ -1,7 +1,6 @@ -import { Downtime, downtimeFromJSON } from "./downtime_duration"; +import { Downtime, downtimeFromJSON, downtimeToJSON } from "./downtime_duration"; import { Duration, DurationAmino, DurationSDKType } from "../../../google/protobuf/duration"; import { BinaryReader, BinaryWriter } from "../../../binary"; -import { isSet } from "../../../helpers"; /** * Query for has it been at least $RECOVERY_DURATION units of time, * since the chain has been down for $DOWNTIME_DURATION. @@ -19,7 +18,7 @@ export interface RecoveredSinceDowntimeOfLengthRequestProtoMsg { * since the chain has been down for $DOWNTIME_DURATION. */ export interface RecoveredSinceDowntimeOfLengthRequestAmino { - downtime: Downtime; + downtime?: Downtime; recovery?: DurationAmino; } export interface RecoveredSinceDowntimeOfLengthRequestAminoMsg { @@ -42,7 +41,7 @@ export interface RecoveredSinceDowntimeOfLengthResponseProtoMsg { value: Uint8Array; } export interface RecoveredSinceDowntimeOfLengthResponseAmino { - succesfully_recovered: boolean; + succesfully_recovered?: boolean; } export interface RecoveredSinceDowntimeOfLengthResponseAminoMsg { type: "osmosis/downtimedetector/recovered-since-downtime-of-length-response"; @@ -95,14 +94,18 @@ export const RecoveredSinceDowntimeOfLengthRequest = { return message; }, fromAmino(object: RecoveredSinceDowntimeOfLengthRequestAmino): RecoveredSinceDowntimeOfLengthRequest { - return { - downtime: isSet(object.downtime) ? downtimeFromJSON(object.downtime) : -1, - recovery: object?.recovery ? Duration.fromAmino(object.recovery) : undefined - }; + const message = createBaseRecoveredSinceDowntimeOfLengthRequest(); + if (object.downtime !== undefined && object.downtime !== null) { + message.downtime = downtimeFromJSON(object.downtime); + } + if (object.recovery !== undefined && object.recovery !== null) { + message.recovery = Duration.fromAmino(object.recovery); + } + return message; }, toAmino(message: RecoveredSinceDowntimeOfLengthRequest): RecoveredSinceDowntimeOfLengthRequestAmino { const obj: any = {}; - obj.downtime = message.downtime; + obj.downtime = downtimeToJSON(message.downtime); obj.recovery = message.recovery ? Duration.toAmino(message.recovery) : undefined; return obj; }, @@ -164,9 +167,11 @@ export const RecoveredSinceDowntimeOfLengthResponse = { return message; }, fromAmino(object: RecoveredSinceDowntimeOfLengthResponseAmino): RecoveredSinceDowntimeOfLengthResponse { - return { - succesfullyRecovered: object.succesfully_recovered - }; + const message = createBaseRecoveredSinceDowntimeOfLengthResponse(); + if (object.succesfully_recovered !== undefined && object.succesfully_recovered !== null) { + message.succesfullyRecovered = object.succesfully_recovered; + } + return message; }, toAmino(message: RecoveredSinceDowntimeOfLengthResponse): RecoveredSinceDowntimeOfLengthResponseAmino { const obj: any = {}; diff --git a/packages/osmo-query/src/codegen/osmosis/epochs/genesis.ts b/packages/osmo-query/src/codegen/osmosis/epochs/v1beta1/genesis.ts similarity index 86% rename from packages/osmo-query/src/codegen/osmosis/epochs/genesis.ts rename to packages/osmo-query/src/codegen/osmosis/epochs/v1beta1/genesis.ts index f4a6e5ccf..a0a99c168 100644 --- a/packages/osmo-query/src/codegen/osmosis/epochs/genesis.ts +++ b/packages/osmo-query/src/codegen/osmosis/epochs/v1beta1/genesis.ts @@ -1,7 +1,7 @@ -import { Timestamp } from "../../google/protobuf/timestamp"; -import { Duration, DurationAmino, DurationSDKType } from "../../google/protobuf/duration"; -import { BinaryReader, BinaryWriter } from "../../binary"; -import { toTimestamp, fromTimestamp } from "../../helpers"; +import { Timestamp } from "../../../google/protobuf/timestamp"; +import { Duration, DurationAmino, DurationSDKType } from "../../../google/protobuf/duration"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { toTimestamp, fromTimestamp } from "../../../helpers"; /** * EpochInfo is a struct that describes the data going into * a timer defined by the x/epochs module. @@ -70,13 +70,13 @@ export interface EpochInfoProtoMsg { */ export interface EpochInfoAmino { /** identifier is a unique reference to this particular timer. */ - identifier: string; + identifier?: string; /** * start_time is the time at which the timer first ever ticks. * If start_time is in the future, the epoch will not begin until the start * time. */ - start_time?: Date; + start_time?: string; /** * duration is the time in between epoch ticks. * In order for intended behavior to be met, duration should @@ -90,7 +90,7 @@ export interface EpochInfoAmino { * The first tick (current_epoch=1) is defined as * the first block whose blocktime is greater than the EpochInfo start_time. */ - current_epoch: string; + current_epoch?: string; /** * current_epoch_start_time describes the start time of the current timer * interval. The interval is (current_epoch_start_time, @@ -110,17 +110,17 @@ export interface EpochInfoAmino { * * The t=34 block will start the epoch for (30, 35] * * The **t=36** block will start the epoch for (35, 40] */ - current_epoch_start_time?: Date; + current_epoch_start_time?: string; /** * epoch_counting_started is a boolean, that indicates whether this * epoch timer has began yet. */ - epoch_counting_started: boolean; + epoch_counting_started?: boolean; /** * current_epoch_start_height is the block height at which the current epoch * started. (The block height at which the timer last ticked) */ - current_epoch_start_height: string; + current_epoch_start_height?: string; } export interface EpochInfoAminoMsg { type: "osmosis/epochs/epoch-info"; @@ -149,7 +149,7 @@ export interface GenesisStateProtoMsg { } /** GenesisState defines the epochs module's genesis state. */ export interface GenesisStateAmino { - epochs: EpochInfoAmino[]; + epochs?: EpochInfoAmino[]; } export interface GenesisStateAminoMsg { type: "osmosis/epochs/genesis-state"; @@ -243,23 +243,37 @@ export const EpochInfo = { return message; }, fromAmino(object: EpochInfoAmino): EpochInfo { - return { - identifier: object.identifier, - startTime: object.start_time, - duration: object?.duration ? Duration.fromAmino(object.duration) : undefined, - currentEpoch: BigInt(object.current_epoch), - currentEpochStartTime: object.current_epoch_start_time, - epochCountingStarted: object.epoch_counting_started, - currentEpochStartHeight: BigInt(object.current_epoch_start_height) - }; + const message = createBaseEpochInfo(); + if (object.identifier !== undefined && object.identifier !== null) { + message.identifier = object.identifier; + } + if (object.start_time !== undefined && object.start_time !== null) { + message.startTime = fromTimestamp(Timestamp.fromAmino(object.start_time)); + } + if (object.duration !== undefined && object.duration !== null) { + message.duration = Duration.fromAmino(object.duration); + } + if (object.current_epoch !== undefined && object.current_epoch !== null) { + message.currentEpoch = BigInt(object.current_epoch); + } + if (object.current_epoch_start_time !== undefined && object.current_epoch_start_time !== null) { + message.currentEpochStartTime = fromTimestamp(Timestamp.fromAmino(object.current_epoch_start_time)); + } + if (object.epoch_counting_started !== undefined && object.epoch_counting_started !== null) { + message.epochCountingStarted = object.epoch_counting_started; + } + if (object.current_epoch_start_height !== undefined && object.current_epoch_start_height !== null) { + message.currentEpochStartHeight = BigInt(object.current_epoch_start_height); + } + return message; }, toAmino(message: EpochInfo): EpochInfoAmino { const obj: any = {}; obj.identifier = message.identifier; - obj.start_time = message.startTime; + obj.start_time = message.startTime ? Timestamp.toAmino(toTimestamp(message.startTime)) : undefined; obj.duration = message.duration ? Duration.toAmino(message.duration) : undefined; obj.current_epoch = message.currentEpoch ? message.currentEpoch.toString() : undefined; - obj.current_epoch_start_time = message.currentEpochStartTime; + obj.current_epoch_start_time = message.currentEpochStartTime ? Timestamp.toAmino(toTimestamp(message.currentEpochStartTime)) : undefined; obj.epoch_counting_started = message.epochCountingStarted; obj.current_epoch_start_height = message.currentEpochStartHeight ? message.currentEpochStartHeight.toString() : undefined; return obj; @@ -322,9 +336,9 @@ export const GenesisState = { return message; }, fromAmino(object: GenesisStateAmino): GenesisState { - return { - epochs: Array.isArray(object?.epochs) ? object.epochs.map((e: any) => EpochInfo.fromAmino(e)) : [] - }; + const message = createBaseGenesisState(); + message.epochs = object.epochs?.map(e => EpochInfo.fromAmino(e)) || []; + return message; }, toAmino(message: GenesisState): GenesisStateAmino { const obj: any = {}; diff --git a/packages/osmo-query/src/codegen/osmosis/epochs/query.lcd.ts b/packages/osmo-query/src/codegen/osmosis/epochs/v1beta1/query.lcd.ts similarity index 100% rename from packages/osmo-query/src/codegen/osmosis/epochs/query.lcd.ts rename to packages/osmo-query/src/codegen/osmosis/epochs/v1beta1/query.lcd.ts diff --git a/packages/osmo-query/src/codegen/osmosis/epochs/query.rpc.Query.ts b/packages/osmo-query/src/codegen/osmosis/epochs/v1beta1/query.rpc.Query.ts similarity index 96% rename from packages/osmo-query/src/codegen/osmosis/epochs/query.rpc.Query.ts rename to packages/osmo-query/src/codegen/osmosis/epochs/v1beta1/query.rpc.Query.ts index 4da5a6fe4..0c2ea0ae5 100644 --- a/packages/osmo-query/src/codegen/osmosis/epochs/query.rpc.Query.ts +++ b/packages/osmo-query/src/codegen/osmosis/epochs/v1beta1/query.rpc.Query.ts @@ -1,7 +1,7 @@ -import { Rpc } from "../../helpers"; -import { BinaryReader } from "../../binary"; +import { Rpc } from "../../../helpers"; +import { BinaryReader } from "../../../binary"; import { QueryClient, createProtobufRpcClient, ProtobufRpcClient } from "@cosmjs/stargate"; -import { ReactQueryParams } from "../../react-query"; +import { ReactQueryParams } from "../../../react-query"; import { useQuery } from "@tanstack/react-query"; import { QueryEpochsInfoRequest, QueryEpochsInfoResponse, QueryCurrentEpochRequest, QueryCurrentEpochResponse } from "./query"; /** Query defines the gRPC querier service. */ diff --git a/packages/osmo-query/src/codegen/osmosis/epochs/query.ts b/packages/osmo-query/src/codegen/osmosis/epochs/v1beta1/query.ts similarity index 93% rename from packages/osmo-query/src/codegen/osmosis/epochs/query.ts rename to packages/osmo-query/src/codegen/osmosis/epochs/v1beta1/query.ts index a26528949..8378bf03d 100644 --- a/packages/osmo-query/src/codegen/osmosis/epochs/query.ts +++ b/packages/osmo-query/src/codegen/osmosis/epochs/v1beta1/query.ts @@ -1,5 +1,5 @@ import { EpochInfo, EpochInfoAmino, EpochInfoSDKType } from "./genesis"; -import { BinaryReader, BinaryWriter } from "../../binary"; +import { BinaryReader, BinaryWriter } from "../../../binary"; export interface QueryEpochsInfoRequest {} export interface QueryEpochsInfoRequestProtoMsg { typeUrl: "/osmosis.epochs.v1beta1.QueryEpochsInfoRequest"; @@ -19,7 +19,7 @@ export interface QueryEpochsInfoResponseProtoMsg { value: Uint8Array; } export interface QueryEpochsInfoResponseAmino { - epochs: EpochInfoAmino[]; + epochs?: EpochInfoAmino[]; } export interface QueryEpochsInfoResponseAminoMsg { type: "osmosis/epochs/query-epochs-info-response"; @@ -36,7 +36,7 @@ export interface QueryCurrentEpochRequestProtoMsg { value: Uint8Array; } export interface QueryCurrentEpochRequestAmino { - identifier: string; + identifier?: string; } export interface QueryCurrentEpochRequestAminoMsg { type: "osmosis/epochs/query-current-epoch-request"; @@ -53,7 +53,7 @@ export interface QueryCurrentEpochResponseProtoMsg { value: Uint8Array; } export interface QueryCurrentEpochResponseAmino { - current_epoch: string; + current_epoch?: string; } export interface QueryCurrentEpochResponseAminoMsg { type: "osmosis/epochs/query-current-epoch-response"; @@ -89,7 +89,8 @@ export const QueryEpochsInfoRequest = { return message; }, fromAmino(_: QueryEpochsInfoRequestAmino): QueryEpochsInfoRequest { - return {}; + const message = createBaseQueryEpochsInfoRequest(); + return message; }, toAmino(_: QueryEpochsInfoRequest): QueryEpochsInfoRequestAmino { const obj: any = {}; @@ -153,9 +154,9 @@ export const QueryEpochsInfoResponse = { return message; }, fromAmino(object: QueryEpochsInfoResponseAmino): QueryEpochsInfoResponse { - return { - epochs: Array.isArray(object?.epochs) ? object.epochs.map((e: any) => EpochInfo.fromAmino(e)) : [] - }; + const message = createBaseQueryEpochsInfoResponse(); + message.epochs = object.epochs?.map(e => EpochInfo.fromAmino(e)) || []; + return message; }, toAmino(message: QueryEpochsInfoResponse): QueryEpochsInfoResponseAmino { const obj: any = {}; @@ -224,9 +225,11 @@ export const QueryCurrentEpochRequest = { return message; }, fromAmino(object: QueryCurrentEpochRequestAmino): QueryCurrentEpochRequest { - return { - identifier: object.identifier - }; + const message = createBaseQueryCurrentEpochRequest(); + if (object.identifier !== undefined && object.identifier !== null) { + message.identifier = object.identifier; + } + return message; }, toAmino(message: QueryCurrentEpochRequest): QueryCurrentEpochRequestAmino { const obj: any = {}; @@ -291,9 +294,11 @@ export const QueryCurrentEpochResponse = { return message; }, fromAmino(object: QueryCurrentEpochResponseAmino): QueryCurrentEpochResponse { - return { - currentEpoch: BigInt(object.current_epoch) - }; + const message = createBaseQueryCurrentEpochResponse(); + if (object.current_epoch !== undefined && object.current_epoch !== null) { + message.currentEpoch = BigInt(object.current_epoch); + } + return message; }, toAmino(message: QueryCurrentEpochResponse): QueryCurrentEpochResponseAmino { const obj: any = {}; diff --git a/packages/osmo-query/src/codegen/osmosis/gamm/pool-models/balancer/tx/tx.amino.ts b/packages/osmo-query/src/codegen/osmosis/gamm/poolmodels/balancer/v1beta1/tx.amino.ts similarity index 100% rename from packages/osmo-query/src/codegen/osmosis/gamm/pool-models/balancer/tx/tx.amino.ts rename to packages/osmo-query/src/codegen/osmosis/gamm/poolmodels/balancer/v1beta1/tx.amino.ts diff --git a/packages/osmo-query/src/codegen/osmosis/gamm/pool-models/balancer/tx/tx.registry.ts b/packages/osmo-query/src/codegen/osmosis/gamm/poolmodels/balancer/v1beta1/tx.registry.ts similarity index 100% rename from packages/osmo-query/src/codegen/osmosis/gamm/pool-models/balancer/tx/tx.registry.ts rename to packages/osmo-query/src/codegen/osmosis/gamm/poolmodels/balancer/v1beta1/tx.registry.ts diff --git a/packages/osmo-query/src/codegen/osmosis/gamm/pool-models/balancer/tx/tx.rpc.msg.ts b/packages/osmo-query/src/codegen/osmosis/gamm/poolmodels/balancer/v1beta1/tx.rpc.msg.ts similarity index 100% rename from packages/osmo-query/src/codegen/osmosis/gamm/pool-models/balancer/tx/tx.rpc.msg.ts rename to packages/osmo-query/src/codegen/osmosis/gamm/poolmodels/balancer/v1beta1/tx.rpc.msg.ts diff --git a/packages/osmo-query/src/codegen/osmosis/gamm/pool-models/balancer/tx/tx.ts b/packages/osmo-query/src/codegen/osmosis/gamm/poolmodels/balancer/v1beta1/tx.ts similarity index 88% rename from packages/osmo-query/src/codegen/osmosis/gamm/pool-models/balancer/tx/tx.ts rename to packages/osmo-query/src/codegen/osmosis/gamm/poolmodels/balancer/v1beta1/tx.ts index 3d78e1c37..4280c93b6 100644 --- a/packages/osmo-query/src/codegen/osmosis/gamm/pool-models/balancer/tx/tx.ts +++ b/packages/osmo-query/src/codegen/osmosis/gamm/poolmodels/balancer/v1beta1/tx.ts @@ -1,9 +1,9 @@ -import { PoolParams, PoolParamsAmino, PoolParamsSDKType, PoolAsset, PoolAssetAmino, PoolAssetSDKType } from "../balancerPool"; +import { PoolParams, PoolParamsAmino, PoolParamsSDKType, PoolAsset, PoolAssetAmino, PoolAssetSDKType } from "../../../v1beta1/balancerPool"; import { BinaryReader, BinaryWriter } from "../../../../../binary"; /** ===================== MsgCreatePool */ export interface MsgCreateBalancerPool { sender: string; - poolParams: PoolParams; + poolParams?: PoolParams; poolAssets: PoolAsset[]; futurePoolGovernor: string; } @@ -13,10 +13,10 @@ export interface MsgCreateBalancerPoolProtoMsg { } /** ===================== MsgCreatePool */ export interface MsgCreateBalancerPoolAmino { - sender: string; + sender?: string; pool_params?: PoolParamsAmino; - pool_assets: PoolAssetAmino[]; - future_pool_governor: string; + pool_assets?: PoolAssetAmino[]; + future_pool_governor?: string; } export interface MsgCreateBalancerPoolAminoMsg { type: "osmosis/gamm/create-balancer-pool"; @@ -25,7 +25,7 @@ export interface MsgCreateBalancerPoolAminoMsg { /** ===================== MsgCreatePool */ export interface MsgCreateBalancerPoolSDKType { sender: string; - pool_params: PoolParamsSDKType; + pool_params?: PoolParamsSDKType; pool_assets: PoolAssetSDKType[]; future_pool_governor: string; } @@ -39,7 +39,7 @@ export interface MsgCreateBalancerPoolResponseProtoMsg { } /** Returns the poolID */ export interface MsgCreateBalancerPoolResponseAmino { - pool_id: string; + pool_id?: string; } export interface MsgCreateBalancerPoolResponseAminoMsg { type: "osmosis/gamm/poolmodels/balancer/create-balancer-pool-response"; @@ -52,7 +52,7 @@ export interface MsgCreateBalancerPoolResponseSDKType { function createBaseMsgCreateBalancerPool(): MsgCreateBalancerPool { return { sender: "", - poolParams: PoolParams.fromPartial({}), + poolParams: undefined, poolAssets: [], futurePoolGovernor: "" }; @@ -109,12 +109,18 @@ export const MsgCreateBalancerPool = { return message; }, fromAmino(object: MsgCreateBalancerPoolAmino): MsgCreateBalancerPool { - return { - sender: object.sender, - poolParams: object?.pool_params ? PoolParams.fromAmino(object.pool_params) : undefined, - poolAssets: Array.isArray(object?.pool_assets) ? object.pool_assets.map((e: any) => PoolAsset.fromAmino(e)) : [], - futurePoolGovernor: object.future_pool_governor - }; + const message = createBaseMsgCreateBalancerPool(); + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + if (object.pool_params !== undefined && object.pool_params !== null) { + message.poolParams = PoolParams.fromAmino(object.pool_params); + } + message.poolAssets = object.pool_assets?.map(e => PoolAsset.fromAmino(e)) || []; + if (object.future_pool_governor !== undefined && object.future_pool_governor !== null) { + message.futurePoolGovernor = object.future_pool_governor; + } + return message; }, toAmino(message: MsgCreateBalancerPool): MsgCreateBalancerPoolAmino { const obj: any = {}; @@ -186,9 +192,11 @@ export const MsgCreateBalancerPoolResponse = { return message; }, fromAmino(object: MsgCreateBalancerPoolResponseAmino): MsgCreateBalancerPoolResponse { - return { - poolId: BigInt(object.pool_id) - }; + const message = createBaseMsgCreateBalancerPoolResponse(); + if (object.pool_id !== undefined && object.pool_id !== null) { + message.poolId = BigInt(object.pool_id); + } + return message; }, toAmino(message: MsgCreateBalancerPoolResponse): MsgCreateBalancerPoolResponseAmino { const obj: any = {}; diff --git a/packages/osmo-query/src/codegen/osmosis/gamm/pool-models/stableswap/stableswap_pool.ts b/packages/osmo-query/src/codegen/osmosis/gamm/poolmodels/stableswap/v1beta1/stableswap_pool.ts similarity index 86% rename from packages/osmo-query/src/codegen/osmosis/gamm/pool-models/stableswap/stableswap_pool.ts rename to packages/osmo-query/src/codegen/osmosis/gamm/poolmodels/stableswap/v1beta1/stableswap_pool.ts index cc9695e2a..415aef34c 100644 --- a/packages/osmo-query/src/codegen/osmosis/gamm/pool-models/stableswap/stableswap_pool.ts +++ b/packages/osmo-query/src/codegen/osmosis/gamm/poolmodels/stableswap/v1beta1/stableswap_pool.ts @@ -1,5 +1,5 @@ -import { Coin, CoinAmino, CoinSDKType } from "../../../../cosmos/base/v1beta1/coin"; -import { BinaryReader, BinaryWriter } from "../../../../binary"; +import { Coin, CoinAmino, CoinSDKType } from "../../../../../cosmos/base/v1beta1/coin"; +import { BinaryReader, BinaryWriter } from "../../../../../binary"; import { Decimal } from "@cosmjs/math"; /** * PoolParams defined the parameters that will be managed by the pool @@ -27,13 +27,13 @@ export interface PoolParamsProtoMsg { * The pool's token holders are specified in future_pool_governor. */ export interface PoolParamsAmino { - swap_fee: string; + swap_fee?: string; /** * N.B.: exit fee is disabled during pool creation in x/poolmanager. While old * pools can maintain a non-zero fee. No new pool can be created with non-zero * fee anymore */ - exit_fee: string; + exit_fee?: string; } export interface PoolParamsAminoMsg { type: "osmosis/gamm/StableswapPoolParams"; @@ -51,7 +51,7 @@ export interface PoolParamsSDKType { } /** Pool is the stableswap Pool struct */ export interface Pool { - $typeUrl?: string; + $typeUrl?: "/osmosis.gamm.poolmodels.stableswap.v1beta1.Pool"; address: string; id: bigint; poolParams: PoolParams; @@ -81,8 +81,8 @@ export interface PoolProtoMsg { } /** Pool is the stableswap Pool struct */ export interface PoolAmino { - address: string; - id: string; + address?: string; + id?: string; pool_params?: PoolParamsAmino; /** * This string specifies who will govern the pool in the future. @@ -94,15 +94,15 @@ export interface PoolAmino { * a time specified as 0w,1w,2w, etc. which specifies how long the token * would need to be locked up to count in governance. 0w means no lockup. */ - future_pool_governor: string; + future_pool_governor?: string; /** sum of all LP shares */ total_shares?: CoinAmino; /** assets in the pool */ - pool_liquidity: CoinAmino[]; + pool_liquidity?: CoinAmino[]; /** for calculation amognst assets with different precisions */ - scaling_factors: string[]; + scaling_factors?: string[]; /** scaling_factor_controller is the address can adjust pool scaling factors */ - scaling_factor_controller: string; + scaling_factor_controller?: string; } export interface PoolAminoMsg { type: "osmosis/gamm/StableswapPool"; @@ -110,7 +110,7 @@ export interface PoolAminoMsg { } /** Pool is the stableswap Pool struct */ export interface PoolSDKType { - $typeUrl?: string; + $typeUrl?: "/osmosis.gamm.poolmodels.stableswap.v1beta1.Pool"; address: string; id: bigint; pool_params: PoolParamsSDKType; @@ -164,10 +164,14 @@ export const PoolParams = { return message; }, fromAmino(object: PoolParamsAmino): PoolParams { - return { - swapFee: object.swap_fee, - exitFee: object.exit_fee - }; + const message = createBasePoolParams(); + if (object.swap_fee !== undefined && object.swap_fee !== null) { + message.swapFee = object.swap_fee; + } + if (object.exit_fee !== undefined && object.exit_fee !== null) { + message.exitFee = object.exit_fee; + } + return message; }, toAmino(message: PoolParams): PoolParamsAmino { const obj: any = {}; @@ -299,16 +303,28 @@ export const Pool = { return message; }, fromAmino(object: PoolAmino): Pool { - return { - address: object.address, - id: BigInt(object.id), - poolParams: object?.pool_params ? PoolParams.fromAmino(object.pool_params) : undefined, - futurePoolGovernor: object.future_pool_governor, - totalShares: object?.total_shares ? Coin.fromAmino(object.total_shares) : undefined, - poolLiquidity: Array.isArray(object?.pool_liquidity) ? object.pool_liquidity.map((e: any) => Coin.fromAmino(e)) : [], - scalingFactors: Array.isArray(object?.scaling_factors) ? object.scaling_factors.map((e: any) => BigInt(e)) : [], - scalingFactorController: object.scaling_factor_controller - }; + const message = createBasePool(); + if (object.address !== undefined && object.address !== null) { + message.address = object.address; + } + if (object.id !== undefined && object.id !== null) { + message.id = BigInt(object.id); + } + if (object.pool_params !== undefined && object.pool_params !== null) { + message.poolParams = PoolParams.fromAmino(object.pool_params); + } + if (object.future_pool_governor !== undefined && object.future_pool_governor !== null) { + message.futurePoolGovernor = object.future_pool_governor; + } + if (object.total_shares !== undefined && object.total_shares !== null) { + message.totalShares = Coin.fromAmino(object.total_shares); + } + message.poolLiquidity = object.pool_liquidity?.map(e => Coin.fromAmino(e)) || []; + message.scalingFactors = object.scaling_factors?.map(e => BigInt(e)) || []; + if (object.scaling_factor_controller !== undefined && object.scaling_factor_controller !== null) { + message.scalingFactorController = object.scaling_factor_controller; + } + return message; }, toAmino(message: Pool): PoolAmino { const obj: any = {}; diff --git a/packages/osmo-query/src/codegen/osmosis/gamm/pool-models/stableswap/tx.amino.ts b/packages/osmo-query/src/codegen/osmosis/gamm/poolmodels/stableswap/v1beta1/tx.amino.ts similarity index 100% rename from packages/osmo-query/src/codegen/osmosis/gamm/pool-models/stableswap/tx.amino.ts rename to packages/osmo-query/src/codegen/osmosis/gamm/poolmodels/stableswap/v1beta1/tx.amino.ts diff --git a/packages/osmo-query/src/codegen/osmosis/gamm/pool-models/stableswap/tx.registry.ts b/packages/osmo-query/src/codegen/osmosis/gamm/poolmodels/stableswap/v1beta1/tx.registry.ts similarity index 100% rename from packages/osmo-query/src/codegen/osmosis/gamm/pool-models/stableswap/tx.registry.ts rename to packages/osmo-query/src/codegen/osmosis/gamm/poolmodels/stableswap/v1beta1/tx.registry.ts diff --git a/packages/osmojs/src/codegen/osmosis/gamm/pool-models/stableswap/tx.rpc.msg.ts b/packages/osmo-query/src/codegen/osmosis/gamm/poolmodels/stableswap/v1beta1/tx.rpc.msg.ts similarity index 93% rename from packages/osmojs/src/codegen/osmosis/gamm/pool-models/stableswap/tx.rpc.msg.ts rename to packages/osmo-query/src/codegen/osmosis/gamm/poolmodels/stableswap/v1beta1/tx.rpc.msg.ts index 94f40063e..c54f18146 100644 --- a/packages/osmojs/src/codegen/osmosis/gamm/pool-models/stableswap/tx.rpc.msg.ts +++ b/packages/osmo-query/src/codegen/osmosis/gamm/poolmodels/stableswap/v1beta1/tx.rpc.msg.ts @@ -1,5 +1,5 @@ -import { Rpc } from "../../../../helpers"; -import { BinaryReader } from "../../../../binary"; +import { Rpc } from "../../../../../helpers"; +import { BinaryReader } from "../../../../../binary"; import { MsgCreateStableswapPool, MsgCreateStableswapPoolResponse, MsgStableSwapAdjustScalingFactors, MsgStableSwapAdjustScalingFactorsResponse } from "./tx"; export interface Msg { createStableswapPool(request: MsgCreateStableswapPool): Promise; diff --git a/packages/osmo-query/src/codegen/osmosis/gamm/pool-models/stableswap/tx.ts b/packages/osmo-query/src/codegen/osmosis/gamm/poolmodels/stableswap/v1beta1/tx.ts similarity index 89% rename from packages/osmo-query/src/codegen/osmosis/gamm/pool-models/stableswap/tx.ts rename to packages/osmo-query/src/codegen/osmosis/gamm/poolmodels/stableswap/v1beta1/tx.ts index d2dcc0230..0b716f2b5 100644 --- a/packages/osmo-query/src/codegen/osmosis/gamm/pool-models/stableswap/tx.ts +++ b/packages/osmo-query/src/codegen/osmosis/gamm/poolmodels/stableswap/v1beta1/tx.ts @@ -1,10 +1,10 @@ import { PoolParams, PoolParamsAmino, PoolParamsSDKType } from "./stableswap_pool"; -import { Coin, CoinAmino, CoinSDKType } from "../../../../cosmos/base/v1beta1/coin"; -import { BinaryReader, BinaryWriter } from "../../../../binary"; +import { Coin, CoinAmino, CoinSDKType } from "../../../../../cosmos/base/v1beta1/coin"; +import { BinaryReader, BinaryWriter } from "../../../../../binary"; /** ===================== MsgCreatePool */ export interface MsgCreateStableswapPool { sender: string; - poolParams: PoolParams; + poolParams?: PoolParams; initialPoolLiquidity: Coin[]; scalingFactors: bigint[]; futurePoolGovernor: string; @@ -16,12 +16,12 @@ export interface MsgCreateStableswapPoolProtoMsg { } /** ===================== MsgCreatePool */ export interface MsgCreateStableswapPoolAmino { - sender: string; + sender?: string; pool_params?: PoolParamsAmino; - initial_pool_liquidity: CoinAmino[]; - scaling_factors: string[]; - future_pool_governor: string; - scaling_factor_controller: string; + initial_pool_liquidity?: CoinAmino[]; + scaling_factors?: string[]; + future_pool_governor?: string; + scaling_factor_controller?: string; } export interface MsgCreateStableswapPoolAminoMsg { type: "osmosis/gamm/create-stableswap-pool"; @@ -30,7 +30,7 @@ export interface MsgCreateStableswapPoolAminoMsg { /** ===================== MsgCreatePool */ export interface MsgCreateStableswapPoolSDKType { sender: string; - pool_params: PoolParamsSDKType; + pool_params?: PoolParamsSDKType; initial_pool_liquidity: CoinSDKType[]; scaling_factors: bigint[]; future_pool_governor: string; @@ -46,7 +46,7 @@ export interface MsgCreateStableswapPoolResponseProtoMsg { } /** Returns a poolID with custom poolName. */ export interface MsgCreateStableswapPoolResponseAmino { - pool_id: string; + pool_id?: string; } export interface MsgCreateStableswapPoolResponseAminoMsg { type: "osmosis/gamm/create-stableswap-pool-response"; @@ -74,9 +74,9 @@ export interface MsgStableSwapAdjustScalingFactorsProtoMsg { * succeed. Adjusts stableswap scaling factors. */ export interface MsgStableSwapAdjustScalingFactorsAmino { - sender: string; - pool_id: string; - scaling_factors: string[]; + sender?: string; + pool_id?: string; + scaling_factors?: string[]; } export interface MsgStableSwapAdjustScalingFactorsAminoMsg { type: "osmosis/gamm/stableswap-adjust-scaling-factors"; @@ -105,7 +105,7 @@ export interface MsgStableSwapAdjustScalingFactorsResponseSDKType {} function createBaseMsgCreateStableswapPool(): MsgCreateStableswapPool { return { sender: "", - poolParams: PoolParams.fromPartial({}), + poolParams: undefined, initialPoolLiquidity: [], scalingFactors: [], futurePoolGovernor: "", @@ -187,14 +187,22 @@ export const MsgCreateStableswapPool = { return message; }, fromAmino(object: MsgCreateStableswapPoolAmino): MsgCreateStableswapPool { - return { - sender: object.sender, - poolParams: object?.pool_params ? PoolParams.fromAmino(object.pool_params) : undefined, - initialPoolLiquidity: Array.isArray(object?.initial_pool_liquidity) ? object.initial_pool_liquidity.map((e: any) => Coin.fromAmino(e)) : [], - scalingFactors: Array.isArray(object?.scaling_factors) ? object.scaling_factors.map((e: any) => BigInt(e)) : [], - futurePoolGovernor: object.future_pool_governor, - scalingFactorController: object.scaling_factor_controller - }; + const message = createBaseMsgCreateStableswapPool(); + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + if (object.pool_params !== undefined && object.pool_params !== null) { + message.poolParams = PoolParams.fromAmino(object.pool_params); + } + message.initialPoolLiquidity = object.initial_pool_liquidity?.map(e => Coin.fromAmino(e)) || []; + message.scalingFactors = object.scaling_factors?.map(e => BigInt(e)) || []; + if (object.future_pool_governor !== undefined && object.future_pool_governor !== null) { + message.futurePoolGovernor = object.future_pool_governor; + } + if (object.scaling_factor_controller !== undefined && object.scaling_factor_controller !== null) { + message.scalingFactorController = object.scaling_factor_controller; + } + return message; }, toAmino(message: MsgCreateStableswapPool): MsgCreateStableswapPoolAmino { const obj: any = {}; @@ -272,9 +280,11 @@ export const MsgCreateStableswapPoolResponse = { return message; }, fromAmino(object: MsgCreateStableswapPoolResponseAmino): MsgCreateStableswapPoolResponse { - return { - poolId: BigInt(object.pool_id) - }; + const message = createBaseMsgCreateStableswapPoolResponse(); + if (object.pool_id !== undefined && object.pool_id !== null) { + message.poolId = BigInt(object.pool_id); + } + return message; }, toAmino(message: MsgCreateStableswapPoolResponse): MsgCreateStableswapPoolResponseAmino { const obj: any = {}; @@ -364,11 +374,15 @@ export const MsgStableSwapAdjustScalingFactors = { return message; }, fromAmino(object: MsgStableSwapAdjustScalingFactorsAmino): MsgStableSwapAdjustScalingFactors { - return { - sender: object.sender, - poolId: BigInt(object.pool_id), - scalingFactors: Array.isArray(object?.scaling_factors) ? object.scaling_factors.map((e: any) => BigInt(e)) : [] - }; + const message = createBaseMsgStableSwapAdjustScalingFactors(); + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + if (object.pool_id !== undefined && object.pool_id !== null) { + message.poolId = BigInt(object.pool_id); + } + message.scalingFactors = object.scaling_factors?.map(e => BigInt(e)) || []; + return message; }, toAmino(message: MsgStableSwapAdjustScalingFactors): MsgStableSwapAdjustScalingFactorsAmino { const obj: any = {}; @@ -430,7 +444,8 @@ export const MsgStableSwapAdjustScalingFactorsResponse = { return message; }, fromAmino(_: MsgStableSwapAdjustScalingFactorsResponseAmino): MsgStableSwapAdjustScalingFactorsResponse { - return {}; + const message = createBaseMsgStableSwapAdjustScalingFactorsResponse(); + return message; }, toAmino(_: MsgStableSwapAdjustScalingFactorsResponse): MsgStableSwapAdjustScalingFactorsResponseAmino { const obj: any = {}; diff --git a/packages/osmo-query/src/codegen/osmosis/gamm/pool-models/balancer/balancerPool.ts b/packages/osmo-query/src/codegen/osmosis/gamm/v1beta1/balancerPool.ts similarity index 88% rename from packages/osmo-query/src/codegen/osmosis/gamm/pool-models/balancer/balancerPool.ts rename to packages/osmo-query/src/codegen/osmosis/gamm/v1beta1/balancerPool.ts index 753dc748c..5bb4b245b 100644 --- a/packages/osmo-query/src/codegen/osmosis/gamm/pool-models/balancer/balancerPool.ts +++ b/packages/osmo-query/src/codegen/osmosis/gamm/v1beta1/balancerPool.ts @@ -1,8 +1,8 @@ -import { Timestamp } from "../../../../google/protobuf/timestamp"; -import { Duration, DurationAmino, DurationSDKType } from "../../../../google/protobuf/duration"; -import { Coin, CoinAmino, CoinSDKType } from "../../../../cosmos/base/v1beta1/coin"; -import { BinaryReader, BinaryWriter } from "../../../../binary"; -import { toTimestamp, fromTimestamp } from "../../../../helpers"; +import { Timestamp } from "../../../google/protobuf/timestamp"; +import { Duration, DurationAmino, DurationSDKType } from "../../../google/protobuf/duration"; +import { Coin, CoinAmino, CoinSDKType } from "../../../cosmos/base/v1beta1/coin"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { toTimestamp, fromTimestamp } from "../../../helpers"; import { Decimal } from "@cosmjs/math"; /** * Parameters for changing the weights in a balancer pool smoothly from @@ -65,7 +65,7 @@ export interface SmoothWeightChangeParamsAmino { * If a parameter change / pool instantiation leaves this blank, * it should be generated by the state_machine as the current time. */ - start_time?: Date; + start_time?: string; /** Duration for the weights to change over */ duration?: DurationAmino; /** @@ -75,14 +75,14 @@ export interface SmoothWeightChangeParamsAmino { * future type refactorings should just have a type with the denom & weight * here. */ - initial_pool_weights: PoolAssetAmino[]; + initial_pool_weights?: PoolAssetAmino[]; /** * The target pool weights. The pool weights will change linearly with respect * to time between start_time, and start_time + duration. The amount * PoolAsset.token.amount field is ignored if present, future type * refactorings should just have a type with the denom & weight here. */ - target_pool_weights: PoolAssetAmino[]; + target_pool_weights?: PoolAssetAmino[]; } export interface SmoothWeightChangeParamsAminoMsg { type: "osmosis/gamm/smooth-weight-change-params"; @@ -134,13 +134,13 @@ export interface PoolParamsProtoMsg { * The pool's token holders are specified in future_pool_governor. */ export interface PoolParamsAmino { - swap_fee: string; + swap_fee?: string; /** * N.B.: exit fee is disabled during pool creation in x/poolmanager. While old * pools can maintain a non-zero fee. No new pool can be created with non-zero * fee anymore */ - exit_fee: string; + exit_fee?: string; smooth_weight_change_params?: SmoothWeightChangeParamsAmino; } export interface PoolParamsAminoMsg { @@ -190,7 +190,7 @@ export interface PoolAssetAmino { */ token?: CoinAmino; /** Weight that is not normalized. This weight must be less than 2^50 */ - weight: string; + weight?: string; } export interface PoolAssetAminoMsg { type: "osmosis/gamm/pool-asset"; @@ -207,7 +207,7 @@ export interface PoolAssetSDKType { weight: string; } export interface Pool { - $typeUrl?: string; + $typeUrl?: "/osmosis.gamm.v1beta1.Pool"; address: string; id: bigint; poolParams: PoolParams; @@ -238,8 +238,8 @@ export interface PoolProtoMsg { value: Uint8Array; } export interface PoolAmino { - address: string; - id: string; + address?: string; + id?: string; pool_params?: PoolParamsAmino; /** * This string specifies who will govern the pool in the future. @@ -252,23 +252,23 @@ export interface PoolAmino { * would need to be locked up to count in governance. 0w means no lockup. * TODO: Further improve these docs */ - future_pool_governor: string; + future_pool_governor?: string; /** sum of all LP tokens sent out */ total_shares?: CoinAmino; /** * These are assumed to be sorted by denomiation. * They contain the pool asset and the information about the weight */ - pool_assets: PoolAssetAmino[]; + pool_assets?: PoolAssetAmino[]; /** sum of all non-normalized pool weights */ - total_weight: string; + total_weight?: string; } export interface PoolAminoMsg { type: "osmosis/gamm/BalancerPool"; value: PoolAmino; } export interface PoolSDKType { - $typeUrl?: string; + $typeUrl?: "/osmosis.gamm.v1beta1.Pool"; address: string; id: bigint; pool_params: PoolParamsSDKType; @@ -337,16 +337,20 @@ export const SmoothWeightChangeParams = { return message; }, fromAmino(object: SmoothWeightChangeParamsAmino): SmoothWeightChangeParams { - return { - startTime: object.start_time, - duration: object?.duration ? Duration.fromAmino(object.duration) : undefined, - initialPoolWeights: Array.isArray(object?.initial_pool_weights) ? object.initial_pool_weights.map((e: any) => PoolAsset.fromAmino(e)) : [], - targetPoolWeights: Array.isArray(object?.target_pool_weights) ? object.target_pool_weights.map((e: any) => PoolAsset.fromAmino(e)) : [] - }; + const message = createBaseSmoothWeightChangeParams(); + if (object.start_time !== undefined && object.start_time !== null) { + message.startTime = fromTimestamp(Timestamp.fromAmino(object.start_time)); + } + if (object.duration !== undefined && object.duration !== null) { + message.duration = Duration.fromAmino(object.duration); + } + message.initialPoolWeights = object.initial_pool_weights?.map(e => PoolAsset.fromAmino(e)) || []; + message.targetPoolWeights = object.target_pool_weights?.map(e => PoolAsset.fromAmino(e)) || []; + return message; }, toAmino(message: SmoothWeightChangeParams): SmoothWeightChangeParamsAmino { const obj: any = {}; - obj.start_time = message.startTime; + obj.start_time = message.startTime ? Timestamp.toAmino(toTimestamp(message.startTime)) : undefined; obj.duration = message.duration ? Duration.toAmino(message.duration) : undefined; if (message.initialPoolWeights) { obj.initial_pool_weights = message.initialPoolWeights.map(e => e ? PoolAsset.toAmino(e) : undefined); @@ -434,11 +438,17 @@ export const PoolParams = { return message; }, fromAmino(object: PoolParamsAmino): PoolParams { - return { - swapFee: object.swap_fee, - exitFee: object.exit_fee, - smoothWeightChangeParams: object?.smooth_weight_change_params ? SmoothWeightChangeParams.fromAmino(object.smooth_weight_change_params) : undefined - }; + const message = createBasePoolParams(); + if (object.swap_fee !== undefined && object.swap_fee !== null) { + message.swapFee = object.swap_fee; + } + if (object.exit_fee !== undefined && object.exit_fee !== null) { + message.exitFee = object.exit_fee; + } + if (object.smooth_weight_change_params !== undefined && object.smooth_weight_change_params !== null) { + message.smoothWeightChangeParams = SmoothWeightChangeParams.fromAmino(object.smooth_weight_change_params); + } + return message; }, toAmino(message: PoolParams): PoolParamsAmino { const obj: any = {}; @@ -513,10 +523,14 @@ export const PoolAsset = { return message; }, fromAmino(object: PoolAssetAmino): PoolAsset { - return { - token: object?.token ? Coin.fromAmino(object.token) : undefined, - weight: object.weight - }; + const message = createBasePoolAsset(); + if (object.token !== undefined && object.token !== null) { + message.token = Coin.fromAmino(object.token); + } + if (object.weight !== undefined && object.weight !== null) { + message.weight = object.weight; + } + return message; }, toAmino(message: PoolAsset): PoolAssetAmino { const obj: any = {}; @@ -631,15 +645,27 @@ export const Pool = { return message; }, fromAmino(object: PoolAmino): Pool { - return { - address: object.address, - id: BigInt(object.id), - poolParams: object?.pool_params ? PoolParams.fromAmino(object.pool_params) : undefined, - futurePoolGovernor: object.future_pool_governor, - totalShares: object?.total_shares ? Coin.fromAmino(object.total_shares) : undefined, - poolAssets: Array.isArray(object?.pool_assets) ? object.pool_assets.map((e: any) => PoolAsset.fromAmino(e)) : [], - totalWeight: object.total_weight - }; + const message = createBasePool(); + if (object.address !== undefined && object.address !== null) { + message.address = object.address; + } + if (object.id !== undefined && object.id !== null) { + message.id = BigInt(object.id); + } + if (object.pool_params !== undefined && object.pool_params !== null) { + message.poolParams = PoolParams.fromAmino(object.pool_params); + } + if (object.future_pool_governor !== undefined && object.future_pool_governor !== null) { + message.futurePoolGovernor = object.future_pool_governor; + } + if (object.total_shares !== undefined && object.total_shares !== null) { + message.totalShares = Coin.fromAmino(object.total_shares); + } + message.poolAssets = object.pool_assets?.map(e => PoolAsset.fromAmino(e)) || []; + if (object.total_weight !== undefined && object.total_weight !== null) { + message.totalWeight = object.total_weight; + } + return message; }, toAmino(message: Pool): PoolAmino { const obj: any = {}; diff --git a/packages/osmo-query/src/codegen/osmosis/gamm/v1beta1/genesis.ts b/packages/osmo-query/src/codegen/osmosis/gamm/v1beta1/genesis.ts index 0c6a0da1b..1ddf4ce1d 100644 --- a/packages/osmo-query/src/codegen/osmosis/gamm/v1beta1/genesis.ts +++ b/packages/osmo-query/src/codegen/osmosis/gamm/v1beta1/genesis.ts @@ -1,16 +1,16 @@ import { Coin, CoinAmino, CoinSDKType } from "../../../cosmos/base/v1beta1/coin"; import { Any, AnyProtoMsg, AnyAmino, AnySDKType } from "../../../google/protobuf/any"; import { MigrationRecords, MigrationRecordsAmino, MigrationRecordsSDKType } from "./shared"; -import { Pool as Pool1 } from "../../concentrated-liquidity/pool"; -import { PoolProtoMsg as Pool1ProtoMsg } from "../../concentrated-liquidity/pool"; -import { PoolSDKType as Pool1SDKType } from "../../concentrated-liquidity/pool"; +import { Pool as Pool1 } from "../../concentratedliquidity/v1beta1/pool"; +import { PoolProtoMsg as Pool1ProtoMsg } from "../../concentratedliquidity/v1beta1/pool"; +import { PoolSDKType as Pool1SDKType } from "../../concentratedliquidity/v1beta1/pool"; import { CosmWasmPool, CosmWasmPoolProtoMsg, CosmWasmPoolSDKType } from "../../cosmwasmpool/v1beta1/model/pool"; -import { Pool as Pool2 } from "../pool-models/balancer/balancerPool"; -import { PoolProtoMsg as Pool2ProtoMsg } from "../pool-models/balancer/balancerPool"; -import { PoolSDKType as Pool2SDKType } from "../pool-models/balancer/balancerPool"; -import { Pool as Pool3 } from "../pool-models/stableswap/stableswap_pool"; -import { PoolProtoMsg as Pool3ProtoMsg } from "../pool-models/stableswap/stableswap_pool"; -import { PoolSDKType as Pool3SDKType } from "../pool-models/stableswap/stableswap_pool"; +import { Pool as Pool2 } from "../poolmodels/stableswap/v1beta1/stableswap_pool"; +import { PoolProtoMsg as Pool2ProtoMsg } from "../poolmodels/stableswap/v1beta1/stableswap_pool"; +import { PoolSDKType as Pool2SDKType } from "../poolmodels/stableswap/v1beta1/stableswap_pool"; +import { Pool as Pool3 } from "./balancerPool"; +import { PoolProtoMsg as Pool3ProtoMsg } from "./balancerPool"; +import { PoolSDKType as Pool3SDKType } from "./balancerPool"; import { BinaryReader, BinaryWriter } from "../../../binary"; /** Params holds parameters for the incentives module */ export interface Params { @@ -22,7 +22,7 @@ export interface ParamsProtoMsg { } /** Params holds parameters for the incentives module */ export interface ParamsAmino { - pool_creation_fee: CoinAmino[]; + pool_creation_fee?: CoinAmino[]; } export interface ParamsAminoMsg { type: "osmosis/gamm/params"; @@ -38,7 +38,7 @@ export interface GenesisState { /** will be renamed to next_pool_id in an upcoming version */ nextPoolNumber: bigint; params: Params; - migrationRecords: MigrationRecords; + migrationRecords?: MigrationRecords; } export interface GenesisStateProtoMsg { typeUrl: "/osmosis.gamm.v1beta1.GenesisState"; @@ -49,9 +49,9 @@ export type GenesisStateEncoded = Omit & { }; /** GenesisState defines the gamm module's genesis state. */ export interface GenesisStateAmino { - pools: AnyAmino[]; + pools?: AnyAmino[]; /** will be renamed to next_pool_id in an upcoming version */ - next_pool_number: string; + next_pool_number?: string; params?: ParamsAmino; migration_records?: MigrationRecordsAmino; } @@ -64,7 +64,7 @@ export interface GenesisStateSDKType { pools: (Pool1SDKType | CosmWasmPoolSDKType | Pool2SDKType | Pool3SDKType | AnySDKType)[]; next_pool_number: bigint; params: ParamsSDKType; - migration_records: MigrationRecordsSDKType; + migration_records?: MigrationRecordsSDKType; } function createBaseParams(): Params { return { @@ -102,9 +102,9 @@ export const Params = { return message; }, fromAmino(object: ParamsAmino): Params { - return { - poolCreationFee: Array.isArray(object?.pool_creation_fee) ? object.pool_creation_fee.map((e: any) => Coin.fromAmino(e)) : [] - }; + const message = createBaseParams(); + message.poolCreationFee = object.pool_creation_fee?.map(e => Coin.fromAmino(e)) || []; + return message; }, toAmino(message: Params): ParamsAmino { const obj: any = {}; @@ -142,7 +142,7 @@ function createBaseGenesisState(): GenesisState { pools: [], nextPoolNumber: BigInt(0), params: Params.fromPartial({}), - migrationRecords: MigrationRecords.fromPartial({}) + migrationRecords: undefined }; } export const GenesisState = { @@ -170,7 +170,7 @@ export const GenesisState = { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.pools.push((PoolI_InterfaceDecoder(reader) as Any)); + message.pools.push((Any(reader) as Any)); break; case 2: message.nextPoolNumber = reader.uint64(); @@ -197,12 +197,18 @@ export const GenesisState = { return message; }, fromAmino(object: GenesisStateAmino): GenesisState { - return { - pools: Array.isArray(object?.pools) ? object.pools.map((e: any) => PoolI_FromAmino(e)) : [], - nextPoolNumber: BigInt(object.next_pool_number), - params: object?.params ? Params.fromAmino(object.params) : undefined, - migrationRecords: object?.migration_records ? MigrationRecords.fromAmino(object.migration_records) : undefined - }; + const message = createBaseGenesisState(); + message.pools = object.pools?.map(e => PoolI_FromAmino(e)) || []; + if (object.next_pool_number !== undefined && object.next_pool_number !== null) { + message.nextPoolNumber = BigInt(object.next_pool_number); + } + if (object.params !== undefined && object.params !== null) { + message.params = Params.fromAmino(object.params); + } + if (object.migration_records !== undefined && object.migration_records !== null) { + message.migrationRecords = MigrationRecords.fromAmino(object.migration_records); + } + return message; }, toAmino(message: GenesisState): GenesisStateAmino { const obj: any = {}; @@ -240,16 +246,16 @@ export const GenesisState = { }; export const PoolI_InterfaceDecoder = (input: BinaryReader | Uint8Array): Pool1 | CosmWasmPool | Pool2 | Pool3 | Any => { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - const data = Any.decode(reader, reader.uint32()); + const data = Any.decode(reader, reader.uint32(), true); switch (data.typeUrl) { case "/osmosis.concentratedliquidity.v1beta1.Pool": - return Pool1.decode(data.value); + return Pool1.decode(data.value, undefined, true); case "/osmosis.cosmwasmpool.v1beta1.CosmWasmPool": - return CosmWasmPool.decode(data.value); - case "/osmosis.gamm.v1beta1.Pool": - return Pool2.decode(data.value); + return CosmWasmPool.decode(data.value, undefined, true); case "/osmosis.gamm.poolmodels.stableswap.v1beta1.Pool": - return Pool3.decode(data.value); + return Pool2.decode(data.value, undefined, true); + case "/osmosis.gamm.v1beta1.Pool": + return Pool3.decode(data.value, undefined, true); default: return data; } @@ -266,14 +272,14 @@ export const PoolI_FromAmino = (content: AnyAmino) => { typeUrl: "/osmosis.cosmwasmpool.v1beta1.CosmWasmPool", value: CosmWasmPool.encode(CosmWasmPool.fromPartial(CosmWasmPool.fromAmino(content.value))).finish() }); - case "osmosis/gamm/BalancerPool": + case "osmosis/gamm/StableswapPool": return Any.fromPartial({ - typeUrl: "/osmosis.gamm.v1beta1.Pool", + typeUrl: "/osmosis.gamm.poolmodels.stableswap.v1beta1.Pool", value: Pool2.encode(Pool2.fromPartial(Pool2.fromAmino(content.value))).finish() }); - case "osmosis/gamm/StableswapPool": + case "osmosis/gamm/BalancerPool": return Any.fromPartial({ - typeUrl: "/osmosis.gamm.poolmodels.stableswap.v1beta1.Pool", + typeUrl: "/osmosis.gamm.v1beta1.Pool", value: Pool3.encode(Pool3.fromPartial(Pool3.fromAmino(content.value))).finish() }); default: @@ -285,22 +291,22 @@ export const PoolI_ToAmino = (content: Any) => { case "/osmosis.concentratedliquidity.v1beta1.Pool": return { type: "osmosis/concentratedliquidity/pool", - value: Pool1.toAmino(Pool1.decode(content.value)) + value: Pool1.toAmino(Pool1.decode(content.value, undefined)) }; case "/osmosis.cosmwasmpool.v1beta1.CosmWasmPool": return { type: "osmosis/cosmwasmpool/cosm-wasm-pool", - value: CosmWasmPool.toAmino(CosmWasmPool.decode(content.value)) - }; - case "/osmosis.gamm.v1beta1.Pool": - return { - type: "osmosis/gamm/BalancerPool", - value: Pool2.toAmino(Pool2.decode(content.value)) + value: CosmWasmPool.toAmino(CosmWasmPool.decode(content.value, undefined)) }; case "/osmosis.gamm.poolmodels.stableswap.v1beta1.Pool": return { type: "osmosis/gamm/StableswapPool", - value: Pool3.toAmino(Pool3.decode(content.value)) + value: Pool2.toAmino(Pool2.decode(content.value, undefined)) + }; + case "/osmosis.gamm.v1beta1.Pool": + return { + type: "osmosis/gamm/BalancerPool", + value: Pool3.toAmino(Pool3.decode(content.value, undefined)) }; default: return Any.toAmino(content); diff --git a/packages/osmo-query/src/codegen/osmosis/gamm/v1beta1/gov.ts b/packages/osmo-query/src/codegen/osmosis/gamm/v1beta1/gov.ts index ea11c5f81..b15dd31e9 100644 --- a/packages/osmo-query/src/codegen/osmosis/gamm/v1beta1/gov.ts +++ b/packages/osmo-query/src/codegen/osmosis/gamm/v1beta1/gov.ts @@ -1,5 +1,6 @@ import { BalancerToConcentratedPoolLink, BalancerToConcentratedPoolLinkAmino, BalancerToConcentratedPoolLinkSDKType } from "./shared"; import { BinaryReader, BinaryWriter } from "../../../binary"; +import { Decimal } from "@cosmjs/math"; /** * ReplaceMigrationRecordsProposal is a gov Content type for updating the * migration records. If a ReplaceMigrationRecordsProposal passes, the @@ -8,7 +9,7 @@ import { BinaryReader, BinaryWriter } from "../../../binary"; * a single concentrated pool. */ export interface ReplaceMigrationRecordsProposal { - $typeUrl?: string; + $typeUrl?: "/osmosis.gamm.v1beta1.ReplaceMigrationRecordsProposal"; title: string; description: string; records: BalancerToConcentratedPoolLink[]; @@ -25,9 +26,9 @@ export interface ReplaceMigrationRecordsProposalProtoMsg { * a single concentrated pool. */ export interface ReplaceMigrationRecordsProposalAmino { - title: string; - description: string; - records: BalancerToConcentratedPoolLinkAmino[]; + title?: string; + description?: string; + records?: BalancerToConcentratedPoolLinkAmino[]; } export interface ReplaceMigrationRecordsProposalAminoMsg { type: "osmosis/ReplaceMigrationRecordsProposal"; @@ -41,7 +42,7 @@ export interface ReplaceMigrationRecordsProposalAminoMsg { * a single concentrated pool. */ export interface ReplaceMigrationRecordsProposalSDKType { - $typeUrl?: string; + $typeUrl?: "/osmosis.gamm.v1beta1.ReplaceMigrationRecordsProposal"; title: string; description: string; records: BalancerToConcentratedPoolLinkSDKType[]; @@ -57,7 +58,7 @@ export interface ReplaceMigrationRecordsProposalSDKType { * [(Balancer 1, CL 5), (Balancer 3, CL 4), (Balancer 4, CL 10)] */ export interface UpdateMigrationRecordsProposal { - $typeUrl?: string; + $typeUrl?: "/osmosis.gamm.v1beta1.UpdateMigrationRecordsProposal"; title: string; description: string; records: BalancerToConcentratedPoolLink[]; @@ -77,9 +78,9 @@ export interface UpdateMigrationRecordsProposalProtoMsg { * [(Balancer 1, CL 5), (Balancer 3, CL 4), (Balancer 4, CL 10)] */ export interface UpdateMigrationRecordsProposalAmino { - title: string; - description: string; - records: BalancerToConcentratedPoolLinkAmino[]; + title?: string; + description?: string; + records?: BalancerToConcentratedPoolLinkAmino[]; } export interface UpdateMigrationRecordsProposalAminoMsg { type: "osmosis/UpdateMigrationRecordsProposal"; @@ -96,11 +97,120 @@ export interface UpdateMigrationRecordsProposalAminoMsg { * [(Balancer 1, CL 5), (Balancer 3, CL 4), (Balancer 4, CL 10)] */ export interface UpdateMigrationRecordsProposalSDKType { - $typeUrl?: string; + $typeUrl?: "/osmosis.gamm.v1beta1.UpdateMigrationRecordsProposal"; title: string; description: string; records: BalancerToConcentratedPoolLinkSDKType[]; } +export interface PoolRecordWithCFMMLink { + denom0: string; + denom1: string; + tickSpacing: bigint; + exponentAtPriceOne: string; + spreadFactor: string; + balancerPoolId: bigint; +} +export interface PoolRecordWithCFMMLinkProtoMsg { + typeUrl: "/osmosis.gamm.v1beta1.PoolRecordWithCFMMLink"; + value: Uint8Array; +} +export interface PoolRecordWithCFMMLinkAmino { + denom0?: string; + denom1?: string; + tick_spacing?: string; + exponent_at_price_one?: string; + spread_factor?: string; + balancer_pool_id?: string; +} +export interface PoolRecordWithCFMMLinkAminoMsg { + type: "osmosis/gamm/pool-record-with-cfmm-link"; + value: PoolRecordWithCFMMLinkAmino; +} +export interface PoolRecordWithCFMMLinkSDKType { + denom0: string; + denom1: string; + tick_spacing: bigint; + exponent_at_price_one: string; + spread_factor: string; + balancer_pool_id: bigint; +} +/** + * CreateConcentratedLiquidityPoolsAndLinktoCFMMProposal is a gov Content type + * for creating concentrated liquidity pools and linking it to a CFMM pool. + */ +export interface CreateConcentratedLiquidityPoolsAndLinktoCFMMProposal { + $typeUrl?: "/osmosis.gamm.v1beta1.CreateConcentratedLiquidityPoolsAndLinktoCFMMProposal"; + title: string; + description: string; + poolRecordsWithCfmmLink: PoolRecordWithCFMMLink[]; +} +export interface CreateConcentratedLiquidityPoolsAndLinktoCFMMProposalProtoMsg { + typeUrl: "/osmosis.gamm.v1beta1.CreateConcentratedLiquidityPoolsAndLinktoCFMMProposal"; + value: Uint8Array; +} +/** + * CreateConcentratedLiquidityPoolsAndLinktoCFMMProposal is a gov Content type + * for creating concentrated liquidity pools and linking it to a CFMM pool. + */ +export interface CreateConcentratedLiquidityPoolsAndLinktoCFMMProposalAmino { + title?: string; + description?: string; + pool_records_with_cfmm_link?: PoolRecordWithCFMMLinkAmino[]; +} +export interface CreateConcentratedLiquidityPoolsAndLinktoCFMMProposalAminoMsg { + type: "osmosis/CreateConcentratedLiquidityPoolsAndLinktoCFMMProposal"; + value: CreateConcentratedLiquidityPoolsAndLinktoCFMMProposalAmino; +} +/** + * CreateConcentratedLiquidityPoolsAndLinktoCFMMProposal is a gov Content type + * for creating concentrated liquidity pools and linking it to a CFMM pool. + */ +export interface CreateConcentratedLiquidityPoolsAndLinktoCFMMProposalSDKType { + $typeUrl?: "/osmosis.gamm.v1beta1.CreateConcentratedLiquidityPoolsAndLinktoCFMMProposal"; + title: string; + description: string; + pool_records_with_cfmm_link: PoolRecordWithCFMMLinkSDKType[]; +} +/** + * SetScalingFactorControllerProposal is a gov Content type for updating the + * scaling factor controller address of a stableswap pool + */ +export interface SetScalingFactorControllerProposal { + $typeUrl?: "/osmosis.gamm.v1beta1.SetScalingFactorControllerProposal"; + title: string; + description: string; + poolId: bigint; + controllerAddress: string; +} +export interface SetScalingFactorControllerProposalProtoMsg { + typeUrl: "/osmosis.gamm.v1beta1.SetScalingFactorControllerProposal"; + value: Uint8Array; +} +/** + * SetScalingFactorControllerProposal is a gov Content type for updating the + * scaling factor controller address of a stableswap pool + */ +export interface SetScalingFactorControllerProposalAmino { + title?: string; + description?: string; + pool_id?: string; + controller_address?: string; +} +export interface SetScalingFactorControllerProposalAminoMsg { + type: "osmosis/SetScalingFactorControllerProposal"; + value: SetScalingFactorControllerProposalAmino; +} +/** + * SetScalingFactorControllerProposal is a gov Content type for updating the + * scaling factor controller address of a stableswap pool + */ +export interface SetScalingFactorControllerProposalSDKType { + $typeUrl?: "/osmosis.gamm.v1beta1.SetScalingFactorControllerProposal"; + title: string; + description: string; + pool_id: bigint; + controller_address: string; +} function createBaseReplaceMigrationRecordsProposal(): ReplaceMigrationRecordsProposal { return { $typeUrl: "/osmosis.gamm.v1beta1.ReplaceMigrationRecordsProposal", @@ -154,11 +264,15 @@ export const ReplaceMigrationRecordsProposal = { return message; }, fromAmino(object: ReplaceMigrationRecordsProposalAmino): ReplaceMigrationRecordsProposal { - return { - title: object.title, - description: object.description, - records: Array.isArray(object?.records) ? object.records.map((e: any) => BalancerToConcentratedPoolLink.fromAmino(e)) : [] - }; + const message = createBaseReplaceMigrationRecordsProposal(); + if (object.title !== undefined && object.title !== null) { + message.title = object.title; + } + if (object.description !== undefined && object.description !== null) { + message.description = object.description; + } + message.records = object.records?.map(e => BalancerToConcentratedPoolLink.fromAmino(e)) || []; + return message; }, toAmino(message: ReplaceMigrationRecordsProposal): ReplaceMigrationRecordsProposalAmino { const obj: any = {}; @@ -246,11 +360,15 @@ export const UpdateMigrationRecordsProposal = { return message; }, fromAmino(object: UpdateMigrationRecordsProposalAmino): UpdateMigrationRecordsProposal { - return { - title: object.title, - description: object.description, - records: Array.isArray(object?.records) ? object.records.map((e: any) => BalancerToConcentratedPoolLink.fromAmino(e)) : [] - }; + const message = createBaseUpdateMigrationRecordsProposal(); + if (object.title !== undefined && object.title !== null) { + message.title = object.title; + } + if (object.description !== undefined && object.description !== null) { + message.description = object.description; + } + message.records = object.records?.map(e => BalancerToConcentratedPoolLink.fromAmino(e)) || []; + return message; }, toAmino(message: UpdateMigrationRecordsProposal): UpdateMigrationRecordsProposalAmino { const obj: any = {}; @@ -284,4 +402,335 @@ export const UpdateMigrationRecordsProposal = { value: UpdateMigrationRecordsProposal.encode(message).finish() }; } +}; +function createBasePoolRecordWithCFMMLink(): PoolRecordWithCFMMLink { + return { + denom0: "", + denom1: "", + tickSpacing: BigInt(0), + exponentAtPriceOne: "", + spreadFactor: "", + balancerPoolId: BigInt(0) + }; +} +export const PoolRecordWithCFMMLink = { + typeUrl: "/osmosis.gamm.v1beta1.PoolRecordWithCFMMLink", + encode(message: PoolRecordWithCFMMLink, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.denom0 !== "") { + writer.uint32(10).string(message.denom0); + } + if (message.denom1 !== "") { + writer.uint32(18).string(message.denom1); + } + if (message.tickSpacing !== BigInt(0)) { + writer.uint32(24).uint64(message.tickSpacing); + } + if (message.exponentAtPriceOne !== "") { + writer.uint32(34).string(message.exponentAtPriceOne); + } + if (message.spreadFactor !== "") { + writer.uint32(42).string(Decimal.fromUserInput(message.spreadFactor, 18).atomics); + } + if (message.balancerPoolId !== BigInt(0)) { + writer.uint32(48).uint64(message.balancerPoolId); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): PoolRecordWithCFMMLink { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBasePoolRecordWithCFMMLink(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.denom0 = reader.string(); + break; + case 2: + message.denom1 = reader.string(); + break; + case 3: + message.tickSpacing = reader.uint64(); + break; + case 4: + message.exponentAtPriceOne = reader.string(); + break; + case 5: + message.spreadFactor = Decimal.fromAtomics(reader.string(), 18).toString(); + break; + case 6: + message.balancerPoolId = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): PoolRecordWithCFMMLink { + const message = createBasePoolRecordWithCFMMLink(); + message.denom0 = object.denom0 ?? ""; + message.denom1 = object.denom1 ?? ""; + message.tickSpacing = object.tickSpacing !== undefined && object.tickSpacing !== null ? BigInt(object.tickSpacing.toString()) : BigInt(0); + message.exponentAtPriceOne = object.exponentAtPriceOne ?? ""; + message.spreadFactor = object.spreadFactor ?? ""; + message.balancerPoolId = object.balancerPoolId !== undefined && object.balancerPoolId !== null ? BigInt(object.balancerPoolId.toString()) : BigInt(0); + return message; + }, + fromAmino(object: PoolRecordWithCFMMLinkAmino): PoolRecordWithCFMMLink { + const message = createBasePoolRecordWithCFMMLink(); + if (object.denom0 !== undefined && object.denom0 !== null) { + message.denom0 = object.denom0; + } + if (object.denom1 !== undefined && object.denom1 !== null) { + message.denom1 = object.denom1; + } + if (object.tick_spacing !== undefined && object.tick_spacing !== null) { + message.tickSpacing = BigInt(object.tick_spacing); + } + if (object.exponent_at_price_one !== undefined && object.exponent_at_price_one !== null) { + message.exponentAtPriceOne = object.exponent_at_price_one; + } + if (object.spread_factor !== undefined && object.spread_factor !== null) { + message.spreadFactor = object.spread_factor; + } + if (object.balancer_pool_id !== undefined && object.balancer_pool_id !== null) { + message.balancerPoolId = BigInt(object.balancer_pool_id); + } + return message; + }, + toAmino(message: PoolRecordWithCFMMLink): PoolRecordWithCFMMLinkAmino { + const obj: any = {}; + obj.denom0 = message.denom0; + obj.denom1 = message.denom1; + obj.tick_spacing = message.tickSpacing ? message.tickSpacing.toString() : undefined; + obj.exponent_at_price_one = message.exponentAtPriceOne; + obj.spread_factor = message.spreadFactor; + obj.balancer_pool_id = message.balancerPoolId ? message.balancerPoolId.toString() : undefined; + return obj; + }, + fromAminoMsg(object: PoolRecordWithCFMMLinkAminoMsg): PoolRecordWithCFMMLink { + return PoolRecordWithCFMMLink.fromAmino(object.value); + }, + toAminoMsg(message: PoolRecordWithCFMMLink): PoolRecordWithCFMMLinkAminoMsg { + return { + type: "osmosis/gamm/pool-record-with-cfmm-link", + value: PoolRecordWithCFMMLink.toAmino(message) + }; + }, + fromProtoMsg(message: PoolRecordWithCFMMLinkProtoMsg): PoolRecordWithCFMMLink { + return PoolRecordWithCFMMLink.decode(message.value); + }, + toProto(message: PoolRecordWithCFMMLink): Uint8Array { + return PoolRecordWithCFMMLink.encode(message).finish(); + }, + toProtoMsg(message: PoolRecordWithCFMMLink): PoolRecordWithCFMMLinkProtoMsg { + return { + typeUrl: "/osmosis.gamm.v1beta1.PoolRecordWithCFMMLink", + value: PoolRecordWithCFMMLink.encode(message).finish() + }; + } +}; +function createBaseCreateConcentratedLiquidityPoolsAndLinktoCFMMProposal(): CreateConcentratedLiquidityPoolsAndLinktoCFMMProposal { + return { + $typeUrl: "/osmosis.gamm.v1beta1.CreateConcentratedLiquidityPoolsAndLinktoCFMMProposal", + title: "", + description: "", + poolRecordsWithCfmmLink: [] + }; +} +export const CreateConcentratedLiquidityPoolsAndLinktoCFMMProposal = { + typeUrl: "/osmosis.gamm.v1beta1.CreateConcentratedLiquidityPoolsAndLinktoCFMMProposal", + encode(message: CreateConcentratedLiquidityPoolsAndLinktoCFMMProposal, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.title !== "") { + writer.uint32(10).string(message.title); + } + if (message.description !== "") { + writer.uint32(18).string(message.description); + } + for (const v of message.poolRecordsWithCfmmLink) { + PoolRecordWithCFMMLink.encode(v!, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): CreateConcentratedLiquidityPoolsAndLinktoCFMMProposal { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseCreateConcentratedLiquidityPoolsAndLinktoCFMMProposal(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.title = reader.string(); + break; + case 2: + message.description = reader.string(); + break; + case 3: + message.poolRecordsWithCfmmLink.push(PoolRecordWithCFMMLink.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): CreateConcentratedLiquidityPoolsAndLinktoCFMMProposal { + const message = createBaseCreateConcentratedLiquidityPoolsAndLinktoCFMMProposal(); + message.title = object.title ?? ""; + message.description = object.description ?? ""; + message.poolRecordsWithCfmmLink = object.poolRecordsWithCfmmLink?.map(e => PoolRecordWithCFMMLink.fromPartial(e)) || []; + return message; + }, + fromAmino(object: CreateConcentratedLiquidityPoolsAndLinktoCFMMProposalAmino): CreateConcentratedLiquidityPoolsAndLinktoCFMMProposal { + const message = createBaseCreateConcentratedLiquidityPoolsAndLinktoCFMMProposal(); + if (object.title !== undefined && object.title !== null) { + message.title = object.title; + } + if (object.description !== undefined && object.description !== null) { + message.description = object.description; + } + message.poolRecordsWithCfmmLink = object.pool_records_with_cfmm_link?.map(e => PoolRecordWithCFMMLink.fromAmino(e)) || []; + return message; + }, + toAmino(message: CreateConcentratedLiquidityPoolsAndLinktoCFMMProposal): CreateConcentratedLiquidityPoolsAndLinktoCFMMProposalAmino { + const obj: any = {}; + obj.title = message.title; + obj.description = message.description; + if (message.poolRecordsWithCfmmLink) { + obj.pool_records_with_cfmm_link = message.poolRecordsWithCfmmLink.map(e => e ? PoolRecordWithCFMMLink.toAmino(e) : undefined); + } else { + obj.pool_records_with_cfmm_link = []; + } + return obj; + }, + fromAminoMsg(object: CreateConcentratedLiquidityPoolsAndLinktoCFMMProposalAminoMsg): CreateConcentratedLiquidityPoolsAndLinktoCFMMProposal { + return CreateConcentratedLiquidityPoolsAndLinktoCFMMProposal.fromAmino(object.value); + }, + toAminoMsg(message: CreateConcentratedLiquidityPoolsAndLinktoCFMMProposal): CreateConcentratedLiquidityPoolsAndLinktoCFMMProposalAminoMsg { + return { + type: "osmosis/CreateConcentratedLiquidityPoolsAndLinktoCFMMProposal", + value: CreateConcentratedLiquidityPoolsAndLinktoCFMMProposal.toAmino(message) + }; + }, + fromProtoMsg(message: CreateConcentratedLiquidityPoolsAndLinktoCFMMProposalProtoMsg): CreateConcentratedLiquidityPoolsAndLinktoCFMMProposal { + return CreateConcentratedLiquidityPoolsAndLinktoCFMMProposal.decode(message.value); + }, + toProto(message: CreateConcentratedLiquidityPoolsAndLinktoCFMMProposal): Uint8Array { + return CreateConcentratedLiquidityPoolsAndLinktoCFMMProposal.encode(message).finish(); + }, + toProtoMsg(message: CreateConcentratedLiquidityPoolsAndLinktoCFMMProposal): CreateConcentratedLiquidityPoolsAndLinktoCFMMProposalProtoMsg { + return { + typeUrl: "/osmosis.gamm.v1beta1.CreateConcentratedLiquidityPoolsAndLinktoCFMMProposal", + value: CreateConcentratedLiquidityPoolsAndLinktoCFMMProposal.encode(message).finish() + }; + } +}; +function createBaseSetScalingFactorControllerProposal(): SetScalingFactorControllerProposal { + return { + $typeUrl: "/osmosis.gamm.v1beta1.SetScalingFactorControllerProposal", + title: "", + description: "", + poolId: BigInt(0), + controllerAddress: "" + }; +} +export const SetScalingFactorControllerProposal = { + typeUrl: "/osmosis.gamm.v1beta1.SetScalingFactorControllerProposal", + encode(message: SetScalingFactorControllerProposal, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.title !== "") { + writer.uint32(10).string(message.title); + } + if (message.description !== "") { + writer.uint32(18).string(message.description); + } + if (message.poolId !== BigInt(0)) { + writer.uint32(24).uint64(message.poolId); + } + if (message.controllerAddress !== "") { + writer.uint32(34).string(message.controllerAddress); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): SetScalingFactorControllerProposal { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSetScalingFactorControllerProposal(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.title = reader.string(); + break; + case 2: + message.description = reader.string(); + break; + case 3: + message.poolId = reader.uint64(); + break; + case 4: + message.controllerAddress = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): SetScalingFactorControllerProposal { + const message = createBaseSetScalingFactorControllerProposal(); + message.title = object.title ?? ""; + message.description = object.description ?? ""; + message.poolId = object.poolId !== undefined && object.poolId !== null ? BigInt(object.poolId.toString()) : BigInt(0); + message.controllerAddress = object.controllerAddress ?? ""; + return message; + }, + fromAmino(object: SetScalingFactorControllerProposalAmino): SetScalingFactorControllerProposal { + const message = createBaseSetScalingFactorControllerProposal(); + if (object.title !== undefined && object.title !== null) { + message.title = object.title; + } + if (object.description !== undefined && object.description !== null) { + message.description = object.description; + } + if (object.pool_id !== undefined && object.pool_id !== null) { + message.poolId = BigInt(object.pool_id); + } + if (object.controller_address !== undefined && object.controller_address !== null) { + message.controllerAddress = object.controller_address; + } + return message; + }, + toAmino(message: SetScalingFactorControllerProposal): SetScalingFactorControllerProposalAmino { + const obj: any = {}; + obj.title = message.title; + obj.description = message.description; + obj.pool_id = message.poolId ? message.poolId.toString() : undefined; + obj.controller_address = message.controllerAddress; + return obj; + }, + fromAminoMsg(object: SetScalingFactorControllerProposalAminoMsg): SetScalingFactorControllerProposal { + return SetScalingFactorControllerProposal.fromAmino(object.value); + }, + toAminoMsg(message: SetScalingFactorControllerProposal): SetScalingFactorControllerProposalAminoMsg { + return { + type: "osmosis/SetScalingFactorControllerProposal", + value: SetScalingFactorControllerProposal.toAmino(message) + }; + }, + fromProtoMsg(message: SetScalingFactorControllerProposalProtoMsg): SetScalingFactorControllerProposal { + return SetScalingFactorControllerProposal.decode(message.value); + }, + toProto(message: SetScalingFactorControllerProposal): Uint8Array { + return SetScalingFactorControllerProposal.encode(message).finish(); + }, + toProtoMsg(message: SetScalingFactorControllerProposal): SetScalingFactorControllerProposalProtoMsg { + return { + typeUrl: "/osmosis.gamm.v1beta1.SetScalingFactorControllerProposal", + value: SetScalingFactorControllerProposal.encode(message).finish() + }; + } }; \ No newline at end of file diff --git a/packages/osmo-query/src/codegen/osmosis/gamm/v1beta1/query.lcd.ts b/packages/osmo-query/src/codegen/osmosis/gamm/v1beta1/query.lcd.ts index fe3524817..ce7d3325e 100644 --- a/packages/osmo-query/src/codegen/osmosis/gamm/v1beta1/query.lcd.ts +++ b/packages/osmo-query/src/codegen/osmosis/gamm/v1beta1/query.lcd.ts @@ -1,6 +1,6 @@ import { setPaginationParams } from "../../../helpers"; import { LCDClient } from "@cosmology/lcd"; -import { QueryPoolsRequest, QueryPoolsResponseSDKType, QueryNumPoolsRequest, QueryNumPoolsResponseSDKType, QueryTotalLiquidityRequest, QueryTotalLiquidityResponseSDKType, QueryPoolsWithFilterRequest, QueryPoolsWithFilterResponseSDKType, QueryPoolRequest, QueryPoolResponseSDKType, QueryPoolTypeRequest, QueryPoolTypeResponseSDKType, QueryCalcJoinPoolSharesRequest, QueryCalcJoinPoolSharesResponseSDKType, QueryCalcExitPoolCoinsFromSharesRequest, QueryCalcExitPoolCoinsFromSharesResponseSDKType, QueryPoolParamsRequest, QueryPoolParamsResponseSDKType, QueryTotalPoolLiquidityRequest, QueryTotalPoolLiquidityResponseSDKType, QueryTotalSharesRequest, QueryTotalSharesResponseSDKType, QuerySpotPriceRequest, QuerySpotPriceResponseSDKType, QuerySwapExactAmountInRequest, QuerySwapExactAmountInResponseSDKType, QuerySwapExactAmountOutRequest, QuerySwapExactAmountOutResponseSDKType, QueryConcentratedPoolIdLinkFromCFMMRequest, QueryConcentratedPoolIdLinkFromCFMMResponseSDKType } from "./query"; +import { QueryPoolsRequest, QueryPoolsResponseSDKType, QueryNumPoolsRequest, QueryNumPoolsResponseSDKType, QueryTotalLiquidityRequest, QueryTotalLiquidityResponseSDKType, QueryPoolsWithFilterRequest, QueryPoolsWithFilterResponseSDKType, QueryPoolRequest, QueryPoolResponseSDKType, QueryPoolTypeRequest, QueryPoolTypeResponseSDKType, QueryCalcJoinPoolSharesRequest, QueryCalcJoinPoolSharesResponseSDKType, QueryCalcExitPoolCoinsFromSharesRequest, QueryCalcExitPoolCoinsFromSharesResponseSDKType, QueryPoolParamsRequest, QueryPoolParamsResponseSDKType, QueryTotalPoolLiquidityRequest, QueryTotalPoolLiquidityResponseSDKType, QueryTotalSharesRequest, QueryTotalSharesResponseSDKType, QuerySpotPriceRequest, QuerySpotPriceResponseSDKType, QuerySwapExactAmountInRequest, QuerySwapExactAmountInResponseSDKType, QuerySwapExactAmountOutRequest, QuerySwapExactAmountOutResponseSDKType, QueryConcentratedPoolIdLinkFromCFMMRequest, QueryConcentratedPoolIdLinkFromCFMMResponseSDKType, QueryCFMMConcentratedPoolLinksRequest, QueryCFMMConcentratedPoolLinksResponseSDKType } from "./query"; export class LCDQueryClient { req: LCDClient; constructor({ @@ -24,6 +24,7 @@ export class LCDQueryClient { this.estimateSwapExactAmountIn = this.estimateSwapExactAmountIn.bind(this); this.estimateSwapExactAmountOut = this.estimateSwapExactAmountOut.bind(this); this.concentratedPoolIdLinkFromCFMM = this.concentratedPoolIdLinkFromCFMM.bind(this); + this.cFMMConcentratedPoolLinks = this.cFMMConcentratedPoolLinks.bind(this); } /* Pools */ async pools(params: QueryPoolsRequest = { @@ -170,4 +171,10 @@ export class LCDQueryClient { const endpoint = `osmosis/gamm/v1beta1/concentrated_pool_id_link_from_cfmm/${params.cfmmPoolId}`; return await this.req.get(endpoint); } + /* CFMMConcentratedPoolLinks returns migration links between CFMM and + Concentrated pools. */ + async cFMMConcentratedPoolLinks(_params: QueryCFMMConcentratedPoolLinksRequest = {}): Promise { + const endpoint = `osmosis/gamm/v1beta1/cfmm_concentrated_pool_links`; + return await this.req.get(endpoint); + } } \ No newline at end of file diff --git a/packages/osmo-query/src/codegen/osmosis/gamm/v1beta1/query.rpc.Query.ts b/packages/osmo-query/src/codegen/osmosis/gamm/v1beta1/query.rpc.Query.ts index e560a88a5..f3464b2d0 100644 --- a/packages/osmo-query/src/codegen/osmosis/gamm/v1beta1/query.rpc.Query.ts +++ b/packages/osmo-query/src/codegen/osmosis/gamm/v1beta1/query.rpc.Query.ts @@ -3,7 +3,7 @@ import { BinaryReader } from "../../../binary"; import { QueryClient, createProtobufRpcClient, ProtobufRpcClient } from "@cosmjs/stargate"; import { ReactQueryParams } from "../../../react-query"; import { useQuery } from "@tanstack/react-query"; -import { QueryPoolsRequest, QueryPoolsResponse, QueryNumPoolsRequest, QueryNumPoolsResponse, QueryTotalLiquidityRequest, QueryTotalLiquidityResponse, QueryPoolsWithFilterRequest, QueryPoolsWithFilterResponse, QueryPoolRequest, QueryPoolResponse, QueryPoolTypeRequest, QueryPoolTypeResponse, QueryCalcJoinPoolNoSwapSharesRequest, QueryCalcJoinPoolNoSwapSharesResponse, QueryCalcJoinPoolSharesRequest, QueryCalcJoinPoolSharesResponse, QueryCalcExitPoolCoinsFromSharesRequest, QueryCalcExitPoolCoinsFromSharesResponse, QueryPoolParamsRequest, QueryPoolParamsResponse, QueryTotalPoolLiquidityRequest, QueryTotalPoolLiquidityResponse, QueryTotalSharesRequest, QueryTotalSharesResponse, QuerySpotPriceRequest, QuerySpotPriceResponse, QuerySwapExactAmountInRequest, QuerySwapExactAmountInResponse, QuerySwapExactAmountOutRequest, QuerySwapExactAmountOutResponse, QueryConcentratedPoolIdLinkFromCFMMRequest, QueryConcentratedPoolIdLinkFromCFMMResponse } from "./query"; +import { QueryPoolsRequest, QueryPoolsResponse, QueryNumPoolsRequest, QueryNumPoolsResponse, QueryTotalLiquidityRequest, QueryTotalLiquidityResponse, QueryPoolsWithFilterRequest, QueryPoolsWithFilterResponse, QueryPoolRequest, QueryPoolResponse, QueryPoolTypeRequest, QueryPoolTypeResponse, QueryCalcJoinPoolNoSwapSharesRequest, QueryCalcJoinPoolNoSwapSharesResponse, QueryCalcJoinPoolSharesRequest, QueryCalcJoinPoolSharesResponse, QueryCalcExitPoolCoinsFromSharesRequest, QueryCalcExitPoolCoinsFromSharesResponse, QueryPoolParamsRequest, QueryPoolParamsResponse, QueryTotalPoolLiquidityRequest, QueryTotalPoolLiquidityResponse, QueryTotalSharesRequest, QueryTotalSharesResponse, QuerySpotPriceRequest, QuerySpotPriceResponse, QuerySwapExactAmountInRequest, QuerySwapExactAmountInResponse, QuerySwapExactAmountOutRequest, QuerySwapExactAmountOutResponse, QueryConcentratedPoolIdLinkFromCFMMRequest, QueryConcentratedPoolIdLinkFromCFMMResponse, QueryCFMMConcentratedPoolLinksRequest, QueryCFMMConcentratedPoolLinksResponse } from "./query"; export interface Query { pools(request?: QueryPoolsRequest): Promise; /** Deprecated: please use the alternative in x/poolmanager */ @@ -47,6 +47,11 @@ export interface Query { * pool that is linked with the given CFMM pool. */ concentratedPoolIdLinkFromCFMM(request: QueryConcentratedPoolIdLinkFromCFMMRequest): Promise; + /** + * CFMMConcentratedPoolLinks returns migration links between CFMM and + * Concentrated pools. + */ + cFMMConcentratedPoolLinks(request?: QueryCFMMConcentratedPoolLinksRequest): Promise; } export class QueryClientImpl implements Query { private readonly rpc: Rpc; @@ -68,6 +73,7 @@ export class QueryClientImpl implements Query { this.estimateSwapExactAmountIn = this.estimateSwapExactAmountIn.bind(this); this.estimateSwapExactAmountOut = this.estimateSwapExactAmountOut.bind(this); this.concentratedPoolIdLinkFromCFMM = this.concentratedPoolIdLinkFromCFMM.bind(this); + this.cFMMConcentratedPoolLinks = this.cFMMConcentratedPoolLinks.bind(this); } pools(request: QueryPoolsRequest = { pagination: undefined @@ -151,6 +157,11 @@ export class QueryClientImpl implements Query { const promise = this.rpc.request("osmosis.gamm.v1beta1.Query", "ConcentratedPoolIdLinkFromCFMM", data); return promise.then(data => QueryConcentratedPoolIdLinkFromCFMMResponse.decode(new BinaryReader(data))); } + cFMMConcentratedPoolLinks(request: QueryCFMMConcentratedPoolLinksRequest = {}): Promise { + const data = QueryCFMMConcentratedPoolLinksRequest.encode(request).finish(); + const promise = this.rpc.request("osmosis.gamm.v1beta1.Query", "CFMMConcentratedPoolLinks", data); + return promise.then(data => QueryCFMMConcentratedPoolLinksResponse.decode(new BinaryReader(data))); + } } export const createRpcQueryExtension = (base: QueryClient) => { const rpc = createProtobufRpcClient(base); @@ -203,6 +214,9 @@ export const createRpcQueryExtension = (base: QueryClient) => { }, concentratedPoolIdLinkFromCFMM(request: QueryConcentratedPoolIdLinkFromCFMMRequest): Promise { return queryService.concentratedPoolIdLinkFromCFMM(request); + }, + cFMMConcentratedPoolLinks(request?: QueryCFMMConcentratedPoolLinksRequest): Promise { + return queryService.cFMMConcentratedPoolLinks(request); } }; }; @@ -254,6 +268,9 @@ export interface UseEstimateSwapExactAmountOutQuery extends ReactQueryPar export interface UseConcentratedPoolIdLinkFromCFMMQuery extends ReactQueryParams { request: QueryConcentratedPoolIdLinkFromCFMMRequest; } +export interface UseCFMMConcentratedPoolLinksQuery extends ReactQueryParams { + request?: QueryCFMMConcentratedPoolLinksRequest; +} const _queryClients: WeakMap = new WeakMap(); const getQueryService = (rpc: ProtobufRpcClient | undefined): QueryClientImpl | undefined => { if (!rpc) return; @@ -410,6 +427,15 @@ export const createRpcQueryHooks = (rpc: ProtobufRpcClient | undefined) => { return queryService.concentratedPoolIdLinkFromCFMM(request); }, options); }; + const useCFMMConcentratedPoolLinks = ({ + request, + options + }: UseCFMMConcentratedPoolLinksQuery) => { + return useQuery(["cFMMConcentratedPoolLinksQuery", request], () => { + if (!queryService) throw new Error("Query Service not initialized"); + return queryService.cFMMConcentratedPoolLinks(request); + }, options); + }; return { usePools, /** Deprecated: please use the alternative in x/poolmanager */useNumPools, @@ -447,6 +473,11 @@ export const createRpcQueryHooks = (rpc: ProtobufRpcClient | undefined) => { * ConcentratedPoolIdLinkFromBalancer returns the pool id of the concentrated * pool that is linked with the given CFMM pool. */ - useConcentratedPoolIdLinkFromCFMM + useConcentratedPoolIdLinkFromCFMM, + /** + * CFMMConcentratedPoolLinks returns migration links between CFMM and + * Concentrated pools. + */ + useCFMMConcentratedPoolLinks }; }; \ No newline at end of file diff --git a/packages/osmo-query/src/codegen/osmosis/gamm/v1beta1/query.ts b/packages/osmo-query/src/codegen/osmosis/gamm/v1beta1/query.ts index 2bdc4e5f1..e7bebc921 100644 --- a/packages/osmo-query/src/codegen/osmosis/gamm/v1beta1/query.ts +++ b/packages/osmo-query/src/codegen/osmosis/gamm/v1beta1/query.ts @@ -2,16 +2,17 @@ import { PageRequest, PageRequestAmino, PageRequestSDKType, PageResponse, PageRe import { Coin, CoinAmino, CoinSDKType } from "../../../cosmos/base/v1beta1/coin"; import { SwapAmountInRoute, SwapAmountInRouteAmino, SwapAmountInRouteSDKType, SwapAmountOutRoute, SwapAmountOutRouteAmino, SwapAmountOutRouteSDKType } from "../../poolmanager/v1beta1/swap_route"; import { Any, AnyProtoMsg, AnyAmino, AnySDKType } from "../../../google/protobuf/any"; -import { Pool as Pool1 } from "../../concentrated-liquidity/pool"; -import { PoolProtoMsg as Pool1ProtoMsg } from "../../concentrated-liquidity/pool"; -import { PoolSDKType as Pool1SDKType } from "../../concentrated-liquidity/pool"; +import { MigrationRecords, MigrationRecordsAmino, MigrationRecordsSDKType } from "./shared"; +import { Pool as Pool1 } from "../../concentratedliquidity/v1beta1/pool"; +import { PoolProtoMsg as Pool1ProtoMsg } from "../../concentratedliquidity/v1beta1/pool"; +import { PoolSDKType as Pool1SDKType } from "../../concentratedliquidity/v1beta1/pool"; import { CosmWasmPool, CosmWasmPoolProtoMsg, CosmWasmPoolSDKType } from "../../cosmwasmpool/v1beta1/model/pool"; -import { Pool as Pool2 } from "../pool-models/balancer/balancerPool"; -import { PoolProtoMsg as Pool2ProtoMsg } from "../pool-models/balancer/balancerPool"; -import { PoolSDKType as Pool2SDKType } from "../pool-models/balancer/balancerPool"; -import { Pool as Pool3 } from "../pool-models/stableswap/stableswap_pool"; -import { PoolProtoMsg as Pool3ProtoMsg } from "../pool-models/stableswap/stableswap_pool"; -import { PoolSDKType as Pool3SDKType } from "../pool-models/stableswap/stableswap_pool"; +import { Pool as Pool2 } from "../poolmodels/stableswap/v1beta1/stableswap_pool"; +import { PoolProtoMsg as Pool2ProtoMsg } from "../poolmodels/stableswap/v1beta1/stableswap_pool"; +import { PoolSDKType as Pool2SDKType } from "../poolmodels/stableswap/v1beta1/stableswap_pool"; +import { Pool as Pool3 } from "./balancerPool"; +import { PoolProtoMsg as Pool3ProtoMsg } from "./balancerPool"; +import { PoolSDKType as Pool3SDKType } from "./balancerPool"; import { BinaryReader, BinaryWriter } from "../../../binary"; /** * =============================== Pool @@ -31,7 +32,7 @@ export interface QueryPoolRequestProtoMsg { */ /** @deprecated */ export interface QueryPoolRequestAmino { - pool_id: string; + pool_id?: string; } export interface QueryPoolRequestAminoMsg { type: "osmosis/gamm/query-pool-request"; @@ -48,7 +49,7 @@ export interface QueryPoolRequestSDKType { /** Deprecated: please use the alternative in x/poolmanager */ /** @deprecated */ export interface QueryPoolResponse { - pool: (Pool1 & CosmWasmPool & Pool2 & Pool3 & Any) | undefined; + pool?: (Pool1 & CosmWasmPool & Pool2 & Pool3 & Any) | undefined; } export interface QueryPoolResponseProtoMsg { typeUrl: "/osmosis.gamm.v1beta1.QueryPoolResponse"; @@ -69,12 +70,12 @@ export interface QueryPoolResponseAminoMsg { /** Deprecated: please use the alternative in x/poolmanager */ /** @deprecated */ export interface QueryPoolResponseSDKType { - pool: Pool1SDKType | CosmWasmPoolSDKType | Pool2SDKType | Pool3SDKType | AnySDKType | undefined; + pool?: Pool1SDKType | CosmWasmPoolSDKType | Pool2SDKType | Pool3SDKType | AnySDKType | undefined; } /** =============================== Pools */ export interface QueryPoolsRequest { /** pagination defines an optional pagination for the request. */ - pagination: PageRequest; + pagination?: PageRequest; } export interface QueryPoolsRequestProtoMsg { typeUrl: "/osmosis.gamm.v1beta1.QueryPoolsRequest"; @@ -91,12 +92,12 @@ export interface QueryPoolsRequestAminoMsg { } /** =============================== Pools */ export interface QueryPoolsRequestSDKType { - pagination: PageRequestSDKType; + pagination?: PageRequestSDKType; } export interface QueryPoolsResponse { pools: (Pool1 & CosmWasmPool & Pool2 & Pool3 & Any)[] | Any[]; /** pagination defines the pagination in the response. */ - pagination: PageResponse; + pagination?: PageResponse; } export interface QueryPoolsResponseProtoMsg { typeUrl: "/osmosis.gamm.v1beta1.QueryPoolsResponse"; @@ -106,7 +107,7 @@ export type QueryPoolsResponseEncoded = Omit & { pools: (Pool1ProtoMsg | CosmWasmPoolProtoMsg | Pool2ProtoMsg | Pool3ProtoMsg | AnyProtoMsg)[]; }; export interface QueryPoolsResponseAmino { - pools: AnyAmino[]; + pools?: AnyAmino[]; /** pagination defines the pagination in the response. */ pagination?: PageResponseAmino; } @@ -116,7 +117,7 @@ export interface QueryPoolsResponseAminoMsg { } export interface QueryPoolsResponseSDKType { pools: (Pool1SDKType | CosmWasmPoolSDKType | Pool2SDKType | Pool3SDKType | AnySDKType)[]; - pagination: PageResponseSDKType; + pagination?: PageResponseSDKType; } /** =============================== NumPools */ /** @deprecated */ @@ -145,7 +146,7 @@ export interface QueryNumPoolsResponseProtoMsg { } /** @deprecated */ export interface QueryNumPoolsResponseAmino { - num_pools: string; + num_pools?: string; } export interface QueryNumPoolsResponseAminoMsg { type: "osmosis/gamm/query-num-pools-response"; @@ -165,7 +166,7 @@ export interface QueryPoolTypeRequestProtoMsg { } /** =============================== PoolType */ export interface QueryPoolTypeRequestAmino { - pool_id: string; + pool_id?: string; } export interface QueryPoolTypeRequestAminoMsg { type: "osmosis/gamm/query-pool-type-request"; @@ -183,7 +184,7 @@ export interface QueryPoolTypeResponseProtoMsg { value: Uint8Array; } export interface QueryPoolTypeResponseAmino { - pool_type: string; + pool_type?: string; } export interface QueryPoolTypeResponseAminoMsg { type: "osmosis/gamm/query-pool-type-response"; @@ -203,8 +204,8 @@ export interface QueryCalcJoinPoolSharesRequestProtoMsg { } /** =============================== CalcJoinPoolShares */ export interface QueryCalcJoinPoolSharesRequestAmino { - pool_id: string; - tokens_in: CoinAmino[]; + pool_id?: string; + tokens_in?: CoinAmino[]; } export interface QueryCalcJoinPoolSharesRequestAminoMsg { type: "osmosis/gamm/query-calc-join-pool-shares-request"; @@ -224,8 +225,8 @@ export interface QueryCalcJoinPoolSharesResponseProtoMsg { value: Uint8Array; } export interface QueryCalcJoinPoolSharesResponseAmino { - share_out_amount: string; - tokens_out: CoinAmino[]; + share_out_amount?: string; + tokens_out?: CoinAmino[]; } export interface QueryCalcJoinPoolSharesResponseAminoMsg { type: "osmosis/gamm/query-calc-join-pool-shares-response"; @@ -246,8 +247,8 @@ export interface QueryCalcExitPoolCoinsFromSharesRequestProtoMsg { } /** =============================== CalcExitPoolCoinsFromShares */ export interface QueryCalcExitPoolCoinsFromSharesRequestAmino { - pool_id: string; - share_in_amount: string; + pool_id?: string; + share_in_amount?: string; } export interface QueryCalcExitPoolCoinsFromSharesRequestAminoMsg { type: "osmosis/gamm/query-calc-exit-pool-coins-from-shares-request"; @@ -266,7 +267,7 @@ export interface QueryCalcExitPoolCoinsFromSharesResponseProtoMsg { value: Uint8Array; } export interface QueryCalcExitPoolCoinsFromSharesResponseAmino { - tokens_out: CoinAmino[]; + tokens_out?: CoinAmino[]; } export interface QueryCalcExitPoolCoinsFromSharesResponseAminoMsg { type: "osmosis/gamm/query-calc-exit-pool-coins-from-shares-response"; @@ -285,7 +286,7 @@ export interface QueryPoolParamsRequestProtoMsg { } /** =============================== PoolParams */ export interface QueryPoolParamsRequestAmino { - pool_id: string; + pool_id?: string; } export interface QueryPoolParamsRequestAminoMsg { type: "osmosis/gamm/query-pool-params-request"; @@ -296,7 +297,7 @@ export interface QueryPoolParamsRequestSDKType { pool_id: bigint; } export interface QueryPoolParamsResponse { - params: Any; + params?: Any; } export interface QueryPoolParamsResponseProtoMsg { typeUrl: "/osmosis.gamm.v1beta1.QueryPoolParamsResponse"; @@ -310,7 +311,7 @@ export interface QueryPoolParamsResponseAminoMsg { value: QueryPoolParamsResponseAmino; } export interface QueryPoolParamsResponseSDKType { - params: AnySDKType; + params?: AnySDKType; } /** * =============================== PoolLiquidity @@ -330,7 +331,7 @@ export interface QueryTotalPoolLiquidityRequestProtoMsg { */ /** @deprecated */ export interface QueryTotalPoolLiquidityRequestAmino { - pool_id: string; + pool_id?: string; } export interface QueryTotalPoolLiquidityRequestAminoMsg { type: "osmosis/gamm/query-total-pool-liquidity-request"; @@ -356,7 +357,7 @@ export interface QueryTotalPoolLiquidityResponseProtoMsg { /** Deprecated: please use the alternative in x/poolmanager */ /** @deprecated */ export interface QueryTotalPoolLiquidityResponseAmino { - liquidity: CoinAmino[]; + liquidity?: CoinAmino[]; } export interface QueryTotalPoolLiquidityResponseAminoMsg { type: "osmosis/gamm/query-total-pool-liquidity-response"; @@ -377,7 +378,7 @@ export interface QueryTotalSharesRequestProtoMsg { } /** =============================== TotalShares */ export interface QueryTotalSharesRequestAmino { - pool_id: string; + pool_id?: string; } export interface QueryTotalSharesRequestAminoMsg { type: "osmosis/gamm/query-total-shares-request"; @@ -415,8 +416,8 @@ export interface QueryCalcJoinPoolNoSwapSharesRequestProtoMsg { } /** =============================== CalcJoinPoolNoSwapShares */ export interface QueryCalcJoinPoolNoSwapSharesRequestAmino { - pool_id: string; - tokens_in: CoinAmino[]; + pool_id?: string; + tokens_in?: CoinAmino[]; } export interface QueryCalcJoinPoolNoSwapSharesRequestAminoMsg { type: "osmosis/gamm/query-calc-join-pool-no-swap-shares-request"; @@ -436,8 +437,8 @@ export interface QueryCalcJoinPoolNoSwapSharesResponseProtoMsg { value: Uint8Array; } export interface QueryCalcJoinPoolNoSwapSharesResponseAmino { - tokens_out: CoinAmino[]; - shares_out: string; + tokens_out?: CoinAmino[]; + shares_out?: string; } export interface QueryCalcJoinPoolNoSwapSharesResponseAminoMsg { type: "osmosis/gamm/query-calc-join-pool-no-swap-shares-response"; @@ -467,9 +468,9 @@ export interface QuerySpotPriceRequestProtoMsg { */ /** @deprecated */ export interface QuerySpotPriceRequestAmino { - pool_id: string; - base_asset_denom: string; - quote_asset_denom: string; + pool_id?: string; + base_asset_denom?: string; + quote_asset_denom?: string; } export interface QuerySpotPriceRequestAminoMsg { type: "osmosis/gamm/query-spot-price-request"; @@ -487,12 +488,12 @@ export interface QuerySpotPriceRequestSDKType { } export interface QueryPoolsWithFilterRequest { /** - * String of the coins in single string seperated by comma. Ex) + * String of the coins in single string separated by comma. Ex) * 10uatom,100uosmo */ minLiquidity: string; poolType: string; - pagination: PageRequest; + pagination?: PageRequest; } export interface QueryPoolsWithFilterRequestProtoMsg { typeUrl: "/osmosis.gamm.v1beta1.QueryPoolsWithFilterRequest"; @@ -500,11 +501,11 @@ export interface QueryPoolsWithFilterRequestProtoMsg { } export interface QueryPoolsWithFilterRequestAmino { /** - * String of the coins in single string seperated by comma. Ex) + * String of the coins in single string separated by comma. Ex) * 10uatom,100uosmo */ - min_liquidity: string; - pool_type: string; + min_liquidity?: string; + pool_type?: string; pagination?: PageRequestAmino; } export interface QueryPoolsWithFilterRequestAminoMsg { @@ -514,12 +515,12 @@ export interface QueryPoolsWithFilterRequestAminoMsg { export interface QueryPoolsWithFilterRequestSDKType { min_liquidity: string; pool_type: string; - pagination: PageRequestSDKType; + pagination?: PageRequestSDKType; } export interface QueryPoolsWithFilterResponse { pools: (Pool1 & CosmWasmPool & Pool2 & Pool3 & Any)[] | Any[]; /** pagination defines the pagination in the response. */ - pagination: PageResponse; + pagination?: PageResponse; } export interface QueryPoolsWithFilterResponseProtoMsg { typeUrl: "/osmosis.gamm.v1beta1.QueryPoolsWithFilterResponse"; @@ -529,7 +530,7 @@ export type QueryPoolsWithFilterResponseEncoded = Omit>> 3) { case 1: - message.pools.push((PoolI_InterfaceDecoder(reader) as Any)); + message.pools.push((Any(reader) as Any)); break; case 2: message.pagination = PageResponse.decode(reader, reader.uint32()); @@ -989,10 +1027,12 @@ export const QueryPoolsResponse = { return message; }, fromAmino(object: QueryPoolsResponseAmino): QueryPoolsResponse { - return { - pools: Array.isArray(object?.pools) ? object.pools.map((e: any) => PoolI_FromAmino(e)) : [], - pagination: object?.pagination ? PageResponse.fromAmino(object.pagination) : undefined - }; + const message = createBaseQueryPoolsResponse(); + message.pools = object.pools?.map(e => PoolI_FromAmino(e)) || []; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromAmino(object.pagination); + } + return message; }, toAmino(message: QueryPoolsResponse): QueryPoolsResponseAmino { const obj: any = {}; @@ -1053,7 +1093,8 @@ export const QueryNumPoolsRequest = { return message; }, fromAmino(_: QueryNumPoolsRequestAmino): QueryNumPoolsRequest { - return {}; + const message = createBaseQueryNumPoolsRequest(); + return message; }, toAmino(_: QueryNumPoolsRequest): QueryNumPoolsRequestAmino { const obj: any = {}; @@ -1117,9 +1158,11 @@ export const QueryNumPoolsResponse = { return message; }, fromAmino(object: QueryNumPoolsResponseAmino): QueryNumPoolsResponse { - return { - numPools: BigInt(object.num_pools) - }; + const message = createBaseQueryNumPoolsResponse(); + if (object.num_pools !== undefined && object.num_pools !== null) { + message.numPools = BigInt(object.num_pools); + } + return message; }, toAmino(message: QueryNumPoolsResponse): QueryNumPoolsResponseAmino { const obj: any = {}; @@ -1184,9 +1227,11 @@ export const QueryPoolTypeRequest = { return message; }, fromAmino(object: QueryPoolTypeRequestAmino): QueryPoolTypeRequest { - return { - poolId: BigInt(object.pool_id) - }; + const message = createBaseQueryPoolTypeRequest(); + if (object.pool_id !== undefined && object.pool_id !== null) { + message.poolId = BigInt(object.pool_id); + } + return message; }, toAmino(message: QueryPoolTypeRequest): QueryPoolTypeRequestAmino { const obj: any = {}; @@ -1251,9 +1296,11 @@ export const QueryPoolTypeResponse = { return message; }, fromAmino(object: QueryPoolTypeResponseAmino): QueryPoolTypeResponse { - return { - poolType: object.pool_type - }; + const message = createBaseQueryPoolTypeResponse(); + if (object.pool_type !== undefined && object.pool_type !== null) { + message.poolType = object.pool_type; + } + return message; }, toAmino(message: QueryPoolTypeResponse): QueryPoolTypeResponseAmino { const obj: any = {}; @@ -1326,10 +1373,12 @@ export const QueryCalcJoinPoolSharesRequest = { return message; }, fromAmino(object: QueryCalcJoinPoolSharesRequestAmino): QueryCalcJoinPoolSharesRequest { - return { - poolId: BigInt(object.pool_id), - tokensIn: Array.isArray(object?.tokens_in) ? object.tokens_in.map((e: any) => Coin.fromAmino(e)) : [] - }; + const message = createBaseQueryCalcJoinPoolSharesRequest(); + if (object.pool_id !== undefined && object.pool_id !== null) { + message.poolId = BigInt(object.pool_id); + } + message.tokensIn = object.tokens_in?.map(e => Coin.fromAmino(e)) || []; + return message; }, toAmino(message: QueryCalcJoinPoolSharesRequest): QueryCalcJoinPoolSharesRequestAmino { const obj: any = {}; @@ -1407,10 +1456,12 @@ export const QueryCalcJoinPoolSharesResponse = { return message; }, fromAmino(object: QueryCalcJoinPoolSharesResponseAmino): QueryCalcJoinPoolSharesResponse { - return { - shareOutAmount: object.share_out_amount, - tokensOut: Array.isArray(object?.tokens_out) ? object.tokens_out.map((e: any) => Coin.fromAmino(e)) : [] - }; + const message = createBaseQueryCalcJoinPoolSharesResponse(); + if (object.share_out_amount !== undefined && object.share_out_amount !== null) { + message.shareOutAmount = object.share_out_amount; + } + message.tokensOut = object.tokens_out?.map(e => Coin.fromAmino(e)) || []; + return message; }, toAmino(message: QueryCalcJoinPoolSharesResponse): QueryCalcJoinPoolSharesResponseAmino { const obj: any = {}; @@ -1488,10 +1539,14 @@ export const QueryCalcExitPoolCoinsFromSharesRequest = { return message; }, fromAmino(object: QueryCalcExitPoolCoinsFromSharesRequestAmino): QueryCalcExitPoolCoinsFromSharesRequest { - return { - poolId: BigInt(object.pool_id), - shareInAmount: object.share_in_amount - }; + const message = createBaseQueryCalcExitPoolCoinsFromSharesRequest(); + if (object.pool_id !== undefined && object.pool_id !== null) { + message.poolId = BigInt(object.pool_id); + } + if (object.share_in_amount !== undefined && object.share_in_amount !== null) { + message.shareInAmount = object.share_in_amount; + } + return message; }, toAmino(message: QueryCalcExitPoolCoinsFromSharesRequest): QueryCalcExitPoolCoinsFromSharesRequestAmino { const obj: any = {}; @@ -1557,9 +1612,9 @@ export const QueryCalcExitPoolCoinsFromSharesResponse = { return message; }, fromAmino(object: QueryCalcExitPoolCoinsFromSharesResponseAmino): QueryCalcExitPoolCoinsFromSharesResponse { - return { - tokensOut: Array.isArray(object?.tokens_out) ? object.tokens_out.map((e: any) => Coin.fromAmino(e)) : [] - }; + const message = createBaseQueryCalcExitPoolCoinsFromSharesResponse(); + message.tokensOut = object.tokens_out?.map(e => Coin.fromAmino(e)) || []; + return message; }, toAmino(message: QueryCalcExitPoolCoinsFromSharesResponse): QueryCalcExitPoolCoinsFromSharesResponseAmino { const obj: any = {}; @@ -1628,9 +1683,11 @@ export const QueryPoolParamsRequest = { return message; }, fromAmino(object: QueryPoolParamsRequestAmino): QueryPoolParamsRequest { - return { - poolId: BigInt(object.pool_id) - }; + const message = createBaseQueryPoolParamsRequest(); + if (object.pool_id !== undefined && object.pool_id !== null) { + message.poolId = BigInt(object.pool_id); + } + return message; }, toAmino(message: QueryPoolParamsRequest): QueryPoolParamsRequestAmino { const obj: any = {}; @@ -1661,7 +1718,7 @@ export const QueryPoolParamsRequest = { }; function createBaseQueryPoolParamsResponse(): QueryPoolParamsResponse { return { - params: Any.fromPartial({}) + params: undefined }; } export const QueryPoolParamsResponse = { @@ -1695,9 +1752,11 @@ export const QueryPoolParamsResponse = { return message; }, fromAmino(object: QueryPoolParamsResponseAmino): QueryPoolParamsResponse { - return { - params: object?.params ? Any.fromAmino(object.params) : undefined - }; + const message = createBaseQueryPoolParamsResponse(); + if (object.params !== undefined && object.params !== null) { + message.params = Any.fromAmino(object.params); + } + return message; }, toAmino(message: QueryPoolParamsResponse): QueryPoolParamsResponseAmino { const obj: any = {}; @@ -1762,9 +1821,11 @@ export const QueryTotalPoolLiquidityRequest = { return message; }, fromAmino(object: QueryTotalPoolLiquidityRequestAmino): QueryTotalPoolLiquidityRequest { - return { - poolId: BigInt(object.pool_id) - }; + const message = createBaseQueryTotalPoolLiquidityRequest(); + if (object.pool_id !== undefined && object.pool_id !== null) { + message.poolId = BigInt(object.pool_id); + } + return message; }, toAmino(message: QueryTotalPoolLiquidityRequest): QueryTotalPoolLiquidityRequestAmino { const obj: any = {}; @@ -1829,9 +1890,9 @@ export const QueryTotalPoolLiquidityResponse = { return message; }, fromAmino(object: QueryTotalPoolLiquidityResponseAmino): QueryTotalPoolLiquidityResponse { - return { - liquidity: Array.isArray(object?.liquidity) ? object.liquidity.map((e: any) => Coin.fromAmino(e)) : [] - }; + const message = createBaseQueryTotalPoolLiquidityResponse(); + message.liquidity = object.liquidity?.map(e => Coin.fromAmino(e)) || []; + return message; }, toAmino(message: QueryTotalPoolLiquidityResponse): QueryTotalPoolLiquidityResponseAmino { const obj: any = {}; @@ -1900,9 +1961,11 @@ export const QueryTotalSharesRequest = { return message; }, fromAmino(object: QueryTotalSharesRequestAmino): QueryTotalSharesRequest { - return { - poolId: BigInt(object.pool_id) - }; + const message = createBaseQueryTotalSharesRequest(); + if (object.pool_id !== undefined && object.pool_id !== null) { + message.poolId = BigInt(object.pool_id); + } + return message; }, toAmino(message: QueryTotalSharesRequest): QueryTotalSharesRequestAmino { const obj: any = {}; @@ -1967,9 +2030,11 @@ export const QueryTotalSharesResponse = { return message; }, fromAmino(object: QueryTotalSharesResponseAmino): QueryTotalSharesResponse { - return { - totalShares: object?.total_shares ? Coin.fromAmino(object.total_shares) : undefined - }; + const message = createBaseQueryTotalSharesResponse(); + if (object.total_shares !== undefined && object.total_shares !== null) { + message.totalShares = Coin.fromAmino(object.total_shares); + } + return message; }, toAmino(message: QueryTotalSharesResponse): QueryTotalSharesResponseAmino { const obj: any = {}; @@ -2042,10 +2107,12 @@ export const QueryCalcJoinPoolNoSwapSharesRequest = { return message; }, fromAmino(object: QueryCalcJoinPoolNoSwapSharesRequestAmino): QueryCalcJoinPoolNoSwapSharesRequest { - return { - poolId: BigInt(object.pool_id), - tokensIn: Array.isArray(object?.tokens_in) ? object.tokens_in.map((e: any) => Coin.fromAmino(e)) : [] - }; + const message = createBaseQueryCalcJoinPoolNoSwapSharesRequest(); + if (object.pool_id !== undefined && object.pool_id !== null) { + message.poolId = BigInt(object.pool_id); + } + message.tokensIn = object.tokens_in?.map(e => Coin.fromAmino(e)) || []; + return message; }, toAmino(message: QueryCalcJoinPoolNoSwapSharesRequest): QueryCalcJoinPoolNoSwapSharesRequestAmino { const obj: any = {}; @@ -2123,10 +2190,12 @@ export const QueryCalcJoinPoolNoSwapSharesResponse = { return message; }, fromAmino(object: QueryCalcJoinPoolNoSwapSharesResponseAmino): QueryCalcJoinPoolNoSwapSharesResponse { - return { - tokensOut: Array.isArray(object?.tokens_out) ? object.tokens_out.map((e: any) => Coin.fromAmino(e)) : [], - sharesOut: object.shares_out - }; + const message = createBaseQueryCalcJoinPoolNoSwapSharesResponse(); + message.tokensOut = object.tokens_out?.map(e => Coin.fromAmino(e)) || []; + if (object.shares_out !== undefined && object.shares_out !== null) { + message.sharesOut = object.shares_out; + } + return message; }, toAmino(message: QueryCalcJoinPoolNoSwapSharesResponse): QueryCalcJoinPoolNoSwapSharesResponseAmino { const obj: any = {}; @@ -2212,11 +2281,17 @@ export const QuerySpotPriceRequest = { return message; }, fromAmino(object: QuerySpotPriceRequestAmino): QuerySpotPriceRequest { - return { - poolId: BigInt(object.pool_id), - baseAssetDenom: object.base_asset_denom, - quoteAssetDenom: object.quote_asset_denom - }; + const message = createBaseQuerySpotPriceRequest(); + if (object.pool_id !== undefined && object.pool_id !== null) { + message.poolId = BigInt(object.pool_id); + } + if (object.base_asset_denom !== undefined && object.base_asset_denom !== null) { + message.baseAssetDenom = object.base_asset_denom; + } + if (object.quote_asset_denom !== undefined && object.quote_asset_denom !== null) { + message.quoteAssetDenom = object.quote_asset_denom; + } + return message; }, toAmino(message: QuerySpotPriceRequest): QuerySpotPriceRequestAmino { const obj: any = {}; @@ -2251,7 +2326,7 @@ function createBaseQueryPoolsWithFilterRequest(): QueryPoolsWithFilterRequest { return { minLiquidity: "", poolType: "", - pagination: PageRequest.fromPartial({}) + pagination: undefined }; } export const QueryPoolsWithFilterRequest = { @@ -2299,11 +2374,17 @@ export const QueryPoolsWithFilterRequest = { return message; }, fromAmino(object: QueryPoolsWithFilterRequestAmino): QueryPoolsWithFilterRequest { - return { - minLiquidity: object.min_liquidity, - poolType: object.pool_type, - pagination: object?.pagination ? PageRequest.fromAmino(object.pagination) : undefined - }; + const message = createBaseQueryPoolsWithFilterRequest(); + if (object.min_liquidity !== undefined && object.min_liquidity !== null) { + message.minLiquidity = object.min_liquidity; + } + if (object.pool_type !== undefined && object.pool_type !== null) { + message.poolType = object.pool_type; + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromAmino(object.pagination); + } + return message; }, toAmino(message: QueryPoolsWithFilterRequest): QueryPoolsWithFilterRequestAmino { const obj: any = {}; @@ -2337,7 +2418,7 @@ export const QueryPoolsWithFilterRequest = { function createBaseQueryPoolsWithFilterResponse(): QueryPoolsWithFilterResponse { return { pools: [], - pagination: PageResponse.fromPartial({}) + pagination: undefined }; } export const QueryPoolsWithFilterResponse = { @@ -2359,7 +2440,7 @@ export const QueryPoolsWithFilterResponse = { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.pools.push((PoolI_InterfaceDecoder(reader) as Any)); + message.pools.push((Any(reader) as Any)); break; case 2: message.pagination = PageResponse.decode(reader, reader.uint32()); @@ -2378,10 +2459,12 @@ export const QueryPoolsWithFilterResponse = { return message; }, fromAmino(object: QueryPoolsWithFilterResponseAmino): QueryPoolsWithFilterResponse { - return { - pools: Array.isArray(object?.pools) ? object.pools.map((e: any) => PoolI_FromAmino(e)) : [], - pagination: object?.pagination ? PageResponse.fromAmino(object.pagination) : undefined - }; + const message = createBaseQueryPoolsWithFilterResponse(); + message.pools = object.pools?.map(e => PoolI_FromAmino(e)) || []; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromAmino(object.pagination); + } + return message; }, toAmino(message: QueryPoolsWithFilterResponse): QueryPoolsWithFilterResponseAmino { const obj: any = {}; @@ -2451,9 +2534,11 @@ export const QuerySpotPriceResponse = { return message; }, fromAmino(object: QuerySpotPriceResponseAmino): QuerySpotPriceResponse { - return { - spotPrice: object.spot_price - }; + const message = createBaseQuerySpotPriceResponse(); + if (object.spot_price !== undefined && object.spot_price !== null) { + message.spotPrice = object.spot_price; + } + return message; }, toAmino(message: QuerySpotPriceResponse): QuerySpotPriceResponseAmino { const obj: any = {}; @@ -2542,12 +2627,18 @@ export const QuerySwapExactAmountInRequest = { return message; }, fromAmino(object: QuerySwapExactAmountInRequestAmino): QuerySwapExactAmountInRequest { - return { - sender: object.sender, - poolId: BigInt(object.pool_id), - tokenIn: object.token_in, - routes: Array.isArray(object?.routes) ? object.routes.map((e: any) => SwapAmountInRoute.fromAmino(e)) : [] - }; + const message = createBaseQuerySwapExactAmountInRequest(); + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + if (object.pool_id !== undefined && object.pool_id !== null) { + message.poolId = BigInt(object.pool_id); + } + if (object.token_in !== undefined && object.token_in !== null) { + message.tokenIn = object.token_in; + } + message.routes = object.routes?.map(e => SwapAmountInRoute.fromAmino(e)) || []; + return message; }, toAmino(message: QuerySwapExactAmountInRequest): QuerySwapExactAmountInRequestAmino { const obj: any = {}; @@ -2619,9 +2710,11 @@ export const QuerySwapExactAmountInResponse = { return message; }, fromAmino(object: QuerySwapExactAmountInResponseAmino): QuerySwapExactAmountInResponse { - return { - tokenOutAmount: object.token_out_amount - }; + const message = createBaseQuerySwapExactAmountInResponse(); + if (object.token_out_amount !== undefined && object.token_out_amount !== null) { + message.tokenOutAmount = object.token_out_amount; + } + return message; }, toAmino(message: QuerySwapExactAmountInResponse): QuerySwapExactAmountInResponseAmino { const obj: any = {}; @@ -2710,12 +2803,18 @@ export const QuerySwapExactAmountOutRequest = { return message; }, fromAmino(object: QuerySwapExactAmountOutRequestAmino): QuerySwapExactAmountOutRequest { - return { - sender: object.sender, - poolId: BigInt(object.pool_id), - routes: Array.isArray(object?.routes) ? object.routes.map((e: any) => SwapAmountOutRoute.fromAmino(e)) : [], - tokenOut: object.token_out - }; + const message = createBaseQuerySwapExactAmountOutRequest(); + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + if (object.pool_id !== undefined && object.pool_id !== null) { + message.poolId = BigInt(object.pool_id); + } + message.routes = object.routes?.map(e => SwapAmountOutRoute.fromAmino(e)) || []; + if (object.token_out !== undefined && object.token_out !== null) { + message.tokenOut = object.token_out; + } + return message; }, toAmino(message: QuerySwapExactAmountOutRequest): QuerySwapExactAmountOutRequestAmino { const obj: any = {}; @@ -2787,9 +2886,11 @@ export const QuerySwapExactAmountOutResponse = { return message; }, fromAmino(object: QuerySwapExactAmountOutResponseAmino): QuerySwapExactAmountOutResponse { - return { - tokenInAmount: object.token_in_amount - }; + const message = createBaseQuerySwapExactAmountOutResponse(); + if (object.token_in_amount !== undefined && object.token_in_amount !== null) { + message.tokenInAmount = object.token_in_amount; + } + return message; }, toAmino(message: QuerySwapExactAmountOutResponse): QuerySwapExactAmountOutResponseAmino { const obj: any = {}; @@ -2845,7 +2946,8 @@ export const QueryTotalLiquidityRequest = { return message; }, fromAmino(_: QueryTotalLiquidityRequestAmino): QueryTotalLiquidityRequest { - return {}; + const message = createBaseQueryTotalLiquidityRequest(); + return message; }, toAmino(_: QueryTotalLiquidityRequest): QueryTotalLiquidityRequestAmino { const obj: any = {}; @@ -2909,9 +3011,9 @@ export const QueryTotalLiquidityResponse = { return message; }, fromAmino(object: QueryTotalLiquidityResponseAmino): QueryTotalLiquidityResponse { - return { - liquidity: Array.isArray(object?.liquidity) ? object.liquidity.map((e: any) => Coin.fromAmino(e)) : [] - }; + const message = createBaseQueryTotalLiquidityResponse(); + message.liquidity = object.liquidity?.map(e => Coin.fromAmino(e)) || []; + return message; }, toAmino(message: QueryTotalLiquidityResponse): QueryTotalLiquidityResponseAmino { const obj: any = {}; @@ -2980,9 +3082,11 @@ export const QueryConcentratedPoolIdLinkFromCFMMRequest = { return message; }, fromAmino(object: QueryConcentratedPoolIdLinkFromCFMMRequestAmino): QueryConcentratedPoolIdLinkFromCFMMRequest { - return { - cfmmPoolId: BigInt(object.cfmm_pool_id) - }; + const message = createBaseQueryConcentratedPoolIdLinkFromCFMMRequest(); + if (object.cfmm_pool_id !== undefined && object.cfmm_pool_id !== null) { + message.cfmmPoolId = BigInt(object.cfmm_pool_id); + } + return message; }, toAmino(message: QueryConcentratedPoolIdLinkFromCFMMRequest): QueryConcentratedPoolIdLinkFromCFMMRequestAmino { const obj: any = {}; @@ -3047,9 +3151,11 @@ export const QueryConcentratedPoolIdLinkFromCFMMResponse = { return message; }, fromAmino(object: QueryConcentratedPoolIdLinkFromCFMMResponseAmino): QueryConcentratedPoolIdLinkFromCFMMResponse { - return { - concentratedPoolId: BigInt(object.concentrated_pool_id) - }; + const message = createBaseQueryConcentratedPoolIdLinkFromCFMMResponse(); + if (object.concentrated_pool_id !== undefined && object.concentrated_pool_id !== null) { + message.concentratedPoolId = BigInt(object.concentrated_pool_id); + } + return message; }, toAmino(message: QueryConcentratedPoolIdLinkFromCFMMResponse): QueryConcentratedPoolIdLinkFromCFMMResponseAmino { const obj: any = {}; @@ -3078,18 +3184,143 @@ export const QueryConcentratedPoolIdLinkFromCFMMResponse = { }; } }; +function createBaseQueryCFMMConcentratedPoolLinksRequest(): QueryCFMMConcentratedPoolLinksRequest { + return {}; +} +export const QueryCFMMConcentratedPoolLinksRequest = { + typeUrl: "/osmosis.gamm.v1beta1.QueryCFMMConcentratedPoolLinksRequest", + encode(_: QueryCFMMConcentratedPoolLinksRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryCFMMConcentratedPoolLinksRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryCFMMConcentratedPoolLinksRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): QueryCFMMConcentratedPoolLinksRequest { + const message = createBaseQueryCFMMConcentratedPoolLinksRequest(); + return message; + }, + fromAmino(_: QueryCFMMConcentratedPoolLinksRequestAmino): QueryCFMMConcentratedPoolLinksRequest { + const message = createBaseQueryCFMMConcentratedPoolLinksRequest(); + return message; + }, + toAmino(_: QueryCFMMConcentratedPoolLinksRequest): QueryCFMMConcentratedPoolLinksRequestAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: QueryCFMMConcentratedPoolLinksRequestAminoMsg): QueryCFMMConcentratedPoolLinksRequest { + return QueryCFMMConcentratedPoolLinksRequest.fromAmino(object.value); + }, + toAminoMsg(message: QueryCFMMConcentratedPoolLinksRequest): QueryCFMMConcentratedPoolLinksRequestAminoMsg { + return { + type: "osmosis/gamm/query-cfmm-concentrated-pool-links-request", + value: QueryCFMMConcentratedPoolLinksRequest.toAmino(message) + }; + }, + fromProtoMsg(message: QueryCFMMConcentratedPoolLinksRequestProtoMsg): QueryCFMMConcentratedPoolLinksRequest { + return QueryCFMMConcentratedPoolLinksRequest.decode(message.value); + }, + toProto(message: QueryCFMMConcentratedPoolLinksRequest): Uint8Array { + return QueryCFMMConcentratedPoolLinksRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryCFMMConcentratedPoolLinksRequest): QueryCFMMConcentratedPoolLinksRequestProtoMsg { + return { + typeUrl: "/osmosis.gamm.v1beta1.QueryCFMMConcentratedPoolLinksRequest", + value: QueryCFMMConcentratedPoolLinksRequest.encode(message).finish() + }; + } +}; +function createBaseQueryCFMMConcentratedPoolLinksResponse(): QueryCFMMConcentratedPoolLinksResponse { + return { + migrationRecords: undefined + }; +} +export const QueryCFMMConcentratedPoolLinksResponse = { + typeUrl: "/osmosis.gamm.v1beta1.QueryCFMMConcentratedPoolLinksResponse", + encode(message: QueryCFMMConcentratedPoolLinksResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.migrationRecords !== undefined) { + MigrationRecords.encode(message.migrationRecords, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryCFMMConcentratedPoolLinksResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryCFMMConcentratedPoolLinksResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.migrationRecords = MigrationRecords.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryCFMMConcentratedPoolLinksResponse { + const message = createBaseQueryCFMMConcentratedPoolLinksResponse(); + message.migrationRecords = object.migrationRecords !== undefined && object.migrationRecords !== null ? MigrationRecords.fromPartial(object.migrationRecords) : undefined; + return message; + }, + fromAmino(object: QueryCFMMConcentratedPoolLinksResponseAmino): QueryCFMMConcentratedPoolLinksResponse { + const message = createBaseQueryCFMMConcentratedPoolLinksResponse(); + if (object.migration_records !== undefined && object.migration_records !== null) { + message.migrationRecords = MigrationRecords.fromAmino(object.migration_records); + } + return message; + }, + toAmino(message: QueryCFMMConcentratedPoolLinksResponse): QueryCFMMConcentratedPoolLinksResponseAmino { + const obj: any = {}; + obj.migration_records = message.migrationRecords ? MigrationRecords.toAmino(message.migrationRecords) : undefined; + return obj; + }, + fromAminoMsg(object: QueryCFMMConcentratedPoolLinksResponseAminoMsg): QueryCFMMConcentratedPoolLinksResponse { + return QueryCFMMConcentratedPoolLinksResponse.fromAmino(object.value); + }, + toAminoMsg(message: QueryCFMMConcentratedPoolLinksResponse): QueryCFMMConcentratedPoolLinksResponseAminoMsg { + return { + type: "osmosis/gamm/query-cfmm-concentrated-pool-links-response", + value: QueryCFMMConcentratedPoolLinksResponse.toAmino(message) + }; + }, + fromProtoMsg(message: QueryCFMMConcentratedPoolLinksResponseProtoMsg): QueryCFMMConcentratedPoolLinksResponse { + return QueryCFMMConcentratedPoolLinksResponse.decode(message.value); + }, + toProto(message: QueryCFMMConcentratedPoolLinksResponse): Uint8Array { + return QueryCFMMConcentratedPoolLinksResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryCFMMConcentratedPoolLinksResponse): QueryCFMMConcentratedPoolLinksResponseProtoMsg { + return { + typeUrl: "/osmosis.gamm.v1beta1.QueryCFMMConcentratedPoolLinksResponse", + value: QueryCFMMConcentratedPoolLinksResponse.encode(message).finish() + }; + } +}; export const PoolI_InterfaceDecoder = (input: BinaryReader | Uint8Array): Pool1 | CosmWasmPool | Pool2 | Pool3 | Any => { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - const data = Any.decode(reader, reader.uint32()); + const data = Any.decode(reader, reader.uint32(), true); switch (data.typeUrl) { case "/osmosis.concentratedliquidity.v1beta1.Pool": - return Pool1.decode(data.value); + return Pool1.decode(data.value, undefined, true); case "/osmosis.cosmwasmpool.v1beta1.CosmWasmPool": - return CosmWasmPool.decode(data.value); - case "/osmosis.gamm.v1beta1.Pool": - return Pool2.decode(data.value); + return CosmWasmPool.decode(data.value, undefined, true); case "/osmosis.gamm.poolmodels.stableswap.v1beta1.Pool": - return Pool3.decode(data.value); + return Pool2.decode(data.value, undefined, true); + case "/osmosis.gamm.v1beta1.Pool": + return Pool3.decode(data.value, undefined, true); default: return data; } @@ -3106,14 +3337,14 @@ export const PoolI_FromAmino = (content: AnyAmino) => { typeUrl: "/osmosis.cosmwasmpool.v1beta1.CosmWasmPool", value: CosmWasmPool.encode(CosmWasmPool.fromPartial(CosmWasmPool.fromAmino(content.value))).finish() }); - case "osmosis/gamm/BalancerPool": + case "osmosis/gamm/StableswapPool": return Any.fromPartial({ - typeUrl: "/osmosis.gamm.v1beta1.Pool", + typeUrl: "/osmosis.gamm.poolmodels.stableswap.v1beta1.Pool", value: Pool2.encode(Pool2.fromPartial(Pool2.fromAmino(content.value))).finish() }); - case "osmosis/gamm/StableswapPool": + case "osmosis/gamm/BalancerPool": return Any.fromPartial({ - typeUrl: "/osmosis.gamm.poolmodels.stableswap.v1beta1.Pool", + typeUrl: "/osmosis.gamm.v1beta1.Pool", value: Pool3.encode(Pool3.fromPartial(Pool3.fromAmino(content.value))).finish() }); default: @@ -3125,22 +3356,22 @@ export const PoolI_ToAmino = (content: Any) => { case "/osmosis.concentratedliquidity.v1beta1.Pool": return { type: "osmosis/concentratedliquidity/pool", - value: Pool1.toAmino(Pool1.decode(content.value)) + value: Pool1.toAmino(Pool1.decode(content.value, undefined)) }; case "/osmosis.cosmwasmpool.v1beta1.CosmWasmPool": return { type: "osmosis/cosmwasmpool/cosm-wasm-pool", - value: CosmWasmPool.toAmino(CosmWasmPool.decode(content.value)) - }; - case "/osmosis.gamm.v1beta1.Pool": - return { - type: "osmosis/gamm/BalancerPool", - value: Pool2.toAmino(Pool2.decode(content.value)) + value: CosmWasmPool.toAmino(CosmWasmPool.decode(content.value, undefined)) }; case "/osmosis.gamm.poolmodels.stableswap.v1beta1.Pool": return { type: "osmosis/gamm/StableswapPool", - value: Pool3.toAmino(Pool3.decode(content.value)) + value: Pool2.toAmino(Pool2.decode(content.value, undefined)) + }; + case "/osmosis.gamm.v1beta1.Pool": + return { + type: "osmosis/gamm/BalancerPool", + value: Pool3.toAmino(Pool3.decode(content.value, undefined)) }; default: return Any.toAmino(content); diff --git a/packages/osmo-query/src/codegen/osmosis/gamm/v1beta1/shared.ts b/packages/osmo-query/src/codegen/osmosis/gamm/v1beta1/shared.ts index 006b80678..28c1614b1 100644 --- a/packages/osmo-query/src/codegen/osmosis/gamm/v1beta1/shared.ts +++ b/packages/osmo-query/src/codegen/osmosis/gamm/v1beta1/shared.ts @@ -15,7 +15,7 @@ export interface MigrationRecordsProtoMsg { * pools */ export interface MigrationRecordsAmino { - balancer_to_concentrated_pool_links: BalancerToConcentratedPoolLinkAmino[]; + balancer_to_concentrated_pool_links?: BalancerToConcentratedPoolLinkAmino[]; } export interface MigrationRecordsAminoMsg { type: "osmosis/gamm/migration-records"; @@ -53,8 +53,8 @@ export interface BalancerToConcentratedPoolLinkProtoMsg { * be linked to a maximum of one balancer pool. */ export interface BalancerToConcentratedPoolLinkAmino { - balancer_pool_id: string; - cl_pool_id: string; + balancer_pool_id?: string; + cl_pool_id?: string; } export interface BalancerToConcentratedPoolLinkAminoMsg { type: "osmosis/gamm/balancer-to-concentrated-pool-link"; @@ -108,9 +108,9 @@ export const MigrationRecords = { return message; }, fromAmino(object: MigrationRecordsAmino): MigrationRecords { - return { - balancerToConcentratedPoolLinks: Array.isArray(object?.balancer_to_concentrated_pool_links) ? object.balancer_to_concentrated_pool_links.map((e: any) => BalancerToConcentratedPoolLink.fromAmino(e)) : [] - }; + const message = createBaseMigrationRecords(); + message.balancerToConcentratedPoolLinks = object.balancer_to_concentrated_pool_links?.map(e => BalancerToConcentratedPoolLink.fromAmino(e)) || []; + return message; }, toAmino(message: MigrationRecords): MigrationRecordsAmino { const obj: any = {}; @@ -187,10 +187,14 @@ export const BalancerToConcentratedPoolLink = { return message; }, fromAmino(object: BalancerToConcentratedPoolLinkAmino): BalancerToConcentratedPoolLink { - return { - balancerPoolId: BigInt(object.balancer_pool_id), - clPoolId: BigInt(object.cl_pool_id) - }; + const message = createBaseBalancerToConcentratedPoolLink(); + if (object.balancer_pool_id !== undefined && object.balancer_pool_id !== null) { + message.balancerPoolId = BigInt(object.balancer_pool_id); + } + if (object.cl_pool_id !== undefined && object.cl_pool_id !== null) { + message.clPoolId = BigInt(object.cl_pool_id); + } + return message; }, toAmino(message: BalancerToConcentratedPoolLink): BalancerToConcentratedPoolLinkAmino { const obj: any = {}; diff --git a/packages/osmo-query/src/codegen/osmosis/gamm/v1beta1/tx.ts b/packages/osmo-query/src/codegen/osmosis/gamm/v1beta1/tx.ts index 8720d4652..0d7eb9d3b 100644 --- a/packages/osmo-query/src/codegen/osmosis/gamm/v1beta1/tx.ts +++ b/packages/osmo-query/src/codegen/osmosis/gamm/v1beta1/tx.ts @@ -20,10 +20,10 @@ export interface MsgJoinPoolProtoMsg { * This is really MsgJoinPoolNoSwap */ export interface MsgJoinPoolAmino { - sender: string; - pool_id: string; - share_out_amount: string; - token_in_maxs: CoinAmino[]; + sender?: string; + pool_id?: string; + share_out_amount?: string; + token_in_maxs?: CoinAmino[]; } export interface MsgJoinPoolAminoMsg { type: "osmosis/gamm/join-pool"; @@ -48,8 +48,8 @@ export interface MsgJoinPoolResponseProtoMsg { value: Uint8Array; } export interface MsgJoinPoolResponseAmino { - share_out_amount: string; - token_in: CoinAmino[]; + share_out_amount?: string; + token_in?: CoinAmino[]; } export interface MsgJoinPoolResponseAminoMsg { type: "osmosis/gamm/join-pool-response"; @@ -72,10 +72,10 @@ export interface MsgExitPoolProtoMsg { } /** ===================== MsgExitPool */ export interface MsgExitPoolAmino { - sender: string; - pool_id: string; - share_in_amount: string; - token_out_mins: CoinAmino[]; + sender?: string; + pool_id?: string; + share_in_amount?: string; + token_out_mins?: CoinAmino[]; } export interface MsgExitPoolAminoMsg { type: "osmosis/gamm/exit-pool"; @@ -96,7 +96,7 @@ export interface MsgExitPoolResponseProtoMsg { value: Uint8Array; } export interface MsgExitPoolResponseAmino { - token_out: CoinAmino[]; + token_out?: CoinAmino[]; } export interface MsgExitPoolResponseAminoMsg { type: "osmosis/gamm/exit-pool-response"; @@ -118,10 +118,10 @@ export interface MsgSwapExactAmountInProtoMsg { } /** ===================== MsgSwapExactAmountIn */ export interface MsgSwapExactAmountInAmino { - sender: string; - routes: SwapAmountInRouteAmino[]; + sender?: string; + routes?: SwapAmountInRouteAmino[]; token_in?: CoinAmino; - token_out_min_amount: string; + token_out_min_amount?: string; } export interface MsgSwapExactAmountInAminoMsg { type: "osmosis/gamm/swap-exact-amount-in"; @@ -142,7 +142,7 @@ export interface MsgSwapExactAmountInResponseProtoMsg { value: Uint8Array; } export interface MsgSwapExactAmountInResponseAmino { - token_out_amount: string; + token_out_amount?: string; } export interface MsgSwapExactAmountInResponseAminoMsg { type: "osmosis/gamm/swap-exact-amount-in-response"; @@ -162,9 +162,9 @@ export interface MsgSwapExactAmountOutProtoMsg { value: Uint8Array; } export interface MsgSwapExactAmountOutAmino { - sender: string; - routes: SwapAmountOutRouteAmino[]; - token_in_max_amount: string; + sender?: string; + routes?: SwapAmountOutRouteAmino[]; + token_in_max_amount?: string; token_out?: CoinAmino; } export interface MsgSwapExactAmountOutAminoMsg { @@ -185,7 +185,7 @@ export interface MsgSwapExactAmountOutResponseProtoMsg { value: Uint8Array; } export interface MsgSwapExactAmountOutResponseAmino { - token_in_amount: string; + token_in_amount?: string; } export interface MsgSwapExactAmountOutResponseAminoMsg { type: "osmosis/gamm/swap-exact-amount-out-response"; @@ -213,10 +213,10 @@ export interface MsgJoinSwapExternAmountInProtoMsg { * TODO: Rename to MsgJoinSwapExactAmountIn */ export interface MsgJoinSwapExternAmountInAmino { - sender: string; - pool_id: string; + sender?: string; + pool_id?: string; token_in?: CoinAmino; - share_out_min_amount: string; + share_out_min_amount?: string; } export interface MsgJoinSwapExternAmountInAminoMsg { type: "osmosis/gamm/join-swap-extern-amount-in"; @@ -240,7 +240,7 @@ export interface MsgJoinSwapExternAmountInResponseProtoMsg { value: Uint8Array; } export interface MsgJoinSwapExternAmountInResponseAmino { - share_out_amount: string; + share_out_amount?: string; } export interface MsgJoinSwapExternAmountInResponseAminoMsg { type: "osmosis/gamm/join-swap-extern-amount-in-response"; @@ -263,11 +263,11 @@ export interface MsgJoinSwapShareAmountOutProtoMsg { } /** ===================== MsgJoinSwapShareAmountOut */ export interface MsgJoinSwapShareAmountOutAmino { - sender: string; - pool_id: string; - token_in_denom: string; - share_out_amount: string; - token_in_max_amount: string; + sender?: string; + pool_id?: string; + token_in_denom?: string; + share_out_amount?: string; + token_in_max_amount?: string; } export interface MsgJoinSwapShareAmountOutAminoMsg { type: "osmosis/gamm/join-swap-share-amount-out"; @@ -289,7 +289,7 @@ export interface MsgJoinSwapShareAmountOutResponseProtoMsg { value: Uint8Array; } export interface MsgJoinSwapShareAmountOutResponseAmino { - token_in_amount: string; + token_in_amount?: string; } export interface MsgJoinSwapShareAmountOutResponseAminoMsg { type: "osmosis/gamm/join-swap-share-amount-out-response"; @@ -312,11 +312,11 @@ export interface MsgExitSwapShareAmountInProtoMsg { } /** ===================== MsgExitSwapShareAmountIn */ export interface MsgExitSwapShareAmountInAmino { - sender: string; - pool_id: string; - token_out_denom: string; - share_in_amount: string; - token_out_min_amount: string; + sender?: string; + pool_id?: string; + token_out_denom?: string; + share_in_amount?: string; + token_out_min_amount?: string; } export interface MsgExitSwapShareAmountInAminoMsg { type: "osmosis/gamm/exit-swap-share-amount-in"; @@ -338,7 +338,7 @@ export interface MsgExitSwapShareAmountInResponseProtoMsg { value: Uint8Array; } export interface MsgExitSwapShareAmountInResponseAmino { - token_out_amount: string; + token_out_amount?: string; } export interface MsgExitSwapShareAmountInResponseAminoMsg { type: "osmosis/gamm/exit-swap-share-amount-in-response"; @@ -360,10 +360,10 @@ export interface MsgExitSwapExternAmountOutProtoMsg { } /** ===================== MsgExitSwapExternAmountOut */ export interface MsgExitSwapExternAmountOutAmino { - sender: string; - pool_id: string; + sender?: string; + pool_id?: string; token_out?: CoinAmino; - share_in_max_amount: string; + share_in_max_amount?: string; } export interface MsgExitSwapExternAmountOutAminoMsg { type: "osmosis/gamm/exit-swap-extern-amount-out"; @@ -384,7 +384,7 @@ export interface MsgExitSwapExternAmountOutResponseProtoMsg { value: Uint8Array; } export interface MsgExitSwapExternAmountOutResponseAmino { - share_in_amount: string; + share_in_amount?: string; } export interface MsgExitSwapExternAmountOutResponseAminoMsg { type: "osmosis/gamm/exit-swap-extern-amount-out-response"; @@ -453,12 +453,18 @@ export const MsgJoinPool = { return message; }, fromAmino(object: MsgJoinPoolAmino): MsgJoinPool { - return { - sender: object.sender, - poolId: BigInt(object.pool_id), - shareOutAmount: object.share_out_amount, - tokenInMaxs: Array.isArray(object?.token_in_maxs) ? object.token_in_maxs.map((e: any) => Coin.fromAmino(e)) : [] - }; + const message = createBaseMsgJoinPool(); + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + if (object.pool_id !== undefined && object.pool_id !== null) { + message.poolId = BigInt(object.pool_id); + } + if (object.share_out_amount !== undefined && object.share_out_amount !== null) { + message.shareOutAmount = object.share_out_amount; + } + message.tokenInMaxs = object.token_in_maxs?.map(e => Coin.fromAmino(e)) || []; + return message; }, toAmino(message: MsgJoinPool): MsgJoinPoolAmino { const obj: any = {}; @@ -538,10 +544,12 @@ export const MsgJoinPoolResponse = { return message; }, fromAmino(object: MsgJoinPoolResponseAmino): MsgJoinPoolResponse { - return { - shareOutAmount: object.share_out_amount, - tokenIn: Array.isArray(object?.token_in) ? object.token_in.map((e: any) => Coin.fromAmino(e)) : [] - }; + const message = createBaseMsgJoinPoolResponse(); + if (object.share_out_amount !== undefined && object.share_out_amount !== null) { + message.shareOutAmount = object.share_out_amount; + } + message.tokenIn = object.token_in?.map(e => Coin.fromAmino(e)) || []; + return message; }, toAmino(message: MsgJoinPoolResponse): MsgJoinPoolResponseAmino { const obj: any = {}; @@ -635,12 +643,18 @@ export const MsgExitPool = { return message; }, fromAmino(object: MsgExitPoolAmino): MsgExitPool { - return { - sender: object.sender, - poolId: BigInt(object.pool_id), - shareInAmount: object.share_in_amount, - tokenOutMins: Array.isArray(object?.token_out_mins) ? object.token_out_mins.map((e: any) => Coin.fromAmino(e)) : [] - }; + const message = createBaseMsgExitPool(); + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + if (object.pool_id !== undefined && object.pool_id !== null) { + message.poolId = BigInt(object.pool_id); + } + if (object.share_in_amount !== undefined && object.share_in_amount !== null) { + message.shareInAmount = object.share_in_amount; + } + message.tokenOutMins = object.token_out_mins?.map(e => Coin.fromAmino(e)) || []; + return message; }, toAmino(message: MsgExitPool): MsgExitPoolAmino { const obj: any = {}; @@ -712,9 +726,9 @@ export const MsgExitPoolResponse = { return message; }, fromAmino(object: MsgExitPoolResponseAmino): MsgExitPoolResponse { - return { - tokenOut: Array.isArray(object?.token_out) ? object.token_out.map((e: any) => Coin.fromAmino(e)) : [] - }; + const message = createBaseMsgExitPoolResponse(); + message.tokenOut = object.token_out?.map(e => Coin.fromAmino(e)) || []; + return message; }, toAmino(message: MsgExitPoolResponse): MsgExitPoolResponseAmino { const obj: any = {}; @@ -807,12 +821,18 @@ export const MsgSwapExactAmountIn = { return message; }, fromAmino(object: MsgSwapExactAmountInAmino): MsgSwapExactAmountIn { - return { - sender: object.sender, - routes: Array.isArray(object?.routes) ? object.routes.map((e: any) => SwapAmountInRoute.fromAmino(e)) : [], - tokenIn: object?.token_in ? Coin.fromAmino(object.token_in) : undefined, - tokenOutMinAmount: object.token_out_min_amount - }; + const message = createBaseMsgSwapExactAmountIn(); + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + message.routes = object.routes?.map(e => SwapAmountInRoute.fromAmino(e)) || []; + if (object.token_in !== undefined && object.token_in !== null) { + message.tokenIn = Coin.fromAmino(object.token_in); + } + if (object.token_out_min_amount !== undefined && object.token_out_min_amount !== null) { + message.tokenOutMinAmount = object.token_out_min_amount; + } + return message; }, toAmino(message: MsgSwapExactAmountIn): MsgSwapExactAmountInAmino { const obj: any = {}; @@ -884,9 +904,11 @@ export const MsgSwapExactAmountInResponse = { return message; }, fromAmino(object: MsgSwapExactAmountInResponseAmino): MsgSwapExactAmountInResponse { - return { - tokenOutAmount: object.token_out_amount - }; + const message = createBaseMsgSwapExactAmountInResponse(); + if (object.token_out_amount !== undefined && object.token_out_amount !== null) { + message.tokenOutAmount = object.token_out_amount; + } + return message; }, toAmino(message: MsgSwapExactAmountInResponse): MsgSwapExactAmountInResponseAmino { const obj: any = {}; @@ -975,12 +997,18 @@ export const MsgSwapExactAmountOut = { return message; }, fromAmino(object: MsgSwapExactAmountOutAmino): MsgSwapExactAmountOut { - return { - sender: object.sender, - routes: Array.isArray(object?.routes) ? object.routes.map((e: any) => SwapAmountOutRoute.fromAmino(e)) : [], - tokenInMaxAmount: object.token_in_max_amount, - tokenOut: object?.token_out ? Coin.fromAmino(object.token_out) : undefined - }; + const message = createBaseMsgSwapExactAmountOut(); + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + message.routes = object.routes?.map(e => SwapAmountOutRoute.fromAmino(e)) || []; + if (object.token_in_max_amount !== undefined && object.token_in_max_amount !== null) { + message.tokenInMaxAmount = object.token_in_max_amount; + } + if (object.token_out !== undefined && object.token_out !== null) { + message.tokenOut = Coin.fromAmino(object.token_out); + } + return message; }, toAmino(message: MsgSwapExactAmountOut): MsgSwapExactAmountOutAmino { const obj: any = {}; @@ -1052,9 +1080,11 @@ export const MsgSwapExactAmountOutResponse = { return message; }, fromAmino(object: MsgSwapExactAmountOutResponseAmino): MsgSwapExactAmountOutResponse { - return { - tokenInAmount: object.token_in_amount - }; + const message = createBaseMsgSwapExactAmountOutResponse(); + if (object.token_in_amount !== undefined && object.token_in_amount !== null) { + message.tokenInAmount = object.token_in_amount; + } + return message; }, toAmino(message: MsgSwapExactAmountOutResponse): MsgSwapExactAmountOutResponseAmino { const obj: any = {}; @@ -1143,12 +1173,20 @@ export const MsgJoinSwapExternAmountIn = { return message; }, fromAmino(object: MsgJoinSwapExternAmountInAmino): MsgJoinSwapExternAmountIn { - return { - sender: object.sender, - poolId: BigInt(object.pool_id), - tokenIn: object?.token_in ? Coin.fromAmino(object.token_in) : undefined, - shareOutMinAmount: object.share_out_min_amount - }; + const message = createBaseMsgJoinSwapExternAmountIn(); + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + if (object.pool_id !== undefined && object.pool_id !== null) { + message.poolId = BigInt(object.pool_id); + } + if (object.token_in !== undefined && object.token_in !== null) { + message.tokenIn = Coin.fromAmino(object.token_in); + } + if (object.share_out_min_amount !== undefined && object.share_out_min_amount !== null) { + message.shareOutMinAmount = object.share_out_min_amount; + } + return message; }, toAmino(message: MsgJoinSwapExternAmountIn): MsgJoinSwapExternAmountInAmino { const obj: any = {}; @@ -1216,9 +1254,11 @@ export const MsgJoinSwapExternAmountInResponse = { return message; }, fromAmino(object: MsgJoinSwapExternAmountInResponseAmino): MsgJoinSwapExternAmountInResponse { - return { - shareOutAmount: object.share_out_amount - }; + const message = createBaseMsgJoinSwapExternAmountInResponse(); + if (object.share_out_amount !== undefined && object.share_out_amount !== null) { + message.shareOutAmount = object.share_out_amount; + } + return message; }, toAmino(message: MsgJoinSwapExternAmountInResponse): MsgJoinSwapExternAmountInResponseAmino { const obj: any = {}; @@ -1315,13 +1355,23 @@ export const MsgJoinSwapShareAmountOut = { return message; }, fromAmino(object: MsgJoinSwapShareAmountOutAmino): MsgJoinSwapShareAmountOut { - return { - sender: object.sender, - poolId: BigInt(object.pool_id), - tokenInDenom: object.token_in_denom, - shareOutAmount: object.share_out_amount, - tokenInMaxAmount: object.token_in_max_amount - }; + const message = createBaseMsgJoinSwapShareAmountOut(); + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + if (object.pool_id !== undefined && object.pool_id !== null) { + message.poolId = BigInt(object.pool_id); + } + if (object.token_in_denom !== undefined && object.token_in_denom !== null) { + message.tokenInDenom = object.token_in_denom; + } + if (object.share_out_amount !== undefined && object.share_out_amount !== null) { + message.shareOutAmount = object.share_out_amount; + } + if (object.token_in_max_amount !== undefined && object.token_in_max_amount !== null) { + message.tokenInMaxAmount = object.token_in_max_amount; + } + return message; }, toAmino(message: MsgJoinSwapShareAmountOut): MsgJoinSwapShareAmountOutAmino { const obj: any = {}; @@ -1390,9 +1440,11 @@ export const MsgJoinSwapShareAmountOutResponse = { return message; }, fromAmino(object: MsgJoinSwapShareAmountOutResponseAmino): MsgJoinSwapShareAmountOutResponse { - return { - tokenInAmount: object.token_in_amount - }; + const message = createBaseMsgJoinSwapShareAmountOutResponse(); + if (object.token_in_amount !== undefined && object.token_in_amount !== null) { + message.tokenInAmount = object.token_in_amount; + } + return message; }, toAmino(message: MsgJoinSwapShareAmountOutResponse): MsgJoinSwapShareAmountOutResponseAmino { const obj: any = {}; @@ -1489,13 +1541,23 @@ export const MsgExitSwapShareAmountIn = { return message; }, fromAmino(object: MsgExitSwapShareAmountInAmino): MsgExitSwapShareAmountIn { - return { - sender: object.sender, - poolId: BigInt(object.pool_id), - tokenOutDenom: object.token_out_denom, - shareInAmount: object.share_in_amount, - tokenOutMinAmount: object.token_out_min_amount - }; + const message = createBaseMsgExitSwapShareAmountIn(); + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + if (object.pool_id !== undefined && object.pool_id !== null) { + message.poolId = BigInt(object.pool_id); + } + if (object.token_out_denom !== undefined && object.token_out_denom !== null) { + message.tokenOutDenom = object.token_out_denom; + } + if (object.share_in_amount !== undefined && object.share_in_amount !== null) { + message.shareInAmount = object.share_in_amount; + } + if (object.token_out_min_amount !== undefined && object.token_out_min_amount !== null) { + message.tokenOutMinAmount = object.token_out_min_amount; + } + return message; }, toAmino(message: MsgExitSwapShareAmountIn): MsgExitSwapShareAmountInAmino { const obj: any = {}; @@ -1564,9 +1626,11 @@ export const MsgExitSwapShareAmountInResponse = { return message; }, fromAmino(object: MsgExitSwapShareAmountInResponseAmino): MsgExitSwapShareAmountInResponse { - return { - tokenOutAmount: object.token_out_amount - }; + const message = createBaseMsgExitSwapShareAmountInResponse(); + if (object.token_out_amount !== undefined && object.token_out_amount !== null) { + message.tokenOutAmount = object.token_out_amount; + } + return message; }, toAmino(message: MsgExitSwapShareAmountInResponse): MsgExitSwapShareAmountInResponseAmino { const obj: any = {}; @@ -1655,12 +1719,20 @@ export const MsgExitSwapExternAmountOut = { return message; }, fromAmino(object: MsgExitSwapExternAmountOutAmino): MsgExitSwapExternAmountOut { - return { - sender: object.sender, - poolId: BigInt(object.pool_id), - tokenOut: object?.token_out ? Coin.fromAmino(object.token_out) : undefined, - shareInMaxAmount: object.share_in_max_amount - }; + const message = createBaseMsgExitSwapExternAmountOut(); + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + if (object.pool_id !== undefined && object.pool_id !== null) { + message.poolId = BigInt(object.pool_id); + } + if (object.token_out !== undefined && object.token_out !== null) { + message.tokenOut = Coin.fromAmino(object.token_out); + } + if (object.share_in_max_amount !== undefined && object.share_in_max_amount !== null) { + message.shareInMaxAmount = object.share_in_max_amount; + } + return message; }, toAmino(message: MsgExitSwapExternAmountOut): MsgExitSwapExternAmountOutAmino { const obj: any = {}; @@ -1728,9 +1800,11 @@ export const MsgExitSwapExternAmountOutResponse = { return message; }, fromAmino(object: MsgExitSwapExternAmountOutResponseAmino): MsgExitSwapExternAmountOutResponse { - return { - shareInAmount: object.share_in_amount - }; + const message = createBaseMsgExitSwapExternAmountOutResponse(); + if (object.share_in_amount !== undefined && object.share_in_amount !== null) { + message.shareInAmount = object.share_in_amount; + } + return message; }, toAmino(message: MsgExitSwapExternAmountOutResponse): MsgExitSwapExternAmountOutResponseAmino { const obj: any = {}; diff --git a/packages/osmo-query/src/codegen/osmosis/gamm/v2/query.ts b/packages/osmo-query/src/codegen/osmosis/gamm/v2/query.ts index 90c0ddf8b..516417603 100644 --- a/packages/osmo-query/src/codegen/osmosis/gamm/v2/query.ts +++ b/packages/osmo-query/src/codegen/osmosis/gamm/v2/query.ts @@ -13,9 +13,9 @@ export interface QuerySpotPriceRequestProtoMsg { /** Deprecated: please use alternate in x/poolmanager */ /** @deprecated */ export interface QuerySpotPriceRequestAmino { - pool_id: string; - base_asset_denom: string; - quote_asset_denom: string; + pool_id?: string; + base_asset_denom?: string; + quote_asset_denom?: string; } export interface QuerySpotPriceRequestAminoMsg { type: "osmosis/gamm/v2/query-spot-price-request"; @@ -28,7 +28,7 @@ export interface QuerySpotPriceRequestSDKType { base_asset_denom: string; quote_asset_denom: string; } -/** Depreacted: please use alternate in x/poolmanager */ +/** Deprecated: please use alternate in x/poolmanager */ /** @deprecated */ export interface QuerySpotPriceResponse { /** String of the Dec. Ex) 10.203uatom */ @@ -38,17 +38,17 @@ export interface QuerySpotPriceResponseProtoMsg { typeUrl: "/osmosis.gamm.v2.QuerySpotPriceResponse"; value: Uint8Array; } -/** Depreacted: please use alternate in x/poolmanager */ +/** Deprecated: please use alternate in x/poolmanager */ /** @deprecated */ export interface QuerySpotPriceResponseAmino { /** String of the Dec. Ex) 10.203uatom */ - spot_price: string; + spot_price?: string; } export interface QuerySpotPriceResponseAminoMsg { type: "osmosis/gamm/v2/query-spot-price-response"; value: QuerySpotPriceResponseAmino; } -/** Depreacted: please use alternate in x/poolmanager */ +/** Deprecated: please use alternate in x/poolmanager */ /** @deprecated */ export interface QuerySpotPriceResponseSDKType { spot_price: string; @@ -105,11 +105,17 @@ export const QuerySpotPriceRequest = { return message; }, fromAmino(object: QuerySpotPriceRequestAmino): QuerySpotPriceRequest { - return { - poolId: BigInt(object.pool_id), - baseAssetDenom: object.base_asset_denom, - quoteAssetDenom: object.quote_asset_denom - }; + const message = createBaseQuerySpotPriceRequest(); + if (object.pool_id !== undefined && object.pool_id !== null) { + message.poolId = BigInt(object.pool_id); + } + if (object.base_asset_denom !== undefined && object.base_asset_denom !== null) { + message.baseAssetDenom = object.base_asset_denom; + } + if (object.quote_asset_denom !== undefined && object.quote_asset_denom !== null) { + message.quoteAssetDenom = object.quote_asset_denom; + } + return message; }, toAmino(message: QuerySpotPriceRequest): QuerySpotPriceRequestAmino { const obj: any = {}; @@ -176,9 +182,11 @@ export const QuerySpotPriceResponse = { return message; }, fromAmino(object: QuerySpotPriceResponseAmino): QuerySpotPriceResponse { - return { - spotPrice: object.spot_price - }; + const message = createBaseQuerySpotPriceResponse(); + if (object.spot_price !== undefined && object.spot_price !== null) { + message.spotPrice = object.spot_price; + } + return message; }, toAmino(message: QuerySpotPriceResponse): QuerySpotPriceResponseAmino { const obj: any = {}; diff --git a/packages/osmo-query/src/codegen/osmosis/ibc-rate-limit/v1beta1/genesis.ts b/packages/osmo-query/src/codegen/osmosis/ibchooks/genesis.ts similarity index 76% rename from packages/osmo-query/src/codegen/osmosis/ibc-rate-limit/v1beta1/genesis.ts rename to packages/osmo-query/src/codegen/osmosis/ibchooks/genesis.ts index d46bb98a9..c948fa79f 100644 --- a/packages/osmo-query/src/codegen/osmosis/ibc-rate-limit/v1beta1/genesis.ts +++ b/packages/osmo-query/src/codegen/osmosis/ibchooks/genesis.ts @@ -1,24 +1,19 @@ import { Params, ParamsAmino, ParamsSDKType } from "./params"; -import { BinaryReader, BinaryWriter } from "../../../binary"; -/** GenesisState defines the ibc-rate-limit module's genesis state. */ +import { BinaryReader, BinaryWriter } from "../../binary"; export interface GenesisState { - /** params are all the parameters of the module */ params: Params; } export interface GenesisStateProtoMsg { - typeUrl: "/osmosis.ibcratelimit.v1beta1.GenesisState"; + typeUrl: "/osmosis.ibchooks.GenesisState"; value: Uint8Array; } -/** GenesisState defines the ibc-rate-limit module's genesis state. */ export interface GenesisStateAmino { - /** params are all the parameters of the module */ params?: ParamsAmino; } export interface GenesisStateAminoMsg { - type: "osmosis/ibcratelimit/genesis-state"; + type: "osmosis/ibchooks/genesis-state"; value: GenesisStateAmino; } -/** GenesisState defines the ibc-rate-limit module's genesis state. */ export interface GenesisStateSDKType { params: ParamsSDKType; } @@ -28,7 +23,7 @@ function createBaseGenesisState(): GenesisState { }; } export const GenesisState = { - typeUrl: "/osmosis.ibcratelimit.v1beta1.GenesisState", + typeUrl: "/osmosis.ibchooks.GenesisState", encode(message: GenesisState, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.params !== undefined) { Params.encode(message.params, writer.uint32(10).fork()).ldelim(); @@ -58,9 +53,11 @@ export const GenesisState = { return message; }, fromAmino(object: GenesisStateAmino): GenesisState { - return { - params: object?.params ? Params.fromAmino(object.params) : undefined - }; + const message = createBaseGenesisState(); + if (object.params !== undefined && object.params !== null) { + message.params = Params.fromAmino(object.params); + } + return message; }, toAmino(message: GenesisState): GenesisStateAmino { const obj: any = {}; @@ -72,7 +69,7 @@ export const GenesisState = { }, toAminoMsg(message: GenesisState): GenesisStateAminoMsg { return { - type: "osmosis/ibcratelimit/genesis-state", + type: "osmosis/ibchooks/genesis-state", value: GenesisState.toAmino(message) }; }, @@ -84,7 +81,7 @@ export const GenesisState = { }, toProtoMsg(message: GenesisState): GenesisStateProtoMsg { return { - typeUrl: "/osmosis.ibcratelimit.v1beta1.GenesisState", + typeUrl: "/osmosis.ibchooks.GenesisState", value: GenesisState.encode(message).finish() }; } diff --git a/packages/osmo-query/src/codegen/osmosis/ibchooks/params.ts b/packages/osmo-query/src/codegen/osmosis/ibchooks/params.ts new file mode 100644 index 000000000..bfa47ea33 --- /dev/null +++ b/packages/osmo-query/src/codegen/osmosis/ibchooks/params.ts @@ -0,0 +1,89 @@ +import { BinaryReader, BinaryWriter } from "../../binary"; +export interface Params { + allowedAsyncAckContracts: string[]; +} +export interface ParamsProtoMsg { + typeUrl: "/osmosis.ibchooks.Params"; + value: Uint8Array; +} +export interface ParamsAmino { + allowed_async_ack_contracts?: string[]; +} +export interface ParamsAminoMsg { + type: "osmosis/ibchooks/params"; + value: ParamsAmino; +} +export interface ParamsSDKType { + allowed_async_ack_contracts: string[]; +} +function createBaseParams(): Params { + return { + allowedAsyncAckContracts: [] + }; +} +export const Params = { + typeUrl: "/osmosis.ibchooks.Params", + encode(message: Params, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.allowedAsyncAckContracts) { + writer.uint32(10).string(v!); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): Params { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseParams(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.allowedAsyncAckContracts.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): Params { + const message = createBaseParams(); + message.allowedAsyncAckContracts = object.allowedAsyncAckContracts?.map(e => e) || []; + return message; + }, + fromAmino(object: ParamsAmino): Params { + const message = createBaseParams(); + message.allowedAsyncAckContracts = object.allowed_async_ack_contracts?.map(e => e) || []; + return message; + }, + toAmino(message: Params): ParamsAmino { + const obj: any = {}; + if (message.allowedAsyncAckContracts) { + obj.allowed_async_ack_contracts = message.allowedAsyncAckContracts.map(e => e); + } else { + obj.allowed_async_ack_contracts = []; + } + return obj; + }, + fromAminoMsg(object: ParamsAminoMsg): Params { + return Params.fromAmino(object.value); + }, + toAminoMsg(message: Params): ParamsAminoMsg { + return { + type: "osmosis/ibchooks/params", + value: Params.toAmino(message) + }; + }, + fromProtoMsg(message: ParamsProtoMsg): Params { + return Params.decode(message.value); + }, + toProto(message: Params): Uint8Array { + return Params.encode(message).finish(); + }, + toProtoMsg(message: Params): ParamsProtoMsg { + return { + typeUrl: "/osmosis.ibchooks.Params", + value: Params.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/packages/osmo-query/src/codegen/osmosis/ibchooks/tx.amino.ts b/packages/osmo-query/src/codegen/osmosis/ibchooks/tx.amino.ts new file mode 100644 index 000000000..b379c5879 --- /dev/null +++ b/packages/osmo-query/src/codegen/osmosis/ibchooks/tx.amino.ts @@ -0,0 +1,9 @@ +//@ts-nocheck +import { MsgEmitIBCAck } from "./tx"; +export const AminoConverter = { + "/osmosis.ibchooks.MsgEmitIBCAck": { + aminoType: "osmosis/ibchooks/emit-ibc-ack", + toAmino: MsgEmitIBCAck.toAmino, + fromAmino: MsgEmitIBCAck.fromAmino + } +}; \ No newline at end of file diff --git a/packages/osmo-query/src/codegen/osmosis/ibchooks/tx.registry.ts b/packages/osmo-query/src/codegen/osmosis/ibchooks/tx.registry.ts new file mode 100644 index 000000000..f28f8c80a --- /dev/null +++ b/packages/osmo-query/src/codegen/osmosis/ibchooks/tx.registry.ts @@ -0,0 +1,35 @@ +//@ts-nocheck +import { GeneratedType, Registry } from "@cosmjs/proto-signing"; +import { MsgEmitIBCAck } from "./tx"; +export const registry: ReadonlyArray<[string, GeneratedType]> = [["/osmosis.ibchooks.MsgEmitIBCAck", MsgEmitIBCAck]]; +export const load = (protoRegistry: Registry) => { + registry.forEach(([typeUrl, mod]) => { + protoRegistry.register(typeUrl, mod); + }); +}; +export const MessageComposer = { + encoded: { + emitIBCAck(value: MsgEmitIBCAck) { + return { + typeUrl: "/osmosis.ibchooks.MsgEmitIBCAck", + value: MsgEmitIBCAck.encode(value).finish() + }; + } + }, + withTypeUrl: { + emitIBCAck(value: MsgEmitIBCAck) { + return { + typeUrl: "/osmosis.ibchooks.MsgEmitIBCAck", + value + }; + } + }, + fromPartial: { + emitIBCAck(value: MsgEmitIBCAck) { + return { + typeUrl: "/osmosis.ibchooks.MsgEmitIBCAck", + value: MsgEmitIBCAck.fromPartial(value) + }; + } + } +}; \ No newline at end of file diff --git a/packages/osmo-query/src/codegen/osmosis/ibchooks/tx.rpc.msg.ts b/packages/osmo-query/src/codegen/osmosis/ibchooks/tx.rpc.msg.ts new file mode 100644 index 000000000..5d6c97059 --- /dev/null +++ b/packages/osmo-query/src/codegen/osmosis/ibchooks/tx.rpc.msg.ts @@ -0,0 +1,23 @@ +import { Rpc } from "../../helpers"; +import { BinaryReader } from "../../binary"; +import { MsgEmitIBCAck, MsgEmitIBCAckResponse } from "./tx"; +/** Msg defines the Msg service. */ +export interface Msg { + /** + * EmitIBCAck checks the sender can emit the ack and writes the IBC + * acknowledgement + */ + emitIBCAck(request: MsgEmitIBCAck): Promise; +} +export class MsgClientImpl implements Msg { + private readonly rpc: Rpc; + constructor(rpc: Rpc) { + this.rpc = rpc; + this.emitIBCAck = this.emitIBCAck.bind(this); + } + emitIBCAck(request: MsgEmitIBCAck): Promise { + const data = MsgEmitIBCAck.encode(request).finish(); + const promise = this.rpc.request("osmosis.ibchooks.Msg", "EmitIBCAck", data); + return promise.then(data => MsgEmitIBCAckResponse.decode(new BinaryReader(data))); + } +} \ No newline at end of file diff --git a/packages/osmo-query/src/codegen/osmosis/ibchooks/tx.ts b/packages/osmo-query/src/codegen/osmosis/ibchooks/tx.ts new file mode 100644 index 000000000..d1f409cd4 --- /dev/null +++ b/packages/osmo-query/src/codegen/osmosis/ibchooks/tx.ts @@ -0,0 +1,218 @@ +import { BinaryReader, BinaryWriter } from "../../binary"; +export interface MsgEmitIBCAck { + sender: string; + packetSequence: bigint; + channel: string; +} +export interface MsgEmitIBCAckProtoMsg { + typeUrl: "/osmosis.ibchooks.MsgEmitIBCAck"; + value: Uint8Array; +} +export interface MsgEmitIBCAckAmino { + sender?: string; + packet_sequence?: string; + channel?: string; +} +export interface MsgEmitIBCAckAminoMsg { + type: "osmosis/ibchooks/emit-ibc-ack"; + value: MsgEmitIBCAckAmino; +} +export interface MsgEmitIBCAckSDKType { + sender: string; + packet_sequence: bigint; + channel: string; +} +export interface MsgEmitIBCAckResponse { + contractResult: string; + ibcAck: string; +} +export interface MsgEmitIBCAckResponseProtoMsg { + typeUrl: "/osmosis.ibchooks.MsgEmitIBCAckResponse"; + value: Uint8Array; +} +export interface MsgEmitIBCAckResponseAmino { + contract_result?: string; + ibc_ack?: string; +} +export interface MsgEmitIBCAckResponseAminoMsg { + type: "osmosis/ibchooks/emit-ibc-ack-response"; + value: MsgEmitIBCAckResponseAmino; +} +export interface MsgEmitIBCAckResponseSDKType { + contract_result: string; + ibc_ack: string; +} +function createBaseMsgEmitIBCAck(): MsgEmitIBCAck { + return { + sender: "", + packetSequence: BigInt(0), + channel: "" + }; +} +export const MsgEmitIBCAck = { + typeUrl: "/osmosis.ibchooks.MsgEmitIBCAck", + encode(message: MsgEmitIBCAck, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.sender !== "") { + writer.uint32(10).string(message.sender); + } + if (message.packetSequence !== BigInt(0)) { + writer.uint32(16).uint64(message.packetSequence); + } + if (message.channel !== "") { + writer.uint32(26).string(message.channel); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgEmitIBCAck { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgEmitIBCAck(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.sender = reader.string(); + break; + case 2: + message.packetSequence = reader.uint64(); + break; + case 3: + message.channel = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgEmitIBCAck { + const message = createBaseMsgEmitIBCAck(); + message.sender = object.sender ?? ""; + message.packetSequence = object.packetSequence !== undefined && object.packetSequence !== null ? BigInt(object.packetSequence.toString()) : BigInt(0); + message.channel = object.channel ?? ""; + return message; + }, + fromAmino(object: MsgEmitIBCAckAmino): MsgEmitIBCAck { + const message = createBaseMsgEmitIBCAck(); + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + if (object.packet_sequence !== undefined && object.packet_sequence !== null) { + message.packetSequence = BigInt(object.packet_sequence); + } + if (object.channel !== undefined && object.channel !== null) { + message.channel = object.channel; + } + return message; + }, + toAmino(message: MsgEmitIBCAck): MsgEmitIBCAckAmino { + const obj: any = {}; + obj.sender = message.sender; + obj.packet_sequence = message.packetSequence ? message.packetSequence.toString() : undefined; + obj.channel = message.channel; + return obj; + }, + fromAminoMsg(object: MsgEmitIBCAckAminoMsg): MsgEmitIBCAck { + return MsgEmitIBCAck.fromAmino(object.value); + }, + toAminoMsg(message: MsgEmitIBCAck): MsgEmitIBCAckAminoMsg { + return { + type: "osmosis/ibchooks/emit-ibc-ack", + value: MsgEmitIBCAck.toAmino(message) + }; + }, + fromProtoMsg(message: MsgEmitIBCAckProtoMsg): MsgEmitIBCAck { + return MsgEmitIBCAck.decode(message.value); + }, + toProto(message: MsgEmitIBCAck): Uint8Array { + return MsgEmitIBCAck.encode(message).finish(); + }, + toProtoMsg(message: MsgEmitIBCAck): MsgEmitIBCAckProtoMsg { + return { + typeUrl: "/osmosis.ibchooks.MsgEmitIBCAck", + value: MsgEmitIBCAck.encode(message).finish() + }; + } +}; +function createBaseMsgEmitIBCAckResponse(): MsgEmitIBCAckResponse { + return { + contractResult: "", + ibcAck: "" + }; +} +export const MsgEmitIBCAckResponse = { + typeUrl: "/osmosis.ibchooks.MsgEmitIBCAckResponse", + encode(message: MsgEmitIBCAckResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.contractResult !== "") { + writer.uint32(10).string(message.contractResult); + } + if (message.ibcAck !== "") { + writer.uint32(18).string(message.ibcAck); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgEmitIBCAckResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgEmitIBCAckResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.contractResult = reader.string(); + break; + case 2: + message.ibcAck = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgEmitIBCAckResponse { + const message = createBaseMsgEmitIBCAckResponse(); + message.contractResult = object.contractResult ?? ""; + message.ibcAck = object.ibcAck ?? ""; + return message; + }, + fromAmino(object: MsgEmitIBCAckResponseAmino): MsgEmitIBCAckResponse { + const message = createBaseMsgEmitIBCAckResponse(); + if (object.contract_result !== undefined && object.contract_result !== null) { + message.contractResult = object.contract_result; + } + if (object.ibc_ack !== undefined && object.ibc_ack !== null) { + message.ibcAck = object.ibc_ack; + } + return message; + }, + toAmino(message: MsgEmitIBCAckResponse): MsgEmitIBCAckResponseAmino { + const obj: any = {}; + obj.contract_result = message.contractResult; + obj.ibc_ack = message.ibcAck; + return obj; + }, + fromAminoMsg(object: MsgEmitIBCAckResponseAminoMsg): MsgEmitIBCAckResponse { + return MsgEmitIBCAckResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgEmitIBCAckResponse): MsgEmitIBCAckResponseAminoMsg { + return { + type: "osmosis/ibchooks/emit-ibc-ack-response", + value: MsgEmitIBCAckResponse.toAmino(message) + }; + }, + fromProtoMsg(message: MsgEmitIBCAckResponseProtoMsg): MsgEmitIBCAckResponse { + return MsgEmitIBCAckResponse.decode(message.value); + }, + toProto(message: MsgEmitIBCAckResponse): Uint8Array { + return MsgEmitIBCAckResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgEmitIBCAckResponse): MsgEmitIBCAckResponseProtoMsg { + return { + typeUrl: "/osmosis.ibchooks.MsgEmitIBCAckResponse", + value: MsgEmitIBCAckResponse.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/packages/osmojs/src/codegen/osmosis/ibc-rate-limit/v1beta1/genesis.ts b/packages/osmo-query/src/codegen/osmosis/ibcratelimit/v1beta1/genesis.ts similarity index 94% rename from packages/osmojs/src/codegen/osmosis/ibc-rate-limit/v1beta1/genesis.ts rename to packages/osmo-query/src/codegen/osmosis/ibcratelimit/v1beta1/genesis.ts index d46bb98a9..ac235cad8 100644 --- a/packages/osmojs/src/codegen/osmosis/ibc-rate-limit/v1beta1/genesis.ts +++ b/packages/osmo-query/src/codegen/osmosis/ibcratelimit/v1beta1/genesis.ts @@ -58,9 +58,11 @@ export const GenesisState = { return message; }, fromAmino(object: GenesisStateAmino): GenesisState { - return { - params: object?.params ? Params.fromAmino(object.params) : undefined - }; + const message = createBaseGenesisState(); + if (object.params !== undefined && object.params !== null) { + message.params = Params.fromAmino(object.params); + } + return message; }, toAmino(message: GenesisState): GenesisStateAmino { const obj: any = {}; diff --git a/packages/osmo-query/src/codegen/osmosis/ibc-rate-limit/v1beta1/params.ts b/packages/osmo-query/src/codegen/osmosis/ibcratelimit/v1beta1/params.ts similarity index 91% rename from packages/osmo-query/src/codegen/osmosis/ibc-rate-limit/v1beta1/params.ts rename to packages/osmo-query/src/codegen/osmosis/ibcratelimit/v1beta1/params.ts index 632f5d45b..f89da68ab 100644 --- a/packages/osmo-query/src/codegen/osmosis/ibc-rate-limit/v1beta1/params.ts +++ b/packages/osmo-query/src/codegen/osmosis/ibcratelimit/v1beta1/params.ts @@ -9,7 +9,7 @@ export interface ParamsProtoMsg { } /** Params defines the parameters for the ibc-rate-limit module. */ export interface ParamsAmino { - contract_address: string; + contract_address?: string; } export interface ParamsAminoMsg { type: "osmosis/ibcratelimit/params"; @@ -55,9 +55,11 @@ export const Params = { return message; }, fromAmino(object: ParamsAmino): Params { - return { - contractAddress: object.contract_address - }; + const message = createBaseParams(); + if (object.contract_address !== undefined && object.contract_address !== null) { + message.contractAddress = object.contract_address; + } + return message; }, toAmino(message: Params): ParamsAmino { const obj: any = {}; diff --git a/packages/osmo-query/src/codegen/osmosis/ibc-rate-limit/v1beta1/query.lcd.ts b/packages/osmo-query/src/codegen/osmosis/ibcratelimit/v1beta1/query.lcd.ts similarity index 100% rename from packages/osmo-query/src/codegen/osmosis/ibc-rate-limit/v1beta1/query.lcd.ts rename to packages/osmo-query/src/codegen/osmosis/ibcratelimit/v1beta1/query.lcd.ts diff --git a/packages/osmo-query/src/codegen/osmosis/ibc-rate-limit/v1beta1/query.rpc.Query.ts b/packages/osmo-query/src/codegen/osmosis/ibcratelimit/v1beta1/query.rpc.Query.ts similarity index 100% rename from packages/osmo-query/src/codegen/osmosis/ibc-rate-limit/v1beta1/query.rpc.Query.ts rename to packages/osmo-query/src/codegen/osmosis/ibcratelimit/v1beta1/query.rpc.Query.ts diff --git a/packages/osmo-query/src/codegen/osmosis/ibc-rate-limit/v1beta1/query.ts b/packages/osmo-query/src/codegen/osmosis/ibcratelimit/v1beta1/query.ts similarity index 95% rename from packages/osmo-query/src/codegen/osmosis/ibc-rate-limit/v1beta1/query.ts rename to packages/osmo-query/src/codegen/osmosis/ibcratelimit/v1beta1/query.ts index 8431917cf..478a8440f 100644 --- a/packages/osmo-query/src/codegen/osmosis/ibc-rate-limit/v1beta1/query.ts +++ b/packages/osmo-query/src/codegen/osmosis/ibcratelimit/v1beta1/query.ts @@ -63,7 +63,8 @@ export const ParamsRequest = { return message; }, fromAmino(_: ParamsRequestAmino): ParamsRequest { - return {}; + const message = createBaseParamsRequest(); + return message; }, toAmino(_: ParamsRequest): ParamsRequestAmino { const obj: any = {}; @@ -127,9 +128,11 @@ export const ParamsResponse = { return message; }, fromAmino(object: ParamsResponseAmino): ParamsResponse { - return { - params: object?.params ? Params.fromAmino(object.params) : undefined - }; + const message = createBaseParamsResponse(); + if (object.params !== undefined && object.params !== null) { + message.params = Params.fromAmino(object.params); + } + return message; }, toAmino(message: ParamsResponse): ParamsResponseAmino { const obj: any = {}; diff --git a/packages/osmo-query/src/codegen/osmosis/incentives/gauge.ts b/packages/osmo-query/src/codegen/osmosis/incentives/gauge.ts index 4f14c9313..e241f6958 100644 --- a/packages/osmo-query/src/codegen/osmosis/incentives/gauge.ts +++ b/packages/osmo-query/src/codegen/osmosis/incentives/gauge.ts @@ -56,7 +56,7 @@ export interface GaugeProtoMsg { */ export interface GaugeAmino { /** id is the unique ID of a Gauge */ - id: string; + id?: string; /** * is_perpetual is a flag to show if it's a perpetual or non-perpetual gauge * Non-perpetual gauges distribute their tokens equally per epoch while the @@ -64,7 +64,7 @@ export interface GaugeAmino { * at a single time and only distribute their tokens again once the gauge is * refilled, Intended for use with incentives that get refilled daily. */ - is_perpetual: boolean; + is_perpetual?: boolean; /** * distribute_to is where the gauge rewards are distributed to. * This is queried via lock duration or by timestamp @@ -74,21 +74,21 @@ export interface GaugeAmino { * coins is the total amount of coins that have been in the gauge * Can distribute multiple coin denoms */ - coins: CoinAmino[]; + coins?: CoinAmino[]; /** start_time is the distribution start time */ - start_time?: Date; + start_time?: string; /** * num_epochs_paid_over is the number of total epochs distribution will be * completed over */ - num_epochs_paid_over: string; + num_epochs_paid_over?: string; /** * filled_epochs is the number of epochs distribution has been completed on * already */ - filled_epochs: string; + filled_epochs?: string; /** distributed_coins are coins that have been distributed already */ - distributed_coins: CoinAmino[]; + distributed_coins?: CoinAmino[]; } export interface GaugeAminoMsg { type: "osmosis/incentives/gauge"; @@ -119,7 +119,7 @@ export interface LockableDurationsInfoProtoMsg { } export interface LockableDurationsInfoAmino { /** List of incentivised durations that gauges will pay out to */ - lockable_durations: DurationAmino[]; + lockable_durations?: DurationAmino[]; } export interface LockableDurationsInfoAminoMsg { type: "osmosis/incentives/lockable-durations-info"; @@ -220,16 +220,28 @@ export const Gauge = { return message; }, fromAmino(object: GaugeAmino): Gauge { - return { - id: BigInt(object.id), - isPerpetual: object.is_perpetual, - distributeTo: object?.distribute_to ? QueryCondition.fromAmino(object.distribute_to) : undefined, - coins: Array.isArray(object?.coins) ? object.coins.map((e: any) => Coin.fromAmino(e)) : [], - startTime: object.start_time, - numEpochsPaidOver: BigInt(object.num_epochs_paid_over), - filledEpochs: BigInt(object.filled_epochs), - distributedCoins: Array.isArray(object?.distributed_coins) ? object.distributed_coins.map((e: any) => Coin.fromAmino(e)) : [] - }; + const message = createBaseGauge(); + if (object.id !== undefined && object.id !== null) { + message.id = BigInt(object.id); + } + if (object.is_perpetual !== undefined && object.is_perpetual !== null) { + message.isPerpetual = object.is_perpetual; + } + if (object.distribute_to !== undefined && object.distribute_to !== null) { + message.distributeTo = QueryCondition.fromAmino(object.distribute_to); + } + message.coins = object.coins?.map(e => Coin.fromAmino(e)) || []; + if (object.start_time !== undefined && object.start_time !== null) { + message.startTime = fromTimestamp(Timestamp.fromAmino(object.start_time)); + } + if (object.num_epochs_paid_over !== undefined && object.num_epochs_paid_over !== null) { + message.numEpochsPaidOver = BigInt(object.num_epochs_paid_over); + } + if (object.filled_epochs !== undefined && object.filled_epochs !== null) { + message.filledEpochs = BigInt(object.filled_epochs); + } + message.distributedCoins = object.distributed_coins?.map(e => Coin.fromAmino(e)) || []; + return message; }, toAmino(message: Gauge): GaugeAmino { const obj: any = {}; @@ -241,7 +253,7 @@ export const Gauge = { } else { obj.coins = []; } - obj.start_time = message.startTime; + obj.start_time = message.startTime ? Timestamp.toAmino(toTimestamp(message.startTime)) : undefined; obj.num_epochs_paid_over = message.numEpochsPaidOver ? message.numEpochsPaidOver.toString() : undefined; obj.filled_epochs = message.filledEpochs ? message.filledEpochs.toString() : undefined; if (message.distributedCoins) { @@ -309,9 +321,9 @@ export const LockableDurationsInfo = { return message; }, fromAmino(object: LockableDurationsInfoAmino): LockableDurationsInfo { - return { - lockableDurations: Array.isArray(object?.lockable_durations) ? object.lockable_durations.map((e: any) => Duration.fromAmino(e)) : [] - }; + const message = createBaseLockableDurationsInfo(); + message.lockableDurations = object.lockable_durations?.map(e => Duration.fromAmino(e)) || []; + return message; }, toAmino(message: LockableDurationsInfo): LockableDurationsInfoAmino { const obj: any = {}; diff --git a/packages/osmo-query/src/codegen/osmosis/incentives/genesis.ts b/packages/osmo-query/src/codegen/osmosis/incentives/genesis.ts index be9104bb9..3ccafb60b 100644 --- a/packages/osmo-query/src/codegen/osmosis/incentives/genesis.ts +++ b/packages/osmo-query/src/codegen/osmosis/incentives/genesis.ts @@ -1,6 +1,7 @@ import { Params, ParamsAmino, ParamsSDKType } from "./params"; import { Gauge, GaugeAmino, GaugeSDKType } from "./gauge"; import { Duration, DurationAmino, DurationSDKType } from "../../google/protobuf/duration"; +import { Group, GroupAmino, GroupSDKType } from "./group"; import { BinaryReader, BinaryWriter } from "../../binary"; /** * GenesisState defines the incentives module's various parameters when first @@ -9,11 +10,14 @@ import { BinaryReader, BinaryWriter } from "../../binary"; export interface GenesisState { /** params are all the parameters of the module */ params: Params; - /** gauges are all gauges that should exist at genesis */ + /** + * gauges are all gauges (not including group gauges) that should exist at + * genesis + */ gauges: Gauge[]; /** * lockable_durations are all lockup durations that gauges can be locked for - * in order to recieve incentives + * in order to receive incentives */ lockableDurations: Duration[]; /** @@ -21,6 +25,10 @@ export interface GenesisState { * the next gauge after genesis */ lastGaugeId: bigint; + /** gauges are all group gauges that should exist at genesis */ + groupGauges: Gauge[]; + /** groups are all the groups that should exist at genesis */ + groups: Group[]; } export interface GenesisStateProtoMsg { typeUrl: "/osmosis.incentives.GenesisState"; @@ -33,18 +41,25 @@ export interface GenesisStateProtoMsg { export interface GenesisStateAmino { /** params are all the parameters of the module */ params?: ParamsAmino; - /** gauges are all gauges that should exist at genesis */ - gauges: GaugeAmino[]; + /** + * gauges are all gauges (not including group gauges) that should exist at + * genesis + */ + gauges?: GaugeAmino[]; /** * lockable_durations are all lockup durations that gauges can be locked for - * in order to recieve incentives + * in order to receive incentives */ - lockable_durations: DurationAmino[]; + lockable_durations?: DurationAmino[]; /** * last_gauge_id is what the gauge number will increment from when creating * the next gauge after genesis */ - last_gauge_id: string; + last_gauge_id?: string; + /** gauges are all group gauges that should exist at genesis */ + group_gauges?: GaugeAmino[]; + /** groups are all the groups that should exist at genesis */ + groups?: GroupAmino[]; } export interface GenesisStateAminoMsg { type: "osmosis/incentives/genesis-state"; @@ -59,13 +74,17 @@ export interface GenesisStateSDKType { gauges: GaugeSDKType[]; lockable_durations: DurationSDKType[]; last_gauge_id: bigint; + group_gauges: GaugeSDKType[]; + groups: GroupSDKType[]; } function createBaseGenesisState(): GenesisState { return { params: Params.fromPartial({}), gauges: [], lockableDurations: [], - lastGaugeId: BigInt(0) + lastGaugeId: BigInt(0), + groupGauges: [], + groups: [] }; } export const GenesisState = { @@ -83,6 +102,12 @@ export const GenesisState = { if (message.lastGaugeId !== BigInt(0)) { writer.uint32(32).uint64(message.lastGaugeId); } + for (const v of message.groupGauges) { + Gauge.encode(v!, writer.uint32(42).fork()).ldelim(); + } + for (const v of message.groups) { + Group.encode(v!, writer.uint32(50).fork()).ldelim(); + } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): GenesisState { @@ -104,6 +129,12 @@ export const GenesisState = { case 4: message.lastGaugeId = reader.uint64(); break; + case 5: + message.groupGauges.push(Gauge.decode(reader, reader.uint32())); + break; + case 6: + message.groups.push(Group.decode(reader, reader.uint32())); + break; default: reader.skipType(tag & 7); break; @@ -117,15 +148,23 @@ export const GenesisState = { message.gauges = object.gauges?.map(e => Gauge.fromPartial(e)) || []; message.lockableDurations = object.lockableDurations?.map(e => Duration.fromPartial(e)) || []; message.lastGaugeId = object.lastGaugeId !== undefined && object.lastGaugeId !== null ? BigInt(object.lastGaugeId.toString()) : BigInt(0); + message.groupGauges = object.groupGauges?.map(e => Gauge.fromPartial(e)) || []; + message.groups = object.groups?.map(e => Group.fromPartial(e)) || []; return message; }, fromAmino(object: GenesisStateAmino): GenesisState { - return { - params: object?.params ? Params.fromAmino(object.params) : undefined, - gauges: Array.isArray(object?.gauges) ? object.gauges.map((e: any) => Gauge.fromAmino(e)) : [], - lockableDurations: Array.isArray(object?.lockable_durations) ? object.lockable_durations.map((e: any) => Duration.fromAmino(e)) : [], - lastGaugeId: BigInt(object.last_gauge_id) - }; + const message = createBaseGenesisState(); + if (object.params !== undefined && object.params !== null) { + message.params = Params.fromAmino(object.params); + } + message.gauges = object.gauges?.map(e => Gauge.fromAmino(e)) || []; + message.lockableDurations = object.lockable_durations?.map(e => Duration.fromAmino(e)) || []; + if (object.last_gauge_id !== undefined && object.last_gauge_id !== null) { + message.lastGaugeId = BigInt(object.last_gauge_id); + } + message.groupGauges = object.group_gauges?.map(e => Gauge.fromAmino(e)) || []; + message.groups = object.groups?.map(e => Group.fromAmino(e)) || []; + return message; }, toAmino(message: GenesisState): GenesisStateAmino { const obj: any = {}; @@ -141,6 +180,16 @@ export const GenesisState = { obj.lockable_durations = []; } obj.last_gauge_id = message.lastGaugeId ? message.lastGaugeId.toString() : undefined; + if (message.groupGauges) { + obj.group_gauges = message.groupGauges.map(e => e ? Gauge.toAmino(e) : undefined); + } else { + obj.group_gauges = []; + } + if (message.groups) { + obj.groups = message.groups.map(e => e ? Group.toAmino(e) : undefined); + } else { + obj.groups = []; + } return obj; }, fromAminoMsg(object: GenesisStateAminoMsg): GenesisState { diff --git a/packages/osmo-query/src/codegen/osmosis/incentives/gov.ts b/packages/osmo-query/src/codegen/osmosis/incentives/gov.ts new file mode 100644 index 000000000..c26e11462 --- /dev/null +++ b/packages/osmo-query/src/codegen/osmosis/incentives/gov.ts @@ -0,0 +1,135 @@ +import { CreateGroup, CreateGroupAmino, CreateGroupSDKType } from "./group"; +import { BinaryReader, BinaryWriter } from "../../binary"; +/** + * CreateGroupsProposal is a type for creating one or more groups via + * governance. This is useful for creating groups without having to pay + * creation fees. + */ +export interface CreateGroupsProposal { + title: string; + description: string; + createGroups: CreateGroup[]; +} +export interface CreateGroupsProposalProtoMsg { + typeUrl: "/osmosis.incentives.CreateGroupsProposal"; + value: Uint8Array; +} +/** + * CreateGroupsProposal is a type for creating one or more groups via + * governance. This is useful for creating groups without having to pay + * creation fees. + */ +export interface CreateGroupsProposalAmino { + title?: string; + description?: string; + create_groups?: CreateGroupAmino[]; +} +export interface CreateGroupsProposalAminoMsg { + type: "osmosis/incentives/create-groups-proposal"; + value: CreateGroupsProposalAmino; +} +/** + * CreateGroupsProposal is a type for creating one or more groups via + * governance. This is useful for creating groups without having to pay + * creation fees. + */ +export interface CreateGroupsProposalSDKType { + title: string; + description: string; + create_groups: CreateGroupSDKType[]; +} +function createBaseCreateGroupsProposal(): CreateGroupsProposal { + return { + title: "", + description: "", + createGroups: [] + }; +} +export const CreateGroupsProposal = { + typeUrl: "/osmosis.incentives.CreateGroupsProposal", + encode(message: CreateGroupsProposal, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.title !== "") { + writer.uint32(10).string(message.title); + } + if (message.description !== "") { + writer.uint32(18).string(message.description); + } + for (const v of message.createGroups) { + CreateGroup.encode(v!, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): CreateGroupsProposal { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseCreateGroupsProposal(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.title = reader.string(); + break; + case 2: + message.description = reader.string(); + break; + case 3: + message.createGroups.push(CreateGroup.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): CreateGroupsProposal { + const message = createBaseCreateGroupsProposal(); + message.title = object.title ?? ""; + message.description = object.description ?? ""; + message.createGroups = object.createGroups?.map(e => CreateGroup.fromPartial(e)) || []; + return message; + }, + fromAmino(object: CreateGroupsProposalAmino): CreateGroupsProposal { + const message = createBaseCreateGroupsProposal(); + if (object.title !== undefined && object.title !== null) { + message.title = object.title; + } + if (object.description !== undefined && object.description !== null) { + message.description = object.description; + } + message.createGroups = object.create_groups?.map(e => CreateGroup.fromAmino(e)) || []; + return message; + }, + toAmino(message: CreateGroupsProposal): CreateGroupsProposalAmino { + const obj: any = {}; + obj.title = message.title; + obj.description = message.description; + if (message.createGroups) { + obj.create_groups = message.createGroups.map(e => e ? CreateGroup.toAmino(e) : undefined); + } else { + obj.create_groups = []; + } + return obj; + }, + fromAminoMsg(object: CreateGroupsProposalAminoMsg): CreateGroupsProposal { + return CreateGroupsProposal.fromAmino(object.value); + }, + toAminoMsg(message: CreateGroupsProposal): CreateGroupsProposalAminoMsg { + return { + type: "osmosis/incentives/create-groups-proposal", + value: CreateGroupsProposal.toAmino(message) + }; + }, + fromProtoMsg(message: CreateGroupsProposalProtoMsg): CreateGroupsProposal { + return CreateGroupsProposal.decode(message.value); + }, + toProto(message: CreateGroupsProposal): Uint8Array { + return CreateGroupsProposal.encode(message).finish(); + }, + toProtoMsg(message: CreateGroupsProposal): CreateGroupsProposalProtoMsg { + return { + typeUrl: "/osmosis.incentives.CreateGroupsProposal", + value: CreateGroupsProposal.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/packages/osmo-query/src/codegen/osmosis/incentives/group.ts b/packages/osmo-query/src/codegen/osmosis/incentives/group.ts new file mode 100644 index 000000000..827f0197b --- /dev/null +++ b/packages/osmo-query/src/codegen/osmosis/incentives/group.ts @@ -0,0 +1,656 @@ +import { Gauge, GaugeAmino, GaugeSDKType } from "./gauge"; +import { BinaryReader, BinaryWriter } from "../../binary"; +/** SplittingPolicy determines the way we want to split incentives in groupGauges */ +export enum SplittingPolicy { + ByVolume = 0, + UNRECOGNIZED = -1, +} +export const SplittingPolicySDKType = SplittingPolicy; +export const SplittingPolicyAmino = SplittingPolicy; +export function splittingPolicyFromJSON(object: any): SplittingPolicy { + switch (object) { + case 0: + case "ByVolume": + return SplittingPolicy.ByVolume; + case -1: + case "UNRECOGNIZED": + default: + return SplittingPolicy.UNRECOGNIZED; + } +} +export function splittingPolicyToJSON(object: SplittingPolicy): string { + switch (object) { + case SplittingPolicy.ByVolume: + return "ByVolume"; + case SplittingPolicy.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} +/** + * Note that while both InternalGaugeInfo and InternalGaugeRecord could + * technically be replaced by DistrInfo and DistrRecord from the pool-incentives + * module, we create separate types here to keep our abstractions clean and + * readable (pool-incentives distribution abstractions are used in a very + * specific way that does not directly relate to gauge logic). This also helps + * us sidestep a refactor to avoid an import cycle. + */ +export interface InternalGaugeInfo { + totalWeight: string; + gaugeRecords: InternalGaugeRecord[]; +} +export interface InternalGaugeInfoProtoMsg { + typeUrl: "/osmosis.incentives.InternalGaugeInfo"; + value: Uint8Array; +} +/** + * Note that while both InternalGaugeInfo and InternalGaugeRecord could + * technically be replaced by DistrInfo and DistrRecord from the pool-incentives + * module, we create separate types here to keep our abstractions clean and + * readable (pool-incentives distribution abstractions are used in a very + * specific way that does not directly relate to gauge logic). This also helps + * us sidestep a refactor to avoid an import cycle. + */ +export interface InternalGaugeInfoAmino { + total_weight?: string; + gauge_records?: InternalGaugeRecordAmino[]; +} +export interface InternalGaugeInfoAminoMsg { + type: "osmosis/incentives/internal-gauge-info"; + value: InternalGaugeInfoAmino; +} +/** + * Note that while both InternalGaugeInfo and InternalGaugeRecord could + * technically be replaced by DistrInfo and DistrRecord from the pool-incentives + * module, we create separate types here to keep our abstractions clean and + * readable (pool-incentives distribution abstractions are used in a very + * specific way that does not directly relate to gauge logic). This also helps + * us sidestep a refactor to avoid an import cycle. + */ +export interface InternalGaugeInfoSDKType { + total_weight: string; + gauge_records: InternalGaugeRecordSDKType[]; +} +export interface InternalGaugeRecord { + gaugeId: bigint; + /** + * CurrentWeight is the current weight of this gauge being distributed to for + * this epoch. For instance, for volume splitting policy, this stores the + * volume generated in the last epoch of the linked pool. + */ + currentWeight: string; + /** + * CumulativeWeight serves as a snapshot of the accumulator being tracked + * based on splitting policy. For instance, for volume splitting policy, this + * stores the cumulative volume for the linked pool at time of last update. + */ + cumulativeWeight: string; +} +export interface InternalGaugeRecordProtoMsg { + typeUrl: "/osmosis.incentives.InternalGaugeRecord"; + value: Uint8Array; +} +export interface InternalGaugeRecordAmino { + gauge_id?: string; + /** + * CurrentWeight is the current weight of this gauge being distributed to for + * this epoch. For instance, for volume splitting policy, this stores the + * volume generated in the last epoch of the linked pool. + */ + current_weight?: string; + /** + * CumulativeWeight serves as a snapshot of the accumulator being tracked + * based on splitting policy. For instance, for volume splitting policy, this + * stores the cumulative volume for the linked pool at time of last update. + */ + cumulative_weight?: string; +} +export interface InternalGaugeRecordAminoMsg { + type: "osmosis/incentives/internal-gauge-record"; + value: InternalGaugeRecordAmino; +} +export interface InternalGaugeRecordSDKType { + gauge_id: bigint; + current_weight: string; + cumulative_weight: string; +} +/** + * Group is an object that stores a 1:1 mapped gauge ID, a list of pool gauge + * info, and a splitting policy. These are grouped into a single abstraction to + * allow for distribution of group incentives to internal gauges according to + * the specified splitting policy. + */ +export interface Group { + groupGaugeId: bigint; + internalGaugeInfo: InternalGaugeInfo; + splittingPolicy: SplittingPolicy; +} +export interface GroupProtoMsg { + typeUrl: "/osmosis.incentives.Group"; + value: Uint8Array; +} +/** + * Group is an object that stores a 1:1 mapped gauge ID, a list of pool gauge + * info, and a splitting policy. These are grouped into a single abstraction to + * allow for distribution of group incentives to internal gauges according to + * the specified splitting policy. + */ +export interface GroupAmino { + group_gauge_id?: string; + internal_gauge_info?: InternalGaugeInfoAmino; + splitting_policy?: SplittingPolicy; +} +export interface GroupAminoMsg { + type: "osmosis/incentives/group"; + value: GroupAmino; +} +/** + * Group is an object that stores a 1:1 mapped gauge ID, a list of pool gauge + * info, and a splitting policy. These are grouped into a single abstraction to + * allow for distribution of group incentives to internal gauges according to + * the specified splitting policy. + */ +export interface GroupSDKType { + group_gauge_id: bigint; + internal_gauge_info: InternalGaugeInfoSDKType; + splitting_policy: SplittingPolicy; +} +/** + * CreateGroup is called via governance to create a new group. + * It takes an array of pool IDs to split the incentives across. + */ +export interface CreateGroup { + /** + * CreateGroup is called via governance to create a new group. + * It takes an array of pool IDs to split the incentives across. + */ + poolIds: bigint[]; +} +export interface CreateGroupProtoMsg { + typeUrl: "/osmosis.incentives.CreateGroup"; + value: Uint8Array; +} +/** + * CreateGroup is called via governance to create a new group. + * It takes an array of pool IDs to split the incentives across. + */ +export interface CreateGroupAmino { + /** + * CreateGroup is called via governance to create a new group. + * It takes an array of pool IDs to split the incentives across. + */ + pool_ids?: string[]; +} +export interface CreateGroupAminoMsg { + type: "osmosis/incentives/create-group"; + value: CreateGroupAmino; +} +/** + * CreateGroup is called via governance to create a new group. + * It takes an array of pool IDs to split the incentives across. + */ +export interface CreateGroupSDKType { + pool_ids: bigint[]; +} +/** + * GroupsWithGauge is a helper struct that stores a group and its + * associated gauge. + */ +export interface GroupsWithGauge { + group: Group; + gauge: Gauge; +} +export interface GroupsWithGaugeProtoMsg { + typeUrl: "/osmosis.incentives.GroupsWithGauge"; + value: Uint8Array; +} +/** + * GroupsWithGauge is a helper struct that stores a group and its + * associated gauge. + */ +export interface GroupsWithGaugeAmino { + group?: GroupAmino; + gauge?: GaugeAmino; +} +export interface GroupsWithGaugeAminoMsg { + type: "osmosis/incentives/groups-with-gauge"; + value: GroupsWithGaugeAmino; +} +/** + * GroupsWithGauge is a helper struct that stores a group and its + * associated gauge. + */ +export interface GroupsWithGaugeSDKType { + group: GroupSDKType; + gauge: GaugeSDKType; +} +function createBaseInternalGaugeInfo(): InternalGaugeInfo { + return { + totalWeight: "", + gaugeRecords: [] + }; +} +export const InternalGaugeInfo = { + typeUrl: "/osmosis.incentives.InternalGaugeInfo", + encode(message: InternalGaugeInfo, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.totalWeight !== "") { + writer.uint32(10).string(message.totalWeight); + } + for (const v of message.gaugeRecords) { + InternalGaugeRecord.encode(v!, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): InternalGaugeInfo { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseInternalGaugeInfo(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.totalWeight = reader.string(); + break; + case 2: + message.gaugeRecords.push(InternalGaugeRecord.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): InternalGaugeInfo { + const message = createBaseInternalGaugeInfo(); + message.totalWeight = object.totalWeight ?? ""; + message.gaugeRecords = object.gaugeRecords?.map(e => InternalGaugeRecord.fromPartial(e)) || []; + return message; + }, + fromAmino(object: InternalGaugeInfoAmino): InternalGaugeInfo { + const message = createBaseInternalGaugeInfo(); + if (object.total_weight !== undefined && object.total_weight !== null) { + message.totalWeight = object.total_weight; + } + message.gaugeRecords = object.gauge_records?.map(e => InternalGaugeRecord.fromAmino(e)) || []; + return message; + }, + toAmino(message: InternalGaugeInfo): InternalGaugeInfoAmino { + const obj: any = {}; + obj.total_weight = message.totalWeight; + if (message.gaugeRecords) { + obj.gauge_records = message.gaugeRecords.map(e => e ? InternalGaugeRecord.toAmino(e) : undefined); + } else { + obj.gauge_records = []; + } + return obj; + }, + fromAminoMsg(object: InternalGaugeInfoAminoMsg): InternalGaugeInfo { + return InternalGaugeInfo.fromAmino(object.value); + }, + toAminoMsg(message: InternalGaugeInfo): InternalGaugeInfoAminoMsg { + return { + type: "osmosis/incentives/internal-gauge-info", + value: InternalGaugeInfo.toAmino(message) + }; + }, + fromProtoMsg(message: InternalGaugeInfoProtoMsg): InternalGaugeInfo { + return InternalGaugeInfo.decode(message.value); + }, + toProto(message: InternalGaugeInfo): Uint8Array { + return InternalGaugeInfo.encode(message).finish(); + }, + toProtoMsg(message: InternalGaugeInfo): InternalGaugeInfoProtoMsg { + return { + typeUrl: "/osmosis.incentives.InternalGaugeInfo", + value: InternalGaugeInfo.encode(message).finish() + }; + } +}; +function createBaseInternalGaugeRecord(): InternalGaugeRecord { + return { + gaugeId: BigInt(0), + currentWeight: "", + cumulativeWeight: "" + }; +} +export const InternalGaugeRecord = { + typeUrl: "/osmosis.incentives.InternalGaugeRecord", + encode(message: InternalGaugeRecord, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.gaugeId !== BigInt(0)) { + writer.uint32(8).uint64(message.gaugeId); + } + if (message.currentWeight !== "") { + writer.uint32(18).string(message.currentWeight); + } + if (message.cumulativeWeight !== "") { + writer.uint32(26).string(message.cumulativeWeight); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): InternalGaugeRecord { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseInternalGaugeRecord(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.gaugeId = reader.uint64(); + break; + case 2: + message.currentWeight = reader.string(); + break; + case 3: + message.cumulativeWeight = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): InternalGaugeRecord { + const message = createBaseInternalGaugeRecord(); + message.gaugeId = object.gaugeId !== undefined && object.gaugeId !== null ? BigInt(object.gaugeId.toString()) : BigInt(0); + message.currentWeight = object.currentWeight ?? ""; + message.cumulativeWeight = object.cumulativeWeight ?? ""; + return message; + }, + fromAmino(object: InternalGaugeRecordAmino): InternalGaugeRecord { + const message = createBaseInternalGaugeRecord(); + if (object.gauge_id !== undefined && object.gauge_id !== null) { + message.gaugeId = BigInt(object.gauge_id); + } + if (object.current_weight !== undefined && object.current_weight !== null) { + message.currentWeight = object.current_weight; + } + if (object.cumulative_weight !== undefined && object.cumulative_weight !== null) { + message.cumulativeWeight = object.cumulative_weight; + } + return message; + }, + toAmino(message: InternalGaugeRecord): InternalGaugeRecordAmino { + const obj: any = {}; + obj.gauge_id = message.gaugeId ? message.gaugeId.toString() : undefined; + obj.current_weight = message.currentWeight; + obj.cumulative_weight = message.cumulativeWeight; + return obj; + }, + fromAminoMsg(object: InternalGaugeRecordAminoMsg): InternalGaugeRecord { + return InternalGaugeRecord.fromAmino(object.value); + }, + toAminoMsg(message: InternalGaugeRecord): InternalGaugeRecordAminoMsg { + return { + type: "osmosis/incentives/internal-gauge-record", + value: InternalGaugeRecord.toAmino(message) + }; + }, + fromProtoMsg(message: InternalGaugeRecordProtoMsg): InternalGaugeRecord { + return InternalGaugeRecord.decode(message.value); + }, + toProto(message: InternalGaugeRecord): Uint8Array { + return InternalGaugeRecord.encode(message).finish(); + }, + toProtoMsg(message: InternalGaugeRecord): InternalGaugeRecordProtoMsg { + return { + typeUrl: "/osmosis.incentives.InternalGaugeRecord", + value: InternalGaugeRecord.encode(message).finish() + }; + } +}; +function createBaseGroup(): Group { + return { + groupGaugeId: BigInt(0), + internalGaugeInfo: InternalGaugeInfo.fromPartial({}), + splittingPolicy: 0 + }; +} +export const Group = { + typeUrl: "/osmosis.incentives.Group", + encode(message: Group, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.groupGaugeId !== BigInt(0)) { + writer.uint32(8).uint64(message.groupGaugeId); + } + if (message.internalGaugeInfo !== undefined) { + InternalGaugeInfo.encode(message.internalGaugeInfo, writer.uint32(18).fork()).ldelim(); + } + if (message.splittingPolicy !== 0) { + writer.uint32(24).int32(message.splittingPolicy); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): Group { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGroup(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.groupGaugeId = reader.uint64(); + break; + case 2: + message.internalGaugeInfo = InternalGaugeInfo.decode(reader, reader.uint32()); + break; + case 3: + message.splittingPolicy = (reader.int32() as any); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): Group { + const message = createBaseGroup(); + message.groupGaugeId = object.groupGaugeId !== undefined && object.groupGaugeId !== null ? BigInt(object.groupGaugeId.toString()) : BigInt(0); + message.internalGaugeInfo = object.internalGaugeInfo !== undefined && object.internalGaugeInfo !== null ? InternalGaugeInfo.fromPartial(object.internalGaugeInfo) : undefined; + message.splittingPolicy = object.splittingPolicy ?? 0; + return message; + }, + fromAmino(object: GroupAmino): Group { + const message = createBaseGroup(); + if (object.group_gauge_id !== undefined && object.group_gauge_id !== null) { + message.groupGaugeId = BigInt(object.group_gauge_id); + } + if (object.internal_gauge_info !== undefined && object.internal_gauge_info !== null) { + message.internalGaugeInfo = InternalGaugeInfo.fromAmino(object.internal_gauge_info); + } + if (object.splitting_policy !== undefined && object.splitting_policy !== null) { + message.splittingPolicy = splittingPolicyFromJSON(object.splitting_policy); + } + return message; + }, + toAmino(message: Group): GroupAmino { + const obj: any = {}; + obj.group_gauge_id = message.groupGaugeId ? message.groupGaugeId.toString() : undefined; + obj.internal_gauge_info = message.internalGaugeInfo ? InternalGaugeInfo.toAmino(message.internalGaugeInfo) : undefined; + obj.splitting_policy = splittingPolicyToJSON(message.splittingPolicy); + return obj; + }, + fromAminoMsg(object: GroupAminoMsg): Group { + return Group.fromAmino(object.value); + }, + toAminoMsg(message: Group): GroupAminoMsg { + return { + type: "osmosis/incentives/group", + value: Group.toAmino(message) + }; + }, + fromProtoMsg(message: GroupProtoMsg): Group { + return Group.decode(message.value); + }, + toProto(message: Group): Uint8Array { + return Group.encode(message).finish(); + }, + toProtoMsg(message: Group): GroupProtoMsg { + return { + typeUrl: "/osmosis.incentives.Group", + value: Group.encode(message).finish() + }; + } +}; +function createBaseCreateGroup(): CreateGroup { + return { + poolIds: [] + }; +} +export const CreateGroup = { + typeUrl: "/osmosis.incentives.CreateGroup", + encode(message: CreateGroup, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + writer.uint32(10).fork(); + for (const v of message.poolIds) { + writer.uint64(v); + } + writer.ldelim(); + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): CreateGroup { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseCreateGroup(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if ((tag & 7) === 2) { + const end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) { + message.poolIds.push(reader.uint64()); + } + } else { + message.poolIds.push(reader.uint64()); + } + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): CreateGroup { + const message = createBaseCreateGroup(); + message.poolIds = object.poolIds?.map(e => BigInt(e.toString())) || []; + return message; + }, + fromAmino(object: CreateGroupAmino): CreateGroup { + const message = createBaseCreateGroup(); + message.poolIds = object.pool_ids?.map(e => BigInt(e)) || []; + return message; + }, + toAmino(message: CreateGroup): CreateGroupAmino { + const obj: any = {}; + if (message.poolIds) { + obj.pool_ids = message.poolIds.map(e => e.toString()); + } else { + obj.pool_ids = []; + } + return obj; + }, + fromAminoMsg(object: CreateGroupAminoMsg): CreateGroup { + return CreateGroup.fromAmino(object.value); + }, + toAminoMsg(message: CreateGroup): CreateGroupAminoMsg { + return { + type: "osmosis/incentives/create-group", + value: CreateGroup.toAmino(message) + }; + }, + fromProtoMsg(message: CreateGroupProtoMsg): CreateGroup { + return CreateGroup.decode(message.value); + }, + toProto(message: CreateGroup): Uint8Array { + return CreateGroup.encode(message).finish(); + }, + toProtoMsg(message: CreateGroup): CreateGroupProtoMsg { + return { + typeUrl: "/osmosis.incentives.CreateGroup", + value: CreateGroup.encode(message).finish() + }; + } +}; +function createBaseGroupsWithGauge(): GroupsWithGauge { + return { + group: Group.fromPartial({}), + gauge: Gauge.fromPartial({}) + }; +} +export const GroupsWithGauge = { + typeUrl: "/osmosis.incentives.GroupsWithGauge", + encode(message: GroupsWithGauge, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.group !== undefined) { + Group.encode(message.group, writer.uint32(10).fork()).ldelim(); + } + if (message.gauge !== undefined) { + Gauge.encode(message.gauge, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): GroupsWithGauge { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGroupsWithGauge(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.group = Group.decode(reader, reader.uint32()); + break; + case 2: + message.gauge = Gauge.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): GroupsWithGauge { + const message = createBaseGroupsWithGauge(); + message.group = object.group !== undefined && object.group !== null ? Group.fromPartial(object.group) : undefined; + message.gauge = object.gauge !== undefined && object.gauge !== null ? Gauge.fromPartial(object.gauge) : undefined; + return message; + }, + fromAmino(object: GroupsWithGaugeAmino): GroupsWithGauge { + const message = createBaseGroupsWithGauge(); + if (object.group !== undefined && object.group !== null) { + message.group = Group.fromAmino(object.group); + } + if (object.gauge !== undefined && object.gauge !== null) { + message.gauge = Gauge.fromAmino(object.gauge); + } + return message; + }, + toAmino(message: GroupsWithGauge): GroupsWithGaugeAmino { + const obj: any = {}; + obj.group = message.group ? Group.toAmino(message.group) : undefined; + obj.gauge = message.gauge ? Gauge.toAmino(message.gauge) : undefined; + return obj; + }, + fromAminoMsg(object: GroupsWithGaugeAminoMsg): GroupsWithGauge { + return GroupsWithGauge.fromAmino(object.value); + }, + toAminoMsg(message: GroupsWithGauge): GroupsWithGaugeAminoMsg { + return { + type: "osmosis/incentives/groups-with-gauge", + value: GroupsWithGauge.toAmino(message) + }; + }, + fromProtoMsg(message: GroupsWithGaugeProtoMsg): GroupsWithGauge { + return GroupsWithGauge.decode(message.value); + }, + toProto(message: GroupsWithGauge): Uint8Array { + return GroupsWithGauge.encode(message).finish(); + }, + toProtoMsg(message: GroupsWithGauge): GroupsWithGaugeProtoMsg { + return { + typeUrl: "/osmosis.incentives.GroupsWithGauge", + value: GroupsWithGauge.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/packages/osmo-query/src/codegen/osmosis/incentives/params.ts b/packages/osmo-query/src/codegen/osmosis/incentives/params.ts index f029e23c5..2d2e7cac0 100644 --- a/packages/osmo-query/src/codegen/osmosis/incentives/params.ts +++ b/packages/osmo-query/src/codegen/osmosis/incentives/params.ts @@ -1,3 +1,4 @@ +import { Coin, CoinAmino, CoinSDKType } from "../../cosmos/base/v1beta1/coin"; import { BinaryReader, BinaryWriter } from "../../binary"; /** Params holds parameters for the incentives module */ export interface Params { @@ -6,6 +7,23 @@ export interface Params { * (day, week, etc.) */ distrEpochIdentifier: string; + /** + * group_creation_fee is the fee required to create a new group + * It is only charged to all addresses other than incentive module account + * or addresses in the unrestricted_creator_whitelist + */ + groupCreationFee: Coin[]; + /** + * unrestricted_creator_whitelist is a list of addresses that are + * allowed to bypass restrictions on permissionless Group + * creation. In the future, we might expand these to creating gauges + * as well. + * The goal of this is to allow a subdao to manage incentives efficiently + * without being stopped by 5 day governance process or a high fee. + * At the same time, it prevents spam by having a fee for all + * other users. + */ + unrestrictedCreatorWhitelist: string[]; } export interface ParamsProtoMsg { typeUrl: "/osmosis.incentives.Params"; @@ -17,7 +35,24 @@ export interface ParamsAmino { * distr_epoch_identifier is what epoch type distribution will be triggered by * (day, week, etc.) */ - distr_epoch_identifier: string; + distr_epoch_identifier?: string; + /** + * group_creation_fee is the fee required to create a new group + * It is only charged to all addresses other than incentive module account + * or addresses in the unrestricted_creator_whitelist + */ + group_creation_fee?: CoinAmino[]; + /** + * unrestricted_creator_whitelist is a list of addresses that are + * allowed to bypass restrictions on permissionless Group + * creation. In the future, we might expand these to creating gauges + * as well. + * The goal of this is to allow a subdao to manage incentives efficiently + * without being stopped by 5 day governance process or a high fee. + * At the same time, it prevents spam by having a fee for all + * other users. + */ + unrestricted_creator_whitelist?: string[]; } export interface ParamsAminoMsg { type: "osmosis/incentives/params"; @@ -26,10 +61,14 @@ export interface ParamsAminoMsg { /** Params holds parameters for the incentives module */ export interface ParamsSDKType { distr_epoch_identifier: string; + group_creation_fee: CoinSDKType[]; + unrestricted_creator_whitelist: string[]; } function createBaseParams(): Params { return { - distrEpochIdentifier: "" + distrEpochIdentifier: "", + groupCreationFee: [], + unrestrictedCreatorWhitelist: [] }; } export const Params = { @@ -38,6 +77,12 @@ export const Params = { if (message.distrEpochIdentifier !== "") { writer.uint32(10).string(message.distrEpochIdentifier); } + for (const v of message.groupCreationFee) { + Coin.encode(v!, writer.uint32(18).fork()).ldelim(); + } + for (const v of message.unrestrictedCreatorWhitelist) { + writer.uint32(26).string(v!); + } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): Params { @@ -50,6 +95,12 @@ export const Params = { case 1: message.distrEpochIdentifier = reader.string(); break; + case 2: + message.groupCreationFee.push(Coin.decode(reader, reader.uint32())); + break; + case 3: + message.unrestrictedCreatorWhitelist.push(reader.string()); + break; default: reader.skipType(tag & 7); break; @@ -60,16 +111,32 @@ export const Params = { fromPartial(object: Partial): Params { const message = createBaseParams(); message.distrEpochIdentifier = object.distrEpochIdentifier ?? ""; + message.groupCreationFee = object.groupCreationFee?.map(e => Coin.fromPartial(e)) || []; + message.unrestrictedCreatorWhitelist = object.unrestrictedCreatorWhitelist?.map(e => e) || []; return message; }, fromAmino(object: ParamsAmino): Params { - return { - distrEpochIdentifier: object.distr_epoch_identifier - }; + const message = createBaseParams(); + if (object.distr_epoch_identifier !== undefined && object.distr_epoch_identifier !== null) { + message.distrEpochIdentifier = object.distr_epoch_identifier; + } + message.groupCreationFee = object.group_creation_fee?.map(e => Coin.fromAmino(e)) || []; + message.unrestrictedCreatorWhitelist = object.unrestricted_creator_whitelist?.map(e => e) || []; + return message; }, toAmino(message: Params): ParamsAmino { const obj: any = {}; obj.distr_epoch_identifier = message.distrEpochIdentifier; + if (message.groupCreationFee) { + obj.group_creation_fee = message.groupCreationFee.map(e => e ? Coin.toAmino(e) : undefined); + } else { + obj.group_creation_fee = []; + } + if (message.unrestrictedCreatorWhitelist) { + obj.unrestricted_creator_whitelist = message.unrestrictedCreatorWhitelist.map(e => e); + } else { + obj.unrestricted_creator_whitelist = []; + } return obj; }, fromAminoMsg(object: ParamsAminoMsg): Params { diff --git a/packages/osmo-query/src/codegen/osmosis/incentives/query.lcd.ts b/packages/osmo-query/src/codegen/osmosis/incentives/query.lcd.ts index 66f8ed4a7..36333577c 100644 --- a/packages/osmo-query/src/codegen/osmosis/incentives/query.lcd.ts +++ b/packages/osmo-query/src/codegen/osmosis/incentives/query.lcd.ts @@ -1,6 +1,6 @@ import { setPaginationParams } from "../../helpers"; import { LCDClient } from "@cosmology/lcd"; -import { ModuleToDistributeCoinsRequest, ModuleToDistributeCoinsResponseSDKType, GaugeByIDRequest, GaugeByIDResponseSDKType, GaugesRequest, GaugesResponseSDKType, ActiveGaugesRequest, ActiveGaugesResponseSDKType, ActiveGaugesPerDenomRequest, ActiveGaugesPerDenomResponseSDKType, UpcomingGaugesRequest, UpcomingGaugesResponseSDKType, UpcomingGaugesPerDenomRequest, UpcomingGaugesPerDenomResponseSDKType, RewardsEstRequest, RewardsEstResponseSDKType, QueryLockableDurationsRequest, QueryLockableDurationsResponseSDKType } from "./query"; +import { ModuleToDistributeCoinsRequest, ModuleToDistributeCoinsResponseSDKType, GaugeByIDRequest, GaugeByIDResponseSDKType, GaugesRequest, GaugesResponseSDKType, ActiveGaugesRequest, ActiveGaugesResponseSDKType, ActiveGaugesPerDenomRequest, ActiveGaugesPerDenomResponseSDKType, UpcomingGaugesRequest, UpcomingGaugesResponseSDKType, UpcomingGaugesPerDenomRequest, UpcomingGaugesPerDenomResponseSDKType, RewardsEstRequest, RewardsEstResponseSDKType, QueryLockableDurationsRequest, QueryLockableDurationsResponseSDKType, QueryAllGroupsRequest, QueryAllGroupsResponseSDKType, QueryAllGroupsGaugesRequest, QueryAllGroupsGaugesResponseSDKType, QueryAllGroupsWithGaugeRequest, QueryAllGroupsWithGaugeResponseSDKType, QueryGroupByGroupGaugeIDRequest, QueryGroupByGroupGaugeIDResponseSDKType, QueryCurrentWeightByGroupGaugeIDRequest, QueryCurrentWeightByGroupGaugeIDResponseSDKType } from "./query"; export class LCDQueryClient { req: LCDClient; constructor({ @@ -18,6 +18,11 @@ export class LCDQueryClient { this.upcomingGaugesPerDenom = this.upcomingGaugesPerDenom.bind(this); this.rewardsEst = this.rewardsEst.bind(this); this.lockableDurations = this.lockableDurations.bind(this); + this.allGroups = this.allGroups.bind(this); + this.allGroupsGauges = this.allGroupsGauges.bind(this); + this.allGroupsWithGauge = this.allGroupsWithGauge.bind(this); + this.groupByGroupGaugeID = this.groupByGroupGaugeID.bind(this); + this.currentWeightByGroupGaugeID = this.currentWeightByGroupGaugeID.bind(this); } /* ModuleToDistributeCoins returns coins that are going to be distributed */ async moduleToDistributeCoins(_params: ModuleToDistributeCoinsRequest = {}): Promise { @@ -69,7 +74,7 @@ export class LCDQueryClient { const endpoint = `osmosis/incentives/v1beta1/active_gauges_per_denom`; return await this.req.get(endpoint, options); } - /* Returns scheduled gauges that have not yet occured */ + /* Returns scheduled gauges that have not yet occurred */ async upcomingGauges(params: UpcomingGaugesRequest = { pagination: undefined }): Promise { @@ -82,7 +87,7 @@ export class LCDQueryClient { const endpoint = `osmosis/incentives/v1beta1/upcoming_gauges`; return await this.req.get(endpoint, options); } - /* UpcomingGaugesPerDenom returns scheduled gauges that have not yet occured + /* UpcomingGaugesPerDenom returns scheduled gauges that have not yet occurred by denom */ async upcomingGaugesPerDenom(params: UpcomingGaugesPerDenomRequest): Promise { const options: any = { @@ -119,4 +124,30 @@ export class LCDQueryClient { const endpoint = `osmosis/incentives/v1beta1/lockable_durations`; return await this.req.get(endpoint); } + /* AllGroups returns all groups */ + async allGroups(_params: QueryAllGroupsRequest = {}): Promise { + const endpoint = `osmosis/incentives/v1beta1/all_groups`; + return await this.req.get(endpoint); + } + /* AllGroupsGauges returns all group gauges */ + async allGroupsGauges(_params: QueryAllGroupsGaugesRequest = {}): Promise { + const endpoint = `osmosis/incentives/v1beta1/all_groups_gauges`; + return await this.req.get(endpoint); + } + /* AllGroupsWithGauge returns all groups with their group gauge */ + async allGroupsWithGauge(_params: QueryAllGroupsWithGaugeRequest = {}): Promise { + const endpoint = `osmosis/incentives/v1beta1/all_groups_with_gauge`; + return await this.req.get(endpoint); + } + /* GroupByGroupGaugeID returns a group given its group gauge ID */ + async groupByGroupGaugeID(params: QueryGroupByGroupGaugeIDRequest): Promise { + const endpoint = `osmosis/incentives/v1beta1/group_by_group_gauge_id/${params.id}`; + return await this.req.get(endpoint); + } + /* CurrentWeightByGroupGaugeID returns the current weight since the + the last epoch given a group gauge ID */ + async currentWeightByGroupGaugeID(params: QueryCurrentWeightByGroupGaugeIDRequest): Promise { + const endpoint = `osmosis/incentives/v1beta1/current_weight_by_group_gauge_id/${params.groupGaugeId}`; + return await this.req.get(endpoint); + } } \ No newline at end of file diff --git a/packages/osmo-query/src/codegen/osmosis/incentives/query.rpc.Query.ts b/packages/osmo-query/src/codegen/osmosis/incentives/query.rpc.Query.ts index 3d7870871..8aa6986b2 100644 --- a/packages/osmo-query/src/codegen/osmosis/incentives/query.rpc.Query.ts +++ b/packages/osmo-query/src/codegen/osmosis/incentives/query.rpc.Query.ts @@ -3,7 +3,7 @@ import { BinaryReader } from "../../binary"; import { QueryClient, createProtobufRpcClient, ProtobufRpcClient } from "@cosmjs/stargate"; import { ReactQueryParams } from "../../react-query"; import { useQuery } from "@tanstack/react-query"; -import { ModuleToDistributeCoinsRequest, ModuleToDistributeCoinsResponse, GaugeByIDRequest, GaugeByIDResponse, GaugesRequest, GaugesResponse, ActiveGaugesRequest, ActiveGaugesResponse, ActiveGaugesPerDenomRequest, ActiveGaugesPerDenomResponse, UpcomingGaugesRequest, UpcomingGaugesResponse, UpcomingGaugesPerDenomRequest, UpcomingGaugesPerDenomResponse, RewardsEstRequest, RewardsEstResponse, QueryLockableDurationsRequest, QueryLockableDurationsResponse } from "./query"; +import { ModuleToDistributeCoinsRequest, ModuleToDistributeCoinsResponse, GaugeByIDRequest, GaugeByIDResponse, GaugesRequest, GaugesResponse, ActiveGaugesRequest, ActiveGaugesResponse, ActiveGaugesPerDenomRequest, ActiveGaugesPerDenomResponse, UpcomingGaugesRequest, UpcomingGaugesResponse, UpcomingGaugesPerDenomRequest, UpcomingGaugesPerDenomResponse, RewardsEstRequest, RewardsEstResponse, QueryLockableDurationsRequest, QueryLockableDurationsResponse, QueryAllGroupsRequest, QueryAllGroupsResponse, QueryAllGroupsGaugesRequest, QueryAllGroupsGaugesResponse, QueryAllGroupsWithGaugeRequest, QueryAllGroupsWithGaugeResponse, QueryGroupByGroupGaugeIDRequest, QueryGroupByGroupGaugeIDResponse, QueryCurrentWeightByGroupGaugeIDRequest, QueryCurrentWeightByGroupGaugeIDResponse } from "./query"; /** Query defines the gRPC querier service */ export interface Query { /** ModuleToDistributeCoins returns coins that are going to be distributed */ @@ -16,10 +16,10 @@ export interface Query { activeGauges(request?: ActiveGaugesRequest): Promise; /** ActiveGaugesPerDenom returns active gauges by denom */ activeGaugesPerDenom(request: ActiveGaugesPerDenomRequest): Promise; - /** Returns scheduled gauges that have not yet occured */ + /** Returns scheduled gauges that have not yet occurred */ upcomingGauges(request?: UpcomingGaugesRequest): Promise; /** - * UpcomingGaugesPerDenom returns scheduled gauges that have not yet occured + * UpcomingGaugesPerDenom returns scheduled gauges that have not yet occurred * by denom */ upcomingGaugesPerDenom(request: UpcomingGaugesPerDenomRequest): Promise; @@ -34,6 +34,19 @@ export interface Query { * incentives for */ lockableDurations(request?: QueryLockableDurationsRequest): Promise; + /** AllGroups returns all groups */ + allGroups(request?: QueryAllGroupsRequest): Promise; + /** AllGroupsGauges returns all group gauges */ + allGroupsGauges(request?: QueryAllGroupsGaugesRequest): Promise; + /** AllGroupsWithGauge returns all groups with their group gauge */ + allGroupsWithGauge(request?: QueryAllGroupsWithGaugeRequest): Promise; + /** GroupByGroupGaugeID returns a group given its group gauge ID */ + groupByGroupGaugeID(request: QueryGroupByGroupGaugeIDRequest): Promise; + /** + * CurrentWeightByGroupGaugeID returns the current weight since the + * the last epoch given a group gauge ID + */ + currentWeightByGroupGaugeID(request: QueryCurrentWeightByGroupGaugeIDRequest): Promise; } export class QueryClientImpl implements Query { private readonly rpc: Rpc; @@ -48,6 +61,11 @@ export class QueryClientImpl implements Query { this.upcomingGaugesPerDenom = this.upcomingGaugesPerDenom.bind(this); this.rewardsEst = this.rewardsEst.bind(this); this.lockableDurations = this.lockableDurations.bind(this); + this.allGroups = this.allGroups.bind(this); + this.allGroupsGauges = this.allGroupsGauges.bind(this); + this.allGroupsWithGauge = this.allGroupsWithGauge.bind(this); + this.groupByGroupGaugeID = this.groupByGroupGaugeID.bind(this); + this.currentWeightByGroupGaugeID = this.currentWeightByGroupGaugeID.bind(this); } moduleToDistributeCoins(request: ModuleToDistributeCoinsRequest = {}): Promise { const data = ModuleToDistributeCoinsRequest.encode(request).finish(); @@ -100,6 +118,31 @@ export class QueryClientImpl implements Query { const promise = this.rpc.request("osmosis.incentives.Query", "LockableDurations", data); return promise.then(data => QueryLockableDurationsResponse.decode(new BinaryReader(data))); } + allGroups(request: QueryAllGroupsRequest = {}): Promise { + const data = QueryAllGroupsRequest.encode(request).finish(); + const promise = this.rpc.request("osmosis.incentives.Query", "AllGroups", data); + return promise.then(data => QueryAllGroupsResponse.decode(new BinaryReader(data))); + } + allGroupsGauges(request: QueryAllGroupsGaugesRequest = {}): Promise { + const data = QueryAllGroupsGaugesRequest.encode(request).finish(); + const promise = this.rpc.request("osmosis.incentives.Query", "AllGroupsGauges", data); + return promise.then(data => QueryAllGroupsGaugesResponse.decode(new BinaryReader(data))); + } + allGroupsWithGauge(request: QueryAllGroupsWithGaugeRequest = {}): Promise { + const data = QueryAllGroupsWithGaugeRequest.encode(request).finish(); + const promise = this.rpc.request("osmosis.incentives.Query", "AllGroupsWithGauge", data); + return promise.then(data => QueryAllGroupsWithGaugeResponse.decode(new BinaryReader(data))); + } + groupByGroupGaugeID(request: QueryGroupByGroupGaugeIDRequest): Promise { + const data = QueryGroupByGroupGaugeIDRequest.encode(request).finish(); + const promise = this.rpc.request("osmosis.incentives.Query", "GroupByGroupGaugeID", data); + return promise.then(data => QueryGroupByGroupGaugeIDResponse.decode(new BinaryReader(data))); + } + currentWeightByGroupGaugeID(request: QueryCurrentWeightByGroupGaugeIDRequest): Promise { + const data = QueryCurrentWeightByGroupGaugeIDRequest.encode(request).finish(); + const promise = this.rpc.request("osmosis.incentives.Query", "CurrentWeightByGroupGaugeID", data); + return promise.then(data => QueryCurrentWeightByGroupGaugeIDResponse.decode(new BinaryReader(data))); + } } export const createRpcQueryExtension = (base: QueryClient) => { const rpc = createProtobufRpcClient(base); @@ -131,6 +174,21 @@ export const createRpcQueryExtension = (base: QueryClient) => { }, lockableDurations(request?: QueryLockableDurationsRequest): Promise { return queryService.lockableDurations(request); + }, + allGroups(request?: QueryAllGroupsRequest): Promise { + return queryService.allGroups(request); + }, + allGroupsGauges(request?: QueryAllGroupsGaugesRequest): Promise { + return queryService.allGroupsGauges(request); + }, + allGroupsWithGauge(request?: QueryAllGroupsWithGaugeRequest): Promise { + return queryService.allGroupsWithGauge(request); + }, + groupByGroupGaugeID(request: QueryGroupByGroupGaugeIDRequest): Promise { + return queryService.groupByGroupGaugeID(request); + }, + currentWeightByGroupGaugeID(request: QueryCurrentWeightByGroupGaugeIDRequest): Promise { + return queryService.currentWeightByGroupGaugeID(request); } }; }; @@ -161,6 +219,21 @@ export interface UseRewardsEstQuery extends ReactQueryParams extends ReactQueryParams { request?: QueryLockableDurationsRequest; } +export interface UseAllGroupsQuery extends ReactQueryParams { + request?: QueryAllGroupsRequest; +} +export interface UseAllGroupsGaugesQuery extends ReactQueryParams { + request?: QueryAllGroupsGaugesRequest; +} +export interface UseAllGroupsWithGaugeQuery extends ReactQueryParams { + request?: QueryAllGroupsWithGaugeRequest; +} +export interface UseGroupByGroupGaugeIDQuery extends ReactQueryParams { + request: QueryGroupByGroupGaugeIDRequest; +} +export interface UseCurrentWeightByGroupGaugeIDQuery extends ReactQueryParams { + request: QueryCurrentWeightByGroupGaugeIDRequest; +} const _queryClients: WeakMap = new WeakMap(); const getQueryService = (rpc: ProtobufRpcClient | undefined): QueryClientImpl | undefined => { if (!rpc) return; @@ -254,15 +327,60 @@ export const createRpcQueryHooks = (rpc: ProtobufRpcClient | undefined) => { return queryService.lockableDurations(request); }, options); }; + const useAllGroups = ({ + request, + options + }: UseAllGroupsQuery) => { + return useQuery(["allGroupsQuery", request], () => { + if (!queryService) throw new Error("Query Service not initialized"); + return queryService.allGroups(request); + }, options); + }; + const useAllGroupsGauges = ({ + request, + options + }: UseAllGroupsGaugesQuery) => { + return useQuery(["allGroupsGaugesQuery", request], () => { + if (!queryService) throw new Error("Query Service not initialized"); + return queryService.allGroupsGauges(request); + }, options); + }; + const useAllGroupsWithGauge = ({ + request, + options + }: UseAllGroupsWithGaugeQuery) => { + return useQuery(["allGroupsWithGaugeQuery", request], () => { + if (!queryService) throw new Error("Query Service not initialized"); + return queryService.allGroupsWithGauge(request); + }, options); + }; + const useGroupByGroupGaugeID = ({ + request, + options + }: UseGroupByGroupGaugeIDQuery) => { + return useQuery(["groupByGroupGaugeIDQuery", request], () => { + if (!queryService) throw new Error("Query Service not initialized"); + return queryService.groupByGroupGaugeID(request); + }, options); + }; + const useCurrentWeightByGroupGaugeID = ({ + request, + options + }: UseCurrentWeightByGroupGaugeIDQuery) => { + return useQuery(["currentWeightByGroupGaugeIDQuery", request], () => { + if (!queryService) throw new Error("Query Service not initialized"); + return queryService.currentWeightByGroupGaugeID(request); + }, options); + }; return { /** ModuleToDistributeCoins returns coins that are going to be distributed */useModuleToDistributeCoins, /** GaugeByID returns gauges by their respective ID */useGaugeByID, /** Gauges returns both upcoming and active gauges */useGauges, /** ActiveGauges returns active gauges */useActiveGauges, /** ActiveGaugesPerDenom returns active gauges by denom */useActiveGaugesPerDenom, - /** Returns scheduled gauges that have not yet occured */useUpcomingGauges, + /** Returns scheduled gauges that have not yet occurred */useUpcomingGauges, /** - * UpcomingGaugesPerDenom returns scheduled gauges that have not yet occured + * UpcomingGaugesPerDenom returns scheduled gauges that have not yet occurred * by denom */ useUpcomingGaugesPerDenom, @@ -276,6 +394,15 @@ export const createRpcQueryHooks = (rpc: ProtobufRpcClient | undefined) => { * LockableDurations returns lockable durations that are valid to distribute * incentives for */ - useLockableDurations + useLockableDurations, + /** AllGroups returns all groups */useAllGroups, + /** AllGroupsGauges returns all group gauges */useAllGroupsGauges, + /** AllGroupsWithGauge returns all groups with their group gauge */useAllGroupsWithGauge, + /** GroupByGroupGaugeID returns a group given its group gauge ID */useGroupByGroupGaugeID, + /** + * CurrentWeightByGroupGaugeID returns the current weight since the + * the last epoch given a group gauge ID + */ + useCurrentWeightByGroupGaugeID }; }; \ No newline at end of file diff --git a/packages/osmo-query/src/codegen/osmosis/incentives/query.ts b/packages/osmo-query/src/codegen/osmosis/incentives/query.ts index 88610a09c..e7b02413a 100644 --- a/packages/osmo-query/src/codegen/osmosis/incentives/query.ts +++ b/packages/osmo-query/src/codegen/osmosis/incentives/query.ts @@ -2,7 +2,9 @@ import { PageRequest, PageRequestAmino, PageRequestSDKType, PageResponse, PageRe import { Coin, CoinAmino, CoinSDKType } from "../../cosmos/base/v1beta1/coin"; import { Gauge, GaugeAmino, GaugeSDKType } from "./gauge"; import { Duration, DurationAmino, DurationSDKType } from "../../google/protobuf/duration"; +import { Group, GroupAmino, GroupSDKType, GroupsWithGauge, GroupsWithGaugeAmino, GroupsWithGaugeSDKType } from "./group"; import { BinaryReader, BinaryWriter } from "../../binary"; +import { Decimal } from "@cosmjs/math"; export interface ModuleToDistributeCoinsRequest {} export interface ModuleToDistributeCoinsRequestProtoMsg { typeUrl: "/osmosis.incentives.ModuleToDistributeCoinsRequest"; @@ -24,7 +26,7 @@ export interface ModuleToDistributeCoinsResponseProtoMsg { } export interface ModuleToDistributeCoinsResponseAmino { /** Coins that have yet to be distributed */ - coins: CoinAmino[]; + coins?: CoinAmino[]; } export interface ModuleToDistributeCoinsResponseAminoMsg { type: "osmosis/incentives/module-to-distribute-coins-response"; @@ -43,7 +45,7 @@ export interface GaugeByIDRequestProtoMsg { } export interface GaugeByIDRequestAmino { /** Gague ID being queried */ - id: string; + id?: string; } export interface GaugeByIDRequestAminoMsg { type: "osmosis/incentives/gauge-by-id-request"; @@ -54,7 +56,7 @@ export interface GaugeByIDRequestSDKType { } export interface GaugeByIDResponse { /** Gauge that corresponds to provided gague ID */ - gauge: Gauge; + gauge?: Gauge; } export interface GaugeByIDResponseProtoMsg { typeUrl: "/osmosis.incentives.GaugeByIDResponse"; @@ -69,11 +71,11 @@ export interface GaugeByIDResponseAminoMsg { value: GaugeByIDResponseAmino; } export interface GaugeByIDResponseSDKType { - gauge: GaugeSDKType; + gauge?: GaugeSDKType; } export interface GaugesRequest { /** Pagination defines pagination for the request */ - pagination: PageRequest; + pagination?: PageRequest; } export interface GaugesRequestProtoMsg { typeUrl: "/osmosis.incentives.GaugesRequest"; @@ -88,13 +90,13 @@ export interface GaugesRequestAminoMsg { value: GaugesRequestAmino; } export interface GaugesRequestSDKType { - pagination: PageRequestSDKType; + pagination?: PageRequestSDKType; } export interface GaugesResponse { /** Upcoming and active gauges */ data: Gauge[]; /** Pagination defines pagination for the response */ - pagination: PageResponse; + pagination?: PageResponse; } export interface GaugesResponseProtoMsg { typeUrl: "/osmosis.incentives.GaugesResponse"; @@ -102,7 +104,7 @@ export interface GaugesResponseProtoMsg { } export interface GaugesResponseAmino { /** Upcoming and active gauges */ - data: GaugeAmino[]; + data?: GaugeAmino[]; /** Pagination defines pagination for the response */ pagination?: PageResponseAmino; } @@ -112,11 +114,11 @@ export interface GaugesResponseAminoMsg { } export interface GaugesResponseSDKType { data: GaugeSDKType[]; - pagination: PageResponseSDKType; + pagination?: PageResponseSDKType; } export interface ActiveGaugesRequest { /** Pagination defines pagination for the request */ - pagination: PageRequest; + pagination?: PageRequest; } export interface ActiveGaugesRequestProtoMsg { typeUrl: "/osmosis.incentives.ActiveGaugesRequest"; @@ -131,13 +133,13 @@ export interface ActiveGaugesRequestAminoMsg { value: ActiveGaugesRequestAmino; } export interface ActiveGaugesRequestSDKType { - pagination: PageRequestSDKType; + pagination?: PageRequestSDKType; } export interface ActiveGaugesResponse { /** Active gagues only */ data: Gauge[]; /** Pagination defines pagination for the response */ - pagination: PageResponse; + pagination?: PageResponse; } export interface ActiveGaugesResponseProtoMsg { typeUrl: "/osmosis.incentives.ActiveGaugesResponse"; @@ -145,7 +147,7 @@ export interface ActiveGaugesResponseProtoMsg { } export interface ActiveGaugesResponseAmino { /** Active gagues only */ - data: GaugeAmino[]; + data?: GaugeAmino[]; /** Pagination defines pagination for the response */ pagination?: PageResponseAmino; } @@ -155,13 +157,13 @@ export interface ActiveGaugesResponseAminoMsg { } export interface ActiveGaugesResponseSDKType { data: GaugeSDKType[]; - pagination: PageResponseSDKType; + pagination?: PageResponseSDKType; } export interface ActiveGaugesPerDenomRequest { /** Desired denom when querying active gagues */ denom: string; /** Pagination defines pagination for the request */ - pagination: PageRequest; + pagination?: PageRequest; } export interface ActiveGaugesPerDenomRequestProtoMsg { typeUrl: "/osmosis.incentives.ActiveGaugesPerDenomRequest"; @@ -169,7 +171,7 @@ export interface ActiveGaugesPerDenomRequestProtoMsg { } export interface ActiveGaugesPerDenomRequestAmino { /** Desired denom when querying active gagues */ - denom: string; + denom?: string; /** Pagination defines pagination for the request */ pagination?: PageRequestAmino; } @@ -179,13 +181,13 @@ export interface ActiveGaugesPerDenomRequestAminoMsg { } export interface ActiveGaugesPerDenomRequestSDKType { denom: string; - pagination: PageRequestSDKType; + pagination?: PageRequestSDKType; } export interface ActiveGaugesPerDenomResponse { /** Active gagues that match denom in query */ data: Gauge[]; /** Pagination defines pagination for the response */ - pagination: PageResponse; + pagination?: PageResponse; } export interface ActiveGaugesPerDenomResponseProtoMsg { typeUrl: "/osmosis.incentives.ActiveGaugesPerDenomResponse"; @@ -193,7 +195,7 @@ export interface ActiveGaugesPerDenomResponseProtoMsg { } export interface ActiveGaugesPerDenomResponseAmino { /** Active gagues that match denom in query */ - data: GaugeAmino[]; + data?: GaugeAmino[]; /** Pagination defines pagination for the response */ pagination?: PageResponseAmino; } @@ -203,11 +205,11 @@ export interface ActiveGaugesPerDenomResponseAminoMsg { } export interface ActiveGaugesPerDenomResponseSDKType { data: GaugeSDKType[]; - pagination: PageResponseSDKType; + pagination?: PageResponseSDKType; } export interface UpcomingGaugesRequest { /** Pagination defines pagination for the request */ - pagination: PageRequest; + pagination?: PageRequest; } export interface UpcomingGaugesRequestProtoMsg { typeUrl: "/osmosis.incentives.UpcomingGaugesRequest"; @@ -222,13 +224,13 @@ export interface UpcomingGaugesRequestAminoMsg { value: UpcomingGaugesRequestAmino; } export interface UpcomingGaugesRequestSDKType { - pagination: PageRequestSDKType; + pagination?: PageRequestSDKType; } export interface UpcomingGaugesResponse { /** Gauges whose distribution is upcoming */ data: Gauge[]; /** Pagination defines pagination for the response */ - pagination: PageResponse; + pagination?: PageResponse; } export interface UpcomingGaugesResponseProtoMsg { typeUrl: "/osmosis.incentives.UpcomingGaugesResponse"; @@ -236,7 +238,7 @@ export interface UpcomingGaugesResponseProtoMsg { } export interface UpcomingGaugesResponseAmino { /** Gauges whose distribution is upcoming */ - data: GaugeAmino[]; + data?: GaugeAmino[]; /** Pagination defines pagination for the response */ pagination?: PageResponseAmino; } @@ -246,13 +248,13 @@ export interface UpcomingGaugesResponseAminoMsg { } export interface UpcomingGaugesResponseSDKType { data: GaugeSDKType[]; - pagination: PageResponseSDKType; + pagination?: PageResponseSDKType; } export interface UpcomingGaugesPerDenomRequest { /** Filter for upcoming gagues that match specific denom */ denom: string; /** Pagination defines pagination for the request */ - pagination: PageRequest; + pagination?: PageRequest; } export interface UpcomingGaugesPerDenomRequestProtoMsg { typeUrl: "/osmosis.incentives.UpcomingGaugesPerDenomRequest"; @@ -260,7 +262,7 @@ export interface UpcomingGaugesPerDenomRequestProtoMsg { } export interface UpcomingGaugesPerDenomRequestAmino { /** Filter for upcoming gagues that match specific denom */ - denom: string; + denom?: string; /** Pagination defines pagination for the request */ pagination?: PageRequestAmino; } @@ -270,13 +272,13 @@ export interface UpcomingGaugesPerDenomRequestAminoMsg { } export interface UpcomingGaugesPerDenomRequestSDKType { denom: string; - pagination: PageRequestSDKType; + pagination?: PageRequestSDKType; } export interface UpcomingGaugesPerDenomResponse { /** Upcoming gagues that match denom in query */ upcomingGauges: Gauge[]; /** Pagination defines pagination for the response */ - pagination: PageResponse; + pagination?: PageResponse; } export interface UpcomingGaugesPerDenomResponseProtoMsg { typeUrl: "/osmosis.incentives.UpcomingGaugesPerDenomResponse"; @@ -284,7 +286,7 @@ export interface UpcomingGaugesPerDenomResponseProtoMsg { } export interface UpcomingGaugesPerDenomResponseAmino { /** Upcoming gagues that match denom in query */ - upcoming_gauges: GaugeAmino[]; + upcoming_gauges?: GaugeAmino[]; /** Pagination defines pagination for the response */ pagination?: PageResponseAmino; } @@ -294,7 +296,7 @@ export interface UpcomingGaugesPerDenomResponseAminoMsg { } export interface UpcomingGaugesPerDenomResponseSDKType { upcoming_gauges: GaugeSDKType[]; - pagination: PageResponseSDKType; + pagination?: PageResponseSDKType; } export interface RewardsEstRequest { /** Address that is being queried for future estimated rewards */ @@ -313,14 +315,14 @@ export interface RewardsEstRequestProtoMsg { } export interface RewardsEstRequestAmino { /** Address that is being queried for future estimated rewards */ - owner: string; + owner?: string; /** Lock IDs included in future reward estimation */ - lock_ids: string[]; + lock_ids?: string[]; /** * Upper time limit of reward estimation * Lower limit is current epoch */ - end_epoch: string; + end_epoch?: string; } export interface RewardsEstRequestAminoMsg { type: "osmosis/incentives/rewards-est-request"; @@ -333,7 +335,7 @@ export interface RewardsEstRequestSDKType { } export interface RewardsEstResponse { /** - * Estimated coin rewards that will be recieved at provided address + * Estimated coin rewards that will be received at provided address * from specified locks between current time and end epoch */ coins: Coin[]; @@ -344,10 +346,10 @@ export interface RewardsEstResponseProtoMsg { } export interface RewardsEstResponseAmino { /** - * Estimated coin rewards that will be recieved at provided address + * Estimated coin rewards that will be received at provided address * from specified locks between current time and end epoch */ - coins: CoinAmino[]; + coins?: CoinAmino[]; } export interface RewardsEstResponseAminoMsg { type: "osmosis/incentives/rewards-est-response"; @@ -368,7 +370,7 @@ export interface QueryLockableDurationsRequestAminoMsg { } export interface QueryLockableDurationsRequestSDKType {} export interface QueryLockableDurationsResponse { - /** Time durations that users can lock coins for in order to recieve rewards */ + /** Time durations that users can lock coins for in order to receive rewards */ lockableDurations: Duration[]; } export interface QueryLockableDurationsResponseProtoMsg { @@ -376,8 +378,8 @@ export interface QueryLockableDurationsResponseProtoMsg { value: Uint8Array; } export interface QueryLockableDurationsResponseAmino { - /** Time durations that users can lock coins for in order to recieve rewards */ - lockable_durations: DurationAmino[]; + /** Time durations that users can lock coins for in order to receive rewards */ + lockable_durations?: DurationAmino[]; } export interface QueryLockableDurationsResponseAminoMsg { type: "osmosis/incentives/query-lockable-durations-response"; @@ -386,6 +388,178 @@ export interface QueryLockableDurationsResponseAminoMsg { export interface QueryLockableDurationsResponseSDKType { lockable_durations: DurationSDKType[]; } +export interface QueryAllGroupsRequest {} +export interface QueryAllGroupsRequestProtoMsg { + typeUrl: "/osmosis.incentives.QueryAllGroupsRequest"; + value: Uint8Array; +} +export interface QueryAllGroupsRequestAmino {} +export interface QueryAllGroupsRequestAminoMsg { + type: "osmosis/incentives/query-all-groups-request"; + value: QueryAllGroupsRequestAmino; +} +export interface QueryAllGroupsRequestSDKType {} +export interface QueryAllGroupsResponse { + groups: Group[]; +} +export interface QueryAllGroupsResponseProtoMsg { + typeUrl: "/osmosis.incentives.QueryAllGroupsResponse"; + value: Uint8Array; +} +export interface QueryAllGroupsResponseAmino { + groups?: GroupAmino[]; +} +export interface QueryAllGroupsResponseAminoMsg { + type: "osmosis/incentives/query-all-groups-response"; + value: QueryAllGroupsResponseAmino; +} +export interface QueryAllGroupsResponseSDKType { + groups: GroupSDKType[]; +} +export interface QueryAllGroupsGaugesRequest {} +export interface QueryAllGroupsGaugesRequestProtoMsg { + typeUrl: "/osmosis.incentives.QueryAllGroupsGaugesRequest"; + value: Uint8Array; +} +export interface QueryAllGroupsGaugesRequestAmino {} +export interface QueryAllGroupsGaugesRequestAminoMsg { + type: "osmosis/incentives/query-all-groups-gauges-request"; + value: QueryAllGroupsGaugesRequestAmino; +} +export interface QueryAllGroupsGaugesRequestSDKType {} +export interface QueryAllGroupsGaugesResponse { + gauges: Gauge[]; +} +export interface QueryAllGroupsGaugesResponseProtoMsg { + typeUrl: "/osmosis.incentives.QueryAllGroupsGaugesResponse"; + value: Uint8Array; +} +export interface QueryAllGroupsGaugesResponseAmino { + gauges?: GaugeAmino[]; +} +export interface QueryAllGroupsGaugesResponseAminoMsg { + type: "osmosis/incentives/query-all-groups-gauges-response"; + value: QueryAllGroupsGaugesResponseAmino; +} +export interface QueryAllGroupsGaugesResponseSDKType { + gauges: GaugeSDKType[]; +} +export interface QueryAllGroupsWithGaugeRequest {} +export interface QueryAllGroupsWithGaugeRequestProtoMsg { + typeUrl: "/osmosis.incentives.QueryAllGroupsWithGaugeRequest"; + value: Uint8Array; +} +export interface QueryAllGroupsWithGaugeRequestAmino {} +export interface QueryAllGroupsWithGaugeRequestAminoMsg { + type: "osmosis/incentives/query-all-groups-with-gauge-request"; + value: QueryAllGroupsWithGaugeRequestAmino; +} +export interface QueryAllGroupsWithGaugeRequestSDKType {} +export interface QueryAllGroupsWithGaugeResponse { + groupsWithGauge: GroupsWithGauge[]; +} +export interface QueryAllGroupsWithGaugeResponseProtoMsg { + typeUrl: "/osmosis.incentives.QueryAllGroupsWithGaugeResponse"; + value: Uint8Array; +} +export interface QueryAllGroupsWithGaugeResponseAmino { + groups_with_gauge?: GroupsWithGaugeAmino[]; +} +export interface QueryAllGroupsWithGaugeResponseAminoMsg { + type: "osmosis/incentives/query-all-groups-with-gauge-response"; + value: QueryAllGroupsWithGaugeResponseAmino; +} +export interface QueryAllGroupsWithGaugeResponseSDKType { + groups_with_gauge: GroupsWithGaugeSDKType[]; +} +export interface QueryGroupByGroupGaugeIDRequest { + id: bigint; +} +export interface QueryGroupByGroupGaugeIDRequestProtoMsg { + typeUrl: "/osmosis.incentives.QueryGroupByGroupGaugeIDRequest"; + value: Uint8Array; +} +export interface QueryGroupByGroupGaugeIDRequestAmino { + id?: string; +} +export interface QueryGroupByGroupGaugeIDRequestAminoMsg { + type: "osmosis/incentives/query-group-by-group-gauge-id-request"; + value: QueryGroupByGroupGaugeIDRequestAmino; +} +export interface QueryGroupByGroupGaugeIDRequestSDKType { + id: bigint; +} +export interface QueryGroupByGroupGaugeIDResponse { + group: Group; +} +export interface QueryGroupByGroupGaugeIDResponseProtoMsg { + typeUrl: "/osmosis.incentives.QueryGroupByGroupGaugeIDResponse"; + value: Uint8Array; +} +export interface QueryGroupByGroupGaugeIDResponseAmino { + group?: GroupAmino; +} +export interface QueryGroupByGroupGaugeIDResponseAminoMsg { + type: "osmosis/incentives/query-group-by-group-gauge-id-response"; + value: QueryGroupByGroupGaugeIDResponseAmino; +} +export interface QueryGroupByGroupGaugeIDResponseSDKType { + group: GroupSDKType; +} +export interface QueryCurrentWeightByGroupGaugeIDRequest { + groupGaugeId: bigint; +} +export interface QueryCurrentWeightByGroupGaugeIDRequestProtoMsg { + typeUrl: "/osmosis.incentives.QueryCurrentWeightByGroupGaugeIDRequest"; + value: Uint8Array; +} +export interface QueryCurrentWeightByGroupGaugeIDRequestAmino { + group_gauge_id?: string; +} +export interface QueryCurrentWeightByGroupGaugeIDRequestAminoMsg { + type: "osmosis/incentives/query-current-weight-by-group-gauge-id-request"; + value: QueryCurrentWeightByGroupGaugeIDRequestAmino; +} +export interface QueryCurrentWeightByGroupGaugeIDRequestSDKType { + group_gauge_id: bigint; +} +export interface QueryCurrentWeightByGroupGaugeIDResponse { + gaugeWeight: GaugeWeight[]; +} +export interface QueryCurrentWeightByGroupGaugeIDResponseProtoMsg { + typeUrl: "/osmosis.incentives.QueryCurrentWeightByGroupGaugeIDResponse"; + value: Uint8Array; +} +export interface QueryCurrentWeightByGroupGaugeIDResponseAmino { + gauge_weight?: GaugeWeightAmino[]; +} +export interface QueryCurrentWeightByGroupGaugeIDResponseAminoMsg { + type: "osmosis/incentives/query-current-weight-by-group-gauge-id-response"; + value: QueryCurrentWeightByGroupGaugeIDResponseAmino; +} +export interface QueryCurrentWeightByGroupGaugeIDResponseSDKType { + gauge_weight: GaugeWeightSDKType[]; +} +export interface GaugeWeight { + gaugeId: bigint; + weightRatio: string; +} +export interface GaugeWeightProtoMsg { + typeUrl: "/osmosis.incentives.GaugeWeight"; + value: Uint8Array; +} +export interface GaugeWeightAmino { + gauge_id?: string; + weight_ratio?: string; +} +export interface GaugeWeightAminoMsg { + type: "osmosis/incentives/gauge-weight"; + value: GaugeWeightAmino; +} +export interface GaugeWeightSDKType { + gauge_id: bigint; + weight_ratio: string; +} function createBaseModuleToDistributeCoinsRequest(): ModuleToDistributeCoinsRequest { return {}; } @@ -413,7 +587,8 @@ export const ModuleToDistributeCoinsRequest = { return message; }, fromAmino(_: ModuleToDistributeCoinsRequestAmino): ModuleToDistributeCoinsRequest { - return {}; + const message = createBaseModuleToDistributeCoinsRequest(); + return message; }, toAmino(_: ModuleToDistributeCoinsRequest): ModuleToDistributeCoinsRequestAmino { const obj: any = {}; @@ -477,9 +652,9 @@ export const ModuleToDistributeCoinsResponse = { return message; }, fromAmino(object: ModuleToDistributeCoinsResponseAmino): ModuleToDistributeCoinsResponse { - return { - coins: Array.isArray(object?.coins) ? object.coins.map((e: any) => Coin.fromAmino(e)) : [] - }; + const message = createBaseModuleToDistributeCoinsResponse(); + message.coins = object.coins?.map(e => Coin.fromAmino(e)) || []; + return message; }, toAmino(message: ModuleToDistributeCoinsResponse): ModuleToDistributeCoinsResponseAmino { const obj: any = {}; @@ -548,9 +723,11 @@ export const GaugeByIDRequest = { return message; }, fromAmino(object: GaugeByIDRequestAmino): GaugeByIDRequest { - return { - id: BigInt(object.id) - }; + const message = createBaseGaugeByIDRequest(); + if (object.id !== undefined && object.id !== null) { + message.id = BigInt(object.id); + } + return message; }, toAmino(message: GaugeByIDRequest): GaugeByIDRequestAmino { const obj: any = {}; @@ -581,7 +758,7 @@ export const GaugeByIDRequest = { }; function createBaseGaugeByIDResponse(): GaugeByIDResponse { return { - gauge: Gauge.fromPartial({}) + gauge: undefined }; } export const GaugeByIDResponse = { @@ -615,9 +792,11 @@ export const GaugeByIDResponse = { return message; }, fromAmino(object: GaugeByIDResponseAmino): GaugeByIDResponse { - return { - gauge: object?.gauge ? Gauge.fromAmino(object.gauge) : undefined - }; + const message = createBaseGaugeByIDResponse(); + if (object.gauge !== undefined && object.gauge !== null) { + message.gauge = Gauge.fromAmino(object.gauge); + } + return message; }, toAmino(message: GaugeByIDResponse): GaugeByIDResponseAmino { const obj: any = {}; @@ -648,7 +827,7 @@ export const GaugeByIDResponse = { }; function createBaseGaugesRequest(): GaugesRequest { return { - pagination: PageRequest.fromPartial({}) + pagination: undefined }; } export const GaugesRequest = { @@ -682,9 +861,11 @@ export const GaugesRequest = { return message; }, fromAmino(object: GaugesRequestAmino): GaugesRequest { - return { - pagination: object?.pagination ? PageRequest.fromAmino(object.pagination) : undefined - }; + const message = createBaseGaugesRequest(); + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromAmino(object.pagination); + } + return message; }, toAmino(message: GaugesRequest): GaugesRequestAmino { const obj: any = {}; @@ -716,7 +897,7 @@ export const GaugesRequest = { function createBaseGaugesResponse(): GaugesResponse { return { data: [], - pagination: PageResponse.fromPartial({}) + pagination: undefined }; } export const GaugesResponse = { @@ -757,10 +938,12 @@ export const GaugesResponse = { return message; }, fromAmino(object: GaugesResponseAmino): GaugesResponse { - return { - data: Array.isArray(object?.data) ? object.data.map((e: any) => Gauge.fromAmino(e)) : [], - pagination: object?.pagination ? PageResponse.fromAmino(object.pagination) : undefined - }; + const message = createBaseGaugesResponse(); + message.data = object.data?.map(e => Gauge.fromAmino(e)) || []; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromAmino(object.pagination); + } + return message; }, toAmino(message: GaugesResponse): GaugesResponseAmino { const obj: any = {}; @@ -796,7 +979,7 @@ export const GaugesResponse = { }; function createBaseActiveGaugesRequest(): ActiveGaugesRequest { return { - pagination: PageRequest.fromPartial({}) + pagination: undefined }; } export const ActiveGaugesRequest = { @@ -830,9 +1013,11 @@ export const ActiveGaugesRequest = { return message; }, fromAmino(object: ActiveGaugesRequestAmino): ActiveGaugesRequest { - return { - pagination: object?.pagination ? PageRequest.fromAmino(object.pagination) : undefined - }; + const message = createBaseActiveGaugesRequest(); + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromAmino(object.pagination); + } + return message; }, toAmino(message: ActiveGaugesRequest): ActiveGaugesRequestAmino { const obj: any = {}; @@ -864,7 +1049,7 @@ export const ActiveGaugesRequest = { function createBaseActiveGaugesResponse(): ActiveGaugesResponse { return { data: [], - pagination: PageResponse.fromPartial({}) + pagination: undefined }; } export const ActiveGaugesResponse = { @@ -905,10 +1090,12 @@ export const ActiveGaugesResponse = { return message; }, fromAmino(object: ActiveGaugesResponseAmino): ActiveGaugesResponse { - return { - data: Array.isArray(object?.data) ? object.data.map((e: any) => Gauge.fromAmino(e)) : [], - pagination: object?.pagination ? PageResponse.fromAmino(object.pagination) : undefined - }; + const message = createBaseActiveGaugesResponse(); + message.data = object.data?.map(e => Gauge.fromAmino(e)) || []; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromAmino(object.pagination); + } + return message; }, toAmino(message: ActiveGaugesResponse): ActiveGaugesResponseAmino { const obj: any = {}; @@ -945,7 +1132,7 @@ export const ActiveGaugesResponse = { function createBaseActiveGaugesPerDenomRequest(): ActiveGaugesPerDenomRequest { return { denom: "", - pagination: PageRequest.fromPartial({}) + pagination: undefined }; } export const ActiveGaugesPerDenomRequest = { @@ -986,10 +1173,14 @@ export const ActiveGaugesPerDenomRequest = { return message; }, fromAmino(object: ActiveGaugesPerDenomRequestAmino): ActiveGaugesPerDenomRequest { - return { - denom: object.denom, - pagination: object?.pagination ? PageRequest.fromAmino(object.pagination) : undefined - }; + const message = createBaseActiveGaugesPerDenomRequest(); + if (object.denom !== undefined && object.denom !== null) { + message.denom = object.denom; + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromAmino(object.pagination); + } + return message; }, toAmino(message: ActiveGaugesPerDenomRequest): ActiveGaugesPerDenomRequestAmino { const obj: any = {}; @@ -1022,7 +1213,7 @@ export const ActiveGaugesPerDenomRequest = { function createBaseActiveGaugesPerDenomResponse(): ActiveGaugesPerDenomResponse { return { data: [], - pagination: PageResponse.fromPartial({}) + pagination: undefined }; } export const ActiveGaugesPerDenomResponse = { @@ -1063,10 +1254,12 @@ export const ActiveGaugesPerDenomResponse = { return message; }, fromAmino(object: ActiveGaugesPerDenomResponseAmino): ActiveGaugesPerDenomResponse { - return { - data: Array.isArray(object?.data) ? object.data.map((e: any) => Gauge.fromAmino(e)) : [], - pagination: object?.pagination ? PageResponse.fromAmino(object.pagination) : undefined - }; + const message = createBaseActiveGaugesPerDenomResponse(); + message.data = object.data?.map(e => Gauge.fromAmino(e)) || []; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromAmino(object.pagination); + } + return message; }, toAmino(message: ActiveGaugesPerDenomResponse): ActiveGaugesPerDenomResponseAmino { const obj: any = {}; @@ -1102,7 +1295,7 @@ export const ActiveGaugesPerDenomResponse = { }; function createBaseUpcomingGaugesRequest(): UpcomingGaugesRequest { return { - pagination: PageRequest.fromPartial({}) + pagination: undefined }; } export const UpcomingGaugesRequest = { @@ -1136,9 +1329,11 @@ export const UpcomingGaugesRequest = { return message; }, fromAmino(object: UpcomingGaugesRequestAmino): UpcomingGaugesRequest { - return { - pagination: object?.pagination ? PageRequest.fromAmino(object.pagination) : undefined - }; + const message = createBaseUpcomingGaugesRequest(); + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromAmino(object.pagination); + } + return message; }, toAmino(message: UpcomingGaugesRequest): UpcomingGaugesRequestAmino { const obj: any = {}; @@ -1170,7 +1365,7 @@ export const UpcomingGaugesRequest = { function createBaseUpcomingGaugesResponse(): UpcomingGaugesResponse { return { data: [], - pagination: PageResponse.fromPartial({}) + pagination: undefined }; } export const UpcomingGaugesResponse = { @@ -1211,10 +1406,12 @@ export const UpcomingGaugesResponse = { return message; }, fromAmino(object: UpcomingGaugesResponseAmino): UpcomingGaugesResponse { - return { - data: Array.isArray(object?.data) ? object.data.map((e: any) => Gauge.fromAmino(e)) : [], - pagination: object?.pagination ? PageResponse.fromAmino(object.pagination) : undefined - }; + const message = createBaseUpcomingGaugesResponse(); + message.data = object.data?.map(e => Gauge.fromAmino(e)) || []; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromAmino(object.pagination); + } + return message; }, toAmino(message: UpcomingGaugesResponse): UpcomingGaugesResponseAmino { const obj: any = {}; @@ -1251,7 +1448,7 @@ export const UpcomingGaugesResponse = { function createBaseUpcomingGaugesPerDenomRequest(): UpcomingGaugesPerDenomRequest { return { denom: "", - pagination: PageRequest.fromPartial({}) + pagination: undefined }; } export const UpcomingGaugesPerDenomRequest = { @@ -1292,10 +1489,14 @@ export const UpcomingGaugesPerDenomRequest = { return message; }, fromAmino(object: UpcomingGaugesPerDenomRequestAmino): UpcomingGaugesPerDenomRequest { - return { - denom: object.denom, - pagination: object?.pagination ? PageRequest.fromAmino(object.pagination) : undefined - }; + const message = createBaseUpcomingGaugesPerDenomRequest(); + if (object.denom !== undefined && object.denom !== null) { + message.denom = object.denom; + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromAmino(object.pagination); + } + return message; }, toAmino(message: UpcomingGaugesPerDenomRequest): UpcomingGaugesPerDenomRequestAmino { const obj: any = {}; @@ -1328,7 +1529,7 @@ export const UpcomingGaugesPerDenomRequest = { function createBaseUpcomingGaugesPerDenomResponse(): UpcomingGaugesPerDenomResponse { return { upcomingGauges: [], - pagination: PageResponse.fromPartial({}) + pagination: undefined }; } export const UpcomingGaugesPerDenomResponse = { @@ -1369,10 +1570,12 @@ export const UpcomingGaugesPerDenomResponse = { return message; }, fromAmino(object: UpcomingGaugesPerDenomResponseAmino): UpcomingGaugesPerDenomResponse { - return { - upcomingGauges: Array.isArray(object?.upcoming_gauges) ? object.upcoming_gauges.map((e: any) => Gauge.fromAmino(e)) : [], - pagination: object?.pagination ? PageResponse.fromAmino(object.pagination) : undefined - }; + const message = createBaseUpcomingGaugesPerDenomResponse(); + message.upcomingGauges = object.upcoming_gauges?.map(e => Gauge.fromAmino(e)) || []; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromAmino(object.pagination); + } + return message; }, toAmino(message: UpcomingGaugesPerDenomResponse): UpcomingGaugesPerDenomResponseAmino { const obj: any = {}; @@ -1467,11 +1670,15 @@ export const RewardsEstRequest = { return message; }, fromAmino(object: RewardsEstRequestAmino): RewardsEstRequest { - return { - owner: object.owner, - lockIds: Array.isArray(object?.lock_ids) ? object.lock_ids.map((e: any) => BigInt(e)) : [], - endEpoch: BigInt(object.end_epoch) - }; + const message = createBaseRewardsEstRequest(); + if (object.owner !== undefined && object.owner !== null) { + message.owner = object.owner; + } + message.lockIds = object.lock_ids?.map(e => BigInt(e)) || []; + if (object.end_epoch !== undefined && object.end_epoch !== null) { + message.endEpoch = BigInt(object.end_epoch); + } + return message; }, toAmino(message: RewardsEstRequest): RewardsEstRequestAmino { const obj: any = {}; @@ -1542,9 +1749,9 @@ export const RewardsEstResponse = { return message; }, fromAmino(object: RewardsEstResponseAmino): RewardsEstResponse { - return { - coins: Array.isArray(object?.coins) ? object.coins.map((e: any) => Coin.fromAmino(e)) : [] - }; + const message = createBaseRewardsEstResponse(); + message.coins = object.coins?.map(e => Coin.fromAmino(e)) || []; + return message; }, toAmino(message: RewardsEstResponse): RewardsEstResponseAmino { const obj: any = {}; @@ -1604,7 +1811,8 @@ export const QueryLockableDurationsRequest = { return message; }, fromAmino(_: QueryLockableDurationsRequestAmino): QueryLockableDurationsRequest { - return {}; + const message = createBaseQueryLockableDurationsRequest(); + return message; }, toAmino(_: QueryLockableDurationsRequest): QueryLockableDurationsRequestAmino { const obj: any = {}; @@ -1668,9 +1876,9 @@ export const QueryLockableDurationsResponse = { return message; }, fromAmino(object: QueryLockableDurationsResponseAmino): QueryLockableDurationsResponse { - return { - lockableDurations: Array.isArray(object?.lockable_durations) ? object.lockable_durations.map((e: any) => Duration.fromAmino(e)) : [] - }; + const message = createBaseQueryLockableDurationsResponse(); + message.lockableDurations = object.lockable_durations?.map(e => Duration.fromAmino(e)) || []; + return message; }, toAmino(message: QueryLockableDurationsResponse): QueryLockableDurationsResponseAmino { const obj: any = {}; @@ -1702,4 +1910,744 @@ export const QueryLockableDurationsResponse = { value: QueryLockableDurationsResponse.encode(message).finish() }; } +}; +function createBaseQueryAllGroupsRequest(): QueryAllGroupsRequest { + return {}; +} +export const QueryAllGroupsRequest = { + typeUrl: "/osmosis.incentives.QueryAllGroupsRequest", + encode(_: QueryAllGroupsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryAllGroupsRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryAllGroupsRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): QueryAllGroupsRequest { + const message = createBaseQueryAllGroupsRequest(); + return message; + }, + fromAmino(_: QueryAllGroupsRequestAmino): QueryAllGroupsRequest { + const message = createBaseQueryAllGroupsRequest(); + return message; + }, + toAmino(_: QueryAllGroupsRequest): QueryAllGroupsRequestAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: QueryAllGroupsRequestAminoMsg): QueryAllGroupsRequest { + return QueryAllGroupsRequest.fromAmino(object.value); + }, + toAminoMsg(message: QueryAllGroupsRequest): QueryAllGroupsRequestAminoMsg { + return { + type: "osmosis/incentives/query-all-groups-request", + value: QueryAllGroupsRequest.toAmino(message) + }; + }, + fromProtoMsg(message: QueryAllGroupsRequestProtoMsg): QueryAllGroupsRequest { + return QueryAllGroupsRequest.decode(message.value); + }, + toProto(message: QueryAllGroupsRequest): Uint8Array { + return QueryAllGroupsRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryAllGroupsRequest): QueryAllGroupsRequestProtoMsg { + return { + typeUrl: "/osmosis.incentives.QueryAllGroupsRequest", + value: QueryAllGroupsRequest.encode(message).finish() + }; + } +}; +function createBaseQueryAllGroupsResponse(): QueryAllGroupsResponse { + return { + groups: [] + }; +} +export const QueryAllGroupsResponse = { + typeUrl: "/osmosis.incentives.QueryAllGroupsResponse", + encode(message: QueryAllGroupsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.groups) { + Group.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryAllGroupsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryAllGroupsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.groups.push(Group.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryAllGroupsResponse { + const message = createBaseQueryAllGroupsResponse(); + message.groups = object.groups?.map(e => Group.fromPartial(e)) || []; + return message; + }, + fromAmino(object: QueryAllGroupsResponseAmino): QueryAllGroupsResponse { + const message = createBaseQueryAllGroupsResponse(); + message.groups = object.groups?.map(e => Group.fromAmino(e)) || []; + return message; + }, + toAmino(message: QueryAllGroupsResponse): QueryAllGroupsResponseAmino { + const obj: any = {}; + if (message.groups) { + obj.groups = message.groups.map(e => e ? Group.toAmino(e) : undefined); + } else { + obj.groups = []; + } + return obj; + }, + fromAminoMsg(object: QueryAllGroupsResponseAminoMsg): QueryAllGroupsResponse { + return QueryAllGroupsResponse.fromAmino(object.value); + }, + toAminoMsg(message: QueryAllGroupsResponse): QueryAllGroupsResponseAminoMsg { + return { + type: "osmosis/incentives/query-all-groups-response", + value: QueryAllGroupsResponse.toAmino(message) + }; + }, + fromProtoMsg(message: QueryAllGroupsResponseProtoMsg): QueryAllGroupsResponse { + return QueryAllGroupsResponse.decode(message.value); + }, + toProto(message: QueryAllGroupsResponse): Uint8Array { + return QueryAllGroupsResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryAllGroupsResponse): QueryAllGroupsResponseProtoMsg { + return { + typeUrl: "/osmosis.incentives.QueryAllGroupsResponse", + value: QueryAllGroupsResponse.encode(message).finish() + }; + } +}; +function createBaseQueryAllGroupsGaugesRequest(): QueryAllGroupsGaugesRequest { + return {}; +} +export const QueryAllGroupsGaugesRequest = { + typeUrl: "/osmosis.incentives.QueryAllGroupsGaugesRequest", + encode(_: QueryAllGroupsGaugesRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryAllGroupsGaugesRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryAllGroupsGaugesRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): QueryAllGroupsGaugesRequest { + const message = createBaseQueryAllGroupsGaugesRequest(); + return message; + }, + fromAmino(_: QueryAllGroupsGaugesRequestAmino): QueryAllGroupsGaugesRequest { + const message = createBaseQueryAllGroupsGaugesRequest(); + return message; + }, + toAmino(_: QueryAllGroupsGaugesRequest): QueryAllGroupsGaugesRequestAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: QueryAllGroupsGaugesRequestAminoMsg): QueryAllGroupsGaugesRequest { + return QueryAllGroupsGaugesRequest.fromAmino(object.value); + }, + toAminoMsg(message: QueryAllGroupsGaugesRequest): QueryAllGroupsGaugesRequestAminoMsg { + return { + type: "osmosis/incentives/query-all-groups-gauges-request", + value: QueryAllGroupsGaugesRequest.toAmino(message) + }; + }, + fromProtoMsg(message: QueryAllGroupsGaugesRequestProtoMsg): QueryAllGroupsGaugesRequest { + return QueryAllGroupsGaugesRequest.decode(message.value); + }, + toProto(message: QueryAllGroupsGaugesRequest): Uint8Array { + return QueryAllGroupsGaugesRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryAllGroupsGaugesRequest): QueryAllGroupsGaugesRequestProtoMsg { + return { + typeUrl: "/osmosis.incentives.QueryAllGroupsGaugesRequest", + value: QueryAllGroupsGaugesRequest.encode(message).finish() + }; + } +}; +function createBaseQueryAllGroupsGaugesResponse(): QueryAllGroupsGaugesResponse { + return { + gauges: [] + }; +} +export const QueryAllGroupsGaugesResponse = { + typeUrl: "/osmosis.incentives.QueryAllGroupsGaugesResponse", + encode(message: QueryAllGroupsGaugesResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.gauges) { + Gauge.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryAllGroupsGaugesResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryAllGroupsGaugesResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.gauges.push(Gauge.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryAllGroupsGaugesResponse { + const message = createBaseQueryAllGroupsGaugesResponse(); + message.gauges = object.gauges?.map(e => Gauge.fromPartial(e)) || []; + return message; + }, + fromAmino(object: QueryAllGroupsGaugesResponseAmino): QueryAllGroupsGaugesResponse { + const message = createBaseQueryAllGroupsGaugesResponse(); + message.gauges = object.gauges?.map(e => Gauge.fromAmino(e)) || []; + return message; + }, + toAmino(message: QueryAllGroupsGaugesResponse): QueryAllGroupsGaugesResponseAmino { + const obj: any = {}; + if (message.gauges) { + obj.gauges = message.gauges.map(e => e ? Gauge.toAmino(e) : undefined); + } else { + obj.gauges = []; + } + return obj; + }, + fromAminoMsg(object: QueryAllGroupsGaugesResponseAminoMsg): QueryAllGroupsGaugesResponse { + return QueryAllGroupsGaugesResponse.fromAmino(object.value); + }, + toAminoMsg(message: QueryAllGroupsGaugesResponse): QueryAllGroupsGaugesResponseAminoMsg { + return { + type: "osmosis/incentives/query-all-groups-gauges-response", + value: QueryAllGroupsGaugesResponse.toAmino(message) + }; + }, + fromProtoMsg(message: QueryAllGroupsGaugesResponseProtoMsg): QueryAllGroupsGaugesResponse { + return QueryAllGroupsGaugesResponse.decode(message.value); + }, + toProto(message: QueryAllGroupsGaugesResponse): Uint8Array { + return QueryAllGroupsGaugesResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryAllGroupsGaugesResponse): QueryAllGroupsGaugesResponseProtoMsg { + return { + typeUrl: "/osmosis.incentives.QueryAllGroupsGaugesResponse", + value: QueryAllGroupsGaugesResponse.encode(message).finish() + }; + } +}; +function createBaseQueryAllGroupsWithGaugeRequest(): QueryAllGroupsWithGaugeRequest { + return {}; +} +export const QueryAllGroupsWithGaugeRequest = { + typeUrl: "/osmosis.incentives.QueryAllGroupsWithGaugeRequest", + encode(_: QueryAllGroupsWithGaugeRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryAllGroupsWithGaugeRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryAllGroupsWithGaugeRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): QueryAllGroupsWithGaugeRequest { + const message = createBaseQueryAllGroupsWithGaugeRequest(); + return message; + }, + fromAmino(_: QueryAllGroupsWithGaugeRequestAmino): QueryAllGroupsWithGaugeRequest { + const message = createBaseQueryAllGroupsWithGaugeRequest(); + return message; + }, + toAmino(_: QueryAllGroupsWithGaugeRequest): QueryAllGroupsWithGaugeRequestAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: QueryAllGroupsWithGaugeRequestAminoMsg): QueryAllGroupsWithGaugeRequest { + return QueryAllGroupsWithGaugeRequest.fromAmino(object.value); + }, + toAminoMsg(message: QueryAllGroupsWithGaugeRequest): QueryAllGroupsWithGaugeRequestAminoMsg { + return { + type: "osmosis/incentives/query-all-groups-with-gauge-request", + value: QueryAllGroupsWithGaugeRequest.toAmino(message) + }; + }, + fromProtoMsg(message: QueryAllGroupsWithGaugeRequestProtoMsg): QueryAllGroupsWithGaugeRequest { + return QueryAllGroupsWithGaugeRequest.decode(message.value); + }, + toProto(message: QueryAllGroupsWithGaugeRequest): Uint8Array { + return QueryAllGroupsWithGaugeRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryAllGroupsWithGaugeRequest): QueryAllGroupsWithGaugeRequestProtoMsg { + return { + typeUrl: "/osmosis.incentives.QueryAllGroupsWithGaugeRequest", + value: QueryAllGroupsWithGaugeRequest.encode(message).finish() + }; + } +}; +function createBaseQueryAllGroupsWithGaugeResponse(): QueryAllGroupsWithGaugeResponse { + return { + groupsWithGauge: [] + }; +} +export const QueryAllGroupsWithGaugeResponse = { + typeUrl: "/osmosis.incentives.QueryAllGroupsWithGaugeResponse", + encode(message: QueryAllGroupsWithGaugeResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.groupsWithGauge) { + GroupsWithGauge.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryAllGroupsWithGaugeResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryAllGroupsWithGaugeResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.groupsWithGauge.push(GroupsWithGauge.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryAllGroupsWithGaugeResponse { + const message = createBaseQueryAllGroupsWithGaugeResponse(); + message.groupsWithGauge = object.groupsWithGauge?.map(e => GroupsWithGauge.fromPartial(e)) || []; + return message; + }, + fromAmino(object: QueryAllGroupsWithGaugeResponseAmino): QueryAllGroupsWithGaugeResponse { + const message = createBaseQueryAllGroupsWithGaugeResponse(); + message.groupsWithGauge = object.groups_with_gauge?.map(e => GroupsWithGauge.fromAmino(e)) || []; + return message; + }, + toAmino(message: QueryAllGroupsWithGaugeResponse): QueryAllGroupsWithGaugeResponseAmino { + const obj: any = {}; + if (message.groupsWithGauge) { + obj.groups_with_gauge = message.groupsWithGauge.map(e => e ? GroupsWithGauge.toAmino(e) : undefined); + } else { + obj.groups_with_gauge = []; + } + return obj; + }, + fromAminoMsg(object: QueryAllGroupsWithGaugeResponseAminoMsg): QueryAllGroupsWithGaugeResponse { + return QueryAllGroupsWithGaugeResponse.fromAmino(object.value); + }, + toAminoMsg(message: QueryAllGroupsWithGaugeResponse): QueryAllGroupsWithGaugeResponseAminoMsg { + return { + type: "osmosis/incentives/query-all-groups-with-gauge-response", + value: QueryAllGroupsWithGaugeResponse.toAmino(message) + }; + }, + fromProtoMsg(message: QueryAllGroupsWithGaugeResponseProtoMsg): QueryAllGroupsWithGaugeResponse { + return QueryAllGroupsWithGaugeResponse.decode(message.value); + }, + toProto(message: QueryAllGroupsWithGaugeResponse): Uint8Array { + return QueryAllGroupsWithGaugeResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryAllGroupsWithGaugeResponse): QueryAllGroupsWithGaugeResponseProtoMsg { + return { + typeUrl: "/osmosis.incentives.QueryAllGroupsWithGaugeResponse", + value: QueryAllGroupsWithGaugeResponse.encode(message).finish() + }; + } +}; +function createBaseQueryGroupByGroupGaugeIDRequest(): QueryGroupByGroupGaugeIDRequest { + return { + id: BigInt(0) + }; +} +export const QueryGroupByGroupGaugeIDRequest = { + typeUrl: "/osmosis.incentives.QueryGroupByGroupGaugeIDRequest", + encode(message: QueryGroupByGroupGaugeIDRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.id !== BigInt(0)) { + writer.uint32(8).uint64(message.id); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryGroupByGroupGaugeIDRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryGroupByGroupGaugeIDRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.id = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryGroupByGroupGaugeIDRequest { + const message = createBaseQueryGroupByGroupGaugeIDRequest(); + message.id = object.id !== undefined && object.id !== null ? BigInt(object.id.toString()) : BigInt(0); + return message; + }, + fromAmino(object: QueryGroupByGroupGaugeIDRequestAmino): QueryGroupByGroupGaugeIDRequest { + const message = createBaseQueryGroupByGroupGaugeIDRequest(); + if (object.id !== undefined && object.id !== null) { + message.id = BigInt(object.id); + } + return message; + }, + toAmino(message: QueryGroupByGroupGaugeIDRequest): QueryGroupByGroupGaugeIDRequestAmino { + const obj: any = {}; + obj.id = message.id ? message.id.toString() : undefined; + return obj; + }, + fromAminoMsg(object: QueryGroupByGroupGaugeIDRequestAminoMsg): QueryGroupByGroupGaugeIDRequest { + return QueryGroupByGroupGaugeIDRequest.fromAmino(object.value); + }, + toAminoMsg(message: QueryGroupByGroupGaugeIDRequest): QueryGroupByGroupGaugeIDRequestAminoMsg { + return { + type: "osmosis/incentives/query-group-by-group-gauge-id-request", + value: QueryGroupByGroupGaugeIDRequest.toAmino(message) + }; + }, + fromProtoMsg(message: QueryGroupByGroupGaugeIDRequestProtoMsg): QueryGroupByGroupGaugeIDRequest { + return QueryGroupByGroupGaugeIDRequest.decode(message.value); + }, + toProto(message: QueryGroupByGroupGaugeIDRequest): Uint8Array { + return QueryGroupByGroupGaugeIDRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryGroupByGroupGaugeIDRequest): QueryGroupByGroupGaugeIDRequestProtoMsg { + return { + typeUrl: "/osmosis.incentives.QueryGroupByGroupGaugeIDRequest", + value: QueryGroupByGroupGaugeIDRequest.encode(message).finish() + }; + } +}; +function createBaseQueryGroupByGroupGaugeIDResponse(): QueryGroupByGroupGaugeIDResponse { + return { + group: Group.fromPartial({}) + }; +} +export const QueryGroupByGroupGaugeIDResponse = { + typeUrl: "/osmosis.incentives.QueryGroupByGroupGaugeIDResponse", + encode(message: QueryGroupByGroupGaugeIDResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.group !== undefined) { + Group.encode(message.group, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryGroupByGroupGaugeIDResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryGroupByGroupGaugeIDResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.group = Group.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryGroupByGroupGaugeIDResponse { + const message = createBaseQueryGroupByGroupGaugeIDResponse(); + message.group = object.group !== undefined && object.group !== null ? Group.fromPartial(object.group) : undefined; + return message; + }, + fromAmino(object: QueryGroupByGroupGaugeIDResponseAmino): QueryGroupByGroupGaugeIDResponse { + const message = createBaseQueryGroupByGroupGaugeIDResponse(); + if (object.group !== undefined && object.group !== null) { + message.group = Group.fromAmino(object.group); + } + return message; + }, + toAmino(message: QueryGroupByGroupGaugeIDResponse): QueryGroupByGroupGaugeIDResponseAmino { + const obj: any = {}; + obj.group = message.group ? Group.toAmino(message.group) : undefined; + return obj; + }, + fromAminoMsg(object: QueryGroupByGroupGaugeIDResponseAminoMsg): QueryGroupByGroupGaugeIDResponse { + return QueryGroupByGroupGaugeIDResponse.fromAmino(object.value); + }, + toAminoMsg(message: QueryGroupByGroupGaugeIDResponse): QueryGroupByGroupGaugeIDResponseAminoMsg { + return { + type: "osmosis/incentives/query-group-by-group-gauge-id-response", + value: QueryGroupByGroupGaugeIDResponse.toAmino(message) + }; + }, + fromProtoMsg(message: QueryGroupByGroupGaugeIDResponseProtoMsg): QueryGroupByGroupGaugeIDResponse { + return QueryGroupByGroupGaugeIDResponse.decode(message.value); + }, + toProto(message: QueryGroupByGroupGaugeIDResponse): Uint8Array { + return QueryGroupByGroupGaugeIDResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryGroupByGroupGaugeIDResponse): QueryGroupByGroupGaugeIDResponseProtoMsg { + return { + typeUrl: "/osmosis.incentives.QueryGroupByGroupGaugeIDResponse", + value: QueryGroupByGroupGaugeIDResponse.encode(message).finish() + }; + } +}; +function createBaseQueryCurrentWeightByGroupGaugeIDRequest(): QueryCurrentWeightByGroupGaugeIDRequest { + return { + groupGaugeId: BigInt(0) + }; +} +export const QueryCurrentWeightByGroupGaugeIDRequest = { + typeUrl: "/osmosis.incentives.QueryCurrentWeightByGroupGaugeIDRequest", + encode(message: QueryCurrentWeightByGroupGaugeIDRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.groupGaugeId !== BigInt(0)) { + writer.uint32(8).uint64(message.groupGaugeId); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryCurrentWeightByGroupGaugeIDRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryCurrentWeightByGroupGaugeIDRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.groupGaugeId = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryCurrentWeightByGroupGaugeIDRequest { + const message = createBaseQueryCurrentWeightByGroupGaugeIDRequest(); + message.groupGaugeId = object.groupGaugeId !== undefined && object.groupGaugeId !== null ? BigInt(object.groupGaugeId.toString()) : BigInt(0); + return message; + }, + fromAmino(object: QueryCurrentWeightByGroupGaugeIDRequestAmino): QueryCurrentWeightByGroupGaugeIDRequest { + const message = createBaseQueryCurrentWeightByGroupGaugeIDRequest(); + if (object.group_gauge_id !== undefined && object.group_gauge_id !== null) { + message.groupGaugeId = BigInt(object.group_gauge_id); + } + return message; + }, + toAmino(message: QueryCurrentWeightByGroupGaugeIDRequest): QueryCurrentWeightByGroupGaugeIDRequestAmino { + const obj: any = {}; + obj.group_gauge_id = message.groupGaugeId ? message.groupGaugeId.toString() : undefined; + return obj; + }, + fromAminoMsg(object: QueryCurrentWeightByGroupGaugeIDRequestAminoMsg): QueryCurrentWeightByGroupGaugeIDRequest { + return QueryCurrentWeightByGroupGaugeIDRequest.fromAmino(object.value); + }, + toAminoMsg(message: QueryCurrentWeightByGroupGaugeIDRequest): QueryCurrentWeightByGroupGaugeIDRequestAminoMsg { + return { + type: "osmosis/incentives/query-current-weight-by-group-gauge-id-request", + value: QueryCurrentWeightByGroupGaugeIDRequest.toAmino(message) + }; + }, + fromProtoMsg(message: QueryCurrentWeightByGroupGaugeIDRequestProtoMsg): QueryCurrentWeightByGroupGaugeIDRequest { + return QueryCurrentWeightByGroupGaugeIDRequest.decode(message.value); + }, + toProto(message: QueryCurrentWeightByGroupGaugeIDRequest): Uint8Array { + return QueryCurrentWeightByGroupGaugeIDRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryCurrentWeightByGroupGaugeIDRequest): QueryCurrentWeightByGroupGaugeIDRequestProtoMsg { + return { + typeUrl: "/osmosis.incentives.QueryCurrentWeightByGroupGaugeIDRequest", + value: QueryCurrentWeightByGroupGaugeIDRequest.encode(message).finish() + }; + } +}; +function createBaseQueryCurrentWeightByGroupGaugeIDResponse(): QueryCurrentWeightByGroupGaugeIDResponse { + return { + gaugeWeight: [] + }; +} +export const QueryCurrentWeightByGroupGaugeIDResponse = { + typeUrl: "/osmosis.incentives.QueryCurrentWeightByGroupGaugeIDResponse", + encode(message: QueryCurrentWeightByGroupGaugeIDResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.gaugeWeight) { + GaugeWeight.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryCurrentWeightByGroupGaugeIDResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryCurrentWeightByGroupGaugeIDResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.gaugeWeight.push(GaugeWeight.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryCurrentWeightByGroupGaugeIDResponse { + const message = createBaseQueryCurrentWeightByGroupGaugeIDResponse(); + message.gaugeWeight = object.gaugeWeight?.map(e => GaugeWeight.fromPartial(e)) || []; + return message; + }, + fromAmino(object: QueryCurrentWeightByGroupGaugeIDResponseAmino): QueryCurrentWeightByGroupGaugeIDResponse { + const message = createBaseQueryCurrentWeightByGroupGaugeIDResponse(); + message.gaugeWeight = object.gauge_weight?.map(e => GaugeWeight.fromAmino(e)) || []; + return message; + }, + toAmino(message: QueryCurrentWeightByGroupGaugeIDResponse): QueryCurrentWeightByGroupGaugeIDResponseAmino { + const obj: any = {}; + if (message.gaugeWeight) { + obj.gauge_weight = message.gaugeWeight.map(e => e ? GaugeWeight.toAmino(e) : undefined); + } else { + obj.gauge_weight = []; + } + return obj; + }, + fromAminoMsg(object: QueryCurrentWeightByGroupGaugeIDResponseAminoMsg): QueryCurrentWeightByGroupGaugeIDResponse { + return QueryCurrentWeightByGroupGaugeIDResponse.fromAmino(object.value); + }, + toAminoMsg(message: QueryCurrentWeightByGroupGaugeIDResponse): QueryCurrentWeightByGroupGaugeIDResponseAminoMsg { + return { + type: "osmosis/incentives/query-current-weight-by-group-gauge-id-response", + value: QueryCurrentWeightByGroupGaugeIDResponse.toAmino(message) + }; + }, + fromProtoMsg(message: QueryCurrentWeightByGroupGaugeIDResponseProtoMsg): QueryCurrentWeightByGroupGaugeIDResponse { + return QueryCurrentWeightByGroupGaugeIDResponse.decode(message.value); + }, + toProto(message: QueryCurrentWeightByGroupGaugeIDResponse): Uint8Array { + return QueryCurrentWeightByGroupGaugeIDResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryCurrentWeightByGroupGaugeIDResponse): QueryCurrentWeightByGroupGaugeIDResponseProtoMsg { + return { + typeUrl: "/osmosis.incentives.QueryCurrentWeightByGroupGaugeIDResponse", + value: QueryCurrentWeightByGroupGaugeIDResponse.encode(message).finish() + }; + } +}; +function createBaseGaugeWeight(): GaugeWeight { + return { + gaugeId: BigInt(0), + weightRatio: "" + }; +} +export const GaugeWeight = { + typeUrl: "/osmosis.incentives.GaugeWeight", + encode(message: GaugeWeight, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.gaugeId !== BigInt(0)) { + writer.uint32(8).uint64(message.gaugeId); + } + if (message.weightRatio !== "") { + writer.uint32(18).string(Decimal.fromUserInput(message.weightRatio, 18).atomics); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): GaugeWeight { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGaugeWeight(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.gaugeId = reader.uint64(); + break; + case 2: + message.weightRatio = Decimal.fromAtomics(reader.string(), 18).toString(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): GaugeWeight { + const message = createBaseGaugeWeight(); + message.gaugeId = object.gaugeId !== undefined && object.gaugeId !== null ? BigInt(object.gaugeId.toString()) : BigInt(0); + message.weightRatio = object.weightRatio ?? ""; + return message; + }, + fromAmino(object: GaugeWeightAmino): GaugeWeight { + const message = createBaseGaugeWeight(); + if (object.gauge_id !== undefined && object.gauge_id !== null) { + message.gaugeId = BigInt(object.gauge_id); + } + if (object.weight_ratio !== undefined && object.weight_ratio !== null) { + message.weightRatio = object.weight_ratio; + } + return message; + }, + toAmino(message: GaugeWeight): GaugeWeightAmino { + const obj: any = {}; + obj.gauge_id = message.gaugeId ? message.gaugeId.toString() : undefined; + obj.weight_ratio = message.weightRatio; + return obj; + }, + fromAminoMsg(object: GaugeWeightAminoMsg): GaugeWeight { + return GaugeWeight.fromAmino(object.value); + }, + toAminoMsg(message: GaugeWeight): GaugeWeightAminoMsg { + return { + type: "osmosis/incentives/gauge-weight", + value: GaugeWeight.toAmino(message) + }; + }, + fromProtoMsg(message: GaugeWeightProtoMsg): GaugeWeight { + return GaugeWeight.decode(message.value); + }, + toProto(message: GaugeWeight): Uint8Array { + return GaugeWeight.encode(message).finish(); + }, + toProtoMsg(message: GaugeWeight): GaugeWeightProtoMsg { + return { + typeUrl: "/osmosis.incentives.GaugeWeight", + value: GaugeWeight.encode(message).finish() + }; + } }; \ No newline at end of file diff --git a/packages/osmo-query/src/codegen/osmosis/incentives/tx.amino.ts b/packages/osmo-query/src/codegen/osmosis/incentives/tx.amino.ts index 31f1d9251..acf62c240 100644 --- a/packages/osmo-query/src/codegen/osmosis/incentives/tx.amino.ts +++ b/packages/osmo-query/src/codegen/osmosis/incentives/tx.amino.ts @@ -1,5 +1,5 @@ //@ts-nocheck -import { MsgCreateGauge, MsgAddToGauge } from "./tx"; +import { MsgCreateGauge, MsgAddToGauge, MsgCreateGroup } from "./tx"; export const AminoConverter = { "/osmosis.incentives.MsgCreateGauge": { aminoType: "osmosis/incentives/create-gauge", @@ -10,5 +10,10 @@ export const AminoConverter = { aminoType: "osmosis/incentives/add-to-gauge", toAmino: MsgAddToGauge.toAmino, fromAmino: MsgAddToGauge.fromAmino + }, + "/osmosis.incentives.MsgCreateGroup": { + aminoType: "osmosis/incentives/create-group", + toAmino: MsgCreateGroup.toAmino, + fromAmino: MsgCreateGroup.fromAmino } }; \ No newline at end of file diff --git a/packages/osmo-query/src/codegen/osmosis/incentives/tx.registry.ts b/packages/osmo-query/src/codegen/osmosis/incentives/tx.registry.ts index af48a3f01..4a440fa33 100644 --- a/packages/osmo-query/src/codegen/osmosis/incentives/tx.registry.ts +++ b/packages/osmo-query/src/codegen/osmosis/incentives/tx.registry.ts @@ -1,7 +1,7 @@ //@ts-nocheck import { GeneratedType, Registry } from "@cosmjs/proto-signing"; -import { MsgCreateGauge, MsgAddToGauge } from "./tx"; -export const registry: ReadonlyArray<[string, GeneratedType]> = [["/osmosis.incentives.MsgCreateGauge", MsgCreateGauge], ["/osmosis.incentives.MsgAddToGauge", MsgAddToGauge]]; +import { MsgCreateGauge, MsgAddToGauge, MsgCreateGroup } from "./tx"; +export const registry: ReadonlyArray<[string, GeneratedType]> = [["/osmosis.incentives.MsgCreateGauge", MsgCreateGauge], ["/osmosis.incentives.MsgAddToGauge", MsgAddToGauge], ["/osmosis.incentives.MsgCreateGroup", MsgCreateGroup]]; export const load = (protoRegistry: Registry) => { registry.forEach(([typeUrl, mod]) => { protoRegistry.register(typeUrl, mod); @@ -20,6 +20,12 @@ export const MessageComposer = { typeUrl: "/osmosis.incentives.MsgAddToGauge", value: MsgAddToGauge.encode(value).finish() }; + }, + createGroup(value: MsgCreateGroup) { + return { + typeUrl: "/osmosis.incentives.MsgCreateGroup", + value: MsgCreateGroup.encode(value).finish() + }; } }, withTypeUrl: { @@ -34,6 +40,12 @@ export const MessageComposer = { typeUrl: "/osmosis.incentives.MsgAddToGauge", value }; + }, + createGroup(value: MsgCreateGroup) { + return { + typeUrl: "/osmosis.incentives.MsgCreateGroup", + value + }; } }, fromPartial: { @@ -48,6 +60,12 @@ export const MessageComposer = { typeUrl: "/osmosis.incentives.MsgAddToGauge", value: MsgAddToGauge.fromPartial(value) }; + }, + createGroup(value: MsgCreateGroup) { + return { + typeUrl: "/osmosis.incentives.MsgCreateGroup", + value: MsgCreateGroup.fromPartial(value) + }; } } }; \ No newline at end of file diff --git a/packages/osmo-query/src/codegen/osmosis/incentives/tx.rpc.msg.ts b/packages/osmo-query/src/codegen/osmosis/incentives/tx.rpc.msg.ts index ccc8532f0..83000ab1c 100644 --- a/packages/osmo-query/src/codegen/osmosis/incentives/tx.rpc.msg.ts +++ b/packages/osmo-query/src/codegen/osmosis/incentives/tx.rpc.msg.ts @@ -1,9 +1,10 @@ import { Rpc } from "../../helpers"; import { BinaryReader } from "../../binary"; -import { MsgCreateGauge, MsgCreateGaugeResponse, MsgAddToGauge, MsgAddToGaugeResponse } from "./tx"; +import { MsgCreateGauge, MsgCreateGaugeResponse, MsgAddToGauge, MsgAddToGaugeResponse, MsgCreateGroup, MsgCreateGroupResponse } from "./tx"; export interface Msg { createGauge(request: MsgCreateGauge): Promise; addToGauge(request: MsgAddToGauge): Promise; + createGroup(request: MsgCreateGroup): Promise; } export class MsgClientImpl implements Msg { private readonly rpc: Rpc; @@ -11,6 +12,7 @@ export class MsgClientImpl implements Msg { this.rpc = rpc; this.createGauge = this.createGauge.bind(this); this.addToGauge = this.addToGauge.bind(this); + this.createGroup = this.createGroup.bind(this); } createGauge(request: MsgCreateGauge): Promise { const data = MsgCreateGauge.encode(request).finish(); @@ -22,4 +24,9 @@ export class MsgClientImpl implements Msg { const promise = this.rpc.request("osmosis.incentives.Msg", "AddToGauge", data); return promise.then(data => MsgAddToGaugeResponse.decode(new BinaryReader(data))); } + createGroup(request: MsgCreateGroup): Promise { + const data = MsgCreateGroup.encode(request).finish(); + const promise = this.rpc.request("osmosis.incentives.Msg", "CreateGroup", data); + return promise.then(data => MsgCreateGroupResponse.decode(new BinaryReader(data))); + } } \ No newline at end of file diff --git a/packages/osmo-query/src/codegen/osmosis/incentives/tx.ts b/packages/osmo-query/src/codegen/osmosis/incentives/tx.ts index 947eb5513..fbe5b1521 100644 --- a/packages/osmo-query/src/codegen/osmosis/incentives/tx.ts +++ b/packages/osmo-query/src/codegen/osmosis/incentives/tx.ts @@ -53,23 +53,23 @@ export interface MsgCreateGaugeAmino { * at a single time and only distribute their tokens again once the gauge is * refilled */ - is_perpetual: boolean; + is_perpetual?: boolean; /** owner is the address of gauge creator */ - owner: string; + owner?: string; /** * distribute_to show which lock the gauge should distribute to by time * duration or by timestamp */ distribute_to?: QueryConditionAmino; /** coins are coin(s) to be distributed by the gauge */ - coins: CoinAmino[]; + coins?: CoinAmino[]; /** start_time is the distribution start time */ - start_time?: Date; + start_time?: string; /** * num_epochs_paid_over is the number of epochs distribution will be completed * over */ - num_epochs_paid_over: string; + num_epochs_paid_over?: string; /** * pool_id is the ID of the pool that the gauge is meant to be associated * with. if pool_id is set, then the "QueryCondition.LockQueryType" must be @@ -79,7 +79,7 @@ export interface MsgCreateGaugeAmino { * incentivestypes.NoLockExternalGaugeDenom() so that the gauges * associated with a pool can be queried by this prefix if needed. */ - pool_id: string; + pool_id?: string; } export interface MsgCreateGaugeAminoMsg { type: "osmosis/incentives/create-gauge"; @@ -122,11 +122,11 @@ export interface MsgAddToGaugeProtoMsg { /** MsgAddToGauge adds coins to a previously created gauge */ export interface MsgAddToGaugeAmino { /** owner is the gauge owner's address */ - owner: string; + owner?: string; /** gauge_id is the ID of gauge that rewards are getting added to */ - gauge_id: string; + gauge_id?: string; /** rewards are the coin(s) to add to gauge */ - rewards: CoinAmino[]; + rewards?: CoinAmino[]; } export interface MsgAddToGaugeAminoMsg { type: "osmosis/incentives/add-to-gauge"; @@ -149,6 +149,68 @@ export interface MsgAddToGaugeResponseAminoMsg { value: MsgAddToGaugeResponseAmino; } export interface MsgAddToGaugeResponseSDKType {} +/** MsgCreateGroup creates a group to distribute rewards to a group of pools */ +export interface MsgCreateGroup { + /** coins are the provided coins that the group will distribute */ + coins: Coin[]; + /** + * num_epochs_paid_over is the number of epochs distribution will be completed + * in. 0 means it's perpetual + */ + numEpochsPaidOver: bigint; + /** owner is the group owner's address */ + owner: string; + /** pool_ids are the IDs of pools that the group is comprised of */ + poolIds: bigint[]; +} +export interface MsgCreateGroupProtoMsg { + typeUrl: "/osmosis.incentives.MsgCreateGroup"; + value: Uint8Array; +} +/** MsgCreateGroup creates a group to distribute rewards to a group of pools */ +export interface MsgCreateGroupAmino { + /** coins are the provided coins that the group will distribute */ + coins?: CoinAmino[]; + /** + * num_epochs_paid_over is the number of epochs distribution will be completed + * in. 0 means it's perpetual + */ + num_epochs_paid_over?: string; + /** owner is the group owner's address */ + owner?: string; + /** pool_ids are the IDs of pools that the group is comprised of */ + pool_ids?: string[]; +} +export interface MsgCreateGroupAminoMsg { + type: "osmosis/incentives/create-group"; + value: MsgCreateGroupAmino; +} +/** MsgCreateGroup creates a group to distribute rewards to a group of pools */ +export interface MsgCreateGroupSDKType { + coins: CoinSDKType[]; + num_epochs_paid_over: bigint; + owner: string; + pool_ids: bigint[]; +} +export interface MsgCreateGroupResponse { + /** group_id is the ID of the group that is created from this msg */ + groupId: bigint; +} +export interface MsgCreateGroupResponseProtoMsg { + typeUrl: "/osmosis.incentives.MsgCreateGroupResponse"; + value: Uint8Array; +} +export interface MsgCreateGroupResponseAmino { + /** group_id is the ID of the group that is created from this msg */ + group_id?: string; +} +export interface MsgCreateGroupResponseAminoMsg { + type: "osmosis/incentives/create-group-response"; + value: MsgCreateGroupResponseAmino; +} +export interface MsgCreateGroupResponseSDKType { + group_id: bigint; +} function createBaseMsgCreateGauge(): MsgCreateGauge { return { isPerpetual: false, @@ -233,15 +295,27 @@ export const MsgCreateGauge = { return message; }, fromAmino(object: MsgCreateGaugeAmino): MsgCreateGauge { - return { - isPerpetual: object.is_perpetual, - owner: object.owner, - distributeTo: object?.distribute_to ? QueryCondition.fromAmino(object.distribute_to) : undefined, - coins: Array.isArray(object?.coins) ? object.coins.map((e: any) => Coin.fromAmino(e)) : [], - startTime: object.start_time, - numEpochsPaidOver: BigInt(object.num_epochs_paid_over), - poolId: BigInt(object.pool_id) - }; + const message = createBaseMsgCreateGauge(); + if (object.is_perpetual !== undefined && object.is_perpetual !== null) { + message.isPerpetual = object.is_perpetual; + } + if (object.owner !== undefined && object.owner !== null) { + message.owner = object.owner; + } + if (object.distribute_to !== undefined && object.distribute_to !== null) { + message.distributeTo = QueryCondition.fromAmino(object.distribute_to); + } + message.coins = object.coins?.map(e => Coin.fromAmino(e)) || []; + if (object.start_time !== undefined && object.start_time !== null) { + message.startTime = fromTimestamp(Timestamp.fromAmino(object.start_time)); + } + if (object.num_epochs_paid_over !== undefined && object.num_epochs_paid_over !== null) { + message.numEpochsPaidOver = BigInt(object.num_epochs_paid_over); + } + if (object.pool_id !== undefined && object.pool_id !== null) { + message.poolId = BigInt(object.pool_id); + } + return message; }, toAmino(message: MsgCreateGauge): MsgCreateGaugeAmino { const obj: any = {}; @@ -253,7 +327,7 @@ export const MsgCreateGauge = { } else { obj.coins = []; } - obj.start_time = message.startTime; + obj.start_time = message.startTime ? Timestamp.toAmino(toTimestamp(message.startTime)) : undefined; obj.num_epochs_paid_over = message.numEpochsPaidOver ? message.numEpochsPaidOver.toString() : undefined; obj.pool_id = message.poolId ? message.poolId.toString() : undefined; return obj; @@ -307,7 +381,8 @@ export const MsgCreateGaugeResponse = { return message; }, fromAmino(_: MsgCreateGaugeResponseAmino): MsgCreateGaugeResponse { - return {}; + const message = createBaseMsgCreateGaugeResponse(); + return message; }, toAmino(_: MsgCreateGaugeResponse): MsgCreateGaugeResponseAmino { const obj: any = {}; @@ -387,11 +462,15 @@ export const MsgAddToGauge = { return message; }, fromAmino(object: MsgAddToGaugeAmino): MsgAddToGauge { - return { - owner: object.owner, - gaugeId: BigInt(object.gauge_id), - rewards: Array.isArray(object?.rewards) ? object.rewards.map((e: any) => Coin.fromAmino(e)) : [] - }; + const message = createBaseMsgAddToGauge(); + if (object.owner !== undefined && object.owner !== null) { + message.owner = object.owner; + } + if (object.gauge_id !== undefined && object.gauge_id !== null) { + message.gaugeId = BigInt(object.gauge_id); + } + message.rewards = object.rewards?.map(e => Coin.fromAmino(e)) || []; + return message; }, toAmino(message: MsgAddToGauge): MsgAddToGaugeAmino { const obj: any = {}; @@ -453,7 +532,8 @@ export const MsgAddToGaugeResponse = { return message; }, fromAmino(_: MsgAddToGaugeResponseAmino): MsgAddToGaugeResponse { - return {}; + const message = createBaseMsgAddToGaugeResponse(); + return message; }, toAmino(_: MsgAddToGaugeResponse): MsgAddToGaugeResponseAmino { const obj: any = {}; @@ -480,4 +560,191 @@ export const MsgAddToGaugeResponse = { value: MsgAddToGaugeResponse.encode(message).finish() }; } +}; +function createBaseMsgCreateGroup(): MsgCreateGroup { + return { + coins: [], + numEpochsPaidOver: BigInt(0), + owner: "", + poolIds: [] + }; +} +export const MsgCreateGroup = { + typeUrl: "/osmosis.incentives.MsgCreateGroup", + encode(message: MsgCreateGroup, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.coins) { + Coin.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.numEpochsPaidOver !== BigInt(0)) { + writer.uint32(16).uint64(message.numEpochsPaidOver); + } + if (message.owner !== "") { + writer.uint32(26).string(message.owner); + } + writer.uint32(34).fork(); + for (const v of message.poolIds) { + writer.uint64(v); + } + writer.ldelim(); + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgCreateGroup { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgCreateGroup(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.coins.push(Coin.decode(reader, reader.uint32())); + break; + case 2: + message.numEpochsPaidOver = reader.uint64(); + break; + case 3: + message.owner = reader.string(); + break; + case 4: + if ((tag & 7) === 2) { + const end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) { + message.poolIds.push(reader.uint64()); + } + } else { + message.poolIds.push(reader.uint64()); + } + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgCreateGroup { + const message = createBaseMsgCreateGroup(); + message.coins = object.coins?.map(e => Coin.fromPartial(e)) || []; + message.numEpochsPaidOver = object.numEpochsPaidOver !== undefined && object.numEpochsPaidOver !== null ? BigInt(object.numEpochsPaidOver.toString()) : BigInt(0); + message.owner = object.owner ?? ""; + message.poolIds = object.poolIds?.map(e => BigInt(e.toString())) || []; + return message; + }, + fromAmino(object: MsgCreateGroupAmino): MsgCreateGroup { + const message = createBaseMsgCreateGroup(); + message.coins = object.coins?.map(e => Coin.fromAmino(e)) || []; + if (object.num_epochs_paid_over !== undefined && object.num_epochs_paid_over !== null) { + message.numEpochsPaidOver = BigInt(object.num_epochs_paid_over); + } + if (object.owner !== undefined && object.owner !== null) { + message.owner = object.owner; + } + message.poolIds = object.pool_ids?.map(e => BigInt(e)) || []; + return message; + }, + toAmino(message: MsgCreateGroup): MsgCreateGroupAmino { + const obj: any = {}; + if (message.coins) { + obj.coins = message.coins.map(e => e ? Coin.toAmino(e) : undefined); + } else { + obj.coins = []; + } + obj.num_epochs_paid_over = message.numEpochsPaidOver ? message.numEpochsPaidOver.toString() : undefined; + obj.owner = message.owner; + if (message.poolIds) { + obj.pool_ids = message.poolIds.map(e => e.toString()); + } else { + obj.pool_ids = []; + } + return obj; + }, + fromAminoMsg(object: MsgCreateGroupAminoMsg): MsgCreateGroup { + return MsgCreateGroup.fromAmino(object.value); + }, + toAminoMsg(message: MsgCreateGroup): MsgCreateGroupAminoMsg { + return { + type: "osmosis/incentives/create-group", + value: MsgCreateGroup.toAmino(message) + }; + }, + fromProtoMsg(message: MsgCreateGroupProtoMsg): MsgCreateGroup { + return MsgCreateGroup.decode(message.value); + }, + toProto(message: MsgCreateGroup): Uint8Array { + return MsgCreateGroup.encode(message).finish(); + }, + toProtoMsg(message: MsgCreateGroup): MsgCreateGroupProtoMsg { + return { + typeUrl: "/osmosis.incentives.MsgCreateGroup", + value: MsgCreateGroup.encode(message).finish() + }; + } +}; +function createBaseMsgCreateGroupResponse(): MsgCreateGroupResponse { + return { + groupId: BigInt(0) + }; +} +export const MsgCreateGroupResponse = { + typeUrl: "/osmosis.incentives.MsgCreateGroupResponse", + encode(message: MsgCreateGroupResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.groupId !== BigInt(0)) { + writer.uint32(8).uint64(message.groupId); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgCreateGroupResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgCreateGroupResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.groupId = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgCreateGroupResponse { + const message = createBaseMsgCreateGroupResponse(); + message.groupId = object.groupId !== undefined && object.groupId !== null ? BigInt(object.groupId.toString()) : BigInt(0); + return message; + }, + fromAmino(object: MsgCreateGroupResponseAmino): MsgCreateGroupResponse { + const message = createBaseMsgCreateGroupResponse(); + if (object.group_id !== undefined && object.group_id !== null) { + message.groupId = BigInt(object.group_id); + } + return message; + }, + toAmino(message: MsgCreateGroupResponse): MsgCreateGroupResponseAmino { + const obj: any = {}; + obj.group_id = message.groupId ? message.groupId.toString() : undefined; + return obj; + }, + fromAminoMsg(object: MsgCreateGroupResponseAminoMsg): MsgCreateGroupResponse { + return MsgCreateGroupResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgCreateGroupResponse): MsgCreateGroupResponseAminoMsg { + return { + type: "osmosis/incentives/create-group-response", + value: MsgCreateGroupResponse.toAmino(message) + }; + }, + fromProtoMsg(message: MsgCreateGroupResponseProtoMsg): MsgCreateGroupResponse { + return MsgCreateGroupResponse.decode(message.value); + }, + toProto(message: MsgCreateGroupResponse): Uint8Array { + return MsgCreateGroupResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgCreateGroupResponse): MsgCreateGroupResponseProtoMsg { + return { + typeUrl: "/osmosis.incentives.MsgCreateGroupResponse", + value: MsgCreateGroupResponse.encode(message).finish() + }; + } }; \ No newline at end of file diff --git a/packages/osmo-query/src/codegen/osmosis/lcd.ts b/packages/osmo-query/src/codegen/osmosis/lcd.ts index cb05bd9da..22e193954 100644 --- a/packages/osmo-query/src/codegen/osmosis/lcd.ts +++ b/packages/osmo-query/src/codegen/osmosis/lcd.ts @@ -31,6 +31,11 @@ export const createLCDClient = async ({ }) } }, + consensus: { + v1: new (await import("../cosmos/consensus/v1/query.lcd")).LCDQueryClient({ + requestClient + }) + }, distribution: { v1beta1: new (await import("../cosmos/distribution/v1beta1/query.lcd")).LCDQueryClient({ requestClient @@ -59,7 +64,7 @@ export const createLCDClient = async ({ }, osmosis: { concentratedliquidity: { - v1beta1: new (await import("./concentrated-liquidity/query.lcd")).LCDQueryClient({ + v1beta1: new (await import("./concentratedliquidity/v1beta1/query.lcd")).LCDQueryClient({ requestClient }) }, @@ -69,12 +74,12 @@ export const createLCDClient = async ({ }) }, downtimedetector: { - v1beta1: new (await import("./downtime-detector/v1beta1/query.lcd")).LCDQueryClient({ + v1beta1: new (await import("./downtimedetector/v1beta1/query.lcd")).LCDQueryClient({ requestClient }) }, epochs: { - v1beta1: new (await import("./epochs/query.lcd")).LCDQueryClient({ + v1beta1: new (await import("./epochs/v1beta1/query.lcd")).LCDQueryClient({ requestClient }) }, @@ -87,7 +92,7 @@ export const createLCDClient = async ({ }) }, ibcratelimit: { - v1beta1: new (await import("./ibc-rate-limit/v1beta1/query.lcd")).LCDQueryClient({ + v1beta1: new (await import("./ibcratelimit/v1beta1/query.lcd")).LCDQueryClient({ requestClient }) }, @@ -103,13 +108,16 @@ export const createLCDClient = async ({ }) }, poolincentives: { - v1beta1: new (await import("./pool-incentives/v1beta1/query.lcd")).LCDQueryClient({ + v1beta1: new (await import("./poolincentives/v1beta1/query.lcd")).LCDQueryClient({ requestClient }) }, poolmanager: { v1beta1: new (await import("./poolmanager/v1beta1/query.lcd")).LCDQueryClient({ requestClient + }), + v2: new (await import("./poolmanager/v2/query.lcd")).LCDQueryClient({ + requestClient }) }, protorev: { @@ -136,7 +144,7 @@ export const createLCDClient = async ({ }) }, valsetpref: { - v1beta1: new (await import("./valset-pref/v1beta1/query.lcd")).LCDQueryClient({ + v1beta1: new (await import("./valsetpref/v1beta1/query.lcd")).LCDQueryClient({ requestClient }) } diff --git a/packages/osmo-query/src/codegen/osmosis/lockup/genesis.ts b/packages/osmo-query/src/codegen/osmosis/lockup/genesis.ts index 408dbdff5..27cd00653 100644 --- a/packages/osmo-query/src/codegen/osmosis/lockup/genesis.ts +++ b/packages/osmo-query/src/codegen/osmosis/lockup/genesis.ts @@ -1,10 +1,12 @@ import { PeriodLock, PeriodLockAmino, PeriodLockSDKType, SyntheticLock, SyntheticLockAmino, SyntheticLockSDKType } from "./lock"; +import { Params, ParamsAmino, ParamsSDKType } from "./params"; import { BinaryReader, BinaryWriter } from "../../binary"; /** GenesisState defines the lockup module's genesis state. */ export interface GenesisState { lastLockId: bigint; locks: PeriodLock[]; syntheticLocks: SyntheticLock[]; + params?: Params; } export interface GenesisStateProtoMsg { typeUrl: "/osmosis.lockup.GenesisState"; @@ -12,9 +14,10 @@ export interface GenesisStateProtoMsg { } /** GenesisState defines the lockup module's genesis state. */ export interface GenesisStateAmino { - last_lock_id: string; - locks: PeriodLockAmino[]; - synthetic_locks: SyntheticLockAmino[]; + last_lock_id?: string; + locks?: PeriodLockAmino[]; + synthetic_locks?: SyntheticLockAmino[]; + params?: ParamsAmino; } export interface GenesisStateAminoMsg { type: "osmosis/lockup/genesis-state"; @@ -25,12 +28,14 @@ export interface GenesisStateSDKType { last_lock_id: bigint; locks: PeriodLockSDKType[]; synthetic_locks: SyntheticLockSDKType[]; + params?: ParamsSDKType; } function createBaseGenesisState(): GenesisState { return { lastLockId: BigInt(0), locks: [], - syntheticLocks: [] + syntheticLocks: [], + params: undefined }; } export const GenesisState = { @@ -45,6 +50,9 @@ export const GenesisState = { for (const v of message.syntheticLocks) { SyntheticLock.encode(v!, writer.uint32(26).fork()).ldelim(); } + if (message.params !== undefined) { + Params.encode(message.params, writer.uint32(34).fork()).ldelim(); + } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): GenesisState { @@ -63,6 +71,9 @@ export const GenesisState = { case 3: message.syntheticLocks.push(SyntheticLock.decode(reader, reader.uint32())); break; + case 4: + message.params = Params.decode(reader, reader.uint32()); + break; default: reader.skipType(tag & 7); break; @@ -75,14 +86,20 @@ export const GenesisState = { message.lastLockId = object.lastLockId !== undefined && object.lastLockId !== null ? BigInt(object.lastLockId.toString()) : BigInt(0); message.locks = object.locks?.map(e => PeriodLock.fromPartial(e)) || []; message.syntheticLocks = object.syntheticLocks?.map(e => SyntheticLock.fromPartial(e)) || []; + message.params = object.params !== undefined && object.params !== null ? Params.fromPartial(object.params) : undefined; return message; }, fromAmino(object: GenesisStateAmino): GenesisState { - return { - lastLockId: BigInt(object.last_lock_id), - locks: Array.isArray(object?.locks) ? object.locks.map((e: any) => PeriodLock.fromAmino(e)) : [], - syntheticLocks: Array.isArray(object?.synthetic_locks) ? object.synthetic_locks.map((e: any) => SyntheticLock.fromAmino(e)) : [] - }; + const message = createBaseGenesisState(); + if (object.last_lock_id !== undefined && object.last_lock_id !== null) { + message.lastLockId = BigInt(object.last_lock_id); + } + message.locks = object.locks?.map(e => PeriodLock.fromAmino(e)) || []; + message.syntheticLocks = object.synthetic_locks?.map(e => SyntheticLock.fromAmino(e)) || []; + if (object.params !== undefined && object.params !== null) { + message.params = Params.fromAmino(object.params); + } + return message; }, toAmino(message: GenesisState): GenesisStateAmino { const obj: any = {}; @@ -97,6 +114,7 @@ export const GenesisState = { } else { obj.synthetic_locks = []; } + obj.params = message.params ? Params.toAmino(message.params) : undefined; return obj; }, fromAminoMsg(object: GenesisStateAminoMsg): GenesisState { diff --git a/packages/osmo-query/src/codegen/osmosis/lockup/lock.ts b/packages/osmo-query/src/codegen/osmosis/lockup/lock.ts index d9dddbdd9..30713a639 100644 --- a/packages/osmo-query/src/codegen/osmosis/lockup/lock.ts +++ b/packages/osmo-query/src/codegen/osmosis/lockup/lock.ts @@ -2,7 +2,7 @@ import { Duration, DurationAmino, DurationSDKType } from "../../google/protobuf/ import { Timestamp } from "../../google/protobuf/timestamp"; import { Coin, CoinAmino, CoinSDKType } from "../../cosmos/base/v1beta1/coin"; import { BinaryReader, BinaryWriter } from "../../binary"; -import { toTimestamp, fromTimestamp, isSet } from "../../helpers"; +import { toTimestamp, fromTimestamp } from "../../helpers"; /** * LockQueryType defines the type of the lock query that can * either be by duration or start time of the lock. @@ -11,6 +11,7 @@ export enum LockQueryType { ByDuration = 0, ByTime = 1, NoLock = 2, + ByGroup = 3, UNRECOGNIZED = -1, } export const LockQueryTypeSDKType = LockQueryType; @@ -26,6 +27,9 @@ export function lockQueryTypeFromJSON(object: any): LockQueryType { case 2: case "NoLock": return LockQueryType.NoLock; + case 3: + case "ByGroup": + return LockQueryType.ByGroup; case -1: case "UNRECOGNIZED": default: @@ -40,6 +44,8 @@ export function lockQueryTypeToJSON(object: LockQueryType): string { return "ByTime"; case LockQueryType.NoLock: return "NoLock"; + case LockQueryType.ByGroup: + return "ByGroup"; case LockQueryType.UNRECOGNIZED: default: return "UNRECOGNIZED"; @@ -101,12 +107,12 @@ export interface PeriodLockAmino { * The ID of the lock is decided upon lock creation, incrementing by 1 for * every lock. */ - ID: string; + ID?: string; /** * Owner is the account address of the lock owner. * Only the owner can modify the state of the lock. */ - owner: string; + owner?: string; /** * Duration is the time needed for a lock to mature after unlocking has * started. @@ -117,15 +123,15 @@ export interface PeriodLockAmino { * This value is first initialized when an unlock has started for the lock, * end time being block time + duration. */ - end_time?: Date; + end_time?: string; /** Coins are the tokens locked within the lock, kept in the module account. */ - coins: CoinAmino[]; + coins?: CoinAmino[]; /** * Reward Receiver Address is the address that would be receiving rewards for * the incentives for the lock. This is set to owner by default and can be * changed via separate msg. */ - reward_receiver_address: string; + reward_receiver_address?: string; } export interface PeriodLockAminoMsg { type: "osmosis/lockup/period-lock"; @@ -180,9 +186,9 @@ export interface QueryConditionProtoMsg { */ export interface QueryConditionAmino { /** LockQueryType is a type of lock query, ByLockDuration | ByLockTime */ - lock_query_type: LockQueryType; + lock_query_type?: LockQueryType; /** Denom represents the token denomination we are looking to lock up */ - denom: string; + denom?: string; /** * Duration is used to query locks with longer duration than the specified * duration. Duration field must not be nil when the lock query type is @@ -194,7 +200,7 @@ export interface QueryConditionAmino { * Timestamp field must not be nil when the lock query type is `ByLockTime`. * Querying locks with timestamp is currently not implemented. */ - timestamp?: Date; + timestamp?: string; } export interface QueryConditionAminoMsg { type: "osmosis/lockup/query-condition"; @@ -254,17 +260,17 @@ export interface SyntheticLockAmino { * Underlying Lock ID is the underlying native lock's id for this synthetic * lockup. A synthetic lock MUST have an underlying lock. */ - underlying_lock_id: string; + underlying_lock_id?: string; /** * SynthDenom is the synthetic denom that is a combination of * gamm share + bonding status + validator address. */ - synth_denom: string; + synth_denom?: string; /** * used for unbonding synthetic lockups, for active synthetic lockups, this * value is set to uninitialized value */ - end_time?: Date; + end_time?: string; /** * Duration is the duration for a synthetic lock to mature * at the point of unbonding has started. @@ -363,21 +369,31 @@ export const PeriodLock = { return message; }, fromAmino(object: PeriodLockAmino): PeriodLock { - return { - ID: BigInt(object.ID), - owner: object.owner, - duration: object?.duration ? Duration.fromAmino(object.duration) : undefined, - endTime: object.end_time, - coins: Array.isArray(object?.coins) ? object.coins.map((e: any) => Coin.fromAmino(e)) : [], - rewardReceiverAddress: object.reward_receiver_address - }; + const message = createBasePeriodLock(); + if (object.ID !== undefined && object.ID !== null) { + message.ID = BigInt(object.ID); + } + if (object.owner !== undefined && object.owner !== null) { + message.owner = object.owner; + } + if (object.duration !== undefined && object.duration !== null) { + message.duration = Duration.fromAmino(object.duration); + } + if (object.end_time !== undefined && object.end_time !== null) { + message.endTime = fromTimestamp(Timestamp.fromAmino(object.end_time)); + } + message.coins = object.coins?.map(e => Coin.fromAmino(e)) || []; + if (object.reward_receiver_address !== undefined && object.reward_receiver_address !== null) { + message.rewardReceiverAddress = object.reward_receiver_address; + } + return message; }, toAmino(message: PeriodLock): PeriodLockAmino { const obj: any = {}; obj.ID = message.ID ? message.ID.toString() : undefined; obj.owner = message.owner; obj.duration = message.duration ? Duration.toAmino(message.duration) : undefined; - obj.end_time = message.endTime; + obj.end_time = message.endTime ? Timestamp.toAmino(toTimestamp(message.endTime)) : undefined; if (message.coins) { obj.coins = message.coins.map(e => e ? Coin.toAmino(e) : undefined); } else { @@ -468,19 +484,27 @@ export const QueryCondition = { return message; }, fromAmino(object: QueryConditionAmino): QueryCondition { - return { - lockQueryType: isSet(object.lock_query_type) ? lockQueryTypeFromJSON(object.lock_query_type) : -1, - denom: object.denom, - duration: object?.duration ? Duration.fromAmino(object.duration) : undefined, - timestamp: object.timestamp - }; + const message = createBaseQueryCondition(); + if (object.lock_query_type !== undefined && object.lock_query_type !== null) { + message.lockQueryType = lockQueryTypeFromJSON(object.lock_query_type); + } + if (object.denom !== undefined && object.denom !== null) { + message.denom = object.denom; + } + if (object.duration !== undefined && object.duration !== null) { + message.duration = Duration.fromAmino(object.duration); + } + if (object.timestamp !== undefined && object.timestamp !== null) { + message.timestamp = fromTimestamp(Timestamp.fromAmino(object.timestamp)); + } + return message; }, toAmino(message: QueryCondition): QueryConditionAmino { const obj: any = {}; - obj.lock_query_type = message.lockQueryType; + obj.lock_query_type = lockQueryTypeToJSON(message.lockQueryType); obj.denom = message.denom; obj.duration = message.duration ? Duration.toAmino(message.duration) : undefined; - obj.timestamp = message.timestamp; + obj.timestamp = message.timestamp ? Timestamp.toAmino(toTimestamp(message.timestamp)) : undefined; return obj; }, fromAminoMsg(object: QueryConditionAminoMsg): QueryCondition { @@ -565,18 +589,26 @@ export const SyntheticLock = { return message; }, fromAmino(object: SyntheticLockAmino): SyntheticLock { - return { - underlyingLockId: BigInt(object.underlying_lock_id), - synthDenom: object.synth_denom, - endTime: object.end_time, - duration: object?.duration ? Duration.fromAmino(object.duration) : undefined - }; + const message = createBaseSyntheticLock(); + if (object.underlying_lock_id !== undefined && object.underlying_lock_id !== null) { + message.underlyingLockId = BigInt(object.underlying_lock_id); + } + if (object.synth_denom !== undefined && object.synth_denom !== null) { + message.synthDenom = object.synth_denom; + } + if (object.end_time !== undefined && object.end_time !== null) { + message.endTime = fromTimestamp(Timestamp.fromAmino(object.end_time)); + } + if (object.duration !== undefined && object.duration !== null) { + message.duration = Duration.fromAmino(object.duration); + } + return message; }, toAmino(message: SyntheticLock): SyntheticLockAmino { const obj: any = {}; obj.underlying_lock_id = message.underlyingLockId ? message.underlyingLockId.toString() : undefined; obj.synth_denom = message.synthDenom; - obj.end_time = message.endTime; + obj.end_time = message.endTime ? Timestamp.toAmino(toTimestamp(message.endTime)) : undefined; obj.duration = message.duration ? Duration.toAmino(message.duration) : undefined; return obj; }, diff --git a/packages/osmo-query/src/codegen/osmosis/lockup/params.ts b/packages/osmo-query/src/codegen/osmosis/lockup/params.ts index 7348e3e07..efab49dbb 100644 --- a/packages/osmo-query/src/codegen/osmosis/lockup/params.ts +++ b/packages/osmo-query/src/codegen/osmosis/lockup/params.ts @@ -7,7 +7,7 @@ export interface ParamsProtoMsg { value: Uint8Array; } export interface ParamsAmino { - force_unlock_allowed_addresses: string[]; + force_unlock_allowed_addresses?: string[]; } export interface ParamsAminoMsg { type: "osmosis/lockup/params"; @@ -52,9 +52,9 @@ export const Params = { return message; }, fromAmino(object: ParamsAmino): Params { - return { - forceUnlockAllowedAddresses: Array.isArray(object?.force_unlock_allowed_addresses) ? object.force_unlock_allowed_addresses.map((e: any) => e) : [] - }; + const message = createBaseParams(); + message.forceUnlockAllowedAddresses = object.force_unlock_allowed_addresses?.map(e => e) || []; + return message; }, toAmino(message: Params): ParamsAmino { const obj: any = {}; diff --git a/packages/osmo-query/src/codegen/osmosis/lockup/query.ts b/packages/osmo-query/src/codegen/osmosis/lockup/query.ts index 0a3bb1ff5..deb6629fb 100644 --- a/packages/osmo-query/src/codegen/osmosis/lockup/query.ts +++ b/packages/osmo-query/src/codegen/osmosis/lockup/query.ts @@ -24,7 +24,7 @@ export interface ModuleBalanceResponseProtoMsg { value: Uint8Array; } export interface ModuleBalanceResponseAmino { - coins: CoinAmino[]; + coins?: CoinAmino[]; } export interface ModuleBalanceResponseAminoMsg { type: "osmosis/lockup/module-balance-response"; @@ -52,7 +52,7 @@ export interface ModuleLockedAmountResponseProtoMsg { value: Uint8Array; } export interface ModuleLockedAmountResponseAmino { - coins: CoinAmino[]; + coins?: CoinAmino[]; } export interface ModuleLockedAmountResponseAminoMsg { type: "osmosis/lockup/module-locked-amount-response"; @@ -69,7 +69,7 @@ export interface AccountUnlockableCoinsRequestProtoMsg { value: Uint8Array; } export interface AccountUnlockableCoinsRequestAmino { - owner: string; + owner?: string; } export interface AccountUnlockableCoinsRequestAminoMsg { type: "osmosis/lockup/account-unlockable-coins-request"; @@ -86,7 +86,7 @@ export interface AccountUnlockableCoinsResponseProtoMsg { value: Uint8Array; } export interface AccountUnlockableCoinsResponseAmino { - coins: CoinAmino[]; + coins?: CoinAmino[]; } export interface AccountUnlockableCoinsResponseAminoMsg { type: "osmosis/lockup/account-unlockable-coins-response"; @@ -103,7 +103,7 @@ export interface AccountUnlockingCoinsRequestProtoMsg { value: Uint8Array; } export interface AccountUnlockingCoinsRequestAmino { - owner: string; + owner?: string; } export interface AccountUnlockingCoinsRequestAminoMsg { type: "osmosis/lockup/account-unlocking-coins-request"; @@ -120,7 +120,7 @@ export interface AccountUnlockingCoinsResponseProtoMsg { value: Uint8Array; } export interface AccountUnlockingCoinsResponseAmino { - coins: CoinAmino[]; + coins?: CoinAmino[]; } export interface AccountUnlockingCoinsResponseAminoMsg { type: "osmosis/lockup/account-unlocking-coins-response"; @@ -137,7 +137,7 @@ export interface AccountLockedCoinsRequestProtoMsg { value: Uint8Array; } export interface AccountLockedCoinsRequestAmino { - owner: string; + owner?: string; } export interface AccountLockedCoinsRequestAminoMsg { type: "osmosis/lockup/account-locked-coins-request"; @@ -154,7 +154,7 @@ export interface AccountLockedCoinsResponseProtoMsg { value: Uint8Array; } export interface AccountLockedCoinsResponseAmino { - coins: CoinAmino[]; + coins?: CoinAmino[]; } export interface AccountLockedCoinsResponseAminoMsg { type: "osmosis/lockup/account-locked-coins-response"; @@ -172,8 +172,8 @@ export interface AccountLockedPastTimeRequestProtoMsg { value: Uint8Array; } export interface AccountLockedPastTimeRequestAmino { - owner: string; - timestamp?: Date; + owner?: string; + timestamp?: string; } export interface AccountLockedPastTimeRequestAminoMsg { type: "osmosis/lockup/account-locked-past-time-request"; @@ -191,7 +191,7 @@ export interface AccountLockedPastTimeResponseProtoMsg { value: Uint8Array; } export interface AccountLockedPastTimeResponseAmino { - locks: PeriodLockAmino[]; + locks?: PeriodLockAmino[]; } export interface AccountLockedPastTimeResponseAminoMsg { type: "osmosis/lockup/account-locked-past-time-response"; @@ -209,8 +209,8 @@ export interface AccountLockedPastTimeNotUnlockingOnlyRequestProtoMsg { value: Uint8Array; } export interface AccountLockedPastTimeNotUnlockingOnlyRequestAmino { - owner: string; - timestamp?: Date; + owner?: string; + timestamp?: string; } export interface AccountLockedPastTimeNotUnlockingOnlyRequestAminoMsg { type: "osmosis/lockup/account-locked-past-time-not-unlocking-only-request"; @@ -228,7 +228,7 @@ export interface AccountLockedPastTimeNotUnlockingOnlyResponseProtoMsg { value: Uint8Array; } export interface AccountLockedPastTimeNotUnlockingOnlyResponseAmino { - locks: PeriodLockAmino[]; + locks?: PeriodLockAmino[]; } export interface AccountLockedPastTimeNotUnlockingOnlyResponseAminoMsg { type: "osmosis/lockup/account-locked-past-time-not-unlocking-only-response"; @@ -246,8 +246,8 @@ export interface AccountUnlockedBeforeTimeRequestProtoMsg { value: Uint8Array; } export interface AccountUnlockedBeforeTimeRequestAmino { - owner: string; - timestamp?: Date; + owner?: string; + timestamp?: string; } export interface AccountUnlockedBeforeTimeRequestAminoMsg { type: "osmosis/lockup/account-unlocked-before-time-request"; @@ -265,7 +265,7 @@ export interface AccountUnlockedBeforeTimeResponseProtoMsg { value: Uint8Array; } export interface AccountUnlockedBeforeTimeResponseAmino { - locks: PeriodLockAmino[]; + locks?: PeriodLockAmino[]; } export interface AccountUnlockedBeforeTimeResponseAminoMsg { type: "osmosis/lockup/account-unlocked-before-time-response"; @@ -284,9 +284,9 @@ export interface AccountLockedPastTimeDenomRequestProtoMsg { value: Uint8Array; } export interface AccountLockedPastTimeDenomRequestAmino { - owner: string; - timestamp?: Date; - denom: string; + owner?: string; + timestamp?: string; + denom?: string; } export interface AccountLockedPastTimeDenomRequestAminoMsg { type: "osmosis/lockup/account-locked-past-time-denom-request"; @@ -305,7 +305,7 @@ export interface AccountLockedPastTimeDenomResponseProtoMsg { value: Uint8Array; } export interface AccountLockedPastTimeDenomResponseAmino { - locks: PeriodLockAmino[]; + locks?: PeriodLockAmino[]; } export interface AccountLockedPastTimeDenomResponseAminoMsg { type: "osmosis/lockup/account-locked-past-time-denom-response"; @@ -323,7 +323,7 @@ export interface LockedDenomRequestProtoMsg { value: Uint8Array; } export interface LockedDenomRequestAmino { - denom: string; + denom?: string; duration?: DurationAmino; } export interface LockedDenomRequestAminoMsg { @@ -342,7 +342,7 @@ export interface LockedDenomResponseProtoMsg { value: Uint8Array; } export interface LockedDenomResponseAmino { - amount: string; + amount?: string; } export interface LockedDenomResponseAminoMsg { type: "osmosis/lockup/locked-denom-response"; @@ -359,7 +359,7 @@ export interface LockedRequestProtoMsg { value: Uint8Array; } export interface LockedRequestAmino { - lock_id: string; + lock_id?: string; } export interface LockedRequestAminoMsg { type: "osmosis/lockup/locked-request"; @@ -369,7 +369,7 @@ export interface LockedRequestSDKType { lock_id: bigint; } export interface LockedResponse { - lock: PeriodLock; + lock?: PeriodLock; } export interface LockedResponseProtoMsg { typeUrl: "/osmosis.lockup.LockedResponse"; @@ -383,7 +383,7 @@ export interface LockedResponseAminoMsg { value: LockedResponseAmino; } export interface LockedResponseSDKType { - lock: PeriodLockSDKType; + lock?: PeriodLockSDKType; } export interface LockRewardReceiverRequest { lockId: bigint; @@ -393,7 +393,7 @@ export interface LockRewardReceiverRequestProtoMsg { value: Uint8Array; } export interface LockRewardReceiverRequestAmino { - lock_id: string; + lock_id?: string; } export interface LockRewardReceiverRequestAminoMsg { type: "osmosis/lockup/lock-reward-receiver-request"; @@ -410,7 +410,7 @@ export interface LockRewardReceiverResponseProtoMsg { value: Uint8Array; } export interface LockRewardReceiverResponseAmino { - reward_receiver: string; + reward_receiver?: string; } export interface LockRewardReceiverResponseAminoMsg { type: "osmosis/lockup/lock-reward-receiver-response"; @@ -438,7 +438,7 @@ export interface NextLockIDResponseProtoMsg { value: Uint8Array; } export interface NextLockIDResponseAmino { - lock_id: string; + lock_id?: string; } export interface NextLockIDResponseAminoMsg { type: "osmosis/lockup/next-lock-id-response"; @@ -457,7 +457,7 @@ export interface SyntheticLockupsByLockupIDRequestProtoMsg { } /** @deprecated */ export interface SyntheticLockupsByLockupIDRequestAmino { - lock_id: string; + lock_id?: string; } export interface SyntheticLockupsByLockupIDRequestAminoMsg { type: "osmosis/lockup/synthetic-lockups-by-lockup-id-request"; @@ -477,7 +477,7 @@ export interface SyntheticLockupsByLockupIDResponseProtoMsg { } /** @deprecated */ export interface SyntheticLockupsByLockupIDResponseAmino { - synthetic_locks: SyntheticLockAmino[]; + synthetic_locks?: SyntheticLockAmino[]; } export interface SyntheticLockupsByLockupIDResponseAminoMsg { type: "osmosis/lockup/synthetic-lockups-by-lockup-id-response"; @@ -495,7 +495,7 @@ export interface SyntheticLockupByLockupIDRequestProtoMsg { value: Uint8Array; } export interface SyntheticLockupByLockupIDRequestAmino { - lock_id: string; + lock_id?: string; } export interface SyntheticLockupByLockupIDRequestAminoMsg { type: "osmosis/lockup/synthetic-lockup-by-lockup-id-request"; @@ -530,7 +530,7 @@ export interface AccountLockedLongerDurationRequestProtoMsg { value: Uint8Array; } export interface AccountLockedLongerDurationRequestAmino { - owner: string; + owner?: string; duration?: DurationAmino; } export interface AccountLockedLongerDurationRequestAminoMsg { @@ -549,7 +549,7 @@ export interface AccountLockedLongerDurationResponseProtoMsg { value: Uint8Array; } export interface AccountLockedLongerDurationResponseAmino { - locks: PeriodLockAmino[]; + locks?: PeriodLockAmino[]; } export interface AccountLockedLongerDurationResponseAminoMsg { type: "osmosis/lockup/account-locked-longer-duration-response"; @@ -567,7 +567,7 @@ export interface AccountLockedDurationRequestProtoMsg { value: Uint8Array; } export interface AccountLockedDurationRequestAmino { - owner: string; + owner?: string; duration?: DurationAmino; } export interface AccountLockedDurationRequestAminoMsg { @@ -586,7 +586,7 @@ export interface AccountLockedDurationResponseProtoMsg { value: Uint8Array; } export interface AccountLockedDurationResponseAmino { - locks: PeriodLockAmino[]; + locks?: PeriodLockAmino[]; } export interface AccountLockedDurationResponseAminoMsg { type: "osmosis/lockup/account-locked-duration-response"; @@ -604,7 +604,7 @@ export interface AccountLockedLongerDurationNotUnlockingOnlyRequestProtoMsg { value: Uint8Array; } export interface AccountLockedLongerDurationNotUnlockingOnlyRequestAmino { - owner: string; + owner?: string; duration?: DurationAmino; } export interface AccountLockedLongerDurationNotUnlockingOnlyRequestAminoMsg { @@ -623,7 +623,7 @@ export interface AccountLockedLongerDurationNotUnlockingOnlyResponseProtoMsg { value: Uint8Array; } export interface AccountLockedLongerDurationNotUnlockingOnlyResponseAmino { - locks: PeriodLockAmino[]; + locks?: PeriodLockAmino[]; } export interface AccountLockedLongerDurationNotUnlockingOnlyResponseAminoMsg { type: "osmosis/lockup/account-locked-longer-duration-not-unlocking-only-response"; @@ -642,9 +642,9 @@ export interface AccountLockedLongerDurationDenomRequestProtoMsg { value: Uint8Array; } export interface AccountLockedLongerDurationDenomRequestAmino { - owner: string; + owner?: string; duration?: DurationAmino; - denom: string; + denom?: string; } export interface AccountLockedLongerDurationDenomRequestAminoMsg { type: "osmosis/lockup/account-locked-longer-duration-denom-request"; @@ -663,7 +663,7 @@ export interface AccountLockedLongerDurationDenomResponseProtoMsg { value: Uint8Array; } export interface AccountLockedLongerDurationDenomResponseAmino { - locks: PeriodLockAmino[]; + locks?: PeriodLockAmino[]; } export interface AccountLockedLongerDurationDenomResponseAminoMsg { type: "osmosis/lockup/account-locked-longer-duration-denom-response"; @@ -727,7 +727,8 @@ export const ModuleBalanceRequest = { return message; }, fromAmino(_: ModuleBalanceRequestAmino): ModuleBalanceRequest { - return {}; + const message = createBaseModuleBalanceRequest(); + return message; }, toAmino(_: ModuleBalanceRequest): ModuleBalanceRequestAmino { const obj: any = {}; @@ -791,9 +792,9 @@ export const ModuleBalanceResponse = { return message; }, fromAmino(object: ModuleBalanceResponseAmino): ModuleBalanceResponse { - return { - coins: Array.isArray(object?.coins) ? object.coins.map((e: any) => Coin.fromAmino(e)) : [] - }; + const message = createBaseModuleBalanceResponse(); + message.coins = object.coins?.map(e => Coin.fromAmino(e)) || []; + return message; }, toAmino(message: ModuleBalanceResponse): ModuleBalanceResponseAmino { const obj: any = {}; @@ -853,7 +854,8 @@ export const ModuleLockedAmountRequest = { return message; }, fromAmino(_: ModuleLockedAmountRequestAmino): ModuleLockedAmountRequest { - return {}; + const message = createBaseModuleLockedAmountRequest(); + return message; }, toAmino(_: ModuleLockedAmountRequest): ModuleLockedAmountRequestAmino { const obj: any = {}; @@ -917,9 +919,9 @@ export const ModuleLockedAmountResponse = { return message; }, fromAmino(object: ModuleLockedAmountResponseAmino): ModuleLockedAmountResponse { - return { - coins: Array.isArray(object?.coins) ? object.coins.map((e: any) => Coin.fromAmino(e)) : [] - }; + const message = createBaseModuleLockedAmountResponse(); + message.coins = object.coins?.map(e => Coin.fromAmino(e)) || []; + return message; }, toAmino(message: ModuleLockedAmountResponse): ModuleLockedAmountResponseAmino { const obj: any = {}; @@ -988,9 +990,11 @@ export const AccountUnlockableCoinsRequest = { return message; }, fromAmino(object: AccountUnlockableCoinsRequestAmino): AccountUnlockableCoinsRequest { - return { - owner: object.owner - }; + const message = createBaseAccountUnlockableCoinsRequest(); + if (object.owner !== undefined && object.owner !== null) { + message.owner = object.owner; + } + return message; }, toAmino(message: AccountUnlockableCoinsRequest): AccountUnlockableCoinsRequestAmino { const obj: any = {}; @@ -1055,9 +1059,9 @@ export const AccountUnlockableCoinsResponse = { return message; }, fromAmino(object: AccountUnlockableCoinsResponseAmino): AccountUnlockableCoinsResponse { - return { - coins: Array.isArray(object?.coins) ? object.coins.map((e: any) => Coin.fromAmino(e)) : [] - }; + const message = createBaseAccountUnlockableCoinsResponse(); + message.coins = object.coins?.map(e => Coin.fromAmino(e)) || []; + return message; }, toAmino(message: AccountUnlockableCoinsResponse): AccountUnlockableCoinsResponseAmino { const obj: any = {}; @@ -1126,9 +1130,11 @@ export const AccountUnlockingCoinsRequest = { return message; }, fromAmino(object: AccountUnlockingCoinsRequestAmino): AccountUnlockingCoinsRequest { - return { - owner: object.owner - }; + const message = createBaseAccountUnlockingCoinsRequest(); + if (object.owner !== undefined && object.owner !== null) { + message.owner = object.owner; + } + return message; }, toAmino(message: AccountUnlockingCoinsRequest): AccountUnlockingCoinsRequestAmino { const obj: any = {}; @@ -1193,9 +1199,9 @@ export const AccountUnlockingCoinsResponse = { return message; }, fromAmino(object: AccountUnlockingCoinsResponseAmino): AccountUnlockingCoinsResponse { - return { - coins: Array.isArray(object?.coins) ? object.coins.map((e: any) => Coin.fromAmino(e)) : [] - }; + const message = createBaseAccountUnlockingCoinsResponse(); + message.coins = object.coins?.map(e => Coin.fromAmino(e)) || []; + return message; }, toAmino(message: AccountUnlockingCoinsResponse): AccountUnlockingCoinsResponseAmino { const obj: any = {}; @@ -1264,9 +1270,11 @@ export const AccountLockedCoinsRequest = { return message; }, fromAmino(object: AccountLockedCoinsRequestAmino): AccountLockedCoinsRequest { - return { - owner: object.owner - }; + const message = createBaseAccountLockedCoinsRequest(); + if (object.owner !== undefined && object.owner !== null) { + message.owner = object.owner; + } + return message; }, toAmino(message: AccountLockedCoinsRequest): AccountLockedCoinsRequestAmino { const obj: any = {}; @@ -1331,9 +1339,9 @@ export const AccountLockedCoinsResponse = { return message; }, fromAmino(object: AccountLockedCoinsResponseAmino): AccountLockedCoinsResponse { - return { - coins: Array.isArray(object?.coins) ? object.coins.map((e: any) => Coin.fromAmino(e)) : [] - }; + const message = createBaseAccountLockedCoinsResponse(); + message.coins = object.coins?.map(e => Coin.fromAmino(e)) || []; + return message; }, toAmino(message: AccountLockedCoinsResponse): AccountLockedCoinsResponseAmino { const obj: any = {}; @@ -1410,15 +1418,19 @@ export const AccountLockedPastTimeRequest = { return message; }, fromAmino(object: AccountLockedPastTimeRequestAmino): AccountLockedPastTimeRequest { - return { - owner: object.owner, - timestamp: object.timestamp - }; + const message = createBaseAccountLockedPastTimeRequest(); + if (object.owner !== undefined && object.owner !== null) { + message.owner = object.owner; + } + if (object.timestamp !== undefined && object.timestamp !== null) { + message.timestamp = fromTimestamp(Timestamp.fromAmino(object.timestamp)); + } + return message; }, toAmino(message: AccountLockedPastTimeRequest): AccountLockedPastTimeRequestAmino { const obj: any = {}; obj.owner = message.owner; - obj.timestamp = message.timestamp; + obj.timestamp = message.timestamp ? Timestamp.toAmino(toTimestamp(message.timestamp)) : undefined; return obj; }, fromAminoMsg(object: AccountLockedPastTimeRequestAminoMsg): AccountLockedPastTimeRequest { @@ -1479,9 +1491,9 @@ export const AccountLockedPastTimeResponse = { return message; }, fromAmino(object: AccountLockedPastTimeResponseAmino): AccountLockedPastTimeResponse { - return { - locks: Array.isArray(object?.locks) ? object.locks.map((e: any) => PeriodLock.fromAmino(e)) : [] - }; + const message = createBaseAccountLockedPastTimeResponse(); + message.locks = object.locks?.map(e => PeriodLock.fromAmino(e)) || []; + return message; }, toAmino(message: AccountLockedPastTimeResponse): AccountLockedPastTimeResponseAmino { const obj: any = {}; @@ -1558,15 +1570,19 @@ export const AccountLockedPastTimeNotUnlockingOnlyRequest = { return message; }, fromAmino(object: AccountLockedPastTimeNotUnlockingOnlyRequestAmino): AccountLockedPastTimeNotUnlockingOnlyRequest { - return { - owner: object.owner, - timestamp: object.timestamp - }; + const message = createBaseAccountLockedPastTimeNotUnlockingOnlyRequest(); + if (object.owner !== undefined && object.owner !== null) { + message.owner = object.owner; + } + if (object.timestamp !== undefined && object.timestamp !== null) { + message.timestamp = fromTimestamp(Timestamp.fromAmino(object.timestamp)); + } + return message; }, toAmino(message: AccountLockedPastTimeNotUnlockingOnlyRequest): AccountLockedPastTimeNotUnlockingOnlyRequestAmino { const obj: any = {}; obj.owner = message.owner; - obj.timestamp = message.timestamp; + obj.timestamp = message.timestamp ? Timestamp.toAmino(toTimestamp(message.timestamp)) : undefined; return obj; }, fromAminoMsg(object: AccountLockedPastTimeNotUnlockingOnlyRequestAminoMsg): AccountLockedPastTimeNotUnlockingOnlyRequest { @@ -1627,9 +1643,9 @@ export const AccountLockedPastTimeNotUnlockingOnlyResponse = { return message; }, fromAmino(object: AccountLockedPastTimeNotUnlockingOnlyResponseAmino): AccountLockedPastTimeNotUnlockingOnlyResponse { - return { - locks: Array.isArray(object?.locks) ? object.locks.map((e: any) => PeriodLock.fromAmino(e)) : [] - }; + const message = createBaseAccountLockedPastTimeNotUnlockingOnlyResponse(); + message.locks = object.locks?.map(e => PeriodLock.fromAmino(e)) || []; + return message; }, toAmino(message: AccountLockedPastTimeNotUnlockingOnlyResponse): AccountLockedPastTimeNotUnlockingOnlyResponseAmino { const obj: any = {}; @@ -1706,15 +1722,19 @@ export const AccountUnlockedBeforeTimeRequest = { return message; }, fromAmino(object: AccountUnlockedBeforeTimeRequestAmino): AccountUnlockedBeforeTimeRequest { - return { - owner: object.owner, - timestamp: object.timestamp - }; + const message = createBaseAccountUnlockedBeforeTimeRequest(); + if (object.owner !== undefined && object.owner !== null) { + message.owner = object.owner; + } + if (object.timestamp !== undefined && object.timestamp !== null) { + message.timestamp = fromTimestamp(Timestamp.fromAmino(object.timestamp)); + } + return message; }, toAmino(message: AccountUnlockedBeforeTimeRequest): AccountUnlockedBeforeTimeRequestAmino { const obj: any = {}; obj.owner = message.owner; - obj.timestamp = message.timestamp; + obj.timestamp = message.timestamp ? Timestamp.toAmino(toTimestamp(message.timestamp)) : undefined; return obj; }, fromAminoMsg(object: AccountUnlockedBeforeTimeRequestAminoMsg): AccountUnlockedBeforeTimeRequest { @@ -1775,9 +1795,9 @@ export const AccountUnlockedBeforeTimeResponse = { return message; }, fromAmino(object: AccountUnlockedBeforeTimeResponseAmino): AccountUnlockedBeforeTimeResponse { - return { - locks: Array.isArray(object?.locks) ? object.locks.map((e: any) => PeriodLock.fromAmino(e)) : [] - }; + const message = createBaseAccountUnlockedBeforeTimeResponse(); + message.locks = object.locks?.map(e => PeriodLock.fromAmino(e)) || []; + return message; }, toAmino(message: AccountUnlockedBeforeTimeResponse): AccountUnlockedBeforeTimeResponseAmino { const obj: any = {}; @@ -1862,16 +1882,22 @@ export const AccountLockedPastTimeDenomRequest = { return message; }, fromAmino(object: AccountLockedPastTimeDenomRequestAmino): AccountLockedPastTimeDenomRequest { - return { - owner: object.owner, - timestamp: object.timestamp, - denom: object.denom - }; + const message = createBaseAccountLockedPastTimeDenomRequest(); + if (object.owner !== undefined && object.owner !== null) { + message.owner = object.owner; + } + if (object.timestamp !== undefined && object.timestamp !== null) { + message.timestamp = fromTimestamp(Timestamp.fromAmino(object.timestamp)); + } + if (object.denom !== undefined && object.denom !== null) { + message.denom = object.denom; + } + return message; }, toAmino(message: AccountLockedPastTimeDenomRequest): AccountLockedPastTimeDenomRequestAmino { const obj: any = {}; obj.owner = message.owner; - obj.timestamp = message.timestamp; + obj.timestamp = message.timestamp ? Timestamp.toAmino(toTimestamp(message.timestamp)) : undefined; obj.denom = message.denom; return obj; }, @@ -1933,9 +1959,9 @@ export const AccountLockedPastTimeDenomResponse = { return message; }, fromAmino(object: AccountLockedPastTimeDenomResponseAmino): AccountLockedPastTimeDenomResponse { - return { - locks: Array.isArray(object?.locks) ? object.locks.map((e: any) => PeriodLock.fromAmino(e)) : [] - }; + const message = createBaseAccountLockedPastTimeDenomResponse(); + message.locks = object.locks?.map(e => PeriodLock.fromAmino(e)) || []; + return message; }, toAmino(message: AccountLockedPastTimeDenomResponse): AccountLockedPastTimeDenomResponseAmino { const obj: any = {}; @@ -2012,10 +2038,14 @@ export const LockedDenomRequest = { return message; }, fromAmino(object: LockedDenomRequestAmino): LockedDenomRequest { - return { - denom: object.denom, - duration: object?.duration ? Duration.fromAmino(object.duration) : undefined - }; + const message = createBaseLockedDenomRequest(); + if (object.denom !== undefined && object.denom !== null) { + message.denom = object.denom; + } + if (object.duration !== undefined && object.duration !== null) { + message.duration = Duration.fromAmino(object.duration); + } + return message; }, toAmino(message: LockedDenomRequest): LockedDenomRequestAmino { const obj: any = {}; @@ -2081,9 +2111,11 @@ export const LockedDenomResponse = { return message; }, fromAmino(object: LockedDenomResponseAmino): LockedDenomResponse { - return { - amount: object.amount - }; + const message = createBaseLockedDenomResponse(); + if (object.amount !== undefined && object.amount !== null) { + message.amount = object.amount; + } + return message; }, toAmino(message: LockedDenomResponse): LockedDenomResponseAmino { const obj: any = {}; @@ -2148,9 +2180,11 @@ export const LockedRequest = { return message; }, fromAmino(object: LockedRequestAmino): LockedRequest { - return { - lockId: BigInt(object.lock_id) - }; + const message = createBaseLockedRequest(); + if (object.lock_id !== undefined && object.lock_id !== null) { + message.lockId = BigInt(object.lock_id); + } + return message; }, toAmino(message: LockedRequest): LockedRequestAmino { const obj: any = {}; @@ -2181,7 +2215,7 @@ export const LockedRequest = { }; function createBaseLockedResponse(): LockedResponse { return { - lock: PeriodLock.fromPartial({}) + lock: undefined }; } export const LockedResponse = { @@ -2215,9 +2249,11 @@ export const LockedResponse = { return message; }, fromAmino(object: LockedResponseAmino): LockedResponse { - return { - lock: object?.lock ? PeriodLock.fromAmino(object.lock) : undefined - }; + const message = createBaseLockedResponse(); + if (object.lock !== undefined && object.lock !== null) { + message.lock = PeriodLock.fromAmino(object.lock); + } + return message; }, toAmino(message: LockedResponse): LockedResponseAmino { const obj: any = {}; @@ -2282,9 +2318,11 @@ export const LockRewardReceiverRequest = { return message; }, fromAmino(object: LockRewardReceiverRequestAmino): LockRewardReceiverRequest { - return { - lockId: BigInt(object.lock_id) - }; + const message = createBaseLockRewardReceiverRequest(); + if (object.lock_id !== undefined && object.lock_id !== null) { + message.lockId = BigInt(object.lock_id); + } + return message; }, toAmino(message: LockRewardReceiverRequest): LockRewardReceiverRequestAmino { const obj: any = {}; @@ -2349,9 +2387,11 @@ export const LockRewardReceiverResponse = { return message; }, fromAmino(object: LockRewardReceiverResponseAmino): LockRewardReceiverResponse { - return { - rewardReceiver: object.reward_receiver - }; + const message = createBaseLockRewardReceiverResponse(); + if (object.reward_receiver !== undefined && object.reward_receiver !== null) { + message.rewardReceiver = object.reward_receiver; + } + return message; }, toAmino(message: LockRewardReceiverResponse): LockRewardReceiverResponseAmino { const obj: any = {}; @@ -2407,7 +2447,8 @@ export const NextLockIDRequest = { return message; }, fromAmino(_: NextLockIDRequestAmino): NextLockIDRequest { - return {}; + const message = createBaseNextLockIDRequest(); + return message; }, toAmino(_: NextLockIDRequest): NextLockIDRequestAmino { const obj: any = {}; @@ -2471,9 +2512,11 @@ export const NextLockIDResponse = { return message; }, fromAmino(object: NextLockIDResponseAmino): NextLockIDResponse { - return { - lockId: BigInt(object.lock_id) - }; + const message = createBaseNextLockIDResponse(); + if (object.lock_id !== undefined && object.lock_id !== null) { + message.lockId = BigInt(object.lock_id); + } + return message; }, toAmino(message: NextLockIDResponse): NextLockIDResponseAmino { const obj: any = {}; @@ -2538,9 +2581,11 @@ export const SyntheticLockupsByLockupIDRequest = { return message; }, fromAmino(object: SyntheticLockupsByLockupIDRequestAmino): SyntheticLockupsByLockupIDRequest { - return { - lockId: BigInt(object.lock_id) - }; + const message = createBaseSyntheticLockupsByLockupIDRequest(); + if (object.lock_id !== undefined && object.lock_id !== null) { + message.lockId = BigInt(object.lock_id); + } + return message; }, toAmino(message: SyntheticLockupsByLockupIDRequest): SyntheticLockupsByLockupIDRequestAmino { const obj: any = {}; @@ -2605,9 +2650,9 @@ export const SyntheticLockupsByLockupIDResponse = { return message; }, fromAmino(object: SyntheticLockupsByLockupIDResponseAmino): SyntheticLockupsByLockupIDResponse { - return { - syntheticLocks: Array.isArray(object?.synthetic_locks) ? object.synthetic_locks.map((e: any) => SyntheticLock.fromAmino(e)) : [] - }; + const message = createBaseSyntheticLockupsByLockupIDResponse(); + message.syntheticLocks = object.synthetic_locks?.map(e => SyntheticLock.fromAmino(e)) || []; + return message; }, toAmino(message: SyntheticLockupsByLockupIDResponse): SyntheticLockupsByLockupIDResponseAmino { const obj: any = {}; @@ -2676,9 +2721,11 @@ export const SyntheticLockupByLockupIDRequest = { return message; }, fromAmino(object: SyntheticLockupByLockupIDRequestAmino): SyntheticLockupByLockupIDRequest { - return { - lockId: BigInt(object.lock_id) - }; + const message = createBaseSyntheticLockupByLockupIDRequest(); + if (object.lock_id !== undefined && object.lock_id !== null) { + message.lockId = BigInt(object.lock_id); + } + return message; }, toAmino(message: SyntheticLockupByLockupIDRequest): SyntheticLockupByLockupIDRequestAmino { const obj: any = {}; @@ -2743,9 +2790,11 @@ export const SyntheticLockupByLockupIDResponse = { return message; }, fromAmino(object: SyntheticLockupByLockupIDResponseAmino): SyntheticLockupByLockupIDResponse { - return { - syntheticLock: object?.synthetic_lock ? SyntheticLock.fromAmino(object.synthetic_lock) : undefined - }; + const message = createBaseSyntheticLockupByLockupIDResponse(); + if (object.synthetic_lock !== undefined && object.synthetic_lock !== null) { + message.syntheticLock = SyntheticLock.fromAmino(object.synthetic_lock); + } + return message; }, toAmino(message: SyntheticLockupByLockupIDResponse): SyntheticLockupByLockupIDResponseAmino { const obj: any = {}; @@ -2818,10 +2867,14 @@ export const AccountLockedLongerDurationRequest = { return message; }, fromAmino(object: AccountLockedLongerDurationRequestAmino): AccountLockedLongerDurationRequest { - return { - owner: object.owner, - duration: object?.duration ? Duration.fromAmino(object.duration) : undefined - }; + const message = createBaseAccountLockedLongerDurationRequest(); + if (object.owner !== undefined && object.owner !== null) { + message.owner = object.owner; + } + if (object.duration !== undefined && object.duration !== null) { + message.duration = Duration.fromAmino(object.duration); + } + return message; }, toAmino(message: AccountLockedLongerDurationRequest): AccountLockedLongerDurationRequestAmino { const obj: any = {}; @@ -2887,9 +2940,9 @@ export const AccountLockedLongerDurationResponse = { return message; }, fromAmino(object: AccountLockedLongerDurationResponseAmino): AccountLockedLongerDurationResponse { - return { - locks: Array.isArray(object?.locks) ? object.locks.map((e: any) => PeriodLock.fromAmino(e)) : [] - }; + const message = createBaseAccountLockedLongerDurationResponse(); + message.locks = object.locks?.map(e => PeriodLock.fromAmino(e)) || []; + return message; }, toAmino(message: AccountLockedLongerDurationResponse): AccountLockedLongerDurationResponseAmino { const obj: any = {}; @@ -2966,10 +3019,14 @@ export const AccountLockedDurationRequest = { return message; }, fromAmino(object: AccountLockedDurationRequestAmino): AccountLockedDurationRequest { - return { - owner: object.owner, - duration: object?.duration ? Duration.fromAmino(object.duration) : undefined - }; + const message = createBaseAccountLockedDurationRequest(); + if (object.owner !== undefined && object.owner !== null) { + message.owner = object.owner; + } + if (object.duration !== undefined && object.duration !== null) { + message.duration = Duration.fromAmino(object.duration); + } + return message; }, toAmino(message: AccountLockedDurationRequest): AccountLockedDurationRequestAmino { const obj: any = {}; @@ -3035,9 +3092,9 @@ export const AccountLockedDurationResponse = { return message; }, fromAmino(object: AccountLockedDurationResponseAmino): AccountLockedDurationResponse { - return { - locks: Array.isArray(object?.locks) ? object.locks.map((e: any) => PeriodLock.fromAmino(e)) : [] - }; + const message = createBaseAccountLockedDurationResponse(); + message.locks = object.locks?.map(e => PeriodLock.fromAmino(e)) || []; + return message; }, toAmino(message: AccountLockedDurationResponse): AccountLockedDurationResponseAmino { const obj: any = {}; @@ -3114,10 +3171,14 @@ export const AccountLockedLongerDurationNotUnlockingOnlyRequest = { return message; }, fromAmino(object: AccountLockedLongerDurationNotUnlockingOnlyRequestAmino): AccountLockedLongerDurationNotUnlockingOnlyRequest { - return { - owner: object.owner, - duration: object?.duration ? Duration.fromAmino(object.duration) : undefined - }; + const message = createBaseAccountLockedLongerDurationNotUnlockingOnlyRequest(); + if (object.owner !== undefined && object.owner !== null) { + message.owner = object.owner; + } + if (object.duration !== undefined && object.duration !== null) { + message.duration = Duration.fromAmino(object.duration); + } + return message; }, toAmino(message: AccountLockedLongerDurationNotUnlockingOnlyRequest): AccountLockedLongerDurationNotUnlockingOnlyRequestAmino { const obj: any = {}; @@ -3183,9 +3244,9 @@ export const AccountLockedLongerDurationNotUnlockingOnlyResponse = { return message; }, fromAmino(object: AccountLockedLongerDurationNotUnlockingOnlyResponseAmino): AccountLockedLongerDurationNotUnlockingOnlyResponse { - return { - locks: Array.isArray(object?.locks) ? object.locks.map((e: any) => PeriodLock.fromAmino(e)) : [] - }; + const message = createBaseAccountLockedLongerDurationNotUnlockingOnlyResponse(); + message.locks = object.locks?.map(e => PeriodLock.fromAmino(e)) || []; + return message; }, toAmino(message: AccountLockedLongerDurationNotUnlockingOnlyResponse): AccountLockedLongerDurationNotUnlockingOnlyResponseAmino { const obj: any = {}; @@ -3270,11 +3331,17 @@ export const AccountLockedLongerDurationDenomRequest = { return message; }, fromAmino(object: AccountLockedLongerDurationDenomRequestAmino): AccountLockedLongerDurationDenomRequest { - return { - owner: object.owner, - duration: object?.duration ? Duration.fromAmino(object.duration) : undefined, - denom: object.denom - }; + const message = createBaseAccountLockedLongerDurationDenomRequest(); + if (object.owner !== undefined && object.owner !== null) { + message.owner = object.owner; + } + if (object.duration !== undefined && object.duration !== null) { + message.duration = Duration.fromAmino(object.duration); + } + if (object.denom !== undefined && object.denom !== null) { + message.denom = object.denom; + } + return message; }, toAmino(message: AccountLockedLongerDurationDenomRequest): AccountLockedLongerDurationDenomRequestAmino { const obj: any = {}; @@ -3341,9 +3408,9 @@ export const AccountLockedLongerDurationDenomResponse = { return message; }, fromAmino(object: AccountLockedLongerDurationDenomResponseAmino): AccountLockedLongerDurationDenomResponse { - return { - locks: Array.isArray(object?.locks) ? object.locks.map((e: any) => PeriodLock.fromAmino(e)) : [] - }; + const message = createBaseAccountLockedLongerDurationDenomResponse(); + message.locks = object.locks?.map(e => PeriodLock.fromAmino(e)) || []; + return message; }, toAmino(message: AccountLockedLongerDurationDenomResponse): AccountLockedLongerDurationDenomResponseAmino { const obj: any = {}; @@ -3403,7 +3470,8 @@ export const QueryParamsRequest = { return message; }, fromAmino(_: QueryParamsRequestAmino): QueryParamsRequest { - return {}; + const message = createBaseQueryParamsRequest(); + return message; }, toAmino(_: QueryParamsRequest): QueryParamsRequestAmino { const obj: any = {}; @@ -3467,9 +3535,11 @@ export const QueryParamsResponse = { return message; }, fromAmino(object: QueryParamsResponseAmino): QueryParamsResponse { - return { - params: object?.params ? Params.fromAmino(object.params) : undefined - }; + const message = createBaseQueryParamsResponse(); + if (object.params !== undefined && object.params !== null) { + message.params = Params.fromAmino(object.params); + } + return message; }, toAmino(message: QueryParamsResponse): QueryParamsResponseAmino { const obj: any = {}; diff --git a/packages/osmo-query/src/codegen/osmosis/lockup/tx.amino.ts b/packages/osmo-query/src/codegen/osmosis/lockup/tx.amino.ts index 0fa595081..9f98bdf0b 100644 --- a/packages/osmo-query/src/codegen/osmosis/lockup/tx.amino.ts +++ b/packages/osmo-query/src/codegen/osmosis/lockup/tx.amino.ts @@ -22,7 +22,7 @@ export const AminoConverter = { fromAmino: MsgExtendLockup.fromAmino }, "/osmosis.lockup.MsgForceUnlock": { - aminoType: "osmosis/lockup/force-unlock", + aminoType: "osmosis/lockup/force-unlock-tokens", toAmino: MsgForceUnlock.toAmino, fromAmino: MsgForceUnlock.fromAmino }, diff --git a/packages/osmo-query/src/codegen/osmosis/lockup/tx.ts b/packages/osmo-query/src/codegen/osmosis/lockup/tx.ts index 4453ca722..0c7d8f0cc 100644 --- a/packages/osmo-query/src/codegen/osmosis/lockup/tx.ts +++ b/packages/osmo-query/src/codegen/osmosis/lockup/tx.ts @@ -12,9 +12,9 @@ export interface MsgLockTokensProtoMsg { value: Uint8Array; } export interface MsgLockTokensAmino { - owner: string; + owner?: string; duration?: DurationAmino; - coins: CoinAmino[]; + coins?: CoinAmino[]; } export interface MsgLockTokensAminoMsg { type: "osmosis/lockup/lock-tokens"; @@ -33,7 +33,7 @@ export interface MsgLockTokensResponseProtoMsg { value: Uint8Array; } export interface MsgLockTokensResponseAmino { - ID: string; + ID?: string; } export interface MsgLockTokensResponseAminoMsg { type: "osmosis/lockup/lock-tokens-response"; @@ -50,7 +50,7 @@ export interface MsgBeginUnlockingAllProtoMsg { value: Uint8Array; } export interface MsgBeginUnlockingAllAmino { - owner: string; + owner?: string; } export interface MsgBeginUnlockingAllAminoMsg { type: "osmosis/lockup/begin-unlock-tokens"; @@ -67,7 +67,7 @@ export interface MsgBeginUnlockingAllResponseProtoMsg { value: Uint8Array; } export interface MsgBeginUnlockingAllResponseAmino { - unlocks: PeriodLockAmino[]; + unlocks?: PeriodLockAmino[]; } export interface MsgBeginUnlockingAllResponseAminoMsg { type: "osmosis/lockup/begin-unlocking-all-response"; @@ -87,10 +87,10 @@ export interface MsgBeginUnlockingProtoMsg { value: Uint8Array; } export interface MsgBeginUnlockingAmino { - owner: string; - ID: string; + owner?: string; + ID?: string; /** Amount of unlocking coins. Unlock all if not set. */ - coins: CoinAmino[]; + coins?: CoinAmino[]; } export interface MsgBeginUnlockingAminoMsg { type: "osmosis/lockup/begin-unlock-period-lock"; @@ -110,8 +110,8 @@ export interface MsgBeginUnlockingResponseProtoMsg { value: Uint8Array; } export interface MsgBeginUnlockingResponseAmino { - success: boolean; - unlockingLockID: string; + success?: boolean; + unlockingLockID?: string; } export interface MsgBeginUnlockingResponseAminoMsg { type: "osmosis/lockup/begin-unlocking-response"; @@ -143,8 +143,8 @@ export interface MsgExtendLockupProtoMsg { * The new duration is longer than the original. */ export interface MsgExtendLockupAmino { - owner: string; - ID: string; + owner?: string; + ID?: string; /** * duration to be set. fails if lower than the current duration, or is * unlocking @@ -172,7 +172,7 @@ export interface MsgExtendLockupResponseProtoMsg { value: Uint8Array; } export interface MsgExtendLockupResponseAmino { - success: boolean; + success?: boolean; } export interface MsgExtendLockupResponseAminoMsg { type: "osmosis/lockup/extend-lockup-response"; @@ -200,13 +200,13 @@ export interface MsgForceUnlockProtoMsg { * addresses registered via governance. */ export interface MsgForceUnlockAmino { - owner: string; - ID: string; + owner?: string; + ID?: string; /** Amount of unlocking coins. Unlock all if not set. */ - coins: CoinAmino[]; + coins?: CoinAmino[]; } export interface MsgForceUnlockAminoMsg { - type: "osmosis/lockup/force-unlock"; + type: "osmosis/lockup/force-unlock-tokens"; value: MsgForceUnlockAmino; } /** @@ -226,7 +226,7 @@ export interface MsgForceUnlockResponseProtoMsg { value: Uint8Array; } export interface MsgForceUnlockResponseAmino { - success: boolean; + success?: boolean; } export interface MsgForceUnlockResponseAminoMsg { type: "osmosis/lockup/force-unlock-response"; @@ -245,9 +245,9 @@ export interface MsgSetRewardReceiverAddressProtoMsg { value: Uint8Array; } export interface MsgSetRewardReceiverAddressAmino { - owner: string; - lockID: string; - reward_receiver: string; + owner?: string; + lockID?: string; + reward_receiver?: string; } export interface MsgSetRewardReceiverAddressAminoMsg { type: "osmosis/lockup/set-reward-receiver-address"; @@ -266,7 +266,7 @@ export interface MsgSetRewardReceiverAddressResponseProtoMsg { value: Uint8Array; } export interface MsgSetRewardReceiverAddressResponseAmino { - success: boolean; + success?: boolean; } export interface MsgSetRewardReceiverAddressResponseAminoMsg { type: "osmosis/lockup/set-reward-receiver-address-response"; @@ -327,11 +327,15 @@ export const MsgLockTokens = { return message; }, fromAmino(object: MsgLockTokensAmino): MsgLockTokens { - return { - owner: object.owner, - duration: object?.duration ? Duration.fromAmino(object.duration) : undefined, - coins: Array.isArray(object?.coins) ? object.coins.map((e: any) => Coin.fromAmino(e)) : [] - }; + const message = createBaseMsgLockTokens(); + if (object.owner !== undefined && object.owner !== null) { + message.owner = object.owner; + } + if (object.duration !== undefined && object.duration !== null) { + message.duration = Duration.fromAmino(object.duration); + } + message.coins = object.coins?.map(e => Coin.fromAmino(e)) || []; + return message; }, toAmino(message: MsgLockTokens): MsgLockTokensAmino { const obj: any = {}; @@ -402,9 +406,11 @@ export const MsgLockTokensResponse = { return message; }, fromAmino(object: MsgLockTokensResponseAmino): MsgLockTokensResponse { - return { - ID: BigInt(object.ID) - }; + const message = createBaseMsgLockTokensResponse(); + if (object.ID !== undefined && object.ID !== null) { + message.ID = BigInt(object.ID); + } + return message; }, toAmino(message: MsgLockTokensResponse): MsgLockTokensResponseAmino { const obj: any = {}; @@ -469,9 +475,11 @@ export const MsgBeginUnlockingAll = { return message; }, fromAmino(object: MsgBeginUnlockingAllAmino): MsgBeginUnlockingAll { - return { - owner: object.owner - }; + const message = createBaseMsgBeginUnlockingAll(); + if (object.owner !== undefined && object.owner !== null) { + message.owner = object.owner; + } + return message; }, toAmino(message: MsgBeginUnlockingAll): MsgBeginUnlockingAllAmino { const obj: any = {}; @@ -536,9 +544,9 @@ export const MsgBeginUnlockingAllResponse = { return message; }, fromAmino(object: MsgBeginUnlockingAllResponseAmino): MsgBeginUnlockingAllResponse { - return { - unlocks: Array.isArray(object?.unlocks) ? object.unlocks.map((e: any) => PeriodLock.fromAmino(e)) : [] - }; + const message = createBaseMsgBeginUnlockingAllResponse(); + message.unlocks = object.unlocks?.map(e => PeriodLock.fromAmino(e)) || []; + return message; }, toAmino(message: MsgBeginUnlockingAllResponse): MsgBeginUnlockingAllResponseAmino { const obj: any = {}; @@ -623,11 +631,15 @@ export const MsgBeginUnlocking = { return message; }, fromAmino(object: MsgBeginUnlockingAmino): MsgBeginUnlocking { - return { - owner: object.owner, - ID: BigInt(object.ID), - coins: Array.isArray(object?.coins) ? object.coins.map((e: any) => Coin.fromAmino(e)) : [] - }; + const message = createBaseMsgBeginUnlocking(); + if (object.owner !== undefined && object.owner !== null) { + message.owner = object.owner; + } + if (object.ID !== undefined && object.ID !== null) { + message.ID = BigInt(object.ID); + } + message.coins = object.coins?.map(e => Coin.fromAmino(e)) || []; + return message; }, toAmino(message: MsgBeginUnlocking): MsgBeginUnlockingAmino { const obj: any = {}; @@ -706,10 +718,14 @@ export const MsgBeginUnlockingResponse = { return message; }, fromAmino(object: MsgBeginUnlockingResponseAmino): MsgBeginUnlockingResponse { - return { - success: object.success, - unlockingLockID: BigInt(object.unlockingLockID) - }; + const message = createBaseMsgBeginUnlockingResponse(); + if (object.success !== undefined && object.success !== null) { + message.success = object.success; + } + if (object.unlockingLockID !== undefined && object.unlockingLockID !== null) { + message.unlockingLockID = BigInt(object.unlockingLockID); + } + return message; }, toAmino(message: MsgBeginUnlockingResponse): MsgBeginUnlockingResponseAmino { const obj: any = {}; @@ -791,11 +807,17 @@ export const MsgExtendLockup = { return message; }, fromAmino(object: MsgExtendLockupAmino): MsgExtendLockup { - return { - owner: object.owner, - ID: BigInt(object.ID), - duration: object?.duration ? Duration.fromAmino(object.duration) : undefined - }; + const message = createBaseMsgExtendLockup(); + if (object.owner !== undefined && object.owner !== null) { + message.owner = object.owner; + } + if (object.ID !== undefined && object.ID !== null) { + message.ID = BigInt(object.ID); + } + if (object.duration !== undefined && object.duration !== null) { + message.duration = Duration.fromAmino(object.duration); + } + return message; }, toAmino(message: MsgExtendLockup): MsgExtendLockupAmino { const obj: any = {}; @@ -862,9 +884,11 @@ export const MsgExtendLockupResponse = { return message; }, fromAmino(object: MsgExtendLockupResponseAmino): MsgExtendLockupResponse { - return { - success: object.success - }; + const message = createBaseMsgExtendLockupResponse(); + if (object.success !== undefined && object.success !== null) { + message.success = object.success; + } + return message; }, toAmino(message: MsgExtendLockupResponse): MsgExtendLockupResponseAmino { const obj: any = {}; @@ -945,11 +969,15 @@ export const MsgForceUnlock = { return message; }, fromAmino(object: MsgForceUnlockAmino): MsgForceUnlock { - return { - owner: object.owner, - ID: BigInt(object.ID), - coins: Array.isArray(object?.coins) ? object.coins.map((e: any) => Coin.fromAmino(e)) : [] - }; + const message = createBaseMsgForceUnlock(); + if (object.owner !== undefined && object.owner !== null) { + message.owner = object.owner; + } + if (object.ID !== undefined && object.ID !== null) { + message.ID = BigInt(object.ID); + } + message.coins = object.coins?.map(e => Coin.fromAmino(e)) || []; + return message; }, toAmino(message: MsgForceUnlock): MsgForceUnlockAmino { const obj: any = {}; @@ -967,7 +995,7 @@ export const MsgForceUnlock = { }, toAminoMsg(message: MsgForceUnlock): MsgForceUnlockAminoMsg { return { - type: "osmosis/lockup/force-unlock", + type: "osmosis/lockup/force-unlock-tokens", value: MsgForceUnlock.toAmino(message) }; }, @@ -1020,9 +1048,11 @@ export const MsgForceUnlockResponse = { return message; }, fromAmino(object: MsgForceUnlockResponseAmino): MsgForceUnlockResponse { - return { - success: object.success - }; + const message = createBaseMsgForceUnlockResponse(); + if (object.success !== undefined && object.success !== null) { + message.success = object.success; + } + return message; }, toAmino(message: MsgForceUnlockResponse): MsgForceUnlockResponseAmino { const obj: any = {}; @@ -1103,11 +1133,17 @@ export const MsgSetRewardReceiverAddress = { return message; }, fromAmino(object: MsgSetRewardReceiverAddressAmino): MsgSetRewardReceiverAddress { - return { - owner: object.owner, - lockID: BigInt(object.lockID), - rewardReceiver: object.reward_receiver - }; + const message = createBaseMsgSetRewardReceiverAddress(); + if (object.owner !== undefined && object.owner !== null) { + message.owner = object.owner; + } + if (object.lockID !== undefined && object.lockID !== null) { + message.lockID = BigInt(object.lockID); + } + if (object.reward_receiver !== undefined && object.reward_receiver !== null) { + message.rewardReceiver = object.reward_receiver; + } + return message; }, toAmino(message: MsgSetRewardReceiverAddress): MsgSetRewardReceiverAddressAmino { const obj: any = {}; @@ -1174,9 +1210,11 @@ export const MsgSetRewardReceiverAddressResponse = { return message; }, fromAmino(object: MsgSetRewardReceiverAddressResponseAmino): MsgSetRewardReceiverAddressResponse { - return { - success: object.success - }; + const message = createBaseMsgSetRewardReceiverAddressResponse(); + if (object.success !== undefined && object.success !== null) { + message.success = object.success; + } + return message; }, toAmino(message: MsgSetRewardReceiverAddressResponse): MsgSetRewardReceiverAddressResponseAmino { const obj: any = {}; diff --git a/packages/osmo-query/src/codegen/osmosis/mint/v1beta1/genesis.ts b/packages/osmo-query/src/codegen/osmosis/mint/v1beta1/genesis.ts index d3656b313..b5381a016 100644 --- a/packages/osmo-query/src/codegen/osmosis/mint/v1beta1/genesis.ts +++ b/packages/osmo-query/src/codegen/osmosis/mint/v1beta1/genesis.ts @@ -4,7 +4,7 @@ import { BinaryReader, BinaryWriter } from "../../../binary"; export interface GenesisState { /** minter is an abstraction for holding current rewards information. */ minter: Minter; - /** params defines all the paramaters of the mint module. */ + /** params defines all the parameters of the mint module. */ params: Params; /** * reduction_started_epoch is the first epoch in which the reduction of mint @@ -20,13 +20,13 @@ export interface GenesisStateProtoMsg { export interface GenesisStateAmino { /** minter is an abstraction for holding current rewards information. */ minter?: MinterAmino; - /** params defines all the paramaters of the mint module. */ + /** params defines all the parameters of the mint module. */ params?: ParamsAmino; /** * reduction_started_epoch is the first epoch in which the reduction of mint * begins. */ - reduction_started_epoch: string; + reduction_started_epoch?: string; } export interface GenesisStateAminoMsg { type: "osmosis/mint/genesis-state"; @@ -90,11 +90,17 @@ export const GenesisState = { return message; }, fromAmino(object: GenesisStateAmino): GenesisState { - return { - minter: object?.minter ? Minter.fromAmino(object.minter) : undefined, - params: object?.params ? Params.fromAmino(object.params) : undefined, - reductionStartedEpoch: BigInt(object.reduction_started_epoch) - }; + const message = createBaseGenesisState(); + if (object.minter !== undefined && object.minter !== null) { + message.minter = Minter.fromAmino(object.minter); + } + if (object.params !== undefined && object.params !== null) { + message.params = Params.fromAmino(object.params); + } + if (object.reduction_started_epoch !== undefined && object.reduction_started_epoch !== null) { + message.reductionStartedEpoch = BigInt(object.reduction_started_epoch); + } + return message; }, toAmino(message: GenesisState): GenesisStateAmino { const obj: any = {}; diff --git a/packages/osmo-query/src/codegen/osmosis/mint/v1beta1/mint.ts b/packages/osmo-query/src/codegen/osmosis/mint/v1beta1/mint.ts index 650bf2cce..c62ba8886 100644 --- a/packages/osmo-query/src/codegen/osmosis/mint/v1beta1/mint.ts +++ b/packages/osmo-query/src/codegen/osmosis/mint/v1beta1/mint.ts @@ -12,7 +12,7 @@ export interface MinterProtoMsg { /** Minter represents the minting state. */ export interface MinterAmino { /** epoch_provisions represent rewards for the current epoch. */ - epoch_provisions: string; + epoch_provisions?: string; } export interface MinterAminoMsg { type: "osmosis/mint/minter"; @@ -41,8 +41,8 @@ export interface WeightedAddressProtoMsg { * tokens to be minted to the address. */ export interface WeightedAddressAmino { - address: string; - weight: string; + address?: string; + weight?: string; } export interface WeightedAddressAminoMsg { type: "osmosis/mint/weighted-address"; @@ -98,22 +98,22 @@ export interface DistributionProportionsAmino { * staking defines the proportion of the minted mint_denom that is to be * allocated as staking rewards. */ - staking: string; + staking?: string; /** * pool_incentives defines the proportion of the minted mint_denom that is * to be allocated as pool incentives. */ - pool_incentives: string; + pool_incentives?: string; /** * developer_rewards defines the proportion of the minted mint_denom that is * to be allocated to developer rewards address. */ - developer_rewards: string; + developer_rewards?: string; /** * community_pool defines the proportion of the minted mint_denom that is * to be allocated to the community pool. */ - community_pool: string; + community_pool?: string; } export interface DistributionProportionsAminoMsg { type: "osmosis/mint/distribution-proportions"; @@ -174,21 +174,21 @@ export interface ParamsProtoMsg { /** Params holds parameters for the x/mint module. */ export interface ParamsAmino { /** mint_denom is the denom of the coin to mint. */ - mint_denom: string; + mint_denom?: string; /** genesis_epoch_provisions epoch provisions from the first epoch. */ - genesis_epoch_provisions: string; + genesis_epoch_provisions?: string; /** epoch_identifier mint epoch identifier e.g. (day, week). */ - epoch_identifier: string; + epoch_identifier?: string; /** * reduction_period_in_epochs the number of epochs it takes * to reduce the rewards. */ - reduction_period_in_epochs: string; + reduction_period_in_epochs?: string; /** * reduction_factor is the reduction multiplier to execute * at the end of each period set by reduction_period_in_epochs. */ - reduction_factor: string; + reduction_factor?: string; /** * distribution_proportions defines the distribution proportions of the minted * denom. In other words, defines which stakeholders will receive the minted @@ -201,12 +201,12 @@ export interface ParamsAmino { * address receives is: epoch_provisions * * distribution_proportions.developer_rewards * Address's Weight. */ - weighted_developer_rewards_receivers: WeightedAddressAmino[]; + weighted_developer_rewards_receivers?: WeightedAddressAmino[]; /** * minting_rewards_distribution_start_epoch start epoch to distribute minting * rewards */ - minting_rewards_distribution_start_epoch: string; + minting_rewards_distribution_start_epoch?: string; } export interface ParamsAminoMsg { type: "osmosis/mint/params"; @@ -259,9 +259,11 @@ export const Minter = { return message; }, fromAmino(object: MinterAmino): Minter { - return { - epochProvisions: object.epoch_provisions - }; + const message = createBaseMinter(); + if (object.epoch_provisions !== undefined && object.epoch_provisions !== null) { + message.epochProvisions = object.epoch_provisions; + } + return message; }, toAmino(message: Minter): MinterAmino { const obj: any = {}; @@ -334,10 +336,14 @@ export const WeightedAddress = { return message; }, fromAmino(object: WeightedAddressAmino): WeightedAddress { - return { - address: object.address, - weight: object.weight - }; + const message = createBaseWeightedAddress(); + if (object.address !== undefined && object.address !== null) { + message.address = object.address; + } + if (object.weight !== undefined && object.weight !== null) { + message.weight = object.weight; + } + return message; }, toAmino(message: WeightedAddress): WeightedAddressAmino { const obj: any = {}; @@ -427,12 +433,20 @@ export const DistributionProportions = { return message; }, fromAmino(object: DistributionProportionsAmino): DistributionProportions { - return { - staking: object.staking, - poolIncentives: object.pool_incentives, - developerRewards: object.developer_rewards, - communityPool: object.community_pool - }; + const message = createBaseDistributionProportions(); + if (object.staking !== undefined && object.staking !== null) { + message.staking = object.staking; + } + if (object.pool_incentives !== undefined && object.pool_incentives !== null) { + message.poolIncentives = object.pool_incentives; + } + if (object.developer_rewards !== undefined && object.developer_rewards !== null) { + message.developerRewards = object.developer_rewards; + } + if (object.community_pool !== undefined && object.community_pool !== null) { + message.communityPool = object.community_pool; + } + return message; }, toAmino(message: DistributionProportions): DistributionProportionsAmino { const obj: any = {}; @@ -556,16 +570,30 @@ export const Params = { return message; }, fromAmino(object: ParamsAmino): Params { - return { - mintDenom: object.mint_denom, - genesisEpochProvisions: object.genesis_epoch_provisions, - epochIdentifier: object.epoch_identifier, - reductionPeriodInEpochs: BigInt(object.reduction_period_in_epochs), - reductionFactor: object.reduction_factor, - distributionProportions: object?.distribution_proportions ? DistributionProportions.fromAmino(object.distribution_proportions) : undefined, - weightedDeveloperRewardsReceivers: Array.isArray(object?.weighted_developer_rewards_receivers) ? object.weighted_developer_rewards_receivers.map((e: any) => WeightedAddress.fromAmino(e)) : [], - mintingRewardsDistributionStartEpoch: BigInt(object.minting_rewards_distribution_start_epoch) - }; + const message = createBaseParams(); + if (object.mint_denom !== undefined && object.mint_denom !== null) { + message.mintDenom = object.mint_denom; + } + if (object.genesis_epoch_provisions !== undefined && object.genesis_epoch_provisions !== null) { + message.genesisEpochProvisions = object.genesis_epoch_provisions; + } + if (object.epoch_identifier !== undefined && object.epoch_identifier !== null) { + message.epochIdentifier = object.epoch_identifier; + } + if (object.reduction_period_in_epochs !== undefined && object.reduction_period_in_epochs !== null) { + message.reductionPeriodInEpochs = BigInt(object.reduction_period_in_epochs); + } + if (object.reduction_factor !== undefined && object.reduction_factor !== null) { + message.reductionFactor = object.reduction_factor; + } + if (object.distribution_proportions !== undefined && object.distribution_proportions !== null) { + message.distributionProportions = DistributionProportions.fromAmino(object.distribution_proportions); + } + message.weightedDeveloperRewardsReceivers = object.weighted_developer_rewards_receivers?.map(e => WeightedAddress.fromAmino(e)) || []; + if (object.minting_rewards_distribution_start_epoch !== undefined && object.minting_rewards_distribution_start_epoch !== null) { + message.mintingRewardsDistributionStartEpoch = BigInt(object.minting_rewards_distribution_start_epoch); + } + return message; }, toAmino(message: Params): ParamsAmino { const obj: any = {}; diff --git a/packages/osmo-query/src/codegen/osmosis/mint/v1beta1/query.ts b/packages/osmo-query/src/codegen/osmosis/mint/v1beta1/query.ts index b691c294a..a15e32993 100644 --- a/packages/osmo-query/src/codegen/osmosis/mint/v1beta1/query.ts +++ b/packages/osmo-query/src/codegen/osmosis/mint/v1beta1/query.ts @@ -1,5 +1,6 @@ import { Params, ParamsAmino, ParamsSDKType } from "./mint"; import { BinaryReader, BinaryWriter } from "../../../binary"; +import { bytesFromBase64, base64FromBytes } from "../../../helpers"; /** QueryParamsRequest is the request type for the Query/Params RPC method. */ export interface QueryParamsRequest {} export interface QueryParamsRequestProtoMsg { @@ -77,7 +78,7 @@ export interface QueryEpochProvisionsResponseProtoMsg { */ export interface QueryEpochProvisionsResponseAmino { /** epoch_provisions is the current minting per epoch provisions value. */ - epoch_provisions: Uint8Array; + epoch_provisions?: string; } export interface QueryEpochProvisionsResponseAminoMsg { type: "osmosis/mint/query-epoch-provisions-response"; @@ -117,7 +118,8 @@ export const QueryParamsRequest = { return message; }, fromAmino(_: QueryParamsRequestAmino): QueryParamsRequest { - return {}; + const message = createBaseQueryParamsRequest(); + return message; }, toAmino(_: QueryParamsRequest): QueryParamsRequestAmino { const obj: any = {}; @@ -181,9 +183,11 @@ export const QueryParamsResponse = { return message; }, fromAmino(object: QueryParamsResponseAmino): QueryParamsResponse { - return { - params: object?.params ? Params.fromAmino(object.params) : undefined - }; + const message = createBaseQueryParamsResponse(); + if (object.params !== undefined && object.params !== null) { + message.params = Params.fromAmino(object.params); + } + return message; }, toAmino(message: QueryParamsResponse): QueryParamsResponseAmino { const obj: any = {}; @@ -239,7 +243,8 @@ export const QueryEpochProvisionsRequest = { return message; }, fromAmino(_: QueryEpochProvisionsRequestAmino): QueryEpochProvisionsRequest { - return {}; + const message = createBaseQueryEpochProvisionsRequest(); + return message; }, toAmino(_: QueryEpochProvisionsRequest): QueryEpochProvisionsRequestAmino { const obj: any = {}; @@ -303,13 +308,15 @@ export const QueryEpochProvisionsResponse = { return message; }, fromAmino(object: QueryEpochProvisionsResponseAmino): QueryEpochProvisionsResponse { - return { - epochProvisions: object.epoch_provisions - }; + const message = createBaseQueryEpochProvisionsResponse(); + if (object.epoch_provisions !== undefined && object.epoch_provisions !== null) { + message.epochProvisions = bytesFromBase64(object.epoch_provisions); + } + return message; }, toAmino(message: QueryEpochProvisionsResponse): QueryEpochProvisionsResponseAmino { const obj: any = {}; - obj.epoch_provisions = message.epochProvisions; + obj.epoch_provisions = message.epochProvisions ? base64FromBytes(message.epochProvisions) : undefined; return obj; }, fromAminoMsg(object: QueryEpochProvisionsResponseAminoMsg): QueryEpochProvisionsResponse { diff --git a/packages/osmo-query/src/codegen/osmosis/pool-incentives/v1beta1/genesis.ts b/packages/osmo-query/src/codegen/osmosis/pool-incentives/v1beta1/genesis.ts deleted file mode 100644 index 6fd3ed518..000000000 --- a/packages/osmo-query/src/codegen/osmosis/pool-incentives/v1beta1/genesis.ts +++ /dev/null @@ -1,135 +0,0 @@ -import { Params, ParamsAmino, ParamsSDKType, DistrInfo, DistrInfoAmino, DistrInfoSDKType, PoolToGauges, PoolToGaugesAmino, PoolToGaugesSDKType } from "./incentives"; -import { Duration, DurationAmino, DurationSDKType } from "../../../google/protobuf/duration"; -import { BinaryReader, BinaryWriter } from "../../../binary"; -/** GenesisState defines the pool incentives module's genesis state. */ -export interface GenesisState { - /** params defines all the paramaters of the module. */ - params: Params; - lockableDurations: Duration[]; - distrInfo?: DistrInfo; - poolToGauges?: PoolToGauges; -} -export interface GenesisStateProtoMsg { - typeUrl: "/osmosis.poolincentives.v1beta1.GenesisState"; - value: Uint8Array; -} -/** GenesisState defines the pool incentives module's genesis state. */ -export interface GenesisStateAmino { - /** params defines all the paramaters of the module. */ - params?: ParamsAmino; - lockable_durations: DurationAmino[]; - distr_info?: DistrInfoAmino; - pool_to_gauges?: PoolToGaugesAmino; -} -export interface GenesisStateAminoMsg { - type: "osmosis/poolincentives/genesis-state"; - value: GenesisStateAmino; -} -/** GenesisState defines the pool incentives module's genesis state. */ -export interface GenesisStateSDKType { - params: ParamsSDKType; - lockable_durations: DurationSDKType[]; - distr_info?: DistrInfoSDKType; - pool_to_gauges?: PoolToGaugesSDKType; -} -function createBaseGenesisState(): GenesisState { - return { - params: Params.fromPartial({}), - lockableDurations: [], - distrInfo: undefined, - poolToGauges: undefined - }; -} -export const GenesisState = { - typeUrl: "/osmosis.poolincentives.v1beta1.GenesisState", - encode(message: GenesisState, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { - if (message.params !== undefined) { - Params.encode(message.params, writer.uint32(10).fork()).ldelim(); - } - for (const v of message.lockableDurations) { - Duration.encode(v!, writer.uint32(18).fork()).ldelim(); - } - if (message.distrInfo !== undefined) { - DistrInfo.encode(message.distrInfo, writer.uint32(26).fork()).ldelim(); - } - if (message.poolToGauges !== undefined) { - PoolToGauges.encode(message.poolToGauges, writer.uint32(34).fork()).ldelim(); - } - return writer; - }, - decode(input: BinaryReader | Uint8Array, length?: number): GenesisState { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseGenesisState(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.params = Params.decode(reader, reader.uint32()); - break; - case 2: - message.lockableDurations.push(Duration.decode(reader, reader.uint32())); - break; - case 3: - message.distrInfo = DistrInfo.decode(reader, reader.uint32()); - break; - case 4: - message.poolToGauges = PoolToGauges.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - fromPartial(object: Partial): GenesisState { - const message = createBaseGenesisState(); - message.params = object.params !== undefined && object.params !== null ? Params.fromPartial(object.params) : undefined; - message.lockableDurations = object.lockableDurations?.map(e => Duration.fromPartial(e)) || []; - message.distrInfo = object.distrInfo !== undefined && object.distrInfo !== null ? DistrInfo.fromPartial(object.distrInfo) : undefined; - message.poolToGauges = object.poolToGauges !== undefined && object.poolToGauges !== null ? PoolToGauges.fromPartial(object.poolToGauges) : undefined; - return message; - }, - fromAmino(object: GenesisStateAmino): GenesisState { - return { - params: object?.params ? Params.fromAmino(object.params) : undefined, - lockableDurations: Array.isArray(object?.lockable_durations) ? object.lockable_durations.map((e: any) => Duration.fromAmino(e)) : [], - distrInfo: object?.distr_info ? DistrInfo.fromAmino(object.distr_info) : undefined, - poolToGauges: object?.pool_to_gauges ? PoolToGauges.fromAmino(object.pool_to_gauges) : undefined - }; - }, - toAmino(message: GenesisState): GenesisStateAmino { - const obj: any = {}; - obj.params = message.params ? Params.toAmino(message.params) : undefined; - if (message.lockableDurations) { - obj.lockable_durations = message.lockableDurations.map(e => e ? Duration.toAmino(e) : undefined); - } else { - obj.lockable_durations = []; - } - obj.distr_info = message.distrInfo ? DistrInfo.toAmino(message.distrInfo) : undefined; - obj.pool_to_gauges = message.poolToGauges ? PoolToGauges.toAmino(message.poolToGauges) : undefined; - return obj; - }, - fromAminoMsg(object: GenesisStateAminoMsg): GenesisState { - return GenesisState.fromAmino(object.value); - }, - toAminoMsg(message: GenesisState): GenesisStateAminoMsg { - return { - type: "osmosis/poolincentives/genesis-state", - value: GenesisState.toAmino(message) - }; - }, - fromProtoMsg(message: GenesisStateProtoMsg): GenesisState { - return GenesisState.decode(message.value); - }, - toProto(message: GenesisState): Uint8Array { - return GenesisState.encode(message).finish(); - }, - toProtoMsg(message: GenesisState): GenesisStateProtoMsg { - return { - typeUrl: "/osmosis.poolincentives.v1beta1.GenesisState", - value: GenesisState.encode(message).finish() - }; - } -}; \ No newline at end of file diff --git a/packages/osmojs/src/codegen/osmosis/pool-incentives/v1beta1/genesis.ts b/packages/osmo-query/src/codegen/osmosis/poolincentives/v1beta1/genesis.ts similarity index 51% rename from packages/osmojs/src/codegen/osmosis/pool-incentives/v1beta1/genesis.ts rename to packages/osmo-query/src/codegen/osmosis/poolincentives/v1beta1/genesis.ts index 6fd3ed518..c7ea02399 100644 --- a/packages/osmojs/src/codegen/osmosis/pool-incentives/v1beta1/genesis.ts +++ b/packages/osmo-query/src/codegen/osmosis/poolincentives/v1beta1/genesis.ts @@ -1,13 +1,24 @@ -import { Params, ParamsAmino, ParamsSDKType, DistrInfo, DistrInfoAmino, DistrInfoSDKType, PoolToGauges, PoolToGaugesAmino, PoolToGaugesSDKType } from "./incentives"; +import { Params, ParamsAmino, ParamsSDKType, DistrInfo, DistrInfoAmino, DistrInfoSDKType, AnyPoolToInternalGauges, AnyPoolToInternalGaugesAmino, AnyPoolToInternalGaugesSDKType, ConcentratedPoolToNoLockGauges, ConcentratedPoolToNoLockGaugesAmino, ConcentratedPoolToNoLockGaugesSDKType } from "./incentives"; import { Duration, DurationAmino, DurationSDKType } from "../../../google/protobuf/duration"; import { BinaryReader, BinaryWriter } from "../../../binary"; /** GenesisState defines the pool incentives module's genesis state. */ export interface GenesisState { - /** params defines all the paramaters of the module. */ + /** params defines all the parameters of the module. */ params: Params; lockableDurations: Duration[]; distrInfo?: DistrInfo; - poolToGauges?: PoolToGauges; + /** + * any_pool_to_internal_gauges defines the gauges for any pool to internal + * pool. For every pool type (e.g. LP, Concentrated, etc), there is one such + * link + */ + anyPoolToInternalGauges?: AnyPoolToInternalGauges; + /** + * concentrated_pool_to_no_lock_gauges defines the no lock gauges for + * concentrated pool. This only exists between concentrated pool and no lock + * gauges. Both external and internal gauges are included. + */ + concentratedPoolToNoLockGauges?: ConcentratedPoolToNoLockGauges; } export interface GenesisStateProtoMsg { typeUrl: "/osmosis.poolincentives.v1beta1.GenesisState"; @@ -15,11 +26,22 @@ export interface GenesisStateProtoMsg { } /** GenesisState defines the pool incentives module's genesis state. */ export interface GenesisStateAmino { - /** params defines all the paramaters of the module. */ + /** params defines all the parameters of the module. */ params?: ParamsAmino; - lockable_durations: DurationAmino[]; + lockable_durations?: DurationAmino[]; distr_info?: DistrInfoAmino; - pool_to_gauges?: PoolToGaugesAmino; + /** + * any_pool_to_internal_gauges defines the gauges for any pool to internal + * pool. For every pool type (e.g. LP, Concentrated, etc), there is one such + * link + */ + any_pool_to_internal_gauges?: AnyPoolToInternalGaugesAmino; + /** + * concentrated_pool_to_no_lock_gauges defines the no lock gauges for + * concentrated pool. This only exists between concentrated pool and no lock + * gauges. Both external and internal gauges are included. + */ + concentrated_pool_to_no_lock_gauges?: ConcentratedPoolToNoLockGaugesAmino; } export interface GenesisStateAminoMsg { type: "osmosis/poolincentives/genesis-state"; @@ -30,14 +52,16 @@ export interface GenesisStateSDKType { params: ParamsSDKType; lockable_durations: DurationSDKType[]; distr_info?: DistrInfoSDKType; - pool_to_gauges?: PoolToGaugesSDKType; + any_pool_to_internal_gauges?: AnyPoolToInternalGaugesSDKType; + concentrated_pool_to_no_lock_gauges?: ConcentratedPoolToNoLockGaugesSDKType; } function createBaseGenesisState(): GenesisState { return { params: Params.fromPartial({}), lockableDurations: [], distrInfo: undefined, - poolToGauges: undefined + anyPoolToInternalGauges: undefined, + concentratedPoolToNoLockGauges: undefined }; } export const GenesisState = { @@ -52,8 +76,11 @@ export const GenesisState = { if (message.distrInfo !== undefined) { DistrInfo.encode(message.distrInfo, writer.uint32(26).fork()).ldelim(); } - if (message.poolToGauges !== undefined) { - PoolToGauges.encode(message.poolToGauges, writer.uint32(34).fork()).ldelim(); + if (message.anyPoolToInternalGauges !== undefined) { + AnyPoolToInternalGauges.encode(message.anyPoolToInternalGauges, writer.uint32(34).fork()).ldelim(); + } + if (message.concentratedPoolToNoLockGauges !== undefined) { + ConcentratedPoolToNoLockGauges.encode(message.concentratedPoolToNoLockGauges, writer.uint32(42).fork()).ldelim(); } return writer; }, @@ -74,7 +101,10 @@ export const GenesisState = { message.distrInfo = DistrInfo.decode(reader, reader.uint32()); break; case 4: - message.poolToGauges = PoolToGauges.decode(reader, reader.uint32()); + message.anyPoolToInternalGauges = AnyPoolToInternalGauges.decode(reader, reader.uint32()); + break; + case 5: + message.concentratedPoolToNoLockGauges = ConcentratedPoolToNoLockGauges.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -88,16 +118,26 @@ export const GenesisState = { message.params = object.params !== undefined && object.params !== null ? Params.fromPartial(object.params) : undefined; message.lockableDurations = object.lockableDurations?.map(e => Duration.fromPartial(e)) || []; message.distrInfo = object.distrInfo !== undefined && object.distrInfo !== null ? DistrInfo.fromPartial(object.distrInfo) : undefined; - message.poolToGauges = object.poolToGauges !== undefined && object.poolToGauges !== null ? PoolToGauges.fromPartial(object.poolToGauges) : undefined; + message.anyPoolToInternalGauges = object.anyPoolToInternalGauges !== undefined && object.anyPoolToInternalGauges !== null ? AnyPoolToInternalGauges.fromPartial(object.anyPoolToInternalGauges) : undefined; + message.concentratedPoolToNoLockGauges = object.concentratedPoolToNoLockGauges !== undefined && object.concentratedPoolToNoLockGauges !== null ? ConcentratedPoolToNoLockGauges.fromPartial(object.concentratedPoolToNoLockGauges) : undefined; return message; }, fromAmino(object: GenesisStateAmino): GenesisState { - return { - params: object?.params ? Params.fromAmino(object.params) : undefined, - lockableDurations: Array.isArray(object?.lockable_durations) ? object.lockable_durations.map((e: any) => Duration.fromAmino(e)) : [], - distrInfo: object?.distr_info ? DistrInfo.fromAmino(object.distr_info) : undefined, - poolToGauges: object?.pool_to_gauges ? PoolToGauges.fromAmino(object.pool_to_gauges) : undefined - }; + const message = createBaseGenesisState(); + if (object.params !== undefined && object.params !== null) { + message.params = Params.fromAmino(object.params); + } + message.lockableDurations = object.lockable_durations?.map(e => Duration.fromAmino(e)) || []; + if (object.distr_info !== undefined && object.distr_info !== null) { + message.distrInfo = DistrInfo.fromAmino(object.distr_info); + } + if (object.any_pool_to_internal_gauges !== undefined && object.any_pool_to_internal_gauges !== null) { + message.anyPoolToInternalGauges = AnyPoolToInternalGauges.fromAmino(object.any_pool_to_internal_gauges); + } + if (object.concentrated_pool_to_no_lock_gauges !== undefined && object.concentrated_pool_to_no_lock_gauges !== null) { + message.concentratedPoolToNoLockGauges = ConcentratedPoolToNoLockGauges.fromAmino(object.concentrated_pool_to_no_lock_gauges); + } + return message; }, toAmino(message: GenesisState): GenesisStateAmino { const obj: any = {}; @@ -108,7 +148,8 @@ export const GenesisState = { obj.lockable_durations = []; } obj.distr_info = message.distrInfo ? DistrInfo.toAmino(message.distrInfo) : undefined; - obj.pool_to_gauges = message.poolToGauges ? PoolToGauges.toAmino(message.poolToGauges) : undefined; + obj.any_pool_to_internal_gauges = message.anyPoolToInternalGauges ? AnyPoolToInternalGauges.toAmino(message.anyPoolToInternalGauges) : undefined; + obj.concentrated_pool_to_no_lock_gauges = message.concentratedPoolToNoLockGauges ? ConcentratedPoolToNoLockGauges.toAmino(message.concentratedPoolToNoLockGauges) : undefined; return obj; }, fromAminoMsg(object: GenesisStateAminoMsg): GenesisState { diff --git a/packages/osmojs/src/codegen/osmosis/pool-incentives/v1beta1/gov.ts b/packages/osmo-query/src/codegen/osmosis/poolincentives/v1beta1/gov.ts similarity index 89% rename from packages/osmojs/src/codegen/osmosis/pool-incentives/v1beta1/gov.ts rename to packages/osmo-query/src/codegen/osmosis/poolincentives/v1beta1/gov.ts index 14194d17d..c9ac3360f 100644 --- a/packages/osmojs/src/codegen/osmosis/pool-incentives/v1beta1/gov.ts +++ b/packages/osmo-query/src/codegen/osmosis/poolincentives/v1beta1/gov.ts @@ -10,7 +10,7 @@ import { BinaryReader, BinaryWriter } from "../../../binary"; * configuration. Note that gaugeId=0 represents the community pool. */ export interface ReplacePoolIncentivesProposal { - $typeUrl?: string; + $typeUrl?: "/osmosis.poolincentives.v1beta1.ReplacePoolIncentivesProposal"; title: string; description: string; records: DistrRecord[]; @@ -29,9 +29,9 @@ export interface ReplacePoolIncentivesProposalProtoMsg { * configuration. Note that gaugeId=0 represents the community pool. */ export interface ReplacePoolIncentivesProposalAmino { - title: string; - description: string; - records: DistrRecordAmino[]; + title?: string; + description?: string; + records?: DistrRecordAmino[]; } export interface ReplacePoolIncentivesProposalAminoMsg { type: "osmosis/ReplacePoolIncentivesProposal"; @@ -47,7 +47,7 @@ export interface ReplacePoolIncentivesProposalAminoMsg { * configuration. Note that gaugeId=0 represents the community pool. */ export interface ReplacePoolIncentivesProposalSDKType { - $typeUrl?: string; + $typeUrl?: "/osmosis.poolincentives.v1beta1.ReplacePoolIncentivesProposal"; title: string; description: string; records: DistrRecordSDKType[]; @@ -62,7 +62,7 @@ export interface ReplacePoolIncentivesProposalSDKType { * [(Gauge 0, 5), (Gauge 2, 4), (Gauge 3, 10)] */ export interface UpdatePoolIncentivesProposal { - $typeUrl?: string; + $typeUrl?: "/osmosis.poolincentives.v1beta1.UpdatePoolIncentivesProposal"; title: string; description: string; records: DistrRecord[]; @@ -81,9 +81,9 @@ export interface UpdatePoolIncentivesProposalProtoMsg { * [(Gauge 0, 5), (Gauge 2, 4), (Gauge 3, 10)] */ export interface UpdatePoolIncentivesProposalAmino { - title: string; - description: string; - records: DistrRecordAmino[]; + title?: string; + description?: string; + records?: DistrRecordAmino[]; } export interface UpdatePoolIncentivesProposalAminoMsg { type: "osmosis/UpdatePoolIncentivesProposal"; @@ -99,7 +99,7 @@ export interface UpdatePoolIncentivesProposalAminoMsg { * [(Gauge 0, 5), (Gauge 2, 4), (Gauge 3, 10)] */ export interface UpdatePoolIncentivesProposalSDKType { - $typeUrl?: string; + $typeUrl?: "/osmosis.poolincentives.v1beta1.UpdatePoolIncentivesProposal"; title: string; description: string; records: DistrRecordSDKType[]; @@ -157,11 +157,15 @@ export const ReplacePoolIncentivesProposal = { return message; }, fromAmino(object: ReplacePoolIncentivesProposalAmino): ReplacePoolIncentivesProposal { - return { - title: object.title, - description: object.description, - records: Array.isArray(object?.records) ? object.records.map((e: any) => DistrRecord.fromAmino(e)) : [] - }; + const message = createBaseReplacePoolIncentivesProposal(); + if (object.title !== undefined && object.title !== null) { + message.title = object.title; + } + if (object.description !== undefined && object.description !== null) { + message.description = object.description; + } + message.records = object.records?.map(e => DistrRecord.fromAmino(e)) || []; + return message; }, toAmino(message: ReplacePoolIncentivesProposal): ReplacePoolIncentivesProposalAmino { const obj: any = {}; @@ -249,11 +253,15 @@ export const UpdatePoolIncentivesProposal = { return message; }, fromAmino(object: UpdatePoolIncentivesProposalAmino): UpdatePoolIncentivesProposal { - return { - title: object.title, - description: object.description, - records: Array.isArray(object?.records) ? object.records.map((e: any) => DistrRecord.fromAmino(e)) : [] - }; + const message = createBaseUpdatePoolIncentivesProposal(); + if (object.title !== undefined && object.title !== null) { + message.title = object.title; + } + if (object.description !== undefined && object.description !== null) { + message.description = object.description; + } + message.records = object.records?.map(e => DistrRecord.fromAmino(e)) || []; + return message; }, toAmino(message: UpdatePoolIncentivesProposal): UpdatePoolIncentivesProposalAmino { const obj: any = {}; diff --git a/packages/osmo-query/src/codegen/osmosis/pool-incentives/v1beta1/incentives.ts b/packages/osmo-query/src/codegen/osmosis/poolincentives/v1beta1/incentives.ts similarity index 69% rename from packages/osmo-query/src/codegen/osmosis/pool-incentives/v1beta1/incentives.ts rename to packages/osmo-query/src/codegen/osmosis/poolincentives/v1beta1/incentives.ts index f513a223a..6f43f9b93 100644 --- a/packages/osmo-query/src/codegen/osmosis/pool-incentives/v1beta1/incentives.ts +++ b/packages/osmo-query/src/codegen/osmosis/poolincentives/v1beta1/incentives.ts @@ -20,7 +20,7 @@ export interface ParamsAmino { * itself, but rather manages the distribution of coins that matches the * defined minted_denom. */ - minted_denom: string; + minted_denom?: string; } export interface ParamsAminoMsg { type: "osmosis/poolincentives/params"; @@ -37,7 +37,7 @@ export interface LockableDurationsInfoProtoMsg { value: Uint8Array; } export interface LockableDurationsInfoAmino { - lockable_durations: DurationAmino[]; + lockable_durations?: DurationAmino[]; } export interface LockableDurationsInfoAminoMsg { type: "osmosis/poolincentives/lockable-durations-info"; @@ -55,8 +55,8 @@ export interface DistrInfoProtoMsg { value: Uint8Array; } export interface DistrInfoAmino { - total_weight: string; - records: DistrRecordAmino[]; + total_weight?: string; + records?: DistrRecordAmino[]; } export interface DistrInfoAminoMsg { type: "osmosis/poolincentives/distr-info"; @@ -75,8 +75,8 @@ export interface DistrRecordProtoMsg { value: Uint8Array; } export interface DistrRecordAmino { - gauge_id: string; - weight: string; + gauge_id?: string; + weight?: string; } export interface DistrRecordAminoMsg { type: "osmosis/poolincentives/distr-record"; @@ -96,8 +96,8 @@ export interface PoolToGaugeProtoMsg { value: Uint8Array; } export interface PoolToGaugeAmino { - pool_id: string; - gauge_id: string; + pool_id?: string; + gauge_id?: string; duration?: DurationAmino; } export interface PoolToGaugeAminoMsg { @@ -109,21 +109,38 @@ export interface PoolToGaugeSDKType { gauge_id: bigint; duration: DurationSDKType; } -export interface PoolToGauges { +export interface AnyPoolToInternalGauges { + poolToGauge: PoolToGauge[]; +} +export interface AnyPoolToInternalGaugesProtoMsg { + typeUrl: "/osmosis.poolincentives.v1beta1.AnyPoolToInternalGauges"; + value: Uint8Array; +} +export interface AnyPoolToInternalGaugesAmino { + pool_to_gauge?: PoolToGaugeAmino[]; +} +export interface AnyPoolToInternalGaugesAminoMsg { + type: "osmosis/poolincentives/any-pool-to-internal-gauges"; + value: AnyPoolToInternalGaugesAmino; +} +export interface AnyPoolToInternalGaugesSDKType { + pool_to_gauge: PoolToGaugeSDKType[]; +} +export interface ConcentratedPoolToNoLockGauges { poolToGauge: PoolToGauge[]; } -export interface PoolToGaugesProtoMsg { - typeUrl: "/osmosis.poolincentives.v1beta1.PoolToGauges"; +export interface ConcentratedPoolToNoLockGaugesProtoMsg { + typeUrl: "/osmosis.poolincentives.v1beta1.ConcentratedPoolToNoLockGauges"; value: Uint8Array; } -export interface PoolToGaugesAmino { - pool_to_gauge: PoolToGaugeAmino[]; +export interface ConcentratedPoolToNoLockGaugesAmino { + pool_to_gauge?: PoolToGaugeAmino[]; } -export interface PoolToGaugesAminoMsg { - type: "osmosis/poolincentives/pool-to-gauges"; - value: PoolToGaugesAmino; +export interface ConcentratedPoolToNoLockGaugesAminoMsg { + type: "osmosis/poolincentives/concentrated-pool-to-no-lock-gauges"; + value: ConcentratedPoolToNoLockGaugesAmino; } -export interface PoolToGaugesSDKType { +export interface ConcentratedPoolToNoLockGaugesSDKType { pool_to_gauge: PoolToGaugeSDKType[]; } function createBaseParams(): Params { @@ -162,9 +179,11 @@ export const Params = { return message; }, fromAmino(object: ParamsAmino): Params { - return { - mintedDenom: object.minted_denom - }; + const message = createBaseParams(); + if (object.minted_denom !== undefined && object.minted_denom !== null) { + message.mintedDenom = object.minted_denom; + } + return message; }, toAmino(message: Params): ParamsAmino { const obj: any = {}; @@ -229,9 +248,9 @@ export const LockableDurationsInfo = { return message; }, fromAmino(object: LockableDurationsInfoAmino): LockableDurationsInfo { - return { - lockableDurations: Array.isArray(object?.lockable_durations) ? object.lockable_durations.map((e: any) => Duration.fromAmino(e)) : [] - }; + const message = createBaseLockableDurationsInfo(); + message.lockableDurations = object.lockable_durations?.map(e => Duration.fromAmino(e)) || []; + return message; }, toAmino(message: LockableDurationsInfo): LockableDurationsInfoAmino { const obj: any = {}; @@ -308,10 +327,12 @@ export const DistrInfo = { return message; }, fromAmino(object: DistrInfoAmino): DistrInfo { - return { - totalWeight: object.total_weight, - records: Array.isArray(object?.records) ? object.records.map((e: any) => DistrRecord.fromAmino(e)) : [] - }; + const message = createBaseDistrInfo(); + if (object.total_weight !== undefined && object.total_weight !== null) { + message.totalWeight = object.total_weight; + } + message.records = object.records?.map(e => DistrRecord.fromAmino(e)) || []; + return message; }, toAmino(message: DistrInfo): DistrInfoAmino { const obj: any = {}; @@ -389,10 +410,14 @@ export const DistrRecord = { return message; }, fromAmino(object: DistrRecordAmino): DistrRecord { - return { - gaugeId: BigInt(object.gauge_id), - weight: object.weight - }; + const message = createBaseDistrRecord(); + if (object.gauge_id !== undefined && object.gauge_id !== null) { + message.gaugeId = BigInt(object.gauge_id); + } + if (object.weight !== undefined && object.weight !== null) { + message.weight = object.weight; + } + return message; }, toAmino(message: DistrRecord): DistrRecordAmino { const obj: any = {}; @@ -474,11 +499,17 @@ export const PoolToGauge = { return message; }, fromAmino(object: PoolToGaugeAmino): PoolToGauge { - return { - poolId: BigInt(object.pool_id), - gaugeId: BigInt(object.gauge_id), - duration: object?.duration ? Duration.fromAmino(object.duration) : undefined - }; + const message = createBasePoolToGauge(); + if (object.pool_id !== undefined && object.pool_id !== null) { + message.poolId = BigInt(object.pool_id); + } + if (object.gauge_id !== undefined && object.gauge_id !== null) { + message.gaugeId = BigInt(object.gauge_id); + } + if (object.duration !== undefined && object.duration !== null) { + message.duration = Duration.fromAmino(object.duration); + } + return message; }, toAmino(message: PoolToGauge): PoolToGaugeAmino { const obj: any = {}; @@ -509,23 +540,23 @@ export const PoolToGauge = { }; } }; -function createBasePoolToGauges(): PoolToGauges { +function createBaseAnyPoolToInternalGauges(): AnyPoolToInternalGauges { return { poolToGauge: [] }; } -export const PoolToGauges = { - typeUrl: "/osmosis.poolincentives.v1beta1.PoolToGauges", - encode(message: PoolToGauges, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { +export const AnyPoolToInternalGauges = { + typeUrl: "/osmosis.poolincentives.v1beta1.AnyPoolToInternalGauges", + encode(message: AnyPoolToInternalGauges, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.poolToGauge) { PoolToGauge.encode(v!, writer.uint32(18).fork()).ldelim(); } return writer; }, - decode(input: BinaryReader | Uint8Array, length?: number): PoolToGauges { + decode(input: BinaryReader | Uint8Array, length?: number): AnyPoolToInternalGauges { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBasePoolToGauges(); + const message = createBaseAnyPoolToInternalGauges(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -539,17 +570,88 @@ export const PoolToGauges = { } return message; }, - fromPartial(object: Partial): PoolToGauges { - const message = createBasePoolToGauges(); + fromPartial(object: Partial): AnyPoolToInternalGauges { + const message = createBaseAnyPoolToInternalGauges(); message.poolToGauge = object.poolToGauge?.map(e => PoolToGauge.fromPartial(e)) || []; return message; }, - fromAmino(object: PoolToGaugesAmino): PoolToGauges { + fromAmino(object: AnyPoolToInternalGaugesAmino): AnyPoolToInternalGauges { + const message = createBaseAnyPoolToInternalGauges(); + message.poolToGauge = object.pool_to_gauge?.map(e => PoolToGauge.fromAmino(e)) || []; + return message; + }, + toAmino(message: AnyPoolToInternalGauges): AnyPoolToInternalGaugesAmino { + const obj: any = {}; + if (message.poolToGauge) { + obj.pool_to_gauge = message.poolToGauge.map(e => e ? PoolToGauge.toAmino(e) : undefined); + } else { + obj.pool_to_gauge = []; + } + return obj; + }, + fromAminoMsg(object: AnyPoolToInternalGaugesAminoMsg): AnyPoolToInternalGauges { + return AnyPoolToInternalGauges.fromAmino(object.value); + }, + toAminoMsg(message: AnyPoolToInternalGauges): AnyPoolToInternalGaugesAminoMsg { return { - poolToGauge: Array.isArray(object?.pool_to_gauge) ? object.pool_to_gauge.map((e: any) => PoolToGauge.fromAmino(e)) : [] + type: "osmosis/poolincentives/any-pool-to-internal-gauges", + value: AnyPoolToInternalGauges.toAmino(message) }; }, - toAmino(message: PoolToGauges): PoolToGaugesAmino { + fromProtoMsg(message: AnyPoolToInternalGaugesProtoMsg): AnyPoolToInternalGauges { + return AnyPoolToInternalGauges.decode(message.value); + }, + toProto(message: AnyPoolToInternalGauges): Uint8Array { + return AnyPoolToInternalGauges.encode(message).finish(); + }, + toProtoMsg(message: AnyPoolToInternalGauges): AnyPoolToInternalGaugesProtoMsg { + return { + typeUrl: "/osmosis.poolincentives.v1beta1.AnyPoolToInternalGauges", + value: AnyPoolToInternalGauges.encode(message).finish() + }; + } +}; +function createBaseConcentratedPoolToNoLockGauges(): ConcentratedPoolToNoLockGauges { + return { + poolToGauge: [] + }; +} +export const ConcentratedPoolToNoLockGauges = { + typeUrl: "/osmosis.poolincentives.v1beta1.ConcentratedPoolToNoLockGauges", + encode(message: ConcentratedPoolToNoLockGauges, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.poolToGauge) { + PoolToGauge.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): ConcentratedPoolToNoLockGauges { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseConcentratedPoolToNoLockGauges(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.poolToGauge.push(PoolToGauge.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): ConcentratedPoolToNoLockGauges { + const message = createBaseConcentratedPoolToNoLockGauges(); + message.poolToGauge = object.poolToGauge?.map(e => PoolToGauge.fromPartial(e)) || []; + return message; + }, + fromAmino(object: ConcentratedPoolToNoLockGaugesAmino): ConcentratedPoolToNoLockGauges { + const message = createBaseConcentratedPoolToNoLockGauges(); + message.poolToGauge = object.pool_to_gauge?.map(e => PoolToGauge.fromAmino(e)) || []; + return message; + }, + toAmino(message: ConcentratedPoolToNoLockGauges): ConcentratedPoolToNoLockGaugesAmino { const obj: any = {}; if (message.poolToGauge) { obj.pool_to_gauge = message.poolToGauge.map(e => e ? PoolToGauge.toAmino(e) : undefined); @@ -558,25 +660,25 @@ export const PoolToGauges = { } return obj; }, - fromAminoMsg(object: PoolToGaugesAminoMsg): PoolToGauges { - return PoolToGauges.fromAmino(object.value); + fromAminoMsg(object: ConcentratedPoolToNoLockGaugesAminoMsg): ConcentratedPoolToNoLockGauges { + return ConcentratedPoolToNoLockGauges.fromAmino(object.value); }, - toAminoMsg(message: PoolToGauges): PoolToGaugesAminoMsg { + toAminoMsg(message: ConcentratedPoolToNoLockGauges): ConcentratedPoolToNoLockGaugesAminoMsg { return { - type: "osmosis/poolincentives/pool-to-gauges", - value: PoolToGauges.toAmino(message) + type: "osmosis/poolincentives/concentrated-pool-to-no-lock-gauges", + value: ConcentratedPoolToNoLockGauges.toAmino(message) }; }, - fromProtoMsg(message: PoolToGaugesProtoMsg): PoolToGauges { - return PoolToGauges.decode(message.value); + fromProtoMsg(message: ConcentratedPoolToNoLockGaugesProtoMsg): ConcentratedPoolToNoLockGauges { + return ConcentratedPoolToNoLockGauges.decode(message.value); }, - toProto(message: PoolToGauges): Uint8Array { - return PoolToGauges.encode(message).finish(); + toProto(message: ConcentratedPoolToNoLockGauges): Uint8Array { + return ConcentratedPoolToNoLockGauges.encode(message).finish(); }, - toProtoMsg(message: PoolToGauges): PoolToGaugesProtoMsg { + toProtoMsg(message: ConcentratedPoolToNoLockGauges): ConcentratedPoolToNoLockGaugesProtoMsg { return { - typeUrl: "/osmosis.poolincentives.v1beta1.PoolToGauges", - value: PoolToGauges.encode(message).finish() + typeUrl: "/osmosis.poolincentives.v1beta1.ConcentratedPoolToNoLockGauges", + value: ConcentratedPoolToNoLockGauges.encode(message).finish() }; } }; \ No newline at end of file diff --git a/packages/osmo-query/src/codegen/osmosis/pool-incentives/v1beta1/query.lcd.ts b/packages/osmo-query/src/codegen/osmosis/poolincentives/v1beta1/query.lcd.ts similarity index 100% rename from packages/osmo-query/src/codegen/osmosis/pool-incentives/v1beta1/query.lcd.ts rename to packages/osmo-query/src/codegen/osmosis/poolincentives/v1beta1/query.lcd.ts diff --git a/packages/osmo-query/src/codegen/osmosis/pool-incentives/v1beta1/query.rpc.Query.ts b/packages/osmo-query/src/codegen/osmosis/poolincentives/v1beta1/query.rpc.Query.ts similarity index 100% rename from packages/osmo-query/src/codegen/osmosis/pool-incentives/v1beta1/query.rpc.Query.ts rename to packages/osmo-query/src/codegen/osmosis/poolincentives/v1beta1/query.rpc.Query.ts diff --git a/packages/osmo-query/src/codegen/osmosis/pool-incentives/v1beta1/query.ts b/packages/osmo-query/src/codegen/osmosis/poolincentives/v1beta1/query.ts similarity index 93% rename from packages/osmo-query/src/codegen/osmosis/pool-incentives/v1beta1/query.ts rename to packages/osmo-query/src/codegen/osmosis/poolincentives/v1beta1/query.ts index f9bc78851..2cacd2641 100644 --- a/packages/osmo-query/src/codegen/osmosis/pool-incentives/v1beta1/query.ts +++ b/packages/osmo-query/src/codegen/osmosis/poolincentives/v1beta1/query.ts @@ -10,7 +10,7 @@ export interface QueryGaugeIdsRequestProtoMsg { value: Uint8Array; } export interface QueryGaugeIdsRequestAmino { - pool_id: string; + pool_id?: string; } export interface QueryGaugeIdsRequestAminoMsg { type: "osmosis/poolincentives/query-gauge-ids-request"; @@ -27,7 +27,7 @@ export interface QueryGaugeIdsResponseProtoMsg { value: Uint8Array; } export interface QueryGaugeIdsResponseAmino { - gauge_ids_with_duration: QueryGaugeIdsResponse_GaugeIdWithDurationAmino[]; + gauge_ids_with_duration?: QueryGaugeIdsResponse_GaugeIdWithDurationAmino[]; } export interface QueryGaugeIdsResponseAminoMsg { type: "osmosis/poolincentives/query-gauge-ids-response"; @@ -46,9 +46,9 @@ export interface QueryGaugeIdsResponse_GaugeIdWithDurationProtoMsg { value: Uint8Array; } export interface QueryGaugeIdsResponse_GaugeIdWithDurationAmino { - gauge_id: string; + gauge_id?: string; duration?: DurationAmino; - gauge_incentive_percentage: string; + gauge_incentive_percentage?: string; } export interface QueryGaugeIdsResponse_GaugeIdWithDurationAminoMsg { type: "osmosis/poolincentives/gauge-id-with-duration"; @@ -134,7 +134,7 @@ export interface QueryLockableDurationsResponseProtoMsg { value: Uint8Array; } export interface QueryLockableDurationsResponseAmino { - lockable_durations: DurationAmino[]; + lockable_durations?: DurationAmino[]; } export interface QueryLockableDurationsResponseAminoMsg { type: "osmosis/poolincentives/query-lockable-durations-response"; @@ -164,9 +164,9 @@ export interface IncentivizedPoolProtoMsg { value: Uint8Array; } export interface IncentivizedPoolAmino { - pool_id: string; + pool_id?: string; lockable_duration?: DurationAmino; - gauge_id: string; + gauge_id?: string; } export interface IncentivizedPoolAminoMsg { type: "osmosis/poolincentives/incentivized-pool"; @@ -185,7 +185,7 @@ export interface QueryIncentivizedPoolsResponseProtoMsg { value: Uint8Array; } export interface QueryIncentivizedPoolsResponseAmino { - incentivized_pools: IncentivizedPoolAmino[]; + incentivized_pools?: IncentivizedPoolAmino[]; } export interface QueryIncentivizedPoolsResponseAminoMsg { type: "osmosis/poolincentives/query-incentivized-pools-response"; @@ -213,7 +213,7 @@ export interface QueryExternalIncentiveGaugesResponseProtoMsg { value: Uint8Array; } export interface QueryExternalIncentiveGaugesResponseAmino { - data: GaugeAmino[]; + data?: GaugeAmino[]; } export interface QueryExternalIncentiveGaugesResponseAminoMsg { type: "osmosis/poolincentives/query-external-incentive-gauges-response"; @@ -258,9 +258,11 @@ export const QueryGaugeIdsRequest = { return message; }, fromAmino(object: QueryGaugeIdsRequestAmino): QueryGaugeIdsRequest { - return { - poolId: BigInt(object.pool_id) - }; + const message = createBaseQueryGaugeIdsRequest(); + if (object.pool_id !== undefined && object.pool_id !== null) { + message.poolId = BigInt(object.pool_id); + } + return message; }, toAmino(message: QueryGaugeIdsRequest): QueryGaugeIdsRequestAmino { const obj: any = {}; @@ -325,9 +327,9 @@ export const QueryGaugeIdsResponse = { return message; }, fromAmino(object: QueryGaugeIdsResponseAmino): QueryGaugeIdsResponse { - return { - gaugeIdsWithDuration: Array.isArray(object?.gauge_ids_with_duration) ? object.gauge_ids_with_duration.map((e: any) => QueryGaugeIdsResponse_GaugeIdWithDuration.fromAmino(e)) : [] - }; + const message = createBaseQueryGaugeIdsResponse(); + message.gaugeIdsWithDuration = object.gauge_ids_with_duration?.map(e => QueryGaugeIdsResponse_GaugeIdWithDuration.fromAmino(e)) || []; + return message; }, toAmino(message: QueryGaugeIdsResponse): QueryGaugeIdsResponseAmino { const obj: any = {}; @@ -412,11 +414,17 @@ export const QueryGaugeIdsResponse_GaugeIdWithDuration = { return message; }, fromAmino(object: QueryGaugeIdsResponse_GaugeIdWithDurationAmino): QueryGaugeIdsResponse_GaugeIdWithDuration { - return { - gaugeId: BigInt(object.gauge_id), - duration: object?.duration ? Duration.fromAmino(object.duration) : undefined, - gaugeIncentivePercentage: object.gauge_incentive_percentage - }; + const message = createBaseQueryGaugeIdsResponse_GaugeIdWithDuration(); + if (object.gauge_id !== undefined && object.gauge_id !== null) { + message.gaugeId = BigInt(object.gauge_id); + } + if (object.duration !== undefined && object.duration !== null) { + message.duration = Duration.fromAmino(object.duration); + } + if (object.gauge_incentive_percentage !== undefined && object.gauge_incentive_percentage !== null) { + message.gaugeIncentivePercentage = object.gauge_incentive_percentage; + } + return message; }, toAmino(message: QueryGaugeIdsResponse_GaugeIdWithDuration): QueryGaugeIdsResponse_GaugeIdWithDurationAmino { const obj: any = {}; @@ -474,7 +482,8 @@ export const QueryDistrInfoRequest = { return message; }, fromAmino(_: QueryDistrInfoRequestAmino): QueryDistrInfoRequest { - return {}; + const message = createBaseQueryDistrInfoRequest(); + return message; }, toAmino(_: QueryDistrInfoRequest): QueryDistrInfoRequestAmino { const obj: any = {}; @@ -538,9 +547,11 @@ export const QueryDistrInfoResponse = { return message; }, fromAmino(object: QueryDistrInfoResponseAmino): QueryDistrInfoResponse { - return { - distrInfo: object?.distr_info ? DistrInfo.fromAmino(object.distr_info) : undefined - }; + const message = createBaseQueryDistrInfoResponse(); + if (object.distr_info !== undefined && object.distr_info !== null) { + message.distrInfo = DistrInfo.fromAmino(object.distr_info); + } + return message; }, toAmino(message: QueryDistrInfoResponse): QueryDistrInfoResponseAmino { const obj: any = {}; @@ -596,7 +607,8 @@ export const QueryParamsRequest = { return message; }, fromAmino(_: QueryParamsRequestAmino): QueryParamsRequest { - return {}; + const message = createBaseQueryParamsRequest(); + return message; }, toAmino(_: QueryParamsRequest): QueryParamsRequestAmino { const obj: any = {}; @@ -660,9 +672,11 @@ export const QueryParamsResponse = { return message; }, fromAmino(object: QueryParamsResponseAmino): QueryParamsResponse { - return { - params: object?.params ? Params.fromAmino(object.params) : undefined - }; + const message = createBaseQueryParamsResponse(); + if (object.params !== undefined && object.params !== null) { + message.params = Params.fromAmino(object.params); + } + return message; }, toAmino(message: QueryParamsResponse): QueryParamsResponseAmino { const obj: any = {}; @@ -718,7 +732,8 @@ export const QueryLockableDurationsRequest = { return message; }, fromAmino(_: QueryLockableDurationsRequestAmino): QueryLockableDurationsRequest { - return {}; + const message = createBaseQueryLockableDurationsRequest(); + return message; }, toAmino(_: QueryLockableDurationsRequest): QueryLockableDurationsRequestAmino { const obj: any = {}; @@ -782,9 +797,9 @@ export const QueryLockableDurationsResponse = { return message; }, fromAmino(object: QueryLockableDurationsResponseAmino): QueryLockableDurationsResponse { - return { - lockableDurations: Array.isArray(object?.lockable_durations) ? object.lockable_durations.map((e: any) => Duration.fromAmino(e)) : [] - }; + const message = createBaseQueryLockableDurationsResponse(); + message.lockableDurations = object.lockable_durations?.map(e => Duration.fromAmino(e)) || []; + return message; }, toAmino(message: QueryLockableDurationsResponse): QueryLockableDurationsResponseAmino { const obj: any = {}; @@ -844,7 +859,8 @@ export const QueryIncentivizedPoolsRequest = { return message; }, fromAmino(_: QueryIncentivizedPoolsRequestAmino): QueryIncentivizedPoolsRequest { - return {}; + const message = createBaseQueryIncentivizedPoolsRequest(); + return message; }, toAmino(_: QueryIncentivizedPoolsRequest): QueryIncentivizedPoolsRequestAmino { const obj: any = {}; @@ -924,11 +940,17 @@ export const IncentivizedPool = { return message; }, fromAmino(object: IncentivizedPoolAmino): IncentivizedPool { - return { - poolId: BigInt(object.pool_id), - lockableDuration: object?.lockable_duration ? Duration.fromAmino(object.lockable_duration) : undefined, - gaugeId: BigInt(object.gauge_id) - }; + const message = createBaseIncentivizedPool(); + if (object.pool_id !== undefined && object.pool_id !== null) { + message.poolId = BigInt(object.pool_id); + } + if (object.lockable_duration !== undefined && object.lockable_duration !== null) { + message.lockableDuration = Duration.fromAmino(object.lockable_duration); + } + if (object.gauge_id !== undefined && object.gauge_id !== null) { + message.gaugeId = BigInt(object.gauge_id); + } + return message; }, toAmino(message: IncentivizedPool): IncentivizedPoolAmino { const obj: any = {}; @@ -995,9 +1017,9 @@ export const QueryIncentivizedPoolsResponse = { return message; }, fromAmino(object: QueryIncentivizedPoolsResponseAmino): QueryIncentivizedPoolsResponse { - return { - incentivizedPools: Array.isArray(object?.incentivized_pools) ? object.incentivized_pools.map((e: any) => IncentivizedPool.fromAmino(e)) : [] - }; + const message = createBaseQueryIncentivizedPoolsResponse(); + message.incentivizedPools = object.incentivized_pools?.map(e => IncentivizedPool.fromAmino(e)) || []; + return message; }, toAmino(message: QueryIncentivizedPoolsResponse): QueryIncentivizedPoolsResponseAmino { const obj: any = {}; @@ -1057,7 +1079,8 @@ export const QueryExternalIncentiveGaugesRequest = { return message; }, fromAmino(_: QueryExternalIncentiveGaugesRequestAmino): QueryExternalIncentiveGaugesRequest { - return {}; + const message = createBaseQueryExternalIncentiveGaugesRequest(); + return message; }, toAmino(_: QueryExternalIncentiveGaugesRequest): QueryExternalIncentiveGaugesRequestAmino { const obj: any = {}; @@ -1121,9 +1144,9 @@ export const QueryExternalIncentiveGaugesResponse = { return message; }, fromAmino(object: QueryExternalIncentiveGaugesResponseAmino): QueryExternalIncentiveGaugesResponse { - return { - data: Array.isArray(object?.data) ? object.data.map((e: any) => Gauge.fromAmino(e)) : [] - }; + const message = createBaseQueryExternalIncentiveGaugesResponse(); + message.data = object.data?.map(e => Gauge.fromAmino(e)) || []; + return message; }, toAmino(message: QueryExternalIncentiveGaugesResponse): QueryExternalIncentiveGaugesResponseAmino { const obj: any = {}; diff --git a/packages/osmojs/src/codegen/osmosis/pool-incentives/v1beta1/shared.ts b/packages/osmo-query/src/codegen/osmosis/poolincentives/v1beta1/shared.ts similarity index 92% rename from packages/osmojs/src/codegen/osmosis/pool-incentives/v1beta1/shared.ts rename to packages/osmo-query/src/codegen/osmosis/poolincentives/v1beta1/shared.ts index b6274a302..a7b523cb4 100644 --- a/packages/osmojs/src/codegen/osmosis/pool-incentives/v1beta1/shared.ts +++ b/packages/osmo-query/src/codegen/osmosis/poolincentives/v1beta1/shared.ts @@ -21,7 +21,7 @@ export interface MigrationRecordsProtoMsg { * the circular dependency between the two modules. */ export interface MigrationRecordsAmino { - balancer_to_concentrated_pool_links: BalancerToConcentratedPoolLinkAmino[]; + balancer_to_concentrated_pool_links?: BalancerToConcentratedPoolLinkAmino[]; } export interface MigrationRecordsAminoMsg { type: "osmosis/poolincentives/migration-records"; @@ -68,8 +68,8 @@ export interface BalancerToConcentratedPoolLinkProtoMsg { * the circular dependency between the two modules. */ export interface BalancerToConcentratedPoolLinkAmino { - balancer_pool_id: string; - cl_pool_id: string; + balancer_pool_id?: string; + cl_pool_id?: string; } export interface BalancerToConcentratedPoolLinkAminoMsg { type: "osmosis/poolincentives/balancer-to-concentrated-pool-link"; @@ -126,9 +126,9 @@ export const MigrationRecords = { return message; }, fromAmino(object: MigrationRecordsAmino): MigrationRecords { - return { - balancerToConcentratedPoolLinks: Array.isArray(object?.balancer_to_concentrated_pool_links) ? object.balancer_to_concentrated_pool_links.map((e: any) => BalancerToConcentratedPoolLink.fromAmino(e)) : [] - }; + const message = createBaseMigrationRecords(); + message.balancerToConcentratedPoolLinks = object.balancer_to_concentrated_pool_links?.map(e => BalancerToConcentratedPoolLink.fromAmino(e)) || []; + return message; }, toAmino(message: MigrationRecords): MigrationRecordsAmino { const obj: any = {}; @@ -205,10 +205,14 @@ export const BalancerToConcentratedPoolLink = { return message; }, fromAmino(object: BalancerToConcentratedPoolLinkAmino): BalancerToConcentratedPoolLink { - return { - balancerPoolId: BigInt(object.balancer_pool_id), - clPoolId: BigInt(object.cl_pool_id) - }; + const message = createBaseBalancerToConcentratedPoolLink(); + if (object.balancer_pool_id !== undefined && object.balancer_pool_id !== null) { + message.balancerPoolId = BigInt(object.balancer_pool_id); + } + if (object.cl_pool_id !== undefined && object.cl_pool_id !== null) { + message.clPoolId = BigInt(object.cl_pool_id); + } + return message; }, toAmino(message: BalancerToConcentratedPoolLink): BalancerToConcentratedPoolLinkAmino { const obj: any = {}; diff --git a/packages/osmo-query/src/codegen/osmosis/poolmanager/v1beta1/genesis.ts b/packages/osmo-query/src/codegen/osmosis/poolmanager/v1beta1/genesis.ts index cbac17cc6..20436e3c3 100644 --- a/packages/osmo-query/src/codegen/osmosis/poolmanager/v1beta1/genesis.ts +++ b/packages/osmo-query/src/codegen/osmosis/poolmanager/v1beta1/genesis.ts @@ -1,9 +1,24 @@ import { Coin, CoinAmino, CoinSDKType } from "../../../cosmos/base/v1beta1/coin"; import { ModuleRoute, ModuleRouteAmino, ModuleRouteSDKType } from "./module_route"; +import { DenomPairTakerFee, DenomPairTakerFeeAmino, DenomPairTakerFeeSDKType } from "./tx"; import { BinaryReader, BinaryWriter } from "../../../binary"; +import { Decimal } from "@cosmjs/math"; /** Params holds parameters for the poolmanager module */ export interface Params { poolCreationFee: Coin[]; + /** taker_fee_params is the container of taker fee parameters. */ + takerFeeParams: TakerFeeParams; + /** + * authorized_quote_denoms is a list of quote denoms that can be used as + * token1 when creating a concentrated pool. We limit the quote assets to a + * small set for the purposes of having convenient price increments stemming + * from tick to price conversion. These increments are in a human readable + * magnitude only for token1 as a quote. For limit orders in the future, this + * will be a desirable property in terms of UX as to allow users to set limit + * orders at prices in terms of token1 (quote asset) that are easy to reason + * about. + */ + authorizedQuoteDenoms: string[]; } export interface ParamsProtoMsg { typeUrl: "/osmosis.poolmanager.v1beta1.Params"; @@ -11,7 +26,20 @@ export interface ParamsProtoMsg { } /** Params holds parameters for the poolmanager module */ export interface ParamsAmino { - pool_creation_fee: CoinAmino[]; + pool_creation_fee?: CoinAmino[]; + /** taker_fee_params is the container of taker fee parameters. */ + taker_fee_params?: TakerFeeParamsAmino; + /** + * authorized_quote_denoms is a list of quote denoms that can be used as + * token1 when creating a concentrated pool. We limit the quote assets to a + * small set for the purposes of having convenient price increments stemming + * from tick to price conversion. These increments are in a human readable + * magnitude only for token1 as a quote. For limit orders in the future, this + * will be a desirable property in terms of UX as to allow users to set limit + * orders at prices in terms of token1 (quote asset) that are easy to reason + * about. + */ + authorized_quote_denoms?: string[]; } export interface ParamsAminoMsg { type: "osmosis/poolmanager/params"; @@ -20,6 +48,8 @@ export interface ParamsAminoMsg { /** Params holds parameters for the poolmanager module */ export interface ParamsSDKType { pool_creation_fee: CoinSDKType[]; + taker_fee_params: TakerFeeParamsSDKType; + authorized_quote_denoms: string[]; } /** GenesisState defines the poolmanager module's genesis state. */ export interface GenesisState { @@ -29,6 +59,10 @@ export interface GenesisState { params: Params; /** pool_routes is the container of the mappings from pool id to pool type. */ poolRoutes: ModuleRoute[]; + /** KVStore state */ + takerFeesTracker?: TakerFeesTracker; + poolVolumes: PoolVolume[]; + denomPairTakerFeeStore: DenomPairTakerFee[]; } export interface GenesisStateProtoMsg { typeUrl: "/osmosis.poolmanager.v1beta1.GenesisState"; @@ -37,11 +71,15 @@ export interface GenesisStateProtoMsg { /** GenesisState defines the poolmanager module's genesis state. */ export interface GenesisStateAmino { /** the next_pool_id */ - next_pool_id: string; + next_pool_id?: string; /** params is the container of poolmanager parameters. */ params?: ParamsAmino; /** pool_routes is the container of the mappings from pool id to pool type. */ - pool_routes: ModuleRouteAmino[]; + pool_routes?: ModuleRouteAmino[]; + /** KVStore state */ + taker_fees_tracker?: TakerFeesTrackerAmino; + pool_volumes?: PoolVolumeAmino[]; + denom_pair_taker_fee_store?: DenomPairTakerFeeAmino[]; } export interface GenesisStateAminoMsg { type: "osmosis/poolmanager/genesis-state"; @@ -52,10 +90,227 @@ export interface GenesisStateSDKType { next_pool_id: bigint; params: ParamsSDKType; pool_routes: ModuleRouteSDKType[]; + taker_fees_tracker?: TakerFeesTrackerSDKType; + pool_volumes: PoolVolumeSDKType[]; + denom_pair_taker_fee_store: DenomPairTakerFeeSDKType[]; +} +/** TakerFeeParams consolidates the taker fee parameters for the poolmanager. */ +export interface TakerFeeParams { + /** + * default_taker_fee is the fee used when creating a new pool that doesn't + * fall under a custom pool taker fee or stableswap taker fee category. + */ + defaultTakerFee: string; + /** + * osmo_taker_fee_distribution defines the distribution of taker fees + * generated in OSMO. As of this writing, it has two categories: + * - staking_rewards: the percent of the taker fee that gets distributed to + * stakers. + * - community_pool: the percent of the taker fee that gets sent to the + * community pool. + */ + osmoTakerFeeDistribution: TakerFeeDistributionPercentage; + /** + * non_osmo_taker_fee_distribution defines the distribution of taker fees + * generated in non-OSMO. As of this writing, it has two categories: + * - staking_rewards: the percent of the taker fee that gets swapped to OSMO + * and then distributed to stakers. + * - community_pool: the percent of the taker fee that gets sent to the + * community pool. Note: If the non-OSMO asset is an authorized_quote_denom, + * that denom is sent directly to the community pool. Otherwise, it is + * swapped to the community_pool_denom_to_swap_non_whitelisted_assets_to and + * then sent to the community pool as that denom. + */ + nonOsmoTakerFeeDistribution: TakerFeeDistributionPercentage; + /** + * admin_addresses is a list of addresses that are allowed to set and remove + * custom taker fees for denom pairs. Governance also has the ability to set + * and remove custom taker fees for denom pairs, but with the normal + * governance delay. + */ + adminAddresses: string[]; + /** + * community_pool_denom_to_swap_non_whitelisted_assets_to is the denom that + * non-whitelisted taker fees will be swapped to before being sent to + * the community pool. + */ + communityPoolDenomToSwapNonWhitelistedAssetsTo: string; + /** + * reduced_fee_whitelist is a list of addresses that are + * allowed to pay a reduce taker fee when performing a swap + * (i.e. swap without paying the taker fee). + * It is intended to be used for integrators who meet qualifying factors + * that are approved by governance. + * Initially, the taker fee is allowed to be bypassed completely. However + * In the future, we will charge a reduced taker fee instead of no fee at all. + */ + reducedFeeWhitelist: string[]; +} +export interface TakerFeeParamsProtoMsg { + typeUrl: "/osmosis.poolmanager.v1beta1.TakerFeeParams"; + value: Uint8Array; +} +/** TakerFeeParams consolidates the taker fee parameters for the poolmanager. */ +export interface TakerFeeParamsAmino { + /** + * default_taker_fee is the fee used when creating a new pool that doesn't + * fall under a custom pool taker fee or stableswap taker fee category. + */ + default_taker_fee?: string; + /** + * osmo_taker_fee_distribution defines the distribution of taker fees + * generated in OSMO. As of this writing, it has two categories: + * - staking_rewards: the percent of the taker fee that gets distributed to + * stakers. + * - community_pool: the percent of the taker fee that gets sent to the + * community pool. + */ + osmo_taker_fee_distribution?: TakerFeeDistributionPercentageAmino; + /** + * non_osmo_taker_fee_distribution defines the distribution of taker fees + * generated in non-OSMO. As of this writing, it has two categories: + * - staking_rewards: the percent of the taker fee that gets swapped to OSMO + * and then distributed to stakers. + * - community_pool: the percent of the taker fee that gets sent to the + * community pool. Note: If the non-OSMO asset is an authorized_quote_denom, + * that denom is sent directly to the community pool. Otherwise, it is + * swapped to the community_pool_denom_to_swap_non_whitelisted_assets_to and + * then sent to the community pool as that denom. + */ + non_osmo_taker_fee_distribution?: TakerFeeDistributionPercentageAmino; + /** + * admin_addresses is a list of addresses that are allowed to set and remove + * custom taker fees for denom pairs. Governance also has the ability to set + * and remove custom taker fees for denom pairs, but with the normal + * governance delay. + */ + admin_addresses?: string[]; + /** + * community_pool_denom_to_swap_non_whitelisted_assets_to is the denom that + * non-whitelisted taker fees will be swapped to before being sent to + * the community pool. + */ + community_pool_denom_to_swap_non_whitelisted_assets_to?: string; + /** + * reduced_fee_whitelist is a list of addresses that are + * allowed to pay a reduce taker fee when performing a swap + * (i.e. swap without paying the taker fee). + * It is intended to be used for integrators who meet qualifying factors + * that are approved by governance. + * Initially, the taker fee is allowed to be bypassed completely. However + * In the future, we will charge a reduced taker fee instead of no fee at all. + */ + reduced_fee_whitelist?: string[]; +} +export interface TakerFeeParamsAminoMsg { + type: "osmosis/poolmanager/taker-fee-params"; + value: TakerFeeParamsAmino; +} +/** TakerFeeParams consolidates the taker fee parameters for the poolmanager. */ +export interface TakerFeeParamsSDKType { + default_taker_fee: string; + osmo_taker_fee_distribution: TakerFeeDistributionPercentageSDKType; + non_osmo_taker_fee_distribution: TakerFeeDistributionPercentageSDKType; + admin_addresses: string[]; + community_pool_denom_to_swap_non_whitelisted_assets_to: string; + reduced_fee_whitelist: string[]; +} +/** + * TakerFeeDistributionPercentage defines what percent of the taker fee category + * gets distributed to the available categories. + */ +export interface TakerFeeDistributionPercentage { + stakingRewards: string; + communityPool: string; +} +export interface TakerFeeDistributionPercentageProtoMsg { + typeUrl: "/osmosis.poolmanager.v1beta1.TakerFeeDistributionPercentage"; + value: Uint8Array; +} +/** + * TakerFeeDistributionPercentage defines what percent of the taker fee category + * gets distributed to the available categories. + */ +export interface TakerFeeDistributionPercentageAmino { + staking_rewards?: string; + community_pool?: string; +} +export interface TakerFeeDistributionPercentageAminoMsg { + type: "osmosis/poolmanager/taker-fee-distribution-percentage"; + value: TakerFeeDistributionPercentageAmino; +} +/** + * TakerFeeDistributionPercentage defines what percent of the taker fee category + * gets distributed to the available categories. + */ +export interface TakerFeeDistributionPercentageSDKType { + staking_rewards: string; + community_pool: string; +} +export interface TakerFeesTracker { + takerFeesToStakers: Coin[]; + takerFeesToCommunityPool: Coin[]; + heightAccountingStartsFrom: bigint; +} +export interface TakerFeesTrackerProtoMsg { + typeUrl: "/osmosis.poolmanager.v1beta1.TakerFeesTracker"; + value: Uint8Array; +} +export interface TakerFeesTrackerAmino { + taker_fees_to_stakers?: CoinAmino[]; + taker_fees_to_community_pool?: CoinAmino[]; + height_accounting_starts_from?: string; +} +export interface TakerFeesTrackerAminoMsg { + type: "osmosis/poolmanager/taker-fees-tracker"; + value: TakerFeesTrackerAmino; +} +export interface TakerFeesTrackerSDKType { + taker_fees_to_stakers: CoinSDKType[]; + taker_fees_to_community_pool: CoinSDKType[]; + height_accounting_starts_from: bigint; +} +/** + * PoolVolume stores the KVStore entries for each pool's volume, which + * is used in export/import genesis. + */ +export interface PoolVolume { + /** pool_id is the id of the pool. */ + poolId: bigint; + /** pool_volume is the cumulative volume of the pool. */ + poolVolume: Coin[]; +} +export interface PoolVolumeProtoMsg { + typeUrl: "/osmosis.poolmanager.v1beta1.PoolVolume"; + value: Uint8Array; +} +/** + * PoolVolume stores the KVStore entries for each pool's volume, which + * is used in export/import genesis. + */ +export interface PoolVolumeAmino { + /** pool_id is the id of the pool. */ + pool_id?: string; + /** pool_volume is the cumulative volume of the pool. */ + pool_volume?: CoinAmino[]; +} +export interface PoolVolumeAminoMsg { + type: "osmosis/poolmanager/pool-volume"; + value: PoolVolumeAmino; +} +/** + * PoolVolume stores the KVStore entries for each pool's volume, which + * is used in export/import genesis. + */ +export interface PoolVolumeSDKType { + pool_id: bigint; + pool_volume: CoinSDKType[]; } function createBaseParams(): Params { return { - poolCreationFee: [] + poolCreationFee: [], + takerFeeParams: TakerFeeParams.fromPartial({}), + authorizedQuoteDenoms: [] }; } export const Params = { @@ -64,6 +319,12 @@ export const Params = { for (const v of message.poolCreationFee) { Coin.encode(v!, writer.uint32(10).fork()).ldelim(); } + if (message.takerFeeParams !== undefined) { + TakerFeeParams.encode(message.takerFeeParams, writer.uint32(18).fork()).ldelim(); + } + for (const v of message.authorizedQuoteDenoms) { + writer.uint32(26).string(v!); + } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): Params { @@ -76,6 +337,12 @@ export const Params = { case 1: message.poolCreationFee.push(Coin.decode(reader, reader.uint32())); break; + case 2: + message.takerFeeParams = TakerFeeParams.decode(reader, reader.uint32()); + break; + case 3: + message.authorizedQuoteDenoms.push(reader.string()); + break; default: reader.skipType(tag & 7); break; @@ -86,12 +353,18 @@ export const Params = { fromPartial(object: Partial): Params { const message = createBaseParams(); message.poolCreationFee = object.poolCreationFee?.map(e => Coin.fromPartial(e)) || []; + message.takerFeeParams = object.takerFeeParams !== undefined && object.takerFeeParams !== null ? TakerFeeParams.fromPartial(object.takerFeeParams) : undefined; + message.authorizedQuoteDenoms = object.authorizedQuoteDenoms?.map(e => e) || []; return message; }, fromAmino(object: ParamsAmino): Params { - return { - poolCreationFee: Array.isArray(object?.pool_creation_fee) ? object.pool_creation_fee.map((e: any) => Coin.fromAmino(e)) : [] - }; + const message = createBaseParams(); + message.poolCreationFee = object.pool_creation_fee?.map(e => Coin.fromAmino(e)) || []; + if (object.taker_fee_params !== undefined && object.taker_fee_params !== null) { + message.takerFeeParams = TakerFeeParams.fromAmino(object.taker_fee_params); + } + message.authorizedQuoteDenoms = object.authorized_quote_denoms?.map(e => e) || []; + return message; }, toAmino(message: Params): ParamsAmino { const obj: any = {}; @@ -100,6 +373,12 @@ export const Params = { } else { obj.pool_creation_fee = []; } + obj.taker_fee_params = message.takerFeeParams ? TakerFeeParams.toAmino(message.takerFeeParams) : undefined; + if (message.authorizedQuoteDenoms) { + obj.authorized_quote_denoms = message.authorizedQuoteDenoms.map(e => e); + } else { + obj.authorized_quote_denoms = []; + } return obj; }, fromAminoMsg(object: ParamsAminoMsg): Params { @@ -128,7 +407,10 @@ function createBaseGenesisState(): GenesisState { return { nextPoolId: BigInt(0), params: Params.fromPartial({}), - poolRoutes: [] + poolRoutes: [], + takerFeesTracker: undefined, + poolVolumes: [], + denomPairTakerFeeStore: [] }; } export const GenesisState = { @@ -143,6 +425,15 @@ export const GenesisState = { for (const v of message.poolRoutes) { ModuleRoute.encode(v!, writer.uint32(26).fork()).ldelim(); } + if (message.takerFeesTracker !== undefined) { + TakerFeesTracker.encode(message.takerFeesTracker, writer.uint32(34).fork()).ldelim(); + } + for (const v of message.poolVolumes) { + PoolVolume.encode(v!, writer.uint32(42).fork()).ldelim(); + } + for (const v of message.denomPairTakerFeeStore) { + DenomPairTakerFee.encode(v!, writer.uint32(50).fork()).ldelim(); + } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): GenesisState { @@ -161,6 +452,15 @@ export const GenesisState = { case 3: message.poolRoutes.push(ModuleRoute.decode(reader, reader.uint32())); break; + case 4: + message.takerFeesTracker = TakerFeesTracker.decode(reader, reader.uint32()); + break; + case 5: + message.poolVolumes.push(PoolVolume.decode(reader, reader.uint32())); + break; + case 6: + message.denomPairTakerFeeStore.push(DenomPairTakerFee.decode(reader, reader.uint32())); + break; default: reader.skipType(tag & 7); break; @@ -173,14 +473,26 @@ export const GenesisState = { message.nextPoolId = object.nextPoolId !== undefined && object.nextPoolId !== null ? BigInt(object.nextPoolId.toString()) : BigInt(0); message.params = object.params !== undefined && object.params !== null ? Params.fromPartial(object.params) : undefined; message.poolRoutes = object.poolRoutes?.map(e => ModuleRoute.fromPartial(e)) || []; + message.takerFeesTracker = object.takerFeesTracker !== undefined && object.takerFeesTracker !== null ? TakerFeesTracker.fromPartial(object.takerFeesTracker) : undefined; + message.poolVolumes = object.poolVolumes?.map(e => PoolVolume.fromPartial(e)) || []; + message.denomPairTakerFeeStore = object.denomPairTakerFeeStore?.map(e => DenomPairTakerFee.fromPartial(e)) || []; return message; }, fromAmino(object: GenesisStateAmino): GenesisState { - return { - nextPoolId: BigInt(object.next_pool_id), - params: object?.params ? Params.fromAmino(object.params) : undefined, - poolRoutes: Array.isArray(object?.pool_routes) ? object.pool_routes.map((e: any) => ModuleRoute.fromAmino(e)) : [] - }; + const message = createBaseGenesisState(); + if (object.next_pool_id !== undefined && object.next_pool_id !== null) { + message.nextPoolId = BigInt(object.next_pool_id); + } + if (object.params !== undefined && object.params !== null) { + message.params = Params.fromAmino(object.params); + } + message.poolRoutes = object.pool_routes?.map(e => ModuleRoute.fromAmino(e)) || []; + if (object.taker_fees_tracker !== undefined && object.taker_fees_tracker !== null) { + message.takerFeesTracker = TakerFeesTracker.fromAmino(object.taker_fees_tracker); + } + message.poolVolumes = object.pool_volumes?.map(e => PoolVolume.fromAmino(e)) || []; + message.denomPairTakerFeeStore = object.denom_pair_taker_fee_store?.map(e => DenomPairTakerFee.fromAmino(e)) || []; + return message; }, toAmino(message: GenesisState): GenesisStateAmino { const obj: any = {}; @@ -191,6 +503,17 @@ export const GenesisState = { } else { obj.pool_routes = []; } + obj.taker_fees_tracker = message.takerFeesTracker ? TakerFeesTracker.toAmino(message.takerFeesTracker) : undefined; + if (message.poolVolumes) { + obj.pool_volumes = message.poolVolumes.map(e => e ? PoolVolume.toAmino(e) : undefined); + } else { + obj.pool_volumes = []; + } + if (message.denomPairTakerFeeStore) { + obj.denom_pair_taker_fee_store = message.denomPairTakerFeeStore.map(e => e ? DenomPairTakerFee.toAmino(e) : undefined); + } else { + obj.denom_pair_taker_fee_store = []; + } return obj; }, fromAminoMsg(object: GenesisStateAminoMsg): GenesisState { @@ -214,4 +537,398 @@ export const GenesisState = { value: GenesisState.encode(message).finish() }; } +}; +function createBaseTakerFeeParams(): TakerFeeParams { + return { + defaultTakerFee: "", + osmoTakerFeeDistribution: TakerFeeDistributionPercentage.fromPartial({}), + nonOsmoTakerFeeDistribution: TakerFeeDistributionPercentage.fromPartial({}), + adminAddresses: [], + communityPoolDenomToSwapNonWhitelistedAssetsTo: "", + reducedFeeWhitelist: [] + }; +} +export const TakerFeeParams = { + typeUrl: "/osmosis.poolmanager.v1beta1.TakerFeeParams", + encode(message: TakerFeeParams, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.defaultTakerFee !== "") { + writer.uint32(10).string(Decimal.fromUserInput(message.defaultTakerFee, 18).atomics); + } + if (message.osmoTakerFeeDistribution !== undefined) { + TakerFeeDistributionPercentage.encode(message.osmoTakerFeeDistribution, writer.uint32(18).fork()).ldelim(); + } + if (message.nonOsmoTakerFeeDistribution !== undefined) { + TakerFeeDistributionPercentage.encode(message.nonOsmoTakerFeeDistribution, writer.uint32(26).fork()).ldelim(); + } + for (const v of message.adminAddresses) { + writer.uint32(34).string(v!); + } + if (message.communityPoolDenomToSwapNonWhitelistedAssetsTo !== "") { + writer.uint32(42).string(message.communityPoolDenomToSwapNonWhitelistedAssetsTo); + } + for (const v of message.reducedFeeWhitelist) { + writer.uint32(50).string(v!); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): TakerFeeParams { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseTakerFeeParams(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.defaultTakerFee = Decimal.fromAtomics(reader.string(), 18).toString(); + break; + case 2: + message.osmoTakerFeeDistribution = TakerFeeDistributionPercentage.decode(reader, reader.uint32()); + break; + case 3: + message.nonOsmoTakerFeeDistribution = TakerFeeDistributionPercentage.decode(reader, reader.uint32()); + break; + case 4: + message.adminAddresses.push(reader.string()); + break; + case 5: + message.communityPoolDenomToSwapNonWhitelistedAssetsTo = reader.string(); + break; + case 6: + message.reducedFeeWhitelist.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): TakerFeeParams { + const message = createBaseTakerFeeParams(); + message.defaultTakerFee = object.defaultTakerFee ?? ""; + message.osmoTakerFeeDistribution = object.osmoTakerFeeDistribution !== undefined && object.osmoTakerFeeDistribution !== null ? TakerFeeDistributionPercentage.fromPartial(object.osmoTakerFeeDistribution) : undefined; + message.nonOsmoTakerFeeDistribution = object.nonOsmoTakerFeeDistribution !== undefined && object.nonOsmoTakerFeeDistribution !== null ? TakerFeeDistributionPercentage.fromPartial(object.nonOsmoTakerFeeDistribution) : undefined; + message.adminAddresses = object.adminAddresses?.map(e => e) || []; + message.communityPoolDenomToSwapNonWhitelistedAssetsTo = object.communityPoolDenomToSwapNonWhitelistedAssetsTo ?? ""; + message.reducedFeeWhitelist = object.reducedFeeWhitelist?.map(e => e) || []; + return message; + }, + fromAmino(object: TakerFeeParamsAmino): TakerFeeParams { + const message = createBaseTakerFeeParams(); + if (object.default_taker_fee !== undefined && object.default_taker_fee !== null) { + message.defaultTakerFee = object.default_taker_fee; + } + if (object.osmo_taker_fee_distribution !== undefined && object.osmo_taker_fee_distribution !== null) { + message.osmoTakerFeeDistribution = TakerFeeDistributionPercentage.fromAmino(object.osmo_taker_fee_distribution); + } + if (object.non_osmo_taker_fee_distribution !== undefined && object.non_osmo_taker_fee_distribution !== null) { + message.nonOsmoTakerFeeDistribution = TakerFeeDistributionPercentage.fromAmino(object.non_osmo_taker_fee_distribution); + } + message.adminAddresses = object.admin_addresses?.map(e => e) || []; + if (object.community_pool_denom_to_swap_non_whitelisted_assets_to !== undefined && object.community_pool_denom_to_swap_non_whitelisted_assets_to !== null) { + message.communityPoolDenomToSwapNonWhitelistedAssetsTo = object.community_pool_denom_to_swap_non_whitelisted_assets_to; + } + message.reducedFeeWhitelist = object.reduced_fee_whitelist?.map(e => e) || []; + return message; + }, + toAmino(message: TakerFeeParams): TakerFeeParamsAmino { + const obj: any = {}; + obj.default_taker_fee = message.defaultTakerFee; + obj.osmo_taker_fee_distribution = message.osmoTakerFeeDistribution ? TakerFeeDistributionPercentage.toAmino(message.osmoTakerFeeDistribution) : undefined; + obj.non_osmo_taker_fee_distribution = message.nonOsmoTakerFeeDistribution ? TakerFeeDistributionPercentage.toAmino(message.nonOsmoTakerFeeDistribution) : undefined; + if (message.adminAddresses) { + obj.admin_addresses = message.adminAddresses.map(e => e); + } else { + obj.admin_addresses = []; + } + obj.community_pool_denom_to_swap_non_whitelisted_assets_to = message.communityPoolDenomToSwapNonWhitelistedAssetsTo; + if (message.reducedFeeWhitelist) { + obj.reduced_fee_whitelist = message.reducedFeeWhitelist.map(e => e); + } else { + obj.reduced_fee_whitelist = []; + } + return obj; + }, + fromAminoMsg(object: TakerFeeParamsAminoMsg): TakerFeeParams { + return TakerFeeParams.fromAmino(object.value); + }, + toAminoMsg(message: TakerFeeParams): TakerFeeParamsAminoMsg { + return { + type: "osmosis/poolmanager/taker-fee-params", + value: TakerFeeParams.toAmino(message) + }; + }, + fromProtoMsg(message: TakerFeeParamsProtoMsg): TakerFeeParams { + return TakerFeeParams.decode(message.value); + }, + toProto(message: TakerFeeParams): Uint8Array { + return TakerFeeParams.encode(message).finish(); + }, + toProtoMsg(message: TakerFeeParams): TakerFeeParamsProtoMsg { + return { + typeUrl: "/osmosis.poolmanager.v1beta1.TakerFeeParams", + value: TakerFeeParams.encode(message).finish() + }; + } +}; +function createBaseTakerFeeDistributionPercentage(): TakerFeeDistributionPercentage { + return { + stakingRewards: "", + communityPool: "" + }; +} +export const TakerFeeDistributionPercentage = { + typeUrl: "/osmosis.poolmanager.v1beta1.TakerFeeDistributionPercentage", + encode(message: TakerFeeDistributionPercentage, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.stakingRewards !== "") { + writer.uint32(10).string(Decimal.fromUserInput(message.stakingRewards, 18).atomics); + } + if (message.communityPool !== "") { + writer.uint32(18).string(Decimal.fromUserInput(message.communityPool, 18).atomics); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): TakerFeeDistributionPercentage { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseTakerFeeDistributionPercentage(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.stakingRewards = Decimal.fromAtomics(reader.string(), 18).toString(); + break; + case 2: + message.communityPool = Decimal.fromAtomics(reader.string(), 18).toString(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): TakerFeeDistributionPercentage { + const message = createBaseTakerFeeDistributionPercentage(); + message.stakingRewards = object.stakingRewards ?? ""; + message.communityPool = object.communityPool ?? ""; + return message; + }, + fromAmino(object: TakerFeeDistributionPercentageAmino): TakerFeeDistributionPercentage { + const message = createBaseTakerFeeDistributionPercentage(); + if (object.staking_rewards !== undefined && object.staking_rewards !== null) { + message.stakingRewards = object.staking_rewards; + } + if (object.community_pool !== undefined && object.community_pool !== null) { + message.communityPool = object.community_pool; + } + return message; + }, + toAmino(message: TakerFeeDistributionPercentage): TakerFeeDistributionPercentageAmino { + const obj: any = {}; + obj.staking_rewards = message.stakingRewards; + obj.community_pool = message.communityPool; + return obj; + }, + fromAminoMsg(object: TakerFeeDistributionPercentageAminoMsg): TakerFeeDistributionPercentage { + return TakerFeeDistributionPercentage.fromAmino(object.value); + }, + toAminoMsg(message: TakerFeeDistributionPercentage): TakerFeeDistributionPercentageAminoMsg { + return { + type: "osmosis/poolmanager/taker-fee-distribution-percentage", + value: TakerFeeDistributionPercentage.toAmino(message) + }; + }, + fromProtoMsg(message: TakerFeeDistributionPercentageProtoMsg): TakerFeeDistributionPercentage { + return TakerFeeDistributionPercentage.decode(message.value); + }, + toProto(message: TakerFeeDistributionPercentage): Uint8Array { + return TakerFeeDistributionPercentage.encode(message).finish(); + }, + toProtoMsg(message: TakerFeeDistributionPercentage): TakerFeeDistributionPercentageProtoMsg { + return { + typeUrl: "/osmosis.poolmanager.v1beta1.TakerFeeDistributionPercentage", + value: TakerFeeDistributionPercentage.encode(message).finish() + }; + } +}; +function createBaseTakerFeesTracker(): TakerFeesTracker { + return { + takerFeesToStakers: [], + takerFeesToCommunityPool: [], + heightAccountingStartsFrom: BigInt(0) + }; +} +export const TakerFeesTracker = { + typeUrl: "/osmosis.poolmanager.v1beta1.TakerFeesTracker", + encode(message: TakerFeesTracker, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.takerFeesToStakers) { + Coin.encode(v!, writer.uint32(10).fork()).ldelim(); + } + for (const v of message.takerFeesToCommunityPool) { + Coin.encode(v!, writer.uint32(18).fork()).ldelim(); + } + if (message.heightAccountingStartsFrom !== BigInt(0)) { + writer.uint32(24).int64(message.heightAccountingStartsFrom); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): TakerFeesTracker { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseTakerFeesTracker(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.takerFeesToStakers.push(Coin.decode(reader, reader.uint32())); + break; + case 2: + message.takerFeesToCommunityPool.push(Coin.decode(reader, reader.uint32())); + break; + case 3: + message.heightAccountingStartsFrom = reader.int64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): TakerFeesTracker { + const message = createBaseTakerFeesTracker(); + message.takerFeesToStakers = object.takerFeesToStakers?.map(e => Coin.fromPartial(e)) || []; + message.takerFeesToCommunityPool = object.takerFeesToCommunityPool?.map(e => Coin.fromPartial(e)) || []; + message.heightAccountingStartsFrom = object.heightAccountingStartsFrom !== undefined && object.heightAccountingStartsFrom !== null ? BigInt(object.heightAccountingStartsFrom.toString()) : BigInt(0); + return message; + }, + fromAmino(object: TakerFeesTrackerAmino): TakerFeesTracker { + const message = createBaseTakerFeesTracker(); + message.takerFeesToStakers = object.taker_fees_to_stakers?.map(e => Coin.fromAmino(e)) || []; + message.takerFeesToCommunityPool = object.taker_fees_to_community_pool?.map(e => Coin.fromAmino(e)) || []; + if (object.height_accounting_starts_from !== undefined && object.height_accounting_starts_from !== null) { + message.heightAccountingStartsFrom = BigInt(object.height_accounting_starts_from); + } + return message; + }, + toAmino(message: TakerFeesTracker): TakerFeesTrackerAmino { + const obj: any = {}; + if (message.takerFeesToStakers) { + obj.taker_fees_to_stakers = message.takerFeesToStakers.map(e => e ? Coin.toAmino(e) : undefined); + } else { + obj.taker_fees_to_stakers = []; + } + if (message.takerFeesToCommunityPool) { + obj.taker_fees_to_community_pool = message.takerFeesToCommunityPool.map(e => e ? Coin.toAmino(e) : undefined); + } else { + obj.taker_fees_to_community_pool = []; + } + obj.height_accounting_starts_from = message.heightAccountingStartsFrom ? message.heightAccountingStartsFrom.toString() : undefined; + return obj; + }, + fromAminoMsg(object: TakerFeesTrackerAminoMsg): TakerFeesTracker { + return TakerFeesTracker.fromAmino(object.value); + }, + toAminoMsg(message: TakerFeesTracker): TakerFeesTrackerAminoMsg { + return { + type: "osmosis/poolmanager/taker-fees-tracker", + value: TakerFeesTracker.toAmino(message) + }; + }, + fromProtoMsg(message: TakerFeesTrackerProtoMsg): TakerFeesTracker { + return TakerFeesTracker.decode(message.value); + }, + toProto(message: TakerFeesTracker): Uint8Array { + return TakerFeesTracker.encode(message).finish(); + }, + toProtoMsg(message: TakerFeesTracker): TakerFeesTrackerProtoMsg { + return { + typeUrl: "/osmosis.poolmanager.v1beta1.TakerFeesTracker", + value: TakerFeesTracker.encode(message).finish() + }; + } +}; +function createBasePoolVolume(): PoolVolume { + return { + poolId: BigInt(0), + poolVolume: [] + }; +} +export const PoolVolume = { + typeUrl: "/osmosis.poolmanager.v1beta1.PoolVolume", + encode(message: PoolVolume, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.poolId !== BigInt(0)) { + writer.uint32(8).uint64(message.poolId); + } + for (const v of message.poolVolume) { + Coin.encode(v!, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): PoolVolume { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBasePoolVolume(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.poolId = reader.uint64(); + break; + case 2: + message.poolVolume.push(Coin.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): PoolVolume { + const message = createBasePoolVolume(); + message.poolId = object.poolId !== undefined && object.poolId !== null ? BigInt(object.poolId.toString()) : BigInt(0); + message.poolVolume = object.poolVolume?.map(e => Coin.fromPartial(e)) || []; + return message; + }, + fromAmino(object: PoolVolumeAmino): PoolVolume { + const message = createBasePoolVolume(); + if (object.pool_id !== undefined && object.pool_id !== null) { + message.poolId = BigInt(object.pool_id); + } + message.poolVolume = object.pool_volume?.map(e => Coin.fromAmino(e)) || []; + return message; + }, + toAmino(message: PoolVolume): PoolVolumeAmino { + const obj: any = {}; + obj.pool_id = message.poolId ? message.poolId.toString() : undefined; + if (message.poolVolume) { + obj.pool_volume = message.poolVolume.map(e => e ? Coin.toAmino(e) : undefined); + } else { + obj.pool_volume = []; + } + return obj; + }, + fromAminoMsg(object: PoolVolumeAminoMsg): PoolVolume { + return PoolVolume.fromAmino(object.value); + }, + toAminoMsg(message: PoolVolume): PoolVolumeAminoMsg { + return { + type: "osmosis/poolmanager/pool-volume", + value: PoolVolume.toAmino(message) + }; + }, + fromProtoMsg(message: PoolVolumeProtoMsg): PoolVolume { + return PoolVolume.decode(message.value); + }, + toProto(message: PoolVolume): Uint8Array { + return PoolVolume.encode(message).finish(); + }, + toProtoMsg(message: PoolVolume): PoolVolumeProtoMsg { + return { + typeUrl: "/osmosis.poolmanager.v1beta1.PoolVolume", + value: PoolVolume.encode(message).finish() + }; + } }; \ No newline at end of file diff --git a/packages/osmo-query/src/codegen/osmosis/poolmanager/v1beta1/gov.ts b/packages/osmo-query/src/codegen/osmosis/poolmanager/v1beta1/gov.ts new file mode 100644 index 000000000..47c4d00a1 --- /dev/null +++ b/packages/osmo-query/src/codegen/osmosis/poolmanager/v1beta1/gov.ts @@ -0,0 +1,132 @@ +import { DenomPairTakerFee, DenomPairTakerFeeAmino, DenomPairTakerFeeSDKType } from "./tx"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +/** + * DenomPairTakerFeeProposal is a type for adding/removing a custom taker fee(s) + * for one or more denom pairs. + */ +export interface DenomPairTakerFeeProposal { + title: string; + description: string; + denomPairTakerFee: DenomPairTakerFee[]; +} +export interface DenomPairTakerFeeProposalProtoMsg { + typeUrl: "/osmosis.poolmanager.v1beta1.DenomPairTakerFeeProposal"; + value: Uint8Array; +} +/** + * DenomPairTakerFeeProposal is a type for adding/removing a custom taker fee(s) + * for one or more denom pairs. + */ +export interface DenomPairTakerFeeProposalAmino { + title?: string; + description?: string; + denom_pair_taker_fee?: DenomPairTakerFeeAmino[]; +} +export interface DenomPairTakerFeeProposalAminoMsg { + type: "osmosis/poolmanager/denom-pair-taker-fee-proposal"; + value: DenomPairTakerFeeProposalAmino; +} +/** + * DenomPairTakerFeeProposal is a type for adding/removing a custom taker fee(s) + * for one or more denom pairs. + */ +export interface DenomPairTakerFeeProposalSDKType { + title: string; + description: string; + denom_pair_taker_fee: DenomPairTakerFeeSDKType[]; +} +function createBaseDenomPairTakerFeeProposal(): DenomPairTakerFeeProposal { + return { + title: "", + description: "", + denomPairTakerFee: [] + }; +} +export const DenomPairTakerFeeProposal = { + typeUrl: "/osmosis.poolmanager.v1beta1.DenomPairTakerFeeProposal", + encode(message: DenomPairTakerFeeProposal, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.title !== "") { + writer.uint32(10).string(message.title); + } + if (message.description !== "") { + writer.uint32(18).string(message.description); + } + for (const v of message.denomPairTakerFee) { + DenomPairTakerFee.encode(v!, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): DenomPairTakerFeeProposal { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseDenomPairTakerFeeProposal(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.title = reader.string(); + break; + case 2: + message.description = reader.string(); + break; + case 3: + message.denomPairTakerFee.push(DenomPairTakerFee.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): DenomPairTakerFeeProposal { + const message = createBaseDenomPairTakerFeeProposal(); + message.title = object.title ?? ""; + message.description = object.description ?? ""; + message.denomPairTakerFee = object.denomPairTakerFee?.map(e => DenomPairTakerFee.fromPartial(e)) || []; + return message; + }, + fromAmino(object: DenomPairTakerFeeProposalAmino): DenomPairTakerFeeProposal { + const message = createBaseDenomPairTakerFeeProposal(); + if (object.title !== undefined && object.title !== null) { + message.title = object.title; + } + if (object.description !== undefined && object.description !== null) { + message.description = object.description; + } + message.denomPairTakerFee = object.denom_pair_taker_fee?.map(e => DenomPairTakerFee.fromAmino(e)) || []; + return message; + }, + toAmino(message: DenomPairTakerFeeProposal): DenomPairTakerFeeProposalAmino { + const obj: any = {}; + obj.title = message.title; + obj.description = message.description; + if (message.denomPairTakerFee) { + obj.denom_pair_taker_fee = message.denomPairTakerFee.map(e => e ? DenomPairTakerFee.toAmino(e) : undefined); + } else { + obj.denom_pair_taker_fee = []; + } + return obj; + }, + fromAminoMsg(object: DenomPairTakerFeeProposalAminoMsg): DenomPairTakerFeeProposal { + return DenomPairTakerFeeProposal.fromAmino(object.value); + }, + toAminoMsg(message: DenomPairTakerFeeProposal): DenomPairTakerFeeProposalAminoMsg { + return { + type: "osmosis/poolmanager/denom-pair-taker-fee-proposal", + value: DenomPairTakerFeeProposal.toAmino(message) + }; + }, + fromProtoMsg(message: DenomPairTakerFeeProposalProtoMsg): DenomPairTakerFeeProposal { + return DenomPairTakerFeeProposal.decode(message.value); + }, + toProto(message: DenomPairTakerFeeProposal): Uint8Array { + return DenomPairTakerFeeProposal.encode(message).finish(); + }, + toProtoMsg(message: DenomPairTakerFeeProposal): DenomPairTakerFeeProposalProtoMsg { + return { + typeUrl: "/osmosis.poolmanager.v1beta1.DenomPairTakerFeeProposal", + value: DenomPairTakerFeeProposal.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/packages/osmo-query/src/codegen/osmosis/poolmanager/v1beta1/module_route.ts b/packages/osmo-query/src/codegen/osmosis/poolmanager/v1beta1/module_route.ts index f8366c174..374942de0 100644 --- a/packages/osmo-query/src/codegen/osmosis/poolmanager/v1beta1/module_route.ts +++ b/packages/osmo-query/src/codegen/osmosis/poolmanager/v1beta1/module_route.ts @@ -1,5 +1,4 @@ import { BinaryReader, BinaryWriter } from "../../../binary"; -import { isSet } from "../../../helpers"; /** PoolType is an enumeration of all supported pool types. */ export enum PoolType { /** Balancer - Balancer is the standard xy=k curve. Its pool model is defined in x/gamm. */ @@ -81,8 +80,8 @@ export interface ModuleRouteProtoMsg { */ export interface ModuleRouteAmino { /** pool_type specifies the type of the pool */ - pool_type: PoolType; - pool_id: string; + pool_type?: PoolType; + pool_id?: string; } export interface ModuleRouteAminoMsg { type: "osmosis/poolmanager/module-route"; @@ -142,14 +141,18 @@ export const ModuleRoute = { return message; }, fromAmino(object: ModuleRouteAmino): ModuleRoute { - return { - poolType: isSet(object.pool_type) ? poolTypeFromJSON(object.pool_type) : -1, - poolId: object?.pool_id ? BigInt(object.pool_id) : undefined - }; + const message = createBaseModuleRoute(); + if (object.pool_type !== undefined && object.pool_type !== null) { + message.poolType = poolTypeFromJSON(object.pool_type); + } + if (object.pool_id !== undefined && object.pool_id !== null) { + message.poolId = BigInt(object.pool_id); + } + return message; }, toAmino(message: ModuleRoute): ModuleRouteAmino { const obj: any = {}; - obj.pool_type = message.poolType; + obj.pool_type = poolTypeToJSON(message.poolType); obj.pool_id = message.poolId ? message.poolId.toString() : undefined; return obj; }, diff --git a/packages/osmo-query/src/codegen/osmosis/poolmanager/v1beta1/query.lcd.ts b/packages/osmo-query/src/codegen/osmosis/poolmanager/v1beta1/query.lcd.ts index 1fe285062..47d979805 100644 --- a/packages/osmo-query/src/codegen/osmosis/poolmanager/v1beta1/query.lcd.ts +++ b/packages/osmo-query/src/codegen/osmosis/poolmanager/v1beta1/query.lcd.ts @@ -1,5 +1,5 @@ import { LCDClient } from "@cosmology/lcd"; -import { ParamsRequest, ParamsResponseSDKType, EstimateSwapExactAmountInRequest, EstimateSwapExactAmountInResponseSDKType, EstimateSinglePoolSwapExactAmountInRequest, EstimateSwapExactAmountOutRequest, EstimateSwapExactAmountOutResponseSDKType, EstimateSinglePoolSwapExactAmountOutRequest, NumPoolsRequest, NumPoolsResponseSDKType, PoolRequest, PoolResponseSDKType, AllPoolsRequest, AllPoolsResponseSDKType, SpotPriceRequest, SpotPriceResponseSDKType, TotalPoolLiquidityRequest, TotalPoolLiquidityResponseSDKType, TotalLiquidityRequest, TotalLiquidityResponseSDKType } from "./query"; +import { ParamsRequest, ParamsResponseSDKType, EstimateSwapExactAmountInRequest, EstimateSwapExactAmountInResponseSDKType, EstimateSwapExactAmountInWithPrimitiveTypesRequest, EstimateSinglePoolSwapExactAmountInRequest, EstimateSwapExactAmountOutRequest, EstimateSwapExactAmountOutResponseSDKType, EstimateSwapExactAmountOutWithPrimitiveTypesRequest, EstimateSinglePoolSwapExactAmountOutRequest, NumPoolsRequest, NumPoolsResponseSDKType, PoolRequest, PoolResponseSDKType, AllPoolsRequest, AllPoolsResponseSDKType, ListPoolsByDenomRequest, ListPoolsByDenomResponseSDKType, SpotPriceRequest, SpotPriceResponseSDKType, TotalPoolLiquidityRequest, TotalPoolLiquidityResponseSDKType, TotalLiquidityRequest, TotalLiquidityResponseSDKType, TotalVolumeForPoolRequest, TotalVolumeForPoolResponseSDKType, TradingPairTakerFeeRequest, TradingPairTakerFeeResponseSDKType, EstimateTradeBasedOnPriceImpactRequest, EstimateTradeBasedOnPriceImpactResponseSDKType } from "./query"; export class LCDQueryClient { req: LCDClient; constructor({ @@ -10,15 +10,21 @@ export class LCDQueryClient { this.req = requestClient; this.params = this.params.bind(this); this.estimateSwapExactAmountIn = this.estimateSwapExactAmountIn.bind(this); + this.estimateSwapExactAmountInWithPrimitiveTypes = this.estimateSwapExactAmountInWithPrimitiveTypes.bind(this); this.estimateSinglePoolSwapExactAmountIn = this.estimateSinglePoolSwapExactAmountIn.bind(this); this.estimateSwapExactAmountOut = this.estimateSwapExactAmountOut.bind(this); + this.estimateSwapExactAmountOutWithPrimitiveTypes = this.estimateSwapExactAmountOutWithPrimitiveTypes.bind(this); this.estimateSinglePoolSwapExactAmountOut = this.estimateSinglePoolSwapExactAmountOut.bind(this); this.numPools = this.numPools.bind(this); this.pool = this.pool.bind(this); this.allPools = this.allPools.bind(this); + this.listPoolsByDenom = this.listPoolsByDenom.bind(this); this.spotPrice = this.spotPrice.bind(this); this.totalPoolLiquidity = this.totalPoolLiquidity.bind(this); this.totalLiquidity = this.totalLiquidity.bind(this); + this.totalVolumeForPool = this.totalVolumeForPool.bind(this); + this.tradingPairTakerFee = this.tradingPairTakerFee.bind(this); + this.estimateTradeBasedOnPriceImpact = this.estimateTradeBasedOnPriceImpact.bind(this); } /* Params */ async params(_params: ParamsRequest = {}): Promise { @@ -39,6 +45,32 @@ export class LCDQueryClient { const endpoint = `osmosis/poolmanager/v1beta1/${params.poolId}/estimate/swap_exact_amount_in`; return await this.req.get(endpoint, options); } + /* EstimateSwapExactAmountInWithPrimitiveTypes is an alternative query for + EstimateSwapExactAmountIn. Supports query via GRPC-Gateway by using + primitive types instead of repeated structs. Each index in the + routes_pool_id field corresponds to the respective routes_token_out_denom + value, thus they are required to have the same length and are grouped + together as pairs. + example usage: + http://0.0.0.0:1317/osmosis/poolmanager/v1beta1/1/estimate/ + swap_exact_amount_in_with_primitive_types?token_in=100000stake&routes_token_out_denom=uatom + &routes_token_out_denom=uion&routes_pool_id=1&routes_pool_id=2 */ + async estimateSwapExactAmountInWithPrimitiveTypes(params: EstimateSwapExactAmountInWithPrimitiveTypesRequest): Promise { + const options: any = { + params: {} + }; + if (typeof params?.tokenIn !== "undefined") { + options.params.token_in = params.tokenIn; + } + if (typeof params?.routesPoolId !== "undefined") { + options.params.routes_pool_id = params.routesPoolId; + } + if (typeof params?.routesTokenOutDenom !== "undefined") { + options.params.routes_token_out_denom = params.routesTokenOutDenom; + } + const endpoint = `osmosis/poolmanager/v1beta1/${params.poolId}/estimate/swap_exact_amount_in_with_primitive_types`; + return await this.req.get(endpoint, options); + } /* EstimateSinglePoolSwapExactAmountIn */ async estimateSinglePoolSwapExactAmountIn(params: EstimateSinglePoolSwapExactAmountInRequest): Promise { const options: any = { @@ -67,6 +99,23 @@ export class LCDQueryClient { const endpoint = `osmosis/poolmanager/v1beta1/${params.poolId}/estimate/swap_exact_amount_out`; return await this.req.get(endpoint, options); } + /* Estimates swap amount in given out. */ + async estimateSwapExactAmountOutWithPrimitiveTypes(params: EstimateSwapExactAmountOutWithPrimitiveTypesRequest): Promise { + const options: any = { + params: {} + }; + if (typeof params?.routesPoolId !== "undefined") { + options.params.routes_pool_id = params.routesPoolId; + } + if (typeof params?.routesTokenInDenom !== "undefined") { + options.params.routes_token_in_denom = params.routesTokenInDenom; + } + if (typeof params?.tokenOut !== "undefined") { + options.params.token_out = params.tokenOut; + } + const endpoint = `osmosis/poolmanager/v1beta1/${params.poolId}/estimate/swap_exact_amount_out_with_primitive_types`; + return await this.req.get(endpoint, options); + } /* EstimateSinglePoolSwapExactAmountOut */ async estimateSinglePoolSwapExactAmountOut(params: EstimateSinglePoolSwapExactAmountOutRequest): Promise { const options: any = { @@ -96,6 +145,17 @@ export class LCDQueryClient { const endpoint = `osmosis/poolmanager/v1beta1/all-pools`; return await this.req.get(endpoint); } + /* ListPoolsByDenom return all pools by denom */ + async listPoolsByDenom(params: ListPoolsByDenomRequest): Promise { + const options: any = { + params: {} + }; + if (typeof params?.denom !== "undefined") { + options.params.denom = params.denom; + } + const endpoint = `osmosis/poolmanager/v1beta1/list-pools-by-denom`; + return await this.req.get(endpoint, options); + } /* SpotPrice defines a gRPC query handler that returns the spot price given a base denomination and a quote denomination. */ async spotPrice(params: SpotPriceRequest): Promise { @@ -118,7 +178,48 @@ export class LCDQueryClient { } /* TotalLiquidity returns the total liquidity across all pools. */ async totalLiquidity(_params: TotalLiquidityRequest = {}): Promise { - const endpoint = `osmosis/poolmanager/v1beta1/pools/total_liquidity`; + const endpoint = `osmosis/poolmanager/v1beta1/total_liquidity`; return await this.req.get(endpoint); } + /* TotalVolumeForPool returns the total volume of the specified pool. */ + async totalVolumeForPool(params: TotalVolumeForPoolRequest): Promise { + const endpoint = `osmosis/poolmanager/v1beta1/pools/${params.poolId}/total_volume`; + return await this.req.get(endpoint); + } + /* TradingPairTakerFee returns the taker fee for a given set of denoms */ + async tradingPairTakerFee(params: TradingPairTakerFeeRequest): Promise { + const options: any = { + params: {} + }; + if (typeof params?.denom0 !== "undefined") { + options.params.denom_0 = params.denom0; + } + if (typeof params?.denom1 !== "undefined") { + options.params.denom_1 = params.denom1; + } + const endpoint = `osmosis/poolmanager/v1beta1/trading_pair_takerfee`; + return await this.req.get(endpoint, options); + } + /* EstimateTradeBasedOnPriceImpact returns an estimated trade based on price + impact, if a trade cannot be estimated a 0 input and 0 output would be + returned. */ + async estimateTradeBasedOnPriceImpact(params: EstimateTradeBasedOnPriceImpactRequest): Promise { + const options: any = { + params: {} + }; + if (typeof params?.fromCoin !== "undefined") { + options.params.from_coin = params.fromCoin; + } + if (typeof params?.toCoinDenom !== "undefined") { + options.params.to_coin_denom = params.toCoinDenom; + } + if (typeof params?.maxPriceImpact !== "undefined") { + options.params.max_price_impact = params.maxPriceImpact; + } + if (typeof params?.externalPrice !== "undefined") { + options.params.external_price = params.externalPrice; + } + const endpoint = `osmosis/poolmanager/v1beta1/${params.poolId}/estimate_trade`; + return await this.req.get(endpoint, options); + } } \ No newline at end of file diff --git a/packages/osmo-query/src/codegen/osmosis/poolmanager/v1beta1/query.rpc.Query.ts b/packages/osmo-query/src/codegen/osmosis/poolmanager/v1beta1/query.rpc.Query.ts index f9943efaf..3856fa7f5 100644 --- a/packages/osmo-query/src/codegen/osmosis/poolmanager/v1beta1/query.rpc.Query.ts +++ b/packages/osmo-query/src/codegen/osmosis/poolmanager/v1beta1/query.rpc.Query.ts @@ -3,14 +3,29 @@ import { BinaryReader } from "../../../binary"; import { QueryClient, createProtobufRpcClient, ProtobufRpcClient } from "@cosmjs/stargate"; import { ReactQueryParams } from "../../../react-query"; import { useQuery } from "@tanstack/react-query"; -import { ParamsRequest, ParamsResponse, EstimateSwapExactAmountInRequest, EstimateSwapExactAmountInResponse, EstimateSinglePoolSwapExactAmountInRequest, EstimateSwapExactAmountOutRequest, EstimateSwapExactAmountOutResponse, EstimateSinglePoolSwapExactAmountOutRequest, NumPoolsRequest, NumPoolsResponse, PoolRequest, PoolResponse, AllPoolsRequest, AllPoolsResponse, SpotPriceRequest, SpotPriceResponse, TotalPoolLiquidityRequest, TotalPoolLiquidityResponse, TotalLiquidityRequest, TotalLiquidityResponse } from "./query"; +import { ParamsRequest, ParamsResponse, EstimateSwapExactAmountInRequest, EstimateSwapExactAmountInResponse, EstimateSwapExactAmountInWithPrimitiveTypesRequest, EstimateSinglePoolSwapExactAmountInRequest, EstimateSwapExactAmountOutRequest, EstimateSwapExactAmountOutResponse, EstimateSwapExactAmountOutWithPrimitiveTypesRequest, EstimateSinglePoolSwapExactAmountOutRequest, NumPoolsRequest, NumPoolsResponse, PoolRequest, PoolResponse, AllPoolsRequest, AllPoolsResponse, ListPoolsByDenomRequest, ListPoolsByDenomResponse, SpotPriceRequest, SpotPriceResponse, TotalPoolLiquidityRequest, TotalPoolLiquidityResponse, TotalLiquidityRequest, TotalLiquidityResponse, TotalVolumeForPoolRequest, TotalVolumeForPoolResponse, TradingPairTakerFeeRequest, TradingPairTakerFeeResponse, EstimateTradeBasedOnPriceImpactRequest, EstimateTradeBasedOnPriceImpactResponse } from "./query"; export interface Query { params(request?: ParamsRequest): Promise; /** Estimates swap amount out given in. */ estimateSwapExactAmountIn(request: EstimateSwapExactAmountInRequest): Promise; + /** + * EstimateSwapExactAmountInWithPrimitiveTypes is an alternative query for + * EstimateSwapExactAmountIn. Supports query via GRPC-Gateway by using + * primitive types instead of repeated structs. Each index in the + * routes_pool_id field corresponds to the respective routes_token_out_denom + * value, thus they are required to have the same length and are grouped + * together as pairs. + * example usage: + * http://0.0.0.0:1317/osmosis/poolmanager/v1beta1/1/estimate/ + * swap_exact_amount_in_with_primitive_types?token_in=100000stake&routes_token_out_denom=uatom + * &routes_token_out_denom=uion&routes_pool_id=1&routes_pool_id=2 + */ + estimateSwapExactAmountInWithPrimitiveTypes(request: EstimateSwapExactAmountInWithPrimitiveTypesRequest): Promise; estimateSinglePoolSwapExactAmountIn(request: EstimateSinglePoolSwapExactAmountInRequest): Promise; /** Estimates swap amount in given out. */ estimateSwapExactAmountOut(request: EstimateSwapExactAmountOutRequest): Promise; + /** Estimates swap amount in given out. */ + estimateSwapExactAmountOutWithPrimitiveTypes(request: EstimateSwapExactAmountOutWithPrimitiveTypesRequest): Promise; estimateSinglePoolSwapExactAmountOut(request: EstimateSinglePoolSwapExactAmountOutRequest): Promise; /** Returns the total number of pools existing in Osmosis. */ numPools(request?: NumPoolsRequest): Promise; @@ -18,6 +33,8 @@ export interface Query { pool(request: PoolRequest): Promise; /** AllPools returns all pools on the Osmosis chain sorted by IDs. */ allPools(request?: AllPoolsRequest): Promise; + /** ListPoolsByDenom return all pools by denom */ + listPoolsByDenom(request: ListPoolsByDenomRequest): Promise; /** * SpotPrice defines a gRPC query handler that returns the spot price given * a base denomination and a quote denomination. @@ -27,6 +44,16 @@ export interface Query { totalPoolLiquidity(request: TotalPoolLiquidityRequest): Promise; /** TotalLiquidity returns the total liquidity across all pools. */ totalLiquidity(request?: TotalLiquidityRequest): Promise; + /** TotalVolumeForPool returns the total volume of the specified pool. */ + totalVolumeForPool(request: TotalVolumeForPoolRequest): Promise; + /** TradingPairTakerFee returns the taker fee for a given set of denoms */ + tradingPairTakerFee(request: TradingPairTakerFeeRequest): Promise; + /** + * EstimateTradeBasedOnPriceImpact returns an estimated trade based on price + * impact, if a trade cannot be estimated a 0 input and 0 output would be + * returned. + */ + estimateTradeBasedOnPriceImpact(request: EstimateTradeBasedOnPriceImpactRequest): Promise; } export class QueryClientImpl implements Query { private readonly rpc: Rpc; @@ -34,15 +61,21 @@ export class QueryClientImpl implements Query { this.rpc = rpc; this.params = this.params.bind(this); this.estimateSwapExactAmountIn = this.estimateSwapExactAmountIn.bind(this); + this.estimateSwapExactAmountInWithPrimitiveTypes = this.estimateSwapExactAmountInWithPrimitiveTypes.bind(this); this.estimateSinglePoolSwapExactAmountIn = this.estimateSinglePoolSwapExactAmountIn.bind(this); this.estimateSwapExactAmountOut = this.estimateSwapExactAmountOut.bind(this); + this.estimateSwapExactAmountOutWithPrimitiveTypes = this.estimateSwapExactAmountOutWithPrimitiveTypes.bind(this); this.estimateSinglePoolSwapExactAmountOut = this.estimateSinglePoolSwapExactAmountOut.bind(this); this.numPools = this.numPools.bind(this); this.pool = this.pool.bind(this); this.allPools = this.allPools.bind(this); + this.listPoolsByDenom = this.listPoolsByDenom.bind(this); this.spotPrice = this.spotPrice.bind(this); this.totalPoolLiquidity = this.totalPoolLiquidity.bind(this); this.totalLiquidity = this.totalLiquidity.bind(this); + this.totalVolumeForPool = this.totalVolumeForPool.bind(this); + this.tradingPairTakerFee = this.tradingPairTakerFee.bind(this); + this.estimateTradeBasedOnPriceImpact = this.estimateTradeBasedOnPriceImpact.bind(this); } params(request: ParamsRequest = {}): Promise { const data = ParamsRequest.encode(request).finish(); @@ -54,6 +87,11 @@ export class QueryClientImpl implements Query { const promise = this.rpc.request("osmosis.poolmanager.v1beta1.Query", "EstimateSwapExactAmountIn", data); return promise.then(data => EstimateSwapExactAmountInResponse.decode(new BinaryReader(data))); } + estimateSwapExactAmountInWithPrimitiveTypes(request: EstimateSwapExactAmountInWithPrimitiveTypesRequest): Promise { + const data = EstimateSwapExactAmountInWithPrimitiveTypesRequest.encode(request).finish(); + const promise = this.rpc.request("osmosis.poolmanager.v1beta1.Query", "EstimateSwapExactAmountInWithPrimitiveTypes", data); + return promise.then(data => EstimateSwapExactAmountInResponse.decode(new BinaryReader(data))); + } estimateSinglePoolSwapExactAmountIn(request: EstimateSinglePoolSwapExactAmountInRequest): Promise { const data = EstimateSinglePoolSwapExactAmountInRequest.encode(request).finish(); const promise = this.rpc.request("osmosis.poolmanager.v1beta1.Query", "EstimateSinglePoolSwapExactAmountIn", data); @@ -64,6 +102,11 @@ export class QueryClientImpl implements Query { const promise = this.rpc.request("osmosis.poolmanager.v1beta1.Query", "EstimateSwapExactAmountOut", data); return promise.then(data => EstimateSwapExactAmountOutResponse.decode(new BinaryReader(data))); } + estimateSwapExactAmountOutWithPrimitiveTypes(request: EstimateSwapExactAmountOutWithPrimitiveTypesRequest): Promise { + const data = EstimateSwapExactAmountOutWithPrimitiveTypesRequest.encode(request).finish(); + const promise = this.rpc.request("osmosis.poolmanager.v1beta1.Query", "EstimateSwapExactAmountOutWithPrimitiveTypes", data); + return promise.then(data => EstimateSwapExactAmountOutResponse.decode(new BinaryReader(data))); + } estimateSinglePoolSwapExactAmountOut(request: EstimateSinglePoolSwapExactAmountOutRequest): Promise { const data = EstimateSinglePoolSwapExactAmountOutRequest.encode(request).finish(); const promise = this.rpc.request("osmosis.poolmanager.v1beta1.Query", "EstimateSinglePoolSwapExactAmountOut", data); @@ -84,6 +127,11 @@ export class QueryClientImpl implements Query { const promise = this.rpc.request("osmosis.poolmanager.v1beta1.Query", "AllPools", data); return promise.then(data => AllPoolsResponse.decode(new BinaryReader(data))); } + listPoolsByDenom(request: ListPoolsByDenomRequest): Promise { + const data = ListPoolsByDenomRequest.encode(request).finish(); + const promise = this.rpc.request("osmosis.poolmanager.v1beta1.Query", "ListPoolsByDenom", data); + return promise.then(data => ListPoolsByDenomResponse.decode(new BinaryReader(data))); + } spotPrice(request: SpotPriceRequest): Promise { const data = SpotPriceRequest.encode(request).finish(); const promise = this.rpc.request("osmosis.poolmanager.v1beta1.Query", "SpotPrice", data); @@ -99,6 +147,21 @@ export class QueryClientImpl implements Query { const promise = this.rpc.request("osmosis.poolmanager.v1beta1.Query", "TotalLiquidity", data); return promise.then(data => TotalLiquidityResponse.decode(new BinaryReader(data))); } + totalVolumeForPool(request: TotalVolumeForPoolRequest): Promise { + const data = TotalVolumeForPoolRequest.encode(request).finish(); + const promise = this.rpc.request("osmosis.poolmanager.v1beta1.Query", "TotalVolumeForPool", data); + return promise.then(data => TotalVolumeForPoolResponse.decode(new BinaryReader(data))); + } + tradingPairTakerFee(request: TradingPairTakerFeeRequest): Promise { + const data = TradingPairTakerFeeRequest.encode(request).finish(); + const promise = this.rpc.request("osmosis.poolmanager.v1beta1.Query", "TradingPairTakerFee", data); + return promise.then(data => TradingPairTakerFeeResponse.decode(new BinaryReader(data))); + } + estimateTradeBasedOnPriceImpact(request: EstimateTradeBasedOnPriceImpactRequest): Promise { + const data = EstimateTradeBasedOnPriceImpactRequest.encode(request).finish(); + const promise = this.rpc.request("osmosis.poolmanager.v1beta1.Query", "EstimateTradeBasedOnPriceImpact", data); + return promise.then(data => EstimateTradeBasedOnPriceImpactResponse.decode(new BinaryReader(data))); + } } export const createRpcQueryExtension = (base: QueryClient) => { const rpc = createProtobufRpcClient(base); @@ -110,12 +173,18 @@ export const createRpcQueryExtension = (base: QueryClient) => { estimateSwapExactAmountIn(request: EstimateSwapExactAmountInRequest): Promise { return queryService.estimateSwapExactAmountIn(request); }, + estimateSwapExactAmountInWithPrimitiveTypes(request: EstimateSwapExactAmountInWithPrimitiveTypesRequest): Promise { + return queryService.estimateSwapExactAmountInWithPrimitiveTypes(request); + }, estimateSinglePoolSwapExactAmountIn(request: EstimateSinglePoolSwapExactAmountInRequest): Promise { return queryService.estimateSinglePoolSwapExactAmountIn(request); }, estimateSwapExactAmountOut(request: EstimateSwapExactAmountOutRequest): Promise { return queryService.estimateSwapExactAmountOut(request); }, + estimateSwapExactAmountOutWithPrimitiveTypes(request: EstimateSwapExactAmountOutWithPrimitiveTypesRequest): Promise { + return queryService.estimateSwapExactAmountOutWithPrimitiveTypes(request); + }, estimateSinglePoolSwapExactAmountOut(request: EstimateSinglePoolSwapExactAmountOutRequest): Promise { return queryService.estimateSinglePoolSwapExactAmountOut(request); }, @@ -128,6 +197,9 @@ export const createRpcQueryExtension = (base: QueryClient) => { allPools(request?: AllPoolsRequest): Promise { return queryService.allPools(request); }, + listPoolsByDenom(request: ListPoolsByDenomRequest): Promise { + return queryService.listPoolsByDenom(request); + }, spotPrice(request: SpotPriceRequest): Promise { return queryService.spotPrice(request); }, @@ -136,6 +208,15 @@ export const createRpcQueryExtension = (base: QueryClient) => { }, totalLiquidity(request?: TotalLiquidityRequest): Promise { return queryService.totalLiquidity(request); + }, + totalVolumeForPool(request: TotalVolumeForPoolRequest): Promise { + return queryService.totalVolumeForPool(request); + }, + tradingPairTakerFee(request: TradingPairTakerFeeRequest): Promise { + return queryService.tradingPairTakerFee(request); + }, + estimateTradeBasedOnPriceImpact(request: EstimateTradeBasedOnPriceImpactRequest): Promise { + return queryService.estimateTradeBasedOnPriceImpact(request); } }; }; @@ -145,12 +226,18 @@ export interface UseParamsQuery extends ReactQueryParams extends ReactQueryParams { request: EstimateSwapExactAmountInRequest; } +export interface UseEstimateSwapExactAmountInWithPrimitiveTypesQuery extends ReactQueryParams { + request: EstimateSwapExactAmountInWithPrimitiveTypesRequest; +} export interface UseEstimateSinglePoolSwapExactAmountInQuery extends ReactQueryParams { request: EstimateSinglePoolSwapExactAmountInRequest; } export interface UseEstimateSwapExactAmountOutQuery extends ReactQueryParams { request: EstimateSwapExactAmountOutRequest; } +export interface UseEstimateSwapExactAmountOutWithPrimitiveTypesQuery extends ReactQueryParams { + request: EstimateSwapExactAmountOutWithPrimitiveTypesRequest; +} export interface UseEstimateSinglePoolSwapExactAmountOutQuery extends ReactQueryParams { request: EstimateSinglePoolSwapExactAmountOutRequest; } @@ -163,6 +250,9 @@ export interface UsePoolQuery extends ReactQueryParams extends ReactQueryParams { request?: AllPoolsRequest; } +export interface UseListPoolsByDenomQuery extends ReactQueryParams { + request: ListPoolsByDenomRequest; +} export interface UseSpotPriceQuery extends ReactQueryParams { request: SpotPriceRequest; } @@ -172,6 +262,15 @@ export interface UseTotalPoolLiquidityQuery extends ReactQueryParams extends ReactQueryParams { request?: TotalLiquidityRequest; } +export interface UseTotalVolumeForPoolQuery extends ReactQueryParams { + request: TotalVolumeForPoolRequest; +} +export interface UseTradingPairTakerFeeQuery extends ReactQueryParams { + request: TradingPairTakerFeeRequest; +} +export interface UseEstimateTradeBasedOnPriceImpactQuery extends ReactQueryParams { + request: EstimateTradeBasedOnPriceImpactRequest; +} const _queryClients: WeakMap = new WeakMap(); const getQueryService = (rpc: ProtobufRpcClient | undefined): QueryClientImpl | undefined => { if (!rpc) return; @@ -202,6 +301,15 @@ export const createRpcQueryHooks = (rpc: ProtobufRpcClient | undefined) => { return queryService.estimateSwapExactAmountIn(request); }, options); }; + const useEstimateSwapExactAmountInWithPrimitiveTypes = ({ + request, + options + }: UseEstimateSwapExactAmountInWithPrimitiveTypesQuery) => { + return useQuery(["estimateSwapExactAmountInWithPrimitiveTypesQuery", request], () => { + if (!queryService) throw new Error("Query Service not initialized"); + return queryService.estimateSwapExactAmountInWithPrimitiveTypes(request); + }, options); + }; const useEstimateSinglePoolSwapExactAmountIn = ({ request, options @@ -220,6 +328,15 @@ export const createRpcQueryHooks = (rpc: ProtobufRpcClient | undefined) => { return queryService.estimateSwapExactAmountOut(request); }, options); }; + const useEstimateSwapExactAmountOutWithPrimitiveTypes = ({ + request, + options + }: UseEstimateSwapExactAmountOutWithPrimitiveTypesQuery) => { + return useQuery(["estimateSwapExactAmountOutWithPrimitiveTypesQuery", request], () => { + if (!queryService) throw new Error("Query Service not initialized"); + return queryService.estimateSwapExactAmountOutWithPrimitiveTypes(request); + }, options); + }; const useEstimateSinglePoolSwapExactAmountOut = ({ request, options @@ -256,6 +373,15 @@ export const createRpcQueryHooks = (rpc: ProtobufRpcClient | undefined) => { return queryService.allPools(request); }, options); }; + const useListPoolsByDenom = ({ + request, + options + }: UseListPoolsByDenomQuery) => { + return useQuery(["listPoolsByDenomQuery", request], () => { + if (!queryService) throw new Error("Query Service not initialized"); + return queryService.listPoolsByDenom(request); + }, options); + }; const useSpotPrice = ({ request, options @@ -283,21 +409,71 @@ export const createRpcQueryHooks = (rpc: ProtobufRpcClient | undefined) => { return queryService.totalLiquidity(request); }, options); }; + const useTotalVolumeForPool = ({ + request, + options + }: UseTotalVolumeForPoolQuery) => { + return useQuery(["totalVolumeForPoolQuery", request], () => { + if (!queryService) throw new Error("Query Service not initialized"); + return queryService.totalVolumeForPool(request); + }, options); + }; + const useTradingPairTakerFee = ({ + request, + options + }: UseTradingPairTakerFeeQuery) => { + return useQuery(["tradingPairTakerFeeQuery", request], () => { + if (!queryService) throw new Error("Query Service not initialized"); + return queryService.tradingPairTakerFee(request); + }, options); + }; + const useEstimateTradeBasedOnPriceImpact = ({ + request, + options + }: UseEstimateTradeBasedOnPriceImpactQuery) => { + return useQuery(["estimateTradeBasedOnPriceImpactQuery", request], () => { + if (!queryService) throw new Error("Query Service not initialized"); + return queryService.estimateTradeBasedOnPriceImpact(request); + }, options); + }; return { useParams, /** Estimates swap amount out given in. */useEstimateSwapExactAmountIn, + /** + * EstimateSwapExactAmountInWithPrimitiveTypes is an alternative query for + * EstimateSwapExactAmountIn. Supports query via GRPC-Gateway by using + * primitive types instead of repeated structs. Each index in the + * routes_pool_id field corresponds to the respective routes_token_out_denom + * value, thus they are required to have the same length and are grouped + * together as pairs. + * example usage: + * http://0.0.0.0:1317/osmosis/poolmanager/v1beta1/1/estimate/ + * swap_exact_amount_in_with_primitive_types?token_in=100000stake&routes_token_out_denom=uatom + * &routes_token_out_denom=uion&routes_pool_id=1&routes_pool_id=2 + */ + useEstimateSwapExactAmountInWithPrimitiveTypes, useEstimateSinglePoolSwapExactAmountIn, /** Estimates swap amount in given out. */useEstimateSwapExactAmountOut, + /** Estimates swap amount in given out. */useEstimateSwapExactAmountOutWithPrimitiveTypes, useEstimateSinglePoolSwapExactAmountOut, /** Returns the total number of pools existing in Osmosis. */useNumPools, /** Pool returns the Pool specified by the pool id */usePool, /** AllPools returns all pools on the Osmosis chain sorted by IDs. */useAllPools, + /** ListPoolsByDenom return all pools by denom */useListPoolsByDenom, /** * SpotPrice defines a gRPC query handler that returns the spot price given * a base denomination and a quote denomination. */ useSpotPrice, /** TotalPoolLiquidity returns the total liquidity of the specified pool. */useTotalPoolLiquidity, - /** TotalLiquidity returns the total liquidity across all pools. */useTotalLiquidity + /** TotalLiquidity returns the total liquidity across all pools. */useTotalLiquidity, + /** TotalVolumeForPool returns the total volume of the specified pool. */useTotalVolumeForPool, + /** TradingPairTakerFee returns the taker fee for a given set of denoms */useTradingPairTakerFee, + /** + * EstimateTradeBasedOnPriceImpact returns an estimated trade based on price + * impact, if a trade cannot be estimated a 0 input and 0 output would be + * returned. + */ + useEstimateTradeBasedOnPriceImpact }; }; \ No newline at end of file diff --git a/packages/osmo-query/src/codegen/osmosis/poolmanager/v1beta1/query.ts b/packages/osmo-query/src/codegen/osmosis/poolmanager/v1beta1/query.ts index fc85644e9..b943e2352 100644 --- a/packages/osmo-query/src/codegen/osmosis/poolmanager/v1beta1/query.ts +++ b/packages/osmo-query/src/codegen/osmosis/poolmanager/v1beta1/query.ts @@ -1,18 +1,19 @@ import { SwapAmountInRoute, SwapAmountInRouteAmino, SwapAmountInRouteSDKType, SwapAmountOutRoute, SwapAmountOutRouteAmino, SwapAmountOutRouteSDKType } from "./swap_route"; +import { Coin, CoinAmino, CoinSDKType } from "../../../cosmos/base/v1beta1/coin"; import { Params, ParamsAmino, ParamsSDKType } from "./genesis"; import { Any, AnyProtoMsg, AnyAmino, AnySDKType } from "../../../google/protobuf/any"; -import { Coin, CoinAmino, CoinSDKType } from "../../../cosmos/base/v1beta1/coin"; -import { Pool as Pool1 } from "../../concentrated-liquidity/pool"; -import { PoolProtoMsg as Pool1ProtoMsg } from "../../concentrated-liquidity/pool"; -import { PoolSDKType as Pool1SDKType } from "../../concentrated-liquidity/pool"; +import { Pool as Pool1 } from "../../concentratedliquidity/v1beta1/pool"; +import { PoolProtoMsg as Pool1ProtoMsg } from "../../concentratedliquidity/v1beta1/pool"; +import { PoolSDKType as Pool1SDKType } from "../../concentratedliquidity/v1beta1/pool"; import { CosmWasmPool, CosmWasmPoolProtoMsg, CosmWasmPoolSDKType } from "../../cosmwasmpool/v1beta1/model/pool"; -import { Pool as Pool2 } from "../../gamm/pool-models/balancer/balancerPool"; -import { PoolProtoMsg as Pool2ProtoMsg } from "../../gamm/pool-models/balancer/balancerPool"; -import { PoolSDKType as Pool2SDKType } from "../../gamm/pool-models/balancer/balancerPool"; -import { Pool as Pool3 } from "../../gamm/pool-models/stableswap/stableswap_pool"; -import { PoolProtoMsg as Pool3ProtoMsg } from "../../gamm/pool-models/stableswap/stableswap_pool"; -import { PoolSDKType as Pool3SDKType } from "../../gamm/pool-models/stableswap/stableswap_pool"; +import { Pool as Pool2 } from "../../gamm/poolmodels/stableswap/v1beta1/stableswap_pool"; +import { PoolProtoMsg as Pool2ProtoMsg } from "../../gamm/poolmodels/stableswap/v1beta1/stableswap_pool"; +import { PoolSDKType as Pool2SDKType } from "../../gamm/poolmodels/stableswap/v1beta1/stableswap_pool"; +import { Pool as Pool3 } from "../../gamm/v1beta1/balancerPool"; +import { PoolProtoMsg as Pool3ProtoMsg } from "../../gamm/v1beta1/balancerPool"; +import { PoolSDKType as Pool3SDKType } from "../../gamm/v1beta1/balancerPool"; import { BinaryReader, BinaryWriter } from "../../../binary"; +import { Decimal } from "@cosmjs/math"; /** =============================== Params */ export interface ParamsRequest {} export interface ParamsRequestProtoMsg { @@ -46,6 +47,7 @@ export interface ParamsResponseSDKType { } /** =============================== EstimateSwapExactAmountIn */ export interface EstimateSwapExactAmountInRequest { + /** @deprecated */ poolId: bigint; tokenIn: string; routes: SwapAmountInRoute[]; @@ -56,9 +58,10 @@ export interface EstimateSwapExactAmountInRequestProtoMsg { } /** =============================== EstimateSwapExactAmountIn */ export interface EstimateSwapExactAmountInRequestAmino { - pool_id: string; - token_in: string; - routes: SwapAmountInRouteAmino[]; + /** @deprecated */ + pool_id?: string; + token_in?: string; + routes?: SwapAmountInRouteAmino[]; } export interface EstimateSwapExactAmountInRequestAminoMsg { type: "osmosis/poolmanager/estimate-swap-exact-amount-in-request"; @@ -66,10 +69,40 @@ export interface EstimateSwapExactAmountInRequestAminoMsg { } /** =============================== EstimateSwapExactAmountIn */ export interface EstimateSwapExactAmountInRequestSDKType { + /** @deprecated */ pool_id: bigint; token_in: string; routes: SwapAmountInRouteSDKType[]; } +export interface EstimateSwapExactAmountInWithPrimitiveTypesRequest { + /** @deprecated */ + poolId: bigint; + tokenIn: string; + routesPoolId: bigint[]; + routesTokenOutDenom: string[]; +} +export interface EstimateSwapExactAmountInWithPrimitiveTypesRequestProtoMsg { + typeUrl: "/osmosis.poolmanager.v1beta1.EstimateSwapExactAmountInWithPrimitiveTypesRequest"; + value: Uint8Array; +} +export interface EstimateSwapExactAmountInWithPrimitiveTypesRequestAmino { + /** @deprecated */ + pool_id?: string; + token_in?: string; + routes_pool_id?: string[]; + routes_token_out_denom?: string[]; +} +export interface EstimateSwapExactAmountInWithPrimitiveTypesRequestAminoMsg { + type: "osmosis/poolmanager/estimate-swap-exact-amount-in-with-primitive-types-request"; + value: EstimateSwapExactAmountInWithPrimitiveTypesRequestAmino; +} +export interface EstimateSwapExactAmountInWithPrimitiveTypesRequestSDKType { + /** @deprecated */ + pool_id: bigint; + token_in: string; + routes_pool_id: bigint[]; + routes_token_out_denom: string[]; +} export interface EstimateSinglePoolSwapExactAmountInRequest { poolId: bigint; tokenIn: string; @@ -80,9 +113,9 @@ export interface EstimateSinglePoolSwapExactAmountInRequestProtoMsg { value: Uint8Array; } export interface EstimateSinglePoolSwapExactAmountInRequestAmino { - pool_id: string; - token_in: string; - token_out_denom: string; + pool_id?: string; + token_in?: string; + token_out_denom?: string; } export interface EstimateSinglePoolSwapExactAmountInRequestAminoMsg { type: "osmosis/poolmanager/estimate-single-pool-swap-exact-amount-in-request"; @@ -101,7 +134,7 @@ export interface EstimateSwapExactAmountInResponseProtoMsg { value: Uint8Array; } export interface EstimateSwapExactAmountInResponseAmino { - token_out_amount: string; + token_out_amount?: string; } export interface EstimateSwapExactAmountInResponseAminoMsg { type: "osmosis/poolmanager/estimate-swap-exact-amount-in-response"; @@ -112,6 +145,7 @@ export interface EstimateSwapExactAmountInResponseSDKType { } /** =============================== EstimateSwapExactAmountOut */ export interface EstimateSwapExactAmountOutRequest { + /** @deprecated */ poolId: bigint; routes: SwapAmountOutRoute[]; tokenOut: string; @@ -122,9 +156,10 @@ export interface EstimateSwapExactAmountOutRequestProtoMsg { } /** =============================== EstimateSwapExactAmountOut */ export interface EstimateSwapExactAmountOutRequestAmino { - pool_id: string; - routes: SwapAmountOutRouteAmino[]; - token_out: string; + /** @deprecated */ + pool_id?: string; + routes?: SwapAmountOutRouteAmino[]; + token_out?: string; } export interface EstimateSwapExactAmountOutRequestAminoMsg { type: "osmosis/poolmanager/estimate-swap-exact-amount-out-request"; @@ -132,10 +167,40 @@ export interface EstimateSwapExactAmountOutRequestAminoMsg { } /** =============================== EstimateSwapExactAmountOut */ export interface EstimateSwapExactAmountOutRequestSDKType { + /** @deprecated */ pool_id: bigint; routes: SwapAmountOutRouteSDKType[]; token_out: string; } +export interface EstimateSwapExactAmountOutWithPrimitiveTypesRequest { + /** @deprecated */ + poolId: bigint; + routesPoolId: bigint[]; + routesTokenInDenom: string[]; + tokenOut: string; +} +export interface EstimateSwapExactAmountOutWithPrimitiveTypesRequestProtoMsg { + typeUrl: "/osmosis.poolmanager.v1beta1.EstimateSwapExactAmountOutWithPrimitiveTypesRequest"; + value: Uint8Array; +} +export interface EstimateSwapExactAmountOutWithPrimitiveTypesRequestAmino { + /** @deprecated */ + pool_id?: string; + routes_pool_id?: string[]; + routes_token_in_denom?: string[]; + token_out?: string; +} +export interface EstimateSwapExactAmountOutWithPrimitiveTypesRequestAminoMsg { + type: "osmosis/poolmanager/estimate-swap-exact-amount-out-with-primitive-types-request"; + value: EstimateSwapExactAmountOutWithPrimitiveTypesRequestAmino; +} +export interface EstimateSwapExactAmountOutWithPrimitiveTypesRequestSDKType { + /** @deprecated */ + pool_id: bigint; + routes_pool_id: bigint[]; + routes_token_in_denom: string[]; + token_out: string; +} export interface EstimateSinglePoolSwapExactAmountOutRequest { poolId: bigint; tokenInDenom: string; @@ -146,9 +211,9 @@ export interface EstimateSinglePoolSwapExactAmountOutRequestProtoMsg { value: Uint8Array; } export interface EstimateSinglePoolSwapExactAmountOutRequestAmino { - pool_id: string; - token_in_denom: string; - token_out: string; + pool_id?: string; + token_in_denom?: string; + token_out?: string; } export interface EstimateSinglePoolSwapExactAmountOutRequestAminoMsg { type: "osmosis/poolmanager/estimate-single-pool-swap-exact-amount-out-request"; @@ -167,7 +232,7 @@ export interface EstimateSwapExactAmountOutResponseProtoMsg { value: Uint8Array; } export interface EstimateSwapExactAmountOutResponseAmino { - token_in_amount: string; + token_in_amount?: string; } export interface EstimateSwapExactAmountOutResponseAminoMsg { type: "osmosis/poolmanager/estimate-swap-exact-amount-out-response"; @@ -198,7 +263,7 @@ export interface NumPoolsResponseProtoMsg { value: Uint8Array; } export interface NumPoolsResponseAmino { - num_pools: string; + num_pools?: string; } export interface NumPoolsResponseAminoMsg { type: "osmosis/poolmanager/num-pools-response"; @@ -217,7 +282,7 @@ export interface PoolRequestProtoMsg { } /** =============================== Pool */ export interface PoolRequestAmino { - pool_id: string; + pool_id?: string; } export interface PoolRequestAminoMsg { type: "osmosis/poolmanager/pool-request"; @@ -228,7 +293,7 @@ export interface PoolRequestSDKType { pool_id: bigint; } export interface PoolResponse { - pool: (Pool1 & CosmWasmPool & Pool2 & Pool3 & Any) | undefined; + pool?: (Pool1 & CosmWasmPool & Pool2 & Pool3 & Any) | undefined; } export interface PoolResponseProtoMsg { typeUrl: "/osmosis.poolmanager.v1beta1.PoolResponse"; @@ -245,7 +310,7 @@ export interface PoolResponseAminoMsg { value: PoolResponseAmino; } export interface PoolResponseSDKType { - pool: Pool1SDKType | CosmWasmPoolSDKType | Pool2SDKType | Pool3SDKType | AnySDKType | undefined; + pool?: Pool1SDKType | CosmWasmPoolSDKType | Pool2SDKType | Pool3SDKType | AnySDKType | undefined; } /** =============================== AllPools */ export interface AllPoolsRequest {} @@ -272,7 +337,7 @@ export type AllPoolsResponseEncoded = Omit & { pools: (Pool1ProtoMsg | CosmWasmPoolProtoMsg | Pool2ProtoMsg | Pool3ProtoMsg | AnyProtoMsg)[]; }; export interface AllPoolsResponseAmino { - pools: AnyAmino[]; + pools?: AnyAmino[]; } export interface AllPoolsResponseAminoMsg { type: "osmosis/poolmanager/all-pools-response"; @@ -282,6 +347,56 @@ export interface AllPoolsResponseSDKType { pools: (Pool1SDKType | CosmWasmPoolSDKType | Pool2SDKType | Pool3SDKType | AnySDKType)[]; } /** + * ======================================================= + * ListPoolsByDenomRequest + */ +export interface ListPoolsByDenomRequest { + denom: string; +} +export interface ListPoolsByDenomRequestProtoMsg { + typeUrl: "/osmosis.poolmanager.v1beta1.ListPoolsByDenomRequest"; + value: Uint8Array; +} +/** + * ======================================================= + * ListPoolsByDenomRequest + */ +export interface ListPoolsByDenomRequestAmino { + denom?: string; +} +export interface ListPoolsByDenomRequestAminoMsg { + type: "osmosis/poolmanager/list-pools-by-denom-request"; + value: ListPoolsByDenomRequestAmino; +} +/** + * ======================================================= + * ListPoolsByDenomRequest + */ +export interface ListPoolsByDenomRequestSDKType { + denom: string; +} +export interface ListPoolsByDenomResponse { + pools: (Pool1 & CosmWasmPool & Pool2 & Pool3 & Any)[] | Any[]; +} +export interface ListPoolsByDenomResponseProtoMsg { + typeUrl: "/osmosis.poolmanager.v1beta1.ListPoolsByDenomResponse"; + value: Uint8Array; +} +export type ListPoolsByDenomResponseEncoded = Omit & { + pools: (Pool1ProtoMsg | CosmWasmPoolProtoMsg | Pool2ProtoMsg | Pool3ProtoMsg | AnyProtoMsg)[]; +}; +export interface ListPoolsByDenomResponseAmino { + pools?: AnyAmino[]; +} +export interface ListPoolsByDenomResponseAminoMsg { + type: "osmosis/poolmanager/list-pools-by-denom-response"; + value: ListPoolsByDenomResponseAmino; +} +export interface ListPoolsByDenomResponseSDKType { + pools: (Pool1SDKType | CosmWasmPoolSDKType | Pool2SDKType | Pool3SDKType | AnySDKType)[]; +} +/** + * ========================================================== * SpotPriceRequest defines the gRPC request structure for a SpotPrice * query. */ @@ -295,19 +410,21 @@ export interface SpotPriceRequestProtoMsg { value: Uint8Array; } /** + * ========================================================== * SpotPriceRequest defines the gRPC request structure for a SpotPrice * query. */ export interface SpotPriceRequestAmino { - pool_id: string; - base_asset_denom: string; - quote_asset_denom: string; + pool_id?: string; + base_asset_denom?: string; + quote_asset_denom?: string; } export interface SpotPriceRequestAminoMsg { type: "osmosis/poolmanager/spot-price-request"; value: SpotPriceRequestAmino; } /** + * ========================================================== * SpotPriceRequest defines the gRPC request structure for a SpotPrice * query. */ @@ -334,7 +451,7 @@ export interface SpotPriceResponseProtoMsg { */ export interface SpotPriceResponseAmino { /** String of the Dec. Ex) 10.203uatom */ - spot_price: string; + spot_price?: string; } export interface SpotPriceResponseAminoMsg { type: "osmosis/poolmanager/spot-price-response"; @@ -357,7 +474,7 @@ export interface TotalPoolLiquidityRequestProtoMsg { } /** =============================== TotalPoolLiquidity */ export interface TotalPoolLiquidityRequestAmino { - pool_id: string; + pool_id?: string; } export interface TotalPoolLiquidityRequestAminoMsg { type: "osmosis/poolmanager/total-pool-liquidity-request"; @@ -375,7 +492,7 @@ export interface TotalPoolLiquidityResponseProtoMsg { value: Uint8Array; } export interface TotalPoolLiquidityResponseAmino { - liquidity: CoinAmino[]; + liquidity?: CoinAmino[]; } export interface TotalPoolLiquidityResponseAminoMsg { type: "osmosis/poolmanager/total-pool-liquidity-response"; @@ -406,7 +523,7 @@ export interface TotalLiquidityResponseProtoMsg { value: Uint8Array; } export interface TotalLiquidityResponseAmino { - liquidity: CoinAmino[]; + liquidity?: CoinAmino[]; } export interface TotalLiquidityResponseAminoMsg { type: "osmosis/poolmanager/total-liquidity-response"; @@ -415,6 +532,217 @@ export interface TotalLiquidityResponseAminoMsg { export interface TotalLiquidityResponseSDKType { liquidity: CoinSDKType[]; } +/** =============================== TotalVolumeForPool */ +export interface TotalVolumeForPoolRequest { + poolId: bigint; +} +export interface TotalVolumeForPoolRequestProtoMsg { + typeUrl: "/osmosis.poolmanager.v1beta1.TotalVolumeForPoolRequest"; + value: Uint8Array; +} +/** =============================== TotalVolumeForPool */ +export interface TotalVolumeForPoolRequestAmino { + pool_id?: string; +} +export interface TotalVolumeForPoolRequestAminoMsg { + type: "osmosis/poolmanager/total-volume-for-pool-request"; + value: TotalVolumeForPoolRequestAmino; +} +/** =============================== TotalVolumeForPool */ +export interface TotalVolumeForPoolRequestSDKType { + pool_id: bigint; +} +export interface TotalVolumeForPoolResponse { + volume: Coin[]; +} +export interface TotalVolumeForPoolResponseProtoMsg { + typeUrl: "/osmosis.poolmanager.v1beta1.TotalVolumeForPoolResponse"; + value: Uint8Array; +} +export interface TotalVolumeForPoolResponseAmino { + volume?: CoinAmino[]; +} +export interface TotalVolumeForPoolResponseAminoMsg { + type: "osmosis/poolmanager/total-volume-for-pool-response"; + value: TotalVolumeForPoolResponseAmino; +} +export interface TotalVolumeForPoolResponseSDKType { + volume: CoinSDKType[]; +} +/** =============================== TradingPairTakerFee */ +export interface TradingPairTakerFeeRequest { + denom0: string; + denom1: string; +} +export interface TradingPairTakerFeeRequestProtoMsg { + typeUrl: "/osmosis.poolmanager.v1beta1.TradingPairTakerFeeRequest"; + value: Uint8Array; +} +/** =============================== TradingPairTakerFee */ +export interface TradingPairTakerFeeRequestAmino { + denom_0?: string; + denom_1?: string; +} +export interface TradingPairTakerFeeRequestAminoMsg { + type: "osmosis/poolmanager/trading-pair-taker-fee-request"; + value: TradingPairTakerFeeRequestAmino; +} +/** =============================== TradingPairTakerFee */ +export interface TradingPairTakerFeeRequestSDKType { + denom_0: string; + denom_1: string; +} +export interface TradingPairTakerFeeResponse { + takerFee: string; +} +export interface TradingPairTakerFeeResponseProtoMsg { + typeUrl: "/osmosis.poolmanager.v1beta1.TradingPairTakerFeeResponse"; + value: Uint8Array; +} +export interface TradingPairTakerFeeResponseAmino { + taker_fee?: string; +} +export interface TradingPairTakerFeeResponseAminoMsg { + type: "osmosis/poolmanager/trading-pair-taker-fee-response"; + value: TradingPairTakerFeeResponseAmino; +} +export interface TradingPairTakerFeeResponseSDKType { + taker_fee: string; +} +/** + * EstimateTradeBasedOnPriceImpactRequest represents a request to estimate a + * trade for Balancer/StableSwap/Concentrated liquidity pool types based on the + * given parameters. + */ +export interface EstimateTradeBasedOnPriceImpactRequest { + /** from_coin is the total amount of tokens that the user wants to sell. */ + fromCoin: Coin; + /** + * to_coin_denom is the denom identifier of the token that the user wants to + * buy. + */ + toCoinDenom: string; + /** + * pool_id is the identifier of the liquidity pool that the trade will occur + * on. + */ + poolId: bigint; + /** + * max_price_impact is the maximum percentage that the user is willing + * to affect the price of the liquidity pool. + */ + maxPriceImpact: string; + /** + * external_price is an optional external price that the user can enter. + * It adjusts the MaxPriceImpact as the SpotPrice of a pool can be changed at + * any time. + */ + externalPrice: string; +} +export interface EstimateTradeBasedOnPriceImpactRequestProtoMsg { + typeUrl: "/osmosis.poolmanager.v1beta1.EstimateTradeBasedOnPriceImpactRequest"; + value: Uint8Array; +} +/** + * EstimateTradeBasedOnPriceImpactRequest represents a request to estimate a + * trade for Balancer/StableSwap/Concentrated liquidity pool types based on the + * given parameters. + */ +export interface EstimateTradeBasedOnPriceImpactRequestAmino { + /** from_coin is the total amount of tokens that the user wants to sell. */ + from_coin?: CoinAmino; + /** + * to_coin_denom is the denom identifier of the token that the user wants to + * buy. + */ + to_coin_denom?: string; + /** + * pool_id is the identifier of the liquidity pool that the trade will occur + * on. + */ + pool_id?: string; + /** + * max_price_impact is the maximum percentage that the user is willing + * to affect the price of the liquidity pool. + */ + max_price_impact?: string; + /** + * external_price is an optional external price that the user can enter. + * It adjusts the MaxPriceImpact as the SpotPrice of a pool can be changed at + * any time. + */ + external_price?: string; +} +export interface EstimateTradeBasedOnPriceImpactRequestAminoMsg { + type: "osmosis/poolmanager/estimate-trade-based-on-price-impact-request"; + value: EstimateTradeBasedOnPriceImpactRequestAmino; +} +/** + * EstimateTradeBasedOnPriceImpactRequest represents a request to estimate a + * trade for Balancer/StableSwap/Concentrated liquidity pool types based on the + * given parameters. + */ +export interface EstimateTradeBasedOnPriceImpactRequestSDKType { + from_coin: CoinSDKType; + to_coin_denom: string; + pool_id: bigint; + max_price_impact: string; + external_price: string; +} +/** + * EstimateTradeBasedOnPriceImpactResponse represents the response data + * for an estimated trade based on price impact. If a trade fails to be + * estimated the response would be 0,0 for input_coin and output_coin and will + * not error. + */ +export interface EstimateTradeBasedOnPriceImpactResponse { + /** + * input_coin is the actual input amount that would be tradeable + * under the specified price impact. + */ + inputCoin: Coin; + /** + * output_coin is the amount of tokens of the ToCoinDenom type + * that will be received for the actual InputCoin trade. + */ + outputCoin: Coin; +} +export interface EstimateTradeBasedOnPriceImpactResponseProtoMsg { + typeUrl: "/osmosis.poolmanager.v1beta1.EstimateTradeBasedOnPriceImpactResponse"; + value: Uint8Array; +} +/** + * EstimateTradeBasedOnPriceImpactResponse represents the response data + * for an estimated trade based on price impact. If a trade fails to be + * estimated the response would be 0,0 for input_coin and output_coin and will + * not error. + */ +export interface EstimateTradeBasedOnPriceImpactResponseAmino { + /** + * input_coin is the actual input amount that would be tradeable + * under the specified price impact. + */ + input_coin?: CoinAmino; + /** + * output_coin is the amount of tokens of the ToCoinDenom type + * that will be received for the actual InputCoin trade. + */ + output_coin?: CoinAmino; +} +export interface EstimateTradeBasedOnPriceImpactResponseAminoMsg { + type: "osmosis/poolmanager/estimate-trade-based-on-price-impact-response"; + value: EstimateTradeBasedOnPriceImpactResponseAmino; +} +/** + * EstimateTradeBasedOnPriceImpactResponse represents the response data + * for an estimated trade based on price impact. If a trade fails to be + * estimated the response would be 0,0 for input_coin and output_coin and will + * not error. + */ +export interface EstimateTradeBasedOnPriceImpactResponseSDKType { + input_coin: CoinSDKType; + output_coin: CoinSDKType; +} function createBaseParamsRequest(): ParamsRequest { return {}; } @@ -442,7 +770,8 @@ export const ParamsRequest = { return message; }, fromAmino(_: ParamsRequestAmino): ParamsRequest { - return {}; + const message = createBaseParamsRequest(); + return message; }, toAmino(_: ParamsRequest): ParamsRequestAmino { const obj: any = {}; @@ -506,9 +835,11 @@ export const ParamsResponse = { return message; }, fromAmino(object: ParamsResponseAmino): ParamsResponse { - return { - params: object?.params ? Params.fromAmino(object.params) : undefined - }; + const message = createBaseParamsResponse(); + if (object.params !== undefined && object.params !== null) { + message.params = Params.fromAmino(object.params); + } + return message; }, toAmino(message: ParamsResponse): ParamsResponseAmino { const obj: any = {}; @@ -589,11 +920,15 @@ export const EstimateSwapExactAmountInRequest = { return message; }, fromAmino(object: EstimateSwapExactAmountInRequestAmino): EstimateSwapExactAmountInRequest { - return { - poolId: BigInt(object.pool_id), - tokenIn: object.token_in, - routes: Array.isArray(object?.routes) ? object.routes.map((e: any) => SwapAmountInRoute.fromAmino(e)) : [] - }; + const message = createBaseEstimateSwapExactAmountInRequest(); + if (object.pool_id !== undefined && object.pool_id !== null) { + message.poolId = BigInt(object.pool_id); + } + if (object.token_in !== undefined && object.token_in !== null) { + message.tokenIn = object.token_in; + } + message.routes = object.routes?.map(e => SwapAmountInRoute.fromAmino(e)) || []; + return message; }, toAmino(message: EstimateSwapExactAmountInRequest): EstimateSwapExactAmountInRequestAmino { const obj: any = {}; @@ -628,6 +963,124 @@ export const EstimateSwapExactAmountInRequest = { }; } }; +function createBaseEstimateSwapExactAmountInWithPrimitiveTypesRequest(): EstimateSwapExactAmountInWithPrimitiveTypesRequest { + return { + poolId: BigInt(0), + tokenIn: "", + routesPoolId: [], + routesTokenOutDenom: [] + }; +} +export const EstimateSwapExactAmountInWithPrimitiveTypesRequest = { + typeUrl: "/osmosis.poolmanager.v1beta1.EstimateSwapExactAmountInWithPrimitiveTypesRequest", + encode(message: EstimateSwapExactAmountInWithPrimitiveTypesRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.poolId !== BigInt(0)) { + writer.uint32(8).uint64(message.poolId); + } + if (message.tokenIn !== "") { + writer.uint32(18).string(message.tokenIn); + } + writer.uint32(26).fork(); + for (const v of message.routesPoolId) { + writer.uint64(v); + } + writer.ldelim(); + for (const v of message.routesTokenOutDenom) { + writer.uint32(34).string(v!); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): EstimateSwapExactAmountInWithPrimitiveTypesRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseEstimateSwapExactAmountInWithPrimitiveTypesRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.poolId = reader.uint64(); + break; + case 2: + message.tokenIn = reader.string(); + break; + case 3: + if ((tag & 7) === 2) { + const end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) { + message.routesPoolId.push(reader.uint64()); + } + } else { + message.routesPoolId.push(reader.uint64()); + } + break; + case 4: + message.routesTokenOutDenom.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): EstimateSwapExactAmountInWithPrimitiveTypesRequest { + const message = createBaseEstimateSwapExactAmountInWithPrimitiveTypesRequest(); + message.poolId = object.poolId !== undefined && object.poolId !== null ? BigInt(object.poolId.toString()) : BigInt(0); + message.tokenIn = object.tokenIn ?? ""; + message.routesPoolId = object.routesPoolId?.map(e => BigInt(e.toString())) || []; + message.routesTokenOutDenom = object.routesTokenOutDenom?.map(e => e) || []; + return message; + }, + fromAmino(object: EstimateSwapExactAmountInWithPrimitiveTypesRequestAmino): EstimateSwapExactAmountInWithPrimitiveTypesRequest { + const message = createBaseEstimateSwapExactAmountInWithPrimitiveTypesRequest(); + if (object.pool_id !== undefined && object.pool_id !== null) { + message.poolId = BigInt(object.pool_id); + } + if (object.token_in !== undefined && object.token_in !== null) { + message.tokenIn = object.token_in; + } + message.routesPoolId = object.routes_pool_id?.map(e => BigInt(e)) || []; + message.routesTokenOutDenom = object.routes_token_out_denom?.map(e => e) || []; + return message; + }, + toAmino(message: EstimateSwapExactAmountInWithPrimitiveTypesRequest): EstimateSwapExactAmountInWithPrimitiveTypesRequestAmino { + const obj: any = {}; + obj.pool_id = message.poolId ? message.poolId.toString() : undefined; + obj.token_in = message.tokenIn; + if (message.routesPoolId) { + obj.routes_pool_id = message.routesPoolId.map(e => e.toString()); + } else { + obj.routes_pool_id = []; + } + if (message.routesTokenOutDenom) { + obj.routes_token_out_denom = message.routesTokenOutDenom.map(e => e); + } else { + obj.routes_token_out_denom = []; + } + return obj; + }, + fromAminoMsg(object: EstimateSwapExactAmountInWithPrimitiveTypesRequestAminoMsg): EstimateSwapExactAmountInWithPrimitiveTypesRequest { + return EstimateSwapExactAmountInWithPrimitiveTypesRequest.fromAmino(object.value); + }, + toAminoMsg(message: EstimateSwapExactAmountInWithPrimitiveTypesRequest): EstimateSwapExactAmountInWithPrimitiveTypesRequestAminoMsg { + return { + type: "osmosis/poolmanager/estimate-swap-exact-amount-in-with-primitive-types-request", + value: EstimateSwapExactAmountInWithPrimitiveTypesRequest.toAmino(message) + }; + }, + fromProtoMsg(message: EstimateSwapExactAmountInWithPrimitiveTypesRequestProtoMsg): EstimateSwapExactAmountInWithPrimitiveTypesRequest { + return EstimateSwapExactAmountInWithPrimitiveTypesRequest.decode(message.value); + }, + toProto(message: EstimateSwapExactAmountInWithPrimitiveTypesRequest): Uint8Array { + return EstimateSwapExactAmountInWithPrimitiveTypesRequest.encode(message).finish(); + }, + toProtoMsg(message: EstimateSwapExactAmountInWithPrimitiveTypesRequest): EstimateSwapExactAmountInWithPrimitiveTypesRequestProtoMsg { + return { + typeUrl: "/osmosis.poolmanager.v1beta1.EstimateSwapExactAmountInWithPrimitiveTypesRequest", + value: EstimateSwapExactAmountInWithPrimitiveTypesRequest.encode(message).finish() + }; + } +}; function createBaseEstimateSinglePoolSwapExactAmountInRequest(): EstimateSinglePoolSwapExactAmountInRequest { return { poolId: BigInt(0), @@ -680,11 +1133,17 @@ export const EstimateSinglePoolSwapExactAmountInRequest = { return message; }, fromAmino(object: EstimateSinglePoolSwapExactAmountInRequestAmino): EstimateSinglePoolSwapExactAmountInRequest { - return { - poolId: BigInt(object.pool_id), - tokenIn: object.token_in, - tokenOutDenom: object.token_out_denom - }; + const message = createBaseEstimateSinglePoolSwapExactAmountInRequest(); + if (object.pool_id !== undefined && object.pool_id !== null) { + message.poolId = BigInt(object.pool_id); + } + if (object.token_in !== undefined && object.token_in !== null) { + message.tokenIn = object.token_in; + } + if (object.token_out_denom !== undefined && object.token_out_denom !== null) { + message.tokenOutDenom = object.token_out_denom; + } + return message; }, toAmino(message: EstimateSinglePoolSwapExactAmountInRequest): EstimateSinglePoolSwapExactAmountInRequestAmino { const obj: any = {}; @@ -751,9 +1210,11 @@ export const EstimateSwapExactAmountInResponse = { return message; }, fromAmino(object: EstimateSwapExactAmountInResponseAmino): EstimateSwapExactAmountInResponse { - return { - tokenOutAmount: object.token_out_amount - }; + const message = createBaseEstimateSwapExactAmountInResponse(); + if (object.token_out_amount !== undefined && object.token_out_amount !== null) { + message.tokenOutAmount = object.token_out_amount; + } + return message; }, toAmino(message: EstimateSwapExactAmountInResponse): EstimateSwapExactAmountInResponseAmino { const obj: any = {}; @@ -834,11 +1295,15 @@ export const EstimateSwapExactAmountOutRequest = { return message; }, fromAmino(object: EstimateSwapExactAmountOutRequestAmino): EstimateSwapExactAmountOutRequest { - return { - poolId: BigInt(object.pool_id), - routes: Array.isArray(object?.routes) ? object.routes.map((e: any) => SwapAmountOutRoute.fromAmino(e)) : [], - tokenOut: object.token_out - }; + const message = createBaseEstimateSwapExactAmountOutRequest(); + if (object.pool_id !== undefined && object.pool_id !== null) { + message.poolId = BigInt(object.pool_id); + } + message.routes = object.routes?.map(e => SwapAmountOutRoute.fromAmino(e)) || []; + if (object.token_out !== undefined && object.token_out !== null) { + message.tokenOut = object.token_out; + } + return message; }, toAmino(message: EstimateSwapExactAmountOutRequest): EstimateSwapExactAmountOutRequestAmino { const obj: any = {}; @@ -873,31 +1338,37 @@ export const EstimateSwapExactAmountOutRequest = { }; } }; -function createBaseEstimateSinglePoolSwapExactAmountOutRequest(): EstimateSinglePoolSwapExactAmountOutRequest { +function createBaseEstimateSwapExactAmountOutWithPrimitiveTypesRequest(): EstimateSwapExactAmountOutWithPrimitiveTypesRequest { return { poolId: BigInt(0), - tokenInDenom: "", + routesPoolId: [], + routesTokenInDenom: [], tokenOut: "" }; } -export const EstimateSinglePoolSwapExactAmountOutRequest = { - typeUrl: "/osmosis.poolmanager.v1beta1.EstimateSinglePoolSwapExactAmountOutRequest", - encode(message: EstimateSinglePoolSwapExactAmountOutRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { +export const EstimateSwapExactAmountOutWithPrimitiveTypesRequest = { + typeUrl: "/osmosis.poolmanager.v1beta1.EstimateSwapExactAmountOutWithPrimitiveTypesRequest", + encode(message: EstimateSwapExactAmountOutWithPrimitiveTypesRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.poolId !== BigInt(0)) { writer.uint32(8).uint64(message.poolId); } - if (message.tokenInDenom !== "") { - writer.uint32(18).string(message.tokenInDenom); + writer.uint32(18).fork(); + for (const v of message.routesPoolId) { + writer.uint64(v); + } + writer.ldelim(); + for (const v of message.routesTokenInDenom) { + writer.uint32(26).string(v!); } if (message.tokenOut !== "") { - writer.uint32(26).string(message.tokenOut); + writer.uint32(34).string(message.tokenOut); } return writer; }, - decode(input: BinaryReader | Uint8Array, length?: number): EstimateSinglePoolSwapExactAmountOutRequest { + decode(input: BinaryReader | Uint8Array, length?: number): EstimateSwapExactAmountOutWithPrimitiveTypesRequest { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseEstimateSinglePoolSwapExactAmountOutRequest(); + const message = createBaseEstimateSwapExactAmountOutWithPrimitiveTypesRequest(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -905,9 +1376,19 @@ export const EstimateSinglePoolSwapExactAmountOutRequest = { message.poolId = reader.uint64(); break; case 2: - message.tokenInDenom = reader.string(); + if ((tag & 7) === 2) { + const end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) { + message.routesPoolId.push(reader.uint64()); + } + } else { + message.routesPoolId.push(reader.uint64()); + } break; case 3: + message.routesTokenInDenom.push(reader.string()); + break; + case 4: message.tokenOut = reader.string(); break; default: @@ -917,59 +1398,167 @@ export const EstimateSinglePoolSwapExactAmountOutRequest = { } return message; }, - fromPartial(object: Partial): EstimateSinglePoolSwapExactAmountOutRequest { - const message = createBaseEstimateSinglePoolSwapExactAmountOutRequest(); + fromPartial(object: Partial): EstimateSwapExactAmountOutWithPrimitiveTypesRequest { + const message = createBaseEstimateSwapExactAmountOutWithPrimitiveTypesRequest(); message.poolId = object.poolId !== undefined && object.poolId !== null ? BigInt(object.poolId.toString()) : BigInt(0); - message.tokenInDenom = object.tokenInDenom ?? ""; + message.routesPoolId = object.routesPoolId?.map(e => BigInt(e.toString())) || []; + message.routesTokenInDenom = object.routesTokenInDenom?.map(e => e) || []; message.tokenOut = object.tokenOut ?? ""; return message; }, - fromAmino(object: EstimateSinglePoolSwapExactAmountOutRequestAmino): EstimateSinglePoolSwapExactAmountOutRequest { - return { - poolId: BigInt(object.pool_id), - tokenInDenom: object.token_in_denom, - tokenOut: object.token_out - }; + fromAmino(object: EstimateSwapExactAmountOutWithPrimitiveTypesRequestAmino): EstimateSwapExactAmountOutWithPrimitiveTypesRequest { + const message = createBaseEstimateSwapExactAmountOutWithPrimitiveTypesRequest(); + if (object.pool_id !== undefined && object.pool_id !== null) { + message.poolId = BigInt(object.pool_id); + } + message.routesPoolId = object.routes_pool_id?.map(e => BigInt(e)) || []; + message.routesTokenInDenom = object.routes_token_in_denom?.map(e => e) || []; + if (object.token_out !== undefined && object.token_out !== null) { + message.tokenOut = object.token_out; + } + return message; }, - toAmino(message: EstimateSinglePoolSwapExactAmountOutRequest): EstimateSinglePoolSwapExactAmountOutRequestAmino { + toAmino(message: EstimateSwapExactAmountOutWithPrimitiveTypesRequest): EstimateSwapExactAmountOutWithPrimitiveTypesRequestAmino { const obj: any = {}; obj.pool_id = message.poolId ? message.poolId.toString() : undefined; - obj.token_in_denom = message.tokenInDenom; + if (message.routesPoolId) { + obj.routes_pool_id = message.routesPoolId.map(e => e.toString()); + } else { + obj.routes_pool_id = []; + } + if (message.routesTokenInDenom) { + obj.routes_token_in_denom = message.routesTokenInDenom.map(e => e); + } else { + obj.routes_token_in_denom = []; + } obj.token_out = message.tokenOut; return obj; }, - fromAminoMsg(object: EstimateSinglePoolSwapExactAmountOutRequestAminoMsg): EstimateSinglePoolSwapExactAmountOutRequest { - return EstimateSinglePoolSwapExactAmountOutRequest.fromAmino(object.value); + fromAminoMsg(object: EstimateSwapExactAmountOutWithPrimitiveTypesRequestAminoMsg): EstimateSwapExactAmountOutWithPrimitiveTypesRequest { + return EstimateSwapExactAmountOutWithPrimitiveTypesRequest.fromAmino(object.value); }, - toAminoMsg(message: EstimateSinglePoolSwapExactAmountOutRequest): EstimateSinglePoolSwapExactAmountOutRequestAminoMsg { + toAminoMsg(message: EstimateSwapExactAmountOutWithPrimitiveTypesRequest): EstimateSwapExactAmountOutWithPrimitiveTypesRequestAminoMsg { return { - type: "osmosis/poolmanager/estimate-single-pool-swap-exact-amount-out-request", - value: EstimateSinglePoolSwapExactAmountOutRequest.toAmino(message) + type: "osmosis/poolmanager/estimate-swap-exact-amount-out-with-primitive-types-request", + value: EstimateSwapExactAmountOutWithPrimitiveTypesRequest.toAmino(message) }; }, - fromProtoMsg(message: EstimateSinglePoolSwapExactAmountOutRequestProtoMsg): EstimateSinglePoolSwapExactAmountOutRequest { - return EstimateSinglePoolSwapExactAmountOutRequest.decode(message.value); + fromProtoMsg(message: EstimateSwapExactAmountOutWithPrimitiveTypesRequestProtoMsg): EstimateSwapExactAmountOutWithPrimitiveTypesRequest { + return EstimateSwapExactAmountOutWithPrimitiveTypesRequest.decode(message.value); }, - toProto(message: EstimateSinglePoolSwapExactAmountOutRequest): Uint8Array { - return EstimateSinglePoolSwapExactAmountOutRequest.encode(message).finish(); + toProto(message: EstimateSwapExactAmountOutWithPrimitiveTypesRequest): Uint8Array { + return EstimateSwapExactAmountOutWithPrimitiveTypesRequest.encode(message).finish(); }, - toProtoMsg(message: EstimateSinglePoolSwapExactAmountOutRequest): EstimateSinglePoolSwapExactAmountOutRequestProtoMsg { + toProtoMsg(message: EstimateSwapExactAmountOutWithPrimitiveTypesRequest): EstimateSwapExactAmountOutWithPrimitiveTypesRequestProtoMsg { return { - typeUrl: "/osmosis.poolmanager.v1beta1.EstimateSinglePoolSwapExactAmountOutRequest", - value: EstimateSinglePoolSwapExactAmountOutRequest.encode(message).finish() + typeUrl: "/osmosis.poolmanager.v1beta1.EstimateSwapExactAmountOutWithPrimitiveTypesRequest", + value: EstimateSwapExactAmountOutWithPrimitiveTypesRequest.encode(message).finish() }; } }; -function createBaseEstimateSwapExactAmountOutResponse(): EstimateSwapExactAmountOutResponse { +function createBaseEstimateSinglePoolSwapExactAmountOutRequest(): EstimateSinglePoolSwapExactAmountOutRequest { return { - tokenInAmount: "" + poolId: BigInt(0), + tokenInDenom: "", + tokenOut: "" }; } -export const EstimateSwapExactAmountOutResponse = { - typeUrl: "/osmosis.poolmanager.v1beta1.EstimateSwapExactAmountOutResponse", - encode(message: EstimateSwapExactAmountOutResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { - if (message.tokenInAmount !== "") { - writer.uint32(10).string(message.tokenInAmount); +export const EstimateSinglePoolSwapExactAmountOutRequest = { + typeUrl: "/osmosis.poolmanager.v1beta1.EstimateSinglePoolSwapExactAmountOutRequest", + encode(message: EstimateSinglePoolSwapExactAmountOutRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.poolId !== BigInt(0)) { + writer.uint32(8).uint64(message.poolId); + } + if (message.tokenInDenom !== "") { + writer.uint32(18).string(message.tokenInDenom); + } + if (message.tokenOut !== "") { + writer.uint32(26).string(message.tokenOut); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): EstimateSinglePoolSwapExactAmountOutRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseEstimateSinglePoolSwapExactAmountOutRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.poolId = reader.uint64(); + break; + case 2: + message.tokenInDenom = reader.string(); + break; + case 3: + message.tokenOut = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): EstimateSinglePoolSwapExactAmountOutRequest { + const message = createBaseEstimateSinglePoolSwapExactAmountOutRequest(); + message.poolId = object.poolId !== undefined && object.poolId !== null ? BigInt(object.poolId.toString()) : BigInt(0); + message.tokenInDenom = object.tokenInDenom ?? ""; + message.tokenOut = object.tokenOut ?? ""; + return message; + }, + fromAmino(object: EstimateSinglePoolSwapExactAmountOutRequestAmino): EstimateSinglePoolSwapExactAmountOutRequest { + const message = createBaseEstimateSinglePoolSwapExactAmountOutRequest(); + if (object.pool_id !== undefined && object.pool_id !== null) { + message.poolId = BigInt(object.pool_id); + } + if (object.token_in_denom !== undefined && object.token_in_denom !== null) { + message.tokenInDenom = object.token_in_denom; + } + if (object.token_out !== undefined && object.token_out !== null) { + message.tokenOut = object.token_out; + } + return message; + }, + toAmino(message: EstimateSinglePoolSwapExactAmountOutRequest): EstimateSinglePoolSwapExactAmountOutRequestAmino { + const obj: any = {}; + obj.pool_id = message.poolId ? message.poolId.toString() : undefined; + obj.token_in_denom = message.tokenInDenom; + obj.token_out = message.tokenOut; + return obj; + }, + fromAminoMsg(object: EstimateSinglePoolSwapExactAmountOutRequestAminoMsg): EstimateSinglePoolSwapExactAmountOutRequest { + return EstimateSinglePoolSwapExactAmountOutRequest.fromAmino(object.value); + }, + toAminoMsg(message: EstimateSinglePoolSwapExactAmountOutRequest): EstimateSinglePoolSwapExactAmountOutRequestAminoMsg { + return { + type: "osmosis/poolmanager/estimate-single-pool-swap-exact-amount-out-request", + value: EstimateSinglePoolSwapExactAmountOutRequest.toAmino(message) + }; + }, + fromProtoMsg(message: EstimateSinglePoolSwapExactAmountOutRequestProtoMsg): EstimateSinglePoolSwapExactAmountOutRequest { + return EstimateSinglePoolSwapExactAmountOutRequest.decode(message.value); + }, + toProto(message: EstimateSinglePoolSwapExactAmountOutRequest): Uint8Array { + return EstimateSinglePoolSwapExactAmountOutRequest.encode(message).finish(); + }, + toProtoMsg(message: EstimateSinglePoolSwapExactAmountOutRequest): EstimateSinglePoolSwapExactAmountOutRequestProtoMsg { + return { + typeUrl: "/osmosis.poolmanager.v1beta1.EstimateSinglePoolSwapExactAmountOutRequest", + value: EstimateSinglePoolSwapExactAmountOutRequest.encode(message).finish() + }; + } +}; +function createBaseEstimateSwapExactAmountOutResponse(): EstimateSwapExactAmountOutResponse { + return { + tokenInAmount: "" + }; +} +export const EstimateSwapExactAmountOutResponse = { + typeUrl: "/osmosis.poolmanager.v1beta1.EstimateSwapExactAmountOutResponse", + encode(message: EstimateSwapExactAmountOutResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.tokenInAmount !== "") { + writer.uint32(10).string(message.tokenInAmount); } return writer; }, @@ -996,9 +1585,11 @@ export const EstimateSwapExactAmountOutResponse = { return message; }, fromAmino(object: EstimateSwapExactAmountOutResponseAmino): EstimateSwapExactAmountOutResponse { - return { - tokenInAmount: object.token_in_amount - }; + const message = createBaseEstimateSwapExactAmountOutResponse(); + if (object.token_in_amount !== undefined && object.token_in_amount !== null) { + message.tokenInAmount = object.token_in_amount; + } + return message; }, toAmino(message: EstimateSwapExactAmountOutResponse): EstimateSwapExactAmountOutResponseAmino { const obj: any = {}; @@ -1054,7 +1645,8 @@ export const NumPoolsRequest = { return message; }, fromAmino(_: NumPoolsRequestAmino): NumPoolsRequest { - return {}; + const message = createBaseNumPoolsRequest(); + return message; }, toAmino(_: NumPoolsRequest): NumPoolsRequestAmino { const obj: any = {}; @@ -1118,9 +1710,11 @@ export const NumPoolsResponse = { return message; }, fromAmino(object: NumPoolsResponseAmino): NumPoolsResponse { - return { - numPools: BigInt(object.num_pools) - }; + const message = createBaseNumPoolsResponse(); + if (object.num_pools !== undefined && object.num_pools !== null) { + message.numPools = BigInt(object.num_pools); + } + return message; }, toAmino(message: NumPoolsResponse): NumPoolsResponseAmino { const obj: any = {}; @@ -1185,9 +1779,11 @@ export const PoolRequest = { return message; }, fromAmino(object: PoolRequestAmino): PoolRequest { - return { - poolId: BigInt(object.pool_id) - }; + const message = createBasePoolRequest(); + if (object.pool_id !== undefined && object.pool_id !== null) { + message.poolId = BigInt(object.pool_id); + } + return message; }, toAmino(message: PoolRequest): PoolRequestAmino { const obj: any = {}; @@ -1218,7 +1814,7 @@ export const PoolRequest = { }; function createBasePoolResponse(): PoolResponse { return { - pool: Any.fromPartial({}) + pool: undefined }; } export const PoolResponse = { @@ -1252,9 +1848,11 @@ export const PoolResponse = { return message; }, fromAmino(object: PoolResponseAmino): PoolResponse { - return { - pool: object?.pool ? PoolI_FromAmino(object.pool) : undefined - }; + const message = createBasePoolResponse(); + if (object.pool !== undefined && object.pool !== null) { + message.pool = PoolI_FromAmino(object.pool); + } + return message; }, toAmino(message: PoolResponse): PoolResponseAmino { const obj: any = {}; @@ -1310,7 +1908,8 @@ export const AllPoolsRequest = { return message; }, fromAmino(_: AllPoolsRequestAmino): AllPoolsRequest { - return {}; + const message = createBaseAllPoolsRequest(); + return message; }, toAmino(_: AllPoolsRequest): AllPoolsRequestAmino { const obj: any = {}; @@ -1359,7 +1958,7 @@ export const AllPoolsResponse = { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.pools.push((PoolI_InterfaceDecoder(reader) as Any)); + message.pools.push((Any(reader) as Any)); break; default: reader.skipType(tag & 7); @@ -1374,9 +1973,9 @@ export const AllPoolsResponse = { return message; }, fromAmino(object: AllPoolsResponseAmino): AllPoolsResponse { - return { - pools: Array.isArray(object?.pools) ? object.pools.map((e: any) => PoolI_FromAmino(e)) : [] - }; + const message = createBaseAllPoolsResponse(); + message.pools = object.pools?.map(e => PoolI_FromAmino(e)) || []; + return message; }, toAmino(message: AllPoolsResponse): AllPoolsResponseAmino { const obj: any = {}; @@ -1409,6 +2008,146 @@ export const AllPoolsResponse = { }; } }; +function createBaseListPoolsByDenomRequest(): ListPoolsByDenomRequest { + return { + denom: "" + }; +} +export const ListPoolsByDenomRequest = { + typeUrl: "/osmosis.poolmanager.v1beta1.ListPoolsByDenomRequest", + encode(message: ListPoolsByDenomRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.denom !== "") { + writer.uint32(10).string(message.denom); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): ListPoolsByDenomRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseListPoolsByDenomRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.denom = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): ListPoolsByDenomRequest { + const message = createBaseListPoolsByDenomRequest(); + message.denom = object.denom ?? ""; + return message; + }, + fromAmino(object: ListPoolsByDenomRequestAmino): ListPoolsByDenomRequest { + const message = createBaseListPoolsByDenomRequest(); + if (object.denom !== undefined && object.denom !== null) { + message.denom = object.denom; + } + return message; + }, + toAmino(message: ListPoolsByDenomRequest): ListPoolsByDenomRequestAmino { + const obj: any = {}; + obj.denom = message.denom; + return obj; + }, + fromAminoMsg(object: ListPoolsByDenomRequestAminoMsg): ListPoolsByDenomRequest { + return ListPoolsByDenomRequest.fromAmino(object.value); + }, + toAminoMsg(message: ListPoolsByDenomRequest): ListPoolsByDenomRequestAminoMsg { + return { + type: "osmosis/poolmanager/list-pools-by-denom-request", + value: ListPoolsByDenomRequest.toAmino(message) + }; + }, + fromProtoMsg(message: ListPoolsByDenomRequestProtoMsg): ListPoolsByDenomRequest { + return ListPoolsByDenomRequest.decode(message.value); + }, + toProto(message: ListPoolsByDenomRequest): Uint8Array { + return ListPoolsByDenomRequest.encode(message).finish(); + }, + toProtoMsg(message: ListPoolsByDenomRequest): ListPoolsByDenomRequestProtoMsg { + return { + typeUrl: "/osmosis.poolmanager.v1beta1.ListPoolsByDenomRequest", + value: ListPoolsByDenomRequest.encode(message).finish() + }; + } +}; +function createBaseListPoolsByDenomResponse(): ListPoolsByDenomResponse { + return { + pools: [] + }; +} +export const ListPoolsByDenomResponse = { + typeUrl: "/osmosis.poolmanager.v1beta1.ListPoolsByDenomResponse", + encode(message: ListPoolsByDenomResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.pools) { + Any.encode((v! as Any), writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): ListPoolsByDenomResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseListPoolsByDenomResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.pools.push((Any(reader) as Any)); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): ListPoolsByDenomResponse { + const message = createBaseListPoolsByDenomResponse(); + message.pools = object.pools?.map(e => Any.fromPartial(e)) || []; + return message; + }, + fromAmino(object: ListPoolsByDenomResponseAmino): ListPoolsByDenomResponse { + const message = createBaseListPoolsByDenomResponse(); + message.pools = object.pools?.map(e => PoolI_FromAmino(e)) || []; + return message; + }, + toAmino(message: ListPoolsByDenomResponse): ListPoolsByDenomResponseAmino { + const obj: any = {}; + if (message.pools) { + obj.pools = message.pools.map(e => e ? PoolI_ToAmino((e as Any)) : undefined); + } else { + obj.pools = []; + } + return obj; + }, + fromAminoMsg(object: ListPoolsByDenomResponseAminoMsg): ListPoolsByDenomResponse { + return ListPoolsByDenomResponse.fromAmino(object.value); + }, + toAminoMsg(message: ListPoolsByDenomResponse): ListPoolsByDenomResponseAminoMsg { + return { + type: "osmosis/poolmanager/list-pools-by-denom-response", + value: ListPoolsByDenomResponse.toAmino(message) + }; + }, + fromProtoMsg(message: ListPoolsByDenomResponseProtoMsg): ListPoolsByDenomResponse { + return ListPoolsByDenomResponse.decode(message.value); + }, + toProto(message: ListPoolsByDenomResponse): Uint8Array { + return ListPoolsByDenomResponse.encode(message).finish(); + }, + toProtoMsg(message: ListPoolsByDenomResponse): ListPoolsByDenomResponseProtoMsg { + return { + typeUrl: "/osmosis.poolmanager.v1beta1.ListPoolsByDenomResponse", + value: ListPoolsByDenomResponse.encode(message).finish() + }; + } +}; function createBaseSpotPriceRequest(): SpotPriceRequest { return { poolId: BigInt(0), @@ -1461,11 +2200,17 @@ export const SpotPriceRequest = { return message; }, fromAmino(object: SpotPriceRequestAmino): SpotPriceRequest { - return { - poolId: BigInt(object.pool_id), - baseAssetDenom: object.base_asset_denom, - quoteAssetDenom: object.quote_asset_denom - }; + const message = createBaseSpotPriceRequest(); + if (object.pool_id !== undefined && object.pool_id !== null) { + message.poolId = BigInt(object.pool_id); + } + if (object.base_asset_denom !== undefined && object.base_asset_denom !== null) { + message.baseAssetDenom = object.base_asset_denom; + } + if (object.quote_asset_denom !== undefined && object.quote_asset_denom !== null) { + message.quoteAssetDenom = object.quote_asset_denom; + } + return message; }, toAmino(message: SpotPriceRequest): SpotPriceRequestAmino { const obj: any = {}; @@ -1532,9 +2277,11 @@ export const SpotPriceResponse = { return message; }, fromAmino(object: SpotPriceResponseAmino): SpotPriceResponse { - return { - spotPrice: object.spot_price - }; + const message = createBaseSpotPriceResponse(); + if (object.spot_price !== undefined && object.spot_price !== null) { + message.spotPrice = object.spot_price; + } + return message; }, toAmino(message: SpotPriceResponse): SpotPriceResponseAmino { const obj: any = {}; @@ -1599,9 +2346,11 @@ export const TotalPoolLiquidityRequest = { return message; }, fromAmino(object: TotalPoolLiquidityRequestAmino): TotalPoolLiquidityRequest { - return { - poolId: BigInt(object.pool_id) - }; + const message = createBaseTotalPoolLiquidityRequest(); + if (object.pool_id !== undefined && object.pool_id !== null) { + message.poolId = BigInt(object.pool_id); + } + return message; }, toAmino(message: TotalPoolLiquidityRequest): TotalPoolLiquidityRequestAmino { const obj: any = {}; @@ -1666,9 +2415,9 @@ export const TotalPoolLiquidityResponse = { return message; }, fromAmino(object: TotalPoolLiquidityResponseAmino): TotalPoolLiquidityResponse { - return { - liquidity: Array.isArray(object?.liquidity) ? object.liquidity.map((e: any) => Coin.fromAmino(e)) : [] - }; + const message = createBaseTotalPoolLiquidityResponse(); + message.liquidity = object.liquidity?.map(e => Coin.fromAmino(e)) || []; + return message; }, toAmino(message: TotalPoolLiquidityResponse): TotalPoolLiquidityResponseAmino { const obj: any = {}; @@ -1728,7 +2477,8 @@ export const TotalLiquidityRequest = { return message; }, fromAmino(_: TotalLiquidityRequestAmino): TotalLiquidityRequest { - return {}; + const message = createBaseTotalLiquidityRequest(); + return message; }, toAmino(_: TotalLiquidityRequest): TotalLiquidityRequestAmino { const obj: any = {}; @@ -1792,9 +2542,9 @@ export const TotalLiquidityResponse = { return message; }, fromAmino(object: TotalLiquidityResponseAmino): TotalLiquidityResponse { - return { - liquidity: Array.isArray(object?.liquidity) ? object.liquidity.map((e: any) => Coin.fromAmino(e)) : [] - }; + const message = createBaseTotalLiquidityResponse(); + message.liquidity = object.liquidity?.map(e => Coin.fromAmino(e)) || []; + return message; }, toAmino(message: TotalLiquidityResponse): TotalLiquidityResponseAmino { const obj: any = {}; @@ -1827,18 +2577,506 @@ export const TotalLiquidityResponse = { }; } }; +function createBaseTotalVolumeForPoolRequest(): TotalVolumeForPoolRequest { + return { + poolId: BigInt(0) + }; +} +export const TotalVolumeForPoolRequest = { + typeUrl: "/osmosis.poolmanager.v1beta1.TotalVolumeForPoolRequest", + encode(message: TotalVolumeForPoolRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.poolId !== BigInt(0)) { + writer.uint32(8).uint64(message.poolId); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): TotalVolumeForPoolRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseTotalVolumeForPoolRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.poolId = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): TotalVolumeForPoolRequest { + const message = createBaseTotalVolumeForPoolRequest(); + message.poolId = object.poolId !== undefined && object.poolId !== null ? BigInt(object.poolId.toString()) : BigInt(0); + return message; + }, + fromAmino(object: TotalVolumeForPoolRequestAmino): TotalVolumeForPoolRequest { + const message = createBaseTotalVolumeForPoolRequest(); + if (object.pool_id !== undefined && object.pool_id !== null) { + message.poolId = BigInt(object.pool_id); + } + return message; + }, + toAmino(message: TotalVolumeForPoolRequest): TotalVolumeForPoolRequestAmino { + const obj: any = {}; + obj.pool_id = message.poolId ? message.poolId.toString() : undefined; + return obj; + }, + fromAminoMsg(object: TotalVolumeForPoolRequestAminoMsg): TotalVolumeForPoolRequest { + return TotalVolumeForPoolRequest.fromAmino(object.value); + }, + toAminoMsg(message: TotalVolumeForPoolRequest): TotalVolumeForPoolRequestAminoMsg { + return { + type: "osmosis/poolmanager/total-volume-for-pool-request", + value: TotalVolumeForPoolRequest.toAmino(message) + }; + }, + fromProtoMsg(message: TotalVolumeForPoolRequestProtoMsg): TotalVolumeForPoolRequest { + return TotalVolumeForPoolRequest.decode(message.value); + }, + toProto(message: TotalVolumeForPoolRequest): Uint8Array { + return TotalVolumeForPoolRequest.encode(message).finish(); + }, + toProtoMsg(message: TotalVolumeForPoolRequest): TotalVolumeForPoolRequestProtoMsg { + return { + typeUrl: "/osmosis.poolmanager.v1beta1.TotalVolumeForPoolRequest", + value: TotalVolumeForPoolRequest.encode(message).finish() + }; + } +}; +function createBaseTotalVolumeForPoolResponse(): TotalVolumeForPoolResponse { + return { + volume: [] + }; +} +export const TotalVolumeForPoolResponse = { + typeUrl: "/osmosis.poolmanager.v1beta1.TotalVolumeForPoolResponse", + encode(message: TotalVolumeForPoolResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.volume) { + Coin.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): TotalVolumeForPoolResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseTotalVolumeForPoolResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.volume.push(Coin.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): TotalVolumeForPoolResponse { + const message = createBaseTotalVolumeForPoolResponse(); + message.volume = object.volume?.map(e => Coin.fromPartial(e)) || []; + return message; + }, + fromAmino(object: TotalVolumeForPoolResponseAmino): TotalVolumeForPoolResponse { + const message = createBaseTotalVolumeForPoolResponse(); + message.volume = object.volume?.map(e => Coin.fromAmino(e)) || []; + return message; + }, + toAmino(message: TotalVolumeForPoolResponse): TotalVolumeForPoolResponseAmino { + const obj: any = {}; + if (message.volume) { + obj.volume = message.volume.map(e => e ? Coin.toAmino(e) : undefined); + } else { + obj.volume = []; + } + return obj; + }, + fromAminoMsg(object: TotalVolumeForPoolResponseAminoMsg): TotalVolumeForPoolResponse { + return TotalVolumeForPoolResponse.fromAmino(object.value); + }, + toAminoMsg(message: TotalVolumeForPoolResponse): TotalVolumeForPoolResponseAminoMsg { + return { + type: "osmosis/poolmanager/total-volume-for-pool-response", + value: TotalVolumeForPoolResponse.toAmino(message) + }; + }, + fromProtoMsg(message: TotalVolumeForPoolResponseProtoMsg): TotalVolumeForPoolResponse { + return TotalVolumeForPoolResponse.decode(message.value); + }, + toProto(message: TotalVolumeForPoolResponse): Uint8Array { + return TotalVolumeForPoolResponse.encode(message).finish(); + }, + toProtoMsg(message: TotalVolumeForPoolResponse): TotalVolumeForPoolResponseProtoMsg { + return { + typeUrl: "/osmosis.poolmanager.v1beta1.TotalVolumeForPoolResponse", + value: TotalVolumeForPoolResponse.encode(message).finish() + }; + } +}; +function createBaseTradingPairTakerFeeRequest(): TradingPairTakerFeeRequest { + return { + denom0: "", + denom1: "" + }; +} +export const TradingPairTakerFeeRequest = { + typeUrl: "/osmosis.poolmanager.v1beta1.TradingPairTakerFeeRequest", + encode(message: TradingPairTakerFeeRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.denom0 !== "") { + writer.uint32(10).string(message.denom0); + } + if (message.denom1 !== "") { + writer.uint32(18).string(message.denom1); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): TradingPairTakerFeeRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseTradingPairTakerFeeRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.denom0 = reader.string(); + break; + case 2: + message.denom1 = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): TradingPairTakerFeeRequest { + const message = createBaseTradingPairTakerFeeRequest(); + message.denom0 = object.denom0 ?? ""; + message.denom1 = object.denom1 ?? ""; + return message; + }, + fromAmino(object: TradingPairTakerFeeRequestAmino): TradingPairTakerFeeRequest { + const message = createBaseTradingPairTakerFeeRequest(); + if (object.denom_0 !== undefined && object.denom_0 !== null) { + message.denom0 = object.denom_0; + } + if (object.denom_1 !== undefined && object.denom_1 !== null) { + message.denom1 = object.denom_1; + } + return message; + }, + toAmino(message: TradingPairTakerFeeRequest): TradingPairTakerFeeRequestAmino { + const obj: any = {}; + obj.denom_0 = message.denom0; + obj.denom_1 = message.denom1; + return obj; + }, + fromAminoMsg(object: TradingPairTakerFeeRequestAminoMsg): TradingPairTakerFeeRequest { + return TradingPairTakerFeeRequest.fromAmino(object.value); + }, + toAminoMsg(message: TradingPairTakerFeeRequest): TradingPairTakerFeeRequestAminoMsg { + return { + type: "osmosis/poolmanager/trading-pair-taker-fee-request", + value: TradingPairTakerFeeRequest.toAmino(message) + }; + }, + fromProtoMsg(message: TradingPairTakerFeeRequestProtoMsg): TradingPairTakerFeeRequest { + return TradingPairTakerFeeRequest.decode(message.value); + }, + toProto(message: TradingPairTakerFeeRequest): Uint8Array { + return TradingPairTakerFeeRequest.encode(message).finish(); + }, + toProtoMsg(message: TradingPairTakerFeeRequest): TradingPairTakerFeeRequestProtoMsg { + return { + typeUrl: "/osmosis.poolmanager.v1beta1.TradingPairTakerFeeRequest", + value: TradingPairTakerFeeRequest.encode(message).finish() + }; + } +}; +function createBaseTradingPairTakerFeeResponse(): TradingPairTakerFeeResponse { + return { + takerFee: "" + }; +} +export const TradingPairTakerFeeResponse = { + typeUrl: "/osmosis.poolmanager.v1beta1.TradingPairTakerFeeResponse", + encode(message: TradingPairTakerFeeResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.takerFee !== "") { + writer.uint32(10).string(Decimal.fromUserInput(message.takerFee, 18).atomics); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): TradingPairTakerFeeResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseTradingPairTakerFeeResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.takerFee = Decimal.fromAtomics(reader.string(), 18).toString(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): TradingPairTakerFeeResponse { + const message = createBaseTradingPairTakerFeeResponse(); + message.takerFee = object.takerFee ?? ""; + return message; + }, + fromAmino(object: TradingPairTakerFeeResponseAmino): TradingPairTakerFeeResponse { + const message = createBaseTradingPairTakerFeeResponse(); + if (object.taker_fee !== undefined && object.taker_fee !== null) { + message.takerFee = object.taker_fee; + } + return message; + }, + toAmino(message: TradingPairTakerFeeResponse): TradingPairTakerFeeResponseAmino { + const obj: any = {}; + obj.taker_fee = message.takerFee; + return obj; + }, + fromAminoMsg(object: TradingPairTakerFeeResponseAminoMsg): TradingPairTakerFeeResponse { + return TradingPairTakerFeeResponse.fromAmino(object.value); + }, + toAminoMsg(message: TradingPairTakerFeeResponse): TradingPairTakerFeeResponseAminoMsg { + return { + type: "osmosis/poolmanager/trading-pair-taker-fee-response", + value: TradingPairTakerFeeResponse.toAmino(message) + }; + }, + fromProtoMsg(message: TradingPairTakerFeeResponseProtoMsg): TradingPairTakerFeeResponse { + return TradingPairTakerFeeResponse.decode(message.value); + }, + toProto(message: TradingPairTakerFeeResponse): Uint8Array { + return TradingPairTakerFeeResponse.encode(message).finish(); + }, + toProtoMsg(message: TradingPairTakerFeeResponse): TradingPairTakerFeeResponseProtoMsg { + return { + typeUrl: "/osmosis.poolmanager.v1beta1.TradingPairTakerFeeResponse", + value: TradingPairTakerFeeResponse.encode(message).finish() + }; + } +}; +function createBaseEstimateTradeBasedOnPriceImpactRequest(): EstimateTradeBasedOnPriceImpactRequest { + return { + fromCoin: Coin.fromPartial({}), + toCoinDenom: "", + poolId: BigInt(0), + maxPriceImpact: "", + externalPrice: "" + }; +} +export const EstimateTradeBasedOnPriceImpactRequest = { + typeUrl: "/osmosis.poolmanager.v1beta1.EstimateTradeBasedOnPriceImpactRequest", + encode(message: EstimateTradeBasedOnPriceImpactRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.fromCoin !== undefined) { + Coin.encode(message.fromCoin, writer.uint32(10).fork()).ldelim(); + } + if (message.toCoinDenom !== "") { + writer.uint32(18).string(message.toCoinDenom); + } + if (message.poolId !== BigInt(0)) { + writer.uint32(24).uint64(message.poolId); + } + if (message.maxPriceImpact !== "") { + writer.uint32(34).string(Decimal.fromUserInput(message.maxPriceImpact, 18).atomics); + } + if (message.externalPrice !== "") { + writer.uint32(42).string(Decimal.fromUserInput(message.externalPrice, 18).atomics); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): EstimateTradeBasedOnPriceImpactRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseEstimateTradeBasedOnPriceImpactRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.fromCoin = Coin.decode(reader, reader.uint32()); + break; + case 2: + message.toCoinDenom = reader.string(); + break; + case 3: + message.poolId = reader.uint64(); + break; + case 4: + message.maxPriceImpact = Decimal.fromAtomics(reader.string(), 18).toString(); + break; + case 5: + message.externalPrice = Decimal.fromAtomics(reader.string(), 18).toString(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): EstimateTradeBasedOnPriceImpactRequest { + const message = createBaseEstimateTradeBasedOnPriceImpactRequest(); + message.fromCoin = object.fromCoin !== undefined && object.fromCoin !== null ? Coin.fromPartial(object.fromCoin) : undefined; + message.toCoinDenom = object.toCoinDenom ?? ""; + message.poolId = object.poolId !== undefined && object.poolId !== null ? BigInt(object.poolId.toString()) : BigInt(0); + message.maxPriceImpact = object.maxPriceImpact ?? ""; + message.externalPrice = object.externalPrice ?? ""; + return message; + }, + fromAmino(object: EstimateTradeBasedOnPriceImpactRequestAmino): EstimateTradeBasedOnPriceImpactRequest { + const message = createBaseEstimateTradeBasedOnPriceImpactRequest(); + if (object.from_coin !== undefined && object.from_coin !== null) { + message.fromCoin = Coin.fromAmino(object.from_coin); + } + if (object.to_coin_denom !== undefined && object.to_coin_denom !== null) { + message.toCoinDenom = object.to_coin_denom; + } + if (object.pool_id !== undefined && object.pool_id !== null) { + message.poolId = BigInt(object.pool_id); + } + if (object.max_price_impact !== undefined && object.max_price_impact !== null) { + message.maxPriceImpact = object.max_price_impact; + } + if (object.external_price !== undefined && object.external_price !== null) { + message.externalPrice = object.external_price; + } + return message; + }, + toAmino(message: EstimateTradeBasedOnPriceImpactRequest): EstimateTradeBasedOnPriceImpactRequestAmino { + const obj: any = {}; + obj.from_coin = message.fromCoin ? Coin.toAmino(message.fromCoin) : undefined; + obj.to_coin_denom = message.toCoinDenom; + obj.pool_id = message.poolId ? message.poolId.toString() : undefined; + obj.max_price_impact = message.maxPriceImpact; + obj.external_price = message.externalPrice; + return obj; + }, + fromAminoMsg(object: EstimateTradeBasedOnPriceImpactRequestAminoMsg): EstimateTradeBasedOnPriceImpactRequest { + return EstimateTradeBasedOnPriceImpactRequest.fromAmino(object.value); + }, + toAminoMsg(message: EstimateTradeBasedOnPriceImpactRequest): EstimateTradeBasedOnPriceImpactRequestAminoMsg { + return { + type: "osmosis/poolmanager/estimate-trade-based-on-price-impact-request", + value: EstimateTradeBasedOnPriceImpactRequest.toAmino(message) + }; + }, + fromProtoMsg(message: EstimateTradeBasedOnPriceImpactRequestProtoMsg): EstimateTradeBasedOnPriceImpactRequest { + return EstimateTradeBasedOnPriceImpactRequest.decode(message.value); + }, + toProto(message: EstimateTradeBasedOnPriceImpactRequest): Uint8Array { + return EstimateTradeBasedOnPriceImpactRequest.encode(message).finish(); + }, + toProtoMsg(message: EstimateTradeBasedOnPriceImpactRequest): EstimateTradeBasedOnPriceImpactRequestProtoMsg { + return { + typeUrl: "/osmosis.poolmanager.v1beta1.EstimateTradeBasedOnPriceImpactRequest", + value: EstimateTradeBasedOnPriceImpactRequest.encode(message).finish() + }; + } +}; +function createBaseEstimateTradeBasedOnPriceImpactResponse(): EstimateTradeBasedOnPriceImpactResponse { + return { + inputCoin: Coin.fromPartial({}), + outputCoin: Coin.fromPartial({}) + }; +} +export const EstimateTradeBasedOnPriceImpactResponse = { + typeUrl: "/osmosis.poolmanager.v1beta1.EstimateTradeBasedOnPriceImpactResponse", + encode(message: EstimateTradeBasedOnPriceImpactResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.inputCoin !== undefined) { + Coin.encode(message.inputCoin, writer.uint32(10).fork()).ldelim(); + } + if (message.outputCoin !== undefined) { + Coin.encode(message.outputCoin, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): EstimateTradeBasedOnPriceImpactResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseEstimateTradeBasedOnPriceImpactResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.inputCoin = Coin.decode(reader, reader.uint32()); + break; + case 2: + message.outputCoin = Coin.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): EstimateTradeBasedOnPriceImpactResponse { + const message = createBaseEstimateTradeBasedOnPriceImpactResponse(); + message.inputCoin = object.inputCoin !== undefined && object.inputCoin !== null ? Coin.fromPartial(object.inputCoin) : undefined; + message.outputCoin = object.outputCoin !== undefined && object.outputCoin !== null ? Coin.fromPartial(object.outputCoin) : undefined; + return message; + }, + fromAmino(object: EstimateTradeBasedOnPriceImpactResponseAmino): EstimateTradeBasedOnPriceImpactResponse { + const message = createBaseEstimateTradeBasedOnPriceImpactResponse(); + if (object.input_coin !== undefined && object.input_coin !== null) { + message.inputCoin = Coin.fromAmino(object.input_coin); + } + if (object.output_coin !== undefined && object.output_coin !== null) { + message.outputCoin = Coin.fromAmino(object.output_coin); + } + return message; + }, + toAmino(message: EstimateTradeBasedOnPriceImpactResponse): EstimateTradeBasedOnPriceImpactResponseAmino { + const obj: any = {}; + obj.input_coin = message.inputCoin ? Coin.toAmino(message.inputCoin) : undefined; + obj.output_coin = message.outputCoin ? Coin.toAmino(message.outputCoin) : undefined; + return obj; + }, + fromAminoMsg(object: EstimateTradeBasedOnPriceImpactResponseAminoMsg): EstimateTradeBasedOnPriceImpactResponse { + return EstimateTradeBasedOnPriceImpactResponse.fromAmino(object.value); + }, + toAminoMsg(message: EstimateTradeBasedOnPriceImpactResponse): EstimateTradeBasedOnPriceImpactResponseAminoMsg { + return { + type: "osmosis/poolmanager/estimate-trade-based-on-price-impact-response", + value: EstimateTradeBasedOnPriceImpactResponse.toAmino(message) + }; + }, + fromProtoMsg(message: EstimateTradeBasedOnPriceImpactResponseProtoMsg): EstimateTradeBasedOnPriceImpactResponse { + return EstimateTradeBasedOnPriceImpactResponse.decode(message.value); + }, + toProto(message: EstimateTradeBasedOnPriceImpactResponse): Uint8Array { + return EstimateTradeBasedOnPriceImpactResponse.encode(message).finish(); + }, + toProtoMsg(message: EstimateTradeBasedOnPriceImpactResponse): EstimateTradeBasedOnPriceImpactResponseProtoMsg { + return { + typeUrl: "/osmosis.poolmanager.v1beta1.EstimateTradeBasedOnPriceImpactResponse", + value: EstimateTradeBasedOnPriceImpactResponse.encode(message).finish() + }; + } +}; export const PoolI_InterfaceDecoder = (input: BinaryReader | Uint8Array): Pool1 | CosmWasmPool | Pool2 | Pool3 | Any => { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - const data = Any.decode(reader, reader.uint32()); + const data = Any.decode(reader, reader.uint32(), true); switch (data.typeUrl) { case "/osmosis.concentratedliquidity.v1beta1.Pool": - return Pool1.decode(data.value); + return Pool1.decode(data.value, undefined, true); case "/osmosis.cosmwasmpool.v1beta1.CosmWasmPool": - return CosmWasmPool.decode(data.value); - case "/osmosis.gamm.v1beta1.Pool": - return Pool2.decode(data.value); + return CosmWasmPool.decode(data.value, undefined, true); case "/osmosis.gamm.poolmodels.stableswap.v1beta1.Pool": - return Pool3.decode(data.value); + return Pool2.decode(data.value, undefined, true); + case "/osmosis.gamm.v1beta1.Pool": + return Pool3.decode(data.value, undefined, true); default: return data; } @@ -1855,14 +3093,14 @@ export const PoolI_FromAmino = (content: AnyAmino) => { typeUrl: "/osmosis.cosmwasmpool.v1beta1.CosmWasmPool", value: CosmWasmPool.encode(CosmWasmPool.fromPartial(CosmWasmPool.fromAmino(content.value))).finish() }); - case "osmosis/gamm/BalancerPool": + case "osmosis/gamm/StableswapPool": return Any.fromPartial({ - typeUrl: "/osmosis.gamm.v1beta1.Pool", + typeUrl: "/osmosis.gamm.poolmodels.stableswap.v1beta1.Pool", value: Pool2.encode(Pool2.fromPartial(Pool2.fromAmino(content.value))).finish() }); - case "osmosis/gamm/StableswapPool": + case "osmosis/gamm/BalancerPool": return Any.fromPartial({ - typeUrl: "/osmosis.gamm.poolmodels.stableswap.v1beta1.Pool", + typeUrl: "/osmosis.gamm.v1beta1.Pool", value: Pool3.encode(Pool3.fromPartial(Pool3.fromAmino(content.value))).finish() }); default: @@ -1874,22 +3112,22 @@ export const PoolI_ToAmino = (content: Any) => { case "/osmosis.concentratedliquidity.v1beta1.Pool": return { type: "osmosis/concentratedliquidity/pool", - value: Pool1.toAmino(Pool1.decode(content.value)) + value: Pool1.toAmino(Pool1.decode(content.value, undefined)) }; case "/osmosis.cosmwasmpool.v1beta1.CosmWasmPool": return { type: "osmosis/cosmwasmpool/cosm-wasm-pool", - value: CosmWasmPool.toAmino(CosmWasmPool.decode(content.value)) - }; - case "/osmosis.gamm.v1beta1.Pool": - return { - type: "osmosis/gamm/BalancerPool", - value: Pool2.toAmino(Pool2.decode(content.value)) + value: CosmWasmPool.toAmino(CosmWasmPool.decode(content.value, undefined)) }; case "/osmosis.gamm.poolmodels.stableswap.v1beta1.Pool": return { type: "osmosis/gamm/StableswapPool", - value: Pool3.toAmino(Pool3.decode(content.value)) + value: Pool2.toAmino(Pool2.decode(content.value, undefined)) + }; + case "/osmosis.gamm.v1beta1.Pool": + return { + type: "osmosis/gamm/BalancerPool", + value: Pool3.toAmino(Pool3.decode(content.value, undefined)) }; default: return Any.toAmino(content); diff --git a/packages/osmo-query/src/codegen/osmosis/poolmanager/v1beta1/swap_route.ts b/packages/osmo-query/src/codegen/osmosis/poolmanager/v1beta1/swap_route.ts index c5f2a9082..b2743fcfc 100644 --- a/packages/osmo-query/src/codegen/osmosis/poolmanager/v1beta1/swap_route.ts +++ b/packages/osmo-query/src/codegen/osmosis/poolmanager/v1beta1/swap_route.ts @@ -8,8 +8,8 @@ export interface SwapAmountInRouteProtoMsg { value: Uint8Array; } export interface SwapAmountInRouteAmino { - pool_id: string; - token_out_denom: string; + pool_id?: string; + token_out_denom?: string; } export interface SwapAmountInRouteAminoMsg { type: "osmosis/poolmanager/swap-amount-in-route"; @@ -28,8 +28,8 @@ export interface SwapAmountOutRouteProtoMsg { value: Uint8Array; } export interface SwapAmountOutRouteAmino { - pool_id: string; - token_in_denom: string; + pool_id?: string; + token_in_denom?: string; } export interface SwapAmountOutRouteAminoMsg { type: "osmosis/poolmanager/swap-amount-out-route"; @@ -48,8 +48,8 @@ export interface SwapAmountInSplitRouteProtoMsg { value: Uint8Array; } export interface SwapAmountInSplitRouteAmino { - pools: SwapAmountInRouteAmino[]; - token_in_amount: string; + pools?: SwapAmountInRouteAmino[]; + token_in_amount?: string; } export interface SwapAmountInSplitRouteAminoMsg { type: "osmosis/poolmanager/swap-amount-in-split-route"; @@ -68,8 +68,8 @@ export interface SwapAmountOutSplitRouteProtoMsg { value: Uint8Array; } export interface SwapAmountOutSplitRouteAmino { - pools: SwapAmountOutRouteAmino[]; - token_out_amount: string; + pools?: SwapAmountOutRouteAmino[]; + token_out_amount?: string; } export interface SwapAmountOutSplitRouteAminoMsg { type: "osmosis/poolmanager/swap-amount-out-split-route"; @@ -123,10 +123,14 @@ export const SwapAmountInRoute = { return message; }, fromAmino(object: SwapAmountInRouteAmino): SwapAmountInRoute { - return { - poolId: BigInt(object.pool_id), - tokenOutDenom: object.token_out_denom - }; + const message = createBaseSwapAmountInRoute(); + if (object.pool_id !== undefined && object.pool_id !== null) { + message.poolId = BigInt(object.pool_id); + } + if (object.token_out_denom !== undefined && object.token_out_denom !== null) { + message.tokenOutDenom = object.token_out_denom; + } + return message; }, toAmino(message: SwapAmountInRoute): SwapAmountInRouteAmino { const obj: any = {}; @@ -200,10 +204,14 @@ export const SwapAmountOutRoute = { return message; }, fromAmino(object: SwapAmountOutRouteAmino): SwapAmountOutRoute { - return { - poolId: BigInt(object.pool_id), - tokenInDenom: object.token_in_denom - }; + const message = createBaseSwapAmountOutRoute(); + if (object.pool_id !== undefined && object.pool_id !== null) { + message.poolId = BigInt(object.pool_id); + } + if (object.token_in_denom !== undefined && object.token_in_denom !== null) { + message.tokenInDenom = object.token_in_denom; + } + return message; }, toAmino(message: SwapAmountOutRoute): SwapAmountOutRouteAmino { const obj: any = {}; @@ -277,10 +285,12 @@ export const SwapAmountInSplitRoute = { return message; }, fromAmino(object: SwapAmountInSplitRouteAmino): SwapAmountInSplitRoute { - return { - pools: Array.isArray(object?.pools) ? object.pools.map((e: any) => SwapAmountInRoute.fromAmino(e)) : [], - tokenInAmount: object.token_in_amount - }; + const message = createBaseSwapAmountInSplitRoute(); + message.pools = object.pools?.map(e => SwapAmountInRoute.fromAmino(e)) || []; + if (object.token_in_amount !== undefined && object.token_in_amount !== null) { + message.tokenInAmount = object.token_in_amount; + } + return message; }, toAmino(message: SwapAmountInSplitRoute): SwapAmountInSplitRouteAmino { const obj: any = {}; @@ -358,10 +368,12 @@ export const SwapAmountOutSplitRoute = { return message; }, fromAmino(object: SwapAmountOutSplitRouteAmino): SwapAmountOutSplitRoute { - return { - pools: Array.isArray(object?.pools) ? object.pools.map((e: any) => SwapAmountOutRoute.fromAmino(e)) : [], - tokenOutAmount: object.token_out_amount - }; + const message = createBaseSwapAmountOutSplitRoute(); + message.pools = object.pools?.map(e => SwapAmountOutRoute.fromAmino(e)) || []; + if (object.token_out_amount !== undefined && object.token_out_amount !== null) { + message.tokenOutAmount = object.token_out_amount; + } + return message; }, toAmino(message: SwapAmountOutSplitRoute): SwapAmountOutSplitRouteAmino { const obj: any = {}; diff --git a/packages/osmo-query/src/codegen/osmosis/poolmanager/v1beta1/tracked_volume.ts b/packages/osmo-query/src/codegen/osmosis/poolmanager/v1beta1/tracked_volume.ts new file mode 100644 index 000000000..c64f0375e --- /dev/null +++ b/packages/osmo-query/src/codegen/osmosis/poolmanager/v1beta1/tracked_volume.ts @@ -0,0 +1,90 @@ +import { Coin, CoinAmino, CoinSDKType } from "../../../cosmos/base/v1beta1/coin"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +export interface TrackedVolume { + amount: Coin[]; +} +export interface TrackedVolumeProtoMsg { + typeUrl: "/osmosis.poolmanager.v1beta1.TrackedVolume"; + value: Uint8Array; +} +export interface TrackedVolumeAmino { + amount?: CoinAmino[]; +} +export interface TrackedVolumeAminoMsg { + type: "osmosis/poolmanager/tracked-volume"; + value: TrackedVolumeAmino; +} +export interface TrackedVolumeSDKType { + amount: CoinSDKType[]; +} +function createBaseTrackedVolume(): TrackedVolume { + return { + amount: [] + }; +} +export const TrackedVolume = { + typeUrl: "/osmosis.poolmanager.v1beta1.TrackedVolume", + encode(message: TrackedVolume, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.amount) { + Coin.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): TrackedVolume { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseTrackedVolume(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.amount.push(Coin.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): TrackedVolume { + const message = createBaseTrackedVolume(); + message.amount = object.amount?.map(e => Coin.fromPartial(e)) || []; + return message; + }, + fromAmino(object: TrackedVolumeAmino): TrackedVolume { + const message = createBaseTrackedVolume(); + message.amount = object.amount?.map(e => Coin.fromAmino(e)) || []; + return message; + }, + toAmino(message: TrackedVolume): TrackedVolumeAmino { + const obj: any = {}; + if (message.amount) { + obj.amount = message.amount.map(e => e ? Coin.toAmino(e) : undefined); + } else { + obj.amount = []; + } + return obj; + }, + fromAminoMsg(object: TrackedVolumeAminoMsg): TrackedVolume { + return TrackedVolume.fromAmino(object.value); + }, + toAminoMsg(message: TrackedVolume): TrackedVolumeAminoMsg { + return { + type: "osmosis/poolmanager/tracked-volume", + value: TrackedVolume.toAmino(message) + }; + }, + fromProtoMsg(message: TrackedVolumeProtoMsg): TrackedVolume { + return TrackedVolume.decode(message.value); + }, + toProto(message: TrackedVolume): Uint8Array { + return TrackedVolume.encode(message).finish(); + }, + toProtoMsg(message: TrackedVolume): TrackedVolumeProtoMsg { + return { + typeUrl: "/osmosis.poolmanager.v1beta1.TrackedVolume", + value: TrackedVolume.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/packages/osmo-query/src/codegen/osmosis/poolmanager/v1beta1/tx.amino.ts b/packages/osmo-query/src/codegen/osmosis/poolmanager/v1beta1/tx.amino.ts index 4f2b575f0..0c1bd738a 100644 --- a/packages/osmo-query/src/codegen/osmosis/poolmanager/v1beta1/tx.amino.ts +++ b/packages/osmo-query/src/codegen/osmosis/poolmanager/v1beta1/tx.amino.ts @@ -1,5 +1,5 @@ //@ts-nocheck -import { MsgSwapExactAmountIn, MsgSwapExactAmountOut, MsgSplitRouteSwapExactAmountIn, MsgSplitRouteSwapExactAmountOut } from "./tx"; +import { MsgSwapExactAmountIn, MsgSwapExactAmountOut, MsgSplitRouteSwapExactAmountIn, MsgSplitRouteSwapExactAmountOut, MsgSetDenomPairTakerFee } from "./tx"; export const AminoConverter = { "/osmosis.poolmanager.v1beta1.MsgSwapExactAmountIn": { aminoType: "osmosis/poolmanager/swap-exact-amount-in", @@ -12,13 +12,18 @@ export const AminoConverter = { fromAmino: MsgSwapExactAmountOut.fromAmino }, "/osmosis.poolmanager.v1beta1.MsgSplitRouteSwapExactAmountIn": { - aminoType: "osmosis/poolmanager/split-route-swap-exact-amount-in", + aminoType: "osmosis/poolmanager/split-amount-in", toAmino: MsgSplitRouteSwapExactAmountIn.toAmino, fromAmino: MsgSplitRouteSwapExactAmountIn.fromAmino }, "/osmosis.poolmanager.v1beta1.MsgSplitRouteSwapExactAmountOut": { - aminoType: "osmosis/poolmanager/split-route-swap-exact-amount-out", + aminoType: "osmosis/poolmanager/split-amount-out", toAmino: MsgSplitRouteSwapExactAmountOut.toAmino, fromAmino: MsgSplitRouteSwapExactAmountOut.fromAmino + }, + "/osmosis.poolmanager.v1beta1.MsgSetDenomPairTakerFee": { + aminoType: "osmosis/poolmanager/set-denom-pair-taker-fee", + toAmino: MsgSetDenomPairTakerFee.toAmino, + fromAmino: MsgSetDenomPairTakerFee.fromAmino } }; \ No newline at end of file diff --git a/packages/osmo-query/src/codegen/osmosis/poolmanager/v1beta1/tx.registry.ts b/packages/osmo-query/src/codegen/osmosis/poolmanager/v1beta1/tx.registry.ts index 116db1f7f..fc1b6fcd7 100644 --- a/packages/osmo-query/src/codegen/osmosis/poolmanager/v1beta1/tx.registry.ts +++ b/packages/osmo-query/src/codegen/osmosis/poolmanager/v1beta1/tx.registry.ts @@ -1,7 +1,7 @@ //@ts-nocheck import { GeneratedType, Registry } from "@cosmjs/proto-signing"; -import { MsgSwapExactAmountIn, MsgSwapExactAmountOut, MsgSplitRouteSwapExactAmountIn, MsgSplitRouteSwapExactAmountOut } from "./tx"; -export const registry: ReadonlyArray<[string, GeneratedType]> = [["/osmosis.poolmanager.v1beta1.MsgSwapExactAmountIn", MsgSwapExactAmountIn], ["/osmosis.poolmanager.v1beta1.MsgSwapExactAmountOut", MsgSwapExactAmountOut], ["/osmosis.poolmanager.v1beta1.MsgSplitRouteSwapExactAmountIn", MsgSplitRouteSwapExactAmountIn], ["/osmosis.poolmanager.v1beta1.MsgSplitRouteSwapExactAmountOut", MsgSplitRouteSwapExactAmountOut]]; +import { MsgSwapExactAmountIn, MsgSwapExactAmountOut, MsgSplitRouteSwapExactAmountIn, MsgSplitRouteSwapExactAmountOut, MsgSetDenomPairTakerFee } from "./tx"; +export const registry: ReadonlyArray<[string, GeneratedType]> = [["/osmosis.poolmanager.v1beta1.MsgSwapExactAmountIn", MsgSwapExactAmountIn], ["/osmosis.poolmanager.v1beta1.MsgSwapExactAmountOut", MsgSwapExactAmountOut], ["/osmosis.poolmanager.v1beta1.MsgSplitRouteSwapExactAmountIn", MsgSplitRouteSwapExactAmountIn], ["/osmosis.poolmanager.v1beta1.MsgSplitRouteSwapExactAmountOut", MsgSplitRouteSwapExactAmountOut], ["/osmosis.poolmanager.v1beta1.MsgSetDenomPairTakerFee", MsgSetDenomPairTakerFee]]; export const load = (protoRegistry: Registry) => { registry.forEach(([typeUrl, mod]) => { protoRegistry.register(typeUrl, mod); @@ -32,6 +32,12 @@ export const MessageComposer = { typeUrl: "/osmosis.poolmanager.v1beta1.MsgSplitRouteSwapExactAmountOut", value: MsgSplitRouteSwapExactAmountOut.encode(value).finish() }; + }, + setDenomPairTakerFee(value: MsgSetDenomPairTakerFee) { + return { + typeUrl: "/osmosis.poolmanager.v1beta1.MsgSetDenomPairTakerFee", + value: MsgSetDenomPairTakerFee.encode(value).finish() + }; } }, withTypeUrl: { @@ -58,6 +64,12 @@ export const MessageComposer = { typeUrl: "/osmosis.poolmanager.v1beta1.MsgSplitRouteSwapExactAmountOut", value }; + }, + setDenomPairTakerFee(value: MsgSetDenomPairTakerFee) { + return { + typeUrl: "/osmosis.poolmanager.v1beta1.MsgSetDenomPairTakerFee", + value + }; } }, fromPartial: { @@ -84,6 +96,12 @@ export const MessageComposer = { typeUrl: "/osmosis.poolmanager.v1beta1.MsgSplitRouteSwapExactAmountOut", value: MsgSplitRouteSwapExactAmountOut.fromPartial(value) }; + }, + setDenomPairTakerFee(value: MsgSetDenomPairTakerFee) { + return { + typeUrl: "/osmosis.poolmanager.v1beta1.MsgSetDenomPairTakerFee", + value: MsgSetDenomPairTakerFee.fromPartial(value) + }; } } }; \ No newline at end of file diff --git a/packages/osmo-query/src/codegen/osmosis/poolmanager/v1beta1/tx.rpc.msg.ts b/packages/osmo-query/src/codegen/osmosis/poolmanager/v1beta1/tx.rpc.msg.ts index ba18a7f89..04cb38413 100644 --- a/packages/osmo-query/src/codegen/osmosis/poolmanager/v1beta1/tx.rpc.msg.ts +++ b/packages/osmo-query/src/codegen/osmosis/poolmanager/v1beta1/tx.rpc.msg.ts @@ -1,11 +1,12 @@ import { Rpc } from "../../../helpers"; import { BinaryReader } from "../../../binary"; -import { MsgSwapExactAmountIn, MsgSwapExactAmountInResponse, MsgSwapExactAmountOut, MsgSwapExactAmountOutResponse, MsgSplitRouteSwapExactAmountIn, MsgSplitRouteSwapExactAmountInResponse, MsgSplitRouteSwapExactAmountOut, MsgSplitRouteSwapExactAmountOutResponse } from "./tx"; +import { MsgSwapExactAmountIn, MsgSwapExactAmountInResponse, MsgSwapExactAmountOut, MsgSwapExactAmountOutResponse, MsgSplitRouteSwapExactAmountIn, MsgSplitRouteSwapExactAmountInResponse, MsgSplitRouteSwapExactAmountOut, MsgSplitRouteSwapExactAmountOutResponse, MsgSetDenomPairTakerFee, MsgSetDenomPairTakerFeeResponse } from "./tx"; export interface Msg { swapExactAmountIn(request: MsgSwapExactAmountIn): Promise; swapExactAmountOut(request: MsgSwapExactAmountOut): Promise; splitRouteSwapExactAmountIn(request: MsgSplitRouteSwapExactAmountIn): Promise; splitRouteSwapExactAmountOut(request: MsgSplitRouteSwapExactAmountOut): Promise; + setDenomPairTakerFee(request: MsgSetDenomPairTakerFee): Promise; } export class MsgClientImpl implements Msg { private readonly rpc: Rpc; @@ -15,6 +16,7 @@ export class MsgClientImpl implements Msg { this.swapExactAmountOut = this.swapExactAmountOut.bind(this); this.splitRouteSwapExactAmountIn = this.splitRouteSwapExactAmountIn.bind(this); this.splitRouteSwapExactAmountOut = this.splitRouteSwapExactAmountOut.bind(this); + this.setDenomPairTakerFee = this.setDenomPairTakerFee.bind(this); } swapExactAmountIn(request: MsgSwapExactAmountIn): Promise { const data = MsgSwapExactAmountIn.encode(request).finish(); @@ -36,4 +38,9 @@ export class MsgClientImpl implements Msg { const promise = this.rpc.request("osmosis.poolmanager.v1beta1.Msg", "SplitRouteSwapExactAmountOut", data); return promise.then(data => MsgSplitRouteSwapExactAmountOutResponse.decode(new BinaryReader(data))); } + setDenomPairTakerFee(request: MsgSetDenomPairTakerFee): Promise { + const data = MsgSetDenomPairTakerFee.encode(request).finish(); + const promise = this.rpc.request("osmosis.poolmanager.v1beta1.Msg", "SetDenomPairTakerFee", data); + return promise.then(data => MsgSetDenomPairTakerFeeResponse.decode(new BinaryReader(data))); + } } \ No newline at end of file diff --git a/packages/osmo-query/src/codegen/osmosis/poolmanager/v1beta1/tx.ts b/packages/osmo-query/src/codegen/osmosis/poolmanager/v1beta1/tx.ts index 98b84c281..737fc8029 100644 --- a/packages/osmo-query/src/codegen/osmosis/poolmanager/v1beta1/tx.ts +++ b/packages/osmo-query/src/codegen/osmosis/poolmanager/v1beta1/tx.ts @@ -1,6 +1,7 @@ import { SwapAmountInRoute, SwapAmountInRouteAmino, SwapAmountInRouteSDKType, SwapAmountOutRoute, SwapAmountOutRouteAmino, SwapAmountOutRouteSDKType, SwapAmountInSplitRoute, SwapAmountInSplitRouteAmino, SwapAmountInSplitRouteSDKType, SwapAmountOutSplitRoute, SwapAmountOutSplitRouteAmino, SwapAmountOutSplitRouteSDKType } from "./swap_route"; import { Coin, CoinAmino, CoinSDKType } from "../../../cosmos/base/v1beta1/coin"; import { BinaryReader, BinaryWriter } from "../../../binary"; +import { Decimal } from "@cosmjs/math"; /** ===================== MsgSwapExactAmountIn */ export interface MsgSwapExactAmountIn { sender: string; @@ -14,10 +15,10 @@ export interface MsgSwapExactAmountInProtoMsg { } /** ===================== MsgSwapExactAmountIn */ export interface MsgSwapExactAmountInAmino { - sender: string; - routes: SwapAmountInRouteAmino[]; + sender?: string; + routes?: SwapAmountInRouteAmino[]; token_in?: CoinAmino; - token_out_min_amount: string; + token_out_min_amount?: string; } export interface MsgSwapExactAmountInAminoMsg { type: "osmosis/poolmanager/swap-exact-amount-in"; @@ -38,7 +39,7 @@ export interface MsgSwapExactAmountInResponseProtoMsg { value: Uint8Array; } export interface MsgSwapExactAmountInResponseAmino { - token_out_amount: string; + token_out_amount?: string; } export interface MsgSwapExactAmountInResponseAminoMsg { type: "osmosis/poolmanager/swap-exact-amount-in-response"; @@ -60,13 +61,13 @@ export interface MsgSplitRouteSwapExactAmountInProtoMsg { } /** ===================== MsgSplitRouteSwapExactAmountIn */ export interface MsgSplitRouteSwapExactAmountInAmino { - sender: string; - routes: SwapAmountInSplitRouteAmino[]; - token_in_denom: string; - token_out_min_amount: string; + sender?: string; + routes?: SwapAmountInSplitRouteAmino[]; + token_in_denom?: string; + token_out_min_amount?: string; } export interface MsgSplitRouteSwapExactAmountInAminoMsg { - type: "osmosis/poolmanager/split-route-swap-exact-amount-in"; + type: "osmosis/poolmanager/split-amount-in"; value: MsgSplitRouteSwapExactAmountInAmino; } /** ===================== MsgSplitRouteSwapExactAmountIn */ @@ -84,7 +85,7 @@ export interface MsgSplitRouteSwapExactAmountInResponseProtoMsg { value: Uint8Array; } export interface MsgSplitRouteSwapExactAmountInResponseAmino { - token_out_amount: string; + token_out_amount?: string; } export interface MsgSplitRouteSwapExactAmountInResponseAminoMsg { type: "osmosis/poolmanager/split-route-swap-exact-amount-in-response"; @@ -106,9 +107,9 @@ export interface MsgSwapExactAmountOutProtoMsg { } /** ===================== MsgSwapExactAmountOut */ export interface MsgSwapExactAmountOutAmino { - sender: string; - routes: SwapAmountOutRouteAmino[]; - token_in_max_amount: string; + sender?: string; + routes?: SwapAmountOutRouteAmino[]; + token_in_max_amount?: string; token_out?: CoinAmino; } export interface MsgSwapExactAmountOutAminoMsg { @@ -130,7 +131,7 @@ export interface MsgSwapExactAmountOutResponseProtoMsg { value: Uint8Array; } export interface MsgSwapExactAmountOutResponseAmino { - token_in_amount: string; + token_in_amount?: string; } export interface MsgSwapExactAmountOutResponseAminoMsg { type: "osmosis/poolmanager/swap-exact-amount-out-response"; @@ -152,13 +153,13 @@ export interface MsgSplitRouteSwapExactAmountOutProtoMsg { } /** ===================== MsgSplitRouteSwapExactAmountOut */ export interface MsgSplitRouteSwapExactAmountOutAmino { - sender: string; - routes: SwapAmountOutSplitRouteAmino[]; - token_out_denom: string; - token_in_max_amount: string; + sender?: string; + routes?: SwapAmountOutSplitRouteAmino[]; + token_out_denom?: string; + token_in_max_amount?: string; } export interface MsgSplitRouteSwapExactAmountOutAminoMsg { - type: "osmosis/poolmanager/split-route-swap-exact-amount-out"; + type: "osmosis/poolmanager/split-amount-out"; value: MsgSplitRouteSwapExactAmountOutAmino; } /** ===================== MsgSplitRouteSwapExactAmountOut */ @@ -176,7 +177,7 @@ export interface MsgSplitRouteSwapExactAmountOutResponseProtoMsg { value: Uint8Array; } export interface MsgSplitRouteSwapExactAmountOutResponseAmino { - token_in_amount: string; + token_in_amount?: string; } export interface MsgSplitRouteSwapExactAmountOutResponseAminoMsg { type: "osmosis/poolmanager/split-route-swap-exact-amount-out-response"; @@ -185,6 +186,77 @@ export interface MsgSplitRouteSwapExactAmountOutResponseAminoMsg { export interface MsgSplitRouteSwapExactAmountOutResponseSDKType { token_in_amount: string; } +/** ===================== MsgSetDenomPairTakerFee */ +export interface MsgSetDenomPairTakerFee { + sender: string; + denomPairTakerFee: DenomPairTakerFee[]; +} +export interface MsgSetDenomPairTakerFeeProtoMsg { + typeUrl: "/osmosis.poolmanager.v1beta1.MsgSetDenomPairTakerFee"; + value: Uint8Array; +} +/** ===================== MsgSetDenomPairTakerFee */ +export interface MsgSetDenomPairTakerFeeAmino { + sender?: string; + denom_pair_taker_fee?: DenomPairTakerFeeAmino[]; +} +export interface MsgSetDenomPairTakerFeeAminoMsg { + type: "osmosis/poolmanager/set-denom-pair-taker-fee"; + value: MsgSetDenomPairTakerFeeAmino; +} +/** ===================== MsgSetDenomPairTakerFee */ +export interface MsgSetDenomPairTakerFeeSDKType { + sender: string; + denom_pair_taker_fee: DenomPairTakerFeeSDKType[]; +} +export interface MsgSetDenomPairTakerFeeResponse { + success: boolean; +} +export interface MsgSetDenomPairTakerFeeResponseProtoMsg { + typeUrl: "/osmosis.poolmanager.v1beta1.MsgSetDenomPairTakerFeeResponse"; + value: Uint8Array; +} +export interface MsgSetDenomPairTakerFeeResponseAmino { + success?: boolean; +} +export interface MsgSetDenomPairTakerFeeResponseAminoMsg { + type: "osmosis/poolmanager/set-denom-pair-taker-fee-response"; + value: MsgSetDenomPairTakerFeeResponseAmino; +} +export interface MsgSetDenomPairTakerFeeResponseSDKType { + success: boolean; +} +export interface DenomPairTakerFee { + /** + * denom0 and denom1 get automatically lexigographically sorted + * when being stored, so the order of input here does not matter. + */ + denom0: string; + denom1: string; + takerFee: string; +} +export interface DenomPairTakerFeeProtoMsg { + typeUrl: "/osmosis.poolmanager.v1beta1.DenomPairTakerFee"; + value: Uint8Array; +} +export interface DenomPairTakerFeeAmino { + /** + * denom0 and denom1 get automatically lexigographically sorted + * when being stored, so the order of input here does not matter. + */ + denom0?: string; + denom1?: string; + taker_fee?: string; +} +export interface DenomPairTakerFeeAminoMsg { + type: "osmosis/poolmanager/denom-pair-taker-fee"; + value: DenomPairTakerFeeAmino; +} +export interface DenomPairTakerFeeSDKType { + denom0: string; + denom1: string; + taker_fee: string; +} function createBaseMsgSwapExactAmountIn(): MsgSwapExactAmountIn { return { sender: "", @@ -245,12 +317,18 @@ export const MsgSwapExactAmountIn = { return message; }, fromAmino(object: MsgSwapExactAmountInAmino): MsgSwapExactAmountIn { - return { - sender: object.sender, - routes: Array.isArray(object?.routes) ? object.routes.map((e: any) => SwapAmountInRoute.fromAmino(e)) : [], - tokenIn: object?.token_in ? Coin.fromAmino(object.token_in) : undefined, - tokenOutMinAmount: object.token_out_min_amount - }; + const message = createBaseMsgSwapExactAmountIn(); + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + message.routes = object.routes?.map(e => SwapAmountInRoute.fromAmino(e)) || []; + if (object.token_in !== undefined && object.token_in !== null) { + message.tokenIn = Coin.fromAmino(object.token_in); + } + if (object.token_out_min_amount !== undefined && object.token_out_min_amount !== null) { + message.tokenOutMinAmount = object.token_out_min_amount; + } + return message; }, toAmino(message: MsgSwapExactAmountIn): MsgSwapExactAmountInAmino { const obj: any = {}; @@ -322,9 +400,11 @@ export const MsgSwapExactAmountInResponse = { return message; }, fromAmino(object: MsgSwapExactAmountInResponseAmino): MsgSwapExactAmountInResponse { - return { - tokenOutAmount: object.token_out_amount - }; + const message = createBaseMsgSwapExactAmountInResponse(); + if (object.token_out_amount !== undefined && object.token_out_amount !== null) { + message.tokenOutAmount = object.token_out_amount; + } + return message; }, toAmino(message: MsgSwapExactAmountInResponse): MsgSwapExactAmountInResponseAmino { const obj: any = {}; @@ -413,12 +493,18 @@ export const MsgSplitRouteSwapExactAmountIn = { return message; }, fromAmino(object: MsgSplitRouteSwapExactAmountInAmino): MsgSplitRouteSwapExactAmountIn { - return { - sender: object.sender, - routes: Array.isArray(object?.routes) ? object.routes.map((e: any) => SwapAmountInSplitRoute.fromAmino(e)) : [], - tokenInDenom: object.token_in_denom, - tokenOutMinAmount: object.token_out_min_amount - }; + const message = createBaseMsgSplitRouteSwapExactAmountIn(); + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + message.routes = object.routes?.map(e => SwapAmountInSplitRoute.fromAmino(e)) || []; + if (object.token_in_denom !== undefined && object.token_in_denom !== null) { + message.tokenInDenom = object.token_in_denom; + } + if (object.token_out_min_amount !== undefined && object.token_out_min_amount !== null) { + message.tokenOutMinAmount = object.token_out_min_amount; + } + return message; }, toAmino(message: MsgSplitRouteSwapExactAmountIn): MsgSplitRouteSwapExactAmountInAmino { const obj: any = {}; @@ -437,7 +523,7 @@ export const MsgSplitRouteSwapExactAmountIn = { }, toAminoMsg(message: MsgSplitRouteSwapExactAmountIn): MsgSplitRouteSwapExactAmountInAminoMsg { return { - type: "osmosis/poolmanager/split-route-swap-exact-amount-in", + type: "osmosis/poolmanager/split-amount-in", value: MsgSplitRouteSwapExactAmountIn.toAmino(message) }; }, @@ -490,9 +576,11 @@ export const MsgSplitRouteSwapExactAmountInResponse = { return message; }, fromAmino(object: MsgSplitRouteSwapExactAmountInResponseAmino): MsgSplitRouteSwapExactAmountInResponse { - return { - tokenOutAmount: object.token_out_amount - }; + const message = createBaseMsgSplitRouteSwapExactAmountInResponse(); + if (object.token_out_amount !== undefined && object.token_out_amount !== null) { + message.tokenOutAmount = object.token_out_amount; + } + return message; }, toAmino(message: MsgSplitRouteSwapExactAmountInResponse): MsgSplitRouteSwapExactAmountInResponseAmino { const obj: any = {}; @@ -581,12 +669,18 @@ export const MsgSwapExactAmountOut = { return message; }, fromAmino(object: MsgSwapExactAmountOutAmino): MsgSwapExactAmountOut { - return { - sender: object.sender, - routes: Array.isArray(object?.routes) ? object.routes.map((e: any) => SwapAmountOutRoute.fromAmino(e)) : [], - tokenInMaxAmount: object.token_in_max_amount, - tokenOut: object?.token_out ? Coin.fromAmino(object.token_out) : undefined - }; + const message = createBaseMsgSwapExactAmountOut(); + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + message.routes = object.routes?.map(e => SwapAmountOutRoute.fromAmino(e)) || []; + if (object.token_in_max_amount !== undefined && object.token_in_max_amount !== null) { + message.tokenInMaxAmount = object.token_in_max_amount; + } + if (object.token_out !== undefined && object.token_out !== null) { + message.tokenOut = Coin.fromAmino(object.token_out); + } + return message; }, toAmino(message: MsgSwapExactAmountOut): MsgSwapExactAmountOutAmino { const obj: any = {}; @@ -658,9 +752,11 @@ export const MsgSwapExactAmountOutResponse = { return message; }, fromAmino(object: MsgSwapExactAmountOutResponseAmino): MsgSwapExactAmountOutResponse { - return { - tokenInAmount: object.token_in_amount - }; + const message = createBaseMsgSwapExactAmountOutResponse(); + if (object.token_in_amount !== undefined && object.token_in_amount !== null) { + message.tokenInAmount = object.token_in_amount; + } + return message; }, toAmino(message: MsgSwapExactAmountOutResponse): MsgSwapExactAmountOutResponseAmino { const obj: any = {}; @@ -749,12 +845,18 @@ export const MsgSplitRouteSwapExactAmountOut = { return message; }, fromAmino(object: MsgSplitRouteSwapExactAmountOutAmino): MsgSplitRouteSwapExactAmountOut { - return { - sender: object.sender, - routes: Array.isArray(object?.routes) ? object.routes.map((e: any) => SwapAmountOutSplitRoute.fromAmino(e)) : [], - tokenOutDenom: object.token_out_denom, - tokenInMaxAmount: object.token_in_max_amount - }; + const message = createBaseMsgSplitRouteSwapExactAmountOut(); + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + message.routes = object.routes?.map(e => SwapAmountOutSplitRoute.fromAmino(e)) || []; + if (object.token_out_denom !== undefined && object.token_out_denom !== null) { + message.tokenOutDenom = object.token_out_denom; + } + if (object.token_in_max_amount !== undefined && object.token_in_max_amount !== null) { + message.tokenInMaxAmount = object.token_in_max_amount; + } + return message; }, toAmino(message: MsgSplitRouteSwapExactAmountOut): MsgSplitRouteSwapExactAmountOutAmino { const obj: any = {}; @@ -773,7 +875,7 @@ export const MsgSplitRouteSwapExactAmountOut = { }, toAminoMsg(message: MsgSplitRouteSwapExactAmountOut): MsgSplitRouteSwapExactAmountOutAminoMsg { return { - type: "osmosis/poolmanager/split-route-swap-exact-amount-out", + type: "osmosis/poolmanager/split-amount-out", value: MsgSplitRouteSwapExactAmountOut.toAmino(message) }; }, @@ -826,9 +928,11 @@ export const MsgSplitRouteSwapExactAmountOutResponse = { return message; }, fromAmino(object: MsgSplitRouteSwapExactAmountOutResponseAmino): MsgSplitRouteSwapExactAmountOutResponse { - return { - tokenInAmount: object.token_in_amount - }; + const message = createBaseMsgSplitRouteSwapExactAmountOutResponse(); + if (object.token_in_amount !== undefined && object.token_in_amount !== null) { + message.tokenInAmount = object.token_in_amount; + } + return message; }, toAmino(message: MsgSplitRouteSwapExactAmountOutResponse): MsgSplitRouteSwapExactAmountOutResponseAmino { const obj: any = {}; @@ -856,4 +960,249 @@ export const MsgSplitRouteSwapExactAmountOutResponse = { value: MsgSplitRouteSwapExactAmountOutResponse.encode(message).finish() }; } +}; +function createBaseMsgSetDenomPairTakerFee(): MsgSetDenomPairTakerFee { + return { + sender: "", + denomPairTakerFee: [] + }; +} +export const MsgSetDenomPairTakerFee = { + typeUrl: "/osmosis.poolmanager.v1beta1.MsgSetDenomPairTakerFee", + encode(message: MsgSetDenomPairTakerFee, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.sender !== "") { + writer.uint32(10).string(message.sender); + } + for (const v of message.denomPairTakerFee) { + DenomPairTakerFee.encode(v!, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgSetDenomPairTakerFee { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgSetDenomPairTakerFee(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.sender = reader.string(); + break; + case 2: + message.denomPairTakerFee.push(DenomPairTakerFee.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgSetDenomPairTakerFee { + const message = createBaseMsgSetDenomPairTakerFee(); + message.sender = object.sender ?? ""; + message.denomPairTakerFee = object.denomPairTakerFee?.map(e => DenomPairTakerFee.fromPartial(e)) || []; + return message; + }, + fromAmino(object: MsgSetDenomPairTakerFeeAmino): MsgSetDenomPairTakerFee { + const message = createBaseMsgSetDenomPairTakerFee(); + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + message.denomPairTakerFee = object.denom_pair_taker_fee?.map(e => DenomPairTakerFee.fromAmino(e)) || []; + return message; + }, + toAmino(message: MsgSetDenomPairTakerFee): MsgSetDenomPairTakerFeeAmino { + const obj: any = {}; + obj.sender = message.sender; + if (message.denomPairTakerFee) { + obj.denom_pair_taker_fee = message.denomPairTakerFee.map(e => e ? DenomPairTakerFee.toAmino(e) : undefined); + } else { + obj.denom_pair_taker_fee = []; + } + return obj; + }, + fromAminoMsg(object: MsgSetDenomPairTakerFeeAminoMsg): MsgSetDenomPairTakerFee { + return MsgSetDenomPairTakerFee.fromAmino(object.value); + }, + toAminoMsg(message: MsgSetDenomPairTakerFee): MsgSetDenomPairTakerFeeAminoMsg { + return { + type: "osmosis/poolmanager/set-denom-pair-taker-fee", + value: MsgSetDenomPairTakerFee.toAmino(message) + }; + }, + fromProtoMsg(message: MsgSetDenomPairTakerFeeProtoMsg): MsgSetDenomPairTakerFee { + return MsgSetDenomPairTakerFee.decode(message.value); + }, + toProto(message: MsgSetDenomPairTakerFee): Uint8Array { + return MsgSetDenomPairTakerFee.encode(message).finish(); + }, + toProtoMsg(message: MsgSetDenomPairTakerFee): MsgSetDenomPairTakerFeeProtoMsg { + return { + typeUrl: "/osmosis.poolmanager.v1beta1.MsgSetDenomPairTakerFee", + value: MsgSetDenomPairTakerFee.encode(message).finish() + }; + } +}; +function createBaseMsgSetDenomPairTakerFeeResponse(): MsgSetDenomPairTakerFeeResponse { + return { + success: false + }; +} +export const MsgSetDenomPairTakerFeeResponse = { + typeUrl: "/osmosis.poolmanager.v1beta1.MsgSetDenomPairTakerFeeResponse", + encode(message: MsgSetDenomPairTakerFeeResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.success === true) { + writer.uint32(8).bool(message.success); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgSetDenomPairTakerFeeResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgSetDenomPairTakerFeeResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.success = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgSetDenomPairTakerFeeResponse { + const message = createBaseMsgSetDenomPairTakerFeeResponse(); + message.success = object.success ?? false; + return message; + }, + fromAmino(object: MsgSetDenomPairTakerFeeResponseAmino): MsgSetDenomPairTakerFeeResponse { + const message = createBaseMsgSetDenomPairTakerFeeResponse(); + if (object.success !== undefined && object.success !== null) { + message.success = object.success; + } + return message; + }, + toAmino(message: MsgSetDenomPairTakerFeeResponse): MsgSetDenomPairTakerFeeResponseAmino { + const obj: any = {}; + obj.success = message.success; + return obj; + }, + fromAminoMsg(object: MsgSetDenomPairTakerFeeResponseAminoMsg): MsgSetDenomPairTakerFeeResponse { + return MsgSetDenomPairTakerFeeResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgSetDenomPairTakerFeeResponse): MsgSetDenomPairTakerFeeResponseAminoMsg { + return { + type: "osmosis/poolmanager/set-denom-pair-taker-fee-response", + value: MsgSetDenomPairTakerFeeResponse.toAmino(message) + }; + }, + fromProtoMsg(message: MsgSetDenomPairTakerFeeResponseProtoMsg): MsgSetDenomPairTakerFeeResponse { + return MsgSetDenomPairTakerFeeResponse.decode(message.value); + }, + toProto(message: MsgSetDenomPairTakerFeeResponse): Uint8Array { + return MsgSetDenomPairTakerFeeResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgSetDenomPairTakerFeeResponse): MsgSetDenomPairTakerFeeResponseProtoMsg { + return { + typeUrl: "/osmosis.poolmanager.v1beta1.MsgSetDenomPairTakerFeeResponse", + value: MsgSetDenomPairTakerFeeResponse.encode(message).finish() + }; + } +}; +function createBaseDenomPairTakerFee(): DenomPairTakerFee { + return { + denom0: "", + denom1: "", + takerFee: "" + }; +} +export const DenomPairTakerFee = { + typeUrl: "/osmosis.poolmanager.v1beta1.DenomPairTakerFee", + encode(message: DenomPairTakerFee, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.denom0 !== "") { + writer.uint32(10).string(message.denom0); + } + if (message.denom1 !== "") { + writer.uint32(18).string(message.denom1); + } + if (message.takerFee !== "") { + writer.uint32(26).string(Decimal.fromUserInput(message.takerFee, 18).atomics); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): DenomPairTakerFee { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseDenomPairTakerFee(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.denom0 = reader.string(); + break; + case 2: + message.denom1 = reader.string(); + break; + case 3: + message.takerFee = Decimal.fromAtomics(reader.string(), 18).toString(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): DenomPairTakerFee { + const message = createBaseDenomPairTakerFee(); + message.denom0 = object.denom0 ?? ""; + message.denom1 = object.denom1 ?? ""; + message.takerFee = object.takerFee ?? ""; + return message; + }, + fromAmino(object: DenomPairTakerFeeAmino): DenomPairTakerFee { + const message = createBaseDenomPairTakerFee(); + if (object.denom0 !== undefined && object.denom0 !== null) { + message.denom0 = object.denom0; + } + if (object.denom1 !== undefined && object.denom1 !== null) { + message.denom1 = object.denom1; + } + if (object.taker_fee !== undefined && object.taker_fee !== null) { + message.takerFee = object.taker_fee; + } + return message; + }, + toAmino(message: DenomPairTakerFee): DenomPairTakerFeeAmino { + const obj: any = {}; + obj.denom0 = message.denom0; + obj.denom1 = message.denom1; + obj.taker_fee = message.takerFee; + return obj; + }, + fromAminoMsg(object: DenomPairTakerFeeAminoMsg): DenomPairTakerFee { + return DenomPairTakerFee.fromAmino(object.value); + }, + toAminoMsg(message: DenomPairTakerFee): DenomPairTakerFeeAminoMsg { + return { + type: "osmosis/poolmanager/denom-pair-taker-fee", + value: DenomPairTakerFee.toAmino(message) + }; + }, + fromProtoMsg(message: DenomPairTakerFeeProtoMsg): DenomPairTakerFee { + return DenomPairTakerFee.decode(message.value); + }, + toProto(message: DenomPairTakerFee): Uint8Array { + return DenomPairTakerFee.encode(message).finish(); + }, + toProtoMsg(message: DenomPairTakerFee): DenomPairTakerFeeProtoMsg { + return { + typeUrl: "/osmosis.poolmanager.v1beta1.DenomPairTakerFee", + value: DenomPairTakerFee.encode(message).finish() + }; + } }; \ No newline at end of file diff --git a/packages/osmo-query/src/codegen/osmosis/poolmanager/v2/query.lcd.ts b/packages/osmo-query/src/codegen/osmosis/poolmanager/v2/query.lcd.ts new file mode 100644 index 000000000..df5a108c8 --- /dev/null +++ b/packages/osmo-query/src/codegen/osmosis/poolmanager/v2/query.lcd.ts @@ -0,0 +1,31 @@ +import { LCDClient } from "@cosmology/lcd"; +import { SpotPriceRequest, SpotPriceResponseSDKType } from "./query"; +export class LCDQueryClient { + req: LCDClient; + constructor({ + requestClient + }: { + requestClient: LCDClient; + }) { + this.req = requestClient; + this.spotPriceV2 = this.spotPriceV2.bind(this); + } + /* SpotPriceV2 defines a gRPC query handler that returns the spot price given + a base denomination and a quote denomination. + The returned spot price has 36 decimal places. However, some of + modules perform sig fig rounding so most of the rightmost decimals can be + zeroes. */ + async spotPriceV2(params: SpotPriceRequest): Promise { + const options: any = { + params: {} + }; + if (typeof params?.baseAssetDenom !== "undefined") { + options.params.base_asset_denom = params.baseAssetDenom; + } + if (typeof params?.quoteAssetDenom !== "undefined") { + options.params.quote_asset_denom = params.quoteAssetDenom; + } + const endpoint = `osmosis/poolmanager/v2/pools/${params.poolId}/prices`; + return await this.req.get(endpoint, options); + } +} \ No newline at end of file diff --git a/packages/osmo-query/src/codegen/osmosis/poolmanager/v2/query.rpc.Query.ts b/packages/osmo-query/src/codegen/osmosis/poolmanager/v2/query.rpc.Query.ts new file mode 100644 index 000000000..0c8e2d53d --- /dev/null +++ b/packages/osmo-query/src/codegen/osmosis/poolmanager/v2/query.rpc.Query.ts @@ -0,0 +1,72 @@ +import { Rpc } from "../../../helpers"; +import { BinaryReader } from "../../../binary"; +import { QueryClient, createProtobufRpcClient, ProtobufRpcClient } from "@cosmjs/stargate"; +import { ReactQueryParams } from "../../../react-query"; +import { useQuery } from "@tanstack/react-query"; +import { SpotPriceRequest, SpotPriceResponse } from "./query"; +export interface Query { + /** + * SpotPriceV2 defines a gRPC query handler that returns the spot price given + * a base denomination and a quote denomination. + * The returned spot price has 36 decimal places. However, some of + * modules perform sig fig rounding so most of the rightmost decimals can be + * zeroes. + */ + spotPriceV2(request: SpotPriceRequest): Promise; +} +export class QueryClientImpl implements Query { + private readonly rpc: Rpc; + constructor(rpc: Rpc) { + this.rpc = rpc; + this.spotPriceV2 = this.spotPriceV2.bind(this); + } + spotPriceV2(request: SpotPriceRequest): Promise { + const data = SpotPriceRequest.encode(request).finish(); + const promise = this.rpc.request("osmosis.poolmanager.v2.Query", "SpotPriceV2", data); + return promise.then(data => SpotPriceResponse.decode(new BinaryReader(data))); + } +} +export const createRpcQueryExtension = (base: QueryClient) => { + const rpc = createProtobufRpcClient(base); + const queryService = new QueryClientImpl(rpc); + return { + spotPriceV2(request: SpotPriceRequest): Promise { + return queryService.spotPriceV2(request); + } + }; +}; +export interface UseSpotPriceV2Query extends ReactQueryParams { + request: SpotPriceRequest; +} +const _queryClients: WeakMap = new WeakMap(); +const getQueryService = (rpc: ProtobufRpcClient | undefined): QueryClientImpl | undefined => { + if (!rpc) return; + if (_queryClients.has(rpc)) { + return _queryClients.get(rpc); + } + const queryService = new QueryClientImpl(rpc); + _queryClients.set(rpc, queryService); + return queryService; +}; +export const createRpcQueryHooks = (rpc: ProtobufRpcClient | undefined) => { + const queryService = getQueryService(rpc); + const useSpotPriceV2 = ({ + request, + options + }: UseSpotPriceV2Query) => { + return useQuery(["spotPriceV2Query", request], () => { + if (!queryService) throw new Error("Query Service not initialized"); + return queryService.spotPriceV2(request); + }, options); + }; + return { + /** + * SpotPriceV2 defines a gRPC query handler that returns the spot price given + * a base denomination and a quote denomination. + * The returned spot price has 36 decimal places. However, some of + * modules perform sig fig rounding so most of the rightmost decimals can be + * zeroes. + */ + useSpotPriceV2 + }; +}; \ No newline at end of file diff --git a/packages/osmo-query/src/codegen/osmosis/poolmanager/v2/query.ts b/packages/osmo-query/src/codegen/osmosis/poolmanager/v2/query.ts new file mode 100644 index 000000000..b943a41ab --- /dev/null +++ b/packages/osmo-query/src/codegen/osmosis/poolmanager/v2/query.ts @@ -0,0 +1,229 @@ +import { BinaryReader, BinaryWriter } from "../../../binary"; +/** + * SpotPriceRequest defines the gRPC request structure for a SpotPrice + * query. + */ +export interface SpotPriceRequest { + poolId: bigint; + baseAssetDenom: string; + quoteAssetDenom: string; +} +export interface SpotPriceRequestProtoMsg { + typeUrl: "/osmosis.poolmanager.v2.SpotPriceRequest"; + value: Uint8Array; +} +/** + * SpotPriceRequest defines the gRPC request structure for a SpotPrice + * query. + */ +export interface SpotPriceRequestAmino { + pool_id?: string; + base_asset_denom?: string; + quote_asset_denom?: string; +} +export interface SpotPriceRequestAminoMsg { + type: "osmosis/poolmanager/v2/spot-price-request"; + value: SpotPriceRequestAmino; +} +/** + * SpotPriceRequest defines the gRPC request structure for a SpotPrice + * query. + */ +export interface SpotPriceRequestSDKType { + pool_id: bigint; + base_asset_denom: string; + quote_asset_denom: string; +} +/** + * SpotPriceResponse defines the gRPC response structure for a SpotPrice + * query. + */ +export interface SpotPriceResponse { + /** String of the BigDec. Ex) 10.203uatom */ + spotPrice: string; +} +export interface SpotPriceResponseProtoMsg { + typeUrl: "/osmosis.poolmanager.v2.SpotPriceResponse"; + value: Uint8Array; +} +/** + * SpotPriceResponse defines the gRPC response structure for a SpotPrice + * query. + */ +export interface SpotPriceResponseAmino { + /** String of the BigDec. Ex) 10.203uatom */ + spot_price?: string; +} +export interface SpotPriceResponseAminoMsg { + type: "osmosis/poolmanager/v2/spot-price-response"; + value: SpotPriceResponseAmino; +} +/** + * SpotPriceResponse defines the gRPC response structure for a SpotPrice + * query. + */ +export interface SpotPriceResponseSDKType { + spot_price: string; +} +function createBaseSpotPriceRequest(): SpotPriceRequest { + return { + poolId: BigInt(0), + baseAssetDenom: "", + quoteAssetDenom: "" + }; +} +export const SpotPriceRequest = { + typeUrl: "/osmosis.poolmanager.v2.SpotPriceRequest", + encode(message: SpotPriceRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.poolId !== BigInt(0)) { + writer.uint32(8).uint64(message.poolId); + } + if (message.baseAssetDenom !== "") { + writer.uint32(18).string(message.baseAssetDenom); + } + if (message.quoteAssetDenom !== "") { + writer.uint32(26).string(message.quoteAssetDenom); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): SpotPriceRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSpotPriceRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.poolId = reader.uint64(); + break; + case 2: + message.baseAssetDenom = reader.string(); + break; + case 3: + message.quoteAssetDenom = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): SpotPriceRequest { + const message = createBaseSpotPriceRequest(); + message.poolId = object.poolId !== undefined && object.poolId !== null ? BigInt(object.poolId.toString()) : BigInt(0); + message.baseAssetDenom = object.baseAssetDenom ?? ""; + message.quoteAssetDenom = object.quoteAssetDenom ?? ""; + return message; + }, + fromAmino(object: SpotPriceRequestAmino): SpotPriceRequest { + const message = createBaseSpotPriceRequest(); + if (object.pool_id !== undefined && object.pool_id !== null) { + message.poolId = BigInt(object.pool_id); + } + if (object.base_asset_denom !== undefined && object.base_asset_denom !== null) { + message.baseAssetDenom = object.base_asset_denom; + } + if (object.quote_asset_denom !== undefined && object.quote_asset_denom !== null) { + message.quoteAssetDenom = object.quote_asset_denom; + } + return message; + }, + toAmino(message: SpotPriceRequest): SpotPriceRequestAmino { + const obj: any = {}; + obj.pool_id = message.poolId ? message.poolId.toString() : undefined; + obj.base_asset_denom = message.baseAssetDenom; + obj.quote_asset_denom = message.quoteAssetDenom; + return obj; + }, + fromAminoMsg(object: SpotPriceRequestAminoMsg): SpotPriceRequest { + return SpotPriceRequest.fromAmino(object.value); + }, + toAminoMsg(message: SpotPriceRequest): SpotPriceRequestAminoMsg { + return { + type: "osmosis/poolmanager/v2/spot-price-request", + value: SpotPriceRequest.toAmino(message) + }; + }, + fromProtoMsg(message: SpotPriceRequestProtoMsg): SpotPriceRequest { + return SpotPriceRequest.decode(message.value); + }, + toProto(message: SpotPriceRequest): Uint8Array { + return SpotPriceRequest.encode(message).finish(); + }, + toProtoMsg(message: SpotPriceRequest): SpotPriceRequestProtoMsg { + return { + typeUrl: "/osmosis.poolmanager.v2.SpotPriceRequest", + value: SpotPriceRequest.encode(message).finish() + }; + } +}; +function createBaseSpotPriceResponse(): SpotPriceResponse { + return { + spotPrice: "" + }; +} +export const SpotPriceResponse = { + typeUrl: "/osmosis.poolmanager.v2.SpotPriceResponse", + encode(message: SpotPriceResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.spotPrice !== "") { + writer.uint32(10).string(message.spotPrice); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): SpotPriceResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSpotPriceResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.spotPrice = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): SpotPriceResponse { + const message = createBaseSpotPriceResponse(); + message.spotPrice = object.spotPrice ?? ""; + return message; + }, + fromAmino(object: SpotPriceResponseAmino): SpotPriceResponse { + const message = createBaseSpotPriceResponse(); + if (object.spot_price !== undefined && object.spot_price !== null) { + message.spotPrice = object.spot_price; + } + return message; + }, + toAmino(message: SpotPriceResponse): SpotPriceResponseAmino { + const obj: any = {}; + obj.spot_price = message.spotPrice; + return obj; + }, + fromAminoMsg(object: SpotPriceResponseAminoMsg): SpotPriceResponse { + return SpotPriceResponse.fromAmino(object.value); + }, + toAminoMsg(message: SpotPriceResponse): SpotPriceResponseAminoMsg { + return { + type: "osmosis/poolmanager/v2/spot-price-response", + value: SpotPriceResponse.toAmino(message) + }; + }, + fromProtoMsg(message: SpotPriceResponseProtoMsg): SpotPriceResponse { + return SpotPriceResponse.decode(message.value); + }, + toProto(message: SpotPriceResponse): Uint8Array { + return SpotPriceResponse.encode(message).finish(); + }, + toProtoMsg(message: SpotPriceResponse): SpotPriceResponseProtoMsg { + return { + typeUrl: "/osmosis.poolmanager.v2.SpotPriceResponse", + value: SpotPriceResponse.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/packages/osmo-query/src/codegen/osmosis/protorev/v1beta1/genesis.ts b/packages/osmo-query/src/codegen/osmosis/protorev/v1beta1/genesis.ts index 4bff481b6..6a4887de3 100644 --- a/packages/osmo-query/src/codegen/osmosis/protorev/v1beta1/genesis.ts +++ b/packages/osmo-query/src/codegen/osmosis/protorev/v1beta1/genesis.ts @@ -1,5 +1,5 @@ import { Params, ParamsAmino, ParamsSDKType } from "./params"; -import { TokenPairArbRoutes, TokenPairArbRoutesAmino, TokenPairArbRoutesSDKType, BaseDenom, BaseDenomAmino, BaseDenomSDKType, PoolWeights, PoolWeightsAmino, PoolWeightsSDKType } from "./protorev"; +import { TokenPairArbRoutes, TokenPairArbRoutesAmino, TokenPairArbRoutesSDKType, BaseDenom, BaseDenomAmino, BaseDenomSDKType, PoolWeights, PoolWeightsAmino, PoolWeightsSDKType, InfoByPoolType, InfoByPoolTypeAmino, InfoByPoolTypeSDKType, CyclicArbTracker, CyclicArbTrackerAmino, CyclicArbTrackerSDKType } from "./protorev"; import { Coin, CoinAmino, CoinSDKType } from "../../../cosmos/base/v1beta1/coin"; import { BinaryReader, BinaryWriter } from "../../../binary"; /** GenesisState defines the protorev module's genesis state. */ @@ -16,6 +16,9 @@ export interface GenesisState { /** * The pool weights that are being used to calculate the weight (compute cost) * of each route. + * + * DEPRECATED: This field is deprecated and will be removed in the next + * release. It is replaced by the `info_by_pool_type` field. */ poolWeights: PoolWeights; /** The number of days since module genesis. */ @@ -40,6 +43,12 @@ export interface GenesisState { pointCountForBlock: bigint; /** All of the profits that have been accumulated by the module. */ profits: Coin[]; + /** + * Information that is used to estimate execution time / gas + * consumption of a swap on a given pool type. + */ + infoByPoolType: InfoByPoolType; + cyclicArbTracker?: CyclicArbTracker; } export interface GenesisStateProtoMsg { typeUrl: "/osmosis.protorev.v1beta1.GenesisState"; @@ -50,39 +59,48 @@ export interface GenesisStateAmino { /** Parameters for the protorev module. */ params?: ParamsAmino; /** Token pair arb routes for the protorev module (hot routes). */ - token_pair_arb_routes: TokenPairArbRoutesAmino[]; + token_pair_arb_routes?: TokenPairArbRoutesAmino[]; /** * The base denominations being used to create cyclic arbitrage routes via the * highest liquidity method. */ - base_denoms: BaseDenomAmino[]; + base_denoms?: BaseDenomAmino[]; /** * The pool weights that are being used to calculate the weight (compute cost) * of each route. + * + * DEPRECATED: This field is deprecated and will be removed in the next + * release. It is replaced by the `info_by_pool_type` field. */ pool_weights?: PoolWeightsAmino; /** The number of days since module genesis. */ - days_since_module_genesis: string; + days_since_module_genesis?: string; /** The fees the developer account has accumulated over time. */ - developer_fees: CoinAmino[]; + developer_fees?: CoinAmino[]; /** The latest block height that the module has processed. */ - latest_block_height: string; + latest_block_height?: string; /** The developer account address of the module. */ - developer_address: string; + developer_address?: string; /** * Max pool points per block i.e. the maximum compute time (in ms) * that protorev can use per block. */ - max_pool_points_per_block: string; + max_pool_points_per_block?: string; /** * Max pool points per tx i.e. the maximum compute time (in ms) that * protorev can use per tx. */ - max_pool_points_per_tx: string; + max_pool_points_per_tx?: string; /** The number of pool points that have been consumed in the current block. */ - point_count_for_block: string; + point_count_for_block?: string; /** All of the profits that have been accumulated by the module. */ - profits: CoinAmino[]; + profits?: CoinAmino[]; + /** + * Information that is used to estimate execution time / gas + * consumption of a swap on a given pool type. + */ + info_by_pool_type?: InfoByPoolTypeAmino; + cyclic_arb_tracker?: CyclicArbTrackerAmino; } export interface GenesisStateAminoMsg { type: "osmosis/protorev/genesis-state"; @@ -102,6 +120,8 @@ export interface GenesisStateSDKType { max_pool_points_per_tx: bigint; point_count_for_block: bigint; profits: CoinSDKType[]; + info_by_pool_type: InfoByPoolTypeSDKType; + cyclic_arb_tracker?: CyclicArbTrackerSDKType; } function createBaseGenesisState(): GenesisState { return { @@ -116,7 +136,9 @@ function createBaseGenesisState(): GenesisState { maxPoolPointsPerBlock: BigInt(0), maxPoolPointsPerTx: BigInt(0), pointCountForBlock: BigInt(0), - profits: [] + profits: [], + infoByPoolType: InfoByPoolType.fromPartial({}), + cyclicArbTracker: undefined }; } export const GenesisState = { @@ -158,6 +180,12 @@ export const GenesisState = { for (const v of message.profits) { Coin.encode(v!, writer.uint32(98).fork()).ldelim(); } + if (message.infoByPoolType !== undefined) { + InfoByPoolType.encode(message.infoByPoolType, writer.uint32(106).fork()).ldelim(); + } + if (message.cyclicArbTracker !== undefined) { + CyclicArbTracker.encode(message.cyclicArbTracker, writer.uint32(114).fork()).ldelim(); + } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): GenesisState { @@ -203,6 +231,12 @@ export const GenesisState = { case 12: message.profits.push(Coin.decode(reader, reader.uint32())); break; + case 13: + message.infoByPoolType = InfoByPoolType.decode(reader, reader.uint32()); + break; + case 14: + message.cyclicArbTracker = CyclicArbTracker.decode(reader, reader.uint32()); + break; default: reader.skipType(tag & 7); break; @@ -224,23 +258,47 @@ export const GenesisState = { message.maxPoolPointsPerTx = object.maxPoolPointsPerTx !== undefined && object.maxPoolPointsPerTx !== null ? BigInt(object.maxPoolPointsPerTx.toString()) : BigInt(0); message.pointCountForBlock = object.pointCountForBlock !== undefined && object.pointCountForBlock !== null ? BigInt(object.pointCountForBlock.toString()) : BigInt(0); message.profits = object.profits?.map(e => Coin.fromPartial(e)) || []; + message.infoByPoolType = object.infoByPoolType !== undefined && object.infoByPoolType !== null ? InfoByPoolType.fromPartial(object.infoByPoolType) : undefined; + message.cyclicArbTracker = object.cyclicArbTracker !== undefined && object.cyclicArbTracker !== null ? CyclicArbTracker.fromPartial(object.cyclicArbTracker) : undefined; return message; }, fromAmino(object: GenesisStateAmino): GenesisState { - return { - params: object?.params ? Params.fromAmino(object.params) : undefined, - tokenPairArbRoutes: Array.isArray(object?.token_pair_arb_routes) ? object.token_pair_arb_routes.map((e: any) => TokenPairArbRoutes.fromAmino(e)) : [], - baseDenoms: Array.isArray(object?.base_denoms) ? object.base_denoms.map((e: any) => BaseDenom.fromAmino(e)) : [], - poolWeights: object?.pool_weights ? PoolWeights.fromAmino(object.pool_weights) : undefined, - daysSinceModuleGenesis: BigInt(object.days_since_module_genesis), - developerFees: Array.isArray(object?.developer_fees) ? object.developer_fees.map((e: any) => Coin.fromAmino(e)) : [], - latestBlockHeight: BigInt(object.latest_block_height), - developerAddress: object.developer_address, - maxPoolPointsPerBlock: BigInt(object.max_pool_points_per_block), - maxPoolPointsPerTx: BigInt(object.max_pool_points_per_tx), - pointCountForBlock: BigInt(object.point_count_for_block), - profits: Array.isArray(object?.profits) ? object.profits.map((e: any) => Coin.fromAmino(e)) : [] - }; + const message = createBaseGenesisState(); + if (object.params !== undefined && object.params !== null) { + message.params = Params.fromAmino(object.params); + } + message.tokenPairArbRoutes = object.token_pair_arb_routes?.map(e => TokenPairArbRoutes.fromAmino(e)) || []; + message.baseDenoms = object.base_denoms?.map(e => BaseDenom.fromAmino(e)) || []; + if (object.pool_weights !== undefined && object.pool_weights !== null) { + message.poolWeights = PoolWeights.fromAmino(object.pool_weights); + } + if (object.days_since_module_genesis !== undefined && object.days_since_module_genesis !== null) { + message.daysSinceModuleGenesis = BigInt(object.days_since_module_genesis); + } + message.developerFees = object.developer_fees?.map(e => Coin.fromAmino(e)) || []; + if (object.latest_block_height !== undefined && object.latest_block_height !== null) { + message.latestBlockHeight = BigInt(object.latest_block_height); + } + if (object.developer_address !== undefined && object.developer_address !== null) { + message.developerAddress = object.developer_address; + } + if (object.max_pool_points_per_block !== undefined && object.max_pool_points_per_block !== null) { + message.maxPoolPointsPerBlock = BigInt(object.max_pool_points_per_block); + } + if (object.max_pool_points_per_tx !== undefined && object.max_pool_points_per_tx !== null) { + message.maxPoolPointsPerTx = BigInt(object.max_pool_points_per_tx); + } + if (object.point_count_for_block !== undefined && object.point_count_for_block !== null) { + message.pointCountForBlock = BigInt(object.point_count_for_block); + } + message.profits = object.profits?.map(e => Coin.fromAmino(e)) || []; + if (object.info_by_pool_type !== undefined && object.info_by_pool_type !== null) { + message.infoByPoolType = InfoByPoolType.fromAmino(object.info_by_pool_type); + } + if (object.cyclic_arb_tracker !== undefined && object.cyclic_arb_tracker !== null) { + message.cyclicArbTracker = CyclicArbTracker.fromAmino(object.cyclic_arb_tracker); + } + return message; }, toAmino(message: GenesisState): GenesisStateAmino { const obj: any = {}; @@ -272,6 +330,8 @@ export const GenesisState = { } else { obj.profits = []; } + obj.info_by_pool_type = message.infoByPoolType ? InfoByPoolType.toAmino(message.infoByPoolType) : undefined; + obj.cyclic_arb_tracker = message.cyclicArbTracker ? CyclicArbTracker.toAmino(message.cyclicArbTracker) : undefined; return obj; }, fromAminoMsg(object: GenesisStateAminoMsg): GenesisState { diff --git a/packages/osmo-query/src/codegen/osmosis/protorev/v1beta1/gov.ts b/packages/osmo-query/src/codegen/osmosis/protorev/v1beta1/gov.ts index f1f3b20f9..8ec5bcc02 100644 --- a/packages/osmo-query/src/codegen/osmosis/protorev/v1beta1/gov.ts +++ b/packages/osmo-query/src/codegen/osmosis/protorev/v1beta1/gov.ts @@ -4,7 +4,7 @@ import { BinaryReader, BinaryWriter } from "../../../binary"; * protorev module is enabled */ export interface SetProtoRevEnabledProposal { - $typeUrl?: string; + $typeUrl?: "/osmosis.protorev.v1beta1.SetProtoRevEnabledProposal"; title: string; description: string; enabled: boolean; @@ -18,9 +18,9 @@ export interface SetProtoRevEnabledProposalProtoMsg { * protorev module is enabled */ export interface SetProtoRevEnabledProposalAmino { - title: string; - description: string; - enabled: boolean; + title?: string; + description?: string; + enabled?: boolean; } export interface SetProtoRevEnabledProposalAminoMsg { type: "osmosis/SetProtoRevEnabledProposal"; @@ -31,7 +31,7 @@ export interface SetProtoRevEnabledProposalAminoMsg { * protorev module is enabled */ export interface SetProtoRevEnabledProposalSDKType { - $typeUrl?: string; + $typeUrl?: "/osmosis.protorev.v1beta1.SetProtoRevEnabledProposal"; title: string; description: string; enabled: boolean; @@ -42,7 +42,7 @@ export interface SetProtoRevEnabledProposalSDKType { * developer address that will be receiving a share of profits from the module */ export interface SetProtoRevAdminAccountProposal { - $typeUrl?: string; + $typeUrl?: "/osmosis.protorev.v1beta1.SetProtoRevAdminAccountProposal"; title: string; description: string; account: string; @@ -57,9 +57,9 @@ export interface SetProtoRevAdminAccountProposalProtoMsg { * developer address that will be receiving a share of profits from the module */ export interface SetProtoRevAdminAccountProposalAmino { - title: string; - description: string; - account: string; + title?: string; + description?: string; + account?: string; } export interface SetProtoRevAdminAccountProposalAminoMsg { type: "osmosis/SetProtoRevAdminAccountProposal"; @@ -71,7 +71,7 @@ export interface SetProtoRevAdminAccountProposalAminoMsg { * developer address that will be receiving a share of profits from the module */ export interface SetProtoRevAdminAccountProposalSDKType { - $typeUrl?: string; + $typeUrl?: "/osmosis.protorev.v1beta1.SetProtoRevAdminAccountProposal"; title: string; description: string; account: string; @@ -129,11 +129,17 @@ export const SetProtoRevEnabledProposal = { return message; }, fromAmino(object: SetProtoRevEnabledProposalAmino): SetProtoRevEnabledProposal { - return { - title: object.title, - description: object.description, - enabled: object.enabled - }; + const message = createBaseSetProtoRevEnabledProposal(); + if (object.title !== undefined && object.title !== null) { + message.title = object.title; + } + if (object.description !== undefined && object.description !== null) { + message.description = object.description; + } + if (object.enabled !== undefined && object.enabled !== null) { + message.enabled = object.enabled; + } + return message; }, toAmino(message: SetProtoRevEnabledProposal): SetProtoRevEnabledProposalAmino { const obj: any = {}; @@ -217,11 +223,17 @@ export const SetProtoRevAdminAccountProposal = { return message; }, fromAmino(object: SetProtoRevAdminAccountProposalAmino): SetProtoRevAdminAccountProposal { - return { - title: object.title, - description: object.description, - account: object.account - }; + const message = createBaseSetProtoRevAdminAccountProposal(); + if (object.title !== undefined && object.title !== null) { + message.title = object.title; + } + if (object.description !== undefined && object.description !== null) { + message.description = object.description; + } + if (object.account !== undefined && object.account !== null) { + message.account = object.account; + } + return message; }, toAmino(message: SetProtoRevAdminAccountProposal): SetProtoRevAdminAccountProposalAmino { const obj: any = {}; diff --git a/packages/osmo-query/src/codegen/osmosis/protorev/v1beta1/params.ts b/packages/osmo-query/src/codegen/osmosis/protorev/v1beta1/params.ts index 8cff57d6a..fd0fefc69 100644 --- a/packages/osmo-query/src/codegen/osmosis/protorev/v1beta1/params.ts +++ b/packages/osmo-query/src/codegen/osmosis/protorev/v1beta1/params.ts @@ -13,9 +13,9 @@ export interface ParamsProtoMsg { /** Params defines the parameters for the module. */ export interface ParamsAmino { /** Boolean whether the protorev module is enabled. */ - enabled: boolean; + enabled?: boolean; /** The admin account (settings manager) of the protorev module. */ - admin: string; + admin?: string; } export interface ParamsAminoMsg { type: "osmosis/protorev/params"; @@ -70,10 +70,14 @@ export const Params = { return message; }, fromAmino(object: ParamsAmino): Params { - return { - enabled: object.enabled, - admin: object.admin - }; + const message = createBaseParams(); + if (object.enabled !== undefined && object.enabled !== null) { + message.enabled = object.enabled; + } + if (object.admin !== undefined && object.admin !== null) { + message.admin = object.admin; + } + return message; }, toAmino(message: Params): ParamsAmino { const obj: any = {}; diff --git a/packages/osmo-query/src/codegen/osmosis/protorev/v1beta1/protorev.ts b/packages/osmo-query/src/codegen/osmosis/protorev/v1beta1/protorev.ts index 75e7f0454..df762da5d 100644 --- a/packages/osmo-query/src/codegen/osmosis/protorev/v1beta1/protorev.ts +++ b/packages/osmo-query/src/codegen/osmosis/protorev/v1beta1/protorev.ts @@ -1,4 +1,5 @@ import { Coin, CoinAmino, CoinSDKType } from "../../../cosmos/base/v1beta1/coin"; +import { TakerFeesTracker, TakerFeesTrackerAmino, TakerFeesTrackerSDKType } from "../../poolmanager/v1beta1/genesis"; import { BinaryReader, BinaryWriter } from "../../../binary"; /** TokenPairArbRoutes tracks all of the hot routes for a given pair of tokens */ export interface TokenPairArbRoutes { @@ -16,11 +17,11 @@ export interface TokenPairArbRoutesProtoMsg { /** TokenPairArbRoutes tracks all of the hot routes for a given pair of tokens */ export interface TokenPairArbRoutesAmino { /** Stores all of the possible hot paths for a given pair of tokens */ - arb_routes: RouteAmino[]; + arb_routes?: RouteAmino[]; /** Token denomination of the first asset */ - token_in: string; + token_in?: string; /** Token denomination of the second asset */ - token_out: string; + token_out?: string; } export interface TokenPairArbRoutesAminoMsg { type: "osmosis/protorev/token-pair-arb-routes"; @@ -35,7 +36,8 @@ export interface TokenPairArbRoutesSDKType { /** Route is a hot route for a given pair of tokens */ export interface Route { /** - * The pool IDs that are travered in the directed cyclic graph (traversed left + * The pool IDs that are traversed in the directed cyclic graph (traversed + * left * -> right) */ trades: Trade[]; @@ -52,15 +54,16 @@ export interface RouteProtoMsg { /** Route is a hot route for a given pair of tokens */ export interface RouteAmino { /** - * The pool IDs that are travered in the directed cyclic graph (traversed left + * The pool IDs that are traversed in the directed cyclic graph (traversed + * left * -> right) */ - trades: TradeAmino[]; + trades?: TradeAmino[]; /** * The step size that will be used to find the optimal swap amount in the * binary search */ - step_size: string; + step_size?: string; } export interface RouteAminoMsg { type: "osmosis/protorev/route"; @@ -87,11 +90,11 @@ export interface TradeProtoMsg { /** Trade is a single trade in a route */ export interface TradeAmino { /** The pool id of the pool that is traded on */ - pool: string; + pool?: string; /** The denom of the token that is traded */ - token_in: string; + token_in?: string; /** The denom of the token that is received */ - token_out: string; + token_out?: string; } export interface TradeAminoMsg { type: "osmosis/protorev/trade"; @@ -128,14 +131,14 @@ export interface RouteStatisticsProtoMsg { */ export interface RouteStatisticsAmino { /** profits is the total profit from all trades on this route */ - profits: CoinAmino[]; + profits?: CoinAmino[]; /** * number_of_trades is the number of trades the module has executed using this * route */ - number_of_trades: string; + number_of_trades?: string; /** route is the route that was used (pool ids along the arbitrage route) */ - route: string[]; + route?: string[]; } export interface RouteStatisticsAminoMsg { type: "osmosis/protorev/route-statistics"; @@ -156,6 +159,9 @@ export interface RouteStatisticsSDKType { * significantly between the different pool types. Each weight roughly * corresponds to the amount of time (in ms) it takes to execute a swap on that * pool type. + * + * DEPRECATED: This field is deprecated and will be removed in the next + * release. It is replaced by the `info_by_pool_type` field. */ export interface PoolWeights { /** The weight of a stableswap pool */ @@ -164,6 +170,8 @@ export interface PoolWeights { balancerWeight: bigint; /** The weight of a concentrated pool */ concentratedWeight: bigint; + /** The weight of a cosmwasm pool */ + cosmwasmWeight: bigint; } export interface PoolWeightsProtoMsg { typeUrl: "/osmosis.protorev.v1beta1.PoolWeights"; @@ -175,14 +183,19 @@ export interface PoolWeightsProtoMsg { * significantly between the different pool types. Each weight roughly * corresponds to the amount of time (in ms) it takes to execute a swap on that * pool type. + * + * DEPRECATED: This field is deprecated and will be removed in the next + * release. It is replaced by the `info_by_pool_type` field. */ export interface PoolWeightsAmino { /** The weight of a stableswap pool */ - stable_weight: string; + stable_weight?: string; /** The weight of a balancer pool */ - balancer_weight: string; + balancer_weight?: string; /** The weight of a concentrated pool */ - concentrated_weight: string; + concentrated_weight?: string; + /** The weight of a cosmwasm pool */ + cosmwasm_weight?: string; } export interface PoolWeightsAminoMsg { type: "osmosis/protorev/pool-weights"; @@ -194,11 +207,205 @@ export interface PoolWeightsAminoMsg { * significantly between the different pool types. Each weight roughly * corresponds to the amount of time (in ms) it takes to execute a swap on that * pool type. + * + * DEPRECATED: This field is deprecated and will be removed in the next + * release. It is replaced by the `info_by_pool_type` field. */ export interface PoolWeightsSDKType { stable_weight: bigint; balancer_weight: bigint; concentrated_weight: bigint; + cosmwasm_weight: bigint; +} +/** + * InfoByPoolType contains information pertaining to how expensive (in terms of + * gas and time) it is to execute a swap on a given pool type. This distinction + * is made and necessary because the execution time ranges significantly between + * the different pool types. + */ +export interface InfoByPoolType { + /** The stable pool info */ + stable: StablePoolInfo; + /** The balancer pool info */ + balancer: BalancerPoolInfo; + /** The concentrated pool info */ + concentrated: ConcentratedPoolInfo; + /** The cosmwasm pool info */ + cosmwasm: CosmwasmPoolInfo; +} +export interface InfoByPoolTypeProtoMsg { + typeUrl: "/osmosis.protorev.v1beta1.InfoByPoolType"; + value: Uint8Array; +} +/** + * InfoByPoolType contains information pertaining to how expensive (in terms of + * gas and time) it is to execute a swap on a given pool type. This distinction + * is made and necessary because the execution time ranges significantly between + * the different pool types. + */ +export interface InfoByPoolTypeAmino { + /** The stable pool info */ + stable?: StablePoolInfoAmino; + /** The balancer pool info */ + balancer?: BalancerPoolInfoAmino; + /** The concentrated pool info */ + concentrated?: ConcentratedPoolInfoAmino; + /** The cosmwasm pool info */ + cosmwasm?: CosmwasmPoolInfoAmino; +} +export interface InfoByPoolTypeAminoMsg { + type: "osmosis/protorev/info-by-pool-type"; + value: InfoByPoolTypeAmino; +} +/** + * InfoByPoolType contains information pertaining to how expensive (in terms of + * gas and time) it is to execute a swap on a given pool type. This distinction + * is made and necessary because the execution time ranges significantly between + * the different pool types. + */ +export interface InfoByPoolTypeSDKType { + stable: StablePoolInfoSDKType; + balancer: BalancerPoolInfoSDKType; + concentrated: ConcentratedPoolInfoSDKType; + cosmwasm: CosmwasmPoolInfoSDKType; +} +/** StablePoolInfo contains meta data pertaining to a stableswap pool type. */ +export interface StablePoolInfo { + /** The weight of a stableswap pool */ + weight: bigint; +} +export interface StablePoolInfoProtoMsg { + typeUrl: "/osmosis.protorev.v1beta1.StablePoolInfo"; + value: Uint8Array; +} +/** StablePoolInfo contains meta data pertaining to a stableswap pool type. */ +export interface StablePoolInfoAmino { + /** The weight of a stableswap pool */ + weight?: string; +} +export interface StablePoolInfoAminoMsg { + type: "osmosis/protorev/stable-pool-info"; + value: StablePoolInfoAmino; +} +/** StablePoolInfo contains meta data pertaining to a stableswap pool type. */ +export interface StablePoolInfoSDKType { + weight: bigint; +} +/** BalancerPoolInfo contains meta data pertaining to a balancer pool type. */ +export interface BalancerPoolInfo { + /** The weight of a balancer pool */ + weight: bigint; +} +export interface BalancerPoolInfoProtoMsg { + typeUrl: "/osmosis.protorev.v1beta1.BalancerPoolInfo"; + value: Uint8Array; +} +/** BalancerPoolInfo contains meta data pertaining to a balancer pool type. */ +export interface BalancerPoolInfoAmino { + /** The weight of a balancer pool */ + weight?: string; +} +export interface BalancerPoolInfoAminoMsg { + type: "osmosis/protorev/balancer-pool-info"; + value: BalancerPoolInfoAmino; +} +/** BalancerPoolInfo contains meta data pertaining to a balancer pool type. */ +export interface BalancerPoolInfoSDKType { + weight: bigint; +} +/** + * ConcentratedPoolInfo contains meta data pertaining to a concentrated pool + * type. + */ +export interface ConcentratedPoolInfo { + /** The weight of a concentrated pool */ + weight: bigint; + /** The maximum number of ticks we can move when rebalancing */ + maxTicksCrossed: bigint; +} +export interface ConcentratedPoolInfoProtoMsg { + typeUrl: "/osmosis.protorev.v1beta1.ConcentratedPoolInfo"; + value: Uint8Array; +} +/** + * ConcentratedPoolInfo contains meta data pertaining to a concentrated pool + * type. + */ +export interface ConcentratedPoolInfoAmino { + /** The weight of a concentrated pool */ + weight?: string; + /** The maximum number of ticks we can move when rebalancing */ + max_ticks_crossed?: string; +} +export interface ConcentratedPoolInfoAminoMsg { + type: "osmosis/protorev/concentrated-pool-info"; + value: ConcentratedPoolInfoAmino; +} +/** + * ConcentratedPoolInfo contains meta data pertaining to a concentrated pool + * type. + */ +export interface ConcentratedPoolInfoSDKType { + weight: bigint; + max_ticks_crossed: bigint; +} +/** CosmwasmPoolInfo contains meta data pertaining to a cosmwasm pool type. */ +export interface CosmwasmPoolInfo { + /** The weight of a cosmwasm pool (by contract address) */ + weightMaps: WeightMap[]; +} +export interface CosmwasmPoolInfoProtoMsg { + typeUrl: "/osmosis.protorev.v1beta1.CosmwasmPoolInfo"; + value: Uint8Array; +} +/** CosmwasmPoolInfo contains meta data pertaining to a cosmwasm pool type. */ +export interface CosmwasmPoolInfoAmino { + /** The weight of a cosmwasm pool (by contract address) */ + weight_maps?: WeightMapAmino[]; +} +export interface CosmwasmPoolInfoAminoMsg { + type: "osmosis/protorev/cosmwasm-pool-info"; + value: CosmwasmPoolInfoAmino; +} +/** CosmwasmPoolInfo contains meta data pertaining to a cosmwasm pool type. */ +export interface CosmwasmPoolInfoSDKType { + weight_maps: WeightMapSDKType[]; +} +/** + * WeightMap maps a contract address to a weight. The weight of an address + * corresponds to the amount of ms required to execute a swap on that contract. + */ +export interface WeightMap { + /** The weight of a cosmwasm pool (by contract address) */ + weight: bigint; + /** The contract address */ + contractAddress: string; +} +export interface WeightMapProtoMsg { + typeUrl: "/osmosis.protorev.v1beta1.WeightMap"; + value: Uint8Array; +} +/** + * WeightMap maps a contract address to a weight. The weight of an address + * corresponds to the amount of ms required to execute a swap on that contract. + */ +export interface WeightMapAmino { + /** The weight of a cosmwasm pool (by contract address) */ + weight?: string; + /** The contract address */ + contract_address?: string; +} +export interface WeightMapAminoMsg { + type: "osmosis/protorev/weight-map"; + value: WeightMapAmino; +} +/** + * WeightMap maps a contract address to a weight. The weight of an address + * corresponds to the amount of ms required to execute a swap on that contract. + */ +export interface WeightMapSDKType { + weight: bigint; + contract_address: string; } /** * BaseDenom represents a single base denom that the module uses for its @@ -225,12 +432,12 @@ export interface BaseDenomProtoMsg { */ export interface BaseDenomAmino { /** The denom i.e. name of the base denom (ex. uosmo) */ - denom: string; + denom?: string; /** * The step size of the binary search that is used to find the optimal swap * amount */ - step_size: string; + step_size?: string; } export interface BaseDenomAminoMsg { type: "osmosis/protorev/base-denom"; @@ -245,6 +452,46 @@ export interface BaseDenomSDKType { denom: string; step_size: string; } +export interface AllProtocolRevenue { + takerFeesTracker: TakerFeesTracker; + cyclicArbTracker: CyclicArbTracker; +} +export interface AllProtocolRevenueProtoMsg { + typeUrl: "/osmosis.protorev.v1beta1.AllProtocolRevenue"; + value: Uint8Array; +} +export interface AllProtocolRevenueAmino { + taker_fees_tracker?: TakerFeesTrackerAmino; + cyclic_arb_tracker?: CyclicArbTrackerAmino; +} +export interface AllProtocolRevenueAminoMsg { + type: "osmosis/protorev/all-protocol-revenue"; + value: AllProtocolRevenueAmino; +} +export interface AllProtocolRevenueSDKType { + taker_fees_tracker: TakerFeesTrackerSDKType; + cyclic_arb_tracker: CyclicArbTrackerSDKType; +} +export interface CyclicArbTracker { + cyclicArb: Coin[]; + heightAccountingStartsFrom: bigint; +} +export interface CyclicArbTrackerProtoMsg { + typeUrl: "/osmosis.protorev.v1beta1.CyclicArbTracker"; + value: Uint8Array; +} +export interface CyclicArbTrackerAmino { + cyclic_arb?: CoinAmino[]; + height_accounting_starts_from?: string; +} +export interface CyclicArbTrackerAminoMsg { + type: "osmosis/protorev/cyclic-arb-tracker"; + value: CyclicArbTrackerAmino; +} +export interface CyclicArbTrackerSDKType { + cyclic_arb: CoinSDKType[]; + height_accounting_starts_from: bigint; +} function createBaseTokenPairArbRoutes(): TokenPairArbRoutes { return { arbRoutes: [], @@ -297,11 +544,15 @@ export const TokenPairArbRoutes = { return message; }, fromAmino(object: TokenPairArbRoutesAmino): TokenPairArbRoutes { - return { - arbRoutes: Array.isArray(object?.arb_routes) ? object.arb_routes.map((e: any) => Route.fromAmino(e)) : [], - tokenIn: object.token_in, - tokenOut: object.token_out - }; + const message = createBaseTokenPairArbRoutes(); + message.arbRoutes = object.arb_routes?.map(e => Route.fromAmino(e)) || []; + if (object.token_in !== undefined && object.token_in !== null) { + message.tokenIn = object.token_in; + } + if (object.token_out !== undefined && object.token_out !== null) { + message.tokenOut = object.token_out; + } + return message; }, toAmino(message: TokenPairArbRoutes): TokenPairArbRoutesAmino { const obj: any = {}; @@ -380,10 +631,12 @@ export const Route = { return message; }, fromAmino(object: RouteAmino): Route { - return { - trades: Array.isArray(object?.trades) ? object.trades.map((e: any) => Trade.fromAmino(e)) : [], - stepSize: object.step_size - }; + const message = createBaseRoute(); + message.trades = object.trades?.map(e => Trade.fromAmino(e)) || []; + if (object.step_size !== undefined && object.step_size !== null) { + message.stepSize = object.step_size; + } + return message; }, toAmino(message: Route): RouteAmino { const obj: any = {}; @@ -469,11 +722,17 @@ export const Trade = { return message; }, fromAmino(object: TradeAmino): Trade { - return { - pool: BigInt(object.pool), - tokenIn: object.token_in, - tokenOut: object.token_out - }; + const message = createBaseTrade(); + if (object.pool !== undefined && object.pool !== null) { + message.pool = BigInt(object.pool); + } + if (object.token_in !== undefined && object.token_in !== null) { + message.tokenIn = object.token_in; + } + if (object.token_out !== undefined && object.token_out !== null) { + message.tokenOut = object.token_out; + } + return message; }, toAmino(message: Trade): TradeAmino { const obj: any = {}; @@ -565,11 +824,13 @@ export const RouteStatistics = { return message; }, fromAmino(object: RouteStatisticsAmino): RouteStatistics { - return { - profits: Array.isArray(object?.profits) ? object.profits.map((e: any) => Coin.fromAmino(e)) : [], - numberOfTrades: object.number_of_trades, - route: Array.isArray(object?.route) ? object.route.map((e: any) => BigInt(e)) : [] - }; + const message = createBaseRouteStatistics(); + message.profits = object.profits?.map(e => Coin.fromAmino(e)) || []; + if (object.number_of_trades !== undefined && object.number_of_trades !== null) { + message.numberOfTrades = object.number_of_trades; + } + message.route = object.route?.map(e => BigInt(e)) || []; + return message; }, toAmino(message: RouteStatistics): RouteStatisticsAmino { const obj: any = {}; @@ -612,7 +873,8 @@ function createBasePoolWeights(): PoolWeights { return { stableWeight: BigInt(0), balancerWeight: BigInt(0), - concentratedWeight: BigInt(0) + concentratedWeight: BigInt(0), + cosmwasmWeight: BigInt(0) }; } export const PoolWeights = { @@ -627,6 +889,9 @@ export const PoolWeights = { if (message.concentratedWeight !== BigInt(0)) { writer.uint32(24).uint64(message.concentratedWeight); } + if (message.cosmwasmWeight !== BigInt(0)) { + writer.uint32(32).uint64(message.cosmwasmWeight); + } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): PoolWeights { @@ -645,6 +910,9 @@ export const PoolWeights = { case 3: message.concentratedWeight = reader.uint64(); break; + case 4: + message.cosmwasmWeight = reader.uint64(); + break; default: reader.skipType(tag & 7); break; @@ -657,20 +925,31 @@ export const PoolWeights = { message.stableWeight = object.stableWeight !== undefined && object.stableWeight !== null ? BigInt(object.stableWeight.toString()) : BigInt(0); message.balancerWeight = object.balancerWeight !== undefined && object.balancerWeight !== null ? BigInt(object.balancerWeight.toString()) : BigInt(0); message.concentratedWeight = object.concentratedWeight !== undefined && object.concentratedWeight !== null ? BigInt(object.concentratedWeight.toString()) : BigInt(0); + message.cosmwasmWeight = object.cosmwasmWeight !== undefined && object.cosmwasmWeight !== null ? BigInt(object.cosmwasmWeight.toString()) : BigInt(0); return message; }, fromAmino(object: PoolWeightsAmino): PoolWeights { - return { - stableWeight: BigInt(object.stable_weight), - balancerWeight: BigInt(object.balancer_weight), - concentratedWeight: BigInt(object.concentrated_weight) - }; + const message = createBasePoolWeights(); + if (object.stable_weight !== undefined && object.stable_weight !== null) { + message.stableWeight = BigInt(object.stable_weight); + } + if (object.balancer_weight !== undefined && object.balancer_weight !== null) { + message.balancerWeight = BigInt(object.balancer_weight); + } + if (object.concentrated_weight !== undefined && object.concentrated_weight !== null) { + message.concentratedWeight = BigInt(object.concentrated_weight); + } + if (object.cosmwasm_weight !== undefined && object.cosmwasm_weight !== null) { + message.cosmwasmWeight = BigInt(object.cosmwasm_weight); + } + return message; }, toAmino(message: PoolWeights): PoolWeightsAmino { const obj: any = {}; obj.stable_weight = message.stableWeight ? message.stableWeight.toString() : undefined; obj.balancer_weight = message.balancerWeight ? message.balancerWeight.toString() : undefined; obj.concentrated_weight = message.concentratedWeight ? message.concentratedWeight.toString() : undefined; + obj.cosmwasm_weight = message.cosmwasmWeight ? message.cosmwasmWeight.toString() : undefined; return obj; }, fromAminoMsg(object: PoolWeightsAminoMsg): PoolWeights { @@ -695,6 +974,482 @@ export const PoolWeights = { }; } }; +function createBaseInfoByPoolType(): InfoByPoolType { + return { + stable: StablePoolInfo.fromPartial({}), + balancer: BalancerPoolInfo.fromPartial({}), + concentrated: ConcentratedPoolInfo.fromPartial({}), + cosmwasm: CosmwasmPoolInfo.fromPartial({}) + }; +} +export const InfoByPoolType = { + typeUrl: "/osmosis.protorev.v1beta1.InfoByPoolType", + encode(message: InfoByPoolType, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.stable !== undefined) { + StablePoolInfo.encode(message.stable, writer.uint32(10).fork()).ldelim(); + } + if (message.balancer !== undefined) { + BalancerPoolInfo.encode(message.balancer, writer.uint32(18).fork()).ldelim(); + } + if (message.concentrated !== undefined) { + ConcentratedPoolInfo.encode(message.concentrated, writer.uint32(26).fork()).ldelim(); + } + if (message.cosmwasm !== undefined) { + CosmwasmPoolInfo.encode(message.cosmwasm, writer.uint32(34).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): InfoByPoolType { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseInfoByPoolType(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.stable = StablePoolInfo.decode(reader, reader.uint32()); + break; + case 2: + message.balancer = BalancerPoolInfo.decode(reader, reader.uint32()); + break; + case 3: + message.concentrated = ConcentratedPoolInfo.decode(reader, reader.uint32()); + break; + case 4: + message.cosmwasm = CosmwasmPoolInfo.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): InfoByPoolType { + const message = createBaseInfoByPoolType(); + message.stable = object.stable !== undefined && object.stable !== null ? StablePoolInfo.fromPartial(object.stable) : undefined; + message.balancer = object.balancer !== undefined && object.balancer !== null ? BalancerPoolInfo.fromPartial(object.balancer) : undefined; + message.concentrated = object.concentrated !== undefined && object.concentrated !== null ? ConcentratedPoolInfo.fromPartial(object.concentrated) : undefined; + message.cosmwasm = object.cosmwasm !== undefined && object.cosmwasm !== null ? CosmwasmPoolInfo.fromPartial(object.cosmwasm) : undefined; + return message; + }, + fromAmino(object: InfoByPoolTypeAmino): InfoByPoolType { + const message = createBaseInfoByPoolType(); + if (object.stable !== undefined && object.stable !== null) { + message.stable = StablePoolInfo.fromAmino(object.stable); + } + if (object.balancer !== undefined && object.balancer !== null) { + message.balancer = BalancerPoolInfo.fromAmino(object.balancer); + } + if (object.concentrated !== undefined && object.concentrated !== null) { + message.concentrated = ConcentratedPoolInfo.fromAmino(object.concentrated); + } + if (object.cosmwasm !== undefined && object.cosmwasm !== null) { + message.cosmwasm = CosmwasmPoolInfo.fromAmino(object.cosmwasm); + } + return message; + }, + toAmino(message: InfoByPoolType): InfoByPoolTypeAmino { + const obj: any = {}; + obj.stable = message.stable ? StablePoolInfo.toAmino(message.stable) : undefined; + obj.balancer = message.balancer ? BalancerPoolInfo.toAmino(message.balancer) : undefined; + obj.concentrated = message.concentrated ? ConcentratedPoolInfo.toAmino(message.concentrated) : undefined; + obj.cosmwasm = message.cosmwasm ? CosmwasmPoolInfo.toAmino(message.cosmwasm) : undefined; + return obj; + }, + fromAminoMsg(object: InfoByPoolTypeAminoMsg): InfoByPoolType { + return InfoByPoolType.fromAmino(object.value); + }, + toAminoMsg(message: InfoByPoolType): InfoByPoolTypeAminoMsg { + return { + type: "osmosis/protorev/info-by-pool-type", + value: InfoByPoolType.toAmino(message) + }; + }, + fromProtoMsg(message: InfoByPoolTypeProtoMsg): InfoByPoolType { + return InfoByPoolType.decode(message.value); + }, + toProto(message: InfoByPoolType): Uint8Array { + return InfoByPoolType.encode(message).finish(); + }, + toProtoMsg(message: InfoByPoolType): InfoByPoolTypeProtoMsg { + return { + typeUrl: "/osmosis.protorev.v1beta1.InfoByPoolType", + value: InfoByPoolType.encode(message).finish() + }; + } +}; +function createBaseStablePoolInfo(): StablePoolInfo { + return { + weight: BigInt(0) + }; +} +export const StablePoolInfo = { + typeUrl: "/osmosis.protorev.v1beta1.StablePoolInfo", + encode(message: StablePoolInfo, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.weight !== BigInt(0)) { + writer.uint32(8).uint64(message.weight); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): StablePoolInfo { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseStablePoolInfo(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.weight = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): StablePoolInfo { + const message = createBaseStablePoolInfo(); + message.weight = object.weight !== undefined && object.weight !== null ? BigInt(object.weight.toString()) : BigInt(0); + return message; + }, + fromAmino(object: StablePoolInfoAmino): StablePoolInfo { + const message = createBaseStablePoolInfo(); + if (object.weight !== undefined && object.weight !== null) { + message.weight = BigInt(object.weight); + } + return message; + }, + toAmino(message: StablePoolInfo): StablePoolInfoAmino { + const obj: any = {}; + obj.weight = message.weight ? message.weight.toString() : undefined; + return obj; + }, + fromAminoMsg(object: StablePoolInfoAminoMsg): StablePoolInfo { + return StablePoolInfo.fromAmino(object.value); + }, + toAminoMsg(message: StablePoolInfo): StablePoolInfoAminoMsg { + return { + type: "osmosis/protorev/stable-pool-info", + value: StablePoolInfo.toAmino(message) + }; + }, + fromProtoMsg(message: StablePoolInfoProtoMsg): StablePoolInfo { + return StablePoolInfo.decode(message.value); + }, + toProto(message: StablePoolInfo): Uint8Array { + return StablePoolInfo.encode(message).finish(); + }, + toProtoMsg(message: StablePoolInfo): StablePoolInfoProtoMsg { + return { + typeUrl: "/osmosis.protorev.v1beta1.StablePoolInfo", + value: StablePoolInfo.encode(message).finish() + }; + } +}; +function createBaseBalancerPoolInfo(): BalancerPoolInfo { + return { + weight: BigInt(0) + }; +} +export const BalancerPoolInfo = { + typeUrl: "/osmosis.protorev.v1beta1.BalancerPoolInfo", + encode(message: BalancerPoolInfo, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.weight !== BigInt(0)) { + writer.uint32(8).uint64(message.weight); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): BalancerPoolInfo { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseBalancerPoolInfo(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.weight = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): BalancerPoolInfo { + const message = createBaseBalancerPoolInfo(); + message.weight = object.weight !== undefined && object.weight !== null ? BigInt(object.weight.toString()) : BigInt(0); + return message; + }, + fromAmino(object: BalancerPoolInfoAmino): BalancerPoolInfo { + const message = createBaseBalancerPoolInfo(); + if (object.weight !== undefined && object.weight !== null) { + message.weight = BigInt(object.weight); + } + return message; + }, + toAmino(message: BalancerPoolInfo): BalancerPoolInfoAmino { + const obj: any = {}; + obj.weight = message.weight ? message.weight.toString() : undefined; + return obj; + }, + fromAminoMsg(object: BalancerPoolInfoAminoMsg): BalancerPoolInfo { + return BalancerPoolInfo.fromAmino(object.value); + }, + toAminoMsg(message: BalancerPoolInfo): BalancerPoolInfoAminoMsg { + return { + type: "osmosis/protorev/balancer-pool-info", + value: BalancerPoolInfo.toAmino(message) + }; + }, + fromProtoMsg(message: BalancerPoolInfoProtoMsg): BalancerPoolInfo { + return BalancerPoolInfo.decode(message.value); + }, + toProto(message: BalancerPoolInfo): Uint8Array { + return BalancerPoolInfo.encode(message).finish(); + }, + toProtoMsg(message: BalancerPoolInfo): BalancerPoolInfoProtoMsg { + return { + typeUrl: "/osmosis.protorev.v1beta1.BalancerPoolInfo", + value: BalancerPoolInfo.encode(message).finish() + }; + } +}; +function createBaseConcentratedPoolInfo(): ConcentratedPoolInfo { + return { + weight: BigInt(0), + maxTicksCrossed: BigInt(0) + }; +} +export const ConcentratedPoolInfo = { + typeUrl: "/osmosis.protorev.v1beta1.ConcentratedPoolInfo", + encode(message: ConcentratedPoolInfo, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.weight !== BigInt(0)) { + writer.uint32(8).uint64(message.weight); + } + if (message.maxTicksCrossed !== BigInt(0)) { + writer.uint32(16).uint64(message.maxTicksCrossed); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): ConcentratedPoolInfo { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseConcentratedPoolInfo(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.weight = reader.uint64(); + break; + case 2: + message.maxTicksCrossed = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): ConcentratedPoolInfo { + const message = createBaseConcentratedPoolInfo(); + message.weight = object.weight !== undefined && object.weight !== null ? BigInt(object.weight.toString()) : BigInt(0); + message.maxTicksCrossed = object.maxTicksCrossed !== undefined && object.maxTicksCrossed !== null ? BigInt(object.maxTicksCrossed.toString()) : BigInt(0); + return message; + }, + fromAmino(object: ConcentratedPoolInfoAmino): ConcentratedPoolInfo { + const message = createBaseConcentratedPoolInfo(); + if (object.weight !== undefined && object.weight !== null) { + message.weight = BigInt(object.weight); + } + if (object.max_ticks_crossed !== undefined && object.max_ticks_crossed !== null) { + message.maxTicksCrossed = BigInt(object.max_ticks_crossed); + } + return message; + }, + toAmino(message: ConcentratedPoolInfo): ConcentratedPoolInfoAmino { + const obj: any = {}; + obj.weight = message.weight ? message.weight.toString() : undefined; + obj.max_ticks_crossed = message.maxTicksCrossed ? message.maxTicksCrossed.toString() : undefined; + return obj; + }, + fromAminoMsg(object: ConcentratedPoolInfoAminoMsg): ConcentratedPoolInfo { + return ConcentratedPoolInfo.fromAmino(object.value); + }, + toAminoMsg(message: ConcentratedPoolInfo): ConcentratedPoolInfoAminoMsg { + return { + type: "osmosis/protorev/concentrated-pool-info", + value: ConcentratedPoolInfo.toAmino(message) + }; + }, + fromProtoMsg(message: ConcentratedPoolInfoProtoMsg): ConcentratedPoolInfo { + return ConcentratedPoolInfo.decode(message.value); + }, + toProto(message: ConcentratedPoolInfo): Uint8Array { + return ConcentratedPoolInfo.encode(message).finish(); + }, + toProtoMsg(message: ConcentratedPoolInfo): ConcentratedPoolInfoProtoMsg { + return { + typeUrl: "/osmosis.protorev.v1beta1.ConcentratedPoolInfo", + value: ConcentratedPoolInfo.encode(message).finish() + }; + } +}; +function createBaseCosmwasmPoolInfo(): CosmwasmPoolInfo { + return { + weightMaps: [] + }; +} +export const CosmwasmPoolInfo = { + typeUrl: "/osmosis.protorev.v1beta1.CosmwasmPoolInfo", + encode(message: CosmwasmPoolInfo, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.weightMaps) { + WeightMap.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): CosmwasmPoolInfo { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseCosmwasmPoolInfo(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.weightMaps.push(WeightMap.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): CosmwasmPoolInfo { + const message = createBaseCosmwasmPoolInfo(); + message.weightMaps = object.weightMaps?.map(e => WeightMap.fromPartial(e)) || []; + return message; + }, + fromAmino(object: CosmwasmPoolInfoAmino): CosmwasmPoolInfo { + const message = createBaseCosmwasmPoolInfo(); + message.weightMaps = object.weight_maps?.map(e => WeightMap.fromAmino(e)) || []; + return message; + }, + toAmino(message: CosmwasmPoolInfo): CosmwasmPoolInfoAmino { + const obj: any = {}; + if (message.weightMaps) { + obj.weight_maps = message.weightMaps.map(e => e ? WeightMap.toAmino(e) : undefined); + } else { + obj.weight_maps = []; + } + return obj; + }, + fromAminoMsg(object: CosmwasmPoolInfoAminoMsg): CosmwasmPoolInfo { + return CosmwasmPoolInfo.fromAmino(object.value); + }, + toAminoMsg(message: CosmwasmPoolInfo): CosmwasmPoolInfoAminoMsg { + return { + type: "osmosis/protorev/cosmwasm-pool-info", + value: CosmwasmPoolInfo.toAmino(message) + }; + }, + fromProtoMsg(message: CosmwasmPoolInfoProtoMsg): CosmwasmPoolInfo { + return CosmwasmPoolInfo.decode(message.value); + }, + toProto(message: CosmwasmPoolInfo): Uint8Array { + return CosmwasmPoolInfo.encode(message).finish(); + }, + toProtoMsg(message: CosmwasmPoolInfo): CosmwasmPoolInfoProtoMsg { + return { + typeUrl: "/osmosis.protorev.v1beta1.CosmwasmPoolInfo", + value: CosmwasmPoolInfo.encode(message).finish() + }; + } +}; +function createBaseWeightMap(): WeightMap { + return { + weight: BigInt(0), + contractAddress: "" + }; +} +export const WeightMap = { + typeUrl: "/osmosis.protorev.v1beta1.WeightMap", + encode(message: WeightMap, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.weight !== BigInt(0)) { + writer.uint32(8).uint64(message.weight); + } + if (message.contractAddress !== "") { + writer.uint32(18).string(message.contractAddress); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): WeightMap { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseWeightMap(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.weight = reader.uint64(); + break; + case 2: + message.contractAddress = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): WeightMap { + const message = createBaseWeightMap(); + message.weight = object.weight !== undefined && object.weight !== null ? BigInt(object.weight.toString()) : BigInt(0); + message.contractAddress = object.contractAddress ?? ""; + return message; + }, + fromAmino(object: WeightMapAmino): WeightMap { + const message = createBaseWeightMap(); + if (object.weight !== undefined && object.weight !== null) { + message.weight = BigInt(object.weight); + } + if (object.contract_address !== undefined && object.contract_address !== null) { + message.contractAddress = object.contract_address; + } + return message; + }, + toAmino(message: WeightMap): WeightMapAmino { + const obj: any = {}; + obj.weight = message.weight ? message.weight.toString() : undefined; + obj.contract_address = message.contractAddress; + return obj; + }, + fromAminoMsg(object: WeightMapAminoMsg): WeightMap { + return WeightMap.fromAmino(object.value); + }, + toAminoMsg(message: WeightMap): WeightMapAminoMsg { + return { + type: "osmosis/protorev/weight-map", + value: WeightMap.toAmino(message) + }; + }, + fromProtoMsg(message: WeightMapProtoMsg): WeightMap { + return WeightMap.decode(message.value); + }, + toProto(message: WeightMap): Uint8Array { + return WeightMap.encode(message).finish(); + }, + toProtoMsg(message: WeightMap): WeightMapProtoMsg { + return { + typeUrl: "/osmosis.protorev.v1beta1.WeightMap", + value: WeightMap.encode(message).finish() + }; + } +}; function createBaseBaseDenom(): BaseDenom { return { denom: "", @@ -739,10 +1494,14 @@ export const BaseDenom = { return message; }, fromAmino(object: BaseDenomAmino): BaseDenom { - return { - denom: object.denom, - stepSize: object.step_size - }; + const message = createBaseBaseDenom(); + if (object.denom !== undefined && object.denom !== null) { + message.denom = object.denom; + } + if (object.step_size !== undefined && object.step_size !== null) { + message.stepSize = object.step_size; + } + return message; }, toAmino(message: BaseDenom): BaseDenomAmino { const obj: any = {}; @@ -771,4 +1530,168 @@ export const BaseDenom = { value: BaseDenom.encode(message).finish() }; } +}; +function createBaseAllProtocolRevenue(): AllProtocolRevenue { + return { + takerFeesTracker: TakerFeesTracker.fromPartial({}), + cyclicArbTracker: CyclicArbTracker.fromPartial({}) + }; +} +export const AllProtocolRevenue = { + typeUrl: "/osmosis.protorev.v1beta1.AllProtocolRevenue", + encode(message: AllProtocolRevenue, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.takerFeesTracker !== undefined) { + TakerFeesTracker.encode(message.takerFeesTracker, writer.uint32(10).fork()).ldelim(); + } + if (message.cyclicArbTracker !== undefined) { + CyclicArbTracker.encode(message.cyclicArbTracker, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): AllProtocolRevenue { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseAllProtocolRevenue(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.takerFeesTracker = TakerFeesTracker.decode(reader, reader.uint32()); + break; + case 3: + message.cyclicArbTracker = CyclicArbTracker.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): AllProtocolRevenue { + const message = createBaseAllProtocolRevenue(); + message.takerFeesTracker = object.takerFeesTracker !== undefined && object.takerFeesTracker !== null ? TakerFeesTracker.fromPartial(object.takerFeesTracker) : undefined; + message.cyclicArbTracker = object.cyclicArbTracker !== undefined && object.cyclicArbTracker !== null ? CyclicArbTracker.fromPartial(object.cyclicArbTracker) : undefined; + return message; + }, + fromAmino(object: AllProtocolRevenueAmino): AllProtocolRevenue { + const message = createBaseAllProtocolRevenue(); + if (object.taker_fees_tracker !== undefined && object.taker_fees_tracker !== null) { + message.takerFeesTracker = TakerFeesTracker.fromAmino(object.taker_fees_tracker); + } + if (object.cyclic_arb_tracker !== undefined && object.cyclic_arb_tracker !== null) { + message.cyclicArbTracker = CyclicArbTracker.fromAmino(object.cyclic_arb_tracker); + } + return message; + }, + toAmino(message: AllProtocolRevenue): AllProtocolRevenueAmino { + const obj: any = {}; + obj.taker_fees_tracker = message.takerFeesTracker ? TakerFeesTracker.toAmino(message.takerFeesTracker) : undefined; + obj.cyclic_arb_tracker = message.cyclicArbTracker ? CyclicArbTracker.toAmino(message.cyclicArbTracker) : undefined; + return obj; + }, + fromAminoMsg(object: AllProtocolRevenueAminoMsg): AllProtocolRevenue { + return AllProtocolRevenue.fromAmino(object.value); + }, + toAminoMsg(message: AllProtocolRevenue): AllProtocolRevenueAminoMsg { + return { + type: "osmosis/protorev/all-protocol-revenue", + value: AllProtocolRevenue.toAmino(message) + }; + }, + fromProtoMsg(message: AllProtocolRevenueProtoMsg): AllProtocolRevenue { + return AllProtocolRevenue.decode(message.value); + }, + toProto(message: AllProtocolRevenue): Uint8Array { + return AllProtocolRevenue.encode(message).finish(); + }, + toProtoMsg(message: AllProtocolRevenue): AllProtocolRevenueProtoMsg { + return { + typeUrl: "/osmosis.protorev.v1beta1.AllProtocolRevenue", + value: AllProtocolRevenue.encode(message).finish() + }; + } +}; +function createBaseCyclicArbTracker(): CyclicArbTracker { + return { + cyclicArb: [], + heightAccountingStartsFrom: BigInt(0) + }; +} +export const CyclicArbTracker = { + typeUrl: "/osmosis.protorev.v1beta1.CyclicArbTracker", + encode(message: CyclicArbTracker, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.cyclicArb) { + Coin.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.heightAccountingStartsFrom !== BigInt(0)) { + writer.uint32(16).int64(message.heightAccountingStartsFrom); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): CyclicArbTracker { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseCyclicArbTracker(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.cyclicArb.push(Coin.decode(reader, reader.uint32())); + break; + case 2: + message.heightAccountingStartsFrom = reader.int64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): CyclicArbTracker { + const message = createBaseCyclicArbTracker(); + message.cyclicArb = object.cyclicArb?.map(e => Coin.fromPartial(e)) || []; + message.heightAccountingStartsFrom = object.heightAccountingStartsFrom !== undefined && object.heightAccountingStartsFrom !== null ? BigInt(object.heightAccountingStartsFrom.toString()) : BigInt(0); + return message; + }, + fromAmino(object: CyclicArbTrackerAmino): CyclicArbTracker { + const message = createBaseCyclicArbTracker(); + message.cyclicArb = object.cyclic_arb?.map(e => Coin.fromAmino(e)) || []; + if (object.height_accounting_starts_from !== undefined && object.height_accounting_starts_from !== null) { + message.heightAccountingStartsFrom = BigInt(object.height_accounting_starts_from); + } + return message; + }, + toAmino(message: CyclicArbTracker): CyclicArbTrackerAmino { + const obj: any = {}; + if (message.cyclicArb) { + obj.cyclic_arb = message.cyclicArb.map(e => e ? Coin.toAmino(e) : undefined); + } else { + obj.cyclic_arb = []; + } + obj.height_accounting_starts_from = message.heightAccountingStartsFrom ? message.heightAccountingStartsFrom.toString() : undefined; + return obj; + }, + fromAminoMsg(object: CyclicArbTrackerAminoMsg): CyclicArbTracker { + return CyclicArbTracker.fromAmino(object.value); + }, + toAminoMsg(message: CyclicArbTracker): CyclicArbTrackerAminoMsg { + return { + type: "osmosis/protorev/cyclic-arb-tracker", + value: CyclicArbTracker.toAmino(message) + }; + }, + fromProtoMsg(message: CyclicArbTrackerProtoMsg): CyclicArbTracker { + return CyclicArbTracker.decode(message.value); + }, + toProto(message: CyclicArbTracker): Uint8Array { + return CyclicArbTracker.encode(message).finish(); + }, + toProtoMsg(message: CyclicArbTracker): CyclicArbTrackerProtoMsg { + return { + typeUrl: "/osmosis.protorev.v1beta1.CyclicArbTracker", + value: CyclicArbTracker.encode(message).finish() + }; + } }; \ No newline at end of file diff --git a/packages/osmo-query/src/codegen/osmosis/protorev/v1beta1/query.lcd.ts b/packages/osmo-query/src/codegen/osmosis/protorev/v1beta1/query.lcd.ts index a24f9782f..625584dec 100644 --- a/packages/osmo-query/src/codegen/osmosis/protorev/v1beta1/query.lcd.ts +++ b/packages/osmo-query/src/codegen/osmosis/protorev/v1beta1/query.lcd.ts @@ -1,5 +1,5 @@ import { LCDClient } from "@cosmology/lcd"; -import { QueryParamsRequest, QueryParamsResponseSDKType, QueryGetProtoRevNumberOfTradesRequest, QueryGetProtoRevNumberOfTradesResponseSDKType, QueryGetProtoRevProfitsByDenomRequest, QueryGetProtoRevProfitsByDenomResponseSDKType, QueryGetProtoRevAllProfitsRequest, QueryGetProtoRevAllProfitsResponseSDKType, QueryGetProtoRevStatisticsByRouteRequest, QueryGetProtoRevStatisticsByRouteResponseSDKType, QueryGetProtoRevAllRouteStatisticsRequest, QueryGetProtoRevAllRouteStatisticsResponseSDKType, QueryGetProtoRevTokenPairArbRoutesRequest, QueryGetProtoRevTokenPairArbRoutesResponseSDKType, QueryGetProtoRevAdminAccountRequest, QueryGetProtoRevAdminAccountResponseSDKType, QueryGetProtoRevDeveloperAccountRequest, QueryGetProtoRevDeveloperAccountResponseSDKType, QueryGetProtoRevPoolWeightsRequest, QueryGetProtoRevPoolWeightsResponseSDKType, QueryGetProtoRevMaxPoolPointsPerTxRequest, QueryGetProtoRevMaxPoolPointsPerTxResponseSDKType, QueryGetProtoRevMaxPoolPointsPerBlockRequest, QueryGetProtoRevMaxPoolPointsPerBlockResponseSDKType, QueryGetProtoRevBaseDenomsRequest, QueryGetProtoRevBaseDenomsResponseSDKType, QueryGetProtoRevEnabledRequest, QueryGetProtoRevEnabledResponseSDKType, QueryGetProtoRevPoolRequest, QueryGetProtoRevPoolResponseSDKType } from "./query"; +import { QueryParamsRequest, QueryParamsResponseSDKType, QueryGetProtoRevNumberOfTradesRequest, QueryGetProtoRevNumberOfTradesResponseSDKType, QueryGetProtoRevProfitsByDenomRequest, QueryGetProtoRevProfitsByDenomResponseSDKType, QueryGetProtoRevAllProfitsRequest, QueryGetProtoRevAllProfitsResponseSDKType, QueryGetProtoRevStatisticsByRouteRequest, QueryGetProtoRevStatisticsByRouteResponseSDKType, QueryGetProtoRevAllRouteStatisticsRequest, QueryGetProtoRevAllRouteStatisticsResponseSDKType, QueryGetProtoRevTokenPairArbRoutesRequest, QueryGetProtoRevTokenPairArbRoutesResponseSDKType, QueryGetProtoRevAdminAccountRequest, QueryGetProtoRevAdminAccountResponseSDKType, QueryGetProtoRevDeveloperAccountRequest, QueryGetProtoRevDeveloperAccountResponseSDKType, QueryGetProtoRevInfoByPoolTypeRequest, QueryGetProtoRevInfoByPoolTypeResponseSDKType, QueryGetProtoRevMaxPoolPointsPerTxRequest, QueryGetProtoRevMaxPoolPointsPerTxResponseSDKType, QueryGetProtoRevMaxPoolPointsPerBlockRequest, QueryGetProtoRevMaxPoolPointsPerBlockResponseSDKType, QueryGetProtoRevBaseDenomsRequest, QueryGetProtoRevBaseDenomsResponseSDKType, QueryGetProtoRevEnabledRequest, QueryGetProtoRevEnabledResponseSDKType, QueryGetProtoRevPoolRequest, QueryGetProtoRevPoolResponseSDKType, QueryGetAllProtocolRevenueRequest, QueryGetAllProtocolRevenueResponseSDKType } from "./query"; export class LCDQueryClient { req: LCDClient; constructor({ @@ -17,22 +17,23 @@ export class LCDQueryClient { this.getProtoRevTokenPairArbRoutes = this.getProtoRevTokenPairArbRoutes.bind(this); this.getProtoRevAdminAccount = this.getProtoRevAdminAccount.bind(this); this.getProtoRevDeveloperAccount = this.getProtoRevDeveloperAccount.bind(this); - this.getProtoRevPoolWeights = this.getProtoRevPoolWeights.bind(this); + this.getProtoRevInfoByPoolType = this.getProtoRevInfoByPoolType.bind(this); this.getProtoRevMaxPoolPointsPerTx = this.getProtoRevMaxPoolPointsPerTx.bind(this); this.getProtoRevMaxPoolPointsPerBlock = this.getProtoRevMaxPoolPointsPerBlock.bind(this); this.getProtoRevBaseDenoms = this.getProtoRevBaseDenoms.bind(this); this.getProtoRevEnabled = this.getProtoRevEnabled.bind(this); this.getProtoRevPool = this.getProtoRevPool.bind(this); + this.getAllProtocolRevenue = this.getAllProtocolRevenue.bind(this); } /* Params queries the parameters of the module. */ async params(_params: QueryParamsRequest = {}): Promise { - const endpoint = `osmosis/v14/protorev/params`; + const endpoint = `osmosis/protorev/params`; return await this.req.get(endpoint); } /* GetProtoRevNumberOfTrades queries the number of arbitrage trades the module has executed */ async getProtoRevNumberOfTrades(_params: QueryGetProtoRevNumberOfTradesRequest = {}): Promise { - const endpoint = `osmosis/v14/protorev/number_of_trades`; + const endpoint = `osmosis/protorev/number_of_trades`; return await this.req.get(endpoint); } /* GetProtoRevProfitsByDenom queries the profits of the module by denom */ @@ -43,12 +44,12 @@ export class LCDQueryClient { if (typeof params?.denom !== "undefined") { options.params.denom = params.denom; } - const endpoint = `osmosis/v14/protorev/profits_by_denom`; + const endpoint = `osmosis/protorev/profits_by_denom`; return await this.req.get(endpoint, options); } /* GetProtoRevAllProfits queries all of the profits from the module */ async getProtoRevAllProfits(_params: QueryGetProtoRevAllProfitsRequest = {}): Promise { - const endpoint = `osmosis/v14/protorev/all_profits`; + const endpoint = `osmosis/protorev/all_profits`; return await this.req.get(endpoint); } /* GetProtoRevStatisticsByRoute queries the number of arbitrages and profits @@ -60,59 +61,59 @@ export class LCDQueryClient { if (typeof params?.route !== "undefined") { options.params.route = params.route; } - const endpoint = `osmosis/v14/protorev/statistics_by_route`; + const endpoint = `osmosis/protorev/statistics_by_route`; return await this.req.get(endpoint, options); } /* GetProtoRevAllRouteStatistics queries all of routes that the module has arbitraged against and the number of trades and profits that have been accumulated for each route */ async getProtoRevAllRouteStatistics(_params: QueryGetProtoRevAllRouteStatisticsRequest = {}): Promise { - const endpoint = `osmosis/v14/protorev/all_route_statistics`; + const endpoint = `osmosis/protorev/all_route_statistics`; return await this.req.get(endpoint); } /* GetProtoRevTokenPairArbRoutes queries all of the hot routes that the module is currently arbitraging */ async getProtoRevTokenPairArbRoutes(_params: QueryGetProtoRevTokenPairArbRoutesRequest = {}): Promise { - const endpoint = `osmosis/v14/protorev/token_pair_arb_routes`; + const endpoint = `osmosis/protorev/token_pair_arb_routes`; return await this.req.get(endpoint); } /* GetProtoRevAdminAccount queries the admin account of the module */ async getProtoRevAdminAccount(_params: QueryGetProtoRevAdminAccountRequest = {}): Promise { - const endpoint = `osmosis/v14/protorev/admin_account`; + const endpoint = `osmosis/protorev/admin_account`; return await this.req.get(endpoint); } /* GetProtoRevDeveloperAccount queries the developer account of the module */ async getProtoRevDeveloperAccount(_params: QueryGetProtoRevDeveloperAccountRequest = {}): Promise { - const endpoint = `osmosis/v14/protorev/developer_account`; + const endpoint = `osmosis/protorev/developer_account`; return await this.req.get(endpoint); } - /* GetProtoRevPoolWeights queries the weights of each pool type currently - being used by the module */ - async getProtoRevPoolWeights(_params: QueryGetProtoRevPoolWeightsRequest = {}): Promise { - const endpoint = `osmosis/v14/protorev/pool_weights`; - return await this.req.get(endpoint); + /* GetProtoRevInfoByPoolType queries pool type information that is currently + being utilized by the module */ + async getProtoRevInfoByPoolType(_params: QueryGetProtoRevInfoByPoolTypeRequest = {}): Promise { + const endpoint = `osmosis/protorev/info_by_pool_type`; + return await this.req.get(endpoint); } /* GetProtoRevMaxPoolPointsPerTx queries the maximum number of pool points that can be consumed per transaction */ async getProtoRevMaxPoolPointsPerTx(_params: QueryGetProtoRevMaxPoolPointsPerTxRequest = {}): Promise { - const endpoint = `osmosis/v14/protorev/max_pool_points_per_tx`; + const endpoint = `osmosis/protorev/max_pool_points_per_tx`; return await this.req.get(endpoint); } /* GetProtoRevMaxPoolPointsPerBlock queries the maximum number of pool points that can consumed per block */ async getProtoRevMaxPoolPointsPerBlock(_params: QueryGetProtoRevMaxPoolPointsPerBlockRequest = {}): Promise { - const endpoint = `osmosis/v14/protorev/max_pool_points_per_block`; + const endpoint = `osmosis/protorev/max_pool_points_per_block`; return await this.req.get(endpoint); } /* GetProtoRevBaseDenoms queries the base denoms that the module is currently utilizing for arbitrage */ async getProtoRevBaseDenoms(_params: QueryGetProtoRevBaseDenomsRequest = {}): Promise { - const endpoint = `osmosis/v14/protorev/base_denoms`; + const endpoint = `osmosis/protorev/base_denoms`; return await this.req.get(endpoint); } /* GetProtoRevEnabled queries whether the module is enabled or not */ async getProtoRevEnabled(_params: QueryGetProtoRevEnabledRequest = {}): Promise { - const endpoint = `osmosis/v14/protorev/enabled`; + const endpoint = `osmosis/protorev/enabled`; return await this.req.get(endpoint); } /* GetProtoRevPool queries the pool id used via the highest liquidity method @@ -127,7 +128,13 @@ export class LCDQueryClient { if (typeof params?.otherDenom !== "undefined") { options.params.other_denom = params.otherDenom; } - const endpoint = `osmosis/v14/protorev/pool`; + const endpoint = `osmosis/protorev/pool`; return await this.req.get(endpoint, options); } + /* GetAllProtocolRevenue queries all of the protocol revenue that has been + accumulated by any module */ + async getAllProtocolRevenue(_params: QueryGetAllProtocolRevenueRequest = {}): Promise { + const endpoint = `osmosis/protorev/all_protocol_revenue`; + return await this.req.get(endpoint); + } } \ No newline at end of file diff --git a/packages/osmo-query/src/codegen/osmosis/protorev/v1beta1/query.rpc.Query.ts b/packages/osmo-query/src/codegen/osmosis/protorev/v1beta1/query.rpc.Query.ts index 055773faf..569dec3a7 100644 --- a/packages/osmo-query/src/codegen/osmosis/protorev/v1beta1/query.rpc.Query.ts +++ b/packages/osmo-query/src/codegen/osmosis/protorev/v1beta1/query.rpc.Query.ts @@ -3,7 +3,7 @@ import { BinaryReader } from "../../../binary"; import { QueryClient, createProtobufRpcClient, ProtobufRpcClient } from "@cosmjs/stargate"; import { ReactQueryParams } from "../../../react-query"; import { useQuery } from "@tanstack/react-query"; -import { QueryParamsRequest, QueryParamsResponse, QueryGetProtoRevNumberOfTradesRequest, QueryGetProtoRevNumberOfTradesResponse, QueryGetProtoRevProfitsByDenomRequest, QueryGetProtoRevProfitsByDenomResponse, QueryGetProtoRevAllProfitsRequest, QueryGetProtoRevAllProfitsResponse, QueryGetProtoRevStatisticsByRouteRequest, QueryGetProtoRevStatisticsByRouteResponse, QueryGetProtoRevAllRouteStatisticsRequest, QueryGetProtoRevAllRouteStatisticsResponse, QueryGetProtoRevTokenPairArbRoutesRequest, QueryGetProtoRevTokenPairArbRoutesResponse, QueryGetProtoRevAdminAccountRequest, QueryGetProtoRevAdminAccountResponse, QueryGetProtoRevDeveloperAccountRequest, QueryGetProtoRevDeveloperAccountResponse, QueryGetProtoRevPoolWeightsRequest, QueryGetProtoRevPoolWeightsResponse, QueryGetProtoRevMaxPoolPointsPerTxRequest, QueryGetProtoRevMaxPoolPointsPerTxResponse, QueryGetProtoRevMaxPoolPointsPerBlockRequest, QueryGetProtoRevMaxPoolPointsPerBlockResponse, QueryGetProtoRevBaseDenomsRequest, QueryGetProtoRevBaseDenomsResponse, QueryGetProtoRevEnabledRequest, QueryGetProtoRevEnabledResponse, QueryGetProtoRevPoolRequest, QueryGetProtoRevPoolResponse } from "./query"; +import { QueryParamsRequest, QueryParamsResponse, QueryGetProtoRevNumberOfTradesRequest, QueryGetProtoRevNumberOfTradesResponse, QueryGetProtoRevProfitsByDenomRequest, QueryGetProtoRevProfitsByDenomResponse, QueryGetProtoRevAllProfitsRequest, QueryGetProtoRevAllProfitsResponse, QueryGetProtoRevStatisticsByRouteRequest, QueryGetProtoRevStatisticsByRouteResponse, QueryGetProtoRevAllRouteStatisticsRequest, QueryGetProtoRevAllRouteStatisticsResponse, QueryGetProtoRevTokenPairArbRoutesRequest, QueryGetProtoRevTokenPairArbRoutesResponse, QueryGetProtoRevAdminAccountRequest, QueryGetProtoRevAdminAccountResponse, QueryGetProtoRevDeveloperAccountRequest, QueryGetProtoRevDeveloperAccountResponse, QueryGetProtoRevInfoByPoolTypeRequest, QueryGetProtoRevInfoByPoolTypeResponse, QueryGetProtoRevMaxPoolPointsPerTxRequest, QueryGetProtoRevMaxPoolPointsPerTxResponse, QueryGetProtoRevMaxPoolPointsPerBlockRequest, QueryGetProtoRevMaxPoolPointsPerBlockResponse, QueryGetProtoRevBaseDenomsRequest, QueryGetProtoRevBaseDenomsResponse, QueryGetProtoRevEnabledRequest, QueryGetProtoRevEnabledResponse, QueryGetProtoRevPoolRequest, QueryGetProtoRevPoolResponse, QueryGetAllProtocolRevenueRequest, QueryGetAllProtocolRevenueResponse } from "./query"; /** Query defines the gRPC querier service. */ export interface Query { /** Params queries the parameters of the module. */ @@ -38,10 +38,10 @@ export interface Query { /** GetProtoRevDeveloperAccount queries the developer account of the module */ getProtoRevDeveloperAccount(request?: QueryGetProtoRevDeveloperAccountRequest): Promise; /** - * GetProtoRevPoolWeights queries the weights of each pool type currently - * being used by the module + * GetProtoRevInfoByPoolType queries pool type information that is currently + * being utilized by the module */ - getProtoRevPoolWeights(request?: QueryGetProtoRevPoolWeightsRequest): Promise; + getProtoRevInfoByPoolType(request?: QueryGetProtoRevInfoByPoolTypeRequest): Promise; /** * GetProtoRevMaxPoolPointsPerTx queries the maximum number of pool points * that can be consumed per transaction @@ -64,6 +64,11 @@ export interface Query { * for arbitrage route building given a pair of denominations */ getProtoRevPool(request: QueryGetProtoRevPoolRequest): Promise; + /** + * GetAllProtocolRevenue queries all of the protocol revenue that has been + * accumulated by any module + */ + getAllProtocolRevenue(request?: QueryGetAllProtocolRevenueRequest): Promise; } export class QueryClientImpl implements Query { private readonly rpc: Rpc; @@ -78,12 +83,13 @@ export class QueryClientImpl implements Query { this.getProtoRevTokenPairArbRoutes = this.getProtoRevTokenPairArbRoutes.bind(this); this.getProtoRevAdminAccount = this.getProtoRevAdminAccount.bind(this); this.getProtoRevDeveloperAccount = this.getProtoRevDeveloperAccount.bind(this); - this.getProtoRevPoolWeights = this.getProtoRevPoolWeights.bind(this); + this.getProtoRevInfoByPoolType = this.getProtoRevInfoByPoolType.bind(this); this.getProtoRevMaxPoolPointsPerTx = this.getProtoRevMaxPoolPointsPerTx.bind(this); this.getProtoRevMaxPoolPointsPerBlock = this.getProtoRevMaxPoolPointsPerBlock.bind(this); this.getProtoRevBaseDenoms = this.getProtoRevBaseDenoms.bind(this); this.getProtoRevEnabled = this.getProtoRevEnabled.bind(this); this.getProtoRevPool = this.getProtoRevPool.bind(this); + this.getAllProtocolRevenue = this.getAllProtocolRevenue.bind(this); } params(request: QueryParamsRequest = {}): Promise { const data = QueryParamsRequest.encode(request).finish(); @@ -130,10 +136,10 @@ export class QueryClientImpl implements Query { const promise = this.rpc.request("osmosis.protorev.v1beta1.Query", "GetProtoRevDeveloperAccount", data); return promise.then(data => QueryGetProtoRevDeveloperAccountResponse.decode(new BinaryReader(data))); } - getProtoRevPoolWeights(request: QueryGetProtoRevPoolWeightsRequest = {}): Promise { - const data = QueryGetProtoRevPoolWeightsRequest.encode(request).finish(); - const promise = this.rpc.request("osmosis.protorev.v1beta1.Query", "GetProtoRevPoolWeights", data); - return promise.then(data => QueryGetProtoRevPoolWeightsResponse.decode(new BinaryReader(data))); + getProtoRevInfoByPoolType(request: QueryGetProtoRevInfoByPoolTypeRequest = {}): Promise { + const data = QueryGetProtoRevInfoByPoolTypeRequest.encode(request).finish(); + const promise = this.rpc.request("osmosis.protorev.v1beta1.Query", "GetProtoRevInfoByPoolType", data); + return promise.then(data => QueryGetProtoRevInfoByPoolTypeResponse.decode(new BinaryReader(data))); } getProtoRevMaxPoolPointsPerTx(request: QueryGetProtoRevMaxPoolPointsPerTxRequest = {}): Promise { const data = QueryGetProtoRevMaxPoolPointsPerTxRequest.encode(request).finish(); @@ -160,6 +166,11 @@ export class QueryClientImpl implements Query { const promise = this.rpc.request("osmosis.protorev.v1beta1.Query", "GetProtoRevPool", data); return promise.then(data => QueryGetProtoRevPoolResponse.decode(new BinaryReader(data))); } + getAllProtocolRevenue(request: QueryGetAllProtocolRevenueRequest = {}): Promise { + const data = QueryGetAllProtocolRevenueRequest.encode(request).finish(); + const promise = this.rpc.request("osmosis.protorev.v1beta1.Query", "GetAllProtocolRevenue", data); + return promise.then(data => QueryGetAllProtocolRevenueResponse.decode(new BinaryReader(data))); + } } export const createRpcQueryExtension = (base: QueryClient) => { const rpc = createProtobufRpcClient(base); @@ -192,8 +203,8 @@ export const createRpcQueryExtension = (base: QueryClient) => { getProtoRevDeveloperAccount(request?: QueryGetProtoRevDeveloperAccountRequest): Promise { return queryService.getProtoRevDeveloperAccount(request); }, - getProtoRevPoolWeights(request?: QueryGetProtoRevPoolWeightsRequest): Promise { - return queryService.getProtoRevPoolWeights(request); + getProtoRevInfoByPoolType(request?: QueryGetProtoRevInfoByPoolTypeRequest): Promise { + return queryService.getProtoRevInfoByPoolType(request); }, getProtoRevMaxPoolPointsPerTx(request?: QueryGetProtoRevMaxPoolPointsPerTxRequest): Promise { return queryService.getProtoRevMaxPoolPointsPerTx(request); @@ -209,6 +220,9 @@ export const createRpcQueryExtension = (base: QueryClient) => { }, getProtoRevPool(request: QueryGetProtoRevPoolRequest): Promise { return queryService.getProtoRevPool(request); + }, + getAllProtocolRevenue(request?: QueryGetAllProtocolRevenueRequest): Promise { + return queryService.getAllProtocolRevenue(request); } }; }; @@ -239,8 +253,8 @@ export interface UseGetProtoRevAdminAccountQuery extends ReactQueryParams export interface UseGetProtoRevDeveloperAccountQuery extends ReactQueryParams { request?: QueryGetProtoRevDeveloperAccountRequest; } -export interface UseGetProtoRevPoolWeightsQuery extends ReactQueryParams { - request?: QueryGetProtoRevPoolWeightsRequest; +export interface UseGetProtoRevInfoByPoolTypeQuery extends ReactQueryParams { + request?: QueryGetProtoRevInfoByPoolTypeRequest; } export interface UseGetProtoRevMaxPoolPointsPerTxQuery extends ReactQueryParams { request?: QueryGetProtoRevMaxPoolPointsPerTxRequest; @@ -257,6 +271,9 @@ export interface UseGetProtoRevEnabledQuery extends ReactQueryParams extends ReactQueryParams { request: QueryGetProtoRevPoolRequest; } +export interface UseGetAllProtocolRevenueQuery extends ReactQueryParams { + request?: QueryGetAllProtocolRevenueRequest; +} const _queryClients: WeakMap = new WeakMap(); const getQueryService = (rpc: ProtobufRpcClient | undefined): QueryClientImpl | undefined => { if (!rpc) return; @@ -350,13 +367,13 @@ export const createRpcQueryHooks = (rpc: ProtobufRpcClient | undefined) => { return queryService.getProtoRevDeveloperAccount(request); }, options); }; - const useGetProtoRevPoolWeights = ({ + const useGetProtoRevInfoByPoolType = ({ request, options - }: UseGetProtoRevPoolWeightsQuery) => { - return useQuery(["getProtoRevPoolWeightsQuery", request], () => { + }: UseGetProtoRevInfoByPoolTypeQuery) => { + return useQuery(["getProtoRevInfoByPoolTypeQuery", request], () => { if (!queryService) throw new Error("Query Service not initialized"); - return queryService.getProtoRevPoolWeights(request); + return queryService.getProtoRevInfoByPoolType(request); }, options); }; const useGetProtoRevMaxPoolPointsPerTx = ({ @@ -404,6 +421,15 @@ export const createRpcQueryHooks = (rpc: ProtobufRpcClient | undefined) => { return queryService.getProtoRevPool(request); }, options); }; + const useGetAllProtocolRevenue = ({ + request, + options + }: UseGetAllProtocolRevenueQuery) => { + return useQuery(["getAllProtocolRevenueQuery", request], () => { + if (!queryService) throw new Error("Query Service not initialized"); + return queryService.getAllProtocolRevenue(request); + }, options); + }; return { /** Params queries the parameters of the module. */useParams, /** @@ -432,10 +458,10 @@ export const createRpcQueryHooks = (rpc: ProtobufRpcClient | undefined) => { /** GetProtoRevAdminAccount queries the admin account of the module */useGetProtoRevAdminAccount, /** GetProtoRevDeveloperAccount queries the developer account of the module */useGetProtoRevDeveloperAccount, /** - * GetProtoRevPoolWeights queries the weights of each pool type currently - * being used by the module + * GetProtoRevInfoByPoolType queries pool type information that is currently + * being utilized by the module */ - useGetProtoRevPoolWeights, + useGetProtoRevInfoByPoolType, /** * GetProtoRevMaxPoolPointsPerTx queries the maximum number of pool points * that can be consumed per transaction @@ -456,6 +482,11 @@ export const createRpcQueryHooks = (rpc: ProtobufRpcClient | undefined) => { * GetProtoRevPool queries the pool id used via the highest liquidity method * for arbitrage route building given a pair of denominations */ - useGetProtoRevPool + useGetProtoRevPool, + /** + * GetAllProtocolRevenue queries all of the protocol revenue that has been + * accumulated by any module + */ + useGetAllProtocolRevenue }; }; \ No newline at end of file diff --git a/packages/osmo-query/src/codegen/osmosis/protorev/v1beta1/query.ts b/packages/osmo-query/src/codegen/osmosis/protorev/v1beta1/query.ts index 7a15517b9..7a38a3e7d 100644 --- a/packages/osmo-query/src/codegen/osmosis/protorev/v1beta1/query.ts +++ b/packages/osmo-query/src/codegen/osmosis/protorev/v1beta1/query.ts @@ -1,6 +1,6 @@ import { Params, ParamsAmino, ParamsSDKType } from "./params"; import { Coin, CoinAmino, CoinSDKType } from "../../../cosmos/base/v1beta1/coin"; -import { RouteStatistics, RouteStatisticsAmino, RouteStatisticsSDKType, TokenPairArbRoutes, TokenPairArbRoutesAmino, TokenPairArbRoutesSDKType, PoolWeights, PoolWeightsAmino, PoolWeightsSDKType, BaseDenom, BaseDenomAmino, BaseDenomSDKType } from "./protorev"; +import { RouteStatistics, RouteStatisticsAmino, RouteStatisticsSDKType, TokenPairArbRoutes, TokenPairArbRoutesAmino, TokenPairArbRoutesSDKType, InfoByPoolType, InfoByPoolTypeAmino, InfoByPoolTypeSDKType, BaseDenom, BaseDenomAmino, BaseDenomSDKType, AllProtocolRevenue, AllProtocolRevenueAmino, AllProtocolRevenueSDKType } from "./protorev"; import { BinaryReader, BinaryWriter } from "../../../binary"; /** QueryParamsRequest is request type for the Query/Params RPC method. */ export interface QueryParamsRequest {} @@ -79,7 +79,7 @@ export interface QueryGetProtoRevNumberOfTradesResponseProtoMsg { */ export interface QueryGetProtoRevNumberOfTradesResponseAmino { /** number_of_trades is the number of trades the module has executed */ - number_of_trades: string; + number_of_trades?: string; } export interface QueryGetProtoRevNumberOfTradesResponseAminoMsg { type: "osmosis/protorev/query-get-proto-rev-number-of-trades-response"; @@ -110,7 +110,7 @@ export interface QueryGetProtoRevProfitsByDenomRequestProtoMsg { */ export interface QueryGetProtoRevProfitsByDenomRequestAmino { /** denom is the denom to query profits by */ - denom: string; + denom?: string; } export interface QueryGetProtoRevProfitsByDenomRequestAminoMsg { type: "osmosis/protorev/query-get-proto-rev-profits-by-denom-request"; @@ -129,7 +129,7 @@ export interface QueryGetProtoRevProfitsByDenomRequestSDKType { */ export interface QueryGetProtoRevProfitsByDenomResponse { /** profit is the profits of the module by the selected denom */ - profit: Coin; + profit?: Coin; } export interface QueryGetProtoRevProfitsByDenomResponseProtoMsg { typeUrl: "/osmosis.protorev.v1beta1.QueryGetProtoRevProfitsByDenomResponse"; @@ -152,7 +152,7 @@ export interface QueryGetProtoRevProfitsByDenomResponseAminoMsg { * Query/GetProtoRevProfitsByDenom RPC method. */ export interface QueryGetProtoRevProfitsByDenomResponseSDKType { - profit: CoinSDKType; + profit?: CoinSDKType; } /** * QueryGetProtoRevAllProfitsRequest is request type for the @@ -195,7 +195,7 @@ export interface QueryGetProtoRevAllProfitsResponseProtoMsg { */ export interface QueryGetProtoRevAllProfitsResponseAmino { /** profits is a list of all of the profits from the module */ - profits: CoinAmino[]; + profits?: CoinAmino[]; } export interface QueryGetProtoRevAllProfitsResponseAminoMsg { type: "osmosis/protorev/query-get-proto-rev-all-profits-response"; @@ -226,7 +226,7 @@ export interface QueryGetProtoRevStatisticsByRouteRequestProtoMsg { */ export interface QueryGetProtoRevStatisticsByRouteRequestAmino { /** route is the set of pool ids to query statistics by i.e. 1,2,3 */ - route: string[]; + route?: string[]; } export interface QueryGetProtoRevStatisticsByRouteRequestAminoMsg { type: "osmosis/protorev/query-get-proto-rev-statistics-by-route-request"; @@ -323,7 +323,7 @@ export interface QueryGetProtoRevAllRouteStatisticsResponseAmino { * statistics contains the number of trades/profits the module has executed on * all routes it has successfully executed a trade on */ - statistics: RouteStatisticsAmino[]; + statistics?: RouteStatisticsAmino[]; } export interface QueryGetProtoRevAllRouteStatisticsResponseAminoMsg { type: "osmosis/protorev/query-get-proto-rev-all-route-statistics-response"; @@ -383,7 +383,7 @@ export interface QueryGetProtoRevTokenPairArbRoutesResponseAmino { * routes is a list of all of the hot routes that the module is currently * arbitraging */ - routes: TokenPairArbRoutesAmino[]; + routes?: TokenPairArbRoutesAmino[]; } export interface QueryGetProtoRevTokenPairArbRoutesResponseAminoMsg { type: "osmosis/protorev/query-get-proto-rev-token-pair-arb-routes-response"; @@ -437,7 +437,7 @@ export interface QueryGetProtoRevAdminAccountResponseProtoMsg { */ export interface QueryGetProtoRevAdminAccountResponseAmino { /** admin_account is the admin account of the module */ - admin_account: string; + admin_account?: string; } export interface QueryGetProtoRevAdminAccountResponseAminoMsg { type: "osmosis/protorev/query-get-proto-rev-admin-account-response"; @@ -491,7 +491,7 @@ export interface QueryGetProtoRevDeveloperAccountResponseProtoMsg { */ export interface QueryGetProtoRevDeveloperAccountResponseAmino { /** developer_account is the developer account of the module */ - developer_account: string; + developer_account?: string; } export interface QueryGetProtoRevDeveloperAccountResponseAminoMsg { type: "osmosis/protorev/query-get-proto-rev-developer-account-response"; @@ -505,58 +505,64 @@ export interface QueryGetProtoRevDeveloperAccountResponseSDKType { developer_account: string; } /** - * QueryGetProtoRevPoolWeightsRequest is request type for the - * Query/GetProtoRevPoolWeights RPC method. + * QueryGetProtoRevInfoByPoolTypeRequest is request type for the + * Query/GetProtoRevInfoByPoolType RPC method. */ -export interface QueryGetProtoRevPoolWeightsRequest {} -export interface QueryGetProtoRevPoolWeightsRequestProtoMsg { - typeUrl: "/osmosis.protorev.v1beta1.QueryGetProtoRevPoolWeightsRequest"; +export interface QueryGetProtoRevInfoByPoolTypeRequest {} +export interface QueryGetProtoRevInfoByPoolTypeRequestProtoMsg { + typeUrl: "/osmosis.protorev.v1beta1.QueryGetProtoRevInfoByPoolTypeRequest"; value: Uint8Array; } /** - * QueryGetProtoRevPoolWeightsRequest is request type for the - * Query/GetProtoRevPoolWeights RPC method. + * QueryGetProtoRevInfoByPoolTypeRequest is request type for the + * Query/GetProtoRevInfoByPoolType RPC method. */ -export interface QueryGetProtoRevPoolWeightsRequestAmino {} -export interface QueryGetProtoRevPoolWeightsRequestAminoMsg { - type: "osmosis/protorev/query-get-proto-rev-pool-weights-request"; - value: QueryGetProtoRevPoolWeightsRequestAmino; +export interface QueryGetProtoRevInfoByPoolTypeRequestAmino {} +export interface QueryGetProtoRevInfoByPoolTypeRequestAminoMsg { + type: "osmosis/protorev/query-get-proto-rev-info-by-pool-type-request"; + value: QueryGetProtoRevInfoByPoolTypeRequestAmino; } /** - * QueryGetProtoRevPoolWeightsRequest is request type for the - * Query/GetProtoRevPoolWeights RPC method. + * QueryGetProtoRevInfoByPoolTypeRequest is request type for the + * Query/GetProtoRevInfoByPoolType RPC method. */ -export interface QueryGetProtoRevPoolWeightsRequestSDKType {} +export interface QueryGetProtoRevInfoByPoolTypeRequestSDKType {} /** - * QueryGetProtoRevPoolWeightsResponse is response type for the - * Query/GetProtoRevPoolWeights RPC method. + * QueryGetProtoRevInfoByPoolTypeResponse is response type for the + * Query/GetProtoRevInfoByPoolType RPC method. */ -export interface QueryGetProtoRevPoolWeightsResponse { - /** pool_weights is a list of all of the pool weights */ - poolWeights: PoolWeights; +export interface QueryGetProtoRevInfoByPoolTypeResponse { + /** + * InfoByPoolType contains all information pertaining to how different + * pool types are handled by the module. + */ + infoByPoolType: InfoByPoolType; } -export interface QueryGetProtoRevPoolWeightsResponseProtoMsg { - typeUrl: "/osmosis.protorev.v1beta1.QueryGetProtoRevPoolWeightsResponse"; +export interface QueryGetProtoRevInfoByPoolTypeResponseProtoMsg { + typeUrl: "/osmosis.protorev.v1beta1.QueryGetProtoRevInfoByPoolTypeResponse"; value: Uint8Array; } /** - * QueryGetProtoRevPoolWeightsResponse is response type for the - * Query/GetProtoRevPoolWeights RPC method. + * QueryGetProtoRevInfoByPoolTypeResponse is response type for the + * Query/GetProtoRevInfoByPoolType RPC method. */ -export interface QueryGetProtoRevPoolWeightsResponseAmino { - /** pool_weights is a list of all of the pool weights */ - pool_weights?: PoolWeightsAmino; +export interface QueryGetProtoRevInfoByPoolTypeResponseAmino { + /** + * InfoByPoolType contains all information pertaining to how different + * pool types are handled by the module. + */ + info_by_pool_type?: InfoByPoolTypeAmino; } -export interface QueryGetProtoRevPoolWeightsResponseAminoMsg { - type: "osmosis/protorev/query-get-proto-rev-pool-weights-response"; - value: QueryGetProtoRevPoolWeightsResponseAmino; +export interface QueryGetProtoRevInfoByPoolTypeResponseAminoMsg { + type: "osmosis/protorev/query-get-proto-rev-info-by-pool-type-response"; + value: QueryGetProtoRevInfoByPoolTypeResponseAmino; } /** - * QueryGetProtoRevPoolWeightsResponse is response type for the - * Query/GetProtoRevPoolWeights RPC method. + * QueryGetProtoRevInfoByPoolTypeResponse is response type for the + * Query/GetProtoRevInfoByPoolType RPC method. */ -export interface QueryGetProtoRevPoolWeightsResponseSDKType { - pool_weights: PoolWeightsSDKType; +export interface QueryGetProtoRevInfoByPoolTypeResponseSDKType { + info_by_pool_type: InfoByPoolTypeSDKType; } /** * QueryGetProtoRevMaxPoolPointsPerBlockRequest is request type for the @@ -605,7 +611,7 @@ export interface QueryGetProtoRevMaxPoolPointsPerBlockResponseAmino { * max_pool_points_per_block is the maximum number of pool points that can be * consumed per block */ - max_pool_points_per_block: string; + max_pool_points_per_block?: string; } export interface QueryGetProtoRevMaxPoolPointsPerBlockResponseAminoMsg { type: "osmosis/protorev/query-get-proto-rev-max-pool-points-per-block-response"; @@ -665,7 +671,7 @@ export interface QueryGetProtoRevMaxPoolPointsPerTxResponseAmino { * max_pool_points_per_tx is the maximum number of pool points that can be * consumed per transaction */ - max_pool_points_per_tx: string; + max_pool_points_per_tx?: string; } export interface QueryGetProtoRevMaxPoolPointsPerTxResponseAminoMsg { type: "osmosis/protorev/query-get-proto-rev-max-pool-points-per-tx-response"; @@ -719,7 +725,7 @@ export interface QueryGetProtoRevBaseDenomsResponseProtoMsg { */ export interface QueryGetProtoRevBaseDenomsResponseAmino { /** base_denoms is a list of all of the base denoms and step sizes */ - base_denoms: BaseDenomAmino[]; + base_denoms?: BaseDenomAmino[]; } export interface QueryGetProtoRevBaseDenomsResponseAminoMsg { type: "osmosis/protorev/query-get-proto-rev-base-denoms-response"; @@ -773,7 +779,7 @@ export interface QueryGetProtoRevEnabledResponseProtoMsg { */ export interface QueryGetProtoRevEnabledResponseAmino { /** enabled is whether the module is enabled */ - enabled: boolean; + enabled?: boolean; } export interface QueryGetProtoRevEnabledResponseAminoMsg { type: "osmosis/protorev/query-get-proto-rev-enabled-response"; @@ -812,9 +818,9 @@ export interface QueryGetProtoRevPoolRequestAmino { * base_denom is the base denom set in protorev for the denom pair to pool * mapping */ - base_denom: string; + base_denom?: string; /** other_denom is the other denom for the denom pair to pool mapping */ - other_denom: string; + other_denom?: string; } export interface QueryGetProtoRevPoolRequestAminoMsg { type: "osmosis/protorev/query-get-proto-rev-pool-request"; @@ -846,7 +852,7 @@ export interface QueryGetProtoRevPoolResponseProtoMsg { */ export interface QueryGetProtoRevPoolResponseAmino { /** pool_id is the pool_id stored for the denom pair */ - pool_id: string; + pool_id?: string; } export interface QueryGetProtoRevPoolResponseAminoMsg { type: "osmosis/protorev/query-get-proto-rev-pool-response"; @@ -859,6 +865,34 @@ export interface QueryGetProtoRevPoolResponseAminoMsg { export interface QueryGetProtoRevPoolResponseSDKType { pool_id: bigint; } +export interface QueryGetAllProtocolRevenueRequest {} +export interface QueryGetAllProtocolRevenueRequestProtoMsg { + typeUrl: "/osmosis.protorev.v1beta1.QueryGetAllProtocolRevenueRequest"; + value: Uint8Array; +} +export interface QueryGetAllProtocolRevenueRequestAmino {} +export interface QueryGetAllProtocolRevenueRequestAminoMsg { + type: "osmosis/protorev/query-get-all-protocol-revenue-request"; + value: QueryGetAllProtocolRevenueRequestAmino; +} +export interface QueryGetAllProtocolRevenueRequestSDKType {} +export interface QueryGetAllProtocolRevenueResponse { + allProtocolRevenue: AllProtocolRevenue; +} +export interface QueryGetAllProtocolRevenueResponseProtoMsg { + typeUrl: "/osmosis.protorev.v1beta1.QueryGetAllProtocolRevenueResponse"; + value: Uint8Array; +} +export interface QueryGetAllProtocolRevenueResponseAmino { + all_protocol_revenue?: AllProtocolRevenueAmino; +} +export interface QueryGetAllProtocolRevenueResponseAminoMsg { + type: "osmosis/protorev/query-get-all-protocol-revenue-response"; + value: QueryGetAllProtocolRevenueResponseAmino; +} +export interface QueryGetAllProtocolRevenueResponseSDKType { + all_protocol_revenue: AllProtocolRevenueSDKType; +} function createBaseQueryParamsRequest(): QueryParamsRequest { return {}; } @@ -886,7 +920,8 @@ export const QueryParamsRequest = { return message; }, fromAmino(_: QueryParamsRequestAmino): QueryParamsRequest { - return {}; + const message = createBaseQueryParamsRequest(); + return message; }, toAmino(_: QueryParamsRequest): QueryParamsRequestAmino { const obj: any = {}; @@ -950,9 +985,11 @@ export const QueryParamsResponse = { return message; }, fromAmino(object: QueryParamsResponseAmino): QueryParamsResponse { - return { - params: object?.params ? Params.fromAmino(object.params) : undefined - }; + const message = createBaseQueryParamsResponse(); + if (object.params !== undefined && object.params !== null) { + message.params = Params.fromAmino(object.params); + } + return message; }, toAmino(message: QueryParamsResponse): QueryParamsResponseAmino { const obj: any = {}; @@ -1008,7 +1045,8 @@ export const QueryGetProtoRevNumberOfTradesRequest = { return message; }, fromAmino(_: QueryGetProtoRevNumberOfTradesRequestAmino): QueryGetProtoRevNumberOfTradesRequest { - return {}; + const message = createBaseQueryGetProtoRevNumberOfTradesRequest(); + return message; }, toAmino(_: QueryGetProtoRevNumberOfTradesRequest): QueryGetProtoRevNumberOfTradesRequestAmino { const obj: any = {}; @@ -1072,9 +1110,11 @@ export const QueryGetProtoRevNumberOfTradesResponse = { return message; }, fromAmino(object: QueryGetProtoRevNumberOfTradesResponseAmino): QueryGetProtoRevNumberOfTradesResponse { - return { - numberOfTrades: object.number_of_trades - }; + const message = createBaseQueryGetProtoRevNumberOfTradesResponse(); + if (object.number_of_trades !== undefined && object.number_of_trades !== null) { + message.numberOfTrades = object.number_of_trades; + } + return message; }, toAmino(message: QueryGetProtoRevNumberOfTradesResponse): QueryGetProtoRevNumberOfTradesResponseAmino { const obj: any = {}; @@ -1139,9 +1179,11 @@ export const QueryGetProtoRevProfitsByDenomRequest = { return message; }, fromAmino(object: QueryGetProtoRevProfitsByDenomRequestAmino): QueryGetProtoRevProfitsByDenomRequest { - return { - denom: object.denom - }; + const message = createBaseQueryGetProtoRevProfitsByDenomRequest(); + if (object.denom !== undefined && object.denom !== null) { + message.denom = object.denom; + } + return message; }, toAmino(message: QueryGetProtoRevProfitsByDenomRequest): QueryGetProtoRevProfitsByDenomRequestAmino { const obj: any = {}; @@ -1172,7 +1214,7 @@ export const QueryGetProtoRevProfitsByDenomRequest = { }; function createBaseQueryGetProtoRevProfitsByDenomResponse(): QueryGetProtoRevProfitsByDenomResponse { return { - profit: Coin.fromPartial({}) + profit: undefined }; } export const QueryGetProtoRevProfitsByDenomResponse = { @@ -1206,9 +1248,11 @@ export const QueryGetProtoRevProfitsByDenomResponse = { return message; }, fromAmino(object: QueryGetProtoRevProfitsByDenomResponseAmino): QueryGetProtoRevProfitsByDenomResponse { - return { - profit: object?.profit ? Coin.fromAmino(object.profit) : undefined - }; + const message = createBaseQueryGetProtoRevProfitsByDenomResponse(); + if (object.profit !== undefined && object.profit !== null) { + message.profit = Coin.fromAmino(object.profit); + } + return message; }, toAmino(message: QueryGetProtoRevProfitsByDenomResponse): QueryGetProtoRevProfitsByDenomResponseAmino { const obj: any = {}; @@ -1264,7 +1308,8 @@ export const QueryGetProtoRevAllProfitsRequest = { return message; }, fromAmino(_: QueryGetProtoRevAllProfitsRequestAmino): QueryGetProtoRevAllProfitsRequest { - return {}; + const message = createBaseQueryGetProtoRevAllProfitsRequest(); + return message; }, toAmino(_: QueryGetProtoRevAllProfitsRequest): QueryGetProtoRevAllProfitsRequestAmino { const obj: any = {}; @@ -1328,9 +1373,9 @@ export const QueryGetProtoRevAllProfitsResponse = { return message; }, fromAmino(object: QueryGetProtoRevAllProfitsResponseAmino): QueryGetProtoRevAllProfitsResponse { - return { - profits: Array.isArray(object?.profits) ? object.profits.map((e: any) => Coin.fromAmino(e)) : [] - }; + const message = createBaseQueryGetProtoRevAllProfitsResponse(); + message.profits = object.profits?.map(e => Coin.fromAmino(e)) || []; + return message; }, toAmino(message: QueryGetProtoRevAllProfitsResponse): QueryGetProtoRevAllProfitsResponseAmino { const obj: any = {}; @@ -1408,9 +1453,9 @@ export const QueryGetProtoRevStatisticsByRouteRequest = { return message; }, fromAmino(object: QueryGetProtoRevStatisticsByRouteRequestAmino): QueryGetProtoRevStatisticsByRouteRequest { - return { - route: Array.isArray(object?.route) ? object.route.map((e: any) => BigInt(e)) : [] - }; + const message = createBaseQueryGetProtoRevStatisticsByRouteRequest(); + message.route = object.route?.map(e => BigInt(e)) || []; + return message; }, toAmino(message: QueryGetProtoRevStatisticsByRouteRequest): QueryGetProtoRevStatisticsByRouteRequestAmino { const obj: any = {}; @@ -1479,9 +1524,11 @@ export const QueryGetProtoRevStatisticsByRouteResponse = { return message; }, fromAmino(object: QueryGetProtoRevStatisticsByRouteResponseAmino): QueryGetProtoRevStatisticsByRouteResponse { - return { - statistics: object?.statistics ? RouteStatistics.fromAmino(object.statistics) : undefined - }; + const message = createBaseQueryGetProtoRevStatisticsByRouteResponse(); + if (object.statistics !== undefined && object.statistics !== null) { + message.statistics = RouteStatistics.fromAmino(object.statistics); + } + return message; }, toAmino(message: QueryGetProtoRevStatisticsByRouteResponse): QueryGetProtoRevStatisticsByRouteResponseAmino { const obj: any = {}; @@ -1537,7 +1584,8 @@ export const QueryGetProtoRevAllRouteStatisticsRequest = { return message; }, fromAmino(_: QueryGetProtoRevAllRouteStatisticsRequestAmino): QueryGetProtoRevAllRouteStatisticsRequest { - return {}; + const message = createBaseQueryGetProtoRevAllRouteStatisticsRequest(); + return message; }, toAmino(_: QueryGetProtoRevAllRouteStatisticsRequest): QueryGetProtoRevAllRouteStatisticsRequestAmino { const obj: any = {}; @@ -1601,9 +1649,9 @@ export const QueryGetProtoRevAllRouteStatisticsResponse = { return message; }, fromAmino(object: QueryGetProtoRevAllRouteStatisticsResponseAmino): QueryGetProtoRevAllRouteStatisticsResponse { - return { - statistics: Array.isArray(object?.statistics) ? object.statistics.map((e: any) => RouteStatistics.fromAmino(e)) : [] - }; + const message = createBaseQueryGetProtoRevAllRouteStatisticsResponse(); + message.statistics = object.statistics?.map(e => RouteStatistics.fromAmino(e)) || []; + return message; }, toAmino(message: QueryGetProtoRevAllRouteStatisticsResponse): QueryGetProtoRevAllRouteStatisticsResponseAmino { const obj: any = {}; @@ -1663,7 +1711,8 @@ export const QueryGetProtoRevTokenPairArbRoutesRequest = { return message; }, fromAmino(_: QueryGetProtoRevTokenPairArbRoutesRequestAmino): QueryGetProtoRevTokenPairArbRoutesRequest { - return {}; + const message = createBaseQueryGetProtoRevTokenPairArbRoutesRequest(); + return message; }, toAmino(_: QueryGetProtoRevTokenPairArbRoutesRequest): QueryGetProtoRevTokenPairArbRoutesRequestAmino { const obj: any = {}; @@ -1727,9 +1776,9 @@ export const QueryGetProtoRevTokenPairArbRoutesResponse = { return message; }, fromAmino(object: QueryGetProtoRevTokenPairArbRoutesResponseAmino): QueryGetProtoRevTokenPairArbRoutesResponse { - return { - routes: Array.isArray(object?.routes) ? object.routes.map((e: any) => TokenPairArbRoutes.fromAmino(e)) : [] - }; + const message = createBaseQueryGetProtoRevTokenPairArbRoutesResponse(); + message.routes = object.routes?.map(e => TokenPairArbRoutes.fromAmino(e)) || []; + return message; }, toAmino(message: QueryGetProtoRevTokenPairArbRoutesResponse): QueryGetProtoRevTokenPairArbRoutesResponseAmino { const obj: any = {}; @@ -1789,7 +1838,8 @@ export const QueryGetProtoRevAdminAccountRequest = { return message; }, fromAmino(_: QueryGetProtoRevAdminAccountRequestAmino): QueryGetProtoRevAdminAccountRequest { - return {}; + const message = createBaseQueryGetProtoRevAdminAccountRequest(); + return message; }, toAmino(_: QueryGetProtoRevAdminAccountRequest): QueryGetProtoRevAdminAccountRequestAmino { const obj: any = {}; @@ -1853,9 +1903,11 @@ export const QueryGetProtoRevAdminAccountResponse = { return message; }, fromAmino(object: QueryGetProtoRevAdminAccountResponseAmino): QueryGetProtoRevAdminAccountResponse { - return { - adminAccount: object.admin_account - }; + const message = createBaseQueryGetProtoRevAdminAccountResponse(); + if (object.admin_account !== undefined && object.admin_account !== null) { + message.adminAccount = object.admin_account; + } + return message; }, toAmino(message: QueryGetProtoRevAdminAccountResponse): QueryGetProtoRevAdminAccountResponseAmino { const obj: any = {}; @@ -1911,7 +1963,8 @@ export const QueryGetProtoRevDeveloperAccountRequest = { return message; }, fromAmino(_: QueryGetProtoRevDeveloperAccountRequestAmino): QueryGetProtoRevDeveloperAccountRequest { - return {}; + const message = createBaseQueryGetProtoRevDeveloperAccountRequest(); + return message; }, toAmino(_: QueryGetProtoRevDeveloperAccountRequest): QueryGetProtoRevDeveloperAccountRequestAmino { const obj: any = {}; @@ -1975,9 +2028,11 @@ export const QueryGetProtoRevDeveloperAccountResponse = { return message; }, fromAmino(object: QueryGetProtoRevDeveloperAccountResponseAmino): QueryGetProtoRevDeveloperAccountResponse { - return { - developerAccount: object.developer_account - }; + const message = createBaseQueryGetProtoRevDeveloperAccountResponse(); + if (object.developer_account !== undefined && object.developer_account !== null) { + message.developerAccount = object.developer_account; + } + return message; }, toAmino(message: QueryGetProtoRevDeveloperAccountResponse): QueryGetProtoRevDeveloperAccountResponseAmino { const obj: any = {}; @@ -2006,18 +2061,18 @@ export const QueryGetProtoRevDeveloperAccountResponse = { }; } }; -function createBaseQueryGetProtoRevPoolWeightsRequest(): QueryGetProtoRevPoolWeightsRequest { +function createBaseQueryGetProtoRevInfoByPoolTypeRequest(): QueryGetProtoRevInfoByPoolTypeRequest { return {}; } -export const QueryGetProtoRevPoolWeightsRequest = { - typeUrl: "/osmosis.protorev.v1beta1.QueryGetProtoRevPoolWeightsRequest", - encode(_: QueryGetProtoRevPoolWeightsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { +export const QueryGetProtoRevInfoByPoolTypeRequest = { + typeUrl: "/osmosis.protorev.v1beta1.QueryGetProtoRevInfoByPoolTypeRequest", + encode(_: QueryGetProtoRevInfoByPoolTypeRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, - decode(input: BinaryReader | Uint8Array, length?: number): QueryGetProtoRevPoolWeightsRequest { + decode(input: BinaryReader | Uint8Array, length?: number): QueryGetProtoRevInfoByPoolTypeRequest { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQueryGetProtoRevPoolWeightsRequest(); + const message = createBaseQueryGetProtoRevInfoByPoolTypeRequest(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -2028,61 +2083,62 @@ export const QueryGetProtoRevPoolWeightsRequest = { } return message; }, - fromPartial(_: Partial): QueryGetProtoRevPoolWeightsRequest { - const message = createBaseQueryGetProtoRevPoolWeightsRequest(); + fromPartial(_: Partial): QueryGetProtoRevInfoByPoolTypeRequest { + const message = createBaseQueryGetProtoRevInfoByPoolTypeRequest(); return message; }, - fromAmino(_: QueryGetProtoRevPoolWeightsRequestAmino): QueryGetProtoRevPoolWeightsRequest { - return {}; + fromAmino(_: QueryGetProtoRevInfoByPoolTypeRequestAmino): QueryGetProtoRevInfoByPoolTypeRequest { + const message = createBaseQueryGetProtoRevInfoByPoolTypeRequest(); + return message; }, - toAmino(_: QueryGetProtoRevPoolWeightsRequest): QueryGetProtoRevPoolWeightsRequestAmino { + toAmino(_: QueryGetProtoRevInfoByPoolTypeRequest): QueryGetProtoRevInfoByPoolTypeRequestAmino { const obj: any = {}; return obj; }, - fromAminoMsg(object: QueryGetProtoRevPoolWeightsRequestAminoMsg): QueryGetProtoRevPoolWeightsRequest { - return QueryGetProtoRevPoolWeightsRequest.fromAmino(object.value); + fromAminoMsg(object: QueryGetProtoRevInfoByPoolTypeRequestAminoMsg): QueryGetProtoRevInfoByPoolTypeRequest { + return QueryGetProtoRevInfoByPoolTypeRequest.fromAmino(object.value); }, - toAminoMsg(message: QueryGetProtoRevPoolWeightsRequest): QueryGetProtoRevPoolWeightsRequestAminoMsg { + toAminoMsg(message: QueryGetProtoRevInfoByPoolTypeRequest): QueryGetProtoRevInfoByPoolTypeRequestAminoMsg { return { - type: "osmosis/protorev/query-get-proto-rev-pool-weights-request", - value: QueryGetProtoRevPoolWeightsRequest.toAmino(message) + type: "osmosis/protorev/query-get-proto-rev-info-by-pool-type-request", + value: QueryGetProtoRevInfoByPoolTypeRequest.toAmino(message) }; }, - fromProtoMsg(message: QueryGetProtoRevPoolWeightsRequestProtoMsg): QueryGetProtoRevPoolWeightsRequest { - return QueryGetProtoRevPoolWeightsRequest.decode(message.value); + fromProtoMsg(message: QueryGetProtoRevInfoByPoolTypeRequestProtoMsg): QueryGetProtoRevInfoByPoolTypeRequest { + return QueryGetProtoRevInfoByPoolTypeRequest.decode(message.value); }, - toProto(message: QueryGetProtoRevPoolWeightsRequest): Uint8Array { - return QueryGetProtoRevPoolWeightsRequest.encode(message).finish(); + toProto(message: QueryGetProtoRevInfoByPoolTypeRequest): Uint8Array { + return QueryGetProtoRevInfoByPoolTypeRequest.encode(message).finish(); }, - toProtoMsg(message: QueryGetProtoRevPoolWeightsRequest): QueryGetProtoRevPoolWeightsRequestProtoMsg { + toProtoMsg(message: QueryGetProtoRevInfoByPoolTypeRequest): QueryGetProtoRevInfoByPoolTypeRequestProtoMsg { return { - typeUrl: "/osmosis.protorev.v1beta1.QueryGetProtoRevPoolWeightsRequest", - value: QueryGetProtoRevPoolWeightsRequest.encode(message).finish() + typeUrl: "/osmosis.protorev.v1beta1.QueryGetProtoRevInfoByPoolTypeRequest", + value: QueryGetProtoRevInfoByPoolTypeRequest.encode(message).finish() }; } }; -function createBaseQueryGetProtoRevPoolWeightsResponse(): QueryGetProtoRevPoolWeightsResponse { +function createBaseQueryGetProtoRevInfoByPoolTypeResponse(): QueryGetProtoRevInfoByPoolTypeResponse { return { - poolWeights: PoolWeights.fromPartial({}) + infoByPoolType: InfoByPoolType.fromPartial({}) }; } -export const QueryGetProtoRevPoolWeightsResponse = { - typeUrl: "/osmosis.protorev.v1beta1.QueryGetProtoRevPoolWeightsResponse", - encode(message: QueryGetProtoRevPoolWeightsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { - if (message.poolWeights !== undefined) { - PoolWeights.encode(message.poolWeights, writer.uint32(10).fork()).ldelim(); +export const QueryGetProtoRevInfoByPoolTypeResponse = { + typeUrl: "/osmosis.protorev.v1beta1.QueryGetProtoRevInfoByPoolTypeResponse", + encode(message: QueryGetProtoRevInfoByPoolTypeResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.infoByPoolType !== undefined) { + InfoByPoolType.encode(message.infoByPoolType, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: BinaryReader | Uint8Array, length?: number): QueryGetProtoRevPoolWeightsResponse { + decode(input: BinaryReader | Uint8Array, length?: number): QueryGetProtoRevInfoByPoolTypeResponse { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQueryGetProtoRevPoolWeightsResponse(); + const message = createBaseQueryGetProtoRevInfoByPoolTypeResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.poolWeights = PoolWeights.decode(reader, reader.uint32()); + message.infoByPoolType = InfoByPoolType.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -2091,40 +2147,42 @@ export const QueryGetProtoRevPoolWeightsResponse = { } return message; }, - fromPartial(object: Partial): QueryGetProtoRevPoolWeightsResponse { - const message = createBaseQueryGetProtoRevPoolWeightsResponse(); - message.poolWeights = object.poolWeights !== undefined && object.poolWeights !== null ? PoolWeights.fromPartial(object.poolWeights) : undefined; + fromPartial(object: Partial): QueryGetProtoRevInfoByPoolTypeResponse { + const message = createBaseQueryGetProtoRevInfoByPoolTypeResponse(); + message.infoByPoolType = object.infoByPoolType !== undefined && object.infoByPoolType !== null ? InfoByPoolType.fromPartial(object.infoByPoolType) : undefined; return message; }, - fromAmino(object: QueryGetProtoRevPoolWeightsResponseAmino): QueryGetProtoRevPoolWeightsResponse { - return { - poolWeights: object?.pool_weights ? PoolWeights.fromAmino(object.pool_weights) : undefined - }; + fromAmino(object: QueryGetProtoRevInfoByPoolTypeResponseAmino): QueryGetProtoRevInfoByPoolTypeResponse { + const message = createBaseQueryGetProtoRevInfoByPoolTypeResponse(); + if (object.info_by_pool_type !== undefined && object.info_by_pool_type !== null) { + message.infoByPoolType = InfoByPoolType.fromAmino(object.info_by_pool_type); + } + return message; }, - toAmino(message: QueryGetProtoRevPoolWeightsResponse): QueryGetProtoRevPoolWeightsResponseAmino { + toAmino(message: QueryGetProtoRevInfoByPoolTypeResponse): QueryGetProtoRevInfoByPoolTypeResponseAmino { const obj: any = {}; - obj.pool_weights = message.poolWeights ? PoolWeights.toAmino(message.poolWeights) : undefined; + obj.info_by_pool_type = message.infoByPoolType ? InfoByPoolType.toAmino(message.infoByPoolType) : undefined; return obj; }, - fromAminoMsg(object: QueryGetProtoRevPoolWeightsResponseAminoMsg): QueryGetProtoRevPoolWeightsResponse { - return QueryGetProtoRevPoolWeightsResponse.fromAmino(object.value); + fromAminoMsg(object: QueryGetProtoRevInfoByPoolTypeResponseAminoMsg): QueryGetProtoRevInfoByPoolTypeResponse { + return QueryGetProtoRevInfoByPoolTypeResponse.fromAmino(object.value); }, - toAminoMsg(message: QueryGetProtoRevPoolWeightsResponse): QueryGetProtoRevPoolWeightsResponseAminoMsg { + toAminoMsg(message: QueryGetProtoRevInfoByPoolTypeResponse): QueryGetProtoRevInfoByPoolTypeResponseAminoMsg { return { - type: "osmosis/protorev/query-get-proto-rev-pool-weights-response", - value: QueryGetProtoRevPoolWeightsResponse.toAmino(message) + type: "osmosis/protorev/query-get-proto-rev-info-by-pool-type-response", + value: QueryGetProtoRevInfoByPoolTypeResponse.toAmino(message) }; }, - fromProtoMsg(message: QueryGetProtoRevPoolWeightsResponseProtoMsg): QueryGetProtoRevPoolWeightsResponse { - return QueryGetProtoRevPoolWeightsResponse.decode(message.value); + fromProtoMsg(message: QueryGetProtoRevInfoByPoolTypeResponseProtoMsg): QueryGetProtoRevInfoByPoolTypeResponse { + return QueryGetProtoRevInfoByPoolTypeResponse.decode(message.value); }, - toProto(message: QueryGetProtoRevPoolWeightsResponse): Uint8Array { - return QueryGetProtoRevPoolWeightsResponse.encode(message).finish(); + toProto(message: QueryGetProtoRevInfoByPoolTypeResponse): Uint8Array { + return QueryGetProtoRevInfoByPoolTypeResponse.encode(message).finish(); }, - toProtoMsg(message: QueryGetProtoRevPoolWeightsResponse): QueryGetProtoRevPoolWeightsResponseProtoMsg { + toProtoMsg(message: QueryGetProtoRevInfoByPoolTypeResponse): QueryGetProtoRevInfoByPoolTypeResponseProtoMsg { return { - typeUrl: "/osmosis.protorev.v1beta1.QueryGetProtoRevPoolWeightsResponse", - value: QueryGetProtoRevPoolWeightsResponse.encode(message).finish() + typeUrl: "/osmosis.protorev.v1beta1.QueryGetProtoRevInfoByPoolTypeResponse", + value: QueryGetProtoRevInfoByPoolTypeResponse.encode(message).finish() }; } }; @@ -2155,7 +2213,8 @@ export const QueryGetProtoRevMaxPoolPointsPerBlockRequest = { return message; }, fromAmino(_: QueryGetProtoRevMaxPoolPointsPerBlockRequestAmino): QueryGetProtoRevMaxPoolPointsPerBlockRequest { - return {}; + const message = createBaseQueryGetProtoRevMaxPoolPointsPerBlockRequest(); + return message; }, toAmino(_: QueryGetProtoRevMaxPoolPointsPerBlockRequest): QueryGetProtoRevMaxPoolPointsPerBlockRequestAmino { const obj: any = {}; @@ -2219,9 +2278,11 @@ export const QueryGetProtoRevMaxPoolPointsPerBlockResponse = { return message; }, fromAmino(object: QueryGetProtoRevMaxPoolPointsPerBlockResponseAmino): QueryGetProtoRevMaxPoolPointsPerBlockResponse { - return { - maxPoolPointsPerBlock: BigInt(object.max_pool_points_per_block) - }; + const message = createBaseQueryGetProtoRevMaxPoolPointsPerBlockResponse(); + if (object.max_pool_points_per_block !== undefined && object.max_pool_points_per_block !== null) { + message.maxPoolPointsPerBlock = BigInt(object.max_pool_points_per_block); + } + return message; }, toAmino(message: QueryGetProtoRevMaxPoolPointsPerBlockResponse): QueryGetProtoRevMaxPoolPointsPerBlockResponseAmino { const obj: any = {}; @@ -2277,7 +2338,8 @@ export const QueryGetProtoRevMaxPoolPointsPerTxRequest = { return message; }, fromAmino(_: QueryGetProtoRevMaxPoolPointsPerTxRequestAmino): QueryGetProtoRevMaxPoolPointsPerTxRequest { - return {}; + const message = createBaseQueryGetProtoRevMaxPoolPointsPerTxRequest(); + return message; }, toAmino(_: QueryGetProtoRevMaxPoolPointsPerTxRequest): QueryGetProtoRevMaxPoolPointsPerTxRequestAmino { const obj: any = {}; @@ -2341,9 +2403,11 @@ export const QueryGetProtoRevMaxPoolPointsPerTxResponse = { return message; }, fromAmino(object: QueryGetProtoRevMaxPoolPointsPerTxResponseAmino): QueryGetProtoRevMaxPoolPointsPerTxResponse { - return { - maxPoolPointsPerTx: BigInt(object.max_pool_points_per_tx) - }; + const message = createBaseQueryGetProtoRevMaxPoolPointsPerTxResponse(); + if (object.max_pool_points_per_tx !== undefined && object.max_pool_points_per_tx !== null) { + message.maxPoolPointsPerTx = BigInt(object.max_pool_points_per_tx); + } + return message; }, toAmino(message: QueryGetProtoRevMaxPoolPointsPerTxResponse): QueryGetProtoRevMaxPoolPointsPerTxResponseAmino { const obj: any = {}; @@ -2399,7 +2463,8 @@ export const QueryGetProtoRevBaseDenomsRequest = { return message; }, fromAmino(_: QueryGetProtoRevBaseDenomsRequestAmino): QueryGetProtoRevBaseDenomsRequest { - return {}; + const message = createBaseQueryGetProtoRevBaseDenomsRequest(); + return message; }, toAmino(_: QueryGetProtoRevBaseDenomsRequest): QueryGetProtoRevBaseDenomsRequestAmino { const obj: any = {}; @@ -2463,9 +2528,9 @@ export const QueryGetProtoRevBaseDenomsResponse = { return message; }, fromAmino(object: QueryGetProtoRevBaseDenomsResponseAmino): QueryGetProtoRevBaseDenomsResponse { - return { - baseDenoms: Array.isArray(object?.base_denoms) ? object.base_denoms.map((e: any) => BaseDenom.fromAmino(e)) : [] - }; + const message = createBaseQueryGetProtoRevBaseDenomsResponse(); + message.baseDenoms = object.base_denoms?.map(e => BaseDenom.fromAmino(e)) || []; + return message; }, toAmino(message: QueryGetProtoRevBaseDenomsResponse): QueryGetProtoRevBaseDenomsResponseAmino { const obj: any = {}; @@ -2525,7 +2590,8 @@ export const QueryGetProtoRevEnabledRequest = { return message; }, fromAmino(_: QueryGetProtoRevEnabledRequestAmino): QueryGetProtoRevEnabledRequest { - return {}; + const message = createBaseQueryGetProtoRevEnabledRequest(); + return message; }, toAmino(_: QueryGetProtoRevEnabledRequest): QueryGetProtoRevEnabledRequestAmino { const obj: any = {}; @@ -2589,9 +2655,11 @@ export const QueryGetProtoRevEnabledResponse = { return message; }, fromAmino(object: QueryGetProtoRevEnabledResponseAmino): QueryGetProtoRevEnabledResponse { - return { - enabled: object.enabled - }; + const message = createBaseQueryGetProtoRevEnabledResponse(); + if (object.enabled !== undefined && object.enabled !== null) { + message.enabled = object.enabled; + } + return message; }, toAmino(message: QueryGetProtoRevEnabledResponse): QueryGetProtoRevEnabledResponseAmino { const obj: any = {}; @@ -2664,10 +2732,14 @@ export const QueryGetProtoRevPoolRequest = { return message; }, fromAmino(object: QueryGetProtoRevPoolRequestAmino): QueryGetProtoRevPoolRequest { - return { - baseDenom: object.base_denom, - otherDenom: object.other_denom - }; + const message = createBaseQueryGetProtoRevPoolRequest(); + if (object.base_denom !== undefined && object.base_denom !== null) { + message.baseDenom = object.base_denom; + } + if (object.other_denom !== undefined && object.other_denom !== null) { + message.otherDenom = object.other_denom; + } + return message; }, toAmino(message: QueryGetProtoRevPoolRequest): QueryGetProtoRevPoolRequestAmino { const obj: any = {}; @@ -2733,9 +2805,11 @@ export const QueryGetProtoRevPoolResponse = { return message; }, fromAmino(object: QueryGetProtoRevPoolResponseAmino): QueryGetProtoRevPoolResponse { - return { - poolId: BigInt(object.pool_id) - }; + const message = createBaseQueryGetProtoRevPoolResponse(); + if (object.pool_id !== undefined && object.pool_id !== null) { + message.poolId = BigInt(object.pool_id); + } + return message; }, toAmino(message: QueryGetProtoRevPoolResponse): QueryGetProtoRevPoolResponseAmino { const obj: any = {}; @@ -2763,4 +2837,129 @@ export const QueryGetProtoRevPoolResponse = { value: QueryGetProtoRevPoolResponse.encode(message).finish() }; } +}; +function createBaseQueryGetAllProtocolRevenueRequest(): QueryGetAllProtocolRevenueRequest { + return {}; +} +export const QueryGetAllProtocolRevenueRequest = { + typeUrl: "/osmosis.protorev.v1beta1.QueryGetAllProtocolRevenueRequest", + encode(_: QueryGetAllProtocolRevenueRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryGetAllProtocolRevenueRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryGetAllProtocolRevenueRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): QueryGetAllProtocolRevenueRequest { + const message = createBaseQueryGetAllProtocolRevenueRequest(); + return message; + }, + fromAmino(_: QueryGetAllProtocolRevenueRequestAmino): QueryGetAllProtocolRevenueRequest { + const message = createBaseQueryGetAllProtocolRevenueRequest(); + return message; + }, + toAmino(_: QueryGetAllProtocolRevenueRequest): QueryGetAllProtocolRevenueRequestAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: QueryGetAllProtocolRevenueRequestAminoMsg): QueryGetAllProtocolRevenueRequest { + return QueryGetAllProtocolRevenueRequest.fromAmino(object.value); + }, + toAminoMsg(message: QueryGetAllProtocolRevenueRequest): QueryGetAllProtocolRevenueRequestAminoMsg { + return { + type: "osmosis/protorev/query-get-all-protocol-revenue-request", + value: QueryGetAllProtocolRevenueRequest.toAmino(message) + }; + }, + fromProtoMsg(message: QueryGetAllProtocolRevenueRequestProtoMsg): QueryGetAllProtocolRevenueRequest { + return QueryGetAllProtocolRevenueRequest.decode(message.value); + }, + toProto(message: QueryGetAllProtocolRevenueRequest): Uint8Array { + return QueryGetAllProtocolRevenueRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryGetAllProtocolRevenueRequest): QueryGetAllProtocolRevenueRequestProtoMsg { + return { + typeUrl: "/osmosis.protorev.v1beta1.QueryGetAllProtocolRevenueRequest", + value: QueryGetAllProtocolRevenueRequest.encode(message).finish() + }; + } +}; +function createBaseQueryGetAllProtocolRevenueResponse(): QueryGetAllProtocolRevenueResponse { + return { + allProtocolRevenue: AllProtocolRevenue.fromPartial({}) + }; +} +export const QueryGetAllProtocolRevenueResponse = { + typeUrl: "/osmosis.protorev.v1beta1.QueryGetAllProtocolRevenueResponse", + encode(message: QueryGetAllProtocolRevenueResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.allProtocolRevenue !== undefined) { + AllProtocolRevenue.encode(message.allProtocolRevenue, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryGetAllProtocolRevenueResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryGetAllProtocolRevenueResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.allProtocolRevenue = AllProtocolRevenue.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryGetAllProtocolRevenueResponse { + const message = createBaseQueryGetAllProtocolRevenueResponse(); + message.allProtocolRevenue = object.allProtocolRevenue !== undefined && object.allProtocolRevenue !== null ? AllProtocolRevenue.fromPartial(object.allProtocolRevenue) : undefined; + return message; + }, + fromAmino(object: QueryGetAllProtocolRevenueResponseAmino): QueryGetAllProtocolRevenueResponse { + const message = createBaseQueryGetAllProtocolRevenueResponse(); + if (object.all_protocol_revenue !== undefined && object.all_protocol_revenue !== null) { + message.allProtocolRevenue = AllProtocolRevenue.fromAmino(object.all_protocol_revenue); + } + return message; + }, + toAmino(message: QueryGetAllProtocolRevenueResponse): QueryGetAllProtocolRevenueResponseAmino { + const obj: any = {}; + obj.all_protocol_revenue = message.allProtocolRevenue ? AllProtocolRevenue.toAmino(message.allProtocolRevenue) : undefined; + return obj; + }, + fromAminoMsg(object: QueryGetAllProtocolRevenueResponseAminoMsg): QueryGetAllProtocolRevenueResponse { + return QueryGetAllProtocolRevenueResponse.fromAmino(object.value); + }, + toAminoMsg(message: QueryGetAllProtocolRevenueResponse): QueryGetAllProtocolRevenueResponseAminoMsg { + return { + type: "osmosis/protorev/query-get-all-protocol-revenue-response", + value: QueryGetAllProtocolRevenueResponse.toAmino(message) + }; + }, + fromProtoMsg(message: QueryGetAllProtocolRevenueResponseProtoMsg): QueryGetAllProtocolRevenueResponse { + return QueryGetAllProtocolRevenueResponse.decode(message.value); + }, + toProto(message: QueryGetAllProtocolRevenueResponse): Uint8Array { + return QueryGetAllProtocolRevenueResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryGetAllProtocolRevenueResponse): QueryGetAllProtocolRevenueResponseProtoMsg { + return { + typeUrl: "/osmosis.protorev.v1beta1.QueryGetAllProtocolRevenueResponse", + value: QueryGetAllProtocolRevenueResponse.encode(message).finish() + }; + } }; \ No newline at end of file diff --git a/packages/osmo-query/src/codegen/osmosis/protorev/v1beta1/tx.amino.ts b/packages/osmo-query/src/codegen/osmosis/protorev/v1beta1/tx.amino.ts index 663139a35..7630b1658 100644 --- a/packages/osmo-query/src/codegen/osmosis/protorev/v1beta1/tx.amino.ts +++ b/packages/osmo-query/src/codegen/osmosis/protorev/v1beta1/tx.amino.ts @@ -1,5 +1,5 @@ //@ts-nocheck -import { MsgSetHotRoutes, MsgSetDeveloperAccount, MsgSetMaxPoolPointsPerTx, MsgSetMaxPoolPointsPerBlock, MsgSetPoolWeights, MsgSetBaseDenoms } from "./tx"; +import { MsgSetHotRoutes, MsgSetDeveloperAccount, MsgSetMaxPoolPointsPerTx, MsgSetMaxPoolPointsPerBlock, MsgSetInfoByPoolType, MsgSetBaseDenoms } from "./tx"; export const AminoConverter = { "/osmosis.protorev.v1beta1.MsgSetHotRoutes": { aminoType: "osmosis/MsgSetHotRoutes", @@ -12,22 +12,22 @@ export const AminoConverter = { fromAmino: MsgSetDeveloperAccount.fromAmino }, "/osmosis.protorev.v1beta1.MsgSetMaxPoolPointsPerTx": { - aminoType: "osmosis/protorev/set-max-pool-points-per-tx", + aminoType: "osmosis/MsgSetMaxPoolPointsPerTx", toAmino: MsgSetMaxPoolPointsPerTx.toAmino, fromAmino: MsgSetMaxPoolPointsPerTx.fromAmino }, "/osmosis.protorev.v1beta1.MsgSetMaxPoolPointsPerBlock": { - aminoType: "osmosis/protorev/set-max-pool-points-per-block", + aminoType: "osmosis/MsgSetPoolWeights", toAmino: MsgSetMaxPoolPointsPerBlock.toAmino, fromAmino: MsgSetMaxPoolPointsPerBlock.fromAmino }, - "/osmosis.protorev.v1beta1.MsgSetPoolWeights": { - aminoType: "osmosis/protorev/set-pool-weights", - toAmino: MsgSetPoolWeights.toAmino, - fromAmino: MsgSetPoolWeights.fromAmino + "/osmosis.protorev.v1beta1.MsgSetInfoByPoolType": { + aminoType: "osmosis/MsgSetInfoByPoolType", + toAmino: MsgSetInfoByPoolType.toAmino, + fromAmino: MsgSetInfoByPoolType.fromAmino }, "/osmosis.protorev.v1beta1.MsgSetBaseDenoms": { - aminoType: "osmosis/protorev/set-base-denoms", + aminoType: "osmosis/MsgSetBaseDenoms", toAmino: MsgSetBaseDenoms.toAmino, fromAmino: MsgSetBaseDenoms.fromAmino } diff --git a/packages/osmo-query/src/codegen/osmosis/protorev/v1beta1/tx.registry.ts b/packages/osmo-query/src/codegen/osmosis/protorev/v1beta1/tx.registry.ts index 7d2966ea5..f35bdd42a 100644 --- a/packages/osmo-query/src/codegen/osmosis/protorev/v1beta1/tx.registry.ts +++ b/packages/osmo-query/src/codegen/osmosis/protorev/v1beta1/tx.registry.ts @@ -1,7 +1,7 @@ //@ts-nocheck import { GeneratedType, Registry } from "@cosmjs/proto-signing"; -import { MsgSetHotRoutes, MsgSetDeveloperAccount, MsgSetMaxPoolPointsPerTx, MsgSetMaxPoolPointsPerBlock, MsgSetPoolWeights, MsgSetBaseDenoms } from "./tx"; -export const registry: ReadonlyArray<[string, GeneratedType]> = [["/osmosis.protorev.v1beta1.MsgSetHotRoutes", MsgSetHotRoutes], ["/osmosis.protorev.v1beta1.MsgSetDeveloperAccount", MsgSetDeveloperAccount], ["/osmosis.protorev.v1beta1.MsgSetMaxPoolPointsPerTx", MsgSetMaxPoolPointsPerTx], ["/osmosis.protorev.v1beta1.MsgSetMaxPoolPointsPerBlock", MsgSetMaxPoolPointsPerBlock], ["/osmosis.protorev.v1beta1.MsgSetPoolWeights", MsgSetPoolWeights], ["/osmosis.protorev.v1beta1.MsgSetBaseDenoms", MsgSetBaseDenoms]]; +import { MsgSetHotRoutes, MsgSetDeveloperAccount, MsgSetMaxPoolPointsPerTx, MsgSetMaxPoolPointsPerBlock, MsgSetInfoByPoolType, MsgSetBaseDenoms } from "./tx"; +export const registry: ReadonlyArray<[string, GeneratedType]> = [["/osmosis.protorev.v1beta1.MsgSetHotRoutes", MsgSetHotRoutes], ["/osmosis.protorev.v1beta1.MsgSetDeveloperAccount", MsgSetDeveloperAccount], ["/osmosis.protorev.v1beta1.MsgSetMaxPoolPointsPerTx", MsgSetMaxPoolPointsPerTx], ["/osmosis.protorev.v1beta1.MsgSetMaxPoolPointsPerBlock", MsgSetMaxPoolPointsPerBlock], ["/osmosis.protorev.v1beta1.MsgSetInfoByPoolType", MsgSetInfoByPoolType], ["/osmosis.protorev.v1beta1.MsgSetBaseDenoms", MsgSetBaseDenoms]]; export const load = (protoRegistry: Registry) => { registry.forEach(([typeUrl, mod]) => { protoRegistry.register(typeUrl, mod); @@ -33,10 +33,10 @@ export const MessageComposer = { value: MsgSetMaxPoolPointsPerBlock.encode(value).finish() }; }, - setPoolWeights(value: MsgSetPoolWeights) { + setInfoByPoolType(value: MsgSetInfoByPoolType) { return { - typeUrl: "/osmosis.protorev.v1beta1.MsgSetPoolWeights", - value: MsgSetPoolWeights.encode(value).finish() + typeUrl: "/osmosis.protorev.v1beta1.MsgSetInfoByPoolType", + value: MsgSetInfoByPoolType.encode(value).finish() }; }, setBaseDenoms(value: MsgSetBaseDenoms) { @@ -71,9 +71,9 @@ export const MessageComposer = { value }; }, - setPoolWeights(value: MsgSetPoolWeights) { + setInfoByPoolType(value: MsgSetInfoByPoolType) { return { - typeUrl: "/osmosis.protorev.v1beta1.MsgSetPoolWeights", + typeUrl: "/osmosis.protorev.v1beta1.MsgSetInfoByPoolType", value }; }, @@ -109,10 +109,10 @@ export const MessageComposer = { value: MsgSetMaxPoolPointsPerBlock.fromPartial(value) }; }, - setPoolWeights(value: MsgSetPoolWeights) { + setInfoByPoolType(value: MsgSetInfoByPoolType) { return { - typeUrl: "/osmosis.protorev.v1beta1.MsgSetPoolWeights", - value: MsgSetPoolWeights.fromPartial(value) + typeUrl: "/osmosis.protorev.v1beta1.MsgSetInfoByPoolType", + value: MsgSetInfoByPoolType.fromPartial(value) }; }, setBaseDenoms(value: MsgSetBaseDenoms) { diff --git a/packages/osmo-query/src/codegen/osmosis/protorev/v1beta1/tx.rpc.msg.ts b/packages/osmo-query/src/codegen/osmosis/protorev/v1beta1/tx.rpc.msg.ts index 2b1409f5e..9ab6fa67d 100644 --- a/packages/osmo-query/src/codegen/osmosis/protorev/v1beta1/tx.rpc.msg.ts +++ b/packages/osmo-query/src/codegen/osmosis/protorev/v1beta1/tx.rpc.msg.ts @@ -1,6 +1,6 @@ import { Rpc } from "../../../helpers"; import { BinaryReader } from "../../../binary"; -import { MsgSetHotRoutes, MsgSetHotRoutesResponse, MsgSetDeveloperAccount, MsgSetDeveloperAccountResponse, MsgSetMaxPoolPointsPerTx, MsgSetMaxPoolPointsPerTxResponse, MsgSetMaxPoolPointsPerBlock, MsgSetMaxPoolPointsPerBlockResponse, MsgSetPoolWeights, MsgSetPoolWeightsResponse, MsgSetBaseDenoms, MsgSetBaseDenomsResponse } from "./tx"; +import { MsgSetHotRoutes, MsgSetHotRoutesResponse, MsgSetDeveloperAccount, MsgSetDeveloperAccountResponse, MsgSetMaxPoolPointsPerTx, MsgSetMaxPoolPointsPerTxResponse, MsgSetMaxPoolPointsPerBlock, MsgSetMaxPoolPointsPerBlockResponse, MsgSetInfoByPoolType, MsgSetInfoByPoolTypeResponse, MsgSetBaseDenoms, MsgSetBaseDenomsResponse } from "./tx"; export interface Msg { /** * SetHotRoutes sets the hot routes that will be explored when creating @@ -23,10 +23,10 @@ export interface Msg { */ setMaxPoolPointsPerBlock(request: MsgSetMaxPoolPointsPerBlock): Promise; /** - * SetPoolWeights sets the weights of each pool type in the store. Can only be - * called by the admin account. + * SetInfoByPoolType sets the pool type information needed to make smart + * assumptions about swapping on different pool types */ - setPoolWeights(request: MsgSetPoolWeights): Promise; + setInfoByPoolType(request: MsgSetInfoByPoolType): Promise; /** * SetBaseDenoms sets the base denoms that will be used to create cyclic * arbitrage routes. Can only be called by the admin account. @@ -41,7 +41,7 @@ export class MsgClientImpl implements Msg { this.setDeveloperAccount = this.setDeveloperAccount.bind(this); this.setMaxPoolPointsPerTx = this.setMaxPoolPointsPerTx.bind(this); this.setMaxPoolPointsPerBlock = this.setMaxPoolPointsPerBlock.bind(this); - this.setPoolWeights = this.setPoolWeights.bind(this); + this.setInfoByPoolType = this.setInfoByPoolType.bind(this); this.setBaseDenoms = this.setBaseDenoms.bind(this); } setHotRoutes(request: MsgSetHotRoutes): Promise { @@ -64,10 +64,10 @@ export class MsgClientImpl implements Msg { const promise = this.rpc.request("osmosis.protorev.v1beta1.Msg", "SetMaxPoolPointsPerBlock", data); return promise.then(data => MsgSetMaxPoolPointsPerBlockResponse.decode(new BinaryReader(data))); } - setPoolWeights(request: MsgSetPoolWeights): Promise { - const data = MsgSetPoolWeights.encode(request).finish(); - const promise = this.rpc.request("osmosis.protorev.v1beta1.Msg", "SetPoolWeights", data); - return promise.then(data => MsgSetPoolWeightsResponse.decode(new BinaryReader(data))); + setInfoByPoolType(request: MsgSetInfoByPoolType): Promise { + const data = MsgSetInfoByPoolType.encode(request).finish(); + const promise = this.rpc.request("osmosis.protorev.v1beta1.Msg", "SetInfoByPoolType", data); + return promise.then(data => MsgSetInfoByPoolTypeResponse.decode(new BinaryReader(data))); } setBaseDenoms(request: MsgSetBaseDenoms): Promise { const data = MsgSetBaseDenoms.encode(request).finish(); diff --git a/packages/osmo-query/src/codegen/osmosis/protorev/v1beta1/tx.ts b/packages/osmo-query/src/codegen/osmosis/protorev/v1beta1/tx.ts index 8765d09c6..bee9a0b58 100644 --- a/packages/osmo-query/src/codegen/osmosis/protorev/v1beta1/tx.ts +++ b/packages/osmo-query/src/codegen/osmosis/protorev/v1beta1/tx.ts @@ -1,4 +1,4 @@ -import { TokenPairArbRoutes, TokenPairArbRoutesAmino, TokenPairArbRoutesSDKType, PoolWeights, PoolWeightsAmino, PoolWeightsSDKType, BaseDenom, BaseDenomAmino, BaseDenomSDKType } from "./protorev"; +import { TokenPairArbRoutes, TokenPairArbRoutesAmino, TokenPairArbRoutesSDKType, InfoByPoolType, InfoByPoolTypeAmino, InfoByPoolTypeSDKType, BaseDenom, BaseDenomAmino, BaseDenomSDKType } from "./protorev"; import { BinaryReader, BinaryWriter } from "../../../binary"; /** MsgSetHotRoutes defines the Msg/SetHotRoutes request type. */ export interface MsgSetHotRoutes { @@ -14,9 +14,9 @@ export interface MsgSetHotRoutesProtoMsg { /** MsgSetHotRoutes defines the Msg/SetHotRoutes request type. */ export interface MsgSetHotRoutesAmino { /** admin is the account that is authorized to set the hot routes. */ - admin: string; + admin?: string; /** hot_routes is the list of hot routes to set. */ - hot_routes: TokenPairArbRoutesAmino[]; + hot_routes?: TokenPairArbRoutesAmino[]; } export interface MsgSetHotRoutesAminoMsg { type: "osmosis/MsgSetHotRoutes"; @@ -58,12 +58,12 @@ export interface MsgSetDeveloperAccountProtoMsg { /** MsgSetDeveloperAccount defines the Msg/SetDeveloperAccount request type. */ export interface MsgSetDeveloperAccountAmino { /** admin is the account that is authorized to set the developer account. */ - admin: string; + admin?: string; /** * developer_account is the account that will receive a portion of the profits * from the protorev module. */ - developer_account: string; + developer_account?: string; } export interface MsgSetDeveloperAccountAminoMsg { type: "osmosis/MsgSetDeveloperAccount"; @@ -97,47 +97,47 @@ export interface MsgSetDeveloperAccountResponseAminoMsg { * type. */ export interface MsgSetDeveloperAccountResponseSDKType {} -/** MsgSetPoolWeights defines the Msg/SetPoolWeights request type. */ -export interface MsgSetPoolWeights { +/** MsgSetInfoByPoolType defines the Msg/SetInfoByPoolType request type. */ +export interface MsgSetInfoByPoolType { /** admin is the account that is authorized to set the pool weights. */ admin: string; - /** pool_weights is the list of pool weights to set. */ - poolWeights: PoolWeights; + /** info_by_pool_type contains information about the pool types. */ + infoByPoolType: InfoByPoolType; } -export interface MsgSetPoolWeightsProtoMsg { - typeUrl: "/osmosis.protorev.v1beta1.MsgSetPoolWeights"; +export interface MsgSetInfoByPoolTypeProtoMsg { + typeUrl: "/osmosis.protorev.v1beta1.MsgSetInfoByPoolType"; value: Uint8Array; } -/** MsgSetPoolWeights defines the Msg/SetPoolWeights request type. */ -export interface MsgSetPoolWeightsAmino { +/** MsgSetInfoByPoolType defines the Msg/SetInfoByPoolType request type. */ +export interface MsgSetInfoByPoolTypeAmino { /** admin is the account that is authorized to set the pool weights. */ - admin: string; - /** pool_weights is the list of pool weights to set. */ - pool_weights?: PoolWeightsAmino; + admin?: string; + /** info_by_pool_type contains information about the pool types. */ + info_by_pool_type?: InfoByPoolTypeAmino; } -export interface MsgSetPoolWeightsAminoMsg { - type: "osmosis/protorev/set-pool-weights"; - value: MsgSetPoolWeightsAmino; +export interface MsgSetInfoByPoolTypeAminoMsg { + type: "osmosis/MsgSetInfoByPoolType"; + value: MsgSetInfoByPoolTypeAmino; } -/** MsgSetPoolWeights defines the Msg/SetPoolWeights request type. */ -export interface MsgSetPoolWeightsSDKType { +/** MsgSetInfoByPoolType defines the Msg/SetInfoByPoolType request type. */ +export interface MsgSetInfoByPoolTypeSDKType { admin: string; - pool_weights: PoolWeightsSDKType; + info_by_pool_type: InfoByPoolTypeSDKType; } -/** MsgSetPoolWeightsResponse defines the Msg/SetPoolWeights response type. */ -export interface MsgSetPoolWeightsResponse {} -export interface MsgSetPoolWeightsResponseProtoMsg { - typeUrl: "/osmosis.protorev.v1beta1.MsgSetPoolWeightsResponse"; +/** MsgSetInfoByPoolTypeResponse defines the Msg/SetInfoByPoolType response type. */ +export interface MsgSetInfoByPoolTypeResponse {} +export interface MsgSetInfoByPoolTypeResponseProtoMsg { + typeUrl: "/osmosis.protorev.v1beta1.MsgSetInfoByPoolTypeResponse"; value: Uint8Array; } -/** MsgSetPoolWeightsResponse defines the Msg/SetPoolWeights response type. */ -export interface MsgSetPoolWeightsResponseAmino {} -export interface MsgSetPoolWeightsResponseAminoMsg { - type: "osmosis/protorev/set-pool-weights-response"; - value: MsgSetPoolWeightsResponseAmino; +/** MsgSetInfoByPoolTypeResponse defines the Msg/SetInfoByPoolType response type. */ +export interface MsgSetInfoByPoolTypeResponseAmino {} +export interface MsgSetInfoByPoolTypeResponseAminoMsg { + type: "osmosis/protorev/set-info-by-pool-type-response"; + value: MsgSetInfoByPoolTypeResponseAmino; } -/** MsgSetPoolWeightsResponse defines the Msg/SetPoolWeights response type. */ -export interface MsgSetPoolWeightsResponseSDKType {} +/** MsgSetInfoByPoolTypeResponse defines the Msg/SetInfoByPoolType response type. */ +export interface MsgSetInfoByPoolTypeResponseSDKType {} /** MsgSetMaxPoolPointsPerTx defines the Msg/SetMaxPoolPointsPerTx request type. */ export interface MsgSetMaxPoolPointsPerTx { /** admin is the account that is authorized to set the max pool points per tx. */ @@ -155,15 +155,15 @@ export interface MsgSetMaxPoolPointsPerTxProtoMsg { /** MsgSetMaxPoolPointsPerTx defines the Msg/SetMaxPoolPointsPerTx request type. */ export interface MsgSetMaxPoolPointsPerTxAmino { /** admin is the account that is authorized to set the max pool points per tx. */ - admin: string; + admin?: string; /** * max_pool_points_per_tx is the maximum number of pool points that can be * consumed per transaction. */ - max_pool_points_per_tx: string; + max_pool_points_per_tx?: string; } export interface MsgSetMaxPoolPointsPerTxAminoMsg { - type: "osmosis/protorev/set-max-pool-points-per-tx"; + type: "osmosis/MsgSetMaxPoolPointsPerTx"; value: MsgSetMaxPoolPointsPerTxAmino; } /** MsgSetMaxPoolPointsPerTx defines the Msg/SetMaxPoolPointsPerTx request type. */ @@ -223,15 +223,15 @@ export interface MsgSetMaxPoolPointsPerBlockAmino { * admin is the account that is authorized to set the max pool points per * block. */ - admin: string; + admin?: string; /** * max_pool_points_per_block is the maximum number of pool points that can be * consumed per block. */ - max_pool_points_per_block: string; + max_pool_points_per_block?: string; } export interface MsgSetMaxPoolPointsPerBlockAminoMsg { - type: "osmosis/protorev/set-max-pool-points-per-block"; + type: "osmosis/MsgSetPoolWeights"; value: MsgSetMaxPoolPointsPerBlockAmino; } /** @@ -279,12 +279,12 @@ export interface MsgSetBaseDenomsProtoMsg { /** MsgSetBaseDenoms defines the Msg/SetBaseDenoms request type. */ export interface MsgSetBaseDenomsAmino { /** admin is the account that is authorized to set the base denoms. */ - admin: string; + admin?: string; /** base_denoms is the list of base denoms to set. */ - base_denoms: BaseDenomAmino[]; + base_denoms?: BaseDenomAmino[]; } export interface MsgSetBaseDenomsAminoMsg { - type: "osmosis/protorev/set-base-denoms"; + type: "osmosis/MsgSetBaseDenoms"; value: MsgSetBaseDenomsAmino; } /** MsgSetBaseDenoms defines the Msg/SetBaseDenoms request type. */ @@ -350,10 +350,12 @@ export const MsgSetHotRoutes = { return message; }, fromAmino(object: MsgSetHotRoutesAmino): MsgSetHotRoutes { - return { - admin: object.admin, - hotRoutes: Array.isArray(object?.hot_routes) ? object.hot_routes.map((e: any) => TokenPairArbRoutes.fromAmino(e)) : [] - }; + const message = createBaseMsgSetHotRoutes(); + if (object.admin !== undefined && object.admin !== null) { + message.admin = object.admin; + } + message.hotRoutes = object.hot_routes?.map(e => TokenPairArbRoutes.fromAmino(e)) || []; + return message; }, toAmino(message: MsgSetHotRoutes): MsgSetHotRoutesAmino { const obj: any = {}; @@ -414,7 +416,8 @@ export const MsgSetHotRoutesResponse = { return message; }, fromAmino(_: MsgSetHotRoutesResponseAmino): MsgSetHotRoutesResponse { - return {}; + const message = createBaseMsgSetHotRoutesResponse(); + return message; }, toAmino(_: MsgSetHotRoutesResponse): MsgSetHotRoutesResponseAmino { const obj: any = {}; @@ -486,10 +489,14 @@ export const MsgSetDeveloperAccount = { return message; }, fromAmino(object: MsgSetDeveloperAccountAmino): MsgSetDeveloperAccount { - return { - admin: object.admin, - developerAccount: object.developer_account - }; + const message = createBaseMsgSetDeveloperAccount(); + if (object.admin !== undefined && object.admin !== null) { + message.admin = object.admin; + } + if (object.developer_account !== undefined && object.developer_account !== null) { + message.developerAccount = object.developer_account; + } + return message; }, toAmino(message: MsgSetDeveloperAccount): MsgSetDeveloperAccountAmino { const obj: any = {}; @@ -546,7 +553,8 @@ export const MsgSetDeveloperAccountResponse = { return message; }, fromAmino(_: MsgSetDeveloperAccountResponseAmino): MsgSetDeveloperAccountResponse { - return {}; + const message = createBaseMsgSetDeveloperAccountResponse(); + return message; }, toAmino(_: MsgSetDeveloperAccountResponse): MsgSetDeveloperAccountResponseAmino { const obj: any = {}; @@ -574,27 +582,27 @@ export const MsgSetDeveloperAccountResponse = { }; } }; -function createBaseMsgSetPoolWeights(): MsgSetPoolWeights { +function createBaseMsgSetInfoByPoolType(): MsgSetInfoByPoolType { return { admin: "", - poolWeights: PoolWeights.fromPartial({}) + infoByPoolType: InfoByPoolType.fromPartial({}) }; } -export const MsgSetPoolWeights = { - typeUrl: "/osmosis.protorev.v1beta1.MsgSetPoolWeights", - encode(message: MsgSetPoolWeights, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { +export const MsgSetInfoByPoolType = { + typeUrl: "/osmosis.protorev.v1beta1.MsgSetInfoByPoolType", + encode(message: MsgSetInfoByPoolType, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.admin !== "") { writer.uint32(10).string(message.admin); } - if (message.poolWeights !== undefined) { - PoolWeights.encode(message.poolWeights, writer.uint32(18).fork()).ldelim(); + if (message.infoByPoolType !== undefined) { + InfoByPoolType.encode(message.infoByPoolType, writer.uint32(18).fork()).ldelim(); } return writer; }, - decode(input: BinaryReader | Uint8Array, length?: number): MsgSetPoolWeights { + decode(input: BinaryReader | Uint8Array, length?: number): MsgSetInfoByPoolType { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseMsgSetPoolWeights(); + const message = createBaseMsgSetInfoByPoolType(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -602,7 +610,7 @@ export const MsgSetPoolWeights = { message.admin = reader.string(); break; case 2: - message.poolWeights = PoolWeights.decode(reader, reader.uint32()); + message.infoByPoolType = InfoByPoolType.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -611,58 +619,62 @@ export const MsgSetPoolWeights = { } return message; }, - fromPartial(object: Partial): MsgSetPoolWeights { - const message = createBaseMsgSetPoolWeights(); + fromPartial(object: Partial): MsgSetInfoByPoolType { + const message = createBaseMsgSetInfoByPoolType(); message.admin = object.admin ?? ""; - message.poolWeights = object.poolWeights !== undefined && object.poolWeights !== null ? PoolWeights.fromPartial(object.poolWeights) : undefined; + message.infoByPoolType = object.infoByPoolType !== undefined && object.infoByPoolType !== null ? InfoByPoolType.fromPartial(object.infoByPoolType) : undefined; return message; }, - fromAmino(object: MsgSetPoolWeightsAmino): MsgSetPoolWeights { - return { - admin: object.admin, - poolWeights: object?.pool_weights ? PoolWeights.fromAmino(object.pool_weights) : undefined - }; + fromAmino(object: MsgSetInfoByPoolTypeAmino): MsgSetInfoByPoolType { + const message = createBaseMsgSetInfoByPoolType(); + if (object.admin !== undefined && object.admin !== null) { + message.admin = object.admin; + } + if (object.info_by_pool_type !== undefined && object.info_by_pool_type !== null) { + message.infoByPoolType = InfoByPoolType.fromAmino(object.info_by_pool_type); + } + return message; }, - toAmino(message: MsgSetPoolWeights): MsgSetPoolWeightsAmino { + toAmino(message: MsgSetInfoByPoolType): MsgSetInfoByPoolTypeAmino { const obj: any = {}; obj.admin = message.admin; - obj.pool_weights = message.poolWeights ? PoolWeights.toAmino(message.poolWeights) : undefined; + obj.info_by_pool_type = message.infoByPoolType ? InfoByPoolType.toAmino(message.infoByPoolType) : undefined; return obj; }, - fromAminoMsg(object: MsgSetPoolWeightsAminoMsg): MsgSetPoolWeights { - return MsgSetPoolWeights.fromAmino(object.value); + fromAminoMsg(object: MsgSetInfoByPoolTypeAminoMsg): MsgSetInfoByPoolType { + return MsgSetInfoByPoolType.fromAmino(object.value); }, - toAminoMsg(message: MsgSetPoolWeights): MsgSetPoolWeightsAminoMsg { + toAminoMsg(message: MsgSetInfoByPoolType): MsgSetInfoByPoolTypeAminoMsg { return { - type: "osmosis/protorev/set-pool-weights", - value: MsgSetPoolWeights.toAmino(message) + type: "osmosis/MsgSetInfoByPoolType", + value: MsgSetInfoByPoolType.toAmino(message) }; }, - fromProtoMsg(message: MsgSetPoolWeightsProtoMsg): MsgSetPoolWeights { - return MsgSetPoolWeights.decode(message.value); + fromProtoMsg(message: MsgSetInfoByPoolTypeProtoMsg): MsgSetInfoByPoolType { + return MsgSetInfoByPoolType.decode(message.value); }, - toProto(message: MsgSetPoolWeights): Uint8Array { - return MsgSetPoolWeights.encode(message).finish(); + toProto(message: MsgSetInfoByPoolType): Uint8Array { + return MsgSetInfoByPoolType.encode(message).finish(); }, - toProtoMsg(message: MsgSetPoolWeights): MsgSetPoolWeightsProtoMsg { + toProtoMsg(message: MsgSetInfoByPoolType): MsgSetInfoByPoolTypeProtoMsg { return { - typeUrl: "/osmosis.protorev.v1beta1.MsgSetPoolWeights", - value: MsgSetPoolWeights.encode(message).finish() + typeUrl: "/osmosis.protorev.v1beta1.MsgSetInfoByPoolType", + value: MsgSetInfoByPoolType.encode(message).finish() }; } }; -function createBaseMsgSetPoolWeightsResponse(): MsgSetPoolWeightsResponse { +function createBaseMsgSetInfoByPoolTypeResponse(): MsgSetInfoByPoolTypeResponse { return {}; } -export const MsgSetPoolWeightsResponse = { - typeUrl: "/osmosis.protorev.v1beta1.MsgSetPoolWeightsResponse", - encode(_: MsgSetPoolWeightsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { +export const MsgSetInfoByPoolTypeResponse = { + typeUrl: "/osmosis.protorev.v1beta1.MsgSetInfoByPoolTypeResponse", + encode(_: MsgSetInfoByPoolTypeResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, - decode(input: BinaryReader | Uint8Array, length?: number): MsgSetPoolWeightsResponse { + decode(input: BinaryReader | Uint8Array, length?: number): MsgSetInfoByPoolTypeResponse { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseMsgSetPoolWeightsResponse(); + const message = createBaseMsgSetInfoByPoolTypeResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -673,36 +685,37 @@ export const MsgSetPoolWeightsResponse = { } return message; }, - fromPartial(_: Partial): MsgSetPoolWeightsResponse { - const message = createBaseMsgSetPoolWeightsResponse(); + fromPartial(_: Partial): MsgSetInfoByPoolTypeResponse { + const message = createBaseMsgSetInfoByPoolTypeResponse(); return message; }, - fromAmino(_: MsgSetPoolWeightsResponseAmino): MsgSetPoolWeightsResponse { - return {}; + fromAmino(_: MsgSetInfoByPoolTypeResponseAmino): MsgSetInfoByPoolTypeResponse { + const message = createBaseMsgSetInfoByPoolTypeResponse(); + return message; }, - toAmino(_: MsgSetPoolWeightsResponse): MsgSetPoolWeightsResponseAmino { + toAmino(_: MsgSetInfoByPoolTypeResponse): MsgSetInfoByPoolTypeResponseAmino { const obj: any = {}; return obj; }, - fromAminoMsg(object: MsgSetPoolWeightsResponseAminoMsg): MsgSetPoolWeightsResponse { - return MsgSetPoolWeightsResponse.fromAmino(object.value); + fromAminoMsg(object: MsgSetInfoByPoolTypeResponseAminoMsg): MsgSetInfoByPoolTypeResponse { + return MsgSetInfoByPoolTypeResponse.fromAmino(object.value); }, - toAminoMsg(message: MsgSetPoolWeightsResponse): MsgSetPoolWeightsResponseAminoMsg { + toAminoMsg(message: MsgSetInfoByPoolTypeResponse): MsgSetInfoByPoolTypeResponseAminoMsg { return { - type: "osmosis/protorev/set-pool-weights-response", - value: MsgSetPoolWeightsResponse.toAmino(message) + type: "osmosis/protorev/set-info-by-pool-type-response", + value: MsgSetInfoByPoolTypeResponse.toAmino(message) }; }, - fromProtoMsg(message: MsgSetPoolWeightsResponseProtoMsg): MsgSetPoolWeightsResponse { - return MsgSetPoolWeightsResponse.decode(message.value); + fromProtoMsg(message: MsgSetInfoByPoolTypeResponseProtoMsg): MsgSetInfoByPoolTypeResponse { + return MsgSetInfoByPoolTypeResponse.decode(message.value); }, - toProto(message: MsgSetPoolWeightsResponse): Uint8Array { - return MsgSetPoolWeightsResponse.encode(message).finish(); + toProto(message: MsgSetInfoByPoolTypeResponse): Uint8Array { + return MsgSetInfoByPoolTypeResponse.encode(message).finish(); }, - toProtoMsg(message: MsgSetPoolWeightsResponse): MsgSetPoolWeightsResponseProtoMsg { + toProtoMsg(message: MsgSetInfoByPoolTypeResponse): MsgSetInfoByPoolTypeResponseProtoMsg { return { - typeUrl: "/osmosis.protorev.v1beta1.MsgSetPoolWeightsResponse", - value: MsgSetPoolWeightsResponse.encode(message).finish() + typeUrl: "/osmosis.protorev.v1beta1.MsgSetInfoByPoolTypeResponse", + value: MsgSetInfoByPoolTypeResponse.encode(message).finish() }; } }; @@ -750,10 +763,14 @@ export const MsgSetMaxPoolPointsPerTx = { return message; }, fromAmino(object: MsgSetMaxPoolPointsPerTxAmino): MsgSetMaxPoolPointsPerTx { - return { - admin: object.admin, - maxPoolPointsPerTx: BigInt(object.max_pool_points_per_tx) - }; + const message = createBaseMsgSetMaxPoolPointsPerTx(); + if (object.admin !== undefined && object.admin !== null) { + message.admin = object.admin; + } + if (object.max_pool_points_per_tx !== undefined && object.max_pool_points_per_tx !== null) { + message.maxPoolPointsPerTx = BigInt(object.max_pool_points_per_tx); + } + return message; }, toAmino(message: MsgSetMaxPoolPointsPerTx): MsgSetMaxPoolPointsPerTxAmino { const obj: any = {}; @@ -766,7 +783,7 @@ export const MsgSetMaxPoolPointsPerTx = { }, toAminoMsg(message: MsgSetMaxPoolPointsPerTx): MsgSetMaxPoolPointsPerTxAminoMsg { return { - type: "osmosis/protorev/set-max-pool-points-per-tx", + type: "osmosis/MsgSetMaxPoolPointsPerTx", value: MsgSetMaxPoolPointsPerTx.toAmino(message) }; }, @@ -810,7 +827,8 @@ export const MsgSetMaxPoolPointsPerTxResponse = { return message; }, fromAmino(_: MsgSetMaxPoolPointsPerTxResponseAmino): MsgSetMaxPoolPointsPerTxResponse { - return {}; + const message = createBaseMsgSetMaxPoolPointsPerTxResponse(); + return message; }, toAmino(_: MsgSetMaxPoolPointsPerTxResponse): MsgSetMaxPoolPointsPerTxResponseAmino { const obj: any = {}; @@ -882,10 +900,14 @@ export const MsgSetMaxPoolPointsPerBlock = { return message; }, fromAmino(object: MsgSetMaxPoolPointsPerBlockAmino): MsgSetMaxPoolPointsPerBlock { - return { - admin: object.admin, - maxPoolPointsPerBlock: BigInt(object.max_pool_points_per_block) - }; + const message = createBaseMsgSetMaxPoolPointsPerBlock(); + if (object.admin !== undefined && object.admin !== null) { + message.admin = object.admin; + } + if (object.max_pool_points_per_block !== undefined && object.max_pool_points_per_block !== null) { + message.maxPoolPointsPerBlock = BigInt(object.max_pool_points_per_block); + } + return message; }, toAmino(message: MsgSetMaxPoolPointsPerBlock): MsgSetMaxPoolPointsPerBlockAmino { const obj: any = {}; @@ -898,7 +920,7 @@ export const MsgSetMaxPoolPointsPerBlock = { }, toAminoMsg(message: MsgSetMaxPoolPointsPerBlock): MsgSetMaxPoolPointsPerBlockAminoMsg { return { - type: "osmosis/protorev/set-max-pool-points-per-block", + type: "osmosis/MsgSetPoolWeights", value: MsgSetMaxPoolPointsPerBlock.toAmino(message) }; }, @@ -942,7 +964,8 @@ export const MsgSetMaxPoolPointsPerBlockResponse = { return message; }, fromAmino(_: MsgSetMaxPoolPointsPerBlockResponseAmino): MsgSetMaxPoolPointsPerBlockResponse { - return {}; + const message = createBaseMsgSetMaxPoolPointsPerBlockResponse(); + return message; }, toAmino(_: MsgSetMaxPoolPointsPerBlockResponse): MsgSetMaxPoolPointsPerBlockResponseAmino { const obj: any = {}; @@ -1014,10 +1037,12 @@ export const MsgSetBaseDenoms = { return message; }, fromAmino(object: MsgSetBaseDenomsAmino): MsgSetBaseDenoms { - return { - admin: object.admin, - baseDenoms: Array.isArray(object?.base_denoms) ? object.base_denoms.map((e: any) => BaseDenom.fromAmino(e)) : [] - }; + const message = createBaseMsgSetBaseDenoms(); + if (object.admin !== undefined && object.admin !== null) { + message.admin = object.admin; + } + message.baseDenoms = object.base_denoms?.map(e => BaseDenom.fromAmino(e)) || []; + return message; }, toAmino(message: MsgSetBaseDenoms): MsgSetBaseDenomsAmino { const obj: any = {}; @@ -1034,7 +1059,7 @@ export const MsgSetBaseDenoms = { }, toAminoMsg(message: MsgSetBaseDenoms): MsgSetBaseDenomsAminoMsg { return { - type: "osmosis/protorev/set-base-denoms", + type: "osmosis/MsgSetBaseDenoms", value: MsgSetBaseDenoms.toAmino(message) }; }, @@ -1078,7 +1103,8 @@ export const MsgSetBaseDenomsResponse = { return message; }, fromAmino(_: MsgSetBaseDenomsResponseAmino): MsgSetBaseDenomsResponse { - return {}; + const message = createBaseMsgSetBaseDenomsResponse(); + return message; }, toAmino(_: MsgSetBaseDenomsResponse): MsgSetBaseDenomsResponseAmino { const obj: any = {}; diff --git a/packages/osmo-query/src/codegen/osmosis/rpc.query.ts b/packages/osmo-query/src/codegen/osmosis/rpc.query.ts index 846287fd0..f03a1e586 100644 --- a/packages/osmo-query/src/codegen/osmosis/rpc.query.ts +++ b/packages/osmo-query/src/codegen/osmosis/rpc.query.ts @@ -1,11 +1,11 @@ -import { HttpEndpoint, connectComet } from "@cosmjs/tendermint-rpc"; +import { Tendermint34Client, HttpEndpoint } from "@cosmjs/tendermint-rpc"; import { QueryClient } from "@cosmjs/stargate"; export const createRPCQueryClient = async ({ rpcEndpoint }: { rpcEndpoint: string | HttpEndpoint; }) => { - const tmClient = await connectComet(rpcEndpoint); + const tmClient = await Tendermint34Client.connect(rpcEndpoint); const client = new QueryClient(tmClient); return { cosmos: { @@ -23,12 +23,20 @@ export const createRPCQueryClient = async ({ v1beta1: (await import("../cosmos/base/node/v1beta1/query.rpc.Service")).createRpcQueryExtension(client) } }, + consensus: { + v1: (await import("../cosmos/consensus/v1/query.rpc.Query")).createRpcQueryExtension(client) + }, distribution: { v1beta1: (await import("../cosmos/distribution/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) }, gov: { v1beta1: (await import("../cosmos/gov/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) }, + orm: { + query: { + v1alpha1: (await import("../cosmos/orm/query/v1alpha1/query.rpc.Query")).createRpcQueryExtension(client) + } + }, staking: { v1beta1: (await import("../cosmos/staking/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) }, @@ -41,23 +49,23 @@ export const createRPCQueryClient = async ({ }, osmosis: { concentratedliquidity: { - v1beta1: (await import("./concentrated-liquidity/query.rpc.Query")).createRpcQueryExtension(client) + v1beta1: (await import("./concentratedliquidity/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) }, cosmwasmpool: { v1beta1: (await import("./cosmwasmpool/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) }, downtimedetector: { - v1beta1: (await import("./downtime-detector/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) + v1beta1: (await import("./downtimedetector/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) }, epochs: { - v1beta1: (await import("./epochs/query.rpc.Query")).createRpcQueryExtension(client) + v1beta1: (await import("./epochs/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) }, gamm: { v1beta1: (await import("./gamm/v1beta1/query.rpc.Query")).createRpcQueryExtension(client), v2: (await import("./gamm/v2/query.rpc.Query")).createRpcQueryExtension(client) }, ibcratelimit: { - v1beta1: (await import("./ibc-rate-limit/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) + v1beta1: (await import("./ibcratelimit/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) }, incentives: (await import("./incentives/query.rpc.Query")).createRpcQueryExtension(client), lockup: (await import("./lockup/query.rpc.Query")).createRpcQueryExtension(client), @@ -65,10 +73,11 @@ export const createRPCQueryClient = async ({ v1beta1: (await import("./mint/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) }, poolincentives: { - v1beta1: (await import("./pool-incentives/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) + v1beta1: (await import("./poolincentives/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) }, poolmanager: { - v1beta1: (await import("./poolmanager/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) + v1beta1: (await import("./poolmanager/v1beta1/query.rpc.Query")).createRpcQueryExtension(client), + v2: (await import("./poolmanager/v2/query.rpc.Query")).createRpcQueryExtension(client) }, protorev: { v1beta1: (await import("./protorev/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) @@ -84,7 +93,7 @@ export const createRPCQueryClient = async ({ v1beta1: (await import("./txfees/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) }, valsetpref: { - v1beta1: (await import("./valset-pref/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) + v1beta1: (await import("./valsetpref/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) } } }; diff --git a/packages/osmo-query/src/codegen/osmosis/rpc.tx.ts b/packages/osmo-query/src/codegen/osmosis/rpc.tx.ts index 7e4bb7a97..da635cb56 100644 --- a/packages/osmo-query/src/codegen/osmosis/rpc.tx.ts +++ b/packages/osmo-query/src/codegen/osmosis/rpc.tx.ts @@ -5,12 +5,18 @@ export const createRPCMsgClient = async ({ rpc: Rpc; }) => ({ cosmos: { + auth: { + v1beta1: new (await import("../cosmos/auth/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) + }, authz: { v1beta1: new (await import("../cosmos/authz/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) }, bank: { v1beta1: new (await import("../cosmos/bank/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) }, + consensus: { + v1: new (await import("../cosmos/consensus/v1/tx.rpc.msg")).MsgClientImpl(rpc) + }, distribution: { v1beta1: new (await import("../cosmos/distribution/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) }, @@ -19,28 +25,32 @@ export const createRPCMsgClient = async ({ }, staking: { v1beta1: new (await import("../cosmos/staking/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) + }, + upgrade: { + v1beta1: new (await import("../cosmos/upgrade/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) } }, osmosis: { concentratedliquidity: { poolmodel: { concentrated: { - v1beta1: new (await import("./concentrated-liquidity/pool-model/concentrated/tx.rpc.msg")).MsgClientImpl(rpc) + v1beta1: new (await import("./concentratedliquidity/poolmodel/concentrated/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) } }, - v1beta1: new (await import("./concentrated-liquidity/tx.rpc.msg")).MsgClientImpl(rpc) + v1beta1: new (await import("./concentratedliquidity/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) }, gamm: { poolmodels: { balancer: { - v1beta1: new (await import("./gamm/pool-models/balancer/tx/tx.rpc.msg")).MsgClientImpl(rpc) + v1beta1: new (await import("./gamm/poolmodels/balancer/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) }, stableswap: { - v1beta1: new (await import("./gamm/pool-models/stableswap/tx.rpc.msg")).MsgClientImpl(rpc) + v1beta1: new (await import("./gamm/poolmodels/stableswap/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) } }, v1beta1: new (await import("./gamm/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) }, + ibchooks: new (await import("./ibchooks/tx.rpc.msg")).MsgClientImpl(rpc), incentives: new (await import("./incentives/tx.rpc.msg")).MsgClientImpl(rpc), lockup: new (await import("./lockup/tx.rpc.msg")).MsgClientImpl(rpc), poolmanager: { @@ -54,7 +64,7 @@ export const createRPCMsgClient = async ({ v1beta1: new (await import("./tokenfactory/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) }, valsetpref: { - v1beta1: new (await import("./valset-pref/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) + v1beta1: new (await import("./valsetpref/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) } } }); \ No newline at end of file diff --git a/packages/osmojs/src/codegen/osmosis/sumtree/v1beta1/tree.ts b/packages/osmo-query/src/codegen/osmosis/store/v1beta1/tree.ts similarity index 88% rename from packages/osmojs/src/codegen/osmosis/sumtree/v1beta1/tree.ts rename to packages/osmo-query/src/codegen/osmosis/store/v1beta1/tree.ts index eff4ec7db..69b6d5973 100644 --- a/packages/osmojs/src/codegen/osmosis/sumtree/v1beta1/tree.ts +++ b/packages/osmo-query/src/codegen/osmosis/store/v1beta1/tree.ts @@ -1,4 +1,5 @@ import { BinaryReader, BinaryWriter } from "../../../binary"; +import { bytesFromBase64, base64FromBytes } from "../../../helpers"; export interface Node { children: Child[]; } @@ -7,7 +8,7 @@ export interface NodeProtoMsg { value: Uint8Array; } export interface NodeAmino { - children: ChildAmino[]; + children?: ChildAmino[]; } export interface NodeAminoMsg { type: "osmosis/store/node"; @@ -25,8 +26,8 @@ export interface ChildProtoMsg { value: Uint8Array; } export interface ChildAmino { - index: Uint8Array; - accumulation: string; + index?: string; + accumulation?: string; } export interface ChildAminoMsg { type: "osmosis/store/child"; @@ -37,7 +38,7 @@ export interface ChildSDKType { accumulation: string; } export interface Leaf { - leaf: Child; + leaf?: Child; } export interface LeafProtoMsg { typeUrl: "/osmosis.store.v1beta1.Leaf"; @@ -51,7 +52,7 @@ export interface LeafAminoMsg { value: LeafAmino; } export interface LeafSDKType { - leaf: ChildSDKType; + leaf?: ChildSDKType; } function createBaseNode(): Node { return { @@ -89,9 +90,9 @@ export const Node = { return message; }, fromAmino(object: NodeAmino): Node { - return { - children: Array.isArray(object?.children) ? object.children.map((e: any) => Child.fromAmino(e)) : [] - }; + const message = createBaseNode(); + message.children = object.children?.map(e => Child.fromAmino(e)) || []; + return message; }, toAmino(message: Node): NodeAmino { const obj: any = {}; @@ -168,14 +169,18 @@ export const Child = { return message; }, fromAmino(object: ChildAmino): Child { - return { - index: object.index, - accumulation: object.accumulation - }; + const message = createBaseChild(); + if (object.index !== undefined && object.index !== null) { + message.index = bytesFromBase64(object.index); + } + if (object.accumulation !== undefined && object.accumulation !== null) { + message.accumulation = object.accumulation; + } + return message; }, toAmino(message: Child): ChildAmino { const obj: any = {}; - obj.index = message.index; + obj.index = message.index ? base64FromBytes(message.index) : undefined; obj.accumulation = message.accumulation; return obj; }, @@ -203,7 +208,7 @@ export const Child = { }; function createBaseLeaf(): Leaf { return { - leaf: Child.fromPartial({}) + leaf: undefined }; } export const Leaf = { @@ -237,9 +242,11 @@ export const Leaf = { return message; }, fromAmino(object: LeafAmino): Leaf { - return { - leaf: object?.leaf ? Child.fromAmino(object.leaf) : undefined - }; + const message = createBaseLeaf(); + if (object.leaf !== undefined && object.leaf !== null) { + message.leaf = Child.fromAmino(object.leaf); + } + return message; }, toAmino(message: Leaf): LeafAmino { const obj: any = {}; diff --git a/packages/osmo-query/src/codegen/osmosis/superfluid/genesis.ts b/packages/osmo-query/src/codegen/osmosis/superfluid/genesis.ts index 3444f27a4..7a2b89447 100644 --- a/packages/osmo-query/src/codegen/osmosis/superfluid/genesis.ts +++ b/packages/osmo-query/src/codegen/osmosis/superfluid/genesis.ts @@ -32,18 +32,18 @@ export interface GenesisStateAmino { * superfluid_assets defines the registered superfluid assets that have been * registered via governance. */ - superfluid_assets: SuperfluidAssetAmino[]; + superfluid_assets?: SuperfluidAssetAmino[]; /** * osmo_equivalent_multipliers is the records of osmo equivalent amount of * each superfluid registered pool, updated every epoch. */ - osmo_equivalent_multipliers: OsmoEquivalentMultiplierRecordAmino[]; + osmo_equivalent_multipliers?: OsmoEquivalentMultiplierRecordAmino[]; /** * intermediary_accounts is a secondary account for superfluid staking that * plays an intermediary role between validators and the delegators. */ - intermediary_accounts: SuperfluidIntermediaryAccountAmino[]; - intemediary_account_connections: LockIdIntermediaryAccountConnectionAmino[]; + intermediary_accounts?: SuperfluidIntermediaryAccountAmino[]; + intemediary_account_connections?: LockIdIntermediaryAccountConnectionAmino[]; } export interface GenesisStateAminoMsg { type: "osmosis/genesis-state"; @@ -125,13 +125,15 @@ export const GenesisState = { return message; }, fromAmino(object: GenesisStateAmino): GenesisState { - return { - params: object?.params ? Params.fromAmino(object.params) : undefined, - superfluidAssets: Array.isArray(object?.superfluid_assets) ? object.superfluid_assets.map((e: any) => SuperfluidAsset.fromAmino(e)) : [], - osmoEquivalentMultipliers: Array.isArray(object?.osmo_equivalent_multipliers) ? object.osmo_equivalent_multipliers.map((e: any) => OsmoEquivalentMultiplierRecord.fromAmino(e)) : [], - intermediaryAccounts: Array.isArray(object?.intermediary_accounts) ? object.intermediary_accounts.map((e: any) => SuperfluidIntermediaryAccount.fromAmino(e)) : [], - intemediaryAccountConnections: Array.isArray(object?.intemediary_account_connections) ? object.intemediary_account_connections.map((e: any) => LockIdIntermediaryAccountConnection.fromAmino(e)) : [] - }; + const message = createBaseGenesisState(); + if (object.params !== undefined && object.params !== null) { + message.params = Params.fromAmino(object.params); + } + message.superfluidAssets = object.superfluid_assets?.map(e => SuperfluidAsset.fromAmino(e)) || []; + message.osmoEquivalentMultipliers = object.osmo_equivalent_multipliers?.map(e => OsmoEquivalentMultiplierRecord.fromAmino(e)) || []; + message.intermediaryAccounts = object.intermediary_accounts?.map(e => SuperfluidIntermediaryAccount.fromAmino(e)) || []; + message.intemediaryAccountConnections = object.intemediary_account_connections?.map(e => LockIdIntermediaryAccountConnection.fromAmino(e)) || []; + return message; }, toAmino(message: GenesisState): GenesisStateAmino { const obj: any = {}; diff --git a/packages/osmo-query/src/codegen/osmosis/superfluid/params.ts b/packages/osmo-query/src/codegen/osmosis/superfluid/params.ts index 19e861b27..acaeee542 100644 --- a/packages/osmo-query/src/codegen/osmosis/superfluid/params.ts +++ b/packages/osmo-query/src/codegen/osmosis/superfluid/params.ts @@ -22,7 +22,7 @@ export interface ParamsAmino { * to counter-balance the staked amount on chain's exposure to various asset * volatilities, and have base staking be 'resistant' to volatility. */ - minimum_risk_factor: string; + minimum_risk_factor?: string; } export interface ParamsAminoMsg { type: "osmosis/params"; @@ -68,9 +68,11 @@ export const Params = { return message; }, fromAmino(object: ParamsAmino): Params { - return { - minimumRiskFactor: object.minimum_risk_factor - }; + const message = createBaseParams(); + if (object.minimum_risk_factor !== undefined && object.minimum_risk_factor !== null) { + message.minimumRiskFactor = object.minimum_risk_factor; + } + return message; }, toAmino(message: Params): ParamsAmino { const obj: any = {}; diff --git a/packages/osmo-query/src/codegen/osmosis/superfluid/query.lcd.ts b/packages/osmo-query/src/codegen/osmosis/superfluid/query.lcd.ts index e29bf9d12..a91a7de2a 100644 --- a/packages/osmo-query/src/codegen/osmosis/superfluid/query.lcd.ts +++ b/packages/osmo-query/src/codegen/osmosis/superfluid/query.lcd.ts @@ -1,6 +1,6 @@ import { setPaginationParams } from "../../helpers"; import { LCDClient } from "@cosmology/lcd"; -import { QueryParamsRequest, QueryParamsResponseSDKType, AssetTypeRequest, AssetTypeResponseSDKType, AllAssetsRequest, AllAssetsResponseSDKType, AssetMultiplierRequest, AssetMultiplierResponseSDKType, AllIntermediaryAccountsRequest, AllIntermediaryAccountsResponseSDKType, ConnectedIntermediaryAccountRequest, ConnectedIntermediaryAccountResponseSDKType, TotalSuperfluidDelegationsRequest, TotalSuperfluidDelegationsResponseSDKType, SuperfluidDelegationAmountRequest, SuperfluidDelegationAmountResponseSDKType, SuperfluidDelegationsByDelegatorRequest, SuperfluidDelegationsByDelegatorResponseSDKType, SuperfluidUndelegationsByDelegatorRequest, SuperfluidUndelegationsByDelegatorResponseSDKType, SuperfluidDelegationsByValidatorDenomRequest, SuperfluidDelegationsByValidatorDenomResponseSDKType, EstimateSuperfluidDelegatedAmountByValidatorDenomRequest, EstimateSuperfluidDelegatedAmountByValidatorDenomResponseSDKType, QueryTotalDelegationByDelegatorRequest, QueryTotalDelegationByDelegatorResponseSDKType, QueryUnpoolWhitelistRequest, QueryUnpoolWhitelistResponseSDKType, UserConcentratedSuperfluidPositionsDelegatedRequest, UserConcentratedSuperfluidPositionsDelegatedResponseSDKType, UserConcentratedSuperfluidPositionsUndelegatingRequest, UserConcentratedSuperfluidPositionsUndelegatingResponseSDKType } from "./query"; +import { QueryParamsRequest, QueryParamsResponseSDKType, AssetTypeRequest, AssetTypeResponseSDKType, AllAssetsRequest, AllAssetsResponseSDKType, AssetMultiplierRequest, AssetMultiplierResponseSDKType, AllIntermediaryAccountsRequest, AllIntermediaryAccountsResponseSDKType, ConnectedIntermediaryAccountRequest, ConnectedIntermediaryAccountResponseSDKType, TotalSuperfluidDelegationsRequest, TotalSuperfluidDelegationsResponseSDKType, SuperfluidDelegationAmountRequest, SuperfluidDelegationAmountResponseSDKType, SuperfluidDelegationsByDelegatorRequest, SuperfluidDelegationsByDelegatorResponseSDKType, SuperfluidUndelegationsByDelegatorRequest, SuperfluidUndelegationsByDelegatorResponseSDKType, SuperfluidDelegationsByValidatorDenomRequest, SuperfluidDelegationsByValidatorDenomResponseSDKType, EstimateSuperfluidDelegatedAmountByValidatorDenomRequest, EstimateSuperfluidDelegatedAmountByValidatorDenomResponseSDKType, QueryTotalDelegationByDelegatorRequest, QueryTotalDelegationByDelegatorResponseSDKType, QueryUnpoolWhitelistRequest, QueryUnpoolWhitelistResponseSDKType, UserConcentratedSuperfluidPositionsDelegatedRequest, UserConcentratedSuperfluidPositionsDelegatedResponseSDKType, UserConcentratedSuperfluidPositionsUndelegatingRequest, UserConcentratedSuperfluidPositionsUndelegatingResponseSDKType, QueryRestSupplyRequest, QueryRestSupplyResponseSDKType } from "./query"; export class LCDQueryClient { req: LCDClient; constructor({ @@ -25,6 +25,7 @@ export class LCDQueryClient { this.unpoolWhitelist = this.unpoolWhitelist.bind(this); this.userConcentratedSuperfluidPositionsDelegated = this.userConcentratedSuperfluidPositionsDelegated.bind(this); this.userConcentratedSuperfluidPositionsUndelegating = this.userConcentratedSuperfluidPositionsUndelegating.bind(this); + this.restSupply = this.restSupply.bind(this); } /* Params returns the total set of superfluid parameters. */ async params(_params: QueryParamsRequest = {}): Promise { @@ -101,12 +102,12 @@ export class LCDQueryClient { const endpoint = `osmosis/superfluid/v1beta1/superfluid_delegation_amount`; return await this.req.get(endpoint, options); } - /* Returns all the delegated superfluid poistions for a specific delegator. */ + /* Returns all the delegated superfluid positions for a specific delegator. */ async superfluidDelegationsByDelegator(params: SuperfluidDelegationsByDelegatorRequest): Promise { const endpoint = `osmosis/superfluid/v1beta1/superfluid_delegations/${params.delegatorAddress}`; return await this.req.get(endpoint); } - /* Returns all the undelegating superfluid poistions for a specific delegator. */ + /* Returns all the undelegating superfluid positions for a specific delegator. */ async superfluidUndelegationsByDelegator(params: SuperfluidUndelegationsByDelegatorRequest): Promise { const options: any = { params: {} @@ -158,7 +159,7 @@ export class LCDQueryClient { const endpoint = `osmosis/superfluid/v1beta1/unpool_whitelist`; return await this.req.get(endpoint); } - /* UserConcentratedSuperfluidPositionsDelegated */ + /* Returns all of a user's full range CL positions that are superfluid staked. */ async userConcentratedSuperfluidPositionsDelegated(params: UserConcentratedSuperfluidPositionsDelegatedRequest): Promise { const endpoint = `osmosis/superfluid/v1beta1/account_delegated_cl_positions/${params.delegatorAddress}`; return await this.req.get(endpoint); @@ -168,4 +169,15 @@ export class LCDQueryClient { const endpoint = `osmosis/superfluid/v1beta1/account_undelegating_cl_positions/${params.delegatorAddress}`; return await this.req.get(endpoint); } + /* RestSupply */ + async restSupply(params: QueryRestSupplyRequest): Promise { + const options: any = { + params: {} + }; + if (typeof params?.denom !== "undefined") { + options.params.denom = params.denom; + } + const endpoint = `osmosis/superfluid/v1beta1/supply`; + return await this.req.get(endpoint, options); + } } \ No newline at end of file diff --git a/packages/osmo-query/src/codegen/osmosis/superfluid/query.rpc.Query.ts b/packages/osmo-query/src/codegen/osmosis/superfluid/query.rpc.Query.ts index a35b85784..bf7932721 100644 --- a/packages/osmo-query/src/codegen/osmosis/superfluid/query.rpc.Query.ts +++ b/packages/osmo-query/src/codegen/osmosis/superfluid/query.rpc.Query.ts @@ -3,7 +3,7 @@ import { BinaryReader } from "../../binary"; import { QueryClient, createProtobufRpcClient, ProtobufRpcClient } from "@cosmjs/stargate"; import { ReactQueryParams } from "../../react-query"; import { useQuery } from "@tanstack/react-query"; -import { QueryParamsRequest, QueryParamsResponse, AssetTypeRequest, AssetTypeResponse, AllAssetsRequest, AllAssetsResponse, AssetMultiplierRequest, AssetMultiplierResponse, AllIntermediaryAccountsRequest, AllIntermediaryAccountsResponse, ConnectedIntermediaryAccountRequest, ConnectedIntermediaryAccountResponse, QueryTotalDelegationByValidatorForDenomRequest, QueryTotalDelegationByValidatorForDenomResponse, TotalSuperfluidDelegationsRequest, TotalSuperfluidDelegationsResponse, SuperfluidDelegationAmountRequest, SuperfluidDelegationAmountResponse, SuperfluidDelegationsByDelegatorRequest, SuperfluidDelegationsByDelegatorResponse, SuperfluidUndelegationsByDelegatorRequest, SuperfluidUndelegationsByDelegatorResponse, SuperfluidDelegationsByValidatorDenomRequest, SuperfluidDelegationsByValidatorDenomResponse, EstimateSuperfluidDelegatedAmountByValidatorDenomRequest, EstimateSuperfluidDelegatedAmountByValidatorDenomResponse, QueryTotalDelegationByDelegatorRequest, QueryTotalDelegationByDelegatorResponse, QueryUnpoolWhitelistRequest, QueryUnpoolWhitelistResponse, UserConcentratedSuperfluidPositionsDelegatedRequest, UserConcentratedSuperfluidPositionsDelegatedResponse, UserConcentratedSuperfluidPositionsUndelegatingRequest, UserConcentratedSuperfluidPositionsUndelegatingResponse } from "./query"; +import { QueryParamsRequest, QueryParamsResponse, AssetTypeRequest, AssetTypeResponse, AllAssetsRequest, AllAssetsResponse, AssetMultiplierRequest, AssetMultiplierResponse, AllIntermediaryAccountsRequest, AllIntermediaryAccountsResponse, ConnectedIntermediaryAccountRequest, ConnectedIntermediaryAccountResponse, QueryTotalDelegationByValidatorForDenomRequest, QueryTotalDelegationByValidatorForDenomResponse, TotalSuperfluidDelegationsRequest, TotalSuperfluidDelegationsResponse, SuperfluidDelegationAmountRequest, SuperfluidDelegationAmountResponse, SuperfluidDelegationsByDelegatorRequest, SuperfluidDelegationsByDelegatorResponse, SuperfluidUndelegationsByDelegatorRequest, SuperfluidUndelegationsByDelegatorResponse, SuperfluidDelegationsByValidatorDenomRequest, SuperfluidDelegationsByValidatorDenomResponse, EstimateSuperfluidDelegatedAmountByValidatorDenomRequest, EstimateSuperfluidDelegatedAmountByValidatorDenomResponse, QueryTotalDelegationByDelegatorRequest, QueryTotalDelegationByDelegatorResponse, QueryUnpoolWhitelistRequest, QueryUnpoolWhitelistResponse, UserConcentratedSuperfluidPositionsDelegatedRequest, UserConcentratedSuperfluidPositionsDelegatedResponse, UserConcentratedSuperfluidPositionsUndelegatingRequest, UserConcentratedSuperfluidPositionsUndelegatingResponse, QueryRestSupplyRequest, QueryRestSupplyResponse } from "./query"; /** Query defines the gRPC querier service. */ export interface Query { /** Params returns the total set of superfluid parameters. */ @@ -33,9 +33,9 @@ export interface Query { * triplet */ superfluidDelegationAmount(request: SuperfluidDelegationAmountRequest): Promise; - /** Returns all the delegated superfluid poistions for a specific delegator. */ + /** Returns all the delegated superfluid positions for a specific delegator. */ superfluidDelegationsByDelegator(request: SuperfluidDelegationsByDelegatorRequest): Promise; - /** Returns all the undelegating superfluid poistions for a specific delegator. */ + /** Returns all the undelegating superfluid positions for a specific delegator. */ superfluidUndelegationsByDelegator(request: SuperfluidUndelegationsByDelegatorRequest): Promise; /** * Returns all the superfluid positions of a specific denom delegated to one @@ -52,8 +52,10 @@ export interface Query { totalDelegationByDelegator(request: QueryTotalDelegationByDelegatorRequest): Promise; /** Returns a list of whitelisted pool ids to unpool. */ unpoolWhitelist(request?: QueryUnpoolWhitelistRequest): Promise; + /** Returns all of a user's full range CL positions that are superfluid staked. */ userConcentratedSuperfluidPositionsDelegated(request: UserConcentratedSuperfluidPositionsDelegatedRequest): Promise; userConcentratedSuperfluidPositionsUndelegating(request: UserConcentratedSuperfluidPositionsUndelegatingRequest): Promise; + restSupply(request: QueryRestSupplyRequest): Promise; } export class QueryClientImpl implements Query { private readonly rpc: Rpc; @@ -76,6 +78,7 @@ export class QueryClientImpl implements Query { this.unpoolWhitelist = this.unpoolWhitelist.bind(this); this.userConcentratedSuperfluidPositionsDelegated = this.userConcentratedSuperfluidPositionsDelegated.bind(this); this.userConcentratedSuperfluidPositionsUndelegating = this.userConcentratedSuperfluidPositionsUndelegating.bind(this); + this.restSupply = this.restSupply.bind(this); } params(request: QueryParamsRequest = {}): Promise { const data = QueryParamsRequest.encode(request).finish(); @@ -164,6 +167,11 @@ export class QueryClientImpl implements Query { const promise = this.rpc.request("osmosis.superfluid.Query", "UserConcentratedSuperfluidPositionsUndelegating", data); return promise.then(data => UserConcentratedSuperfluidPositionsUndelegatingResponse.decode(new BinaryReader(data))); } + restSupply(request: QueryRestSupplyRequest): Promise { + const data = QueryRestSupplyRequest.encode(request).finish(); + const promise = this.rpc.request("osmosis.superfluid.Query", "RestSupply", data); + return promise.then(data => QueryRestSupplyResponse.decode(new BinaryReader(data))); + } } export const createRpcQueryExtension = (base: QueryClient) => { const rpc = createProtobufRpcClient(base); @@ -219,6 +227,9 @@ export const createRpcQueryExtension = (base: QueryClient) => { }, userConcentratedSuperfluidPositionsUndelegating(request: UserConcentratedSuperfluidPositionsUndelegatingRequest): Promise { return queryService.userConcentratedSuperfluidPositionsUndelegating(request); + }, + restSupply(request: QueryRestSupplyRequest): Promise { + return queryService.restSupply(request); } }; }; @@ -273,6 +284,9 @@ export interface UseUserConcentratedSuperfluidPositionsDelegatedQuery ext export interface UseUserConcentratedSuperfluidPositionsUndelegatingQuery extends ReactQueryParams { request: UserConcentratedSuperfluidPositionsUndelegatingRequest; } +export interface UseRestSupplyQuery extends ReactQueryParams { + request: QueryRestSupplyRequest; +} const _queryClients: WeakMap = new WeakMap(); const getQueryService = (rpc: ProtobufRpcClient | undefined): QueryClientImpl | undefined => { if (!rpc) return; @@ -438,6 +452,15 @@ export const createRpcQueryHooks = (rpc: ProtobufRpcClient | undefined) => { return queryService.userConcentratedSuperfluidPositionsUndelegating(request); }, options); }; + const useRestSupply = ({ + request, + options + }: UseRestSupplyQuery) => { + return useQuery(["restSupplyQuery", request], () => { + if (!queryService) throw new Error("Query Service not initialized"); + return queryService.restSupply(request); + }, options); + }; return { /** Params returns the total set of superfluid parameters. */useParams, /** @@ -460,8 +483,8 @@ export const createRpcQueryHooks = (rpc: ProtobufRpcClient | undefined) => { * triplet */ useSuperfluidDelegationAmount, - /** Returns all the delegated superfluid poistions for a specific delegator. */useSuperfluidDelegationsByDelegator, - /** Returns all the undelegating superfluid poistions for a specific delegator. */useSuperfluidUndelegationsByDelegator, + /** Returns all the delegated superfluid positions for a specific delegator. */useSuperfluidDelegationsByDelegator, + /** Returns all the undelegating superfluid positions for a specific delegator. */useSuperfluidUndelegationsByDelegator, /** * Returns all the superfluid positions of a specific denom delegated to one * validator @@ -475,7 +498,8 @@ export const createRpcQueryHooks = (rpc: ProtobufRpcClient | undefined) => { useEstimateSuperfluidDelegatedAmountByValidatorDenom, /** Returns the specified delegations for a specific delegator */useTotalDelegationByDelegator, /** Returns a list of whitelisted pool ids to unpool. */useUnpoolWhitelist, - useUserConcentratedSuperfluidPositionsDelegated, - useUserConcentratedSuperfluidPositionsUndelegating + /** Returns all of a user's full range CL positions that are superfluid staked. */useUserConcentratedSuperfluidPositionsDelegated, + useUserConcentratedSuperfluidPositionsUndelegating, + useRestSupply }; }; \ No newline at end of file diff --git a/packages/osmo-query/src/codegen/osmosis/superfluid/query.ts b/packages/osmo-query/src/codegen/osmosis/superfluid/query.ts index 0fa773fe9..6835d04a0 100644 --- a/packages/osmo-query/src/codegen/osmosis/superfluid/query.ts +++ b/packages/osmo-query/src/codegen/osmosis/superfluid/query.ts @@ -1,11 +1,10 @@ import { PageRequest, PageRequestAmino, PageRequestSDKType, PageResponse, PageResponseAmino, PageResponseSDKType } from "../../cosmos/base/query/v1beta1/pagination"; import { Params, ParamsAmino, ParamsSDKType } from "./params"; -import { SuperfluidAssetType, SuperfluidAsset, SuperfluidAssetAmino, SuperfluidAssetSDKType, OsmoEquivalentMultiplierRecord, OsmoEquivalentMultiplierRecordAmino, OsmoEquivalentMultiplierRecordSDKType, SuperfluidDelegationRecord, SuperfluidDelegationRecordAmino, SuperfluidDelegationRecordSDKType, ConcentratedPoolUserPositionRecord, ConcentratedPoolUserPositionRecordAmino, ConcentratedPoolUserPositionRecordSDKType, superfluidAssetTypeFromJSON } from "./superfluid"; +import { SuperfluidAssetType, SuperfluidAsset, SuperfluidAssetAmino, SuperfluidAssetSDKType, OsmoEquivalentMultiplierRecord, OsmoEquivalentMultiplierRecordAmino, OsmoEquivalentMultiplierRecordSDKType, SuperfluidDelegationRecord, SuperfluidDelegationRecordAmino, SuperfluidDelegationRecordSDKType, ConcentratedPoolUserPositionRecord, ConcentratedPoolUserPositionRecordAmino, ConcentratedPoolUserPositionRecordSDKType, superfluidAssetTypeFromJSON, superfluidAssetTypeToJSON } from "./superfluid"; import { Coin, CoinAmino, CoinSDKType } from "../../cosmos/base/v1beta1/coin"; import { SyntheticLock, SyntheticLockAmino, SyntheticLockSDKType } from "../lockup/lock"; import { DelegationResponse, DelegationResponseAmino, DelegationResponseSDKType } from "../../cosmos/staking/v1beta1/staking"; import { BinaryReader, BinaryWriter } from "../../binary"; -import { isSet } from "../../helpers"; export interface QueryParamsRequest {} export interface QueryParamsRequestProtoMsg { typeUrl: "/osmosis.superfluid.QueryParamsRequest"; @@ -44,7 +43,7 @@ export interface AssetTypeRequestProtoMsg { value: Uint8Array; } export interface AssetTypeRequestAmino { - denom: string; + denom?: string; } export interface AssetTypeRequestAminoMsg { type: "osmosis/asset-type-request"; @@ -61,7 +60,7 @@ export interface AssetTypeResponseProtoMsg { value: Uint8Array; } export interface AssetTypeResponseAmino { - asset_type: SuperfluidAssetType; + asset_type?: SuperfluidAssetType; } export interface AssetTypeResponseAminoMsg { type: "osmosis/asset-type-response"; @@ -89,7 +88,7 @@ export interface AllAssetsResponseProtoMsg { value: Uint8Array; } export interface AllAssetsResponseAmino { - assets: SuperfluidAssetAmino[]; + assets?: SuperfluidAssetAmino[]; } export interface AllAssetsResponseAminoMsg { type: "osmosis/all-assets-response"; @@ -106,7 +105,7 @@ export interface AssetMultiplierRequestProtoMsg { value: Uint8Array; } export interface AssetMultiplierRequestAmino { - denom: string; + denom?: string; } export interface AssetMultiplierRequestAminoMsg { type: "osmosis/asset-multiplier-request"; @@ -116,7 +115,7 @@ export interface AssetMultiplierRequestSDKType { denom: string; } export interface AssetMultiplierResponse { - osmoEquivalentMultiplier: OsmoEquivalentMultiplierRecord; + osmoEquivalentMultiplier?: OsmoEquivalentMultiplierRecord; } export interface AssetMultiplierResponseProtoMsg { typeUrl: "/osmosis.superfluid.AssetMultiplierResponse"; @@ -130,7 +129,7 @@ export interface AssetMultiplierResponseAminoMsg { value: AssetMultiplierResponseAmino; } export interface AssetMultiplierResponseSDKType { - osmo_equivalent_multiplier: OsmoEquivalentMultiplierRecordSDKType; + osmo_equivalent_multiplier?: OsmoEquivalentMultiplierRecordSDKType; } export interface SuperfluidIntermediaryAccountInfo { denom: string; @@ -143,10 +142,10 @@ export interface SuperfluidIntermediaryAccountInfoProtoMsg { value: Uint8Array; } export interface SuperfluidIntermediaryAccountInfoAmino { - denom: string; - val_addr: string; - gauge_id: string; - address: string; + denom?: string; + val_addr?: string; + gauge_id?: string; + address?: string; } export interface SuperfluidIntermediaryAccountInfoAminoMsg { type: "osmosis/superfluid-intermediary-account-info"; @@ -159,7 +158,7 @@ export interface SuperfluidIntermediaryAccountInfoSDKType { address: string; } export interface AllIntermediaryAccountsRequest { - pagination: PageRequest; + pagination?: PageRequest; } export interface AllIntermediaryAccountsRequestProtoMsg { typeUrl: "/osmosis.superfluid.AllIntermediaryAccountsRequest"; @@ -173,18 +172,18 @@ export interface AllIntermediaryAccountsRequestAminoMsg { value: AllIntermediaryAccountsRequestAmino; } export interface AllIntermediaryAccountsRequestSDKType { - pagination: PageRequestSDKType; + pagination?: PageRequestSDKType; } export interface AllIntermediaryAccountsResponse { accounts: SuperfluidIntermediaryAccountInfo[]; - pagination: PageResponse; + pagination?: PageResponse; } export interface AllIntermediaryAccountsResponseProtoMsg { typeUrl: "/osmosis.superfluid.AllIntermediaryAccountsResponse"; value: Uint8Array; } export interface AllIntermediaryAccountsResponseAmino { - accounts: SuperfluidIntermediaryAccountInfoAmino[]; + accounts?: SuperfluidIntermediaryAccountInfoAmino[]; pagination?: PageResponseAmino; } export interface AllIntermediaryAccountsResponseAminoMsg { @@ -193,7 +192,7 @@ export interface AllIntermediaryAccountsResponseAminoMsg { } export interface AllIntermediaryAccountsResponseSDKType { accounts: SuperfluidIntermediaryAccountInfoSDKType[]; - pagination: PageResponseSDKType; + pagination?: PageResponseSDKType; } export interface ConnectedIntermediaryAccountRequest { lockId: bigint; @@ -203,7 +202,7 @@ export interface ConnectedIntermediaryAccountRequestProtoMsg { value: Uint8Array; } export interface ConnectedIntermediaryAccountRequestAmino { - lock_id: string; + lock_id?: string; } export interface ConnectedIntermediaryAccountRequestAminoMsg { type: "osmosis/connected-intermediary-account-request"; @@ -213,7 +212,7 @@ export interface ConnectedIntermediaryAccountRequestSDKType { lock_id: bigint; } export interface ConnectedIntermediaryAccountResponse { - account: SuperfluidIntermediaryAccountInfo; + account?: SuperfluidIntermediaryAccountInfo; } export interface ConnectedIntermediaryAccountResponseProtoMsg { typeUrl: "/osmosis.superfluid.ConnectedIntermediaryAccountResponse"; @@ -227,7 +226,7 @@ export interface ConnectedIntermediaryAccountResponseAminoMsg { value: ConnectedIntermediaryAccountResponseAmino; } export interface ConnectedIntermediaryAccountResponseSDKType { - account: SuperfluidIntermediaryAccountInfoSDKType; + account?: SuperfluidIntermediaryAccountInfoSDKType; } export interface QueryTotalDelegationByValidatorForDenomRequest { denom: string; @@ -237,7 +236,7 @@ export interface QueryTotalDelegationByValidatorForDenomRequestProtoMsg { value: Uint8Array; } export interface QueryTotalDelegationByValidatorForDenomRequestAmino { - denom: string; + denom?: string; } export interface QueryTotalDelegationByValidatorForDenomRequestAminoMsg { type: "osmosis/query-total-delegation-by-validator-for-denom-request"; @@ -254,7 +253,7 @@ export interface QueryTotalDelegationByValidatorForDenomResponseProtoMsg { value: Uint8Array; } export interface QueryTotalDelegationByValidatorForDenomResponseAmino { - assets: DelegationsAmino[]; + assets?: DelegationsAmino[]; } export interface QueryTotalDelegationByValidatorForDenomResponseAminoMsg { type: "osmosis/query-total-delegation-by-validator-for-denom-response"; @@ -273,9 +272,9 @@ export interface DelegationsProtoMsg { value: Uint8Array; } export interface DelegationsAmino { - val_addr: string; - amount_sfsd: string; - osmo_equivalent: string; + val_addr?: string; + amount_sfsd?: string; + osmo_equivalent?: string; } export interface DelegationsAminoMsg { type: "osmosis/delegations"; @@ -305,7 +304,7 @@ export interface TotalSuperfluidDelegationsResponseProtoMsg { value: Uint8Array; } export interface TotalSuperfluidDelegationsResponseAmino { - total_delegations: string; + total_delegations?: string; } export interface TotalSuperfluidDelegationsResponseAminoMsg { type: "osmosis/total-superfluid-delegations-response"; @@ -324,9 +323,9 @@ export interface SuperfluidDelegationAmountRequestProtoMsg { value: Uint8Array; } export interface SuperfluidDelegationAmountRequestAmino { - delegator_address: string; - validator_address: string; - denom: string; + delegator_address?: string; + validator_address?: string; + denom?: string; } export interface SuperfluidDelegationAmountRequestAminoMsg { type: "osmosis/superfluid-delegation-amount-request"; @@ -345,7 +344,7 @@ export interface SuperfluidDelegationAmountResponseProtoMsg { value: Uint8Array; } export interface SuperfluidDelegationAmountResponseAmino { - amount: CoinAmino[]; + amount?: CoinAmino[]; } export interface SuperfluidDelegationAmountResponseAminoMsg { type: "osmosis/superfluid-delegation-amount-response"; @@ -362,7 +361,7 @@ export interface SuperfluidDelegationsByDelegatorRequestProtoMsg { value: Uint8Array; } export interface SuperfluidDelegationsByDelegatorRequestAmino { - delegator_address: string; + delegator_address?: string; } export interface SuperfluidDelegationsByDelegatorRequestAminoMsg { type: "osmosis/superfluid-delegations-by-delegator-request"; @@ -381,8 +380,8 @@ export interface SuperfluidDelegationsByDelegatorResponseProtoMsg { value: Uint8Array; } export interface SuperfluidDelegationsByDelegatorResponseAmino { - superfluid_delegation_records: SuperfluidDelegationRecordAmino[]; - total_delegated_coins: CoinAmino[]; + superfluid_delegation_records?: SuperfluidDelegationRecordAmino[]; + total_delegated_coins?: CoinAmino[]; total_equivalent_staked_amount?: CoinAmino; } export interface SuperfluidDelegationsByDelegatorResponseAminoMsg { @@ -403,8 +402,8 @@ export interface SuperfluidUndelegationsByDelegatorRequestProtoMsg { value: Uint8Array; } export interface SuperfluidUndelegationsByDelegatorRequestAmino { - delegator_address: string; - denom: string; + delegator_address?: string; + denom?: string; } export interface SuperfluidUndelegationsByDelegatorRequestAminoMsg { type: "osmosis/superfluid-undelegations-by-delegator-request"; @@ -424,9 +423,9 @@ export interface SuperfluidUndelegationsByDelegatorResponseProtoMsg { value: Uint8Array; } export interface SuperfluidUndelegationsByDelegatorResponseAmino { - superfluid_delegation_records: SuperfluidDelegationRecordAmino[]; - total_undelegated_coins: CoinAmino[]; - synthetic_locks: SyntheticLockAmino[]; + superfluid_delegation_records?: SuperfluidDelegationRecordAmino[]; + total_undelegated_coins?: CoinAmino[]; + synthetic_locks?: SyntheticLockAmino[]; } export interface SuperfluidUndelegationsByDelegatorResponseAminoMsg { type: "osmosis/superfluid-undelegations-by-delegator-response"; @@ -446,8 +445,8 @@ export interface SuperfluidDelegationsByValidatorDenomRequestProtoMsg { value: Uint8Array; } export interface SuperfluidDelegationsByValidatorDenomRequestAmino { - validator_address: string; - denom: string; + validator_address?: string; + denom?: string; } export interface SuperfluidDelegationsByValidatorDenomRequestAminoMsg { type: "osmosis/superfluid-delegations-by-validator-denom-request"; @@ -465,7 +464,7 @@ export interface SuperfluidDelegationsByValidatorDenomResponseProtoMsg { value: Uint8Array; } export interface SuperfluidDelegationsByValidatorDenomResponseAmino { - superfluid_delegation_records: SuperfluidDelegationRecordAmino[]; + superfluid_delegation_records?: SuperfluidDelegationRecordAmino[]; } export interface SuperfluidDelegationsByValidatorDenomResponseAminoMsg { type: "osmosis/superfluid-delegations-by-validator-denom-response"; @@ -483,8 +482,8 @@ export interface EstimateSuperfluidDelegatedAmountByValidatorDenomRequestProtoMs value: Uint8Array; } export interface EstimateSuperfluidDelegatedAmountByValidatorDenomRequestAmino { - validator_address: string; - denom: string; + validator_address?: string; + denom?: string; } export interface EstimateSuperfluidDelegatedAmountByValidatorDenomRequestAminoMsg { type: "osmosis/estimate-superfluid-delegated-amount-by-validator-denom-request"; @@ -502,7 +501,7 @@ export interface EstimateSuperfluidDelegatedAmountByValidatorDenomResponseProtoM value: Uint8Array; } export interface EstimateSuperfluidDelegatedAmountByValidatorDenomResponseAmino { - total_delegated_coins: CoinAmino[]; + total_delegated_coins?: CoinAmino[]; } export interface EstimateSuperfluidDelegatedAmountByValidatorDenomResponseAminoMsg { type: "osmosis/estimate-superfluid-delegated-amount-by-validator-denom-response"; @@ -519,7 +518,7 @@ export interface QueryTotalDelegationByDelegatorRequestProtoMsg { value: Uint8Array; } export interface QueryTotalDelegationByDelegatorRequestAmino { - delegator_address: string; + delegator_address?: string; } export interface QueryTotalDelegationByDelegatorRequestAminoMsg { type: "osmosis/query-total-delegation-by-delegator-request"; @@ -539,9 +538,9 @@ export interface QueryTotalDelegationByDelegatorResponseProtoMsg { value: Uint8Array; } export interface QueryTotalDelegationByDelegatorResponseAmino { - superfluid_delegation_records: SuperfluidDelegationRecordAmino[]; - delegation_response: DelegationResponseAmino[]; - total_delegated_coins: CoinAmino[]; + superfluid_delegation_records?: SuperfluidDelegationRecordAmino[]; + delegation_response?: DelegationResponseAmino[]; + total_delegated_coins?: CoinAmino[]; total_equivalent_staked_amount?: CoinAmino; } export interface QueryTotalDelegationByDelegatorResponseAminoMsg { @@ -573,7 +572,7 @@ export interface QueryUnpoolWhitelistResponseProtoMsg { value: Uint8Array; } export interface QueryUnpoolWhitelistResponseAmino { - pool_ids: string[]; + pool_ids?: string[]; } export interface QueryUnpoolWhitelistResponseAminoMsg { type: "osmosis/query-unpool-whitelist-response"; @@ -590,7 +589,7 @@ export interface UserConcentratedSuperfluidPositionsDelegatedRequestProtoMsg { value: Uint8Array; } export interface UserConcentratedSuperfluidPositionsDelegatedRequestAmino { - delegator_address: string; + delegator_address?: string; } export interface UserConcentratedSuperfluidPositionsDelegatedRequestAminoMsg { type: "osmosis/user-concentrated-superfluid-positions-delegated-request"; @@ -607,7 +606,7 @@ export interface UserConcentratedSuperfluidPositionsDelegatedResponseProtoMsg { value: Uint8Array; } export interface UserConcentratedSuperfluidPositionsDelegatedResponseAmino { - cl_pool_user_position_records: ConcentratedPoolUserPositionRecordAmino[]; + cl_pool_user_position_records?: ConcentratedPoolUserPositionRecordAmino[]; } export interface UserConcentratedSuperfluidPositionsDelegatedResponseAminoMsg { type: "osmosis/user-concentrated-superfluid-positions-delegated-response"; @@ -624,7 +623,7 @@ export interface UserConcentratedSuperfluidPositionsUndelegatingRequestProtoMsg value: Uint8Array; } export interface UserConcentratedSuperfluidPositionsUndelegatingRequestAmino { - delegator_address: string; + delegator_address?: string; } export interface UserConcentratedSuperfluidPositionsUndelegatingRequestAminoMsg { type: "osmosis/user-concentrated-superfluid-positions-undelegating-request"; @@ -641,7 +640,7 @@ export interface UserConcentratedSuperfluidPositionsUndelegatingResponseProtoMsg value: Uint8Array; } export interface UserConcentratedSuperfluidPositionsUndelegatingResponseAmino { - cl_pool_user_position_records: ConcentratedPoolUserPositionRecordAmino[]; + cl_pool_user_position_records?: ConcentratedPoolUserPositionRecordAmino[]; } export interface UserConcentratedSuperfluidPositionsUndelegatingResponseAminoMsg { type: "osmosis/user-concentrated-superfluid-positions-undelegating-response"; @@ -650,6 +649,47 @@ export interface UserConcentratedSuperfluidPositionsUndelegatingResponseAminoMsg export interface UserConcentratedSuperfluidPositionsUndelegatingResponseSDKType { cl_pool_user_position_records: ConcentratedPoolUserPositionRecordSDKType[]; } +/** THIS QUERY IS TEMPORARY */ +export interface QueryRestSupplyRequest { + /** THIS QUERY IS TEMPORARY */ + denom: string; +} +export interface QueryRestSupplyRequestProtoMsg { + typeUrl: "/osmosis.superfluid.QueryRestSupplyRequest"; + value: Uint8Array; +} +/** THIS QUERY IS TEMPORARY */ +export interface QueryRestSupplyRequestAmino { + /** THIS QUERY IS TEMPORARY */ + denom?: string; +} +export interface QueryRestSupplyRequestAminoMsg { + type: "osmosis/query-rest-supply-request"; + value: QueryRestSupplyRequestAmino; +} +/** THIS QUERY IS TEMPORARY */ +export interface QueryRestSupplyRequestSDKType { + denom: string; +} +export interface QueryRestSupplyResponse { + /** amount is the supply of the coin. */ + amount: Coin; +} +export interface QueryRestSupplyResponseProtoMsg { + typeUrl: "/osmosis.superfluid.QueryRestSupplyResponse"; + value: Uint8Array; +} +export interface QueryRestSupplyResponseAmino { + /** amount is the supply of the coin. */ + amount?: CoinAmino; +} +export interface QueryRestSupplyResponseAminoMsg { + type: "osmosis/query-rest-supply-response"; + value: QueryRestSupplyResponseAmino; +} +export interface QueryRestSupplyResponseSDKType { + amount: CoinSDKType; +} function createBaseQueryParamsRequest(): QueryParamsRequest { return {}; } @@ -677,7 +717,8 @@ export const QueryParamsRequest = { return message; }, fromAmino(_: QueryParamsRequestAmino): QueryParamsRequest { - return {}; + const message = createBaseQueryParamsRequest(); + return message; }, toAmino(_: QueryParamsRequest): QueryParamsRequestAmino { const obj: any = {}; @@ -741,9 +782,11 @@ export const QueryParamsResponse = { return message; }, fromAmino(object: QueryParamsResponseAmino): QueryParamsResponse { - return { - params: object?.params ? Params.fromAmino(object.params) : undefined - }; + const message = createBaseQueryParamsResponse(); + if (object.params !== undefined && object.params !== null) { + message.params = Params.fromAmino(object.params); + } + return message; }, toAmino(message: QueryParamsResponse): QueryParamsResponseAmino { const obj: any = {}; @@ -808,9 +851,11 @@ export const AssetTypeRequest = { return message; }, fromAmino(object: AssetTypeRequestAmino): AssetTypeRequest { - return { - denom: object.denom - }; + const message = createBaseAssetTypeRequest(); + if (object.denom !== undefined && object.denom !== null) { + message.denom = object.denom; + } + return message; }, toAmino(message: AssetTypeRequest): AssetTypeRequestAmino { const obj: any = {}; @@ -875,13 +920,15 @@ export const AssetTypeResponse = { return message; }, fromAmino(object: AssetTypeResponseAmino): AssetTypeResponse { - return { - assetType: isSet(object.asset_type) ? superfluidAssetTypeFromJSON(object.asset_type) : -1 - }; + const message = createBaseAssetTypeResponse(); + if (object.asset_type !== undefined && object.asset_type !== null) { + message.assetType = superfluidAssetTypeFromJSON(object.asset_type); + } + return message; }, toAmino(message: AssetTypeResponse): AssetTypeResponseAmino { const obj: any = {}; - obj.asset_type = message.assetType; + obj.asset_type = superfluidAssetTypeToJSON(message.assetType); return obj; }, fromAminoMsg(object: AssetTypeResponseAminoMsg): AssetTypeResponse { @@ -933,7 +980,8 @@ export const AllAssetsRequest = { return message; }, fromAmino(_: AllAssetsRequestAmino): AllAssetsRequest { - return {}; + const message = createBaseAllAssetsRequest(); + return message; }, toAmino(_: AllAssetsRequest): AllAssetsRequestAmino { const obj: any = {}; @@ -997,9 +1045,9 @@ export const AllAssetsResponse = { return message; }, fromAmino(object: AllAssetsResponseAmino): AllAssetsResponse { - return { - assets: Array.isArray(object?.assets) ? object.assets.map((e: any) => SuperfluidAsset.fromAmino(e)) : [] - }; + const message = createBaseAllAssetsResponse(); + message.assets = object.assets?.map(e => SuperfluidAsset.fromAmino(e)) || []; + return message; }, toAmino(message: AllAssetsResponse): AllAssetsResponseAmino { const obj: any = {}; @@ -1068,9 +1116,11 @@ export const AssetMultiplierRequest = { return message; }, fromAmino(object: AssetMultiplierRequestAmino): AssetMultiplierRequest { - return { - denom: object.denom - }; + const message = createBaseAssetMultiplierRequest(); + if (object.denom !== undefined && object.denom !== null) { + message.denom = object.denom; + } + return message; }, toAmino(message: AssetMultiplierRequest): AssetMultiplierRequestAmino { const obj: any = {}; @@ -1101,7 +1151,7 @@ export const AssetMultiplierRequest = { }; function createBaseAssetMultiplierResponse(): AssetMultiplierResponse { return { - osmoEquivalentMultiplier: OsmoEquivalentMultiplierRecord.fromPartial({}) + osmoEquivalentMultiplier: undefined }; } export const AssetMultiplierResponse = { @@ -1135,9 +1185,11 @@ export const AssetMultiplierResponse = { return message; }, fromAmino(object: AssetMultiplierResponseAmino): AssetMultiplierResponse { - return { - osmoEquivalentMultiplier: object?.osmo_equivalent_multiplier ? OsmoEquivalentMultiplierRecord.fromAmino(object.osmo_equivalent_multiplier) : undefined - }; + const message = createBaseAssetMultiplierResponse(); + if (object.osmo_equivalent_multiplier !== undefined && object.osmo_equivalent_multiplier !== null) { + message.osmoEquivalentMultiplier = OsmoEquivalentMultiplierRecord.fromAmino(object.osmo_equivalent_multiplier); + } + return message; }, toAmino(message: AssetMultiplierResponse): AssetMultiplierResponseAmino { const obj: any = {}; @@ -1226,12 +1278,20 @@ export const SuperfluidIntermediaryAccountInfo = { return message; }, fromAmino(object: SuperfluidIntermediaryAccountInfoAmino): SuperfluidIntermediaryAccountInfo { - return { - denom: object.denom, - valAddr: object.val_addr, - gaugeId: BigInt(object.gauge_id), - address: object.address - }; + const message = createBaseSuperfluidIntermediaryAccountInfo(); + if (object.denom !== undefined && object.denom !== null) { + message.denom = object.denom; + } + if (object.val_addr !== undefined && object.val_addr !== null) { + message.valAddr = object.val_addr; + } + if (object.gauge_id !== undefined && object.gauge_id !== null) { + message.gaugeId = BigInt(object.gauge_id); + } + if (object.address !== undefined && object.address !== null) { + message.address = object.address; + } + return message; }, toAmino(message: SuperfluidIntermediaryAccountInfo): SuperfluidIntermediaryAccountInfoAmino { const obj: any = {}; @@ -1265,7 +1325,7 @@ export const SuperfluidIntermediaryAccountInfo = { }; function createBaseAllIntermediaryAccountsRequest(): AllIntermediaryAccountsRequest { return { - pagination: PageRequest.fromPartial({}) + pagination: undefined }; } export const AllIntermediaryAccountsRequest = { @@ -1299,9 +1359,11 @@ export const AllIntermediaryAccountsRequest = { return message; }, fromAmino(object: AllIntermediaryAccountsRequestAmino): AllIntermediaryAccountsRequest { - return { - pagination: object?.pagination ? PageRequest.fromAmino(object.pagination) : undefined - }; + const message = createBaseAllIntermediaryAccountsRequest(); + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromAmino(object.pagination); + } + return message; }, toAmino(message: AllIntermediaryAccountsRequest): AllIntermediaryAccountsRequestAmino { const obj: any = {}; @@ -1333,7 +1395,7 @@ export const AllIntermediaryAccountsRequest = { function createBaseAllIntermediaryAccountsResponse(): AllIntermediaryAccountsResponse { return { accounts: [], - pagination: PageResponse.fromPartial({}) + pagination: undefined }; } export const AllIntermediaryAccountsResponse = { @@ -1374,10 +1436,12 @@ export const AllIntermediaryAccountsResponse = { return message; }, fromAmino(object: AllIntermediaryAccountsResponseAmino): AllIntermediaryAccountsResponse { - return { - accounts: Array.isArray(object?.accounts) ? object.accounts.map((e: any) => SuperfluidIntermediaryAccountInfo.fromAmino(e)) : [], - pagination: object?.pagination ? PageResponse.fromAmino(object.pagination) : undefined - }; + const message = createBaseAllIntermediaryAccountsResponse(); + message.accounts = object.accounts?.map(e => SuperfluidIntermediaryAccountInfo.fromAmino(e)) || []; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromAmino(object.pagination); + } + return message; }, toAmino(message: AllIntermediaryAccountsResponse): AllIntermediaryAccountsResponseAmino { const obj: any = {}; @@ -1447,9 +1511,11 @@ export const ConnectedIntermediaryAccountRequest = { return message; }, fromAmino(object: ConnectedIntermediaryAccountRequestAmino): ConnectedIntermediaryAccountRequest { - return { - lockId: BigInt(object.lock_id) - }; + const message = createBaseConnectedIntermediaryAccountRequest(); + if (object.lock_id !== undefined && object.lock_id !== null) { + message.lockId = BigInt(object.lock_id); + } + return message; }, toAmino(message: ConnectedIntermediaryAccountRequest): ConnectedIntermediaryAccountRequestAmino { const obj: any = {}; @@ -1480,7 +1546,7 @@ export const ConnectedIntermediaryAccountRequest = { }; function createBaseConnectedIntermediaryAccountResponse(): ConnectedIntermediaryAccountResponse { return { - account: SuperfluidIntermediaryAccountInfo.fromPartial({}) + account: undefined }; } export const ConnectedIntermediaryAccountResponse = { @@ -1514,9 +1580,11 @@ export const ConnectedIntermediaryAccountResponse = { return message; }, fromAmino(object: ConnectedIntermediaryAccountResponseAmino): ConnectedIntermediaryAccountResponse { - return { - account: object?.account ? SuperfluidIntermediaryAccountInfo.fromAmino(object.account) : undefined - }; + const message = createBaseConnectedIntermediaryAccountResponse(); + if (object.account !== undefined && object.account !== null) { + message.account = SuperfluidIntermediaryAccountInfo.fromAmino(object.account); + } + return message; }, toAmino(message: ConnectedIntermediaryAccountResponse): ConnectedIntermediaryAccountResponseAmino { const obj: any = {}; @@ -1581,9 +1649,11 @@ export const QueryTotalDelegationByValidatorForDenomRequest = { return message; }, fromAmino(object: QueryTotalDelegationByValidatorForDenomRequestAmino): QueryTotalDelegationByValidatorForDenomRequest { - return { - denom: object.denom - }; + const message = createBaseQueryTotalDelegationByValidatorForDenomRequest(); + if (object.denom !== undefined && object.denom !== null) { + message.denom = object.denom; + } + return message; }, toAmino(message: QueryTotalDelegationByValidatorForDenomRequest): QueryTotalDelegationByValidatorForDenomRequestAmino { const obj: any = {}; @@ -1648,9 +1718,9 @@ export const QueryTotalDelegationByValidatorForDenomResponse = { return message; }, fromAmino(object: QueryTotalDelegationByValidatorForDenomResponseAmino): QueryTotalDelegationByValidatorForDenomResponse { - return { - assets: Array.isArray(object?.assets) ? object.assets.map((e: any) => Delegations.fromAmino(e)) : [] - }; + const message = createBaseQueryTotalDelegationByValidatorForDenomResponse(); + message.assets = object.assets?.map(e => Delegations.fromAmino(e)) || []; + return message; }, toAmino(message: QueryTotalDelegationByValidatorForDenomResponse): QueryTotalDelegationByValidatorForDenomResponseAmino { const obj: any = {}; @@ -1735,11 +1805,17 @@ export const Delegations = { return message; }, fromAmino(object: DelegationsAmino): Delegations { - return { - valAddr: object.val_addr, - amountSfsd: object.amount_sfsd, - osmoEquivalent: object.osmo_equivalent - }; + const message = createBaseDelegations(); + if (object.val_addr !== undefined && object.val_addr !== null) { + message.valAddr = object.val_addr; + } + if (object.amount_sfsd !== undefined && object.amount_sfsd !== null) { + message.amountSfsd = object.amount_sfsd; + } + if (object.osmo_equivalent !== undefined && object.osmo_equivalent !== null) { + message.osmoEquivalent = object.osmo_equivalent; + } + return message; }, toAmino(message: Delegations): DelegationsAmino { const obj: any = {}; @@ -1797,7 +1873,8 @@ export const TotalSuperfluidDelegationsRequest = { return message; }, fromAmino(_: TotalSuperfluidDelegationsRequestAmino): TotalSuperfluidDelegationsRequest { - return {}; + const message = createBaseTotalSuperfluidDelegationsRequest(); + return message; }, toAmino(_: TotalSuperfluidDelegationsRequest): TotalSuperfluidDelegationsRequestAmino { const obj: any = {}; @@ -1861,9 +1938,11 @@ export const TotalSuperfluidDelegationsResponse = { return message; }, fromAmino(object: TotalSuperfluidDelegationsResponseAmino): TotalSuperfluidDelegationsResponse { - return { - totalDelegations: object.total_delegations - }; + const message = createBaseTotalSuperfluidDelegationsResponse(); + if (object.total_delegations !== undefined && object.total_delegations !== null) { + message.totalDelegations = object.total_delegations; + } + return message; }, toAmino(message: TotalSuperfluidDelegationsResponse): TotalSuperfluidDelegationsResponseAmino { const obj: any = {}; @@ -1944,11 +2023,17 @@ export const SuperfluidDelegationAmountRequest = { return message; }, fromAmino(object: SuperfluidDelegationAmountRequestAmino): SuperfluidDelegationAmountRequest { - return { - delegatorAddress: object.delegator_address, - validatorAddress: object.validator_address, - denom: object.denom - }; + const message = createBaseSuperfluidDelegationAmountRequest(); + if (object.delegator_address !== undefined && object.delegator_address !== null) { + message.delegatorAddress = object.delegator_address; + } + if (object.validator_address !== undefined && object.validator_address !== null) { + message.validatorAddress = object.validator_address; + } + if (object.denom !== undefined && object.denom !== null) { + message.denom = object.denom; + } + return message; }, toAmino(message: SuperfluidDelegationAmountRequest): SuperfluidDelegationAmountRequestAmino { const obj: any = {}; @@ -2015,9 +2100,9 @@ export const SuperfluidDelegationAmountResponse = { return message; }, fromAmino(object: SuperfluidDelegationAmountResponseAmino): SuperfluidDelegationAmountResponse { - return { - amount: Array.isArray(object?.amount) ? object.amount.map((e: any) => Coin.fromAmino(e)) : [] - }; + const message = createBaseSuperfluidDelegationAmountResponse(); + message.amount = object.amount?.map(e => Coin.fromAmino(e)) || []; + return message; }, toAmino(message: SuperfluidDelegationAmountResponse): SuperfluidDelegationAmountResponseAmino { const obj: any = {}; @@ -2086,9 +2171,11 @@ export const SuperfluidDelegationsByDelegatorRequest = { return message; }, fromAmino(object: SuperfluidDelegationsByDelegatorRequestAmino): SuperfluidDelegationsByDelegatorRequest { - return { - delegatorAddress: object.delegator_address - }; + const message = createBaseSuperfluidDelegationsByDelegatorRequest(); + if (object.delegator_address !== undefined && object.delegator_address !== null) { + message.delegatorAddress = object.delegator_address; + } + return message; }, toAmino(message: SuperfluidDelegationsByDelegatorRequest): SuperfluidDelegationsByDelegatorRequestAmino { const obj: any = {}; @@ -2169,11 +2256,13 @@ export const SuperfluidDelegationsByDelegatorResponse = { return message; }, fromAmino(object: SuperfluidDelegationsByDelegatorResponseAmino): SuperfluidDelegationsByDelegatorResponse { - return { - superfluidDelegationRecords: Array.isArray(object?.superfluid_delegation_records) ? object.superfluid_delegation_records.map((e: any) => SuperfluidDelegationRecord.fromAmino(e)) : [], - totalDelegatedCoins: Array.isArray(object?.total_delegated_coins) ? object.total_delegated_coins.map((e: any) => Coin.fromAmino(e)) : [], - totalEquivalentStakedAmount: object?.total_equivalent_staked_amount ? Coin.fromAmino(object.total_equivalent_staked_amount) : undefined - }; + const message = createBaseSuperfluidDelegationsByDelegatorResponse(); + message.superfluidDelegationRecords = object.superfluid_delegation_records?.map(e => SuperfluidDelegationRecord.fromAmino(e)) || []; + message.totalDelegatedCoins = object.total_delegated_coins?.map(e => Coin.fromAmino(e)) || []; + if (object.total_equivalent_staked_amount !== undefined && object.total_equivalent_staked_amount !== null) { + message.totalEquivalentStakedAmount = Coin.fromAmino(object.total_equivalent_staked_amount); + } + return message; }, toAmino(message: SuperfluidDelegationsByDelegatorResponse): SuperfluidDelegationsByDelegatorResponseAmino { const obj: any = {}; @@ -2256,10 +2345,14 @@ export const SuperfluidUndelegationsByDelegatorRequest = { return message; }, fromAmino(object: SuperfluidUndelegationsByDelegatorRequestAmino): SuperfluidUndelegationsByDelegatorRequest { - return { - delegatorAddress: object.delegator_address, - denom: object.denom - }; + const message = createBaseSuperfluidUndelegationsByDelegatorRequest(); + if (object.delegator_address !== undefined && object.delegator_address !== null) { + message.delegatorAddress = object.delegator_address; + } + if (object.denom !== undefined && object.denom !== null) { + message.denom = object.denom; + } + return message; }, toAmino(message: SuperfluidUndelegationsByDelegatorRequest): SuperfluidUndelegationsByDelegatorRequestAmino { const obj: any = {}; @@ -2341,11 +2434,11 @@ export const SuperfluidUndelegationsByDelegatorResponse = { return message; }, fromAmino(object: SuperfluidUndelegationsByDelegatorResponseAmino): SuperfluidUndelegationsByDelegatorResponse { - return { - superfluidDelegationRecords: Array.isArray(object?.superfluid_delegation_records) ? object.superfluid_delegation_records.map((e: any) => SuperfluidDelegationRecord.fromAmino(e)) : [], - totalUndelegatedCoins: Array.isArray(object?.total_undelegated_coins) ? object.total_undelegated_coins.map((e: any) => Coin.fromAmino(e)) : [], - syntheticLocks: Array.isArray(object?.synthetic_locks) ? object.synthetic_locks.map((e: any) => SyntheticLock.fromAmino(e)) : [] - }; + const message = createBaseSuperfluidUndelegationsByDelegatorResponse(); + message.superfluidDelegationRecords = object.superfluid_delegation_records?.map(e => SuperfluidDelegationRecord.fromAmino(e)) || []; + message.totalUndelegatedCoins = object.total_undelegated_coins?.map(e => Coin.fromAmino(e)) || []; + message.syntheticLocks = object.synthetic_locks?.map(e => SyntheticLock.fromAmino(e)) || []; + return message; }, toAmino(message: SuperfluidUndelegationsByDelegatorResponse): SuperfluidUndelegationsByDelegatorResponseAmino { const obj: any = {}; @@ -2432,10 +2525,14 @@ export const SuperfluidDelegationsByValidatorDenomRequest = { return message; }, fromAmino(object: SuperfluidDelegationsByValidatorDenomRequestAmino): SuperfluidDelegationsByValidatorDenomRequest { - return { - validatorAddress: object.validator_address, - denom: object.denom - }; + const message = createBaseSuperfluidDelegationsByValidatorDenomRequest(); + if (object.validator_address !== undefined && object.validator_address !== null) { + message.validatorAddress = object.validator_address; + } + if (object.denom !== undefined && object.denom !== null) { + message.denom = object.denom; + } + return message; }, toAmino(message: SuperfluidDelegationsByValidatorDenomRequest): SuperfluidDelegationsByValidatorDenomRequestAmino { const obj: any = {}; @@ -2501,9 +2598,9 @@ export const SuperfluidDelegationsByValidatorDenomResponse = { return message; }, fromAmino(object: SuperfluidDelegationsByValidatorDenomResponseAmino): SuperfluidDelegationsByValidatorDenomResponse { - return { - superfluidDelegationRecords: Array.isArray(object?.superfluid_delegation_records) ? object.superfluid_delegation_records.map((e: any) => SuperfluidDelegationRecord.fromAmino(e)) : [] - }; + const message = createBaseSuperfluidDelegationsByValidatorDenomResponse(); + message.superfluidDelegationRecords = object.superfluid_delegation_records?.map(e => SuperfluidDelegationRecord.fromAmino(e)) || []; + return message; }, toAmino(message: SuperfluidDelegationsByValidatorDenomResponse): SuperfluidDelegationsByValidatorDenomResponseAmino { const obj: any = {}; @@ -2580,10 +2677,14 @@ export const EstimateSuperfluidDelegatedAmountByValidatorDenomRequest = { return message; }, fromAmino(object: EstimateSuperfluidDelegatedAmountByValidatorDenomRequestAmino): EstimateSuperfluidDelegatedAmountByValidatorDenomRequest { - return { - validatorAddress: object.validator_address, - denom: object.denom - }; + const message = createBaseEstimateSuperfluidDelegatedAmountByValidatorDenomRequest(); + if (object.validator_address !== undefined && object.validator_address !== null) { + message.validatorAddress = object.validator_address; + } + if (object.denom !== undefined && object.denom !== null) { + message.denom = object.denom; + } + return message; }, toAmino(message: EstimateSuperfluidDelegatedAmountByValidatorDenomRequest): EstimateSuperfluidDelegatedAmountByValidatorDenomRequestAmino { const obj: any = {}; @@ -2649,9 +2750,9 @@ export const EstimateSuperfluidDelegatedAmountByValidatorDenomResponse = { return message; }, fromAmino(object: EstimateSuperfluidDelegatedAmountByValidatorDenomResponseAmino): EstimateSuperfluidDelegatedAmountByValidatorDenomResponse { - return { - totalDelegatedCoins: Array.isArray(object?.total_delegated_coins) ? object.total_delegated_coins.map((e: any) => Coin.fromAmino(e)) : [] - }; + const message = createBaseEstimateSuperfluidDelegatedAmountByValidatorDenomResponse(); + message.totalDelegatedCoins = object.total_delegated_coins?.map(e => Coin.fromAmino(e)) || []; + return message; }, toAmino(message: EstimateSuperfluidDelegatedAmountByValidatorDenomResponse): EstimateSuperfluidDelegatedAmountByValidatorDenomResponseAmino { const obj: any = {}; @@ -2720,9 +2821,11 @@ export const QueryTotalDelegationByDelegatorRequest = { return message; }, fromAmino(object: QueryTotalDelegationByDelegatorRequestAmino): QueryTotalDelegationByDelegatorRequest { - return { - delegatorAddress: object.delegator_address - }; + const message = createBaseQueryTotalDelegationByDelegatorRequest(); + if (object.delegator_address !== undefined && object.delegator_address !== null) { + message.delegatorAddress = object.delegator_address; + } + return message; }, toAmino(message: QueryTotalDelegationByDelegatorRequest): QueryTotalDelegationByDelegatorRequestAmino { const obj: any = {}; @@ -2811,12 +2914,14 @@ export const QueryTotalDelegationByDelegatorResponse = { return message; }, fromAmino(object: QueryTotalDelegationByDelegatorResponseAmino): QueryTotalDelegationByDelegatorResponse { - return { - superfluidDelegationRecords: Array.isArray(object?.superfluid_delegation_records) ? object.superfluid_delegation_records.map((e: any) => SuperfluidDelegationRecord.fromAmino(e)) : [], - delegationResponse: Array.isArray(object?.delegation_response) ? object.delegation_response.map((e: any) => DelegationResponse.fromAmino(e)) : [], - totalDelegatedCoins: Array.isArray(object?.total_delegated_coins) ? object.total_delegated_coins.map((e: any) => Coin.fromAmino(e)) : [], - totalEquivalentStakedAmount: object?.total_equivalent_staked_amount ? Coin.fromAmino(object.total_equivalent_staked_amount) : undefined - }; + const message = createBaseQueryTotalDelegationByDelegatorResponse(); + message.superfluidDelegationRecords = object.superfluid_delegation_records?.map(e => SuperfluidDelegationRecord.fromAmino(e)) || []; + message.delegationResponse = object.delegation_response?.map(e => DelegationResponse.fromAmino(e)) || []; + message.totalDelegatedCoins = object.total_delegated_coins?.map(e => Coin.fromAmino(e)) || []; + if (object.total_equivalent_staked_amount !== undefined && object.total_equivalent_staked_amount !== null) { + message.totalEquivalentStakedAmount = Coin.fromAmino(object.total_equivalent_staked_amount); + } + return message; }, toAmino(message: QueryTotalDelegationByDelegatorResponse): QueryTotalDelegationByDelegatorResponseAmino { const obj: any = {}; @@ -2887,7 +2992,8 @@ export const QueryUnpoolWhitelistRequest = { return message; }, fromAmino(_: QueryUnpoolWhitelistRequestAmino): QueryUnpoolWhitelistRequest { - return {}; + const message = createBaseQueryUnpoolWhitelistRequest(); + return message; }, toAmino(_: QueryUnpoolWhitelistRequest): QueryUnpoolWhitelistRequestAmino { const obj: any = {}; @@ -2960,9 +3066,9 @@ export const QueryUnpoolWhitelistResponse = { return message; }, fromAmino(object: QueryUnpoolWhitelistResponseAmino): QueryUnpoolWhitelistResponse { - return { - poolIds: Array.isArray(object?.pool_ids) ? object.pool_ids.map((e: any) => BigInt(e)) : [] - }; + const message = createBaseQueryUnpoolWhitelistResponse(); + message.poolIds = object.pool_ids?.map(e => BigInt(e)) || []; + return message; }, toAmino(message: QueryUnpoolWhitelistResponse): QueryUnpoolWhitelistResponseAmino { const obj: any = {}; @@ -3031,9 +3137,11 @@ export const UserConcentratedSuperfluidPositionsDelegatedRequest = { return message; }, fromAmino(object: UserConcentratedSuperfluidPositionsDelegatedRequestAmino): UserConcentratedSuperfluidPositionsDelegatedRequest { - return { - delegatorAddress: object.delegator_address - }; + const message = createBaseUserConcentratedSuperfluidPositionsDelegatedRequest(); + if (object.delegator_address !== undefined && object.delegator_address !== null) { + message.delegatorAddress = object.delegator_address; + } + return message; }, toAmino(message: UserConcentratedSuperfluidPositionsDelegatedRequest): UserConcentratedSuperfluidPositionsDelegatedRequestAmino { const obj: any = {}; @@ -3098,9 +3206,9 @@ export const UserConcentratedSuperfluidPositionsDelegatedResponse = { return message; }, fromAmino(object: UserConcentratedSuperfluidPositionsDelegatedResponseAmino): UserConcentratedSuperfluidPositionsDelegatedResponse { - return { - clPoolUserPositionRecords: Array.isArray(object?.cl_pool_user_position_records) ? object.cl_pool_user_position_records.map((e: any) => ConcentratedPoolUserPositionRecord.fromAmino(e)) : [] - }; + const message = createBaseUserConcentratedSuperfluidPositionsDelegatedResponse(); + message.clPoolUserPositionRecords = object.cl_pool_user_position_records?.map(e => ConcentratedPoolUserPositionRecord.fromAmino(e)) || []; + return message; }, toAmino(message: UserConcentratedSuperfluidPositionsDelegatedResponse): UserConcentratedSuperfluidPositionsDelegatedResponseAmino { const obj: any = {}; @@ -3169,9 +3277,11 @@ export const UserConcentratedSuperfluidPositionsUndelegatingRequest = { return message; }, fromAmino(object: UserConcentratedSuperfluidPositionsUndelegatingRequestAmino): UserConcentratedSuperfluidPositionsUndelegatingRequest { - return { - delegatorAddress: object.delegator_address - }; + const message = createBaseUserConcentratedSuperfluidPositionsUndelegatingRequest(); + if (object.delegator_address !== undefined && object.delegator_address !== null) { + message.delegatorAddress = object.delegator_address; + } + return message; }, toAmino(message: UserConcentratedSuperfluidPositionsUndelegatingRequest): UserConcentratedSuperfluidPositionsUndelegatingRequestAmino { const obj: any = {}; @@ -3236,9 +3346,9 @@ export const UserConcentratedSuperfluidPositionsUndelegatingResponse = { return message; }, fromAmino(object: UserConcentratedSuperfluidPositionsUndelegatingResponseAmino): UserConcentratedSuperfluidPositionsUndelegatingResponse { - return { - clPoolUserPositionRecords: Array.isArray(object?.cl_pool_user_position_records) ? object.cl_pool_user_position_records.map((e: any) => ConcentratedPoolUserPositionRecord.fromAmino(e)) : [] - }; + const message = createBaseUserConcentratedSuperfluidPositionsUndelegatingResponse(); + message.clPoolUserPositionRecords = object.cl_pool_user_position_records?.map(e => ConcentratedPoolUserPositionRecord.fromAmino(e)) || []; + return message; }, toAmino(message: UserConcentratedSuperfluidPositionsUndelegatingResponse): UserConcentratedSuperfluidPositionsUndelegatingResponseAmino { const obj: any = {}; @@ -3270,4 +3380,142 @@ export const UserConcentratedSuperfluidPositionsUndelegatingResponse = { value: UserConcentratedSuperfluidPositionsUndelegatingResponse.encode(message).finish() }; } +}; +function createBaseQueryRestSupplyRequest(): QueryRestSupplyRequest { + return { + denom: "" + }; +} +export const QueryRestSupplyRequest = { + typeUrl: "/osmosis.superfluid.QueryRestSupplyRequest", + encode(message: QueryRestSupplyRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.denom !== "") { + writer.uint32(10).string(message.denom); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryRestSupplyRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryRestSupplyRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.denom = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryRestSupplyRequest { + const message = createBaseQueryRestSupplyRequest(); + message.denom = object.denom ?? ""; + return message; + }, + fromAmino(object: QueryRestSupplyRequestAmino): QueryRestSupplyRequest { + const message = createBaseQueryRestSupplyRequest(); + if (object.denom !== undefined && object.denom !== null) { + message.denom = object.denom; + } + return message; + }, + toAmino(message: QueryRestSupplyRequest): QueryRestSupplyRequestAmino { + const obj: any = {}; + obj.denom = message.denom; + return obj; + }, + fromAminoMsg(object: QueryRestSupplyRequestAminoMsg): QueryRestSupplyRequest { + return QueryRestSupplyRequest.fromAmino(object.value); + }, + toAminoMsg(message: QueryRestSupplyRequest): QueryRestSupplyRequestAminoMsg { + return { + type: "osmosis/query-rest-supply-request", + value: QueryRestSupplyRequest.toAmino(message) + }; + }, + fromProtoMsg(message: QueryRestSupplyRequestProtoMsg): QueryRestSupplyRequest { + return QueryRestSupplyRequest.decode(message.value); + }, + toProto(message: QueryRestSupplyRequest): Uint8Array { + return QueryRestSupplyRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryRestSupplyRequest): QueryRestSupplyRequestProtoMsg { + return { + typeUrl: "/osmosis.superfluid.QueryRestSupplyRequest", + value: QueryRestSupplyRequest.encode(message).finish() + }; + } +}; +function createBaseQueryRestSupplyResponse(): QueryRestSupplyResponse { + return { + amount: Coin.fromPartial({}) + }; +} +export const QueryRestSupplyResponse = { + typeUrl: "/osmosis.superfluid.QueryRestSupplyResponse", + encode(message: QueryRestSupplyResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.amount !== undefined) { + Coin.encode(message.amount, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryRestSupplyResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryRestSupplyResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.amount = Coin.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryRestSupplyResponse { + const message = createBaseQueryRestSupplyResponse(); + message.amount = object.amount !== undefined && object.amount !== null ? Coin.fromPartial(object.amount) : undefined; + return message; + }, + fromAmino(object: QueryRestSupplyResponseAmino): QueryRestSupplyResponse { + const message = createBaseQueryRestSupplyResponse(); + if (object.amount !== undefined && object.amount !== null) { + message.amount = Coin.fromAmino(object.amount); + } + return message; + }, + toAmino(message: QueryRestSupplyResponse): QueryRestSupplyResponseAmino { + const obj: any = {}; + obj.amount = message.amount ? Coin.toAmino(message.amount) : undefined; + return obj; + }, + fromAminoMsg(object: QueryRestSupplyResponseAminoMsg): QueryRestSupplyResponse { + return QueryRestSupplyResponse.fromAmino(object.value); + }, + toAminoMsg(message: QueryRestSupplyResponse): QueryRestSupplyResponseAminoMsg { + return { + type: "osmosis/query-rest-supply-response", + value: QueryRestSupplyResponse.toAmino(message) + }; + }, + fromProtoMsg(message: QueryRestSupplyResponseProtoMsg): QueryRestSupplyResponse { + return QueryRestSupplyResponse.decode(message.value); + }, + toProto(message: QueryRestSupplyResponse): Uint8Array { + return QueryRestSupplyResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryRestSupplyResponse): QueryRestSupplyResponseProtoMsg { + return { + typeUrl: "/osmosis.superfluid.QueryRestSupplyResponse", + value: QueryRestSupplyResponse.encode(message).finish() + }; + } }; \ No newline at end of file diff --git a/packages/osmo-query/src/codegen/osmosis/superfluid/superfluid.ts b/packages/osmo-query/src/codegen/osmosis/superfluid/superfluid.ts index 1fcd185f9..856c4a9ac 100644 --- a/packages/osmo-query/src/codegen/osmosis/superfluid/superfluid.ts +++ b/packages/osmo-query/src/codegen/osmosis/superfluid/superfluid.ts @@ -1,7 +1,6 @@ import { Coin, CoinAmino, CoinSDKType } from "../../cosmos/base/v1beta1/coin"; import { SyntheticLock, SyntheticLockAmino, SyntheticLockSDKType } from "../lockup/lock"; import { BinaryReader, BinaryWriter } from "../../binary"; -import { isSet } from "../../helpers"; import { Decimal } from "@cosmjs/math"; /** * SuperfluidAssetType indicates whether the superfluid asset is @@ -60,12 +59,12 @@ export interface SuperfluidAssetProtoMsg { } /** SuperfluidAsset stores the pair of superfluid asset type and denom pair */ export interface SuperfluidAssetAmino { - denom: string; + denom?: string; /** * AssetType indicates whether the superfluid asset is a native token or an lp * share */ - asset_type: SuperfluidAssetType; + asset_type?: SuperfluidAssetType; } export interface SuperfluidAssetAminoMsg { type: "osmosis/superfluid-asset"; @@ -99,10 +98,10 @@ export interface SuperfluidIntermediaryAccountProtoMsg { */ export interface SuperfluidIntermediaryAccountAmino { /** Denom indicates the denom of the superfluid asset. */ - denom: string; - val_addr: string; + denom?: string; + val_addr?: string; /** perpetual gauge for rewards distribution */ - gauge_id: string; + gauge_id?: string; } export interface SuperfluidIntermediaryAccountAminoMsg { type: "osmosis/superfluid-intermediary-account"; @@ -122,10 +121,10 @@ export interface SuperfluidIntermediaryAccountSDKType { * The Osmo-Equivalent-Multiplier Record for epoch N refers to the osmo worth we * treat an LP share as having, for all of epoch N. Eventually this is intended * to be set as the Time-weighted-average-osmo-backing for the entire duration - * of epoch N-1. (Thereby locking whats in use for epoch N as based on the prior - * epochs rewards) However for now, this is not the TWAP but instead the spot - * price at the boundary. For different types of assets in the future, it could - * change. + * of epoch N-1. (Thereby locking what's in use for epoch N as based on the + * prior epochs rewards) However for now, this is not the TWAP but instead the + * spot price at the boundary. For different types of assets in the future, it + * could change. */ export interface OsmoEquivalentMultiplierRecord { epochNumber: bigint; @@ -141,16 +140,16 @@ export interface OsmoEquivalentMultiplierRecordProtoMsg { * The Osmo-Equivalent-Multiplier Record for epoch N refers to the osmo worth we * treat an LP share as having, for all of epoch N. Eventually this is intended * to be set as the Time-weighted-average-osmo-backing for the entire duration - * of epoch N-1. (Thereby locking whats in use for epoch N as based on the prior - * epochs rewards) However for now, this is not the TWAP but instead the spot - * price at the boundary. For different types of assets in the future, it could - * change. + * of epoch N-1. (Thereby locking what's in use for epoch N as based on the + * prior epochs rewards) However for now, this is not the TWAP but instead the + * spot price at the boundary. For different types of assets in the future, it + * could change. */ export interface OsmoEquivalentMultiplierRecordAmino { - epoch_number: string; + epoch_number?: string; /** superfluid asset denom, can be LP token or native token */ - denom: string; - multiplier: string; + denom?: string; + multiplier?: string; } export interface OsmoEquivalentMultiplierRecordAminoMsg { type: "osmosis/osmo-equivalent-multiplier-record"; @@ -160,10 +159,10 @@ export interface OsmoEquivalentMultiplierRecordAminoMsg { * The Osmo-Equivalent-Multiplier Record for epoch N refers to the osmo worth we * treat an LP share as having, for all of epoch N. Eventually this is intended * to be set as the Time-weighted-average-osmo-backing for the entire duration - * of epoch N-1. (Thereby locking whats in use for epoch N as based on the prior - * epochs rewards) However for now, this is not the TWAP but instead the spot - * price at the boundary. For different types of assets in the future, it could - * change. + * of epoch N-1. (Thereby locking what's in use for epoch N as based on the + * prior epochs rewards) However for now, this is not the TWAP but instead the + * spot price at the boundary. For different types of assets in the future, it + * could change. */ export interface OsmoEquivalentMultiplierRecordSDKType { epoch_number: bigint; @@ -178,7 +177,7 @@ export interface SuperfluidDelegationRecord { delegatorAddress: string; validatorAddress: string; delegationAmount: Coin; - equivalentStakedAmount: Coin; + equivalentStakedAmount?: Coin; } export interface SuperfluidDelegationRecordProtoMsg { typeUrl: "/osmosis.superfluid.SuperfluidDelegationRecord"; @@ -189,8 +188,8 @@ export interface SuperfluidDelegationRecordProtoMsg { * delegations of an account in the state machine in a user friendly form. */ export interface SuperfluidDelegationRecordAmino { - delegator_address: string; - validator_address: string; + delegator_address?: string; + validator_address?: string; delegation_amount?: CoinAmino; equivalent_staked_amount?: CoinAmino; } @@ -206,7 +205,7 @@ export interface SuperfluidDelegationRecordSDKType { delegator_address: string; validator_address: string; delegation_amount: CoinSDKType; - equivalent_staked_amount: CoinSDKType; + equivalent_staked_amount?: CoinSDKType; } /** * LockIdIntermediaryAccountConnection is a struct used to indicate the @@ -227,8 +226,8 @@ export interface LockIdIntermediaryAccountConnectionProtoMsg { * via lp shares. */ export interface LockIdIntermediaryAccountConnectionAmino { - lock_id: string; - intermediary_account: string; + lock_id?: string; + intermediary_account?: string; } export interface LockIdIntermediaryAccountConnectionAminoMsg { type: "osmosis/lock-id-intermediary-account-connection"; @@ -251,7 +250,7 @@ export interface UnpoolWhitelistedPoolsProtoMsg { value: Uint8Array; } export interface UnpoolWhitelistedPoolsAmino { - ids: string[]; + ids?: string[]; } export interface UnpoolWhitelistedPoolsAminoMsg { type: "osmosis/unpool-whitelisted-pools"; @@ -266,16 +265,16 @@ export interface ConcentratedPoolUserPositionRecord { lockId: bigint; syntheticLock: SyntheticLock; delegationAmount: Coin; - equivalentStakedAmount: Coin; + equivalentStakedAmount?: Coin; } export interface ConcentratedPoolUserPositionRecordProtoMsg { typeUrl: "/osmosis.superfluid.ConcentratedPoolUserPositionRecord"; value: Uint8Array; } export interface ConcentratedPoolUserPositionRecordAmino { - validator_address: string; - position_id: string; - lock_id: string; + validator_address?: string; + position_id?: string; + lock_id?: string; synthetic_lock?: SyntheticLockAmino; delegation_amount?: CoinAmino; equivalent_staked_amount?: CoinAmino; @@ -290,7 +289,7 @@ export interface ConcentratedPoolUserPositionRecordSDKType { lock_id: bigint; synthetic_lock: SyntheticLockSDKType; delegation_amount: CoinSDKType; - equivalent_staked_amount: CoinSDKType; + equivalent_staked_amount?: CoinSDKType; } function createBaseSuperfluidAsset(): SuperfluidAsset { return { @@ -336,15 +335,19 @@ export const SuperfluidAsset = { return message; }, fromAmino(object: SuperfluidAssetAmino): SuperfluidAsset { - return { - denom: object.denom, - assetType: isSet(object.asset_type) ? superfluidAssetTypeFromJSON(object.asset_type) : -1 - }; + const message = createBaseSuperfluidAsset(); + if (object.denom !== undefined && object.denom !== null) { + message.denom = object.denom; + } + if (object.asset_type !== undefined && object.asset_type !== null) { + message.assetType = superfluidAssetTypeFromJSON(object.asset_type); + } + return message; }, toAmino(message: SuperfluidAsset): SuperfluidAssetAmino { const obj: any = {}; obj.denom = message.denom; - obj.asset_type = message.assetType; + obj.asset_type = superfluidAssetTypeToJSON(message.assetType); return obj; }, fromAminoMsg(object: SuperfluidAssetAminoMsg): SuperfluidAsset { @@ -421,11 +424,17 @@ export const SuperfluidIntermediaryAccount = { return message; }, fromAmino(object: SuperfluidIntermediaryAccountAmino): SuperfluidIntermediaryAccount { - return { - denom: object.denom, - valAddr: object.val_addr, - gaugeId: BigInt(object.gauge_id) - }; + const message = createBaseSuperfluidIntermediaryAccount(); + if (object.denom !== undefined && object.denom !== null) { + message.denom = object.denom; + } + if (object.val_addr !== undefined && object.val_addr !== null) { + message.valAddr = object.val_addr; + } + if (object.gauge_id !== undefined && object.gauge_id !== null) { + message.gaugeId = BigInt(object.gauge_id); + } + return message; }, toAmino(message: SuperfluidIntermediaryAccount): SuperfluidIntermediaryAccountAmino { const obj: any = {}; @@ -508,11 +517,17 @@ export const OsmoEquivalentMultiplierRecord = { return message; }, fromAmino(object: OsmoEquivalentMultiplierRecordAmino): OsmoEquivalentMultiplierRecord { - return { - epochNumber: BigInt(object.epoch_number), - denom: object.denom, - multiplier: object.multiplier - }; + const message = createBaseOsmoEquivalentMultiplierRecord(); + if (object.epoch_number !== undefined && object.epoch_number !== null) { + message.epochNumber = BigInt(object.epoch_number); + } + if (object.denom !== undefined && object.denom !== null) { + message.denom = object.denom; + } + if (object.multiplier !== undefined && object.multiplier !== null) { + message.multiplier = object.multiplier; + } + return message; }, toAmino(message: OsmoEquivalentMultiplierRecord): OsmoEquivalentMultiplierRecordAmino { const obj: any = {}; @@ -548,7 +563,7 @@ function createBaseSuperfluidDelegationRecord(): SuperfluidDelegationRecord { delegatorAddress: "", validatorAddress: "", delegationAmount: Coin.fromPartial({}), - equivalentStakedAmount: Coin.fromPartial({}) + equivalentStakedAmount: undefined }; } export const SuperfluidDelegationRecord = { @@ -603,12 +618,20 @@ export const SuperfluidDelegationRecord = { return message; }, fromAmino(object: SuperfluidDelegationRecordAmino): SuperfluidDelegationRecord { - return { - delegatorAddress: object.delegator_address, - validatorAddress: object.validator_address, - delegationAmount: object?.delegation_amount ? Coin.fromAmino(object.delegation_amount) : undefined, - equivalentStakedAmount: object?.equivalent_staked_amount ? Coin.fromAmino(object.equivalent_staked_amount) : undefined - }; + const message = createBaseSuperfluidDelegationRecord(); + if (object.delegator_address !== undefined && object.delegator_address !== null) { + message.delegatorAddress = object.delegator_address; + } + if (object.validator_address !== undefined && object.validator_address !== null) { + message.validatorAddress = object.validator_address; + } + if (object.delegation_amount !== undefined && object.delegation_amount !== null) { + message.delegationAmount = Coin.fromAmino(object.delegation_amount); + } + if (object.equivalent_staked_amount !== undefined && object.equivalent_staked_amount !== null) { + message.equivalentStakedAmount = Coin.fromAmino(object.equivalent_staked_amount); + } + return message; }, toAmino(message: SuperfluidDelegationRecord): SuperfluidDelegationRecordAmino { const obj: any = {}; @@ -684,10 +707,14 @@ export const LockIdIntermediaryAccountConnection = { return message; }, fromAmino(object: LockIdIntermediaryAccountConnectionAmino): LockIdIntermediaryAccountConnection { - return { - lockId: BigInt(object.lock_id), - intermediaryAccount: object.intermediary_account - }; + const message = createBaseLockIdIntermediaryAccountConnection(); + if (object.lock_id !== undefined && object.lock_id !== null) { + message.lockId = BigInt(object.lock_id); + } + if (object.intermediary_account !== undefined && object.intermediary_account !== null) { + message.intermediaryAccount = object.intermediary_account; + } + return message; }, toAmino(message: LockIdIntermediaryAccountConnection): LockIdIntermediaryAccountConnectionAmino { const obj: any = {}; @@ -762,9 +789,9 @@ export const UnpoolWhitelistedPools = { return message; }, fromAmino(object: UnpoolWhitelistedPoolsAmino): UnpoolWhitelistedPools { - return { - ids: Array.isArray(object?.ids) ? object.ids.map((e: any) => BigInt(e)) : [] - }; + const message = createBaseUnpoolWhitelistedPools(); + message.ids = object.ids?.map(e => BigInt(e)) || []; + return message; }, toAmino(message: UnpoolWhitelistedPools): UnpoolWhitelistedPoolsAmino { const obj: any = {}; @@ -804,7 +831,7 @@ function createBaseConcentratedPoolUserPositionRecord(): ConcentratedPoolUserPos lockId: BigInt(0), syntheticLock: SyntheticLock.fromPartial({}), delegationAmount: Coin.fromPartial({}), - equivalentStakedAmount: Coin.fromPartial({}) + equivalentStakedAmount: undefined }; } export const ConcentratedPoolUserPositionRecord = { @@ -873,14 +900,26 @@ export const ConcentratedPoolUserPositionRecord = { return message; }, fromAmino(object: ConcentratedPoolUserPositionRecordAmino): ConcentratedPoolUserPositionRecord { - return { - validatorAddress: object.validator_address, - positionId: BigInt(object.position_id), - lockId: BigInt(object.lock_id), - syntheticLock: object?.synthetic_lock ? SyntheticLock.fromAmino(object.synthetic_lock) : undefined, - delegationAmount: object?.delegation_amount ? Coin.fromAmino(object.delegation_amount) : undefined, - equivalentStakedAmount: object?.equivalent_staked_amount ? Coin.fromAmino(object.equivalent_staked_amount) : undefined - }; + const message = createBaseConcentratedPoolUserPositionRecord(); + if (object.validator_address !== undefined && object.validator_address !== null) { + message.validatorAddress = object.validator_address; + } + if (object.position_id !== undefined && object.position_id !== null) { + message.positionId = BigInt(object.position_id); + } + if (object.lock_id !== undefined && object.lock_id !== null) { + message.lockId = BigInt(object.lock_id); + } + if (object.synthetic_lock !== undefined && object.synthetic_lock !== null) { + message.syntheticLock = SyntheticLock.fromAmino(object.synthetic_lock); + } + if (object.delegation_amount !== undefined && object.delegation_amount !== null) { + message.delegationAmount = Coin.fromAmino(object.delegation_amount); + } + if (object.equivalent_staked_amount !== undefined && object.equivalent_staked_amount !== null) { + message.equivalentStakedAmount = Coin.fromAmino(object.equivalent_staked_amount); + } + return message; }, toAmino(message: ConcentratedPoolUserPositionRecord): ConcentratedPoolUserPositionRecordAmino { const obj: any = {}; diff --git a/packages/osmo-query/src/codegen/osmosis/superfluid/tx.amino.ts b/packages/osmo-query/src/codegen/osmosis/superfluid/tx.amino.ts index 158de5f58..1304dac9e 100644 --- a/packages/osmo-query/src/codegen/osmosis/superfluid/tx.amino.ts +++ b/packages/osmo-query/src/codegen/osmosis/superfluid/tx.amino.ts @@ -1,5 +1,5 @@ //@ts-nocheck -import { MsgSuperfluidDelegate, MsgSuperfluidUndelegate, MsgSuperfluidUnbondLock, MsgSuperfluidUndelegateAndUnbondLock, MsgLockAndSuperfluidDelegate, MsgCreateFullRangePositionAndSuperfluidDelegate, MsgUnPoolWhitelistedPool, MsgUnlockAndMigrateSharesToFullRangeConcentratedPosition, MsgAddToConcentratedLiquiditySuperfluidPosition } from "./tx"; +import { MsgSuperfluidDelegate, MsgSuperfluidUndelegate, MsgSuperfluidUnbondLock, MsgSuperfluidUndelegateAndUnbondLock, MsgLockAndSuperfluidDelegate, MsgCreateFullRangePositionAndSuperfluidDelegate, MsgUnPoolWhitelistedPool, MsgUnlockAndMigrateSharesToFullRangeConcentratedPosition, MsgAddToConcentratedLiquiditySuperfluidPosition, MsgUnbondConvertAndStake } from "./tx"; export const AminoConverter = { "/osmosis.superfluid.MsgSuperfluidDelegate": { aminoType: "osmosis/superfluid-delegate", @@ -27,7 +27,7 @@ export const AminoConverter = { fromAmino: MsgLockAndSuperfluidDelegate.fromAmino }, "/osmosis.superfluid.MsgCreateFullRangePositionAndSuperfluidDelegate": { - aminoType: "osmosis/create-full-range-position-and-superfluid-delegate", + aminoType: "osmosis/full-range-and-sf-delegate", toAmino: MsgCreateFullRangePositionAndSuperfluidDelegate.toAmino, fromAmino: MsgCreateFullRangePositionAndSuperfluidDelegate.fromAmino }, @@ -37,13 +37,18 @@ export const AminoConverter = { fromAmino: MsgUnPoolWhitelistedPool.fromAmino }, "/osmosis.superfluid.MsgUnlockAndMigrateSharesToFullRangeConcentratedPosition": { - aminoType: "osmosis/unlock-and-migrate-shares-to-full-range-concentrated-position", + aminoType: "osmosis/unlock-and-migrate", toAmino: MsgUnlockAndMigrateSharesToFullRangeConcentratedPosition.toAmino, fromAmino: MsgUnlockAndMigrateSharesToFullRangeConcentratedPosition.fromAmino }, "/osmosis.superfluid.MsgAddToConcentratedLiquiditySuperfluidPosition": { - aminoType: "osmosis/add-to-concentrated-liquidity-superfluid-position", + aminoType: "osmosis/add-to-cl-superfluid-position", toAmino: MsgAddToConcentratedLiquiditySuperfluidPosition.toAmino, fromAmino: MsgAddToConcentratedLiquiditySuperfluidPosition.fromAmino + }, + "/osmosis.superfluid.MsgUnbondConvertAndStake": { + aminoType: "osmosis/unbond-convert-and-stake", + toAmino: MsgUnbondConvertAndStake.toAmino, + fromAmino: MsgUnbondConvertAndStake.fromAmino } }; \ No newline at end of file diff --git a/packages/osmo-query/src/codegen/osmosis/superfluid/tx.registry.ts b/packages/osmo-query/src/codegen/osmosis/superfluid/tx.registry.ts index fe3b6c01b..f9338bc4a 100644 --- a/packages/osmo-query/src/codegen/osmosis/superfluid/tx.registry.ts +++ b/packages/osmo-query/src/codegen/osmosis/superfluid/tx.registry.ts @@ -1,7 +1,7 @@ //@ts-nocheck import { GeneratedType, Registry } from "@cosmjs/proto-signing"; -import { MsgSuperfluidDelegate, MsgSuperfluidUndelegate, MsgSuperfluidUnbondLock, MsgSuperfluidUndelegateAndUnbondLock, MsgLockAndSuperfluidDelegate, MsgCreateFullRangePositionAndSuperfluidDelegate, MsgUnPoolWhitelistedPool, MsgUnlockAndMigrateSharesToFullRangeConcentratedPosition, MsgAddToConcentratedLiquiditySuperfluidPosition } from "./tx"; -export const registry: ReadonlyArray<[string, GeneratedType]> = [["/osmosis.superfluid.MsgSuperfluidDelegate", MsgSuperfluidDelegate], ["/osmosis.superfluid.MsgSuperfluidUndelegate", MsgSuperfluidUndelegate], ["/osmosis.superfluid.MsgSuperfluidUnbondLock", MsgSuperfluidUnbondLock], ["/osmosis.superfluid.MsgSuperfluidUndelegateAndUnbondLock", MsgSuperfluidUndelegateAndUnbondLock], ["/osmosis.superfluid.MsgLockAndSuperfluidDelegate", MsgLockAndSuperfluidDelegate], ["/osmosis.superfluid.MsgCreateFullRangePositionAndSuperfluidDelegate", MsgCreateFullRangePositionAndSuperfluidDelegate], ["/osmosis.superfluid.MsgUnPoolWhitelistedPool", MsgUnPoolWhitelistedPool], ["/osmosis.superfluid.MsgUnlockAndMigrateSharesToFullRangeConcentratedPosition", MsgUnlockAndMigrateSharesToFullRangeConcentratedPosition], ["/osmosis.superfluid.MsgAddToConcentratedLiquiditySuperfluidPosition", MsgAddToConcentratedLiquiditySuperfluidPosition]]; +import { MsgSuperfluidDelegate, MsgSuperfluidUndelegate, MsgSuperfluidUnbondLock, MsgSuperfluidUndelegateAndUnbondLock, MsgLockAndSuperfluidDelegate, MsgCreateFullRangePositionAndSuperfluidDelegate, MsgUnPoolWhitelistedPool, MsgUnlockAndMigrateSharesToFullRangeConcentratedPosition, MsgAddToConcentratedLiquiditySuperfluidPosition, MsgUnbondConvertAndStake } from "./tx"; +export const registry: ReadonlyArray<[string, GeneratedType]> = [["/osmosis.superfluid.MsgSuperfluidDelegate", MsgSuperfluidDelegate], ["/osmosis.superfluid.MsgSuperfluidUndelegate", MsgSuperfluidUndelegate], ["/osmosis.superfluid.MsgSuperfluidUnbondLock", MsgSuperfluidUnbondLock], ["/osmosis.superfluid.MsgSuperfluidUndelegateAndUnbondLock", MsgSuperfluidUndelegateAndUnbondLock], ["/osmosis.superfluid.MsgLockAndSuperfluidDelegate", MsgLockAndSuperfluidDelegate], ["/osmosis.superfluid.MsgCreateFullRangePositionAndSuperfluidDelegate", MsgCreateFullRangePositionAndSuperfluidDelegate], ["/osmosis.superfluid.MsgUnPoolWhitelistedPool", MsgUnPoolWhitelistedPool], ["/osmosis.superfluid.MsgUnlockAndMigrateSharesToFullRangeConcentratedPosition", MsgUnlockAndMigrateSharesToFullRangeConcentratedPosition], ["/osmosis.superfluid.MsgAddToConcentratedLiquiditySuperfluidPosition", MsgAddToConcentratedLiquiditySuperfluidPosition], ["/osmosis.superfluid.MsgUnbondConvertAndStake", MsgUnbondConvertAndStake]]; export const load = (protoRegistry: Registry) => { registry.forEach(([typeUrl, mod]) => { protoRegistry.register(typeUrl, mod); @@ -62,6 +62,12 @@ export const MessageComposer = { typeUrl: "/osmosis.superfluid.MsgAddToConcentratedLiquiditySuperfluidPosition", value: MsgAddToConcentratedLiquiditySuperfluidPosition.encode(value).finish() }; + }, + unbondConvertAndStake(value: MsgUnbondConvertAndStake) { + return { + typeUrl: "/osmosis.superfluid.MsgUnbondConvertAndStake", + value: MsgUnbondConvertAndStake.encode(value).finish() + }; } }, withTypeUrl: { @@ -118,6 +124,12 @@ export const MessageComposer = { typeUrl: "/osmosis.superfluid.MsgAddToConcentratedLiquiditySuperfluidPosition", value }; + }, + unbondConvertAndStake(value: MsgUnbondConvertAndStake) { + return { + typeUrl: "/osmosis.superfluid.MsgUnbondConvertAndStake", + value + }; } }, fromPartial: { @@ -174,6 +186,12 @@ export const MessageComposer = { typeUrl: "/osmosis.superfluid.MsgAddToConcentratedLiquiditySuperfluidPosition", value: MsgAddToConcentratedLiquiditySuperfluidPosition.fromPartial(value) }; + }, + unbondConvertAndStake(value: MsgUnbondConvertAndStake) { + return { + typeUrl: "/osmosis.superfluid.MsgUnbondConvertAndStake", + value: MsgUnbondConvertAndStake.fromPartial(value) + }; } } }; \ No newline at end of file diff --git a/packages/osmo-query/src/codegen/osmosis/superfluid/tx.rpc.msg.ts b/packages/osmo-query/src/codegen/osmosis/superfluid/tx.rpc.msg.ts index e4f591bc2..fb9ca4d5c 100644 --- a/packages/osmo-query/src/codegen/osmosis/superfluid/tx.rpc.msg.ts +++ b/packages/osmo-query/src/codegen/osmosis/superfluid/tx.rpc.msg.ts @@ -1,6 +1,6 @@ import { Rpc } from "../../helpers"; import { BinaryReader } from "../../binary"; -import { MsgSuperfluidDelegate, MsgSuperfluidDelegateResponse, MsgSuperfluidUndelegate, MsgSuperfluidUndelegateResponse, MsgSuperfluidUnbondLock, MsgSuperfluidUnbondLockResponse, MsgSuperfluidUndelegateAndUnbondLock, MsgSuperfluidUndelegateAndUnbondLockResponse, MsgLockAndSuperfluidDelegate, MsgLockAndSuperfluidDelegateResponse, MsgCreateFullRangePositionAndSuperfluidDelegate, MsgCreateFullRangePositionAndSuperfluidDelegateResponse, MsgUnPoolWhitelistedPool, MsgUnPoolWhitelistedPoolResponse, MsgUnlockAndMigrateSharesToFullRangeConcentratedPosition, MsgUnlockAndMigrateSharesToFullRangeConcentratedPositionResponse, MsgAddToConcentratedLiquiditySuperfluidPosition, MsgAddToConcentratedLiquiditySuperfluidPositionResponse } from "./tx"; +import { MsgSuperfluidDelegate, MsgSuperfluidDelegateResponse, MsgSuperfluidUndelegate, MsgSuperfluidUndelegateResponse, MsgSuperfluidUnbondLock, MsgSuperfluidUnbondLockResponse, MsgSuperfluidUndelegateAndUnbondLock, MsgSuperfluidUndelegateAndUnbondLockResponse, MsgLockAndSuperfluidDelegate, MsgLockAndSuperfluidDelegateResponse, MsgCreateFullRangePositionAndSuperfluidDelegate, MsgCreateFullRangePositionAndSuperfluidDelegateResponse, MsgUnPoolWhitelistedPool, MsgUnPoolWhitelistedPoolResponse, MsgUnlockAndMigrateSharesToFullRangeConcentratedPosition, MsgUnlockAndMigrateSharesToFullRangeConcentratedPositionResponse, MsgAddToConcentratedLiquiditySuperfluidPosition, MsgAddToConcentratedLiquiditySuperfluidPositionResponse, MsgUnbondConvertAndStake, MsgUnbondConvertAndStakeResponse } from "./tx"; /** Msg defines the Msg service. */ export interface Msg { /** Execute superfluid delegation for a lockup */ @@ -20,6 +20,11 @@ export interface Msg { unPoolWhitelistedPool(request: MsgUnPoolWhitelistedPool): Promise; unlockAndMigrateSharesToFullRangeConcentratedPosition(request: MsgUnlockAndMigrateSharesToFullRangeConcentratedPosition): Promise; addToConcentratedLiquiditySuperfluidPosition(request: MsgAddToConcentratedLiquiditySuperfluidPosition): Promise; + /** + * UnbondConvertAndStake breaks all locks / superfluid staked assets, + * converts them to osmo then stakes the osmo to the designated validator. + */ + unbondConvertAndStake(request: MsgUnbondConvertAndStake): Promise; } export class MsgClientImpl implements Msg { private readonly rpc: Rpc; @@ -34,6 +39,7 @@ export class MsgClientImpl implements Msg { this.unPoolWhitelistedPool = this.unPoolWhitelistedPool.bind(this); this.unlockAndMigrateSharesToFullRangeConcentratedPosition = this.unlockAndMigrateSharesToFullRangeConcentratedPosition.bind(this); this.addToConcentratedLiquiditySuperfluidPosition = this.addToConcentratedLiquiditySuperfluidPosition.bind(this); + this.unbondConvertAndStake = this.unbondConvertAndStake.bind(this); } superfluidDelegate(request: MsgSuperfluidDelegate): Promise { const data = MsgSuperfluidDelegate.encode(request).finish(); @@ -80,4 +86,9 @@ export class MsgClientImpl implements Msg { const promise = this.rpc.request("osmosis.superfluid.Msg", "AddToConcentratedLiquiditySuperfluidPosition", data); return promise.then(data => MsgAddToConcentratedLiquiditySuperfluidPositionResponse.decode(new BinaryReader(data))); } + unbondConvertAndStake(request: MsgUnbondConvertAndStake): Promise { + const data = MsgUnbondConvertAndStake.encode(request).finish(); + const promise = this.rpc.request("osmosis.superfluid.Msg", "UnbondConvertAndStake", data); + return promise.then(data => MsgUnbondConvertAndStakeResponse.decode(new BinaryReader(data))); + } } \ No newline at end of file diff --git a/packages/osmo-query/src/codegen/osmosis/superfluid/tx.ts b/packages/osmo-query/src/codegen/osmosis/superfluid/tx.ts index 0911e45b1..406875ce5 100644 --- a/packages/osmo-query/src/codegen/osmosis/superfluid/tx.ts +++ b/packages/osmo-query/src/codegen/osmosis/superfluid/tx.ts @@ -13,9 +13,9 @@ export interface MsgSuperfluidDelegateProtoMsg { value: Uint8Array; } export interface MsgSuperfluidDelegateAmino { - sender: string; - lock_id: string; - val_addr: string; + sender?: string; + lock_id?: string; + val_addr?: string; } export interface MsgSuperfluidDelegateAminoMsg { type: "osmosis/superfluid-delegate"; @@ -46,8 +46,8 @@ export interface MsgSuperfluidUndelegateProtoMsg { value: Uint8Array; } export interface MsgSuperfluidUndelegateAmino { - sender: string; - lock_id: string; + sender?: string; + lock_id?: string; } export interface MsgSuperfluidUndelegateAminoMsg { type: "osmosis/superfluid-undelegate"; @@ -77,8 +77,8 @@ export interface MsgSuperfluidUnbondLockProtoMsg { value: Uint8Array; } export interface MsgSuperfluidUnbondLockAmino { - sender: string; - lock_id: string; + sender?: string; + lock_id?: string; } export interface MsgSuperfluidUnbondLockAminoMsg { type: "osmosis/superfluid-unbond-lock"; @@ -110,8 +110,8 @@ export interface MsgSuperfluidUndelegateAndUnbondLockProtoMsg { value: Uint8Array; } export interface MsgSuperfluidUndelegateAndUnbondLockAmino { - sender: string; - lock_id: string; + sender?: string; + lock_id?: string; /** Amount of unlocking coin. */ coin?: CoinAmino; } @@ -142,7 +142,7 @@ export interface MsgSuperfluidUndelegateAndUnbondLockResponseAmino { * returns the original lockid if the unlocked amount is equal to the * original lock's amount. */ - lock_id: string; + lock_id?: string; } export interface MsgSuperfluidUndelegateAndUnbondLockResponseAminoMsg { type: "osmosis/superfluid-undelegate-and-unbond-lock-response"; @@ -171,9 +171,9 @@ export interface MsgLockAndSuperfluidDelegateProtoMsg { * specified validator addr. */ export interface MsgLockAndSuperfluidDelegateAmino { - sender: string; - coins: CoinAmino[]; - val_addr: string; + sender?: string; + coins?: CoinAmino[]; + val_addr?: string; } export interface MsgLockAndSuperfluidDelegateAminoMsg { type: "osmosis/lock-and-superfluid-delegate"; @@ -197,7 +197,7 @@ export interface MsgLockAndSuperfluidDelegateResponseProtoMsg { value: Uint8Array; } export interface MsgLockAndSuperfluidDelegateResponseAmino { - ID: string; + ID?: string; } export interface MsgLockAndSuperfluidDelegateResponseAminoMsg { type: "osmosis/lock-and-superfluid-delegate-response"; @@ -225,13 +225,13 @@ export interface MsgCreateFullRangePositionAndSuperfluidDelegateProtoMsg { * in a concentrated liquidity pool, then superfluid delegates. */ export interface MsgCreateFullRangePositionAndSuperfluidDelegateAmino { - sender: string; - coins: CoinAmino[]; - val_addr: string; - pool_id: string; + sender?: string; + coins?: CoinAmino[]; + val_addr?: string; + pool_id?: string; } export interface MsgCreateFullRangePositionAndSuperfluidDelegateAminoMsg { - type: "osmosis/create-full-range-position-and-superfluid-delegate"; + type: "osmosis/full-range-and-sf-delegate"; value: MsgCreateFullRangePositionAndSuperfluidDelegateAmino; } /** @@ -253,8 +253,8 @@ export interface MsgCreateFullRangePositionAndSuperfluidDelegateResponseProtoMsg value: Uint8Array; } export interface MsgCreateFullRangePositionAndSuperfluidDelegateResponseAmino { - lockID: string; - positionID: string; + lockID?: string; + positionID?: string; } export interface MsgCreateFullRangePositionAndSuperfluidDelegateResponseAminoMsg { type: "osmosis/create-full-range-position-and-superfluid-delegate-response"; @@ -293,8 +293,8 @@ export interface MsgUnPoolWhitelistedPoolProtoMsg { * until unbond completion. */ export interface MsgUnPoolWhitelistedPoolAmino { - sender: string; - pool_id: string; + sender?: string; + pool_id?: string; } export interface MsgUnPoolWhitelistedPoolAminoMsg { type: "osmosis/unpool-whitelisted-pool"; @@ -322,7 +322,7 @@ export interface MsgUnPoolWhitelistedPoolResponseProtoMsg { value: Uint8Array; } export interface MsgUnPoolWhitelistedPoolResponseAmino { - exited_lock_ids: string[]; + exited_lock_ids?: string[]; } export interface MsgUnPoolWhitelistedPoolResponseAminoMsg { type: "osmosis/un-pool-whitelisted-pool-response"; @@ -351,14 +351,14 @@ export interface MsgUnlockAndMigrateSharesToFullRangeConcentratedPositionProtoMs * MsgUnlockAndMigrateSharesToFullRangeConcentratedPosition */ export interface MsgUnlockAndMigrateSharesToFullRangeConcentratedPositionAmino { - sender: string; - lock_id: string; + sender?: string; + lock_id?: string; shares_to_migrate?: CoinAmino; /** token_out_mins indicates minimum token to exit Balancer pool with. */ - token_out_mins: CoinAmino[]; + token_out_mins?: CoinAmino[]; } export interface MsgUnlockAndMigrateSharesToFullRangeConcentratedPositionAminoMsg { - type: "osmosis/unlock-and-migrate-shares-to-full-range-concentrated-position"; + type: "osmosis/unlock-and-migrate"; value: MsgUnlockAndMigrateSharesToFullRangeConcentratedPositionAmino; } /** @@ -382,10 +382,10 @@ export interface MsgUnlockAndMigrateSharesToFullRangeConcentratedPositionRespons value: Uint8Array; } export interface MsgUnlockAndMigrateSharesToFullRangeConcentratedPositionResponseAmino { - amount0: string; - amount1: string; - liquidity_created: string; - join_time?: Date; + amount0?: string; + amount1?: string; + liquidity_created?: string; + join_time?: string; } export interface MsgUnlockAndMigrateSharesToFullRangeConcentratedPositionResponseAminoMsg { type: "osmosis/unlock-and-migrate-shares-to-full-range-concentrated-position-response"; @@ -410,13 +410,13 @@ export interface MsgAddToConcentratedLiquiditySuperfluidPositionProtoMsg { } /** ===================== MsgAddToConcentratedLiquiditySuperfluidPosition */ export interface MsgAddToConcentratedLiquiditySuperfluidPositionAmino { - position_id: string; - sender: string; + position_id?: string; + sender?: string; token_desired0?: CoinAmino; token_desired1?: CoinAmino; } export interface MsgAddToConcentratedLiquiditySuperfluidPositionAminoMsg { - type: "osmosis/add-to-concentrated-liquidity-superfluid-position"; + type: "osmosis/add-to-cl-superfluid-position"; value: MsgAddToConcentratedLiquiditySuperfluidPositionAmino; } /** ===================== MsgAddToConcentratedLiquiditySuperfluidPosition */ @@ -443,16 +443,16 @@ export interface MsgAddToConcentratedLiquiditySuperfluidPositionResponseProtoMsg value: Uint8Array; } export interface MsgAddToConcentratedLiquiditySuperfluidPositionResponseAmino { - position_id: string; - amount0: string; - amount1: string; + position_id?: string; + amount0?: string; + amount1?: string; /** * new_liquidity is the final liquidity after the add. * It includes the liquidity that existed before in the position * and the new liquidity that was added to the position. */ - new_liquidity: string; - lock_id: string; + new_liquidity?: string; + lock_id?: string; } export interface MsgAddToConcentratedLiquiditySuperfluidPositionResponseAminoMsg { type: "osmosis/add-to-concentrated-liquidity-superfluid-position-response"; @@ -465,6 +465,85 @@ export interface MsgAddToConcentratedLiquiditySuperfluidPositionResponseSDKType new_liquidity: string; lock_id: bigint; } +/** ===================== MsgUnbondConvertAndStake */ +export interface MsgUnbondConvertAndStake { + /** + * lock ID to convert and stake. + * lock id with 0 should be provided if converting liquid gamm shares to stake + */ + lockId: bigint; + sender: string; + /** + * validator address to delegate to. + * If provided empty string, we use the validators returned from + * valset-preference module. + */ + valAddr: string; + /** min_amt_to_stake indicates the minimum amount to stake after conversion */ + minAmtToStake: string; + /** + * shares_to_convert indicates shares wanted to stake. + * Note that this field is only used for liquid(unlocked) gamm shares. + * For all other cases, this field would be disregarded. + */ + sharesToConvert: Coin; +} +export interface MsgUnbondConvertAndStakeProtoMsg { + typeUrl: "/osmosis.superfluid.MsgUnbondConvertAndStake"; + value: Uint8Array; +} +/** ===================== MsgUnbondConvertAndStake */ +export interface MsgUnbondConvertAndStakeAmino { + /** + * lock ID to convert and stake. + * lock id with 0 should be provided if converting liquid gamm shares to stake + */ + lock_id?: string; + sender?: string; + /** + * validator address to delegate to. + * If provided empty string, we use the validators returned from + * valset-preference module. + */ + val_addr?: string; + /** min_amt_to_stake indicates the minimum amount to stake after conversion */ + min_amt_to_stake?: string; + /** + * shares_to_convert indicates shares wanted to stake. + * Note that this field is only used for liquid(unlocked) gamm shares. + * For all other cases, this field would be disregarded. + */ + shares_to_convert?: CoinAmino; +} +export interface MsgUnbondConvertAndStakeAminoMsg { + type: "osmosis/unbond-convert-and-stake"; + value: MsgUnbondConvertAndStakeAmino; +} +/** ===================== MsgUnbondConvertAndStake */ +export interface MsgUnbondConvertAndStakeSDKType { + lock_id: bigint; + sender: string; + val_addr: string; + min_amt_to_stake: string; + shares_to_convert: CoinSDKType; +} +export interface MsgUnbondConvertAndStakeResponse { + totalAmtStaked: string; +} +export interface MsgUnbondConvertAndStakeResponseProtoMsg { + typeUrl: "/osmosis.superfluid.MsgUnbondConvertAndStakeResponse"; + value: Uint8Array; +} +export interface MsgUnbondConvertAndStakeResponseAmino { + total_amt_staked?: string; +} +export interface MsgUnbondConvertAndStakeResponseAminoMsg { + type: "osmosis/unbond-convert-and-stake-response"; + value: MsgUnbondConvertAndStakeResponseAmino; +} +export interface MsgUnbondConvertAndStakeResponseSDKType { + total_amt_staked: string; +} function createBaseMsgSuperfluidDelegate(): MsgSuperfluidDelegate { return { sender: "", @@ -517,11 +596,17 @@ export const MsgSuperfluidDelegate = { return message; }, fromAmino(object: MsgSuperfluidDelegateAmino): MsgSuperfluidDelegate { - return { - sender: object.sender, - lockId: BigInt(object.lock_id), - valAddr: object.val_addr - }; + const message = createBaseMsgSuperfluidDelegate(); + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + if (object.lock_id !== undefined && object.lock_id !== null) { + message.lockId = BigInt(object.lock_id); + } + if (object.val_addr !== undefined && object.val_addr !== null) { + message.valAddr = object.val_addr; + } + return message; }, toAmino(message: MsgSuperfluidDelegate): MsgSuperfluidDelegateAmino { const obj: any = {}; @@ -579,7 +664,8 @@ export const MsgSuperfluidDelegateResponse = { return message; }, fromAmino(_: MsgSuperfluidDelegateResponseAmino): MsgSuperfluidDelegateResponse { - return {}; + const message = createBaseMsgSuperfluidDelegateResponse(); + return message; }, toAmino(_: MsgSuperfluidDelegateResponse): MsgSuperfluidDelegateResponseAmino { const obj: any = {}; @@ -651,10 +737,14 @@ export const MsgSuperfluidUndelegate = { return message; }, fromAmino(object: MsgSuperfluidUndelegateAmino): MsgSuperfluidUndelegate { - return { - sender: object.sender, - lockId: BigInt(object.lock_id) - }; + const message = createBaseMsgSuperfluidUndelegate(); + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + if (object.lock_id !== undefined && object.lock_id !== null) { + message.lockId = BigInt(object.lock_id); + } + return message; }, toAmino(message: MsgSuperfluidUndelegate): MsgSuperfluidUndelegateAmino { const obj: any = {}; @@ -711,7 +801,8 @@ export const MsgSuperfluidUndelegateResponse = { return message; }, fromAmino(_: MsgSuperfluidUndelegateResponseAmino): MsgSuperfluidUndelegateResponse { - return {}; + const message = createBaseMsgSuperfluidUndelegateResponse(); + return message; }, toAmino(_: MsgSuperfluidUndelegateResponse): MsgSuperfluidUndelegateResponseAmino { const obj: any = {}; @@ -783,10 +874,14 @@ export const MsgSuperfluidUnbondLock = { return message; }, fromAmino(object: MsgSuperfluidUnbondLockAmino): MsgSuperfluidUnbondLock { - return { - sender: object.sender, - lockId: BigInt(object.lock_id) - }; + const message = createBaseMsgSuperfluidUnbondLock(); + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + if (object.lock_id !== undefined && object.lock_id !== null) { + message.lockId = BigInt(object.lock_id); + } + return message; }, toAmino(message: MsgSuperfluidUnbondLock): MsgSuperfluidUnbondLockAmino { const obj: any = {}; @@ -843,7 +938,8 @@ export const MsgSuperfluidUnbondLockResponse = { return message; }, fromAmino(_: MsgSuperfluidUnbondLockResponseAmino): MsgSuperfluidUnbondLockResponse { - return {}; + const message = createBaseMsgSuperfluidUnbondLockResponse(); + return message; }, toAmino(_: MsgSuperfluidUnbondLockResponse): MsgSuperfluidUnbondLockResponseAmino { const obj: any = {}; @@ -923,11 +1019,17 @@ export const MsgSuperfluidUndelegateAndUnbondLock = { return message; }, fromAmino(object: MsgSuperfluidUndelegateAndUnbondLockAmino): MsgSuperfluidUndelegateAndUnbondLock { - return { - sender: object.sender, - lockId: BigInt(object.lock_id), - coin: object?.coin ? Coin.fromAmino(object.coin) : undefined - }; + const message = createBaseMsgSuperfluidUndelegateAndUnbondLock(); + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + if (object.lock_id !== undefined && object.lock_id !== null) { + message.lockId = BigInt(object.lock_id); + } + if (object.coin !== undefined && object.coin !== null) { + message.coin = Coin.fromAmino(object.coin); + } + return message; }, toAmino(message: MsgSuperfluidUndelegateAndUnbondLock): MsgSuperfluidUndelegateAndUnbondLockAmino { const obj: any = {}; @@ -994,9 +1096,11 @@ export const MsgSuperfluidUndelegateAndUnbondLockResponse = { return message; }, fromAmino(object: MsgSuperfluidUndelegateAndUnbondLockResponseAmino): MsgSuperfluidUndelegateAndUnbondLockResponse { - return { - lockId: BigInt(object.lock_id) - }; + const message = createBaseMsgSuperfluidUndelegateAndUnbondLockResponse(); + if (object.lock_id !== undefined && object.lock_id !== null) { + message.lockId = BigInt(object.lock_id); + } + return message; }, toAmino(message: MsgSuperfluidUndelegateAndUnbondLockResponse): MsgSuperfluidUndelegateAndUnbondLockResponseAmino { const obj: any = {}; @@ -1077,11 +1181,15 @@ export const MsgLockAndSuperfluidDelegate = { return message; }, fromAmino(object: MsgLockAndSuperfluidDelegateAmino): MsgLockAndSuperfluidDelegate { - return { - sender: object.sender, - coins: Array.isArray(object?.coins) ? object.coins.map((e: any) => Coin.fromAmino(e)) : [], - valAddr: object.val_addr - }; + const message = createBaseMsgLockAndSuperfluidDelegate(); + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + message.coins = object.coins?.map(e => Coin.fromAmino(e)) || []; + if (object.val_addr !== undefined && object.val_addr !== null) { + message.valAddr = object.val_addr; + } + return message; }, toAmino(message: MsgLockAndSuperfluidDelegate): MsgLockAndSuperfluidDelegateAmino { const obj: any = {}; @@ -1152,9 +1260,11 @@ export const MsgLockAndSuperfluidDelegateResponse = { return message; }, fromAmino(object: MsgLockAndSuperfluidDelegateResponseAmino): MsgLockAndSuperfluidDelegateResponse { - return { - ID: BigInt(object.ID) - }; + const message = createBaseMsgLockAndSuperfluidDelegateResponse(); + if (object.ID !== undefined && object.ID !== null) { + message.ID = BigInt(object.ID); + } + return message; }, toAmino(message: MsgLockAndSuperfluidDelegateResponse): MsgLockAndSuperfluidDelegateResponseAmino { const obj: any = {}; @@ -1243,12 +1353,18 @@ export const MsgCreateFullRangePositionAndSuperfluidDelegate = { return message; }, fromAmino(object: MsgCreateFullRangePositionAndSuperfluidDelegateAmino): MsgCreateFullRangePositionAndSuperfluidDelegate { - return { - sender: object.sender, - coins: Array.isArray(object?.coins) ? object.coins.map((e: any) => Coin.fromAmino(e)) : [], - valAddr: object.val_addr, - poolId: BigInt(object.pool_id) - }; + const message = createBaseMsgCreateFullRangePositionAndSuperfluidDelegate(); + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + message.coins = object.coins?.map(e => Coin.fromAmino(e)) || []; + if (object.val_addr !== undefined && object.val_addr !== null) { + message.valAddr = object.val_addr; + } + if (object.pool_id !== undefined && object.pool_id !== null) { + message.poolId = BigInt(object.pool_id); + } + return message; }, toAmino(message: MsgCreateFullRangePositionAndSuperfluidDelegate): MsgCreateFullRangePositionAndSuperfluidDelegateAmino { const obj: any = {}; @@ -1267,7 +1383,7 @@ export const MsgCreateFullRangePositionAndSuperfluidDelegate = { }, toAminoMsg(message: MsgCreateFullRangePositionAndSuperfluidDelegate): MsgCreateFullRangePositionAndSuperfluidDelegateAminoMsg { return { - type: "osmosis/create-full-range-position-and-superfluid-delegate", + type: "osmosis/full-range-and-sf-delegate", value: MsgCreateFullRangePositionAndSuperfluidDelegate.toAmino(message) }; }, @@ -1328,10 +1444,14 @@ export const MsgCreateFullRangePositionAndSuperfluidDelegateResponse = { return message; }, fromAmino(object: MsgCreateFullRangePositionAndSuperfluidDelegateResponseAmino): MsgCreateFullRangePositionAndSuperfluidDelegateResponse { - return { - lockID: BigInt(object.lockID), - positionID: BigInt(object.positionID) - }; + const message = createBaseMsgCreateFullRangePositionAndSuperfluidDelegateResponse(); + if (object.lockID !== undefined && object.lockID !== null) { + message.lockID = BigInt(object.lockID); + } + if (object.positionID !== undefined && object.positionID !== null) { + message.positionID = BigInt(object.positionID); + } + return message; }, toAmino(message: MsgCreateFullRangePositionAndSuperfluidDelegateResponse): MsgCreateFullRangePositionAndSuperfluidDelegateResponseAmino { const obj: any = {}; @@ -1405,10 +1525,14 @@ export const MsgUnPoolWhitelistedPool = { return message; }, fromAmino(object: MsgUnPoolWhitelistedPoolAmino): MsgUnPoolWhitelistedPool { - return { - sender: object.sender, - poolId: BigInt(object.pool_id) - }; + const message = createBaseMsgUnPoolWhitelistedPool(); + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + if (object.pool_id !== undefined && object.pool_id !== null) { + message.poolId = BigInt(object.pool_id); + } + return message; }, toAmino(message: MsgUnPoolWhitelistedPool): MsgUnPoolWhitelistedPoolAmino { const obj: any = {}; @@ -1483,9 +1607,9 @@ export const MsgUnPoolWhitelistedPoolResponse = { return message; }, fromAmino(object: MsgUnPoolWhitelistedPoolResponseAmino): MsgUnPoolWhitelistedPoolResponse { - return { - exitedLockIds: Array.isArray(object?.exited_lock_ids) ? object.exited_lock_ids.map((e: any) => BigInt(e)) : [] - }; + const message = createBaseMsgUnPoolWhitelistedPoolResponse(); + message.exitedLockIds = object.exited_lock_ids?.map(e => BigInt(e)) || []; + return message; }, toAmino(message: MsgUnPoolWhitelistedPoolResponse): MsgUnPoolWhitelistedPoolResponseAmino { const obj: any = {}; @@ -1578,12 +1702,18 @@ export const MsgUnlockAndMigrateSharesToFullRangeConcentratedPosition = { return message; }, fromAmino(object: MsgUnlockAndMigrateSharesToFullRangeConcentratedPositionAmino): MsgUnlockAndMigrateSharesToFullRangeConcentratedPosition { - return { - sender: object.sender, - lockId: BigInt(object.lock_id), - sharesToMigrate: object?.shares_to_migrate ? Coin.fromAmino(object.shares_to_migrate) : undefined, - tokenOutMins: Array.isArray(object?.token_out_mins) ? object.token_out_mins.map((e: any) => Coin.fromAmino(e)) : [] - }; + const message = createBaseMsgUnlockAndMigrateSharesToFullRangeConcentratedPosition(); + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + if (object.lock_id !== undefined && object.lock_id !== null) { + message.lockId = BigInt(object.lock_id); + } + if (object.shares_to_migrate !== undefined && object.shares_to_migrate !== null) { + message.sharesToMigrate = Coin.fromAmino(object.shares_to_migrate); + } + message.tokenOutMins = object.token_out_mins?.map(e => Coin.fromAmino(e)) || []; + return message; }, toAmino(message: MsgUnlockAndMigrateSharesToFullRangeConcentratedPosition): MsgUnlockAndMigrateSharesToFullRangeConcentratedPositionAmino { const obj: any = {}; @@ -1602,7 +1732,7 @@ export const MsgUnlockAndMigrateSharesToFullRangeConcentratedPosition = { }, toAminoMsg(message: MsgUnlockAndMigrateSharesToFullRangeConcentratedPosition): MsgUnlockAndMigrateSharesToFullRangeConcentratedPositionAminoMsg { return { - type: "osmosis/unlock-and-migrate-shares-to-full-range-concentrated-position", + type: "osmosis/unlock-and-migrate", value: MsgUnlockAndMigrateSharesToFullRangeConcentratedPosition.toAmino(message) }; }, @@ -1679,19 +1809,27 @@ export const MsgUnlockAndMigrateSharesToFullRangeConcentratedPositionResponse = return message; }, fromAmino(object: MsgUnlockAndMigrateSharesToFullRangeConcentratedPositionResponseAmino): MsgUnlockAndMigrateSharesToFullRangeConcentratedPositionResponse { - return { - amount0: object.amount0, - amount1: object.amount1, - liquidityCreated: object.liquidity_created, - joinTime: object.join_time - }; + const message = createBaseMsgUnlockAndMigrateSharesToFullRangeConcentratedPositionResponse(); + if (object.amount0 !== undefined && object.amount0 !== null) { + message.amount0 = object.amount0; + } + if (object.amount1 !== undefined && object.amount1 !== null) { + message.amount1 = object.amount1; + } + if (object.liquidity_created !== undefined && object.liquidity_created !== null) { + message.liquidityCreated = object.liquidity_created; + } + if (object.join_time !== undefined && object.join_time !== null) { + message.joinTime = fromTimestamp(Timestamp.fromAmino(object.join_time)); + } + return message; }, toAmino(message: MsgUnlockAndMigrateSharesToFullRangeConcentratedPositionResponse): MsgUnlockAndMigrateSharesToFullRangeConcentratedPositionResponseAmino { const obj: any = {}; obj.amount0 = message.amount0; obj.amount1 = message.amount1; obj.liquidity_created = message.liquidityCreated; - obj.join_time = message.joinTime; + obj.join_time = message.joinTime ? Timestamp.toAmino(toTimestamp(message.joinTime)) : undefined; return obj; }, fromAminoMsg(object: MsgUnlockAndMigrateSharesToFullRangeConcentratedPositionResponseAminoMsg): MsgUnlockAndMigrateSharesToFullRangeConcentratedPositionResponse { @@ -1776,12 +1914,20 @@ export const MsgAddToConcentratedLiquiditySuperfluidPosition = { return message; }, fromAmino(object: MsgAddToConcentratedLiquiditySuperfluidPositionAmino): MsgAddToConcentratedLiquiditySuperfluidPosition { - return { - positionId: BigInt(object.position_id), - sender: object.sender, - tokenDesired0: object?.token_desired0 ? Coin.fromAmino(object.token_desired0) : undefined, - tokenDesired1: object?.token_desired1 ? Coin.fromAmino(object.token_desired1) : undefined - }; + const message = createBaseMsgAddToConcentratedLiquiditySuperfluidPosition(); + if (object.position_id !== undefined && object.position_id !== null) { + message.positionId = BigInt(object.position_id); + } + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + if (object.token_desired0 !== undefined && object.token_desired0 !== null) { + message.tokenDesired0 = Coin.fromAmino(object.token_desired0); + } + if (object.token_desired1 !== undefined && object.token_desired1 !== null) { + message.tokenDesired1 = Coin.fromAmino(object.token_desired1); + } + return message; }, toAmino(message: MsgAddToConcentratedLiquiditySuperfluidPosition): MsgAddToConcentratedLiquiditySuperfluidPositionAmino { const obj: any = {}; @@ -1796,7 +1942,7 @@ export const MsgAddToConcentratedLiquiditySuperfluidPosition = { }, toAminoMsg(message: MsgAddToConcentratedLiquiditySuperfluidPosition): MsgAddToConcentratedLiquiditySuperfluidPositionAminoMsg { return { - type: "osmosis/add-to-concentrated-liquidity-superfluid-position", + type: "osmosis/add-to-cl-superfluid-position", value: MsgAddToConcentratedLiquiditySuperfluidPosition.toAmino(message) }; }, @@ -1881,13 +2027,23 @@ export const MsgAddToConcentratedLiquiditySuperfluidPositionResponse = { return message; }, fromAmino(object: MsgAddToConcentratedLiquiditySuperfluidPositionResponseAmino): MsgAddToConcentratedLiquiditySuperfluidPositionResponse { - return { - positionId: BigInt(object.position_id), - amount0: object.amount0, - amount1: object.amount1, - newLiquidity: object.new_liquidity, - lockId: BigInt(object.lock_id) - }; + const message = createBaseMsgAddToConcentratedLiquiditySuperfluidPositionResponse(); + if (object.position_id !== undefined && object.position_id !== null) { + message.positionId = BigInt(object.position_id); + } + if (object.amount0 !== undefined && object.amount0 !== null) { + message.amount0 = object.amount0; + } + if (object.amount1 !== undefined && object.amount1 !== null) { + message.amount1 = object.amount1; + } + if (object.new_liquidity !== undefined && object.new_liquidity !== null) { + message.newLiquidity = object.new_liquidity; + } + if (object.lock_id !== undefined && object.lock_id !== null) { + message.lockId = BigInt(object.lock_id); + } + return message; }, toAmino(message: MsgAddToConcentratedLiquiditySuperfluidPositionResponse): MsgAddToConcentratedLiquiditySuperfluidPositionResponseAmino { const obj: any = {}; @@ -1919,4 +2075,190 @@ export const MsgAddToConcentratedLiquiditySuperfluidPositionResponse = { value: MsgAddToConcentratedLiquiditySuperfluidPositionResponse.encode(message).finish() }; } +}; +function createBaseMsgUnbondConvertAndStake(): MsgUnbondConvertAndStake { + return { + lockId: BigInt(0), + sender: "", + valAddr: "", + minAmtToStake: "", + sharesToConvert: Coin.fromPartial({}) + }; +} +export const MsgUnbondConvertAndStake = { + typeUrl: "/osmosis.superfluid.MsgUnbondConvertAndStake", + encode(message: MsgUnbondConvertAndStake, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.lockId !== BigInt(0)) { + writer.uint32(8).uint64(message.lockId); + } + if (message.sender !== "") { + writer.uint32(18).string(message.sender); + } + if (message.valAddr !== "") { + writer.uint32(26).string(message.valAddr); + } + if (message.minAmtToStake !== "") { + writer.uint32(34).string(message.minAmtToStake); + } + if (message.sharesToConvert !== undefined) { + Coin.encode(message.sharesToConvert, writer.uint32(42).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgUnbondConvertAndStake { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUnbondConvertAndStake(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.lockId = reader.uint64(); + break; + case 2: + message.sender = reader.string(); + break; + case 3: + message.valAddr = reader.string(); + break; + case 4: + message.minAmtToStake = reader.string(); + break; + case 5: + message.sharesToConvert = Coin.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgUnbondConvertAndStake { + const message = createBaseMsgUnbondConvertAndStake(); + message.lockId = object.lockId !== undefined && object.lockId !== null ? BigInt(object.lockId.toString()) : BigInt(0); + message.sender = object.sender ?? ""; + message.valAddr = object.valAddr ?? ""; + message.minAmtToStake = object.minAmtToStake ?? ""; + message.sharesToConvert = object.sharesToConvert !== undefined && object.sharesToConvert !== null ? Coin.fromPartial(object.sharesToConvert) : undefined; + return message; + }, + fromAmino(object: MsgUnbondConvertAndStakeAmino): MsgUnbondConvertAndStake { + const message = createBaseMsgUnbondConvertAndStake(); + if (object.lock_id !== undefined && object.lock_id !== null) { + message.lockId = BigInt(object.lock_id); + } + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + if (object.val_addr !== undefined && object.val_addr !== null) { + message.valAddr = object.val_addr; + } + if (object.min_amt_to_stake !== undefined && object.min_amt_to_stake !== null) { + message.minAmtToStake = object.min_amt_to_stake; + } + if (object.shares_to_convert !== undefined && object.shares_to_convert !== null) { + message.sharesToConvert = Coin.fromAmino(object.shares_to_convert); + } + return message; + }, + toAmino(message: MsgUnbondConvertAndStake): MsgUnbondConvertAndStakeAmino { + const obj: any = {}; + obj.lock_id = message.lockId ? message.lockId.toString() : undefined; + obj.sender = message.sender; + obj.val_addr = message.valAddr; + obj.min_amt_to_stake = message.minAmtToStake; + obj.shares_to_convert = message.sharesToConvert ? Coin.toAmino(message.sharesToConvert) : undefined; + return obj; + }, + fromAminoMsg(object: MsgUnbondConvertAndStakeAminoMsg): MsgUnbondConvertAndStake { + return MsgUnbondConvertAndStake.fromAmino(object.value); + }, + toAminoMsg(message: MsgUnbondConvertAndStake): MsgUnbondConvertAndStakeAminoMsg { + return { + type: "osmosis/unbond-convert-and-stake", + value: MsgUnbondConvertAndStake.toAmino(message) + }; + }, + fromProtoMsg(message: MsgUnbondConvertAndStakeProtoMsg): MsgUnbondConvertAndStake { + return MsgUnbondConvertAndStake.decode(message.value); + }, + toProto(message: MsgUnbondConvertAndStake): Uint8Array { + return MsgUnbondConvertAndStake.encode(message).finish(); + }, + toProtoMsg(message: MsgUnbondConvertAndStake): MsgUnbondConvertAndStakeProtoMsg { + return { + typeUrl: "/osmosis.superfluid.MsgUnbondConvertAndStake", + value: MsgUnbondConvertAndStake.encode(message).finish() + }; + } +}; +function createBaseMsgUnbondConvertAndStakeResponse(): MsgUnbondConvertAndStakeResponse { + return { + totalAmtStaked: "" + }; +} +export const MsgUnbondConvertAndStakeResponse = { + typeUrl: "/osmosis.superfluid.MsgUnbondConvertAndStakeResponse", + encode(message: MsgUnbondConvertAndStakeResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.totalAmtStaked !== "") { + writer.uint32(10).string(message.totalAmtStaked); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgUnbondConvertAndStakeResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUnbondConvertAndStakeResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.totalAmtStaked = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgUnbondConvertAndStakeResponse { + const message = createBaseMsgUnbondConvertAndStakeResponse(); + message.totalAmtStaked = object.totalAmtStaked ?? ""; + return message; + }, + fromAmino(object: MsgUnbondConvertAndStakeResponseAmino): MsgUnbondConvertAndStakeResponse { + const message = createBaseMsgUnbondConvertAndStakeResponse(); + if (object.total_amt_staked !== undefined && object.total_amt_staked !== null) { + message.totalAmtStaked = object.total_amt_staked; + } + return message; + }, + toAmino(message: MsgUnbondConvertAndStakeResponse): MsgUnbondConvertAndStakeResponseAmino { + const obj: any = {}; + obj.total_amt_staked = message.totalAmtStaked; + return obj; + }, + fromAminoMsg(object: MsgUnbondConvertAndStakeResponseAminoMsg): MsgUnbondConvertAndStakeResponse { + return MsgUnbondConvertAndStakeResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgUnbondConvertAndStakeResponse): MsgUnbondConvertAndStakeResponseAminoMsg { + return { + type: "osmosis/unbond-convert-and-stake-response", + value: MsgUnbondConvertAndStakeResponse.toAmino(message) + }; + }, + fromProtoMsg(message: MsgUnbondConvertAndStakeResponseProtoMsg): MsgUnbondConvertAndStakeResponse { + return MsgUnbondConvertAndStakeResponse.decode(message.value); + }, + toProto(message: MsgUnbondConvertAndStakeResponse): Uint8Array { + return MsgUnbondConvertAndStakeResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgUnbondConvertAndStakeResponse): MsgUnbondConvertAndStakeResponseProtoMsg { + return { + typeUrl: "/osmosis.superfluid.MsgUnbondConvertAndStakeResponse", + value: MsgUnbondConvertAndStakeResponse.encode(message).finish() + }; + } }; \ No newline at end of file diff --git a/packages/osmo-query/src/codegen/osmosis/superfluid/v1beta1/gov.ts b/packages/osmo-query/src/codegen/osmosis/superfluid/v1beta1/gov.ts index 89ee80a06..47629d13a 100644 --- a/packages/osmo-query/src/codegen/osmosis/superfluid/v1beta1/gov.ts +++ b/packages/osmo-query/src/codegen/osmosis/superfluid/v1beta1/gov.ts @@ -5,7 +5,7 @@ import { BinaryReader, BinaryWriter } from "../../../binary"; * assets */ export interface SetSuperfluidAssetsProposal { - $typeUrl?: string; + $typeUrl?: "/osmosis.superfluid.v1beta1.SetSuperfluidAssetsProposal"; title: string; description: string; assets: SuperfluidAsset[]; @@ -19,9 +19,9 @@ export interface SetSuperfluidAssetsProposalProtoMsg { * assets */ export interface SetSuperfluidAssetsProposalAmino { - title: string; - description: string; - assets: SuperfluidAssetAmino[]; + title?: string; + description?: string; + assets?: SuperfluidAssetAmino[]; } export interface SetSuperfluidAssetsProposalAminoMsg { type: "osmosis/set-superfluid-assets-proposal"; @@ -32,7 +32,7 @@ export interface SetSuperfluidAssetsProposalAminoMsg { * assets */ export interface SetSuperfluidAssetsProposalSDKType { - $typeUrl?: string; + $typeUrl?: "/osmosis.superfluid.v1beta1.SetSuperfluidAssetsProposal"; title: string; description: string; assets: SuperfluidAssetSDKType[]; @@ -42,7 +42,7 @@ export interface SetSuperfluidAssetsProposalSDKType { * assets by denom */ export interface RemoveSuperfluidAssetsProposal { - $typeUrl?: string; + $typeUrl?: "/osmosis.superfluid.v1beta1.RemoveSuperfluidAssetsProposal"; title: string; description: string; superfluidAssetDenoms: string[]; @@ -56,9 +56,9 @@ export interface RemoveSuperfluidAssetsProposalProtoMsg { * assets by denom */ export interface RemoveSuperfluidAssetsProposalAmino { - title: string; - description: string; - superfluid_asset_denoms: string[]; + title?: string; + description?: string; + superfluid_asset_denoms?: string[]; } export interface RemoveSuperfluidAssetsProposalAminoMsg { type: "osmosis/del-superfluid-assets-proposal"; @@ -69,7 +69,7 @@ export interface RemoveSuperfluidAssetsProposalAminoMsg { * assets by denom */ export interface RemoveSuperfluidAssetsProposalSDKType { - $typeUrl?: string; + $typeUrl?: "/osmosis.superfluid.v1beta1.RemoveSuperfluidAssetsProposal"; title: string; description: string; superfluid_asset_denoms: string[]; @@ -79,7 +79,7 @@ export interface RemoveSuperfluidAssetsProposalSDKType { * allowed list of pool ids. */ export interface UpdateUnpoolWhiteListProposal { - $typeUrl?: string; + $typeUrl?: "/osmosis.superfluid.v1beta1.UpdateUnpoolWhiteListProposal"; title: string; description: string; ids: bigint[]; @@ -94,10 +94,10 @@ export interface UpdateUnpoolWhiteListProposalProtoMsg { * allowed list of pool ids. */ export interface UpdateUnpoolWhiteListProposalAmino { - title: string; - description: string; - ids: string[]; - is_overwrite: boolean; + title?: string; + description?: string; + ids?: string[]; + is_overwrite?: boolean; } export interface UpdateUnpoolWhiteListProposalAminoMsg { type: "osmosis/update-unpool-whitelist"; @@ -108,7 +108,7 @@ export interface UpdateUnpoolWhiteListProposalAminoMsg { * allowed list of pool ids. */ export interface UpdateUnpoolWhiteListProposalSDKType { - $typeUrl?: string; + $typeUrl?: "/osmosis.superfluid.v1beta1.UpdateUnpoolWhiteListProposal"; title: string; description: string; ids: bigint[]; @@ -167,11 +167,15 @@ export const SetSuperfluidAssetsProposal = { return message; }, fromAmino(object: SetSuperfluidAssetsProposalAmino): SetSuperfluidAssetsProposal { - return { - title: object.title, - description: object.description, - assets: Array.isArray(object?.assets) ? object.assets.map((e: any) => SuperfluidAsset.fromAmino(e)) : [] - }; + const message = createBaseSetSuperfluidAssetsProposal(); + if (object.title !== undefined && object.title !== null) { + message.title = object.title; + } + if (object.description !== undefined && object.description !== null) { + message.description = object.description; + } + message.assets = object.assets?.map(e => SuperfluidAsset.fromAmino(e)) || []; + return message; }, toAmino(message: SetSuperfluidAssetsProposal): SetSuperfluidAssetsProposalAmino { const obj: any = {}; @@ -259,11 +263,15 @@ export const RemoveSuperfluidAssetsProposal = { return message; }, fromAmino(object: RemoveSuperfluidAssetsProposalAmino): RemoveSuperfluidAssetsProposal { - return { - title: object.title, - description: object.description, - superfluidAssetDenoms: Array.isArray(object?.superfluid_asset_denoms) ? object.superfluid_asset_denoms.map((e: any) => e) : [] - }; + const message = createBaseRemoveSuperfluidAssetsProposal(); + if (object.title !== undefined && object.title !== null) { + message.title = object.title; + } + if (object.description !== undefined && object.description !== null) { + message.description = object.description; + } + message.superfluidAssetDenoms = object.superfluid_asset_denoms?.map(e => e) || []; + return message; }, toAmino(message: RemoveSuperfluidAssetsProposal): RemoveSuperfluidAssetsProposalAmino { const obj: any = {}; @@ -368,12 +376,18 @@ export const UpdateUnpoolWhiteListProposal = { return message; }, fromAmino(object: UpdateUnpoolWhiteListProposalAmino): UpdateUnpoolWhiteListProposal { - return { - title: object.title, - description: object.description, - ids: Array.isArray(object?.ids) ? object.ids.map((e: any) => BigInt(e)) : [], - isOverwrite: object.is_overwrite - }; + const message = createBaseUpdateUnpoolWhiteListProposal(); + if (object.title !== undefined && object.title !== null) { + message.title = object.title; + } + if (object.description !== undefined && object.description !== null) { + message.description = object.description; + } + message.ids = object.ids?.map(e => BigInt(e)) || []; + if (object.is_overwrite !== undefined && object.is_overwrite !== null) { + message.isOverwrite = object.is_overwrite; + } + return message; }, toAmino(message: UpdateUnpoolWhiteListProposal): UpdateUnpoolWhiteListProposalAmino { const obj: any = {}; diff --git a/packages/osmo-query/src/codegen/osmosis/tokenfactory/v1beta1/authorityMetadata.ts b/packages/osmo-query/src/codegen/osmosis/tokenfactory/v1beta1/authorityMetadata.ts index 14b8ac9b5..a9498f0e0 100644 --- a/packages/osmo-query/src/codegen/osmosis/tokenfactory/v1beta1/authorityMetadata.ts +++ b/packages/osmo-query/src/codegen/osmosis/tokenfactory/v1beta1/authorityMetadata.ts @@ -19,7 +19,7 @@ export interface DenomAuthorityMetadataProtoMsg { */ export interface DenomAuthorityMetadataAmino { /** Can be empty for no admin, or a valid osmosis address */ - admin: string; + admin?: string; } export interface DenomAuthorityMetadataAminoMsg { type: "osmosis/tokenfactory/denom-authority-metadata"; @@ -69,9 +69,11 @@ export const DenomAuthorityMetadata = { return message; }, fromAmino(object: DenomAuthorityMetadataAmino): DenomAuthorityMetadata { - return { - admin: object.admin - }; + const message = createBaseDenomAuthorityMetadata(); + if (object.admin !== undefined && object.admin !== null) { + message.admin = object.admin; + } + return message; }, toAmino(message: DenomAuthorityMetadata): DenomAuthorityMetadataAmino { const obj: any = {}; diff --git a/packages/osmo-query/src/codegen/osmosis/tokenfactory/v1beta1/genesis.ts b/packages/osmo-query/src/codegen/osmosis/tokenfactory/v1beta1/genesis.ts index 3ebcb731a..a9b9e8bc1 100644 --- a/packages/osmo-query/src/codegen/osmosis/tokenfactory/v1beta1/genesis.ts +++ b/packages/osmo-query/src/codegen/osmosis/tokenfactory/v1beta1/genesis.ts @@ -3,7 +3,7 @@ import { DenomAuthorityMetadata, DenomAuthorityMetadataAmino, DenomAuthorityMeta import { BinaryReader, BinaryWriter } from "../../../binary"; /** GenesisState defines the tokenfactory module's genesis state. */ export interface GenesisState { - /** params defines the paramaters of the module. */ + /** params defines the parameters of the module. */ params: Params; factoryDenoms: GenesisDenom[]; } @@ -13,9 +13,9 @@ export interface GenesisStateProtoMsg { } /** GenesisState defines the tokenfactory module's genesis state. */ export interface GenesisStateAmino { - /** params defines the paramaters of the module. */ + /** params defines the parameters of the module. */ params?: ParamsAmino; - factory_denoms: GenesisDenomAmino[]; + factory_denoms?: GenesisDenomAmino[]; } export interface GenesisStateAminoMsg { type: "osmosis/tokenfactory/genesis-state"; @@ -45,7 +45,7 @@ export interface GenesisDenomProtoMsg { * denom's admin. */ export interface GenesisDenomAmino { - denom: string; + denom?: string; authority_metadata?: DenomAuthorityMetadataAmino; } export interface GenesisDenomAminoMsg { @@ -105,10 +105,12 @@ export const GenesisState = { return message; }, fromAmino(object: GenesisStateAmino): GenesisState { - return { - params: object?.params ? Params.fromAmino(object.params) : undefined, - factoryDenoms: Array.isArray(object?.factory_denoms) ? object.factory_denoms.map((e: any) => GenesisDenom.fromAmino(e)) : [] - }; + const message = createBaseGenesisState(); + if (object.params !== undefined && object.params !== null) { + message.params = Params.fromAmino(object.params); + } + message.factoryDenoms = object.factory_denoms?.map(e => GenesisDenom.fromAmino(e)) || []; + return message; }, toAmino(message: GenesisState): GenesisStateAmino { const obj: any = {}; @@ -186,10 +188,14 @@ export const GenesisDenom = { return message; }, fromAmino(object: GenesisDenomAmino): GenesisDenom { - return { - denom: object.denom, - authorityMetadata: object?.authority_metadata ? DenomAuthorityMetadata.fromAmino(object.authority_metadata) : undefined - }; + const message = createBaseGenesisDenom(); + if (object.denom !== undefined && object.denom !== null) { + message.denom = object.denom; + } + if (object.authority_metadata !== undefined && object.authority_metadata !== null) { + message.authorityMetadata = DenomAuthorityMetadata.fromAmino(object.authority_metadata); + } + return message; }, toAmino(message: GenesisDenom): GenesisDenomAmino { const obj: any = {}; diff --git a/packages/osmo-query/src/codegen/osmosis/tokenfactory/v1beta1/params.ts b/packages/osmo-query/src/codegen/osmosis/tokenfactory/v1beta1/params.ts index ad395087e..5b29a1aca 100644 --- a/packages/osmo-query/src/codegen/osmosis/tokenfactory/v1beta1/params.ts +++ b/packages/osmo-query/src/codegen/osmosis/tokenfactory/v1beta1/params.ts @@ -27,14 +27,14 @@ export interface ParamsAmino { * denom. The fee is drawn from the MsgCreateDenom's sender account, and * transferred to the community pool. */ - denom_creation_fee: CoinAmino[]; + denom_creation_fee?: CoinAmino[]; /** * DenomCreationGasConsume defines the gas cost for creating a new denom. * This is intended as a spam deterrence mechanism. * * See: https://github.com/CosmWasm/token-factory/issues/11 */ - denom_creation_gas_consume: string; + denom_creation_gas_consume?: string; } export interface ParamsAminoMsg { type: "osmosis/tokenfactory/params"; @@ -89,10 +89,12 @@ export const Params = { return message; }, fromAmino(object: ParamsAmino): Params { - return { - denomCreationFee: Array.isArray(object?.denom_creation_fee) ? object.denom_creation_fee.map((e: any) => Coin.fromAmino(e)) : [], - denomCreationGasConsume: object?.denom_creation_gas_consume ? BigInt(object.denom_creation_gas_consume) : undefined - }; + const message = createBaseParams(); + message.denomCreationFee = object.denom_creation_fee?.map(e => Coin.fromAmino(e)) || []; + if (object.denom_creation_gas_consume !== undefined && object.denom_creation_gas_consume !== null) { + message.denomCreationGasConsume = BigInt(object.denom_creation_gas_consume); + } + return message; }, toAmino(message: Params): ParamsAmino { const obj: any = {}; diff --git a/packages/osmo-query/src/codegen/osmosis/tokenfactory/v1beta1/query.lcd.ts b/packages/osmo-query/src/codegen/osmosis/tokenfactory/v1beta1/query.lcd.ts index 45d81527e..3b278af95 100644 --- a/packages/osmo-query/src/codegen/osmosis/tokenfactory/v1beta1/query.lcd.ts +++ b/packages/osmo-query/src/codegen/osmosis/tokenfactory/v1beta1/query.lcd.ts @@ -1,5 +1,5 @@ import { LCDClient } from "@cosmology/lcd"; -import { QueryParamsRequest, QueryParamsResponseSDKType, QueryDenomAuthorityMetadataRequest, QueryDenomAuthorityMetadataResponseSDKType, QueryDenomsFromCreatorRequest, QueryDenomsFromCreatorResponseSDKType } from "./query"; +import { QueryParamsRequest, QueryParamsResponseSDKType, QueryDenomAuthorityMetadataRequest, QueryDenomAuthorityMetadataResponseSDKType, QueryDenomsFromCreatorRequest, QueryDenomsFromCreatorResponseSDKType, QueryBeforeSendHookAddressRequest, QueryBeforeSendHookAddressResponseSDKType } from "./query"; export class LCDQueryClient { req: LCDClient; constructor({ @@ -11,6 +11,7 @@ export class LCDQueryClient { this.params = this.params.bind(this); this.denomAuthorityMetadata = this.denomAuthorityMetadata.bind(this); this.denomsFromCreator = this.denomsFromCreator.bind(this); + this.beforeSendHookAddress = this.beforeSendHookAddress.bind(this); } /* Params defines a gRPC query method that returns the tokenfactory module's parameters. */ @@ -30,4 +31,10 @@ export class LCDQueryClient { const endpoint = `osmosis/tokenfactory/v1beta1/denoms_from_creator/${params.creator}`; return await this.req.get(endpoint); } + /* BeforeSendHookAddress defines a gRPC query method for + getting the address registered for the before send hook. */ + async beforeSendHookAddress(params: QueryBeforeSendHookAddressRequest): Promise { + const endpoint = `osmosis/tokenfactory/v1beta1/denoms/${params.denom}/before_send_hook`; + return await this.req.get(endpoint); + } } \ No newline at end of file diff --git a/packages/osmo-query/src/codegen/osmosis/tokenfactory/v1beta1/query.rpc.Query.ts b/packages/osmo-query/src/codegen/osmosis/tokenfactory/v1beta1/query.rpc.Query.ts index e4d9b08f7..3e17735a5 100644 --- a/packages/osmo-query/src/codegen/osmosis/tokenfactory/v1beta1/query.rpc.Query.ts +++ b/packages/osmo-query/src/codegen/osmosis/tokenfactory/v1beta1/query.rpc.Query.ts @@ -3,7 +3,7 @@ import { BinaryReader } from "../../../binary"; import { QueryClient, createProtobufRpcClient, ProtobufRpcClient } from "@cosmjs/stargate"; import { ReactQueryParams } from "../../../react-query"; import { useQuery } from "@tanstack/react-query"; -import { QueryParamsRequest, QueryParamsResponse, QueryDenomAuthorityMetadataRequest, QueryDenomAuthorityMetadataResponse, QueryDenomsFromCreatorRequest, QueryDenomsFromCreatorResponse } from "./query"; +import { QueryParamsRequest, QueryParamsResponse, QueryDenomAuthorityMetadataRequest, QueryDenomAuthorityMetadataResponse, QueryDenomsFromCreatorRequest, QueryDenomsFromCreatorResponse, QueryBeforeSendHookAddressRequest, QueryBeforeSendHookAddressResponse } from "./query"; /** Query defines the gRPC querier service. */ export interface Query { /** @@ -21,6 +21,11 @@ export interface Query { * denominations created by a specific admin/creator. */ denomsFromCreator(request: QueryDenomsFromCreatorRequest): Promise; + /** + * BeforeSendHookAddress defines a gRPC query method for + * getting the address registered for the before send hook. + */ + beforeSendHookAddress(request: QueryBeforeSendHookAddressRequest): Promise; } export class QueryClientImpl implements Query { private readonly rpc: Rpc; @@ -29,6 +34,7 @@ export class QueryClientImpl implements Query { this.params = this.params.bind(this); this.denomAuthorityMetadata = this.denomAuthorityMetadata.bind(this); this.denomsFromCreator = this.denomsFromCreator.bind(this); + this.beforeSendHookAddress = this.beforeSendHookAddress.bind(this); } params(request: QueryParamsRequest = {}): Promise { const data = QueryParamsRequest.encode(request).finish(); @@ -45,6 +51,11 @@ export class QueryClientImpl implements Query { const promise = this.rpc.request("osmosis.tokenfactory.v1beta1.Query", "DenomsFromCreator", data); return promise.then(data => QueryDenomsFromCreatorResponse.decode(new BinaryReader(data))); } + beforeSendHookAddress(request: QueryBeforeSendHookAddressRequest): Promise { + const data = QueryBeforeSendHookAddressRequest.encode(request).finish(); + const promise = this.rpc.request("osmosis.tokenfactory.v1beta1.Query", "BeforeSendHookAddress", data); + return promise.then(data => QueryBeforeSendHookAddressResponse.decode(new BinaryReader(data))); + } } export const createRpcQueryExtension = (base: QueryClient) => { const rpc = createProtobufRpcClient(base); @@ -58,6 +69,9 @@ export const createRpcQueryExtension = (base: QueryClient) => { }, denomsFromCreator(request: QueryDenomsFromCreatorRequest): Promise { return queryService.denomsFromCreator(request); + }, + beforeSendHookAddress(request: QueryBeforeSendHookAddressRequest): Promise { + return queryService.beforeSendHookAddress(request); } }; }; @@ -70,6 +84,9 @@ export interface UseDenomAuthorityMetadataQuery extends ReactQueryParams< export interface UseDenomsFromCreatorQuery extends ReactQueryParams { request: QueryDenomsFromCreatorRequest; } +export interface UseBeforeSendHookAddressQuery extends ReactQueryParams { + request: QueryBeforeSendHookAddressRequest; +} const _queryClients: WeakMap = new WeakMap(); const getQueryService = (rpc: ProtobufRpcClient | undefined): QueryClientImpl | undefined => { if (!rpc) return; @@ -109,6 +126,15 @@ export const createRpcQueryHooks = (rpc: ProtobufRpcClient | undefined) => { return queryService.denomsFromCreator(request); }, options); }; + const useBeforeSendHookAddress = ({ + request, + options + }: UseBeforeSendHookAddressQuery) => { + return useQuery(["beforeSendHookAddressQuery", request], () => { + if (!queryService) throw new Error("Query Service not initialized"); + return queryService.beforeSendHookAddress(request); + }, options); + }; return { /** * Params defines a gRPC query method that returns the tokenfactory module's @@ -124,6 +150,11 @@ export const createRpcQueryHooks = (rpc: ProtobufRpcClient | undefined) => { * DenomsFromCreator defines a gRPC query method for fetching all * denominations created by a specific admin/creator. */ - useDenomsFromCreator + useDenomsFromCreator, + /** + * BeforeSendHookAddress defines a gRPC query method for + * getting the address registered for the before send hook. + */ + useBeforeSendHookAddress }; }; \ No newline at end of file diff --git a/packages/osmo-query/src/codegen/osmosis/tokenfactory/v1beta1/query.ts b/packages/osmo-query/src/codegen/osmosis/tokenfactory/v1beta1/query.ts index b699f367d..a529e19e6 100644 --- a/packages/osmo-query/src/codegen/osmosis/tokenfactory/v1beta1/query.ts +++ b/packages/osmo-query/src/codegen/osmosis/tokenfactory/v1beta1/query.ts @@ -53,7 +53,7 @@ export interface QueryDenomAuthorityMetadataRequestProtoMsg { * DenomAuthorityMetadata gRPC query. */ export interface QueryDenomAuthorityMetadataRequestAmino { - denom: string; + denom?: string; } export interface QueryDenomAuthorityMetadataRequestAminoMsg { type: "osmosis/tokenfactory/query-denom-authority-metadata-request"; @@ -111,7 +111,7 @@ export interface QueryDenomsFromCreatorRequestProtoMsg { * DenomsFromCreator gRPC query. */ export interface QueryDenomsFromCreatorRequestAmino { - creator: string; + creator?: string; } export interface QueryDenomsFromCreatorRequestAminoMsg { type: "osmosis/tokenfactory/query-denoms-from-creator-request"; @@ -140,7 +140,7 @@ export interface QueryDenomsFromCreatorResponseProtoMsg { * DenomsFromCreator gRPC query. */ export interface QueryDenomsFromCreatorResponseAmino { - denoms: string[]; + denoms?: string[]; } export interface QueryDenomsFromCreatorResponseAminoMsg { type: "osmosis/tokenfactory/query-denoms-from-creator-response"; @@ -153,6 +153,52 @@ export interface QueryDenomsFromCreatorResponseAminoMsg { export interface QueryDenomsFromCreatorResponseSDKType { denoms: string[]; } +export interface QueryBeforeSendHookAddressRequest { + denom: string; +} +export interface QueryBeforeSendHookAddressRequestProtoMsg { + typeUrl: "/osmosis.tokenfactory.v1beta1.QueryBeforeSendHookAddressRequest"; + value: Uint8Array; +} +export interface QueryBeforeSendHookAddressRequestAmino { + denom?: string; +} +export interface QueryBeforeSendHookAddressRequestAminoMsg { + type: "osmosis/tokenfactory/query-before-send-hook-address-request"; + value: QueryBeforeSendHookAddressRequestAmino; +} +export interface QueryBeforeSendHookAddressRequestSDKType { + denom: string; +} +/** + * QueryBeforeSendHookAddressResponse defines the response structure for the + * DenomBeforeSendHook gRPC query. + */ +export interface QueryBeforeSendHookAddressResponse { + cosmwasmAddress: string; +} +export interface QueryBeforeSendHookAddressResponseProtoMsg { + typeUrl: "/osmosis.tokenfactory.v1beta1.QueryBeforeSendHookAddressResponse"; + value: Uint8Array; +} +/** + * QueryBeforeSendHookAddressResponse defines the response structure for the + * DenomBeforeSendHook gRPC query. + */ +export interface QueryBeforeSendHookAddressResponseAmino { + cosmwasm_address?: string; +} +export interface QueryBeforeSendHookAddressResponseAminoMsg { + type: "osmosis/tokenfactory/query-before-send-hook-address-response"; + value: QueryBeforeSendHookAddressResponseAmino; +} +/** + * QueryBeforeSendHookAddressResponse defines the response structure for the + * DenomBeforeSendHook gRPC query. + */ +export interface QueryBeforeSendHookAddressResponseSDKType { + cosmwasm_address: string; +} function createBaseQueryParamsRequest(): QueryParamsRequest { return {}; } @@ -180,7 +226,8 @@ export const QueryParamsRequest = { return message; }, fromAmino(_: QueryParamsRequestAmino): QueryParamsRequest { - return {}; + const message = createBaseQueryParamsRequest(); + return message; }, toAmino(_: QueryParamsRequest): QueryParamsRequestAmino { const obj: any = {}; @@ -244,9 +291,11 @@ export const QueryParamsResponse = { return message; }, fromAmino(object: QueryParamsResponseAmino): QueryParamsResponse { - return { - params: object?.params ? Params.fromAmino(object.params) : undefined - }; + const message = createBaseQueryParamsResponse(); + if (object.params !== undefined && object.params !== null) { + message.params = Params.fromAmino(object.params); + } + return message; }, toAmino(message: QueryParamsResponse): QueryParamsResponseAmino { const obj: any = {}; @@ -311,9 +360,11 @@ export const QueryDenomAuthorityMetadataRequest = { return message; }, fromAmino(object: QueryDenomAuthorityMetadataRequestAmino): QueryDenomAuthorityMetadataRequest { - return { - denom: object.denom - }; + const message = createBaseQueryDenomAuthorityMetadataRequest(); + if (object.denom !== undefined && object.denom !== null) { + message.denom = object.denom; + } + return message; }, toAmino(message: QueryDenomAuthorityMetadataRequest): QueryDenomAuthorityMetadataRequestAmino { const obj: any = {}; @@ -378,9 +429,11 @@ export const QueryDenomAuthorityMetadataResponse = { return message; }, fromAmino(object: QueryDenomAuthorityMetadataResponseAmino): QueryDenomAuthorityMetadataResponse { - return { - authorityMetadata: object?.authority_metadata ? DenomAuthorityMetadata.fromAmino(object.authority_metadata) : undefined - }; + const message = createBaseQueryDenomAuthorityMetadataResponse(); + if (object.authority_metadata !== undefined && object.authority_metadata !== null) { + message.authorityMetadata = DenomAuthorityMetadata.fromAmino(object.authority_metadata); + } + return message; }, toAmino(message: QueryDenomAuthorityMetadataResponse): QueryDenomAuthorityMetadataResponseAmino { const obj: any = {}; @@ -445,9 +498,11 @@ export const QueryDenomsFromCreatorRequest = { return message; }, fromAmino(object: QueryDenomsFromCreatorRequestAmino): QueryDenomsFromCreatorRequest { - return { - creator: object.creator - }; + const message = createBaseQueryDenomsFromCreatorRequest(); + if (object.creator !== undefined && object.creator !== null) { + message.creator = object.creator; + } + return message; }, toAmino(message: QueryDenomsFromCreatorRequest): QueryDenomsFromCreatorRequestAmino { const obj: any = {}; @@ -512,9 +567,9 @@ export const QueryDenomsFromCreatorResponse = { return message; }, fromAmino(object: QueryDenomsFromCreatorResponseAmino): QueryDenomsFromCreatorResponse { - return { - denoms: Array.isArray(object?.denoms) ? object.denoms.map((e: any) => e) : [] - }; + const message = createBaseQueryDenomsFromCreatorResponse(); + message.denoms = object.denoms?.map(e => e) || []; + return message; }, toAmino(message: QueryDenomsFromCreatorResponse): QueryDenomsFromCreatorResponseAmino { const obj: any = {}; @@ -546,4 +601,142 @@ export const QueryDenomsFromCreatorResponse = { value: QueryDenomsFromCreatorResponse.encode(message).finish() }; } +}; +function createBaseQueryBeforeSendHookAddressRequest(): QueryBeforeSendHookAddressRequest { + return { + denom: "" + }; +} +export const QueryBeforeSendHookAddressRequest = { + typeUrl: "/osmosis.tokenfactory.v1beta1.QueryBeforeSendHookAddressRequest", + encode(message: QueryBeforeSendHookAddressRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.denom !== "") { + writer.uint32(10).string(message.denom); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryBeforeSendHookAddressRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryBeforeSendHookAddressRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.denom = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryBeforeSendHookAddressRequest { + const message = createBaseQueryBeforeSendHookAddressRequest(); + message.denom = object.denom ?? ""; + return message; + }, + fromAmino(object: QueryBeforeSendHookAddressRequestAmino): QueryBeforeSendHookAddressRequest { + const message = createBaseQueryBeforeSendHookAddressRequest(); + if (object.denom !== undefined && object.denom !== null) { + message.denom = object.denom; + } + return message; + }, + toAmino(message: QueryBeforeSendHookAddressRequest): QueryBeforeSendHookAddressRequestAmino { + const obj: any = {}; + obj.denom = message.denom; + return obj; + }, + fromAminoMsg(object: QueryBeforeSendHookAddressRequestAminoMsg): QueryBeforeSendHookAddressRequest { + return QueryBeforeSendHookAddressRequest.fromAmino(object.value); + }, + toAminoMsg(message: QueryBeforeSendHookAddressRequest): QueryBeforeSendHookAddressRequestAminoMsg { + return { + type: "osmosis/tokenfactory/query-before-send-hook-address-request", + value: QueryBeforeSendHookAddressRequest.toAmino(message) + }; + }, + fromProtoMsg(message: QueryBeforeSendHookAddressRequestProtoMsg): QueryBeforeSendHookAddressRequest { + return QueryBeforeSendHookAddressRequest.decode(message.value); + }, + toProto(message: QueryBeforeSendHookAddressRequest): Uint8Array { + return QueryBeforeSendHookAddressRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryBeforeSendHookAddressRequest): QueryBeforeSendHookAddressRequestProtoMsg { + return { + typeUrl: "/osmosis.tokenfactory.v1beta1.QueryBeforeSendHookAddressRequest", + value: QueryBeforeSendHookAddressRequest.encode(message).finish() + }; + } +}; +function createBaseQueryBeforeSendHookAddressResponse(): QueryBeforeSendHookAddressResponse { + return { + cosmwasmAddress: "" + }; +} +export const QueryBeforeSendHookAddressResponse = { + typeUrl: "/osmosis.tokenfactory.v1beta1.QueryBeforeSendHookAddressResponse", + encode(message: QueryBeforeSendHookAddressResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.cosmwasmAddress !== "") { + writer.uint32(10).string(message.cosmwasmAddress); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryBeforeSendHookAddressResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryBeforeSendHookAddressResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.cosmwasmAddress = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryBeforeSendHookAddressResponse { + const message = createBaseQueryBeforeSendHookAddressResponse(); + message.cosmwasmAddress = object.cosmwasmAddress ?? ""; + return message; + }, + fromAmino(object: QueryBeforeSendHookAddressResponseAmino): QueryBeforeSendHookAddressResponse { + const message = createBaseQueryBeforeSendHookAddressResponse(); + if (object.cosmwasm_address !== undefined && object.cosmwasm_address !== null) { + message.cosmwasmAddress = object.cosmwasm_address; + } + return message; + }, + toAmino(message: QueryBeforeSendHookAddressResponse): QueryBeforeSendHookAddressResponseAmino { + const obj: any = {}; + obj.cosmwasm_address = message.cosmwasmAddress; + return obj; + }, + fromAminoMsg(object: QueryBeforeSendHookAddressResponseAminoMsg): QueryBeforeSendHookAddressResponse { + return QueryBeforeSendHookAddressResponse.fromAmino(object.value); + }, + toAminoMsg(message: QueryBeforeSendHookAddressResponse): QueryBeforeSendHookAddressResponseAminoMsg { + return { + type: "osmosis/tokenfactory/query-before-send-hook-address-response", + value: QueryBeforeSendHookAddressResponse.toAmino(message) + }; + }, + fromProtoMsg(message: QueryBeforeSendHookAddressResponseProtoMsg): QueryBeforeSendHookAddressResponse { + return QueryBeforeSendHookAddressResponse.decode(message.value); + }, + toProto(message: QueryBeforeSendHookAddressResponse): Uint8Array { + return QueryBeforeSendHookAddressResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryBeforeSendHookAddressResponse): QueryBeforeSendHookAddressResponseProtoMsg { + return { + typeUrl: "/osmosis.tokenfactory.v1beta1.QueryBeforeSendHookAddressResponse", + value: QueryBeforeSendHookAddressResponse.encode(message).finish() + }; + } }; \ No newline at end of file diff --git a/packages/osmo-query/src/codegen/osmosis/tokenfactory/v1beta1/tx.amino.ts b/packages/osmo-query/src/codegen/osmosis/tokenfactory/v1beta1/tx.amino.ts index fba1678c3..e0e58097c 100644 --- a/packages/osmo-query/src/codegen/osmosis/tokenfactory/v1beta1/tx.amino.ts +++ b/packages/osmo-query/src/codegen/osmosis/tokenfactory/v1beta1/tx.amino.ts @@ -1,5 +1,5 @@ //@ts-nocheck -import { MsgCreateDenom, MsgMint, MsgBurn, MsgChangeAdmin, MsgSetDenomMetadata, MsgForceTransfer } from "./tx"; +import { MsgCreateDenom, MsgMint, MsgBurn, MsgChangeAdmin, MsgSetDenomMetadata, MsgSetBeforeSendHook, MsgForceTransfer } from "./tx"; export const AminoConverter = { "/osmosis.tokenfactory.v1beta1.MsgCreateDenom": { aminoType: "osmosis/tokenfactory/create-denom", @@ -26,6 +26,11 @@ export const AminoConverter = { toAmino: MsgSetDenomMetadata.toAmino, fromAmino: MsgSetDenomMetadata.fromAmino }, + "/osmosis.tokenfactory.v1beta1.MsgSetBeforeSendHook": { + aminoType: "osmosis/tokenfactory/set-bef-send-hook", + toAmino: MsgSetBeforeSendHook.toAmino, + fromAmino: MsgSetBeforeSendHook.fromAmino + }, "/osmosis.tokenfactory.v1beta1.MsgForceTransfer": { aminoType: "osmosis/tokenfactory/force-transfer", toAmino: MsgForceTransfer.toAmino, diff --git a/packages/osmo-query/src/codegen/osmosis/tokenfactory/v1beta1/tx.registry.ts b/packages/osmo-query/src/codegen/osmosis/tokenfactory/v1beta1/tx.registry.ts index b5338c034..9da606aeb 100644 --- a/packages/osmo-query/src/codegen/osmosis/tokenfactory/v1beta1/tx.registry.ts +++ b/packages/osmo-query/src/codegen/osmosis/tokenfactory/v1beta1/tx.registry.ts @@ -1,7 +1,7 @@ //@ts-nocheck import { GeneratedType, Registry } from "@cosmjs/proto-signing"; -import { MsgCreateDenom, MsgMint, MsgBurn, MsgChangeAdmin, MsgSetDenomMetadata, MsgForceTransfer } from "./tx"; -export const registry: ReadonlyArray<[string, GeneratedType]> = [["/osmosis.tokenfactory.v1beta1.MsgCreateDenom", MsgCreateDenom], ["/osmosis.tokenfactory.v1beta1.MsgMint", MsgMint], ["/osmosis.tokenfactory.v1beta1.MsgBurn", MsgBurn], ["/osmosis.tokenfactory.v1beta1.MsgChangeAdmin", MsgChangeAdmin], ["/osmosis.tokenfactory.v1beta1.MsgSetDenomMetadata", MsgSetDenomMetadata], ["/osmosis.tokenfactory.v1beta1.MsgForceTransfer", MsgForceTransfer]]; +import { MsgCreateDenom, MsgMint, MsgBurn, MsgChangeAdmin, MsgSetDenomMetadata, MsgSetBeforeSendHook, MsgForceTransfer } from "./tx"; +export const registry: ReadonlyArray<[string, GeneratedType]> = [["/osmosis.tokenfactory.v1beta1.MsgCreateDenom", MsgCreateDenom], ["/osmosis.tokenfactory.v1beta1.MsgMint", MsgMint], ["/osmosis.tokenfactory.v1beta1.MsgBurn", MsgBurn], ["/osmosis.tokenfactory.v1beta1.MsgChangeAdmin", MsgChangeAdmin], ["/osmosis.tokenfactory.v1beta1.MsgSetDenomMetadata", MsgSetDenomMetadata], ["/osmosis.tokenfactory.v1beta1.MsgSetBeforeSendHook", MsgSetBeforeSendHook], ["/osmosis.tokenfactory.v1beta1.MsgForceTransfer", MsgForceTransfer]]; export const load = (protoRegistry: Registry) => { registry.forEach(([typeUrl, mod]) => { protoRegistry.register(typeUrl, mod); @@ -39,6 +39,12 @@ export const MessageComposer = { value: MsgSetDenomMetadata.encode(value).finish() }; }, + setBeforeSendHook(value: MsgSetBeforeSendHook) { + return { + typeUrl: "/osmosis.tokenfactory.v1beta1.MsgSetBeforeSendHook", + value: MsgSetBeforeSendHook.encode(value).finish() + }; + }, forceTransfer(value: MsgForceTransfer) { return { typeUrl: "/osmosis.tokenfactory.v1beta1.MsgForceTransfer", @@ -77,6 +83,12 @@ export const MessageComposer = { value }; }, + setBeforeSendHook(value: MsgSetBeforeSendHook) { + return { + typeUrl: "/osmosis.tokenfactory.v1beta1.MsgSetBeforeSendHook", + value + }; + }, forceTransfer(value: MsgForceTransfer) { return { typeUrl: "/osmosis.tokenfactory.v1beta1.MsgForceTransfer", @@ -115,6 +127,12 @@ export const MessageComposer = { value: MsgSetDenomMetadata.fromPartial(value) }; }, + setBeforeSendHook(value: MsgSetBeforeSendHook) { + return { + typeUrl: "/osmosis.tokenfactory.v1beta1.MsgSetBeforeSendHook", + value: MsgSetBeforeSendHook.fromPartial(value) + }; + }, forceTransfer(value: MsgForceTransfer) { return { typeUrl: "/osmosis.tokenfactory.v1beta1.MsgForceTransfer", diff --git a/packages/osmo-query/src/codegen/osmosis/tokenfactory/v1beta1/tx.rpc.msg.ts b/packages/osmo-query/src/codegen/osmosis/tokenfactory/v1beta1/tx.rpc.msg.ts index 2e3eb27f2..ccf13d751 100644 --- a/packages/osmo-query/src/codegen/osmosis/tokenfactory/v1beta1/tx.rpc.msg.ts +++ b/packages/osmo-query/src/codegen/osmosis/tokenfactory/v1beta1/tx.rpc.msg.ts @@ -1,6 +1,6 @@ import { Rpc } from "../../../helpers"; import { BinaryReader } from "../../../binary"; -import { MsgCreateDenom, MsgCreateDenomResponse, MsgMint, MsgMintResponse, MsgBurn, MsgBurnResponse, MsgChangeAdmin, MsgChangeAdminResponse, MsgSetDenomMetadata, MsgSetDenomMetadataResponse, MsgForceTransfer, MsgForceTransferResponse } from "./tx"; +import { MsgCreateDenom, MsgCreateDenomResponse, MsgMint, MsgMintResponse, MsgBurn, MsgBurnResponse, MsgChangeAdmin, MsgChangeAdminResponse, MsgSetDenomMetadata, MsgSetDenomMetadataResponse, MsgSetBeforeSendHook, MsgSetBeforeSendHookResponse, MsgForceTransfer, MsgForceTransferResponse } from "./tx"; /** Msg defines the tokefactory module's gRPC message service. */ export interface Msg { createDenom(request: MsgCreateDenom): Promise; @@ -8,6 +8,7 @@ export interface Msg { burn(request: MsgBurn): Promise; changeAdmin(request: MsgChangeAdmin): Promise; setDenomMetadata(request: MsgSetDenomMetadata): Promise; + setBeforeSendHook(request: MsgSetBeforeSendHook): Promise; forceTransfer(request: MsgForceTransfer): Promise; } export class MsgClientImpl implements Msg { @@ -19,6 +20,7 @@ export class MsgClientImpl implements Msg { this.burn = this.burn.bind(this); this.changeAdmin = this.changeAdmin.bind(this); this.setDenomMetadata = this.setDenomMetadata.bind(this); + this.setBeforeSendHook = this.setBeforeSendHook.bind(this); this.forceTransfer = this.forceTransfer.bind(this); } createDenom(request: MsgCreateDenom): Promise { @@ -46,6 +48,11 @@ export class MsgClientImpl implements Msg { const promise = this.rpc.request("osmosis.tokenfactory.v1beta1.Msg", "SetDenomMetadata", data); return promise.then(data => MsgSetDenomMetadataResponse.decode(new BinaryReader(data))); } + setBeforeSendHook(request: MsgSetBeforeSendHook): Promise { + const data = MsgSetBeforeSendHook.encode(request).finish(); + const promise = this.rpc.request("osmosis.tokenfactory.v1beta1.Msg", "SetBeforeSendHook", data); + return promise.then(data => MsgSetBeforeSendHookResponse.decode(new BinaryReader(data))); + } forceTransfer(request: MsgForceTransfer): Promise { const data = MsgForceTransfer.encode(request).finish(); const promise = this.rpc.request("osmosis.tokenfactory.v1beta1.Msg", "ForceTransfer", data); diff --git a/packages/osmo-query/src/codegen/osmosis/tokenfactory/v1beta1/tx.ts b/packages/osmo-query/src/codegen/osmosis/tokenfactory/v1beta1/tx.ts index e1eddab18..92184e79b 100644 --- a/packages/osmo-query/src/codegen/osmosis/tokenfactory/v1beta1/tx.ts +++ b/packages/osmo-query/src/codegen/osmosis/tokenfactory/v1beta1/tx.ts @@ -33,9 +33,9 @@ export interface MsgCreateDenomProtoMsg { * denom does not indicate the current admin. */ export interface MsgCreateDenomAmino { - sender: string; + sender?: string; /** subdenom can be up to 44 "alphanumeric" characters long. */ - subdenom: string; + subdenom?: string; } export interface MsgCreateDenomAminoMsg { type: "osmosis/tokenfactory/create-denom"; @@ -72,7 +72,7 @@ export interface MsgCreateDenomResponseProtoMsg { * It returns the full string of the newly created denom */ export interface MsgCreateDenomResponseAmino { - new_token_denom: string; + new_token_denom?: string; } export interface MsgCreateDenomResponseAminoMsg { type: "osmosis/tokenfactory/create-denom-response"; @@ -87,7 +87,9 @@ export interface MsgCreateDenomResponseSDKType { } /** * MsgMint is the sdk.Msg type for allowing an admin account to mint - * more of a token. For now, we only support minting to the sender account + * more of a token. + * Only the admin of the token factory denom has permission to mint unless + * the denom does not have any admin. */ export interface MsgMint { sender: string; @@ -100,10 +102,12 @@ export interface MsgMintProtoMsg { } /** * MsgMint is the sdk.Msg type for allowing an admin account to mint - * more of a token. For now, we only support minting to the sender account + * more of a token. + * Only the admin of the token factory denom has permission to mint unless + * the denom does not have any admin. */ export interface MsgMintAmino { - sender: string; + sender?: string; amount?: CoinAmino; mintToAddress: string; } @@ -113,7 +117,9 @@ export interface MsgMintAminoMsg { } /** * MsgMint is the sdk.Msg type for allowing an admin account to mint - * more of a token. For now, we only support minting to the sender account + * more of a token. + * Only the admin of the token factory denom has permission to mint unless + * the denom does not have any admin. */ export interface MsgMintSDKType { sender: string; @@ -133,7 +139,9 @@ export interface MsgMintResponseAminoMsg { export interface MsgMintResponseSDKType {} /** * MsgBurn is the sdk.Msg type for allowing an admin account to burn - * a token. For now, we only support burning from the sender account. + * a token. + * Only the admin of the token factory denom has permission to burn unless + * the denom does not have any admin. */ export interface MsgBurn { sender: string; @@ -146,10 +154,12 @@ export interface MsgBurnProtoMsg { } /** * MsgBurn is the sdk.Msg type for allowing an admin account to burn - * a token. For now, we only support burning from the sender account. + * a token. + * Only the admin of the token factory denom has permission to burn unless + * the denom does not have any admin. */ export interface MsgBurnAmino { - sender: string; + sender?: string; amount?: CoinAmino; burnFromAddress: string; } @@ -159,7 +169,9 @@ export interface MsgBurnAminoMsg { } /** * MsgBurn is the sdk.Msg type for allowing an admin account to burn - * a token. For now, we only support burning from the sender account. + * a token. + * Only the admin of the token factory denom has permission to burn unless + * the denom does not have any admin. */ export interface MsgBurnSDKType { sender: string; @@ -195,9 +207,9 @@ export interface MsgChangeAdminProtoMsg { * adminship of a denom to a new account */ export interface MsgChangeAdminAmino { - sender: string; - denom: string; - new_admin: string; + sender?: string; + denom?: string; + new_admin?: string; } export interface MsgChangeAdminAminoMsg { type: "osmosis/tokenfactory/change-admin"; @@ -235,6 +247,64 @@ export interface MsgChangeAdminResponseAminoMsg { * MsgChangeAdmin message. */ export interface MsgChangeAdminResponseSDKType {} +/** + * MsgSetBeforeSendHook is the sdk.Msg type for allowing an admin account to + * assign a CosmWasm contract to call with a BeforeSend hook + */ +export interface MsgSetBeforeSendHook { + sender: string; + denom: string; + cosmwasmAddress: string; +} +export interface MsgSetBeforeSendHookProtoMsg { + typeUrl: "/osmosis.tokenfactory.v1beta1.MsgSetBeforeSendHook"; + value: Uint8Array; +} +/** + * MsgSetBeforeSendHook is the sdk.Msg type for allowing an admin account to + * assign a CosmWasm contract to call with a BeforeSend hook + */ +export interface MsgSetBeforeSendHookAmino { + sender?: string; + denom?: string; + cosmwasm_address: string; +} +export interface MsgSetBeforeSendHookAminoMsg { + type: "osmosis/tokenfactory/set-bef-send-hook"; + value: MsgSetBeforeSendHookAmino; +} +/** + * MsgSetBeforeSendHook is the sdk.Msg type for allowing an admin account to + * assign a CosmWasm contract to call with a BeforeSend hook + */ +export interface MsgSetBeforeSendHookSDKType { + sender: string; + denom: string; + cosmwasm_address: string; +} +/** + * MsgSetBeforeSendHookResponse defines the response structure for an executed + * MsgSetBeforeSendHook message. + */ +export interface MsgSetBeforeSendHookResponse {} +export interface MsgSetBeforeSendHookResponseProtoMsg { + typeUrl: "/osmosis.tokenfactory.v1beta1.MsgSetBeforeSendHookResponse"; + value: Uint8Array; +} +/** + * MsgSetBeforeSendHookResponse defines the response structure for an executed + * MsgSetBeforeSendHook message. + */ +export interface MsgSetBeforeSendHookResponseAmino {} +export interface MsgSetBeforeSendHookResponseAminoMsg { + type: "osmosis/tokenfactory/set-before-send-hook-response"; + value: MsgSetBeforeSendHookResponseAmino; +} +/** + * MsgSetBeforeSendHookResponse defines the response structure for an executed + * MsgSetBeforeSendHook message. + */ +export interface MsgSetBeforeSendHookResponseSDKType {} /** * MsgSetDenomMetadata is the sdk.Msg type for allowing an admin account to set * the denom's bank metadata @@ -252,7 +322,7 @@ export interface MsgSetDenomMetadataProtoMsg { * the denom's bank metadata */ export interface MsgSetDenomMetadataAmino { - sender: string; + sender?: string; metadata?: MetadataAmino; } export interface MsgSetDenomMetadataAminoMsg { @@ -301,10 +371,10 @@ export interface MsgForceTransferProtoMsg { value: Uint8Array; } export interface MsgForceTransferAmino { - sender: string; + sender?: string; amount?: CoinAmino; - transferFromAddress: string; - transferToAddress: string; + transferFromAddress?: string; + transferToAddress?: string; } export interface MsgForceTransferAminoMsg { type: "osmosis/tokenfactory/force-transfer"; @@ -371,10 +441,14 @@ export const MsgCreateDenom = { return message; }, fromAmino(object: MsgCreateDenomAmino): MsgCreateDenom { - return { - sender: object.sender, - subdenom: object.subdenom - }; + const message = createBaseMsgCreateDenom(); + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + if (object.subdenom !== undefined && object.subdenom !== null) { + message.subdenom = object.subdenom; + } + return message; }, toAmino(message: MsgCreateDenom): MsgCreateDenomAmino { const obj: any = {}; @@ -440,9 +514,11 @@ export const MsgCreateDenomResponse = { return message; }, fromAmino(object: MsgCreateDenomResponseAmino): MsgCreateDenomResponse { - return { - newTokenDenom: object.new_token_denom - }; + const message = createBaseMsgCreateDenomResponse(); + if (object.new_token_denom !== undefined && object.new_token_denom !== null) { + message.newTokenDenom = object.new_token_denom; + } + return message; }, toAmino(message: MsgCreateDenomResponse): MsgCreateDenomResponseAmino { const obj: any = {}; @@ -523,17 +599,23 @@ export const MsgMint = { return message; }, fromAmino(object: MsgMintAmino): MsgMint { - return { - sender: object.sender, - amount: object?.amount ? Coin.fromAmino(object.amount) : undefined, - mintToAddress: object.mintToAddress - }; + const message = createBaseMsgMint(); + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + if (object.amount !== undefined && object.amount !== null) { + message.amount = Coin.fromAmino(object.amount); + } + if (object.mintToAddress !== undefined && object.mintToAddress !== null) { + message.mintToAddress = object.mintToAddress; + } + return message; }, toAmino(message: MsgMint): MsgMintAmino { const obj: any = {}; obj.sender = message.sender; obj.amount = message.amount ? Coin.toAmino(message.amount) : undefined; - obj.mintToAddress = message.mintToAddress; + obj.mintToAddress = message.mintToAddress ?? ""; return obj; }, fromAminoMsg(object: MsgMintAminoMsg): MsgMint { @@ -585,7 +667,8 @@ export const MsgMintResponse = { return message; }, fromAmino(_: MsgMintResponseAmino): MsgMintResponse { - return {}; + const message = createBaseMsgMintResponse(); + return message; }, toAmino(_: MsgMintResponse): MsgMintResponseAmino { const obj: any = {}; @@ -665,17 +748,23 @@ export const MsgBurn = { return message; }, fromAmino(object: MsgBurnAmino): MsgBurn { - return { - sender: object.sender, - amount: object?.amount ? Coin.fromAmino(object.amount) : undefined, - burnFromAddress: object.burnFromAddress - }; + const message = createBaseMsgBurn(); + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + if (object.amount !== undefined && object.amount !== null) { + message.amount = Coin.fromAmino(object.amount); + } + if (object.burnFromAddress !== undefined && object.burnFromAddress !== null) { + message.burnFromAddress = object.burnFromAddress; + } + return message; }, toAmino(message: MsgBurn): MsgBurnAmino { const obj: any = {}; obj.sender = message.sender; obj.amount = message.amount ? Coin.toAmino(message.amount) : undefined; - obj.burnFromAddress = message.burnFromAddress; + obj.burnFromAddress = message.burnFromAddress ?? ""; return obj; }, fromAminoMsg(object: MsgBurnAminoMsg): MsgBurn { @@ -727,7 +816,8 @@ export const MsgBurnResponse = { return message; }, fromAmino(_: MsgBurnResponseAmino): MsgBurnResponse { - return {}; + const message = createBaseMsgBurnResponse(); + return message; }, toAmino(_: MsgBurnResponse): MsgBurnResponseAmino { const obj: any = {}; @@ -807,11 +897,17 @@ export const MsgChangeAdmin = { return message; }, fromAmino(object: MsgChangeAdminAmino): MsgChangeAdmin { - return { - sender: object.sender, - denom: object.denom, - newAdmin: object.new_admin - }; + const message = createBaseMsgChangeAdmin(); + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + if (object.denom !== undefined && object.denom !== null) { + message.denom = object.denom; + } + if (object.new_admin !== undefined && object.new_admin !== null) { + message.newAdmin = object.new_admin; + } + return message; }, toAmino(message: MsgChangeAdmin): MsgChangeAdminAmino { const obj: any = {}; @@ -869,7 +965,8 @@ export const MsgChangeAdminResponse = { return message; }, fromAmino(_: MsgChangeAdminResponseAmino): MsgChangeAdminResponse { - return {}; + const message = createBaseMsgChangeAdminResponse(); + return message; }, toAmino(_: MsgChangeAdminResponse): MsgChangeAdminResponseAmino { const obj: any = {}; @@ -897,6 +994,155 @@ export const MsgChangeAdminResponse = { }; } }; +function createBaseMsgSetBeforeSendHook(): MsgSetBeforeSendHook { + return { + sender: "", + denom: "", + cosmwasmAddress: "" + }; +} +export const MsgSetBeforeSendHook = { + typeUrl: "/osmosis.tokenfactory.v1beta1.MsgSetBeforeSendHook", + encode(message: MsgSetBeforeSendHook, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.sender !== "") { + writer.uint32(10).string(message.sender); + } + if (message.denom !== "") { + writer.uint32(18).string(message.denom); + } + if (message.cosmwasmAddress !== "") { + writer.uint32(26).string(message.cosmwasmAddress); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgSetBeforeSendHook { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgSetBeforeSendHook(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.sender = reader.string(); + break; + case 2: + message.denom = reader.string(); + break; + case 3: + message.cosmwasmAddress = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgSetBeforeSendHook { + const message = createBaseMsgSetBeforeSendHook(); + message.sender = object.sender ?? ""; + message.denom = object.denom ?? ""; + message.cosmwasmAddress = object.cosmwasmAddress ?? ""; + return message; + }, + fromAmino(object: MsgSetBeforeSendHookAmino): MsgSetBeforeSendHook { + const message = createBaseMsgSetBeforeSendHook(); + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + if (object.denom !== undefined && object.denom !== null) { + message.denom = object.denom; + } + if (object.cosmwasm_address !== undefined && object.cosmwasm_address !== null) { + message.cosmwasmAddress = object.cosmwasm_address; + } + return message; + }, + toAmino(message: MsgSetBeforeSendHook): MsgSetBeforeSendHookAmino { + const obj: any = {}; + obj.sender = message.sender; + obj.denom = message.denom; + obj.cosmwasm_address = message.cosmwasmAddress ?? ""; + return obj; + }, + fromAminoMsg(object: MsgSetBeforeSendHookAminoMsg): MsgSetBeforeSendHook { + return MsgSetBeforeSendHook.fromAmino(object.value); + }, + toAminoMsg(message: MsgSetBeforeSendHook): MsgSetBeforeSendHookAminoMsg { + return { + type: "osmosis/tokenfactory/set-bef-send-hook", + value: MsgSetBeforeSendHook.toAmino(message) + }; + }, + fromProtoMsg(message: MsgSetBeforeSendHookProtoMsg): MsgSetBeforeSendHook { + return MsgSetBeforeSendHook.decode(message.value); + }, + toProto(message: MsgSetBeforeSendHook): Uint8Array { + return MsgSetBeforeSendHook.encode(message).finish(); + }, + toProtoMsg(message: MsgSetBeforeSendHook): MsgSetBeforeSendHookProtoMsg { + return { + typeUrl: "/osmosis.tokenfactory.v1beta1.MsgSetBeforeSendHook", + value: MsgSetBeforeSendHook.encode(message).finish() + }; + } +}; +function createBaseMsgSetBeforeSendHookResponse(): MsgSetBeforeSendHookResponse { + return {}; +} +export const MsgSetBeforeSendHookResponse = { + typeUrl: "/osmosis.tokenfactory.v1beta1.MsgSetBeforeSendHookResponse", + encode(_: MsgSetBeforeSendHookResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgSetBeforeSendHookResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgSetBeforeSendHookResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): MsgSetBeforeSendHookResponse { + const message = createBaseMsgSetBeforeSendHookResponse(); + return message; + }, + fromAmino(_: MsgSetBeforeSendHookResponseAmino): MsgSetBeforeSendHookResponse { + const message = createBaseMsgSetBeforeSendHookResponse(); + return message; + }, + toAmino(_: MsgSetBeforeSendHookResponse): MsgSetBeforeSendHookResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgSetBeforeSendHookResponseAminoMsg): MsgSetBeforeSendHookResponse { + return MsgSetBeforeSendHookResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgSetBeforeSendHookResponse): MsgSetBeforeSendHookResponseAminoMsg { + return { + type: "osmosis/tokenfactory/set-before-send-hook-response", + value: MsgSetBeforeSendHookResponse.toAmino(message) + }; + }, + fromProtoMsg(message: MsgSetBeforeSendHookResponseProtoMsg): MsgSetBeforeSendHookResponse { + return MsgSetBeforeSendHookResponse.decode(message.value); + }, + toProto(message: MsgSetBeforeSendHookResponse): Uint8Array { + return MsgSetBeforeSendHookResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgSetBeforeSendHookResponse): MsgSetBeforeSendHookResponseProtoMsg { + return { + typeUrl: "/osmosis.tokenfactory.v1beta1.MsgSetBeforeSendHookResponse", + value: MsgSetBeforeSendHookResponse.encode(message).finish() + }; + } +}; function createBaseMsgSetDenomMetadata(): MsgSetDenomMetadata { return { sender: "", @@ -941,10 +1187,14 @@ export const MsgSetDenomMetadata = { return message; }, fromAmino(object: MsgSetDenomMetadataAmino): MsgSetDenomMetadata { - return { - sender: object.sender, - metadata: object?.metadata ? Metadata.fromAmino(object.metadata) : undefined - }; + const message = createBaseMsgSetDenomMetadata(); + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + if (object.metadata !== undefined && object.metadata !== null) { + message.metadata = Metadata.fromAmino(object.metadata); + } + return message; }, toAmino(message: MsgSetDenomMetadata): MsgSetDenomMetadataAmino { const obj: any = {}; @@ -1001,7 +1251,8 @@ export const MsgSetDenomMetadataResponse = { return message; }, fromAmino(_: MsgSetDenomMetadataResponseAmino): MsgSetDenomMetadataResponse { - return {}; + const message = createBaseMsgSetDenomMetadataResponse(); + return message; }, toAmino(_: MsgSetDenomMetadataResponse): MsgSetDenomMetadataResponseAmino { const obj: any = {}; @@ -1089,12 +1340,20 @@ export const MsgForceTransfer = { return message; }, fromAmino(object: MsgForceTransferAmino): MsgForceTransfer { - return { - sender: object.sender, - amount: object?.amount ? Coin.fromAmino(object.amount) : undefined, - transferFromAddress: object.transferFromAddress, - transferToAddress: object.transferToAddress - }; + const message = createBaseMsgForceTransfer(); + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + if (object.amount !== undefined && object.amount !== null) { + message.amount = Coin.fromAmino(object.amount); + } + if (object.transferFromAddress !== undefined && object.transferFromAddress !== null) { + message.transferFromAddress = object.transferFromAddress; + } + if (object.transferToAddress !== undefined && object.transferToAddress !== null) { + message.transferToAddress = object.transferToAddress; + } + return message; }, toAmino(message: MsgForceTransfer): MsgForceTransferAmino { const obj: any = {}; @@ -1153,7 +1412,8 @@ export const MsgForceTransferResponse = { return message; }, fromAmino(_: MsgForceTransferResponseAmino): MsgForceTransferResponse { - return {}; + const message = createBaseMsgForceTransferResponse(); + return message; }, toAmino(_: MsgForceTransferResponse): MsgForceTransferResponseAmino { const obj: any = {}; diff --git a/packages/osmo-query/src/codegen/osmosis/twap/v1beta1/genesis.ts b/packages/osmo-query/src/codegen/osmosis/twap/v1beta1/genesis.ts index c546dd77c..4ba4e7f86 100644 --- a/packages/osmo-query/src/codegen/osmosis/twap/v1beta1/genesis.ts +++ b/packages/osmo-query/src/codegen/osmosis/twap/v1beta1/genesis.ts @@ -12,7 +12,7 @@ export interface ParamsProtoMsg { } /** Params holds parameters for the twap module */ export interface ParamsAmino { - prune_epoch_identifier: string; + prune_epoch_identifier?: string; record_history_keep_period?: DurationAmino; } export interface ParamsAminoMsg { @@ -38,7 +38,7 @@ export interface GenesisStateProtoMsg { /** GenesisState defines the twap module's genesis state. */ export interface GenesisStateAmino { /** twaps is the collection of all twap records. */ - twaps: TwapRecordAmino[]; + twaps?: TwapRecordAmino[]; /** params is the container of twap parameters. */ params?: ParamsAmino; } @@ -95,10 +95,14 @@ export const Params = { return message; }, fromAmino(object: ParamsAmino): Params { - return { - pruneEpochIdentifier: object.prune_epoch_identifier, - recordHistoryKeepPeriod: object?.record_history_keep_period ? Duration.fromAmino(object.record_history_keep_period) : undefined - }; + const message = createBaseParams(); + if (object.prune_epoch_identifier !== undefined && object.prune_epoch_identifier !== null) { + message.pruneEpochIdentifier = object.prune_epoch_identifier; + } + if (object.record_history_keep_period !== undefined && object.record_history_keep_period !== null) { + message.recordHistoryKeepPeriod = Duration.fromAmino(object.record_history_keep_period); + } + return message; }, toAmino(message: Params): ParamsAmino { const obj: any = {}; @@ -172,10 +176,12 @@ export const GenesisState = { return message; }, fromAmino(object: GenesisStateAmino): GenesisState { - return { - twaps: Array.isArray(object?.twaps) ? object.twaps.map((e: any) => TwapRecord.fromAmino(e)) : [], - params: object?.params ? Params.fromAmino(object.params) : undefined - }; + const message = createBaseGenesisState(); + message.twaps = object.twaps?.map(e => TwapRecord.fromAmino(e)) || []; + if (object.params !== undefined && object.params !== null) { + message.params = Params.fromAmino(object.params); + } + return message; }, toAmino(message: GenesisState): GenesisStateAmino { const obj: any = {}; diff --git a/packages/osmo-query/src/codegen/osmosis/twap/v1beta1/query.ts b/packages/osmo-query/src/codegen/osmosis/twap/v1beta1/query.ts index 7ff42b1fc..0e2424964 100644 --- a/packages/osmo-query/src/codegen/osmosis/twap/v1beta1/query.ts +++ b/packages/osmo-query/src/codegen/osmosis/twap/v1beta1/query.ts @@ -15,11 +15,11 @@ export interface ArithmeticTwapRequestProtoMsg { value: Uint8Array; } export interface ArithmeticTwapRequestAmino { - pool_id: string; - base_asset: string; - quote_asset: string; - start_time?: Date; - end_time?: Date; + pool_id?: string; + base_asset?: string; + quote_asset?: string; + start_time?: string; + end_time?: string; } export interface ArithmeticTwapRequestAminoMsg { type: "osmosis/twap/arithmetic-twap-request"; @@ -40,7 +40,7 @@ export interface ArithmeticTwapResponseProtoMsg { value: Uint8Array; } export interface ArithmeticTwapResponseAmino { - arithmetic_twap: string; + arithmetic_twap?: string; } export interface ArithmeticTwapResponseAminoMsg { type: "osmosis/twap/arithmetic-twap-response"; @@ -60,10 +60,10 @@ export interface ArithmeticTwapToNowRequestProtoMsg { value: Uint8Array; } export interface ArithmeticTwapToNowRequestAmino { - pool_id: string; - base_asset: string; - quote_asset: string; - start_time?: Date; + pool_id?: string; + base_asset?: string; + quote_asset?: string; + start_time?: string; } export interface ArithmeticTwapToNowRequestAminoMsg { type: "osmosis/twap/arithmetic-twap-to-now-request"; @@ -83,7 +83,7 @@ export interface ArithmeticTwapToNowResponseProtoMsg { value: Uint8Array; } export interface ArithmeticTwapToNowResponseAmino { - arithmetic_twap: string; + arithmetic_twap?: string; } export interface ArithmeticTwapToNowResponseAminoMsg { type: "osmosis/twap/arithmetic-twap-to-now-response"; @@ -104,11 +104,11 @@ export interface GeometricTwapRequestProtoMsg { value: Uint8Array; } export interface GeometricTwapRequestAmino { - pool_id: string; - base_asset: string; - quote_asset: string; - start_time?: Date; - end_time?: Date; + pool_id?: string; + base_asset?: string; + quote_asset?: string; + start_time?: string; + end_time?: string; } export interface GeometricTwapRequestAminoMsg { type: "osmosis/twap/geometric-twap-request"; @@ -129,7 +129,7 @@ export interface GeometricTwapResponseProtoMsg { value: Uint8Array; } export interface GeometricTwapResponseAmino { - geometric_twap: string; + geometric_twap?: string; } export interface GeometricTwapResponseAminoMsg { type: "osmosis/twap/geometric-twap-response"; @@ -149,10 +149,10 @@ export interface GeometricTwapToNowRequestProtoMsg { value: Uint8Array; } export interface GeometricTwapToNowRequestAmino { - pool_id: string; - base_asset: string; - quote_asset: string; - start_time?: Date; + pool_id?: string; + base_asset?: string; + quote_asset?: string; + start_time?: string; } export interface GeometricTwapToNowRequestAminoMsg { type: "osmosis/twap/geometric-twap-to-now-request"; @@ -172,7 +172,7 @@ export interface GeometricTwapToNowResponseProtoMsg { value: Uint8Array; } export interface GeometricTwapToNowResponseAmino { - geometric_twap: string; + geometric_twap?: string; } export interface GeometricTwapToNowResponseAminoMsg { type: "osmosis/twap/geometric-twap-to-now-response"; @@ -277,21 +277,31 @@ export const ArithmeticTwapRequest = { return message; }, fromAmino(object: ArithmeticTwapRequestAmino): ArithmeticTwapRequest { - return { - poolId: BigInt(object.pool_id), - baseAsset: object.base_asset, - quoteAsset: object.quote_asset, - startTime: object.start_time, - endTime: object?.end_time - }; + const message = createBaseArithmeticTwapRequest(); + if (object.pool_id !== undefined && object.pool_id !== null) { + message.poolId = BigInt(object.pool_id); + } + if (object.base_asset !== undefined && object.base_asset !== null) { + message.baseAsset = object.base_asset; + } + if (object.quote_asset !== undefined && object.quote_asset !== null) { + message.quoteAsset = object.quote_asset; + } + if (object.start_time !== undefined && object.start_time !== null) { + message.startTime = fromTimestamp(Timestamp.fromAmino(object.start_time)); + } + if (object.end_time !== undefined && object.end_time !== null) { + message.endTime = fromTimestamp(Timestamp.fromAmino(object.end_time)); + } + return message; }, toAmino(message: ArithmeticTwapRequest): ArithmeticTwapRequestAmino { const obj: any = {}; obj.pool_id = message.poolId ? message.poolId.toString() : undefined; obj.base_asset = message.baseAsset; obj.quote_asset = message.quoteAsset; - obj.start_time = message.startTime; - obj.end_time = message.endTime; + obj.start_time = message.startTime ? Timestamp.toAmino(toTimestamp(message.startTime)) : undefined; + obj.end_time = message.endTime ? Timestamp.toAmino(toTimestamp(message.endTime)) : undefined; return obj; }, fromAminoMsg(object: ArithmeticTwapRequestAminoMsg): ArithmeticTwapRequest { @@ -352,9 +362,11 @@ export const ArithmeticTwapResponse = { return message; }, fromAmino(object: ArithmeticTwapResponseAmino): ArithmeticTwapResponse { - return { - arithmeticTwap: object.arithmetic_twap - }; + const message = createBaseArithmeticTwapResponse(); + if (object.arithmetic_twap !== undefined && object.arithmetic_twap !== null) { + message.arithmeticTwap = object.arithmetic_twap; + } + return message; }, toAmino(message: ArithmeticTwapResponse): ArithmeticTwapResponseAmino { const obj: any = {}; @@ -443,19 +455,27 @@ export const ArithmeticTwapToNowRequest = { return message; }, fromAmino(object: ArithmeticTwapToNowRequestAmino): ArithmeticTwapToNowRequest { - return { - poolId: BigInt(object.pool_id), - baseAsset: object.base_asset, - quoteAsset: object.quote_asset, - startTime: object.start_time - }; + const message = createBaseArithmeticTwapToNowRequest(); + if (object.pool_id !== undefined && object.pool_id !== null) { + message.poolId = BigInt(object.pool_id); + } + if (object.base_asset !== undefined && object.base_asset !== null) { + message.baseAsset = object.base_asset; + } + if (object.quote_asset !== undefined && object.quote_asset !== null) { + message.quoteAsset = object.quote_asset; + } + if (object.start_time !== undefined && object.start_time !== null) { + message.startTime = fromTimestamp(Timestamp.fromAmino(object.start_time)); + } + return message; }, toAmino(message: ArithmeticTwapToNowRequest): ArithmeticTwapToNowRequestAmino { const obj: any = {}; obj.pool_id = message.poolId ? message.poolId.toString() : undefined; obj.base_asset = message.baseAsset; obj.quote_asset = message.quoteAsset; - obj.start_time = message.startTime; + obj.start_time = message.startTime ? Timestamp.toAmino(toTimestamp(message.startTime)) : undefined; return obj; }, fromAminoMsg(object: ArithmeticTwapToNowRequestAminoMsg): ArithmeticTwapToNowRequest { @@ -516,9 +536,11 @@ export const ArithmeticTwapToNowResponse = { return message; }, fromAmino(object: ArithmeticTwapToNowResponseAmino): ArithmeticTwapToNowResponse { - return { - arithmeticTwap: object.arithmetic_twap - }; + const message = createBaseArithmeticTwapToNowResponse(); + if (object.arithmetic_twap !== undefined && object.arithmetic_twap !== null) { + message.arithmeticTwap = object.arithmetic_twap; + } + return message; }, toAmino(message: ArithmeticTwapToNowResponse): ArithmeticTwapToNowResponseAmino { const obj: any = {}; @@ -615,21 +637,31 @@ export const GeometricTwapRequest = { return message; }, fromAmino(object: GeometricTwapRequestAmino): GeometricTwapRequest { - return { - poolId: BigInt(object.pool_id), - baseAsset: object.base_asset, - quoteAsset: object.quote_asset, - startTime: object.start_time, - endTime: object?.end_time - }; + const message = createBaseGeometricTwapRequest(); + if (object.pool_id !== undefined && object.pool_id !== null) { + message.poolId = BigInt(object.pool_id); + } + if (object.base_asset !== undefined && object.base_asset !== null) { + message.baseAsset = object.base_asset; + } + if (object.quote_asset !== undefined && object.quote_asset !== null) { + message.quoteAsset = object.quote_asset; + } + if (object.start_time !== undefined && object.start_time !== null) { + message.startTime = fromTimestamp(Timestamp.fromAmino(object.start_time)); + } + if (object.end_time !== undefined && object.end_time !== null) { + message.endTime = fromTimestamp(Timestamp.fromAmino(object.end_time)); + } + return message; }, toAmino(message: GeometricTwapRequest): GeometricTwapRequestAmino { const obj: any = {}; obj.pool_id = message.poolId ? message.poolId.toString() : undefined; obj.base_asset = message.baseAsset; obj.quote_asset = message.quoteAsset; - obj.start_time = message.startTime; - obj.end_time = message.endTime; + obj.start_time = message.startTime ? Timestamp.toAmino(toTimestamp(message.startTime)) : undefined; + obj.end_time = message.endTime ? Timestamp.toAmino(toTimestamp(message.endTime)) : undefined; return obj; }, fromAminoMsg(object: GeometricTwapRequestAminoMsg): GeometricTwapRequest { @@ -690,9 +722,11 @@ export const GeometricTwapResponse = { return message; }, fromAmino(object: GeometricTwapResponseAmino): GeometricTwapResponse { - return { - geometricTwap: object.geometric_twap - }; + const message = createBaseGeometricTwapResponse(); + if (object.geometric_twap !== undefined && object.geometric_twap !== null) { + message.geometricTwap = object.geometric_twap; + } + return message; }, toAmino(message: GeometricTwapResponse): GeometricTwapResponseAmino { const obj: any = {}; @@ -781,19 +815,27 @@ export const GeometricTwapToNowRequest = { return message; }, fromAmino(object: GeometricTwapToNowRequestAmino): GeometricTwapToNowRequest { - return { - poolId: BigInt(object.pool_id), - baseAsset: object.base_asset, - quoteAsset: object.quote_asset, - startTime: object.start_time - }; + const message = createBaseGeometricTwapToNowRequest(); + if (object.pool_id !== undefined && object.pool_id !== null) { + message.poolId = BigInt(object.pool_id); + } + if (object.base_asset !== undefined && object.base_asset !== null) { + message.baseAsset = object.base_asset; + } + if (object.quote_asset !== undefined && object.quote_asset !== null) { + message.quoteAsset = object.quote_asset; + } + if (object.start_time !== undefined && object.start_time !== null) { + message.startTime = fromTimestamp(Timestamp.fromAmino(object.start_time)); + } + return message; }, toAmino(message: GeometricTwapToNowRequest): GeometricTwapToNowRequestAmino { const obj: any = {}; obj.pool_id = message.poolId ? message.poolId.toString() : undefined; obj.base_asset = message.baseAsset; obj.quote_asset = message.quoteAsset; - obj.start_time = message.startTime; + obj.start_time = message.startTime ? Timestamp.toAmino(toTimestamp(message.startTime)) : undefined; return obj; }, fromAminoMsg(object: GeometricTwapToNowRequestAminoMsg): GeometricTwapToNowRequest { @@ -854,9 +896,11 @@ export const GeometricTwapToNowResponse = { return message; }, fromAmino(object: GeometricTwapToNowResponseAmino): GeometricTwapToNowResponse { - return { - geometricTwap: object.geometric_twap - }; + const message = createBaseGeometricTwapToNowResponse(); + if (object.geometric_twap !== undefined && object.geometric_twap !== null) { + message.geometricTwap = object.geometric_twap; + } + return message; }, toAmino(message: GeometricTwapToNowResponse): GeometricTwapToNowResponseAmino { const obj: any = {}; @@ -912,7 +956,8 @@ export const ParamsRequest = { return message; }, fromAmino(_: ParamsRequestAmino): ParamsRequest { - return {}; + const message = createBaseParamsRequest(); + return message; }, toAmino(_: ParamsRequest): ParamsRequestAmino { const obj: any = {}; @@ -976,9 +1021,11 @@ export const ParamsResponse = { return message; }, fromAmino(object: ParamsResponseAmino): ParamsResponse { - return { - params: object?.params ? Params.fromAmino(object.params) : undefined - }; + const message = createBaseParamsResponse(); + if (object.params !== undefined && object.params !== null) { + message.params = Params.fromAmino(object.params); + } + return message; }, toAmino(message: ParamsResponse): ParamsResponseAmino { const obj: any = {}; diff --git a/packages/osmo-query/src/codegen/osmosis/twap/v1beta1/twap_record.ts b/packages/osmo-query/src/codegen/osmosis/twap/v1beta1/twap_record.ts index cb430c3a5..ed00cfde4 100644 --- a/packages/osmo-query/src/codegen/osmosis/twap/v1beta1/twap_record.ts +++ b/packages/osmo-query/src/codegen/osmosis/twap/v1beta1/twap_record.ts @@ -34,7 +34,7 @@ export interface TwapRecord { p1ArithmeticTwapAccumulator: string; geometricTwapAccumulator: string; /** - * This field contains the time in which the last spot price error occured. + * This field contains the time in which the last spot price error occurred. * It is used to alert the caller if they are getting a potentially erroneous * TWAP, due to an unforeseen underlying error. */ @@ -54,33 +54,33 @@ export interface TwapRecordProtoMsg { * now. */ export interface TwapRecordAmino { - pool_id: string; + pool_id?: string; /** Lexicographically smaller denom of the pair */ - asset0_denom: string; + asset0_denom?: string; /** Lexicographically larger denom of the pair */ - asset1_denom: string; + asset1_denom?: string; /** height this record corresponds to, for debugging purposes */ - height: string; + height?: string; /** * This field should only exist until we have a global registry in the state * machine, mapping prior block heights within {TIME RANGE} to times. */ - time?: Date; + time?: string; /** * We store the last spot prices in the struct, so that we can interpolate * accumulator values for times between when accumulator records are stored. */ - p0_last_spot_price: string; - p1_last_spot_price: string; - p0_arithmetic_twap_accumulator: string; - p1_arithmetic_twap_accumulator: string; - geometric_twap_accumulator: string; + p0_last_spot_price?: string; + p1_last_spot_price?: string; + p0_arithmetic_twap_accumulator?: string; + p1_arithmetic_twap_accumulator?: string; + geometric_twap_accumulator?: string; /** - * This field contains the time in which the last spot price error occured. + * This field contains the time in which the last spot price error occurred. * It is used to alert the caller if they are getting a potentially erroneous * TWAP, due to an unforeseen underlying error. */ - last_error_time?: Date; + last_error_time?: string; } export interface TwapRecordAminoMsg { type: "osmosis/twap/twap-record"; @@ -224,19 +224,41 @@ export const TwapRecord = { return message; }, fromAmino(object: TwapRecordAmino): TwapRecord { - return { - poolId: BigInt(object.pool_id), - asset0Denom: object.asset0_denom, - asset1Denom: object.asset1_denom, - height: BigInt(object.height), - time: object.time, - p0LastSpotPrice: object.p0_last_spot_price, - p1LastSpotPrice: object.p1_last_spot_price, - p0ArithmeticTwapAccumulator: object.p0_arithmetic_twap_accumulator, - p1ArithmeticTwapAccumulator: object.p1_arithmetic_twap_accumulator, - geometricTwapAccumulator: object.geometric_twap_accumulator, - lastErrorTime: object.last_error_time - }; + const message = createBaseTwapRecord(); + if (object.pool_id !== undefined && object.pool_id !== null) { + message.poolId = BigInt(object.pool_id); + } + if (object.asset0_denom !== undefined && object.asset0_denom !== null) { + message.asset0Denom = object.asset0_denom; + } + if (object.asset1_denom !== undefined && object.asset1_denom !== null) { + message.asset1Denom = object.asset1_denom; + } + if (object.height !== undefined && object.height !== null) { + message.height = BigInt(object.height); + } + if (object.time !== undefined && object.time !== null) { + message.time = fromTimestamp(Timestamp.fromAmino(object.time)); + } + if (object.p0_last_spot_price !== undefined && object.p0_last_spot_price !== null) { + message.p0LastSpotPrice = object.p0_last_spot_price; + } + if (object.p1_last_spot_price !== undefined && object.p1_last_spot_price !== null) { + message.p1LastSpotPrice = object.p1_last_spot_price; + } + if (object.p0_arithmetic_twap_accumulator !== undefined && object.p0_arithmetic_twap_accumulator !== null) { + message.p0ArithmeticTwapAccumulator = object.p0_arithmetic_twap_accumulator; + } + if (object.p1_arithmetic_twap_accumulator !== undefined && object.p1_arithmetic_twap_accumulator !== null) { + message.p1ArithmeticTwapAccumulator = object.p1_arithmetic_twap_accumulator; + } + if (object.geometric_twap_accumulator !== undefined && object.geometric_twap_accumulator !== null) { + message.geometricTwapAccumulator = object.geometric_twap_accumulator; + } + if (object.last_error_time !== undefined && object.last_error_time !== null) { + message.lastErrorTime = fromTimestamp(Timestamp.fromAmino(object.last_error_time)); + } + return message; }, toAmino(message: TwapRecord): TwapRecordAmino { const obj: any = {}; @@ -244,13 +266,13 @@ export const TwapRecord = { obj.asset0_denom = message.asset0Denom; obj.asset1_denom = message.asset1Denom; obj.height = message.height ? message.height.toString() : undefined; - obj.time = message.time; + obj.time = message.time ? Timestamp.toAmino(toTimestamp(message.time)) : undefined; obj.p0_last_spot_price = message.p0LastSpotPrice; obj.p1_last_spot_price = message.p1LastSpotPrice; obj.p0_arithmetic_twap_accumulator = message.p0ArithmeticTwapAccumulator; obj.p1_arithmetic_twap_accumulator = message.p1ArithmeticTwapAccumulator; obj.geometric_twap_accumulator = message.geometricTwapAccumulator; - obj.last_error_time = message.lastErrorTime; + obj.last_error_time = message.lastErrorTime ? Timestamp.toAmino(toTimestamp(message.lastErrorTime)) : undefined; return obj; }, fromAminoMsg(object: TwapRecordAminoMsg): TwapRecord { diff --git a/packages/osmo-query/src/codegen/osmosis/txfees/v1beta1/feetoken.ts b/packages/osmo-query/src/codegen/osmosis/txfees/v1beta1/feetoken.ts index 15f488860..8d367bdb1 100644 --- a/packages/osmo-query/src/codegen/osmosis/txfees/v1beta1/feetoken.ts +++ b/packages/osmo-query/src/codegen/osmosis/txfees/v1beta1/feetoken.ts @@ -20,8 +20,8 @@ export interface FeeTokenProtoMsg { * The pool ID must have osmo as one of its assets. */ export interface FeeTokenAmino { - denom: string; - poolID: string; + denom?: string; + poolID?: string; } export interface FeeTokenAminoMsg { type: "osmosis/txfees/fee-token"; @@ -81,10 +81,14 @@ export const FeeToken = { return message; }, fromAmino(object: FeeTokenAmino): FeeToken { - return { - denom: object.denom, - poolID: BigInt(object.poolID) - }; + const message = createBaseFeeToken(); + if (object.denom !== undefined && object.denom !== null) { + message.denom = object.denom; + } + if (object.poolID !== undefined && object.poolID !== null) { + message.poolID = BigInt(object.poolID); + } + return message; }, toAmino(message: FeeToken): FeeTokenAmino { const obj: any = {}; diff --git a/packages/osmo-query/src/codegen/osmosis/txfees/v1beta1/genesis.ts b/packages/osmo-query/src/codegen/osmosis/txfees/v1beta1/genesis.ts index 8e3141e32..559a7a711 100644 --- a/packages/osmo-query/src/codegen/osmosis/txfees/v1beta1/genesis.ts +++ b/packages/osmo-query/src/codegen/osmosis/txfees/v1beta1/genesis.ts @@ -11,8 +11,8 @@ export interface GenesisStateProtoMsg { } /** GenesisState defines the txfees module's genesis state. */ export interface GenesisStateAmino { - basedenom: string; - feetokens: FeeTokenAmino[]; + basedenom?: string; + feetokens?: FeeTokenAmino[]; } export interface GenesisStateAminoMsg { type: "osmosis/txfees/genesis-state"; @@ -67,10 +67,12 @@ export const GenesisState = { return message; }, fromAmino(object: GenesisStateAmino): GenesisState { - return { - basedenom: object.basedenom, - feetokens: Array.isArray(object?.feetokens) ? object.feetokens.map((e: any) => FeeToken.fromAmino(e)) : [] - }; + const message = createBaseGenesisState(); + if (object.basedenom !== undefined && object.basedenom !== null) { + message.basedenom = object.basedenom; + } + message.feetokens = object.feetokens?.map(e => FeeToken.fromAmino(e)) || []; + return message; }, toAmino(message: GenesisState): GenesisStateAmino { const obj: any = {}; diff --git a/packages/osmo-query/src/codegen/osmosis/txfees/v1beta1/gov.ts b/packages/osmo-query/src/codegen/osmosis/txfees/v1beta1/gov.ts index 615a09480..05ef0c6bc 100644 --- a/packages/osmo-query/src/codegen/osmosis/txfees/v1beta1/gov.ts +++ b/packages/osmo-query/src/codegen/osmosis/txfees/v1beta1/gov.ts @@ -8,7 +8,7 @@ import { BinaryReader, BinaryWriter } from "../../../binary"; * set to 0, it will remove the denom from the whitelisted set. */ export interface UpdateFeeTokenProposal { - $typeUrl?: string; + $typeUrl?: "/osmosis.txfees.v1beta1.UpdateFeeTokenProposal"; title: string; description: string; feetokens: FeeToken[]; @@ -25,9 +25,9 @@ export interface UpdateFeeTokenProposalProtoMsg { * set to 0, it will remove the denom from the whitelisted set. */ export interface UpdateFeeTokenProposalAmino { - title: string; - description: string; - feetokens: FeeTokenAmino[]; + title?: string; + description?: string; + feetokens?: FeeTokenAmino[]; } export interface UpdateFeeTokenProposalAminoMsg { type: "osmosis/UpdateFeeTokenProposal"; @@ -41,7 +41,7 @@ export interface UpdateFeeTokenProposalAminoMsg { * set to 0, it will remove the denom from the whitelisted set. */ export interface UpdateFeeTokenProposalSDKType { - $typeUrl?: string; + $typeUrl?: "/osmosis.txfees.v1beta1.UpdateFeeTokenProposal"; title: string; description: string; feetokens: FeeTokenSDKType[]; @@ -99,11 +99,15 @@ export const UpdateFeeTokenProposal = { return message; }, fromAmino(object: UpdateFeeTokenProposalAmino): UpdateFeeTokenProposal { - return { - title: object.title, - description: object.description, - feetokens: Array.isArray(object?.feetokens) ? object.feetokens.map((e: any) => FeeToken.fromAmino(e)) : [] - }; + const message = createBaseUpdateFeeTokenProposal(); + if (object.title !== undefined && object.title !== null) { + message.title = object.title; + } + if (object.description !== undefined && object.description !== null) { + message.description = object.description; + } + message.feetokens = object.feetokens?.map(e => FeeToken.fromAmino(e)) || []; + return message; }, toAmino(message: UpdateFeeTokenProposal): UpdateFeeTokenProposalAmino { const obj: any = {}; diff --git a/packages/osmo-query/src/codegen/osmosis/txfees/v1beta1/query.lcd.ts b/packages/osmo-query/src/codegen/osmosis/txfees/v1beta1/query.lcd.ts index 455dbdd73..7b6db4f38 100644 --- a/packages/osmo-query/src/codegen/osmosis/txfees/v1beta1/query.lcd.ts +++ b/packages/osmo-query/src/codegen/osmosis/txfees/v1beta1/query.lcd.ts @@ -1,5 +1,5 @@ import { LCDClient } from "@cosmology/lcd"; -import { QueryFeeTokensRequest, QueryFeeTokensResponseSDKType, QueryDenomSpotPriceRequest, QueryDenomSpotPriceResponseSDKType, QueryDenomPoolIdRequest, QueryDenomPoolIdResponseSDKType, QueryBaseDenomRequest, QueryBaseDenomResponseSDKType } from "./query"; +import { QueryFeeTokensRequest, QueryFeeTokensResponseSDKType, QueryDenomSpotPriceRequest, QueryDenomSpotPriceResponseSDKType, QueryDenomPoolIdRequest, QueryDenomPoolIdResponseSDKType, QueryBaseDenomRequest, QueryBaseDenomResponseSDKType, QueryEipBaseFeeRequest, QueryEipBaseFeeResponseSDKType } from "./query"; export class LCDQueryClient { req: LCDClient; constructor({ @@ -12,6 +12,7 @@ export class LCDQueryClient { this.denomSpotPrice = this.denomSpotPrice.bind(this); this.denomPoolId = this.denomPoolId.bind(this); this.baseDenom = this.baseDenom.bind(this); + this.getEipBaseFee = this.getEipBaseFee.bind(this); } /* FeeTokens returns a list of all the whitelisted fee tokens and their corresponding pools. It does not include the BaseDenom, which has its own @@ -41,4 +42,9 @@ export class LCDQueryClient { const endpoint = `osmosis/txfees/v1beta1/base_denom`; return await this.req.get(endpoint); } + /* Returns a list of all base denom tokens and their corresponding pools. */ + async getEipBaseFee(_params: QueryEipBaseFeeRequest = {}): Promise { + const endpoint = `osmosis/txfees/v1beta1/cur_eip_base_fee`; + return await this.req.get(endpoint); + } } \ No newline at end of file diff --git a/packages/osmo-query/src/codegen/osmosis/txfees/v1beta1/query.rpc.Query.ts b/packages/osmo-query/src/codegen/osmosis/txfees/v1beta1/query.rpc.Query.ts index abb6ed574..6ae9e81a9 100644 --- a/packages/osmo-query/src/codegen/osmosis/txfees/v1beta1/query.rpc.Query.ts +++ b/packages/osmo-query/src/codegen/osmosis/txfees/v1beta1/query.rpc.Query.ts @@ -3,7 +3,7 @@ import { BinaryReader } from "../../../binary"; import { QueryClient, createProtobufRpcClient, ProtobufRpcClient } from "@cosmjs/stargate"; import { ReactQueryParams } from "../../../react-query"; import { useQuery } from "@tanstack/react-query"; -import { QueryFeeTokensRequest, QueryFeeTokensResponse, QueryDenomSpotPriceRequest, QueryDenomSpotPriceResponse, QueryDenomPoolIdRequest, QueryDenomPoolIdResponse, QueryBaseDenomRequest, QueryBaseDenomResponse } from "./query"; +import { QueryFeeTokensRequest, QueryFeeTokensResponse, QueryDenomSpotPriceRequest, QueryDenomSpotPriceResponse, QueryDenomPoolIdRequest, QueryDenomPoolIdResponse, QueryBaseDenomRequest, QueryBaseDenomResponse, QueryEipBaseFeeRequest, QueryEipBaseFeeResponse } from "./query"; export interface Query { /** * FeeTokens returns a list of all the whitelisted fee tokens and their @@ -17,6 +17,8 @@ export interface Query { denomPoolId(request: QueryDenomPoolIdRequest): Promise; /** Returns a list of all base denom tokens and their corresponding pools. */ baseDenom(request?: QueryBaseDenomRequest): Promise; + /** Returns a list of all base denom tokens and their corresponding pools. */ + getEipBaseFee(request?: QueryEipBaseFeeRequest): Promise; } export class QueryClientImpl implements Query { private readonly rpc: Rpc; @@ -26,6 +28,7 @@ export class QueryClientImpl implements Query { this.denomSpotPrice = this.denomSpotPrice.bind(this); this.denomPoolId = this.denomPoolId.bind(this); this.baseDenom = this.baseDenom.bind(this); + this.getEipBaseFee = this.getEipBaseFee.bind(this); } feeTokens(request: QueryFeeTokensRequest = {}): Promise { const data = QueryFeeTokensRequest.encode(request).finish(); @@ -47,6 +50,11 @@ export class QueryClientImpl implements Query { const promise = this.rpc.request("osmosis.txfees.v1beta1.Query", "BaseDenom", data); return promise.then(data => QueryBaseDenomResponse.decode(new BinaryReader(data))); } + getEipBaseFee(request: QueryEipBaseFeeRequest = {}): Promise { + const data = QueryEipBaseFeeRequest.encode(request).finish(); + const promise = this.rpc.request("osmosis.txfees.v1beta1.Query", "GetEipBaseFee", data); + return promise.then(data => QueryEipBaseFeeResponse.decode(new BinaryReader(data))); + } } export const createRpcQueryExtension = (base: QueryClient) => { const rpc = createProtobufRpcClient(base); @@ -63,6 +71,9 @@ export const createRpcQueryExtension = (base: QueryClient) => { }, baseDenom(request?: QueryBaseDenomRequest): Promise { return queryService.baseDenom(request); + }, + getEipBaseFee(request?: QueryEipBaseFeeRequest): Promise { + return queryService.getEipBaseFee(request); } }; }; @@ -78,6 +89,9 @@ export interface UseDenomPoolIdQuery extends ReactQueryParams extends ReactQueryParams { request?: QueryBaseDenomRequest; } +export interface UseGetEipBaseFeeQuery extends ReactQueryParams { + request?: QueryEipBaseFeeRequest; +} const _queryClients: WeakMap = new WeakMap(); const getQueryService = (rpc: ProtobufRpcClient | undefined): QueryClientImpl | undefined => { if (!rpc) return; @@ -126,6 +140,15 @@ export const createRpcQueryHooks = (rpc: ProtobufRpcClient | undefined) => { return queryService.baseDenom(request); }, options); }; + const useGetEipBaseFee = ({ + request, + options + }: UseGetEipBaseFeeQuery) => { + return useQuery(["getEipBaseFeeQuery", request], () => { + if (!queryService) throw new Error("Query Service not initialized"); + return queryService.getEipBaseFee(request); + }, options); + }; return { /** * FeeTokens returns a list of all the whitelisted fee tokens and their @@ -135,6 +158,7 @@ export const createRpcQueryHooks = (rpc: ProtobufRpcClient | undefined) => { useFeeTokens, /** DenomSpotPrice returns all spot prices by each registered token denom. */useDenomSpotPrice, /** Returns the poolID for a specified denom input. */useDenomPoolId, - /** Returns a list of all base denom tokens and their corresponding pools. */useBaseDenom + /** Returns a list of all base denom tokens and their corresponding pools. */useBaseDenom, + /** Returns a list of all base denom tokens and their corresponding pools. */useGetEipBaseFee }; }; \ No newline at end of file diff --git a/packages/osmo-query/src/codegen/osmosis/txfees/v1beta1/query.ts b/packages/osmo-query/src/codegen/osmosis/txfees/v1beta1/query.ts index 3139a8ec9..b5d65da69 100644 --- a/packages/osmo-query/src/codegen/osmosis/txfees/v1beta1/query.ts +++ b/packages/osmo-query/src/codegen/osmosis/txfees/v1beta1/query.ts @@ -20,7 +20,7 @@ export interface QueryFeeTokensResponseProtoMsg { value: Uint8Array; } export interface QueryFeeTokensResponseAmino { - fee_tokens: FeeTokenAmino[]; + fee_tokens?: FeeTokenAmino[]; } export interface QueryFeeTokensResponseAminoMsg { type: "osmosis/txfees/query-fee-tokens-response"; @@ -45,7 +45,7 @@ export interface QueryDenomSpotPriceRequestProtoMsg { * price for the specified tx fee denom */ export interface QueryDenomSpotPriceRequestAmino { - denom: string; + denom?: string; } export interface QueryDenomSpotPriceRequestAminoMsg { type: "osmosis/txfees/query-denom-spot-price-request"; @@ -75,8 +75,8 @@ export interface QueryDenomSpotPriceResponseProtoMsg { * price for the specified tx fee denom */ export interface QueryDenomSpotPriceResponseAmino { - poolID: string; - spot_price: string; + poolID?: string; + spot_price?: string; } export interface QueryDenomSpotPriceResponseAminoMsg { type: "osmosis/txfees/query-denom-spot-price-response"; @@ -98,7 +98,7 @@ export interface QueryDenomPoolIdRequestProtoMsg { value: Uint8Array; } export interface QueryDenomPoolIdRequestAmino { - denom: string; + denom?: string; } export interface QueryDenomPoolIdRequestAminoMsg { type: "osmosis/txfees/query-denom-pool-id-request"; @@ -115,7 +115,7 @@ export interface QueryDenomPoolIdResponseProtoMsg { value: Uint8Array; } export interface QueryDenomPoolIdResponseAmino { - poolID: string; + poolID?: string; } export interface QueryDenomPoolIdResponseAminoMsg { type: "osmosis/txfees/query-denom-pool-id-response"; @@ -143,7 +143,7 @@ export interface QueryBaseDenomResponseProtoMsg { value: Uint8Array; } export interface QueryBaseDenomResponseAmino { - base_denom: string; + base_denom?: string; } export interface QueryBaseDenomResponseAminoMsg { type: "osmosis/txfees/query-base-denom-response"; @@ -152,6 +152,34 @@ export interface QueryBaseDenomResponseAminoMsg { export interface QueryBaseDenomResponseSDKType { base_denom: string; } +export interface QueryEipBaseFeeRequest {} +export interface QueryEipBaseFeeRequestProtoMsg { + typeUrl: "/osmosis.txfees.v1beta1.QueryEipBaseFeeRequest"; + value: Uint8Array; +} +export interface QueryEipBaseFeeRequestAmino {} +export interface QueryEipBaseFeeRequestAminoMsg { + type: "osmosis/txfees/query-eip-base-fee-request"; + value: QueryEipBaseFeeRequestAmino; +} +export interface QueryEipBaseFeeRequestSDKType {} +export interface QueryEipBaseFeeResponse { + baseFee: string; +} +export interface QueryEipBaseFeeResponseProtoMsg { + typeUrl: "/osmosis.txfees.v1beta1.QueryEipBaseFeeResponse"; + value: Uint8Array; +} +export interface QueryEipBaseFeeResponseAmino { + base_fee?: string; +} +export interface QueryEipBaseFeeResponseAminoMsg { + type: "osmosis/txfees/query-eip-base-fee-response"; + value: QueryEipBaseFeeResponseAmino; +} +export interface QueryEipBaseFeeResponseSDKType { + base_fee: string; +} function createBaseQueryFeeTokensRequest(): QueryFeeTokensRequest { return {}; } @@ -179,7 +207,8 @@ export const QueryFeeTokensRequest = { return message; }, fromAmino(_: QueryFeeTokensRequestAmino): QueryFeeTokensRequest { - return {}; + const message = createBaseQueryFeeTokensRequest(); + return message; }, toAmino(_: QueryFeeTokensRequest): QueryFeeTokensRequestAmino { const obj: any = {}; @@ -243,9 +272,9 @@ export const QueryFeeTokensResponse = { return message; }, fromAmino(object: QueryFeeTokensResponseAmino): QueryFeeTokensResponse { - return { - feeTokens: Array.isArray(object?.fee_tokens) ? object.fee_tokens.map((e: any) => FeeToken.fromAmino(e)) : [] - }; + const message = createBaseQueryFeeTokensResponse(); + message.feeTokens = object.fee_tokens?.map(e => FeeToken.fromAmino(e)) || []; + return message; }, toAmino(message: QueryFeeTokensResponse): QueryFeeTokensResponseAmino { const obj: any = {}; @@ -314,9 +343,11 @@ export const QueryDenomSpotPriceRequest = { return message; }, fromAmino(object: QueryDenomSpotPriceRequestAmino): QueryDenomSpotPriceRequest { - return { - denom: object.denom - }; + const message = createBaseQueryDenomSpotPriceRequest(); + if (object.denom !== undefined && object.denom !== null) { + message.denom = object.denom; + } + return message; }, toAmino(message: QueryDenomSpotPriceRequest): QueryDenomSpotPriceRequestAmino { const obj: any = {}; @@ -389,10 +420,14 @@ export const QueryDenomSpotPriceResponse = { return message; }, fromAmino(object: QueryDenomSpotPriceResponseAmino): QueryDenomSpotPriceResponse { - return { - poolID: BigInt(object.poolID), - spotPrice: object.spot_price - }; + const message = createBaseQueryDenomSpotPriceResponse(); + if (object.poolID !== undefined && object.poolID !== null) { + message.poolID = BigInt(object.poolID); + } + if (object.spot_price !== undefined && object.spot_price !== null) { + message.spotPrice = object.spot_price; + } + return message; }, toAmino(message: QueryDenomSpotPriceResponse): QueryDenomSpotPriceResponseAmino { const obj: any = {}; @@ -458,9 +493,11 @@ export const QueryDenomPoolIdRequest = { return message; }, fromAmino(object: QueryDenomPoolIdRequestAmino): QueryDenomPoolIdRequest { - return { - denom: object.denom - }; + const message = createBaseQueryDenomPoolIdRequest(); + if (object.denom !== undefined && object.denom !== null) { + message.denom = object.denom; + } + return message; }, toAmino(message: QueryDenomPoolIdRequest): QueryDenomPoolIdRequestAmino { const obj: any = {}; @@ -525,9 +562,11 @@ export const QueryDenomPoolIdResponse = { return message; }, fromAmino(object: QueryDenomPoolIdResponseAmino): QueryDenomPoolIdResponse { - return { - poolID: BigInt(object.poolID) - }; + const message = createBaseQueryDenomPoolIdResponse(); + if (object.poolID !== undefined && object.poolID !== null) { + message.poolID = BigInt(object.poolID); + } + return message; }, toAmino(message: QueryDenomPoolIdResponse): QueryDenomPoolIdResponseAmino { const obj: any = {}; @@ -583,7 +622,8 @@ export const QueryBaseDenomRequest = { return message; }, fromAmino(_: QueryBaseDenomRequestAmino): QueryBaseDenomRequest { - return {}; + const message = createBaseQueryBaseDenomRequest(); + return message; }, toAmino(_: QueryBaseDenomRequest): QueryBaseDenomRequestAmino { const obj: any = {}; @@ -647,9 +687,11 @@ export const QueryBaseDenomResponse = { return message; }, fromAmino(object: QueryBaseDenomResponseAmino): QueryBaseDenomResponse { - return { - baseDenom: object.base_denom - }; + const message = createBaseQueryBaseDenomResponse(); + if (object.base_denom !== undefined && object.base_denom !== null) { + message.baseDenom = object.base_denom; + } + return message; }, toAmino(message: QueryBaseDenomResponse): QueryBaseDenomResponseAmino { const obj: any = {}; @@ -677,4 +719,129 @@ export const QueryBaseDenomResponse = { value: QueryBaseDenomResponse.encode(message).finish() }; } +}; +function createBaseQueryEipBaseFeeRequest(): QueryEipBaseFeeRequest { + return {}; +} +export const QueryEipBaseFeeRequest = { + typeUrl: "/osmosis.txfees.v1beta1.QueryEipBaseFeeRequest", + encode(_: QueryEipBaseFeeRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryEipBaseFeeRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryEipBaseFeeRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): QueryEipBaseFeeRequest { + const message = createBaseQueryEipBaseFeeRequest(); + return message; + }, + fromAmino(_: QueryEipBaseFeeRequestAmino): QueryEipBaseFeeRequest { + const message = createBaseQueryEipBaseFeeRequest(); + return message; + }, + toAmino(_: QueryEipBaseFeeRequest): QueryEipBaseFeeRequestAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: QueryEipBaseFeeRequestAminoMsg): QueryEipBaseFeeRequest { + return QueryEipBaseFeeRequest.fromAmino(object.value); + }, + toAminoMsg(message: QueryEipBaseFeeRequest): QueryEipBaseFeeRequestAminoMsg { + return { + type: "osmosis/txfees/query-eip-base-fee-request", + value: QueryEipBaseFeeRequest.toAmino(message) + }; + }, + fromProtoMsg(message: QueryEipBaseFeeRequestProtoMsg): QueryEipBaseFeeRequest { + return QueryEipBaseFeeRequest.decode(message.value); + }, + toProto(message: QueryEipBaseFeeRequest): Uint8Array { + return QueryEipBaseFeeRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryEipBaseFeeRequest): QueryEipBaseFeeRequestProtoMsg { + return { + typeUrl: "/osmosis.txfees.v1beta1.QueryEipBaseFeeRequest", + value: QueryEipBaseFeeRequest.encode(message).finish() + }; + } +}; +function createBaseQueryEipBaseFeeResponse(): QueryEipBaseFeeResponse { + return { + baseFee: "" + }; +} +export const QueryEipBaseFeeResponse = { + typeUrl: "/osmosis.txfees.v1beta1.QueryEipBaseFeeResponse", + encode(message: QueryEipBaseFeeResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.baseFee !== "") { + writer.uint32(10).string(Decimal.fromUserInput(message.baseFee, 18).atomics); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryEipBaseFeeResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryEipBaseFeeResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.baseFee = Decimal.fromAtomics(reader.string(), 18).toString(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryEipBaseFeeResponse { + const message = createBaseQueryEipBaseFeeResponse(); + message.baseFee = object.baseFee ?? ""; + return message; + }, + fromAmino(object: QueryEipBaseFeeResponseAmino): QueryEipBaseFeeResponse { + const message = createBaseQueryEipBaseFeeResponse(); + if (object.base_fee !== undefined && object.base_fee !== null) { + message.baseFee = object.base_fee; + } + return message; + }, + toAmino(message: QueryEipBaseFeeResponse): QueryEipBaseFeeResponseAmino { + const obj: any = {}; + obj.base_fee = message.baseFee; + return obj; + }, + fromAminoMsg(object: QueryEipBaseFeeResponseAminoMsg): QueryEipBaseFeeResponse { + return QueryEipBaseFeeResponse.fromAmino(object.value); + }, + toAminoMsg(message: QueryEipBaseFeeResponse): QueryEipBaseFeeResponseAminoMsg { + return { + type: "osmosis/txfees/query-eip-base-fee-response", + value: QueryEipBaseFeeResponse.toAmino(message) + }; + }, + fromProtoMsg(message: QueryEipBaseFeeResponseProtoMsg): QueryEipBaseFeeResponse { + return QueryEipBaseFeeResponse.decode(message.value); + }, + toProto(message: QueryEipBaseFeeResponse): Uint8Array { + return QueryEipBaseFeeResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryEipBaseFeeResponse): QueryEipBaseFeeResponseProtoMsg { + return { + typeUrl: "/osmosis.txfees.v1beta1.QueryEipBaseFeeResponse", + value: QueryEipBaseFeeResponse.encode(message).finish() + }; + } }; \ No newline at end of file diff --git a/packages/osmo-query/src/codegen/osmosis/valset-pref/v1beta1/query.lcd.ts b/packages/osmo-query/src/codegen/osmosis/valsetpref/v1beta1/query.lcd.ts similarity index 100% rename from packages/osmo-query/src/codegen/osmosis/valset-pref/v1beta1/query.lcd.ts rename to packages/osmo-query/src/codegen/osmosis/valsetpref/v1beta1/query.lcd.ts diff --git a/packages/osmo-query/src/codegen/osmosis/valset-pref/v1beta1/query.rpc.Query.ts b/packages/osmo-query/src/codegen/osmosis/valsetpref/v1beta1/query.rpc.Query.ts similarity index 100% rename from packages/osmo-query/src/codegen/osmosis/valset-pref/v1beta1/query.rpc.Query.ts rename to packages/osmo-query/src/codegen/osmosis/valsetpref/v1beta1/query.rpc.Query.ts diff --git a/packages/osmojs/src/codegen/osmosis/valset-pref/v1beta1/query.ts b/packages/osmo-query/src/codegen/osmosis/valsetpref/v1beta1/query.ts similarity index 94% rename from packages/osmojs/src/codegen/osmosis/valset-pref/v1beta1/query.ts rename to packages/osmo-query/src/codegen/osmosis/valsetpref/v1beta1/query.ts index 15a800ad8..5d91b7e8f 100644 --- a/packages/osmojs/src/codegen/osmosis/valset-pref/v1beta1/query.ts +++ b/packages/osmo-query/src/codegen/osmosis/valsetpref/v1beta1/query.ts @@ -12,7 +12,7 @@ export interface UserValidatorPreferencesRequestProtoMsg { /** Request type for UserValidatorPreferences. */ export interface UserValidatorPreferencesRequestAmino { /** user account address */ - address: string; + address?: string; } export interface UserValidatorPreferencesRequestAminoMsg { type: "osmosis/valsetpref/user-validator-preferences-request"; @@ -32,7 +32,7 @@ export interface UserValidatorPreferencesResponseProtoMsg { } /** Response type the QueryUserValidatorPreferences query request */ export interface UserValidatorPreferencesResponseAmino { - preferences: ValidatorPreferenceAmino[]; + preferences?: ValidatorPreferenceAmino[]; } export interface UserValidatorPreferencesResponseAminoMsg { type: "osmosis/valsetpref/user-validator-preferences-response"; @@ -78,9 +78,11 @@ export const UserValidatorPreferencesRequest = { return message; }, fromAmino(object: UserValidatorPreferencesRequestAmino): UserValidatorPreferencesRequest { - return { - address: object.address - }; + const message = createBaseUserValidatorPreferencesRequest(); + if (object.address !== undefined && object.address !== null) { + message.address = object.address; + } + return message; }, toAmino(message: UserValidatorPreferencesRequest): UserValidatorPreferencesRequestAmino { const obj: any = {}; @@ -145,9 +147,9 @@ export const UserValidatorPreferencesResponse = { return message; }, fromAmino(object: UserValidatorPreferencesResponseAmino): UserValidatorPreferencesResponse { - return { - preferences: Array.isArray(object?.preferences) ? object.preferences.map((e: any) => ValidatorPreference.fromAmino(e)) : [] - }; + const message = createBaseUserValidatorPreferencesResponse(); + message.preferences = object.preferences?.map(e => ValidatorPreference.fromAmino(e)) || []; + return message; }, toAmino(message: UserValidatorPreferencesResponse): UserValidatorPreferencesResponseAmino { const obj: any = {}; diff --git a/packages/osmo-query/src/codegen/osmosis/valset-pref/v1beta1/state.ts b/packages/osmo-query/src/codegen/osmosis/valsetpref/v1beta1/state.ts similarity index 93% rename from packages/osmo-query/src/codegen/osmosis/valset-pref/v1beta1/state.ts rename to packages/osmo-query/src/codegen/osmosis/valsetpref/v1beta1/state.ts index e993ba247..4cad4c7c4 100644 --- a/packages/osmo-query/src/codegen/osmosis/valset-pref/v1beta1/state.ts +++ b/packages/osmo-query/src/codegen/osmosis/valsetpref/v1beta1/state.ts @@ -32,9 +32,9 @@ export interface ValidatorPreferenceAmino { * val_oper_address holds the validator address the user wants to delegate * funds to. */ - val_oper_address: string; + val_oper_address?: string; /** weight is decimal between 0 and 1, and they all sum to 1. */ - weight: string; + weight?: string; } export interface ValidatorPreferenceAminoMsg { type: "osmosis/valsetpref/validator-preference"; @@ -73,7 +73,7 @@ export interface ValidatorSetPreferencesProtoMsg { */ export interface ValidatorSetPreferencesAmino { /** preference holds {valAddr, weight} for the user who created it. */ - preferences: ValidatorPreferenceAmino[]; + preferences?: ValidatorPreferenceAmino[]; } export interface ValidatorSetPreferencesAminoMsg { type: "osmosis/valsetpref/validator-set-preferences"; @@ -132,10 +132,14 @@ export const ValidatorPreference = { return message; }, fromAmino(object: ValidatorPreferenceAmino): ValidatorPreference { - return { - valOperAddress: object.val_oper_address, - weight: object.weight - }; + const message = createBaseValidatorPreference(); + if (object.val_oper_address !== undefined && object.val_oper_address !== null) { + message.valOperAddress = object.val_oper_address; + } + if (object.weight !== undefined && object.weight !== null) { + message.weight = object.weight; + } + return message; }, toAmino(message: ValidatorPreference): ValidatorPreferenceAmino { const obj: any = {}; @@ -201,9 +205,9 @@ export const ValidatorSetPreferences = { return message; }, fromAmino(object: ValidatorSetPreferencesAmino): ValidatorSetPreferences { - return { - preferences: Array.isArray(object?.preferences) ? object.preferences.map((e: any) => ValidatorPreference.fromAmino(e)) : [] - }; + const message = createBaseValidatorSetPreferences(); + message.preferences = object.preferences?.map(e => ValidatorPreference.fromAmino(e)) || []; + return message; }, toAmino(message: ValidatorSetPreferences): ValidatorSetPreferencesAmino { const obj: any = {}; diff --git a/packages/osmo-query/src/codegen/osmosis/valset-pref/v1beta1/tx.amino.ts b/packages/osmo-query/src/codegen/osmosis/valsetpref/v1beta1/tx.amino.ts similarity index 62% rename from packages/osmo-query/src/codegen/osmosis/valset-pref/v1beta1/tx.amino.ts rename to packages/osmo-query/src/codegen/osmosis/valsetpref/v1beta1/tx.amino.ts index e7e7d5ca5..cd5c56ea7 100644 --- a/packages/osmo-query/src/codegen/osmosis/valset-pref/v1beta1/tx.amino.ts +++ b/packages/osmo-query/src/codegen/osmosis/valsetpref/v1beta1/tx.amino.ts @@ -1,28 +1,33 @@ //@ts-nocheck -import { MsgSetValidatorSetPreference, MsgDelegateToValidatorSet, MsgUndelegateFromValidatorSet, MsgRedelegateValidatorSet, MsgWithdrawDelegationRewards, MsgDelegateBondedTokens } from "./tx"; +import { MsgSetValidatorSetPreference, MsgDelegateToValidatorSet, MsgUndelegateFromValidatorSet, MsgUndelegateFromRebalancedValidatorSet, MsgRedelegateValidatorSet, MsgWithdrawDelegationRewards, MsgDelegateBondedTokens } from "./tx"; export const AminoConverter = { "/osmosis.valsetpref.v1beta1.MsgSetValidatorSetPreference": { - aminoType: "osmosis/valset-pref/MsgSetValidatorSetPreference", + aminoType: "osmosis/MsgSetValidatorSetPreference", toAmino: MsgSetValidatorSetPreference.toAmino, fromAmino: MsgSetValidatorSetPreference.fromAmino }, "/osmosis.valsetpref.v1beta1.MsgDelegateToValidatorSet": { - aminoType: "osmosis/valset-pref/MsgDelegateToValidatorSet", + aminoType: "osmosis/MsgDelegateToValidatorSet", toAmino: MsgDelegateToValidatorSet.toAmino, fromAmino: MsgDelegateToValidatorSet.fromAmino }, "/osmosis.valsetpref.v1beta1.MsgUndelegateFromValidatorSet": { - aminoType: "osmosis/valset-pref/MsgUndelegateFromValidatorSet", + aminoType: "osmosis/MsgUndelegateFromValidatorSet", toAmino: MsgUndelegateFromValidatorSet.toAmino, fromAmino: MsgUndelegateFromValidatorSet.fromAmino }, + "/osmosis.valsetpref.v1beta1.MsgUndelegateFromRebalancedValidatorSet": { + aminoType: "osmosis/MsgUndelegateFromRebalValset", + toAmino: MsgUndelegateFromRebalancedValidatorSet.toAmino, + fromAmino: MsgUndelegateFromRebalancedValidatorSet.fromAmino + }, "/osmosis.valsetpref.v1beta1.MsgRedelegateValidatorSet": { - aminoType: "osmosis/valsetpref/redelegate-validator-set", + aminoType: "osmosis/MsgRedelegateValidatorSet", toAmino: MsgRedelegateValidatorSet.toAmino, fromAmino: MsgRedelegateValidatorSet.fromAmino }, "/osmosis.valsetpref.v1beta1.MsgWithdrawDelegationRewards": { - aminoType: "osmosis/valset-pref/MsgWithdrawDelegationRewards", + aminoType: "osmosis/MsgWithdrawDelegationRewards", toAmino: MsgWithdrawDelegationRewards.toAmino, fromAmino: MsgWithdrawDelegationRewards.fromAmino }, diff --git a/packages/osmo-query/src/codegen/osmosis/valset-pref/v1beta1/tx.registry.ts b/packages/osmo-query/src/codegen/osmosis/valsetpref/v1beta1/tx.registry.ts similarity index 77% rename from packages/osmo-query/src/codegen/osmosis/valset-pref/v1beta1/tx.registry.ts rename to packages/osmo-query/src/codegen/osmosis/valsetpref/v1beta1/tx.registry.ts index 6814f6f7d..d46720674 100644 --- a/packages/osmo-query/src/codegen/osmosis/valset-pref/v1beta1/tx.registry.ts +++ b/packages/osmo-query/src/codegen/osmosis/valsetpref/v1beta1/tx.registry.ts @@ -1,7 +1,7 @@ //@ts-nocheck import { GeneratedType, Registry } from "@cosmjs/proto-signing"; -import { MsgSetValidatorSetPreference, MsgDelegateToValidatorSet, MsgUndelegateFromValidatorSet, MsgRedelegateValidatorSet, MsgWithdrawDelegationRewards, MsgDelegateBondedTokens } from "./tx"; -export const registry: ReadonlyArray<[string, GeneratedType]> = [["/osmosis.valsetpref.v1beta1.MsgSetValidatorSetPreference", MsgSetValidatorSetPreference], ["/osmosis.valsetpref.v1beta1.MsgDelegateToValidatorSet", MsgDelegateToValidatorSet], ["/osmosis.valsetpref.v1beta1.MsgUndelegateFromValidatorSet", MsgUndelegateFromValidatorSet], ["/osmosis.valsetpref.v1beta1.MsgRedelegateValidatorSet", MsgRedelegateValidatorSet], ["/osmosis.valsetpref.v1beta1.MsgWithdrawDelegationRewards", MsgWithdrawDelegationRewards], ["/osmosis.valsetpref.v1beta1.MsgDelegateBondedTokens", MsgDelegateBondedTokens]]; +import { MsgSetValidatorSetPreference, MsgDelegateToValidatorSet, MsgUndelegateFromValidatorSet, MsgUndelegateFromRebalancedValidatorSet, MsgRedelegateValidatorSet, MsgWithdrawDelegationRewards, MsgDelegateBondedTokens } from "./tx"; +export const registry: ReadonlyArray<[string, GeneratedType]> = [["/osmosis.valsetpref.v1beta1.MsgSetValidatorSetPreference", MsgSetValidatorSetPreference], ["/osmosis.valsetpref.v1beta1.MsgDelegateToValidatorSet", MsgDelegateToValidatorSet], ["/osmosis.valsetpref.v1beta1.MsgUndelegateFromValidatorSet", MsgUndelegateFromValidatorSet], ["/osmosis.valsetpref.v1beta1.MsgUndelegateFromRebalancedValidatorSet", MsgUndelegateFromRebalancedValidatorSet], ["/osmosis.valsetpref.v1beta1.MsgRedelegateValidatorSet", MsgRedelegateValidatorSet], ["/osmosis.valsetpref.v1beta1.MsgWithdrawDelegationRewards", MsgWithdrawDelegationRewards], ["/osmosis.valsetpref.v1beta1.MsgDelegateBondedTokens", MsgDelegateBondedTokens]]; export const load = (protoRegistry: Registry) => { registry.forEach(([typeUrl, mod]) => { protoRegistry.register(typeUrl, mod); @@ -27,6 +27,12 @@ export const MessageComposer = { value: MsgUndelegateFromValidatorSet.encode(value).finish() }; }, + undelegateFromRebalancedValidatorSet(value: MsgUndelegateFromRebalancedValidatorSet) { + return { + typeUrl: "/osmosis.valsetpref.v1beta1.MsgUndelegateFromRebalancedValidatorSet", + value: MsgUndelegateFromRebalancedValidatorSet.encode(value).finish() + }; + }, redelegateValidatorSet(value: MsgRedelegateValidatorSet) { return { typeUrl: "/osmosis.valsetpref.v1beta1.MsgRedelegateValidatorSet", @@ -65,6 +71,12 @@ export const MessageComposer = { value }; }, + undelegateFromRebalancedValidatorSet(value: MsgUndelegateFromRebalancedValidatorSet) { + return { + typeUrl: "/osmosis.valsetpref.v1beta1.MsgUndelegateFromRebalancedValidatorSet", + value + }; + }, redelegateValidatorSet(value: MsgRedelegateValidatorSet) { return { typeUrl: "/osmosis.valsetpref.v1beta1.MsgRedelegateValidatorSet", @@ -103,6 +115,12 @@ export const MessageComposer = { value: MsgUndelegateFromValidatorSet.fromPartial(value) }; }, + undelegateFromRebalancedValidatorSet(value: MsgUndelegateFromRebalancedValidatorSet) { + return { + typeUrl: "/osmosis.valsetpref.v1beta1.MsgUndelegateFromRebalancedValidatorSet", + value: MsgUndelegateFromRebalancedValidatorSet.fromPartial(value) + }; + }, redelegateValidatorSet(value: MsgRedelegateValidatorSet) { return { typeUrl: "/osmosis.valsetpref.v1beta1.MsgRedelegateValidatorSet", diff --git a/packages/osmojs/src/codegen/osmosis/valset-pref/v1beta1/tx.rpc.msg.ts b/packages/osmo-query/src/codegen/osmosis/valsetpref/v1beta1/tx.rpc.msg.ts similarity index 77% rename from packages/osmojs/src/codegen/osmosis/valset-pref/v1beta1/tx.rpc.msg.ts rename to packages/osmo-query/src/codegen/osmosis/valsetpref/v1beta1/tx.rpc.msg.ts index c553d41cb..9ba43ce06 100644 --- a/packages/osmojs/src/codegen/osmosis/valset-pref/v1beta1/tx.rpc.msg.ts +++ b/packages/osmo-query/src/codegen/osmosis/valsetpref/v1beta1/tx.rpc.msg.ts @@ -1,7 +1,7 @@ import { Rpc } from "../../../helpers"; import { BinaryReader } from "../../../binary"; -import { MsgSetValidatorSetPreference, MsgSetValidatorSetPreferenceResponse, MsgDelegateToValidatorSet, MsgDelegateToValidatorSetResponse, MsgUndelegateFromValidatorSet, MsgUndelegateFromValidatorSetResponse, MsgRedelegateValidatorSet, MsgRedelegateValidatorSetResponse, MsgWithdrawDelegationRewards, MsgWithdrawDelegationRewardsResponse, MsgDelegateBondedTokens, MsgDelegateBondedTokensResponse } from "./tx"; -/** Msg defines the valset-pref modules's gRPC message service. */ +import { MsgSetValidatorSetPreference, MsgSetValidatorSetPreferenceResponse, MsgDelegateToValidatorSet, MsgDelegateToValidatorSetResponse, MsgUndelegateFromValidatorSet, MsgUndelegateFromValidatorSetResponse, MsgUndelegateFromRebalancedValidatorSet, MsgUndelegateFromRebalancedValidatorSetResponse, MsgRedelegateValidatorSet, MsgRedelegateValidatorSetResponse, MsgWithdrawDelegationRewards, MsgWithdrawDelegationRewardsResponse, MsgDelegateBondedTokens, MsgDelegateBondedTokensResponse } from "./tx"; +/** Msg defines the valset-pref module's gRPC message service. */ export interface Msg { /** * SetValidatorSetPreference creates a set of validator preference. @@ -19,6 +19,12 @@ export interface Msg { * the sdk. */ undelegateFromValidatorSet(request: MsgUndelegateFromValidatorSet): Promise; + /** + * UndelegateFromRebalancedValidatorSet undelegates the proivded amount from + * the validator set, but takes into consideration the current delegations + * to the user's validator set to determine the weights assigned to each. + */ + undelegateFromRebalancedValidatorSet(request: MsgUndelegateFromRebalancedValidatorSet): Promise; /** * RedelegateValidatorSet takes the existing validator set and redelegates to * a new set. @@ -42,6 +48,7 @@ export class MsgClientImpl implements Msg { this.setValidatorSetPreference = this.setValidatorSetPreference.bind(this); this.delegateToValidatorSet = this.delegateToValidatorSet.bind(this); this.undelegateFromValidatorSet = this.undelegateFromValidatorSet.bind(this); + this.undelegateFromRebalancedValidatorSet = this.undelegateFromRebalancedValidatorSet.bind(this); this.redelegateValidatorSet = this.redelegateValidatorSet.bind(this); this.withdrawDelegationRewards = this.withdrawDelegationRewards.bind(this); this.delegateBondedTokens = this.delegateBondedTokens.bind(this); @@ -61,6 +68,11 @@ export class MsgClientImpl implements Msg { const promise = this.rpc.request("osmosis.valsetpref.v1beta1.Msg", "UndelegateFromValidatorSet", data); return promise.then(data => MsgUndelegateFromValidatorSetResponse.decode(new BinaryReader(data))); } + undelegateFromRebalancedValidatorSet(request: MsgUndelegateFromRebalancedValidatorSet): Promise { + const data = MsgUndelegateFromRebalancedValidatorSet.encode(request).finish(); + const promise = this.rpc.request("osmosis.valsetpref.v1beta1.Msg", "UndelegateFromRebalancedValidatorSet", data); + return promise.then(data => MsgUndelegateFromRebalancedValidatorSetResponse.decode(new BinaryReader(data))); + } redelegateValidatorSet(request: MsgRedelegateValidatorSet): Promise { const data = MsgRedelegateValidatorSet.encode(request).finish(); const promise = this.rpc.request("osmosis.valsetpref.v1beta1.Msg", "RedelegateValidatorSet", data); diff --git a/packages/osmo-query/src/codegen/osmosis/valset-pref/v1beta1/tx.ts b/packages/osmo-query/src/codegen/osmosis/valsetpref/v1beta1/tx.ts similarity index 77% rename from packages/osmo-query/src/codegen/osmosis/valset-pref/v1beta1/tx.ts rename to packages/osmo-query/src/codegen/osmosis/valsetpref/v1beta1/tx.ts index 3c18169fe..9b33174d0 100644 --- a/packages/osmo-query/src/codegen/osmosis/valset-pref/v1beta1/tx.ts +++ b/packages/osmo-query/src/codegen/osmosis/valsetpref/v1beta1/tx.ts @@ -15,12 +15,12 @@ export interface MsgSetValidatorSetPreferenceProtoMsg { /** MsgCreateValidatorSetPreference is a list that holds validator-set. */ export interface MsgSetValidatorSetPreferenceAmino { /** delegator is the user who is trying to create a validator-set. */ - delegator: string; + delegator?: string; /** list of {valAddr, weight} to delegate to */ - preferences: ValidatorPreferenceAmino[]; + preferences?: ValidatorPreferenceAmino[]; } export interface MsgSetValidatorSetPreferenceAminoMsg { - type: "osmosis/valset-pref/MsgSetValidatorSetPreference"; + type: "osmosis/MsgSetValidatorSetPreference"; value: MsgSetValidatorSetPreferenceAmino; } /** MsgCreateValidatorSetPreference is a list that holds validator-set. */ @@ -64,7 +64,7 @@ export interface MsgDelegateToValidatorSetProtoMsg { */ export interface MsgDelegateToValidatorSetAmino { /** delegator is the user who is trying to delegate. */ - delegator: string; + delegator?: string; /** * the amount of tokens the user is trying to delegate. * For ex: delegate 10osmo with validator-set {ValA -> 0.5, ValB -> 0.3, ValC @@ -74,7 +74,7 @@ export interface MsgDelegateToValidatorSetAmino { coin?: CoinAmino; } export interface MsgDelegateToValidatorSetAminoMsg { - type: "osmosis/valset-pref/MsgDelegateToValidatorSet"; + type: "osmosis/MsgDelegateToValidatorSet"; value: MsgDelegateToValidatorSetAmino; } /** @@ -114,7 +114,7 @@ export interface MsgUndelegateFromValidatorSetProtoMsg { } export interface MsgUndelegateFromValidatorSetAmino { /** delegator is the user who is trying to undelegate. */ - delegator: string; + delegator?: string; /** * the amount the user wants to undelegate * For ex: Undelegate 10osmo with validator-set {ValA -> 0.5, ValB -> 0.3, @@ -125,7 +125,7 @@ export interface MsgUndelegateFromValidatorSetAmino { coin?: CoinAmino; } export interface MsgUndelegateFromValidatorSetAminoMsg { - type: "osmosis/valset-pref/MsgUndelegateFromValidatorSet"; + type: "osmosis/MsgUndelegateFromValidatorSet"; value: MsgUndelegateFromValidatorSetAmino; } export interface MsgUndelegateFromValidatorSetSDKType { @@ -143,6 +143,57 @@ export interface MsgUndelegateFromValidatorSetResponseAminoMsg { value: MsgUndelegateFromValidatorSetResponseAmino; } export interface MsgUndelegateFromValidatorSetResponseSDKType {} +export interface MsgUndelegateFromRebalancedValidatorSet { + /** delegator is the user who is trying to undelegate. */ + delegator: string; + /** + * the amount the user wants to undelegate + * For ex: Undelegate 50 osmo with validator-set {ValA -> 0.5, ValB -> 0.5} + * Our undelegate logic would first check the current delegation balance. + * If the user has 90 osmo delegated to ValA and 10 osmo delegated to ValB, + * the rebalanced validator set would be {ValA -> 0.9, ValB -> 0.1} + * So now the 45 osmo would be undelegated from ValA and 5 osmo would be + * undelegated from ValB. + */ + coin: Coin; +} +export interface MsgUndelegateFromRebalancedValidatorSetProtoMsg { + typeUrl: "/osmosis.valsetpref.v1beta1.MsgUndelegateFromRebalancedValidatorSet"; + value: Uint8Array; +} +export interface MsgUndelegateFromRebalancedValidatorSetAmino { + /** delegator is the user who is trying to undelegate. */ + delegator?: string; + /** + * the amount the user wants to undelegate + * For ex: Undelegate 50 osmo with validator-set {ValA -> 0.5, ValB -> 0.5} + * Our undelegate logic would first check the current delegation balance. + * If the user has 90 osmo delegated to ValA and 10 osmo delegated to ValB, + * the rebalanced validator set would be {ValA -> 0.9, ValB -> 0.1} + * So now the 45 osmo would be undelegated from ValA and 5 osmo would be + * undelegated from ValB. + */ + coin?: CoinAmino; +} +export interface MsgUndelegateFromRebalancedValidatorSetAminoMsg { + type: "osmosis/MsgUndelegateFromRebalValset"; + value: MsgUndelegateFromRebalancedValidatorSetAmino; +} +export interface MsgUndelegateFromRebalancedValidatorSetSDKType { + delegator: string; + coin: CoinSDKType; +} +export interface MsgUndelegateFromRebalancedValidatorSetResponse {} +export interface MsgUndelegateFromRebalancedValidatorSetResponseProtoMsg { + typeUrl: "/osmosis.valsetpref.v1beta1.MsgUndelegateFromRebalancedValidatorSetResponse"; + value: Uint8Array; +} +export interface MsgUndelegateFromRebalancedValidatorSetResponseAmino {} +export interface MsgUndelegateFromRebalancedValidatorSetResponseAminoMsg { + type: "osmosis/valsetpref/undelegate-from-rebalanced-validator-set-response"; + value: MsgUndelegateFromRebalancedValidatorSetResponseAmino; +} +export interface MsgUndelegateFromRebalancedValidatorSetResponseSDKType {} export interface MsgRedelegateValidatorSet { /** delegator is the user who is trying to create a validator-set. */ delegator: string; @@ -155,12 +206,12 @@ export interface MsgRedelegateValidatorSetProtoMsg { } export interface MsgRedelegateValidatorSetAmino { /** delegator is the user who is trying to create a validator-set. */ - delegator: string; + delegator?: string; /** list of {valAddr, weight} to delegate to */ - preferences: ValidatorPreferenceAmino[]; + preferences?: ValidatorPreferenceAmino[]; } export interface MsgRedelegateValidatorSetAminoMsg { - type: "osmosis/valsetpref/redelegate-validator-set"; + type: "osmosis/MsgRedelegateValidatorSet"; value: MsgRedelegateValidatorSetAmino; } export interface MsgRedelegateValidatorSetSDKType { @@ -196,10 +247,10 @@ export interface MsgWithdrawDelegationRewardsProtoMsg { */ export interface MsgWithdrawDelegationRewardsAmino { /** delegator is the user who is trying to claim staking rewards. */ - delegator: string; + delegator?: string; } export interface MsgWithdrawDelegationRewardsAminoMsg { - type: "osmosis/valset-pref/MsgWithdrawDelegationRewards"; + type: "osmosis/MsgWithdrawDelegationRewards"; value: MsgWithdrawDelegationRewardsAmino; } /** @@ -242,9 +293,9 @@ export interface MsgDelegateBondedTokensProtoMsg { */ export interface MsgDelegateBondedTokensAmino { /** delegator is the user who is trying to force unbond osmo and delegate. */ - delegator: string; + delegator?: string; /** lockup id of osmo in the pool */ - lockID: string; + lockID?: string; } export interface MsgDelegateBondedTokensAminoMsg { type: "osmosis/valsetpref/delegate-bonded-tokens"; @@ -314,10 +365,12 @@ export const MsgSetValidatorSetPreference = { return message; }, fromAmino(object: MsgSetValidatorSetPreferenceAmino): MsgSetValidatorSetPreference { - return { - delegator: object.delegator, - preferences: Array.isArray(object?.preferences) ? object.preferences.map((e: any) => ValidatorPreference.fromAmino(e)) : [] - }; + const message = createBaseMsgSetValidatorSetPreference(); + if (object.delegator !== undefined && object.delegator !== null) { + message.delegator = object.delegator; + } + message.preferences = object.preferences?.map(e => ValidatorPreference.fromAmino(e)) || []; + return message; }, toAmino(message: MsgSetValidatorSetPreference): MsgSetValidatorSetPreferenceAmino { const obj: any = {}; @@ -334,7 +387,7 @@ export const MsgSetValidatorSetPreference = { }, toAminoMsg(message: MsgSetValidatorSetPreference): MsgSetValidatorSetPreferenceAminoMsg { return { - type: "osmosis/valset-pref/MsgSetValidatorSetPreference", + type: "osmosis/MsgSetValidatorSetPreference", value: MsgSetValidatorSetPreference.toAmino(message) }; }, @@ -378,7 +431,8 @@ export const MsgSetValidatorSetPreferenceResponse = { return message; }, fromAmino(_: MsgSetValidatorSetPreferenceResponseAmino): MsgSetValidatorSetPreferenceResponse { - return {}; + const message = createBaseMsgSetValidatorSetPreferenceResponse(); + return message; }, toAmino(_: MsgSetValidatorSetPreferenceResponse): MsgSetValidatorSetPreferenceResponseAmino { const obj: any = {}; @@ -450,10 +504,14 @@ export const MsgDelegateToValidatorSet = { return message; }, fromAmino(object: MsgDelegateToValidatorSetAmino): MsgDelegateToValidatorSet { - return { - delegator: object.delegator, - coin: object?.coin ? Coin.fromAmino(object.coin) : undefined - }; + const message = createBaseMsgDelegateToValidatorSet(); + if (object.delegator !== undefined && object.delegator !== null) { + message.delegator = object.delegator; + } + if (object.coin !== undefined && object.coin !== null) { + message.coin = Coin.fromAmino(object.coin); + } + return message; }, toAmino(message: MsgDelegateToValidatorSet): MsgDelegateToValidatorSetAmino { const obj: any = {}; @@ -466,7 +524,7 @@ export const MsgDelegateToValidatorSet = { }, toAminoMsg(message: MsgDelegateToValidatorSet): MsgDelegateToValidatorSetAminoMsg { return { - type: "osmosis/valset-pref/MsgDelegateToValidatorSet", + type: "osmosis/MsgDelegateToValidatorSet", value: MsgDelegateToValidatorSet.toAmino(message) }; }, @@ -510,7 +568,8 @@ export const MsgDelegateToValidatorSetResponse = { return message; }, fromAmino(_: MsgDelegateToValidatorSetResponseAmino): MsgDelegateToValidatorSetResponse { - return {}; + const message = createBaseMsgDelegateToValidatorSetResponse(); + return message; }, toAmino(_: MsgDelegateToValidatorSetResponse): MsgDelegateToValidatorSetResponseAmino { const obj: any = {}; @@ -582,10 +641,14 @@ export const MsgUndelegateFromValidatorSet = { return message; }, fromAmino(object: MsgUndelegateFromValidatorSetAmino): MsgUndelegateFromValidatorSet { - return { - delegator: object.delegator, - coin: object?.coin ? Coin.fromAmino(object.coin) : undefined - }; + const message = createBaseMsgUndelegateFromValidatorSet(); + if (object.delegator !== undefined && object.delegator !== null) { + message.delegator = object.delegator; + } + if (object.coin !== undefined && object.coin !== null) { + message.coin = Coin.fromAmino(object.coin); + } + return message; }, toAmino(message: MsgUndelegateFromValidatorSet): MsgUndelegateFromValidatorSetAmino { const obj: any = {}; @@ -598,7 +661,7 @@ export const MsgUndelegateFromValidatorSet = { }, toAminoMsg(message: MsgUndelegateFromValidatorSet): MsgUndelegateFromValidatorSetAminoMsg { return { - type: "osmosis/valset-pref/MsgUndelegateFromValidatorSet", + type: "osmosis/MsgUndelegateFromValidatorSet", value: MsgUndelegateFromValidatorSet.toAmino(message) }; }, @@ -642,7 +705,8 @@ export const MsgUndelegateFromValidatorSetResponse = { return message; }, fromAmino(_: MsgUndelegateFromValidatorSetResponseAmino): MsgUndelegateFromValidatorSetResponse { - return {}; + const message = createBaseMsgUndelegateFromValidatorSetResponse(); + return message; }, toAmino(_: MsgUndelegateFromValidatorSetResponse): MsgUndelegateFromValidatorSetResponseAmino { const obj: any = {}; @@ -670,6 +734,143 @@ export const MsgUndelegateFromValidatorSetResponse = { }; } }; +function createBaseMsgUndelegateFromRebalancedValidatorSet(): MsgUndelegateFromRebalancedValidatorSet { + return { + delegator: "", + coin: Coin.fromPartial({}) + }; +} +export const MsgUndelegateFromRebalancedValidatorSet = { + typeUrl: "/osmosis.valsetpref.v1beta1.MsgUndelegateFromRebalancedValidatorSet", + encode(message: MsgUndelegateFromRebalancedValidatorSet, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.delegator !== "") { + writer.uint32(10).string(message.delegator); + } + if (message.coin !== undefined) { + Coin.encode(message.coin, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgUndelegateFromRebalancedValidatorSet { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUndelegateFromRebalancedValidatorSet(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.delegator = reader.string(); + break; + case 2: + message.coin = Coin.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgUndelegateFromRebalancedValidatorSet { + const message = createBaseMsgUndelegateFromRebalancedValidatorSet(); + message.delegator = object.delegator ?? ""; + message.coin = object.coin !== undefined && object.coin !== null ? Coin.fromPartial(object.coin) : undefined; + return message; + }, + fromAmino(object: MsgUndelegateFromRebalancedValidatorSetAmino): MsgUndelegateFromRebalancedValidatorSet { + const message = createBaseMsgUndelegateFromRebalancedValidatorSet(); + if (object.delegator !== undefined && object.delegator !== null) { + message.delegator = object.delegator; + } + if (object.coin !== undefined && object.coin !== null) { + message.coin = Coin.fromAmino(object.coin); + } + return message; + }, + toAmino(message: MsgUndelegateFromRebalancedValidatorSet): MsgUndelegateFromRebalancedValidatorSetAmino { + const obj: any = {}; + obj.delegator = message.delegator; + obj.coin = message.coin ? Coin.toAmino(message.coin) : undefined; + return obj; + }, + fromAminoMsg(object: MsgUndelegateFromRebalancedValidatorSetAminoMsg): MsgUndelegateFromRebalancedValidatorSet { + return MsgUndelegateFromRebalancedValidatorSet.fromAmino(object.value); + }, + toAminoMsg(message: MsgUndelegateFromRebalancedValidatorSet): MsgUndelegateFromRebalancedValidatorSetAminoMsg { + return { + type: "osmosis/MsgUndelegateFromRebalValset", + value: MsgUndelegateFromRebalancedValidatorSet.toAmino(message) + }; + }, + fromProtoMsg(message: MsgUndelegateFromRebalancedValidatorSetProtoMsg): MsgUndelegateFromRebalancedValidatorSet { + return MsgUndelegateFromRebalancedValidatorSet.decode(message.value); + }, + toProto(message: MsgUndelegateFromRebalancedValidatorSet): Uint8Array { + return MsgUndelegateFromRebalancedValidatorSet.encode(message).finish(); + }, + toProtoMsg(message: MsgUndelegateFromRebalancedValidatorSet): MsgUndelegateFromRebalancedValidatorSetProtoMsg { + return { + typeUrl: "/osmosis.valsetpref.v1beta1.MsgUndelegateFromRebalancedValidatorSet", + value: MsgUndelegateFromRebalancedValidatorSet.encode(message).finish() + }; + } +}; +function createBaseMsgUndelegateFromRebalancedValidatorSetResponse(): MsgUndelegateFromRebalancedValidatorSetResponse { + return {}; +} +export const MsgUndelegateFromRebalancedValidatorSetResponse = { + typeUrl: "/osmosis.valsetpref.v1beta1.MsgUndelegateFromRebalancedValidatorSetResponse", + encode(_: MsgUndelegateFromRebalancedValidatorSetResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgUndelegateFromRebalancedValidatorSetResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUndelegateFromRebalancedValidatorSetResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): MsgUndelegateFromRebalancedValidatorSetResponse { + const message = createBaseMsgUndelegateFromRebalancedValidatorSetResponse(); + return message; + }, + fromAmino(_: MsgUndelegateFromRebalancedValidatorSetResponseAmino): MsgUndelegateFromRebalancedValidatorSetResponse { + const message = createBaseMsgUndelegateFromRebalancedValidatorSetResponse(); + return message; + }, + toAmino(_: MsgUndelegateFromRebalancedValidatorSetResponse): MsgUndelegateFromRebalancedValidatorSetResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgUndelegateFromRebalancedValidatorSetResponseAminoMsg): MsgUndelegateFromRebalancedValidatorSetResponse { + return MsgUndelegateFromRebalancedValidatorSetResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgUndelegateFromRebalancedValidatorSetResponse): MsgUndelegateFromRebalancedValidatorSetResponseAminoMsg { + return { + type: "osmosis/valsetpref/undelegate-from-rebalanced-validator-set-response", + value: MsgUndelegateFromRebalancedValidatorSetResponse.toAmino(message) + }; + }, + fromProtoMsg(message: MsgUndelegateFromRebalancedValidatorSetResponseProtoMsg): MsgUndelegateFromRebalancedValidatorSetResponse { + return MsgUndelegateFromRebalancedValidatorSetResponse.decode(message.value); + }, + toProto(message: MsgUndelegateFromRebalancedValidatorSetResponse): Uint8Array { + return MsgUndelegateFromRebalancedValidatorSetResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgUndelegateFromRebalancedValidatorSetResponse): MsgUndelegateFromRebalancedValidatorSetResponseProtoMsg { + return { + typeUrl: "/osmosis.valsetpref.v1beta1.MsgUndelegateFromRebalancedValidatorSetResponse", + value: MsgUndelegateFromRebalancedValidatorSetResponse.encode(message).finish() + }; + } +}; function createBaseMsgRedelegateValidatorSet(): MsgRedelegateValidatorSet { return { delegator: "", @@ -714,10 +915,12 @@ export const MsgRedelegateValidatorSet = { return message; }, fromAmino(object: MsgRedelegateValidatorSetAmino): MsgRedelegateValidatorSet { - return { - delegator: object.delegator, - preferences: Array.isArray(object?.preferences) ? object.preferences.map((e: any) => ValidatorPreference.fromAmino(e)) : [] - }; + const message = createBaseMsgRedelegateValidatorSet(); + if (object.delegator !== undefined && object.delegator !== null) { + message.delegator = object.delegator; + } + message.preferences = object.preferences?.map(e => ValidatorPreference.fromAmino(e)) || []; + return message; }, toAmino(message: MsgRedelegateValidatorSet): MsgRedelegateValidatorSetAmino { const obj: any = {}; @@ -734,7 +937,7 @@ export const MsgRedelegateValidatorSet = { }, toAminoMsg(message: MsgRedelegateValidatorSet): MsgRedelegateValidatorSetAminoMsg { return { - type: "osmosis/valsetpref/redelegate-validator-set", + type: "osmosis/MsgRedelegateValidatorSet", value: MsgRedelegateValidatorSet.toAmino(message) }; }, @@ -778,7 +981,8 @@ export const MsgRedelegateValidatorSetResponse = { return message; }, fromAmino(_: MsgRedelegateValidatorSetResponseAmino): MsgRedelegateValidatorSetResponse { - return {}; + const message = createBaseMsgRedelegateValidatorSetResponse(); + return message; }, toAmino(_: MsgRedelegateValidatorSetResponse): MsgRedelegateValidatorSetResponseAmino { const obj: any = {}; @@ -842,9 +1046,11 @@ export const MsgWithdrawDelegationRewards = { return message; }, fromAmino(object: MsgWithdrawDelegationRewardsAmino): MsgWithdrawDelegationRewards { - return { - delegator: object.delegator - }; + const message = createBaseMsgWithdrawDelegationRewards(); + if (object.delegator !== undefined && object.delegator !== null) { + message.delegator = object.delegator; + } + return message; }, toAmino(message: MsgWithdrawDelegationRewards): MsgWithdrawDelegationRewardsAmino { const obj: any = {}; @@ -856,7 +1062,7 @@ export const MsgWithdrawDelegationRewards = { }, toAminoMsg(message: MsgWithdrawDelegationRewards): MsgWithdrawDelegationRewardsAminoMsg { return { - type: "osmosis/valset-pref/MsgWithdrawDelegationRewards", + type: "osmosis/MsgWithdrawDelegationRewards", value: MsgWithdrawDelegationRewards.toAmino(message) }; }, @@ -900,7 +1106,8 @@ export const MsgWithdrawDelegationRewardsResponse = { return message; }, fromAmino(_: MsgWithdrawDelegationRewardsResponseAmino): MsgWithdrawDelegationRewardsResponse { - return {}; + const message = createBaseMsgWithdrawDelegationRewardsResponse(); + return message; }, toAmino(_: MsgWithdrawDelegationRewardsResponse): MsgWithdrawDelegationRewardsResponseAmino { const obj: any = {}; @@ -972,10 +1179,14 @@ export const MsgDelegateBondedTokens = { return message; }, fromAmino(object: MsgDelegateBondedTokensAmino): MsgDelegateBondedTokens { - return { - delegator: object.delegator, - lockID: BigInt(object.lockID) - }; + const message = createBaseMsgDelegateBondedTokens(); + if (object.delegator !== undefined && object.delegator !== null) { + message.delegator = object.delegator; + } + if (object.lockID !== undefined && object.lockID !== null) { + message.lockID = BigInt(object.lockID); + } + return message; }, toAmino(message: MsgDelegateBondedTokens): MsgDelegateBondedTokensAmino { const obj: any = {}; @@ -1032,7 +1243,8 @@ export const MsgDelegateBondedTokensResponse = { return message; }, fromAmino(_: MsgDelegateBondedTokensResponseAmino): MsgDelegateBondedTokensResponse { - return {}; + const message = createBaseMsgDelegateBondedTokensResponse(); + return message; }, toAmino(_: MsgDelegateBondedTokensResponse): MsgDelegateBondedTokensResponseAmino { const obj: any = {}; diff --git a/packages/osmo-query/src/codegen/react-query.ts b/packages/osmo-query/src/codegen/react-query.ts index 93cf9f7e6..8914d52a5 100644 --- a/packages/osmo-query/src/codegen/react-query.ts +++ b/packages/osmo-query/src/codegen/react-query.ts @@ -1,5 +1,5 @@ /** -* This file and any referenced files were automatically generated by @cosmology/telescope@0.102.0 +* This file and any referenced files were automatically generated by @cosmology/telescope@1.4.1 * DO NOT MODIFY BY HAND. Instead, download the latest proto files for your chain * and run the transpile command or yarn proto command to regenerate this bundle. */ diff --git a/packages/osmo-query/src/codegen/tendermint/abci/types.ts b/packages/osmo-query/src/codegen/tendermint/abci/types.ts index 48d0f5341..ff1dfcd88 100644 --- a/packages/osmo-query/src/codegen/tendermint/abci/types.ts +++ b/packages/osmo-query/src/codegen/tendermint/abci/types.ts @@ -1,10 +1,10 @@ import { Timestamp } from "../../google/protobuf/timestamp"; +import { ConsensusParams, ConsensusParamsAmino, ConsensusParamsSDKType } from "../types/params"; import { Header, HeaderAmino, HeaderSDKType } from "../types/types"; import { ProofOps, ProofOpsAmino, ProofOpsSDKType } from "../crypto/proof"; -import { EvidenceParams, EvidenceParamsAmino, EvidenceParamsSDKType, ValidatorParams, ValidatorParamsAmino, ValidatorParamsSDKType, VersionParams, VersionParamsAmino, VersionParamsSDKType } from "../types/params"; import { PublicKey, PublicKeyAmino, PublicKeySDKType } from "../crypto/keys"; import { BinaryReader, BinaryWriter } from "../../binary"; -import { toTimestamp, fromTimestamp, isSet } from "../../helpers"; +import { toTimestamp, fromTimestamp, bytesFromBase64, base64FromBytes } from "../../helpers"; export enum CheckTxType { NEW = 0, RECHECK = 1, @@ -161,40 +161,78 @@ export function responseApplySnapshotChunk_ResultToJSON(object: ResponseApplySna return "UNRECOGNIZED"; } } -export enum EvidenceType { +export enum ResponseProcessProposal_ProposalStatus { + UNKNOWN = 0, + ACCEPT = 1, + REJECT = 2, + UNRECOGNIZED = -1, +} +export const ResponseProcessProposal_ProposalStatusSDKType = ResponseProcessProposal_ProposalStatus; +export const ResponseProcessProposal_ProposalStatusAmino = ResponseProcessProposal_ProposalStatus; +export function responseProcessProposal_ProposalStatusFromJSON(object: any): ResponseProcessProposal_ProposalStatus { + switch (object) { + case 0: + case "UNKNOWN": + return ResponseProcessProposal_ProposalStatus.UNKNOWN; + case 1: + case "ACCEPT": + return ResponseProcessProposal_ProposalStatus.ACCEPT; + case 2: + case "REJECT": + return ResponseProcessProposal_ProposalStatus.REJECT; + case -1: + case "UNRECOGNIZED": + default: + return ResponseProcessProposal_ProposalStatus.UNRECOGNIZED; + } +} +export function responseProcessProposal_ProposalStatusToJSON(object: ResponseProcessProposal_ProposalStatus): string { + switch (object) { + case ResponseProcessProposal_ProposalStatus.UNKNOWN: + return "UNKNOWN"; + case ResponseProcessProposal_ProposalStatus.ACCEPT: + return "ACCEPT"; + case ResponseProcessProposal_ProposalStatus.REJECT: + return "REJECT"; + case ResponseProcessProposal_ProposalStatus.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} +export enum MisbehaviorType { UNKNOWN = 0, DUPLICATE_VOTE = 1, LIGHT_CLIENT_ATTACK = 2, UNRECOGNIZED = -1, } -export const EvidenceTypeSDKType = EvidenceType; -export const EvidenceTypeAmino = EvidenceType; -export function evidenceTypeFromJSON(object: any): EvidenceType { +export const MisbehaviorTypeSDKType = MisbehaviorType; +export const MisbehaviorTypeAmino = MisbehaviorType; +export function misbehaviorTypeFromJSON(object: any): MisbehaviorType { switch (object) { case 0: case "UNKNOWN": - return EvidenceType.UNKNOWN; + return MisbehaviorType.UNKNOWN; case 1: case "DUPLICATE_VOTE": - return EvidenceType.DUPLICATE_VOTE; + return MisbehaviorType.DUPLICATE_VOTE; case 2: case "LIGHT_CLIENT_ATTACK": - return EvidenceType.LIGHT_CLIENT_ATTACK; + return MisbehaviorType.LIGHT_CLIENT_ATTACK; case -1: case "UNRECOGNIZED": default: - return EvidenceType.UNRECOGNIZED; + return MisbehaviorType.UNRECOGNIZED; } } -export function evidenceTypeToJSON(object: EvidenceType): string { +export function misbehaviorTypeToJSON(object: MisbehaviorType): string { switch (object) { - case EvidenceType.UNKNOWN: + case MisbehaviorType.UNKNOWN: return "UNKNOWN"; - case EvidenceType.DUPLICATE_VOTE: + case MisbehaviorType.DUPLICATE_VOTE: return "DUPLICATE_VOTE"; - case EvidenceType.LIGHT_CLIENT_ATTACK: + case MisbehaviorType.LIGHT_CLIENT_ATTACK: return "LIGHT_CLIENT_ATTACK"; - case EvidenceType.UNRECOGNIZED: + case MisbehaviorType.UNRECOGNIZED: default: return "UNRECOGNIZED"; } @@ -203,7 +241,6 @@ export interface Request { echo?: RequestEcho; flush?: RequestFlush; info?: RequestInfo; - setOption?: RequestSetOption; initChain?: RequestInitChain; query?: RequestQuery; beginBlock?: RequestBeginBlock; @@ -215,6 +252,8 @@ export interface Request { offerSnapshot?: RequestOfferSnapshot; loadSnapshotChunk?: RequestLoadSnapshotChunk; applySnapshotChunk?: RequestApplySnapshotChunk; + prepareProposal?: RequestPrepareProposal; + processProposal?: RequestProcessProposal; } export interface RequestProtoMsg { typeUrl: "/tendermint.abci.Request"; @@ -224,7 +263,6 @@ export interface RequestAmino { echo?: RequestEchoAmino; flush?: RequestFlushAmino; info?: RequestInfoAmino; - set_option?: RequestSetOptionAmino; init_chain?: RequestInitChainAmino; query?: RequestQueryAmino; begin_block?: RequestBeginBlockAmino; @@ -236,6 +274,8 @@ export interface RequestAmino { offer_snapshot?: RequestOfferSnapshotAmino; load_snapshot_chunk?: RequestLoadSnapshotChunkAmino; apply_snapshot_chunk?: RequestApplySnapshotChunkAmino; + prepare_proposal?: RequestPrepareProposalAmino; + process_proposal?: RequestProcessProposalAmino; } export interface RequestAminoMsg { type: "/tendermint.abci.Request"; @@ -245,7 +285,6 @@ export interface RequestSDKType { echo?: RequestEchoSDKType; flush?: RequestFlushSDKType; info?: RequestInfoSDKType; - set_option?: RequestSetOptionSDKType; init_chain?: RequestInitChainSDKType; query?: RequestQuerySDKType; begin_block?: RequestBeginBlockSDKType; @@ -257,6 +296,8 @@ export interface RequestSDKType { offer_snapshot?: RequestOfferSnapshotSDKType; load_snapshot_chunk?: RequestLoadSnapshotChunkSDKType; apply_snapshot_chunk?: RequestApplySnapshotChunkSDKType; + prepare_proposal?: RequestPrepareProposalSDKType; + process_proposal?: RequestProcessProposalSDKType; } export interface RequestEcho { message: string; @@ -266,7 +307,7 @@ export interface RequestEchoProtoMsg { value: Uint8Array; } export interface RequestEchoAmino { - message: string; + message?: string; } export interface RequestEchoAminoMsg { type: "/tendermint.abci.RequestEcho"; @@ -290,15 +331,17 @@ export interface RequestInfo { version: string; blockVersion: bigint; p2pVersion: bigint; + abciVersion: string; } export interface RequestInfoProtoMsg { typeUrl: "/tendermint.abci.RequestInfo"; value: Uint8Array; } export interface RequestInfoAmino { - version: string; - block_version: string; - p2p_version: string; + version?: string; + block_version?: string; + p2p_version?: string; + abci_version?: string; } export interface RequestInfoAminoMsg { type: "/tendermint.abci.RequestInfo"; @@ -308,34 +351,12 @@ export interface RequestInfoSDKType { version: string; block_version: bigint; p2p_version: bigint; -} -/** nondeterministic */ -export interface RequestSetOption { - key: string; - value: string; -} -export interface RequestSetOptionProtoMsg { - typeUrl: "/tendermint.abci.RequestSetOption"; - value: Uint8Array; -} -/** nondeterministic */ -export interface RequestSetOptionAmino { - key: string; - value: string; -} -export interface RequestSetOptionAminoMsg { - type: "/tendermint.abci.RequestSetOption"; - value: RequestSetOptionAmino; -} -/** nondeterministic */ -export interface RequestSetOptionSDKType { - key: string; - value: string; + abci_version: string; } export interface RequestInitChain { time: Date; chainId: string; - consensusParams: ConsensusParams; + consensusParams?: ConsensusParams; validators: ValidatorUpdate[]; appStateBytes: Uint8Array; initialHeight: bigint; @@ -345,12 +366,12 @@ export interface RequestInitChainProtoMsg { value: Uint8Array; } export interface RequestInitChainAmino { - time?: Date; - chain_id: string; + time?: string; + chain_id?: string; consensus_params?: ConsensusParamsAmino; - validators: ValidatorUpdateAmino[]; - app_state_bytes: Uint8Array; - initial_height: string; + validators?: ValidatorUpdateAmino[]; + app_state_bytes?: string; + initial_height?: string; } export interface RequestInitChainAminoMsg { type: "/tendermint.abci.RequestInitChain"; @@ -359,7 +380,7 @@ export interface RequestInitChainAminoMsg { export interface RequestInitChainSDKType { time: Date; chain_id: string; - consensus_params: ConsensusParamsSDKType; + consensus_params?: ConsensusParamsSDKType; validators: ValidatorUpdateSDKType[]; app_state_bytes: Uint8Array; initial_height: bigint; @@ -375,10 +396,10 @@ export interface RequestQueryProtoMsg { value: Uint8Array; } export interface RequestQueryAmino { - data: Uint8Array; - path: string; - height: string; - prove: boolean; + data?: string; + path?: string; + height?: string; + prove?: boolean; } export interface RequestQueryAminoMsg { type: "/tendermint.abci.RequestQuery"; @@ -393,18 +414,18 @@ export interface RequestQuerySDKType { export interface RequestBeginBlock { hash: Uint8Array; header: Header; - lastCommitInfo: LastCommitInfo; - byzantineValidators: Evidence[]; + lastCommitInfo: CommitInfo; + byzantineValidators: Misbehavior[]; } export interface RequestBeginBlockProtoMsg { typeUrl: "/tendermint.abci.RequestBeginBlock"; value: Uint8Array; } export interface RequestBeginBlockAmino { - hash: Uint8Array; + hash?: string; header?: HeaderAmino; - last_commit_info?: LastCommitInfoAmino; - byzantine_validators: EvidenceAmino[]; + last_commit_info?: CommitInfoAmino; + byzantine_validators?: MisbehaviorAmino[]; } export interface RequestBeginBlockAminoMsg { type: "/tendermint.abci.RequestBeginBlock"; @@ -413,8 +434,8 @@ export interface RequestBeginBlockAminoMsg { export interface RequestBeginBlockSDKType { hash: Uint8Array; header: HeaderSDKType; - last_commit_info: LastCommitInfoSDKType; - byzantine_validators: EvidenceSDKType[]; + last_commit_info: CommitInfoSDKType; + byzantine_validators: MisbehaviorSDKType[]; } export interface RequestCheckTx { tx: Uint8Array; @@ -425,8 +446,8 @@ export interface RequestCheckTxProtoMsg { value: Uint8Array; } export interface RequestCheckTxAmino { - tx: Uint8Array; - type: CheckTxType; + tx?: string; + type?: CheckTxType; } export interface RequestCheckTxAminoMsg { type: "/tendermint.abci.RequestCheckTx"; @@ -444,7 +465,7 @@ export interface RequestDeliverTxProtoMsg { value: Uint8Array; } export interface RequestDeliverTxAmino { - tx: Uint8Array; + tx?: string; } export interface RequestDeliverTxAminoMsg { type: "/tendermint.abci.RequestDeliverTx"; @@ -461,7 +482,7 @@ export interface RequestEndBlockProtoMsg { value: Uint8Array; } export interface RequestEndBlockAmino { - height: string; + height?: string; } export interface RequestEndBlockAminoMsg { type: "/tendermint.abci.RequestEndBlock"; @@ -498,7 +519,7 @@ export interface RequestListSnapshotsSDKType {} /** 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; } @@ -511,7 +532,7 @@ export interface RequestOfferSnapshotAmino { /** snapshot offered by peers */ snapshot?: SnapshotAmino; /** light client-verified app hash for snapshot height */ - app_hash: Uint8Array; + app_hash?: string; } export interface RequestOfferSnapshotAminoMsg { type: "/tendermint.abci.RequestOfferSnapshot"; @@ -519,7 +540,7 @@ export interface RequestOfferSnapshotAminoMsg { } /** offers a snapshot to the application */ export interface RequestOfferSnapshotSDKType { - snapshot: SnapshotSDKType; + snapshot?: SnapshotSDKType; app_hash: Uint8Array; } /** loads a snapshot chunk */ @@ -534,9 +555,9 @@ export interface RequestLoadSnapshotChunkProtoMsg { } /** loads a snapshot chunk */ export interface RequestLoadSnapshotChunkAmino { - height: string; - format: number; - chunk: number; + height?: string; + format?: number; + chunk?: number; } export interface RequestLoadSnapshotChunkAminoMsg { type: "/tendermint.abci.RequestLoadSnapshotChunk"; @@ -560,9 +581,9 @@ export interface RequestApplySnapshotChunkProtoMsg { } /** Applies a snapshot chunk */ export interface RequestApplySnapshotChunkAmino { - index: number; - chunk: Uint8Array; - sender: string; + index?: number; + chunk?: string; + sender?: string; } export interface RequestApplySnapshotChunkAminoMsg { type: "/tendermint.abci.RequestApplySnapshotChunk"; @@ -574,12 +595,103 @@ export interface RequestApplySnapshotChunkSDKType { chunk: Uint8Array; sender: string; } +export interface RequestPrepareProposal { + /** the modified transactions cannot exceed this size. */ + maxTxBytes: bigint; + /** + * txs is an array of transactions that will be included in a block, + * sent to the app for possible modifications. + */ + txs: Uint8Array[]; + localLastCommit: ExtendedCommitInfo; + misbehavior: Misbehavior[]; + height: bigint; + time: Date; + nextValidatorsHash: Uint8Array; + /** address of the public key of the validator proposing the block. */ + proposerAddress: Uint8Array; +} +export interface RequestPrepareProposalProtoMsg { + typeUrl: "/tendermint.abci.RequestPrepareProposal"; + value: Uint8Array; +} +export interface RequestPrepareProposalAmino { + /** the modified transactions cannot exceed this size. */ + max_tx_bytes?: string; + /** + * txs is an array of transactions that will be included in a block, + * sent to the app for possible modifications. + */ + txs?: string[]; + local_last_commit?: ExtendedCommitInfoAmino; + misbehavior?: MisbehaviorAmino[]; + height?: string; + time?: string; + next_validators_hash?: string; + /** address of the public key of the validator proposing the block. */ + proposer_address?: string; +} +export interface RequestPrepareProposalAminoMsg { + type: "/tendermint.abci.RequestPrepareProposal"; + value: RequestPrepareProposalAmino; +} +export interface RequestPrepareProposalSDKType { + max_tx_bytes: bigint; + txs: Uint8Array[]; + local_last_commit: ExtendedCommitInfoSDKType; + misbehavior: MisbehaviorSDKType[]; + height: bigint; + time: Date; + next_validators_hash: Uint8Array; + proposer_address: Uint8Array; +} +export interface RequestProcessProposal { + txs: Uint8Array[]; + proposedLastCommit: CommitInfo; + misbehavior: Misbehavior[]; + /** hash is the merkle root hash of the fields of the proposed block. */ + hash: Uint8Array; + height: bigint; + time: Date; + nextValidatorsHash: Uint8Array; + /** address of the public key of the original proposer of the block. */ + proposerAddress: Uint8Array; +} +export interface RequestProcessProposalProtoMsg { + typeUrl: "/tendermint.abci.RequestProcessProposal"; + value: Uint8Array; +} +export interface RequestProcessProposalAmino { + txs?: string[]; + proposed_last_commit?: CommitInfoAmino; + misbehavior?: MisbehaviorAmino[]; + /** hash is the merkle root hash of the fields of the proposed block. */ + hash?: string; + height?: string; + time?: string; + next_validators_hash?: string; + /** address of the public key of the original proposer of the block. */ + proposer_address?: string; +} +export interface RequestProcessProposalAminoMsg { + type: "/tendermint.abci.RequestProcessProposal"; + value: RequestProcessProposalAmino; +} +export interface RequestProcessProposalSDKType { + txs: Uint8Array[]; + proposed_last_commit: CommitInfoSDKType; + misbehavior: MisbehaviorSDKType[]; + hash: Uint8Array; + height: bigint; + time: Date; + next_validators_hash: Uint8Array; + proposer_address: Uint8Array; +} export interface Response { exception?: ResponseException; echo?: ResponseEcho; flush?: ResponseFlush; info?: ResponseInfo; - setOption?: ResponseSetOption; initChain?: ResponseInitChain; query?: ResponseQuery; beginBlock?: ResponseBeginBlock; @@ -591,6 +703,8 @@ export interface Response { offerSnapshot?: ResponseOfferSnapshot; loadSnapshotChunk?: ResponseLoadSnapshotChunk; applySnapshotChunk?: ResponseApplySnapshotChunk; + prepareProposal?: ResponsePrepareProposal; + processProposal?: ResponseProcessProposal; } export interface ResponseProtoMsg { typeUrl: "/tendermint.abci.Response"; @@ -601,7 +715,6 @@ export interface ResponseAmino { echo?: ResponseEchoAmino; flush?: ResponseFlushAmino; info?: ResponseInfoAmino; - set_option?: ResponseSetOptionAmino; init_chain?: ResponseInitChainAmino; query?: ResponseQueryAmino; begin_block?: ResponseBeginBlockAmino; @@ -613,6 +726,8 @@ export interface ResponseAmino { offer_snapshot?: ResponseOfferSnapshotAmino; load_snapshot_chunk?: ResponseLoadSnapshotChunkAmino; apply_snapshot_chunk?: ResponseApplySnapshotChunkAmino; + prepare_proposal?: ResponsePrepareProposalAmino; + process_proposal?: ResponseProcessProposalAmino; } export interface ResponseAminoMsg { type: "/tendermint.abci.Response"; @@ -623,7 +738,6 @@ export interface ResponseSDKType { echo?: ResponseEchoSDKType; flush?: ResponseFlushSDKType; info?: ResponseInfoSDKType; - set_option?: ResponseSetOptionSDKType; init_chain?: ResponseInitChainSDKType; query?: ResponseQuerySDKType; begin_block?: ResponseBeginBlockSDKType; @@ -635,6 +749,8 @@ export interface ResponseSDKType { offer_snapshot?: ResponseOfferSnapshotSDKType; load_snapshot_chunk?: ResponseLoadSnapshotChunkSDKType; apply_snapshot_chunk?: ResponseApplySnapshotChunkSDKType; + prepare_proposal?: ResponsePrepareProposalSDKType; + process_proposal?: ResponseProcessProposalSDKType; } /** nondeterministic */ export interface ResponseException { @@ -646,7 +762,7 @@ export interface ResponseExceptionProtoMsg { } /** nondeterministic */ export interface ResponseExceptionAmino { - error: string; + error?: string; } export interface ResponseExceptionAminoMsg { type: "/tendermint.abci.ResponseException"; @@ -664,7 +780,7 @@ export interface ResponseEchoProtoMsg { value: Uint8Array; } export interface ResponseEchoAmino { - message: string; + message?: string; } export interface ResponseEchoAminoMsg { type: "/tendermint.abci.ResponseEcho"; @@ -696,11 +812,11 @@ export interface ResponseInfoProtoMsg { value: Uint8Array; } export interface ResponseInfoAmino { - data: string; - version: string; - app_version: string; - last_block_height: string; - last_block_app_hash: Uint8Array; + data?: string; + version?: string; + app_version?: string; + last_block_height?: string; + last_block_app_hash?: string; } export interface ResponseInfoAminoMsg { type: "/tendermint.abci.ResponseInfo"; @@ -713,36 +829,8 @@ export interface ResponseInfoSDKType { last_block_height: bigint; last_block_app_hash: Uint8Array; } -/** nondeterministic */ -export interface ResponseSetOption { - code: number; - /** bytes data = 2; */ - log: string; - info: string; -} -export interface ResponseSetOptionProtoMsg { - typeUrl: "/tendermint.abci.ResponseSetOption"; - value: Uint8Array; -} -/** nondeterministic */ -export interface ResponseSetOptionAmino { - code: number; - /** bytes data = 2; */ - log: string; - info: string; -} -export interface ResponseSetOptionAminoMsg { - type: "/tendermint.abci.ResponseSetOption"; - value: ResponseSetOptionAmino; -} -/** nondeterministic */ -export interface ResponseSetOptionSDKType { - code: number; - log: string; - info: string; -} export interface ResponseInitChain { - consensusParams: ConsensusParams; + consensusParams?: ConsensusParams; validators: ValidatorUpdate[]; appHash: Uint8Array; } @@ -752,15 +840,15 @@ export interface ResponseInitChainProtoMsg { } export interface ResponseInitChainAmino { consensus_params?: ConsensusParamsAmino; - validators: ValidatorUpdateAmino[]; - app_hash: Uint8Array; + validators?: ValidatorUpdateAmino[]; + app_hash?: string; } export interface ResponseInitChainAminoMsg { type: "/tendermint.abci.ResponseInitChain"; value: ResponseInitChainAmino; } export interface ResponseInitChainSDKType { - consensus_params: ConsensusParamsSDKType; + consensus_params?: ConsensusParamsSDKType; validators: ValidatorUpdateSDKType[]; app_hash: Uint8Array; } @@ -773,7 +861,7 @@ export interface ResponseQuery { index: bigint; key: Uint8Array; value: Uint8Array; - proofOps: ProofOps; + proofOps?: ProofOps; height: bigint; codespace: string; } @@ -782,17 +870,17 @@ export interface ResponseQueryProtoMsg { value: Uint8Array; } export interface ResponseQueryAmino { - code: number; + code?: number; /** bytes data = 2; // use "value" instead. */ - log: string; + log?: string; /** nondeterministic */ - info: string; - index: string; - key: Uint8Array; - value: Uint8Array; + info?: string; + index?: string; + key?: string; + value?: string; proof_ops?: ProofOpsAmino; - height: string; - codespace: string; + height?: string; + codespace?: string; } export interface ResponseQueryAminoMsg { type: "/tendermint.abci.ResponseQuery"; @@ -805,7 +893,7 @@ export interface ResponseQuerySDKType { index: bigint; key: Uint8Array; value: Uint8Array; - proof_ops: ProofOpsSDKType; + proof_ops?: ProofOpsSDKType; height: bigint; codespace: string; } @@ -817,7 +905,7 @@ export interface ResponseBeginBlockProtoMsg { value: Uint8Array; } export interface ResponseBeginBlockAmino { - events: EventAmino[]; + events?: EventAmino[]; } export interface ResponseBeginBlockAminoMsg { type: "/tendermint.abci.ResponseBeginBlock"; @@ -837,22 +925,36 @@ export interface ResponseCheckTx { gasUsed: bigint; events: Event[]; codespace: string; + sender: string; + priority: bigint; + /** + * mempool_error is set by CometBFT. + * ABCI applictions creating a ResponseCheckTX should not set mempool_error. + */ + mempoolError: string; } export interface ResponseCheckTxProtoMsg { typeUrl: "/tendermint.abci.ResponseCheckTx"; value: Uint8Array; } export interface ResponseCheckTxAmino { - code: number; - data: Uint8Array; + code?: number; + data?: string; /** nondeterministic */ - log: string; + log?: string; /** nondeterministic */ - info: string; - gas_wanted: string; - gas_used: string; - events: EventAmino[]; - codespace: string; + info?: string; + gas_wanted?: string; + gas_used?: string; + events?: EventAmino[]; + codespace?: string; + sender?: string; + priority?: string; + /** + * mempool_error is set by CometBFT. + * ABCI applictions creating a ResponseCheckTX should not set mempool_error. + */ + mempool_error?: string; } export interface ResponseCheckTxAminoMsg { type: "/tendermint.abci.ResponseCheckTx"; @@ -867,6 +969,9 @@ export interface ResponseCheckTxSDKType { gas_used: bigint; events: EventSDKType[]; codespace: string; + sender: string; + priority: bigint; + mempool_error: string; } export interface ResponseDeliverTx { code: number; @@ -885,16 +990,16 @@ export interface ResponseDeliverTxProtoMsg { value: Uint8Array; } export interface ResponseDeliverTxAmino { - code: number; - data: Uint8Array; + code?: number; + data?: string; /** nondeterministic */ - log: string; + log?: string; /** nondeterministic */ - info: string; - gas_wanted: string; - gas_used: string; - events: EventAmino[]; - codespace: string; + info?: string; + gas_wanted?: string; + gas_used?: string; + events?: EventAmino[]; + codespace?: string; } export interface ResponseDeliverTxAminoMsg { type: "/tendermint.abci.ResponseDeliverTx"; @@ -912,7 +1017,7 @@ export interface ResponseDeliverTxSDKType { } export interface ResponseEndBlock { validatorUpdates: ValidatorUpdate[]; - consensusParamUpdates: ConsensusParams; + consensusParamUpdates?: ConsensusParams; events: Event[]; } export interface ResponseEndBlockProtoMsg { @@ -920,9 +1025,9 @@ export interface ResponseEndBlockProtoMsg { value: Uint8Array; } export interface ResponseEndBlockAmino { - validator_updates: ValidatorUpdateAmino[]; + validator_updates?: ValidatorUpdateAmino[]; consensus_param_updates?: ConsensusParamsAmino; - events: EventAmino[]; + events?: EventAmino[]; } export interface ResponseEndBlockAminoMsg { type: "/tendermint.abci.ResponseEndBlock"; @@ -930,7 +1035,7 @@ export interface ResponseEndBlockAminoMsg { } export interface ResponseEndBlockSDKType { validator_updates: ValidatorUpdateSDKType[]; - consensus_param_updates: ConsensusParamsSDKType; + consensus_param_updates?: ConsensusParamsSDKType; events: EventSDKType[]; } export interface ResponseCommit { @@ -944,8 +1049,8 @@ export interface ResponseCommitProtoMsg { } export interface ResponseCommitAmino { /** reserve 1 */ - data: Uint8Array; - retain_height: string; + data?: string; + retain_height?: string; } export interface ResponseCommitAminoMsg { type: "/tendermint.abci.ResponseCommit"; @@ -963,7 +1068,7 @@ export interface ResponseListSnapshotsProtoMsg { value: Uint8Array; } export interface ResponseListSnapshotsAmino { - snapshots: SnapshotAmino[]; + snapshots?: SnapshotAmino[]; } export interface ResponseListSnapshotsAminoMsg { type: "/tendermint.abci.ResponseListSnapshots"; @@ -980,7 +1085,7 @@ export interface ResponseOfferSnapshotProtoMsg { value: Uint8Array; } export interface ResponseOfferSnapshotAmino { - result: ResponseOfferSnapshot_Result; + result?: ResponseOfferSnapshot_Result; } export interface ResponseOfferSnapshotAminoMsg { type: "/tendermint.abci.ResponseOfferSnapshot"; @@ -997,7 +1102,7 @@ export interface ResponseLoadSnapshotChunkProtoMsg { value: Uint8Array; } export interface ResponseLoadSnapshotChunkAmino { - chunk: Uint8Array; + chunk?: string; } export interface ResponseLoadSnapshotChunkAminoMsg { type: "/tendermint.abci.ResponseLoadSnapshotChunk"; @@ -1018,11 +1123,11 @@ export interface ResponseApplySnapshotChunkProtoMsg { value: Uint8Array; } export interface ResponseApplySnapshotChunkAmino { - result: ResponseApplySnapshotChunk_Result; + result?: ResponseApplySnapshotChunk_Result; /** Chunks to refetch and reapply */ - refetch_chunks: number[]; + refetch_chunks?: number[]; /** Chunk senders to reject and ban */ - reject_senders: string[]; + reject_senders?: string[]; } export interface ResponseApplySnapshotChunkAminoMsg { type: "/tendermint.abci.ResponseApplySnapshotChunk"; @@ -1033,91 +1138,90 @@ export interface ResponseApplySnapshotChunkSDKType { refetch_chunks: number[]; reject_senders: string[]; } -/** - * ConsensusParams contains all consensus-relevant parameters - * that can be adjusted by the abci app - */ -export interface ConsensusParams { - block: BlockParams; - evidence: EvidenceParams; - validator: ValidatorParams; - version: VersionParams; -} -export interface ConsensusParamsProtoMsg { - typeUrl: "/tendermint.abci.ConsensusParams"; +export interface ResponsePrepareProposal { + txs: Uint8Array[]; +} +export interface ResponsePrepareProposalProtoMsg { + typeUrl: "/tendermint.abci.ResponsePrepareProposal"; value: Uint8Array; } -/** - * ConsensusParams contains all consensus-relevant parameters - * that can be adjusted by the abci app - */ -export interface ConsensusParamsAmino { - block?: BlockParamsAmino; - evidence?: EvidenceParamsAmino; - validator?: ValidatorParamsAmino; - version?: VersionParamsAmino; +export interface ResponsePrepareProposalAmino { + txs?: string[]; } -export interface ConsensusParamsAminoMsg { - type: "/tendermint.abci.ConsensusParams"; - value: ConsensusParamsAmino; +export interface ResponsePrepareProposalAminoMsg { + type: "/tendermint.abci.ResponsePrepareProposal"; + value: ResponsePrepareProposalAmino; } -/** - * ConsensusParams contains all consensus-relevant parameters - * that can be adjusted by the abci app - */ -export interface ConsensusParamsSDKType { - block: BlockParamsSDKType; - evidence: EvidenceParamsSDKType; - validator: ValidatorParamsSDKType; - version: VersionParamsSDKType; -} -/** BlockParams contains limits on the block size. */ -export interface BlockParams { - /** Note: must be greater than 0 */ - maxBytes: bigint; - /** Note: must be greater or equal to -1 */ - maxGas: bigint; -} -export interface BlockParamsProtoMsg { - typeUrl: "/tendermint.abci.BlockParams"; +export interface ResponsePrepareProposalSDKType { + txs: Uint8Array[]; +} +export interface ResponseProcessProposal { + status: ResponseProcessProposal_ProposalStatus; +} +export interface ResponseProcessProposalProtoMsg { + typeUrl: "/tendermint.abci.ResponseProcessProposal"; value: Uint8Array; } -/** BlockParams contains limits on the block size. */ -export interface BlockParamsAmino { - /** Note: must be greater than 0 */ - max_bytes: string; - /** Note: must be greater or equal to -1 */ - max_gas: string; +export interface ResponseProcessProposalAmino { + status?: ResponseProcessProposal_ProposalStatus; } -export interface BlockParamsAminoMsg { - type: "/tendermint.abci.BlockParams"; - value: BlockParamsAmino; +export interface ResponseProcessProposalAminoMsg { + type: "/tendermint.abci.ResponseProcessProposal"; + value: ResponseProcessProposalAmino; } -/** BlockParams contains limits on the block size. */ -export interface BlockParamsSDKType { - max_bytes: bigint; - max_gas: bigint; +export interface ResponseProcessProposalSDKType { + status: ResponseProcessProposal_ProposalStatus; } -export interface LastCommitInfo { +export interface CommitInfo { round: number; votes: VoteInfo[]; } -export interface LastCommitInfoProtoMsg { - typeUrl: "/tendermint.abci.LastCommitInfo"; +export interface CommitInfoProtoMsg { + typeUrl: "/tendermint.abci.CommitInfo"; value: Uint8Array; } -export interface LastCommitInfoAmino { - round: number; - votes: VoteInfoAmino[]; +export interface CommitInfoAmino { + round?: number; + votes?: VoteInfoAmino[]; } -export interface LastCommitInfoAminoMsg { - type: "/tendermint.abci.LastCommitInfo"; - value: LastCommitInfoAmino; +export interface CommitInfoAminoMsg { + type: "/tendermint.abci.CommitInfo"; + value: CommitInfoAmino; } -export interface LastCommitInfoSDKType { +export interface CommitInfoSDKType { round: number; votes: VoteInfoSDKType[]; } +export interface ExtendedCommitInfo { + /** The round at which the block proposer decided in the previous height. */ + round: number; + /** + * List of validators' addresses in the last validator set with their voting + * information, including vote extensions. + */ + votes: ExtendedVoteInfo[]; +} +export interface ExtendedCommitInfoProtoMsg { + typeUrl: "/tendermint.abci.ExtendedCommitInfo"; + value: Uint8Array; +} +export interface ExtendedCommitInfoAmino { + /** The round at which the block proposer decided in the previous height. */ + round?: number; + /** + * List of validators' addresses in the last validator set with their voting + * information, including vote extensions. + */ + votes?: ExtendedVoteInfoAmino[]; +} +export interface ExtendedCommitInfoAminoMsg { + type: "/tendermint.abci.ExtendedCommitInfo"; + value: ExtendedCommitInfoAmino; +} +export interface ExtendedCommitInfoSDKType { + round: number; + votes: ExtendedVoteInfoSDKType[]; +} /** * Event allows application developers to attach additional information to * ResponseBeginBlock, ResponseEndBlock, ResponseCheckTx and ResponseDeliverTx. @@ -1137,8 +1241,8 @@ export interface EventProtoMsg { * Later, transactions may be queried using these events. */ export interface EventAmino { - type: string; - attributes: EventAttributeAmino[]; + type?: string; + attributes?: EventAttributeAmino[]; } export interface EventAminoMsg { type: "/tendermint.abci.Event"; @@ -1155,8 +1259,8 @@ export interface EventSDKType { } /** EventAttribute is a single key-value pair, associated with an event. */ export interface EventAttribute { - key: Uint8Array; - value: Uint8Array; + key: string; + value: string; /** nondeterministic */ index: boolean; } @@ -1166,10 +1270,10 @@ export interface EventAttributeProtoMsg { } /** EventAttribute is a single key-value pair, associated with an event. */ export interface EventAttributeAmino { - key: Uint8Array; - value: Uint8Array; + key?: string; + value?: string; /** nondeterministic */ - index: boolean; + index?: boolean; } export interface EventAttributeAminoMsg { type: "/tendermint.abci.EventAttribute"; @@ -1177,8 +1281,8 @@ export interface EventAttributeAminoMsg { } /** EventAttribute is a single key-value pair, associated with an event. */ export interface EventAttributeSDKType { - key: Uint8Array; - value: Uint8Array; + key: string; + value: string; index: boolean; } /** @@ -1202,9 +1306,9 @@ export interface TxResultProtoMsg { * One usage is indexing transaction results. */ export interface TxResultAmino { - height: string; - index: number; - tx: Uint8Array; + height?: string; + index?: number; + tx?: string; result?: ResponseDeliverTxAmino; } export interface TxResultAminoMsg { @@ -1242,9 +1346,9 @@ export interface ValidatorAmino { * The first 20 bytes of SHA256(public key) * PubKey pub_key = 2 [(gogoproto.nullable)=false]; */ - address: Uint8Array; + address?: string; /** The voting power */ - power: string; + power?: string; } export interface ValidatorAminoMsg { type: "/tendermint.abci.Validator"; @@ -1267,7 +1371,7 @@ export interface ValidatorUpdateProtoMsg { /** ValidatorUpdate */ export interface ValidatorUpdateAmino { pub_key?: PublicKeyAmino; - power: string; + power?: string; } export interface ValidatorUpdateAminoMsg { type: "/tendermint.abci.ValidatorUpdate"; @@ -1290,7 +1394,7 @@ export interface VoteInfoProtoMsg { /** VoteInfo */ export interface VoteInfoAmino { validator?: ValidatorAmino; - signed_last_block: boolean; + signed_last_block?: boolean; } export interface VoteInfoAminoMsg { type: "/tendermint.abci.VoteInfo"; @@ -1301,8 +1405,33 @@ export interface VoteInfoSDKType { validator: ValidatorSDKType; signed_last_block: boolean; } -export interface Evidence { - type: EvidenceType; +export interface ExtendedVoteInfo { + validator: Validator; + signedLastBlock: boolean; + /** Reserved for future use */ + voteExtension: Uint8Array; +} +export interface ExtendedVoteInfoProtoMsg { + typeUrl: "/tendermint.abci.ExtendedVoteInfo"; + value: Uint8Array; +} +export interface ExtendedVoteInfoAmino { + validator?: ValidatorAmino; + signed_last_block?: boolean; + /** Reserved for future use */ + vote_extension?: string; +} +export interface ExtendedVoteInfoAminoMsg { + type: "/tendermint.abci.ExtendedVoteInfo"; + value: ExtendedVoteInfoAmino; +} +export interface ExtendedVoteInfoSDKType { + validator: ValidatorSDKType; + signed_last_block: boolean; + vote_extension: Uint8Array; +} +export interface Misbehavior { + type: MisbehaviorType; /** The offending validator */ validator: Validator; /** The height when the offense occurred */ @@ -1316,31 +1445,31 @@ export interface Evidence { */ totalVotingPower: bigint; } -export interface EvidenceProtoMsg { - typeUrl: "/tendermint.abci.Evidence"; +export interface MisbehaviorProtoMsg { + typeUrl: "/tendermint.abci.Misbehavior"; value: Uint8Array; } -export interface EvidenceAmino { - type: EvidenceType; +export interface MisbehaviorAmino { + type?: MisbehaviorType; /** The offending validator */ validator?: ValidatorAmino; /** The height when the offense occurred */ - height: string; + height?: string; /** The corresponding time where the offense occurred */ - time?: Date; + time?: string; /** * Total voting power of the validator set in case the ABCI application does * not store historical validators. * https://github.com/tendermint/tendermint/issues/4581 */ - total_voting_power: string; + total_voting_power?: string; } -export interface EvidenceAminoMsg { - type: "/tendermint.abci.Evidence"; - value: EvidenceAmino; +export interface MisbehaviorAminoMsg { + type: "/tendermint.abci.Misbehavior"; + value: MisbehaviorAmino; } -export interface EvidenceSDKType { - type: EvidenceType; +export interface MisbehaviorSDKType { + type: MisbehaviorType; validator: ValidatorSDKType; height: bigint; time: Date; @@ -1364,15 +1493,15 @@ export interface SnapshotProtoMsg { } export interface SnapshotAmino { /** The height at which the snapshot was taken */ - height: string; + height?: string; /** 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?: string; /** Arbitrary application metadata */ - metadata: Uint8Array; + metadata?: string; } export interface SnapshotAminoMsg { type: "/tendermint.abci.Snapshot"; @@ -1390,7 +1519,6 @@ function createBaseRequest(): Request { echo: undefined, flush: undefined, info: undefined, - setOption: undefined, initChain: undefined, query: undefined, beginBlock: undefined, @@ -1401,7 +1529,9 @@ function createBaseRequest(): Request { listSnapshots: undefined, offerSnapshot: undefined, loadSnapshotChunk: undefined, - applySnapshotChunk: undefined + applySnapshotChunk: undefined, + prepareProposal: undefined, + processProposal: undefined }; } export const Request = { @@ -1416,9 +1546,6 @@ export const Request = { if (message.info !== undefined) { RequestInfo.encode(message.info, writer.uint32(26).fork()).ldelim(); } - if (message.setOption !== undefined) { - RequestSetOption.encode(message.setOption, writer.uint32(34).fork()).ldelim(); - } if (message.initChain !== undefined) { RequestInitChain.encode(message.initChain, writer.uint32(42).fork()).ldelim(); } @@ -1452,6 +1579,12 @@ export const Request = { if (message.applySnapshotChunk !== undefined) { RequestApplySnapshotChunk.encode(message.applySnapshotChunk, writer.uint32(122).fork()).ldelim(); } + if (message.prepareProposal !== undefined) { + RequestPrepareProposal.encode(message.prepareProposal, writer.uint32(130).fork()).ldelim(); + } + if (message.processProposal !== undefined) { + RequestProcessProposal.encode(message.processProposal, writer.uint32(138).fork()).ldelim(); + } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): Request { @@ -1470,9 +1603,6 @@ export const Request = { case 3: message.info = RequestInfo.decode(reader, reader.uint32()); break; - case 4: - message.setOption = RequestSetOption.decode(reader, reader.uint32()); - break; case 5: message.initChain = RequestInitChain.decode(reader, reader.uint32()); break; @@ -1506,6 +1636,12 @@ export const Request = { case 15: message.applySnapshotChunk = RequestApplySnapshotChunk.decode(reader, reader.uint32()); break; + case 16: + message.prepareProposal = RequestPrepareProposal.decode(reader, reader.uint32()); + break; + case 17: + message.processProposal = RequestProcessProposal.decode(reader, reader.uint32()); + break; default: reader.skipType(tag & 7); break; @@ -1518,7 +1654,6 @@ export const Request = { 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; @@ -1530,33 +1665,67 @@ export const Request = { 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; + message.prepareProposal = object.prepareProposal !== undefined && object.prepareProposal !== null ? RequestPrepareProposal.fromPartial(object.prepareProposal) : undefined; + message.processProposal = object.processProposal !== undefined && object.processProposal !== null ? RequestProcessProposal.fromPartial(object.processProposal) : undefined; return message; }, fromAmino(object: RequestAmino): Request { - return { - echo: object?.echo ? RequestEcho.fromAmino(object.echo) : undefined, - flush: object?.flush ? RequestFlush.fromAmino(object.flush) : undefined, - info: object?.info ? RequestInfo.fromAmino(object.info) : undefined, - setOption: object?.set_option ? RequestSetOption.fromAmino(object.set_option) : undefined, - initChain: object?.init_chain ? RequestInitChain.fromAmino(object.init_chain) : undefined, - query: object?.query ? RequestQuery.fromAmino(object.query) : undefined, - beginBlock: object?.begin_block ? RequestBeginBlock.fromAmino(object.begin_block) : undefined, - checkTx: object?.check_tx ? RequestCheckTx.fromAmino(object.check_tx) : undefined, - deliverTx: object?.deliver_tx ? RequestDeliverTx.fromAmino(object.deliver_tx) : undefined, - endBlock: object?.end_block ? RequestEndBlock.fromAmino(object.end_block) : undefined, - commit: object?.commit ? RequestCommit.fromAmino(object.commit) : undefined, - listSnapshots: object?.list_snapshots ? RequestListSnapshots.fromAmino(object.list_snapshots) : undefined, - offerSnapshot: object?.offer_snapshot ? RequestOfferSnapshot.fromAmino(object.offer_snapshot) : undefined, - loadSnapshotChunk: object?.load_snapshot_chunk ? RequestLoadSnapshotChunk.fromAmino(object.load_snapshot_chunk) : undefined, - applySnapshotChunk: object?.apply_snapshot_chunk ? RequestApplySnapshotChunk.fromAmino(object.apply_snapshot_chunk) : undefined - }; + const message = createBaseRequest(); + if (object.echo !== undefined && object.echo !== null) { + message.echo = RequestEcho.fromAmino(object.echo); + } + if (object.flush !== undefined && object.flush !== null) { + message.flush = RequestFlush.fromAmino(object.flush); + } + if (object.info !== undefined && object.info !== null) { + message.info = RequestInfo.fromAmino(object.info); + } + if (object.init_chain !== undefined && object.init_chain !== null) { + message.initChain = RequestInitChain.fromAmino(object.init_chain); + } + if (object.query !== undefined && object.query !== null) { + message.query = RequestQuery.fromAmino(object.query); + } + if (object.begin_block !== undefined && object.begin_block !== null) { + message.beginBlock = RequestBeginBlock.fromAmino(object.begin_block); + } + if (object.check_tx !== undefined && object.check_tx !== null) { + message.checkTx = RequestCheckTx.fromAmino(object.check_tx); + } + if (object.deliver_tx !== undefined && object.deliver_tx !== null) { + message.deliverTx = RequestDeliverTx.fromAmino(object.deliver_tx); + } + if (object.end_block !== undefined && object.end_block !== null) { + message.endBlock = RequestEndBlock.fromAmino(object.end_block); + } + if (object.commit !== undefined && object.commit !== null) { + message.commit = RequestCommit.fromAmino(object.commit); + } + if (object.list_snapshots !== undefined && object.list_snapshots !== null) { + message.listSnapshots = RequestListSnapshots.fromAmino(object.list_snapshots); + } + if (object.offer_snapshot !== undefined && object.offer_snapshot !== null) { + message.offerSnapshot = RequestOfferSnapshot.fromAmino(object.offer_snapshot); + } + if (object.load_snapshot_chunk !== undefined && object.load_snapshot_chunk !== null) { + message.loadSnapshotChunk = RequestLoadSnapshotChunk.fromAmino(object.load_snapshot_chunk); + } + if (object.apply_snapshot_chunk !== undefined && object.apply_snapshot_chunk !== null) { + message.applySnapshotChunk = RequestApplySnapshotChunk.fromAmino(object.apply_snapshot_chunk); + } + if (object.prepare_proposal !== undefined && object.prepare_proposal !== null) { + message.prepareProposal = RequestPrepareProposal.fromAmino(object.prepare_proposal); + } + if (object.process_proposal !== undefined && object.process_proposal !== null) { + message.processProposal = RequestProcessProposal.fromAmino(object.process_proposal); + } + return message; }, toAmino(message: Request): RequestAmino { const obj: any = {}; obj.echo = message.echo ? RequestEcho.toAmino(message.echo) : undefined; obj.flush = message.flush ? RequestFlush.toAmino(message.flush) : undefined; obj.info = message.info ? RequestInfo.toAmino(message.info) : undefined; - obj.set_option = message.setOption ? RequestSetOption.toAmino(message.setOption) : undefined; obj.init_chain = message.initChain ? RequestInitChain.toAmino(message.initChain) : undefined; obj.query = message.query ? RequestQuery.toAmino(message.query) : undefined; obj.begin_block = message.beginBlock ? RequestBeginBlock.toAmino(message.beginBlock) : undefined; @@ -1568,6 +1737,8 @@ export const Request = { obj.offer_snapshot = message.offerSnapshot ? RequestOfferSnapshot.toAmino(message.offerSnapshot) : undefined; obj.load_snapshot_chunk = message.loadSnapshotChunk ? RequestLoadSnapshotChunk.toAmino(message.loadSnapshotChunk) : undefined; obj.apply_snapshot_chunk = message.applySnapshotChunk ? RequestApplySnapshotChunk.toAmino(message.applySnapshotChunk) : undefined; + obj.prepare_proposal = message.prepareProposal ? RequestPrepareProposal.toAmino(message.prepareProposal) : undefined; + obj.process_proposal = message.processProposal ? RequestProcessProposal.toAmino(message.processProposal) : undefined; return obj; }, fromAminoMsg(object: RequestAminoMsg): Request { @@ -1622,9 +1793,11 @@ export const RequestEcho = { return message; }, fromAmino(object: RequestEchoAmino): RequestEcho { - return { - message: object.message - }; + const message = createBaseRequestEcho(); + if (object.message !== undefined && object.message !== null) { + message.message = object.message; + } + return message; }, toAmino(message: RequestEcho): RequestEchoAmino { const obj: any = {}; @@ -1674,7 +1847,8 @@ export const RequestFlush = { return message; }, fromAmino(_: RequestFlushAmino): RequestFlush { - return {}; + const message = createBaseRequestFlush(); + return message; }, toAmino(_: RequestFlush): RequestFlushAmino { const obj: any = {}; @@ -1700,7 +1874,8 @@ function createBaseRequestInfo(): RequestInfo { return { version: "", blockVersion: BigInt(0), - p2pVersion: BigInt(0) + p2pVersion: BigInt(0), + abciVersion: "" }; } export const RequestInfo = { @@ -1715,6 +1890,9 @@ export const RequestInfo = { if (message.p2pVersion !== BigInt(0)) { writer.uint32(24).uint64(message.p2pVersion); } + if (message.abciVersion !== "") { + writer.uint32(34).string(message.abciVersion); + } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): RequestInfo { @@ -1733,6 +1911,9 @@ export const RequestInfo = { case 3: message.p2pVersion = reader.uint64(); break; + case 4: + message.abciVersion = reader.string(); + break; default: reader.skipType(tag & 7); break; @@ -1745,20 +1926,31 @@ export const RequestInfo = { message.version = object.version ?? ""; message.blockVersion = object.blockVersion !== undefined && object.blockVersion !== null ? BigInt(object.blockVersion.toString()) : BigInt(0); message.p2pVersion = object.p2pVersion !== undefined && object.p2pVersion !== null ? BigInt(object.p2pVersion.toString()) : BigInt(0); + message.abciVersion = object.abciVersion ?? ""; return message; }, fromAmino(object: RequestInfoAmino): RequestInfo { - return { - version: object.version, - blockVersion: BigInt(object.block_version), - p2pVersion: BigInt(object.p2p_version) - }; + const message = createBaseRequestInfo(); + if (object.version !== undefined && object.version !== null) { + message.version = object.version; + } + if (object.block_version !== undefined && object.block_version !== null) { + message.blockVersion = BigInt(object.block_version); + } + if (object.p2p_version !== undefined && object.p2p_version !== null) { + message.p2pVersion = BigInt(object.p2p_version); + } + if (object.abci_version !== undefined && object.abci_version !== null) { + message.abciVersion = object.abci_version; + } + return message; }, toAmino(message: RequestInfo): RequestInfoAmino { const obj: any = {}; obj.version = message.version; obj.block_version = message.blockVersion ? message.blockVersion.toString() : undefined; obj.p2p_version = message.p2pVersion ? message.p2pVersion.toString() : undefined; + obj.abci_version = message.abciVersion; return obj; }, fromAminoMsg(object: RequestInfoAminoMsg): RequestInfo { @@ -1777,95 +1969,24 @@ export const RequestInfo = { }; } }; -function createBaseRequestSetOption(): RequestSetOption { +function createBaseRequestInitChain(): RequestInitChain { return { - key: "", - value: "" + time: new Date(), + chainId: "", + consensusParams: undefined, + validators: [], + appStateBytes: new Uint8Array(), + initialHeight: BigInt(0) }; } -export const RequestSetOption = { - typeUrl: "/tendermint.abci.RequestSetOption", - encode(message: RequestSetOption, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { - if (message.key !== "") { - writer.uint32(10).string(message.key); +export const RequestInitChain = { + typeUrl: "/tendermint.abci.RequestInitChain", + encode(message: RequestInitChain, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.time !== undefined) { + Timestamp.encode(toTimestamp(message.time), writer.uint32(10).fork()).ldelim(); } - if (message.value !== "") { - writer.uint32(18).string(message.value); - } - return writer; - }, - decode(input: BinaryReader | Uint8Array, length?: number): RequestSetOption { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseRequestSetOption(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.key = reader.string(); - break; - case 2: - message.value = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - fromPartial(object: Partial): RequestSetOption { - const message = createBaseRequestSetOption(); - message.key = object.key ?? ""; - message.value = object.value ?? ""; - return message; - }, - fromAmino(object: RequestSetOptionAmino): RequestSetOption { - return { - key: object.key, - value: object.value - }; - }, - toAmino(message: RequestSetOption): RequestSetOptionAmino { - const obj: any = {}; - obj.key = message.key; - obj.value = message.value; - return obj; - }, - fromAminoMsg(object: RequestSetOptionAminoMsg): RequestSetOption { - return RequestSetOption.fromAmino(object.value); - }, - fromProtoMsg(message: RequestSetOptionProtoMsg): RequestSetOption { - return RequestSetOption.decode(message.value); - }, - toProto(message: RequestSetOption): Uint8Array { - return RequestSetOption.encode(message).finish(); - }, - toProtoMsg(message: RequestSetOption): RequestSetOptionProtoMsg { - return { - typeUrl: "/tendermint.abci.RequestSetOption", - value: RequestSetOption.encode(message).finish() - }; - } -}; -function createBaseRequestInitChain(): RequestInitChain { - return { - time: new Date(), - chainId: "", - consensusParams: ConsensusParams.fromPartial({}), - validators: [], - appStateBytes: new Uint8Array(), - initialHeight: BigInt(0) - }; -} -export const RequestInitChain = { - typeUrl: "/tendermint.abci.RequestInitChain", - encode(message: RequestInitChain, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { - if (message.time !== undefined) { - Timestamp.encode(toTimestamp(message.time), writer.uint32(10).fork()).ldelim(); - } - if (message.chainId !== "") { - writer.uint32(18).string(message.chainId); + if (message.chainId !== "") { + writer.uint32(18).string(message.chainId); } if (message.consensusParams !== undefined) { ConsensusParams.encode(message.consensusParams, writer.uint32(26).fork()).ldelim(); @@ -1924,18 +2045,28 @@ export const RequestInitChain = { return message; }, fromAmino(object: RequestInitChainAmino): RequestInitChain { - return { - time: object.time, - chainId: object.chain_id, - consensusParams: object?.consensus_params ? ConsensusParams.fromAmino(object.consensus_params) : undefined, - validators: Array.isArray(object?.validators) ? object.validators.map((e: any) => ValidatorUpdate.fromAmino(e)) : [], - appStateBytes: object.app_state_bytes, - initialHeight: BigInt(object.initial_height) - }; + const message = createBaseRequestInitChain(); + if (object.time !== undefined && object.time !== null) { + message.time = fromTimestamp(Timestamp.fromAmino(object.time)); + } + if (object.chain_id !== undefined && object.chain_id !== null) { + message.chainId = object.chain_id; + } + if (object.consensus_params !== undefined && object.consensus_params !== null) { + message.consensusParams = ConsensusParams.fromAmino(object.consensus_params); + } + message.validators = object.validators?.map(e => ValidatorUpdate.fromAmino(e)) || []; + if (object.app_state_bytes !== undefined && object.app_state_bytes !== null) { + message.appStateBytes = bytesFromBase64(object.app_state_bytes); + } + if (object.initial_height !== undefined && object.initial_height !== null) { + message.initialHeight = BigInt(object.initial_height); + } + return message; }, toAmino(message: RequestInitChain): RequestInitChainAmino { const obj: any = {}; - obj.time = message.time; + obj.time = message.time ? Timestamp.toAmino(toTimestamp(message.time)) : undefined; obj.chain_id = message.chainId; obj.consensus_params = message.consensusParams ? ConsensusParams.toAmino(message.consensusParams) : undefined; if (message.validators) { @@ -1943,7 +2074,7 @@ export const RequestInitChain = { } else { obj.validators = []; } - obj.app_state_bytes = message.appStateBytes; + obj.app_state_bytes = message.appStateBytes ? base64FromBytes(message.appStateBytes) : undefined; obj.initial_height = message.initialHeight ? message.initialHeight.toString() : undefined; return obj; }, @@ -2023,16 +2154,24 @@ export const RequestQuery = { return message; }, fromAmino(object: RequestQueryAmino): RequestQuery { - return { - data: object.data, - path: object.path, - height: BigInt(object.height), - prove: object.prove - }; + const message = createBaseRequestQuery(); + if (object.data !== undefined && object.data !== null) { + message.data = bytesFromBase64(object.data); + } + if (object.path !== undefined && object.path !== null) { + message.path = object.path; + } + if (object.height !== undefined && object.height !== null) { + message.height = BigInt(object.height); + } + if (object.prove !== undefined && object.prove !== null) { + message.prove = object.prove; + } + return message; }, toAmino(message: RequestQuery): RequestQueryAmino { const obj: any = {}; - obj.data = message.data; + obj.data = message.data ? base64FromBytes(message.data) : undefined; obj.path = message.path; obj.height = message.height ? message.height.toString() : undefined; obj.prove = message.prove; @@ -2058,7 +2197,7 @@ function createBaseRequestBeginBlock(): RequestBeginBlock { return { hash: new Uint8Array(), header: Header.fromPartial({}), - lastCommitInfo: LastCommitInfo.fromPartial({}), + lastCommitInfo: CommitInfo.fromPartial({}), byzantineValidators: [] }; } @@ -2072,10 +2211,10 @@ export const RequestBeginBlock = { Header.encode(message.header, writer.uint32(18).fork()).ldelim(); } if (message.lastCommitInfo !== undefined) { - LastCommitInfo.encode(message.lastCommitInfo, writer.uint32(26).fork()).ldelim(); + CommitInfo.encode(message.lastCommitInfo, writer.uint32(26).fork()).ldelim(); } for (const v of message.byzantineValidators) { - Evidence.encode(v!, writer.uint32(34).fork()).ldelim(); + Misbehavior.encode(v!, writer.uint32(34).fork()).ldelim(); } return writer; }, @@ -2093,10 +2232,10 @@ export const RequestBeginBlock = { message.header = Header.decode(reader, reader.uint32()); break; case 3: - message.lastCommitInfo = LastCommitInfo.decode(reader, reader.uint32()); + message.lastCommitInfo = CommitInfo.decode(reader, reader.uint32()); break; case 4: - message.byzantineValidators.push(Evidence.decode(reader, reader.uint32())); + message.byzantineValidators.push(Misbehavior.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -2109,25 +2248,31 @@ export const 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)) || []; + message.lastCommitInfo = object.lastCommitInfo !== undefined && object.lastCommitInfo !== null ? CommitInfo.fromPartial(object.lastCommitInfo) : undefined; + message.byzantineValidators = object.byzantineValidators?.map(e => Misbehavior.fromPartial(e)) || []; return message; }, fromAmino(object: RequestBeginBlockAmino): RequestBeginBlock { - return { - hash: object.hash, - header: object?.header ? Header.fromAmino(object.header) : undefined, - lastCommitInfo: object?.last_commit_info ? LastCommitInfo.fromAmino(object.last_commit_info) : undefined, - byzantineValidators: Array.isArray(object?.byzantine_validators) ? object.byzantine_validators.map((e: any) => Evidence.fromAmino(e)) : [] - }; + const message = createBaseRequestBeginBlock(); + if (object.hash !== undefined && object.hash !== null) { + message.hash = bytesFromBase64(object.hash); + } + if (object.header !== undefined && object.header !== null) { + message.header = Header.fromAmino(object.header); + } + if (object.last_commit_info !== undefined && object.last_commit_info !== null) { + message.lastCommitInfo = CommitInfo.fromAmino(object.last_commit_info); + } + message.byzantineValidators = object.byzantine_validators?.map(e => Misbehavior.fromAmino(e)) || []; + return message; }, toAmino(message: RequestBeginBlock): RequestBeginBlockAmino { const obj: any = {}; - obj.hash = message.hash; + obj.hash = message.hash ? base64FromBytes(message.hash) : undefined; obj.header = message.header ? Header.toAmino(message.header) : undefined; - obj.last_commit_info = message.lastCommitInfo ? LastCommitInfo.toAmino(message.lastCommitInfo) : undefined; + obj.last_commit_info = message.lastCommitInfo ? CommitInfo.toAmino(message.lastCommitInfo) : undefined; if (message.byzantineValidators) { - obj.byzantine_validators = message.byzantineValidators.map(e => e ? Evidence.toAmino(e) : undefined); + obj.byzantine_validators = message.byzantineValidators.map(e => e ? Misbehavior.toAmino(e) : undefined); } else { obj.byzantine_validators = []; } @@ -2193,15 +2338,19 @@ export const RequestCheckTx = { return message; }, fromAmino(object: RequestCheckTxAmino): RequestCheckTx { - return { - tx: object.tx, - type: isSet(object.type) ? checkTxTypeFromJSON(object.type) : -1 - }; + const message = createBaseRequestCheckTx(); + if (object.tx !== undefined && object.tx !== null) { + message.tx = bytesFromBase64(object.tx); + } + if (object.type !== undefined && object.type !== null) { + message.type = checkTxTypeFromJSON(object.type); + } + return message; }, toAmino(message: RequestCheckTx): RequestCheckTxAmino { const obj: any = {}; - obj.tx = message.tx; - obj.type = message.type; + obj.tx = message.tx ? base64FromBytes(message.tx) : undefined; + obj.type = checkTxTypeToJSON(message.type); return obj; }, fromAminoMsg(object: RequestCheckTxAminoMsg): RequestCheckTx { @@ -2256,13 +2405,15 @@ export const RequestDeliverTx = { return message; }, fromAmino(object: RequestDeliverTxAmino): RequestDeliverTx { - return { - tx: object.tx - }; + const message = createBaseRequestDeliverTx(); + if (object.tx !== undefined && object.tx !== null) { + message.tx = bytesFromBase64(object.tx); + } + return message; }, toAmino(message: RequestDeliverTx): RequestDeliverTxAmino { const obj: any = {}; - obj.tx = message.tx; + obj.tx = message.tx ? base64FromBytes(message.tx) : undefined; return obj; }, fromAminoMsg(object: RequestDeliverTxAminoMsg): RequestDeliverTx { @@ -2317,9 +2468,11 @@ export const RequestEndBlock = { return message; }, fromAmino(object: RequestEndBlockAmino): RequestEndBlock { - return { - height: BigInt(object.height) - }; + const message = createBaseRequestEndBlock(); + if (object.height !== undefined && object.height !== null) { + message.height = BigInt(object.height); + } + return message; }, toAmino(message: RequestEndBlock): RequestEndBlockAmino { const obj: any = {}; @@ -2369,7 +2522,8 @@ export const RequestCommit = { return message; }, fromAmino(_: RequestCommitAmino): RequestCommit { - return {}; + const message = createBaseRequestCommit(); + return message; }, toAmino(_: RequestCommit): RequestCommitAmino { const obj: any = {}; @@ -2418,7 +2572,8 @@ export const RequestListSnapshots = { return message; }, fromAmino(_: RequestListSnapshotsAmino): RequestListSnapshots { - return {}; + const message = createBaseRequestListSnapshots(); + return message; }, toAmino(_: RequestListSnapshots): RequestListSnapshotsAmino { const obj: any = {}; @@ -2442,7 +2597,7 @@ export const RequestListSnapshots = { }; function createBaseRequestOfferSnapshot(): RequestOfferSnapshot { return { - snapshot: Snapshot.fromPartial({}), + snapshot: undefined, appHash: new Uint8Array() }; } @@ -2484,15 +2639,19 @@ export const RequestOfferSnapshot = { return message; }, fromAmino(object: RequestOfferSnapshotAmino): RequestOfferSnapshot { - return { - snapshot: object?.snapshot ? Snapshot.fromAmino(object.snapshot) : undefined, - appHash: object.app_hash - }; + const message = createBaseRequestOfferSnapshot(); + if (object.snapshot !== undefined && object.snapshot !== null) { + message.snapshot = Snapshot.fromAmino(object.snapshot); + } + if (object.app_hash !== undefined && object.app_hash !== null) { + message.appHash = bytesFromBase64(object.app_hash); + } + return message; }, toAmino(message: RequestOfferSnapshot): RequestOfferSnapshotAmino { const obj: any = {}; obj.snapshot = message.snapshot ? Snapshot.toAmino(message.snapshot) : undefined; - obj.app_hash = message.appHash; + obj.app_hash = message.appHash ? base64FromBytes(message.appHash) : undefined; return obj; }, fromAminoMsg(object: RequestOfferSnapshotAminoMsg): RequestOfferSnapshot { @@ -2563,11 +2722,17 @@ export const RequestLoadSnapshotChunk = { return message; }, fromAmino(object: RequestLoadSnapshotChunkAmino): RequestLoadSnapshotChunk { - return { - height: BigInt(object.height), - format: object.format, - chunk: object.chunk - }; + const message = createBaseRequestLoadSnapshotChunk(); + if (object.height !== undefined && object.height !== null) { + message.height = BigInt(object.height); + } + if (object.format !== undefined && object.format !== null) { + message.format = object.format; + } + if (object.chunk !== undefined && object.chunk !== null) { + message.chunk = object.chunk; + } + return message; }, toAmino(message: RequestLoadSnapshotChunk): RequestLoadSnapshotChunkAmino { const obj: any = {}; @@ -2644,16 +2809,22 @@ export const RequestApplySnapshotChunk = { return message; }, fromAmino(object: RequestApplySnapshotChunkAmino): RequestApplySnapshotChunk { - return { - index: object.index, - chunk: object.chunk, - sender: object.sender - }; + const message = createBaseRequestApplySnapshotChunk(); + if (object.index !== undefined && object.index !== null) { + message.index = object.index; + } + if (object.chunk !== undefined && object.chunk !== null) { + message.chunk = bytesFromBase64(object.chunk); + } + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + return message; }, toAmino(message: RequestApplySnapshotChunk): RequestApplySnapshotChunkAmino { const obj: any = {}; obj.index = message.index; - obj.chunk = message.chunk; + obj.chunk = message.chunk ? base64FromBytes(message.chunk) : undefined; obj.sender = message.sender; return obj; }, @@ -2673,13 +2844,314 @@ export const RequestApplySnapshotChunk = { }; } }; +function createBaseRequestPrepareProposal(): RequestPrepareProposal { + return { + maxTxBytes: BigInt(0), + txs: [], + localLastCommit: ExtendedCommitInfo.fromPartial({}), + misbehavior: [], + height: BigInt(0), + time: new Date(), + nextValidatorsHash: new Uint8Array(), + proposerAddress: new Uint8Array() + }; +} +export const RequestPrepareProposal = { + typeUrl: "/tendermint.abci.RequestPrepareProposal", + encode(message: RequestPrepareProposal, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.maxTxBytes !== BigInt(0)) { + writer.uint32(8).int64(message.maxTxBytes); + } + for (const v of message.txs) { + writer.uint32(18).bytes(v!); + } + if (message.localLastCommit !== undefined) { + ExtendedCommitInfo.encode(message.localLastCommit, writer.uint32(26).fork()).ldelim(); + } + for (const v of message.misbehavior) { + Misbehavior.encode(v!, writer.uint32(34).fork()).ldelim(); + } + if (message.height !== BigInt(0)) { + writer.uint32(40).int64(message.height); + } + if (message.time !== undefined) { + Timestamp.encode(toTimestamp(message.time), writer.uint32(50).fork()).ldelim(); + } + if (message.nextValidatorsHash.length !== 0) { + writer.uint32(58).bytes(message.nextValidatorsHash); + } + if (message.proposerAddress.length !== 0) { + writer.uint32(66).bytes(message.proposerAddress); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): RequestPrepareProposal { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseRequestPrepareProposal(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.maxTxBytes = reader.int64(); + break; + case 2: + message.txs.push(reader.bytes()); + break; + case 3: + message.localLastCommit = ExtendedCommitInfo.decode(reader, reader.uint32()); + break; + case 4: + message.misbehavior.push(Misbehavior.decode(reader, reader.uint32())); + break; + case 5: + message.height = reader.int64(); + break; + case 6: + message.time = fromTimestamp(Timestamp.decode(reader, reader.uint32())); + break; + case 7: + message.nextValidatorsHash = reader.bytes(); + break; + case 8: + message.proposerAddress = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): RequestPrepareProposal { + const message = createBaseRequestPrepareProposal(); + message.maxTxBytes = object.maxTxBytes !== undefined && object.maxTxBytes !== null ? BigInt(object.maxTxBytes.toString()) : BigInt(0); + message.txs = object.txs?.map(e => e) || []; + message.localLastCommit = object.localLastCommit !== undefined && object.localLastCommit !== null ? ExtendedCommitInfo.fromPartial(object.localLastCommit) : undefined; + message.misbehavior = object.misbehavior?.map(e => Misbehavior.fromPartial(e)) || []; + message.height = object.height !== undefined && object.height !== null ? BigInt(object.height.toString()) : BigInt(0); + message.time = object.time ?? undefined; + message.nextValidatorsHash = object.nextValidatorsHash ?? new Uint8Array(); + message.proposerAddress = object.proposerAddress ?? new Uint8Array(); + return message; + }, + fromAmino(object: RequestPrepareProposalAmino): RequestPrepareProposal { + const message = createBaseRequestPrepareProposal(); + if (object.max_tx_bytes !== undefined && object.max_tx_bytes !== null) { + message.maxTxBytes = BigInt(object.max_tx_bytes); + } + message.txs = object.txs?.map(e => bytesFromBase64(e)) || []; + if (object.local_last_commit !== undefined && object.local_last_commit !== null) { + message.localLastCommit = ExtendedCommitInfo.fromAmino(object.local_last_commit); + } + message.misbehavior = object.misbehavior?.map(e => Misbehavior.fromAmino(e)) || []; + if (object.height !== undefined && object.height !== null) { + message.height = BigInt(object.height); + } + if (object.time !== undefined && object.time !== null) { + message.time = fromTimestamp(Timestamp.fromAmino(object.time)); + } + if (object.next_validators_hash !== undefined && object.next_validators_hash !== null) { + message.nextValidatorsHash = bytesFromBase64(object.next_validators_hash); + } + if (object.proposer_address !== undefined && object.proposer_address !== null) { + message.proposerAddress = bytesFromBase64(object.proposer_address); + } + return message; + }, + toAmino(message: RequestPrepareProposal): RequestPrepareProposalAmino { + const obj: any = {}; + obj.max_tx_bytes = message.maxTxBytes ? message.maxTxBytes.toString() : undefined; + if (message.txs) { + obj.txs = message.txs.map(e => base64FromBytes(e)); + } else { + obj.txs = []; + } + obj.local_last_commit = message.localLastCommit ? ExtendedCommitInfo.toAmino(message.localLastCommit) : undefined; + if (message.misbehavior) { + obj.misbehavior = message.misbehavior.map(e => e ? Misbehavior.toAmino(e) : undefined); + } else { + obj.misbehavior = []; + } + obj.height = message.height ? message.height.toString() : undefined; + obj.time = message.time ? Timestamp.toAmino(toTimestamp(message.time)) : undefined; + obj.next_validators_hash = message.nextValidatorsHash ? base64FromBytes(message.nextValidatorsHash) : undefined; + obj.proposer_address = message.proposerAddress ? base64FromBytes(message.proposerAddress) : undefined; + return obj; + }, + fromAminoMsg(object: RequestPrepareProposalAminoMsg): RequestPrepareProposal { + return RequestPrepareProposal.fromAmino(object.value); + }, + fromProtoMsg(message: RequestPrepareProposalProtoMsg): RequestPrepareProposal { + return RequestPrepareProposal.decode(message.value); + }, + toProto(message: RequestPrepareProposal): Uint8Array { + return RequestPrepareProposal.encode(message).finish(); + }, + toProtoMsg(message: RequestPrepareProposal): RequestPrepareProposalProtoMsg { + return { + typeUrl: "/tendermint.abci.RequestPrepareProposal", + value: RequestPrepareProposal.encode(message).finish() + }; + } +}; +function createBaseRequestProcessProposal(): RequestProcessProposal { + return { + txs: [], + proposedLastCommit: CommitInfo.fromPartial({}), + misbehavior: [], + hash: new Uint8Array(), + height: BigInt(0), + time: new Date(), + nextValidatorsHash: new Uint8Array(), + proposerAddress: new Uint8Array() + }; +} +export const RequestProcessProposal = { + typeUrl: "/tendermint.abci.RequestProcessProposal", + encode(message: RequestProcessProposal, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.txs) { + writer.uint32(10).bytes(v!); + } + if (message.proposedLastCommit !== undefined) { + CommitInfo.encode(message.proposedLastCommit, writer.uint32(18).fork()).ldelim(); + } + for (const v of message.misbehavior) { + Misbehavior.encode(v!, writer.uint32(26).fork()).ldelim(); + } + if (message.hash.length !== 0) { + writer.uint32(34).bytes(message.hash); + } + if (message.height !== BigInt(0)) { + writer.uint32(40).int64(message.height); + } + if (message.time !== undefined) { + Timestamp.encode(toTimestamp(message.time), writer.uint32(50).fork()).ldelim(); + } + if (message.nextValidatorsHash.length !== 0) { + writer.uint32(58).bytes(message.nextValidatorsHash); + } + if (message.proposerAddress.length !== 0) { + writer.uint32(66).bytes(message.proposerAddress); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): RequestProcessProposal { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseRequestProcessProposal(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.txs.push(reader.bytes()); + break; + case 2: + message.proposedLastCommit = CommitInfo.decode(reader, reader.uint32()); + break; + case 3: + message.misbehavior.push(Misbehavior.decode(reader, reader.uint32())); + break; + case 4: + message.hash = reader.bytes(); + break; + case 5: + message.height = reader.int64(); + break; + case 6: + message.time = fromTimestamp(Timestamp.decode(reader, reader.uint32())); + break; + case 7: + message.nextValidatorsHash = reader.bytes(); + break; + case 8: + message.proposerAddress = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): RequestProcessProposal { + const message = createBaseRequestProcessProposal(); + message.txs = object.txs?.map(e => e) || []; + message.proposedLastCommit = object.proposedLastCommit !== undefined && object.proposedLastCommit !== null ? CommitInfo.fromPartial(object.proposedLastCommit) : undefined; + message.misbehavior = object.misbehavior?.map(e => Misbehavior.fromPartial(e)) || []; + message.hash = object.hash ?? new Uint8Array(); + message.height = object.height !== undefined && object.height !== null ? BigInt(object.height.toString()) : BigInt(0); + message.time = object.time ?? undefined; + message.nextValidatorsHash = object.nextValidatorsHash ?? new Uint8Array(); + message.proposerAddress = object.proposerAddress ?? new Uint8Array(); + return message; + }, + fromAmino(object: RequestProcessProposalAmino): RequestProcessProposal { + const message = createBaseRequestProcessProposal(); + message.txs = object.txs?.map(e => bytesFromBase64(e)) || []; + if (object.proposed_last_commit !== undefined && object.proposed_last_commit !== null) { + message.proposedLastCommit = CommitInfo.fromAmino(object.proposed_last_commit); + } + message.misbehavior = object.misbehavior?.map(e => Misbehavior.fromAmino(e)) || []; + if (object.hash !== undefined && object.hash !== null) { + message.hash = bytesFromBase64(object.hash); + } + if (object.height !== undefined && object.height !== null) { + message.height = BigInt(object.height); + } + if (object.time !== undefined && object.time !== null) { + message.time = fromTimestamp(Timestamp.fromAmino(object.time)); + } + if (object.next_validators_hash !== undefined && object.next_validators_hash !== null) { + message.nextValidatorsHash = bytesFromBase64(object.next_validators_hash); + } + if (object.proposer_address !== undefined && object.proposer_address !== null) { + message.proposerAddress = bytesFromBase64(object.proposer_address); + } + return message; + }, + toAmino(message: RequestProcessProposal): RequestProcessProposalAmino { + const obj: any = {}; + if (message.txs) { + obj.txs = message.txs.map(e => base64FromBytes(e)); + } else { + obj.txs = []; + } + obj.proposed_last_commit = message.proposedLastCommit ? CommitInfo.toAmino(message.proposedLastCommit) : undefined; + if (message.misbehavior) { + obj.misbehavior = message.misbehavior.map(e => e ? Misbehavior.toAmino(e) : undefined); + } else { + obj.misbehavior = []; + } + obj.hash = message.hash ? base64FromBytes(message.hash) : undefined; + obj.height = message.height ? message.height.toString() : undefined; + obj.time = message.time ? Timestamp.toAmino(toTimestamp(message.time)) : undefined; + obj.next_validators_hash = message.nextValidatorsHash ? base64FromBytes(message.nextValidatorsHash) : undefined; + obj.proposer_address = message.proposerAddress ? base64FromBytes(message.proposerAddress) : undefined; + return obj; + }, + fromAminoMsg(object: RequestProcessProposalAminoMsg): RequestProcessProposal { + return RequestProcessProposal.fromAmino(object.value); + }, + fromProtoMsg(message: RequestProcessProposalProtoMsg): RequestProcessProposal { + return RequestProcessProposal.decode(message.value); + }, + toProto(message: RequestProcessProposal): Uint8Array { + return RequestProcessProposal.encode(message).finish(); + }, + toProtoMsg(message: RequestProcessProposal): RequestProcessProposalProtoMsg { + return { + typeUrl: "/tendermint.abci.RequestProcessProposal", + value: RequestProcessProposal.encode(message).finish() + }; + } +}; function createBaseResponse(): Response { return { exception: undefined, echo: undefined, flush: undefined, info: undefined, - setOption: undefined, initChain: undefined, query: undefined, beginBlock: undefined, @@ -2690,7 +3162,9 @@ function createBaseResponse(): Response { listSnapshots: undefined, offerSnapshot: undefined, loadSnapshotChunk: undefined, - applySnapshotChunk: undefined + applySnapshotChunk: undefined, + prepareProposal: undefined, + processProposal: undefined }; } export const Response = { @@ -2708,9 +3182,6 @@ export const Response = { if (message.info !== undefined) { ResponseInfo.encode(message.info, writer.uint32(34).fork()).ldelim(); } - if (message.setOption !== undefined) { - ResponseSetOption.encode(message.setOption, writer.uint32(42).fork()).ldelim(); - } if (message.initChain !== undefined) { ResponseInitChain.encode(message.initChain, writer.uint32(50).fork()).ldelim(); } @@ -2744,6 +3215,12 @@ export const Response = { if (message.applySnapshotChunk !== undefined) { ResponseApplySnapshotChunk.encode(message.applySnapshotChunk, writer.uint32(130).fork()).ldelim(); } + if (message.prepareProposal !== undefined) { + ResponsePrepareProposal.encode(message.prepareProposal, writer.uint32(138).fork()).ldelim(); + } + if (message.processProposal !== undefined) { + ResponseProcessProposal.encode(message.processProposal, writer.uint32(146).fork()).ldelim(); + } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): Response { @@ -2765,9 +3242,6 @@ export const Response = { case 4: message.info = ResponseInfo.decode(reader, reader.uint32()); break; - case 5: - message.setOption = ResponseSetOption.decode(reader, reader.uint32()); - break; case 6: message.initChain = ResponseInitChain.decode(reader, reader.uint32()); break; @@ -2801,6 +3275,12 @@ export const Response = { case 16: message.applySnapshotChunk = ResponseApplySnapshotChunk.decode(reader, reader.uint32()); break; + case 17: + message.prepareProposal = ResponsePrepareProposal.decode(reader, reader.uint32()); + break; + case 18: + message.processProposal = ResponseProcessProposal.decode(reader, reader.uint32()); + break; default: reader.skipType(tag & 7); break; @@ -2814,7 +3294,6 @@ export const Response = { 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; @@ -2826,27 +3305,64 @@ export const Response = { 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; + message.prepareProposal = object.prepareProposal !== undefined && object.prepareProposal !== null ? ResponsePrepareProposal.fromPartial(object.prepareProposal) : undefined; + message.processProposal = object.processProposal !== undefined && object.processProposal !== null ? ResponseProcessProposal.fromPartial(object.processProposal) : undefined; return message; }, fromAmino(object: ResponseAmino): Response { - return { - exception: object?.exception ? ResponseException.fromAmino(object.exception) : undefined, - echo: object?.echo ? ResponseEcho.fromAmino(object.echo) : undefined, - flush: object?.flush ? ResponseFlush.fromAmino(object.flush) : undefined, - info: object?.info ? ResponseInfo.fromAmino(object.info) : undefined, - setOption: object?.set_option ? ResponseSetOption.fromAmino(object.set_option) : undefined, - initChain: object?.init_chain ? ResponseInitChain.fromAmino(object.init_chain) : undefined, - query: object?.query ? ResponseQuery.fromAmino(object.query) : undefined, - beginBlock: object?.begin_block ? ResponseBeginBlock.fromAmino(object.begin_block) : undefined, - checkTx: object?.check_tx ? ResponseCheckTx.fromAmino(object.check_tx) : undefined, - deliverTx: object?.deliver_tx ? ResponseDeliverTx.fromAmino(object.deliver_tx) : undefined, - endBlock: object?.end_block ? ResponseEndBlock.fromAmino(object.end_block) : undefined, - commit: object?.commit ? ResponseCommit.fromAmino(object.commit) : undefined, - listSnapshots: object?.list_snapshots ? ResponseListSnapshots.fromAmino(object.list_snapshots) : undefined, - offerSnapshot: object?.offer_snapshot ? ResponseOfferSnapshot.fromAmino(object.offer_snapshot) : undefined, - loadSnapshotChunk: object?.load_snapshot_chunk ? ResponseLoadSnapshotChunk.fromAmino(object.load_snapshot_chunk) : undefined, - applySnapshotChunk: object?.apply_snapshot_chunk ? ResponseApplySnapshotChunk.fromAmino(object.apply_snapshot_chunk) : undefined - }; + const message = createBaseResponse(); + if (object.exception !== undefined && object.exception !== null) { + message.exception = ResponseException.fromAmino(object.exception); + } + if (object.echo !== undefined && object.echo !== null) { + message.echo = ResponseEcho.fromAmino(object.echo); + } + if (object.flush !== undefined && object.flush !== null) { + message.flush = ResponseFlush.fromAmino(object.flush); + } + if (object.info !== undefined && object.info !== null) { + message.info = ResponseInfo.fromAmino(object.info); + } + if (object.init_chain !== undefined && object.init_chain !== null) { + message.initChain = ResponseInitChain.fromAmino(object.init_chain); + } + if (object.query !== undefined && object.query !== null) { + message.query = ResponseQuery.fromAmino(object.query); + } + if (object.begin_block !== undefined && object.begin_block !== null) { + message.beginBlock = ResponseBeginBlock.fromAmino(object.begin_block); + } + if (object.check_tx !== undefined && object.check_tx !== null) { + message.checkTx = ResponseCheckTx.fromAmino(object.check_tx); + } + if (object.deliver_tx !== undefined && object.deliver_tx !== null) { + message.deliverTx = ResponseDeliverTx.fromAmino(object.deliver_tx); + } + if (object.end_block !== undefined && object.end_block !== null) { + message.endBlock = ResponseEndBlock.fromAmino(object.end_block); + } + if (object.commit !== undefined && object.commit !== null) { + message.commit = ResponseCommit.fromAmino(object.commit); + } + if (object.list_snapshots !== undefined && object.list_snapshots !== null) { + message.listSnapshots = ResponseListSnapshots.fromAmino(object.list_snapshots); + } + if (object.offer_snapshot !== undefined && object.offer_snapshot !== null) { + message.offerSnapshot = ResponseOfferSnapshot.fromAmino(object.offer_snapshot); + } + if (object.load_snapshot_chunk !== undefined && object.load_snapshot_chunk !== null) { + message.loadSnapshotChunk = ResponseLoadSnapshotChunk.fromAmino(object.load_snapshot_chunk); + } + if (object.apply_snapshot_chunk !== undefined && object.apply_snapshot_chunk !== null) { + message.applySnapshotChunk = ResponseApplySnapshotChunk.fromAmino(object.apply_snapshot_chunk); + } + if (object.prepare_proposal !== undefined && object.prepare_proposal !== null) { + message.prepareProposal = ResponsePrepareProposal.fromAmino(object.prepare_proposal); + } + if (object.process_proposal !== undefined && object.process_proposal !== null) { + message.processProposal = ResponseProcessProposal.fromAmino(object.process_proposal); + } + return message; }, toAmino(message: Response): ResponseAmino { const obj: any = {}; @@ -2854,7 +3370,6 @@ export const Response = { obj.echo = message.echo ? ResponseEcho.toAmino(message.echo) : undefined; obj.flush = message.flush ? ResponseFlush.toAmino(message.flush) : undefined; obj.info = message.info ? ResponseInfo.toAmino(message.info) : undefined; - obj.set_option = message.setOption ? ResponseSetOption.toAmino(message.setOption) : undefined; obj.init_chain = message.initChain ? ResponseInitChain.toAmino(message.initChain) : undefined; obj.query = message.query ? ResponseQuery.toAmino(message.query) : undefined; obj.begin_block = message.beginBlock ? ResponseBeginBlock.toAmino(message.beginBlock) : undefined; @@ -2866,6 +3381,8 @@ export const Response = { obj.offer_snapshot = message.offerSnapshot ? ResponseOfferSnapshot.toAmino(message.offerSnapshot) : undefined; obj.load_snapshot_chunk = message.loadSnapshotChunk ? ResponseLoadSnapshotChunk.toAmino(message.loadSnapshotChunk) : undefined; obj.apply_snapshot_chunk = message.applySnapshotChunk ? ResponseApplySnapshotChunk.toAmino(message.applySnapshotChunk) : undefined; + obj.prepare_proposal = message.prepareProposal ? ResponsePrepareProposal.toAmino(message.prepareProposal) : undefined; + obj.process_proposal = message.processProposal ? ResponseProcessProposal.toAmino(message.processProposal) : undefined; return obj; }, fromAminoMsg(object: ResponseAminoMsg): Response { @@ -2920,9 +3437,11 @@ export const ResponseException = { return message; }, fromAmino(object: ResponseExceptionAmino): ResponseException { - return { - error: object.error - }; + const message = createBaseResponseException(); + if (object.error !== undefined && object.error !== null) { + message.error = object.error; + } + return message; }, toAmino(message: ResponseException): ResponseExceptionAmino { const obj: any = {}; @@ -2981,9 +3500,11 @@ export const ResponseEcho = { return message; }, fromAmino(object: ResponseEchoAmino): ResponseEcho { - return { - message: object.message - }; + const message = createBaseResponseEcho(); + if (object.message !== undefined && object.message !== null) { + message.message = object.message; + } + return message; }, toAmino(message: ResponseEcho): ResponseEchoAmino { const obj: any = {}; @@ -3033,7 +3554,8 @@ export const ResponseFlush = { return message; }, fromAmino(_: ResponseFlushAmino): ResponseFlush { - return {}; + const message = createBaseResponseFlush(); + return message; }, toAmino(_: ResponseFlush): ResponseFlushAmino { const obj: any = {}; @@ -3123,13 +3645,23 @@ export const ResponseInfo = { return message; }, fromAmino(object: ResponseInfoAmino): ResponseInfo { - return { - data: object.data, - version: object.version, - appVersion: BigInt(object.app_version), - lastBlockHeight: BigInt(object.last_block_height), - lastBlockAppHash: object.last_block_app_hash - }; + const message = createBaseResponseInfo(); + if (object.data !== undefined && object.data !== null) { + message.data = object.data; + } + if (object.version !== undefined && object.version !== null) { + message.version = object.version; + } + if (object.app_version !== undefined && object.app_version !== null) { + message.appVersion = BigInt(object.app_version); + } + if (object.last_block_height !== undefined && object.last_block_height !== null) { + message.lastBlockHeight = BigInt(object.last_block_height); + } + if (object.last_block_app_hash !== undefined && object.last_block_app_hash !== null) { + message.lastBlockAppHash = bytesFromBase64(object.last_block_app_hash); + } + return message; }, toAmino(message: ResponseInfo): ResponseInfoAmino { const obj: any = {}; @@ -3137,7 +3669,7 @@ export const ResponseInfo = { obj.version = message.version; obj.app_version = message.appVersion ? message.appVersion.toString() : undefined; obj.last_block_height = message.lastBlockHeight ? message.lastBlockHeight.toString() : undefined; - obj.last_block_app_hash = message.lastBlockAppHash; + obj.last_block_app_hash = message.lastBlockAppHash ? base64FromBytes(message.lastBlockAppHash) : undefined; return obj; }, fromAminoMsg(object: ResponseInfoAminoMsg): ResponseInfo { @@ -3156,90 +3688,9 @@ export const ResponseInfo = { }; } }; -function createBaseResponseSetOption(): ResponseSetOption { - return { - code: 0, - log: "", - info: "" - }; -} -export const ResponseSetOption = { - typeUrl: "/tendermint.abci.ResponseSetOption", - encode(message: ResponseSetOption, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { - if (message.code !== 0) { - writer.uint32(8).uint32(message.code); - } - if (message.log !== "") { - writer.uint32(26).string(message.log); - } - if (message.info !== "") { - writer.uint32(34).string(message.info); - } - return writer; - }, - decode(input: BinaryReader | Uint8Array, length?: number): ResponseSetOption { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseResponseSetOption(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.code = reader.uint32(); - break; - case 3: - message.log = reader.string(); - break; - case 4: - message.info = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - fromPartial(object: Partial): ResponseSetOption { - const message = createBaseResponseSetOption(); - message.code = object.code ?? 0; - message.log = object.log ?? ""; - message.info = object.info ?? ""; - return message; - }, - fromAmino(object: ResponseSetOptionAmino): ResponseSetOption { - return { - code: object.code, - log: object.log, - info: object.info - }; - }, - toAmino(message: ResponseSetOption): ResponseSetOptionAmino { - const obj: any = {}; - obj.code = message.code; - obj.log = message.log; - obj.info = message.info; - return obj; - }, - fromAminoMsg(object: ResponseSetOptionAminoMsg): ResponseSetOption { - return ResponseSetOption.fromAmino(object.value); - }, - fromProtoMsg(message: ResponseSetOptionProtoMsg): ResponseSetOption { - return ResponseSetOption.decode(message.value); - }, - toProto(message: ResponseSetOption): Uint8Array { - return ResponseSetOption.encode(message).finish(); - }, - toProtoMsg(message: ResponseSetOption): ResponseSetOptionProtoMsg { - return { - typeUrl: "/tendermint.abci.ResponseSetOption", - value: ResponseSetOption.encode(message).finish() - }; - } -}; function createBaseResponseInitChain(): ResponseInitChain { return { - consensusParams: ConsensusParams.fromPartial({}), + consensusParams: undefined, validators: [], appHash: new Uint8Array() }; @@ -3289,11 +3740,15 @@ export const ResponseInitChain = { return message; }, fromAmino(object: ResponseInitChainAmino): ResponseInitChain { - return { - consensusParams: object?.consensus_params ? ConsensusParams.fromAmino(object.consensus_params) : undefined, - validators: Array.isArray(object?.validators) ? object.validators.map((e: any) => ValidatorUpdate.fromAmino(e)) : [], - appHash: object.app_hash - }; + const message = createBaseResponseInitChain(); + if (object.consensus_params !== undefined && object.consensus_params !== null) { + message.consensusParams = ConsensusParams.fromAmino(object.consensus_params); + } + message.validators = object.validators?.map(e => ValidatorUpdate.fromAmino(e)) || []; + if (object.app_hash !== undefined && object.app_hash !== null) { + message.appHash = bytesFromBase64(object.app_hash); + } + return message; }, toAmino(message: ResponseInitChain): ResponseInitChainAmino { const obj: any = {}; @@ -3303,7 +3758,7 @@ export const ResponseInitChain = { } else { obj.validators = []; } - obj.app_hash = message.appHash; + obj.app_hash = message.appHash ? base64FromBytes(message.appHash) : undefined; return obj; }, fromAminoMsg(object: ResponseInitChainAminoMsg): ResponseInitChain { @@ -3330,7 +3785,7 @@ function createBaseResponseQuery(): ResponseQuery { index: BigInt(0), key: new Uint8Array(), value: new Uint8Array(), - proofOps: ProofOps.fromPartial({}), + proofOps: undefined, height: BigInt(0), codespace: "" }; @@ -3422,17 +3877,35 @@ export const ResponseQuery = { return message; }, fromAmino(object: ResponseQueryAmino): ResponseQuery { - return { - code: object.code, - log: object.log, - info: object.info, - index: BigInt(object.index), - key: object.key, - value: object.value, - proofOps: object?.proof_ops ? ProofOps.fromAmino(object.proof_ops) : undefined, - height: BigInt(object.height), - codespace: object.codespace - }; + const message = createBaseResponseQuery(); + if (object.code !== undefined && object.code !== null) { + message.code = object.code; + } + if (object.log !== undefined && object.log !== null) { + message.log = object.log; + } + if (object.info !== undefined && object.info !== null) { + message.info = object.info; + } + if (object.index !== undefined && object.index !== null) { + message.index = BigInt(object.index); + } + if (object.key !== undefined && object.key !== null) { + message.key = bytesFromBase64(object.key); + } + if (object.value !== undefined && object.value !== null) { + message.value = bytesFromBase64(object.value); + } + if (object.proof_ops !== undefined && object.proof_ops !== null) { + message.proofOps = ProofOps.fromAmino(object.proof_ops); + } + if (object.height !== undefined && object.height !== null) { + message.height = BigInt(object.height); + } + if (object.codespace !== undefined && object.codespace !== null) { + message.codespace = object.codespace; + } + return message; }, toAmino(message: ResponseQuery): ResponseQueryAmino { const obj: any = {}; @@ -3440,8 +3913,8 @@ export const ResponseQuery = { obj.log = message.log; obj.info = message.info; obj.index = message.index ? message.index.toString() : undefined; - obj.key = message.key; - obj.value = message.value; + obj.key = message.key ? base64FromBytes(message.key) : undefined; + obj.value = message.value ? base64FromBytes(message.value) : undefined; obj.proof_ops = message.proofOps ? ProofOps.toAmino(message.proofOps) : undefined; obj.height = message.height ? message.height.toString() : undefined; obj.codespace = message.codespace; @@ -3499,9 +3972,9 @@ export const ResponseBeginBlock = { return message; }, fromAmino(object: ResponseBeginBlockAmino): ResponseBeginBlock { - return { - events: Array.isArray(object?.events) ? object.events.map((e: any) => Event.fromAmino(e)) : [] - }; + const message = createBaseResponseBeginBlock(); + message.events = object.events?.map(e => Event.fromAmino(e)) || []; + return message; }, toAmino(message: ResponseBeginBlock): ResponseBeginBlockAmino { const obj: any = {}; @@ -3537,7 +4010,10 @@ function createBaseResponseCheckTx(): ResponseCheckTx { gasWanted: BigInt(0), gasUsed: BigInt(0), events: [], - codespace: "" + codespace: "", + sender: "", + priority: BigInt(0), + mempoolError: "" }; } export const ResponseCheckTx = { @@ -3567,6 +4043,15 @@ export const ResponseCheckTx = { if (message.codespace !== "") { writer.uint32(66).string(message.codespace); } + if (message.sender !== "") { + writer.uint32(74).string(message.sender); + } + if (message.priority !== BigInt(0)) { + writer.uint32(80).int64(message.priority); + } + if (message.mempoolError !== "") { + writer.uint32(90).string(message.mempoolError); + } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): ResponseCheckTx { @@ -3600,6 +4085,15 @@ export const ResponseCheckTx = { case 8: message.codespace = reader.string(); break; + case 9: + message.sender = reader.string(); + break; + case 10: + message.priority = reader.int64(); + break; + case 11: + message.mempoolError = reader.string(); + break; default: reader.skipType(tag & 7); break; @@ -3617,24 +4111,50 @@ export const ResponseCheckTx = { message.gasUsed = object.gasUsed !== undefined && object.gasUsed !== null ? BigInt(object.gasUsed.toString()) : BigInt(0); 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 ? BigInt(object.priority.toString()) : BigInt(0); + message.mempoolError = object.mempoolError ?? ""; + return message; + }, + fromAmino(object: ResponseCheckTxAmino): ResponseCheckTx { + const message = createBaseResponseCheckTx(); + if (object.code !== undefined && object.code !== null) { + message.code = object.code; + } + if (object.data !== undefined && object.data !== null) { + message.data = bytesFromBase64(object.data); + } + if (object.log !== undefined && object.log !== null) { + message.log = object.log; + } + if (object.info !== undefined && object.info !== null) { + message.info = object.info; + } + if (object.gas_wanted !== undefined && object.gas_wanted !== null) { + message.gasWanted = BigInt(object.gas_wanted); + } + if (object.gas_used !== undefined && object.gas_used !== null) { + message.gasUsed = BigInt(object.gas_used); + } + message.events = object.events?.map(e => Event.fromAmino(e)) || []; + if (object.codespace !== undefined && object.codespace !== null) { + message.codespace = object.codespace; + } + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + if (object.priority !== undefined && object.priority !== null) { + message.priority = BigInt(object.priority); + } + if (object.mempool_error !== undefined && object.mempool_error !== null) { + message.mempoolError = object.mempool_error; + } return message; }, - fromAmino(object: ResponseCheckTxAmino): ResponseCheckTx { - return { - code: object.code, - data: object.data, - log: object.log, - info: object.info, - gasWanted: BigInt(object.gas_wanted), - gasUsed: BigInt(object.gas_used), - events: Array.isArray(object?.events) ? object.events.map((e: any) => Event.fromAmino(e)) : [], - codespace: object.codespace - }; - }, toAmino(message: ResponseCheckTx): ResponseCheckTxAmino { const obj: any = {}; obj.code = message.code; - obj.data = message.data; + obj.data = message.data ? base64FromBytes(message.data) : undefined; obj.log = message.log; obj.info = message.info; obj.gas_wanted = message.gasWanted ? message.gasWanted.toString() : undefined; @@ -3645,6 +4165,9 @@ export const ResponseCheckTx = { obj.events = []; } obj.codespace = message.codespace; + obj.sender = message.sender; + obj.priority = message.priority ? message.priority.toString() : undefined; + obj.mempool_error = message.mempoolError; return obj; }, fromAminoMsg(object: ResponseCheckTxAminoMsg): ResponseCheckTx { @@ -3755,21 +4278,35 @@ export const ResponseDeliverTx = { return message; }, fromAmino(object: ResponseDeliverTxAmino): ResponseDeliverTx { - return { - code: object.code, - data: object.data, - log: object.log, - info: object.info, - gasWanted: BigInt(object.gas_wanted), - gasUsed: BigInt(object.gas_used), - events: Array.isArray(object?.events) ? object.events.map((e: any) => Event.fromAmino(e)) : [], - codespace: object.codespace - }; + const message = createBaseResponseDeliverTx(); + if (object.code !== undefined && object.code !== null) { + message.code = object.code; + } + if (object.data !== undefined && object.data !== null) { + message.data = bytesFromBase64(object.data); + } + if (object.log !== undefined && object.log !== null) { + message.log = object.log; + } + if (object.info !== undefined && object.info !== null) { + message.info = object.info; + } + if (object.gas_wanted !== undefined && object.gas_wanted !== null) { + message.gasWanted = BigInt(object.gas_wanted); + } + if (object.gas_used !== undefined && object.gas_used !== null) { + message.gasUsed = BigInt(object.gas_used); + } + message.events = object.events?.map(e => Event.fromAmino(e)) || []; + if (object.codespace !== undefined && object.codespace !== null) { + message.codespace = object.codespace; + } + return message; }, toAmino(message: ResponseDeliverTx): ResponseDeliverTxAmino { const obj: any = {}; obj.code = message.code; - obj.data = message.data; + obj.data = message.data ? base64FromBytes(message.data) : undefined; obj.log = message.log; obj.info = message.info; obj.gas_wanted = message.gasWanted ? message.gasWanted.toString() : undefined; @@ -3801,7 +4338,7 @@ export const ResponseDeliverTx = { function createBaseResponseEndBlock(): ResponseEndBlock { return { validatorUpdates: [], - consensusParamUpdates: ConsensusParams.fromPartial({}), + consensusParamUpdates: undefined, events: [] }; } @@ -3850,11 +4387,13 @@ export const ResponseEndBlock = { return message; }, fromAmino(object: ResponseEndBlockAmino): ResponseEndBlock { - return { - validatorUpdates: Array.isArray(object?.validator_updates) ? object.validator_updates.map((e: any) => ValidatorUpdate.fromAmino(e)) : [], - consensusParamUpdates: object?.consensus_param_updates ? ConsensusParams.fromAmino(object.consensus_param_updates) : undefined, - events: Array.isArray(object?.events) ? object.events.map((e: any) => Event.fromAmino(e)) : [] - }; + const message = createBaseResponseEndBlock(); + message.validatorUpdates = object.validator_updates?.map(e => ValidatorUpdate.fromAmino(e)) || []; + if (object.consensus_param_updates !== undefined && object.consensus_param_updates !== null) { + message.consensusParamUpdates = ConsensusParams.fromAmino(object.consensus_param_updates); + } + message.events = object.events?.map(e => Event.fromAmino(e)) || []; + return message; }, toAmino(message: ResponseEndBlock): ResponseEndBlockAmino { const obj: any = {}; @@ -3931,14 +4470,18 @@ export const ResponseCommit = { return message; }, fromAmino(object: ResponseCommitAmino): ResponseCommit { - return { - data: object.data, - retainHeight: BigInt(object.retain_height) - }; + const message = createBaseResponseCommit(); + if (object.data !== undefined && object.data !== null) { + message.data = bytesFromBase64(object.data); + } + if (object.retain_height !== undefined && object.retain_height !== null) { + message.retainHeight = BigInt(object.retain_height); + } + return message; }, toAmino(message: ResponseCommit): ResponseCommitAmino { const obj: any = {}; - obj.data = message.data; + obj.data = message.data ? base64FromBytes(message.data) : undefined; obj.retain_height = message.retainHeight ? message.retainHeight.toString() : undefined; return obj; }, @@ -3994,9 +4537,9 @@ export const ResponseListSnapshots = { return message; }, fromAmino(object: ResponseListSnapshotsAmino): ResponseListSnapshots { - return { - snapshots: Array.isArray(object?.snapshots) ? object.snapshots.map((e: any) => Snapshot.fromAmino(e)) : [] - }; + const message = createBaseResponseListSnapshots(); + message.snapshots = object.snapshots?.map(e => Snapshot.fromAmino(e)) || []; + return message; }, toAmino(message: ResponseListSnapshots): ResponseListSnapshotsAmino { const obj: any = {}; @@ -4059,13 +4602,15 @@ export const ResponseOfferSnapshot = { return message; }, fromAmino(object: ResponseOfferSnapshotAmino): ResponseOfferSnapshot { - return { - result: isSet(object.result) ? responseOfferSnapshot_ResultFromJSON(object.result) : -1 - }; + const message = createBaseResponseOfferSnapshot(); + if (object.result !== undefined && object.result !== null) { + message.result = responseOfferSnapshot_ResultFromJSON(object.result); + } + return message; }, toAmino(message: ResponseOfferSnapshot): ResponseOfferSnapshotAmino { const obj: any = {}; - obj.result = message.result; + obj.result = responseOfferSnapshot_ResultToJSON(message.result); return obj; }, fromAminoMsg(object: ResponseOfferSnapshotAminoMsg): ResponseOfferSnapshot { @@ -4120,13 +4665,15 @@ export const ResponseLoadSnapshotChunk = { return message; }, fromAmino(object: ResponseLoadSnapshotChunkAmino): ResponseLoadSnapshotChunk { - return { - chunk: object.chunk - }; + const message = createBaseResponseLoadSnapshotChunk(); + if (object.chunk !== undefined && object.chunk !== null) { + message.chunk = bytesFromBase64(object.chunk); + } + return message; }, toAmino(message: ResponseLoadSnapshotChunk): ResponseLoadSnapshotChunkAmino { const obj: any = {}; - obj.chunk = message.chunk; + obj.chunk = message.chunk ? base64FromBytes(message.chunk) : undefined; return obj; }, fromAminoMsg(object: ResponseLoadSnapshotChunkAminoMsg): ResponseLoadSnapshotChunk { @@ -4206,15 +4753,17 @@ export const ResponseApplySnapshotChunk = { return message; }, fromAmino(object: ResponseApplySnapshotChunkAmino): ResponseApplySnapshotChunk { - return { - result: isSet(object.result) ? responseApplySnapshotChunk_ResultFromJSON(object.result) : -1, - refetchChunks: Array.isArray(object?.refetch_chunks) ? object.refetch_chunks.map((e: any) => e) : [], - rejectSenders: Array.isArray(object?.reject_senders) ? object.reject_senders.map((e: any) => e) : [] - }; + const message = createBaseResponseApplySnapshotChunk(); + if (object.result !== undefined && object.result !== null) { + message.result = responseApplySnapshotChunk_ResultFromJSON(object.result); + } + message.refetchChunks = object.refetch_chunks?.map(e => e) || []; + message.rejectSenders = object.reject_senders?.map(e => e) || []; + return message; }, toAmino(message: ResponseApplySnapshotChunk): ResponseApplySnapshotChunkAmino { const obj: any = {}; - obj.result = message.result; + obj.result = responseApplySnapshotChunk_ResultToJSON(message.result); if (message.refetchChunks) { obj.refetch_chunks = message.refetchChunks.map(e => e); } else { @@ -4243,49 +4792,93 @@ export const ResponseApplySnapshotChunk = { }; } }; -function createBaseConsensusParams(): ConsensusParams { +function createBaseResponsePrepareProposal(): ResponsePrepareProposal { return { - block: BlockParams.fromPartial({}), - evidence: EvidenceParams.fromPartial({}), - validator: ValidatorParams.fromPartial({}), - version: VersionParams.fromPartial({}) + txs: [] }; } -export const ConsensusParams = { - typeUrl: "/tendermint.abci.ConsensusParams", - encode(message: ConsensusParams, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { - if (message.block !== undefined) { - BlockParams.encode(message.block, writer.uint32(10).fork()).ldelim(); +export const ResponsePrepareProposal = { + typeUrl: "/tendermint.abci.ResponsePrepareProposal", + encode(message: ResponsePrepareProposal, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.txs) { + writer.uint32(10).bytes(v!); } - if (message.evidence !== undefined) { - EvidenceParams.encode(message.evidence, writer.uint32(18).fork()).ldelim(); + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): ResponsePrepareProposal { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseResponsePrepareProposal(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.txs.push(reader.bytes()); + break; + default: + reader.skipType(tag & 7); + break; + } } - if (message.validator !== undefined) { - ValidatorParams.encode(message.validator, writer.uint32(26).fork()).ldelim(); + return message; + }, + fromPartial(object: Partial): ResponsePrepareProposal { + const message = createBaseResponsePrepareProposal(); + message.txs = object.txs?.map(e => e) || []; + return message; + }, + fromAmino(object: ResponsePrepareProposalAmino): ResponsePrepareProposal { + const message = createBaseResponsePrepareProposal(); + message.txs = object.txs?.map(e => bytesFromBase64(e)) || []; + return message; + }, + toAmino(message: ResponsePrepareProposal): ResponsePrepareProposalAmino { + const obj: any = {}; + if (message.txs) { + obj.txs = message.txs.map(e => base64FromBytes(e)); + } else { + obj.txs = []; } - if (message.version !== undefined) { - VersionParams.encode(message.version, writer.uint32(34).fork()).ldelim(); + return obj; + }, + fromAminoMsg(object: ResponsePrepareProposalAminoMsg): ResponsePrepareProposal { + return ResponsePrepareProposal.fromAmino(object.value); + }, + fromProtoMsg(message: ResponsePrepareProposalProtoMsg): ResponsePrepareProposal { + return ResponsePrepareProposal.decode(message.value); + }, + toProto(message: ResponsePrepareProposal): Uint8Array { + return ResponsePrepareProposal.encode(message).finish(); + }, + toProtoMsg(message: ResponsePrepareProposal): ResponsePrepareProposalProtoMsg { + return { + typeUrl: "/tendermint.abci.ResponsePrepareProposal", + value: ResponsePrepareProposal.encode(message).finish() + }; + } +}; +function createBaseResponseProcessProposal(): ResponseProcessProposal { + return { + status: 0 + }; +} +export const ResponseProcessProposal = { + typeUrl: "/tendermint.abci.ResponseProcessProposal", + encode(message: ResponseProcessProposal, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.status !== 0) { + writer.uint32(8).int32(message.status); } return writer; }, - decode(input: BinaryReader | Uint8Array, length?: number): ConsensusParams { + decode(input: BinaryReader | Uint8Array, length?: number): ResponseProcessProposal { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseConsensusParams(); + const message = createBaseResponseProcessProposal(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.block = BlockParams.decode(reader, reader.uint32()); - break; - case 2: - message.evidence = EvidenceParams.decode(reader, reader.uint32()); - break; - case 3: - message.validator = ValidatorParams.decode(reader, reader.uint32()); - break; - case 4: - message.version = VersionParams.decode(reader, reader.uint32()); + message.status = (reader.int32() as any); break; default: reader.skipType(tag & 7); @@ -4294,75 +4887,68 @@ export const ConsensusParams = { } return message; }, - fromPartial(object: Partial): 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; + fromPartial(object: Partial): ResponseProcessProposal { + const message = createBaseResponseProcessProposal(); + message.status = object.status ?? 0; return message; }, - fromAmino(object: ConsensusParamsAmino): ConsensusParams { - return { - block: object?.block ? BlockParams.fromAmino(object.block) : undefined, - evidence: object?.evidence ? EvidenceParams.fromAmino(object.evidence) : undefined, - validator: object?.validator ? ValidatorParams.fromAmino(object.validator) : undefined, - version: object?.version ? VersionParams.fromAmino(object.version) : undefined - }; + fromAmino(object: ResponseProcessProposalAmino): ResponseProcessProposal { + const message = createBaseResponseProcessProposal(); + if (object.status !== undefined && object.status !== null) { + message.status = responseProcessProposal_ProposalStatusFromJSON(object.status); + } + return message; }, - toAmino(message: ConsensusParams): ConsensusParamsAmino { + toAmino(message: ResponseProcessProposal): ResponseProcessProposalAmino { const obj: any = {}; - obj.block = message.block ? BlockParams.toAmino(message.block) : undefined; - obj.evidence = message.evidence ? EvidenceParams.toAmino(message.evidence) : undefined; - obj.validator = message.validator ? ValidatorParams.toAmino(message.validator) : undefined; - obj.version = message.version ? VersionParams.toAmino(message.version) : undefined; + obj.status = responseProcessProposal_ProposalStatusToJSON(message.status); return obj; }, - fromAminoMsg(object: ConsensusParamsAminoMsg): ConsensusParams { - return ConsensusParams.fromAmino(object.value); + fromAminoMsg(object: ResponseProcessProposalAminoMsg): ResponseProcessProposal { + return ResponseProcessProposal.fromAmino(object.value); }, - fromProtoMsg(message: ConsensusParamsProtoMsg): ConsensusParams { - return ConsensusParams.decode(message.value); + fromProtoMsg(message: ResponseProcessProposalProtoMsg): ResponseProcessProposal { + return ResponseProcessProposal.decode(message.value); }, - toProto(message: ConsensusParams): Uint8Array { - return ConsensusParams.encode(message).finish(); + toProto(message: ResponseProcessProposal): Uint8Array { + return ResponseProcessProposal.encode(message).finish(); }, - toProtoMsg(message: ConsensusParams): ConsensusParamsProtoMsg { + toProtoMsg(message: ResponseProcessProposal): ResponseProcessProposalProtoMsg { return { - typeUrl: "/tendermint.abci.ConsensusParams", - value: ConsensusParams.encode(message).finish() + typeUrl: "/tendermint.abci.ResponseProcessProposal", + value: ResponseProcessProposal.encode(message).finish() }; } }; -function createBaseBlockParams(): BlockParams { +function createBaseCommitInfo(): CommitInfo { return { - maxBytes: BigInt(0), - maxGas: BigInt(0) + round: 0, + votes: [] }; } -export const BlockParams = { - typeUrl: "/tendermint.abci.BlockParams", - encode(message: BlockParams, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { - if (message.maxBytes !== BigInt(0)) { - writer.uint32(8).int64(message.maxBytes); +export const CommitInfo = { + typeUrl: "/tendermint.abci.CommitInfo", + encode(message: CommitInfo, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.round !== 0) { + writer.uint32(8).int32(message.round); } - if (message.maxGas !== BigInt(0)) { - writer.uint32(16).int64(message.maxGas); + for (const v of message.votes) { + VoteInfo.encode(v!, writer.uint32(18).fork()).ldelim(); } return writer; }, - decode(input: BinaryReader | Uint8Array, length?: number): BlockParams { + decode(input: BinaryReader | Uint8Array, length?: number): CommitInfo { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseBlockParams(); + const message = createBaseCommitInfo(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.maxBytes = reader.int64(); + message.round = reader.int32(); break; case 2: - message.maxGas = reader.int64(); + message.votes.push(VoteInfo.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -4371,61 +4957,67 @@ export const BlockParams = { } return message; }, - fromPartial(object: Partial): BlockParams { - const message = createBaseBlockParams(); - message.maxBytes = object.maxBytes !== undefined && object.maxBytes !== null ? BigInt(object.maxBytes.toString()) : BigInt(0); - message.maxGas = object.maxGas !== undefined && object.maxGas !== null ? BigInt(object.maxGas.toString()) : BigInt(0); + fromPartial(object: Partial): CommitInfo { + const message = createBaseCommitInfo(); + message.round = object.round ?? 0; + message.votes = object.votes?.map(e => VoteInfo.fromPartial(e)) || []; return message; }, - fromAmino(object: BlockParamsAmino): BlockParams { - return { - maxBytes: BigInt(object.max_bytes), - maxGas: BigInt(object.max_gas) - }; + fromAmino(object: CommitInfoAmino): CommitInfo { + const message = createBaseCommitInfo(); + if (object.round !== undefined && object.round !== null) { + message.round = object.round; + } + message.votes = object.votes?.map(e => VoteInfo.fromAmino(e)) || []; + return message; }, - toAmino(message: BlockParams): BlockParamsAmino { + toAmino(message: CommitInfo): CommitInfoAmino { const obj: any = {}; - obj.max_bytes = message.maxBytes ? message.maxBytes.toString() : undefined; - obj.max_gas = message.maxGas ? message.maxGas.toString() : undefined; + obj.round = message.round; + if (message.votes) { + obj.votes = message.votes.map(e => e ? VoteInfo.toAmino(e) : undefined); + } else { + obj.votes = []; + } return obj; }, - fromAminoMsg(object: BlockParamsAminoMsg): BlockParams { - return BlockParams.fromAmino(object.value); + fromAminoMsg(object: CommitInfoAminoMsg): CommitInfo { + return CommitInfo.fromAmino(object.value); }, - fromProtoMsg(message: BlockParamsProtoMsg): BlockParams { - return BlockParams.decode(message.value); + fromProtoMsg(message: CommitInfoProtoMsg): CommitInfo { + return CommitInfo.decode(message.value); }, - toProto(message: BlockParams): Uint8Array { - return BlockParams.encode(message).finish(); + toProto(message: CommitInfo): Uint8Array { + return CommitInfo.encode(message).finish(); }, - toProtoMsg(message: BlockParams): BlockParamsProtoMsg { + toProtoMsg(message: CommitInfo): CommitInfoProtoMsg { return { - typeUrl: "/tendermint.abci.BlockParams", - value: BlockParams.encode(message).finish() + typeUrl: "/tendermint.abci.CommitInfo", + value: CommitInfo.encode(message).finish() }; } }; -function createBaseLastCommitInfo(): LastCommitInfo { +function createBaseExtendedCommitInfo(): ExtendedCommitInfo { return { round: 0, votes: [] }; } -export const LastCommitInfo = { - typeUrl: "/tendermint.abci.LastCommitInfo", - encode(message: LastCommitInfo, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { +export const ExtendedCommitInfo = { + typeUrl: "/tendermint.abci.ExtendedCommitInfo", + encode(message: ExtendedCommitInfo, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.round !== 0) { writer.uint32(8).int32(message.round); } for (const v of message.votes) { - VoteInfo.encode(v!, writer.uint32(18).fork()).ldelim(); + ExtendedVoteInfo.encode(v!, writer.uint32(18).fork()).ldelim(); } return writer; }, - decode(input: BinaryReader | Uint8Array, length?: number): LastCommitInfo { + decode(input: BinaryReader | Uint8Array, length?: number): ExtendedCommitInfo { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseLastCommitInfo(); + const message = createBaseExtendedCommitInfo(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -4433,7 +5025,7 @@ export const LastCommitInfo = { message.round = reader.int32(); break; case 2: - message.votes.push(VoteInfo.decode(reader, reader.uint32())); + message.votes.push(ExtendedVoteInfo.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -4442,41 +5034,43 @@ export const LastCommitInfo = { } return message; }, - fromPartial(object: Partial): LastCommitInfo { - const message = createBaseLastCommitInfo(); + fromPartial(object: Partial): ExtendedCommitInfo { + const message = createBaseExtendedCommitInfo(); message.round = object.round ?? 0; - message.votes = object.votes?.map(e => VoteInfo.fromPartial(e)) || []; + message.votes = object.votes?.map(e => ExtendedVoteInfo.fromPartial(e)) || []; return message; }, - fromAmino(object: LastCommitInfoAmino): LastCommitInfo { - return { - round: object.round, - votes: Array.isArray(object?.votes) ? object.votes.map((e: any) => VoteInfo.fromAmino(e)) : [] - }; + fromAmino(object: ExtendedCommitInfoAmino): ExtendedCommitInfo { + const message = createBaseExtendedCommitInfo(); + if (object.round !== undefined && object.round !== null) { + message.round = object.round; + } + message.votes = object.votes?.map(e => ExtendedVoteInfo.fromAmino(e)) || []; + return message; }, - toAmino(message: LastCommitInfo): LastCommitInfoAmino { + toAmino(message: ExtendedCommitInfo): ExtendedCommitInfoAmino { const obj: any = {}; obj.round = message.round; if (message.votes) { - obj.votes = message.votes.map(e => e ? VoteInfo.toAmino(e) : undefined); + obj.votes = message.votes.map(e => e ? ExtendedVoteInfo.toAmino(e) : undefined); } else { obj.votes = []; } return obj; }, - fromAminoMsg(object: LastCommitInfoAminoMsg): LastCommitInfo { - return LastCommitInfo.fromAmino(object.value); + fromAminoMsg(object: ExtendedCommitInfoAminoMsg): ExtendedCommitInfo { + return ExtendedCommitInfo.fromAmino(object.value); }, - fromProtoMsg(message: LastCommitInfoProtoMsg): LastCommitInfo { - return LastCommitInfo.decode(message.value); + fromProtoMsg(message: ExtendedCommitInfoProtoMsg): ExtendedCommitInfo { + return ExtendedCommitInfo.decode(message.value); }, - toProto(message: LastCommitInfo): Uint8Array { - return LastCommitInfo.encode(message).finish(); + toProto(message: ExtendedCommitInfo): Uint8Array { + return ExtendedCommitInfo.encode(message).finish(); }, - toProtoMsg(message: LastCommitInfo): LastCommitInfoProtoMsg { + toProtoMsg(message: ExtendedCommitInfo): ExtendedCommitInfoProtoMsg { return { - typeUrl: "/tendermint.abci.LastCommitInfo", - value: LastCommitInfo.encode(message).finish() + typeUrl: "/tendermint.abci.ExtendedCommitInfo", + value: ExtendedCommitInfo.encode(message).finish() }; } }; @@ -4524,10 +5118,12 @@ export const Event = { return message; }, fromAmino(object: EventAmino): Event { - return { - type: object.type, - attributes: Array.isArray(object?.attributes) ? object.attributes.map((e: any) => EventAttribute.fromAmino(e)) : [] - }; + const message = createBaseEvent(); + if (object.type !== undefined && object.type !== null) { + message.type = object.type; + } + message.attributes = object.attributes?.map(e => EventAttribute.fromAmino(e)) || []; + return message; }, toAmino(message: Event): EventAmino { const obj: any = {}; @@ -4557,19 +5153,19 @@ export const Event = { }; function createBaseEventAttribute(): EventAttribute { return { - key: new Uint8Array(), - value: new Uint8Array(), + key: "", + value: "", index: false }; } export const EventAttribute = { typeUrl: "/tendermint.abci.EventAttribute", encode(message: EventAttribute, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { - if (message.key.length !== 0) { - writer.uint32(10).bytes(message.key); + if (message.key !== "") { + writer.uint32(10).string(message.key); } - if (message.value.length !== 0) { - writer.uint32(18).bytes(message.value); + if (message.value !== "") { + writer.uint32(18).string(message.value); } if (message.index === true) { writer.uint32(24).bool(message.index); @@ -4584,10 +5180,10 @@ export const EventAttribute = { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.key = reader.bytes(); + message.key = reader.string(); break; case 2: - message.value = reader.bytes(); + message.value = reader.string(); break; case 3: message.index = reader.bool(); @@ -4601,17 +5197,23 @@ export const EventAttribute = { }, fromPartial(object: Partial): EventAttribute { const message = createBaseEventAttribute(); - message.key = object.key ?? new Uint8Array(); - message.value = object.value ?? new Uint8Array(); + message.key = object.key ?? ""; + message.value = object.value ?? ""; message.index = object.index ?? false; return message; }, fromAmino(object: EventAttributeAmino): EventAttribute { - return { - key: object.key, - value: object.value, - index: object.index - }; + const message = createBaseEventAttribute(); + if (object.key !== undefined && object.key !== null) { + message.key = object.key; + } + if (object.value !== undefined && object.value !== null) { + message.value = object.value; + } + if (object.index !== undefined && object.index !== null) { + message.index = object.index; + } + return message; }, toAmino(message: EventAttribute): EventAttributeAmino { const obj: any = {}; @@ -4696,18 +5298,26 @@ export const TxResult = { return message; }, fromAmino(object: TxResultAmino): TxResult { - return { - height: BigInt(object.height), - index: object.index, - tx: object.tx, - result: object?.result ? ResponseDeliverTx.fromAmino(object.result) : undefined - }; + const message = createBaseTxResult(); + if (object.height !== undefined && object.height !== null) { + message.height = BigInt(object.height); + } + if (object.index !== undefined && object.index !== null) { + message.index = object.index; + } + if (object.tx !== undefined && object.tx !== null) { + message.tx = bytesFromBase64(object.tx); + } + if (object.result !== undefined && object.result !== null) { + message.result = ResponseDeliverTx.fromAmino(object.result); + } + return message; }, toAmino(message: TxResult): TxResultAmino { const obj: any = {}; obj.height = message.height ? message.height.toString() : undefined; obj.index = message.index; - obj.tx = message.tx; + obj.tx = message.tx ? base64FromBytes(message.tx) : undefined; obj.result = message.result ? ResponseDeliverTx.toAmino(message.result) : undefined; return obj; }, @@ -4771,14 +5381,18 @@ export const Validator = { return message; }, fromAmino(object: ValidatorAmino): Validator { - return { - address: object.address, - power: BigInt(object.power) - }; + const message = createBaseValidator(); + if (object.address !== undefined && object.address !== null) { + message.address = bytesFromBase64(object.address); + } + if (object.power !== undefined && object.power !== null) { + message.power = BigInt(object.power); + } + return message; }, toAmino(message: Validator): ValidatorAmino { const obj: any = {}; - obj.address = message.address; + obj.address = message.address ? base64FromBytes(message.address) : undefined; obj.power = message.power ? message.power.toString() : undefined; return obj; }, @@ -4842,10 +5456,14 @@ export const ValidatorUpdate = { return message; }, fromAmino(object: ValidatorUpdateAmino): ValidatorUpdate { - return { - pubKey: object?.pub_key ? PublicKey.fromAmino(object.pub_key) : undefined, - power: BigInt(object.power) - }; + const message = createBaseValidatorUpdate(); + if (object.pub_key !== undefined && object.pub_key !== null) { + message.pubKey = PublicKey.fromAmino(object.pub_key); + } + if (object.power !== undefined && object.power !== null) { + message.power = BigInt(object.power); + } + return message; }, toAmino(message: ValidatorUpdate): ValidatorUpdateAmino { const obj: any = {}; @@ -4913,10 +5531,14 @@ export const VoteInfo = { return message; }, fromAmino(object: VoteInfoAmino): VoteInfo { - return { - validator: object?.validator ? Validator.fromAmino(object.validator) : undefined, - signedLastBlock: object.signed_last_block - }; + const message = createBaseVoteInfo(); + if (object.validator !== undefined && object.validator !== null) { + message.validator = Validator.fromAmino(object.validator); + } + if (object.signed_last_block !== undefined && object.signed_last_block !== null) { + message.signedLastBlock = object.signed_last_block; + } + return message; }, toAmino(message: VoteInfo): VoteInfoAmino { const obj: any = {}; @@ -4940,7 +5562,94 @@ export const VoteInfo = { }; } }; -function createBaseEvidence(): Evidence { +function createBaseExtendedVoteInfo(): ExtendedVoteInfo { + return { + validator: Validator.fromPartial({}), + signedLastBlock: false, + voteExtension: new Uint8Array() + }; +} +export const ExtendedVoteInfo = { + typeUrl: "/tendermint.abci.ExtendedVoteInfo", + encode(message: ExtendedVoteInfo, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.validator !== undefined) { + Validator.encode(message.validator, writer.uint32(10).fork()).ldelim(); + } + if (message.signedLastBlock === true) { + writer.uint32(16).bool(message.signedLastBlock); + } + if (message.voteExtension.length !== 0) { + writer.uint32(26).bytes(message.voteExtension); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): ExtendedVoteInfo { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseExtendedVoteInfo(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.validator = Validator.decode(reader, reader.uint32()); + break; + case 2: + message.signedLastBlock = reader.bool(); + break; + case 3: + message.voteExtension = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): ExtendedVoteInfo { + const message = createBaseExtendedVoteInfo(); + message.validator = object.validator !== undefined && object.validator !== null ? Validator.fromPartial(object.validator) : undefined; + message.signedLastBlock = object.signedLastBlock ?? false; + message.voteExtension = object.voteExtension ?? new Uint8Array(); + return message; + }, + fromAmino(object: ExtendedVoteInfoAmino): ExtendedVoteInfo { + const message = createBaseExtendedVoteInfo(); + if (object.validator !== undefined && object.validator !== null) { + message.validator = Validator.fromAmino(object.validator); + } + if (object.signed_last_block !== undefined && object.signed_last_block !== null) { + message.signedLastBlock = object.signed_last_block; + } + if (object.vote_extension !== undefined && object.vote_extension !== null) { + message.voteExtension = bytesFromBase64(object.vote_extension); + } + return message; + }, + toAmino(message: ExtendedVoteInfo): ExtendedVoteInfoAmino { + const obj: any = {}; + obj.validator = message.validator ? Validator.toAmino(message.validator) : undefined; + obj.signed_last_block = message.signedLastBlock; + obj.vote_extension = message.voteExtension ? base64FromBytes(message.voteExtension) : undefined; + return obj; + }, + fromAminoMsg(object: ExtendedVoteInfoAminoMsg): ExtendedVoteInfo { + return ExtendedVoteInfo.fromAmino(object.value); + }, + fromProtoMsg(message: ExtendedVoteInfoProtoMsg): ExtendedVoteInfo { + return ExtendedVoteInfo.decode(message.value); + }, + toProto(message: ExtendedVoteInfo): Uint8Array { + return ExtendedVoteInfo.encode(message).finish(); + }, + toProtoMsg(message: ExtendedVoteInfo): ExtendedVoteInfoProtoMsg { + return { + typeUrl: "/tendermint.abci.ExtendedVoteInfo", + value: ExtendedVoteInfo.encode(message).finish() + }; + } +}; +function createBaseMisbehavior(): Misbehavior { return { type: 0, validator: Validator.fromPartial({}), @@ -4949,9 +5658,9 @@ function createBaseEvidence(): Evidence { totalVotingPower: BigInt(0) }; } -export const Evidence = { - typeUrl: "/tendermint.abci.Evidence", - encode(message: Evidence, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { +export const Misbehavior = { + typeUrl: "/tendermint.abci.Misbehavior", + encode(message: Misbehavior, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.type !== 0) { writer.uint32(8).int32(message.type); } @@ -4969,10 +5678,10 @@ export const Evidence = { } return writer; }, - decode(input: BinaryReader | Uint8Array, length?: number): Evidence { + decode(input: BinaryReader | Uint8Array, length?: number): Misbehavior { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseEvidence(); + const message = createBaseMisbehavior(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -4998,8 +5707,8 @@ export const Evidence = { } return message; }, - fromPartial(object: Partial): Evidence { - const message = createBaseEvidence(); + fromPartial(object: Partial): Misbehavior { + const message = createBaseMisbehavior(); 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 ? BigInt(object.height.toString()) : BigInt(0); @@ -5007,37 +5716,47 @@ export const Evidence = { message.totalVotingPower = object.totalVotingPower !== undefined && object.totalVotingPower !== null ? BigInt(object.totalVotingPower.toString()) : BigInt(0); return message; }, - fromAmino(object: EvidenceAmino): Evidence { - return { - type: isSet(object.type) ? evidenceTypeFromJSON(object.type) : -1, - validator: object?.validator ? Validator.fromAmino(object.validator) : undefined, - height: BigInt(object.height), - time: object.time, - totalVotingPower: BigInt(object.total_voting_power) - }; + fromAmino(object: MisbehaviorAmino): Misbehavior { + const message = createBaseMisbehavior(); + if (object.type !== undefined && object.type !== null) { + message.type = misbehaviorTypeFromJSON(object.type); + } + if (object.validator !== undefined && object.validator !== null) { + message.validator = Validator.fromAmino(object.validator); + } + if (object.height !== undefined && object.height !== null) { + message.height = BigInt(object.height); + } + if (object.time !== undefined && object.time !== null) { + message.time = fromTimestamp(Timestamp.fromAmino(object.time)); + } + if (object.total_voting_power !== undefined && object.total_voting_power !== null) { + message.totalVotingPower = BigInt(object.total_voting_power); + } + return message; }, - toAmino(message: Evidence): EvidenceAmino { + toAmino(message: Misbehavior): MisbehaviorAmino { const obj: any = {}; - obj.type = message.type; + obj.type = misbehaviorTypeToJSON(message.type); obj.validator = message.validator ? Validator.toAmino(message.validator) : undefined; obj.height = message.height ? message.height.toString() : undefined; - obj.time = message.time; + obj.time = message.time ? Timestamp.toAmino(toTimestamp(message.time)) : undefined; obj.total_voting_power = message.totalVotingPower ? message.totalVotingPower.toString() : undefined; return obj; }, - fromAminoMsg(object: EvidenceAminoMsg): Evidence { - return Evidence.fromAmino(object.value); + fromAminoMsg(object: MisbehaviorAminoMsg): Misbehavior { + return Misbehavior.fromAmino(object.value); }, - fromProtoMsg(message: EvidenceProtoMsg): Evidence { - return Evidence.decode(message.value); + fromProtoMsg(message: MisbehaviorProtoMsg): Misbehavior { + return Misbehavior.decode(message.value); }, - toProto(message: Evidence): Uint8Array { - return Evidence.encode(message).finish(); + toProto(message: Misbehavior): Uint8Array { + return Misbehavior.encode(message).finish(); }, - toProtoMsg(message: Evidence): EvidenceProtoMsg { + toProtoMsg(message: Misbehavior): MisbehaviorProtoMsg { return { - typeUrl: "/tendermint.abci.Evidence", - value: Evidence.encode(message).finish() + typeUrl: "/tendermint.abci.Misbehavior", + value: Misbehavior.encode(message).finish() }; } }; @@ -5109,21 +5828,31 @@ export const Snapshot = { return message; }, fromAmino(object: SnapshotAmino): Snapshot { - return { - height: BigInt(object.height), - format: object.format, - chunks: object.chunks, - hash: object.hash, - metadata: object.metadata - }; + const message = createBaseSnapshot(); + if (object.height !== undefined && object.height !== null) { + message.height = BigInt(object.height); + } + if (object.format !== undefined && object.format !== null) { + message.format = object.format; + } + if (object.chunks !== undefined && object.chunks !== null) { + message.chunks = object.chunks; + } + if (object.hash !== undefined && object.hash !== null) { + message.hash = bytesFromBase64(object.hash); + } + if (object.metadata !== undefined && object.metadata !== null) { + message.metadata = bytesFromBase64(object.metadata); + } + return message; }, toAmino(message: Snapshot): SnapshotAmino { const obj: any = {}; obj.height = message.height ? message.height.toString() : undefined; obj.format = message.format; obj.chunks = message.chunks; - obj.hash = message.hash; - obj.metadata = message.metadata; + obj.hash = message.hash ? base64FromBytes(message.hash) : undefined; + obj.metadata = message.metadata ? base64FromBytes(message.metadata) : undefined; return obj; }, fromAminoMsg(object: SnapshotAminoMsg): Snapshot { diff --git a/packages/osmo-query/src/codegen/tendermint/bundle.ts b/packages/osmo-query/src/codegen/tendermint/bundle.ts index a1405caeb..989386d44 100644 --- a/packages/osmo-query/src/codegen/tendermint/bundle.ts +++ b/packages/osmo-query/src/codegen/tendermint/bundle.ts @@ -1,38 +1,38 @@ -import * as _179 from "./abci/types"; -import * as _180 from "./crypto/keys"; -import * as _181 from "./crypto/proof"; -import * as _182 from "./libs/bits/types"; -import * as _183 from "./p2p/types"; -import * as _184 from "./types/block"; -import * as _185 from "./types/evidence"; -import * as _186 from "./types/params"; -import * as _187 from "./types/types"; -import * as _188 from "./types/validator"; -import * as _189 from "./version/types"; +import * as _73 from "./abci/types"; +import * as _74 from "./crypto/keys"; +import * as _75 from "./crypto/proof"; +import * as _76 from "./libs/bits/types"; +import * as _77 from "./p2p/types"; +import * as _78 from "./types/block"; +import * as _79 from "./types/evidence"; +import * as _80 from "./types/params"; +import * as _81 from "./types/types"; +import * as _82 from "./types/validator"; +import * as _83 from "./version/types"; export namespace tendermint { export const abci = { - ..._179 + ..._73 }; export const crypto = { - ..._180, - ..._181 + ..._74, + ..._75 }; export namespace libs { export const bits = { - ..._182 + ..._76 }; } export const p2p = { - ..._183 + ..._77 }; export const types = { - ..._184, - ..._185, - ..._186, - ..._187, - ..._188 + ..._78, + ..._79, + ..._80, + ..._81, + ..._82 }; export const version = { - ..._189 + ..._83 }; } \ No newline at end of file diff --git a/packages/osmo-query/src/codegen/tendermint/crypto/keys.ts b/packages/osmo-query/src/codegen/tendermint/crypto/keys.ts index 54a0ef252..9f96f6db3 100644 --- a/packages/osmo-query/src/codegen/tendermint/crypto/keys.ts +++ b/packages/osmo-query/src/codegen/tendermint/crypto/keys.ts @@ -1,5 +1,6 @@ import { BinaryReader, BinaryWriter } from "../../binary"; -/** PublicKey defines the keys available for use with Tendermint Validators */ +import { bytesFromBase64, base64FromBytes } from "../../helpers"; +/** PublicKey defines the keys available for use with Validators */ export interface PublicKey { ed25519?: Uint8Array; secp256k1?: Uint8Array; @@ -8,16 +9,16 @@ export interface PublicKeyProtoMsg { typeUrl: "/tendermint.crypto.PublicKey"; value: Uint8Array; } -/** PublicKey defines the keys available for use with Tendermint Validators */ +/** PublicKey defines the keys available for use with Validators */ export interface PublicKeyAmino { - ed25519?: Uint8Array; - secp256k1?: Uint8Array; + ed25519?: string; + secp256k1?: string; } export interface PublicKeyAminoMsg { type: "/tendermint.crypto.PublicKey"; value: PublicKeyAmino; } -/** PublicKey defines the keys available for use with Tendermint Validators */ +/** PublicKey defines the keys available for use with Validators */ export interface PublicKeySDKType { ed25519?: Uint8Array; secp256k1?: Uint8Array; @@ -66,15 +67,19 @@ export const PublicKey = { return message; }, fromAmino(object: PublicKeyAmino): PublicKey { - return { - ed25519: object?.ed25519, - secp256k1: object?.secp256k1 - }; + const message = createBasePublicKey(); + if (object.ed25519 !== undefined && object.ed25519 !== null) { + message.ed25519 = bytesFromBase64(object.ed25519); + } + if (object.secp256k1 !== undefined && object.secp256k1 !== null) { + message.secp256k1 = bytesFromBase64(object.secp256k1); + } + return message; }, toAmino(message: PublicKey): PublicKeyAmino { const obj: any = {}; - obj.ed25519 = message.ed25519; - obj.secp256k1 = message.secp256k1; + obj.ed25519 = message.ed25519 ? base64FromBytes(message.ed25519) : undefined; + obj.secp256k1 = message.secp256k1 ? base64FromBytes(message.secp256k1) : undefined; return obj; }, fromAminoMsg(object: PublicKeyAminoMsg): PublicKey { diff --git a/packages/osmo-query/src/codegen/tendermint/crypto/proof.ts b/packages/osmo-query/src/codegen/tendermint/crypto/proof.ts index baf80ed42..8d91ce1b2 100644 --- a/packages/osmo-query/src/codegen/tendermint/crypto/proof.ts +++ b/packages/osmo-query/src/codegen/tendermint/crypto/proof.ts @@ -1,4 +1,5 @@ import { BinaryReader, BinaryWriter } from "../../binary"; +import { bytesFromBase64, base64FromBytes } from "../../helpers"; export interface Proof { total: bigint; index: bigint; @@ -10,10 +11,10 @@ export interface ProofProtoMsg { value: Uint8Array; } export interface ProofAmino { - total: string; - index: string; - leaf_hash: Uint8Array; - aunts: Uint8Array[]; + total?: string; + index?: string; + leaf_hash?: string; + aunts?: string[]; } export interface ProofAminoMsg { type: "/tendermint.crypto.Proof"; @@ -29,7 +30,7 @@ export interface ValueOp { /** Encoded in ProofOp.Key. */ key: Uint8Array; /** To encode in ProofOp.Data */ - proof: Proof; + proof?: Proof; } export interface ValueOpProtoMsg { typeUrl: "/tendermint.crypto.ValueOp"; @@ -37,7 +38,7 @@ export interface ValueOpProtoMsg { } export interface ValueOpAmino { /** Encoded in ProofOp.Key. */ - key: Uint8Array; + key?: string; /** To encode in ProofOp.Data */ proof?: ProofAmino; } @@ -47,7 +48,7 @@ export interface ValueOpAminoMsg { } export interface ValueOpSDKType { key: Uint8Array; - proof: ProofSDKType; + proof?: ProofSDKType; } export interface DominoOp { key: string; @@ -59,9 +60,9 @@ export interface DominoOpProtoMsg { value: Uint8Array; } export interface DominoOpAmino { - key: string; - input: string; - output: string; + key?: string; + input?: string; + output?: string; } export interface DominoOpAminoMsg { type: "/tendermint.crypto.DominoOp"; @@ -92,9 +93,9 @@ export interface ProofOpProtoMsg { * for example neighbouring node hash */ export interface ProofOpAmino { - type: string; - key: Uint8Array; - data: Uint8Array; + type?: string; + key?: string; + data?: string; } export interface ProofOpAminoMsg { type: "/tendermint.crypto.ProofOp"; @@ -120,7 +121,7 @@ export interface ProofOpsProtoMsg { } /** ProofOps is Merkle proof defined by the list of ProofOps */ export interface ProofOpsAmino { - ops: ProofOpAmino[]; + ops?: ProofOpAmino[]; } export interface ProofOpsAminoMsg { type: "/tendermint.crypto.ProofOps"; @@ -190,20 +191,26 @@ export const Proof = { return message; }, fromAmino(object: ProofAmino): Proof { - return { - total: BigInt(object.total), - index: BigInt(object.index), - leafHash: object.leaf_hash, - aunts: Array.isArray(object?.aunts) ? object.aunts.map((e: any) => e) : [] - }; + const message = createBaseProof(); + if (object.total !== undefined && object.total !== null) { + message.total = BigInt(object.total); + } + if (object.index !== undefined && object.index !== null) { + message.index = BigInt(object.index); + } + if (object.leaf_hash !== undefined && object.leaf_hash !== null) { + message.leafHash = bytesFromBase64(object.leaf_hash); + } + message.aunts = object.aunts?.map(e => bytesFromBase64(e)) || []; + return message; }, toAmino(message: Proof): ProofAmino { const obj: any = {}; obj.total = message.total ? message.total.toString() : undefined; obj.index = message.index ? message.index.toString() : undefined; - obj.leaf_hash = message.leafHash; + obj.leaf_hash = message.leafHash ? base64FromBytes(message.leafHash) : undefined; if (message.aunts) { - obj.aunts = message.aunts.map(e => e); + obj.aunts = message.aunts.map(e => base64FromBytes(e)); } else { obj.aunts = []; } @@ -228,7 +235,7 @@ export const Proof = { function createBaseValueOp(): ValueOp { return { key: new Uint8Array(), - proof: Proof.fromPartial({}) + proof: undefined }; } export const ValueOp = { @@ -269,14 +276,18 @@ export const ValueOp = { return message; }, fromAmino(object: ValueOpAmino): ValueOp { - return { - key: object.key, - proof: object?.proof ? Proof.fromAmino(object.proof) : undefined - }; + const message = createBaseValueOp(); + if (object.key !== undefined && object.key !== null) { + message.key = bytesFromBase64(object.key); + } + if (object.proof !== undefined && object.proof !== null) { + message.proof = Proof.fromAmino(object.proof); + } + return message; }, toAmino(message: ValueOp): ValueOpAmino { const obj: any = {}; - obj.key = message.key; + obj.key = message.key ? base64FromBytes(message.key) : undefined; obj.proof = message.proof ? Proof.toAmino(message.proof) : undefined; return obj; }, @@ -348,11 +359,17 @@ export const DominoOp = { return message; }, fromAmino(object: DominoOpAmino): DominoOp { - return { - key: object.key, - input: object.input, - output: object.output - }; + const message = createBaseDominoOp(); + if (object.key !== undefined && object.key !== null) { + message.key = object.key; + } + if (object.input !== undefined && object.input !== null) { + message.input = object.input; + } + if (object.output !== undefined && object.output !== null) { + message.output = object.output; + } + return message; }, toAmino(message: DominoOp): DominoOpAmino { const obj: any = {}; @@ -429,17 +446,23 @@ export const ProofOp = { return message; }, fromAmino(object: ProofOpAmino): ProofOp { - return { - type: object.type, - key: object.key, - data: object.data - }; + const message = createBaseProofOp(); + if (object.type !== undefined && object.type !== null) { + message.type = object.type; + } + if (object.key !== undefined && object.key !== null) { + message.key = bytesFromBase64(object.key); + } + if (object.data !== undefined && object.data !== null) { + message.data = bytesFromBase64(object.data); + } + return message; }, toAmino(message: ProofOp): ProofOpAmino { const obj: any = {}; obj.type = message.type; - obj.key = message.key; - obj.data = message.data; + obj.key = message.key ? base64FromBytes(message.key) : undefined; + obj.data = message.data ? base64FromBytes(message.data) : undefined; return obj; }, fromAminoMsg(object: ProofOpAminoMsg): ProofOp { @@ -494,9 +517,9 @@ export const ProofOps = { return message; }, fromAmino(object: ProofOpsAmino): ProofOps { - return { - ops: Array.isArray(object?.ops) ? object.ops.map((e: any) => ProofOp.fromAmino(e)) : [] - }; + const message = createBaseProofOps(); + message.ops = object.ops?.map(e => ProofOp.fromAmino(e)) || []; + return message; }, toAmino(message: ProofOps): ProofOpsAmino { const obj: any = {}; diff --git a/packages/osmo-query/src/codegen/tendermint/libs/bits/types.ts b/packages/osmo-query/src/codegen/tendermint/libs/bits/types.ts index b7a7e607a..8e9cb41dc 100644 --- a/packages/osmo-query/src/codegen/tendermint/libs/bits/types.ts +++ b/packages/osmo-query/src/codegen/tendermint/libs/bits/types.ts @@ -8,8 +8,8 @@ export interface BitArrayProtoMsg { value: Uint8Array; } export interface BitArrayAmino { - bits: string; - elems: string[]; + bits?: string; + elems?: string[]; } export interface BitArrayAminoMsg { type: "/tendermint.libs.bits.BitArray"; @@ -72,10 +72,12 @@ export const BitArray = { return message; }, fromAmino(object: BitArrayAmino): BitArray { - return { - bits: BigInt(object.bits), - elems: Array.isArray(object?.elems) ? object.elems.map((e: any) => BigInt(e)) : [] - }; + const message = createBaseBitArray(); + if (object.bits !== undefined && object.bits !== null) { + message.bits = BigInt(object.bits); + } + message.elems = object.elems?.map(e => BigInt(e)) || []; + return message; }, toAmino(message: BitArray): BitArrayAmino { const obj: any = {}; diff --git a/packages/osmo-query/src/codegen/tendermint/p2p/types.ts b/packages/osmo-query/src/codegen/tendermint/p2p/types.ts index ca133d2bf..88ab8b57e 100644 --- a/packages/osmo-query/src/codegen/tendermint/p2p/types.ts +++ b/packages/osmo-query/src/codegen/tendermint/p2p/types.ts @@ -1,6 +1,28 @@ -import { Timestamp } from "../../google/protobuf/timestamp"; import { BinaryReader, BinaryWriter } from "../../binary"; -import { toTimestamp, fromTimestamp } from "../../helpers"; +import { bytesFromBase64, base64FromBytes } from "../../helpers"; +export interface NetAddress { + id: string; + ip: string; + port: number; +} +export interface NetAddressProtoMsg { + typeUrl: "/tendermint.p2p.NetAddress"; + value: Uint8Array; +} +export interface NetAddressAmino { + id?: string; + ip?: string; + port?: number; +} +export interface NetAddressAminoMsg { + type: "/tendermint.p2p.NetAddress"; + value: NetAddressAmino; +} +export interface NetAddressSDKType { + id: string; + ip: string; + port: number; +} export interface ProtocolVersion { p2p: bigint; block: bigint; @@ -11,9 +33,9 @@ export interface ProtocolVersionProtoMsg { value: Uint8Array; } export interface ProtocolVersionAmino { - p2p: string; - block: string; - app: string; + p2p?: string; + block?: string; + app?: string; } export interface ProtocolVersionAminoMsg { type: "/tendermint.p2p.ProtocolVersion"; @@ -24,113 +46,151 @@ export interface ProtocolVersionSDKType { block: bigint; app: bigint; } -export interface NodeInfo { +export interface DefaultNodeInfo { protocolVersion: ProtocolVersion; - nodeId: string; + defaultNodeId: string; listenAddr: string; network: string; version: string; channels: Uint8Array; moniker: string; - other: NodeInfoOther; + other: DefaultNodeInfoOther; } -export interface NodeInfoProtoMsg { - typeUrl: "/tendermint.p2p.NodeInfo"; +export interface DefaultNodeInfoProtoMsg { + typeUrl: "/tendermint.p2p.DefaultNodeInfo"; value: Uint8Array; } -export interface NodeInfoAmino { +export interface DefaultNodeInfoAmino { protocol_version?: ProtocolVersionAmino; - node_id: string; - listen_addr: string; - network: string; - version: string; - channels: Uint8Array; - moniker: string; - other?: NodeInfoOtherAmino; + default_node_id?: string; + listen_addr?: string; + network?: string; + version?: string; + channels?: string; + moniker?: string; + other?: DefaultNodeInfoOtherAmino; } -export interface NodeInfoAminoMsg { - type: "/tendermint.p2p.NodeInfo"; - value: NodeInfoAmino; +export interface DefaultNodeInfoAminoMsg { + type: "/tendermint.p2p.DefaultNodeInfo"; + value: DefaultNodeInfoAmino; } -export interface NodeInfoSDKType { +export interface DefaultNodeInfoSDKType { protocol_version: ProtocolVersionSDKType; - node_id: string; + default_node_id: string; listen_addr: string; network: string; version: string; channels: Uint8Array; moniker: string; - other: NodeInfoOtherSDKType; + other: DefaultNodeInfoOtherSDKType; } -export interface NodeInfoOther { +export interface DefaultNodeInfoOther { txIndex: string; rpcAddress: string; } -export interface NodeInfoOtherProtoMsg { - typeUrl: "/tendermint.p2p.NodeInfoOther"; +export interface DefaultNodeInfoOtherProtoMsg { + typeUrl: "/tendermint.p2p.DefaultNodeInfoOther"; value: Uint8Array; } -export interface NodeInfoOtherAmino { - tx_index: string; - rpc_address: string; +export interface DefaultNodeInfoOtherAmino { + tx_index?: string; + rpc_address?: string; } -export interface NodeInfoOtherAminoMsg { - type: "/tendermint.p2p.NodeInfoOther"; - value: NodeInfoOtherAmino; +export interface DefaultNodeInfoOtherAminoMsg { + type: "/tendermint.p2p.DefaultNodeInfoOther"; + value: DefaultNodeInfoOtherAmino; } -export interface NodeInfoOtherSDKType { +export interface DefaultNodeInfoOtherSDKType { tx_index: string; rpc_address: string; } -export interface PeerInfo { - id: string; - addressInfo: PeerAddressInfo[]; - lastConnected: Date; -} -export interface PeerInfoProtoMsg { - typeUrl: "/tendermint.p2p.PeerInfo"; - value: Uint8Array; -} -export interface PeerInfoAmino { - id: string; - address_info: PeerAddressInfoAmino[]; - last_connected?: Date; -} -export interface PeerInfoAminoMsg { - type: "/tendermint.p2p.PeerInfo"; - value: PeerInfoAmino; -} -export interface PeerInfoSDKType { - id: string; - address_info: PeerAddressInfoSDKType[]; - last_connected: Date; -} -export interface PeerAddressInfo { - address: string; - lastDialSuccess: Date; - lastDialFailure: Date; - dialFailures: number; -} -export interface PeerAddressInfoProtoMsg { - typeUrl: "/tendermint.p2p.PeerAddressInfo"; - value: Uint8Array; -} -export interface PeerAddressInfoAmino { - address: string; - last_dial_success?: Date; - last_dial_failure?: Date; - dial_failures: number; -} -export interface PeerAddressInfoAminoMsg { - type: "/tendermint.p2p.PeerAddressInfo"; - value: PeerAddressInfoAmino; -} -export interface PeerAddressInfoSDKType { - address: string; - last_dial_success: Date; - last_dial_failure: Date; - dial_failures: number; +function createBaseNetAddress(): NetAddress { + return { + id: "", + ip: "", + port: 0 + }; } +export const NetAddress = { + typeUrl: "/tendermint.p2p.NetAddress", + encode(message: NetAddress, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.id !== "") { + writer.uint32(10).string(message.id); + } + if (message.ip !== "") { + writer.uint32(18).string(message.ip); + } + if (message.port !== 0) { + writer.uint32(24).uint32(message.port); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): NetAddress { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseNetAddress(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.id = reader.string(); + break; + case 2: + message.ip = reader.string(); + break; + case 3: + message.port = reader.uint32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): NetAddress { + const message = createBaseNetAddress(); + message.id = object.id ?? ""; + message.ip = object.ip ?? ""; + message.port = object.port ?? 0; + return message; + }, + fromAmino(object: NetAddressAmino): NetAddress { + const message = createBaseNetAddress(); + if (object.id !== undefined && object.id !== null) { + message.id = object.id; + } + if (object.ip !== undefined && object.ip !== null) { + message.ip = object.ip; + } + if (object.port !== undefined && object.port !== null) { + message.port = object.port; + } + return message; + }, + toAmino(message: NetAddress): NetAddressAmino { + const obj: any = {}; + obj.id = message.id; + obj.ip = message.ip; + obj.port = message.port; + return obj; + }, + fromAminoMsg(object: NetAddressAminoMsg): NetAddress { + return NetAddress.fromAmino(object.value); + }, + fromProtoMsg(message: NetAddressProtoMsg): NetAddress { + return NetAddress.decode(message.value); + }, + toProto(message: NetAddress): Uint8Array { + return NetAddress.encode(message).finish(); + }, + toProtoMsg(message: NetAddress): NetAddressProtoMsg { + return { + typeUrl: "/tendermint.p2p.NetAddress", + value: NetAddress.encode(message).finish() + }; + } +}; function createBaseProtocolVersion(): ProtocolVersion { return { p2p: BigInt(0), @@ -183,11 +243,17 @@ export const ProtocolVersion = { return message; }, fromAmino(object: ProtocolVersionAmino): ProtocolVersion { - return { - p2p: BigInt(object.p2p), - block: BigInt(object.block), - app: BigInt(object.app) - }; + const message = createBaseProtocolVersion(); + if (object.p2p !== undefined && object.p2p !== null) { + message.p2p = BigInt(object.p2p); + } + if (object.block !== undefined && object.block !== null) { + message.block = BigInt(object.block); + } + if (object.app !== undefined && object.app !== null) { + message.app = BigInt(object.app); + } + return message; }, toAmino(message: ProtocolVersion): ProtocolVersionAmino { const obj: any = {}; @@ -212,26 +278,26 @@ export const ProtocolVersion = { }; } }; -function createBaseNodeInfo(): NodeInfo { +function createBaseDefaultNodeInfo(): DefaultNodeInfo { return { protocolVersion: ProtocolVersion.fromPartial({}), - nodeId: "", + defaultNodeId: "", listenAddr: "", network: "", version: "", channels: new Uint8Array(), moniker: "", - other: NodeInfoOther.fromPartial({}) + other: DefaultNodeInfoOther.fromPartial({}) }; } -export const NodeInfo = { - typeUrl: "/tendermint.p2p.NodeInfo", - encode(message: NodeInfo, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { +export const DefaultNodeInfo = { + typeUrl: "/tendermint.p2p.DefaultNodeInfo", + encode(message: DefaultNodeInfo, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.protocolVersion !== undefined) { ProtocolVersion.encode(message.protocolVersion, writer.uint32(10).fork()).ldelim(); } - if (message.nodeId !== "") { - writer.uint32(18).string(message.nodeId); + if (message.defaultNodeId !== "") { + writer.uint32(18).string(message.defaultNodeId); } if (message.listenAddr !== "") { writer.uint32(26).string(message.listenAddr); @@ -249,14 +315,14 @@ export const NodeInfo = { writer.uint32(58).string(message.moniker); } if (message.other !== undefined) { - NodeInfoOther.encode(message.other, writer.uint32(66).fork()).ldelim(); + DefaultNodeInfoOther.encode(message.other, writer.uint32(66).fork()).ldelim(); } return writer; }, - decode(input: BinaryReader | Uint8Array, length?: number): NodeInfo { + decode(input: BinaryReader | Uint8Array, length?: number): DefaultNodeInfo { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseNodeInfo(); + const message = createBaseDefaultNodeInfo(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -264,7 +330,7 @@ export const NodeInfo = { message.protocolVersion = ProtocolVersion.decode(reader, reader.uint32()); break; case 2: - message.nodeId = reader.string(); + message.defaultNodeId = reader.string(); break; case 3: message.listenAddr = reader.string(); @@ -282,7 +348,7 @@ export const NodeInfo = { message.moniker = reader.string(); break; case 8: - message.other = NodeInfoOther.decode(reader, reader.uint32()); + message.other = DefaultNodeInfoOther.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -291,67 +357,83 @@ export const NodeInfo = { } return message; }, - fromPartial(object: Partial): NodeInfo { - const message = createBaseNodeInfo(); + fromPartial(object: Partial): DefaultNodeInfo { + const message = createBaseDefaultNodeInfo(); message.protocolVersion = object.protocolVersion !== undefined && object.protocolVersion !== null ? ProtocolVersion.fromPartial(object.protocolVersion) : undefined; - message.nodeId = object.nodeId ?? ""; + 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 ? NodeInfoOther.fromPartial(object.other) : undefined; + message.other = object.other !== undefined && object.other !== null ? DefaultNodeInfoOther.fromPartial(object.other) : undefined; return message; }, - fromAmino(object: NodeInfoAmino): NodeInfo { - return { - protocolVersion: object?.protocol_version ? ProtocolVersion.fromAmino(object.protocol_version) : undefined, - nodeId: object.node_id, - listenAddr: object.listen_addr, - network: object.network, - version: object.version, - channels: object.channels, - moniker: object.moniker, - other: object?.other ? NodeInfoOther.fromAmino(object.other) : undefined - }; + fromAmino(object: DefaultNodeInfoAmino): DefaultNodeInfo { + const message = createBaseDefaultNodeInfo(); + if (object.protocol_version !== undefined && object.protocol_version !== null) { + message.protocolVersion = ProtocolVersion.fromAmino(object.protocol_version); + } + if (object.default_node_id !== undefined && object.default_node_id !== null) { + message.defaultNodeId = object.default_node_id; + } + if (object.listen_addr !== undefined && object.listen_addr !== null) { + message.listenAddr = object.listen_addr; + } + if (object.network !== undefined && object.network !== null) { + message.network = object.network; + } + if (object.version !== undefined && object.version !== null) { + message.version = object.version; + } + if (object.channels !== undefined && object.channels !== null) { + message.channels = bytesFromBase64(object.channels); + } + if (object.moniker !== undefined && object.moniker !== null) { + message.moniker = object.moniker; + } + if (object.other !== undefined && object.other !== null) { + message.other = DefaultNodeInfoOther.fromAmino(object.other); + } + return message; }, - toAmino(message: NodeInfo): NodeInfoAmino { + toAmino(message: DefaultNodeInfo): DefaultNodeInfoAmino { const obj: any = {}; obj.protocol_version = message.protocolVersion ? ProtocolVersion.toAmino(message.protocolVersion) : undefined; - obj.node_id = message.nodeId; + obj.default_node_id = message.defaultNodeId; obj.listen_addr = message.listenAddr; obj.network = message.network; obj.version = message.version; - obj.channels = message.channels; + obj.channels = message.channels ? base64FromBytes(message.channels) : undefined; obj.moniker = message.moniker; - obj.other = message.other ? NodeInfoOther.toAmino(message.other) : undefined; + obj.other = message.other ? DefaultNodeInfoOther.toAmino(message.other) : undefined; return obj; }, - fromAminoMsg(object: NodeInfoAminoMsg): NodeInfo { - return NodeInfo.fromAmino(object.value); + fromAminoMsg(object: DefaultNodeInfoAminoMsg): DefaultNodeInfo { + return DefaultNodeInfo.fromAmino(object.value); }, - fromProtoMsg(message: NodeInfoProtoMsg): NodeInfo { - return NodeInfo.decode(message.value); + fromProtoMsg(message: DefaultNodeInfoProtoMsg): DefaultNodeInfo { + return DefaultNodeInfo.decode(message.value); }, - toProto(message: NodeInfo): Uint8Array { - return NodeInfo.encode(message).finish(); + toProto(message: DefaultNodeInfo): Uint8Array { + return DefaultNodeInfo.encode(message).finish(); }, - toProtoMsg(message: NodeInfo): NodeInfoProtoMsg { + toProtoMsg(message: DefaultNodeInfo): DefaultNodeInfoProtoMsg { return { - typeUrl: "/tendermint.p2p.NodeInfo", - value: NodeInfo.encode(message).finish() + typeUrl: "/tendermint.p2p.DefaultNodeInfo", + value: DefaultNodeInfo.encode(message).finish() }; } }; -function createBaseNodeInfoOther(): NodeInfoOther { +function createBaseDefaultNodeInfoOther(): DefaultNodeInfoOther { return { txIndex: "", rpcAddress: "" }; } -export const NodeInfoOther = { - typeUrl: "/tendermint.p2p.NodeInfoOther", - encode(message: NodeInfoOther, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { +export const DefaultNodeInfoOther = { + typeUrl: "/tendermint.p2p.DefaultNodeInfoOther", + encode(message: DefaultNodeInfoOther, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.txIndex !== "") { writer.uint32(10).string(message.txIndex); } @@ -360,10 +442,10 @@ export const NodeInfoOther = { } return writer; }, - decode(input: BinaryReader | Uint8Array, length?: number): NodeInfoOther { + decode(input: BinaryReader | Uint8Array, length?: number): DefaultNodeInfoOther { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseNodeInfoOther(); + const message = createBaseDefaultNodeInfoOther(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -380,213 +462,41 @@ export const NodeInfoOther = { } return message; }, - fromPartial(object: Partial): NodeInfoOther { - const message = createBaseNodeInfoOther(); + fromPartial(object: Partial): DefaultNodeInfoOther { + const message = createBaseDefaultNodeInfoOther(); message.txIndex = object.txIndex ?? ""; message.rpcAddress = object.rpcAddress ?? ""; return message; }, - fromAmino(object: NodeInfoOtherAmino): NodeInfoOther { - return { - txIndex: object.tx_index, - rpcAddress: object.rpc_address - }; - }, - toAmino(message: NodeInfoOther): NodeInfoOtherAmino { - const obj: any = {}; - obj.tx_index = message.txIndex; - obj.rpc_address = message.rpcAddress; - return obj; - }, - fromAminoMsg(object: NodeInfoOtherAminoMsg): NodeInfoOther { - return NodeInfoOther.fromAmino(object.value); - }, - fromProtoMsg(message: NodeInfoOtherProtoMsg): NodeInfoOther { - return NodeInfoOther.decode(message.value); - }, - toProto(message: NodeInfoOther): Uint8Array { - return NodeInfoOther.encode(message).finish(); - }, - toProtoMsg(message: NodeInfoOther): NodeInfoOtherProtoMsg { - return { - typeUrl: "/tendermint.p2p.NodeInfoOther", - value: NodeInfoOther.encode(message).finish() - }; - } -}; -function createBasePeerInfo(): PeerInfo { - return { - id: "", - addressInfo: [], - lastConnected: new Date() - }; -} -export const PeerInfo = { - typeUrl: "/tendermint.p2p.PeerInfo", - encode(message: PeerInfo, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { - if (message.id !== "") { - writer.uint32(10).string(message.id); + fromAmino(object: DefaultNodeInfoOtherAmino): DefaultNodeInfoOther { + const message = createBaseDefaultNodeInfoOther(); + if (object.tx_index !== undefined && object.tx_index !== null) { + message.txIndex = object.tx_index; } - for (const v of message.addressInfo) { - PeerAddressInfo.encode(v!, writer.uint32(18).fork()).ldelim(); - } - if (message.lastConnected !== undefined) { - Timestamp.encode(toTimestamp(message.lastConnected), writer.uint32(26).fork()).ldelim(); - } - return writer; - }, - decode(input: BinaryReader | Uint8Array, length?: number): PeerInfo { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBasePeerInfo(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.id = reader.string(); - break; - case 2: - message.addressInfo.push(PeerAddressInfo.decode(reader, reader.uint32())); - break; - case 3: - message.lastConnected = fromTimestamp(Timestamp.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } + if (object.rpc_address !== undefined && object.rpc_address !== null) { + message.rpcAddress = object.rpc_address; } return message; }, - fromPartial(object: Partial): PeerInfo { - const message = createBasePeerInfo(); - message.id = object.id ?? ""; - message.addressInfo = object.addressInfo?.map(e => PeerAddressInfo.fromPartial(e)) || []; - message.lastConnected = object.lastConnected ?? undefined; - return message; - }, - fromAmino(object: PeerInfoAmino): PeerInfo { - return { - id: object.id, - addressInfo: Array.isArray(object?.address_info) ? object.address_info.map((e: any) => PeerAddressInfo.fromAmino(e)) : [], - lastConnected: object.last_connected - }; - }, - toAmino(message: PeerInfo): PeerInfoAmino { + toAmino(message: DefaultNodeInfoOther): DefaultNodeInfoOtherAmino { const obj: any = {}; - obj.id = message.id; - if (message.addressInfo) { - obj.address_info = message.addressInfo.map(e => e ? PeerAddressInfo.toAmino(e) : undefined); - } else { - obj.address_info = []; - } - obj.last_connected = message.lastConnected; - return obj; - }, - fromAminoMsg(object: PeerInfoAminoMsg): PeerInfo { - return PeerInfo.fromAmino(object.value); - }, - fromProtoMsg(message: PeerInfoProtoMsg): PeerInfo { - return PeerInfo.decode(message.value); - }, - toProto(message: PeerInfo): Uint8Array { - return PeerInfo.encode(message).finish(); - }, - toProtoMsg(message: PeerInfo): PeerInfoProtoMsg { - return { - typeUrl: "/tendermint.p2p.PeerInfo", - value: PeerInfo.encode(message).finish() - }; - } -}; -function createBasePeerAddressInfo(): PeerAddressInfo { - return { - address: "", - lastDialSuccess: new Date(), - lastDialFailure: new Date(), - dialFailures: 0 - }; -} -export const PeerAddressInfo = { - typeUrl: "/tendermint.p2p.PeerAddressInfo", - encode(message: PeerAddressInfo, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { - if (message.address !== "") { - writer.uint32(10).string(message.address); - } - if (message.lastDialSuccess !== undefined) { - Timestamp.encode(toTimestamp(message.lastDialSuccess), writer.uint32(18).fork()).ldelim(); - } - if (message.lastDialFailure !== undefined) { - Timestamp.encode(toTimestamp(message.lastDialFailure), writer.uint32(26).fork()).ldelim(); - } - if (message.dialFailures !== 0) { - writer.uint32(32).uint32(message.dialFailures); - } - return writer; - }, - decode(input: BinaryReader | Uint8Array, length?: number): PeerAddressInfo { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBasePeerAddressInfo(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.address = reader.string(); - break; - case 2: - message.lastDialSuccess = fromTimestamp(Timestamp.decode(reader, reader.uint32())); - break; - case 3: - message.lastDialFailure = fromTimestamp(Timestamp.decode(reader, reader.uint32())); - break; - case 4: - message.dialFailures = reader.uint32(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - fromPartial(object: Partial): PeerAddressInfo { - const message = createBasePeerAddressInfo(); - message.address = object.address ?? ""; - message.lastDialSuccess = object.lastDialSuccess ?? undefined; - message.lastDialFailure = object.lastDialFailure ?? undefined; - message.dialFailures = object.dialFailures ?? 0; - return message; - }, - fromAmino(object: PeerAddressInfoAmino): PeerAddressInfo { - return { - address: object.address, - lastDialSuccess: object.last_dial_success, - lastDialFailure: object.last_dial_failure, - dialFailures: object.dial_failures - }; - }, - toAmino(message: PeerAddressInfo): PeerAddressInfoAmino { - const obj: any = {}; - obj.address = message.address; - obj.last_dial_success = message.lastDialSuccess; - obj.last_dial_failure = message.lastDialFailure; - obj.dial_failures = message.dialFailures; + obj.tx_index = message.txIndex; + obj.rpc_address = message.rpcAddress; return obj; }, - fromAminoMsg(object: PeerAddressInfoAminoMsg): PeerAddressInfo { - return PeerAddressInfo.fromAmino(object.value); + fromAminoMsg(object: DefaultNodeInfoOtherAminoMsg): DefaultNodeInfoOther { + return DefaultNodeInfoOther.fromAmino(object.value); }, - fromProtoMsg(message: PeerAddressInfoProtoMsg): PeerAddressInfo { - return PeerAddressInfo.decode(message.value); + fromProtoMsg(message: DefaultNodeInfoOtherProtoMsg): DefaultNodeInfoOther { + return DefaultNodeInfoOther.decode(message.value); }, - toProto(message: PeerAddressInfo): Uint8Array { - return PeerAddressInfo.encode(message).finish(); + toProto(message: DefaultNodeInfoOther): Uint8Array { + return DefaultNodeInfoOther.encode(message).finish(); }, - toProtoMsg(message: PeerAddressInfo): PeerAddressInfoProtoMsg { + toProtoMsg(message: DefaultNodeInfoOther): DefaultNodeInfoOtherProtoMsg { return { - typeUrl: "/tendermint.p2p.PeerAddressInfo", - value: PeerAddressInfo.encode(message).finish() + typeUrl: "/tendermint.p2p.DefaultNodeInfoOther", + value: DefaultNodeInfoOther.encode(message).finish() }; } }; \ No newline at end of file diff --git a/packages/osmo-query/src/codegen/tendermint/types/block.ts b/packages/osmo-query/src/codegen/tendermint/types/block.ts index 737ce34f1..08b90c5bb 100644 --- a/packages/osmo-query/src/codegen/tendermint/types/block.ts +++ b/packages/osmo-query/src/codegen/tendermint/types/block.ts @@ -5,7 +5,7 @@ export interface Block { header: Header; data: Data; evidence: EvidenceList; - lastCommit: Commit; + lastCommit?: Commit; } export interface BlockProtoMsg { typeUrl: "/tendermint.types.Block"; @@ -25,14 +25,14 @@ export interface BlockSDKType { header: HeaderSDKType; data: DataSDKType; evidence: EvidenceListSDKType; - last_commit: CommitSDKType; + last_commit?: CommitSDKType; } function createBaseBlock(): Block { return { header: Header.fromPartial({}), data: Data.fromPartial({}), evidence: EvidenceList.fromPartial({}), - lastCommit: Commit.fromPartial({}) + lastCommit: undefined }; } export const Block = { @@ -87,12 +87,20 @@ export const Block = { return message; }, fromAmino(object: BlockAmino): Block { - return { - header: object?.header ? Header.fromAmino(object.header) : undefined, - data: object?.data ? Data.fromAmino(object.data) : undefined, - evidence: object?.evidence ? EvidenceList.fromAmino(object.evidence) : undefined, - lastCommit: object?.last_commit ? Commit.fromAmino(object.last_commit) : undefined - }; + const message = createBaseBlock(); + if (object.header !== undefined && object.header !== null) { + message.header = Header.fromAmino(object.header); + } + if (object.data !== undefined && object.data !== null) { + message.data = Data.fromAmino(object.data); + } + if (object.evidence !== undefined && object.evidence !== null) { + message.evidence = EvidenceList.fromAmino(object.evidence); + } + if (object.last_commit !== undefined && object.last_commit !== null) { + message.lastCommit = Commit.fromAmino(object.last_commit); + } + return message; }, toAmino(message: Block): BlockAmino { const obj: any = {}; diff --git a/packages/osmo-query/src/codegen/tendermint/types/evidence.ts b/packages/osmo-query/src/codegen/tendermint/types/evidence.ts index 9827d4587..e51429d11 100644 --- a/packages/osmo-query/src/codegen/tendermint/types/evidence.ts +++ b/packages/osmo-query/src/codegen/tendermint/types/evidence.ts @@ -25,8 +25,8 @@ export interface EvidenceSDKType { } /** DuplicateVoteEvidence contains evidence of a validator signed two conflicting votes. */ export interface DuplicateVoteEvidence { - voteA: Vote; - voteB: Vote; + voteA?: Vote; + voteB?: Vote; totalVotingPower: bigint; validatorPower: bigint; timestamp: Date; @@ -39,9 +39,9 @@ export interface DuplicateVoteEvidenceProtoMsg { export interface DuplicateVoteEvidenceAmino { vote_a?: VoteAmino; vote_b?: VoteAmino; - total_voting_power: string; - validator_power: string; - timestamp?: Date; + total_voting_power?: string; + validator_power?: string; + timestamp?: string; } export interface DuplicateVoteEvidenceAminoMsg { type: "/tendermint.types.DuplicateVoteEvidence"; @@ -49,15 +49,15 @@ export interface DuplicateVoteEvidenceAminoMsg { } /** DuplicateVoteEvidence contains evidence of a validator signed two conflicting votes. */ export interface DuplicateVoteEvidenceSDKType { - vote_a: VoteSDKType; - vote_b: VoteSDKType; + vote_a?: VoteSDKType; + vote_b?: VoteSDKType; total_voting_power: bigint; validator_power: bigint; timestamp: Date; } /** LightClientAttackEvidence contains evidence of a set of validators attempting to mislead a light client. */ export interface LightClientAttackEvidence { - conflictingBlock: LightBlock; + conflictingBlock?: LightBlock; commonHeight: bigint; byzantineValidators: Validator[]; totalVotingPower: bigint; @@ -70,10 +70,10 @@ export interface LightClientAttackEvidenceProtoMsg { /** LightClientAttackEvidence contains evidence of a set of validators attempting to mislead a light client. */ export interface LightClientAttackEvidenceAmino { conflicting_block?: LightBlockAmino; - common_height: string; - byzantine_validators: ValidatorAmino[]; - total_voting_power: string; - timestamp?: Date; + common_height?: string; + byzantine_validators?: ValidatorAmino[]; + total_voting_power?: string; + timestamp?: string; } export interface LightClientAttackEvidenceAminoMsg { type: "/tendermint.types.LightClientAttackEvidence"; @@ -81,7 +81,7 @@ export interface LightClientAttackEvidenceAminoMsg { } /** LightClientAttackEvidence contains evidence of a set of validators attempting to mislead a light client. */ export interface LightClientAttackEvidenceSDKType { - conflicting_block: LightBlockSDKType; + conflicting_block?: LightBlockSDKType; common_height: bigint; byzantine_validators: ValidatorSDKType[]; total_voting_power: bigint; @@ -95,7 +95,7 @@ export interface EvidenceListProtoMsg { value: Uint8Array; } export interface EvidenceListAmino { - evidence: EvidenceAmino[]; + evidence?: EvidenceAmino[]; } export interface EvidenceListAminoMsg { type: "/tendermint.types.EvidenceList"; @@ -148,10 +148,14 @@ export const Evidence = { return message; }, fromAmino(object: EvidenceAmino): Evidence { - return { - duplicateVoteEvidence: object?.duplicate_vote_evidence ? DuplicateVoteEvidence.fromAmino(object.duplicate_vote_evidence) : undefined, - lightClientAttackEvidence: object?.light_client_attack_evidence ? LightClientAttackEvidence.fromAmino(object.light_client_attack_evidence) : undefined - }; + const message = createBaseEvidence(); + if (object.duplicate_vote_evidence !== undefined && object.duplicate_vote_evidence !== null) { + message.duplicateVoteEvidence = DuplicateVoteEvidence.fromAmino(object.duplicate_vote_evidence); + } + if (object.light_client_attack_evidence !== undefined && object.light_client_attack_evidence !== null) { + message.lightClientAttackEvidence = LightClientAttackEvidence.fromAmino(object.light_client_attack_evidence); + } + return message; }, toAmino(message: Evidence): EvidenceAmino { const obj: any = {}; @@ -177,8 +181,8 @@ export const Evidence = { }; function createBaseDuplicateVoteEvidence(): DuplicateVoteEvidence { return { - voteA: Vote.fromPartial({}), - voteB: Vote.fromPartial({}), + voteA: undefined, + voteB: undefined, totalVotingPower: BigInt(0), validatorPower: BigInt(0), timestamp: new Date() @@ -243,13 +247,23 @@ export const DuplicateVoteEvidence = { return message; }, fromAmino(object: DuplicateVoteEvidenceAmino): DuplicateVoteEvidence { - return { - voteA: object?.vote_a ? Vote.fromAmino(object.vote_a) : undefined, - voteB: object?.vote_b ? Vote.fromAmino(object.vote_b) : undefined, - totalVotingPower: BigInt(object.total_voting_power), - validatorPower: BigInt(object.validator_power), - timestamp: object.timestamp - }; + const message = createBaseDuplicateVoteEvidence(); + if (object.vote_a !== undefined && object.vote_a !== null) { + message.voteA = Vote.fromAmino(object.vote_a); + } + if (object.vote_b !== undefined && object.vote_b !== null) { + message.voteB = Vote.fromAmino(object.vote_b); + } + if (object.total_voting_power !== undefined && object.total_voting_power !== null) { + message.totalVotingPower = BigInt(object.total_voting_power); + } + if (object.validator_power !== undefined && object.validator_power !== null) { + message.validatorPower = BigInt(object.validator_power); + } + if (object.timestamp !== undefined && object.timestamp !== null) { + message.timestamp = fromTimestamp(Timestamp.fromAmino(object.timestamp)); + } + return message; }, toAmino(message: DuplicateVoteEvidence): DuplicateVoteEvidenceAmino { const obj: any = {}; @@ -257,7 +271,7 @@ export const DuplicateVoteEvidence = { obj.vote_b = message.voteB ? Vote.toAmino(message.voteB) : undefined; obj.total_voting_power = message.totalVotingPower ? message.totalVotingPower.toString() : undefined; obj.validator_power = message.validatorPower ? message.validatorPower.toString() : undefined; - obj.timestamp = message.timestamp; + obj.timestamp = message.timestamp ? Timestamp.toAmino(toTimestamp(message.timestamp)) : undefined; return obj; }, fromAminoMsg(object: DuplicateVoteEvidenceAminoMsg): DuplicateVoteEvidence { @@ -278,7 +292,7 @@ export const DuplicateVoteEvidence = { }; function createBaseLightClientAttackEvidence(): LightClientAttackEvidence { return { - conflictingBlock: LightBlock.fromPartial({}), + conflictingBlock: undefined, commonHeight: BigInt(0), byzantineValidators: [], totalVotingPower: BigInt(0), @@ -344,13 +358,21 @@ export const LightClientAttackEvidence = { return message; }, fromAmino(object: LightClientAttackEvidenceAmino): LightClientAttackEvidence { - return { - conflictingBlock: object?.conflicting_block ? LightBlock.fromAmino(object.conflicting_block) : undefined, - commonHeight: BigInt(object.common_height), - byzantineValidators: Array.isArray(object?.byzantine_validators) ? object.byzantine_validators.map((e: any) => Validator.fromAmino(e)) : [], - totalVotingPower: BigInt(object.total_voting_power), - timestamp: object.timestamp - }; + const message = createBaseLightClientAttackEvidence(); + if (object.conflicting_block !== undefined && object.conflicting_block !== null) { + message.conflictingBlock = LightBlock.fromAmino(object.conflicting_block); + } + if (object.common_height !== undefined && object.common_height !== null) { + message.commonHeight = BigInt(object.common_height); + } + message.byzantineValidators = object.byzantine_validators?.map(e => Validator.fromAmino(e)) || []; + if (object.total_voting_power !== undefined && object.total_voting_power !== null) { + message.totalVotingPower = BigInt(object.total_voting_power); + } + if (object.timestamp !== undefined && object.timestamp !== null) { + message.timestamp = fromTimestamp(Timestamp.fromAmino(object.timestamp)); + } + return message; }, toAmino(message: LightClientAttackEvidence): LightClientAttackEvidenceAmino { const obj: any = {}; @@ -362,7 +384,7 @@ export const LightClientAttackEvidence = { obj.byzantine_validators = []; } obj.total_voting_power = message.totalVotingPower ? message.totalVotingPower.toString() : undefined; - obj.timestamp = message.timestamp; + obj.timestamp = message.timestamp ? Timestamp.toAmino(toTimestamp(message.timestamp)) : undefined; return obj; }, fromAminoMsg(object: LightClientAttackEvidenceAminoMsg): LightClientAttackEvidence { @@ -417,9 +439,9 @@ export const EvidenceList = { return message; }, fromAmino(object: EvidenceListAmino): EvidenceList { - return { - evidence: Array.isArray(object?.evidence) ? object.evidence.map((e: any) => Evidence.fromAmino(e)) : [] - }; + const message = createBaseEvidenceList(); + message.evidence = object.evidence?.map(e => Evidence.fromAmino(e)) || []; + return message; }, toAmino(message: EvidenceList): EvidenceListAmino { const obj: any = {}; diff --git a/packages/osmo-query/src/codegen/tendermint/types/params.ts b/packages/osmo-query/src/codegen/tendermint/types/params.ts index f321ae3e5..6e027a221 100644 --- a/packages/osmo-query/src/codegen/tendermint/types/params.ts +++ b/packages/osmo-query/src/codegen/tendermint/types/params.ts @@ -5,10 +5,10 @@ import { BinaryReader, BinaryWriter } from "../../binary"; * validity of blocks. */ export interface ConsensusParams { - block: BlockParams; - evidence: EvidenceParams; - validator: ValidatorParams; - version: VersionParams; + block?: BlockParams; + evidence?: EvidenceParams; + validator?: ValidatorParams; + version?: VersionParams; } export interface ConsensusParamsProtoMsg { typeUrl: "/tendermint.types.ConsensusParams"; @@ -33,10 +33,10 @@ export interface ConsensusParamsAminoMsg { * validity of blocks. */ export interface ConsensusParamsSDKType { - block: BlockParamsSDKType; - evidence: EvidenceParamsSDKType; - validator: ValidatorParamsSDKType; - version: VersionParamsSDKType; + block?: BlockParamsSDKType; + evidence?: EvidenceParamsSDKType; + validator?: ValidatorParamsSDKType; + version?: VersionParamsSDKType; } /** BlockParams contains limits on the block size. */ export interface BlockParams { @@ -50,13 +50,6 @@ export interface BlockParams { * Note: must be greater or equal to -1 */ maxGas: bigint; - /** - * 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: bigint; } export interface BlockParamsProtoMsg { typeUrl: "/tendermint.types.BlockParams"; @@ -68,19 +61,12 @@ export interface BlockParamsAmino { * Max block size, in bytes. * Note: must be greater than 0 */ - max_bytes: string; + max_bytes?: string; /** * Max gas per block. * Note: must be greater or equal to -1 */ - max_gas: string; - /** - * 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. - */ - time_iota_ms: string; + max_gas?: string; } export interface BlockParamsAminoMsg { type: "/tendermint.types.BlockParams"; @@ -90,7 +76,6 @@ export interface BlockParamsAminoMsg { export interface BlockParamsSDKType { max_bytes: bigint; max_gas: bigint; - time_iota_ms: bigint; } /** EvidenceParams determine how we handle evidence of malfeasance. */ export interface EvidenceParams { @@ -128,7 +113,7 @@ export interface EvidenceParamsAmino { * The basic formula for calculating this is: MaxAgeDuration / {average block * time}. */ - max_age_num_blocks: string; + max_age_num_blocks?: string; /** * Max age of evidence, in time. * @@ -142,7 +127,7 @@ export interface EvidenceParamsAmino { * and should fall comfortably under the max block bytes. * Default is 1048576 or 1MB */ - max_bytes: string; + max_bytes?: string; } export interface EvidenceParamsAminoMsg { type: "/tendermint.types.EvidenceParams"; @@ -170,7 +155,7 @@ export interface ValidatorParamsProtoMsg { * NOTE: uses ABCI pubkey naming, not Amino names. */ export interface ValidatorParamsAmino { - pub_key_types: string[]; + pub_key_types?: string[]; } export interface ValidatorParamsAminoMsg { type: "/tendermint.types.ValidatorParams"; @@ -185,7 +170,7 @@ export interface ValidatorParamsSDKType { } /** VersionParams contains the ABCI application version. */ export interface VersionParams { - appVersion: bigint; + app: bigint; } export interface VersionParamsProtoMsg { typeUrl: "/tendermint.types.VersionParams"; @@ -193,7 +178,7 @@ export interface VersionParamsProtoMsg { } /** VersionParams contains the ABCI application version. */ export interface VersionParamsAmino { - app_version: string; + app?: string; } export interface VersionParamsAminoMsg { type: "/tendermint.types.VersionParams"; @@ -201,7 +186,7 @@ export interface VersionParamsAminoMsg { } /** VersionParams contains the ABCI application version. */ export interface VersionParamsSDKType { - app_version: bigint; + app: bigint; } /** * HashedParams is a subset of ConsensusParams. @@ -222,8 +207,8 @@ export interface HashedParamsProtoMsg { * It is hashed into the Header.ConsensusHash. */ export interface HashedParamsAmino { - block_max_bytes: string; - block_max_gas: string; + block_max_bytes?: string; + block_max_gas?: string; } export interface HashedParamsAminoMsg { type: "/tendermint.types.HashedParams"; @@ -240,10 +225,10 @@ export interface HashedParamsSDKType { } function createBaseConsensusParams(): ConsensusParams { return { - block: BlockParams.fromPartial({}), - evidence: EvidenceParams.fromPartial({}), - validator: ValidatorParams.fromPartial({}), - version: VersionParams.fromPartial({}) + block: undefined, + evidence: undefined, + validator: undefined, + version: undefined }; } export const ConsensusParams = { @@ -298,12 +283,20 @@ export const ConsensusParams = { return message; }, fromAmino(object: ConsensusParamsAmino): ConsensusParams { - return { - block: object?.block ? BlockParams.fromAmino(object.block) : undefined, - evidence: object?.evidence ? EvidenceParams.fromAmino(object.evidence) : undefined, - validator: object?.validator ? ValidatorParams.fromAmino(object.validator) : undefined, - version: object?.version ? VersionParams.fromAmino(object.version) : undefined - }; + const message = createBaseConsensusParams(); + if (object.block !== undefined && object.block !== null) { + message.block = BlockParams.fromAmino(object.block); + } + if (object.evidence !== undefined && object.evidence !== null) { + message.evidence = EvidenceParams.fromAmino(object.evidence); + } + if (object.validator !== undefined && object.validator !== null) { + message.validator = ValidatorParams.fromAmino(object.validator); + } + if (object.version !== undefined && object.version !== null) { + message.version = VersionParams.fromAmino(object.version); + } + return message; }, toAmino(message: ConsensusParams): ConsensusParamsAmino { const obj: any = {}; @@ -332,8 +325,7 @@ export const ConsensusParams = { function createBaseBlockParams(): BlockParams { return { maxBytes: BigInt(0), - maxGas: BigInt(0), - timeIotaMs: BigInt(0) + maxGas: BigInt(0) }; } export const BlockParams = { @@ -345,9 +337,6 @@ export const BlockParams = { if (message.maxGas !== BigInt(0)) { writer.uint32(16).int64(message.maxGas); } - if (message.timeIotaMs !== BigInt(0)) { - writer.uint32(24).int64(message.timeIotaMs); - } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): BlockParams { @@ -363,9 +352,6 @@ export const BlockParams = { case 2: message.maxGas = reader.int64(); break; - case 3: - message.timeIotaMs = reader.int64(); - break; default: reader.skipType(tag & 7); break; @@ -377,21 +363,22 @@ export const BlockParams = { const message = createBaseBlockParams(); message.maxBytes = object.maxBytes !== undefined && object.maxBytes !== null ? BigInt(object.maxBytes.toString()) : BigInt(0); message.maxGas = object.maxGas !== undefined && object.maxGas !== null ? BigInt(object.maxGas.toString()) : BigInt(0); - message.timeIotaMs = object.timeIotaMs !== undefined && object.timeIotaMs !== null ? BigInt(object.timeIotaMs.toString()) : BigInt(0); return message; }, fromAmino(object: BlockParamsAmino): BlockParams { - return { - maxBytes: BigInt(object.max_bytes), - maxGas: BigInt(object.max_gas), - timeIotaMs: BigInt(object.time_iota_ms) - }; + const message = createBaseBlockParams(); + if (object.max_bytes !== undefined && object.max_bytes !== null) { + message.maxBytes = BigInt(object.max_bytes); + } + if (object.max_gas !== undefined && object.max_gas !== null) { + message.maxGas = BigInt(object.max_gas); + } + return message; }, toAmino(message: BlockParams): BlockParamsAmino { const obj: any = {}; obj.max_bytes = message.maxBytes ? message.maxBytes.toString() : undefined; obj.max_gas = message.maxGas ? message.maxGas.toString() : undefined; - obj.time_iota_ms = message.timeIotaMs ? message.timeIotaMs.toString() : undefined; return obj; }, fromAminoMsg(object: BlockParamsAminoMsg): BlockParams { @@ -462,11 +449,17 @@ export const EvidenceParams = { return message; }, fromAmino(object: EvidenceParamsAmino): EvidenceParams { - return { - maxAgeNumBlocks: BigInt(object.max_age_num_blocks), - maxAgeDuration: object?.max_age_duration ? Duration.fromAmino(object.max_age_duration) : undefined, - maxBytes: BigInt(object.max_bytes) - }; + const message = createBaseEvidenceParams(); + if (object.max_age_num_blocks !== undefined && object.max_age_num_blocks !== null) { + message.maxAgeNumBlocks = BigInt(object.max_age_num_blocks); + } + if (object.max_age_duration !== undefined && object.max_age_duration !== null) { + message.maxAgeDuration = Duration.fromAmino(object.max_age_duration); + } + if (object.max_bytes !== undefined && object.max_bytes !== null) { + message.maxBytes = BigInt(object.max_bytes); + } + return message; }, toAmino(message: EvidenceParams): EvidenceParamsAmino { const obj: any = {}; @@ -527,9 +520,9 @@ export const ValidatorParams = { return message; }, fromAmino(object: ValidatorParamsAmino): ValidatorParams { - return { - pubKeyTypes: Array.isArray(object?.pub_key_types) ? object.pub_key_types.map((e: any) => e) : [] - }; + const message = createBaseValidatorParams(); + message.pubKeyTypes = object.pub_key_types?.map(e => e) || []; + return message; }, toAmino(message: ValidatorParams): ValidatorParamsAmino { const obj: any = {}; @@ -558,14 +551,14 @@ export const ValidatorParams = { }; function createBaseVersionParams(): VersionParams { return { - appVersion: BigInt(0) + app: BigInt(0) }; } export const VersionParams = { typeUrl: "/tendermint.types.VersionParams", encode(message: VersionParams, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { - if (message.appVersion !== BigInt(0)) { - writer.uint32(8).uint64(message.appVersion); + if (message.app !== BigInt(0)) { + writer.uint32(8).uint64(message.app); } return writer; }, @@ -577,7 +570,7 @@ export const VersionParams = { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.appVersion = reader.uint64(); + message.app = reader.uint64(); break; default: reader.skipType(tag & 7); @@ -588,17 +581,19 @@ export const VersionParams = { }, fromPartial(object: Partial): VersionParams { const message = createBaseVersionParams(); - message.appVersion = object.appVersion !== undefined && object.appVersion !== null ? BigInt(object.appVersion.toString()) : BigInt(0); + message.app = object.app !== undefined && object.app !== null ? BigInt(object.app.toString()) : BigInt(0); return message; }, fromAmino(object: VersionParamsAmino): VersionParams { - return { - appVersion: BigInt(object.app_version) - }; + const message = createBaseVersionParams(); + if (object.app !== undefined && object.app !== null) { + message.app = BigInt(object.app); + } + return message; }, toAmino(message: VersionParams): VersionParamsAmino { const obj: any = {}; - obj.app_version = message.appVersion ? message.appVersion.toString() : undefined; + obj.app = message.app ? message.app.toString() : undefined; return obj; }, fromAminoMsg(object: VersionParamsAminoMsg): VersionParams { @@ -661,10 +656,14 @@ export const HashedParams = { return message; }, fromAmino(object: HashedParamsAmino): HashedParams { - return { - blockMaxBytes: BigInt(object.block_max_bytes), - blockMaxGas: BigInt(object.block_max_gas) - }; + const message = createBaseHashedParams(); + if (object.block_max_bytes !== undefined && object.block_max_bytes !== null) { + message.blockMaxBytes = BigInt(object.block_max_bytes); + } + if (object.block_max_gas !== undefined && object.block_max_gas !== null) { + message.blockMaxGas = BigInt(object.block_max_gas); + } + return message; }, toAmino(message: HashedParams): HashedParamsAmino { const obj: any = {}; diff --git a/packages/osmo-query/src/codegen/tendermint/types/types.ts b/packages/osmo-query/src/codegen/tendermint/types/types.ts index ffef5da73..e465024e5 100644 --- a/packages/osmo-query/src/codegen/tendermint/types/types.ts +++ b/packages/osmo-query/src/codegen/tendermint/types/types.ts @@ -3,7 +3,7 @@ import { Consensus, ConsensusAmino, ConsensusSDKType } from "../version/types"; import { Timestamp } from "../../google/protobuf/timestamp"; import { ValidatorSet, ValidatorSetAmino, ValidatorSetSDKType } from "./validator"; import { BinaryReader, BinaryWriter } from "../../binary"; -import { toTimestamp, fromTimestamp, isSet } from "../../helpers"; +import { bytesFromBase64, base64FromBytes, toTimestamp, fromTimestamp } from "../../helpers"; /** BlockIdFlag indicates which BlcokID the signature is for */ export enum BlockIDFlag { BLOCK_ID_FLAG_UNKNOWN = 0, @@ -107,8 +107,8 @@ export interface PartSetHeaderProtoMsg { } /** PartsetHeader */ export interface PartSetHeaderAmino { - total: number; - hash: Uint8Array; + total?: number; + hash?: string; } export interface PartSetHeaderAminoMsg { type: "/tendermint.types.PartSetHeader"; @@ -129,8 +129,8 @@ export interface PartProtoMsg { value: Uint8Array; } export interface PartAmino { - index: number; - bytes: Uint8Array; + index?: number; + bytes?: string; proof?: ProofAmino; } export interface PartAminoMsg { @@ -153,7 +153,7 @@ export interface BlockIDProtoMsg { } /** BlockID */ export interface BlockIDAmino { - hash: Uint8Array; + hash?: string; part_set_header?: PartSetHeaderAmino; } export interface BlockIDAminoMsg { @@ -165,7 +165,7 @@ export interface BlockIDSDKType { hash: Uint8Array; part_set_header: PartSetHeaderSDKType; } -/** Header defines the structure of a Tendermint block header. */ +/** Header defines the structure of a block header. */ export interface Header { /** basic block info */ version: Consensus; @@ -195,37 +195,37 @@ export interface HeaderProtoMsg { typeUrl: "/tendermint.types.Header"; value: Uint8Array; } -/** Header defines the structure of a Tendermint block header. */ +/** Header defines the structure of a block header. */ export interface HeaderAmino { /** basic block info */ version?: ConsensusAmino; - chain_id: string; - height: string; - time?: Date; + chain_id?: string; + height?: string; + time?: string; /** prev block info */ last_block_id?: BlockIDAmino; /** hashes of block data */ - last_commit_hash: Uint8Array; - data_hash: Uint8Array; + last_commit_hash?: string; + data_hash?: string; /** hashes from the app output from the prev block */ - validators_hash: Uint8Array; + validators_hash?: string; /** validators for the next block */ - next_validators_hash: Uint8Array; + next_validators_hash?: string; /** consensus params for current block */ - consensus_hash: Uint8Array; + consensus_hash?: string; /** state after txs from the previous block */ - app_hash: Uint8Array; - last_results_hash: Uint8Array; + app_hash?: string; + last_results_hash?: string; /** consensus info */ - evidence_hash: Uint8Array; + evidence_hash?: string; /** original proposer of the block */ - proposer_address: Uint8Array; + proposer_address?: string; } export interface HeaderAminoMsg { type: "/tendermint.types.Header"; value: HeaderAmino; } -/** Header defines the structure of a Tendermint block header. */ +/** Header defines the structure of a block header. */ export interface HeaderSDKType { version: ConsensusSDKType; chain_id: string; @@ -262,7 +262,7 @@ export interface DataAmino { * 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?: string[]; } export interface DataAminoMsg { type: "/tendermint.types.Data"; @@ -296,15 +296,15 @@ export interface VoteProtoMsg { * consensus. */ export interface VoteAmino { - type: SignedMsgType; - height: string; - round: number; + type?: SignedMsgType; + height?: string; + round?: number; /** zero if vote is nil. */ block_id?: BlockIDAmino; - timestamp?: Date; - validator_address: Uint8Array; - validator_index: number; - signature: Uint8Array; + timestamp?: string; + validator_address?: string; + validator_index?: number; + signature?: string; } export interface VoteAminoMsg { type: "/tendermint.types.Vote"; @@ -337,10 +337,10 @@ export interface CommitProtoMsg { } /** Commit contains the evidence that a block was committed by a set of validators. */ export interface CommitAmino { - height: string; - round: number; + height?: string; + round?: number; block_id?: BlockIDAmino; - signatures: CommitSigAmino[]; + signatures?: CommitSigAmino[]; } export interface CommitAminoMsg { type: "/tendermint.types.Commit"; @@ -366,10 +366,10 @@ export interface CommitSigProtoMsg { } /** CommitSig is a part of the Vote included in a Commit. */ export interface CommitSigAmino { - block_id_flag: BlockIDFlag; - validator_address: Uint8Array; - timestamp?: Date; - signature: Uint8Array; + block_id_flag?: BlockIDFlag; + validator_address?: string; + timestamp?: string; + signature?: string; } export interface CommitSigAminoMsg { type: "/tendermint.types.CommitSig"; @@ -396,13 +396,13 @@ export interface ProposalProtoMsg { value: Uint8Array; } export interface ProposalAmino { - type: SignedMsgType; - height: string; - round: number; - pol_round: number; + type?: SignedMsgType; + height?: string; + round?: number; + pol_round?: number; block_id?: BlockIDAmino; - timestamp?: Date; - signature: Uint8Array; + timestamp?: string; + signature?: string; } export interface ProposalAminoMsg { type: "/tendermint.types.Proposal"; @@ -418,8 +418,8 @@ export interface ProposalSDKType { signature: Uint8Array; } export interface SignedHeader { - header: Header; - commit: Commit; + header?: Header; + commit?: Commit; } export interface SignedHeaderProtoMsg { typeUrl: "/tendermint.types.SignedHeader"; @@ -434,12 +434,12 @@ export interface SignedHeaderAminoMsg { value: SignedHeaderAmino; } export interface SignedHeaderSDKType { - header: HeaderSDKType; - commit: CommitSDKType; + header?: HeaderSDKType; + commit?: CommitSDKType; } export interface LightBlock { - signedHeader: SignedHeader; - validatorSet: ValidatorSet; + signedHeader?: SignedHeader; + validatorSet?: ValidatorSet; } export interface LightBlockProtoMsg { typeUrl: "/tendermint.types.LightBlock"; @@ -454,8 +454,8 @@ export interface LightBlockAminoMsg { value: LightBlockAmino; } export interface LightBlockSDKType { - signed_header: SignedHeaderSDKType; - validator_set: ValidatorSetSDKType; + signed_header?: SignedHeaderSDKType; + validator_set?: ValidatorSetSDKType; } export interface BlockMeta { blockId: BlockID; @@ -469,9 +469,9 @@ export interface BlockMetaProtoMsg { } export interface BlockMetaAmino { block_id?: BlockIDAmino; - block_size: string; + block_size?: string; header?: HeaderAmino; - num_txs: string; + num_txs?: string; } export interface BlockMetaAminoMsg { type: "/tendermint.types.BlockMeta"; @@ -487,7 +487,7 @@ export interface BlockMetaSDKType { export interface TxProof { rootHash: Uint8Array; data: Uint8Array; - proof: Proof; + proof?: Proof; } export interface TxProofProtoMsg { typeUrl: "/tendermint.types.TxProof"; @@ -495,8 +495,8 @@ export interface TxProofProtoMsg { } /** TxProof represents a Merkle proof of the presence of a transaction in the Merkle tree. */ export interface TxProofAmino { - root_hash: Uint8Array; - data: Uint8Array; + root_hash?: string; + data?: string; proof?: ProofAmino; } export interface TxProofAminoMsg { @@ -507,7 +507,7 @@ export interface TxProofAminoMsg { export interface TxProofSDKType { root_hash: Uint8Array; data: Uint8Array; - proof: ProofSDKType; + proof?: ProofSDKType; } function createBasePartSetHeader(): PartSetHeader { return { @@ -553,15 +553,19 @@ export const PartSetHeader = { return message; }, fromAmino(object: PartSetHeaderAmino): PartSetHeader { - return { - total: object.total, - hash: object.hash - }; + const message = createBasePartSetHeader(); + if (object.total !== undefined && object.total !== null) { + message.total = object.total; + } + if (object.hash !== undefined && object.hash !== null) { + message.hash = bytesFromBase64(object.hash); + } + return message; }, toAmino(message: PartSetHeader): PartSetHeaderAmino { const obj: any = {}; obj.total = message.total; - obj.hash = message.hash; + obj.hash = message.hash ? base64FromBytes(message.hash) : undefined; return obj; }, fromAminoMsg(object: PartSetHeaderAminoMsg): PartSetHeader { @@ -632,16 +636,22 @@ export const Part = { return message; }, fromAmino(object: PartAmino): Part { - return { - index: object.index, - bytes: object.bytes, - proof: object?.proof ? Proof.fromAmino(object.proof) : undefined - }; + const message = createBasePart(); + if (object.index !== undefined && object.index !== null) { + message.index = object.index; + } + if (object.bytes !== undefined && object.bytes !== null) { + message.bytes = bytesFromBase64(object.bytes); + } + if (object.proof !== undefined && object.proof !== null) { + message.proof = Proof.fromAmino(object.proof); + } + return message; }, toAmino(message: Part): PartAmino { const obj: any = {}; obj.index = message.index; - obj.bytes = message.bytes; + obj.bytes = message.bytes ? base64FromBytes(message.bytes) : undefined; obj.proof = message.proof ? Proof.toAmino(message.proof) : undefined; return obj; }, @@ -705,14 +715,18 @@ export const BlockID = { return message; }, fromAmino(object: BlockIDAmino): BlockID { - return { - hash: object.hash, - partSetHeader: object?.part_set_header ? PartSetHeader.fromAmino(object.part_set_header) : undefined - }; + const message = createBaseBlockID(); + if (object.hash !== undefined && object.hash !== null) { + message.hash = bytesFromBase64(object.hash); + } + if (object.part_set_header !== undefined && object.part_set_header !== null) { + message.partSetHeader = PartSetHeader.fromAmino(object.part_set_header); + } + return message; }, toAmino(message: BlockID): BlockIDAmino { const obj: any = {}; - obj.hash = message.hash; + obj.hash = message.hash ? base64FromBytes(message.hash) : undefined; obj.part_set_header = message.partSetHeader ? PartSetHeader.toAmino(message.partSetHeader) : undefined; return obj; }, @@ -872,39 +886,67 @@ export const Header = { return message; }, fromAmino(object: HeaderAmino): Header { - return { - version: object?.version ? Consensus.fromAmino(object.version) : undefined, - chainId: object.chain_id, - height: BigInt(object.height), - time: object.time, - lastBlockId: object?.last_block_id ? BlockID.fromAmino(object.last_block_id) : undefined, - lastCommitHash: object.last_commit_hash, - dataHash: object.data_hash, - validatorsHash: object.validators_hash, - nextValidatorsHash: object.next_validators_hash, - consensusHash: object.consensus_hash, - appHash: object.app_hash, - lastResultsHash: object.last_results_hash, - evidenceHash: object.evidence_hash, - proposerAddress: object.proposer_address - }; + const message = createBaseHeader(); + if (object.version !== undefined && object.version !== null) { + message.version = Consensus.fromAmino(object.version); + } + if (object.chain_id !== undefined && object.chain_id !== null) { + message.chainId = object.chain_id; + } + if (object.height !== undefined && object.height !== null) { + message.height = BigInt(object.height); + } + if (object.time !== undefined && object.time !== null) { + message.time = fromTimestamp(Timestamp.fromAmino(object.time)); + } + if (object.last_block_id !== undefined && object.last_block_id !== null) { + message.lastBlockId = BlockID.fromAmino(object.last_block_id); + } + if (object.last_commit_hash !== undefined && object.last_commit_hash !== null) { + message.lastCommitHash = bytesFromBase64(object.last_commit_hash); + } + if (object.data_hash !== undefined && object.data_hash !== null) { + message.dataHash = bytesFromBase64(object.data_hash); + } + if (object.validators_hash !== undefined && object.validators_hash !== null) { + message.validatorsHash = bytesFromBase64(object.validators_hash); + } + if (object.next_validators_hash !== undefined && object.next_validators_hash !== null) { + message.nextValidatorsHash = bytesFromBase64(object.next_validators_hash); + } + if (object.consensus_hash !== undefined && object.consensus_hash !== null) { + message.consensusHash = bytesFromBase64(object.consensus_hash); + } + if (object.app_hash !== undefined && object.app_hash !== null) { + message.appHash = bytesFromBase64(object.app_hash); + } + if (object.last_results_hash !== undefined && object.last_results_hash !== null) { + message.lastResultsHash = bytesFromBase64(object.last_results_hash); + } + if (object.evidence_hash !== undefined && object.evidence_hash !== null) { + message.evidenceHash = bytesFromBase64(object.evidence_hash); + } + if (object.proposer_address !== undefined && object.proposer_address !== null) { + message.proposerAddress = bytesFromBase64(object.proposer_address); + } + return message; }, toAmino(message: Header): HeaderAmino { const obj: any = {}; obj.version = message.version ? Consensus.toAmino(message.version) : undefined; obj.chain_id = message.chainId; obj.height = message.height ? message.height.toString() : undefined; - obj.time = message.time; + obj.time = message.time ? Timestamp.toAmino(toTimestamp(message.time)) : undefined; obj.last_block_id = message.lastBlockId ? BlockID.toAmino(message.lastBlockId) : undefined; - obj.last_commit_hash = message.lastCommitHash; - obj.data_hash = message.dataHash; - obj.validators_hash = message.validatorsHash; - obj.next_validators_hash = message.nextValidatorsHash; - obj.consensus_hash = message.consensusHash; - obj.app_hash = message.appHash; - obj.last_results_hash = message.lastResultsHash; - obj.evidence_hash = message.evidenceHash; - obj.proposer_address = message.proposerAddress; + obj.last_commit_hash = message.lastCommitHash ? base64FromBytes(message.lastCommitHash) : undefined; + obj.data_hash = message.dataHash ? base64FromBytes(message.dataHash) : undefined; + obj.validators_hash = message.validatorsHash ? base64FromBytes(message.validatorsHash) : undefined; + obj.next_validators_hash = message.nextValidatorsHash ? base64FromBytes(message.nextValidatorsHash) : undefined; + obj.consensus_hash = message.consensusHash ? base64FromBytes(message.consensusHash) : undefined; + obj.app_hash = message.appHash ? base64FromBytes(message.appHash) : undefined; + obj.last_results_hash = message.lastResultsHash ? base64FromBytes(message.lastResultsHash) : undefined; + obj.evidence_hash = message.evidenceHash ? base64FromBytes(message.evidenceHash) : undefined; + obj.proposer_address = message.proposerAddress ? base64FromBytes(message.proposerAddress) : undefined; return obj; }, fromAminoMsg(object: HeaderAminoMsg): Header { @@ -959,14 +1001,14 @@ export const Data = { return message; }, fromAmino(object: DataAmino): Data { - return { - txs: Array.isArray(object?.txs) ? object.txs.map((e: any) => e) : [] - }; + const message = createBaseData(); + message.txs = object.txs?.map(e => bytesFromBase64(e)) || []; + return message; }, toAmino(message: Data): DataAmino { const obj: any = {}; if (message.txs) { - obj.txs = message.txs.map(e => e); + obj.txs = message.txs.map(e => base64FromBytes(e)); } else { obj.txs = []; } @@ -1080,27 +1122,43 @@ export const Vote = { return message; }, fromAmino(object: VoteAmino): Vote { - return { - type: isSet(object.type) ? signedMsgTypeFromJSON(object.type) : -1, - height: BigInt(object.height), - round: object.round, - blockId: object?.block_id ? BlockID.fromAmino(object.block_id) : undefined, - timestamp: object.timestamp, - validatorAddress: object.validator_address, - validatorIndex: object.validator_index, - signature: object.signature - }; + const message = createBaseVote(); + if (object.type !== undefined && object.type !== null) { + message.type = signedMsgTypeFromJSON(object.type); + } + if (object.height !== undefined && object.height !== null) { + message.height = BigInt(object.height); + } + if (object.round !== undefined && object.round !== null) { + message.round = object.round; + } + if (object.block_id !== undefined && object.block_id !== null) { + message.blockId = BlockID.fromAmino(object.block_id); + } + if (object.timestamp !== undefined && object.timestamp !== null) { + message.timestamp = fromTimestamp(Timestamp.fromAmino(object.timestamp)); + } + if (object.validator_address !== undefined && object.validator_address !== null) { + message.validatorAddress = bytesFromBase64(object.validator_address); + } + if (object.validator_index !== undefined && object.validator_index !== null) { + message.validatorIndex = object.validator_index; + } + if (object.signature !== undefined && object.signature !== null) { + message.signature = bytesFromBase64(object.signature); + } + return message; }, toAmino(message: Vote): VoteAmino { const obj: any = {}; - obj.type = message.type; + obj.type = signedMsgTypeToJSON(message.type); obj.height = message.height ? message.height.toString() : undefined; obj.round = message.round; obj.block_id = message.blockId ? BlockID.toAmino(message.blockId) : undefined; - obj.timestamp = message.timestamp; - obj.validator_address = message.validatorAddress; + obj.timestamp = message.timestamp ? Timestamp.toAmino(toTimestamp(message.timestamp)) : undefined; + obj.validator_address = message.validatorAddress ? base64FromBytes(message.validatorAddress) : undefined; obj.validator_index = message.validatorIndex; - obj.signature = message.signature; + obj.signature = message.signature ? base64FromBytes(message.signature) : undefined; return obj; }, fromAminoMsg(object: VoteAminoMsg): Vote { @@ -1179,12 +1237,18 @@ export const Commit = { return message; }, fromAmino(object: CommitAmino): Commit { - return { - height: BigInt(object.height), - round: object.round, - blockId: object?.block_id ? BlockID.fromAmino(object.block_id) : undefined, - signatures: Array.isArray(object?.signatures) ? object.signatures.map((e: any) => CommitSig.fromAmino(e)) : [] - }; + const message = createBaseCommit(); + if (object.height !== undefined && object.height !== null) { + message.height = BigInt(object.height); + } + if (object.round !== undefined && object.round !== null) { + message.round = object.round; + } + if (object.block_id !== undefined && object.block_id !== null) { + message.blockId = BlockID.fromAmino(object.block_id); + } + message.signatures = object.signatures?.map(e => CommitSig.fromAmino(e)) || []; + return message; }, toAmino(message: Commit): CommitAmino { const obj: any = {}; @@ -1274,19 +1338,27 @@ export const CommitSig = { return message; }, fromAmino(object: CommitSigAmino): CommitSig { - return { - blockIdFlag: isSet(object.block_id_flag) ? blockIDFlagFromJSON(object.block_id_flag) : -1, - validatorAddress: object.validator_address, - timestamp: object.timestamp, - signature: object.signature - }; + const message = createBaseCommitSig(); + if (object.block_id_flag !== undefined && object.block_id_flag !== null) { + message.blockIdFlag = blockIDFlagFromJSON(object.block_id_flag); + } + if (object.validator_address !== undefined && object.validator_address !== null) { + message.validatorAddress = bytesFromBase64(object.validator_address); + } + if (object.timestamp !== undefined && object.timestamp !== null) { + message.timestamp = fromTimestamp(Timestamp.fromAmino(object.timestamp)); + } + if (object.signature !== undefined && object.signature !== null) { + message.signature = bytesFromBase64(object.signature); + } + return message; }, toAmino(message: CommitSig): CommitSigAmino { const obj: any = {}; - obj.block_id_flag = message.blockIdFlag; - obj.validator_address = message.validatorAddress; - obj.timestamp = message.timestamp; - obj.signature = message.signature; + obj.block_id_flag = blockIDFlagToJSON(message.blockIdFlag); + obj.validator_address = message.validatorAddress ? base64FromBytes(message.validatorAddress) : undefined; + obj.timestamp = message.timestamp ? Timestamp.toAmino(toTimestamp(message.timestamp)) : undefined; + obj.signature = message.signature ? base64FromBytes(message.signature) : undefined; return obj; }, fromAminoMsg(object: CommitSigAminoMsg): CommitSig { @@ -1389,25 +1461,39 @@ export const Proposal = { return message; }, fromAmino(object: ProposalAmino): Proposal { - return { - type: isSet(object.type) ? signedMsgTypeFromJSON(object.type) : -1, - height: BigInt(object.height), - round: object.round, - polRound: object.pol_round, - blockId: object?.block_id ? BlockID.fromAmino(object.block_id) : undefined, - timestamp: object.timestamp, - signature: object.signature - }; + const message = createBaseProposal(); + if (object.type !== undefined && object.type !== null) { + message.type = signedMsgTypeFromJSON(object.type); + } + if (object.height !== undefined && object.height !== null) { + message.height = BigInt(object.height); + } + if (object.round !== undefined && object.round !== null) { + message.round = object.round; + } + if (object.pol_round !== undefined && object.pol_round !== null) { + message.polRound = object.pol_round; + } + if (object.block_id !== undefined && object.block_id !== null) { + message.blockId = BlockID.fromAmino(object.block_id); + } + if (object.timestamp !== undefined && object.timestamp !== null) { + message.timestamp = fromTimestamp(Timestamp.fromAmino(object.timestamp)); + } + if (object.signature !== undefined && object.signature !== null) { + message.signature = bytesFromBase64(object.signature); + } + return message; }, toAmino(message: Proposal): ProposalAmino { const obj: any = {}; - obj.type = message.type; + obj.type = signedMsgTypeToJSON(message.type); obj.height = message.height ? message.height.toString() : undefined; obj.round = message.round; obj.pol_round = message.polRound; obj.block_id = message.blockId ? BlockID.toAmino(message.blockId) : undefined; - obj.timestamp = message.timestamp; - obj.signature = message.signature; + obj.timestamp = message.timestamp ? Timestamp.toAmino(toTimestamp(message.timestamp)) : undefined; + obj.signature = message.signature ? base64FromBytes(message.signature) : undefined; return obj; }, fromAminoMsg(object: ProposalAminoMsg): Proposal { @@ -1428,8 +1514,8 @@ export const Proposal = { }; function createBaseSignedHeader(): SignedHeader { return { - header: Header.fromPartial({}), - commit: Commit.fromPartial({}) + header: undefined, + commit: undefined }; } export const SignedHeader = { @@ -1470,10 +1556,14 @@ export const SignedHeader = { return message; }, fromAmino(object: SignedHeaderAmino): SignedHeader { - return { - header: object?.header ? Header.fromAmino(object.header) : undefined, - commit: object?.commit ? Commit.fromAmino(object.commit) : undefined - }; + const message = createBaseSignedHeader(); + if (object.header !== undefined && object.header !== null) { + message.header = Header.fromAmino(object.header); + } + if (object.commit !== undefined && object.commit !== null) { + message.commit = Commit.fromAmino(object.commit); + } + return message; }, toAmino(message: SignedHeader): SignedHeaderAmino { const obj: any = {}; @@ -1499,8 +1589,8 @@ export const SignedHeader = { }; function createBaseLightBlock(): LightBlock { return { - signedHeader: SignedHeader.fromPartial({}), - validatorSet: ValidatorSet.fromPartial({}) + signedHeader: undefined, + validatorSet: undefined }; } export const LightBlock = { @@ -1541,10 +1631,14 @@ export const LightBlock = { return message; }, fromAmino(object: LightBlockAmino): LightBlock { - return { - signedHeader: object?.signed_header ? SignedHeader.fromAmino(object.signed_header) : undefined, - validatorSet: object?.validator_set ? ValidatorSet.fromAmino(object.validator_set) : undefined - }; + const message = createBaseLightBlock(); + if (object.signed_header !== undefined && object.signed_header !== null) { + message.signedHeader = SignedHeader.fromAmino(object.signed_header); + } + if (object.validator_set !== undefined && object.validator_set !== null) { + message.validatorSet = ValidatorSet.fromAmino(object.validator_set); + } + return message; }, toAmino(message: LightBlock): LightBlockAmino { const obj: any = {}; @@ -1628,12 +1722,20 @@ export const BlockMeta = { return message; }, fromAmino(object: BlockMetaAmino): BlockMeta { - return { - blockId: object?.block_id ? BlockID.fromAmino(object.block_id) : undefined, - blockSize: BigInt(object.block_size), - header: object?.header ? Header.fromAmino(object.header) : undefined, - numTxs: BigInt(object.num_txs) - }; + const message = createBaseBlockMeta(); + if (object.block_id !== undefined && object.block_id !== null) { + message.blockId = BlockID.fromAmino(object.block_id); + } + if (object.block_size !== undefined && object.block_size !== null) { + message.blockSize = BigInt(object.block_size); + } + if (object.header !== undefined && object.header !== null) { + message.header = Header.fromAmino(object.header); + } + if (object.num_txs !== undefined && object.num_txs !== null) { + message.numTxs = BigInt(object.num_txs); + } + return message; }, toAmino(message: BlockMeta): BlockMetaAmino { const obj: any = {}; @@ -1663,7 +1765,7 @@ function createBaseTxProof(): TxProof { return { rootHash: new Uint8Array(), data: new Uint8Array(), - proof: Proof.fromPartial({}) + proof: undefined }; } export const TxProof = { @@ -1711,16 +1813,22 @@ export const TxProof = { return message; }, fromAmino(object: TxProofAmino): TxProof { - return { - rootHash: object.root_hash, - data: object.data, - proof: object?.proof ? Proof.fromAmino(object.proof) : undefined - }; + const message = createBaseTxProof(); + if (object.root_hash !== undefined && object.root_hash !== null) { + message.rootHash = bytesFromBase64(object.root_hash); + } + if (object.data !== undefined && object.data !== null) { + message.data = bytesFromBase64(object.data); + } + if (object.proof !== undefined && object.proof !== null) { + message.proof = Proof.fromAmino(object.proof); + } + return message; }, toAmino(message: TxProof): TxProofAmino { const obj: any = {}; - obj.root_hash = message.rootHash; - obj.data = message.data; + obj.root_hash = message.rootHash ? base64FromBytes(message.rootHash) : undefined; + obj.data = message.data ? base64FromBytes(message.data) : undefined; obj.proof = message.proof ? Proof.toAmino(message.proof) : undefined; return obj; }, diff --git a/packages/osmo-query/src/codegen/tendermint/types/validator.ts b/packages/osmo-query/src/codegen/tendermint/types/validator.ts index a8440bfee..2dddbe6a1 100644 --- a/packages/osmo-query/src/codegen/tendermint/types/validator.ts +++ b/packages/osmo-query/src/codegen/tendermint/types/validator.ts @@ -1,8 +1,9 @@ import { PublicKey, PublicKeyAmino, PublicKeySDKType } from "../crypto/keys"; import { BinaryReader, BinaryWriter } from "../../binary"; +import { bytesFromBase64, base64FromBytes } from "../../helpers"; export interface ValidatorSet { validators: Validator[]; - proposer: Validator; + proposer?: Validator; totalVotingPower: bigint; } export interface ValidatorSetProtoMsg { @@ -10,9 +11,9 @@ export interface ValidatorSetProtoMsg { value: Uint8Array; } export interface ValidatorSetAmino { - validators: ValidatorAmino[]; + validators?: ValidatorAmino[]; proposer?: ValidatorAmino; - total_voting_power: string; + total_voting_power?: string; } export interface ValidatorSetAminoMsg { type: "/tendermint.types.ValidatorSet"; @@ -20,7 +21,7 @@ export interface ValidatorSetAminoMsg { } export interface ValidatorSetSDKType { validators: ValidatorSDKType[]; - proposer: ValidatorSDKType; + proposer?: ValidatorSDKType; total_voting_power: bigint; } export interface Validator { @@ -34,10 +35,10 @@ export interface ValidatorProtoMsg { value: Uint8Array; } export interface ValidatorAmino { - address: Uint8Array; + address?: string; pub_key?: PublicKeyAmino; - voting_power: string; - proposer_priority: string; + voting_power?: string; + proposer_priority?: string; } export interface ValidatorAminoMsg { type: "/tendermint.types.Validator"; @@ -50,7 +51,7 @@ export interface ValidatorSDKType { proposer_priority: bigint; } export interface SimpleValidator { - pubKey: PublicKey; + pubKey?: PublicKey; votingPower: bigint; } export interface SimpleValidatorProtoMsg { @@ -59,20 +60,20 @@ export interface SimpleValidatorProtoMsg { } export interface SimpleValidatorAmino { pub_key?: PublicKeyAmino; - voting_power: string; + voting_power?: string; } export interface SimpleValidatorAminoMsg { type: "/tendermint.types.SimpleValidator"; value: SimpleValidatorAmino; } export interface SimpleValidatorSDKType { - pub_key: PublicKeySDKType; + pub_key?: PublicKeySDKType; voting_power: bigint; } function createBaseValidatorSet(): ValidatorSet { return { validators: [], - proposer: Validator.fromPartial({}), + proposer: undefined, totalVotingPower: BigInt(0) }; } @@ -121,11 +122,15 @@ export const ValidatorSet = { return message; }, fromAmino(object: ValidatorSetAmino): ValidatorSet { - return { - validators: Array.isArray(object?.validators) ? object.validators.map((e: any) => Validator.fromAmino(e)) : [], - proposer: object?.proposer ? Validator.fromAmino(object.proposer) : undefined, - totalVotingPower: BigInt(object.total_voting_power) - }; + const message = createBaseValidatorSet(); + message.validators = object.validators?.map(e => Validator.fromAmino(e)) || []; + if (object.proposer !== undefined && object.proposer !== null) { + message.proposer = Validator.fromAmino(object.proposer); + } + if (object.total_voting_power !== undefined && object.total_voting_power !== null) { + message.totalVotingPower = BigInt(object.total_voting_power); + } + return message; }, toAmino(message: ValidatorSet): ValidatorSetAmino { const obj: any = {}; @@ -214,16 +219,24 @@ export const Validator = { return message; }, fromAmino(object: ValidatorAmino): Validator { - return { - address: object.address, - pubKey: object?.pub_key ? PublicKey.fromAmino(object.pub_key) : undefined, - votingPower: BigInt(object.voting_power), - proposerPriority: BigInt(object.proposer_priority) - }; + const message = createBaseValidator(); + if (object.address !== undefined && object.address !== null) { + message.address = bytesFromBase64(object.address); + } + if (object.pub_key !== undefined && object.pub_key !== null) { + message.pubKey = PublicKey.fromAmino(object.pub_key); + } + if (object.voting_power !== undefined && object.voting_power !== null) { + message.votingPower = BigInt(object.voting_power); + } + if (object.proposer_priority !== undefined && object.proposer_priority !== null) { + message.proposerPriority = BigInt(object.proposer_priority); + } + return message; }, toAmino(message: Validator): ValidatorAmino { const obj: any = {}; - obj.address = message.address; + obj.address = message.address ? base64FromBytes(message.address) : undefined; obj.pub_key = message.pubKey ? PublicKey.toAmino(message.pubKey) : undefined; obj.voting_power = message.votingPower ? message.votingPower.toString() : undefined; obj.proposer_priority = message.proposerPriority ? message.proposerPriority.toString() : undefined; @@ -247,7 +260,7 @@ export const Validator = { }; function createBaseSimpleValidator(): SimpleValidator { return { - pubKey: PublicKey.fromPartial({}), + pubKey: undefined, votingPower: BigInt(0) }; } @@ -289,10 +302,14 @@ export const SimpleValidator = { return message; }, fromAmino(object: SimpleValidatorAmino): SimpleValidator { - return { - pubKey: object?.pub_key ? PublicKey.fromAmino(object.pub_key) : undefined, - votingPower: BigInt(object.voting_power) - }; + const message = createBaseSimpleValidator(); + if (object.pub_key !== undefined && object.pub_key !== null) { + message.pubKey = PublicKey.fromAmino(object.pub_key); + } + if (object.voting_power !== undefined && object.voting_power !== null) { + message.votingPower = BigInt(object.voting_power); + } + return message; }, toAmino(message: SimpleValidator): SimpleValidatorAmino { const obj: any = {}; diff --git a/packages/osmo-query/src/codegen/tendermint/version/types.ts b/packages/osmo-query/src/codegen/tendermint/version/types.ts index d771dbbb5..7b4cf3b0e 100644 --- a/packages/osmo-query/src/codegen/tendermint/version/types.ts +++ b/packages/osmo-query/src/codegen/tendermint/version/types.ts @@ -18,8 +18,8 @@ export interface AppProtoMsg { * updated in ResponseEndBlock. */ export interface AppAmino { - protocol: string; - software: string; + protocol?: string; + software?: string; } export interface AppAminoMsg { type: "/tendermint.version.App"; @@ -53,8 +53,8 @@ export interface ConsensusProtoMsg { * state transition machine. */ export interface ConsensusAmino { - block: string; - app: string; + block?: string; + app?: string; } export interface ConsensusAminoMsg { type: "/tendermint.version.Consensus"; @@ -113,10 +113,14 @@ export const App = { return message; }, fromAmino(object: AppAmino): App { - return { - protocol: BigInt(object.protocol), - software: object.software - }; + const message = createBaseApp(); + if (object.protocol !== undefined && object.protocol !== null) { + message.protocol = BigInt(object.protocol); + } + if (object.software !== undefined && object.software !== null) { + message.software = object.software; + } + return message; }, toAmino(message: App): AppAmino { const obj: any = {}; @@ -184,10 +188,14 @@ export const Consensus = { return message; }, fromAmino(object: ConsensusAmino): Consensus { - return { - block: BigInt(object.block), - app: BigInt(object.app) - }; + const message = createBaseConsensus(); + if (object.block !== undefined && object.block !== null) { + message.block = BigInt(object.block); + } + if (object.app !== undefined && object.app !== null) { + message.app = BigInt(object.app); + } + return message; }, toAmino(message: Consensus): ConsensusAmino { const obj: any = {}; diff --git a/packages/osmo-query/src/codegen/utf8.ts b/packages/osmo-query/src/codegen/utf8.ts index c22bba916..020361f7b 100644 --- a/packages/osmo-query/src/codegen/utf8.ts +++ b/packages/osmo-query/src/codegen/utf8.ts @@ -1,5 +1,5 @@ /** -* This file and any referenced files were automatically generated by @cosmology/telescope@0.102.0 +* This file and any referenced files were automatically generated by @cosmology/telescope@1.4.1 * DO NOT MODIFY BY HAND. Instead, download the latest proto files for your chain * and run the transpile command or yarn proto command to regenerate this bundle. */ @@ -72,7 +72,7 @@ export function utf8Read( const len = end - start; if (len < 1) return ""; const chunk = []; - let parts = null, + let parts: string[] = [], i = 0, // char offset t; // temporary while (start < end) { diff --git a/packages/osmo-query/src/codegen/varint.ts b/packages/osmo-query/src/codegen/varint.ts index 90e455554..78922d41b 100644 --- a/packages/osmo-query/src/codegen/varint.ts +++ b/packages/osmo-query/src/codegen/varint.ts @@ -1,5 +1,5 @@ /** -* This file and any referenced files were automatically generated by @cosmology/telescope@0.102.0 +* This file and any referenced files were automatically generated by @cosmology/telescope@1.4.1 * DO NOT MODIFY BY HAND. Instead, download the latest proto files for your chain * and run the transpile command or yarn proto command to regenerate this bundle. */ diff --git a/packages/osmojs/__tests__/unit/modules/cosmos/distribution/aminomessages.spec.ts b/packages/osmojs/__tests__/unit/modules/cosmos/distribution/aminomessages.spec.ts index 39d9c6e70..43f2eb42a 100644 --- a/packages/osmojs/__tests__/unit/modules/cosmos/distribution/aminomessages.spec.ts +++ b/packages/osmojs/__tests__/unit/modules/cosmos/distribution/aminomessages.spec.ts @@ -88,7 +88,7 @@ describe("AminoTypes", () => { }); const expected: AminoMsgWithdrawValidatorCommission = { // type: "cosmos-sdk/MsgWithdrawValidatorCommission", - type: "cosmos-sdk/MsgWithdrawValCommission", + type: "cosmos-sdk/MsgWithdrawValidatorCommission", value: { validator_address: "cosmos10dyr9899g6t0pelew4nvf4j5c3jcgv0r73qga5", }, diff --git a/packages/osmojs/__tests__/unit/modules/cosmos/gov/aminomessages.spec.ts b/packages/osmojs/__tests__/unit/modules/cosmos/gov/aminomessages.spec.ts index a6ab3ed66..784547ad1 100644 --- a/packages/osmojs/__tests__/unit/modules/cosmos/gov/aminomessages.spec.ts +++ b/packages/osmojs/__tests__/unit/modules/cosmos/gov/aminomessages.spec.ts @@ -28,7 +28,7 @@ describe("AminoTypes", () => { }); const expected: AminoMsgDeposit = { // type: "cosmos-sdk/MsgDeposit", - type: "cosmos-sdk/v1/MsgDeposit", + type: "cosmos-sdk/MsgDeposit", value: { amount: [{ amount: "12300000", denom: "ustake" }], depositor: "cosmos10dyr9899g6t0pelew4nvf4j5c3jcgv0r73qga5", @@ -85,9 +85,11 @@ describe("AminoTypes", () => { }); const expected: AminoMsgVote = { // type: "cosmos-sdk/MsgVote", - type: "cosmos-sdk/v1/MsgVote", + type: "cosmos-sdk/MsgVote", value: { - option: 4, + //TODO:: fix amino option to numbers in telescope. + //option: 4, + option: "VOTE_OPTION_NO_WITH_VETO", proposal_id: "5", voter: "cosmos1xy4yqngt0nlkdcenxymg8tenrghmek4nmqm28k", }, @@ -99,7 +101,7 @@ describe("AminoTypes", () => { describe("fromAmino", () => { it("works for MsgDeposit", () => { const aminoMsg: AminoMsgDeposit = { - type: "cosmos-sdk/v1/MsgDeposit", + type: "cosmos-sdk/MsgDeposit", value: { amount: [{ amount: "12300000", denom: "ustake" }], depositor: "cosmos10dyr9899g6t0pelew4nvf4j5c3jcgv0r73qga5", @@ -155,7 +157,7 @@ describe("AminoTypes", () => { it("works for MsgVote", () => { const aminoMsg: AminoMsgVote = { // type: "cosmos-sdk/MsgVote", - type: "cosmos-sdk/v1/MsgVote", + type: "cosmos-sdk/MsgVote", value: { option: 4, proposal_id: "5", diff --git a/packages/osmojs/cosmos-sdk b/packages/osmojs/cosmos-sdk index ed4eb883f..7ff0763fd 160000 --- a/packages/osmojs/cosmos-sdk +++ b/packages/osmojs/cosmos-sdk @@ -1 +1 @@ -Subproject commit ed4eb883f2a65bd5343e9d2f6186060f45294cb2 +Subproject commit 7ff0763fd1f96b46dc7f6527a3ef08d47b785493 diff --git a/packages/osmojs/ibc-go b/packages/osmojs/ibc-go index 10324f5bf..fadf8f2b0 160000 --- a/packages/osmojs/ibc-go +++ b/packages/osmojs/ibc-go @@ -1 +1 @@ -Subproject commit 10324f5bf6840892cd7bba8a40231fc52a8b1745 +Subproject commit fadf8f2b0ab184798d021d220d877e00c7634e26 diff --git a/packages/osmojs/ics23 b/packages/osmojs/ics23 index f4deb054b..bf89d957b 160000 --- a/packages/osmojs/ics23 +++ b/packages/osmojs/ics23 @@ -1 +1 @@ -Subproject commit f4deb054b697458e7f0aa353c2f45a365361e895 +Subproject commit bf89d957b019bb9a2f381edb1f24d06957807690 diff --git a/packages/osmojs/osmosis b/packages/osmojs/osmosis index 326dfb08a..647904ff4 160000 --- a/packages/osmojs/osmosis +++ b/packages/osmojs/osmosis @@ -1 +1 @@ -Subproject commit 326dfb08a9af17d53ed5d5a71ac4a591e72ae4b0 +Subproject commit 647904ff4bf9f37bdc3bf46447629a75a0618edd diff --git a/packages/osmojs/package.json b/packages/osmojs/package.json index 87ceefc2a..7957900bb 100644 --- a/packages/osmojs/package.json +++ b/packages/osmojs/package.json @@ -75,7 +75,7 @@ "@confio/relayer": "0.7.0", "@cosmjs/cosmwasm-stargate": "0.29.4", "@cosmjs/crypto": "0.29.4", - "@cosmology/telescope": "0.102.0", + "@cosmology/telescope": "1.4.1", "@protobufs/confio": "^0.0.6", "@protobufs/cosmos": "^0.1.0", "@protobufs/cosmos_proto": "^0.0.10", @@ -116,7 +116,7 @@ "@cosmjs/amino": "0.32.0", "@cosmjs/proto-signing": "0.32.0", "@cosmjs/stargate": "0.32.0", - "@cosmjs/tendermint-rpc": "0.32.0", + "@cosmjs/tendermint-rpc": "^0.32.0", "@cosmology/lcd": "^0.12.0" } } diff --git a/packages/osmojs/scripts/codegen.js b/packages/osmojs/scripts/codegen.js index 0e853c4cf..7f0f4036b 100644 --- a/packages/osmojs/scripts/codegen.js +++ b/packages/osmojs/scripts/codegen.js @@ -17,15 +17,15 @@ telescope({ protoDirs, outPath, options: { - + env: "v-next", removeUnusedImports: true, tsDisable: { patterns: ['**/*amino.ts', '**/*registry.ts'] }, - experimentalGlobalProtoNamespace: true, // [ 'v1beta1' ] concentratedliquidity interfaces: { enabled: true, - useUnionTypes: false + useUnionTypes: true, + useGlobalDecoderRegistry: true }, prototypes: { addTypeUrlToDecoders: true, @@ -55,7 +55,6 @@ telescope({ 'cosmos.nft.v1beta1', 'cosmos.orm.v1', 'cosmos.orm.v1alpha1', - 'cosmos.params.v1beta1', 'cosmos.slashing.v1beta1', 'cosmos.vesting.v1beta1', 'google.api', @@ -64,8 +63,8 @@ telescope({ ] }, methods: { - fromJSON: false, - toJSON: false, + fromJSON: true, + toJSON: true, encode: true, decode: true, @@ -109,7 +108,8 @@ telescope({ }, rpcClients: { enabled: true, - camelCase: true + camelCase: true, + useConnectComet: true } } }) diff --git a/packages/osmojs/src/codegen/amino/bundle.ts b/packages/osmojs/src/codegen/amino/bundle.ts index 00d920fc1..6204aed71 100644 --- a/packages/osmojs/src/codegen/amino/bundle.ts +++ b/packages/osmojs/src/codegen/amino/bundle.ts @@ -1,4 +1,4 @@ -import * as _41 from "./amino"; +import * as _74 from "./amino"; export const amino = { - ..._41 + ..._74 }; \ No newline at end of file diff --git a/packages/osmojs/src/codegen/binary.ts b/packages/osmojs/src/codegen/binary.ts index 428082e04..377f17250 100644 --- a/packages/osmojs/src/codegen/binary.ts +++ b/packages/osmojs/src/codegen/binary.ts @@ -1,5 +1,5 @@ /** -* This file and any referenced files were automatically generated by @cosmology/telescope@0.99.12 +* This file and any referenced files were automatically generated by @cosmology/telescope@1.4.1 * DO NOT MODIFY BY HAND. Instead, download the latest proto files for your chain * and run the transpile command or yarn proto command to regenerate this bundle. */ @@ -68,14 +68,38 @@ export enum WireType { } // Reader +export interface IBinaryReader { + buf: Uint8Array; + pos: number; + type: number; + len: number; + tag(): [number, WireType, number]; + skip(length?: number): this; + skipType(wireType: number): this; + uint32(): number; + int32(): number; + sint32(): number; + fixed32(): number; + sfixed32(): number; + int64(): bigint; + uint64(): bigint; + sint64(): bigint; + fixed64(): bigint; + sfixed64(): bigint; + float(): number; + double(): number; + bool(): boolean; + bytes(): Uint8Array; + string(): string; +} -export class BinaryReader { +export class BinaryReader implements IBinaryReader { buf: Uint8Array; pos: number; type: number; len: number; - protected assertBounds(): void { + assertBounds(): void { if (this.pos > this.len) throw new RangeError("premature EOF"); } @@ -217,35 +241,73 @@ export class BinaryReader { } // Writer +export interface IBinaryWriter { + len: number; + head: IOp; + tail: IOp; + states: State | null; + finish(): Uint8Array; + fork(): IBinaryWriter; + reset(): IBinaryWriter; + ldelim(): IBinaryWriter; + tag(fieldNo: number, type: WireType): IBinaryWriter; + uint32(value: number): IBinaryWriter; + int32(value: number): IBinaryWriter; + sint32(value: number): IBinaryWriter; + int64(value: string | number | bigint): IBinaryWriter; + uint64: (value: string | number | bigint) => IBinaryWriter; + sint64(value: string | number | bigint): IBinaryWriter; + fixed64(value: string | number | bigint): IBinaryWriter; + sfixed64: (value: string | number | bigint) => IBinaryWriter; + bool(value: boolean): IBinaryWriter; + fixed32(value: number): IBinaryWriter; + sfixed32: (value: number) => IBinaryWriter; + float(value: number): IBinaryWriter; + double(value: number): IBinaryWriter; + bytes(value: Uint8Array): IBinaryWriter; + string(value: string): IBinaryWriter; +} -type OpVal = string | number | object | Uint8Array; +interface IOp { + len: number; + next?: IOp; + proceed(buf: Uint8Array | number[], pos: number): void; +} -class Op { - fn?: (val: OpVal, buf: Uint8Array | number[], pos: number) => void; +class Op implements IOp { + fn?: ((val: T, buf: Uint8Array | number[], pos: number) => void) | null; len: number; - val: OpVal; - next?: Op; + val: T; + next?: IOp; constructor( - fn: ( - val: OpVal, - buf: Uint8Array | number[], - pos: number - ) => void | undefined, + fn: + | (( + val: T, + buf: Uint8Array | number[], + pos: number + ) => void | undefined | null) + | null, len: number, - val: OpVal + val: T ) { this.fn = fn; this.len = len; this.val = val; } + + proceed(buf: Uint8Array | number[], pos: number) { + if (this.fn) { + this.fn(this.val, buf, pos); + } + } } class State { - head: Op; - tail: Op; + head: IOp; + tail: IOp; len: number; - next: State; + next: State | null; constructor(writer: BinaryWriter) { this.head = writer.head; @@ -255,11 +317,11 @@ class State { } } -export class BinaryWriter { +export class BinaryWriter implements IBinaryWriter { len = 0; - head: Op; - tail: Op; - states: State; + head: IOp; + tail: IOp; + states: State | null; constructor() { this.head = new Op(null, 0, 0); @@ -282,10 +344,10 @@ export class BinaryWriter { } } - private _push( - fn: (val: OpVal, buf: Uint8Array | number[], pos: number) => void, + private _push( + fn: (val: T, buf: Uint8Array | number[], pos: number) => void, len: number, - val: OpVal + val: T ) { this.tail = this.tail.next = new Op(fn, len, val); this.len += len; @@ -297,7 +359,7 @@ export class BinaryWriter { pos = 0; const buf = BinaryWriter.alloc(this.len); while (head) { - head.fn(head.val, buf, pos); + head.proceed(buf, pos); pos += head.len; head = head.next; } @@ -348,12 +410,12 @@ export class BinaryWriter { (value = value >>> 0) < 128 ? 1 : value < 16384 - ? 2 - : value < 2097152 - ? 3 - : value < 268435456 - ? 4 - : 5, + ? 2 + : value < 2097152 + ? 3 + : value < 268435456 + ? 4 + : 5, value )).len; return this; @@ -444,7 +506,7 @@ function pool( ): (size: number) => Uint8Array { const SIZE = size || 8192; const MAX = SIZE >>> 1; - let slab = null; + let slab: Uint8Array | null = null; let offset = SIZE; return function pool_alloc(size): Uint8Array { if (size < 1 || size > MAX) return alloc(size); @@ -463,10 +525,10 @@ function pool( function indexOutOfRange(reader: BinaryReader, writeLength?: number) { return RangeError( "index out of range: " + - reader.pos + - " + " + - (writeLength || 1) + - " > " + - reader.len + reader.pos + + " + " + + (writeLength || 1) + + " > " + + reader.len ); } diff --git a/packages/osmojs/src/codegen/capability/bundle.ts b/packages/osmojs/src/codegen/capability/bundle.ts index 486628ae2..e06ed1a47 100644 --- a/packages/osmojs/src/codegen/capability/bundle.ts +++ b/packages/osmojs/src/codegen/capability/bundle.ts @@ -1,8 +1,8 @@ -import * as _42 from "./v1/capability"; -import * as _43 from "./v1/genesis"; +import * as _86 from "./v1/capability"; +import * as _87 from "./v1/genesis"; export namespace capability { export const v1 = { - ..._42, - ..._43 + ..._86, + ..._87 }; } \ No newline at end of file diff --git a/packages/osmojs/src/codegen/capability/v1/capability.ts b/packages/osmojs/src/codegen/capability/v1/capability.ts index d772feeda..b47b4168a 100644 --- a/packages/osmojs/src/codegen/capability/v1/capability.ts +++ b/packages/osmojs/src/codegen/capability/v1/capability.ts @@ -1,4 +1,6 @@ import { BinaryReader, BinaryWriter } from "../../binary"; +import { isSet } from "../../helpers"; +import { GlobalDecoderRegistry } from "../../registry"; /** * Capability defines an implementation of an object capability. The index * provided to a Capability must be globally unique. @@ -15,7 +17,7 @@ export interface CapabilityProtoMsg { * provided to a Capability must be globally unique. */ export interface CapabilityAmino { - index: string; + index?: string; } export interface CapabilityAminoMsg { type: "/capability.v1.Capability"; @@ -45,8 +47,8 @@ export interface OwnerProtoMsg { * capability and the module name. */ export interface OwnerAmino { - module: string; - name: string; + module?: string; + name?: string; } export interface OwnerAminoMsg { type: "/capability.v1.Owner"; @@ -96,6 +98,15 @@ function createBaseCapability(): Capability { } export const Capability = { typeUrl: "/capability.v1.Capability", + is(o: any): o is Capability { + return o && (o.$typeUrl === Capability.typeUrl || typeof o.index === "bigint"); + }, + isSDK(o: any): o is CapabilitySDKType { + return o && (o.$typeUrl === Capability.typeUrl || typeof o.index === "bigint"); + }, + isAmino(o: any): o is CapabilityAmino { + return o && (o.$typeUrl === Capability.typeUrl || typeof o.index === "bigint"); + }, encode(message: Capability, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.index !== BigInt(0)) { writer.uint32(8).uint64(message.index); @@ -119,15 +130,27 @@ export const Capability = { } return message; }, + fromJSON(object: any): Capability { + return { + index: isSet(object.index) ? BigInt(object.index.toString()) : BigInt(0) + }; + }, + toJSON(message: Capability): unknown { + const obj: any = {}; + message.index !== undefined && (obj.index = (message.index || BigInt(0)).toString()); + return obj; + }, fromPartial(object: Partial): Capability { const message = createBaseCapability(); message.index = object.index !== undefined && object.index !== null ? BigInt(object.index.toString()) : BigInt(0); return message; }, fromAmino(object: CapabilityAmino): Capability { - return { - index: BigInt(object.index) - }; + const message = createBaseCapability(); + if (object.index !== undefined && object.index !== null) { + message.index = BigInt(object.index); + } + return message; }, toAmino(message: Capability): CapabilityAmino { const obj: any = {}; @@ -150,6 +173,7 @@ export const Capability = { }; } }; +GlobalDecoderRegistry.register(Capability.typeUrl, Capability); function createBaseOwner(): Owner { return { module: "", @@ -158,6 +182,15 @@ function createBaseOwner(): Owner { } export const Owner = { typeUrl: "/capability.v1.Owner", + is(o: any): o is Owner { + return o && (o.$typeUrl === Owner.typeUrl || typeof o.module === "string" && typeof o.name === "string"); + }, + isSDK(o: any): o is OwnerSDKType { + return o && (o.$typeUrl === Owner.typeUrl || typeof o.module === "string" && typeof o.name === "string"); + }, + isAmino(o: any): o is OwnerAmino { + return o && (o.$typeUrl === Owner.typeUrl || typeof o.module === "string" && typeof o.name === "string"); + }, encode(message: Owner, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.module !== "") { writer.uint32(10).string(message.module); @@ -187,6 +220,18 @@ export const Owner = { } 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; + }, fromPartial(object: Partial): Owner { const message = createBaseOwner(); message.module = object.module ?? ""; @@ -194,10 +239,14 @@ export const Owner = { return message; }, fromAmino(object: OwnerAmino): Owner { - return { - module: object.module, - name: object.name - }; + const message = createBaseOwner(); + if (object.module !== undefined && object.module !== null) { + message.module = object.module; + } + if (object.name !== undefined && object.name !== null) { + message.name = object.name; + } + return message; }, toAmino(message: Owner): OwnerAmino { const obj: any = {}; @@ -221,6 +270,7 @@ export const Owner = { }; } }; +GlobalDecoderRegistry.register(Owner.typeUrl, Owner); function createBaseCapabilityOwners(): CapabilityOwners { return { owners: [] @@ -228,6 +278,15 @@ function createBaseCapabilityOwners(): CapabilityOwners { } export const CapabilityOwners = { typeUrl: "/capability.v1.CapabilityOwners", + is(o: any): o is CapabilityOwners { + return o && (o.$typeUrl === CapabilityOwners.typeUrl || Array.isArray(o.owners) && (!o.owners.length || Owner.is(o.owners[0]))); + }, + isSDK(o: any): o is CapabilityOwnersSDKType { + return o && (o.$typeUrl === CapabilityOwners.typeUrl || Array.isArray(o.owners) && (!o.owners.length || Owner.isSDK(o.owners[0]))); + }, + isAmino(o: any): o is CapabilityOwnersAmino { + return o && (o.$typeUrl === CapabilityOwners.typeUrl || Array.isArray(o.owners) && (!o.owners.length || Owner.isAmino(o.owners[0]))); + }, encode(message: CapabilityOwners, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.owners) { Owner.encode(v!, writer.uint32(10).fork()).ldelim(); @@ -251,15 +310,29 @@ export const CapabilityOwners = { } return message; }, + fromJSON(object: any): CapabilityOwners { + return { + owners: Array.isArray(object?.owners) ? object.owners.map((e: any) => Owner.fromJSON(e)) : [] + }; + }, + toJSON(message: CapabilityOwners): unknown { + const obj: any = {}; + if (message.owners) { + obj.owners = message.owners.map(e => e ? Owner.toJSON(e) : undefined); + } else { + obj.owners = []; + } + return obj; + }, fromPartial(object: Partial): CapabilityOwners { const message = createBaseCapabilityOwners(); message.owners = object.owners?.map(e => Owner.fromPartial(e)) || []; return message; }, fromAmino(object: CapabilityOwnersAmino): CapabilityOwners { - return { - owners: Array.isArray(object?.owners) ? object.owners.map((e: any) => Owner.fromAmino(e)) : [] - }; + const message = createBaseCapabilityOwners(); + message.owners = object.owners?.map(e => Owner.fromAmino(e)) || []; + return message; }, toAmino(message: CapabilityOwners): CapabilityOwnersAmino { const obj: any = {}; @@ -285,4 +358,5 @@ export const CapabilityOwners = { value: CapabilityOwners.encode(message).finish() }; } -}; \ No newline at end of file +}; +GlobalDecoderRegistry.register(CapabilityOwners.typeUrl, CapabilityOwners); \ No newline at end of file diff --git a/packages/osmojs/src/codegen/capability/v1/genesis.ts b/packages/osmojs/src/codegen/capability/v1/genesis.ts index a310f0ac9..f61c1bb26 100644 --- a/packages/osmojs/src/codegen/capability/v1/genesis.ts +++ b/packages/osmojs/src/codegen/capability/v1/genesis.ts @@ -1,5 +1,7 @@ import { CapabilityOwners, CapabilityOwnersAmino, CapabilityOwnersSDKType } from "./capability"; import { BinaryReader, BinaryWriter } from "../../binary"; +import { isSet } from "../../helpers"; +import { GlobalDecoderRegistry } from "../../registry"; /** GenesisOwners defines the capability owners with their corresponding index. */ export interface GenesisOwners { /** index is the index of the capability owner. */ @@ -14,9 +16,9 @@ export interface GenesisOwnersProtoMsg { /** GenesisOwners defines the capability owners with their corresponding index. */ export interface GenesisOwnersAmino { /** index is the index of the capability owner. */ - index: string; + index?: string; /** index_owners are the owners at the given index. */ - index_owners?: CapabilityOwnersAmino; + index_owners: CapabilityOwnersAmino; } export interface GenesisOwnersAminoMsg { type: "/capability.v1.GenesisOwners"; @@ -44,7 +46,7 @@ export interface GenesisStateProtoMsg { /** GenesisState defines the capability module's genesis state. */ export interface GenesisStateAmino { /** index is the capability global index. */ - index: string; + index?: string; /** * owners represents a map from index to owners of the capability index * index key is string to allow amino marshalling. @@ -68,6 +70,15 @@ function createBaseGenesisOwners(): GenesisOwners { } export const GenesisOwners = { typeUrl: "/capability.v1.GenesisOwners", + is(o: any): o is GenesisOwners { + return o && (o.$typeUrl === GenesisOwners.typeUrl || typeof o.index === "bigint" && CapabilityOwners.is(o.indexOwners)); + }, + isSDK(o: any): o is GenesisOwnersSDKType { + return o && (o.$typeUrl === GenesisOwners.typeUrl || typeof o.index === "bigint" && CapabilityOwners.isSDK(o.index_owners)); + }, + isAmino(o: any): o is GenesisOwnersAmino { + return o && (o.$typeUrl === GenesisOwners.typeUrl || typeof o.index === "bigint" && CapabilityOwners.isAmino(o.index_owners)); + }, encode(message: GenesisOwners, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.index !== BigInt(0)) { writer.uint32(8).uint64(message.index); @@ -97,6 +108,18 @@ export const GenesisOwners = { } return message; }, + fromJSON(object: any): GenesisOwners { + return { + index: isSet(object.index) ? BigInt(object.index.toString()) : BigInt(0), + indexOwners: isSet(object.indexOwners) ? CapabilityOwners.fromJSON(object.indexOwners) : undefined + }; + }, + toJSON(message: GenesisOwners): unknown { + const obj: any = {}; + message.index !== undefined && (obj.index = (message.index || BigInt(0)).toString()); + message.indexOwners !== undefined && (obj.indexOwners = message.indexOwners ? CapabilityOwners.toJSON(message.indexOwners) : undefined); + return obj; + }, fromPartial(object: Partial): GenesisOwners { const message = createBaseGenesisOwners(); message.index = object.index !== undefined && object.index !== null ? BigInt(object.index.toString()) : BigInt(0); @@ -104,15 +127,19 @@ export const GenesisOwners = { return message; }, fromAmino(object: GenesisOwnersAmino): GenesisOwners { - return { - index: BigInt(object.index), - indexOwners: object?.index_owners ? CapabilityOwners.fromAmino(object.index_owners) : undefined - }; + const message = createBaseGenesisOwners(); + if (object.index !== undefined && object.index !== null) { + message.index = BigInt(object.index); + } + if (object.index_owners !== undefined && object.index_owners !== null) { + message.indexOwners = CapabilityOwners.fromAmino(object.index_owners); + } + return message; }, toAmino(message: GenesisOwners): GenesisOwnersAmino { const obj: any = {}; obj.index = message.index ? message.index.toString() : undefined; - obj.index_owners = message.indexOwners ? CapabilityOwners.toAmino(message.indexOwners) : undefined; + obj.index_owners = message.indexOwners ? CapabilityOwners.toAmino(message.indexOwners) : CapabilityOwners.fromPartial({}); return obj; }, fromAminoMsg(object: GenesisOwnersAminoMsg): GenesisOwners { @@ -131,6 +158,7 @@ export const GenesisOwners = { }; } }; +GlobalDecoderRegistry.register(GenesisOwners.typeUrl, GenesisOwners); function createBaseGenesisState(): GenesisState { return { index: BigInt(0), @@ -139,6 +167,15 @@ function createBaseGenesisState(): GenesisState { } export const GenesisState = { typeUrl: "/capability.v1.GenesisState", + is(o: any): o is GenesisState { + return o && (o.$typeUrl === GenesisState.typeUrl || typeof o.index === "bigint" && Array.isArray(o.owners) && (!o.owners.length || GenesisOwners.is(o.owners[0]))); + }, + isSDK(o: any): o is GenesisStateSDKType { + return o && (o.$typeUrl === GenesisState.typeUrl || typeof o.index === "bigint" && Array.isArray(o.owners) && (!o.owners.length || GenesisOwners.isSDK(o.owners[0]))); + }, + isAmino(o: any): o is GenesisStateAmino { + return o && (o.$typeUrl === GenesisState.typeUrl || typeof o.index === "bigint" && Array.isArray(o.owners) && (!o.owners.length || GenesisOwners.isAmino(o.owners[0]))); + }, encode(message: GenesisState, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.index !== BigInt(0)) { writer.uint32(8).uint64(message.index); @@ -168,6 +205,22 @@ export const GenesisState = { } return message; }, + fromJSON(object: any): GenesisState { + return { + index: isSet(object.index) ? BigInt(object.index.toString()) : BigInt(0), + 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 || BigInt(0)).toString()); + if (message.owners) { + obj.owners = message.owners.map(e => e ? GenesisOwners.toJSON(e) : undefined); + } else { + obj.owners = []; + } + return obj; + }, fromPartial(object: Partial): GenesisState { const message = createBaseGenesisState(); message.index = object.index !== undefined && object.index !== null ? BigInt(object.index.toString()) : BigInt(0); @@ -175,10 +228,12 @@ export const GenesisState = { return message; }, fromAmino(object: GenesisStateAmino): GenesisState { - return { - index: BigInt(object.index), - owners: Array.isArray(object?.owners) ? object.owners.map((e: any) => GenesisOwners.fromAmino(e)) : [] - }; + const message = createBaseGenesisState(); + if (object.index !== undefined && object.index !== null) { + message.index = BigInt(object.index); + } + message.owners = object.owners?.map(e => GenesisOwners.fromAmino(e)) || []; + return message; }, toAmino(message: GenesisState): GenesisStateAmino { const obj: any = {}; @@ -205,4 +260,5 @@ export const GenesisState = { value: GenesisState.encode(message).finish() }; } -}; \ No newline at end of file +}; +GlobalDecoderRegistry.register(GenesisState.typeUrl, GenesisState); \ No newline at end of file diff --git a/packages/osmojs/src/codegen/confio/proofs.ts b/packages/osmojs/src/codegen/confio/proofs.ts index 9a98f4ff9..502ae4874 100644 --- a/packages/osmojs/src/codegen/confio/proofs.ts +++ b/packages/osmojs/src/codegen/confio/proofs.ts @@ -1,5 +1,6 @@ import { BinaryReader, BinaryWriter } from "../binary"; -import { isSet } from "../helpers"; +import { isSet, bytesFromBase64, base64FromBytes } from "../helpers"; +import { GlobalDecoderRegistry } from "../registry"; export enum HashOp { /** NO_HASH - NO_HASH is the default if no data passed. Note this is an illegal argument some places. */ NO_HASH = 0, @@ -171,7 +172,7 @@ export function lengthOpToJSON(object: LengthOp): string { export interface ExistenceProof { key: Uint8Array; value: Uint8Array; - leaf: LeafOp; + leaf?: LeafOp; path: InnerOp[]; } export interface ExistenceProofProtoMsg { @@ -200,10 +201,10 @@ export interface ExistenceProofProtoMsg { * length-prefix the data before hashing it. */ export interface ExistenceProofAmino { - key: Uint8Array; - value: Uint8Array; + key?: string; + value?: string; leaf?: LeafOpAmino; - path: InnerOpAmino[]; + path?: InnerOpAmino[]; } export interface ExistenceProofAminoMsg { type: "/ics23.ExistenceProof"; @@ -233,7 +234,7 @@ export interface ExistenceProofAminoMsg { export interface ExistenceProofSDKType { key: Uint8Array; value: Uint8Array; - leaf: LeafOpSDKType; + leaf?: LeafOpSDKType; path: InnerOpSDKType[]; } /** @@ -244,8 +245,8 @@ export interface ExistenceProofSDKType { export interface NonExistenceProof { /** TODO: remove this as unnecessary??? we prove a range */ key: Uint8Array; - left: ExistenceProof; - right: ExistenceProof; + left?: ExistenceProof; + right?: ExistenceProof; } export interface NonExistenceProofProtoMsg { typeUrl: "/ics23.NonExistenceProof"; @@ -258,7 +259,7 @@ export interface NonExistenceProofProtoMsg { */ export interface NonExistenceProofAmino { /** TODO: remove this as unnecessary??? we prove a range */ - key: Uint8Array; + key?: string; left?: ExistenceProofAmino; right?: ExistenceProofAmino; } @@ -273,8 +274,8 @@ export interface NonExistenceProofAminoMsg { */ export interface NonExistenceProofSDKType { key: Uint8Array; - left: ExistenceProofSDKType; - right: ExistenceProofSDKType; + left?: ExistenceProofSDKType; + right?: ExistenceProofSDKType; } /** CommitmentProof is either an ExistenceProof or a NonExistenceProof, or a Batch of such messages */ export interface CommitmentProof { @@ -353,15 +354,15 @@ export interface LeafOpProtoMsg { * output = hash(prefix || length(hkey) || hkey || length(hvalue) || hvalue) */ export interface LeafOpAmino { - hash: HashOp; - prehash_key: HashOp; - prehash_value: HashOp; - length: LengthOp; + hash?: HashOp; + prehash_key?: HashOp; + prehash_value?: 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?: string; } export interface LeafOpAminoMsg { type: "/ics23.LeafOp"; @@ -434,9 +435,9 @@ export interface InnerOpProtoMsg { * If either of prefix or suffix is empty, we just treat it as an empty string */ export interface InnerOpAmino { - hash: HashOp; - prefix: Uint8Array; - suffix: Uint8Array; + hash?: HashOp; + prefix?: string; + suffix?: string; } export interface InnerOpAminoMsg { type: "/ics23.InnerOp"; @@ -481,8 +482,8 @@ 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; /** min_depth (if > 0) is the minimum number of InnerOps allowed (mainly for fixed-depth tries) */ @@ -512,9 +513,9 @@ export interface ProofSpecAmino { leaf_spec?: LeafOpAmino; inner_spec?: InnerSpecAmino; /** max_depth (if > 0) is the maximum number of InnerOps allowed (mainly for fixed-depth tries) */ - max_depth: number; + max_depth?: number; /** min_depth (if > 0) is the minimum number of InnerOps allowed (mainly for fixed-depth tries) */ - min_depth: number; + min_depth?: number; } export interface ProofSpecAminoMsg { type: "/ics23.ProofSpec"; @@ -533,8 +534,8 @@ export interface ProofSpecAminoMsg { * tree format server uses. But not in code, rather a configuration object. */ export interface ProofSpecSDKType { - leaf_spec: LeafOpSDKType; - inner_spec: InnerSpecSDKType; + leaf_spec?: LeafOpSDKType; + inner_spec?: InnerSpecSDKType; max_depth: number; min_depth: number; } @@ -583,14 +584,14 @@ export interface InnerSpecAmino { * iavl tree is [0, 1] (left then right) * merk is [0, 2, 1] (left, right, here) */ - child_order: number[]; - child_size: number; - min_prefix_length: number; - max_prefix_length: number; + child_order?: number[]; + child_size?: number; + min_prefix_length?: number; + max_prefix_length?: number; /** empty child is the prehash image that is used when one child is nil (eg. 20 bytes of 0) */ - empty_child: Uint8Array; + empty_child?: string; /** hash is the algorithm that must be used for each InnerOp */ - hash: HashOp; + hash?: HashOp; } export interface InnerSpecAminoMsg { type: "/ics23.InnerSpec"; @@ -624,7 +625,7 @@ export interface BatchProofProtoMsg { } /** BatchProof is a group of multiple proof types than can be compressed */ export interface BatchProofAmino { - entries: BatchEntryAmino[]; + entries?: BatchEntryAmino[]; } export interface BatchProofAminoMsg { type: "/ics23.BatchProof"; @@ -666,8 +667,8 @@ export interface CompressedBatchProofProtoMsg { value: Uint8Array; } export interface CompressedBatchProofAmino { - entries: CompressedBatchEntryAmino[]; - lookup_inners: InnerOpAmino[]; + entries?: CompressedBatchEntryAmino[]; + lookup_inners?: InnerOpAmino[]; } export interface CompressedBatchProofAminoMsg { type: "/ics23.CompressedBatchProof"; @@ -703,7 +704,7 @@ export interface CompressedBatchEntrySDKType { export interface CompressedExistenceProof { key: Uint8Array; value: Uint8Array; - leaf: LeafOp; + leaf?: LeafOp; /** these are indexes into the lookup_inners table in CompressedBatchProof */ path: number[]; } @@ -712,11 +713,11 @@ export interface CompressedExistenceProofProtoMsg { value: Uint8Array; } export interface CompressedExistenceProofAmino { - key: Uint8Array; - value: Uint8Array; + key?: string; + value?: string; leaf?: LeafOpAmino; /** these are indexes into the lookup_inners table in CompressedBatchProof */ - path: number[]; + path?: number[]; } export interface CompressedExistenceProofAminoMsg { type: "/ics23.CompressedExistenceProof"; @@ -725,14 +726,14 @@ export interface CompressedExistenceProofAminoMsg { export interface CompressedExistenceProofSDKType { key: Uint8Array; value: Uint8Array; - leaf: LeafOpSDKType; + leaf?: LeafOpSDKType; path: number[]; } export interface CompressedNonExistenceProof { /** TODO: remove this as unnecessary??? we prove a range */ key: Uint8Array; - left: CompressedExistenceProof; - right: CompressedExistenceProof; + left?: CompressedExistenceProof; + right?: CompressedExistenceProof; } export interface CompressedNonExistenceProofProtoMsg { typeUrl: "/ics23.CompressedNonExistenceProof"; @@ -740,7 +741,7 @@ export interface CompressedNonExistenceProofProtoMsg { } export interface CompressedNonExistenceProofAmino { /** TODO: remove this as unnecessary??? we prove a range */ - key: Uint8Array; + key?: string; left?: CompressedExistenceProofAmino; right?: CompressedExistenceProofAmino; } @@ -750,19 +751,28 @@ export interface CompressedNonExistenceProofAminoMsg { } export interface CompressedNonExistenceProofSDKType { key: Uint8Array; - left: CompressedExistenceProofSDKType; - right: CompressedExistenceProofSDKType; + left?: CompressedExistenceProofSDKType; + right?: CompressedExistenceProofSDKType; } function createBaseExistenceProof(): ExistenceProof { return { key: new Uint8Array(), value: new Uint8Array(), - leaf: LeafOp.fromPartial({}), + leaf: undefined, path: [] }; } export const ExistenceProof = { typeUrl: "/ics23.ExistenceProof", + is(o: any): o is ExistenceProof { + return o && (o.$typeUrl === ExistenceProof.typeUrl || (o.key instanceof Uint8Array || typeof o.key === "string") && (o.value instanceof Uint8Array || typeof o.value === "string") && Array.isArray(o.path) && (!o.path.length || InnerOp.is(o.path[0]))); + }, + isSDK(o: any): o is ExistenceProofSDKType { + return o && (o.$typeUrl === ExistenceProof.typeUrl || (o.key instanceof Uint8Array || typeof o.key === "string") && (o.value instanceof Uint8Array || typeof o.value === "string") && Array.isArray(o.path) && (!o.path.length || InnerOp.isSDK(o.path[0]))); + }, + isAmino(o: any): o is ExistenceProofAmino { + return o && (o.$typeUrl === ExistenceProof.typeUrl || (o.key instanceof Uint8Array || typeof o.key === "string") && (o.value instanceof Uint8Array || typeof o.value === "string") && Array.isArray(o.path) && (!o.path.length || InnerOp.isAmino(o.path[0]))); + }, encode(message: ExistenceProof, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.key.length !== 0) { writer.uint32(10).bytes(message.key); @@ -804,6 +814,26 @@ export const ExistenceProof = { } return message; }, + fromJSON(object: any): ExistenceProof { + return { + 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)) : [] + }; + }, + toJSON(message: ExistenceProof): unknown { + const obj: any = {}; + message.key !== undefined && (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); + if (message.path) { + obj.path = message.path.map(e => e ? InnerOp.toJSON(e) : undefined); + } else { + obj.path = []; + } + return obj; + }, fromPartial(object: Partial): ExistenceProof { const message = createBaseExistenceProof(); message.key = object.key ?? new Uint8Array(); @@ -813,17 +843,23 @@ export const ExistenceProof = { return message; }, fromAmino(object: ExistenceProofAmino): ExistenceProof { - return { - key: object.key, - value: object.value, - leaf: object?.leaf ? LeafOp.fromAmino(object.leaf) : undefined, - path: Array.isArray(object?.path) ? object.path.map((e: any) => InnerOp.fromAmino(e)) : [] - }; + const message = createBaseExistenceProof(); + if (object.key !== undefined && object.key !== null) { + message.key = bytesFromBase64(object.key); + } + if (object.value !== undefined && object.value !== null) { + message.value = bytesFromBase64(object.value); + } + if (object.leaf !== undefined && object.leaf !== null) { + message.leaf = LeafOp.fromAmino(object.leaf); + } + message.path = object.path?.map(e => InnerOp.fromAmino(e)) || []; + return message; }, toAmino(message: ExistenceProof): ExistenceProofAmino { const obj: any = {}; - obj.key = message.key; - obj.value = message.value; + obj.key = message.key ? base64FromBytes(message.key) : undefined; + obj.value = message.value ? base64FromBytes(message.value) : undefined; obj.leaf = message.leaf ? LeafOp.toAmino(message.leaf) : undefined; if (message.path) { obj.path = message.path.map(e => e ? InnerOp.toAmino(e) : undefined); @@ -848,15 +884,25 @@ export const ExistenceProof = { }; } }; +GlobalDecoderRegistry.register(ExistenceProof.typeUrl, ExistenceProof); function createBaseNonExistenceProof(): NonExistenceProof { return { key: new Uint8Array(), - left: ExistenceProof.fromPartial({}), - right: ExistenceProof.fromPartial({}) + left: undefined, + right: undefined }; } export const NonExistenceProof = { typeUrl: "/ics23.NonExistenceProof", + is(o: any): o is NonExistenceProof { + return o && (o.$typeUrl === NonExistenceProof.typeUrl || o.key instanceof Uint8Array || typeof o.key === "string"); + }, + isSDK(o: any): o is NonExistenceProofSDKType { + return o && (o.$typeUrl === NonExistenceProof.typeUrl || o.key instanceof Uint8Array || typeof o.key === "string"); + }, + isAmino(o: any): o is NonExistenceProofAmino { + return o && (o.$typeUrl === NonExistenceProof.typeUrl || o.key instanceof Uint8Array || typeof o.key === "string"); + }, encode(message: NonExistenceProof, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.key.length !== 0) { writer.uint32(10).bytes(message.key); @@ -892,6 +938,20 @@ export const NonExistenceProof = { } return message; }, + fromJSON(object: any): NonExistenceProof { + return { + 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 = {}; + 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(object: Partial): NonExistenceProof { const message = createBaseNonExistenceProof(); message.key = object.key ?? new Uint8Array(); @@ -900,15 +960,21 @@ export const NonExistenceProof = { return message; }, fromAmino(object: NonExistenceProofAmino): NonExistenceProof { - return { - key: object.key, - left: object?.left ? ExistenceProof.fromAmino(object.left) : undefined, - right: object?.right ? ExistenceProof.fromAmino(object.right) : undefined - }; + const message = createBaseNonExistenceProof(); + if (object.key !== undefined && object.key !== null) { + message.key = bytesFromBase64(object.key); + } + if (object.left !== undefined && object.left !== null) { + message.left = ExistenceProof.fromAmino(object.left); + } + if (object.right !== undefined && object.right !== null) { + message.right = ExistenceProof.fromAmino(object.right); + } + return message; }, toAmino(message: NonExistenceProof): NonExistenceProofAmino { const obj: any = {}; - obj.key = message.key; + obj.key = message.key ? base64FromBytes(message.key) : undefined; obj.left = message.left ? ExistenceProof.toAmino(message.left) : undefined; obj.right = message.right ? ExistenceProof.toAmino(message.right) : undefined; return obj; @@ -929,6 +995,7 @@ export const NonExistenceProof = { }; } }; +GlobalDecoderRegistry.register(NonExistenceProof.typeUrl, NonExistenceProof); function createBaseCommitmentProof(): CommitmentProof { return { exist: undefined, @@ -939,6 +1006,15 @@ function createBaseCommitmentProof(): CommitmentProof { } export const CommitmentProof = { typeUrl: "/ics23.CommitmentProof", + is(o: any): o is CommitmentProof { + return o && o.$typeUrl === CommitmentProof.typeUrl; + }, + isSDK(o: any): o is CommitmentProofSDKType { + return o && o.$typeUrl === CommitmentProof.typeUrl; + }, + isAmino(o: any): o is CommitmentProofAmino { + return o && o.$typeUrl === CommitmentProof.typeUrl; + }, encode(message: CommitmentProof, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.exist !== undefined) { ExistenceProof.encode(message.exist, writer.uint32(10).fork()).ldelim(); @@ -980,6 +1056,22 @@ export const CommitmentProof = { } 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, + batch: isSet(object.batch) ? BatchProof.fromJSON(object.batch) : 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); + message.nonexist !== 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(object: Partial): CommitmentProof { const message = createBaseCommitmentProof(); message.exist = object.exist !== undefined && object.exist !== null ? ExistenceProof.fromPartial(object.exist) : undefined; @@ -989,12 +1081,20 @@ export const CommitmentProof = { return message; }, fromAmino(object: CommitmentProofAmino): CommitmentProof { - return { - exist: object?.exist ? ExistenceProof.fromAmino(object.exist) : undefined, - nonexist: object?.nonexist ? NonExistenceProof.fromAmino(object.nonexist) : undefined, - batch: object?.batch ? BatchProof.fromAmino(object.batch) : undefined, - compressed: object?.compressed ? CompressedBatchProof.fromAmino(object.compressed) : undefined - }; + const message = createBaseCommitmentProof(); + if (object.exist !== undefined && object.exist !== null) { + message.exist = ExistenceProof.fromAmino(object.exist); + } + if (object.nonexist !== undefined && object.nonexist !== null) { + message.nonexist = NonExistenceProof.fromAmino(object.nonexist); + } + if (object.batch !== undefined && object.batch !== null) { + message.batch = BatchProof.fromAmino(object.batch); + } + if (object.compressed !== undefined && object.compressed !== null) { + message.compressed = CompressedBatchProof.fromAmino(object.compressed); + } + return message; }, toAmino(message: CommitmentProof): CommitmentProofAmino { const obj: any = {}; @@ -1020,6 +1120,7 @@ export const CommitmentProof = { }; } }; +GlobalDecoderRegistry.register(CommitmentProof.typeUrl, CommitmentProof); function createBaseLeafOp(): LeafOp { return { hash: 0, @@ -1031,6 +1132,15 @@ function createBaseLeafOp(): LeafOp { } export const LeafOp = { typeUrl: "/ics23.LeafOp", + is(o: any): o is LeafOp { + return o && (o.$typeUrl === LeafOp.typeUrl || isSet(o.hash) && isSet(o.prehashKey) && isSet(o.prehashValue) && isSet(o.length) && (o.prefix instanceof Uint8Array || typeof o.prefix === "string")); + }, + isSDK(o: any): o is LeafOpSDKType { + return o && (o.$typeUrl === LeafOp.typeUrl || isSet(o.hash) && isSet(o.prehash_key) && isSet(o.prehash_value) && isSet(o.length) && (o.prefix instanceof Uint8Array || typeof o.prefix === "string")); + }, + isAmino(o: any): o is LeafOpAmino { + return o && (o.$typeUrl === LeafOp.typeUrl || isSet(o.hash) && isSet(o.prehash_key) && isSet(o.prehash_value) && isSet(o.length) && (o.prefix instanceof Uint8Array || typeof o.prefix === "string")); + }, encode(message: LeafOp, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.hash !== 0) { writer.uint32(8).int32(message.hash); @@ -1078,6 +1188,24 @@ export const LeafOp = { } return message; }, + fromJSON(object: any): LeafOp { + return { + hash: isSet(object.hash) ? hashOpFromJSON(object.hash) : -1, + prehashKey: isSet(object.prehashKey) ? hashOpFromJSON(object.prehashKey) : -1, + prehashValue: isSet(object.prehashValue) ? hashOpFromJSON(object.prehashValue) : -1, + length: isSet(object.length) ? lengthOpFromJSON(object.length) : -1, + 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)); + message.prefix !== undefined && (obj.prefix = base64FromBytes(message.prefix !== undefined ? message.prefix : new Uint8Array())); + return obj; + }, fromPartial(object: Partial): LeafOp { const message = createBaseLeafOp(); message.hash = object.hash ?? 0; @@ -1088,21 +1216,31 @@ export const LeafOp = { return message; }, fromAmino(object: LeafOpAmino): LeafOp { - return { - hash: isSet(object.hash) ? hashOpFromJSON(object.hash) : -1, - prehashKey: isSet(object.prehash_key) ? hashOpFromJSON(object.prehash_key) : -1, - prehashValue: isSet(object.prehash_value) ? hashOpFromJSON(object.prehash_value) : -1, - length: isSet(object.length) ? lengthOpFromJSON(object.length) : -1, - prefix: object.prefix - }; + const message = createBaseLeafOp(); + if (object.hash !== undefined && object.hash !== null) { + message.hash = hashOpFromJSON(object.hash); + } + if (object.prehash_key !== undefined && object.prehash_key !== null) { + message.prehashKey = hashOpFromJSON(object.prehash_key); + } + if (object.prehash_value !== undefined && object.prehash_value !== null) { + message.prehashValue = hashOpFromJSON(object.prehash_value); + } + if (object.length !== undefined && object.length !== null) { + message.length = lengthOpFromJSON(object.length); + } + if (object.prefix !== undefined && object.prefix !== null) { + message.prefix = bytesFromBase64(object.prefix); + } + return message; }, toAmino(message: LeafOp): LeafOpAmino { const obj: any = {}; - obj.hash = message.hash; - obj.prehash_key = message.prehashKey; - obj.prehash_value = message.prehashValue; - obj.length = message.length; - obj.prefix = message.prefix; + obj.hash = hashOpToJSON(message.hash); + obj.prehash_key = hashOpToJSON(message.prehashKey); + obj.prehash_value = hashOpToJSON(message.prehashValue); + obj.length = lengthOpToJSON(message.length); + obj.prefix = message.prefix ? base64FromBytes(message.prefix) : undefined; return obj; }, fromAminoMsg(object: LeafOpAminoMsg): LeafOp { @@ -1121,6 +1259,7 @@ export const LeafOp = { }; } }; +GlobalDecoderRegistry.register(LeafOp.typeUrl, LeafOp); function createBaseInnerOp(): InnerOp { return { hash: 0, @@ -1130,6 +1269,15 @@ function createBaseInnerOp(): InnerOp { } export const InnerOp = { typeUrl: "/ics23.InnerOp", + is(o: any): o is InnerOp { + return o && (o.$typeUrl === InnerOp.typeUrl || isSet(o.hash) && (o.prefix instanceof Uint8Array || typeof o.prefix === "string") && (o.suffix instanceof Uint8Array || typeof o.suffix === "string")); + }, + isSDK(o: any): o is InnerOpSDKType { + return o && (o.$typeUrl === InnerOp.typeUrl || isSet(o.hash) && (o.prefix instanceof Uint8Array || typeof o.prefix === "string") && (o.suffix instanceof Uint8Array || typeof o.suffix === "string")); + }, + isAmino(o: any): o is InnerOpAmino { + return o && (o.$typeUrl === InnerOp.typeUrl || isSet(o.hash) && (o.prefix instanceof Uint8Array || typeof o.prefix === "string") && (o.suffix instanceof Uint8Array || typeof o.suffix === "string")); + }, encode(message: InnerOp, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.hash !== 0) { writer.uint32(8).int32(message.hash); @@ -1165,6 +1313,20 @@ export const InnerOp = { } return message; }, + fromJSON(object: any): InnerOp { + return { + hash: isSet(object.hash) ? hashOpFromJSON(object.hash) : -1, + 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)); + message.prefix !== undefined && (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; + }, fromPartial(object: Partial): InnerOp { const message = createBaseInnerOp(); message.hash = object.hash ?? 0; @@ -1173,17 +1335,23 @@ export const InnerOp = { return message; }, fromAmino(object: InnerOpAmino): InnerOp { - return { - hash: isSet(object.hash) ? hashOpFromJSON(object.hash) : -1, - prefix: object.prefix, - suffix: object.suffix - }; + const message = createBaseInnerOp(); + if (object.hash !== undefined && object.hash !== null) { + message.hash = hashOpFromJSON(object.hash); + } + if (object.prefix !== undefined && object.prefix !== null) { + message.prefix = bytesFromBase64(object.prefix); + } + if (object.suffix !== undefined && object.suffix !== null) { + message.suffix = bytesFromBase64(object.suffix); + } + return message; }, toAmino(message: InnerOp): InnerOpAmino { const obj: any = {}; - obj.hash = message.hash; - obj.prefix = message.prefix; - obj.suffix = message.suffix; + obj.hash = hashOpToJSON(message.hash); + obj.prefix = message.prefix ? base64FromBytes(message.prefix) : undefined; + obj.suffix = message.suffix ? base64FromBytes(message.suffix) : undefined; return obj; }, fromAminoMsg(object: InnerOpAminoMsg): InnerOp { @@ -1202,16 +1370,26 @@ export const InnerOp = { }; } }; +GlobalDecoderRegistry.register(InnerOp.typeUrl, InnerOp); function createBaseProofSpec(): ProofSpec { return { - leafSpec: LeafOp.fromPartial({}), - innerSpec: InnerSpec.fromPartial({}), + leafSpec: undefined, + innerSpec: undefined, maxDepth: 0, minDepth: 0 }; } export const ProofSpec = { typeUrl: "/ics23.ProofSpec", + is(o: any): o is ProofSpec { + return o && (o.$typeUrl === ProofSpec.typeUrl || typeof o.maxDepth === "number" && typeof o.minDepth === "number"); + }, + isSDK(o: any): o is ProofSpecSDKType { + return o && (o.$typeUrl === ProofSpec.typeUrl || typeof o.max_depth === "number" && typeof o.min_depth === "number"); + }, + isAmino(o: any): o is ProofSpecAmino { + return o && (o.$typeUrl === ProofSpec.typeUrl || typeof o.max_depth === "number" && typeof o.min_depth === "number"); + }, encode(message: ProofSpec, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.leafSpec !== undefined) { LeafOp.encode(message.leafSpec, writer.uint32(10).fork()).ldelim(); @@ -1253,6 +1431,22 @@ export const ProofSpec = { } 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, + 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); + 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; + }, fromPartial(object: Partial): ProofSpec { const message = createBaseProofSpec(); message.leafSpec = object.leafSpec !== undefined && object.leafSpec !== null ? LeafOp.fromPartial(object.leafSpec) : undefined; @@ -1262,12 +1456,20 @@ export const ProofSpec = { return message; }, fromAmino(object: ProofSpecAmino): ProofSpec { - return { - leafSpec: object?.leaf_spec ? LeafOp.fromAmino(object.leaf_spec) : undefined, - innerSpec: object?.inner_spec ? InnerSpec.fromAmino(object.inner_spec) : undefined, - maxDepth: object.max_depth, - minDepth: object.min_depth - }; + const message = createBaseProofSpec(); + if (object.leaf_spec !== undefined && object.leaf_spec !== null) { + message.leafSpec = LeafOp.fromAmino(object.leaf_spec); + } + if (object.inner_spec !== undefined && object.inner_spec !== null) { + message.innerSpec = InnerSpec.fromAmino(object.inner_spec); + } + if (object.max_depth !== undefined && object.max_depth !== null) { + message.maxDepth = object.max_depth; + } + if (object.min_depth !== undefined && object.min_depth !== null) { + message.minDepth = object.min_depth; + } + return message; }, toAmino(message: ProofSpec): ProofSpecAmino { const obj: any = {}; @@ -1293,6 +1495,7 @@ export const ProofSpec = { }; } }; +GlobalDecoderRegistry.register(ProofSpec.typeUrl, ProofSpec); function createBaseInnerSpec(): InnerSpec { return { childOrder: [], @@ -1305,6 +1508,15 @@ function createBaseInnerSpec(): InnerSpec { } export const InnerSpec = { typeUrl: "/ics23.InnerSpec", + is(o: any): o is InnerSpec { + return o && (o.$typeUrl === InnerSpec.typeUrl || Array.isArray(o.childOrder) && (!o.childOrder.length || typeof o.childOrder[0] === "number") && typeof o.childSize === "number" && typeof o.minPrefixLength === "number" && typeof o.maxPrefixLength === "number" && (o.emptyChild instanceof Uint8Array || typeof o.emptyChild === "string") && isSet(o.hash)); + }, + isSDK(o: any): o is InnerSpecSDKType { + return o && (o.$typeUrl === InnerSpec.typeUrl || Array.isArray(o.child_order) && (!o.child_order.length || typeof o.child_order[0] === "number") && typeof o.child_size === "number" && typeof o.min_prefix_length === "number" && typeof o.max_prefix_length === "number" && (o.empty_child instanceof Uint8Array || typeof o.empty_child === "string") && isSet(o.hash)); + }, + isAmino(o: any): o is InnerSpecAmino { + return o && (o.$typeUrl === InnerSpec.typeUrl || Array.isArray(o.child_order) && (!o.child_order.length || typeof o.child_order[0] === "number") && typeof o.child_size === "number" && typeof o.min_prefix_length === "number" && typeof o.max_prefix_length === "number" && (o.empty_child instanceof Uint8Array || typeof o.empty_child === "string") && isSet(o.hash)); + }, encode(message: InnerSpec, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { writer.uint32(10).fork(); for (const v of message.childOrder) { @@ -1367,6 +1579,30 @@ export const InnerSpec = { } return message; }, + fromJSON(object: any): InnerSpec { + return { + 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(), + hash: isSet(object.hash) ? hashOpFromJSON(object.hash) : -1 + }; + }, + toJSON(message: InnerSpec): unknown { + const obj: any = {}; + if (message.childOrder) { + obj.childOrder = message.childOrder.map(e => Math.round(e)); + } else { + 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.emptyChild !== undefined && (obj.emptyChild = base64FromBytes(message.emptyChild !== undefined ? message.emptyChild : new Uint8Array())); + message.hash !== undefined && (obj.hash = hashOpToJSON(message.hash)); + return obj; + }, fromPartial(object: Partial): InnerSpec { const message = createBaseInnerSpec(); message.childOrder = object.childOrder?.map(e => e) || []; @@ -1378,14 +1614,24 @@ export const InnerSpec = { return message; }, fromAmino(object: InnerSpecAmino): InnerSpec { - return { - childOrder: Array.isArray(object?.child_order) ? object.child_order.map((e: any) => e) : [], - childSize: object.child_size, - minPrefixLength: object.min_prefix_length, - maxPrefixLength: object.max_prefix_length, - emptyChild: object.empty_child, - hash: isSet(object.hash) ? hashOpFromJSON(object.hash) : -1 - }; + const message = createBaseInnerSpec(); + message.childOrder = object.child_order?.map(e => e) || []; + if (object.child_size !== undefined && object.child_size !== null) { + message.childSize = object.child_size; + } + if (object.min_prefix_length !== undefined && object.min_prefix_length !== null) { + message.minPrefixLength = object.min_prefix_length; + } + if (object.max_prefix_length !== undefined && object.max_prefix_length !== null) { + message.maxPrefixLength = object.max_prefix_length; + } + if (object.empty_child !== undefined && object.empty_child !== null) { + message.emptyChild = bytesFromBase64(object.empty_child); + } + if (object.hash !== undefined && object.hash !== null) { + message.hash = hashOpFromJSON(object.hash); + } + return message; }, toAmino(message: InnerSpec): InnerSpecAmino { const obj: any = {}; @@ -1397,8 +1643,8 @@ export const InnerSpec = { obj.child_size = message.childSize; obj.min_prefix_length = message.minPrefixLength; obj.max_prefix_length = message.maxPrefixLength; - obj.empty_child = message.emptyChild; - obj.hash = message.hash; + obj.empty_child = message.emptyChild ? base64FromBytes(message.emptyChild) : undefined; + obj.hash = hashOpToJSON(message.hash); return obj; }, fromAminoMsg(object: InnerSpecAminoMsg): InnerSpec { @@ -1417,6 +1663,7 @@ export const InnerSpec = { }; } }; +GlobalDecoderRegistry.register(InnerSpec.typeUrl, InnerSpec); function createBaseBatchProof(): BatchProof { return { entries: [] @@ -1424,6 +1671,15 @@ function createBaseBatchProof(): BatchProof { } export const BatchProof = { typeUrl: "/ics23.BatchProof", + is(o: any): o is BatchProof { + return o && (o.$typeUrl === BatchProof.typeUrl || Array.isArray(o.entries) && (!o.entries.length || BatchEntry.is(o.entries[0]))); + }, + isSDK(o: any): o is BatchProofSDKType { + return o && (o.$typeUrl === BatchProof.typeUrl || Array.isArray(o.entries) && (!o.entries.length || BatchEntry.isSDK(o.entries[0]))); + }, + isAmino(o: any): o is BatchProofAmino { + return o && (o.$typeUrl === BatchProof.typeUrl || Array.isArray(o.entries) && (!o.entries.length || BatchEntry.isAmino(o.entries[0]))); + }, encode(message: BatchProof, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.entries) { BatchEntry.encode(v!, writer.uint32(10).fork()).ldelim(); @@ -1447,15 +1703,29 @@ export const BatchProof = { } return message; }, + fromJSON(object: any): BatchProof { + return { + entries: Array.isArray(object?.entries) ? object.entries.map((e: any) => BatchEntry.fromJSON(e)) : [] + }; + }, + toJSON(message: BatchProof): unknown { + const obj: any = {}; + if (message.entries) { + obj.entries = message.entries.map(e => e ? BatchEntry.toJSON(e) : undefined); + } else { + obj.entries = []; + } + return obj; + }, fromPartial(object: Partial): BatchProof { const message = createBaseBatchProof(); message.entries = object.entries?.map(e => BatchEntry.fromPartial(e)) || []; return message; }, fromAmino(object: BatchProofAmino): BatchProof { - return { - entries: Array.isArray(object?.entries) ? object.entries.map((e: any) => BatchEntry.fromAmino(e)) : [] - }; + const message = createBaseBatchProof(); + message.entries = object.entries?.map(e => BatchEntry.fromAmino(e)) || []; + return message; }, toAmino(message: BatchProof): BatchProofAmino { const obj: any = {}; @@ -1482,6 +1752,7 @@ export const BatchProof = { }; } }; +GlobalDecoderRegistry.register(BatchProof.typeUrl, BatchProof); function createBaseBatchEntry(): BatchEntry { return { exist: undefined, @@ -1490,6 +1761,15 @@ function createBaseBatchEntry(): BatchEntry { } export const BatchEntry = { typeUrl: "/ics23.BatchEntry", + is(o: any): o is BatchEntry { + return o && o.$typeUrl === BatchEntry.typeUrl; + }, + isSDK(o: any): o is BatchEntrySDKType { + return o && o.$typeUrl === BatchEntry.typeUrl; + }, + isAmino(o: any): o is BatchEntryAmino { + return o && o.$typeUrl === BatchEntry.typeUrl; + }, encode(message: BatchEntry, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.exist !== undefined) { ExistenceProof.encode(message.exist, writer.uint32(10).fork()).ldelim(); @@ -1519,6 +1799,18 @@ export const BatchEntry = { } 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 + }; + }, + toJSON(message: BatchEntry): unknown { + 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; + }, fromPartial(object: Partial): BatchEntry { const message = createBaseBatchEntry(); message.exist = object.exist !== undefined && object.exist !== null ? ExistenceProof.fromPartial(object.exist) : undefined; @@ -1526,10 +1818,14 @@ export const BatchEntry = { return message; }, fromAmino(object: BatchEntryAmino): BatchEntry { - return { - exist: object?.exist ? ExistenceProof.fromAmino(object.exist) : undefined, - nonexist: object?.nonexist ? NonExistenceProof.fromAmino(object.nonexist) : undefined - }; + const message = createBaseBatchEntry(); + if (object.exist !== undefined && object.exist !== null) { + message.exist = ExistenceProof.fromAmino(object.exist); + } + if (object.nonexist !== undefined && object.nonexist !== null) { + message.nonexist = NonExistenceProof.fromAmino(object.nonexist); + } + return message; }, toAmino(message: BatchEntry): BatchEntryAmino { const obj: any = {}; @@ -1553,6 +1849,7 @@ export const BatchEntry = { }; } }; +GlobalDecoderRegistry.register(BatchEntry.typeUrl, BatchEntry); function createBaseCompressedBatchProof(): CompressedBatchProof { return { entries: [], @@ -1561,6 +1858,15 @@ function createBaseCompressedBatchProof(): CompressedBatchProof { } export const CompressedBatchProof = { typeUrl: "/ics23.CompressedBatchProof", + is(o: any): o is CompressedBatchProof { + return o && (o.$typeUrl === CompressedBatchProof.typeUrl || Array.isArray(o.entries) && (!o.entries.length || CompressedBatchEntry.is(o.entries[0])) && Array.isArray(o.lookupInners) && (!o.lookupInners.length || InnerOp.is(o.lookupInners[0]))); + }, + isSDK(o: any): o is CompressedBatchProofSDKType { + return o && (o.$typeUrl === CompressedBatchProof.typeUrl || Array.isArray(o.entries) && (!o.entries.length || CompressedBatchEntry.isSDK(o.entries[0])) && Array.isArray(o.lookup_inners) && (!o.lookup_inners.length || InnerOp.isSDK(o.lookup_inners[0]))); + }, + isAmino(o: any): o is CompressedBatchProofAmino { + return o && (o.$typeUrl === CompressedBatchProof.typeUrl || Array.isArray(o.entries) && (!o.entries.length || CompressedBatchEntry.isAmino(o.entries[0])) && Array.isArray(o.lookup_inners) && (!o.lookup_inners.length || InnerOp.isAmino(o.lookup_inners[0]))); + }, encode(message: CompressedBatchProof, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.entries) { CompressedBatchEntry.encode(v!, writer.uint32(10).fork()).ldelim(); @@ -1590,6 +1896,26 @@ export const CompressedBatchProof = { } 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)) : [] + }; + }, + toJSON(message: CompressedBatchProof): unknown { + const obj: any = {}; + if (message.entries) { + obj.entries = message.entries.map(e => e ? CompressedBatchEntry.toJSON(e) : undefined); + } else { + obj.entries = []; + } + if (message.lookupInners) { + obj.lookupInners = message.lookupInners.map(e => e ? InnerOp.toJSON(e) : undefined); + } else { + obj.lookupInners = []; + } + return obj; + }, fromPartial(object: Partial): CompressedBatchProof { const message = createBaseCompressedBatchProof(); message.entries = object.entries?.map(e => CompressedBatchEntry.fromPartial(e)) || []; @@ -1597,10 +1923,10 @@ export const CompressedBatchProof = { return message; }, fromAmino(object: CompressedBatchProofAmino): CompressedBatchProof { - return { - entries: Array.isArray(object?.entries) ? object.entries.map((e: any) => CompressedBatchEntry.fromAmino(e)) : [], - lookupInners: Array.isArray(object?.lookup_inners) ? object.lookup_inners.map((e: any) => InnerOp.fromAmino(e)) : [] - }; + const message = createBaseCompressedBatchProof(); + message.entries = object.entries?.map(e => CompressedBatchEntry.fromAmino(e)) || []; + message.lookupInners = object.lookup_inners?.map(e => InnerOp.fromAmino(e)) || []; + return message; }, toAmino(message: CompressedBatchProof): CompressedBatchProofAmino { const obj: any = {}; @@ -1632,6 +1958,7 @@ export const CompressedBatchProof = { }; } }; +GlobalDecoderRegistry.register(CompressedBatchProof.typeUrl, CompressedBatchProof); function createBaseCompressedBatchEntry(): CompressedBatchEntry { return { exist: undefined, @@ -1640,6 +1967,15 @@ function createBaseCompressedBatchEntry(): CompressedBatchEntry { } export const CompressedBatchEntry = { typeUrl: "/ics23.CompressedBatchEntry", + is(o: any): o is CompressedBatchEntry { + return o && o.$typeUrl === CompressedBatchEntry.typeUrl; + }, + isSDK(o: any): o is CompressedBatchEntrySDKType { + return o && o.$typeUrl === CompressedBatchEntry.typeUrl; + }, + isAmino(o: any): o is CompressedBatchEntryAmino { + return o && o.$typeUrl === CompressedBatchEntry.typeUrl; + }, encode(message: CompressedBatchEntry, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.exist !== undefined) { CompressedExistenceProof.encode(message.exist, writer.uint32(10).fork()).ldelim(); @@ -1669,6 +2005,18 @@ export const CompressedBatchEntry = { } 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 + }; + }, + toJSON(message: CompressedBatchEntry): unknown { + const obj: any = {}; + 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(object: Partial): CompressedBatchEntry { const message = createBaseCompressedBatchEntry(); message.exist = object.exist !== undefined && object.exist !== null ? CompressedExistenceProof.fromPartial(object.exist) : undefined; @@ -1676,10 +2024,14 @@ export const CompressedBatchEntry = { return message; }, fromAmino(object: CompressedBatchEntryAmino): CompressedBatchEntry { - return { - exist: object?.exist ? CompressedExistenceProof.fromAmino(object.exist) : undefined, - nonexist: object?.nonexist ? CompressedNonExistenceProof.fromAmino(object.nonexist) : undefined - }; + const message = createBaseCompressedBatchEntry(); + if (object.exist !== undefined && object.exist !== null) { + message.exist = CompressedExistenceProof.fromAmino(object.exist); + } + if (object.nonexist !== undefined && object.nonexist !== null) { + message.nonexist = CompressedNonExistenceProof.fromAmino(object.nonexist); + } + return message; }, toAmino(message: CompressedBatchEntry): CompressedBatchEntryAmino { const obj: any = {}; @@ -1703,16 +2055,26 @@ export const CompressedBatchEntry = { }; } }; +GlobalDecoderRegistry.register(CompressedBatchEntry.typeUrl, CompressedBatchEntry); function createBaseCompressedExistenceProof(): CompressedExistenceProof { return { key: new Uint8Array(), value: new Uint8Array(), - leaf: LeafOp.fromPartial({}), + leaf: undefined, path: [] }; } export const CompressedExistenceProof = { typeUrl: "/ics23.CompressedExistenceProof", + is(o: any): o is CompressedExistenceProof { + return o && (o.$typeUrl === CompressedExistenceProof.typeUrl || (o.key instanceof Uint8Array || typeof o.key === "string") && (o.value instanceof Uint8Array || typeof o.value === "string") && Array.isArray(o.path) && (!o.path.length || typeof o.path[0] === "number")); + }, + isSDK(o: any): o is CompressedExistenceProofSDKType { + return o && (o.$typeUrl === CompressedExistenceProof.typeUrl || (o.key instanceof Uint8Array || typeof o.key === "string") && (o.value instanceof Uint8Array || typeof o.value === "string") && Array.isArray(o.path) && (!o.path.length || typeof o.path[0] === "number")); + }, + isAmino(o: any): o is CompressedExistenceProofAmino { + return o && (o.$typeUrl === CompressedExistenceProof.typeUrl || (o.key instanceof Uint8Array || typeof o.key === "string") && (o.value instanceof Uint8Array || typeof o.value === "string") && Array.isArray(o.path) && (!o.path.length || typeof o.path[0] === "number")); + }, encode(message: CompressedExistenceProof, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.key.length !== 0) { writer.uint32(10).bytes(message.key); @@ -1763,6 +2125,26 @@ export const CompressedExistenceProof = { } return message; }, + fromJSON(object: any): CompressedExistenceProof { + return { + 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) => Number(e)) : [] + }; + }, + toJSON(message: CompressedExistenceProof): unknown { + const obj: any = {}; + message.key !== undefined && (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); + if (message.path) { + obj.path = message.path.map(e => Math.round(e)); + } else { + obj.path = []; + } + return obj; + }, fromPartial(object: Partial): CompressedExistenceProof { const message = createBaseCompressedExistenceProof(); message.key = object.key ?? new Uint8Array(); @@ -1772,17 +2154,23 @@ export const CompressedExistenceProof = { return message; }, fromAmino(object: CompressedExistenceProofAmino): CompressedExistenceProof { - return { - key: object.key, - value: object.value, - leaf: object?.leaf ? LeafOp.fromAmino(object.leaf) : undefined, - path: Array.isArray(object?.path) ? object.path.map((e: any) => e) : [] - }; + const message = createBaseCompressedExistenceProof(); + if (object.key !== undefined && object.key !== null) { + message.key = bytesFromBase64(object.key); + } + if (object.value !== undefined && object.value !== null) { + message.value = bytesFromBase64(object.value); + } + if (object.leaf !== undefined && object.leaf !== null) { + message.leaf = LeafOp.fromAmino(object.leaf); + } + message.path = object.path?.map(e => e) || []; + return message; }, toAmino(message: CompressedExistenceProof): CompressedExistenceProofAmino { const obj: any = {}; - obj.key = message.key; - obj.value = message.value; + obj.key = message.key ? base64FromBytes(message.key) : undefined; + obj.value = message.value ? base64FromBytes(message.value) : undefined; obj.leaf = message.leaf ? LeafOp.toAmino(message.leaf) : undefined; if (message.path) { obj.path = message.path.map(e => e); @@ -1807,15 +2195,25 @@ export const CompressedExistenceProof = { }; } }; +GlobalDecoderRegistry.register(CompressedExistenceProof.typeUrl, CompressedExistenceProof); function createBaseCompressedNonExistenceProof(): CompressedNonExistenceProof { return { key: new Uint8Array(), - left: CompressedExistenceProof.fromPartial({}), - right: CompressedExistenceProof.fromPartial({}) + left: undefined, + right: undefined }; } export const CompressedNonExistenceProof = { typeUrl: "/ics23.CompressedNonExistenceProof", + is(o: any): o is CompressedNonExistenceProof { + return o && (o.$typeUrl === CompressedNonExistenceProof.typeUrl || o.key instanceof Uint8Array || typeof o.key === "string"); + }, + isSDK(o: any): o is CompressedNonExistenceProofSDKType { + return o && (o.$typeUrl === CompressedNonExistenceProof.typeUrl || o.key instanceof Uint8Array || typeof o.key === "string"); + }, + isAmino(o: any): o is CompressedNonExistenceProofAmino { + return o && (o.$typeUrl === CompressedNonExistenceProof.typeUrl || o.key instanceof Uint8Array || typeof o.key === "string"); + }, encode(message: CompressedNonExistenceProof, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.key.length !== 0) { writer.uint32(10).bytes(message.key); @@ -1851,6 +2249,20 @@ export const CompressedNonExistenceProof = { } 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 + }; + }, + toJSON(message: CompressedNonExistenceProof): unknown { + 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); + message.right !== undefined && (obj.right = message.right ? CompressedExistenceProof.toJSON(message.right) : undefined); + return obj; + }, fromPartial(object: Partial): CompressedNonExistenceProof { const message = createBaseCompressedNonExistenceProof(); message.key = object.key ?? new Uint8Array(); @@ -1859,15 +2271,21 @@ export const CompressedNonExistenceProof = { return message; }, fromAmino(object: CompressedNonExistenceProofAmino): CompressedNonExistenceProof { - return { - key: object.key, - left: object?.left ? CompressedExistenceProof.fromAmino(object.left) : undefined, - right: object?.right ? CompressedExistenceProof.fromAmino(object.right) : undefined - }; + const message = createBaseCompressedNonExistenceProof(); + if (object.key !== undefined && object.key !== null) { + message.key = bytesFromBase64(object.key); + } + if (object.left !== undefined && object.left !== null) { + message.left = CompressedExistenceProof.fromAmino(object.left); + } + if (object.right !== undefined && object.right !== null) { + message.right = CompressedExistenceProof.fromAmino(object.right); + } + return message; }, toAmino(message: CompressedNonExistenceProof): CompressedNonExistenceProofAmino { const obj: any = {}; - obj.key = message.key; + obj.key = message.key ? base64FromBytes(message.key) : undefined; obj.left = message.left ? CompressedExistenceProof.toAmino(message.left) : undefined; obj.right = message.right ? CompressedExistenceProof.toAmino(message.right) : undefined; return obj; @@ -1887,4 +2305,5 @@ export const CompressedNonExistenceProof = { value: CompressedNonExistenceProof.encode(message).finish() }; } -}; \ No newline at end of file +}; +GlobalDecoderRegistry.register(CompressedNonExistenceProof.typeUrl, CompressedNonExistenceProof); \ No newline at end of file diff --git a/packages/osmojs/src/codegen/cosmos/app/runtime/v1alpha1/module.ts b/packages/osmojs/src/codegen/cosmos/app/runtime/v1alpha1/module.ts new file mode 100644 index 000000000..c0c268d78 --- /dev/null +++ b/packages/osmojs/src/codegen/cosmos/app/runtime/v1alpha1/module.ts @@ -0,0 +1,420 @@ +import { BinaryReader, BinaryWriter } from "../../../../binary"; +import { isSet } from "../../../../helpers"; +import { GlobalDecoderRegistry } from "../../../../registry"; +/** Module is the config object for the runtime module. */ +export interface Module { + /** app_name is the name of the app. */ + appName: string; + /** + * begin_blockers specifies the module names of begin blockers + * to call in the order in which they should be called. If this is left empty + * no begin blocker will be registered. + */ + beginBlockers: string[]; + /** + * end_blockers specifies the module names of the end blockers + * to call in the order in which they should be called. If this is left empty + * no end blocker will be registered. + */ + endBlockers: string[]; + /** + * init_genesis specifies the module names of init genesis functions + * to call in the order in which they should be called. If this is left empty + * no init genesis function will be registered. + */ + initGenesis: string[]; + /** + * export_genesis specifies the order in which to export module genesis data. + * If this is left empty, the init_genesis order will be used for export genesis + * if it is specified. + */ + exportGenesis: string[]; + /** + * override_store_keys is an optional list of overrides for the module store keys + * to be used in keeper construction. + */ + overrideStoreKeys: StoreKeyConfig[]; +} +export interface ModuleProtoMsg { + typeUrl: "/cosmos.app.runtime.v1alpha1.Module"; + value: Uint8Array; +} +/** Module is the config object for the runtime module. */ +export interface ModuleAmino { + /** app_name is the name of the app. */ + app_name?: string; + /** + * begin_blockers specifies the module names of begin blockers + * to call in the order in which they should be called. If this is left empty + * no begin blocker will be registered. + */ + begin_blockers?: string[]; + /** + * end_blockers specifies the module names of the end blockers + * to call in the order in which they should be called. If this is left empty + * no end blocker will be registered. + */ + end_blockers?: string[]; + /** + * init_genesis specifies the module names of init genesis functions + * to call in the order in which they should be called. If this is left empty + * no init genesis function will be registered. + */ + init_genesis?: string[]; + /** + * export_genesis specifies the order in which to export module genesis data. + * If this is left empty, the init_genesis order will be used for export genesis + * if it is specified. + */ + export_genesis?: string[]; + /** + * override_store_keys is an optional list of overrides for the module store keys + * to be used in keeper construction. + */ + override_store_keys?: StoreKeyConfigAmino[]; +} +export interface ModuleAminoMsg { + type: "cosmos-sdk/Module"; + value: ModuleAmino; +} +/** Module is the config object for the runtime module. */ +export interface ModuleSDKType { + app_name: string; + begin_blockers: string[]; + end_blockers: string[]; + init_genesis: string[]; + export_genesis: string[]; + override_store_keys: StoreKeyConfigSDKType[]; +} +/** + * StoreKeyConfig may be supplied to override the default module store key, which + * is the module name. + */ +export interface StoreKeyConfig { + /** name of the module to override the store key of */ + moduleName: string; + /** the kv store key to use instead of the module name. */ + kvStoreKey: string; +} +export interface StoreKeyConfigProtoMsg { + typeUrl: "/cosmos.app.runtime.v1alpha1.StoreKeyConfig"; + value: Uint8Array; +} +/** + * StoreKeyConfig may be supplied to override the default module store key, which + * is the module name. + */ +export interface StoreKeyConfigAmino { + /** name of the module to override the store key of */ + module_name?: string; + /** the kv store key to use instead of the module name. */ + kv_store_key?: string; +} +export interface StoreKeyConfigAminoMsg { + type: "cosmos-sdk/StoreKeyConfig"; + value: StoreKeyConfigAmino; +} +/** + * StoreKeyConfig may be supplied to override the default module store key, which + * is the module name. + */ +export interface StoreKeyConfigSDKType { + module_name: string; + kv_store_key: string; +} +function createBaseModule(): Module { + return { + appName: "", + beginBlockers: [], + endBlockers: [], + initGenesis: [], + exportGenesis: [], + overrideStoreKeys: [] + }; +} +export const Module = { + typeUrl: "/cosmos.app.runtime.v1alpha1.Module", + aminoType: "cosmos-sdk/Module", + is(o: any): o is Module { + return o && (o.$typeUrl === Module.typeUrl || typeof o.appName === "string" && Array.isArray(o.beginBlockers) && (!o.beginBlockers.length || typeof o.beginBlockers[0] === "string") && Array.isArray(o.endBlockers) && (!o.endBlockers.length || typeof o.endBlockers[0] === "string") && Array.isArray(o.initGenesis) && (!o.initGenesis.length || typeof o.initGenesis[0] === "string") && Array.isArray(o.exportGenesis) && (!o.exportGenesis.length || typeof o.exportGenesis[0] === "string") && Array.isArray(o.overrideStoreKeys) && (!o.overrideStoreKeys.length || StoreKeyConfig.is(o.overrideStoreKeys[0]))); + }, + isSDK(o: any): o is ModuleSDKType { + return o && (o.$typeUrl === Module.typeUrl || typeof o.app_name === "string" && Array.isArray(o.begin_blockers) && (!o.begin_blockers.length || typeof o.begin_blockers[0] === "string") && Array.isArray(o.end_blockers) && (!o.end_blockers.length || typeof o.end_blockers[0] === "string") && Array.isArray(o.init_genesis) && (!o.init_genesis.length || typeof o.init_genesis[0] === "string") && Array.isArray(o.export_genesis) && (!o.export_genesis.length || typeof o.export_genesis[0] === "string") && Array.isArray(o.override_store_keys) && (!o.override_store_keys.length || StoreKeyConfig.isSDK(o.override_store_keys[0]))); + }, + isAmino(o: any): o is ModuleAmino { + return o && (o.$typeUrl === Module.typeUrl || typeof o.app_name === "string" && Array.isArray(o.begin_blockers) && (!o.begin_blockers.length || typeof o.begin_blockers[0] === "string") && Array.isArray(o.end_blockers) && (!o.end_blockers.length || typeof o.end_blockers[0] === "string") && Array.isArray(o.init_genesis) && (!o.init_genesis.length || typeof o.init_genesis[0] === "string") && Array.isArray(o.export_genesis) && (!o.export_genesis.length || typeof o.export_genesis[0] === "string") && Array.isArray(o.override_store_keys) && (!o.override_store_keys.length || StoreKeyConfig.isAmino(o.override_store_keys[0]))); + }, + encode(message: Module, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.appName !== "") { + writer.uint32(10).string(message.appName); + } + for (const v of message.beginBlockers) { + writer.uint32(18).string(v!); + } + for (const v of message.endBlockers) { + writer.uint32(26).string(v!); + } + for (const v of message.initGenesis) { + writer.uint32(34).string(v!); + } + for (const v of message.exportGenesis) { + writer.uint32(42).string(v!); + } + for (const v of message.overrideStoreKeys) { + StoreKeyConfig.encode(v!, writer.uint32(50).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): Module { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseModule(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.appName = reader.string(); + break; + case 2: + message.beginBlockers.push(reader.string()); + break; + case 3: + message.endBlockers.push(reader.string()); + break; + case 4: + message.initGenesis.push(reader.string()); + break; + case 5: + message.exportGenesis.push(reader.string()); + break; + case 6: + message.overrideStoreKeys.push(StoreKeyConfig.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): Module { + return { + appName: isSet(object.appName) ? String(object.appName) : "", + beginBlockers: Array.isArray(object?.beginBlockers) ? object.beginBlockers.map((e: any) => String(e)) : [], + endBlockers: Array.isArray(object?.endBlockers) ? object.endBlockers.map((e: any) => String(e)) : [], + initGenesis: Array.isArray(object?.initGenesis) ? object.initGenesis.map((e: any) => String(e)) : [], + exportGenesis: Array.isArray(object?.exportGenesis) ? object.exportGenesis.map((e: any) => String(e)) : [], + overrideStoreKeys: Array.isArray(object?.overrideStoreKeys) ? object.overrideStoreKeys.map((e: any) => StoreKeyConfig.fromJSON(e)) : [] + }; + }, + toJSON(message: Module): unknown { + const obj: any = {}; + message.appName !== undefined && (obj.appName = message.appName); + if (message.beginBlockers) { + obj.beginBlockers = message.beginBlockers.map(e => e); + } else { + obj.beginBlockers = []; + } + if (message.endBlockers) { + obj.endBlockers = message.endBlockers.map(e => e); + } else { + obj.endBlockers = []; + } + if (message.initGenesis) { + obj.initGenesis = message.initGenesis.map(e => e); + } else { + obj.initGenesis = []; + } + if (message.exportGenesis) { + obj.exportGenesis = message.exportGenesis.map(e => e); + } else { + obj.exportGenesis = []; + } + if (message.overrideStoreKeys) { + obj.overrideStoreKeys = message.overrideStoreKeys.map(e => e ? StoreKeyConfig.toJSON(e) : undefined); + } else { + obj.overrideStoreKeys = []; + } + return obj; + }, + fromPartial(object: Partial): Module { + const message = createBaseModule(); + message.appName = object.appName ?? ""; + message.beginBlockers = object.beginBlockers?.map(e => e) || []; + message.endBlockers = object.endBlockers?.map(e => e) || []; + message.initGenesis = object.initGenesis?.map(e => e) || []; + message.exportGenesis = object.exportGenesis?.map(e => e) || []; + message.overrideStoreKeys = object.overrideStoreKeys?.map(e => StoreKeyConfig.fromPartial(e)) || []; + return message; + }, + fromAmino(object: ModuleAmino): Module { + const message = createBaseModule(); + if (object.app_name !== undefined && object.app_name !== null) { + message.appName = object.app_name; + } + message.beginBlockers = object.begin_blockers?.map(e => e) || []; + message.endBlockers = object.end_blockers?.map(e => e) || []; + message.initGenesis = object.init_genesis?.map(e => e) || []; + message.exportGenesis = object.export_genesis?.map(e => e) || []; + message.overrideStoreKeys = object.override_store_keys?.map(e => StoreKeyConfig.fromAmino(e)) || []; + return message; + }, + toAmino(message: Module): ModuleAmino { + const obj: any = {}; + obj.app_name = message.appName; + if (message.beginBlockers) { + obj.begin_blockers = message.beginBlockers.map(e => e); + } else { + obj.begin_blockers = []; + } + if (message.endBlockers) { + obj.end_blockers = message.endBlockers.map(e => e); + } else { + obj.end_blockers = []; + } + if (message.initGenesis) { + obj.init_genesis = message.initGenesis.map(e => e); + } else { + obj.init_genesis = []; + } + if (message.exportGenesis) { + obj.export_genesis = message.exportGenesis.map(e => e); + } else { + obj.export_genesis = []; + } + if (message.overrideStoreKeys) { + obj.override_store_keys = message.overrideStoreKeys.map(e => e ? StoreKeyConfig.toAmino(e) : undefined); + } else { + obj.override_store_keys = []; + } + return obj; + }, + fromAminoMsg(object: ModuleAminoMsg): Module { + return Module.fromAmino(object.value); + }, + toAminoMsg(message: Module): ModuleAminoMsg { + return { + type: "cosmos-sdk/Module", + value: Module.toAmino(message) + }; + }, + fromProtoMsg(message: ModuleProtoMsg): Module { + return Module.decode(message.value); + }, + toProto(message: Module): Uint8Array { + return Module.encode(message).finish(); + }, + toProtoMsg(message: Module): ModuleProtoMsg { + return { + typeUrl: "/cosmos.app.runtime.v1alpha1.Module", + value: Module.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(Module.typeUrl, Module); +GlobalDecoderRegistry.registerAminoProtoMapping(Module.aminoType, Module.typeUrl); +function createBaseStoreKeyConfig(): StoreKeyConfig { + return { + moduleName: "", + kvStoreKey: "" + }; +} +export const StoreKeyConfig = { + typeUrl: "/cosmos.app.runtime.v1alpha1.StoreKeyConfig", + aminoType: "cosmos-sdk/StoreKeyConfig", + is(o: any): o is StoreKeyConfig { + return o && (o.$typeUrl === StoreKeyConfig.typeUrl || typeof o.moduleName === "string" && typeof o.kvStoreKey === "string"); + }, + isSDK(o: any): o is StoreKeyConfigSDKType { + return o && (o.$typeUrl === StoreKeyConfig.typeUrl || typeof o.module_name === "string" && typeof o.kv_store_key === "string"); + }, + isAmino(o: any): o is StoreKeyConfigAmino { + return o && (o.$typeUrl === StoreKeyConfig.typeUrl || typeof o.module_name === "string" && typeof o.kv_store_key === "string"); + }, + encode(message: StoreKeyConfig, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.moduleName !== "") { + writer.uint32(10).string(message.moduleName); + } + if (message.kvStoreKey !== "") { + writer.uint32(18).string(message.kvStoreKey); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): StoreKeyConfig { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseStoreKeyConfig(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.moduleName = reader.string(); + break; + case 2: + message.kvStoreKey = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): StoreKeyConfig { + return { + moduleName: isSet(object.moduleName) ? String(object.moduleName) : "", + kvStoreKey: isSet(object.kvStoreKey) ? String(object.kvStoreKey) : "" + }; + }, + toJSON(message: StoreKeyConfig): unknown { + const obj: any = {}; + message.moduleName !== undefined && (obj.moduleName = message.moduleName); + message.kvStoreKey !== undefined && (obj.kvStoreKey = message.kvStoreKey); + return obj; + }, + fromPartial(object: Partial): StoreKeyConfig { + const message = createBaseStoreKeyConfig(); + message.moduleName = object.moduleName ?? ""; + message.kvStoreKey = object.kvStoreKey ?? ""; + return message; + }, + fromAmino(object: StoreKeyConfigAmino): StoreKeyConfig { + const message = createBaseStoreKeyConfig(); + if (object.module_name !== undefined && object.module_name !== null) { + message.moduleName = object.module_name; + } + if (object.kv_store_key !== undefined && object.kv_store_key !== null) { + message.kvStoreKey = object.kv_store_key; + } + return message; + }, + toAmino(message: StoreKeyConfig): StoreKeyConfigAmino { + const obj: any = {}; + obj.module_name = message.moduleName; + obj.kv_store_key = message.kvStoreKey; + return obj; + }, + fromAminoMsg(object: StoreKeyConfigAminoMsg): StoreKeyConfig { + return StoreKeyConfig.fromAmino(object.value); + }, + toAminoMsg(message: StoreKeyConfig): StoreKeyConfigAminoMsg { + return { + type: "cosmos-sdk/StoreKeyConfig", + value: StoreKeyConfig.toAmino(message) + }; + }, + fromProtoMsg(message: StoreKeyConfigProtoMsg): StoreKeyConfig { + return StoreKeyConfig.decode(message.value); + }, + toProto(message: StoreKeyConfig): Uint8Array { + return StoreKeyConfig.encode(message).finish(); + }, + toProtoMsg(message: StoreKeyConfig): StoreKeyConfigProtoMsg { + return { + typeUrl: "/cosmos.app.runtime.v1alpha1.StoreKeyConfig", + value: StoreKeyConfig.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(StoreKeyConfig.typeUrl, StoreKeyConfig); +GlobalDecoderRegistry.registerAminoProtoMapping(StoreKeyConfig.aminoType, StoreKeyConfig.typeUrl); \ No newline at end of file diff --git a/packages/osmojs/src/codegen/cosmos/app/v1alpha1/module.ts b/packages/osmojs/src/codegen/cosmos/app/v1alpha1/module.ts new file mode 100644 index 000000000..aa4c4f8bc --- /dev/null +++ b/packages/osmojs/src/codegen/cosmos/app/v1alpha1/module.ts @@ -0,0 +1,532 @@ +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { isSet } from "../../../helpers"; +import { GlobalDecoderRegistry } from "../../../registry"; +/** ModuleDescriptor describes an app module. */ +export interface ModuleDescriptor { + /** + * go_import names the package that should be imported by an app to load the + * module in the runtime module registry. It is required to make debugging + * of configuration errors easier for users. + */ + goImport: string; + /** + * use_package refers to a protobuf package that this module + * uses and exposes to the world. In an app, only one module should "use" + * or own a single protobuf package. It is assumed that the module uses + * all of the .proto files in a single package. + */ + usePackage: PackageReference[]; + /** + * can_migrate_from defines which module versions this module can migrate + * state from. The framework will check that one module version is able to + * migrate from a previous module version before attempting to update its + * config. It is assumed that modules can transitively migrate from earlier + * versions. For instance if v3 declares it can migrate from v2, and v2 + * declares it can migrate from v1, the framework knows how to migrate + * from v1 to v3, assuming all 3 module versions are registered at runtime. + */ + canMigrateFrom: MigrateFromInfo[]; +} +export interface ModuleDescriptorProtoMsg { + typeUrl: "/cosmos.app.v1alpha1.ModuleDescriptor"; + value: Uint8Array; +} +/** ModuleDescriptor describes an app module. */ +export interface ModuleDescriptorAmino { + /** + * go_import names the package that should be imported by an app to load the + * module in the runtime module registry. It is required to make debugging + * of configuration errors easier for users. + */ + go_import?: string; + /** + * use_package refers to a protobuf package that this module + * uses and exposes to the world. In an app, only one module should "use" + * or own a single protobuf package. It is assumed that the module uses + * all of the .proto files in a single package. + */ + use_package?: PackageReferenceAmino[]; + /** + * can_migrate_from defines which module versions this module can migrate + * state from. The framework will check that one module version is able to + * migrate from a previous module version before attempting to update its + * config. It is assumed that modules can transitively migrate from earlier + * versions. For instance if v3 declares it can migrate from v2, and v2 + * declares it can migrate from v1, the framework knows how to migrate + * from v1 to v3, assuming all 3 module versions are registered at runtime. + */ + can_migrate_from?: MigrateFromInfoAmino[]; +} +export interface ModuleDescriptorAminoMsg { + type: "cosmos-sdk/ModuleDescriptor"; + value: ModuleDescriptorAmino; +} +/** ModuleDescriptor describes an app module. */ +export interface ModuleDescriptorSDKType { + go_import: string; + use_package: PackageReferenceSDKType[]; + can_migrate_from: MigrateFromInfoSDKType[]; +} +/** PackageReference is a reference to a protobuf package used by a module. */ +export interface PackageReference { + /** name is the fully-qualified name of the package. */ + name: string; + /** + * revision is the optional revision of the package that is being used. + * Protobuf packages used in Cosmos should generally have a major version + * as the last part of the package name, ex. foo.bar.baz.v1. + * The revision of a package can be thought of as the minor version of a + * package which has additional backwards compatible definitions that weren't + * present in a previous version. + * + * A package should indicate its revision with a source code comment + * above the package declaration in one of its files containing the + * text "Revision N" where N is an integer revision. All packages start + * at revision 0 the first time they are released in a module. + * + * When a new version of a module is released and items are added to existing + * .proto files, these definitions should contain comments of the form + * "Since Revision N" where N is an integer revision. + * + * When the module runtime starts up, it will check the pinned proto + * image and panic if there are runtime protobuf definitions that are not + * in the pinned descriptor which do not have + * a "Since Revision N" comment or have a "Since Revision N" comment where + * N is <= to the revision specified here. This indicates that the protobuf + * files have been updated, but the pinned file descriptor hasn't. + * + * If there are items in the pinned file descriptor with a revision + * greater than the value indicated here, this will also cause a panic + * as it may mean that the pinned descriptor for a legacy module has been + * improperly updated or that there is some other versioning discrepancy. + * Runtime protobuf definitions will also be checked for compatibility + * with pinned file descriptors to make sure there are no incompatible changes. + * + * This behavior ensures that: + * * pinned proto images are up-to-date + * * protobuf files are carefully annotated with revision comments which + * are important good client UX + * * protobuf files are changed in backwards and forwards compatible ways + */ + revision: number; +} +export interface PackageReferenceProtoMsg { + typeUrl: "/cosmos.app.v1alpha1.PackageReference"; + value: Uint8Array; +} +/** PackageReference is a reference to a protobuf package used by a module. */ +export interface PackageReferenceAmino { + /** name is the fully-qualified name of the package. */ + name?: string; + /** + * revision is the optional revision of the package that is being used. + * Protobuf packages used in Cosmos should generally have a major version + * as the last part of the package name, ex. foo.bar.baz.v1. + * The revision of a package can be thought of as the minor version of a + * package which has additional backwards compatible definitions that weren't + * present in a previous version. + * + * A package should indicate its revision with a source code comment + * above the package declaration in one of its files containing the + * text "Revision N" where N is an integer revision. All packages start + * at revision 0 the first time they are released in a module. + * + * When a new version of a module is released and items are added to existing + * .proto files, these definitions should contain comments of the form + * "Since Revision N" where N is an integer revision. + * + * When the module runtime starts up, it will check the pinned proto + * image and panic if there are runtime protobuf definitions that are not + * in the pinned descriptor which do not have + * a "Since Revision N" comment or have a "Since Revision N" comment where + * N is <= to the revision specified here. This indicates that the protobuf + * files have been updated, but the pinned file descriptor hasn't. + * + * If there are items in the pinned file descriptor with a revision + * greater than the value indicated here, this will also cause a panic + * as it may mean that the pinned descriptor for a legacy module has been + * improperly updated or that there is some other versioning discrepancy. + * Runtime protobuf definitions will also be checked for compatibility + * with pinned file descriptors to make sure there are no incompatible changes. + * + * This behavior ensures that: + * * pinned proto images are up-to-date + * * protobuf files are carefully annotated with revision comments which + * are important good client UX + * * protobuf files are changed in backwards and forwards compatible ways + */ + revision?: number; +} +export interface PackageReferenceAminoMsg { + type: "cosmos-sdk/PackageReference"; + value: PackageReferenceAmino; +} +/** PackageReference is a reference to a protobuf package used by a module. */ +export interface PackageReferenceSDKType { + name: string; + revision: number; +} +/** + * MigrateFromInfo is information on a module version that a newer module + * can migrate from. + */ +export interface MigrateFromInfo { + /** + * module is the fully-qualified protobuf name of the module config object + * for the previous module version, ex: "cosmos.group.module.v1.Module". + */ + module: string; +} +export interface MigrateFromInfoProtoMsg { + typeUrl: "/cosmos.app.v1alpha1.MigrateFromInfo"; + value: Uint8Array; +} +/** + * MigrateFromInfo is information on a module version that a newer module + * can migrate from. + */ +export interface MigrateFromInfoAmino { + /** + * module is the fully-qualified protobuf name of the module config object + * for the previous module version, ex: "cosmos.group.module.v1.Module". + */ + module?: string; +} +export interface MigrateFromInfoAminoMsg { + type: "cosmos-sdk/MigrateFromInfo"; + value: MigrateFromInfoAmino; +} +/** + * MigrateFromInfo is information on a module version that a newer module + * can migrate from. + */ +export interface MigrateFromInfoSDKType { + module: string; +} +function createBaseModuleDescriptor(): ModuleDescriptor { + return { + goImport: "", + usePackage: [], + canMigrateFrom: [] + }; +} +export const ModuleDescriptor = { + typeUrl: "/cosmos.app.v1alpha1.ModuleDescriptor", + aminoType: "cosmos-sdk/ModuleDescriptor", + is(o: any): o is ModuleDescriptor { + return o && (o.$typeUrl === ModuleDescriptor.typeUrl || typeof o.goImport === "string" && Array.isArray(o.usePackage) && (!o.usePackage.length || PackageReference.is(o.usePackage[0])) && Array.isArray(o.canMigrateFrom) && (!o.canMigrateFrom.length || MigrateFromInfo.is(o.canMigrateFrom[0]))); + }, + isSDK(o: any): o is ModuleDescriptorSDKType { + return o && (o.$typeUrl === ModuleDescriptor.typeUrl || typeof o.go_import === "string" && Array.isArray(o.use_package) && (!o.use_package.length || PackageReference.isSDK(o.use_package[0])) && Array.isArray(o.can_migrate_from) && (!o.can_migrate_from.length || MigrateFromInfo.isSDK(o.can_migrate_from[0]))); + }, + isAmino(o: any): o is ModuleDescriptorAmino { + return o && (o.$typeUrl === ModuleDescriptor.typeUrl || typeof o.go_import === "string" && Array.isArray(o.use_package) && (!o.use_package.length || PackageReference.isAmino(o.use_package[0])) && Array.isArray(o.can_migrate_from) && (!o.can_migrate_from.length || MigrateFromInfo.isAmino(o.can_migrate_from[0]))); + }, + encode(message: ModuleDescriptor, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.goImport !== "") { + writer.uint32(10).string(message.goImport); + } + for (const v of message.usePackage) { + PackageReference.encode(v!, writer.uint32(18).fork()).ldelim(); + } + for (const v of message.canMigrateFrom) { + MigrateFromInfo.encode(v!, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): ModuleDescriptor { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseModuleDescriptor(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.goImport = reader.string(); + break; + case 2: + message.usePackage.push(PackageReference.decode(reader, reader.uint32())); + break; + case 3: + message.canMigrateFrom.push(MigrateFromInfo.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): ModuleDescriptor { + return { + goImport: isSet(object.goImport) ? String(object.goImport) : "", + usePackage: Array.isArray(object?.usePackage) ? object.usePackage.map((e: any) => PackageReference.fromJSON(e)) : [], + canMigrateFrom: Array.isArray(object?.canMigrateFrom) ? object.canMigrateFrom.map((e: any) => MigrateFromInfo.fromJSON(e)) : [] + }; + }, + toJSON(message: ModuleDescriptor): unknown { + const obj: any = {}; + message.goImport !== undefined && (obj.goImport = message.goImport); + if (message.usePackage) { + obj.usePackage = message.usePackage.map(e => e ? PackageReference.toJSON(e) : undefined); + } else { + obj.usePackage = []; + } + if (message.canMigrateFrom) { + obj.canMigrateFrom = message.canMigrateFrom.map(e => e ? MigrateFromInfo.toJSON(e) : undefined); + } else { + obj.canMigrateFrom = []; + } + return obj; + }, + fromPartial(object: Partial): ModuleDescriptor { + const message = createBaseModuleDescriptor(); + message.goImport = object.goImport ?? ""; + message.usePackage = object.usePackage?.map(e => PackageReference.fromPartial(e)) || []; + message.canMigrateFrom = object.canMigrateFrom?.map(e => MigrateFromInfo.fromPartial(e)) || []; + return message; + }, + fromAmino(object: ModuleDescriptorAmino): ModuleDescriptor { + const message = createBaseModuleDescriptor(); + if (object.go_import !== undefined && object.go_import !== null) { + message.goImport = object.go_import; + } + message.usePackage = object.use_package?.map(e => PackageReference.fromAmino(e)) || []; + message.canMigrateFrom = object.can_migrate_from?.map(e => MigrateFromInfo.fromAmino(e)) || []; + return message; + }, + toAmino(message: ModuleDescriptor): ModuleDescriptorAmino { + const obj: any = {}; + obj.go_import = message.goImport; + if (message.usePackage) { + obj.use_package = message.usePackage.map(e => e ? PackageReference.toAmino(e) : undefined); + } else { + obj.use_package = []; + } + if (message.canMigrateFrom) { + obj.can_migrate_from = message.canMigrateFrom.map(e => e ? MigrateFromInfo.toAmino(e) : undefined); + } else { + obj.can_migrate_from = []; + } + return obj; + }, + fromAminoMsg(object: ModuleDescriptorAminoMsg): ModuleDescriptor { + return ModuleDescriptor.fromAmino(object.value); + }, + toAminoMsg(message: ModuleDescriptor): ModuleDescriptorAminoMsg { + return { + type: "cosmos-sdk/ModuleDescriptor", + value: ModuleDescriptor.toAmino(message) + }; + }, + fromProtoMsg(message: ModuleDescriptorProtoMsg): ModuleDescriptor { + return ModuleDescriptor.decode(message.value); + }, + toProto(message: ModuleDescriptor): Uint8Array { + return ModuleDescriptor.encode(message).finish(); + }, + toProtoMsg(message: ModuleDescriptor): ModuleDescriptorProtoMsg { + return { + typeUrl: "/cosmos.app.v1alpha1.ModuleDescriptor", + value: ModuleDescriptor.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(ModuleDescriptor.typeUrl, ModuleDescriptor); +GlobalDecoderRegistry.registerAminoProtoMapping(ModuleDescriptor.aminoType, ModuleDescriptor.typeUrl); +function createBasePackageReference(): PackageReference { + return { + name: "", + revision: 0 + }; +} +export const PackageReference = { + typeUrl: "/cosmos.app.v1alpha1.PackageReference", + aminoType: "cosmos-sdk/PackageReference", + is(o: any): o is PackageReference { + return o && (o.$typeUrl === PackageReference.typeUrl || typeof o.name === "string" && typeof o.revision === "number"); + }, + isSDK(o: any): o is PackageReferenceSDKType { + return o && (o.$typeUrl === PackageReference.typeUrl || typeof o.name === "string" && typeof o.revision === "number"); + }, + isAmino(o: any): o is PackageReferenceAmino { + return o && (o.$typeUrl === PackageReference.typeUrl || typeof o.name === "string" && typeof o.revision === "number"); + }, + encode(message: PackageReference, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.name !== "") { + writer.uint32(10).string(message.name); + } + if (message.revision !== 0) { + writer.uint32(16).uint32(message.revision); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): PackageReference { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBasePackageReference(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.revision = reader.uint32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): PackageReference { + return { + name: isSet(object.name) ? String(object.name) : "", + revision: isSet(object.revision) ? Number(object.revision) : 0 + }; + }, + toJSON(message: PackageReference): unknown { + const obj: any = {}; + message.name !== undefined && (obj.name = message.name); + message.revision !== undefined && (obj.revision = Math.round(message.revision)); + return obj; + }, + fromPartial(object: Partial): PackageReference { + const message = createBasePackageReference(); + message.name = object.name ?? ""; + message.revision = object.revision ?? 0; + return message; + }, + fromAmino(object: PackageReferenceAmino): PackageReference { + const message = createBasePackageReference(); + if (object.name !== undefined && object.name !== null) { + message.name = object.name; + } + if (object.revision !== undefined && object.revision !== null) { + message.revision = object.revision; + } + return message; + }, + toAmino(message: PackageReference): PackageReferenceAmino { + const obj: any = {}; + obj.name = message.name; + obj.revision = message.revision; + return obj; + }, + fromAminoMsg(object: PackageReferenceAminoMsg): PackageReference { + return PackageReference.fromAmino(object.value); + }, + toAminoMsg(message: PackageReference): PackageReferenceAminoMsg { + return { + type: "cosmos-sdk/PackageReference", + value: PackageReference.toAmino(message) + }; + }, + fromProtoMsg(message: PackageReferenceProtoMsg): PackageReference { + return PackageReference.decode(message.value); + }, + toProto(message: PackageReference): Uint8Array { + return PackageReference.encode(message).finish(); + }, + toProtoMsg(message: PackageReference): PackageReferenceProtoMsg { + return { + typeUrl: "/cosmos.app.v1alpha1.PackageReference", + value: PackageReference.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(PackageReference.typeUrl, PackageReference); +GlobalDecoderRegistry.registerAminoProtoMapping(PackageReference.aminoType, PackageReference.typeUrl); +function createBaseMigrateFromInfo(): MigrateFromInfo { + return { + module: "" + }; +} +export const MigrateFromInfo = { + typeUrl: "/cosmos.app.v1alpha1.MigrateFromInfo", + aminoType: "cosmos-sdk/MigrateFromInfo", + is(o: any): o is MigrateFromInfo { + return o && (o.$typeUrl === MigrateFromInfo.typeUrl || typeof o.module === "string"); + }, + isSDK(o: any): o is MigrateFromInfoSDKType { + return o && (o.$typeUrl === MigrateFromInfo.typeUrl || typeof o.module === "string"); + }, + isAmino(o: any): o is MigrateFromInfoAmino { + return o && (o.$typeUrl === MigrateFromInfo.typeUrl || typeof o.module === "string"); + }, + encode(message: MigrateFromInfo, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.module !== "") { + writer.uint32(10).string(message.module); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MigrateFromInfo { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMigrateFromInfo(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.module = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): MigrateFromInfo { + return { + module: isSet(object.module) ? String(object.module) : "" + }; + }, + toJSON(message: MigrateFromInfo): unknown { + const obj: any = {}; + message.module !== undefined && (obj.module = message.module); + return obj; + }, + fromPartial(object: Partial): MigrateFromInfo { + const message = createBaseMigrateFromInfo(); + message.module = object.module ?? ""; + return message; + }, + fromAmino(object: MigrateFromInfoAmino): MigrateFromInfo { + const message = createBaseMigrateFromInfo(); + if (object.module !== undefined && object.module !== null) { + message.module = object.module; + } + return message; + }, + toAmino(message: MigrateFromInfo): MigrateFromInfoAmino { + const obj: any = {}; + obj.module = message.module; + return obj; + }, + fromAminoMsg(object: MigrateFromInfoAminoMsg): MigrateFromInfo { + return MigrateFromInfo.fromAmino(object.value); + }, + toAminoMsg(message: MigrateFromInfo): MigrateFromInfoAminoMsg { + return { + type: "cosmos-sdk/MigrateFromInfo", + value: MigrateFromInfo.toAmino(message) + }; + }, + fromProtoMsg(message: MigrateFromInfoProtoMsg): MigrateFromInfo { + return MigrateFromInfo.decode(message.value); + }, + toProto(message: MigrateFromInfo): Uint8Array { + return MigrateFromInfo.encode(message).finish(); + }, + toProtoMsg(message: MigrateFromInfo): MigrateFromInfoProtoMsg { + return { + typeUrl: "/cosmos.app.v1alpha1.MigrateFromInfo", + value: MigrateFromInfo.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MigrateFromInfo.typeUrl, MigrateFromInfo); +GlobalDecoderRegistry.registerAminoProtoMapping(MigrateFromInfo.aminoType, MigrateFromInfo.typeUrl); \ No newline at end of file diff --git a/packages/osmojs/src/codegen/cosmos/auth/v1beta1/auth.ts b/packages/osmojs/src/codegen/cosmos/auth/v1beta1/auth.ts index 204958798..281aaa413 100644 --- a/packages/osmojs/src/codegen/cosmos/auth/v1beta1/auth.ts +++ b/packages/osmojs/src/codegen/cosmos/auth/v1beta1/auth.ts @@ -1,14 +1,16 @@ import { Any, AnyAmino, AnySDKType } from "../../../google/protobuf/any"; import { BinaryReader, BinaryWriter } from "../../../binary"; +import { isSet, bytesFromBase64, base64FromBytes } from "../../../helpers"; +import { GlobalDecoderRegistry } from "../../../registry"; /** * BaseAccount defines a base account type. It contains all the necessary fields * for basic account functionality. Any custom account type should extend this * type for additional functionality (e.g. vesting). */ export interface BaseAccount { - $typeUrl?: string; + $typeUrl?: "/cosmos.auth.v1beta1.BaseAccount"; address: string; - pubKey: Any; + pubKey?: Any; accountNumber: bigint; sequence: bigint; } @@ -22,10 +24,10 @@ export interface BaseAccountProtoMsg { * type for additional functionality (e.g. vesting). */ export interface BaseAccountAmino { - address: string; + address?: string; pub_key?: AnyAmino; - account_number: string; - sequence: string; + account_number?: string; + sequence?: string; } export interface BaseAccountAminoMsg { type: "cosmos-sdk/BaseAccount"; @@ -37,16 +39,16 @@ export interface BaseAccountAminoMsg { * type for additional functionality (e.g. vesting). */ export interface BaseAccountSDKType { - $typeUrl?: string; + $typeUrl?: "/cosmos.auth.v1beta1.BaseAccount"; address: string; - pub_key: AnySDKType; + pub_key?: AnySDKType; account_number: bigint; sequence: bigint; } /** ModuleAccount defines an account for modules that holds coins on a pool. */ export interface ModuleAccount { - $typeUrl?: string; - baseAccount: BaseAccount; + $typeUrl?: "/cosmos.auth.v1beta1.ModuleAccount"; + baseAccount?: BaseAccount; name: string; permissions: string[]; } @@ -57,8 +59,8 @@ export interface ModuleAccountProtoMsg { /** ModuleAccount defines an account for modules that holds coins on a pool. */ export interface ModuleAccountAmino { base_account?: BaseAccountAmino; - name: string; - permissions: string[]; + name?: string; + permissions?: string[]; } export interface ModuleAccountAminoMsg { type: "cosmos-sdk/ModuleAccount"; @@ -66,11 +68,56 @@ export interface ModuleAccountAminoMsg { } /** ModuleAccount defines an account for modules that holds coins on a pool. */ export interface ModuleAccountSDKType { - $typeUrl?: string; - base_account: BaseAccountSDKType; + $typeUrl?: "/cosmos.auth.v1beta1.ModuleAccount"; + base_account?: BaseAccountSDKType; name: string; permissions: string[]; } +/** + * ModuleCredential represents a unclaimable pubkey for base accounts controlled by modules. + * + * Since: cosmos-sdk 0.47 + */ +export interface ModuleCredential { + /** module_name is the name of the module used for address derivation (passed into address.Module). */ + moduleName: string; + /** + * derivation_keys is for deriving a module account address (passed into address.Module) + * adding more keys creates sub-account addresses (passed into address.Derive) + */ + derivationKeys: Uint8Array[]; +} +export interface ModuleCredentialProtoMsg { + typeUrl: "/cosmos.auth.v1beta1.ModuleCredential"; + value: Uint8Array; +} +/** + * ModuleCredential represents a unclaimable pubkey for base accounts controlled by modules. + * + * Since: cosmos-sdk 0.47 + */ +export interface ModuleCredentialAmino { + /** module_name is the name of the module used for address derivation (passed into address.Module). */ + module_name?: string; + /** + * derivation_keys is for deriving a module account address (passed into address.Module) + * adding more keys creates sub-account addresses (passed into address.Derive) + */ + derivation_keys?: string[]; +} +export interface ModuleCredentialAminoMsg { + type: "cosmos-sdk/ModuleCredential"; + value: ModuleCredentialAmino; +} +/** + * ModuleCredential represents a unclaimable pubkey for base accounts controlled by modules. + * + * Since: cosmos-sdk 0.47 + */ +export interface ModuleCredentialSDKType { + module_name: string; + derivation_keys: Uint8Array[]; +} /** Params defines the parameters for the auth module. */ export interface Params { maxMemoCharacters: bigint; @@ -85,11 +132,11 @@ export interface ParamsProtoMsg { } /** Params defines the parameters for the auth module. */ export interface ParamsAmino { - max_memo_characters: string; - tx_sig_limit: string; - tx_size_cost_per_byte: string; - sig_verify_cost_ed25519: string; - sig_verify_cost_secp256k1: string; + max_memo_characters?: string; + tx_sig_limit?: string; + tx_size_cost_per_byte?: string; + sig_verify_cost_ed25519?: string; + sig_verify_cost_secp256k1?: string; } export interface ParamsAminoMsg { type: "cosmos-sdk/x/auth/Params"; @@ -114,6 +161,16 @@ function createBaseBaseAccount(): BaseAccount { } export const BaseAccount = { typeUrl: "/cosmos.auth.v1beta1.BaseAccount", + aminoType: "cosmos-sdk/BaseAccount", + is(o: any): o is BaseAccount { + return o && (o.$typeUrl === BaseAccount.typeUrl || typeof o.address === "string" && typeof o.accountNumber === "bigint" && typeof o.sequence === "bigint"); + }, + isSDK(o: any): o is BaseAccountSDKType { + return o && (o.$typeUrl === BaseAccount.typeUrl || typeof o.address === "string" && typeof o.account_number === "bigint" && typeof o.sequence === "bigint"); + }, + isAmino(o: any): o is BaseAccountAmino { + return o && (o.$typeUrl === BaseAccount.typeUrl || typeof o.address === "string" && typeof o.account_number === "bigint" && typeof o.sequence === "bigint"); + }, encode(message: BaseAccount, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.address !== "") { writer.uint32(10).string(message.address); @@ -155,6 +212,22 @@ export const BaseAccount = { } 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) ? BigInt(object.accountNumber.toString()) : BigInt(0), + sequence: isSet(object.sequence) ? BigInt(object.sequence.toString()) : BigInt(0) + }; + }, + 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 || BigInt(0)).toString()); + message.sequence !== undefined && (obj.sequence = (message.sequence || BigInt(0)).toString()); + return obj; + }, fromPartial(object: Partial): BaseAccount { const message = createBaseBaseAccount(); message.address = object.address ?? ""; @@ -164,12 +237,20 @@ export const BaseAccount = { return message; }, fromAmino(object: BaseAccountAmino): BaseAccount { - return { - address: object.address, - pubKey: object?.pub_key ? Any.fromAmino(object.pub_key) : undefined, - accountNumber: BigInt(object.account_number), - sequence: BigInt(object.sequence) - }; + const message = createBaseBaseAccount(); + if (object.address !== undefined && object.address !== null) { + message.address = object.address; + } + if (object.pub_key !== undefined && object.pub_key !== null) { + message.pubKey = Any.fromAmino(object.pub_key); + } + if (object.account_number !== undefined && object.account_number !== null) { + message.accountNumber = BigInt(object.account_number); + } + if (object.sequence !== undefined && object.sequence !== null) { + message.sequence = BigInt(object.sequence); + } + return message; }, toAmino(message: BaseAccount): BaseAccountAmino { const obj: any = {}; @@ -201,16 +282,28 @@ export const BaseAccount = { }; } }; +GlobalDecoderRegistry.register(BaseAccount.typeUrl, BaseAccount); +GlobalDecoderRegistry.registerAminoProtoMapping(BaseAccount.aminoType, BaseAccount.typeUrl); function createBaseModuleAccount(): ModuleAccount { return { $typeUrl: "/cosmos.auth.v1beta1.ModuleAccount", - baseAccount: BaseAccount.fromPartial({}), + baseAccount: undefined, name: "", permissions: [] }; } export const ModuleAccount = { typeUrl: "/cosmos.auth.v1beta1.ModuleAccount", + aminoType: "cosmos-sdk/ModuleAccount", + is(o: any): o is ModuleAccount { + return o && (o.$typeUrl === ModuleAccount.typeUrl || typeof o.name === "string" && Array.isArray(o.permissions) && (!o.permissions.length || typeof o.permissions[0] === "string")); + }, + isSDK(o: any): o is ModuleAccountSDKType { + return o && (o.$typeUrl === ModuleAccount.typeUrl || typeof o.name === "string" && Array.isArray(o.permissions) && (!o.permissions.length || typeof o.permissions[0] === "string")); + }, + isAmino(o: any): o is ModuleAccountAmino { + return o && (o.$typeUrl === ModuleAccount.typeUrl || typeof o.name === "string" && Array.isArray(o.permissions) && (!o.permissions.length || typeof o.permissions[0] === "string")); + }, encode(message: ModuleAccount, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.baseAccount !== undefined) { BaseAccount.encode(message.baseAccount, writer.uint32(10).fork()).ldelim(); @@ -246,6 +339,24 @@ export const ModuleAccount = { } return message; }, + fromJSON(object: any): ModuleAccount { + return { + 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)) : [] + }; + }, + toJSON(message: ModuleAccount): unknown { + const obj: any = {}; + message.baseAccount !== undefined && (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); + } else { + obj.permissions = []; + } + return obj; + }, fromPartial(object: Partial): ModuleAccount { const message = createBaseModuleAccount(); message.baseAccount = object.baseAccount !== undefined && object.baseAccount !== null ? BaseAccount.fromPartial(object.baseAccount) : undefined; @@ -254,11 +365,15 @@ export const ModuleAccount = { return message; }, fromAmino(object: ModuleAccountAmino): ModuleAccount { - return { - baseAccount: object?.base_account ? BaseAccount.fromAmino(object.base_account) : undefined, - name: object.name, - permissions: Array.isArray(object?.permissions) ? object.permissions.map((e: any) => e) : [] - }; + const message = createBaseModuleAccount(); + if (object.base_account !== undefined && object.base_account !== null) { + message.baseAccount = BaseAccount.fromAmino(object.base_account); + } + if (object.name !== undefined && object.name !== null) { + message.name = object.name; + } + message.permissions = object.permissions?.map(e => e) || []; + return message; }, toAmino(message: ModuleAccount): ModuleAccountAmino { const obj: any = {}; @@ -293,6 +408,119 @@ export const ModuleAccount = { }; } }; +GlobalDecoderRegistry.register(ModuleAccount.typeUrl, ModuleAccount); +GlobalDecoderRegistry.registerAminoProtoMapping(ModuleAccount.aminoType, ModuleAccount.typeUrl); +function createBaseModuleCredential(): ModuleCredential { + return { + moduleName: "", + derivationKeys: [] + }; +} +export const ModuleCredential = { + typeUrl: "/cosmos.auth.v1beta1.ModuleCredential", + aminoType: "cosmos-sdk/ModuleCredential", + is(o: any): o is ModuleCredential { + return o && (o.$typeUrl === ModuleCredential.typeUrl || typeof o.moduleName === "string" && Array.isArray(o.derivationKeys) && (!o.derivationKeys.length || o.derivationKeys[0] instanceof Uint8Array || typeof o.derivationKeys[0] === "string")); + }, + isSDK(o: any): o is ModuleCredentialSDKType { + return o && (o.$typeUrl === ModuleCredential.typeUrl || typeof o.module_name === "string" && Array.isArray(o.derivation_keys) && (!o.derivation_keys.length || o.derivation_keys[0] instanceof Uint8Array || typeof o.derivation_keys[0] === "string")); + }, + isAmino(o: any): o is ModuleCredentialAmino { + return o && (o.$typeUrl === ModuleCredential.typeUrl || typeof o.module_name === "string" && Array.isArray(o.derivation_keys) && (!o.derivation_keys.length || o.derivation_keys[0] instanceof Uint8Array || typeof o.derivation_keys[0] === "string")); + }, + encode(message: ModuleCredential, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.moduleName !== "") { + writer.uint32(10).string(message.moduleName); + } + for (const v of message.derivationKeys) { + writer.uint32(18).bytes(v!); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): ModuleCredential { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseModuleCredential(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.moduleName = reader.string(); + break; + case 2: + message.derivationKeys.push(reader.bytes()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): ModuleCredential { + return { + moduleName: isSet(object.moduleName) ? String(object.moduleName) : "", + derivationKeys: Array.isArray(object?.derivationKeys) ? object.derivationKeys.map((e: any) => bytesFromBase64(e)) : [] + }; + }, + toJSON(message: ModuleCredential): unknown { + const obj: any = {}; + message.moduleName !== undefined && (obj.moduleName = message.moduleName); + if (message.derivationKeys) { + obj.derivationKeys = message.derivationKeys.map(e => base64FromBytes(e !== undefined ? e : new Uint8Array())); + } else { + obj.derivationKeys = []; + } + return obj; + }, + fromPartial(object: Partial): ModuleCredential { + const message = createBaseModuleCredential(); + message.moduleName = object.moduleName ?? ""; + message.derivationKeys = object.derivationKeys?.map(e => e) || []; + return message; + }, + fromAmino(object: ModuleCredentialAmino): ModuleCredential { + const message = createBaseModuleCredential(); + if (object.module_name !== undefined && object.module_name !== null) { + message.moduleName = object.module_name; + } + message.derivationKeys = object.derivation_keys?.map(e => bytesFromBase64(e)) || []; + return message; + }, + toAmino(message: ModuleCredential): ModuleCredentialAmino { + const obj: any = {}; + obj.module_name = message.moduleName; + if (message.derivationKeys) { + obj.derivation_keys = message.derivationKeys.map(e => base64FromBytes(e)); + } else { + obj.derivation_keys = []; + } + return obj; + }, + fromAminoMsg(object: ModuleCredentialAminoMsg): ModuleCredential { + return ModuleCredential.fromAmino(object.value); + }, + toAminoMsg(message: ModuleCredential): ModuleCredentialAminoMsg { + return { + type: "cosmos-sdk/ModuleCredential", + value: ModuleCredential.toAmino(message) + }; + }, + fromProtoMsg(message: ModuleCredentialProtoMsg): ModuleCredential { + return ModuleCredential.decode(message.value); + }, + toProto(message: ModuleCredential): Uint8Array { + return ModuleCredential.encode(message).finish(); + }, + toProtoMsg(message: ModuleCredential): ModuleCredentialProtoMsg { + return { + typeUrl: "/cosmos.auth.v1beta1.ModuleCredential", + value: ModuleCredential.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(ModuleCredential.typeUrl, ModuleCredential); +GlobalDecoderRegistry.registerAminoProtoMapping(ModuleCredential.aminoType, ModuleCredential.typeUrl); function createBaseParams(): Params { return { maxMemoCharacters: BigInt(0), @@ -304,6 +532,16 @@ function createBaseParams(): Params { } export const Params = { typeUrl: "/cosmos.auth.v1beta1.Params", + aminoType: "cosmos-sdk/x/auth/Params", + is(o: any): o is Params { + return o && (o.$typeUrl === Params.typeUrl || typeof o.maxMemoCharacters === "bigint" && typeof o.txSigLimit === "bigint" && typeof o.txSizeCostPerByte === "bigint" && typeof o.sigVerifyCostEd25519 === "bigint" && typeof o.sigVerifyCostSecp256k1 === "bigint"); + }, + isSDK(o: any): o is ParamsSDKType { + return o && (o.$typeUrl === Params.typeUrl || typeof o.max_memo_characters === "bigint" && typeof o.tx_sig_limit === "bigint" && typeof o.tx_size_cost_per_byte === "bigint" && typeof o.sig_verify_cost_ed25519 === "bigint" && typeof o.sig_verify_cost_secp256k1 === "bigint"); + }, + isAmino(o: any): o is ParamsAmino { + return o && (o.$typeUrl === Params.typeUrl || typeof o.max_memo_characters === "bigint" && typeof o.tx_sig_limit === "bigint" && typeof o.tx_size_cost_per_byte === "bigint" && typeof o.sig_verify_cost_ed25519 === "bigint" && typeof o.sig_verify_cost_secp256k1 === "bigint"); + }, encode(message: Params, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.maxMemoCharacters !== BigInt(0)) { writer.uint32(8).uint64(message.maxMemoCharacters); @@ -351,6 +589,24 @@ export const Params = { } return message; }, + fromJSON(object: any): Params { + return { + maxMemoCharacters: isSet(object.maxMemoCharacters) ? BigInt(object.maxMemoCharacters.toString()) : BigInt(0), + txSigLimit: isSet(object.txSigLimit) ? BigInt(object.txSigLimit.toString()) : BigInt(0), + txSizeCostPerByte: isSet(object.txSizeCostPerByte) ? BigInt(object.txSizeCostPerByte.toString()) : BigInt(0), + sigVerifyCostEd25519: isSet(object.sigVerifyCostEd25519) ? BigInt(object.sigVerifyCostEd25519.toString()) : BigInt(0), + sigVerifyCostSecp256k1: isSet(object.sigVerifyCostSecp256k1) ? BigInt(object.sigVerifyCostSecp256k1.toString()) : BigInt(0) + }; + }, + toJSON(message: Params): unknown { + const obj: any = {}; + message.maxMemoCharacters !== undefined && (obj.maxMemoCharacters = (message.maxMemoCharacters || BigInt(0)).toString()); + message.txSigLimit !== undefined && (obj.txSigLimit = (message.txSigLimit || BigInt(0)).toString()); + message.txSizeCostPerByte !== undefined && (obj.txSizeCostPerByte = (message.txSizeCostPerByte || BigInt(0)).toString()); + message.sigVerifyCostEd25519 !== undefined && (obj.sigVerifyCostEd25519 = (message.sigVerifyCostEd25519 || BigInt(0)).toString()); + message.sigVerifyCostSecp256k1 !== undefined && (obj.sigVerifyCostSecp256k1 = (message.sigVerifyCostSecp256k1 || BigInt(0)).toString()); + return obj; + }, fromPartial(object: Partial): Params { const message = createBaseParams(); message.maxMemoCharacters = object.maxMemoCharacters !== undefined && object.maxMemoCharacters !== null ? BigInt(object.maxMemoCharacters.toString()) : BigInt(0); @@ -361,13 +617,23 @@ export const Params = { return message; }, fromAmino(object: ParamsAmino): Params { - return { - maxMemoCharacters: BigInt(object.max_memo_characters), - txSigLimit: BigInt(object.tx_sig_limit), - txSizeCostPerByte: BigInt(object.tx_size_cost_per_byte), - sigVerifyCostEd25519: BigInt(object.sig_verify_cost_ed25519), - sigVerifyCostSecp256k1: BigInt(object.sig_verify_cost_secp256k1) - }; + const message = createBaseParams(); + if (object.max_memo_characters !== undefined && object.max_memo_characters !== null) { + message.maxMemoCharacters = BigInt(object.max_memo_characters); + } + if (object.tx_sig_limit !== undefined && object.tx_sig_limit !== null) { + message.txSigLimit = BigInt(object.tx_sig_limit); + } + if (object.tx_size_cost_per_byte !== undefined && object.tx_size_cost_per_byte !== null) { + message.txSizeCostPerByte = BigInt(object.tx_size_cost_per_byte); + } + if (object.sig_verify_cost_ed25519 !== undefined && object.sig_verify_cost_ed25519 !== null) { + message.sigVerifyCostEd25519 = BigInt(object.sig_verify_cost_ed25519); + } + if (object.sig_verify_cost_secp256k1 !== undefined && object.sig_verify_cost_secp256k1 !== null) { + message.sigVerifyCostSecp256k1 = BigInt(object.sig_verify_cost_secp256k1); + } + return message; }, toAmino(message: Params): ParamsAmino { const obj: any = {}; @@ -399,4 +665,6 @@ export const Params = { value: Params.encode(message).finish() }; } -}; \ No newline at end of file +}; +GlobalDecoderRegistry.register(Params.typeUrl, Params); +GlobalDecoderRegistry.registerAminoProtoMapping(Params.aminoType, Params.typeUrl); \ No newline at end of file diff --git a/packages/osmojs/src/codegen/cosmos/auth/v1beta1/genesis.ts b/packages/osmojs/src/codegen/cosmos/auth/v1beta1/genesis.ts index e1d6676b5..0d705a111 100644 --- a/packages/osmojs/src/codegen/cosmos/auth/v1beta1/genesis.ts +++ b/packages/osmojs/src/codegen/cosmos/auth/v1beta1/genesis.ts @@ -1,9 +1,11 @@ import { Params, ParamsAmino, ParamsSDKType } from "./auth"; import { Any, AnyAmino, AnySDKType } from "../../../google/protobuf/any"; import { BinaryReader, BinaryWriter } from "../../../binary"; +import { isSet } from "../../../helpers"; +import { GlobalDecoderRegistry } from "../../../registry"; /** GenesisState defines the auth module's genesis state. */ export interface GenesisState { - /** params defines all the paramaters of the module. */ + /** params defines all the parameters of the module. */ params: Params; /** accounts are the accounts present at genesis. */ accounts: Any[]; @@ -14,10 +16,10 @@ export interface GenesisStateProtoMsg { } /** GenesisState defines the auth module's genesis state. */ export interface GenesisStateAmino { - /** params defines all the paramaters of the module. */ - params?: ParamsAmino; + /** params defines all the parameters of the module. */ + params: ParamsAmino; /** accounts are the accounts present at genesis. */ - accounts: AnyAmino[]; + accounts?: AnyAmino[]; } export interface GenesisStateAminoMsg { type: "cosmos-sdk/GenesisState"; @@ -36,6 +38,16 @@ function createBaseGenesisState(): GenesisState { } export const GenesisState = { typeUrl: "/cosmos.auth.v1beta1.GenesisState", + aminoType: "cosmos-sdk/GenesisState", + is(o: any): o is GenesisState { + return o && (o.$typeUrl === GenesisState.typeUrl || Params.is(o.params) && Array.isArray(o.accounts) && (!o.accounts.length || Any.is(o.accounts[0]))); + }, + isSDK(o: any): o is GenesisStateSDKType { + return o && (o.$typeUrl === GenesisState.typeUrl || Params.isSDK(o.params) && Array.isArray(o.accounts) && (!o.accounts.length || Any.isSDK(o.accounts[0]))); + }, + isAmino(o: any): o is GenesisStateAmino { + return o && (o.$typeUrl === GenesisState.typeUrl || Params.isAmino(o.params) && Array.isArray(o.accounts) && (!o.accounts.length || Any.isAmino(o.accounts[0]))); + }, encode(message: GenesisState, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.params !== undefined) { Params.encode(message.params, writer.uint32(10).fork()).ldelim(); @@ -65,6 +77,22 @@ export const GenesisState = { } 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)) : [] + }; + }, + toJSON(message: GenesisState): unknown { + 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); + } else { + obj.accounts = []; + } + return obj; + }, fromPartial(object: Partial): GenesisState { const message = createBaseGenesisState(); message.params = object.params !== undefined && object.params !== null ? Params.fromPartial(object.params) : undefined; @@ -72,14 +100,16 @@ export const GenesisState = { return message; }, fromAmino(object: GenesisStateAmino): GenesisState { - return { - params: object?.params ? Params.fromAmino(object.params) : undefined, - accounts: Array.isArray(object?.accounts) ? object.accounts.map((e: any) => Any.fromAmino(e)) : [] - }; + const message = createBaseGenesisState(); + if (object.params !== undefined && object.params !== null) { + message.params = Params.fromAmino(object.params); + } + message.accounts = object.accounts?.map(e => Any.fromAmino(e)) || []; + return message; }, toAmino(message: GenesisState): GenesisStateAmino { const obj: any = {}; - obj.params = message.params ? Params.toAmino(message.params) : undefined; + obj.params = message.params ? Params.toAmino(message.params) : Params.fromPartial({}); if (message.accounts) { obj.accounts = message.accounts.map(e => e ? Any.toAmino(e) : undefined); } else { @@ -108,4 +138,6 @@ export const GenesisState = { value: GenesisState.encode(message).finish() }; } -}; \ No newline at end of file +}; +GlobalDecoderRegistry.register(GenesisState.typeUrl, GenesisState); +GlobalDecoderRegistry.registerAminoProtoMapping(GenesisState.aminoType, GenesisState.typeUrl); \ No newline at end of file diff --git a/packages/osmojs/src/codegen/cosmos/auth/v1beta1/query.lcd.ts b/packages/osmojs/src/codegen/cosmos/auth/v1beta1/query.lcd.ts index 46230b530..e6507b9db 100644 --- a/packages/osmojs/src/codegen/cosmos/auth/v1beta1/query.lcd.ts +++ b/packages/osmojs/src/codegen/cosmos/auth/v1beta1/query.lcd.ts @@ -1,6 +1,6 @@ import { setPaginationParams } from "../../../helpers"; import { LCDClient } from "@cosmology/lcd"; -import { QueryAccountsRequest, QueryAccountsResponseSDKType, QueryAccountRequest, QueryAccountResponseSDKType, QueryParamsRequest, QueryParamsResponseSDKType, QueryModuleAccountsRequest, QueryModuleAccountsResponseSDKType } from "./query"; +import { QueryAccountsRequest, QueryAccountsResponseSDKType, QueryAccountRequest, QueryAccountResponseSDKType, QueryAccountAddressByIDRequest, QueryAccountAddressByIDResponseSDKType, QueryParamsRequest, QueryParamsResponseSDKType, QueryModuleAccountsRequest, QueryModuleAccountsResponseSDKType, QueryModuleAccountByNameRequest, QueryModuleAccountByNameResponseSDKType, Bech32PrefixRequest, Bech32PrefixResponseSDKType, AddressBytesToStringRequest, AddressBytesToStringResponseSDKType, AddressStringToBytesRequest, AddressStringToBytesResponseSDKType, QueryAccountInfoRequest, QueryAccountInfoResponseSDKType } from "./query"; export class LCDQueryClient { req: LCDClient; constructor({ @@ -11,10 +11,19 @@ export class LCDQueryClient { this.req = requestClient; this.accounts = this.accounts.bind(this); this.account = this.account.bind(this); + this.accountAddressByID = this.accountAddressByID.bind(this); this.params = this.params.bind(this); this.moduleAccounts = this.moduleAccounts.bind(this); + this.moduleAccountByName = this.moduleAccountByName.bind(this); + this.bech32Prefix = this.bech32Prefix.bind(this); + this.addressBytesToString = this.addressBytesToString.bind(this); + this.addressStringToBytes = this.addressStringToBytes.bind(this); + this.accountInfo = this.accountInfo.bind(this); } - /* Accounts returns all the existing accounts + /* Accounts returns all the existing accounts. + + When called from another module, this query might consume a high amount of + gas if the pagination field is incorrectly set. Since: cosmos-sdk 0.43 */ async accounts(params: QueryAccountsRequest = { @@ -34,14 +43,62 @@ export class LCDQueryClient { const endpoint = `cosmos/auth/v1beta1/accounts/${params.address}`; return await this.req.get(endpoint); } + /* AccountAddressByID returns account address based on account number. + + Since: cosmos-sdk 0.46.2 */ + async accountAddressByID(params: QueryAccountAddressByIDRequest): Promise { + const options: any = { + params: {} + }; + if (typeof params?.accountId !== "undefined") { + options.params.account_id = params.accountId; + } + const endpoint = `cosmos/auth/v1beta1/address_by_id/${params.id}`; + return await this.req.get(endpoint, options); + } /* Params queries all parameters. */ async params(_params: QueryParamsRequest = {}): Promise { const endpoint = `cosmos/auth/v1beta1/params`; return await this.req.get(endpoint); } - /* ModuleAccounts returns all the existing module accounts. */ + /* ModuleAccounts returns all the existing module accounts. + + Since: cosmos-sdk 0.46 */ async moduleAccounts(_params: QueryModuleAccountsRequest = {}): Promise { const endpoint = `cosmos/auth/v1beta1/module_accounts`; return await this.req.get(endpoint); } + /* ModuleAccountByName returns the module account info by module name */ + async moduleAccountByName(params: QueryModuleAccountByNameRequest): Promise { + const endpoint = `cosmos/auth/v1beta1/module_accounts/${params.name}`; + return await this.req.get(endpoint); + } + /* Bech32Prefix queries bech32Prefix + + Since: cosmos-sdk 0.46 */ + async bech32Prefix(_params: Bech32PrefixRequest = {}): Promise { + const endpoint = `cosmos/auth/v1beta1/bech32`; + return await this.req.get(endpoint); + } + /* AddressBytesToString converts Account Address bytes to string + + Since: cosmos-sdk 0.46 */ + async addressBytesToString(params: AddressBytesToStringRequest): Promise { + const endpoint = `cosmos/auth/v1beta1/bech32/${params.addressBytes}`; + return await this.req.get(endpoint); + } + /* AddressStringToBytes converts Address string to bytes + + Since: cosmos-sdk 0.46 */ + async addressStringToBytes(params: AddressStringToBytesRequest): Promise { + const endpoint = `cosmos/auth/v1beta1/bech32/${params.addressString}`; + return await this.req.get(endpoint); + } + /* AccountInfo queries account info which is common to all account types. + + Since: cosmos-sdk 0.47 */ + async accountInfo(params: QueryAccountInfoRequest): Promise { + const endpoint = `cosmos/auth/v1beta1/account_info/${params.address}`; + return await this.req.get(endpoint); + } } \ No newline at end of file diff --git a/packages/osmojs/src/codegen/cosmos/auth/v1beta1/query.rpc.Query.ts b/packages/osmojs/src/codegen/cosmos/auth/v1beta1/query.rpc.Query.ts index 3197f859b..660583fe2 100644 --- a/packages/osmojs/src/codegen/cosmos/auth/v1beta1/query.rpc.Query.ts +++ b/packages/osmojs/src/codegen/cosmos/auth/v1beta1/query.rpc.Query.ts @@ -1,21 +1,60 @@ import { Rpc } from "../../../helpers"; import { BinaryReader } from "../../../binary"; import { QueryClient, createProtobufRpcClient } from "@cosmjs/stargate"; -import { QueryAccountsRequest, QueryAccountsResponse, QueryAccountRequest, QueryAccountResponse, QueryParamsRequest, QueryParamsResponse, QueryModuleAccountsRequest, QueryModuleAccountsResponse } from "./query"; +import { QueryAccountsRequest, QueryAccountsResponse, QueryAccountRequest, QueryAccountResponse, QueryAccountAddressByIDRequest, QueryAccountAddressByIDResponse, QueryParamsRequest, QueryParamsResponse, QueryModuleAccountsRequest, QueryModuleAccountsResponse, QueryModuleAccountByNameRequest, QueryModuleAccountByNameResponse, Bech32PrefixRequest, Bech32PrefixResponse, AddressBytesToStringRequest, AddressBytesToStringResponse, AddressStringToBytesRequest, AddressStringToBytesResponse, QueryAccountInfoRequest, QueryAccountInfoResponse } from "./query"; /** Query defines the gRPC querier service. */ export interface Query { /** - * Accounts returns all the existing accounts + * Accounts returns all the existing accounts. + * + * When called from another module, this query might consume a high amount of + * gas if the pagination field is incorrectly set. * * Since: cosmos-sdk 0.43 */ accounts(request?: QueryAccountsRequest): Promise; /** Account returns account details based on address. */ account(request: QueryAccountRequest): Promise; + /** + * AccountAddressByID returns account address based on account number. + * + * Since: cosmos-sdk 0.46.2 + */ + accountAddressByID(request: QueryAccountAddressByIDRequest): Promise; /** Params queries all parameters. */ params(request?: QueryParamsRequest): Promise; - /** ModuleAccounts returns all the existing module accounts. */ + /** + * ModuleAccounts returns all the existing module accounts. + * + * Since: cosmos-sdk 0.46 + */ moduleAccounts(request?: QueryModuleAccountsRequest): Promise; + /** ModuleAccountByName returns the module account info by module name */ + moduleAccountByName(request: QueryModuleAccountByNameRequest): Promise; + /** + * Bech32Prefix queries bech32Prefix + * + * Since: cosmos-sdk 0.46 + */ + bech32Prefix(request?: Bech32PrefixRequest): Promise; + /** + * AddressBytesToString converts Account Address bytes to string + * + * Since: cosmos-sdk 0.46 + */ + addressBytesToString(request: AddressBytesToStringRequest): Promise; + /** + * AddressStringToBytes converts Address string to bytes + * + * Since: cosmos-sdk 0.46 + */ + addressStringToBytes(request: AddressStringToBytesRequest): Promise; + /** + * AccountInfo queries account info which is common to all account types. + * + * Since: cosmos-sdk 0.47 + */ + accountInfo(request: QueryAccountInfoRequest): Promise; } export class QueryClientImpl implements Query { private readonly rpc: Rpc; @@ -23,8 +62,14 @@ export class QueryClientImpl implements Query { this.rpc = rpc; this.accounts = this.accounts.bind(this); this.account = this.account.bind(this); + this.accountAddressByID = this.accountAddressByID.bind(this); this.params = this.params.bind(this); this.moduleAccounts = this.moduleAccounts.bind(this); + this.moduleAccountByName = this.moduleAccountByName.bind(this); + this.bech32Prefix = this.bech32Prefix.bind(this); + this.addressBytesToString = this.addressBytesToString.bind(this); + this.addressStringToBytes = this.addressStringToBytes.bind(this); + this.accountInfo = this.accountInfo.bind(this); } accounts(request: QueryAccountsRequest = { pagination: undefined @@ -38,6 +83,11 @@ export class QueryClientImpl implements Query { const promise = this.rpc.request("cosmos.auth.v1beta1.Query", "Account", data); return promise.then(data => QueryAccountResponse.decode(new BinaryReader(data))); } + accountAddressByID(request: QueryAccountAddressByIDRequest): Promise { + const data = QueryAccountAddressByIDRequest.encode(request).finish(); + const promise = this.rpc.request("cosmos.auth.v1beta1.Query", "AccountAddressByID", data); + return promise.then(data => QueryAccountAddressByIDResponse.decode(new BinaryReader(data))); + } params(request: QueryParamsRequest = {}): Promise { const data = QueryParamsRequest.encode(request).finish(); const promise = this.rpc.request("cosmos.auth.v1beta1.Query", "Params", data); @@ -48,6 +98,31 @@ export class QueryClientImpl implements Query { const promise = this.rpc.request("cosmos.auth.v1beta1.Query", "ModuleAccounts", data); return promise.then(data => QueryModuleAccountsResponse.decode(new BinaryReader(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 BinaryReader(data))); + } + bech32Prefix(request: Bech32PrefixRequest = {}): Promise { + const data = Bech32PrefixRequest.encode(request).finish(); + const promise = this.rpc.request("cosmos.auth.v1beta1.Query", "Bech32Prefix", data); + return promise.then(data => Bech32PrefixResponse.decode(new BinaryReader(data))); + } + addressBytesToString(request: AddressBytesToStringRequest): Promise { + const data = AddressBytesToStringRequest.encode(request).finish(); + const promise = this.rpc.request("cosmos.auth.v1beta1.Query", "AddressBytesToString", data); + return promise.then(data => AddressBytesToStringResponse.decode(new BinaryReader(data))); + } + addressStringToBytes(request: AddressStringToBytesRequest): Promise { + const data = AddressStringToBytesRequest.encode(request).finish(); + const promise = this.rpc.request("cosmos.auth.v1beta1.Query", "AddressStringToBytes", data); + return promise.then(data => AddressStringToBytesResponse.decode(new BinaryReader(data))); + } + accountInfo(request: QueryAccountInfoRequest): Promise { + const data = QueryAccountInfoRequest.encode(request).finish(); + const promise = this.rpc.request("cosmos.auth.v1beta1.Query", "AccountInfo", data); + return promise.then(data => QueryAccountInfoResponse.decode(new BinaryReader(data))); + } } export const createRpcQueryExtension = (base: QueryClient) => { const rpc = createProtobufRpcClient(base); @@ -59,11 +134,29 @@ export const createRpcQueryExtension = (base: QueryClient) => { account(request: QueryAccountRequest): Promise { return queryService.account(request); }, + accountAddressByID(request: QueryAccountAddressByIDRequest): Promise { + return queryService.accountAddressByID(request); + }, params(request?: QueryParamsRequest): Promise { return queryService.params(request); }, moduleAccounts(request?: QueryModuleAccountsRequest): Promise { return queryService.moduleAccounts(request); + }, + moduleAccountByName(request: QueryModuleAccountByNameRequest): Promise { + return queryService.moduleAccountByName(request); + }, + bech32Prefix(request?: Bech32PrefixRequest): Promise { + return queryService.bech32Prefix(request); + }, + addressBytesToString(request: AddressBytesToStringRequest): Promise { + return queryService.addressBytesToString(request); + }, + addressStringToBytes(request: AddressStringToBytesRequest): Promise { + return queryService.addressStringToBytes(request); + }, + accountInfo(request: QueryAccountInfoRequest): Promise { + return queryService.accountInfo(request); } }; }; \ No newline at end of file diff --git a/packages/osmojs/src/codegen/cosmos/auth/v1beta1/query.ts b/packages/osmojs/src/codegen/cosmos/auth/v1beta1/query.ts index d5d0ca590..f25ddba59 100644 --- a/packages/osmojs/src/codegen/cosmos/auth/v1beta1/query.ts +++ b/packages/osmojs/src/codegen/cosmos/auth/v1beta1/query.ts @@ -1,7 +1,9 @@ import { PageRequest, PageRequestAmino, PageRequestSDKType, PageResponse, PageResponseAmino, PageResponseSDKType } from "../../base/query/v1beta1/pagination"; import { Any, AnyProtoMsg, AnyAmino, AnySDKType } from "../../../google/protobuf/any"; -import { Params, ParamsAmino, ParamsSDKType, BaseAccount, BaseAccountProtoMsg, BaseAccountSDKType, ModuleAccount, ModuleAccountProtoMsg, ModuleAccountSDKType } from "./auth"; +import { Params, ParamsAmino, ParamsSDKType, BaseAccount, BaseAccountProtoMsg, BaseAccountAmino, BaseAccountSDKType, ModuleAccount, ModuleAccountProtoMsg, ModuleAccountSDKType } from "./auth"; import { BinaryReader, BinaryWriter } from "../../../binary"; +import { isSet, bytesFromBase64, base64FromBytes } from "../../../helpers"; +import { GlobalDecoderRegistry } from "../../../registry"; /** * QueryAccountsRequest is the request type for the Query/Accounts RPC method. * @@ -9,7 +11,7 @@ import { BinaryReader, BinaryWriter } from "../../../binary"; */ export interface QueryAccountsRequest { /** pagination defines an optional pagination for the request. */ - pagination: PageRequest; + pagination?: PageRequest; } export interface QueryAccountsRequestProtoMsg { typeUrl: "/cosmos.auth.v1beta1.QueryAccountsRequest"; @@ -34,7 +36,7 @@ export interface QueryAccountsRequestAminoMsg { * Since: cosmos-sdk 0.43 */ export interface QueryAccountsRequestSDKType { - pagination: PageRequestSDKType; + pagination?: PageRequestSDKType; } /** * QueryAccountsResponse is the response type for the Query/Accounts RPC method. @@ -43,9 +45,9 @@ export interface QueryAccountsRequestSDKType { */ export interface QueryAccountsResponse { /** accounts are the existing accounts */ - accounts: (BaseAccount & Any)[] | Any[]; + accounts: (BaseAccount | Any)[] | Any[]; /** pagination defines the pagination in the response. */ - pagination: PageResponse; + pagination?: PageResponse; } export interface QueryAccountsResponseProtoMsg { typeUrl: "/cosmos.auth.v1beta1.QueryAccountsResponse"; @@ -61,7 +63,7 @@ export type QueryAccountsResponseEncoded = Omit & { accounts: (ModuleAccountProtoMsg | AnyProtoMsg)[]; }; -/** QueryModuleAccountsResponse is the response type for the Query/ModuleAccounts RPC method. */ +/** + * QueryModuleAccountsResponse is the response type for the Query/ModuleAccounts RPC method. + * + * Since: cosmos-sdk 0.46 + */ export interface QueryModuleAccountsResponseAmino { - accounts: AnyAmino[]; + accounts?: AnyAmino[]; } export interface QueryModuleAccountsResponseAminoMsg { type: "cosmos-sdk/QueryModuleAccountsResponse"; value: QueryModuleAccountsResponseAmino; } -/** QueryModuleAccountsResponse is the response type for the Query/ModuleAccounts RPC method. */ +/** + * QueryModuleAccountsResponse is the response type for the Query/ModuleAccounts RPC method. + * + * Since: cosmos-sdk 0.46 + */ export interface QueryModuleAccountsResponseSDKType { accounts: (ModuleAccountSDKType | AnySDKType)[]; } +/** QueryModuleAccountByNameRequest is the request type for the Query/ModuleAccountByName RPC method. */ +export interface QueryModuleAccountByNameRequest { + name: string; +} +export interface QueryModuleAccountByNameRequestProtoMsg { + typeUrl: "/cosmos.auth.v1beta1.QueryModuleAccountByNameRequest"; + value: Uint8Array; +} +/** QueryModuleAccountByNameRequest is the request type for the Query/ModuleAccountByName RPC method. */ +export interface QueryModuleAccountByNameRequestAmino { + name?: string; +} +export interface QueryModuleAccountByNameRequestAminoMsg { + type: "cosmos-sdk/QueryModuleAccountByNameRequest"; + value: QueryModuleAccountByNameRequestAmino; +} +/** QueryModuleAccountByNameRequest is the request type for the Query/ModuleAccountByName RPC method. */ +export interface QueryModuleAccountByNameRequestSDKType { + name: string; +} +/** QueryModuleAccountByNameResponse is the response type for the Query/ModuleAccountByName RPC method. */ +export interface QueryModuleAccountByNameResponse { + account?: ModuleAccount | Any | undefined; +} +export interface QueryModuleAccountByNameResponseProtoMsg { + typeUrl: "/cosmos.auth.v1beta1.QueryModuleAccountByNameResponse"; + value: Uint8Array; +} +export type QueryModuleAccountByNameResponseEncoded = Omit & { + account?: ModuleAccountProtoMsg | AnyProtoMsg | undefined; +}; +/** QueryModuleAccountByNameResponse is the response type for the Query/ModuleAccountByName RPC method. */ +export interface QueryModuleAccountByNameResponseAmino { + account?: AnyAmino; +} +export interface QueryModuleAccountByNameResponseAminoMsg { + type: "cosmos-sdk/QueryModuleAccountByNameResponse"; + value: QueryModuleAccountByNameResponseAmino; +} +/** QueryModuleAccountByNameResponse is the response type for the Query/ModuleAccountByName RPC method. */ +export interface QueryModuleAccountByNameResponseSDKType { + account?: ModuleAccountSDKType | AnySDKType | undefined; +} +/** + * Bech32PrefixRequest is the request type for Bech32Prefix rpc method. + * + * Since: cosmos-sdk 0.46 + */ +export interface Bech32PrefixRequest {} +export interface Bech32PrefixRequestProtoMsg { + typeUrl: "/cosmos.auth.v1beta1.Bech32PrefixRequest"; + value: Uint8Array; +} +/** + * Bech32PrefixRequest is the request type for Bech32Prefix rpc method. + * + * Since: cosmos-sdk 0.46 + */ +export interface Bech32PrefixRequestAmino {} +export interface Bech32PrefixRequestAminoMsg { + type: "cosmos-sdk/Bech32PrefixRequest"; + value: Bech32PrefixRequestAmino; +} +/** + * Bech32PrefixRequest is the request type for Bech32Prefix rpc method. + * + * Since: cosmos-sdk 0.46 + */ +export interface Bech32PrefixRequestSDKType {} +/** + * Bech32PrefixResponse is the response type for Bech32Prefix rpc method. + * + * Since: cosmos-sdk 0.46 + */ +export interface Bech32PrefixResponse { + bech32Prefix: string; +} +export interface Bech32PrefixResponseProtoMsg { + typeUrl: "/cosmos.auth.v1beta1.Bech32PrefixResponse"; + value: Uint8Array; +} +/** + * Bech32PrefixResponse is the response type for Bech32Prefix rpc method. + * + * Since: cosmos-sdk 0.46 + */ +export interface Bech32PrefixResponseAmino { + bech32_prefix?: string; +} +export interface Bech32PrefixResponseAminoMsg { + type: "cosmos-sdk/Bech32PrefixResponse"; + value: Bech32PrefixResponseAmino; +} +/** + * Bech32PrefixResponse is the response type for Bech32Prefix rpc method. + * + * Since: cosmos-sdk 0.46 + */ +export interface Bech32PrefixResponseSDKType { + bech32_prefix: string; +} +/** + * AddressBytesToStringRequest is the request type for AddressString rpc method. + * + * Since: cosmos-sdk 0.46 + */ +export interface AddressBytesToStringRequest { + addressBytes: Uint8Array; +} +export interface AddressBytesToStringRequestProtoMsg { + typeUrl: "/cosmos.auth.v1beta1.AddressBytesToStringRequest"; + value: Uint8Array; +} +/** + * AddressBytesToStringRequest is the request type for AddressString rpc method. + * + * Since: cosmos-sdk 0.46 + */ +export interface AddressBytesToStringRequestAmino { + address_bytes?: string; +} +export interface AddressBytesToStringRequestAminoMsg { + type: "cosmos-sdk/AddressBytesToStringRequest"; + value: AddressBytesToStringRequestAmino; +} +/** + * AddressBytesToStringRequest is the request type for AddressString rpc method. + * + * Since: cosmos-sdk 0.46 + */ +export interface AddressBytesToStringRequestSDKType { + address_bytes: Uint8Array; +} +/** + * AddressBytesToStringResponse is the response type for AddressString rpc method. + * + * Since: cosmos-sdk 0.46 + */ +export interface AddressBytesToStringResponse { + addressString: string; +} +export interface AddressBytesToStringResponseProtoMsg { + typeUrl: "/cosmos.auth.v1beta1.AddressBytesToStringResponse"; + value: Uint8Array; +} +/** + * AddressBytesToStringResponse is the response type for AddressString rpc method. + * + * Since: cosmos-sdk 0.46 + */ +export interface AddressBytesToStringResponseAmino { + address_string?: string; +} +export interface AddressBytesToStringResponseAminoMsg { + type: "cosmos-sdk/AddressBytesToStringResponse"; + value: AddressBytesToStringResponseAmino; +} +/** + * AddressBytesToStringResponse is the response type for AddressString rpc method. + * + * Since: cosmos-sdk 0.46 + */ +export interface AddressBytesToStringResponseSDKType { + address_string: string; +} +/** + * AddressStringToBytesRequest is the request type for AccountBytes rpc method. + * + * Since: cosmos-sdk 0.46 + */ +export interface AddressStringToBytesRequest { + addressString: string; +} +export interface AddressStringToBytesRequestProtoMsg { + typeUrl: "/cosmos.auth.v1beta1.AddressStringToBytesRequest"; + value: Uint8Array; +} +/** + * AddressStringToBytesRequest is the request type for AccountBytes rpc method. + * + * Since: cosmos-sdk 0.46 + */ +export interface AddressStringToBytesRequestAmino { + address_string?: string; +} +export interface AddressStringToBytesRequestAminoMsg { + type: "cosmos-sdk/AddressStringToBytesRequest"; + value: AddressStringToBytesRequestAmino; +} +/** + * AddressStringToBytesRequest is the request type for AccountBytes rpc method. + * + * Since: cosmos-sdk 0.46 + */ +export interface AddressStringToBytesRequestSDKType { + address_string: string; +} +/** + * AddressStringToBytesResponse is the response type for AddressBytes rpc method. + * + * Since: cosmos-sdk 0.46 + */ +export interface AddressStringToBytesResponse { + addressBytes: Uint8Array; +} +export interface AddressStringToBytesResponseProtoMsg { + typeUrl: "/cosmos.auth.v1beta1.AddressStringToBytesResponse"; + value: Uint8Array; +} +/** + * AddressStringToBytesResponse is the response type for AddressBytes rpc method. + * + * Since: cosmos-sdk 0.46 + */ +export interface AddressStringToBytesResponseAmino { + address_bytes?: string; +} +export interface AddressStringToBytesResponseAminoMsg { + type: "cosmos-sdk/AddressStringToBytesResponse"; + value: AddressStringToBytesResponseAmino; +} +/** + * AddressStringToBytesResponse is the response type for AddressBytes rpc method. + * + * Since: cosmos-sdk 0.46 + */ +export interface AddressStringToBytesResponseSDKType { + address_bytes: Uint8Array; +} +/** + * QueryAccountAddressByIDRequest is the request type for AccountAddressByID rpc method + * + * Since: cosmos-sdk 0.46.2 + */ +export interface QueryAccountAddressByIDRequest { + /** + * Deprecated, use account_id instead + * + * id is the account number of the address to be queried. This field + * should have been an uint64 (like all account numbers), and will be + * updated to uint64 in a future version of the auth query. + */ + /** @deprecated */ + id: bigint; + /** + * account_id is the account number of the address to be queried. + * + * Since: cosmos-sdk 0.47 + */ + accountId: bigint; +} +export interface QueryAccountAddressByIDRequestProtoMsg { + typeUrl: "/cosmos.auth.v1beta1.QueryAccountAddressByIDRequest"; + value: Uint8Array; +} +/** + * QueryAccountAddressByIDRequest is the request type for AccountAddressByID rpc method + * + * Since: cosmos-sdk 0.46.2 + */ +export interface QueryAccountAddressByIDRequestAmino { + /** + * Deprecated, use account_id instead + * + * id is the account number of the address to be queried. This field + * should have been an uint64 (like all account numbers), and will be + * updated to uint64 in a future version of the auth query. + */ + /** @deprecated */ + id?: string; + /** + * account_id is the account number of the address to be queried. + * + * Since: cosmos-sdk 0.47 + */ + account_id?: string; +} +export interface QueryAccountAddressByIDRequestAminoMsg { + type: "cosmos-sdk/QueryAccountAddressByIDRequest"; + value: QueryAccountAddressByIDRequestAmino; +} +/** + * QueryAccountAddressByIDRequest is the request type for AccountAddressByID rpc method + * + * Since: cosmos-sdk 0.46.2 + */ +export interface QueryAccountAddressByIDRequestSDKType { + /** @deprecated */ + id: bigint; + account_id: bigint; +} +/** + * QueryAccountAddressByIDResponse is the response type for AccountAddressByID rpc method + * + * Since: cosmos-sdk 0.46.2 + */ +export interface QueryAccountAddressByIDResponse { + accountAddress: string; +} +export interface QueryAccountAddressByIDResponseProtoMsg { + typeUrl: "/cosmos.auth.v1beta1.QueryAccountAddressByIDResponse"; + value: Uint8Array; +} +/** + * QueryAccountAddressByIDResponse is the response type for AccountAddressByID rpc method + * + * Since: cosmos-sdk 0.46.2 + */ +export interface QueryAccountAddressByIDResponseAmino { + account_address?: string; +} +export interface QueryAccountAddressByIDResponseAminoMsg { + type: "cosmos-sdk/QueryAccountAddressByIDResponse"; + value: QueryAccountAddressByIDResponseAmino; +} +/** + * QueryAccountAddressByIDResponse is the response type for AccountAddressByID rpc method + * + * Since: cosmos-sdk 0.46.2 + */ +export interface QueryAccountAddressByIDResponseSDKType { + account_address: string; +} +/** + * QueryAccountInfoRequest is the Query/AccountInfo request type. + * + * Since: cosmos-sdk 0.47 + */ +export interface QueryAccountInfoRequest { + /** address is the account address string. */ + address: string; +} +export interface QueryAccountInfoRequestProtoMsg { + typeUrl: "/cosmos.auth.v1beta1.QueryAccountInfoRequest"; + value: Uint8Array; +} +/** + * QueryAccountInfoRequest is the Query/AccountInfo request type. + * + * Since: cosmos-sdk 0.47 + */ +export interface QueryAccountInfoRequestAmino { + /** address is the account address string. */ + address?: string; +} +export interface QueryAccountInfoRequestAminoMsg { + type: "cosmos-sdk/QueryAccountInfoRequest"; + value: QueryAccountInfoRequestAmino; +} +/** + * QueryAccountInfoRequest is the Query/AccountInfo request type. + * + * Since: cosmos-sdk 0.47 + */ +export interface QueryAccountInfoRequestSDKType { + address: string; +} +/** + * QueryAccountInfoResponse is the Query/AccountInfo response type. + * + * Since: cosmos-sdk 0.47 + */ +export interface QueryAccountInfoResponse { + /** info is the account info which is represented by BaseAccount. */ + info?: BaseAccount; +} +export interface QueryAccountInfoResponseProtoMsg { + typeUrl: "/cosmos.auth.v1beta1.QueryAccountInfoResponse"; + value: Uint8Array; +} +/** + * QueryAccountInfoResponse is the Query/AccountInfo response type. + * + * Since: cosmos-sdk 0.47 + */ +export interface QueryAccountInfoResponseAmino { + /** info is the account info which is represented by BaseAccount. */ + info?: BaseAccountAmino; +} +export interface QueryAccountInfoResponseAminoMsg { + type: "cosmos-sdk/QueryAccountInfoResponse"; + value: QueryAccountInfoResponseAmino; +} +/** + * QueryAccountInfoResponse is the Query/AccountInfo response type. + * + * Since: cosmos-sdk 0.47 + */ +export interface QueryAccountInfoResponseSDKType { + info?: BaseAccountSDKType; +} function createBaseQueryAccountsRequest(): QueryAccountsRequest { return { - pagination: PageRequest.fromPartial({}) + pagination: undefined }; } export const QueryAccountsRequest = { typeUrl: "/cosmos.auth.v1beta1.QueryAccountsRequest", + aminoType: "cosmos-sdk/QueryAccountsRequest", + is(o: any): o is QueryAccountsRequest { + return o && o.$typeUrl === QueryAccountsRequest.typeUrl; + }, + isSDK(o: any): o is QueryAccountsRequestSDKType { + return o && o.$typeUrl === QueryAccountsRequest.typeUrl; + }, + isAmino(o: any): o is QueryAccountsRequestAmino { + return o && o.$typeUrl === QueryAccountsRequest.typeUrl; + }, encode(message: QueryAccountsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.pagination !== undefined) { PageRequest.encode(message.pagination, writer.uint32(10).fork()).ldelim(); @@ -228,15 +655,27 @@ export const QueryAccountsRequest = { } return message; }, + fromJSON(object: any): QueryAccountsRequest { + return { + pagination: isSet(object.pagination) ? PageRequest.fromJSON(object.pagination) : undefined + }; + }, + toJSON(message: QueryAccountsRequest): unknown { + const obj: any = {}; + message.pagination !== undefined && (obj.pagination = message.pagination ? PageRequest.toJSON(message.pagination) : undefined); + return obj; + }, fromPartial(object: Partial): QueryAccountsRequest { const message = createBaseQueryAccountsRequest(); message.pagination = object.pagination !== undefined && object.pagination !== null ? PageRequest.fromPartial(object.pagination) : undefined; return message; }, fromAmino(object: QueryAccountsRequestAmino): QueryAccountsRequest { - return { - pagination: object?.pagination ? PageRequest.fromAmino(object.pagination) : undefined - }; + const message = createBaseQueryAccountsRequest(); + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromAmino(object.pagination); + } + return message; }, toAmino(message: QueryAccountsRequest): QueryAccountsRequestAmino { const obj: any = {}; @@ -265,17 +704,29 @@ export const QueryAccountsRequest = { }; } }; +GlobalDecoderRegistry.register(QueryAccountsRequest.typeUrl, QueryAccountsRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryAccountsRequest.aminoType, QueryAccountsRequest.typeUrl); function createBaseQueryAccountsResponse(): QueryAccountsResponse { return { accounts: [], - pagination: PageResponse.fromPartial({}) + pagination: undefined }; } export const QueryAccountsResponse = { typeUrl: "/cosmos.auth.v1beta1.QueryAccountsResponse", + aminoType: "cosmos-sdk/QueryAccountsResponse", + is(o: any): o is QueryAccountsResponse { + return o && (o.$typeUrl === QueryAccountsResponse.typeUrl || Array.isArray(o.accounts) && (!o.accounts.length || BaseAccount.is(o.accounts[0]) || Any.is(o.accounts[0]))); + }, + isSDK(o: any): o is QueryAccountsResponseSDKType { + return o && (o.$typeUrl === QueryAccountsResponse.typeUrl || Array.isArray(o.accounts) && (!o.accounts.length || BaseAccount.isSDK(o.accounts[0]) || Any.isSDK(o.accounts[0]))); + }, + isAmino(o: any): o is QueryAccountsResponseAmino { + return o && (o.$typeUrl === QueryAccountsResponse.typeUrl || Array.isArray(o.accounts) && (!o.accounts.length || BaseAccount.isAmino(o.accounts[0]) || Any.isAmino(o.accounts[0]))); + }, encode(message: QueryAccountsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.accounts) { - Any.encode((v! as Any), writer.uint32(10).fork()).ldelim(); + Any.encode(GlobalDecoderRegistry.wrapAny(v!), writer.uint32(10).fork()).ldelim(); } if (message.pagination !== undefined) { PageResponse.encode(message.pagination, writer.uint32(18).fork()).ldelim(); @@ -290,7 +741,7 @@ export const QueryAccountsResponse = { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.accounts.push((AccountI_InterfaceDecoder(reader) as Any)); + message.accounts.push(GlobalDecoderRegistry.unwrapAny(reader)); break; case 2: message.pagination = PageResponse.decode(reader, reader.uint32()); @@ -302,22 +753,40 @@ export const QueryAccountsResponse = { } return message; }, + fromJSON(object: any): QueryAccountsResponse { + return { + accounts: Array.isArray(object?.accounts) ? object.accounts.map((e: any) => GlobalDecoderRegistry.fromJSON(e)) : [], + pagination: isSet(object.pagination) ? PageResponse.fromJSON(object.pagination) : undefined + }; + }, + toJSON(message: QueryAccountsResponse): unknown { + const obj: any = {}; + if (message.accounts) { + obj.accounts = message.accounts.map(e => e ? GlobalDecoderRegistry.toJSON(e) : undefined); + } else { + obj.accounts = []; + } + message.pagination !== undefined && (obj.pagination = message.pagination ? PageResponse.toJSON(message.pagination) : undefined); + return obj; + }, fromPartial(object: Partial): QueryAccountsResponse { const message = createBaseQueryAccountsResponse(); - message.accounts = object.accounts?.map(e => Any.fromPartial(e)) || []; + message.accounts = object.accounts?.map(e => (Any.fromPartial(e) as any)) || []; message.pagination = object.pagination !== undefined && object.pagination !== null ? PageResponse.fromPartial(object.pagination) : undefined; return message; }, fromAmino(object: QueryAccountsResponseAmino): QueryAccountsResponse { - return { - accounts: Array.isArray(object?.accounts) ? object.accounts.map((e: any) => AccountI_FromAmino(e)) : [], - pagination: object?.pagination ? PageResponse.fromAmino(object.pagination) : undefined - }; + const message = createBaseQueryAccountsResponse(); + message.accounts = object.accounts?.map(e => GlobalDecoderRegistry.fromAminoMsg(e)) || []; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromAmino(object.pagination); + } + return message; }, toAmino(message: QueryAccountsResponse): QueryAccountsResponseAmino { const obj: any = {}; if (message.accounts) { - obj.accounts = message.accounts.map(e => e ? AccountI_ToAmino((e as Any)) : undefined); + obj.accounts = message.accounts.map(e => e ? GlobalDecoderRegistry.toAminoMsg(e) : undefined); } else { obj.accounts = []; } @@ -346,6 +815,8 @@ export const QueryAccountsResponse = { }; } }; +GlobalDecoderRegistry.register(QueryAccountsResponse.typeUrl, QueryAccountsResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryAccountsResponse.aminoType, QueryAccountsResponse.typeUrl); function createBaseQueryAccountRequest(): QueryAccountRequest { return { address: "" @@ -353,6 +824,16 @@ function createBaseQueryAccountRequest(): QueryAccountRequest { } export const QueryAccountRequest = { typeUrl: "/cosmos.auth.v1beta1.QueryAccountRequest", + aminoType: "cosmos-sdk/QueryAccountRequest", + is(o: any): o is QueryAccountRequest { + return o && (o.$typeUrl === QueryAccountRequest.typeUrl || typeof o.address === "string"); + }, + isSDK(o: any): o is QueryAccountRequestSDKType { + return o && (o.$typeUrl === QueryAccountRequest.typeUrl || typeof o.address === "string"); + }, + isAmino(o: any): o is QueryAccountRequestAmino { + return o && (o.$typeUrl === QueryAccountRequest.typeUrl || typeof o.address === "string"); + }, encode(message: QueryAccountRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.address !== "") { writer.uint32(10).string(message.address); @@ -376,15 +857,27 @@ export const QueryAccountRequest = { } return message; }, + fromJSON(object: any): QueryAccountRequest { + return { + address: isSet(object.address) ? String(object.address) : "" + }; + }, + toJSON(message: QueryAccountRequest): unknown { + const obj: any = {}; + message.address !== undefined && (obj.address = message.address); + return obj; + }, fromPartial(object: Partial): QueryAccountRequest { const message = createBaseQueryAccountRequest(); message.address = object.address ?? ""; return message; }, fromAmino(object: QueryAccountRequestAmino): QueryAccountRequest { - return { - address: object.address - }; + const message = createBaseQueryAccountRequest(); + if (object.address !== undefined && object.address !== null) { + message.address = object.address; + } + return message; }, toAmino(message: QueryAccountRequest): QueryAccountRequestAmino { const obj: any = {}; @@ -413,6 +906,8 @@ export const QueryAccountRequest = { }; } }; +GlobalDecoderRegistry.register(QueryAccountRequest.typeUrl, QueryAccountRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryAccountRequest.aminoType, QueryAccountRequest.typeUrl); function createBaseQueryAccountResponse(): QueryAccountResponse { return { account: undefined @@ -420,9 +915,19 @@ function createBaseQueryAccountResponse(): QueryAccountResponse { } export const QueryAccountResponse = { typeUrl: "/cosmos.auth.v1beta1.QueryAccountResponse", + aminoType: "cosmos-sdk/QueryAccountResponse", + is(o: any): o is QueryAccountResponse { + return o && o.$typeUrl === QueryAccountResponse.typeUrl; + }, + isSDK(o: any): o is QueryAccountResponseSDKType { + return o && o.$typeUrl === QueryAccountResponse.typeUrl; + }, + isAmino(o: any): o is QueryAccountResponseAmino { + return o && o.$typeUrl === QueryAccountResponse.typeUrl; + }, encode(message: QueryAccountResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.account !== undefined) { - Any.encode((message.account as Any), writer.uint32(10).fork()).ldelim(); + Any.encode(GlobalDecoderRegistry.wrapAny(message.account), writer.uint32(10).fork()).ldelim(); } return writer; }, @@ -434,7 +939,7 @@ export const QueryAccountResponse = { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.account = (AccountI_InterfaceDecoder(reader) as Any); + message.account = GlobalDecoderRegistry.unwrapAny(reader); break; default: reader.skipType(tag & 7); @@ -443,19 +948,31 @@ export const QueryAccountResponse = { } return message; }, + fromJSON(object: any): QueryAccountResponse { + return { + account: isSet(object.account) ? GlobalDecoderRegistry.fromJSON(object.account) : undefined + }; + }, + toJSON(message: QueryAccountResponse): unknown { + const obj: any = {}; + message.account !== undefined && (obj.account = message.account ? GlobalDecoderRegistry.toJSON(message.account) : undefined); + return obj; + }, fromPartial(object: Partial): QueryAccountResponse { const message = createBaseQueryAccountResponse(); - message.account = object.account !== undefined && object.account !== null ? Any.fromPartial(object.account) : undefined; + message.account = object.account !== undefined && object.account !== null ? GlobalDecoderRegistry.fromPartial(object.account) : undefined; return message; }, fromAmino(object: QueryAccountResponseAmino): QueryAccountResponse { - return { - account: object?.account ? AccountI_FromAmino(object.account) : undefined - }; + const message = createBaseQueryAccountResponse(); + if (object.account !== undefined && object.account !== null) { + message.account = GlobalDecoderRegistry.fromAminoMsg(object.account); + } + return message; }, toAmino(message: QueryAccountResponse): QueryAccountResponseAmino { const obj: any = {}; - obj.account = message.account ? AccountI_ToAmino((message.account as Any)) : undefined; + obj.account = message.account ? GlobalDecoderRegistry.toAminoMsg(message.account) : undefined; return obj; }, fromAminoMsg(object: QueryAccountResponseAminoMsg): QueryAccountResponse { @@ -480,11 +997,23 @@ export const QueryAccountResponse = { }; } }; +GlobalDecoderRegistry.register(QueryAccountResponse.typeUrl, QueryAccountResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryAccountResponse.aminoType, QueryAccountResponse.typeUrl); function createBaseQueryParamsRequest(): QueryParamsRequest { return {}; } export const QueryParamsRequest = { typeUrl: "/cosmos.auth.v1beta1.QueryParamsRequest", + aminoType: "cosmos-sdk/QueryParamsRequest", + is(o: any): o is QueryParamsRequest { + return o && o.$typeUrl === QueryParamsRequest.typeUrl; + }, + isSDK(o: any): o is QueryParamsRequestSDKType { + return o && o.$typeUrl === QueryParamsRequest.typeUrl; + }, + isAmino(o: any): o is QueryParamsRequestAmino { + return o && o.$typeUrl === QueryParamsRequest.typeUrl; + }, encode(_: QueryParamsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, @@ -502,12 +1031,20 @@ export const QueryParamsRequest = { } return message; }, + fromJSON(_: any): QueryParamsRequest { + return {}; + }, + toJSON(_: QueryParamsRequest): unknown { + const obj: any = {}; + return obj; + }, fromPartial(_: Partial): QueryParamsRequest { const message = createBaseQueryParamsRequest(); return message; }, fromAmino(_: QueryParamsRequestAmino): QueryParamsRequest { - return {}; + const message = createBaseQueryParamsRequest(); + return message; }, toAmino(_: QueryParamsRequest): QueryParamsRequestAmino { const obj: any = {}; @@ -535,6 +1072,8 @@ export const QueryParamsRequest = { }; } }; +GlobalDecoderRegistry.register(QueryParamsRequest.typeUrl, QueryParamsRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryParamsRequest.aminoType, QueryParamsRequest.typeUrl); function createBaseQueryParamsResponse(): QueryParamsResponse { return { params: Params.fromPartial({}) @@ -542,6 +1081,16 @@ function createBaseQueryParamsResponse(): QueryParamsResponse { } export const QueryParamsResponse = { typeUrl: "/cosmos.auth.v1beta1.QueryParamsResponse", + aminoType: "cosmos-sdk/QueryParamsResponse", + is(o: any): o is QueryParamsResponse { + return o && (o.$typeUrl === QueryParamsResponse.typeUrl || Params.is(o.params)); + }, + isSDK(o: any): o is QueryParamsResponseSDKType { + return o && (o.$typeUrl === QueryParamsResponse.typeUrl || Params.isSDK(o.params)); + }, + isAmino(o: any): o is QueryParamsResponseAmino { + return o && (o.$typeUrl === QueryParamsResponse.typeUrl || Params.isAmino(o.params)); + }, encode(message: QueryParamsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.params !== undefined) { Params.encode(message.params, writer.uint32(10).fork()).ldelim(); @@ -565,15 +1114,27 @@ export const QueryParamsResponse = { } return message; }, + fromJSON(object: any): QueryParamsResponse { + 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; + }, fromPartial(object: Partial): QueryParamsResponse { const message = createBaseQueryParamsResponse(); message.params = object.params !== undefined && object.params !== null ? Params.fromPartial(object.params) : undefined; return message; }, fromAmino(object: QueryParamsResponseAmino): QueryParamsResponse { - return { - params: object?.params ? Params.fromAmino(object.params) : undefined - }; + const message = createBaseQueryParamsResponse(); + if (object.params !== undefined && object.params !== null) { + message.params = Params.fromAmino(object.params); + } + return message; }, toAmino(message: QueryParamsResponse): QueryParamsResponseAmino { const obj: any = {}; @@ -602,11 +1163,23 @@ export const QueryParamsResponse = { }; } }; +GlobalDecoderRegistry.register(QueryParamsResponse.typeUrl, QueryParamsResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryParamsResponse.aminoType, QueryParamsResponse.typeUrl); function createBaseQueryModuleAccountsRequest(): QueryModuleAccountsRequest { return {}; } export const QueryModuleAccountsRequest = { typeUrl: "/cosmos.auth.v1beta1.QueryModuleAccountsRequest", + aminoType: "cosmos-sdk/QueryModuleAccountsRequest", + is(o: any): o is QueryModuleAccountsRequest { + return o && o.$typeUrl === QueryModuleAccountsRequest.typeUrl; + }, + isSDK(o: any): o is QueryModuleAccountsRequestSDKType { + return o && o.$typeUrl === QueryModuleAccountsRequest.typeUrl; + }, + isAmino(o: any): o is QueryModuleAccountsRequestAmino { + return o && o.$typeUrl === QueryModuleAccountsRequest.typeUrl; + }, encode(_: QueryModuleAccountsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, @@ -624,12 +1197,20 @@ export const QueryModuleAccountsRequest = { } return message; }, + fromJSON(_: any): QueryModuleAccountsRequest { + return {}; + }, + toJSON(_: QueryModuleAccountsRequest): unknown { + const obj: any = {}; + return obj; + }, fromPartial(_: Partial): QueryModuleAccountsRequest { const message = createBaseQueryModuleAccountsRequest(); return message; }, fromAmino(_: QueryModuleAccountsRequestAmino): QueryModuleAccountsRequest { - return {}; + const message = createBaseQueryModuleAccountsRequest(); + return message; }, toAmino(_: QueryModuleAccountsRequest): QueryModuleAccountsRequestAmino { const obj: any = {}; @@ -657,6 +1238,8 @@ export const QueryModuleAccountsRequest = { }; } }; +GlobalDecoderRegistry.register(QueryModuleAccountsRequest.typeUrl, QueryModuleAccountsRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryModuleAccountsRequest.aminoType, QueryModuleAccountsRequest.typeUrl); function createBaseQueryModuleAccountsResponse(): QueryModuleAccountsResponse { return { accounts: [] @@ -664,9 +1247,19 @@ function createBaseQueryModuleAccountsResponse(): QueryModuleAccountsResponse { } export const QueryModuleAccountsResponse = { typeUrl: "/cosmos.auth.v1beta1.QueryModuleAccountsResponse", + aminoType: "cosmos-sdk/QueryModuleAccountsResponse", + is(o: any): o is QueryModuleAccountsResponse { + return o && (o.$typeUrl === QueryModuleAccountsResponse.typeUrl || Array.isArray(o.accounts) && (!o.accounts.length || ModuleAccount.is(o.accounts[0]) || Any.is(o.accounts[0]))); + }, + isSDK(o: any): o is QueryModuleAccountsResponseSDKType { + return o && (o.$typeUrl === QueryModuleAccountsResponse.typeUrl || Array.isArray(o.accounts) && (!o.accounts.length || ModuleAccount.isSDK(o.accounts[0]) || Any.isSDK(o.accounts[0]))); + }, + isAmino(o: any): o is QueryModuleAccountsResponseAmino { + return o && (o.$typeUrl === QueryModuleAccountsResponse.typeUrl || Array.isArray(o.accounts) && (!o.accounts.length || ModuleAccount.isAmino(o.accounts[0]) || Any.isAmino(o.accounts[0]))); + }, encode(message: QueryModuleAccountsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.accounts) { - Any.encode((v! as Any), writer.uint32(10).fork()).ldelim(); + Any.encode(GlobalDecoderRegistry.wrapAny(v!), writer.uint32(10).fork()).ldelim(); } return writer; }, @@ -678,7 +1271,7 @@ export const QueryModuleAccountsResponse = { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.accounts.push((ModuleAccountI_InterfaceDecoder(reader) as Any)); + message.accounts.push(GlobalDecoderRegistry.unwrapAny(reader)); break; default: reader.skipType(tag & 7); @@ -687,20 +1280,34 @@ export const QueryModuleAccountsResponse = { } return message; }, + fromJSON(object: any): QueryModuleAccountsResponse { + return { + accounts: Array.isArray(object?.accounts) ? object.accounts.map((e: any) => GlobalDecoderRegistry.fromJSON(e)) : [] + }; + }, + toJSON(message: QueryModuleAccountsResponse): unknown { + const obj: any = {}; + if (message.accounts) { + obj.accounts = message.accounts.map(e => e ? GlobalDecoderRegistry.toJSON(e) : undefined); + } else { + obj.accounts = []; + } + return obj; + }, fromPartial(object: Partial): QueryModuleAccountsResponse { const message = createBaseQueryModuleAccountsResponse(); - message.accounts = object.accounts?.map(e => Any.fromPartial(e)) || []; + message.accounts = object.accounts?.map(e => (Any.fromPartial(e) as any)) || []; return message; }, fromAmino(object: QueryModuleAccountsResponseAmino): QueryModuleAccountsResponse { - return { - accounts: Array.isArray(object?.accounts) ? object.accounts.map((e: any) => ModuleAccountI_FromAmino(e)) : [] - }; + const message = createBaseQueryModuleAccountsResponse(); + message.accounts = object.accounts?.map(e => GlobalDecoderRegistry.fromAminoMsg(e)) || []; + return message; }, toAmino(message: QueryModuleAccountsResponse): QueryModuleAccountsResponseAmino { const obj: any = {}; if (message.accounts) { - obj.accounts = message.accounts.map(e => e ? ModuleAccountI_ToAmino((e as Any)) : undefined); + obj.accounts = message.accounts.map(e => e ? GlobalDecoderRegistry.toAminoMsg(e) : undefined); } else { obj.accounts = []; } @@ -728,67 +1335,1095 @@ export const QueryModuleAccountsResponse = { }; } }; -export const AccountI_InterfaceDecoder = (input: BinaryReader | Uint8Array): BaseAccount | Any => { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - const data = Any.decode(reader, reader.uint32()); - switch (data.typeUrl) { - case "/cosmos.auth.v1beta1.BaseAccount": - return BaseAccount.decode(data.value); - default: - return data; - } -}; -export const AccountI_FromAmino = (content: AnyAmino) => { - switch (content.type) { - case "cosmos-sdk/BaseAccount": - return Any.fromPartial({ - typeUrl: "/cosmos.auth.v1beta1.BaseAccount", - value: BaseAccount.encode(BaseAccount.fromPartial(BaseAccount.fromAmino(content.value))).finish() - }); - default: - return Any.fromAmino(content); +GlobalDecoderRegistry.register(QueryModuleAccountsResponse.typeUrl, QueryModuleAccountsResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryModuleAccountsResponse.aminoType, QueryModuleAccountsResponse.typeUrl); +function createBaseQueryModuleAccountByNameRequest(): QueryModuleAccountByNameRequest { + return { + name: "" + }; +} +export const QueryModuleAccountByNameRequest = { + typeUrl: "/cosmos.auth.v1beta1.QueryModuleAccountByNameRequest", + aminoType: "cosmos-sdk/QueryModuleAccountByNameRequest", + is(o: any): o is QueryModuleAccountByNameRequest { + return o && (o.$typeUrl === QueryModuleAccountByNameRequest.typeUrl || typeof o.name === "string"); + }, + isSDK(o: any): o is QueryModuleAccountByNameRequestSDKType { + return o && (o.$typeUrl === QueryModuleAccountByNameRequest.typeUrl || typeof o.name === "string"); + }, + isAmino(o: any): o is QueryModuleAccountByNameRequestAmino { + return o && (o.$typeUrl === QueryModuleAccountByNameRequest.typeUrl || typeof o.name === "string"); + }, + encode(message: QueryModuleAccountByNameRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.name !== "") { + writer.uint32(10).string(message.name); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryModuleAccountByNameRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryModuleAccountByNameRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): QueryModuleAccountByNameRequest { + return { + name: isSet(object.name) ? String(object.name) : "" + }; + }, + toJSON(message: QueryModuleAccountByNameRequest): unknown { + const obj: any = {}; + message.name !== undefined && (obj.name = message.name); + return obj; + }, + fromPartial(object: Partial): QueryModuleAccountByNameRequest { + const message = createBaseQueryModuleAccountByNameRequest(); + message.name = object.name ?? ""; + return message; + }, + fromAmino(object: QueryModuleAccountByNameRequestAmino): QueryModuleAccountByNameRequest { + const message = createBaseQueryModuleAccountByNameRequest(); + if (object.name !== undefined && object.name !== null) { + message.name = object.name; + } + return message; + }, + toAmino(message: QueryModuleAccountByNameRequest): QueryModuleAccountByNameRequestAmino { + const obj: any = {}; + obj.name = message.name; + return obj; + }, + fromAminoMsg(object: QueryModuleAccountByNameRequestAminoMsg): QueryModuleAccountByNameRequest { + return QueryModuleAccountByNameRequest.fromAmino(object.value); + }, + toAminoMsg(message: QueryModuleAccountByNameRequest): QueryModuleAccountByNameRequestAminoMsg { + return { + type: "cosmos-sdk/QueryModuleAccountByNameRequest", + value: QueryModuleAccountByNameRequest.toAmino(message) + }; + }, + fromProtoMsg(message: QueryModuleAccountByNameRequestProtoMsg): QueryModuleAccountByNameRequest { + return QueryModuleAccountByNameRequest.decode(message.value); + }, + toProto(message: QueryModuleAccountByNameRequest): Uint8Array { + return QueryModuleAccountByNameRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryModuleAccountByNameRequest): QueryModuleAccountByNameRequestProtoMsg { + return { + typeUrl: "/cosmos.auth.v1beta1.QueryModuleAccountByNameRequest", + value: QueryModuleAccountByNameRequest.encode(message).finish() + }; } }; -export const AccountI_ToAmino = (content: Any) => { - switch (content.typeUrl) { - case "/cosmos.auth.v1beta1.BaseAccount": - return { - type: "cosmos-sdk/BaseAccount", - value: BaseAccount.toAmino(BaseAccount.decode(content.value)) - }; - default: - return Any.toAmino(content); +GlobalDecoderRegistry.register(QueryModuleAccountByNameRequest.typeUrl, QueryModuleAccountByNameRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryModuleAccountByNameRequest.aminoType, QueryModuleAccountByNameRequest.typeUrl); +function createBaseQueryModuleAccountByNameResponse(): QueryModuleAccountByNameResponse { + return { + account: undefined + }; +} +export const QueryModuleAccountByNameResponse = { + typeUrl: "/cosmos.auth.v1beta1.QueryModuleAccountByNameResponse", + aminoType: "cosmos-sdk/QueryModuleAccountByNameResponse", + is(o: any): o is QueryModuleAccountByNameResponse { + return o && o.$typeUrl === QueryModuleAccountByNameResponse.typeUrl; + }, + isSDK(o: any): o is QueryModuleAccountByNameResponseSDKType { + return o && o.$typeUrl === QueryModuleAccountByNameResponse.typeUrl; + }, + isAmino(o: any): o is QueryModuleAccountByNameResponseAmino { + return o && o.$typeUrl === QueryModuleAccountByNameResponse.typeUrl; + }, + encode(message: QueryModuleAccountByNameResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.account !== undefined) { + Any.encode(GlobalDecoderRegistry.wrapAny(message.account), writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryModuleAccountByNameResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryModuleAccountByNameResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.account = GlobalDecoderRegistry.unwrapAny(reader); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): QueryModuleAccountByNameResponse { + return { + account: isSet(object.account) ? GlobalDecoderRegistry.fromJSON(object.account) : undefined + }; + }, + toJSON(message: QueryModuleAccountByNameResponse): unknown { + const obj: any = {}; + message.account !== undefined && (obj.account = message.account ? GlobalDecoderRegistry.toJSON(message.account) : undefined); + return obj; + }, + fromPartial(object: Partial): QueryModuleAccountByNameResponse { + const message = createBaseQueryModuleAccountByNameResponse(); + message.account = object.account !== undefined && object.account !== null ? GlobalDecoderRegistry.fromPartial(object.account) : undefined; + return message; + }, + fromAmino(object: QueryModuleAccountByNameResponseAmino): QueryModuleAccountByNameResponse { + const message = createBaseQueryModuleAccountByNameResponse(); + if (object.account !== undefined && object.account !== null) { + message.account = GlobalDecoderRegistry.fromAminoMsg(object.account); + } + return message; + }, + toAmino(message: QueryModuleAccountByNameResponse): QueryModuleAccountByNameResponseAmino { + const obj: any = {}; + obj.account = message.account ? GlobalDecoderRegistry.toAminoMsg(message.account) : undefined; + return obj; + }, + fromAminoMsg(object: QueryModuleAccountByNameResponseAminoMsg): QueryModuleAccountByNameResponse { + return QueryModuleAccountByNameResponse.fromAmino(object.value); + }, + toAminoMsg(message: QueryModuleAccountByNameResponse): QueryModuleAccountByNameResponseAminoMsg { + return { + type: "cosmos-sdk/QueryModuleAccountByNameResponse", + value: QueryModuleAccountByNameResponse.toAmino(message) + }; + }, + fromProtoMsg(message: QueryModuleAccountByNameResponseProtoMsg): QueryModuleAccountByNameResponse { + return QueryModuleAccountByNameResponse.decode(message.value); + }, + toProto(message: QueryModuleAccountByNameResponse): Uint8Array { + return QueryModuleAccountByNameResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryModuleAccountByNameResponse): QueryModuleAccountByNameResponseProtoMsg { + return { + typeUrl: "/cosmos.auth.v1beta1.QueryModuleAccountByNameResponse", + value: QueryModuleAccountByNameResponse.encode(message).finish() + }; } }; -export const ModuleAccountI_InterfaceDecoder = (input: BinaryReader | Uint8Array): ModuleAccount | Any => { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - const data = Any.decode(reader, reader.uint32()); - switch (data.typeUrl) { - case "/cosmos.auth.v1beta1.ModuleAccount": - return ModuleAccount.decode(data.value); - default: - return data; +GlobalDecoderRegistry.register(QueryModuleAccountByNameResponse.typeUrl, QueryModuleAccountByNameResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryModuleAccountByNameResponse.aminoType, QueryModuleAccountByNameResponse.typeUrl); +function createBaseBech32PrefixRequest(): Bech32PrefixRequest { + return {}; +} +export const Bech32PrefixRequest = { + typeUrl: "/cosmos.auth.v1beta1.Bech32PrefixRequest", + aminoType: "cosmos-sdk/Bech32PrefixRequest", + is(o: any): o is Bech32PrefixRequest { + return o && o.$typeUrl === Bech32PrefixRequest.typeUrl; + }, + isSDK(o: any): o is Bech32PrefixRequestSDKType { + return o && o.$typeUrl === Bech32PrefixRequest.typeUrl; + }, + isAmino(o: any): o is Bech32PrefixRequestAmino { + return o && o.$typeUrl === Bech32PrefixRequest.typeUrl; + }, + encode(_: Bech32PrefixRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): Bech32PrefixRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseBech32PrefixRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(_: any): Bech32PrefixRequest { + return {}; + }, + toJSON(_: Bech32PrefixRequest): unknown { + const obj: any = {}; + return obj; + }, + fromPartial(_: Partial): Bech32PrefixRequest { + const message = createBaseBech32PrefixRequest(); + return message; + }, + fromAmino(_: Bech32PrefixRequestAmino): Bech32PrefixRequest { + const message = createBaseBech32PrefixRequest(); + return message; + }, + toAmino(_: Bech32PrefixRequest): Bech32PrefixRequestAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: Bech32PrefixRequestAminoMsg): Bech32PrefixRequest { + return Bech32PrefixRequest.fromAmino(object.value); + }, + toAminoMsg(message: Bech32PrefixRequest): Bech32PrefixRequestAminoMsg { + return { + type: "cosmos-sdk/Bech32PrefixRequest", + value: Bech32PrefixRequest.toAmino(message) + }; + }, + fromProtoMsg(message: Bech32PrefixRequestProtoMsg): Bech32PrefixRequest { + return Bech32PrefixRequest.decode(message.value); + }, + toProto(message: Bech32PrefixRequest): Uint8Array { + return Bech32PrefixRequest.encode(message).finish(); + }, + toProtoMsg(message: Bech32PrefixRequest): Bech32PrefixRequestProtoMsg { + return { + typeUrl: "/cosmos.auth.v1beta1.Bech32PrefixRequest", + value: Bech32PrefixRequest.encode(message).finish() + }; } }; -export const ModuleAccountI_FromAmino = (content: AnyAmino) => { - switch (content.type) { - case "cosmos-sdk/ModuleAccount": - return Any.fromPartial({ - typeUrl: "/cosmos.auth.v1beta1.ModuleAccount", - value: ModuleAccount.encode(ModuleAccount.fromPartial(ModuleAccount.fromAmino(content.value))).finish() - }); - default: - return Any.fromAmino(content); +GlobalDecoderRegistry.register(Bech32PrefixRequest.typeUrl, Bech32PrefixRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(Bech32PrefixRequest.aminoType, Bech32PrefixRequest.typeUrl); +function createBaseBech32PrefixResponse(): Bech32PrefixResponse { + return { + bech32Prefix: "" + }; +} +export const Bech32PrefixResponse = { + typeUrl: "/cosmos.auth.v1beta1.Bech32PrefixResponse", + aminoType: "cosmos-sdk/Bech32PrefixResponse", + is(o: any): o is Bech32PrefixResponse { + return o && (o.$typeUrl === Bech32PrefixResponse.typeUrl || typeof o.bech32Prefix === "string"); + }, + isSDK(o: any): o is Bech32PrefixResponseSDKType { + return o && (o.$typeUrl === Bech32PrefixResponse.typeUrl || typeof o.bech32_prefix === "string"); + }, + isAmino(o: any): o is Bech32PrefixResponseAmino { + return o && (o.$typeUrl === Bech32PrefixResponse.typeUrl || typeof o.bech32_prefix === "string"); + }, + encode(message: Bech32PrefixResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.bech32Prefix !== "") { + writer.uint32(10).string(message.bech32Prefix); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): Bech32PrefixResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseBech32PrefixResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.bech32Prefix = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): Bech32PrefixResponse { + return { + bech32Prefix: isSet(object.bech32Prefix) ? String(object.bech32Prefix) : "" + }; + }, + toJSON(message: Bech32PrefixResponse): unknown { + const obj: any = {}; + message.bech32Prefix !== undefined && (obj.bech32Prefix = message.bech32Prefix); + return obj; + }, + fromPartial(object: Partial): Bech32PrefixResponse { + const message = createBaseBech32PrefixResponse(); + message.bech32Prefix = object.bech32Prefix ?? ""; + return message; + }, + fromAmino(object: Bech32PrefixResponseAmino): Bech32PrefixResponse { + const message = createBaseBech32PrefixResponse(); + if (object.bech32_prefix !== undefined && object.bech32_prefix !== null) { + message.bech32Prefix = object.bech32_prefix; + } + return message; + }, + toAmino(message: Bech32PrefixResponse): Bech32PrefixResponseAmino { + const obj: any = {}; + obj.bech32_prefix = message.bech32Prefix; + return obj; + }, + fromAminoMsg(object: Bech32PrefixResponseAminoMsg): Bech32PrefixResponse { + return Bech32PrefixResponse.fromAmino(object.value); + }, + toAminoMsg(message: Bech32PrefixResponse): Bech32PrefixResponseAminoMsg { + return { + type: "cosmos-sdk/Bech32PrefixResponse", + value: Bech32PrefixResponse.toAmino(message) + }; + }, + fromProtoMsg(message: Bech32PrefixResponseProtoMsg): Bech32PrefixResponse { + return Bech32PrefixResponse.decode(message.value); + }, + toProto(message: Bech32PrefixResponse): Uint8Array { + return Bech32PrefixResponse.encode(message).finish(); + }, + toProtoMsg(message: Bech32PrefixResponse): Bech32PrefixResponseProtoMsg { + return { + typeUrl: "/cosmos.auth.v1beta1.Bech32PrefixResponse", + value: Bech32PrefixResponse.encode(message).finish() + }; } }; -export const ModuleAccountI_ToAmino = (content: Any) => { - switch (content.typeUrl) { - case "/cosmos.auth.v1beta1.ModuleAccount": - return { - type: "cosmos-sdk/ModuleAccount", - value: ModuleAccount.toAmino(ModuleAccount.decode(content.value)) - }; - default: - return Any.toAmino(content); - } -}; \ No newline at end of file +GlobalDecoderRegistry.register(Bech32PrefixResponse.typeUrl, Bech32PrefixResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(Bech32PrefixResponse.aminoType, Bech32PrefixResponse.typeUrl); +function createBaseAddressBytesToStringRequest(): AddressBytesToStringRequest { + return { + addressBytes: new Uint8Array() + }; +} +export const AddressBytesToStringRequest = { + typeUrl: "/cosmos.auth.v1beta1.AddressBytesToStringRequest", + aminoType: "cosmos-sdk/AddressBytesToStringRequest", + is(o: any): o is AddressBytesToStringRequest { + return o && (o.$typeUrl === AddressBytesToStringRequest.typeUrl || o.addressBytes instanceof Uint8Array || typeof o.addressBytes === "string"); + }, + isSDK(o: any): o is AddressBytesToStringRequestSDKType { + return o && (o.$typeUrl === AddressBytesToStringRequest.typeUrl || o.address_bytes instanceof Uint8Array || typeof o.address_bytes === "string"); + }, + isAmino(o: any): o is AddressBytesToStringRequestAmino { + return o && (o.$typeUrl === AddressBytesToStringRequest.typeUrl || o.address_bytes instanceof Uint8Array || typeof o.address_bytes === "string"); + }, + encode(message: AddressBytesToStringRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.addressBytes.length !== 0) { + writer.uint32(10).bytes(message.addressBytes); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): AddressBytesToStringRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseAddressBytesToStringRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.addressBytes = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): AddressBytesToStringRequest { + return { + addressBytes: isSet(object.addressBytes) ? bytesFromBase64(object.addressBytes) : new Uint8Array() + }; + }, + toJSON(message: AddressBytesToStringRequest): unknown { + const obj: any = {}; + message.addressBytes !== undefined && (obj.addressBytes = base64FromBytes(message.addressBytes !== undefined ? message.addressBytes : new Uint8Array())); + return obj; + }, + fromPartial(object: Partial): AddressBytesToStringRequest { + const message = createBaseAddressBytesToStringRequest(); + message.addressBytes = object.addressBytes ?? new Uint8Array(); + return message; + }, + fromAmino(object: AddressBytesToStringRequestAmino): AddressBytesToStringRequest { + const message = createBaseAddressBytesToStringRequest(); + if (object.address_bytes !== undefined && object.address_bytes !== null) { + message.addressBytes = bytesFromBase64(object.address_bytes); + } + return message; + }, + toAmino(message: AddressBytesToStringRequest): AddressBytesToStringRequestAmino { + const obj: any = {}; + obj.address_bytes = message.addressBytes ? base64FromBytes(message.addressBytes) : undefined; + return obj; + }, + fromAminoMsg(object: AddressBytesToStringRequestAminoMsg): AddressBytesToStringRequest { + return AddressBytesToStringRequest.fromAmino(object.value); + }, + toAminoMsg(message: AddressBytesToStringRequest): AddressBytesToStringRequestAminoMsg { + return { + type: "cosmos-sdk/AddressBytesToStringRequest", + value: AddressBytesToStringRequest.toAmino(message) + }; + }, + fromProtoMsg(message: AddressBytesToStringRequestProtoMsg): AddressBytesToStringRequest { + return AddressBytesToStringRequest.decode(message.value); + }, + toProto(message: AddressBytesToStringRequest): Uint8Array { + return AddressBytesToStringRequest.encode(message).finish(); + }, + toProtoMsg(message: AddressBytesToStringRequest): AddressBytesToStringRequestProtoMsg { + return { + typeUrl: "/cosmos.auth.v1beta1.AddressBytesToStringRequest", + value: AddressBytesToStringRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(AddressBytesToStringRequest.typeUrl, AddressBytesToStringRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(AddressBytesToStringRequest.aminoType, AddressBytesToStringRequest.typeUrl); +function createBaseAddressBytesToStringResponse(): AddressBytesToStringResponse { + return { + addressString: "" + }; +} +export const AddressBytesToStringResponse = { + typeUrl: "/cosmos.auth.v1beta1.AddressBytesToStringResponse", + aminoType: "cosmos-sdk/AddressBytesToStringResponse", + is(o: any): o is AddressBytesToStringResponse { + return o && (o.$typeUrl === AddressBytesToStringResponse.typeUrl || typeof o.addressString === "string"); + }, + isSDK(o: any): o is AddressBytesToStringResponseSDKType { + return o && (o.$typeUrl === AddressBytesToStringResponse.typeUrl || typeof o.address_string === "string"); + }, + isAmino(o: any): o is AddressBytesToStringResponseAmino { + return o && (o.$typeUrl === AddressBytesToStringResponse.typeUrl || typeof o.address_string === "string"); + }, + encode(message: AddressBytesToStringResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.addressString !== "") { + writer.uint32(10).string(message.addressString); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): AddressBytesToStringResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseAddressBytesToStringResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.addressString = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): AddressBytesToStringResponse { + return { + addressString: isSet(object.addressString) ? String(object.addressString) : "" + }; + }, + toJSON(message: AddressBytesToStringResponse): unknown { + const obj: any = {}; + message.addressString !== undefined && (obj.addressString = message.addressString); + return obj; + }, + fromPartial(object: Partial): AddressBytesToStringResponse { + const message = createBaseAddressBytesToStringResponse(); + message.addressString = object.addressString ?? ""; + return message; + }, + fromAmino(object: AddressBytesToStringResponseAmino): AddressBytesToStringResponse { + const message = createBaseAddressBytesToStringResponse(); + if (object.address_string !== undefined && object.address_string !== null) { + message.addressString = object.address_string; + } + return message; + }, + toAmino(message: AddressBytesToStringResponse): AddressBytesToStringResponseAmino { + const obj: any = {}; + obj.address_string = message.addressString; + return obj; + }, + fromAminoMsg(object: AddressBytesToStringResponseAminoMsg): AddressBytesToStringResponse { + return AddressBytesToStringResponse.fromAmino(object.value); + }, + toAminoMsg(message: AddressBytesToStringResponse): AddressBytesToStringResponseAminoMsg { + return { + type: "cosmos-sdk/AddressBytesToStringResponse", + value: AddressBytesToStringResponse.toAmino(message) + }; + }, + fromProtoMsg(message: AddressBytesToStringResponseProtoMsg): AddressBytesToStringResponse { + return AddressBytesToStringResponse.decode(message.value); + }, + toProto(message: AddressBytesToStringResponse): Uint8Array { + return AddressBytesToStringResponse.encode(message).finish(); + }, + toProtoMsg(message: AddressBytesToStringResponse): AddressBytesToStringResponseProtoMsg { + return { + typeUrl: "/cosmos.auth.v1beta1.AddressBytesToStringResponse", + value: AddressBytesToStringResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(AddressBytesToStringResponse.typeUrl, AddressBytesToStringResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(AddressBytesToStringResponse.aminoType, AddressBytesToStringResponse.typeUrl); +function createBaseAddressStringToBytesRequest(): AddressStringToBytesRequest { + return { + addressString: "" + }; +} +export const AddressStringToBytesRequest = { + typeUrl: "/cosmos.auth.v1beta1.AddressStringToBytesRequest", + aminoType: "cosmos-sdk/AddressStringToBytesRequest", + is(o: any): o is AddressStringToBytesRequest { + return o && (o.$typeUrl === AddressStringToBytesRequest.typeUrl || typeof o.addressString === "string"); + }, + isSDK(o: any): o is AddressStringToBytesRequestSDKType { + return o && (o.$typeUrl === AddressStringToBytesRequest.typeUrl || typeof o.address_string === "string"); + }, + isAmino(o: any): o is AddressStringToBytesRequestAmino { + return o && (o.$typeUrl === AddressStringToBytesRequest.typeUrl || typeof o.address_string === "string"); + }, + encode(message: AddressStringToBytesRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.addressString !== "") { + writer.uint32(10).string(message.addressString); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): AddressStringToBytesRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseAddressStringToBytesRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.addressString = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): AddressStringToBytesRequest { + return { + addressString: isSet(object.addressString) ? String(object.addressString) : "" + }; + }, + toJSON(message: AddressStringToBytesRequest): unknown { + const obj: any = {}; + message.addressString !== undefined && (obj.addressString = message.addressString); + return obj; + }, + fromPartial(object: Partial): AddressStringToBytesRequest { + const message = createBaseAddressStringToBytesRequest(); + message.addressString = object.addressString ?? ""; + return message; + }, + fromAmino(object: AddressStringToBytesRequestAmino): AddressStringToBytesRequest { + const message = createBaseAddressStringToBytesRequest(); + if (object.address_string !== undefined && object.address_string !== null) { + message.addressString = object.address_string; + } + return message; + }, + toAmino(message: AddressStringToBytesRequest): AddressStringToBytesRequestAmino { + const obj: any = {}; + obj.address_string = message.addressString; + return obj; + }, + fromAminoMsg(object: AddressStringToBytesRequestAminoMsg): AddressStringToBytesRequest { + return AddressStringToBytesRequest.fromAmino(object.value); + }, + toAminoMsg(message: AddressStringToBytesRequest): AddressStringToBytesRequestAminoMsg { + return { + type: "cosmos-sdk/AddressStringToBytesRequest", + value: AddressStringToBytesRequest.toAmino(message) + }; + }, + fromProtoMsg(message: AddressStringToBytesRequestProtoMsg): AddressStringToBytesRequest { + return AddressStringToBytesRequest.decode(message.value); + }, + toProto(message: AddressStringToBytesRequest): Uint8Array { + return AddressStringToBytesRequest.encode(message).finish(); + }, + toProtoMsg(message: AddressStringToBytesRequest): AddressStringToBytesRequestProtoMsg { + return { + typeUrl: "/cosmos.auth.v1beta1.AddressStringToBytesRequest", + value: AddressStringToBytesRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(AddressStringToBytesRequest.typeUrl, AddressStringToBytesRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(AddressStringToBytesRequest.aminoType, AddressStringToBytesRequest.typeUrl); +function createBaseAddressStringToBytesResponse(): AddressStringToBytesResponse { + return { + addressBytes: new Uint8Array() + }; +} +export const AddressStringToBytesResponse = { + typeUrl: "/cosmos.auth.v1beta1.AddressStringToBytesResponse", + aminoType: "cosmos-sdk/AddressStringToBytesResponse", + is(o: any): o is AddressStringToBytesResponse { + return o && (o.$typeUrl === AddressStringToBytesResponse.typeUrl || o.addressBytes instanceof Uint8Array || typeof o.addressBytes === "string"); + }, + isSDK(o: any): o is AddressStringToBytesResponseSDKType { + return o && (o.$typeUrl === AddressStringToBytesResponse.typeUrl || o.address_bytes instanceof Uint8Array || typeof o.address_bytes === "string"); + }, + isAmino(o: any): o is AddressStringToBytesResponseAmino { + return o && (o.$typeUrl === AddressStringToBytesResponse.typeUrl || o.address_bytes instanceof Uint8Array || typeof o.address_bytes === "string"); + }, + encode(message: AddressStringToBytesResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.addressBytes.length !== 0) { + writer.uint32(10).bytes(message.addressBytes); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): AddressStringToBytesResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseAddressStringToBytesResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.addressBytes = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): AddressStringToBytesResponse { + return { + addressBytes: isSet(object.addressBytes) ? bytesFromBase64(object.addressBytes) : new Uint8Array() + }; + }, + toJSON(message: AddressStringToBytesResponse): unknown { + const obj: any = {}; + message.addressBytes !== undefined && (obj.addressBytes = base64FromBytes(message.addressBytes !== undefined ? message.addressBytes : new Uint8Array())); + return obj; + }, + fromPartial(object: Partial): AddressStringToBytesResponse { + const message = createBaseAddressStringToBytesResponse(); + message.addressBytes = object.addressBytes ?? new Uint8Array(); + return message; + }, + fromAmino(object: AddressStringToBytesResponseAmino): AddressStringToBytesResponse { + const message = createBaseAddressStringToBytesResponse(); + if (object.address_bytes !== undefined && object.address_bytes !== null) { + message.addressBytes = bytesFromBase64(object.address_bytes); + } + return message; + }, + toAmino(message: AddressStringToBytesResponse): AddressStringToBytesResponseAmino { + const obj: any = {}; + obj.address_bytes = message.addressBytes ? base64FromBytes(message.addressBytes) : undefined; + return obj; + }, + fromAminoMsg(object: AddressStringToBytesResponseAminoMsg): AddressStringToBytesResponse { + return AddressStringToBytesResponse.fromAmino(object.value); + }, + toAminoMsg(message: AddressStringToBytesResponse): AddressStringToBytesResponseAminoMsg { + return { + type: "cosmos-sdk/AddressStringToBytesResponse", + value: AddressStringToBytesResponse.toAmino(message) + }; + }, + fromProtoMsg(message: AddressStringToBytesResponseProtoMsg): AddressStringToBytesResponse { + return AddressStringToBytesResponse.decode(message.value); + }, + toProto(message: AddressStringToBytesResponse): Uint8Array { + return AddressStringToBytesResponse.encode(message).finish(); + }, + toProtoMsg(message: AddressStringToBytesResponse): AddressStringToBytesResponseProtoMsg { + return { + typeUrl: "/cosmos.auth.v1beta1.AddressStringToBytesResponse", + value: AddressStringToBytesResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(AddressStringToBytesResponse.typeUrl, AddressStringToBytesResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(AddressStringToBytesResponse.aminoType, AddressStringToBytesResponse.typeUrl); +function createBaseQueryAccountAddressByIDRequest(): QueryAccountAddressByIDRequest { + return { + id: BigInt(0), + accountId: BigInt(0) + }; +} +export const QueryAccountAddressByIDRequest = { + typeUrl: "/cosmos.auth.v1beta1.QueryAccountAddressByIDRequest", + aminoType: "cosmos-sdk/QueryAccountAddressByIDRequest", + is(o: any): o is QueryAccountAddressByIDRequest { + return o && (o.$typeUrl === QueryAccountAddressByIDRequest.typeUrl || typeof o.id === "bigint" && typeof o.accountId === "bigint"); + }, + isSDK(o: any): o is QueryAccountAddressByIDRequestSDKType { + return o && (o.$typeUrl === QueryAccountAddressByIDRequest.typeUrl || typeof o.id === "bigint" && typeof o.account_id === "bigint"); + }, + isAmino(o: any): o is QueryAccountAddressByIDRequestAmino { + return o && (o.$typeUrl === QueryAccountAddressByIDRequest.typeUrl || typeof o.id === "bigint" && typeof o.account_id === "bigint"); + }, + encode(message: QueryAccountAddressByIDRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.id !== BigInt(0)) { + writer.uint32(8).int64(message.id); + } + if (message.accountId !== BigInt(0)) { + writer.uint32(16).uint64(message.accountId); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryAccountAddressByIDRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryAccountAddressByIDRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.id = reader.int64(); + break; + case 2: + message.accountId = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): QueryAccountAddressByIDRequest { + return { + id: isSet(object.id) ? BigInt(object.id.toString()) : BigInt(0), + accountId: isSet(object.accountId) ? BigInt(object.accountId.toString()) : BigInt(0) + }; + }, + toJSON(message: QueryAccountAddressByIDRequest): unknown { + const obj: any = {}; + message.id !== undefined && (obj.id = (message.id || BigInt(0)).toString()); + message.accountId !== undefined && (obj.accountId = (message.accountId || BigInt(0)).toString()); + return obj; + }, + fromPartial(object: Partial): QueryAccountAddressByIDRequest { + const message = createBaseQueryAccountAddressByIDRequest(); + message.id = object.id !== undefined && object.id !== null ? BigInt(object.id.toString()) : BigInt(0); + message.accountId = object.accountId !== undefined && object.accountId !== null ? BigInt(object.accountId.toString()) : BigInt(0); + return message; + }, + fromAmino(object: QueryAccountAddressByIDRequestAmino): QueryAccountAddressByIDRequest { + const message = createBaseQueryAccountAddressByIDRequest(); + if (object.id !== undefined && object.id !== null) { + message.id = BigInt(object.id); + } + if (object.account_id !== undefined && object.account_id !== null) { + message.accountId = BigInt(object.account_id); + } + return message; + }, + toAmino(message: QueryAccountAddressByIDRequest): QueryAccountAddressByIDRequestAmino { + const obj: any = {}; + obj.id = message.id ? message.id.toString() : undefined; + obj.account_id = message.accountId ? message.accountId.toString() : undefined; + return obj; + }, + fromAminoMsg(object: QueryAccountAddressByIDRequestAminoMsg): QueryAccountAddressByIDRequest { + return QueryAccountAddressByIDRequest.fromAmino(object.value); + }, + toAminoMsg(message: QueryAccountAddressByIDRequest): QueryAccountAddressByIDRequestAminoMsg { + return { + type: "cosmos-sdk/QueryAccountAddressByIDRequest", + value: QueryAccountAddressByIDRequest.toAmino(message) + }; + }, + fromProtoMsg(message: QueryAccountAddressByIDRequestProtoMsg): QueryAccountAddressByIDRequest { + return QueryAccountAddressByIDRequest.decode(message.value); + }, + toProto(message: QueryAccountAddressByIDRequest): Uint8Array { + return QueryAccountAddressByIDRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryAccountAddressByIDRequest): QueryAccountAddressByIDRequestProtoMsg { + return { + typeUrl: "/cosmos.auth.v1beta1.QueryAccountAddressByIDRequest", + value: QueryAccountAddressByIDRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryAccountAddressByIDRequest.typeUrl, QueryAccountAddressByIDRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryAccountAddressByIDRequest.aminoType, QueryAccountAddressByIDRequest.typeUrl); +function createBaseQueryAccountAddressByIDResponse(): QueryAccountAddressByIDResponse { + return { + accountAddress: "" + }; +} +export const QueryAccountAddressByIDResponse = { + typeUrl: "/cosmos.auth.v1beta1.QueryAccountAddressByIDResponse", + aminoType: "cosmos-sdk/QueryAccountAddressByIDResponse", + is(o: any): o is QueryAccountAddressByIDResponse { + return o && (o.$typeUrl === QueryAccountAddressByIDResponse.typeUrl || typeof o.accountAddress === "string"); + }, + isSDK(o: any): o is QueryAccountAddressByIDResponseSDKType { + return o && (o.$typeUrl === QueryAccountAddressByIDResponse.typeUrl || typeof o.account_address === "string"); + }, + isAmino(o: any): o is QueryAccountAddressByIDResponseAmino { + return o && (o.$typeUrl === QueryAccountAddressByIDResponse.typeUrl || typeof o.account_address === "string"); + }, + encode(message: QueryAccountAddressByIDResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.accountAddress !== "") { + writer.uint32(10).string(message.accountAddress); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryAccountAddressByIDResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryAccountAddressByIDResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.accountAddress = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): QueryAccountAddressByIDResponse { + return { + accountAddress: isSet(object.accountAddress) ? String(object.accountAddress) : "" + }; + }, + toJSON(message: QueryAccountAddressByIDResponse): unknown { + const obj: any = {}; + message.accountAddress !== undefined && (obj.accountAddress = message.accountAddress); + return obj; + }, + fromPartial(object: Partial): QueryAccountAddressByIDResponse { + const message = createBaseQueryAccountAddressByIDResponse(); + message.accountAddress = object.accountAddress ?? ""; + return message; + }, + fromAmino(object: QueryAccountAddressByIDResponseAmino): QueryAccountAddressByIDResponse { + const message = createBaseQueryAccountAddressByIDResponse(); + if (object.account_address !== undefined && object.account_address !== null) { + message.accountAddress = object.account_address; + } + return message; + }, + toAmino(message: QueryAccountAddressByIDResponse): QueryAccountAddressByIDResponseAmino { + const obj: any = {}; + obj.account_address = message.accountAddress; + return obj; + }, + fromAminoMsg(object: QueryAccountAddressByIDResponseAminoMsg): QueryAccountAddressByIDResponse { + return QueryAccountAddressByIDResponse.fromAmino(object.value); + }, + toAminoMsg(message: QueryAccountAddressByIDResponse): QueryAccountAddressByIDResponseAminoMsg { + return { + type: "cosmos-sdk/QueryAccountAddressByIDResponse", + value: QueryAccountAddressByIDResponse.toAmino(message) + }; + }, + fromProtoMsg(message: QueryAccountAddressByIDResponseProtoMsg): QueryAccountAddressByIDResponse { + return QueryAccountAddressByIDResponse.decode(message.value); + }, + toProto(message: QueryAccountAddressByIDResponse): Uint8Array { + return QueryAccountAddressByIDResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryAccountAddressByIDResponse): QueryAccountAddressByIDResponseProtoMsg { + return { + typeUrl: "/cosmos.auth.v1beta1.QueryAccountAddressByIDResponse", + value: QueryAccountAddressByIDResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryAccountAddressByIDResponse.typeUrl, QueryAccountAddressByIDResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryAccountAddressByIDResponse.aminoType, QueryAccountAddressByIDResponse.typeUrl); +function createBaseQueryAccountInfoRequest(): QueryAccountInfoRequest { + return { + address: "" + }; +} +export const QueryAccountInfoRequest = { + typeUrl: "/cosmos.auth.v1beta1.QueryAccountInfoRequest", + aminoType: "cosmos-sdk/QueryAccountInfoRequest", + is(o: any): o is QueryAccountInfoRequest { + return o && (o.$typeUrl === QueryAccountInfoRequest.typeUrl || typeof o.address === "string"); + }, + isSDK(o: any): o is QueryAccountInfoRequestSDKType { + return o && (o.$typeUrl === QueryAccountInfoRequest.typeUrl || typeof o.address === "string"); + }, + isAmino(o: any): o is QueryAccountInfoRequestAmino { + return o && (o.$typeUrl === QueryAccountInfoRequest.typeUrl || typeof o.address === "string"); + }, + encode(message: QueryAccountInfoRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.address !== "") { + writer.uint32(10).string(message.address); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryAccountInfoRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryAccountInfoRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.address = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): QueryAccountInfoRequest { + return { + address: isSet(object.address) ? String(object.address) : "" + }; + }, + toJSON(message: QueryAccountInfoRequest): unknown { + const obj: any = {}; + message.address !== undefined && (obj.address = message.address); + return obj; + }, + fromPartial(object: Partial): QueryAccountInfoRequest { + const message = createBaseQueryAccountInfoRequest(); + message.address = object.address ?? ""; + return message; + }, + fromAmino(object: QueryAccountInfoRequestAmino): QueryAccountInfoRequest { + const message = createBaseQueryAccountInfoRequest(); + if (object.address !== undefined && object.address !== null) { + message.address = object.address; + } + return message; + }, + toAmino(message: QueryAccountInfoRequest): QueryAccountInfoRequestAmino { + const obj: any = {}; + obj.address = message.address; + return obj; + }, + fromAminoMsg(object: QueryAccountInfoRequestAminoMsg): QueryAccountInfoRequest { + return QueryAccountInfoRequest.fromAmino(object.value); + }, + toAminoMsg(message: QueryAccountInfoRequest): QueryAccountInfoRequestAminoMsg { + return { + type: "cosmos-sdk/QueryAccountInfoRequest", + value: QueryAccountInfoRequest.toAmino(message) + }; + }, + fromProtoMsg(message: QueryAccountInfoRequestProtoMsg): QueryAccountInfoRequest { + return QueryAccountInfoRequest.decode(message.value); + }, + toProto(message: QueryAccountInfoRequest): Uint8Array { + return QueryAccountInfoRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryAccountInfoRequest): QueryAccountInfoRequestProtoMsg { + return { + typeUrl: "/cosmos.auth.v1beta1.QueryAccountInfoRequest", + value: QueryAccountInfoRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryAccountInfoRequest.typeUrl, QueryAccountInfoRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryAccountInfoRequest.aminoType, QueryAccountInfoRequest.typeUrl); +function createBaseQueryAccountInfoResponse(): QueryAccountInfoResponse { + return { + info: undefined + }; +} +export const QueryAccountInfoResponse = { + typeUrl: "/cosmos.auth.v1beta1.QueryAccountInfoResponse", + aminoType: "cosmos-sdk/QueryAccountInfoResponse", + is(o: any): o is QueryAccountInfoResponse { + return o && o.$typeUrl === QueryAccountInfoResponse.typeUrl; + }, + isSDK(o: any): o is QueryAccountInfoResponseSDKType { + return o && o.$typeUrl === QueryAccountInfoResponse.typeUrl; + }, + isAmino(o: any): o is QueryAccountInfoResponseAmino { + return o && o.$typeUrl === QueryAccountInfoResponse.typeUrl; + }, + encode(message: QueryAccountInfoResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.info !== undefined) { + BaseAccount.encode(message.info, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryAccountInfoResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryAccountInfoResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.info = BaseAccount.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): QueryAccountInfoResponse { + return { + info: isSet(object.info) ? BaseAccount.fromJSON(object.info) : undefined + }; + }, + toJSON(message: QueryAccountInfoResponse): unknown { + const obj: any = {}; + message.info !== undefined && (obj.info = message.info ? BaseAccount.toJSON(message.info) : undefined); + return obj; + }, + fromPartial(object: Partial): QueryAccountInfoResponse { + const message = createBaseQueryAccountInfoResponse(); + message.info = object.info !== undefined && object.info !== null ? BaseAccount.fromPartial(object.info) : undefined; + return message; + }, + fromAmino(object: QueryAccountInfoResponseAmino): QueryAccountInfoResponse { + const message = createBaseQueryAccountInfoResponse(); + if (object.info !== undefined && object.info !== null) { + message.info = BaseAccount.fromAmino(object.info); + } + return message; + }, + toAmino(message: QueryAccountInfoResponse): QueryAccountInfoResponseAmino { + const obj: any = {}; + obj.info = message.info ? BaseAccount.toAmino(message.info) : undefined; + return obj; + }, + fromAminoMsg(object: QueryAccountInfoResponseAminoMsg): QueryAccountInfoResponse { + return QueryAccountInfoResponse.fromAmino(object.value); + }, + toAminoMsg(message: QueryAccountInfoResponse): QueryAccountInfoResponseAminoMsg { + return { + type: "cosmos-sdk/QueryAccountInfoResponse", + value: QueryAccountInfoResponse.toAmino(message) + }; + }, + fromProtoMsg(message: QueryAccountInfoResponseProtoMsg): QueryAccountInfoResponse { + return QueryAccountInfoResponse.decode(message.value); + }, + toProto(message: QueryAccountInfoResponse): Uint8Array { + return QueryAccountInfoResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryAccountInfoResponse): QueryAccountInfoResponseProtoMsg { + return { + typeUrl: "/cosmos.auth.v1beta1.QueryAccountInfoResponse", + value: QueryAccountInfoResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryAccountInfoResponse.typeUrl, QueryAccountInfoResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryAccountInfoResponse.aminoType, QueryAccountInfoResponse.typeUrl); \ No newline at end of file diff --git a/packages/osmojs/src/codegen/cosmos/auth/v1beta1/tx.amino.ts b/packages/osmojs/src/codegen/cosmos/auth/v1beta1/tx.amino.ts new file mode 100644 index 000000000..54570c3b6 --- /dev/null +++ b/packages/osmojs/src/codegen/cosmos/auth/v1beta1/tx.amino.ts @@ -0,0 +1,9 @@ +//@ts-nocheck +import { MsgUpdateParams } from "./tx"; +export const AminoConverter = { + "/cosmos.auth.v1beta1.MsgUpdateParams": { + aminoType: "cosmos-sdk/x/auth/MsgUpdateParams", + toAmino: MsgUpdateParams.toAmino, + fromAmino: MsgUpdateParams.fromAmino + } +}; \ No newline at end of file diff --git a/packages/osmojs/src/codegen/cosmos/auth/v1beta1/tx.registry.ts b/packages/osmojs/src/codegen/cosmos/auth/v1beta1/tx.registry.ts new file mode 100644 index 000000000..99d4503af --- /dev/null +++ b/packages/osmojs/src/codegen/cosmos/auth/v1beta1/tx.registry.ts @@ -0,0 +1,51 @@ +//@ts-nocheck +import { GeneratedType, Registry } from "@cosmjs/proto-signing"; +import { MsgUpdateParams } from "./tx"; +export const registry: ReadonlyArray<[string, GeneratedType]> = [["/cosmos.auth.v1beta1.MsgUpdateParams", MsgUpdateParams]]; +export const load = (protoRegistry: Registry) => { + registry.forEach(([typeUrl, mod]) => { + protoRegistry.register(typeUrl, mod); + }); +}; +export const MessageComposer = { + encoded: { + updateParams(value: MsgUpdateParams) { + return { + typeUrl: "/cosmos.auth.v1beta1.MsgUpdateParams", + value: MsgUpdateParams.encode(value).finish() + }; + } + }, + withTypeUrl: { + updateParams(value: MsgUpdateParams) { + return { + typeUrl: "/cosmos.auth.v1beta1.MsgUpdateParams", + value + }; + } + }, + toJSON: { + updateParams(value: MsgUpdateParams) { + return { + typeUrl: "/cosmos.auth.v1beta1.MsgUpdateParams", + value: MsgUpdateParams.toJSON(value) + }; + } + }, + fromJSON: { + updateParams(value: any) { + return { + typeUrl: "/cosmos.auth.v1beta1.MsgUpdateParams", + value: MsgUpdateParams.fromJSON(value) + }; + } + }, + fromPartial: { + updateParams(value: MsgUpdateParams) { + return { + typeUrl: "/cosmos.auth.v1beta1.MsgUpdateParams", + value: MsgUpdateParams.fromPartial(value) + }; + } + } +}; \ No newline at end of file diff --git a/packages/osmojs/src/codegen/cosmos/auth/v1beta1/tx.rpc.msg.ts b/packages/osmojs/src/codegen/cosmos/auth/v1beta1/tx.rpc.msg.ts new file mode 100644 index 000000000..c67f25965 --- /dev/null +++ b/packages/osmojs/src/codegen/cosmos/auth/v1beta1/tx.rpc.msg.ts @@ -0,0 +1,28 @@ +import { Rpc } from "../../../helpers"; +import { BinaryReader } from "../../../binary"; +import { MsgUpdateParams, MsgUpdateParamsResponse } from "./tx"; +/** Msg defines the x/auth Msg service. */ +export interface Msg { + /** + * UpdateParams defines a (governance) operation for updating the x/auth module + * parameters. The authority defaults to the x/gov module account. + * + * Since: cosmos-sdk 0.47 + */ + updateParams(request: MsgUpdateParams): Promise; +} +export class MsgClientImpl implements Msg { + private readonly rpc: Rpc; + constructor(rpc: Rpc) { + this.rpc = rpc; + this.updateParams = this.updateParams.bind(this); + } + updateParams(request: MsgUpdateParams): Promise { + const data = MsgUpdateParams.encode(request).finish(); + const promise = this.rpc.request("cosmos.auth.v1beta1.Msg", "UpdateParams", data); + return promise.then(data => MsgUpdateParamsResponse.decode(new BinaryReader(data))); + } +} +export const createClientImpl = (rpc: Rpc) => { + return new MsgClientImpl(rpc); +}; \ No newline at end of file diff --git a/packages/osmojs/src/codegen/cosmos/auth/v1beta1/tx.ts b/packages/osmojs/src/codegen/cosmos/auth/v1beta1/tx.ts new file mode 100644 index 000000000..a4a856961 --- /dev/null +++ b/packages/osmojs/src/codegen/cosmos/auth/v1beta1/tx.ts @@ -0,0 +1,260 @@ +import { Params, ParamsAmino, ParamsSDKType } from "./auth"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { isSet } from "../../../helpers"; +import { GlobalDecoderRegistry } from "../../../registry"; +/** + * MsgUpdateParams is the Msg/UpdateParams request type. + * + * Since: cosmos-sdk 0.47 + */ +export interface MsgUpdateParams { + /** authority is the address that controls the module (defaults to x/gov unless overwritten). */ + authority: string; + /** + * params defines the x/auth parameters to update. + * + * NOTE: All parameters must be supplied. + */ + params: Params; +} +export interface MsgUpdateParamsProtoMsg { + typeUrl: "/cosmos.auth.v1beta1.MsgUpdateParams"; + value: Uint8Array; +} +/** + * MsgUpdateParams is the Msg/UpdateParams request type. + * + * Since: cosmos-sdk 0.47 + */ +export interface MsgUpdateParamsAmino { + /** authority is the address that controls the module (defaults to x/gov unless overwritten). */ + authority?: string; + /** + * params defines the x/auth parameters to update. + * + * NOTE: All parameters must be supplied. + */ + params: ParamsAmino; +} +export interface MsgUpdateParamsAminoMsg { + type: "cosmos-sdk/x/auth/MsgUpdateParams"; + value: MsgUpdateParamsAmino; +} +/** + * MsgUpdateParams is the Msg/UpdateParams request type. + * + * Since: cosmos-sdk 0.47 + */ +export interface MsgUpdateParamsSDKType { + authority: string; + params: ParamsSDKType; +} +/** + * MsgUpdateParamsResponse defines the response structure for executing a + * MsgUpdateParams message. + * + * Since: cosmos-sdk 0.47 + */ +export interface MsgUpdateParamsResponse {} +export interface MsgUpdateParamsResponseProtoMsg { + typeUrl: "/cosmos.auth.v1beta1.MsgUpdateParamsResponse"; + value: Uint8Array; +} +/** + * MsgUpdateParamsResponse defines the response structure for executing a + * MsgUpdateParams message. + * + * Since: cosmos-sdk 0.47 + */ +export interface MsgUpdateParamsResponseAmino {} +export interface MsgUpdateParamsResponseAminoMsg { + type: "cosmos-sdk/MsgUpdateParamsResponse"; + value: MsgUpdateParamsResponseAmino; +} +/** + * MsgUpdateParamsResponse defines the response structure for executing a + * MsgUpdateParams message. + * + * Since: cosmos-sdk 0.47 + */ +export interface MsgUpdateParamsResponseSDKType {} +function createBaseMsgUpdateParams(): MsgUpdateParams { + return { + authority: "", + params: Params.fromPartial({}) + }; +} +export const MsgUpdateParams = { + typeUrl: "/cosmos.auth.v1beta1.MsgUpdateParams", + aminoType: "cosmos-sdk/x/auth/MsgUpdateParams", + is(o: any): o is MsgUpdateParams { + return o && (o.$typeUrl === MsgUpdateParams.typeUrl || typeof o.authority === "string" && Params.is(o.params)); + }, + isSDK(o: any): o is MsgUpdateParamsSDKType { + return o && (o.$typeUrl === MsgUpdateParams.typeUrl || typeof o.authority === "string" && Params.isSDK(o.params)); + }, + isAmino(o: any): o is MsgUpdateParamsAmino { + return o && (o.$typeUrl === MsgUpdateParams.typeUrl || typeof o.authority === "string" && Params.isAmino(o.params)); + }, + encode(message: MsgUpdateParams, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.authority !== "") { + writer.uint32(10).string(message.authority); + } + if (message.params !== undefined) { + Params.encode(message.params, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgUpdateParams { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUpdateParams(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.authority = reader.string(); + break; + case 2: + message.params = Params.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): MsgUpdateParams { + return { + authority: isSet(object.authority) ? String(object.authority) : "", + params: isSet(object.params) ? Params.fromJSON(object.params) : undefined + }; + }, + toJSON(message: MsgUpdateParams): unknown { + const obj: any = {}; + message.authority !== undefined && (obj.authority = message.authority); + message.params !== undefined && (obj.params = message.params ? Params.toJSON(message.params) : undefined); + return obj; + }, + fromPartial(object: Partial): MsgUpdateParams { + const message = createBaseMsgUpdateParams(); + message.authority = object.authority ?? ""; + message.params = object.params !== undefined && object.params !== null ? Params.fromPartial(object.params) : undefined; + return message; + }, + fromAmino(object: MsgUpdateParamsAmino): MsgUpdateParams { + const message = createBaseMsgUpdateParams(); + if (object.authority !== undefined && object.authority !== null) { + message.authority = object.authority; + } + if (object.params !== undefined && object.params !== null) { + message.params = Params.fromAmino(object.params); + } + return message; + }, + toAmino(message: MsgUpdateParams): MsgUpdateParamsAmino { + const obj: any = {}; + obj.authority = message.authority; + obj.params = message.params ? Params.toAmino(message.params) : Params.fromPartial({}); + return obj; + }, + fromAminoMsg(object: MsgUpdateParamsAminoMsg): MsgUpdateParams { + return MsgUpdateParams.fromAmino(object.value); + }, + toAminoMsg(message: MsgUpdateParams): MsgUpdateParamsAminoMsg { + return { + type: "cosmos-sdk/x/auth/MsgUpdateParams", + value: MsgUpdateParams.toAmino(message) + }; + }, + fromProtoMsg(message: MsgUpdateParamsProtoMsg): MsgUpdateParams { + return MsgUpdateParams.decode(message.value); + }, + toProto(message: MsgUpdateParams): Uint8Array { + return MsgUpdateParams.encode(message).finish(); + }, + toProtoMsg(message: MsgUpdateParams): MsgUpdateParamsProtoMsg { + return { + typeUrl: "/cosmos.auth.v1beta1.MsgUpdateParams", + value: MsgUpdateParams.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgUpdateParams.typeUrl, MsgUpdateParams); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgUpdateParams.aminoType, MsgUpdateParams.typeUrl); +function createBaseMsgUpdateParamsResponse(): MsgUpdateParamsResponse { + return {}; +} +export const MsgUpdateParamsResponse = { + typeUrl: "/cosmos.auth.v1beta1.MsgUpdateParamsResponse", + aminoType: "cosmos-sdk/MsgUpdateParamsResponse", + is(o: any): o is MsgUpdateParamsResponse { + return o && o.$typeUrl === MsgUpdateParamsResponse.typeUrl; + }, + isSDK(o: any): o is MsgUpdateParamsResponseSDKType { + return o && o.$typeUrl === MsgUpdateParamsResponse.typeUrl; + }, + isAmino(o: any): o is MsgUpdateParamsResponseAmino { + return o && o.$typeUrl === MsgUpdateParamsResponse.typeUrl; + }, + encode(_: MsgUpdateParamsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgUpdateParamsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUpdateParamsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(_: any): MsgUpdateParamsResponse { + return {}; + }, + toJSON(_: MsgUpdateParamsResponse): unknown { + const obj: any = {}; + return obj; + }, + fromPartial(_: Partial): MsgUpdateParamsResponse { + const message = createBaseMsgUpdateParamsResponse(); + return message; + }, + fromAmino(_: MsgUpdateParamsResponseAmino): MsgUpdateParamsResponse { + const message = createBaseMsgUpdateParamsResponse(); + return message; + }, + toAmino(_: MsgUpdateParamsResponse): MsgUpdateParamsResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgUpdateParamsResponseAminoMsg): MsgUpdateParamsResponse { + return MsgUpdateParamsResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgUpdateParamsResponse): MsgUpdateParamsResponseAminoMsg { + return { + type: "cosmos-sdk/MsgUpdateParamsResponse", + value: MsgUpdateParamsResponse.toAmino(message) + }; + }, + fromProtoMsg(message: MsgUpdateParamsResponseProtoMsg): MsgUpdateParamsResponse { + return MsgUpdateParamsResponse.decode(message.value); + }, + toProto(message: MsgUpdateParamsResponse): Uint8Array { + return MsgUpdateParamsResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgUpdateParamsResponse): MsgUpdateParamsResponseProtoMsg { + return { + typeUrl: "/cosmos.auth.v1beta1.MsgUpdateParamsResponse", + value: MsgUpdateParamsResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgUpdateParamsResponse.typeUrl, MsgUpdateParamsResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgUpdateParamsResponse.aminoType, MsgUpdateParamsResponse.typeUrl); \ No newline at end of file diff --git a/packages/osmojs/src/codegen/cosmos/authz/v1beta1/authz.ts b/packages/osmojs/src/codegen/cosmos/authz/v1beta1/authz.ts index 402fb2a2b..8561bc4ae 100644 --- a/packages/osmojs/src/codegen/cosmos/authz/v1beta1/authz.ts +++ b/packages/osmojs/src/codegen/cosmos/authz/v1beta1/authz.ts @@ -2,14 +2,17 @@ import { Any, AnyProtoMsg, AnyAmino, AnySDKType } from "../../../google/protobuf import { Timestamp } from "../../../google/protobuf/timestamp"; import { SendAuthorization, SendAuthorizationProtoMsg, SendAuthorizationSDKType } from "../../bank/v1beta1/authz"; import { StakeAuthorization, StakeAuthorizationProtoMsg, StakeAuthorizationSDKType } from "../../staking/v1beta1/authz"; +import { TransferAuthorization, TransferAuthorizationProtoMsg, TransferAuthorizationSDKType } from "../../../ibc/applications/transfer/v1/authz"; +import { StoreCodeAuthorization, StoreCodeAuthorizationProtoMsg, StoreCodeAuthorizationSDKType, ContractExecutionAuthorization, ContractExecutionAuthorizationProtoMsg, ContractExecutionAuthorizationSDKType, ContractMigrationAuthorization, ContractMigrationAuthorizationProtoMsg, ContractMigrationAuthorizationSDKType } from "../../../cosmwasm/wasm/v1/authz"; import { BinaryReader, BinaryWriter } from "../../../binary"; -import { toTimestamp, fromTimestamp } from "../../../helpers"; +import { isSet, toTimestamp, fromTimestamp } from "../../../helpers"; +import { GlobalDecoderRegistry } from "../../../registry"; /** * GenericAuthorization gives the grantee unrestricted permissions to execute * the provided method on behalf of the granter's account. */ export interface GenericAuthorization { - $typeUrl?: string; + $typeUrl?: "/cosmos.authz.v1beta1.GenericAuthorization"; /** Msg, identified by it's type URL, to grant unrestricted permissions to execute */ msg: string; } @@ -23,7 +26,7 @@ export interface GenericAuthorizationProtoMsg { */ export interface GenericAuthorizationAmino { /** Msg, identified by it's type URL, to grant unrestricted permissions to execute */ - msg: string; + msg?: string; } export interface GenericAuthorizationAminoMsg { type: "cosmos-sdk/GenericAuthorization"; @@ -34,7 +37,7 @@ export interface GenericAuthorizationAminoMsg { * the provided method on behalf of the granter's account. */ export interface GenericAuthorizationSDKType { - $typeUrl?: string; + $typeUrl?: "/cosmos.authz.v1beta1.GenericAuthorization"; msg: string; } /** @@ -42,15 +45,20 @@ export interface GenericAuthorizationSDKType { * the provide method with expiration time. */ export interface Grant { - authorization: (GenericAuthorization & SendAuthorization & StakeAuthorization & Any) | undefined; - expiration: Date; + authorization?: GenericAuthorization | SendAuthorization | StakeAuthorization | TransferAuthorization | StoreCodeAuthorization | ContractExecutionAuthorization | ContractMigrationAuthorization | Any | undefined; + /** + * time when the grant will expire and will be pruned. If null, then the grant + * doesn't have a time expiration (other conditions in `authorization` + * may apply to invalidate the grant) + */ + expiration?: Date; } export interface GrantProtoMsg { typeUrl: "/cosmos.authz.v1beta1.Grant"; value: Uint8Array; } export type GrantEncoded = Omit & { - authorization?: GenericAuthorizationProtoMsg | SendAuthorizationProtoMsg | StakeAuthorizationProtoMsg | AnyProtoMsg | undefined; + authorization?: GenericAuthorizationProtoMsg | SendAuthorizationProtoMsg | StakeAuthorizationProtoMsg | TransferAuthorizationProtoMsg | StoreCodeAuthorizationProtoMsg | ContractExecutionAuthorizationProtoMsg | ContractMigrationAuthorizationProtoMsg | AnyProtoMsg | undefined; }; /** * Grant gives permissions to execute @@ -58,7 +66,12 @@ export type GrantEncoded = Omit & { */ export interface GrantAmino { authorization?: AnyAmino; - expiration?: Date; + /** + * time when the grant will expire and will be pruned. If null, then the grant + * doesn't have a time expiration (other conditions in `authorization` + * may apply to invalidate the grant) + */ + expiration?: string; } export interface GrantAminoMsg { type: "cosmos-sdk/Grant"; @@ -69,8 +82,8 @@ export interface GrantAminoMsg { * the provide method with expiration time. */ export interface GrantSDKType { - authorization: GenericAuthorizationSDKType | SendAuthorizationSDKType | StakeAuthorizationSDKType | AnySDKType | undefined; - expiration: Date; + authorization?: GenericAuthorizationSDKType | SendAuthorizationSDKType | StakeAuthorizationSDKType | TransferAuthorizationSDKType | StoreCodeAuthorizationSDKType | ContractExecutionAuthorizationSDKType | ContractMigrationAuthorizationSDKType | AnySDKType | undefined; + expiration?: Date; } /** * GrantAuthorization extends a grant with both the addresses of the grantee and granter. @@ -79,25 +92,25 @@ export interface GrantSDKType { export interface GrantAuthorization { granter: string; grantee: string; - authorization: (GenericAuthorization & SendAuthorization & StakeAuthorization & Any) | undefined; - expiration: Date; + authorization?: GenericAuthorization | SendAuthorization | StakeAuthorization | TransferAuthorization | StoreCodeAuthorization | ContractExecutionAuthorization | ContractMigrationAuthorization | Any | undefined; + expiration?: Date; } export interface GrantAuthorizationProtoMsg { typeUrl: "/cosmos.authz.v1beta1.GrantAuthorization"; value: Uint8Array; } export type GrantAuthorizationEncoded = Omit & { - authorization?: GenericAuthorizationProtoMsg | SendAuthorizationProtoMsg | StakeAuthorizationProtoMsg | AnyProtoMsg | undefined; + authorization?: GenericAuthorizationProtoMsg | SendAuthorizationProtoMsg | StakeAuthorizationProtoMsg | TransferAuthorizationProtoMsg | StoreCodeAuthorizationProtoMsg | ContractExecutionAuthorizationProtoMsg | ContractMigrationAuthorizationProtoMsg | AnyProtoMsg | undefined; }; /** * GrantAuthorization extends a grant with both the addresses of the grantee and granter. * It is used in genesis.proto and query.proto */ export interface GrantAuthorizationAmino { - granter: string; - grantee: string; + granter?: string; + grantee?: string; authorization?: AnyAmino; - expiration?: Date; + expiration?: string; } export interface GrantAuthorizationAminoMsg { type: "cosmos-sdk/GrantAuthorization"; @@ -110,8 +123,30 @@ export interface GrantAuthorizationAminoMsg { export interface GrantAuthorizationSDKType { granter: string; grantee: string; - authorization: GenericAuthorizationSDKType | SendAuthorizationSDKType | StakeAuthorizationSDKType | AnySDKType | undefined; - expiration: Date; + authorization?: GenericAuthorizationSDKType | SendAuthorizationSDKType | StakeAuthorizationSDKType | TransferAuthorizationSDKType | StoreCodeAuthorizationSDKType | ContractExecutionAuthorizationSDKType | ContractMigrationAuthorizationSDKType | AnySDKType | undefined; + expiration?: Date; +} +/** GrantQueueItem contains the list of TypeURL of a sdk.Msg. */ +export interface GrantQueueItem { + /** msg_type_urls contains the list of TypeURL of a sdk.Msg. */ + msgTypeUrls: string[]; +} +export interface GrantQueueItemProtoMsg { + typeUrl: "/cosmos.authz.v1beta1.GrantQueueItem"; + value: Uint8Array; +} +/** GrantQueueItem contains the list of TypeURL of a sdk.Msg. */ +export interface GrantQueueItemAmino { + /** msg_type_urls contains the list of TypeURL of a sdk.Msg. */ + msg_type_urls?: string[]; +} +export interface GrantQueueItemAminoMsg { + type: "cosmos-sdk/GrantQueueItem"; + value: GrantQueueItemAmino; +} +/** GrantQueueItem contains the list of TypeURL of a sdk.Msg. */ +export interface GrantQueueItemSDKType { + msg_type_urls: string[]; } function createBaseGenericAuthorization(): GenericAuthorization { return { @@ -121,6 +156,16 @@ function createBaseGenericAuthorization(): GenericAuthorization { } export const GenericAuthorization = { typeUrl: "/cosmos.authz.v1beta1.GenericAuthorization", + aminoType: "cosmos-sdk/GenericAuthorization", + is(o: any): o is GenericAuthorization { + return o && (o.$typeUrl === GenericAuthorization.typeUrl || typeof o.msg === "string"); + }, + isSDK(o: any): o is GenericAuthorizationSDKType { + return o && (o.$typeUrl === GenericAuthorization.typeUrl || typeof o.msg === "string"); + }, + isAmino(o: any): o is GenericAuthorizationAmino { + return o && (o.$typeUrl === GenericAuthorization.typeUrl || typeof o.msg === "string"); + }, encode(message: GenericAuthorization, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.msg !== "") { writer.uint32(10).string(message.msg); @@ -144,15 +189,27 @@ export const GenericAuthorization = { } return message; }, + fromJSON(object: any): GenericAuthorization { + return { + msg: isSet(object.msg) ? String(object.msg) : "" + }; + }, + toJSON(message: GenericAuthorization): unknown { + const obj: any = {}; + message.msg !== undefined && (obj.msg = message.msg); + return obj; + }, fromPartial(object: Partial): GenericAuthorization { const message = createBaseGenericAuthorization(); message.msg = object.msg ?? ""; return message; }, fromAmino(object: GenericAuthorizationAmino): GenericAuthorization { - return { - msg: object.msg - }; + const message = createBaseGenericAuthorization(); + if (object.msg !== undefined && object.msg !== null) { + message.msg = object.msg; + } + return message; }, toAmino(message: GenericAuthorization): GenericAuthorizationAmino { const obj: any = {}; @@ -181,6 +238,8 @@ export const GenericAuthorization = { }; } }; +GlobalDecoderRegistry.register(GenericAuthorization.typeUrl, GenericAuthorization); +GlobalDecoderRegistry.registerAminoProtoMapping(GenericAuthorization.aminoType, GenericAuthorization.typeUrl); function createBaseGrant(): Grant { return { authorization: undefined, @@ -189,9 +248,19 @@ function createBaseGrant(): Grant { } export const Grant = { typeUrl: "/cosmos.authz.v1beta1.Grant", + aminoType: "cosmos-sdk/Grant", + is(o: any): o is Grant { + return o && o.$typeUrl === Grant.typeUrl; + }, + isSDK(o: any): o is GrantSDKType { + return o && o.$typeUrl === Grant.typeUrl; + }, + isAmino(o: any): o is GrantAmino { + return o && o.$typeUrl === Grant.typeUrl; + }, encode(message: Grant, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.authorization !== undefined) { - Any.encode((message.authorization as Any), writer.uint32(10).fork()).ldelim(); + Any.encode(GlobalDecoderRegistry.wrapAny(message.authorization), writer.uint32(10).fork()).ldelim(); } if (message.expiration !== undefined) { Timestamp.encode(toTimestamp(message.expiration), writer.uint32(18).fork()).ldelim(); @@ -206,7 +275,7 @@ export const Grant = { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.authorization = (Authorization_InterfaceDecoder(reader) as Any); + message.authorization = GlobalDecoderRegistry.unwrapAny(reader); break; case 2: message.expiration = fromTimestamp(Timestamp.decode(reader, reader.uint32())); @@ -218,22 +287,38 @@ export const Grant = { } return message; }, + fromJSON(object: any): Grant { + return { + authorization: isSet(object.authorization) ? GlobalDecoderRegistry.fromJSON(object.authorization) : undefined, + expiration: isSet(object.expiration) ? new Date(object.expiration) : undefined + }; + }, + toJSON(message: Grant): unknown { + const obj: any = {}; + message.authorization !== undefined && (obj.authorization = message.authorization ? GlobalDecoderRegistry.toJSON(message.authorization) : undefined); + message.expiration !== undefined && (obj.expiration = message.expiration.toISOString()); + return obj; + }, fromPartial(object: Partial): Grant { const message = createBaseGrant(); - message.authorization = object.authorization !== undefined && object.authorization !== null ? Any.fromPartial(object.authorization) : undefined; + message.authorization = object.authorization !== undefined && object.authorization !== null ? GlobalDecoderRegistry.fromPartial(object.authorization) : undefined; message.expiration = object.expiration ?? undefined; return message; }, fromAmino(object: GrantAmino): Grant { - return { - authorization: object?.authorization ? Authorization_FromAmino(object.authorization) : undefined, - expiration: object.expiration - }; + const message = createBaseGrant(); + if (object.authorization !== undefined && object.authorization !== null) { + message.authorization = GlobalDecoderRegistry.fromAminoMsg(object.authorization); + } + if (object.expiration !== undefined && object.expiration !== null) { + message.expiration = fromTimestamp(Timestamp.fromAmino(object.expiration)); + } + return message; }, toAmino(message: Grant): GrantAmino { const obj: any = {}; - obj.authorization = message.authorization ? Authorization_ToAmino((message.authorization as Any)) : undefined; - obj.expiration = message.expiration; + obj.authorization = message.authorization ? GlobalDecoderRegistry.toAminoMsg(message.authorization) : undefined; + obj.expiration = message.expiration ? Timestamp.toAmino(toTimestamp(message.expiration)) : undefined; return obj; }, fromAminoMsg(object: GrantAminoMsg): Grant { @@ -258,6 +343,8 @@ export const Grant = { }; } }; +GlobalDecoderRegistry.register(Grant.typeUrl, Grant); +GlobalDecoderRegistry.registerAminoProtoMapping(Grant.aminoType, Grant.typeUrl); function createBaseGrantAuthorization(): GrantAuthorization { return { granter: "", @@ -268,6 +355,16 @@ function createBaseGrantAuthorization(): GrantAuthorization { } export const GrantAuthorization = { typeUrl: "/cosmos.authz.v1beta1.GrantAuthorization", + aminoType: "cosmos-sdk/GrantAuthorization", + is(o: any): o is GrantAuthorization { + return o && (o.$typeUrl === GrantAuthorization.typeUrl || typeof o.granter === "string" && typeof o.grantee === "string"); + }, + isSDK(o: any): o is GrantAuthorizationSDKType { + return o && (o.$typeUrl === GrantAuthorization.typeUrl || typeof o.granter === "string" && typeof o.grantee === "string"); + }, + isAmino(o: any): o is GrantAuthorizationAmino { + return o && (o.$typeUrl === GrantAuthorization.typeUrl || typeof o.granter === "string" && typeof o.grantee === "string"); + }, encode(message: GrantAuthorization, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.granter !== "") { writer.uint32(10).string(message.granter); @@ -276,7 +373,7 @@ export const GrantAuthorization = { writer.uint32(18).string(message.grantee); } if (message.authorization !== undefined) { - Any.encode((message.authorization as Any), writer.uint32(26).fork()).ldelim(); + Any.encode(GlobalDecoderRegistry.wrapAny(message.authorization), writer.uint32(26).fork()).ldelim(); } if (message.expiration !== undefined) { Timestamp.encode(toTimestamp(message.expiration), writer.uint32(34).fork()).ldelim(); @@ -297,7 +394,7 @@ export const GrantAuthorization = { message.grantee = reader.string(); break; case 3: - message.authorization = (Authorization_InterfaceDecoder(reader) as Any); + message.authorization = GlobalDecoderRegistry.unwrapAny(reader); break; case 4: message.expiration = fromTimestamp(Timestamp.decode(reader, reader.uint32())); @@ -309,28 +406,52 @@ export const GrantAuthorization = { } 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) ? GlobalDecoderRegistry.fromJSON(object.authorization) : undefined, + expiration: isSet(object.expiration) ? new Date(object.expiration) : undefined + }; + }, + toJSON(message: GrantAuthorization): unknown { + const obj: any = {}; + message.granter !== undefined && (obj.granter = message.granter); + message.grantee !== undefined && (obj.grantee = message.grantee); + message.authorization !== undefined && (obj.authorization = message.authorization ? GlobalDecoderRegistry.toJSON(message.authorization) : undefined); + message.expiration !== undefined && (obj.expiration = message.expiration.toISOString()); + return obj; + }, fromPartial(object: Partial): 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.authorization = object.authorization !== undefined && object.authorization !== null ? GlobalDecoderRegistry.fromPartial(object.authorization) : undefined; message.expiration = object.expiration ?? undefined; return message; }, fromAmino(object: GrantAuthorizationAmino): GrantAuthorization { - return { - granter: object.granter, - grantee: object.grantee, - authorization: object?.authorization ? Authorization_FromAmino(object.authorization) : undefined, - expiration: object.expiration - }; + const message = createBaseGrantAuthorization(); + if (object.granter !== undefined && object.granter !== null) { + message.granter = object.granter; + } + if (object.grantee !== undefined && object.grantee !== null) { + message.grantee = object.grantee; + } + if (object.authorization !== undefined && object.authorization !== null) { + message.authorization = GlobalDecoderRegistry.fromAminoMsg(object.authorization); + } + if (object.expiration !== undefined && object.expiration !== null) { + message.expiration = fromTimestamp(Timestamp.fromAmino(object.expiration)); + } + return message; }, toAmino(message: GrantAuthorization): GrantAuthorizationAmino { const obj: any = {}; obj.granter = message.granter; obj.grantee = message.grantee; - obj.authorization = message.authorization ? Authorization_ToAmino((message.authorization as Any)) : undefined; - obj.expiration = message.expiration; + obj.authorization = message.authorization ? GlobalDecoderRegistry.toAminoMsg(message.authorization) : undefined; + obj.expiration = message.expiration ? Timestamp.toAmino(toTimestamp(message.expiration)) : undefined; return obj; }, fromAminoMsg(object: GrantAuthorizationAminoMsg): GrantAuthorization { @@ -355,59 +476,102 @@ export const GrantAuthorization = { }; } }; -export const Authorization_InterfaceDecoder = (input: BinaryReader | Uint8Array): GenericAuthorization | SendAuthorization | StakeAuthorization | Any => { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - const data = Any.decode(reader, reader.uint32()); - switch (data.typeUrl) { - case "/cosmos.authz.v1beta1.GenericAuthorization": - return GenericAuthorization.decode(data.value); - case "/cosmos.bank.v1beta1.SendAuthorization": - return SendAuthorization.decode(data.value); - case "/cosmos.staking.v1beta1.StakeAuthorization": - return StakeAuthorization.decode(data.value); - default: - return data; - } -}; -export const Authorization_FromAmino = (content: AnyAmino) => { - switch (content.type) { - case "cosmos-sdk/GenericAuthorization": - return Any.fromPartial({ - typeUrl: "/cosmos.authz.v1beta1.GenericAuthorization", - value: GenericAuthorization.encode(GenericAuthorization.fromPartial(GenericAuthorization.fromAmino(content.value))).finish() - }); - case "cosmos-sdk/SendAuthorization": - return Any.fromPartial({ - typeUrl: "/cosmos.bank.v1beta1.SendAuthorization", - value: SendAuthorization.encode(SendAuthorization.fromPartial(SendAuthorization.fromAmino(content.value))).finish() - }); - case "cosmos-sdk/StakeAuthorization": - return Any.fromPartial({ - typeUrl: "/cosmos.staking.v1beta1.StakeAuthorization", - value: StakeAuthorization.encode(StakeAuthorization.fromPartial(StakeAuthorization.fromAmino(content.value))).finish() - }); - default: - return Any.fromAmino(content); +GlobalDecoderRegistry.register(GrantAuthorization.typeUrl, GrantAuthorization); +GlobalDecoderRegistry.registerAminoProtoMapping(GrantAuthorization.aminoType, GrantAuthorization.typeUrl); +function createBaseGrantQueueItem(): GrantQueueItem { + return { + msgTypeUrls: [] + }; +} +export const GrantQueueItem = { + typeUrl: "/cosmos.authz.v1beta1.GrantQueueItem", + aminoType: "cosmos-sdk/GrantQueueItem", + is(o: any): o is GrantQueueItem { + return o && (o.$typeUrl === GrantQueueItem.typeUrl || Array.isArray(o.msgTypeUrls) && (!o.msgTypeUrls.length || typeof o.msgTypeUrls[0] === "string")); + }, + isSDK(o: any): o is GrantQueueItemSDKType { + return o && (o.$typeUrl === GrantQueueItem.typeUrl || Array.isArray(o.msg_type_urls) && (!o.msg_type_urls.length || typeof o.msg_type_urls[0] === "string")); + }, + isAmino(o: any): o is GrantQueueItemAmino { + return o && (o.$typeUrl === GrantQueueItem.typeUrl || Array.isArray(o.msg_type_urls) && (!o.msg_type_urls.length || typeof o.msg_type_urls[0] === "string")); + }, + encode(message: GrantQueueItem, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.msgTypeUrls) { + writer.uint32(10).string(v!); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): GrantQueueItem { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGrantQueueItem(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.msgTypeUrls.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): GrantQueueItem { + return { + msgTypeUrls: Array.isArray(object?.msgTypeUrls) ? object.msgTypeUrls.map((e: any) => String(e)) : [] + }; + }, + toJSON(message: GrantQueueItem): unknown { + const obj: any = {}; + if (message.msgTypeUrls) { + obj.msgTypeUrls = message.msgTypeUrls.map(e => e); + } else { + obj.msgTypeUrls = []; + } + return obj; + }, + fromPartial(object: Partial): GrantQueueItem { + const message = createBaseGrantQueueItem(); + message.msgTypeUrls = object.msgTypeUrls?.map(e => e) || []; + return message; + }, + fromAmino(object: GrantQueueItemAmino): GrantQueueItem { + const message = createBaseGrantQueueItem(); + message.msgTypeUrls = object.msg_type_urls?.map(e => e) || []; + return message; + }, + toAmino(message: GrantQueueItem): GrantQueueItemAmino { + const obj: any = {}; + if (message.msgTypeUrls) { + obj.msg_type_urls = message.msgTypeUrls.map(e => e); + } else { + obj.msg_type_urls = []; + } + return obj; + }, + fromAminoMsg(object: GrantQueueItemAminoMsg): GrantQueueItem { + return GrantQueueItem.fromAmino(object.value); + }, + toAminoMsg(message: GrantQueueItem): GrantQueueItemAminoMsg { + return { + type: "cosmos-sdk/GrantQueueItem", + value: GrantQueueItem.toAmino(message) + }; + }, + fromProtoMsg(message: GrantQueueItemProtoMsg): GrantQueueItem { + return GrantQueueItem.decode(message.value); + }, + toProto(message: GrantQueueItem): Uint8Array { + return GrantQueueItem.encode(message).finish(); + }, + toProtoMsg(message: GrantQueueItem): GrantQueueItemProtoMsg { + return { + typeUrl: "/cosmos.authz.v1beta1.GrantQueueItem", + value: GrantQueueItem.encode(message).finish() + }; } }; -export const Authorization_ToAmino = (content: Any) => { - switch (content.typeUrl) { - case "/cosmos.authz.v1beta1.GenericAuthorization": - return { - type: "cosmos-sdk/GenericAuthorization", - value: GenericAuthorization.toAmino(GenericAuthorization.decode(content.value)) - }; - case "/cosmos.bank.v1beta1.SendAuthorization": - return { - type: "cosmos-sdk/SendAuthorization", - value: SendAuthorization.toAmino(SendAuthorization.decode(content.value)) - }; - case "/cosmos.staking.v1beta1.StakeAuthorization": - return { - type: "cosmos-sdk/StakeAuthorization", - value: StakeAuthorization.toAmino(StakeAuthorization.decode(content.value)) - }; - default: - return Any.toAmino(content); - } -}; \ No newline at end of file +GlobalDecoderRegistry.register(GrantQueueItem.typeUrl, GrantQueueItem); +GlobalDecoderRegistry.registerAminoProtoMapping(GrantQueueItem.aminoType, GrantQueueItem.typeUrl); \ No newline at end of file diff --git a/packages/osmojs/src/codegen/cosmos/authz/v1beta1/event.ts b/packages/osmojs/src/codegen/cosmos/authz/v1beta1/event.ts index d5579423e..ba364da12 100644 --- a/packages/osmojs/src/codegen/cosmos/authz/v1beta1/event.ts +++ b/packages/osmojs/src/codegen/cosmos/authz/v1beta1/event.ts @@ -1,4 +1,6 @@ import { BinaryReader, BinaryWriter } from "../../../binary"; +import { isSet } from "../../../helpers"; +import { GlobalDecoderRegistry } from "../../../registry"; /** EventGrant is emitted on Msg/Grant */ export interface EventGrant { /** Msg type URL for which an autorization is granted */ @@ -15,11 +17,11 @@ export interface EventGrantProtoMsg { /** EventGrant is emitted on Msg/Grant */ export interface EventGrantAmino { /** Msg type URL for which an autorization is granted */ - msg_type_url: string; + msg_type_url?: string; /** Granter account address */ - granter: string; + granter?: string; /** Grantee account address */ - grantee: string; + grantee?: string; } export interface EventGrantAminoMsg { type: "cosmos-sdk/EventGrant"; @@ -47,11 +49,11 @@ export interface EventRevokeProtoMsg { /** EventRevoke is emitted on Msg/Revoke */ export interface EventRevokeAmino { /** Msg type URL for which an autorization is revoked */ - msg_type_url: string; + msg_type_url?: string; /** Granter account address */ - granter: string; + granter?: string; /** Grantee account address */ - grantee: string; + grantee?: string; } export interface EventRevokeAminoMsg { type: "cosmos-sdk/EventRevoke"; @@ -72,6 +74,16 @@ function createBaseEventGrant(): EventGrant { } export const EventGrant = { typeUrl: "/cosmos.authz.v1beta1.EventGrant", + aminoType: "cosmos-sdk/EventGrant", + is(o: any): o is EventGrant { + return o && (o.$typeUrl === EventGrant.typeUrl || typeof o.msgTypeUrl === "string" && typeof o.granter === "string" && typeof o.grantee === "string"); + }, + isSDK(o: any): o is EventGrantSDKType { + return o && (o.$typeUrl === EventGrant.typeUrl || typeof o.msg_type_url === "string" && typeof o.granter === "string" && typeof o.grantee === "string"); + }, + isAmino(o: any): o is EventGrantAmino { + return o && (o.$typeUrl === EventGrant.typeUrl || typeof o.msg_type_url === "string" && typeof o.granter === "string" && typeof o.grantee === "string"); + }, encode(message: EventGrant, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.msgTypeUrl !== "") { writer.uint32(18).string(message.msgTypeUrl); @@ -107,6 +119,20 @@ export const EventGrant = { } return message; }, + fromJSON(object: any): EventGrant { + return { + 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; + }, fromPartial(object: Partial): EventGrant { const message = createBaseEventGrant(); message.msgTypeUrl = object.msgTypeUrl ?? ""; @@ -115,11 +141,17 @@ export const EventGrant = { return message; }, fromAmino(object: EventGrantAmino): EventGrant { - return { - msgTypeUrl: object.msg_type_url, - granter: object.granter, - grantee: object.grantee - }; + const message = createBaseEventGrant(); + if (object.msg_type_url !== undefined && object.msg_type_url !== null) { + message.msgTypeUrl = object.msg_type_url; + } + if (object.granter !== undefined && object.granter !== null) { + message.granter = object.granter; + } + if (object.grantee !== undefined && object.grantee !== null) { + message.grantee = object.grantee; + } + return message; }, toAmino(message: EventGrant): EventGrantAmino { const obj: any = {}; @@ -150,6 +182,8 @@ export const EventGrant = { }; } }; +GlobalDecoderRegistry.register(EventGrant.typeUrl, EventGrant); +GlobalDecoderRegistry.registerAminoProtoMapping(EventGrant.aminoType, EventGrant.typeUrl); function createBaseEventRevoke(): EventRevoke { return { msgTypeUrl: "", @@ -159,6 +193,16 @@ function createBaseEventRevoke(): EventRevoke { } export const EventRevoke = { typeUrl: "/cosmos.authz.v1beta1.EventRevoke", + aminoType: "cosmos-sdk/EventRevoke", + is(o: any): o is EventRevoke { + return o && (o.$typeUrl === EventRevoke.typeUrl || typeof o.msgTypeUrl === "string" && typeof o.granter === "string" && typeof o.grantee === "string"); + }, + isSDK(o: any): o is EventRevokeSDKType { + return o && (o.$typeUrl === EventRevoke.typeUrl || typeof o.msg_type_url === "string" && typeof o.granter === "string" && typeof o.grantee === "string"); + }, + isAmino(o: any): o is EventRevokeAmino { + return o && (o.$typeUrl === EventRevoke.typeUrl || typeof o.msg_type_url === "string" && typeof o.granter === "string" && typeof o.grantee === "string"); + }, encode(message: EventRevoke, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.msgTypeUrl !== "") { writer.uint32(18).string(message.msgTypeUrl); @@ -194,6 +238,20 @@ export const EventRevoke = { } return message; }, + fromJSON(object: any): EventRevoke { + return { + 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; + }, fromPartial(object: Partial): EventRevoke { const message = createBaseEventRevoke(); message.msgTypeUrl = object.msgTypeUrl ?? ""; @@ -202,11 +260,17 @@ export const EventRevoke = { return message; }, fromAmino(object: EventRevokeAmino): EventRevoke { - return { - msgTypeUrl: object.msg_type_url, - granter: object.granter, - grantee: object.grantee - }; + const message = createBaseEventRevoke(); + if (object.msg_type_url !== undefined && object.msg_type_url !== null) { + message.msgTypeUrl = object.msg_type_url; + } + if (object.granter !== undefined && object.granter !== null) { + message.granter = object.granter; + } + if (object.grantee !== undefined && object.grantee !== null) { + message.grantee = object.grantee; + } + return message; }, toAmino(message: EventRevoke): EventRevokeAmino { const obj: any = {}; @@ -236,4 +300,6 @@ export const EventRevoke = { value: EventRevoke.encode(message).finish() }; } -}; \ No newline at end of file +}; +GlobalDecoderRegistry.register(EventRevoke.typeUrl, EventRevoke); +GlobalDecoderRegistry.registerAminoProtoMapping(EventRevoke.aminoType, EventRevoke.typeUrl); \ No newline at end of file diff --git a/packages/osmojs/src/codegen/cosmos/authz/v1beta1/genesis.ts b/packages/osmojs/src/codegen/cosmos/authz/v1beta1/genesis.ts index d90f2f199..0c98e07da 100644 --- a/packages/osmojs/src/codegen/cosmos/authz/v1beta1/genesis.ts +++ b/packages/osmojs/src/codegen/cosmos/authz/v1beta1/genesis.ts @@ -1,5 +1,6 @@ import { GrantAuthorization, GrantAuthorizationAmino, GrantAuthorizationSDKType } from "./authz"; import { BinaryReader, BinaryWriter } from "../../../binary"; +import { GlobalDecoderRegistry } from "../../../registry"; /** GenesisState defines the authz module's genesis state. */ export interface GenesisState { authorization: GrantAuthorization[]; @@ -27,6 +28,16 @@ function createBaseGenesisState(): GenesisState { } export const GenesisState = { typeUrl: "/cosmos.authz.v1beta1.GenesisState", + aminoType: "cosmos-sdk/GenesisState", + is(o: any): o is GenesisState { + return o && (o.$typeUrl === GenesisState.typeUrl || Array.isArray(o.authorization) && (!o.authorization.length || GrantAuthorization.is(o.authorization[0]))); + }, + isSDK(o: any): o is GenesisStateSDKType { + return o && (o.$typeUrl === GenesisState.typeUrl || Array.isArray(o.authorization) && (!o.authorization.length || GrantAuthorization.isSDK(o.authorization[0]))); + }, + isAmino(o: any): o is GenesisStateAmino { + return o && (o.$typeUrl === GenesisState.typeUrl || Array.isArray(o.authorization) && (!o.authorization.length || GrantAuthorization.isAmino(o.authorization[0]))); + }, encode(message: GenesisState, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.authorization) { GrantAuthorization.encode(v!, writer.uint32(10).fork()).ldelim(); @@ -50,15 +61,29 @@ export const GenesisState = { } return message; }, + fromJSON(object: any): GenesisState { + return { + authorization: Array.isArray(object?.authorization) ? object.authorization.map((e: any) => GrantAuthorization.fromJSON(e)) : [] + }; + }, + toJSON(message: GenesisState): unknown { + const obj: any = {}; + if (message.authorization) { + obj.authorization = message.authorization.map(e => e ? GrantAuthorization.toJSON(e) : undefined); + } else { + obj.authorization = []; + } + return obj; + }, fromPartial(object: Partial): GenesisState { const message = createBaseGenesisState(); message.authorization = object.authorization?.map(e => GrantAuthorization.fromPartial(e)) || []; return message; }, fromAmino(object: GenesisStateAmino): GenesisState { - return { - authorization: Array.isArray(object?.authorization) ? object.authorization.map((e: any) => GrantAuthorization.fromAmino(e)) : [] - }; + const message = createBaseGenesisState(); + message.authorization = object.authorization?.map(e => GrantAuthorization.fromAmino(e)) || []; + return message; }, toAmino(message: GenesisState): GenesisStateAmino { const obj: any = {}; @@ -90,4 +115,6 @@ export const GenesisState = { value: GenesisState.encode(message).finish() }; } -}; \ No newline at end of file +}; +GlobalDecoderRegistry.register(GenesisState.typeUrl, GenesisState); +GlobalDecoderRegistry.registerAminoProtoMapping(GenesisState.aminoType, GenesisState.typeUrl); \ No newline at end of file diff --git a/packages/osmojs/src/codegen/cosmos/authz/v1beta1/query.lcd.ts b/packages/osmojs/src/codegen/cosmos/authz/v1beta1/query.lcd.ts index 815b4f4b6..e5699e320 100644 --- a/packages/osmojs/src/codegen/cosmos/authz/v1beta1/query.lcd.ts +++ b/packages/osmojs/src/codegen/cosmos/authz/v1beta1/query.lcd.ts @@ -33,7 +33,9 @@ export class LCDQueryClient { const endpoint = `cosmos/authz/v1beta1/grants`; return await this.req.get(endpoint, options); } - /* GranterGrants returns list of `Authorization`, granted by granter. */ + /* GranterGrants returns list of `GrantAuthorization`, granted by granter. + + Since: cosmos-sdk 0.46 */ async granterGrants(params: QueryGranterGrantsRequest): Promise { const options: any = { params: {} @@ -44,7 +46,9 @@ export class LCDQueryClient { const endpoint = `cosmos/authz/v1beta1/grants/granter/${params.granter}`; return await this.req.get(endpoint, options); } - /* GranteeGrants returns a list of `GrantAuthorization` by grantee. */ + /* GranteeGrants returns a list of `GrantAuthorization` by grantee. + + Since: cosmos-sdk 0.46 */ async granteeGrants(params: QueryGranteeGrantsRequest): Promise { const options: any = { params: {} diff --git a/packages/osmojs/src/codegen/cosmos/authz/v1beta1/query.rpc.Query.ts b/packages/osmojs/src/codegen/cosmos/authz/v1beta1/query.rpc.Query.ts index 0f191ecf0..f42a05d87 100644 --- a/packages/osmojs/src/codegen/cosmos/authz/v1beta1/query.rpc.Query.ts +++ b/packages/osmojs/src/codegen/cosmos/authz/v1beta1/query.rpc.Query.ts @@ -6,9 +6,17 @@ import { QueryGrantsRequest, QueryGrantsResponse, QueryGranterGrantsRequest, Que export interface Query { /** Returns list of `Authorization`, granted to the grantee by the granter. */ grants(request: QueryGrantsRequest): Promise; - /** GranterGrants returns list of `Authorization`, granted by granter. */ + /** + * GranterGrants returns list of `GrantAuthorization`, granted by granter. + * + * Since: cosmos-sdk 0.46 + */ granterGrants(request: QueryGranterGrantsRequest): Promise; - /** GranteeGrants returns a list of `GrantAuthorization` by grantee. */ + /** + * GranteeGrants returns a list of `GrantAuthorization` by grantee. + * + * Since: cosmos-sdk 0.46 + */ granteeGrants(request: QueryGranteeGrantsRequest): Promise; } export class QueryClientImpl implements Query { diff --git a/packages/osmojs/src/codegen/cosmos/authz/v1beta1/query.ts b/packages/osmojs/src/codegen/cosmos/authz/v1beta1/query.ts index e0a8bfe7d..0eb594e24 100644 --- a/packages/osmojs/src/codegen/cosmos/authz/v1beta1/query.ts +++ b/packages/osmojs/src/codegen/cosmos/authz/v1beta1/query.ts @@ -1,6 +1,8 @@ import { PageRequest, PageRequestAmino, PageRequestSDKType, PageResponse, PageResponseAmino, PageResponseSDKType } from "../../base/query/v1beta1/pagination"; import { Grant, GrantAmino, GrantSDKType, GrantAuthorization, GrantAuthorizationAmino, GrantAuthorizationSDKType } from "./authz"; import { BinaryReader, BinaryWriter } from "../../../binary"; +import { isSet } from "../../../helpers"; +import { GlobalDecoderRegistry } from "../../../registry"; /** QueryGrantsRequest is the request type for the Query/Grants RPC method. */ export interface QueryGrantsRequest { granter: string; @@ -8,7 +10,7 @@ export interface QueryGrantsRequest { /** Optional, msg_type_url, when set, will query only grants matching given msg type. */ msgTypeUrl: string; /** pagination defines an pagination for the request. */ - pagination: PageRequest; + pagination?: PageRequest; } export interface QueryGrantsRequestProtoMsg { typeUrl: "/cosmos.authz.v1beta1.QueryGrantsRequest"; @@ -16,10 +18,10 @@ export interface QueryGrantsRequestProtoMsg { } /** QueryGrantsRequest is the request type for the Query/Grants RPC method. */ export interface QueryGrantsRequestAmino { - granter: string; - grantee: string; + granter?: string; + grantee?: string; /** Optional, msg_type_url, when set, will query only grants matching given msg type. */ - msg_type_url: string; + msg_type_url?: string; /** pagination defines an pagination for the request. */ pagination?: PageRequestAmino; } @@ -32,14 +34,14 @@ export interface QueryGrantsRequestSDKType { granter: string; grantee: string; msg_type_url: string; - pagination: PageRequestSDKType; + pagination?: PageRequestSDKType; } /** 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[]; /** pagination defines an pagination for the response. */ - pagination: PageResponse; + pagination?: PageResponse; } export interface QueryGrantsResponseProtoMsg { typeUrl: "/cosmos.authz.v1beta1.QueryGrantsResponse"; @@ -48,7 +50,7 @@ export interface QueryGrantsResponseProtoMsg { /** QueryGrantsResponse is the response type for the Query/Authorizations RPC method. */ export interface QueryGrantsResponseAmino { /** authorizations is a list of grants granted for grantee by granter. */ - grants: GrantAmino[]; + grants?: GrantAmino[]; /** pagination defines an pagination for the response. */ pagination?: PageResponseAmino; } @@ -59,13 +61,13 @@ export interface QueryGrantsResponseAminoMsg { /** QueryGrantsResponse is the response type for the Query/Authorizations RPC method. */ export interface QueryGrantsResponseSDKType { grants: GrantSDKType[]; - pagination: PageResponseSDKType; + pagination?: PageResponseSDKType; } /** QueryGranterGrantsRequest is the request type for the Query/GranterGrants RPC method. */ export interface QueryGranterGrantsRequest { granter: string; /** pagination defines an pagination for the request. */ - pagination: PageRequest; + pagination?: PageRequest; } export interface QueryGranterGrantsRequestProtoMsg { typeUrl: "/cosmos.authz.v1beta1.QueryGranterGrantsRequest"; @@ -73,7 +75,7 @@ export interface QueryGranterGrantsRequestProtoMsg { } /** QueryGranterGrantsRequest is the request type for the Query/GranterGrants RPC method. */ export interface QueryGranterGrantsRequestAmino { - granter: string; + granter?: string; /** pagination defines an pagination for the request. */ pagination?: PageRequestAmino; } @@ -84,14 +86,14 @@ export interface QueryGranterGrantsRequestAminoMsg { /** QueryGranterGrantsRequest is the request type for the Query/GranterGrants RPC method. */ export interface QueryGranterGrantsRequestSDKType { granter: string; - pagination: PageRequestSDKType; + pagination?: PageRequestSDKType; } /** 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[]; /** pagination defines an pagination for the response. */ - pagination: PageResponse; + pagination?: PageResponse; } export interface QueryGranterGrantsResponseProtoMsg { typeUrl: "/cosmos.authz.v1beta1.QueryGranterGrantsResponse"; @@ -100,7 +102,7 @@ export interface QueryGranterGrantsResponseProtoMsg { /** QueryGranterGrantsResponse is the response type for the Query/GranterGrants RPC method. */ export interface QueryGranterGrantsResponseAmino { /** grants is a list of grants granted by the granter. */ - grants: GrantAuthorizationAmino[]; + grants?: GrantAuthorizationAmino[]; /** pagination defines an pagination for the response. */ pagination?: PageResponseAmino; } @@ -111,13 +113,13 @@ export interface QueryGranterGrantsResponseAminoMsg { /** QueryGranterGrantsResponse is the response type for the Query/GranterGrants RPC method. */ export interface QueryGranterGrantsResponseSDKType { grants: GrantAuthorizationSDKType[]; - pagination: PageResponseSDKType; + pagination?: PageResponseSDKType; } /** QueryGranteeGrantsRequest is the request type for the Query/IssuedGrants RPC method. */ export interface QueryGranteeGrantsRequest { grantee: string; /** pagination defines an pagination for the request. */ - pagination: PageRequest; + pagination?: PageRequest; } export interface QueryGranteeGrantsRequestProtoMsg { typeUrl: "/cosmos.authz.v1beta1.QueryGranteeGrantsRequest"; @@ -125,7 +127,7 @@ export interface QueryGranteeGrantsRequestProtoMsg { } /** QueryGranteeGrantsRequest is the request type for the Query/IssuedGrants RPC method. */ export interface QueryGranteeGrantsRequestAmino { - grantee: string; + grantee?: string; /** pagination defines an pagination for the request. */ pagination?: PageRequestAmino; } @@ -136,14 +138,14 @@ export interface QueryGranteeGrantsRequestAminoMsg { /** QueryGranteeGrantsRequest is the request type for the Query/IssuedGrants RPC method. */ export interface QueryGranteeGrantsRequestSDKType { grantee: string; - pagination: PageRequestSDKType; + pagination?: PageRequestSDKType; } /** 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[]; /** pagination defines an pagination for the response. */ - pagination: PageResponse; + pagination?: PageResponse; } export interface QueryGranteeGrantsResponseProtoMsg { typeUrl: "/cosmos.authz.v1beta1.QueryGranteeGrantsResponse"; @@ -152,7 +154,7 @@ export interface QueryGranteeGrantsResponseProtoMsg { /** QueryGranteeGrantsResponse is the response type for the Query/GranteeGrants RPC method. */ export interface QueryGranteeGrantsResponseAmino { /** grants is a list of grants granted to the grantee. */ - grants: GrantAuthorizationAmino[]; + grants?: GrantAuthorizationAmino[]; /** pagination defines an pagination for the response. */ pagination?: PageResponseAmino; } @@ -163,18 +165,28 @@ export interface QueryGranteeGrantsResponseAminoMsg { /** QueryGranteeGrantsResponse is the response type for the Query/GranteeGrants RPC method. */ export interface QueryGranteeGrantsResponseSDKType { grants: GrantAuthorizationSDKType[]; - pagination: PageResponseSDKType; + pagination?: PageResponseSDKType; } function createBaseQueryGrantsRequest(): QueryGrantsRequest { return { granter: "", grantee: "", msgTypeUrl: "", - pagination: PageRequest.fromPartial({}) + pagination: undefined }; } export const QueryGrantsRequest = { typeUrl: "/cosmos.authz.v1beta1.QueryGrantsRequest", + aminoType: "cosmos-sdk/QueryGrantsRequest", + is(o: any): o is QueryGrantsRequest { + return o && (o.$typeUrl === QueryGrantsRequest.typeUrl || typeof o.granter === "string" && typeof o.grantee === "string" && typeof o.msgTypeUrl === "string"); + }, + isSDK(o: any): o is QueryGrantsRequestSDKType { + return o && (o.$typeUrl === QueryGrantsRequest.typeUrl || typeof o.granter === "string" && typeof o.grantee === "string" && typeof o.msg_type_url === "string"); + }, + isAmino(o: any): o is QueryGrantsRequestAmino { + return o && (o.$typeUrl === QueryGrantsRequest.typeUrl || typeof o.granter === "string" && typeof o.grantee === "string" && typeof o.msg_type_url === "string"); + }, encode(message: QueryGrantsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.granter !== "") { writer.uint32(10).string(message.granter); @@ -216,6 +228,22 @@ export const QueryGrantsRequest = { } return message; }, + fromJSON(object: any): QueryGrantsRequest { + return { + 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 + }; + }, + 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); + message.pagination !== undefined && (obj.pagination = message.pagination ? PageRequest.toJSON(message.pagination) : undefined); + return obj; + }, fromPartial(object: Partial): QueryGrantsRequest { const message = createBaseQueryGrantsRequest(); message.granter = object.granter ?? ""; @@ -225,12 +253,20 @@ export const QueryGrantsRequest = { return message; }, fromAmino(object: QueryGrantsRequestAmino): QueryGrantsRequest { - return { - granter: object.granter, - grantee: object.grantee, - msgTypeUrl: object.msg_type_url, - pagination: object?.pagination ? PageRequest.fromAmino(object.pagination) : undefined - }; + const message = createBaseQueryGrantsRequest(); + if (object.granter !== undefined && object.granter !== null) { + message.granter = object.granter; + } + if (object.grantee !== undefined && object.grantee !== null) { + message.grantee = object.grantee; + } + if (object.msg_type_url !== undefined && object.msg_type_url !== null) { + message.msgTypeUrl = object.msg_type_url; + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromAmino(object.pagination); + } + return message; }, toAmino(message: QueryGrantsRequest): QueryGrantsRequestAmino { const obj: any = {}; @@ -262,14 +298,26 @@ export const QueryGrantsRequest = { }; } }; +GlobalDecoderRegistry.register(QueryGrantsRequest.typeUrl, QueryGrantsRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryGrantsRequest.aminoType, QueryGrantsRequest.typeUrl); function createBaseQueryGrantsResponse(): QueryGrantsResponse { return { grants: [], - pagination: PageResponse.fromPartial({}) + pagination: undefined }; } export const QueryGrantsResponse = { typeUrl: "/cosmos.authz.v1beta1.QueryGrantsResponse", + aminoType: "cosmos-sdk/QueryGrantsResponse", + is(o: any): o is QueryGrantsResponse { + return o && (o.$typeUrl === QueryGrantsResponse.typeUrl || Array.isArray(o.grants) && (!o.grants.length || Grant.is(o.grants[0]))); + }, + isSDK(o: any): o is QueryGrantsResponseSDKType { + return o && (o.$typeUrl === QueryGrantsResponse.typeUrl || Array.isArray(o.grants) && (!o.grants.length || Grant.isSDK(o.grants[0]))); + }, + isAmino(o: any): o is QueryGrantsResponseAmino { + return o && (o.$typeUrl === QueryGrantsResponse.typeUrl || Array.isArray(o.grants) && (!o.grants.length || Grant.isAmino(o.grants[0]))); + }, encode(message: QueryGrantsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.grants) { Grant.encode(v!, writer.uint32(10).fork()).ldelim(); @@ -299,6 +347,22 @@ export const QueryGrantsResponse = { } 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 + }; + }, + toJSON(message: QueryGrantsResponse): unknown { + const obj: any = {}; + if (message.grants) { + obj.grants = message.grants.map(e => e ? Grant.toJSON(e) : undefined); + } else { + obj.grants = []; + } + message.pagination !== undefined && (obj.pagination = message.pagination ? PageResponse.toJSON(message.pagination) : undefined); + return obj; + }, fromPartial(object: Partial): QueryGrantsResponse { const message = createBaseQueryGrantsResponse(); message.grants = object.grants?.map(e => Grant.fromPartial(e)) || []; @@ -306,10 +370,12 @@ export const QueryGrantsResponse = { return message; }, fromAmino(object: QueryGrantsResponseAmino): QueryGrantsResponse { - return { - grants: Array.isArray(object?.grants) ? object.grants.map((e: any) => Grant.fromAmino(e)) : [], - pagination: object?.pagination ? PageResponse.fromAmino(object.pagination) : undefined - }; + const message = createBaseQueryGrantsResponse(); + message.grants = object.grants?.map(e => Grant.fromAmino(e)) || []; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromAmino(object.pagination); + } + return message; }, toAmino(message: QueryGrantsResponse): QueryGrantsResponseAmino { const obj: any = {}; @@ -343,14 +409,26 @@ export const QueryGrantsResponse = { }; } }; +GlobalDecoderRegistry.register(QueryGrantsResponse.typeUrl, QueryGrantsResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryGrantsResponse.aminoType, QueryGrantsResponse.typeUrl); function createBaseQueryGranterGrantsRequest(): QueryGranterGrantsRequest { return { granter: "", - pagination: PageRequest.fromPartial({}) + pagination: undefined }; } export const QueryGranterGrantsRequest = { typeUrl: "/cosmos.authz.v1beta1.QueryGranterGrantsRequest", + aminoType: "cosmos-sdk/QueryGranterGrantsRequest", + is(o: any): o is QueryGranterGrantsRequest { + return o && (o.$typeUrl === QueryGranterGrantsRequest.typeUrl || typeof o.granter === "string"); + }, + isSDK(o: any): o is QueryGranterGrantsRequestSDKType { + return o && (o.$typeUrl === QueryGranterGrantsRequest.typeUrl || typeof o.granter === "string"); + }, + isAmino(o: any): o is QueryGranterGrantsRequestAmino { + return o && (o.$typeUrl === QueryGranterGrantsRequest.typeUrl || typeof o.granter === "string"); + }, encode(message: QueryGranterGrantsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.granter !== "") { writer.uint32(10).string(message.granter); @@ -380,6 +458,18 @@ export const QueryGranterGrantsRequest = { } return message; }, + fromJSON(object: any): QueryGranterGrantsRequest { + return { + granter: isSet(object.granter) ? String(object.granter) : "", + pagination: isSet(object.pagination) ? PageRequest.fromJSON(object.pagination) : undefined + }; + }, + toJSON(message: QueryGranterGrantsRequest): unknown { + const obj: any = {}; + message.granter !== undefined && (obj.granter = message.granter); + message.pagination !== undefined && (obj.pagination = message.pagination ? PageRequest.toJSON(message.pagination) : undefined); + return obj; + }, fromPartial(object: Partial): QueryGranterGrantsRequest { const message = createBaseQueryGranterGrantsRequest(); message.granter = object.granter ?? ""; @@ -387,10 +477,14 @@ export const QueryGranterGrantsRequest = { return message; }, fromAmino(object: QueryGranterGrantsRequestAmino): QueryGranterGrantsRequest { - return { - granter: object.granter, - pagination: object?.pagination ? PageRequest.fromAmino(object.pagination) : undefined - }; + const message = createBaseQueryGranterGrantsRequest(); + if (object.granter !== undefined && object.granter !== null) { + message.granter = object.granter; + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromAmino(object.pagination); + } + return message; }, toAmino(message: QueryGranterGrantsRequest): QueryGranterGrantsRequestAmino { const obj: any = {}; @@ -420,14 +514,26 @@ export const QueryGranterGrantsRequest = { }; } }; +GlobalDecoderRegistry.register(QueryGranterGrantsRequest.typeUrl, QueryGranterGrantsRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryGranterGrantsRequest.aminoType, QueryGranterGrantsRequest.typeUrl); function createBaseQueryGranterGrantsResponse(): QueryGranterGrantsResponse { return { grants: [], - pagination: PageResponse.fromPartial({}) + pagination: undefined }; } export const QueryGranterGrantsResponse = { typeUrl: "/cosmos.authz.v1beta1.QueryGranterGrantsResponse", + aminoType: "cosmos-sdk/QueryGranterGrantsResponse", + is(o: any): o is QueryGranterGrantsResponse { + return o && (o.$typeUrl === QueryGranterGrantsResponse.typeUrl || Array.isArray(o.grants) && (!o.grants.length || GrantAuthorization.is(o.grants[0]))); + }, + isSDK(o: any): o is QueryGranterGrantsResponseSDKType { + return o && (o.$typeUrl === QueryGranterGrantsResponse.typeUrl || Array.isArray(o.grants) && (!o.grants.length || GrantAuthorization.isSDK(o.grants[0]))); + }, + isAmino(o: any): o is QueryGranterGrantsResponseAmino { + return o && (o.$typeUrl === QueryGranterGrantsResponse.typeUrl || Array.isArray(o.grants) && (!o.grants.length || GrantAuthorization.isAmino(o.grants[0]))); + }, encode(message: QueryGranterGrantsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.grants) { GrantAuthorization.encode(v!, writer.uint32(10).fork()).ldelim(); @@ -457,6 +563,22 @@ export const QueryGranterGrantsResponse = { } 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 + }; + }, + toJSON(message: QueryGranterGrantsResponse): unknown { + const obj: any = {}; + if (message.grants) { + obj.grants = message.grants.map(e => e ? GrantAuthorization.toJSON(e) : undefined); + } else { + obj.grants = []; + } + message.pagination !== undefined && (obj.pagination = message.pagination ? PageResponse.toJSON(message.pagination) : undefined); + return obj; + }, fromPartial(object: Partial): QueryGranterGrantsResponse { const message = createBaseQueryGranterGrantsResponse(); message.grants = object.grants?.map(e => GrantAuthorization.fromPartial(e)) || []; @@ -464,10 +586,12 @@ export const QueryGranterGrantsResponse = { return message; }, fromAmino(object: QueryGranterGrantsResponseAmino): QueryGranterGrantsResponse { - return { - grants: Array.isArray(object?.grants) ? object.grants.map((e: any) => GrantAuthorization.fromAmino(e)) : [], - pagination: object?.pagination ? PageResponse.fromAmino(object.pagination) : undefined - }; + const message = createBaseQueryGranterGrantsResponse(); + message.grants = object.grants?.map(e => GrantAuthorization.fromAmino(e)) || []; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromAmino(object.pagination); + } + return message; }, toAmino(message: QueryGranterGrantsResponse): QueryGranterGrantsResponseAmino { const obj: any = {}; @@ -501,14 +625,26 @@ export const QueryGranterGrantsResponse = { }; } }; +GlobalDecoderRegistry.register(QueryGranterGrantsResponse.typeUrl, QueryGranterGrantsResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryGranterGrantsResponse.aminoType, QueryGranterGrantsResponse.typeUrl); function createBaseQueryGranteeGrantsRequest(): QueryGranteeGrantsRequest { return { grantee: "", - pagination: PageRequest.fromPartial({}) + pagination: undefined }; } export const QueryGranteeGrantsRequest = { typeUrl: "/cosmos.authz.v1beta1.QueryGranteeGrantsRequest", + aminoType: "cosmos-sdk/QueryGranteeGrantsRequest", + is(o: any): o is QueryGranteeGrantsRequest { + return o && (o.$typeUrl === QueryGranteeGrantsRequest.typeUrl || typeof o.grantee === "string"); + }, + isSDK(o: any): o is QueryGranteeGrantsRequestSDKType { + return o && (o.$typeUrl === QueryGranteeGrantsRequest.typeUrl || typeof o.grantee === "string"); + }, + isAmino(o: any): o is QueryGranteeGrantsRequestAmino { + return o && (o.$typeUrl === QueryGranteeGrantsRequest.typeUrl || typeof o.grantee === "string"); + }, encode(message: QueryGranteeGrantsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.grantee !== "") { writer.uint32(10).string(message.grantee); @@ -538,6 +674,18 @@ export const QueryGranteeGrantsRequest = { } return message; }, + fromJSON(object: any): QueryGranteeGrantsRequest { + return { + grantee: isSet(object.grantee) ? String(object.grantee) : "", + pagination: isSet(object.pagination) ? PageRequest.fromJSON(object.pagination) : undefined + }; + }, + toJSON(message: QueryGranteeGrantsRequest): unknown { + const obj: any = {}; + message.grantee !== undefined && (obj.grantee = message.grantee); + message.pagination !== undefined && (obj.pagination = message.pagination ? PageRequest.toJSON(message.pagination) : undefined); + return obj; + }, fromPartial(object: Partial): QueryGranteeGrantsRequest { const message = createBaseQueryGranteeGrantsRequest(); message.grantee = object.grantee ?? ""; @@ -545,10 +693,14 @@ export const QueryGranteeGrantsRequest = { return message; }, fromAmino(object: QueryGranteeGrantsRequestAmino): QueryGranteeGrantsRequest { - return { - grantee: object.grantee, - pagination: object?.pagination ? PageRequest.fromAmino(object.pagination) : undefined - }; + const message = createBaseQueryGranteeGrantsRequest(); + if (object.grantee !== undefined && object.grantee !== null) { + message.grantee = object.grantee; + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromAmino(object.pagination); + } + return message; }, toAmino(message: QueryGranteeGrantsRequest): QueryGranteeGrantsRequestAmino { const obj: any = {}; @@ -578,14 +730,26 @@ export const QueryGranteeGrantsRequest = { }; } }; +GlobalDecoderRegistry.register(QueryGranteeGrantsRequest.typeUrl, QueryGranteeGrantsRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryGranteeGrantsRequest.aminoType, QueryGranteeGrantsRequest.typeUrl); function createBaseQueryGranteeGrantsResponse(): QueryGranteeGrantsResponse { return { grants: [], - pagination: PageResponse.fromPartial({}) + pagination: undefined }; } export const QueryGranteeGrantsResponse = { typeUrl: "/cosmos.authz.v1beta1.QueryGranteeGrantsResponse", + aminoType: "cosmos-sdk/QueryGranteeGrantsResponse", + is(o: any): o is QueryGranteeGrantsResponse { + return o && (o.$typeUrl === QueryGranteeGrantsResponse.typeUrl || Array.isArray(o.grants) && (!o.grants.length || GrantAuthorization.is(o.grants[0]))); + }, + isSDK(o: any): o is QueryGranteeGrantsResponseSDKType { + return o && (o.$typeUrl === QueryGranteeGrantsResponse.typeUrl || Array.isArray(o.grants) && (!o.grants.length || GrantAuthorization.isSDK(o.grants[0]))); + }, + isAmino(o: any): o is QueryGranteeGrantsResponseAmino { + return o && (o.$typeUrl === QueryGranteeGrantsResponse.typeUrl || Array.isArray(o.grants) && (!o.grants.length || GrantAuthorization.isAmino(o.grants[0]))); + }, encode(message: QueryGranteeGrantsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.grants) { GrantAuthorization.encode(v!, writer.uint32(10).fork()).ldelim(); @@ -615,6 +779,22 @@ export const QueryGranteeGrantsResponse = { } 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 + }; + }, + toJSON(message: QueryGranteeGrantsResponse): unknown { + const obj: any = {}; + if (message.grants) { + obj.grants = message.grants.map(e => e ? GrantAuthorization.toJSON(e) : undefined); + } else { + obj.grants = []; + } + message.pagination !== undefined && (obj.pagination = message.pagination ? PageResponse.toJSON(message.pagination) : undefined); + return obj; + }, fromPartial(object: Partial): QueryGranteeGrantsResponse { const message = createBaseQueryGranteeGrantsResponse(); message.grants = object.grants?.map(e => GrantAuthorization.fromPartial(e)) || []; @@ -622,10 +802,12 @@ export const QueryGranteeGrantsResponse = { return message; }, fromAmino(object: QueryGranteeGrantsResponseAmino): QueryGranteeGrantsResponse { - return { - grants: Array.isArray(object?.grants) ? object.grants.map((e: any) => GrantAuthorization.fromAmino(e)) : [], - pagination: object?.pagination ? PageResponse.fromAmino(object.pagination) : undefined - }; + const message = createBaseQueryGranteeGrantsResponse(); + message.grants = object.grants?.map(e => GrantAuthorization.fromAmino(e)) || []; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromAmino(object.pagination); + } + return message; }, toAmino(message: QueryGranteeGrantsResponse): QueryGranteeGrantsResponseAmino { const obj: any = {}; @@ -658,4 +840,6 @@ export const QueryGranteeGrantsResponse = { value: QueryGranteeGrantsResponse.encode(message).finish() }; } -}; \ No newline at end of file +}; +GlobalDecoderRegistry.register(QueryGranteeGrantsResponse.typeUrl, QueryGranteeGrantsResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryGranteeGrantsResponse.aminoType, QueryGranteeGrantsResponse.typeUrl); \ No newline at end of file diff --git a/packages/osmojs/src/codegen/cosmos/authz/v1beta1/tx.registry.ts b/packages/osmojs/src/codegen/cosmos/authz/v1beta1/tx.registry.ts index bdcdde874..c9004e628 100644 --- a/packages/osmojs/src/codegen/cosmos/authz/v1beta1/tx.registry.ts +++ b/packages/osmojs/src/codegen/cosmos/authz/v1beta1/tx.registry.ts @@ -48,6 +48,46 @@ export const MessageComposer = { }; } }, + toJSON: { + grant(value: MsgGrant) { + return { + typeUrl: "/cosmos.authz.v1beta1.MsgGrant", + value: MsgGrant.toJSON(value) + }; + }, + exec(value: MsgExec) { + return { + typeUrl: "/cosmos.authz.v1beta1.MsgExec", + value: MsgExec.toJSON(value) + }; + }, + revoke(value: MsgRevoke) { + return { + typeUrl: "/cosmos.authz.v1beta1.MsgRevoke", + value: MsgRevoke.toJSON(value) + }; + } + }, + fromJSON: { + grant(value: any) { + return { + typeUrl: "/cosmos.authz.v1beta1.MsgGrant", + value: MsgGrant.fromJSON(value) + }; + }, + exec(value: any) { + return { + typeUrl: "/cosmos.authz.v1beta1.MsgExec", + value: MsgExec.fromJSON(value) + }; + }, + revoke(value: any) { + return { + typeUrl: "/cosmos.authz.v1beta1.MsgRevoke", + value: MsgRevoke.fromJSON(value) + }; + } + }, fromPartial: { grant(value: MsgGrant) { return { diff --git a/packages/osmojs/src/codegen/cosmos/authz/v1beta1/tx.rpc.msg.ts b/packages/osmojs/src/codegen/cosmos/authz/v1beta1/tx.rpc.msg.ts index 4f5bb4ee1..29485d422 100644 --- a/packages/osmojs/src/codegen/cosmos/authz/v1beta1/tx.rpc.msg.ts +++ b/packages/osmojs/src/codegen/cosmos/authz/v1beta1/tx.rpc.msg.ts @@ -45,4 +45,7 @@ export class MsgClientImpl implements Msg { const promise = this.rpc.request("cosmos.authz.v1beta1.Msg", "Revoke", data); return promise.then(data => MsgRevokeResponse.decode(new BinaryReader(data))); } -} \ No newline at end of file +} +export const createClientImpl = (rpc: Rpc) => { + return new MsgClientImpl(rpc); +}; \ No newline at end of file diff --git a/packages/osmojs/src/codegen/cosmos/authz/v1beta1/tx.ts b/packages/osmojs/src/codegen/cosmos/authz/v1beta1/tx.ts index 1bb275fab..fa3eb84cb 100644 --- a/packages/osmojs/src/codegen/cosmos/authz/v1beta1/tx.ts +++ b/packages/osmojs/src/codegen/cosmos/authz/v1beta1/tx.ts @@ -1,6 +1,8 @@ import { Grant, GrantAmino, GrantSDKType } from "./authz"; import { Any, AnyProtoMsg, AnyAmino, AnySDKType } from "../../../google/protobuf/any"; import { BinaryReader, BinaryWriter } from "../../../binary"; +import { isSet, bytesFromBase64, base64FromBytes } from "../../../helpers"; +import { GlobalDecoderRegistry } from "../../../registry"; /** * MsgGrant is a request type for Grant method. It declares authorization to the grantee * on behalf of the granter with the provided expiration time. @@ -19,9 +21,9 @@ export interface MsgGrantProtoMsg { * on behalf of the granter with the provided expiration time. */ export interface MsgGrantAmino { - granter: string; - grantee: string; - grant?: GrantAmino; + granter?: string; + grantee?: string; + grant: GrantAmino; } export interface MsgGrantAminoMsg { type: "cosmos-sdk/MsgGrant"; @@ -46,7 +48,7 @@ export interface MsgExecResponseProtoMsg { } /** MsgExecResponse defines the Msg/MsgExecResponse response type. */ export interface MsgExecResponseAmino { - results: Uint8Array[]; + results?: string[]; } export interface MsgExecResponseAminoMsg { type: "cosmos-sdk/MsgExecResponse"; @@ -64,7 +66,7 @@ export interface MsgExecResponseSDKType { export interface MsgExec { grantee: string; /** - * Authorization Msg requests to execute. Each msg must implement Authorization interface + * Execute Msg. * The x/authz will try to find a grant matching (msg.signers[0], grantee, MsgTypeURL(msg)) * triple and validate it. */ @@ -76,7 +78,7 @@ export interface MsgExecProtoMsg { } export type MsgExecEncoded = Omit & { /** - * Authorization Msg requests to execute. Each msg must implement Authorization interface + * Execute Msg. * The x/authz will try to find a grant matching (msg.signers[0], grantee, MsgTypeURL(msg)) * triple and validate it. */ @@ -88,13 +90,13 @@ export type MsgExecEncoded = Omit & { * one signer corresponding to the granter of the authorization. */ export interface MsgExecAmino { - grantee: string; + grantee?: string; /** - * Authorization Msg requests to execute. Each msg must implement Authorization interface + * Execute Msg. * The x/authz will try to find a grant matching (msg.signers[0], grantee, MsgTypeURL(msg)) * triple and validate it. */ - msgs: AnyAmino[]; + msgs?: AnyAmino[]; } export interface MsgExecAminoMsg { type: "cosmos-sdk/MsgExec"; @@ -141,9 +143,9 @@ export interface MsgRevokeProtoMsg { * granter's account with that has been granted to the grantee. */ export interface MsgRevokeAmino { - granter: string; - grantee: string; - msg_type_url: string; + granter?: string; + grantee?: string; + msg_type_url?: string; } export interface MsgRevokeAminoMsg { type: "cosmos-sdk/MsgRevoke"; @@ -181,6 +183,16 @@ function createBaseMsgGrant(): MsgGrant { } export const MsgGrant = { typeUrl: "/cosmos.authz.v1beta1.MsgGrant", + aminoType: "cosmos-sdk/MsgGrant", + is(o: any): o is MsgGrant { + return o && (o.$typeUrl === MsgGrant.typeUrl || typeof o.granter === "string" && typeof o.grantee === "string" && Grant.is(o.grant)); + }, + isSDK(o: any): o is MsgGrantSDKType { + return o && (o.$typeUrl === MsgGrant.typeUrl || typeof o.granter === "string" && typeof o.grantee === "string" && Grant.isSDK(o.grant)); + }, + isAmino(o: any): o is MsgGrantAmino { + return o && (o.$typeUrl === MsgGrant.typeUrl || typeof o.granter === "string" && typeof o.grantee === "string" && Grant.isAmino(o.grant)); + }, encode(message: MsgGrant, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.granter !== "") { writer.uint32(10).string(message.granter); @@ -216,6 +228,20 @@ export const MsgGrant = { } return message; }, + fromJSON(object: any): MsgGrant { + return { + 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; + }, fromPartial(object: Partial): MsgGrant { const message = createBaseMsgGrant(); message.granter = object.granter ?? ""; @@ -224,17 +250,23 @@ export const MsgGrant = { return message; }, fromAmino(object: MsgGrantAmino): MsgGrant { - return { - granter: object.granter, - grantee: object.grantee, - grant: object?.grant ? Grant.fromAmino(object.grant) : undefined - }; + const message = createBaseMsgGrant(); + if (object.granter !== undefined && object.granter !== null) { + message.granter = object.granter; + } + if (object.grantee !== undefined && object.grantee !== null) { + message.grantee = object.grantee; + } + if (object.grant !== undefined && object.grant !== null) { + message.grant = Grant.fromAmino(object.grant); + } + return message; }, toAmino(message: MsgGrant): MsgGrantAmino { const obj: any = {}; obj.granter = message.granter; obj.grantee = message.grantee; - obj.grant = message.grant ? Grant.toAmino(message.grant) : undefined; + obj.grant = message.grant ? Grant.toAmino(message.grant) : Grant.fromPartial({}); return obj; }, fromAminoMsg(object: MsgGrantAminoMsg): MsgGrant { @@ -259,6 +291,8 @@ export const MsgGrant = { }; } }; +GlobalDecoderRegistry.register(MsgGrant.typeUrl, MsgGrant); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgGrant.aminoType, MsgGrant.typeUrl); function createBaseMsgExecResponse(): MsgExecResponse { return { results: [] @@ -266,6 +300,16 @@ function createBaseMsgExecResponse(): MsgExecResponse { } export const MsgExecResponse = { typeUrl: "/cosmos.authz.v1beta1.MsgExecResponse", + aminoType: "cosmos-sdk/MsgExecResponse", + is(o: any): o is MsgExecResponse { + return o && (o.$typeUrl === MsgExecResponse.typeUrl || Array.isArray(o.results) && (!o.results.length || o.results[0] instanceof Uint8Array || typeof o.results[0] === "string")); + }, + isSDK(o: any): o is MsgExecResponseSDKType { + return o && (o.$typeUrl === MsgExecResponse.typeUrl || Array.isArray(o.results) && (!o.results.length || o.results[0] instanceof Uint8Array || typeof o.results[0] === "string")); + }, + isAmino(o: any): o is MsgExecResponseAmino { + return o && (o.$typeUrl === MsgExecResponse.typeUrl || Array.isArray(o.results) && (!o.results.length || o.results[0] instanceof Uint8Array || typeof o.results[0] === "string")); + }, encode(message: MsgExecResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.results) { writer.uint32(10).bytes(v!); @@ -289,20 +333,34 @@ export const MsgExecResponse = { } return message; }, + fromJSON(object: any): MsgExecResponse { + return { + results: Array.isArray(object?.results) ? object.results.map((e: any) => bytesFromBase64(e)) : [] + }; + }, + toJSON(message: MsgExecResponse): unknown { + const obj: any = {}; + if (message.results) { + obj.results = message.results.map(e => base64FromBytes(e !== undefined ? e : new Uint8Array())); + } else { + obj.results = []; + } + return obj; + }, fromPartial(object: Partial): MsgExecResponse { const message = createBaseMsgExecResponse(); message.results = object.results?.map(e => e) || []; return message; }, fromAmino(object: MsgExecResponseAmino): MsgExecResponse { - return { - results: Array.isArray(object?.results) ? object.results.map((e: any) => e) : [] - }; + const message = createBaseMsgExecResponse(); + message.results = object.results?.map(e => bytesFromBase64(e)) || []; + return message; }, toAmino(message: MsgExecResponse): MsgExecResponseAmino { const obj: any = {}; if (message.results) { - obj.results = message.results.map(e => e); + obj.results = message.results.map(e => base64FromBytes(e)); } else { obj.results = []; } @@ -330,6 +388,8 @@ export const MsgExecResponse = { }; } }; +GlobalDecoderRegistry.register(MsgExecResponse.typeUrl, MsgExecResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgExecResponse.aminoType, MsgExecResponse.typeUrl); function createBaseMsgExec(): MsgExec { return { grantee: "", @@ -338,12 +398,22 @@ function createBaseMsgExec(): MsgExec { } export const MsgExec = { typeUrl: "/cosmos.authz.v1beta1.MsgExec", + aminoType: "cosmos-sdk/MsgExec", + is(o: any): o is MsgExec { + return o && (o.$typeUrl === MsgExec.typeUrl || typeof o.grantee === "string" && Array.isArray(o.msgs) && (!o.msgs.length || Any.is(o.msgs[0]))); + }, + isSDK(o: any): o is MsgExecSDKType { + return o && (o.$typeUrl === MsgExec.typeUrl || typeof o.grantee === "string" && Array.isArray(o.msgs) && (!o.msgs.length || Any.isSDK(o.msgs[0]))); + }, + isAmino(o: any): o is MsgExecAmino { + return o && (o.$typeUrl === MsgExec.typeUrl || typeof o.grantee === "string" && Array.isArray(o.msgs) && (!o.msgs.length || Any.isAmino(o.msgs[0]))); + }, encode(message: MsgExec, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.grantee !== "") { writer.uint32(10).string(message.grantee); } for (const v of message.msgs) { - Any.encode((v! as Any), writer.uint32(18).fork()).ldelim(); + Any.encode(GlobalDecoderRegistry.wrapAny(v!), writer.uint32(18).fork()).ldelim(); } return writer; }, @@ -358,7 +428,7 @@ export const MsgExec = { message.grantee = reader.string(); break; case 2: - message.msgs.push((Sdk_MsgauthzAuthorization_InterfaceDecoder(reader) as Any)); + message.msgs.push(GlobalDecoderRegistry.unwrapAny(reader)); break; default: reader.skipType(tag & 7); @@ -367,23 +437,41 @@ export const MsgExec = { } return message; }, + fromJSON(object: any): MsgExec { + return { + grantee: isSet(object.grantee) ? String(object.grantee) : "", + msgs: Array.isArray(object?.msgs) ? object.msgs.map((e: any) => GlobalDecoderRegistry.fromJSON(e)) : [] + }; + }, + toJSON(message: MsgExec): unknown { + const obj: any = {}; + message.grantee !== undefined && (obj.grantee = message.grantee); + if (message.msgs) { + obj.msgs = message.msgs.map(e => e ? GlobalDecoderRegistry.toJSON(e) : undefined); + } else { + obj.msgs = []; + } + return obj; + }, fromPartial(object: Partial): MsgExec { const message = createBaseMsgExec(); message.grantee = object.grantee ?? ""; - message.msgs = object.msgs?.map(e => Any.fromPartial(e)) || []; + message.msgs = object.msgs?.map(e => (Any.fromPartial(e) as any)) || []; return message; }, fromAmino(object: MsgExecAmino): MsgExec { - return { - grantee: object.grantee, - msgs: Array.isArray(object?.msgs) ? object.msgs.map((e: any) => Sdk_MsgauthzAuthorization_FromAmino(e)) : [] - }; + const message = createBaseMsgExec(); + if (object.grantee !== undefined && object.grantee !== null) { + message.grantee = object.grantee; + } + message.msgs = object.msgs?.map(e => GlobalDecoderRegistry.fromAminoMsg(e)) || []; + return message; }, toAmino(message: MsgExec): MsgExecAmino { const obj: any = {}; obj.grantee = message.grantee; if (message.msgs) { - obj.msgs = message.msgs.map(e => e ? Sdk_MsgauthzAuthorization_ToAmino((e as Any)) : undefined); + obj.msgs = message.msgs.map(e => e ? GlobalDecoderRegistry.toAminoMsg(e) : undefined); } else { obj.msgs = []; } @@ -411,11 +499,23 @@ export const MsgExec = { }; } }; +GlobalDecoderRegistry.register(MsgExec.typeUrl, MsgExec); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgExec.aminoType, MsgExec.typeUrl); function createBaseMsgGrantResponse(): MsgGrantResponse { return {}; } export const MsgGrantResponse = { typeUrl: "/cosmos.authz.v1beta1.MsgGrantResponse", + aminoType: "cosmos-sdk/MsgGrantResponse", + is(o: any): o is MsgGrantResponse { + return o && o.$typeUrl === MsgGrantResponse.typeUrl; + }, + isSDK(o: any): o is MsgGrantResponseSDKType { + return o && o.$typeUrl === MsgGrantResponse.typeUrl; + }, + isAmino(o: any): o is MsgGrantResponseAmino { + return o && o.$typeUrl === MsgGrantResponse.typeUrl; + }, encode(_: MsgGrantResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, @@ -433,12 +533,20 @@ export const MsgGrantResponse = { } return message; }, + fromJSON(_: any): MsgGrantResponse { + return {}; + }, + toJSON(_: MsgGrantResponse): unknown { + const obj: any = {}; + return obj; + }, fromPartial(_: Partial): MsgGrantResponse { const message = createBaseMsgGrantResponse(); return message; }, fromAmino(_: MsgGrantResponseAmino): MsgGrantResponse { - return {}; + const message = createBaseMsgGrantResponse(); + return message; }, toAmino(_: MsgGrantResponse): MsgGrantResponseAmino { const obj: any = {}; @@ -466,6 +574,8 @@ export const MsgGrantResponse = { }; } }; +GlobalDecoderRegistry.register(MsgGrantResponse.typeUrl, MsgGrantResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgGrantResponse.aminoType, MsgGrantResponse.typeUrl); function createBaseMsgRevoke(): MsgRevoke { return { granter: "", @@ -475,6 +585,16 @@ function createBaseMsgRevoke(): MsgRevoke { } export const MsgRevoke = { typeUrl: "/cosmos.authz.v1beta1.MsgRevoke", + aminoType: "cosmos-sdk/MsgRevoke", + is(o: any): o is MsgRevoke { + return o && (o.$typeUrl === MsgRevoke.typeUrl || typeof o.granter === "string" && typeof o.grantee === "string" && typeof o.msgTypeUrl === "string"); + }, + isSDK(o: any): o is MsgRevokeSDKType { + return o && (o.$typeUrl === MsgRevoke.typeUrl || typeof o.granter === "string" && typeof o.grantee === "string" && typeof o.msg_type_url === "string"); + }, + isAmino(o: any): o is MsgRevokeAmino { + return o && (o.$typeUrl === MsgRevoke.typeUrl || typeof o.granter === "string" && typeof o.grantee === "string" && typeof o.msg_type_url === "string"); + }, encode(message: MsgRevoke, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.granter !== "") { writer.uint32(10).string(message.granter); @@ -510,6 +630,20 @@ export const MsgRevoke = { } return message; }, + fromJSON(object: any): MsgRevoke { + return { + 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; + }, fromPartial(object: Partial): MsgRevoke { const message = createBaseMsgRevoke(); message.granter = object.granter ?? ""; @@ -518,11 +652,17 @@ export const MsgRevoke = { return message; }, fromAmino(object: MsgRevokeAmino): MsgRevoke { - return { - granter: object.granter, - grantee: object.grantee, - msgTypeUrl: object.msg_type_url - }; + const message = createBaseMsgRevoke(); + if (object.granter !== undefined && object.granter !== null) { + message.granter = object.granter; + } + if (object.grantee !== undefined && object.grantee !== null) { + message.grantee = object.grantee; + } + if (object.msg_type_url !== undefined && object.msg_type_url !== null) { + message.msgTypeUrl = object.msg_type_url; + } + return message; }, toAmino(message: MsgRevoke): MsgRevokeAmino { const obj: any = {}; @@ -553,11 +693,23 @@ export const MsgRevoke = { }; } }; +GlobalDecoderRegistry.register(MsgRevoke.typeUrl, MsgRevoke); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgRevoke.aminoType, MsgRevoke.typeUrl); function createBaseMsgRevokeResponse(): MsgRevokeResponse { return {}; } export const MsgRevokeResponse = { typeUrl: "/cosmos.authz.v1beta1.MsgRevokeResponse", + aminoType: "cosmos-sdk/MsgRevokeResponse", + is(o: any): o is MsgRevokeResponse { + return o && o.$typeUrl === MsgRevokeResponse.typeUrl; + }, + isSDK(o: any): o is MsgRevokeResponseSDKType { + return o && o.$typeUrl === MsgRevokeResponse.typeUrl; + }, + isAmino(o: any): o is MsgRevokeResponseAmino { + return o && o.$typeUrl === MsgRevokeResponse.typeUrl; + }, encode(_: MsgRevokeResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, @@ -575,12 +727,20 @@ export const MsgRevokeResponse = { } return message; }, + fromJSON(_: any): MsgRevokeResponse { + return {}; + }, + toJSON(_: MsgRevokeResponse): unknown { + const obj: any = {}; + return obj; + }, fromPartial(_: Partial): MsgRevokeResponse { const message = createBaseMsgRevokeResponse(); return message; }, fromAmino(_: MsgRevokeResponseAmino): MsgRevokeResponse { - return {}; + const message = createBaseMsgRevokeResponse(); + return message; }, toAmino(_: MsgRevokeResponse): MsgRevokeResponseAmino { const obj: any = {}; @@ -608,31 +768,5 @@ export const MsgRevokeResponse = { }; } }; -export const Sdk_Msg_InterfaceDecoder = (input: BinaryReader | Uint8Array): Any => { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - const data = Any.decode(reader, reader.uint32()); - switch (data.typeUrl) { - default: - return data; - } -}; -export const Sdk_Msg_FromAmino = (content: AnyAmino) => { - return Any.fromAmino(content); -}; -export const Sdk_Msg_ToAmino = (content: Any) => { - return Any.toAmino(content); -}; -export const Authz_Authorization_InterfaceDecoder = (input: BinaryReader | Uint8Array): Any => { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - const data = Any.decode(reader, reader.uint32()); - switch (data.typeUrl) { - default: - return data; - } -}; -export const Authz_Authorization_FromAmino = (content: AnyAmino) => { - return Any.fromAmino(content); -}; -export const Authz_Authorization_ToAmino = (content: Any) => { - return Any.toAmino(content); -}; \ No newline at end of file +GlobalDecoderRegistry.register(MsgRevokeResponse.typeUrl, MsgRevokeResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgRevokeResponse.aminoType, MsgRevokeResponse.typeUrl); \ No newline at end of file diff --git a/packages/osmojs/src/codegen/cosmos/bank/v1beta1/authz.ts b/packages/osmojs/src/codegen/cosmos/bank/v1beta1/authz.ts index 1908259e8..a90adc0dc 100644 --- a/packages/osmojs/src/codegen/cosmos/bank/v1beta1/authz.ts +++ b/packages/osmojs/src/codegen/cosmos/bank/v1beta1/authz.ts @@ -1,5 +1,6 @@ import { Coin, CoinAmino, CoinSDKType } from "../../base/v1beta1/coin"; import { BinaryReader, BinaryWriter } from "../../../binary"; +import { GlobalDecoderRegistry } from "../../../registry"; /** * SendAuthorization allows the grantee to spend up to spend_limit coins from * the granter's account. @@ -7,8 +8,15 @@ import { BinaryReader, BinaryWriter } from "../../../binary"; * Since: cosmos-sdk 0.43 */ export interface SendAuthorization { - $typeUrl?: string; + $typeUrl?: "/cosmos.bank.v1beta1.SendAuthorization"; spendLimit: Coin[]; + /** + * allow_list specifies an optional list of addresses to whom the grantee can send tokens on behalf of the + * granter. If omitted, any recipient is allowed. + * + * Since: cosmos-sdk 0.47 + */ + allowList: string[]; } export interface SendAuthorizationProtoMsg { typeUrl: "/cosmos.bank.v1beta1.SendAuthorization"; @@ -22,6 +30,13 @@ export interface SendAuthorizationProtoMsg { */ export interface SendAuthorizationAmino { spend_limit: CoinAmino[]; + /** + * allow_list specifies an optional list of addresses to whom the grantee can send tokens on behalf of the + * granter. If omitted, any recipient is allowed. + * + * Since: cosmos-sdk 0.47 + */ + allow_list?: string[]; } export interface SendAuthorizationAminoMsg { type: "cosmos-sdk/SendAuthorization"; @@ -34,21 +49,36 @@ export interface SendAuthorizationAminoMsg { * Since: cosmos-sdk 0.43 */ export interface SendAuthorizationSDKType { - $typeUrl?: string; + $typeUrl?: "/cosmos.bank.v1beta1.SendAuthorization"; spend_limit: CoinSDKType[]; + allow_list: string[]; } function createBaseSendAuthorization(): SendAuthorization { return { $typeUrl: "/cosmos.bank.v1beta1.SendAuthorization", - spendLimit: [] + spendLimit: [], + allowList: [] }; } export const SendAuthorization = { typeUrl: "/cosmos.bank.v1beta1.SendAuthorization", + aminoType: "cosmos-sdk/SendAuthorization", + is(o: any): o is SendAuthorization { + return o && (o.$typeUrl === SendAuthorization.typeUrl || Array.isArray(o.spendLimit) && (!o.spendLimit.length || Coin.is(o.spendLimit[0])) && Array.isArray(o.allowList) && (!o.allowList.length || typeof o.allowList[0] === "string")); + }, + isSDK(o: any): o is SendAuthorizationSDKType { + return o && (o.$typeUrl === SendAuthorization.typeUrl || Array.isArray(o.spend_limit) && (!o.spend_limit.length || Coin.isSDK(o.spend_limit[0])) && Array.isArray(o.allow_list) && (!o.allow_list.length || typeof o.allow_list[0] === "string")); + }, + isAmino(o: any): o is SendAuthorizationAmino { + return o && (o.$typeUrl === SendAuthorization.typeUrl || Array.isArray(o.spend_limit) && (!o.spend_limit.length || Coin.isAmino(o.spend_limit[0])) && Array.isArray(o.allow_list) && (!o.allow_list.length || typeof o.allow_list[0] === "string")); + }, encode(message: SendAuthorization, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.spendLimit) { Coin.encode(v!, writer.uint32(10).fork()).ldelim(); } + for (const v of message.allowList) { + writer.uint32(18).string(v!); + } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): SendAuthorization { @@ -61,6 +91,9 @@ export const SendAuthorization = { case 1: message.spendLimit.push(Coin.decode(reader, reader.uint32())); break; + case 2: + message.allowList.push(reader.string()); + break; default: reader.skipType(tag & 7); break; @@ -68,15 +101,37 @@ export const SendAuthorization = { } return message; }, + fromJSON(object: any): SendAuthorization { + return { + spendLimit: Array.isArray(object?.spendLimit) ? object.spendLimit.map((e: any) => Coin.fromJSON(e)) : [], + allowList: Array.isArray(object?.allowList) ? object.allowList.map((e: any) => String(e)) : [] + }; + }, + toJSON(message: SendAuthorization): unknown { + const obj: any = {}; + if (message.spendLimit) { + obj.spendLimit = message.spendLimit.map(e => e ? Coin.toJSON(e) : undefined); + } else { + obj.spendLimit = []; + } + if (message.allowList) { + obj.allowList = message.allowList.map(e => e); + } else { + obj.allowList = []; + } + return obj; + }, fromPartial(object: Partial): SendAuthorization { const message = createBaseSendAuthorization(); message.spendLimit = object.spendLimit?.map(e => Coin.fromPartial(e)) || []; + message.allowList = object.allowList?.map(e => e) || []; return message; }, fromAmino(object: SendAuthorizationAmino): SendAuthorization { - return { - spendLimit: Array.isArray(object?.spend_limit) ? object.spend_limit.map((e: any) => Coin.fromAmino(e)) : [] - }; + const message = createBaseSendAuthorization(); + message.spendLimit = object.spend_limit?.map(e => Coin.fromAmino(e)) || []; + message.allowList = object.allow_list?.map(e => e) || []; + return message; }, toAmino(message: SendAuthorization): SendAuthorizationAmino { const obj: any = {}; @@ -85,6 +140,11 @@ export const SendAuthorization = { } else { obj.spend_limit = []; } + if (message.allowList) { + obj.allow_list = message.allowList.map(e => e); + } else { + obj.allow_list = []; + } return obj; }, fromAminoMsg(object: SendAuthorizationAminoMsg): SendAuthorization { @@ -108,4 +168,6 @@ export const SendAuthorization = { value: SendAuthorization.encode(message).finish() }; } -}; \ No newline at end of file +}; +GlobalDecoderRegistry.register(SendAuthorization.typeUrl, SendAuthorization); +GlobalDecoderRegistry.registerAminoProtoMapping(SendAuthorization.aminoType, SendAuthorization.typeUrl); \ No newline at end of file diff --git a/packages/osmojs/src/codegen/cosmos/bank/v1beta1/bank.ts b/packages/osmojs/src/codegen/cosmos/bank/v1beta1/bank.ts index 169e67c08..d41933e68 100644 --- a/packages/osmojs/src/codegen/cosmos/bank/v1beta1/bank.ts +++ b/packages/osmojs/src/codegen/cosmos/bank/v1beta1/bank.ts @@ -1,7 +1,17 @@ import { Coin, CoinAmino, CoinSDKType } from "../../base/v1beta1/coin"; import { BinaryReader, BinaryWriter } from "../../../binary"; +import { isSet } from "../../../helpers"; +import { GlobalDecoderRegistry } from "../../../registry"; /** Params defines the parameters for the bank module. */ export interface Params { + /** + * Deprecated: Use of SendEnabled in params is deprecated. + * For genesis, use the newly added send_enabled field in the genesis object. + * Storage, lookup, and manipulation of this information is now in the keeper. + * + * As of cosmos-sdk 0.47, this only exists for backwards compatibility of genesis files. + */ + /** @deprecated */ sendEnabled: SendEnabled[]; defaultSendEnabled: boolean; } @@ -11,8 +21,16 @@ export interface ParamsProtoMsg { } /** Params defines the parameters for the bank module. */ export interface ParamsAmino { - send_enabled: SendEnabledAmino[]; - default_send_enabled: boolean; + /** + * Deprecated: Use of SendEnabled in params is deprecated. + * For genesis, use the newly added send_enabled field in the genesis object. + * Storage, lookup, and manipulation of this information is now in the keeper. + * + * As of cosmos-sdk 0.47, this only exists for backwards compatibility of genesis files. + */ + /** @deprecated */ + send_enabled?: SendEnabledAmino[]; + default_send_enabled?: boolean; } export interface ParamsAminoMsg { type: "cosmos-sdk/x/bank/Params"; @@ -20,6 +38,7 @@ export interface ParamsAminoMsg { } /** Params defines the parameters for the bank module. */ export interface ParamsSDKType { + /** @deprecated */ send_enabled: SendEnabledSDKType[]; default_send_enabled: boolean; } @@ -40,8 +59,8 @@ export interface SendEnabledProtoMsg { * sendable). */ export interface SendEnabledAmino { - denom: string; - enabled: boolean; + denom?: string; + enabled?: boolean; } export interface SendEnabledAminoMsg { type: "cosmos-sdk/SendEnabled"; @@ -66,7 +85,7 @@ export interface InputProtoMsg { } /** Input models transaction input. */ export interface InputAmino { - address: string; + address?: string; coins: CoinAmino[]; } export interface InputAminoMsg { @@ -89,7 +108,7 @@ export interface OutputProtoMsg { } /** Output models transaction outputs. */ export interface OutputAmino { - address: string; + address?: string; coins: CoinAmino[]; } export interface OutputAminoMsg { @@ -108,7 +127,7 @@ export interface OutputSDKType { */ /** @deprecated */ export interface Supply { - $typeUrl?: string; + $typeUrl?: "/cosmos.bank.v1beta1.Supply"; total: Coin[]; } export interface SupplyProtoMsg { @@ -135,7 +154,7 @@ export interface SupplyAminoMsg { */ /** @deprecated */ export interface SupplySDKType { - $typeUrl?: string; + $typeUrl?: "/cosmos.bank.v1beta1.Supply"; total: CoinSDKType[]; } /** @@ -148,7 +167,7 @@ export interface DenomUnit { /** * exponent represents power of 10 exponent that one must * raise the base_denom to in order to equal the given DenomUnit's denom - * 1 denom = 1^exponent base_denom + * 1 denom = 10^exponent base_denom * (e.g. with a base_denom of uatom, one can create a DenomUnit of 'atom' with * exponent = 6, thus: 1 atom = 10^6 uatom). */ @@ -166,17 +185,17 @@ export interface DenomUnitProtoMsg { */ export interface DenomUnitAmino { /** 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 - * 1 denom = 1^exponent base_denom + * 1 denom = 10^exponent base_denom * (e.g. with a base_denom of uatom, one can create a DenomUnit of 'atom' with * exponent = 6, thus: 1 atom = 10^6 uatom). */ - exponent: number; + exponent?: number; /** aliases is a list of string aliases for the given denom */ - aliases: string[]; + aliases?: string[]; } export interface DenomUnitAminoMsg { type: "cosmos-sdk/DenomUnit"; @@ -219,6 +238,19 @@ export interface Metadata { * Since: cosmos-sdk 0.43 */ symbol: string; + /** + * URI to a document (on or off-chain) that contains additional information. Optional. + * + * Since: cosmos-sdk 0.46 + */ + uri: string; + /** + * URIHash is a sha256 hash of a document pointed by URI. It's used to verify that + * the document didn't change. Optional. + * + * Since: cosmos-sdk 0.46 + */ + uriHash: string; } export interface MetadataProtoMsg { typeUrl: "/cosmos.bank.v1beta1.Metadata"; @@ -229,29 +261,42 @@ export interface MetadataProtoMsg { * a basic token. */ export interface MetadataAmino { - description: string; + description?: string; /** denom_units represents the list of DenomUnit's for a given coin */ - denom_units: DenomUnitAmino[]; + denom_units?: DenomUnitAmino[]; /** 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; + /** + * URI to a document (on or off-chain) that contains additional information. Optional. + * + * Since: cosmos-sdk 0.46 + */ + uri?: string; + /** + * URIHash is a sha256 hash of a document pointed by URI. It's used to verify that + * the document didn't change. Optional. + * + * Since: cosmos-sdk 0.46 + */ + uri_hash?: string; } export interface MetadataAminoMsg { type: "cosmos-sdk/Metadata"; @@ -268,6 +313,8 @@ export interface MetadataSDKType { display: string; name: string; symbol: string; + uri: string; + uri_hash: string; } function createBaseParams(): Params { return { @@ -277,6 +324,16 @@ function createBaseParams(): Params { } export const Params = { typeUrl: "/cosmos.bank.v1beta1.Params", + aminoType: "cosmos-sdk/x/bank/Params", + is(o: any): o is Params { + return o && (o.$typeUrl === Params.typeUrl || Array.isArray(o.sendEnabled) && (!o.sendEnabled.length || SendEnabled.is(o.sendEnabled[0])) && typeof o.defaultSendEnabled === "boolean"); + }, + isSDK(o: any): o is ParamsSDKType { + return o && (o.$typeUrl === Params.typeUrl || Array.isArray(o.send_enabled) && (!o.send_enabled.length || SendEnabled.isSDK(o.send_enabled[0])) && typeof o.default_send_enabled === "boolean"); + }, + isAmino(o: any): o is ParamsAmino { + return o && (o.$typeUrl === Params.typeUrl || Array.isArray(o.send_enabled) && (!o.send_enabled.length || SendEnabled.isAmino(o.send_enabled[0])) && typeof o.default_send_enabled === "boolean"); + }, encode(message: Params, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.sendEnabled) { SendEnabled.encode(v!, writer.uint32(10).fork()).ldelim(); @@ -306,6 +363,22 @@ export const Params = { } return message; }, + fromJSON(object: any): Params { + return { + sendEnabled: Array.isArray(object?.sendEnabled) ? object.sendEnabled.map((e: any) => SendEnabled.fromJSON(e)) : [], + defaultSendEnabled: isSet(object.defaultSendEnabled) ? Boolean(object.defaultSendEnabled) : false + }; + }, + toJSON(message: Params): unknown { + const obj: any = {}; + if (message.sendEnabled) { + obj.sendEnabled = message.sendEnabled.map(e => e ? SendEnabled.toJSON(e) : undefined); + } else { + obj.sendEnabled = []; + } + message.defaultSendEnabled !== undefined && (obj.defaultSendEnabled = message.defaultSendEnabled); + return obj; + }, fromPartial(object: Partial): Params { const message = createBaseParams(); message.sendEnabled = object.sendEnabled?.map(e => SendEnabled.fromPartial(e)) || []; @@ -313,10 +386,12 @@ export const Params = { return message; }, fromAmino(object: ParamsAmino): Params { - return { - sendEnabled: Array.isArray(object?.send_enabled) ? object.send_enabled.map((e: any) => SendEnabled.fromAmino(e)) : [], - defaultSendEnabled: object.default_send_enabled - }; + const message = createBaseParams(); + message.sendEnabled = object.send_enabled?.map(e => SendEnabled.fromAmino(e)) || []; + if (object.default_send_enabled !== undefined && object.default_send_enabled !== null) { + message.defaultSendEnabled = object.default_send_enabled; + } + return message; }, toAmino(message: Params): ParamsAmino { const obj: any = {}; @@ -350,6 +425,8 @@ export const Params = { }; } }; +GlobalDecoderRegistry.register(Params.typeUrl, Params); +GlobalDecoderRegistry.registerAminoProtoMapping(Params.aminoType, Params.typeUrl); function createBaseSendEnabled(): SendEnabled { return { denom: "", @@ -358,6 +435,16 @@ function createBaseSendEnabled(): SendEnabled { } export const SendEnabled = { typeUrl: "/cosmos.bank.v1beta1.SendEnabled", + aminoType: "cosmos-sdk/SendEnabled", + is(o: any): o is SendEnabled { + return o && (o.$typeUrl === SendEnabled.typeUrl || typeof o.denom === "string" && typeof o.enabled === "boolean"); + }, + isSDK(o: any): o is SendEnabledSDKType { + return o && (o.$typeUrl === SendEnabled.typeUrl || typeof o.denom === "string" && typeof o.enabled === "boolean"); + }, + isAmino(o: any): o is SendEnabledAmino { + return o && (o.$typeUrl === SendEnabled.typeUrl || typeof o.denom === "string" && typeof o.enabled === "boolean"); + }, encode(message: SendEnabled, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.denom !== "") { writer.uint32(10).string(message.denom); @@ -387,6 +474,18 @@ export const SendEnabled = { } 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; + }, fromPartial(object: Partial): SendEnabled { const message = createBaseSendEnabled(); message.denom = object.denom ?? ""; @@ -394,10 +493,14 @@ export const SendEnabled = { return message; }, fromAmino(object: SendEnabledAmino): SendEnabled { - return { - denom: object.denom, - enabled: object.enabled - }; + const message = createBaseSendEnabled(); + if (object.denom !== undefined && object.denom !== null) { + message.denom = object.denom; + } + if (object.enabled !== undefined && object.enabled !== null) { + message.enabled = object.enabled; + } + return message; }, toAmino(message: SendEnabled): SendEnabledAmino { const obj: any = {}; @@ -427,6 +530,8 @@ export const SendEnabled = { }; } }; +GlobalDecoderRegistry.register(SendEnabled.typeUrl, SendEnabled); +GlobalDecoderRegistry.registerAminoProtoMapping(SendEnabled.aminoType, SendEnabled.typeUrl); function createBaseInput(): Input { return { address: "", @@ -435,6 +540,16 @@ function createBaseInput(): Input { } export const Input = { typeUrl: "/cosmos.bank.v1beta1.Input", + aminoType: "cosmos-sdk/Input", + is(o: any): o is Input { + return o && (o.$typeUrl === Input.typeUrl || typeof o.address === "string" && Array.isArray(o.coins) && (!o.coins.length || Coin.is(o.coins[0]))); + }, + isSDK(o: any): o is InputSDKType { + return o && (o.$typeUrl === Input.typeUrl || typeof o.address === "string" && Array.isArray(o.coins) && (!o.coins.length || Coin.isSDK(o.coins[0]))); + }, + isAmino(o: any): o is InputAmino { + return o && (o.$typeUrl === Input.typeUrl || typeof o.address === "string" && Array.isArray(o.coins) && (!o.coins.length || Coin.isAmino(o.coins[0]))); + }, encode(message: Input, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.address !== "") { writer.uint32(10).string(message.address); @@ -464,6 +579,22 @@ export const Input = { } 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)) : [] + }; + }, + toJSON(message: Input): unknown { + const obj: any = {}; + message.address !== undefined && (obj.address = message.address); + if (message.coins) { + obj.coins = message.coins.map(e => e ? Coin.toJSON(e) : undefined); + } else { + obj.coins = []; + } + return obj; + }, fromPartial(object: Partial): Input { const message = createBaseInput(); message.address = object.address ?? ""; @@ -471,10 +602,12 @@ export const Input = { return message; }, fromAmino(object: InputAmino): Input { - return { - address: object.address, - coins: Array.isArray(object?.coins) ? object.coins.map((e: any) => Coin.fromAmino(e)) : [] - }; + const message = createBaseInput(); + if (object.address !== undefined && object.address !== null) { + message.address = object.address; + } + message.coins = object.coins?.map(e => Coin.fromAmino(e)) || []; + return message; }, toAmino(message: Input): InputAmino { const obj: any = {}; @@ -508,6 +641,8 @@ export const Input = { }; } }; +GlobalDecoderRegistry.register(Input.typeUrl, Input); +GlobalDecoderRegistry.registerAminoProtoMapping(Input.aminoType, Input.typeUrl); function createBaseOutput(): Output { return { address: "", @@ -516,6 +651,16 @@ function createBaseOutput(): Output { } export const Output = { typeUrl: "/cosmos.bank.v1beta1.Output", + aminoType: "cosmos-sdk/Output", + is(o: any): o is Output { + return o && (o.$typeUrl === Output.typeUrl || typeof o.address === "string" && Array.isArray(o.coins) && (!o.coins.length || Coin.is(o.coins[0]))); + }, + isSDK(o: any): o is OutputSDKType { + return o && (o.$typeUrl === Output.typeUrl || typeof o.address === "string" && Array.isArray(o.coins) && (!o.coins.length || Coin.isSDK(o.coins[0]))); + }, + isAmino(o: any): o is OutputAmino { + return o && (o.$typeUrl === Output.typeUrl || typeof o.address === "string" && Array.isArray(o.coins) && (!o.coins.length || Coin.isAmino(o.coins[0]))); + }, encode(message: Output, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.address !== "") { writer.uint32(10).string(message.address); @@ -545,6 +690,22 @@ export const Output = { } 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)) : [] + }; + }, + toJSON(message: Output): unknown { + const obj: any = {}; + message.address !== undefined && (obj.address = message.address); + if (message.coins) { + obj.coins = message.coins.map(e => e ? Coin.toJSON(e) : undefined); + } else { + obj.coins = []; + } + return obj; + }, fromPartial(object: Partial): Output { const message = createBaseOutput(); message.address = object.address ?? ""; @@ -552,10 +713,12 @@ export const Output = { return message; }, fromAmino(object: OutputAmino): Output { - return { - address: object.address, - coins: Array.isArray(object?.coins) ? object.coins.map((e: any) => Coin.fromAmino(e)) : [] - }; + const message = createBaseOutput(); + if (object.address !== undefined && object.address !== null) { + message.address = object.address; + } + message.coins = object.coins?.map(e => Coin.fromAmino(e)) || []; + return message; }, toAmino(message: Output): OutputAmino { const obj: any = {}; @@ -589,6 +752,8 @@ export const Output = { }; } }; +GlobalDecoderRegistry.register(Output.typeUrl, Output); +GlobalDecoderRegistry.registerAminoProtoMapping(Output.aminoType, Output.typeUrl); function createBaseSupply(): Supply { return { $typeUrl: "/cosmos.bank.v1beta1.Supply", @@ -597,6 +762,16 @@ function createBaseSupply(): Supply { } export const Supply = { typeUrl: "/cosmos.bank.v1beta1.Supply", + aminoType: "cosmos-sdk/Supply", + is(o: any): o is Supply { + return o && (o.$typeUrl === Supply.typeUrl || Array.isArray(o.total) && (!o.total.length || Coin.is(o.total[0]))); + }, + isSDK(o: any): o is SupplySDKType { + return o && (o.$typeUrl === Supply.typeUrl || Array.isArray(o.total) && (!o.total.length || Coin.isSDK(o.total[0]))); + }, + isAmino(o: any): o is SupplyAmino { + return o && (o.$typeUrl === Supply.typeUrl || Array.isArray(o.total) && (!o.total.length || Coin.isAmino(o.total[0]))); + }, encode(message: Supply, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.total) { Coin.encode(v!, writer.uint32(10).fork()).ldelim(); @@ -620,15 +795,29 @@ export const Supply = { } return message; }, + fromJSON(object: any): Supply { + return { + total: Array.isArray(object?.total) ? object.total.map((e: any) => Coin.fromJSON(e)) : [] + }; + }, + toJSON(message: Supply): unknown { + const obj: any = {}; + if (message.total) { + obj.total = message.total.map(e => e ? Coin.toJSON(e) : undefined); + } else { + obj.total = []; + } + return obj; + }, fromPartial(object: Partial): Supply { const message = createBaseSupply(); message.total = object.total?.map(e => Coin.fromPartial(e)) || []; return message; }, fromAmino(object: SupplyAmino): Supply { - return { - total: Array.isArray(object?.total) ? object.total.map((e: any) => Coin.fromAmino(e)) : [] - }; + const message = createBaseSupply(); + message.total = object.total?.map(e => Coin.fromAmino(e)) || []; + return message; }, toAmino(message: Supply): SupplyAmino { const obj: any = {}; @@ -661,6 +850,8 @@ export const Supply = { }; } }; +GlobalDecoderRegistry.register(Supply.typeUrl, Supply); +GlobalDecoderRegistry.registerAminoProtoMapping(Supply.aminoType, Supply.typeUrl); function createBaseDenomUnit(): DenomUnit { return { denom: "", @@ -670,6 +861,16 @@ function createBaseDenomUnit(): DenomUnit { } export const DenomUnit = { typeUrl: "/cosmos.bank.v1beta1.DenomUnit", + aminoType: "cosmos-sdk/DenomUnit", + is(o: any): o is DenomUnit { + return o && (o.$typeUrl === DenomUnit.typeUrl || typeof o.denom === "string" && typeof o.exponent === "number" && Array.isArray(o.aliases) && (!o.aliases.length || typeof o.aliases[0] === "string")); + }, + isSDK(o: any): o is DenomUnitSDKType { + return o && (o.$typeUrl === DenomUnit.typeUrl || typeof o.denom === "string" && typeof o.exponent === "number" && Array.isArray(o.aliases) && (!o.aliases.length || typeof o.aliases[0] === "string")); + }, + isAmino(o: any): o is DenomUnitAmino { + return o && (o.$typeUrl === DenomUnit.typeUrl || typeof o.denom === "string" && typeof o.exponent === "number" && Array.isArray(o.aliases) && (!o.aliases.length || typeof o.aliases[0] === "string")); + }, encode(message: DenomUnit, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.denom !== "") { writer.uint32(10).string(message.denom); @@ -705,6 +906,24 @@ export const DenomUnit = { } 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)) : [] + }; + }, + toJSON(message: DenomUnit): unknown { + 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); + } else { + obj.aliases = []; + } + return obj; + }, fromPartial(object: Partial): DenomUnit { const message = createBaseDenomUnit(); message.denom = object.denom ?? ""; @@ -713,11 +932,15 @@ export const DenomUnit = { return message; }, fromAmino(object: DenomUnitAmino): DenomUnit { - return { - denom: object.denom, - exponent: object.exponent, - aliases: Array.isArray(object?.aliases) ? object.aliases.map((e: any) => e) : [] - }; + const message = createBaseDenomUnit(); + if (object.denom !== undefined && object.denom !== null) { + message.denom = object.denom; + } + if (object.exponent !== undefined && object.exponent !== null) { + message.exponent = object.exponent; + } + message.aliases = object.aliases?.map(e => e) || []; + return message; }, toAmino(message: DenomUnit): DenomUnitAmino { const obj: any = {}; @@ -752,6 +975,8 @@ export const DenomUnit = { }; } }; +GlobalDecoderRegistry.register(DenomUnit.typeUrl, DenomUnit); +GlobalDecoderRegistry.registerAminoProtoMapping(DenomUnit.aminoType, DenomUnit.typeUrl); function createBaseMetadata(): Metadata { return { description: "", @@ -759,11 +984,23 @@ function createBaseMetadata(): Metadata { base: "", display: "", name: "", - symbol: "" + symbol: "", + uri: "", + uriHash: "" }; } export const Metadata = { typeUrl: "/cosmos.bank.v1beta1.Metadata", + aminoType: "cosmos-sdk/Metadata", + is(o: any): o is Metadata { + return o && (o.$typeUrl === Metadata.typeUrl || typeof o.description === "string" && Array.isArray(o.denomUnits) && (!o.denomUnits.length || DenomUnit.is(o.denomUnits[0])) && typeof o.base === "string" && typeof o.display === "string" && typeof o.name === "string" && typeof o.symbol === "string" && typeof o.uri === "string" && typeof o.uriHash === "string"); + }, + isSDK(o: any): o is MetadataSDKType { + return o && (o.$typeUrl === Metadata.typeUrl || typeof o.description === "string" && Array.isArray(o.denom_units) && (!o.denom_units.length || DenomUnit.isSDK(o.denom_units[0])) && typeof o.base === "string" && typeof o.display === "string" && typeof o.name === "string" && typeof o.symbol === "string" && typeof o.uri === "string" && typeof o.uri_hash === "string"); + }, + isAmino(o: any): o is MetadataAmino { + return o && (o.$typeUrl === Metadata.typeUrl || typeof o.description === "string" && Array.isArray(o.denom_units) && (!o.denom_units.length || DenomUnit.isAmino(o.denom_units[0])) && typeof o.base === "string" && typeof o.display === "string" && typeof o.name === "string" && typeof o.symbol === "string" && typeof o.uri === "string" && typeof o.uri_hash === "string"); + }, encode(message: Metadata, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.description !== "") { writer.uint32(10).string(message.description); @@ -783,6 +1020,12 @@ export const Metadata = { if (message.symbol !== "") { writer.uint32(50).string(message.symbol); } + if (message.uri !== "") { + writer.uint32(58).string(message.uri); + } + if (message.uriHash !== "") { + writer.uint32(66).string(message.uriHash); + } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): Metadata { @@ -810,6 +1053,12 @@ export const Metadata = { case 6: message.symbol = reader.string(); break; + case 7: + message.uri = reader.string(); + break; + case 8: + message.uriHash = reader.string(); + break; default: reader.skipType(tag & 7); break; @@ -817,6 +1066,34 @@ export const Metadata = { } 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)) : [], + 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) : "", + uri: isSet(object.uri) ? String(object.uri) : "", + uriHash: isSet(object.uriHash) ? String(object.uriHash) : "" + }; + }, + toJSON(message: Metadata): unknown { + const obj: any = {}; + message.description !== undefined && (obj.description = message.description); + if (message.denomUnits) { + obj.denomUnits = message.denomUnits.map(e => e ? DenomUnit.toJSON(e) : undefined); + } else { + obj.denomUnits = []; + } + message.base !== undefined && (obj.base = message.base); + message.display !== undefined && (obj.display = message.display); + message.name !== undefined && (obj.name = message.name); + message.symbol !== undefined && (obj.symbol = message.symbol); + message.uri !== undefined && (obj.uri = message.uri); + message.uriHash !== undefined && (obj.uriHash = message.uriHash); + return obj; + }, fromPartial(object: Partial): Metadata { const message = createBaseMetadata(); message.description = object.description ?? ""; @@ -825,17 +1102,35 @@ export const Metadata = { message.display = object.display ?? ""; message.name = object.name ?? ""; message.symbol = object.symbol ?? ""; + message.uri = object.uri ?? ""; + message.uriHash = object.uriHash ?? ""; return message; }, fromAmino(object: MetadataAmino): Metadata { - return { - description: object.description, - denomUnits: Array.isArray(object?.denom_units) ? object.denom_units.map((e: any) => DenomUnit.fromAmino(e)) : [], - base: object.base, - display: object.display, - name: object.name, - symbol: object.symbol - }; + const message = createBaseMetadata(); + if (object.description !== undefined && object.description !== null) { + message.description = object.description; + } + message.denomUnits = object.denom_units?.map(e => DenomUnit.fromAmino(e)) || []; + if (object.base !== undefined && object.base !== null) { + message.base = object.base; + } + if (object.display !== undefined && object.display !== null) { + message.display = object.display; + } + if (object.name !== undefined && object.name !== null) { + message.name = object.name; + } + if (object.symbol !== undefined && object.symbol !== null) { + message.symbol = object.symbol; + } + if (object.uri !== undefined && object.uri !== null) { + message.uri = object.uri; + } + if (object.uri_hash !== undefined && object.uri_hash !== null) { + message.uriHash = object.uri_hash; + } + return message; }, toAmino(message: Metadata): MetadataAmino { const obj: any = {}; @@ -849,6 +1144,8 @@ export const Metadata = { obj.display = message.display; obj.name = message.name; obj.symbol = message.symbol; + obj.uri = message.uri; + obj.uri_hash = message.uriHash; return obj; }, fromAminoMsg(object: MetadataAminoMsg): Metadata { @@ -872,4 +1169,6 @@ export const Metadata = { value: Metadata.encode(message).finish() }; } -}; \ No newline at end of file +}; +GlobalDecoderRegistry.register(Metadata.typeUrl, Metadata); +GlobalDecoderRegistry.registerAminoProtoMapping(Metadata.aminoType, Metadata.typeUrl); \ No newline at end of file diff --git a/packages/osmojs/src/codegen/cosmos/bank/v1beta1/genesis.ts b/packages/osmojs/src/codegen/cosmos/bank/v1beta1/genesis.ts index 1c22960ac..6f5609e40 100644 --- a/packages/osmojs/src/codegen/cosmos/bank/v1beta1/genesis.ts +++ b/packages/osmojs/src/codegen/cosmos/bank/v1beta1/genesis.ts @@ -1,9 +1,11 @@ -import { Params, ParamsAmino, ParamsSDKType, Metadata, MetadataAmino, MetadataSDKType } from "./bank"; +import { Params, ParamsAmino, ParamsSDKType, Metadata, MetadataAmino, MetadataSDKType, SendEnabled, SendEnabledAmino, SendEnabledSDKType } from "./bank"; import { Coin, CoinAmino, CoinSDKType } from "../../base/v1beta1/coin"; import { BinaryReader, BinaryWriter } from "../../../binary"; +import { isSet } from "../../../helpers"; +import { GlobalDecoderRegistry } from "../../../registry"; /** GenesisState defines the bank module's genesis state. */ export interface GenesisState { - /** params defines all the paramaters of the module. */ + /** params defines all the parameters of the module. */ params: Params; /** balances is an array containing the balances of all the accounts. */ balances: Balance[]; @@ -12,10 +14,14 @@ export interface GenesisState { * balances. Otherwise, it will be used to validate that the sum of the balances equals this amount. */ supply: Coin[]; - /** denom_metadata defines the metadata of the differents coins. */ + /** denom_metadata defines the metadata of the different coins. */ denomMetadata: Metadata[]; - /** supply_offsets defines the amount of supply offset. */ - supplyOffsets: GenesisSupplyOffset[]; + /** + * send_enabled defines the denoms where send is enabled or disabled. + * + * Since: cosmos-sdk 0.47 + */ + sendEnabled: SendEnabled[]; } export interface GenesisStateProtoMsg { typeUrl: "/cosmos.bank.v1beta1.GenesisState"; @@ -23,8 +29,8 @@ export interface GenesisStateProtoMsg { } /** GenesisState defines the bank module's genesis state. */ export interface GenesisStateAmino { - /** params defines all the paramaters of the module. */ - params?: ParamsAmino; + /** params defines all the parameters of the module. */ + params: ParamsAmino; /** balances is an array containing the balances of all the accounts. */ balances: BalanceAmino[]; /** @@ -32,10 +38,14 @@ export interface GenesisStateAmino { * balances. Otherwise, it will be used to validate that the sum of the balances equals this amount. */ supply: CoinAmino[]; - /** denom_metadata defines the metadata of the differents coins. */ + /** denom_metadata defines the metadata of the different coins. */ denom_metadata: MetadataAmino[]; - /** supply_offsets defines the amount of supply offset. */ - supply_offsets: GenesisSupplyOffsetAmino[]; + /** + * send_enabled defines the denoms where send is enabled or disabled. + * + * Since: cosmos-sdk 0.47 + */ + send_enabled: SendEnabledAmino[]; } export interface GenesisStateAminoMsg { type: "cosmos-sdk/GenesisState"; @@ -47,7 +57,7 @@ export interface GenesisStateSDKType { balances: BalanceSDKType[]; supply: CoinSDKType[]; denom_metadata: MetadataSDKType[]; - supply_offsets: GenesisSupplyOffsetSDKType[]; + send_enabled: SendEnabledSDKType[]; } /** * Balance defines an account address and balance pair used in the bank module's @@ -69,7 +79,7 @@ export interface BalanceProtoMsg { */ export interface BalanceAmino { /** address is the address of the balance holder. */ - address: string; + address?: string; /** coins defines the different coins this balance holds. */ coins: CoinAmino[]; } @@ -85,53 +95,27 @@ export interface BalanceSDKType { address: string; coins: CoinSDKType[]; } -/** - * GenesisSupplyOffset encodes the supply offsets, just for genesis. - * The offsets are serialized directly by denom in state. - */ -export interface GenesisSupplyOffset { - /** Denom */ - denom: string; - /** SupplyOffset */ - offset: string; -} -export interface GenesisSupplyOffsetProtoMsg { - typeUrl: "/cosmos.bank.v1beta1.GenesisSupplyOffset"; - value: Uint8Array; -} -/** - * GenesisSupplyOffset encodes the supply offsets, just for genesis. - * The offsets are serialized directly by denom in state. - */ -export interface GenesisSupplyOffsetAmino { - /** Denom */ - denom: string; - /** SupplyOffset */ - offset: string; -} -export interface GenesisSupplyOffsetAminoMsg { - type: "cosmos-sdk/GenesisSupplyOffset"; - value: GenesisSupplyOffsetAmino; -} -/** - * GenesisSupplyOffset encodes the supply offsets, just for genesis. - * The offsets are serialized directly by denom in state. - */ -export interface GenesisSupplyOffsetSDKType { - denom: string; - offset: string; -} function createBaseGenesisState(): GenesisState { return { params: Params.fromPartial({}), balances: [], supply: [], denomMetadata: [], - supplyOffsets: [] + sendEnabled: [] }; } export const GenesisState = { typeUrl: "/cosmos.bank.v1beta1.GenesisState", + aminoType: "cosmos-sdk/GenesisState", + is(o: any): o is GenesisState { + return o && (o.$typeUrl === GenesisState.typeUrl || Params.is(o.params) && Array.isArray(o.balances) && (!o.balances.length || Balance.is(o.balances[0])) && Array.isArray(o.supply) && (!o.supply.length || Coin.is(o.supply[0])) && Array.isArray(o.denomMetadata) && (!o.denomMetadata.length || Metadata.is(o.denomMetadata[0])) && Array.isArray(o.sendEnabled) && (!o.sendEnabled.length || SendEnabled.is(o.sendEnabled[0]))); + }, + isSDK(o: any): o is GenesisStateSDKType { + return o && (o.$typeUrl === GenesisState.typeUrl || Params.isSDK(o.params) && Array.isArray(o.balances) && (!o.balances.length || Balance.isSDK(o.balances[0])) && Array.isArray(o.supply) && (!o.supply.length || Coin.isSDK(o.supply[0])) && Array.isArray(o.denom_metadata) && (!o.denom_metadata.length || Metadata.isSDK(o.denom_metadata[0])) && Array.isArray(o.send_enabled) && (!o.send_enabled.length || SendEnabled.isSDK(o.send_enabled[0]))); + }, + isAmino(o: any): o is GenesisStateAmino { + return o && (o.$typeUrl === GenesisState.typeUrl || Params.isAmino(o.params) && Array.isArray(o.balances) && (!o.balances.length || Balance.isAmino(o.balances[0])) && Array.isArray(o.supply) && (!o.supply.length || Coin.isAmino(o.supply[0])) && Array.isArray(o.denom_metadata) && (!o.denom_metadata.length || Metadata.isAmino(o.denom_metadata[0])) && Array.isArray(o.send_enabled) && (!o.send_enabled.length || SendEnabled.isAmino(o.send_enabled[0]))); + }, encode(message: GenesisState, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.params !== undefined) { Params.encode(message.params, writer.uint32(10).fork()).ldelim(); @@ -145,8 +129,8 @@ export const GenesisState = { for (const v of message.denomMetadata) { Metadata.encode(v!, writer.uint32(34).fork()).ldelim(); } - for (const v of message.supplyOffsets) { - GenesisSupplyOffset.encode(v!, writer.uint32(42).fork()).ldelim(); + for (const v of message.sendEnabled) { + SendEnabled.encode(v!, writer.uint32(42).fork()).ldelim(); } return writer; }, @@ -170,7 +154,7 @@ export const GenesisState = { message.denomMetadata.push(Metadata.decode(reader, reader.uint32())); break; case 5: - message.supplyOffsets.push(GenesisSupplyOffset.decode(reader, reader.uint32())); + message.sendEnabled.push(SendEnabled.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -179,27 +163,63 @@ export const GenesisState = { } 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)) : [], + denomMetadata: Array.isArray(object?.denomMetadata) ? object.denomMetadata.map((e: any) => Metadata.fromJSON(e)) : [], + sendEnabled: Array.isArray(object?.sendEnabled) ? object.sendEnabled.map((e: any) => SendEnabled.fromJSON(e)) : [] + }; + }, + toJSON(message: GenesisState): unknown { + 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); + } else { + obj.balances = []; + } + if (message.supply) { + obj.supply = message.supply.map(e => e ? Coin.toJSON(e) : undefined); + } else { + obj.supply = []; + } + if (message.denomMetadata) { + obj.denomMetadata = message.denomMetadata.map(e => e ? Metadata.toJSON(e) : undefined); + } else { + obj.denomMetadata = []; + } + if (message.sendEnabled) { + obj.sendEnabled = message.sendEnabled.map(e => e ? SendEnabled.toJSON(e) : undefined); + } else { + obj.sendEnabled = []; + } + return obj; + }, fromPartial(object: Partial): 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)) || []; - message.supplyOffsets = object.supplyOffsets?.map(e => GenesisSupplyOffset.fromPartial(e)) || []; + message.sendEnabled = object.sendEnabled?.map(e => SendEnabled.fromPartial(e)) || []; return message; }, fromAmino(object: GenesisStateAmino): GenesisState { - return { - params: object?.params ? Params.fromAmino(object.params) : undefined, - balances: Array.isArray(object?.balances) ? object.balances.map((e: any) => Balance.fromAmino(e)) : [], - supply: Array.isArray(object?.supply) ? object.supply.map((e: any) => Coin.fromAmino(e)) : [], - denomMetadata: Array.isArray(object?.denom_metadata) ? object.denom_metadata.map((e: any) => Metadata.fromAmino(e)) : [], - supplyOffsets: Array.isArray(object?.supply_offsets) ? object.supply_offsets.map((e: any) => GenesisSupplyOffset.fromAmino(e)) : [] - }; + const message = createBaseGenesisState(); + if (object.params !== undefined && object.params !== null) { + message.params = Params.fromAmino(object.params); + } + message.balances = object.balances?.map(e => Balance.fromAmino(e)) || []; + message.supply = object.supply?.map(e => Coin.fromAmino(e)) || []; + message.denomMetadata = object.denom_metadata?.map(e => Metadata.fromAmino(e)) || []; + message.sendEnabled = object.send_enabled?.map(e => SendEnabled.fromAmino(e)) || []; + return message; }, toAmino(message: GenesisState): GenesisStateAmino { const obj: any = {}; - obj.params = message.params ? Params.toAmino(message.params) : undefined; + obj.params = message.params ? Params.toAmino(message.params) : Params.fromPartial({}); if (message.balances) { obj.balances = message.balances.map(e => e ? Balance.toAmino(e) : undefined); } else { @@ -215,10 +235,10 @@ export const GenesisState = { } else { obj.denom_metadata = []; } - if (message.supplyOffsets) { - obj.supply_offsets = message.supplyOffsets.map(e => e ? GenesisSupplyOffset.toAmino(e) : undefined); + if (message.sendEnabled) { + obj.send_enabled = message.sendEnabled.map(e => e ? SendEnabled.toAmino(e) : undefined); } else { - obj.supply_offsets = []; + obj.send_enabled = []; } return obj; }, @@ -244,6 +264,8 @@ export const GenesisState = { }; } }; +GlobalDecoderRegistry.register(GenesisState.typeUrl, GenesisState); +GlobalDecoderRegistry.registerAminoProtoMapping(GenesisState.aminoType, GenesisState.typeUrl); function createBaseBalance(): Balance { return { address: "", @@ -252,6 +274,16 @@ function createBaseBalance(): Balance { } export const Balance = { typeUrl: "/cosmos.bank.v1beta1.Balance", + aminoType: "cosmos-sdk/Balance", + is(o: any): o is Balance { + return o && (o.$typeUrl === Balance.typeUrl || typeof o.address === "string" && Array.isArray(o.coins) && (!o.coins.length || Coin.is(o.coins[0]))); + }, + isSDK(o: any): o is BalanceSDKType { + return o && (o.$typeUrl === Balance.typeUrl || typeof o.address === "string" && Array.isArray(o.coins) && (!o.coins.length || Coin.isSDK(o.coins[0]))); + }, + isAmino(o: any): o is BalanceAmino { + return o && (o.$typeUrl === Balance.typeUrl || typeof o.address === "string" && Array.isArray(o.coins) && (!o.coins.length || Coin.isAmino(o.coins[0]))); + }, encode(message: Balance, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.address !== "") { writer.uint32(10).string(message.address); @@ -281,6 +313,22 @@ export const Balance = { } 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)) : [] + }; + }, + toJSON(message: Balance): unknown { + const obj: any = {}; + message.address !== undefined && (obj.address = message.address); + if (message.coins) { + obj.coins = message.coins.map(e => e ? Coin.toJSON(e) : undefined); + } else { + obj.coins = []; + } + return obj; + }, fromPartial(object: Partial): Balance { const message = createBaseBalance(); message.address = object.address ?? ""; @@ -288,10 +336,12 @@ export const Balance = { return message; }, fromAmino(object: BalanceAmino): Balance { - return { - address: object.address, - coins: Array.isArray(object?.coins) ? object.coins.map((e: any) => Coin.fromAmino(e)) : [] - }; + const message = createBaseBalance(); + if (object.address !== undefined && object.address !== null) { + message.address = object.address; + } + message.coins = object.coins?.map(e => Coin.fromAmino(e)) || []; + return message; }, toAmino(message: Balance): BalanceAmino { const obj: any = {}; @@ -325,80 +375,5 @@ export const Balance = { }; } }; -function createBaseGenesisSupplyOffset(): GenesisSupplyOffset { - return { - denom: "", - offset: "" - }; -} -export const GenesisSupplyOffset = { - typeUrl: "/cosmos.bank.v1beta1.GenesisSupplyOffset", - encode(message: GenesisSupplyOffset, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { - if (message.denom !== "") { - writer.uint32(10).string(message.denom); - } - if (message.offset !== "") { - writer.uint32(18).string(message.offset); - } - return writer; - }, - decode(input: BinaryReader | Uint8Array, length?: number): GenesisSupplyOffset { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseGenesisSupplyOffset(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.denom = reader.string(); - break; - case 2: - message.offset = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - fromPartial(object: Partial): GenesisSupplyOffset { - const message = createBaseGenesisSupplyOffset(); - message.denom = object.denom ?? ""; - message.offset = object.offset ?? ""; - return message; - }, - fromAmino(object: GenesisSupplyOffsetAmino): GenesisSupplyOffset { - return { - denom: object.denom, - offset: object.offset - }; - }, - toAmino(message: GenesisSupplyOffset): GenesisSupplyOffsetAmino { - const obj: any = {}; - obj.denom = message.denom; - obj.offset = message.offset; - return obj; - }, - fromAminoMsg(object: GenesisSupplyOffsetAminoMsg): GenesisSupplyOffset { - return GenesisSupplyOffset.fromAmino(object.value); - }, - toAminoMsg(message: GenesisSupplyOffset): GenesisSupplyOffsetAminoMsg { - return { - type: "cosmos-sdk/GenesisSupplyOffset", - value: GenesisSupplyOffset.toAmino(message) - }; - }, - fromProtoMsg(message: GenesisSupplyOffsetProtoMsg): GenesisSupplyOffset { - return GenesisSupplyOffset.decode(message.value); - }, - toProto(message: GenesisSupplyOffset): Uint8Array { - return GenesisSupplyOffset.encode(message).finish(); - }, - toProtoMsg(message: GenesisSupplyOffset): GenesisSupplyOffsetProtoMsg { - return { - typeUrl: "/cosmos.bank.v1beta1.GenesisSupplyOffset", - value: GenesisSupplyOffset.encode(message).finish() - }; - } -}; \ No newline at end of file +GlobalDecoderRegistry.register(Balance.typeUrl, Balance); +GlobalDecoderRegistry.registerAminoProtoMapping(Balance.aminoType, Balance.typeUrl); \ No newline at end of file diff --git a/packages/osmojs/src/codegen/cosmos/bank/v1beta1/query.lcd.ts b/packages/osmojs/src/codegen/cosmos/bank/v1beta1/query.lcd.ts index f0b7f999a..51f71073a 100644 --- a/packages/osmojs/src/codegen/cosmos/bank/v1beta1/query.lcd.ts +++ b/packages/osmojs/src/codegen/cosmos/bank/v1beta1/query.lcd.ts @@ -1,6 +1,6 @@ import { setPaginationParams } from "../../../helpers"; import { LCDClient } from "@cosmology/lcd"; -import { QueryBalanceRequest, QueryBalanceResponseSDKType, QueryAllBalancesRequest, QueryAllBalancesResponseSDKType, QueryTotalSupplyRequest, QueryTotalSupplyResponseSDKType, QuerySupplyOfRequest, QuerySupplyOfResponseSDKType, QueryTotalSupplyWithoutOffsetRequest, QueryTotalSupplyWithoutOffsetResponseSDKType, QuerySupplyOfWithoutOffsetRequest, QuerySupplyOfWithoutOffsetResponseSDKType, QueryParamsRequest, QueryParamsResponseSDKType, QueryDenomMetadataRequest, QueryDenomMetadataResponseSDKType, QueryDenomsMetadataRequest, QueryDenomsMetadataResponseSDKType, QueryBaseDenomRequest, QueryBaseDenomResponseSDKType } from "./query"; +import { QueryBalanceRequest, QueryBalanceResponseSDKType, QueryAllBalancesRequest, QueryAllBalancesResponseSDKType, QuerySpendableBalancesRequest, QuerySpendableBalancesResponseSDKType, QuerySpendableBalanceByDenomRequest, QuerySpendableBalanceByDenomResponseSDKType, QueryTotalSupplyRequest, QueryTotalSupplyResponseSDKType, QuerySupplyOfRequest, QuerySupplyOfResponseSDKType, QueryTotalSupplyWithoutOffsetRequest, QueryTotalSupplyWithoutOffsetResponseSDKType, QuerySupplyOfWithoutOffsetRequest, QuerySupplyOfWithoutOffsetResponseSDKType, QueryParamsRequest, QueryParamsResponseSDKType, QueryDenomMetadataRequest, QueryDenomMetadataResponseSDKType, QueryDenomsMetadataRequest, QueryDenomsMetadataResponseSDKType, QueryDenomOwnersRequest, QueryDenomOwnersResponseSDKType, QuerySendEnabledRequest, QuerySendEnabledResponseSDKType } from "./query"; export class LCDQueryClient { req: LCDClient; constructor({ @@ -11,6 +11,8 @@ export class LCDQueryClient { this.req = requestClient; this.balance = this.balance.bind(this); this.allBalances = this.allBalances.bind(this); + this.spendableBalances = this.spendableBalances.bind(this); + this.spendableBalanceByDenom = this.spendableBalanceByDenom.bind(this); this.totalSupply = this.totalSupply.bind(this); this.supplyOf = this.supplyOf.bind(this); this.totalSupplyWithoutOffset = this.totalSupplyWithoutOffset.bind(this); @@ -18,7 +20,8 @@ export class LCDQueryClient { this.params = this.params.bind(this); this.denomMetadata = this.denomMetadata.bind(this); this.denomsMetadata = this.denomsMetadata.bind(this); - this.baseDenom = this.baseDenom.bind(this); + this.denomOwners = this.denomOwners.bind(this); + this.sendEnabled = this.sendEnabled.bind(this); } /* Balance queries the balance of a single coin for a single account. */ async balance(params: QueryBalanceRequest): Promise { @@ -31,7 +34,10 @@ export class LCDQueryClient { const endpoint = `cosmos/bank/v1beta1/balances/${params.address}/by_denom`; return await this.req.get(endpoint, options); } - /* AllBalances queries the balance of all coins for a single account. */ + /* AllBalances queries the balance of all coins for a single account. + + When called from another module, this query might consume a high amount of + gas if the pagination field is incorrectly set. */ async allBalances(params: QueryAllBalancesRequest): Promise { const options: any = { params: {} @@ -42,7 +48,44 @@ export class LCDQueryClient { const endpoint = `cosmos/bank/v1beta1/balances/${params.address}`; return await this.req.get(endpoint, options); } - /* TotalSupply queries the total supply of all coins. */ + /* SpendableBalances queries the spendable balance of all coins for a single + account. + + When called from another module, this query might consume a high amount of + gas if the pagination field is incorrectly set. + + Since: cosmos-sdk 0.46 */ + async spendableBalances(params: QuerySpendableBalancesRequest): Promise { + const options: any = { + params: {} + }; + if (typeof params?.pagination !== "undefined") { + setPaginationParams(options, params.pagination); + } + const endpoint = `cosmos/bank/v1beta1/spendable_balances/${params.address}`; + return await this.req.get(endpoint, options); + } + /* SpendableBalanceByDenom queries the spendable balance of a single denom for + a single account. + + When called from another module, this query might consume a high amount of + gas if the pagination field is incorrectly set. + + Since: cosmos-sdk 0.47 */ + async spendableBalanceByDenom(params: QuerySpendableBalanceByDenomRequest): Promise { + const options: any = { + params: {} + }; + if (typeof params?.denom !== "undefined") { + options.params.denom = params.denom; + } + const endpoint = `cosmos/bank/v1beta1/spendable_balances/${params.address}/by_denom`; + return await this.req.get(endpoint, options); + } + /* TotalSupply queries the total supply of all coins. + + When called from another module, this query might consume a high amount of + gas if the pagination field is incorrectly set. */ async totalSupply(params: QueryTotalSupplyRequest = { pagination: undefined }): Promise { @@ -55,10 +98,19 @@ export class LCDQueryClient { const endpoint = `cosmos/bank/v1beta1/supply`; return await this.req.get(endpoint, options); } - /* SupplyOf queries the supply of a single coin. */ + /* SupplyOf queries the supply of a single coin. + + When called from another module, this query might consume a high amount of + gas if the pagination field is incorrectly set. */ async supplyOf(params: QuerySupplyOfRequest): Promise { - const endpoint = `cosmos/bank/v1beta1/supply/${params.denom}`; - return await this.req.get(endpoint); + const options: any = { + params: {} + }; + if (typeof params?.denom !== "undefined") { + options.params.denom = params.denom; + } + const endpoint = `cosmos/bank/v1beta1/supply/by_denom`; + return await this.req.get(endpoint, options); } /* TotalSupplyWithoutOffset queries the total supply of all coins. */ async totalSupplyWithoutOffset(params: QueryTotalSupplyWithoutOffsetRequest = { @@ -88,7 +140,8 @@ export class LCDQueryClient { const endpoint = `cosmos/bank/v1beta1/denoms_metadata/${params.denom}`; return await this.req.get(endpoint); } - /* DenomsMetadata queries the client metadata for all registered coin denominations. */ + /* DenomsMetadata queries the client metadata for all registered coin + denominations. */ async denomsMetadata(params: QueryDenomsMetadataRequest = { pagination: undefined }): Promise { @@ -101,16 +154,41 @@ export class LCDQueryClient { const endpoint = `cosmos/bank/v1beta1/denoms_metadata`; return await this.req.get(endpoint, options); } - /* BaseDenom queries for a base denomination given a denom that can either be - the base denom itself or a metadata denom unit that maps to the base denom. */ - async baseDenom(params: QueryBaseDenomRequest): Promise { + /* DenomOwners queries for all account addresses that own a particular token + denomination. + + When called from another module, this query might consume a high amount of + gas if the pagination field is incorrectly set. + + Since: cosmos-sdk 0.46 */ + async denomOwners(params: QueryDenomOwnersRequest): Promise { const options: any = { params: {} }; - if (typeof params?.denom !== "undefined") { - options.params.denom = params.denom; + if (typeof params?.pagination !== "undefined") { + setPaginationParams(options, params.pagination); + } + const endpoint = `cosmos/bank/v1beta1/denom_owners/${params.denom}`; + return await this.req.get(endpoint, options); + } + /* SendEnabled queries for SendEnabled entries. + + This query only returns denominations that have specific SendEnabled settings. + Any denomination that does not have a specific setting will use the default + params.default_send_enabled, and will not be returned by this query. + + Since: cosmos-sdk 0.47 */ + async sendEnabled(params: QuerySendEnabledRequest): Promise { + const options: any = { + params: {} + }; + if (typeof params?.denoms !== "undefined") { + options.params.denoms = params.denoms; + } + if (typeof params?.pagination !== "undefined") { + setPaginationParams(options, params.pagination); } - const endpoint = `cosmos/bank/v1beta1/base_denom`; - return await this.req.get(endpoint, options); + const endpoint = `cosmos/bank/v1beta1/send_enabled`; + return await this.req.get(endpoint, options); } } \ No newline at end of file diff --git a/packages/osmojs/src/codegen/cosmos/bank/v1beta1/query.rpc.Query.ts b/packages/osmojs/src/codegen/cosmos/bank/v1beta1/query.rpc.Query.ts index ecb25cdd9..e227e7830 100644 --- a/packages/osmojs/src/codegen/cosmos/bank/v1beta1/query.rpc.Query.ts +++ b/packages/osmojs/src/codegen/cosmos/bank/v1beta1/query.rpc.Query.ts @@ -1,16 +1,51 @@ import { Rpc } from "../../../helpers"; import { BinaryReader } from "../../../binary"; import { QueryClient, createProtobufRpcClient } from "@cosmjs/stargate"; -import { QueryBalanceRequest, QueryBalanceResponse, QueryAllBalancesRequest, QueryAllBalancesResponse, QueryTotalSupplyRequest, QueryTotalSupplyResponse, QuerySupplyOfRequest, QuerySupplyOfResponse, QueryTotalSupplyWithoutOffsetRequest, QueryTotalSupplyWithoutOffsetResponse, QuerySupplyOfWithoutOffsetRequest, QuerySupplyOfWithoutOffsetResponse, QueryParamsRequest, QueryParamsResponse, QueryDenomMetadataRequest, QueryDenomMetadataResponse, QueryDenomsMetadataRequest, QueryDenomsMetadataResponse, QueryBaseDenomRequest, QueryBaseDenomResponse } from "./query"; +import { QueryBalanceRequest, QueryBalanceResponse, QueryAllBalancesRequest, QueryAllBalancesResponse, QuerySpendableBalancesRequest, QuerySpendableBalancesResponse, QuerySpendableBalanceByDenomRequest, QuerySpendableBalanceByDenomResponse, QueryTotalSupplyRequest, QueryTotalSupplyResponse, QuerySupplyOfRequest, QuerySupplyOfResponse, QueryTotalSupplyWithoutOffsetRequest, QueryTotalSupplyWithoutOffsetResponse, QuerySupplyOfWithoutOffsetRequest, QuerySupplyOfWithoutOffsetResponse, QueryParamsRequest, QueryParamsResponse, QueryDenomMetadataRequest, QueryDenomMetadataResponse, QueryDenomsMetadataRequest, QueryDenomsMetadataResponse, QueryDenomOwnersRequest, QueryDenomOwnersResponse, QuerySendEnabledRequest, QuerySendEnabledResponse } from "./query"; /** 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; - /** AllBalances queries the balance of all coins for a single account. */ + /** + * AllBalances queries the balance of all coins for a single account. + * + * When called from another module, this query might consume a high amount of + * gas if the pagination field is incorrectly set. + */ allBalances(request: QueryAllBalancesRequest): Promise; - /** TotalSupply queries the total supply of all coins. */ + /** + * SpendableBalances queries the spendable balance of all coins for a single + * account. + * + * When called from another module, this query might consume a high amount of + * gas if the pagination field is incorrectly set. + * + * Since: cosmos-sdk 0.46 + */ + spendableBalances(request: QuerySpendableBalancesRequest): Promise; + /** + * SpendableBalanceByDenom queries the spendable balance of a single denom for + * a single account. + * + * When called from another module, this query might consume a high amount of + * gas if the pagination field is incorrectly set. + * + * Since: cosmos-sdk 0.47 + */ + spendableBalanceByDenom(request: QuerySpendableBalanceByDenomRequest): Promise; + /** + * TotalSupply queries the total supply of all coins. + * + * When called from another module, this query might consume a high amount of + * gas if the pagination field is incorrectly set. + */ totalSupply(request?: QueryTotalSupplyRequest): Promise; - /** SupplyOf queries the supply of a single coin. */ + /** + * SupplyOf queries the supply of a single coin. + * + * When called from another module, this query might consume a high amount of + * gas if the pagination field is incorrectly set. + */ supplyOf(request: QuerySupplyOfRequest): Promise; /** TotalSupplyWithoutOffset queries the total supply of all coins. */ totalSupplyWithoutOffset(request?: QueryTotalSupplyWithoutOffsetRequest): Promise; @@ -20,13 +55,31 @@ export interface Query { params(request?: QueryParamsRequest): Promise; /** DenomsMetadata queries the client metadata of a given coin denomination. */ denomMetadata(request: QueryDenomMetadataRequest): Promise; - /** DenomsMetadata queries the client metadata for all registered coin denominations. */ + /** + * DenomsMetadata queries the client metadata for all registered coin + * denominations. + */ denomsMetadata(request?: QueryDenomsMetadataRequest): Promise; /** - * BaseDenom queries for a base denomination given a denom that can either be - * the base denom itself or a metadata denom unit that maps to the base denom. + * DenomOwners queries for all account addresses that own a particular token + * denomination. + * + * When called from another module, this query might consume a high amount of + * gas if the pagination field is incorrectly set. + * + * Since: cosmos-sdk 0.46 */ - baseDenom(request: QueryBaseDenomRequest): Promise; + denomOwners(request: QueryDenomOwnersRequest): Promise; + /** + * SendEnabled queries for SendEnabled entries. + * + * This query only returns denominations that have specific SendEnabled settings. + * Any denomination that does not have a specific setting will use the default + * params.default_send_enabled, and will not be returned by this query. + * + * Since: cosmos-sdk 0.47 + */ + sendEnabled(request: QuerySendEnabledRequest): Promise; } export class QueryClientImpl implements Query { private readonly rpc: Rpc; @@ -34,6 +87,8 @@ export class QueryClientImpl implements Query { this.rpc = rpc; this.balance = this.balance.bind(this); this.allBalances = this.allBalances.bind(this); + this.spendableBalances = this.spendableBalances.bind(this); + this.spendableBalanceByDenom = this.spendableBalanceByDenom.bind(this); this.totalSupply = this.totalSupply.bind(this); this.supplyOf = this.supplyOf.bind(this); this.totalSupplyWithoutOffset = this.totalSupplyWithoutOffset.bind(this); @@ -41,7 +96,8 @@ export class QueryClientImpl implements Query { this.params = this.params.bind(this); this.denomMetadata = this.denomMetadata.bind(this); this.denomsMetadata = this.denomsMetadata.bind(this); - this.baseDenom = this.baseDenom.bind(this); + this.denomOwners = this.denomOwners.bind(this); + this.sendEnabled = this.sendEnabled.bind(this); } balance(request: QueryBalanceRequest): Promise { const data = QueryBalanceRequest.encode(request).finish(); @@ -53,6 +109,16 @@ export class QueryClientImpl implements Query { const promise = this.rpc.request("cosmos.bank.v1beta1.Query", "AllBalances", data); return promise.then(data => QueryAllBalancesResponse.decode(new BinaryReader(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 BinaryReader(data))); + } + spendableBalanceByDenom(request: QuerySpendableBalanceByDenomRequest): Promise { + const data = QuerySpendableBalanceByDenomRequest.encode(request).finish(); + const promise = this.rpc.request("cosmos.bank.v1beta1.Query", "SpendableBalanceByDenom", data); + return promise.then(data => QuerySpendableBalanceByDenomResponse.decode(new BinaryReader(data))); + } totalSupply(request: QueryTotalSupplyRequest = { pagination: undefined }): Promise { @@ -94,10 +160,15 @@ export class QueryClientImpl implements Query { const promise = this.rpc.request("cosmos.bank.v1beta1.Query", "DenomsMetadata", data); return promise.then(data => QueryDenomsMetadataResponse.decode(new BinaryReader(data))); } - baseDenom(request: QueryBaseDenomRequest): Promise { - const data = QueryBaseDenomRequest.encode(request).finish(); - const promise = this.rpc.request("cosmos.bank.v1beta1.Query", "BaseDenom", data); - return promise.then(data => QueryBaseDenomResponse.decode(new BinaryReader(data))); + denomOwners(request: QueryDenomOwnersRequest): Promise { + const data = QueryDenomOwnersRequest.encode(request).finish(); + const promise = this.rpc.request("cosmos.bank.v1beta1.Query", "DenomOwners", data); + return promise.then(data => QueryDenomOwnersResponse.decode(new BinaryReader(data))); + } + sendEnabled(request: QuerySendEnabledRequest): Promise { + const data = QuerySendEnabledRequest.encode(request).finish(); + const promise = this.rpc.request("cosmos.bank.v1beta1.Query", "SendEnabled", data); + return promise.then(data => QuerySendEnabledResponse.decode(new BinaryReader(data))); } } export const createRpcQueryExtension = (base: QueryClient) => { @@ -110,6 +181,12 @@ export const createRpcQueryExtension = (base: QueryClient) => { allBalances(request: QueryAllBalancesRequest): Promise { return queryService.allBalances(request); }, + spendableBalances(request: QuerySpendableBalancesRequest): Promise { + return queryService.spendableBalances(request); + }, + spendableBalanceByDenom(request: QuerySpendableBalanceByDenomRequest): Promise { + return queryService.spendableBalanceByDenom(request); + }, totalSupply(request?: QueryTotalSupplyRequest): Promise { return queryService.totalSupply(request); }, @@ -131,8 +208,11 @@ export const createRpcQueryExtension = (base: QueryClient) => { denomsMetadata(request?: QueryDenomsMetadataRequest): Promise { return queryService.denomsMetadata(request); }, - baseDenom(request: QueryBaseDenomRequest): Promise { - return queryService.baseDenom(request); + denomOwners(request: QueryDenomOwnersRequest): Promise { + return queryService.denomOwners(request); + }, + sendEnabled(request: QuerySendEnabledRequest): Promise { + return queryService.sendEnabled(request); } }; }; \ No newline at end of file diff --git a/packages/osmojs/src/codegen/cosmos/bank/v1beta1/query.ts b/packages/osmojs/src/codegen/cosmos/bank/v1beta1/query.ts index ebd116310..d11af7f0d 100644 --- a/packages/osmojs/src/codegen/cosmos/bank/v1beta1/query.ts +++ b/packages/osmojs/src/codegen/cosmos/bank/v1beta1/query.ts @@ -1,7 +1,9 @@ import { PageRequest, PageRequestAmino, PageRequestSDKType, PageResponse, PageResponseAmino, PageResponseSDKType } from "../../base/query/v1beta1/pagination"; import { Coin, CoinAmino, CoinSDKType } from "../../base/v1beta1/coin"; -import { Params, ParamsAmino, ParamsSDKType, Metadata, MetadataAmino, MetadataSDKType } from "./bank"; +import { Params, ParamsAmino, ParamsSDKType, Metadata, MetadataAmino, MetadataSDKType, SendEnabled, SendEnabledAmino, SendEnabledSDKType } from "./bank"; import { BinaryReader, BinaryWriter } from "../../../binary"; +import { isSet } from "../../../helpers"; +import { GlobalDecoderRegistry } from "../../../registry"; /** QueryBalanceRequest is the request type for the Query/Balance RPC method. */ export interface QueryBalanceRequest { /** address is the address to query balances for. */ @@ -16,9 +18,9 @@ export interface QueryBalanceRequestProtoMsg { /** QueryBalanceRequest is the request type for the Query/Balance RPC method. */ export interface QueryBalanceRequestAmino { /** 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; } export interface QueryBalanceRequestAminoMsg { type: "cosmos-sdk/QueryBalanceRequest"; @@ -32,7 +34,7 @@ export interface QueryBalanceRequestSDKType { /** 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; } export interface QueryBalanceResponseProtoMsg { typeUrl: "/cosmos.bank.v1beta1.QueryBalanceResponse"; @@ -49,14 +51,14 @@ export interface QueryBalanceResponseAminoMsg { } /** QueryBalanceResponse is the response type for the Query/Balance RPC method. */ export interface QueryBalanceResponseSDKType { - balance: CoinSDKType; + balance?: CoinSDKType; } /** QueryBalanceRequest is the request type for the Query/AllBalances RPC method. */ export interface QueryAllBalancesRequest { /** address is the address to query balances for. */ address: string; /** pagination defines an optional pagination for the request. */ - pagination: PageRequest; + pagination?: PageRequest; } export interface QueryAllBalancesRequestProtoMsg { typeUrl: "/cosmos.bank.v1beta1.QueryAllBalancesRequest"; @@ -65,7 +67,7 @@ export interface QueryAllBalancesRequestProtoMsg { /** QueryBalanceRequest is the request type for the Query/AllBalances RPC method. */ export interface QueryAllBalancesRequestAmino { /** address is the address to query balances for. */ - address: string; + address?: string; /** pagination defines an optional pagination for the request. */ pagination?: PageRequestAmino; } @@ -76,7 +78,7 @@ export interface QueryAllBalancesRequestAminoMsg { /** QueryBalanceRequest is the request type for the Query/AllBalances RPC method. */ export interface QueryAllBalancesRequestSDKType { address: string; - pagination: PageRequestSDKType; + pagination?: PageRequestSDKType; } /** * QueryAllBalancesResponse is the response type for the Query/AllBalances RPC @@ -86,7 +88,7 @@ export interface QueryAllBalancesResponse { /** balances is the balances of all the coins. */ balances: Coin[]; /** pagination defines the pagination in the response. */ - pagination: PageResponse; + pagination?: PageResponse; } export interface QueryAllBalancesResponseProtoMsg { typeUrl: "/cosmos.bank.v1beta1.QueryAllBalancesResponse"; @@ -112,7 +114,170 @@ export interface QueryAllBalancesResponseAminoMsg { */ export interface QueryAllBalancesResponseSDKType { balances: CoinSDKType[]; - pagination: PageResponseSDKType; + pagination?: PageResponseSDKType; +} +/** + * QuerySpendableBalancesRequest defines the gRPC request structure for querying + * an account's spendable balances. + * + * Since: cosmos-sdk 0.46 + */ +export interface QuerySpendableBalancesRequest { + /** address is the address to query spendable balances for. */ + address: string; + /** pagination defines an optional pagination for the request. */ + pagination?: PageRequest; +} +export interface QuerySpendableBalancesRequestProtoMsg { + typeUrl: "/cosmos.bank.v1beta1.QuerySpendableBalancesRequest"; + value: Uint8Array; +} +/** + * QuerySpendableBalancesRequest defines the gRPC request structure for querying + * an account's spendable balances. + * + * Since: cosmos-sdk 0.46 + */ +export interface QuerySpendableBalancesRequestAmino { + /** address is the address to query spendable balances for. */ + address?: string; + /** pagination defines an optional pagination for the request. */ + pagination?: PageRequestAmino; +} +export interface QuerySpendableBalancesRequestAminoMsg { + type: "cosmos-sdk/QuerySpendableBalancesRequest"; + value: QuerySpendableBalancesRequestAmino; +} +/** + * QuerySpendableBalancesRequest defines the gRPC request structure for querying + * an account's spendable balances. + * + * Since: cosmos-sdk 0.46 + */ +export interface QuerySpendableBalancesRequestSDKType { + address: string; + pagination?: PageRequestSDKType; +} +/** + * QuerySpendableBalancesResponse defines the gRPC response structure for querying + * an account's spendable balances. + * + * Since: cosmos-sdk 0.46 + */ +export interface QuerySpendableBalancesResponse { + /** balances is the spendable balances of all the coins. */ + balances: Coin[]; + /** pagination defines the pagination in the response. */ + pagination?: PageResponse; +} +export interface QuerySpendableBalancesResponseProtoMsg { + typeUrl: "/cosmos.bank.v1beta1.QuerySpendableBalancesResponse"; + value: Uint8Array; +} +/** + * QuerySpendableBalancesResponse defines the gRPC response structure for querying + * an account's spendable balances. + * + * Since: cosmos-sdk 0.46 + */ +export interface QuerySpendableBalancesResponseAmino { + /** balances is the spendable balances of all the coins. */ + balances: CoinAmino[]; + /** pagination defines the pagination in the response. */ + pagination?: PageResponseAmino; +} +export interface QuerySpendableBalancesResponseAminoMsg { + type: "cosmos-sdk/QuerySpendableBalancesResponse"; + value: QuerySpendableBalancesResponseAmino; +} +/** + * QuerySpendableBalancesResponse defines the gRPC response structure for querying + * an account's spendable balances. + * + * Since: cosmos-sdk 0.46 + */ +export interface QuerySpendableBalancesResponseSDKType { + balances: CoinSDKType[]; + pagination?: PageResponseSDKType; +} +/** + * QuerySpendableBalanceByDenomRequest defines the gRPC request structure for + * querying an account's spendable balance for a specific denom. + * + * Since: cosmos-sdk 0.47 + */ +export interface QuerySpendableBalanceByDenomRequest { + /** address is the address to query balances for. */ + address: string; + /** denom is the coin denom to query balances for. */ + denom: string; +} +export interface QuerySpendableBalanceByDenomRequestProtoMsg { + typeUrl: "/cosmos.bank.v1beta1.QuerySpendableBalanceByDenomRequest"; + value: Uint8Array; +} +/** + * QuerySpendableBalanceByDenomRequest defines the gRPC request structure for + * querying an account's spendable balance for a specific denom. + * + * Since: cosmos-sdk 0.47 + */ +export interface QuerySpendableBalanceByDenomRequestAmino { + /** address is the address to query balances for. */ + address?: string; + /** denom is the coin denom to query balances for. */ + denom?: string; +} +export interface QuerySpendableBalanceByDenomRequestAminoMsg { + type: "cosmos-sdk/QuerySpendableBalanceByDenomRequest"; + value: QuerySpendableBalanceByDenomRequestAmino; +} +/** + * QuerySpendableBalanceByDenomRequest defines the gRPC request structure for + * querying an account's spendable balance for a specific denom. + * + * Since: cosmos-sdk 0.47 + */ +export interface QuerySpendableBalanceByDenomRequestSDKType { + address: string; + denom: string; +} +/** + * QuerySpendableBalanceByDenomResponse defines the gRPC response structure for + * querying an account's spendable balance for a specific denom. + * + * Since: cosmos-sdk 0.47 + */ +export interface QuerySpendableBalanceByDenomResponse { + /** balance is the balance of the coin. */ + balance?: Coin; +} +export interface QuerySpendableBalanceByDenomResponseProtoMsg { + typeUrl: "/cosmos.bank.v1beta1.QuerySpendableBalanceByDenomResponse"; + value: Uint8Array; +} +/** + * QuerySpendableBalanceByDenomResponse defines the gRPC response structure for + * querying an account's spendable balance for a specific denom. + * + * Since: cosmos-sdk 0.47 + */ +export interface QuerySpendableBalanceByDenomResponseAmino { + /** balance is the balance of the coin. */ + balance?: CoinAmino; +} +export interface QuerySpendableBalanceByDenomResponseAminoMsg { + type: "cosmos-sdk/QuerySpendableBalanceByDenomResponse"; + value: QuerySpendableBalanceByDenomResponseAmino; +} +/** + * QuerySpendableBalanceByDenomResponse defines the gRPC response structure for + * querying an account's spendable balance for a specific denom. + * + * Since: cosmos-sdk 0.47 + */ +export interface QuerySpendableBalanceByDenomResponseSDKType { + balance?: CoinSDKType; } /** * QueryTotalSupplyRequest is the request type for the Query/TotalSupply RPC @@ -124,7 +289,7 @@ export interface QueryTotalSupplyRequest { * * Since: cosmos-sdk 0.43 */ - pagination: PageRequest; + pagination?: PageRequest; } export interface QueryTotalSupplyRequestProtoMsg { typeUrl: "/cosmos.bank.v1beta1.QueryTotalSupplyRequest"; @@ -151,7 +316,7 @@ export interface QueryTotalSupplyRequestAminoMsg { * method. */ export interface QueryTotalSupplyRequestSDKType { - pagination: PageRequestSDKType; + pagination?: PageRequestSDKType; } /** * QueryTotalSupplyResponse is the response type for the Query/TotalSupply RPC @@ -165,7 +330,7 @@ export interface QueryTotalSupplyResponse { * * Since: cosmos-sdk 0.43 */ - pagination: PageResponse; + pagination?: PageResponse; } export interface QueryTotalSupplyResponseProtoMsg { typeUrl: "/cosmos.bank.v1beta1.QueryTotalSupplyResponse"; @@ -195,7 +360,7 @@ export interface QueryTotalSupplyResponseAminoMsg { */ export interface QueryTotalSupplyResponseSDKType { supply: CoinSDKType[]; - pagination: PageResponseSDKType; + pagination?: PageResponseSDKType; } /** QuerySupplyOfRequest is the request type for the Query/SupplyOf RPC method. */ export interface QuerySupplyOfRequest { @@ -209,7 +374,7 @@ export interface QuerySupplyOfRequestProtoMsg { /** QuerySupplyOfRequest is the request type for the Query/SupplyOf RPC method. */ export interface QuerySupplyOfRequestAmino { /** denom is the coin denom to query balances for. */ - denom: string; + denom?: string; } export interface QuerySupplyOfRequestAminoMsg { type: "cosmos-sdk/QuerySupplyOfRequest"; @@ -231,7 +396,7 @@ export interface QuerySupplyOfResponseProtoMsg { /** QuerySupplyOfResponse is the response type for the Query/SupplyOf RPC method. */ export interface QuerySupplyOfResponseAmino { /** amount is the supply of the coin. */ - amount?: CoinAmino; + amount: CoinAmino; } export interface QuerySupplyOfResponseAminoMsg { type: "cosmos-sdk/QuerySupplyOfResponse"; @@ -251,7 +416,7 @@ export interface QueryTotalSupplyWithoutOffsetRequest { * * Since: cosmos-sdk 0.43 */ - pagination: PageRequest; + pagination?: PageRequest; } export interface QueryTotalSupplyWithoutOffsetRequestProtoMsg { typeUrl: "/cosmos.bank.v1beta1.QueryTotalSupplyWithoutOffsetRequest"; @@ -278,7 +443,7 @@ export interface QueryTotalSupplyWithoutOffsetRequestAminoMsg { * method. */ export interface QueryTotalSupplyWithoutOffsetRequestSDKType { - pagination: PageRequestSDKType; + pagination?: PageRequestSDKType; } /** * QueryTotalSupplyWithoutOffsetResponse is the response type for the Query/TotalSupplyWithoutOffset RPC @@ -292,7 +457,7 @@ export interface QueryTotalSupplyWithoutOffsetResponse { * * Since: cosmos-sdk 0.43 */ - pagination: PageResponse; + pagination?: PageResponse; } export interface QueryTotalSupplyWithoutOffsetResponseProtoMsg { typeUrl: "/cosmos.bank.v1beta1.QueryTotalSupplyWithoutOffsetResponse"; @@ -304,7 +469,7 @@ export interface QueryTotalSupplyWithoutOffsetResponseProtoMsg { */ export interface QueryTotalSupplyWithoutOffsetResponseAmino { /** supply is the supply of the coins */ - supply: CoinAmino[]; + supply?: CoinAmino[]; /** * pagination defines the pagination in the response. * @@ -322,7 +487,7 @@ export interface QueryTotalSupplyWithoutOffsetResponseAminoMsg { */ export interface QueryTotalSupplyWithoutOffsetResponseSDKType { supply: CoinSDKType[]; - pagination: PageResponseSDKType; + pagination?: PageResponseSDKType; } /** QuerySupplyOfWithoutOffsetRequest is the request type for the Query/SupplyOfWithoutOffset RPC method. */ export interface QuerySupplyOfWithoutOffsetRequest { @@ -336,7 +501,7 @@ export interface QuerySupplyOfWithoutOffsetRequestProtoMsg { /** QuerySupplyOfWithoutOffsetRequest is the request type for the Query/SupplyOfWithoutOffset RPC method. */ export interface QuerySupplyOfWithoutOffsetRequestAmino { /** denom is the coin denom to query balances for. */ - denom: string; + denom?: string; } export interface QuerySupplyOfWithoutOffsetRequestAminoMsg { type: "cosmos-sdk/QuerySupplyOfWithoutOffsetRequest"; @@ -392,7 +557,7 @@ export interface QueryParamsResponseProtoMsg { } /** QueryParamsResponse defines the response type for querying x/bank parameters. */ export interface QueryParamsResponseAmino { - params?: ParamsAmino; + params: ParamsAmino; } export interface QueryParamsResponseAminoMsg { type: "cosmos-sdk/QueryParamsResponse"; @@ -405,7 +570,7 @@ export interface QueryParamsResponseSDKType { /** 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; } export interface QueryDenomsMetadataRequestProtoMsg { typeUrl: "/cosmos.bank.v1beta1.QueryDenomsMetadataRequest"; @@ -422,7 +587,7 @@ export interface QueryDenomsMetadataRequestAminoMsg { } /** QueryDenomsMetadataRequest is the request type for the Query/DenomsMetadata RPC method. */ export interface QueryDenomsMetadataRequestSDKType { - pagination: PageRequestSDKType; + pagination?: PageRequestSDKType; } /** * QueryDenomsMetadataResponse is the response type for the Query/DenomsMetadata RPC @@ -432,7 +597,7 @@ export interface QueryDenomsMetadataResponse { /** metadata provides the client information for all the registered tokens. */ metadatas: Metadata[]; /** pagination defines the pagination in the response. */ - pagination: PageResponse; + pagination?: PageResponse; } export interface QueryDenomsMetadataResponseProtoMsg { typeUrl: "/cosmos.bank.v1beta1.QueryDenomsMetadataResponse"; @@ -458,7 +623,7 @@ export interface QueryDenomsMetadataResponseAminoMsg { */ export interface QueryDenomsMetadataResponseSDKType { metadatas: MetadataSDKType[]; - pagination: PageResponseSDKType; + pagination?: PageResponseSDKType; } /** QueryDenomMetadataRequest is the request type for the Query/DenomMetadata RPC method. */ export interface QueryDenomMetadataRequest { @@ -472,7 +637,7 @@ export interface QueryDenomMetadataRequestProtoMsg { /** QueryDenomMetadataRequest is the request type for the Query/DenomMetadata RPC method. */ export interface QueryDenomMetadataRequestAmino { /** denom is the coin denom to query the metadata for. */ - denom: string; + denom?: string; } export interface QueryDenomMetadataRequestAminoMsg { type: "cosmos-sdk/QueryDenomMetadataRequest"; @@ -500,7 +665,7 @@ export interface QueryDenomMetadataResponseProtoMsg { */ export interface QueryDenomMetadataResponseAmino { /** metadata describes and provides all the client information for the requested token. */ - metadata?: MetadataAmino; + metadata: MetadataAmino; } export interface QueryDenomMetadataResponseAminoMsg { type: "cosmos-sdk/QueryDenomMetadataResponse"; @@ -513,45 +678,214 @@ export interface QueryDenomMetadataResponseAminoMsg { export interface QueryDenomMetadataResponseSDKType { metadata: MetadataSDKType; } -/** QueryBaseDenomRequest defines the request type for the BaseDenom gRPC method. */ -export interface QueryBaseDenomRequest { +/** + * QueryDenomOwnersRequest defines the request type for the DenomOwners RPC query, + * which queries for a paginated set of all account holders of a particular + * denomination. + */ +export interface QueryDenomOwnersRequest { + /** denom defines the coin denomination to query all account holders for. */ denom: string; + /** pagination defines an optional pagination for the request. */ + pagination?: PageRequest; } -export interface QueryBaseDenomRequestProtoMsg { - typeUrl: "/cosmos.bank.v1beta1.QueryBaseDenomRequest"; +export interface QueryDenomOwnersRequestProtoMsg { + typeUrl: "/cosmos.bank.v1beta1.QueryDenomOwnersRequest"; value: Uint8Array; } -/** QueryBaseDenomRequest defines the request type for the BaseDenom gRPC method. */ -export interface QueryBaseDenomRequestAmino { - denom: string; +/** + * QueryDenomOwnersRequest defines the request type for the DenomOwners RPC query, + * which queries for a paginated set of all account holders of a particular + * denomination. + */ +export interface QueryDenomOwnersRequestAmino { + /** denom defines the coin denomination to query all account holders for. */ + denom?: string; + /** pagination defines an optional pagination for the request. */ + pagination?: PageRequestAmino; } -export interface QueryBaseDenomRequestAminoMsg { - type: "cosmos-sdk/QueryBaseDenomRequest"; - value: QueryBaseDenomRequestAmino; +export interface QueryDenomOwnersRequestAminoMsg { + type: "cosmos-sdk/QueryDenomOwnersRequest"; + value: QueryDenomOwnersRequestAmino; } -/** QueryBaseDenomRequest defines the request type for the BaseDenom gRPC method. */ -export interface QueryBaseDenomRequestSDKType { +/** + * QueryDenomOwnersRequest defines the request type for the DenomOwners RPC query, + * which queries for a paginated set of all account holders of a particular + * denomination. + */ +export interface QueryDenomOwnersRequestSDKType { denom: string; + pagination?: PageRequestSDKType; +} +/** + * DenomOwner defines structure representing an account that owns or holds a + * particular denominated token. It contains the account address and account + * balance of the denominated token. + * + * Since: cosmos-sdk 0.46 + */ +export interface DenomOwner { + /** address defines the address that owns a particular denomination. */ + address: string; + /** balance is the balance of the denominated coin for an account. */ + balance: Coin; +} +export interface DenomOwnerProtoMsg { + typeUrl: "/cosmos.bank.v1beta1.DenomOwner"; + value: Uint8Array; +} +/** + * DenomOwner defines structure representing an account that owns or holds a + * particular denominated token. It contains the account address and account + * balance of the denominated token. + * + * Since: cosmos-sdk 0.46 + */ +export interface DenomOwnerAmino { + /** address defines the address that owns a particular denomination. */ + address?: string; + /** balance is the balance of the denominated coin for an account. */ + balance: CoinAmino; +} +export interface DenomOwnerAminoMsg { + type: "cosmos-sdk/DenomOwner"; + value: DenomOwnerAmino; +} +/** + * DenomOwner defines structure representing an account that owns or holds a + * particular denominated token. It contains the account address and account + * balance of the denominated token. + * + * Since: cosmos-sdk 0.46 + */ +export interface DenomOwnerSDKType { + address: string; + balance: CoinSDKType; +} +/** + * QueryDenomOwnersResponse defines the RPC response of a DenomOwners RPC query. + * + * Since: cosmos-sdk 0.46 + */ +export interface QueryDenomOwnersResponse { + denomOwners: DenomOwner[]; + /** pagination defines the pagination in the response. */ + pagination?: PageResponse; +} +export interface QueryDenomOwnersResponseProtoMsg { + typeUrl: "/cosmos.bank.v1beta1.QueryDenomOwnersResponse"; + value: Uint8Array; +} +/** + * QueryDenomOwnersResponse defines the RPC response of a DenomOwners RPC query. + * + * Since: cosmos-sdk 0.46 + */ +export interface QueryDenomOwnersResponseAmino { + denom_owners?: DenomOwnerAmino[]; + /** pagination defines the pagination in the response. */ + pagination?: PageResponseAmino; +} +export interface QueryDenomOwnersResponseAminoMsg { + type: "cosmos-sdk/QueryDenomOwnersResponse"; + value: QueryDenomOwnersResponseAmino; +} +/** + * QueryDenomOwnersResponse defines the RPC response of a DenomOwners RPC query. + * + * Since: cosmos-sdk 0.46 + */ +export interface QueryDenomOwnersResponseSDKType { + denom_owners: DenomOwnerSDKType[]; + pagination?: PageResponseSDKType; +} +/** + * QuerySendEnabledRequest defines the RPC request for looking up SendEnabled entries. + * + * Since: cosmos-sdk 0.47 + */ +export interface QuerySendEnabledRequest { + /** denoms is the specific denoms you want look up. Leave empty to get all entries. */ + denoms: string[]; + /** + * pagination defines an optional pagination for the request. This field is + * only read if the denoms field is empty. + */ + pagination?: PageRequest; +} +export interface QuerySendEnabledRequestProtoMsg { + typeUrl: "/cosmos.bank.v1beta1.QuerySendEnabledRequest"; + value: Uint8Array; } -/** QueryBaseDenomResponse defines the response type for the BaseDenom gRPC method. */ -export interface QueryBaseDenomResponse { - baseDenom: string; +/** + * QuerySendEnabledRequest defines the RPC request for looking up SendEnabled entries. + * + * Since: cosmos-sdk 0.47 + */ +export interface QuerySendEnabledRequestAmino { + /** denoms is the specific denoms you want look up. Leave empty to get all entries. */ + denoms?: string[]; + /** + * pagination defines an optional pagination for the request. This field is + * only read if the denoms field is empty. + */ + pagination?: PageRequestAmino; +} +export interface QuerySendEnabledRequestAminoMsg { + type: "cosmos-sdk/QuerySendEnabledRequest"; + value: QuerySendEnabledRequestAmino; +} +/** + * QuerySendEnabledRequest defines the RPC request for looking up SendEnabled entries. + * + * Since: cosmos-sdk 0.47 + */ +export interface QuerySendEnabledRequestSDKType { + denoms: string[]; + pagination?: PageRequestSDKType; +} +/** + * QuerySendEnabledResponse defines the RPC response of a SendEnable query. + * + * Since: cosmos-sdk 0.47 + */ +export interface QuerySendEnabledResponse { + sendEnabled: SendEnabled[]; + /** + * pagination defines the pagination in the response. This field is only + * populated if the denoms field in the request is empty. + */ + pagination?: PageResponse; } -export interface QueryBaseDenomResponseProtoMsg { - typeUrl: "/cosmos.bank.v1beta1.QueryBaseDenomResponse"; +export interface QuerySendEnabledResponseProtoMsg { + typeUrl: "/cosmos.bank.v1beta1.QuerySendEnabledResponse"; value: Uint8Array; } -/** QueryBaseDenomResponse defines the response type for the BaseDenom gRPC method. */ -export interface QueryBaseDenomResponseAmino { - base_denom: string; +/** + * QuerySendEnabledResponse defines the RPC response of a SendEnable query. + * + * Since: cosmos-sdk 0.47 + */ +export interface QuerySendEnabledResponseAmino { + send_enabled?: SendEnabledAmino[]; + /** + * pagination defines the pagination in the response. This field is only + * populated if the denoms field in the request is empty. + */ + pagination?: PageResponseAmino; } -export interface QueryBaseDenomResponseAminoMsg { - type: "cosmos-sdk/QueryBaseDenomResponse"; - value: QueryBaseDenomResponseAmino; +export interface QuerySendEnabledResponseAminoMsg { + type: "cosmos-sdk/QuerySendEnabledResponse"; + value: QuerySendEnabledResponseAmino; } -/** QueryBaseDenomResponse defines the response type for the BaseDenom gRPC method. */ -export interface QueryBaseDenomResponseSDKType { - base_denom: string; +/** + * QuerySendEnabledResponse defines the RPC response of a SendEnable query. + * + * Since: cosmos-sdk 0.47 + */ +export interface QuerySendEnabledResponseSDKType { + send_enabled: SendEnabledSDKType[]; + pagination?: PageResponseSDKType; } function createBaseQueryBalanceRequest(): QueryBalanceRequest { return { @@ -561,6 +895,16 @@ function createBaseQueryBalanceRequest(): QueryBalanceRequest { } export const QueryBalanceRequest = { typeUrl: "/cosmos.bank.v1beta1.QueryBalanceRequest", + aminoType: "cosmos-sdk/QueryBalanceRequest", + is(o: any): o is QueryBalanceRequest { + return o && (o.$typeUrl === QueryBalanceRequest.typeUrl || typeof o.address === "string" && typeof o.denom === "string"); + }, + isSDK(o: any): o is QueryBalanceRequestSDKType { + return o && (o.$typeUrl === QueryBalanceRequest.typeUrl || typeof o.address === "string" && typeof o.denom === "string"); + }, + isAmino(o: any): o is QueryBalanceRequestAmino { + return o && (o.$typeUrl === QueryBalanceRequest.typeUrl || typeof o.address === "string" && typeof o.denom === "string"); + }, encode(message: QueryBalanceRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.address !== "") { writer.uint32(10).string(message.address); @@ -590,6 +934,18 @@ export const QueryBalanceRequest = { } 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; + }, fromPartial(object: Partial): QueryBalanceRequest { const message = createBaseQueryBalanceRequest(); message.address = object.address ?? ""; @@ -597,10 +953,14 @@ export const QueryBalanceRequest = { return message; }, fromAmino(object: QueryBalanceRequestAmino): QueryBalanceRequest { - return { - address: object.address, - denom: object.denom - }; + const message = createBaseQueryBalanceRequest(); + if (object.address !== undefined && object.address !== null) { + message.address = object.address; + } + if (object.denom !== undefined && object.denom !== null) { + message.denom = object.denom; + } + return message; }, toAmino(message: QueryBalanceRequest): QueryBalanceRequestAmino { const obj: any = {}; @@ -630,6 +990,8 @@ export const QueryBalanceRequest = { }; } }; +GlobalDecoderRegistry.register(QueryBalanceRequest.typeUrl, QueryBalanceRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryBalanceRequest.aminoType, QueryBalanceRequest.typeUrl); function createBaseQueryBalanceResponse(): QueryBalanceResponse { return { balance: undefined @@ -637,6 +999,16 @@ function createBaseQueryBalanceResponse(): QueryBalanceResponse { } export const QueryBalanceResponse = { typeUrl: "/cosmos.bank.v1beta1.QueryBalanceResponse", + aminoType: "cosmos-sdk/QueryBalanceResponse", + is(o: any): o is QueryBalanceResponse { + return o && o.$typeUrl === QueryBalanceResponse.typeUrl; + }, + isSDK(o: any): o is QueryBalanceResponseSDKType { + return o && o.$typeUrl === QueryBalanceResponse.typeUrl; + }, + isAmino(o: any): o is QueryBalanceResponseAmino { + return o && o.$typeUrl === QueryBalanceResponse.typeUrl; + }, encode(message: QueryBalanceResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.balance !== undefined) { Coin.encode(message.balance, writer.uint32(10).fork()).ldelim(); @@ -660,15 +1032,27 @@ export const QueryBalanceResponse = { } return message; }, + fromJSON(object: any): QueryBalanceResponse { + 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; + }, fromPartial(object: Partial): QueryBalanceResponse { const message = createBaseQueryBalanceResponse(); message.balance = object.balance !== undefined && object.balance !== null ? Coin.fromPartial(object.balance) : undefined; return message; }, fromAmino(object: QueryBalanceResponseAmino): QueryBalanceResponse { - return { - balance: object?.balance ? Coin.fromAmino(object.balance) : undefined - }; + const message = createBaseQueryBalanceResponse(); + if (object.balance !== undefined && object.balance !== null) { + message.balance = Coin.fromAmino(object.balance); + } + return message; }, toAmino(message: QueryBalanceResponse): QueryBalanceResponseAmino { const obj: any = {}; @@ -697,14 +1081,26 @@ export const QueryBalanceResponse = { }; } }; +GlobalDecoderRegistry.register(QueryBalanceResponse.typeUrl, QueryBalanceResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryBalanceResponse.aminoType, QueryBalanceResponse.typeUrl); function createBaseQueryAllBalancesRequest(): QueryAllBalancesRequest { return { address: "", - pagination: PageRequest.fromPartial({}) + pagination: undefined }; } export const QueryAllBalancesRequest = { typeUrl: "/cosmos.bank.v1beta1.QueryAllBalancesRequest", + aminoType: "cosmos-sdk/QueryAllBalancesRequest", + is(o: any): o is QueryAllBalancesRequest { + return o && (o.$typeUrl === QueryAllBalancesRequest.typeUrl || typeof o.address === "string"); + }, + isSDK(o: any): o is QueryAllBalancesRequestSDKType { + return o && (o.$typeUrl === QueryAllBalancesRequest.typeUrl || typeof o.address === "string"); + }, + isAmino(o: any): o is QueryAllBalancesRequestAmino { + return o && (o.$typeUrl === QueryAllBalancesRequest.typeUrl || typeof o.address === "string"); + }, encode(message: QueryAllBalancesRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.address !== "") { writer.uint32(10).string(message.address); @@ -734,6 +1130,18 @@ export const QueryAllBalancesRequest = { } return message; }, + fromJSON(object: any): QueryAllBalancesRequest { + return { + address: isSet(object.address) ? String(object.address) : "", + pagination: isSet(object.pagination) ? PageRequest.fromJSON(object.pagination) : undefined + }; + }, + toJSON(message: QueryAllBalancesRequest): unknown { + const obj: any = {}; + message.address !== undefined && (obj.address = message.address); + message.pagination !== undefined && (obj.pagination = message.pagination ? PageRequest.toJSON(message.pagination) : undefined); + return obj; + }, fromPartial(object: Partial): QueryAllBalancesRequest { const message = createBaseQueryAllBalancesRequest(); message.address = object.address ?? ""; @@ -741,10 +1149,14 @@ export const QueryAllBalancesRequest = { return message; }, fromAmino(object: QueryAllBalancesRequestAmino): QueryAllBalancesRequest { - return { - address: object.address, - pagination: object?.pagination ? PageRequest.fromAmino(object.pagination) : undefined - }; + const message = createBaseQueryAllBalancesRequest(); + if (object.address !== undefined && object.address !== null) { + message.address = object.address; + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromAmino(object.pagination); + } + return message; }, toAmino(message: QueryAllBalancesRequest): QueryAllBalancesRequestAmino { const obj: any = {}; @@ -774,14 +1186,26 @@ export const QueryAllBalancesRequest = { }; } }; +GlobalDecoderRegistry.register(QueryAllBalancesRequest.typeUrl, QueryAllBalancesRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryAllBalancesRequest.aminoType, QueryAllBalancesRequest.typeUrl); function createBaseQueryAllBalancesResponse(): QueryAllBalancesResponse { return { balances: [], - pagination: PageResponse.fromPartial({}) + pagination: undefined }; } export const QueryAllBalancesResponse = { typeUrl: "/cosmos.bank.v1beta1.QueryAllBalancesResponse", + aminoType: "cosmos-sdk/QueryAllBalancesResponse", + is(o: any): o is QueryAllBalancesResponse { + return o && (o.$typeUrl === QueryAllBalancesResponse.typeUrl || Array.isArray(o.balances) && (!o.balances.length || Coin.is(o.balances[0]))); + }, + isSDK(o: any): o is QueryAllBalancesResponseSDKType { + return o && (o.$typeUrl === QueryAllBalancesResponse.typeUrl || Array.isArray(o.balances) && (!o.balances.length || Coin.isSDK(o.balances[0]))); + }, + isAmino(o: any): o is QueryAllBalancesResponseAmino { + return o && (o.$typeUrl === QueryAllBalancesResponse.typeUrl || Array.isArray(o.balances) && (!o.balances.length || Coin.isAmino(o.balances[0]))); + }, encode(message: QueryAllBalancesResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.balances) { Coin.encode(v!, writer.uint32(10).fork()).ldelim(); @@ -811,6 +1235,22 @@ export const QueryAllBalancesResponse = { } 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 + }; + }, + toJSON(message: QueryAllBalancesResponse): unknown { + const obj: any = {}; + if (message.balances) { + obj.balances = message.balances.map(e => e ? Coin.toJSON(e) : undefined); + } else { + obj.balances = []; + } + message.pagination !== undefined && (obj.pagination = message.pagination ? PageResponse.toJSON(message.pagination) : undefined); + return obj; + }, fromPartial(object: Partial): QueryAllBalancesResponse { const message = createBaseQueryAllBalancesResponse(); message.balances = object.balances?.map(e => Coin.fromPartial(e)) || []; @@ -818,10 +1258,12 @@ export const QueryAllBalancesResponse = { return message; }, fromAmino(object: QueryAllBalancesResponseAmino): QueryAllBalancesResponse { - return { - balances: Array.isArray(object?.balances) ? object.balances.map((e: any) => Coin.fromAmino(e)) : [], - pagination: object?.pagination ? PageResponse.fromAmino(object.pagination) : undefined - }; + const message = createBaseQueryAllBalancesResponse(); + message.balances = object.balances?.map(e => Coin.fromAmino(e)) || []; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromAmino(object.pagination); + } + return message; }, toAmino(message: QueryAllBalancesResponse): QueryAllBalancesResponseAmino { const obj: any = {}; @@ -855,27 +1297,46 @@ export const QueryAllBalancesResponse = { }; } }; -function createBaseQueryTotalSupplyRequest(): QueryTotalSupplyRequest { +GlobalDecoderRegistry.register(QueryAllBalancesResponse.typeUrl, QueryAllBalancesResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryAllBalancesResponse.aminoType, QueryAllBalancesResponse.typeUrl); +function createBaseQuerySpendableBalancesRequest(): QuerySpendableBalancesRequest { return { - pagination: PageRequest.fromPartial({}) + address: "", + pagination: undefined }; } -export const QueryTotalSupplyRequest = { - typeUrl: "/cosmos.bank.v1beta1.QueryTotalSupplyRequest", - encode(message: QueryTotalSupplyRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { +export const QuerySpendableBalancesRequest = { + typeUrl: "/cosmos.bank.v1beta1.QuerySpendableBalancesRequest", + aminoType: "cosmos-sdk/QuerySpendableBalancesRequest", + is(o: any): o is QuerySpendableBalancesRequest { + return o && (o.$typeUrl === QuerySpendableBalancesRequest.typeUrl || typeof o.address === "string"); + }, + isSDK(o: any): o is QuerySpendableBalancesRequestSDKType { + return o && (o.$typeUrl === QuerySpendableBalancesRequest.typeUrl || typeof o.address === "string"); + }, + isAmino(o: any): o is QuerySpendableBalancesRequestAmino { + return o && (o.$typeUrl === QuerySpendableBalancesRequest.typeUrl || typeof o.address === "string"); + }, + encode(message: QuerySpendableBalancesRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.address !== "") { + writer.uint32(10).string(message.address); + } if (message.pagination !== undefined) { - PageRequest.encode(message.pagination, writer.uint32(10).fork()).ldelim(); + PageRequest.encode(message.pagination, writer.uint32(18).fork()).ldelim(); } return writer; }, - decode(input: BinaryReader | Uint8Array, length?: number): QueryTotalSupplyRequest { + decode(input: BinaryReader | Uint8Array, length?: number): QuerySpendableBalancesRequest { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQueryTotalSupplyRequest(); + const message = createBaseQuerySpendableBalancesRequest(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: + message.address = reader.string(); + break; + case 2: message.pagination = PageRequest.decode(reader, reader.uint32()); break; default: @@ -885,51 +1346,480 @@ export const QueryTotalSupplyRequest = { } return message; }, - fromPartial(object: Partial): QueryTotalSupplyRequest { - const message = createBaseQueryTotalSupplyRequest(); + fromJSON(object: any): QuerySpendableBalancesRequest { + return { + address: isSet(object.address) ? String(object.address) : "", + pagination: isSet(object.pagination) ? PageRequest.fromJSON(object.pagination) : undefined + }; + }, + toJSON(message: QuerySpendableBalancesRequest): unknown { + const obj: any = {}; + message.address !== undefined && (obj.address = message.address); + message.pagination !== undefined && (obj.pagination = message.pagination ? PageRequest.toJSON(message.pagination) : undefined); + return obj; + }, + fromPartial(object: Partial): QuerySpendableBalancesRequest { + const message = createBaseQuerySpendableBalancesRequest(); + message.address = object.address ?? ""; message.pagination = object.pagination !== undefined && object.pagination !== null ? PageRequest.fromPartial(object.pagination) : undefined; return message; }, - fromAmino(object: QueryTotalSupplyRequestAmino): QueryTotalSupplyRequest { - return { - pagination: object?.pagination ? PageRequest.fromAmino(object.pagination) : undefined - }; + fromAmino(object: QuerySpendableBalancesRequestAmino): QuerySpendableBalancesRequest { + const message = createBaseQuerySpendableBalancesRequest(); + if (object.address !== undefined && object.address !== null) { + message.address = object.address; + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromAmino(object.pagination); + } + return message; }, - toAmino(message: QueryTotalSupplyRequest): QueryTotalSupplyRequestAmino { + toAmino(message: QuerySpendableBalancesRequest): QuerySpendableBalancesRequestAmino { const obj: any = {}; + obj.address = message.address; obj.pagination = message.pagination ? PageRequest.toAmino(message.pagination) : undefined; return obj; }, - fromAminoMsg(object: QueryTotalSupplyRequestAminoMsg): QueryTotalSupplyRequest { - return QueryTotalSupplyRequest.fromAmino(object.value); + fromAminoMsg(object: QuerySpendableBalancesRequestAminoMsg): QuerySpendableBalancesRequest { + return QuerySpendableBalancesRequest.fromAmino(object.value); }, - toAminoMsg(message: QueryTotalSupplyRequest): QueryTotalSupplyRequestAminoMsg { + toAminoMsg(message: QuerySpendableBalancesRequest): QuerySpendableBalancesRequestAminoMsg { return { - type: "cosmos-sdk/QueryTotalSupplyRequest", - value: QueryTotalSupplyRequest.toAmino(message) + type: "cosmos-sdk/QuerySpendableBalancesRequest", + value: QuerySpendableBalancesRequest.toAmino(message) }; }, - fromProtoMsg(message: QueryTotalSupplyRequestProtoMsg): QueryTotalSupplyRequest { - return QueryTotalSupplyRequest.decode(message.value); + fromProtoMsg(message: QuerySpendableBalancesRequestProtoMsg): QuerySpendableBalancesRequest { + return QuerySpendableBalancesRequest.decode(message.value); }, - toProto(message: QueryTotalSupplyRequest): Uint8Array { - return QueryTotalSupplyRequest.encode(message).finish(); + toProto(message: QuerySpendableBalancesRequest): Uint8Array { + return QuerySpendableBalancesRequest.encode(message).finish(); }, - toProtoMsg(message: QueryTotalSupplyRequest): QueryTotalSupplyRequestProtoMsg { + toProtoMsg(message: QuerySpendableBalancesRequest): QuerySpendableBalancesRequestProtoMsg { + return { + typeUrl: "/cosmos.bank.v1beta1.QuerySpendableBalancesRequest", + value: QuerySpendableBalancesRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QuerySpendableBalancesRequest.typeUrl, QuerySpendableBalancesRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(QuerySpendableBalancesRequest.aminoType, QuerySpendableBalancesRequest.typeUrl); +function createBaseQuerySpendableBalancesResponse(): QuerySpendableBalancesResponse { + return { + balances: [], + pagination: undefined + }; +} +export const QuerySpendableBalancesResponse = { + typeUrl: "/cosmos.bank.v1beta1.QuerySpendableBalancesResponse", + aminoType: "cosmos-sdk/QuerySpendableBalancesResponse", + is(o: any): o is QuerySpendableBalancesResponse { + return o && (o.$typeUrl === QuerySpendableBalancesResponse.typeUrl || Array.isArray(o.balances) && (!o.balances.length || Coin.is(o.balances[0]))); + }, + isSDK(o: any): o is QuerySpendableBalancesResponseSDKType { + return o && (o.$typeUrl === QuerySpendableBalancesResponse.typeUrl || Array.isArray(o.balances) && (!o.balances.length || Coin.isSDK(o.balances[0]))); + }, + isAmino(o: any): o is QuerySpendableBalancesResponseAmino { + return o && (o.$typeUrl === QuerySpendableBalancesResponse.typeUrl || Array.isArray(o.balances) && (!o.balances.length || Coin.isAmino(o.balances[0]))); + }, + encode(message: QuerySpendableBalancesResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.balances) { + Coin.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.pagination !== undefined) { + PageResponse.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QuerySpendableBalancesResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQuerySpendableBalancesResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.balances.push(Coin.decode(reader, reader.uint32())); + break; + case 2: + message.pagination = PageResponse.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + 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 + }; + }, + toJSON(message: QuerySpendableBalancesResponse): unknown { + const obj: any = {}; + if (message.balances) { + obj.balances = message.balances.map(e => e ? Coin.toJSON(e) : undefined); + } else { + obj.balances = []; + } + message.pagination !== undefined && (obj.pagination = message.pagination ? PageResponse.toJSON(message.pagination) : undefined); + return obj; + }, + fromPartial(object: Partial): 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; + }, + fromAmino(object: QuerySpendableBalancesResponseAmino): QuerySpendableBalancesResponse { + const message = createBaseQuerySpendableBalancesResponse(); + message.balances = object.balances?.map(e => Coin.fromAmino(e)) || []; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromAmino(object.pagination); + } + return message; + }, + toAmino(message: QuerySpendableBalancesResponse): QuerySpendableBalancesResponseAmino { + const obj: any = {}; + if (message.balances) { + obj.balances = message.balances.map(e => e ? Coin.toAmino(e) : undefined); + } else { + obj.balances = []; + } + obj.pagination = message.pagination ? PageResponse.toAmino(message.pagination) : undefined; + return obj; + }, + fromAminoMsg(object: QuerySpendableBalancesResponseAminoMsg): QuerySpendableBalancesResponse { + return QuerySpendableBalancesResponse.fromAmino(object.value); + }, + toAminoMsg(message: QuerySpendableBalancesResponse): QuerySpendableBalancesResponseAminoMsg { + return { + type: "cosmos-sdk/QuerySpendableBalancesResponse", + value: QuerySpendableBalancesResponse.toAmino(message) + }; + }, + fromProtoMsg(message: QuerySpendableBalancesResponseProtoMsg): QuerySpendableBalancesResponse { + return QuerySpendableBalancesResponse.decode(message.value); + }, + toProto(message: QuerySpendableBalancesResponse): Uint8Array { + return QuerySpendableBalancesResponse.encode(message).finish(); + }, + toProtoMsg(message: QuerySpendableBalancesResponse): QuerySpendableBalancesResponseProtoMsg { + return { + typeUrl: "/cosmos.bank.v1beta1.QuerySpendableBalancesResponse", + value: QuerySpendableBalancesResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QuerySpendableBalancesResponse.typeUrl, QuerySpendableBalancesResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(QuerySpendableBalancesResponse.aminoType, QuerySpendableBalancesResponse.typeUrl); +function createBaseQuerySpendableBalanceByDenomRequest(): QuerySpendableBalanceByDenomRequest { + return { + address: "", + denom: "" + }; +} +export const QuerySpendableBalanceByDenomRequest = { + typeUrl: "/cosmos.bank.v1beta1.QuerySpendableBalanceByDenomRequest", + aminoType: "cosmos-sdk/QuerySpendableBalanceByDenomRequest", + is(o: any): o is QuerySpendableBalanceByDenomRequest { + return o && (o.$typeUrl === QuerySpendableBalanceByDenomRequest.typeUrl || typeof o.address === "string" && typeof o.denom === "string"); + }, + isSDK(o: any): o is QuerySpendableBalanceByDenomRequestSDKType { + return o && (o.$typeUrl === QuerySpendableBalanceByDenomRequest.typeUrl || typeof o.address === "string" && typeof o.denom === "string"); + }, + isAmino(o: any): o is QuerySpendableBalanceByDenomRequestAmino { + return o && (o.$typeUrl === QuerySpendableBalanceByDenomRequest.typeUrl || typeof o.address === "string" && typeof o.denom === "string"); + }, + encode(message: QuerySpendableBalanceByDenomRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.address !== "") { + writer.uint32(10).string(message.address); + } + if (message.denom !== "") { + writer.uint32(18).string(message.denom); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QuerySpendableBalanceByDenomRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQuerySpendableBalanceByDenomRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.address = reader.string(); + break; + case 2: + message.denom = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): QuerySpendableBalanceByDenomRequest { + return { + address: isSet(object.address) ? String(object.address) : "", + denom: isSet(object.denom) ? String(object.denom) : "" + }; + }, + toJSON(message: QuerySpendableBalanceByDenomRequest): unknown { + const obj: any = {}; + message.address !== undefined && (obj.address = message.address); + message.denom !== undefined && (obj.denom = message.denom); + return obj; + }, + fromPartial(object: Partial): QuerySpendableBalanceByDenomRequest { + const message = createBaseQuerySpendableBalanceByDenomRequest(); + message.address = object.address ?? ""; + message.denom = object.denom ?? ""; + return message; + }, + fromAmino(object: QuerySpendableBalanceByDenomRequestAmino): QuerySpendableBalanceByDenomRequest { + const message = createBaseQuerySpendableBalanceByDenomRequest(); + if (object.address !== undefined && object.address !== null) { + message.address = object.address; + } + if (object.denom !== undefined && object.denom !== null) { + message.denom = object.denom; + } + return message; + }, + toAmino(message: QuerySpendableBalanceByDenomRequest): QuerySpendableBalanceByDenomRequestAmino { + const obj: any = {}; + obj.address = message.address; + obj.denom = message.denom; + return obj; + }, + fromAminoMsg(object: QuerySpendableBalanceByDenomRequestAminoMsg): QuerySpendableBalanceByDenomRequest { + return QuerySpendableBalanceByDenomRequest.fromAmino(object.value); + }, + toAminoMsg(message: QuerySpendableBalanceByDenomRequest): QuerySpendableBalanceByDenomRequestAminoMsg { + return { + type: "cosmos-sdk/QuerySpendableBalanceByDenomRequest", + value: QuerySpendableBalanceByDenomRequest.toAmino(message) + }; + }, + fromProtoMsg(message: QuerySpendableBalanceByDenomRequestProtoMsg): QuerySpendableBalanceByDenomRequest { + return QuerySpendableBalanceByDenomRequest.decode(message.value); + }, + toProto(message: QuerySpendableBalanceByDenomRequest): Uint8Array { + return QuerySpendableBalanceByDenomRequest.encode(message).finish(); + }, + toProtoMsg(message: QuerySpendableBalanceByDenomRequest): QuerySpendableBalanceByDenomRequestProtoMsg { + return { + typeUrl: "/cosmos.bank.v1beta1.QuerySpendableBalanceByDenomRequest", + value: QuerySpendableBalanceByDenomRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QuerySpendableBalanceByDenomRequest.typeUrl, QuerySpendableBalanceByDenomRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(QuerySpendableBalanceByDenomRequest.aminoType, QuerySpendableBalanceByDenomRequest.typeUrl); +function createBaseQuerySpendableBalanceByDenomResponse(): QuerySpendableBalanceByDenomResponse { + return { + balance: undefined + }; +} +export const QuerySpendableBalanceByDenomResponse = { + typeUrl: "/cosmos.bank.v1beta1.QuerySpendableBalanceByDenomResponse", + aminoType: "cosmos-sdk/QuerySpendableBalanceByDenomResponse", + is(o: any): o is QuerySpendableBalanceByDenomResponse { + return o && o.$typeUrl === QuerySpendableBalanceByDenomResponse.typeUrl; + }, + isSDK(o: any): o is QuerySpendableBalanceByDenomResponseSDKType { + return o && o.$typeUrl === QuerySpendableBalanceByDenomResponse.typeUrl; + }, + isAmino(o: any): o is QuerySpendableBalanceByDenomResponseAmino { + return o && o.$typeUrl === QuerySpendableBalanceByDenomResponse.typeUrl; + }, + encode(message: QuerySpendableBalanceByDenomResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.balance !== undefined) { + Coin.encode(message.balance, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QuerySpendableBalanceByDenomResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQuerySpendableBalanceByDenomResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.balance = Coin.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): QuerySpendableBalanceByDenomResponse { + return { + balance: isSet(object.balance) ? Coin.fromJSON(object.balance) : undefined + }; + }, + toJSON(message: QuerySpendableBalanceByDenomResponse): unknown { + const obj: any = {}; + message.balance !== undefined && (obj.balance = message.balance ? Coin.toJSON(message.balance) : undefined); + return obj; + }, + fromPartial(object: Partial): QuerySpendableBalanceByDenomResponse { + const message = createBaseQuerySpendableBalanceByDenomResponse(); + message.balance = object.balance !== undefined && object.balance !== null ? Coin.fromPartial(object.balance) : undefined; + return message; + }, + fromAmino(object: QuerySpendableBalanceByDenomResponseAmino): QuerySpendableBalanceByDenomResponse { + const message = createBaseQuerySpendableBalanceByDenomResponse(); + if (object.balance !== undefined && object.balance !== null) { + message.balance = Coin.fromAmino(object.balance); + } + return message; + }, + toAmino(message: QuerySpendableBalanceByDenomResponse): QuerySpendableBalanceByDenomResponseAmino { + const obj: any = {}; + obj.balance = message.balance ? Coin.toAmino(message.balance) : undefined; + return obj; + }, + fromAminoMsg(object: QuerySpendableBalanceByDenomResponseAminoMsg): QuerySpendableBalanceByDenomResponse { + return QuerySpendableBalanceByDenomResponse.fromAmino(object.value); + }, + toAminoMsg(message: QuerySpendableBalanceByDenomResponse): QuerySpendableBalanceByDenomResponseAminoMsg { + return { + type: "cosmos-sdk/QuerySpendableBalanceByDenomResponse", + value: QuerySpendableBalanceByDenomResponse.toAmino(message) + }; + }, + fromProtoMsg(message: QuerySpendableBalanceByDenomResponseProtoMsg): QuerySpendableBalanceByDenomResponse { + return QuerySpendableBalanceByDenomResponse.decode(message.value); + }, + toProto(message: QuerySpendableBalanceByDenomResponse): Uint8Array { + return QuerySpendableBalanceByDenomResponse.encode(message).finish(); + }, + toProtoMsg(message: QuerySpendableBalanceByDenomResponse): QuerySpendableBalanceByDenomResponseProtoMsg { + return { + typeUrl: "/cosmos.bank.v1beta1.QuerySpendableBalanceByDenomResponse", + value: QuerySpendableBalanceByDenomResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QuerySpendableBalanceByDenomResponse.typeUrl, QuerySpendableBalanceByDenomResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(QuerySpendableBalanceByDenomResponse.aminoType, QuerySpendableBalanceByDenomResponse.typeUrl); +function createBaseQueryTotalSupplyRequest(): QueryTotalSupplyRequest { + return { + pagination: undefined + }; +} +export const QueryTotalSupplyRequest = { + typeUrl: "/cosmos.bank.v1beta1.QueryTotalSupplyRequest", + aminoType: "cosmos-sdk/QueryTotalSupplyRequest", + is(o: any): o is QueryTotalSupplyRequest { + return o && o.$typeUrl === QueryTotalSupplyRequest.typeUrl; + }, + isSDK(o: any): o is QueryTotalSupplyRequestSDKType { + return o && o.$typeUrl === QueryTotalSupplyRequest.typeUrl; + }, + isAmino(o: any): o is QueryTotalSupplyRequestAmino { + return o && o.$typeUrl === QueryTotalSupplyRequest.typeUrl; + }, + encode(message: QueryTotalSupplyRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.pagination !== undefined) { + PageRequest.encode(message.pagination, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryTotalSupplyRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryTotalSupplyRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.pagination = PageRequest.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): QueryTotalSupplyRequest { + return { + pagination: isSet(object.pagination) ? PageRequest.fromJSON(object.pagination) : undefined + }; + }, + toJSON(message: QueryTotalSupplyRequest): unknown { + const obj: any = {}; + message.pagination !== undefined && (obj.pagination = message.pagination ? PageRequest.toJSON(message.pagination) : undefined); + return obj; + }, + fromPartial(object: Partial): QueryTotalSupplyRequest { + const message = createBaseQueryTotalSupplyRequest(); + message.pagination = object.pagination !== undefined && object.pagination !== null ? PageRequest.fromPartial(object.pagination) : undefined; + return message; + }, + fromAmino(object: QueryTotalSupplyRequestAmino): QueryTotalSupplyRequest { + const message = createBaseQueryTotalSupplyRequest(); + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromAmino(object.pagination); + } + return message; + }, + toAmino(message: QueryTotalSupplyRequest): QueryTotalSupplyRequestAmino { + const obj: any = {}; + obj.pagination = message.pagination ? PageRequest.toAmino(message.pagination) : undefined; + return obj; + }, + fromAminoMsg(object: QueryTotalSupplyRequestAminoMsg): QueryTotalSupplyRequest { + return QueryTotalSupplyRequest.fromAmino(object.value); + }, + toAminoMsg(message: QueryTotalSupplyRequest): QueryTotalSupplyRequestAminoMsg { + return { + type: "cosmos-sdk/QueryTotalSupplyRequest", + value: QueryTotalSupplyRequest.toAmino(message) + }; + }, + fromProtoMsg(message: QueryTotalSupplyRequestProtoMsg): QueryTotalSupplyRequest { + return QueryTotalSupplyRequest.decode(message.value); + }, + toProto(message: QueryTotalSupplyRequest): Uint8Array { + return QueryTotalSupplyRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryTotalSupplyRequest): QueryTotalSupplyRequestProtoMsg { return { typeUrl: "/cosmos.bank.v1beta1.QueryTotalSupplyRequest", value: QueryTotalSupplyRequest.encode(message).finish() }; } }; +GlobalDecoderRegistry.register(QueryTotalSupplyRequest.typeUrl, QueryTotalSupplyRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryTotalSupplyRequest.aminoType, QueryTotalSupplyRequest.typeUrl); function createBaseQueryTotalSupplyResponse(): QueryTotalSupplyResponse { return { supply: [], - pagination: PageResponse.fromPartial({}) + pagination: undefined }; } export const QueryTotalSupplyResponse = { typeUrl: "/cosmos.bank.v1beta1.QueryTotalSupplyResponse", + aminoType: "cosmos-sdk/QueryTotalSupplyResponse", + is(o: any): o is QueryTotalSupplyResponse { + return o && (o.$typeUrl === QueryTotalSupplyResponse.typeUrl || Array.isArray(o.supply) && (!o.supply.length || Coin.is(o.supply[0]))); + }, + isSDK(o: any): o is QueryTotalSupplyResponseSDKType { + return o && (o.$typeUrl === QueryTotalSupplyResponse.typeUrl || Array.isArray(o.supply) && (!o.supply.length || Coin.isSDK(o.supply[0]))); + }, + isAmino(o: any): o is QueryTotalSupplyResponseAmino { + return o && (o.$typeUrl === QueryTotalSupplyResponse.typeUrl || Array.isArray(o.supply) && (!o.supply.length || Coin.isAmino(o.supply[0]))); + }, encode(message: QueryTotalSupplyResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.supply) { Coin.encode(v!, writer.uint32(10).fork()).ldelim(); @@ -959,6 +1849,22 @@ export const QueryTotalSupplyResponse = { } 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 + }; + }, + toJSON(message: QueryTotalSupplyResponse): unknown { + const obj: any = {}; + if (message.supply) { + obj.supply = message.supply.map(e => e ? Coin.toJSON(e) : undefined); + } else { + obj.supply = []; + } + message.pagination !== undefined && (obj.pagination = message.pagination ? PageResponse.toJSON(message.pagination) : undefined); + return obj; + }, fromPartial(object: Partial): QueryTotalSupplyResponse { const message = createBaseQueryTotalSupplyResponse(); message.supply = object.supply?.map(e => Coin.fromPartial(e)) || []; @@ -966,10 +1872,12 @@ export const QueryTotalSupplyResponse = { return message; }, fromAmino(object: QueryTotalSupplyResponseAmino): QueryTotalSupplyResponse { - return { - supply: Array.isArray(object?.supply) ? object.supply.map((e: any) => Coin.fromAmino(e)) : [], - pagination: object?.pagination ? PageResponse.fromAmino(object.pagination) : undefined - }; + const message = createBaseQueryTotalSupplyResponse(); + message.supply = object.supply?.map(e => Coin.fromAmino(e)) || []; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromAmino(object.pagination); + } + return message; }, toAmino(message: QueryTotalSupplyResponse): QueryTotalSupplyResponseAmino { const obj: any = {}; @@ -1003,6 +1911,8 @@ export const QueryTotalSupplyResponse = { }; } }; +GlobalDecoderRegistry.register(QueryTotalSupplyResponse.typeUrl, QueryTotalSupplyResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryTotalSupplyResponse.aminoType, QueryTotalSupplyResponse.typeUrl); function createBaseQuerySupplyOfRequest(): QuerySupplyOfRequest { return { denom: "" @@ -1010,6 +1920,16 @@ function createBaseQuerySupplyOfRequest(): QuerySupplyOfRequest { } export const QuerySupplyOfRequest = { typeUrl: "/cosmos.bank.v1beta1.QuerySupplyOfRequest", + aminoType: "cosmos-sdk/QuerySupplyOfRequest", + is(o: any): o is QuerySupplyOfRequest { + return o && (o.$typeUrl === QuerySupplyOfRequest.typeUrl || typeof o.denom === "string"); + }, + isSDK(o: any): o is QuerySupplyOfRequestSDKType { + return o && (o.$typeUrl === QuerySupplyOfRequest.typeUrl || typeof o.denom === "string"); + }, + isAmino(o: any): o is QuerySupplyOfRequestAmino { + return o && (o.$typeUrl === QuerySupplyOfRequest.typeUrl || typeof o.denom === "string"); + }, encode(message: QuerySupplyOfRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.denom !== "") { writer.uint32(10).string(message.denom); @@ -1033,15 +1953,27 @@ export const QuerySupplyOfRequest = { } return message; }, + fromJSON(object: any): QuerySupplyOfRequest { + return { + denom: isSet(object.denom) ? String(object.denom) : "" + }; + }, + toJSON(message: QuerySupplyOfRequest): unknown { + const obj: any = {}; + message.denom !== undefined && (obj.denom = message.denom); + return obj; + }, fromPartial(object: Partial): QuerySupplyOfRequest { const message = createBaseQuerySupplyOfRequest(); message.denom = object.denom ?? ""; return message; }, fromAmino(object: QuerySupplyOfRequestAmino): QuerySupplyOfRequest { - return { - denom: object.denom - }; + const message = createBaseQuerySupplyOfRequest(); + if (object.denom !== undefined && object.denom !== null) { + message.denom = object.denom; + } + return message; }, toAmino(message: QuerySupplyOfRequest): QuerySupplyOfRequestAmino { const obj: any = {}; @@ -1070,13 +2002,25 @@ export const QuerySupplyOfRequest = { }; } }; +GlobalDecoderRegistry.register(QuerySupplyOfRequest.typeUrl, QuerySupplyOfRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(QuerySupplyOfRequest.aminoType, QuerySupplyOfRequest.typeUrl); function createBaseQuerySupplyOfResponse(): QuerySupplyOfResponse { return { - amount: undefined + amount: Coin.fromPartial({}) }; } export const QuerySupplyOfResponse = { typeUrl: "/cosmos.bank.v1beta1.QuerySupplyOfResponse", + aminoType: "cosmos-sdk/QuerySupplyOfResponse", + is(o: any): o is QuerySupplyOfResponse { + return o && (o.$typeUrl === QuerySupplyOfResponse.typeUrl || Coin.is(o.amount)); + }, + isSDK(o: any): o is QuerySupplyOfResponseSDKType { + return o && (o.$typeUrl === QuerySupplyOfResponse.typeUrl || Coin.isSDK(o.amount)); + }, + isAmino(o: any): o is QuerySupplyOfResponseAmino { + return o && (o.$typeUrl === QuerySupplyOfResponse.typeUrl || Coin.isAmino(o.amount)); + }, encode(message: QuerySupplyOfResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.amount !== undefined) { Coin.encode(message.amount, writer.uint32(10).fork()).ldelim(); @@ -1100,19 +2044,31 @@ export const QuerySupplyOfResponse = { } return message; }, + fromJSON(object: any): QuerySupplyOfResponse { + 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; + }, fromPartial(object: Partial): QuerySupplyOfResponse { const message = createBaseQuerySupplyOfResponse(); message.amount = object.amount !== undefined && object.amount !== null ? Coin.fromPartial(object.amount) : undefined; return message; }, fromAmino(object: QuerySupplyOfResponseAmino): QuerySupplyOfResponse { - return { - amount: object?.amount ? Coin.fromAmino(object.amount) : undefined - }; + const message = createBaseQuerySupplyOfResponse(); + if (object.amount !== undefined && object.amount !== null) { + message.amount = Coin.fromAmino(object.amount); + } + return message; }, toAmino(message: QuerySupplyOfResponse): QuerySupplyOfResponseAmino { const obj: any = {}; - obj.amount = message.amount ? Coin.toAmino(message.amount) : undefined; + obj.amount = message.amount ? Coin.toAmino(message.amount) : Coin.fromPartial({}); return obj; }, fromAminoMsg(object: QuerySupplyOfResponseAminoMsg): QuerySupplyOfResponse { @@ -1137,13 +2093,25 @@ export const QuerySupplyOfResponse = { }; } }; +GlobalDecoderRegistry.register(QuerySupplyOfResponse.typeUrl, QuerySupplyOfResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(QuerySupplyOfResponse.aminoType, QuerySupplyOfResponse.typeUrl); function createBaseQueryTotalSupplyWithoutOffsetRequest(): QueryTotalSupplyWithoutOffsetRequest { return { - pagination: PageRequest.fromPartial({}) + pagination: undefined }; } export const QueryTotalSupplyWithoutOffsetRequest = { typeUrl: "/cosmos.bank.v1beta1.QueryTotalSupplyWithoutOffsetRequest", + aminoType: "cosmos-sdk/QueryTotalSupplyWithoutOffsetRequest", + is(o: any): o is QueryTotalSupplyWithoutOffsetRequest { + return o && o.$typeUrl === QueryTotalSupplyWithoutOffsetRequest.typeUrl; + }, + isSDK(o: any): o is QueryTotalSupplyWithoutOffsetRequestSDKType { + return o && o.$typeUrl === QueryTotalSupplyWithoutOffsetRequest.typeUrl; + }, + isAmino(o: any): o is QueryTotalSupplyWithoutOffsetRequestAmino { + return o && o.$typeUrl === QueryTotalSupplyWithoutOffsetRequest.typeUrl; + }, encode(message: QueryTotalSupplyWithoutOffsetRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.pagination !== undefined) { PageRequest.encode(message.pagination, writer.uint32(10).fork()).ldelim(); @@ -1167,15 +2135,27 @@ export const QueryTotalSupplyWithoutOffsetRequest = { } return message; }, + fromJSON(object: any): QueryTotalSupplyWithoutOffsetRequest { + return { + pagination: isSet(object.pagination) ? PageRequest.fromJSON(object.pagination) : undefined + }; + }, + toJSON(message: QueryTotalSupplyWithoutOffsetRequest): unknown { + const obj: any = {}; + message.pagination !== undefined && (obj.pagination = message.pagination ? PageRequest.toJSON(message.pagination) : undefined); + return obj; + }, fromPartial(object: Partial): QueryTotalSupplyWithoutOffsetRequest { const message = createBaseQueryTotalSupplyWithoutOffsetRequest(); message.pagination = object.pagination !== undefined && object.pagination !== null ? PageRequest.fromPartial(object.pagination) : undefined; return message; }, fromAmino(object: QueryTotalSupplyWithoutOffsetRequestAmino): QueryTotalSupplyWithoutOffsetRequest { - return { - pagination: object?.pagination ? PageRequest.fromAmino(object.pagination) : undefined - }; + const message = createBaseQueryTotalSupplyWithoutOffsetRequest(); + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromAmino(object.pagination); + } + return message; }, toAmino(message: QueryTotalSupplyWithoutOffsetRequest): QueryTotalSupplyWithoutOffsetRequestAmino { const obj: any = {}; @@ -1204,14 +2184,26 @@ export const QueryTotalSupplyWithoutOffsetRequest = { }; } }; +GlobalDecoderRegistry.register(QueryTotalSupplyWithoutOffsetRequest.typeUrl, QueryTotalSupplyWithoutOffsetRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryTotalSupplyWithoutOffsetRequest.aminoType, QueryTotalSupplyWithoutOffsetRequest.typeUrl); function createBaseQueryTotalSupplyWithoutOffsetResponse(): QueryTotalSupplyWithoutOffsetResponse { return { supply: [], - pagination: PageResponse.fromPartial({}) + pagination: undefined }; } export const QueryTotalSupplyWithoutOffsetResponse = { typeUrl: "/cosmos.bank.v1beta1.QueryTotalSupplyWithoutOffsetResponse", + aminoType: "cosmos-sdk/QueryTotalSupplyWithoutOffsetResponse", + is(o: any): o is QueryTotalSupplyWithoutOffsetResponse { + return o && (o.$typeUrl === QueryTotalSupplyWithoutOffsetResponse.typeUrl || Array.isArray(o.supply) && (!o.supply.length || Coin.is(o.supply[0]))); + }, + isSDK(o: any): o is QueryTotalSupplyWithoutOffsetResponseSDKType { + return o && (o.$typeUrl === QueryTotalSupplyWithoutOffsetResponse.typeUrl || Array.isArray(o.supply) && (!o.supply.length || Coin.isSDK(o.supply[0]))); + }, + isAmino(o: any): o is QueryTotalSupplyWithoutOffsetResponseAmino { + return o && (o.$typeUrl === QueryTotalSupplyWithoutOffsetResponse.typeUrl || Array.isArray(o.supply) && (!o.supply.length || Coin.isAmino(o.supply[0]))); + }, encode(message: QueryTotalSupplyWithoutOffsetResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.supply) { Coin.encode(v!, writer.uint32(10).fork()).ldelim(); @@ -1241,6 +2233,22 @@ export const QueryTotalSupplyWithoutOffsetResponse = { } return message; }, + fromJSON(object: any): QueryTotalSupplyWithoutOffsetResponse { + return { + supply: Array.isArray(object?.supply) ? object.supply.map((e: any) => Coin.fromJSON(e)) : [], + pagination: isSet(object.pagination) ? PageResponse.fromJSON(object.pagination) : undefined + }; + }, + toJSON(message: QueryTotalSupplyWithoutOffsetResponse): unknown { + const obj: any = {}; + if (message.supply) { + obj.supply = message.supply.map(e => e ? Coin.toJSON(e) : undefined); + } else { + obj.supply = []; + } + message.pagination !== undefined && (obj.pagination = message.pagination ? PageResponse.toJSON(message.pagination) : undefined); + return obj; + }, fromPartial(object: Partial): QueryTotalSupplyWithoutOffsetResponse { const message = createBaseQueryTotalSupplyWithoutOffsetResponse(); message.supply = object.supply?.map(e => Coin.fromPartial(e)) || []; @@ -1248,10 +2256,12 @@ export const QueryTotalSupplyWithoutOffsetResponse = { return message; }, fromAmino(object: QueryTotalSupplyWithoutOffsetResponseAmino): QueryTotalSupplyWithoutOffsetResponse { - return { - supply: Array.isArray(object?.supply) ? object.supply.map((e: any) => Coin.fromAmino(e)) : [], - pagination: object?.pagination ? PageResponse.fromAmino(object.pagination) : undefined - }; + const message = createBaseQueryTotalSupplyWithoutOffsetResponse(); + message.supply = object.supply?.map(e => Coin.fromAmino(e)) || []; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromAmino(object.pagination); + } + return message; }, toAmino(message: QueryTotalSupplyWithoutOffsetResponse): QueryTotalSupplyWithoutOffsetResponseAmino { const obj: any = {}; @@ -1285,6 +2295,8 @@ export const QueryTotalSupplyWithoutOffsetResponse = { }; } }; +GlobalDecoderRegistry.register(QueryTotalSupplyWithoutOffsetResponse.typeUrl, QueryTotalSupplyWithoutOffsetResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryTotalSupplyWithoutOffsetResponse.aminoType, QueryTotalSupplyWithoutOffsetResponse.typeUrl); function createBaseQuerySupplyOfWithoutOffsetRequest(): QuerySupplyOfWithoutOffsetRequest { return { denom: "" @@ -1292,6 +2304,16 @@ function createBaseQuerySupplyOfWithoutOffsetRequest(): QuerySupplyOfWithoutOffs } export const QuerySupplyOfWithoutOffsetRequest = { typeUrl: "/cosmos.bank.v1beta1.QuerySupplyOfWithoutOffsetRequest", + aminoType: "cosmos-sdk/QuerySupplyOfWithoutOffsetRequest", + is(o: any): o is QuerySupplyOfWithoutOffsetRequest { + return o && (o.$typeUrl === QuerySupplyOfWithoutOffsetRequest.typeUrl || typeof o.denom === "string"); + }, + isSDK(o: any): o is QuerySupplyOfWithoutOffsetRequestSDKType { + return o && (o.$typeUrl === QuerySupplyOfWithoutOffsetRequest.typeUrl || typeof o.denom === "string"); + }, + isAmino(o: any): o is QuerySupplyOfWithoutOffsetRequestAmino { + return o && (o.$typeUrl === QuerySupplyOfWithoutOffsetRequest.typeUrl || typeof o.denom === "string"); + }, encode(message: QuerySupplyOfWithoutOffsetRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.denom !== "") { writer.uint32(10).string(message.denom); @@ -1315,15 +2337,27 @@ export const QuerySupplyOfWithoutOffsetRequest = { } return message; }, + fromJSON(object: any): QuerySupplyOfWithoutOffsetRequest { + return { + denom: isSet(object.denom) ? String(object.denom) : "" + }; + }, + toJSON(message: QuerySupplyOfWithoutOffsetRequest): unknown { + const obj: any = {}; + message.denom !== undefined && (obj.denom = message.denom); + return obj; + }, fromPartial(object: Partial): QuerySupplyOfWithoutOffsetRequest { const message = createBaseQuerySupplyOfWithoutOffsetRequest(); message.denom = object.denom ?? ""; return message; }, fromAmino(object: QuerySupplyOfWithoutOffsetRequestAmino): QuerySupplyOfWithoutOffsetRequest { - return { - denom: object.denom - }; + const message = createBaseQuerySupplyOfWithoutOffsetRequest(); + if (object.denom !== undefined && object.denom !== null) { + message.denom = object.denom; + } + return message; }, toAmino(message: QuerySupplyOfWithoutOffsetRequest): QuerySupplyOfWithoutOffsetRequestAmino { const obj: any = {}; @@ -1352,13 +2386,25 @@ export const QuerySupplyOfWithoutOffsetRequest = { }; } }; +GlobalDecoderRegistry.register(QuerySupplyOfWithoutOffsetRequest.typeUrl, QuerySupplyOfWithoutOffsetRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(QuerySupplyOfWithoutOffsetRequest.aminoType, QuerySupplyOfWithoutOffsetRequest.typeUrl); function createBaseQuerySupplyOfWithoutOffsetResponse(): QuerySupplyOfWithoutOffsetResponse { return { - amount: undefined + amount: Coin.fromPartial({}) }; } export const QuerySupplyOfWithoutOffsetResponse = { typeUrl: "/cosmos.bank.v1beta1.QuerySupplyOfWithoutOffsetResponse", + aminoType: "cosmos-sdk/QuerySupplyOfWithoutOffsetResponse", + is(o: any): o is QuerySupplyOfWithoutOffsetResponse { + return o && (o.$typeUrl === QuerySupplyOfWithoutOffsetResponse.typeUrl || Coin.is(o.amount)); + }, + isSDK(o: any): o is QuerySupplyOfWithoutOffsetResponseSDKType { + return o && (o.$typeUrl === QuerySupplyOfWithoutOffsetResponse.typeUrl || Coin.isSDK(o.amount)); + }, + isAmino(o: any): o is QuerySupplyOfWithoutOffsetResponseAmino { + return o && (o.$typeUrl === QuerySupplyOfWithoutOffsetResponse.typeUrl || Coin.isAmino(o.amount)); + }, encode(message: QuerySupplyOfWithoutOffsetResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.amount !== undefined) { Coin.encode(message.amount, writer.uint32(10).fork()).ldelim(); @@ -1382,15 +2428,27 @@ export const QuerySupplyOfWithoutOffsetResponse = { } return message; }, + fromJSON(object: any): QuerySupplyOfWithoutOffsetResponse { + return { + amount: isSet(object.amount) ? Coin.fromJSON(object.amount) : undefined + }; + }, + toJSON(message: QuerySupplyOfWithoutOffsetResponse): unknown { + const obj: any = {}; + message.amount !== undefined && (obj.amount = message.amount ? Coin.toJSON(message.amount) : undefined); + return obj; + }, fromPartial(object: Partial): QuerySupplyOfWithoutOffsetResponse { const message = createBaseQuerySupplyOfWithoutOffsetResponse(); message.amount = object.amount !== undefined && object.amount !== null ? Coin.fromPartial(object.amount) : undefined; return message; }, fromAmino(object: QuerySupplyOfWithoutOffsetResponseAmino): QuerySupplyOfWithoutOffsetResponse { - return { - amount: object?.amount ? Coin.fromAmino(object.amount) : undefined - }; + const message = createBaseQuerySupplyOfWithoutOffsetResponse(); + if (object.amount !== undefined && object.amount !== null) { + message.amount = Coin.fromAmino(object.amount); + } + return message; }, toAmino(message: QuerySupplyOfWithoutOffsetResponse): QuerySupplyOfWithoutOffsetResponseAmino { const obj: any = {}; @@ -1419,11 +2477,23 @@ export const QuerySupplyOfWithoutOffsetResponse = { }; } }; +GlobalDecoderRegistry.register(QuerySupplyOfWithoutOffsetResponse.typeUrl, QuerySupplyOfWithoutOffsetResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(QuerySupplyOfWithoutOffsetResponse.aminoType, QuerySupplyOfWithoutOffsetResponse.typeUrl); function createBaseQueryParamsRequest(): QueryParamsRequest { return {}; } export const QueryParamsRequest = { typeUrl: "/cosmos.bank.v1beta1.QueryParamsRequest", + aminoType: "cosmos-sdk/QueryParamsRequest", + is(o: any): o is QueryParamsRequest { + return o && o.$typeUrl === QueryParamsRequest.typeUrl; + }, + isSDK(o: any): o is QueryParamsRequestSDKType { + return o && o.$typeUrl === QueryParamsRequest.typeUrl; + }, + isAmino(o: any): o is QueryParamsRequestAmino { + return o && o.$typeUrl === QueryParamsRequest.typeUrl; + }, encode(_: QueryParamsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, @@ -1441,12 +2511,20 @@ export const QueryParamsRequest = { } return message; }, + fromJSON(_: any): QueryParamsRequest { + return {}; + }, + toJSON(_: QueryParamsRequest): unknown { + const obj: any = {}; + return obj; + }, fromPartial(_: Partial): QueryParamsRequest { const message = createBaseQueryParamsRequest(); return message; }, fromAmino(_: QueryParamsRequestAmino): QueryParamsRequest { - return {}; + const message = createBaseQueryParamsRequest(); + return message; }, toAmino(_: QueryParamsRequest): QueryParamsRequestAmino { const obj: any = {}; @@ -1474,6 +2552,8 @@ export const QueryParamsRequest = { }; } }; +GlobalDecoderRegistry.register(QueryParamsRequest.typeUrl, QueryParamsRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryParamsRequest.aminoType, QueryParamsRequest.typeUrl); function createBaseQueryParamsResponse(): QueryParamsResponse { return { params: Params.fromPartial({}) @@ -1481,6 +2561,16 @@ function createBaseQueryParamsResponse(): QueryParamsResponse { } export const QueryParamsResponse = { typeUrl: "/cosmos.bank.v1beta1.QueryParamsResponse", + aminoType: "cosmos-sdk/QueryParamsResponse", + is(o: any): o is QueryParamsResponse { + return o && (o.$typeUrl === QueryParamsResponse.typeUrl || Params.is(o.params)); + }, + isSDK(o: any): o is QueryParamsResponseSDKType { + return o && (o.$typeUrl === QueryParamsResponse.typeUrl || Params.isSDK(o.params)); + }, + isAmino(o: any): o is QueryParamsResponseAmino { + return o && (o.$typeUrl === QueryParamsResponse.typeUrl || Params.isAmino(o.params)); + }, encode(message: QueryParamsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.params !== undefined) { Params.encode(message.params, writer.uint32(10).fork()).ldelim(); @@ -1504,19 +2594,31 @@ export const QueryParamsResponse = { } return message; }, + fromJSON(object: any): QueryParamsResponse { + 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; + }, fromPartial(object: Partial): QueryParamsResponse { const message = createBaseQueryParamsResponse(); message.params = object.params !== undefined && object.params !== null ? Params.fromPartial(object.params) : undefined; return message; }, fromAmino(object: QueryParamsResponseAmino): QueryParamsResponse { - return { - params: object?.params ? Params.fromAmino(object.params) : undefined - }; + const message = createBaseQueryParamsResponse(); + if (object.params !== undefined && object.params !== null) { + message.params = Params.fromAmino(object.params); + } + return message; }, toAmino(message: QueryParamsResponse): QueryParamsResponseAmino { const obj: any = {}; - obj.params = message.params ? Params.toAmino(message.params) : undefined; + obj.params = message.params ? Params.toAmino(message.params) : Params.fromPartial({}); return obj; }, fromAminoMsg(object: QueryParamsResponseAminoMsg): QueryParamsResponse { @@ -1541,13 +2643,25 @@ export const QueryParamsResponse = { }; } }; +GlobalDecoderRegistry.register(QueryParamsResponse.typeUrl, QueryParamsResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryParamsResponse.aminoType, QueryParamsResponse.typeUrl); function createBaseQueryDenomsMetadataRequest(): QueryDenomsMetadataRequest { return { - pagination: PageRequest.fromPartial({}) + pagination: undefined }; } export const QueryDenomsMetadataRequest = { typeUrl: "/cosmos.bank.v1beta1.QueryDenomsMetadataRequest", + aminoType: "cosmos-sdk/QueryDenomsMetadataRequest", + is(o: any): o is QueryDenomsMetadataRequest { + return o && o.$typeUrl === QueryDenomsMetadataRequest.typeUrl; + }, + isSDK(o: any): o is QueryDenomsMetadataRequestSDKType { + return o && o.$typeUrl === QueryDenomsMetadataRequest.typeUrl; + }, + isAmino(o: any): o is QueryDenomsMetadataRequestAmino { + return o && o.$typeUrl === QueryDenomsMetadataRequest.typeUrl; + }, encode(message: QueryDenomsMetadataRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.pagination !== undefined) { PageRequest.encode(message.pagination, writer.uint32(10).fork()).ldelim(); @@ -1571,15 +2685,27 @@ export const QueryDenomsMetadataRequest = { } return message; }, + fromJSON(object: any): QueryDenomsMetadataRequest { + return { + pagination: isSet(object.pagination) ? PageRequest.fromJSON(object.pagination) : undefined + }; + }, + toJSON(message: QueryDenomsMetadataRequest): unknown { + const obj: any = {}; + message.pagination !== undefined && (obj.pagination = message.pagination ? PageRequest.toJSON(message.pagination) : undefined); + return obj; + }, fromPartial(object: Partial): QueryDenomsMetadataRequest { const message = createBaseQueryDenomsMetadataRequest(); message.pagination = object.pagination !== undefined && object.pagination !== null ? PageRequest.fromPartial(object.pagination) : undefined; return message; }, fromAmino(object: QueryDenomsMetadataRequestAmino): QueryDenomsMetadataRequest { - return { - pagination: object?.pagination ? PageRequest.fromAmino(object.pagination) : undefined - }; + const message = createBaseQueryDenomsMetadataRequest(); + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromAmino(object.pagination); + } + return message; }, toAmino(message: QueryDenomsMetadataRequest): QueryDenomsMetadataRequestAmino { const obj: any = {}; @@ -1608,14 +2734,26 @@ export const QueryDenomsMetadataRequest = { }; } }; +GlobalDecoderRegistry.register(QueryDenomsMetadataRequest.typeUrl, QueryDenomsMetadataRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryDenomsMetadataRequest.aminoType, QueryDenomsMetadataRequest.typeUrl); function createBaseQueryDenomsMetadataResponse(): QueryDenomsMetadataResponse { return { metadatas: [], - pagination: PageResponse.fromPartial({}) + pagination: undefined }; } export const QueryDenomsMetadataResponse = { typeUrl: "/cosmos.bank.v1beta1.QueryDenomsMetadataResponse", + aminoType: "cosmos-sdk/QueryDenomsMetadataResponse", + is(o: any): o is QueryDenomsMetadataResponse { + return o && (o.$typeUrl === QueryDenomsMetadataResponse.typeUrl || Array.isArray(o.metadatas) && (!o.metadatas.length || Metadata.is(o.metadatas[0]))); + }, + isSDK(o: any): o is QueryDenomsMetadataResponseSDKType { + return o && (o.$typeUrl === QueryDenomsMetadataResponse.typeUrl || Array.isArray(o.metadatas) && (!o.metadatas.length || Metadata.isSDK(o.metadatas[0]))); + }, + isAmino(o: any): o is QueryDenomsMetadataResponseAmino { + return o && (o.$typeUrl === QueryDenomsMetadataResponse.typeUrl || Array.isArray(o.metadatas) && (!o.metadatas.length || Metadata.isAmino(o.metadatas[0]))); + }, encode(message: QueryDenomsMetadataResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.metadatas) { Metadata.encode(v!, writer.uint32(10).fork()).ldelim(); @@ -1643,7 +2781,23 @@ export const QueryDenomsMetadataResponse = { 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 + }; + }, + toJSON(message: QueryDenomsMetadataResponse): unknown { + const obj: any = {}; + if (message.metadatas) { + obj.metadatas = message.metadatas.map(e => e ? Metadata.toJSON(e) : undefined); + } else { + obj.metadatas = []; + } + message.pagination !== undefined && (obj.pagination = message.pagination ? PageResponse.toJSON(message.pagination) : undefined); + return obj; }, fromPartial(object: Partial): QueryDenomsMetadataResponse { const message = createBaseQueryDenomsMetadataResponse(); @@ -1652,10 +2806,12 @@ export const QueryDenomsMetadataResponse = { return message; }, fromAmino(object: QueryDenomsMetadataResponseAmino): QueryDenomsMetadataResponse { - return { - metadatas: Array.isArray(object?.metadatas) ? object.metadatas.map((e: any) => Metadata.fromAmino(e)) : [], - pagination: object?.pagination ? PageResponse.fromAmino(object.pagination) : undefined - }; + const message = createBaseQueryDenomsMetadataResponse(); + message.metadatas = object.metadatas?.map(e => Metadata.fromAmino(e)) || []; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromAmino(object.pagination); + } + return message; }, toAmino(message: QueryDenomsMetadataResponse): QueryDenomsMetadataResponseAmino { const obj: any = {}; @@ -1689,6 +2845,8 @@ export const QueryDenomsMetadataResponse = { }; } }; +GlobalDecoderRegistry.register(QueryDenomsMetadataResponse.typeUrl, QueryDenomsMetadataResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryDenomsMetadataResponse.aminoType, QueryDenomsMetadataResponse.typeUrl); function createBaseQueryDenomMetadataRequest(): QueryDenomMetadataRequest { return { denom: "" @@ -1696,6 +2854,16 @@ function createBaseQueryDenomMetadataRequest(): QueryDenomMetadataRequest { } export const QueryDenomMetadataRequest = { typeUrl: "/cosmos.bank.v1beta1.QueryDenomMetadataRequest", + aminoType: "cosmos-sdk/QueryDenomMetadataRequest", + is(o: any): o is QueryDenomMetadataRequest { + return o && (o.$typeUrl === QueryDenomMetadataRequest.typeUrl || typeof o.denom === "string"); + }, + isSDK(o: any): o is QueryDenomMetadataRequestSDKType { + return o && (o.$typeUrl === QueryDenomMetadataRequest.typeUrl || typeof o.denom === "string"); + }, + isAmino(o: any): o is QueryDenomMetadataRequestAmino { + return o && (o.$typeUrl === QueryDenomMetadataRequest.typeUrl || typeof o.denom === "string"); + }, encode(message: QueryDenomMetadataRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.denom !== "") { writer.uint32(10).string(message.denom); @@ -1719,15 +2887,27 @@ export const QueryDenomMetadataRequest = { } return message; }, + fromJSON(object: any): QueryDenomMetadataRequest { + return { + denom: isSet(object.denom) ? String(object.denom) : "" + }; + }, + toJSON(message: QueryDenomMetadataRequest): unknown { + const obj: any = {}; + message.denom !== undefined && (obj.denom = message.denom); + return obj; + }, fromPartial(object: Partial): QueryDenomMetadataRequest { const message = createBaseQueryDenomMetadataRequest(); message.denom = object.denom ?? ""; return message; }, fromAmino(object: QueryDenomMetadataRequestAmino): QueryDenomMetadataRequest { - return { - denom: object.denom - }; + const message = createBaseQueryDenomMetadataRequest(); + if (object.denom !== undefined && object.denom !== null) { + message.denom = object.denom; + } + return message; }, toAmino(message: QueryDenomMetadataRequest): QueryDenomMetadataRequestAmino { const obj: any = {}; @@ -1756,6 +2936,8 @@ export const QueryDenomMetadataRequest = { }; } }; +GlobalDecoderRegistry.register(QueryDenomMetadataRequest.typeUrl, QueryDenomMetadataRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryDenomMetadataRequest.aminoType, QueryDenomMetadataRequest.typeUrl); function createBaseQueryDenomMetadataResponse(): QueryDenomMetadataResponse { return { metadata: Metadata.fromPartial({}) @@ -1763,6 +2945,16 @@ function createBaseQueryDenomMetadataResponse(): QueryDenomMetadataResponse { } export const QueryDenomMetadataResponse = { typeUrl: "/cosmos.bank.v1beta1.QueryDenomMetadataResponse", + aminoType: "cosmos-sdk/QueryDenomMetadataResponse", + is(o: any): o is QueryDenomMetadataResponse { + return o && (o.$typeUrl === QueryDenomMetadataResponse.typeUrl || Metadata.is(o.metadata)); + }, + isSDK(o: any): o is QueryDenomMetadataResponseSDKType { + return o && (o.$typeUrl === QueryDenomMetadataResponse.typeUrl || Metadata.isSDK(o.metadata)); + }, + isAmino(o: any): o is QueryDenomMetadataResponseAmino { + return o && (o.$typeUrl === QueryDenomMetadataResponse.typeUrl || Metadata.isAmino(o.metadata)); + }, encode(message: QueryDenomMetadataResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.metadata !== undefined) { Metadata.encode(message.metadata, writer.uint32(10).fork()).ldelim(); @@ -1786,19 +2978,31 @@ export const QueryDenomMetadataResponse = { } return message; }, + fromJSON(object: any): QueryDenomMetadataResponse { + 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; + }, fromPartial(object: Partial): QueryDenomMetadataResponse { const message = createBaseQueryDenomMetadataResponse(); message.metadata = object.metadata !== undefined && object.metadata !== null ? Metadata.fromPartial(object.metadata) : undefined; return message; }, fromAmino(object: QueryDenomMetadataResponseAmino): QueryDenomMetadataResponse { - return { - metadata: object?.metadata ? Metadata.fromAmino(object.metadata) : undefined - }; + const message = createBaseQueryDenomMetadataResponse(); + if (object.metadata !== undefined && object.metadata !== null) { + message.metadata = Metadata.fromAmino(object.metadata); + } + return message; }, toAmino(message: QueryDenomMetadataResponse): QueryDenomMetadataResponseAmino { const obj: any = {}; - obj.metadata = message.metadata ? Metadata.toAmino(message.metadata) : undefined; + obj.metadata = message.metadata ? Metadata.toAmino(message.metadata) : Metadata.fromPartial({}); return obj; }, fromAminoMsg(object: QueryDenomMetadataResponseAminoMsg): QueryDenomMetadataResponse { @@ -1823,29 +3027,48 @@ export const QueryDenomMetadataResponse = { }; } }; -function createBaseQueryBaseDenomRequest(): QueryBaseDenomRequest { +GlobalDecoderRegistry.register(QueryDenomMetadataResponse.typeUrl, QueryDenomMetadataResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryDenomMetadataResponse.aminoType, QueryDenomMetadataResponse.typeUrl); +function createBaseQueryDenomOwnersRequest(): QueryDenomOwnersRequest { return { - denom: "" + denom: "", + pagination: undefined }; } -export const QueryBaseDenomRequest = { - typeUrl: "/cosmos.bank.v1beta1.QueryBaseDenomRequest", - encode(message: QueryBaseDenomRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { +export const QueryDenomOwnersRequest = { + typeUrl: "/cosmos.bank.v1beta1.QueryDenomOwnersRequest", + aminoType: "cosmos-sdk/QueryDenomOwnersRequest", + is(o: any): o is QueryDenomOwnersRequest { + return o && (o.$typeUrl === QueryDenomOwnersRequest.typeUrl || typeof o.denom === "string"); + }, + isSDK(o: any): o is QueryDenomOwnersRequestSDKType { + return o && (o.$typeUrl === QueryDenomOwnersRequest.typeUrl || typeof o.denom === "string"); + }, + isAmino(o: any): o is QueryDenomOwnersRequestAmino { + return o && (o.$typeUrl === QueryDenomOwnersRequest.typeUrl || typeof o.denom === "string"); + }, + encode(message: QueryDenomOwnersRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.denom !== "") { writer.uint32(10).string(message.denom); } + if (message.pagination !== undefined) { + PageRequest.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + } return writer; }, - decode(input: BinaryReader | Uint8Array, length?: number): QueryBaseDenomRequest { + decode(input: BinaryReader | Uint8Array, length?: number): QueryDenomOwnersRequest { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQueryBaseDenomRequest(); + const message = createBaseQueryDenomOwnersRequest(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: message.denom = reader.string(); break; + case 2: + message.pagination = PageRequest.decode(reader, reader.uint32()); + break; default: reader.skipType(tag & 7); break; @@ -1853,65 +3076,319 @@ export const QueryBaseDenomRequest = { } return message; }, - fromPartial(object: Partial): QueryBaseDenomRequest { - const message = createBaseQueryBaseDenomRequest(); + fromJSON(object: any): QueryDenomOwnersRequest { + return { + denom: isSet(object.denom) ? String(object.denom) : "", + pagination: isSet(object.pagination) ? PageRequest.fromJSON(object.pagination) : undefined + }; + }, + toJSON(message: QueryDenomOwnersRequest): unknown { + const obj: any = {}; + message.denom !== undefined && (obj.denom = message.denom); + message.pagination !== undefined && (obj.pagination = message.pagination ? PageRequest.toJSON(message.pagination) : undefined); + return obj; + }, + fromPartial(object: Partial): QueryDenomOwnersRequest { + const message = createBaseQueryDenomOwnersRequest(); message.denom = object.denom ?? ""; + message.pagination = object.pagination !== undefined && object.pagination !== null ? PageRequest.fromPartial(object.pagination) : undefined; + return message; + }, + fromAmino(object: QueryDenomOwnersRequestAmino): QueryDenomOwnersRequest { + const message = createBaseQueryDenomOwnersRequest(); + if (object.denom !== undefined && object.denom !== null) { + message.denom = object.denom; + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromAmino(object.pagination); + } + return message; + }, + toAmino(message: QueryDenomOwnersRequest): QueryDenomOwnersRequestAmino { + const obj: any = {}; + obj.denom = message.denom; + obj.pagination = message.pagination ? PageRequest.toAmino(message.pagination) : undefined; + return obj; + }, + fromAminoMsg(object: QueryDenomOwnersRequestAminoMsg): QueryDenomOwnersRequest { + return QueryDenomOwnersRequest.fromAmino(object.value); + }, + toAminoMsg(message: QueryDenomOwnersRequest): QueryDenomOwnersRequestAminoMsg { + return { + type: "cosmos-sdk/QueryDenomOwnersRequest", + value: QueryDenomOwnersRequest.toAmino(message) + }; + }, + fromProtoMsg(message: QueryDenomOwnersRequestProtoMsg): QueryDenomOwnersRequest { + return QueryDenomOwnersRequest.decode(message.value); + }, + toProto(message: QueryDenomOwnersRequest): Uint8Array { + return QueryDenomOwnersRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryDenomOwnersRequest): QueryDenomOwnersRequestProtoMsg { + return { + typeUrl: "/cosmos.bank.v1beta1.QueryDenomOwnersRequest", + value: QueryDenomOwnersRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryDenomOwnersRequest.typeUrl, QueryDenomOwnersRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryDenomOwnersRequest.aminoType, QueryDenomOwnersRequest.typeUrl); +function createBaseDenomOwner(): DenomOwner { + return { + address: "", + balance: Coin.fromPartial({}) + }; +} +export const DenomOwner = { + typeUrl: "/cosmos.bank.v1beta1.DenomOwner", + aminoType: "cosmos-sdk/DenomOwner", + is(o: any): o is DenomOwner { + return o && (o.$typeUrl === DenomOwner.typeUrl || typeof o.address === "string" && Coin.is(o.balance)); + }, + isSDK(o: any): o is DenomOwnerSDKType { + return o && (o.$typeUrl === DenomOwner.typeUrl || typeof o.address === "string" && Coin.isSDK(o.balance)); + }, + isAmino(o: any): o is DenomOwnerAmino { + return o && (o.$typeUrl === DenomOwner.typeUrl || typeof o.address === "string" && Coin.isAmino(o.balance)); + }, + encode(message: DenomOwner, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.address !== "") { + writer.uint32(10).string(message.address); + } + if (message.balance !== undefined) { + Coin.encode(message.balance, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): DenomOwner { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseDenomOwner(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.address = reader.string(); + break; + case 2: + message.balance = Coin.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } return message; }, - fromAmino(object: QueryBaseDenomRequestAmino): QueryBaseDenomRequest { + fromJSON(object: any): DenomOwner { return { - denom: object.denom + address: isSet(object.address) ? String(object.address) : "", + balance: isSet(object.balance) ? Coin.fromJSON(object.balance) : undefined }; }, - toAmino(message: QueryBaseDenomRequest): QueryBaseDenomRequestAmino { + toJSON(message: DenomOwner): unknown { const obj: any = {}; - obj.denom = message.denom; + message.address !== undefined && (obj.address = message.address); + message.balance !== undefined && (obj.balance = message.balance ? Coin.toJSON(message.balance) : undefined); + return obj; + }, + fromPartial(object: Partial): DenomOwner { + const message = createBaseDenomOwner(); + message.address = object.address ?? ""; + message.balance = object.balance !== undefined && object.balance !== null ? Coin.fromPartial(object.balance) : undefined; + return message; + }, + fromAmino(object: DenomOwnerAmino): DenomOwner { + const message = createBaseDenomOwner(); + if (object.address !== undefined && object.address !== null) { + message.address = object.address; + } + if (object.balance !== undefined && object.balance !== null) { + message.balance = Coin.fromAmino(object.balance); + } + return message; + }, + toAmino(message: DenomOwner): DenomOwnerAmino { + const obj: any = {}; + obj.address = message.address; + obj.balance = message.balance ? Coin.toAmino(message.balance) : Coin.fromPartial({}); + return obj; + }, + fromAminoMsg(object: DenomOwnerAminoMsg): DenomOwner { + return DenomOwner.fromAmino(object.value); + }, + toAminoMsg(message: DenomOwner): DenomOwnerAminoMsg { + return { + type: "cosmos-sdk/DenomOwner", + value: DenomOwner.toAmino(message) + }; + }, + fromProtoMsg(message: DenomOwnerProtoMsg): DenomOwner { + return DenomOwner.decode(message.value); + }, + toProto(message: DenomOwner): Uint8Array { + return DenomOwner.encode(message).finish(); + }, + toProtoMsg(message: DenomOwner): DenomOwnerProtoMsg { + return { + typeUrl: "/cosmos.bank.v1beta1.DenomOwner", + value: DenomOwner.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(DenomOwner.typeUrl, DenomOwner); +GlobalDecoderRegistry.registerAminoProtoMapping(DenomOwner.aminoType, DenomOwner.typeUrl); +function createBaseQueryDenomOwnersResponse(): QueryDenomOwnersResponse { + return { + denomOwners: [], + pagination: undefined + }; +} +export const QueryDenomOwnersResponse = { + typeUrl: "/cosmos.bank.v1beta1.QueryDenomOwnersResponse", + aminoType: "cosmos-sdk/QueryDenomOwnersResponse", + is(o: any): o is QueryDenomOwnersResponse { + return o && (o.$typeUrl === QueryDenomOwnersResponse.typeUrl || Array.isArray(o.denomOwners) && (!o.denomOwners.length || DenomOwner.is(o.denomOwners[0]))); + }, + isSDK(o: any): o is QueryDenomOwnersResponseSDKType { + return o && (o.$typeUrl === QueryDenomOwnersResponse.typeUrl || Array.isArray(o.denom_owners) && (!o.denom_owners.length || DenomOwner.isSDK(o.denom_owners[0]))); + }, + isAmino(o: any): o is QueryDenomOwnersResponseAmino { + return o && (o.$typeUrl === QueryDenomOwnersResponse.typeUrl || Array.isArray(o.denom_owners) && (!o.denom_owners.length || DenomOwner.isAmino(o.denom_owners[0]))); + }, + encode(message: QueryDenomOwnersResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.denomOwners) { + DenomOwner.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.pagination !== undefined) { + PageResponse.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryDenomOwnersResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryDenomOwnersResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.denomOwners.push(DenomOwner.decode(reader, reader.uint32())); + break; + case 2: + message.pagination = PageResponse.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): QueryDenomOwnersResponse { + return { + denomOwners: Array.isArray(object?.denomOwners) ? object.denomOwners.map((e: any) => DenomOwner.fromJSON(e)) : [], + pagination: isSet(object.pagination) ? PageResponse.fromJSON(object.pagination) : undefined + }; + }, + toJSON(message: QueryDenomOwnersResponse): unknown { + const obj: any = {}; + if (message.denomOwners) { + obj.denomOwners = message.denomOwners.map(e => e ? DenomOwner.toJSON(e) : undefined); + } else { + obj.denomOwners = []; + } + message.pagination !== undefined && (obj.pagination = message.pagination ? PageResponse.toJSON(message.pagination) : undefined); + return obj; + }, + fromPartial(object: Partial): QueryDenomOwnersResponse { + const message = createBaseQueryDenomOwnersResponse(); + message.denomOwners = object.denomOwners?.map(e => DenomOwner.fromPartial(e)) || []; + message.pagination = object.pagination !== undefined && object.pagination !== null ? PageResponse.fromPartial(object.pagination) : undefined; + return message; + }, + fromAmino(object: QueryDenomOwnersResponseAmino): QueryDenomOwnersResponse { + const message = createBaseQueryDenomOwnersResponse(); + message.denomOwners = object.denom_owners?.map(e => DenomOwner.fromAmino(e)) || []; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromAmino(object.pagination); + } + return message; + }, + toAmino(message: QueryDenomOwnersResponse): QueryDenomOwnersResponseAmino { + const obj: any = {}; + if (message.denomOwners) { + obj.denom_owners = message.denomOwners.map(e => e ? DenomOwner.toAmino(e) : undefined); + } else { + obj.denom_owners = []; + } + obj.pagination = message.pagination ? PageResponse.toAmino(message.pagination) : undefined; return obj; }, - fromAminoMsg(object: QueryBaseDenomRequestAminoMsg): QueryBaseDenomRequest { - return QueryBaseDenomRequest.fromAmino(object.value); + fromAminoMsg(object: QueryDenomOwnersResponseAminoMsg): QueryDenomOwnersResponse { + return QueryDenomOwnersResponse.fromAmino(object.value); }, - toAminoMsg(message: QueryBaseDenomRequest): QueryBaseDenomRequestAminoMsg { + toAminoMsg(message: QueryDenomOwnersResponse): QueryDenomOwnersResponseAminoMsg { return { - type: "cosmos-sdk/QueryBaseDenomRequest", - value: QueryBaseDenomRequest.toAmino(message) + type: "cosmos-sdk/QueryDenomOwnersResponse", + value: QueryDenomOwnersResponse.toAmino(message) }; }, - fromProtoMsg(message: QueryBaseDenomRequestProtoMsg): QueryBaseDenomRequest { - return QueryBaseDenomRequest.decode(message.value); + fromProtoMsg(message: QueryDenomOwnersResponseProtoMsg): QueryDenomOwnersResponse { + return QueryDenomOwnersResponse.decode(message.value); }, - toProto(message: QueryBaseDenomRequest): Uint8Array { - return QueryBaseDenomRequest.encode(message).finish(); + toProto(message: QueryDenomOwnersResponse): Uint8Array { + return QueryDenomOwnersResponse.encode(message).finish(); }, - toProtoMsg(message: QueryBaseDenomRequest): QueryBaseDenomRequestProtoMsg { + toProtoMsg(message: QueryDenomOwnersResponse): QueryDenomOwnersResponseProtoMsg { return { - typeUrl: "/cosmos.bank.v1beta1.QueryBaseDenomRequest", - value: QueryBaseDenomRequest.encode(message).finish() + typeUrl: "/cosmos.bank.v1beta1.QueryDenomOwnersResponse", + value: QueryDenomOwnersResponse.encode(message).finish() }; } }; -function createBaseQueryBaseDenomResponse(): QueryBaseDenomResponse { +GlobalDecoderRegistry.register(QueryDenomOwnersResponse.typeUrl, QueryDenomOwnersResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryDenomOwnersResponse.aminoType, QueryDenomOwnersResponse.typeUrl); +function createBaseQuerySendEnabledRequest(): QuerySendEnabledRequest { return { - baseDenom: "" + denoms: [], + pagination: undefined }; } -export const QueryBaseDenomResponse = { - typeUrl: "/cosmos.bank.v1beta1.QueryBaseDenomResponse", - encode(message: QueryBaseDenomResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { - if (message.baseDenom !== "") { - writer.uint32(10).string(message.baseDenom); +export const QuerySendEnabledRequest = { + typeUrl: "/cosmos.bank.v1beta1.QuerySendEnabledRequest", + aminoType: "cosmos-sdk/QuerySendEnabledRequest", + is(o: any): o is QuerySendEnabledRequest { + return o && (o.$typeUrl === QuerySendEnabledRequest.typeUrl || Array.isArray(o.denoms) && (!o.denoms.length || typeof o.denoms[0] === "string")); + }, + isSDK(o: any): o is QuerySendEnabledRequestSDKType { + return o && (o.$typeUrl === QuerySendEnabledRequest.typeUrl || Array.isArray(o.denoms) && (!o.denoms.length || typeof o.denoms[0] === "string")); + }, + isAmino(o: any): o is QuerySendEnabledRequestAmino { + return o && (o.$typeUrl === QuerySendEnabledRequest.typeUrl || Array.isArray(o.denoms) && (!o.denoms.length || typeof o.denoms[0] === "string")); + }, + encode(message: QuerySendEnabledRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.denoms) { + writer.uint32(10).string(v!); + } + if (message.pagination !== undefined) { + PageRequest.encode(message.pagination, writer.uint32(794).fork()).ldelim(); } return writer; }, - decode(input: BinaryReader | Uint8Array, length?: number): QueryBaseDenomResponse { + decode(input: BinaryReader | Uint8Array, length?: number): QuerySendEnabledRequest { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQueryBaseDenomResponse(); + const message = createBaseQuerySendEnabledRequest(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.baseDenom = reader.string(); + message.denoms.push(reader.string()); + break; + case 99: + message.pagination = PageRequest.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -1920,40 +3397,178 @@ export const QueryBaseDenomResponse = { } return message; }, - fromPartial(object: Partial): QueryBaseDenomResponse { - const message = createBaseQueryBaseDenomResponse(); - message.baseDenom = object.baseDenom ?? ""; + fromJSON(object: any): QuerySendEnabledRequest { + return { + denoms: Array.isArray(object?.denoms) ? object.denoms.map((e: any) => String(e)) : [], + pagination: isSet(object.pagination) ? PageRequest.fromJSON(object.pagination) : undefined + }; + }, + toJSON(message: QuerySendEnabledRequest): unknown { + const obj: any = {}; + if (message.denoms) { + obj.denoms = message.denoms.map(e => e); + } else { + obj.denoms = []; + } + message.pagination !== undefined && (obj.pagination = message.pagination ? PageRequest.toJSON(message.pagination) : undefined); + return obj; + }, + fromPartial(object: Partial): QuerySendEnabledRequest { + const message = createBaseQuerySendEnabledRequest(); + message.denoms = object.denoms?.map(e => e) || []; + message.pagination = object.pagination !== undefined && object.pagination !== null ? PageRequest.fromPartial(object.pagination) : undefined; + return message; + }, + fromAmino(object: QuerySendEnabledRequestAmino): QuerySendEnabledRequest { + const message = createBaseQuerySendEnabledRequest(); + message.denoms = object.denoms?.map(e => e) || []; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromAmino(object.pagination); + } + return message; + }, + toAmino(message: QuerySendEnabledRequest): QuerySendEnabledRequestAmino { + const obj: any = {}; + if (message.denoms) { + obj.denoms = message.denoms.map(e => e); + } else { + obj.denoms = []; + } + obj.pagination = message.pagination ? PageRequest.toAmino(message.pagination) : undefined; + return obj; + }, + fromAminoMsg(object: QuerySendEnabledRequestAminoMsg): QuerySendEnabledRequest { + return QuerySendEnabledRequest.fromAmino(object.value); + }, + toAminoMsg(message: QuerySendEnabledRequest): QuerySendEnabledRequestAminoMsg { + return { + type: "cosmos-sdk/QuerySendEnabledRequest", + value: QuerySendEnabledRequest.toAmino(message) + }; + }, + fromProtoMsg(message: QuerySendEnabledRequestProtoMsg): QuerySendEnabledRequest { + return QuerySendEnabledRequest.decode(message.value); + }, + toProto(message: QuerySendEnabledRequest): Uint8Array { + return QuerySendEnabledRequest.encode(message).finish(); + }, + toProtoMsg(message: QuerySendEnabledRequest): QuerySendEnabledRequestProtoMsg { + return { + typeUrl: "/cosmos.bank.v1beta1.QuerySendEnabledRequest", + value: QuerySendEnabledRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QuerySendEnabledRequest.typeUrl, QuerySendEnabledRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(QuerySendEnabledRequest.aminoType, QuerySendEnabledRequest.typeUrl); +function createBaseQuerySendEnabledResponse(): QuerySendEnabledResponse { + return { + sendEnabled: [], + pagination: undefined + }; +} +export const QuerySendEnabledResponse = { + typeUrl: "/cosmos.bank.v1beta1.QuerySendEnabledResponse", + aminoType: "cosmos-sdk/QuerySendEnabledResponse", + is(o: any): o is QuerySendEnabledResponse { + return o && (o.$typeUrl === QuerySendEnabledResponse.typeUrl || Array.isArray(o.sendEnabled) && (!o.sendEnabled.length || SendEnabled.is(o.sendEnabled[0]))); + }, + isSDK(o: any): o is QuerySendEnabledResponseSDKType { + return o && (o.$typeUrl === QuerySendEnabledResponse.typeUrl || Array.isArray(o.send_enabled) && (!o.send_enabled.length || SendEnabled.isSDK(o.send_enabled[0]))); + }, + isAmino(o: any): o is QuerySendEnabledResponseAmino { + return o && (o.$typeUrl === QuerySendEnabledResponse.typeUrl || Array.isArray(o.send_enabled) && (!o.send_enabled.length || SendEnabled.isAmino(o.send_enabled[0]))); + }, + encode(message: QuerySendEnabledResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.sendEnabled) { + SendEnabled.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.pagination !== undefined) { + PageResponse.encode(message.pagination, writer.uint32(794).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QuerySendEnabledResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQuerySendEnabledResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.sendEnabled.push(SendEnabled.decode(reader, reader.uint32())); + break; + case 99: + message.pagination = PageResponse.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } return message; }, - fromAmino(object: QueryBaseDenomResponseAmino): QueryBaseDenomResponse { + fromJSON(object: any): QuerySendEnabledResponse { return { - baseDenom: object.base_denom + sendEnabled: Array.isArray(object?.sendEnabled) ? object.sendEnabled.map((e: any) => SendEnabled.fromJSON(e)) : [], + pagination: isSet(object.pagination) ? PageResponse.fromJSON(object.pagination) : undefined }; }, - toAmino(message: QueryBaseDenomResponse): QueryBaseDenomResponseAmino { + toJSON(message: QuerySendEnabledResponse): unknown { + const obj: any = {}; + if (message.sendEnabled) { + obj.sendEnabled = message.sendEnabled.map(e => e ? SendEnabled.toJSON(e) : undefined); + } else { + obj.sendEnabled = []; + } + message.pagination !== undefined && (obj.pagination = message.pagination ? PageResponse.toJSON(message.pagination) : undefined); + return obj; + }, + fromPartial(object: Partial): QuerySendEnabledResponse { + const message = createBaseQuerySendEnabledResponse(); + message.sendEnabled = object.sendEnabled?.map(e => SendEnabled.fromPartial(e)) || []; + message.pagination = object.pagination !== undefined && object.pagination !== null ? PageResponse.fromPartial(object.pagination) : undefined; + return message; + }, + fromAmino(object: QuerySendEnabledResponseAmino): QuerySendEnabledResponse { + const message = createBaseQuerySendEnabledResponse(); + message.sendEnabled = object.send_enabled?.map(e => SendEnabled.fromAmino(e)) || []; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromAmino(object.pagination); + } + return message; + }, + toAmino(message: QuerySendEnabledResponse): QuerySendEnabledResponseAmino { const obj: any = {}; - obj.base_denom = message.baseDenom; + if (message.sendEnabled) { + obj.send_enabled = message.sendEnabled.map(e => e ? SendEnabled.toAmino(e) : undefined); + } else { + obj.send_enabled = []; + } + obj.pagination = message.pagination ? PageResponse.toAmino(message.pagination) : undefined; return obj; }, - fromAminoMsg(object: QueryBaseDenomResponseAminoMsg): QueryBaseDenomResponse { - return QueryBaseDenomResponse.fromAmino(object.value); + fromAminoMsg(object: QuerySendEnabledResponseAminoMsg): QuerySendEnabledResponse { + return QuerySendEnabledResponse.fromAmino(object.value); }, - toAminoMsg(message: QueryBaseDenomResponse): QueryBaseDenomResponseAminoMsg { + toAminoMsg(message: QuerySendEnabledResponse): QuerySendEnabledResponseAminoMsg { return { - type: "cosmos-sdk/QueryBaseDenomResponse", - value: QueryBaseDenomResponse.toAmino(message) + type: "cosmos-sdk/QuerySendEnabledResponse", + value: QuerySendEnabledResponse.toAmino(message) }; }, - fromProtoMsg(message: QueryBaseDenomResponseProtoMsg): QueryBaseDenomResponse { - return QueryBaseDenomResponse.decode(message.value); + fromProtoMsg(message: QuerySendEnabledResponseProtoMsg): QuerySendEnabledResponse { + return QuerySendEnabledResponse.decode(message.value); }, - toProto(message: QueryBaseDenomResponse): Uint8Array { - return QueryBaseDenomResponse.encode(message).finish(); + toProto(message: QuerySendEnabledResponse): Uint8Array { + return QuerySendEnabledResponse.encode(message).finish(); }, - toProtoMsg(message: QueryBaseDenomResponse): QueryBaseDenomResponseProtoMsg { + toProtoMsg(message: QuerySendEnabledResponse): QuerySendEnabledResponseProtoMsg { return { - typeUrl: "/cosmos.bank.v1beta1.QueryBaseDenomResponse", - value: QueryBaseDenomResponse.encode(message).finish() + typeUrl: "/cosmos.bank.v1beta1.QuerySendEnabledResponse", + value: QuerySendEnabledResponse.encode(message).finish() }; } -}; \ No newline at end of file +}; +GlobalDecoderRegistry.register(QuerySendEnabledResponse.typeUrl, QuerySendEnabledResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(QuerySendEnabledResponse.aminoType, QuerySendEnabledResponse.typeUrl); \ No newline at end of file diff --git a/packages/osmojs/src/codegen/cosmos/bank/v1beta1/tx.amino.ts b/packages/osmojs/src/codegen/cosmos/bank/v1beta1/tx.amino.ts index 340a07fc7..e1b950a79 100644 --- a/packages/osmojs/src/codegen/cosmos/bank/v1beta1/tx.amino.ts +++ b/packages/osmojs/src/codegen/cosmos/bank/v1beta1/tx.amino.ts @@ -1,5 +1,5 @@ //@ts-nocheck -import { MsgSend, MsgMultiSend } from "./tx"; +import { MsgSend, MsgMultiSend, MsgUpdateParams, MsgSetSendEnabled } from "./tx"; export const AminoConverter = { "/cosmos.bank.v1beta1.MsgSend": { aminoType: "cosmos-sdk/MsgSend", @@ -10,5 +10,15 @@ export const AminoConverter = { aminoType: "cosmos-sdk/MsgMultiSend", toAmino: MsgMultiSend.toAmino, fromAmino: MsgMultiSend.fromAmino + }, + "/cosmos.bank.v1beta1.MsgUpdateParams": { + aminoType: "cosmos-sdk/x/bank/MsgUpdateParams", + toAmino: MsgUpdateParams.toAmino, + fromAmino: MsgUpdateParams.fromAmino + }, + "/cosmos.bank.v1beta1.MsgSetSendEnabled": { + aminoType: "cosmos-sdk/MsgSetSendEnabled", + toAmino: MsgSetSendEnabled.toAmino, + fromAmino: MsgSetSendEnabled.fromAmino } }; \ No newline at end of file diff --git a/packages/osmojs/src/codegen/cosmos/bank/v1beta1/tx.registry.ts b/packages/osmojs/src/codegen/cosmos/bank/v1beta1/tx.registry.ts index 716f9d0da..63ce91d6e 100644 --- a/packages/osmojs/src/codegen/cosmos/bank/v1beta1/tx.registry.ts +++ b/packages/osmojs/src/codegen/cosmos/bank/v1beta1/tx.registry.ts @@ -1,7 +1,7 @@ //@ts-nocheck import { GeneratedType, Registry } from "@cosmjs/proto-signing"; -import { MsgSend, MsgMultiSend } from "./tx"; -export const registry: ReadonlyArray<[string, GeneratedType]> = [["/cosmos.bank.v1beta1.MsgSend", MsgSend], ["/cosmos.bank.v1beta1.MsgMultiSend", MsgMultiSend]]; +import { MsgSend, MsgMultiSend, MsgUpdateParams, MsgSetSendEnabled } from "./tx"; +export const registry: ReadonlyArray<[string, GeneratedType]> = [["/cosmos.bank.v1beta1.MsgSend", MsgSend], ["/cosmos.bank.v1beta1.MsgMultiSend", MsgMultiSend], ["/cosmos.bank.v1beta1.MsgUpdateParams", MsgUpdateParams], ["/cosmos.bank.v1beta1.MsgSetSendEnabled", MsgSetSendEnabled]]; export const load = (protoRegistry: Registry) => { registry.forEach(([typeUrl, mod]) => { protoRegistry.register(typeUrl, mod); @@ -20,6 +20,18 @@ export const MessageComposer = { typeUrl: "/cosmos.bank.v1beta1.MsgMultiSend", value: MsgMultiSend.encode(value).finish() }; + }, + updateParams(value: MsgUpdateParams) { + return { + typeUrl: "/cosmos.bank.v1beta1.MsgUpdateParams", + value: MsgUpdateParams.encode(value).finish() + }; + }, + setSendEnabled(value: MsgSetSendEnabled) { + return { + typeUrl: "/cosmos.bank.v1beta1.MsgSetSendEnabled", + value: MsgSetSendEnabled.encode(value).finish() + }; } }, withTypeUrl: { @@ -34,6 +46,70 @@ export const MessageComposer = { typeUrl: "/cosmos.bank.v1beta1.MsgMultiSend", value }; + }, + updateParams(value: MsgUpdateParams) { + return { + typeUrl: "/cosmos.bank.v1beta1.MsgUpdateParams", + value + }; + }, + setSendEnabled(value: MsgSetSendEnabled) { + return { + typeUrl: "/cosmos.bank.v1beta1.MsgSetSendEnabled", + value + }; + } + }, + toJSON: { + send(value: MsgSend) { + return { + typeUrl: "/cosmos.bank.v1beta1.MsgSend", + value: MsgSend.toJSON(value) + }; + }, + multiSend(value: MsgMultiSend) { + return { + typeUrl: "/cosmos.bank.v1beta1.MsgMultiSend", + value: MsgMultiSend.toJSON(value) + }; + }, + updateParams(value: MsgUpdateParams) { + return { + typeUrl: "/cosmos.bank.v1beta1.MsgUpdateParams", + value: MsgUpdateParams.toJSON(value) + }; + }, + setSendEnabled(value: MsgSetSendEnabled) { + return { + typeUrl: "/cosmos.bank.v1beta1.MsgSetSendEnabled", + value: MsgSetSendEnabled.toJSON(value) + }; + } + }, + fromJSON: { + send(value: any) { + return { + typeUrl: "/cosmos.bank.v1beta1.MsgSend", + value: MsgSend.fromJSON(value) + }; + }, + multiSend(value: any) { + return { + typeUrl: "/cosmos.bank.v1beta1.MsgMultiSend", + value: MsgMultiSend.fromJSON(value) + }; + }, + updateParams(value: any) { + return { + typeUrl: "/cosmos.bank.v1beta1.MsgUpdateParams", + value: MsgUpdateParams.fromJSON(value) + }; + }, + setSendEnabled(value: any) { + return { + typeUrl: "/cosmos.bank.v1beta1.MsgSetSendEnabled", + value: MsgSetSendEnabled.fromJSON(value) + }; } }, fromPartial: { @@ -48,6 +124,18 @@ export const MessageComposer = { typeUrl: "/cosmos.bank.v1beta1.MsgMultiSend", value: MsgMultiSend.fromPartial(value) }; + }, + updateParams(value: MsgUpdateParams) { + return { + typeUrl: "/cosmos.bank.v1beta1.MsgUpdateParams", + value: MsgUpdateParams.fromPartial(value) + }; + }, + setSendEnabled(value: MsgSetSendEnabled) { + return { + typeUrl: "/cosmos.bank.v1beta1.MsgSetSendEnabled", + value: MsgSetSendEnabled.fromPartial(value) + }; } } }; \ No newline at end of file diff --git a/packages/osmojs/src/codegen/cosmos/bank/v1beta1/tx.rpc.msg.ts b/packages/osmojs/src/codegen/cosmos/bank/v1beta1/tx.rpc.msg.ts index 2193a1df2..0d3b335c1 100644 --- a/packages/osmojs/src/codegen/cosmos/bank/v1beta1/tx.rpc.msg.ts +++ b/packages/osmojs/src/codegen/cosmos/bank/v1beta1/tx.rpc.msg.ts @@ -1,19 +1,28 @@ import { Rpc } from "../../../helpers"; import { BinaryReader } from "../../../binary"; -import { MsgSend, MsgSendResponse, MsgMultiSend, MsgMultiSendResponse } from "./tx"; +import { MsgSend, MsgSendResponse, MsgMultiSend, MsgMultiSendResponse, MsgUpdateParams, MsgUpdateParamsResponse, MsgSetSendEnabled, MsgSetSendEnabledResponse } from "./tx"; /** Msg defines the bank Msg service. */ export interface Msg { + /** Send defines a method for sending coins from one account to another account. */ + send(request: MsgSend): Promise; + /** MultiSend defines a method for sending coins from some accounts to other accounts. */ + multiSend(request: MsgMultiSend): Promise; /** - * Send defines a method for sending coins from one account to another - * account. + * UpdateParams defines a governance operation for updating the x/bank module parameters. + * The authority is defined in the keeper. + * + * Since: cosmos-sdk 0.47 */ - send(request: MsgSend): Promise; + updateParams(request: MsgUpdateParams): Promise; /** - * MultiSend defines a method for sending coins from a single account to - * multiple accounts. It can be seen as a single message representation of - * multiple individual MsgSend messages. + * SetSendEnabled is a governance operation for setting the SendEnabled flag + * on any number of Denoms. Only the entries to add or update should be + * included. Entries that already exist in the store, but that aren't + * included in this message, will be left unchanged. + * + * Since: cosmos-sdk 0.47 */ - multiSend(request: MsgMultiSend): Promise; + setSendEnabled(request: MsgSetSendEnabled): Promise; } export class MsgClientImpl implements Msg { private readonly rpc: Rpc; @@ -21,6 +30,8 @@ export class MsgClientImpl implements Msg { this.rpc = rpc; this.send = this.send.bind(this); this.multiSend = this.multiSend.bind(this); + this.updateParams = this.updateParams.bind(this); + this.setSendEnabled = this.setSendEnabled.bind(this); } send(request: MsgSend): Promise { const data = MsgSend.encode(request).finish(); @@ -32,4 +43,17 @@ export class MsgClientImpl implements Msg { const promise = this.rpc.request("cosmos.bank.v1beta1.Msg", "MultiSend", data); return promise.then(data => MsgMultiSendResponse.decode(new BinaryReader(data))); } -} \ No newline at end of file + updateParams(request: MsgUpdateParams): Promise { + const data = MsgUpdateParams.encode(request).finish(); + const promise = this.rpc.request("cosmos.bank.v1beta1.Msg", "UpdateParams", data); + return promise.then(data => MsgUpdateParamsResponse.decode(new BinaryReader(data))); + } + setSendEnabled(request: MsgSetSendEnabled): Promise { + const data = MsgSetSendEnabled.encode(request).finish(); + const promise = this.rpc.request("cosmos.bank.v1beta1.Msg", "SetSendEnabled", data); + return promise.then(data => MsgSetSendEnabledResponse.decode(new BinaryReader(data))); + } +} +export const createClientImpl = (rpc: Rpc) => { + return new MsgClientImpl(rpc); +}; \ No newline at end of file diff --git a/packages/osmojs/src/codegen/cosmos/bank/v1beta1/tx.ts b/packages/osmojs/src/codegen/cosmos/bank/v1beta1/tx.ts index 139f1166a..0f76ed4f6 100644 --- a/packages/osmojs/src/codegen/cosmos/bank/v1beta1/tx.ts +++ b/packages/osmojs/src/codegen/cosmos/bank/v1beta1/tx.ts @@ -1,6 +1,8 @@ import { Coin, CoinAmino, CoinSDKType } from "../../base/v1beta1/coin"; -import { Input, InputAmino, InputSDKType, Output, OutputAmino, OutputSDKType } from "./bank"; +import { Input, InputAmino, InputSDKType, Output, OutputAmino, OutputSDKType, Params, ParamsAmino, ParamsSDKType, SendEnabled, SendEnabledAmino, SendEnabledSDKType } from "./bank"; import { BinaryReader, BinaryWriter } from "../../../binary"; +import { isSet } from "../../../helpers"; +import { GlobalDecoderRegistry } from "../../../registry"; /** MsgSend represents a message to send coins from one account to another. */ export interface MsgSend { fromAddress: string; @@ -13,8 +15,8 @@ export interface MsgSendProtoMsg { } /** MsgSend represents a message to send coins from one account to another. */ export interface MsgSendAmino { - from_address: string; - to_address: string; + from_address?: string; + to_address?: string; amount: CoinAmino[]; } export interface MsgSendAminoMsg { @@ -43,6 +45,10 @@ export interface MsgSendResponseAminoMsg { export interface MsgSendResponseSDKType {} /** MsgMultiSend represents an arbitrary multi-in, multi-out send message. */ export interface MsgMultiSend { + /** + * Inputs, despite being `repeated`, only allows one sender input. This is + * checked in MsgMultiSend's ValidateBasic. + */ inputs: Input[]; outputs: Output[]; } @@ -52,6 +58,10 @@ export interface MsgMultiSendProtoMsg { } /** MsgMultiSend represents an arbitrary multi-in, multi-out send message. */ export interface MsgMultiSendAmino { + /** + * Inputs, despite being `repeated`, only allows one sender input. This is + * checked in MsgMultiSend's ValidateBasic. + */ inputs: InputAmino[]; outputs: OutputAmino[]; } @@ -78,6 +88,172 @@ export interface MsgMultiSendResponseAminoMsg { } /** MsgMultiSendResponse defines the Msg/MultiSend response type. */ export interface MsgMultiSendResponseSDKType {} +/** + * MsgUpdateParams is the Msg/UpdateParams request type. + * + * Since: cosmos-sdk 0.47 + */ +export interface MsgUpdateParams { + /** authority is the address that controls the module (defaults to x/gov unless overwritten). */ + authority: string; + /** + * params defines the x/bank parameters to update. + * + * NOTE: All parameters must be supplied. + */ + params: Params; +} +export interface MsgUpdateParamsProtoMsg { + typeUrl: "/cosmos.bank.v1beta1.MsgUpdateParams"; + value: Uint8Array; +} +/** + * MsgUpdateParams is the Msg/UpdateParams request type. + * + * Since: cosmos-sdk 0.47 + */ +export interface MsgUpdateParamsAmino { + /** authority is the address that controls the module (defaults to x/gov unless overwritten). */ + authority?: string; + /** + * params defines the x/bank parameters to update. + * + * NOTE: All parameters must be supplied. + */ + params: ParamsAmino; +} +export interface MsgUpdateParamsAminoMsg { + type: "cosmos-sdk/x/bank/MsgUpdateParams"; + value: MsgUpdateParamsAmino; +} +/** + * MsgUpdateParams is the Msg/UpdateParams request type. + * + * Since: cosmos-sdk 0.47 + */ +export interface MsgUpdateParamsSDKType { + authority: string; + params: ParamsSDKType; +} +/** + * MsgUpdateParamsResponse defines the response structure for executing a + * MsgUpdateParams message. + * + * Since: cosmos-sdk 0.47 + */ +export interface MsgUpdateParamsResponse {} +export interface MsgUpdateParamsResponseProtoMsg { + typeUrl: "/cosmos.bank.v1beta1.MsgUpdateParamsResponse"; + value: Uint8Array; +} +/** + * MsgUpdateParamsResponse defines the response structure for executing a + * MsgUpdateParams message. + * + * Since: cosmos-sdk 0.47 + */ +export interface MsgUpdateParamsResponseAmino {} +export interface MsgUpdateParamsResponseAminoMsg { + type: "cosmos-sdk/MsgUpdateParamsResponse"; + value: MsgUpdateParamsResponseAmino; +} +/** + * MsgUpdateParamsResponse defines the response structure for executing a + * MsgUpdateParams message. + * + * Since: cosmos-sdk 0.47 + */ +export interface MsgUpdateParamsResponseSDKType {} +/** + * MsgSetSendEnabled is the Msg/SetSendEnabled request type. + * + * Only entries to add/update/delete need to be included. + * Existing SendEnabled entries that are not included in this + * message are left unchanged. + * + * Since: cosmos-sdk 0.47 + */ +export interface MsgSetSendEnabled { + authority: string; + /** send_enabled is the list of entries to add or update. */ + sendEnabled: SendEnabled[]; + /** + * use_default_for is a list of denoms that should use the params.default_send_enabled value. + * Denoms listed here will have their SendEnabled entries deleted. + * If a denom is included that doesn't have a SendEnabled entry, + * it will be ignored. + */ + useDefaultFor: string[]; +} +export interface MsgSetSendEnabledProtoMsg { + typeUrl: "/cosmos.bank.v1beta1.MsgSetSendEnabled"; + value: Uint8Array; +} +/** + * MsgSetSendEnabled is the Msg/SetSendEnabled request type. + * + * Only entries to add/update/delete need to be included. + * Existing SendEnabled entries that are not included in this + * message are left unchanged. + * + * Since: cosmos-sdk 0.47 + */ +export interface MsgSetSendEnabledAmino { + authority?: string; + /** send_enabled is the list of entries to add or update. */ + send_enabled?: SendEnabledAmino[]; + /** + * use_default_for is a list of denoms that should use the params.default_send_enabled value. + * Denoms listed here will have their SendEnabled entries deleted. + * If a denom is included that doesn't have a SendEnabled entry, + * it will be ignored. + */ + use_default_for?: string[]; +} +export interface MsgSetSendEnabledAminoMsg { + type: "cosmos-sdk/MsgSetSendEnabled"; + value: MsgSetSendEnabledAmino; +} +/** + * MsgSetSendEnabled is the Msg/SetSendEnabled request type. + * + * Only entries to add/update/delete need to be included. + * Existing SendEnabled entries that are not included in this + * message are left unchanged. + * + * Since: cosmos-sdk 0.47 + */ +export interface MsgSetSendEnabledSDKType { + authority: string; + send_enabled: SendEnabledSDKType[]; + use_default_for: string[]; +} +/** + * MsgSetSendEnabledResponse defines the Msg/SetSendEnabled response type. + * + * Since: cosmos-sdk 0.47 + */ +export interface MsgSetSendEnabledResponse {} +export interface MsgSetSendEnabledResponseProtoMsg { + typeUrl: "/cosmos.bank.v1beta1.MsgSetSendEnabledResponse"; + value: Uint8Array; +} +/** + * MsgSetSendEnabledResponse defines the Msg/SetSendEnabled response type. + * + * Since: cosmos-sdk 0.47 + */ +export interface MsgSetSendEnabledResponseAmino {} +export interface MsgSetSendEnabledResponseAminoMsg { + type: "cosmos-sdk/MsgSetSendEnabledResponse"; + value: MsgSetSendEnabledResponseAmino; +} +/** + * MsgSetSendEnabledResponse defines the Msg/SetSendEnabled response type. + * + * Since: cosmos-sdk 0.47 + */ +export interface MsgSetSendEnabledResponseSDKType {} function createBaseMsgSend(): MsgSend { return { fromAddress: "", @@ -87,6 +263,16 @@ function createBaseMsgSend(): MsgSend { } export const MsgSend = { typeUrl: "/cosmos.bank.v1beta1.MsgSend", + aminoType: "cosmos-sdk/MsgSend", + is(o: any): o is MsgSend { + return o && (o.$typeUrl === MsgSend.typeUrl || typeof o.fromAddress === "string" && typeof o.toAddress === "string" && Array.isArray(o.amount) && (!o.amount.length || Coin.is(o.amount[0]))); + }, + isSDK(o: any): o is MsgSendSDKType { + return o && (o.$typeUrl === MsgSend.typeUrl || typeof o.from_address === "string" && typeof o.to_address === "string" && Array.isArray(o.amount) && (!o.amount.length || Coin.isSDK(o.amount[0]))); + }, + isAmino(o: any): o is MsgSendAmino { + return o && (o.$typeUrl === MsgSend.typeUrl || typeof o.from_address === "string" && typeof o.to_address === "string" && Array.isArray(o.amount) && (!o.amount.length || Coin.isAmino(o.amount[0]))); + }, encode(message: MsgSend, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.fromAddress !== "") { writer.uint32(10).string(message.fromAddress); @@ -122,6 +308,24 @@ export const MsgSend = { } 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)) : [] + }; + }, + toJSON(message: MsgSend): unknown { + const obj: any = {}; + message.fromAddress !== undefined && (obj.fromAddress = message.fromAddress); + message.toAddress !== undefined && (obj.toAddress = message.toAddress); + if (message.amount) { + obj.amount = message.amount.map(e => e ? Coin.toJSON(e) : undefined); + } else { + obj.amount = []; + } + return obj; + }, fromPartial(object: Partial): MsgSend { const message = createBaseMsgSend(); message.fromAddress = object.fromAddress ?? ""; @@ -130,11 +334,15 @@ export const MsgSend = { return message; }, fromAmino(object: MsgSendAmino): MsgSend { - return { - fromAddress: object.from_address, - toAddress: object.to_address, - amount: Array.isArray(object?.amount) ? object.amount.map((e: any) => Coin.fromAmino(e)) : [] - }; + const message = createBaseMsgSend(); + if (object.from_address !== undefined && object.from_address !== null) { + message.fromAddress = object.from_address; + } + if (object.to_address !== undefined && object.to_address !== null) { + message.toAddress = object.to_address; + } + message.amount = object.amount?.map(e => Coin.fromAmino(e)) || []; + return message; }, toAmino(message: MsgSend): MsgSendAmino { const obj: any = {}; @@ -169,11 +377,23 @@ export const MsgSend = { }; } }; +GlobalDecoderRegistry.register(MsgSend.typeUrl, MsgSend); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgSend.aminoType, MsgSend.typeUrl); function createBaseMsgSendResponse(): MsgSendResponse { return {}; } export const MsgSendResponse = { typeUrl: "/cosmos.bank.v1beta1.MsgSendResponse", + aminoType: "cosmos-sdk/MsgSendResponse", + is(o: any): o is MsgSendResponse { + return o && o.$typeUrl === MsgSendResponse.typeUrl; + }, + isSDK(o: any): o is MsgSendResponseSDKType { + return o && o.$typeUrl === MsgSendResponse.typeUrl; + }, + isAmino(o: any): o is MsgSendResponseAmino { + return o && o.$typeUrl === MsgSendResponse.typeUrl; + }, encode(_: MsgSendResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, @@ -191,12 +411,20 @@ export const MsgSendResponse = { } return message; }, + fromJSON(_: any): MsgSendResponse { + return {}; + }, + toJSON(_: MsgSendResponse): unknown { + const obj: any = {}; + return obj; + }, fromPartial(_: Partial): MsgSendResponse { const message = createBaseMsgSendResponse(); return message; }, fromAmino(_: MsgSendResponseAmino): MsgSendResponse { - return {}; + const message = createBaseMsgSendResponse(); + return message; }, toAmino(_: MsgSendResponse): MsgSendResponseAmino { const obj: any = {}; @@ -224,6 +452,8 @@ export const MsgSendResponse = { }; } }; +GlobalDecoderRegistry.register(MsgSendResponse.typeUrl, MsgSendResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgSendResponse.aminoType, MsgSendResponse.typeUrl); function createBaseMsgMultiSend(): MsgMultiSend { return { inputs: [], @@ -232,6 +462,16 @@ function createBaseMsgMultiSend(): MsgMultiSend { } export const MsgMultiSend = { typeUrl: "/cosmos.bank.v1beta1.MsgMultiSend", + aminoType: "cosmos-sdk/MsgMultiSend", + is(o: any): o is MsgMultiSend { + return o && (o.$typeUrl === MsgMultiSend.typeUrl || Array.isArray(o.inputs) && (!o.inputs.length || Input.is(o.inputs[0])) && Array.isArray(o.outputs) && (!o.outputs.length || Output.is(o.outputs[0]))); + }, + isSDK(o: any): o is MsgMultiSendSDKType { + return o && (o.$typeUrl === MsgMultiSend.typeUrl || Array.isArray(o.inputs) && (!o.inputs.length || Input.isSDK(o.inputs[0])) && Array.isArray(o.outputs) && (!o.outputs.length || Output.isSDK(o.outputs[0]))); + }, + isAmino(o: any): o is MsgMultiSendAmino { + return o && (o.$typeUrl === MsgMultiSend.typeUrl || Array.isArray(o.inputs) && (!o.inputs.length || Input.isAmino(o.inputs[0])) && Array.isArray(o.outputs) && (!o.outputs.length || Output.isAmino(o.outputs[0]))); + }, encode(message: MsgMultiSend, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.inputs) { Input.encode(v!, writer.uint32(10).fork()).ldelim(); @@ -261,6 +501,26 @@ export const MsgMultiSend = { } 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)) : [] + }; + }, + toJSON(message: MsgMultiSend): unknown { + const obj: any = {}; + if (message.inputs) { + obj.inputs = message.inputs.map(e => e ? Input.toJSON(e) : undefined); + } else { + obj.inputs = []; + } + if (message.outputs) { + obj.outputs = message.outputs.map(e => e ? Output.toJSON(e) : undefined); + } else { + obj.outputs = []; + } + return obj; + }, fromPartial(object: Partial): MsgMultiSend { const message = createBaseMsgMultiSend(); message.inputs = object.inputs?.map(e => Input.fromPartial(e)) || []; @@ -268,10 +528,10 @@ export const MsgMultiSend = { return message; }, fromAmino(object: MsgMultiSendAmino): MsgMultiSend { - return { - inputs: Array.isArray(object?.inputs) ? object.inputs.map((e: any) => Input.fromAmino(e)) : [], - outputs: Array.isArray(object?.outputs) ? object.outputs.map((e: any) => Output.fromAmino(e)) : [] - }; + const message = createBaseMsgMultiSend(); + message.inputs = object.inputs?.map(e => Input.fromAmino(e)) || []; + message.outputs = object.outputs?.map(e => Output.fromAmino(e)) || []; + return message; }, toAmino(message: MsgMultiSend): MsgMultiSendAmino { const obj: any = {}; @@ -309,11 +569,23 @@ export const MsgMultiSend = { }; } }; +GlobalDecoderRegistry.register(MsgMultiSend.typeUrl, MsgMultiSend); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgMultiSend.aminoType, MsgMultiSend.typeUrl); function createBaseMsgMultiSendResponse(): MsgMultiSendResponse { return {}; } export const MsgMultiSendResponse = { typeUrl: "/cosmos.bank.v1beta1.MsgMultiSendResponse", + aminoType: "cosmos-sdk/MsgMultiSendResponse", + is(o: any): o is MsgMultiSendResponse { + return o && o.$typeUrl === MsgMultiSendResponse.typeUrl; + }, + isSDK(o: any): o is MsgMultiSendResponseSDKType { + return o && o.$typeUrl === MsgMultiSendResponse.typeUrl; + }, + isAmino(o: any): o is MsgMultiSendResponseAmino { + return o && o.$typeUrl === MsgMultiSendResponse.typeUrl; + }, encode(_: MsgMultiSendResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, @@ -331,12 +603,20 @@ export const MsgMultiSendResponse = { } return message; }, + fromJSON(_: any): MsgMultiSendResponse { + return {}; + }, + toJSON(_: MsgMultiSendResponse): unknown { + const obj: any = {}; + return obj; + }, fromPartial(_: Partial): MsgMultiSendResponse { const message = createBaseMsgMultiSendResponse(); return message; }, fromAmino(_: MsgMultiSendResponseAmino): MsgMultiSendResponse { - return {}; + const message = createBaseMsgMultiSendResponse(); + return message; }, toAmino(_: MsgMultiSendResponse): MsgMultiSendResponseAmino { const obj: any = {}; @@ -363,4 +643,392 @@ export const MsgMultiSendResponse = { value: MsgMultiSendResponse.encode(message).finish() }; } -}; \ No newline at end of file +}; +GlobalDecoderRegistry.register(MsgMultiSendResponse.typeUrl, MsgMultiSendResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgMultiSendResponse.aminoType, MsgMultiSendResponse.typeUrl); +function createBaseMsgUpdateParams(): MsgUpdateParams { + return { + authority: "", + params: Params.fromPartial({}) + }; +} +export const MsgUpdateParams = { + typeUrl: "/cosmos.bank.v1beta1.MsgUpdateParams", + aminoType: "cosmos-sdk/x/bank/MsgUpdateParams", + is(o: any): o is MsgUpdateParams { + return o && (o.$typeUrl === MsgUpdateParams.typeUrl || typeof o.authority === "string" && Params.is(o.params)); + }, + isSDK(o: any): o is MsgUpdateParamsSDKType { + return o && (o.$typeUrl === MsgUpdateParams.typeUrl || typeof o.authority === "string" && Params.isSDK(o.params)); + }, + isAmino(o: any): o is MsgUpdateParamsAmino { + return o && (o.$typeUrl === MsgUpdateParams.typeUrl || typeof o.authority === "string" && Params.isAmino(o.params)); + }, + encode(message: MsgUpdateParams, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.authority !== "") { + writer.uint32(10).string(message.authority); + } + if (message.params !== undefined) { + Params.encode(message.params, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgUpdateParams { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUpdateParams(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.authority = reader.string(); + break; + case 2: + message.params = Params.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): MsgUpdateParams { + return { + authority: isSet(object.authority) ? String(object.authority) : "", + params: isSet(object.params) ? Params.fromJSON(object.params) : undefined + }; + }, + toJSON(message: MsgUpdateParams): unknown { + const obj: any = {}; + message.authority !== undefined && (obj.authority = message.authority); + message.params !== undefined && (obj.params = message.params ? Params.toJSON(message.params) : undefined); + return obj; + }, + fromPartial(object: Partial): MsgUpdateParams { + const message = createBaseMsgUpdateParams(); + message.authority = object.authority ?? ""; + message.params = object.params !== undefined && object.params !== null ? Params.fromPartial(object.params) : undefined; + return message; + }, + fromAmino(object: MsgUpdateParamsAmino): MsgUpdateParams { + const message = createBaseMsgUpdateParams(); + if (object.authority !== undefined && object.authority !== null) { + message.authority = object.authority; + } + if (object.params !== undefined && object.params !== null) { + message.params = Params.fromAmino(object.params); + } + return message; + }, + toAmino(message: MsgUpdateParams): MsgUpdateParamsAmino { + const obj: any = {}; + obj.authority = message.authority; + obj.params = message.params ? Params.toAmino(message.params) : Params.fromPartial({}); + return obj; + }, + fromAminoMsg(object: MsgUpdateParamsAminoMsg): MsgUpdateParams { + return MsgUpdateParams.fromAmino(object.value); + }, + toAminoMsg(message: MsgUpdateParams): MsgUpdateParamsAminoMsg { + return { + type: "cosmos-sdk/x/bank/MsgUpdateParams", + value: MsgUpdateParams.toAmino(message) + }; + }, + fromProtoMsg(message: MsgUpdateParamsProtoMsg): MsgUpdateParams { + return MsgUpdateParams.decode(message.value); + }, + toProto(message: MsgUpdateParams): Uint8Array { + return MsgUpdateParams.encode(message).finish(); + }, + toProtoMsg(message: MsgUpdateParams): MsgUpdateParamsProtoMsg { + return { + typeUrl: "/cosmos.bank.v1beta1.MsgUpdateParams", + value: MsgUpdateParams.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgUpdateParams.typeUrl, MsgUpdateParams); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgUpdateParams.aminoType, MsgUpdateParams.typeUrl); +function createBaseMsgUpdateParamsResponse(): MsgUpdateParamsResponse { + return {}; +} +export const MsgUpdateParamsResponse = { + typeUrl: "/cosmos.bank.v1beta1.MsgUpdateParamsResponse", + aminoType: "cosmos-sdk/MsgUpdateParamsResponse", + is(o: any): o is MsgUpdateParamsResponse { + return o && o.$typeUrl === MsgUpdateParamsResponse.typeUrl; + }, + isSDK(o: any): o is MsgUpdateParamsResponseSDKType { + return o && o.$typeUrl === MsgUpdateParamsResponse.typeUrl; + }, + isAmino(o: any): o is MsgUpdateParamsResponseAmino { + return o && o.$typeUrl === MsgUpdateParamsResponse.typeUrl; + }, + encode(_: MsgUpdateParamsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgUpdateParamsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUpdateParamsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(_: any): MsgUpdateParamsResponse { + return {}; + }, + toJSON(_: MsgUpdateParamsResponse): unknown { + const obj: any = {}; + return obj; + }, + fromPartial(_: Partial): MsgUpdateParamsResponse { + const message = createBaseMsgUpdateParamsResponse(); + return message; + }, + fromAmino(_: MsgUpdateParamsResponseAmino): MsgUpdateParamsResponse { + const message = createBaseMsgUpdateParamsResponse(); + return message; + }, + toAmino(_: MsgUpdateParamsResponse): MsgUpdateParamsResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgUpdateParamsResponseAminoMsg): MsgUpdateParamsResponse { + return MsgUpdateParamsResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgUpdateParamsResponse): MsgUpdateParamsResponseAminoMsg { + return { + type: "cosmos-sdk/MsgUpdateParamsResponse", + value: MsgUpdateParamsResponse.toAmino(message) + }; + }, + fromProtoMsg(message: MsgUpdateParamsResponseProtoMsg): MsgUpdateParamsResponse { + return MsgUpdateParamsResponse.decode(message.value); + }, + toProto(message: MsgUpdateParamsResponse): Uint8Array { + return MsgUpdateParamsResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgUpdateParamsResponse): MsgUpdateParamsResponseProtoMsg { + return { + typeUrl: "/cosmos.bank.v1beta1.MsgUpdateParamsResponse", + value: MsgUpdateParamsResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgUpdateParamsResponse.typeUrl, MsgUpdateParamsResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgUpdateParamsResponse.aminoType, MsgUpdateParamsResponse.typeUrl); +function createBaseMsgSetSendEnabled(): MsgSetSendEnabled { + return { + authority: "", + sendEnabled: [], + useDefaultFor: [] + }; +} +export const MsgSetSendEnabled = { + typeUrl: "/cosmos.bank.v1beta1.MsgSetSendEnabled", + aminoType: "cosmos-sdk/MsgSetSendEnabled", + is(o: any): o is MsgSetSendEnabled { + return o && (o.$typeUrl === MsgSetSendEnabled.typeUrl || typeof o.authority === "string" && Array.isArray(o.sendEnabled) && (!o.sendEnabled.length || SendEnabled.is(o.sendEnabled[0])) && Array.isArray(o.useDefaultFor) && (!o.useDefaultFor.length || typeof o.useDefaultFor[0] === "string")); + }, + isSDK(o: any): o is MsgSetSendEnabledSDKType { + return o && (o.$typeUrl === MsgSetSendEnabled.typeUrl || typeof o.authority === "string" && Array.isArray(o.send_enabled) && (!o.send_enabled.length || SendEnabled.isSDK(o.send_enabled[0])) && Array.isArray(o.use_default_for) && (!o.use_default_for.length || typeof o.use_default_for[0] === "string")); + }, + isAmino(o: any): o is MsgSetSendEnabledAmino { + return o && (o.$typeUrl === MsgSetSendEnabled.typeUrl || typeof o.authority === "string" && Array.isArray(o.send_enabled) && (!o.send_enabled.length || SendEnabled.isAmino(o.send_enabled[0])) && Array.isArray(o.use_default_for) && (!o.use_default_for.length || typeof o.use_default_for[0] === "string")); + }, + encode(message: MsgSetSendEnabled, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.authority !== "") { + writer.uint32(10).string(message.authority); + } + for (const v of message.sendEnabled) { + SendEnabled.encode(v!, writer.uint32(18).fork()).ldelim(); + } + for (const v of message.useDefaultFor) { + writer.uint32(26).string(v!); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgSetSendEnabled { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgSetSendEnabled(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.authority = reader.string(); + break; + case 2: + message.sendEnabled.push(SendEnabled.decode(reader, reader.uint32())); + break; + case 3: + message.useDefaultFor.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): MsgSetSendEnabled { + return { + authority: isSet(object.authority) ? String(object.authority) : "", + sendEnabled: Array.isArray(object?.sendEnabled) ? object.sendEnabled.map((e: any) => SendEnabled.fromJSON(e)) : [], + useDefaultFor: Array.isArray(object?.useDefaultFor) ? object.useDefaultFor.map((e: any) => String(e)) : [] + }; + }, + toJSON(message: MsgSetSendEnabled): unknown { + const obj: any = {}; + message.authority !== undefined && (obj.authority = message.authority); + if (message.sendEnabled) { + obj.sendEnabled = message.sendEnabled.map(e => e ? SendEnabled.toJSON(e) : undefined); + } else { + obj.sendEnabled = []; + } + if (message.useDefaultFor) { + obj.useDefaultFor = message.useDefaultFor.map(e => e); + } else { + obj.useDefaultFor = []; + } + return obj; + }, + fromPartial(object: Partial): MsgSetSendEnabled { + const message = createBaseMsgSetSendEnabled(); + message.authority = object.authority ?? ""; + message.sendEnabled = object.sendEnabled?.map(e => SendEnabled.fromPartial(e)) || []; + message.useDefaultFor = object.useDefaultFor?.map(e => e) || []; + return message; + }, + fromAmino(object: MsgSetSendEnabledAmino): MsgSetSendEnabled { + const message = createBaseMsgSetSendEnabled(); + if (object.authority !== undefined && object.authority !== null) { + message.authority = object.authority; + } + message.sendEnabled = object.send_enabled?.map(e => SendEnabled.fromAmino(e)) || []; + message.useDefaultFor = object.use_default_for?.map(e => e) || []; + return message; + }, + toAmino(message: MsgSetSendEnabled): MsgSetSendEnabledAmino { + const obj: any = {}; + obj.authority = message.authority; + if (message.sendEnabled) { + obj.send_enabled = message.sendEnabled.map(e => e ? SendEnabled.toAmino(e) : undefined); + } else { + obj.send_enabled = []; + } + if (message.useDefaultFor) { + obj.use_default_for = message.useDefaultFor.map(e => e); + } else { + obj.use_default_for = []; + } + return obj; + }, + fromAminoMsg(object: MsgSetSendEnabledAminoMsg): MsgSetSendEnabled { + return MsgSetSendEnabled.fromAmino(object.value); + }, + toAminoMsg(message: MsgSetSendEnabled): MsgSetSendEnabledAminoMsg { + return { + type: "cosmos-sdk/MsgSetSendEnabled", + value: MsgSetSendEnabled.toAmino(message) + }; + }, + fromProtoMsg(message: MsgSetSendEnabledProtoMsg): MsgSetSendEnabled { + return MsgSetSendEnabled.decode(message.value); + }, + toProto(message: MsgSetSendEnabled): Uint8Array { + return MsgSetSendEnabled.encode(message).finish(); + }, + toProtoMsg(message: MsgSetSendEnabled): MsgSetSendEnabledProtoMsg { + return { + typeUrl: "/cosmos.bank.v1beta1.MsgSetSendEnabled", + value: MsgSetSendEnabled.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgSetSendEnabled.typeUrl, MsgSetSendEnabled); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgSetSendEnabled.aminoType, MsgSetSendEnabled.typeUrl); +function createBaseMsgSetSendEnabledResponse(): MsgSetSendEnabledResponse { + return {}; +} +export const MsgSetSendEnabledResponse = { + typeUrl: "/cosmos.bank.v1beta1.MsgSetSendEnabledResponse", + aminoType: "cosmos-sdk/MsgSetSendEnabledResponse", + is(o: any): o is MsgSetSendEnabledResponse { + return o && o.$typeUrl === MsgSetSendEnabledResponse.typeUrl; + }, + isSDK(o: any): o is MsgSetSendEnabledResponseSDKType { + return o && o.$typeUrl === MsgSetSendEnabledResponse.typeUrl; + }, + isAmino(o: any): o is MsgSetSendEnabledResponseAmino { + return o && o.$typeUrl === MsgSetSendEnabledResponse.typeUrl; + }, + encode(_: MsgSetSendEnabledResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgSetSendEnabledResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgSetSendEnabledResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(_: any): MsgSetSendEnabledResponse { + return {}; + }, + toJSON(_: MsgSetSendEnabledResponse): unknown { + const obj: any = {}; + return obj; + }, + fromPartial(_: Partial): MsgSetSendEnabledResponse { + const message = createBaseMsgSetSendEnabledResponse(); + return message; + }, + fromAmino(_: MsgSetSendEnabledResponseAmino): MsgSetSendEnabledResponse { + const message = createBaseMsgSetSendEnabledResponse(); + return message; + }, + toAmino(_: MsgSetSendEnabledResponse): MsgSetSendEnabledResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgSetSendEnabledResponseAminoMsg): MsgSetSendEnabledResponse { + return MsgSetSendEnabledResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgSetSendEnabledResponse): MsgSetSendEnabledResponseAminoMsg { + return { + type: "cosmos-sdk/MsgSetSendEnabledResponse", + value: MsgSetSendEnabledResponse.toAmino(message) + }; + }, + fromProtoMsg(message: MsgSetSendEnabledResponseProtoMsg): MsgSetSendEnabledResponse { + return MsgSetSendEnabledResponse.decode(message.value); + }, + toProto(message: MsgSetSendEnabledResponse): Uint8Array { + return MsgSetSendEnabledResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgSetSendEnabledResponse): MsgSetSendEnabledResponseProtoMsg { + return { + typeUrl: "/cosmos.bank.v1beta1.MsgSetSendEnabledResponse", + value: MsgSetSendEnabledResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgSetSendEnabledResponse.typeUrl, MsgSetSendEnabledResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgSetSendEnabledResponse.aminoType, MsgSetSendEnabledResponse.typeUrl); \ No newline at end of file diff --git a/packages/osmojs/src/codegen/cosmos/base/abci/v1beta1/abci.ts b/packages/osmojs/src/codegen/cosmos/base/abci/v1beta1/abci.ts index 9dd5af368..a582d7cb4 100644 --- a/packages/osmojs/src/codegen/cosmos/base/abci/v1beta1/abci.ts +++ b/packages/osmojs/src/codegen/cosmos/base/abci/v1beta1/abci.ts @@ -1,6 +1,8 @@ import { Any, AnyAmino, AnySDKType } from "../../../../google/protobuf/any"; import { Event, EventAmino, EventSDKType } from "../../../../tendermint/abci/types"; import { BinaryReader, BinaryWriter } from "../../../../binary"; +import { isSet, bytesFromBase64, base64FromBytes } from "../../../../helpers"; +import { GlobalDecoderRegistry } from "../../../../registry"; /** * TxResponse defines a structure containing relevant tx data and metadata. The * tags are stringified and the log is JSON decoded. @@ -30,7 +32,7 @@ export interface TxResponse { /** Amount of gas consumed by transaction. */ gasUsed: bigint; /** 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, @@ -40,7 +42,7 @@ export interface TxResponse { /** * Events defines all the events emitted by processing a transaction. Note, * these events include those emitted by processing all the messages and those - * emitted from the ante handler. Whereas Logs contains the events, with + * emitted from the ante. Whereas Logs contains the events, with * additional metadata, emitted only by processing the messages. * * Since: cosmos-sdk 0.42.11, 0.44.5, 0.45 @@ -57,28 +59,28 @@ export interface TxResponseProtoMsg { */ export interface TxResponseAmino { /** The block height */ - height: string; + height?: string; /** 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. */ - raw_log: string; + raw_log?: string; /** The output of the application's logger (typed). May be non-deterministic. */ - logs: ABCIMessageLogAmino[]; + logs?: ABCIMessageLogAmino[]; /** Additional information. May be non-deterministic. */ - info: string; + info?: string; /** Amount of gas requested for transaction. */ - gas_wanted: string; + gas_wanted?: string; /** Amount of gas consumed by transaction. */ - gas_used: string; + gas_used?: string; /** The request transaction bytes. */ tx?: AnyAmino; /** @@ -86,16 +88,16 @@ export interface TxResponseAmino { * 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 - * emitted from the ante handler. Whereas Logs contains the events, with + * emitted from the ante. Whereas Logs contains the events, with * additional metadata, emitted only by processing the messages. * * Since: cosmos-sdk 0.42.11, 0.44.5, 0.45 */ - events: EventAmino[]; + events?: EventAmino[]; } export interface TxResponseAminoMsg { type: "cosmos-sdk/TxResponse"; @@ -116,7 +118,7 @@ export interface TxResponseSDKType { info: string; gas_wanted: bigint; gas_used: bigint; - tx: AnySDKType; + tx?: AnySDKType; timestamp: string; events: EventSDKType[]; } @@ -136,13 +138,13 @@ export interface ABCIMessageLogProtoMsg { } /** ABCIMessageLog defines a structure containing an indexed tx ABCI message log. */ export interface ABCIMessageLogAmino { - msg_index: number; - log: string; + msg_index?: number; + log?: string; /** * Events contains a slice of Event objects that were emitted during some * execution. */ - events: StringEventAmino[]; + events?: StringEventAmino[]; } export interface ABCIMessageLogAminoMsg { type: "cosmos-sdk/ABCIMessageLog"; @@ -171,8 +173,8 @@ export interface StringEventProtoMsg { * contain key/value pairs that are strings instead of raw bytes. */ export interface StringEventAmino { - type: string; - attributes: AttributeAmino[]; + type?: string; + attributes?: AttributeAmino[]; } export interface StringEventAminoMsg { type: "cosmos-sdk/StringEvent"; @@ -203,8 +205,8 @@ export interface AttributeProtoMsg { * strings instead of raw bytes. */ export interface AttributeAmino { - key: string; - value: string; + key?: string; + value?: string; } export interface AttributeAminoMsg { type: "cosmos-sdk/Attribute"; @@ -232,9 +234,9 @@ export interface GasInfoProtoMsg { /** GasInfo defines tx execution gas context. */ export interface GasInfoAmino { /** GasWanted is the maximum units of work we allow this tx to perform. */ - gas_wanted: string; + gas_wanted?: string; /** GasUsed is the amount of gas actually consumed. */ - gas_used: string; + gas_used?: string; } export interface GasInfoAminoMsg { type: "cosmos-sdk/GasInfo"; @@ -250,7 +252,10 @@ 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. + * Deprecated. This field is still populated, but prefer msg_response instead + * because it also contains the Msg response typeURL. */ + /** @deprecated */ data: Uint8Array; /** Log contains the log information from message or handler execution. */ log: string; @@ -259,6 +264,12 @@ export interface Result { * or handler execution. */ events: Event[]; + /** + * msg_responses contains the Msg handler responses type packed in Anys. + * + * Since: cosmos-sdk 0.46 + */ + msgResponses: Any[]; } export interface ResultProtoMsg { typeUrl: "/cosmos.base.abci.v1beta1.Result"; @@ -269,15 +280,24 @@ export interface ResultAmino { /** * Data is any data returned from message or handler execution. It MUST be * length prefixed in order to separate data from multiple message executions. + * Deprecated. This field is still populated, but prefer msg_response instead + * because it also contains the Msg response typeURL. */ - data: Uint8Array; + /** @deprecated */ + data?: string; /** 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: EventAmino[]; + events?: EventAmino[]; + /** + * msg_responses contains the Msg handler responses type packed in Anys. + * + * Since: cosmos-sdk 0.46 + */ + msg_responses?: AnyAmino[]; } export interface ResultAminoMsg { type: "cosmos-sdk/Result"; @@ -285,9 +305,11 @@ export interface ResultAminoMsg { } /** Result is the union of ResponseFormat and ResponseCheckTx. */ export interface ResultSDKType { + /** @deprecated */ data: Uint8Array; log: string; events: EventSDKType[]; + msg_responses: AnySDKType[]; } /** * SimulationResponse defines the response generated when a transaction is @@ -295,7 +317,7 @@ export interface ResultSDKType { */ export interface SimulationResponse { gasInfo: GasInfo; - result: Result; + result?: Result; } export interface SimulationResponseProtoMsg { typeUrl: "/cosmos.base.abci.v1beta1.SimulationResponse"; @@ -319,12 +341,13 @@ export interface SimulationResponseAminoMsg { */ export interface SimulationResponseSDKType { gas_info: GasInfoSDKType; - result: ResultSDKType; + result?: ResultSDKType; } /** * MsgData defines the data returned in a Result object during message * execution. */ +/** @deprecated */ export interface MsgData { msgType: string; data: Uint8Array; @@ -337,9 +360,10 @@ export interface MsgDataProtoMsg { * MsgData defines the data returned in a Result object during message * execution. */ +/** @deprecated */ export interface MsgDataAmino { - msg_type: string; - data: Uint8Array; + msg_type?: string; + data?: string; } export interface MsgDataAminoMsg { type: "cosmos-sdk/MsgData"; @@ -349,6 +373,7 @@ export interface MsgDataAminoMsg { * MsgData defines the data returned in a Result object during message * execution. */ +/** @deprecated */ export interface MsgDataSDKType { msg_type: string; data: Uint8Array; @@ -358,7 +383,15 @@ export interface MsgDataSDKType { * for each message. */ export interface TxMsgData { + /** data field is deprecated and not populated. */ + /** @deprecated */ data: MsgData[]; + /** + * msg_responses contains the Msg handler responses packed into Anys. + * + * Since: cosmos-sdk 0.46 + */ + msgResponses: Any[]; } export interface TxMsgDataProtoMsg { typeUrl: "/cosmos.base.abci.v1beta1.TxMsgData"; @@ -369,7 +402,15 @@ export interface TxMsgDataProtoMsg { * for each message. */ export interface TxMsgDataAmino { - data: MsgDataAmino[]; + /** data field is deprecated and not populated. */ + /** @deprecated */ + data?: MsgDataAmino[]; + /** + * msg_responses contains the Msg handler responses packed into Anys. + * + * Since: cosmos-sdk 0.46 + */ + msg_responses?: AnyAmino[]; } export interface TxMsgDataAminoMsg { type: "cosmos-sdk/TxMsgData"; @@ -380,7 +421,9 @@ export interface TxMsgDataAminoMsg { * for each message. */ export interface TxMsgDataSDKType { + /** @deprecated */ data: MsgDataSDKType[]; + msg_responses: AnySDKType[]; } /** SearchTxsResult defines a structure for querying txs pageable */ export interface SearchTxsResult { @@ -404,17 +447,17 @@ export interface SearchTxsResultProtoMsg { /** SearchTxsResult defines a structure for querying txs pageable */ export interface SearchTxsResultAmino { /** Count of all txs */ - total_count: string; + total_count?: string; /** Count of txs in current page */ - count: string; + count?: string; /** Index of current page, start from 1 */ - page_number: string; + page_number?: string; /** Count of total pages */ - page_total: string; + page_total?: string; /** Max count txs per page */ - limit: string; + limit?: string; /** List of txs in current page */ - txs: TxResponseAmino[]; + txs?: TxResponseAmino[]; } export interface SearchTxsResultAminoMsg { type: "cosmos-sdk/SearchTxsResult"; @@ -448,6 +491,16 @@ function createBaseTxResponse(): TxResponse { } export const TxResponse = { typeUrl: "/cosmos.base.abci.v1beta1.TxResponse", + aminoType: "cosmos-sdk/TxResponse", + is(o: any): o is TxResponse { + return o && (o.$typeUrl === TxResponse.typeUrl || typeof o.height === "bigint" && typeof o.txhash === "string" && typeof o.codespace === "string" && typeof o.code === "number" && typeof o.data === "string" && typeof o.rawLog === "string" && Array.isArray(o.logs) && (!o.logs.length || ABCIMessageLog.is(o.logs[0])) && typeof o.info === "string" && typeof o.gasWanted === "bigint" && typeof o.gasUsed === "bigint" && typeof o.timestamp === "string" && Array.isArray(o.events) && (!o.events.length || Event.is(o.events[0]))); + }, + isSDK(o: any): o is TxResponseSDKType { + return o && (o.$typeUrl === TxResponse.typeUrl || typeof o.height === "bigint" && typeof o.txhash === "string" && typeof o.codespace === "string" && typeof o.code === "number" && typeof o.data === "string" && typeof o.raw_log === "string" && Array.isArray(o.logs) && (!o.logs.length || ABCIMessageLog.isSDK(o.logs[0])) && typeof o.info === "string" && typeof o.gas_wanted === "bigint" && typeof o.gas_used === "bigint" && typeof o.timestamp === "string" && Array.isArray(o.events) && (!o.events.length || Event.isSDK(o.events[0]))); + }, + isAmino(o: any): o is TxResponseAmino { + return o && (o.$typeUrl === TxResponse.typeUrl || typeof o.height === "bigint" && typeof o.txhash === "string" && typeof o.codespace === "string" && typeof o.code === "number" && typeof o.data === "string" && typeof o.raw_log === "string" && Array.isArray(o.logs) && (!o.logs.length || ABCIMessageLog.isAmino(o.logs[0])) && typeof o.info === "string" && typeof o.gas_wanted === "bigint" && typeof o.gas_used === "bigint" && typeof o.timestamp === "string" && Array.isArray(o.events) && (!o.events.length || Event.isAmino(o.events[0]))); + }, encode(message: TxResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.height !== BigInt(0)) { writer.uint32(8).int64(message.height); @@ -543,6 +596,48 @@ export const TxResponse = { } return message; }, + fromJSON(object: any): TxResponse { + return { + height: isSet(object.height) ? BigInt(object.height.toString()) : BigInt(0), + txhash: isSet(object.txhash) ? String(object.txhash) : "", + codespace: isSet(object.codespace) ? String(object.codespace) : "", + 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)) : [], + info: isSet(object.info) ? String(object.info) : "", + gasWanted: isSet(object.gasWanted) ? BigInt(object.gasWanted.toString()) : BigInt(0), + gasUsed: isSet(object.gasUsed) ? BigInt(object.gasUsed.toString()) : BigInt(0), + 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)) : [] + }; + }, + toJSON(message: TxResponse): unknown { + const obj: any = {}; + message.height !== undefined && (obj.height = (message.height || BigInt(0)).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); + } else { + obj.logs = []; + } + message.info !== undefined && (obj.info = message.info); + message.gasWanted !== undefined && (obj.gasWanted = (message.gasWanted || BigInt(0)).toString()); + message.gasUsed !== undefined && (obj.gasUsed = (message.gasUsed || BigInt(0)).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); + } else { + obj.events = []; + } + return obj; + }, fromPartial(object: Partial): TxResponse { const message = createBaseTxResponse(); message.height = object.height !== undefined && object.height !== null ? BigInt(object.height.toString()) : BigInt(0); @@ -561,21 +656,43 @@ export const TxResponse = { return message; }, fromAmino(object: TxResponseAmino): TxResponse { - return { - height: BigInt(object.height), - txhash: object.txhash, - codespace: object.codespace, - code: object.code, - data: object.data, - rawLog: object.raw_log, - logs: Array.isArray(object?.logs) ? object.logs.map((e: any) => ABCIMessageLog.fromAmino(e)) : [], - info: object.info, - gasWanted: BigInt(object.gas_wanted), - gasUsed: BigInt(object.gas_used), - tx: object?.tx ? Any.fromAmino(object.tx) : undefined, - timestamp: object.timestamp, - events: Array.isArray(object?.events) ? object.events.map((e: any) => Event.fromAmino(e)) : [] - }; + const message = createBaseTxResponse(); + if (object.height !== undefined && object.height !== null) { + message.height = BigInt(object.height); + } + if (object.txhash !== undefined && object.txhash !== null) { + message.txhash = object.txhash; + } + if (object.codespace !== undefined && object.codespace !== null) { + message.codespace = object.codespace; + } + if (object.code !== undefined && object.code !== null) { + message.code = object.code; + } + if (object.data !== undefined && object.data !== null) { + message.data = object.data; + } + if (object.raw_log !== undefined && object.raw_log !== null) { + message.rawLog = object.raw_log; + } + message.logs = object.logs?.map(e => ABCIMessageLog.fromAmino(e)) || []; + if (object.info !== undefined && object.info !== null) { + message.info = object.info; + } + if (object.gas_wanted !== undefined && object.gas_wanted !== null) { + message.gasWanted = BigInt(object.gas_wanted); + } + if (object.gas_used !== undefined && object.gas_used !== null) { + message.gasUsed = BigInt(object.gas_used); + } + if (object.tx !== undefined && object.tx !== null) { + message.tx = Any.fromAmino(object.tx); + } + if (object.timestamp !== undefined && object.timestamp !== null) { + message.timestamp = object.timestamp; + } + message.events = object.events?.map(e => Event.fromAmino(e)) || []; + return message; }, toAmino(message: TxResponse): TxResponseAmino { const obj: any = {}; @@ -624,6 +741,8 @@ export const TxResponse = { }; } }; +GlobalDecoderRegistry.register(TxResponse.typeUrl, TxResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(TxResponse.aminoType, TxResponse.typeUrl); function createBaseABCIMessageLog(): ABCIMessageLog { return { msgIndex: 0, @@ -633,6 +752,16 @@ function createBaseABCIMessageLog(): ABCIMessageLog { } export const ABCIMessageLog = { typeUrl: "/cosmos.base.abci.v1beta1.ABCIMessageLog", + aminoType: "cosmos-sdk/ABCIMessageLog", + is(o: any): o is ABCIMessageLog { + return o && (o.$typeUrl === ABCIMessageLog.typeUrl || typeof o.msgIndex === "number" && typeof o.log === "string" && Array.isArray(o.events) && (!o.events.length || StringEvent.is(o.events[0]))); + }, + isSDK(o: any): o is ABCIMessageLogSDKType { + return o && (o.$typeUrl === ABCIMessageLog.typeUrl || typeof o.msg_index === "number" && typeof o.log === "string" && Array.isArray(o.events) && (!o.events.length || StringEvent.isSDK(o.events[0]))); + }, + isAmino(o: any): o is ABCIMessageLogAmino { + return o && (o.$typeUrl === ABCIMessageLog.typeUrl || typeof o.msg_index === "number" && typeof o.log === "string" && Array.isArray(o.events) && (!o.events.length || StringEvent.isAmino(o.events[0]))); + }, encode(message: ABCIMessageLog, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.msgIndex !== 0) { writer.uint32(8).uint32(message.msgIndex); @@ -668,6 +797,24 @@ export const ABCIMessageLog = { } 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)) : [] + }; + }, + toJSON(message: ABCIMessageLog): unknown { + 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); + } else { + obj.events = []; + } + return obj; + }, fromPartial(object: Partial): ABCIMessageLog { const message = createBaseABCIMessageLog(); message.msgIndex = object.msgIndex ?? 0; @@ -676,11 +823,15 @@ export const ABCIMessageLog = { return message; }, fromAmino(object: ABCIMessageLogAmino): ABCIMessageLog { - return { - msgIndex: object.msg_index, - log: object.log, - events: Array.isArray(object?.events) ? object.events.map((e: any) => StringEvent.fromAmino(e)) : [] - }; + const message = createBaseABCIMessageLog(); + if (object.msg_index !== undefined && object.msg_index !== null) { + message.msgIndex = object.msg_index; + } + if (object.log !== undefined && object.log !== null) { + message.log = object.log; + } + message.events = object.events?.map(e => StringEvent.fromAmino(e)) || []; + return message; }, toAmino(message: ABCIMessageLog): ABCIMessageLogAmino { const obj: any = {}; @@ -715,6 +866,8 @@ export const ABCIMessageLog = { }; } }; +GlobalDecoderRegistry.register(ABCIMessageLog.typeUrl, ABCIMessageLog); +GlobalDecoderRegistry.registerAminoProtoMapping(ABCIMessageLog.aminoType, ABCIMessageLog.typeUrl); function createBaseStringEvent(): StringEvent { return { type: "", @@ -723,6 +876,16 @@ function createBaseStringEvent(): StringEvent { } export const StringEvent = { typeUrl: "/cosmos.base.abci.v1beta1.StringEvent", + aminoType: "cosmos-sdk/StringEvent", + is(o: any): o is StringEvent { + return o && (o.$typeUrl === StringEvent.typeUrl || typeof o.type === "string" && Array.isArray(o.attributes) && (!o.attributes.length || Attribute.is(o.attributes[0]))); + }, + isSDK(o: any): o is StringEventSDKType { + return o && (o.$typeUrl === StringEvent.typeUrl || typeof o.type === "string" && Array.isArray(o.attributes) && (!o.attributes.length || Attribute.isSDK(o.attributes[0]))); + }, + isAmino(o: any): o is StringEventAmino { + return o && (o.$typeUrl === StringEvent.typeUrl || typeof o.type === "string" && Array.isArray(o.attributes) && (!o.attributes.length || Attribute.isAmino(o.attributes[0]))); + }, encode(message: StringEvent, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.type !== "") { writer.uint32(10).string(message.type); @@ -752,6 +915,22 @@ export const StringEvent = { } 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)) : [] + }; + }, + toJSON(message: StringEvent): unknown { + const obj: any = {}; + message.type !== undefined && (obj.type = message.type); + if (message.attributes) { + obj.attributes = message.attributes.map(e => e ? Attribute.toJSON(e) : undefined); + } else { + obj.attributes = []; + } + return obj; + }, fromPartial(object: Partial): StringEvent { const message = createBaseStringEvent(); message.type = object.type ?? ""; @@ -759,10 +938,12 @@ export const StringEvent = { return message; }, fromAmino(object: StringEventAmino): StringEvent { - return { - type: object.type, - attributes: Array.isArray(object?.attributes) ? object.attributes.map((e: any) => Attribute.fromAmino(e)) : [] - }; + const message = createBaseStringEvent(); + if (object.type !== undefined && object.type !== null) { + message.type = object.type; + } + message.attributes = object.attributes?.map(e => Attribute.fromAmino(e)) || []; + return message; }, toAmino(message: StringEvent): StringEventAmino { const obj: any = {}; @@ -796,6 +977,8 @@ export const StringEvent = { }; } }; +GlobalDecoderRegistry.register(StringEvent.typeUrl, StringEvent); +GlobalDecoderRegistry.registerAminoProtoMapping(StringEvent.aminoType, StringEvent.typeUrl); function createBaseAttribute(): Attribute { return { key: "", @@ -804,6 +987,16 @@ function createBaseAttribute(): Attribute { } export const Attribute = { typeUrl: "/cosmos.base.abci.v1beta1.Attribute", + aminoType: "cosmos-sdk/Attribute", + is(o: any): o is Attribute { + return o && (o.$typeUrl === Attribute.typeUrl || typeof o.key === "string" && typeof o.value === "string"); + }, + isSDK(o: any): o is AttributeSDKType { + return o && (o.$typeUrl === Attribute.typeUrl || typeof o.key === "string" && typeof o.value === "string"); + }, + isAmino(o: any): o is AttributeAmino { + return o && (o.$typeUrl === Attribute.typeUrl || typeof o.key === "string" && typeof o.value === "string"); + }, encode(message: Attribute, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.key !== "") { writer.uint32(10).string(message.key); @@ -833,6 +1026,18 @@ export const Attribute = { } return message; }, + fromJSON(object: any): Attribute { + 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; + }, fromPartial(object: Partial): Attribute { const message = createBaseAttribute(); message.key = object.key ?? ""; @@ -840,10 +1045,14 @@ export const Attribute = { return message; }, fromAmino(object: AttributeAmino): Attribute { - return { - key: object.key, - value: object.value - }; + const message = createBaseAttribute(); + if (object.key !== undefined && object.key !== null) { + message.key = object.key; + } + if (object.value !== undefined && object.value !== null) { + message.value = object.value; + } + return message; }, toAmino(message: Attribute): AttributeAmino { const obj: any = {}; @@ -873,6 +1082,8 @@ export const Attribute = { }; } }; +GlobalDecoderRegistry.register(Attribute.typeUrl, Attribute); +GlobalDecoderRegistry.registerAminoProtoMapping(Attribute.aminoType, Attribute.typeUrl); function createBaseGasInfo(): GasInfo { return { gasWanted: BigInt(0), @@ -881,6 +1092,16 @@ function createBaseGasInfo(): GasInfo { } export const GasInfo = { typeUrl: "/cosmos.base.abci.v1beta1.GasInfo", + aminoType: "cosmos-sdk/GasInfo", + is(o: any): o is GasInfo { + return o && (o.$typeUrl === GasInfo.typeUrl || typeof o.gasWanted === "bigint" && typeof o.gasUsed === "bigint"); + }, + isSDK(o: any): o is GasInfoSDKType { + return o && (o.$typeUrl === GasInfo.typeUrl || typeof o.gas_wanted === "bigint" && typeof o.gas_used === "bigint"); + }, + isAmino(o: any): o is GasInfoAmino { + return o && (o.$typeUrl === GasInfo.typeUrl || typeof o.gas_wanted === "bigint" && typeof o.gas_used === "bigint"); + }, encode(message: GasInfo, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.gasWanted !== BigInt(0)) { writer.uint32(8).uint64(message.gasWanted); @@ -910,6 +1131,18 @@ export const GasInfo = { } return message; }, + fromJSON(object: any): GasInfo { + return { + gasWanted: isSet(object.gasWanted) ? BigInt(object.gasWanted.toString()) : BigInt(0), + gasUsed: isSet(object.gasUsed) ? BigInt(object.gasUsed.toString()) : BigInt(0) + }; + }, + toJSON(message: GasInfo): unknown { + const obj: any = {}; + message.gasWanted !== undefined && (obj.gasWanted = (message.gasWanted || BigInt(0)).toString()); + message.gasUsed !== undefined && (obj.gasUsed = (message.gasUsed || BigInt(0)).toString()); + return obj; + }, fromPartial(object: Partial): GasInfo { const message = createBaseGasInfo(); message.gasWanted = object.gasWanted !== undefined && object.gasWanted !== null ? BigInt(object.gasWanted.toString()) : BigInt(0); @@ -917,10 +1150,14 @@ export const GasInfo = { return message; }, fromAmino(object: GasInfoAmino): GasInfo { - return { - gasWanted: BigInt(object.gas_wanted), - gasUsed: BigInt(object.gas_used) - }; + const message = createBaseGasInfo(); + if (object.gas_wanted !== undefined && object.gas_wanted !== null) { + message.gasWanted = BigInt(object.gas_wanted); + } + if (object.gas_used !== undefined && object.gas_used !== null) { + message.gasUsed = BigInt(object.gas_used); + } + return message; }, toAmino(message: GasInfo): GasInfoAmino { const obj: any = {}; @@ -950,15 +1187,28 @@ export const GasInfo = { }; } }; +GlobalDecoderRegistry.register(GasInfo.typeUrl, GasInfo); +GlobalDecoderRegistry.registerAminoProtoMapping(GasInfo.aminoType, GasInfo.typeUrl); function createBaseResult(): Result { return { data: new Uint8Array(), log: "", - events: [] + events: [], + msgResponses: [] }; } export const Result = { typeUrl: "/cosmos.base.abci.v1beta1.Result", + aminoType: "cosmos-sdk/Result", + is(o: any): o is Result { + return o && (o.$typeUrl === Result.typeUrl || (o.data instanceof Uint8Array || typeof o.data === "string") && typeof o.log === "string" && Array.isArray(o.events) && (!o.events.length || Event.is(o.events[0])) && Array.isArray(o.msgResponses) && (!o.msgResponses.length || Any.is(o.msgResponses[0]))); + }, + isSDK(o: any): o is ResultSDKType { + return o && (o.$typeUrl === Result.typeUrl || (o.data instanceof Uint8Array || typeof o.data === "string") && typeof o.log === "string" && Array.isArray(o.events) && (!o.events.length || Event.isSDK(o.events[0])) && Array.isArray(o.msg_responses) && (!o.msg_responses.length || Any.isSDK(o.msg_responses[0]))); + }, + isAmino(o: any): o is ResultAmino { + return o && (o.$typeUrl === Result.typeUrl || (o.data instanceof Uint8Array || typeof o.data === "string") && typeof o.log === "string" && Array.isArray(o.events) && (!o.events.length || Event.isAmino(o.events[0])) && Array.isArray(o.msg_responses) && (!o.msg_responses.length || Any.isAmino(o.msg_responses[0]))); + }, encode(message: Result, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.data.length !== 0) { writer.uint32(10).bytes(message.data); @@ -969,6 +1219,9 @@ export const Result = { for (const v of message.events) { Event.encode(v!, writer.uint32(26).fork()).ldelim(); } + for (const v of message.msgResponses) { + Any.encode(v!, writer.uint32(34).fork()).ldelim(); + } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): Result { @@ -987,6 +1240,9 @@ export const Result = { case 3: message.events.push(Event.decode(reader, reader.uint32())); break; + case 4: + message.msgResponses.push(Any.decode(reader, reader.uint32())); + break; default: reader.skipType(tag & 7); break; @@ -994,29 +1250,64 @@ export const Result = { } 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)) : [], + msgResponses: Array.isArray(object?.msgResponses) ? object.msgResponses.map((e: any) => Any.fromJSON(e)) : [] + }; + }, + toJSON(message: Result): unknown { + const obj: any = {}; + message.data !== undefined && (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); + } else { + obj.events = []; + } + if (message.msgResponses) { + obj.msgResponses = message.msgResponses.map(e => e ? Any.toJSON(e) : undefined); + } else { + obj.msgResponses = []; + } + return obj; + }, fromPartial(object: Partial): Result { const message = createBaseResult(); message.data = object.data ?? new Uint8Array(); message.log = object.log ?? ""; message.events = object.events?.map(e => Event.fromPartial(e)) || []; + message.msgResponses = object.msgResponses?.map(e => Any.fromPartial(e)) || []; return message; }, fromAmino(object: ResultAmino): Result { - return { - data: object.data, - log: object.log, - events: Array.isArray(object?.events) ? object.events.map((e: any) => Event.fromAmino(e)) : [] - }; + const message = createBaseResult(); + if (object.data !== undefined && object.data !== null) { + message.data = bytesFromBase64(object.data); + } + if (object.log !== undefined && object.log !== null) { + message.log = object.log; + } + message.events = object.events?.map(e => Event.fromAmino(e)) || []; + message.msgResponses = object.msg_responses?.map(e => Any.fromAmino(e)) || []; + return message; }, toAmino(message: Result): ResultAmino { const obj: any = {}; - obj.data = message.data; + obj.data = message.data ? base64FromBytes(message.data) : undefined; obj.log = message.log; if (message.events) { obj.events = message.events.map(e => e ? Event.toAmino(e) : undefined); } else { obj.events = []; } + if (message.msgResponses) { + obj.msg_responses = message.msgResponses.map(e => e ? Any.toAmino(e) : undefined); + } else { + obj.msg_responses = []; + } return obj; }, fromAminoMsg(object: ResultAminoMsg): Result { @@ -1041,14 +1332,26 @@ export const Result = { }; } }; +GlobalDecoderRegistry.register(Result.typeUrl, Result); +GlobalDecoderRegistry.registerAminoProtoMapping(Result.aminoType, Result.typeUrl); function createBaseSimulationResponse(): SimulationResponse { return { gasInfo: GasInfo.fromPartial({}), - result: Result.fromPartial({}) + result: undefined }; } export const SimulationResponse = { typeUrl: "/cosmos.base.abci.v1beta1.SimulationResponse", + aminoType: "cosmos-sdk/SimulationResponse", + is(o: any): o is SimulationResponse { + return o && (o.$typeUrl === SimulationResponse.typeUrl || GasInfo.is(o.gasInfo)); + }, + isSDK(o: any): o is SimulationResponseSDKType { + return o && (o.$typeUrl === SimulationResponse.typeUrl || GasInfo.isSDK(o.gas_info)); + }, + isAmino(o: any): o is SimulationResponseAmino { + return o && (o.$typeUrl === SimulationResponse.typeUrl || GasInfo.isAmino(o.gas_info)); + }, encode(message: SimulationResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.gasInfo !== undefined) { GasInfo.encode(message.gasInfo, writer.uint32(10).fork()).ldelim(); @@ -1078,6 +1381,18 @@ export const SimulationResponse = { } 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; + }, fromPartial(object: Partial): SimulationResponse { const message = createBaseSimulationResponse(); message.gasInfo = object.gasInfo !== undefined && object.gasInfo !== null ? GasInfo.fromPartial(object.gasInfo) : undefined; @@ -1085,10 +1400,14 @@ export const SimulationResponse = { return message; }, fromAmino(object: SimulationResponseAmino): SimulationResponse { - return { - gasInfo: object?.gas_info ? GasInfo.fromAmino(object.gas_info) : undefined, - result: object?.result ? Result.fromAmino(object.result) : undefined - }; + const message = createBaseSimulationResponse(); + if (object.gas_info !== undefined && object.gas_info !== null) { + message.gasInfo = GasInfo.fromAmino(object.gas_info); + } + if (object.result !== undefined && object.result !== null) { + message.result = Result.fromAmino(object.result); + } + return message; }, toAmino(message: SimulationResponse): SimulationResponseAmino { const obj: any = {}; @@ -1118,6 +1437,8 @@ export const SimulationResponse = { }; } }; +GlobalDecoderRegistry.register(SimulationResponse.typeUrl, SimulationResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(SimulationResponse.aminoType, SimulationResponse.typeUrl); function createBaseMsgData(): MsgData { return { msgType: "", @@ -1126,6 +1447,16 @@ function createBaseMsgData(): MsgData { } export const MsgData = { typeUrl: "/cosmos.base.abci.v1beta1.MsgData", + aminoType: "cosmos-sdk/MsgData", + is(o: any): o is MsgData { + return o && (o.$typeUrl === MsgData.typeUrl || typeof o.msgType === "string" && (o.data instanceof Uint8Array || typeof o.data === "string")); + }, + isSDK(o: any): o is MsgDataSDKType { + return o && (o.$typeUrl === MsgData.typeUrl || typeof o.msg_type === "string" && (o.data instanceof Uint8Array || typeof o.data === "string")); + }, + isAmino(o: any): o is MsgDataAmino { + return o && (o.$typeUrl === MsgData.typeUrl || typeof o.msg_type === "string" && (o.data instanceof Uint8Array || typeof o.data === "string")); + }, encode(message: MsgData, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.msgType !== "") { writer.uint32(10).string(message.msgType); @@ -1155,6 +1486,18 @@ export const MsgData = { } 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); + message.data !== undefined && (obj.data = base64FromBytes(message.data !== undefined ? message.data : new Uint8Array())); + return obj; + }, fromPartial(object: Partial): MsgData { const message = createBaseMsgData(); message.msgType = object.msgType ?? ""; @@ -1162,15 +1505,19 @@ export const MsgData = { return message; }, fromAmino(object: MsgDataAmino): MsgData { - return { - msgType: object.msg_type, - data: object.data - }; + const message = createBaseMsgData(); + if (object.msg_type !== undefined && object.msg_type !== null) { + message.msgType = object.msg_type; + } + if (object.data !== undefined && object.data !== null) { + message.data = bytesFromBase64(object.data); + } + return message; }, toAmino(message: MsgData): MsgDataAmino { const obj: any = {}; obj.msg_type = message.msgType; - obj.data = message.data; + obj.data = message.data ? base64FromBytes(message.data) : undefined; return obj; }, fromAminoMsg(object: MsgDataAminoMsg): MsgData { @@ -1195,17 +1542,33 @@ export const MsgData = { }; } }; +GlobalDecoderRegistry.register(MsgData.typeUrl, MsgData); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgData.aminoType, MsgData.typeUrl); function createBaseTxMsgData(): TxMsgData { return { - data: [] + data: [], + msgResponses: [] }; } export const TxMsgData = { typeUrl: "/cosmos.base.abci.v1beta1.TxMsgData", + aminoType: "cosmos-sdk/TxMsgData", + is(o: any): o is TxMsgData { + return o && (o.$typeUrl === TxMsgData.typeUrl || Array.isArray(o.data) && (!o.data.length || MsgData.is(o.data[0])) && Array.isArray(o.msgResponses) && (!o.msgResponses.length || Any.is(o.msgResponses[0]))); + }, + isSDK(o: any): o is TxMsgDataSDKType { + return o && (o.$typeUrl === TxMsgData.typeUrl || Array.isArray(o.data) && (!o.data.length || MsgData.isSDK(o.data[0])) && Array.isArray(o.msg_responses) && (!o.msg_responses.length || Any.isSDK(o.msg_responses[0]))); + }, + isAmino(o: any): o is TxMsgDataAmino { + return o && (o.$typeUrl === TxMsgData.typeUrl || Array.isArray(o.data) && (!o.data.length || MsgData.isAmino(o.data[0])) && Array.isArray(o.msg_responses) && (!o.msg_responses.length || Any.isAmino(o.msg_responses[0]))); + }, encode(message: TxMsgData, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.data) { MsgData.encode(v!, writer.uint32(10).fork()).ldelim(); } + for (const v of message.msgResponses) { + Any.encode(v!, writer.uint32(18).fork()).ldelim(); + } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): TxMsgData { @@ -1218,6 +1581,9 @@ export const TxMsgData = { case 1: message.data.push(MsgData.decode(reader, reader.uint32())); break; + case 2: + message.msgResponses.push(Any.decode(reader, reader.uint32())); + break; default: reader.skipType(tag & 7); break; @@ -1225,15 +1591,37 @@ export const TxMsgData = { } return message; }, + fromJSON(object: any): TxMsgData { + return { + data: Array.isArray(object?.data) ? object.data.map((e: any) => MsgData.fromJSON(e)) : [], + msgResponses: Array.isArray(object?.msgResponses) ? object.msgResponses.map((e: any) => Any.fromJSON(e)) : [] + }; + }, + toJSON(message: TxMsgData): unknown { + const obj: any = {}; + if (message.data) { + obj.data = message.data.map(e => e ? MsgData.toJSON(e) : undefined); + } else { + obj.data = []; + } + if (message.msgResponses) { + obj.msgResponses = message.msgResponses.map(e => e ? Any.toJSON(e) : undefined); + } else { + obj.msgResponses = []; + } + return obj; + }, fromPartial(object: Partial): TxMsgData { const message = createBaseTxMsgData(); message.data = object.data?.map(e => MsgData.fromPartial(e)) || []; + message.msgResponses = object.msgResponses?.map(e => Any.fromPartial(e)) || []; return message; }, fromAmino(object: TxMsgDataAmino): TxMsgData { - return { - data: Array.isArray(object?.data) ? object.data.map((e: any) => MsgData.fromAmino(e)) : [] - }; + const message = createBaseTxMsgData(); + message.data = object.data?.map(e => MsgData.fromAmino(e)) || []; + message.msgResponses = object.msg_responses?.map(e => Any.fromAmino(e)) || []; + return message; }, toAmino(message: TxMsgData): TxMsgDataAmino { const obj: any = {}; @@ -1242,6 +1630,11 @@ export const TxMsgData = { } else { obj.data = []; } + if (message.msgResponses) { + obj.msg_responses = message.msgResponses.map(e => e ? Any.toAmino(e) : undefined); + } else { + obj.msg_responses = []; + } return obj; }, fromAminoMsg(object: TxMsgDataAminoMsg): TxMsgData { @@ -1266,6 +1659,8 @@ export const TxMsgData = { }; } }; +GlobalDecoderRegistry.register(TxMsgData.typeUrl, TxMsgData); +GlobalDecoderRegistry.registerAminoProtoMapping(TxMsgData.aminoType, TxMsgData.typeUrl); function createBaseSearchTxsResult(): SearchTxsResult { return { totalCount: BigInt(0), @@ -1278,6 +1673,16 @@ function createBaseSearchTxsResult(): SearchTxsResult { } export const SearchTxsResult = { typeUrl: "/cosmos.base.abci.v1beta1.SearchTxsResult", + aminoType: "cosmos-sdk/SearchTxsResult", + is(o: any): o is SearchTxsResult { + return o && (o.$typeUrl === SearchTxsResult.typeUrl || typeof o.totalCount === "bigint" && typeof o.count === "bigint" && typeof o.pageNumber === "bigint" && typeof o.pageTotal === "bigint" && typeof o.limit === "bigint" && Array.isArray(o.txs) && (!o.txs.length || TxResponse.is(o.txs[0]))); + }, + isSDK(o: any): o is SearchTxsResultSDKType { + return o && (o.$typeUrl === SearchTxsResult.typeUrl || typeof o.total_count === "bigint" && typeof o.count === "bigint" && typeof o.page_number === "bigint" && typeof o.page_total === "bigint" && typeof o.limit === "bigint" && Array.isArray(o.txs) && (!o.txs.length || TxResponse.isSDK(o.txs[0]))); + }, + isAmino(o: any): o is SearchTxsResultAmino { + return o && (o.$typeUrl === SearchTxsResult.typeUrl || typeof o.total_count === "bigint" && typeof o.count === "bigint" && typeof o.page_number === "bigint" && typeof o.page_total === "bigint" && typeof o.limit === "bigint" && Array.isArray(o.txs) && (!o.txs.length || TxResponse.isAmino(o.txs[0]))); + }, encode(message: SearchTxsResult, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.totalCount !== BigInt(0)) { writer.uint32(8).uint64(message.totalCount); @@ -1331,6 +1736,30 @@ export const SearchTxsResult = { } return message; }, + fromJSON(object: any): SearchTxsResult { + return { + totalCount: isSet(object.totalCount) ? BigInt(object.totalCount.toString()) : BigInt(0), + count: isSet(object.count) ? BigInt(object.count.toString()) : BigInt(0), + pageNumber: isSet(object.pageNumber) ? BigInt(object.pageNumber.toString()) : BigInt(0), + pageTotal: isSet(object.pageTotal) ? BigInt(object.pageTotal.toString()) : BigInt(0), + limit: isSet(object.limit) ? BigInt(object.limit.toString()) : BigInt(0), + 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 || BigInt(0)).toString()); + message.count !== undefined && (obj.count = (message.count || BigInt(0)).toString()); + message.pageNumber !== undefined && (obj.pageNumber = (message.pageNumber || BigInt(0)).toString()); + message.pageTotal !== undefined && (obj.pageTotal = (message.pageTotal || BigInt(0)).toString()); + message.limit !== undefined && (obj.limit = (message.limit || BigInt(0)).toString()); + if (message.txs) { + obj.txs = message.txs.map(e => e ? TxResponse.toJSON(e) : undefined); + } else { + obj.txs = []; + } + return obj; + }, fromPartial(object: Partial): SearchTxsResult { const message = createBaseSearchTxsResult(); message.totalCount = object.totalCount !== undefined && object.totalCount !== null ? BigInt(object.totalCount.toString()) : BigInt(0); @@ -1342,14 +1771,24 @@ export const SearchTxsResult = { return message; }, fromAmino(object: SearchTxsResultAmino): SearchTxsResult { - return { - totalCount: BigInt(object.total_count), - count: BigInt(object.count), - pageNumber: BigInt(object.page_number), - pageTotal: BigInt(object.page_total), - limit: BigInt(object.limit), - txs: Array.isArray(object?.txs) ? object.txs.map((e: any) => TxResponse.fromAmino(e)) : [] - }; + const message = createBaseSearchTxsResult(); + if (object.total_count !== undefined && object.total_count !== null) { + message.totalCount = BigInt(object.total_count); + } + if (object.count !== undefined && object.count !== null) { + message.count = BigInt(object.count); + } + if (object.page_number !== undefined && object.page_number !== null) { + message.pageNumber = BigInt(object.page_number); + } + if (object.page_total !== undefined && object.page_total !== null) { + message.pageTotal = BigInt(object.page_total); + } + if (object.limit !== undefined && object.limit !== null) { + message.limit = BigInt(object.limit); + } + message.txs = object.txs?.map(e => TxResponse.fromAmino(e)) || []; + return message; }, toAmino(message: SearchTxsResult): SearchTxsResultAmino { const obj: any = {}; @@ -1386,4 +1825,6 @@ export const SearchTxsResult = { value: SearchTxsResult.encode(message).finish() }; } -}; \ No newline at end of file +}; +GlobalDecoderRegistry.register(SearchTxsResult.typeUrl, SearchTxsResult); +GlobalDecoderRegistry.registerAminoProtoMapping(SearchTxsResult.aminoType, SearchTxsResult.typeUrl); \ No newline at end of file diff --git a/packages/osmojs/src/codegen/cosmos/base/node/v1beta1/query.ts b/packages/osmojs/src/codegen/cosmos/base/node/v1beta1/query.ts index c2c12f623..d1cc02678 100644 --- a/packages/osmojs/src/codegen/cosmos/base/node/v1beta1/query.ts +++ b/packages/osmojs/src/codegen/cosmos/base/node/v1beta1/query.ts @@ -1,4 +1,6 @@ import { BinaryReader, BinaryWriter } from "../../../../binary"; +import { GlobalDecoderRegistry } from "../../../../registry"; +import { isSet } from "../../../../helpers"; /** ConfigRequest defines the request structure for the Config gRPC query. */ export interface ConfigRequest {} export interface ConfigRequestProtoMsg { @@ -23,7 +25,7 @@ export interface ConfigResponseProtoMsg { } /** ConfigResponse defines the response structure for the Config gRPC query. */ export interface ConfigResponseAmino { - minimum_gas_price: string; + minimum_gas_price?: string; } export interface ConfigResponseAminoMsg { type: "cosmos-sdk/ConfigResponse"; @@ -38,6 +40,16 @@ function createBaseConfigRequest(): ConfigRequest { } export const ConfigRequest = { typeUrl: "/cosmos.base.node.v1beta1.ConfigRequest", + aminoType: "cosmos-sdk/ConfigRequest", + is(o: any): o is ConfigRequest { + return o && o.$typeUrl === ConfigRequest.typeUrl; + }, + isSDK(o: any): o is ConfigRequestSDKType { + return o && o.$typeUrl === ConfigRequest.typeUrl; + }, + isAmino(o: any): o is ConfigRequestAmino { + return o && o.$typeUrl === ConfigRequest.typeUrl; + }, encode(_: ConfigRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, @@ -55,12 +67,20 @@ export const ConfigRequest = { } return message; }, + fromJSON(_: any): ConfigRequest { + return {}; + }, + toJSON(_: ConfigRequest): unknown { + const obj: any = {}; + return obj; + }, fromPartial(_: Partial): ConfigRequest { const message = createBaseConfigRequest(); return message; }, fromAmino(_: ConfigRequestAmino): ConfigRequest { - return {}; + const message = createBaseConfigRequest(); + return message; }, toAmino(_: ConfigRequest): ConfigRequestAmino { const obj: any = {}; @@ -88,6 +108,8 @@ export const ConfigRequest = { }; } }; +GlobalDecoderRegistry.register(ConfigRequest.typeUrl, ConfigRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(ConfigRequest.aminoType, ConfigRequest.typeUrl); function createBaseConfigResponse(): ConfigResponse { return { minimumGasPrice: "" @@ -95,6 +117,16 @@ function createBaseConfigResponse(): ConfigResponse { } export const ConfigResponse = { typeUrl: "/cosmos.base.node.v1beta1.ConfigResponse", + aminoType: "cosmos-sdk/ConfigResponse", + is(o: any): o is ConfigResponse { + return o && (o.$typeUrl === ConfigResponse.typeUrl || typeof o.minimumGasPrice === "string"); + }, + isSDK(o: any): o is ConfigResponseSDKType { + return o && (o.$typeUrl === ConfigResponse.typeUrl || typeof o.minimum_gas_price === "string"); + }, + isAmino(o: any): o is ConfigResponseAmino { + return o && (o.$typeUrl === ConfigResponse.typeUrl || typeof o.minimum_gas_price === "string"); + }, encode(message: ConfigResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.minimumGasPrice !== "") { writer.uint32(10).string(message.minimumGasPrice); @@ -118,15 +150,27 @@ export const ConfigResponse = { } return message; }, + fromJSON(object: any): ConfigResponse { + return { + minimumGasPrice: isSet(object.minimumGasPrice) ? String(object.minimumGasPrice) : "" + }; + }, + toJSON(message: ConfigResponse): unknown { + const obj: any = {}; + message.minimumGasPrice !== undefined && (obj.minimumGasPrice = message.minimumGasPrice); + return obj; + }, fromPartial(object: Partial): ConfigResponse { const message = createBaseConfigResponse(); message.minimumGasPrice = object.minimumGasPrice ?? ""; return message; }, fromAmino(object: ConfigResponseAmino): ConfigResponse { - return { - minimumGasPrice: object.minimum_gas_price - }; + const message = createBaseConfigResponse(); + if (object.minimum_gas_price !== undefined && object.minimum_gas_price !== null) { + message.minimumGasPrice = object.minimum_gas_price; + } + return message; }, toAmino(message: ConfigResponse): ConfigResponseAmino { const obj: any = {}; @@ -154,4 +198,6 @@ export const ConfigResponse = { value: ConfigResponse.encode(message).finish() }; } -}; \ No newline at end of file +}; +GlobalDecoderRegistry.register(ConfigResponse.typeUrl, ConfigResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(ConfigResponse.aminoType, ConfigResponse.typeUrl); \ No newline at end of file diff --git a/packages/osmojs/src/codegen/cosmos/base/query/v1beta1/pagination.ts b/packages/osmojs/src/codegen/cosmos/base/query/v1beta1/pagination.ts index e3f81da30..559482c8d 100644 --- a/packages/osmojs/src/codegen/cosmos/base/query/v1beta1/pagination.ts +++ b/packages/osmojs/src/codegen/cosmos/base/query/v1beta1/pagination.ts @@ -1,4 +1,6 @@ import { BinaryReader, BinaryWriter } from "../../../../binary"; +import { isSet, bytesFromBase64, base64FromBytes } from "../../../../helpers"; +import { GlobalDecoderRegistry } from "../../../../registry"; /** * PageRequest is to be embedded in gRPC request messages for efficient * pagination. Ex: @@ -59,31 +61,31 @@ export interface PageRequestAmino { * querying the next page most efficiently. Only one of offset or key * should be set. */ - key: Uint8Array; + key?: string; /** * 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: string; + offset?: string; /** * 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: string; + limit?: string; /** * 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. */ - count_total: boolean; + count_total?: 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; } export interface PageRequestAminoMsg { type: "cosmos-sdk/PageRequest"; @@ -117,7 +119,8 @@ export interface PageRequestSDKType { export interface PageResponse { /** * next_key is the key to be passed to PageRequest.key to - * query the next page most efficiently + * query the next page most efficiently. It will be empty if + * there are no more results. */ nextKey: Uint8Array; /** @@ -142,14 +145,15 @@ export interface PageResponseProtoMsg { export interface PageResponseAmino { /** * next_key is the key to be passed to PageRequest.key to - * query the next page most efficiently + * query the next page most efficiently. It will be empty if + * there are no more results. */ - next_key: Uint8Array; + next_key?: string; /** * total is total number of results available if PageRequest.count_total * was set, its value is undefined otherwise */ - total: string; + total?: string; } export interface PageResponseAminoMsg { type: "cosmos-sdk/PageResponse"; @@ -179,6 +183,16 @@ function createBasePageRequest(): PageRequest { } export const PageRequest = { typeUrl: "/cosmos.base.query.v1beta1.PageRequest", + aminoType: "cosmos-sdk/PageRequest", + is(o: any): o is PageRequest { + return o && (o.$typeUrl === PageRequest.typeUrl || (o.key instanceof Uint8Array || typeof o.key === "string") && typeof o.offset === "bigint" && typeof o.limit === "bigint" && typeof o.countTotal === "boolean" && typeof o.reverse === "boolean"); + }, + isSDK(o: any): o is PageRequestSDKType { + return o && (o.$typeUrl === PageRequest.typeUrl || (o.key instanceof Uint8Array || typeof o.key === "string") && typeof o.offset === "bigint" && typeof o.limit === "bigint" && typeof o.count_total === "boolean" && typeof o.reverse === "boolean"); + }, + isAmino(o: any): o is PageRequestAmino { + return o && (o.$typeUrl === PageRequest.typeUrl || (o.key instanceof Uint8Array || typeof o.key === "string") && typeof o.offset === "bigint" && typeof o.limit === "bigint" && typeof o.count_total === "boolean" && typeof o.reverse === "boolean"); + }, encode(message: PageRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.key.length !== 0) { writer.uint32(10).bytes(message.key); @@ -226,6 +240,24 @@ export const PageRequest = { } return message; }, + fromJSON(object: any): PageRequest { + return { + key: isSet(object.key) ? bytesFromBase64(object.key) : new Uint8Array(), + offset: isSet(object.offset) ? BigInt(object.offset.toString()) : BigInt(0), + limit: isSet(object.limit) ? BigInt(object.limit.toString()) : BigInt(0), + countTotal: isSet(object.countTotal) ? Boolean(object.countTotal) : false, + reverse: isSet(object.reverse) ? Boolean(object.reverse) : false + }; + }, + toJSON(message: PageRequest): unknown { + const obj: any = {}; + message.key !== undefined && (obj.key = base64FromBytes(message.key !== undefined ? message.key : new Uint8Array())); + message.offset !== undefined && (obj.offset = (message.offset || BigInt(0)).toString()); + message.limit !== undefined && (obj.limit = (message.limit || BigInt(0)).toString()); + message.countTotal !== undefined && (obj.countTotal = message.countTotal); + message.reverse !== undefined && (obj.reverse = message.reverse); + return obj; + }, fromPartial(object: Partial): PageRequest { const message = createBasePageRequest(); message.key = object.key ?? new Uint8Array(); @@ -236,17 +268,27 @@ export const PageRequest = { return message; }, fromAmino(object: PageRequestAmino): PageRequest { - return { - key: object.key, - offset: BigInt(object.offset), - limit: BigInt(object.limit), - countTotal: object.count_total, - reverse: object.reverse - }; + const message = createBasePageRequest(); + if (object.key !== undefined && object.key !== null) { + message.key = bytesFromBase64(object.key); + } + if (object.offset !== undefined && object.offset !== null) { + message.offset = BigInt(object.offset); + } + if (object.limit !== undefined && object.limit !== null) { + message.limit = BigInt(object.limit); + } + if (object.count_total !== undefined && object.count_total !== null) { + message.countTotal = object.count_total; + } + if (object.reverse !== undefined && object.reverse !== null) { + message.reverse = object.reverse; + } + return message; }, toAmino(message: PageRequest): PageRequestAmino { const obj: any = {}; - obj.key = message.key; + obj.key = message.key ? base64FromBytes(message.key) : undefined; obj.offset = message.offset ? message.offset.toString() : undefined; obj.limit = message.limit ? message.limit.toString() : undefined; obj.count_total = message.countTotal; @@ -275,6 +317,8 @@ export const PageRequest = { }; } }; +GlobalDecoderRegistry.register(PageRequest.typeUrl, PageRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(PageRequest.aminoType, PageRequest.typeUrl); function createBasePageResponse(): PageResponse { return { nextKey: new Uint8Array(), @@ -283,6 +327,16 @@ function createBasePageResponse(): PageResponse { } export const PageResponse = { typeUrl: "/cosmos.base.query.v1beta1.PageResponse", + aminoType: "cosmos-sdk/PageResponse", + is(o: any): o is PageResponse { + return o && (o.$typeUrl === PageResponse.typeUrl || (o.nextKey instanceof Uint8Array || typeof o.nextKey === "string") && typeof o.total === "bigint"); + }, + isSDK(o: any): o is PageResponseSDKType { + return o && (o.$typeUrl === PageResponse.typeUrl || (o.next_key instanceof Uint8Array || typeof o.next_key === "string") && typeof o.total === "bigint"); + }, + isAmino(o: any): o is PageResponseAmino { + return o && (o.$typeUrl === PageResponse.typeUrl || (o.next_key instanceof Uint8Array || typeof o.next_key === "string") && typeof o.total === "bigint"); + }, encode(message: PageResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.nextKey.length !== 0) { writer.uint32(10).bytes(message.nextKey); @@ -312,6 +366,18 @@ export const PageResponse = { } return message; }, + fromJSON(object: any): PageResponse { + return { + nextKey: isSet(object.nextKey) ? bytesFromBase64(object.nextKey) : new Uint8Array(), + total: isSet(object.total) ? BigInt(object.total.toString()) : BigInt(0) + }; + }, + toJSON(message: PageResponse): unknown { + const obj: any = {}; + message.nextKey !== undefined && (obj.nextKey = base64FromBytes(message.nextKey !== undefined ? message.nextKey : new Uint8Array())); + message.total !== undefined && (obj.total = (message.total || BigInt(0)).toString()); + return obj; + }, fromPartial(object: Partial): PageResponse { const message = createBasePageResponse(); message.nextKey = object.nextKey ?? new Uint8Array(); @@ -319,14 +385,18 @@ export const PageResponse = { return message; }, fromAmino(object: PageResponseAmino): PageResponse { - return { - nextKey: object.next_key, - total: BigInt(object.total) - }; + const message = createBasePageResponse(); + if (object.next_key !== undefined && object.next_key !== null) { + message.nextKey = bytesFromBase64(object.next_key); + } + if (object.total !== undefined && object.total !== null) { + message.total = BigInt(object.total); + } + return message; }, toAmino(message: PageResponse): PageResponseAmino { const obj: any = {}; - obj.next_key = message.nextKey; + obj.next_key = message.nextKey ? base64FromBytes(message.nextKey) : undefined; obj.total = message.total ? message.total.toString() : undefined; return obj; }, @@ -351,4 +421,6 @@ export const PageResponse = { value: PageResponse.encode(message).finish() }; } -}; \ No newline at end of file +}; +GlobalDecoderRegistry.register(PageResponse.typeUrl, PageResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(PageResponse.aminoType, PageResponse.typeUrl); \ No newline at end of file diff --git a/packages/osmojs/src/codegen/cosmos/base/reflection/v2alpha1/reflection.ts b/packages/osmojs/src/codegen/cosmos/base/reflection/v2alpha1/reflection.ts index e53daa0de..05734eb4d 100644 --- a/packages/osmojs/src/codegen/cosmos/base/reflection/v2alpha1/reflection.ts +++ b/packages/osmojs/src/codegen/cosmos/base/reflection/v2alpha1/reflection.ts @@ -1,21 +1,23 @@ import { BinaryReader, BinaryWriter } from "../../../../binary"; +import { isSet } from "../../../../helpers"; +import { GlobalDecoderRegistry } from "../../../../registry"; /** AppDescriptor describes a cosmos-sdk based application */ 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; } export interface AppDescriptorProtoMsg { typeUrl: "/cosmos.base.reflection.v2alpha1.AppDescriptor"; @@ -45,12 +47,12 @@ export interface AppDescriptorAminoMsg { } /** AppDescriptor describes a cosmos-sdk based application */ export interface AppDescriptorSDKType { - authn: AuthnDescriptorSDKType; - chain: ChainDescriptorSDKType; - codec: CodecDescriptorSDKType; - configuration: ConfigurationDescriptorSDKType; - query_services: QueryServicesDescriptorSDKType; - tx: TxDescriptorSDKType; + authn?: AuthnDescriptorSDKType; + chain?: ChainDescriptorSDKType; + codec?: CodecDescriptorSDKType; + configuration?: ConfigurationDescriptorSDKType; + query_services?: QueryServicesDescriptorSDKType; + tx?: TxDescriptorSDKType; } /** TxDescriptor describes the accepted transaction type */ export interface TxDescriptor { @@ -74,9 +76,9 @@ export interface TxDescriptorAmino { * 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: MsgDescriptorAmino[]; + msgs?: MsgDescriptorAmino[]; } export interface TxDescriptorAminoMsg { type: "cosmos-sdk/TxDescriptor"; @@ -105,7 +107,7 @@ export interface AuthnDescriptorProtoMsg { */ export interface AuthnDescriptorAmino { /** sign_modes defines the supported signature algorithm */ - sign_modes: SigningModeDescriptorAmino[]; + sign_modes?: SigningModeDescriptorAmino[]; } export interface AuthnDescriptorAminoMsg { type: "cosmos-sdk/AuthnDescriptor"; @@ -147,14 +149,14 @@ export interface SigningModeDescriptorProtoMsg { */ export interface SigningModeDescriptorAmino { /** 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 */ - authn_info_provider_method_fullname: string; + authn_info_provider_method_fullname?: string; } export interface SigningModeDescriptorAminoMsg { type: "cosmos-sdk/SigningModeDescriptor"; @@ -183,7 +185,7 @@ export interface ChainDescriptorProtoMsg { /** ChainDescriptor describes chain information of the application */ export interface ChainDescriptorAmino { /** id is the chain id */ - id: string; + id?: string; } export interface ChainDescriptorAminoMsg { type: "cosmos-sdk/ChainDescriptor"; @@ -205,7 +207,7 @@ export interface CodecDescriptorProtoMsg { /** CodecDescriptor describes the registered interfaces and provides metadata information on the types */ export interface CodecDescriptorAmino { /** interfaces is a list of the registerted interfaces descriptors */ - interfaces: InterfaceDescriptorAmino[]; + interfaces?: InterfaceDescriptorAmino[]; } export interface CodecDescriptorAminoMsg { type: "cosmos-sdk/CodecDescriptor"; @@ -234,14 +236,14 @@ export interface InterfaceDescriptorProtoMsg { /** InterfaceDescriptor describes the implementation of an interface */ export interface InterfaceDescriptorAmino { /** 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 */ - interface_accepting_messages: InterfaceAcceptingMessageDescriptorAmino[]; + interface_accepting_messages?: InterfaceAcceptingMessageDescriptorAmino[]; /** interface_implementers is a list of the descriptors of the interface implementers */ - interface_implementers: InterfaceImplementerDescriptorAmino[]; + interface_implementers?: InterfaceImplementerDescriptorAmino[]; } export interface InterfaceDescriptorAminoMsg { type: "cosmos-sdk/InterfaceDescriptor"; @@ -272,14 +274,14 @@ export interface InterfaceImplementerDescriptorProtoMsg { /** InterfaceImplementerDescriptor describes an interface implementer */ export interface InterfaceImplementerDescriptorAmino { /** 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 */ - type_url: string; + type_url?: string; } export interface InterfaceImplementerDescriptorAminoMsg { type: "cosmos-sdk/InterfaceImplementerDescriptor"; @@ -314,13 +316,13 @@ export interface InterfaceAcceptingMessageDescriptorProtoMsg { */ export interface InterfaceAcceptingMessageDescriptorAmino { /** 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) */ - field_descriptor_names: string[]; + field_descriptor_names?: string[]; } export interface InterfaceAcceptingMessageDescriptorAminoMsg { type: "cosmos-sdk/InterfaceAcceptingMessageDescriptor"; @@ -346,7 +348,7 @@ export interface ConfigurationDescriptorProtoMsg { /** ConfigurationDescriptor contains metadata information on the sdk.Config */ export interface ConfigurationDescriptorAmino { /** bech32_account_address_prefix is the account address prefix */ - bech32_account_address_prefix: string; + bech32_account_address_prefix?: string; } export interface ConfigurationDescriptorAminoMsg { type: "cosmos-sdk/ConfigurationDescriptor"; @@ -368,7 +370,7 @@ export interface MsgDescriptorProtoMsg { /** MsgDescriptor describes a cosmos-sdk message that can be delivered with a transaction */ export interface MsgDescriptorAmino { /** msg_type_url contains the TypeURL of a sdk.Msg. */ - msg_type_url: string; + msg_type_url?: string; } export interface MsgDescriptorAminoMsg { type: "cosmos-sdk/MsgDescriptor"; @@ -395,7 +397,7 @@ export interface GetAuthnDescriptorRequestSDKType {} /** 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; } export interface GetAuthnDescriptorResponseProtoMsg { typeUrl: "/cosmos.base.reflection.v2alpha1.GetAuthnDescriptorResponse"; @@ -412,7 +414,7 @@ export interface GetAuthnDescriptorResponseAminoMsg { } /** GetAuthnDescriptorResponse is the response returned by the GetAuthnDescriptor RPC */ export interface GetAuthnDescriptorResponseSDKType { - authn: AuthnDescriptorSDKType; + authn?: AuthnDescriptorSDKType; } /** GetChainDescriptorRequest is the request used for the GetChainDescriptor RPC */ export interface GetChainDescriptorRequest {} @@ -431,7 +433,7 @@ export interface GetChainDescriptorRequestSDKType {} /** GetChainDescriptorResponse is the response returned by the GetChainDescriptor RPC */ export interface GetChainDescriptorResponse { /** chain describes application chain information */ - chain: ChainDescriptor; + chain?: ChainDescriptor; } export interface GetChainDescriptorResponseProtoMsg { typeUrl: "/cosmos.base.reflection.v2alpha1.GetChainDescriptorResponse"; @@ -448,7 +450,7 @@ export interface GetChainDescriptorResponseAminoMsg { } /** GetChainDescriptorResponse is the response returned by the GetChainDescriptor RPC */ export interface GetChainDescriptorResponseSDKType { - chain: ChainDescriptorSDKType; + chain?: ChainDescriptorSDKType; } /** GetCodecDescriptorRequest is the request used for the GetCodecDescriptor RPC */ export interface GetCodecDescriptorRequest {} @@ -467,7 +469,7 @@ export interface GetCodecDescriptorRequestSDKType {} /** 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; } export interface GetCodecDescriptorResponseProtoMsg { typeUrl: "/cosmos.base.reflection.v2alpha1.GetCodecDescriptorResponse"; @@ -484,7 +486,7 @@ export interface GetCodecDescriptorResponseAminoMsg { } /** GetCodecDescriptorResponse is the response returned by the GetCodecDescriptor RPC */ export interface GetCodecDescriptorResponseSDKType { - codec: CodecDescriptorSDKType; + codec?: CodecDescriptorSDKType; } /** GetConfigurationDescriptorRequest is the request used for the GetConfigurationDescriptor RPC */ export interface GetConfigurationDescriptorRequest {} @@ -503,7 +505,7 @@ export interface GetConfigurationDescriptorRequestSDKType {} /** GetConfigurationDescriptorResponse is the response returned by the GetConfigurationDescriptor RPC */ export interface GetConfigurationDescriptorResponse { /** config describes the application's sdk.Config */ - config: ConfigurationDescriptor; + config?: ConfigurationDescriptor; } export interface GetConfigurationDescriptorResponseProtoMsg { typeUrl: "/cosmos.base.reflection.v2alpha1.GetConfigurationDescriptorResponse"; @@ -520,7 +522,7 @@ export interface GetConfigurationDescriptorResponseAminoMsg { } /** GetConfigurationDescriptorResponse is the response returned by the GetConfigurationDescriptor RPC */ export interface GetConfigurationDescriptorResponseSDKType { - config: ConfigurationDescriptorSDKType; + config?: ConfigurationDescriptorSDKType; } /** GetQueryServicesDescriptorRequest is the request used for the GetQueryServicesDescriptor RPC */ export interface GetQueryServicesDescriptorRequest {} @@ -539,7 +541,7 @@ export interface GetQueryServicesDescriptorRequestSDKType {} /** GetQueryServicesDescriptorResponse is the response returned by the GetQueryServicesDescriptor RPC */ export interface GetQueryServicesDescriptorResponse { /** queries provides information on the available queryable services */ - queries: QueryServicesDescriptor; + queries?: QueryServicesDescriptor; } export interface GetQueryServicesDescriptorResponseProtoMsg { typeUrl: "/cosmos.base.reflection.v2alpha1.GetQueryServicesDescriptorResponse"; @@ -556,7 +558,7 @@ export interface GetQueryServicesDescriptorResponseAminoMsg { } /** GetQueryServicesDescriptorResponse is the response returned by the GetQueryServicesDescriptor RPC */ export interface GetQueryServicesDescriptorResponseSDKType { - queries: QueryServicesDescriptorSDKType; + queries?: QueryServicesDescriptorSDKType; } /** GetTxDescriptorRequest is the request used for the GetTxDescriptor RPC */ export interface GetTxDescriptorRequest {} @@ -578,7 +580,7 @@ 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; } export interface GetTxDescriptorResponseProtoMsg { typeUrl: "/cosmos.base.reflection.v2alpha1.GetTxDescriptorResponse"; @@ -598,7 +600,7 @@ export interface GetTxDescriptorResponseAminoMsg { } /** GetTxDescriptorResponse is the response returned by the GetTxDescriptor RPC */ export interface GetTxDescriptorResponseSDKType { - tx: TxDescriptorSDKType; + tx?: TxDescriptorSDKType; } /** QueryServicesDescriptor contains the list of cosmos-sdk queriable services */ export interface QueryServicesDescriptor { @@ -612,7 +614,7 @@ export interface QueryServicesDescriptorProtoMsg { /** QueryServicesDescriptor contains the list of cosmos-sdk queriable services */ export interface QueryServicesDescriptorAmino { /** query_services is a list of cosmos-sdk QueryServiceDescriptor */ - query_services: QueryServiceDescriptorAmino[]; + query_services?: QueryServiceDescriptorAmino[]; } export interface QueryServicesDescriptorAminoMsg { type: "cosmos-sdk/QueryServicesDescriptor"; @@ -638,11 +640,11 @@ export interface QueryServiceDescriptorProtoMsg { /** QueryServiceDescriptor describes a cosmos-sdk queryable service */ export interface QueryServiceDescriptorAmino { /** 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 */ - is_module: boolean; + is_module?: boolean; /** methods provides a list of query service methods */ - methods: QueryMethodDescriptorAmino[]; + methods?: QueryMethodDescriptorAmino[]; } export interface QueryServiceDescriptorAminoMsg { type: "cosmos-sdk/QueryServiceDescriptor"; @@ -679,12 +681,12 @@ export interface QueryMethodDescriptorProtoMsg { */ export interface QueryMethodDescriptorAmino { /** 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 */ - full_query_path: string; + full_query_path?: string; } export interface QueryMethodDescriptorAminoMsg { type: "cosmos-sdk/QueryMethodDescriptor"; @@ -701,16 +703,26 @@ export interface QueryMethodDescriptorSDKType { } function createBaseAppDescriptor(): AppDescriptor { return { - authn: AuthnDescriptor.fromPartial({}), - chain: ChainDescriptor.fromPartial({}), - codec: CodecDescriptor.fromPartial({}), - configuration: ConfigurationDescriptor.fromPartial({}), - queryServices: QueryServicesDescriptor.fromPartial({}), - tx: TxDescriptor.fromPartial({}) + authn: undefined, + chain: undefined, + codec: undefined, + configuration: undefined, + queryServices: undefined, + tx: undefined }; } export const AppDescriptor = { typeUrl: "/cosmos.base.reflection.v2alpha1.AppDescriptor", + aminoType: "cosmos-sdk/AppDescriptor", + is(o: any): o is AppDescriptor { + return o && o.$typeUrl === AppDescriptor.typeUrl; + }, + isSDK(o: any): o is AppDescriptorSDKType { + return o && o.$typeUrl === AppDescriptor.typeUrl; + }, + isAmino(o: any): o is AppDescriptorAmino { + return o && o.$typeUrl === AppDescriptor.typeUrl; + }, encode(message: AppDescriptor, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.authn !== undefined) { AuthnDescriptor.encode(message.authn, writer.uint32(10).fork()).ldelim(); @@ -764,6 +776,26 @@ export const AppDescriptor = { } return message; }, + fromJSON(object: any): AppDescriptor { + return { + 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, + 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); + 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(object: Partial): AppDescriptor { const message = createBaseAppDescriptor(); message.authn = object.authn !== undefined && object.authn !== null ? AuthnDescriptor.fromPartial(object.authn) : undefined; @@ -775,14 +807,26 @@ export const AppDescriptor = { return message; }, fromAmino(object: AppDescriptorAmino): AppDescriptor { - return { - authn: object?.authn ? AuthnDescriptor.fromAmino(object.authn) : undefined, - chain: object?.chain ? ChainDescriptor.fromAmino(object.chain) : undefined, - codec: object?.codec ? CodecDescriptor.fromAmino(object.codec) : undefined, - configuration: object?.configuration ? ConfigurationDescriptor.fromAmino(object.configuration) : undefined, - queryServices: object?.query_services ? QueryServicesDescriptor.fromAmino(object.query_services) : undefined, - tx: object?.tx ? TxDescriptor.fromAmino(object.tx) : undefined - }; + const message = createBaseAppDescriptor(); + if (object.authn !== undefined && object.authn !== null) { + message.authn = AuthnDescriptor.fromAmino(object.authn); + } + if (object.chain !== undefined && object.chain !== null) { + message.chain = ChainDescriptor.fromAmino(object.chain); + } + if (object.codec !== undefined && object.codec !== null) { + message.codec = CodecDescriptor.fromAmino(object.codec); + } + if (object.configuration !== undefined && object.configuration !== null) { + message.configuration = ConfigurationDescriptor.fromAmino(object.configuration); + } + if (object.query_services !== undefined && object.query_services !== null) { + message.queryServices = QueryServicesDescriptor.fromAmino(object.query_services); + } + if (object.tx !== undefined && object.tx !== null) { + message.tx = TxDescriptor.fromAmino(object.tx); + } + return message; }, toAmino(message: AppDescriptor): AppDescriptorAmino { const obj: any = {}; @@ -816,6 +860,8 @@ export const AppDescriptor = { }; } }; +GlobalDecoderRegistry.register(AppDescriptor.typeUrl, AppDescriptor); +GlobalDecoderRegistry.registerAminoProtoMapping(AppDescriptor.aminoType, AppDescriptor.typeUrl); function createBaseTxDescriptor(): TxDescriptor { return { fullname: "", @@ -824,6 +870,16 @@ function createBaseTxDescriptor(): TxDescriptor { } export const TxDescriptor = { typeUrl: "/cosmos.base.reflection.v2alpha1.TxDescriptor", + aminoType: "cosmos-sdk/TxDescriptor", + is(o: any): o is TxDescriptor { + return o && (o.$typeUrl === TxDescriptor.typeUrl || typeof o.fullname === "string" && Array.isArray(o.msgs) && (!o.msgs.length || MsgDescriptor.is(o.msgs[0]))); + }, + isSDK(o: any): o is TxDescriptorSDKType { + return o && (o.$typeUrl === TxDescriptor.typeUrl || typeof o.fullname === "string" && Array.isArray(o.msgs) && (!o.msgs.length || MsgDescriptor.isSDK(o.msgs[0]))); + }, + isAmino(o: any): o is TxDescriptorAmino { + return o && (o.$typeUrl === TxDescriptor.typeUrl || typeof o.fullname === "string" && Array.isArray(o.msgs) && (!o.msgs.length || MsgDescriptor.isAmino(o.msgs[0]))); + }, encode(message: TxDescriptor, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.fullname !== "") { writer.uint32(10).string(message.fullname); @@ -853,6 +909,22 @@ export const TxDescriptor = { } 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)) : [] + }; + }, + toJSON(message: TxDescriptor): unknown { + const obj: any = {}; + message.fullname !== undefined && (obj.fullname = message.fullname); + if (message.msgs) { + obj.msgs = message.msgs.map(e => e ? MsgDescriptor.toJSON(e) : undefined); + } else { + obj.msgs = []; + } + return obj; + }, fromPartial(object: Partial): TxDescriptor { const message = createBaseTxDescriptor(); message.fullname = object.fullname ?? ""; @@ -860,10 +932,12 @@ export const TxDescriptor = { return message; }, fromAmino(object: TxDescriptorAmino): TxDescriptor { - return { - fullname: object.fullname, - msgs: Array.isArray(object?.msgs) ? object.msgs.map((e: any) => MsgDescriptor.fromAmino(e)) : [] - }; + const message = createBaseTxDescriptor(); + if (object.fullname !== undefined && object.fullname !== null) { + message.fullname = object.fullname; + } + message.msgs = object.msgs?.map(e => MsgDescriptor.fromAmino(e)) || []; + return message; }, toAmino(message: TxDescriptor): TxDescriptorAmino { const obj: any = {}; @@ -897,6 +971,8 @@ export const TxDescriptor = { }; } }; +GlobalDecoderRegistry.register(TxDescriptor.typeUrl, TxDescriptor); +GlobalDecoderRegistry.registerAminoProtoMapping(TxDescriptor.aminoType, TxDescriptor.typeUrl); function createBaseAuthnDescriptor(): AuthnDescriptor { return { signModes: [] @@ -904,6 +980,16 @@ function createBaseAuthnDescriptor(): AuthnDescriptor { } export const AuthnDescriptor = { typeUrl: "/cosmos.base.reflection.v2alpha1.AuthnDescriptor", + aminoType: "cosmos-sdk/AuthnDescriptor", + is(o: any): o is AuthnDescriptor { + return o && (o.$typeUrl === AuthnDescriptor.typeUrl || Array.isArray(o.signModes) && (!o.signModes.length || SigningModeDescriptor.is(o.signModes[0]))); + }, + isSDK(o: any): o is AuthnDescriptorSDKType { + return o && (o.$typeUrl === AuthnDescriptor.typeUrl || Array.isArray(o.sign_modes) && (!o.sign_modes.length || SigningModeDescriptor.isSDK(o.sign_modes[0]))); + }, + isAmino(o: any): o is AuthnDescriptorAmino { + return o && (o.$typeUrl === AuthnDescriptor.typeUrl || Array.isArray(o.sign_modes) && (!o.sign_modes.length || SigningModeDescriptor.isAmino(o.sign_modes[0]))); + }, encode(message: AuthnDescriptor, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.signModes) { SigningModeDescriptor.encode(v!, writer.uint32(10).fork()).ldelim(); @@ -927,15 +1013,29 @@ export const AuthnDescriptor = { } return message; }, + fromJSON(object: any): AuthnDescriptor { + return { + signModes: Array.isArray(object?.signModes) ? object.signModes.map((e: any) => SigningModeDescriptor.fromJSON(e)) : [] + }; + }, + toJSON(message: AuthnDescriptor): unknown { + const obj: any = {}; + if (message.signModes) { + obj.signModes = message.signModes.map(e => e ? SigningModeDescriptor.toJSON(e) : undefined); + } else { + obj.signModes = []; + } + return obj; + }, fromPartial(object: Partial): AuthnDescriptor { const message = createBaseAuthnDescriptor(); message.signModes = object.signModes?.map(e => SigningModeDescriptor.fromPartial(e)) || []; return message; }, fromAmino(object: AuthnDescriptorAmino): AuthnDescriptor { - return { - signModes: Array.isArray(object?.sign_modes) ? object.sign_modes.map((e: any) => SigningModeDescriptor.fromAmino(e)) : [] - }; + const message = createBaseAuthnDescriptor(); + message.signModes = object.sign_modes?.map(e => SigningModeDescriptor.fromAmino(e)) || []; + return message; }, toAmino(message: AuthnDescriptor): AuthnDescriptorAmino { const obj: any = {}; @@ -968,6 +1068,8 @@ export const AuthnDescriptor = { }; } }; +GlobalDecoderRegistry.register(AuthnDescriptor.typeUrl, AuthnDescriptor); +GlobalDecoderRegistry.registerAminoProtoMapping(AuthnDescriptor.aminoType, AuthnDescriptor.typeUrl); function createBaseSigningModeDescriptor(): SigningModeDescriptor { return { name: "", @@ -977,6 +1079,16 @@ function createBaseSigningModeDescriptor(): SigningModeDescriptor { } export const SigningModeDescriptor = { typeUrl: "/cosmos.base.reflection.v2alpha1.SigningModeDescriptor", + aminoType: "cosmos-sdk/SigningModeDescriptor", + is(o: any): o is SigningModeDescriptor { + return o && (o.$typeUrl === SigningModeDescriptor.typeUrl || typeof o.name === "string" && typeof o.number === "number" && typeof o.authnInfoProviderMethodFullname === "string"); + }, + isSDK(o: any): o is SigningModeDescriptorSDKType { + return o && (o.$typeUrl === SigningModeDescriptor.typeUrl || typeof o.name === "string" && typeof o.number === "number" && typeof o.authn_info_provider_method_fullname === "string"); + }, + isAmino(o: any): o is SigningModeDescriptorAmino { + return o && (o.$typeUrl === SigningModeDescriptor.typeUrl || typeof o.name === "string" && typeof o.number === "number" && typeof o.authn_info_provider_method_fullname === "string"); + }, encode(message: SigningModeDescriptor, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.name !== "") { writer.uint32(10).string(message.name); @@ -1012,6 +1124,20 @@ export const SigningModeDescriptor = { } return message; }, + fromJSON(object: any): SigningModeDescriptor { + return { + name: isSet(object.name) ? String(object.name) : "", + number: isSet(object.number) ? Number(object.number) : 0, + 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)); + message.authnInfoProviderMethodFullname !== undefined && (obj.authnInfoProviderMethodFullname = message.authnInfoProviderMethodFullname); + return obj; + }, fromPartial(object: Partial): SigningModeDescriptor { const message = createBaseSigningModeDescriptor(); message.name = object.name ?? ""; @@ -1020,11 +1146,17 @@ export const SigningModeDescriptor = { return message; }, fromAmino(object: SigningModeDescriptorAmino): SigningModeDescriptor { - return { - name: object.name, - number: object.number, - authnInfoProviderMethodFullname: object.authn_info_provider_method_fullname - }; + const message = createBaseSigningModeDescriptor(); + if (object.name !== undefined && object.name !== null) { + message.name = object.name; + } + if (object.number !== undefined && object.number !== null) { + message.number = object.number; + } + if (object.authn_info_provider_method_fullname !== undefined && object.authn_info_provider_method_fullname !== null) { + message.authnInfoProviderMethodFullname = object.authn_info_provider_method_fullname; + } + return message; }, toAmino(message: SigningModeDescriptor): SigningModeDescriptorAmino { const obj: any = {}; @@ -1055,6 +1187,8 @@ export const SigningModeDescriptor = { }; } }; +GlobalDecoderRegistry.register(SigningModeDescriptor.typeUrl, SigningModeDescriptor); +GlobalDecoderRegistry.registerAminoProtoMapping(SigningModeDescriptor.aminoType, SigningModeDescriptor.typeUrl); function createBaseChainDescriptor(): ChainDescriptor { return { id: "" @@ -1062,6 +1196,16 @@ function createBaseChainDescriptor(): ChainDescriptor { } export const ChainDescriptor = { typeUrl: "/cosmos.base.reflection.v2alpha1.ChainDescriptor", + aminoType: "cosmos-sdk/ChainDescriptor", + is(o: any): o is ChainDescriptor { + return o && (o.$typeUrl === ChainDescriptor.typeUrl || typeof o.id === "string"); + }, + isSDK(o: any): o is ChainDescriptorSDKType { + return o && (o.$typeUrl === ChainDescriptor.typeUrl || typeof o.id === "string"); + }, + isAmino(o: any): o is ChainDescriptorAmino { + return o && (o.$typeUrl === ChainDescriptor.typeUrl || typeof o.id === "string"); + }, encode(message: ChainDescriptor, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.id !== "") { writer.uint32(10).string(message.id); @@ -1085,15 +1229,27 @@ export const ChainDescriptor = { } return message; }, + fromJSON(object: any): ChainDescriptor { + return { + id: isSet(object.id) ? String(object.id) : "" + }; + }, + toJSON(message: ChainDescriptor): unknown { + const obj: any = {}; + message.id !== undefined && (obj.id = message.id); + return obj; + }, fromPartial(object: Partial): ChainDescriptor { const message = createBaseChainDescriptor(); message.id = object.id ?? ""; return message; }, fromAmino(object: ChainDescriptorAmino): ChainDescriptor { - return { - id: object.id - }; + const message = createBaseChainDescriptor(); + if (object.id !== undefined && object.id !== null) { + message.id = object.id; + } + return message; }, toAmino(message: ChainDescriptor): ChainDescriptorAmino { const obj: any = {}; @@ -1122,6 +1278,8 @@ export const ChainDescriptor = { }; } }; +GlobalDecoderRegistry.register(ChainDescriptor.typeUrl, ChainDescriptor); +GlobalDecoderRegistry.registerAminoProtoMapping(ChainDescriptor.aminoType, ChainDescriptor.typeUrl); function createBaseCodecDescriptor(): CodecDescriptor { return { interfaces: [] @@ -1129,6 +1287,16 @@ function createBaseCodecDescriptor(): CodecDescriptor { } export const CodecDescriptor = { typeUrl: "/cosmos.base.reflection.v2alpha1.CodecDescriptor", + aminoType: "cosmos-sdk/CodecDescriptor", + is(o: any): o is CodecDescriptor { + return o && (o.$typeUrl === CodecDescriptor.typeUrl || Array.isArray(o.interfaces) && (!o.interfaces.length || InterfaceDescriptor.is(o.interfaces[0]))); + }, + isSDK(o: any): o is CodecDescriptorSDKType { + return o && (o.$typeUrl === CodecDescriptor.typeUrl || Array.isArray(o.interfaces) && (!o.interfaces.length || InterfaceDescriptor.isSDK(o.interfaces[0]))); + }, + isAmino(o: any): o is CodecDescriptorAmino { + return o && (o.$typeUrl === CodecDescriptor.typeUrl || Array.isArray(o.interfaces) && (!o.interfaces.length || InterfaceDescriptor.isAmino(o.interfaces[0]))); + }, encode(message: CodecDescriptor, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.interfaces) { InterfaceDescriptor.encode(v!, writer.uint32(10).fork()).ldelim(); @@ -1152,15 +1320,29 @@ export const CodecDescriptor = { } return message; }, + fromJSON(object: any): CodecDescriptor { + return { + interfaces: Array.isArray(object?.interfaces) ? object.interfaces.map((e: any) => InterfaceDescriptor.fromJSON(e)) : [] + }; + }, + toJSON(message: CodecDescriptor): unknown { + const obj: any = {}; + if (message.interfaces) { + obj.interfaces = message.interfaces.map(e => e ? InterfaceDescriptor.toJSON(e) : undefined); + } else { + obj.interfaces = []; + } + return obj; + }, fromPartial(object: Partial): CodecDescriptor { const message = createBaseCodecDescriptor(); message.interfaces = object.interfaces?.map(e => InterfaceDescriptor.fromPartial(e)) || []; return message; }, fromAmino(object: CodecDescriptorAmino): CodecDescriptor { - return { - interfaces: Array.isArray(object?.interfaces) ? object.interfaces.map((e: any) => InterfaceDescriptor.fromAmino(e)) : [] - }; + const message = createBaseCodecDescriptor(); + message.interfaces = object.interfaces?.map(e => InterfaceDescriptor.fromAmino(e)) || []; + return message; }, toAmino(message: CodecDescriptor): CodecDescriptorAmino { const obj: any = {}; @@ -1193,6 +1375,8 @@ export const CodecDescriptor = { }; } }; +GlobalDecoderRegistry.register(CodecDescriptor.typeUrl, CodecDescriptor); +GlobalDecoderRegistry.registerAminoProtoMapping(CodecDescriptor.aminoType, CodecDescriptor.typeUrl); function createBaseInterfaceDescriptor(): InterfaceDescriptor { return { fullname: "", @@ -1202,6 +1386,16 @@ function createBaseInterfaceDescriptor(): InterfaceDescriptor { } export const InterfaceDescriptor = { typeUrl: "/cosmos.base.reflection.v2alpha1.InterfaceDescriptor", + aminoType: "cosmos-sdk/InterfaceDescriptor", + is(o: any): o is InterfaceDescriptor { + return o && (o.$typeUrl === InterfaceDescriptor.typeUrl || typeof o.fullname === "string" && Array.isArray(o.interfaceAcceptingMessages) && (!o.interfaceAcceptingMessages.length || InterfaceAcceptingMessageDescriptor.is(o.interfaceAcceptingMessages[0])) && Array.isArray(o.interfaceImplementers) && (!o.interfaceImplementers.length || InterfaceImplementerDescriptor.is(o.interfaceImplementers[0]))); + }, + isSDK(o: any): o is InterfaceDescriptorSDKType { + return o && (o.$typeUrl === InterfaceDescriptor.typeUrl || typeof o.fullname === "string" && Array.isArray(o.interface_accepting_messages) && (!o.interface_accepting_messages.length || InterfaceAcceptingMessageDescriptor.isSDK(o.interface_accepting_messages[0])) && Array.isArray(o.interface_implementers) && (!o.interface_implementers.length || InterfaceImplementerDescriptor.isSDK(o.interface_implementers[0]))); + }, + isAmino(o: any): o is InterfaceDescriptorAmino { + return o && (o.$typeUrl === InterfaceDescriptor.typeUrl || typeof o.fullname === "string" && Array.isArray(o.interface_accepting_messages) && (!o.interface_accepting_messages.length || InterfaceAcceptingMessageDescriptor.isAmino(o.interface_accepting_messages[0])) && Array.isArray(o.interface_implementers) && (!o.interface_implementers.length || InterfaceImplementerDescriptor.isAmino(o.interface_implementers[0]))); + }, encode(message: InterfaceDescriptor, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.fullname !== "") { writer.uint32(10).string(message.fullname); @@ -1237,6 +1431,28 @@ export const InterfaceDescriptor = { } 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)) : [], + interfaceImplementers: Array.isArray(object?.interfaceImplementers) ? object.interfaceImplementers.map((e: any) => InterfaceImplementerDescriptor.fromJSON(e)) : [] + }; + }, + toJSON(message: InterfaceDescriptor): unknown { + const obj: any = {}; + message.fullname !== undefined && (obj.fullname = message.fullname); + if (message.interfaceAcceptingMessages) { + obj.interfaceAcceptingMessages = message.interfaceAcceptingMessages.map(e => e ? InterfaceAcceptingMessageDescriptor.toJSON(e) : undefined); + } else { + obj.interfaceAcceptingMessages = []; + } + if (message.interfaceImplementers) { + obj.interfaceImplementers = message.interfaceImplementers.map(e => e ? InterfaceImplementerDescriptor.toJSON(e) : undefined); + } else { + obj.interfaceImplementers = []; + } + return obj; + }, fromPartial(object: Partial): InterfaceDescriptor { const message = createBaseInterfaceDescriptor(); message.fullname = object.fullname ?? ""; @@ -1245,11 +1461,13 @@ export const InterfaceDescriptor = { return message; }, fromAmino(object: InterfaceDescriptorAmino): InterfaceDescriptor { - return { - fullname: object.fullname, - interfaceAcceptingMessages: Array.isArray(object?.interface_accepting_messages) ? object.interface_accepting_messages.map((e: any) => InterfaceAcceptingMessageDescriptor.fromAmino(e)) : [], - interfaceImplementers: Array.isArray(object?.interface_implementers) ? object.interface_implementers.map((e: any) => InterfaceImplementerDescriptor.fromAmino(e)) : [] - }; + const message = createBaseInterfaceDescriptor(); + if (object.fullname !== undefined && object.fullname !== null) { + message.fullname = object.fullname; + } + message.interfaceAcceptingMessages = object.interface_accepting_messages?.map(e => InterfaceAcceptingMessageDescriptor.fromAmino(e)) || []; + message.interfaceImplementers = object.interface_implementers?.map(e => InterfaceImplementerDescriptor.fromAmino(e)) || []; + return message; }, toAmino(message: InterfaceDescriptor): InterfaceDescriptorAmino { const obj: any = {}; @@ -1288,6 +1506,8 @@ export const InterfaceDescriptor = { }; } }; +GlobalDecoderRegistry.register(InterfaceDescriptor.typeUrl, InterfaceDescriptor); +GlobalDecoderRegistry.registerAminoProtoMapping(InterfaceDescriptor.aminoType, InterfaceDescriptor.typeUrl); function createBaseInterfaceImplementerDescriptor(): InterfaceImplementerDescriptor { return { fullname: "", @@ -1296,6 +1516,16 @@ function createBaseInterfaceImplementerDescriptor(): InterfaceImplementerDescrip } export const InterfaceImplementerDescriptor = { typeUrl: "/cosmos.base.reflection.v2alpha1.InterfaceImplementerDescriptor", + aminoType: "cosmos-sdk/InterfaceImplementerDescriptor", + is(o: any): o is InterfaceImplementerDescriptor { + return o && (o.$typeUrl === InterfaceImplementerDescriptor.typeUrl || typeof o.fullname === "string" && typeof o.typeUrl === "string"); + }, + isSDK(o: any): o is InterfaceImplementerDescriptorSDKType { + return o && (o.$typeUrl === InterfaceImplementerDescriptor.typeUrl || typeof o.fullname === "string" && typeof o.type_url === "string"); + }, + isAmino(o: any): o is InterfaceImplementerDescriptorAmino { + return o && (o.$typeUrl === InterfaceImplementerDescriptor.typeUrl || typeof o.fullname === "string" && typeof o.type_url === "string"); + }, encode(message: InterfaceImplementerDescriptor, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.fullname !== "") { writer.uint32(10).string(message.fullname); @@ -1325,6 +1555,18 @@ export const InterfaceImplementerDescriptor = { } 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; + }, fromPartial(object: Partial): InterfaceImplementerDescriptor { const message = createBaseInterfaceImplementerDescriptor(); message.fullname = object.fullname ?? ""; @@ -1332,10 +1574,14 @@ export const InterfaceImplementerDescriptor = { return message; }, fromAmino(object: InterfaceImplementerDescriptorAmino): InterfaceImplementerDescriptor { - return { - fullname: object.fullname, - typeUrl: object.type_url - }; + const message = createBaseInterfaceImplementerDescriptor(); + if (object.fullname !== undefined && object.fullname !== null) { + message.fullname = object.fullname; + } + if (object.type_url !== undefined && object.type_url !== null) { + message.typeUrl = object.type_url; + } + return message; }, toAmino(message: InterfaceImplementerDescriptor): InterfaceImplementerDescriptorAmino { const obj: any = {}; @@ -1365,6 +1611,8 @@ export const InterfaceImplementerDescriptor = { }; } }; +GlobalDecoderRegistry.register(InterfaceImplementerDescriptor.typeUrl, InterfaceImplementerDescriptor); +GlobalDecoderRegistry.registerAminoProtoMapping(InterfaceImplementerDescriptor.aminoType, InterfaceImplementerDescriptor.typeUrl); function createBaseInterfaceAcceptingMessageDescriptor(): InterfaceAcceptingMessageDescriptor { return { fullname: "", @@ -1373,6 +1621,16 @@ function createBaseInterfaceAcceptingMessageDescriptor(): InterfaceAcceptingMess } export const InterfaceAcceptingMessageDescriptor = { typeUrl: "/cosmos.base.reflection.v2alpha1.InterfaceAcceptingMessageDescriptor", + aminoType: "cosmos-sdk/InterfaceAcceptingMessageDescriptor", + is(o: any): o is InterfaceAcceptingMessageDescriptor { + return o && (o.$typeUrl === InterfaceAcceptingMessageDescriptor.typeUrl || typeof o.fullname === "string" && Array.isArray(o.fieldDescriptorNames) && (!o.fieldDescriptorNames.length || typeof o.fieldDescriptorNames[0] === "string")); + }, + isSDK(o: any): o is InterfaceAcceptingMessageDescriptorSDKType { + return o && (o.$typeUrl === InterfaceAcceptingMessageDescriptor.typeUrl || typeof o.fullname === "string" && Array.isArray(o.field_descriptor_names) && (!o.field_descriptor_names.length || typeof o.field_descriptor_names[0] === "string")); + }, + isAmino(o: any): o is InterfaceAcceptingMessageDescriptorAmino { + return o && (o.$typeUrl === InterfaceAcceptingMessageDescriptor.typeUrl || typeof o.fullname === "string" && Array.isArray(o.field_descriptor_names) && (!o.field_descriptor_names.length || typeof o.field_descriptor_names[0] === "string")); + }, encode(message: InterfaceAcceptingMessageDescriptor, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.fullname !== "") { writer.uint32(10).string(message.fullname); @@ -1402,6 +1660,22 @@ export const InterfaceAcceptingMessageDescriptor = { } return message; }, + fromJSON(object: any): InterfaceAcceptingMessageDescriptor { + return { + fullname: isSet(object.fullname) ? String(object.fullname) : "", + 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); + if (message.fieldDescriptorNames) { + obj.fieldDescriptorNames = message.fieldDescriptorNames.map(e => e); + } else { + obj.fieldDescriptorNames = []; + } + return obj; + }, fromPartial(object: Partial): InterfaceAcceptingMessageDescriptor { const message = createBaseInterfaceAcceptingMessageDescriptor(); message.fullname = object.fullname ?? ""; @@ -1409,10 +1683,12 @@ export const InterfaceAcceptingMessageDescriptor = { return message; }, fromAmino(object: InterfaceAcceptingMessageDescriptorAmino): InterfaceAcceptingMessageDescriptor { - return { - fullname: object.fullname, - fieldDescriptorNames: Array.isArray(object?.field_descriptor_names) ? object.field_descriptor_names.map((e: any) => e) : [] - }; + const message = createBaseInterfaceAcceptingMessageDescriptor(); + if (object.fullname !== undefined && object.fullname !== null) { + message.fullname = object.fullname; + } + message.fieldDescriptorNames = object.field_descriptor_names?.map(e => e) || []; + return message; }, toAmino(message: InterfaceAcceptingMessageDescriptor): InterfaceAcceptingMessageDescriptorAmino { const obj: any = {}; @@ -1446,6 +1722,8 @@ export const InterfaceAcceptingMessageDescriptor = { }; } }; +GlobalDecoderRegistry.register(InterfaceAcceptingMessageDescriptor.typeUrl, InterfaceAcceptingMessageDescriptor); +GlobalDecoderRegistry.registerAminoProtoMapping(InterfaceAcceptingMessageDescriptor.aminoType, InterfaceAcceptingMessageDescriptor.typeUrl); function createBaseConfigurationDescriptor(): ConfigurationDescriptor { return { bech32AccountAddressPrefix: "" @@ -1453,6 +1731,16 @@ function createBaseConfigurationDescriptor(): ConfigurationDescriptor { } export const ConfigurationDescriptor = { typeUrl: "/cosmos.base.reflection.v2alpha1.ConfigurationDescriptor", + aminoType: "cosmos-sdk/ConfigurationDescriptor", + is(o: any): o is ConfigurationDescriptor { + return o && (o.$typeUrl === ConfigurationDescriptor.typeUrl || typeof o.bech32AccountAddressPrefix === "string"); + }, + isSDK(o: any): o is ConfigurationDescriptorSDKType { + return o && (o.$typeUrl === ConfigurationDescriptor.typeUrl || typeof o.bech32_account_address_prefix === "string"); + }, + isAmino(o: any): o is ConfigurationDescriptorAmino { + return o && (o.$typeUrl === ConfigurationDescriptor.typeUrl || typeof o.bech32_account_address_prefix === "string"); + }, encode(message: ConfigurationDescriptor, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.bech32AccountAddressPrefix !== "") { writer.uint32(10).string(message.bech32AccountAddressPrefix); @@ -1476,15 +1764,27 @@ export const ConfigurationDescriptor = { } return message; }, + fromJSON(object: any): ConfigurationDescriptor { + return { + bech32AccountAddressPrefix: isSet(object.bech32AccountAddressPrefix) ? String(object.bech32AccountAddressPrefix) : "" + }; + }, + toJSON(message: ConfigurationDescriptor): unknown { + const obj: any = {}; + message.bech32AccountAddressPrefix !== undefined && (obj.bech32AccountAddressPrefix = message.bech32AccountAddressPrefix); + return obj; + }, fromPartial(object: Partial): ConfigurationDescriptor { const message = createBaseConfigurationDescriptor(); message.bech32AccountAddressPrefix = object.bech32AccountAddressPrefix ?? ""; return message; }, fromAmino(object: ConfigurationDescriptorAmino): ConfigurationDescriptor { - return { - bech32AccountAddressPrefix: object.bech32_account_address_prefix - }; + const message = createBaseConfigurationDescriptor(); + if (object.bech32_account_address_prefix !== undefined && object.bech32_account_address_prefix !== null) { + message.bech32AccountAddressPrefix = object.bech32_account_address_prefix; + } + return message; }, toAmino(message: ConfigurationDescriptor): ConfigurationDescriptorAmino { const obj: any = {}; @@ -1513,6 +1813,8 @@ export const ConfigurationDescriptor = { }; } }; +GlobalDecoderRegistry.register(ConfigurationDescriptor.typeUrl, ConfigurationDescriptor); +GlobalDecoderRegistry.registerAminoProtoMapping(ConfigurationDescriptor.aminoType, ConfigurationDescriptor.typeUrl); function createBaseMsgDescriptor(): MsgDescriptor { return { msgTypeUrl: "" @@ -1520,6 +1822,16 @@ function createBaseMsgDescriptor(): MsgDescriptor { } export const MsgDescriptor = { typeUrl: "/cosmos.base.reflection.v2alpha1.MsgDescriptor", + aminoType: "cosmos-sdk/MsgDescriptor", + is(o: any): o is MsgDescriptor { + return o && (o.$typeUrl === MsgDescriptor.typeUrl || typeof o.msgTypeUrl === "string"); + }, + isSDK(o: any): o is MsgDescriptorSDKType { + return o && (o.$typeUrl === MsgDescriptor.typeUrl || typeof o.msg_type_url === "string"); + }, + isAmino(o: any): o is MsgDescriptorAmino { + return o && (o.$typeUrl === MsgDescriptor.typeUrl || typeof o.msg_type_url === "string"); + }, encode(message: MsgDescriptor, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.msgTypeUrl !== "") { writer.uint32(10).string(message.msgTypeUrl); @@ -1543,15 +1855,27 @@ export const MsgDescriptor = { } return message; }, + fromJSON(object: any): MsgDescriptor { + return { + msgTypeUrl: isSet(object.msgTypeUrl) ? String(object.msgTypeUrl) : "" + }; + }, + toJSON(message: MsgDescriptor): unknown { + const obj: any = {}; + message.msgTypeUrl !== undefined && (obj.msgTypeUrl = message.msgTypeUrl); + return obj; + }, fromPartial(object: Partial): MsgDescriptor { const message = createBaseMsgDescriptor(); message.msgTypeUrl = object.msgTypeUrl ?? ""; return message; }, fromAmino(object: MsgDescriptorAmino): MsgDescriptor { - return { - msgTypeUrl: object.msg_type_url - }; + const message = createBaseMsgDescriptor(); + if (object.msg_type_url !== undefined && object.msg_type_url !== null) { + message.msgTypeUrl = object.msg_type_url; + } + return message; }, toAmino(message: MsgDescriptor): MsgDescriptorAmino { const obj: any = {}; @@ -1580,11 +1904,23 @@ export const MsgDescriptor = { }; } }; +GlobalDecoderRegistry.register(MsgDescriptor.typeUrl, MsgDescriptor); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgDescriptor.aminoType, MsgDescriptor.typeUrl); function createBaseGetAuthnDescriptorRequest(): GetAuthnDescriptorRequest { return {}; } export const GetAuthnDescriptorRequest = { typeUrl: "/cosmos.base.reflection.v2alpha1.GetAuthnDescriptorRequest", + aminoType: "cosmos-sdk/GetAuthnDescriptorRequest", + is(o: any): o is GetAuthnDescriptorRequest { + return o && o.$typeUrl === GetAuthnDescriptorRequest.typeUrl; + }, + isSDK(o: any): o is GetAuthnDescriptorRequestSDKType { + return o && o.$typeUrl === GetAuthnDescriptorRequest.typeUrl; + }, + isAmino(o: any): o is GetAuthnDescriptorRequestAmino { + return o && o.$typeUrl === GetAuthnDescriptorRequest.typeUrl; + }, encode(_: GetAuthnDescriptorRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, @@ -1602,12 +1938,20 @@ export const GetAuthnDescriptorRequest = { } return message; }, + fromJSON(_: any): GetAuthnDescriptorRequest { + return {}; + }, + toJSON(_: GetAuthnDescriptorRequest): unknown { + const obj: any = {}; + return obj; + }, fromPartial(_: Partial): GetAuthnDescriptorRequest { const message = createBaseGetAuthnDescriptorRequest(); return message; }, fromAmino(_: GetAuthnDescriptorRequestAmino): GetAuthnDescriptorRequest { - return {}; + const message = createBaseGetAuthnDescriptorRequest(); + return message; }, toAmino(_: GetAuthnDescriptorRequest): GetAuthnDescriptorRequestAmino { const obj: any = {}; @@ -1635,13 +1979,25 @@ export const GetAuthnDescriptorRequest = { }; } }; +GlobalDecoderRegistry.register(GetAuthnDescriptorRequest.typeUrl, GetAuthnDescriptorRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(GetAuthnDescriptorRequest.aminoType, GetAuthnDescriptorRequest.typeUrl); function createBaseGetAuthnDescriptorResponse(): GetAuthnDescriptorResponse { return { - authn: AuthnDescriptor.fromPartial({}) + authn: undefined }; } export const GetAuthnDescriptorResponse = { typeUrl: "/cosmos.base.reflection.v2alpha1.GetAuthnDescriptorResponse", + aminoType: "cosmos-sdk/GetAuthnDescriptorResponse", + is(o: any): o is GetAuthnDescriptorResponse { + return o && o.$typeUrl === GetAuthnDescriptorResponse.typeUrl; + }, + isSDK(o: any): o is GetAuthnDescriptorResponseSDKType { + return o && o.$typeUrl === GetAuthnDescriptorResponse.typeUrl; + }, + isAmino(o: any): o is GetAuthnDescriptorResponseAmino { + return o && o.$typeUrl === GetAuthnDescriptorResponse.typeUrl; + }, encode(message: GetAuthnDescriptorResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.authn !== undefined) { AuthnDescriptor.encode(message.authn, writer.uint32(10).fork()).ldelim(); @@ -1665,15 +2021,27 @@ export const GetAuthnDescriptorResponse = { } return message; }, + fromJSON(object: any): GetAuthnDescriptorResponse { + 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; + }, fromPartial(object: Partial): GetAuthnDescriptorResponse { const message = createBaseGetAuthnDescriptorResponse(); message.authn = object.authn !== undefined && object.authn !== null ? AuthnDescriptor.fromPartial(object.authn) : undefined; return message; }, fromAmino(object: GetAuthnDescriptorResponseAmino): GetAuthnDescriptorResponse { - return { - authn: object?.authn ? AuthnDescriptor.fromAmino(object.authn) : undefined - }; + const message = createBaseGetAuthnDescriptorResponse(); + if (object.authn !== undefined && object.authn !== null) { + message.authn = AuthnDescriptor.fromAmino(object.authn); + } + return message; }, toAmino(message: GetAuthnDescriptorResponse): GetAuthnDescriptorResponseAmino { const obj: any = {}; @@ -1702,11 +2070,23 @@ export const GetAuthnDescriptorResponse = { }; } }; +GlobalDecoderRegistry.register(GetAuthnDescriptorResponse.typeUrl, GetAuthnDescriptorResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(GetAuthnDescriptorResponse.aminoType, GetAuthnDescriptorResponse.typeUrl); function createBaseGetChainDescriptorRequest(): GetChainDescriptorRequest { return {}; } export const GetChainDescriptorRequest = { typeUrl: "/cosmos.base.reflection.v2alpha1.GetChainDescriptorRequest", + aminoType: "cosmos-sdk/GetChainDescriptorRequest", + is(o: any): o is GetChainDescriptorRequest { + return o && o.$typeUrl === GetChainDescriptorRequest.typeUrl; + }, + isSDK(o: any): o is GetChainDescriptorRequestSDKType { + return o && o.$typeUrl === GetChainDescriptorRequest.typeUrl; + }, + isAmino(o: any): o is GetChainDescriptorRequestAmino { + return o && o.$typeUrl === GetChainDescriptorRequest.typeUrl; + }, encode(_: GetChainDescriptorRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, @@ -1724,12 +2104,20 @@ export const GetChainDescriptorRequest = { } return message; }, + fromJSON(_: any): GetChainDescriptorRequest { + return {}; + }, + toJSON(_: GetChainDescriptorRequest): unknown { + const obj: any = {}; + return obj; + }, fromPartial(_: Partial): GetChainDescriptorRequest { const message = createBaseGetChainDescriptorRequest(); return message; }, fromAmino(_: GetChainDescriptorRequestAmino): GetChainDescriptorRequest { - return {}; + const message = createBaseGetChainDescriptorRequest(); + return message; }, toAmino(_: GetChainDescriptorRequest): GetChainDescriptorRequestAmino { const obj: any = {}; @@ -1757,13 +2145,25 @@ export const GetChainDescriptorRequest = { }; } }; +GlobalDecoderRegistry.register(GetChainDescriptorRequest.typeUrl, GetChainDescriptorRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(GetChainDescriptorRequest.aminoType, GetChainDescriptorRequest.typeUrl); function createBaseGetChainDescriptorResponse(): GetChainDescriptorResponse { return { - chain: ChainDescriptor.fromPartial({}) + chain: undefined }; } export const GetChainDescriptorResponse = { typeUrl: "/cosmos.base.reflection.v2alpha1.GetChainDescriptorResponse", + aminoType: "cosmos-sdk/GetChainDescriptorResponse", + is(o: any): o is GetChainDescriptorResponse { + return o && o.$typeUrl === GetChainDescriptorResponse.typeUrl; + }, + isSDK(o: any): o is GetChainDescriptorResponseSDKType { + return o && o.$typeUrl === GetChainDescriptorResponse.typeUrl; + }, + isAmino(o: any): o is GetChainDescriptorResponseAmino { + return o && o.$typeUrl === GetChainDescriptorResponse.typeUrl; + }, encode(message: GetChainDescriptorResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.chain !== undefined) { ChainDescriptor.encode(message.chain, writer.uint32(10).fork()).ldelim(); @@ -1787,15 +2187,27 @@ export const GetChainDescriptorResponse = { } return message; }, + fromJSON(object: any): GetChainDescriptorResponse { + 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; + }, fromPartial(object: Partial): GetChainDescriptorResponse { const message = createBaseGetChainDescriptorResponse(); message.chain = object.chain !== undefined && object.chain !== null ? ChainDescriptor.fromPartial(object.chain) : undefined; return message; }, fromAmino(object: GetChainDescriptorResponseAmino): GetChainDescriptorResponse { - return { - chain: object?.chain ? ChainDescriptor.fromAmino(object.chain) : undefined - }; + const message = createBaseGetChainDescriptorResponse(); + if (object.chain !== undefined && object.chain !== null) { + message.chain = ChainDescriptor.fromAmino(object.chain); + } + return message; }, toAmino(message: GetChainDescriptorResponse): GetChainDescriptorResponseAmino { const obj: any = {}; @@ -1824,11 +2236,23 @@ export const GetChainDescriptorResponse = { }; } }; +GlobalDecoderRegistry.register(GetChainDescriptorResponse.typeUrl, GetChainDescriptorResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(GetChainDescriptorResponse.aminoType, GetChainDescriptorResponse.typeUrl); function createBaseGetCodecDescriptorRequest(): GetCodecDescriptorRequest { return {}; } export const GetCodecDescriptorRequest = { typeUrl: "/cosmos.base.reflection.v2alpha1.GetCodecDescriptorRequest", + aminoType: "cosmos-sdk/GetCodecDescriptorRequest", + is(o: any): o is GetCodecDescriptorRequest { + return o && o.$typeUrl === GetCodecDescriptorRequest.typeUrl; + }, + isSDK(o: any): o is GetCodecDescriptorRequestSDKType { + return o && o.$typeUrl === GetCodecDescriptorRequest.typeUrl; + }, + isAmino(o: any): o is GetCodecDescriptorRequestAmino { + return o && o.$typeUrl === GetCodecDescriptorRequest.typeUrl; + }, encode(_: GetCodecDescriptorRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, @@ -1846,12 +2270,20 @@ export const GetCodecDescriptorRequest = { } return message; }, + fromJSON(_: any): GetCodecDescriptorRequest { + return {}; + }, + toJSON(_: GetCodecDescriptorRequest): unknown { + const obj: any = {}; + return obj; + }, fromPartial(_: Partial): GetCodecDescriptorRequest { const message = createBaseGetCodecDescriptorRequest(); return message; }, fromAmino(_: GetCodecDescriptorRequestAmino): GetCodecDescriptorRequest { - return {}; + const message = createBaseGetCodecDescriptorRequest(); + return message; }, toAmino(_: GetCodecDescriptorRequest): GetCodecDescriptorRequestAmino { const obj: any = {}; @@ -1879,13 +2311,25 @@ export const GetCodecDescriptorRequest = { }; } }; +GlobalDecoderRegistry.register(GetCodecDescriptorRequest.typeUrl, GetCodecDescriptorRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(GetCodecDescriptorRequest.aminoType, GetCodecDescriptorRequest.typeUrl); function createBaseGetCodecDescriptorResponse(): GetCodecDescriptorResponse { return { - codec: CodecDescriptor.fromPartial({}) + codec: undefined }; } export const GetCodecDescriptorResponse = { typeUrl: "/cosmos.base.reflection.v2alpha1.GetCodecDescriptorResponse", + aminoType: "cosmos-sdk/GetCodecDescriptorResponse", + is(o: any): o is GetCodecDescriptorResponse { + return o && o.$typeUrl === GetCodecDescriptorResponse.typeUrl; + }, + isSDK(o: any): o is GetCodecDescriptorResponseSDKType { + return o && o.$typeUrl === GetCodecDescriptorResponse.typeUrl; + }, + isAmino(o: any): o is GetCodecDescriptorResponseAmino { + return o && o.$typeUrl === GetCodecDescriptorResponse.typeUrl; + }, encode(message: GetCodecDescriptorResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.codec !== undefined) { CodecDescriptor.encode(message.codec, writer.uint32(10).fork()).ldelim(); @@ -1909,15 +2353,27 @@ export const GetCodecDescriptorResponse = { } return message; }, + fromJSON(object: any): GetCodecDescriptorResponse { + 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; + }, fromPartial(object: Partial): GetCodecDescriptorResponse { const message = createBaseGetCodecDescriptorResponse(); message.codec = object.codec !== undefined && object.codec !== null ? CodecDescriptor.fromPartial(object.codec) : undefined; return message; }, fromAmino(object: GetCodecDescriptorResponseAmino): GetCodecDescriptorResponse { - return { - codec: object?.codec ? CodecDescriptor.fromAmino(object.codec) : undefined - }; + const message = createBaseGetCodecDescriptorResponse(); + if (object.codec !== undefined && object.codec !== null) { + message.codec = CodecDescriptor.fromAmino(object.codec); + } + return message; }, toAmino(message: GetCodecDescriptorResponse): GetCodecDescriptorResponseAmino { const obj: any = {}; @@ -1946,11 +2402,23 @@ export const GetCodecDescriptorResponse = { }; } }; +GlobalDecoderRegistry.register(GetCodecDescriptorResponse.typeUrl, GetCodecDescriptorResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(GetCodecDescriptorResponse.aminoType, GetCodecDescriptorResponse.typeUrl); function createBaseGetConfigurationDescriptorRequest(): GetConfigurationDescriptorRequest { return {}; } export const GetConfigurationDescriptorRequest = { typeUrl: "/cosmos.base.reflection.v2alpha1.GetConfigurationDescriptorRequest", + aminoType: "cosmos-sdk/GetConfigurationDescriptorRequest", + is(o: any): o is GetConfigurationDescriptorRequest { + return o && o.$typeUrl === GetConfigurationDescriptorRequest.typeUrl; + }, + isSDK(o: any): o is GetConfigurationDescriptorRequestSDKType { + return o && o.$typeUrl === GetConfigurationDescriptorRequest.typeUrl; + }, + isAmino(o: any): o is GetConfigurationDescriptorRequestAmino { + return o && o.$typeUrl === GetConfigurationDescriptorRequest.typeUrl; + }, encode(_: GetConfigurationDescriptorRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, @@ -1968,12 +2436,20 @@ export const GetConfigurationDescriptorRequest = { } return message; }, + fromJSON(_: any): GetConfigurationDescriptorRequest { + return {}; + }, + toJSON(_: GetConfigurationDescriptorRequest): unknown { + const obj: any = {}; + return obj; + }, fromPartial(_: Partial): GetConfigurationDescriptorRequest { const message = createBaseGetConfigurationDescriptorRequest(); return message; }, fromAmino(_: GetConfigurationDescriptorRequestAmino): GetConfigurationDescriptorRequest { - return {}; + const message = createBaseGetConfigurationDescriptorRequest(); + return message; }, toAmino(_: GetConfigurationDescriptorRequest): GetConfigurationDescriptorRequestAmino { const obj: any = {}; @@ -2001,13 +2477,25 @@ export const GetConfigurationDescriptorRequest = { }; } }; +GlobalDecoderRegistry.register(GetConfigurationDescriptorRequest.typeUrl, GetConfigurationDescriptorRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(GetConfigurationDescriptorRequest.aminoType, GetConfigurationDescriptorRequest.typeUrl); function createBaseGetConfigurationDescriptorResponse(): GetConfigurationDescriptorResponse { return { - config: ConfigurationDescriptor.fromPartial({}) + config: undefined }; } export const GetConfigurationDescriptorResponse = { typeUrl: "/cosmos.base.reflection.v2alpha1.GetConfigurationDescriptorResponse", + aminoType: "cosmos-sdk/GetConfigurationDescriptorResponse", + is(o: any): o is GetConfigurationDescriptorResponse { + return o && o.$typeUrl === GetConfigurationDescriptorResponse.typeUrl; + }, + isSDK(o: any): o is GetConfigurationDescriptorResponseSDKType { + return o && o.$typeUrl === GetConfigurationDescriptorResponse.typeUrl; + }, + isAmino(o: any): o is GetConfigurationDescriptorResponseAmino { + return o && o.$typeUrl === GetConfigurationDescriptorResponse.typeUrl; + }, encode(message: GetConfigurationDescriptorResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.config !== undefined) { ConfigurationDescriptor.encode(message.config, writer.uint32(10).fork()).ldelim(); @@ -2031,15 +2519,27 @@ export const GetConfigurationDescriptorResponse = { } return message; }, + fromJSON(object: any): GetConfigurationDescriptorResponse { + return { + config: isSet(object.config) ? ConfigurationDescriptor.fromJSON(object.config) : undefined + }; + }, + toJSON(message: GetConfigurationDescriptorResponse): unknown { + const obj: any = {}; + message.config !== undefined && (obj.config = message.config ? ConfigurationDescriptor.toJSON(message.config) : undefined); + return obj; + }, fromPartial(object: Partial): GetConfigurationDescriptorResponse { const message = createBaseGetConfigurationDescriptorResponse(); message.config = object.config !== undefined && object.config !== null ? ConfigurationDescriptor.fromPartial(object.config) : undefined; return message; }, fromAmino(object: GetConfigurationDescriptorResponseAmino): GetConfigurationDescriptorResponse { - return { - config: object?.config ? ConfigurationDescriptor.fromAmino(object.config) : undefined - }; + const message = createBaseGetConfigurationDescriptorResponse(); + if (object.config !== undefined && object.config !== null) { + message.config = ConfigurationDescriptor.fromAmino(object.config); + } + return message; }, toAmino(message: GetConfigurationDescriptorResponse): GetConfigurationDescriptorResponseAmino { const obj: any = {}; @@ -2068,11 +2568,23 @@ export const GetConfigurationDescriptorResponse = { }; } }; +GlobalDecoderRegistry.register(GetConfigurationDescriptorResponse.typeUrl, GetConfigurationDescriptorResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(GetConfigurationDescriptorResponse.aminoType, GetConfigurationDescriptorResponse.typeUrl); function createBaseGetQueryServicesDescriptorRequest(): GetQueryServicesDescriptorRequest { return {}; } export const GetQueryServicesDescriptorRequest = { typeUrl: "/cosmos.base.reflection.v2alpha1.GetQueryServicesDescriptorRequest", + aminoType: "cosmos-sdk/GetQueryServicesDescriptorRequest", + is(o: any): o is GetQueryServicesDescriptorRequest { + return o && o.$typeUrl === GetQueryServicesDescriptorRequest.typeUrl; + }, + isSDK(o: any): o is GetQueryServicesDescriptorRequestSDKType { + return o && o.$typeUrl === GetQueryServicesDescriptorRequest.typeUrl; + }, + isAmino(o: any): o is GetQueryServicesDescriptorRequestAmino { + return o && o.$typeUrl === GetQueryServicesDescriptorRequest.typeUrl; + }, encode(_: GetQueryServicesDescriptorRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, @@ -2090,12 +2602,20 @@ export const GetQueryServicesDescriptorRequest = { } return message; }, + fromJSON(_: any): GetQueryServicesDescriptorRequest { + return {}; + }, + toJSON(_: GetQueryServicesDescriptorRequest): unknown { + const obj: any = {}; + return obj; + }, fromPartial(_: Partial): GetQueryServicesDescriptorRequest { const message = createBaseGetQueryServicesDescriptorRequest(); return message; }, fromAmino(_: GetQueryServicesDescriptorRequestAmino): GetQueryServicesDescriptorRequest { - return {}; + const message = createBaseGetQueryServicesDescriptorRequest(); + return message; }, toAmino(_: GetQueryServicesDescriptorRequest): GetQueryServicesDescriptorRequestAmino { const obj: any = {}; @@ -2123,13 +2643,25 @@ export const GetQueryServicesDescriptorRequest = { }; } }; +GlobalDecoderRegistry.register(GetQueryServicesDescriptorRequest.typeUrl, GetQueryServicesDescriptorRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(GetQueryServicesDescriptorRequest.aminoType, GetQueryServicesDescriptorRequest.typeUrl); function createBaseGetQueryServicesDescriptorResponse(): GetQueryServicesDescriptorResponse { return { - queries: QueryServicesDescriptor.fromPartial({}) + queries: undefined }; } export const GetQueryServicesDescriptorResponse = { typeUrl: "/cosmos.base.reflection.v2alpha1.GetQueryServicesDescriptorResponse", + aminoType: "cosmos-sdk/GetQueryServicesDescriptorResponse", + is(o: any): o is GetQueryServicesDescriptorResponse { + return o && o.$typeUrl === GetQueryServicesDescriptorResponse.typeUrl; + }, + isSDK(o: any): o is GetQueryServicesDescriptorResponseSDKType { + return o && o.$typeUrl === GetQueryServicesDescriptorResponse.typeUrl; + }, + isAmino(o: any): o is GetQueryServicesDescriptorResponseAmino { + return o && o.$typeUrl === GetQueryServicesDescriptorResponse.typeUrl; + }, encode(message: GetQueryServicesDescriptorResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.queries !== undefined) { QueryServicesDescriptor.encode(message.queries, writer.uint32(10).fork()).ldelim(); @@ -2153,15 +2685,27 @@ export const GetQueryServicesDescriptorResponse = { } return message; }, + fromJSON(object: any): GetQueryServicesDescriptorResponse { + return { + queries: isSet(object.queries) ? QueryServicesDescriptor.fromJSON(object.queries) : undefined + }; + }, + toJSON(message: GetQueryServicesDescriptorResponse): unknown { + const obj: any = {}; + message.queries !== undefined && (obj.queries = message.queries ? QueryServicesDescriptor.toJSON(message.queries) : undefined); + return obj; + }, fromPartial(object: Partial): GetQueryServicesDescriptorResponse { const message = createBaseGetQueryServicesDescriptorResponse(); message.queries = object.queries !== undefined && object.queries !== null ? QueryServicesDescriptor.fromPartial(object.queries) : undefined; return message; }, fromAmino(object: GetQueryServicesDescriptorResponseAmino): GetQueryServicesDescriptorResponse { - return { - queries: object?.queries ? QueryServicesDescriptor.fromAmino(object.queries) : undefined - }; + const message = createBaseGetQueryServicesDescriptorResponse(); + if (object.queries !== undefined && object.queries !== null) { + message.queries = QueryServicesDescriptor.fromAmino(object.queries); + } + return message; }, toAmino(message: GetQueryServicesDescriptorResponse): GetQueryServicesDescriptorResponseAmino { const obj: any = {}; @@ -2190,11 +2734,23 @@ export const GetQueryServicesDescriptorResponse = { }; } }; +GlobalDecoderRegistry.register(GetQueryServicesDescriptorResponse.typeUrl, GetQueryServicesDescriptorResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(GetQueryServicesDescriptorResponse.aminoType, GetQueryServicesDescriptorResponse.typeUrl); function createBaseGetTxDescriptorRequest(): GetTxDescriptorRequest { return {}; } export const GetTxDescriptorRequest = { typeUrl: "/cosmos.base.reflection.v2alpha1.GetTxDescriptorRequest", + aminoType: "cosmos-sdk/GetTxDescriptorRequest", + is(o: any): o is GetTxDescriptorRequest { + return o && o.$typeUrl === GetTxDescriptorRequest.typeUrl; + }, + isSDK(o: any): o is GetTxDescriptorRequestSDKType { + return o && o.$typeUrl === GetTxDescriptorRequest.typeUrl; + }, + isAmino(o: any): o is GetTxDescriptorRequestAmino { + return o && o.$typeUrl === GetTxDescriptorRequest.typeUrl; + }, encode(_: GetTxDescriptorRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, @@ -2212,12 +2768,20 @@ export const GetTxDescriptorRequest = { } return message; }, + fromJSON(_: any): GetTxDescriptorRequest { + return {}; + }, + toJSON(_: GetTxDescriptorRequest): unknown { + const obj: any = {}; + return obj; + }, fromPartial(_: Partial): GetTxDescriptorRequest { const message = createBaseGetTxDescriptorRequest(); return message; }, fromAmino(_: GetTxDescriptorRequestAmino): GetTxDescriptorRequest { - return {}; + const message = createBaseGetTxDescriptorRequest(); + return message; }, toAmino(_: GetTxDescriptorRequest): GetTxDescriptorRequestAmino { const obj: any = {}; @@ -2245,13 +2809,25 @@ export const GetTxDescriptorRequest = { }; } }; +GlobalDecoderRegistry.register(GetTxDescriptorRequest.typeUrl, GetTxDescriptorRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(GetTxDescriptorRequest.aminoType, GetTxDescriptorRequest.typeUrl); function createBaseGetTxDescriptorResponse(): GetTxDescriptorResponse { return { - tx: TxDescriptor.fromPartial({}) + tx: undefined }; } export const GetTxDescriptorResponse = { typeUrl: "/cosmos.base.reflection.v2alpha1.GetTxDescriptorResponse", + aminoType: "cosmos-sdk/GetTxDescriptorResponse", + is(o: any): o is GetTxDescriptorResponse { + return o && o.$typeUrl === GetTxDescriptorResponse.typeUrl; + }, + isSDK(o: any): o is GetTxDescriptorResponseSDKType { + return o && o.$typeUrl === GetTxDescriptorResponse.typeUrl; + }, + isAmino(o: any): o is GetTxDescriptorResponseAmino { + return o && o.$typeUrl === GetTxDescriptorResponse.typeUrl; + }, encode(message: GetTxDescriptorResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.tx !== undefined) { TxDescriptor.encode(message.tx, writer.uint32(10).fork()).ldelim(); @@ -2275,15 +2851,27 @@ export const GetTxDescriptorResponse = { } return message; }, + fromJSON(object: any): GetTxDescriptorResponse { + 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; + }, fromPartial(object: Partial): GetTxDescriptorResponse { const message = createBaseGetTxDescriptorResponse(); message.tx = object.tx !== undefined && object.tx !== null ? TxDescriptor.fromPartial(object.tx) : undefined; return message; }, fromAmino(object: GetTxDescriptorResponseAmino): GetTxDescriptorResponse { - return { - tx: object?.tx ? TxDescriptor.fromAmino(object.tx) : undefined - }; + const message = createBaseGetTxDescriptorResponse(); + if (object.tx !== undefined && object.tx !== null) { + message.tx = TxDescriptor.fromAmino(object.tx); + } + return message; }, toAmino(message: GetTxDescriptorResponse): GetTxDescriptorResponseAmino { const obj: any = {}; @@ -2312,6 +2900,8 @@ export const GetTxDescriptorResponse = { }; } }; +GlobalDecoderRegistry.register(GetTxDescriptorResponse.typeUrl, GetTxDescriptorResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(GetTxDescriptorResponse.aminoType, GetTxDescriptorResponse.typeUrl); function createBaseQueryServicesDescriptor(): QueryServicesDescriptor { return { queryServices: [] @@ -2319,6 +2909,16 @@ function createBaseQueryServicesDescriptor(): QueryServicesDescriptor { } export const QueryServicesDescriptor = { typeUrl: "/cosmos.base.reflection.v2alpha1.QueryServicesDescriptor", + aminoType: "cosmos-sdk/QueryServicesDescriptor", + is(o: any): o is QueryServicesDescriptor { + return o && (o.$typeUrl === QueryServicesDescriptor.typeUrl || Array.isArray(o.queryServices) && (!o.queryServices.length || QueryServiceDescriptor.is(o.queryServices[0]))); + }, + isSDK(o: any): o is QueryServicesDescriptorSDKType { + return o && (o.$typeUrl === QueryServicesDescriptor.typeUrl || Array.isArray(o.query_services) && (!o.query_services.length || QueryServiceDescriptor.isSDK(o.query_services[0]))); + }, + isAmino(o: any): o is QueryServicesDescriptorAmino { + return o && (o.$typeUrl === QueryServicesDescriptor.typeUrl || Array.isArray(o.query_services) && (!o.query_services.length || QueryServiceDescriptor.isAmino(o.query_services[0]))); + }, encode(message: QueryServicesDescriptor, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.queryServices) { QueryServiceDescriptor.encode(v!, writer.uint32(10).fork()).ldelim(); @@ -2342,15 +2942,29 @@ export const QueryServicesDescriptor = { } return message; }, + fromJSON(object: any): QueryServicesDescriptor { + return { + queryServices: Array.isArray(object?.queryServices) ? object.queryServices.map((e: any) => QueryServiceDescriptor.fromJSON(e)) : [] + }; + }, + toJSON(message: QueryServicesDescriptor): unknown { + const obj: any = {}; + if (message.queryServices) { + obj.queryServices = message.queryServices.map(e => e ? QueryServiceDescriptor.toJSON(e) : undefined); + } else { + obj.queryServices = []; + } + return obj; + }, fromPartial(object: Partial): QueryServicesDescriptor { const message = createBaseQueryServicesDescriptor(); message.queryServices = object.queryServices?.map(e => QueryServiceDescriptor.fromPartial(e)) || []; return message; }, fromAmino(object: QueryServicesDescriptorAmino): QueryServicesDescriptor { - return { - queryServices: Array.isArray(object?.query_services) ? object.query_services.map((e: any) => QueryServiceDescriptor.fromAmino(e)) : [] - }; + const message = createBaseQueryServicesDescriptor(); + message.queryServices = object.query_services?.map(e => QueryServiceDescriptor.fromAmino(e)) || []; + return message; }, toAmino(message: QueryServicesDescriptor): QueryServicesDescriptorAmino { const obj: any = {}; @@ -2383,6 +2997,8 @@ export const QueryServicesDescriptor = { }; } }; +GlobalDecoderRegistry.register(QueryServicesDescriptor.typeUrl, QueryServicesDescriptor); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryServicesDescriptor.aminoType, QueryServicesDescriptor.typeUrl); function createBaseQueryServiceDescriptor(): QueryServiceDescriptor { return { fullname: "", @@ -2392,6 +3008,16 @@ function createBaseQueryServiceDescriptor(): QueryServiceDescriptor { } export const QueryServiceDescriptor = { typeUrl: "/cosmos.base.reflection.v2alpha1.QueryServiceDescriptor", + aminoType: "cosmos-sdk/QueryServiceDescriptor", + is(o: any): o is QueryServiceDescriptor { + return o && (o.$typeUrl === QueryServiceDescriptor.typeUrl || typeof o.fullname === "string" && typeof o.isModule === "boolean" && Array.isArray(o.methods) && (!o.methods.length || QueryMethodDescriptor.is(o.methods[0]))); + }, + isSDK(o: any): o is QueryServiceDescriptorSDKType { + return o && (o.$typeUrl === QueryServiceDescriptor.typeUrl || typeof o.fullname === "string" && typeof o.is_module === "boolean" && Array.isArray(o.methods) && (!o.methods.length || QueryMethodDescriptor.isSDK(o.methods[0]))); + }, + isAmino(o: any): o is QueryServiceDescriptorAmino { + return o && (o.$typeUrl === QueryServiceDescriptor.typeUrl || typeof o.fullname === "string" && typeof o.is_module === "boolean" && Array.isArray(o.methods) && (!o.methods.length || QueryMethodDescriptor.isAmino(o.methods[0]))); + }, encode(message: QueryServiceDescriptor, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.fullname !== "") { writer.uint32(10).string(message.fullname); @@ -2427,6 +3053,24 @@ export const QueryServiceDescriptor = { } 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)) : [] + }; + }, + toJSON(message: QueryServiceDescriptor): unknown { + 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); + } else { + obj.methods = []; + } + return obj; + }, fromPartial(object: Partial): QueryServiceDescriptor { const message = createBaseQueryServiceDescriptor(); message.fullname = object.fullname ?? ""; @@ -2435,11 +3079,15 @@ export const QueryServiceDescriptor = { return message; }, fromAmino(object: QueryServiceDescriptorAmino): QueryServiceDescriptor { - return { - fullname: object.fullname, - isModule: object.is_module, - methods: Array.isArray(object?.methods) ? object.methods.map((e: any) => QueryMethodDescriptor.fromAmino(e)) : [] - }; + const message = createBaseQueryServiceDescriptor(); + if (object.fullname !== undefined && object.fullname !== null) { + message.fullname = object.fullname; + } + if (object.is_module !== undefined && object.is_module !== null) { + message.isModule = object.is_module; + } + message.methods = object.methods?.map(e => QueryMethodDescriptor.fromAmino(e)) || []; + return message; }, toAmino(message: QueryServiceDescriptor): QueryServiceDescriptorAmino { const obj: any = {}; @@ -2474,6 +3122,8 @@ export const QueryServiceDescriptor = { }; } }; +GlobalDecoderRegistry.register(QueryServiceDescriptor.typeUrl, QueryServiceDescriptor); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryServiceDescriptor.aminoType, QueryServiceDescriptor.typeUrl); function createBaseQueryMethodDescriptor(): QueryMethodDescriptor { return { name: "", @@ -2482,6 +3132,16 @@ function createBaseQueryMethodDescriptor(): QueryMethodDescriptor { } export const QueryMethodDescriptor = { typeUrl: "/cosmos.base.reflection.v2alpha1.QueryMethodDescriptor", + aminoType: "cosmos-sdk/QueryMethodDescriptor", + is(o: any): o is QueryMethodDescriptor { + return o && (o.$typeUrl === QueryMethodDescriptor.typeUrl || typeof o.name === "string" && typeof o.fullQueryPath === "string"); + }, + isSDK(o: any): o is QueryMethodDescriptorSDKType { + return o && (o.$typeUrl === QueryMethodDescriptor.typeUrl || typeof o.name === "string" && typeof o.full_query_path === "string"); + }, + isAmino(o: any): o is QueryMethodDescriptorAmino { + return o && (o.$typeUrl === QueryMethodDescriptor.typeUrl || typeof o.name === "string" && typeof o.full_query_path === "string"); + }, encode(message: QueryMethodDescriptor, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.name !== "") { writer.uint32(10).string(message.name); @@ -2511,6 +3171,18 @@ export const QueryMethodDescriptor = { } 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; + }, fromPartial(object: Partial): QueryMethodDescriptor { const message = createBaseQueryMethodDescriptor(); message.name = object.name ?? ""; @@ -2518,10 +3190,14 @@ export const QueryMethodDescriptor = { return message; }, fromAmino(object: QueryMethodDescriptorAmino): QueryMethodDescriptor { - return { - name: object.name, - fullQueryPath: object.full_query_path - }; + const message = createBaseQueryMethodDescriptor(); + if (object.name !== undefined && object.name !== null) { + message.name = object.name; + } + if (object.full_query_path !== undefined && object.full_query_path !== null) { + message.fullQueryPath = object.full_query_path; + } + return message; }, toAmino(message: QueryMethodDescriptor): QueryMethodDescriptorAmino { const obj: any = {}; @@ -2550,4 +3226,6 @@ export const QueryMethodDescriptor = { value: QueryMethodDescriptor.encode(message).finish() }; } -}; \ No newline at end of file +}; +GlobalDecoderRegistry.register(QueryMethodDescriptor.typeUrl, QueryMethodDescriptor); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryMethodDescriptor.aminoType, QueryMethodDescriptor.typeUrl); \ No newline at end of file diff --git a/packages/osmojs/src/codegen/cosmos/base/v1beta1/coin.ts b/packages/osmojs/src/codegen/cosmos/base/v1beta1/coin.ts index 70f7a52e1..72f91714d 100644 --- a/packages/osmojs/src/codegen/cosmos/base/v1beta1/coin.ts +++ b/packages/osmojs/src/codegen/cosmos/base/v1beta1/coin.ts @@ -1,4 +1,6 @@ import { BinaryReader, BinaryWriter } from "../../../binary"; +import { isSet } from "../../../helpers"; +import { GlobalDecoderRegistry } from "../../../registry"; /** * Coin defines a token with a denomination and an amount. * @@ -20,7 +22,7 @@ export interface CoinProtoMsg { * signatures required by gogoproto. */ export interface CoinAmino { - denom: string; + denom?: string; amount: string; } export interface CoinAminoMsg { @@ -58,8 +60,8 @@ export interface DecCoinProtoMsg { * signatures required by gogoproto. */ export interface DecCoinAmino { - denom: string; - amount: string; + denom?: string; + amount?: string; } export interface DecCoinAminoMsg { type: "cosmos-sdk/DecCoin"; @@ -85,7 +87,7 @@ export interface IntProtoProtoMsg { } /** IntProto defines a Protobuf wrapper around an Int object. */ export interface IntProtoAmino { - int: string; + int?: string; } export interface IntProtoAminoMsg { type: "cosmos-sdk/IntProto"; @@ -105,7 +107,7 @@ export interface DecProtoProtoMsg { } /** DecProto defines a Protobuf wrapper around a Dec object. */ export interface DecProtoAmino { - dec: string; + dec?: string; } export interface DecProtoAminoMsg { type: "cosmos-sdk/DecProto"; @@ -123,6 +125,16 @@ function createBaseCoin(): Coin { } export const Coin = { typeUrl: "/cosmos.base.v1beta1.Coin", + aminoType: "cosmos-sdk/Coin", + is(o: any): o is Coin { + return o && (o.$typeUrl === Coin.typeUrl || typeof o.denom === "string" && typeof o.amount === "string"); + }, + isSDK(o: any): o is CoinSDKType { + return o && (o.$typeUrl === Coin.typeUrl || typeof o.denom === "string" && typeof o.amount === "string"); + }, + isAmino(o: any): o is CoinAmino { + return o && (o.$typeUrl === Coin.typeUrl || typeof o.denom === "string" && typeof o.amount === "string"); + }, encode(message: Coin, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.denom !== "") { writer.uint32(10).string(message.denom); @@ -152,6 +164,18 @@ export const Coin = { } 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; + }, fromPartial(object: Partial): Coin { const message = createBaseCoin(); message.denom = object.denom ?? ""; @@ -159,15 +183,19 @@ export const Coin = { return message; }, fromAmino(object: CoinAmino): Coin { - return { - denom: object.denom, - amount: object.amount - }; + const message = createBaseCoin(); + if (object.denom !== undefined && object.denom !== null) { + message.denom = object.denom; + } + if (object.amount !== undefined && object.amount !== null) { + message.amount = object.amount; + } + return message; }, toAmino(message: Coin): CoinAmino { const obj: any = {}; obj.denom = message.denom; - obj.amount = message.amount; + obj.amount = message.amount ?? ""; return obj; }, fromAminoMsg(object: CoinAminoMsg): Coin { @@ -192,6 +220,8 @@ export const Coin = { }; } }; +GlobalDecoderRegistry.register(Coin.typeUrl, Coin); +GlobalDecoderRegistry.registerAminoProtoMapping(Coin.aminoType, Coin.typeUrl); function createBaseDecCoin(): DecCoin { return { denom: "", @@ -200,6 +230,16 @@ function createBaseDecCoin(): DecCoin { } export const DecCoin = { typeUrl: "/cosmos.base.v1beta1.DecCoin", + aminoType: "cosmos-sdk/DecCoin", + is(o: any): o is DecCoin { + return o && (o.$typeUrl === DecCoin.typeUrl || typeof o.denom === "string" && typeof o.amount === "string"); + }, + isSDK(o: any): o is DecCoinSDKType { + return o && (o.$typeUrl === DecCoin.typeUrl || typeof o.denom === "string" && typeof o.amount === "string"); + }, + isAmino(o: any): o is DecCoinAmino { + return o && (o.$typeUrl === DecCoin.typeUrl || typeof o.denom === "string" && typeof o.amount === "string"); + }, encode(message: DecCoin, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.denom !== "") { writer.uint32(10).string(message.denom); @@ -229,6 +269,18 @@ export const DecCoin = { } 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; + }, fromPartial(object: Partial): DecCoin { const message = createBaseDecCoin(); message.denom = object.denom ?? ""; @@ -236,10 +288,14 @@ export const DecCoin = { return message; }, fromAmino(object: DecCoinAmino): DecCoin { - return { - denom: object.denom, - amount: object.amount - }; + const message = createBaseDecCoin(); + if (object.denom !== undefined && object.denom !== null) { + message.denom = object.denom; + } + if (object.amount !== undefined && object.amount !== null) { + message.amount = object.amount; + } + return message; }, toAmino(message: DecCoin): DecCoinAmino { const obj: any = {}; @@ -269,6 +325,8 @@ export const DecCoin = { }; } }; +GlobalDecoderRegistry.register(DecCoin.typeUrl, DecCoin); +GlobalDecoderRegistry.registerAminoProtoMapping(DecCoin.aminoType, DecCoin.typeUrl); function createBaseIntProto(): IntProto { return { int: "" @@ -276,6 +334,16 @@ function createBaseIntProto(): IntProto { } export const IntProto = { typeUrl: "/cosmos.base.v1beta1.IntProto", + aminoType: "cosmos-sdk/IntProto", + is(o: any): o is IntProto { + return o && (o.$typeUrl === IntProto.typeUrl || typeof o.int === "string"); + }, + isSDK(o: any): o is IntProtoSDKType { + return o && (o.$typeUrl === IntProto.typeUrl || typeof o.int === "string"); + }, + isAmino(o: any): o is IntProtoAmino { + return o && (o.$typeUrl === IntProto.typeUrl || typeof o.int === "string"); + }, encode(message: IntProto, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.int !== "") { writer.uint32(10).string(message.int); @@ -299,15 +367,27 @@ export const IntProto = { } return message; }, + fromJSON(object: any): IntProto { + return { + int: isSet(object.int) ? String(object.int) : "" + }; + }, + toJSON(message: IntProto): unknown { + const obj: any = {}; + message.int !== undefined && (obj.int = message.int); + return obj; + }, fromPartial(object: Partial): IntProto { const message = createBaseIntProto(); message.int = object.int ?? ""; return message; }, fromAmino(object: IntProtoAmino): IntProto { - return { - int: object.int - }; + const message = createBaseIntProto(); + if (object.int !== undefined && object.int !== null) { + message.int = object.int; + } + return message; }, toAmino(message: IntProto): IntProtoAmino { const obj: any = {}; @@ -336,6 +416,8 @@ export const IntProto = { }; } }; +GlobalDecoderRegistry.register(IntProto.typeUrl, IntProto); +GlobalDecoderRegistry.registerAminoProtoMapping(IntProto.aminoType, IntProto.typeUrl); function createBaseDecProto(): DecProto { return { dec: "" @@ -343,6 +425,16 @@ function createBaseDecProto(): DecProto { } export const DecProto = { typeUrl: "/cosmos.base.v1beta1.DecProto", + aminoType: "cosmos-sdk/DecProto", + is(o: any): o is DecProto { + return o && (o.$typeUrl === DecProto.typeUrl || typeof o.dec === "string"); + }, + isSDK(o: any): o is DecProtoSDKType { + return o && (o.$typeUrl === DecProto.typeUrl || typeof o.dec === "string"); + }, + isAmino(o: any): o is DecProtoAmino { + return o && (o.$typeUrl === DecProto.typeUrl || typeof o.dec === "string"); + }, encode(message: DecProto, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.dec !== "") { writer.uint32(10).string(message.dec); @@ -366,15 +458,27 @@ export const DecProto = { } return message; }, + fromJSON(object: any): DecProto { + return { + dec: isSet(object.dec) ? String(object.dec) : "" + }; + }, + toJSON(message: DecProto): unknown { + const obj: any = {}; + message.dec !== undefined && (obj.dec = message.dec); + return obj; + }, fromPartial(object: Partial): DecProto { const message = createBaseDecProto(); message.dec = object.dec ?? ""; return message; }, fromAmino(object: DecProtoAmino): DecProto { - return { - dec: object.dec - }; + const message = createBaseDecProto(); + if (object.dec !== undefined && object.dec !== null) { + message.dec = object.dec; + } + return message; }, toAmino(message: DecProto): DecProtoAmino { const obj: any = {}; @@ -402,4 +506,6 @@ export const DecProto = { value: DecProto.encode(message).finish() }; } -}; \ No newline at end of file +}; +GlobalDecoderRegistry.register(DecProto.typeUrl, DecProto); +GlobalDecoderRegistry.registerAminoProtoMapping(DecProto.aminoType, DecProto.typeUrl); \ No newline at end of file diff --git a/packages/osmojs/src/codegen/cosmos/bundle.ts b/packages/osmojs/src/codegen/cosmos/bundle.ts index 8a55932b2..4d223842e 100644 --- a/packages/osmojs/src/codegen/cosmos/bundle.ts +++ b/packages/osmojs/src/codegen/cosmos/bundle.ts @@ -1,228 +1,462 @@ import * as _0 from "./ics23/v1/proofs"; -import * as _1 from "./auth/v1beta1/auth"; -import * as _2 from "./auth/v1beta1/genesis"; -import * as _3 from "./auth/v1beta1/query"; -import * as _4 from "./authz/v1beta1/authz"; -import * as _5 from "./authz/v1beta1/event"; -import * as _6 from "./authz/v1beta1/genesis"; -import * as _7 from "./authz/v1beta1/query"; -import * as _8 from "./authz/v1beta1/tx"; -import * as _9 from "./bank/v1beta1/authz"; -import * as _10 from "./bank/v1beta1/bank"; -import * as _11 from "./bank/v1beta1/genesis"; -import * as _12 from "./bank/v1beta1/query"; -import * as _13 from "./bank/v1beta1/tx"; -import * as _14 from "./base/abci/v1beta1/abci"; -import * as _15 from "./base/node/v1beta1/query"; -import * as _16 from "./base/query/v1beta1/pagination"; -import * as _17 from "./base/reflection/v2alpha1/reflection"; -import * as _18 from "./base/v1beta1/coin"; -import * as _19 from "./crypto/ed25519/keys"; -import * as _20 from "./crypto/multisig/keys"; -import * as _21 from "./crypto/secp256k1/keys"; -import * as _22 from "./crypto/secp256r1/keys"; -import * as _23 from "./distribution/v1beta1/distribution"; -import * as _24 from "./distribution/v1beta1/genesis"; -import * as _25 from "./distribution/v1beta1/query"; -import * as _26 from "./distribution/v1beta1/tx"; -import * as _27 from "./gov/v1beta1/genesis"; -import * as _28 from "./gov/v1beta1/gov"; -import * as _29 from "./gov/v1beta1/query"; -import * as _30 from "./gov/v1beta1/tx"; -import * as _31 from "./staking/v1beta1/authz"; -import * as _32 from "./staking/v1beta1/genesis"; -import * as _33 from "./staking/v1beta1/query"; -import * as _34 from "./staking/v1beta1/staking"; -import * as _35 from "./staking/v1beta1/tx"; -import * as _36 from "./tx/signing/v1beta1/signing"; -import * as _37 from "./tx/v1beta1/service"; -import * as _38 from "./tx/v1beta1/tx"; -import * as _39 from "./upgrade/v1beta1/query"; -import * as _40 from "./upgrade/v1beta1/upgrade"; -import * as _190 from "./authz/v1beta1/tx.amino"; -import * as _191 from "./bank/v1beta1/tx.amino"; -import * as _192 from "./distribution/v1beta1/tx.amino"; -import * as _193 from "./gov/v1beta1/tx.amino"; -import * as _194 from "./staking/v1beta1/tx.amino"; -import * as _195 from "./authz/v1beta1/tx.registry"; -import * as _196 from "./bank/v1beta1/tx.registry"; -import * as _197 from "./distribution/v1beta1/tx.registry"; -import * as _198 from "./gov/v1beta1/tx.registry"; -import * as _199 from "./staking/v1beta1/tx.registry"; -import * as _200 from "./auth/v1beta1/query.lcd"; -import * as _201 from "./authz/v1beta1/query.lcd"; -import * as _202 from "./bank/v1beta1/query.lcd"; -import * as _203 from "./base/node/v1beta1/query.lcd"; -import * as _204 from "./distribution/v1beta1/query.lcd"; -import * as _205 from "./gov/v1beta1/query.lcd"; -import * as _206 from "./staking/v1beta1/query.lcd"; -import * as _207 from "./tx/v1beta1/service.lcd"; -import * as _208 from "./upgrade/v1beta1/query.lcd"; -import * as _209 from "./auth/v1beta1/query.rpc.Query"; -import * as _210 from "./authz/v1beta1/query.rpc.Query"; -import * as _211 from "./bank/v1beta1/query.rpc.Query"; -import * as _212 from "./base/node/v1beta1/query.rpc.Service"; -import * as _213 from "./distribution/v1beta1/query.rpc.Query"; -import * as _214 from "./gov/v1beta1/query.rpc.Query"; -import * as _215 from "./staking/v1beta1/query.rpc.Query"; -import * as _216 from "./tx/v1beta1/service.rpc.Service"; -import * as _217 from "./upgrade/v1beta1/query.rpc.Query"; -import * as _218 from "./authz/v1beta1/tx.rpc.msg"; -import * as _219 from "./bank/v1beta1/tx.rpc.msg"; -import * as _220 from "./distribution/v1beta1/tx.rpc.msg"; -import * as _221 from "./gov/v1beta1/tx.rpc.msg"; -import * as _222 from "./staking/v1beta1/tx.rpc.msg"; -import * as _332 from "./lcd"; -import * as _333 from "./rpc.query"; -import * as _334 from "./rpc.tx"; +import * as _1 from "./app/runtime/v1alpha1/module"; +import * as _2 from "./auth/module/v1/module"; +import * as _3 from "./auth/v1beta1/auth"; +import * as _4 from "./auth/v1beta1/genesis"; +import * as _5 from "./auth/v1beta1/query"; +import * as _6 from "./auth/v1beta1/tx"; +import * as _7 from "./authz/module/v1/module"; +import * as _8 from "./authz/v1beta1/authz"; +import * as _9 from "./authz/v1beta1/event"; +import * as _10 from "./authz/v1beta1/genesis"; +import * as _11 from "./authz/v1beta1/query"; +import * as _12 from "./authz/v1beta1/tx"; +import * as _13 from "./bank/module/v1/module"; +import * as _14 from "./bank/v1beta1/authz"; +import * as _15 from "./bank/v1beta1/bank"; +import * as _16 from "./bank/v1beta1/genesis"; +import * as _17 from "./bank/v1beta1/query"; +import * as _18 from "./bank/v1beta1/tx"; +import * as _19 from "./base/abci/v1beta1/abci"; +import * as _20 from "./base/node/v1beta1/query"; +import * as _21 from "./base/query/v1beta1/pagination"; +import * as _22 from "./base/reflection/v2alpha1/reflection"; +import * as _23 from "./base/v1beta1/coin"; +import * as _24 from "./capability/module/v1/module"; +import * as _25 from "./consensus/module/v1/module"; +import * as _26 from "./consensus/v1/query"; +import * as _27 from "./consensus/v1/tx"; +import * as _28 from "./crisis/module/v1/module"; +import * as _29 from "./crypto/ed25519/keys"; +import * as _30 from "./crypto/hd/v1/hd"; +import * as _31 from "./crypto/keyring/v1/record"; +import * as _32 from "./crypto/multisig/keys"; +import * as _33 from "./crypto/secp256k1/keys"; +import * as _34 from "./crypto/secp256r1/keys"; +import * as _35 from "./distribution/module/v1/module"; +import * as _36 from "./distribution/v1beta1/distribution"; +import * as _37 from "./distribution/v1beta1/genesis"; +import * as _38 from "./distribution/v1beta1/query"; +import * as _39 from "./distribution/v1beta1/tx"; +import * as _40 from "./evidence/module/v1/module"; +import * as _41 from "./feegrant/module/v1/module"; +import * as _42 from "./genutil/module/v1/module"; +import * as _43 from "./gov/module/v1/module"; +import * as _44 from "./gov/v1beta1/genesis"; +import * as _45 from "./gov/v1beta1/gov"; +import * as _46 from "./gov/v1beta1/query"; +import * as _47 from "./gov/v1beta1/tx"; +import * as _48 from "./group/module/v1/module"; +import * as _49 from "./mint/module/v1/module"; +import * as _50 from "./nft/module/v1/module"; +import * as _51 from "./orm/module/v1alpha1/module"; +import * as _52 from "./orm/query/v1alpha1/query"; +import * as _53 from "./params/module/v1/module"; +import * as _54 from "./params/v1beta1/params"; +import * as _55 from "./params/v1beta1/query"; +import * as _56 from "./query/v1/query"; +import * as _57 from "./reflection/v1/reflection"; +import * as _58 from "./slashing/module/v1/module"; +import * as _59 from "./staking/module/v1/module"; +import * as _60 from "./staking/v1beta1/authz"; +import * as _61 from "./staking/v1beta1/genesis"; +import * as _62 from "./staking/v1beta1/query"; +import * as _63 from "./staking/v1beta1/staking"; +import * as _64 from "./staking/v1beta1/tx"; +import * as _65 from "./tx/config/v1/config"; +import * as _66 from "./tx/signing/v1beta1/signing"; +import * as _67 from "./tx/v1beta1/service"; +import * as _68 from "./tx/v1beta1/tx"; +import * as _69 from "./upgrade/module/v1/module"; +import * as _70 from "./upgrade/v1beta1/query"; +import * as _71 from "./upgrade/v1beta1/tx"; +import * as _72 from "./upgrade/v1beta1/upgrade"; +import * as _73 from "./vesting/module/v1/module"; +import * as _237 from "./auth/v1beta1/tx.amino"; +import * as _238 from "./authz/v1beta1/tx.amino"; +import * as _239 from "./bank/v1beta1/tx.amino"; +import * as _240 from "./consensus/v1/tx.amino"; +import * as _241 from "./distribution/v1beta1/tx.amino"; +import * as _242 from "./gov/v1beta1/tx.amino"; +import * as _243 from "./staking/v1beta1/tx.amino"; +import * as _244 from "./upgrade/v1beta1/tx.amino"; +import * as _245 from "./auth/v1beta1/tx.registry"; +import * as _246 from "./authz/v1beta1/tx.registry"; +import * as _247 from "./bank/v1beta1/tx.registry"; +import * as _248 from "./consensus/v1/tx.registry"; +import * as _249 from "./distribution/v1beta1/tx.registry"; +import * as _250 from "./gov/v1beta1/tx.registry"; +import * as _251 from "./staking/v1beta1/tx.registry"; +import * as _252 from "./upgrade/v1beta1/tx.registry"; +import * as _253 from "./auth/v1beta1/query.lcd"; +import * as _254 from "./authz/v1beta1/query.lcd"; +import * as _255 from "./bank/v1beta1/query.lcd"; +import * as _256 from "./base/node/v1beta1/query.lcd"; +import * as _257 from "./consensus/v1/query.lcd"; +import * as _258 from "./distribution/v1beta1/query.lcd"; +import * as _259 from "./gov/v1beta1/query.lcd"; +import * as _260 from "./params/v1beta1/query.lcd"; +import * as _261 from "./staking/v1beta1/query.lcd"; +import * as _262 from "./tx/v1beta1/service.lcd"; +import * as _263 from "./upgrade/v1beta1/query.lcd"; +import * as _264 from "./auth/v1beta1/query.rpc.Query"; +import * as _265 from "./authz/v1beta1/query.rpc.Query"; +import * as _266 from "./bank/v1beta1/query.rpc.Query"; +import * as _267 from "./base/node/v1beta1/query.rpc.Service"; +import * as _268 from "./consensus/v1/query.rpc.Query"; +import * as _269 from "./distribution/v1beta1/query.rpc.Query"; +import * as _270 from "./gov/v1beta1/query.rpc.Query"; +import * as _271 from "./orm/query/v1alpha1/query.rpc.Query"; +import * as _272 from "./params/v1beta1/query.rpc.Query"; +import * as _273 from "./staking/v1beta1/query.rpc.Query"; +import * as _274 from "./tx/v1beta1/service.rpc.Service"; +import * as _275 from "./upgrade/v1beta1/query.rpc.Query"; +import * as _276 from "./auth/v1beta1/tx.rpc.msg"; +import * as _277 from "./authz/v1beta1/tx.rpc.msg"; +import * as _278 from "./bank/v1beta1/tx.rpc.msg"; +import * as _279 from "./consensus/v1/tx.rpc.msg"; +import * as _280 from "./distribution/v1beta1/tx.rpc.msg"; +import * as _281 from "./gov/v1beta1/tx.rpc.msg"; +import * as _282 from "./staking/v1beta1/tx.rpc.msg"; +import * as _283 from "./upgrade/v1beta1/tx.rpc.msg"; +import * as _406 from "./lcd"; +import * as _407 from "./rpc.query"; +import * as _408 from "./rpc.tx"; export namespace cosmos { export namespace ics23 { export const v1 = { ..._0 }; } + export namespace app { + export namespace runtime { + export const v1alpha1 = { + ..._1 + }; + } + } export namespace auth { + export namespace module { + export const v1 = { + ..._2 + }; + } export const v1beta1 = { - ..._1, - ..._2, ..._3, - ..._200, - ..._209 - }; - } - export namespace authz { - export const v1beta1 = { ..._4, ..._5, ..._6, - ..._7, - ..._8, - ..._190, - ..._195, - ..._201, - ..._210, - ..._218 + ..._237, + ..._245, + ..._253, + ..._264, + ..._276 }; } - export namespace bank { + export namespace authz { + export namespace module { + export const v1 = { + ..._7 + }; + } export const v1beta1 = { + ..._8, ..._9, ..._10, ..._11, ..._12, - ..._13, - ..._191, - ..._196, - ..._202, - ..._211, - ..._219 + ..._238, + ..._246, + ..._254, + ..._265, + ..._277 + }; + } + export namespace bank { + export namespace module { + export const v1 = { + ..._13 + }; + } + export const v1beta1 = { + ..._14, + ..._15, + ..._16, + ..._17, + ..._18, + ..._239, + ..._247, + ..._255, + ..._266, + ..._278 }; } export namespace base { export namespace abci { export const v1beta1 = { - ..._14 + ..._19 }; } export namespace node { export const v1beta1 = { - ..._15, - ..._203, - ..._212 + ..._20, + ..._256, + ..._267 }; } export namespace query { export const v1beta1 = { - ..._16 + ..._21 }; } export namespace reflection { export const v2alpha1 = { - ..._17 + ..._22 }; } export const v1beta1 = { - ..._18 + ..._23 }; } + export namespace capability { + export namespace module { + export const v1 = { + ..._24 + }; + } + } + export namespace consensus { + export namespace module { + export const v1 = { + ..._25 + }; + } + export const v1 = { + ..._26, + ..._27, + ..._240, + ..._248, + ..._257, + ..._268, + ..._279 + }; + } + export namespace crisis { + export namespace module { + export const v1 = { + ..._28 + }; + } + } export namespace crypto { export const ed25519 = { - ..._19 + ..._29 }; + export namespace hd { + export const v1 = { + ..._30 + }; + } + export namespace keyring { + export const v1 = { + ..._31 + }; + } export const multisig = { - ..._20 + ..._32 }; export const secp256k1 = { - ..._21 + ..._33 }; export const secp256r1 = { - ..._22 + ..._34 }; } export namespace distribution { + export namespace module { + export const v1 = { + ..._35 + }; + } export const v1beta1 = { - ..._23, - ..._24, - ..._25, - ..._26, - ..._192, - ..._197, - ..._204, - ..._213, - ..._220 + ..._36, + ..._37, + ..._38, + ..._39, + ..._241, + ..._249, + ..._258, + ..._269, + ..._280 }; } + export namespace evidence { + export namespace module { + export const v1 = { + ..._40 + }; + } + } + export namespace feegrant { + export namespace module { + export const v1 = { + ..._41 + }; + } + } + export namespace genutil { + export namespace module { + export const v1 = { + ..._42 + }; + } + } export namespace gov { + export namespace module { + export const v1 = { + ..._43 + }; + } export const v1beta1 = { - ..._27, - ..._28, - ..._29, - ..._30, - ..._193, - ..._198, - ..._205, - ..._214, - ..._221 + ..._44, + ..._45, + ..._46, + ..._47, + ..._242, + ..._250, + ..._259, + ..._270, + ..._281 + }; + } + export namespace group { + export namespace module { + export const v1 = { + ..._48 + }; + } + } + export namespace mint { + export namespace module { + export const v1 = { + ..._49 + }; + } + } + export namespace nft { + export namespace module { + export const v1 = { + ..._50 + }; + } + } + export namespace orm { + export namespace module { + export const v1alpha1 = { + ..._51 + }; + } + export namespace query { + export const v1alpha1 = { + ..._52, + ..._271 + }; + } + } + export namespace params { + export namespace module { + export const v1 = { + ..._53 + }; + } + export const v1beta1 = { + ..._54, + ..._55, + ..._260, + ..._272 + }; + } + export namespace query { + export const v1 = { + ..._56 }; } + export namespace reflection { + export const v1 = { + ..._57 + }; + } + export namespace slashing { + export namespace module { + export const v1 = { + ..._58 + }; + } + } export namespace staking { + export namespace module { + export const v1 = { + ..._59 + }; + } export const v1beta1 = { - ..._31, - ..._32, - ..._33, - ..._34, - ..._35, - ..._194, - ..._199, - ..._206, - ..._215, - ..._222 + ..._60, + ..._61, + ..._62, + ..._63, + ..._64, + ..._243, + ..._251, + ..._261, + ..._273, + ..._282 }; } export namespace tx { + export namespace config { + export const v1 = { + ..._65 + }; + } export namespace signing { export const v1beta1 = { - ..._36 + ..._66 }; } export const v1beta1 = { - ..._37, - ..._38, - ..._207, - ..._216 + ..._67, + ..._68, + ..._262, + ..._274 }; } export namespace upgrade { + export namespace module { + export const v1 = { + ..._69 + }; + } export const v1beta1 = { - ..._39, - ..._40, - ..._208, - ..._217 + ..._70, + ..._71, + ..._72, + ..._244, + ..._252, + ..._263, + ..._275, + ..._283 }; } + export namespace vesting { + export namespace module { + export const v1 = { + ..._73 + }; + } + } export const ClientFactory = { - ..._332, - ..._333, - ..._334 + ..._406, + ..._407, + ..._408 }; } \ No newline at end of file diff --git a/packages/osmojs/src/codegen/cosmos/client.ts b/packages/osmojs/src/codegen/cosmos/client.ts index dd1ad8595..278467e8f 100644 --- a/packages/osmojs/src/codegen/cosmos/client.ts +++ b/packages/osmojs/src/codegen/cosmos/client.ts @@ -1,24 +1,33 @@ import { GeneratedType, Registry, OfflineSigner } from "@cosmjs/proto-signing"; import { AminoTypes, SigningStargateClient } from "@cosmjs/stargate"; import { HttpEndpoint } from "@cosmjs/tendermint-rpc"; +import * as cosmosAuthV1beta1TxRegistry from "./auth/v1beta1/tx.registry"; import * as cosmosAuthzV1beta1TxRegistry from "./authz/v1beta1/tx.registry"; import * as cosmosBankV1beta1TxRegistry from "./bank/v1beta1/tx.registry"; +import * as cosmosConsensusV1TxRegistry from "./consensus/v1/tx.registry"; import * as cosmosDistributionV1beta1TxRegistry from "./distribution/v1beta1/tx.registry"; import * as cosmosGovV1beta1TxRegistry from "./gov/v1beta1/tx.registry"; import * as cosmosStakingV1beta1TxRegistry from "./staking/v1beta1/tx.registry"; +import * as cosmosUpgradeV1beta1TxRegistry from "./upgrade/v1beta1/tx.registry"; +import * as cosmosAuthV1beta1TxAmino from "./auth/v1beta1/tx.amino"; import * as cosmosAuthzV1beta1TxAmino from "./authz/v1beta1/tx.amino"; import * as cosmosBankV1beta1TxAmino from "./bank/v1beta1/tx.amino"; +import * as cosmosConsensusV1TxAmino from "./consensus/v1/tx.amino"; import * as cosmosDistributionV1beta1TxAmino from "./distribution/v1beta1/tx.amino"; import * as cosmosGovV1beta1TxAmino from "./gov/v1beta1/tx.amino"; import * as cosmosStakingV1beta1TxAmino from "./staking/v1beta1/tx.amino"; +import * as cosmosUpgradeV1beta1TxAmino from "./upgrade/v1beta1/tx.amino"; export const cosmosAminoConverters = { + ...cosmosAuthV1beta1TxAmino.AminoConverter, ...cosmosAuthzV1beta1TxAmino.AminoConverter, ...cosmosBankV1beta1TxAmino.AminoConverter, + ...cosmosConsensusV1TxAmino.AminoConverter, ...cosmosDistributionV1beta1TxAmino.AminoConverter, ...cosmosGovV1beta1TxAmino.AminoConverter, - ...cosmosStakingV1beta1TxAmino.AminoConverter + ...cosmosStakingV1beta1TxAmino.AminoConverter, + ...cosmosUpgradeV1beta1TxAmino.AminoConverter }; -export const cosmosProtoRegistry: ReadonlyArray<[string, GeneratedType]> = [...cosmosAuthzV1beta1TxRegistry.registry, ...cosmosBankV1beta1TxRegistry.registry, ...cosmosDistributionV1beta1TxRegistry.registry, ...cosmosGovV1beta1TxRegistry.registry, ...cosmosStakingV1beta1TxRegistry.registry]; +export const cosmosProtoRegistry: ReadonlyArray<[string, GeneratedType]> = [...cosmosAuthV1beta1TxRegistry.registry, ...cosmosAuthzV1beta1TxRegistry.registry, ...cosmosBankV1beta1TxRegistry.registry, ...cosmosConsensusV1TxRegistry.registry, ...cosmosDistributionV1beta1TxRegistry.registry, ...cosmosGovV1beta1TxRegistry.registry, ...cosmosStakingV1beta1TxRegistry.registry, ...cosmosUpgradeV1beta1TxRegistry.registry]; export const getSigningCosmosClientOptions = (): { registry: Registry; aminoTypes: AminoTypes; diff --git a/packages/osmojs/src/codegen/cosmos/consensus/v1/query.lcd.ts b/packages/osmojs/src/codegen/cosmos/consensus/v1/query.lcd.ts new file mode 100644 index 000000000..c792c8d86 --- /dev/null +++ b/packages/osmojs/src/codegen/cosmos/consensus/v1/query.lcd.ts @@ -0,0 +1,18 @@ +import { LCDClient } from "@cosmology/lcd"; +import { QueryParamsRequest, QueryParamsResponseSDKType } from "./query"; +export class LCDQueryClient { + req: LCDClient; + constructor({ + requestClient + }: { + requestClient: LCDClient; + }) { + this.req = requestClient; + this.params = this.params.bind(this); + } + /* Params queries the parameters of x/consensus_param module. */ + async params(_params: QueryParamsRequest = {}): Promise { + const endpoint = `cosmos/consensus/v1/params`; + return await this.req.get(endpoint); + } +} \ No newline at end of file diff --git a/packages/osmojs/src/codegen/cosmos/consensus/v1/query.rpc.Query.ts b/packages/osmojs/src/codegen/cosmos/consensus/v1/query.rpc.Query.ts new file mode 100644 index 000000000..714768e5e --- /dev/null +++ b/packages/osmojs/src/codegen/cosmos/consensus/v1/query.rpc.Query.ts @@ -0,0 +1,30 @@ +import { Rpc } from "../../../helpers"; +import { BinaryReader } from "../../../binary"; +import { QueryClient, createProtobufRpcClient } from "@cosmjs/stargate"; +import { QueryParamsRequest, QueryParamsResponse } from "./query"; +/** Query defines the gRPC querier service. */ +export interface Query { + /** Params queries the parameters of x/consensus_param module. */ + params(request?: QueryParamsRequest): Promise; +} +export class QueryClientImpl implements Query { + private readonly rpc: Rpc; + constructor(rpc: Rpc) { + 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.consensus.v1.Query", "Params", data); + return promise.then(data => QueryParamsResponse.decode(new BinaryReader(data))); + } +} +export const createRpcQueryExtension = (base: QueryClient) => { + const rpc = createProtobufRpcClient(base); + const queryService = new QueryClientImpl(rpc); + return { + params(request?: QueryParamsRequest): Promise { + return queryService.params(request); + } + }; +}; \ No newline at end of file diff --git a/packages/osmojs/src/codegen/cosmos/consensus/v1/query.ts b/packages/osmojs/src/codegen/cosmos/consensus/v1/query.ts new file mode 100644 index 000000000..ae48afaa8 --- /dev/null +++ b/packages/osmojs/src/codegen/cosmos/consensus/v1/query.ts @@ -0,0 +1,214 @@ +import { ConsensusParams, ConsensusParamsAmino, ConsensusParamsSDKType } from "../../../tendermint/types/params"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { GlobalDecoderRegistry } from "../../../registry"; +import { isSet } from "../../../helpers"; +/** QueryParamsRequest defines the request type for querying x/consensus parameters. */ +export interface QueryParamsRequest {} +export interface QueryParamsRequestProtoMsg { + typeUrl: "/cosmos.consensus.v1.QueryParamsRequest"; + value: Uint8Array; +} +/** QueryParamsRequest defines the request type for querying x/consensus parameters. */ +export interface QueryParamsRequestAmino {} +export interface QueryParamsRequestAminoMsg { + type: "cosmos-sdk/QueryParamsRequest"; + value: QueryParamsRequestAmino; +} +/** QueryParamsRequest defines the request type for querying x/consensus parameters. */ +export interface QueryParamsRequestSDKType {} +/** QueryParamsResponse defines the response type for querying x/consensus parameters. */ +export interface QueryParamsResponse { + /** + * params are the tendermint consensus params stored in the consensus module. + * Please note that `params.version` is not populated in this response, it is + * tracked separately in the x/upgrade module. + */ + params?: ConsensusParams; +} +export interface QueryParamsResponseProtoMsg { + typeUrl: "/cosmos.consensus.v1.QueryParamsResponse"; + value: Uint8Array; +} +/** QueryParamsResponse defines the response type for querying x/consensus parameters. */ +export interface QueryParamsResponseAmino { + /** + * params are the tendermint consensus params stored in the consensus module. + * Please note that `params.version` is not populated in this response, it is + * tracked separately in the x/upgrade module. + */ + params?: ConsensusParamsAmino; +} +export interface QueryParamsResponseAminoMsg { + type: "cosmos-sdk/QueryParamsResponse"; + value: QueryParamsResponseAmino; +} +/** QueryParamsResponse defines the response type for querying x/consensus parameters. */ +export interface QueryParamsResponseSDKType { + params?: ConsensusParamsSDKType; +} +function createBaseQueryParamsRequest(): QueryParamsRequest { + return {}; +} +export const QueryParamsRequest = { + typeUrl: "/cosmos.consensus.v1.QueryParamsRequest", + aminoType: "cosmos-sdk/QueryParamsRequest", + is(o: any): o is QueryParamsRequest { + return o && o.$typeUrl === QueryParamsRequest.typeUrl; + }, + isSDK(o: any): o is QueryParamsRequestSDKType { + return o && o.$typeUrl === QueryParamsRequest.typeUrl; + }, + isAmino(o: any): o is QueryParamsRequestAmino { + return o && o.$typeUrl === QueryParamsRequest.typeUrl; + }, + encode(_: QueryParamsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryParamsRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryParamsRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(_: any): QueryParamsRequest { + return {}; + }, + toJSON(_: QueryParamsRequest): unknown { + const obj: any = {}; + return obj; + }, + fromPartial(_: Partial): QueryParamsRequest { + const message = createBaseQueryParamsRequest(); + return message; + }, + fromAmino(_: QueryParamsRequestAmino): QueryParamsRequest { + const message = createBaseQueryParamsRequest(); + return message; + }, + toAmino(_: QueryParamsRequest): QueryParamsRequestAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: QueryParamsRequestAminoMsg): QueryParamsRequest { + return QueryParamsRequest.fromAmino(object.value); + }, + toAminoMsg(message: QueryParamsRequest): QueryParamsRequestAminoMsg { + return { + type: "cosmos-sdk/QueryParamsRequest", + value: QueryParamsRequest.toAmino(message) + }; + }, + fromProtoMsg(message: QueryParamsRequestProtoMsg): QueryParamsRequest { + return QueryParamsRequest.decode(message.value); + }, + toProto(message: QueryParamsRequest): Uint8Array { + return QueryParamsRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryParamsRequest): QueryParamsRequestProtoMsg { + return { + typeUrl: "/cosmos.consensus.v1.QueryParamsRequest", + value: QueryParamsRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryParamsRequest.typeUrl, QueryParamsRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryParamsRequest.aminoType, QueryParamsRequest.typeUrl); +function createBaseQueryParamsResponse(): QueryParamsResponse { + return { + params: undefined + }; +} +export const QueryParamsResponse = { + typeUrl: "/cosmos.consensus.v1.QueryParamsResponse", + aminoType: "cosmos-sdk/QueryParamsResponse", + is(o: any): o is QueryParamsResponse { + return o && o.$typeUrl === QueryParamsResponse.typeUrl; + }, + isSDK(o: any): o is QueryParamsResponseSDKType { + return o && o.$typeUrl === QueryParamsResponse.typeUrl; + }, + isAmino(o: any): o is QueryParamsResponseAmino { + return o && o.$typeUrl === QueryParamsResponse.typeUrl; + }, + encode(message: QueryParamsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.params !== undefined) { + ConsensusParams.encode(message.params, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryParamsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryParamsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.params = ConsensusParams.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): QueryParamsResponse { + return { + params: isSet(object.params) ? ConsensusParams.fromJSON(object.params) : undefined + }; + }, + toJSON(message: QueryParamsResponse): unknown { + const obj: any = {}; + message.params !== undefined && (obj.params = message.params ? ConsensusParams.toJSON(message.params) : undefined); + return obj; + }, + fromPartial(object: Partial): QueryParamsResponse { + const message = createBaseQueryParamsResponse(); + message.params = object.params !== undefined && object.params !== null ? ConsensusParams.fromPartial(object.params) : undefined; + return message; + }, + fromAmino(object: QueryParamsResponseAmino): QueryParamsResponse { + const message = createBaseQueryParamsResponse(); + if (object.params !== undefined && object.params !== null) { + message.params = ConsensusParams.fromAmino(object.params); + } + return message; + }, + toAmino(message: QueryParamsResponse): QueryParamsResponseAmino { + const obj: any = {}; + obj.params = message.params ? ConsensusParams.toAmino(message.params) : undefined; + return obj; + }, + fromAminoMsg(object: QueryParamsResponseAminoMsg): QueryParamsResponse { + return QueryParamsResponse.fromAmino(object.value); + }, + toAminoMsg(message: QueryParamsResponse): QueryParamsResponseAminoMsg { + return { + type: "cosmos-sdk/QueryParamsResponse", + value: QueryParamsResponse.toAmino(message) + }; + }, + fromProtoMsg(message: QueryParamsResponseProtoMsg): QueryParamsResponse { + return QueryParamsResponse.decode(message.value); + }, + toProto(message: QueryParamsResponse): Uint8Array { + return QueryParamsResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryParamsResponse): QueryParamsResponseProtoMsg { + return { + typeUrl: "/cosmos.consensus.v1.QueryParamsResponse", + value: QueryParamsResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryParamsResponse.typeUrl, QueryParamsResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryParamsResponse.aminoType, QueryParamsResponse.typeUrl); \ No newline at end of file diff --git a/packages/osmojs/src/codegen/cosmos/consensus/v1/tx.amino.ts b/packages/osmojs/src/codegen/cosmos/consensus/v1/tx.amino.ts new file mode 100644 index 000000000..b965006c6 --- /dev/null +++ b/packages/osmojs/src/codegen/cosmos/consensus/v1/tx.amino.ts @@ -0,0 +1,9 @@ +//@ts-nocheck +import { MsgUpdateParams } from "./tx"; +export const AminoConverter = { + "/cosmos.consensus.v1.MsgUpdateParams": { + aminoType: "cosmos-sdk/MsgUpdateParams", + toAmino: MsgUpdateParams.toAmino, + fromAmino: MsgUpdateParams.fromAmino + } +}; \ No newline at end of file diff --git a/packages/osmojs/src/codegen/cosmos/consensus/v1/tx.registry.ts b/packages/osmojs/src/codegen/cosmos/consensus/v1/tx.registry.ts new file mode 100644 index 000000000..937b00fb2 --- /dev/null +++ b/packages/osmojs/src/codegen/cosmos/consensus/v1/tx.registry.ts @@ -0,0 +1,51 @@ +//@ts-nocheck +import { GeneratedType, Registry } from "@cosmjs/proto-signing"; +import { MsgUpdateParams } from "./tx"; +export const registry: ReadonlyArray<[string, GeneratedType]> = [["/cosmos.consensus.v1.MsgUpdateParams", MsgUpdateParams]]; +export const load = (protoRegistry: Registry) => { + registry.forEach(([typeUrl, mod]) => { + protoRegistry.register(typeUrl, mod); + }); +}; +export const MessageComposer = { + encoded: { + updateParams(value: MsgUpdateParams) { + return { + typeUrl: "/cosmos.consensus.v1.MsgUpdateParams", + value: MsgUpdateParams.encode(value).finish() + }; + } + }, + withTypeUrl: { + updateParams(value: MsgUpdateParams) { + return { + typeUrl: "/cosmos.consensus.v1.MsgUpdateParams", + value + }; + } + }, + toJSON: { + updateParams(value: MsgUpdateParams) { + return { + typeUrl: "/cosmos.consensus.v1.MsgUpdateParams", + value: MsgUpdateParams.toJSON(value) + }; + } + }, + fromJSON: { + updateParams(value: any) { + return { + typeUrl: "/cosmos.consensus.v1.MsgUpdateParams", + value: MsgUpdateParams.fromJSON(value) + }; + } + }, + fromPartial: { + updateParams(value: MsgUpdateParams) { + return { + typeUrl: "/cosmos.consensus.v1.MsgUpdateParams", + value: MsgUpdateParams.fromPartial(value) + }; + } + } +}; \ No newline at end of file diff --git a/packages/osmojs/src/codegen/cosmos/consensus/v1/tx.rpc.msg.ts b/packages/osmojs/src/codegen/cosmos/consensus/v1/tx.rpc.msg.ts new file mode 100644 index 000000000..495a2b2de --- /dev/null +++ b/packages/osmojs/src/codegen/cosmos/consensus/v1/tx.rpc.msg.ts @@ -0,0 +1,28 @@ +import { Rpc } from "../../../helpers"; +import { BinaryReader } from "../../../binary"; +import { MsgUpdateParams, MsgUpdateParamsResponse } from "./tx"; +/** Msg defines the bank Msg service. */ +export interface Msg { + /** + * UpdateParams defines a governance operation for updating the x/consensus_param module parameters. + * The authority is defined in the keeper. + * + * Since: cosmos-sdk 0.47 + */ + updateParams(request: MsgUpdateParams): Promise; +} +export class MsgClientImpl implements Msg { + private readonly rpc: Rpc; + constructor(rpc: Rpc) { + this.rpc = rpc; + this.updateParams = this.updateParams.bind(this); + } + updateParams(request: MsgUpdateParams): Promise { + const data = MsgUpdateParams.encode(request).finish(); + const promise = this.rpc.request("cosmos.consensus.v1.Msg", "UpdateParams", data); + return promise.then(data => MsgUpdateParamsResponse.decode(new BinaryReader(data))); + } +} +export const createClientImpl = (rpc: Rpc) => { + return new MsgClientImpl(rpc); +}; \ No newline at end of file diff --git a/packages/osmojs/src/codegen/cosmos/consensus/v1/tx.ts b/packages/osmojs/src/codegen/cosmos/consensus/v1/tx.ts new file mode 100644 index 000000000..895a9ad3a --- /dev/null +++ b/packages/osmojs/src/codegen/cosmos/consensus/v1/tx.ts @@ -0,0 +1,280 @@ +import { BlockParams, BlockParamsAmino, BlockParamsSDKType, EvidenceParams, EvidenceParamsAmino, EvidenceParamsSDKType, ValidatorParams, ValidatorParamsAmino, ValidatorParamsSDKType } from "../../../tendermint/types/params"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { isSet } from "../../../helpers"; +import { GlobalDecoderRegistry } from "../../../registry"; +/** MsgUpdateParams is the Msg/UpdateParams request type. */ +export interface MsgUpdateParams { + /** authority is the address that controls the module (defaults to x/gov unless overwritten). */ + authority: string; + /** + * params defines the x/consensus parameters to update. + * VersionsParams is not included in this Msg because it is tracked + * separarately in x/upgrade. + * + * NOTE: All parameters must be supplied. + */ + block?: BlockParams; + evidence?: EvidenceParams; + validator?: ValidatorParams; +} +export interface MsgUpdateParamsProtoMsg { + typeUrl: "/cosmos.consensus.v1.MsgUpdateParams"; + value: Uint8Array; +} +/** MsgUpdateParams is the Msg/UpdateParams request type. */ +export interface MsgUpdateParamsAmino { + /** authority is the address that controls the module (defaults to x/gov unless overwritten). */ + authority?: string; + /** + * params defines the x/consensus parameters to update. + * VersionsParams is not included in this Msg because it is tracked + * separarately in x/upgrade. + * + * NOTE: All parameters must be supplied. + */ + block?: BlockParamsAmino; + evidence?: EvidenceParamsAmino; + validator?: ValidatorParamsAmino; +} +export interface MsgUpdateParamsAminoMsg { + type: "cosmos-sdk/MsgUpdateParams"; + value: MsgUpdateParamsAmino; +} +/** MsgUpdateParams is the Msg/UpdateParams request type. */ +export interface MsgUpdateParamsSDKType { + authority: string; + block?: BlockParamsSDKType; + evidence?: EvidenceParamsSDKType; + validator?: ValidatorParamsSDKType; +} +/** + * MsgUpdateParamsResponse defines the response structure for executing a + * MsgUpdateParams message. + */ +export interface MsgUpdateParamsResponse {} +export interface MsgUpdateParamsResponseProtoMsg { + typeUrl: "/cosmos.consensus.v1.MsgUpdateParamsResponse"; + value: Uint8Array; +} +/** + * MsgUpdateParamsResponse defines the response structure for executing a + * MsgUpdateParams message. + */ +export interface MsgUpdateParamsResponseAmino {} +export interface MsgUpdateParamsResponseAminoMsg { + type: "cosmos-sdk/MsgUpdateParamsResponse"; + value: MsgUpdateParamsResponseAmino; +} +/** + * MsgUpdateParamsResponse defines the response structure for executing a + * MsgUpdateParams message. + */ +export interface MsgUpdateParamsResponseSDKType {} +function createBaseMsgUpdateParams(): MsgUpdateParams { + return { + authority: "", + block: undefined, + evidence: undefined, + validator: undefined + }; +} +export const MsgUpdateParams = { + typeUrl: "/cosmos.consensus.v1.MsgUpdateParams", + aminoType: "cosmos-sdk/MsgUpdateParams", + is(o: any): o is MsgUpdateParams { + return o && (o.$typeUrl === MsgUpdateParams.typeUrl || typeof o.authority === "string"); + }, + isSDK(o: any): o is MsgUpdateParamsSDKType { + return o && (o.$typeUrl === MsgUpdateParams.typeUrl || typeof o.authority === "string"); + }, + isAmino(o: any): o is MsgUpdateParamsAmino { + return o && (o.$typeUrl === MsgUpdateParams.typeUrl || typeof o.authority === "string"); + }, + encode(message: MsgUpdateParams, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.authority !== "") { + writer.uint32(10).string(message.authority); + } + if (message.block !== undefined) { + BlockParams.encode(message.block, writer.uint32(18).fork()).ldelim(); + } + if (message.evidence !== undefined) { + EvidenceParams.encode(message.evidence, writer.uint32(26).fork()).ldelim(); + } + if (message.validator !== undefined) { + ValidatorParams.encode(message.validator, writer.uint32(34).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgUpdateParams { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUpdateParams(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.authority = reader.string(); + break; + case 2: + message.block = BlockParams.decode(reader, reader.uint32()); + break; + case 3: + message.evidence = EvidenceParams.decode(reader, reader.uint32()); + break; + case 4: + message.validator = ValidatorParams.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): MsgUpdateParams { + return { + authority: isSet(object.authority) ? String(object.authority) : "", + 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 + }; + }, + toJSON(message: MsgUpdateParams): unknown { + const obj: any = {}; + message.authority !== undefined && (obj.authority = message.authority); + message.block !== undefined && (obj.block = message.block ? BlockParams.toJSON(message.block) : undefined); + message.evidence !== undefined && (obj.evidence = message.evidence ? EvidenceParams.toJSON(message.evidence) : undefined); + message.validator !== undefined && (obj.validator = message.validator ? ValidatorParams.toJSON(message.validator) : undefined); + return obj; + }, + fromPartial(object: Partial): MsgUpdateParams { + const message = createBaseMsgUpdateParams(); + message.authority = object.authority ?? ""; + 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; + return message; + }, + fromAmino(object: MsgUpdateParamsAmino): MsgUpdateParams { + const message = createBaseMsgUpdateParams(); + if (object.authority !== undefined && object.authority !== null) { + message.authority = object.authority; + } + if (object.block !== undefined && object.block !== null) { + message.block = BlockParams.fromAmino(object.block); + } + if (object.evidence !== undefined && object.evidence !== null) { + message.evidence = EvidenceParams.fromAmino(object.evidence); + } + if (object.validator !== undefined && object.validator !== null) { + message.validator = ValidatorParams.fromAmino(object.validator); + } + return message; + }, + toAmino(message: MsgUpdateParams): MsgUpdateParamsAmino { + const obj: any = {}; + obj.authority = message.authority; + obj.block = message.block ? BlockParams.toAmino(message.block) : undefined; + obj.evidence = message.evidence ? EvidenceParams.toAmino(message.evidence) : undefined; + obj.validator = message.validator ? ValidatorParams.toAmino(message.validator) : undefined; + return obj; + }, + fromAminoMsg(object: MsgUpdateParamsAminoMsg): MsgUpdateParams { + return MsgUpdateParams.fromAmino(object.value); + }, + toAminoMsg(message: MsgUpdateParams): MsgUpdateParamsAminoMsg { + return { + type: "cosmos-sdk/MsgUpdateParams", + value: MsgUpdateParams.toAmino(message) + }; + }, + fromProtoMsg(message: MsgUpdateParamsProtoMsg): MsgUpdateParams { + return MsgUpdateParams.decode(message.value); + }, + toProto(message: MsgUpdateParams): Uint8Array { + return MsgUpdateParams.encode(message).finish(); + }, + toProtoMsg(message: MsgUpdateParams): MsgUpdateParamsProtoMsg { + return { + typeUrl: "/cosmos.consensus.v1.MsgUpdateParams", + value: MsgUpdateParams.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgUpdateParams.typeUrl, MsgUpdateParams); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgUpdateParams.aminoType, MsgUpdateParams.typeUrl); +function createBaseMsgUpdateParamsResponse(): MsgUpdateParamsResponse { + return {}; +} +export const MsgUpdateParamsResponse = { + typeUrl: "/cosmos.consensus.v1.MsgUpdateParamsResponse", + aminoType: "cosmos-sdk/MsgUpdateParamsResponse", + is(o: any): o is MsgUpdateParamsResponse { + return o && o.$typeUrl === MsgUpdateParamsResponse.typeUrl; + }, + isSDK(o: any): o is MsgUpdateParamsResponseSDKType { + return o && o.$typeUrl === MsgUpdateParamsResponse.typeUrl; + }, + isAmino(o: any): o is MsgUpdateParamsResponseAmino { + return o && o.$typeUrl === MsgUpdateParamsResponse.typeUrl; + }, + encode(_: MsgUpdateParamsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgUpdateParamsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUpdateParamsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(_: any): MsgUpdateParamsResponse { + return {}; + }, + toJSON(_: MsgUpdateParamsResponse): unknown { + const obj: any = {}; + return obj; + }, + fromPartial(_: Partial): MsgUpdateParamsResponse { + const message = createBaseMsgUpdateParamsResponse(); + return message; + }, + fromAmino(_: MsgUpdateParamsResponseAmino): MsgUpdateParamsResponse { + const message = createBaseMsgUpdateParamsResponse(); + return message; + }, + toAmino(_: MsgUpdateParamsResponse): MsgUpdateParamsResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgUpdateParamsResponseAminoMsg): MsgUpdateParamsResponse { + return MsgUpdateParamsResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgUpdateParamsResponse): MsgUpdateParamsResponseAminoMsg { + return { + type: "cosmos-sdk/MsgUpdateParamsResponse", + value: MsgUpdateParamsResponse.toAmino(message) + }; + }, + fromProtoMsg(message: MsgUpdateParamsResponseProtoMsg): MsgUpdateParamsResponse { + return MsgUpdateParamsResponse.decode(message.value); + }, + toProto(message: MsgUpdateParamsResponse): Uint8Array { + return MsgUpdateParamsResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgUpdateParamsResponse): MsgUpdateParamsResponseProtoMsg { + return { + typeUrl: "/cosmos.consensus.v1.MsgUpdateParamsResponse", + value: MsgUpdateParamsResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgUpdateParamsResponse.typeUrl, MsgUpdateParamsResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgUpdateParamsResponse.aminoType, MsgUpdateParamsResponse.typeUrl); \ No newline at end of file diff --git a/packages/osmojs/src/codegen/cosmos/crypto/ed25519/keys.ts b/packages/osmojs/src/codegen/cosmos/crypto/ed25519/keys.ts index 41183b75d..80abdd08a 100644 --- a/packages/osmojs/src/codegen/cosmos/crypto/ed25519/keys.ts +++ b/packages/osmojs/src/codegen/cosmos/crypto/ed25519/keys.ts @@ -1,4 +1,6 @@ import { BinaryReader, BinaryWriter } from "../../../binary"; +import { isSet, bytesFromBase64, base64FromBytes } from "../../../helpers"; +import { GlobalDecoderRegistry } from "../../../registry"; /** * PubKey is an ed25519 public key for handling Tendermint keys in SDK. * It's needed for Any serialization and SDK compatibility. @@ -21,7 +23,7 @@ export interface PubKeyProtoMsg { * then you must create a new proto message and follow ADR-28 for Address construction. */ export interface PubKeyAmino { - key: Uint8Array; + key?: string; } export interface PubKeyAminoMsg { type: "tendermint/PubKeyEd25519"; @@ -53,7 +55,7 @@ export interface PrivKeyProtoMsg { * NOTE: ed25519 keys must not be used in SDK apps except in a tendermint validator context. */ export interface PrivKeyAmino { - key: Uint8Array; + key?: string; } export interface PrivKeyAminoMsg { type: "tendermint/PrivKeyEd25519"; @@ -73,6 +75,16 @@ function createBasePubKey(): PubKey { } export const PubKey = { typeUrl: "/cosmos.crypto.ed25519.PubKey", + aminoType: "tendermint/PubKeyEd25519", + is(o: any): o is PubKey { + return o && (o.$typeUrl === PubKey.typeUrl || o.key instanceof Uint8Array || typeof o.key === "string"); + }, + isSDK(o: any): o is PubKeySDKType { + return o && (o.$typeUrl === PubKey.typeUrl || o.key instanceof Uint8Array || typeof o.key === "string"); + }, + isAmino(o: any): o is PubKeyAmino { + return o && (o.$typeUrl === PubKey.typeUrl || o.key instanceof Uint8Array || typeof o.key === "string"); + }, encode(message: PubKey, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.key.length !== 0) { writer.uint32(10).bytes(message.key); @@ -96,19 +108,31 @@ export const PubKey = { } return message; }, + fromJSON(object: any): PubKey { + return { + key: isSet(object.key) ? bytesFromBase64(object.key) : new Uint8Array() + }; + }, + toJSON(message: PubKey): unknown { + const obj: any = {}; + message.key !== undefined && (obj.key = base64FromBytes(message.key !== undefined ? message.key : new Uint8Array())); + return obj; + }, fromPartial(object: Partial): PubKey { const message = createBasePubKey(); message.key = object.key ?? new Uint8Array(); return message; }, fromAmino(object: PubKeyAmino): PubKey { - return { - key: object.key - }; + const message = createBasePubKey(); + if (object.key !== undefined && object.key !== null) { + message.key = bytesFromBase64(object.key); + } + return message; }, toAmino(message: PubKey): PubKeyAmino { const obj: any = {}; - obj.key = message.key; + obj.key = message.key ? base64FromBytes(message.key) : undefined; return obj; }, fromAminoMsg(object: PubKeyAminoMsg): PubKey { @@ -133,6 +157,8 @@ export const PubKey = { }; } }; +GlobalDecoderRegistry.register(PubKey.typeUrl, PubKey); +GlobalDecoderRegistry.registerAminoProtoMapping(PubKey.aminoType, PubKey.typeUrl); function createBasePrivKey(): PrivKey { return { key: new Uint8Array() @@ -140,6 +166,16 @@ function createBasePrivKey(): PrivKey { } export const PrivKey = { typeUrl: "/cosmos.crypto.ed25519.PrivKey", + aminoType: "tendermint/PrivKeyEd25519", + is(o: any): o is PrivKey { + return o && (o.$typeUrl === PrivKey.typeUrl || o.key instanceof Uint8Array || typeof o.key === "string"); + }, + isSDK(o: any): o is PrivKeySDKType { + return o && (o.$typeUrl === PrivKey.typeUrl || o.key instanceof Uint8Array || typeof o.key === "string"); + }, + isAmino(o: any): o is PrivKeyAmino { + return o && (o.$typeUrl === PrivKey.typeUrl || o.key instanceof Uint8Array || typeof o.key === "string"); + }, encode(message: PrivKey, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.key.length !== 0) { writer.uint32(10).bytes(message.key); @@ -163,19 +199,31 @@ export const PrivKey = { } return message; }, + fromJSON(object: any): PrivKey { + return { + key: isSet(object.key) ? bytesFromBase64(object.key) : new Uint8Array() + }; + }, + toJSON(message: PrivKey): unknown { + const obj: any = {}; + message.key !== undefined && (obj.key = base64FromBytes(message.key !== undefined ? message.key : new Uint8Array())); + return obj; + }, fromPartial(object: Partial): PrivKey { const message = createBasePrivKey(); message.key = object.key ?? new Uint8Array(); return message; }, fromAmino(object: PrivKeyAmino): PrivKey { - return { - key: object.key - }; + const message = createBasePrivKey(); + if (object.key !== undefined && object.key !== null) { + message.key = bytesFromBase64(object.key); + } + return message; }, toAmino(message: PrivKey): PrivKeyAmino { const obj: any = {}; - obj.key = message.key; + obj.key = message.key ? base64FromBytes(message.key) : undefined; return obj; }, fromAminoMsg(object: PrivKeyAminoMsg): PrivKey { @@ -199,4 +247,6 @@ export const PrivKey = { value: PrivKey.encode(message).finish() }; } -}; \ No newline at end of file +}; +GlobalDecoderRegistry.register(PrivKey.typeUrl, PrivKey); +GlobalDecoderRegistry.registerAminoProtoMapping(PrivKey.aminoType, PrivKey.typeUrl); \ No newline at end of file diff --git a/packages/osmojs/src/codegen/cosmos/crypto/hd/v1/hd.ts b/packages/osmojs/src/codegen/cosmos/crypto/hd/v1/hd.ts new file mode 100644 index 000000000..7a6e33854 --- /dev/null +++ b/packages/osmojs/src/codegen/cosmos/crypto/hd/v1/hd.ts @@ -0,0 +1,198 @@ +import { BinaryReader, BinaryWriter } from "../../../../binary"; +import { isSet } from "../../../../helpers"; +import { GlobalDecoderRegistry } from "../../../../registry"; +/** BIP44Params is used as path field in ledger item in Record. */ +export interface BIP44Params { + /** purpose is a constant set to 44' (or 0x8000002C) following the BIP43 recommendation */ + purpose: number; + /** coin_type is a constant that improves privacy */ + coinType: number; + /** account splits the key space into independent user identities */ + account: number; + /** + * change is a constant used for public derivation. Constant 0 is used for external chain and constant 1 for internal + * chain. + */ + change: boolean; + /** address_index is used as child index in BIP32 derivation */ + addressIndex: number; +} +export interface BIP44ParamsProtoMsg { + typeUrl: "/cosmos.crypto.hd.v1.BIP44Params"; + value: Uint8Array; +} +/** BIP44Params is used as path field in ledger item in Record. */ +export interface BIP44ParamsAmino { + /** purpose is a constant set to 44' (or 0x8000002C) following the BIP43 recommendation */ + purpose?: number; + /** coin_type is a constant that improves privacy */ + coin_type?: number; + /** account splits the key space into independent user identities */ + account?: number; + /** + * change is a constant used for public derivation. Constant 0 is used for external chain and constant 1 for internal + * chain. + */ + change?: boolean; + /** address_index is used as child index in BIP32 derivation */ + address_index?: number; +} +export interface BIP44ParamsAminoMsg { + type: "crypto/keys/hd/BIP44Params"; + value: BIP44ParamsAmino; +} +/** BIP44Params is used as path field in ledger item in Record. */ +export interface BIP44ParamsSDKType { + purpose: number; + coin_type: number; + account: number; + change: boolean; + address_index: number; +} +function createBaseBIP44Params(): BIP44Params { + return { + purpose: 0, + coinType: 0, + account: 0, + change: false, + addressIndex: 0 + }; +} +export const BIP44Params = { + typeUrl: "/cosmos.crypto.hd.v1.BIP44Params", + aminoType: "crypto/keys/hd/BIP44Params", + is(o: any): o is BIP44Params { + return o && (o.$typeUrl === BIP44Params.typeUrl || typeof o.purpose === "number" && typeof o.coinType === "number" && typeof o.account === "number" && typeof o.change === "boolean" && typeof o.addressIndex === "number"); + }, + isSDK(o: any): o is BIP44ParamsSDKType { + return o && (o.$typeUrl === BIP44Params.typeUrl || typeof o.purpose === "number" && typeof o.coin_type === "number" && typeof o.account === "number" && typeof o.change === "boolean" && typeof o.address_index === "number"); + }, + isAmino(o: any): o is BIP44ParamsAmino { + return o && (o.$typeUrl === BIP44Params.typeUrl || typeof o.purpose === "number" && typeof o.coin_type === "number" && typeof o.account === "number" && typeof o.change === "boolean" && typeof o.address_index === "number"); + }, + encode(message: BIP44Params, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.purpose !== 0) { + writer.uint32(8).uint32(message.purpose); + } + if (message.coinType !== 0) { + writer.uint32(16).uint32(message.coinType); + } + if (message.account !== 0) { + writer.uint32(24).uint32(message.account); + } + if (message.change === true) { + writer.uint32(32).bool(message.change); + } + if (message.addressIndex !== 0) { + writer.uint32(40).uint32(message.addressIndex); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): BIP44Params { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseBIP44Params(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.purpose = reader.uint32(); + break; + case 2: + message.coinType = reader.uint32(); + break; + case 3: + message.account = reader.uint32(); + break; + case 4: + message.change = reader.bool(); + break; + case 5: + message.addressIndex = reader.uint32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): BIP44Params { + return { + purpose: isSet(object.purpose) ? Number(object.purpose) : 0, + coinType: isSet(object.coinType) ? Number(object.coinType) : 0, + account: isSet(object.account) ? Number(object.account) : 0, + change: isSet(object.change) ? Boolean(object.change) : false, + addressIndex: isSet(object.addressIndex) ? Number(object.addressIndex) : 0 + }; + }, + toJSON(message: BIP44Params): unknown { + const obj: any = {}; + message.purpose !== undefined && (obj.purpose = Math.round(message.purpose)); + message.coinType !== undefined && (obj.coinType = Math.round(message.coinType)); + message.account !== undefined && (obj.account = Math.round(message.account)); + message.change !== undefined && (obj.change = message.change); + message.addressIndex !== undefined && (obj.addressIndex = Math.round(message.addressIndex)); + return obj; + }, + fromPartial(object: Partial): BIP44Params { + const message = createBaseBIP44Params(); + message.purpose = object.purpose ?? 0; + message.coinType = object.coinType ?? 0; + message.account = object.account ?? 0; + message.change = object.change ?? false; + message.addressIndex = object.addressIndex ?? 0; + return message; + }, + fromAmino(object: BIP44ParamsAmino): BIP44Params { + const message = createBaseBIP44Params(); + if (object.purpose !== undefined && object.purpose !== null) { + message.purpose = object.purpose; + } + if (object.coin_type !== undefined && object.coin_type !== null) { + message.coinType = object.coin_type; + } + if (object.account !== undefined && object.account !== null) { + message.account = object.account; + } + if (object.change !== undefined && object.change !== null) { + message.change = object.change; + } + if (object.address_index !== undefined && object.address_index !== null) { + message.addressIndex = object.address_index; + } + return message; + }, + toAmino(message: BIP44Params): BIP44ParamsAmino { + const obj: any = {}; + obj.purpose = message.purpose; + obj.coin_type = message.coinType; + obj.account = message.account; + obj.change = message.change; + obj.address_index = message.addressIndex; + return obj; + }, + fromAminoMsg(object: BIP44ParamsAminoMsg): BIP44Params { + return BIP44Params.fromAmino(object.value); + }, + toAminoMsg(message: BIP44Params): BIP44ParamsAminoMsg { + return { + type: "crypto/keys/hd/BIP44Params", + value: BIP44Params.toAmino(message) + }; + }, + fromProtoMsg(message: BIP44ParamsProtoMsg): BIP44Params { + return BIP44Params.decode(message.value); + }, + toProto(message: BIP44Params): Uint8Array { + return BIP44Params.encode(message).finish(); + }, + toProtoMsg(message: BIP44Params): BIP44ParamsProtoMsg { + return { + typeUrl: "/cosmos.crypto.hd.v1.BIP44Params", + value: BIP44Params.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(BIP44Params.typeUrl, BIP44Params); +GlobalDecoderRegistry.registerAminoProtoMapping(BIP44Params.aminoType, BIP44Params.typeUrl); \ No newline at end of file diff --git a/packages/osmojs/src/codegen/cosmos/crypto/keyring/v1/record.ts b/packages/osmojs/src/codegen/cosmos/crypto/keyring/v1/record.ts new file mode 100644 index 000000000..7095a148a --- /dev/null +++ b/packages/osmojs/src/codegen/cosmos/crypto/keyring/v1/record.ts @@ -0,0 +1,622 @@ +import { Any, AnyAmino, AnySDKType } from "../../../../google/protobuf/any"; +import { BIP44Params, BIP44ParamsAmino, BIP44ParamsSDKType } from "../../hd/v1/hd"; +import { BinaryReader, BinaryWriter } from "../../../../binary"; +import { isSet } from "../../../../helpers"; +import { GlobalDecoderRegistry } from "../../../../registry"; +/** Record is used for representing a key in the keyring. */ +export interface Record { + /** name represents a name of Record */ + name: string; + /** pub_key represents a public key in any format */ + pubKey?: Any; + /** local stores the private key locally. */ + local?: Record_Local; + /** ledger stores the information about a Ledger key. */ + ledger?: Record_Ledger; + /** Multi does not store any other information. */ + multi?: Record_Multi; + /** Offline does not store any other information. */ + offline?: Record_Offline; +} +export interface RecordProtoMsg { + typeUrl: "/cosmos.crypto.keyring.v1.Record"; + value: Uint8Array; +} +/** Record is used for representing a key in the keyring. */ +export interface RecordAmino { + /** name represents a name of Record */ + name?: string; + /** pub_key represents a public key in any format */ + pub_key?: AnyAmino; + /** local stores the private key locally. */ + local?: Record_LocalAmino; + /** ledger stores the information about a Ledger key. */ + ledger?: Record_LedgerAmino; + /** Multi does not store any other information. */ + multi?: Record_MultiAmino; + /** Offline does not store any other information. */ + offline?: Record_OfflineAmino; +} +export interface RecordAminoMsg { + type: "cosmos-sdk/Record"; + value: RecordAmino; +} +/** Record is used for representing a key in the keyring. */ +export interface RecordSDKType { + name: string; + pub_key?: AnySDKType; + local?: Record_LocalSDKType; + ledger?: Record_LedgerSDKType; + multi?: Record_MultiSDKType; + offline?: Record_OfflineSDKType; +} +/** + * Item is a keyring item stored in a keyring backend. + * Local item + */ +export interface Record_Local { + privKey?: Any; +} +export interface Record_LocalProtoMsg { + typeUrl: "/cosmos.crypto.keyring.v1.Local"; + value: Uint8Array; +} +/** + * Item is a keyring item stored in a keyring backend. + * Local item + */ +export interface Record_LocalAmino { + priv_key?: AnyAmino; +} +export interface Record_LocalAminoMsg { + type: "cosmos-sdk/Local"; + value: Record_LocalAmino; +} +/** + * Item is a keyring item stored in a keyring backend. + * Local item + */ +export interface Record_LocalSDKType { + priv_key?: AnySDKType; +} +/** Ledger item */ +export interface Record_Ledger { + path?: BIP44Params; +} +export interface Record_LedgerProtoMsg { + typeUrl: "/cosmos.crypto.keyring.v1.Ledger"; + value: Uint8Array; +} +/** Ledger item */ +export interface Record_LedgerAmino { + path?: BIP44ParamsAmino; +} +export interface Record_LedgerAminoMsg { + type: "cosmos-sdk/Ledger"; + value: Record_LedgerAmino; +} +/** Ledger item */ +export interface Record_LedgerSDKType { + path?: BIP44ParamsSDKType; +} +/** Multi item */ +export interface Record_Multi {} +export interface Record_MultiProtoMsg { + typeUrl: "/cosmos.crypto.keyring.v1.Multi"; + value: Uint8Array; +} +/** Multi item */ +export interface Record_MultiAmino {} +export interface Record_MultiAminoMsg { + type: "cosmos-sdk/Multi"; + value: Record_MultiAmino; +} +/** Multi item */ +export interface Record_MultiSDKType {} +/** Offline item */ +export interface Record_Offline {} +export interface Record_OfflineProtoMsg { + typeUrl: "/cosmos.crypto.keyring.v1.Offline"; + value: Uint8Array; +} +/** Offline item */ +export interface Record_OfflineAmino {} +export interface Record_OfflineAminoMsg { + type: "cosmos-sdk/Offline"; + value: Record_OfflineAmino; +} +/** Offline item */ +export interface Record_OfflineSDKType {} +function createBaseRecord(): Record { + return { + name: "", + pubKey: undefined, + local: undefined, + ledger: undefined, + multi: undefined, + offline: undefined + }; +} +export const Record = { + typeUrl: "/cosmos.crypto.keyring.v1.Record", + aminoType: "cosmos-sdk/Record", + is(o: any): o is Record { + return o && (o.$typeUrl === Record.typeUrl || typeof o.name === "string"); + }, + isSDK(o: any): o is RecordSDKType { + return o && (o.$typeUrl === Record.typeUrl || typeof o.name === "string"); + }, + isAmino(o: any): o is RecordAmino { + return o && (o.$typeUrl === Record.typeUrl || typeof o.name === "string"); + }, + encode(message: Record, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.name !== "") { + writer.uint32(10).string(message.name); + } + if (message.pubKey !== undefined) { + Any.encode(message.pubKey, writer.uint32(18).fork()).ldelim(); + } + if (message.local !== undefined) { + Record_Local.encode(message.local, writer.uint32(26).fork()).ldelim(); + } + if (message.ledger !== undefined) { + Record_Ledger.encode(message.ledger, writer.uint32(34).fork()).ldelim(); + } + if (message.multi !== undefined) { + Record_Multi.encode(message.multi, writer.uint32(42).fork()).ldelim(); + } + if (message.offline !== undefined) { + Record_Offline.encode(message.offline, writer.uint32(50).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): Record { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseRecord(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.pubKey = Any.decode(reader, reader.uint32()); + break; + case 3: + message.local = Record_Local.decode(reader, reader.uint32()); + break; + case 4: + message.ledger = Record_Ledger.decode(reader, reader.uint32()); + break; + case 5: + message.multi = Record_Multi.decode(reader, reader.uint32()); + break; + case 6: + message.offline = Record_Offline.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): Record { + return { + name: isSet(object.name) ? String(object.name) : "", + pubKey: isSet(object.pubKey) ? Any.fromJSON(object.pubKey) : undefined, + local: isSet(object.local) ? Record_Local.fromJSON(object.local) : undefined, + ledger: isSet(object.ledger) ? Record_Ledger.fromJSON(object.ledger) : undefined, + multi: isSet(object.multi) ? Record_Multi.fromJSON(object.multi) : undefined, + offline: isSet(object.offline) ? Record_Offline.fromJSON(object.offline) : undefined + }; + }, + toJSON(message: Record): unknown { + const obj: any = {}; + message.name !== undefined && (obj.name = message.name); + message.pubKey !== undefined && (obj.pubKey = message.pubKey ? Any.toJSON(message.pubKey) : undefined); + message.local !== undefined && (obj.local = message.local ? Record_Local.toJSON(message.local) : undefined); + message.ledger !== undefined && (obj.ledger = message.ledger ? Record_Ledger.toJSON(message.ledger) : undefined); + message.multi !== undefined && (obj.multi = message.multi ? Record_Multi.toJSON(message.multi) : undefined); + message.offline !== undefined && (obj.offline = message.offline ? Record_Offline.toJSON(message.offline) : undefined); + return obj; + }, + fromPartial(object: Partial): Record { + const message = createBaseRecord(); + message.name = object.name ?? ""; + message.pubKey = object.pubKey !== undefined && object.pubKey !== null ? Any.fromPartial(object.pubKey) : undefined; + message.local = object.local !== undefined && object.local !== null ? Record_Local.fromPartial(object.local) : undefined; + message.ledger = object.ledger !== undefined && object.ledger !== null ? Record_Ledger.fromPartial(object.ledger) : undefined; + message.multi = object.multi !== undefined && object.multi !== null ? Record_Multi.fromPartial(object.multi) : undefined; + message.offline = object.offline !== undefined && object.offline !== null ? Record_Offline.fromPartial(object.offline) : undefined; + return message; + }, + fromAmino(object: RecordAmino): Record { + const message = createBaseRecord(); + if (object.name !== undefined && object.name !== null) { + message.name = object.name; + } + if (object.pub_key !== undefined && object.pub_key !== null) { + message.pubKey = Any.fromAmino(object.pub_key); + } + if (object.local !== undefined && object.local !== null) { + message.local = Record_Local.fromAmino(object.local); + } + if (object.ledger !== undefined && object.ledger !== null) { + message.ledger = Record_Ledger.fromAmino(object.ledger); + } + if (object.multi !== undefined && object.multi !== null) { + message.multi = Record_Multi.fromAmino(object.multi); + } + if (object.offline !== undefined && object.offline !== null) { + message.offline = Record_Offline.fromAmino(object.offline); + } + return message; + }, + toAmino(message: Record): RecordAmino { + const obj: any = {}; + obj.name = message.name; + obj.pub_key = message.pubKey ? Any.toAmino(message.pubKey) : undefined; + obj.local = message.local ? Record_Local.toAmino(message.local) : undefined; + obj.ledger = message.ledger ? Record_Ledger.toAmino(message.ledger) : undefined; + obj.multi = message.multi ? Record_Multi.toAmino(message.multi) : undefined; + obj.offline = message.offline ? Record_Offline.toAmino(message.offline) : undefined; + return obj; + }, + fromAminoMsg(object: RecordAminoMsg): Record { + return Record.fromAmino(object.value); + }, + toAminoMsg(message: Record): RecordAminoMsg { + return { + type: "cosmos-sdk/Record", + value: Record.toAmino(message) + }; + }, + fromProtoMsg(message: RecordProtoMsg): Record { + return Record.decode(message.value); + }, + toProto(message: Record): Uint8Array { + return Record.encode(message).finish(); + }, + toProtoMsg(message: Record): RecordProtoMsg { + return { + typeUrl: "/cosmos.crypto.keyring.v1.Record", + value: Record.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(Record.typeUrl, Record); +GlobalDecoderRegistry.registerAminoProtoMapping(Record.aminoType, Record.typeUrl); +function createBaseRecord_Local(): Record_Local { + return { + privKey: undefined + }; +} +export const Record_Local = { + typeUrl: "/cosmos.crypto.keyring.v1.Local", + aminoType: "cosmos-sdk/Local", + is(o: any): o is Record_Local { + return o && o.$typeUrl === Record_Local.typeUrl; + }, + isSDK(o: any): o is Record_LocalSDKType { + return o && o.$typeUrl === Record_Local.typeUrl; + }, + isAmino(o: any): o is Record_LocalAmino { + return o && o.$typeUrl === Record_Local.typeUrl; + }, + encode(message: Record_Local, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.privKey !== undefined) { + Any.encode(message.privKey, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): Record_Local { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseRecord_Local(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.privKey = Any.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): Record_Local { + return { + privKey: isSet(object.privKey) ? Any.fromJSON(object.privKey) : undefined + }; + }, + toJSON(message: Record_Local): unknown { + const obj: any = {}; + message.privKey !== undefined && (obj.privKey = message.privKey ? Any.toJSON(message.privKey) : undefined); + return obj; + }, + fromPartial(object: Partial): Record_Local { + const message = createBaseRecord_Local(); + message.privKey = object.privKey !== undefined && object.privKey !== null ? Any.fromPartial(object.privKey) : undefined; + return message; + }, + fromAmino(object: Record_LocalAmino): Record_Local { + const message = createBaseRecord_Local(); + if (object.priv_key !== undefined && object.priv_key !== null) { + message.privKey = Any.fromAmino(object.priv_key); + } + return message; + }, + toAmino(message: Record_Local): Record_LocalAmino { + const obj: any = {}; + obj.priv_key = message.privKey ? Any.toAmino(message.privKey) : undefined; + return obj; + }, + fromAminoMsg(object: Record_LocalAminoMsg): Record_Local { + return Record_Local.fromAmino(object.value); + }, + toAminoMsg(message: Record_Local): Record_LocalAminoMsg { + return { + type: "cosmos-sdk/Local", + value: Record_Local.toAmino(message) + }; + }, + fromProtoMsg(message: Record_LocalProtoMsg): Record_Local { + return Record_Local.decode(message.value); + }, + toProto(message: Record_Local): Uint8Array { + return Record_Local.encode(message).finish(); + }, + toProtoMsg(message: Record_Local): Record_LocalProtoMsg { + return { + typeUrl: "/cosmos.crypto.keyring.v1.Local", + value: Record_Local.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(Record_Local.typeUrl, Record_Local); +GlobalDecoderRegistry.registerAminoProtoMapping(Record_Local.aminoType, Record_Local.typeUrl); +function createBaseRecord_Ledger(): Record_Ledger { + return { + path: undefined + }; +} +export const Record_Ledger = { + typeUrl: "/cosmos.crypto.keyring.v1.Ledger", + aminoType: "cosmos-sdk/Ledger", + is(o: any): o is Record_Ledger { + return o && o.$typeUrl === Record_Ledger.typeUrl; + }, + isSDK(o: any): o is Record_LedgerSDKType { + return o && o.$typeUrl === Record_Ledger.typeUrl; + }, + isAmino(o: any): o is Record_LedgerAmino { + return o && o.$typeUrl === Record_Ledger.typeUrl; + }, + encode(message: Record_Ledger, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.path !== undefined) { + BIP44Params.encode(message.path, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): Record_Ledger { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseRecord_Ledger(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.path = BIP44Params.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): Record_Ledger { + return { + path: isSet(object.path) ? BIP44Params.fromJSON(object.path) : undefined + }; + }, + toJSON(message: Record_Ledger): unknown { + const obj: any = {}; + message.path !== undefined && (obj.path = message.path ? BIP44Params.toJSON(message.path) : undefined); + return obj; + }, + fromPartial(object: Partial): Record_Ledger { + const message = createBaseRecord_Ledger(); + message.path = object.path !== undefined && object.path !== null ? BIP44Params.fromPartial(object.path) : undefined; + return message; + }, + fromAmino(object: Record_LedgerAmino): Record_Ledger { + const message = createBaseRecord_Ledger(); + if (object.path !== undefined && object.path !== null) { + message.path = BIP44Params.fromAmino(object.path); + } + return message; + }, + toAmino(message: Record_Ledger): Record_LedgerAmino { + const obj: any = {}; + obj.path = message.path ? BIP44Params.toAmino(message.path) : undefined; + return obj; + }, + fromAminoMsg(object: Record_LedgerAminoMsg): Record_Ledger { + return Record_Ledger.fromAmino(object.value); + }, + toAminoMsg(message: Record_Ledger): Record_LedgerAminoMsg { + return { + type: "cosmos-sdk/Ledger", + value: Record_Ledger.toAmino(message) + }; + }, + fromProtoMsg(message: Record_LedgerProtoMsg): Record_Ledger { + return Record_Ledger.decode(message.value); + }, + toProto(message: Record_Ledger): Uint8Array { + return Record_Ledger.encode(message).finish(); + }, + toProtoMsg(message: Record_Ledger): Record_LedgerProtoMsg { + return { + typeUrl: "/cosmos.crypto.keyring.v1.Ledger", + value: Record_Ledger.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(Record_Ledger.typeUrl, Record_Ledger); +GlobalDecoderRegistry.registerAminoProtoMapping(Record_Ledger.aminoType, Record_Ledger.typeUrl); +function createBaseRecord_Multi(): Record_Multi { + return {}; +} +export const Record_Multi = { + typeUrl: "/cosmos.crypto.keyring.v1.Multi", + aminoType: "cosmos-sdk/Multi", + is(o: any): o is Record_Multi { + return o && o.$typeUrl === Record_Multi.typeUrl; + }, + isSDK(o: any): o is Record_MultiSDKType { + return o && o.$typeUrl === Record_Multi.typeUrl; + }, + isAmino(o: any): o is Record_MultiAmino { + return o && o.$typeUrl === Record_Multi.typeUrl; + }, + encode(_: Record_Multi, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): Record_Multi { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseRecord_Multi(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(_: any): Record_Multi { + return {}; + }, + toJSON(_: Record_Multi): unknown { + const obj: any = {}; + return obj; + }, + fromPartial(_: Partial): Record_Multi { + const message = createBaseRecord_Multi(); + return message; + }, + fromAmino(_: Record_MultiAmino): Record_Multi { + const message = createBaseRecord_Multi(); + return message; + }, + toAmino(_: Record_Multi): Record_MultiAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: Record_MultiAminoMsg): Record_Multi { + return Record_Multi.fromAmino(object.value); + }, + toAminoMsg(message: Record_Multi): Record_MultiAminoMsg { + return { + type: "cosmos-sdk/Multi", + value: Record_Multi.toAmino(message) + }; + }, + fromProtoMsg(message: Record_MultiProtoMsg): Record_Multi { + return Record_Multi.decode(message.value); + }, + toProto(message: Record_Multi): Uint8Array { + return Record_Multi.encode(message).finish(); + }, + toProtoMsg(message: Record_Multi): Record_MultiProtoMsg { + return { + typeUrl: "/cosmos.crypto.keyring.v1.Multi", + value: Record_Multi.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(Record_Multi.typeUrl, Record_Multi); +GlobalDecoderRegistry.registerAminoProtoMapping(Record_Multi.aminoType, Record_Multi.typeUrl); +function createBaseRecord_Offline(): Record_Offline { + return {}; +} +export const Record_Offline = { + typeUrl: "/cosmos.crypto.keyring.v1.Offline", + aminoType: "cosmos-sdk/Offline", + is(o: any): o is Record_Offline { + return o && o.$typeUrl === Record_Offline.typeUrl; + }, + isSDK(o: any): o is Record_OfflineSDKType { + return o && o.$typeUrl === Record_Offline.typeUrl; + }, + isAmino(o: any): o is Record_OfflineAmino { + return o && o.$typeUrl === Record_Offline.typeUrl; + }, + encode(_: Record_Offline, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): Record_Offline { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseRecord_Offline(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(_: any): Record_Offline { + return {}; + }, + toJSON(_: Record_Offline): unknown { + const obj: any = {}; + return obj; + }, + fromPartial(_: Partial): Record_Offline { + const message = createBaseRecord_Offline(); + return message; + }, + fromAmino(_: Record_OfflineAmino): Record_Offline { + const message = createBaseRecord_Offline(); + return message; + }, + toAmino(_: Record_Offline): Record_OfflineAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: Record_OfflineAminoMsg): Record_Offline { + return Record_Offline.fromAmino(object.value); + }, + toAminoMsg(message: Record_Offline): Record_OfflineAminoMsg { + return { + type: "cosmos-sdk/Offline", + value: Record_Offline.toAmino(message) + }; + }, + fromProtoMsg(message: Record_OfflineProtoMsg): Record_Offline { + return Record_Offline.decode(message.value); + }, + toProto(message: Record_Offline): Uint8Array { + return Record_Offline.encode(message).finish(); + }, + toProtoMsg(message: Record_Offline): Record_OfflineProtoMsg { + return { + typeUrl: "/cosmos.crypto.keyring.v1.Offline", + value: Record_Offline.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(Record_Offline.typeUrl, Record_Offline); +GlobalDecoderRegistry.registerAminoProtoMapping(Record_Offline.aminoType, Record_Offline.typeUrl); \ No newline at end of file diff --git a/packages/osmojs/src/codegen/cosmos/crypto/multisig/keys.ts b/packages/osmojs/src/codegen/cosmos/crypto/multisig/keys.ts index 0bae8b06f..43b71ac33 100644 --- a/packages/osmojs/src/codegen/cosmos/crypto/multisig/keys.ts +++ b/packages/osmojs/src/codegen/cosmos/crypto/multisig/keys.ts @@ -1,5 +1,7 @@ import { Any, AnyAmino, AnySDKType } from "../../../google/protobuf/any"; import { BinaryReader, BinaryWriter } from "../../../binary"; +import { isSet } from "../../../helpers"; +import { GlobalDecoderRegistry } from "../../../registry"; /** * LegacyAminoPubKey specifies a public key type * which nests multiple public keys and a threshold, @@ -19,8 +21,8 @@ export interface LegacyAminoPubKeyProtoMsg { * it uses legacy amino address rules. */ export interface LegacyAminoPubKeyAmino { - threshold: number; - public_keys: AnyAmino[]; + threshold?: number; + public_keys?: AnyAmino[]; } export interface LegacyAminoPubKeyAminoMsg { type: "tendermint/PubKeyMultisigThreshold"; @@ -43,6 +45,16 @@ function createBaseLegacyAminoPubKey(): LegacyAminoPubKey { } export const LegacyAminoPubKey = { typeUrl: "/cosmos.crypto.multisig.LegacyAminoPubKey", + aminoType: "tendermint/PubKeyMultisigThreshold", + is(o: any): o is LegacyAminoPubKey { + return o && (o.$typeUrl === LegacyAminoPubKey.typeUrl || typeof o.threshold === "number" && Array.isArray(o.publicKeys) && (!o.publicKeys.length || Any.is(o.publicKeys[0]))); + }, + isSDK(o: any): o is LegacyAminoPubKeySDKType { + return o && (o.$typeUrl === LegacyAminoPubKey.typeUrl || typeof o.threshold === "number" && Array.isArray(o.public_keys) && (!o.public_keys.length || Any.isSDK(o.public_keys[0]))); + }, + isAmino(o: any): o is LegacyAminoPubKeyAmino { + return o && (o.$typeUrl === LegacyAminoPubKey.typeUrl || typeof o.threshold === "number" && Array.isArray(o.public_keys) && (!o.public_keys.length || Any.isAmino(o.public_keys[0]))); + }, encode(message: LegacyAminoPubKey, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.threshold !== 0) { writer.uint32(8).uint32(message.threshold); @@ -72,6 +84,22 @@ export const LegacyAminoPubKey = { } 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)) : [] + }; + }, + toJSON(message: LegacyAminoPubKey): unknown { + 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); + } else { + obj.publicKeys = []; + } + return obj; + }, fromPartial(object: Partial): LegacyAminoPubKey { const message = createBaseLegacyAminoPubKey(); message.threshold = object.threshold ?? 0; @@ -79,10 +107,12 @@ export const LegacyAminoPubKey = { return message; }, fromAmino(object: LegacyAminoPubKeyAmino): LegacyAminoPubKey { - return { - threshold: object.threshold, - publicKeys: Array.isArray(object?.public_keys) ? object.public_keys.map((e: any) => Any.fromAmino(e)) : [] - }; + const message = createBaseLegacyAminoPubKey(); + if (object.threshold !== undefined && object.threshold !== null) { + message.threshold = object.threshold; + } + message.publicKeys = object.public_keys?.map(e => Any.fromAmino(e)) || []; + return message; }, toAmino(message: LegacyAminoPubKey): LegacyAminoPubKeyAmino { const obj: any = {}; @@ -115,4 +145,6 @@ export const LegacyAminoPubKey = { value: LegacyAminoPubKey.encode(message).finish() }; } -}; \ No newline at end of file +}; +GlobalDecoderRegistry.register(LegacyAminoPubKey.typeUrl, LegacyAminoPubKey); +GlobalDecoderRegistry.registerAminoProtoMapping(LegacyAminoPubKey.aminoType, LegacyAminoPubKey.typeUrl); \ No newline at end of file diff --git a/packages/osmojs/src/codegen/cosmos/crypto/multisig/v1beta1/multisig.ts b/packages/osmojs/src/codegen/cosmos/crypto/multisig/v1beta1/multisig.ts index 9ab89d1dc..34b591d4d 100644 --- a/packages/osmojs/src/codegen/cosmos/crypto/multisig/v1beta1/multisig.ts +++ b/packages/osmojs/src/codegen/cosmos/crypto/multisig/v1beta1/multisig.ts @@ -1,4 +1,6 @@ import { BinaryReader, BinaryWriter } from "../../../../binary"; +import { bytesFromBase64, base64FromBytes, isSet } from "../../../../helpers"; +import { GlobalDecoderRegistry } from "../../../../registry"; /** * MultiSignature wraps the signatures from a multisig.LegacyAminoPubKey. * See cosmos.tx.v1betata1.ModeInfo.Multi for how to specify which signers @@ -17,7 +19,7 @@ export interface MultiSignatureProtoMsg { * signed and with which modes. */ export interface MultiSignatureAmino { - signatures: Uint8Array[]; + signatures?: string[]; } export interface MultiSignatureAminoMsg { type: "cosmos-sdk/MultiSignature"; @@ -52,8 +54,8 @@ export interface CompactBitArrayProtoMsg { * This is not thread safe, and is not intended for concurrent usage. */ export interface CompactBitArrayAmino { - extra_bits_stored: number; - elems: Uint8Array; + extra_bits_stored?: number; + elems?: string; } export interface CompactBitArrayAminoMsg { type: "cosmos-sdk/CompactBitArray"; @@ -76,6 +78,16 @@ function createBaseMultiSignature(): MultiSignature { } export const MultiSignature = { typeUrl: "/cosmos.crypto.multisig.v1beta1.MultiSignature", + aminoType: "cosmos-sdk/MultiSignature", + is(o: any): o is MultiSignature { + return o && (o.$typeUrl === MultiSignature.typeUrl || Array.isArray(o.signatures) && (!o.signatures.length || o.signatures[0] instanceof Uint8Array || typeof o.signatures[0] === "string")); + }, + isSDK(o: any): o is MultiSignatureSDKType { + return o && (o.$typeUrl === MultiSignature.typeUrl || Array.isArray(o.signatures) && (!o.signatures.length || o.signatures[0] instanceof Uint8Array || typeof o.signatures[0] === "string")); + }, + isAmino(o: any): o is MultiSignatureAmino { + return o && (o.$typeUrl === MultiSignature.typeUrl || Array.isArray(o.signatures) && (!o.signatures.length || o.signatures[0] instanceof Uint8Array || typeof o.signatures[0] === "string")); + }, encode(message: MultiSignature, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.signatures) { writer.uint32(10).bytes(v!); @@ -99,20 +111,34 @@ export const MultiSignature = { } return message; }, + fromJSON(object: any): MultiSignature { + return { + signatures: Array.isArray(object?.signatures) ? object.signatures.map((e: any) => bytesFromBase64(e)) : [] + }; + }, + toJSON(message: MultiSignature): unknown { + const obj: any = {}; + if (message.signatures) { + obj.signatures = message.signatures.map(e => base64FromBytes(e !== undefined ? e : new Uint8Array())); + } else { + obj.signatures = []; + } + return obj; + }, fromPartial(object: Partial): MultiSignature { const message = createBaseMultiSignature(); message.signatures = object.signatures?.map(e => e) || []; return message; }, fromAmino(object: MultiSignatureAmino): MultiSignature { - return { - signatures: Array.isArray(object?.signatures) ? object.signatures.map((e: any) => e) : [] - }; + const message = createBaseMultiSignature(); + message.signatures = object.signatures?.map(e => bytesFromBase64(e)) || []; + return message; }, toAmino(message: MultiSignature): MultiSignatureAmino { const obj: any = {}; if (message.signatures) { - obj.signatures = message.signatures.map(e => e); + obj.signatures = message.signatures.map(e => base64FromBytes(e)); } else { obj.signatures = []; } @@ -140,6 +166,8 @@ export const MultiSignature = { }; } }; +GlobalDecoderRegistry.register(MultiSignature.typeUrl, MultiSignature); +GlobalDecoderRegistry.registerAminoProtoMapping(MultiSignature.aminoType, MultiSignature.typeUrl); function createBaseCompactBitArray(): CompactBitArray { return { extraBitsStored: 0, @@ -148,6 +176,16 @@ function createBaseCompactBitArray(): CompactBitArray { } export const CompactBitArray = { typeUrl: "/cosmos.crypto.multisig.v1beta1.CompactBitArray", + aminoType: "cosmos-sdk/CompactBitArray", + is(o: any): o is CompactBitArray { + return o && (o.$typeUrl === CompactBitArray.typeUrl || typeof o.extraBitsStored === "number" && (o.elems instanceof Uint8Array || typeof o.elems === "string")); + }, + isSDK(o: any): o is CompactBitArraySDKType { + return o && (o.$typeUrl === CompactBitArray.typeUrl || typeof o.extra_bits_stored === "number" && (o.elems instanceof Uint8Array || typeof o.elems === "string")); + }, + isAmino(o: any): o is CompactBitArrayAmino { + return o && (o.$typeUrl === CompactBitArray.typeUrl || typeof o.extra_bits_stored === "number" && (o.elems instanceof Uint8Array || typeof o.elems === "string")); + }, encode(message: CompactBitArray, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.extraBitsStored !== 0) { writer.uint32(8).uint32(message.extraBitsStored); @@ -177,6 +215,18 @@ export const CompactBitArray = { } return message; }, + fromJSON(object: any): CompactBitArray { + return { + 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)); + message.elems !== undefined && (obj.elems = base64FromBytes(message.elems !== undefined ? message.elems : new Uint8Array())); + return obj; + }, fromPartial(object: Partial): CompactBitArray { const message = createBaseCompactBitArray(); message.extraBitsStored = object.extraBitsStored ?? 0; @@ -184,15 +234,19 @@ export const CompactBitArray = { return message; }, fromAmino(object: CompactBitArrayAmino): CompactBitArray { - return { - extraBitsStored: object.extra_bits_stored, - elems: object.elems - }; + const message = createBaseCompactBitArray(); + if (object.extra_bits_stored !== undefined && object.extra_bits_stored !== null) { + message.extraBitsStored = object.extra_bits_stored; + } + if (object.elems !== undefined && object.elems !== null) { + message.elems = bytesFromBase64(object.elems); + } + return message; }, toAmino(message: CompactBitArray): CompactBitArrayAmino { const obj: any = {}; obj.extra_bits_stored = message.extraBitsStored; - obj.elems = message.elems; + obj.elems = message.elems ? base64FromBytes(message.elems) : undefined; return obj; }, fromAminoMsg(object: CompactBitArrayAminoMsg): CompactBitArray { @@ -216,4 +270,6 @@ export const CompactBitArray = { value: CompactBitArray.encode(message).finish() }; } -}; \ No newline at end of file +}; +GlobalDecoderRegistry.register(CompactBitArray.typeUrl, CompactBitArray); +GlobalDecoderRegistry.registerAminoProtoMapping(CompactBitArray.aminoType, CompactBitArray.typeUrl); \ No newline at end of file diff --git a/packages/osmojs/src/codegen/cosmos/crypto/secp256k1/keys.ts b/packages/osmojs/src/codegen/cosmos/crypto/secp256k1/keys.ts index 9feac35fb..51ffa54dd 100644 --- a/packages/osmojs/src/codegen/cosmos/crypto/secp256k1/keys.ts +++ b/packages/osmojs/src/codegen/cosmos/crypto/secp256k1/keys.ts @@ -1,4 +1,6 @@ import { BinaryReader, BinaryWriter } from "../../../binary"; +import { isSet, bytesFromBase64, base64FromBytes } from "../../../helpers"; +import { GlobalDecoderRegistry } from "../../../registry"; /** * PubKey defines a secp256k1 public key * Key is the compressed form of the pubkey. The first byte depends is a 0x02 byte @@ -21,7 +23,7 @@ export interface PubKeyProtoMsg { * This prefix is followed with the x-coordinate. */ export interface PubKeyAmino { - key: Uint8Array; + key?: string; } export interface PubKeyAminoMsg { type: "tendermint/PubKeySecp256k1"; @@ -47,7 +49,7 @@ export interface PrivKeyProtoMsg { } /** PrivKey defines a secp256k1 private key. */ export interface PrivKeyAmino { - key: Uint8Array; + key?: string; } export interface PrivKeyAminoMsg { type: "tendermint/PrivKeySecp256k1"; @@ -64,6 +66,16 @@ function createBasePubKey(): PubKey { } export const PubKey = { typeUrl: "/cosmos.crypto.secp256k1.PubKey", + aminoType: "tendermint/PubKeySecp256k1", + is(o: any): o is PubKey { + return o && (o.$typeUrl === PubKey.typeUrl || o.key instanceof Uint8Array || typeof o.key === "string"); + }, + isSDK(o: any): o is PubKeySDKType { + return o && (o.$typeUrl === PubKey.typeUrl || o.key instanceof Uint8Array || typeof o.key === "string"); + }, + isAmino(o: any): o is PubKeyAmino { + return o && (o.$typeUrl === PubKey.typeUrl || o.key instanceof Uint8Array || typeof o.key === "string"); + }, encode(message: PubKey, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.key.length !== 0) { writer.uint32(10).bytes(message.key); @@ -87,19 +99,31 @@ export const PubKey = { } return message; }, + fromJSON(object: any): PubKey { + return { + key: isSet(object.key) ? bytesFromBase64(object.key) : new Uint8Array() + }; + }, + toJSON(message: PubKey): unknown { + const obj: any = {}; + message.key !== undefined && (obj.key = base64FromBytes(message.key !== undefined ? message.key : new Uint8Array())); + return obj; + }, fromPartial(object: Partial): PubKey { const message = createBasePubKey(); message.key = object.key ?? new Uint8Array(); return message; }, fromAmino(object: PubKeyAmino): PubKey { - return { - key: object.key - }; + const message = createBasePubKey(); + if (object.key !== undefined && object.key !== null) { + message.key = bytesFromBase64(object.key); + } + return message; }, toAmino(message: PubKey): PubKeyAmino { const obj: any = {}; - obj.key = message.key; + obj.key = message.key ? base64FromBytes(message.key) : undefined; return obj; }, fromAminoMsg(object: PubKeyAminoMsg): PubKey { @@ -124,6 +148,8 @@ export const PubKey = { }; } }; +GlobalDecoderRegistry.register(PubKey.typeUrl, PubKey); +GlobalDecoderRegistry.registerAminoProtoMapping(PubKey.aminoType, PubKey.typeUrl); function createBasePrivKey(): PrivKey { return { key: new Uint8Array() @@ -131,6 +157,16 @@ function createBasePrivKey(): PrivKey { } export const PrivKey = { typeUrl: "/cosmos.crypto.secp256k1.PrivKey", + aminoType: "tendermint/PrivKeySecp256k1", + is(o: any): o is PrivKey { + return o && (o.$typeUrl === PrivKey.typeUrl || o.key instanceof Uint8Array || typeof o.key === "string"); + }, + isSDK(o: any): o is PrivKeySDKType { + return o && (o.$typeUrl === PrivKey.typeUrl || o.key instanceof Uint8Array || typeof o.key === "string"); + }, + isAmino(o: any): o is PrivKeyAmino { + return o && (o.$typeUrl === PrivKey.typeUrl || o.key instanceof Uint8Array || typeof o.key === "string"); + }, encode(message: PrivKey, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.key.length !== 0) { writer.uint32(10).bytes(message.key); @@ -154,19 +190,31 @@ export const PrivKey = { } return message; }, + fromJSON(object: any): PrivKey { + return { + key: isSet(object.key) ? bytesFromBase64(object.key) : new Uint8Array() + }; + }, + toJSON(message: PrivKey): unknown { + const obj: any = {}; + message.key !== undefined && (obj.key = base64FromBytes(message.key !== undefined ? message.key : new Uint8Array())); + return obj; + }, fromPartial(object: Partial): PrivKey { const message = createBasePrivKey(); message.key = object.key ?? new Uint8Array(); return message; }, fromAmino(object: PrivKeyAmino): PrivKey { - return { - key: object.key - }; + const message = createBasePrivKey(); + if (object.key !== undefined && object.key !== null) { + message.key = bytesFromBase64(object.key); + } + return message; }, toAmino(message: PrivKey): PrivKeyAmino { const obj: any = {}; - obj.key = message.key; + obj.key = message.key ? base64FromBytes(message.key) : undefined; return obj; }, fromAminoMsg(object: PrivKeyAminoMsg): PrivKey { @@ -190,4 +238,6 @@ export const PrivKey = { value: PrivKey.encode(message).finish() }; } -}; \ No newline at end of file +}; +GlobalDecoderRegistry.register(PrivKey.typeUrl, PrivKey); +GlobalDecoderRegistry.registerAminoProtoMapping(PrivKey.aminoType, PrivKey.typeUrl); \ No newline at end of file diff --git a/packages/osmojs/src/codegen/cosmos/crypto/secp256r1/keys.ts b/packages/osmojs/src/codegen/cosmos/crypto/secp256r1/keys.ts index 4888b054b..166a3c0ea 100644 --- a/packages/osmojs/src/codegen/cosmos/crypto/secp256r1/keys.ts +++ b/packages/osmojs/src/codegen/cosmos/crypto/secp256r1/keys.ts @@ -1,4 +1,6 @@ import { BinaryReader, BinaryWriter } from "../../../binary"; +import { isSet, bytesFromBase64, base64FromBytes } from "../../../helpers"; +import { GlobalDecoderRegistry } from "../../../registry"; /** PubKey defines a secp256r1 ECDSA public key. */ export interface PubKey { /** @@ -17,7 +19,7 @@ export interface PubKeyAmino { * 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?: string; } export interface PubKeyAminoMsg { type: "cosmos-sdk/PubKey"; @@ -39,7 +41,7 @@ export interface PrivKeyProtoMsg { /** PrivKey defines a secp256r1 ECDSA private key. */ export interface PrivKeyAmino { /** secret number serialized using big-endian encoding */ - secret: Uint8Array; + secret?: string; } export interface PrivKeyAminoMsg { type: "cosmos-sdk/PrivKey"; @@ -56,6 +58,16 @@ function createBasePubKey(): PubKey { } export const PubKey = { typeUrl: "/cosmos.crypto.secp256r1.PubKey", + aminoType: "cosmos-sdk/PubKey", + is(o: any): o is PubKey { + return o && (o.$typeUrl === PubKey.typeUrl || o.key instanceof Uint8Array || typeof o.key === "string"); + }, + isSDK(o: any): o is PubKeySDKType { + return o && (o.$typeUrl === PubKey.typeUrl || o.key instanceof Uint8Array || typeof o.key === "string"); + }, + isAmino(o: any): o is PubKeyAmino { + return o && (o.$typeUrl === PubKey.typeUrl || o.key instanceof Uint8Array || typeof o.key === "string"); + }, encode(message: PubKey, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.key.length !== 0) { writer.uint32(10).bytes(message.key); @@ -79,19 +91,31 @@ export const PubKey = { } return message; }, + fromJSON(object: any): PubKey { + return { + key: isSet(object.key) ? bytesFromBase64(object.key) : new Uint8Array() + }; + }, + toJSON(message: PubKey): unknown { + const obj: any = {}; + message.key !== undefined && (obj.key = base64FromBytes(message.key !== undefined ? message.key : new Uint8Array())); + return obj; + }, fromPartial(object: Partial): PubKey { const message = createBasePubKey(); message.key = object.key ?? new Uint8Array(); return message; }, fromAmino(object: PubKeyAmino): PubKey { - return { - key: object.key - }; + const message = createBasePubKey(); + if (object.key !== undefined && object.key !== null) { + message.key = bytesFromBase64(object.key); + } + return message; }, toAmino(message: PubKey): PubKeyAmino { const obj: any = {}; - obj.key = message.key; + obj.key = message.key ? base64FromBytes(message.key) : undefined; return obj; }, fromAminoMsg(object: PubKeyAminoMsg): PubKey { @@ -116,6 +140,8 @@ export const PubKey = { }; } }; +GlobalDecoderRegistry.register(PubKey.typeUrl, PubKey); +GlobalDecoderRegistry.registerAminoProtoMapping(PubKey.aminoType, PubKey.typeUrl); function createBasePrivKey(): PrivKey { return { secret: new Uint8Array() @@ -123,6 +149,16 @@ function createBasePrivKey(): PrivKey { } export const PrivKey = { typeUrl: "/cosmos.crypto.secp256r1.PrivKey", + aminoType: "cosmos-sdk/PrivKey", + is(o: any): o is PrivKey { + return o && (o.$typeUrl === PrivKey.typeUrl || o.secret instanceof Uint8Array || typeof o.secret === "string"); + }, + isSDK(o: any): o is PrivKeySDKType { + return o && (o.$typeUrl === PrivKey.typeUrl || o.secret instanceof Uint8Array || typeof o.secret === "string"); + }, + isAmino(o: any): o is PrivKeyAmino { + return o && (o.$typeUrl === PrivKey.typeUrl || o.secret instanceof Uint8Array || typeof o.secret === "string"); + }, encode(message: PrivKey, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.secret.length !== 0) { writer.uint32(10).bytes(message.secret); @@ -146,19 +182,31 @@ export const PrivKey = { } return message; }, + fromJSON(object: any): PrivKey { + return { + secret: isSet(object.secret) ? bytesFromBase64(object.secret) : new Uint8Array() + }; + }, + toJSON(message: PrivKey): unknown { + const obj: any = {}; + message.secret !== undefined && (obj.secret = base64FromBytes(message.secret !== undefined ? message.secret : new Uint8Array())); + return obj; + }, fromPartial(object: Partial): PrivKey { const message = createBasePrivKey(); message.secret = object.secret ?? new Uint8Array(); return message; }, fromAmino(object: PrivKeyAmino): PrivKey { - return { - secret: object.secret - }; + const message = createBasePrivKey(); + if (object.secret !== undefined && object.secret !== null) { + message.secret = bytesFromBase64(object.secret); + } + return message; }, toAmino(message: PrivKey): PrivKeyAmino { const obj: any = {}; - obj.secret = message.secret; + obj.secret = message.secret ? base64FromBytes(message.secret) : undefined; return obj; }, fromAminoMsg(object: PrivKeyAminoMsg): PrivKey { @@ -182,4 +230,6 @@ export const PrivKey = { value: PrivKey.encode(message).finish() }; } -}; \ No newline at end of file +}; +GlobalDecoderRegistry.register(PrivKey.typeUrl, PrivKey); +GlobalDecoderRegistry.registerAminoProtoMapping(PrivKey.aminoType, PrivKey.typeUrl); \ No newline at end of file diff --git a/packages/osmojs/src/codegen/cosmos/distribution/v1beta1/distribution.ts b/packages/osmojs/src/codegen/cosmos/distribution/v1beta1/distribution.ts index cae54cb14..ae2f2f937 100644 --- a/packages/osmojs/src/codegen/cosmos/distribution/v1beta1/distribution.ts +++ b/packages/osmojs/src/codegen/cosmos/distribution/v1beta1/distribution.ts @@ -1,10 +1,22 @@ import { DecCoin, DecCoinAmino, DecCoinSDKType, Coin, CoinAmino, CoinSDKType } from "../../base/v1beta1/coin"; import { BinaryReader, BinaryWriter } from "../../../binary"; import { Decimal } from "@cosmjs/math"; +import { isSet } from "../../../helpers"; +import { GlobalDecoderRegistry } from "../../../registry"; /** Params defines the set of params for the distribution module. */ export interface Params { communityTax: string; + /** + * Deprecated: The base_proposer_reward field is deprecated and is no longer used + * in the x/distribution module's reward mechanism. + */ + /** @deprecated */ baseProposerReward: string; + /** + * Deprecated: The bonus_proposer_reward field is deprecated and is no longer used + * in the x/distribution module's reward mechanism. + */ + /** @deprecated */ bonusProposerReward: string; withdrawAddrEnabled: boolean; } @@ -14,10 +26,20 @@ export interface ParamsProtoMsg { } /** Params defines the set of params for the distribution module. */ export interface ParamsAmino { - community_tax: string; - base_proposer_reward: string; - bonus_proposer_reward: string; - withdraw_addr_enabled: boolean; + community_tax?: string; + /** + * Deprecated: The base_proposer_reward field is deprecated and is no longer used + * in the x/distribution module's reward mechanism. + */ + /** @deprecated */ + base_proposer_reward?: string; + /** + * Deprecated: The bonus_proposer_reward field is deprecated and is no longer used + * in the x/distribution module's reward mechanism. + */ + /** @deprecated */ + bonus_proposer_reward?: string; + withdraw_addr_enabled?: boolean; } export interface ParamsAminoMsg { type: "cosmos-sdk/x/distribution/Params"; @@ -26,7 +48,9 @@ export interface ParamsAminoMsg { /** Params defines the set of params for the distribution module. */ export interface ParamsSDKType { community_tax: string; + /** @deprecated */ base_proposer_reward: string; + /** @deprecated */ bonus_proposer_reward: string; withdraw_addr_enabled: boolean; } @@ -68,7 +92,7 @@ export interface ValidatorHistoricalRewardsProtoMsg { */ export interface ValidatorHistoricalRewardsAmino { cumulative_reward_ratio: DecCoinAmino[]; - reference_count: number; + reference_count?: number; } export interface ValidatorHistoricalRewardsAminoMsg { type: "cosmos-sdk/ValidatorHistoricalRewards"; @@ -112,7 +136,7 @@ export interface ValidatorCurrentRewardsProtoMsg { */ export interface ValidatorCurrentRewardsAmino { rewards: DecCoinAmino[]; - period: string; + period?: string; } export interface ValidatorCurrentRewardsAminoMsg { type: "cosmos-sdk/ValidatorCurrentRewards"; @@ -206,8 +230,8 @@ export interface ValidatorSlashEventProtoMsg { * for delegations which are withdrawn after a slash has occurred. */ export interface ValidatorSlashEventAmino { - validator_period: string; - fraction: string; + validator_period?: string; + fraction?: string; } export interface ValidatorSlashEventAminoMsg { type: "cosmos-sdk/ValidatorSlashEvent"; @@ -267,8 +291,15 @@ export interface FeePoolSDKType { * CommunityPoolSpendProposal details a proposal for use of community funds, * together with how many coins are proposed to be spent, and to which * recipient account. + * + * Deprecated: Do not use. As of the Cosmos SDK release v0.47.x, there is no + * longer a need for an explicit CommunityPoolSpendProposal. To spend community + * pool funds, a simple MsgCommunityPoolSpend can be invoked from the x/gov + * module via a v1 governance proposal. */ +/** @deprecated */ export interface CommunityPoolSpendProposal { + $typeUrl?: "/cosmos.distribution.v1beta1.CommunityPoolSpendProposal"; title: string; description: string; recipient: string; @@ -282,11 +313,17 @@ export interface CommunityPoolSpendProposalProtoMsg { * CommunityPoolSpendProposal details a proposal for use of community funds, * together with how many coins are proposed to be spent, and to which * recipient account. + * + * Deprecated: Do not use. As of the Cosmos SDK release v0.47.x, there is no + * longer a need for an explicit CommunityPoolSpendProposal. To spend community + * pool funds, a simple MsgCommunityPoolSpend can be invoked from the x/gov + * module via a v1 governance proposal. */ +/** @deprecated */ export interface CommunityPoolSpendProposalAmino { - title: string; - description: string; - recipient: string; + title?: string; + description?: string; + recipient?: string; amount: CoinAmino[]; } export interface CommunityPoolSpendProposalAminoMsg { @@ -297,8 +334,15 @@ export interface CommunityPoolSpendProposalAminoMsg { * CommunityPoolSpendProposal details a proposal for use of community funds, * together with how many coins are proposed to be spent, and to which * recipient account. + * + * Deprecated: Do not use. As of the Cosmos SDK release v0.47.x, there is no + * longer a need for an explicit CommunityPoolSpendProposal. To spend community + * pool funds, a simple MsgCommunityPoolSpend can be invoked from the x/gov + * module via a v1 governance proposal. */ +/** @deprecated */ export interface CommunityPoolSpendProposalSDKType { + $typeUrl?: "/cosmos.distribution.v1beta1.CommunityPoolSpendProposal"; title: string; description: string; recipient: string; @@ -330,8 +374,8 @@ export interface DelegatorStartingInfoProtoMsg { * thus sdk.Dec is used. */ export interface DelegatorStartingInfoAmino { - previous_period: string; - stake: string; + previous_period?: string; + stake?: string; height: string; } export interface DelegatorStartingInfoAminoMsg { @@ -368,7 +412,7 @@ export interface DelegationDelegatorRewardProtoMsg { * of a delegator's delegation reward. */ export interface DelegationDelegatorRewardAmino { - validator_address: string; + validator_address?: string; reward: DecCoinAmino[]; } export interface DelegationDelegatorRewardAminoMsg { @@ -388,6 +432,7 @@ export interface DelegationDelegatorRewardSDKType { * with a deposit */ export interface CommunityPoolSpendProposalWithDeposit { + $typeUrl?: "/cosmos.distribution.v1beta1.CommunityPoolSpendProposalWithDeposit"; title: string; description: string; recipient: string; @@ -403,11 +448,11 @@ export interface CommunityPoolSpendProposalWithDepositProtoMsg { * with a deposit */ export interface CommunityPoolSpendProposalWithDepositAmino { - title: string; - description: string; - recipient: string; - amount: string; - deposit: string; + title?: string; + description?: string; + recipient?: string; + amount?: string; + deposit?: string; } export interface CommunityPoolSpendProposalWithDepositAminoMsg { type: "cosmos-sdk/CommunityPoolSpendProposalWithDeposit"; @@ -418,6 +463,7 @@ export interface CommunityPoolSpendProposalWithDepositAminoMsg { * with a deposit */ export interface CommunityPoolSpendProposalWithDepositSDKType { + $typeUrl?: "/cosmos.distribution.v1beta1.CommunityPoolSpendProposalWithDeposit"; title: string; description: string; recipient: string; @@ -434,6 +480,16 @@ function createBaseParams(): Params { } export const Params = { typeUrl: "/cosmos.distribution.v1beta1.Params", + aminoType: "cosmos-sdk/x/distribution/Params", + is(o: any): o is Params { + return o && (o.$typeUrl === Params.typeUrl || typeof o.communityTax === "string" && typeof o.baseProposerReward === "string" && typeof o.bonusProposerReward === "string" && typeof o.withdrawAddrEnabled === "boolean"); + }, + isSDK(o: any): o is ParamsSDKType { + return o && (o.$typeUrl === Params.typeUrl || typeof o.community_tax === "string" && typeof o.base_proposer_reward === "string" && typeof o.bonus_proposer_reward === "string" && typeof o.withdraw_addr_enabled === "boolean"); + }, + isAmino(o: any): o is ParamsAmino { + return o && (o.$typeUrl === Params.typeUrl || typeof o.community_tax === "string" && typeof o.base_proposer_reward === "string" && typeof o.bonus_proposer_reward === "string" && typeof o.withdraw_addr_enabled === "boolean"); + }, encode(message: Params, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.communityTax !== "") { writer.uint32(10).string(Decimal.fromUserInput(message.communityTax, 18).atomics); @@ -475,6 +531,22 @@ export const Params = { } 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 + }; + }, + 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; + }, fromPartial(object: Partial): Params { const message = createBaseParams(); message.communityTax = object.communityTax ?? ""; @@ -484,12 +556,20 @@ export const Params = { return message; }, fromAmino(object: ParamsAmino): Params { - return { - communityTax: object.community_tax, - baseProposerReward: object.base_proposer_reward, - bonusProposerReward: object.bonus_proposer_reward, - withdrawAddrEnabled: object.withdraw_addr_enabled - }; + const message = createBaseParams(); + if (object.community_tax !== undefined && object.community_tax !== null) { + message.communityTax = object.community_tax; + } + if (object.base_proposer_reward !== undefined && object.base_proposer_reward !== null) { + message.baseProposerReward = object.base_proposer_reward; + } + if (object.bonus_proposer_reward !== undefined && object.bonus_proposer_reward !== null) { + message.bonusProposerReward = object.bonus_proposer_reward; + } + if (object.withdraw_addr_enabled !== undefined && object.withdraw_addr_enabled !== null) { + message.withdrawAddrEnabled = object.withdraw_addr_enabled; + } + return message; }, toAmino(message: Params): ParamsAmino { const obj: any = {}; @@ -521,6 +601,8 @@ export const Params = { }; } }; +GlobalDecoderRegistry.register(Params.typeUrl, Params); +GlobalDecoderRegistry.registerAminoProtoMapping(Params.aminoType, Params.typeUrl); function createBaseValidatorHistoricalRewards(): ValidatorHistoricalRewards { return { cumulativeRewardRatio: [], @@ -529,6 +611,16 @@ function createBaseValidatorHistoricalRewards(): ValidatorHistoricalRewards { } export const ValidatorHistoricalRewards = { typeUrl: "/cosmos.distribution.v1beta1.ValidatorHistoricalRewards", + aminoType: "cosmos-sdk/ValidatorHistoricalRewards", + is(o: any): o is ValidatorHistoricalRewards { + return o && (o.$typeUrl === ValidatorHistoricalRewards.typeUrl || Array.isArray(o.cumulativeRewardRatio) && (!o.cumulativeRewardRatio.length || DecCoin.is(o.cumulativeRewardRatio[0])) && typeof o.referenceCount === "number"); + }, + isSDK(o: any): o is ValidatorHistoricalRewardsSDKType { + return o && (o.$typeUrl === ValidatorHistoricalRewards.typeUrl || Array.isArray(o.cumulative_reward_ratio) && (!o.cumulative_reward_ratio.length || DecCoin.isSDK(o.cumulative_reward_ratio[0])) && typeof o.reference_count === "number"); + }, + isAmino(o: any): o is ValidatorHistoricalRewardsAmino { + return o && (o.$typeUrl === ValidatorHistoricalRewards.typeUrl || Array.isArray(o.cumulative_reward_ratio) && (!o.cumulative_reward_ratio.length || DecCoin.isAmino(o.cumulative_reward_ratio[0])) && typeof o.reference_count === "number"); + }, encode(message: ValidatorHistoricalRewards, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.cumulativeRewardRatio) { DecCoin.encode(v!, writer.uint32(10).fork()).ldelim(); @@ -558,6 +650,22 @@ export const ValidatorHistoricalRewards = { } return message; }, + fromJSON(object: any): ValidatorHistoricalRewards { + return { + cumulativeRewardRatio: Array.isArray(object?.cumulativeRewardRatio) ? object.cumulativeRewardRatio.map((e: any) => DecCoin.fromJSON(e)) : [], + referenceCount: isSet(object.referenceCount) ? Number(object.referenceCount) : 0 + }; + }, + toJSON(message: ValidatorHistoricalRewards): unknown { + const obj: any = {}; + if (message.cumulativeRewardRatio) { + obj.cumulativeRewardRatio = message.cumulativeRewardRatio.map(e => e ? DecCoin.toJSON(e) : undefined); + } else { + obj.cumulativeRewardRatio = []; + } + message.referenceCount !== undefined && (obj.referenceCount = Math.round(message.referenceCount)); + return obj; + }, fromPartial(object: Partial): ValidatorHistoricalRewards { const message = createBaseValidatorHistoricalRewards(); message.cumulativeRewardRatio = object.cumulativeRewardRatio?.map(e => DecCoin.fromPartial(e)) || []; @@ -565,10 +673,12 @@ export const ValidatorHistoricalRewards = { return message; }, fromAmino(object: ValidatorHistoricalRewardsAmino): ValidatorHistoricalRewards { - return { - cumulativeRewardRatio: Array.isArray(object?.cumulative_reward_ratio) ? object.cumulative_reward_ratio.map((e: any) => DecCoin.fromAmino(e)) : [], - referenceCount: object.reference_count - }; + const message = createBaseValidatorHistoricalRewards(); + message.cumulativeRewardRatio = object.cumulative_reward_ratio?.map(e => DecCoin.fromAmino(e)) || []; + if (object.reference_count !== undefined && object.reference_count !== null) { + message.referenceCount = object.reference_count; + } + return message; }, toAmino(message: ValidatorHistoricalRewards): ValidatorHistoricalRewardsAmino { const obj: any = {}; @@ -602,6 +712,8 @@ export const ValidatorHistoricalRewards = { }; } }; +GlobalDecoderRegistry.register(ValidatorHistoricalRewards.typeUrl, ValidatorHistoricalRewards); +GlobalDecoderRegistry.registerAminoProtoMapping(ValidatorHistoricalRewards.aminoType, ValidatorHistoricalRewards.typeUrl); function createBaseValidatorCurrentRewards(): ValidatorCurrentRewards { return { rewards: [], @@ -610,6 +722,16 @@ function createBaseValidatorCurrentRewards(): ValidatorCurrentRewards { } export const ValidatorCurrentRewards = { typeUrl: "/cosmos.distribution.v1beta1.ValidatorCurrentRewards", + aminoType: "cosmos-sdk/ValidatorCurrentRewards", + is(o: any): o is ValidatorCurrentRewards { + return o && (o.$typeUrl === ValidatorCurrentRewards.typeUrl || Array.isArray(o.rewards) && (!o.rewards.length || DecCoin.is(o.rewards[0])) && typeof o.period === "bigint"); + }, + isSDK(o: any): o is ValidatorCurrentRewardsSDKType { + return o && (o.$typeUrl === ValidatorCurrentRewards.typeUrl || Array.isArray(o.rewards) && (!o.rewards.length || DecCoin.isSDK(o.rewards[0])) && typeof o.period === "bigint"); + }, + isAmino(o: any): o is ValidatorCurrentRewardsAmino { + return o && (o.$typeUrl === ValidatorCurrentRewards.typeUrl || Array.isArray(o.rewards) && (!o.rewards.length || DecCoin.isAmino(o.rewards[0])) && typeof o.period === "bigint"); + }, encode(message: ValidatorCurrentRewards, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.rewards) { DecCoin.encode(v!, writer.uint32(10).fork()).ldelim(); @@ -639,6 +761,22 @@ export const ValidatorCurrentRewards = { } return message; }, + fromJSON(object: any): ValidatorCurrentRewards { + return { + rewards: Array.isArray(object?.rewards) ? object.rewards.map((e: any) => DecCoin.fromJSON(e)) : [], + period: isSet(object.period) ? BigInt(object.period.toString()) : BigInt(0) + }; + }, + toJSON(message: ValidatorCurrentRewards): unknown { + const obj: any = {}; + if (message.rewards) { + obj.rewards = message.rewards.map(e => e ? DecCoin.toJSON(e) : undefined); + } else { + obj.rewards = []; + } + message.period !== undefined && (obj.period = (message.period || BigInt(0)).toString()); + return obj; + }, fromPartial(object: Partial): ValidatorCurrentRewards { const message = createBaseValidatorCurrentRewards(); message.rewards = object.rewards?.map(e => DecCoin.fromPartial(e)) || []; @@ -646,10 +784,12 @@ export const ValidatorCurrentRewards = { return message; }, fromAmino(object: ValidatorCurrentRewardsAmino): ValidatorCurrentRewards { - return { - rewards: Array.isArray(object?.rewards) ? object.rewards.map((e: any) => DecCoin.fromAmino(e)) : [], - period: BigInt(object.period) - }; + const message = createBaseValidatorCurrentRewards(); + message.rewards = object.rewards?.map(e => DecCoin.fromAmino(e)) || []; + if (object.period !== undefined && object.period !== null) { + message.period = BigInt(object.period); + } + return message; }, toAmino(message: ValidatorCurrentRewards): ValidatorCurrentRewardsAmino { const obj: any = {}; @@ -683,6 +823,8 @@ export const ValidatorCurrentRewards = { }; } }; +GlobalDecoderRegistry.register(ValidatorCurrentRewards.typeUrl, ValidatorCurrentRewards); +GlobalDecoderRegistry.registerAminoProtoMapping(ValidatorCurrentRewards.aminoType, ValidatorCurrentRewards.typeUrl); function createBaseValidatorAccumulatedCommission(): ValidatorAccumulatedCommission { return { commission: [] @@ -690,6 +832,16 @@ function createBaseValidatorAccumulatedCommission(): ValidatorAccumulatedCommiss } export const ValidatorAccumulatedCommission = { typeUrl: "/cosmos.distribution.v1beta1.ValidatorAccumulatedCommission", + aminoType: "cosmos-sdk/ValidatorAccumulatedCommission", + is(o: any): o is ValidatorAccumulatedCommission { + return o && (o.$typeUrl === ValidatorAccumulatedCommission.typeUrl || Array.isArray(o.commission) && (!o.commission.length || DecCoin.is(o.commission[0]))); + }, + isSDK(o: any): o is ValidatorAccumulatedCommissionSDKType { + return o && (o.$typeUrl === ValidatorAccumulatedCommission.typeUrl || Array.isArray(o.commission) && (!o.commission.length || DecCoin.isSDK(o.commission[0]))); + }, + isAmino(o: any): o is ValidatorAccumulatedCommissionAmino { + return o && (o.$typeUrl === ValidatorAccumulatedCommission.typeUrl || Array.isArray(o.commission) && (!o.commission.length || DecCoin.isAmino(o.commission[0]))); + }, encode(message: ValidatorAccumulatedCommission, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.commission) { DecCoin.encode(v!, writer.uint32(10).fork()).ldelim(); @@ -713,15 +865,29 @@ export const ValidatorAccumulatedCommission = { } return message; }, + fromJSON(object: any): ValidatorAccumulatedCommission { + return { + commission: Array.isArray(object?.commission) ? object.commission.map((e: any) => DecCoin.fromJSON(e)) : [] + }; + }, + toJSON(message: ValidatorAccumulatedCommission): unknown { + const obj: any = {}; + if (message.commission) { + obj.commission = message.commission.map(e => e ? DecCoin.toJSON(e) : undefined); + } else { + obj.commission = []; + } + return obj; + }, fromPartial(object: Partial): ValidatorAccumulatedCommission { const message = createBaseValidatorAccumulatedCommission(); message.commission = object.commission?.map(e => DecCoin.fromPartial(e)) || []; return message; }, fromAmino(object: ValidatorAccumulatedCommissionAmino): ValidatorAccumulatedCommission { - return { - commission: Array.isArray(object?.commission) ? object.commission.map((e: any) => DecCoin.fromAmino(e)) : [] - }; + const message = createBaseValidatorAccumulatedCommission(); + message.commission = object.commission?.map(e => DecCoin.fromAmino(e)) || []; + return message; }, toAmino(message: ValidatorAccumulatedCommission): ValidatorAccumulatedCommissionAmino { const obj: any = {}; @@ -754,6 +920,8 @@ export const ValidatorAccumulatedCommission = { }; } }; +GlobalDecoderRegistry.register(ValidatorAccumulatedCommission.typeUrl, ValidatorAccumulatedCommission); +GlobalDecoderRegistry.registerAminoProtoMapping(ValidatorAccumulatedCommission.aminoType, ValidatorAccumulatedCommission.typeUrl); function createBaseValidatorOutstandingRewards(): ValidatorOutstandingRewards { return { rewards: [] @@ -761,6 +929,16 @@ function createBaseValidatorOutstandingRewards(): ValidatorOutstandingRewards { } export const ValidatorOutstandingRewards = { typeUrl: "/cosmos.distribution.v1beta1.ValidatorOutstandingRewards", + aminoType: "cosmos-sdk/ValidatorOutstandingRewards", + is(o: any): o is ValidatorOutstandingRewards { + return o && (o.$typeUrl === ValidatorOutstandingRewards.typeUrl || Array.isArray(o.rewards) && (!o.rewards.length || DecCoin.is(o.rewards[0]))); + }, + isSDK(o: any): o is ValidatorOutstandingRewardsSDKType { + return o && (o.$typeUrl === ValidatorOutstandingRewards.typeUrl || Array.isArray(o.rewards) && (!o.rewards.length || DecCoin.isSDK(o.rewards[0]))); + }, + isAmino(o: any): o is ValidatorOutstandingRewardsAmino { + return o && (o.$typeUrl === ValidatorOutstandingRewards.typeUrl || Array.isArray(o.rewards) && (!o.rewards.length || DecCoin.isAmino(o.rewards[0]))); + }, encode(message: ValidatorOutstandingRewards, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.rewards) { DecCoin.encode(v!, writer.uint32(10).fork()).ldelim(); @@ -784,15 +962,29 @@ export const ValidatorOutstandingRewards = { } return message; }, + fromJSON(object: any): ValidatorOutstandingRewards { + return { + rewards: Array.isArray(object?.rewards) ? object.rewards.map((e: any) => DecCoin.fromJSON(e)) : [] + }; + }, + toJSON(message: ValidatorOutstandingRewards): unknown { + const obj: any = {}; + if (message.rewards) { + obj.rewards = message.rewards.map(e => e ? DecCoin.toJSON(e) : undefined); + } else { + obj.rewards = []; + } + return obj; + }, fromPartial(object: Partial): ValidatorOutstandingRewards { const message = createBaseValidatorOutstandingRewards(); message.rewards = object.rewards?.map(e => DecCoin.fromPartial(e)) || []; return message; }, fromAmino(object: ValidatorOutstandingRewardsAmino): ValidatorOutstandingRewards { - return { - rewards: Array.isArray(object?.rewards) ? object.rewards.map((e: any) => DecCoin.fromAmino(e)) : [] - }; + const message = createBaseValidatorOutstandingRewards(); + message.rewards = object.rewards?.map(e => DecCoin.fromAmino(e)) || []; + return message; }, toAmino(message: ValidatorOutstandingRewards): ValidatorOutstandingRewardsAmino { const obj: any = {}; @@ -825,6 +1017,8 @@ export const ValidatorOutstandingRewards = { }; } }; +GlobalDecoderRegistry.register(ValidatorOutstandingRewards.typeUrl, ValidatorOutstandingRewards); +GlobalDecoderRegistry.registerAminoProtoMapping(ValidatorOutstandingRewards.aminoType, ValidatorOutstandingRewards.typeUrl); function createBaseValidatorSlashEvent(): ValidatorSlashEvent { return { validatorPeriod: BigInt(0), @@ -833,6 +1027,16 @@ function createBaseValidatorSlashEvent(): ValidatorSlashEvent { } export const ValidatorSlashEvent = { typeUrl: "/cosmos.distribution.v1beta1.ValidatorSlashEvent", + aminoType: "cosmos-sdk/ValidatorSlashEvent", + is(o: any): o is ValidatorSlashEvent { + return o && (o.$typeUrl === ValidatorSlashEvent.typeUrl || typeof o.validatorPeriod === "bigint" && typeof o.fraction === "string"); + }, + isSDK(o: any): o is ValidatorSlashEventSDKType { + return o && (o.$typeUrl === ValidatorSlashEvent.typeUrl || typeof o.validator_period === "bigint" && typeof o.fraction === "string"); + }, + isAmino(o: any): o is ValidatorSlashEventAmino { + return o && (o.$typeUrl === ValidatorSlashEvent.typeUrl || typeof o.validator_period === "bigint" && typeof o.fraction === "string"); + }, encode(message: ValidatorSlashEvent, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.validatorPeriod !== BigInt(0)) { writer.uint32(8).uint64(message.validatorPeriod); @@ -862,6 +1066,18 @@ export const ValidatorSlashEvent = { } return message; }, + fromJSON(object: any): ValidatorSlashEvent { + return { + validatorPeriod: isSet(object.validatorPeriod) ? BigInt(object.validatorPeriod.toString()) : BigInt(0), + fraction: isSet(object.fraction) ? String(object.fraction) : "" + }; + }, + toJSON(message: ValidatorSlashEvent): unknown { + const obj: any = {}; + message.validatorPeriod !== undefined && (obj.validatorPeriod = (message.validatorPeriod || BigInt(0)).toString()); + message.fraction !== undefined && (obj.fraction = message.fraction); + return obj; + }, fromPartial(object: Partial): ValidatorSlashEvent { const message = createBaseValidatorSlashEvent(); message.validatorPeriod = object.validatorPeriod !== undefined && object.validatorPeriod !== null ? BigInt(object.validatorPeriod.toString()) : BigInt(0); @@ -869,10 +1085,14 @@ export const ValidatorSlashEvent = { return message; }, fromAmino(object: ValidatorSlashEventAmino): ValidatorSlashEvent { - return { - validatorPeriod: BigInt(object.validator_period), - fraction: object.fraction - }; + const message = createBaseValidatorSlashEvent(); + if (object.validator_period !== undefined && object.validator_period !== null) { + message.validatorPeriod = BigInt(object.validator_period); + } + if (object.fraction !== undefined && object.fraction !== null) { + message.fraction = object.fraction; + } + return message; }, toAmino(message: ValidatorSlashEvent): ValidatorSlashEventAmino { const obj: any = {}; @@ -902,6 +1122,8 @@ export const ValidatorSlashEvent = { }; } }; +GlobalDecoderRegistry.register(ValidatorSlashEvent.typeUrl, ValidatorSlashEvent); +GlobalDecoderRegistry.registerAminoProtoMapping(ValidatorSlashEvent.aminoType, ValidatorSlashEvent.typeUrl); function createBaseValidatorSlashEvents(): ValidatorSlashEvents { return { validatorSlashEvents: [] @@ -909,6 +1131,16 @@ function createBaseValidatorSlashEvents(): ValidatorSlashEvents { } export const ValidatorSlashEvents = { typeUrl: "/cosmos.distribution.v1beta1.ValidatorSlashEvents", + aminoType: "cosmos-sdk/ValidatorSlashEvents", + is(o: any): o is ValidatorSlashEvents { + return o && (o.$typeUrl === ValidatorSlashEvents.typeUrl || Array.isArray(o.validatorSlashEvents) && (!o.validatorSlashEvents.length || ValidatorSlashEvent.is(o.validatorSlashEvents[0]))); + }, + isSDK(o: any): o is ValidatorSlashEventsSDKType { + return o && (o.$typeUrl === ValidatorSlashEvents.typeUrl || Array.isArray(o.validator_slash_events) && (!o.validator_slash_events.length || ValidatorSlashEvent.isSDK(o.validator_slash_events[0]))); + }, + isAmino(o: any): o is ValidatorSlashEventsAmino { + return o && (o.$typeUrl === ValidatorSlashEvents.typeUrl || Array.isArray(o.validator_slash_events) && (!o.validator_slash_events.length || ValidatorSlashEvent.isAmino(o.validator_slash_events[0]))); + }, encode(message: ValidatorSlashEvents, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.validatorSlashEvents) { ValidatorSlashEvent.encode(v!, writer.uint32(10).fork()).ldelim(); @@ -932,15 +1164,29 @@ export const ValidatorSlashEvents = { } return message; }, + fromJSON(object: any): ValidatorSlashEvents { + return { + validatorSlashEvents: Array.isArray(object?.validatorSlashEvents) ? object.validatorSlashEvents.map((e: any) => ValidatorSlashEvent.fromJSON(e)) : [] + }; + }, + toJSON(message: ValidatorSlashEvents): unknown { + const obj: any = {}; + if (message.validatorSlashEvents) { + obj.validatorSlashEvents = message.validatorSlashEvents.map(e => e ? ValidatorSlashEvent.toJSON(e) : undefined); + } else { + obj.validatorSlashEvents = []; + } + return obj; + }, fromPartial(object: Partial): ValidatorSlashEvents { const message = createBaseValidatorSlashEvents(); message.validatorSlashEvents = object.validatorSlashEvents?.map(e => ValidatorSlashEvent.fromPartial(e)) || []; return message; }, fromAmino(object: ValidatorSlashEventsAmino): ValidatorSlashEvents { - return { - validatorSlashEvents: Array.isArray(object?.validator_slash_events) ? object.validator_slash_events.map((e: any) => ValidatorSlashEvent.fromAmino(e)) : [] - }; + const message = createBaseValidatorSlashEvents(); + message.validatorSlashEvents = object.validator_slash_events?.map(e => ValidatorSlashEvent.fromAmino(e)) || []; + return message; }, toAmino(message: ValidatorSlashEvents): ValidatorSlashEventsAmino { const obj: any = {}; @@ -973,6 +1219,8 @@ export const ValidatorSlashEvents = { }; } }; +GlobalDecoderRegistry.register(ValidatorSlashEvents.typeUrl, ValidatorSlashEvents); +GlobalDecoderRegistry.registerAminoProtoMapping(ValidatorSlashEvents.aminoType, ValidatorSlashEvents.typeUrl); function createBaseFeePool(): FeePool { return { communityPool: [] @@ -980,6 +1228,16 @@ function createBaseFeePool(): FeePool { } export const FeePool = { typeUrl: "/cosmos.distribution.v1beta1.FeePool", + aminoType: "cosmos-sdk/FeePool", + is(o: any): o is FeePool { + return o && (o.$typeUrl === FeePool.typeUrl || Array.isArray(o.communityPool) && (!o.communityPool.length || DecCoin.is(o.communityPool[0]))); + }, + isSDK(o: any): o is FeePoolSDKType { + return o && (o.$typeUrl === FeePool.typeUrl || Array.isArray(o.community_pool) && (!o.community_pool.length || DecCoin.isSDK(o.community_pool[0]))); + }, + isAmino(o: any): o is FeePoolAmino { + return o && (o.$typeUrl === FeePool.typeUrl || Array.isArray(o.community_pool) && (!o.community_pool.length || DecCoin.isAmino(o.community_pool[0]))); + }, encode(message: FeePool, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.communityPool) { DecCoin.encode(v!, writer.uint32(10).fork()).ldelim(); @@ -1003,15 +1261,29 @@ export const FeePool = { } return message; }, + fromJSON(object: any): FeePool { + return { + communityPool: Array.isArray(object?.communityPool) ? object.communityPool.map((e: any) => DecCoin.fromJSON(e)) : [] + }; + }, + toJSON(message: FeePool): unknown { + const obj: any = {}; + if (message.communityPool) { + obj.communityPool = message.communityPool.map(e => e ? DecCoin.toJSON(e) : undefined); + } else { + obj.communityPool = []; + } + return obj; + }, fromPartial(object: Partial): FeePool { const message = createBaseFeePool(); message.communityPool = object.communityPool?.map(e => DecCoin.fromPartial(e)) || []; return message; }, fromAmino(object: FeePoolAmino): FeePool { - return { - communityPool: Array.isArray(object?.community_pool) ? object.community_pool.map((e: any) => DecCoin.fromAmino(e)) : [] - }; + const message = createBaseFeePool(); + message.communityPool = object.community_pool?.map(e => DecCoin.fromAmino(e)) || []; + return message; }, toAmino(message: FeePool): FeePoolAmino { const obj: any = {}; @@ -1044,8 +1316,11 @@ export const FeePool = { }; } }; +GlobalDecoderRegistry.register(FeePool.typeUrl, FeePool); +GlobalDecoderRegistry.registerAminoProtoMapping(FeePool.aminoType, FeePool.typeUrl); function createBaseCommunityPoolSpendProposal(): CommunityPoolSpendProposal { return { + $typeUrl: "/cosmos.distribution.v1beta1.CommunityPoolSpendProposal", title: "", description: "", recipient: "", @@ -1054,6 +1329,16 @@ function createBaseCommunityPoolSpendProposal(): CommunityPoolSpendProposal { } export const CommunityPoolSpendProposal = { typeUrl: "/cosmos.distribution.v1beta1.CommunityPoolSpendProposal", + aminoType: "cosmos-sdk/CommunityPoolSpendProposal", + is(o: any): o is CommunityPoolSpendProposal { + return o && (o.$typeUrl === CommunityPoolSpendProposal.typeUrl || typeof o.title === "string" && typeof o.description === "string" && typeof o.recipient === "string" && Array.isArray(o.amount) && (!o.amount.length || Coin.is(o.amount[0]))); + }, + isSDK(o: any): o is CommunityPoolSpendProposalSDKType { + return o && (o.$typeUrl === CommunityPoolSpendProposal.typeUrl || typeof o.title === "string" && typeof o.description === "string" && typeof o.recipient === "string" && Array.isArray(o.amount) && (!o.amount.length || Coin.isSDK(o.amount[0]))); + }, + isAmino(o: any): o is CommunityPoolSpendProposalAmino { + return o && (o.$typeUrl === CommunityPoolSpendProposal.typeUrl || typeof o.title === "string" && typeof o.description === "string" && typeof o.recipient === "string" && Array.isArray(o.amount) && (!o.amount.length || Coin.isAmino(o.amount[0]))); + }, encode(message: CommunityPoolSpendProposal, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.title !== "") { writer.uint32(10).string(message.title); @@ -1095,6 +1380,26 @@ export const CommunityPoolSpendProposal = { } return message; }, + fromJSON(object: any): CommunityPoolSpendProposal { + return { + 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)) : [] + }; + }, + 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); + if (message.amount) { + obj.amount = message.amount.map(e => e ? Coin.toJSON(e) : undefined); + } else { + obj.amount = []; + } + return obj; + }, fromPartial(object: Partial): CommunityPoolSpendProposal { const message = createBaseCommunityPoolSpendProposal(); message.title = object.title ?? ""; @@ -1104,12 +1409,18 @@ export const CommunityPoolSpendProposal = { return message; }, fromAmino(object: CommunityPoolSpendProposalAmino): CommunityPoolSpendProposal { - return { - title: object.title, - description: object.description, - recipient: object.recipient, - amount: Array.isArray(object?.amount) ? object.amount.map((e: any) => Coin.fromAmino(e)) : [] - }; + const message = createBaseCommunityPoolSpendProposal(); + if (object.title !== undefined && object.title !== null) { + message.title = object.title; + } + if (object.description !== undefined && object.description !== null) { + message.description = object.description; + } + if (object.recipient !== undefined && object.recipient !== null) { + message.recipient = object.recipient; + } + message.amount = object.amount?.map(e => Coin.fromAmino(e)) || []; + return message; }, toAmino(message: CommunityPoolSpendProposal): CommunityPoolSpendProposalAmino { const obj: any = {}; @@ -1145,6 +1456,8 @@ export const CommunityPoolSpendProposal = { }; } }; +GlobalDecoderRegistry.register(CommunityPoolSpendProposal.typeUrl, CommunityPoolSpendProposal); +GlobalDecoderRegistry.registerAminoProtoMapping(CommunityPoolSpendProposal.aminoType, CommunityPoolSpendProposal.typeUrl); function createBaseDelegatorStartingInfo(): DelegatorStartingInfo { return { previousPeriod: BigInt(0), @@ -1154,6 +1467,16 @@ function createBaseDelegatorStartingInfo(): DelegatorStartingInfo { } export const DelegatorStartingInfo = { typeUrl: "/cosmos.distribution.v1beta1.DelegatorStartingInfo", + aminoType: "cosmos-sdk/DelegatorStartingInfo", + is(o: any): o is DelegatorStartingInfo { + return o && (o.$typeUrl === DelegatorStartingInfo.typeUrl || typeof o.previousPeriod === "bigint" && typeof o.stake === "string" && typeof o.height === "bigint"); + }, + isSDK(o: any): o is DelegatorStartingInfoSDKType { + return o && (o.$typeUrl === DelegatorStartingInfo.typeUrl || typeof o.previous_period === "bigint" && typeof o.stake === "string" && typeof o.height === "bigint"); + }, + isAmino(o: any): o is DelegatorStartingInfoAmino { + return o && (o.$typeUrl === DelegatorStartingInfo.typeUrl || typeof o.previous_period === "bigint" && typeof o.stake === "string" && typeof o.height === "bigint"); + }, encode(message: DelegatorStartingInfo, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.previousPeriod !== BigInt(0)) { writer.uint32(8).uint64(message.previousPeriod); @@ -1189,6 +1512,20 @@ export const DelegatorStartingInfo = { } return message; }, + fromJSON(object: any): DelegatorStartingInfo { + return { + previousPeriod: isSet(object.previousPeriod) ? BigInt(object.previousPeriod.toString()) : BigInt(0), + stake: isSet(object.stake) ? String(object.stake) : "", + height: isSet(object.height) ? BigInt(object.height.toString()) : BigInt(0) + }; + }, + toJSON(message: DelegatorStartingInfo): unknown { + const obj: any = {}; + message.previousPeriod !== undefined && (obj.previousPeriod = (message.previousPeriod || BigInt(0)).toString()); + message.stake !== undefined && (obj.stake = message.stake); + message.height !== undefined && (obj.height = (message.height || BigInt(0)).toString()); + return obj; + }, fromPartial(object: Partial): DelegatorStartingInfo { const message = createBaseDelegatorStartingInfo(); message.previousPeriod = object.previousPeriod !== undefined && object.previousPeriod !== null ? BigInt(object.previousPeriod.toString()) : BigInt(0); @@ -1197,17 +1534,23 @@ export const DelegatorStartingInfo = { return message; }, fromAmino(object: DelegatorStartingInfoAmino): DelegatorStartingInfo { - return { - previousPeriod: BigInt(object.previous_period), - stake: object.stake, - height: BigInt(object.height) - }; + const message = createBaseDelegatorStartingInfo(); + if (object.previous_period !== undefined && object.previous_period !== null) { + message.previousPeriod = BigInt(object.previous_period); + } + if (object.stake !== undefined && object.stake !== null) { + message.stake = object.stake; + } + if (object.height !== undefined && object.height !== null) { + message.height = BigInt(object.height); + } + return message; }, toAmino(message: DelegatorStartingInfo): DelegatorStartingInfoAmino { const obj: any = {}; obj.previous_period = message.previousPeriod ? message.previousPeriod.toString() : undefined; obj.stake = message.stake; - obj.height = message.height ? message.height.toString() : undefined; + obj.height = message.height ? message.height.toString() : "0"; return obj; }, fromAminoMsg(object: DelegatorStartingInfoAminoMsg): DelegatorStartingInfo { @@ -1232,6 +1575,8 @@ export const DelegatorStartingInfo = { }; } }; +GlobalDecoderRegistry.register(DelegatorStartingInfo.typeUrl, DelegatorStartingInfo); +GlobalDecoderRegistry.registerAminoProtoMapping(DelegatorStartingInfo.aminoType, DelegatorStartingInfo.typeUrl); function createBaseDelegationDelegatorReward(): DelegationDelegatorReward { return { validatorAddress: "", @@ -1240,6 +1585,16 @@ function createBaseDelegationDelegatorReward(): DelegationDelegatorReward { } export const DelegationDelegatorReward = { typeUrl: "/cosmos.distribution.v1beta1.DelegationDelegatorReward", + aminoType: "cosmos-sdk/DelegationDelegatorReward", + is(o: any): o is DelegationDelegatorReward { + return o && (o.$typeUrl === DelegationDelegatorReward.typeUrl || typeof o.validatorAddress === "string" && Array.isArray(o.reward) && (!o.reward.length || DecCoin.is(o.reward[0]))); + }, + isSDK(o: any): o is DelegationDelegatorRewardSDKType { + return o && (o.$typeUrl === DelegationDelegatorReward.typeUrl || typeof o.validator_address === "string" && Array.isArray(o.reward) && (!o.reward.length || DecCoin.isSDK(o.reward[0]))); + }, + isAmino(o: any): o is DelegationDelegatorRewardAmino { + return o && (o.$typeUrl === DelegationDelegatorReward.typeUrl || typeof o.validator_address === "string" && Array.isArray(o.reward) && (!o.reward.length || DecCoin.isAmino(o.reward[0]))); + }, encode(message: DelegationDelegatorReward, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.validatorAddress !== "") { writer.uint32(10).string(message.validatorAddress); @@ -1269,6 +1624,22 @@ export const DelegationDelegatorReward = { } 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)) : [] + }; + }, + toJSON(message: DelegationDelegatorReward): unknown { + const obj: any = {}; + message.validatorAddress !== undefined && (obj.validatorAddress = message.validatorAddress); + if (message.reward) { + obj.reward = message.reward.map(e => e ? DecCoin.toJSON(e) : undefined); + } else { + obj.reward = []; + } + return obj; + }, fromPartial(object: Partial): DelegationDelegatorReward { const message = createBaseDelegationDelegatorReward(); message.validatorAddress = object.validatorAddress ?? ""; @@ -1276,10 +1647,12 @@ export const DelegationDelegatorReward = { return message; }, fromAmino(object: DelegationDelegatorRewardAmino): DelegationDelegatorReward { - return { - validatorAddress: object.validator_address, - reward: Array.isArray(object?.reward) ? object.reward.map((e: any) => DecCoin.fromAmino(e)) : [] - }; + const message = createBaseDelegationDelegatorReward(); + if (object.validator_address !== undefined && object.validator_address !== null) { + message.validatorAddress = object.validator_address; + } + message.reward = object.reward?.map(e => DecCoin.fromAmino(e)) || []; + return message; }, toAmino(message: DelegationDelegatorReward): DelegationDelegatorRewardAmino { const obj: any = {}; @@ -1313,8 +1686,11 @@ export const DelegationDelegatorReward = { }; } }; +GlobalDecoderRegistry.register(DelegationDelegatorReward.typeUrl, DelegationDelegatorReward); +GlobalDecoderRegistry.registerAminoProtoMapping(DelegationDelegatorReward.aminoType, DelegationDelegatorReward.typeUrl); function createBaseCommunityPoolSpendProposalWithDeposit(): CommunityPoolSpendProposalWithDeposit { return { + $typeUrl: "/cosmos.distribution.v1beta1.CommunityPoolSpendProposalWithDeposit", title: "", description: "", recipient: "", @@ -1324,6 +1700,16 @@ function createBaseCommunityPoolSpendProposalWithDeposit(): CommunityPoolSpendPr } export const CommunityPoolSpendProposalWithDeposit = { typeUrl: "/cosmos.distribution.v1beta1.CommunityPoolSpendProposalWithDeposit", + aminoType: "cosmos-sdk/CommunityPoolSpendProposalWithDeposit", + is(o: any): o is CommunityPoolSpendProposalWithDeposit { + return o && (o.$typeUrl === CommunityPoolSpendProposalWithDeposit.typeUrl || typeof o.title === "string" && typeof o.description === "string" && typeof o.recipient === "string" && typeof o.amount === "string" && typeof o.deposit === "string"); + }, + isSDK(o: any): o is CommunityPoolSpendProposalWithDepositSDKType { + return o && (o.$typeUrl === CommunityPoolSpendProposalWithDeposit.typeUrl || typeof o.title === "string" && typeof o.description === "string" && typeof o.recipient === "string" && typeof o.amount === "string" && typeof o.deposit === "string"); + }, + isAmino(o: any): o is CommunityPoolSpendProposalWithDepositAmino { + return o && (o.$typeUrl === CommunityPoolSpendProposalWithDeposit.typeUrl || typeof o.title === "string" && typeof o.description === "string" && typeof o.recipient === "string" && typeof o.amount === "string" && typeof o.deposit === "string"); + }, encode(message: CommunityPoolSpendProposalWithDeposit, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.title !== "") { writer.uint32(10).string(message.title); @@ -1371,6 +1757,24 @@ export const CommunityPoolSpendProposalWithDeposit = { } return message; }, + fromJSON(object: any): CommunityPoolSpendProposalWithDeposit { + return { + title: isSet(object.title) ? String(object.title) : "", + description: isSet(object.description) ? String(object.description) : "", + 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; + }, fromPartial(object: Partial): CommunityPoolSpendProposalWithDeposit { const message = createBaseCommunityPoolSpendProposalWithDeposit(); message.title = object.title ?? ""; @@ -1381,13 +1785,23 @@ export const CommunityPoolSpendProposalWithDeposit = { return message; }, fromAmino(object: CommunityPoolSpendProposalWithDepositAmino): CommunityPoolSpendProposalWithDeposit { - return { - title: object.title, - description: object.description, - recipient: object.recipient, - amount: object.amount, - deposit: object.deposit - }; + const message = createBaseCommunityPoolSpendProposalWithDeposit(); + if (object.title !== undefined && object.title !== null) { + message.title = object.title; + } + if (object.description !== undefined && object.description !== null) { + message.description = object.description; + } + if (object.recipient !== undefined && object.recipient !== null) { + message.recipient = object.recipient; + } + if (object.amount !== undefined && object.amount !== null) { + message.amount = object.amount; + } + if (object.deposit !== undefined && object.deposit !== null) { + message.deposit = object.deposit; + } + return message; }, toAmino(message: CommunityPoolSpendProposalWithDeposit): CommunityPoolSpendProposalWithDepositAmino { const obj: any = {}; @@ -1419,4 +1833,6 @@ export const CommunityPoolSpendProposalWithDeposit = { value: CommunityPoolSpendProposalWithDeposit.encode(message).finish() }; } -}; \ No newline at end of file +}; +GlobalDecoderRegistry.register(CommunityPoolSpendProposalWithDeposit.typeUrl, CommunityPoolSpendProposalWithDeposit); +GlobalDecoderRegistry.registerAminoProtoMapping(CommunityPoolSpendProposalWithDeposit.aminoType, CommunityPoolSpendProposalWithDeposit.typeUrl); \ No newline at end of file diff --git a/packages/osmojs/src/codegen/cosmos/distribution/v1beta1/genesis.ts b/packages/osmojs/src/codegen/cosmos/distribution/v1beta1/genesis.ts index 258275e9d..912c4b9ee 100644 --- a/packages/osmojs/src/codegen/cosmos/distribution/v1beta1/genesis.ts +++ b/packages/osmojs/src/codegen/cosmos/distribution/v1beta1/genesis.ts @@ -1,6 +1,8 @@ import { DecCoin, DecCoinAmino, DecCoinSDKType } from "../../base/v1beta1/coin"; import { ValidatorAccumulatedCommission, ValidatorAccumulatedCommissionAmino, ValidatorAccumulatedCommissionSDKType, ValidatorHistoricalRewards, ValidatorHistoricalRewardsAmino, ValidatorHistoricalRewardsSDKType, ValidatorCurrentRewards, ValidatorCurrentRewardsAmino, ValidatorCurrentRewardsSDKType, DelegatorStartingInfo, DelegatorStartingInfoAmino, DelegatorStartingInfoSDKType, ValidatorSlashEvent, ValidatorSlashEventAmino, ValidatorSlashEventSDKType, Params, ParamsAmino, ParamsSDKType, FeePool, FeePoolAmino, FeePoolSDKType } from "./distribution"; import { BinaryReader, BinaryWriter } from "../../../binary"; +import { isSet } from "../../../helpers"; +import { GlobalDecoderRegistry } from "../../../registry"; /** * DelegatorWithdrawInfo is the address for where distributions rewards are * withdrawn to by default this struct is only used at genesis to feed in @@ -23,9 +25,9 @@ export interface DelegatorWithdrawInfoProtoMsg { */ export interface DelegatorWithdrawInfoAmino { /** delegator_address is the address of the delegator. */ - delegator_address: string; + delegator_address?: string; /** withdraw_address is the address to withdraw the delegation rewards to. */ - withdraw_address: string; + withdraw_address?: string; } export interface DelegatorWithdrawInfoAminoMsg { type: "cosmos-sdk/DelegatorWithdrawInfo"; @@ -44,7 +46,7 @@ export interface DelegatorWithdrawInfoSDKType { export interface ValidatorOutstandingRewardsRecord { /** validator_address is the address of the validator. */ validatorAddress: string; - /** outstanding_rewards represents the oustanding rewards of a validator. */ + /** outstanding_rewards represents the outstanding rewards of a validator. */ outstandingRewards: DecCoin[]; } export interface ValidatorOutstandingRewardsRecordProtoMsg { @@ -54,8 +56,8 @@ export interface ValidatorOutstandingRewardsRecordProtoMsg { /** ValidatorOutstandingRewardsRecord is used for import/export via genesis json. */ export interface ValidatorOutstandingRewardsRecordAmino { /** validator_address is the address of the validator. */ - validator_address: string; - /** outstanding_rewards represents the oustanding rewards of a validator. */ + validator_address?: string; + /** outstanding_rewards represents the outstanding rewards of a validator. */ outstanding_rewards: DecCoinAmino[]; } export interface ValidatorOutstandingRewardsRecordAminoMsg { @@ -87,9 +89,9 @@ export interface ValidatorAccumulatedCommissionRecordProtoMsg { */ export interface ValidatorAccumulatedCommissionRecordAmino { /** validator_address is the address of the validator. */ - validator_address: string; + validator_address?: string; /** accumulated is the accumulated commission of a validator. */ - accumulated?: ValidatorAccumulatedCommissionAmino; + accumulated: ValidatorAccumulatedCommissionAmino; } export interface ValidatorAccumulatedCommissionRecordAminoMsg { type: "cosmos-sdk/ValidatorAccumulatedCommissionRecord"; @@ -125,11 +127,11 @@ export interface ValidatorHistoricalRewardsRecordProtoMsg { */ export interface ValidatorHistoricalRewardsRecordAmino { /** validator_address is the address of the validator. */ - validator_address: string; + validator_address?: string; /** period defines the period the historical rewards apply to. */ - period: string; + period?: string; /** rewards defines the historical rewards of a validator. */ - rewards?: ValidatorHistoricalRewardsAmino; + rewards: ValidatorHistoricalRewardsAmino; } export interface ValidatorHistoricalRewardsRecordAminoMsg { type: "cosmos-sdk/ValidatorHistoricalRewardsRecord"; @@ -158,9 +160,9 @@ export interface ValidatorCurrentRewardsRecordProtoMsg { /** ValidatorCurrentRewardsRecord is used for import / export via genesis json. */ export interface ValidatorCurrentRewardsRecordAmino { /** validator_address is the address of the validator. */ - validator_address: string; + validator_address?: string; /** rewards defines the current rewards of a validator. */ - rewards?: ValidatorCurrentRewardsAmino; + rewards: ValidatorCurrentRewardsAmino; } export interface ValidatorCurrentRewardsRecordAminoMsg { type: "cosmos-sdk/ValidatorCurrentRewardsRecord"; @@ -187,11 +189,11 @@ export interface DelegatorStartingInfoRecordProtoMsg { /** DelegatorStartingInfoRecord used for import / export via genesis json. */ export interface DelegatorStartingInfoRecordAmino { /** delegator_address is the address of the delegator. */ - delegator_address: string; + delegator_address?: string; /** validator_address is the address of the validator. */ - validator_address: string; + validator_address?: string; /** starting_info defines the starting info of a delegator. */ - starting_info?: DelegatorStartingInfoAmino; + starting_info: DelegatorStartingInfoAmino; } export interface DelegatorStartingInfoRecordAminoMsg { type: "cosmos-sdk/DelegatorStartingInfoRecord"; @@ -207,7 +209,7 @@ export interface DelegatorStartingInfoRecordSDKType { export interface ValidatorSlashEventRecord { /** validator_address is the address of the validator. */ validatorAddress: string; - /** height defines the block height at which the slash event occured. */ + /** height defines the block height at which the slash event occurred. */ height: bigint; /** period is the period of the slash event. */ period: bigint; @@ -221,13 +223,13 @@ export interface ValidatorSlashEventRecordProtoMsg { /** ValidatorSlashEventRecord is used for import / export via genesis json. */ export interface ValidatorSlashEventRecordAmino { /** validator_address is the address of the validator. */ - validator_address: string; - /** height defines the block height at which the slash event occured. */ - height: string; + validator_address?: string; + /** height defines the block height at which the slash event occurred. */ + height?: string; /** period is the period of the slash event. */ - period: string; + period?: string; /** validator_slash_event describes the slash event. */ - validator_slash_event?: ValidatorSlashEventAmino; + validator_slash_event: ValidatorSlashEventAmino; } export interface ValidatorSlashEventRecordAminoMsg { type: "cosmos-sdk/ValidatorSlashEventRecord"; @@ -242,7 +244,7 @@ export interface ValidatorSlashEventRecordSDKType { } /** GenesisState defines the distribution module's genesis state. */ export interface GenesisState { - /** params defines all the paramaters of the module. */ + /** params defines all the parameters of the module. */ params: Params; /** fee_pool defines the fee pool at genesis. */ feePool: FeePool; @@ -252,7 +254,7 @@ export interface GenesisState { previousProposer: string; /** fee_pool defines the outstanding rewards of all validators at genesis. */ outstandingRewards: ValidatorOutstandingRewardsRecord[]; - /** fee_pool defines the accumulated commisions of all validators at genesis. */ + /** fee_pool defines the accumulated commissions of all validators at genesis. */ validatorAccumulatedCommissions: ValidatorAccumulatedCommissionRecord[]; /** fee_pool defines the historical rewards of all validators at genesis. */ validatorHistoricalRewards: ValidatorHistoricalRewardsRecord[]; @@ -269,17 +271,17 @@ export interface GenesisStateProtoMsg { } /** GenesisState defines the distribution module's genesis state. */ export interface GenesisStateAmino { - /** params defines all the paramaters of the module. */ - params?: ParamsAmino; + /** params defines all the parameters of the module. */ + params: ParamsAmino; /** fee_pool defines the fee pool at genesis. */ - fee_pool?: FeePoolAmino; + fee_pool: FeePoolAmino; /** fee_pool defines the delegator withdraw infos at genesis. */ delegator_withdraw_infos: DelegatorWithdrawInfoAmino[]; /** fee_pool defines the previous proposer at genesis. */ - previous_proposer: string; + previous_proposer?: string; /** fee_pool defines the outstanding rewards of all validators at genesis. */ outstanding_rewards: ValidatorOutstandingRewardsRecordAmino[]; - /** fee_pool defines the accumulated commisions of all validators at genesis. */ + /** fee_pool defines the accumulated commissions of all validators at genesis. */ validator_accumulated_commissions: ValidatorAccumulatedCommissionRecordAmino[]; /** fee_pool defines the historical rewards of all validators at genesis. */ validator_historical_rewards: ValidatorHistoricalRewardsRecordAmino[]; @@ -315,6 +317,16 @@ function createBaseDelegatorWithdrawInfo(): DelegatorWithdrawInfo { } export const DelegatorWithdrawInfo = { typeUrl: "/cosmos.distribution.v1beta1.DelegatorWithdrawInfo", + aminoType: "cosmos-sdk/DelegatorWithdrawInfo", + is(o: any): o is DelegatorWithdrawInfo { + return o && (o.$typeUrl === DelegatorWithdrawInfo.typeUrl || typeof o.delegatorAddress === "string" && typeof o.withdrawAddress === "string"); + }, + isSDK(o: any): o is DelegatorWithdrawInfoSDKType { + return o && (o.$typeUrl === DelegatorWithdrawInfo.typeUrl || typeof o.delegator_address === "string" && typeof o.withdraw_address === "string"); + }, + isAmino(o: any): o is DelegatorWithdrawInfoAmino { + return o && (o.$typeUrl === DelegatorWithdrawInfo.typeUrl || typeof o.delegator_address === "string" && typeof o.withdraw_address === "string"); + }, encode(message: DelegatorWithdrawInfo, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.delegatorAddress !== "") { writer.uint32(10).string(message.delegatorAddress); @@ -344,6 +356,18 @@ export const DelegatorWithdrawInfo = { } return message; }, + fromJSON(object: any): DelegatorWithdrawInfo { + return { + 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; + }, fromPartial(object: Partial): DelegatorWithdrawInfo { const message = createBaseDelegatorWithdrawInfo(); message.delegatorAddress = object.delegatorAddress ?? ""; @@ -351,10 +375,14 @@ export const DelegatorWithdrawInfo = { return message; }, fromAmino(object: DelegatorWithdrawInfoAmino): DelegatorWithdrawInfo { - return { - delegatorAddress: object.delegator_address, - withdrawAddress: object.withdraw_address - }; + const message = createBaseDelegatorWithdrawInfo(); + if (object.delegator_address !== undefined && object.delegator_address !== null) { + message.delegatorAddress = object.delegator_address; + } + if (object.withdraw_address !== undefined && object.withdraw_address !== null) { + message.withdrawAddress = object.withdraw_address; + } + return message; }, toAmino(message: DelegatorWithdrawInfo): DelegatorWithdrawInfoAmino { const obj: any = {}; @@ -384,6 +412,8 @@ export const DelegatorWithdrawInfo = { }; } }; +GlobalDecoderRegistry.register(DelegatorWithdrawInfo.typeUrl, DelegatorWithdrawInfo); +GlobalDecoderRegistry.registerAminoProtoMapping(DelegatorWithdrawInfo.aminoType, DelegatorWithdrawInfo.typeUrl); function createBaseValidatorOutstandingRewardsRecord(): ValidatorOutstandingRewardsRecord { return { validatorAddress: "", @@ -392,6 +422,16 @@ function createBaseValidatorOutstandingRewardsRecord(): ValidatorOutstandingRewa } export const ValidatorOutstandingRewardsRecord = { typeUrl: "/cosmos.distribution.v1beta1.ValidatorOutstandingRewardsRecord", + aminoType: "cosmos-sdk/ValidatorOutstandingRewardsRecord", + is(o: any): o is ValidatorOutstandingRewardsRecord { + return o && (o.$typeUrl === ValidatorOutstandingRewardsRecord.typeUrl || typeof o.validatorAddress === "string" && Array.isArray(o.outstandingRewards) && (!o.outstandingRewards.length || DecCoin.is(o.outstandingRewards[0]))); + }, + isSDK(o: any): o is ValidatorOutstandingRewardsRecordSDKType { + return o && (o.$typeUrl === ValidatorOutstandingRewardsRecord.typeUrl || typeof o.validator_address === "string" && Array.isArray(o.outstanding_rewards) && (!o.outstanding_rewards.length || DecCoin.isSDK(o.outstanding_rewards[0]))); + }, + isAmino(o: any): o is ValidatorOutstandingRewardsRecordAmino { + return o && (o.$typeUrl === ValidatorOutstandingRewardsRecord.typeUrl || typeof o.validator_address === "string" && Array.isArray(o.outstanding_rewards) && (!o.outstanding_rewards.length || DecCoin.isAmino(o.outstanding_rewards[0]))); + }, encode(message: ValidatorOutstandingRewardsRecord, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.validatorAddress !== "") { writer.uint32(10).string(message.validatorAddress); @@ -421,6 +461,22 @@ export const ValidatorOutstandingRewardsRecord = { } return message; }, + fromJSON(object: any): ValidatorOutstandingRewardsRecord { + return { + 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); + if (message.outstandingRewards) { + obj.outstandingRewards = message.outstandingRewards.map(e => e ? DecCoin.toJSON(e) : undefined); + } else { + obj.outstandingRewards = []; + } + return obj; + }, fromPartial(object: Partial): ValidatorOutstandingRewardsRecord { const message = createBaseValidatorOutstandingRewardsRecord(); message.validatorAddress = object.validatorAddress ?? ""; @@ -428,10 +484,12 @@ export const ValidatorOutstandingRewardsRecord = { return message; }, fromAmino(object: ValidatorOutstandingRewardsRecordAmino): ValidatorOutstandingRewardsRecord { - return { - validatorAddress: object.validator_address, - outstandingRewards: Array.isArray(object?.outstanding_rewards) ? object.outstanding_rewards.map((e: any) => DecCoin.fromAmino(e)) : [] - }; + const message = createBaseValidatorOutstandingRewardsRecord(); + if (object.validator_address !== undefined && object.validator_address !== null) { + message.validatorAddress = object.validator_address; + } + message.outstandingRewards = object.outstanding_rewards?.map(e => DecCoin.fromAmino(e)) || []; + return message; }, toAmino(message: ValidatorOutstandingRewardsRecord): ValidatorOutstandingRewardsRecordAmino { const obj: any = {}; @@ -465,6 +523,8 @@ export const ValidatorOutstandingRewardsRecord = { }; } }; +GlobalDecoderRegistry.register(ValidatorOutstandingRewardsRecord.typeUrl, ValidatorOutstandingRewardsRecord); +GlobalDecoderRegistry.registerAminoProtoMapping(ValidatorOutstandingRewardsRecord.aminoType, ValidatorOutstandingRewardsRecord.typeUrl); function createBaseValidatorAccumulatedCommissionRecord(): ValidatorAccumulatedCommissionRecord { return { validatorAddress: "", @@ -473,6 +533,16 @@ function createBaseValidatorAccumulatedCommissionRecord(): ValidatorAccumulatedC } export const ValidatorAccumulatedCommissionRecord = { typeUrl: "/cosmos.distribution.v1beta1.ValidatorAccumulatedCommissionRecord", + aminoType: "cosmos-sdk/ValidatorAccumulatedCommissionRecord", + is(o: any): o is ValidatorAccumulatedCommissionRecord { + return o && (o.$typeUrl === ValidatorAccumulatedCommissionRecord.typeUrl || typeof o.validatorAddress === "string" && ValidatorAccumulatedCommission.is(o.accumulated)); + }, + isSDK(o: any): o is ValidatorAccumulatedCommissionRecordSDKType { + return o && (o.$typeUrl === ValidatorAccumulatedCommissionRecord.typeUrl || typeof o.validator_address === "string" && ValidatorAccumulatedCommission.isSDK(o.accumulated)); + }, + isAmino(o: any): o is ValidatorAccumulatedCommissionRecordAmino { + return o && (o.$typeUrl === ValidatorAccumulatedCommissionRecord.typeUrl || typeof o.validator_address === "string" && ValidatorAccumulatedCommission.isAmino(o.accumulated)); + }, encode(message: ValidatorAccumulatedCommissionRecord, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.validatorAddress !== "") { writer.uint32(10).string(message.validatorAddress); @@ -502,6 +572,18 @@ export const ValidatorAccumulatedCommissionRecord = { } return message; }, + fromJSON(object: any): ValidatorAccumulatedCommissionRecord { + return { + 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); + message.accumulated !== undefined && (obj.accumulated = message.accumulated ? ValidatorAccumulatedCommission.toJSON(message.accumulated) : undefined); + return obj; + }, fromPartial(object: Partial): ValidatorAccumulatedCommissionRecord { const message = createBaseValidatorAccumulatedCommissionRecord(); message.validatorAddress = object.validatorAddress ?? ""; @@ -509,15 +591,19 @@ export const ValidatorAccumulatedCommissionRecord = { return message; }, fromAmino(object: ValidatorAccumulatedCommissionRecordAmino): ValidatorAccumulatedCommissionRecord { - return { - validatorAddress: object.validator_address, - accumulated: object?.accumulated ? ValidatorAccumulatedCommission.fromAmino(object.accumulated) : undefined - }; + const message = createBaseValidatorAccumulatedCommissionRecord(); + if (object.validator_address !== undefined && object.validator_address !== null) { + message.validatorAddress = object.validator_address; + } + if (object.accumulated !== undefined && object.accumulated !== null) { + message.accumulated = ValidatorAccumulatedCommission.fromAmino(object.accumulated); + } + return message; }, toAmino(message: ValidatorAccumulatedCommissionRecord): ValidatorAccumulatedCommissionRecordAmino { const obj: any = {}; obj.validator_address = message.validatorAddress; - obj.accumulated = message.accumulated ? ValidatorAccumulatedCommission.toAmino(message.accumulated) : undefined; + obj.accumulated = message.accumulated ? ValidatorAccumulatedCommission.toAmino(message.accumulated) : ValidatorAccumulatedCommission.fromPartial({}); return obj; }, fromAminoMsg(object: ValidatorAccumulatedCommissionRecordAminoMsg): ValidatorAccumulatedCommissionRecord { @@ -542,6 +628,8 @@ export const ValidatorAccumulatedCommissionRecord = { }; } }; +GlobalDecoderRegistry.register(ValidatorAccumulatedCommissionRecord.typeUrl, ValidatorAccumulatedCommissionRecord); +GlobalDecoderRegistry.registerAminoProtoMapping(ValidatorAccumulatedCommissionRecord.aminoType, ValidatorAccumulatedCommissionRecord.typeUrl); function createBaseValidatorHistoricalRewardsRecord(): ValidatorHistoricalRewardsRecord { return { validatorAddress: "", @@ -551,6 +639,16 @@ function createBaseValidatorHistoricalRewardsRecord(): ValidatorHistoricalReward } export const ValidatorHistoricalRewardsRecord = { typeUrl: "/cosmos.distribution.v1beta1.ValidatorHistoricalRewardsRecord", + aminoType: "cosmos-sdk/ValidatorHistoricalRewardsRecord", + is(o: any): o is ValidatorHistoricalRewardsRecord { + return o && (o.$typeUrl === ValidatorHistoricalRewardsRecord.typeUrl || typeof o.validatorAddress === "string" && typeof o.period === "bigint" && ValidatorHistoricalRewards.is(o.rewards)); + }, + isSDK(o: any): o is ValidatorHistoricalRewardsRecordSDKType { + return o && (o.$typeUrl === ValidatorHistoricalRewardsRecord.typeUrl || typeof o.validator_address === "string" && typeof o.period === "bigint" && ValidatorHistoricalRewards.isSDK(o.rewards)); + }, + isAmino(o: any): o is ValidatorHistoricalRewardsRecordAmino { + return o && (o.$typeUrl === ValidatorHistoricalRewardsRecord.typeUrl || typeof o.validator_address === "string" && typeof o.period === "bigint" && ValidatorHistoricalRewards.isAmino(o.rewards)); + }, encode(message: ValidatorHistoricalRewardsRecord, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.validatorAddress !== "") { writer.uint32(10).string(message.validatorAddress); @@ -586,6 +684,20 @@ export const ValidatorHistoricalRewardsRecord = { } return message; }, + fromJSON(object: any): ValidatorHistoricalRewardsRecord { + return { + validatorAddress: isSet(object.validatorAddress) ? String(object.validatorAddress) : "", + period: isSet(object.period) ? BigInt(object.period.toString()) : BigInt(0), + 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 || BigInt(0)).toString()); + message.rewards !== undefined && (obj.rewards = message.rewards ? ValidatorHistoricalRewards.toJSON(message.rewards) : undefined); + return obj; + }, fromPartial(object: Partial): ValidatorHistoricalRewardsRecord { const message = createBaseValidatorHistoricalRewardsRecord(); message.validatorAddress = object.validatorAddress ?? ""; @@ -594,17 +706,23 @@ export const ValidatorHistoricalRewardsRecord = { return message; }, fromAmino(object: ValidatorHistoricalRewardsRecordAmino): ValidatorHistoricalRewardsRecord { - return { - validatorAddress: object.validator_address, - period: BigInt(object.period), - rewards: object?.rewards ? ValidatorHistoricalRewards.fromAmino(object.rewards) : undefined - }; + const message = createBaseValidatorHistoricalRewardsRecord(); + if (object.validator_address !== undefined && object.validator_address !== null) { + message.validatorAddress = object.validator_address; + } + if (object.period !== undefined && object.period !== null) { + message.period = BigInt(object.period); + } + if (object.rewards !== undefined && object.rewards !== null) { + message.rewards = ValidatorHistoricalRewards.fromAmino(object.rewards); + } + return message; }, toAmino(message: ValidatorHistoricalRewardsRecord): ValidatorHistoricalRewardsRecordAmino { const obj: any = {}; obj.validator_address = message.validatorAddress; obj.period = message.period ? message.period.toString() : undefined; - obj.rewards = message.rewards ? ValidatorHistoricalRewards.toAmino(message.rewards) : undefined; + obj.rewards = message.rewards ? ValidatorHistoricalRewards.toAmino(message.rewards) : ValidatorHistoricalRewards.fromPartial({}); return obj; }, fromAminoMsg(object: ValidatorHistoricalRewardsRecordAminoMsg): ValidatorHistoricalRewardsRecord { @@ -629,6 +747,8 @@ export const ValidatorHistoricalRewardsRecord = { }; } }; +GlobalDecoderRegistry.register(ValidatorHistoricalRewardsRecord.typeUrl, ValidatorHistoricalRewardsRecord); +GlobalDecoderRegistry.registerAminoProtoMapping(ValidatorHistoricalRewardsRecord.aminoType, ValidatorHistoricalRewardsRecord.typeUrl); function createBaseValidatorCurrentRewardsRecord(): ValidatorCurrentRewardsRecord { return { validatorAddress: "", @@ -637,6 +757,16 @@ function createBaseValidatorCurrentRewardsRecord(): ValidatorCurrentRewardsRecor } export const ValidatorCurrentRewardsRecord = { typeUrl: "/cosmos.distribution.v1beta1.ValidatorCurrentRewardsRecord", + aminoType: "cosmos-sdk/ValidatorCurrentRewardsRecord", + is(o: any): o is ValidatorCurrentRewardsRecord { + return o && (o.$typeUrl === ValidatorCurrentRewardsRecord.typeUrl || typeof o.validatorAddress === "string" && ValidatorCurrentRewards.is(o.rewards)); + }, + isSDK(o: any): o is ValidatorCurrentRewardsRecordSDKType { + return o && (o.$typeUrl === ValidatorCurrentRewardsRecord.typeUrl || typeof o.validator_address === "string" && ValidatorCurrentRewards.isSDK(o.rewards)); + }, + isAmino(o: any): o is ValidatorCurrentRewardsRecordAmino { + return o && (o.$typeUrl === ValidatorCurrentRewardsRecord.typeUrl || typeof o.validator_address === "string" && ValidatorCurrentRewards.isAmino(o.rewards)); + }, encode(message: ValidatorCurrentRewardsRecord, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.validatorAddress !== "") { writer.uint32(10).string(message.validatorAddress); @@ -666,6 +796,18 @@ export const ValidatorCurrentRewardsRecord = { } return message; }, + fromJSON(object: any): ValidatorCurrentRewardsRecord { + return { + 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); + message.rewards !== undefined && (obj.rewards = message.rewards ? ValidatorCurrentRewards.toJSON(message.rewards) : undefined); + return obj; + }, fromPartial(object: Partial): ValidatorCurrentRewardsRecord { const message = createBaseValidatorCurrentRewardsRecord(); message.validatorAddress = object.validatorAddress ?? ""; @@ -673,15 +815,19 @@ export const ValidatorCurrentRewardsRecord = { return message; }, fromAmino(object: ValidatorCurrentRewardsRecordAmino): ValidatorCurrentRewardsRecord { - return { - validatorAddress: object.validator_address, - rewards: object?.rewards ? ValidatorCurrentRewards.fromAmino(object.rewards) : undefined - }; + const message = createBaseValidatorCurrentRewardsRecord(); + if (object.validator_address !== undefined && object.validator_address !== null) { + message.validatorAddress = object.validator_address; + } + if (object.rewards !== undefined && object.rewards !== null) { + message.rewards = ValidatorCurrentRewards.fromAmino(object.rewards); + } + return message; }, toAmino(message: ValidatorCurrentRewardsRecord): ValidatorCurrentRewardsRecordAmino { const obj: any = {}; obj.validator_address = message.validatorAddress; - obj.rewards = message.rewards ? ValidatorCurrentRewards.toAmino(message.rewards) : undefined; + obj.rewards = message.rewards ? ValidatorCurrentRewards.toAmino(message.rewards) : ValidatorCurrentRewards.fromPartial({}); return obj; }, fromAminoMsg(object: ValidatorCurrentRewardsRecordAminoMsg): ValidatorCurrentRewardsRecord { @@ -706,6 +852,8 @@ export const ValidatorCurrentRewardsRecord = { }; } }; +GlobalDecoderRegistry.register(ValidatorCurrentRewardsRecord.typeUrl, ValidatorCurrentRewardsRecord); +GlobalDecoderRegistry.registerAminoProtoMapping(ValidatorCurrentRewardsRecord.aminoType, ValidatorCurrentRewardsRecord.typeUrl); function createBaseDelegatorStartingInfoRecord(): DelegatorStartingInfoRecord { return { delegatorAddress: "", @@ -715,6 +863,16 @@ function createBaseDelegatorStartingInfoRecord(): DelegatorStartingInfoRecord { } export const DelegatorStartingInfoRecord = { typeUrl: "/cosmos.distribution.v1beta1.DelegatorStartingInfoRecord", + aminoType: "cosmos-sdk/DelegatorStartingInfoRecord", + is(o: any): o is DelegatorStartingInfoRecord { + return o && (o.$typeUrl === DelegatorStartingInfoRecord.typeUrl || typeof o.delegatorAddress === "string" && typeof o.validatorAddress === "string" && DelegatorStartingInfo.is(o.startingInfo)); + }, + isSDK(o: any): o is DelegatorStartingInfoRecordSDKType { + return o && (o.$typeUrl === DelegatorStartingInfoRecord.typeUrl || typeof o.delegator_address === "string" && typeof o.validator_address === "string" && DelegatorStartingInfo.isSDK(o.starting_info)); + }, + isAmino(o: any): o is DelegatorStartingInfoRecordAmino { + return o && (o.$typeUrl === DelegatorStartingInfoRecord.typeUrl || typeof o.delegator_address === "string" && typeof o.validator_address === "string" && DelegatorStartingInfo.isAmino(o.starting_info)); + }, encode(message: DelegatorStartingInfoRecord, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.delegatorAddress !== "") { writer.uint32(10).string(message.delegatorAddress); @@ -750,6 +908,20 @@ export const DelegatorStartingInfoRecord = { } 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 + }; + }, + toJSON(message: DelegatorStartingInfoRecord): unknown { + 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; + }, fromPartial(object: Partial): DelegatorStartingInfoRecord { const message = createBaseDelegatorStartingInfoRecord(); message.delegatorAddress = object.delegatorAddress ?? ""; @@ -758,17 +930,23 @@ export const DelegatorStartingInfoRecord = { return message; }, fromAmino(object: DelegatorStartingInfoRecordAmino): DelegatorStartingInfoRecord { - return { - delegatorAddress: object.delegator_address, - validatorAddress: object.validator_address, - startingInfo: object?.starting_info ? DelegatorStartingInfo.fromAmino(object.starting_info) : undefined - }; + const message = createBaseDelegatorStartingInfoRecord(); + if (object.delegator_address !== undefined && object.delegator_address !== null) { + message.delegatorAddress = object.delegator_address; + } + if (object.validator_address !== undefined && object.validator_address !== null) { + message.validatorAddress = object.validator_address; + } + if (object.starting_info !== undefined && object.starting_info !== null) { + message.startingInfo = DelegatorStartingInfo.fromAmino(object.starting_info); + } + return message; }, toAmino(message: DelegatorStartingInfoRecord): DelegatorStartingInfoRecordAmino { const obj: any = {}; obj.delegator_address = message.delegatorAddress; obj.validator_address = message.validatorAddress; - obj.starting_info = message.startingInfo ? DelegatorStartingInfo.toAmino(message.startingInfo) : undefined; + obj.starting_info = message.startingInfo ? DelegatorStartingInfo.toAmino(message.startingInfo) : DelegatorStartingInfo.fromPartial({}); return obj; }, fromAminoMsg(object: DelegatorStartingInfoRecordAminoMsg): DelegatorStartingInfoRecord { @@ -793,6 +971,8 @@ export const DelegatorStartingInfoRecord = { }; } }; +GlobalDecoderRegistry.register(DelegatorStartingInfoRecord.typeUrl, DelegatorStartingInfoRecord); +GlobalDecoderRegistry.registerAminoProtoMapping(DelegatorStartingInfoRecord.aminoType, DelegatorStartingInfoRecord.typeUrl); function createBaseValidatorSlashEventRecord(): ValidatorSlashEventRecord { return { validatorAddress: "", @@ -803,6 +983,16 @@ function createBaseValidatorSlashEventRecord(): ValidatorSlashEventRecord { } export const ValidatorSlashEventRecord = { typeUrl: "/cosmos.distribution.v1beta1.ValidatorSlashEventRecord", + aminoType: "cosmos-sdk/ValidatorSlashEventRecord", + is(o: any): o is ValidatorSlashEventRecord { + return o && (o.$typeUrl === ValidatorSlashEventRecord.typeUrl || typeof o.validatorAddress === "string" && typeof o.height === "bigint" && typeof o.period === "bigint" && ValidatorSlashEvent.is(o.validatorSlashEvent)); + }, + isSDK(o: any): o is ValidatorSlashEventRecordSDKType { + return o && (o.$typeUrl === ValidatorSlashEventRecord.typeUrl || typeof o.validator_address === "string" && typeof o.height === "bigint" && typeof o.period === "bigint" && ValidatorSlashEvent.isSDK(o.validator_slash_event)); + }, + isAmino(o: any): o is ValidatorSlashEventRecordAmino { + return o && (o.$typeUrl === ValidatorSlashEventRecord.typeUrl || typeof o.validator_address === "string" && typeof o.height === "bigint" && typeof o.period === "bigint" && ValidatorSlashEvent.isAmino(o.validator_slash_event)); + }, encode(message: ValidatorSlashEventRecord, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.validatorAddress !== "") { writer.uint32(10).string(message.validatorAddress); @@ -844,6 +1034,22 @@ export const ValidatorSlashEventRecord = { } return message; }, + fromJSON(object: any): ValidatorSlashEventRecord { + return { + validatorAddress: isSet(object.validatorAddress) ? String(object.validatorAddress) : "", + height: isSet(object.height) ? BigInt(object.height.toString()) : BigInt(0), + period: isSet(object.period) ? BigInt(object.period.toString()) : BigInt(0), + 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 || BigInt(0)).toString()); + message.period !== undefined && (obj.period = (message.period || BigInt(0)).toString()); + message.validatorSlashEvent !== undefined && (obj.validatorSlashEvent = message.validatorSlashEvent ? ValidatorSlashEvent.toJSON(message.validatorSlashEvent) : undefined); + return obj; + }, fromPartial(object: Partial): ValidatorSlashEventRecord { const message = createBaseValidatorSlashEventRecord(); message.validatorAddress = object.validatorAddress ?? ""; @@ -853,19 +1059,27 @@ export const ValidatorSlashEventRecord = { return message; }, fromAmino(object: ValidatorSlashEventRecordAmino): ValidatorSlashEventRecord { - return { - validatorAddress: object.validator_address, - height: BigInt(object.height), - period: BigInt(object.period), - validatorSlashEvent: object?.validator_slash_event ? ValidatorSlashEvent.fromAmino(object.validator_slash_event) : undefined - }; + const message = createBaseValidatorSlashEventRecord(); + if (object.validator_address !== undefined && object.validator_address !== null) { + message.validatorAddress = object.validator_address; + } + if (object.height !== undefined && object.height !== null) { + message.height = BigInt(object.height); + } + if (object.period !== undefined && object.period !== null) { + message.period = BigInt(object.period); + } + if (object.validator_slash_event !== undefined && object.validator_slash_event !== null) { + message.validatorSlashEvent = ValidatorSlashEvent.fromAmino(object.validator_slash_event); + } + return message; }, toAmino(message: ValidatorSlashEventRecord): ValidatorSlashEventRecordAmino { const obj: any = {}; obj.validator_address = message.validatorAddress; obj.height = message.height ? message.height.toString() : undefined; obj.period = message.period ? message.period.toString() : undefined; - obj.validator_slash_event = message.validatorSlashEvent ? ValidatorSlashEvent.toAmino(message.validatorSlashEvent) : undefined; + obj.validator_slash_event = message.validatorSlashEvent ? ValidatorSlashEvent.toAmino(message.validatorSlashEvent) : ValidatorSlashEvent.fromPartial({}); return obj; }, fromAminoMsg(object: ValidatorSlashEventRecordAminoMsg): ValidatorSlashEventRecord { @@ -890,6 +1104,8 @@ export const ValidatorSlashEventRecord = { }; } }; +GlobalDecoderRegistry.register(ValidatorSlashEventRecord.typeUrl, ValidatorSlashEventRecord); +GlobalDecoderRegistry.registerAminoProtoMapping(ValidatorSlashEventRecord.aminoType, ValidatorSlashEventRecord.typeUrl); function createBaseGenesisState(): GenesisState { return { params: Params.fromPartial({}), @@ -906,6 +1122,16 @@ function createBaseGenesisState(): GenesisState { } export const GenesisState = { typeUrl: "/cosmos.distribution.v1beta1.GenesisState", + aminoType: "cosmos-sdk/GenesisState", + is(o: any): o is GenesisState { + return o && (o.$typeUrl === GenesisState.typeUrl || Params.is(o.params) && FeePool.is(o.feePool) && Array.isArray(o.delegatorWithdrawInfos) && (!o.delegatorWithdrawInfos.length || DelegatorWithdrawInfo.is(o.delegatorWithdrawInfos[0])) && typeof o.previousProposer === "string" && Array.isArray(o.outstandingRewards) && (!o.outstandingRewards.length || ValidatorOutstandingRewardsRecord.is(o.outstandingRewards[0])) && Array.isArray(o.validatorAccumulatedCommissions) && (!o.validatorAccumulatedCommissions.length || ValidatorAccumulatedCommissionRecord.is(o.validatorAccumulatedCommissions[0])) && Array.isArray(o.validatorHistoricalRewards) && (!o.validatorHistoricalRewards.length || ValidatorHistoricalRewardsRecord.is(o.validatorHistoricalRewards[0])) && Array.isArray(o.validatorCurrentRewards) && (!o.validatorCurrentRewards.length || ValidatorCurrentRewardsRecord.is(o.validatorCurrentRewards[0])) && Array.isArray(o.delegatorStartingInfos) && (!o.delegatorStartingInfos.length || DelegatorStartingInfoRecord.is(o.delegatorStartingInfos[0])) && Array.isArray(o.validatorSlashEvents) && (!o.validatorSlashEvents.length || ValidatorSlashEventRecord.is(o.validatorSlashEvents[0]))); + }, + isSDK(o: any): o is GenesisStateSDKType { + return o && (o.$typeUrl === GenesisState.typeUrl || Params.isSDK(o.params) && FeePool.isSDK(o.fee_pool) && Array.isArray(o.delegator_withdraw_infos) && (!o.delegator_withdraw_infos.length || DelegatorWithdrawInfo.isSDK(o.delegator_withdraw_infos[0])) && typeof o.previous_proposer === "string" && Array.isArray(o.outstanding_rewards) && (!o.outstanding_rewards.length || ValidatorOutstandingRewardsRecord.isSDK(o.outstanding_rewards[0])) && Array.isArray(o.validator_accumulated_commissions) && (!o.validator_accumulated_commissions.length || ValidatorAccumulatedCommissionRecord.isSDK(o.validator_accumulated_commissions[0])) && Array.isArray(o.validator_historical_rewards) && (!o.validator_historical_rewards.length || ValidatorHistoricalRewardsRecord.isSDK(o.validator_historical_rewards[0])) && Array.isArray(o.validator_current_rewards) && (!o.validator_current_rewards.length || ValidatorCurrentRewardsRecord.isSDK(o.validator_current_rewards[0])) && Array.isArray(o.delegator_starting_infos) && (!o.delegator_starting_infos.length || DelegatorStartingInfoRecord.isSDK(o.delegator_starting_infos[0])) && Array.isArray(o.validator_slash_events) && (!o.validator_slash_events.length || ValidatorSlashEventRecord.isSDK(o.validator_slash_events[0]))); + }, + isAmino(o: any): o is GenesisStateAmino { + return o && (o.$typeUrl === GenesisState.typeUrl || Params.isAmino(o.params) && FeePool.isAmino(o.fee_pool) && Array.isArray(o.delegator_withdraw_infos) && (!o.delegator_withdraw_infos.length || DelegatorWithdrawInfo.isAmino(o.delegator_withdraw_infos[0])) && typeof o.previous_proposer === "string" && Array.isArray(o.outstanding_rewards) && (!o.outstanding_rewards.length || ValidatorOutstandingRewardsRecord.isAmino(o.outstanding_rewards[0])) && Array.isArray(o.validator_accumulated_commissions) && (!o.validator_accumulated_commissions.length || ValidatorAccumulatedCommissionRecord.isAmino(o.validator_accumulated_commissions[0])) && Array.isArray(o.validator_historical_rewards) && (!o.validator_historical_rewards.length || ValidatorHistoricalRewardsRecord.isAmino(o.validator_historical_rewards[0])) && Array.isArray(o.validator_current_rewards) && (!o.validator_current_rewards.length || ValidatorCurrentRewardsRecord.isAmino(o.validator_current_rewards[0])) && Array.isArray(o.delegator_starting_infos) && (!o.delegator_starting_infos.length || DelegatorStartingInfoRecord.isAmino(o.delegator_starting_infos[0])) && Array.isArray(o.validator_slash_events) && (!o.validator_slash_events.length || ValidatorSlashEventRecord.isAmino(o.validator_slash_events[0]))); + }, encode(message: GenesisState, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.params !== undefined) { Params.encode(message.params, writer.uint32(10).fork()).ldelim(); @@ -983,6 +1209,62 @@ export const GenesisState = { } return message; }, + fromJSON(object: any): GenesisState { + return { + 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)) : [], + previousProposer: isSet(object.previousProposer) ? String(object.previousProposer) : "", + outstandingRewards: Array.isArray(object?.outstandingRewards) ? object.outstandingRewards.map((e: any) => ValidatorOutstandingRewardsRecord.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)) : [], + validatorCurrentRewards: Array.isArray(object?.validatorCurrentRewards) ? object.validatorCurrentRewards.map((e: any) => ValidatorCurrentRewardsRecord.fromJSON(e)) : [], + delegatorStartingInfos: Array.isArray(object?.delegatorStartingInfos) ? object.delegatorStartingInfos.map((e: any) => DelegatorStartingInfoRecord.fromJSON(e)) : [], + validatorSlashEvents: Array.isArray(object?.validatorSlashEvents) ? 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); + if (message.delegatorWithdrawInfos) { + obj.delegatorWithdrawInfos = message.delegatorWithdrawInfos.map(e => e ? DelegatorWithdrawInfo.toJSON(e) : undefined); + } else { + obj.delegatorWithdrawInfos = []; + } + message.previousProposer !== undefined && (obj.previousProposer = message.previousProposer); + if (message.outstandingRewards) { + obj.outstandingRewards = message.outstandingRewards.map(e => e ? ValidatorOutstandingRewardsRecord.toJSON(e) : undefined); + } else { + obj.outstandingRewards = []; + } + if (message.validatorAccumulatedCommissions) { + obj.validatorAccumulatedCommissions = message.validatorAccumulatedCommissions.map(e => e ? ValidatorAccumulatedCommissionRecord.toJSON(e) : undefined); + } else { + obj.validatorAccumulatedCommissions = []; + } + if (message.validatorHistoricalRewards) { + obj.validatorHistoricalRewards = message.validatorHistoricalRewards.map(e => e ? ValidatorHistoricalRewardsRecord.toJSON(e) : undefined); + } else { + obj.validatorHistoricalRewards = []; + } + if (message.validatorCurrentRewards) { + obj.validatorCurrentRewards = message.validatorCurrentRewards.map(e => e ? ValidatorCurrentRewardsRecord.toJSON(e) : undefined); + } else { + obj.validatorCurrentRewards = []; + } + if (message.delegatorStartingInfos) { + obj.delegatorStartingInfos = message.delegatorStartingInfos.map(e => e ? DelegatorStartingInfoRecord.toJSON(e) : undefined); + } else { + obj.delegatorStartingInfos = []; + } + if (message.validatorSlashEvents) { + obj.validatorSlashEvents = message.validatorSlashEvents.map(e => e ? ValidatorSlashEventRecord.toJSON(e) : undefined); + } else { + obj.validatorSlashEvents = []; + } + return obj; + }, fromPartial(object: Partial): GenesisState { const message = createBaseGenesisState(); message.params = object.params !== undefined && object.params !== null ? Params.fromPartial(object.params) : undefined; @@ -998,23 +1280,29 @@ export const GenesisState = { return message; }, fromAmino(object: GenesisStateAmino): GenesisState { - return { - params: object?.params ? Params.fromAmino(object.params) : undefined, - feePool: object?.fee_pool ? FeePool.fromAmino(object.fee_pool) : undefined, - delegatorWithdrawInfos: Array.isArray(object?.delegator_withdraw_infos) ? object.delegator_withdraw_infos.map((e: any) => DelegatorWithdrawInfo.fromAmino(e)) : [], - previousProposer: object.previous_proposer, - outstandingRewards: Array.isArray(object?.outstanding_rewards) ? object.outstanding_rewards.map((e: any) => ValidatorOutstandingRewardsRecord.fromAmino(e)) : [], - validatorAccumulatedCommissions: Array.isArray(object?.validator_accumulated_commissions) ? object.validator_accumulated_commissions.map((e: any) => ValidatorAccumulatedCommissionRecord.fromAmino(e)) : [], - validatorHistoricalRewards: Array.isArray(object?.validator_historical_rewards) ? object.validator_historical_rewards.map((e: any) => ValidatorHistoricalRewardsRecord.fromAmino(e)) : [], - validatorCurrentRewards: Array.isArray(object?.validator_current_rewards) ? object.validator_current_rewards.map((e: any) => ValidatorCurrentRewardsRecord.fromAmino(e)) : [], - delegatorStartingInfos: Array.isArray(object?.delegator_starting_infos) ? object.delegator_starting_infos.map((e: any) => DelegatorStartingInfoRecord.fromAmino(e)) : [], - validatorSlashEvents: Array.isArray(object?.validator_slash_events) ? object.validator_slash_events.map((e: any) => ValidatorSlashEventRecord.fromAmino(e)) : [] - }; + const message = createBaseGenesisState(); + if (object.params !== undefined && object.params !== null) { + message.params = Params.fromAmino(object.params); + } + if (object.fee_pool !== undefined && object.fee_pool !== null) { + message.feePool = FeePool.fromAmino(object.fee_pool); + } + message.delegatorWithdrawInfos = object.delegator_withdraw_infos?.map(e => DelegatorWithdrawInfo.fromAmino(e)) || []; + if (object.previous_proposer !== undefined && object.previous_proposer !== null) { + message.previousProposer = object.previous_proposer; + } + message.outstandingRewards = object.outstanding_rewards?.map(e => ValidatorOutstandingRewardsRecord.fromAmino(e)) || []; + message.validatorAccumulatedCommissions = object.validator_accumulated_commissions?.map(e => ValidatorAccumulatedCommissionRecord.fromAmino(e)) || []; + message.validatorHistoricalRewards = object.validator_historical_rewards?.map(e => ValidatorHistoricalRewardsRecord.fromAmino(e)) || []; + message.validatorCurrentRewards = object.validator_current_rewards?.map(e => ValidatorCurrentRewardsRecord.fromAmino(e)) || []; + message.delegatorStartingInfos = object.delegator_starting_infos?.map(e => DelegatorStartingInfoRecord.fromAmino(e)) || []; + message.validatorSlashEvents = object.validator_slash_events?.map(e => ValidatorSlashEventRecord.fromAmino(e)) || []; + return message; }, toAmino(message: GenesisState): GenesisStateAmino { const obj: any = {}; - obj.params = message.params ? Params.toAmino(message.params) : undefined; - obj.fee_pool = message.feePool ? FeePool.toAmino(message.feePool) : undefined; + obj.params = message.params ? Params.toAmino(message.params) : Params.fromPartial({}); + obj.fee_pool = message.feePool ? FeePool.toAmino(message.feePool) : FeePool.fromPartial({}); if (message.delegatorWithdrawInfos) { obj.delegator_withdraw_infos = message.delegatorWithdrawInfos.map(e => e ? DelegatorWithdrawInfo.toAmino(e) : undefined); } else { @@ -1074,4 +1362,6 @@ export const GenesisState = { value: GenesisState.encode(message).finish() }; } -}; \ No newline at end of file +}; +GlobalDecoderRegistry.register(GenesisState.typeUrl, GenesisState); +GlobalDecoderRegistry.registerAminoProtoMapping(GenesisState.aminoType, GenesisState.typeUrl); \ No newline at end of file diff --git a/packages/osmojs/src/codegen/cosmos/distribution/v1beta1/query.lcd.ts b/packages/osmojs/src/codegen/cosmos/distribution/v1beta1/query.lcd.ts index 1d0dbb185..abaa343fc 100644 --- a/packages/osmojs/src/codegen/cosmos/distribution/v1beta1/query.lcd.ts +++ b/packages/osmojs/src/codegen/cosmos/distribution/v1beta1/query.lcd.ts @@ -1,6 +1,6 @@ import { setPaginationParams } from "../../../helpers"; import { LCDClient } from "@cosmology/lcd"; -import { QueryParamsRequest, QueryParamsResponseSDKType, QueryValidatorOutstandingRewardsRequest, QueryValidatorOutstandingRewardsResponseSDKType, QueryValidatorCommissionRequest, QueryValidatorCommissionResponseSDKType, QueryValidatorSlashesRequest, QueryValidatorSlashesResponseSDKType, QueryDelegationRewardsRequest, QueryDelegationRewardsResponseSDKType, QueryDelegationTotalRewardsRequest, QueryDelegationTotalRewardsResponseSDKType, QueryDelegatorValidatorsRequest, QueryDelegatorValidatorsResponseSDKType, QueryDelegatorWithdrawAddressRequest, QueryDelegatorWithdrawAddressResponseSDKType, QueryCommunityPoolRequest, QueryCommunityPoolResponseSDKType } from "./query"; +import { QueryParamsRequest, QueryParamsResponseSDKType, QueryValidatorDistributionInfoRequest, QueryValidatorDistributionInfoResponseSDKType, QueryValidatorOutstandingRewardsRequest, QueryValidatorOutstandingRewardsResponseSDKType, QueryValidatorCommissionRequest, QueryValidatorCommissionResponseSDKType, QueryValidatorSlashesRequest, QueryValidatorSlashesResponseSDKType, QueryDelegationRewardsRequest, QueryDelegationRewardsResponseSDKType, QueryDelegationTotalRewardsRequest, QueryDelegationTotalRewardsResponseSDKType, QueryDelegatorValidatorsRequest, QueryDelegatorValidatorsResponseSDKType, QueryDelegatorWithdrawAddressRequest, QueryDelegatorWithdrawAddressResponseSDKType, QueryCommunityPoolRequest, QueryCommunityPoolResponseSDKType } from "./query"; export class LCDQueryClient { req: LCDClient; constructor({ @@ -10,6 +10,7 @@ export class LCDQueryClient { }) { this.req = requestClient; this.params = this.params.bind(this); + this.validatorDistributionInfo = this.validatorDistributionInfo.bind(this); this.validatorOutstandingRewards = this.validatorOutstandingRewards.bind(this); this.validatorCommission = this.validatorCommission.bind(this); this.validatorSlashes = this.validatorSlashes.bind(this); @@ -24,6 +25,11 @@ export class LCDQueryClient { const endpoint = `cosmos/distribution/v1beta1/params`; return await this.req.get(endpoint); } + /* ValidatorDistributionInfo queries validator commission and self-delegation rewards for validator */ + async validatorDistributionInfo(params: QueryValidatorDistributionInfoRequest): Promise { + const endpoint = `cosmos/distribution/v1beta1/validators/${params.validatorAddress}`; + return await this.req.get(endpoint); + } /* ValidatorOutstandingRewards queries rewards of a validator address. */ async validatorOutstandingRewards(params: QueryValidatorOutstandingRewardsRequest): Promise { const endpoint = `cosmos/distribution/v1beta1/validators/${params.validatorAddress}/outstanding_rewards`; diff --git a/packages/osmojs/src/codegen/cosmos/distribution/v1beta1/query.rpc.Query.ts b/packages/osmojs/src/codegen/cosmos/distribution/v1beta1/query.rpc.Query.ts index 6ecc809c7..fc5e039eb 100644 --- a/packages/osmojs/src/codegen/cosmos/distribution/v1beta1/query.rpc.Query.ts +++ b/packages/osmojs/src/codegen/cosmos/distribution/v1beta1/query.rpc.Query.ts @@ -1,11 +1,13 @@ import { Rpc } from "../../../helpers"; import { BinaryReader } from "../../../binary"; import { QueryClient, createProtobufRpcClient } from "@cosmjs/stargate"; -import { QueryParamsRequest, QueryParamsResponse, QueryValidatorOutstandingRewardsRequest, QueryValidatorOutstandingRewardsResponse, QueryValidatorCommissionRequest, QueryValidatorCommissionResponse, QueryValidatorSlashesRequest, QueryValidatorSlashesResponse, QueryDelegationRewardsRequest, QueryDelegationRewardsResponse, QueryDelegationTotalRewardsRequest, QueryDelegationTotalRewardsResponse, QueryDelegatorValidatorsRequest, QueryDelegatorValidatorsResponse, QueryDelegatorWithdrawAddressRequest, QueryDelegatorWithdrawAddressResponse, QueryCommunityPoolRequest, QueryCommunityPoolResponse } from "./query"; +import { QueryParamsRequest, QueryParamsResponse, QueryValidatorDistributionInfoRequest, QueryValidatorDistributionInfoResponse, QueryValidatorOutstandingRewardsRequest, QueryValidatorOutstandingRewardsResponse, QueryValidatorCommissionRequest, QueryValidatorCommissionResponse, QueryValidatorSlashesRequest, QueryValidatorSlashesResponse, QueryDelegationRewardsRequest, QueryDelegationRewardsResponse, QueryDelegationTotalRewardsRequest, QueryDelegationTotalRewardsResponse, QueryDelegatorValidatorsRequest, QueryDelegatorValidatorsResponse, QueryDelegatorWithdrawAddressRequest, QueryDelegatorWithdrawAddressResponse, QueryCommunityPoolRequest, QueryCommunityPoolResponse } from "./query"; /** Query defines the gRPC querier service for distribution module. */ export interface Query { /** Params queries params of the distribution module. */ params(request?: QueryParamsRequest): Promise; + /** ValidatorDistributionInfo queries validator commission and self-delegation rewards for validator */ + validatorDistributionInfo(request: QueryValidatorDistributionInfoRequest): Promise; /** ValidatorOutstandingRewards queries rewards of a validator address. */ validatorOutstandingRewards(request: QueryValidatorOutstandingRewardsRequest): Promise; /** ValidatorCommission queries accumulated commission for a validator. */ @@ -31,6 +33,7 @@ export class QueryClientImpl implements Query { constructor(rpc: Rpc) { this.rpc = rpc; this.params = this.params.bind(this); + this.validatorDistributionInfo = this.validatorDistributionInfo.bind(this); this.validatorOutstandingRewards = this.validatorOutstandingRewards.bind(this); this.validatorCommission = this.validatorCommission.bind(this); this.validatorSlashes = this.validatorSlashes.bind(this); @@ -45,6 +48,11 @@ export class QueryClientImpl implements Query { const promise = this.rpc.request("cosmos.distribution.v1beta1.Query", "Params", data); return promise.then(data => QueryParamsResponse.decode(new BinaryReader(data))); } + validatorDistributionInfo(request: QueryValidatorDistributionInfoRequest): Promise { + const data = QueryValidatorDistributionInfoRequest.encode(request).finish(); + const promise = this.rpc.request("cosmos.distribution.v1beta1.Query", "ValidatorDistributionInfo", data); + return promise.then(data => QueryValidatorDistributionInfoResponse.decode(new BinaryReader(data))); + } validatorOutstandingRewards(request: QueryValidatorOutstandingRewardsRequest): Promise { const data = QueryValidatorOutstandingRewardsRequest.encode(request).finish(); const promise = this.rpc.request("cosmos.distribution.v1beta1.Query", "ValidatorOutstandingRewards", data); @@ -93,6 +101,9 @@ export const createRpcQueryExtension = (base: QueryClient) => { params(request?: QueryParamsRequest): Promise { return queryService.params(request); }, + validatorDistributionInfo(request: QueryValidatorDistributionInfoRequest): Promise { + return queryService.validatorDistributionInfo(request); + }, validatorOutstandingRewards(request: QueryValidatorOutstandingRewardsRequest): Promise { return queryService.validatorOutstandingRewards(request); }, diff --git a/packages/osmojs/src/codegen/cosmos/distribution/v1beta1/query.ts b/packages/osmojs/src/codegen/cosmos/distribution/v1beta1/query.ts index fa5dd71a3..3ab352743 100644 --- a/packages/osmojs/src/codegen/cosmos/distribution/v1beta1/query.ts +++ b/packages/osmojs/src/codegen/cosmos/distribution/v1beta1/query.ts @@ -2,6 +2,8 @@ import { PageRequest, PageRequestAmino, PageRequestSDKType, PageResponse, PageRe import { Params, ParamsAmino, ParamsSDKType, ValidatorOutstandingRewards, ValidatorOutstandingRewardsAmino, ValidatorOutstandingRewardsSDKType, ValidatorAccumulatedCommission, ValidatorAccumulatedCommissionAmino, ValidatorAccumulatedCommissionSDKType, ValidatorSlashEvent, ValidatorSlashEventAmino, ValidatorSlashEventSDKType, DelegationDelegatorReward, DelegationDelegatorRewardAmino, DelegationDelegatorRewardSDKType } from "./distribution"; import { DecCoin, DecCoinAmino, DecCoinSDKType } from "../../base/v1beta1/coin"; import { BinaryReader, BinaryWriter } from "../../../binary"; +import { GlobalDecoderRegistry } from "../../../registry"; +import { isSet } from "../../../helpers"; /** QueryParamsRequest is the request type for the Query/Params RPC method. */ export interface QueryParamsRequest {} export interface QueryParamsRequestProtoMsg { @@ -28,7 +30,7 @@ export interface QueryParamsResponseProtoMsg { /** QueryParamsResponse is the response type for the Query/Params RPC method. */ export interface QueryParamsResponseAmino { /** params defines the parameters of the module. */ - params?: ParamsAmino; + params: ParamsAmino; } export interface QueryParamsResponseAminoMsg { type: "cosmos-sdk/QueryParamsResponse"; @@ -38,6 +40,60 @@ export interface QueryParamsResponseAminoMsg { export interface QueryParamsResponseSDKType { params: ParamsSDKType; } +/** QueryValidatorDistributionInfoRequest is the request type for the Query/ValidatorDistributionInfo RPC method. */ +export interface QueryValidatorDistributionInfoRequest { + /** validator_address defines the validator address to query for. */ + validatorAddress: string; +} +export interface QueryValidatorDistributionInfoRequestProtoMsg { + typeUrl: "/cosmos.distribution.v1beta1.QueryValidatorDistributionInfoRequest"; + value: Uint8Array; +} +/** QueryValidatorDistributionInfoRequest is the request type for the Query/ValidatorDistributionInfo RPC method. */ +export interface QueryValidatorDistributionInfoRequestAmino { + /** validator_address defines the validator address to query for. */ + validator_address?: string; +} +export interface QueryValidatorDistributionInfoRequestAminoMsg { + type: "cosmos-sdk/QueryValidatorDistributionInfoRequest"; + value: QueryValidatorDistributionInfoRequestAmino; +} +/** QueryValidatorDistributionInfoRequest is the request type for the Query/ValidatorDistributionInfo RPC method. */ +export interface QueryValidatorDistributionInfoRequestSDKType { + validator_address: string; +} +/** QueryValidatorDistributionInfoResponse is the response type for the Query/ValidatorDistributionInfo RPC method. */ +export interface QueryValidatorDistributionInfoResponse { + /** operator_address defines the validator operator address. */ + operatorAddress: string; + /** self_bond_rewards defines the self delegations rewards. */ + selfBondRewards: DecCoin[]; + /** commission defines the commission the validator received. */ + commission: DecCoin[]; +} +export interface QueryValidatorDistributionInfoResponseProtoMsg { + typeUrl: "/cosmos.distribution.v1beta1.QueryValidatorDistributionInfoResponse"; + value: Uint8Array; +} +/** QueryValidatorDistributionInfoResponse is the response type for the Query/ValidatorDistributionInfo RPC method. */ +export interface QueryValidatorDistributionInfoResponseAmino { + /** operator_address defines the validator operator address. */ + operator_address?: string; + /** self_bond_rewards defines the self delegations rewards. */ + self_bond_rewards: DecCoinAmino[]; + /** commission defines the commission the validator received. */ + commission?: DecCoinAmino[]; +} +export interface QueryValidatorDistributionInfoResponseAminoMsg { + type: "cosmos-sdk/QueryValidatorDistributionInfoResponse"; + value: QueryValidatorDistributionInfoResponseAmino; +} +/** QueryValidatorDistributionInfoResponse is the response type for the Query/ValidatorDistributionInfo RPC method. */ +export interface QueryValidatorDistributionInfoResponseSDKType { + operator_address: string; + self_bond_rewards: DecCoinSDKType[]; + commission: DecCoinSDKType[]; +} /** * QueryValidatorOutstandingRewardsRequest is the request type for the * Query/ValidatorOutstandingRewards RPC method. @@ -56,7 +112,7 @@ export interface QueryValidatorOutstandingRewardsRequestProtoMsg { */ export interface QueryValidatorOutstandingRewardsRequestAmino { /** validator_address defines the validator address to query for. */ - validator_address: string; + validator_address?: string; } export interface QueryValidatorOutstandingRewardsRequestAminoMsg { type: "cosmos-sdk/QueryValidatorOutstandingRewardsRequest"; @@ -85,7 +141,7 @@ export interface QueryValidatorOutstandingRewardsResponseProtoMsg { * Query/ValidatorOutstandingRewards RPC method. */ export interface QueryValidatorOutstandingRewardsResponseAmino { - rewards?: ValidatorOutstandingRewardsAmino; + rewards: ValidatorOutstandingRewardsAmino; } export interface QueryValidatorOutstandingRewardsResponseAminoMsg { type: "cosmos-sdk/QueryValidatorOutstandingRewardsResponse"; @@ -116,7 +172,7 @@ export interface QueryValidatorCommissionRequestProtoMsg { */ export interface QueryValidatorCommissionRequestAmino { /** validator_address defines the validator address to query for. */ - validator_address: string; + validator_address?: string; } export interface QueryValidatorCommissionRequestAminoMsg { type: "cosmos-sdk/QueryValidatorCommissionRequest"; @@ -134,7 +190,7 @@ export interface QueryValidatorCommissionRequestSDKType { * Query/ValidatorCommission RPC method */ export interface QueryValidatorCommissionResponse { - /** commission defines the commision the validator received. */ + /** commission defines the commission the validator received. */ commission: ValidatorAccumulatedCommission; } export interface QueryValidatorCommissionResponseProtoMsg { @@ -146,8 +202,8 @@ export interface QueryValidatorCommissionResponseProtoMsg { * Query/ValidatorCommission RPC method */ export interface QueryValidatorCommissionResponseAmino { - /** commission defines the commision the validator received. */ - commission?: ValidatorAccumulatedCommissionAmino; + /** commission defines the commission the validator received. */ + commission: ValidatorAccumulatedCommissionAmino; } export interface QueryValidatorCommissionResponseAminoMsg { type: "cosmos-sdk/QueryValidatorCommissionResponse"; @@ -172,7 +228,7 @@ export interface QueryValidatorSlashesRequest { /** starting_height defines the optional ending height to query the slashes. */ endingHeight: bigint; /** pagination defines an optional pagination for the request. */ - pagination: PageRequest; + pagination?: PageRequest; } export interface QueryValidatorSlashesRequestProtoMsg { typeUrl: "/cosmos.distribution.v1beta1.QueryValidatorSlashesRequest"; @@ -184,11 +240,11 @@ export interface QueryValidatorSlashesRequestProtoMsg { */ export interface QueryValidatorSlashesRequestAmino { /** validator_address defines the validator address to query for. */ - validator_address: string; + validator_address?: string; /** starting_height defines the optional starting height to query the slashes. */ - starting_height: string; + starting_height?: string; /** starting_height defines the optional ending height to query the slashes. */ - ending_height: string; + ending_height?: string; /** pagination defines an optional pagination for the request. */ pagination?: PageRequestAmino; } @@ -204,7 +260,7 @@ export interface QueryValidatorSlashesRequestSDKType { validator_address: string; starting_height: bigint; ending_height: bigint; - pagination: PageRequestSDKType; + pagination?: PageRequestSDKType; } /** * QueryValidatorSlashesResponse is the response type for the @@ -214,7 +270,7 @@ export interface QueryValidatorSlashesResponse { /** slashes defines the slashes the validator received. */ slashes: ValidatorSlashEvent[]; /** pagination defines the pagination in the response. */ - pagination: PageResponse; + pagination?: PageResponse; } export interface QueryValidatorSlashesResponseProtoMsg { typeUrl: "/cosmos.distribution.v1beta1.QueryValidatorSlashesResponse"; @@ -240,7 +296,7 @@ export interface QueryValidatorSlashesResponseAminoMsg { */ export interface QueryValidatorSlashesResponseSDKType { slashes: ValidatorSlashEventSDKType[]; - pagination: PageResponseSDKType; + pagination?: PageResponseSDKType; } /** * QueryDelegationRewardsRequest is the request type for the @@ -262,9 +318,9 @@ export interface QueryDelegationRewardsRequestProtoMsg { */ export interface QueryDelegationRewardsRequestAmino { /** delegator_address defines the delegator address to query for. */ - delegator_address: string; + delegator_address?: string; /** validator_address defines the validator address to query for. */ - validator_address: string; + validator_address?: string; } export interface QueryDelegationRewardsRequestAminoMsg { type: "cosmos-sdk/QueryDelegationRewardsRequest"; @@ -327,7 +383,7 @@ export interface QueryDelegationTotalRewardsRequestProtoMsg { */ export interface QueryDelegationTotalRewardsRequestAmino { /** delegator_address defines the delegator address to query for. */ - delegator_address: string; + delegator_address?: string; } export interface QueryDelegationTotalRewardsRequestAminoMsg { type: "cosmos-sdk/QueryDelegationTotalRewardsRequest"; @@ -394,7 +450,7 @@ export interface QueryDelegatorValidatorsRequestProtoMsg { */ export interface QueryDelegatorValidatorsRequestAmino { /** delegator_address defines the delegator address to query for. */ - delegator_address: string; + delegator_address?: string; } export interface QueryDelegatorValidatorsRequestAminoMsg { type: "cosmos-sdk/QueryDelegatorValidatorsRequest"; @@ -425,7 +481,7 @@ export interface QueryDelegatorValidatorsResponseProtoMsg { */ export interface QueryDelegatorValidatorsResponseAmino { /** validators defines the validators a delegator is delegating for. */ - validators: string[]; + validators?: string[]; } export interface QueryDelegatorValidatorsResponseAminoMsg { type: "cosmos-sdk/QueryDelegatorValidatorsResponse"; @@ -456,7 +512,7 @@ export interface QueryDelegatorWithdrawAddressRequestProtoMsg { */ export interface QueryDelegatorWithdrawAddressRequestAmino { /** delegator_address defines the delegator address to query for. */ - delegator_address: string; + delegator_address?: string; } export interface QueryDelegatorWithdrawAddressRequestAminoMsg { type: "cosmos-sdk/QueryDelegatorWithdrawAddressRequest"; @@ -487,7 +543,7 @@ export interface QueryDelegatorWithdrawAddressResponseProtoMsg { */ export interface QueryDelegatorWithdrawAddressResponseAmino { /** withdraw_address defines the delegator address to query for. */ - withdraw_address: string; + withdraw_address?: string; } export interface QueryDelegatorWithdrawAddressResponseAminoMsg { type: "cosmos-sdk/QueryDelegatorWithdrawAddressResponse"; @@ -559,6 +615,16 @@ function createBaseQueryParamsRequest(): QueryParamsRequest { } export const QueryParamsRequest = { typeUrl: "/cosmos.distribution.v1beta1.QueryParamsRequest", + aminoType: "cosmos-sdk/QueryParamsRequest", + is(o: any): o is QueryParamsRequest { + return o && o.$typeUrl === QueryParamsRequest.typeUrl; + }, + isSDK(o: any): o is QueryParamsRequestSDKType { + return o && o.$typeUrl === QueryParamsRequest.typeUrl; + }, + isAmino(o: any): o is QueryParamsRequestAmino { + return o && o.$typeUrl === QueryParamsRequest.typeUrl; + }, encode(_: QueryParamsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, @@ -576,12 +642,20 @@ export const QueryParamsRequest = { } return message; }, + fromJSON(_: any): QueryParamsRequest { + return {}; + }, + toJSON(_: QueryParamsRequest): unknown { + const obj: any = {}; + return obj; + }, fromPartial(_: Partial): QueryParamsRequest { const message = createBaseQueryParamsRequest(); return message; }, fromAmino(_: QueryParamsRequestAmino): QueryParamsRequest { - return {}; + const message = createBaseQueryParamsRequest(); + return message; }, toAmino(_: QueryParamsRequest): QueryParamsRequestAmino { const obj: any = {}; @@ -609,6 +683,8 @@ export const QueryParamsRequest = { }; } }; +GlobalDecoderRegistry.register(QueryParamsRequest.typeUrl, QueryParamsRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryParamsRequest.aminoType, QueryParamsRequest.typeUrl); function createBaseQueryParamsResponse(): QueryParamsResponse { return { params: Params.fromPartial({}) @@ -616,6 +692,16 @@ function createBaseQueryParamsResponse(): QueryParamsResponse { } export const QueryParamsResponse = { typeUrl: "/cosmos.distribution.v1beta1.QueryParamsResponse", + aminoType: "cosmos-sdk/QueryParamsResponse", + is(o: any): o is QueryParamsResponse { + return o && (o.$typeUrl === QueryParamsResponse.typeUrl || Params.is(o.params)); + }, + isSDK(o: any): o is QueryParamsResponseSDKType { + return o && (o.$typeUrl === QueryParamsResponse.typeUrl || Params.isSDK(o.params)); + }, + isAmino(o: any): o is QueryParamsResponseAmino { + return o && (o.$typeUrl === QueryParamsResponse.typeUrl || Params.isAmino(o.params)); + }, encode(message: QueryParamsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.params !== undefined) { Params.encode(message.params, writer.uint32(10).fork()).ldelim(); @@ -639,19 +725,31 @@ export const QueryParamsResponse = { } return message; }, + fromJSON(object: any): QueryParamsResponse { + 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; + }, fromPartial(object: Partial): QueryParamsResponse { const message = createBaseQueryParamsResponse(); message.params = object.params !== undefined && object.params !== null ? Params.fromPartial(object.params) : undefined; return message; }, fromAmino(object: QueryParamsResponseAmino): QueryParamsResponse { - return { - params: object?.params ? Params.fromAmino(object.params) : undefined - }; + const message = createBaseQueryParamsResponse(); + if (object.params !== undefined && object.params !== null) { + message.params = Params.fromAmino(object.params); + } + return message; }, toAmino(message: QueryParamsResponse): QueryParamsResponseAmino { const obj: any = {}; - obj.params = message.params ? Params.toAmino(message.params) : undefined; + obj.params = message.params ? Params.toAmino(message.params) : Params.fromPartial({}); return obj; }, fromAminoMsg(object: QueryParamsResponseAminoMsg): QueryParamsResponse { @@ -676,6 +774,230 @@ export const QueryParamsResponse = { }; } }; +GlobalDecoderRegistry.register(QueryParamsResponse.typeUrl, QueryParamsResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryParamsResponse.aminoType, QueryParamsResponse.typeUrl); +function createBaseQueryValidatorDistributionInfoRequest(): QueryValidatorDistributionInfoRequest { + return { + validatorAddress: "" + }; +} +export const QueryValidatorDistributionInfoRequest = { + typeUrl: "/cosmos.distribution.v1beta1.QueryValidatorDistributionInfoRequest", + aminoType: "cosmos-sdk/QueryValidatorDistributionInfoRequest", + is(o: any): o is QueryValidatorDistributionInfoRequest { + return o && (o.$typeUrl === QueryValidatorDistributionInfoRequest.typeUrl || typeof o.validatorAddress === "string"); + }, + isSDK(o: any): o is QueryValidatorDistributionInfoRequestSDKType { + return o && (o.$typeUrl === QueryValidatorDistributionInfoRequest.typeUrl || typeof o.validator_address === "string"); + }, + isAmino(o: any): o is QueryValidatorDistributionInfoRequestAmino { + return o && (o.$typeUrl === QueryValidatorDistributionInfoRequest.typeUrl || typeof o.validator_address === "string"); + }, + encode(message: QueryValidatorDistributionInfoRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.validatorAddress !== "") { + writer.uint32(10).string(message.validatorAddress); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryValidatorDistributionInfoRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryValidatorDistributionInfoRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.validatorAddress = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): QueryValidatorDistributionInfoRequest { + return { + validatorAddress: isSet(object.validatorAddress) ? String(object.validatorAddress) : "" + }; + }, + toJSON(message: QueryValidatorDistributionInfoRequest): unknown { + const obj: any = {}; + message.validatorAddress !== undefined && (obj.validatorAddress = message.validatorAddress); + return obj; + }, + fromPartial(object: Partial): QueryValidatorDistributionInfoRequest { + const message = createBaseQueryValidatorDistributionInfoRequest(); + message.validatorAddress = object.validatorAddress ?? ""; + return message; + }, + fromAmino(object: QueryValidatorDistributionInfoRequestAmino): QueryValidatorDistributionInfoRequest { + const message = createBaseQueryValidatorDistributionInfoRequest(); + if (object.validator_address !== undefined && object.validator_address !== null) { + message.validatorAddress = object.validator_address; + } + return message; + }, + toAmino(message: QueryValidatorDistributionInfoRequest): QueryValidatorDistributionInfoRequestAmino { + const obj: any = {}; + obj.validator_address = message.validatorAddress; + return obj; + }, + fromAminoMsg(object: QueryValidatorDistributionInfoRequestAminoMsg): QueryValidatorDistributionInfoRequest { + return QueryValidatorDistributionInfoRequest.fromAmino(object.value); + }, + toAminoMsg(message: QueryValidatorDistributionInfoRequest): QueryValidatorDistributionInfoRequestAminoMsg { + return { + type: "cosmos-sdk/QueryValidatorDistributionInfoRequest", + value: QueryValidatorDistributionInfoRequest.toAmino(message) + }; + }, + fromProtoMsg(message: QueryValidatorDistributionInfoRequestProtoMsg): QueryValidatorDistributionInfoRequest { + return QueryValidatorDistributionInfoRequest.decode(message.value); + }, + toProto(message: QueryValidatorDistributionInfoRequest): Uint8Array { + return QueryValidatorDistributionInfoRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryValidatorDistributionInfoRequest): QueryValidatorDistributionInfoRequestProtoMsg { + return { + typeUrl: "/cosmos.distribution.v1beta1.QueryValidatorDistributionInfoRequest", + value: QueryValidatorDistributionInfoRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryValidatorDistributionInfoRequest.typeUrl, QueryValidatorDistributionInfoRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryValidatorDistributionInfoRequest.aminoType, QueryValidatorDistributionInfoRequest.typeUrl); +function createBaseQueryValidatorDistributionInfoResponse(): QueryValidatorDistributionInfoResponse { + return { + operatorAddress: "", + selfBondRewards: [], + commission: [] + }; +} +export const QueryValidatorDistributionInfoResponse = { + typeUrl: "/cosmos.distribution.v1beta1.QueryValidatorDistributionInfoResponse", + aminoType: "cosmos-sdk/QueryValidatorDistributionInfoResponse", + is(o: any): o is QueryValidatorDistributionInfoResponse { + return o && (o.$typeUrl === QueryValidatorDistributionInfoResponse.typeUrl || typeof o.operatorAddress === "string" && Array.isArray(o.selfBondRewards) && (!o.selfBondRewards.length || DecCoin.is(o.selfBondRewards[0])) && Array.isArray(o.commission) && (!o.commission.length || DecCoin.is(o.commission[0]))); + }, + isSDK(o: any): o is QueryValidatorDistributionInfoResponseSDKType { + return o && (o.$typeUrl === QueryValidatorDistributionInfoResponse.typeUrl || typeof o.operator_address === "string" && Array.isArray(o.self_bond_rewards) && (!o.self_bond_rewards.length || DecCoin.isSDK(o.self_bond_rewards[0])) && Array.isArray(o.commission) && (!o.commission.length || DecCoin.isSDK(o.commission[0]))); + }, + isAmino(o: any): o is QueryValidatorDistributionInfoResponseAmino { + return o && (o.$typeUrl === QueryValidatorDistributionInfoResponse.typeUrl || typeof o.operator_address === "string" && Array.isArray(o.self_bond_rewards) && (!o.self_bond_rewards.length || DecCoin.isAmino(o.self_bond_rewards[0])) && Array.isArray(o.commission) && (!o.commission.length || DecCoin.isAmino(o.commission[0]))); + }, + encode(message: QueryValidatorDistributionInfoResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.operatorAddress !== "") { + writer.uint32(10).string(message.operatorAddress); + } + for (const v of message.selfBondRewards) { + DecCoin.encode(v!, writer.uint32(18).fork()).ldelim(); + } + for (const v of message.commission) { + DecCoin.encode(v!, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryValidatorDistributionInfoResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryValidatorDistributionInfoResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.operatorAddress = reader.string(); + break; + case 2: + message.selfBondRewards.push(DecCoin.decode(reader, reader.uint32())); + break; + case 3: + message.commission.push(DecCoin.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): QueryValidatorDistributionInfoResponse { + return { + operatorAddress: isSet(object.operatorAddress) ? String(object.operatorAddress) : "", + selfBondRewards: Array.isArray(object?.selfBondRewards) ? object.selfBondRewards.map((e: any) => DecCoin.fromJSON(e)) : [], + commission: Array.isArray(object?.commission) ? object.commission.map((e: any) => DecCoin.fromJSON(e)) : [] + }; + }, + toJSON(message: QueryValidatorDistributionInfoResponse): unknown { + const obj: any = {}; + message.operatorAddress !== undefined && (obj.operatorAddress = message.operatorAddress); + if (message.selfBondRewards) { + obj.selfBondRewards = message.selfBondRewards.map(e => e ? DecCoin.toJSON(e) : undefined); + } else { + obj.selfBondRewards = []; + } + if (message.commission) { + obj.commission = message.commission.map(e => e ? DecCoin.toJSON(e) : undefined); + } else { + obj.commission = []; + } + return obj; + }, + fromPartial(object: Partial): QueryValidatorDistributionInfoResponse { + const message = createBaseQueryValidatorDistributionInfoResponse(); + message.operatorAddress = object.operatorAddress ?? ""; + message.selfBondRewards = object.selfBondRewards?.map(e => DecCoin.fromPartial(e)) || []; + message.commission = object.commission?.map(e => DecCoin.fromPartial(e)) || []; + return message; + }, + fromAmino(object: QueryValidatorDistributionInfoResponseAmino): QueryValidatorDistributionInfoResponse { + const message = createBaseQueryValidatorDistributionInfoResponse(); + if (object.operator_address !== undefined && object.operator_address !== null) { + message.operatorAddress = object.operator_address; + } + message.selfBondRewards = object.self_bond_rewards?.map(e => DecCoin.fromAmino(e)) || []; + message.commission = object.commission?.map(e => DecCoin.fromAmino(e)) || []; + return message; + }, + toAmino(message: QueryValidatorDistributionInfoResponse): QueryValidatorDistributionInfoResponseAmino { + const obj: any = {}; + obj.operator_address = message.operatorAddress; + if (message.selfBondRewards) { + obj.self_bond_rewards = message.selfBondRewards.map(e => e ? DecCoin.toAmino(e) : undefined); + } else { + obj.self_bond_rewards = []; + } + if (message.commission) { + obj.commission = message.commission.map(e => e ? DecCoin.toAmino(e) : undefined); + } else { + obj.commission = []; + } + return obj; + }, + fromAminoMsg(object: QueryValidatorDistributionInfoResponseAminoMsg): QueryValidatorDistributionInfoResponse { + return QueryValidatorDistributionInfoResponse.fromAmino(object.value); + }, + toAminoMsg(message: QueryValidatorDistributionInfoResponse): QueryValidatorDistributionInfoResponseAminoMsg { + return { + type: "cosmos-sdk/QueryValidatorDistributionInfoResponse", + value: QueryValidatorDistributionInfoResponse.toAmino(message) + }; + }, + fromProtoMsg(message: QueryValidatorDistributionInfoResponseProtoMsg): QueryValidatorDistributionInfoResponse { + return QueryValidatorDistributionInfoResponse.decode(message.value); + }, + toProto(message: QueryValidatorDistributionInfoResponse): Uint8Array { + return QueryValidatorDistributionInfoResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryValidatorDistributionInfoResponse): QueryValidatorDistributionInfoResponseProtoMsg { + return { + typeUrl: "/cosmos.distribution.v1beta1.QueryValidatorDistributionInfoResponse", + value: QueryValidatorDistributionInfoResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryValidatorDistributionInfoResponse.typeUrl, QueryValidatorDistributionInfoResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryValidatorDistributionInfoResponse.aminoType, QueryValidatorDistributionInfoResponse.typeUrl); function createBaseQueryValidatorOutstandingRewardsRequest(): QueryValidatorOutstandingRewardsRequest { return { validatorAddress: "" @@ -683,6 +1005,16 @@ function createBaseQueryValidatorOutstandingRewardsRequest(): QueryValidatorOuts } export const QueryValidatorOutstandingRewardsRequest = { typeUrl: "/cosmos.distribution.v1beta1.QueryValidatorOutstandingRewardsRequest", + aminoType: "cosmos-sdk/QueryValidatorOutstandingRewardsRequest", + is(o: any): o is QueryValidatorOutstandingRewardsRequest { + return o && (o.$typeUrl === QueryValidatorOutstandingRewardsRequest.typeUrl || typeof o.validatorAddress === "string"); + }, + isSDK(o: any): o is QueryValidatorOutstandingRewardsRequestSDKType { + return o && (o.$typeUrl === QueryValidatorOutstandingRewardsRequest.typeUrl || typeof o.validator_address === "string"); + }, + isAmino(o: any): o is QueryValidatorOutstandingRewardsRequestAmino { + return o && (o.$typeUrl === QueryValidatorOutstandingRewardsRequest.typeUrl || typeof o.validator_address === "string"); + }, encode(message: QueryValidatorOutstandingRewardsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.validatorAddress !== "") { writer.uint32(10).string(message.validatorAddress); @@ -706,15 +1038,27 @@ export const QueryValidatorOutstandingRewardsRequest = { } return message; }, + fromJSON(object: any): QueryValidatorOutstandingRewardsRequest { + return { + validatorAddress: isSet(object.validatorAddress) ? String(object.validatorAddress) : "" + }; + }, + toJSON(message: QueryValidatorOutstandingRewardsRequest): unknown { + const obj: any = {}; + message.validatorAddress !== undefined && (obj.validatorAddress = message.validatorAddress); + return obj; + }, fromPartial(object: Partial): QueryValidatorOutstandingRewardsRequest { const message = createBaseQueryValidatorOutstandingRewardsRequest(); message.validatorAddress = object.validatorAddress ?? ""; return message; }, fromAmino(object: QueryValidatorOutstandingRewardsRequestAmino): QueryValidatorOutstandingRewardsRequest { - return { - validatorAddress: object.validator_address - }; + const message = createBaseQueryValidatorOutstandingRewardsRequest(); + if (object.validator_address !== undefined && object.validator_address !== null) { + message.validatorAddress = object.validator_address; + } + return message; }, toAmino(message: QueryValidatorOutstandingRewardsRequest): QueryValidatorOutstandingRewardsRequestAmino { const obj: any = {}; @@ -743,6 +1087,8 @@ export const QueryValidatorOutstandingRewardsRequest = { }; } }; +GlobalDecoderRegistry.register(QueryValidatorOutstandingRewardsRequest.typeUrl, QueryValidatorOutstandingRewardsRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryValidatorOutstandingRewardsRequest.aminoType, QueryValidatorOutstandingRewardsRequest.typeUrl); function createBaseQueryValidatorOutstandingRewardsResponse(): QueryValidatorOutstandingRewardsResponse { return { rewards: ValidatorOutstandingRewards.fromPartial({}) @@ -750,6 +1096,16 @@ function createBaseQueryValidatorOutstandingRewardsResponse(): QueryValidatorOut } export const QueryValidatorOutstandingRewardsResponse = { typeUrl: "/cosmos.distribution.v1beta1.QueryValidatorOutstandingRewardsResponse", + aminoType: "cosmos-sdk/QueryValidatorOutstandingRewardsResponse", + is(o: any): o is QueryValidatorOutstandingRewardsResponse { + return o && (o.$typeUrl === QueryValidatorOutstandingRewardsResponse.typeUrl || ValidatorOutstandingRewards.is(o.rewards)); + }, + isSDK(o: any): o is QueryValidatorOutstandingRewardsResponseSDKType { + return o && (o.$typeUrl === QueryValidatorOutstandingRewardsResponse.typeUrl || ValidatorOutstandingRewards.isSDK(o.rewards)); + }, + isAmino(o: any): o is QueryValidatorOutstandingRewardsResponseAmino { + return o && (o.$typeUrl === QueryValidatorOutstandingRewardsResponse.typeUrl || ValidatorOutstandingRewards.isAmino(o.rewards)); + }, encode(message: QueryValidatorOutstandingRewardsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.rewards !== undefined) { ValidatorOutstandingRewards.encode(message.rewards, writer.uint32(10).fork()).ldelim(); @@ -773,19 +1129,31 @@ export const QueryValidatorOutstandingRewardsResponse = { } return message; }, + fromJSON(object: any): QueryValidatorOutstandingRewardsResponse { + return { + rewards: isSet(object.rewards) ? ValidatorOutstandingRewards.fromJSON(object.rewards) : undefined + }; + }, + toJSON(message: QueryValidatorOutstandingRewardsResponse): unknown { + const obj: any = {}; + message.rewards !== undefined && (obj.rewards = message.rewards ? ValidatorOutstandingRewards.toJSON(message.rewards) : undefined); + return obj; + }, fromPartial(object: Partial): QueryValidatorOutstandingRewardsResponse { const message = createBaseQueryValidatorOutstandingRewardsResponse(); message.rewards = object.rewards !== undefined && object.rewards !== null ? ValidatorOutstandingRewards.fromPartial(object.rewards) : undefined; return message; }, fromAmino(object: QueryValidatorOutstandingRewardsResponseAmino): QueryValidatorOutstandingRewardsResponse { - return { - rewards: object?.rewards ? ValidatorOutstandingRewards.fromAmino(object.rewards) : undefined - }; + const message = createBaseQueryValidatorOutstandingRewardsResponse(); + if (object.rewards !== undefined && object.rewards !== null) { + message.rewards = ValidatorOutstandingRewards.fromAmino(object.rewards); + } + return message; }, toAmino(message: QueryValidatorOutstandingRewardsResponse): QueryValidatorOutstandingRewardsResponseAmino { const obj: any = {}; - obj.rewards = message.rewards ? ValidatorOutstandingRewards.toAmino(message.rewards) : undefined; + obj.rewards = message.rewards ? ValidatorOutstandingRewards.toAmino(message.rewards) : ValidatorOutstandingRewards.fromPartial({}); return obj; }, fromAminoMsg(object: QueryValidatorOutstandingRewardsResponseAminoMsg): QueryValidatorOutstandingRewardsResponse { @@ -810,6 +1178,8 @@ export const QueryValidatorOutstandingRewardsResponse = { }; } }; +GlobalDecoderRegistry.register(QueryValidatorOutstandingRewardsResponse.typeUrl, QueryValidatorOutstandingRewardsResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryValidatorOutstandingRewardsResponse.aminoType, QueryValidatorOutstandingRewardsResponse.typeUrl); function createBaseQueryValidatorCommissionRequest(): QueryValidatorCommissionRequest { return { validatorAddress: "" @@ -817,6 +1187,16 @@ function createBaseQueryValidatorCommissionRequest(): QueryValidatorCommissionRe } export const QueryValidatorCommissionRequest = { typeUrl: "/cosmos.distribution.v1beta1.QueryValidatorCommissionRequest", + aminoType: "cosmos-sdk/QueryValidatorCommissionRequest", + is(o: any): o is QueryValidatorCommissionRequest { + return o && (o.$typeUrl === QueryValidatorCommissionRequest.typeUrl || typeof o.validatorAddress === "string"); + }, + isSDK(o: any): o is QueryValidatorCommissionRequestSDKType { + return o && (o.$typeUrl === QueryValidatorCommissionRequest.typeUrl || typeof o.validator_address === "string"); + }, + isAmino(o: any): o is QueryValidatorCommissionRequestAmino { + return o && (o.$typeUrl === QueryValidatorCommissionRequest.typeUrl || typeof o.validator_address === "string"); + }, encode(message: QueryValidatorCommissionRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.validatorAddress !== "") { writer.uint32(10).string(message.validatorAddress); @@ -840,15 +1220,27 @@ export const QueryValidatorCommissionRequest = { } return message; }, + fromJSON(object: any): QueryValidatorCommissionRequest { + return { + validatorAddress: isSet(object.validatorAddress) ? String(object.validatorAddress) : "" + }; + }, + toJSON(message: QueryValidatorCommissionRequest): unknown { + const obj: any = {}; + message.validatorAddress !== undefined && (obj.validatorAddress = message.validatorAddress); + return obj; + }, fromPartial(object: Partial): QueryValidatorCommissionRequest { const message = createBaseQueryValidatorCommissionRequest(); message.validatorAddress = object.validatorAddress ?? ""; return message; }, fromAmino(object: QueryValidatorCommissionRequestAmino): QueryValidatorCommissionRequest { - return { - validatorAddress: object.validator_address - }; + const message = createBaseQueryValidatorCommissionRequest(); + if (object.validator_address !== undefined && object.validator_address !== null) { + message.validatorAddress = object.validator_address; + } + return message; }, toAmino(message: QueryValidatorCommissionRequest): QueryValidatorCommissionRequestAmino { const obj: any = {}; @@ -877,6 +1269,8 @@ export const QueryValidatorCommissionRequest = { }; } }; +GlobalDecoderRegistry.register(QueryValidatorCommissionRequest.typeUrl, QueryValidatorCommissionRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryValidatorCommissionRequest.aminoType, QueryValidatorCommissionRequest.typeUrl); function createBaseQueryValidatorCommissionResponse(): QueryValidatorCommissionResponse { return { commission: ValidatorAccumulatedCommission.fromPartial({}) @@ -884,6 +1278,16 @@ function createBaseQueryValidatorCommissionResponse(): QueryValidatorCommissionR } export const QueryValidatorCommissionResponse = { typeUrl: "/cosmos.distribution.v1beta1.QueryValidatorCommissionResponse", + aminoType: "cosmos-sdk/QueryValidatorCommissionResponse", + is(o: any): o is QueryValidatorCommissionResponse { + return o && (o.$typeUrl === QueryValidatorCommissionResponse.typeUrl || ValidatorAccumulatedCommission.is(o.commission)); + }, + isSDK(o: any): o is QueryValidatorCommissionResponseSDKType { + return o && (o.$typeUrl === QueryValidatorCommissionResponse.typeUrl || ValidatorAccumulatedCommission.isSDK(o.commission)); + }, + isAmino(o: any): o is QueryValidatorCommissionResponseAmino { + return o && (o.$typeUrl === QueryValidatorCommissionResponse.typeUrl || ValidatorAccumulatedCommission.isAmino(o.commission)); + }, encode(message: QueryValidatorCommissionResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.commission !== undefined) { ValidatorAccumulatedCommission.encode(message.commission, writer.uint32(10).fork()).ldelim(); @@ -907,19 +1311,31 @@ export const QueryValidatorCommissionResponse = { } return message; }, + fromJSON(object: any): QueryValidatorCommissionResponse { + return { + commission: isSet(object.commission) ? ValidatorAccumulatedCommission.fromJSON(object.commission) : undefined + }; + }, + toJSON(message: QueryValidatorCommissionResponse): unknown { + const obj: any = {}; + message.commission !== undefined && (obj.commission = message.commission ? ValidatorAccumulatedCommission.toJSON(message.commission) : undefined); + return obj; + }, fromPartial(object: Partial): QueryValidatorCommissionResponse { const message = createBaseQueryValidatorCommissionResponse(); message.commission = object.commission !== undefined && object.commission !== null ? ValidatorAccumulatedCommission.fromPartial(object.commission) : undefined; return message; }, fromAmino(object: QueryValidatorCommissionResponseAmino): QueryValidatorCommissionResponse { - return { - commission: object?.commission ? ValidatorAccumulatedCommission.fromAmino(object.commission) : undefined - }; + const message = createBaseQueryValidatorCommissionResponse(); + if (object.commission !== undefined && object.commission !== null) { + message.commission = ValidatorAccumulatedCommission.fromAmino(object.commission); + } + return message; }, toAmino(message: QueryValidatorCommissionResponse): QueryValidatorCommissionResponseAmino { const obj: any = {}; - obj.commission = message.commission ? ValidatorAccumulatedCommission.toAmino(message.commission) : undefined; + obj.commission = message.commission ? ValidatorAccumulatedCommission.toAmino(message.commission) : ValidatorAccumulatedCommission.fromPartial({}); return obj; }, fromAminoMsg(object: QueryValidatorCommissionResponseAminoMsg): QueryValidatorCommissionResponse { @@ -944,16 +1360,28 @@ export const QueryValidatorCommissionResponse = { }; } }; +GlobalDecoderRegistry.register(QueryValidatorCommissionResponse.typeUrl, QueryValidatorCommissionResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryValidatorCommissionResponse.aminoType, QueryValidatorCommissionResponse.typeUrl); function createBaseQueryValidatorSlashesRequest(): QueryValidatorSlashesRequest { return { validatorAddress: "", startingHeight: BigInt(0), endingHeight: BigInt(0), - pagination: PageRequest.fromPartial({}) + pagination: undefined }; } export const QueryValidatorSlashesRequest = { typeUrl: "/cosmos.distribution.v1beta1.QueryValidatorSlashesRequest", + aminoType: "cosmos-sdk/QueryValidatorSlashesRequest", + is(o: any): o is QueryValidatorSlashesRequest { + return o && (o.$typeUrl === QueryValidatorSlashesRequest.typeUrl || typeof o.validatorAddress === "string" && typeof o.startingHeight === "bigint" && typeof o.endingHeight === "bigint"); + }, + isSDK(o: any): o is QueryValidatorSlashesRequestSDKType { + return o && (o.$typeUrl === QueryValidatorSlashesRequest.typeUrl || typeof o.validator_address === "string" && typeof o.starting_height === "bigint" && typeof o.ending_height === "bigint"); + }, + isAmino(o: any): o is QueryValidatorSlashesRequestAmino { + return o && (o.$typeUrl === QueryValidatorSlashesRequest.typeUrl || typeof o.validator_address === "string" && typeof o.starting_height === "bigint" && typeof o.ending_height === "bigint"); + }, encode(message: QueryValidatorSlashesRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.validatorAddress !== "") { writer.uint32(10).string(message.validatorAddress); @@ -995,6 +1423,22 @@ export const QueryValidatorSlashesRequest = { } return message; }, + fromJSON(object: any): QueryValidatorSlashesRequest { + return { + validatorAddress: isSet(object.validatorAddress) ? String(object.validatorAddress) : "", + startingHeight: isSet(object.startingHeight) ? BigInt(object.startingHeight.toString()) : BigInt(0), + endingHeight: isSet(object.endingHeight) ? BigInt(object.endingHeight.toString()) : BigInt(0), + 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 || BigInt(0)).toString()); + message.endingHeight !== undefined && (obj.endingHeight = (message.endingHeight || BigInt(0)).toString()); + message.pagination !== undefined && (obj.pagination = message.pagination ? PageRequest.toJSON(message.pagination) : undefined); + return obj; + }, fromPartial(object: Partial): QueryValidatorSlashesRequest { const message = createBaseQueryValidatorSlashesRequest(); message.validatorAddress = object.validatorAddress ?? ""; @@ -1004,12 +1448,20 @@ export const QueryValidatorSlashesRequest = { return message; }, fromAmino(object: QueryValidatorSlashesRequestAmino): QueryValidatorSlashesRequest { - return { - validatorAddress: object.validator_address, - startingHeight: BigInt(object.starting_height), - endingHeight: BigInt(object.ending_height), - pagination: object?.pagination ? PageRequest.fromAmino(object.pagination) : undefined - }; + const message = createBaseQueryValidatorSlashesRequest(); + if (object.validator_address !== undefined && object.validator_address !== null) { + message.validatorAddress = object.validator_address; + } + if (object.starting_height !== undefined && object.starting_height !== null) { + message.startingHeight = BigInt(object.starting_height); + } + if (object.ending_height !== undefined && object.ending_height !== null) { + message.endingHeight = BigInt(object.ending_height); + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromAmino(object.pagination); + } + return message; }, toAmino(message: QueryValidatorSlashesRequest): QueryValidatorSlashesRequestAmino { const obj: any = {}; @@ -1041,14 +1493,26 @@ export const QueryValidatorSlashesRequest = { }; } }; +GlobalDecoderRegistry.register(QueryValidatorSlashesRequest.typeUrl, QueryValidatorSlashesRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryValidatorSlashesRequest.aminoType, QueryValidatorSlashesRequest.typeUrl); function createBaseQueryValidatorSlashesResponse(): QueryValidatorSlashesResponse { return { slashes: [], - pagination: PageResponse.fromPartial({}) + pagination: undefined }; } export const QueryValidatorSlashesResponse = { typeUrl: "/cosmos.distribution.v1beta1.QueryValidatorSlashesResponse", + aminoType: "cosmos-sdk/QueryValidatorSlashesResponse", + is(o: any): o is QueryValidatorSlashesResponse { + return o && (o.$typeUrl === QueryValidatorSlashesResponse.typeUrl || Array.isArray(o.slashes) && (!o.slashes.length || ValidatorSlashEvent.is(o.slashes[0]))); + }, + isSDK(o: any): o is QueryValidatorSlashesResponseSDKType { + return o && (o.$typeUrl === QueryValidatorSlashesResponse.typeUrl || Array.isArray(o.slashes) && (!o.slashes.length || ValidatorSlashEvent.isSDK(o.slashes[0]))); + }, + isAmino(o: any): o is QueryValidatorSlashesResponseAmino { + return o && (o.$typeUrl === QueryValidatorSlashesResponse.typeUrl || Array.isArray(o.slashes) && (!o.slashes.length || ValidatorSlashEvent.isAmino(o.slashes[0]))); + }, encode(message: QueryValidatorSlashesResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.slashes) { ValidatorSlashEvent.encode(v!, writer.uint32(10).fork()).ldelim(); @@ -1078,6 +1542,22 @@ export const QueryValidatorSlashesResponse = { } 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 + }; + }, + toJSON(message: QueryValidatorSlashesResponse): unknown { + const obj: any = {}; + if (message.slashes) { + obj.slashes = message.slashes.map(e => e ? ValidatorSlashEvent.toJSON(e) : undefined); + } else { + obj.slashes = []; + } + message.pagination !== undefined && (obj.pagination = message.pagination ? PageResponse.toJSON(message.pagination) : undefined); + return obj; + }, fromPartial(object: Partial): QueryValidatorSlashesResponse { const message = createBaseQueryValidatorSlashesResponse(); message.slashes = object.slashes?.map(e => ValidatorSlashEvent.fromPartial(e)) || []; @@ -1085,10 +1565,12 @@ export const QueryValidatorSlashesResponse = { return message; }, fromAmino(object: QueryValidatorSlashesResponseAmino): QueryValidatorSlashesResponse { - return { - slashes: Array.isArray(object?.slashes) ? object.slashes.map((e: any) => ValidatorSlashEvent.fromAmino(e)) : [], - pagination: object?.pagination ? PageResponse.fromAmino(object.pagination) : undefined - }; + const message = createBaseQueryValidatorSlashesResponse(); + message.slashes = object.slashes?.map(e => ValidatorSlashEvent.fromAmino(e)) || []; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromAmino(object.pagination); + } + return message; }, toAmino(message: QueryValidatorSlashesResponse): QueryValidatorSlashesResponseAmino { const obj: any = {}; @@ -1122,6 +1604,8 @@ export const QueryValidatorSlashesResponse = { }; } }; +GlobalDecoderRegistry.register(QueryValidatorSlashesResponse.typeUrl, QueryValidatorSlashesResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryValidatorSlashesResponse.aminoType, QueryValidatorSlashesResponse.typeUrl); function createBaseQueryDelegationRewardsRequest(): QueryDelegationRewardsRequest { return { delegatorAddress: "", @@ -1130,6 +1614,16 @@ function createBaseQueryDelegationRewardsRequest(): QueryDelegationRewardsReques } export const QueryDelegationRewardsRequest = { typeUrl: "/cosmos.distribution.v1beta1.QueryDelegationRewardsRequest", + aminoType: "cosmos-sdk/QueryDelegationRewardsRequest", + is(o: any): o is QueryDelegationRewardsRequest { + return o && (o.$typeUrl === QueryDelegationRewardsRequest.typeUrl || typeof o.delegatorAddress === "string" && typeof o.validatorAddress === "string"); + }, + isSDK(o: any): o is QueryDelegationRewardsRequestSDKType { + return o && (o.$typeUrl === QueryDelegationRewardsRequest.typeUrl || typeof o.delegator_address === "string" && typeof o.validator_address === "string"); + }, + isAmino(o: any): o is QueryDelegationRewardsRequestAmino { + return o && (o.$typeUrl === QueryDelegationRewardsRequest.typeUrl || typeof o.delegator_address === "string" && typeof o.validator_address === "string"); + }, encode(message: QueryDelegationRewardsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.delegatorAddress !== "") { writer.uint32(10).string(message.delegatorAddress); @@ -1159,6 +1653,18 @@ export const QueryDelegationRewardsRequest = { } return message; }, + fromJSON(object: any): QueryDelegationRewardsRequest { + return { + 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; + }, fromPartial(object: Partial): QueryDelegationRewardsRequest { const message = createBaseQueryDelegationRewardsRequest(); message.delegatorAddress = object.delegatorAddress ?? ""; @@ -1166,10 +1672,14 @@ export const QueryDelegationRewardsRequest = { return message; }, fromAmino(object: QueryDelegationRewardsRequestAmino): QueryDelegationRewardsRequest { - return { - delegatorAddress: object.delegator_address, - validatorAddress: object.validator_address - }; + const message = createBaseQueryDelegationRewardsRequest(); + if (object.delegator_address !== undefined && object.delegator_address !== null) { + message.delegatorAddress = object.delegator_address; + } + if (object.validator_address !== undefined && object.validator_address !== null) { + message.validatorAddress = object.validator_address; + } + return message; }, toAmino(message: QueryDelegationRewardsRequest): QueryDelegationRewardsRequestAmino { const obj: any = {}; @@ -1199,6 +1709,8 @@ export const QueryDelegationRewardsRequest = { }; } }; +GlobalDecoderRegistry.register(QueryDelegationRewardsRequest.typeUrl, QueryDelegationRewardsRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryDelegationRewardsRequest.aminoType, QueryDelegationRewardsRequest.typeUrl); function createBaseQueryDelegationRewardsResponse(): QueryDelegationRewardsResponse { return { rewards: [] @@ -1206,6 +1718,16 @@ function createBaseQueryDelegationRewardsResponse(): QueryDelegationRewardsRespo } export const QueryDelegationRewardsResponse = { typeUrl: "/cosmos.distribution.v1beta1.QueryDelegationRewardsResponse", + aminoType: "cosmos-sdk/QueryDelegationRewardsResponse", + is(o: any): o is QueryDelegationRewardsResponse { + return o && (o.$typeUrl === QueryDelegationRewardsResponse.typeUrl || Array.isArray(o.rewards) && (!o.rewards.length || DecCoin.is(o.rewards[0]))); + }, + isSDK(o: any): o is QueryDelegationRewardsResponseSDKType { + return o && (o.$typeUrl === QueryDelegationRewardsResponse.typeUrl || Array.isArray(o.rewards) && (!o.rewards.length || DecCoin.isSDK(o.rewards[0]))); + }, + isAmino(o: any): o is QueryDelegationRewardsResponseAmino { + return o && (o.$typeUrl === QueryDelegationRewardsResponse.typeUrl || Array.isArray(o.rewards) && (!o.rewards.length || DecCoin.isAmino(o.rewards[0]))); + }, encode(message: QueryDelegationRewardsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.rewards) { DecCoin.encode(v!, writer.uint32(10).fork()).ldelim(); @@ -1229,15 +1751,29 @@ export const QueryDelegationRewardsResponse = { } return message; }, + fromJSON(object: any): QueryDelegationRewardsResponse { + return { + rewards: Array.isArray(object?.rewards) ? object.rewards.map((e: any) => DecCoin.fromJSON(e)) : [] + }; + }, + toJSON(message: QueryDelegationRewardsResponse): unknown { + const obj: any = {}; + if (message.rewards) { + obj.rewards = message.rewards.map(e => e ? DecCoin.toJSON(e) : undefined); + } else { + obj.rewards = []; + } + return obj; + }, fromPartial(object: Partial): QueryDelegationRewardsResponse { const message = createBaseQueryDelegationRewardsResponse(); message.rewards = object.rewards?.map(e => DecCoin.fromPartial(e)) || []; return message; }, fromAmino(object: QueryDelegationRewardsResponseAmino): QueryDelegationRewardsResponse { - return { - rewards: Array.isArray(object?.rewards) ? object.rewards.map((e: any) => DecCoin.fromAmino(e)) : [] - }; + const message = createBaseQueryDelegationRewardsResponse(); + message.rewards = object.rewards?.map(e => DecCoin.fromAmino(e)) || []; + return message; }, toAmino(message: QueryDelegationRewardsResponse): QueryDelegationRewardsResponseAmino { const obj: any = {}; @@ -1270,6 +1806,8 @@ export const QueryDelegationRewardsResponse = { }; } }; +GlobalDecoderRegistry.register(QueryDelegationRewardsResponse.typeUrl, QueryDelegationRewardsResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryDelegationRewardsResponse.aminoType, QueryDelegationRewardsResponse.typeUrl); function createBaseQueryDelegationTotalRewardsRequest(): QueryDelegationTotalRewardsRequest { return { delegatorAddress: "" @@ -1277,6 +1815,16 @@ function createBaseQueryDelegationTotalRewardsRequest(): QueryDelegationTotalRew } export const QueryDelegationTotalRewardsRequest = { typeUrl: "/cosmos.distribution.v1beta1.QueryDelegationTotalRewardsRequest", + aminoType: "cosmos-sdk/QueryDelegationTotalRewardsRequest", + is(o: any): o is QueryDelegationTotalRewardsRequest { + return o && (o.$typeUrl === QueryDelegationTotalRewardsRequest.typeUrl || typeof o.delegatorAddress === "string"); + }, + isSDK(o: any): o is QueryDelegationTotalRewardsRequestSDKType { + return o && (o.$typeUrl === QueryDelegationTotalRewardsRequest.typeUrl || typeof o.delegator_address === "string"); + }, + isAmino(o: any): o is QueryDelegationTotalRewardsRequestAmino { + return o && (o.$typeUrl === QueryDelegationTotalRewardsRequest.typeUrl || typeof o.delegator_address === "string"); + }, encode(message: QueryDelegationTotalRewardsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.delegatorAddress !== "") { writer.uint32(10).string(message.delegatorAddress); @@ -1300,15 +1848,27 @@ export const QueryDelegationTotalRewardsRequest = { } return message; }, + fromJSON(object: any): QueryDelegationTotalRewardsRequest { + return { + delegatorAddress: isSet(object.delegatorAddress) ? String(object.delegatorAddress) : "" + }; + }, + toJSON(message: QueryDelegationTotalRewardsRequest): unknown { + const obj: any = {}; + message.delegatorAddress !== undefined && (obj.delegatorAddress = message.delegatorAddress); + return obj; + }, fromPartial(object: Partial): QueryDelegationTotalRewardsRequest { const message = createBaseQueryDelegationTotalRewardsRequest(); message.delegatorAddress = object.delegatorAddress ?? ""; return message; }, fromAmino(object: QueryDelegationTotalRewardsRequestAmino): QueryDelegationTotalRewardsRequest { - return { - delegatorAddress: object.delegator_address - }; + const message = createBaseQueryDelegationTotalRewardsRequest(); + if (object.delegator_address !== undefined && object.delegator_address !== null) { + message.delegatorAddress = object.delegator_address; + } + return message; }, toAmino(message: QueryDelegationTotalRewardsRequest): QueryDelegationTotalRewardsRequestAmino { const obj: any = {}; @@ -1337,6 +1897,8 @@ export const QueryDelegationTotalRewardsRequest = { }; } }; +GlobalDecoderRegistry.register(QueryDelegationTotalRewardsRequest.typeUrl, QueryDelegationTotalRewardsRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryDelegationTotalRewardsRequest.aminoType, QueryDelegationTotalRewardsRequest.typeUrl); function createBaseQueryDelegationTotalRewardsResponse(): QueryDelegationTotalRewardsResponse { return { rewards: [], @@ -1345,6 +1907,16 @@ function createBaseQueryDelegationTotalRewardsResponse(): QueryDelegationTotalRe } export const QueryDelegationTotalRewardsResponse = { typeUrl: "/cosmos.distribution.v1beta1.QueryDelegationTotalRewardsResponse", + aminoType: "cosmos-sdk/QueryDelegationTotalRewardsResponse", + is(o: any): o is QueryDelegationTotalRewardsResponse { + return o && (o.$typeUrl === QueryDelegationTotalRewardsResponse.typeUrl || Array.isArray(o.rewards) && (!o.rewards.length || DelegationDelegatorReward.is(o.rewards[0])) && Array.isArray(o.total) && (!o.total.length || DecCoin.is(o.total[0]))); + }, + isSDK(o: any): o is QueryDelegationTotalRewardsResponseSDKType { + return o && (o.$typeUrl === QueryDelegationTotalRewardsResponse.typeUrl || Array.isArray(o.rewards) && (!o.rewards.length || DelegationDelegatorReward.isSDK(o.rewards[0])) && Array.isArray(o.total) && (!o.total.length || DecCoin.isSDK(o.total[0]))); + }, + isAmino(o: any): o is QueryDelegationTotalRewardsResponseAmino { + return o && (o.$typeUrl === QueryDelegationTotalRewardsResponse.typeUrl || Array.isArray(o.rewards) && (!o.rewards.length || DelegationDelegatorReward.isAmino(o.rewards[0])) && Array.isArray(o.total) && (!o.total.length || DecCoin.isAmino(o.total[0]))); + }, encode(message: QueryDelegationTotalRewardsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.rewards) { DelegationDelegatorReward.encode(v!, writer.uint32(10).fork()).ldelim(); @@ -1374,6 +1946,26 @@ export const QueryDelegationTotalRewardsResponse = { } return message; }, + fromJSON(object: any): QueryDelegationTotalRewardsResponse { + return { + 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)) : [] + }; + }, + toJSON(message: QueryDelegationTotalRewardsResponse): unknown { + const obj: any = {}; + if (message.rewards) { + obj.rewards = message.rewards.map(e => e ? DelegationDelegatorReward.toJSON(e) : undefined); + } else { + obj.rewards = []; + } + if (message.total) { + obj.total = message.total.map(e => e ? DecCoin.toJSON(e) : undefined); + } else { + obj.total = []; + } + return obj; + }, fromPartial(object: Partial): QueryDelegationTotalRewardsResponse { const message = createBaseQueryDelegationTotalRewardsResponse(); message.rewards = object.rewards?.map(e => DelegationDelegatorReward.fromPartial(e)) || []; @@ -1381,10 +1973,10 @@ export const QueryDelegationTotalRewardsResponse = { return message; }, fromAmino(object: QueryDelegationTotalRewardsResponseAmino): QueryDelegationTotalRewardsResponse { - return { - rewards: Array.isArray(object?.rewards) ? object.rewards.map((e: any) => DelegationDelegatorReward.fromAmino(e)) : [], - total: Array.isArray(object?.total) ? object.total.map((e: any) => DecCoin.fromAmino(e)) : [] - }; + const message = createBaseQueryDelegationTotalRewardsResponse(); + message.rewards = object.rewards?.map(e => DelegationDelegatorReward.fromAmino(e)) || []; + message.total = object.total?.map(e => DecCoin.fromAmino(e)) || []; + return message; }, toAmino(message: QueryDelegationTotalRewardsResponse): QueryDelegationTotalRewardsResponseAmino { const obj: any = {}; @@ -1422,6 +2014,8 @@ export const QueryDelegationTotalRewardsResponse = { }; } }; +GlobalDecoderRegistry.register(QueryDelegationTotalRewardsResponse.typeUrl, QueryDelegationTotalRewardsResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryDelegationTotalRewardsResponse.aminoType, QueryDelegationTotalRewardsResponse.typeUrl); function createBaseQueryDelegatorValidatorsRequest(): QueryDelegatorValidatorsRequest { return { delegatorAddress: "" @@ -1429,6 +2023,16 @@ function createBaseQueryDelegatorValidatorsRequest(): QueryDelegatorValidatorsRe } export const QueryDelegatorValidatorsRequest = { typeUrl: "/cosmos.distribution.v1beta1.QueryDelegatorValidatorsRequest", + aminoType: "cosmos-sdk/QueryDelegatorValidatorsRequest", + is(o: any): o is QueryDelegatorValidatorsRequest { + return o && (o.$typeUrl === QueryDelegatorValidatorsRequest.typeUrl || typeof o.delegatorAddress === "string"); + }, + isSDK(o: any): o is QueryDelegatorValidatorsRequestSDKType { + return o && (o.$typeUrl === QueryDelegatorValidatorsRequest.typeUrl || typeof o.delegator_address === "string"); + }, + isAmino(o: any): o is QueryDelegatorValidatorsRequestAmino { + return o && (o.$typeUrl === QueryDelegatorValidatorsRequest.typeUrl || typeof o.delegator_address === "string"); + }, encode(message: QueryDelegatorValidatorsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.delegatorAddress !== "") { writer.uint32(10).string(message.delegatorAddress); @@ -1452,15 +2056,27 @@ export const QueryDelegatorValidatorsRequest = { } return message; }, + fromJSON(object: any): QueryDelegatorValidatorsRequest { + return { + delegatorAddress: isSet(object.delegatorAddress) ? String(object.delegatorAddress) : "" + }; + }, + toJSON(message: QueryDelegatorValidatorsRequest): unknown { + const obj: any = {}; + message.delegatorAddress !== undefined && (obj.delegatorAddress = message.delegatorAddress); + return obj; + }, fromPartial(object: Partial): QueryDelegatorValidatorsRequest { const message = createBaseQueryDelegatorValidatorsRequest(); message.delegatorAddress = object.delegatorAddress ?? ""; return message; }, fromAmino(object: QueryDelegatorValidatorsRequestAmino): QueryDelegatorValidatorsRequest { - return { - delegatorAddress: object.delegator_address - }; + const message = createBaseQueryDelegatorValidatorsRequest(); + if (object.delegator_address !== undefined && object.delegator_address !== null) { + message.delegatorAddress = object.delegator_address; + } + return message; }, toAmino(message: QueryDelegatorValidatorsRequest): QueryDelegatorValidatorsRequestAmino { const obj: any = {}; @@ -1489,6 +2105,8 @@ export const QueryDelegatorValidatorsRequest = { }; } }; +GlobalDecoderRegistry.register(QueryDelegatorValidatorsRequest.typeUrl, QueryDelegatorValidatorsRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryDelegatorValidatorsRequest.aminoType, QueryDelegatorValidatorsRequest.typeUrl); function createBaseQueryDelegatorValidatorsResponse(): QueryDelegatorValidatorsResponse { return { validators: [] @@ -1496,6 +2114,16 @@ function createBaseQueryDelegatorValidatorsResponse(): QueryDelegatorValidatorsR } export const QueryDelegatorValidatorsResponse = { typeUrl: "/cosmos.distribution.v1beta1.QueryDelegatorValidatorsResponse", + aminoType: "cosmos-sdk/QueryDelegatorValidatorsResponse", + is(o: any): o is QueryDelegatorValidatorsResponse { + return o && (o.$typeUrl === QueryDelegatorValidatorsResponse.typeUrl || Array.isArray(o.validators) && (!o.validators.length || typeof o.validators[0] === "string")); + }, + isSDK(o: any): o is QueryDelegatorValidatorsResponseSDKType { + return o && (o.$typeUrl === QueryDelegatorValidatorsResponse.typeUrl || Array.isArray(o.validators) && (!o.validators.length || typeof o.validators[0] === "string")); + }, + isAmino(o: any): o is QueryDelegatorValidatorsResponseAmino { + return o && (o.$typeUrl === QueryDelegatorValidatorsResponse.typeUrl || Array.isArray(o.validators) && (!o.validators.length || typeof o.validators[0] === "string")); + }, encode(message: QueryDelegatorValidatorsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.validators) { writer.uint32(10).string(v!); @@ -1519,15 +2147,29 @@ export const QueryDelegatorValidatorsResponse = { } return message; }, + fromJSON(object: any): QueryDelegatorValidatorsResponse { + return { + validators: Array.isArray(object?.validators) ? object.validators.map((e: any) => String(e)) : [] + }; + }, + toJSON(message: QueryDelegatorValidatorsResponse): unknown { + const obj: any = {}; + if (message.validators) { + obj.validators = message.validators.map(e => e); + } else { + obj.validators = []; + } + return obj; + }, fromPartial(object: Partial): QueryDelegatorValidatorsResponse { const message = createBaseQueryDelegatorValidatorsResponse(); message.validators = object.validators?.map(e => e) || []; return message; }, fromAmino(object: QueryDelegatorValidatorsResponseAmino): QueryDelegatorValidatorsResponse { - return { - validators: Array.isArray(object?.validators) ? object.validators.map((e: any) => e) : [] - }; + const message = createBaseQueryDelegatorValidatorsResponse(); + message.validators = object.validators?.map(e => e) || []; + return message; }, toAmino(message: QueryDelegatorValidatorsResponse): QueryDelegatorValidatorsResponseAmino { const obj: any = {}; @@ -1560,6 +2202,8 @@ export const QueryDelegatorValidatorsResponse = { }; } }; +GlobalDecoderRegistry.register(QueryDelegatorValidatorsResponse.typeUrl, QueryDelegatorValidatorsResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryDelegatorValidatorsResponse.aminoType, QueryDelegatorValidatorsResponse.typeUrl); function createBaseQueryDelegatorWithdrawAddressRequest(): QueryDelegatorWithdrawAddressRequest { return { delegatorAddress: "" @@ -1567,6 +2211,16 @@ function createBaseQueryDelegatorWithdrawAddressRequest(): QueryDelegatorWithdra } export const QueryDelegatorWithdrawAddressRequest = { typeUrl: "/cosmos.distribution.v1beta1.QueryDelegatorWithdrawAddressRequest", + aminoType: "cosmos-sdk/QueryDelegatorWithdrawAddressRequest", + is(o: any): o is QueryDelegatorWithdrawAddressRequest { + return o && (o.$typeUrl === QueryDelegatorWithdrawAddressRequest.typeUrl || typeof o.delegatorAddress === "string"); + }, + isSDK(o: any): o is QueryDelegatorWithdrawAddressRequestSDKType { + return o && (o.$typeUrl === QueryDelegatorWithdrawAddressRequest.typeUrl || typeof o.delegator_address === "string"); + }, + isAmino(o: any): o is QueryDelegatorWithdrawAddressRequestAmino { + return o && (o.$typeUrl === QueryDelegatorWithdrawAddressRequest.typeUrl || typeof o.delegator_address === "string"); + }, encode(message: QueryDelegatorWithdrawAddressRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.delegatorAddress !== "") { writer.uint32(10).string(message.delegatorAddress); @@ -1590,15 +2244,27 @@ export const QueryDelegatorWithdrawAddressRequest = { } return message; }, + fromJSON(object: any): QueryDelegatorWithdrawAddressRequest { + return { + delegatorAddress: isSet(object.delegatorAddress) ? String(object.delegatorAddress) : "" + }; + }, + toJSON(message: QueryDelegatorWithdrawAddressRequest): unknown { + const obj: any = {}; + message.delegatorAddress !== undefined && (obj.delegatorAddress = message.delegatorAddress); + return obj; + }, fromPartial(object: Partial): QueryDelegatorWithdrawAddressRequest { const message = createBaseQueryDelegatorWithdrawAddressRequest(); message.delegatorAddress = object.delegatorAddress ?? ""; return message; }, fromAmino(object: QueryDelegatorWithdrawAddressRequestAmino): QueryDelegatorWithdrawAddressRequest { - return { - delegatorAddress: object.delegator_address - }; + const message = createBaseQueryDelegatorWithdrawAddressRequest(); + if (object.delegator_address !== undefined && object.delegator_address !== null) { + message.delegatorAddress = object.delegator_address; + } + return message; }, toAmino(message: QueryDelegatorWithdrawAddressRequest): QueryDelegatorWithdrawAddressRequestAmino { const obj: any = {}; @@ -1627,6 +2293,8 @@ export const QueryDelegatorWithdrawAddressRequest = { }; } }; +GlobalDecoderRegistry.register(QueryDelegatorWithdrawAddressRequest.typeUrl, QueryDelegatorWithdrawAddressRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryDelegatorWithdrawAddressRequest.aminoType, QueryDelegatorWithdrawAddressRequest.typeUrl); function createBaseQueryDelegatorWithdrawAddressResponse(): QueryDelegatorWithdrawAddressResponse { return { withdrawAddress: "" @@ -1634,6 +2302,16 @@ function createBaseQueryDelegatorWithdrawAddressResponse(): QueryDelegatorWithdr } export const QueryDelegatorWithdrawAddressResponse = { typeUrl: "/cosmos.distribution.v1beta1.QueryDelegatorWithdrawAddressResponse", + aminoType: "cosmos-sdk/QueryDelegatorWithdrawAddressResponse", + is(o: any): o is QueryDelegatorWithdrawAddressResponse { + return o && (o.$typeUrl === QueryDelegatorWithdrawAddressResponse.typeUrl || typeof o.withdrawAddress === "string"); + }, + isSDK(o: any): o is QueryDelegatorWithdrawAddressResponseSDKType { + return o && (o.$typeUrl === QueryDelegatorWithdrawAddressResponse.typeUrl || typeof o.withdraw_address === "string"); + }, + isAmino(o: any): o is QueryDelegatorWithdrawAddressResponseAmino { + return o && (o.$typeUrl === QueryDelegatorWithdrawAddressResponse.typeUrl || typeof o.withdraw_address === "string"); + }, encode(message: QueryDelegatorWithdrawAddressResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.withdrawAddress !== "") { writer.uint32(10).string(message.withdrawAddress); @@ -1657,15 +2335,27 @@ export const QueryDelegatorWithdrawAddressResponse = { } return message; }, + fromJSON(object: any): QueryDelegatorWithdrawAddressResponse { + return { + withdrawAddress: isSet(object.withdrawAddress) ? String(object.withdrawAddress) : "" + }; + }, + toJSON(message: QueryDelegatorWithdrawAddressResponse): unknown { + const obj: any = {}; + message.withdrawAddress !== undefined && (obj.withdrawAddress = message.withdrawAddress); + return obj; + }, fromPartial(object: Partial): QueryDelegatorWithdrawAddressResponse { const message = createBaseQueryDelegatorWithdrawAddressResponse(); message.withdrawAddress = object.withdrawAddress ?? ""; return message; }, fromAmino(object: QueryDelegatorWithdrawAddressResponseAmino): QueryDelegatorWithdrawAddressResponse { - return { - withdrawAddress: object.withdraw_address - }; + const message = createBaseQueryDelegatorWithdrawAddressResponse(); + if (object.withdraw_address !== undefined && object.withdraw_address !== null) { + message.withdrawAddress = object.withdraw_address; + } + return message; }, toAmino(message: QueryDelegatorWithdrawAddressResponse): QueryDelegatorWithdrawAddressResponseAmino { const obj: any = {}; @@ -1694,11 +2384,23 @@ export const QueryDelegatorWithdrawAddressResponse = { }; } }; +GlobalDecoderRegistry.register(QueryDelegatorWithdrawAddressResponse.typeUrl, QueryDelegatorWithdrawAddressResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryDelegatorWithdrawAddressResponse.aminoType, QueryDelegatorWithdrawAddressResponse.typeUrl); function createBaseQueryCommunityPoolRequest(): QueryCommunityPoolRequest { return {}; } export const QueryCommunityPoolRequest = { typeUrl: "/cosmos.distribution.v1beta1.QueryCommunityPoolRequest", + aminoType: "cosmos-sdk/QueryCommunityPoolRequest", + is(o: any): o is QueryCommunityPoolRequest { + return o && o.$typeUrl === QueryCommunityPoolRequest.typeUrl; + }, + isSDK(o: any): o is QueryCommunityPoolRequestSDKType { + return o && o.$typeUrl === QueryCommunityPoolRequest.typeUrl; + }, + isAmino(o: any): o is QueryCommunityPoolRequestAmino { + return o && o.$typeUrl === QueryCommunityPoolRequest.typeUrl; + }, encode(_: QueryCommunityPoolRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, @@ -1716,12 +2418,20 @@ export const QueryCommunityPoolRequest = { } return message; }, + fromJSON(_: any): QueryCommunityPoolRequest { + return {}; + }, + toJSON(_: QueryCommunityPoolRequest): unknown { + const obj: any = {}; + return obj; + }, fromPartial(_: Partial): QueryCommunityPoolRequest { const message = createBaseQueryCommunityPoolRequest(); return message; }, fromAmino(_: QueryCommunityPoolRequestAmino): QueryCommunityPoolRequest { - return {}; + const message = createBaseQueryCommunityPoolRequest(); + return message; }, toAmino(_: QueryCommunityPoolRequest): QueryCommunityPoolRequestAmino { const obj: any = {}; @@ -1749,6 +2459,8 @@ export const QueryCommunityPoolRequest = { }; } }; +GlobalDecoderRegistry.register(QueryCommunityPoolRequest.typeUrl, QueryCommunityPoolRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryCommunityPoolRequest.aminoType, QueryCommunityPoolRequest.typeUrl); function createBaseQueryCommunityPoolResponse(): QueryCommunityPoolResponse { return { pool: [] @@ -1756,6 +2468,16 @@ function createBaseQueryCommunityPoolResponse(): QueryCommunityPoolResponse { } export const QueryCommunityPoolResponse = { typeUrl: "/cosmos.distribution.v1beta1.QueryCommunityPoolResponse", + aminoType: "cosmos-sdk/QueryCommunityPoolResponse", + is(o: any): o is QueryCommunityPoolResponse { + return o && (o.$typeUrl === QueryCommunityPoolResponse.typeUrl || Array.isArray(o.pool) && (!o.pool.length || DecCoin.is(o.pool[0]))); + }, + isSDK(o: any): o is QueryCommunityPoolResponseSDKType { + return o && (o.$typeUrl === QueryCommunityPoolResponse.typeUrl || Array.isArray(o.pool) && (!o.pool.length || DecCoin.isSDK(o.pool[0]))); + }, + isAmino(o: any): o is QueryCommunityPoolResponseAmino { + return o && (o.$typeUrl === QueryCommunityPoolResponse.typeUrl || Array.isArray(o.pool) && (!o.pool.length || DecCoin.isAmino(o.pool[0]))); + }, encode(message: QueryCommunityPoolResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.pool) { DecCoin.encode(v!, writer.uint32(10).fork()).ldelim(); @@ -1779,15 +2501,29 @@ export const QueryCommunityPoolResponse = { } return message; }, + fromJSON(object: any): QueryCommunityPoolResponse { + return { + pool: Array.isArray(object?.pool) ? object.pool.map((e: any) => DecCoin.fromJSON(e)) : [] + }; + }, + toJSON(message: QueryCommunityPoolResponse): unknown { + const obj: any = {}; + if (message.pool) { + obj.pool = message.pool.map(e => e ? DecCoin.toJSON(e) : undefined); + } else { + obj.pool = []; + } + return obj; + }, fromPartial(object: Partial): QueryCommunityPoolResponse { const message = createBaseQueryCommunityPoolResponse(); message.pool = object.pool?.map(e => DecCoin.fromPartial(e)) || []; return message; }, fromAmino(object: QueryCommunityPoolResponseAmino): QueryCommunityPoolResponse { - return { - pool: Array.isArray(object?.pool) ? object.pool.map((e: any) => DecCoin.fromAmino(e)) : [] - }; + const message = createBaseQueryCommunityPoolResponse(); + message.pool = object.pool?.map(e => DecCoin.fromAmino(e)) || []; + return message; }, toAmino(message: QueryCommunityPoolResponse): QueryCommunityPoolResponseAmino { const obj: any = {}; @@ -1819,4 +2555,6 @@ export const QueryCommunityPoolResponse = { value: QueryCommunityPoolResponse.encode(message).finish() }; } -}; \ No newline at end of file +}; +GlobalDecoderRegistry.register(QueryCommunityPoolResponse.typeUrl, QueryCommunityPoolResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryCommunityPoolResponse.aminoType, QueryCommunityPoolResponse.typeUrl); \ No newline at end of file diff --git a/packages/osmojs/src/codegen/cosmos/distribution/v1beta1/tx.amino.ts b/packages/osmojs/src/codegen/cosmos/distribution/v1beta1/tx.amino.ts index fe927e7e0..1e9b2effd 100644 --- a/packages/osmojs/src/codegen/cosmos/distribution/v1beta1/tx.amino.ts +++ b/packages/osmojs/src/codegen/cosmos/distribution/v1beta1/tx.amino.ts @@ -1,5 +1,5 @@ //@ts-nocheck -import { MsgSetWithdrawAddress, MsgWithdrawDelegatorReward, MsgWithdrawValidatorCommission, MsgFundCommunityPool } from "./tx"; +import { MsgSetWithdrawAddress, MsgWithdrawDelegatorReward, MsgWithdrawValidatorCommission, MsgFundCommunityPool, MsgUpdateParams, MsgCommunityPoolSpend } from "./tx"; export const AminoConverter = { "/cosmos.distribution.v1beta1.MsgSetWithdrawAddress": { aminoType: "cosmos-sdk/MsgModifyWithdrawAddress", @@ -12,7 +12,7 @@ export const AminoConverter = { fromAmino: MsgWithdrawDelegatorReward.fromAmino }, "/cosmos.distribution.v1beta1.MsgWithdrawValidatorCommission": { - aminoType: "cosmos-sdk/MsgWithdrawValCommission", + aminoType: "cosmos-sdk/MsgWithdrawValidatorCommission", toAmino: MsgWithdrawValidatorCommission.toAmino, fromAmino: MsgWithdrawValidatorCommission.fromAmino }, @@ -20,5 +20,15 @@ export const AminoConverter = { aminoType: "cosmos-sdk/MsgFundCommunityPool", toAmino: MsgFundCommunityPool.toAmino, fromAmino: MsgFundCommunityPool.fromAmino + }, + "/cosmos.distribution.v1beta1.MsgUpdateParams": { + aminoType: "cosmos-sdk/distribution/MsgUpdateParams", + toAmino: MsgUpdateParams.toAmino, + fromAmino: MsgUpdateParams.fromAmino + }, + "/cosmos.distribution.v1beta1.MsgCommunityPoolSpend": { + aminoType: "cosmos-sdk/distr/MsgCommunityPoolSpend", + toAmino: MsgCommunityPoolSpend.toAmino, + fromAmino: MsgCommunityPoolSpend.fromAmino } }; \ No newline at end of file diff --git a/packages/osmojs/src/codegen/cosmos/distribution/v1beta1/tx.registry.ts b/packages/osmojs/src/codegen/cosmos/distribution/v1beta1/tx.registry.ts index 52151ed59..bbcb23512 100644 --- a/packages/osmojs/src/codegen/cosmos/distribution/v1beta1/tx.registry.ts +++ b/packages/osmojs/src/codegen/cosmos/distribution/v1beta1/tx.registry.ts @@ -1,7 +1,7 @@ //@ts-nocheck import { GeneratedType, Registry } from "@cosmjs/proto-signing"; -import { MsgSetWithdrawAddress, MsgWithdrawDelegatorReward, MsgWithdrawValidatorCommission, MsgFundCommunityPool } from "./tx"; -export const registry: ReadonlyArray<[string, GeneratedType]> = [["/cosmos.distribution.v1beta1.MsgSetWithdrawAddress", MsgSetWithdrawAddress], ["/cosmos.distribution.v1beta1.MsgWithdrawDelegatorReward", MsgWithdrawDelegatorReward], ["/cosmos.distribution.v1beta1.MsgWithdrawValidatorCommission", MsgWithdrawValidatorCommission], ["/cosmos.distribution.v1beta1.MsgFundCommunityPool", MsgFundCommunityPool]]; +import { MsgSetWithdrawAddress, MsgWithdrawDelegatorReward, MsgWithdrawValidatorCommission, MsgFundCommunityPool, MsgUpdateParams, MsgCommunityPoolSpend } from "./tx"; +export const registry: ReadonlyArray<[string, GeneratedType]> = [["/cosmos.distribution.v1beta1.MsgSetWithdrawAddress", MsgSetWithdrawAddress], ["/cosmos.distribution.v1beta1.MsgWithdrawDelegatorReward", MsgWithdrawDelegatorReward], ["/cosmos.distribution.v1beta1.MsgWithdrawValidatorCommission", MsgWithdrawValidatorCommission], ["/cosmos.distribution.v1beta1.MsgFundCommunityPool", MsgFundCommunityPool], ["/cosmos.distribution.v1beta1.MsgUpdateParams", MsgUpdateParams], ["/cosmos.distribution.v1beta1.MsgCommunityPoolSpend", MsgCommunityPoolSpend]]; export const load = (protoRegistry: Registry) => { registry.forEach(([typeUrl, mod]) => { protoRegistry.register(typeUrl, mod); @@ -32,6 +32,18 @@ export const MessageComposer = { typeUrl: "/cosmos.distribution.v1beta1.MsgFundCommunityPool", value: MsgFundCommunityPool.encode(value).finish() }; + }, + updateParams(value: MsgUpdateParams) { + return { + typeUrl: "/cosmos.distribution.v1beta1.MsgUpdateParams", + value: MsgUpdateParams.encode(value).finish() + }; + }, + communityPoolSpend(value: MsgCommunityPoolSpend) { + return { + typeUrl: "/cosmos.distribution.v1beta1.MsgCommunityPoolSpend", + value: MsgCommunityPoolSpend.encode(value).finish() + }; } }, withTypeUrl: { @@ -58,6 +70,94 @@ export const MessageComposer = { typeUrl: "/cosmos.distribution.v1beta1.MsgFundCommunityPool", value }; + }, + updateParams(value: MsgUpdateParams) { + return { + typeUrl: "/cosmos.distribution.v1beta1.MsgUpdateParams", + value + }; + }, + communityPoolSpend(value: MsgCommunityPoolSpend) { + return { + typeUrl: "/cosmos.distribution.v1beta1.MsgCommunityPoolSpend", + value + }; + } + }, + toJSON: { + setWithdrawAddress(value: MsgSetWithdrawAddress) { + return { + typeUrl: "/cosmos.distribution.v1beta1.MsgSetWithdrawAddress", + value: MsgSetWithdrawAddress.toJSON(value) + }; + }, + withdrawDelegatorReward(value: MsgWithdrawDelegatorReward) { + return { + typeUrl: "/cosmos.distribution.v1beta1.MsgWithdrawDelegatorReward", + value: MsgWithdrawDelegatorReward.toJSON(value) + }; + }, + withdrawValidatorCommission(value: MsgWithdrawValidatorCommission) { + return { + typeUrl: "/cosmos.distribution.v1beta1.MsgWithdrawValidatorCommission", + value: MsgWithdrawValidatorCommission.toJSON(value) + }; + }, + fundCommunityPool(value: MsgFundCommunityPool) { + return { + typeUrl: "/cosmos.distribution.v1beta1.MsgFundCommunityPool", + value: MsgFundCommunityPool.toJSON(value) + }; + }, + updateParams(value: MsgUpdateParams) { + return { + typeUrl: "/cosmos.distribution.v1beta1.MsgUpdateParams", + value: MsgUpdateParams.toJSON(value) + }; + }, + communityPoolSpend(value: MsgCommunityPoolSpend) { + return { + typeUrl: "/cosmos.distribution.v1beta1.MsgCommunityPoolSpend", + value: MsgCommunityPoolSpend.toJSON(value) + }; + } + }, + fromJSON: { + setWithdrawAddress(value: any) { + return { + typeUrl: "/cosmos.distribution.v1beta1.MsgSetWithdrawAddress", + value: MsgSetWithdrawAddress.fromJSON(value) + }; + }, + withdrawDelegatorReward(value: any) { + return { + typeUrl: "/cosmos.distribution.v1beta1.MsgWithdrawDelegatorReward", + value: MsgWithdrawDelegatorReward.fromJSON(value) + }; + }, + withdrawValidatorCommission(value: any) { + return { + typeUrl: "/cosmos.distribution.v1beta1.MsgWithdrawValidatorCommission", + value: MsgWithdrawValidatorCommission.fromJSON(value) + }; + }, + fundCommunityPool(value: any) { + return { + typeUrl: "/cosmos.distribution.v1beta1.MsgFundCommunityPool", + value: MsgFundCommunityPool.fromJSON(value) + }; + }, + updateParams(value: any) { + return { + typeUrl: "/cosmos.distribution.v1beta1.MsgUpdateParams", + value: MsgUpdateParams.fromJSON(value) + }; + }, + communityPoolSpend(value: any) { + return { + typeUrl: "/cosmos.distribution.v1beta1.MsgCommunityPoolSpend", + value: MsgCommunityPoolSpend.fromJSON(value) + }; } }, fromPartial: { @@ -84,6 +184,18 @@ export const MessageComposer = { typeUrl: "/cosmos.distribution.v1beta1.MsgFundCommunityPool", value: MsgFundCommunityPool.fromPartial(value) }; + }, + updateParams(value: MsgUpdateParams) { + return { + typeUrl: "/cosmos.distribution.v1beta1.MsgUpdateParams", + value: MsgUpdateParams.fromPartial(value) + }; + }, + communityPoolSpend(value: MsgCommunityPoolSpend) { + return { + typeUrl: "/cosmos.distribution.v1beta1.MsgCommunityPoolSpend", + value: MsgCommunityPoolSpend.fromPartial(value) + }; } } }; \ No newline at end of file diff --git a/packages/osmojs/src/codegen/cosmos/distribution/v1beta1/tx.rpc.msg.ts b/packages/osmojs/src/codegen/cosmos/distribution/v1beta1/tx.rpc.msg.ts index c66ec3e0b..af08fc1d5 100644 --- a/packages/osmojs/src/codegen/cosmos/distribution/v1beta1/tx.rpc.msg.ts +++ b/packages/osmojs/src/codegen/cosmos/distribution/v1beta1/tx.rpc.msg.ts @@ -1,6 +1,6 @@ import { Rpc } from "../../../helpers"; import { BinaryReader } from "../../../binary"; -import { MsgSetWithdrawAddress, MsgSetWithdrawAddressResponse, MsgWithdrawDelegatorReward, MsgWithdrawDelegatorRewardResponse, MsgWithdrawValidatorCommission, MsgWithdrawValidatorCommissionResponse, MsgFundCommunityPool, MsgFundCommunityPoolResponse } from "./tx"; +import { MsgSetWithdrawAddress, MsgSetWithdrawAddressResponse, MsgWithdrawDelegatorReward, MsgWithdrawDelegatorRewardResponse, MsgWithdrawValidatorCommission, MsgWithdrawValidatorCommissionResponse, MsgFundCommunityPool, MsgFundCommunityPoolResponse, MsgUpdateParams, MsgUpdateParamsResponse, MsgCommunityPoolSpend, MsgCommunityPoolSpendResponse } from "./tx"; /** Msg defines the distribution Msg service. */ export interface Msg { /** @@ -23,6 +23,22 @@ export interface Msg { * fund the community pool. */ fundCommunityPool(request: MsgFundCommunityPool): Promise; + /** + * UpdateParams defines a governance operation for updating the x/distribution + * module parameters. The authority is defined in the keeper. + * + * Since: cosmos-sdk 0.47 + */ + updateParams(request: MsgUpdateParams): Promise; + /** + * CommunityPoolSpend defines a governance operation for sending tokens from + * the community pool in the x/distribution module to another account, which + * could be the governance module itself. The authority is defined in the + * keeper. + * + * Since: cosmos-sdk 0.47 + */ + communityPoolSpend(request: MsgCommunityPoolSpend): Promise; } export class MsgClientImpl implements Msg { private readonly rpc: Rpc; @@ -32,6 +48,8 @@ export class MsgClientImpl implements Msg { this.withdrawDelegatorReward = this.withdrawDelegatorReward.bind(this); this.withdrawValidatorCommission = this.withdrawValidatorCommission.bind(this); this.fundCommunityPool = this.fundCommunityPool.bind(this); + this.updateParams = this.updateParams.bind(this); + this.communityPoolSpend = this.communityPoolSpend.bind(this); } setWithdrawAddress(request: MsgSetWithdrawAddress): Promise { const data = MsgSetWithdrawAddress.encode(request).finish(); @@ -53,4 +71,17 @@ export class MsgClientImpl implements Msg { const promise = this.rpc.request("cosmos.distribution.v1beta1.Msg", "FundCommunityPool", data); return promise.then(data => MsgFundCommunityPoolResponse.decode(new BinaryReader(data))); } -} \ No newline at end of file + updateParams(request: MsgUpdateParams): Promise { + const data = MsgUpdateParams.encode(request).finish(); + const promise = this.rpc.request("cosmos.distribution.v1beta1.Msg", "UpdateParams", data); + return promise.then(data => MsgUpdateParamsResponse.decode(new BinaryReader(data))); + } + communityPoolSpend(request: MsgCommunityPoolSpend): Promise { + const data = MsgCommunityPoolSpend.encode(request).finish(); + const promise = this.rpc.request("cosmos.distribution.v1beta1.Msg", "CommunityPoolSpend", data); + return promise.then(data => MsgCommunityPoolSpendResponse.decode(new BinaryReader(data))); + } +} +export const createClientImpl = (rpc: Rpc) => { + return new MsgClientImpl(rpc); +}; \ No newline at end of file diff --git a/packages/osmojs/src/codegen/cosmos/distribution/v1beta1/tx.ts b/packages/osmojs/src/codegen/cosmos/distribution/v1beta1/tx.ts index 9c238e436..0e207493e 100644 --- a/packages/osmojs/src/codegen/cosmos/distribution/v1beta1/tx.ts +++ b/packages/osmojs/src/codegen/cosmos/distribution/v1beta1/tx.ts @@ -1,5 +1,8 @@ import { Coin, CoinAmino, CoinSDKType } from "../../base/v1beta1/coin"; +import { Params, ParamsAmino, ParamsSDKType } from "./distribution"; import { BinaryReader, BinaryWriter } from "../../../binary"; +import { isSet } from "../../../helpers"; +import { GlobalDecoderRegistry } from "../../../registry"; /** * MsgSetWithdrawAddress sets the withdraw address for * a delegator (or validator self-delegation). @@ -17,8 +20,8 @@ export interface MsgSetWithdrawAddressProtoMsg { * a delegator (or validator self-delegation). */ export interface MsgSetWithdrawAddressAmino { - delegator_address: string; - withdraw_address: string; + delegator_address?: string; + withdraw_address?: string; } export interface MsgSetWithdrawAddressAminoMsg { type: "cosmos-sdk/MsgModifyWithdrawAddress"; @@ -32,19 +35,28 @@ export interface MsgSetWithdrawAddressSDKType { delegator_address: string; withdraw_address: string; } -/** MsgSetWithdrawAddressResponse defines the Msg/SetWithdrawAddress response type. */ +/** + * MsgSetWithdrawAddressResponse defines the Msg/SetWithdrawAddress response + * type. + */ export interface MsgSetWithdrawAddressResponse {} export interface MsgSetWithdrawAddressResponseProtoMsg { typeUrl: "/cosmos.distribution.v1beta1.MsgSetWithdrawAddressResponse"; value: Uint8Array; } -/** MsgSetWithdrawAddressResponse defines the Msg/SetWithdrawAddress response type. */ +/** + * MsgSetWithdrawAddressResponse defines the Msg/SetWithdrawAddress response + * type. + */ export interface MsgSetWithdrawAddressResponseAmino {} export interface MsgSetWithdrawAddressResponseAminoMsg { type: "cosmos-sdk/MsgSetWithdrawAddressResponse"; value: MsgSetWithdrawAddressResponseAmino; } -/** MsgSetWithdrawAddressResponse defines the Msg/SetWithdrawAddress response type. */ +/** + * MsgSetWithdrawAddressResponse defines the Msg/SetWithdrawAddress response + * type. + */ export interface MsgSetWithdrawAddressResponseSDKType {} /** * MsgWithdrawDelegatorReward represents delegation withdrawal to a delegator @@ -63,8 +75,8 @@ export interface MsgWithdrawDelegatorRewardProtoMsg { * from a single validator. */ export interface MsgWithdrawDelegatorRewardAmino { - delegator_address: string; - validator_address: string; + delegator_address?: string; + validator_address?: string; } export interface MsgWithdrawDelegatorRewardAminoMsg { type: "cosmos-sdk/MsgWithdrawDelegationReward"; @@ -78,20 +90,37 @@ export interface MsgWithdrawDelegatorRewardSDKType { delegator_address: string; validator_address: string; } -/** MsgWithdrawDelegatorRewardResponse defines the Msg/WithdrawDelegatorReward response type. */ -export interface MsgWithdrawDelegatorRewardResponse {} +/** + * MsgWithdrawDelegatorRewardResponse defines the Msg/WithdrawDelegatorReward + * response type. + */ +export interface MsgWithdrawDelegatorRewardResponse { + /** Since: cosmos-sdk 0.46 */ + amount: Coin[]; +} export interface MsgWithdrawDelegatorRewardResponseProtoMsg { typeUrl: "/cosmos.distribution.v1beta1.MsgWithdrawDelegatorRewardResponse"; value: Uint8Array; } -/** MsgWithdrawDelegatorRewardResponse defines the Msg/WithdrawDelegatorReward response type. */ -export interface MsgWithdrawDelegatorRewardResponseAmino {} +/** + * MsgWithdrawDelegatorRewardResponse defines the Msg/WithdrawDelegatorReward + * response type. + */ +export interface MsgWithdrawDelegatorRewardResponseAmino { + /** Since: cosmos-sdk 0.46 */ + amount: CoinAmino[]; +} export interface MsgWithdrawDelegatorRewardResponseAminoMsg { type: "cosmos-sdk/MsgWithdrawDelegatorRewardResponse"; value: MsgWithdrawDelegatorRewardResponseAmino; } -/** MsgWithdrawDelegatorRewardResponse defines the Msg/WithdrawDelegatorReward response type. */ -export interface MsgWithdrawDelegatorRewardResponseSDKType {} +/** + * MsgWithdrawDelegatorRewardResponse defines the Msg/WithdrawDelegatorReward + * response type. + */ +export interface MsgWithdrawDelegatorRewardResponseSDKType { + amount: CoinSDKType[]; +} /** * MsgWithdrawValidatorCommission withdraws the full commission to the validator * address. @@ -108,10 +137,10 @@ export interface MsgWithdrawValidatorCommissionProtoMsg { * address. */ export interface MsgWithdrawValidatorCommissionAmino { - validator_address: string; + validator_address?: string; } export interface MsgWithdrawValidatorCommissionAminoMsg { - type: "cosmos-sdk/MsgWithdrawValCommission"; + type: "cosmos-sdk/MsgWithdrawValidatorCommission"; value: MsgWithdrawValidatorCommissionAmino; } /** @@ -121,20 +150,37 @@ export interface MsgWithdrawValidatorCommissionAminoMsg { export interface MsgWithdrawValidatorCommissionSDKType { validator_address: string; } -/** MsgWithdrawValidatorCommissionResponse defines the Msg/WithdrawValidatorCommission response type. */ -export interface MsgWithdrawValidatorCommissionResponse {} +/** + * MsgWithdrawValidatorCommissionResponse defines the + * Msg/WithdrawValidatorCommission response type. + */ +export interface MsgWithdrawValidatorCommissionResponse { + /** Since: cosmos-sdk 0.46 */ + amount: Coin[]; +} export interface MsgWithdrawValidatorCommissionResponseProtoMsg { typeUrl: "/cosmos.distribution.v1beta1.MsgWithdrawValidatorCommissionResponse"; value: Uint8Array; } -/** MsgWithdrawValidatorCommissionResponse defines the Msg/WithdrawValidatorCommission response type. */ -export interface MsgWithdrawValidatorCommissionResponseAmino {} +/** + * MsgWithdrawValidatorCommissionResponse defines the + * Msg/WithdrawValidatorCommission response type. + */ +export interface MsgWithdrawValidatorCommissionResponseAmino { + /** Since: cosmos-sdk 0.46 */ + amount: CoinAmino[]; +} export interface MsgWithdrawValidatorCommissionResponseAminoMsg { type: "cosmos-sdk/MsgWithdrawValidatorCommissionResponse"; value: MsgWithdrawValidatorCommissionResponseAmino; } -/** MsgWithdrawValidatorCommissionResponse defines the Msg/WithdrawValidatorCommission response type. */ -export interface MsgWithdrawValidatorCommissionResponseSDKType {} +/** + * MsgWithdrawValidatorCommissionResponse defines the + * Msg/WithdrawValidatorCommission response type. + */ +export interface MsgWithdrawValidatorCommissionResponseSDKType { + amount: CoinSDKType[]; +} /** * MsgFundCommunityPool allows an account to directly * fund the community pool. @@ -153,7 +199,7 @@ export interface MsgFundCommunityPoolProtoMsg { */ export interface MsgFundCommunityPoolAmino { amount: CoinAmino[]; - depositor: string; + depositor?: string; } export interface MsgFundCommunityPoolAminoMsg { type: "cosmos-sdk/MsgFundCommunityPool"; @@ -181,6 +227,157 @@ export interface MsgFundCommunityPoolResponseAminoMsg { } /** MsgFundCommunityPoolResponse defines the Msg/FundCommunityPool response type. */ export interface MsgFundCommunityPoolResponseSDKType {} +/** + * MsgUpdateParams is the Msg/UpdateParams request type. + * + * Since: cosmos-sdk 0.47 + */ +export interface MsgUpdateParams { + /** authority is the address that controls the module (defaults to x/gov unless overwritten). */ + authority: string; + /** + * params defines the x/distribution parameters to update. + * + * NOTE: All parameters must be supplied. + */ + params: Params; +} +export interface MsgUpdateParamsProtoMsg { + typeUrl: "/cosmos.distribution.v1beta1.MsgUpdateParams"; + value: Uint8Array; +} +/** + * MsgUpdateParams is the Msg/UpdateParams request type. + * + * Since: cosmos-sdk 0.47 + */ +export interface MsgUpdateParamsAmino { + /** authority is the address that controls the module (defaults to x/gov unless overwritten). */ + authority?: string; + /** + * params defines the x/distribution parameters to update. + * + * NOTE: All parameters must be supplied. + */ + params: ParamsAmino; +} +export interface MsgUpdateParamsAminoMsg { + type: "cosmos-sdk/distribution/MsgUpdateParams"; + value: MsgUpdateParamsAmino; +} +/** + * MsgUpdateParams is the Msg/UpdateParams request type. + * + * Since: cosmos-sdk 0.47 + */ +export interface MsgUpdateParamsSDKType { + authority: string; + params: ParamsSDKType; +} +/** + * MsgUpdateParamsResponse defines the response structure for executing a + * MsgUpdateParams message. + * + * Since: cosmos-sdk 0.47 + */ +export interface MsgUpdateParamsResponse {} +export interface MsgUpdateParamsResponseProtoMsg { + typeUrl: "/cosmos.distribution.v1beta1.MsgUpdateParamsResponse"; + value: Uint8Array; +} +/** + * MsgUpdateParamsResponse defines the response structure for executing a + * MsgUpdateParams message. + * + * Since: cosmos-sdk 0.47 + */ +export interface MsgUpdateParamsResponseAmino {} +export interface MsgUpdateParamsResponseAminoMsg { + type: "cosmos-sdk/MsgUpdateParamsResponse"; + value: MsgUpdateParamsResponseAmino; +} +/** + * MsgUpdateParamsResponse defines the response structure for executing a + * MsgUpdateParams message. + * + * Since: cosmos-sdk 0.47 + */ +export interface MsgUpdateParamsResponseSDKType {} +/** + * MsgCommunityPoolSpend defines a message for sending tokens from the community + * pool to another account. This message is typically executed via a governance + * proposal with the governance module being the executing authority. + * + * Since: cosmos-sdk 0.47 + */ +export interface MsgCommunityPoolSpend { + /** authority is the address that controls the module (defaults to x/gov unless overwritten). */ + authority: string; + recipient: string; + amount: Coin[]; +} +export interface MsgCommunityPoolSpendProtoMsg { + typeUrl: "/cosmos.distribution.v1beta1.MsgCommunityPoolSpend"; + value: Uint8Array; +} +/** + * MsgCommunityPoolSpend defines a message for sending tokens from the community + * pool to another account. This message is typically executed via a governance + * proposal with the governance module being the executing authority. + * + * Since: cosmos-sdk 0.47 + */ +export interface MsgCommunityPoolSpendAmino { + /** authority is the address that controls the module (defaults to x/gov unless overwritten). */ + authority?: string; + recipient?: string; + amount: CoinAmino[]; +} +export interface MsgCommunityPoolSpendAminoMsg { + type: "cosmos-sdk/distr/MsgCommunityPoolSpend"; + value: MsgCommunityPoolSpendAmino; +} +/** + * MsgCommunityPoolSpend defines a message for sending tokens from the community + * pool to another account. This message is typically executed via a governance + * proposal with the governance module being the executing authority. + * + * Since: cosmos-sdk 0.47 + */ +export interface MsgCommunityPoolSpendSDKType { + authority: string; + recipient: string; + amount: CoinSDKType[]; +} +/** + * MsgCommunityPoolSpendResponse defines the response to executing a + * MsgCommunityPoolSpend message. + * + * Since: cosmos-sdk 0.47 + */ +export interface MsgCommunityPoolSpendResponse {} +export interface MsgCommunityPoolSpendResponseProtoMsg { + typeUrl: "/cosmos.distribution.v1beta1.MsgCommunityPoolSpendResponse"; + value: Uint8Array; +} +/** + * MsgCommunityPoolSpendResponse defines the response to executing a + * MsgCommunityPoolSpend message. + * + * Since: cosmos-sdk 0.47 + */ +export interface MsgCommunityPoolSpendResponseAmino {} +export interface MsgCommunityPoolSpendResponseAminoMsg { + type: "cosmos-sdk/MsgCommunityPoolSpendResponse"; + value: MsgCommunityPoolSpendResponseAmino; +} +/** + * MsgCommunityPoolSpendResponse defines the response to executing a + * MsgCommunityPoolSpend message. + * + * Since: cosmos-sdk 0.47 + */ +export interface MsgCommunityPoolSpendResponseSDKType {} function createBaseMsgSetWithdrawAddress(): MsgSetWithdrawAddress { return { delegatorAddress: "", @@ -189,6 +386,16 @@ function createBaseMsgSetWithdrawAddress(): MsgSetWithdrawAddress { } export const MsgSetWithdrawAddress = { typeUrl: "/cosmos.distribution.v1beta1.MsgSetWithdrawAddress", + aminoType: "cosmos-sdk/MsgModifyWithdrawAddress", + is(o: any): o is MsgSetWithdrawAddress { + return o && (o.$typeUrl === MsgSetWithdrawAddress.typeUrl || typeof o.delegatorAddress === "string" && typeof o.withdrawAddress === "string"); + }, + isSDK(o: any): o is MsgSetWithdrawAddressSDKType { + return o && (o.$typeUrl === MsgSetWithdrawAddress.typeUrl || typeof o.delegator_address === "string" && typeof o.withdraw_address === "string"); + }, + isAmino(o: any): o is MsgSetWithdrawAddressAmino { + return o && (o.$typeUrl === MsgSetWithdrawAddress.typeUrl || typeof o.delegator_address === "string" && typeof o.withdraw_address === "string"); + }, encode(message: MsgSetWithdrawAddress, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.delegatorAddress !== "") { writer.uint32(10).string(message.delegatorAddress); @@ -218,6 +425,18 @@ export const MsgSetWithdrawAddress = { } return message; }, + fromJSON(object: any): MsgSetWithdrawAddress { + return { + 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; + }, fromPartial(object: Partial): MsgSetWithdrawAddress { const message = createBaseMsgSetWithdrawAddress(); message.delegatorAddress = object.delegatorAddress ?? ""; @@ -225,10 +444,14 @@ export const MsgSetWithdrawAddress = { return message; }, fromAmino(object: MsgSetWithdrawAddressAmino): MsgSetWithdrawAddress { - return { - delegatorAddress: object.delegator_address, - withdrawAddress: object.withdraw_address - }; + const message = createBaseMsgSetWithdrawAddress(); + if (object.delegator_address !== undefined && object.delegator_address !== null) { + message.delegatorAddress = object.delegator_address; + } + if (object.withdraw_address !== undefined && object.withdraw_address !== null) { + message.withdrawAddress = object.withdraw_address; + } + return message; }, toAmino(message: MsgSetWithdrawAddress): MsgSetWithdrawAddressAmino { const obj: any = {}; @@ -258,11 +481,23 @@ export const MsgSetWithdrawAddress = { }; } }; +GlobalDecoderRegistry.register(MsgSetWithdrawAddress.typeUrl, MsgSetWithdrawAddress); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgSetWithdrawAddress.aminoType, MsgSetWithdrawAddress.typeUrl); function createBaseMsgSetWithdrawAddressResponse(): MsgSetWithdrawAddressResponse { return {}; } export const MsgSetWithdrawAddressResponse = { typeUrl: "/cosmos.distribution.v1beta1.MsgSetWithdrawAddressResponse", + aminoType: "cosmos-sdk/MsgSetWithdrawAddressResponse", + is(o: any): o is MsgSetWithdrawAddressResponse { + return o && o.$typeUrl === MsgSetWithdrawAddressResponse.typeUrl; + }, + isSDK(o: any): o is MsgSetWithdrawAddressResponseSDKType { + return o && o.$typeUrl === MsgSetWithdrawAddressResponse.typeUrl; + }, + isAmino(o: any): o is MsgSetWithdrawAddressResponseAmino { + return o && o.$typeUrl === MsgSetWithdrawAddressResponse.typeUrl; + }, encode(_: MsgSetWithdrawAddressResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, @@ -280,12 +515,20 @@ export const MsgSetWithdrawAddressResponse = { } return message; }, + fromJSON(_: any): MsgSetWithdrawAddressResponse { + return {}; + }, + toJSON(_: MsgSetWithdrawAddressResponse): unknown { + const obj: any = {}; + return obj; + }, fromPartial(_: Partial): MsgSetWithdrawAddressResponse { const message = createBaseMsgSetWithdrawAddressResponse(); return message; }, fromAmino(_: MsgSetWithdrawAddressResponseAmino): MsgSetWithdrawAddressResponse { - return {}; + const message = createBaseMsgSetWithdrawAddressResponse(); + return message; }, toAmino(_: MsgSetWithdrawAddressResponse): MsgSetWithdrawAddressResponseAmino { const obj: any = {}; @@ -313,6 +556,8 @@ export const MsgSetWithdrawAddressResponse = { }; } }; +GlobalDecoderRegistry.register(MsgSetWithdrawAddressResponse.typeUrl, MsgSetWithdrawAddressResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgSetWithdrawAddressResponse.aminoType, MsgSetWithdrawAddressResponse.typeUrl); function createBaseMsgWithdrawDelegatorReward(): MsgWithdrawDelegatorReward { return { delegatorAddress: "", @@ -321,6 +566,16 @@ function createBaseMsgWithdrawDelegatorReward(): MsgWithdrawDelegatorReward { } export const MsgWithdrawDelegatorReward = { typeUrl: "/cosmos.distribution.v1beta1.MsgWithdrawDelegatorReward", + aminoType: "cosmos-sdk/MsgWithdrawDelegationReward", + is(o: any): o is MsgWithdrawDelegatorReward { + return o && (o.$typeUrl === MsgWithdrawDelegatorReward.typeUrl || typeof o.delegatorAddress === "string" && typeof o.validatorAddress === "string"); + }, + isSDK(o: any): o is MsgWithdrawDelegatorRewardSDKType { + return o && (o.$typeUrl === MsgWithdrawDelegatorReward.typeUrl || typeof o.delegator_address === "string" && typeof o.validator_address === "string"); + }, + isAmino(o: any): o is MsgWithdrawDelegatorRewardAmino { + return o && (o.$typeUrl === MsgWithdrawDelegatorReward.typeUrl || typeof o.delegator_address === "string" && typeof o.validator_address === "string"); + }, encode(message: MsgWithdrawDelegatorReward, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.delegatorAddress !== "") { writer.uint32(10).string(message.delegatorAddress); @@ -350,6 +605,18 @@ export const MsgWithdrawDelegatorReward = { } return message; }, + fromJSON(object: any): MsgWithdrawDelegatorReward { + return { + 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; + }, fromPartial(object: Partial): MsgWithdrawDelegatorReward { const message = createBaseMsgWithdrawDelegatorReward(); message.delegatorAddress = object.delegatorAddress ?? ""; @@ -357,10 +624,14 @@ export const MsgWithdrawDelegatorReward = { return message; }, fromAmino(object: MsgWithdrawDelegatorRewardAmino): MsgWithdrawDelegatorReward { - return { - delegatorAddress: object.delegator_address, - validatorAddress: object.validator_address - }; + const message = createBaseMsgWithdrawDelegatorReward(); + if (object.delegator_address !== undefined && object.delegator_address !== null) { + message.delegatorAddress = object.delegator_address; + } + if (object.validator_address !== undefined && object.validator_address !== null) { + message.validatorAddress = object.validator_address; + } + return message; }, toAmino(message: MsgWithdrawDelegatorReward): MsgWithdrawDelegatorRewardAmino { const obj: any = {}; @@ -390,12 +661,29 @@ export const MsgWithdrawDelegatorReward = { }; } }; +GlobalDecoderRegistry.register(MsgWithdrawDelegatorReward.typeUrl, MsgWithdrawDelegatorReward); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgWithdrawDelegatorReward.aminoType, MsgWithdrawDelegatorReward.typeUrl); function createBaseMsgWithdrawDelegatorRewardResponse(): MsgWithdrawDelegatorRewardResponse { - return {}; + return { + amount: [] + }; } export const MsgWithdrawDelegatorRewardResponse = { typeUrl: "/cosmos.distribution.v1beta1.MsgWithdrawDelegatorRewardResponse", - encode(_: MsgWithdrawDelegatorRewardResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + aminoType: "cosmos-sdk/MsgWithdrawDelegatorRewardResponse", + is(o: any): o is MsgWithdrawDelegatorRewardResponse { + return o && (o.$typeUrl === MsgWithdrawDelegatorRewardResponse.typeUrl || Array.isArray(o.amount) && (!o.amount.length || Coin.is(o.amount[0]))); + }, + isSDK(o: any): o is MsgWithdrawDelegatorRewardResponseSDKType { + return o && (o.$typeUrl === MsgWithdrawDelegatorRewardResponse.typeUrl || Array.isArray(o.amount) && (!o.amount.length || Coin.isSDK(o.amount[0]))); + }, + isAmino(o: any): o is MsgWithdrawDelegatorRewardResponseAmino { + return o && (o.$typeUrl === MsgWithdrawDelegatorRewardResponse.typeUrl || Array.isArray(o.amount) && (!o.amount.length || Coin.isAmino(o.amount[0]))); + }, + encode(message: MsgWithdrawDelegatorRewardResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.amount) { + Coin.encode(v!, writer.uint32(10).fork()).ldelim(); + } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): MsgWithdrawDelegatorRewardResponse { @@ -405,6 +693,9 @@ export const MsgWithdrawDelegatorRewardResponse = { while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { + case 1: + message.amount.push(Coin.decode(reader, reader.uint32())); + break; default: reader.skipType(tag & 7); break; @@ -412,15 +703,37 @@ export const MsgWithdrawDelegatorRewardResponse = { } return message; }, - fromPartial(_: Partial): MsgWithdrawDelegatorRewardResponse { + fromJSON(object: any): MsgWithdrawDelegatorRewardResponse { + return { + amount: Array.isArray(object?.amount) ? object.amount.map((e: any) => Coin.fromJSON(e)) : [] + }; + }, + toJSON(message: MsgWithdrawDelegatorRewardResponse): unknown { + const obj: any = {}; + if (message.amount) { + obj.amount = message.amount.map(e => e ? Coin.toJSON(e) : undefined); + } else { + obj.amount = []; + } + return obj; + }, + fromPartial(object: Partial): MsgWithdrawDelegatorRewardResponse { const message = createBaseMsgWithdrawDelegatorRewardResponse(); + message.amount = object.amount?.map(e => Coin.fromPartial(e)) || []; return message; }, - fromAmino(_: MsgWithdrawDelegatorRewardResponseAmino): MsgWithdrawDelegatorRewardResponse { - return {}; + fromAmino(object: MsgWithdrawDelegatorRewardResponseAmino): MsgWithdrawDelegatorRewardResponse { + const message = createBaseMsgWithdrawDelegatorRewardResponse(); + message.amount = object.amount?.map(e => Coin.fromAmino(e)) || []; + return message; }, - toAmino(_: MsgWithdrawDelegatorRewardResponse): MsgWithdrawDelegatorRewardResponseAmino { + toAmino(message: MsgWithdrawDelegatorRewardResponse): MsgWithdrawDelegatorRewardResponseAmino { const obj: any = {}; + if (message.amount) { + obj.amount = message.amount.map(e => e ? Coin.toAmino(e) : undefined); + } else { + obj.amount = []; + } return obj; }, fromAminoMsg(object: MsgWithdrawDelegatorRewardResponseAminoMsg): MsgWithdrawDelegatorRewardResponse { @@ -445,6 +758,8 @@ export const MsgWithdrawDelegatorRewardResponse = { }; } }; +GlobalDecoderRegistry.register(MsgWithdrawDelegatorRewardResponse.typeUrl, MsgWithdrawDelegatorRewardResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgWithdrawDelegatorRewardResponse.aminoType, MsgWithdrawDelegatorRewardResponse.typeUrl); function createBaseMsgWithdrawValidatorCommission(): MsgWithdrawValidatorCommission { return { validatorAddress: "" @@ -452,6 +767,16 @@ function createBaseMsgWithdrawValidatorCommission(): MsgWithdrawValidatorCommiss } export const MsgWithdrawValidatorCommission = { typeUrl: "/cosmos.distribution.v1beta1.MsgWithdrawValidatorCommission", + aminoType: "cosmos-sdk/MsgWithdrawValidatorCommission", + is(o: any): o is MsgWithdrawValidatorCommission { + return o && (o.$typeUrl === MsgWithdrawValidatorCommission.typeUrl || typeof o.validatorAddress === "string"); + }, + isSDK(o: any): o is MsgWithdrawValidatorCommissionSDKType { + return o && (o.$typeUrl === MsgWithdrawValidatorCommission.typeUrl || typeof o.validator_address === "string"); + }, + isAmino(o: any): o is MsgWithdrawValidatorCommissionAmino { + return o && (o.$typeUrl === MsgWithdrawValidatorCommission.typeUrl || typeof o.validator_address === "string"); + }, encode(message: MsgWithdrawValidatorCommission, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.validatorAddress !== "") { writer.uint32(10).string(message.validatorAddress); @@ -475,15 +800,27 @@ export const MsgWithdrawValidatorCommission = { } return message; }, + fromJSON(object: any): MsgWithdrawValidatorCommission { + return { + validatorAddress: isSet(object.validatorAddress) ? String(object.validatorAddress) : "" + }; + }, + toJSON(message: MsgWithdrawValidatorCommission): unknown { + const obj: any = {}; + message.validatorAddress !== undefined && (obj.validatorAddress = message.validatorAddress); + return obj; + }, fromPartial(object: Partial): MsgWithdrawValidatorCommission { const message = createBaseMsgWithdrawValidatorCommission(); message.validatorAddress = object.validatorAddress ?? ""; return message; }, fromAmino(object: MsgWithdrawValidatorCommissionAmino): MsgWithdrawValidatorCommission { - return { - validatorAddress: object.validator_address - }; + const message = createBaseMsgWithdrawValidatorCommission(); + if (object.validator_address !== undefined && object.validator_address !== null) { + message.validatorAddress = object.validator_address; + } + return message; }, toAmino(message: MsgWithdrawValidatorCommission): MsgWithdrawValidatorCommissionAmino { const obj: any = {}; @@ -495,7 +832,7 @@ export const MsgWithdrawValidatorCommission = { }, toAminoMsg(message: MsgWithdrawValidatorCommission): MsgWithdrawValidatorCommissionAminoMsg { return { - type: "cosmos-sdk/MsgWithdrawValCommission", + type: "cosmos-sdk/MsgWithdrawValidatorCommission", value: MsgWithdrawValidatorCommission.toAmino(message) }; }, @@ -512,12 +849,29 @@ export const MsgWithdrawValidatorCommission = { }; } }; +GlobalDecoderRegistry.register(MsgWithdrawValidatorCommission.typeUrl, MsgWithdrawValidatorCommission); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgWithdrawValidatorCommission.aminoType, MsgWithdrawValidatorCommission.typeUrl); function createBaseMsgWithdrawValidatorCommissionResponse(): MsgWithdrawValidatorCommissionResponse { - return {}; + return { + amount: [] + }; } export const MsgWithdrawValidatorCommissionResponse = { typeUrl: "/cosmos.distribution.v1beta1.MsgWithdrawValidatorCommissionResponse", - encode(_: MsgWithdrawValidatorCommissionResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + aminoType: "cosmos-sdk/MsgWithdrawValidatorCommissionResponse", + is(o: any): o is MsgWithdrawValidatorCommissionResponse { + return o && (o.$typeUrl === MsgWithdrawValidatorCommissionResponse.typeUrl || Array.isArray(o.amount) && (!o.amount.length || Coin.is(o.amount[0]))); + }, + isSDK(o: any): o is MsgWithdrawValidatorCommissionResponseSDKType { + return o && (o.$typeUrl === MsgWithdrawValidatorCommissionResponse.typeUrl || Array.isArray(o.amount) && (!o.amount.length || Coin.isSDK(o.amount[0]))); + }, + isAmino(o: any): o is MsgWithdrawValidatorCommissionResponseAmino { + return o && (o.$typeUrl === MsgWithdrawValidatorCommissionResponse.typeUrl || Array.isArray(o.amount) && (!o.amount.length || Coin.isAmino(o.amount[0]))); + }, + encode(message: MsgWithdrawValidatorCommissionResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.amount) { + Coin.encode(v!, writer.uint32(10).fork()).ldelim(); + } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): MsgWithdrawValidatorCommissionResponse { @@ -527,6 +881,9 @@ export const MsgWithdrawValidatorCommissionResponse = { while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { + case 1: + message.amount.push(Coin.decode(reader, reader.uint32())); + break; default: reader.skipType(tag & 7); break; @@ -534,15 +891,37 @@ export const MsgWithdrawValidatorCommissionResponse = { } return message; }, - fromPartial(_: Partial): MsgWithdrawValidatorCommissionResponse { + fromJSON(object: any): MsgWithdrawValidatorCommissionResponse { + return { + amount: Array.isArray(object?.amount) ? object.amount.map((e: any) => Coin.fromJSON(e)) : [] + }; + }, + toJSON(message: MsgWithdrawValidatorCommissionResponse): unknown { + const obj: any = {}; + if (message.amount) { + obj.amount = message.amount.map(e => e ? Coin.toJSON(e) : undefined); + } else { + obj.amount = []; + } + return obj; + }, + fromPartial(object: Partial): MsgWithdrawValidatorCommissionResponse { const message = createBaseMsgWithdrawValidatorCommissionResponse(); + message.amount = object.amount?.map(e => Coin.fromPartial(e)) || []; return message; }, - fromAmino(_: MsgWithdrawValidatorCommissionResponseAmino): MsgWithdrawValidatorCommissionResponse { - return {}; + fromAmino(object: MsgWithdrawValidatorCommissionResponseAmino): MsgWithdrawValidatorCommissionResponse { + const message = createBaseMsgWithdrawValidatorCommissionResponse(); + message.amount = object.amount?.map(e => Coin.fromAmino(e)) || []; + return message; }, - toAmino(_: MsgWithdrawValidatorCommissionResponse): MsgWithdrawValidatorCommissionResponseAmino { + toAmino(message: MsgWithdrawValidatorCommissionResponse): MsgWithdrawValidatorCommissionResponseAmino { const obj: any = {}; + if (message.amount) { + obj.amount = message.amount.map(e => e ? Coin.toAmino(e) : undefined); + } else { + obj.amount = []; + } return obj; }, fromAminoMsg(object: MsgWithdrawValidatorCommissionResponseAminoMsg): MsgWithdrawValidatorCommissionResponse { @@ -567,6 +946,8 @@ export const MsgWithdrawValidatorCommissionResponse = { }; } }; +GlobalDecoderRegistry.register(MsgWithdrawValidatorCommissionResponse.typeUrl, MsgWithdrawValidatorCommissionResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgWithdrawValidatorCommissionResponse.aminoType, MsgWithdrawValidatorCommissionResponse.typeUrl); function createBaseMsgFundCommunityPool(): MsgFundCommunityPool { return { amount: [], @@ -575,6 +956,16 @@ function createBaseMsgFundCommunityPool(): MsgFundCommunityPool { } export const MsgFundCommunityPool = { typeUrl: "/cosmos.distribution.v1beta1.MsgFundCommunityPool", + aminoType: "cosmos-sdk/MsgFundCommunityPool", + is(o: any): o is MsgFundCommunityPool { + return o && (o.$typeUrl === MsgFundCommunityPool.typeUrl || Array.isArray(o.amount) && (!o.amount.length || Coin.is(o.amount[0])) && typeof o.depositor === "string"); + }, + isSDK(o: any): o is MsgFundCommunityPoolSDKType { + return o && (o.$typeUrl === MsgFundCommunityPool.typeUrl || Array.isArray(o.amount) && (!o.amount.length || Coin.isSDK(o.amount[0])) && typeof o.depositor === "string"); + }, + isAmino(o: any): o is MsgFundCommunityPoolAmino { + return o && (o.$typeUrl === MsgFundCommunityPool.typeUrl || Array.isArray(o.amount) && (!o.amount.length || Coin.isAmino(o.amount[0])) && typeof o.depositor === "string"); + }, encode(message: MsgFundCommunityPool, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.amount) { Coin.encode(v!, writer.uint32(10).fork()).ldelim(); @@ -604,6 +995,22 @@ export const MsgFundCommunityPool = { } return message; }, + fromJSON(object: any): MsgFundCommunityPool { + return { + 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 = {}; + if (message.amount) { + obj.amount = message.amount.map(e => e ? Coin.toJSON(e) : undefined); + } else { + obj.amount = []; + } + message.depositor !== undefined && (obj.depositor = message.depositor); + return obj; + }, fromPartial(object: Partial): MsgFundCommunityPool { const message = createBaseMsgFundCommunityPool(); message.amount = object.amount?.map(e => Coin.fromPartial(e)) || []; @@ -611,10 +1018,12 @@ export const MsgFundCommunityPool = { return message; }, fromAmino(object: MsgFundCommunityPoolAmino): MsgFundCommunityPool { - return { - amount: Array.isArray(object?.amount) ? object.amount.map((e: any) => Coin.fromAmino(e)) : [], - depositor: object.depositor - }; + const message = createBaseMsgFundCommunityPool(); + message.amount = object.amount?.map(e => Coin.fromAmino(e)) || []; + if (object.depositor !== undefined && object.depositor !== null) { + message.depositor = object.depositor; + } + return message; }, toAmino(message: MsgFundCommunityPool): MsgFundCommunityPoolAmino { const obj: any = {}; @@ -648,11 +1057,23 @@ export const MsgFundCommunityPool = { }; } }; +GlobalDecoderRegistry.register(MsgFundCommunityPool.typeUrl, MsgFundCommunityPool); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgFundCommunityPool.aminoType, MsgFundCommunityPool.typeUrl); function createBaseMsgFundCommunityPoolResponse(): MsgFundCommunityPoolResponse { return {}; } export const MsgFundCommunityPoolResponse = { typeUrl: "/cosmos.distribution.v1beta1.MsgFundCommunityPoolResponse", + aminoType: "cosmos-sdk/MsgFundCommunityPoolResponse", + is(o: any): o is MsgFundCommunityPoolResponse { + return o && o.$typeUrl === MsgFundCommunityPoolResponse.typeUrl; + }, + isSDK(o: any): o is MsgFundCommunityPoolResponseSDKType { + return o && o.$typeUrl === MsgFundCommunityPoolResponse.typeUrl; + }, + isAmino(o: any): o is MsgFundCommunityPoolResponseAmino { + return o && o.$typeUrl === MsgFundCommunityPoolResponse.typeUrl; + }, encode(_: MsgFundCommunityPoolResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, @@ -670,12 +1091,20 @@ export const MsgFundCommunityPoolResponse = { } return message; }, + fromJSON(_: any): MsgFundCommunityPoolResponse { + return {}; + }, + toJSON(_: MsgFundCommunityPoolResponse): unknown { + const obj: any = {}; + return obj; + }, fromPartial(_: Partial): MsgFundCommunityPoolResponse { const message = createBaseMsgFundCommunityPoolResponse(); return message; }, fromAmino(_: MsgFundCommunityPoolResponseAmino): MsgFundCommunityPoolResponse { - return {}; + const message = createBaseMsgFundCommunityPoolResponse(); + return message; }, toAmino(_: MsgFundCommunityPoolResponse): MsgFundCommunityPoolResponseAmino { const obj: any = {}; @@ -702,4 +1131,386 @@ export const MsgFundCommunityPoolResponse = { value: MsgFundCommunityPoolResponse.encode(message).finish() }; } -}; \ No newline at end of file +}; +GlobalDecoderRegistry.register(MsgFundCommunityPoolResponse.typeUrl, MsgFundCommunityPoolResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgFundCommunityPoolResponse.aminoType, MsgFundCommunityPoolResponse.typeUrl); +function createBaseMsgUpdateParams(): MsgUpdateParams { + return { + authority: "", + params: Params.fromPartial({}) + }; +} +export const MsgUpdateParams = { + typeUrl: "/cosmos.distribution.v1beta1.MsgUpdateParams", + aminoType: "cosmos-sdk/distribution/MsgUpdateParams", + is(o: any): o is MsgUpdateParams { + return o && (o.$typeUrl === MsgUpdateParams.typeUrl || typeof o.authority === "string" && Params.is(o.params)); + }, + isSDK(o: any): o is MsgUpdateParamsSDKType { + return o && (o.$typeUrl === MsgUpdateParams.typeUrl || typeof o.authority === "string" && Params.isSDK(o.params)); + }, + isAmino(o: any): o is MsgUpdateParamsAmino { + return o && (o.$typeUrl === MsgUpdateParams.typeUrl || typeof o.authority === "string" && Params.isAmino(o.params)); + }, + encode(message: MsgUpdateParams, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.authority !== "") { + writer.uint32(10).string(message.authority); + } + if (message.params !== undefined) { + Params.encode(message.params, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgUpdateParams { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUpdateParams(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.authority = reader.string(); + break; + case 2: + message.params = Params.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): MsgUpdateParams { + return { + authority: isSet(object.authority) ? String(object.authority) : "", + params: isSet(object.params) ? Params.fromJSON(object.params) : undefined + }; + }, + toJSON(message: MsgUpdateParams): unknown { + const obj: any = {}; + message.authority !== undefined && (obj.authority = message.authority); + message.params !== undefined && (obj.params = message.params ? Params.toJSON(message.params) : undefined); + return obj; + }, + fromPartial(object: Partial): MsgUpdateParams { + const message = createBaseMsgUpdateParams(); + message.authority = object.authority ?? ""; + message.params = object.params !== undefined && object.params !== null ? Params.fromPartial(object.params) : undefined; + return message; + }, + fromAmino(object: MsgUpdateParamsAmino): MsgUpdateParams { + const message = createBaseMsgUpdateParams(); + if (object.authority !== undefined && object.authority !== null) { + message.authority = object.authority; + } + if (object.params !== undefined && object.params !== null) { + message.params = Params.fromAmino(object.params); + } + return message; + }, + toAmino(message: MsgUpdateParams): MsgUpdateParamsAmino { + const obj: any = {}; + obj.authority = message.authority; + obj.params = message.params ? Params.toAmino(message.params) : Params.fromPartial({}); + return obj; + }, + fromAminoMsg(object: MsgUpdateParamsAminoMsg): MsgUpdateParams { + return MsgUpdateParams.fromAmino(object.value); + }, + toAminoMsg(message: MsgUpdateParams): MsgUpdateParamsAminoMsg { + return { + type: "cosmos-sdk/distribution/MsgUpdateParams", + value: MsgUpdateParams.toAmino(message) + }; + }, + fromProtoMsg(message: MsgUpdateParamsProtoMsg): MsgUpdateParams { + return MsgUpdateParams.decode(message.value); + }, + toProto(message: MsgUpdateParams): Uint8Array { + return MsgUpdateParams.encode(message).finish(); + }, + toProtoMsg(message: MsgUpdateParams): MsgUpdateParamsProtoMsg { + return { + typeUrl: "/cosmos.distribution.v1beta1.MsgUpdateParams", + value: MsgUpdateParams.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgUpdateParams.typeUrl, MsgUpdateParams); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgUpdateParams.aminoType, MsgUpdateParams.typeUrl); +function createBaseMsgUpdateParamsResponse(): MsgUpdateParamsResponse { + return {}; +} +export const MsgUpdateParamsResponse = { + typeUrl: "/cosmos.distribution.v1beta1.MsgUpdateParamsResponse", + aminoType: "cosmos-sdk/MsgUpdateParamsResponse", + is(o: any): o is MsgUpdateParamsResponse { + return o && o.$typeUrl === MsgUpdateParamsResponse.typeUrl; + }, + isSDK(o: any): o is MsgUpdateParamsResponseSDKType { + return o && o.$typeUrl === MsgUpdateParamsResponse.typeUrl; + }, + isAmino(o: any): o is MsgUpdateParamsResponseAmino { + return o && o.$typeUrl === MsgUpdateParamsResponse.typeUrl; + }, + encode(_: MsgUpdateParamsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgUpdateParamsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUpdateParamsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(_: any): MsgUpdateParamsResponse { + return {}; + }, + toJSON(_: MsgUpdateParamsResponse): unknown { + const obj: any = {}; + return obj; + }, + fromPartial(_: Partial): MsgUpdateParamsResponse { + const message = createBaseMsgUpdateParamsResponse(); + return message; + }, + fromAmino(_: MsgUpdateParamsResponseAmino): MsgUpdateParamsResponse { + const message = createBaseMsgUpdateParamsResponse(); + return message; + }, + toAmino(_: MsgUpdateParamsResponse): MsgUpdateParamsResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgUpdateParamsResponseAminoMsg): MsgUpdateParamsResponse { + return MsgUpdateParamsResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgUpdateParamsResponse): MsgUpdateParamsResponseAminoMsg { + return { + type: "cosmos-sdk/MsgUpdateParamsResponse", + value: MsgUpdateParamsResponse.toAmino(message) + }; + }, + fromProtoMsg(message: MsgUpdateParamsResponseProtoMsg): MsgUpdateParamsResponse { + return MsgUpdateParamsResponse.decode(message.value); + }, + toProto(message: MsgUpdateParamsResponse): Uint8Array { + return MsgUpdateParamsResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgUpdateParamsResponse): MsgUpdateParamsResponseProtoMsg { + return { + typeUrl: "/cosmos.distribution.v1beta1.MsgUpdateParamsResponse", + value: MsgUpdateParamsResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgUpdateParamsResponse.typeUrl, MsgUpdateParamsResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgUpdateParamsResponse.aminoType, MsgUpdateParamsResponse.typeUrl); +function createBaseMsgCommunityPoolSpend(): MsgCommunityPoolSpend { + return { + authority: "", + recipient: "", + amount: [] + }; +} +export const MsgCommunityPoolSpend = { + typeUrl: "/cosmos.distribution.v1beta1.MsgCommunityPoolSpend", + aminoType: "cosmos-sdk/distr/MsgCommunityPoolSpend", + is(o: any): o is MsgCommunityPoolSpend { + return o && (o.$typeUrl === MsgCommunityPoolSpend.typeUrl || typeof o.authority === "string" && typeof o.recipient === "string" && Array.isArray(o.amount) && (!o.amount.length || Coin.is(o.amount[0]))); + }, + isSDK(o: any): o is MsgCommunityPoolSpendSDKType { + return o && (o.$typeUrl === MsgCommunityPoolSpend.typeUrl || typeof o.authority === "string" && typeof o.recipient === "string" && Array.isArray(o.amount) && (!o.amount.length || Coin.isSDK(o.amount[0]))); + }, + isAmino(o: any): o is MsgCommunityPoolSpendAmino { + return o && (o.$typeUrl === MsgCommunityPoolSpend.typeUrl || typeof o.authority === "string" && typeof o.recipient === "string" && Array.isArray(o.amount) && (!o.amount.length || Coin.isAmino(o.amount[0]))); + }, + encode(message: MsgCommunityPoolSpend, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.authority !== "") { + writer.uint32(10).string(message.authority); + } + if (message.recipient !== "") { + writer.uint32(18).string(message.recipient); + } + for (const v of message.amount) { + Coin.encode(v!, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgCommunityPoolSpend { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgCommunityPoolSpend(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.authority = reader.string(); + break; + case 2: + message.recipient = reader.string(); + break; + case 3: + message.amount.push(Coin.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): MsgCommunityPoolSpend { + return { + authority: isSet(object.authority) ? String(object.authority) : "", + recipient: isSet(object.recipient) ? String(object.recipient) : "", + amount: Array.isArray(object?.amount) ? object.amount.map((e: any) => Coin.fromJSON(e)) : [] + }; + }, + toJSON(message: MsgCommunityPoolSpend): unknown { + const obj: any = {}; + message.authority !== undefined && (obj.authority = message.authority); + message.recipient !== undefined && (obj.recipient = message.recipient); + if (message.amount) { + obj.amount = message.amount.map(e => e ? Coin.toJSON(e) : undefined); + } else { + obj.amount = []; + } + return obj; + }, + fromPartial(object: Partial): MsgCommunityPoolSpend { + const message = createBaseMsgCommunityPoolSpend(); + message.authority = object.authority ?? ""; + message.recipient = object.recipient ?? ""; + message.amount = object.amount?.map(e => Coin.fromPartial(e)) || []; + return message; + }, + fromAmino(object: MsgCommunityPoolSpendAmino): MsgCommunityPoolSpend { + const message = createBaseMsgCommunityPoolSpend(); + if (object.authority !== undefined && object.authority !== null) { + message.authority = object.authority; + } + if (object.recipient !== undefined && object.recipient !== null) { + message.recipient = object.recipient; + } + message.amount = object.amount?.map(e => Coin.fromAmino(e)) || []; + return message; + }, + toAmino(message: MsgCommunityPoolSpend): MsgCommunityPoolSpendAmino { + const obj: any = {}; + obj.authority = message.authority; + obj.recipient = message.recipient; + if (message.amount) { + obj.amount = message.amount.map(e => e ? Coin.toAmino(e) : undefined); + } else { + obj.amount = []; + } + return obj; + }, + fromAminoMsg(object: MsgCommunityPoolSpendAminoMsg): MsgCommunityPoolSpend { + return MsgCommunityPoolSpend.fromAmino(object.value); + }, + toAminoMsg(message: MsgCommunityPoolSpend): MsgCommunityPoolSpendAminoMsg { + return { + type: "cosmos-sdk/distr/MsgCommunityPoolSpend", + value: MsgCommunityPoolSpend.toAmino(message) + }; + }, + fromProtoMsg(message: MsgCommunityPoolSpendProtoMsg): MsgCommunityPoolSpend { + return MsgCommunityPoolSpend.decode(message.value); + }, + toProto(message: MsgCommunityPoolSpend): Uint8Array { + return MsgCommunityPoolSpend.encode(message).finish(); + }, + toProtoMsg(message: MsgCommunityPoolSpend): MsgCommunityPoolSpendProtoMsg { + return { + typeUrl: "/cosmos.distribution.v1beta1.MsgCommunityPoolSpend", + value: MsgCommunityPoolSpend.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgCommunityPoolSpend.typeUrl, MsgCommunityPoolSpend); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgCommunityPoolSpend.aminoType, MsgCommunityPoolSpend.typeUrl); +function createBaseMsgCommunityPoolSpendResponse(): MsgCommunityPoolSpendResponse { + return {}; +} +export const MsgCommunityPoolSpendResponse = { + typeUrl: "/cosmos.distribution.v1beta1.MsgCommunityPoolSpendResponse", + aminoType: "cosmos-sdk/MsgCommunityPoolSpendResponse", + is(o: any): o is MsgCommunityPoolSpendResponse { + return o && o.$typeUrl === MsgCommunityPoolSpendResponse.typeUrl; + }, + isSDK(o: any): o is MsgCommunityPoolSpendResponseSDKType { + return o && o.$typeUrl === MsgCommunityPoolSpendResponse.typeUrl; + }, + isAmino(o: any): o is MsgCommunityPoolSpendResponseAmino { + return o && o.$typeUrl === MsgCommunityPoolSpendResponse.typeUrl; + }, + encode(_: MsgCommunityPoolSpendResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgCommunityPoolSpendResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgCommunityPoolSpendResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(_: any): MsgCommunityPoolSpendResponse { + return {}; + }, + toJSON(_: MsgCommunityPoolSpendResponse): unknown { + const obj: any = {}; + return obj; + }, + fromPartial(_: Partial): MsgCommunityPoolSpendResponse { + const message = createBaseMsgCommunityPoolSpendResponse(); + return message; + }, + fromAmino(_: MsgCommunityPoolSpendResponseAmino): MsgCommunityPoolSpendResponse { + const message = createBaseMsgCommunityPoolSpendResponse(); + return message; + }, + toAmino(_: MsgCommunityPoolSpendResponse): MsgCommunityPoolSpendResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgCommunityPoolSpendResponseAminoMsg): MsgCommunityPoolSpendResponse { + return MsgCommunityPoolSpendResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgCommunityPoolSpendResponse): MsgCommunityPoolSpendResponseAminoMsg { + return { + type: "cosmos-sdk/MsgCommunityPoolSpendResponse", + value: MsgCommunityPoolSpendResponse.toAmino(message) + }; + }, + fromProtoMsg(message: MsgCommunityPoolSpendResponseProtoMsg): MsgCommunityPoolSpendResponse { + return MsgCommunityPoolSpendResponse.decode(message.value); + }, + toProto(message: MsgCommunityPoolSpendResponse): Uint8Array { + return MsgCommunityPoolSpendResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgCommunityPoolSpendResponse): MsgCommunityPoolSpendResponseProtoMsg { + return { + typeUrl: "/cosmos.distribution.v1beta1.MsgCommunityPoolSpendResponse", + value: MsgCommunityPoolSpendResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgCommunityPoolSpendResponse.typeUrl, MsgCommunityPoolSpendResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgCommunityPoolSpendResponse.aminoType, MsgCommunityPoolSpendResponse.typeUrl); \ No newline at end of file diff --git a/packages/osmojs/src/codegen/cosmos/gov/v1beta1/genesis.ts b/packages/osmojs/src/codegen/cosmos/gov/v1beta1/genesis.ts index 78acffccf..7376a557f 100644 --- a/packages/osmojs/src/codegen/cosmos/gov/v1beta1/genesis.ts +++ b/packages/osmojs/src/codegen/cosmos/gov/v1beta1/genesis.ts @@ -1,5 +1,7 @@ import { Deposit, DepositAmino, DepositSDKType, Vote, VoteAmino, VoteSDKType, Proposal, ProposalAmino, ProposalSDKType, DepositParams, DepositParamsAmino, DepositParamsSDKType, VotingParams, VotingParamsAmino, VotingParamsSDKType, TallyParams, TallyParamsAmino, TallyParamsSDKType } from "./gov"; import { BinaryReader, BinaryWriter } from "../../../binary"; +import { isSet } from "../../../helpers"; +import { GlobalDecoderRegistry } from "../../../registry"; /** GenesisState defines the gov module's genesis state. */ export interface GenesisState { /** starting_proposal_id is the ID of the starting proposal. */ @@ -10,11 +12,11 @@ export interface GenesisState { votes: Vote[]; /** proposals defines all the proposals present at genesis. */ proposals: Proposal[]; - /** params defines all the paramaters of related to deposit. */ + /** params defines all the parameters of related to deposit. */ depositParams: DepositParams; - /** params defines all the paramaters of related to voting. */ + /** params defines all the parameters of related to voting. */ votingParams: VotingParams; - /** params defines all the paramaters of related to tally. */ + /** params defines all the parameters of related to tally. */ tallyParams: TallyParams; } export interface GenesisStateProtoMsg { @@ -24,19 +26,19 @@ export interface GenesisStateProtoMsg { /** GenesisState defines the gov module's genesis state. */ export interface GenesisStateAmino { /** starting_proposal_id is the ID of the starting proposal. */ - starting_proposal_id: string; + starting_proposal_id?: string; /** deposits defines all the deposits present at genesis. */ deposits: DepositAmino[]; /** votes defines all the votes present at genesis. */ votes: VoteAmino[]; /** proposals defines all the proposals present at genesis. */ proposals: ProposalAmino[]; - /** params defines all the paramaters of related to deposit. */ - deposit_params?: DepositParamsAmino; - /** params defines all the paramaters of related to voting. */ - voting_params?: VotingParamsAmino; - /** params defines all the paramaters of related to tally. */ - tally_params?: TallyParamsAmino; + /** params defines all the parameters of related to deposit. */ + deposit_params: DepositParamsAmino; + /** params defines all the parameters of related to voting. */ + voting_params: VotingParamsAmino; + /** params defines all the parameters of related to tally. */ + tally_params: TallyParamsAmino; } export interface GenesisStateAminoMsg { type: "cosmos-sdk/GenesisState"; @@ -65,6 +67,16 @@ function createBaseGenesisState(): GenesisState { } export const GenesisState = { typeUrl: "/cosmos.gov.v1beta1.GenesisState", + aminoType: "cosmos-sdk/GenesisState", + is(o: any): o is GenesisState { + return o && (o.$typeUrl === GenesisState.typeUrl || typeof o.startingProposalId === "bigint" && Array.isArray(o.deposits) && (!o.deposits.length || Deposit.is(o.deposits[0])) && Array.isArray(o.votes) && (!o.votes.length || Vote.is(o.votes[0])) && Array.isArray(o.proposals) && (!o.proposals.length || Proposal.is(o.proposals[0])) && DepositParams.is(o.depositParams) && VotingParams.is(o.votingParams) && TallyParams.is(o.tallyParams)); + }, + isSDK(o: any): o is GenesisStateSDKType { + return o && (o.$typeUrl === GenesisState.typeUrl || typeof o.starting_proposal_id === "bigint" && Array.isArray(o.deposits) && (!o.deposits.length || Deposit.isSDK(o.deposits[0])) && Array.isArray(o.votes) && (!o.votes.length || Vote.isSDK(o.votes[0])) && Array.isArray(o.proposals) && (!o.proposals.length || Proposal.isSDK(o.proposals[0])) && DepositParams.isSDK(o.deposit_params) && VotingParams.isSDK(o.voting_params) && TallyParams.isSDK(o.tally_params)); + }, + isAmino(o: any): o is GenesisStateAmino { + return o && (o.$typeUrl === GenesisState.typeUrl || typeof o.starting_proposal_id === "bigint" && Array.isArray(o.deposits) && (!o.deposits.length || Deposit.isAmino(o.deposits[0])) && Array.isArray(o.votes) && (!o.votes.length || Vote.isAmino(o.votes[0])) && Array.isArray(o.proposals) && (!o.proposals.length || Proposal.isAmino(o.proposals[0])) && DepositParams.isAmino(o.deposit_params) && VotingParams.isAmino(o.voting_params) && TallyParams.isAmino(o.tally_params)); + }, encode(message: GenesisState, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.startingProposalId !== BigInt(0)) { writer.uint32(8).uint64(message.startingProposalId); @@ -124,6 +136,40 @@ export const GenesisState = { } return message; }, + fromJSON(object: any): GenesisState { + return { + startingProposalId: isSet(object.startingProposalId) ? BigInt(object.startingProposalId.toString()) : BigInt(0), + 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 = {}; + message.startingProposalId !== undefined && (obj.startingProposalId = (message.startingProposalId || BigInt(0)).toString()); + if (message.deposits) { + obj.deposits = message.deposits.map(e => e ? Deposit.toJSON(e) : undefined); + } else { + obj.deposits = []; + } + if (message.votes) { + obj.votes = message.votes.map(e => e ? Vote.toJSON(e) : undefined); + } else { + obj.votes = []; + } + if (message.proposals) { + obj.proposals = message.proposals.map(e => e ? Proposal.toJSON(e) : undefined); + } else { + obj.proposals = []; + } + message.depositParams !== undefined && (obj.depositParams = message.depositParams ? DepositParams.toJSON(message.depositParams) : undefined); + 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; + }, fromPartial(object: Partial): GenesisState { const message = createBaseGenesisState(); message.startingProposalId = object.startingProposalId !== undefined && object.startingProposalId !== null ? BigInt(object.startingProposalId.toString()) : BigInt(0); @@ -136,15 +182,23 @@ export const GenesisState = { return message; }, fromAmino(object: GenesisStateAmino): GenesisState { - return { - startingProposalId: BigInt(object.starting_proposal_id), - deposits: Array.isArray(object?.deposits) ? object.deposits.map((e: any) => Deposit.fromAmino(e)) : [], - votes: Array.isArray(object?.votes) ? object.votes.map((e: any) => Vote.fromAmino(e)) : [], - proposals: Array.isArray(object?.proposals) ? object.proposals.map((e: any) => Proposal.fromAmino(e)) : [], - depositParams: object?.deposit_params ? DepositParams.fromAmino(object.deposit_params) : undefined, - votingParams: object?.voting_params ? VotingParams.fromAmino(object.voting_params) : undefined, - tallyParams: object?.tally_params ? TallyParams.fromAmino(object.tally_params) : undefined - }; + const message = createBaseGenesisState(); + if (object.starting_proposal_id !== undefined && object.starting_proposal_id !== null) { + message.startingProposalId = BigInt(object.starting_proposal_id); + } + message.deposits = object.deposits?.map(e => Deposit.fromAmino(e)) || []; + message.votes = object.votes?.map(e => Vote.fromAmino(e)) || []; + message.proposals = object.proposals?.map(e => Proposal.fromAmino(e)) || []; + if (object.deposit_params !== undefined && object.deposit_params !== null) { + message.depositParams = DepositParams.fromAmino(object.deposit_params); + } + if (object.voting_params !== undefined && object.voting_params !== null) { + message.votingParams = VotingParams.fromAmino(object.voting_params); + } + if (object.tally_params !== undefined && object.tally_params !== null) { + message.tallyParams = TallyParams.fromAmino(object.tally_params); + } + return message; }, toAmino(message: GenesisState): GenesisStateAmino { const obj: any = {}; @@ -164,9 +218,9 @@ export const GenesisState = { } else { obj.proposals = []; } - obj.deposit_params = message.depositParams ? DepositParams.toAmino(message.depositParams) : undefined; - obj.voting_params = message.votingParams ? VotingParams.toAmino(message.votingParams) : undefined; - obj.tally_params = message.tallyParams ? TallyParams.toAmino(message.tallyParams) : undefined; + obj.deposit_params = message.depositParams ? DepositParams.toAmino(message.depositParams) : DepositParams.fromPartial({}); + obj.voting_params = message.votingParams ? VotingParams.toAmino(message.votingParams) : VotingParams.fromPartial({}); + obj.tally_params = message.tallyParams ? TallyParams.toAmino(message.tallyParams) : TallyParams.fromPartial({}); return obj; }, fromAminoMsg(object: GenesisStateAminoMsg): GenesisState { @@ -190,4 +244,6 @@ export const GenesisState = { value: GenesisState.encode(message).finish() }; } -}; \ No newline at end of file +}; +GlobalDecoderRegistry.register(GenesisState.typeUrl, GenesisState); +GlobalDecoderRegistry.registerAminoProtoMapping(GenesisState.aminoType, GenesisState.typeUrl); \ No newline at end of file diff --git a/packages/osmojs/src/codegen/cosmos/gov/v1beta1/gov.ts b/packages/osmojs/src/codegen/cosmos/gov/v1beta1/gov.ts index 80cdae7d6..988766092 100644 --- a/packages/osmojs/src/codegen/cosmos/gov/v1beta1/gov.ts +++ b/packages/osmojs/src/codegen/cosmos/gov/v1beta1/gov.ts @@ -2,9 +2,20 @@ import { Coin, CoinAmino, CoinSDKType } from "../../base/v1beta1/coin"; import { Any, AnyProtoMsg, AnyAmino, AnySDKType } from "../../../google/protobuf/any"; import { Timestamp } from "../../../google/protobuf/timestamp"; import { Duration, DurationAmino, DurationSDKType } from "../../../google/protobuf/duration"; +import { CommunityPoolSpendProposal, CommunityPoolSpendProposalProtoMsg, CommunityPoolSpendProposalSDKType, CommunityPoolSpendProposalWithDeposit, CommunityPoolSpendProposalWithDepositProtoMsg, CommunityPoolSpendProposalWithDepositSDKType } from "../../distribution/v1beta1/distribution"; +import { ParameterChangeProposal, ParameterChangeProposalProtoMsg, ParameterChangeProposalSDKType } from "../../params/v1beta1/params"; +import { SoftwareUpgradeProposal, SoftwareUpgradeProposalProtoMsg, SoftwareUpgradeProposalSDKType, CancelSoftwareUpgradeProposal, CancelSoftwareUpgradeProposalProtoMsg, CancelSoftwareUpgradeProposalSDKType } from "../../upgrade/v1beta1/upgrade"; +import { ClientUpdateProposal, ClientUpdateProposalProtoMsg, ClientUpdateProposalSDKType, UpgradeProposal, UpgradeProposalProtoMsg, UpgradeProposalSDKType } from "../../../ibc/core/client/v1/client"; +import { StoreCodeProposal, StoreCodeProposalProtoMsg, StoreCodeProposalSDKType, InstantiateContractProposal, InstantiateContractProposalProtoMsg, InstantiateContractProposalSDKType, InstantiateContract2Proposal, InstantiateContract2ProposalProtoMsg, InstantiateContract2ProposalSDKType, MigrateContractProposal, MigrateContractProposalProtoMsg, MigrateContractProposalSDKType, SudoContractProposal, SudoContractProposalProtoMsg, SudoContractProposalSDKType, ExecuteContractProposal, ExecuteContractProposalProtoMsg, ExecuteContractProposalSDKType, UpdateAdminProposal, UpdateAdminProposalProtoMsg, UpdateAdminProposalSDKType, ClearAdminProposal, ClearAdminProposalProtoMsg, ClearAdminProposalSDKType, PinCodesProposal, PinCodesProposalProtoMsg, PinCodesProposalSDKType, UnpinCodesProposal, UnpinCodesProposalProtoMsg, UnpinCodesProposalSDKType, UpdateInstantiateConfigProposal, UpdateInstantiateConfigProposalProtoMsg, UpdateInstantiateConfigProposalSDKType, StoreAndInstantiateContractProposal, StoreAndInstantiateContractProposalProtoMsg, StoreAndInstantiateContractProposalSDKType } from "../../../cosmwasm/wasm/v1/proposal_legacy"; +import { ReplaceMigrationRecordsProposal, ReplaceMigrationRecordsProposalProtoMsg, ReplaceMigrationRecordsProposalSDKType, UpdateMigrationRecordsProposal, UpdateMigrationRecordsProposalProtoMsg, UpdateMigrationRecordsProposalSDKType, CreateConcentratedLiquidityPoolsAndLinktoCFMMProposal, CreateConcentratedLiquidityPoolsAndLinktoCFMMProposalProtoMsg, CreateConcentratedLiquidityPoolsAndLinktoCFMMProposalSDKType, SetScalingFactorControllerProposal, SetScalingFactorControllerProposalProtoMsg, SetScalingFactorControllerProposalSDKType } from "../../../osmosis/gamm/v1beta1/gov"; +import { ReplacePoolIncentivesProposal, ReplacePoolIncentivesProposalProtoMsg, ReplacePoolIncentivesProposalSDKType, UpdatePoolIncentivesProposal, UpdatePoolIncentivesProposalProtoMsg, UpdatePoolIncentivesProposalSDKType } from "../../../osmosis/poolincentives/v1beta1/gov"; +import { SetProtoRevEnabledProposal, SetProtoRevEnabledProposalProtoMsg, SetProtoRevEnabledProposalSDKType, SetProtoRevAdminAccountProposal, SetProtoRevAdminAccountProposalProtoMsg, SetProtoRevAdminAccountProposalSDKType } from "../../../osmosis/protorev/v1beta1/gov"; +import { SetSuperfluidAssetsProposal, SetSuperfluidAssetsProposalProtoMsg, SetSuperfluidAssetsProposalSDKType, RemoveSuperfluidAssetsProposal, RemoveSuperfluidAssetsProposalProtoMsg, RemoveSuperfluidAssetsProposalSDKType, UpdateUnpoolWhiteListProposal, UpdateUnpoolWhiteListProposalProtoMsg, UpdateUnpoolWhiteListProposalSDKType } from "../../../osmosis/superfluid/v1beta1/gov"; +import { UpdateFeeTokenProposal, UpdateFeeTokenProposalProtoMsg, UpdateFeeTokenProposalSDKType } from "../../../osmosis/txfees/v1beta1/gov"; +import { isSet, toTimestamp, fromTimestamp, bytesFromBase64, base64FromBytes } from "../../../helpers"; import { BinaryReader, BinaryWriter } from "../../../binary"; import { Decimal } from "@cosmjs/math"; -import { isSet, toTimestamp, fromTimestamp } from "../../../helpers"; +import { GlobalDecoderRegistry } from "../../../registry"; /** VoteOption enumerates the valid vote options for a given governance proposal. */ export enum VoteOption { /** VOTE_OPTION_UNSPECIFIED - VOTE_OPTION_UNSPECIFIED defines a no-op vote option. */ @@ -63,7 +74,7 @@ export function voteOptionToJSON(object: VoteOption): string { } /** ProposalStatus enumerates the valid statuses of a proposal. */ export enum ProposalStatus { - /** PROPOSAL_STATUS_UNSPECIFIED - PROPOSAL_STATUS_UNSPECIFIED defines the default propopsal status. */ + /** PROPOSAL_STATUS_UNSPECIFIED - PROPOSAL_STATUS_UNSPECIFIED defines the default proposal status. */ PROPOSAL_STATUS_UNSPECIFIED = 0, /** * PROPOSAL_STATUS_DEPOSIT_PERIOD - PROPOSAL_STATUS_DEPOSIT_PERIOD defines a proposal status during the deposit @@ -145,7 +156,9 @@ export function proposalStatusToJSON(object: ProposalStatus): string { * Since: cosmos-sdk 0.43 */ export interface WeightedVoteOption { + /** option defines the valid vote options, it must not contain duplicate vote options. */ option: VoteOption; + /** weight is the vote weight associated with the vote option. */ weight: string; } export interface WeightedVoteOptionProtoMsg { @@ -158,8 +171,10 @@ export interface WeightedVoteOptionProtoMsg { * Since: cosmos-sdk 0.43 */ export interface WeightedVoteOptionAmino { - option: VoteOption; - weight: string; + /** option defines the valid vote options, it must not contain duplicate vote options. */ + option?: VoteOption; + /** weight is the vote weight associated with the vote option. */ + weight?: string; } export interface WeightedVoteOptionAminoMsg { type: "cosmos-sdk/WeightedVoteOption"; @@ -179,8 +194,10 @@ export interface WeightedVoteOptionSDKType { * manually updated in case of approval. */ export interface TextProposal { - $typeUrl?: string; + $typeUrl?: "/cosmos.gov.v1beta1.TextProposal"; + /** title of the proposal. */ title: string; + /** description associated with the proposal. */ description: string; } export interface TextProposalProtoMsg { @@ -192,8 +209,10 @@ export interface TextProposalProtoMsg { * manually updated in case of approval. */ export interface TextProposalAmino { - title: string; - description: string; + /** title of the proposal. */ + title?: string; + /** description associated with the proposal. */ + description?: string; } export interface TextProposalAminoMsg { type: "cosmos-sdk/TextProposal"; @@ -204,7 +223,7 @@ export interface TextProposalAminoMsg { * manually updated in case of approval. */ export interface TextProposalSDKType { - $typeUrl?: string; + $typeUrl?: "/cosmos.gov.v1beta1.TextProposal"; title: string; description: string; } @@ -213,8 +232,11 @@ export interface TextProposalSDKType { * proposal. */ export interface Deposit { + /** proposal_id defines the unique id of the proposal. */ proposalId: bigint; + /** depositor defines the deposit addresses from the proposals. */ depositor: string; + /** amount to be deposited by depositor. */ amount: Coin[]; } export interface DepositProtoMsg { @@ -226,8 +248,11 @@ export interface DepositProtoMsg { * proposal. */ export interface DepositAmino { - proposal_id: string; - depositor: string; + /** proposal_id defines the unique id of the proposal. */ + proposal_id?: string; + /** depositor defines the deposit addresses from the proposals. */ + depositor?: string; + /** amount to be deposited by depositor. */ amount: CoinAmino[]; } export interface DepositAminoMsg { @@ -245,36 +270,60 @@ export interface DepositSDKType { } /** Proposal defines the core field members of a governance proposal. */ export interface Proposal { + /** proposal_id defines the unique id of the proposal. */ proposalId: bigint; - content: (TextProposal & Any) | undefined; + /** content is the proposal's content. */ + content?: TextProposal | CommunityPoolSpendProposal | CommunityPoolSpendProposalWithDeposit | ParameterChangeProposal | SoftwareUpgradeProposal | CancelSoftwareUpgradeProposal | ClientUpdateProposal | UpgradeProposal | StoreCodeProposal | InstantiateContractProposal | InstantiateContract2Proposal | MigrateContractProposal | SudoContractProposal | ExecuteContractProposal | UpdateAdminProposal | ClearAdminProposal | PinCodesProposal | UnpinCodesProposal | UpdateInstantiateConfigProposal | StoreAndInstantiateContractProposal | ReplaceMigrationRecordsProposal | UpdateMigrationRecordsProposal | CreateConcentratedLiquidityPoolsAndLinktoCFMMProposal | SetScalingFactorControllerProposal | ReplacePoolIncentivesProposal | UpdatePoolIncentivesProposal | SetProtoRevEnabledProposal | SetProtoRevAdminAccountProposal | SetSuperfluidAssetsProposal | RemoveSuperfluidAssetsProposal | UpdateUnpoolWhiteListProposal | UpdateFeeTokenProposal | Any | undefined; + /** status defines the proposal status. */ status: ProposalStatus; + /** + * final_tally_result is the final tally result of the proposal. When + * querying a proposal via gRPC, this field is not populated until the + * proposal's voting period has ended. + */ finalTallyResult: TallyResult; + /** submit_time is the time of proposal submission. */ submitTime: Date; + /** deposit_end_time is the end time for deposition. */ depositEndTime: Date; + /** total_deposit is the total deposit on the proposal. */ totalDeposit: Coin[]; + /** voting_start_time is the starting time to vote on a proposal. */ votingStartTime: Date; + /** voting_end_time is the end time of voting on a proposal. */ votingEndTime: Date; - isExpedited: boolean; } export interface ProposalProtoMsg { typeUrl: "/cosmos.gov.v1beta1.Proposal"; value: Uint8Array; } export type ProposalEncoded = Omit & { - content?: TextProposalProtoMsg | AnyProtoMsg | undefined; + /** content is the proposal's content. */content?: TextProposalProtoMsg | CommunityPoolSpendProposalProtoMsg | CommunityPoolSpendProposalWithDepositProtoMsg | ParameterChangeProposalProtoMsg | SoftwareUpgradeProposalProtoMsg | CancelSoftwareUpgradeProposalProtoMsg | ClientUpdateProposalProtoMsg | UpgradeProposalProtoMsg | StoreCodeProposalProtoMsg | InstantiateContractProposalProtoMsg | InstantiateContract2ProposalProtoMsg | MigrateContractProposalProtoMsg | SudoContractProposalProtoMsg | ExecuteContractProposalProtoMsg | UpdateAdminProposalProtoMsg | ClearAdminProposalProtoMsg | PinCodesProposalProtoMsg | UnpinCodesProposalProtoMsg | UpdateInstantiateConfigProposalProtoMsg | StoreAndInstantiateContractProposalProtoMsg | ReplaceMigrationRecordsProposalProtoMsg | UpdateMigrationRecordsProposalProtoMsg | CreateConcentratedLiquidityPoolsAndLinktoCFMMProposalProtoMsg | SetScalingFactorControllerProposalProtoMsg | ReplacePoolIncentivesProposalProtoMsg | UpdatePoolIncentivesProposalProtoMsg | SetProtoRevEnabledProposalProtoMsg | SetProtoRevAdminAccountProposalProtoMsg | SetSuperfluidAssetsProposalProtoMsg | RemoveSuperfluidAssetsProposalProtoMsg | UpdateUnpoolWhiteListProposalProtoMsg | UpdateFeeTokenProposalProtoMsg | AnyProtoMsg | undefined; }; /** Proposal defines the core field members of a governance proposal. */ export interface ProposalAmino { - proposal_id: string; + /** proposal_id defines the unique id of the proposal. */ + proposal_id?: string; + /** content is the proposal's content. */ content?: AnyAmino; - status: ProposalStatus; - final_tally_result?: TallyResultAmino; - submit_time?: Date; - deposit_end_time?: Date; + /** status defines the proposal status. */ + status?: ProposalStatus; + /** + * final_tally_result is the final tally result of the proposal. When + * querying a proposal via gRPC, this field is not populated until the + * proposal's voting period has ended. + */ + final_tally_result: TallyResultAmino; + /** submit_time is the time of proposal submission. */ + submit_time: string; + /** deposit_end_time is the end time for deposition. */ + deposit_end_time: string; + /** total_deposit is the total deposit on the proposal. */ total_deposit: CoinAmino[]; - voting_start_time?: Date; - voting_end_time?: Date; - is_expedited: boolean; + /** voting_start_time is the starting time to vote on a proposal. */ + voting_start_time: string; + /** voting_end_time is the end time of voting on a proposal. */ + voting_end_time: string; } export interface ProposalAminoMsg { type: "cosmos-sdk/Proposal"; @@ -283,7 +332,7 @@ export interface ProposalAminoMsg { /** Proposal defines the core field members of a governance proposal. */ export interface ProposalSDKType { proposal_id: bigint; - content: TextProposalSDKType | AnySDKType | undefined; + content?: TextProposalSDKType | CommunityPoolSpendProposalSDKType | CommunityPoolSpendProposalWithDepositSDKType | ParameterChangeProposalSDKType | SoftwareUpgradeProposalSDKType | CancelSoftwareUpgradeProposalSDKType | ClientUpdateProposalSDKType | UpgradeProposalSDKType | StoreCodeProposalSDKType | InstantiateContractProposalSDKType | InstantiateContract2ProposalSDKType | MigrateContractProposalSDKType | SudoContractProposalSDKType | ExecuteContractProposalSDKType | UpdateAdminProposalSDKType | ClearAdminProposalSDKType | PinCodesProposalSDKType | UnpinCodesProposalSDKType | UpdateInstantiateConfigProposalSDKType | StoreAndInstantiateContractProposalSDKType | ReplaceMigrationRecordsProposalSDKType | UpdateMigrationRecordsProposalSDKType | CreateConcentratedLiquidityPoolsAndLinktoCFMMProposalSDKType | SetScalingFactorControllerProposalSDKType | ReplacePoolIncentivesProposalSDKType | UpdatePoolIncentivesProposalSDKType | SetProtoRevEnabledProposalSDKType | SetProtoRevAdminAccountProposalSDKType | SetSuperfluidAssetsProposalSDKType | RemoveSuperfluidAssetsProposalSDKType | UpdateUnpoolWhiteListProposalSDKType | UpdateFeeTokenProposalSDKType | AnySDKType | undefined; status: ProposalStatus; final_tally_result: TallyResultSDKType; submit_time: Date; @@ -291,13 +340,16 @@ export interface ProposalSDKType { total_deposit: CoinSDKType[]; voting_start_time: Date; voting_end_time: Date; - is_expedited: boolean; } /** TallyResult defines a standard tally for a governance proposal. */ export interface TallyResult { + /** yes is the number of yes votes on a proposal. */ yes: string; + /** abstain is the number of abstain votes on a proposal. */ abstain: string; + /** no is the number of no votes on a proposal. */ no: string; + /** no_with_veto is the number of no with veto votes on a proposal. */ noWithVeto: string; } export interface TallyResultProtoMsg { @@ -306,10 +358,14 @@ export interface TallyResultProtoMsg { } /** TallyResult defines a standard tally for a governance proposal. */ export interface TallyResultAmino { - yes: string; - abstain: string; - no: string; - no_with_veto: string; + /** yes is the number of yes votes on a proposal. */ + yes?: string; + /** abstain is the number of abstain votes on a proposal. */ + abstain?: string; + /** no is the number of no votes on a proposal. */ + no?: string; + /** no_with_veto is the number of no with veto votes on a proposal. */ + no_with_veto?: string; } export interface TallyResultAminoMsg { type: "cosmos-sdk/TallyResult"; @@ -327,7 +383,9 @@ export interface TallyResultSDKType { * A Vote consists of a proposal ID, the voter, and the vote option. */ export interface Vote { + /** proposal_id defines the unique id of the proposal. */ proposalId: bigint; + /** voter is the voter address of the proposal. */ voter: string; /** * Deprecated: Prefer to use `options` instead. This field is set in queries @@ -336,7 +394,11 @@ export interface Vote { */ /** @deprecated */ option: VoteOption; - /** Since: cosmos-sdk 0.43 */ + /** + * options is the weighted vote options. + * + * Since: cosmos-sdk 0.43 + */ options: WeightedVoteOption[]; } export interface VoteProtoMsg { @@ -348,16 +410,22 @@ export interface VoteProtoMsg { * A Vote consists of a proposal ID, the voter, and the vote option. */ export interface VoteAmino { + /** proposal_id defines the unique id of the proposal. */ proposal_id: string; - voter: string; + /** voter is the voter address of the proposal. */ + 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 * other cases, this field will default to VOTE_OPTION_UNSPECIFIED. */ /** @deprecated */ - option: VoteOption; - /** Since: cosmos-sdk 0.43 */ + option?: VoteOption; + /** + * options is the weighted vote options. + * + * Since: cosmos-sdk 0.43 + */ options: WeightedVoteOptionAmino[]; } export interface VoteAminoMsg { @@ -381,13 +449,9 @@ export interface DepositParams { minDeposit: Coin[]; /** * Maximum period for Atom holders to deposit on a proposal. Initial value: 2 - * months. + * months. */ maxDepositPeriod: Duration; - /** Minimum expedited deposit for a proposal to enter voting period. */ - minExpeditedDeposit: Coin[]; - /** The ratio representing the proportion of the deposit value that must be paid at proposal submission. */ - minInitialDepositRatio: string; } export interface DepositParamsProtoMsg { typeUrl: "/cosmos.gov.v1beta1.DepositParams"; @@ -396,16 +460,12 @@ export interface DepositParamsProtoMsg { /** DepositParams defines the params for deposits on governance proposals. */ export interface DepositParamsAmino { /** Minimum deposit for a proposal to enter voting period. */ - min_deposit: CoinAmino[]; + min_deposit?: CoinAmino[]; /** * Maximum period for Atom holders to deposit on a proposal. Initial value: 2 - * months. + * months. */ max_deposit_period?: DurationAmino; - /** Minimum expedited deposit for a proposal to enter voting period. */ - min_expedited_deposit: CoinAmino[]; - /** The ratio representing the proportion of the deposit value that must be paid at proposal submission. */ - min_initial_deposit_ratio: string; } export interface DepositParamsAminoMsg { type: "cosmos-sdk/DepositParams"; @@ -415,17 +475,11 @@ export interface DepositParamsAminoMsg { export interface DepositParamsSDKType { min_deposit: CoinSDKType[]; max_deposit_period: DurationSDKType; - min_expedited_deposit: CoinSDKType[]; - min_initial_deposit_ratio: string; } /** VotingParams defines the params for voting on governance proposals. */ export interface VotingParams { - /** voting_period defines the length of the voting period. */ + /** Duration of the voting period. */ votingPeriod: Duration; - /** proposal_voting_periods defines custom voting periods for proposal types. */ - proposalVotingPeriods: ProposalVotingPeriod[]; - /** Length of the expedited voting period. */ - expeditedVotingPeriod: Duration; } export interface VotingParamsProtoMsg { typeUrl: "/cosmos.gov.v1beta1.VotingParams"; @@ -433,12 +487,8 @@ export interface VotingParamsProtoMsg { } /** VotingParams defines the params for voting on governance proposals. */ export interface VotingParamsAmino { - /** voting_period defines the length of the voting period. */ + /** Duration of the voting period. */ voting_period?: DurationAmino; - /** proposal_voting_periods defines custom voting periods for proposal types. */ - proposal_voting_periods: ProposalVotingPeriodAmino[]; - /** Length of the expedited voting period. */ - expedited_voting_period?: DurationAmino; } export interface VotingParamsAminoMsg { type: "cosmos-sdk/VotingParams"; @@ -447,27 +497,21 @@ export interface VotingParamsAminoMsg { /** VotingParams defines the params for voting on governance proposals. */ export interface VotingParamsSDKType { voting_period: DurationSDKType; - proposal_voting_periods: ProposalVotingPeriodSDKType[]; - expedited_voting_period: DurationSDKType; } /** TallyParams defines the params for tallying votes on governance proposals. */ export interface TallyParams { /** * Minimum percentage of total stake needed to vote for a result to be - * considered valid. + * considered valid. */ quorum: Uint8Array; /** Minimum proportion of Yes votes for proposal to pass. Default value: 0.5. */ threshold: Uint8Array; /** * Minimum value of Veto votes to Total votes ratio for proposal to be - * vetoed. Default value: 1/3. + * vetoed. Default value: 1/3. */ vetoThreshold: Uint8Array; - /** Minimum proportion of Yes votes for an expedited proposal to pass. Default value: 0.67. */ - expeditedThreshold: Uint8Array; - /** Minimum proportion of Yes votes for an expedited proposal to reach quorum. Default value: 0.67. */ - expeditedQuorum: Uint8Array; } export interface TallyParamsProtoMsg { typeUrl: "/cosmos.gov.v1beta1.TallyParams"; @@ -477,20 +521,16 @@ export interface TallyParamsProtoMsg { export interface TallyParamsAmino { /** * Minimum percentage of total stake needed to vote for a result to be - * considered valid. + * considered valid. */ - quorum: Uint8Array; + quorum?: string; /** Minimum proportion of Yes votes for proposal to pass. Default value: 0.5. */ - threshold: Uint8Array; + threshold?: string; /** * Minimum value of Veto votes to Total votes ratio for proposal to be - * vetoed. Default value: 1/3. + * vetoed. Default value: 1/3. */ - veto_threshold: Uint8Array; - /** Minimum proportion of Yes votes for an expedited proposal to pass. Default value: 0.67. */ - expedited_threshold: Uint8Array; - /** Minimum proportion of Yes votes for an expedited proposal to reach quorum. Default value: 0.67. */ - expedited_quorum: Uint8Array; + veto_threshold?: string; } export interface TallyParamsAminoMsg { type: "cosmos-sdk/TallyParams"; @@ -501,42 +541,6 @@ export interface TallyParamsSDKType { quorum: Uint8Array; threshold: Uint8Array; veto_threshold: Uint8Array; - expedited_threshold: Uint8Array; - expedited_quorum: Uint8Array; -} -/** - * ProposalVotingPeriod defines custom voting periods for a unique governance - * proposal type. - */ -export interface ProposalVotingPeriod { - /** e.g. "cosmos.params.v1beta1.ParameterChangeProposal" */ - proposalType: string; - votingPeriod: Duration; -} -export interface ProposalVotingPeriodProtoMsg { - typeUrl: "/cosmos.gov.v1beta1.ProposalVotingPeriod"; - value: Uint8Array; -} -/** - * ProposalVotingPeriod defines custom voting periods for a unique governance - * proposal type. - */ -export interface ProposalVotingPeriodAmino { - /** e.g. "cosmos.params.v1beta1.ParameterChangeProposal" */ - proposal_type: string; - voting_period?: DurationAmino; -} -export interface ProposalVotingPeriodAminoMsg { - type: "cosmos-sdk/ProposalVotingPeriod"; - value: ProposalVotingPeriodAmino; -} -/** - * ProposalVotingPeriod defines custom voting periods for a unique governance - * proposal type. - */ -export interface ProposalVotingPeriodSDKType { - proposal_type: string; - voting_period: DurationSDKType; } function createBaseWeightedVoteOption(): WeightedVoteOption { return { @@ -546,6 +550,16 @@ function createBaseWeightedVoteOption(): WeightedVoteOption { } export const WeightedVoteOption = { typeUrl: "/cosmos.gov.v1beta1.WeightedVoteOption", + aminoType: "cosmos-sdk/WeightedVoteOption", + is(o: any): o is WeightedVoteOption { + return o && (o.$typeUrl === WeightedVoteOption.typeUrl || isSet(o.option) && typeof o.weight === "string"); + }, + isSDK(o: any): o is WeightedVoteOptionSDKType { + return o && (o.$typeUrl === WeightedVoteOption.typeUrl || isSet(o.option) && typeof o.weight === "string"); + }, + isAmino(o: any): o is WeightedVoteOptionAmino { + return o && (o.$typeUrl === WeightedVoteOption.typeUrl || isSet(o.option) && typeof o.weight === "string"); + }, encode(message: WeightedVoteOption, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.option !== 0) { writer.uint32(8).int32(message.option); @@ -575,6 +589,18 @@ export const WeightedVoteOption = { } return message; }, + fromJSON(object: any): WeightedVoteOption { + return { + option: isSet(object.option) ? voteOptionFromJSON(object.option) : -1, + 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; + }, fromPartial(object: Partial): WeightedVoteOption { const message = createBaseWeightedVoteOption(); message.option = object.option ?? 0; @@ -582,14 +608,18 @@ export const WeightedVoteOption = { return message; }, fromAmino(object: WeightedVoteOptionAmino): WeightedVoteOption { - return { - option: isSet(object.option) ? voteOptionFromJSON(object.option) : -1, - weight: object.weight - }; + const message = createBaseWeightedVoteOption(); + if (object.option !== undefined && object.option !== null) { + message.option = voteOptionFromJSON(object.option); + } + if (object.weight !== undefined && object.weight !== null) { + message.weight = object.weight; + } + return message; }, toAmino(message: WeightedVoteOption): WeightedVoteOptionAmino { const obj: any = {}; - obj.option = message.option; + obj.option = voteOptionToJSON(message.option); obj.weight = message.weight; return obj; }, @@ -615,6 +645,8 @@ export const WeightedVoteOption = { }; } }; +GlobalDecoderRegistry.register(WeightedVoteOption.typeUrl, WeightedVoteOption); +GlobalDecoderRegistry.registerAminoProtoMapping(WeightedVoteOption.aminoType, WeightedVoteOption.typeUrl); function createBaseTextProposal(): TextProposal { return { $typeUrl: "/cosmos.gov.v1beta1.TextProposal", @@ -624,6 +656,16 @@ function createBaseTextProposal(): TextProposal { } export const TextProposal = { typeUrl: "/cosmos.gov.v1beta1.TextProposal", + aminoType: "cosmos-sdk/TextProposal", + is(o: any): o is TextProposal { + return o && (o.$typeUrl === TextProposal.typeUrl || typeof o.title === "string" && typeof o.description === "string"); + }, + isSDK(o: any): o is TextProposalSDKType { + return o && (o.$typeUrl === TextProposal.typeUrl || typeof o.title === "string" && typeof o.description === "string"); + }, + isAmino(o: any): o is TextProposalAmino { + return o && (o.$typeUrl === TextProposal.typeUrl || typeof o.title === "string" && typeof o.description === "string"); + }, encode(message: TextProposal, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.title !== "") { writer.uint32(10).string(message.title); @@ -653,6 +695,18 @@ export const TextProposal = { } 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; + }, fromPartial(object: Partial): TextProposal { const message = createBaseTextProposal(); message.title = object.title ?? ""; @@ -660,10 +714,14 @@ export const TextProposal = { return message; }, fromAmino(object: TextProposalAmino): TextProposal { - return { - title: object.title, - description: object.description - }; + const message = createBaseTextProposal(); + if (object.title !== undefined && object.title !== null) { + message.title = object.title; + } + if (object.description !== undefined && object.description !== null) { + message.description = object.description; + } + return message; }, toAmino(message: TextProposal): TextProposalAmino { const obj: any = {}; @@ -693,6 +751,8 @@ export const TextProposal = { }; } }; +GlobalDecoderRegistry.register(TextProposal.typeUrl, TextProposal); +GlobalDecoderRegistry.registerAminoProtoMapping(TextProposal.aminoType, TextProposal.typeUrl); function createBaseDeposit(): Deposit { return { proposalId: BigInt(0), @@ -702,6 +762,16 @@ function createBaseDeposit(): Deposit { } export const Deposit = { typeUrl: "/cosmos.gov.v1beta1.Deposit", + aminoType: "cosmos-sdk/Deposit", + is(o: any): o is Deposit { + return o && (o.$typeUrl === Deposit.typeUrl || typeof o.proposalId === "bigint" && typeof o.depositor === "string" && Array.isArray(o.amount) && (!o.amount.length || Coin.is(o.amount[0]))); + }, + isSDK(o: any): o is DepositSDKType { + return o && (o.$typeUrl === Deposit.typeUrl || typeof o.proposal_id === "bigint" && typeof o.depositor === "string" && Array.isArray(o.amount) && (!o.amount.length || Coin.isSDK(o.amount[0]))); + }, + isAmino(o: any): o is DepositAmino { + return o && (o.$typeUrl === Deposit.typeUrl || typeof o.proposal_id === "bigint" && typeof o.depositor === "string" && Array.isArray(o.amount) && (!o.amount.length || Coin.isAmino(o.amount[0]))); + }, encode(message: Deposit, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.proposalId !== BigInt(0)) { writer.uint32(8).uint64(message.proposalId); @@ -737,6 +807,24 @@ export const Deposit = { } return message; }, + fromJSON(object: any): Deposit { + return { + proposalId: isSet(object.proposalId) ? BigInt(object.proposalId.toString()) : BigInt(0), + depositor: isSet(object.depositor) ? String(object.depositor) : "", + 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 || BigInt(0)).toString()); + message.depositor !== undefined && (obj.depositor = message.depositor); + if (message.amount) { + obj.amount = message.amount.map(e => e ? Coin.toJSON(e) : undefined); + } else { + obj.amount = []; + } + return obj; + }, fromPartial(object: Partial): Deposit { const message = createBaseDeposit(); message.proposalId = object.proposalId !== undefined && object.proposalId !== null ? BigInt(object.proposalId.toString()) : BigInt(0); @@ -745,11 +833,15 @@ export const Deposit = { return message; }, fromAmino(object: DepositAmino): Deposit { - return { - proposalId: BigInt(object.proposal_id), - depositor: object.depositor, - amount: Array.isArray(object?.amount) ? object.amount.map((e: any) => Coin.fromAmino(e)) : [] - }; + const message = createBaseDeposit(); + if (object.proposal_id !== undefined && object.proposal_id !== null) { + message.proposalId = BigInt(object.proposal_id); + } + if (object.depositor !== undefined && object.depositor !== null) { + message.depositor = object.depositor; + } + message.amount = object.amount?.map(e => Coin.fromAmino(e)) || []; + return message; }, toAmino(message: Deposit): DepositAmino { const obj: any = {}; @@ -784,28 +876,39 @@ export const Deposit = { }; } }; +GlobalDecoderRegistry.register(Deposit.typeUrl, Deposit); +GlobalDecoderRegistry.registerAminoProtoMapping(Deposit.aminoType, Deposit.typeUrl); function createBaseProposal(): Proposal { return { proposalId: BigInt(0), content: undefined, status: 0, finalTallyResult: TallyResult.fromPartial({}), - submitTime: undefined, - depositEndTime: undefined, + submitTime: new Date(), + depositEndTime: new Date(), totalDeposit: [], - votingStartTime: undefined, - votingEndTime: undefined, - isExpedited: false + votingStartTime: new Date(), + votingEndTime: new Date() }; } export const Proposal = { typeUrl: "/cosmos.gov.v1beta1.Proposal", + aminoType: "cosmos-sdk/Proposal", + is(o: any): o is Proposal { + return o && (o.$typeUrl === Proposal.typeUrl || typeof o.proposalId === "bigint" && isSet(o.status) && TallyResult.is(o.finalTallyResult) && Timestamp.is(o.submitTime) && Timestamp.is(o.depositEndTime) && Array.isArray(o.totalDeposit) && (!o.totalDeposit.length || Coin.is(o.totalDeposit[0])) && Timestamp.is(o.votingStartTime) && Timestamp.is(o.votingEndTime)); + }, + isSDK(o: any): o is ProposalSDKType { + return o && (o.$typeUrl === Proposal.typeUrl || typeof o.proposal_id === "bigint" && isSet(o.status) && TallyResult.isSDK(o.final_tally_result) && Timestamp.isSDK(o.submit_time) && Timestamp.isSDK(o.deposit_end_time) && Array.isArray(o.total_deposit) && (!o.total_deposit.length || Coin.isSDK(o.total_deposit[0])) && Timestamp.isSDK(o.voting_start_time) && Timestamp.isSDK(o.voting_end_time)); + }, + isAmino(o: any): o is ProposalAmino { + return o && (o.$typeUrl === Proposal.typeUrl || typeof o.proposal_id === "bigint" && isSet(o.status) && TallyResult.isAmino(o.final_tally_result) && Timestamp.isAmino(o.submit_time) && Timestamp.isAmino(o.deposit_end_time) && Array.isArray(o.total_deposit) && (!o.total_deposit.length || Coin.isAmino(o.total_deposit[0])) && Timestamp.isAmino(o.voting_start_time) && Timestamp.isAmino(o.voting_end_time)); + }, encode(message: Proposal, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.proposalId !== BigInt(0)) { writer.uint32(8).uint64(message.proposalId); } if (message.content !== undefined) { - Any.encode((message.content as Any), writer.uint32(18).fork()).ldelim(); + Any.encode(GlobalDecoderRegistry.wrapAny(message.content), writer.uint32(18).fork()).ldelim(); } if (message.status !== 0) { writer.uint32(24).int32(message.status); @@ -828,9 +931,6 @@ export const Proposal = { if (message.votingEndTime !== undefined) { Timestamp.encode(toTimestamp(message.votingEndTime), writer.uint32(74).fork()).ldelim(); } - if (message.isExpedited === true) { - writer.uint32(80).bool(message.isExpedited); - } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): Proposal { @@ -844,7 +944,7 @@ export const Proposal = { message.proposalId = reader.uint64(); break; case 2: - message.content = (Content_InterfaceDecoder(reader) as Any); + message.content = GlobalDecoderRegistry.unwrapAny(reader); break; case 3: message.status = (reader.int32() as any); @@ -867,9 +967,6 @@ export const Proposal = { case 9: message.votingEndTime = fromTimestamp(Timestamp.decode(reader, reader.uint32())); break; - case 10: - message.isExpedited = reader.bool(); - break; default: reader.skipType(tag & 7); break; @@ -877,10 +974,40 @@ export const Proposal = { } return message; }, + fromJSON(object: any): Proposal { + return { + proposalId: isSet(object.proposalId) ? BigInt(object.proposalId.toString()) : BigInt(0), + content: isSet(object.content) ? GlobalDecoderRegistry.fromJSON(object.content) : undefined, + status: isSet(object.status) ? proposalStatusFromJSON(object.status) : -1, + finalTallyResult: isSet(object.finalTallyResult) ? TallyResult.fromJSON(object.finalTallyResult) : undefined, + submitTime: isSet(object.submitTime) ? new Date(object.submitTime) : undefined, + depositEndTime: isSet(object.depositEndTime) ? new Date(object.depositEndTime) : undefined, + totalDeposit: Array.isArray(object?.totalDeposit) ? object.totalDeposit.map((e: any) => Coin.fromJSON(e)) : [], + votingStartTime: isSet(object.votingStartTime) ? new Date(object.votingStartTime) : undefined, + votingEndTime: isSet(object.votingEndTime) ? new Date(object.votingEndTime) : undefined + }; + }, + toJSON(message: Proposal): unknown { + const obj: any = {}; + message.proposalId !== undefined && (obj.proposalId = (message.proposalId || BigInt(0)).toString()); + message.content !== undefined && (obj.content = message.content ? GlobalDecoderRegistry.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()); + if (message.totalDeposit) { + obj.totalDeposit = message.totalDeposit.map(e => e ? Coin.toJSON(e) : undefined); + } else { + obj.totalDeposit = []; + } + message.votingStartTime !== undefined && (obj.votingStartTime = message.votingStartTime.toISOString()); + message.votingEndTime !== undefined && (obj.votingEndTime = message.votingEndTime.toISOString()); + return obj; + }, fromPartial(object: Partial): Proposal { const message = createBaseProposal(); message.proposalId = object.proposalId !== undefined && object.proposalId !== null ? BigInt(object.proposalId.toString()) : BigInt(0); - message.content = object.content !== undefined && object.content !== null ? Any.fromPartial(object.content) : undefined; + message.content = object.content !== undefined && object.content !== null ? GlobalDecoderRegistry.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; @@ -888,39 +1015,52 @@ export const Proposal = { message.totalDeposit = object.totalDeposit?.map(e => Coin.fromPartial(e)) || []; message.votingStartTime = object.votingStartTime ?? undefined; message.votingEndTime = object.votingEndTime ?? undefined; - message.isExpedited = object.isExpedited ?? false; return message; }, fromAmino(object: ProposalAmino): Proposal { - return { - proposalId: BigInt(object.proposal_id), - content: object?.content ? Content_FromAmino(object.content) : undefined, - status: isSet(object.status) ? proposalStatusFromJSON(object.status) : -1, - finalTallyResult: object?.final_tally_result ? TallyResult.fromAmino(object.final_tally_result) : undefined, - submitTime: object.submit_time, - depositEndTime: object.deposit_end_time, - totalDeposit: Array.isArray(object?.total_deposit) ? object.total_deposit.map((e: any) => Coin.fromAmino(e)) : [], - votingStartTime: object.voting_start_time, - votingEndTime: object.voting_end_time, - isExpedited: object.is_expedited - }; + const message = createBaseProposal(); + if (object.proposal_id !== undefined && object.proposal_id !== null) { + message.proposalId = BigInt(object.proposal_id); + } + if (object.content !== undefined && object.content !== null) { + message.content = GlobalDecoderRegistry.fromAminoMsg(object.content); + } + if (object.status !== undefined && object.status !== null) { + message.status = proposalStatusFromJSON(object.status); + } + if (object.final_tally_result !== undefined && object.final_tally_result !== null) { + message.finalTallyResult = TallyResult.fromAmino(object.final_tally_result); + } + if (object.submit_time !== undefined && object.submit_time !== null) { + message.submitTime = fromTimestamp(Timestamp.fromAmino(object.submit_time)); + } + if (object.deposit_end_time !== undefined && object.deposit_end_time !== null) { + message.depositEndTime = fromTimestamp(Timestamp.fromAmino(object.deposit_end_time)); + } + message.totalDeposit = object.total_deposit?.map(e => Coin.fromAmino(e)) || []; + if (object.voting_start_time !== undefined && object.voting_start_time !== null) { + message.votingStartTime = fromTimestamp(Timestamp.fromAmino(object.voting_start_time)); + } + if (object.voting_end_time !== undefined && object.voting_end_time !== null) { + message.votingEndTime = fromTimestamp(Timestamp.fromAmino(object.voting_end_time)); + } + return message; }, toAmino(message: Proposal): ProposalAmino { const obj: any = {}; obj.proposal_id = message.proposalId ? message.proposalId.toString() : undefined; - obj.content = message.content ? Content_ToAmino((message.content as Any)) : undefined; - obj.status = message.status; - obj.final_tally_result = message.finalTallyResult ? TallyResult.toAmino(message.finalTallyResult) : undefined; - obj.submit_time = message.submitTime; - obj.deposit_end_time = message.depositEndTime; + obj.content = message.content ? GlobalDecoderRegistry.toAminoMsg(message.content) : undefined; + obj.status = proposalStatusToJSON(message.status); + obj.final_tally_result = message.finalTallyResult ? TallyResult.toAmino(message.finalTallyResult) : TallyResult.fromPartial({}); + obj.submit_time = message.submitTime ? Timestamp.toAmino(toTimestamp(message.submitTime)) : new Date(); + obj.deposit_end_time = message.depositEndTime ? Timestamp.toAmino(toTimestamp(message.depositEndTime)) : new Date(); if (message.totalDeposit) { obj.total_deposit = message.totalDeposit.map(e => e ? Coin.toAmino(e) : undefined); } else { obj.total_deposit = []; } - obj.voting_start_time = message.votingStartTime; - obj.voting_end_time = message.votingEndTime; - obj.is_expedited = message.isExpedited; + obj.voting_start_time = message.votingStartTime ? Timestamp.toAmino(toTimestamp(message.votingStartTime)) : new Date(); + obj.voting_end_time = message.votingEndTime ? Timestamp.toAmino(toTimestamp(message.votingEndTime)) : new Date(); return obj; }, fromAminoMsg(object: ProposalAminoMsg): Proposal { @@ -945,6 +1085,8 @@ export const Proposal = { }; } }; +GlobalDecoderRegistry.register(Proposal.typeUrl, Proposal); +GlobalDecoderRegistry.registerAminoProtoMapping(Proposal.aminoType, Proposal.typeUrl); function createBaseTallyResult(): TallyResult { return { yes: "", @@ -955,6 +1097,16 @@ function createBaseTallyResult(): TallyResult { } export const TallyResult = { typeUrl: "/cosmos.gov.v1beta1.TallyResult", + aminoType: "cosmos-sdk/TallyResult", + is(o: any): o is TallyResult { + return o && (o.$typeUrl === TallyResult.typeUrl || typeof o.yes === "string" && typeof o.abstain === "string" && typeof o.no === "string" && typeof o.noWithVeto === "string"); + }, + isSDK(o: any): o is TallyResultSDKType { + return o && (o.$typeUrl === TallyResult.typeUrl || typeof o.yes === "string" && typeof o.abstain === "string" && typeof o.no === "string" && typeof o.no_with_veto === "string"); + }, + isAmino(o: any): o is TallyResultAmino { + return o && (o.$typeUrl === TallyResult.typeUrl || typeof o.yes === "string" && typeof o.abstain === "string" && typeof o.no === "string" && typeof o.no_with_veto === "string"); + }, encode(message: TallyResult, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.yes !== "") { writer.uint32(10).string(message.yes); @@ -996,6 +1148,22 @@ export const TallyResult = { } return message; }, + fromJSON(object: any): TallyResult { + return { + yes: isSet(object.yes) ? String(object.yes) : "", + 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; + }, fromPartial(object: Partial): TallyResult { const message = createBaseTallyResult(); message.yes = object.yes ?? ""; @@ -1005,12 +1173,20 @@ export const TallyResult = { return message; }, fromAmino(object: TallyResultAmino): TallyResult { - return { - yes: object.yes, - abstain: object.abstain, - no: object.no, - noWithVeto: object.no_with_veto - }; + const message = createBaseTallyResult(); + if (object.yes !== undefined && object.yes !== null) { + message.yes = object.yes; + } + if (object.abstain !== undefined && object.abstain !== null) { + message.abstain = object.abstain; + } + if (object.no !== undefined && object.no !== null) { + message.no = object.no; + } + if (object.no_with_veto !== undefined && object.no_with_veto !== null) { + message.noWithVeto = object.no_with_veto; + } + return message; }, toAmino(message: TallyResult): TallyResultAmino { const obj: any = {}; @@ -1042,6 +1218,8 @@ export const TallyResult = { }; } }; +GlobalDecoderRegistry.register(TallyResult.typeUrl, TallyResult); +GlobalDecoderRegistry.registerAminoProtoMapping(TallyResult.aminoType, TallyResult.typeUrl); function createBaseVote(): Vote { return { proposalId: BigInt(0), @@ -1052,6 +1230,16 @@ function createBaseVote(): Vote { } export const Vote = { typeUrl: "/cosmos.gov.v1beta1.Vote", + aminoType: "cosmos-sdk/Vote", + is(o: any): o is Vote { + return o && (o.$typeUrl === Vote.typeUrl || typeof o.proposalId === "bigint" && typeof o.voter === "string" && isSet(o.option) && Array.isArray(o.options) && (!o.options.length || WeightedVoteOption.is(o.options[0]))); + }, + isSDK(o: any): o is VoteSDKType { + return o && (o.$typeUrl === Vote.typeUrl || typeof o.proposal_id === "bigint" && typeof o.voter === "string" && isSet(o.option) && Array.isArray(o.options) && (!o.options.length || WeightedVoteOption.isSDK(o.options[0]))); + }, + isAmino(o: any): o is VoteAmino { + return o && (o.$typeUrl === Vote.typeUrl || typeof o.proposal_id === "bigint" && typeof o.voter === "string" && isSet(o.option) && Array.isArray(o.options) && (!o.options.length || WeightedVoteOption.isAmino(o.options[0]))); + }, encode(message: Vote, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.proposalId !== BigInt(0)) { writer.uint32(8).uint64(message.proposalId); @@ -1093,6 +1281,26 @@ export const Vote = { } return message; }, + fromJSON(object: any): Vote { + return { + proposalId: isSet(object.proposalId) ? BigInt(object.proposalId.toString()) : BigInt(0), + voter: isSet(object.voter) ? String(object.voter) : "", + option: isSet(object.option) ? voteOptionFromJSON(object.option) : -1, + 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 || BigInt(0)).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); + } else { + obj.options = []; + } + return obj; + }, fromPartial(object: Partial): Vote { const message = createBaseVote(); message.proposalId = object.proposalId !== undefined && object.proposalId !== null ? BigInt(object.proposalId.toString()) : BigInt(0); @@ -1102,18 +1310,24 @@ export const Vote = { return message; }, fromAmino(object: VoteAmino): Vote { - return { - proposalId: BigInt(object.proposal_id), - voter: object.voter, - option: isSet(object.option) ? voteOptionFromJSON(object.option) : -1, - options: Array.isArray(object?.options) ? object.options.map((e: any) => WeightedVoteOption.fromAmino(e)) : [] - }; + const message = createBaseVote(); + if (object.proposal_id !== undefined && object.proposal_id !== null) { + message.proposalId = BigInt(object.proposal_id); + } + if (object.voter !== undefined && object.voter !== null) { + message.voter = object.voter; + } + if (object.option !== undefined && object.option !== null) { + message.option = voteOptionFromJSON(object.option); + } + message.options = object.options?.map(e => WeightedVoteOption.fromAmino(e)) || []; + return message; }, toAmino(message: Vote): VoteAmino { const obj: any = {}; - obj.proposal_id = message.proposalId ? message.proposalId.toString() : undefined; + obj.proposal_id = message.proposalId ? message.proposalId.toString() : "0"; obj.voter = message.voter; - obj.option = message.option; + obj.option = voteOptionToJSON(message.option); if (message.options) { obj.options = message.options.map(e => e ? WeightedVoteOption.toAmino(e) : undefined); } else { @@ -1143,16 +1357,26 @@ export const Vote = { }; } }; +GlobalDecoderRegistry.register(Vote.typeUrl, Vote); +GlobalDecoderRegistry.registerAminoProtoMapping(Vote.aminoType, Vote.typeUrl); function createBaseDepositParams(): DepositParams { return { minDeposit: [], - maxDepositPeriod: undefined, - minExpeditedDeposit: [], - minInitialDepositRatio: "" + maxDepositPeriod: Duration.fromPartial({}) }; } export const DepositParams = { typeUrl: "/cosmos.gov.v1beta1.DepositParams", + aminoType: "cosmos-sdk/DepositParams", + is(o: any): o is DepositParams { + return o && (o.$typeUrl === DepositParams.typeUrl || Array.isArray(o.minDeposit) && (!o.minDeposit.length || Coin.is(o.minDeposit[0])) && Duration.is(o.maxDepositPeriod)); + }, + isSDK(o: any): o is DepositParamsSDKType { + return o && (o.$typeUrl === DepositParams.typeUrl || Array.isArray(o.min_deposit) && (!o.min_deposit.length || Coin.isSDK(o.min_deposit[0])) && Duration.isSDK(o.max_deposit_period)); + }, + isAmino(o: any): o is DepositParamsAmino { + return o && (o.$typeUrl === DepositParams.typeUrl || Array.isArray(o.min_deposit) && (!o.min_deposit.length || Coin.isAmino(o.min_deposit[0])) && Duration.isAmino(o.max_deposit_period)); + }, encode(message: DepositParams, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.minDeposit) { Coin.encode(v!, writer.uint32(10).fork()).ldelim(); @@ -1160,12 +1384,6 @@ export const DepositParams = { if (message.maxDepositPeriod !== undefined) { Duration.encode(message.maxDepositPeriod, writer.uint32(18).fork()).ldelim(); } - for (const v of message.minExpeditedDeposit) { - Coin.encode(v!, writer.uint32(26).fork()).ldelim(); - } - if (message.minInitialDepositRatio !== "") { - writer.uint32(34).string(Decimal.fromUserInput(message.minInitialDepositRatio, 18).atomics); - } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): DepositParams { @@ -1181,12 +1399,6 @@ export const DepositParams = { case 2: message.maxDepositPeriod = Duration.decode(reader, reader.uint32()); break; - case 3: - message.minExpeditedDeposit.push(Coin.decode(reader, reader.uint32())); - break; - case 4: - message.minInitialDepositRatio = Decimal.fromAtomics(reader.string(), 18).toString(); - break; default: reader.skipType(tag & 7); break; @@ -1194,21 +1406,35 @@ export const DepositParams = { } 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 + }; + }, + toJSON(message: DepositParams): unknown { + const obj: any = {}; + if (message.minDeposit) { + obj.minDeposit = message.minDeposit.map(e => e ? Coin.toJSON(e) : undefined); + } else { + obj.minDeposit = []; + } + message.maxDepositPeriod !== undefined && (obj.maxDepositPeriod = message.maxDepositPeriod ? Duration.toJSON(message.maxDepositPeriod) : undefined); + return obj; + }, fromPartial(object: Partial): 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; - message.minExpeditedDeposit = object.minExpeditedDeposit?.map(e => Coin.fromPartial(e)) || []; - message.minInitialDepositRatio = object.minInitialDepositRatio ?? ""; return message; }, fromAmino(object: DepositParamsAmino): DepositParams { - return { - minDeposit: Array.isArray(object?.min_deposit) ? object.min_deposit.map((e: any) => Coin.fromAmino(e)) : [], - maxDepositPeriod: object?.max_deposit_period ? Duration.fromAmino(object.max_deposit_period) : undefined, - minExpeditedDeposit: Array.isArray(object?.min_expedited_deposit) ? object.min_expedited_deposit.map((e: any) => Coin.fromAmino(e)) : [], - minInitialDepositRatio: object.min_initial_deposit_ratio - }; + const message = createBaseDepositParams(); + message.minDeposit = object.min_deposit?.map(e => Coin.fromAmino(e)) || []; + if (object.max_deposit_period !== undefined && object.max_deposit_period !== null) { + message.maxDepositPeriod = Duration.fromAmino(object.max_deposit_period); + } + return message; }, toAmino(message: DepositParams): DepositParamsAmino { const obj: any = {}; @@ -1218,12 +1444,6 @@ export const DepositParams = { obj.min_deposit = []; } obj.max_deposit_period = message.maxDepositPeriod ? Duration.toAmino(message.maxDepositPeriod) : undefined; - if (message.minExpeditedDeposit) { - obj.min_expedited_deposit = message.minExpeditedDeposit.map(e => e ? Coin.toAmino(e) : undefined); - } else { - obj.min_expedited_deposit = []; - } - obj.min_initial_deposit_ratio = message.minInitialDepositRatio; return obj; }, fromAminoMsg(object: DepositParamsAminoMsg): DepositParams { @@ -1248,25 +1468,29 @@ export const DepositParams = { }; } }; +GlobalDecoderRegistry.register(DepositParams.typeUrl, DepositParams); +GlobalDecoderRegistry.registerAminoProtoMapping(DepositParams.aminoType, DepositParams.typeUrl); function createBaseVotingParams(): VotingParams { return { - votingPeriod: undefined, - proposalVotingPeriods: [], - expeditedVotingPeriod: undefined + votingPeriod: Duration.fromPartial({}) }; } export const VotingParams = { typeUrl: "/cosmos.gov.v1beta1.VotingParams", + aminoType: "cosmos-sdk/VotingParams", + is(o: any): o is VotingParams { + return o && (o.$typeUrl === VotingParams.typeUrl || Duration.is(o.votingPeriod)); + }, + isSDK(o: any): o is VotingParamsSDKType { + return o && (o.$typeUrl === VotingParams.typeUrl || Duration.isSDK(o.voting_period)); + }, + isAmino(o: any): o is VotingParamsAmino { + return o && (o.$typeUrl === VotingParams.typeUrl || Duration.isAmino(o.voting_period)); + }, encode(message: VotingParams, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.votingPeriod !== undefined) { Duration.encode(message.votingPeriod, writer.uint32(10).fork()).ldelim(); } - for (const v of message.proposalVotingPeriods) { - ProposalVotingPeriod.encode(v!, writer.uint32(18).fork()).ldelim(); - } - if (message.expeditedVotingPeriod !== undefined) { - Duration.encode(message.expeditedVotingPeriod, writer.uint32(26).fork()).ldelim(); - } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): VotingParams { @@ -1279,12 +1503,6 @@ export const VotingParams = { case 1: message.votingPeriod = Duration.decode(reader, reader.uint32()); break; - case 2: - message.proposalVotingPeriods.push(ProposalVotingPeriod.decode(reader, reader.uint32())); - break; - case 3: - message.expeditedVotingPeriod = Duration.decode(reader, reader.uint32()); - break; default: reader.skipType(tag & 7); break; @@ -1292,29 +1510,31 @@ export const VotingParams = { } return message; }, + fromJSON(object: any): VotingParams { + return { + votingPeriod: isSet(object.votingPeriod) ? Duration.fromJSON(object.votingPeriod) : undefined + }; + }, + toJSON(message: VotingParams): unknown { + const obj: any = {}; + message.votingPeriod !== undefined && (obj.votingPeriod = message.votingPeriod ? Duration.toJSON(message.votingPeriod) : undefined); + return obj; + }, fromPartial(object: Partial): VotingParams { const message = createBaseVotingParams(); message.votingPeriod = object.votingPeriod !== undefined && object.votingPeriod !== null ? Duration.fromPartial(object.votingPeriod) : undefined; - message.proposalVotingPeriods = object.proposalVotingPeriods?.map(e => ProposalVotingPeriod.fromPartial(e)) || []; - message.expeditedVotingPeriod = object.expeditedVotingPeriod !== undefined && object.expeditedVotingPeriod !== null ? Duration.fromPartial(object.expeditedVotingPeriod) : undefined; return message; }, fromAmino(object: VotingParamsAmino): VotingParams { - return { - votingPeriod: object?.voting_period ? Duration.fromAmino(object.voting_period) : undefined, - proposalVotingPeriods: Array.isArray(object?.proposal_voting_periods) ? object.proposal_voting_periods.map((e: any) => ProposalVotingPeriod.fromAmino(e)) : [], - expeditedVotingPeriod: object?.expedited_voting_period ? Duration.fromAmino(object.expedited_voting_period) : undefined - }; + const message = createBaseVotingParams(); + if (object.voting_period !== undefined && object.voting_period !== null) { + message.votingPeriod = Duration.fromAmino(object.voting_period); + } + return message; }, toAmino(message: VotingParams): VotingParamsAmino { const obj: any = {}; obj.voting_period = message.votingPeriod ? Duration.toAmino(message.votingPeriod) : undefined; - if (message.proposalVotingPeriods) { - obj.proposal_voting_periods = message.proposalVotingPeriods.map(e => e ? ProposalVotingPeriod.toAmino(e) : undefined); - } else { - obj.proposal_voting_periods = []; - } - obj.expedited_voting_period = message.expeditedVotingPeriod ? Duration.toAmino(message.expeditedVotingPeriod) : undefined; return obj; }, fromAminoMsg(object: VotingParamsAminoMsg): VotingParams { @@ -1339,17 +1559,27 @@ export const VotingParams = { }; } }; +GlobalDecoderRegistry.register(VotingParams.typeUrl, VotingParams); +GlobalDecoderRegistry.registerAminoProtoMapping(VotingParams.aminoType, VotingParams.typeUrl); function createBaseTallyParams(): TallyParams { return { quorum: new Uint8Array(), threshold: new Uint8Array(), - vetoThreshold: new Uint8Array(), - expeditedThreshold: new Uint8Array(), - expeditedQuorum: new Uint8Array() + vetoThreshold: new Uint8Array() }; } export const TallyParams = { typeUrl: "/cosmos.gov.v1beta1.TallyParams", + aminoType: "cosmos-sdk/TallyParams", + is(o: any): o is TallyParams { + return o && (o.$typeUrl === TallyParams.typeUrl || (o.quorum instanceof Uint8Array || typeof o.quorum === "string") && (o.threshold instanceof Uint8Array || typeof o.threshold === "string") && (o.vetoThreshold instanceof Uint8Array || typeof o.vetoThreshold === "string")); + }, + isSDK(o: any): o is TallyParamsSDKType { + return o && (o.$typeUrl === TallyParams.typeUrl || (o.quorum instanceof Uint8Array || typeof o.quorum === "string") && (o.threshold instanceof Uint8Array || typeof o.threshold === "string") && (o.veto_threshold instanceof Uint8Array || typeof o.veto_threshold === "string")); + }, + isAmino(o: any): o is TallyParamsAmino { + return o && (o.$typeUrl === TallyParams.typeUrl || (o.quorum instanceof Uint8Array || typeof o.quorum === "string") && (o.threshold instanceof Uint8Array || typeof o.threshold === "string") && (o.veto_threshold instanceof Uint8Array || typeof o.veto_threshold === "string")); + }, encode(message: TallyParams, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.quorum.length !== 0) { writer.uint32(10).bytes(message.quorum); @@ -1360,12 +1590,6 @@ export const TallyParams = { if (message.vetoThreshold.length !== 0) { writer.uint32(26).bytes(message.vetoThreshold); } - if (message.expeditedThreshold.length !== 0) { - writer.uint32(34).bytes(message.expeditedThreshold); - } - if (message.expeditedQuorum.length !== 0) { - writer.uint32(42).bytes(message.expeditedQuorum); - } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): TallyParams { @@ -1384,12 +1608,6 @@ export const TallyParams = { case 3: message.vetoThreshold = reader.bytes(); break; - case 4: - message.expeditedThreshold = reader.bytes(); - break; - case 5: - message.expeditedQuorum = reader.bytes(); - break; default: reader.skipType(tag & 7); break; @@ -1397,31 +1615,45 @@ export const TallyParams = { } 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() + }; + }, + toJSON(message: TallyParams): unknown { + const obj: any = {}; + message.quorum !== undefined && (obj.quorum = base64FromBytes(message.quorum !== undefined ? message.quorum : new Uint8Array())); + message.threshold !== undefined && (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; + }, fromPartial(object: Partial): TallyParams { const message = createBaseTallyParams(); message.quorum = object.quorum ?? new Uint8Array(); message.threshold = object.threshold ?? new Uint8Array(); message.vetoThreshold = object.vetoThreshold ?? new Uint8Array(); - message.expeditedThreshold = object.expeditedThreshold ?? new Uint8Array(); - message.expeditedQuorum = object.expeditedQuorum ?? new Uint8Array(); return message; }, fromAmino(object: TallyParamsAmino): TallyParams { - return { - quorum: object.quorum, - threshold: object.threshold, - vetoThreshold: object.veto_threshold, - expeditedThreshold: object.expedited_threshold, - expeditedQuorum: object.expedited_quorum - }; + const message = createBaseTallyParams(); + if (object.quorum !== undefined && object.quorum !== null) { + message.quorum = bytesFromBase64(object.quorum); + } + if (object.threshold !== undefined && object.threshold !== null) { + message.threshold = bytesFromBase64(object.threshold); + } + if (object.veto_threshold !== undefined && object.veto_threshold !== null) { + message.vetoThreshold = bytesFromBase64(object.veto_threshold); + } + return message; }, toAmino(message: TallyParams): TallyParamsAmino { const obj: any = {}; - obj.quorum = message.quorum; - obj.threshold = message.threshold; - obj.veto_threshold = message.vetoThreshold; - obj.expedited_threshold = message.expeditedThreshold; - obj.expedited_quorum = message.expeditedQuorum; + obj.quorum = message.quorum ? base64FromBytes(message.quorum) : undefined; + obj.threshold = message.threshold ? base64FromBytes(message.threshold) : undefined; + obj.veto_threshold = message.vetoThreshold ? base64FromBytes(message.vetoThreshold) : undefined; return obj; }, fromAminoMsg(object: TallyParamsAminoMsg): TallyParams { @@ -1446,112 +1678,5 @@ export const TallyParams = { }; } }; -function createBaseProposalVotingPeriod(): ProposalVotingPeriod { - return { - proposalType: "", - votingPeriod: undefined - }; -} -export const ProposalVotingPeriod = { - typeUrl: "/cosmos.gov.v1beta1.ProposalVotingPeriod", - encode(message: ProposalVotingPeriod, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { - if (message.proposalType !== "") { - writer.uint32(10).string(message.proposalType); - } - if (message.votingPeriod !== undefined) { - Duration.encode(message.votingPeriod, writer.uint32(18).fork()).ldelim(); - } - return writer; - }, - decode(input: BinaryReader | Uint8Array, length?: number): ProposalVotingPeriod { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseProposalVotingPeriod(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.proposalType = reader.string(); - break; - case 2: - message.votingPeriod = Duration.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - fromPartial(object: Partial): ProposalVotingPeriod { - const message = createBaseProposalVotingPeriod(); - message.proposalType = object.proposalType ?? ""; - message.votingPeriod = object.votingPeriod !== undefined && object.votingPeriod !== null ? Duration.fromPartial(object.votingPeriod) : undefined; - return message; - }, - fromAmino(object: ProposalVotingPeriodAmino): ProposalVotingPeriod { - return { - proposalType: object.proposal_type, - votingPeriod: object?.voting_period ? Duration.fromAmino(object.voting_period) : undefined - }; - }, - toAmino(message: ProposalVotingPeriod): ProposalVotingPeriodAmino { - const obj: any = {}; - obj.proposal_type = message.proposalType; - obj.voting_period = message.votingPeriod ? Duration.toAmino(message.votingPeriod) : undefined; - return obj; - }, - fromAminoMsg(object: ProposalVotingPeriodAminoMsg): ProposalVotingPeriod { - return ProposalVotingPeriod.fromAmino(object.value); - }, - toAminoMsg(message: ProposalVotingPeriod): ProposalVotingPeriodAminoMsg { - return { - type: "cosmos-sdk/ProposalVotingPeriod", - value: ProposalVotingPeriod.toAmino(message) - }; - }, - fromProtoMsg(message: ProposalVotingPeriodProtoMsg): ProposalVotingPeriod { - return ProposalVotingPeriod.decode(message.value); - }, - toProto(message: ProposalVotingPeriod): Uint8Array { - return ProposalVotingPeriod.encode(message).finish(); - }, - toProtoMsg(message: ProposalVotingPeriod): ProposalVotingPeriodProtoMsg { - return { - typeUrl: "/cosmos.gov.v1beta1.ProposalVotingPeriod", - value: ProposalVotingPeriod.encode(message).finish() - }; - } -}; -export const Content_InterfaceDecoder = (input: BinaryReader | Uint8Array): TextProposal | Any => { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - const data = Any.decode(reader, reader.uint32()); - switch (data.typeUrl) { - case "/cosmos.gov.v1beta1.TextProposal": - return TextProposal.decode(data.value); - default: - return data; - } -}; -export const Content_FromAmino = (content: AnyAmino) => { - switch (content.type) { - case "cosmos-sdk/TextProposal": - return Any.fromPartial({ - typeUrl: "/cosmos.gov.v1beta1.TextProposal", - value: TextProposal.encode(TextProposal.fromPartial(TextProposal.fromAmino(content.value))).finish() - }); - default: - return Any.fromAmino(content); - } -}; -export const Content_ToAmino = (content: Any) => { - switch (content.typeUrl) { - case "/cosmos.gov.v1beta1.TextProposal": - return { - type: "cosmos-sdk/TextProposal", - value: TextProposal.toAmino(TextProposal.decode(content.value)) - }; - default: - return Any.toAmino(content); - } -}; \ No newline at end of file +GlobalDecoderRegistry.register(TallyParams.typeUrl, TallyParams); +GlobalDecoderRegistry.registerAminoProtoMapping(TallyParams.aminoType, TallyParams.typeUrl); \ No newline at end of file diff --git a/packages/osmojs/src/codegen/cosmos/gov/v1beta1/query.ts b/packages/osmojs/src/codegen/cosmos/gov/v1beta1/query.ts index b747105da..48c59e5b7 100644 --- a/packages/osmojs/src/codegen/cosmos/gov/v1beta1/query.ts +++ b/packages/osmojs/src/codegen/cosmos/gov/v1beta1/query.ts @@ -1,7 +1,8 @@ -import { ProposalStatus, Proposal, ProposalAmino, ProposalSDKType, Vote, VoteAmino, VoteSDKType, VotingParams, VotingParamsAmino, VotingParamsSDKType, DepositParams, DepositParamsAmino, DepositParamsSDKType, TallyParams, TallyParamsAmino, TallyParamsSDKType, Deposit, DepositAmino, DepositSDKType, TallyResult, TallyResultAmino, TallyResultSDKType, proposalStatusFromJSON } from "./gov"; +import { ProposalStatus, Proposal, ProposalAmino, ProposalSDKType, Vote, VoteAmino, VoteSDKType, VotingParams, VotingParamsAmino, VotingParamsSDKType, DepositParams, DepositParamsAmino, DepositParamsSDKType, TallyParams, TallyParamsAmino, TallyParamsSDKType, Deposit, DepositAmino, DepositSDKType, TallyResult, TallyResultAmino, TallyResultSDKType, proposalStatusFromJSON, proposalStatusToJSON } from "./gov"; import { PageRequest, PageRequestAmino, PageRequestSDKType, PageResponse, PageResponseAmino, PageResponseSDKType } from "../../base/query/v1beta1/pagination"; import { BinaryReader, BinaryWriter } from "../../../binary"; import { isSet } from "../../../helpers"; +import { GlobalDecoderRegistry } from "../../../registry"; /** QueryProposalRequest is the request type for the Query/Proposal RPC method. */ export interface QueryProposalRequest { /** proposal_id defines the unique id of the proposal. */ @@ -14,7 +15,7 @@ export interface QueryProposalRequestProtoMsg { /** QueryProposalRequest is the request type for the Query/Proposal RPC method. */ export interface QueryProposalRequestAmino { /** proposal_id defines the unique id of the proposal. */ - proposal_id: string; + proposal_id?: string; } export interface QueryProposalRequestAminoMsg { type: "cosmos-sdk/QueryProposalRequest"; @@ -34,7 +35,7 @@ export interface QueryProposalResponseProtoMsg { } /** QueryProposalResponse is the response type for the Query/Proposal RPC method. */ export interface QueryProposalResponseAmino { - proposal?: ProposalAmino; + proposal: ProposalAmino; } export interface QueryProposalResponseAminoMsg { type: "cosmos-sdk/QueryProposalResponse"; @@ -53,7 +54,7 @@ export interface QueryProposalsRequest { /** depositor defines the deposit addresses from the proposals. */ depositor: string; /** pagination defines an optional pagination for the request. */ - pagination: PageRequest; + pagination?: PageRequest; } export interface QueryProposalsRequestProtoMsg { typeUrl: "/cosmos.gov.v1beta1.QueryProposalsRequest"; @@ -62,11 +63,11 @@ export interface QueryProposalsRequestProtoMsg { /** QueryProposalsRequest is the request type for the Query/Proposals RPC method. */ export interface QueryProposalsRequestAmino { /** proposal_status defines the status of the proposals. */ - proposal_status: ProposalStatus; + proposal_status?: 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?: PageRequestAmino; } @@ -79,16 +80,17 @@ export interface QueryProposalsRequestSDKType { proposal_status: ProposalStatus; voter: string; depositor: string; - pagination: PageRequestSDKType; + pagination?: PageRequestSDKType; } /** * QueryProposalsResponse is the response type for the Query/Proposals RPC * method. */ export interface QueryProposalsResponse { + /** proposals defines all the requested governance proposals. */ proposals: Proposal[]; /** pagination defines the pagination in the response. */ - pagination: PageResponse; + pagination?: PageResponse; } export interface QueryProposalsResponseProtoMsg { typeUrl: "/cosmos.gov.v1beta1.QueryProposalsResponse"; @@ -99,6 +101,7 @@ export interface QueryProposalsResponseProtoMsg { * method. */ export interface QueryProposalsResponseAmino { + /** proposals defines all the requested governance proposals. */ proposals: ProposalAmino[]; /** pagination defines the pagination in the response. */ pagination?: PageResponseAmino; @@ -113,13 +116,13 @@ export interface QueryProposalsResponseAminoMsg { */ export interface QueryProposalsResponseSDKType { proposals: ProposalSDKType[]; - pagination: PageResponseSDKType; + pagination?: PageResponseSDKType; } /** QueryVoteRequest is the request type for the Query/Vote RPC method. */ export interface QueryVoteRequest { /** proposal_id defines the unique id of the proposal. */ proposalId: bigint; - /** voter defines the oter address for the proposals. */ + /** voter defines the voter address for the proposals. */ voter: string; } export interface QueryVoteRequestProtoMsg { @@ -129,9 +132,9 @@ export interface QueryVoteRequestProtoMsg { /** QueryVoteRequest is the request type for the Query/Vote RPC method. */ export interface QueryVoteRequestAmino { /** proposal_id defines the unique id of the proposal. */ - proposal_id: string; - /** voter defines the oter address for the proposals. */ - voter: string; + proposal_id?: string; + /** voter defines the voter address for the proposals. */ + voter?: string; } export interface QueryVoteRequestAminoMsg { type: "cosmos-sdk/QueryVoteRequest"; @@ -144,7 +147,7 @@ export interface QueryVoteRequestSDKType { } /** QueryVoteResponse is the response type for the Query/Vote RPC method. */ export interface QueryVoteResponse { - /** vote defined the queried vote. */ + /** vote defines the queried vote. */ vote: Vote; } export interface QueryVoteResponseProtoMsg { @@ -153,8 +156,8 @@ export interface QueryVoteResponseProtoMsg { } /** QueryVoteResponse is the response type for the Query/Vote RPC method. */ export interface QueryVoteResponseAmino { - /** vote defined the queried vote. */ - vote?: VoteAmino; + /** vote defines the queried vote. */ + vote: VoteAmino; } export interface QueryVoteResponseAminoMsg { type: "cosmos-sdk/QueryVoteResponse"; @@ -169,7 +172,7 @@ export interface QueryVotesRequest { /** proposal_id defines the unique id of the proposal. */ proposalId: bigint; /** pagination defines an optional pagination for the request. */ - pagination: PageRequest; + pagination?: PageRequest; } export interface QueryVotesRequestProtoMsg { typeUrl: "/cosmos.gov.v1beta1.QueryVotesRequest"; @@ -178,7 +181,7 @@ export interface QueryVotesRequestProtoMsg { /** QueryVotesRequest is the request type for the Query/Votes RPC method. */ export interface QueryVotesRequestAmino { /** proposal_id defines the unique id of the proposal. */ - proposal_id: string; + proposal_id?: string; /** pagination defines an optional pagination for the request. */ pagination?: PageRequestAmino; } @@ -189,14 +192,14 @@ export interface QueryVotesRequestAminoMsg { /** QueryVotesRequest is the request type for the Query/Votes RPC method. */ export interface QueryVotesRequestSDKType { proposal_id: bigint; - pagination: PageRequestSDKType; + pagination?: PageRequestSDKType; } /** QueryVotesResponse is the response type for the Query/Votes RPC method. */ export interface QueryVotesResponse { - /** votes defined the queried votes. */ + /** votes defines the queried votes. */ votes: Vote[]; /** pagination defines the pagination in the response. */ - pagination: PageResponse; + pagination?: PageResponse; } export interface QueryVotesResponseProtoMsg { typeUrl: "/cosmos.gov.v1beta1.QueryVotesResponse"; @@ -204,7 +207,7 @@ export interface QueryVotesResponseProtoMsg { } /** QueryVotesResponse is the response type for the Query/Votes RPC method. */ export interface QueryVotesResponseAmino { - /** votes defined the queried votes. */ + /** votes defines the queried votes. */ votes: VoteAmino[]; /** pagination defines the pagination in the response. */ pagination?: PageResponseAmino; @@ -216,7 +219,7 @@ export interface QueryVotesResponseAminoMsg { /** QueryVotesResponse is the response type for the Query/Votes RPC method. */ export interface QueryVotesResponseSDKType { votes: VoteSDKType[]; - pagination: PageResponseSDKType; + pagination?: PageResponseSDKType; } /** QueryParamsRequest is the request type for the Query/Params RPC method. */ export interface QueryParamsRequest { @@ -236,7 +239,7 @@ export interface QueryParamsRequestAmino { * params_type defines which parameters to query for, can be one of "voting", * "tallying" or "deposit". */ - params_type: string; + params_type?: string; } export interface QueryParamsRequestAminoMsg { type: "cosmos-sdk/QueryParamsRequest"; @@ -262,11 +265,11 @@ export interface QueryParamsResponseProtoMsg { /** QueryParamsResponse is the response type for the Query/Params RPC method. */ export interface QueryParamsResponseAmino { /** voting_params defines the parameters related to voting. */ - voting_params?: VotingParamsAmino; + voting_params: VotingParamsAmino; /** deposit_params defines the parameters related to deposit. */ - deposit_params?: DepositParamsAmino; + deposit_params: DepositParamsAmino; /** tally_params defines the parameters related to tally. */ - tally_params?: TallyParamsAmino; + tally_params: TallyParamsAmino; } export interface QueryParamsResponseAminoMsg { type: "cosmos-sdk/QueryParamsResponse"; @@ -292,9 +295,9 @@ export interface QueryDepositRequestProtoMsg { /** QueryDepositRequest is the request type for the Query/Deposit RPC method. */ export interface QueryDepositRequestAmino { /** proposal_id defines the unique id of the proposal. */ - proposal_id: string; + proposal_id?: string; /** depositor defines the deposit addresses from the proposals. */ - depositor: string; + depositor?: string; } export interface QueryDepositRequestAminoMsg { type: "cosmos-sdk/QueryDepositRequest"; @@ -317,7 +320,7 @@ export interface QueryDepositResponseProtoMsg { /** QueryDepositResponse is the response type for the Query/Deposit RPC method. */ export interface QueryDepositResponseAmino { /** deposit defines the requested deposit. */ - deposit?: DepositAmino; + deposit: DepositAmino; } export interface QueryDepositResponseAminoMsg { type: "cosmos-sdk/QueryDepositResponse"; @@ -332,7 +335,7 @@ export interface QueryDepositsRequest { /** proposal_id defines the unique id of the proposal. */ proposalId: bigint; /** pagination defines an optional pagination for the request. */ - pagination: PageRequest; + pagination?: PageRequest; } export interface QueryDepositsRequestProtoMsg { typeUrl: "/cosmos.gov.v1beta1.QueryDepositsRequest"; @@ -341,7 +344,7 @@ export interface QueryDepositsRequestProtoMsg { /** QueryDepositsRequest is the request type for the Query/Deposits RPC method. */ export interface QueryDepositsRequestAmino { /** proposal_id defines the unique id of the proposal. */ - proposal_id: string; + proposal_id?: string; /** pagination defines an optional pagination for the request. */ pagination?: PageRequestAmino; } @@ -352,13 +355,14 @@ export interface QueryDepositsRequestAminoMsg { /** QueryDepositsRequest is the request type for the Query/Deposits RPC method. */ export interface QueryDepositsRequestSDKType { proposal_id: bigint; - pagination: PageRequestSDKType; + pagination?: PageRequestSDKType; } /** QueryDepositsResponse is the response type for the Query/Deposits RPC method. */ export interface QueryDepositsResponse { + /** deposits defines the requested deposits. */ deposits: Deposit[]; /** pagination defines the pagination in the response. */ - pagination: PageResponse; + pagination?: PageResponse; } export interface QueryDepositsResponseProtoMsg { typeUrl: "/cosmos.gov.v1beta1.QueryDepositsResponse"; @@ -366,6 +370,7 @@ export interface QueryDepositsResponseProtoMsg { } /** QueryDepositsResponse is the response type for the Query/Deposits RPC method. */ export interface QueryDepositsResponseAmino { + /** deposits defines the requested deposits. */ deposits: DepositAmino[]; /** pagination defines the pagination in the response. */ pagination?: PageResponseAmino; @@ -377,7 +382,7 @@ export interface QueryDepositsResponseAminoMsg { /** QueryDepositsResponse is the response type for the Query/Deposits RPC method. */ export interface QueryDepositsResponseSDKType { deposits: DepositSDKType[]; - pagination: PageResponseSDKType; + pagination?: PageResponseSDKType; } /** QueryTallyResultRequest is the request type for the Query/Tally RPC method. */ export interface QueryTallyResultRequest { @@ -391,7 +396,7 @@ export interface QueryTallyResultRequestProtoMsg { /** QueryTallyResultRequest is the request type for the Query/Tally RPC method. */ export interface QueryTallyResultRequestAmino { /** proposal_id defines the unique id of the proposal. */ - proposal_id: string; + proposal_id?: string; } export interface QueryTallyResultRequestAminoMsg { type: "cosmos-sdk/QueryTallyResultRequest"; @@ -413,7 +418,7 @@ export interface QueryTallyResultResponseProtoMsg { /** QueryTallyResultResponse is the response type for the Query/Tally RPC method. */ export interface QueryTallyResultResponseAmino { /** tally defines the requested tally. */ - tally?: TallyResultAmino; + tally: TallyResultAmino; } export interface QueryTallyResultResponseAminoMsg { type: "cosmos-sdk/QueryTallyResultResponse"; @@ -430,6 +435,16 @@ function createBaseQueryProposalRequest(): QueryProposalRequest { } export const QueryProposalRequest = { typeUrl: "/cosmos.gov.v1beta1.QueryProposalRequest", + aminoType: "cosmos-sdk/QueryProposalRequest", + is(o: any): o is QueryProposalRequest { + return o && (o.$typeUrl === QueryProposalRequest.typeUrl || typeof o.proposalId === "bigint"); + }, + isSDK(o: any): o is QueryProposalRequestSDKType { + return o && (o.$typeUrl === QueryProposalRequest.typeUrl || typeof o.proposal_id === "bigint"); + }, + isAmino(o: any): o is QueryProposalRequestAmino { + return o && (o.$typeUrl === QueryProposalRequest.typeUrl || typeof o.proposal_id === "bigint"); + }, encode(message: QueryProposalRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.proposalId !== BigInt(0)) { writer.uint32(8).uint64(message.proposalId); @@ -453,15 +468,27 @@ export const QueryProposalRequest = { } return message; }, + fromJSON(object: any): QueryProposalRequest { + return { + proposalId: isSet(object.proposalId) ? BigInt(object.proposalId.toString()) : BigInt(0) + }; + }, + toJSON(message: QueryProposalRequest): unknown { + const obj: any = {}; + message.proposalId !== undefined && (obj.proposalId = (message.proposalId || BigInt(0)).toString()); + return obj; + }, fromPartial(object: Partial): QueryProposalRequest { const message = createBaseQueryProposalRequest(); message.proposalId = object.proposalId !== undefined && object.proposalId !== null ? BigInt(object.proposalId.toString()) : BigInt(0); return message; }, fromAmino(object: QueryProposalRequestAmino): QueryProposalRequest { - return { - proposalId: BigInt(object.proposal_id) - }; + const message = createBaseQueryProposalRequest(); + if (object.proposal_id !== undefined && object.proposal_id !== null) { + message.proposalId = BigInt(object.proposal_id); + } + return message; }, toAmino(message: QueryProposalRequest): QueryProposalRequestAmino { const obj: any = {}; @@ -490,6 +517,8 @@ export const QueryProposalRequest = { }; } }; +GlobalDecoderRegistry.register(QueryProposalRequest.typeUrl, QueryProposalRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryProposalRequest.aminoType, QueryProposalRequest.typeUrl); function createBaseQueryProposalResponse(): QueryProposalResponse { return { proposal: Proposal.fromPartial({}) @@ -497,6 +526,16 @@ function createBaseQueryProposalResponse(): QueryProposalResponse { } export const QueryProposalResponse = { typeUrl: "/cosmos.gov.v1beta1.QueryProposalResponse", + aminoType: "cosmos-sdk/QueryProposalResponse", + is(o: any): o is QueryProposalResponse { + return o && (o.$typeUrl === QueryProposalResponse.typeUrl || Proposal.is(o.proposal)); + }, + isSDK(o: any): o is QueryProposalResponseSDKType { + return o && (o.$typeUrl === QueryProposalResponse.typeUrl || Proposal.isSDK(o.proposal)); + }, + isAmino(o: any): o is QueryProposalResponseAmino { + return o && (o.$typeUrl === QueryProposalResponse.typeUrl || Proposal.isAmino(o.proposal)); + }, encode(message: QueryProposalResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.proposal !== undefined) { Proposal.encode(message.proposal, writer.uint32(10).fork()).ldelim(); @@ -520,19 +559,31 @@ export const QueryProposalResponse = { } return message; }, + fromJSON(object: any): QueryProposalResponse { + 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(object: Partial): QueryProposalResponse { const message = createBaseQueryProposalResponse(); message.proposal = object.proposal !== undefined && object.proposal !== null ? Proposal.fromPartial(object.proposal) : undefined; return message; }, fromAmino(object: QueryProposalResponseAmino): QueryProposalResponse { - return { - proposal: object?.proposal ? Proposal.fromAmino(object.proposal) : undefined - }; + const message = createBaseQueryProposalResponse(); + if (object.proposal !== undefined && object.proposal !== null) { + message.proposal = Proposal.fromAmino(object.proposal); + } + return message; }, toAmino(message: QueryProposalResponse): QueryProposalResponseAmino { const obj: any = {}; - obj.proposal = message.proposal ? Proposal.toAmino(message.proposal) : undefined; + obj.proposal = message.proposal ? Proposal.toAmino(message.proposal) : Proposal.fromPartial({}); return obj; }, fromAminoMsg(object: QueryProposalResponseAminoMsg): QueryProposalResponse { @@ -557,16 +608,28 @@ export const QueryProposalResponse = { }; } }; +GlobalDecoderRegistry.register(QueryProposalResponse.typeUrl, QueryProposalResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryProposalResponse.aminoType, QueryProposalResponse.typeUrl); function createBaseQueryProposalsRequest(): QueryProposalsRequest { return { proposalStatus: 0, voter: "", depositor: "", - pagination: PageRequest.fromPartial({}) + pagination: undefined }; } export const QueryProposalsRequest = { typeUrl: "/cosmos.gov.v1beta1.QueryProposalsRequest", + aminoType: "cosmos-sdk/QueryProposalsRequest", + is(o: any): o is QueryProposalsRequest { + return o && (o.$typeUrl === QueryProposalsRequest.typeUrl || isSet(o.proposalStatus) && typeof o.voter === "string" && typeof o.depositor === "string"); + }, + isSDK(o: any): o is QueryProposalsRequestSDKType { + return o && (o.$typeUrl === QueryProposalsRequest.typeUrl || isSet(o.proposal_status) && typeof o.voter === "string" && typeof o.depositor === "string"); + }, + isAmino(o: any): o is QueryProposalsRequestAmino { + return o && (o.$typeUrl === QueryProposalsRequest.typeUrl || isSet(o.proposal_status) && typeof o.voter === "string" && typeof o.depositor === "string"); + }, encode(message: QueryProposalsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.proposalStatus !== 0) { writer.uint32(8).int32(message.proposalStatus); @@ -608,6 +671,22 @@ export const QueryProposalsRequest = { } return message; }, + fromJSON(object: any): QueryProposalsRequest { + return { + proposalStatus: isSet(object.proposalStatus) ? proposalStatusFromJSON(object.proposalStatus) : -1, + voter: isSet(object.voter) ? String(object.voter) : "", + depositor: isSet(object.depositor) ? String(object.depositor) : "", + 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); + message.pagination !== undefined && (obj.pagination = message.pagination ? PageRequest.toJSON(message.pagination) : undefined); + return obj; + }, fromPartial(object: Partial): QueryProposalsRequest { const message = createBaseQueryProposalsRequest(); message.proposalStatus = object.proposalStatus ?? 0; @@ -617,16 +696,24 @@ export const QueryProposalsRequest = { return message; }, fromAmino(object: QueryProposalsRequestAmino): QueryProposalsRequest { - return { - proposalStatus: isSet(object.proposal_status) ? proposalStatusFromJSON(object.proposal_status) : -1, - voter: object.voter, - depositor: object.depositor, - pagination: object?.pagination ? PageRequest.fromAmino(object.pagination) : undefined - }; + const message = createBaseQueryProposalsRequest(); + if (object.proposal_status !== undefined && object.proposal_status !== null) { + message.proposalStatus = proposalStatusFromJSON(object.proposal_status); + } + if (object.voter !== undefined && object.voter !== null) { + message.voter = object.voter; + } + if (object.depositor !== undefined && object.depositor !== null) { + message.depositor = object.depositor; + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromAmino(object.pagination); + } + return message; }, toAmino(message: QueryProposalsRequest): QueryProposalsRequestAmino { const obj: any = {}; - obj.proposal_status = message.proposalStatus; + obj.proposal_status = proposalStatusToJSON(message.proposalStatus); obj.voter = message.voter; obj.depositor = message.depositor; obj.pagination = message.pagination ? PageRequest.toAmino(message.pagination) : undefined; @@ -654,14 +741,26 @@ export const QueryProposalsRequest = { }; } }; +GlobalDecoderRegistry.register(QueryProposalsRequest.typeUrl, QueryProposalsRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryProposalsRequest.aminoType, QueryProposalsRequest.typeUrl); function createBaseQueryProposalsResponse(): QueryProposalsResponse { return { proposals: [], - pagination: PageResponse.fromPartial({}) + pagination: undefined }; } export const QueryProposalsResponse = { typeUrl: "/cosmos.gov.v1beta1.QueryProposalsResponse", + aminoType: "cosmos-sdk/QueryProposalsResponse", + is(o: any): o is QueryProposalsResponse { + return o && (o.$typeUrl === QueryProposalsResponse.typeUrl || Array.isArray(o.proposals) && (!o.proposals.length || Proposal.is(o.proposals[0]))); + }, + isSDK(o: any): o is QueryProposalsResponseSDKType { + return o && (o.$typeUrl === QueryProposalsResponse.typeUrl || Array.isArray(o.proposals) && (!o.proposals.length || Proposal.isSDK(o.proposals[0]))); + }, + isAmino(o: any): o is QueryProposalsResponseAmino { + return o && (o.$typeUrl === QueryProposalsResponse.typeUrl || Array.isArray(o.proposals) && (!o.proposals.length || Proposal.isAmino(o.proposals[0]))); + }, encode(message: QueryProposalsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.proposals) { Proposal.encode(v!, writer.uint32(10).fork()).ldelim(); @@ -691,6 +790,22 @@ export const QueryProposalsResponse = { } 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 + }; + }, + toJSON(message: QueryProposalsResponse): unknown { + const obj: any = {}; + if (message.proposals) { + obj.proposals = message.proposals.map(e => e ? Proposal.toJSON(e) : undefined); + } else { + obj.proposals = []; + } + message.pagination !== undefined && (obj.pagination = message.pagination ? PageResponse.toJSON(message.pagination) : undefined); + return obj; + }, fromPartial(object: Partial): QueryProposalsResponse { const message = createBaseQueryProposalsResponse(); message.proposals = object.proposals?.map(e => Proposal.fromPartial(e)) || []; @@ -698,10 +813,12 @@ export const QueryProposalsResponse = { return message; }, fromAmino(object: QueryProposalsResponseAmino): QueryProposalsResponse { - return { - proposals: Array.isArray(object?.proposals) ? object.proposals.map((e: any) => Proposal.fromAmino(e)) : [], - pagination: object?.pagination ? PageResponse.fromAmino(object.pagination) : undefined - }; + const message = createBaseQueryProposalsResponse(); + message.proposals = object.proposals?.map(e => Proposal.fromAmino(e)) || []; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromAmino(object.pagination); + } + return message; }, toAmino(message: QueryProposalsResponse): QueryProposalsResponseAmino { const obj: any = {}; @@ -735,6 +852,8 @@ export const QueryProposalsResponse = { }; } }; +GlobalDecoderRegistry.register(QueryProposalsResponse.typeUrl, QueryProposalsResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryProposalsResponse.aminoType, QueryProposalsResponse.typeUrl); function createBaseQueryVoteRequest(): QueryVoteRequest { return { proposalId: BigInt(0), @@ -743,6 +862,16 @@ function createBaseQueryVoteRequest(): QueryVoteRequest { } export const QueryVoteRequest = { typeUrl: "/cosmos.gov.v1beta1.QueryVoteRequest", + aminoType: "cosmos-sdk/QueryVoteRequest", + is(o: any): o is QueryVoteRequest { + return o && (o.$typeUrl === QueryVoteRequest.typeUrl || typeof o.proposalId === "bigint" && typeof o.voter === "string"); + }, + isSDK(o: any): o is QueryVoteRequestSDKType { + return o && (o.$typeUrl === QueryVoteRequest.typeUrl || typeof o.proposal_id === "bigint" && typeof o.voter === "string"); + }, + isAmino(o: any): o is QueryVoteRequestAmino { + return o && (o.$typeUrl === QueryVoteRequest.typeUrl || typeof o.proposal_id === "bigint" && typeof o.voter === "string"); + }, encode(message: QueryVoteRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.proposalId !== BigInt(0)) { writer.uint32(8).uint64(message.proposalId); @@ -772,6 +901,18 @@ export const QueryVoteRequest = { } return message; }, + fromJSON(object: any): QueryVoteRequest { + return { + proposalId: isSet(object.proposalId) ? BigInt(object.proposalId.toString()) : BigInt(0), + voter: isSet(object.voter) ? String(object.voter) : "" + }; + }, + toJSON(message: QueryVoteRequest): unknown { + const obj: any = {}; + message.proposalId !== undefined && (obj.proposalId = (message.proposalId || BigInt(0)).toString()); + message.voter !== undefined && (obj.voter = message.voter); + return obj; + }, fromPartial(object: Partial): QueryVoteRequest { const message = createBaseQueryVoteRequest(); message.proposalId = object.proposalId !== undefined && object.proposalId !== null ? BigInt(object.proposalId.toString()) : BigInt(0); @@ -779,10 +920,14 @@ export const QueryVoteRequest = { return message; }, fromAmino(object: QueryVoteRequestAmino): QueryVoteRequest { - return { - proposalId: BigInt(object.proposal_id), - voter: object.voter - }; + const message = createBaseQueryVoteRequest(); + if (object.proposal_id !== undefined && object.proposal_id !== null) { + message.proposalId = BigInt(object.proposal_id); + } + if (object.voter !== undefined && object.voter !== null) { + message.voter = object.voter; + } + return message; }, toAmino(message: QueryVoteRequest): QueryVoteRequestAmino { const obj: any = {}; @@ -812,6 +957,8 @@ export const QueryVoteRequest = { }; } }; +GlobalDecoderRegistry.register(QueryVoteRequest.typeUrl, QueryVoteRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryVoteRequest.aminoType, QueryVoteRequest.typeUrl); function createBaseQueryVoteResponse(): QueryVoteResponse { return { vote: Vote.fromPartial({}) @@ -819,6 +966,16 @@ function createBaseQueryVoteResponse(): QueryVoteResponse { } export const QueryVoteResponse = { typeUrl: "/cosmos.gov.v1beta1.QueryVoteResponse", + aminoType: "cosmos-sdk/QueryVoteResponse", + is(o: any): o is QueryVoteResponse { + return o && (o.$typeUrl === QueryVoteResponse.typeUrl || Vote.is(o.vote)); + }, + isSDK(o: any): o is QueryVoteResponseSDKType { + return o && (o.$typeUrl === QueryVoteResponse.typeUrl || Vote.isSDK(o.vote)); + }, + isAmino(o: any): o is QueryVoteResponseAmino { + return o && (o.$typeUrl === QueryVoteResponse.typeUrl || Vote.isAmino(o.vote)); + }, encode(message: QueryVoteResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.vote !== undefined) { Vote.encode(message.vote, writer.uint32(10).fork()).ldelim(); @@ -842,19 +999,31 @@ export const QueryVoteResponse = { } return message; }, + fromJSON(object: any): QueryVoteResponse { + 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(object: Partial): QueryVoteResponse { const message = createBaseQueryVoteResponse(); message.vote = object.vote !== undefined && object.vote !== null ? Vote.fromPartial(object.vote) : undefined; return message; }, fromAmino(object: QueryVoteResponseAmino): QueryVoteResponse { - return { - vote: object?.vote ? Vote.fromAmino(object.vote) : undefined - }; + const message = createBaseQueryVoteResponse(); + if (object.vote !== undefined && object.vote !== null) { + message.vote = Vote.fromAmino(object.vote); + } + return message; }, toAmino(message: QueryVoteResponse): QueryVoteResponseAmino { const obj: any = {}; - obj.vote = message.vote ? Vote.toAmino(message.vote) : undefined; + obj.vote = message.vote ? Vote.toAmino(message.vote) : Vote.fromPartial({}); return obj; }, fromAminoMsg(object: QueryVoteResponseAminoMsg): QueryVoteResponse { @@ -879,14 +1048,26 @@ export const QueryVoteResponse = { }; } }; +GlobalDecoderRegistry.register(QueryVoteResponse.typeUrl, QueryVoteResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryVoteResponse.aminoType, QueryVoteResponse.typeUrl); function createBaseQueryVotesRequest(): QueryVotesRequest { return { proposalId: BigInt(0), - pagination: PageRequest.fromPartial({}) + pagination: undefined }; } export const QueryVotesRequest = { typeUrl: "/cosmos.gov.v1beta1.QueryVotesRequest", + aminoType: "cosmos-sdk/QueryVotesRequest", + is(o: any): o is QueryVotesRequest { + return o && (o.$typeUrl === QueryVotesRequest.typeUrl || typeof o.proposalId === "bigint"); + }, + isSDK(o: any): o is QueryVotesRequestSDKType { + return o && (o.$typeUrl === QueryVotesRequest.typeUrl || typeof o.proposal_id === "bigint"); + }, + isAmino(o: any): o is QueryVotesRequestAmino { + return o && (o.$typeUrl === QueryVotesRequest.typeUrl || typeof o.proposal_id === "bigint"); + }, encode(message: QueryVotesRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.proposalId !== BigInt(0)) { writer.uint32(8).uint64(message.proposalId); @@ -916,6 +1097,18 @@ export const QueryVotesRequest = { } return message; }, + fromJSON(object: any): QueryVotesRequest { + return { + proposalId: isSet(object.proposalId) ? BigInt(object.proposalId.toString()) : BigInt(0), + pagination: isSet(object.pagination) ? PageRequest.fromJSON(object.pagination) : undefined + }; + }, + toJSON(message: QueryVotesRequest): unknown { + const obj: any = {}; + message.proposalId !== undefined && (obj.proposalId = (message.proposalId || BigInt(0)).toString()); + message.pagination !== undefined && (obj.pagination = message.pagination ? PageRequest.toJSON(message.pagination) : undefined); + return obj; + }, fromPartial(object: Partial): QueryVotesRequest { const message = createBaseQueryVotesRequest(); message.proposalId = object.proposalId !== undefined && object.proposalId !== null ? BigInt(object.proposalId.toString()) : BigInt(0); @@ -923,10 +1116,14 @@ export const QueryVotesRequest = { return message; }, fromAmino(object: QueryVotesRequestAmino): QueryVotesRequest { - return { - proposalId: BigInt(object.proposal_id), - pagination: object?.pagination ? PageRequest.fromAmino(object.pagination) : undefined - }; + const message = createBaseQueryVotesRequest(); + if (object.proposal_id !== undefined && object.proposal_id !== null) { + message.proposalId = BigInt(object.proposal_id); + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromAmino(object.pagination); + } + return message; }, toAmino(message: QueryVotesRequest): QueryVotesRequestAmino { const obj: any = {}; @@ -956,14 +1153,26 @@ export const QueryVotesRequest = { }; } }; +GlobalDecoderRegistry.register(QueryVotesRequest.typeUrl, QueryVotesRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryVotesRequest.aminoType, QueryVotesRequest.typeUrl); function createBaseQueryVotesResponse(): QueryVotesResponse { return { votes: [], - pagination: PageResponse.fromPartial({}) + pagination: undefined }; } export const QueryVotesResponse = { typeUrl: "/cosmos.gov.v1beta1.QueryVotesResponse", + aminoType: "cosmos-sdk/QueryVotesResponse", + is(o: any): o is QueryVotesResponse { + return o && (o.$typeUrl === QueryVotesResponse.typeUrl || Array.isArray(o.votes) && (!o.votes.length || Vote.is(o.votes[0]))); + }, + isSDK(o: any): o is QueryVotesResponseSDKType { + return o && (o.$typeUrl === QueryVotesResponse.typeUrl || Array.isArray(o.votes) && (!o.votes.length || Vote.isSDK(o.votes[0]))); + }, + isAmino(o: any): o is QueryVotesResponseAmino { + return o && (o.$typeUrl === QueryVotesResponse.typeUrl || Array.isArray(o.votes) && (!o.votes.length || Vote.isAmino(o.votes[0]))); + }, encode(message: QueryVotesResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.votes) { Vote.encode(v!, writer.uint32(10).fork()).ldelim(); @@ -993,6 +1202,22 @@ export const QueryVotesResponse = { } 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 + }; + }, + toJSON(message: QueryVotesResponse): unknown { + const obj: any = {}; + if (message.votes) { + obj.votes = message.votes.map(e => e ? Vote.toJSON(e) : undefined); + } else { + obj.votes = []; + } + message.pagination !== undefined && (obj.pagination = message.pagination ? PageResponse.toJSON(message.pagination) : undefined); + return obj; + }, fromPartial(object: Partial): QueryVotesResponse { const message = createBaseQueryVotesResponse(); message.votes = object.votes?.map(e => Vote.fromPartial(e)) || []; @@ -1000,10 +1225,12 @@ export const QueryVotesResponse = { return message; }, fromAmino(object: QueryVotesResponseAmino): QueryVotesResponse { - return { - votes: Array.isArray(object?.votes) ? object.votes.map((e: any) => Vote.fromAmino(e)) : [], - pagination: object?.pagination ? PageResponse.fromAmino(object.pagination) : undefined - }; + const message = createBaseQueryVotesResponse(); + message.votes = object.votes?.map(e => Vote.fromAmino(e)) || []; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromAmino(object.pagination); + } + return message; }, toAmino(message: QueryVotesResponse): QueryVotesResponseAmino { const obj: any = {}; @@ -1037,6 +1264,8 @@ export const QueryVotesResponse = { }; } }; +GlobalDecoderRegistry.register(QueryVotesResponse.typeUrl, QueryVotesResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryVotesResponse.aminoType, QueryVotesResponse.typeUrl); function createBaseQueryParamsRequest(): QueryParamsRequest { return { paramsType: "" @@ -1044,6 +1273,16 @@ function createBaseQueryParamsRequest(): QueryParamsRequest { } export const QueryParamsRequest = { typeUrl: "/cosmos.gov.v1beta1.QueryParamsRequest", + aminoType: "cosmos-sdk/QueryParamsRequest", + is(o: any): o is QueryParamsRequest { + return o && (o.$typeUrl === QueryParamsRequest.typeUrl || typeof o.paramsType === "string"); + }, + isSDK(o: any): o is QueryParamsRequestSDKType { + return o && (o.$typeUrl === QueryParamsRequest.typeUrl || typeof o.params_type === "string"); + }, + isAmino(o: any): o is QueryParamsRequestAmino { + return o && (o.$typeUrl === QueryParamsRequest.typeUrl || typeof o.params_type === "string"); + }, encode(message: QueryParamsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.paramsType !== "") { writer.uint32(10).string(message.paramsType); @@ -1067,15 +1306,27 @@ export const QueryParamsRequest = { } return message; }, + fromJSON(object: any): QueryParamsRequest { + return { + paramsType: isSet(object.paramsType) ? String(object.paramsType) : "" + }; + }, + toJSON(message: QueryParamsRequest): unknown { + const obj: any = {}; + message.paramsType !== undefined && (obj.paramsType = message.paramsType); + return obj; + }, fromPartial(object: Partial): QueryParamsRequest { const message = createBaseQueryParamsRequest(); message.paramsType = object.paramsType ?? ""; return message; }, fromAmino(object: QueryParamsRequestAmino): QueryParamsRequest { - return { - paramsType: object.params_type - }; + const message = createBaseQueryParamsRequest(); + if (object.params_type !== undefined && object.params_type !== null) { + message.paramsType = object.params_type; + } + return message; }, toAmino(message: QueryParamsRequest): QueryParamsRequestAmino { const obj: any = {}; @@ -1104,6 +1355,8 @@ export const QueryParamsRequest = { }; } }; +GlobalDecoderRegistry.register(QueryParamsRequest.typeUrl, QueryParamsRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryParamsRequest.aminoType, QueryParamsRequest.typeUrl); function createBaseQueryParamsResponse(): QueryParamsResponse { return { votingParams: VotingParams.fromPartial({}), @@ -1113,6 +1366,16 @@ function createBaseQueryParamsResponse(): QueryParamsResponse { } export const QueryParamsResponse = { typeUrl: "/cosmos.gov.v1beta1.QueryParamsResponse", + aminoType: "cosmos-sdk/QueryParamsResponse", + is(o: any): o is QueryParamsResponse { + return o && (o.$typeUrl === QueryParamsResponse.typeUrl || VotingParams.is(o.votingParams) && DepositParams.is(o.depositParams) && TallyParams.is(o.tallyParams)); + }, + isSDK(o: any): o is QueryParamsResponseSDKType { + return o && (o.$typeUrl === QueryParamsResponse.typeUrl || VotingParams.isSDK(o.voting_params) && DepositParams.isSDK(o.deposit_params) && TallyParams.isSDK(o.tally_params)); + }, + isAmino(o: any): o is QueryParamsResponseAmino { + return o && (o.$typeUrl === QueryParamsResponse.typeUrl || VotingParams.isAmino(o.voting_params) && DepositParams.isAmino(o.deposit_params) && TallyParams.isAmino(o.tally_params)); + }, encode(message: QueryParamsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.votingParams !== undefined) { VotingParams.encode(message.votingParams, writer.uint32(10).fork()).ldelim(); @@ -1148,6 +1411,20 @@ export const QueryParamsResponse = { } 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 + }; + }, + toJSON(message: QueryParamsResponse): unknown { + const obj: any = {}; + message.votingParams !== undefined && (obj.votingParams = message.votingParams ? VotingParams.toJSON(message.votingParams) : undefined); + 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(object: Partial): QueryParamsResponse { const message = createBaseQueryParamsResponse(); message.votingParams = object.votingParams !== undefined && object.votingParams !== null ? VotingParams.fromPartial(object.votingParams) : undefined; @@ -1156,17 +1433,23 @@ export const QueryParamsResponse = { return message; }, fromAmino(object: QueryParamsResponseAmino): QueryParamsResponse { - return { - votingParams: object?.voting_params ? VotingParams.fromAmino(object.voting_params) : undefined, - depositParams: object?.deposit_params ? DepositParams.fromAmino(object.deposit_params) : undefined, - tallyParams: object?.tally_params ? TallyParams.fromAmino(object.tally_params) : undefined - }; + const message = createBaseQueryParamsResponse(); + if (object.voting_params !== undefined && object.voting_params !== null) { + message.votingParams = VotingParams.fromAmino(object.voting_params); + } + if (object.deposit_params !== undefined && object.deposit_params !== null) { + message.depositParams = DepositParams.fromAmino(object.deposit_params); + } + if (object.tally_params !== undefined && object.tally_params !== null) { + message.tallyParams = TallyParams.fromAmino(object.tally_params); + } + return message; }, toAmino(message: QueryParamsResponse): QueryParamsResponseAmino { const obj: any = {}; - obj.voting_params = message.votingParams ? VotingParams.toAmino(message.votingParams) : undefined; - obj.deposit_params = message.depositParams ? DepositParams.toAmino(message.depositParams) : undefined; - obj.tally_params = message.tallyParams ? TallyParams.toAmino(message.tallyParams) : undefined; + obj.voting_params = message.votingParams ? VotingParams.toAmino(message.votingParams) : VotingParams.fromPartial({}); + obj.deposit_params = message.depositParams ? DepositParams.toAmino(message.depositParams) : DepositParams.fromPartial({}); + obj.tally_params = message.tallyParams ? TallyParams.toAmino(message.tallyParams) : TallyParams.fromPartial({}); return obj; }, fromAminoMsg(object: QueryParamsResponseAminoMsg): QueryParamsResponse { @@ -1191,6 +1474,8 @@ export const QueryParamsResponse = { }; } }; +GlobalDecoderRegistry.register(QueryParamsResponse.typeUrl, QueryParamsResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryParamsResponse.aminoType, QueryParamsResponse.typeUrl); function createBaseQueryDepositRequest(): QueryDepositRequest { return { proposalId: BigInt(0), @@ -1199,6 +1484,16 @@ function createBaseQueryDepositRequest(): QueryDepositRequest { } export const QueryDepositRequest = { typeUrl: "/cosmos.gov.v1beta1.QueryDepositRequest", + aminoType: "cosmos-sdk/QueryDepositRequest", + is(o: any): o is QueryDepositRequest { + return o && (o.$typeUrl === QueryDepositRequest.typeUrl || typeof o.proposalId === "bigint" && typeof o.depositor === "string"); + }, + isSDK(o: any): o is QueryDepositRequestSDKType { + return o && (o.$typeUrl === QueryDepositRequest.typeUrl || typeof o.proposal_id === "bigint" && typeof o.depositor === "string"); + }, + isAmino(o: any): o is QueryDepositRequestAmino { + return o && (o.$typeUrl === QueryDepositRequest.typeUrl || typeof o.proposal_id === "bigint" && typeof o.depositor === "string"); + }, encode(message: QueryDepositRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.proposalId !== BigInt(0)) { writer.uint32(8).uint64(message.proposalId); @@ -1228,6 +1523,18 @@ export const QueryDepositRequest = { } return message; }, + fromJSON(object: any): QueryDepositRequest { + return { + proposalId: isSet(object.proposalId) ? BigInt(object.proposalId.toString()) : BigInt(0), + depositor: isSet(object.depositor) ? String(object.depositor) : "" + }; + }, + toJSON(message: QueryDepositRequest): unknown { + const obj: any = {}; + message.proposalId !== undefined && (obj.proposalId = (message.proposalId || BigInt(0)).toString()); + message.depositor !== undefined && (obj.depositor = message.depositor); + return obj; + }, fromPartial(object: Partial): QueryDepositRequest { const message = createBaseQueryDepositRequest(); message.proposalId = object.proposalId !== undefined && object.proposalId !== null ? BigInt(object.proposalId.toString()) : BigInt(0); @@ -1235,10 +1542,14 @@ export const QueryDepositRequest = { return message; }, fromAmino(object: QueryDepositRequestAmino): QueryDepositRequest { - return { - proposalId: BigInt(object.proposal_id), - depositor: object.depositor - }; + const message = createBaseQueryDepositRequest(); + if (object.proposal_id !== undefined && object.proposal_id !== null) { + message.proposalId = BigInt(object.proposal_id); + } + if (object.depositor !== undefined && object.depositor !== null) { + message.depositor = object.depositor; + } + return message; }, toAmino(message: QueryDepositRequest): QueryDepositRequestAmino { const obj: any = {}; @@ -1268,6 +1579,8 @@ export const QueryDepositRequest = { }; } }; +GlobalDecoderRegistry.register(QueryDepositRequest.typeUrl, QueryDepositRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryDepositRequest.aminoType, QueryDepositRequest.typeUrl); function createBaseQueryDepositResponse(): QueryDepositResponse { return { deposit: Deposit.fromPartial({}) @@ -1275,6 +1588,16 @@ function createBaseQueryDepositResponse(): QueryDepositResponse { } export const QueryDepositResponse = { typeUrl: "/cosmos.gov.v1beta1.QueryDepositResponse", + aminoType: "cosmos-sdk/QueryDepositResponse", + is(o: any): o is QueryDepositResponse { + return o && (o.$typeUrl === QueryDepositResponse.typeUrl || Deposit.is(o.deposit)); + }, + isSDK(o: any): o is QueryDepositResponseSDKType { + return o && (o.$typeUrl === QueryDepositResponse.typeUrl || Deposit.isSDK(o.deposit)); + }, + isAmino(o: any): o is QueryDepositResponseAmino { + return o && (o.$typeUrl === QueryDepositResponse.typeUrl || Deposit.isAmino(o.deposit)); + }, encode(message: QueryDepositResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.deposit !== undefined) { Deposit.encode(message.deposit, writer.uint32(10).fork()).ldelim(); @@ -1298,19 +1621,31 @@ export const QueryDepositResponse = { } return message; }, + fromJSON(object: any): QueryDepositResponse { + 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; + }, fromPartial(object: Partial): QueryDepositResponse { const message = createBaseQueryDepositResponse(); message.deposit = object.deposit !== undefined && object.deposit !== null ? Deposit.fromPartial(object.deposit) : undefined; return message; }, fromAmino(object: QueryDepositResponseAmino): QueryDepositResponse { - return { - deposit: object?.deposit ? Deposit.fromAmino(object.deposit) : undefined - }; + const message = createBaseQueryDepositResponse(); + if (object.deposit !== undefined && object.deposit !== null) { + message.deposit = Deposit.fromAmino(object.deposit); + } + return message; }, toAmino(message: QueryDepositResponse): QueryDepositResponseAmino { const obj: any = {}; - obj.deposit = message.deposit ? Deposit.toAmino(message.deposit) : undefined; + obj.deposit = message.deposit ? Deposit.toAmino(message.deposit) : Deposit.fromPartial({}); return obj; }, fromAminoMsg(object: QueryDepositResponseAminoMsg): QueryDepositResponse { @@ -1335,14 +1670,26 @@ export const QueryDepositResponse = { }; } }; +GlobalDecoderRegistry.register(QueryDepositResponse.typeUrl, QueryDepositResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryDepositResponse.aminoType, QueryDepositResponse.typeUrl); function createBaseQueryDepositsRequest(): QueryDepositsRequest { return { proposalId: BigInt(0), - pagination: PageRequest.fromPartial({}) + pagination: undefined }; } export const QueryDepositsRequest = { typeUrl: "/cosmos.gov.v1beta1.QueryDepositsRequest", + aminoType: "cosmos-sdk/QueryDepositsRequest", + is(o: any): o is QueryDepositsRequest { + return o && (o.$typeUrl === QueryDepositsRequest.typeUrl || typeof o.proposalId === "bigint"); + }, + isSDK(o: any): o is QueryDepositsRequestSDKType { + return o && (o.$typeUrl === QueryDepositsRequest.typeUrl || typeof o.proposal_id === "bigint"); + }, + isAmino(o: any): o is QueryDepositsRequestAmino { + return o && (o.$typeUrl === QueryDepositsRequest.typeUrl || typeof o.proposal_id === "bigint"); + }, encode(message: QueryDepositsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.proposalId !== BigInt(0)) { writer.uint32(8).uint64(message.proposalId); @@ -1372,6 +1719,18 @@ export const QueryDepositsRequest = { } return message; }, + fromJSON(object: any): QueryDepositsRequest { + return { + proposalId: isSet(object.proposalId) ? BigInt(object.proposalId.toString()) : BigInt(0), + pagination: isSet(object.pagination) ? PageRequest.fromJSON(object.pagination) : undefined + }; + }, + toJSON(message: QueryDepositsRequest): unknown { + const obj: any = {}; + message.proposalId !== undefined && (obj.proposalId = (message.proposalId || BigInt(0)).toString()); + message.pagination !== undefined && (obj.pagination = message.pagination ? PageRequest.toJSON(message.pagination) : undefined); + return obj; + }, fromPartial(object: Partial): QueryDepositsRequest { const message = createBaseQueryDepositsRequest(); message.proposalId = object.proposalId !== undefined && object.proposalId !== null ? BigInt(object.proposalId.toString()) : BigInt(0); @@ -1379,10 +1738,14 @@ export const QueryDepositsRequest = { return message; }, fromAmino(object: QueryDepositsRequestAmino): QueryDepositsRequest { - return { - proposalId: BigInt(object.proposal_id), - pagination: object?.pagination ? PageRequest.fromAmino(object.pagination) : undefined - }; + const message = createBaseQueryDepositsRequest(); + if (object.proposal_id !== undefined && object.proposal_id !== null) { + message.proposalId = BigInt(object.proposal_id); + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromAmino(object.pagination); + } + return message; }, toAmino(message: QueryDepositsRequest): QueryDepositsRequestAmino { const obj: any = {}; @@ -1412,14 +1775,26 @@ export const QueryDepositsRequest = { }; } }; +GlobalDecoderRegistry.register(QueryDepositsRequest.typeUrl, QueryDepositsRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryDepositsRequest.aminoType, QueryDepositsRequest.typeUrl); function createBaseQueryDepositsResponse(): QueryDepositsResponse { return { deposits: [], - pagination: PageResponse.fromPartial({}) + pagination: undefined }; } export const QueryDepositsResponse = { typeUrl: "/cosmos.gov.v1beta1.QueryDepositsResponse", + aminoType: "cosmos-sdk/QueryDepositsResponse", + is(o: any): o is QueryDepositsResponse { + return o && (o.$typeUrl === QueryDepositsResponse.typeUrl || Array.isArray(o.deposits) && (!o.deposits.length || Deposit.is(o.deposits[0]))); + }, + isSDK(o: any): o is QueryDepositsResponseSDKType { + return o && (o.$typeUrl === QueryDepositsResponse.typeUrl || Array.isArray(o.deposits) && (!o.deposits.length || Deposit.isSDK(o.deposits[0]))); + }, + isAmino(o: any): o is QueryDepositsResponseAmino { + return o && (o.$typeUrl === QueryDepositsResponse.typeUrl || Array.isArray(o.deposits) && (!o.deposits.length || Deposit.isAmino(o.deposits[0]))); + }, encode(message: QueryDepositsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.deposits) { Deposit.encode(v!, writer.uint32(10).fork()).ldelim(); @@ -1449,6 +1824,22 @@ export const QueryDepositsResponse = { } 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 + }; + }, + toJSON(message: QueryDepositsResponse): unknown { + const obj: any = {}; + if (message.deposits) { + obj.deposits = message.deposits.map(e => e ? Deposit.toJSON(e) : undefined); + } else { + obj.deposits = []; + } + message.pagination !== undefined && (obj.pagination = message.pagination ? PageResponse.toJSON(message.pagination) : undefined); + return obj; + }, fromPartial(object: Partial): QueryDepositsResponse { const message = createBaseQueryDepositsResponse(); message.deposits = object.deposits?.map(e => Deposit.fromPartial(e)) || []; @@ -1456,10 +1847,12 @@ export const QueryDepositsResponse = { return message; }, fromAmino(object: QueryDepositsResponseAmino): QueryDepositsResponse { - return { - deposits: Array.isArray(object?.deposits) ? object.deposits.map((e: any) => Deposit.fromAmino(e)) : [], - pagination: object?.pagination ? PageResponse.fromAmino(object.pagination) : undefined - }; + const message = createBaseQueryDepositsResponse(); + message.deposits = object.deposits?.map(e => Deposit.fromAmino(e)) || []; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromAmino(object.pagination); + } + return message; }, toAmino(message: QueryDepositsResponse): QueryDepositsResponseAmino { const obj: any = {}; @@ -1493,6 +1886,8 @@ export const QueryDepositsResponse = { }; } }; +GlobalDecoderRegistry.register(QueryDepositsResponse.typeUrl, QueryDepositsResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryDepositsResponse.aminoType, QueryDepositsResponse.typeUrl); function createBaseQueryTallyResultRequest(): QueryTallyResultRequest { return { proposalId: BigInt(0) @@ -1500,6 +1895,16 @@ function createBaseQueryTallyResultRequest(): QueryTallyResultRequest { } export const QueryTallyResultRequest = { typeUrl: "/cosmos.gov.v1beta1.QueryTallyResultRequest", + aminoType: "cosmos-sdk/QueryTallyResultRequest", + is(o: any): o is QueryTallyResultRequest { + return o && (o.$typeUrl === QueryTallyResultRequest.typeUrl || typeof o.proposalId === "bigint"); + }, + isSDK(o: any): o is QueryTallyResultRequestSDKType { + return o && (o.$typeUrl === QueryTallyResultRequest.typeUrl || typeof o.proposal_id === "bigint"); + }, + isAmino(o: any): o is QueryTallyResultRequestAmino { + return o && (o.$typeUrl === QueryTallyResultRequest.typeUrl || typeof o.proposal_id === "bigint"); + }, encode(message: QueryTallyResultRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.proposalId !== BigInt(0)) { writer.uint32(8).uint64(message.proposalId); @@ -1523,15 +1928,27 @@ export const QueryTallyResultRequest = { } return message; }, + fromJSON(object: any): QueryTallyResultRequest { + return { + proposalId: isSet(object.proposalId) ? BigInt(object.proposalId.toString()) : BigInt(0) + }; + }, + toJSON(message: QueryTallyResultRequest): unknown { + const obj: any = {}; + message.proposalId !== undefined && (obj.proposalId = (message.proposalId || BigInt(0)).toString()); + return obj; + }, fromPartial(object: Partial): QueryTallyResultRequest { const message = createBaseQueryTallyResultRequest(); message.proposalId = object.proposalId !== undefined && object.proposalId !== null ? BigInt(object.proposalId.toString()) : BigInt(0); return message; }, fromAmino(object: QueryTallyResultRequestAmino): QueryTallyResultRequest { - return { - proposalId: BigInt(object.proposal_id) - }; + const message = createBaseQueryTallyResultRequest(); + if (object.proposal_id !== undefined && object.proposal_id !== null) { + message.proposalId = BigInt(object.proposal_id); + } + return message; }, toAmino(message: QueryTallyResultRequest): QueryTallyResultRequestAmino { const obj: any = {}; @@ -1560,6 +1977,8 @@ export const QueryTallyResultRequest = { }; } }; +GlobalDecoderRegistry.register(QueryTallyResultRequest.typeUrl, QueryTallyResultRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryTallyResultRequest.aminoType, QueryTallyResultRequest.typeUrl); function createBaseQueryTallyResultResponse(): QueryTallyResultResponse { return { tally: TallyResult.fromPartial({}) @@ -1567,6 +1986,16 @@ function createBaseQueryTallyResultResponse(): QueryTallyResultResponse { } export const QueryTallyResultResponse = { typeUrl: "/cosmos.gov.v1beta1.QueryTallyResultResponse", + aminoType: "cosmos-sdk/QueryTallyResultResponse", + is(o: any): o is QueryTallyResultResponse { + return o && (o.$typeUrl === QueryTallyResultResponse.typeUrl || TallyResult.is(o.tally)); + }, + isSDK(o: any): o is QueryTallyResultResponseSDKType { + return o && (o.$typeUrl === QueryTallyResultResponse.typeUrl || TallyResult.isSDK(o.tally)); + }, + isAmino(o: any): o is QueryTallyResultResponseAmino { + return o && (o.$typeUrl === QueryTallyResultResponse.typeUrl || TallyResult.isAmino(o.tally)); + }, encode(message: QueryTallyResultResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.tally !== undefined) { TallyResult.encode(message.tally, writer.uint32(10).fork()).ldelim(); @@ -1590,19 +2019,31 @@ export const QueryTallyResultResponse = { } return message; }, + fromJSON(object: any): QueryTallyResultResponse { + 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; + }, fromPartial(object: Partial): QueryTallyResultResponse { const message = createBaseQueryTallyResultResponse(); message.tally = object.tally !== undefined && object.tally !== null ? TallyResult.fromPartial(object.tally) : undefined; return message; }, fromAmino(object: QueryTallyResultResponseAmino): QueryTallyResultResponse { - return { - tally: object?.tally ? TallyResult.fromAmino(object.tally) : undefined - }; + const message = createBaseQueryTallyResultResponse(); + if (object.tally !== undefined && object.tally !== null) { + message.tally = TallyResult.fromAmino(object.tally); + } + return message; }, toAmino(message: QueryTallyResultResponse): QueryTallyResultResponseAmino { const obj: any = {}; - obj.tally = message.tally ? TallyResult.toAmino(message.tally) : undefined; + obj.tally = message.tally ? TallyResult.toAmino(message.tally) : TallyResult.fromPartial({}); return obj; }, fromAminoMsg(object: QueryTallyResultResponseAminoMsg): QueryTallyResultResponse { @@ -1626,4 +2067,6 @@ export const QueryTallyResultResponse = { value: QueryTallyResultResponse.encode(message).finish() }; } -}; \ No newline at end of file +}; +GlobalDecoderRegistry.register(QueryTallyResultResponse.typeUrl, QueryTallyResultResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryTallyResultResponse.aminoType, QueryTallyResultResponse.typeUrl); \ No newline at end of file diff --git a/packages/osmojs/src/codegen/cosmos/gov/v1beta1/tx.amino.ts b/packages/osmojs/src/codegen/cosmos/gov/v1beta1/tx.amino.ts index d90c3806a..933c1663d 100644 --- a/packages/osmojs/src/codegen/cosmos/gov/v1beta1/tx.amino.ts +++ b/packages/osmojs/src/codegen/cosmos/gov/v1beta1/tx.amino.ts @@ -2,22 +2,22 @@ import { MsgSubmitProposal, MsgVote, MsgVoteWeighted, MsgDeposit } from "./tx"; export const AminoConverter = { "/cosmos.gov.v1beta1.MsgSubmitProposal": { - aminoType: "cosmos-sdk/v1/MsgSubmitProposal", + aminoType: "cosmos-sdk/MsgSubmitProposal", toAmino: MsgSubmitProposal.toAmino, fromAmino: MsgSubmitProposal.fromAmino }, "/cosmos.gov.v1beta1.MsgVote": { - aminoType: "cosmos-sdk/v1/MsgVote", + aminoType: "cosmos-sdk/MsgVote", toAmino: MsgVote.toAmino, fromAmino: MsgVote.fromAmino }, "/cosmos.gov.v1beta1.MsgVoteWeighted": { - aminoType: "cosmos-sdk/v1/MsgVoteWeighted", + aminoType: "cosmos-sdk/MsgVoteWeighted", toAmino: MsgVoteWeighted.toAmino, fromAmino: MsgVoteWeighted.fromAmino }, "/cosmos.gov.v1beta1.MsgDeposit": { - aminoType: "cosmos-sdk/v1/MsgDeposit", + aminoType: "cosmos-sdk/MsgDeposit", toAmino: MsgDeposit.toAmino, fromAmino: MsgDeposit.fromAmino } diff --git a/packages/osmojs/src/codegen/cosmos/gov/v1beta1/tx.registry.ts b/packages/osmojs/src/codegen/cosmos/gov/v1beta1/tx.registry.ts index 604c0b300..6b9b28075 100644 --- a/packages/osmojs/src/codegen/cosmos/gov/v1beta1/tx.registry.ts +++ b/packages/osmojs/src/codegen/cosmos/gov/v1beta1/tx.registry.ts @@ -60,6 +60,58 @@ export const MessageComposer = { }; } }, + toJSON: { + submitProposal(value: MsgSubmitProposal) { + return { + typeUrl: "/cosmos.gov.v1beta1.MsgSubmitProposal", + value: MsgSubmitProposal.toJSON(value) + }; + }, + vote(value: MsgVote) { + return { + typeUrl: "/cosmos.gov.v1beta1.MsgVote", + value: MsgVote.toJSON(value) + }; + }, + voteWeighted(value: MsgVoteWeighted) { + return { + typeUrl: "/cosmos.gov.v1beta1.MsgVoteWeighted", + value: MsgVoteWeighted.toJSON(value) + }; + }, + deposit(value: MsgDeposit) { + return { + typeUrl: "/cosmos.gov.v1beta1.MsgDeposit", + value: MsgDeposit.toJSON(value) + }; + } + }, + fromJSON: { + submitProposal(value: any) { + return { + typeUrl: "/cosmos.gov.v1beta1.MsgSubmitProposal", + value: MsgSubmitProposal.fromJSON(value) + }; + }, + vote(value: any) { + return { + typeUrl: "/cosmos.gov.v1beta1.MsgVote", + value: MsgVote.fromJSON(value) + }; + }, + voteWeighted(value: any) { + return { + typeUrl: "/cosmos.gov.v1beta1.MsgVoteWeighted", + value: MsgVoteWeighted.fromJSON(value) + }; + }, + deposit(value: any) { + return { + typeUrl: "/cosmos.gov.v1beta1.MsgDeposit", + value: MsgDeposit.fromJSON(value) + }; + } + }, fromPartial: { submitProposal(value: MsgSubmitProposal) { return { diff --git a/packages/osmojs/src/codegen/cosmos/gov/v1beta1/tx.rpc.msg.ts b/packages/osmojs/src/codegen/cosmos/gov/v1beta1/tx.rpc.msg.ts index 929828839..4f5ea29e8 100644 --- a/packages/osmojs/src/codegen/cosmos/gov/v1beta1/tx.rpc.msg.ts +++ b/packages/osmojs/src/codegen/cosmos/gov/v1beta1/tx.rpc.msg.ts @@ -45,4 +45,7 @@ export class MsgClientImpl implements Msg { const promise = this.rpc.request("cosmos.gov.v1beta1.Msg", "Deposit", data); return promise.then(data => MsgDepositResponse.decode(new BinaryReader(data))); } -} \ No newline at end of file +} +export const createClientImpl = (rpc: Rpc) => { + return new MsgClientImpl(rpc); +}; \ No newline at end of file diff --git a/packages/osmojs/src/codegen/cosmos/gov/v1beta1/tx.ts b/packages/osmojs/src/codegen/cosmos/gov/v1beta1/tx.ts index 581a05e73..f4198ca64 100644 --- a/packages/osmojs/src/codegen/cosmos/gov/v1beta1/tx.ts +++ b/packages/osmojs/src/codegen/cosmos/gov/v1beta1/tx.ts @@ -1,37 +1,52 @@ import { Any, AnyProtoMsg, AnyAmino, AnySDKType } from "../../../google/protobuf/any"; import { Coin, CoinAmino, CoinSDKType } from "../../base/v1beta1/coin"; -import { VoteOption, WeightedVoteOption, WeightedVoteOptionAmino, WeightedVoteOptionSDKType, TextProposal, TextProposalProtoMsg, TextProposalSDKType, voteOptionFromJSON } from "./gov"; +import { VoteOption, WeightedVoteOption, WeightedVoteOptionAmino, WeightedVoteOptionSDKType, TextProposal, TextProposalProtoMsg, TextProposalSDKType, voteOptionFromJSON, voteOptionToJSON } from "./gov"; +import { CommunityPoolSpendProposal, CommunityPoolSpendProposalProtoMsg, CommunityPoolSpendProposalSDKType, CommunityPoolSpendProposalWithDeposit, CommunityPoolSpendProposalWithDepositProtoMsg, CommunityPoolSpendProposalWithDepositSDKType } from "../../distribution/v1beta1/distribution"; +import { ParameterChangeProposal, ParameterChangeProposalProtoMsg, ParameterChangeProposalSDKType } from "../../params/v1beta1/params"; +import { SoftwareUpgradeProposal, SoftwareUpgradeProposalProtoMsg, SoftwareUpgradeProposalSDKType, CancelSoftwareUpgradeProposal, CancelSoftwareUpgradeProposalProtoMsg, CancelSoftwareUpgradeProposalSDKType } from "../../upgrade/v1beta1/upgrade"; +import { ClientUpdateProposal, ClientUpdateProposalProtoMsg, ClientUpdateProposalSDKType, UpgradeProposal, UpgradeProposalProtoMsg, UpgradeProposalSDKType } from "../../../ibc/core/client/v1/client"; +import { StoreCodeProposal, StoreCodeProposalProtoMsg, StoreCodeProposalSDKType, InstantiateContractProposal, InstantiateContractProposalProtoMsg, InstantiateContractProposalSDKType, InstantiateContract2Proposal, InstantiateContract2ProposalProtoMsg, InstantiateContract2ProposalSDKType, MigrateContractProposal, MigrateContractProposalProtoMsg, MigrateContractProposalSDKType, SudoContractProposal, SudoContractProposalProtoMsg, SudoContractProposalSDKType, ExecuteContractProposal, ExecuteContractProposalProtoMsg, ExecuteContractProposalSDKType, UpdateAdminProposal, UpdateAdminProposalProtoMsg, UpdateAdminProposalSDKType, ClearAdminProposal, ClearAdminProposalProtoMsg, ClearAdminProposalSDKType, PinCodesProposal, PinCodesProposalProtoMsg, PinCodesProposalSDKType, UnpinCodesProposal, UnpinCodesProposalProtoMsg, UnpinCodesProposalSDKType, UpdateInstantiateConfigProposal, UpdateInstantiateConfigProposalProtoMsg, UpdateInstantiateConfigProposalSDKType, StoreAndInstantiateContractProposal, StoreAndInstantiateContractProposalProtoMsg, StoreAndInstantiateContractProposalSDKType } from "../../../cosmwasm/wasm/v1/proposal_legacy"; +import { ReplaceMigrationRecordsProposal, ReplaceMigrationRecordsProposalProtoMsg, ReplaceMigrationRecordsProposalSDKType, UpdateMigrationRecordsProposal, UpdateMigrationRecordsProposalProtoMsg, UpdateMigrationRecordsProposalSDKType, CreateConcentratedLiquidityPoolsAndLinktoCFMMProposal, CreateConcentratedLiquidityPoolsAndLinktoCFMMProposalProtoMsg, CreateConcentratedLiquidityPoolsAndLinktoCFMMProposalSDKType, SetScalingFactorControllerProposal, SetScalingFactorControllerProposalProtoMsg, SetScalingFactorControllerProposalSDKType } from "../../../osmosis/gamm/v1beta1/gov"; +import { ReplacePoolIncentivesProposal, ReplacePoolIncentivesProposalProtoMsg, ReplacePoolIncentivesProposalSDKType, UpdatePoolIncentivesProposal, UpdatePoolIncentivesProposalProtoMsg, UpdatePoolIncentivesProposalSDKType } from "../../../osmosis/poolincentives/v1beta1/gov"; +import { SetProtoRevEnabledProposal, SetProtoRevEnabledProposalProtoMsg, SetProtoRevEnabledProposalSDKType, SetProtoRevAdminAccountProposal, SetProtoRevAdminAccountProposalProtoMsg, SetProtoRevAdminAccountProposalSDKType } from "../../../osmosis/protorev/v1beta1/gov"; +import { SetSuperfluidAssetsProposal, SetSuperfluidAssetsProposalProtoMsg, SetSuperfluidAssetsProposalSDKType, RemoveSuperfluidAssetsProposal, RemoveSuperfluidAssetsProposalProtoMsg, RemoveSuperfluidAssetsProposalSDKType, UpdateUnpoolWhiteListProposal, UpdateUnpoolWhiteListProposalProtoMsg, UpdateUnpoolWhiteListProposalSDKType } from "../../../osmosis/superfluid/v1beta1/gov"; +import { UpdateFeeTokenProposal, UpdateFeeTokenProposalProtoMsg, UpdateFeeTokenProposalSDKType } from "../../../osmosis/txfees/v1beta1/gov"; import { BinaryReader, BinaryWriter } from "../../../binary"; import { isSet } from "../../../helpers"; +import { GlobalDecoderRegistry } from "../../../registry"; /** * MsgSubmitProposal defines an sdk.Msg type that supports submitting arbitrary * proposal Content. */ export interface MsgSubmitProposal { - content: (TextProposal & Any) | undefined; + /** content is the proposal's content. */ + content?: CommunityPoolSpendProposal | CommunityPoolSpendProposalWithDeposit | TextProposal | ParameterChangeProposal | SoftwareUpgradeProposal | CancelSoftwareUpgradeProposal | ClientUpdateProposal | UpgradeProposal | StoreCodeProposal | InstantiateContractProposal | InstantiateContract2Proposal | MigrateContractProposal | SudoContractProposal | ExecuteContractProposal | UpdateAdminProposal | ClearAdminProposal | PinCodesProposal | UnpinCodesProposal | UpdateInstantiateConfigProposal | StoreAndInstantiateContractProposal | ReplaceMigrationRecordsProposal | UpdateMigrationRecordsProposal | CreateConcentratedLiquidityPoolsAndLinktoCFMMProposal | SetScalingFactorControllerProposal | ReplacePoolIncentivesProposal | UpdatePoolIncentivesProposal | SetProtoRevEnabledProposal | SetProtoRevAdminAccountProposal | SetSuperfluidAssetsProposal | RemoveSuperfluidAssetsProposal | UpdateUnpoolWhiteListProposal | UpdateFeeTokenProposal | Any | undefined; + /** initial_deposit is the deposit value that must be paid at proposal submission. */ initialDeposit: Coin[]; + /** proposer is the account address of the proposer. */ proposer: string; - isExpedited: boolean; } export interface MsgSubmitProposalProtoMsg { typeUrl: "/cosmos.gov.v1beta1.MsgSubmitProposal"; value: Uint8Array; } export type MsgSubmitProposalEncoded = Omit & { - content?: TextProposalProtoMsg | AnyProtoMsg | undefined; + /** content is the proposal's content. */content?: CommunityPoolSpendProposalProtoMsg | CommunityPoolSpendProposalWithDepositProtoMsg | TextProposalProtoMsg | ParameterChangeProposalProtoMsg | SoftwareUpgradeProposalProtoMsg | CancelSoftwareUpgradeProposalProtoMsg | ClientUpdateProposalProtoMsg | UpgradeProposalProtoMsg | StoreCodeProposalProtoMsg | InstantiateContractProposalProtoMsg | InstantiateContract2ProposalProtoMsg | MigrateContractProposalProtoMsg | SudoContractProposalProtoMsg | ExecuteContractProposalProtoMsg | UpdateAdminProposalProtoMsg | ClearAdminProposalProtoMsg | PinCodesProposalProtoMsg | UnpinCodesProposalProtoMsg | UpdateInstantiateConfigProposalProtoMsg | StoreAndInstantiateContractProposalProtoMsg | ReplaceMigrationRecordsProposalProtoMsg | UpdateMigrationRecordsProposalProtoMsg | CreateConcentratedLiquidityPoolsAndLinktoCFMMProposalProtoMsg | SetScalingFactorControllerProposalProtoMsg | ReplacePoolIncentivesProposalProtoMsg | UpdatePoolIncentivesProposalProtoMsg | SetProtoRevEnabledProposalProtoMsg | SetProtoRevAdminAccountProposalProtoMsg | SetSuperfluidAssetsProposalProtoMsg | RemoveSuperfluidAssetsProposalProtoMsg | UpdateUnpoolWhiteListProposalProtoMsg | UpdateFeeTokenProposalProtoMsg | AnyProtoMsg | undefined; }; /** * MsgSubmitProposal defines an sdk.Msg type that supports submitting arbitrary * proposal Content. */ export interface MsgSubmitProposalAmino { + /** content is the proposal's content. */ content?: AnyAmino; + /** initial_deposit is the deposit value that must be paid at proposal submission. */ initial_deposit: CoinAmino[]; - proposer: string; - is_expedited: boolean; + /** proposer is the account address of the proposer. */ + proposer?: string; } export interface MsgSubmitProposalAminoMsg { - type: "cosmos-sdk/v1/MsgSubmitProposal"; + type: "cosmos-sdk/MsgSubmitProposal"; value: MsgSubmitProposalAmino; } /** @@ -39,13 +54,13 @@ export interface MsgSubmitProposalAminoMsg { * proposal Content. */ export interface MsgSubmitProposalSDKType { - content: TextProposalSDKType | AnySDKType | undefined; + content?: CommunityPoolSpendProposalSDKType | CommunityPoolSpendProposalWithDepositSDKType | TextProposalSDKType | ParameterChangeProposalSDKType | SoftwareUpgradeProposalSDKType | CancelSoftwareUpgradeProposalSDKType | ClientUpdateProposalSDKType | UpgradeProposalSDKType | StoreCodeProposalSDKType | InstantiateContractProposalSDKType | InstantiateContract2ProposalSDKType | MigrateContractProposalSDKType | SudoContractProposalSDKType | ExecuteContractProposalSDKType | UpdateAdminProposalSDKType | ClearAdminProposalSDKType | PinCodesProposalSDKType | UnpinCodesProposalSDKType | UpdateInstantiateConfigProposalSDKType | StoreAndInstantiateContractProposalSDKType | ReplaceMigrationRecordsProposalSDKType | UpdateMigrationRecordsProposalSDKType | CreateConcentratedLiquidityPoolsAndLinktoCFMMProposalSDKType | SetScalingFactorControllerProposalSDKType | ReplacePoolIncentivesProposalSDKType | UpdatePoolIncentivesProposalSDKType | SetProtoRevEnabledProposalSDKType | SetProtoRevAdminAccountProposalSDKType | SetSuperfluidAssetsProposalSDKType | RemoveSuperfluidAssetsProposalSDKType | UpdateUnpoolWhiteListProposalSDKType | UpdateFeeTokenProposalSDKType | AnySDKType | undefined; initial_deposit: CoinSDKType[]; proposer: string; - is_expedited: boolean; } /** MsgSubmitProposalResponse defines the Msg/SubmitProposal response type. */ export interface MsgSubmitProposalResponse { + /** proposal_id defines the unique id of the proposal. */ proposalId: bigint; } export interface MsgSubmitProposalResponseProtoMsg { @@ -54,6 +69,7 @@ export interface MsgSubmitProposalResponseProtoMsg { } /** MsgSubmitProposalResponse defines the Msg/SubmitProposal response type. */ export interface MsgSubmitProposalResponseAmino { + /** proposal_id defines the unique id of the proposal. */ proposal_id: string; } export interface MsgSubmitProposalResponseAminoMsg { @@ -66,8 +82,11 @@ export interface MsgSubmitProposalResponseSDKType { } /** MsgVote defines a message to cast a vote. */ export interface MsgVote { + /** proposal_id defines the unique id of the proposal. */ proposalId: bigint; + /** voter is the voter address for the proposal. */ voter: string; + /** option defines the vote option. */ option: VoteOption; } export interface MsgVoteProtoMsg { @@ -76,12 +95,15 @@ export interface MsgVoteProtoMsg { } /** MsgVote defines a message to cast a vote. */ export interface MsgVoteAmino { - proposal_id: string; - voter: string; - option: VoteOption; + /** proposal_id defines the unique id of the proposal. */ + proposal_id?: string; + /** voter is the voter address for the proposal. */ + voter?: string; + /** option defines the vote option. */ + option?: VoteOption; } export interface MsgVoteAminoMsg { - type: "cosmos-sdk/v1/MsgVote"; + type: "cosmos-sdk/MsgVote"; value: MsgVoteAmino; } /** MsgVote defines a message to cast a vote. */ @@ -110,8 +132,11 @@ export interface MsgVoteResponseSDKType {} * Since: cosmos-sdk 0.43 */ export interface MsgVoteWeighted { + /** proposal_id defines the unique id of the proposal. */ proposalId: bigint; + /** voter is the voter address for the proposal. */ voter: string; + /** options defines the weighted vote options. */ options: WeightedVoteOption[]; } export interface MsgVoteWeightedProtoMsg { @@ -124,12 +149,15 @@ export interface MsgVoteWeightedProtoMsg { * Since: cosmos-sdk 0.43 */ export interface MsgVoteWeightedAmino { + /** proposal_id defines the unique id of the proposal. */ proposal_id: string; - voter: string; + /** voter is the voter address for the proposal. */ + voter?: string; + /** options defines the weighted vote options. */ options: WeightedVoteOptionAmino[]; } export interface MsgVoteWeightedAminoMsg { - type: "cosmos-sdk/v1/MsgVoteWeighted"; + type: "cosmos-sdk/MsgVoteWeighted"; value: MsgVoteWeightedAmino; } /** @@ -170,8 +198,11 @@ export interface MsgVoteWeightedResponseAminoMsg { export interface MsgVoteWeightedResponseSDKType {} /** MsgDeposit defines a message to submit a deposit to an existing proposal. */ export interface MsgDeposit { + /** proposal_id defines the unique id of the proposal. */ proposalId: bigint; + /** depositor defines the deposit addresses from the proposals. */ depositor: string; + /** amount to be deposited by depositor. */ amount: Coin[]; } export interface MsgDepositProtoMsg { @@ -180,12 +211,15 @@ export interface MsgDepositProtoMsg { } /** MsgDeposit defines a message to submit a deposit to an existing proposal. */ export interface MsgDepositAmino { + /** proposal_id defines the unique id of the proposal. */ proposal_id: string; - depositor: string; + /** depositor defines the deposit addresses from the proposals. */ + depositor?: string; + /** amount to be deposited by depositor. */ amount: CoinAmino[]; } export interface MsgDepositAminoMsg { - type: "cosmos-sdk/v1/MsgDeposit"; + type: "cosmos-sdk/MsgDeposit"; value: MsgDepositAmino; } /** MsgDeposit defines a message to submit a deposit to an existing proposal. */ @@ -212,15 +246,24 @@ function createBaseMsgSubmitProposal(): MsgSubmitProposal { return { content: undefined, initialDeposit: [], - proposer: "", - isExpedited: false + proposer: "" }; } export const MsgSubmitProposal = { typeUrl: "/cosmos.gov.v1beta1.MsgSubmitProposal", + aminoType: "cosmos-sdk/MsgSubmitProposal", + is(o: any): o is MsgSubmitProposal { + return o && (o.$typeUrl === MsgSubmitProposal.typeUrl || Array.isArray(o.initialDeposit) && (!o.initialDeposit.length || Coin.is(o.initialDeposit[0])) && typeof o.proposer === "string"); + }, + isSDK(o: any): o is MsgSubmitProposalSDKType { + return o && (o.$typeUrl === MsgSubmitProposal.typeUrl || Array.isArray(o.initial_deposit) && (!o.initial_deposit.length || Coin.isSDK(o.initial_deposit[0])) && typeof o.proposer === "string"); + }, + isAmino(o: any): o is MsgSubmitProposalAmino { + return o && (o.$typeUrl === MsgSubmitProposal.typeUrl || Array.isArray(o.initial_deposit) && (!o.initial_deposit.length || Coin.isAmino(o.initial_deposit[0])) && typeof o.proposer === "string"); + }, encode(message: MsgSubmitProposal, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.content !== undefined) { - Any.encode((message.content as Any), writer.uint32(10).fork()).ldelim(); + Any.encode(GlobalDecoderRegistry.wrapAny(message.content), writer.uint32(10).fork()).ldelim(); } for (const v of message.initialDeposit) { Coin.encode(v!, writer.uint32(18).fork()).ldelim(); @@ -228,9 +271,6 @@ export const MsgSubmitProposal = { if (message.proposer !== "") { writer.uint32(26).string(message.proposer); } - if (message.isExpedited === true) { - writer.uint32(32).bool(message.isExpedited); - } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): MsgSubmitProposal { @@ -241,7 +281,7 @@ export const MsgSubmitProposal = { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.content = (Content_InterfaceDecoder(reader) as Any); + message.content = GlobalDecoderRegistry.unwrapAny(reader); break; case 2: message.initialDeposit.push(Coin.decode(reader, reader.uint32())); @@ -249,9 +289,6 @@ export const MsgSubmitProposal = { case 3: message.proposer = reader.string(); break; - case 4: - message.isExpedited = reader.bool(); - break; default: reader.skipType(tag & 7); break; @@ -259,32 +296,51 @@ export const MsgSubmitProposal = { } return message; }, + fromJSON(object: any): MsgSubmitProposal { + return { + content: isSet(object.content) ? GlobalDecoderRegistry.fromJSON(object.content) : undefined, + initialDeposit: Array.isArray(object?.initialDeposit) ? 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 ? GlobalDecoderRegistry.toJSON(message.content) : undefined); + if (message.initialDeposit) { + obj.initialDeposit = message.initialDeposit.map(e => e ? Coin.toJSON(e) : undefined); + } else { + obj.initialDeposit = []; + } + message.proposer !== undefined && (obj.proposer = message.proposer); + return obj; + }, fromPartial(object: Partial): MsgSubmitProposal { const message = createBaseMsgSubmitProposal(); - message.content = object.content !== undefined && object.content !== null ? Any.fromPartial(object.content) : undefined; + message.content = object.content !== undefined && object.content !== null ? GlobalDecoderRegistry.fromPartial(object.content) : undefined; message.initialDeposit = object.initialDeposit?.map(e => Coin.fromPartial(e)) || []; message.proposer = object.proposer ?? ""; - message.isExpedited = object.isExpedited ?? false; return message; }, fromAmino(object: MsgSubmitProposalAmino): MsgSubmitProposal { - return { - content: object?.content ? Content_FromAmino(object.content) : undefined, - initialDeposit: Array.isArray(object?.initial_deposit) ? object.initial_deposit.map((e: any) => Coin.fromAmino(e)) : [], - proposer: object.proposer, - isExpedited: object.is_expedited - }; + const message = createBaseMsgSubmitProposal(); + if (object.content !== undefined && object.content !== null) { + message.content = GlobalDecoderRegistry.fromAminoMsg(object.content); + } + message.initialDeposit = object.initial_deposit?.map(e => Coin.fromAmino(e)) || []; + if (object.proposer !== undefined && object.proposer !== null) { + message.proposer = object.proposer; + } + return message; }, toAmino(message: MsgSubmitProposal): MsgSubmitProposalAmino { const obj: any = {}; - obj.content = message.content ? Content_ToAmino((message.content as Any)) : undefined; + obj.content = message.content ? GlobalDecoderRegistry.toAminoMsg(message.content) : undefined; if (message.initialDeposit) { obj.initial_deposit = message.initialDeposit.map(e => e ? Coin.toAmino(e) : undefined); } else { obj.initial_deposit = []; } obj.proposer = message.proposer; - obj.is_expedited = message.isExpedited; return obj; }, fromAminoMsg(object: MsgSubmitProposalAminoMsg): MsgSubmitProposal { @@ -292,7 +348,7 @@ export const MsgSubmitProposal = { }, toAminoMsg(message: MsgSubmitProposal): MsgSubmitProposalAminoMsg { return { - type: "cosmos-sdk/v1/MsgSubmitProposal", + type: "cosmos-sdk/MsgSubmitProposal", value: MsgSubmitProposal.toAmino(message) }; }, @@ -309,6 +365,8 @@ export const MsgSubmitProposal = { }; } }; +GlobalDecoderRegistry.register(MsgSubmitProposal.typeUrl, MsgSubmitProposal); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgSubmitProposal.aminoType, MsgSubmitProposal.typeUrl); function createBaseMsgSubmitProposalResponse(): MsgSubmitProposalResponse { return { proposalId: BigInt(0) @@ -316,6 +374,16 @@ function createBaseMsgSubmitProposalResponse(): MsgSubmitProposalResponse { } export const MsgSubmitProposalResponse = { typeUrl: "/cosmos.gov.v1beta1.MsgSubmitProposalResponse", + aminoType: "cosmos-sdk/MsgSubmitProposalResponse", + is(o: any): o is MsgSubmitProposalResponse { + return o && (o.$typeUrl === MsgSubmitProposalResponse.typeUrl || typeof o.proposalId === "bigint"); + }, + isSDK(o: any): o is MsgSubmitProposalResponseSDKType { + return o && (o.$typeUrl === MsgSubmitProposalResponse.typeUrl || typeof o.proposal_id === "bigint"); + }, + isAmino(o: any): o is MsgSubmitProposalResponseAmino { + return o && (o.$typeUrl === MsgSubmitProposalResponse.typeUrl || typeof o.proposal_id === "bigint"); + }, encode(message: MsgSubmitProposalResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.proposalId !== BigInt(0)) { writer.uint32(8).uint64(message.proposalId); @@ -339,19 +407,31 @@ export const MsgSubmitProposalResponse = { } return message; }, + fromJSON(object: any): MsgSubmitProposalResponse { + return { + proposalId: isSet(object.proposalId) ? BigInt(object.proposalId.toString()) : BigInt(0) + }; + }, + toJSON(message: MsgSubmitProposalResponse): unknown { + const obj: any = {}; + message.proposalId !== undefined && (obj.proposalId = (message.proposalId || BigInt(0)).toString()); + return obj; + }, fromPartial(object: Partial): MsgSubmitProposalResponse { const message = createBaseMsgSubmitProposalResponse(); message.proposalId = object.proposalId !== undefined && object.proposalId !== null ? BigInt(object.proposalId.toString()) : BigInt(0); return message; }, fromAmino(object: MsgSubmitProposalResponseAmino): MsgSubmitProposalResponse { - return { - proposalId: BigInt(object.proposal_id) - }; + const message = createBaseMsgSubmitProposalResponse(); + if (object.proposal_id !== undefined && object.proposal_id !== null) { + message.proposalId = BigInt(object.proposal_id); + } + return message; }, toAmino(message: MsgSubmitProposalResponse): MsgSubmitProposalResponseAmino { const obj: any = {}; - obj.proposal_id = message.proposalId ? message.proposalId.toString() : undefined; + obj.proposal_id = message.proposalId ? message.proposalId.toString() : "0"; return obj; }, fromAminoMsg(object: MsgSubmitProposalResponseAminoMsg): MsgSubmitProposalResponse { @@ -376,6 +456,8 @@ export const MsgSubmitProposalResponse = { }; } }; +GlobalDecoderRegistry.register(MsgSubmitProposalResponse.typeUrl, MsgSubmitProposalResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgSubmitProposalResponse.aminoType, MsgSubmitProposalResponse.typeUrl); function createBaseMsgVote(): MsgVote { return { proposalId: BigInt(0), @@ -385,6 +467,16 @@ function createBaseMsgVote(): MsgVote { } export const MsgVote = { typeUrl: "/cosmos.gov.v1beta1.MsgVote", + aminoType: "cosmos-sdk/MsgVote", + is(o: any): o is MsgVote { + return o && (o.$typeUrl === MsgVote.typeUrl || typeof o.proposalId === "bigint" && typeof o.voter === "string" && isSet(o.option)); + }, + isSDK(o: any): o is MsgVoteSDKType { + return o && (o.$typeUrl === MsgVote.typeUrl || typeof o.proposal_id === "bigint" && typeof o.voter === "string" && isSet(o.option)); + }, + isAmino(o: any): o is MsgVoteAmino { + return o && (o.$typeUrl === MsgVote.typeUrl || typeof o.proposal_id === "bigint" && typeof o.voter === "string" && isSet(o.option)); + }, encode(message: MsgVote, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.proposalId !== BigInt(0)) { writer.uint32(8).uint64(message.proposalId); @@ -420,6 +512,20 @@ export const MsgVote = { } return message; }, + fromJSON(object: any): MsgVote { + return { + proposalId: isSet(object.proposalId) ? BigInt(object.proposalId.toString()) : BigInt(0), + voter: isSet(object.voter) ? String(object.voter) : "", + option: isSet(object.option) ? voteOptionFromJSON(object.option) : -1 + }; + }, + toJSON(message: MsgVote): unknown { + const obj: any = {}; + message.proposalId !== undefined && (obj.proposalId = (message.proposalId || BigInt(0)).toString()); + message.voter !== undefined && (obj.voter = message.voter); + message.option !== undefined && (obj.option = voteOptionToJSON(message.option)); + return obj; + }, fromPartial(object: Partial): MsgVote { const message = createBaseMsgVote(); message.proposalId = object.proposalId !== undefined && object.proposalId !== null ? BigInt(object.proposalId.toString()) : BigInt(0); @@ -428,17 +534,23 @@ export const MsgVote = { return message; }, fromAmino(object: MsgVoteAmino): MsgVote { - return { - proposalId: BigInt(object.proposal_id), - voter: object.voter, - option: isSet(object.option) ? voteOptionFromJSON(object.option) : -1 - }; + const message = createBaseMsgVote(); + if (object.proposal_id !== undefined && object.proposal_id !== null) { + message.proposalId = BigInt(object.proposal_id); + } + if (object.voter !== undefined && object.voter !== null) { + message.voter = object.voter; + } + if (object.option !== undefined && object.option !== null) { + message.option = voteOptionFromJSON(object.option); + } + return message; }, toAmino(message: MsgVote): MsgVoteAmino { const obj: any = {}; obj.proposal_id = message.proposalId ? message.proposalId.toString() : undefined; obj.voter = message.voter; - obj.option = message.option; + obj.option = voteOptionToJSON(message.option); return obj; }, fromAminoMsg(object: MsgVoteAminoMsg): MsgVote { @@ -446,7 +558,7 @@ export const MsgVote = { }, toAminoMsg(message: MsgVote): MsgVoteAminoMsg { return { - type: "cosmos-sdk/v1/MsgVote", + type: "cosmos-sdk/MsgVote", value: MsgVote.toAmino(message) }; }, @@ -463,11 +575,23 @@ export const MsgVote = { }; } }; +GlobalDecoderRegistry.register(MsgVote.typeUrl, MsgVote); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgVote.aminoType, MsgVote.typeUrl); function createBaseMsgVoteResponse(): MsgVoteResponse { return {}; } export const MsgVoteResponse = { typeUrl: "/cosmos.gov.v1beta1.MsgVoteResponse", + aminoType: "cosmos-sdk/MsgVoteResponse", + is(o: any): o is MsgVoteResponse { + return o && o.$typeUrl === MsgVoteResponse.typeUrl; + }, + isSDK(o: any): o is MsgVoteResponseSDKType { + return o && o.$typeUrl === MsgVoteResponse.typeUrl; + }, + isAmino(o: any): o is MsgVoteResponseAmino { + return o && o.$typeUrl === MsgVoteResponse.typeUrl; + }, encode(_: MsgVoteResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, @@ -485,12 +609,20 @@ export const MsgVoteResponse = { } return message; }, + fromJSON(_: any): MsgVoteResponse { + return {}; + }, + toJSON(_: MsgVoteResponse): unknown { + const obj: any = {}; + return obj; + }, fromPartial(_: Partial): MsgVoteResponse { const message = createBaseMsgVoteResponse(); return message; }, fromAmino(_: MsgVoteResponseAmino): MsgVoteResponse { - return {}; + const message = createBaseMsgVoteResponse(); + return message; }, toAmino(_: MsgVoteResponse): MsgVoteResponseAmino { const obj: any = {}; @@ -518,6 +650,8 @@ export const MsgVoteResponse = { }; } }; +GlobalDecoderRegistry.register(MsgVoteResponse.typeUrl, MsgVoteResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgVoteResponse.aminoType, MsgVoteResponse.typeUrl); function createBaseMsgVoteWeighted(): MsgVoteWeighted { return { proposalId: BigInt(0), @@ -527,6 +661,16 @@ function createBaseMsgVoteWeighted(): MsgVoteWeighted { } export const MsgVoteWeighted = { typeUrl: "/cosmos.gov.v1beta1.MsgVoteWeighted", + aminoType: "cosmos-sdk/MsgVoteWeighted", + is(o: any): o is MsgVoteWeighted { + return o && (o.$typeUrl === MsgVoteWeighted.typeUrl || typeof o.proposalId === "bigint" && typeof o.voter === "string" && Array.isArray(o.options) && (!o.options.length || WeightedVoteOption.is(o.options[0]))); + }, + isSDK(o: any): o is MsgVoteWeightedSDKType { + return o && (o.$typeUrl === MsgVoteWeighted.typeUrl || typeof o.proposal_id === "bigint" && typeof o.voter === "string" && Array.isArray(o.options) && (!o.options.length || WeightedVoteOption.isSDK(o.options[0]))); + }, + isAmino(o: any): o is MsgVoteWeightedAmino { + return o && (o.$typeUrl === MsgVoteWeighted.typeUrl || typeof o.proposal_id === "bigint" && typeof o.voter === "string" && Array.isArray(o.options) && (!o.options.length || WeightedVoteOption.isAmino(o.options[0]))); + }, encode(message: MsgVoteWeighted, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.proposalId !== BigInt(0)) { writer.uint32(8).uint64(message.proposalId); @@ -562,6 +706,24 @@ export const MsgVoteWeighted = { } return message; }, + fromJSON(object: any): MsgVoteWeighted { + return { + proposalId: isSet(object.proposalId) ? BigInt(object.proposalId.toString()) : BigInt(0), + voter: isSet(object.voter) ? String(object.voter) : "", + 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 || BigInt(0)).toString()); + message.voter !== undefined && (obj.voter = message.voter); + if (message.options) { + obj.options = message.options.map(e => e ? WeightedVoteOption.toJSON(e) : undefined); + } else { + obj.options = []; + } + return obj; + }, fromPartial(object: Partial): MsgVoteWeighted { const message = createBaseMsgVoteWeighted(); message.proposalId = object.proposalId !== undefined && object.proposalId !== null ? BigInt(object.proposalId.toString()) : BigInt(0); @@ -570,15 +732,19 @@ export const MsgVoteWeighted = { return message; }, fromAmino(object: MsgVoteWeightedAmino): MsgVoteWeighted { - return { - proposalId: BigInt(object.proposal_id), - voter: object.voter, - options: Array.isArray(object?.options) ? object.options.map((e: any) => WeightedVoteOption.fromAmino(e)) : [] - }; + const message = createBaseMsgVoteWeighted(); + if (object.proposal_id !== undefined && object.proposal_id !== null) { + message.proposalId = BigInt(object.proposal_id); + } + if (object.voter !== undefined && object.voter !== null) { + message.voter = object.voter; + } + message.options = object.options?.map(e => WeightedVoteOption.fromAmino(e)) || []; + return message; }, toAmino(message: MsgVoteWeighted): MsgVoteWeightedAmino { const obj: any = {}; - obj.proposal_id = message.proposalId ? message.proposalId.toString() : undefined; + obj.proposal_id = message.proposalId ? message.proposalId.toString() : "0"; obj.voter = message.voter; if (message.options) { obj.options = message.options.map(e => e ? WeightedVoteOption.toAmino(e) : undefined); @@ -592,7 +758,7 @@ export const MsgVoteWeighted = { }, toAminoMsg(message: MsgVoteWeighted): MsgVoteWeightedAminoMsg { return { - type: "cosmos-sdk/v1/MsgVoteWeighted", + type: "cosmos-sdk/MsgVoteWeighted", value: MsgVoteWeighted.toAmino(message) }; }, @@ -609,11 +775,23 @@ export const MsgVoteWeighted = { }; } }; +GlobalDecoderRegistry.register(MsgVoteWeighted.typeUrl, MsgVoteWeighted); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgVoteWeighted.aminoType, MsgVoteWeighted.typeUrl); function createBaseMsgVoteWeightedResponse(): MsgVoteWeightedResponse { return {}; } export const MsgVoteWeightedResponse = { typeUrl: "/cosmos.gov.v1beta1.MsgVoteWeightedResponse", + aminoType: "cosmos-sdk/MsgVoteWeightedResponse", + is(o: any): o is MsgVoteWeightedResponse { + return o && o.$typeUrl === MsgVoteWeightedResponse.typeUrl; + }, + isSDK(o: any): o is MsgVoteWeightedResponseSDKType { + return o && o.$typeUrl === MsgVoteWeightedResponse.typeUrl; + }, + isAmino(o: any): o is MsgVoteWeightedResponseAmino { + return o && o.$typeUrl === MsgVoteWeightedResponse.typeUrl; + }, encode(_: MsgVoteWeightedResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, @@ -631,12 +809,20 @@ export const MsgVoteWeightedResponse = { } return message; }, + fromJSON(_: any): MsgVoteWeightedResponse { + return {}; + }, + toJSON(_: MsgVoteWeightedResponse): unknown { + const obj: any = {}; + return obj; + }, fromPartial(_: Partial): MsgVoteWeightedResponse { const message = createBaseMsgVoteWeightedResponse(); return message; }, fromAmino(_: MsgVoteWeightedResponseAmino): MsgVoteWeightedResponse { - return {}; + const message = createBaseMsgVoteWeightedResponse(); + return message; }, toAmino(_: MsgVoteWeightedResponse): MsgVoteWeightedResponseAmino { const obj: any = {}; @@ -664,6 +850,8 @@ export const MsgVoteWeightedResponse = { }; } }; +GlobalDecoderRegistry.register(MsgVoteWeightedResponse.typeUrl, MsgVoteWeightedResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgVoteWeightedResponse.aminoType, MsgVoteWeightedResponse.typeUrl); function createBaseMsgDeposit(): MsgDeposit { return { proposalId: BigInt(0), @@ -673,6 +861,16 @@ function createBaseMsgDeposit(): MsgDeposit { } export const MsgDeposit = { typeUrl: "/cosmos.gov.v1beta1.MsgDeposit", + aminoType: "cosmos-sdk/MsgDeposit", + is(o: any): o is MsgDeposit { + return o && (o.$typeUrl === MsgDeposit.typeUrl || typeof o.proposalId === "bigint" && typeof o.depositor === "string" && Array.isArray(o.amount) && (!o.amount.length || Coin.is(o.amount[0]))); + }, + isSDK(o: any): o is MsgDepositSDKType { + return o && (o.$typeUrl === MsgDeposit.typeUrl || typeof o.proposal_id === "bigint" && typeof o.depositor === "string" && Array.isArray(o.amount) && (!o.amount.length || Coin.isSDK(o.amount[0]))); + }, + isAmino(o: any): o is MsgDepositAmino { + return o && (o.$typeUrl === MsgDeposit.typeUrl || typeof o.proposal_id === "bigint" && typeof o.depositor === "string" && Array.isArray(o.amount) && (!o.amount.length || Coin.isAmino(o.amount[0]))); + }, encode(message: MsgDeposit, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.proposalId !== BigInt(0)) { writer.uint32(8).uint64(message.proposalId); @@ -708,6 +906,24 @@ export const MsgDeposit = { } return message; }, + fromJSON(object: any): MsgDeposit { + return { + proposalId: isSet(object.proposalId) ? BigInt(object.proposalId.toString()) : BigInt(0), + depositor: isSet(object.depositor) ? String(object.depositor) : "", + 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 || BigInt(0)).toString()); + message.depositor !== undefined && (obj.depositor = message.depositor); + if (message.amount) { + obj.amount = message.amount.map(e => e ? Coin.toJSON(e) : undefined); + } else { + obj.amount = []; + } + return obj; + }, fromPartial(object: Partial): MsgDeposit { const message = createBaseMsgDeposit(); message.proposalId = object.proposalId !== undefined && object.proposalId !== null ? BigInt(object.proposalId.toString()) : BigInt(0); @@ -716,15 +932,19 @@ export const MsgDeposit = { return message; }, fromAmino(object: MsgDepositAmino): MsgDeposit { - return { - proposalId: BigInt(object.proposal_id), - depositor: object.depositor, - amount: Array.isArray(object?.amount) ? object.amount.map((e: any) => Coin.fromAmino(e)) : [] - }; + const message = createBaseMsgDeposit(); + if (object.proposal_id !== undefined && object.proposal_id !== null) { + message.proposalId = BigInt(object.proposal_id); + } + if (object.depositor !== undefined && object.depositor !== null) { + message.depositor = object.depositor; + } + message.amount = object.amount?.map(e => Coin.fromAmino(e)) || []; + return message; }, toAmino(message: MsgDeposit): MsgDepositAmino { const obj: any = {}; - obj.proposal_id = message.proposalId ? message.proposalId.toString() : undefined; + obj.proposal_id = message.proposalId ? message.proposalId.toString() : "0"; obj.depositor = message.depositor; if (message.amount) { obj.amount = message.amount.map(e => e ? Coin.toAmino(e) : undefined); @@ -738,7 +958,7 @@ export const MsgDeposit = { }, toAminoMsg(message: MsgDeposit): MsgDepositAminoMsg { return { - type: "cosmos-sdk/v1/MsgDeposit", + type: "cosmos-sdk/MsgDeposit", value: MsgDeposit.toAmino(message) }; }, @@ -755,11 +975,23 @@ export const MsgDeposit = { }; } }; +GlobalDecoderRegistry.register(MsgDeposit.typeUrl, MsgDeposit); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgDeposit.aminoType, MsgDeposit.typeUrl); function createBaseMsgDepositResponse(): MsgDepositResponse { return {}; } export const MsgDepositResponse = { typeUrl: "/cosmos.gov.v1beta1.MsgDepositResponse", + aminoType: "cosmos-sdk/MsgDepositResponse", + is(o: any): o is MsgDepositResponse { + return o && o.$typeUrl === MsgDepositResponse.typeUrl; + }, + isSDK(o: any): o is MsgDepositResponseSDKType { + return o && o.$typeUrl === MsgDepositResponse.typeUrl; + }, + isAmino(o: any): o is MsgDepositResponseAmino { + return o && o.$typeUrl === MsgDepositResponse.typeUrl; + }, encode(_: MsgDepositResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, @@ -777,12 +1009,20 @@ export const MsgDepositResponse = { } return message; }, + fromJSON(_: any): MsgDepositResponse { + return {}; + }, + toJSON(_: MsgDepositResponse): unknown { + const obj: any = {}; + return obj; + }, fromPartial(_: Partial): MsgDepositResponse { const message = createBaseMsgDepositResponse(); return message; }, fromAmino(_: MsgDepositResponseAmino): MsgDepositResponse { - return {}; + const message = createBaseMsgDepositResponse(); + return message; }, toAmino(_: MsgDepositResponse): MsgDepositResponseAmino { const obj: any = {}; @@ -810,35 +1050,5 @@ export const MsgDepositResponse = { }; } }; -export const Content_InterfaceDecoder = (input: BinaryReader | Uint8Array): TextProposal | Any => { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - const data = Any.decode(reader, reader.uint32()); - switch (data.typeUrl) { - case "/cosmos.gov.v1beta1.TextProposal": - return TextProposal.decode(data.value); - default: - return data; - } -}; -export const Content_FromAmino = (content: AnyAmino) => { - switch (content.type) { - case "cosmos-sdk/TextProposal": - return Any.fromPartial({ - typeUrl: "/cosmos.gov.v1beta1.TextProposal", - value: TextProposal.encode(TextProposal.fromPartial(TextProposal.fromAmino(content.value))).finish() - }); - default: - return Any.fromAmino(content); - } -}; -export const Content_ToAmino = (content: Any) => { - switch (content.typeUrl) { - case "/cosmos.gov.v1beta1.TextProposal": - return { - type: "cosmos-sdk/TextProposal", - value: TextProposal.toAmino(TextProposal.decode(content.value)) - }; - default: - return Any.toAmino(content); - } -}; \ No newline at end of file +GlobalDecoderRegistry.register(MsgDepositResponse.typeUrl, MsgDepositResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgDepositResponse.aminoType, MsgDepositResponse.typeUrl); \ No newline at end of file diff --git a/packages/osmojs/src/codegen/cosmos/ics23/v1/proofs.ts b/packages/osmojs/src/codegen/cosmos/ics23/v1/proofs.ts index b9babf701..71207691c 100644 --- a/packages/osmojs/src/codegen/cosmos/ics23/v1/proofs.ts +++ b/packages/osmojs/src/codegen/cosmos/ics23/v1/proofs.ts @@ -1,15 +1,19 @@ import { BinaryReader, BinaryWriter } from "../../../binary"; -import { isSet } from "../../../helpers"; +import { isSet, bytesFromBase64, base64FromBytes } from "../../../helpers"; +import { GlobalDecoderRegistry } from "../../../registry"; export enum HashOp { /** NO_HASH - NO_HASH is the default if no data passed. Note this is an illegal argument some places. */ NO_HASH = 0, SHA256 = 1, SHA512 = 2, - KECCAK = 3, + KECCAK256 = 3, RIPEMD160 = 4, /** BITCOIN - ripemd160(sha256(x)) */ BITCOIN = 5, SHA512_256 = 6, + BLAKE2B_512 = 7, + BLAKE2S_256 = 8, + BLAKE3 = 9, UNRECOGNIZED = -1, } export const HashOpSDKType = HashOp; @@ -26,8 +30,8 @@ export function hashOpFromJSON(object: any): HashOp { case "SHA512": return HashOp.SHA512; case 3: - case "KECCAK": - return HashOp.KECCAK; + case "KECCAK256": + return HashOp.KECCAK256; case 4: case "RIPEMD160": return HashOp.RIPEMD160; @@ -37,6 +41,15 @@ export function hashOpFromJSON(object: any): HashOp { case 6: case "SHA512_256": return HashOp.SHA512_256; + case 7: + case "BLAKE2B_512": + return HashOp.BLAKE2B_512; + case 8: + case "BLAKE2S_256": + return HashOp.BLAKE2S_256; + case 9: + case "BLAKE3": + return HashOp.BLAKE3; case -1: case "UNRECOGNIZED": default: @@ -51,14 +64,20 @@ export function hashOpToJSON(object: HashOp): string { return "SHA256"; case HashOp.SHA512: return "SHA512"; - case HashOp.KECCAK: - return "KECCAK"; + case HashOp.KECCAK256: + return "KECCAK256"; case HashOp.RIPEMD160: return "RIPEMD160"; case HashOp.BITCOIN: return "BITCOIN"; case HashOp.SHA512_256: return "SHA512_256"; + case HashOp.BLAKE2B_512: + return "BLAKE2B_512"; + case HashOp.BLAKE2S_256: + return "BLAKE2S_256"; + case HashOp.BLAKE3: + return "BLAKE3"; case HashOp.UNRECOGNIZED: default: return "UNRECOGNIZED"; @@ -177,7 +196,7 @@ export function lengthOpToJSON(object: LengthOp): string { export interface ExistenceProof { key: Uint8Array; value: Uint8Array; - leaf: LeafOp; + leaf?: LeafOp; path: InnerOp[]; } export interface ExistenceProofProtoMsg { @@ -206,10 +225,10 @@ export interface ExistenceProofProtoMsg { * length-prefix the data before hashing it. */ export interface ExistenceProofAmino { - key: Uint8Array; - value: Uint8Array; + key?: string; + value?: string; leaf?: LeafOpAmino; - path: InnerOpAmino[]; + path?: InnerOpAmino[]; } export interface ExistenceProofAminoMsg { type: "cosmos-sdk/ExistenceProof"; @@ -239,7 +258,7 @@ export interface ExistenceProofAminoMsg { export interface ExistenceProofSDKType { key: Uint8Array; value: Uint8Array; - leaf: LeafOpSDKType; + leaf?: LeafOpSDKType; path: InnerOpSDKType[]; } /** @@ -250,8 +269,8 @@ export interface ExistenceProofSDKType { export interface NonExistenceProof { /** TODO: remove this as unnecessary??? we prove a range */ key: Uint8Array; - left: ExistenceProof; - right: ExistenceProof; + left?: ExistenceProof; + right?: ExistenceProof; } export interface NonExistenceProofProtoMsg { typeUrl: "/cosmos.ics23.v1.NonExistenceProof"; @@ -264,7 +283,7 @@ export interface NonExistenceProofProtoMsg { */ export interface NonExistenceProofAmino { /** TODO: remove this as unnecessary??? we prove a range */ - key: Uint8Array; + key?: string; left?: ExistenceProofAmino; right?: ExistenceProofAmino; } @@ -279,8 +298,8 @@ export interface NonExistenceProofAminoMsg { */ export interface NonExistenceProofSDKType { key: Uint8Array; - left: ExistenceProofSDKType; - right: ExistenceProofSDKType; + left?: ExistenceProofSDKType; + right?: ExistenceProofSDKType; } /** CommitmentProof is either an ExistenceProof or a NonExistenceProof, or a Batch of such messages */ export interface CommitmentProof { @@ -359,15 +378,15 @@ export interface LeafOpProtoMsg { * output = hash(prefix || length(hkey) || hkey || length(hvalue) || hvalue) */ export interface LeafOpAmino { - hash: HashOp; - prehash_key: HashOp; - prehash_value: HashOp; - length: LengthOp; + hash?: HashOp; + prehash_key?: HashOp; + prehash_value?: 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?: string; } export interface LeafOpAminoMsg { type: "cosmos-sdk/LeafOp"; @@ -440,9 +459,9 @@ export interface InnerOpProtoMsg { * If either of prefix or suffix is empty, we just treat it as an empty string */ export interface InnerOpAmino { - hash: HashOp; - prefix: Uint8Array; - suffix: Uint8Array; + hash?: HashOp; + prefix?: string; + suffix?: string; } export interface InnerOpAminoMsg { type: "cosmos-sdk/InnerOp"; @@ -487,12 +506,18 @@ 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; /** min_depth (if > 0) is the minimum number of InnerOps allowed (mainly for fixed-depth tries) */ minDepth: number; + /** + * prehash_key_before_comparison is a flag that indicates whether to use the + * prehash_key specified by LeafOp to compare lexical ordering of keys for + * non-existence proofs. + */ + prehashKeyBeforeComparison: boolean; } export interface ProofSpecProtoMsg { typeUrl: "/cosmos.ics23.v1.ProofSpec"; @@ -518,9 +543,15 @@ export interface ProofSpecAmino { leaf_spec?: LeafOpAmino; inner_spec?: InnerSpecAmino; /** max_depth (if > 0) is the maximum number of InnerOps allowed (mainly for fixed-depth tries) */ - max_depth: number; + max_depth?: number; /** min_depth (if > 0) is the minimum number of InnerOps allowed (mainly for fixed-depth tries) */ - min_depth: number; + min_depth?: number; + /** + * prehash_key_before_comparison is a flag that indicates whether to use the + * prehash_key specified by LeafOp to compare lexical ordering of keys for + * non-existence proofs. + */ + prehash_key_before_comparison?: boolean; } export interface ProofSpecAminoMsg { type: "cosmos-sdk/ProofSpec"; @@ -539,10 +570,11 @@ export interface ProofSpecAminoMsg { * tree format server uses. But not in code, rather a configuration object. */ export interface ProofSpecSDKType { - leaf_spec: LeafOpSDKType; - inner_spec: InnerSpecSDKType; + leaf_spec?: LeafOpSDKType; + inner_spec?: InnerSpecSDKType; max_depth: number; min_depth: number; + prehash_key_before_comparison: boolean; } /** * InnerSpec contains all store-specific structure info to determine if two proofs from a @@ -589,14 +621,14 @@ export interface InnerSpecAmino { * iavl tree is [0, 1] (left then right) * merk is [0, 2, 1] (left, right, here) */ - child_order: number[]; - child_size: number; - min_prefix_length: number; - max_prefix_length: number; + child_order?: number[]; + child_size?: number; + min_prefix_length?: number; + max_prefix_length?: number; /** empty child is the prehash image that is used when one child is nil (eg. 20 bytes of 0) */ - empty_child: Uint8Array; + empty_child?: string; /** hash is the algorithm that must be used for each InnerOp */ - hash: HashOp; + hash?: HashOp; } export interface InnerSpecAminoMsg { type: "cosmos-sdk/InnerSpec"; @@ -630,7 +662,7 @@ export interface BatchProofProtoMsg { } /** BatchProof is a group of multiple proof types than can be compressed */ export interface BatchProofAmino { - entries: BatchEntryAmino[]; + entries?: BatchEntryAmino[]; } export interface BatchProofAminoMsg { type: "cosmos-sdk/BatchProof"; @@ -672,8 +704,8 @@ export interface CompressedBatchProofProtoMsg { value: Uint8Array; } export interface CompressedBatchProofAmino { - entries: CompressedBatchEntryAmino[]; - lookup_inners: InnerOpAmino[]; + entries?: CompressedBatchEntryAmino[]; + lookup_inners?: InnerOpAmino[]; } export interface CompressedBatchProofAminoMsg { type: "cosmos-sdk/CompressedBatchProof"; @@ -709,7 +741,7 @@ export interface CompressedBatchEntrySDKType { export interface CompressedExistenceProof { key: Uint8Array; value: Uint8Array; - leaf: LeafOp; + leaf?: LeafOp; /** these are indexes into the lookup_inners table in CompressedBatchProof */ path: number[]; } @@ -718,11 +750,11 @@ export interface CompressedExistenceProofProtoMsg { value: Uint8Array; } export interface CompressedExistenceProofAmino { - key: Uint8Array; - value: Uint8Array; + key?: string; + value?: string; leaf?: LeafOpAmino; /** these are indexes into the lookup_inners table in CompressedBatchProof */ - path: number[]; + path?: number[]; } export interface CompressedExistenceProofAminoMsg { type: "cosmos-sdk/CompressedExistenceProof"; @@ -731,14 +763,14 @@ export interface CompressedExistenceProofAminoMsg { export interface CompressedExistenceProofSDKType { key: Uint8Array; value: Uint8Array; - leaf: LeafOpSDKType; + leaf?: LeafOpSDKType; path: number[]; } export interface CompressedNonExistenceProof { /** TODO: remove this as unnecessary??? we prove a range */ key: Uint8Array; - left: CompressedExistenceProof; - right: CompressedExistenceProof; + left?: CompressedExistenceProof; + right?: CompressedExistenceProof; } export interface CompressedNonExistenceProofProtoMsg { typeUrl: "/cosmos.ics23.v1.CompressedNonExistenceProof"; @@ -746,7 +778,7 @@ export interface CompressedNonExistenceProofProtoMsg { } export interface CompressedNonExistenceProofAmino { /** TODO: remove this as unnecessary??? we prove a range */ - key: Uint8Array; + key?: string; left?: CompressedExistenceProofAmino; right?: CompressedExistenceProofAmino; } @@ -756,19 +788,29 @@ export interface CompressedNonExistenceProofAminoMsg { } export interface CompressedNonExistenceProofSDKType { key: Uint8Array; - left: CompressedExistenceProofSDKType; - right: CompressedExistenceProofSDKType; + left?: CompressedExistenceProofSDKType; + right?: CompressedExistenceProofSDKType; } function createBaseExistenceProof(): ExistenceProof { return { key: new Uint8Array(), value: new Uint8Array(), - leaf: LeafOp.fromPartial({}), + leaf: undefined, path: [] }; } export const ExistenceProof = { typeUrl: "/cosmos.ics23.v1.ExistenceProof", + aminoType: "cosmos-sdk/ExistenceProof", + is(o: any): o is ExistenceProof { + return o && (o.$typeUrl === ExistenceProof.typeUrl || (o.key instanceof Uint8Array || typeof o.key === "string") && (o.value instanceof Uint8Array || typeof o.value === "string") && Array.isArray(o.path) && (!o.path.length || InnerOp.is(o.path[0]))); + }, + isSDK(o: any): o is ExistenceProofSDKType { + return o && (o.$typeUrl === ExistenceProof.typeUrl || (o.key instanceof Uint8Array || typeof o.key === "string") && (o.value instanceof Uint8Array || typeof o.value === "string") && Array.isArray(o.path) && (!o.path.length || InnerOp.isSDK(o.path[0]))); + }, + isAmino(o: any): o is ExistenceProofAmino { + return o && (o.$typeUrl === ExistenceProof.typeUrl || (o.key instanceof Uint8Array || typeof o.key === "string") && (o.value instanceof Uint8Array || typeof o.value === "string") && Array.isArray(o.path) && (!o.path.length || InnerOp.isAmino(o.path[0]))); + }, encode(message: ExistenceProof, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.key.length !== 0) { writer.uint32(10).bytes(message.key); @@ -810,6 +852,26 @@ export const ExistenceProof = { } return message; }, + fromJSON(object: any): ExistenceProof { + return { + 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)) : [] + }; + }, + toJSON(message: ExistenceProof): unknown { + const obj: any = {}; + message.key !== undefined && (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); + if (message.path) { + obj.path = message.path.map(e => e ? InnerOp.toJSON(e) : undefined); + } else { + obj.path = []; + } + return obj; + }, fromPartial(object: Partial): ExistenceProof { const message = createBaseExistenceProof(); message.key = object.key ?? new Uint8Array(); @@ -819,17 +881,23 @@ export const ExistenceProof = { return message; }, fromAmino(object: ExistenceProofAmino): ExistenceProof { - return { - key: object.key, - value: object.value, - leaf: object?.leaf ? LeafOp.fromAmino(object.leaf) : undefined, - path: Array.isArray(object?.path) ? object.path.map((e: any) => InnerOp.fromAmino(e)) : [] - }; + const message = createBaseExistenceProof(); + if (object.key !== undefined && object.key !== null) { + message.key = bytesFromBase64(object.key); + } + if (object.value !== undefined && object.value !== null) { + message.value = bytesFromBase64(object.value); + } + if (object.leaf !== undefined && object.leaf !== null) { + message.leaf = LeafOp.fromAmino(object.leaf); + } + message.path = object.path?.map(e => InnerOp.fromAmino(e)) || []; + return message; }, toAmino(message: ExistenceProof): ExistenceProofAmino { const obj: any = {}; - obj.key = message.key; - obj.value = message.value; + obj.key = message.key ? base64FromBytes(message.key) : undefined; + obj.value = message.value ? base64FromBytes(message.value) : undefined; obj.leaf = message.leaf ? LeafOp.toAmino(message.leaf) : undefined; if (message.path) { obj.path = message.path.map(e => e ? InnerOp.toAmino(e) : undefined); @@ -860,15 +928,27 @@ export const ExistenceProof = { }; } }; +GlobalDecoderRegistry.register(ExistenceProof.typeUrl, ExistenceProof); +GlobalDecoderRegistry.registerAminoProtoMapping(ExistenceProof.aminoType, ExistenceProof.typeUrl); function createBaseNonExistenceProof(): NonExistenceProof { return { key: new Uint8Array(), - left: ExistenceProof.fromPartial({}), - right: ExistenceProof.fromPartial({}) + left: undefined, + right: undefined }; } export const NonExistenceProof = { typeUrl: "/cosmos.ics23.v1.NonExistenceProof", + aminoType: "cosmos-sdk/NonExistenceProof", + is(o: any): o is NonExistenceProof { + return o && (o.$typeUrl === NonExistenceProof.typeUrl || o.key instanceof Uint8Array || typeof o.key === "string"); + }, + isSDK(o: any): o is NonExistenceProofSDKType { + return o && (o.$typeUrl === NonExistenceProof.typeUrl || o.key instanceof Uint8Array || typeof o.key === "string"); + }, + isAmino(o: any): o is NonExistenceProofAmino { + return o && (o.$typeUrl === NonExistenceProof.typeUrl || o.key instanceof Uint8Array || typeof o.key === "string"); + }, encode(message: NonExistenceProof, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.key.length !== 0) { writer.uint32(10).bytes(message.key); @@ -904,6 +984,20 @@ export const NonExistenceProof = { } return message; }, + fromJSON(object: any): NonExistenceProof { + return { + 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 = {}; + 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(object: Partial): NonExistenceProof { const message = createBaseNonExistenceProof(); message.key = object.key ?? new Uint8Array(); @@ -912,15 +1006,21 @@ export const NonExistenceProof = { return message; }, fromAmino(object: NonExistenceProofAmino): NonExistenceProof { - return { - key: object.key, - left: object?.left ? ExistenceProof.fromAmino(object.left) : undefined, - right: object?.right ? ExistenceProof.fromAmino(object.right) : undefined - }; + const message = createBaseNonExistenceProof(); + if (object.key !== undefined && object.key !== null) { + message.key = bytesFromBase64(object.key); + } + if (object.left !== undefined && object.left !== null) { + message.left = ExistenceProof.fromAmino(object.left); + } + if (object.right !== undefined && object.right !== null) { + message.right = ExistenceProof.fromAmino(object.right); + } + return message; }, toAmino(message: NonExistenceProof): NonExistenceProofAmino { const obj: any = {}; - obj.key = message.key; + obj.key = message.key ? base64FromBytes(message.key) : undefined; obj.left = message.left ? ExistenceProof.toAmino(message.left) : undefined; obj.right = message.right ? ExistenceProof.toAmino(message.right) : undefined; return obj; @@ -947,6 +1047,8 @@ export const NonExistenceProof = { }; } }; +GlobalDecoderRegistry.register(NonExistenceProof.typeUrl, NonExistenceProof); +GlobalDecoderRegistry.registerAminoProtoMapping(NonExistenceProof.aminoType, NonExistenceProof.typeUrl); function createBaseCommitmentProof(): CommitmentProof { return { exist: undefined, @@ -957,6 +1059,16 @@ function createBaseCommitmentProof(): CommitmentProof { } export const CommitmentProof = { typeUrl: "/cosmos.ics23.v1.CommitmentProof", + aminoType: "cosmos-sdk/CommitmentProof", + is(o: any): o is CommitmentProof { + return o && o.$typeUrl === CommitmentProof.typeUrl; + }, + isSDK(o: any): o is CommitmentProofSDKType { + return o && o.$typeUrl === CommitmentProof.typeUrl; + }, + isAmino(o: any): o is CommitmentProofAmino { + return o && o.$typeUrl === CommitmentProof.typeUrl; + }, encode(message: CommitmentProof, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.exist !== undefined) { ExistenceProof.encode(message.exist, writer.uint32(10).fork()).ldelim(); @@ -998,6 +1110,22 @@ export const CommitmentProof = { } 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, + batch: isSet(object.batch) ? BatchProof.fromJSON(object.batch) : 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); + message.nonexist !== 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(object: Partial): CommitmentProof { const message = createBaseCommitmentProof(); message.exist = object.exist !== undefined && object.exist !== null ? ExistenceProof.fromPartial(object.exist) : undefined; @@ -1007,12 +1135,20 @@ export const CommitmentProof = { return message; }, fromAmino(object: CommitmentProofAmino): CommitmentProof { - return { - exist: object?.exist ? ExistenceProof.fromAmino(object.exist) : undefined, - nonexist: object?.nonexist ? NonExistenceProof.fromAmino(object.nonexist) : undefined, - batch: object?.batch ? BatchProof.fromAmino(object.batch) : undefined, - compressed: object?.compressed ? CompressedBatchProof.fromAmino(object.compressed) : undefined - }; + const message = createBaseCommitmentProof(); + if (object.exist !== undefined && object.exist !== null) { + message.exist = ExistenceProof.fromAmino(object.exist); + } + if (object.nonexist !== undefined && object.nonexist !== null) { + message.nonexist = NonExistenceProof.fromAmino(object.nonexist); + } + if (object.batch !== undefined && object.batch !== null) { + message.batch = BatchProof.fromAmino(object.batch); + } + if (object.compressed !== undefined && object.compressed !== null) { + message.compressed = CompressedBatchProof.fromAmino(object.compressed); + } + return message; }, toAmino(message: CommitmentProof): CommitmentProofAmino { const obj: any = {}; @@ -1044,6 +1180,8 @@ export const CommitmentProof = { }; } }; +GlobalDecoderRegistry.register(CommitmentProof.typeUrl, CommitmentProof); +GlobalDecoderRegistry.registerAminoProtoMapping(CommitmentProof.aminoType, CommitmentProof.typeUrl); function createBaseLeafOp(): LeafOp { return { hash: 0, @@ -1055,6 +1193,16 @@ function createBaseLeafOp(): LeafOp { } export const LeafOp = { typeUrl: "/cosmos.ics23.v1.LeafOp", + aminoType: "cosmos-sdk/LeafOp", + is(o: any): o is LeafOp { + return o && (o.$typeUrl === LeafOp.typeUrl || isSet(o.hash) && isSet(o.prehashKey) && isSet(o.prehashValue) && isSet(o.length) && (o.prefix instanceof Uint8Array || typeof o.prefix === "string")); + }, + isSDK(o: any): o is LeafOpSDKType { + return o && (o.$typeUrl === LeafOp.typeUrl || isSet(o.hash) && isSet(o.prehash_key) && isSet(o.prehash_value) && isSet(o.length) && (o.prefix instanceof Uint8Array || typeof o.prefix === "string")); + }, + isAmino(o: any): o is LeafOpAmino { + return o && (o.$typeUrl === LeafOp.typeUrl || isSet(o.hash) && isSet(o.prehash_key) && isSet(o.prehash_value) && isSet(o.length) && (o.prefix instanceof Uint8Array || typeof o.prefix === "string")); + }, encode(message: LeafOp, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.hash !== 0) { writer.uint32(8).int32(message.hash); @@ -1102,6 +1250,24 @@ export const LeafOp = { } return message; }, + fromJSON(object: any): LeafOp { + return { + hash: isSet(object.hash) ? hashOpFromJSON(object.hash) : -1, + prehashKey: isSet(object.prehashKey) ? hashOpFromJSON(object.prehashKey) : -1, + prehashValue: isSet(object.prehashValue) ? hashOpFromJSON(object.prehashValue) : -1, + length: isSet(object.length) ? lengthOpFromJSON(object.length) : -1, + 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)); + message.prefix !== undefined && (obj.prefix = base64FromBytes(message.prefix !== undefined ? message.prefix : new Uint8Array())); + return obj; + }, fromPartial(object: Partial): LeafOp { const message = createBaseLeafOp(); message.hash = object.hash ?? 0; @@ -1112,21 +1278,31 @@ export const LeafOp = { return message; }, fromAmino(object: LeafOpAmino): LeafOp { - return { - hash: isSet(object.hash) ? hashOpFromJSON(object.hash) : -1, - prehashKey: isSet(object.prehash_key) ? hashOpFromJSON(object.prehash_key) : -1, - prehashValue: isSet(object.prehash_value) ? hashOpFromJSON(object.prehash_value) : -1, - length: isSet(object.length) ? lengthOpFromJSON(object.length) : -1, - prefix: object.prefix - }; + const message = createBaseLeafOp(); + if (object.hash !== undefined && object.hash !== null) { + message.hash = hashOpFromJSON(object.hash); + } + if (object.prehash_key !== undefined && object.prehash_key !== null) { + message.prehashKey = hashOpFromJSON(object.prehash_key); + } + if (object.prehash_value !== undefined && object.prehash_value !== null) { + message.prehashValue = hashOpFromJSON(object.prehash_value); + } + if (object.length !== undefined && object.length !== null) { + message.length = lengthOpFromJSON(object.length); + } + if (object.prefix !== undefined && object.prefix !== null) { + message.prefix = bytesFromBase64(object.prefix); + } + return message; }, toAmino(message: LeafOp): LeafOpAmino { const obj: any = {}; - obj.hash = message.hash; - obj.prehash_key = message.prehashKey; - obj.prehash_value = message.prehashValue; - obj.length = message.length; - obj.prefix = message.prefix; + obj.hash = hashOpToJSON(message.hash); + obj.prehash_key = hashOpToJSON(message.prehashKey); + obj.prehash_value = hashOpToJSON(message.prehashValue); + obj.length = lengthOpToJSON(message.length); + obj.prefix = message.prefix ? base64FromBytes(message.prefix) : undefined; return obj; }, fromAminoMsg(object: LeafOpAminoMsg): LeafOp { @@ -1151,6 +1327,8 @@ export const LeafOp = { }; } }; +GlobalDecoderRegistry.register(LeafOp.typeUrl, LeafOp); +GlobalDecoderRegistry.registerAminoProtoMapping(LeafOp.aminoType, LeafOp.typeUrl); function createBaseInnerOp(): InnerOp { return { hash: 0, @@ -1160,6 +1338,16 @@ function createBaseInnerOp(): InnerOp { } export const InnerOp = { typeUrl: "/cosmos.ics23.v1.InnerOp", + aminoType: "cosmos-sdk/InnerOp", + is(o: any): o is InnerOp { + return o && (o.$typeUrl === InnerOp.typeUrl || isSet(o.hash) && (o.prefix instanceof Uint8Array || typeof o.prefix === "string") && (o.suffix instanceof Uint8Array || typeof o.suffix === "string")); + }, + isSDK(o: any): o is InnerOpSDKType { + return o && (o.$typeUrl === InnerOp.typeUrl || isSet(o.hash) && (o.prefix instanceof Uint8Array || typeof o.prefix === "string") && (o.suffix instanceof Uint8Array || typeof o.suffix === "string")); + }, + isAmino(o: any): o is InnerOpAmino { + return o && (o.$typeUrl === InnerOp.typeUrl || isSet(o.hash) && (o.prefix instanceof Uint8Array || typeof o.prefix === "string") && (o.suffix instanceof Uint8Array || typeof o.suffix === "string")); + }, encode(message: InnerOp, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.hash !== 0) { writer.uint32(8).int32(message.hash); @@ -1195,6 +1383,20 @@ export const InnerOp = { } return message; }, + fromJSON(object: any): InnerOp { + return { + hash: isSet(object.hash) ? hashOpFromJSON(object.hash) : -1, + 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)); + message.prefix !== undefined && (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; + }, fromPartial(object: Partial): InnerOp { const message = createBaseInnerOp(); message.hash = object.hash ?? 0; @@ -1203,17 +1405,23 @@ export const InnerOp = { return message; }, fromAmino(object: InnerOpAmino): InnerOp { - return { - hash: isSet(object.hash) ? hashOpFromJSON(object.hash) : -1, - prefix: object.prefix, - suffix: object.suffix - }; + const message = createBaseInnerOp(); + if (object.hash !== undefined && object.hash !== null) { + message.hash = hashOpFromJSON(object.hash); + } + if (object.prefix !== undefined && object.prefix !== null) { + message.prefix = bytesFromBase64(object.prefix); + } + if (object.suffix !== undefined && object.suffix !== null) { + message.suffix = bytesFromBase64(object.suffix); + } + return message; }, toAmino(message: InnerOp): InnerOpAmino { const obj: any = {}; - obj.hash = message.hash; - obj.prefix = message.prefix; - obj.suffix = message.suffix; + obj.hash = hashOpToJSON(message.hash); + obj.prefix = message.prefix ? base64FromBytes(message.prefix) : undefined; + obj.suffix = message.suffix ? base64FromBytes(message.suffix) : undefined; return obj; }, fromAminoMsg(object: InnerOpAminoMsg): InnerOp { @@ -1238,16 +1446,29 @@ export const InnerOp = { }; } }; +GlobalDecoderRegistry.register(InnerOp.typeUrl, InnerOp); +GlobalDecoderRegistry.registerAminoProtoMapping(InnerOp.aminoType, InnerOp.typeUrl); function createBaseProofSpec(): ProofSpec { return { - leafSpec: LeafOp.fromPartial({}), - innerSpec: InnerSpec.fromPartial({}), + leafSpec: undefined, + innerSpec: undefined, maxDepth: 0, - minDepth: 0 + minDepth: 0, + prehashKeyBeforeComparison: false }; } export const ProofSpec = { typeUrl: "/cosmos.ics23.v1.ProofSpec", + aminoType: "cosmos-sdk/ProofSpec", + is(o: any): o is ProofSpec { + return o && (o.$typeUrl === ProofSpec.typeUrl || typeof o.maxDepth === "number" && typeof o.minDepth === "number" && typeof o.prehashKeyBeforeComparison === "boolean"); + }, + isSDK(o: any): o is ProofSpecSDKType { + return o && (o.$typeUrl === ProofSpec.typeUrl || typeof o.max_depth === "number" && typeof o.min_depth === "number" && typeof o.prehash_key_before_comparison === "boolean"); + }, + isAmino(o: any): o is ProofSpecAmino { + return o && (o.$typeUrl === ProofSpec.typeUrl || typeof o.max_depth === "number" && typeof o.min_depth === "number" && typeof o.prehash_key_before_comparison === "boolean"); + }, encode(message: ProofSpec, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.leafSpec !== undefined) { LeafOp.encode(message.leafSpec, writer.uint32(10).fork()).ldelim(); @@ -1261,6 +1482,9 @@ export const ProofSpec = { if (message.minDepth !== 0) { writer.uint32(32).int32(message.minDepth); } + if (message.prehashKeyBeforeComparison === true) { + writer.uint32(40).bool(message.prehashKeyBeforeComparison); + } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): ProofSpec { @@ -1282,6 +1506,9 @@ export const ProofSpec = { case 4: message.minDepth = reader.int32(); break; + case 5: + message.prehashKeyBeforeComparison = reader.bool(); + break; default: reader.skipType(tag & 7); break; @@ -1289,21 +1516,51 @@ export const ProofSpec = { } 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, + maxDepth: isSet(object.maxDepth) ? Number(object.maxDepth) : 0, + minDepth: isSet(object.minDepth) ? Number(object.minDepth) : 0, + prehashKeyBeforeComparison: isSet(object.prehashKeyBeforeComparison) ? Boolean(object.prehashKeyBeforeComparison) : false + }; + }, + toJSON(message: ProofSpec): unknown { + 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)); + message.prehashKeyBeforeComparison !== undefined && (obj.prehashKeyBeforeComparison = message.prehashKeyBeforeComparison); + return obj; + }, fromPartial(object: Partial): 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; + message.prehashKeyBeforeComparison = object.prehashKeyBeforeComparison ?? false; return message; }, fromAmino(object: ProofSpecAmino): ProofSpec { - return { - leafSpec: object?.leaf_spec ? LeafOp.fromAmino(object.leaf_spec) : undefined, - innerSpec: object?.inner_spec ? InnerSpec.fromAmino(object.inner_spec) : undefined, - maxDepth: object.max_depth, - minDepth: object.min_depth - }; + const message = createBaseProofSpec(); + if (object.leaf_spec !== undefined && object.leaf_spec !== null) { + message.leafSpec = LeafOp.fromAmino(object.leaf_spec); + } + if (object.inner_spec !== undefined && object.inner_spec !== null) { + message.innerSpec = InnerSpec.fromAmino(object.inner_spec); + } + if (object.max_depth !== undefined && object.max_depth !== null) { + message.maxDepth = object.max_depth; + } + if (object.min_depth !== undefined && object.min_depth !== null) { + message.minDepth = object.min_depth; + } + if (object.prehash_key_before_comparison !== undefined && object.prehash_key_before_comparison !== null) { + message.prehashKeyBeforeComparison = object.prehash_key_before_comparison; + } + return message; }, toAmino(message: ProofSpec): ProofSpecAmino { const obj: any = {}; @@ -1311,6 +1568,7 @@ export const ProofSpec = { obj.inner_spec = message.innerSpec ? InnerSpec.toAmino(message.innerSpec) : undefined; obj.max_depth = message.maxDepth; obj.min_depth = message.minDepth; + obj.prehash_key_before_comparison = message.prehashKeyBeforeComparison; return obj; }, fromAminoMsg(object: ProofSpecAminoMsg): ProofSpec { @@ -1335,6 +1593,8 @@ export const ProofSpec = { }; } }; +GlobalDecoderRegistry.register(ProofSpec.typeUrl, ProofSpec); +GlobalDecoderRegistry.registerAminoProtoMapping(ProofSpec.aminoType, ProofSpec.typeUrl); function createBaseInnerSpec(): InnerSpec { return { childOrder: [], @@ -1347,6 +1607,16 @@ function createBaseInnerSpec(): InnerSpec { } export const InnerSpec = { typeUrl: "/cosmos.ics23.v1.InnerSpec", + aminoType: "cosmos-sdk/InnerSpec", + is(o: any): o is InnerSpec { + return o && (o.$typeUrl === InnerSpec.typeUrl || Array.isArray(o.childOrder) && (!o.childOrder.length || typeof o.childOrder[0] === "number") && typeof o.childSize === "number" && typeof o.minPrefixLength === "number" && typeof o.maxPrefixLength === "number" && (o.emptyChild instanceof Uint8Array || typeof o.emptyChild === "string") && isSet(o.hash)); + }, + isSDK(o: any): o is InnerSpecSDKType { + return o && (o.$typeUrl === InnerSpec.typeUrl || Array.isArray(o.child_order) && (!o.child_order.length || typeof o.child_order[0] === "number") && typeof o.child_size === "number" && typeof o.min_prefix_length === "number" && typeof o.max_prefix_length === "number" && (o.empty_child instanceof Uint8Array || typeof o.empty_child === "string") && isSet(o.hash)); + }, + isAmino(o: any): o is InnerSpecAmino { + return o && (o.$typeUrl === InnerSpec.typeUrl || Array.isArray(o.child_order) && (!o.child_order.length || typeof o.child_order[0] === "number") && typeof o.child_size === "number" && typeof o.min_prefix_length === "number" && typeof o.max_prefix_length === "number" && (o.empty_child instanceof Uint8Array || typeof o.empty_child === "string") && isSet(o.hash)); + }, encode(message: InnerSpec, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { writer.uint32(10).fork(); for (const v of message.childOrder) { @@ -1409,6 +1679,30 @@ export const InnerSpec = { } return message; }, + fromJSON(object: any): InnerSpec { + return { + 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(), + hash: isSet(object.hash) ? hashOpFromJSON(object.hash) : -1 + }; + }, + toJSON(message: InnerSpec): unknown { + const obj: any = {}; + if (message.childOrder) { + obj.childOrder = message.childOrder.map(e => Math.round(e)); + } else { + 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.emptyChild !== undefined && (obj.emptyChild = base64FromBytes(message.emptyChild !== undefined ? message.emptyChild : new Uint8Array())); + message.hash !== undefined && (obj.hash = hashOpToJSON(message.hash)); + return obj; + }, fromPartial(object: Partial): InnerSpec { const message = createBaseInnerSpec(); message.childOrder = object.childOrder?.map(e => e) || []; @@ -1420,14 +1714,24 @@ export const InnerSpec = { return message; }, fromAmino(object: InnerSpecAmino): InnerSpec { - return { - childOrder: Array.isArray(object?.child_order) ? object.child_order.map((e: any) => e) : [], - childSize: object.child_size, - minPrefixLength: object.min_prefix_length, - maxPrefixLength: object.max_prefix_length, - emptyChild: object.empty_child, - hash: isSet(object.hash) ? hashOpFromJSON(object.hash) : -1 - }; + const message = createBaseInnerSpec(); + message.childOrder = object.child_order?.map(e => e) || []; + if (object.child_size !== undefined && object.child_size !== null) { + message.childSize = object.child_size; + } + if (object.min_prefix_length !== undefined && object.min_prefix_length !== null) { + message.minPrefixLength = object.min_prefix_length; + } + if (object.max_prefix_length !== undefined && object.max_prefix_length !== null) { + message.maxPrefixLength = object.max_prefix_length; + } + if (object.empty_child !== undefined && object.empty_child !== null) { + message.emptyChild = bytesFromBase64(object.empty_child); + } + if (object.hash !== undefined && object.hash !== null) { + message.hash = hashOpFromJSON(object.hash); + } + return message; }, toAmino(message: InnerSpec): InnerSpecAmino { const obj: any = {}; @@ -1439,8 +1743,8 @@ export const InnerSpec = { obj.child_size = message.childSize; obj.min_prefix_length = message.minPrefixLength; obj.max_prefix_length = message.maxPrefixLength; - obj.empty_child = message.emptyChild; - obj.hash = message.hash; + obj.empty_child = message.emptyChild ? base64FromBytes(message.emptyChild) : undefined; + obj.hash = hashOpToJSON(message.hash); return obj; }, fromAminoMsg(object: InnerSpecAminoMsg): InnerSpec { @@ -1465,6 +1769,8 @@ export const InnerSpec = { }; } }; +GlobalDecoderRegistry.register(InnerSpec.typeUrl, InnerSpec); +GlobalDecoderRegistry.registerAminoProtoMapping(InnerSpec.aminoType, InnerSpec.typeUrl); function createBaseBatchProof(): BatchProof { return { entries: [] @@ -1472,6 +1778,16 @@ function createBaseBatchProof(): BatchProof { } export const BatchProof = { typeUrl: "/cosmos.ics23.v1.BatchProof", + aminoType: "cosmos-sdk/BatchProof", + is(o: any): o is BatchProof { + return o && (o.$typeUrl === BatchProof.typeUrl || Array.isArray(o.entries) && (!o.entries.length || BatchEntry.is(o.entries[0]))); + }, + isSDK(o: any): o is BatchProofSDKType { + return o && (o.$typeUrl === BatchProof.typeUrl || Array.isArray(o.entries) && (!o.entries.length || BatchEntry.isSDK(o.entries[0]))); + }, + isAmino(o: any): o is BatchProofAmino { + return o && (o.$typeUrl === BatchProof.typeUrl || Array.isArray(o.entries) && (!o.entries.length || BatchEntry.isAmino(o.entries[0]))); + }, encode(message: BatchProof, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.entries) { BatchEntry.encode(v!, writer.uint32(10).fork()).ldelim(); @@ -1495,15 +1811,29 @@ export const BatchProof = { } return message; }, + fromJSON(object: any): BatchProof { + return { + entries: Array.isArray(object?.entries) ? object.entries.map((e: any) => BatchEntry.fromJSON(e)) : [] + }; + }, + toJSON(message: BatchProof): unknown { + const obj: any = {}; + if (message.entries) { + obj.entries = message.entries.map(e => e ? BatchEntry.toJSON(e) : undefined); + } else { + obj.entries = []; + } + return obj; + }, fromPartial(object: Partial): BatchProof { const message = createBaseBatchProof(); message.entries = object.entries?.map(e => BatchEntry.fromPartial(e)) || []; return message; }, fromAmino(object: BatchProofAmino): BatchProof { - return { - entries: Array.isArray(object?.entries) ? object.entries.map((e: any) => BatchEntry.fromAmino(e)) : [] - }; + const message = createBaseBatchProof(); + message.entries = object.entries?.map(e => BatchEntry.fromAmino(e)) || []; + return message; }, toAmino(message: BatchProof): BatchProofAmino { const obj: any = {}; @@ -1536,6 +1866,8 @@ export const BatchProof = { }; } }; +GlobalDecoderRegistry.register(BatchProof.typeUrl, BatchProof); +GlobalDecoderRegistry.registerAminoProtoMapping(BatchProof.aminoType, BatchProof.typeUrl); function createBaseBatchEntry(): BatchEntry { return { exist: undefined, @@ -1544,6 +1876,16 @@ function createBaseBatchEntry(): BatchEntry { } export const BatchEntry = { typeUrl: "/cosmos.ics23.v1.BatchEntry", + aminoType: "cosmos-sdk/BatchEntry", + is(o: any): o is BatchEntry { + return o && o.$typeUrl === BatchEntry.typeUrl; + }, + isSDK(o: any): o is BatchEntrySDKType { + return o && o.$typeUrl === BatchEntry.typeUrl; + }, + isAmino(o: any): o is BatchEntryAmino { + return o && o.$typeUrl === BatchEntry.typeUrl; + }, encode(message: BatchEntry, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.exist !== undefined) { ExistenceProof.encode(message.exist, writer.uint32(10).fork()).ldelim(); @@ -1573,6 +1915,18 @@ export const BatchEntry = { } 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 + }; + }, + toJSON(message: BatchEntry): unknown { + 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; + }, fromPartial(object: Partial): BatchEntry { const message = createBaseBatchEntry(); message.exist = object.exist !== undefined && object.exist !== null ? ExistenceProof.fromPartial(object.exist) : undefined; @@ -1580,10 +1934,14 @@ export const BatchEntry = { return message; }, fromAmino(object: BatchEntryAmino): BatchEntry { - return { - exist: object?.exist ? ExistenceProof.fromAmino(object.exist) : undefined, - nonexist: object?.nonexist ? NonExistenceProof.fromAmino(object.nonexist) : undefined - }; + const message = createBaseBatchEntry(); + if (object.exist !== undefined && object.exist !== null) { + message.exist = ExistenceProof.fromAmino(object.exist); + } + if (object.nonexist !== undefined && object.nonexist !== null) { + message.nonexist = NonExistenceProof.fromAmino(object.nonexist); + } + return message; }, toAmino(message: BatchEntry): BatchEntryAmino { const obj: any = {}; @@ -1613,6 +1971,8 @@ export const BatchEntry = { }; } }; +GlobalDecoderRegistry.register(BatchEntry.typeUrl, BatchEntry); +GlobalDecoderRegistry.registerAminoProtoMapping(BatchEntry.aminoType, BatchEntry.typeUrl); function createBaseCompressedBatchProof(): CompressedBatchProof { return { entries: [], @@ -1621,6 +1981,16 @@ function createBaseCompressedBatchProof(): CompressedBatchProof { } export const CompressedBatchProof = { typeUrl: "/cosmos.ics23.v1.CompressedBatchProof", + aminoType: "cosmos-sdk/CompressedBatchProof", + is(o: any): o is CompressedBatchProof { + return o && (o.$typeUrl === CompressedBatchProof.typeUrl || Array.isArray(o.entries) && (!o.entries.length || CompressedBatchEntry.is(o.entries[0])) && Array.isArray(o.lookupInners) && (!o.lookupInners.length || InnerOp.is(o.lookupInners[0]))); + }, + isSDK(o: any): o is CompressedBatchProofSDKType { + return o && (o.$typeUrl === CompressedBatchProof.typeUrl || Array.isArray(o.entries) && (!o.entries.length || CompressedBatchEntry.isSDK(o.entries[0])) && Array.isArray(o.lookup_inners) && (!o.lookup_inners.length || InnerOp.isSDK(o.lookup_inners[0]))); + }, + isAmino(o: any): o is CompressedBatchProofAmino { + return o && (o.$typeUrl === CompressedBatchProof.typeUrl || Array.isArray(o.entries) && (!o.entries.length || CompressedBatchEntry.isAmino(o.entries[0])) && Array.isArray(o.lookup_inners) && (!o.lookup_inners.length || InnerOp.isAmino(o.lookup_inners[0]))); + }, encode(message: CompressedBatchProof, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.entries) { CompressedBatchEntry.encode(v!, writer.uint32(10).fork()).ldelim(); @@ -1650,6 +2020,26 @@ export const CompressedBatchProof = { } 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)) : [] + }; + }, + toJSON(message: CompressedBatchProof): unknown { + const obj: any = {}; + if (message.entries) { + obj.entries = message.entries.map(e => e ? CompressedBatchEntry.toJSON(e) : undefined); + } else { + obj.entries = []; + } + if (message.lookupInners) { + obj.lookupInners = message.lookupInners.map(e => e ? InnerOp.toJSON(e) : undefined); + } else { + obj.lookupInners = []; + } + return obj; + }, fromPartial(object: Partial): CompressedBatchProof { const message = createBaseCompressedBatchProof(); message.entries = object.entries?.map(e => CompressedBatchEntry.fromPartial(e)) || []; @@ -1657,10 +2047,10 @@ export const CompressedBatchProof = { return message; }, fromAmino(object: CompressedBatchProofAmino): CompressedBatchProof { - return { - entries: Array.isArray(object?.entries) ? object.entries.map((e: any) => CompressedBatchEntry.fromAmino(e)) : [], - lookupInners: Array.isArray(object?.lookup_inners) ? object.lookup_inners.map((e: any) => InnerOp.fromAmino(e)) : [] - }; + const message = createBaseCompressedBatchProof(); + message.entries = object.entries?.map(e => CompressedBatchEntry.fromAmino(e)) || []; + message.lookupInners = object.lookup_inners?.map(e => InnerOp.fromAmino(e)) || []; + return message; }, toAmino(message: CompressedBatchProof): CompressedBatchProofAmino { const obj: any = {}; @@ -1698,6 +2088,8 @@ export const CompressedBatchProof = { }; } }; +GlobalDecoderRegistry.register(CompressedBatchProof.typeUrl, CompressedBatchProof); +GlobalDecoderRegistry.registerAminoProtoMapping(CompressedBatchProof.aminoType, CompressedBatchProof.typeUrl); function createBaseCompressedBatchEntry(): CompressedBatchEntry { return { exist: undefined, @@ -1706,6 +2098,16 @@ function createBaseCompressedBatchEntry(): CompressedBatchEntry { } export const CompressedBatchEntry = { typeUrl: "/cosmos.ics23.v1.CompressedBatchEntry", + aminoType: "cosmos-sdk/CompressedBatchEntry", + is(o: any): o is CompressedBatchEntry { + return o && o.$typeUrl === CompressedBatchEntry.typeUrl; + }, + isSDK(o: any): o is CompressedBatchEntrySDKType { + return o && o.$typeUrl === CompressedBatchEntry.typeUrl; + }, + isAmino(o: any): o is CompressedBatchEntryAmino { + return o && o.$typeUrl === CompressedBatchEntry.typeUrl; + }, encode(message: CompressedBatchEntry, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.exist !== undefined) { CompressedExistenceProof.encode(message.exist, writer.uint32(10).fork()).ldelim(); @@ -1735,6 +2137,18 @@ export const CompressedBatchEntry = { } 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 + }; + }, + toJSON(message: CompressedBatchEntry): unknown { + const obj: any = {}; + 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(object: Partial): CompressedBatchEntry { const message = createBaseCompressedBatchEntry(); message.exist = object.exist !== undefined && object.exist !== null ? CompressedExistenceProof.fromPartial(object.exist) : undefined; @@ -1742,10 +2156,14 @@ export const CompressedBatchEntry = { return message; }, fromAmino(object: CompressedBatchEntryAmino): CompressedBatchEntry { - return { - exist: object?.exist ? CompressedExistenceProof.fromAmino(object.exist) : undefined, - nonexist: object?.nonexist ? CompressedNonExistenceProof.fromAmino(object.nonexist) : undefined - }; + const message = createBaseCompressedBatchEntry(); + if (object.exist !== undefined && object.exist !== null) { + message.exist = CompressedExistenceProof.fromAmino(object.exist); + } + if (object.nonexist !== undefined && object.nonexist !== null) { + message.nonexist = CompressedNonExistenceProof.fromAmino(object.nonexist); + } + return message; }, toAmino(message: CompressedBatchEntry): CompressedBatchEntryAmino { const obj: any = {}; @@ -1775,16 +2193,28 @@ export const CompressedBatchEntry = { }; } }; +GlobalDecoderRegistry.register(CompressedBatchEntry.typeUrl, CompressedBatchEntry); +GlobalDecoderRegistry.registerAminoProtoMapping(CompressedBatchEntry.aminoType, CompressedBatchEntry.typeUrl); function createBaseCompressedExistenceProof(): CompressedExistenceProof { return { key: new Uint8Array(), value: new Uint8Array(), - leaf: LeafOp.fromPartial({}), + leaf: undefined, path: [] }; } export const CompressedExistenceProof = { typeUrl: "/cosmos.ics23.v1.CompressedExistenceProof", + aminoType: "cosmos-sdk/CompressedExistenceProof", + is(o: any): o is CompressedExistenceProof { + return o && (o.$typeUrl === CompressedExistenceProof.typeUrl || (o.key instanceof Uint8Array || typeof o.key === "string") && (o.value instanceof Uint8Array || typeof o.value === "string") && Array.isArray(o.path) && (!o.path.length || typeof o.path[0] === "number")); + }, + isSDK(o: any): o is CompressedExistenceProofSDKType { + return o && (o.$typeUrl === CompressedExistenceProof.typeUrl || (o.key instanceof Uint8Array || typeof o.key === "string") && (o.value instanceof Uint8Array || typeof o.value === "string") && Array.isArray(o.path) && (!o.path.length || typeof o.path[0] === "number")); + }, + isAmino(o: any): o is CompressedExistenceProofAmino { + return o && (o.$typeUrl === CompressedExistenceProof.typeUrl || (o.key instanceof Uint8Array || typeof o.key === "string") && (o.value instanceof Uint8Array || typeof o.value === "string") && Array.isArray(o.path) && (!o.path.length || typeof o.path[0] === "number")); + }, encode(message: CompressedExistenceProof, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.key.length !== 0) { writer.uint32(10).bytes(message.key); @@ -1835,6 +2265,26 @@ export const CompressedExistenceProof = { } return message; }, + fromJSON(object: any): CompressedExistenceProof { + return { + 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) => Number(e)) : [] + }; + }, + toJSON(message: CompressedExistenceProof): unknown { + const obj: any = {}; + message.key !== undefined && (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); + if (message.path) { + obj.path = message.path.map(e => Math.round(e)); + } else { + obj.path = []; + } + return obj; + }, fromPartial(object: Partial): CompressedExistenceProof { const message = createBaseCompressedExistenceProof(); message.key = object.key ?? new Uint8Array(); @@ -1844,17 +2294,23 @@ export const CompressedExistenceProof = { return message; }, fromAmino(object: CompressedExistenceProofAmino): CompressedExistenceProof { - return { - key: object.key, - value: object.value, - leaf: object?.leaf ? LeafOp.fromAmino(object.leaf) : undefined, - path: Array.isArray(object?.path) ? object.path.map((e: any) => e) : [] - }; + const message = createBaseCompressedExistenceProof(); + if (object.key !== undefined && object.key !== null) { + message.key = bytesFromBase64(object.key); + } + if (object.value !== undefined && object.value !== null) { + message.value = bytesFromBase64(object.value); + } + if (object.leaf !== undefined && object.leaf !== null) { + message.leaf = LeafOp.fromAmino(object.leaf); + } + message.path = object.path?.map(e => e) || []; + return message; }, toAmino(message: CompressedExistenceProof): CompressedExistenceProofAmino { const obj: any = {}; - obj.key = message.key; - obj.value = message.value; + obj.key = message.key ? base64FromBytes(message.key) : undefined; + obj.value = message.value ? base64FromBytes(message.value) : undefined; obj.leaf = message.leaf ? LeafOp.toAmino(message.leaf) : undefined; if (message.path) { obj.path = message.path.map(e => e); @@ -1885,15 +2341,27 @@ export const CompressedExistenceProof = { }; } }; +GlobalDecoderRegistry.register(CompressedExistenceProof.typeUrl, CompressedExistenceProof); +GlobalDecoderRegistry.registerAminoProtoMapping(CompressedExistenceProof.aminoType, CompressedExistenceProof.typeUrl); function createBaseCompressedNonExistenceProof(): CompressedNonExistenceProof { return { key: new Uint8Array(), - left: CompressedExistenceProof.fromPartial({}), - right: CompressedExistenceProof.fromPartial({}) + left: undefined, + right: undefined }; } export const CompressedNonExistenceProof = { typeUrl: "/cosmos.ics23.v1.CompressedNonExistenceProof", + aminoType: "cosmos-sdk/CompressedNonExistenceProof", + is(o: any): o is CompressedNonExistenceProof { + return o && (o.$typeUrl === CompressedNonExistenceProof.typeUrl || o.key instanceof Uint8Array || typeof o.key === "string"); + }, + isSDK(o: any): o is CompressedNonExistenceProofSDKType { + return o && (o.$typeUrl === CompressedNonExistenceProof.typeUrl || o.key instanceof Uint8Array || typeof o.key === "string"); + }, + isAmino(o: any): o is CompressedNonExistenceProofAmino { + return o && (o.$typeUrl === CompressedNonExistenceProof.typeUrl || o.key instanceof Uint8Array || typeof o.key === "string"); + }, encode(message: CompressedNonExistenceProof, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.key.length !== 0) { writer.uint32(10).bytes(message.key); @@ -1929,6 +2397,20 @@ export const CompressedNonExistenceProof = { } 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 + }; + }, + toJSON(message: CompressedNonExistenceProof): unknown { + 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); + message.right !== undefined && (obj.right = message.right ? CompressedExistenceProof.toJSON(message.right) : undefined); + return obj; + }, fromPartial(object: Partial): CompressedNonExistenceProof { const message = createBaseCompressedNonExistenceProof(); message.key = object.key ?? new Uint8Array(); @@ -1937,15 +2419,21 @@ export const CompressedNonExistenceProof = { return message; }, fromAmino(object: CompressedNonExistenceProofAmino): CompressedNonExistenceProof { - return { - key: object.key, - left: object?.left ? CompressedExistenceProof.fromAmino(object.left) : undefined, - right: object?.right ? CompressedExistenceProof.fromAmino(object.right) : undefined - }; + const message = createBaseCompressedNonExistenceProof(); + if (object.key !== undefined && object.key !== null) { + message.key = bytesFromBase64(object.key); + } + if (object.left !== undefined && object.left !== null) { + message.left = CompressedExistenceProof.fromAmino(object.left); + } + if (object.right !== undefined && object.right !== null) { + message.right = CompressedExistenceProof.fromAmino(object.right); + } + return message; }, toAmino(message: CompressedNonExistenceProof): CompressedNonExistenceProofAmino { const obj: any = {}; - obj.key = message.key; + obj.key = message.key ? base64FromBytes(message.key) : undefined; obj.left = message.left ? CompressedExistenceProof.toAmino(message.left) : undefined; obj.right = message.right ? CompressedExistenceProof.toAmino(message.right) : undefined; return obj; @@ -1971,4 +2459,6 @@ export const CompressedNonExistenceProof = { value: CompressedNonExistenceProof.encode(message).finish() }; } -}; \ No newline at end of file +}; +GlobalDecoderRegistry.register(CompressedNonExistenceProof.typeUrl, CompressedNonExistenceProof); +GlobalDecoderRegistry.registerAminoProtoMapping(CompressedNonExistenceProof.aminoType, CompressedNonExistenceProof.typeUrl); \ No newline at end of file diff --git a/packages/osmojs/src/codegen/cosmos/lcd.ts b/packages/osmojs/src/codegen/cosmos/lcd.ts index cc9676119..4df88d562 100644 --- a/packages/osmojs/src/codegen/cosmos/lcd.ts +++ b/packages/osmojs/src/codegen/cosmos/lcd.ts @@ -31,6 +31,11 @@ export const createLCDClient = async ({ }) } }, + consensus: { + v1: new (await import("./consensus/v1/query.lcd")).LCDQueryClient({ + requestClient + }) + }, distribution: { v1beta1: new (await import("./distribution/v1beta1/query.lcd")).LCDQueryClient({ requestClient @@ -41,6 +46,11 @@ export const createLCDClient = async ({ requestClient }) }, + params: { + v1beta1: new (await import("./params/v1beta1/query.lcd")).LCDQueryClient({ + requestClient + }) + }, staking: { v1beta1: new (await import("./staking/v1beta1/query.lcd")).LCDQueryClient({ requestClient diff --git a/packages/osmojs/src/codegen/cosmos/msg/v1/msg.ts b/packages/osmojs/src/codegen/cosmos/msg/v1/msg.ts new file mode 100644 index 000000000..693da49fc --- /dev/null +++ b/packages/osmojs/src/codegen/cosmos/msg/v1/msg.ts @@ -0,0 +1 @@ +export {} \ No newline at end of file diff --git a/packages/osmojs/src/codegen/cosmos/orm/query/v1alpha1/query.rpc.Query.ts b/packages/osmojs/src/codegen/cosmos/orm/query/v1alpha1/query.rpc.Query.ts new file mode 100644 index 000000000..e4eca2d99 --- /dev/null +++ b/packages/osmojs/src/codegen/cosmos/orm/query/v1alpha1/query.rpc.Query.ts @@ -0,0 +1,41 @@ +import { Rpc } from "../../../../helpers"; +import { BinaryReader } from "../../../../binary"; +import { QueryClient, createProtobufRpcClient } from "@cosmjs/stargate"; +import { GetRequest, GetResponse, ListRequest, ListResponse } from "./query"; +/** Query is a generic gRPC service for querying ORM data. */ +export interface Query { + /** Get queries an ORM table against an unique index. */ + get(request: GetRequest): Promise; + /** List queries an ORM table against an index. */ + list(request: ListRequest): Promise; +} +export class QueryClientImpl implements Query { + private readonly rpc: Rpc; + constructor(rpc: Rpc) { + this.rpc = rpc; + this.get = this.get.bind(this); + this.list = this.list.bind(this); + } + get(request: GetRequest): Promise { + const data = GetRequest.encode(request).finish(); + const promise = this.rpc.request("cosmos.orm.query.v1alpha1.Query", "Get", data); + return promise.then(data => GetResponse.decode(new BinaryReader(data))); + } + list(request: ListRequest): Promise { + const data = ListRequest.encode(request).finish(); + const promise = this.rpc.request("cosmos.orm.query.v1alpha1.Query", "List", data); + return promise.then(data => ListResponse.decode(new BinaryReader(data))); + } +} +export const createRpcQueryExtension = (base: QueryClient) => { + const rpc = createProtobufRpcClient(base); + const queryService = new QueryClientImpl(rpc); + return { + get(request: GetRequest): Promise { + return queryService.get(request); + }, + list(request: ListRequest): Promise { + return queryService.list(request); + } + }; +}; \ No newline at end of file diff --git a/packages/osmojs/src/codegen/cosmos/orm/query/v1alpha1/query.ts b/packages/osmojs/src/codegen/cosmos/orm/query/v1alpha1/query.ts new file mode 100644 index 000000000..b3dfa678d --- /dev/null +++ b/packages/osmojs/src/codegen/cosmos/orm/query/v1alpha1/query.ts @@ -0,0 +1,1181 @@ +import { PageRequest, PageRequestAmino, PageRequestSDKType, PageResponse, PageResponseAmino, PageResponseSDKType } from "../../../base/query/v1beta1/pagination"; +import { Any, AnyAmino, AnySDKType } from "../../../../google/protobuf/any"; +import { Timestamp } from "../../../../google/protobuf/timestamp"; +import { Duration, DurationAmino, DurationSDKType } from "../../../../google/protobuf/duration"; +import { BinaryReader, BinaryWriter } from "../../../../binary"; +import { isSet, toTimestamp, fromTimestamp, bytesFromBase64, base64FromBytes } from "../../../../helpers"; +import { GlobalDecoderRegistry } from "../../../../registry"; +/** GetRequest is the Query/Get request type. */ +export interface GetRequest { + /** message_name is the fully-qualified message name of the ORM table being queried. */ + messageName: string; + /** + * index is the index fields expression used in orm definitions. If it + * is empty, the table's primary key is assumed. If it is non-empty, it must + * refer to an unique index. + */ + index: string; + /** + * values are the values of the fields corresponding to the requested index. + * There must be as many values provided as there are fields in the index and + * these values must correspond to the index field types. + */ + values: IndexValue[]; +} +export interface GetRequestProtoMsg { + typeUrl: "/cosmos.orm.query.v1alpha1.GetRequest"; + value: Uint8Array; +} +/** GetRequest is the Query/Get request type. */ +export interface GetRequestAmino { + /** message_name is the fully-qualified message name of the ORM table being queried. */ + message_name?: string; + /** + * index is the index fields expression used in orm definitions. If it + * is empty, the table's primary key is assumed. If it is non-empty, it must + * refer to an unique index. + */ + index?: string; + /** + * values are the values of the fields corresponding to the requested index. + * There must be as many values provided as there are fields in the index and + * these values must correspond to the index field types. + */ + values?: IndexValueAmino[]; +} +export interface GetRequestAminoMsg { + type: "cosmos-sdk/GetRequest"; + value: GetRequestAmino; +} +/** GetRequest is the Query/Get request type. */ +export interface GetRequestSDKType { + message_name: string; + index: string; + values: IndexValueSDKType[]; +} +/** GetResponse is the Query/Get response type. */ +export interface GetResponse { + /** + * result is the result of the get query. If no value is found, the gRPC + * status code NOT_FOUND will be returned. + */ + result?: Any; +} +export interface GetResponseProtoMsg { + typeUrl: "/cosmos.orm.query.v1alpha1.GetResponse"; + value: Uint8Array; +} +/** GetResponse is the Query/Get response type. */ +export interface GetResponseAmino { + /** + * result is the result of the get query. If no value is found, the gRPC + * status code NOT_FOUND will be returned. + */ + result?: AnyAmino; +} +export interface GetResponseAminoMsg { + type: "cosmos-sdk/GetResponse"; + value: GetResponseAmino; +} +/** GetResponse is the Query/Get response type. */ +export interface GetResponseSDKType { + result?: AnySDKType; +} +/** ListRequest is the Query/List request type. */ +export interface ListRequest { + /** message_name is the fully-qualified message name of the ORM table being queried. */ + messageName: string; + /** + * index is the index fields expression used in orm definitions. If it + * is empty, the table's primary key is assumed. + */ + index: string; + /** prefix defines a prefix query. */ + prefix?: ListRequest_Prefix; + /** range defines a range query. */ + range?: ListRequest_Range; + /** pagination is the pagination request. */ + pagination?: PageRequest; +} +export interface ListRequestProtoMsg { + typeUrl: "/cosmos.orm.query.v1alpha1.ListRequest"; + value: Uint8Array; +} +/** ListRequest is the Query/List request type. */ +export interface ListRequestAmino { + /** message_name is the fully-qualified message name of the ORM table being queried. */ + message_name?: string; + /** + * index is the index fields expression used in orm definitions. If it + * is empty, the table's primary key is assumed. + */ + index?: string; + /** prefix defines a prefix query. */ + prefix?: ListRequest_PrefixAmino; + /** range defines a range query. */ + range?: ListRequest_RangeAmino; + /** pagination is the pagination request. */ + pagination?: PageRequestAmino; +} +export interface ListRequestAminoMsg { + type: "cosmos-sdk/ListRequest"; + value: ListRequestAmino; +} +/** ListRequest is the Query/List request type. */ +export interface ListRequestSDKType { + message_name: string; + index: string; + prefix?: ListRequest_PrefixSDKType; + range?: ListRequest_RangeSDKType; + pagination?: PageRequestSDKType; +} +/** Prefix specifies the arguments to a prefix query. */ +export interface ListRequest_Prefix { + /** + * values specifies the index values for the prefix query. + * It is valid to special a partial prefix with fewer values than + * the number of fields in the index. + */ + values: IndexValue[]; +} +export interface ListRequest_PrefixProtoMsg { + typeUrl: "/cosmos.orm.query.v1alpha1.Prefix"; + value: Uint8Array; +} +/** Prefix specifies the arguments to a prefix query. */ +export interface ListRequest_PrefixAmino { + /** + * values specifies the index values for the prefix query. + * It is valid to special a partial prefix with fewer values than + * the number of fields in the index. + */ + values?: IndexValueAmino[]; +} +export interface ListRequest_PrefixAminoMsg { + type: "cosmos-sdk/Prefix"; + value: ListRequest_PrefixAmino; +} +/** Prefix specifies the arguments to a prefix query. */ +export interface ListRequest_PrefixSDKType { + values: IndexValueSDKType[]; +} +/** Range specifies the arguments to a range query. */ +export interface ListRequest_Range { + /** + * start specifies the starting index values for the range query. + * It is valid to provide fewer values than the number of fields in the + * index. + */ + start: IndexValue[]; + /** + * end specifies the inclusive ending index values for the range query. + * It is valid to provide fewer values than the number of fields in the + * index. + */ + end: IndexValue[]; +} +export interface ListRequest_RangeProtoMsg { + typeUrl: "/cosmos.orm.query.v1alpha1.Range"; + value: Uint8Array; +} +/** Range specifies the arguments to a range query. */ +export interface ListRequest_RangeAmino { + /** + * start specifies the starting index values for the range query. + * It is valid to provide fewer values than the number of fields in the + * index. + */ + start?: IndexValueAmino[]; + /** + * end specifies the inclusive ending index values for the range query. + * It is valid to provide fewer values than the number of fields in the + * index. + */ + end?: IndexValueAmino[]; +} +export interface ListRequest_RangeAminoMsg { + type: "cosmos-sdk/Range"; + value: ListRequest_RangeAmino; +} +/** Range specifies the arguments to a range query. */ +export interface ListRequest_RangeSDKType { + start: IndexValueSDKType[]; + end: IndexValueSDKType[]; +} +/** ListResponse is the Query/List response type. */ +export interface ListResponse { + /** results are the results of the query. */ + results: Any[]; + /** pagination is the pagination response. */ + pagination?: PageResponse; +} +export interface ListResponseProtoMsg { + typeUrl: "/cosmos.orm.query.v1alpha1.ListResponse"; + value: Uint8Array; +} +/** ListResponse is the Query/List response type. */ +export interface ListResponseAmino { + /** results are the results of the query. */ + results?: AnyAmino[]; + /** pagination is the pagination response. */ + pagination?: PageResponseAmino; +} +export interface ListResponseAminoMsg { + type: "cosmos-sdk/ListResponse"; + value: ListResponseAmino; +} +/** ListResponse is the Query/List response type. */ +export interface ListResponseSDKType { + results: AnySDKType[]; + pagination?: PageResponseSDKType; +} +/** IndexValue represents the value of a field in an ORM index expression. */ +export interface IndexValue { + /** + * uint specifies a value for an uint32, fixed32, uint64, or fixed64 + * index field. + */ + uint?: bigint; + /** + * int64 specifies a value for an int32, sfixed32, int64, or sfixed64 + * index field. + */ + int?: bigint; + /** str specifies a value for a string index field. */ + str?: string; + /** bytes specifies a value for a bytes index field. */ + bytes?: Uint8Array; + /** enum specifies a value for an enum index field. */ + enum?: string; + /** bool specifies a value for a bool index field. */ + bool?: boolean; + /** timestamp specifies a value for a timestamp index field. */ + timestamp?: Date; + /** duration specifies a value for a duration index field. */ + duration?: Duration; +} +export interface IndexValueProtoMsg { + typeUrl: "/cosmos.orm.query.v1alpha1.IndexValue"; + value: Uint8Array; +} +/** IndexValue represents the value of a field in an ORM index expression. */ +export interface IndexValueAmino { + /** + * uint specifies a value for an uint32, fixed32, uint64, or fixed64 + * index field. + */ + uint?: string; + /** + * int64 specifies a value for an int32, sfixed32, int64, or sfixed64 + * index field. + */ + int?: string; + /** str specifies a value for a string index field. */ + str?: string; + /** bytes specifies a value for a bytes index field. */ + bytes?: string; + /** enum specifies a value for an enum index field. */ + enum?: string; + /** bool specifies a value for a bool index field. */ + bool?: boolean; + /** timestamp specifies a value for a timestamp index field. */ + timestamp?: string; + /** duration specifies a value for a duration index field. */ + duration?: DurationAmino; +} +export interface IndexValueAminoMsg { + type: "cosmos-sdk/IndexValue"; + value: IndexValueAmino; +} +/** IndexValue represents the value of a field in an ORM index expression. */ +export interface IndexValueSDKType { + uint?: bigint; + int?: bigint; + str?: string; + bytes?: Uint8Array; + enum?: string; + bool?: boolean; + timestamp?: Date; + duration?: DurationSDKType; +} +function createBaseGetRequest(): GetRequest { + return { + messageName: "", + index: "", + values: [] + }; +} +export const GetRequest = { + typeUrl: "/cosmos.orm.query.v1alpha1.GetRequest", + aminoType: "cosmos-sdk/GetRequest", + is(o: any): o is GetRequest { + return o && (o.$typeUrl === GetRequest.typeUrl || typeof o.messageName === "string" && typeof o.index === "string" && Array.isArray(o.values) && (!o.values.length || IndexValue.is(o.values[0]))); + }, + isSDK(o: any): o is GetRequestSDKType { + return o && (o.$typeUrl === GetRequest.typeUrl || typeof o.message_name === "string" && typeof o.index === "string" && Array.isArray(o.values) && (!o.values.length || IndexValue.isSDK(o.values[0]))); + }, + isAmino(o: any): o is GetRequestAmino { + return o && (o.$typeUrl === GetRequest.typeUrl || typeof o.message_name === "string" && typeof o.index === "string" && Array.isArray(o.values) && (!o.values.length || IndexValue.isAmino(o.values[0]))); + }, + encode(message: GetRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.messageName !== "") { + writer.uint32(10).string(message.messageName); + } + if (message.index !== "") { + writer.uint32(18).string(message.index); + } + for (const v of message.values) { + IndexValue.encode(v!, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): GetRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGetRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.messageName = reader.string(); + break; + case 2: + message.index = reader.string(); + break; + case 3: + message.values.push(IndexValue.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): GetRequest { + return { + messageName: isSet(object.messageName) ? String(object.messageName) : "", + index: isSet(object.index) ? String(object.index) : "", + values: Array.isArray(object?.values) ? object.values.map((e: any) => IndexValue.fromJSON(e)) : [] + }; + }, + toJSON(message: GetRequest): unknown { + const obj: any = {}; + message.messageName !== undefined && (obj.messageName = message.messageName); + message.index !== undefined && (obj.index = message.index); + if (message.values) { + obj.values = message.values.map(e => e ? IndexValue.toJSON(e) : undefined); + } else { + obj.values = []; + } + return obj; + }, + fromPartial(object: Partial): GetRequest { + const message = createBaseGetRequest(); + message.messageName = object.messageName ?? ""; + message.index = object.index ?? ""; + message.values = object.values?.map(e => IndexValue.fromPartial(e)) || []; + return message; + }, + fromAmino(object: GetRequestAmino): GetRequest { + const message = createBaseGetRequest(); + if (object.message_name !== undefined && object.message_name !== null) { + message.messageName = object.message_name; + } + if (object.index !== undefined && object.index !== null) { + message.index = object.index; + } + message.values = object.values?.map(e => IndexValue.fromAmino(e)) || []; + return message; + }, + toAmino(message: GetRequest): GetRequestAmino { + const obj: any = {}; + obj.message_name = message.messageName; + obj.index = message.index; + if (message.values) { + obj.values = message.values.map(e => e ? IndexValue.toAmino(e) : undefined); + } else { + obj.values = []; + } + return obj; + }, + fromAminoMsg(object: GetRequestAminoMsg): GetRequest { + return GetRequest.fromAmino(object.value); + }, + toAminoMsg(message: GetRequest): GetRequestAminoMsg { + return { + type: "cosmos-sdk/GetRequest", + value: GetRequest.toAmino(message) + }; + }, + fromProtoMsg(message: GetRequestProtoMsg): GetRequest { + return GetRequest.decode(message.value); + }, + toProto(message: GetRequest): Uint8Array { + return GetRequest.encode(message).finish(); + }, + toProtoMsg(message: GetRequest): GetRequestProtoMsg { + return { + typeUrl: "/cosmos.orm.query.v1alpha1.GetRequest", + value: GetRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(GetRequest.typeUrl, GetRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(GetRequest.aminoType, GetRequest.typeUrl); +function createBaseGetResponse(): GetResponse { + return { + result: undefined + }; +} +export const GetResponse = { + typeUrl: "/cosmos.orm.query.v1alpha1.GetResponse", + aminoType: "cosmos-sdk/GetResponse", + is(o: any): o is GetResponse { + return o && o.$typeUrl === GetResponse.typeUrl; + }, + isSDK(o: any): o is GetResponseSDKType { + return o && o.$typeUrl === GetResponse.typeUrl; + }, + isAmino(o: any): o is GetResponseAmino { + return o && o.$typeUrl === GetResponse.typeUrl; + }, + encode(message: GetResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.result !== undefined) { + Any.encode(message.result, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): GetResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGetResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.result = Any.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): GetResponse { + return { + result: isSet(object.result) ? Any.fromJSON(object.result) : undefined + }; + }, + toJSON(message: GetResponse): unknown { + const obj: any = {}; + message.result !== undefined && (obj.result = message.result ? Any.toJSON(message.result) : undefined); + return obj; + }, + fromPartial(object: Partial): GetResponse { + const message = createBaseGetResponse(); + message.result = object.result !== undefined && object.result !== null ? Any.fromPartial(object.result) : undefined; + return message; + }, + fromAmino(object: GetResponseAmino): GetResponse { + const message = createBaseGetResponse(); + if (object.result !== undefined && object.result !== null) { + message.result = Any.fromAmino(object.result); + } + return message; + }, + toAmino(message: GetResponse): GetResponseAmino { + const obj: any = {}; + obj.result = message.result ? Any.toAmino(message.result) : undefined; + return obj; + }, + fromAminoMsg(object: GetResponseAminoMsg): GetResponse { + return GetResponse.fromAmino(object.value); + }, + toAminoMsg(message: GetResponse): GetResponseAminoMsg { + return { + type: "cosmos-sdk/GetResponse", + value: GetResponse.toAmino(message) + }; + }, + fromProtoMsg(message: GetResponseProtoMsg): GetResponse { + return GetResponse.decode(message.value); + }, + toProto(message: GetResponse): Uint8Array { + return GetResponse.encode(message).finish(); + }, + toProtoMsg(message: GetResponse): GetResponseProtoMsg { + return { + typeUrl: "/cosmos.orm.query.v1alpha1.GetResponse", + value: GetResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(GetResponse.typeUrl, GetResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(GetResponse.aminoType, GetResponse.typeUrl); +function createBaseListRequest(): ListRequest { + return { + messageName: "", + index: "", + prefix: undefined, + range: undefined, + pagination: undefined + }; +} +export const ListRequest = { + typeUrl: "/cosmos.orm.query.v1alpha1.ListRequest", + aminoType: "cosmos-sdk/ListRequest", + is(o: any): o is ListRequest { + return o && (o.$typeUrl === ListRequest.typeUrl || typeof o.messageName === "string" && typeof o.index === "string"); + }, + isSDK(o: any): o is ListRequestSDKType { + return o && (o.$typeUrl === ListRequest.typeUrl || typeof o.message_name === "string" && typeof o.index === "string"); + }, + isAmino(o: any): o is ListRequestAmino { + return o && (o.$typeUrl === ListRequest.typeUrl || typeof o.message_name === "string" && typeof o.index === "string"); + }, + encode(message: ListRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.messageName !== "") { + writer.uint32(10).string(message.messageName); + } + if (message.index !== "") { + writer.uint32(18).string(message.index); + } + if (message.prefix !== undefined) { + ListRequest_Prefix.encode(message.prefix, writer.uint32(26).fork()).ldelim(); + } + if (message.range !== undefined) { + ListRequest_Range.encode(message.range, writer.uint32(34).fork()).ldelim(); + } + if (message.pagination !== undefined) { + PageRequest.encode(message.pagination, writer.uint32(42).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): ListRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseListRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.messageName = reader.string(); + break; + case 2: + message.index = reader.string(); + break; + case 3: + message.prefix = ListRequest_Prefix.decode(reader, reader.uint32()); + break; + case 4: + message.range = ListRequest_Range.decode(reader, reader.uint32()); + break; + case 5: + message.pagination = PageRequest.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): ListRequest { + return { + messageName: isSet(object.messageName) ? String(object.messageName) : "", + index: isSet(object.index) ? String(object.index) : "", + prefix: isSet(object.prefix) ? ListRequest_Prefix.fromJSON(object.prefix) : undefined, + range: isSet(object.range) ? ListRequest_Range.fromJSON(object.range) : undefined, + pagination: isSet(object.pagination) ? PageRequest.fromJSON(object.pagination) : undefined + }; + }, + toJSON(message: ListRequest): unknown { + const obj: any = {}; + message.messageName !== undefined && (obj.messageName = message.messageName); + message.index !== undefined && (obj.index = message.index); + message.prefix !== undefined && (obj.prefix = message.prefix ? ListRequest_Prefix.toJSON(message.prefix) : undefined); + message.range !== undefined && (obj.range = message.range ? ListRequest_Range.toJSON(message.range) : undefined); + message.pagination !== undefined && (obj.pagination = message.pagination ? PageRequest.toJSON(message.pagination) : undefined); + return obj; + }, + fromPartial(object: Partial): ListRequest { + const message = createBaseListRequest(); + message.messageName = object.messageName ?? ""; + message.index = object.index ?? ""; + message.prefix = object.prefix !== undefined && object.prefix !== null ? ListRequest_Prefix.fromPartial(object.prefix) : undefined; + message.range = object.range !== undefined && object.range !== null ? ListRequest_Range.fromPartial(object.range) : undefined; + message.pagination = object.pagination !== undefined && object.pagination !== null ? PageRequest.fromPartial(object.pagination) : undefined; + return message; + }, + fromAmino(object: ListRequestAmino): ListRequest { + const message = createBaseListRequest(); + if (object.message_name !== undefined && object.message_name !== null) { + message.messageName = object.message_name; + } + if (object.index !== undefined && object.index !== null) { + message.index = object.index; + } + if (object.prefix !== undefined && object.prefix !== null) { + message.prefix = ListRequest_Prefix.fromAmino(object.prefix); + } + if (object.range !== undefined && object.range !== null) { + message.range = ListRequest_Range.fromAmino(object.range); + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromAmino(object.pagination); + } + return message; + }, + toAmino(message: ListRequest): ListRequestAmino { + const obj: any = {}; + obj.message_name = message.messageName; + obj.index = message.index; + obj.prefix = message.prefix ? ListRequest_Prefix.toAmino(message.prefix) : undefined; + obj.range = message.range ? ListRequest_Range.toAmino(message.range) : undefined; + obj.pagination = message.pagination ? PageRequest.toAmino(message.pagination) : undefined; + return obj; + }, + fromAminoMsg(object: ListRequestAminoMsg): ListRequest { + return ListRequest.fromAmino(object.value); + }, + toAminoMsg(message: ListRequest): ListRequestAminoMsg { + return { + type: "cosmos-sdk/ListRequest", + value: ListRequest.toAmino(message) + }; + }, + fromProtoMsg(message: ListRequestProtoMsg): ListRequest { + return ListRequest.decode(message.value); + }, + toProto(message: ListRequest): Uint8Array { + return ListRequest.encode(message).finish(); + }, + toProtoMsg(message: ListRequest): ListRequestProtoMsg { + return { + typeUrl: "/cosmos.orm.query.v1alpha1.ListRequest", + value: ListRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(ListRequest.typeUrl, ListRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(ListRequest.aminoType, ListRequest.typeUrl); +function createBaseListRequest_Prefix(): ListRequest_Prefix { + return { + values: [] + }; +} +export const ListRequest_Prefix = { + typeUrl: "/cosmos.orm.query.v1alpha1.Prefix", + aminoType: "cosmos-sdk/Prefix", + is(o: any): o is ListRequest_Prefix { + return o && (o.$typeUrl === ListRequest_Prefix.typeUrl || Array.isArray(o.values) && (!o.values.length || IndexValue.is(o.values[0]))); + }, + isSDK(o: any): o is ListRequest_PrefixSDKType { + return o && (o.$typeUrl === ListRequest_Prefix.typeUrl || Array.isArray(o.values) && (!o.values.length || IndexValue.isSDK(o.values[0]))); + }, + isAmino(o: any): o is ListRequest_PrefixAmino { + return o && (o.$typeUrl === ListRequest_Prefix.typeUrl || Array.isArray(o.values) && (!o.values.length || IndexValue.isAmino(o.values[0]))); + }, + encode(message: ListRequest_Prefix, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.values) { + IndexValue.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): ListRequest_Prefix { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseListRequest_Prefix(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.values.push(IndexValue.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): ListRequest_Prefix { + return { + values: Array.isArray(object?.values) ? object.values.map((e: any) => IndexValue.fromJSON(e)) : [] + }; + }, + toJSON(message: ListRequest_Prefix): unknown { + const obj: any = {}; + if (message.values) { + obj.values = message.values.map(e => e ? IndexValue.toJSON(e) : undefined); + } else { + obj.values = []; + } + return obj; + }, + fromPartial(object: Partial): ListRequest_Prefix { + const message = createBaseListRequest_Prefix(); + message.values = object.values?.map(e => IndexValue.fromPartial(e)) || []; + return message; + }, + fromAmino(object: ListRequest_PrefixAmino): ListRequest_Prefix { + const message = createBaseListRequest_Prefix(); + message.values = object.values?.map(e => IndexValue.fromAmino(e)) || []; + return message; + }, + toAmino(message: ListRequest_Prefix): ListRequest_PrefixAmino { + const obj: any = {}; + if (message.values) { + obj.values = message.values.map(e => e ? IndexValue.toAmino(e) : undefined); + } else { + obj.values = []; + } + return obj; + }, + fromAminoMsg(object: ListRequest_PrefixAminoMsg): ListRequest_Prefix { + return ListRequest_Prefix.fromAmino(object.value); + }, + toAminoMsg(message: ListRequest_Prefix): ListRequest_PrefixAminoMsg { + return { + type: "cosmos-sdk/Prefix", + value: ListRequest_Prefix.toAmino(message) + }; + }, + fromProtoMsg(message: ListRequest_PrefixProtoMsg): ListRequest_Prefix { + return ListRequest_Prefix.decode(message.value); + }, + toProto(message: ListRequest_Prefix): Uint8Array { + return ListRequest_Prefix.encode(message).finish(); + }, + toProtoMsg(message: ListRequest_Prefix): ListRequest_PrefixProtoMsg { + return { + typeUrl: "/cosmos.orm.query.v1alpha1.Prefix", + value: ListRequest_Prefix.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(ListRequest_Prefix.typeUrl, ListRequest_Prefix); +GlobalDecoderRegistry.registerAminoProtoMapping(ListRequest_Prefix.aminoType, ListRequest_Prefix.typeUrl); +function createBaseListRequest_Range(): ListRequest_Range { + return { + start: [], + end: [] + }; +} +export const ListRequest_Range = { + typeUrl: "/cosmos.orm.query.v1alpha1.Range", + aminoType: "cosmos-sdk/Range", + is(o: any): o is ListRequest_Range { + return o && (o.$typeUrl === ListRequest_Range.typeUrl || Array.isArray(o.start) && (!o.start.length || IndexValue.is(o.start[0])) && Array.isArray(o.end) && (!o.end.length || IndexValue.is(o.end[0]))); + }, + isSDK(o: any): o is ListRequest_RangeSDKType { + return o && (o.$typeUrl === ListRequest_Range.typeUrl || Array.isArray(o.start) && (!o.start.length || IndexValue.isSDK(o.start[0])) && Array.isArray(o.end) && (!o.end.length || IndexValue.isSDK(o.end[0]))); + }, + isAmino(o: any): o is ListRequest_RangeAmino { + return o && (o.$typeUrl === ListRequest_Range.typeUrl || Array.isArray(o.start) && (!o.start.length || IndexValue.isAmino(o.start[0])) && Array.isArray(o.end) && (!o.end.length || IndexValue.isAmino(o.end[0]))); + }, + encode(message: ListRequest_Range, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.start) { + IndexValue.encode(v!, writer.uint32(10).fork()).ldelim(); + } + for (const v of message.end) { + IndexValue.encode(v!, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): ListRequest_Range { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseListRequest_Range(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.start.push(IndexValue.decode(reader, reader.uint32())); + break; + case 2: + message.end.push(IndexValue.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): ListRequest_Range { + return { + start: Array.isArray(object?.start) ? object.start.map((e: any) => IndexValue.fromJSON(e)) : [], + end: Array.isArray(object?.end) ? object.end.map((e: any) => IndexValue.fromJSON(e)) : [] + }; + }, + toJSON(message: ListRequest_Range): unknown { + const obj: any = {}; + if (message.start) { + obj.start = message.start.map(e => e ? IndexValue.toJSON(e) : undefined); + } else { + obj.start = []; + } + if (message.end) { + obj.end = message.end.map(e => e ? IndexValue.toJSON(e) : undefined); + } else { + obj.end = []; + } + return obj; + }, + fromPartial(object: Partial): ListRequest_Range { + const message = createBaseListRequest_Range(); + message.start = object.start?.map(e => IndexValue.fromPartial(e)) || []; + message.end = object.end?.map(e => IndexValue.fromPartial(e)) || []; + return message; + }, + fromAmino(object: ListRequest_RangeAmino): ListRequest_Range { + const message = createBaseListRequest_Range(); + message.start = object.start?.map(e => IndexValue.fromAmino(e)) || []; + message.end = object.end?.map(e => IndexValue.fromAmino(e)) || []; + return message; + }, + toAmino(message: ListRequest_Range): ListRequest_RangeAmino { + const obj: any = {}; + if (message.start) { + obj.start = message.start.map(e => e ? IndexValue.toAmino(e) : undefined); + } else { + obj.start = []; + } + if (message.end) { + obj.end = message.end.map(e => e ? IndexValue.toAmino(e) : undefined); + } else { + obj.end = []; + } + return obj; + }, + fromAminoMsg(object: ListRequest_RangeAminoMsg): ListRequest_Range { + return ListRequest_Range.fromAmino(object.value); + }, + toAminoMsg(message: ListRequest_Range): ListRequest_RangeAminoMsg { + return { + type: "cosmos-sdk/Range", + value: ListRequest_Range.toAmino(message) + }; + }, + fromProtoMsg(message: ListRequest_RangeProtoMsg): ListRequest_Range { + return ListRequest_Range.decode(message.value); + }, + toProto(message: ListRequest_Range): Uint8Array { + return ListRequest_Range.encode(message).finish(); + }, + toProtoMsg(message: ListRequest_Range): ListRequest_RangeProtoMsg { + return { + typeUrl: "/cosmos.orm.query.v1alpha1.Range", + value: ListRequest_Range.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(ListRequest_Range.typeUrl, ListRequest_Range); +GlobalDecoderRegistry.registerAminoProtoMapping(ListRequest_Range.aminoType, ListRequest_Range.typeUrl); +function createBaseListResponse(): ListResponse { + return { + results: [], + pagination: undefined + }; +} +export const ListResponse = { + typeUrl: "/cosmos.orm.query.v1alpha1.ListResponse", + aminoType: "cosmos-sdk/ListResponse", + is(o: any): o is ListResponse { + return o && (o.$typeUrl === ListResponse.typeUrl || Array.isArray(o.results) && (!o.results.length || Any.is(o.results[0]))); + }, + isSDK(o: any): o is ListResponseSDKType { + return o && (o.$typeUrl === ListResponse.typeUrl || Array.isArray(o.results) && (!o.results.length || Any.isSDK(o.results[0]))); + }, + isAmino(o: any): o is ListResponseAmino { + return o && (o.$typeUrl === ListResponse.typeUrl || Array.isArray(o.results) && (!o.results.length || Any.isAmino(o.results[0]))); + }, + encode(message: ListResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.results) { + Any.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.pagination !== undefined) { + PageResponse.encode(message.pagination, writer.uint32(42).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): ListResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseListResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.results.push(Any.decode(reader, reader.uint32())); + break; + case 5: + message.pagination = PageResponse.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): ListResponse { + return { + results: Array.isArray(object?.results) ? object.results.map((e: any) => Any.fromJSON(e)) : [], + pagination: isSet(object.pagination) ? PageResponse.fromJSON(object.pagination) : undefined + }; + }, + toJSON(message: ListResponse): unknown { + const obj: any = {}; + if (message.results) { + obj.results = message.results.map(e => e ? Any.toJSON(e) : undefined); + } else { + obj.results = []; + } + message.pagination !== undefined && (obj.pagination = message.pagination ? PageResponse.toJSON(message.pagination) : undefined); + return obj; + }, + fromPartial(object: Partial): ListResponse { + const message = createBaseListResponse(); + message.results = object.results?.map(e => Any.fromPartial(e)) || []; + message.pagination = object.pagination !== undefined && object.pagination !== null ? PageResponse.fromPartial(object.pagination) : undefined; + return message; + }, + fromAmino(object: ListResponseAmino): ListResponse { + const message = createBaseListResponse(); + message.results = object.results?.map(e => Any.fromAmino(e)) || []; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromAmino(object.pagination); + } + return message; + }, + toAmino(message: ListResponse): ListResponseAmino { + const obj: any = {}; + if (message.results) { + obj.results = message.results.map(e => e ? Any.toAmino(e) : undefined); + } else { + obj.results = []; + } + obj.pagination = message.pagination ? PageResponse.toAmino(message.pagination) : undefined; + return obj; + }, + fromAminoMsg(object: ListResponseAminoMsg): ListResponse { + return ListResponse.fromAmino(object.value); + }, + toAminoMsg(message: ListResponse): ListResponseAminoMsg { + return { + type: "cosmos-sdk/ListResponse", + value: ListResponse.toAmino(message) + }; + }, + fromProtoMsg(message: ListResponseProtoMsg): ListResponse { + return ListResponse.decode(message.value); + }, + toProto(message: ListResponse): Uint8Array { + return ListResponse.encode(message).finish(); + }, + toProtoMsg(message: ListResponse): ListResponseProtoMsg { + return { + typeUrl: "/cosmos.orm.query.v1alpha1.ListResponse", + value: ListResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(ListResponse.typeUrl, ListResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(ListResponse.aminoType, ListResponse.typeUrl); +function createBaseIndexValue(): IndexValue { + return { + uint: undefined, + int: undefined, + str: undefined, + bytes: undefined, + enum: undefined, + bool: undefined, + timestamp: undefined, + duration: undefined + }; +} +export const IndexValue = { + typeUrl: "/cosmos.orm.query.v1alpha1.IndexValue", + aminoType: "cosmos-sdk/IndexValue", + is(o: any): o is IndexValue { + return o && o.$typeUrl === IndexValue.typeUrl; + }, + isSDK(o: any): o is IndexValueSDKType { + return o && o.$typeUrl === IndexValue.typeUrl; + }, + isAmino(o: any): o is IndexValueAmino { + return o && o.$typeUrl === IndexValue.typeUrl; + }, + encode(message: IndexValue, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.uint !== undefined) { + writer.uint32(8).uint64(message.uint); + } + if (message.int !== undefined) { + writer.uint32(16).int64(message.int); + } + if (message.str !== undefined) { + writer.uint32(26).string(message.str); + } + if (message.bytes !== undefined) { + writer.uint32(34).bytes(message.bytes); + } + if (message.enum !== undefined) { + writer.uint32(42).string(message.enum); + } + if (message.bool !== undefined) { + writer.uint32(48).bool(message.bool); + } + if (message.timestamp !== undefined) { + Timestamp.encode(toTimestamp(message.timestamp), writer.uint32(58).fork()).ldelim(); + } + if (message.duration !== undefined) { + Duration.encode(message.duration, writer.uint32(66).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): IndexValue { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseIndexValue(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.uint = reader.uint64(); + break; + case 2: + message.int = reader.int64(); + break; + case 3: + message.str = reader.string(); + break; + case 4: + message.bytes = reader.bytes(); + break; + case 5: + message.enum = reader.string(); + break; + case 6: + message.bool = reader.bool(); + break; + case 7: + message.timestamp = fromTimestamp(Timestamp.decode(reader, reader.uint32())); + break; + case 8: + message.duration = Duration.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): IndexValue { + return { + uint: isSet(object.uint) ? BigInt(object.uint.toString()) : undefined, + int: isSet(object.int) ? BigInt(object.int.toString()) : undefined, + str: isSet(object.str) ? String(object.str) : undefined, + bytes: isSet(object.bytes) ? bytesFromBase64(object.bytes) : undefined, + enum: isSet(object.enum) ? String(object.enum) : undefined, + bool: isSet(object.bool) ? Boolean(object.bool) : undefined, + timestamp: isSet(object.timestamp) ? new Date(object.timestamp) : undefined, + duration: isSet(object.duration) ? Duration.fromJSON(object.duration) : undefined + }; + }, + toJSON(message: IndexValue): unknown { + const obj: any = {}; + if (message.uint !== undefined) { + obj.uint = message.uint.toString(); + } + if (message.int !== undefined) { + obj.int = message.int.toString(); + } + message.str !== undefined && (obj.str = message.str); + message.bytes !== undefined && (obj.bytes = message.bytes !== undefined ? base64FromBytes(message.bytes) : undefined); + message.enum !== undefined && (obj.enum = message.enum); + message.bool !== undefined && (obj.bool = message.bool); + message.timestamp !== undefined && (obj.timestamp = message.timestamp.toISOString()); + message.duration !== undefined && (obj.duration = message.duration ? Duration.toJSON(message.duration) : undefined); + return obj; + }, + fromPartial(object: Partial): IndexValue { + const message = createBaseIndexValue(); + message.uint = object.uint !== undefined && object.uint !== null ? BigInt(object.uint.toString()) : undefined; + message.int = object.int !== undefined && object.int !== null ? BigInt(object.int.toString()) : undefined; + message.str = object.str ?? undefined; + message.bytes = object.bytes ?? undefined; + message.enum = object.enum ?? undefined; + message.bool = object.bool ?? undefined; + message.timestamp = object.timestamp ?? undefined; + message.duration = object.duration !== undefined && object.duration !== null ? Duration.fromPartial(object.duration) : undefined; + return message; + }, + fromAmino(object: IndexValueAmino): IndexValue { + const message = createBaseIndexValue(); + if (object.uint !== undefined && object.uint !== null) { + message.uint = BigInt(object.uint); + } + if (object.int !== undefined && object.int !== null) { + message.int = BigInt(object.int); + } + if (object.str !== undefined && object.str !== null) { + message.str = object.str; + } + if (object.bytes !== undefined && object.bytes !== null) { + message.bytes = bytesFromBase64(object.bytes); + } + if (object.enum !== undefined && object.enum !== null) { + message.enum = object.enum; + } + if (object.bool !== undefined && object.bool !== null) { + message.bool = object.bool; + } + if (object.timestamp !== undefined && object.timestamp !== null) { + message.timestamp = fromTimestamp(Timestamp.fromAmino(object.timestamp)); + } + if (object.duration !== undefined && object.duration !== null) { + message.duration = Duration.fromAmino(object.duration); + } + return message; + }, + toAmino(message: IndexValue): IndexValueAmino { + const obj: any = {}; + obj.uint = message.uint ? message.uint.toString() : undefined; + obj.int = message.int ? message.int.toString() : undefined; + obj.str = message.str; + obj.bytes = message.bytes ? base64FromBytes(message.bytes) : undefined; + obj.enum = message.enum; + obj.bool = message.bool; + obj.timestamp = message.timestamp ? Timestamp.toAmino(toTimestamp(message.timestamp)) : undefined; + obj.duration = message.duration ? Duration.toAmino(message.duration) : undefined; + return obj; + }, + fromAminoMsg(object: IndexValueAminoMsg): IndexValue { + return IndexValue.fromAmino(object.value); + }, + toAminoMsg(message: IndexValue): IndexValueAminoMsg { + return { + type: "cosmos-sdk/IndexValue", + value: IndexValue.toAmino(message) + }; + }, + fromProtoMsg(message: IndexValueProtoMsg): IndexValue { + return IndexValue.decode(message.value); + }, + toProto(message: IndexValue): Uint8Array { + return IndexValue.encode(message).finish(); + }, + toProtoMsg(message: IndexValue): IndexValueProtoMsg { + return { + typeUrl: "/cosmos.orm.query.v1alpha1.IndexValue", + value: IndexValue.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(IndexValue.typeUrl, IndexValue); +GlobalDecoderRegistry.registerAminoProtoMapping(IndexValue.aminoType, IndexValue.typeUrl); \ No newline at end of file diff --git a/packages/osmojs/src/codegen/cosmos/params/v1beta1/params.ts b/packages/osmojs/src/codegen/cosmos/params/v1beta1/params.ts new file mode 100644 index 000000000..463bd8ba5 --- /dev/null +++ b/packages/osmojs/src/codegen/cosmos/params/v1beta1/params.ts @@ -0,0 +1,311 @@ +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { isSet } from "../../../helpers"; +import { GlobalDecoderRegistry } from "../../../registry"; +/** ParameterChangeProposal defines a proposal to change one or more parameters. */ +export interface ParameterChangeProposal { + $typeUrl?: "/cosmos.params.v1beta1.ParameterChangeProposal"; + title: string; + description: string; + changes: ParamChange[]; +} +export interface ParameterChangeProposalProtoMsg { + typeUrl: "/cosmos.params.v1beta1.ParameterChangeProposal"; + value: Uint8Array; +} +/** ParameterChangeProposal defines a proposal to change one or more parameters. */ +export interface ParameterChangeProposalAmino { + title?: string; + description?: string; + changes: ParamChangeAmino[]; +} +export interface ParameterChangeProposalAminoMsg { + type: "cosmos-sdk/ParameterChangeProposal"; + value: ParameterChangeProposalAmino; +} +/** ParameterChangeProposal defines a proposal to change one or more parameters. */ +export interface ParameterChangeProposalSDKType { + $typeUrl?: "/cosmos.params.v1beta1.ParameterChangeProposal"; + title: string; + description: string; + changes: ParamChangeSDKType[]; +} +/** + * ParamChange defines an individual parameter change, for use in + * ParameterChangeProposal. + */ +export interface ParamChange { + subspace: string; + key: string; + value: string; +} +export interface ParamChangeProtoMsg { + typeUrl: "/cosmos.params.v1beta1.ParamChange"; + value: Uint8Array; +} +/** + * ParamChange defines an individual parameter change, for use in + * ParameterChangeProposal. + */ +export interface ParamChangeAmino { + subspace?: string; + key?: string; + value?: string; +} +export interface ParamChangeAminoMsg { + type: "cosmos-sdk/ParamChange"; + value: ParamChangeAmino; +} +/** + * ParamChange defines an individual parameter change, for use in + * ParameterChangeProposal. + */ +export interface ParamChangeSDKType { + subspace: string; + key: string; + value: string; +} +function createBaseParameterChangeProposal(): ParameterChangeProposal { + return { + $typeUrl: "/cosmos.params.v1beta1.ParameterChangeProposal", + title: "", + description: "", + changes: [] + }; +} +export const ParameterChangeProposal = { + typeUrl: "/cosmos.params.v1beta1.ParameterChangeProposal", + aminoType: "cosmos-sdk/ParameterChangeProposal", + is(o: any): o is ParameterChangeProposal { + return o && (o.$typeUrl === ParameterChangeProposal.typeUrl || typeof o.title === "string" && typeof o.description === "string" && Array.isArray(o.changes) && (!o.changes.length || ParamChange.is(o.changes[0]))); + }, + isSDK(o: any): o is ParameterChangeProposalSDKType { + return o && (o.$typeUrl === ParameterChangeProposal.typeUrl || typeof o.title === "string" && typeof o.description === "string" && Array.isArray(o.changes) && (!o.changes.length || ParamChange.isSDK(o.changes[0]))); + }, + isAmino(o: any): o is ParameterChangeProposalAmino { + return o && (o.$typeUrl === ParameterChangeProposal.typeUrl || typeof o.title === "string" && typeof o.description === "string" && Array.isArray(o.changes) && (!o.changes.length || ParamChange.isAmino(o.changes[0]))); + }, + encode(message: ParameterChangeProposal, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.title !== "") { + writer.uint32(10).string(message.title); + } + if (message.description !== "") { + writer.uint32(18).string(message.description); + } + for (const v of message.changes) { + ParamChange.encode(v!, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): ParameterChangeProposal { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseParameterChangeProposal(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.title = reader.string(); + break; + case 2: + message.description = reader.string(); + break; + case 3: + message.changes.push(ParamChange.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + 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)) : [] + }; + }, + toJSON(message: ParameterChangeProposal): unknown { + 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); + } else { + obj.changes = []; + } + return obj; + }, + fromPartial(object: Partial): ParameterChangeProposal { + const message = createBaseParameterChangeProposal(); + message.title = object.title ?? ""; + message.description = object.description ?? ""; + message.changes = object.changes?.map(e => ParamChange.fromPartial(e)) || []; + return message; + }, + fromAmino(object: ParameterChangeProposalAmino): ParameterChangeProposal { + const message = createBaseParameterChangeProposal(); + if (object.title !== undefined && object.title !== null) { + message.title = object.title; + } + if (object.description !== undefined && object.description !== null) { + message.description = object.description; + } + message.changes = object.changes?.map(e => ParamChange.fromAmino(e)) || []; + return message; + }, + toAmino(message: ParameterChangeProposal): ParameterChangeProposalAmino { + const obj: any = {}; + obj.title = message.title; + obj.description = message.description; + if (message.changes) { + obj.changes = message.changes.map(e => e ? ParamChange.toAmino(e) : undefined); + } else { + obj.changes = []; + } + return obj; + }, + fromAminoMsg(object: ParameterChangeProposalAminoMsg): ParameterChangeProposal { + return ParameterChangeProposal.fromAmino(object.value); + }, + toAminoMsg(message: ParameterChangeProposal): ParameterChangeProposalAminoMsg { + return { + type: "cosmos-sdk/ParameterChangeProposal", + value: ParameterChangeProposal.toAmino(message) + }; + }, + fromProtoMsg(message: ParameterChangeProposalProtoMsg): ParameterChangeProposal { + return ParameterChangeProposal.decode(message.value); + }, + toProto(message: ParameterChangeProposal): Uint8Array { + return ParameterChangeProposal.encode(message).finish(); + }, + toProtoMsg(message: ParameterChangeProposal): ParameterChangeProposalProtoMsg { + return { + typeUrl: "/cosmos.params.v1beta1.ParameterChangeProposal", + value: ParameterChangeProposal.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(ParameterChangeProposal.typeUrl, ParameterChangeProposal); +GlobalDecoderRegistry.registerAminoProtoMapping(ParameterChangeProposal.aminoType, ParameterChangeProposal.typeUrl); +function createBaseParamChange(): ParamChange { + return { + subspace: "", + key: "", + value: "" + }; +} +export const ParamChange = { + typeUrl: "/cosmos.params.v1beta1.ParamChange", + aminoType: "cosmos-sdk/ParamChange", + is(o: any): o is ParamChange { + return o && (o.$typeUrl === ParamChange.typeUrl || typeof o.subspace === "string" && typeof o.key === "string" && typeof o.value === "string"); + }, + isSDK(o: any): o is ParamChangeSDKType { + return o && (o.$typeUrl === ParamChange.typeUrl || typeof o.subspace === "string" && typeof o.key === "string" && typeof o.value === "string"); + }, + isAmino(o: any): o is ParamChangeAmino { + return o && (o.$typeUrl === ParamChange.typeUrl || typeof o.subspace === "string" && typeof o.key === "string" && typeof o.value === "string"); + }, + encode(message: ParamChange, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.subspace !== "") { + writer.uint32(10).string(message.subspace); + } + if (message.key !== "") { + writer.uint32(18).string(message.key); + } + if (message.value !== "") { + writer.uint32(26).string(message.value); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): ParamChange { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseParamChange(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.subspace = reader.string(); + break; + case 2: + message.key = reader.string(); + break; + case 3: + message.value = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): ParamChange { + return { + 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; + }, + fromPartial(object: Partial): ParamChange { + const message = createBaseParamChange(); + message.subspace = object.subspace ?? ""; + message.key = object.key ?? ""; + message.value = object.value ?? ""; + return message; + }, + fromAmino(object: ParamChangeAmino): ParamChange { + const message = createBaseParamChange(); + if (object.subspace !== undefined && object.subspace !== null) { + message.subspace = object.subspace; + } + if (object.key !== undefined && object.key !== null) { + message.key = object.key; + } + if (object.value !== undefined && object.value !== null) { + message.value = object.value; + } + return message; + }, + toAmino(message: ParamChange): ParamChangeAmino { + const obj: any = {}; + obj.subspace = message.subspace; + obj.key = message.key; + obj.value = message.value; + return obj; + }, + fromAminoMsg(object: ParamChangeAminoMsg): ParamChange { + return ParamChange.fromAmino(object.value); + }, + toAminoMsg(message: ParamChange): ParamChangeAminoMsg { + return { + type: "cosmos-sdk/ParamChange", + value: ParamChange.toAmino(message) + }; + }, + fromProtoMsg(message: ParamChangeProtoMsg): ParamChange { + return ParamChange.decode(message.value); + }, + toProto(message: ParamChange): Uint8Array { + return ParamChange.encode(message).finish(); + }, + toProtoMsg(message: ParamChange): ParamChangeProtoMsg { + return { + typeUrl: "/cosmos.params.v1beta1.ParamChange", + value: ParamChange.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(ParamChange.typeUrl, ParamChange); +GlobalDecoderRegistry.registerAminoProtoMapping(ParamChange.aminoType, ParamChange.typeUrl); \ No newline at end of file diff --git a/packages/osmojs/src/codegen/cosmos/params/v1beta1/query.lcd.ts b/packages/osmojs/src/codegen/cosmos/params/v1beta1/query.lcd.ts new file mode 100644 index 000000000..30dd12e35 --- /dev/null +++ b/packages/osmojs/src/codegen/cosmos/params/v1beta1/query.lcd.ts @@ -0,0 +1,36 @@ +import { LCDClient } from "@cosmology/lcd"; +import { QueryParamsRequest, QueryParamsResponseSDKType, QuerySubspacesRequest, QuerySubspacesResponseSDKType } from "./query"; +export class LCDQueryClient { + req: LCDClient; + constructor({ + requestClient + }: { + requestClient: LCDClient; + }) { + this.req = requestClient; + this.params = this.params.bind(this); + this.subspaces = this.subspaces.bind(this); + } + /* Params queries a specific parameter of a module, given its subspace and + key. */ + async params(params: QueryParamsRequest): Promise { + const options: any = { + params: {} + }; + if (typeof params?.subspace !== "undefined") { + options.params.subspace = params.subspace; + } + if (typeof params?.key !== "undefined") { + options.params.key = params.key; + } + const endpoint = `cosmos/params/v1beta1/params`; + return await this.req.get(endpoint, options); + } + /* Subspaces queries for all registered subspaces and all keys for a subspace. + + Since: cosmos-sdk 0.46 */ + async subspaces(_params: QuerySubspacesRequest = {}): Promise { + const endpoint = `cosmos/params/v1beta1/subspaces`; + return await this.req.get(endpoint); + } +} \ No newline at end of file diff --git a/packages/osmojs/src/codegen/cosmos/params/v1beta1/query.rpc.Query.ts b/packages/osmojs/src/codegen/cosmos/params/v1beta1/query.rpc.Query.ts new file mode 100644 index 000000000..a432f94d7 --- /dev/null +++ b/packages/osmojs/src/codegen/cosmos/params/v1beta1/query.rpc.Query.ts @@ -0,0 +1,48 @@ +import { Rpc } from "../../../helpers"; +import { BinaryReader } from "../../../binary"; +import { QueryClient, createProtobufRpcClient } from "@cosmjs/stargate"; +import { QueryParamsRequest, QueryParamsResponse, QuerySubspacesRequest, QuerySubspacesResponse } from "./query"; +/** Query defines the gRPC querier service. */ +export interface Query { + /** + * Params queries a specific parameter of a module, given its subspace and + * key. + */ + params(request: QueryParamsRequest): Promise; + /** + * Subspaces queries for all registered subspaces and all keys for a subspace. + * + * Since: cosmos-sdk 0.46 + */ + subspaces(request?: QuerySubspacesRequest): Promise; +} +export class QueryClientImpl implements Query { + private readonly rpc: Rpc; + constructor(rpc: Rpc) { + this.rpc = rpc; + this.params = this.params.bind(this); + this.subspaces = this.subspaces.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 BinaryReader(data))); + } + subspaces(request: QuerySubspacesRequest = {}): Promise { + const data = QuerySubspacesRequest.encode(request).finish(); + const promise = this.rpc.request("cosmos.params.v1beta1.Query", "Subspaces", data); + return promise.then(data => QuerySubspacesResponse.decode(new BinaryReader(data))); + } +} +export const createRpcQueryExtension = (base: QueryClient) => { + const rpc = createProtobufRpcClient(base); + const queryService = new QueryClientImpl(rpc); + return { + params(request: QueryParamsRequest): Promise { + return queryService.params(request); + }, + subspaces(request?: QuerySubspacesRequest): Promise { + return queryService.subspaces(request); + } + }; +}; \ No newline at end of file diff --git a/packages/osmojs/src/codegen/cosmos/params/v1beta1/query.ts b/packages/osmojs/src/codegen/cosmos/params/v1beta1/query.ts new file mode 100644 index 000000000..e12cb6eab --- /dev/null +++ b/packages/osmojs/src/codegen/cosmos/params/v1beta1/query.ts @@ -0,0 +1,634 @@ +import { ParamChange, ParamChangeAmino, ParamChangeSDKType } from "./params"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { isSet } from "../../../helpers"; +import { GlobalDecoderRegistry } from "../../../registry"; +/** QueryParamsRequest is request type for the Query/Params RPC method. */ +export interface QueryParamsRequest { + /** subspace defines the module to query the parameter for. */ + subspace: string; + /** key defines the key of the parameter in the subspace. */ + key: string; +} +export interface QueryParamsRequestProtoMsg { + typeUrl: "/cosmos.params.v1beta1.QueryParamsRequest"; + value: Uint8Array; +} +/** QueryParamsRequest is request type for the Query/Params RPC method. */ +export interface QueryParamsRequestAmino { + /** subspace defines the module to query the parameter for. */ + subspace?: string; + /** key defines the key of the parameter in the subspace. */ + key?: string; +} +export interface QueryParamsRequestAminoMsg { + type: "cosmos-sdk/QueryParamsRequest"; + value: QueryParamsRequestAmino; +} +/** QueryParamsRequest is request type for the Query/Params RPC method. */ +export interface QueryParamsRequestSDKType { + subspace: string; + key: string; +} +/** QueryParamsResponse is response type for the Query/Params RPC method. */ +export interface QueryParamsResponse { + /** param defines the queried parameter. */ + param: ParamChange; +} +export interface QueryParamsResponseProtoMsg { + typeUrl: "/cosmos.params.v1beta1.QueryParamsResponse"; + value: Uint8Array; +} +/** QueryParamsResponse is response type for the Query/Params RPC method. */ +export interface QueryParamsResponseAmino { + /** param defines the queried parameter. */ + param: ParamChangeAmino; +} +export interface QueryParamsResponseAminoMsg { + type: "cosmos-sdk/QueryParamsResponse"; + value: QueryParamsResponseAmino; +} +/** QueryParamsResponse is response type for the Query/Params RPC method. */ +export interface QueryParamsResponseSDKType { + param: ParamChangeSDKType; +} +/** + * QuerySubspacesRequest defines a request type for querying for all registered + * subspaces and all keys for a subspace. + * + * Since: cosmos-sdk 0.46 + */ +export interface QuerySubspacesRequest {} +export interface QuerySubspacesRequestProtoMsg { + typeUrl: "/cosmos.params.v1beta1.QuerySubspacesRequest"; + value: Uint8Array; +} +/** + * QuerySubspacesRequest defines a request type for querying for all registered + * subspaces and all keys for a subspace. + * + * Since: cosmos-sdk 0.46 + */ +export interface QuerySubspacesRequestAmino {} +export interface QuerySubspacesRequestAminoMsg { + type: "cosmos-sdk/QuerySubspacesRequest"; + value: QuerySubspacesRequestAmino; +} +/** + * QuerySubspacesRequest defines a request type for querying for all registered + * subspaces and all keys for a subspace. + * + * Since: cosmos-sdk 0.46 + */ +export interface QuerySubspacesRequestSDKType {} +/** + * QuerySubspacesResponse defines the response types for querying for all + * registered subspaces and all keys for a subspace. + * + * Since: cosmos-sdk 0.46 + */ +export interface QuerySubspacesResponse { + subspaces: Subspace[]; +} +export interface QuerySubspacesResponseProtoMsg { + typeUrl: "/cosmos.params.v1beta1.QuerySubspacesResponse"; + value: Uint8Array; +} +/** + * QuerySubspacesResponse defines the response types for querying for all + * registered subspaces and all keys for a subspace. + * + * Since: cosmos-sdk 0.46 + */ +export interface QuerySubspacesResponseAmino { + subspaces?: SubspaceAmino[]; +} +export interface QuerySubspacesResponseAminoMsg { + type: "cosmos-sdk/QuerySubspacesResponse"; + value: QuerySubspacesResponseAmino; +} +/** + * QuerySubspacesResponse defines the response types for querying for all + * registered subspaces and all keys for a subspace. + * + * Since: cosmos-sdk 0.46 + */ +export interface QuerySubspacesResponseSDKType { + subspaces: SubspaceSDKType[]; +} +/** + * Subspace defines a parameter subspace name and all the keys that exist for + * the subspace. + * + * Since: cosmos-sdk 0.46 + */ +export interface Subspace { + subspace: string; + keys: string[]; +} +export interface SubspaceProtoMsg { + typeUrl: "/cosmos.params.v1beta1.Subspace"; + value: Uint8Array; +} +/** + * Subspace defines a parameter subspace name and all the keys that exist for + * the subspace. + * + * Since: cosmos-sdk 0.46 + */ +export interface SubspaceAmino { + subspace?: string; + keys?: string[]; +} +export interface SubspaceAminoMsg { + type: "cosmos-sdk/Subspace"; + value: SubspaceAmino; +} +/** + * Subspace defines a parameter subspace name and all the keys that exist for + * the subspace. + * + * Since: cosmos-sdk 0.46 + */ +export interface SubspaceSDKType { + subspace: string; + keys: string[]; +} +function createBaseQueryParamsRequest(): QueryParamsRequest { + return { + subspace: "", + key: "" + }; +} +export const QueryParamsRequest = { + typeUrl: "/cosmos.params.v1beta1.QueryParamsRequest", + aminoType: "cosmos-sdk/QueryParamsRequest", + is(o: any): o is QueryParamsRequest { + return o && (o.$typeUrl === QueryParamsRequest.typeUrl || typeof o.subspace === "string" && typeof o.key === "string"); + }, + isSDK(o: any): o is QueryParamsRequestSDKType { + return o && (o.$typeUrl === QueryParamsRequest.typeUrl || typeof o.subspace === "string" && typeof o.key === "string"); + }, + isAmino(o: any): o is QueryParamsRequestAmino { + return o && (o.$typeUrl === QueryParamsRequest.typeUrl || typeof o.subspace === "string" && typeof o.key === "string"); + }, + encode(message: QueryParamsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.subspace !== "") { + writer.uint32(10).string(message.subspace); + } + if (message.key !== "") { + writer.uint32(18).string(message.key); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryParamsRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryParamsRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.subspace = reader.string(); + break; + case 2: + message.key = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + 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; + }, + fromPartial(object: Partial): QueryParamsRequest { + const message = createBaseQueryParamsRequest(); + message.subspace = object.subspace ?? ""; + message.key = object.key ?? ""; + return message; + }, + fromAmino(object: QueryParamsRequestAmino): QueryParamsRequest { + const message = createBaseQueryParamsRequest(); + if (object.subspace !== undefined && object.subspace !== null) { + message.subspace = object.subspace; + } + if (object.key !== undefined && object.key !== null) { + message.key = object.key; + } + return message; + }, + toAmino(message: QueryParamsRequest): QueryParamsRequestAmino { + const obj: any = {}; + obj.subspace = message.subspace; + obj.key = message.key; + return obj; + }, + fromAminoMsg(object: QueryParamsRequestAminoMsg): QueryParamsRequest { + return QueryParamsRequest.fromAmino(object.value); + }, + toAminoMsg(message: QueryParamsRequest): QueryParamsRequestAminoMsg { + return { + type: "cosmos-sdk/QueryParamsRequest", + value: QueryParamsRequest.toAmino(message) + }; + }, + fromProtoMsg(message: QueryParamsRequestProtoMsg): QueryParamsRequest { + return QueryParamsRequest.decode(message.value); + }, + toProto(message: QueryParamsRequest): Uint8Array { + return QueryParamsRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryParamsRequest): QueryParamsRequestProtoMsg { + return { + typeUrl: "/cosmos.params.v1beta1.QueryParamsRequest", + value: QueryParamsRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryParamsRequest.typeUrl, QueryParamsRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryParamsRequest.aminoType, QueryParamsRequest.typeUrl); +function createBaseQueryParamsResponse(): QueryParamsResponse { + return { + param: ParamChange.fromPartial({}) + }; +} +export const QueryParamsResponse = { + typeUrl: "/cosmos.params.v1beta1.QueryParamsResponse", + aminoType: "cosmos-sdk/QueryParamsResponse", + is(o: any): o is QueryParamsResponse { + return o && (o.$typeUrl === QueryParamsResponse.typeUrl || ParamChange.is(o.param)); + }, + isSDK(o: any): o is QueryParamsResponseSDKType { + return o && (o.$typeUrl === QueryParamsResponse.typeUrl || ParamChange.isSDK(o.param)); + }, + isAmino(o: any): o is QueryParamsResponseAmino { + return o && (o.$typeUrl === QueryParamsResponse.typeUrl || ParamChange.isAmino(o.param)); + }, + encode(message: QueryParamsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.param !== undefined) { + ParamChange.encode(message.param, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryParamsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryParamsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.param = ParamChange.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): QueryParamsResponse { + 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; + }, + fromPartial(object: Partial): QueryParamsResponse { + const message = createBaseQueryParamsResponse(); + message.param = object.param !== undefined && object.param !== null ? ParamChange.fromPartial(object.param) : undefined; + return message; + }, + fromAmino(object: QueryParamsResponseAmino): QueryParamsResponse { + const message = createBaseQueryParamsResponse(); + if (object.param !== undefined && object.param !== null) { + message.param = ParamChange.fromAmino(object.param); + } + return message; + }, + toAmino(message: QueryParamsResponse): QueryParamsResponseAmino { + const obj: any = {}; + obj.param = message.param ? ParamChange.toAmino(message.param) : ParamChange.fromPartial({}); + return obj; + }, + fromAminoMsg(object: QueryParamsResponseAminoMsg): QueryParamsResponse { + return QueryParamsResponse.fromAmino(object.value); + }, + toAminoMsg(message: QueryParamsResponse): QueryParamsResponseAminoMsg { + return { + type: "cosmos-sdk/QueryParamsResponse", + value: QueryParamsResponse.toAmino(message) + }; + }, + fromProtoMsg(message: QueryParamsResponseProtoMsg): QueryParamsResponse { + return QueryParamsResponse.decode(message.value); + }, + toProto(message: QueryParamsResponse): Uint8Array { + return QueryParamsResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryParamsResponse): QueryParamsResponseProtoMsg { + return { + typeUrl: "/cosmos.params.v1beta1.QueryParamsResponse", + value: QueryParamsResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryParamsResponse.typeUrl, QueryParamsResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryParamsResponse.aminoType, QueryParamsResponse.typeUrl); +function createBaseQuerySubspacesRequest(): QuerySubspacesRequest { + return {}; +} +export const QuerySubspacesRequest = { + typeUrl: "/cosmos.params.v1beta1.QuerySubspacesRequest", + aminoType: "cosmos-sdk/QuerySubspacesRequest", + is(o: any): o is QuerySubspacesRequest { + return o && o.$typeUrl === QuerySubspacesRequest.typeUrl; + }, + isSDK(o: any): o is QuerySubspacesRequestSDKType { + return o && o.$typeUrl === QuerySubspacesRequest.typeUrl; + }, + isAmino(o: any): o is QuerySubspacesRequestAmino { + return o && o.$typeUrl === QuerySubspacesRequest.typeUrl; + }, + encode(_: QuerySubspacesRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QuerySubspacesRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQuerySubspacesRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(_: any): QuerySubspacesRequest { + return {}; + }, + toJSON(_: QuerySubspacesRequest): unknown { + const obj: any = {}; + return obj; + }, + fromPartial(_: Partial): QuerySubspacesRequest { + const message = createBaseQuerySubspacesRequest(); + return message; + }, + fromAmino(_: QuerySubspacesRequestAmino): QuerySubspacesRequest { + const message = createBaseQuerySubspacesRequest(); + return message; + }, + toAmino(_: QuerySubspacesRequest): QuerySubspacesRequestAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: QuerySubspacesRequestAminoMsg): QuerySubspacesRequest { + return QuerySubspacesRequest.fromAmino(object.value); + }, + toAminoMsg(message: QuerySubspacesRequest): QuerySubspacesRequestAminoMsg { + return { + type: "cosmos-sdk/QuerySubspacesRequest", + value: QuerySubspacesRequest.toAmino(message) + }; + }, + fromProtoMsg(message: QuerySubspacesRequestProtoMsg): QuerySubspacesRequest { + return QuerySubspacesRequest.decode(message.value); + }, + toProto(message: QuerySubspacesRequest): Uint8Array { + return QuerySubspacesRequest.encode(message).finish(); + }, + toProtoMsg(message: QuerySubspacesRequest): QuerySubspacesRequestProtoMsg { + return { + typeUrl: "/cosmos.params.v1beta1.QuerySubspacesRequest", + value: QuerySubspacesRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QuerySubspacesRequest.typeUrl, QuerySubspacesRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(QuerySubspacesRequest.aminoType, QuerySubspacesRequest.typeUrl); +function createBaseQuerySubspacesResponse(): QuerySubspacesResponse { + return { + subspaces: [] + }; +} +export const QuerySubspacesResponse = { + typeUrl: "/cosmos.params.v1beta1.QuerySubspacesResponse", + aminoType: "cosmos-sdk/QuerySubspacesResponse", + is(o: any): o is QuerySubspacesResponse { + return o && (o.$typeUrl === QuerySubspacesResponse.typeUrl || Array.isArray(o.subspaces) && (!o.subspaces.length || Subspace.is(o.subspaces[0]))); + }, + isSDK(o: any): o is QuerySubspacesResponseSDKType { + return o && (o.$typeUrl === QuerySubspacesResponse.typeUrl || Array.isArray(o.subspaces) && (!o.subspaces.length || Subspace.isSDK(o.subspaces[0]))); + }, + isAmino(o: any): o is QuerySubspacesResponseAmino { + return o && (o.$typeUrl === QuerySubspacesResponse.typeUrl || Array.isArray(o.subspaces) && (!o.subspaces.length || Subspace.isAmino(o.subspaces[0]))); + }, + encode(message: QuerySubspacesResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.subspaces) { + Subspace.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QuerySubspacesResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQuerySubspacesResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.subspaces.push(Subspace.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): QuerySubspacesResponse { + return { + subspaces: Array.isArray(object?.subspaces) ? object.subspaces.map((e: any) => Subspace.fromJSON(e)) : [] + }; + }, + toJSON(message: QuerySubspacesResponse): unknown { + const obj: any = {}; + if (message.subspaces) { + obj.subspaces = message.subspaces.map(e => e ? Subspace.toJSON(e) : undefined); + } else { + obj.subspaces = []; + } + return obj; + }, + fromPartial(object: Partial): QuerySubspacesResponse { + const message = createBaseQuerySubspacesResponse(); + message.subspaces = object.subspaces?.map(e => Subspace.fromPartial(e)) || []; + return message; + }, + fromAmino(object: QuerySubspacesResponseAmino): QuerySubspacesResponse { + const message = createBaseQuerySubspacesResponse(); + message.subspaces = object.subspaces?.map(e => Subspace.fromAmino(e)) || []; + return message; + }, + toAmino(message: QuerySubspacesResponse): QuerySubspacesResponseAmino { + const obj: any = {}; + if (message.subspaces) { + obj.subspaces = message.subspaces.map(e => e ? Subspace.toAmino(e) : undefined); + } else { + obj.subspaces = []; + } + return obj; + }, + fromAminoMsg(object: QuerySubspacesResponseAminoMsg): QuerySubspacesResponse { + return QuerySubspacesResponse.fromAmino(object.value); + }, + toAminoMsg(message: QuerySubspacesResponse): QuerySubspacesResponseAminoMsg { + return { + type: "cosmos-sdk/QuerySubspacesResponse", + value: QuerySubspacesResponse.toAmino(message) + }; + }, + fromProtoMsg(message: QuerySubspacesResponseProtoMsg): QuerySubspacesResponse { + return QuerySubspacesResponse.decode(message.value); + }, + toProto(message: QuerySubspacesResponse): Uint8Array { + return QuerySubspacesResponse.encode(message).finish(); + }, + toProtoMsg(message: QuerySubspacesResponse): QuerySubspacesResponseProtoMsg { + return { + typeUrl: "/cosmos.params.v1beta1.QuerySubspacesResponse", + value: QuerySubspacesResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QuerySubspacesResponse.typeUrl, QuerySubspacesResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(QuerySubspacesResponse.aminoType, QuerySubspacesResponse.typeUrl); +function createBaseSubspace(): Subspace { + return { + subspace: "", + keys: [] + }; +} +export const Subspace = { + typeUrl: "/cosmos.params.v1beta1.Subspace", + aminoType: "cosmos-sdk/Subspace", + is(o: any): o is Subspace { + return o && (o.$typeUrl === Subspace.typeUrl || typeof o.subspace === "string" && Array.isArray(o.keys) && (!o.keys.length || typeof o.keys[0] === "string")); + }, + isSDK(o: any): o is SubspaceSDKType { + return o && (o.$typeUrl === Subspace.typeUrl || typeof o.subspace === "string" && Array.isArray(o.keys) && (!o.keys.length || typeof o.keys[0] === "string")); + }, + isAmino(o: any): o is SubspaceAmino { + return o && (o.$typeUrl === Subspace.typeUrl || typeof o.subspace === "string" && Array.isArray(o.keys) && (!o.keys.length || typeof o.keys[0] === "string")); + }, + encode(message: Subspace, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.subspace !== "") { + writer.uint32(10).string(message.subspace); + } + for (const v of message.keys) { + writer.uint32(18).string(v!); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): Subspace { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSubspace(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.subspace = reader.string(); + break; + case 2: + message.keys.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): Subspace { + return { + subspace: isSet(object.subspace) ? String(object.subspace) : "", + keys: Array.isArray(object?.keys) ? object.keys.map((e: any) => String(e)) : [] + }; + }, + toJSON(message: Subspace): unknown { + const obj: any = {}; + message.subspace !== undefined && (obj.subspace = message.subspace); + if (message.keys) { + obj.keys = message.keys.map(e => e); + } else { + obj.keys = []; + } + return obj; + }, + fromPartial(object: Partial): Subspace { + const message = createBaseSubspace(); + message.subspace = object.subspace ?? ""; + message.keys = object.keys?.map(e => e) || []; + return message; + }, + fromAmino(object: SubspaceAmino): Subspace { + const message = createBaseSubspace(); + if (object.subspace !== undefined && object.subspace !== null) { + message.subspace = object.subspace; + } + message.keys = object.keys?.map(e => e) || []; + return message; + }, + toAmino(message: Subspace): SubspaceAmino { + const obj: any = {}; + obj.subspace = message.subspace; + if (message.keys) { + obj.keys = message.keys.map(e => e); + } else { + obj.keys = []; + } + return obj; + }, + fromAminoMsg(object: SubspaceAminoMsg): Subspace { + return Subspace.fromAmino(object.value); + }, + toAminoMsg(message: Subspace): SubspaceAminoMsg { + return { + type: "cosmos-sdk/Subspace", + value: Subspace.toAmino(message) + }; + }, + fromProtoMsg(message: SubspaceProtoMsg): Subspace { + return Subspace.decode(message.value); + }, + toProto(message: Subspace): Uint8Array { + return Subspace.encode(message).finish(); + }, + toProtoMsg(message: Subspace): SubspaceProtoMsg { + return { + typeUrl: "/cosmos.params.v1beta1.Subspace", + value: Subspace.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(Subspace.typeUrl, Subspace); +GlobalDecoderRegistry.registerAminoProtoMapping(Subspace.aminoType, Subspace.typeUrl); \ No newline at end of file diff --git a/packages/osmojs/src/codegen/cosmos/query/v1/query.ts b/packages/osmojs/src/codegen/cosmos/query/v1/query.ts new file mode 100644 index 000000000..693da49fc --- /dev/null +++ b/packages/osmojs/src/codegen/cosmos/query/v1/query.ts @@ -0,0 +1 @@ +export {} \ No newline at end of file diff --git a/packages/osmojs/src/codegen/cosmos/reflection/v1/reflection.ts b/packages/osmojs/src/codegen/cosmos/reflection/v1/reflection.ts new file mode 100644 index 000000000..f4e098686 --- /dev/null +++ b/packages/osmojs/src/codegen/cosmos/reflection/v1/reflection.ts @@ -0,0 +1,211 @@ +import { FileDescriptorProto, FileDescriptorProtoAmino, FileDescriptorProtoSDKType } from "../../../google/protobuf/descriptor"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { GlobalDecoderRegistry } from "../../../registry"; +/** FileDescriptorsRequest is the Query/FileDescriptors request type. */ +export interface FileDescriptorsRequest {} +export interface FileDescriptorsRequestProtoMsg { + typeUrl: "/cosmos.reflection.v1.FileDescriptorsRequest"; + value: Uint8Array; +} +/** FileDescriptorsRequest is the Query/FileDescriptors request type. */ +export interface FileDescriptorsRequestAmino {} +export interface FileDescriptorsRequestAminoMsg { + type: "cosmos-sdk/FileDescriptorsRequest"; + value: FileDescriptorsRequestAmino; +} +/** FileDescriptorsRequest is the Query/FileDescriptors request type. */ +export interface FileDescriptorsRequestSDKType {} +/** FileDescriptorsResponse is the Query/FileDescriptors response type. */ +export interface FileDescriptorsResponse { + /** files is the file descriptors. */ + files: FileDescriptorProto[]; +} +export interface FileDescriptorsResponseProtoMsg { + typeUrl: "/cosmos.reflection.v1.FileDescriptorsResponse"; + value: Uint8Array; +} +/** FileDescriptorsResponse is the Query/FileDescriptors response type. */ +export interface FileDescriptorsResponseAmino { + /** files is the file descriptors. */ + files?: FileDescriptorProtoAmino[]; +} +export interface FileDescriptorsResponseAminoMsg { + type: "cosmos-sdk/FileDescriptorsResponse"; + value: FileDescriptorsResponseAmino; +} +/** FileDescriptorsResponse is the Query/FileDescriptors response type. */ +export interface FileDescriptorsResponseSDKType { + files: FileDescriptorProtoSDKType[]; +} +function createBaseFileDescriptorsRequest(): FileDescriptorsRequest { + return {}; +} +export const FileDescriptorsRequest = { + typeUrl: "/cosmos.reflection.v1.FileDescriptorsRequest", + aminoType: "cosmos-sdk/FileDescriptorsRequest", + is(o: any): o is FileDescriptorsRequest { + return o && o.$typeUrl === FileDescriptorsRequest.typeUrl; + }, + isSDK(o: any): o is FileDescriptorsRequestSDKType { + return o && o.$typeUrl === FileDescriptorsRequest.typeUrl; + }, + isAmino(o: any): o is FileDescriptorsRequestAmino { + return o && o.$typeUrl === FileDescriptorsRequest.typeUrl; + }, + encode(_: FileDescriptorsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): FileDescriptorsRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseFileDescriptorsRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(_: any): FileDescriptorsRequest { + return {}; + }, + toJSON(_: FileDescriptorsRequest): unknown { + const obj: any = {}; + return obj; + }, + fromPartial(_: Partial): FileDescriptorsRequest { + const message = createBaseFileDescriptorsRequest(); + return message; + }, + fromAmino(_: FileDescriptorsRequestAmino): FileDescriptorsRequest { + const message = createBaseFileDescriptorsRequest(); + return message; + }, + toAmino(_: FileDescriptorsRequest): FileDescriptorsRequestAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: FileDescriptorsRequestAminoMsg): FileDescriptorsRequest { + return FileDescriptorsRequest.fromAmino(object.value); + }, + toAminoMsg(message: FileDescriptorsRequest): FileDescriptorsRequestAminoMsg { + return { + type: "cosmos-sdk/FileDescriptorsRequest", + value: FileDescriptorsRequest.toAmino(message) + }; + }, + fromProtoMsg(message: FileDescriptorsRequestProtoMsg): FileDescriptorsRequest { + return FileDescriptorsRequest.decode(message.value); + }, + toProto(message: FileDescriptorsRequest): Uint8Array { + return FileDescriptorsRequest.encode(message).finish(); + }, + toProtoMsg(message: FileDescriptorsRequest): FileDescriptorsRequestProtoMsg { + return { + typeUrl: "/cosmos.reflection.v1.FileDescriptorsRequest", + value: FileDescriptorsRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(FileDescriptorsRequest.typeUrl, FileDescriptorsRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(FileDescriptorsRequest.aminoType, FileDescriptorsRequest.typeUrl); +function createBaseFileDescriptorsResponse(): FileDescriptorsResponse { + return { + files: [] + }; +} +export const FileDescriptorsResponse = { + typeUrl: "/cosmos.reflection.v1.FileDescriptorsResponse", + aminoType: "cosmos-sdk/FileDescriptorsResponse", + is(o: any): o is FileDescriptorsResponse { + return o && (o.$typeUrl === FileDescriptorsResponse.typeUrl || Array.isArray(o.files) && (!o.files.length || FileDescriptorProto.is(o.files[0]))); + }, + isSDK(o: any): o is FileDescriptorsResponseSDKType { + return o && (o.$typeUrl === FileDescriptorsResponse.typeUrl || Array.isArray(o.files) && (!o.files.length || FileDescriptorProto.isSDK(o.files[0]))); + }, + isAmino(o: any): o is FileDescriptorsResponseAmino { + return o && (o.$typeUrl === FileDescriptorsResponse.typeUrl || Array.isArray(o.files) && (!o.files.length || FileDescriptorProto.isAmino(o.files[0]))); + }, + encode(message: FileDescriptorsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.files) { + FileDescriptorProto.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): FileDescriptorsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseFileDescriptorsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.files.push(FileDescriptorProto.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): FileDescriptorsResponse { + return { + files: Array.isArray(object?.files) ? object.files.map((e: any) => FileDescriptorProto.fromJSON(e)) : [] + }; + }, + toJSON(message: FileDescriptorsResponse): unknown { + const obj: any = {}; + if (message.files) { + obj.files = message.files.map(e => e ? FileDescriptorProto.toJSON(e) : undefined); + } else { + obj.files = []; + } + return obj; + }, + fromPartial(object: Partial): FileDescriptorsResponse { + const message = createBaseFileDescriptorsResponse(); + message.files = object.files?.map(e => FileDescriptorProto.fromPartial(e)) || []; + return message; + }, + fromAmino(object: FileDescriptorsResponseAmino): FileDescriptorsResponse { + const message = createBaseFileDescriptorsResponse(); + message.files = object.files?.map(e => FileDescriptorProto.fromAmino(e)) || []; + return message; + }, + toAmino(message: FileDescriptorsResponse): FileDescriptorsResponseAmino { + const obj: any = {}; + if (message.files) { + obj.files = message.files.map(e => e ? FileDescriptorProto.toAmino(e) : undefined); + } else { + obj.files = []; + } + return obj; + }, + fromAminoMsg(object: FileDescriptorsResponseAminoMsg): FileDescriptorsResponse { + return FileDescriptorsResponse.fromAmino(object.value); + }, + toAminoMsg(message: FileDescriptorsResponse): FileDescriptorsResponseAminoMsg { + return { + type: "cosmos-sdk/FileDescriptorsResponse", + value: FileDescriptorsResponse.toAmino(message) + }; + }, + fromProtoMsg(message: FileDescriptorsResponseProtoMsg): FileDescriptorsResponse { + return FileDescriptorsResponse.decode(message.value); + }, + toProto(message: FileDescriptorsResponse): Uint8Array { + return FileDescriptorsResponse.encode(message).finish(); + }, + toProtoMsg(message: FileDescriptorsResponse): FileDescriptorsResponseProtoMsg { + return { + typeUrl: "/cosmos.reflection.v1.FileDescriptorsResponse", + value: FileDescriptorsResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(FileDescriptorsResponse.typeUrl, FileDescriptorsResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(FileDescriptorsResponse.aminoType, FileDescriptorsResponse.typeUrl); \ No newline at end of file diff --git a/packages/osmojs/src/codegen/cosmos/rpc.query.ts b/packages/osmojs/src/codegen/cosmos/rpc.query.ts index fac7811fe..9bddf84c6 100644 --- a/packages/osmojs/src/codegen/cosmos/rpc.query.ts +++ b/packages/osmojs/src/codegen/cosmos/rpc.query.ts @@ -1,4 +1,4 @@ -import { HttpEndpoint, connectComet } from "@cosmjs/tendermint-rpc"; +import { connectComet, HttpEndpoint } from "@cosmjs/tendermint-rpc"; import { QueryClient } from "@cosmjs/stargate"; export const createRPCQueryClient = async ({ rpcEndpoint @@ -23,12 +23,23 @@ export const createRPCQueryClient = async ({ v1beta1: (await import("./base/node/v1beta1/query.rpc.Service")).createRpcQueryExtension(client) } }, + consensus: { + v1: (await import("./consensus/v1/query.rpc.Query")).createRpcQueryExtension(client) + }, distribution: { v1beta1: (await import("./distribution/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) }, gov: { v1beta1: (await import("./gov/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) }, + orm: { + query: { + v1alpha1: (await import("./orm/query/v1alpha1/query.rpc.Query")).createRpcQueryExtension(client) + } + }, + params: { + v1beta1: (await import("./params/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) + }, staking: { v1beta1: (await import("./staking/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) }, diff --git a/packages/osmojs/src/codegen/cosmos/rpc.tx.ts b/packages/osmojs/src/codegen/cosmos/rpc.tx.ts index 61ff2464b..8587d8013 100644 --- a/packages/osmojs/src/codegen/cosmos/rpc.tx.ts +++ b/packages/osmojs/src/codegen/cosmos/rpc.tx.ts @@ -5,12 +5,18 @@ export const createRPCMsgClient = async ({ rpc: Rpc; }) => ({ cosmos: { + auth: { + v1beta1: new (await import("./auth/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) + }, authz: { v1beta1: new (await import("./authz/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) }, bank: { v1beta1: new (await import("./bank/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) }, + consensus: { + v1: new (await import("./consensus/v1/tx.rpc.msg")).MsgClientImpl(rpc) + }, distribution: { v1beta1: new (await import("./distribution/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) }, @@ -19,6 +25,9 @@ export const createRPCMsgClient = async ({ }, staking: { v1beta1: new (await import("./staking/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) + }, + upgrade: { + v1beta1: new (await import("./upgrade/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) } } }); \ No newline at end of file diff --git a/packages/osmojs/src/codegen/cosmos/staking/v1beta1/authz.ts b/packages/osmojs/src/codegen/cosmos/staking/v1beta1/authz.ts index 1b23b5425..10e88928a 100644 --- a/packages/osmojs/src/codegen/cosmos/staking/v1beta1/authz.ts +++ b/packages/osmojs/src/codegen/cosmos/staking/v1beta1/authz.ts @@ -1,6 +1,7 @@ import { Coin, CoinAmino, CoinSDKType } from "../../base/v1beta1/coin"; -import { BinaryReader, BinaryWriter } from "../../../binary"; import { isSet } from "../../../helpers"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { GlobalDecoderRegistry } from "../../../registry"; /** * AuthorizationType defines the type of staking module authorization type * @@ -60,12 +61,12 @@ export function authorizationTypeToJSON(object: AuthorizationType): string { * Since: cosmos-sdk 0.43 */ export interface StakeAuthorization { - $typeUrl?: string; + $typeUrl?: "/cosmos.staking.v1beta1.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. @@ -99,7 +100,7 @@ export interface StakeAuthorizationAmino { /** deny_list specifies list of validator addresses to whom grantee can not delegate tokens. */ deny_list?: StakeAuthorization_ValidatorsAmino; /** authorization_type defines one of AuthorizationType. */ - authorization_type: AuthorizationType; + authorization_type?: AuthorizationType; } export interface StakeAuthorizationAminoMsg { type: "cosmos-sdk/StakeAuthorization"; @@ -111,8 +112,8 @@ export interface StakeAuthorizationAminoMsg { * Since: cosmos-sdk 0.43 */ export interface StakeAuthorizationSDKType { - $typeUrl?: string; - max_tokens: CoinSDKType; + $typeUrl?: "/cosmos.staking.v1beta1.StakeAuthorization"; + max_tokens?: CoinSDKType; allow_list?: StakeAuthorization_ValidatorsSDKType; deny_list?: StakeAuthorization_ValidatorsSDKType; authorization_type: AuthorizationType; @@ -127,7 +128,7 @@ export interface StakeAuthorization_ValidatorsProtoMsg { } /** Validators defines list of validator addresses. */ export interface StakeAuthorization_ValidatorsAmino { - address: string[]; + address?: string[]; } export interface StakeAuthorization_ValidatorsAminoMsg { type: "cosmos-sdk/Validators"; @@ -148,6 +149,16 @@ function createBaseStakeAuthorization(): StakeAuthorization { } export const StakeAuthorization = { typeUrl: "/cosmos.staking.v1beta1.StakeAuthorization", + aminoType: "cosmos-sdk/StakeAuthorization", + is(o: any): o is StakeAuthorization { + return o && (o.$typeUrl === StakeAuthorization.typeUrl || isSet(o.authorizationType)); + }, + isSDK(o: any): o is StakeAuthorizationSDKType { + return o && (o.$typeUrl === StakeAuthorization.typeUrl || isSet(o.authorization_type)); + }, + isAmino(o: any): o is StakeAuthorizationAmino { + return o && (o.$typeUrl === StakeAuthorization.typeUrl || isSet(o.authorization_type)); + }, encode(message: StakeAuthorization, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.maxTokens !== undefined) { Coin.encode(message.maxTokens, writer.uint32(10).fork()).ldelim(); @@ -189,6 +200,22 @@ export const StakeAuthorization = { } 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) : -1 + }; + }, + toJSON(message: StakeAuthorization): unknown { + 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); + message.denyList !== undefined && (obj.denyList = message.denyList ? StakeAuthorization_Validators.toJSON(message.denyList) : undefined); + message.authorizationType !== undefined && (obj.authorizationType = authorizationTypeToJSON(message.authorizationType)); + return obj; + }, fromPartial(object: Partial): StakeAuthorization { const message = createBaseStakeAuthorization(); message.maxTokens = object.maxTokens !== undefined && object.maxTokens !== null ? Coin.fromPartial(object.maxTokens) : undefined; @@ -198,19 +225,27 @@ export const StakeAuthorization = { return message; }, fromAmino(object: StakeAuthorizationAmino): StakeAuthorization { - return { - maxTokens: object?.max_tokens ? Coin.fromAmino(object.max_tokens) : undefined, - allowList: object?.allow_list ? StakeAuthorization_Validators.fromAmino(object.allow_list) : undefined, - denyList: object?.deny_list ? StakeAuthorization_Validators.fromAmino(object.deny_list) : undefined, - authorizationType: isSet(object.authorization_type) ? authorizationTypeFromJSON(object.authorization_type) : -1 - }; + const message = createBaseStakeAuthorization(); + if (object.max_tokens !== undefined && object.max_tokens !== null) { + message.maxTokens = Coin.fromAmino(object.max_tokens); + } + if (object.allow_list !== undefined && object.allow_list !== null) { + message.allowList = StakeAuthorization_Validators.fromAmino(object.allow_list); + } + if (object.deny_list !== undefined && object.deny_list !== null) { + message.denyList = StakeAuthorization_Validators.fromAmino(object.deny_list); + } + if (object.authorization_type !== undefined && object.authorization_type !== null) { + message.authorizationType = authorizationTypeFromJSON(object.authorization_type); + } + return message; }, toAmino(message: StakeAuthorization): StakeAuthorizationAmino { const obj: any = {}; obj.max_tokens = message.maxTokens ? Coin.toAmino(message.maxTokens) : undefined; obj.allow_list = message.allowList ? StakeAuthorization_Validators.toAmino(message.allowList) : undefined; obj.deny_list = message.denyList ? StakeAuthorization_Validators.toAmino(message.denyList) : undefined; - obj.authorization_type = message.authorizationType; + obj.authorization_type = authorizationTypeToJSON(message.authorizationType); return obj; }, fromAminoMsg(object: StakeAuthorizationAminoMsg): StakeAuthorization { @@ -235,6 +270,8 @@ export const StakeAuthorization = { }; } }; +GlobalDecoderRegistry.register(StakeAuthorization.typeUrl, StakeAuthorization); +GlobalDecoderRegistry.registerAminoProtoMapping(StakeAuthorization.aminoType, StakeAuthorization.typeUrl); function createBaseStakeAuthorization_Validators(): StakeAuthorization_Validators { return { address: [] @@ -242,6 +279,16 @@ function createBaseStakeAuthorization_Validators(): StakeAuthorization_Validator } export const StakeAuthorization_Validators = { typeUrl: "/cosmos.staking.v1beta1.Validators", + aminoType: "cosmos-sdk/Validators", + is(o: any): o is StakeAuthorization_Validators { + return o && (o.$typeUrl === StakeAuthorization_Validators.typeUrl || Array.isArray(o.address) && (!o.address.length || typeof o.address[0] === "string")); + }, + isSDK(o: any): o is StakeAuthorization_ValidatorsSDKType { + return o && (o.$typeUrl === StakeAuthorization_Validators.typeUrl || Array.isArray(o.address) && (!o.address.length || typeof o.address[0] === "string")); + }, + isAmino(o: any): o is StakeAuthorization_ValidatorsAmino { + return o && (o.$typeUrl === StakeAuthorization_Validators.typeUrl || Array.isArray(o.address) && (!o.address.length || typeof o.address[0] === "string")); + }, encode(message: StakeAuthorization_Validators, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.address) { writer.uint32(10).string(v!); @@ -265,15 +312,29 @@ export const StakeAuthorization_Validators = { } return message; }, + fromJSON(object: any): StakeAuthorization_Validators { + return { + address: Array.isArray(object?.address) ? object.address.map((e: any) => String(e)) : [] + }; + }, + toJSON(message: StakeAuthorization_Validators): unknown { + const obj: any = {}; + if (message.address) { + obj.address = message.address.map(e => e); + } else { + obj.address = []; + } + return obj; + }, fromPartial(object: Partial): StakeAuthorization_Validators { const message = createBaseStakeAuthorization_Validators(); message.address = object.address?.map(e => e) || []; return message; }, fromAmino(object: StakeAuthorization_ValidatorsAmino): StakeAuthorization_Validators { - return { - address: Array.isArray(object?.address) ? object.address.map((e: any) => e) : [] - }; + const message = createBaseStakeAuthorization_Validators(); + message.address = object.address?.map(e => e) || []; + return message; }, toAmino(message: StakeAuthorization_Validators): StakeAuthorization_ValidatorsAmino { const obj: any = {}; @@ -305,4 +366,6 @@ export const StakeAuthorization_Validators = { value: StakeAuthorization_Validators.encode(message).finish() }; } -}; \ No newline at end of file +}; +GlobalDecoderRegistry.register(StakeAuthorization_Validators.typeUrl, StakeAuthorization_Validators); +GlobalDecoderRegistry.registerAminoProtoMapping(StakeAuthorization_Validators.aminoType, StakeAuthorization_Validators.typeUrl); \ No newline at end of file diff --git a/packages/osmojs/src/codegen/cosmos/staking/v1beta1/genesis.ts b/packages/osmojs/src/codegen/cosmos/staking/v1beta1/genesis.ts index 9470bea30..63d46bf30 100644 --- a/packages/osmojs/src/codegen/cosmos/staking/v1beta1/genesis.ts +++ b/packages/osmojs/src/codegen/cosmos/staking/v1beta1/genesis.ts @@ -1,8 +1,10 @@ import { Params, ParamsAmino, ParamsSDKType, Validator, ValidatorAmino, ValidatorSDKType, Delegation, DelegationAmino, DelegationSDKType, UnbondingDelegation, UnbondingDelegationAmino, UnbondingDelegationSDKType, Redelegation, RedelegationAmino, RedelegationSDKType } from "./staking"; import { BinaryReader, BinaryWriter } from "../../../binary"; +import { isSet, bytesFromBase64, base64FromBytes } from "../../../helpers"; +import { GlobalDecoderRegistry } from "../../../registry"; /** GenesisState defines the staking module's genesis state. */ export interface GenesisState { - /** params defines all the paramaters of related to deposit. */ + /** params defines all the parameters of related to deposit. */ params: Params; /** * last_total_power tracks the total amounts of bonded tokens recorded during @@ -30,13 +32,13 @@ export interface GenesisStateProtoMsg { } /** GenesisState defines the staking module's genesis state. */ export interface GenesisStateAmino { - /** params defines all the paramaters of related to deposit. */ - params?: ParamsAmino; + /** params defines all the parameters of related to deposit. */ + params: ParamsAmino; /** * last_total_power tracks the total amounts of bonded tokens recorded during * the previous end block. */ - last_total_power: Uint8Array; + last_total_power: string; /** * last_validator_powers is a special index that provides a historical list * of the last-block's bonded validators. @@ -50,7 +52,7 @@ export interface GenesisStateAmino { unbonding_delegations: UnbondingDelegationAmino[]; /** redelegations defines the redelegations active at genesis. */ redelegations: RedelegationAmino[]; - exported: boolean; + exported?: boolean; } export interface GenesisStateAminoMsg { type: "cosmos-sdk/GenesisState"; @@ -81,9 +83,9 @@ export interface LastValidatorPowerProtoMsg { /** LastValidatorPower required for validator set update logic. */ export interface LastValidatorPowerAmino { /** address is the address of the validator. */ - address: string; + address?: string; /** power defines the power of the validator. */ - power: string; + power?: string; } export interface LastValidatorPowerAminoMsg { type: "cosmos-sdk/LastValidatorPower"; @@ -108,6 +110,16 @@ function createBaseGenesisState(): GenesisState { } export const GenesisState = { typeUrl: "/cosmos.staking.v1beta1.GenesisState", + aminoType: "cosmos-sdk/GenesisState", + is(o: any): o is GenesisState { + return o && (o.$typeUrl === GenesisState.typeUrl || Params.is(o.params) && (o.lastTotalPower instanceof Uint8Array || typeof o.lastTotalPower === "string") && Array.isArray(o.lastValidatorPowers) && (!o.lastValidatorPowers.length || LastValidatorPower.is(o.lastValidatorPowers[0])) && Array.isArray(o.validators) && (!o.validators.length || Validator.is(o.validators[0])) && Array.isArray(o.delegations) && (!o.delegations.length || Delegation.is(o.delegations[0])) && Array.isArray(o.unbondingDelegations) && (!o.unbondingDelegations.length || UnbondingDelegation.is(o.unbondingDelegations[0])) && Array.isArray(o.redelegations) && (!o.redelegations.length || Redelegation.is(o.redelegations[0])) && typeof o.exported === "boolean"); + }, + isSDK(o: any): o is GenesisStateSDKType { + return o && (o.$typeUrl === GenesisState.typeUrl || Params.isSDK(o.params) && (o.last_total_power instanceof Uint8Array || typeof o.last_total_power === "string") && Array.isArray(o.last_validator_powers) && (!o.last_validator_powers.length || LastValidatorPower.isSDK(o.last_validator_powers[0])) && Array.isArray(o.validators) && (!o.validators.length || Validator.isSDK(o.validators[0])) && Array.isArray(o.delegations) && (!o.delegations.length || Delegation.isSDK(o.delegations[0])) && Array.isArray(o.unbonding_delegations) && (!o.unbonding_delegations.length || UnbondingDelegation.isSDK(o.unbonding_delegations[0])) && Array.isArray(o.redelegations) && (!o.redelegations.length || Redelegation.isSDK(o.redelegations[0])) && typeof o.exported === "boolean"); + }, + isAmino(o: any): o is GenesisStateAmino { + return o && (o.$typeUrl === GenesisState.typeUrl || Params.isAmino(o.params) && (o.last_total_power instanceof Uint8Array || typeof o.last_total_power === "string") && Array.isArray(o.last_validator_powers) && (!o.last_validator_powers.length || LastValidatorPower.isAmino(o.last_validator_powers[0])) && Array.isArray(o.validators) && (!o.validators.length || Validator.isAmino(o.validators[0])) && Array.isArray(o.delegations) && (!o.delegations.length || Delegation.isAmino(o.delegations[0])) && Array.isArray(o.unbonding_delegations) && (!o.unbonding_delegations.length || UnbondingDelegation.isAmino(o.unbonding_delegations[0])) && Array.isArray(o.redelegations) && (!o.redelegations.length || Redelegation.isAmino(o.redelegations[0])) && typeof o.exported === "boolean"); + }, encode(message: GenesisState, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.params !== undefined) { Params.encode(message.params, writer.uint32(10).fork()).ldelim(); @@ -173,6 +185,50 @@ export const GenesisState = { } 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(), + 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)) : [], + unbondingDelegations: Array.isArray(object?.unbondingDelegations) ? object.unbondingDelegations.map((e: any) => UnbondingDelegation.fromJSON(e)) : [], + redelegations: Array.isArray(object?.redelegations) ? 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); + message.lastTotalPower !== undefined && (obj.lastTotalPower = base64FromBytes(message.lastTotalPower !== undefined ? message.lastTotalPower : new Uint8Array())); + if (message.lastValidatorPowers) { + obj.lastValidatorPowers = message.lastValidatorPowers.map(e => e ? LastValidatorPower.toJSON(e) : undefined); + } else { + obj.lastValidatorPowers = []; + } + if (message.validators) { + obj.validators = message.validators.map(e => e ? Validator.toJSON(e) : undefined); + } else { + obj.validators = []; + } + if (message.delegations) { + obj.delegations = message.delegations.map(e => e ? Delegation.toJSON(e) : undefined); + } else { + obj.delegations = []; + } + if (message.unbondingDelegations) { + obj.unbondingDelegations = message.unbondingDelegations.map(e => e ? UnbondingDelegation.toJSON(e) : undefined); + } else { + obj.unbondingDelegations = []; + } + if (message.redelegations) { + obj.redelegations = message.redelegations.map(e => e ? Redelegation.toJSON(e) : undefined); + } else { + obj.redelegations = []; + } + message.exported !== undefined && (obj.exported = message.exported); + return obj; + }, fromPartial(object: Partial): GenesisState { const message = createBaseGenesisState(); message.params = object.params !== undefined && object.params !== null ? Params.fromPartial(object.params) : undefined; @@ -186,21 +242,27 @@ export const GenesisState = { return message; }, fromAmino(object: GenesisStateAmino): GenesisState { - return { - params: object?.params ? Params.fromAmino(object.params) : undefined, - lastTotalPower: object.last_total_power, - lastValidatorPowers: Array.isArray(object?.last_validator_powers) ? object.last_validator_powers.map((e: any) => LastValidatorPower.fromAmino(e)) : [], - validators: Array.isArray(object?.validators) ? object.validators.map((e: any) => Validator.fromAmino(e)) : [], - delegations: Array.isArray(object?.delegations) ? object.delegations.map((e: any) => Delegation.fromAmino(e)) : [], - unbondingDelegations: Array.isArray(object?.unbonding_delegations) ? object.unbonding_delegations.map((e: any) => UnbondingDelegation.fromAmino(e)) : [], - redelegations: Array.isArray(object?.redelegations) ? object.redelegations.map((e: any) => Redelegation.fromAmino(e)) : [], - exported: object.exported - }; + const message = createBaseGenesisState(); + if (object.params !== undefined && object.params !== null) { + message.params = Params.fromAmino(object.params); + } + if (object.last_total_power !== undefined && object.last_total_power !== null) { + message.lastTotalPower = bytesFromBase64(object.last_total_power); + } + message.lastValidatorPowers = object.last_validator_powers?.map(e => LastValidatorPower.fromAmino(e)) || []; + message.validators = object.validators?.map(e => Validator.fromAmino(e)) || []; + message.delegations = object.delegations?.map(e => Delegation.fromAmino(e)) || []; + message.unbondingDelegations = object.unbonding_delegations?.map(e => UnbondingDelegation.fromAmino(e)) || []; + message.redelegations = object.redelegations?.map(e => Redelegation.fromAmino(e)) || []; + if (object.exported !== undefined && object.exported !== null) { + message.exported = object.exported; + } + return message; }, toAmino(message: GenesisState): GenesisStateAmino { const obj: any = {}; - obj.params = message.params ? Params.toAmino(message.params) : undefined; - obj.last_total_power = message.lastTotalPower; + obj.params = message.params ? Params.toAmino(message.params) : Params.fromPartial({}); + obj.last_total_power = message.lastTotalPower ? base64FromBytes(message.lastTotalPower) : ""; if (message.lastValidatorPowers) { obj.last_validator_powers = message.lastValidatorPowers.map(e => e ? LastValidatorPower.toAmino(e) : undefined); } else { @@ -251,6 +313,8 @@ export const GenesisState = { }; } }; +GlobalDecoderRegistry.register(GenesisState.typeUrl, GenesisState); +GlobalDecoderRegistry.registerAminoProtoMapping(GenesisState.aminoType, GenesisState.typeUrl); function createBaseLastValidatorPower(): LastValidatorPower { return { address: "", @@ -259,6 +323,16 @@ function createBaseLastValidatorPower(): LastValidatorPower { } export const LastValidatorPower = { typeUrl: "/cosmos.staking.v1beta1.LastValidatorPower", + aminoType: "cosmos-sdk/LastValidatorPower", + is(o: any): o is LastValidatorPower { + return o && (o.$typeUrl === LastValidatorPower.typeUrl || typeof o.address === "string" && typeof o.power === "bigint"); + }, + isSDK(o: any): o is LastValidatorPowerSDKType { + return o && (o.$typeUrl === LastValidatorPower.typeUrl || typeof o.address === "string" && typeof o.power === "bigint"); + }, + isAmino(o: any): o is LastValidatorPowerAmino { + return o && (o.$typeUrl === LastValidatorPower.typeUrl || typeof o.address === "string" && typeof o.power === "bigint"); + }, encode(message: LastValidatorPower, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.address !== "") { writer.uint32(10).string(message.address); @@ -288,6 +362,18 @@ export const LastValidatorPower = { } return message; }, + fromJSON(object: any): LastValidatorPower { + return { + address: isSet(object.address) ? String(object.address) : "", + power: isSet(object.power) ? BigInt(object.power.toString()) : BigInt(0) + }; + }, + toJSON(message: LastValidatorPower): unknown { + const obj: any = {}; + message.address !== undefined && (obj.address = message.address); + message.power !== undefined && (obj.power = (message.power || BigInt(0)).toString()); + return obj; + }, fromPartial(object: Partial): LastValidatorPower { const message = createBaseLastValidatorPower(); message.address = object.address ?? ""; @@ -295,10 +381,14 @@ export const LastValidatorPower = { return message; }, fromAmino(object: LastValidatorPowerAmino): LastValidatorPower { - return { - address: object.address, - power: BigInt(object.power) - }; + const message = createBaseLastValidatorPower(); + if (object.address !== undefined && object.address !== null) { + message.address = object.address; + } + if (object.power !== undefined && object.power !== null) { + message.power = BigInt(object.power); + } + return message; }, toAmino(message: LastValidatorPower): LastValidatorPowerAmino { const obj: any = {}; @@ -327,4 +417,6 @@ export const LastValidatorPower = { value: LastValidatorPower.encode(message).finish() }; } -}; \ No newline at end of file +}; +GlobalDecoderRegistry.register(LastValidatorPower.typeUrl, LastValidatorPower); +GlobalDecoderRegistry.registerAminoProtoMapping(LastValidatorPower.aminoType, LastValidatorPower.typeUrl); \ No newline at end of file diff --git a/packages/osmojs/src/codegen/cosmos/staking/v1beta1/query.lcd.ts b/packages/osmojs/src/codegen/cosmos/staking/v1beta1/query.lcd.ts index 4ba0b0222..24291aab7 100644 --- a/packages/osmojs/src/codegen/cosmos/staking/v1beta1/query.lcd.ts +++ b/packages/osmojs/src/codegen/cosmos/staking/v1beta1/query.lcd.ts @@ -24,7 +24,10 @@ export class LCDQueryClient { this.pool = this.pool.bind(this); this.params = this.params.bind(this); } - /* Validators queries all validators that match the given status. */ + /* Validators queries all validators that match the given status. + + When called from another module, this query might consume a high amount of + gas if the pagination field is incorrectly set. */ async validators(params: QueryValidatorsRequest): Promise { const options: any = { params: {} @@ -43,7 +46,10 @@ export class LCDQueryClient { const endpoint = `cosmos/staking/v1beta1/validators/${params.validatorAddr}`; return await this.req.get(endpoint); } - /* ValidatorDelegations queries delegate info for given validator. */ + /* ValidatorDelegations queries delegate info for given validator. + + When called from another module, this query might consume a high amount of + gas if the pagination field is incorrectly set. */ async validatorDelegations(params: QueryValidatorDelegationsRequest): Promise { const options: any = { params: {} @@ -54,7 +60,10 @@ export class LCDQueryClient { const endpoint = `cosmos/staking/v1beta1/validators/${params.validatorAddr}/delegations`; return await this.req.get(endpoint, options); } - /* ValidatorUnbondingDelegations queries unbonding delegations of a validator. */ + /* ValidatorUnbondingDelegations queries unbonding delegations of a validator. + + When called from another module, this query might consume a high amount of + gas if the pagination field is incorrectly set. */ async validatorUnbondingDelegations(params: QueryValidatorUnbondingDelegationsRequest): Promise { const options: any = { params: {} @@ -76,7 +85,10 @@ export class LCDQueryClient { const endpoint = `cosmos/staking/v1beta1/validators/${params.validatorAddr}/delegations/${params.delegatorAddr}/unbonding_delegation`; return await this.req.get(endpoint); } - /* DelegatorDelegations queries all delegations of a given delegator address. */ + /* DelegatorDelegations queries all delegations of a given delegator address. + + When called from another module, this query might consume a high amount of + gas if the pagination field is incorrectly set. */ async delegatorDelegations(params: QueryDelegatorDelegationsRequest): Promise { const options: any = { params: {} @@ -88,7 +100,10 @@ export class LCDQueryClient { return await this.req.get(endpoint, options); } /* DelegatorUnbondingDelegations queries all unbonding delegations of a given - delegator address. */ + delegator address. + + When called from another module, this query might consume a high amount of + gas if the pagination field is incorrectly set. */ async delegatorUnbondingDelegations(params: QueryDelegatorUnbondingDelegationsRequest): Promise { const options: any = { params: {} @@ -99,7 +114,10 @@ export class LCDQueryClient { const endpoint = `cosmos/staking/v1beta1/delegators/${params.delegatorAddr}/unbonding_delegations`; return await this.req.get(endpoint, options); } - /* Redelegations queries redelegations of given address. */ + /* Redelegations queries redelegations of given address. + + When called from another module, this query might consume a high amount of + gas if the pagination field is incorrectly set. */ async redelegations(params: QueryRedelegationsRequest): Promise { const options: any = { params: {} @@ -117,7 +135,10 @@ export class LCDQueryClient { return await this.req.get(endpoint, options); } /* DelegatorValidators queries all validators info for given delegator - address. */ + address. + + When called from another module, this query might consume a high amount of + gas if the pagination field is incorrectly set. */ async delegatorValidators(params: QueryDelegatorValidatorsRequest): Promise { const options: any = { params: {} diff --git a/packages/osmojs/src/codegen/cosmos/staking/v1beta1/query.rpc.Query.ts b/packages/osmojs/src/codegen/cosmos/staking/v1beta1/query.rpc.Query.ts index 1a204ce89..f70d85e87 100644 --- a/packages/osmojs/src/codegen/cosmos/staking/v1beta1/query.rpc.Query.ts +++ b/packages/osmojs/src/codegen/cosmos/staking/v1beta1/query.rpc.Query.ts @@ -4,13 +4,28 @@ import { QueryClient, createProtobufRpcClient } from "@cosmjs/stargate"; import { QueryValidatorsRequest, QueryValidatorsResponse, QueryValidatorRequest, QueryValidatorResponse, QueryValidatorDelegationsRequest, QueryValidatorDelegationsResponse, QueryValidatorUnbondingDelegationsRequest, QueryValidatorUnbondingDelegationsResponse, QueryDelegationRequest, QueryDelegationResponse, QueryUnbondingDelegationRequest, QueryUnbondingDelegationResponse, QueryDelegatorDelegationsRequest, QueryDelegatorDelegationsResponse, QueryDelegatorUnbondingDelegationsRequest, QueryDelegatorUnbondingDelegationsResponse, QueryRedelegationsRequest, QueryRedelegationsResponse, QueryDelegatorValidatorsRequest, QueryDelegatorValidatorsResponse, QueryDelegatorValidatorRequest, QueryDelegatorValidatorResponse, QueryHistoricalInfoRequest, QueryHistoricalInfoResponse, QueryPoolRequest, QueryPoolResponse, QueryParamsRequest, QueryParamsResponse } from "./query"; /** Query defines the gRPC querier service. */ export interface Query { - /** Validators queries all validators that match the given status. */ + /** + * Validators queries all validators that match the given status. + * + * When called from another module, this query might consume a high amount of + * gas if the pagination field is incorrectly set. + */ validators(request: QueryValidatorsRequest): Promise; /** Validator queries validator info for given validator address. */ validator(request: QueryValidatorRequest): Promise; - /** ValidatorDelegations queries delegate info for given validator. */ + /** + * ValidatorDelegations queries delegate info for given validator. + * + * When called from another module, this query might consume a high amount of + * gas if the pagination field is incorrectly set. + */ validatorDelegations(request: QueryValidatorDelegationsRequest): Promise; - /** ValidatorUnbondingDelegations queries unbonding delegations of a validator. */ + /** + * ValidatorUnbondingDelegations queries unbonding delegations of a validator. + * + * When called from another module, this query might consume a high amount of + * gas if the pagination field is incorrectly set. + */ validatorUnbondingDelegations(request: QueryValidatorUnbondingDelegationsRequest): Promise; /** Delegation queries delegate info for given validator delegator pair. */ delegation(request: QueryDelegationRequest): Promise; @@ -19,18 +34,34 @@ export interface Query { * pair. */ unbondingDelegation(request: QueryUnbondingDelegationRequest): Promise; - /** DelegatorDelegations queries all delegations of a given delegator address. */ + /** + * DelegatorDelegations queries all delegations of a given delegator address. + * + * When called from another module, this query might consume a high amount of + * gas if the pagination field is incorrectly set. + */ delegatorDelegations(request: QueryDelegatorDelegationsRequest): Promise; /** * DelegatorUnbondingDelegations queries all unbonding delegations of a given * delegator address. + * + * When called from another module, this query might consume a high amount of + * gas if the pagination field is incorrectly set. */ delegatorUnbondingDelegations(request: QueryDelegatorUnbondingDelegationsRequest): Promise; - /** Redelegations queries redelegations of given address. */ + /** + * Redelegations queries redelegations of given address. + * + * When called from another module, this query might consume a high amount of + * gas if the pagination field is incorrectly set. + */ redelegations(request: QueryRedelegationsRequest): Promise; /** * DelegatorValidators queries all validators info for given delegator * address. + * + * When called from another module, this query might consume a high amount of + * gas if the pagination field is incorrectly set. */ delegatorValidators(request: QueryDelegatorValidatorsRequest): Promise; /** diff --git a/packages/osmojs/src/codegen/cosmos/staking/v1beta1/query.ts b/packages/osmojs/src/codegen/cosmos/staking/v1beta1/query.ts index d9e00c6fc..490c677b7 100644 --- a/packages/osmojs/src/codegen/cosmos/staking/v1beta1/query.ts +++ b/packages/osmojs/src/codegen/cosmos/staking/v1beta1/query.ts @@ -1,12 +1,14 @@ import { PageRequest, PageRequestAmino, PageRequestSDKType, PageResponse, PageResponseAmino, PageResponseSDKType } from "../../base/query/v1beta1/pagination"; import { Validator, ValidatorAmino, ValidatorSDKType, DelegationResponse, DelegationResponseAmino, DelegationResponseSDKType, UnbondingDelegation, UnbondingDelegationAmino, UnbondingDelegationSDKType, RedelegationResponse, RedelegationResponseAmino, RedelegationResponseSDKType, HistoricalInfo, HistoricalInfoAmino, HistoricalInfoSDKType, Pool, PoolAmino, PoolSDKType, Params, ParamsAmino, ParamsSDKType } from "./staking"; import { BinaryReader, BinaryWriter } from "../../../binary"; +import { isSet } from "../../../helpers"; +import { GlobalDecoderRegistry } from "../../../registry"; /** QueryValidatorsRequest is request type for Query/Validators RPC method. */ export interface QueryValidatorsRequest { /** status enables to query for validators matching a given status. */ status: string; /** pagination defines an optional pagination for the request. */ - pagination: PageRequest; + pagination?: PageRequest; } export interface QueryValidatorsRequestProtoMsg { typeUrl: "/cosmos.staking.v1beta1.QueryValidatorsRequest"; @@ -15,7 +17,7 @@ export interface QueryValidatorsRequestProtoMsg { /** QueryValidatorsRequest is request type for Query/Validators RPC method. */ export interface QueryValidatorsRequestAmino { /** status enables to query for validators matching a given status. */ - status: string; + status?: string; /** pagination defines an optional pagination for the request. */ pagination?: PageRequestAmino; } @@ -26,14 +28,14 @@ export interface QueryValidatorsRequestAminoMsg { /** QueryValidatorsRequest is request type for Query/Validators RPC method. */ export interface QueryValidatorsRequestSDKType { status: string; - pagination: PageRequestSDKType; + pagination?: PageRequestSDKType; } /** QueryValidatorsResponse is response type for the Query/Validators RPC method */ export interface QueryValidatorsResponse { /** validators contains all the queried validators. */ validators: Validator[]; /** pagination defines the pagination in the response. */ - pagination: PageResponse; + pagination?: PageResponse; } export interface QueryValidatorsResponseProtoMsg { typeUrl: "/cosmos.staking.v1beta1.QueryValidatorsResponse"; @@ -53,7 +55,7 @@ export interface QueryValidatorsResponseAminoMsg { /** QueryValidatorsResponse is response type for the Query/Validators RPC method */ export interface QueryValidatorsResponseSDKType { validators: ValidatorSDKType[]; - pagination: PageResponseSDKType; + pagination?: PageResponseSDKType; } /** QueryValidatorRequest is response type for the Query/Validator RPC method */ export interface QueryValidatorRequest { @@ -67,7 +69,7 @@ export interface QueryValidatorRequestProtoMsg { /** QueryValidatorRequest is response type for the Query/Validator RPC method */ export interface QueryValidatorRequestAmino { /** validator_addr defines the validator address to query for. */ - validator_addr: string; + validator_addr?: string; } export interface QueryValidatorRequestAminoMsg { type: "cosmos-sdk/QueryValidatorRequest"; @@ -79,7 +81,7 @@ export interface QueryValidatorRequestSDKType { } /** QueryValidatorResponse is response type for the Query/Validator RPC method */ export interface QueryValidatorResponse { - /** validator defines the the validator info. */ + /** validator defines the validator info. */ validator: Validator; } export interface QueryValidatorResponseProtoMsg { @@ -88,8 +90,8 @@ export interface QueryValidatorResponseProtoMsg { } /** QueryValidatorResponse is response type for the Query/Validator RPC method */ export interface QueryValidatorResponseAmino { - /** validator defines the the validator info. */ - validator?: ValidatorAmino; + /** validator defines the validator info. */ + validator: ValidatorAmino; } export interface QueryValidatorResponseAminoMsg { type: "cosmos-sdk/QueryValidatorResponse"; @@ -107,7 +109,7 @@ export interface QueryValidatorDelegationsRequest { /** validator_addr defines the validator address to query for. */ validatorAddr: string; /** pagination defines an optional pagination for the request. */ - pagination: PageRequest; + pagination?: PageRequest; } export interface QueryValidatorDelegationsRequestProtoMsg { typeUrl: "/cosmos.staking.v1beta1.QueryValidatorDelegationsRequest"; @@ -119,7 +121,7 @@ export interface QueryValidatorDelegationsRequestProtoMsg { */ export interface QueryValidatorDelegationsRequestAmino { /** validator_addr defines the validator address to query for. */ - validator_addr: string; + validator_addr?: string; /** pagination defines an optional pagination for the request. */ pagination?: PageRequestAmino; } @@ -133,7 +135,7 @@ export interface QueryValidatorDelegationsRequestAminoMsg { */ export interface QueryValidatorDelegationsRequestSDKType { validator_addr: string; - pagination: PageRequestSDKType; + pagination?: PageRequestSDKType; } /** * QueryValidatorDelegationsResponse is response type for the @@ -142,7 +144,7 @@ export interface QueryValidatorDelegationsRequestSDKType { export interface QueryValidatorDelegationsResponse { delegationResponses: DelegationResponse[]; /** pagination defines the pagination in the response. */ - pagination: PageResponse; + pagination?: PageResponse; } export interface QueryValidatorDelegationsResponseProtoMsg { typeUrl: "/cosmos.staking.v1beta1.QueryValidatorDelegationsResponse"; @@ -167,7 +169,7 @@ export interface QueryValidatorDelegationsResponseAminoMsg { */ export interface QueryValidatorDelegationsResponseSDKType { delegation_responses: DelegationResponseSDKType[]; - pagination: PageResponseSDKType; + pagination?: PageResponseSDKType; } /** * QueryValidatorUnbondingDelegationsRequest is required type for the @@ -177,7 +179,7 @@ export interface QueryValidatorUnbondingDelegationsRequest { /** validator_addr defines the validator address to query for. */ validatorAddr: string; /** pagination defines an optional pagination for the request. */ - pagination: PageRequest; + pagination?: PageRequest; } export interface QueryValidatorUnbondingDelegationsRequestProtoMsg { typeUrl: "/cosmos.staking.v1beta1.QueryValidatorUnbondingDelegationsRequest"; @@ -189,7 +191,7 @@ export interface QueryValidatorUnbondingDelegationsRequestProtoMsg { */ export interface QueryValidatorUnbondingDelegationsRequestAmino { /** validator_addr defines the validator address to query for. */ - validator_addr: string; + validator_addr?: string; /** pagination defines an optional pagination for the request. */ pagination?: PageRequestAmino; } @@ -203,7 +205,7 @@ export interface QueryValidatorUnbondingDelegationsRequestAminoMsg { */ export interface QueryValidatorUnbondingDelegationsRequestSDKType { validator_addr: string; - pagination: PageRequestSDKType; + pagination?: PageRequestSDKType; } /** * QueryValidatorUnbondingDelegationsResponse is response type for the @@ -212,7 +214,7 @@ export interface QueryValidatorUnbondingDelegationsRequestSDKType { export interface QueryValidatorUnbondingDelegationsResponse { unbondingResponses: UnbondingDelegation[]; /** pagination defines the pagination in the response. */ - pagination: PageResponse; + pagination?: PageResponse; } export interface QueryValidatorUnbondingDelegationsResponseProtoMsg { typeUrl: "/cosmos.staking.v1beta1.QueryValidatorUnbondingDelegationsResponse"; @@ -237,7 +239,7 @@ export interface QueryValidatorUnbondingDelegationsResponseAminoMsg { */ export interface QueryValidatorUnbondingDelegationsResponseSDKType { unbonding_responses: UnbondingDelegationSDKType[]; - pagination: PageResponseSDKType; + pagination?: PageResponseSDKType; } /** QueryDelegationRequest is request type for the Query/Delegation RPC method. */ export interface QueryDelegationRequest { @@ -253,9 +255,9 @@ export interface QueryDelegationRequestProtoMsg { /** QueryDelegationRequest is request type for the Query/Delegation RPC method. */ export interface QueryDelegationRequestAmino { /** delegator_addr defines the delegator address to query for. */ - delegator_addr: string; + delegator_addr?: string; /** validator_addr defines the validator address to query for. */ - validator_addr: string; + validator_addr?: string; } export interface QueryDelegationRequestAminoMsg { type: "cosmos-sdk/QueryDelegationRequest"; @@ -269,7 +271,7 @@ export interface QueryDelegationRequestSDKType { /** 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; } export interface QueryDelegationResponseProtoMsg { typeUrl: "/cosmos.staking.v1beta1.QueryDelegationResponse"; @@ -286,7 +288,7 @@ export interface QueryDelegationResponseAminoMsg { } /** QueryDelegationResponse is response type for the Query/Delegation RPC method. */ export interface QueryDelegationResponseSDKType { - delegation_response: DelegationResponseSDKType; + delegation_response?: DelegationResponseSDKType; } /** * QueryUnbondingDelegationRequest is request type for the @@ -308,9 +310,9 @@ export interface QueryUnbondingDelegationRequestProtoMsg { */ export interface QueryUnbondingDelegationRequestAmino { /** delegator_addr defines the delegator address to query for. */ - delegator_addr: string; + delegator_addr?: string; /** validator_addr defines the validator address to query for. */ - validator_addr: string; + validator_addr?: string; } export interface QueryUnbondingDelegationRequestAminoMsg { type: "cosmos-sdk/QueryUnbondingDelegationRequest"; @@ -342,7 +344,7 @@ export interface QueryUnbondingDelegationResponseProtoMsg { */ export interface QueryUnbondingDelegationResponseAmino { /** unbond defines the unbonding information of a delegation. */ - unbond?: UnbondingDelegationAmino; + unbond: UnbondingDelegationAmino; } export interface QueryUnbondingDelegationResponseAminoMsg { type: "cosmos-sdk/QueryUnbondingDelegationResponse"; @@ -363,7 +365,7 @@ export interface QueryDelegatorDelegationsRequest { /** delegator_addr defines the delegator address to query for. */ delegatorAddr: string; /** pagination defines an optional pagination for the request. */ - pagination: PageRequest; + pagination?: PageRequest; } export interface QueryDelegatorDelegationsRequestProtoMsg { typeUrl: "/cosmos.staking.v1beta1.QueryDelegatorDelegationsRequest"; @@ -375,7 +377,7 @@ export interface QueryDelegatorDelegationsRequestProtoMsg { */ export interface QueryDelegatorDelegationsRequestAmino { /** delegator_addr defines the delegator address to query for. */ - delegator_addr: string; + delegator_addr?: string; /** pagination defines an optional pagination for the request. */ pagination?: PageRequestAmino; } @@ -389,7 +391,7 @@ export interface QueryDelegatorDelegationsRequestAminoMsg { */ export interface QueryDelegatorDelegationsRequestSDKType { delegator_addr: string; - pagination: PageRequestSDKType; + pagination?: PageRequestSDKType; } /** * QueryDelegatorDelegationsResponse is response type for the @@ -399,7 +401,7 @@ export interface QueryDelegatorDelegationsResponse { /** delegation_responses defines all the delegations' info of a delegator. */ delegationResponses: DelegationResponse[]; /** pagination defines the pagination in the response. */ - pagination: PageResponse; + pagination?: PageResponse; } export interface QueryDelegatorDelegationsResponseProtoMsg { typeUrl: "/cosmos.staking.v1beta1.QueryDelegatorDelegationsResponse"; @@ -425,7 +427,7 @@ export interface QueryDelegatorDelegationsResponseAminoMsg { */ export interface QueryDelegatorDelegationsResponseSDKType { delegation_responses: DelegationResponseSDKType[]; - pagination: PageResponseSDKType; + pagination?: PageResponseSDKType; } /** * QueryDelegatorUnbondingDelegationsRequest is request type for the @@ -435,7 +437,7 @@ export interface QueryDelegatorUnbondingDelegationsRequest { /** delegator_addr defines the delegator address to query for. */ delegatorAddr: string; /** pagination defines an optional pagination for the request. */ - pagination: PageRequest; + pagination?: PageRequest; } export interface QueryDelegatorUnbondingDelegationsRequestProtoMsg { typeUrl: "/cosmos.staking.v1beta1.QueryDelegatorUnbondingDelegationsRequest"; @@ -447,7 +449,7 @@ export interface QueryDelegatorUnbondingDelegationsRequestProtoMsg { */ export interface QueryDelegatorUnbondingDelegationsRequestAmino { /** delegator_addr defines the delegator address to query for. */ - delegator_addr: string; + delegator_addr?: string; /** pagination defines an optional pagination for the request. */ pagination?: PageRequestAmino; } @@ -461,7 +463,7 @@ export interface QueryDelegatorUnbondingDelegationsRequestAminoMsg { */ export interface QueryDelegatorUnbondingDelegationsRequestSDKType { delegator_addr: string; - pagination: PageRequestSDKType; + pagination?: PageRequestSDKType; } /** * QueryUnbondingDelegatorDelegationsResponse is response type for the @@ -470,7 +472,7 @@ export interface QueryDelegatorUnbondingDelegationsRequestSDKType { export interface QueryDelegatorUnbondingDelegationsResponse { unbondingResponses: UnbondingDelegation[]; /** pagination defines the pagination in the response. */ - pagination: PageResponse; + pagination?: PageResponse; } export interface QueryDelegatorUnbondingDelegationsResponseProtoMsg { typeUrl: "/cosmos.staking.v1beta1.QueryDelegatorUnbondingDelegationsResponse"; @@ -495,7 +497,7 @@ export interface QueryDelegatorUnbondingDelegationsResponseAminoMsg { */ export interface QueryDelegatorUnbondingDelegationsResponseSDKType { unbonding_responses: UnbondingDelegationSDKType[]; - pagination: PageResponseSDKType; + pagination?: PageResponseSDKType; } /** * QueryRedelegationsRequest is request type for the Query/Redelegations RPC @@ -509,7 +511,7 @@ export interface QueryRedelegationsRequest { /** dst_validator_addr defines the validator address to redelegate to. */ dstValidatorAddr: string; /** pagination defines an optional pagination for the request. */ - pagination: PageRequest; + pagination?: PageRequest; } export interface QueryRedelegationsRequestProtoMsg { typeUrl: "/cosmos.staking.v1beta1.QueryRedelegationsRequest"; @@ -521,11 +523,11 @@ export interface QueryRedelegationsRequestProtoMsg { */ export interface QueryRedelegationsRequestAmino { /** delegator_addr defines the delegator address to query for. */ - delegator_addr: string; + delegator_addr?: string; /** src_validator_addr defines the validator address to redelegate from. */ - src_validator_addr: string; + src_validator_addr?: string; /** dst_validator_addr defines the validator address to redelegate to. */ - dst_validator_addr: string; + dst_validator_addr?: string; /** pagination defines an optional pagination for the request. */ pagination?: PageRequestAmino; } @@ -541,7 +543,7 @@ export interface QueryRedelegationsRequestSDKType { delegator_addr: string; src_validator_addr: string; dst_validator_addr: string; - pagination: PageRequestSDKType; + pagination?: PageRequestSDKType; } /** * QueryRedelegationsResponse is response type for the Query/Redelegations RPC @@ -550,7 +552,7 @@ export interface QueryRedelegationsRequestSDKType { export interface QueryRedelegationsResponse { redelegationResponses: RedelegationResponse[]; /** pagination defines the pagination in the response. */ - pagination: PageResponse; + pagination?: PageResponse; } export interface QueryRedelegationsResponseProtoMsg { typeUrl: "/cosmos.staking.v1beta1.QueryRedelegationsResponse"; @@ -575,7 +577,7 @@ export interface QueryRedelegationsResponseAminoMsg { */ export interface QueryRedelegationsResponseSDKType { redelegation_responses: RedelegationResponseSDKType[]; - pagination: PageResponseSDKType; + pagination?: PageResponseSDKType; } /** * QueryDelegatorValidatorsRequest is request type for the @@ -585,7 +587,7 @@ export interface QueryDelegatorValidatorsRequest { /** delegator_addr defines the delegator address to query for. */ delegatorAddr: string; /** pagination defines an optional pagination for the request. */ - pagination: PageRequest; + pagination?: PageRequest; } export interface QueryDelegatorValidatorsRequestProtoMsg { typeUrl: "/cosmos.staking.v1beta1.QueryDelegatorValidatorsRequest"; @@ -597,7 +599,7 @@ export interface QueryDelegatorValidatorsRequestProtoMsg { */ export interface QueryDelegatorValidatorsRequestAmino { /** delegator_addr defines the delegator address to query for. */ - delegator_addr: string; + delegator_addr?: string; /** pagination defines an optional pagination for the request. */ pagination?: PageRequestAmino; } @@ -611,17 +613,17 @@ export interface QueryDelegatorValidatorsRequestAminoMsg { */ export interface QueryDelegatorValidatorsRequestSDKType { delegator_addr: string; - pagination: PageRequestSDKType; + pagination?: PageRequestSDKType; } /** * QueryDelegatorValidatorsResponse is response type for the * Query/DelegatorValidators RPC method. */ export interface QueryDelegatorValidatorsResponse { - /** validators defines the the validators' info of a delegator. */ + /** validators defines the validators' info of a delegator. */ validators: Validator[]; /** pagination defines the pagination in the response. */ - pagination: PageResponse; + pagination?: PageResponse; } export interface QueryDelegatorValidatorsResponseProtoMsg { typeUrl: "/cosmos.staking.v1beta1.QueryDelegatorValidatorsResponse"; @@ -632,7 +634,7 @@ export interface QueryDelegatorValidatorsResponseProtoMsg { * Query/DelegatorValidators RPC method. */ export interface QueryDelegatorValidatorsResponseAmino { - /** validators defines the the validators' info of a delegator. */ + /** validators defines the validators' info of a delegator. */ validators: ValidatorAmino[]; /** pagination defines the pagination in the response. */ pagination?: PageResponseAmino; @@ -647,7 +649,7 @@ export interface QueryDelegatorValidatorsResponseAminoMsg { */ export interface QueryDelegatorValidatorsResponseSDKType { validators: ValidatorSDKType[]; - pagination: PageResponseSDKType; + pagination?: PageResponseSDKType; } /** * QueryDelegatorValidatorRequest is request type for the @@ -669,9 +671,9 @@ export interface QueryDelegatorValidatorRequestProtoMsg { */ export interface QueryDelegatorValidatorRequestAmino { /** delegator_addr defines the delegator address to query for. */ - delegator_addr: string; + delegator_addr?: string; /** validator_addr defines the validator address to query for. */ - validator_addr: string; + validator_addr?: string; } export interface QueryDelegatorValidatorRequestAminoMsg { type: "cosmos-sdk/QueryDelegatorValidatorRequest"; @@ -690,7 +692,7 @@ export interface QueryDelegatorValidatorRequestSDKType { * Query/DelegatorValidator RPC method. */ export interface QueryDelegatorValidatorResponse { - /** validator defines the the validator info. */ + /** validator defines the validator info. */ validator: Validator; } export interface QueryDelegatorValidatorResponseProtoMsg { @@ -702,8 +704,8 @@ export interface QueryDelegatorValidatorResponseProtoMsg { * Query/DelegatorValidator RPC method. */ export interface QueryDelegatorValidatorResponseAmino { - /** validator defines the the validator info. */ - validator?: ValidatorAmino; + /** validator defines the validator info. */ + validator: ValidatorAmino; } export interface QueryDelegatorValidatorResponseAminoMsg { type: "cosmos-sdk/QueryDelegatorValidatorResponse"; @@ -734,7 +736,7 @@ export interface QueryHistoricalInfoRequestProtoMsg { */ export interface QueryHistoricalInfoRequestAmino { /** height defines at which height to query the historical info. */ - height: string; + height?: string; } export interface QueryHistoricalInfoRequestAminoMsg { type: "cosmos-sdk/QueryHistoricalInfoRequest"; @@ -753,7 +755,7 @@ export interface QueryHistoricalInfoRequestSDKType { */ export interface QueryHistoricalInfoResponse { /** hist defines the historical info at the given height. */ - hist: HistoricalInfo; + hist?: HistoricalInfo; } export interface QueryHistoricalInfoResponseProtoMsg { typeUrl: "/cosmos.staking.v1beta1.QueryHistoricalInfoResponse"; @@ -776,7 +778,7 @@ export interface QueryHistoricalInfoResponseAminoMsg { * method. */ export interface QueryHistoricalInfoResponseSDKType { - hist: HistoricalInfoSDKType; + hist?: HistoricalInfoSDKType; } /** QueryPoolRequest is request type for the Query/Pool RPC method. */ export interface QueryPoolRequest {} @@ -804,7 +806,7 @@ export interface QueryPoolResponseProtoMsg { /** QueryPoolResponse is response type for the Query/Pool RPC method. */ export interface QueryPoolResponseAmino { /** pool defines the pool info. */ - pool?: PoolAmino; + pool: PoolAmino; } export interface QueryPoolResponseAminoMsg { type: "cosmos-sdk/QueryPoolResponse"; @@ -840,7 +842,7 @@ export interface QueryParamsResponseProtoMsg { /** QueryParamsResponse is response type for the Query/Params RPC method. */ export interface QueryParamsResponseAmino { /** params holds all the parameters of this module. */ - params?: ParamsAmino; + params: ParamsAmino; } export interface QueryParamsResponseAminoMsg { type: "cosmos-sdk/QueryParamsResponse"; @@ -853,11 +855,21 @@ export interface QueryParamsResponseSDKType { function createBaseQueryValidatorsRequest(): QueryValidatorsRequest { return { status: "", - pagination: PageRequest.fromPartial({}) + pagination: undefined }; } export const QueryValidatorsRequest = { typeUrl: "/cosmos.staking.v1beta1.QueryValidatorsRequest", + aminoType: "cosmos-sdk/QueryValidatorsRequest", + is(o: any): o is QueryValidatorsRequest { + return o && (o.$typeUrl === QueryValidatorsRequest.typeUrl || typeof o.status === "string"); + }, + isSDK(o: any): o is QueryValidatorsRequestSDKType { + return o && (o.$typeUrl === QueryValidatorsRequest.typeUrl || typeof o.status === "string"); + }, + isAmino(o: any): o is QueryValidatorsRequestAmino { + return o && (o.$typeUrl === QueryValidatorsRequest.typeUrl || typeof o.status === "string"); + }, encode(message: QueryValidatorsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.status !== "") { writer.uint32(10).string(message.status); @@ -887,6 +899,18 @@ export const QueryValidatorsRequest = { } return message; }, + fromJSON(object: any): QueryValidatorsRequest { + return { + status: isSet(object.status) ? String(object.status) : "", + pagination: isSet(object.pagination) ? PageRequest.fromJSON(object.pagination) : undefined + }; + }, + toJSON(message: QueryValidatorsRequest): unknown { + const obj: any = {}; + message.status !== undefined && (obj.status = message.status); + message.pagination !== undefined && (obj.pagination = message.pagination ? PageRequest.toJSON(message.pagination) : undefined); + return obj; + }, fromPartial(object: Partial): QueryValidatorsRequest { const message = createBaseQueryValidatorsRequest(); message.status = object.status ?? ""; @@ -894,10 +918,14 @@ export const QueryValidatorsRequest = { return message; }, fromAmino(object: QueryValidatorsRequestAmino): QueryValidatorsRequest { - return { - status: object.status, - pagination: object?.pagination ? PageRequest.fromAmino(object.pagination) : undefined - }; + const message = createBaseQueryValidatorsRequest(); + if (object.status !== undefined && object.status !== null) { + message.status = object.status; + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromAmino(object.pagination); + } + return message; }, toAmino(message: QueryValidatorsRequest): QueryValidatorsRequestAmino { const obj: any = {}; @@ -927,14 +955,26 @@ export const QueryValidatorsRequest = { }; } }; +GlobalDecoderRegistry.register(QueryValidatorsRequest.typeUrl, QueryValidatorsRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryValidatorsRequest.aminoType, QueryValidatorsRequest.typeUrl); function createBaseQueryValidatorsResponse(): QueryValidatorsResponse { return { validators: [], - pagination: PageResponse.fromPartial({}) + pagination: undefined }; } export const QueryValidatorsResponse = { typeUrl: "/cosmos.staking.v1beta1.QueryValidatorsResponse", + aminoType: "cosmos-sdk/QueryValidatorsResponse", + is(o: any): o is QueryValidatorsResponse { + return o && (o.$typeUrl === QueryValidatorsResponse.typeUrl || Array.isArray(o.validators) && (!o.validators.length || Validator.is(o.validators[0]))); + }, + isSDK(o: any): o is QueryValidatorsResponseSDKType { + return o && (o.$typeUrl === QueryValidatorsResponse.typeUrl || Array.isArray(o.validators) && (!o.validators.length || Validator.isSDK(o.validators[0]))); + }, + isAmino(o: any): o is QueryValidatorsResponseAmino { + return o && (o.$typeUrl === QueryValidatorsResponse.typeUrl || Array.isArray(o.validators) && (!o.validators.length || Validator.isAmino(o.validators[0]))); + }, encode(message: QueryValidatorsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.validators) { Validator.encode(v!, writer.uint32(10).fork()).ldelim(); @@ -964,6 +1004,22 @@ export const QueryValidatorsResponse = { } 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 + }; + }, + toJSON(message: QueryValidatorsResponse): unknown { + const obj: any = {}; + if (message.validators) { + obj.validators = message.validators.map(e => e ? Validator.toJSON(e) : undefined); + } else { + obj.validators = []; + } + message.pagination !== undefined && (obj.pagination = message.pagination ? PageResponse.toJSON(message.pagination) : undefined); + return obj; + }, fromPartial(object: Partial): QueryValidatorsResponse { const message = createBaseQueryValidatorsResponse(); message.validators = object.validators?.map(e => Validator.fromPartial(e)) || []; @@ -971,10 +1027,12 @@ export const QueryValidatorsResponse = { return message; }, fromAmino(object: QueryValidatorsResponseAmino): QueryValidatorsResponse { - return { - validators: Array.isArray(object?.validators) ? object.validators.map((e: any) => Validator.fromAmino(e)) : [], - pagination: object?.pagination ? PageResponse.fromAmino(object.pagination) : undefined - }; + const message = createBaseQueryValidatorsResponse(); + message.validators = object.validators?.map(e => Validator.fromAmino(e)) || []; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromAmino(object.pagination); + } + return message; }, toAmino(message: QueryValidatorsResponse): QueryValidatorsResponseAmino { const obj: any = {}; @@ -1008,6 +1066,8 @@ export const QueryValidatorsResponse = { }; } }; +GlobalDecoderRegistry.register(QueryValidatorsResponse.typeUrl, QueryValidatorsResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryValidatorsResponse.aminoType, QueryValidatorsResponse.typeUrl); function createBaseQueryValidatorRequest(): QueryValidatorRequest { return { validatorAddr: "" @@ -1015,6 +1075,16 @@ function createBaseQueryValidatorRequest(): QueryValidatorRequest { } export const QueryValidatorRequest = { typeUrl: "/cosmos.staking.v1beta1.QueryValidatorRequest", + aminoType: "cosmos-sdk/QueryValidatorRequest", + is(o: any): o is QueryValidatorRequest { + return o && (o.$typeUrl === QueryValidatorRequest.typeUrl || typeof o.validatorAddr === "string"); + }, + isSDK(o: any): o is QueryValidatorRequestSDKType { + return o && (o.$typeUrl === QueryValidatorRequest.typeUrl || typeof o.validator_addr === "string"); + }, + isAmino(o: any): o is QueryValidatorRequestAmino { + return o && (o.$typeUrl === QueryValidatorRequest.typeUrl || typeof o.validator_addr === "string"); + }, encode(message: QueryValidatorRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.validatorAddr !== "") { writer.uint32(10).string(message.validatorAddr); @@ -1038,15 +1108,27 @@ export const QueryValidatorRequest = { } return message; }, + fromJSON(object: any): QueryValidatorRequest { + return { + validatorAddr: isSet(object.validatorAddr) ? String(object.validatorAddr) : "" + }; + }, + toJSON(message: QueryValidatorRequest): unknown { + const obj: any = {}; + message.validatorAddr !== undefined && (obj.validatorAddr = message.validatorAddr); + return obj; + }, fromPartial(object: Partial): QueryValidatorRequest { const message = createBaseQueryValidatorRequest(); message.validatorAddr = object.validatorAddr ?? ""; return message; }, fromAmino(object: QueryValidatorRequestAmino): QueryValidatorRequest { - return { - validatorAddr: object.validator_addr - }; + const message = createBaseQueryValidatorRequest(); + if (object.validator_addr !== undefined && object.validator_addr !== null) { + message.validatorAddr = object.validator_addr; + } + return message; }, toAmino(message: QueryValidatorRequest): QueryValidatorRequestAmino { const obj: any = {}; @@ -1075,6 +1157,8 @@ export const QueryValidatorRequest = { }; } }; +GlobalDecoderRegistry.register(QueryValidatorRequest.typeUrl, QueryValidatorRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryValidatorRequest.aminoType, QueryValidatorRequest.typeUrl); function createBaseQueryValidatorResponse(): QueryValidatorResponse { return { validator: Validator.fromPartial({}) @@ -1082,6 +1166,16 @@ function createBaseQueryValidatorResponse(): QueryValidatorResponse { } export const QueryValidatorResponse = { typeUrl: "/cosmos.staking.v1beta1.QueryValidatorResponse", + aminoType: "cosmos-sdk/QueryValidatorResponse", + is(o: any): o is QueryValidatorResponse { + return o && (o.$typeUrl === QueryValidatorResponse.typeUrl || Validator.is(o.validator)); + }, + isSDK(o: any): o is QueryValidatorResponseSDKType { + return o && (o.$typeUrl === QueryValidatorResponse.typeUrl || Validator.isSDK(o.validator)); + }, + isAmino(o: any): o is QueryValidatorResponseAmino { + return o && (o.$typeUrl === QueryValidatorResponse.typeUrl || Validator.isAmino(o.validator)); + }, encode(message: QueryValidatorResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.validator !== undefined) { Validator.encode(message.validator, writer.uint32(10).fork()).ldelim(); @@ -1105,19 +1199,31 @@ export const QueryValidatorResponse = { } return message; }, + fromJSON(object: any): QueryValidatorResponse { + return { + validator: isSet(object.validator) ? Validator.fromJSON(object.validator) : undefined + }; + }, + toJSON(message: QueryValidatorResponse): unknown { + const obj: any = {}; + message.validator !== undefined && (obj.validator = message.validator ? Validator.toJSON(message.validator) : undefined); + return obj; + }, fromPartial(object: Partial): QueryValidatorResponse { const message = createBaseQueryValidatorResponse(); message.validator = object.validator !== undefined && object.validator !== null ? Validator.fromPartial(object.validator) : undefined; return message; }, fromAmino(object: QueryValidatorResponseAmino): QueryValidatorResponse { - return { - validator: object?.validator ? Validator.fromAmino(object.validator) : undefined - }; + const message = createBaseQueryValidatorResponse(); + if (object.validator !== undefined && object.validator !== null) { + message.validator = Validator.fromAmino(object.validator); + } + return message; }, toAmino(message: QueryValidatorResponse): QueryValidatorResponseAmino { const obj: any = {}; - obj.validator = message.validator ? Validator.toAmino(message.validator) : undefined; + obj.validator = message.validator ? Validator.toAmino(message.validator) : Validator.fromPartial({}); return obj; }, fromAminoMsg(object: QueryValidatorResponseAminoMsg): QueryValidatorResponse { @@ -1142,14 +1248,26 @@ export const QueryValidatorResponse = { }; } }; +GlobalDecoderRegistry.register(QueryValidatorResponse.typeUrl, QueryValidatorResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryValidatorResponse.aminoType, QueryValidatorResponse.typeUrl); function createBaseQueryValidatorDelegationsRequest(): QueryValidatorDelegationsRequest { return { validatorAddr: "", - pagination: PageRequest.fromPartial({}) + pagination: undefined }; } export const QueryValidatorDelegationsRequest = { typeUrl: "/cosmos.staking.v1beta1.QueryValidatorDelegationsRequest", + aminoType: "cosmos-sdk/QueryValidatorDelegationsRequest", + is(o: any): o is QueryValidatorDelegationsRequest { + return o && (o.$typeUrl === QueryValidatorDelegationsRequest.typeUrl || typeof o.validatorAddr === "string"); + }, + isSDK(o: any): o is QueryValidatorDelegationsRequestSDKType { + return o && (o.$typeUrl === QueryValidatorDelegationsRequest.typeUrl || typeof o.validator_addr === "string"); + }, + isAmino(o: any): o is QueryValidatorDelegationsRequestAmino { + return o && (o.$typeUrl === QueryValidatorDelegationsRequest.typeUrl || typeof o.validator_addr === "string"); + }, encode(message: QueryValidatorDelegationsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.validatorAddr !== "") { writer.uint32(10).string(message.validatorAddr); @@ -1179,6 +1297,18 @@ export const QueryValidatorDelegationsRequest = { } return message; }, + fromJSON(object: any): QueryValidatorDelegationsRequest { + return { + validatorAddr: isSet(object.validatorAddr) ? String(object.validatorAddr) : "", + pagination: isSet(object.pagination) ? PageRequest.fromJSON(object.pagination) : undefined + }; + }, + toJSON(message: QueryValidatorDelegationsRequest): unknown { + const obj: any = {}; + message.validatorAddr !== undefined && (obj.validatorAddr = message.validatorAddr); + message.pagination !== undefined && (obj.pagination = message.pagination ? PageRequest.toJSON(message.pagination) : undefined); + return obj; + }, fromPartial(object: Partial): QueryValidatorDelegationsRequest { const message = createBaseQueryValidatorDelegationsRequest(); message.validatorAddr = object.validatorAddr ?? ""; @@ -1186,10 +1316,14 @@ export const QueryValidatorDelegationsRequest = { return message; }, fromAmino(object: QueryValidatorDelegationsRequestAmino): QueryValidatorDelegationsRequest { - return { - validatorAddr: object.validator_addr, - pagination: object?.pagination ? PageRequest.fromAmino(object.pagination) : undefined - }; + const message = createBaseQueryValidatorDelegationsRequest(); + if (object.validator_addr !== undefined && object.validator_addr !== null) { + message.validatorAddr = object.validator_addr; + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromAmino(object.pagination); + } + return message; }, toAmino(message: QueryValidatorDelegationsRequest): QueryValidatorDelegationsRequestAmino { const obj: any = {}; @@ -1219,14 +1353,26 @@ export const QueryValidatorDelegationsRequest = { }; } }; +GlobalDecoderRegistry.register(QueryValidatorDelegationsRequest.typeUrl, QueryValidatorDelegationsRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryValidatorDelegationsRequest.aminoType, QueryValidatorDelegationsRequest.typeUrl); function createBaseQueryValidatorDelegationsResponse(): QueryValidatorDelegationsResponse { return { delegationResponses: [], - pagination: PageResponse.fromPartial({}) + pagination: undefined }; } export const QueryValidatorDelegationsResponse = { typeUrl: "/cosmos.staking.v1beta1.QueryValidatorDelegationsResponse", + aminoType: "cosmos-sdk/QueryValidatorDelegationsResponse", + is(o: any): o is QueryValidatorDelegationsResponse { + return o && (o.$typeUrl === QueryValidatorDelegationsResponse.typeUrl || Array.isArray(o.delegationResponses) && (!o.delegationResponses.length || DelegationResponse.is(o.delegationResponses[0]))); + }, + isSDK(o: any): o is QueryValidatorDelegationsResponseSDKType { + return o && (o.$typeUrl === QueryValidatorDelegationsResponse.typeUrl || Array.isArray(o.delegation_responses) && (!o.delegation_responses.length || DelegationResponse.isSDK(o.delegation_responses[0]))); + }, + isAmino(o: any): o is QueryValidatorDelegationsResponseAmino { + return o && (o.$typeUrl === QueryValidatorDelegationsResponse.typeUrl || Array.isArray(o.delegation_responses) && (!o.delegation_responses.length || DelegationResponse.isAmino(o.delegation_responses[0]))); + }, encode(message: QueryValidatorDelegationsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.delegationResponses) { DelegationResponse.encode(v!, writer.uint32(10).fork()).ldelim(); @@ -1256,6 +1402,22 @@ export const QueryValidatorDelegationsResponse = { } return message; }, + fromJSON(object: any): QueryValidatorDelegationsResponse { + return { + delegationResponses: Array.isArray(object?.delegationResponses) ? object.delegationResponses.map((e: any) => DelegationResponse.fromJSON(e)) : [], + pagination: isSet(object.pagination) ? PageResponse.fromJSON(object.pagination) : undefined + }; + }, + toJSON(message: QueryValidatorDelegationsResponse): unknown { + const obj: any = {}; + if (message.delegationResponses) { + obj.delegationResponses = message.delegationResponses.map(e => e ? DelegationResponse.toJSON(e) : undefined); + } else { + obj.delegationResponses = []; + } + message.pagination !== undefined && (obj.pagination = message.pagination ? PageResponse.toJSON(message.pagination) : undefined); + return obj; + }, fromPartial(object: Partial): QueryValidatorDelegationsResponse { const message = createBaseQueryValidatorDelegationsResponse(); message.delegationResponses = object.delegationResponses?.map(e => DelegationResponse.fromPartial(e)) || []; @@ -1263,10 +1425,12 @@ export const QueryValidatorDelegationsResponse = { return message; }, fromAmino(object: QueryValidatorDelegationsResponseAmino): QueryValidatorDelegationsResponse { - return { - delegationResponses: Array.isArray(object?.delegation_responses) ? object.delegation_responses.map((e: any) => DelegationResponse.fromAmino(e)) : [], - pagination: object?.pagination ? PageResponse.fromAmino(object.pagination) : undefined - }; + const message = createBaseQueryValidatorDelegationsResponse(); + message.delegationResponses = object.delegation_responses?.map(e => DelegationResponse.fromAmino(e)) || []; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromAmino(object.pagination); + } + return message; }, toAmino(message: QueryValidatorDelegationsResponse): QueryValidatorDelegationsResponseAmino { const obj: any = {}; @@ -1300,14 +1464,26 @@ export const QueryValidatorDelegationsResponse = { }; } }; +GlobalDecoderRegistry.register(QueryValidatorDelegationsResponse.typeUrl, QueryValidatorDelegationsResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryValidatorDelegationsResponse.aminoType, QueryValidatorDelegationsResponse.typeUrl); function createBaseQueryValidatorUnbondingDelegationsRequest(): QueryValidatorUnbondingDelegationsRequest { return { validatorAddr: "", - pagination: PageRequest.fromPartial({}) + pagination: undefined }; } export const QueryValidatorUnbondingDelegationsRequest = { typeUrl: "/cosmos.staking.v1beta1.QueryValidatorUnbondingDelegationsRequest", + aminoType: "cosmos-sdk/QueryValidatorUnbondingDelegationsRequest", + is(o: any): o is QueryValidatorUnbondingDelegationsRequest { + return o && (o.$typeUrl === QueryValidatorUnbondingDelegationsRequest.typeUrl || typeof o.validatorAddr === "string"); + }, + isSDK(o: any): o is QueryValidatorUnbondingDelegationsRequestSDKType { + return o && (o.$typeUrl === QueryValidatorUnbondingDelegationsRequest.typeUrl || typeof o.validator_addr === "string"); + }, + isAmino(o: any): o is QueryValidatorUnbondingDelegationsRequestAmino { + return o && (o.$typeUrl === QueryValidatorUnbondingDelegationsRequest.typeUrl || typeof o.validator_addr === "string"); + }, encode(message: QueryValidatorUnbondingDelegationsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.validatorAddr !== "") { writer.uint32(10).string(message.validatorAddr); @@ -1337,6 +1513,18 @@ export const QueryValidatorUnbondingDelegationsRequest = { } return message; }, + fromJSON(object: any): QueryValidatorUnbondingDelegationsRequest { + return { + validatorAddr: isSet(object.validatorAddr) ? String(object.validatorAddr) : "", + pagination: isSet(object.pagination) ? PageRequest.fromJSON(object.pagination) : undefined + }; + }, + toJSON(message: QueryValidatorUnbondingDelegationsRequest): unknown { + const obj: any = {}; + message.validatorAddr !== undefined && (obj.validatorAddr = message.validatorAddr); + message.pagination !== undefined && (obj.pagination = message.pagination ? PageRequest.toJSON(message.pagination) : undefined); + return obj; + }, fromPartial(object: Partial): QueryValidatorUnbondingDelegationsRequest { const message = createBaseQueryValidatorUnbondingDelegationsRequest(); message.validatorAddr = object.validatorAddr ?? ""; @@ -1344,10 +1532,14 @@ export const QueryValidatorUnbondingDelegationsRequest = { return message; }, fromAmino(object: QueryValidatorUnbondingDelegationsRequestAmino): QueryValidatorUnbondingDelegationsRequest { - return { - validatorAddr: object.validator_addr, - pagination: object?.pagination ? PageRequest.fromAmino(object.pagination) : undefined - }; + const message = createBaseQueryValidatorUnbondingDelegationsRequest(); + if (object.validator_addr !== undefined && object.validator_addr !== null) { + message.validatorAddr = object.validator_addr; + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromAmino(object.pagination); + } + return message; }, toAmino(message: QueryValidatorUnbondingDelegationsRequest): QueryValidatorUnbondingDelegationsRequestAmino { const obj: any = {}; @@ -1377,14 +1569,26 @@ export const QueryValidatorUnbondingDelegationsRequest = { }; } }; +GlobalDecoderRegistry.register(QueryValidatorUnbondingDelegationsRequest.typeUrl, QueryValidatorUnbondingDelegationsRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryValidatorUnbondingDelegationsRequest.aminoType, QueryValidatorUnbondingDelegationsRequest.typeUrl); function createBaseQueryValidatorUnbondingDelegationsResponse(): QueryValidatorUnbondingDelegationsResponse { return { unbondingResponses: [], - pagination: PageResponse.fromPartial({}) + pagination: undefined }; } export const QueryValidatorUnbondingDelegationsResponse = { typeUrl: "/cosmos.staking.v1beta1.QueryValidatorUnbondingDelegationsResponse", + aminoType: "cosmos-sdk/QueryValidatorUnbondingDelegationsResponse", + is(o: any): o is QueryValidatorUnbondingDelegationsResponse { + return o && (o.$typeUrl === QueryValidatorUnbondingDelegationsResponse.typeUrl || Array.isArray(o.unbondingResponses) && (!o.unbondingResponses.length || UnbondingDelegation.is(o.unbondingResponses[0]))); + }, + isSDK(o: any): o is QueryValidatorUnbondingDelegationsResponseSDKType { + return o && (o.$typeUrl === QueryValidatorUnbondingDelegationsResponse.typeUrl || Array.isArray(o.unbonding_responses) && (!o.unbonding_responses.length || UnbondingDelegation.isSDK(o.unbonding_responses[0]))); + }, + isAmino(o: any): o is QueryValidatorUnbondingDelegationsResponseAmino { + return o && (o.$typeUrl === QueryValidatorUnbondingDelegationsResponse.typeUrl || Array.isArray(o.unbonding_responses) && (!o.unbonding_responses.length || UnbondingDelegation.isAmino(o.unbonding_responses[0]))); + }, encode(message: QueryValidatorUnbondingDelegationsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.unbondingResponses) { UnbondingDelegation.encode(v!, writer.uint32(10).fork()).ldelim(); @@ -1414,6 +1618,22 @@ export const QueryValidatorUnbondingDelegationsResponse = { } return message; }, + fromJSON(object: any): QueryValidatorUnbondingDelegationsResponse { + return { + unbondingResponses: Array.isArray(object?.unbondingResponses) ? object.unbondingResponses.map((e: any) => UnbondingDelegation.fromJSON(e)) : [], + pagination: isSet(object.pagination) ? PageResponse.fromJSON(object.pagination) : undefined + }; + }, + toJSON(message: QueryValidatorUnbondingDelegationsResponse): unknown { + const obj: any = {}; + if (message.unbondingResponses) { + obj.unbondingResponses = message.unbondingResponses.map(e => e ? UnbondingDelegation.toJSON(e) : undefined); + } else { + obj.unbondingResponses = []; + } + message.pagination !== undefined && (obj.pagination = message.pagination ? PageResponse.toJSON(message.pagination) : undefined); + return obj; + }, fromPartial(object: Partial): QueryValidatorUnbondingDelegationsResponse { const message = createBaseQueryValidatorUnbondingDelegationsResponse(); message.unbondingResponses = object.unbondingResponses?.map(e => UnbondingDelegation.fromPartial(e)) || []; @@ -1421,10 +1641,12 @@ export const QueryValidatorUnbondingDelegationsResponse = { return message; }, fromAmino(object: QueryValidatorUnbondingDelegationsResponseAmino): QueryValidatorUnbondingDelegationsResponse { - return { - unbondingResponses: Array.isArray(object?.unbonding_responses) ? object.unbonding_responses.map((e: any) => UnbondingDelegation.fromAmino(e)) : [], - pagination: object?.pagination ? PageResponse.fromAmino(object.pagination) : undefined - }; + const message = createBaseQueryValidatorUnbondingDelegationsResponse(); + message.unbondingResponses = object.unbonding_responses?.map(e => UnbondingDelegation.fromAmino(e)) || []; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromAmino(object.pagination); + } + return message; }, toAmino(message: QueryValidatorUnbondingDelegationsResponse): QueryValidatorUnbondingDelegationsResponseAmino { const obj: any = {}; @@ -1458,6 +1680,8 @@ export const QueryValidatorUnbondingDelegationsResponse = { }; } }; +GlobalDecoderRegistry.register(QueryValidatorUnbondingDelegationsResponse.typeUrl, QueryValidatorUnbondingDelegationsResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryValidatorUnbondingDelegationsResponse.aminoType, QueryValidatorUnbondingDelegationsResponse.typeUrl); function createBaseQueryDelegationRequest(): QueryDelegationRequest { return { delegatorAddr: "", @@ -1466,6 +1690,16 @@ function createBaseQueryDelegationRequest(): QueryDelegationRequest { } export const QueryDelegationRequest = { typeUrl: "/cosmos.staking.v1beta1.QueryDelegationRequest", + aminoType: "cosmos-sdk/QueryDelegationRequest", + is(o: any): o is QueryDelegationRequest { + return o && (o.$typeUrl === QueryDelegationRequest.typeUrl || typeof o.delegatorAddr === "string" && typeof o.validatorAddr === "string"); + }, + isSDK(o: any): o is QueryDelegationRequestSDKType { + return o && (o.$typeUrl === QueryDelegationRequest.typeUrl || typeof o.delegator_addr === "string" && typeof o.validator_addr === "string"); + }, + isAmino(o: any): o is QueryDelegationRequestAmino { + return o && (o.$typeUrl === QueryDelegationRequest.typeUrl || typeof o.delegator_addr === "string" && typeof o.validator_addr === "string"); + }, encode(message: QueryDelegationRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.delegatorAddr !== "") { writer.uint32(10).string(message.delegatorAddr); @@ -1495,6 +1729,18 @@ export const QueryDelegationRequest = { } 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; + }, fromPartial(object: Partial): QueryDelegationRequest { const message = createBaseQueryDelegationRequest(); message.delegatorAddr = object.delegatorAddr ?? ""; @@ -1502,10 +1748,14 @@ export const QueryDelegationRequest = { return message; }, fromAmino(object: QueryDelegationRequestAmino): QueryDelegationRequest { - return { - delegatorAddr: object.delegator_addr, - validatorAddr: object.validator_addr - }; + const message = createBaseQueryDelegationRequest(); + if (object.delegator_addr !== undefined && object.delegator_addr !== null) { + message.delegatorAddr = object.delegator_addr; + } + if (object.validator_addr !== undefined && object.validator_addr !== null) { + message.validatorAddr = object.validator_addr; + } + return message; }, toAmino(message: QueryDelegationRequest): QueryDelegationRequestAmino { const obj: any = {}; @@ -1535,13 +1785,25 @@ export const QueryDelegationRequest = { }; } }; +GlobalDecoderRegistry.register(QueryDelegationRequest.typeUrl, QueryDelegationRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryDelegationRequest.aminoType, QueryDelegationRequest.typeUrl); function createBaseQueryDelegationResponse(): QueryDelegationResponse { return { - delegationResponse: DelegationResponse.fromPartial({}) + delegationResponse: undefined }; } export const QueryDelegationResponse = { typeUrl: "/cosmos.staking.v1beta1.QueryDelegationResponse", + aminoType: "cosmos-sdk/QueryDelegationResponse", + is(o: any): o is QueryDelegationResponse { + return o && o.$typeUrl === QueryDelegationResponse.typeUrl; + }, + isSDK(o: any): o is QueryDelegationResponseSDKType { + return o && o.$typeUrl === QueryDelegationResponse.typeUrl; + }, + isAmino(o: any): o is QueryDelegationResponseAmino { + return o && o.$typeUrl === QueryDelegationResponse.typeUrl; + }, encode(message: QueryDelegationResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.delegationResponse !== undefined) { DelegationResponse.encode(message.delegationResponse, writer.uint32(10).fork()).ldelim(); @@ -1565,15 +1827,27 @@ export const QueryDelegationResponse = { } return message; }, + fromJSON(object: any): QueryDelegationResponse { + return { + 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; + }, fromPartial(object: Partial): QueryDelegationResponse { const message = createBaseQueryDelegationResponse(); message.delegationResponse = object.delegationResponse !== undefined && object.delegationResponse !== null ? DelegationResponse.fromPartial(object.delegationResponse) : undefined; return message; }, fromAmino(object: QueryDelegationResponseAmino): QueryDelegationResponse { - return { - delegationResponse: object?.delegation_response ? DelegationResponse.fromAmino(object.delegation_response) : undefined - }; + const message = createBaseQueryDelegationResponse(); + if (object.delegation_response !== undefined && object.delegation_response !== null) { + message.delegationResponse = DelegationResponse.fromAmino(object.delegation_response); + } + return message; }, toAmino(message: QueryDelegationResponse): QueryDelegationResponseAmino { const obj: any = {}; @@ -1602,6 +1876,8 @@ export const QueryDelegationResponse = { }; } }; +GlobalDecoderRegistry.register(QueryDelegationResponse.typeUrl, QueryDelegationResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryDelegationResponse.aminoType, QueryDelegationResponse.typeUrl); function createBaseQueryUnbondingDelegationRequest(): QueryUnbondingDelegationRequest { return { delegatorAddr: "", @@ -1610,6 +1886,16 @@ function createBaseQueryUnbondingDelegationRequest(): QueryUnbondingDelegationRe } export const QueryUnbondingDelegationRequest = { typeUrl: "/cosmos.staking.v1beta1.QueryUnbondingDelegationRequest", + aminoType: "cosmos-sdk/QueryUnbondingDelegationRequest", + is(o: any): o is QueryUnbondingDelegationRequest { + return o && (o.$typeUrl === QueryUnbondingDelegationRequest.typeUrl || typeof o.delegatorAddr === "string" && typeof o.validatorAddr === "string"); + }, + isSDK(o: any): o is QueryUnbondingDelegationRequestSDKType { + return o && (o.$typeUrl === QueryUnbondingDelegationRequest.typeUrl || typeof o.delegator_addr === "string" && typeof o.validator_addr === "string"); + }, + isAmino(o: any): o is QueryUnbondingDelegationRequestAmino { + return o && (o.$typeUrl === QueryUnbondingDelegationRequest.typeUrl || typeof o.delegator_addr === "string" && typeof o.validator_addr === "string"); + }, encode(message: QueryUnbondingDelegationRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.delegatorAddr !== "") { writer.uint32(10).string(message.delegatorAddr); @@ -1639,6 +1925,18 @@ export const QueryUnbondingDelegationRequest = { } 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; + }, fromPartial(object: Partial): QueryUnbondingDelegationRequest { const message = createBaseQueryUnbondingDelegationRequest(); message.delegatorAddr = object.delegatorAddr ?? ""; @@ -1646,10 +1944,14 @@ export const QueryUnbondingDelegationRequest = { return message; }, fromAmino(object: QueryUnbondingDelegationRequestAmino): QueryUnbondingDelegationRequest { - return { - delegatorAddr: object.delegator_addr, - validatorAddr: object.validator_addr - }; + const message = createBaseQueryUnbondingDelegationRequest(); + if (object.delegator_addr !== undefined && object.delegator_addr !== null) { + message.delegatorAddr = object.delegator_addr; + } + if (object.validator_addr !== undefined && object.validator_addr !== null) { + message.validatorAddr = object.validator_addr; + } + return message; }, toAmino(message: QueryUnbondingDelegationRequest): QueryUnbondingDelegationRequestAmino { const obj: any = {}; @@ -1679,6 +1981,8 @@ export const QueryUnbondingDelegationRequest = { }; } }; +GlobalDecoderRegistry.register(QueryUnbondingDelegationRequest.typeUrl, QueryUnbondingDelegationRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryUnbondingDelegationRequest.aminoType, QueryUnbondingDelegationRequest.typeUrl); function createBaseQueryUnbondingDelegationResponse(): QueryUnbondingDelegationResponse { return { unbond: UnbondingDelegation.fromPartial({}) @@ -1686,6 +1990,16 @@ function createBaseQueryUnbondingDelegationResponse(): QueryUnbondingDelegationR } export const QueryUnbondingDelegationResponse = { typeUrl: "/cosmos.staking.v1beta1.QueryUnbondingDelegationResponse", + aminoType: "cosmos-sdk/QueryUnbondingDelegationResponse", + is(o: any): o is QueryUnbondingDelegationResponse { + return o && (o.$typeUrl === QueryUnbondingDelegationResponse.typeUrl || UnbondingDelegation.is(o.unbond)); + }, + isSDK(o: any): o is QueryUnbondingDelegationResponseSDKType { + return o && (o.$typeUrl === QueryUnbondingDelegationResponse.typeUrl || UnbondingDelegation.isSDK(o.unbond)); + }, + isAmino(o: any): o is QueryUnbondingDelegationResponseAmino { + return o && (o.$typeUrl === QueryUnbondingDelegationResponse.typeUrl || UnbondingDelegation.isAmino(o.unbond)); + }, encode(message: QueryUnbondingDelegationResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.unbond !== undefined) { UnbondingDelegation.encode(message.unbond, writer.uint32(10).fork()).ldelim(); @@ -1709,19 +2023,31 @@ export const QueryUnbondingDelegationResponse = { } return message; }, + fromJSON(object: any): QueryUnbondingDelegationResponse { + return { + unbond: isSet(object.unbond) ? UnbondingDelegation.fromJSON(object.unbond) : undefined + }; + }, + toJSON(message: QueryUnbondingDelegationResponse): unknown { + const obj: any = {}; + message.unbond !== undefined && (obj.unbond = message.unbond ? UnbondingDelegation.toJSON(message.unbond) : undefined); + return obj; + }, fromPartial(object: Partial): QueryUnbondingDelegationResponse { const message = createBaseQueryUnbondingDelegationResponse(); message.unbond = object.unbond !== undefined && object.unbond !== null ? UnbondingDelegation.fromPartial(object.unbond) : undefined; return message; }, fromAmino(object: QueryUnbondingDelegationResponseAmino): QueryUnbondingDelegationResponse { - return { - unbond: object?.unbond ? UnbondingDelegation.fromAmino(object.unbond) : undefined - }; + const message = createBaseQueryUnbondingDelegationResponse(); + if (object.unbond !== undefined && object.unbond !== null) { + message.unbond = UnbondingDelegation.fromAmino(object.unbond); + } + return message; }, toAmino(message: QueryUnbondingDelegationResponse): QueryUnbondingDelegationResponseAmino { const obj: any = {}; - obj.unbond = message.unbond ? UnbondingDelegation.toAmino(message.unbond) : undefined; + obj.unbond = message.unbond ? UnbondingDelegation.toAmino(message.unbond) : UnbondingDelegation.fromPartial({}); return obj; }, fromAminoMsg(object: QueryUnbondingDelegationResponseAminoMsg): QueryUnbondingDelegationResponse { @@ -1746,14 +2072,26 @@ export const QueryUnbondingDelegationResponse = { }; } }; +GlobalDecoderRegistry.register(QueryUnbondingDelegationResponse.typeUrl, QueryUnbondingDelegationResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryUnbondingDelegationResponse.aminoType, QueryUnbondingDelegationResponse.typeUrl); function createBaseQueryDelegatorDelegationsRequest(): QueryDelegatorDelegationsRequest { return { delegatorAddr: "", - pagination: PageRequest.fromPartial({}) + pagination: undefined }; } export const QueryDelegatorDelegationsRequest = { typeUrl: "/cosmos.staking.v1beta1.QueryDelegatorDelegationsRequest", + aminoType: "cosmos-sdk/QueryDelegatorDelegationsRequest", + is(o: any): o is QueryDelegatorDelegationsRequest { + return o && (o.$typeUrl === QueryDelegatorDelegationsRequest.typeUrl || typeof o.delegatorAddr === "string"); + }, + isSDK(o: any): o is QueryDelegatorDelegationsRequestSDKType { + return o && (o.$typeUrl === QueryDelegatorDelegationsRequest.typeUrl || typeof o.delegator_addr === "string"); + }, + isAmino(o: any): o is QueryDelegatorDelegationsRequestAmino { + return o && (o.$typeUrl === QueryDelegatorDelegationsRequest.typeUrl || typeof o.delegator_addr === "string"); + }, encode(message: QueryDelegatorDelegationsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.delegatorAddr !== "") { writer.uint32(10).string(message.delegatorAddr); @@ -1783,6 +2121,18 @@ export const QueryDelegatorDelegationsRequest = { } return message; }, + fromJSON(object: any): QueryDelegatorDelegationsRequest { + return { + delegatorAddr: isSet(object.delegatorAddr) ? String(object.delegatorAddr) : "", + pagination: isSet(object.pagination) ? PageRequest.fromJSON(object.pagination) : undefined + }; + }, + toJSON(message: QueryDelegatorDelegationsRequest): unknown { + const obj: any = {}; + message.delegatorAddr !== undefined && (obj.delegatorAddr = message.delegatorAddr); + message.pagination !== undefined && (obj.pagination = message.pagination ? PageRequest.toJSON(message.pagination) : undefined); + return obj; + }, fromPartial(object: Partial): QueryDelegatorDelegationsRequest { const message = createBaseQueryDelegatorDelegationsRequest(); message.delegatorAddr = object.delegatorAddr ?? ""; @@ -1790,10 +2140,14 @@ export const QueryDelegatorDelegationsRequest = { return message; }, fromAmino(object: QueryDelegatorDelegationsRequestAmino): QueryDelegatorDelegationsRequest { - return { - delegatorAddr: object.delegator_addr, - pagination: object?.pagination ? PageRequest.fromAmino(object.pagination) : undefined - }; + const message = createBaseQueryDelegatorDelegationsRequest(); + if (object.delegator_addr !== undefined && object.delegator_addr !== null) { + message.delegatorAddr = object.delegator_addr; + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromAmino(object.pagination); + } + return message; }, toAmino(message: QueryDelegatorDelegationsRequest): QueryDelegatorDelegationsRequestAmino { const obj: any = {}; @@ -1823,14 +2177,26 @@ export const QueryDelegatorDelegationsRequest = { }; } }; +GlobalDecoderRegistry.register(QueryDelegatorDelegationsRequest.typeUrl, QueryDelegatorDelegationsRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryDelegatorDelegationsRequest.aminoType, QueryDelegatorDelegationsRequest.typeUrl); function createBaseQueryDelegatorDelegationsResponse(): QueryDelegatorDelegationsResponse { return { delegationResponses: [], - pagination: PageResponse.fromPartial({}) + pagination: undefined }; } export const QueryDelegatorDelegationsResponse = { typeUrl: "/cosmos.staking.v1beta1.QueryDelegatorDelegationsResponse", + aminoType: "cosmos-sdk/QueryDelegatorDelegationsResponse", + is(o: any): o is QueryDelegatorDelegationsResponse { + return o && (o.$typeUrl === QueryDelegatorDelegationsResponse.typeUrl || Array.isArray(o.delegationResponses) && (!o.delegationResponses.length || DelegationResponse.is(o.delegationResponses[0]))); + }, + isSDK(o: any): o is QueryDelegatorDelegationsResponseSDKType { + return o && (o.$typeUrl === QueryDelegatorDelegationsResponse.typeUrl || Array.isArray(o.delegation_responses) && (!o.delegation_responses.length || DelegationResponse.isSDK(o.delegation_responses[0]))); + }, + isAmino(o: any): o is QueryDelegatorDelegationsResponseAmino { + return o && (o.$typeUrl === QueryDelegatorDelegationsResponse.typeUrl || Array.isArray(o.delegation_responses) && (!o.delegation_responses.length || DelegationResponse.isAmino(o.delegation_responses[0]))); + }, encode(message: QueryDelegatorDelegationsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.delegationResponses) { DelegationResponse.encode(v!, writer.uint32(10).fork()).ldelim(); @@ -1860,6 +2226,22 @@ export const QueryDelegatorDelegationsResponse = { } return message; }, + fromJSON(object: any): QueryDelegatorDelegationsResponse { + return { + delegationResponses: Array.isArray(object?.delegationResponses) ? object.delegationResponses.map((e: any) => DelegationResponse.fromJSON(e)) : [], + pagination: isSet(object.pagination) ? PageResponse.fromJSON(object.pagination) : undefined + }; + }, + toJSON(message: QueryDelegatorDelegationsResponse): unknown { + const obj: any = {}; + if (message.delegationResponses) { + obj.delegationResponses = message.delegationResponses.map(e => e ? DelegationResponse.toJSON(e) : undefined); + } else { + obj.delegationResponses = []; + } + message.pagination !== undefined && (obj.pagination = message.pagination ? PageResponse.toJSON(message.pagination) : undefined); + return obj; + }, fromPartial(object: Partial): QueryDelegatorDelegationsResponse { const message = createBaseQueryDelegatorDelegationsResponse(); message.delegationResponses = object.delegationResponses?.map(e => DelegationResponse.fromPartial(e)) || []; @@ -1867,10 +2249,12 @@ export const QueryDelegatorDelegationsResponse = { return message; }, fromAmino(object: QueryDelegatorDelegationsResponseAmino): QueryDelegatorDelegationsResponse { - return { - delegationResponses: Array.isArray(object?.delegation_responses) ? object.delegation_responses.map((e: any) => DelegationResponse.fromAmino(e)) : [], - pagination: object?.pagination ? PageResponse.fromAmino(object.pagination) : undefined - }; + const message = createBaseQueryDelegatorDelegationsResponse(); + message.delegationResponses = object.delegation_responses?.map(e => DelegationResponse.fromAmino(e)) || []; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromAmino(object.pagination); + } + return message; }, toAmino(message: QueryDelegatorDelegationsResponse): QueryDelegatorDelegationsResponseAmino { const obj: any = {}; @@ -1904,14 +2288,26 @@ export const QueryDelegatorDelegationsResponse = { }; } }; +GlobalDecoderRegistry.register(QueryDelegatorDelegationsResponse.typeUrl, QueryDelegatorDelegationsResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryDelegatorDelegationsResponse.aminoType, QueryDelegatorDelegationsResponse.typeUrl); function createBaseQueryDelegatorUnbondingDelegationsRequest(): QueryDelegatorUnbondingDelegationsRequest { return { delegatorAddr: "", - pagination: PageRequest.fromPartial({}) + pagination: undefined }; } export const QueryDelegatorUnbondingDelegationsRequest = { typeUrl: "/cosmos.staking.v1beta1.QueryDelegatorUnbondingDelegationsRequest", + aminoType: "cosmos-sdk/QueryDelegatorUnbondingDelegationsRequest", + is(o: any): o is QueryDelegatorUnbondingDelegationsRequest { + return o && (o.$typeUrl === QueryDelegatorUnbondingDelegationsRequest.typeUrl || typeof o.delegatorAddr === "string"); + }, + isSDK(o: any): o is QueryDelegatorUnbondingDelegationsRequestSDKType { + return o && (o.$typeUrl === QueryDelegatorUnbondingDelegationsRequest.typeUrl || typeof o.delegator_addr === "string"); + }, + isAmino(o: any): o is QueryDelegatorUnbondingDelegationsRequestAmino { + return o && (o.$typeUrl === QueryDelegatorUnbondingDelegationsRequest.typeUrl || typeof o.delegator_addr === "string"); + }, encode(message: QueryDelegatorUnbondingDelegationsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.delegatorAddr !== "") { writer.uint32(10).string(message.delegatorAddr); @@ -1941,6 +2337,18 @@ export const QueryDelegatorUnbondingDelegationsRequest = { } return message; }, + fromJSON(object: any): QueryDelegatorUnbondingDelegationsRequest { + return { + delegatorAddr: isSet(object.delegatorAddr) ? String(object.delegatorAddr) : "", + pagination: isSet(object.pagination) ? PageRequest.fromJSON(object.pagination) : undefined + }; + }, + toJSON(message: QueryDelegatorUnbondingDelegationsRequest): unknown { + const obj: any = {}; + message.delegatorAddr !== undefined && (obj.delegatorAddr = message.delegatorAddr); + message.pagination !== undefined && (obj.pagination = message.pagination ? PageRequest.toJSON(message.pagination) : undefined); + return obj; + }, fromPartial(object: Partial): QueryDelegatorUnbondingDelegationsRequest { const message = createBaseQueryDelegatorUnbondingDelegationsRequest(); message.delegatorAddr = object.delegatorAddr ?? ""; @@ -1948,10 +2356,14 @@ export const QueryDelegatorUnbondingDelegationsRequest = { return message; }, fromAmino(object: QueryDelegatorUnbondingDelegationsRequestAmino): QueryDelegatorUnbondingDelegationsRequest { - return { - delegatorAddr: object.delegator_addr, - pagination: object?.pagination ? PageRequest.fromAmino(object.pagination) : undefined - }; + const message = createBaseQueryDelegatorUnbondingDelegationsRequest(); + if (object.delegator_addr !== undefined && object.delegator_addr !== null) { + message.delegatorAddr = object.delegator_addr; + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromAmino(object.pagination); + } + return message; }, toAmino(message: QueryDelegatorUnbondingDelegationsRequest): QueryDelegatorUnbondingDelegationsRequestAmino { const obj: any = {}; @@ -1981,14 +2393,26 @@ export const QueryDelegatorUnbondingDelegationsRequest = { }; } }; +GlobalDecoderRegistry.register(QueryDelegatorUnbondingDelegationsRequest.typeUrl, QueryDelegatorUnbondingDelegationsRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryDelegatorUnbondingDelegationsRequest.aminoType, QueryDelegatorUnbondingDelegationsRequest.typeUrl); function createBaseQueryDelegatorUnbondingDelegationsResponse(): QueryDelegatorUnbondingDelegationsResponse { return { unbondingResponses: [], - pagination: PageResponse.fromPartial({}) + pagination: undefined }; } export const QueryDelegatorUnbondingDelegationsResponse = { typeUrl: "/cosmos.staking.v1beta1.QueryDelegatorUnbondingDelegationsResponse", + aminoType: "cosmos-sdk/QueryDelegatorUnbondingDelegationsResponse", + is(o: any): o is QueryDelegatorUnbondingDelegationsResponse { + return o && (o.$typeUrl === QueryDelegatorUnbondingDelegationsResponse.typeUrl || Array.isArray(o.unbondingResponses) && (!o.unbondingResponses.length || UnbondingDelegation.is(o.unbondingResponses[0]))); + }, + isSDK(o: any): o is QueryDelegatorUnbondingDelegationsResponseSDKType { + return o && (o.$typeUrl === QueryDelegatorUnbondingDelegationsResponse.typeUrl || Array.isArray(o.unbonding_responses) && (!o.unbonding_responses.length || UnbondingDelegation.isSDK(o.unbonding_responses[0]))); + }, + isAmino(o: any): o is QueryDelegatorUnbondingDelegationsResponseAmino { + return o && (o.$typeUrl === QueryDelegatorUnbondingDelegationsResponse.typeUrl || Array.isArray(o.unbonding_responses) && (!o.unbonding_responses.length || UnbondingDelegation.isAmino(o.unbonding_responses[0]))); + }, encode(message: QueryDelegatorUnbondingDelegationsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.unbondingResponses) { UnbondingDelegation.encode(v!, writer.uint32(10).fork()).ldelim(); @@ -2018,6 +2442,22 @@ export const QueryDelegatorUnbondingDelegationsResponse = { } return message; }, + fromJSON(object: any): QueryDelegatorUnbondingDelegationsResponse { + return { + unbondingResponses: Array.isArray(object?.unbondingResponses) ? object.unbondingResponses.map((e: any) => UnbondingDelegation.fromJSON(e)) : [], + pagination: isSet(object.pagination) ? PageResponse.fromJSON(object.pagination) : undefined + }; + }, + toJSON(message: QueryDelegatorUnbondingDelegationsResponse): unknown { + const obj: any = {}; + if (message.unbondingResponses) { + obj.unbondingResponses = message.unbondingResponses.map(e => e ? UnbondingDelegation.toJSON(e) : undefined); + } else { + obj.unbondingResponses = []; + } + message.pagination !== undefined && (obj.pagination = message.pagination ? PageResponse.toJSON(message.pagination) : undefined); + return obj; + }, fromPartial(object: Partial): QueryDelegatorUnbondingDelegationsResponse { const message = createBaseQueryDelegatorUnbondingDelegationsResponse(); message.unbondingResponses = object.unbondingResponses?.map(e => UnbondingDelegation.fromPartial(e)) || []; @@ -2025,10 +2465,12 @@ export const QueryDelegatorUnbondingDelegationsResponse = { return message; }, fromAmino(object: QueryDelegatorUnbondingDelegationsResponseAmino): QueryDelegatorUnbondingDelegationsResponse { - return { - unbondingResponses: Array.isArray(object?.unbonding_responses) ? object.unbonding_responses.map((e: any) => UnbondingDelegation.fromAmino(e)) : [], - pagination: object?.pagination ? PageResponse.fromAmino(object.pagination) : undefined - }; + const message = createBaseQueryDelegatorUnbondingDelegationsResponse(); + message.unbondingResponses = object.unbonding_responses?.map(e => UnbondingDelegation.fromAmino(e)) || []; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromAmino(object.pagination); + } + return message; }, toAmino(message: QueryDelegatorUnbondingDelegationsResponse): QueryDelegatorUnbondingDelegationsResponseAmino { const obj: any = {}; @@ -2062,16 +2504,28 @@ export const QueryDelegatorUnbondingDelegationsResponse = { }; } }; +GlobalDecoderRegistry.register(QueryDelegatorUnbondingDelegationsResponse.typeUrl, QueryDelegatorUnbondingDelegationsResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryDelegatorUnbondingDelegationsResponse.aminoType, QueryDelegatorUnbondingDelegationsResponse.typeUrl); function createBaseQueryRedelegationsRequest(): QueryRedelegationsRequest { return { delegatorAddr: "", srcValidatorAddr: "", dstValidatorAddr: "", - pagination: PageRequest.fromPartial({}) + pagination: undefined }; } export const QueryRedelegationsRequest = { typeUrl: "/cosmos.staking.v1beta1.QueryRedelegationsRequest", + aminoType: "cosmos-sdk/QueryRedelegationsRequest", + is(o: any): o is QueryRedelegationsRequest { + return o && (o.$typeUrl === QueryRedelegationsRequest.typeUrl || typeof o.delegatorAddr === "string" && typeof o.srcValidatorAddr === "string" && typeof o.dstValidatorAddr === "string"); + }, + isSDK(o: any): o is QueryRedelegationsRequestSDKType { + return o && (o.$typeUrl === QueryRedelegationsRequest.typeUrl || typeof o.delegator_addr === "string" && typeof o.src_validator_addr === "string" && typeof o.dst_validator_addr === "string"); + }, + isAmino(o: any): o is QueryRedelegationsRequestAmino { + return o && (o.$typeUrl === QueryRedelegationsRequest.typeUrl || typeof o.delegator_addr === "string" && typeof o.src_validator_addr === "string" && typeof o.dst_validator_addr === "string"); + }, encode(message: QueryRedelegationsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.delegatorAddr !== "") { writer.uint32(10).string(message.delegatorAddr); @@ -2113,6 +2567,22 @@ export const QueryRedelegationsRequest = { } 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 + }; + }, + 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); + message.pagination !== undefined && (obj.pagination = message.pagination ? PageRequest.toJSON(message.pagination) : undefined); + return obj; + }, fromPartial(object: Partial): QueryRedelegationsRequest { const message = createBaseQueryRedelegationsRequest(); message.delegatorAddr = object.delegatorAddr ?? ""; @@ -2122,12 +2592,20 @@ export const QueryRedelegationsRequest = { return message; }, fromAmino(object: QueryRedelegationsRequestAmino): QueryRedelegationsRequest { - return { - delegatorAddr: object.delegator_addr, - srcValidatorAddr: object.src_validator_addr, - dstValidatorAddr: object.dst_validator_addr, - pagination: object?.pagination ? PageRequest.fromAmino(object.pagination) : undefined - }; + const message = createBaseQueryRedelegationsRequest(); + if (object.delegator_addr !== undefined && object.delegator_addr !== null) { + message.delegatorAddr = object.delegator_addr; + } + if (object.src_validator_addr !== undefined && object.src_validator_addr !== null) { + message.srcValidatorAddr = object.src_validator_addr; + } + if (object.dst_validator_addr !== undefined && object.dst_validator_addr !== null) { + message.dstValidatorAddr = object.dst_validator_addr; + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromAmino(object.pagination); + } + return message; }, toAmino(message: QueryRedelegationsRequest): QueryRedelegationsRequestAmino { const obj: any = {}; @@ -2159,14 +2637,26 @@ export const QueryRedelegationsRequest = { }; } }; +GlobalDecoderRegistry.register(QueryRedelegationsRequest.typeUrl, QueryRedelegationsRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryRedelegationsRequest.aminoType, QueryRedelegationsRequest.typeUrl); function createBaseQueryRedelegationsResponse(): QueryRedelegationsResponse { return { redelegationResponses: [], - pagination: PageResponse.fromPartial({}) + pagination: undefined }; } export const QueryRedelegationsResponse = { typeUrl: "/cosmos.staking.v1beta1.QueryRedelegationsResponse", + aminoType: "cosmos-sdk/QueryRedelegationsResponse", + is(o: any): o is QueryRedelegationsResponse { + return o && (o.$typeUrl === QueryRedelegationsResponse.typeUrl || Array.isArray(o.redelegationResponses) && (!o.redelegationResponses.length || RedelegationResponse.is(o.redelegationResponses[0]))); + }, + isSDK(o: any): o is QueryRedelegationsResponseSDKType { + return o && (o.$typeUrl === QueryRedelegationsResponse.typeUrl || Array.isArray(o.redelegation_responses) && (!o.redelegation_responses.length || RedelegationResponse.isSDK(o.redelegation_responses[0]))); + }, + isAmino(o: any): o is QueryRedelegationsResponseAmino { + return o && (o.$typeUrl === QueryRedelegationsResponse.typeUrl || Array.isArray(o.redelegation_responses) && (!o.redelegation_responses.length || RedelegationResponse.isAmino(o.redelegation_responses[0]))); + }, encode(message: QueryRedelegationsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.redelegationResponses) { RedelegationResponse.encode(v!, writer.uint32(10).fork()).ldelim(); @@ -2196,6 +2686,22 @@ export const QueryRedelegationsResponse = { } return message; }, + fromJSON(object: any): QueryRedelegationsResponse { + return { + redelegationResponses: Array.isArray(object?.redelegationResponses) ? object.redelegationResponses.map((e: any) => RedelegationResponse.fromJSON(e)) : [], + pagination: isSet(object.pagination) ? PageResponse.fromJSON(object.pagination) : undefined + }; + }, + toJSON(message: QueryRedelegationsResponse): unknown { + const obj: any = {}; + if (message.redelegationResponses) { + obj.redelegationResponses = message.redelegationResponses.map(e => e ? RedelegationResponse.toJSON(e) : undefined); + } else { + obj.redelegationResponses = []; + } + message.pagination !== undefined && (obj.pagination = message.pagination ? PageResponse.toJSON(message.pagination) : undefined); + return obj; + }, fromPartial(object: Partial): QueryRedelegationsResponse { const message = createBaseQueryRedelegationsResponse(); message.redelegationResponses = object.redelegationResponses?.map(e => RedelegationResponse.fromPartial(e)) || []; @@ -2203,10 +2709,12 @@ export const QueryRedelegationsResponse = { return message; }, fromAmino(object: QueryRedelegationsResponseAmino): QueryRedelegationsResponse { - return { - redelegationResponses: Array.isArray(object?.redelegation_responses) ? object.redelegation_responses.map((e: any) => RedelegationResponse.fromAmino(e)) : [], - pagination: object?.pagination ? PageResponse.fromAmino(object.pagination) : undefined - }; + const message = createBaseQueryRedelegationsResponse(); + message.redelegationResponses = object.redelegation_responses?.map(e => RedelegationResponse.fromAmino(e)) || []; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromAmino(object.pagination); + } + return message; }, toAmino(message: QueryRedelegationsResponse): QueryRedelegationsResponseAmino { const obj: any = {}; @@ -2240,14 +2748,26 @@ export const QueryRedelegationsResponse = { }; } }; +GlobalDecoderRegistry.register(QueryRedelegationsResponse.typeUrl, QueryRedelegationsResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryRedelegationsResponse.aminoType, QueryRedelegationsResponse.typeUrl); function createBaseQueryDelegatorValidatorsRequest(): QueryDelegatorValidatorsRequest { return { delegatorAddr: "", - pagination: PageRequest.fromPartial({}) + pagination: undefined }; } export const QueryDelegatorValidatorsRequest = { typeUrl: "/cosmos.staking.v1beta1.QueryDelegatorValidatorsRequest", + aminoType: "cosmos-sdk/QueryDelegatorValidatorsRequest", + is(o: any): o is QueryDelegatorValidatorsRequest { + return o && (o.$typeUrl === QueryDelegatorValidatorsRequest.typeUrl || typeof o.delegatorAddr === "string"); + }, + isSDK(o: any): o is QueryDelegatorValidatorsRequestSDKType { + return o && (o.$typeUrl === QueryDelegatorValidatorsRequest.typeUrl || typeof o.delegator_addr === "string"); + }, + isAmino(o: any): o is QueryDelegatorValidatorsRequestAmino { + return o && (o.$typeUrl === QueryDelegatorValidatorsRequest.typeUrl || typeof o.delegator_addr === "string"); + }, encode(message: QueryDelegatorValidatorsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.delegatorAddr !== "") { writer.uint32(10).string(message.delegatorAddr); @@ -2277,6 +2797,18 @@ export const QueryDelegatorValidatorsRequest = { } return message; }, + fromJSON(object: any): QueryDelegatorValidatorsRequest { + return { + delegatorAddr: isSet(object.delegatorAddr) ? String(object.delegatorAddr) : "", + pagination: isSet(object.pagination) ? PageRequest.fromJSON(object.pagination) : undefined + }; + }, + toJSON(message: QueryDelegatorValidatorsRequest): unknown { + const obj: any = {}; + message.delegatorAddr !== undefined && (obj.delegatorAddr = message.delegatorAddr); + message.pagination !== undefined && (obj.pagination = message.pagination ? PageRequest.toJSON(message.pagination) : undefined); + return obj; + }, fromPartial(object: Partial): QueryDelegatorValidatorsRequest { const message = createBaseQueryDelegatorValidatorsRequest(); message.delegatorAddr = object.delegatorAddr ?? ""; @@ -2284,10 +2816,14 @@ export const QueryDelegatorValidatorsRequest = { return message; }, fromAmino(object: QueryDelegatorValidatorsRequestAmino): QueryDelegatorValidatorsRequest { - return { - delegatorAddr: object.delegator_addr, - pagination: object?.pagination ? PageRequest.fromAmino(object.pagination) : undefined - }; + const message = createBaseQueryDelegatorValidatorsRequest(); + if (object.delegator_addr !== undefined && object.delegator_addr !== null) { + message.delegatorAddr = object.delegator_addr; + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromAmino(object.pagination); + } + return message; }, toAmino(message: QueryDelegatorValidatorsRequest): QueryDelegatorValidatorsRequestAmino { const obj: any = {}; @@ -2317,14 +2853,26 @@ export const QueryDelegatorValidatorsRequest = { }; } }; +GlobalDecoderRegistry.register(QueryDelegatorValidatorsRequest.typeUrl, QueryDelegatorValidatorsRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryDelegatorValidatorsRequest.aminoType, QueryDelegatorValidatorsRequest.typeUrl); function createBaseQueryDelegatorValidatorsResponse(): QueryDelegatorValidatorsResponse { return { validators: [], - pagination: PageResponse.fromPartial({}) + pagination: undefined }; } export const QueryDelegatorValidatorsResponse = { typeUrl: "/cosmos.staking.v1beta1.QueryDelegatorValidatorsResponse", + aminoType: "cosmos-sdk/QueryDelegatorValidatorsResponse", + is(o: any): o is QueryDelegatorValidatorsResponse { + return o && (o.$typeUrl === QueryDelegatorValidatorsResponse.typeUrl || Array.isArray(o.validators) && (!o.validators.length || Validator.is(o.validators[0]))); + }, + isSDK(o: any): o is QueryDelegatorValidatorsResponseSDKType { + return o && (o.$typeUrl === QueryDelegatorValidatorsResponse.typeUrl || Array.isArray(o.validators) && (!o.validators.length || Validator.isSDK(o.validators[0]))); + }, + isAmino(o: any): o is QueryDelegatorValidatorsResponseAmino { + return o && (o.$typeUrl === QueryDelegatorValidatorsResponse.typeUrl || Array.isArray(o.validators) && (!o.validators.length || Validator.isAmino(o.validators[0]))); + }, encode(message: QueryDelegatorValidatorsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.validators) { Validator.encode(v!, writer.uint32(10).fork()).ldelim(); @@ -2354,6 +2902,22 @@ export const QueryDelegatorValidatorsResponse = { } 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 + }; + }, + toJSON(message: QueryDelegatorValidatorsResponse): unknown { + const obj: any = {}; + if (message.validators) { + obj.validators = message.validators.map(e => e ? Validator.toJSON(e) : undefined); + } else { + obj.validators = []; + } + message.pagination !== undefined && (obj.pagination = message.pagination ? PageResponse.toJSON(message.pagination) : undefined); + return obj; + }, fromPartial(object: Partial): QueryDelegatorValidatorsResponse { const message = createBaseQueryDelegatorValidatorsResponse(); message.validators = object.validators?.map(e => Validator.fromPartial(e)) || []; @@ -2361,10 +2925,12 @@ export const QueryDelegatorValidatorsResponse = { return message; }, fromAmino(object: QueryDelegatorValidatorsResponseAmino): QueryDelegatorValidatorsResponse { - return { - validators: Array.isArray(object?.validators) ? object.validators.map((e: any) => Validator.fromAmino(e)) : [], - pagination: object?.pagination ? PageResponse.fromAmino(object.pagination) : undefined - }; + const message = createBaseQueryDelegatorValidatorsResponse(); + message.validators = object.validators?.map(e => Validator.fromAmino(e)) || []; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromAmino(object.pagination); + } + return message; }, toAmino(message: QueryDelegatorValidatorsResponse): QueryDelegatorValidatorsResponseAmino { const obj: any = {}; @@ -2398,6 +2964,8 @@ export const QueryDelegatorValidatorsResponse = { }; } }; +GlobalDecoderRegistry.register(QueryDelegatorValidatorsResponse.typeUrl, QueryDelegatorValidatorsResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryDelegatorValidatorsResponse.aminoType, QueryDelegatorValidatorsResponse.typeUrl); function createBaseQueryDelegatorValidatorRequest(): QueryDelegatorValidatorRequest { return { delegatorAddr: "", @@ -2406,6 +2974,16 @@ function createBaseQueryDelegatorValidatorRequest(): QueryDelegatorValidatorRequ } export const QueryDelegatorValidatorRequest = { typeUrl: "/cosmos.staking.v1beta1.QueryDelegatorValidatorRequest", + aminoType: "cosmos-sdk/QueryDelegatorValidatorRequest", + is(o: any): o is QueryDelegatorValidatorRequest { + return o && (o.$typeUrl === QueryDelegatorValidatorRequest.typeUrl || typeof o.delegatorAddr === "string" && typeof o.validatorAddr === "string"); + }, + isSDK(o: any): o is QueryDelegatorValidatorRequestSDKType { + return o && (o.$typeUrl === QueryDelegatorValidatorRequest.typeUrl || typeof o.delegator_addr === "string" && typeof o.validator_addr === "string"); + }, + isAmino(o: any): o is QueryDelegatorValidatorRequestAmino { + return o && (o.$typeUrl === QueryDelegatorValidatorRequest.typeUrl || typeof o.delegator_addr === "string" && typeof o.validator_addr === "string"); + }, encode(message: QueryDelegatorValidatorRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.delegatorAddr !== "") { writer.uint32(10).string(message.delegatorAddr); @@ -2435,6 +3013,18 @@ export const QueryDelegatorValidatorRequest = { } 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; + }, fromPartial(object: Partial): QueryDelegatorValidatorRequest { const message = createBaseQueryDelegatorValidatorRequest(); message.delegatorAddr = object.delegatorAddr ?? ""; @@ -2442,10 +3032,14 @@ export const QueryDelegatorValidatorRequest = { return message; }, fromAmino(object: QueryDelegatorValidatorRequestAmino): QueryDelegatorValidatorRequest { - return { - delegatorAddr: object.delegator_addr, - validatorAddr: object.validator_addr - }; + const message = createBaseQueryDelegatorValidatorRequest(); + if (object.delegator_addr !== undefined && object.delegator_addr !== null) { + message.delegatorAddr = object.delegator_addr; + } + if (object.validator_addr !== undefined && object.validator_addr !== null) { + message.validatorAddr = object.validator_addr; + } + return message; }, toAmino(message: QueryDelegatorValidatorRequest): QueryDelegatorValidatorRequestAmino { const obj: any = {}; @@ -2475,6 +3069,8 @@ export const QueryDelegatorValidatorRequest = { }; } }; +GlobalDecoderRegistry.register(QueryDelegatorValidatorRequest.typeUrl, QueryDelegatorValidatorRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryDelegatorValidatorRequest.aminoType, QueryDelegatorValidatorRequest.typeUrl); function createBaseQueryDelegatorValidatorResponse(): QueryDelegatorValidatorResponse { return { validator: Validator.fromPartial({}) @@ -2482,6 +3078,16 @@ function createBaseQueryDelegatorValidatorResponse(): QueryDelegatorValidatorRes } export const QueryDelegatorValidatorResponse = { typeUrl: "/cosmos.staking.v1beta1.QueryDelegatorValidatorResponse", + aminoType: "cosmos-sdk/QueryDelegatorValidatorResponse", + is(o: any): o is QueryDelegatorValidatorResponse { + return o && (o.$typeUrl === QueryDelegatorValidatorResponse.typeUrl || Validator.is(o.validator)); + }, + isSDK(o: any): o is QueryDelegatorValidatorResponseSDKType { + return o && (o.$typeUrl === QueryDelegatorValidatorResponse.typeUrl || Validator.isSDK(o.validator)); + }, + isAmino(o: any): o is QueryDelegatorValidatorResponseAmino { + return o && (o.$typeUrl === QueryDelegatorValidatorResponse.typeUrl || Validator.isAmino(o.validator)); + }, encode(message: QueryDelegatorValidatorResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.validator !== undefined) { Validator.encode(message.validator, writer.uint32(10).fork()).ldelim(); @@ -2505,19 +3111,31 @@ export const QueryDelegatorValidatorResponse = { } return message; }, + fromJSON(object: any): QueryDelegatorValidatorResponse { + return { + validator: isSet(object.validator) ? Validator.fromJSON(object.validator) : undefined + }; + }, + toJSON(message: QueryDelegatorValidatorResponse): unknown { + const obj: any = {}; + message.validator !== undefined && (obj.validator = message.validator ? Validator.toJSON(message.validator) : undefined); + return obj; + }, fromPartial(object: Partial): QueryDelegatorValidatorResponse { const message = createBaseQueryDelegatorValidatorResponse(); message.validator = object.validator !== undefined && object.validator !== null ? Validator.fromPartial(object.validator) : undefined; return message; }, fromAmino(object: QueryDelegatorValidatorResponseAmino): QueryDelegatorValidatorResponse { - return { - validator: object?.validator ? Validator.fromAmino(object.validator) : undefined - }; + const message = createBaseQueryDelegatorValidatorResponse(); + if (object.validator !== undefined && object.validator !== null) { + message.validator = Validator.fromAmino(object.validator); + } + return message; }, toAmino(message: QueryDelegatorValidatorResponse): QueryDelegatorValidatorResponseAmino { const obj: any = {}; - obj.validator = message.validator ? Validator.toAmino(message.validator) : undefined; + obj.validator = message.validator ? Validator.toAmino(message.validator) : Validator.fromPartial({}); return obj; }, fromAminoMsg(object: QueryDelegatorValidatorResponseAminoMsg): QueryDelegatorValidatorResponse { @@ -2542,6 +3160,8 @@ export const QueryDelegatorValidatorResponse = { }; } }; +GlobalDecoderRegistry.register(QueryDelegatorValidatorResponse.typeUrl, QueryDelegatorValidatorResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryDelegatorValidatorResponse.aminoType, QueryDelegatorValidatorResponse.typeUrl); function createBaseQueryHistoricalInfoRequest(): QueryHistoricalInfoRequest { return { height: BigInt(0) @@ -2549,6 +3169,16 @@ function createBaseQueryHistoricalInfoRequest(): QueryHistoricalInfoRequest { } export const QueryHistoricalInfoRequest = { typeUrl: "/cosmos.staking.v1beta1.QueryHistoricalInfoRequest", + aminoType: "cosmos-sdk/QueryHistoricalInfoRequest", + is(o: any): o is QueryHistoricalInfoRequest { + return o && (o.$typeUrl === QueryHistoricalInfoRequest.typeUrl || typeof o.height === "bigint"); + }, + isSDK(o: any): o is QueryHistoricalInfoRequestSDKType { + return o && (o.$typeUrl === QueryHistoricalInfoRequest.typeUrl || typeof o.height === "bigint"); + }, + isAmino(o: any): o is QueryHistoricalInfoRequestAmino { + return o && (o.$typeUrl === QueryHistoricalInfoRequest.typeUrl || typeof o.height === "bigint"); + }, encode(message: QueryHistoricalInfoRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.height !== BigInt(0)) { writer.uint32(8).int64(message.height); @@ -2572,15 +3202,27 @@ export const QueryHistoricalInfoRequest = { } return message; }, + fromJSON(object: any): QueryHistoricalInfoRequest { + return { + height: isSet(object.height) ? BigInt(object.height.toString()) : BigInt(0) + }; + }, + toJSON(message: QueryHistoricalInfoRequest): unknown { + const obj: any = {}; + message.height !== undefined && (obj.height = (message.height || BigInt(0)).toString()); + return obj; + }, fromPartial(object: Partial): QueryHistoricalInfoRequest { const message = createBaseQueryHistoricalInfoRequest(); message.height = object.height !== undefined && object.height !== null ? BigInt(object.height.toString()) : BigInt(0); return message; }, fromAmino(object: QueryHistoricalInfoRequestAmino): QueryHistoricalInfoRequest { - return { - height: BigInt(object.height) - }; + const message = createBaseQueryHistoricalInfoRequest(); + if (object.height !== undefined && object.height !== null) { + message.height = BigInt(object.height); + } + return message; }, toAmino(message: QueryHistoricalInfoRequest): QueryHistoricalInfoRequestAmino { const obj: any = {}; @@ -2609,13 +3251,25 @@ export const QueryHistoricalInfoRequest = { }; } }; +GlobalDecoderRegistry.register(QueryHistoricalInfoRequest.typeUrl, QueryHistoricalInfoRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryHistoricalInfoRequest.aminoType, QueryHistoricalInfoRequest.typeUrl); function createBaseQueryHistoricalInfoResponse(): QueryHistoricalInfoResponse { return { - hist: HistoricalInfo.fromPartial({}) + hist: undefined }; } export const QueryHistoricalInfoResponse = { typeUrl: "/cosmos.staking.v1beta1.QueryHistoricalInfoResponse", + aminoType: "cosmos-sdk/QueryHistoricalInfoResponse", + is(o: any): o is QueryHistoricalInfoResponse { + return o && o.$typeUrl === QueryHistoricalInfoResponse.typeUrl; + }, + isSDK(o: any): o is QueryHistoricalInfoResponseSDKType { + return o && o.$typeUrl === QueryHistoricalInfoResponse.typeUrl; + }, + isAmino(o: any): o is QueryHistoricalInfoResponseAmino { + return o && o.$typeUrl === QueryHistoricalInfoResponse.typeUrl; + }, encode(message: QueryHistoricalInfoResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.hist !== undefined) { HistoricalInfo.encode(message.hist, writer.uint32(10).fork()).ldelim(); @@ -2639,15 +3293,27 @@ export const QueryHistoricalInfoResponse = { } return message; }, + fromJSON(object: any): QueryHistoricalInfoResponse { + 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; + }, fromPartial(object: Partial): QueryHistoricalInfoResponse { const message = createBaseQueryHistoricalInfoResponse(); message.hist = object.hist !== undefined && object.hist !== null ? HistoricalInfo.fromPartial(object.hist) : undefined; return message; }, fromAmino(object: QueryHistoricalInfoResponseAmino): QueryHistoricalInfoResponse { - return { - hist: object?.hist ? HistoricalInfo.fromAmino(object.hist) : undefined - }; + const message = createBaseQueryHistoricalInfoResponse(); + if (object.hist !== undefined && object.hist !== null) { + message.hist = HistoricalInfo.fromAmino(object.hist); + } + return message; }, toAmino(message: QueryHistoricalInfoResponse): QueryHistoricalInfoResponseAmino { const obj: any = {}; @@ -2676,11 +3342,23 @@ export const QueryHistoricalInfoResponse = { }; } }; +GlobalDecoderRegistry.register(QueryHistoricalInfoResponse.typeUrl, QueryHistoricalInfoResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryHistoricalInfoResponse.aminoType, QueryHistoricalInfoResponse.typeUrl); function createBaseQueryPoolRequest(): QueryPoolRequest { return {}; } export const QueryPoolRequest = { typeUrl: "/cosmos.staking.v1beta1.QueryPoolRequest", + aminoType: "cosmos-sdk/QueryPoolRequest", + is(o: any): o is QueryPoolRequest { + return o && o.$typeUrl === QueryPoolRequest.typeUrl; + }, + isSDK(o: any): o is QueryPoolRequestSDKType { + return o && o.$typeUrl === QueryPoolRequest.typeUrl; + }, + isAmino(o: any): o is QueryPoolRequestAmino { + return o && o.$typeUrl === QueryPoolRequest.typeUrl; + }, encode(_: QueryPoolRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, @@ -2698,12 +3376,20 @@ export const QueryPoolRequest = { } return message; }, + fromJSON(_: any): QueryPoolRequest { + return {}; + }, + toJSON(_: QueryPoolRequest): unknown { + const obj: any = {}; + return obj; + }, fromPartial(_: Partial): QueryPoolRequest { const message = createBaseQueryPoolRequest(); return message; }, fromAmino(_: QueryPoolRequestAmino): QueryPoolRequest { - return {}; + const message = createBaseQueryPoolRequest(); + return message; }, toAmino(_: QueryPoolRequest): QueryPoolRequestAmino { const obj: any = {}; @@ -2731,6 +3417,8 @@ export const QueryPoolRequest = { }; } }; +GlobalDecoderRegistry.register(QueryPoolRequest.typeUrl, QueryPoolRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryPoolRequest.aminoType, QueryPoolRequest.typeUrl); function createBaseQueryPoolResponse(): QueryPoolResponse { return { pool: Pool.fromPartial({}) @@ -2738,6 +3426,16 @@ function createBaseQueryPoolResponse(): QueryPoolResponse { } export const QueryPoolResponse = { typeUrl: "/cosmos.staking.v1beta1.QueryPoolResponse", + aminoType: "cosmos-sdk/QueryPoolResponse", + is(o: any): o is QueryPoolResponse { + return o && (o.$typeUrl === QueryPoolResponse.typeUrl || Pool.is(o.pool)); + }, + isSDK(o: any): o is QueryPoolResponseSDKType { + return o && (o.$typeUrl === QueryPoolResponse.typeUrl || Pool.isSDK(o.pool)); + }, + isAmino(o: any): o is QueryPoolResponseAmino { + return o && (o.$typeUrl === QueryPoolResponse.typeUrl || Pool.isAmino(o.pool)); + }, encode(message: QueryPoolResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.pool !== undefined) { Pool.encode(message.pool, writer.uint32(10).fork()).ldelim(); @@ -2761,19 +3459,31 @@ export const QueryPoolResponse = { } return message; }, + fromJSON(object: any): QueryPoolResponse { + 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; + }, fromPartial(object: Partial): QueryPoolResponse { const message = createBaseQueryPoolResponse(); message.pool = object.pool !== undefined && object.pool !== null ? Pool.fromPartial(object.pool) : undefined; return message; }, fromAmino(object: QueryPoolResponseAmino): QueryPoolResponse { - return { - pool: object?.pool ? Pool.fromAmino(object.pool) : undefined - }; + const message = createBaseQueryPoolResponse(); + if (object.pool !== undefined && object.pool !== null) { + message.pool = Pool.fromAmino(object.pool); + } + return message; }, toAmino(message: QueryPoolResponse): QueryPoolResponseAmino { const obj: any = {}; - obj.pool = message.pool ? Pool.toAmino(message.pool) : undefined; + obj.pool = message.pool ? Pool.toAmino(message.pool) : Pool.fromPartial({}); return obj; }, fromAminoMsg(object: QueryPoolResponseAminoMsg): QueryPoolResponse { @@ -2798,11 +3508,23 @@ export const QueryPoolResponse = { }; } }; +GlobalDecoderRegistry.register(QueryPoolResponse.typeUrl, QueryPoolResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryPoolResponse.aminoType, QueryPoolResponse.typeUrl); function createBaseQueryParamsRequest(): QueryParamsRequest { return {}; } export const QueryParamsRequest = { typeUrl: "/cosmos.staking.v1beta1.QueryParamsRequest", + aminoType: "cosmos-sdk/QueryParamsRequest", + is(o: any): o is QueryParamsRequest { + return o && o.$typeUrl === QueryParamsRequest.typeUrl; + }, + isSDK(o: any): o is QueryParamsRequestSDKType { + return o && o.$typeUrl === QueryParamsRequest.typeUrl; + }, + isAmino(o: any): o is QueryParamsRequestAmino { + return o && o.$typeUrl === QueryParamsRequest.typeUrl; + }, encode(_: QueryParamsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, @@ -2820,12 +3542,20 @@ export const QueryParamsRequest = { } return message; }, + fromJSON(_: any): QueryParamsRequest { + return {}; + }, + toJSON(_: QueryParamsRequest): unknown { + const obj: any = {}; + return obj; + }, fromPartial(_: Partial): QueryParamsRequest { const message = createBaseQueryParamsRequest(); return message; }, fromAmino(_: QueryParamsRequestAmino): QueryParamsRequest { - return {}; + const message = createBaseQueryParamsRequest(); + return message; }, toAmino(_: QueryParamsRequest): QueryParamsRequestAmino { const obj: any = {}; @@ -2853,6 +3583,8 @@ export const QueryParamsRequest = { }; } }; +GlobalDecoderRegistry.register(QueryParamsRequest.typeUrl, QueryParamsRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryParamsRequest.aminoType, QueryParamsRequest.typeUrl); function createBaseQueryParamsResponse(): QueryParamsResponse { return { params: Params.fromPartial({}) @@ -2860,6 +3592,16 @@ function createBaseQueryParamsResponse(): QueryParamsResponse { } export const QueryParamsResponse = { typeUrl: "/cosmos.staking.v1beta1.QueryParamsResponse", + aminoType: "cosmos-sdk/QueryParamsResponse", + is(o: any): o is QueryParamsResponse { + return o && (o.$typeUrl === QueryParamsResponse.typeUrl || Params.is(o.params)); + }, + isSDK(o: any): o is QueryParamsResponseSDKType { + return o && (o.$typeUrl === QueryParamsResponse.typeUrl || Params.isSDK(o.params)); + }, + isAmino(o: any): o is QueryParamsResponseAmino { + return o && (o.$typeUrl === QueryParamsResponse.typeUrl || Params.isAmino(o.params)); + }, encode(message: QueryParamsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.params !== undefined) { Params.encode(message.params, writer.uint32(10).fork()).ldelim(); @@ -2883,19 +3625,31 @@ export const QueryParamsResponse = { } return message; }, + fromJSON(object: any): QueryParamsResponse { + 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; + }, fromPartial(object: Partial): QueryParamsResponse { const message = createBaseQueryParamsResponse(); message.params = object.params !== undefined && object.params !== null ? Params.fromPartial(object.params) : undefined; return message; }, fromAmino(object: QueryParamsResponseAmino): QueryParamsResponse { - return { - params: object?.params ? Params.fromAmino(object.params) : undefined - }; + const message = createBaseQueryParamsResponse(); + if (object.params !== undefined && object.params !== null) { + message.params = Params.fromAmino(object.params); + } + return message; }, toAmino(message: QueryParamsResponse): QueryParamsResponseAmino { const obj: any = {}; - obj.params = message.params ? Params.toAmino(message.params) : undefined; + obj.params = message.params ? Params.toAmino(message.params) : Params.fromPartial({}); return obj; }, fromAminoMsg(object: QueryParamsResponseAminoMsg): QueryParamsResponse { @@ -2919,4 +3673,6 @@ export const QueryParamsResponse = { value: QueryParamsResponse.encode(message).finish() }; } -}; \ No newline at end of file +}; +GlobalDecoderRegistry.register(QueryParamsResponse.typeUrl, QueryParamsResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryParamsResponse.aminoType, QueryParamsResponse.typeUrl); \ No newline at end of file diff --git a/packages/osmojs/src/codegen/cosmos/staking/v1beta1/staking.ts b/packages/osmojs/src/codegen/cosmos/staking/v1beta1/staking.ts index d273366c2..ca55b0eb8 100644 --- a/packages/osmojs/src/codegen/cosmos/staking/v1beta1/staking.ts +++ b/packages/osmojs/src/codegen/cosmos/staking/v1beta1/staking.ts @@ -3,11 +3,12 @@ import { Timestamp } from "../../../google/protobuf/timestamp"; import { Any, AnyProtoMsg, AnyAmino, AnySDKType } from "../../../google/protobuf/any"; import { Duration, DurationAmino, DurationSDKType } from "../../../google/protobuf/duration"; import { Coin, CoinAmino, CoinSDKType } from "../../base/v1beta1/coin"; +import { ValidatorUpdate, ValidatorUpdateAmino, ValidatorUpdateSDKType } from "../../../tendermint/abci/types"; import { BinaryReader, BinaryWriter } from "../../../binary"; +import { isSet, toTimestamp, fromTimestamp } from "../../../helpers"; +import { GlobalDecoderRegistry } from "../../../registry"; import { Decimal } from "@cosmjs/math"; -import { toTimestamp, fromTimestamp, isSet } from "../../../helpers"; -import { toBase64, fromBase64 } from "@cosmjs/encoding"; -import { encodeBech32Pubkey, decodeBech32Pubkey } from "@cosmjs/amino"; +import { encodePubkey, decodePubkey } from "@cosmjs/proto-signing"; /** BondStatus is the status of a validator. */ export enum BondStatus { /** BOND_STATUS_UNSPECIFIED - UNSPECIFIED defines an invalid validator status. */ @@ -57,6 +58,48 @@ export function bondStatusToJSON(object: BondStatus): string { return "UNRECOGNIZED"; } } +/** Infraction indicates the infraction a validator commited. */ +export enum Infraction { + /** INFRACTION_UNSPECIFIED - UNSPECIFIED defines an empty infraction. */ + INFRACTION_UNSPECIFIED = 0, + /** INFRACTION_DOUBLE_SIGN - DOUBLE_SIGN defines a validator that double-signs a block. */ + INFRACTION_DOUBLE_SIGN = 1, + /** INFRACTION_DOWNTIME - DOWNTIME defines a validator that missed signing too many blocks. */ + INFRACTION_DOWNTIME = 2, + UNRECOGNIZED = -1, +} +export const InfractionSDKType = Infraction; +export const InfractionAmino = Infraction; +export function infractionFromJSON(object: any): Infraction { + switch (object) { + case 0: + case "INFRACTION_UNSPECIFIED": + return Infraction.INFRACTION_UNSPECIFIED; + case 1: + case "INFRACTION_DOUBLE_SIGN": + return Infraction.INFRACTION_DOUBLE_SIGN; + case 2: + case "INFRACTION_DOWNTIME": + return Infraction.INFRACTION_DOWNTIME; + case -1: + case "UNRECOGNIZED": + default: + return Infraction.UNRECOGNIZED; + } +} +export function infractionToJSON(object: Infraction): string { + switch (object) { + case Infraction.INFRACTION_UNSPECIFIED: + return "INFRACTION_UNSPECIFIED"; + case Infraction.INFRACTION_DOUBLE_SIGN: + return "INFRACTION_DOUBLE_SIGN"; + case Infraction.INFRACTION_DOWNTIME: + return "INFRACTION_DOWNTIME"; + case Infraction.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} /** * HistoricalInfo contains header and validator information for a given block. * It is stored as part of staking module's state, which persists the `n` most @@ -78,7 +121,7 @@ export interface HistoricalInfoProtoMsg { * (`n` is set by the staking module's `historical_entries` parameter). */ export interface HistoricalInfoAmino { - header?: HeaderAmino; + header: HeaderAmino; valset: ValidatorAmino[]; } export interface HistoricalInfoAminoMsg { @@ -117,11 +160,11 @@ export interface CommissionRatesProtoMsg { */ export interface CommissionRatesAmino { /** 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. */ - max_rate: string; + max_rate?: string; /** max_change_rate defines the maximum daily increase of the validator commission, as a fraction. */ - max_change_rate: string; + max_change_rate?: string; } export interface CommissionRatesAminoMsg { type: "cosmos-sdk/CommissionRates"; @@ -150,9 +193,9 @@ export interface CommissionProtoMsg { /** Commission defines commission parameters for a given validator. */ export interface CommissionAmino { /** commission_rates defines the initial commission rates to be used for creating a validator. */ - commission_rates?: CommissionRatesAmino; + commission_rates: CommissionRatesAmino; /** update_time is the last time the commission rate was changed. */ - update_time?: Date; + update_time: string; } export interface CommissionAminoMsg { type: "cosmos-sdk/Commission"; @@ -183,15 +226,15 @@ export interface DescriptionProtoMsg { /** Description defines a validator description. */ export interface DescriptionAmino { /** 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. */ - security_contact: string; + security_contact?: string; /** details define other optional details. */ - details: string; + details?: string; } export interface DescriptionAminoMsg { type: "cosmos-sdk/Description"; @@ -219,7 +262,7 @@ export interface Validator { /** operator_address defines the address of the validator's operator; bech encoded in JSON. */ operatorAddress: string; /** consensus_pubkey is the consensus public key of the validator, as a Protobuf Any. */ - consensusPubkey: (Any) | undefined; + consensusPubkey?: Any | undefined; /** jailed defined whether the validator has been jailed from bonded status or not. */ jailed: boolean; /** status is the validator status (bonded/unbonding/unbonded). */ @@ -236,8 +279,16 @@ export interface Validator { unbondingTime: Date; /** commission defines the commission parameters. */ commission: Commission; - /** min_self_delegation is the validator's self declared minimum self delegation. */ + /** + * min_self_delegation is the validator's self declared minimum self delegation. + * + * Since: cosmos-sdk 0.46 + */ minSelfDelegation: string; + /** strictly positive if this validator's unbonding has been stopped by external modules */ + unbondingOnHoldRefCount: bigint; + /** list of unbonding ids, each uniquely identifing an unbonding of this validator */ + unbondingIds: bigint[]; } export interface ValidatorProtoMsg { typeUrl: "/cosmos.staking.v1beta1.Validator"; @@ -258,27 +309,35 @@ export type ValidatorEncoded = Omit & { */ export interface ValidatorAmino { /** operator_address defines the address of the validator's operator; bech encoded in JSON. */ - operator_address: string; + operator_address?: string; /** consensus_pubkey is the consensus public key of the validator, as a Protobuf Any. */ consensus_pubkey?: AnyAmino; /** 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. */ - delegator_shares: string; + delegator_shares?: string; /** description defines the description terms for the validator. */ - description?: DescriptionAmino; + description: DescriptionAmino; /** unbonding_height defines, if unbonding, the height at which this validator has begun unbonding. */ - unbonding_height: string; + unbonding_height?: string; /** unbonding_time defines, if unbonding, the min time for the validator to complete unbonding. */ - unbonding_time?: Date; + unbonding_time: string; /** commission defines the commission parameters. */ - commission?: CommissionAmino; - /** min_self_delegation is the validator's self declared minimum self delegation. */ - min_self_delegation: string; + commission: CommissionAmino; + /** + * min_self_delegation is the validator's self declared minimum self delegation. + * + * Since: cosmos-sdk 0.46 + */ + min_self_delegation?: string; + /** strictly positive if this validator's unbonding has been stopped by external modules */ + unbonding_on_hold_ref_count?: string; + /** list of unbonding ids, each uniquely identifing an unbonding of this validator */ + unbonding_ids?: string[]; } export interface ValidatorAminoMsg { type: "cosmos-sdk/Validator"; @@ -296,7 +355,7 @@ export interface ValidatorAminoMsg { */ export interface ValidatorSDKType { operator_address: string; - consensus_pubkey: AnySDKType | undefined; + consensus_pubkey?: AnySDKType | undefined; jailed: boolean; status: BondStatus; tokens: string; @@ -306,6 +365,8 @@ export interface ValidatorSDKType { unbonding_time: Date; commission: CommissionSDKType; min_self_delegation: string; + unbonding_on_hold_ref_count: bigint; + unbonding_ids: bigint[]; } /** ValAddresses defines a repeated set of validator addresses. */ export interface ValAddresses { @@ -317,7 +378,7 @@ export interface ValAddressesProtoMsg { } /** ValAddresses defines a repeated set of validator addresses. */ export interface ValAddressesAmino { - addresses: string[]; + addresses?: string[]; } export interface ValAddressesAminoMsg { type: "cosmos-sdk/ValAddresses"; @@ -346,8 +407,8 @@ export interface DVPairProtoMsg { * be used to construct the key to getting an UnbondingDelegation from state. */ export interface DVPairAmino { - delegator_address: string; - validator_address: string; + delegator_address?: string; + validator_address?: string; } export interface DVPairAminoMsg { type: "cosmos-sdk/DVPair"; @@ -404,9 +465,9 @@ export interface DVVTripletProtoMsg { * Redelegation from state. */ export interface DVVTripletAmino { - delegator_address: string; - validator_src_address: string; - validator_dst_address: string; + delegator_address?: string; + validator_src_address?: string; + validator_dst_address?: string; } export interface DVVTripletAminoMsg { type: "cosmos-sdk/DVVTriplet"; @@ -467,11 +528,11 @@ export interface DelegationProtoMsg { */ export interface DelegationAmino { /** delegator_address is the bech32-encoded address of the delegator. */ - delegator_address: string; + delegator_address?: string; /** validator_address is the bech32-encoded address of the validator. */ - validator_address: string; + validator_address?: string; /** shares define the delegation shares received. */ - shares: string; + shares?: string; } export interface DelegationAminoMsg { type: "cosmos-sdk/Delegation"; @@ -509,9 +570,9 @@ export interface UnbondingDelegationProtoMsg { */ export interface UnbondingDelegationAmino { /** delegator_address is the bech32-encoded address of the delegator. */ - delegator_address: string; + delegator_address?: string; /** validator_address is the bech32-encoded address of the validator. */ - validator_address: string; + validator_address?: string; /** entries are the unbonding delegation entries. */ entries: UnbondingDelegationEntryAmino[]; } @@ -538,6 +599,10 @@ export interface UnbondingDelegationEntry { initialBalance: string; /** balance defines the tokens to receive at completion. */ balance: string; + /** Incrementing id that uniquely identifies this entry */ + unbondingId: bigint; + /** Strictly positive if this entry's unbonding has been stopped by external modules */ + unbondingOnHoldRefCount: bigint; } export interface UnbondingDelegationEntryProtoMsg { typeUrl: "/cosmos.staking.v1beta1.UnbondingDelegationEntry"; @@ -546,13 +611,17 @@ export interface UnbondingDelegationEntryProtoMsg { /** UnbondingDelegationEntry defines an unbonding object with relevant metadata. */ export interface UnbondingDelegationEntryAmino { /** creation_height is the height which the unbonding took place. */ - creation_height: string; + creation_height?: string; /** completion_time is the unix time for unbonding completion. */ - completion_time?: Date; + completion_time: string; /** initial_balance defines the tokens initially scheduled to receive at completion. */ - initial_balance: string; + initial_balance?: string; /** balance defines the tokens to receive at completion. */ - balance: string; + balance?: string; + /** Incrementing id that uniquely identifies this entry */ + unbonding_id?: string; + /** Strictly positive if this entry's unbonding has been stopped by external modules */ + unbonding_on_hold_ref_count?: string; } export interface UnbondingDelegationEntryAminoMsg { type: "cosmos-sdk/UnbondingDelegationEntry"; @@ -564,6 +633,8 @@ export interface UnbondingDelegationEntrySDKType { completion_time: Date; initial_balance: string; balance: string; + unbonding_id: bigint; + unbonding_on_hold_ref_count: bigint; } /** RedelegationEntry defines a redelegation object with relevant metadata. */ export interface RedelegationEntry { @@ -575,6 +646,10 @@ export interface RedelegationEntry { initialBalance: string; /** shares_dst is the amount of destination-validator shares created by redelegation. */ sharesDst: string; + /** Incrementing id that uniquely identifies this entry */ + unbondingId: bigint; + /** Strictly positive if this entry's unbonding has been stopped by external modules */ + unbondingOnHoldRefCount: bigint; } export interface RedelegationEntryProtoMsg { typeUrl: "/cosmos.staking.v1beta1.RedelegationEntry"; @@ -583,13 +658,17 @@ export interface RedelegationEntryProtoMsg { /** RedelegationEntry defines a redelegation object with relevant metadata. */ export interface RedelegationEntryAmino { /** creation_height defines the height which the redelegation took place. */ - creation_height: string; + creation_height?: string; /** completion_time defines the unix time for redelegation completion. */ - completion_time?: Date; + completion_time: string; /** initial_balance defines the initial balance when redelegation started. */ - initial_balance: string; + initial_balance?: string; /** shares_dst is the amount of destination-validator shares created by redelegation. */ - shares_dst: string; + shares_dst?: string; + /** Incrementing id that uniquely identifies this entry */ + unbonding_id?: string; + /** Strictly positive if this entry's unbonding has been stopped by external modules */ + unbonding_on_hold_ref_count?: string; } export interface RedelegationEntryAminoMsg { type: "cosmos-sdk/RedelegationEntry"; @@ -601,6 +680,8 @@ export interface RedelegationEntrySDKType { completion_time: Date; initial_balance: string; shares_dst: string; + unbonding_id: bigint; + unbonding_on_hold_ref_count: bigint; } /** * Redelegation contains the list of a particular delegator's redelegating bonds @@ -626,11 +707,11 @@ export interface RedelegationProtoMsg { */ export interface RedelegationAmino { /** delegator_address is the bech32-encoded address of the delegator. */ - delegator_address: string; + delegator_address?: string; /** validator_src_address is the validator redelegation source operator address. */ - validator_src_address: string; + validator_src_address?: string; /** validator_dst_address is the validator redelegation destination operator address. */ - validator_dst_address: string; + validator_dst_address?: string; /** entries are the redelegation entries. */ entries: RedelegationEntryAmino[]; } @@ -648,7 +729,7 @@ export interface RedelegationSDKType { validator_dst_address: string; entries: RedelegationEntrySDKType[]; } -/** Params defines the parameters for the staking module. */ +/** Params defines the parameters for the x/staking module. */ export interface Params { /** unbonding_time is the time duration of unbonding. */ unbondingTime: Duration; @@ -662,35 +743,31 @@ export interface Params { bondDenom: string; /** min_commission_rate is the chain-wide minimum commission rate that a validator can charge their delegators */ minCommissionRate: string; - /** min_self_delegation is the chain-wide minimum amount that a validator has to self delegate */ - minSelfDelegation: string; } export interface ParamsProtoMsg { typeUrl: "/cosmos.staking.v1beta1.Params"; value: Uint8Array; } -/** Params defines the parameters for the staking module. */ +/** Params defines the parameters for the x/staking module. */ export interface ParamsAmino { /** unbonding_time is the time duration of unbonding. */ - unbonding_time?: DurationAmino; + unbonding_time: DurationAmino; /** max_validators is the maximum number of validators. */ - max_validators: number; + max_validators?: number; /** max_entries is the max entries for either unbonding delegation or redelegation (per pair/trio). */ - max_entries: number; + max_entries?: number; /** historical_entries is the number of historical entries to persist. */ - historical_entries: number; + historical_entries?: number; /** bond_denom defines the bondable coin denomination. */ - bond_denom: string; + bond_denom?: string; /** min_commission_rate is the chain-wide minimum commission rate that a validator can charge their delegators */ - min_commission_rate: string; - /** min_self_delegation is the chain-wide minimum amount that a validator has to self delegate */ - min_self_delegation: string; + min_commission_rate?: string; } export interface ParamsAminoMsg { type: "cosmos-sdk/x/staking/Params"; value: ParamsAmino; } -/** Params defines the parameters for the staking module. */ +/** Params defines the parameters for the x/staking module. */ export interface ParamsSDKType { unbonding_time: DurationSDKType; max_validators: number; @@ -698,7 +775,6 @@ export interface ParamsSDKType { historical_entries: number; bond_denom: string; min_commission_rate: string; - min_self_delegation: string; } /** * DelegationResponse is equivalent to Delegation except that it contains a @@ -717,8 +793,8 @@ export interface DelegationResponseProtoMsg { * balance in addition to shares which is more suitable for client responses. */ export interface DelegationResponseAmino { - delegation?: DelegationAmino; - balance?: CoinAmino; + delegation: DelegationAmino; + balance: CoinAmino; } export interface DelegationResponseAminoMsg { type: "cosmos-sdk/DelegationResponse"; @@ -751,8 +827,8 @@ export interface RedelegationEntryResponseProtoMsg { * responses. */ export interface RedelegationEntryResponseAmino { - redelegation_entry?: RedelegationEntryAmino; - balance: string; + redelegation_entry: RedelegationEntryAmino; + balance?: string; } export interface RedelegationEntryResponseAminoMsg { type: "cosmos-sdk/RedelegationEntryResponse"; @@ -786,7 +862,7 @@ export interface RedelegationResponseProtoMsg { * responses. */ export interface RedelegationResponseAmino { - redelegation?: RedelegationAmino; + redelegation: RedelegationAmino; entries: RedelegationEntryResponseAmino[]; } export interface RedelegationResponseAminoMsg { @@ -834,6 +910,35 @@ export interface PoolSDKType { not_bonded_tokens: string; bonded_tokens: string; } +/** + * ValidatorUpdates defines an array of abci.ValidatorUpdate objects. + * TODO: explore moving this to proto/cosmos/base to separate modules from tendermint dependence + */ +export interface ValidatorUpdates { + updates: ValidatorUpdate[]; +} +export interface ValidatorUpdatesProtoMsg { + typeUrl: "/cosmos.staking.v1beta1.ValidatorUpdates"; + value: Uint8Array; +} +/** + * ValidatorUpdates defines an array of abci.ValidatorUpdate objects. + * TODO: explore moving this to proto/cosmos/base to separate modules from tendermint dependence + */ +export interface ValidatorUpdatesAmino { + updates: ValidatorUpdateAmino[]; +} +export interface ValidatorUpdatesAminoMsg { + type: "cosmos-sdk/ValidatorUpdates"; + value: ValidatorUpdatesAmino; +} +/** + * ValidatorUpdates defines an array of abci.ValidatorUpdate objects. + * TODO: explore moving this to proto/cosmos/base to separate modules from tendermint dependence + */ +export interface ValidatorUpdatesSDKType { + updates: ValidatorUpdateSDKType[]; +} function createBaseHistoricalInfo(): HistoricalInfo { return { header: Header.fromPartial({}), @@ -842,6 +947,16 @@ function createBaseHistoricalInfo(): HistoricalInfo { } export const HistoricalInfo = { typeUrl: "/cosmos.staking.v1beta1.HistoricalInfo", + aminoType: "cosmos-sdk/HistoricalInfo", + is(o: any): o is HistoricalInfo { + return o && (o.$typeUrl === HistoricalInfo.typeUrl || Header.is(o.header) && Array.isArray(o.valset) && (!o.valset.length || Validator.is(o.valset[0]))); + }, + isSDK(o: any): o is HistoricalInfoSDKType { + return o && (o.$typeUrl === HistoricalInfo.typeUrl || Header.isSDK(o.header) && Array.isArray(o.valset) && (!o.valset.length || Validator.isSDK(o.valset[0]))); + }, + isAmino(o: any): o is HistoricalInfoAmino { + return o && (o.$typeUrl === HistoricalInfo.typeUrl || Header.isAmino(o.header) && Array.isArray(o.valset) && (!o.valset.length || Validator.isAmino(o.valset[0]))); + }, encode(message: HistoricalInfo, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.header !== undefined) { Header.encode(message.header, writer.uint32(10).fork()).ldelim(); @@ -871,6 +986,22 @@ export const HistoricalInfo = { } 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)) : [] + }; + }, + toJSON(message: HistoricalInfo): unknown { + 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); + } else { + obj.valset = []; + } + return obj; + }, fromPartial(object: Partial): HistoricalInfo { const message = createBaseHistoricalInfo(); message.header = object.header !== undefined && object.header !== null ? Header.fromPartial(object.header) : undefined; @@ -878,14 +1009,16 @@ export const HistoricalInfo = { return message; }, fromAmino(object: HistoricalInfoAmino): HistoricalInfo { - return { - header: object?.header ? Header.fromAmino(object.header) : undefined, - valset: Array.isArray(object?.valset) ? object.valset.map((e: any) => Validator.fromAmino(e)) : [] - }; + const message = createBaseHistoricalInfo(); + if (object.header !== undefined && object.header !== null) { + message.header = Header.fromAmino(object.header); + } + message.valset = object.valset?.map(e => Validator.fromAmino(e)) || []; + return message; }, toAmino(message: HistoricalInfo): HistoricalInfoAmino { const obj: any = {}; - obj.header = message.header ? Header.toAmino(message.header) : undefined; + obj.header = message.header ? Header.toAmino(message.header) : Header.fromPartial({}); if (message.valset) { obj.valset = message.valset.map(e => e ? Validator.toAmino(e) : undefined); } else { @@ -915,6 +1048,8 @@ export const HistoricalInfo = { }; } }; +GlobalDecoderRegistry.register(HistoricalInfo.typeUrl, HistoricalInfo); +GlobalDecoderRegistry.registerAminoProtoMapping(HistoricalInfo.aminoType, HistoricalInfo.typeUrl); function createBaseCommissionRates(): CommissionRates { return { rate: "", @@ -924,6 +1059,16 @@ function createBaseCommissionRates(): CommissionRates { } export const CommissionRates = { typeUrl: "/cosmos.staking.v1beta1.CommissionRates", + aminoType: "cosmos-sdk/CommissionRates", + is(o: any): o is CommissionRates { + return o && (o.$typeUrl === CommissionRates.typeUrl || typeof o.rate === "string" && typeof o.maxRate === "string" && typeof o.maxChangeRate === "string"); + }, + isSDK(o: any): o is CommissionRatesSDKType { + return o && (o.$typeUrl === CommissionRates.typeUrl || typeof o.rate === "string" && typeof o.max_rate === "string" && typeof o.max_change_rate === "string"); + }, + isAmino(o: any): o is CommissionRatesAmino { + return o && (o.$typeUrl === CommissionRates.typeUrl || typeof o.rate === "string" && typeof o.max_rate === "string" && typeof o.max_change_rate === "string"); + }, encode(message: CommissionRates, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.rate !== "") { writer.uint32(10).string(Decimal.fromUserInput(message.rate, 18).atomics); @@ -959,6 +1104,20 @@ export const CommissionRates = { } return message; }, + fromJSON(object: any): CommissionRates { + return { + 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(object: Partial): CommissionRates { const message = createBaseCommissionRates(); message.rate = object.rate ?? ""; @@ -967,11 +1126,17 @@ export const CommissionRates = { return message; }, fromAmino(object: CommissionRatesAmino): CommissionRates { - return { - rate: object.rate, - maxRate: object.max_rate, - maxChangeRate: object.max_change_rate - }; + const message = createBaseCommissionRates(); + if (object.rate !== undefined && object.rate !== null) { + message.rate = object.rate; + } + if (object.max_rate !== undefined && object.max_rate !== null) { + message.maxRate = object.max_rate; + } + if (object.max_change_rate !== undefined && object.max_change_rate !== null) { + message.maxChangeRate = object.max_change_rate; + } + return message; }, toAmino(message: CommissionRates): CommissionRatesAmino { const obj: any = {}; @@ -1002,14 +1167,26 @@ export const CommissionRates = { }; } }; +GlobalDecoderRegistry.register(CommissionRates.typeUrl, CommissionRates); +GlobalDecoderRegistry.registerAminoProtoMapping(CommissionRates.aminoType, CommissionRates.typeUrl); function createBaseCommission(): Commission { return { commissionRates: CommissionRates.fromPartial({}), - updateTime: undefined + updateTime: new Date() }; } export const Commission = { typeUrl: "/cosmos.staking.v1beta1.Commission", + aminoType: "cosmos-sdk/Commission", + is(o: any): o is Commission { + return o && (o.$typeUrl === Commission.typeUrl || CommissionRates.is(o.commissionRates) && Timestamp.is(o.updateTime)); + }, + isSDK(o: any): o is CommissionSDKType { + return o && (o.$typeUrl === Commission.typeUrl || CommissionRates.isSDK(o.commission_rates) && Timestamp.isSDK(o.update_time)); + }, + isAmino(o: any): o is CommissionAmino { + return o && (o.$typeUrl === Commission.typeUrl || CommissionRates.isAmino(o.commission_rates) && Timestamp.isAmino(o.update_time)); + }, encode(message: Commission, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.commissionRates !== undefined) { CommissionRates.encode(message.commissionRates, writer.uint32(10).fork()).ldelim(); @@ -1039,6 +1216,18 @@ export const Commission = { } return message; }, + fromJSON(object: any): Commission { + return { + commissionRates: isSet(object.commissionRates) ? CommissionRates.fromJSON(object.commissionRates) : undefined, + updateTime: isSet(object.updateTime) ? new Date(object.updateTime) : undefined + }; + }, + toJSON(message: Commission): unknown { + 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; + }, fromPartial(object: Partial): Commission { const message = createBaseCommission(); message.commissionRates = object.commissionRates !== undefined && object.commissionRates !== null ? CommissionRates.fromPartial(object.commissionRates) : undefined; @@ -1046,15 +1235,19 @@ export const Commission = { return message; }, fromAmino(object: CommissionAmino): Commission { - return { - commissionRates: object?.commission_rates ? CommissionRates.fromAmino(object.commission_rates) : undefined, - updateTime: object.update_time - }; + const message = createBaseCommission(); + if (object.commission_rates !== undefined && object.commission_rates !== null) { + message.commissionRates = CommissionRates.fromAmino(object.commission_rates); + } + if (object.update_time !== undefined && object.update_time !== null) { + message.updateTime = fromTimestamp(Timestamp.fromAmino(object.update_time)); + } + return message; }, toAmino(message: Commission): CommissionAmino { const obj: any = {}; - obj.commission_rates = message.commissionRates ? CommissionRates.toAmino(message.commissionRates) : undefined; - obj.update_time = message.updateTime; + obj.commission_rates = message.commissionRates ? CommissionRates.toAmino(message.commissionRates) : CommissionRates.fromPartial({}); + obj.update_time = message.updateTime ? Timestamp.toAmino(toTimestamp(message.updateTime)) : new Date(); return obj; }, fromAminoMsg(object: CommissionAminoMsg): Commission { @@ -1079,6 +1272,8 @@ export const Commission = { }; } }; +GlobalDecoderRegistry.register(Commission.typeUrl, Commission); +GlobalDecoderRegistry.registerAminoProtoMapping(Commission.aminoType, Commission.typeUrl); function createBaseDescription(): Description { return { moniker: "", @@ -1090,6 +1285,16 @@ function createBaseDescription(): Description { } export const Description = { typeUrl: "/cosmos.staking.v1beta1.Description", + aminoType: "cosmos-sdk/Description", + is(o: any): o is Description { + return o && (o.$typeUrl === Description.typeUrl || typeof o.moniker === "string" && typeof o.identity === "string" && typeof o.website === "string" && typeof o.securityContact === "string" && typeof o.details === "string"); + }, + isSDK(o: any): o is DescriptionSDKType { + return o && (o.$typeUrl === Description.typeUrl || typeof o.moniker === "string" && typeof o.identity === "string" && typeof o.website === "string" && typeof o.security_contact === "string" && typeof o.details === "string"); + }, + isAmino(o: any): o is DescriptionAmino { + return o && (o.$typeUrl === Description.typeUrl || typeof o.moniker === "string" && typeof o.identity === "string" && typeof o.website === "string" && typeof o.security_contact === "string" && typeof o.details === "string"); + }, encode(message: Description, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.moniker !== "") { writer.uint32(10).string(message.moniker); @@ -1137,6 +1342,24 @@ export const Description = { } return message; }, + fromJSON(object: any): Description { + return { + 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) : "", + 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; + }, fromPartial(object: Partial): Description { const message = createBaseDescription(); message.moniker = object.moniker ?? ""; @@ -1147,13 +1370,23 @@ export const Description = { return message; }, fromAmino(object: DescriptionAmino): Description { - return { - moniker: object.moniker, - identity: object.identity, - website: object.website, - securityContact: object.security_contact, - details: object.details - }; + const message = createBaseDescription(); + if (object.moniker !== undefined && object.moniker !== null) { + message.moniker = object.moniker; + } + if (object.identity !== undefined && object.identity !== null) { + message.identity = object.identity; + } + if (object.website !== undefined && object.website !== null) { + message.website = object.website; + } + if (object.security_contact !== undefined && object.security_contact !== null) { + message.securityContact = object.security_contact; + } + if (object.details !== undefined && object.details !== null) { + message.details = object.details; + } + return message; }, toAmino(message: Description): DescriptionAmino { const obj: any = {}; @@ -1186,6 +1419,8 @@ export const Description = { }; } }; +GlobalDecoderRegistry.register(Description.typeUrl, Description); +GlobalDecoderRegistry.registerAminoProtoMapping(Description.aminoType, Description.typeUrl); function createBaseValidator(): Validator { return { operatorAddress: "", @@ -1196,19 +1431,31 @@ function createBaseValidator(): Validator { delegatorShares: "", description: Description.fromPartial({}), unbondingHeight: BigInt(0), - unbondingTime: undefined, + unbondingTime: new Date(), commission: Commission.fromPartial({}), - minSelfDelegation: "" + minSelfDelegation: "", + unbondingOnHoldRefCount: BigInt(0), + unbondingIds: [] }; } export const Validator = { typeUrl: "/cosmos.staking.v1beta1.Validator", + aminoType: "cosmos-sdk/Validator", + is(o: any): o is Validator { + return o && (o.$typeUrl === Validator.typeUrl || typeof o.operatorAddress === "string" && typeof o.jailed === "boolean" && isSet(o.status) && typeof o.tokens === "string" && typeof o.delegatorShares === "string" && Description.is(o.description) && typeof o.unbondingHeight === "bigint" && Timestamp.is(o.unbondingTime) && Commission.is(o.commission) && typeof o.minSelfDelegation === "string" && typeof o.unbondingOnHoldRefCount === "bigint" && Array.isArray(o.unbondingIds) && (!o.unbondingIds.length || typeof o.unbondingIds[0] === "bigint")); + }, + isSDK(o: any): o is ValidatorSDKType { + return o && (o.$typeUrl === Validator.typeUrl || typeof o.operator_address === "string" && typeof o.jailed === "boolean" && isSet(o.status) && typeof o.tokens === "string" && typeof o.delegator_shares === "string" && Description.isSDK(o.description) && typeof o.unbonding_height === "bigint" && Timestamp.isSDK(o.unbonding_time) && Commission.isSDK(o.commission) && typeof o.min_self_delegation === "string" && typeof o.unbonding_on_hold_ref_count === "bigint" && Array.isArray(o.unbonding_ids) && (!o.unbonding_ids.length || typeof o.unbonding_ids[0] === "bigint")); + }, + isAmino(o: any): o is ValidatorAmino { + return o && (o.$typeUrl === Validator.typeUrl || typeof o.operator_address === "string" && typeof o.jailed === "boolean" && isSet(o.status) && typeof o.tokens === "string" && typeof o.delegator_shares === "string" && Description.isAmino(o.description) && typeof o.unbonding_height === "bigint" && Timestamp.isAmino(o.unbonding_time) && Commission.isAmino(o.commission) && typeof o.min_self_delegation === "string" && typeof o.unbonding_on_hold_ref_count === "bigint" && Array.isArray(o.unbonding_ids) && (!o.unbonding_ids.length || typeof o.unbonding_ids[0] === "bigint")); + }, encode(message: Validator, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.operatorAddress !== "") { writer.uint32(10).string(message.operatorAddress); } if (message.consensusPubkey !== undefined) { - Any.encode((message.consensusPubkey as Any), writer.uint32(18).fork()).ldelim(); + Any.encode(GlobalDecoderRegistry.wrapAny(message.consensusPubkey), writer.uint32(18).fork()).ldelim(); } if (message.jailed === true) { writer.uint32(24).bool(message.jailed); @@ -1237,6 +1484,14 @@ export const Validator = { if (message.minSelfDelegation !== "") { writer.uint32(90).string(message.minSelfDelegation); } + if (message.unbondingOnHoldRefCount !== BigInt(0)) { + writer.uint32(96).int64(message.unbondingOnHoldRefCount); + } + writer.uint32(106).fork(); + for (const v of message.unbondingIds) { + writer.uint64(v); + } + writer.ldelim(); return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): Validator { @@ -1250,7 +1505,7 @@ export const Validator = { message.operatorAddress = reader.string(); break; case 2: - message.consensusPubkey = (Cosmos_cryptoPubKey_InterfaceDecoder(reader) as Any); + message.consensusPubkey = GlobalDecoderRegistry.unwrapAny(reader); break; case 3: message.jailed = reader.bool(); @@ -1279,6 +1534,19 @@ export const Validator = { case 11: message.minSelfDelegation = reader.string(); break; + case 12: + message.unbondingOnHoldRefCount = reader.int64(); + break; + case 13: + if ((tag & 7) === 2) { + const end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) { + message.unbondingIds.push(reader.uint64()); + } + } else { + message.unbondingIds.push(reader.uint64()); + } + break; default: reader.skipType(tag & 7); break; @@ -1286,10 +1554,48 @@ export const Validator = { } return message; }, + fromJSON(object: any): Validator { + return { + operatorAddress: isSet(object.operatorAddress) ? String(object.operatorAddress) : "", + consensusPubkey: isSet(object.consensusPubkey) ? GlobalDecoderRegistry.fromJSON(object.consensusPubkey) : undefined, + jailed: isSet(object.jailed) ? Boolean(object.jailed) : false, + status: isSet(object.status) ? bondStatusFromJSON(object.status) : -1, + 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) ? BigInt(object.unbondingHeight.toString()) : BigInt(0), + unbondingTime: isSet(object.unbondingTime) ? new Date(object.unbondingTime) : undefined, + commission: isSet(object.commission) ? Commission.fromJSON(object.commission) : undefined, + minSelfDelegation: isSet(object.minSelfDelegation) ? String(object.minSelfDelegation) : "", + unbondingOnHoldRefCount: isSet(object.unbondingOnHoldRefCount) ? BigInt(object.unbondingOnHoldRefCount.toString()) : BigInt(0), + unbondingIds: Array.isArray(object?.unbondingIds) ? object.unbondingIds.map((e: any) => BigInt(e.toString())) : [] + }; + }, + toJSON(message: Validator): unknown { + const obj: any = {}; + message.operatorAddress !== undefined && (obj.operatorAddress = message.operatorAddress); + message.consensusPubkey !== undefined && (obj.consensusPubkey = message.consensusPubkey ? GlobalDecoderRegistry.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 || BigInt(0)).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); + message.unbondingOnHoldRefCount !== undefined && (obj.unbondingOnHoldRefCount = (message.unbondingOnHoldRefCount || BigInt(0)).toString()); + if (message.unbondingIds) { + obj.unbondingIds = message.unbondingIds.map(e => (e || BigInt(0)).toString()); + } else { + obj.unbondingIds = []; + } + return obj; + }, fromPartial(object: Partial): Validator { const message = createBaseValidator(); message.operatorAddress = object.operatorAddress ?? ""; - message.consensusPubkey = object.consensusPubkey !== undefined && object.consensusPubkey !== null ? Any.fromPartial(object.consensusPubkey) : undefined; + message.consensusPubkey = object.consensusPubkey !== undefined && object.consensusPubkey !== null ? GlobalDecoderRegistry.fromPartial(object.consensusPubkey) : undefined; message.jailed = object.jailed ?? false; message.status = object.status ?? 0; message.tokens = object.tokens ?? ""; @@ -1299,42 +1605,70 @@ export const Validator = { message.unbondingTime = object.unbondingTime ?? undefined; message.commission = object.commission !== undefined && object.commission !== null ? Commission.fromPartial(object.commission) : undefined; message.minSelfDelegation = object.minSelfDelegation ?? ""; + message.unbondingOnHoldRefCount = object.unbondingOnHoldRefCount !== undefined && object.unbondingOnHoldRefCount !== null ? BigInt(object.unbondingOnHoldRefCount.toString()) : BigInt(0); + message.unbondingIds = object.unbondingIds?.map(e => BigInt(e.toString())) || []; return message; }, fromAmino(object: ValidatorAmino): Validator { - return { - operatorAddress: object.operator_address, - consensusPubkey: encodeBech32Pubkey({ - type: "tendermint/PubKeySecp256k1", - value: toBase64(object.consensus_pubkey.value) - }, "cosmos"), - jailed: object.jailed, - status: isSet(object.status) ? bondStatusFromJSON(object.status) : -1, - tokens: object.tokens, - delegatorShares: object.delegator_shares, - description: object?.description ? Description.fromAmino(object.description) : undefined, - unbondingHeight: BigInt(object.unbonding_height), - unbondingTime: object.unbonding_time, - commission: object?.commission ? Commission.fromAmino(object.commission) : undefined, - minSelfDelegation: object.min_self_delegation - }; + const message = createBaseValidator(); + if (object.operator_address !== undefined && object.operator_address !== null) { + message.operatorAddress = object.operator_address; + } + if (object.consensus_pubkey !== undefined && object.consensus_pubkey !== null) { + message.consensusPubkey = encodePubkey(object.consensus_pubkey); + } + if (object.jailed !== undefined && object.jailed !== null) { + message.jailed = object.jailed; + } + if (object.status !== undefined && object.status !== null) { + message.status = bondStatusFromJSON(object.status); + } + if (object.tokens !== undefined && object.tokens !== null) { + message.tokens = object.tokens; + } + if (object.delegator_shares !== undefined && object.delegator_shares !== null) { + message.delegatorShares = object.delegator_shares; + } + if (object.description !== undefined && object.description !== null) { + message.description = Description.fromAmino(object.description); + } + if (object.unbonding_height !== undefined && object.unbonding_height !== null) { + message.unbondingHeight = BigInt(object.unbonding_height); + } + if (object.unbonding_time !== undefined && object.unbonding_time !== null) { + message.unbondingTime = fromTimestamp(Timestamp.fromAmino(object.unbonding_time)); + } + if (object.commission !== undefined && object.commission !== null) { + message.commission = Commission.fromAmino(object.commission); + } + if (object.min_self_delegation !== undefined && object.min_self_delegation !== null) { + message.minSelfDelegation = object.min_self_delegation; + } + if (object.unbonding_on_hold_ref_count !== undefined && object.unbonding_on_hold_ref_count !== null) { + message.unbondingOnHoldRefCount = BigInt(object.unbonding_on_hold_ref_count); + } + message.unbondingIds = object.unbonding_ids?.map(e => BigInt(e)) || []; + return message; }, toAmino(message: Validator): ValidatorAmino { const obj: any = {}; obj.operator_address = message.operatorAddress; - obj.consensus_pubkey = message.consensusPubkey ? { - typeUrl: "/cosmos.crypto.secp256k1.PubKey", - value: fromBase64(decodeBech32Pubkey(message.consensusPubkey).value) - } : undefined; + obj.consensus_pubkey = message.consensusPubkey ? decodePubkey(message.consensusPubkey) : undefined; obj.jailed = message.jailed; - obj.status = message.status; + obj.status = bondStatusToJSON(message.status); obj.tokens = message.tokens; obj.delegator_shares = message.delegatorShares; - obj.description = message.description ? Description.toAmino(message.description) : undefined; + obj.description = message.description ? Description.toAmino(message.description) : Description.fromPartial({}); obj.unbonding_height = message.unbondingHeight ? message.unbondingHeight.toString() : undefined; - obj.unbonding_time = message.unbondingTime; - obj.commission = message.commission ? Commission.toAmino(message.commission) : undefined; + obj.unbonding_time = message.unbondingTime ? Timestamp.toAmino(toTimestamp(message.unbondingTime)) : new Date(); + obj.commission = message.commission ? Commission.toAmino(message.commission) : Commission.fromPartial({}); obj.min_self_delegation = message.minSelfDelegation; + obj.unbonding_on_hold_ref_count = message.unbondingOnHoldRefCount ? message.unbondingOnHoldRefCount.toString() : undefined; + if (message.unbondingIds) { + obj.unbonding_ids = message.unbondingIds.map(e => e.toString()); + } else { + obj.unbonding_ids = []; + } return obj; }, fromAminoMsg(object: ValidatorAminoMsg): Validator { @@ -1359,6 +1693,8 @@ export const Validator = { }; } }; +GlobalDecoderRegistry.register(Validator.typeUrl, Validator); +GlobalDecoderRegistry.registerAminoProtoMapping(Validator.aminoType, Validator.typeUrl); function createBaseValAddresses(): ValAddresses { return { addresses: [] @@ -1366,6 +1702,16 @@ function createBaseValAddresses(): ValAddresses { } export const ValAddresses = { typeUrl: "/cosmos.staking.v1beta1.ValAddresses", + aminoType: "cosmos-sdk/ValAddresses", + is(o: any): o is ValAddresses { + return o && (o.$typeUrl === ValAddresses.typeUrl || Array.isArray(o.addresses) && (!o.addresses.length || typeof o.addresses[0] === "string")); + }, + isSDK(o: any): o is ValAddressesSDKType { + return o && (o.$typeUrl === ValAddresses.typeUrl || Array.isArray(o.addresses) && (!o.addresses.length || typeof o.addresses[0] === "string")); + }, + isAmino(o: any): o is ValAddressesAmino { + return o && (o.$typeUrl === ValAddresses.typeUrl || Array.isArray(o.addresses) && (!o.addresses.length || typeof o.addresses[0] === "string")); + }, encode(message: ValAddresses, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.addresses) { writer.uint32(10).string(v!); @@ -1389,15 +1735,29 @@ export const ValAddresses = { } return message; }, + fromJSON(object: any): ValAddresses { + return { + addresses: Array.isArray(object?.addresses) ? object.addresses.map((e: any) => String(e)) : [] + }; + }, + toJSON(message: ValAddresses): unknown { + const obj: any = {}; + if (message.addresses) { + obj.addresses = message.addresses.map(e => e); + } else { + obj.addresses = []; + } + return obj; + }, fromPartial(object: Partial): ValAddresses { const message = createBaseValAddresses(); message.addresses = object.addresses?.map(e => e) || []; return message; }, fromAmino(object: ValAddressesAmino): ValAddresses { - return { - addresses: Array.isArray(object?.addresses) ? object.addresses.map((e: any) => e) : [] - }; + const message = createBaseValAddresses(); + message.addresses = object.addresses?.map(e => e) || []; + return message; }, toAmino(message: ValAddresses): ValAddressesAmino { const obj: any = {}; @@ -1430,6 +1790,8 @@ export const ValAddresses = { }; } }; +GlobalDecoderRegistry.register(ValAddresses.typeUrl, ValAddresses); +GlobalDecoderRegistry.registerAminoProtoMapping(ValAddresses.aminoType, ValAddresses.typeUrl); function createBaseDVPair(): DVPair { return { delegatorAddress: "", @@ -1438,6 +1800,16 @@ function createBaseDVPair(): DVPair { } export const DVPair = { typeUrl: "/cosmos.staking.v1beta1.DVPair", + aminoType: "cosmos-sdk/DVPair", + is(o: any): o is DVPair { + return o && (o.$typeUrl === DVPair.typeUrl || typeof o.delegatorAddress === "string" && typeof o.validatorAddress === "string"); + }, + isSDK(o: any): o is DVPairSDKType { + return o && (o.$typeUrl === DVPair.typeUrl || typeof o.delegator_address === "string" && typeof o.validator_address === "string"); + }, + isAmino(o: any): o is DVPairAmino { + return o && (o.$typeUrl === DVPair.typeUrl || typeof o.delegator_address === "string" && typeof o.validator_address === "string"); + }, encode(message: DVPair, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.delegatorAddress !== "") { writer.uint32(10).string(message.delegatorAddress); @@ -1467,6 +1839,18 @@ export const DVPair = { } return message; }, + fromJSON(object: any): DVPair { + return { + 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; + }, fromPartial(object: Partial): DVPair { const message = createBaseDVPair(); message.delegatorAddress = object.delegatorAddress ?? ""; @@ -1474,10 +1858,14 @@ export const DVPair = { return message; }, fromAmino(object: DVPairAmino): DVPair { - return { - delegatorAddress: object.delegator_address, - validatorAddress: object.validator_address - }; + const message = createBaseDVPair(); + if (object.delegator_address !== undefined && object.delegator_address !== null) { + message.delegatorAddress = object.delegator_address; + } + if (object.validator_address !== undefined && object.validator_address !== null) { + message.validatorAddress = object.validator_address; + } + return message; }, toAmino(message: DVPair): DVPairAmino { const obj: any = {}; @@ -1507,6 +1895,8 @@ export const DVPair = { }; } }; +GlobalDecoderRegistry.register(DVPair.typeUrl, DVPair); +GlobalDecoderRegistry.registerAminoProtoMapping(DVPair.aminoType, DVPair.typeUrl); function createBaseDVPairs(): DVPairs { return { pairs: [] @@ -1514,6 +1904,16 @@ function createBaseDVPairs(): DVPairs { } export const DVPairs = { typeUrl: "/cosmos.staking.v1beta1.DVPairs", + aminoType: "cosmos-sdk/DVPairs", + is(o: any): o is DVPairs { + return o && (o.$typeUrl === DVPairs.typeUrl || Array.isArray(o.pairs) && (!o.pairs.length || DVPair.is(o.pairs[0]))); + }, + isSDK(o: any): o is DVPairsSDKType { + return o && (o.$typeUrl === DVPairs.typeUrl || Array.isArray(o.pairs) && (!o.pairs.length || DVPair.isSDK(o.pairs[0]))); + }, + isAmino(o: any): o is DVPairsAmino { + return o && (o.$typeUrl === DVPairs.typeUrl || Array.isArray(o.pairs) && (!o.pairs.length || DVPair.isAmino(o.pairs[0]))); + }, encode(message: DVPairs, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.pairs) { DVPair.encode(v!, writer.uint32(10).fork()).ldelim(); @@ -1537,15 +1937,29 @@ export const DVPairs = { } return message; }, + fromJSON(object: any): DVPairs { + return { + pairs: Array.isArray(object?.pairs) ? object.pairs.map((e: any) => DVPair.fromJSON(e)) : [] + }; + }, + toJSON(message: DVPairs): unknown { + const obj: any = {}; + if (message.pairs) { + obj.pairs = message.pairs.map(e => e ? DVPair.toJSON(e) : undefined); + } else { + obj.pairs = []; + } + return obj; + }, fromPartial(object: Partial): DVPairs { const message = createBaseDVPairs(); message.pairs = object.pairs?.map(e => DVPair.fromPartial(e)) || []; return message; }, fromAmino(object: DVPairsAmino): DVPairs { - return { - pairs: Array.isArray(object?.pairs) ? object.pairs.map((e: any) => DVPair.fromAmino(e)) : [] - }; + const message = createBaseDVPairs(); + message.pairs = object.pairs?.map(e => DVPair.fromAmino(e)) || []; + return message; }, toAmino(message: DVPairs): DVPairsAmino { const obj: any = {}; @@ -1578,6 +1992,8 @@ export const DVPairs = { }; } }; +GlobalDecoderRegistry.register(DVPairs.typeUrl, DVPairs); +GlobalDecoderRegistry.registerAminoProtoMapping(DVPairs.aminoType, DVPairs.typeUrl); function createBaseDVVTriplet(): DVVTriplet { return { delegatorAddress: "", @@ -1587,6 +2003,16 @@ function createBaseDVVTriplet(): DVVTriplet { } export const DVVTriplet = { typeUrl: "/cosmos.staking.v1beta1.DVVTriplet", + aminoType: "cosmos-sdk/DVVTriplet", + is(o: any): o is DVVTriplet { + return o && (o.$typeUrl === DVVTriplet.typeUrl || typeof o.delegatorAddress === "string" && typeof o.validatorSrcAddress === "string" && typeof o.validatorDstAddress === "string"); + }, + isSDK(o: any): o is DVVTripletSDKType { + return o && (o.$typeUrl === DVVTriplet.typeUrl || typeof o.delegator_address === "string" && typeof o.validator_src_address === "string" && typeof o.validator_dst_address === "string"); + }, + isAmino(o: any): o is DVVTripletAmino { + return o && (o.$typeUrl === DVVTriplet.typeUrl || typeof o.delegator_address === "string" && typeof o.validator_src_address === "string" && typeof o.validator_dst_address === "string"); + }, encode(message: DVVTriplet, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.delegatorAddress !== "") { writer.uint32(10).string(message.delegatorAddress); @@ -1622,6 +2048,20 @@ export const DVVTriplet = { } 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) : "" + }; + }, + 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; + }, fromPartial(object: Partial): DVVTriplet { const message = createBaseDVVTriplet(); message.delegatorAddress = object.delegatorAddress ?? ""; @@ -1630,11 +2070,17 @@ export const DVVTriplet = { return message; }, fromAmino(object: DVVTripletAmino): DVVTriplet { - return { - delegatorAddress: object.delegator_address, - validatorSrcAddress: object.validator_src_address, - validatorDstAddress: object.validator_dst_address - }; + const message = createBaseDVVTriplet(); + if (object.delegator_address !== undefined && object.delegator_address !== null) { + message.delegatorAddress = object.delegator_address; + } + if (object.validator_src_address !== undefined && object.validator_src_address !== null) { + message.validatorSrcAddress = object.validator_src_address; + } + if (object.validator_dst_address !== undefined && object.validator_dst_address !== null) { + message.validatorDstAddress = object.validator_dst_address; + } + return message; }, toAmino(message: DVVTriplet): DVVTripletAmino { const obj: any = {}; @@ -1665,6 +2111,8 @@ export const DVVTriplet = { }; } }; +GlobalDecoderRegistry.register(DVVTriplet.typeUrl, DVVTriplet); +GlobalDecoderRegistry.registerAminoProtoMapping(DVVTriplet.aminoType, DVVTriplet.typeUrl); function createBaseDVVTriplets(): DVVTriplets { return { triplets: [] @@ -1672,6 +2120,16 @@ function createBaseDVVTriplets(): DVVTriplets { } export const DVVTriplets = { typeUrl: "/cosmos.staking.v1beta1.DVVTriplets", + aminoType: "cosmos-sdk/DVVTriplets", + is(o: any): o is DVVTriplets { + return o && (o.$typeUrl === DVVTriplets.typeUrl || Array.isArray(o.triplets) && (!o.triplets.length || DVVTriplet.is(o.triplets[0]))); + }, + isSDK(o: any): o is DVVTripletsSDKType { + return o && (o.$typeUrl === DVVTriplets.typeUrl || Array.isArray(o.triplets) && (!o.triplets.length || DVVTriplet.isSDK(o.triplets[0]))); + }, + isAmino(o: any): o is DVVTripletsAmino { + return o && (o.$typeUrl === DVVTriplets.typeUrl || Array.isArray(o.triplets) && (!o.triplets.length || DVVTriplet.isAmino(o.triplets[0]))); + }, encode(message: DVVTriplets, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.triplets) { DVVTriplet.encode(v!, writer.uint32(10).fork()).ldelim(); @@ -1695,15 +2153,29 @@ export const DVVTriplets = { } return message; }, + fromJSON(object: any): DVVTriplets { + return { + triplets: Array.isArray(object?.triplets) ? object.triplets.map((e: any) => DVVTriplet.fromJSON(e)) : [] + }; + }, + toJSON(message: DVVTriplets): unknown { + const obj: any = {}; + if (message.triplets) { + obj.triplets = message.triplets.map(e => e ? DVVTriplet.toJSON(e) : undefined); + } else { + obj.triplets = []; + } + return obj; + }, fromPartial(object: Partial): DVVTriplets { const message = createBaseDVVTriplets(); message.triplets = object.triplets?.map(e => DVVTriplet.fromPartial(e)) || []; return message; }, fromAmino(object: DVVTripletsAmino): DVVTriplets { - return { - triplets: Array.isArray(object?.triplets) ? object.triplets.map((e: any) => DVVTriplet.fromAmino(e)) : [] - }; + const message = createBaseDVVTriplets(); + message.triplets = object.triplets?.map(e => DVVTriplet.fromAmino(e)) || []; + return message; }, toAmino(message: DVVTriplets): DVVTripletsAmino { const obj: any = {}; @@ -1736,6 +2208,8 @@ export const DVVTriplets = { }; } }; +GlobalDecoderRegistry.register(DVVTriplets.typeUrl, DVVTriplets); +GlobalDecoderRegistry.registerAminoProtoMapping(DVVTriplets.aminoType, DVVTriplets.typeUrl); function createBaseDelegation(): Delegation { return { delegatorAddress: "", @@ -1745,6 +2219,16 @@ function createBaseDelegation(): Delegation { } export const Delegation = { typeUrl: "/cosmos.staking.v1beta1.Delegation", + aminoType: "cosmos-sdk/Delegation", + is(o: any): o is Delegation { + return o && (o.$typeUrl === Delegation.typeUrl || typeof o.delegatorAddress === "string" && typeof o.validatorAddress === "string" && typeof o.shares === "string"); + }, + isSDK(o: any): o is DelegationSDKType { + return o && (o.$typeUrl === Delegation.typeUrl || typeof o.delegator_address === "string" && typeof o.validator_address === "string" && typeof o.shares === "string"); + }, + isAmino(o: any): o is DelegationAmino { + return o && (o.$typeUrl === Delegation.typeUrl || typeof o.delegator_address === "string" && typeof o.validator_address === "string" && typeof o.shares === "string"); + }, encode(message: Delegation, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.delegatorAddress !== "") { writer.uint32(10).string(message.delegatorAddress); @@ -1780,6 +2264,20 @@ export const Delegation = { } return message; }, + fromJSON(object: any): Delegation { + return { + 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; + }, fromPartial(object: Partial): Delegation { const message = createBaseDelegation(); message.delegatorAddress = object.delegatorAddress ?? ""; @@ -1788,11 +2286,17 @@ export const Delegation = { return message; }, fromAmino(object: DelegationAmino): Delegation { - return { - delegatorAddress: object.delegator_address, - validatorAddress: object.validator_address, - shares: object.shares - }; + const message = createBaseDelegation(); + if (object.delegator_address !== undefined && object.delegator_address !== null) { + message.delegatorAddress = object.delegator_address; + } + if (object.validator_address !== undefined && object.validator_address !== null) { + message.validatorAddress = object.validator_address; + } + if (object.shares !== undefined && object.shares !== null) { + message.shares = object.shares; + } + return message; }, toAmino(message: Delegation): DelegationAmino { const obj: any = {}; @@ -1823,6 +2327,8 @@ export const Delegation = { }; } }; +GlobalDecoderRegistry.register(Delegation.typeUrl, Delegation); +GlobalDecoderRegistry.registerAminoProtoMapping(Delegation.aminoType, Delegation.typeUrl); function createBaseUnbondingDelegation(): UnbondingDelegation { return { delegatorAddress: "", @@ -1832,6 +2338,16 @@ function createBaseUnbondingDelegation(): UnbondingDelegation { } export const UnbondingDelegation = { typeUrl: "/cosmos.staking.v1beta1.UnbondingDelegation", + aminoType: "cosmos-sdk/UnbondingDelegation", + is(o: any): o is UnbondingDelegation { + return o && (o.$typeUrl === UnbondingDelegation.typeUrl || typeof o.delegatorAddress === "string" && typeof o.validatorAddress === "string" && Array.isArray(o.entries) && (!o.entries.length || UnbondingDelegationEntry.is(o.entries[0]))); + }, + isSDK(o: any): o is UnbondingDelegationSDKType { + return o && (o.$typeUrl === UnbondingDelegation.typeUrl || typeof o.delegator_address === "string" && typeof o.validator_address === "string" && Array.isArray(o.entries) && (!o.entries.length || UnbondingDelegationEntry.isSDK(o.entries[0]))); + }, + isAmino(o: any): o is UnbondingDelegationAmino { + return o && (o.$typeUrl === UnbondingDelegation.typeUrl || typeof o.delegator_address === "string" && typeof o.validator_address === "string" && Array.isArray(o.entries) && (!o.entries.length || UnbondingDelegationEntry.isAmino(o.entries[0]))); + }, encode(message: UnbondingDelegation, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.delegatorAddress !== "") { writer.uint32(10).string(message.delegatorAddress); @@ -1867,6 +2383,24 @@ export const UnbondingDelegation = { } return message; }, + fromJSON(object: any): UnbondingDelegation { + return { + 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); + if (message.entries) { + obj.entries = message.entries.map(e => e ? UnbondingDelegationEntry.toJSON(e) : undefined); + } else { + obj.entries = []; + } + return obj; + }, fromPartial(object: Partial): UnbondingDelegation { const message = createBaseUnbondingDelegation(); message.delegatorAddress = object.delegatorAddress ?? ""; @@ -1875,11 +2409,15 @@ export const UnbondingDelegation = { return message; }, fromAmino(object: UnbondingDelegationAmino): UnbondingDelegation { - return { - delegatorAddress: object.delegator_address, - validatorAddress: object.validator_address, - entries: Array.isArray(object?.entries) ? object.entries.map((e: any) => UnbondingDelegationEntry.fromAmino(e)) : [] - }; + const message = createBaseUnbondingDelegation(); + if (object.delegator_address !== undefined && object.delegator_address !== null) { + message.delegatorAddress = object.delegator_address; + } + if (object.validator_address !== undefined && object.validator_address !== null) { + message.validatorAddress = object.validator_address; + } + message.entries = object.entries?.map(e => UnbondingDelegationEntry.fromAmino(e)) || []; + return message; }, toAmino(message: UnbondingDelegation): UnbondingDelegationAmino { const obj: any = {}; @@ -1914,16 +2452,30 @@ export const UnbondingDelegation = { }; } }; +GlobalDecoderRegistry.register(UnbondingDelegation.typeUrl, UnbondingDelegation); +GlobalDecoderRegistry.registerAminoProtoMapping(UnbondingDelegation.aminoType, UnbondingDelegation.typeUrl); function createBaseUnbondingDelegationEntry(): UnbondingDelegationEntry { return { creationHeight: BigInt(0), - completionTime: undefined, + completionTime: new Date(), initialBalance: "", - balance: "" + balance: "", + unbondingId: BigInt(0), + unbondingOnHoldRefCount: BigInt(0) }; } export const UnbondingDelegationEntry = { typeUrl: "/cosmos.staking.v1beta1.UnbondingDelegationEntry", + aminoType: "cosmos-sdk/UnbondingDelegationEntry", + is(o: any): o is UnbondingDelegationEntry { + return o && (o.$typeUrl === UnbondingDelegationEntry.typeUrl || typeof o.creationHeight === "bigint" && Timestamp.is(o.completionTime) && typeof o.initialBalance === "string" && typeof o.balance === "string" && typeof o.unbondingId === "bigint" && typeof o.unbondingOnHoldRefCount === "bigint"); + }, + isSDK(o: any): o is UnbondingDelegationEntrySDKType { + return o && (o.$typeUrl === UnbondingDelegationEntry.typeUrl || typeof o.creation_height === "bigint" && Timestamp.isSDK(o.completion_time) && typeof o.initial_balance === "string" && typeof o.balance === "string" && typeof o.unbonding_id === "bigint" && typeof o.unbonding_on_hold_ref_count === "bigint"); + }, + isAmino(o: any): o is UnbondingDelegationEntryAmino { + return o && (o.$typeUrl === UnbondingDelegationEntry.typeUrl || typeof o.creation_height === "bigint" && Timestamp.isAmino(o.completion_time) && typeof o.initial_balance === "string" && typeof o.balance === "string" && typeof o.unbonding_id === "bigint" && typeof o.unbonding_on_hold_ref_count === "bigint"); + }, encode(message: UnbondingDelegationEntry, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.creationHeight !== BigInt(0)) { writer.uint32(8).int64(message.creationHeight); @@ -1937,6 +2489,12 @@ export const UnbondingDelegationEntry = { if (message.balance !== "") { writer.uint32(34).string(message.balance); } + if (message.unbondingId !== BigInt(0)) { + writer.uint32(40).uint64(message.unbondingId); + } + if (message.unbondingOnHoldRefCount !== BigInt(0)) { + writer.uint32(48).int64(message.unbondingOnHoldRefCount); + } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): UnbondingDelegationEntry { @@ -1958,6 +2516,12 @@ export const UnbondingDelegationEntry = { case 4: message.balance = reader.string(); break; + case 5: + message.unbondingId = reader.uint64(); + break; + case 6: + message.unbondingOnHoldRefCount = reader.int64(); + break; default: reader.skipType(tag & 7); break; @@ -1965,28 +2529,66 @@ export const UnbondingDelegationEntry = { } return message; }, + fromJSON(object: any): UnbondingDelegationEntry { + return { + creationHeight: isSet(object.creationHeight) ? BigInt(object.creationHeight.toString()) : BigInt(0), + completionTime: isSet(object.completionTime) ? new Date(object.completionTime) : undefined, + initialBalance: isSet(object.initialBalance) ? String(object.initialBalance) : "", + balance: isSet(object.balance) ? String(object.balance) : "", + unbondingId: isSet(object.unbondingId) ? BigInt(object.unbondingId.toString()) : BigInt(0), + unbondingOnHoldRefCount: isSet(object.unbondingOnHoldRefCount) ? BigInt(object.unbondingOnHoldRefCount.toString()) : BigInt(0) + }; + }, + toJSON(message: UnbondingDelegationEntry): unknown { + const obj: any = {}; + message.creationHeight !== undefined && (obj.creationHeight = (message.creationHeight || BigInt(0)).toString()); + message.completionTime !== undefined && (obj.completionTime = message.completionTime.toISOString()); + message.initialBalance !== undefined && (obj.initialBalance = message.initialBalance); + message.balance !== undefined && (obj.balance = message.balance); + message.unbondingId !== undefined && (obj.unbondingId = (message.unbondingId || BigInt(0)).toString()); + message.unbondingOnHoldRefCount !== undefined && (obj.unbondingOnHoldRefCount = (message.unbondingOnHoldRefCount || BigInt(0)).toString()); + return obj; + }, fromPartial(object: Partial): UnbondingDelegationEntry { const message = createBaseUnbondingDelegationEntry(); message.creationHeight = object.creationHeight !== undefined && object.creationHeight !== null ? BigInt(object.creationHeight.toString()) : BigInt(0); message.completionTime = object.completionTime ?? undefined; message.initialBalance = object.initialBalance ?? ""; message.balance = object.balance ?? ""; + message.unbondingId = object.unbondingId !== undefined && object.unbondingId !== null ? BigInt(object.unbondingId.toString()) : BigInt(0); + message.unbondingOnHoldRefCount = object.unbondingOnHoldRefCount !== undefined && object.unbondingOnHoldRefCount !== null ? BigInt(object.unbondingOnHoldRefCount.toString()) : BigInt(0); return message; }, fromAmino(object: UnbondingDelegationEntryAmino): UnbondingDelegationEntry { - return { - creationHeight: BigInt(object.creation_height), - completionTime: object.completion_time, - initialBalance: object.initial_balance, - balance: object.balance - }; + const message = createBaseUnbondingDelegationEntry(); + if (object.creation_height !== undefined && object.creation_height !== null) { + message.creationHeight = BigInt(object.creation_height); + } + if (object.completion_time !== undefined && object.completion_time !== null) { + message.completionTime = fromTimestamp(Timestamp.fromAmino(object.completion_time)); + } + if (object.initial_balance !== undefined && object.initial_balance !== null) { + message.initialBalance = object.initial_balance; + } + if (object.balance !== undefined && object.balance !== null) { + message.balance = object.balance; + } + if (object.unbonding_id !== undefined && object.unbonding_id !== null) { + message.unbondingId = BigInt(object.unbonding_id); + } + if (object.unbonding_on_hold_ref_count !== undefined && object.unbonding_on_hold_ref_count !== null) { + message.unbondingOnHoldRefCount = BigInt(object.unbonding_on_hold_ref_count); + } + return message; }, toAmino(message: UnbondingDelegationEntry): UnbondingDelegationEntryAmino { const obj: any = {}; obj.creation_height = message.creationHeight ? message.creationHeight.toString() : undefined; - obj.completion_time = message.completionTime; + obj.completion_time = message.completionTime ? Timestamp.toAmino(toTimestamp(message.completionTime)) : new Date(); obj.initial_balance = message.initialBalance; obj.balance = message.balance; + obj.unbonding_id = message.unbondingId ? message.unbondingId.toString() : undefined; + obj.unbonding_on_hold_ref_count = message.unbondingOnHoldRefCount ? message.unbondingOnHoldRefCount.toString() : undefined; return obj; }, fromAminoMsg(object: UnbondingDelegationEntryAminoMsg): UnbondingDelegationEntry { @@ -2011,16 +2613,30 @@ export const UnbondingDelegationEntry = { }; } }; +GlobalDecoderRegistry.register(UnbondingDelegationEntry.typeUrl, UnbondingDelegationEntry); +GlobalDecoderRegistry.registerAminoProtoMapping(UnbondingDelegationEntry.aminoType, UnbondingDelegationEntry.typeUrl); function createBaseRedelegationEntry(): RedelegationEntry { return { creationHeight: BigInt(0), - completionTime: undefined, + completionTime: new Date(), initialBalance: "", - sharesDst: "" + sharesDst: "", + unbondingId: BigInt(0), + unbondingOnHoldRefCount: BigInt(0) }; } export const RedelegationEntry = { typeUrl: "/cosmos.staking.v1beta1.RedelegationEntry", + aminoType: "cosmos-sdk/RedelegationEntry", + is(o: any): o is RedelegationEntry { + return o && (o.$typeUrl === RedelegationEntry.typeUrl || typeof o.creationHeight === "bigint" && Timestamp.is(o.completionTime) && typeof o.initialBalance === "string" && typeof o.sharesDst === "string" && typeof o.unbondingId === "bigint" && typeof o.unbondingOnHoldRefCount === "bigint"); + }, + isSDK(o: any): o is RedelegationEntrySDKType { + return o && (o.$typeUrl === RedelegationEntry.typeUrl || typeof o.creation_height === "bigint" && Timestamp.isSDK(o.completion_time) && typeof o.initial_balance === "string" && typeof o.shares_dst === "string" && typeof o.unbonding_id === "bigint" && typeof o.unbonding_on_hold_ref_count === "bigint"); + }, + isAmino(o: any): o is RedelegationEntryAmino { + return o && (o.$typeUrl === RedelegationEntry.typeUrl || typeof o.creation_height === "bigint" && Timestamp.isAmino(o.completion_time) && typeof o.initial_balance === "string" && typeof o.shares_dst === "string" && typeof o.unbonding_id === "bigint" && typeof o.unbonding_on_hold_ref_count === "bigint"); + }, encode(message: RedelegationEntry, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.creationHeight !== BigInt(0)) { writer.uint32(8).int64(message.creationHeight); @@ -2034,6 +2650,12 @@ export const RedelegationEntry = { if (message.sharesDst !== "") { writer.uint32(34).string(Decimal.fromUserInput(message.sharesDst, 18).atomics); } + if (message.unbondingId !== BigInt(0)) { + writer.uint32(40).uint64(message.unbondingId); + } + if (message.unbondingOnHoldRefCount !== BigInt(0)) { + writer.uint32(48).int64(message.unbondingOnHoldRefCount); + } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): RedelegationEntry { @@ -2055,6 +2677,12 @@ export const RedelegationEntry = { case 4: message.sharesDst = Decimal.fromAtomics(reader.string(), 18).toString(); break; + case 5: + message.unbondingId = reader.uint64(); + break; + case 6: + message.unbondingOnHoldRefCount = reader.int64(); + break; default: reader.skipType(tag & 7); break; @@ -2062,28 +2690,66 @@ export const RedelegationEntry = { } return message; }, + fromJSON(object: any): RedelegationEntry { + return { + creationHeight: isSet(object.creationHeight) ? BigInt(object.creationHeight.toString()) : BigInt(0), + completionTime: isSet(object.completionTime) ? new Date(object.completionTime) : undefined, + initialBalance: isSet(object.initialBalance) ? String(object.initialBalance) : "", + sharesDst: isSet(object.sharesDst) ? String(object.sharesDst) : "", + unbondingId: isSet(object.unbondingId) ? BigInt(object.unbondingId.toString()) : BigInt(0), + unbondingOnHoldRefCount: isSet(object.unbondingOnHoldRefCount) ? BigInt(object.unbondingOnHoldRefCount.toString()) : BigInt(0) + }; + }, + toJSON(message: RedelegationEntry): unknown { + const obj: any = {}; + message.creationHeight !== undefined && (obj.creationHeight = (message.creationHeight || BigInt(0)).toString()); + message.completionTime !== undefined && (obj.completionTime = message.completionTime.toISOString()); + message.initialBalance !== undefined && (obj.initialBalance = message.initialBalance); + message.sharesDst !== undefined && (obj.sharesDst = message.sharesDst); + message.unbondingId !== undefined && (obj.unbondingId = (message.unbondingId || BigInt(0)).toString()); + message.unbondingOnHoldRefCount !== undefined && (obj.unbondingOnHoldRefCount = (message.unbondingOnHoldRefCount || BigInt(0)).toString()); + return obj; + }, fromPartial(object: Partial): RedelegationEntry { const message = createBaseRedelegationEntry(); message.creationHeight = object.creationHeight !== undefined && object.creationHeight !== null ? BigInt(object.creationHeight.toString()) : BigInt(0); message.completionTime = object.completionTime ?? undefined; message.initialBalance = object.initialBalance ?? ""; message.sharesDst = object.sharesDst ?? ""; + message.unbondingId = object.unbondingId !== undefined && object.unbondingId !== null ? BigInt(object.unbondingId.toString()) : BigInt(0); + message.unbondingOnHoldRefCount = object.unbondingOnHoldRefCount !== undefined && object.unbondingOnHoldRefCount !== null ? BigInt(object.unbondingOnHoldRefCount.toString()) : BigInt(0); return message; }, fromAmino(object: RedelegationEntryAmino): RedelegationEntry { - return { - creationHeight: BigInt(object.creation_height), - completionTime: object.completion_time, - initialBalance: object.initial_balance, - sharesDst: object.shares_dst - }; + const message = createBaseRedelegationEntry(); + if (object.creation_height !== undefined && object.creation_height !== null) { + message.creationHeight = BigInt(object.creation_height); + } + if (object.completion_time !== undefined && object.completion_time !== null) { + message.completionTime = fromTimestamp(Timestamp.fromAmino(object.completion_time)); + } + if (object.initial_balance !== undefined && object.initial_balance !== null) { + message.initialBalance = object.initial_balance; + } + if (object.shares_dst !== undefined && object.shares_dst !== null) { + message.sharesDst = object.shares_dst; + } + if (object.unbonding_id !== undefined && object.unbonding_id !== null) { + message.unbondingId = BigInt(object.unbonding_id); + } + if (object.unbonding_on_hold_ref_count !== undefined && object.unbonding_on_hold_ref_count !== null) { + message.unbondingOnHoldRefCount = BigInt(object.unbonding_on_hold_ref_count); + } + return message; }, toAmino(message: RedelegationEntry): RedelegationEntryAmino { const obj: any = {}; obj.creation_height = message.creationHeight ? message.creationHeight.toString() : undefined; - obj.completion_time = message.completionTime; + obj.completion_time = message.completionTime ? Timestamp.toAmino(toTimestamp(message.completionTime)) : new Date(); obj.initial_balance = message.initialBalance; obj.shares_dst = message.sharesDst; + obj.unbonding_id = message.unbondingId ? message.unbondingId.toString() : undefined; + obj.unbonding_on_hold_ref_count = message.unbondingOnHoldRefCount ? message.unbondingOnHoldRefCount.toString() : undefined; return obj; }, fromAminoMsg(object: RedelegationEntryAminoMsg): RedelegationEntry { @@ -2108,6 +2774,8 @@ export const RedelegationEntry = { }; } }; +GlobalDecoderRegistry.register(RedelegationEntry.typeUrl, RedelegationEntry); +GlobalDecoderRegistry.registerAminoProtoMapping(RedelegationEntry.aminoType, RedelegationEntry.typeUrl); function createBaseRedelegation(): Redelegation { return { delegatorAddress: "", @@ -2118,6 +2786,16 @@ function createBaseRedelegation(): Redelegation { } export const Redelegation = { typeUrl: "/cosmos.staking.v1beta1.Redelegation", + aminoType: "cosmos-sdk/Redelegation", + is(o: any): o is Redelegation { + return o && (o.$typeUrl === Redelegation.typeUrl || typeof o.delegatorAddress === "string" && typeof o.validatorSrcAddress === "string" && typeof o.validatorDstAddress === "string" && Array.isArray(o.entries) && (!o.entries.length || RedelegationEntry.is(o.entries[0]))); + }, + isSDK(o: any): o is RedelegationSDKType { + return o && (o.$typeUrl === Redelegation.typeUrl || typeof o.delegator_address === "string" && typeof o.validator_src_address === "string" && typeof o.validator_dst_address === "string" && Array.isArray(o.entries) && (!o.entries.length || RedelegationEntry.isSDK(o.entries[0]))); + }, + isAmino(o: any): o is RedelegationAmino { + return o && (o.$typeUrl === Redelegation.typeUrl || typeof o.delegator_address === "string" && typeof o.validator_src_address === "string" && typeof o.validator_dst_address === "string" && Array.isArray(o.entries) && (!o.entries.length || RedelegationEntry.isAmino(o.entries[0]))); + }, encode(message: Redelegation, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.delegatorAddress !== "") { writer.uint32(10).string(message.delegatorAddress); @@ -2159,6 +2837,26 @@ export const Redelegation = { } 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)) : [] + }; + }, + 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); + if (message.entries) { + obj.entries = message.entries.map(e => e ? RedelegationEntry.toJSON(e) : undefined); + } else { + obj.entries = []; + } + return obj; + }, fromPartial(object: Partial): Redelegation { const message = createBaseRedelegation(); message.delegatorAddress = object.delegatorAddress ?? ""; @@ -2168,12 +2866,18 @@ export const Redelegation = { return message; }, fromAmino(object: RedelegationAmino): Redelegation { - return { - delegatorAddress: object.delegator_address, - validatorSrcAddress: object.validator_src_address, - validatorDstAddress: object.validator_dst_address, - entries: Array.isArray(object?.entries) ? object.entries.map((e: any) => RedelegationEntry.fromAmino(e)) : [] - }; + const message = createBaseRedelegation(); + if (object.delegator_address !== undefined && object.delegator_address !== null) { + message.delegatorAddress = object.delegator_address; + } + if (object.validator_src_address !== undefined && object.validator_src_address !== null) { + message.validatorSrcAddress = object.validator_src_address; + } + if (object.validator_dst_address !== undefined && object.validator_dst_address !== null) { + message.validatorDstAddress = object.validator_dst_address; + } + message.entries = object.entries?.map(e => RedelegationEntry.fromAmino(e)) || []; + return message; }, toAmino(message: Redelegation): RedelegationAmino { const obj: any = {}; @@ -2209,19 +2913,30 @@ export const Redelegation = { }; } }; +GlobalDecoderRegistry.register(Redelegation.typeUrl, Redelegation); +GlobalDecoderRegistry.registerAminoProtoMapping(Redelegation.aminoType, Redelegation.typeUrl); function createBaseParams(): Params { return { - unbondingTime: undefined, + unbondingTime: Duration.fromPartial({}), maxValidators: 0, maxEntries: 0, historicalEntries: 0, bondDenom: "", - minCommissionRate: "", - minSelfDelegation: "" + minCommissionRate: "" }; } export const Params = { typeUrl: "/cosmos.staking.v1beta1.Params", + aminoType: "cosmos-sdk/x/staking/Params", + is(o: any): o is Params { + return o && (o.$typeUrl === Params.typeUrl || Duration.is(o.unbondingTime) && typeof o.maxValidators === "number" && typeof o.maxEntries === "number" && typeof o.historicalEntries === "number" && typeof o.bondDenom === "string" && typeof o.minCommissionRate === "string"); + }, + isSDK(o: any): o is ParamsSDKType { + return o && (o.$typeUrl === Params.typeUrl || Duration.isSDK(o.unbonding_time) && typeof o.max_validators === "number" && typeof o.max_entries === "number" && typeof o.historical_entries === "number" && typeof o.bond_denom === "string" && typeof o.min_commission_rate === "string"); + }, + isAmino(o: any): o is ParamsAmino { + return o && (o.$typeUrl === Params.typeUrl || Duration.isAmino(o.unbonding_time) && typeof o.max_validators === "number" && typeof o.max_entries === "number" && typeof o.historical_entries === "number" && typeof o.bond_denom === "string" && typeof o.min_commission_rate === "string"); + }, encode(message: Params, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.unbondingTime !== undefined) { Duration.encode(message.unbondingTime, writer.uint32(10).fork()).ldelim(); @@ -2241,9 +2956,6 @@ export const Params = { if (message.minCommissionRate !== "") { writer.uint32(50).string(Decimal.fromUserInput(message.minCommissionRate, 18).atomics); } - if (message.minSelfDelegation !== "") { - writer.uint32(58).string(message.minSelfDelegation); - } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): Params { @@ -2271,9 +2983,6 @@ export const Params = { case 6: message.minCommissionRate = Decimal.fromAtomics(reader.string(), 18).toString(); break; - case 7: - message.minSelfDelegation = reader.string(); - break; default: reader.skipType(tag & 7); break; @@ -2281,6 +2990,26 @@ export const Params = { } return message; }, + fromJSON(object: any): Params { + return { + 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, + bondDenom: isSet(object.bondDenom) ? String(object.bondDenom) : "", + minCommissionRate: isSet(object.minCommissionRate) ? String(object.minCommissionRate) : "" + }; + }, + toJSON(message: Params): unknown { + 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); + message.minCommissionRate !== undefined && (obj.minCommissionRate = message.minCommissionRate); + return obj; + }, fromPartial(object: Partial): Params { const message = createBaseParams(); message.unbondingTime = object.unbondingTime !== undefined && object.unbondingTime !== null ? Duration.fromPartial(object.unbondingTime) : undefined; @@ -2289,29 +3018,38 @@ export const Params = { message.historicalEntries = object.historicalEntries ?? 0; message.bondDenom = object.bondDenom ?? ""; message.minCommissionRate = object.minCommissionRate ?? ""; - message.minSelfDelegation = object.minSelfDelegation ?? ""; return message; }, fromAmino(object: ParamsAmino): Params { - return { - unbondingTime: object?.unbonding_time ? Duration.fromAmino(object.unbonding_time) : undefined, - maxValidators: object.max_validators, - maxEntries: object.max_entries, - historicalEntries: object.historical_entries, - bondDenom: object.bond_denom, - minCommissionRate: object.min_commission_rate, - minSelfDelegation: object.min_self_delegation - }; + const message = createBaseParams(); + if (object.unbonding_time !== undefined && object.unbonding_time !== null) { + message.unbondingTime = Duration.fromAmino(object.unbonding_time); + } + if (object.max_validators !== undefined && object.max_validators !== null) { + message.maxValidators = object.max_validators; + } + if (object.max_entries !== undefined && object.max_entries !== null) { + message.maxEntries = object.max_entries; + } + if (object.historical_entries !== undefined && object.historical_entries !== null) { + message.historicalEntries = object.historical_entries; + } + if (object.bond_denom !== undefined && object.bond_denom !== null) { + message.bondDenom = object.bond_denom; + } + if (object.min_commission_rate !== undefined && object.min_commission_rate !== null) { + message.minCommissionRate = object.min_commission_rate; + } + return message; }, toAmino(message: Params): ParamsAmino { const obj: any = {}; - obj.unbonding_time = message.unbondingTime ? Duration.toAmino(message.unbondingTime) : undefined; + obj.unbonding_time = message.unbondingTime ? Duration.toAmino(message.unbondingTime) : Duration.fromPartial({}); obj.max_validators = message.maxValidators; obj.max_entries = message.maxEntries; obj.historical_entries = message.historicalEntries; obj.bond_denom = message.bondDenom; obj.min_commission_rate = message.minCommissionRate; - obj.min_self_delegation = message.minSelfDelegation; return obj; }, fromAminoMsg(object: ParamsAminoMsg): Params { @@ -2336,14 +3074,26 @@ export const Params = { }; } }; +GlobalDecoderRegistry.register(Params.typeUrl, Params); +GlobalDecoderRegistry.registerAminoProtoMapping(Params.aminoType, Params.typeUrl); function createBaseDelegationResponse(): DelegationResponse { return { delegation: Delegation.fromPartial({}), - balance: undefined + balance: Coin.fromPartial({}) }; } export const DelegationResponse = { typeUrl: "/cosmos.staking.v1beta1.DelegationResponse", + aminoType: "cosmos-sdk/DelegationResponse", + is(o: any): o is DelegationResponse { + return o && (o.$typeUrl === DelegationResponse.typeUrl || Delegation.is(o.delegation) && Coin.is(o.balance)); + }, + isSDK(o: any): o is DelegationResponseSDKType { + return o && (o.$typeUrl === DelegationResponse.typeUrl || Delegation.isSDK(o.delegation) && Coin.isSDK(o.balance)); + }, + isAmino(o: any): o is DelegationResponseAmino { + return o && (o.$typeUrl === DelegationResponse.typeUrl || Delegation.isAmino(o.delegation) && Coin.isAmino(o.balance)); + }, encode(message: DelegationResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.delegation !== undefined) { Delegation.encode(message.delegation, writer.uint32(10).fork()).ldelim(); @@ -2373,6 +3123,18 @@ export const DelegationResponse = { } return message; }, + fromJSON(object: any): DelegationResponse { + return { + 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 = {}; + 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(object: Partial): DelegationResponse { const message = createBaseDelegationResponse(); message.delegation = object.delegation !== undefined && object.delegation !== null ? Delegation.fromPartial(object.delegation) : undefined; @@ -2380,15 +3142,19 @@ export const DelegationResponse = { return message; }, fromAmino(object: DelegationResponseAmino): DelegationResponse { - return { - delegation: object?.delegation ? Delegation.fromAmino(object.delegation) : undefined, - balance: object?.balance ? Coin.fromAmino(object.balance) : undefined - }; + const message = createBaseDelegationResponse(); + if (object.delegation !== undefined && object.delegation !== null) { + message.delegation = Delegation.fromAmino(object.delegation); + } + if (object.balance !== undefined && object.balance !== null) { + message.balance = Coin.fromAmino(object.balance); + } + return message; }, toAmino(message: DelegationResponse): DelegationResponseAmino { const obj: any = {}; - obj.delegation = message.delegation ? Delegation.toAmino(message.delegation) : undefined; - obj.balance = message.balance ? Coin.toAmino(message.balance) : undefined; + obj.delegation = message.delegation ? Delegation.toAmino(message.delegation) : Delegation.fromPartial({}); + obj.balance = message.balance ? Coin.toAmino(message.balance) : Coin.fromPartial({}); return obj; }, fromAminoMsg(object: DelegationResponseAminoMsg): DelegationResponse { @@ -2413,6 +3179,8 @@ export const DelegationResponse = { }; } }; +GlobalDecoderRegistry.register(DelegationResponse.typeUrl, DelegationResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(DelegationResponse.aminoType, DelegationResponse.typeUrl); function createBaseRedelegationEntryResponse(): RedelegationEntryResponse { return { redelegationEntry: RedelegationEntry.fromPartial({}), @@ -2421,6 +3189,16 @@ function createBaseRedelegationEntryResponse(): RedelegationEntryResponse { } export const RedelegationEntryResponse = { typeUrl: "/cosmos.staking.v1beta1.RedelegationEntryResponse", + aminoType: "cosmos-sdk/RedelegationEntryResponse", + is(o: any): o is RedelegationEntryResponse { + return o && (o.$typeUrl === RedelegationEntryResponse.typeUrl || RedelegationEntry.is(o.redelegationEntry) && typeof o.balance === "string"); + }, + isSDK(o: any): o is RedelegationEntryResponseSDKType { + return o && (o.$typeUrl === RedelegationEntryResponse.typeUrl || RedelegationEntry.isSDK(o.redelegation_entry) && typeof o.balance === "string"); + }, + isAmino(o: any): o is RedelegationEntryResponseAmino { + return o && (o.$typeUrl === RedelegationEntryResponse.typeUrl || RedelegationEntry.isAmino(o.redelegation_entry) && typeof o.balance === "string"); + }, encode(message: RedelegationEntryResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.redelegationEntry !== undefined) { RedelegationEntry.encode(message.redelegationEntry, writer.uint32(10).fork()).ldelim(); @@ -2450,6 +3228,18 @@ export const RedelegationEntryResponse = { } return message; }, + fromJSON(object: any): RedelegationEntryResponse { + return { + redelegationEntry: isSet(object.redelegationEntry) ? 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; + }, fromPartial(object: Partial): RedelegationEntryResponse { const message = createBaseRedelegationEntryResponse(); message.redelegationEntry = object.redelegationEntry !== undefined && object.redelegationEntry !== null ? RedelegationEntry.fromPartial(object.redelegationEntry) : undefined; @@ -2457,14 +3247,18 @@ export const RedelegationEntryResponse = { return message; }, fromAmino(object: RedelegationEntryResponseAmino): RedelegationEntryResponse { - return { - redelegationEntry: object?.redelegation_entry ? RedelegationEntry.fromAmino(object.redelegation_entry) : undefined, - balance: object.balance - }; + const message = createBaseRedelegationEntryResponse(); + if (object.redelegation_entry !== undefined && object.redelegation_entry !== null) { + message.redelegationEntry = RedelegationEntry.fromAmino(object.redelegation_entry); + } + if (object.balance !== undefined && object.balance !== null) { + message.balance = object.balance; + } + return message; }, toAmino(message: RedelegationEntryResponse): RedelegationEntryResponseAmino { const obj: any = {}; - obj.redelegation_entry = message.redelegationEntry ? RedelegationEntry.toAmino(message.redelegationEntry) : undefined; + obj.redelegation_entry = message.redelegationEntry ? RedelegationEntry.toAmino(message.redelegationEntry) : RedelegationEntry.fromPartial({}); obj.balance = message.balance; return obj; }, @@ -2490,6 +3284,8 @@ export const RedelegationEntryResponse = { }; } }; +GlobalDecoderRegistry.register(RedelegationEntryResponse.typeUrl, RedelegationEntryResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(RedelegationEntryResponse.aminoType, RedelegationEntryResponse.typeUrl); function createBaseRedelegationResponse(): RedelegationResponse { return { redelegation: Redelegation.fromPartial({}), @@ -2498,6 +3294,16 @@ function createBaseRedelegationResponse(): RedelegationResponse { } export const RedelegationResponse = { typeUrl: "/cosmos.staking.v1beta1.RedelegationResponse", + aminoType: "cosmos-sdk/RedelegationResponse", + is(o: any): o is RedelegationResponse { + return o && (o.$typeUrl === RedelegationResponse.typeUrl || Redelegation.is(o.redelegation) && Array.isArray(o.entries) && (!o.entries.length || RedelegationEntryResponse.is(o.entries[0]))); + }, + isSDK(o: any): o is RedelegationResponseSDKType { + return o && (o.$typeUrl === RedelegationResponse.typeUrl || Redelegation.isSDK(o.redelegation) && Array.isArray(o.entries) && (!o.entries.length || RedelegationEntryResponse.isSDK(o.entries[0]))); + }, + isAmino(o: any): o is RedelegationResponseAmino { + return o && (o.$typeUrl === RedelegationResponse.typeUrl || Redelegation.isAmino(o.redelegation) && Array.isArray(o.entries) && (!o.entries.length || RedelegationEntryResponse.isAmino(o.entries[0]))); + }, encode(message: RedelegationResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.redelegation !== undefined) { Redelegation.encode(message.redelegation, writer.uint32(10).fork()).ldelim(); @@ -2527,6 +3333,22 @@ export const RedelegationResponse = { } return message; }, + fromJSON(object: any): RedelegationResponse { + return { + 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 = {}; + 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); + } else { + obj.entries = []; + } + return obj; + }, fromPartial(object: Partial): RedelegationResponse { const message = createBaseRedelegationResponse(); message.redelegation = object.redelegation !== undefined && object.redelegation !== null ? Redelegation.fromPartial(object.redelegation) : undefined; @@ -2534,14 +3356,16 @@ export const RedelegationResponse = { return message; }, fromAmino(object: RedelegationResponseAmino): RedelegationResponse { - return { - redelegation: object?.redelegation ? Redelegation.fromAmino(object.redelegation) : undefined, - entries: Array.isArray(object?.entries) ? object.entries.map((e: any) => RedelegationEntryResponse.fromAmino(e)) : [] - }; + const message = createBaseRedelegationResponse(); + if (object.redelegation !== undefined && object.redelegation !== null) { + message.redelegation = Redelegation.fromAmino(object.redelegation); + } + message.entries = object.entries?.map(e => RedelegationEntryResponse.fromAmino(e)) || []; + return message; }, toAmino(message: RedelegationResponse): RedelegationResponseAmino { const obj: any = {}; - obj.redelegation = message.redelegation ? Redelegation.toAmino(message.redelegation) : undefined; + obj.redelegation = message.redelegation ? Redelegation.toAmino(message.redelegation) : Redelegation.fromPartial({}); if (message.entries) { obj.entries = message.entries.map(e => e ? RedelegationEntryResponse.toAmino(e) : undefined); } else { @@ -2571,6 +3395,8 @@ export const RedelegationResponse = { }; } }; +GlobalDecoderRegistry.register(RedelegationResponse.typeUrl, RedelegationResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(RedelegationResponse.aminoType, RedelegationResponse.typeUrl); function createBasePool(): Pool { return { notBondedTokens: "", @@ -2579,6 +3405,16 @@ function createBasePool(): Pool { } export const Pool = { typeUrl: "/cosmos.staking.v1beta1.Pool", + aminoType: "cosmos-sdk/Pool", + is(o: any): o is Pool { + return o && (o.$typeUrl === Pool.typeUrl || typeof o.notBondedTokens === "string" && typeof o.bondedTokens === "string"); + }, + isSDK(o: any): o is PoolSDKType { + return o && (o.$typeUrl === Pool.typeUrl || typeof o.not_bonded_tokens === "string" && typeof o.bonded_tokens === "string"); + }, + isAmino(o: any): o is PoolAmino { + return o && (o.$typeUrl === Pool.typeUrl || typeof o.not_bonded_tokens === "string" && typeof o.bonded_tokens === "string"); + }, encode(message: Pool, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.notBondedTokens !== "") { writer.uint32(10).string(message.notBondedTokens); @@ -2608,6 +3444,18 @@ export const Pool = { } return message; }, + fromJSON(object: any): Pool { + return { + 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; + }, fromPartial(object: Partial): Pool { const message = createBasePool(); message.notBondedTokens = object.notBondedTokens ?? ""; @@ -2615,15 +3463,19 @@ export const Pool = { return message; }, fromAmino(object: PoolAmino): Pool { - return { - notBondedTokens: object.not_bonded_tokens, - bondedTokens: object.bonded_tokens - }; + const message = createBasePool(); + if (object.not_bonded_tokens !== undefined && object.not_bonded_tokens !== null) { + message.notBondedTokens = object.not_bonded_tokens; + } + if (object.bonded_tokens !== undefined && object.bonded_tokens !== null) { + message.bondedTokens = object.bonded_tokens; + } + return message; }, toAmino(message: Pool): PoolAmino { const obj: any = {}; - obj.not_bonded_tokens = message.notBondedTokens; - obj.bonded_tokens = message.bondedTokens; + obj.not_bonded_tokens = message.notBondedTokens ?? ""; + obj.bonded_tokens = message.bondedTokens ?? ""; return obj; }, fromAminoMsg(object: PoolAminoMsg): Pool { @@ -2648,23 +3500,102 @@ export const Pool = { }; } }; -export const Cosmos_cryptoPubKey_InterfaceDecoder = (input: BinaryReader | Uint8Array): Any => { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - const data = Any.decode(reader, reader.uint32()); - switch (data.typeUrl) { - default: - return data; - } -}; -export const Cosmos_cryptoPubKey_FromAmino = (content: AnyAmino) => { - return encodeBech32Pubkey({ - type: "tendermint/PubKeySecp256k1", - value: toBase64(content.value) - }, "cosmos"); -}; -export const Cosmos_cryptoPubKey_ToAmino = (content: Any) => { +GlobalDecoderRegistry.register(Pool.typeUrl, Pool); +GlobalDecoderRegistry.registerAminoProtoMapping(Pool.aminoType, Pool.typeUrl); +function createBaseValidatorUpdates(): ValidatorUpdates { return { - typeUrl: "/cosmos.crypto.secp256k1.PubKey", - value: fromBase64(decodeBech32Pubkey(content).value) + updates: [] }; -}; \ No newline at end of file +} +export const ValidatorUpdates = { + typeUrl: "/cosmos.staking.v1beta1.ValidatorUpdates", + aminoType: "cosmos-sdk/ValidatorUpdates", + is(o: any): o is ValidatorUpdates { + return o && (o.$typeUrl === ValidatorUpdates.typeUrl || Array.isArray(o.updates) && (!o.updates.length || ValidatorUpdate.is(o.updates[0]))); + }, + isSDK(o: any): o is ValidatorUpdatesSDKType { + return o && (o.$typeUrl === ValidatorUpdates.typeUrl || Array.isArray(o.updates) && (!o.updates.length || ValidatorUpdate.isSDK(o.updates[0]))); + }, + isAmino(o: any): o is ValidatorUpdatesAmino { + return o && (o.$typeUrl === ValidatorUpdates.typeUrl || Array.isArray(o.updates) && (!o.updates.length || ValidatorUpdate.isAmino(o.updates[0]))); + }, + encode(message: ValidatorUpdates, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.updates) { + ValidatorUpdate.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): ValidatorUpdates { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseValidatorUpdates(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.updates.push(ValidatorUpdate.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): ValidatorUpdates { + return { + updates: Array.isArray(object?.updates) ? object.updates.map((e: any) => ValidatorUpdate.fromJSON(e)) : [] + }; + }, + toJSON(message: ValidatorUpdates): unknown { + const obj: any = {}; + if (message.updates) { + obj.updates = message.updates.map(e => e ? ValidatorUpdate.toJSON(e) : undefined); + } else { + obj.updates = []; + } + return obj; + }, + fromPartial(object: Partial): ValidatorUpdates { + const message = createBaseValidatorUpdates(); + message.updates = object.updates?.map(e => ValidatorUpdate.fromPartial(e)) || []; + return message; + }, + fromAmino(object: ValidatorUpdatesAmino): ValidatorUpdates { + const message = createBaseValidatorUpdates(); + message.updates = object.updates?.map(e => ValidatorUpdate.fromAmino(e)) || []; + return message; + }, + toAmino(message: ValidatorUpdates): ValidatorUpdatesAmino { + const obj: any = {}; + if (message.updates) { + obj.updates = message.updates.map(e => e ? ValidatorUpdate.toAmino(e) : undefined); + } else { + obj.updates = []; + } + return obj; + }, + fromAminoMsg(object: ValidatorUpdatesAminoMsg): ValidatorUpdates { + return ValidatorUpdates.fromAmino(object.value); + }, + toAminoMsg(message: ValidatorUpdates): ValidatorUpdatesAminoMsg { + return { + type: "cosmos-sdk/ValidatorUpdates", + value: ValidatorUpdates.toAmino(message) + }; + }, + fromProtoMsg(message: ValidatorUpdatesProtoMsg): ValidatorUpdates { + return ValidatorUpdates.decode(message.value); + }, + toProto(message: ValidatorUpdates): Uint8Array { + return ValidatorUpdates.encode(message).finish(); + }, + toProtoMsg(message: ValidatorUpdates): ValidatorUpdatesProtoMsg { + return { + typeUrl: "/cosmos.staking.v1beta1.ValidatorUpdates", + value: ValidatorUpdates.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(ValidatorUpdates.typeUrl, ValidatorUpdates); +GlobalDecoderRegistry.registerAminoProtoMapping(ValidatorUpdates.aminoType, ValidatorUpdates.typeUrl); \ No newline at end of file diff --git a/packages/osmojs/src/codegen/cosmos/staking/v1beta1/tx.amino.ts b/packages/osmojs/src/codegen/cosmos/staking/v1beta1/tx.amino.ts index 159426720..9d017906e 100644 --- a/packages/osmojs/src/codegen/cosmos/staking/v1beta1/tx.amino.ts +++ b/packages/osmojs/src/codegen/cosmos/staking/v1beta1/tx.amino.ts @@ -1,5 +1,5 @@ //@ts-nocheck -import { MsgCreateValidator, MsgEditValidator, MsgDelegate, MsgBeginRedelegate, MsgUndelegate } from "./tx"; +import { MsgCreateValidator, MsgEditValidator, MsgDelegate, MsgBeginRedelegate, MsgUndelegate, MsgCancelUnbondingDelegation, MsgUpdateParams } from "./tx"; export const AminoConverter = { "/cosmos.staking.v1beta1.MsgCreateValidator": { aminoType: "cosmos-sdk/MsgCreateValidator", @@ -25,5 +25,15 @@ export const AminoConverter = { aminoType: "cosmos-sdk/MsgUndelegate", toAmino: MsgUndelegate.toAmino, fromAmino: MsgUndelegate.fromAmino + }, + "/cosmos.staking.v1beta1.MsgCancelUnbondingDelegation": { + aminoType: "cosmos-sdk/MsgCancelUnbondingDelegation", + toAmino: MsgCancelUnbondingDelegation.toAmino, + fromAmino: MsgCancelUnbondingDelegation.fromAmino + }, + "/cosmos.staking.v1beta1.MsgUpdateParams": { + aminoType: "cosmos-sdk/x/staking/MsgUpdateParams", + toAmino: MsgUpdateParams.toAmino, + fromAmino: MsgUpdateParams.fromAmino } }; \ No newline at end of file diff --git a/packages/osmojs/src/codegen/cosmos/staking/v1beta1/tx.registry.ts b/packages/osmojs/src/codegen/cosmos/staking/v1beta1/tx.registry.ts index a8e1a9d0e..61f388681 100644 --- a/packages/osmojs/src/codegen/cosmos/staking/v1beta1/tx.registry.ts +++ b/packages/osmojs/src/codegen/cosmos/staking/v1beta1/tx.registry.ts @@ -1,7 +1,7 @@ //@ts-nocheck import { GeneratedType, Registry } from "@cosmjs/proto-signing"; -import { MsgCreateValidator, MsgEditValidator, MsgDelegate, MsgBeginRedelegate, MsgUndelegate } from "./tx"; -export const registry: ReadonlyArray<[string, GeneratedType]> = [["/cosmos.staking.v1beta1.MsgCreateValidator", MsgCreateValidator], ["/cosmos.staking.v1beta1.MsgEditValidator", MsgEditValidator], ["/cosmos.staking.v1beta1.MsgDelegate", MsgDelegate], ["/cosmos.staking.v1beta1.MsgBeginRedelegate", MsgBeginRedelegate], ["/cosmos.staking.v1beta1.MsgUndelegate", MsgUndelegate]]; +import { MsgCreateValidator, MsgEditValidator, MsgDelegate, MsgBeginRedelegate, MsgUndelegate, MsgCancelUnbondingDelegation, MsgUpdateParams } from "./tx"; +export const registry: ReadonlyArray<[string, GeneratedType]> = [["/cosmos.staking.v1beta1.MsgCreateValidator", MsgCreateValidator], ["/cosmos.staking.v1beta1.MsgEditValidator", MsgEditValidator], ["/cosmos.staking.v1beta1.MsgDelegate", MsgDelegate], ["/cosmos.staking.v1beta1.MsgBeginRedelegate", MsgBeginRedelegate], ["/cosmos.staking.v1beta1.MsgUndelegate", MsgUndelegate], ["/cosmos.staking.v1beta1.MsgCancelUnbondingDelegation", MsgCancelUnbondingDelegation], ["/cosmos.staking.v1beta1.MsgUpdateParams", MsgUpdateParams]]; export const load = (protoRegistry: Registry) => { registry.forEach(([typeUrl, mod]) => { protoRegistry.register(typeUrl, mod); @@ -38,6 +38,18 @@ export const MessageComposer = { typeUrl: "/cosmos.staking.v1beta1.MsgUndelegate", value: MsgUndelegate.encode(value).finish() }; + }, + cancelUnbondingDelegation(value: MsgCancelUnbondingDelegation) { + return { + typeUrl: "/cosmos.staking.v1beta1.MsgCancelUnbondingDelegation", + value: MsgCancelUnbondingDelegation.encode(value).finish() + }; + }, + updateParams(value: MsgUpdateParams) { + return { + typeUrl: "/cosmos.staking.v1beta1.MsgUpdateParams", + value: MsgUpdateParams.encode(value).finish() + }; } }, withTypeUrl: { @@ -70,6 +82,106 @@ export const MessageComposer = { typeUrl: "/cosmos.staking.v1beta1.MsgUndelegate", value }; + }, + cancelUnbondingDelegation(value: MsgCancelUnbondingDelegation) { + return { + typeUrl: "/cosmos.staking.v1beta1.MsgCancelUnbondingDelegation", + value + }; + }, + updateParams(value: MsgUpdateParams) { + return { + typeUrl: "/cosmos.staking.v1beta1.MsgUpdateParams", + value + }; + } + }, + toJSON: { + createValidator(value: MsgCreateValidator) { + return { + typeUrl: "/cosmos.staking.v1beta1.MsgCreateValidator", + value: MsgCreateValidator.toJSON(value) + }; + }, + editValidator(value: MsgEditValidator) { + return { + typeUrl: "/cosmos.staking.v1beta1.MsgEditValidator", + value: MsgEditValidator.toJSON(value) + }; + }, + delegate(value: MsgDelegate) { + return { + typeUrl: "/cosmos.staking.v1beta1.MsgDelegate", + value: MsgDelegate.toJSON(value) + }; + }, + beginRedelegate(value: MsgBeginRedelegate) { + return { + typeUrl: "/cosmos.staking.v1beta1.MsgBeginRedelegate", + value: MsgBeginRedelegate.toJSON(value) + }; + }, + undelegate(value: MsgUndelegate) { + return { + typeUrl: "/cosmos.staking.v1beta1.MsgUndelegate", + value: MsgUndelegate.toJSON(value) + }; + }, + cancelUnbondingDelegation(value: MsgCancelUnbondingDelegation) { + return { + typeUrl: "/cosmos.staking.v1beta1.MsgCancelUnbondingDelegation", + value: MsgCancelUnbondingDelegation.toJSON(value) + }; + }, + updateParams(value: MsgUpdateParams) { + return { + typeUrl: "/cosmos.staking.v1beta1.MsgUpdateParams", + value: MsgUpdateParams.toJSON(value) + }; + } + }, + fromJSON: { + createValidator(value: any) { + return { + typeUrl: "/cosmos.staking.v1beta1.MsgCreateValidator", + value: MsgCreateValidator.fromJSON(value) + }; + }, + editValidator(value: any) { + return { + typeUrl: "/cosmos.staking.v1beta1.MsgEditValidator", + value: MsgEditValidator.fromJSON(value) + }; + }, + delegate(value: any) { + return { + typeUrl: "/cosmos.staking.v1beta1.MsgDelegate", + value: MsgDelegate.fromJSON(value) + }; + }, + beginRedelegate(value: any) { + return { + typeUrl: "/cosmos.staking.v1beta1.MsgBeginRedelegate", + value: MsgBeginRedelegate.fromJSON(value) + }; + }, + undelegate(value: any) { + return { + typeUrl: "/cosmos.staking.v1beta1.MsgUndelegate", + value: MsgUndelegate.fromJSON(value) + }; + }, + cancelUnbondingDelegation(value: any) { + return { + typeUrl: "/cosmos.staking.v1beta1.MsgCancelUnbondingDelegation", + value: MsgCancelUnbondingDelegation.fromJSON(value) + }; + }, + updateParams(value: any) { + return { + typeUrl: "/cosmos.staking.v1beta1.MsgUpdateParams", + value: MsgUpdateParams.fromJSON(value) + }; } }, fromPartial: { @@ -102,6 +214,18 @@ export const MessageComposer = { typeUrl: "/cosmos.staking.v1beta1.MsgUndelegate", value: MsgUndelegate.fromPartial(value) }; + }, + cancelUnbondingDelegation(value: MsgCancelUnbondingDelegation) { + return { + typeUrl: "/cosmos.staking.v1beta1.MsgCancelUnbondingDelegation", + value: MsgCancelUnbondingDelegation.fromPartial(value) + }; + }, + updateParams(value: MsgUpdateParams) { + return { + typeUrl: "/cosmos.staking.v1beta1.MsgUpdateParams", + value: MsgUpdateParams.fromPartial(value) + }; } } }; \ No newline at end of file diff --git a/packages/osmojs/src/codegen/cosmos/staking/v1beta1/tx.rpc.msg.ts b/packages/osmojs/src/codegen/cosmos/staking/v1beta1/tx.rpc.msg.ts index bc68ae5b6..ee78e36c7 100644 --- a/packages/osmojs/src/codegen/cosmos/staking/v1beta1/tx.rpc.msg.ts +++ b/packages/osmojs/src/codegen/cosmos/staking/v1beta1/tx.rpc.msg.ts @@ -1,6 +1,6 @@ import { Rpc } from "../../../helpers"; import { BinaryReader } from "../../../binary"; -import { MsgCreateValidator, MsgCreateValidatorResponse, MsgEditValidator, MsgEditValidatorResponse, MsgDelegate, MsgDelegateResponse, MsgBeginRedelegate, MsgBeginRedelegateResponse, MsgUndelegate, MsgUndelegateResponse } from "./tx"; +import { MsgCreateValidator, MsgCreateValidatorResponse, MsgEditValidator, MsgEditValidatorResponse, MsgDelegate, MsgDelegateResponse, MsgBeginRedelegate, MsgBeginRedelegateResponse, MsgUndelegate, MsgUndelegateResponse, MsgCancelUnbondingDelegation, MsgCancelUnbondingDelegationResponse, MsgUpdateParams, MsgUpdateParamsResponse } from "./tx"; /** Msg defines the staking Msg service. */ export interface Msg { /** CreateValidator defines a method for creating a new validator. */ @@ -22,6 +22,19 @@ export interface Msg { * delegate and a validator. */ undelegate(request: MsgUndelegate): Promise; + /** + * CancelUnbondingDelegation defines a method for performing canceling the unbonding delegation + * and delegate back to previous validator. + * + * Since: cosmos-sdk 0.46 + */ + cancelUnbondingDelegation(request: MsgCancelUnbondingDelegation): Promise; + /** + * UpdateParams defines an operation for updating the x/staking module + * parameters. + * Since: cosmos-sdk 0.47 + */ + updateParams(request: MsgUpdateParams): Promise; } export class MsgClientImpl implements Msg { private readonly rpc: Rpc; @@ -32,6 +45,8 @@ export class MsgClientImpl implements Msg { this.delegate = this.delegate.bind(this); this.beginRedelegate = this.beginRedelegate.bind(this); this.undelegate = this.undelegate.bind(this); + this.cancelUnbondingDelegation = this.cancelUnbondingDelegation.bind(this); + this.updateParams = this.updateParams.bind(this); } createValidator(request: MsgCreateValidator): Promise { const data = MsgCreateValidator.encode(request).finish(); @@ -58,4 +73,17 @@ export class MsgClientImpl implements Msg { const promise = this.rpc.request("cosmos.staking.v1beta1.Msg", "Undelegate", data); return promise.then(data => MsgUndelegateResponse.decode(new BinaryReader(data))); } -} \ No newline at end of file + cancelUnbondingDelegation(request: MsgCancelUnbondingDelegation): Promise { + const data = MsgCancelUnbondingDelegation.encode(request).finish(); + const promise = this.rpc.request("cosmos.staking.v1beta1.Msg", "CancelUnbondingDelegation", data); + return promise.then(data => MsgCancelUnbondingDelegationResponse.decode(new BinaryReader(data))); + } + updateParams(request: MsgUpdateParams): Promise { + const data = MsgUpdateParams.encode(request).finish(); + const promise = this.rpc.request("cosmos.staking.v1beta1.Msg", "UpdateParams", data); + return promise.then(data => MsgUpdateParamsResponse.decode(new BinaryReader(data))); + } +} +export const createClientImpl = (rpc: Rpc) => { + return new MsgClientImpl(rpc); +}; \ No newline at end of file diff --git a/packages/osmojs/src/codegen/cosmos/staking/v1beta1/tx.ts b/packages/osmojs/src/codegen/cosmos/staking/v1beta1/tx.ts index a5f55d3cd..c4d58ca80 100644 --- a/packages/osmojs/src/codegen/cosmos/staking/v1beta1/tx.ts +++ b/packages/osmojs/src/codegen/cosmos/staking/v1beta1/tx.ts @@ -1,12 +1,12 @@ -import { Description, DescriptionAmino, DescriptionSDKType, CommissionRates, CommissionRatesAmino, CommissionRatesSDKType } from "./staking"; +import { Description, DescriptionAmino, DescriptionSDKType, CommissionRates, CommissionRatesAmino, CommissionRatesSDKType, Params, ParamsAmino, ParamsSDKType } from "./staking"; import { Any, AnyProtoMsg, AnyAmino, AnySDKType } from "../../../google/protobuf/any"; import { Coin, CoinAmino, CoinSDKType } from "../../base/v1beta1/coin"; import { Timestamp } from "../../../google/protobuf/timestamp"; import { BinaryReader, BinaryWriter } from "../../../binary"; -import { toBase64, fromBase64 } from "@cosmjs/encoding"; -import { encodeBech32Pubkey, decodeBech32Pubkey } from "@cosmjs/amino"; +import { isSet, toTimestamp, fromTimestamp } from "../../../helpers"; +import { encodePubkey, decodePubkey } from "@cosmjs/proto-signing"; +import { GlobalDecoderRegistry } from "../../../registry"; import { Decimal } from "@cosmjs/math"; -import { toTimestamp, fromTimestamp } from "../../../helpers"; /** MsgCreateValidator defines a SDK message for creating a new validator. */ export interface MsgCreateValidator { description: Description; @@ -14,7 +14,7 @@ export interface MsgCreateValidator { minSelfDelegation: string; delegatorAddress: string; validatorAddress: string; - pubkey: (Any) | undefined; + pubkey?: Any | undefined; value: Coin; } export interface MsgCreateValidatorProtoMsg { @@ -26,13 +26,13 @@ export type MsgCreateValidatorEncoded = Omit & { }; /** MsgCreateValidator defines a SDK message for creating a new validator. */ export interface MsgCreateValidatorAmino { - description?: DescriptionAmino; - commission?: CommissionRatesAmino; - min_self_delegation: string; - delegator_address: string; - validator_address: string; + description: DescriptionAmino; + commission: CommissionRatesAmino; + min_self_delegation?: string; + delegator_address?: string; + validator_address?: string; pubkey?: AnyAmino; - value?: CoinAmino; + value: CoinAmino; } export interface MsgCreateValidatorAminoMsg { type: "cosmos-sdk/MsgCreateValidator"; @@ -45,7 +45,7 @@ export interface MsgCreateValidatorSDKType { min_self_delegation: string; delegator_address: string; validator_address: string; - pubkey: AnySDKType | undefined; + pubkey?: AnySDKType | undefined; value: CoinSDKType; } /** MsgCreateValidatorResponse defines the Msg/CreateValidator response type. */ @@ -81,16 +81,16 @@ export interface MsgEditValidatorProtoMsg { } /** MsgEditValidator defines a SDK message for editing an existing validator. */ export interface MsgEditValidatorAmino { - description?: DescriptionAmino; - validator_address: string; + description: DescriptionAmino; + validator_address?: 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 */ - commission_rate: string; - min_self_delegation: string; + commission_rate?: string; + min_self_delegation?: string; } export interface MsgEditValidatorAminoMsg { type: "cosmos-sdk/MsgEditValidator"; @@ -135,9 +135,9 @@ export interface MsgDelegateProtoMsg { * from a delegator to a validator. */ export interface MsgDelegateAmino { - delegator_address: string; - validator_address: string; - amount?: CoinAmino; + delegator_address?: string; + validator_address?: string; + amount: CoinAmino; } export interface MsgDelegateAminoMsg { type: "cosmos-sdk/MsgDelegate"; @@ -185,10 +185,10 @@ export interface MsgBeginRedelegateProtoMsg { * of coins from a delegator and source validator to a destination validator. */ export interface MsgBeginRedelegateAmino { - delegator_address: string; - validator_src_address: string; - validator_dst_address: string; - amount?: CoinAmino; + delegator_address?: string; + validator_src_address?: string; + validator_dst_address?: string; + amount: CoinAmino; } export interface MsgBeginRedelegateAminoMsg { type: "cosmos-sdk/MsgBeginRedelegate"; @@ -214,7 +214,7 @@ export interface MsgBeginRedelegateResponseProtoMsg { } /** MsgBeginRedelegateResponse defines the Msg/BeginRedelegate response type. */ export interface MsgBeginRedelegateResponseAmino { - completion_time?: Date; + completion_time: string; } export interface MsgBeginRedelegateResponseAminoMsg { type: "cosmos-sdk/MsgBeginRedelegateResponse"; @@ -242,9 +242,9 @@ export interface MsgUndelegateProtoMsg { * delegate and a validator. */ export interface MsgUndelegateAmino { - delegator_address: string; - validator_address: string; - amount?: CoinAmino; + delegator_address?: string; + validator_address?: string; + amount: CoinAmino; } export interface MsgUndelegateAminoMsg { type: "cosmos-sdk/MsgUndelegate"; @@ -269,7 +269,7 @@ export interface MsgUndelegateResponseProtoMsg { } /** MsgUndelegateResponse defines the Msg/Undelegate response type. */ export interface MsgUndelegateResponseAmino { - completion_time?: Date; + completion_time: string; } export interface MsgUndelegateResponseAminoMsg { type: "cosmos-sdk/MsgUndelegateResponse"; @@ -279,6 +279,153 @@ export interface MsgUndelegateResponseAminoMsg { export interface MsgUndelegateResponseSDKType { completion_time: Date; } +/** + * MsgCancelUnbondingDelegation defines the SDK message for performing a cancel unbonding delegation for delegator + * + * Since: cosmos-sdk 0.46 + */ +export interface MsgCancelUnbondingDelegation { + delegatorAddress: string; + validatorAddress: string; + /** amount is always less than or equal to unbonding delegation entry balance */ + amount: Coin; + /** creation_height is the height which the unbonding took place. */ + creationHeight: bigint; +} +export interface MsgCancelUnbondingDelegationProtoMsg { + typeUrl: "/cosmos.staking.v1beta1.MsgCancelUnbondingDelegation"; + value: Uint8Array; +} +/** + * MsgCancelUnbondingDelegation defines the SDK message for performing a cancel unbonding delegation for delegator + * + * Since: cosmos-sdk 0.46 + */ +export interface MsgCancelUnbondingDelegationAmino { + delegator_address?: string; + validator_address?: string; + /** amount is always less than or equal to unbonding delegation entry balance */ + amount: CoinAmino; + /** creation_height is the height which the unbonding took place. */ + creation_height?: string; +} +export interface MsgCancelUnbondingDelegationAminoMsg { + type: "cosmos-sdk/MsgCancelUnbondingDelegation"; + value: MsgCancelUnbondingDelegationAmino; +} +/** + * MsgCancelUnbondingDelegation defines the SDK message for performing a cancel unbonding delegation for delegator + * + * Since: cosmos-sdk 0.46 + */ +export interface MsgCancelUnbondingDelegationSDKType { + delegator_address: string; + validator_address: string; + amount: CoinSDKType; + creation_height: bigint; +} +/** + * MsgCancelUnbondingDelegationResponse + * + * Since: cosmos-sdk 0.46 + */ +export interface MsgCancelUnbondingDelegationResponse {} +export interface MsgCancelUnbondingDelegationResponseProtoMsg { + typeUrl: "/cosmos.staking.v1beta1.MsgCancelUnbondingDelegationResponse"; + value: Uint8Array; +} +/** + * MsgCancelUnbondingDelegationResponse + * + * Since: cosmos-sdk 0.46 + */ +export interface MsgCancelUnbondingDelegationResponseAmino {} +export interface MsgCancelUnbondingDelegationResponseAminoMsg { + type: "cosmos-sdk/MsgCancelUnbondingDelegationResponse"; + value: MsgCancelUnbondingDelegationResponseAmino; +} +/** + * MsgCancelUnbondingDelegationResponse + * + * Since: cosmos-sdk 0.46 + */ +export interface MsgCancelUnbondingDelegationResponseSDKType {} +/** + * MsgUpdateParams is the Msg/UpdateParams request type. + * + * Since: cosmos-sdk 0.47 + */ +export interface MsgUpdateParams { + /** authority is the address that controls the module (defaults to x/gov unless overwritten). */ + authority: string; + /** + * params defines the x/staking parameters to update. + * + * NOTE: All parameters must be supplied. + */ + params: Params; +} +export interface MsgUpdateParamsProtoMsg { + typeUrl: "/cosmos.staking.v1beta1.MsgUpdateParams"; + value: Uint8Array; +} +/** + * MsgUpdateParams is the Msg/UpdateParams request type. + * + * Since: cosmos-sdk 0.47 + */ +export interface MsgUpdateParamsAmino { + /** authority is the address that controls the module (defaults to x/gov unless overwritten). */ + authority?: string; + /** + * params defines the x/staking parameters to update. + * + * NOTE: All parameters must be supplied. + */ + params: ParamsAmino; +} +export interface MsgUpdateParamsAminoMsg { + type: "cosmos-sdk/x/staking/MsgUpdateParams"; + value: MsgUpdateParamsAmino; +} +/** + * MsgUpdateParams is the Msg/UpdateParams request type. + * + * Since: cosmos-sdk 0.47 + */ +export interface MsgUpdateParamsSDKType { + authority: string; + params: ParamsSDKType; +} +/** + * MsgUpdateParamsResponse defines the response structure for executing a + * MsgUpdateParams message. + * + * Since: cosmos-sdk 0.47 + */ +export interface MsgUpdateParamsResponse {} +export interface MsgUpdateParamsResponseProtoMsg { + typeUrl: "/cosmos.staking.v1beta1.MsgUpdateParamsResponse"; + value: Uint8Array; +} +/** + * MsgUpdateParamsResponse defines the response structure for executing a + * MsgUpdateParams message. + * + * Since: cosmos-sdk 0.47 + */ +export interface MsgUpdateParamsResponseAmino {} +export interface MsgUpdateParamsResponseAminoMsg { + type: "cosmos-sdk/MsgUpdateParamsResponse"; + value: MsgUpdateParamsResponseAmino; +} +/** + * MsgUpdateParamsResponse defines the response structure for executing a + * MsgUpdateParams message. + * + * Since: cosmos-sdk 0.47 + */ +export interface MsgUpdateParamsResponseSDKType {} function createBaseMsgCreateValidator(): MsgCreateValidator { return { description: Description.fromPartial({}), @@ -287,11 +434,21 @@ function createBaseMsgCreateValidator(): MsgCreateValidator { delegatorAddress: "", validatorAddress: "", pubkey: undefined, - value: undefined + value: Coin.fromPartial({}) }; } export const MsgCreateValidator = { typeUrl: "/cosmos.staking.v1beta1.MsgCreateValidator", + aminoType: "cosmos-sdk/MsgCreateValidator", + is(o: any): o is MsgCreateValidator { + return o && (o.$typeUrl === MsgCreateValidator.typeUrl || Description.is(o.description) && CommissionRates.is(o.commission) && typeof o.minSelfDelegation === "string" && typeof o.delegatorAddress === "string" && typeof o.validatorAddress === "string" && Coin.is(o.value)); + }, + isSDK(o: any): o is MsgCreateValidatorSDKType { + return o && (o.$typeUrl === MsgCreateValidator.typeUrl || Description.isSDK(o.description) && CommissionRates.isSDK(o.commission) && typeof o.min_self_delegation === "string" && typeof o.delegator_address === "string" && typeof o.validator_address === "string" && Coin.isSDK(o.value)); + }, + isAmino(o: any): o is MsgCreateValidatorAmino { + return o && (o.$typeUrl === MsgCreateValidator.typeUrl || Description.isAmino(o.description) && CommissionRates.isAmino(o.commission) && typeof o.min_self_delegation === "string" && typeof o.delegator_address === "string" && typeof o.validator_address === "string" && Coin.isAmino(o.value)); + }, encode(message: MsgCreateValidator, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.description !== undefined) { Description.encode(message.description, writer.uint32(10).fork()).ldelim(); @@ -309,7 +466,7 @@ export const MsgCreateValidator = { writer.uint32(42).string(message.validatorAddress); } if (message.pubkey !== undefined) { - Any.encode((message.pubkey as Any), writer.uint32(50).fork()).ldelim(); + Any.encode(GlobalDecoderRegistry.wrapAny(message.pubkey), writer.uint32(50).fork()).ldelim(); } if (message.value !== undefined) { Coin.encode(message.value, writer.uint32(58).fork()).ldelim(); @@ -339,7 +496,7 @@ export const MsgCreateValidator = { message.validatorAddress = reader.string(); break; case 6: - message.pubkey = (Cosmos_cryptoPubKey_InterfaceDecoder(reader) as Any); + message.pubkey = GlobalDecoderRegistry.unwrapAny(reader); break; case 7: message.value = Coin.decode(reader, reader.uint32()); @@ -351,6 +508,28 @@ export const MsgCreateValidator = { } 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) : "", + pubkey: isSet(object.pubkey) ? GlobalDecoderRegistry.fromJSON(object.pubkey) : undefined, + value: isSet(object.value) ? Coin.fromJSON(object.value) : undefined + }; + }, + toJSON(message: MsgCreateValidator): unknown { + const obj: any = {}; + 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 ? GlobalDecoderRegistry.toJSON(message.pubkey) : undefined); + message.value !== undefined && (obj.value = message.value ? Coin.toJSON(message.value) : undefined); + return obj; + }, fromPartial(object: Partial): MsgCreateValidator { const message = createBaseMsgCreateValidator(); message.description = object.description !== undefined && object.description !== null ? Description.fromPartial(object.description) : undefined; @@ -358,36 +537,44 @@ export const MsgCreateValidator = { 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.pubkey = object.pubkey !== undefined && object.pubkey !== null ? GlobalDecoderRegistry.fromPartial(object.pubkey) : undefined; message.value = object.value !== undefined && object.value !== null ? Coin.fromPartial(object.value) : undefined; return message; }, fromAmino(object: MsgCreateValidatorAmino): MsgCreateValidator { - return { - description: object?.description ? Description.fromAmino(object.description) : undefined, - commission: object?.commission ? CommissionRates.fromAmino(object.commission) : undefined, - minSelfDelegation: object.min_self_delegation, - delegatorAddress: object.delegator_address, - validatorAddress: object.validator_address, - pubkey: encodeBech32Pubkey({ - type: "tendermint/PubKeySecp256k1", - value: toBase64(object.pubkey.value) - }, "cosmos"), - value: object?.value ? Coin.fromAmino(object.value) : undefined - }; + const message = createBaseMsgCreateValidator(); + if (object.description !== undefined && object.description !== null) { + message.description = Description.fromAmino(object.description); + } + if (object.commission !== undefined && object.commission !== null) { + message.commission = CommissionRates.fromAmino(object.commission); + } + if (object.min_self_delegation !== undefined && object.min_self_delegation !== null) { + message.minSelfDelegation = object.min_self_delegation; + } + if (object.delegator_address !== undefined && object.delegator_address !== null) { + message.delegatorAddress = object.delegator_address; + } + if (object.validator_address !== undefined && object.validator_address !== null) { + message.validatorAddress = object.validator_address; + } + if (object.pubkey !== undefined && object.pubkey !== null) { + message.pubkey = encodePubkey(object.pubkey); + } + if (object.value !== undefined && object.value !== null) { + message.value = Coin.fromAmino(object.value); + } + return message; }, toAmino(message: MsgCreateValidator): MsgCreateValidatorAmino { const obj: any = {}; - obj.description = message.description ? Description.toAmino(message.description) : undefined; - obj.commission = message.commission ? CommissionRates.toAmino(message.commission) : undefined; + obj.description = message.description ? Description.toAmino(message.description) : Description.fromPartial({}); + obj.commission = message.commission ? CommissionRates.toAmino(message.commission) : CommissionRates.fromPartial({}); obj.min_self_delegation = message.minSelfDelegation; obj.delegator_address = message.delegatorAddress; obj.validator_address = message.validatorAddress; - obj.pubkey = message.pubkey ? { - typeUrl: "/cosmos.crypto.secp256k1.PubKey", - value: fromBase64(decodeBech32Pubkey(message.pubkey).value) - } : undefined; - obj.value = message.value ? Coin.toAmino(message.value) : undefined; + obj.pubkey = message.pubkey ? decodePubkey(message.pubkey) : undefined; + obj.value = message.value ? Coin.toAmino(message.value) : Coin.fromPartial({}); return obj; }, fromAminoMsg(object: MsgCreateValidatorAminoMsg): MsgCreateValidator { @@ -412,11 +599,23 @@ export const MsgCreateValidator = { }; } }; +GlobalDecoderRegistry.register(MsgCreateValidator.typeUrl, MsgCreateValidator); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgCreateValidator.aminoType, MsgCreateValidator.typeUrl); function createBaseMsgCreateValidatorResponse(): MsgCreateValidatorResponse { return {}; } export const MsgCreateValidatorResponse = { typeUrl: "/cosmos.staking.v1beta1.MsgCreateValidatorResponse", + aminoType: "cosmos-sdk/MsgCreateValidatorResponse", + is(o: any): o is MsgCreateValidatorResponse { + return o && o.$typeUrl === MsgCreateValidatorResponse.typeUrl; + }, + isSDK(o: any): o is MsgCreateValidatorResponseSDKType { + return o && o.$typeUrl === MsgCreateValidatorResponse.typeUrl; + }, + isAmino(o: any): o is MsgCreateValidatorResponseAmino { + return o && o.$typeUrl === MsgCreateValidatorResponse.typeUrl; + }, encode(_: MsgCreateValidatorResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, @@ -434,12 +633,20 @@ export const MsgCreateValidatorResponse = { } return message; }, + fromJSON(_: any): MsgCreateValidatorResponse { + return {}; + }, + toJSON(_: MsgCreateValidatorResponse): unknown { + const obj: any = {}; + return obj; + }, fromPartial(_: Partial): MsgCreateValidatorResponse { const message = createBaseMsgCreateValidatorResponse(); return message; }, fromAmino(_: MsgCreateValidatorResponseAmino): MsgCreateValidatorResponse { - return {}; + const message = createBaseMsgCreateValidatorResponse(); + return message; }, toAmino(_: MsgCreateValidatorResponse): MsgCreateValidatorResponseAmino { const obj: any = {}; @@ -467,6 +674,8 @@ export const MsgCreateValidatorResponse = { }; } }; +GlobalDecoderRegistry.register(MsgCreateValidatorResponse.typeUrl, MsgCreateValidatorResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgCreateValidatorResponse.aminoType, MsgCreateValidatorResponse.typeUrl); function createBaseMsgEditValidator(): MsgEditValidator { return { description: Description.fromPartial({}), @@ -477,6 +686,16 @@ function createBaseMsgEditValidator(): MsgEditValidator { } export const MsgEditValidator = { typeUrl: "/cosmos.staking.v1beta1.MsgEditValidator", + aminoType: "cosmos-sdk/MsgEditValidator", + is(o: any): o is MsgEditValidator { + return o && (o.$typeUrl === MsgEditValidator.typeUrl || Description.is(o.description) && typeof o.validatorAddress === "string" && typeof o.commissionRate === "string" && typeof o.minSelfDelegation === "string"); + }, + isSDK(o: any): o is MsgEditValidatorSDKType { + return o && (o.$typeUrl === MsgEditValidator.typeUrl || Description.isSDK(o.description) && typeof o.validator_address === "string" && typeof o.commission_rate === "string" && typeof o.min_self_delegation === "string"); + }, + isAmino(o: any): o is MsgEditValidatorAmino { + return o && (o.$typeUrl === MsgEditValidator.typeUrl || Description.isAmino(o.description) && typeof o.validator_address === "string" && typeof o.commission_rate === "string" && typeof o.min_self_delegation === "string"); + }, encode(message: MsgEditValidator, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.description !== undefined) { Description.encode(message.description, writer.uint32(10).fork()).ldelim(); @@ -518,6 +737,22 @@ export const MsgEditValidator = { } return message; }, + fromJSON(object: any): MsgEditValidator { + return { + 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) : "" + }; + }, + toJSON(message: MsgEditValidator): unknown { + 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(object: Partial): MsgEditValidator { const message = createBaseMsgEditValidator(); message.description = object.description !== undefined && object.description !== null ? Description.fromPartial(object.description) : undefined; @@ -527,16 +762,24 @@ export const MsgEditValidator = { return message; }, fromAmino(object: MsgEditValidatorAmino): MsgEditValidator { - return { - description: object?.description ? Description.fromAmino(object.description) : undefined, - validatorAddress: object.validator_address, - commissionRate: object.commission_rate, - minSelfDelegation: object.min_self_delegation - }; + const message = createBaseMsgEditValidator(); + if (object.description !== undefined && object.description !== null) { + message.description = Description.fromAmino(object.description); + } + if (object.validator_address !== undefined && object.validator_address !== null) { + message.validatorAddress = object.validator_address; + } + if (object.commission_rate !== undefined && object.commission_rate !== null) { + message.commissionRate = object.commission_rate; + } + if (object.min_self_delegation !== undefined && object.min_self_delegation !== null) { + message.minSelfDelegation = object.min_self_delegation; + } + return message; }, toAmino(message: MsgEditValidator): MsgEditValidatorAmino { const obj: any = {}; - obj.description = message.description ? Description.toAmino(message.description) : undefined; + obj.description = message.description ? Description.toAmino(message.description) : Description.fromPartial({}); obj.validator_address = message.validatorAddress; obj.commission_rate = message.commissionRate; obj.min_self_delegation = message.minSelfDelegation; @@ -564,11 +807,23 @@ export const MsgEditValidator = { }; } }; +GlobalDecoderRegistry.register(MsgEditValidator.typeUrl, MsgEditValidator); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgEditValidator.aminoType, MsgEditValidator.typeUrl); function createBaseMsgEditValidatorResponse(): MsgEditValidatorResponse { return {}; } export const MsgEditValidatorResponse = { typeUrl: "/cosmos.staking.v1beta1.MsgEditValidatorResponse", + aminoType: "cosmos-sdk/MsgEditValidatorResponse", + is(o: any): o is MsgEditValidatorResponse { + return o && o.$typeUrl === MsgEditValidatorResponse.typeUrl; + }, + isSDK(o: any): o is MsgEditValidatorResponseSDKType { + return o && o.$typeUrl === MsgEditValidatorResponse.typeUrl; + }, + isAmino(o: any): o is MsgEditValidatorResponseAmino { + return o && o.$typeUrl === MsgEditValidatorResponse.typeUrl; + }, encode(_: MsgEditValidatorResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, @@ -586,12 +841,20 @@ export const MsgEditValidatorResponse = { } return message; }, + fromJSON(_: any): MsgEditValidatorResponse { + return {}; + }, + toJSON(_: MsgEditValidatorResponse): unknown { + const obj: any = {}; + return obj; + }, fromPartial(_: Partial): MsgEditValidatorResponse { const message = createBaseMsgEditValidatorResponse(); return message; }, fromAmino(_: MsgEditValidatorResponseAmino): MsgEditValidatorResponse { - return {}; + const message = createBaseMsgEditValidatorResponse(); + return message; }, toAmino(_: MsgEditValidatorResponse): MsgEditValidatorResponseAmino { const obj: any = {}; @@ -619,15 +882,27 @@ export const MsgEditValidatorResponse = { }; } }; +GlobalDecoderRegistry.register(MsgEditValidatorResponse.typeUrl, MsgEditValidatorResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgEditValidatorResponse.aminoType, MsgEditValidatorResponse.typeUrl); function createBaseMsgDelegate(): MsgDelegate { return { delegatorAddress: "", validatorAddress: "", - amount: undefined + amount: Coin.fromPartial({}) }; } export const MsgDelegate = { typeUrl: "/cosmos.staking.v1beta1.MsgDelegate", + aminoType: "cosmos-sdk/MsgDelegate", + is(o: any): o is MsgDelegate { + return o && (o.$typeUrl === MsgDelegate.typeUrl || typeof o.delegatorAddress === "string" && typeof o.validatorAddress === "string" && Coin.is(o.amount)); + }, + isSDK(o: any): o is MsgDelegateSDKType { + return o && (o.$typeUrl === MsgDelegate.typeUrl || typeof o.delegator_address === "string" && typeof o.validator_address === "string" && Coin.isSDK(o.amount)); + }, + isAmino(o: any): o is MsgDelegateAmino { + return o && (o.$typeUrl === MsgDelegate.typeUrl || typeof o.delegator_address === "string" && typeof o.validator_address === "string" && Coin.isAmino(o.amount)); + }, encode(message: MsgDelegate, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.delegatorAddress !== "") { writer.uint32(10).string(message.delegatorAddress); @@ -663,6 +938,20 @@ export const MsgDelegate = { } return message; }, + fromJSON(object: any): MsgDelegate { + return { + 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; + }, fromPartial(object: Partial): MsgDelegate { const message = createBaseMsgDelegate(); message.delegatorAddress = object.delegatorAddress ?? ""; @@ -671,17 +960,23 @@ export const MsgDelegate = { return message; }, fromAmino(object: MsgDelegateAmino): MsgDelegate { - return { - delegatorAddress: object.delegator_address, - validatorAddress: object.validator_address, - amount: object?.amount ? Coin.fromAmino(object.amount) : undefined - }; + const message = createBaseMsgDelegate(); + if (object.delegator_address !== undefined && object.delegator_address !== null) { + message.delegatorAddress = object.delegator_address; + } + if (object.validator_address !== undefined && object.validator_address !== null) { + message.validatorAddress = object.validator_address; + } + if (object.amount !== undefined && object.amount !== null) { + message.amount = Coin.fromAmino(object.amount); + } + return message; }, toAmino(message: MsgDelegate): MsgDelegateAmino { const obj: any = {}; obj.delegator_address = message.delegatorAddress; obj.validator_address = message.validatorAddress; - obj.amount = message.amount ? Coin.toAmino(message.amount) : undefined; + obj.amount = message.amount ? Coin.toAmino(message.amount) : Coin.fromPartial({}); return obj; }, fromAminoMsg(object: MsgDelegateAminoMsg): MsgDelegate { @@ -706,11 +1001,23 @@ export const MsgDelegate = { }; } }; +GlobalDecoderRegistry.register(MsgDelegate.typeUrl, MsgDelegate); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgDelegate.aminoType, MsgDelegate.typeUrl); function createBaseMsgDelegateResponse(): MsgDelegateResponse { return {}; } export const MsgDelegateResponse = { typeUrl: "/cosmos.staking.v1beta1.MsgDelegateResponse", + aminoType: "cosmos-sdk/MsgDelegateResponse", + is(o: any): o is MsgDelegateResponse { + return o && o.$typeUrl === MsgDelegateResponse.typeUrl; + }, + isSDK(o: any): o is MsgDelegateResponseSDKType { + return o && o.$typeUrl === MsgDelegateResponse.typeUrl; + }, + isAmino(o: any): o is MsgDelegateResponseAmino { + return o && o.$typeUrl === MsgDelegateResponse.typeUrl; + }, encode(_: MsgDelegateResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, @@ -728,12 +1035,20 @@ export const MsgDelegateResponse = { } return message; }, + fromJSON(_: any): MsgDelegateResponse { + return {}; + }, + toJSON(_: MsgDelegateResponse): unknown { + const obj: any = {}; + return obj; + }, fromPartial(_: Partial): MsgDelegateResponse { const message = createBaseMsgDelegateResponse(); return message; }, fromAmino(_: MsgDelegateResponseAmino): MsgDelegateResponse { - return {}; + const message = createBaseMsgDelegateResponse(); + return message; }, toAmino(_: MsgDelegateResponse): MsgDelegateResponseAmino { const obj: any = {}; @@ -761,16 +1076,28 @@ export const MsgDelegateResponse = { }; } }; +GlobalDecoderRegistry.register(MsgDelegateResponse.typeUrl, MsgDelegateResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgDelegateResponse.aminoType, MsgDelegateResponse.typeUrl); function createBaseMsgBeginRedelegate(): MsgBeginRedelegate { return { delegatorAddress: "", validatorSrcAddress: "", validatorDstAddress: "", - amount: undefined + amount: Coin.fromPartial({}) }; } export const MsgBeginRedelegate = { typeUrl: "/cosmos.staking.v1beta1.MsgBeginRedelegate", + aminoType: "cosmos-sdk/MsgBeginRedelegate", + is(o: any): o is MsgBeginRedelegate { + return o && (o.$typeUrl === MsgBeginRedelegate.typeUrl || typeof o.delegatorAddress === "string" && typeof o.validatorSrcAddress === "string" && typeof o.validatorDstAddress === "string" && Coin.is(o.amount)); + }, + isSDK(o: any): o is MsgBeginRedelegateSDKType { + return o && (o.$typeUrl === MsgBeginRedelegate.typeUrl || typeof o.delegator_address === "string" && typeof o.validator_src_address === "string" && typeof o.validator_dst_address === "string" && Coin.isSDK(o.amount)); + }, + isAmino(o: any): o is MsgBeginRedelegateAmino { + return o && (o.$typeUrl === MsgBeginRedelegate.typeUrl || typeof o.delegator_address === "string" && typeof o.validator_src_address === "string" && typeof o.validator_dst_address === "string" && Coin.isAmino(o.amount)); + }, encode(message: MsgBeginRedelegate, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.delegatorAddress !== "") { writer.uint32(10).string(message.delegatorAddress); @@ -812,6 +1139,22 @@ export const MsgBeginRedelegate = { } 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) : "", + 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(object: Partial): MsgBeginRedelegate { const message = createBaseMsgBeginRedelegate(); message.delegatorAddress = object.delegatorAddress ?? ""; @@ -821,19 +1164,27 @@ export const MsgBeginRedelegate = { return message; }, fromAmino(object: MsgBeginRedelegateAmino): MsgBeginRedelegate { - return { - delegatorAddress: object.delegator_address, - validatorSrcAddress: object.validator_src_address, - validatorDstAddress: object.validator_dst_address, - amount: object?.amount ? Coin.fromAmino(object.amount) : undefined - }; + const message = createBaseMsgBeginRedelegate(); + if (object.delegator_address !== undefined && object.delegator_address !== null) { + message.delegatorAddress = object.delegator_address; + } + if (object.validator_src_address !== undefined && object.validator_src_address !== null) { + message.validatorSrcAddress = object.validator_src_address; + } + if (object.validator_dst_address !== undefined && object.validator_dst_address !== null) { + message.validatorDstAddress = object.validator_dst_address; + } + if (object.amount !== undefined && object.amount !== null) { + message.amount = Coin.fromAmino(object.amount); + } + return message; }, toAmino(message: MsgBeginRedelegate): MsgBeginRedelegateAmino { const obj: any = {}; obj.delegator_address = message.delegatorAddress; obj.validator_src_address = message.validatorSrcAddress; obj.validator_dst_address = message.validatorDstAddress; - obj.amount = message.amount ? Coin.toAmino(message.amount) : undefined; + obj.amount = message.amount ? Coin.toAmino(message.amount) : Coin.fromPartial({}); return obj; }, fromAminoMsg(object: MsgBeginRedelegateAminoMsg): MsgBeginRedelegate { @@ -858,13 +1209,25 @@ export const MsgBeginRedelegate = { }; } }; +GlobalDecoderRegistry.register(MsgBeginRedelegate.typeUrl, MsgBeginRedelegate); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgBeginRedelegate.aminoType, MsgBeginRedelegate.typeUrl); function createBaseMsgBeginRedelegateResponse(): MsgBeginRedelegateResponse { return { - completionTime: undefined + completionTime: new Date() }; } export const MsgBeginRedelegateResponse = { typeUrl: "/cosmos.staking.v1beta1.MsgBeginRedelegateResponse", + aminoType: "cosmos-sdk/MsgBeginRedelegateResponse", + is(o: any): o is MsgBeginRedelegateResponse { + return o && (o.$typeUrl === MsgBeginRedelegateResponse.typeUrl || Timestamp.is(o.completionTime)); + }, + isSDK(o: any): o is MsgBeginRedelegateResponseSDKType { + return o && (o.$typeUrl === MsgBeginRedelegateResponse.typeUrl || Timestamp.isSDK(o.completion_time)); + }, + isAmino(o: any): o is MsgBeginRedelegateResponseAmino { + return o && (o.$typeUrl === MsgBeginRedelegateResponse.typeUrl || Timestamp.isAmino(o.completion_time)); + }, encode(message: MsgBeginRedelegateResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.completionTime !== undefined) { Timestamp.encode(toTimestamp(message.completionTime), writer.uint32(10).fork()).ldelim(); @@ -888,19 +1251,31 @@ export const MsgBeginRedelegateResponse = { } return message; }, + fromJSON(object: any): MsgBeginRedelegateResponse { + return { + completionTime: isSet(object.completionTime) ? new Date(object.completionTime) : undefined + }; + }, + toJSON(message: MsgBeginRedelegateResponse): unknown { + const obj: any = {}; + message.completionTime !== undefined && (obj.completionTime = message.completionTime.toISOString()); + return obj; + }, fromPartial(object: Partial): MsgBeginRedelegateResponse { const message = createBaseMsgBeginRedelegateResponse(); message.completionTime = object.completionTime ?? undefined; return message; }, fromAmino(object: MsgBeginRedelegateResponseAmino): MsgBeginRedelegateResponse { - return { - completionTime: object.completion_time - }; + const message = createBaseMsgBeginRedelegateResponse(); + if (object.completion_time !== undefined && object.completion_time !== null) { + message.completionTime = fromTimestamp(Timestamp.fromAmino(object.completion_time)); + } + return message; }, toAmino(message: MsgBeginRedelegateResponse): MsgBeginRedelegateResponseAmino { const obj: any = {}; - obj.completion_time = message.completionTime; + obj.completion_time = message.completionTime ? Timestamp.toAmino(toTimestamp(message.completionTime)) : new Date(); return obj; }, fromAminoMsg(object: MsgBeginRedelegateResponseAminoMsg): MsgBeginRedelegateResponse { @@ -925,15 +1300,27 @@ export const MsgBeginRedelegateResponse = { }; } }; +GlobalDecoderRegistry.register(MsgBeginRedelegateResponse.typeUrl, MsgBeginRedelegateResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgBeginRedelegateResponse.aminoType, MsgBeginRedelegateResponse.typeUrl); function createBaseMsgUndelegate(): MsgUndelegate { return { delegatorAddress: "", validatorAddress: "", - amount: undefined + amount: Coin.fromPartial({}) }; } export const MsgUndelegate = { typeUrl: "/cosmos.staking.v1beta1.MsgUndelegate", + aminoType: "cosmos-sdk/MsgUndelegate", + is(o: any): o is MsgUndelegate { + return o && (o.$typeUrl === MsgUndelegate.typeUrl || typeof o.delegatorAddress === "string" && typeof o.validatorAddress === "string" && Coin.is(o.amount)); + }, + isSDK(o: any): o is MsgUndelegateSDKType { + return o && (o.$typeUrl === MsgUndelegate.typeUrl || typeof o.delegator_address === "string" && typeof o.validator_address === "string" && Coin.isSDK(o.amount)); + }, + isAmino(o: any): o is MsgUndelegateAmino { + return o && (o.$typeUrl === MsgUndelegate.typeUrl || typeof o.delegator_address === "string" && typeof o.validator_address === "string" && Coin.isAmino(o.amount)); + }, encode(message: MsgUndelegate, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.delegatorAddress !== "") { writer.uint32(10).string(message.delegatorAddress); @@ -969,6 +1356,20 @@ export const MsgUndelegate = { } return message; }, + fromJSON(object: any): MsgUndelegate { + return { + 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(object: Partial): MsgUndelegate { const message = createBaseMsgUndelegate(); message.delegatorAddress = object.delegatorAddress ?? ""; @@ -977,17 +1378,23 @@ export const MsgUndelegate = { return message; }, fromAmino(object: MsgUndelegateAmino): MsgUndelegate { - return { - delegatorAddress: object.delegator_address, - validatorAddress: object.validator_address, - amount: object?.amount ? Coin.fromAmino(object.amount) : undefined - }; + const message = createBaseMsgUndelegate(); + if (object.delegator_address !== undefined && object.delegator_address !== null) { + message.delegatorAddress = object.delegator_address; + } + if (object.validator_address !== undefined && object.validator_address !== null) { + message.validatorAddress = object.validator_address; + } + if (object.amount !== undefined && object.amount !== null) { + message.amount = Coin.fromAmino(object.amount); + } + return message; }, toAmino(message: MsgUndelegate): MsgUndelegateAmino { const obj: any = {}; obj.delegator_address = message.delegatorAddress; obj.validator_address = message.validatorAddress; - obj.amount = message.amount ? Coin.toAmino(message.amount) : undefined; + obj.amount = message.amount ? Coin.toAmino(message.amount) : Coin.fromPartial({}); return obj; }, fromAminoMsg(object: MsgUndelegateAminoMsg): MsgUndelegate { @@ -1012,13 +1419,25 @@ export const MsgUndelegate = { }; } }; +GlobalDecoderRegistry.register(MsgUndelegate.typeUrl, MsgUndelegate); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgUndelegate.aminoType, MsgUndelegate.typeUrl); function createBaseMsgUndelegateResponse(): MsgUndelegateResponse { return { - completionTime: undefined + completionTime: new Date() }; } export const MsgUndelegateResponse = { typeUrl: "/cosmos.staking.v1beta1.MsgUndelegateResponse", + aminoType: "cosmos-sdk/MsgUndelegateResponse", + is(o: any): o is MsgUndelegateResponse { + return o && (o.$typeUrl === MsgUndelegateResponse.typeUrl || Timestamp.is(o.completionTime)); + }, + isSDK(o: any): o is MsgUndelegateResponseSDKType { + return o && (o.$typeUrl === MsgUndelegateResponse.typeUrl || Timestamp.isSDK(o.completion_time)); + }, + isAmino(o: any): o is MsgUndelegateResponseAmino { + return o && (o.$typeUrl === MsgUndelegateResponse.typeUrl || Timestamp.isAmino(o.completion_time)); + }, encode(message: MsgUndelegateResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.completionTime !== undefined) { Timestamp.encode(toTimestamp(message.completionTime), writer.uint32(10).fork()).ldelim(); @@ -1042,19 +1461,31 @@ export const MsgUndelegateResponse = { } return message; }, + fromJSON(object: any): MsgUndelegateResponse { + return { + completionTime: isSet(object.completionTime) ? new Date(object.completionTime) : undefined + }; + }, + toJSON(message: MsgUndelegateResponse): unknown { + const obj: any = {}; + message.completionTime !== undefined && (obj.completionTime = message.completionTime.toISOString()); + return obj; + }, fromPartial(object: Partial): MsgUndelegateResponse { const message = createBaseMsgUndelegateResponse(); message.completionTime = object.completionTime ?? undefined; return message; }, fromAmino(object: MsgUndelegateResponseAmino): MsgUndelegateResponse { - return { - completionTime: object.completion_time - }; + const message = createBaseMsgUndelegateResponse(); + if (object.completion_time !== undefined && object.completion_time !== null) { + message.completionTime = fromTimestamp(Timestamp.fromAmino(object.completion_time)); + } + return message; }, toAmino(message: MsgUndelegateResponse): MsgUndelegateResponseAmino { const obj: any = {}; - obj.completion_time = message.completionTime; + obj.completion_time = message.completionTime ? Timestamp.toAmino(toTimestamp(message.completionTime)) : new Date(); return obj; }, fromAminoMsg(object: MsgUndelegateResponseAminoMsg): MsgUndelegateResponse { @@ -1079,23 +1510,393 @@ export const MsgUndelegateResponse = { }; } }; -export const Cosmos_cryptoPubKey_InterfaceDecoder = (input: BinaryReader | Uint8Array): Any => { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - const data = Any.decode(reader, reader.uint32()); - switch (data.typeUrl) { - default: - return data; +GlobalDecoderRegistry.register(MsgUndelegateResponse.typeUrl, MsgUndelegateResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgUndelegateResponse.aminoType, MsgUndelegateResponse.typeUrl); +function createBaseMsgCancelUnbondingDelegation(): MsgCancelUnbondingDelegation { + return { + delegatorAddress: "", + validatorAddress: "", + amount: Coin.fromPartial({}), + creationHeight: BigInt(0) + }; +} +export const MsgCancelUnbondingDelegation = { + typeUrl: "/cosmos.staking.v1beta1.MsgCancelUnbondingDelegation", + aminoType: "cosmos-sdk/MsgCancelUnbondingDelegation", + is(o: any): o is MsgCancelUnbondingDelegation { + return o && (o.$typeUrl === MsgCancelUnbondingDelegation.typeUrl || typeof o.delegatorAddress === "string" && typeof o.validatorAddress === "string" && Coin.is(o.amount) && typeof o.creationHeight === "bigint"); + }, + isSDK(o: any): o is MsgCancelUnbondingDelegationSDKType { + return o && (o.$typeUrl === MsgCancelUnbondingDelegation.typeUrl || typeof o.delegator_address === "string" && typeof o.validator_address === "string" && Coin.isSDK(o.amount) && typeof o.creation_height === "bigint"); + }, + isAmino(o: any): o is MsgCancelUnbondingDelegationAmino { + return o && (o.$typeUrl === MsgCancelUnbondingDelegation.typeUrl || typeof o.delegator_address === "string" && typeof o.validator_address === "string" && Coin.isAmino(o.amount) && typeof o.creation_height === "bigint"); + }, + encode(message: MsgCancelUnbondingDelegation, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.delegatorAddress !== "") { + writer.uint32(10).string(message.delegatorAddress); + } + if (message.validatorAddress !== "") { + writer.uint32(18).string(message.validatorAddress); + } + if (message.amount !== undefined) { + Coin.encode(message.amount, writer.uint32(26).fork()).ldelim(); + } + if (message.creationHeight !== BigInt(0)) { + writer.uint32(32).int64(message.creationHeight); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgCancelUnbondingDelegation { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgCancelUnbondingDelegation(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.delegatorAddress = reader.string(); + break; + case 2: + message.validatorAddress = reader.string(); + break; + case 3: + message.amount = Coin.decode(reader, reader.uint32()); + break; + case 4: + message.creationHeight = reader.int64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): MsgCancelUnbondingDelegation { + return { + delegatorAddress: isSet(object.delegatorAddress) ? String(object.delegatorAddress) : "", + validatorAddress: isSet(object.validatorAddress) ? String(object.validatorAddress) : "", + amount: isSet(object.amount) ? Coin.fromJSON(object.amount) : undefined, + creationHeight: isSet(object.creationHeight) ? BigInt(object.creationHeight.toString()) : BigInt(0) + }; + }, + toJSON(message: MsgCancelUnbondingDelegation): 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); + message.creationHeight !== undefined && (obj.creationHeight = (message.creationHeight || BigInt(0)).toString()); + return obj; + }, + fromPartial(object: Partial): MsgCancelUnbondingDelegation { + const message = createBaseMsgCancelUnbondingDelegation(); + message.delegatorAddress = object.delegatorAddress ?? ""; + message.validatorAddress = object.validatorAddress ?? ""; + message.amount = object.amount !== undefined && object.amount !== null ? Coin.fromPartial(object.amount) : undefined; + message.creationHeight = object.creationHeight !== undefined && object.creationHeight !== null ? BigInt(object.creationHeight.toString()) : BigInt(0); + return message; + }, + fromAmino(object: MsgCancelUnbondingDelegationAmino): MsgCancelUnbondingDelegation { + const message = createBaseMsgCancelUnbondingDelegation(); + if (object.delegator_address !== undefined && object.delegator_address !== null) { + message.delegatorAddress = object.delegator_address; + } + if (object.validator_address !== undefined && object.validator_address !== null) { + message.validatorAddress = object.validator_address; + } + if (object.amount !== undefined && object.amount !== null) { + message.amount = Coin.fromAmino(object.amount); + } + if (object.creation_height !== undefined && object.creation_height !== null) { + message.creationHeight = BigInt(object.creation_height); + } + return message; + }, + toAmino(message: MsgCancelUnbondingDelegation): MsgCancelUnbondingDelegationAmino { + const obj: any = {}; + obj.delegator_address = message.delegatorAddress; + obj.validator_address = message.validatorAddress; + obj.amount = message.amount ? Coin.toAmino(message.amount) : Coin.fromPartial({}); + obj.creation_height = message.creationHeight ? message.creationHeight.toString() : undefined; + return obj; + }, + fromAminoMsg(object: MsgCancelUnbondingDelegationAminoMsg): MsgCancelUnbondingDelegation { + return MsgCancelUnbondingDelegation.fromAmino(object.value); + }, + toAminoMsg(message: MsgCancelUnbondingDelegation): MsgCancelUnbondingDelegationAminoMsg { + return { + type: "cosmos-sdk/MsgCancelUnbondingDelegation", + value: MsgCancelUnbondingDelegation.toAmino(message) + }; + }, + fromProtoMsg(message: MsgCancelUnbondingDelegationProtoMsg): MsgCancelUnbondingDelegation { + return MsgCancelUnbondingDelegation.decode(message.value); + }, + toProto(message: MsgCancelUnbondingDelegation): Uint8Array { + return MsgCancelUnbondingDelegation.encode(message).finish(); + }, + toProtoMsg(message: MsgCancelUnbondingDelegation): MsgCancelUnbondingDelegationProtoMsg { + return { + typeUrl: "/cosmos.staking.v1beta1.MsgCancelUnbondingDelegation", + value: MsgCancelUnbondingDelegation.encode(message).finish() + }; } }; -export const Cosmos_cryptoPubKey_FromAmino = (content: AnyAmino) => { - return encodeBech32Pubkey({ - type: "tendermint/PubKeySecp256k1", - value: toBase64(content.value) - }, "cosmos"); +GlobalDecoderRegistry.register(MsgCancelUnbondingDelegation.typeUrl, MsgCancelUnbondingDelegation); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgCancelUnbondingDelegation.aminoType, MsgCancelUnbondingDelegation.typeUrl); +function createBaseMsgCancelUnbondingDelegationResponse(): MsgCancelUnbondingDelegationResponse { + return {}; +} +export const MsgCancelUnbondingDelegationResponse = { + typeUrl: "/cosmos.staking.v1beta1.MsgCancelUnbondingDelegationResponse", + aminoType: "cosmos-sdk/MsgCancelUnbondingDelegationResponse", + is(o: any): o is MsgCancelUnbondingDelegationResponse { + return o && o.$typeUrl === MsgCancelUnbondingDelegationResponse.typeUrl; + }, + isSDK(o: any): o is MsgCancelUnbondingDelegationResponseSDKType { + return o && o.$typeUrl === MsgCancelUnbondingDelegationResponse.typeUrl; + }, + isAmino(o: any): o is MsgCancelUnbondingDelegationResponseAmino { + return o && o.$typeUrl === MsgCancelUnbondingDelegationResponse.typeUrl; + }, + encode(_: MsgCancelUnbondingDelegationResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgCancelUnbondingDelegationResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgCancelUnbondingDelegationResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(_: any): MsgCancelUnbondingDelegationResponse { + return {}; + }, + toJSON(_: MsgCancelUnbondingDelegationResponse): unknown { + const obj: any = {}; + return obj; + }, + fromPartial(_: Partial): MsgCancelUnbondingDelegationResponse { + const message = createBaseMsgCancelUnbondingDelegationResponse(); + return message; + }, + fromAmino(_: MsgCancelUnbondingDelegationResponseAmino): MsgCancelUnbondingDelegationResponse { + const message = createBaseMsgCancelUnbondingDelegationResponse(); + return message; + }, + toAmino(_: MsgCancelUnbondingDelegationResponse): MsgCancelUnbondingDelegationResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgCancelUnbondingDelegationResponseAminoMsg): MsgCancelUnbondingDelegationResponse { + return MsgCancelUnbondingDelegationResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgCancelUnbondingDelegationResponse): MsgCancelUnbondingDelegationResponseAminoMsg { + return { + type: "cosmos-sdk/MsgCancelUnbondingDelegationResponse", + value: MsgCancelUnbondingDelegationResponse.toAmino(message) + }; + }, + fromProtoMsg(message: MsgCancelUnbondingDelegationResponseProtoMsg): MsgCancelUnbondingDelegationResponse { + return MsgCancelUnbondingDelegationResponse.decode(message.value); + }, + toProto(message: MsgCancelUnbondingDelegationResponse): Uint8Array { + return MsgCancelUnbondingDelegationResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgCancelUnbondingDelegationResponse): MsgCancelUnbondingDelegationResponseProtoMsg { + return { + typeUrl: "/cosmos.staking.v1beta1.MsgCancelUnbondingDelegationResponse", + value: MsgCancelUnbondingDelegationResponse.encode(message).finish() + }; + } }; -export const Cosmos_cryptoPubKey_ToAmino = (content: Any) => { +GlobalDecoderRegistry.register(MsgCancelUnbondingDelegationResponse.typeUrl, MsgCancelUnbondingDelegationResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgCancelUnbondingDelegationResponse.aminoType, MsgCancelUnbondingDelegationResponse.typeUrl); +function createBaseMsgUpdateParams(): MsgUpdateParams { return { - typeUrl: "/cosmos.crypto.secp256k1.PubKey", - value: fromBase64(decodeBech32Pubkey(content).value) + authority: "", + params: Params.fromPartial({}) }; -}; \ No newline at end of file +} +export const MsgUpdateParams = { + typeUrl: "/cosmos.staking.v1beta1.MsgUpdateParams", + aminoType: "cosmos-sdk/x/staking/MsgUpdateParams", + is(o: any): o is MsgUpdateParams { + return o && (o.$typeUrl === MsgUpdateParams.typeUrl || typeof o.authority === "string" && Params.is(o.params)); + }, + isSDK(o: any): o is MsgUpdateParamsSDKType { + return o && (o.$typeUrl === MsgUpdateParams.typeUrl || typeof o.authority === "string" && Params.isSDK(o.params)); + }, + isAmino(o: any): o is MsgUpdateParamsAmino { + return o && (o.$typeUrl === MsgUpdateParams.typeUrl || typeof o.authority === "string" && Params.isAmino(o.params)); + }, + encode(message: MsgUpdateParams, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.authority !== "") { + writer.uint32(10).string(message.authority); + } + if (message.params !== undefined) { + Params.encode(message.params, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgUpdateParams { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUpdateParams(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.authority = reader.string(); + break; + case 2: + message.params = Params.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): MsgUpdateParams { + return { + authority: isSet(object.authority) ? String(object.authority) : "", + params: isSet(object.params) ? Params.fromJSON(object.params) : undefined + }; + }, + toJSON(message: MsgUpdateParams): unknown { + const obj: any = {}; + message.authority !== undefined && (obj.authority = message.authority); + message.params !== undefined && (obj.params = message.params ? Params.toJSON(message.params) : undefined); + return obj; + }, + fromPartial(object: Partial): MsgUpdateParams { + const message = createBaseMsgUpdateParams(); + message.authority = object.authority ?? ""; + message.params = object.params !== undefined && object.params !== null ? Params.fromPartial(object.params) : undefined; + return message; + }, + fromAmino(object: MsgUpdateParamsAmino): MsgUpdateParams { + const message = createBaseMsgUpdateParams(); + if (object.authority !== undefined && object.authority !== null) { + message.authority = object.authority; + } + if (object.params !== undefined && object.params !== null) { + message.params = Params.fromAmino(object.params); + } + return message; + }, + toAmino(message: MsgUpdateParams): MsgUpdateParamsAmino { + const obj: any = {}; + obj.authority = message.authority; + obj.params = message.params ? Params.toAmino(message.params) : Params.fromPartial({}); + return obj; + }, + fromAminoMsg(object: MsgUpdateParamsAminoMsg): MsgUpdateParams { + return MsgUpdateParams.fromAmino(object.value); + }, + toAminoMsg(message: MsgUpdateParams): MsgUpdateParamsAminoMsg { + return { + type: "cosmos-sdk/x/staking/MsgUpdateParams", + value: MsgUpdateParams.toAmino(message) + }; + }, + fromProtoMsg(message: MsgUpdateParamsProtoMsg): MsgUpdateParams { + return MsgUpdateParams.decode(message.value); + }, + toProto(message: MsgUpdateParams): Uint8Array { + return MsgUpdateParams.encode(message).finish(); + }, + toProtoMsg(message: MsgUpdateParams): MsgUpdateParamsProtoMsg { + return { + typeUrl: "/cosmos.staking.v1beta1.MsgUpdateParams", + value: MsgUpdateParams.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgUpdateParams.typeUrl, MsgUpdateParams); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgUpdateParams.aminoType, MsgUpdateParams.typeUrl); +function createBaseMsgUpdateParamsResponse(): MsgUpdateParamsResponse { + return {}; +} +export const MsgUpdateParamsResponse = { + typeUrl: "/cosmos.staking.v1beta1.MsgUpdateParamsResponse", + aminoType: "cosmos-sdk/MsgUpdateParamsResponse", + is(o: any): o is MsgUpdateParamsResponse { + return o && o.$typeUrl === MsgUpdateParamsResponse.typeUrl; + }, + isSDK(o: any): o is MsgUpdateParamsResponseSDKType { + return o && o.$typeUrl === MsgUpdateParamsResponse.typeUrl; + }, + isAmino(o: any): o is MsgUpdateParamsResponseAmino { + return o && o.$typeUrl === MsgUpdateParamsResponse.typeUrl; + }, + encode(_: MsgUpdateParamsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgUpdateParamsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUpdateParamsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(_: any): MsgUpdateParamsResponse { + return {}; + }, + toJSON(_: MsgUpdateParamsResponse): unknown { + const obj: any = {}; + return obj; + }, + fromPartial(_: Partial): MsgUpdateParamsResponse { + const message = createBaseMsgUpdateParamsResponse(); + return message; + }, + fromAmino(_: MsgUpdateParamsResponseAmino): MsgUpdateParamsResponse { + const message = createBaseMsgUpdateParamsResponse(); + return message; + }, + toAmino(_: MsgUpdateParamsResponse): MsgUpdateParamsResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgUpdateParamsResponseAminoMsg): MsgUpdateParamsResponse { + return MsgUpdateParamsResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgUpdateParamsResponse): MsgUpdateParamsResponseAminoMsg { + return { + type: "cosmos-sdk/MsgUpdateParamsResponse", + value: MsgUpdateParamsResponse.toAmino(message) + }; + }, + fromProtoMsg(message: MsgUpdateParamsResponseProtoMsg): MsgUpdateParamsResponse { + return MsgUpdateParamsResponse.decode(message.value); + }, + toProto(message: MsgUpdateParamsResponse): Uint8Array { + return MsgUpdateParamsResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgUpdateParamsResponse): MsgUpdateParamsResponseProtoMsg { + return { + typeUrl: "/cosmos.staking.v1beta1.MsgUpdateParamsResponse", + value: MsgUpdateParamsResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgUpdateParamsResponse.typeUrl, MsgUpdateParamsResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgUpdateParamsResponse.aminoType, MsgUpdateParamsResponse.typeUrl); \ No newline at end of file diff --git a/packages/osmojs/src/codegen/cosmos/tx/config/v1/config.ts b/packages/osmojs/src/codegen/cosmos/tx/config/v1/config.ts new file mode 100644 index 000000000..6fbd59bc9 --- /dev/null +++ b/packages/osmojs/src/codegen/cosmos/tx/config/v1/config.ts @@ -0,0 +1,147 @@ +import { BinaryReader, BinaryWriter } from "../../../../binary"; +import { isSet } from "../../../../helpers"; +import { GlobalDecoderRegistry } from "../../../../registry"; +/** Config is the config object of the x/auth/tx package. */ +export interface Config { + /** + * skip_ante_handler defines whether the ante handler registration should be skipped in case an app wants to override + * this functionality. + */ + skipAnteHandler: boolean; + /** + * skip_post_handler defines whether the post handler registration should be skipped in case an app wants to override + * this functionality. + */ + skipPostHandler: boolean; +} +export interface ConfigProtoMsg { + typeUrl: "/cosmos.tx.config.v1.Config"; + value: Uint8Array; +} +/** Config is the config object of the x/auth/tx package. */ +export interface ConfigAmino { + /** + * skip_ante_handler defines whether the ante handler registration should be skipped in case an app wants to override + * this functionality. + */ + skip_ante_handler?: boolean; + /** + * skip_post_handler defines whether the post handler registration should be skipped in case an app wants to override + * this functionality. + */ + skip_post_handler?: boolean; +} +export interface ConfigAminoMsg { + type: "cosmos-sdk/Config"; + value: ConfigAmino; +} +/** Config is the config object of the x/auth/tx package. */ +export interface ConfigSDKType { + skip_ante_handler: boolean; + skip_post_handler: boolean; +} +function createBaseConfig(): Config { + return { + skipAnteHandler: false, + skipPostHandler: false + }; +} +export const Config = { + typeUrl: "/cosmos.tx.config.v1.Config", + aminoType: "cosmos-sdk/Config", + is(o: any): o is Config { + return o && (o.$typeUrl === Config.typeUrl || typeof o.skipAnteHandler === "boolean" && typeof o.skipPostHandler === "boolean"); + }, + isSDK(o: any): o is ConfigSDKType { + return o && (o.$typeUrl === Config.typeUrl || typeof o.skip_ante_handler === "boolean" && typeof o.skip_post_handler === "boolean"); + }, + isAmino(o: any): o is ConfigAmino { + return o && (o.$typeUrl === Config.typeUrl || typeof o.skip_ante_handler === "boolean" && typeof o.skip_post_handler === "boolean"); + }, + encode(message: Config, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.skipAnteHandler === true) { + writer.uint32(8).bool(message.skipAnteHandler); + } + if (message.skipPostHandler === true) { + writer.uint32(16).bool(message.skipPostHandler); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): Config { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseConfig(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.skipAnteHandler = reader.bool(); + break; + case 2: + message.skipPostHandler = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): Config { + return { + skipAnteHandler: isSet(object.skipAnteHandler) ? Boolean(object.skipAnteHandler) : false, + skipPostHandler: isSet(object.skipPostHandler) ? Boolean(object.skipPostHandler) : false + }; + }, + toJSON(message: Config): unknown { + const obj: any = {}; + message.skipAnteHandler !== undefined && (obj.skipAnteHandler = message.skipAnteHandler); + message.skipPostHandler !== undefined && (obj.skipPostHandler = message.skipPostHandler); + return obj; + }, + fromPartial(object: Partial): Config { + const message = createBaseConfig(); + message.skipAnteHandler = object.skipAnteHandler ?? false; + message.skipPostHandler = object.skipPostHandler ?? false; + return message; + }, + fromAmino(object: ConfigAmino): Config { + const message = createBaseConfig(); + if (object.skip_ante_handler !== undefined && object.skip_ante_handler !== null) { + message.skipAnteHandler = object.skip_ante_handler; + } + if (object.skip_post_handler !== undefined && object.skip_post_handler !== null) { + message.skipPostHandler = object.skip_post_handler; + } + return message; + }, + toAmino(message: Config): ConfigAmino { + const obj: any = {}; + obj.skip_ante_handler = message.skipAnteHandler; + obj.skip_post_handler = message.skipPostHandler; + return obj; + }, + fromAminoMsg(object: ConfigAminoMsg): Config { + return Config.fromAmino(object.value); + }, + toAminoMsg(message: Config): ConfigAminoMsg { + return { + type: "cosmos-sdk/Config", + value: Config.toAmino(message) + }; + }, + fromProtoMsg(message: ConfigProtoMsg): Config { + return Config.decode(message.value); + }, + toProto(message: Config): Uint8Array { + return Config.encode(message).finish(); + }, + toProtoMsg(message: Config): ConfigProtoMsg { + return { + typeUrl: "/cosmos.tx.config.v1.Config", + value: Config.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(Config.typeUrl, Config); +GlobalDecoderRegistry.registerAminoProtoMapping(Config.aminoType, Config.typeUrl); \ No newline at end of file diff --git a/packages/osmojs/src/codegen/cosmos/tx/signing/v1beta1/signing.ts b/packages/osmojs/src/codegen/cosmos/tx/signing/v1beta1/signing.ts index 18f6e2d55..1d9d83e76 100644 --- a/packages/osmojs/src/codegen/cosmos/tx/signing/v1beta1/signing.ts +++ b/packages/osmojs/src/codegen/cosmos/tx/signing/v1beta1/signing.ts @@ -1,28 +1,47 @@ import { CompactBitArray, CompactBitArrayAmino, CompactBitArraySDKType } from "../../../crypto/multisig/v1beta1/multisig"; import { Any, AnyAmino, AnySDKType } from "../../../../google/protobuf/any"; import { BinaryReader, BinaryWriter } from "../../../../binary"; -import { isSet } from "../../../../helpers"; -/** SignMode represents a signing mode with its own security guarantees. */ +import { GlobalDecoderRegistry } from "../../../../registry"; +import { isSet, bytesFromBase64, base64FromBytes } from "../../../../helpers"; +/** + * SignMode represents a signing mode with its own security guarantees. + * + * This enum should be considered a registry of all known sign modes + * in the Cosmos ecosystem. Apps are not expected to support all known + * sign modes. Apps that would like to support custom sign modes are + * encouraged to open a small PR against this file to add a new case + * to this SignMode enum describing their sign mode so that different + * apps have a consistent version of this enum. + */ export enum SignMode { /** * SIGN_MODE_UNSPECIFIED - SIGN_MODE_UNSPECIFIED specifies an unknown signing mode and will be - * rejected + * rejected. */ SIGN_MODE_UNSPECIFIED = 0, /** * SIGN_MODE_DIRECT - SIGN_MODE_DIRECT specifies a signing mode which uses SignDoc and is - * verified with raw bytes from Tx + * verified with raw bytes from Tx. */ SIGN_MODE_DIRECT = 1, /** * SIGN_MODE_TEXTUAL - SIGN_MODE_TEXTUAL is a future signing mode that will verify some * human-readable textual representation on top of the binary representation - * from SIGN_MODE_DIRECT + * from SIGN_MODE_DIRECT. It is currently not supported. */ SIGN_MODE_TEXTUAL = 2, + /** + * SIGN_MODE_DIRECT_AUX - SIGN_MODE_DIRECT_AUX specifies a signing mode which uses + * SignDocDirectAux. As opposed to SIGN_MODE_DIRECT, this sign mode does not + * require signers signing over other signers' `signer_info`. It also allows + * for adding Tips in transactions. + * + * Since: cosmos-sdk 0.46 + */ + SIGN_MODE_DIRECT_AUX = 3, /** * SIGN_MODE_LEGACY_AMINO_JSON - SIGN_MODE_LEGACY_AMINO_JSON is a backwards compatibility mode which uses - * Amino JSON and will be removed in the future + * Amino JSON and will be removed in the future. */ SIGN_MODE_LEGACY_AMINO_JSON = 127, /** @@ -53,6 +72,9 @@ export function signModeFromJSON(object: any): SignMode { case 2: case "SIGN_MODE_TEXTUAL": return SignMode.SIGN_MODE_TEXTUAL; + case 3: + case "SIGN_MODE_DIRECT_AUX": + return SignMode.SIGN_MODE_DIRECT_AUX; case 127: case "SIGN_MODE_LEGACY_AMINO_JSON": return SignMode.SIGN_MODE_LEGACY_AMINO_JSON; @@ -73,6 +95,8 @@ export function signModeToJSON(object: SignMode): string { return "SIGN_MODE_DIRECT"; case SignMode.SIGN_MODE_TEXTUAL: return "SIGN_MODE_TEXTUAL"; + case SignMode.SIGN_MODE_DIRECT_AUX: + return "SIGN_MODE_DIRECT_AUX"; case SignMode.SIGN_MODE_LEGACY_AMINO_JSON: return "SIGN_MODE_LEGACY_AMINO_JSON"; case SignMode.SIGN_MODE_EIP_191: @@ -94,7 +118,7 @@ export interface SignatureDescriptorsProtoMsg { /** SignatureDescriptors wraps multiple SignatureDescriptor's. */ export interface SignatureDescriptorsAmino { /** signatures are the signature descriptors */ - signatures: SignatureDescriptorAmino[]; + signatures?: SignatureDescriptorAmino[]; } export interface SignatureDescriptorsAminoMsg { type: "cosmos-sdk/SignatureDescriptors"; @@ -112,8 +136,8 @@ export interface SignatureDescriptorsSDKType { */ 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 @@ -140,7 +164,7 @@ export interface SignatureDescriptorAmino { * number of committed transactions signed by a given address. It is used to prevent * replay attacks. */ - sequence: string; + sequence?: string; } export interface SignatureDescriptorAminoMsg { type: "cosmos-sdk/SignatureDescriptor"; @@ -153,8 +177,8 @@ export interface SignatureDescriptorAminoMsg { * clients. */ export interface SignatureDescriptorSDKType { - public_key: AnySDKType; - data: SignatureDescriptor_DataSDKType; + public_key?: AnySDKType; + data?: SignatureDescriptor_DataSDKType; sequence: bigint; } /** Data represents signature data */ @@ -198,9 +222,9 @@ export interface SignatureDescriptor_Data_SingleProtoMsg { /** Single is the signature data for a single signer */ export interface SignatureDescriptor_Data_SingleAmino { /** mode is the signing mode of the single signer */ - mode: SignMode; + mode?: SignMode; /** signature is the raw signature bytes */ - signature: Uint8Array; + signature?: string; } export interface SignatureDescriptor_Data_SingleAminoMsg { type: "cosmos-sdk/Single"; @@ -214,7 +238,7 @@ export interface SignatureDescriptor_Data_SingleSDKType { /** 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[]; } @@ -227,7 +251,7 @@ export interface SignatureDescriptor_Data_MultiAmino { /** bitarray specifies which keys within the multisig are signing */ bitarray?: CompactBitArrayAmino; /** signatures is the signatures of the multi-signature */ - signatures: SignatureDescriptor_DataAmino[]; + signatures?: SignatureDescriptor_DataAmino[]; } export interface SignatureDescriptor_Data_MultiAminoMsg { type: "cosmos-sdk/Multi"; @@ -235,7 +259,7 @@ export interface SignatureDescriptor_Data_MultiAminoMsg { } /** Multi is the signature data for a multisig public key */ export interface SignatureDescriptor_Data_MultiSDKType { - bitarray: CompactBitArraySDKType; + bitarray?: CompactBitArraySDKType; signatures: SignatureDescriptor_DataSDKType[]; } function createBaseSignatureDescriptors(): SignatureDescriptors { @@ -245,6 +269,16 @@ function createBaseSignatureDescriptors(): SignatureDescriptors { } export const SignatureDescriptors = { typeUrl: "/cosmos.tx.signing.v1beta1.SignatureDescriptors", + aminoType: "cosmos-sdk/SignatureDescriptors", + is(o: any): o is SignatureDescriptors { + return o && (o.$typeUrl === SignatureDescriptors.typeUrl || Array.isArray(o.signatures) && (!o.signatures.length || SignatureDescriptor.is(o.signatures[0]))); + }, + isSDK(o: any): o is SignatureDescriptorsSDKType { + return o && (o.$typeUrl === SignatureDescriptors.typeUrl || Array.isArray(o.signatures) && (!o.signatures.length || SignatureDescriptor.isSDK(o.signatures[0]))); + }, + isAmino(o: any): o is SignatureDescriptorsAmino { + return o && (o.$typeUrl === SignatureDescriptors.typeUrl || Array.isArray(o.signatures) && (!o.signatures.length || SignatureDescriptor.isAmino(o.signatures[0]))); + }, encode(message: SignatureDescriptors, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.signatures) { SignatureDescriptor.encode(v!, writer.uint32(10).fork()).ldelim(); @@ -268,15 +302,29 @@ export const SignatureDescriptors = { } return message; }, + fromJSON(object: any): SignatureDescriptors { + return { + signatures: Array.isArray(object?.signatures) ? object.signatures.map((e: any) => SignatureDescriptor.fromJSON(e)) : [] + }; + }, + toJSON(message: SignatureDescriptors): unknown { + const obj: any = {}; + if (message.signatures) { + obj.signatures = message.signatures.map(e => e ? SignatureDescriptor.toJSON(e) : undefined); + } else { + obj.signatures = []; + } + return obj; + }, fromPartial(object: Partial): SignatureDescriptors { const message = createBaseSignatureDescriptors(); message.signatures = object.signatures?.map(e => SignatureDescriptor.fromPartial(e)) || []; return message; }, fromAmino(object: SignatureDescriptorsAmino): SignatureDescriptors { - return { - signatures: Array.isArray(object?.signatures) ? object.signatures.map((e: any) => SignatureDescriptor.fromAmino(e)) : [] - }; + const message = createBaseSignatureDescriptors(); + message.signatures = object.signatures?.map(e => SignatureDescriptor.fromAmino(e)) || []; + return message; }, toAmino(message: SignatureDescriptors): SignatureDescriptorsAmino { const obj: any = {}; @@ -309,15 +357,27 @@ export const SignatureDescriptors = { }; } }; +GlobalDecoderRegistry.register(SignatureDescriptors.typeUrl, SignatureDescriptors); +GlobalDecoderRegistry.registerAminoProtoMapping(SignatureDescriptors.aminoType, SignatureDescriptors.typeUrl); function createBaseSignatureDescriptor(): SignatureDescriptor { return { publicKey: undefined, - data: Data.fromPartial({}), + data: undefined, sequence: BigInt(0) }; } export const SignatureDescriptor = { typeUrl: "/cosmos.tx.signing.v1beta1.SignatureDescriptor", + aminoType: "cosmos-sdk/SignatureDescriptor", + is(o: any): o is SignatureDescriptor { + return o && (o.$typeUrl === SignatureDescriptor.typeUrl || typeof o.sequence === "bigint"); + }, + isSDK(o: any): o is SignatureDescriptorSDKType { + return o && (o.$typeUrl === SignatureDescriptor.typeUrl || typeof o.sequence === "bigint"); + }, + isAmino(o: any): o is SignatureDescriptorAmino { + return o && (o.$typeUrl === SignatureDescriptor.typeUrl || typeof o.sequence === "bigint"); + }, encode(message: SignatureDescriptor, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.publicKey !== undefined) { Any.encode(message.publicKey, writer.uint32(10).fork()).ldelim(); @@ -353,6 +413,20 @@ export const SignatureDescriptor = { } 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, + sequence: isSet(object.sequence) ? BigInt(object.sequence.toString()) : BigInt(0) + }; + }, + 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 || BigInt(0)).toString()); + return obj; + }, fromPartial(object: Partial): SignatureDescriptor { const message = createBaseSignatureDescriptor(); message.publicKey = object.publicKey !== undefined && object.publicKey !== null ? Any.fromPartial(object.publicKey) : undefined; @@ -361,11 +435,17 @@ export const SignatureDescriptor = { return message; }, fromAmino(object: SignatureDescriptorAmino): SignatureDescriptor { - return { - publicKey: object?.public_key ? Any.fromAmino(object.public_key) : undefined, - data: object?.data ? SignatureDescriptor_Data.fromAmino(object.data) : undefined, - sequence: BigInt(object.sequence) - }; + const message = createBaseSignatureDescriptor(); + if (object.public_key !== undefined && object.public_key !== null) { + message.publicKey = Any.fromAmino(object.public_key); + } + if (object.data !== undefined && object.data !== null) { + message.data = SignatureDescriptor_Data.fromAmino(object.data); + } + if (object.sequence !== undefined && object.sequence !== null) { + message.sequence = BigInt(object.sequence); + } + return message; }, toAmino(message: SignatureDescriptor): SignatureDescriptorAmino { const obj: any = {}; @@ -396,6 +476,8 @@ export const SignatureDescriptor = { }; } }; +GlobalDecoderRegistry.register(SignatureDescriptor.typeUrl, SignatureDescriptor); +GlobalDecoderRegistry.registerAminoProtoMapping(SignatureDescriptor.aminoType, SignatureDescriptor.typeUrl); function createBaseSignatureDescriptor_Data(): SignatureDescriptor_Data { return { single: undefined, @@ -404,6 +486,16 @@ function createBaseSignatureDescriptor_Data(): SignatureDescriptor_Data { } export const SignatureDescriptor_Data = { typeUrl: "/cosmos.tx.signing.v1beta1.Data", + aminoType: "cosmos-sdk/Data", + is(o: any): o is SignatureDescriptor_Data { + return o && o.$typeUrl === SignatureDescriptor_Data.typeUrl; + }, + isSDK(o: any): o is SignatureDescriptor_DataSDKType { + return o && o.$typeUrl === SignatureDescriptor_Data.typeUrl; + }, + isAmino(o: any): o is SignatureDescriptor_DataAmino { + return o && o.$typeUrl === SignatureDescriptor_Data.typeUrl; + }, encode(message: SignatureDescriptor_Data, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.single !== undefined) { SignatureDescriptor_Data_Single.encode(message.single, writer.uint32(10).fork()).ldelim(); @@ -433,6 +525,18 @@ export const SignatureDescriptor_Data = { } 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 + }; + }, + toJSON(message: SignatureDescriptor_Data): unknown { + const obj: any = {}; + message.single !== undefined && (obj.single = message.single ? SignatureDescriptor_Data_Single.toJSON(message.single) : undefined); + message.multi !== undefined && (obj.multi = message.multi ? SignatureDescriptor_Data_Multi.toJSON(message.multi) : undefined); + return obj; + }, fromPartial(object: Partial): SignatureDescriptor_Data { const message = createBaseSignatureDescriptor_Data(); message.single = object.single !== undefined && object.single !== null ? SignatureDescriptor_Data_Single.fromPartial(object.single) : undefined; @@ -440,10 +544,14 @@ export const SignatureDescriptor_Data = { return message; }, fromAmino(object: SignatureDescriptor_DataAmino): SignatureDescriptor_Data { - return { - single: object?.single ? SignatureDescriptor_Data_Single.fromAmino(object.single) : undefined, - multi: object?.multi ? SignatureDescriptor_Data_Multi.fromAmino(object.multi) : undefined - }; + const message = createBaseSignatureDescriptor_Data(); + if (object.single !== undefined && object.single !== null) { + message.single = SignatureDescriptor_Data_Single.fromAmino(object.single); + } + if (object.multi !== undefined && object.multi !== null) { + message.multi = SignatureDescriptor_Data_Multi.fromAmino(object.multi); + } + return message; }, toAmino(message: SignatureDescriptor_Data): SignatureDescriptor_DataAmino { const obj: any = {}; @@ -473,6 +581,8 @@ export const SignatureDescriptor_Data = { }; } }; +GlobalDecoderRegistry.register(SignatureDescriptor_Data.typeUrl, SignatureDescriptor_Data); +GlobalDecoderRegistry.registerAminoProtoMapping(SignatureDescriptor_Data.aminoType, SignatureDescriptor_Data.typeUrl); function createBaseSignatureDescriptor_Data_Single(): SignatureDescriptor_Data_Single { return { mode: 0, @@ -481,6 +591,16 @@ function createBaseSignatureDescriptor_Data_Single(): SignatureDescriptor_Data_S } export const SignatureDescriptor_Data_Single = { typeUrl: "/cosmos.tx.signing.v1beta1.Single", + aminoType: "cosmos-sdk/Single", + is(o: any): o is SignatureDescriptor_Data_Single { + return o && (o.$typeUrl === SignatureDescriptor_Data_Single.typeUrl || isSet(o.mode) && (o.signature instanceof Uint8Array || typeof o.signature === "string")); + }, + isSDK(o: any): o is SignatureDescriptor_Data_SingleSDKType { + return o && (o.$typeUrl === SignatureDescriptor_Data_Single.typeUrl || isSet(o.mode) && (o.signature instanceof Uint8Array || typeof o.signature === "string")); + }, + isAmino(o: any): o is SignatureDescriptor_Data_SingleAmino { + return o && (o.$typeUrl === SignatureDescriptor_Data_Single.typeUrl || isSet(o.mode) && (o.signature instanceof Uint8Array || typeof o.signature === "string")); + }, encode(message: SignatureDescriptor_Data_Single, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.mode !== 0) { writer.uint32(8).int32(message.mode); @@ -510,6 +630,18 @@ export const SignatureDescriptor_Data_Single = { } return message; }, + fromJSON(object: any): SignatureDescriptor_Data_Single { + return { + mode: isSet(object.mode) ? signModeFromJSON(object.mode) : -1, + 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)); + message.signature !== undefined && (obj.signature = base64FromBytes(message.signature !== undefined ? message.signature : new Uint8Array())); + return obj; + }, fromPartial(object: Partial): SignatureDescriptor_Data_Single { const message = createBaseSignatureDescriptor_Data_Single(); message.mode = object.mode ?? 0; @@ -517,15 +649,19 @@ export const SignatureDescriptor_Data_Single = { return message; }, fromAmino(object: SignatureDescriptor_Data_SingleAmino): SignatureDescriptor_Data_Single { - return { - mode: isSet(object.mode) ? signModeFromJSON(object.mode) : -1, - signature: object.signature - }; + const message = createBaseSignatureDescriptor_Data_Single(); + if (object.mode !== undefined && object.mode !== null) { + message.mode = signModeFromJSON(object.mode); + } + if (object.signature !== undefined && object.signature !== null) { + message.signature = bytesFromBase64(object.signature); + } + return message; }, toAmino(message: SignatureDescriptor_Data_Single): SignatureDescriptor_Data_SingleAmino { const obj: any = {}; - obj.mode = message.mode; - obj.signature = message.signature; + obj.mode = signModeToJSON(message.mode); + obj.signature = message.signature ? base64FromBytes(message.signature) : undefined; return obj; }, fromAminoMsg(object: SignatureDescriptor_Data_SingleAminoMsg): SignatureDescriptor_Data_Single { @@ -550,14 +686,26 @@ export const SignatureDescriptor_Data_Single = { }; } }; +GlobalDecoderRegistry.register(SignatureDescriptor_Data_Single.typeUrl, SignatureDescriptor_Data_Single); +GlobalDecoderRegistry.registerAminoProtoMapping(SignatureDescriptor_Data_Single.aminoType, SignatureDescriptor_Data_Single.typeUrl); function createBaseSignatureDescriptor_Data_Multi(): SignatureDescriptor_Data_Multi { return { - bitarray: CompactBitArray.fromPartial({}), + bitarray: undefined, signatures: [] }; } export const SignatureDescriptor_Data_Multi = { typeUrl: "/cosmos.tx.signing.v1beta1.Multi", + aminoType: "cosmos-sdk/Multi", + is(o: any): o is SignatureDescriptor_Data_Multi { + return o && (o.$typeUrl === SignatureDescriptor_Data_Multi.typeUrl || Array.isArray(o.signatures) && (!o.signatures.length || SignatureDescriptor_Data.is(o.signatures[0]))); + }, + isSDK(o: any): o is SignatureDescriptor_Data_MultiSDKType { + return o && (o.$typeUrl === SignatureDescriptor_Data_Multi.typeUrl || Array.isArray(o.signatures) && (!o.signatures.length || SignatureDescriptor_Data.isSDK(o.signatures[0]))); + }, + isAmino(o: any): o is SignatureDescriptor_Data_MultiAmino { + return o && (o.$typeUrl === SignatureDescriptor_Data_Multi.typeUrl || Array.isArray(o.signatures) && (!o.signatures.length || SignatureDescriptor_Data.isAmino(o.signatures[0]))); + }, encode(message: SignatureDescriptor_Data_Multi, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.bitarray !== undefined) { CompactBitArray.encode(message.bitarray, writer.uint32(10).fork()).ldelim(); @@ -587,6 +735,22 @@ export const SignatureDescriptor_Data_Multi = { } return message; }, + fromJSON(object: any): SignatureDescriptor_Data_Multi { + return { + 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 = {}; + message.bitarray !== undefined && (obj.bitarray = message.bitarray ? CompactBitArray.toJSON(message.bitarray) : undefined); + if (message.signatures) { + obj.signatures = message.signatures.map(e => e ? SignatureDescriptor_Data.toJSON(e) : undefined); + } else { + obj.signatures = []; + } + return obj; + }, fromPartial(object: Partial): SignatureDescriptor_Data_Multi { const message = createBaseSignatureDescriptor_Data_Multi(); message.bitarray = object.bitarray !== undefined && object.bitarray !== null ? CompactBitArray.fromPartial(object.bitarray) : undefined; @@ -594,10 +758,12 @@ export const SignatureDescriptor_Data_Multi = { return message; }, fromAmino(object: SignatureDescriptor_Data_MultiAmino): SignatureDescriptor_Data_Multi { - return { - bitarray: object?.bitarray ? CompactBitArray.fromAmino(object.bitarray) : undefined, - signatures: Array.isArray(object?.signatures) ? object.signatures.map((e: any) => SignatureDescriptor_Data.fromAmino(e)) : [] - }; + const message = createBaseSignatureDescriptor_Data_Multi(); + if (object.bitarray !== undefined && object.bitarray !== null) { + message.bitarray = CompactBitArray.fromAmino(object.bitarray); + } + message.signatures = object.signatures?.map(e => SignatureDescriptor_Data.fromAmino(e)) || []; + return message; }, toAmino(message: SignatureDescriptor_Data_Multi): SignatureDescriptor_Data_MultiAmino { const obj: any = {}; @@ -630,4 +796,6 @@ export const SignatureDescriptor_Data_Multi = { value: SignatureDescriptor_Data_Multi.encode(message).finish() }; } -}; \ No newline at end of file +}; +GlobalDecoderRegistry.register(SignatureDescriptor_Data_Multi.typeUrl, SignatureDescriptor_Data_Multi); +GlobalDecoderRegistry.registerAminoProtoMapping(SignatureDescriptor_Data_Multi.aminoType, SignatureDescriptor_Data_Multi.typeUrl); \ No newline at end of file diff --git a/packages/osmojs/src/codegen/cosmos/tx/v1beta1/service.lcd.ts b/packages/osmojs/src/codegen/cosmos/tx/v1beta1/service.lcd.ts index 2ae7a7b58..185943478 100644 --- a/packages/osmojs/src/codegen/cosmos/tx/v1beta1/service.lcd.ts +++ b/packages/osmojs/src/codegen/cosmos/tx/v1beta1/service.lcd.ts @@ -1,6 +1,6 @@ import { setPaginationParams } from "../../../helpers"; import { LCDClient } from "@cosmology/lcd"; -import { GetTxRequest, GetTxResponseSDKType, GetTxsEventRequest, GetTxsEventResponseSDKType } from "./service"; +import { GetTxRequest, GetTxResponseSDKType, GetTxsEventRequest, GetTxsEventResponseSDKType, GetBlockWithTxsRequest, GetBlockWithTxsResponseSDKType } from "./service"; export class LCDQueryClient { req: LCDClient; constructor({ @@ -11,6 +11,7 @@ export class LCDQueryClient { this.req = requestClient; this.getTx = this.getTx.bind(this); this.getTxsEvent = this.getTxsEvent.bind(this); + this.getBlockWithTxs = this.getBlockWithTxs.bind(this); } /* GetTx fetches a tx by hash. */ async getTx(params: GetTxRequest): Promise { @@ -31,7 +32,26 @@ export class LCDQueryClient { if (typeof params?.orderBy !== "undefined") { options.params.order_by = params.orderBy; } + if (typeof params?.page !== "undefined") { + options.params.page = params.page; + } + if (typeof params?.limit !== "undefined") { + options.params.limit = params.limit; + } const endpoint = `cosmos/tx/v1beta1/txs`; return await this.req.get(endpoint, options); } + /* GetBlockWithTxs fetches a block with decoded txs. + + Since: cosmos-sdk 0.45.2 */ + async getBlockWithTxs(params: GetBlockWithTxsRequest): Promise { + const options: any = { + params: {} + }; + if (typeof params?.pagination !== "undefined") { + setPaginationParams(options, params.pagination); + } + const endpoint = `cosmos/tx/v1beta1/txs/block/${params.height}`; + return await this.req.get(endpoint, options); + } } \ No newline at end of file diff --git a/packages/osmojs/src/codegen/cosmos/tx/v1beta1/service.rpc.Service.ts b/packages/osmojs/src/codegen/cosmos/tx/v1beta1/service.rpc.Service.ts index 54c991c28..8fee3dbcf 100644 --- a/packages/osmojs/src/codegen/cosmos/tx/v1beta1/service.rpc.Service.ts +++ b/packages/osmojs/src/codegen/cosmos/tx/v1beta1/service.rpc.Service.ts @@ -1,7 +1,7 @@ import { Rpc } from "../../../helpers"; import { BinaryReader } from "../../../binary"; import { QueryClient, createProtobufRpcClient } from "@cosmjs/stargate"; -import { SimulateRequest, SimulateResponse, GetTxRequest, GetTxResponse, BroadcastTxRequest, BroadcastTxResponse, GetTxsEventRequest, GetTxsEventResponse } from "./service"; +import { SimulateRequest, SimulateResponse, GetTxRequest, GetTxResponse, BroadcastTxRequest, BroadcastTxResponse, GetTxsEventRequest, GetTxsEventResponse, GetBlockWithTxsRequest, GetBlockWithTxsResponse, TxDecodeRequest, TxDecodeResponse, TxEncodeRequest, TxEncodeResponse, TxEncodeAminoRequest, TxEncodeAminoResponse, TxDecodeAminoRequest, TxDecodeAminoResponse } from "./service"; /** Service defines a gRPC service for interacting with transactions. */ export interface Service { /** Simulate simulates executing a transaction for estimating gas usage. */ @@ -12,6 +12,36 @@ export interface Service { broadcastTx(request: BroadcastTxRequest): Promise; /** GetTxsEvent fetches txs by event. */ getTxsEvent(request: GetTxsEventRequest): Promise; + /** + * GetBlockWithTxs fetches a block with decoded txs. + * + * Since: cosmos-sdk 0.45.2 + */ + getBlockWithTxs(request: GetBlockWithTxsRequest): Promise; + /** + * TxDecode decodes the transaction. + * + * Since: cosmos-sdk 0.47 + */ + txDecode(request: TxDecodeRequest): Promise; + /** + * TxEncode encodes the transaction. + * + * Since: cosmos-sdk 0.47 + */ + txEncode(request: TxEncodeRequest): Promise; + /** + * TxEncodeAmino encodes an Amino transaction from JSON to encoded bytes. + * + * Since: cosmos-sdk 0.47 + */ + txEncodeAmino(request: TxEncodeAminoRequest): Promise; + /** + * TxDecodeAmino decodes an Amino transaction from encoded bytes to JSON. + * + * Since: cosmos-sdk 0.47 + */ + txDecodeAmino(request: TxDecodeAminoRequest): Promise; } export class ServiceClientImpl implements Service { private readonly rpc: Rpc; @@ -21,6 +51,11 @@ export class ServiceClientImpl implements Service { 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.txDecode = this.txDecode.bind(this); + this.txEncode = this.txEncode.bind(this); + this.txEncodeAmino = this.txEncodeAmino.bind(this); + this.txDecodeAmino = this.txDecodeAmino.bind(this); } simulate(request: SimulateRequest): Promise { const data = SimulateRequest.encode(request).finish(); @@ -42,6 +77,31 @@ export class ServiceClientImpl implements Service { const promise = this.rpc.request("cosmos.tx.v1beta1.Service", "GetTxsEvent", data); return promise.then(data => GetTxsEventResponse.decode(new BinaryReader(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 BinaryReader(data))); + } + txDecode(request: TxDecodeRequest): Promise { + const data = TxDecodeRequest.encode(request).finish(); + const promise = this.rpc.request("cosmos.tx.v1beta1.Service", "TxDecode", data); + return promise.then(data => TxDecodeResponse.decode(new BinaryReader(data))); + } + txEncode(request: TxEncodeRequest): Promise { + const data = TxEncodeRequest.encode(request).finish(); + const promise = this.rpc.request("cosmos.tx.v1beta1.Service", "TxEncode", data); + return promise.then(data => TxEncodeResponse.decode(new BinaryReader(data))); + } + txEncodeAmino(request: TxEncodeAminoRequest): Promise { + const data = TxEncodeAminoRequest.encode(request).finish(); + const promise = this.rpc.request("cosmos.tx.v1beta1.Service", "TxEncodeAmino", data); + return promise.then(data => TxEncodeAminoResponse.decode(new BinaryReader(data))); + } + txDecodeAmino(request: TxDecodeAminoRequest): Promise { + const data = TxDecodeAminoRequest.encode(request).finish(); + const promise = this.rpc.request("cosmos.tx.v1beta1.Service", "TxDecodeAmino", data); + return promise.then(data => TxDecodeAminoResponse.decode(new BinaryReader(data))); + } } export const createRpcQueryExtension = (base: QueryClient) => { const rpc = createProtobufRpcClient(base); @@ -58,6 +118,21 @@ export const createRpcQueryExtension = (base: QueryClient) => { }, getTxsEvent(request: GetTxsEventRequest): Promise { return queryService.getTxsEvent(request); + }, + getBlockWithTxs(request: GetBlockWithTxsRequest): Promise { + return queryService.getBlockWithTxs(request); + }, + txDecode(request: TxDecodeRequest): Promise { + return queryService.txDecode(request); + }, + txEncode(request: TxEncodeRequest): Promise { + return queryService.txEncode(request); + }, + txEncodeAmino(request: TxEncodeAminoRequest): Promise { + return queryService.txEncodeAmino(request); + }, + txDecodeAmino(request: TxDecodeAminoRequest): Promise { + return queryService.txDecodeAmino(request); } }; }; \ No newline at end of file diff --git a/packages/osmojs/src/codegen/cosmos/tx/v1beta1/service.ts b/packages/osmojs/src/codegen/cosmos/tx/v1beta1/service.ts index 911233eaf..77b675fe1 100644 --- a/packages/osmojs/src/codegen/cosmos/tx/v1beta1/service.ts +++ b/packages/osmojs/src/codegen/cosmos/tx/v1beta1/service.ts @@ -1,8 +1,11 @@ import { Tx, TxAmino, TxSDKType } from "./tx"; import { PageRequest, PageRequestAmino, PageRequestSDKType, PageResponse, PageResponseAmino, PageResponseSDKType } from "../../base/query/v1beta1/pagination"; import { TxResponse, TxResponseAmino, TxResponseSDKType, GasInfo, GasInfoAmino, GasInfoSDKType, Result, ResultAmino, ResultSDKType } from "../../base/abci/v1beta1/abci"; +import { BlockID, BlockIDAmino, BlockIDSDKType } from "../../../tendermint/types/types"; +import { Block, BlockAmino, BlockSDKType } from "../../../tendermint/types/block"; +import { isSet, bytesFromBase64, base64FromBytes } from "../../../helpers"; import { BinaryReader, BinaryWriter } from "../../../binary"; -import { isSet } from "../../../helpers"; +import { GlobalDecoderRegistry } from "../../../registry"; /** OrderBy defines the sorting order */ export enum OrderBy { /** ORDER_BY_UNSPECIFIED - ORDER_BY_UNSPECIFIED specifies an unknown sorting order. OrderBy defaults to ASC in this case. */ @@ -50,8 +53,8 @@ export enum BroadcastMode { /** BROADCAST_MODE_UNSPECIFIED - zero-value for mode ordering */ BROADCAST_MODE_UNSPECIFIED = 0, /** - * BROADCAST_MODE_BLOCK - BROADCAST_MODE_BLOCK defines a tx broadcasting mode where the client waits for - * the tx to be committed in a block. + * BROADCAST_MODE_BLOCK - DEPRECATED: use BROADCAST_MODE_SYNC instead, + * BROADCAST_MODE_BLOCK is not supported by the SDK from v0.47.x onwards. */ BROADCAST_MODE_BLOCK = 1, /** @@ -110,9 +113,20 @@ export function broadcastModeToJSON(object: BroadcastMode): string { export interface GetTxsEventRequest { /** events is the list of transaction event type. */ events: string[]; - /** pagination defines an pagination for the request. */ - pagination: PageRequest; + /** + * pagination defines a pagination for the request. + * Deprecated post v0.46.x: use page and limit instead. + */ + /** @deprecated */ + pagination?: PageRequest; orderBy: OrderBy; + /** page is the page number to query, starts at 1. If not provided, will default to first page. */ + page: bigint; + /** + * 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: bigint; } export interface GetTxsEventRequestProtoMsg { typeUrl: "/cosmos.tx.v1beta1.GetTxsEventRequest"; @@ -124,10 +138,21 @@ export interface GetTxsEventRequestProtoMsg { */ export interface GetTxsEventRequestAmino { /** events is the list of transaction event type. */ - events: string[]; - /** pagination defines an pagination for the request. */ + events?: string[]; + /** + * pagination defines a pagination for the request. + * Deprecated post v0.46.x: use page and limit instead. + */ + /** @deprecated */ pagination?: PageRequestAmino; - order_by: OrderBy; + order_by?: OrderBy; + /** page is the page number to query, starts at 1. If not provided, will default to first page. */ + page?: string; + /** + * 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?: string; } export interface GetTxsEventRequestAminoMsg { type: "cosmos-sdk/GetTxsEventRequest"; @@ -139,8 +164,11 @@ export interface GetTxsEventRequestAminoMsg { */ export interface GetTxsEventRequestSDKType { events: string[]; - pagination: PageRequestSDKType; + /** @deprecated */ + pagination?: PageRequestSDKType; order_by: OrderBy; + page: bigint; + limit: bigint; } /** * GetTxsEventResponse is the response type for the Service.TxsByEvents @@ -151,8 +179,14 @@ export interface GetTxsEventResponse { txs: Tx[]; /** tx_responses is the list of queried TxResponses. */ txResponses: TxResponse[]; - /** pagination defines an pagination for the response. */ - pagination: PageResponse; + /** + * pagination defines a pagination for the response. + * Deprecated post v0.46.x: use total instead. + */ + /** @deprecated */ + pagination?: PageResponse; + /** total is total number of results available */ + total: bigint; } export interface GetTxsEventResponseProtoMsg { typeUrl: "/cosmos.tx.v1beta1.GetTxsEventResponse"; @@ -164,11 +198,17 @@ export interface GetTxsEventResponseProtoMsg { */ export interface GetTxsEventResponseAmino { /** txs is the list of queried transactions. */ - txs: TxAmino[]; + txs?: TxAmino[]; /** tx_responses is the list of queried TxResponses. */ - tx_responses: TxResponseAmino[]; - /** pagination defines an pagination for the response. */ + tx_responses?: TxResponseAmino[]; + /** + * pagination defines a pagination for the response. + * Deprecated post v0.46.x: use total instead. + */ + /** @deprecated */ pagination?: PageResponseAmino; + /** total is total number of results available */ + total?: string; } export interface GetTxsEventResponseAminoMsg { type: "cosmos-sdk/GetTxsEventResponse"; @@ -181,7 +221,9 @@ export interface GetTxsEventResponseAminoMsg { export interface GetTxsEventResponseSDKType { txs: TxSDKType[]; tx_responses: TxResponseSDKType[]; - pagination: PageResponseSDKType; + /** @deprecated */ + pagination?: PageResponseSDKType; + total: bigint; } /** * BroadcastTxRequest is the request type for the Service.BroadcastTxRequest @@ -202,8 +244,8 @@ export interface BroadcastTxRequestProtoMsg { */ export interface BroadcastTxRequestAmino { /** tx_bytes is the raw transaction. */ - tx_bytes: Uint8Array; - mode: BroadcastMode; + tx_bytes?: string; + mode?: BroadcastMode; } export interface BroadcastTxRequestAminoMsg { type: "cosmos-sdk/BroadcastTxRequest"; @@ -223,7 +265,7 @@ export interface BroadcastTxRequestSDKType { */ export interface BroadcastTxResponse { /** tx_response is the queried TxResponses. */ - txResponse: TxResponse; + txResponse?: TxResponse; } export interface BroadcastTxResponseProtoMsg { typeUrl: "/cosmos.tx.v1beta1.BroadcastTxResponse"; @@ -246,7 +288,7 @@ export interface BroadcastTxResponseAminoMsg { * Service.BroadcastTx method. */ export interface BroadcastTxResponseSDKType { - tx_response: TxResponseSDKType; + tx_response?: TxResponseSDKType; } /** * SimulateRequest is the request type for the Service.Simulate @@ -258,7 +300,7 @@ export interface SimulateRequest { * Deprecated. Send raw tx bytes instead. */ /** @deprecated */ - tx: Tx; + tx?: Tx; /** * tx_bytes is the raw transaction. * @@ -286,7 +328,7 @@ export interface SimulateRequestAmino { * * Since: cosmos-sdk 0.43 */ - tx_bytes: Uint8Array; + tx_bytes?: string; } export interface SimulateRequestAminoMsg { type: "cosmos-sdk/SimulateRequest"; @@ -298,7 +340,7 @@ export interface SimulateRequestAminoMsg { */ export interface SimulateRequestSDKType { /** @deprecated */ - tx: TxSDKType; + tx?: TxSDKType; tx_bytes: Uint8Array; } /** @@ -307,9 +349,9 @@ export interface SimulateRequestSDKType { */ 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; } export interface SimulateResponseProtoMsg { typeUrl: "/cosmos.tx.v1beta1.SimulateResponse"; @@ -334,8 +376,8 @@ export interface SimulateResponseAminoMsg { * Service.SimulateRPC method. */ export interface SimulateResponseSDKType { - gas_info: GasInfoSDKType; - result: ResultSDKType; + gas_info?: GasInfoSDKType; + result?: ResultSDKType; } /** * GetTxRequest is the request type for the Service.GetTx @@ -355,7 +397,7 @@ export interface GetTxRequestProtoMsg { */ export interface GetTxRequestAmino { /** hash is the tx hash to query, encoded as a hex string. */ - hash: string; + hash?: string; } export interface GetTxRequestAminoMsg { type: "cosmos-sdk/GetTxRequest"; @@ -371,9 +413,9 @@ export interface GetTxRequestSDKType { /** 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; } export interface GetTxResponseProtoMsg { typeUrl: "/cosmos.tx.v1beta1.GetTxResponse"; @@ -392,18 +434,405 @@ export interface GetTxResponseAminoMsg { } /** GetTxResponse is the response type for the Service.GetTx method. */ export interface GetTxResponseSDKType { - tx: TxSDKType; - tx_response: TxResponseSDKType; + tx?: TxSDKType; + tx_response?: TxResponseSDKType; +} +/** + * GetBlockWithTxsRequest is the request type for the Service.GetBlockWithTxs + * RPC method. + * + * Since: cosmos-sdk 0.45.2 + */ +export interface GetBlockWithTxsRequest { + /** height is the height of the block to query. */ + height: bigint; + /** pagination defines a pagination for the request. */ + pagination?: PageRequest; +} +export interface GetBlockWithTxsRequestProtoMsg { + typeUrl: "/cosmos.tx.v1beta1.GetBlockWithTxsRequest"; + value: Uint8Array; +} +/** + * GetBlockWithTxsRequest is the request type for the Service.GetBlockWithTxs + * RPC method. + * + * Since: cosmos-sdk 0.45.2 + */ +export interface GetBlockWithTxsRequestAmino { + /** height is the height of the block to query. */ + height?: string; + /** pagination defines a pagination for the request. */ + pagination?: PageRequestAmino; +} +export interface GetBlockWithTxsRequestAminoMsg { + type: "cosmos-sdk/GetBlockWithTxsRequest"; + value: GetBlockWithTxsRequestAmino; +} +/** + * GetBlockWithTxsRequest is the request type for the Service.GetBlockWithTxs + * RPC method. + * + * Since: cosmos-sdk 0.45.2 + */ +export interface GetBlockWithTxsRequestSDKType { + height: bigint; + pagination?: PageRequestSDKType; +} +/** + * GetBlockWithTxsResponse is the response type for the Service.GetBlockWithTxs method. + * + * Since: cosmos-sdk 0.45.2 + */ +export interface GetBlockWithTxsResponse { + /** txs are the transactions in the block. */ + txs: Tx[]; + blockId?: BlockID; + block?: Block; + /** pagination defines a pagination for the response. */ + pagination?: PageResponse; +} +export interface GetBlockWithTxsResponseProtoMsg { + typeUrl: "/cosmos.tx.v1beta1.GetBlockWithTxsResponse"; + value: Uint8Array; +} +/** + * GetBlockWithTxsResponse is the response type for the Service.GetBlockWithTxs method. + * + * Since: cosmos-sdk 0.45.2 + */ +export interface GetBlockWithTxsResponseAmino { + /** txs are the transactions in the block. */ + txs?: TxAmino[]; + block_id?: BlockIDAmino; + block?: BlockAmino; + /** pagination defines a pagination for the response. */ + pagination?: PageResponseAmino; +} +export interface GetBlockWithTxsResponseAminoMsg { + type: "cosmos-sdk/GetBlockWithTxsResponse"; + value: GetBlockWithTxsResponseAmino; +} +/** + * GetBlockWithTxsResponse is the response type for the Service.GetBlockWithTxs method. + * + * Since: cosmos-sdk 0.45.2 + */ +export interface GetBlockWithTxsResponseSDKType { + txs: TxSDKType[]; + block_id?: BlockIDSDKType; + block?: BlockSDKType; + pagination?: PageResponseSDKType; +} +/** + * TxDecodeRequest is the request type for the Service.TxDecode + * RPC method. + * + * Since: cosmos-sdk 0.47 + */ +export interface TxDecodeRequest { + /** tx_bytes is the raw transaction. */ + txBytes: Uint8Array; +} +export interface TxDecodeRequestProtoMsg { + typeUrl: "/cosmos.tx.v1beta1.TxDecodeRequest"; + value: Uint8Array; +} +/** + * TxDecodeRequest is the request type for the Service.TxDecode + * RPC method. + * + * Since: cosmos-sdk 0.47 + */ +export interface TxDecodeRequestAmino { + /** tx_bytes is the raw transaction. */ + tx_bytes?: string; +} +export interface TxDecodeRequestAminoMsg { + type: "cosmos-sdk/TxDecodeRequest"; + value: TxDecodeRequestAmino; +} +/** + * TxDecodeRequest is the request type for the Service.TxDecode + * RPC method. + * + * Since: cosmos-sdk 0.47 + */ +export interface TxDecodeRequestSDKType { + tx_bytes: Uint8Array; +} +/** + * TxDecodeResponse is the response type for the + * Service.TxDecode method. + * + * Since: cosmos-sdk 0.47 + */ +export interface TxDecodeResponse { + /** tx is the decoded transaction. */ + tx?: Tx; +} +export interface TxDecodeResponseProtoMsg { + typeUrl: "/cosmos.tx.v1beta1.TxDecodeResponse"; + value: Uint8Array; +} +/** + * TxDecodeResponse is the response type for the + * Service.TxDecode method. + * + * Since: cosmos-sdk 0.47 + */ +export interface TxDecodeResponseAmino { + /** tx is the decoded transaction. */ + tx?: TxAmino; +} +export interface TxDecodeResponseAminoMsg { + type: "cosmos-sdk/TxDecodeResponse"; + value: TxDecodeResponseAmino; +} +/** + * TxDecodeResponse is the response type for the + * Service.TxDecode method. + * + * Since: cosmos-sdk 0.47 + */ +export interface TxDecodeResponseSDKType { + tx?: TxSDKType; +} +/** + * TxEncodeRequest is the request type for the Service.TxEncode + * RPC method. + * + * Since: cosmos-sdk 0.47 + */ +export interface TxEncodeRequest { + /** tx is the transaction to encode. */ + tx?: Tx; +} +export interface TxEncodeRequestProtoMsg { + typeUrl: "/cosmos.tx.v1beta1.TxEncodeRequest"; + value: Uint8Array; +} +/** + * TxEncodeRequest is the request type for the Service.TxEncode + * RPC method. + * + * Since: cosmos-sdk 0.47 + */ +export interface TxEncodeRequestAmino { + /** tx is the transaction to encode. */ + tx?: TxAmino; +} +export interface TxEncodeRequestAminoMsg { + type: "cosmos-sdk/TxEncodeRequest"; + value: TxEncodeRequestAmino; +} +/** + * TxEncodeRequest is the request type for the Service.TxEncode + * RPC method. + * + * Since: cosmos-sdk 0.47 + */ +export interface TxEncodeRequestSDKType { + tx?: TxSDKType; +} +/** + * TxEncodeResponse is the response type for the + * Service.TxEncode method. + * + * Since: cosmos-sdk 0.47 + */ +export interface TxEncodeResponse { + /** tx_bytes is the encoded transaction bytes. */ + txBytes: Uint8Array; +} +export interface TxEncodeResponseProtoMsg { + typeUrl: "/cosmos.tx.v1beta1.TxEncodeResponse"; + value: Uint8Array; +} +/** + * TxEncodeResponse is the response type for the + * Service.TxEncode method. + * + * Since: cosmos-sdk 0.47 + */ +export interface TxEncodeResponseAmino { + /** tx_bytes is the encoded transaction bytes. */ + tx_bytes?: string; +} +export interface TxEncodeResponseAminoMsg { + type: "cosmos-sdk/TxEncodeResponse"; + value: TxEncodeResponseAmino; +} +/** + * TxEncodeResponse is the response type for the + * Service.TxEncode method. + * + * Since: cosmos-sdk 0.47 + */ +export interface TxEncodeResponseSDKType { + tx_bytes: Uint8Array; +} +/** + * TxEncodeAminoRequest is the request type for the Service.TxEncodeAmino + * RPC method. + * + * Since: cosmos-sdk 0.47 + */ +export interface TxEncodeAminoRequest { + aminoJson: string; +} +export interface TxEncodeAminoRequestProtoMsg { + typeUrl: "/cosmos.tx.v1beta1.TxEncodeAminoRequest"; + value: Uint8Array; +} +/** + * TxEncodeAminoRequest is the request type for the Service.TxEncodeAmino + * RPC method. + * + * Since: cosmos-sdk 0.47 + */ +export interface TxEncodeAminoRequestAmino { + amino_json?: string; +} +export interface TxEncodeAminoRequestAminoMsg { + type: "cosmos-sdk/TxEncodeAminoRequest"; + value: TxEncodeAminoRequestAmino; +} +/** + * TxEncodeAminoRequest is the request type for the Service.TxEncodeAmino + * RPC method. + * + * Since: cosmos-sdk 0.47 + */ +export interface TxEncodeAminoRequestSDKType { + amino_json: string; +} +/** + * TxEncodeAminoResponse is the response type for the Service.TxEncodeAmino + * RPC method. + * + * Since: cosmos-sdk 0.47 + */ +export interface TxEncodeAminoResponse { + aminoBinary: Uint8Array; +} +export interface TxEncodeAminoResponseProtoMsg { + typeUrl: "/cosmos.tx.v1beta1.TxEncodeAminoResponse"; + value: Uint8Array; +} +/** + * TxEncodeAminoResponse is the response type for the Service.TxEncodeAmino + * RPC method. + * + * Since: cosmos-sdk 0.47 + */ +export interface TxEncodeAminoResponseAmino { + amino_binary?: string; +} +export interface TxEncodeAminoResponseAminoMsg { + type: "cosmos-sdk/TxEncodeAminoResponse"; + value: TxEncodeAminoResponseAmino; +} +/** + * TxEncodeAminoResponse is the response type for the Service.TxEncodeAmino + * RPC method. + * + * Since: cosmos-sdk 0.47 + */ +export interface TxEncodeAminoResponseSDKType { + amino_binary: Uint8Array; +} +/** + * TxDecodeAminoRequest is the request type for the Service.TxDecodeAmino + * RPC method. + * + * Since: cosmos-sdk 0.47 + */ +export interface TxDecodeAminoRequest { + aminoBinary: Uint8Array; +} +export interface TxDecodeAminoRequestProtoMsg { + typeUrl: "/cosmos.tx.v1beta1.TxDecodeAminoRequest"; + value: Uint8Array; +} +/** + * TxDecodeAminoRequest is the request type for the Service.TxDecodeAmino + * RPC method. + * + * Since: cosmos-sdk 0.47 + */ +export interface TxDecodeAminoRequestAmino { + amino_binary?: string; +} +export interface TxDecodeAminoRequestAminoMsg { + type: "cosmos-sdk/TxDecodeAminoRequest"; + value: TxDecodeAminoRequestAmino; +} +/** + * TxDecodeAminoRequest is the request type for the Service.TxDecodeAmino + * RPC method. + * + * Since: cosmos-sdk 0.47 + */ +export interface TxDecodeAminoRequestSDKType { + amino_binary: Uint8Array; +} +/** + * TxDecodeAminoResponse is the response type for the Service.TxDecodeAmino + * RPC method. + * + * Since: cosmos-sdk 0.47 + */ +export interface TxDecodeAminoResponse { + aminoJson: string; +} +export interface TxDecodeAminoResponseProtoMsg { + typeUrl: "/cosmos.tx.v1beta1.TxDecodeAminoResponse"; + value: Uint8Array; +} +/** + * TxDecodeAminoResponse is the response type for the Service.TxDecodeAmino + * RPC method. + * + * Since: cosmos-sdk 0.47 + */ +export interface TxDecodeAminoResponseAmino { + amino_json?: string; +} +export interface TxDecodeAminoResponseAminoMsg { + type: "cosmos-sdk/TxDecodeAminoResponse"; + value: TxDecodeAminoResponseAmino; +} +/** + * TxDecodeAminoResponse is the response type for the Service.TxDecodeAmino + * RPC method. + * + * Since: cosmos-sdk 0.47 + */ +export interface TxDecodeAminoResponseSDKType { + amino_json: string; } function createBaseGetTxsEventRequest(): GetTxsEventRequest { return { events: [], - pagination: PageRequest.fromPartial({}), - orderBy: 0 + pagination: undefined, + orderBy: 0, + page: BigInt(0), + limit: BigInt(0) }; } export const GetTxsEventRequest = { typeUrl: "/cosmos.tx.v1beta1.GetTxsEventRequest", + aminoType: "cosmos-sdk/GetTxsEventRequest", + is(o: any): o is GetTxsEventRequest { + return o && (o.$typeUrl === GetTxsEventRequest.typeUrl || Array.isArray(o.events) && (!o.events.length || typeof o.events[0] === "string") && isSet(o.orderBy) && typeof o.page === "bigint" && typeof o.limit === "bigint"); + }, + isSDK(o: any): o is GetTxsEventRequestSDKType { + return o && (o.$typeUrl === GetTxsEventRequest.typeUrl || Array.isArray(o.events) && (!o.events.length || typeof o.events[0] === "string") && isSet(o.order_by) && typeof o.page === "bigint" && typeof o.limit === "bigint"); + }, + isAmino(o: any): o is GetTxsEventRequestAmino { + return o && (o.$typeUrl === GetTxsEventRequest.typeUrl || Array.isArray(o.events) && (!o.events.length || typeof o.events[0] === "string") && isSet(o.order_by) && typeof o.page === "bigint" && typeof o.limit === "bigint"); + }, encode(message: GetTxsEventRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.events) { writer.uint32(10).string(v!); @@ -414,6 +843,12 @@ export const GetTxsEventRequest = { if (message.orderBy !== 0) { writer.uint32(24).int32(message.orderBy); } + if (message.page !== BigInt(0)) { + writer.uint32(32).uint64(message.page); + } + if (message.limit !== BigInt(0)) { + writer.uint32(40).uint64(message.limit); + } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): GetTxsEventRequest { @@ -432,6 +867,12 @@ export const GetTxsEventRequest = { case 3: message.orderBy = (reader.int32() as any); break; + case 4: + message.page = reader.uint64(); + break; + case 5: + message.limit = reader.uint64(); + break; default: reader.skipType(tag & 7); break; @@ -439,19 +880,53 @@ export const GetTxsEventRequest = { } 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, + orderBy: isSet(object.orderBy) ? orderByFromJSON(object.orderBy) : -1, + page: isSet(object.page) ? BigInt(object.page.toString()) : BigInt(0), + limit: isSet(object.limit) ? BigInt(object.limit.toString()) : BigInt(0) + }; + }, + toJSON(message: GetTxsEventRequest): unknown { + const obj: any = {}; + if (message.events) { + obj.events = message.events.map(e => e); + } else { + obj.events = []; + } + message.pagination !== undefined && (obj.pagination = message.pagination ? PageRequest.toJSON(message.pagination) : undefined); + message.orderBy !== undefined && (obj.orderBy = orderByToJSON(message.orderBy)); + message.page !== undefined && (obj.page = (message.page || BigInt(0)).toString()); + message.limit !== undefined && (obj.limit = (message.limit || BigInt(0)).toString()); + return obj; + }, fromPartial(object: Partial): 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; + message.page = object.page !== undefined && object.page !== null ? BigInt(object.page.toString()) : BigInt(0); + message.limit = object.limit !== undefined && object.limit !== null ? BigInt(object.limit.toString()) : BigInt(0); return message; }, fromAmino(object: GetTxsEventRequestAmino): GetTxsEventRequest { - return { - events: Array.isArray(object?.events) ? object.events.map((e: any) => e) : [], - pagination: object?.pagination ? PageRequest.fromAmino(object.pagination) : undefined, - orderBy: isSet(object.order_by) ? orderByFromJSON(object.order_by) : -1 - }; + const message = createBaseGetTxsEventRequest(); + message.events = object.events?.map(e => e) || []; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromAmino(object.pagination); + } + if (object.order_by !== undefined && object.order_by !== null) { + message.orderBy = orderByFromJSON(object.order_by); + } + if (object.page !== undefined && object.page !== null) { + message.page = BigInt(object.page); + } + if (object.limit !== undefined && object.limit !== null) { + message.limit = BigInt(object.limit); + } + return message; }, toAmino(message: GetTxsEventRequest): GetTxsEventRequestAmino { const obj: any = {}; @@ -461,7 +936,9 @@ export const GetTxsEventRequest = { obj.events = []; } obj.pagination = message.pagination ? PageRequest.toAmino(message.pagination) : undefined; - obj.order_by = message.orderBy; + obj.order_by = orderByToJSON(message.orderBy); + obj.page = message.page ? message.page.toString() : undefined; + obj.limit = message.limit ? message.limit.toString() : undefined; return obj; }, fromAminoMsg(object: GetTxsEventRequestAminoMsg): GetTxsEventRequest { @@ -486,15 +963,28 @@ export const GetTxsEventRequest = { }; } }; +GlobalDecoderRegistry.register(GetTxsEventRequest.typeUrl, GetTxsEventRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(GetTxsEventRequest.aminoType, GetTxsEventRequest.typeUrl); function createBaseGetTxsEventResponse(): GetTxsEventResponse { return { txs: [], txResponses: [], - pagination: PageResponse.fromPartial({}) + pagination: undefined, + total: BigInt(0) }; } export const GetTxsEventResponse = { typeUrl: "/cosmos.tx.v1beta1.GetTxsEventResponse", + aminoType: "cosmos-sdk/GetTxsEventResponse", + is(o: any): o is GetTxsEventResponse { + return o && (o.$typeUrl === GetTxsEventResponse.typeUrl || Array.isArray(o.txs) && (!o.txs.length || Tx.is(o.txs[0])) && Array.isArray(o.txResponses) && (!o.txResponses.length || TxResponse.is(o.txResponses[0])) && typeof o.total === "bigint"); + }, + isSDK(o: any): o is GetTxsEventResponseSDKType { + return o && (o.$typeUrl === GetTxsEventResponse.typeUrl || Array.isArray(o.txs) && (!o.txs.length || Tx.isSDK(o.txs[0])) && Array.isArray(o.tx_responses) && (!o.tx_responses.length || TxResponse.isSDK(o.tx_responses[0])) && typeof o.total === "bigint"); + }, + isAmino(o: any): o is GetTxsEventResponseAmino { + return o && (o.$typeUrl === GetTxsEventResponse.typeUrl || Array.isArray(o.txs) && (!o.txs.length || Tx.isAmino(o.txs[0])) && Array.isArray(o.tx_responses) && (!o.tx_responses.length || TxResponse.isAmino(o.tx_responses[0])) && typeof o.total === "bigint"); + }, encode(message: GetTxsEventResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.txs) { Tx.encode(v!, writer.uint32(10).fork()).ldelim(); @@ -505,6 +995,9 @@ export const GetTxsEventResponse = { if (message.pagination !== undefined) { PageResponse.encode(message.pagination, writer.uint32(26).fork()).ldelim(); } + if (message.total !== BigInt(0)) { + writer.uint32(32).uint64(message.total); + } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): GetTxsEventResponse { @@ -523,6 +1016,9 @@ export const GetTxsEventResponse = { case 3: message.pagination = PageResponse.decode(reader, reader.uint32()); break; + case 4: + message.total = reader.uint64(); + break; default: reader.skipType(tag & 7); break; @@ -530,19 +1026,49 @@ export const GetTxsEventResponse = { } 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, + total: isSet(object.total) ? BigInt(object.total.toString()) : BigInt(0) + }; + }, + toJSON(message: GetTxsEventResponse): unknown { + const obj: any = {}; + if (message.txs) { + obj.txs = message.txs.map(e => e ? Tx.toJSON(e) : undefined); + } else { + obj.txs = []; + } + if (message.txResponses) { + obj.txResponses = message.txResponses.map(e => e ? TxResponse.toJSON(e) : undefined); + } else { + obj.txResponses = []; + } + message.pagination !== undefined && (obj.pagination = message.pagination ? PageResponse.toJSON(message.pagination) : undefined); + message.total !== undefined && (obj.total = (message.total || BigInt(0)).toString()); + return obj; + }, fromPartial(object: Partial): 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; + message.total = object.total !== undefined && object.total !== null ? BigInt(object.total.toString()) : BigInt(0); return message; }, fromAmino(object: GetTxsEventResponseAmino): GetTxsEventResponse { - return { - txs: Array.isArray(object?.txs) ? object.txs.map((e: any) => Tx.fromAmino(e)) : [], - txResponses: Array.isArray(object?.tx_responses) ? object.tx_responses.map((e: any) => TxResponse.fromAmino(e)) : [], - pagination: object?.pagination ? PageResponse.fromAmino(object.pagination) : undefined - }; + const message = createBaseGetTxsEventResponse(); + message.txs = object.txs?.map(e => Tx.fromAmino(e)) || []; + message.txResponses = object.tx_responses?.map(e => TxResponse.fromAmino(e)) || []; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromAmino(object.pagination); + } + if (object.total !== undefined && object.total !== null) { + message.total = BigInt(object.total); + } + return message; }, toAmino(message: GetTxsEventResponse): GetTxsEventResponseAmino { const obj: any = {}; @@ -557,6 +1083,7 @@ export const GetTxsEventResponse = { obj.tx_responses = []; } obj.pagination = message.pagination ? PageResponse.toAmino(message.pagination) : undefined; + obj.total = message.total ? message.total.toString() : undefined; return obj; }, fromAminoMsg(object: GetTxsEventResponseAminoMsg): GetTxsEventResponse { @@ -581,6 +1108,8 @@ export const GetTxsEventResponse = { }; } }; +GlobalDecoderRegistry.register(GetTxsEventResponse.typeUrl, GetTxsEventResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(GetTxsEventResponse.aminoType, GetTxsEventResponse.typeUrl); function createBaseBroadcastTxRequest(): BroadcastTxRequest { return { txBytes: new Uint8Array(), @@ -589,6 +1118,16 @@ function createBaseBroadcastTxRequest(): BroadcastTxRequest { } export const BroadcastTxRequest = { typeUrl: "/cosmos.tx.v1beta1.BroadcastTxRequest", + aminoType: "cosmos-sdk/BroadcastTxRequest", + is(o: any): o is BroadcastTxRequest { + return o && (o.$typeUrl === BroadcastTxRequest.typeUrl || (o.txBytes instanceof Uint8Array || typeof o.txBytes === "string") && isSet(o.mode)); + }, + isSDK(o: any): o is BroadcastTxRequestSDKType { + return o && (o.$typeUrl === BroadcastTxRequest.typeUrl || (o.tx_bytes instanceof Uint8Array || typeof o.tx_bytes === "string") && isSet(o.mode)); + }, + isAmino(o: any): o is BroadcastTxRequestAmino { + return o && (o.$typeUrl === BroadcastTxRequest.typeUrl || (o.tx_bytes instanceof Uint8Array || typeof o.tx_bytes === "string") && isSet(o.mode)); + }, encode(message: BroadcastTxRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.txBytes.length !== 0) { writer.uint32(10).bytes(message.txBytes); @@ -618,6 +1157,18 @@ export const BroadcastTxRequest = { } return message; }, + fromJSON(object: any): BroadcastTxRequest { + return { + txBytes: isSet(object.txBytes) ? bytesFromBase64(object.txBytes) : new Uint8Array(), + mode: isSet(object.mode) ? broadcastModeFromJSON(object.mode) : -1 + }; + }, + toJSON(message: BroadcastTxRequest): unknown { + 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; + }, fromPartial(object: Partial): BroadcastTxRequest { const message = createBaseBroadcastTxRequest(); message.txBytes = object.txBytes ?? new Uint8Array(); @@ -625,15 +1176,19 @@ export const BroadcastTxRequest = { return message; }, fromAmino(object: BroadcastTxRequestAmino): BroadcastTxRequest { - return { - txBytes: object.tx_bytes, - mode: isSet(object.mode) ? broadcastModeFromJSON(object.mode) : -1 - }; + const message = createBaseBroadcastTxRequest(); + if (object.tx_bytes !== undefined && object.tx_bytes !== null) { + message.txBytes = bytesFromBase64(object.tx_bytes); + } + if (object.mode !== undefined && object.mode !== null) { + message.mode = broadcastModeFromJSON(object.mode); + } + return message; }, toAmino(message: BroadcastTxRequest): BroadcastTxRequestAmino { const obj: any = {}; - obj.tx_bytes = message.txBytes; - obj.mode = message.mode; + obj.tx_bytes = message.txBytes ? base64FromBytes(message.txBytes) : undefined; + obj.mode = broadcastModeToJSON(message.mode); return obj; }, fromAminoMsg(object: BroadcastTxRequestAminoMsg): BroadcastTxRequest { @@ -658,13 +1213,25 @@ export const BroadcastTxRequest = { }; } }; +GlobalDecoderRegistry.register(BroadcastTxRequest.typeUrl, BroadcastTxRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(BroadcastTxRequest.aminoType, BroadcastTxRequest.typeUrl); function createBaseBroadcastTxResponse(): BroadcastTxResponse { return { - txResponse: TxResponse.fromPartial({}) + txResponse: undefined }; } export const BroadcastTxResponse = { typeUrl: "/cosmos.tx.v1beta1.BroadcastTxResponse", + aminoType: "cosmos-sdk/BroadcastTxResponse", + is(o: any): o is BroadcastTxResponse { + return o && o.$typeUrl === BroadcastTxResponse.typeUrl; + }, + isSDK(o: any): o is BroadcastTxResponseSDKType { + return o && o.$typeUrl === BroadcastTxResponse.typeUrl; + }, + isAmino(o: any): o is BroadcastTxResponseAmino { + return o && o.$typeUrl === BroadcastTxResponse.typeUrl; + }, encode(message: BroadcastTxResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.txResponse !== undefined) { TxResponse.encode(message.txResponse, writer.uint32(10).fork()).ldelim(); @@ -688,19 +1255,31 @@ export const BroadcastTxResponse = { } return message; }, - fromPartial(object: Partial): BroadcastTxResponse { - const message = createBaseBroadcastTxResponse(); - message.txResponse = object.txResponse !== undefined && object.txResponse !== null ? TxResponse.fromPartial(object.txResponse) : undefined; - return message; - }, - fromAmino(object: BroadcastTxResponseAmino): BroadcastTxResponse { + fromJSON(object: any): BroadcastTxResponse { return { - txResponse: object?.tx_response ? TxResponse.fromAmino(object.tx_response) : undefined + txResponse: isSet(object.txResponse) ? TxResponse.fromJSON(object.txResponse) : undefined }; }, - toAmino(message: BroadcastTxResponse): BroadcastTxResponseAmino { + toJSON(message: BroadcastTxResponse): unknown { const obj: any = {}; - obj.tx_response = message.txResponse ? TxResponse.toAmino(message.txResponse) : undefined; + message.txResponse !== undefined && (obj.txResponse = message.txResponse ? TxResponse.toJSON(message.txResponse) : undefined); + return obj; + }, + fromPartial(object: Partial): BroadcastTxResponse { + const message = createBaseBroadcastTxResponse(); + message.txResponse = object.txResponse !== undefined && object.txResponse !== null ? TxResponse.fromPartial(object.txResponse) : undefined; + return message; + }, + fromAmino(object: BroadcastTxResponseAmino): BroadcastTxResponse { + const message = createBaseBroadcastTxResponse(); + if (object.tx_response !== undefined && object.tx_response !== null) { + message.txResponse = TxResponse.fromAmino(object.tx_response); + } + return message; + }, + toAmino(message: BroadcastTxResponse): BroadcastTxResponseAmino { + const obj: any = {}; + obj.tx_response = message.txResponse ? TxResponse.toAmino(message.txResponse) : undefined; return obj; }, fromAminoMsg(object: BroadcastTxResponseAminoMsg): BroadcastTxResponse { @@ -725,14 +1304,26 @@ export const BroadcastTxResponse = { }; } }; +GlobalDecoderRegistry.register(BroadcastTxResponse.typeUrl, BroadcastTxResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(BroadcastTxResponse.aminoType, BroadcastTxResponse.typeUrl); function createBaseSimulateRequest(): SimulateRequest { return { - tx: Tx.fromPartial({}), + tx: undefined, txBytes: new Uint8Array() }; } export const SimulateRequest = { typeUrl: "/cosmos.tx.v1beta1.SimulateRequest", + aminoType: "cosmos-sdk/SimulateRequest", + is(o: any): o is SimulateRequest { + return o && (o.$typeUrl === SimulateRequest.typeUrl || o.txBytes instanceof Uint8Array || typeof o.txBytes === "string"); + }, + isSDK(o: any): o is SimulateRequestSDKType { + return o && (o.$typeUrl === SimulateRequest.typeUrl || o.tx_bytes instanceof Uint8Array || typeof o.tx_bytes === "string"); + }, + isAmino(o: any): o is SimulateRequestAmino { + return o && (o.$typeUrl === SimulateRequest.typeUrl || o.tx_bytes instanceof Uint8Array || typeof o.tx_bytes === "string"); + }, encode(message: SimulateRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.tx !== undefined) { Tx.encode(message.tx, writer.uint32(10).fork()).ldelim(); @@ -762,6 +1353,18 @@ export const SimulateRequest = { } 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() + }; + }, + toJSON(message: SimulateRequest): unknown { + 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; + }, fromPartial(object: Partial): SimulateRequest { const message = createBaseSimulateRequest(); message.tx = object.tx !== undefined && object.tx !== null ? Tx.fromPartial(object.tx) : undefined; @@ -769,15 +1372,19 @@ export const SimulateRequest = { return message; }, fromAmino(object: SimulateRequestAmino): SimulateRequest { - return { - tx: object?.tx ? Tx.fromAmino(object.tx) : undefined, - txBytes: object.tx_bytes - }; + const message = createBaseSimulateRequest(); + if (object.tx !== undefined && object.tx !== null) { + message.tx = Tx.fromAmino(object.tx); + } + if (object.tx_bytes !== undefined && object.tx_bytes !== null) { + message.txBytes = bytesFromBase64(object.tx_bytes); + } + return message; }, toAmino(message: SimulateRequest): SimulateRequestAmino { const obj: any = {}; obj.tx = message.tx ? Tx.toAmino(message.tx) : undefined; - obj.tx_bytes = message.txBytes; + obj.tx_bytes = message.txBytes ? base64FromBytes(message.txBytes) : undefined; return obj; }, fromAminoMsg(object: SimulateRequestAminoMsg): SimulateRequest { @@ -802,14 +1409,26 @@ export const SimulateRequest = { }; } }; +GlobalDecoderRegistry.register(SimulateRequest.typeUrl, SimulateRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(SimulateRequest.aminoType, SimulateRequest.typeUrl); function createBaseSimulateResponse(): SimulateResponse { return { - gasInfo: GasInfo.fromPartial({}), - result: Result.fromPartial({}) + gasInfo: undefined, + result: undefined }; } export const SimulateResponse = { typeUrl: "/cosmos.tx.v1beta1.SimulateResponse", + aminoType: "cosmos-sdk/SimulateResponse", + is(o: any): o is SimulateResponse { + return o && o.$typeUrl === SimulateResponse.typeUrl; + }, + isSDK(o: any): o is SimulateResponseSDKType { + return o && o.$typeUrl === SimulateResponse.typeUrl; + }, + isAmino(o: any): o is SimulateResponseAmino { + return o && o.$typeUrl === SimulateResponse.typeUrl; + }, encode(message: SimulateResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.gasInfo !== undefined) { GasInfo.encode(message.gasInfo, writer.uint32(10).fork()).ldelim(); @@ -839,6 +1458,18 @@ export const SimulateResponse = { } 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; + }, fromPartial(object: Partial): SimulateResponse { const message = createBaseSimulateResponse(); message.gasInfo = object.gasInfo !== undefined && object.gasInfo !== null ? GasInfo.fromPartial(object.gasInfo) : undefined; @@ -846,10 +1477,14 @@ export const SimulateResponse = { return message; }, fromAmino(object: SimulateResponseAmino): SimulateResponse { - return { - gasInfo: object?.gas_info ? GasInfo.fromAmino(object.gas_info) : undefined, - result: object?.result ? Result.fromAmino(object.result) : undefined - }; + const message = createBaseSimulateResponse(); + if (object.gas_info !== undefined && object.gas_info !== null) { + message.gasInfo = GasInfo.fromAmino(object.gas_info); + } + if (object.result !== undefined && object.result !== null) { + message.result = Result.fromAmino(object.result); + } + return message; }, toAmino(message: SimulateResponse): SimulateResponseAmino { const obj: any = {}; @@ -879,6 +1514,8 @@ export const SimulateResponse = { }; } }; +GlobalDecoderRegistry.register(SimulateResponse.typeUrl, SimulateResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(SimulateResponse.aminoType, SimulateResponse.typeUrl); function createBaseGetTxRequest(): GetTxRequest { return { hash: "" @@ -886,6 +1523,16 @@ function createBaseGetTxRequest(): GetTxRequest { } export const GetTxRequest = { typeUrl: "/cosmos.tx.v1beta1.GetTxRequest", + aminoType: "cosmos-sdk/GetTxRequest", + is(o: any): o is GetTxRequest { + return o && (o.$typeUrl === GetTxRequest.typeUrl || typeof o.hash === "string"); + }, + isSDK(o: any): o is GetTxRequestSDKType { + return o && (o.$typeUrl === GetTxRequest.typeUrl || typeof o.hash === "string"); + }, + isAmino(o: any): o is GetTxRequestAmino { + return o && (o.$typeUrl === GetTxRequest.typeUrl || typeof o.hash === "string"); + }, encode(message: GetTxRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.hash !== "") { writer.uint32(10).string(message.hash); @@ -909,15 +1556,27 @@ export const GetTxRequest = { } return message; }, + fromJSON(object: any): GetTxRequest { + return { + hash: isSet(object.hash) ? String(object.hash) : "" + }; + }, + toJSON(message: GetTxRequest): unknown { + const obj: any = {}; + message.hash !== undefined && (obj.hash = message.hash); + return obj; + }, fromPartial(object: Partial): GetTxRequest { const message = createBaseGetTxRequest(); message.hash = object.hash ?? ""; return message; }, fromAmino(object: GetTxRequestAmino): GetTxRequest { - return { - hash: object.hash - }; + const message = createBaseGetTxRequest(); + if (object.hash !== undefined && object.hash !== null) { + message.hash = object.hash; + } + return message; }, toAmino(message: GetTxRequest): GetTxRequestAmino { const obj: any = {}; @@ -946,14 +1605,26 @@ export const GetTxRequest = { }; } }; +GlobalDecoderRegistry.register(GetTxRequest.typeUrl, GetTxRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(GetTxRequest.aminoType, GetTxRequest.typeUrl); function createBaseGetTxResponse(): GetTxResponse { return { - tx: Tx.fromPartial({}), - txResponse: TxResponse.fromPartial({}) + tx: undefined, + txResponse: undefined }; } export const GetTxResponse = { typeUrl: "/cosmos.tx.v1beta1.GetTxResponse", + aminoType: "cosmos-sdk/GetTxResponse", + is(o: any): o is GetTxResponse { + return o && o.$typeUrl === GetTxResponse.typeUrl; + }, + isSDK(o: any): o is GetTxResponseSDKType { + return o && o.$typeUrl === GetTxResponse.typeUrl; + }, + isAmino(o: any): o is GetTxResponseAmino { + return o && o.$typeUrl === GetTxResponse.typeUrl; + }, encode(message: GetTxResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.tx !== undefined) { Tx.encode(message.tx, writer.uint32(10).fork()).ldelim(); @@ -983,6 +1654,18 @@ export const GetTxResponse = { } 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 + }; + }, + toJSON(message: GetTxResponse): unknown { + 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; + }, fromPartial(object: Partial): GetTxResponse { const message = createBaseGetTxResponse(); message.tx = object.tx !== undefined && object.tx !== null ? Tx.fromPartial(object.tx) : undefined; @@ -990,10 +1673,14 @@ export const GetTxResponse = { return message; }, fromAmino(object: GetTxResponseAmino): GetTxResponse { - return { - tx: object?.tx ? Tx.fromAmino(object.tx) : undefined, - txResponse: object?.tx_response ? TxResponse.fromAmino(object.tx_response) : undefined - }; + const message = createBaseGetTxResponse(); + if (object.tx !== undefined && object.tx !== null) { + message.tx = Tx.fromAmino(object.tx); + } + if (object.tx_response !== undefined && object.tx_response !== null) { + message.txResponse = TxResponse.fromAmino(object.tx_response); + } + return message; }, toAmino(message: GetTxResponse): GetTxResponseAmino { const obj: any = {}; @@ -1022,4 +1709,978 @@ export const GetTxResponse = { value: GetTxResponse.encode(message).finish() }; } -}; \ No newline at end of file +}; +GlobalDecoderRegistry.register(GetTxResponse.typeUrl, GetTxResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(GetTxResponse.aminoType, GetTxResponse.typeUrl); +function createBaseGetBlockWithTxsRequest(): GetBlockWithTxsRequest { + return { + height: BigInt(0), + pagination: undefined + }; +} +export const GetBlockWithTxsRequest = { + typeUrl: "/cosmos.tx.v1beta1.GetBlockWithTxsRequest", + aminoType: "cosmos-sdk/GetBlockWithTxsRequest", + is(o: any): o is GetBlockWithTxsRequest { + return o && (o.$typeUrl === GetBlockWithTxsRequest.typeUrl || typeof o.height === "bigint"); + }, + isSDK(o: any): o is GetBlockWithTxsRequestSDKType { + return o && (o.$typeUrl === GetBlockWithTxsRequest.typeUrl || typeof o.height === "bigint"); + }, + isAmino(o: any): o is GetBlockWithTxsRequestAmino { + return o && (o.$typeUrl === GetBlockWithTxsRequest.typeUrl || typeof o.height === "bigint"); + }, + encode(message: GetBlockWithTxsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.height !== BigInt(0)) { + writer.uint32(8).int64(message.height); + } + if (message.pagination !== undefined) { + PageRequest.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): GetBlockWithTxsRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGetBlockWithTxsRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.height = reader.int64(); + break; + case 2: + message.pagination = PageRequest.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): GetBlockWithTxsRequest { + return { + height: isSet(object.height) ? BigInt(object.height.toString()) : BigInt(0), + pagination: isSet(object.pagination) ? PageRequest.fromJSON(object.pagination) : undefined + }; + }, + toJSON(message: GetBlockWithTxsRequest): unknown { + const obj: any = {}; + message.height !== undefined && (obj.height = (message.height || BigInt(0)).toString()); + message.pagination !== undefined && (obj.pagination = message.pagination ? PageRequest.toJSON(message.pagination) : undefined); + return obj; + }, + fromPartial(object: Partial): GetBlockWithTxsRequest { + const message = createBaseGetBlockWithTxsRequest(); + message.height = object.height !== undefined && object.height !== null ? BigInt(object.height.toString()) : BigInt(0); + message.pagination = object.pagination !== undefined && object.pagination !== null ? PageRequest.fromPartial(object.pagination) : undefined; + return message; + }, + fromAmino(object: GetBlockWithTxsRequestAmino): GetBlockWithTxsRequest { + const message = createBaseGetBlockWithTxsRequest(); + if (object.height !== undefined && object.height !== null) { + message.height = BigInt(object.height); + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromAmino(object.pagination); + } + return message; + }, + toAmino(message: GetBlockWithTxsRequest): GetBlockWithTxsRequestAmino { + const obj: any = {}; + obj.height = message.height ? message.height.toString() : undefined; + obj.pagination = message.pagination ? PageRequest.toAmino(message.pagination) : undefined; + return obj; + }, + fromAminoMsg(object: GetBlockWithTxsRequestAminoMsg): GetBlockWithTxsRequest { + return GetBlockWithTxsRequest.fromAmino(object.value); + }, + toAminoMsg(message: GetBlockWithTxsRequest): GetBlockWithTxsRequestAminoMsg { + return { + type: "cosmos-sdk/GetBlockWithTxsRequest", + value: GetBlockWithTxsRequest.toAmino(message) + }; + }, + fromProtoMsg(message: GetBlockWithTxsRequestProtoMsg): GetBlockWithTxsRequest { + return GetBlockWithTxsRequest.decode(message.value); + }, + toProto(message: GetBlockWithTxsRequest): Uint8Array { + return GetBlockWithTxsRequest.encode(message).finish(); + }, + toProtoMsg(message: GetBlockWithTxsRequest): GetBlockWithTxsRequestProtoMsg { + return { + typeUrl: "/cosmos.tx.v1beta1.GetBlockWithTxsRequest", + value: GetBlockWithTxsRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(GetBlockWithTxsRequest.typeUrl, GetBlockWithTxsRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(GetBlockWithTxsRequest.aminoType, GetBlockWithTxsRequest.typeUrl); +function createBaseGetBlockWithTxsResponse(): GetBlockWithTxsResponse { + return { + txs: [], + blockId: undefined, + block: undefined, + pagination: undefined + }; +} +export const GetBlockWithTxsResponse = { + typeUrl: "/cosmos.tx.v1beta1.GetBlockWithTxsResponse", + aminoType: "cosmos-sdk/GetBlockWithTxsResponse", + is(o: any): o is GetBlockWithTxsResponse { + return o && (o.$typeUrl === GetBlockWithTxsResponse.typeUrl || Array.isArray(o.txs) && (!o.txs.length || Tx.is(o.txs[0]))); + }, + isSDK(o: any): o is GetBlockWithTxsResponseSDKType { + return o && (o.$typeUrl === GetBlockWithTxsResponse.typeUrl || Array.isArray(o.txs) && (!o.txs.length || Tx.isSDK(o.txs[0]))); + }, + isAmino(o: any): o is GetBlockWithTxsResponseAmino { + return o && (o.$typeUrl === GetBlockWithTxsResponse.typeUrl || Array.isArray(o.txs) && (!o.txs.length || Tx.isAmino(o.txs[0]))); + }, + encode(message: GetBlockWithTxsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.txs) { + Tx.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.blockId !== undefined) { + BlockID.encode(message.blockId, writer.uint32(18).fork()).ldelim(); + } + if (message.block !== undefined) { + Block.encode(message.block, writer.uint32(26).fork()).ldelim(); + } + if (message.pagination !== undefined) { + PageResponse.encode(message.pagination, writer.uint32(34).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): GetBlockWithTxsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGetBlockWithTxsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.txs.push(Tx.decode(reader, reader.uint32())); + break; + case 2: + message.blockId = BlockID.decode(reader, reader.uint32()); + break; + case 3: + message.block = Block.decode(reader, reader.uint32()); + break; + case 4: + message.pagination = PageResponse.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): GetBlockWithTxsResponse { + return { + 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 + }; + }, + toJSON(message: GetBlockWithTxsResponse): unknown { + const obj: any = {}; + if (message.txs) { + obj.txs = message.txs.map(e => e ? Tx.toJSON(e) : undefined); + } else { + 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.pagination !== undefined && (obj.pagination = message.pagination ? PageResponse.toJSON(message.pagination) : undefined); + return obj; + }, + fromPartial(object: Partial): 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; + }, + fromAmino(object: GetBlockWithTxsResponseAmino): GetBlockWithTxsResponse { + const message = createBaseGetBlockWithTxsResponse(); + message.txs = object.txs?.map(e => Tx.fromAmino(e)) || []; + if (object.block_id !== undefined && object.block_id !== null) { + message.blockId = BlockID.fromAmino(object.block_id); + } + if (object.block !== undefined && object.block !== null) { + message.block = Block.fromAmino(object.block); + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromAmino(object.pagination); + } + return message; + }, + toAmino(message: GetBlockWithTxsResponse): GetBlockWithTxsResponseAmino { + const obj: any = {}; + if (message.txs) { + obj.txs = message.txs.map(e => e ? Tx.toAmino(e) : undefined); + } else { + obj.txs = []; + } + obj.block_id = message.blockId ? BlockID.toAmino(message.blockId) : undefined; + obj.block = message.block ? Block.toAmino(message.block) : undefined; + obj.pagination = message.pagination ? PageResponse.toAmino(message.pagination) : undefined; + return obj; + }, + fromAminoMsg(object: GetBlockWithTxsResponseAminoMsg): GetBlockWithTxsResponse { + return GetBlockWithTxsResponse.fromAmino(object.value); + }, + toAminoMsg(message: GetBlockWithTxsResponse): GetBlockWithTxsResponseAminoMsg { + return { + type: "cosmos-sdk/GetBlockWithTxsResponse", + value: GetBlockWithTxsResponse.toAmino(message) + }; + }, + fromProtoMsg(message: GetBlockWithTxsResponseProtoMsg): GetBlockWithTxsResponse { + return GetBlockWithTxsResponse.decode(message.value); + }, + toProto(message: GetBlockWithTxsResponse): Uint8Array { + return GetBlockWithTxsResponse.encode(message).finish(); + }, + toProtoMsg(message: GetBlockWithTxsResponse): GetBlockWithTxsResponseProtoMsg { + return { + typeUrl: "/cosmos.tx.v1beta1.GetBlockWithTxsResponse", + value: GetBlockWithTxsResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(GetBlockWithTxsResponse.typeUrl, GetBlockWithTxsResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(GetBlockWithTxsResponse.aminoType, GetBlockWithTxsResponse.typeUrl); +function createBaseTxDecodeRequest(): TxDecodeRequest { + return { + txBytes: new Uint8Array() + }; +} +export const TxDecodeRequest = { + typeUrl: "/cosmos.tx.v1beta1.TxDecodeRequest", + aminoType: "cosmos-sdk/TxDecodeRequest", + is(o: any): o is TxDecodeRequest { + return o && (o.$typeUrl === TxDecodeRequest.typeUrl || o.txBytes instanceof Uint8Array || typeof o.txBytes === "string"); + }, + isSDK(o: any): o is TxDecodeRequestSDKType { + return o && (o.$typeUrl === TxDecodeRequest.typeUrl || o.tx_bytes instanceof Uint8Array || typeof o.tx_bytes === "string"); + }, + isAmino(o: any): o is TxDecodeRequestAmino { + return o && (o.$typeUrl === TxDecodeRequest.typeUrl || o.tx_bytes instanceof Uint8Array || typeof o.tx_bytes === "string"); + }, + encode(message: TxDecodeRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.txBytes.length !== 0) { + writer.uint32(10).bytes(message.txBytes); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): TxDecodeRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseTxDecodeRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.txBytes = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): TxDecodeRequest { + return { + txBytes: isSet(object.txBytes) ? bytesFromBase64(object.txBytes) : new Uint8Array() + }; + }, + toJSON(message: TxDecodeRequest): unknown { + const obj: any = {}; + message.txBytes !== undefined && (obj.txBytes = base64FromBytes(message.txBytes !== undefined ? message.txBytes : new Uint8Array())); + return obj; + }, + fromPartial(object: Partial): TxDecodeRequest { + const message = createBaseTxDecodeRequest(); + message.txBytes = object.txBytes ?? new Uint8Array(); + return message; + }, + fromAmino(object: TxDecodeRequestAmino): TxDecodeRequest { + const message = createBaseTxDecodeRequest(); + if (object.tx_bytes !== undefined && object.tx_bytes !== null) { + message.txBytes = bytesFromBase64(object.tx_bytes); + } + return message; + }, + toAmino(message: TxDecodeRequest): TxDecodeRequestAmino { + const obj: any = {}; + obj.tx_bytes = message.txBytes ? base64FromBytes(message.txBytes) : undefined; + return obj; + }, + fromAminoMsg(object: TxDecodeRequestAminoMsg): TxDecodeRequest { + return TxDecodeRequest.fromAmino(object.value); + }, + toAminoMsg(message: TxDecodeRequest): TxDecodeRequestAminoMsg { + return { + type: "cosmos-sdk/TxDecodeRequest", + value: TxDecodeRequest.toAmino(message) + }; + }, + fromProtoMsg(message: TxDecodeRequestProtoMsg): TxDecodeRequest { + return TxDecodeRequest.decode(message.value); + }, + toProto(message: TxDecodeRequest): Uint8Array { + return TxDecodeRequest.encode(message).finish(); + }, + toProtoMsg(message: TxDecodeRequest): TxDecodeRequestProtoMsg { + return { + typeUrl: "/cosmos.tx.v1beta1.TxDecodeRequest", + value: TxDecodeRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(TxDecodeRequest.typeUrl, TxDecodeRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(TxDecodeRequest.aminoType, TxDecodeRequest.typeUrl); +function createBaseTxDecodeResponse(): TxDecodeResponse { + return { + tx: undefined + }; +} +export const TxDecodeResponse = { + typeUrl: "/cosmos.tx.v1beta1.TxDecodeResponse", + aminoType: "cosmos-sdk/TxDecodeResponse", + is(o: any): o is TxDecodeResponse { + return o && o.$typeUrl === TxDecodeResponse.typeUrl; + }, + isSDK(o: any): o is TxDecodeResponseSDKType { + return o && o.$typeUrl === TxDecodeResponse.typeUrl; + }, + isAmino(o: any): o is TxDecodeResponseAmino { + return o && o.$typeUrl === TxDecodeResponse.typeUrl; + }, + encode(message: TxDecodeResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.tx !== undefined) { + Tx.encode(message.tx, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): TxDecodeResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseTxDecodeResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.tx = Tx.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): TxDecodeResponse { + return { + tx: isSet(object.tx) ? Tx.fromJSON(object.tx) : undefined + }; + }, + toJSON(message: TxDecodeResponse): unknown { + const obj: any = {}; + message.tx !== undefined && (obj.tx = message.tx ? Tx.toJSON(message.tx) : undefined); + return obj; + }, + fromPartial(object: Partial): TxDecodeResponse { + const message = createBaseTxDecodeResponse(); + message.tx = object.tx !== undefined && object.tx !== null ? Tx.fromPartial(object.tx) : undefined; + return message; + }, + fromAmino(object: TxDecodeResponseAmino): TxDecodeResponse { + const message = createBaseTxDecodeResponse(); + if (object.tx !== undefined && object.tx !== null) { + message.tx = Tx.fromAmino(object.tx); + } + return message; + }, + toAmino(message: TxDecodeResponse): TxDecodeResponseAmino { + const obj: any = {}; + obj.tx = message.tx ? Tx.toAmino(message.tx) : undefined; + return obj; + }, + fromAminoMsg(object: TxDecodeResponseAminoMsg): TxDecodeResponse { + return TxDecodeResponse.fromAmino(object.value); + }, + toAminoMsg(message: TxDecodeResponse): TxDecodeResponseAminoMsg { + return { + type: "cosmos-sdk/TxDecodeResponse", + value: TxDecodeResponse.toAmino(message) + }; + }, + fromProtoMsg(message: TxDecodeResponseProtoMsg): TxDecodeResponse { + return TxDecodeResponse.decode(message.value); + }, + toProto(message: TxDecodeResponse): Uint8Array { + return TxDecodeResponse.encode(message).finish(); + }, + toProtoMsg(message: TxDecodeResponse): TxDecodeResponseProtoMsg { + return { + typeUrl: "/cosmos.tx.v1beta1.TxDecodeResponse", + value: TxDecodeResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(TxDecodeResponse.typeUrl, TxDecodeResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(TxDecodeResponse.aminoType, TxDecodeResponse.typeUrl); +function createBaseTxEncodeRequest(): TxEncodeRequest { + return { + tx: undefined + }; +} +export const TxEncodeRequest = { + typeUrl: "/cosmos.tx.v1beta1.TxEncodeRequest", + aminoType: "cosmos-sdk/TxEncodeRequest", + is(o: any): o is TxEncodeRequest { + return o && o.$typeUrl === TxEncodeRequest.typeUrl; + }, + isSDK(o: any): o is TxEncodeRequestSDKType { + return o && o.$typeUrl === TxEncodeRequest.typeUrl; + }, + isAmino(o: any): o is TxEncodeRequestAmino { + return o && o.$typeUrl === TxEncodeRequest.typeUrl; + }, + encode(message: TxEncodeRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.tx !== undefined) { + Tx.encode(message.tx, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): TxEncodeRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseTxEncodeRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.tx = Tx.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): TxEncodeRequest { + return { + tx: isSet(object.tx) ? Tx.fromJSON(object.tx) : undefined + }; + }, + toJSON(message: TxEncodeRequest): unknown { + const obj: any = {}; + message.tx !== undefined && (obj.tx = message.tx ? Tx.toJSON(message.tx) : undefined); + return obj; + }, + fromPartial(object: Partial): TxEncodeRequest { + const message = createBaseTxEncodeRequest(); + message.tx = object.tx !== undefined && object.tx !== null ? Tx.fromPartial(object.tx) : undefined; + return message; + }, + fromAmino(object: TxEncodeRequestAmino): TxEncodeRequest { + const message = createBaseTxEncodeRequest(); + if (object.tx !== undefined && object.tx !== null) { + message.tx = Tx.fromAmino(object.tx); + } + return message; + }, + toAmino(message: TxEncodeRequest): TxEncodeRequestAmino { + const obj: any = {}; + obj.tx = message.tx ? Tx.toAmino(message.tx) : undefined; + return obj; + }, + fromAminoMsg(object: TxEncodeRequestAminoMsg): TxEncodeRequest { + return TxEncodeRequest.fromAmino(object.value); + }, + toAminoMsg(message: TxEncodeRequest): TxEncodeRequestAminoMsg { + return { + type: "cosmos-sdk/TxEncodeRequest", + value: TxEncodeRequest.toAmino(message) + }; + }, + fromProtoMsg(message: TxEncodeRequestProtoMsg): TxEncodeRequest { + return TxEncodeRequest.decode(message.value); + }, + toProto(message: TxEncodeRequest): Uint8Array { + return TxEncodeRequest.encode(message).finish(); + }, + toProtoMsg(message: TxEncodeRequest): TxEncodeRequestProtoMsg { + return { + typeUrl: "/cosmos.tx.v1beta1.TxEncodeRequest", + value: TxEncodeRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(TxEncodeRequest.typeUrl, TxEncodeRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(TxEncodeRequest.aminoType, TxEncodeRequest.typeUrl); +function createBaseTxEncodeResponse(): TxEncodeResponse { + return { + txBytes: new Uint8Array() + }; +} +export const TxEncodeResponse = { + typeUrl: "/cosmos.tx.v1beta1.TxEncodeResponse", + aminoType: "cosmos-sdk/TxEncodeResponse", + is(o: any): o is TxEncodeResponse { + return o && (o.$typeUrl === TxEncodeResponse.typeUrl || o.txBytes instanceof Uint8Array || typeof o.txBytes === "string"); + }, + isSDK(o: any): o is TxEncodeResponseSDKType { + return o && (o.$typeUrl === TxEncodeResponse.typeUrl || o.tx_bytes instanceof Uint8Array || typeof o.tx_bytes === "string"); + }, + isAmino(o: any): o is TxEncodeResponseAmino { + return o && (o.$typeUrl === TxEncodeResponse.typeUrl || o.tx_bytes instanceof Uint8Array || typeof o.tx_bytes === "string"); + }, + encode(message: TxEncodeResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.txBytes.length !== 0) { + writer.uint32(10).bytes(message.txBytes); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): TxEncodeResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseTxEncodeResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.txBytes = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): TxEncodeResponse { + return { + txBytes: isSet(object.txBytes) ? bytesFromBase64(object.txBytes) : new Uint8Array() + }; + }, + toJSON(message: TxEncodeResponse): unknown { + const obj: any = {}; + message.txBytes !== undefined && (obj.txBytes = base64FromBytes(message.txBytes !== undefined ? message.txBytes : new Uint8Array())); + return obj; + }, + fromPartial(object: Partial): TxEncodeResponse { + const message = createBaseTxEncodeResponse(); + message.txBytes = object.txBytes ?? new Uint8Array(); + return message; + }, + fromAmino(object: TxEncodeResponseAmino): TxEncodeResponse { + const message = createBaseTxEncodeResponse(); + if (object.tx_bytes !== undefined && object.tx_bytes !== null) { + message.txBytes = bytesFromBase64(object.tx_bytes); + } + return message; + }, + toAmino(message: TxEncodeResponse): TxEncodeResponseAmino { + const obj: any = {}; + obj.tx_bytes = message.txBytes ? base64FromBytes(message.txBytes) : undefined; + return obj; + }, + fromAminoMsg(object: TxEncodeResponseAminoMsg): TxEncodeResponse { + return TxEncodeResponse.fromAmino(object.value); + }, + toAminoMsg(message: TxEncodeResponse): TxEncodeResponseAminoMsg { + return { + type: "cosmos-sdk/TxEncodeResponse", + value: TxEncodeResponse.toAmino(message) + }; + }, + fromProtoMsg(message: TxEncodeResponseProtoMsg): TxEncodeResponse { + return TxEncodeResponse.decode(message.value); + }, + toProto(message: TxEncodeResponse): Uint8Array { + return TxEncodeResponse.encode(message).finish(); + }, + toProtoMsg(message: TxEncodeResponse): TxEncodeResponseProtoMsg { + return { + typeUrl: "/cosmos.tx.v1beta1.TxEncodeResponse", + value: TxEncodeResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(TxEncodeResponse.typeUrl, TxEncodeResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(TxEncodeResponse.aminoType, TxEncodeResponse.typeUrl); +function createBaseTxEncodeAminoRequest(): TxEncodeAminoRequest { + return { + aminoJson: "" + }; +} +export const TxEncodeAminoRequest = { + typeUrl: "/cosmos.tx.v1beta1.TxEncodeAminoRequest", + aminoType: "cosmos-sdk/TxEncodeAminoRequest", + is(o: any): o is TxEncodeAminoRequest { + return o && (o.$typeUrl === TxEncodeAminoRequest.typeUrl || typeof o.aminoJson === "string"); + }, + isSDK(o: any): o is TxEncodeAminoRequestSDKType { + return o && (o.$typeUrl === TxEncodeAminoRequest.typeUrl || typeof o.amino_json === "string"); + }, + isAmino(o: any): o is TxEncodeAminoRequestAmino { + return o && (o.$typeUrl === TxEncodeAminoRequest.typeUrl || typeof o.amino_json === "string"); + }, + encode(message: TxEncodeAminoRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.aminoJson !== "") { + writer.uint32(10).string(message.aminoJson); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): TxEncodeAminoRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseTxEncodeAminoRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.aminoJson = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): TxEncodeAminoRequest { + return { + aminoJson: isSet(object.aminoJson) ? String(object.aminoJson) : "" + }; + }, + toJSON(message: TxEncodeAminoRequest): unknown { + const obj: any = {}; + message.aminoJson !== undefined && (obj.aminoJson = message.aminoJson); + return obj; + }, + fromPartial(object: Partial): TxEncodeAminoRequest { + const message = createBaseTxEncodeAminoRequest(); + message.aminoJson = object.aminoJson ?? ""; + return message; + }, + fromAmino(object: TxEncodeAminoRequestAmino): TxEncodeAminoRequest { + const message = createBaseTxEncodeAminoRequest(); + if (object.amino_json !== undefined && object.amino_json !== null) { + message.aminoJson = object.amino_json; + } + return message; + }, + toAmino(message: TxEncodeAminoRequest): TxEncodeAminoRequestAmino { + const obj: any = {}; + obj.amino_json = message.aminoJson; + return obj; + }, + fromAminoMsg(object: TxEncodeAminoRequestAminoMsg): TxEncodeAminoRequest { + return TxEncodeAminoRequest.fromAmino(object.value); + }, + toAminoMsg(message: TxEncodeAminoRequest): TxEncodeAminoRequestAminoMsg { + return { + type: "cosmos-sdk/TxEncodeAminoRequest", + value: TxEncodeAminoRequest.toAmino(message) + }; + }, + fromProtoMsg(message: TxEncodeAminoRequestProtoMsg): TxEncodeAminoRequest { + return TxEncodeAminoRequest.decode(message.value); + }, + toProto(message: TxEncodeAminoRequest): Uint8Array { + return TxEncodeAminoRequest.encode(message).finish(); + }, + toProtoMsg(message: TxEncodeAminoRequest): TxEncodeAminoRequestProtoMsg { + return { + typeUrl: "/cosmos.tx.v1beta1.TxEncodeAminoRequest", + value: TxEncodeAminoRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(TxEncodeAminoRequest.typeUrl, TxEncodeAminoRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(TxEncodeAminoRequest.aminoType, TxEncodeAminoRequest.typeUrl); +function createBaseTxEncodeAminoResponse(): TxEncodeAminoResponse { + return { + aminoBinary: new Uint8Array() + }; +} +export const TxEncodeAminoResponse = { + typeUrl: "/cosmos.tx.v1beta1.TxEncodeAminoResponse", + aminoType: "cosmos-sdk/TxEncodeAminoResponse", + is(o: any): o is TxEncodeAminoResponse { + return o && (o.$typeUrl === TxEncodeAminoResponse.typeUrl || o.aminoBinary instanceof Uint8Array || typeof o.aminoBinary === "string"); + }, + isSDK(o: any): o is TxEncodeAminoResponseSDKType { + return o && (o.$typeUrl === TxEncodeAminoResponse.typeUrl || o.amino_binary instanceof Uint8Array || typeof o.amino_binary === "string"); + }, + isAmino(o: any): o is TxEncodeAminoResponseAmino { + return o && (o.$typeUrl === TxEncodeAminoResponse.typeUrl || o.amino_binary instanceof Uint8Array || typeof o.amino_binary === "string"); + }, + encode(message: TxEncodeAminoResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.aminoBinary.length !== 0) { + writer.uint32(10).bytes(message.aminoBinary); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): TxEncodeAminoResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseTxEncodeAminoResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.aminoBinary = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): TxEncodeAminoResponse { + return { + aminoBinary: isSet(object.aminoBinary) ? bytesFromBase64(object.aminoBinary) : new Uint8Array() + }; + }, + toJSON(message: TxEncodeAminoResponse): unknown { + const obj: any = {}; + message.aminoBinary !== undefined && (obj.aminoBinary = base64FromBytes(message.aminoBinary !== undefined ? message.aminoBinary : new Uint8Array())); + return obj; + }, + fromPartial(object: Partial): TxEncodeAminoResponse { + const message = createBaseTxEncodeAminoResponse(); + message.aminoBinary = object.aminoBinary ?? new Uint8Array(); + return message; + }, + fromAmino(object: TxEncodeAminoResponseAmino): TxEncodeAminoResponse { + const message = createBaseTxEncodeAminoResponse(); + if (object.amino_binary !== undefined && object.amino_binary !== null) { + message.aminoBinary = bytesFromBase64(object.amino_binary); + } + return message; + }, + toAmino(message: TxEncodeAminoResponse): TxEncodeAminoResponseAmino { + const obj: any = {}; + obj.amino_binary = message.aminoBinary ? base64FromBytes(message.aminoBinary) : undefined; + return obj; + }, + fromAminoMsg(object: TxEncodeAminoResponseAminoMsg): TxEncodeAminoResponse { + return TxEncodeAminoResponse.fromAmino(object.value); + }, + toAminoMsg(message: TxEncodeAminoResponse): TxEncodeAminoResponseAminoMsg { + return { + type: "cosmos-sdk/TxEncodeAminoResponse", + value: TxEncodeAminoResponse.toAmino(message) + }; + }, + fromProtoMsg(message: TxEncodeAminoResponseProtoMsg): TxEncodeAminoResponse { + return TxEncodeAminoResponse.decode(message.value); + }, + toProto(message: TxEncodeAminoResponse): Uint8Array { + return TxEncodeAminoResponse.encode(message).finish(); + }, + toProtoMsg(message: TxEncodeAminoResponse): TxEncodeAminoResponseProtoMsg { + return { + typeUrl: "/cosmos.tx.v1beta1.TxEncodeAminoResponse", + value: TxEncodeAminoResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(TxEncodeAminoResponse.typeUrl, TxEncodeAminoResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(TxEncodeAminoResponse.aminoType, TxEncodeAminoResponse.typeUrl); +function createBaseTxDecodeAminoRequest(): TxDecodeAminoRequest { + return { + aminoBinary: new Uint8Array() + }; +} +export const TxDecodeAminoRequest = { + typeUrl: "/cosmos.tx.v1beta1.TxDecodeAminoRequest", + aminoType: "cosmos-sdk/TxDecodeAminoRequest", + is(o: any): o is TxDecodeAminoRequest { + return o && (o.$typeUrl === TxDecodeAminoRequest.typeUrl || o.aminoBinary instanceof Uint8Array || typeof o.aminoBinary === "string"); + }, + isSDK(o: any): o is TxDecodeAminoRequestSDKType { + return o && (o.$typeUrl === TxDecodeAminoRequest.typeUrl || o.amino_binary instanceof Uint8Array || typeof o.amino_binary === "string"); + }, + isAmino(o: any): o is TxDecodeAminoRequestAmino { + return o && (o.$typeUrl === TxDecodeAminoRequest.typeUrl || o.amino_binary instanceof Uint8Array || typeof o.amino_binary === "string"); + }, + encode(message: TxDecodeAminoRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.aminoBinary.length !== 0) { + writer.uint32(10).bytes(message.aminoBinary); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): TxDecodeAminoRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseTxDecodeAminoRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.aminoBinary = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): TxDecodeAminoRequest { + return { + aminoBinary: isSet(object.aminoBinary) ? bytesFromBase64(object.aminoBinary) : new Uint8Array() + }; + }, + toJSON(message: TxDecodeAminoRequest): unknown { + const obj: any = {}; + message.aminoBinary !== undefined && (obj.aminoBinary = base64FromBytes(message.aminoBinary !== undefined ? message.aminoBinary : new Uint8Array())); + return obj; + }, + fromPartial(object: Partial): TxDecodeAminoRequest { + const message = createBaseTxDecodeAminoRequest(); + message.aminoBinary = object.aminoBinary ?? new Uint8Array(); + return message; + }, + fromAmino(object: TxDecodeAminoRequestAmino): TxDecodeAminoRequest { + const message = createBaseTxDecodeAminoRequest(); + if (object.amino_binary !== undefined && object.amino_binary !== null) { + message.aminoBinary = bytesFromBase64(object.amino_binary); + } + return message; + }, + toAmino(message: TxDecodeAminoRequest): TxDecodeAminoRequestAmino { + const obj: any = {}; + obj.amino_binary = message.aminoBinary ? base64FromBytes(message.aminoBinary) : undefined; + return obj; + }, + fromAminoMsg(object: TxDecodeAminoRequestAminoMsg): TxDecodeAminoRequest { + return TxDecodeAminoRequest.fromAmino(object.value); + }, + toAminoMsg(message: TxDecodeAminoRequest): TxDecodeAminoRequestAminoMsg { + return { + type: "cosmos-sdk/TxDecodeAminoRequest", + value: TxDecodeAminoRequest.toAmino(message) + }; + }, + fromProtoMsg(message: TxDecodeAminoRequestProtoMsg): TxDecodeAminoRequest { + return TxDecodeAminoRequest.decode(message.value); + }, + toProto(message: TxDecodeAminoRequest): Uint8Array { + return TxDecodeAminoRequest.encode(message).finish(); + }, + toProtoMsg(message: TxDecodeAminoRequest): TxDecodeAminoRequestProtoMsg { + return { + typeUrl: "/cosmos.tx.v1beta1.TxDecodeAminoRequest", + value: TxDecodeAminoRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(TxDecodeAminoRequest.typeUrl, TxDecodeAminoRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(TxDecodeAminoRequest.aminoType, TxDecodeAminoRequest.typeUrl); +function createBaseTxDecodeAminoResponse(): TxDecodeAminoResponse { + return { + aminoJson: "" + }; +} +export const TxDecodeAminoResponse = { + typeUrl: "/cosmos.tx.v1beta1.TxDecodeAminoResponse", + aminoType: "cosmos-sdk/TxDecodeAminoResponse", + is(o: any): o is TxDecodeAminoResponse { + return o && (o.$typeUrl === TxDecodeAminoResponse.typeUrl || typeof o.aminoJson === "string"); + }, + isSDK(o: any): o is TxDecodeAminoResponseSDKType { + return o && (o.$typeUrl === TxDecodeAminoResponse.typeUrl || typeof o.amino_json === "string"); + }, + isAmino(o: any): o is TxDecodeAminoResponseAmino { + return o && (o.$typeUrl === TxDecodeAminoResponse.typeUrl || typeof o.amino_json === "string"); + }, + encode(message: TxDecodeAminoResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.aminoJson !== "") { + writer.uint32(10).string(message.aminoJson); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): TxDecodeAminoResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseTxDecodeAminoResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.aminoJson = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): TxDecodeAminoResponse { + return { + aminoJson: isSet(object.aminoJson) ? String(object.aminoJson) : "" + }; + }, + toJSON(message: TxDecodeAminoResponse): unknown { + const obj: any = {}; + message.aminoJson !== undefined && (obj.aminoJson = message.aminoJson); + return obj; + }, + fromPartial(object: Partial): TxDecodeAminoResponse { + const message = createBaseTxDecodeAminoResponse(); + message.aminoJson = object.aminoJson ?? ""; + return message; + }, + fromAmino(object: TxDecodeAminoResponseAmino): TxDecodeAminoResponse { + const message = createBaseTxDecodeAminoResponse(); + if (object.amino_json !== undefined && object.amino_json !== null) { + message.aminoJson = object.amino_json; + } + return message; + }, + toAmino(message: TxDecodeAminoResponse): TxDecodeAminoResponseAmino { + const obj: any = {}; + obj.amino_json = message.aminoJson; + return obj; + }, + fromAminoMsg(object: TxDecodeAminoResponseAminoMsg): TxDecodeAminoResponse { + return TxDecodeAminoResponse.fromAmino(object.value); + }, + toAminoMsg(message: TxDecodeAminoResponse): TxDecodeAminoResponseAminoMsg { + return { + type: "cosmos-sdk/TxDecodeAminoResponse", + value: TxDecodeAminoResponse.toAmino(message) + }; + }, + fromProtoMsg(message: TxDecodeAminoResponseProtoMsg): TxDecodeAminoResponse { + return TxDecodeAminoResponse.decode(message.value); + }, + toProto(message: TxDecodeAminoResponse): Uint8Array { + return TxDecodeAminoResponse.encode(message).finish(); + }, + toProtoMsg(message: TxDecodeAminoResponse): TxDecodeAminoResponseProtoMsg { + return { + typeUrl: "/cosmos.tx.v1beta1.TxDecodeAminoResponse", + value: TxDecodeAminoResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(TxDecodeAminoResponse.typeUrl, TxDecodeAminoResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(TxDecodeAminoResponse.aminoType, TxDecodeAminoResponse.typeUrl); \ No newline at end of file diff --git a/packages/osmojs/src/codegen/cosmos/tx/v1beta1/tx.ts b/packages/osmojs/src/codegen/cosmos/tx/v1beta1/tx.ts index ff8d62545..4f0d74e71 100644 --- a/packages/osmojs/src/codegen/cosmos/tx/v1beta1/tx.ts +++ b/packages/osmojs/src/codegen/cosmos/tx/v1beta1/tx.ts @@ -1,18 +1,19 @@ import { Any, AnyAmino, AnySDKType } from "../../../google/protobuf/any"; -import { SignMode, signModeFromJSON } from "../signing/v1beta1/signing"; +import { SignMode, signModeFromJSON, signModeToJSON } from "../signing/v1beta1/signing"; import { CompactBitArray, CompactBitArrayAmino, CompactBitArraySDKType } from "../../crypto/multisig/v1beta1/multisig"; import { Coin, CoinAmino, CoinSDKType } from "../../base/v1beta1/coin"; import { BinaryReader, BinaryWriter } from "../../../binary"; -import { isSet } from "../../../helpers"; +import { isSet, bytesFromBase64, base64FromBytes } from "../../../helpers"; +import { GlobalDecoderRegistry } from "../../../registry"; /** 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 @@ -38,7 +39,7 @@ export interface TxAmino { * AuthInfo's signer_infos to allow connecting signature meta information like * public key and signing mode by position. */ - signatures: Uint8Array[]; + signatures?: string[]; } export interface TxAminoMsg { type: "cosmos-sdk/Tx"; @@ -46,8 +47,8 @@ export interface TxAminoMsg { } /** Tx is the standard type used for broadcasting transactions. */ export interface TxSDKType { - body: TxBodySDKType; - auth_info: AuthInfoSDKType; + body?: TxBodySDKType; + auth_info?: AuthInfoSDKType; signatures: Uint8Array[]; } /** @@ -91,18 +92,18 @@ export interface TxRawAmino { * body_bytes is a protobuf serialization of a TxBody that matches the * representation in SignDoc. */ - body_bytes: Uint8Array; + body_bytes?: string; /** * auth_info_bytes is a protobuf serialization of an AuthInfo that matches the * representation in SignDoc. */ - auth_info_bytes: Uint8Array; + auth_info_bytes?: string; /** * 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?: string[]; } export interface TxRawAminoMsg { type: "cosmos-sdk/TxRaw"; @@ -151,20 +152,20 @@ export interface SignDocAmino { * body_bytes is protobuf serialization of a TxBody that matches the * representation in TxRaw. */ - body_bytes: Uint8Array; + body_bytes?: string; /** * auth_info_bytes is a protobuf serialization of an AuthInfo that matches the * representation in TxRaw. */ - auth_info_bytes: Uint8Array; + auth_info_bytes?: string; /** * 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 */ - chain_id: string; + chain_id?: string; /** account_number is the account number of the account in state */ - account_number: string; + account_number?: string; } export interface SignDocAminoMsg { type: "cosmos-sdk/SignDoc"; @@ -177,6 +178,96 @@ export interface SignDocSDKType { chain_id: string; account_number: bigint; } +/** + * SignDocDirectAux is the type used for generating sign bytes for + * SIGN_MODE_DIRECT_AUX. + * + * Since: cosmos-sdk 0.46 + */ +export interface SignDocDirectAux { + /** + * body_bytes is protobuf serialization of a TxBody that matches the + * representation in TxRaw. + */ + bodyBytes: Uint8Array; + /** public_key is the public key of the signing account. */ + publicKey?: Any; + /** + * chain_id is the identifier of the chain this transaction targets. + * It prevents signed transactions from being used on another chain by an + * attacker. + */ + chainId: string; + /** account_number is the account number of the account in state. */ + accountNumber: bigint; + /** sequence is the sequence number of the signing account. */ + sequence: bigint; + /** + * Tip is the optional tip used for transactions fees paid in another denom. + * It should be left empty if the signer is not the tipper for this + * transaction. + * + * This field is ignored if the chain didn't enable tips, i.e. didn't add the + * `TipDecorator` in its posthandler. + */ + tip?: Tip; +} +export interface SignDocDirectAuxProtoMsg { + typeUrl: "/cosmos.tx.v1beta1.SignDocDirectAux"; + value: Uint8Array; +} +/** + * SignDocDirectAux is the type used for generating sign bytes for + * SIGN_MODE_DIRECT_AUX. + * + * Since: cosmos-sdk 0.46 + */ +export interface SignDocDirectAuxAmino { + /** + * body_bytes is protobuf serialization of a TxBody that matches the + * representation in TxRaw. + */ + body_bytes?: string; + /** public_key is the public key of the signing account. */ + public_key?: AnyAmino; + /** + * chain_id is the identifier of the chain this transaction targets. + * It prevents signed transactions from being used on another chain by an + * attacker. + */ + chain_id?: string; + /** account_number is the account number of the account in state. */ + account_number?: string; + /** sequence is the sequence number of the signing account. */ + sequence?: string; + /** + * Tip is the optional tip used for transactions fees paid in another denom. + * It should be left empty if the signer is not the tipper for this + * transaction. + * + * This field is ignored if the chain didn't enable tips, i.e. didn't add the + * `TipDecorator` in its posthandler. + */ + tip?: TipAmino; +} +export interface SignDocDirectAuxAminoMsg { + type: "cosmos-sdk/SignDocDirectAux"; + value: SignDocDirectAuxAmino; +} +/** + * SignDocDirectAux is the type used for generating sign bytes for + * SIGN_MODE_DIRECT_AUX. + * + * Since: cosmos-sdk 0.46 + */ +export interface SignDocDirectAuxSDKType { + body_bytes: Uint8Array; + public_key?: AnySDKType; + chain_id: string; + account_number: bigint; + sequence: bigint; + tip?: TipSDKType; +} /** TxBody is the body of a transaction that all signers sign over. */ export interface TxBody { /** @@ -228,30 +319,30 @@ export interface TxBodyAmino { * is referred to as the primary signer and pays the fee for the whole * transaction. */ - messages: AnyAmino[]; + messages?: AnyAmino[]; /** * 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 */ - timeout_height: string; + timeout_height?: string; /** * 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 */ - extension_options: AnyAmino[]; + extension_options?: AnyAmino[]; /** * 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 */ - non_critical_extension_options: AnyAmino[]; + non_critical_extension_options?: AnyAmino[]; } export interface TxBodyAminoMsg { type: "cosmos-sdk/TxBody"; @@ -283,7 +374,16 @@ export interface AuthInfo { * 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; + /** + * Tip is the optional tip used for transactions fees paid in another denom. + * + * This field is ignored if the chain didn't enable tips, i.e. didn't add the + * `TipDecorator` in its posthandler. + * + * Since: cosmos-sdk 0.46 + */ + tip?: Tip; } export interface AuthInfoProtoMsg { typeUrl: "/cosmos.tx.v1beta1.AuthInfo"; @@ -300,7 +400,7 @@ export interface AuthInfoAmino { * messages. The first element is the primary signer and the one which pays * the fee. */ - signer_infos: SignerInfoAmino[]; + signer_infos?: SignerInfoAmino[]; /** * 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 @@ -308,6 +408,15 @@ export interface AuthInfoAmino { * of the signers. This can be estimated via simulation. */ fee?: FeeAmino; + /** + * Tip is the optional tip used for transactions fees paid in another denom. + * + * This field is ignored if the chain didn't enable tips, i.e. didn't add the + * `TipDecorator` in its posthandler. + * + * Since: cosmos-sdk 0.46 + */ + tip?: TipAmino; } export interface AuthInfoAminoMsg { type: "cosmos-sdk/AuthInfo"; @@ -319,7 +428,8 @@ export interface AuthInfoAminoMsg { */ export interface AuthInfoSDKType { signer_infos: SignerInfoSDKType[]; - fee: FeeSDKType; + fee?: FeeSDKType; + tip?: TipSDKType; } /** * SignerInfo describes the public key and signing mode of a single top-level @@ -331,12 +441,12 @@ 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 @@ -369,7 +479,7 @@ export interface SignerInfoAmino { * number of committed transactions signed by a given address. It is used to * prevent replay attacks. */ - sequence: string; + sequence?: string; } export interface SignerInfoAminoMsg { type: "cosmos-sdk/SignerInfo"; @@ -380,8 +490,8 @@ export interface SignerInfoAminoMsg { * signer. */ export interface SignerInfoSDKType { - public_key: AnySDKType; - mode_info: ModeInfoSDKType; + public_key?: AnySDKType; + mode_info?: ModeInfoSDKType; sequence: bigint; } /** ModeInfo describes the signing mode of a single or nested multisig signer. */ @@ -431,7 +541,7 @@ export interface ModeInfo_SingleProtoMsg { */ export interface ModeInfo_SingleAmino { /** mode is the signing mode of the single signer */ - mode: SignMode; + mode?: SignMode; } export interface ModeInfo_SingleAminoMsg { type: "cosmos-sdk/Single"; @@ -448,7 +558,7 @@ export interface ModeInfo_SingleSDKType { /** 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 @@ -467,7 +577,7 @@ export interface ModeInfo_MultiAmino { * mode_infos is the corresponding modes of the signers of the multisig * which could include nested multisig public keys */ - mode_infos: ModeInfoAmino[]; + mode_infos?: ModeInfoAmino[]; } export interface ModeInfo_MultiAminoMsg { type: "cosmos-sdk/Multi"; @@ -475,7 +585,7 @@ export interface ModeInfo_MultiAminoMsg { } /** Multi is the mode info for a multisig public key */ export interface ModeInfo_MultiSDKType { - bitarray: CompactBitArraySDKType; + bitarray?: CompactBitArraySDKType; mode_infos: ModeInfoSDKType[]; } /** @@ -515,24 +625,24 @@ export interface FeeProtoMsg { */ export interface FeeAmino { /** amount is the amount of coins to be paid as a fee */ - amount: CoinAmino[]; + amount?: CoinAmino[]; /** * gas_limit is the maximum gas that can be used in transaction processing * before an out of gas error occurs */ - gas_limit: string; + gas_limit?: string; /** * 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; } export interface FeeAminoMsg { type: "cosmos-sdk/Fee"; @@ -549,15 +659,138 @@ export interface FeeSDKType { payer: string; granter: string; } +/** + * Tip is the tip used for meta-transactions. + * + * Since: cosmos-sdk 0.46 + */ +export interface Tip { + /** amount is the amount of the tip */ + amount: Coin[]; + /** tipper is the address of the account paying for the tip */ + tipper: string; +} +export interface TipProtoMsg { + typeUrl: "/cosmos.tx.v1beta1.Tip"; + value: Uint8Array; +} +/** + * Tip is the tip used for meta-transactions. + * + * Since: cosmos-sdk 0.46 + */ +export interface TipAmino { + /** amount is the amount of the tip */ + amount?: CoinAmino[]; + /** tipper is the address of the account paying for the tip */ + tipper?: string; +} +export interface TipAminoMsg { + type: "cosmos-sdk/Tip"; + value: TipAmino; +} +/** + * Tip is the tip used for meta-transactions. + * + * Since: cosmos-sdk 0.46 + */ +export interface TipSDKType { + amount: CoinSDKType[]; + tipper: string; +} +/** + * AuxSignerData is the intermediary format that an auxiliary signer (e.g. a + * tipper) builds and sends to the fee payer (who will build and broadcast the + * actual tx). AuxSignerData is not a valid tx in itself, and will be rejected + * by the node if sent directly as-is. + * + * Since: cosmos-sdk 0.46 + */ +export interface AuxSignerData { + /** + * address is the bech32-encoded address of the auxiliary signer. If using + * AuxSignerData across different chains, the bech32 prefix of the target + * chain (where the final transaction is broadcasted) should be used. + */ + address: string; + /** + * sign_doc is the SIGN_MODE_DIRECT_AUX sign doc that the auxiliary signer + * signs. Note: we use the same sign doc even if we're signing with + * LEGACY_AMINO_JSON. + */ + signDoc?: SignDocDirectAux; + /** mode is the signing mode of the single signer. */ + mode: SignMode; + /** sig is the signature of the sign doc. */ + sig: Uint8Array; +} +export interface AuxSignerDataProtoMsg { + typeUrl: "/cosmos.tx.v1beta1.AuxSignerData"; + value: Uint8Array; +} +/** + * AuxSignerData is the intermediary format that an auxiliary signer (e.g. a + * tipper) builds and sends to the fee payer (who will build and broadcast the + * actual tx). AuxSignerData is not a valid tx in itself, and will be rejected + * by the node if sent directly as-is. + * + * Since: cosmos-sdk 0.46 + */ +export interface AuxSignerDataAmino { + /** + * address is the bech32-encoded address of the auxiliary signer. If using + * AuxSignerData across different chains, the bech32 prefix of the target + * chain (where the final transaction is broadcasted) should be used. + */ + address?: string; + /** + * sign_doc is the SIGN_MODE_DIRECT_AUX sign doc that the auxiliary signer + * signs. Note: we use the same sign doc even if we're signing with + * LEGACY_AMINO_JSON. + */ + sign_doc?: SignDocDirectAuxAmino; + /** mode is the signing mode of the single signer. */ + mode?: SignMode; + /** sig is the signature of the sign doc. */ + sig?: string; +} +export interface AuxSignerDataAminoMsg { + type: "cosmos-sdk/AuxSignerData"; + value: AuxSignerDataAmino; +} +/** + * AuxSignerData is the intermediary format that an auxiliary signer (e.g. a + * tipper) builds and sends to the fee payer (who will build and broadcast the + * actual tx). AuxSignerData is not a valid tx in itself, and will be rejected + * by the node if sent directly as-is. + * + * Since: cosmos-sdk 0.46 + */ +export interface AuxSignerDataSDKType { + address: string; + sign_doc?: SignDocDirectAuxSDKType; + mode: SignMode; + sig: Uint8Array; +} function createBaseTx(): Tx { return { - body: TxBody.fromPartial({}), - authInfo: AuthInfo.fromPartial({}), + body: undefined, + authInfo: undefined, signatures: [] }; } export const Tx = { typeUrl: "/cosmos.tx.v1beta1.Tx", + aminoType: "cosmos-sdk/Tx", + is(o: any): o is Tx { + return o && (o.$typeUrl === Tx.typeUrl || Array.isArray(o.signatures) && (!o.signatures.length || o.signatures[0] instanceof Uint8Array || typeof o.signatures[0] === "string")); + }, + isSDK(o: any): o is TxSDKType { + return o && (o.$typeUrl === Tx.typeUrl || Array.isArray(o.signatures) && (!o.signatures.length || o.signatures[0] instanceof Uint8Array || typeof o.signatures[0] === "string")); + }, + isAmino(o: any): o is TxAmino { + return o && (o.$typeUrl === Tx.typeUrl || Array.isArray(o.signatures) && (!o.signatures.length || o.signatures[0] instanceof Uint8Array || typeof o.signatures[0] === "string")); + }, encode(message: Tx, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.body !== undefined) { TxBody.encode(message.body, writer.uint32(10).fork()).ldelim(); @@ -593,6 +826,24 @@ export const Tx = { } 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)) : [] + }; + }, + toJSON(message: Tx): unknown { + const obj: any = {}; + message.body !== undefined && (obj.body = message.body ? TxBody.toJSON(message.body) : undefined); + message.authInfo !== undefined && (obj.authInfo = message.authInfo ? AuthInfo.toJSON(message.authInfo) : undefined); + if (message.signatures) { + obj.signatures = message.signatures.map(e => base64FromBytes(e !== undefined ? e : new Uint8Array())); + } else { + obj.signatures = []; + } + return obj; + }, fromPartial(object: Partial): Tx { const message = createBaseTx(); message.body = object.body !== undefined && object.body !== null ? TxBody.fromPartial(object.body) : undefined; @@ -601,18 +852,22 @@ export const Tx = { return message; }, fromAmino(object: TxAmino): Tx { - return { - body: object?.body ? TxBody.fromAmino(object.body) : undefined, - authInfo: object?.auth_info ? AuthInfo.fromAmino(object.auth_info) : undefined, - signatures: Array.isArray(object?.signatures) ? object.signatures.map((e: any) => e) : [] - }; + const message = createBaseTx(); + if (object.body !== undefined && object.body !== null) { + message.body = TxBody.fromAmino(object.body); + } + if (object.auth_info !== undefined && object.auth_info !== null) { + message.authInfo = AuthInfo.fromAmino(object.auth_info); + } + message.signatures = object.signatures?.map(e => bytesFromBase64(e)) || []; + return message; }, toAmino(message: Tx): TxAmino { const obj: any = {}; obj.body = message.body ? TxBody.toAmino(message.body) : undefined; obj.auth_info = message.authInfo ? AuthInfo.toAmino(message.authInfo) : undefined; if (message.signatures) { - obj.signatures = message.signatures.map(e => e); + obj.signatures = message.signatures.map(e => base64FromBytes(e)); } else { obj.signatures = []; } @@ -640,6 +895,8 @@ export const Tx = { }; } }; +GlobalDecoderRegistry.register(Tx.typeUrl, Tx); +GlobalDecoderRegistry.registerAminoProtoMapping(Tx.aminoType, Tx.typeUrl); function createBaseTxRaw(): TxRaw { return { bodyBytes: new Uint8Array(), @@ -649,6 +906,16 @@ function createBaseTxRaw(): TxRaw { } export const TxRaw = { typeUrl: "/cosmos.tx.v1beta1.TxRaw", + aminoType: "cosmos-sdk/TxRaw", + is(o: any): o is TxRaw { + return o && (o.$typeUrl === TxRaw.typeUrl || (o.bodyBytes instanceof Uint8Array || typeof o.bodyBytes === "string") && (o.authInfoBytes instanceof Uint8Array || typeof o.authInfoBytes === "string") && Array.isArray(o.signatures) && (!o.signatures.length || o.signatures[0] instanceof Uint8Array || typeof o.signatures[0] === "string")); + }, + isSDK(o: any): o is TxRawSDKType { + return o && (o.$typeUrl === TxRaw.typeUrl || (o.body_bytes instanceof Uint8Array || typeof o.body_bytes === "string") && (o.auth_info_bytes instanceof Uint8Array || typeof o.auth_info_bytes === "string") && Array.isArray(o.signatures) && (!o.signatures.length || o.signatures[0] instanceof Uint8Array || typeof o.signatures[0] === "string")); + }, + isAmino(o: any): o is TxRawAmino { + return o && (o.$typeUrl === TxRaw.typeUrl || (o.body_bytes instanceof Uint8Array || typeof o.body_bytes === "string") && (o.auth_info_bytes instanceof Uint8Array || typeof o.auth_info_bytes === "string") && Array.isArray(o.signatures) && (!o.signatures.length || o.signatures[0] instanceof Uint8Array || typeof o.signatures[0] === "string")); + }, encode(message: TxRaw, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.bodyBytes.length !== 0) { writer.uint32(10).bytes(message.bodyBytes); @@ -684,6 +951,24 @@ export const TxRaw = { } 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)) : [] + }; + }, + toJSON(message: TxRaw): unknown { + const obj: any = {}; + message.bodyBytes !== undefined && (obj.bodyBytes = base64FromBytes(message.bodyBytes !== undefined ? message.bodyBytes : new Uint8Array())); + message.authInfoBytes !== undefined && (obj.authInfoBytes = base64FromBytes(message.authInfoBytes !== undefined ? message.authInfoBytes : new Uint8Array())); + if (message.signatures) { + obj.signatures = message.signatures.map(e => base64FromBytes(e !== undefined ? e : new Uint8Array())); + } else { + obj.signatures = []; + } + return obj; + }, fromPartial(object: Partial): TxRaw { const message = createBaseTxRaw(); message.bodyBytes = object.bodyBytes ?? new Uint8Array(); @@ -692,18 +977,22 @@ export const TxRaw = { return message; }, fromAmino(object: TxRawAmino): TxRaw { - return { - bodyBytes: object.body_bytes, - authInfoBytes: object.auth_info_bytes, - signatures: Array.isArray(object?.signatures) ? object.signatures.map((e: any) => e) : [] - }; + const message = createBaseTxRaw(); + if (object.body_bytes !== undefined && object.body_bytes !== null) { + message.bodyBytes = bytesFromBase64(object.body_bytes); + } + if (object.auth_info_bytes !== undefined && object.auth_info_bytes !== null) { + message.authInfoBytes = bytesFromBase64(object.auth_info_bytes); + } + message.signatures = object.signatures?.map(e => bytesFromBase64(e)) || []; + return message; }, toAmino(message: TxRaw): TxRawAmino { const obj: any = {}; - obj.body_bytes = message.bodyBytes; - obj.auth_info_bytes = message.authInfoBytes; + obj.body_bytes = message.bodyBytes ? base64FromBytes(message.bodyBytes) : undefined; + obj.auth_info_bytes = message.authInfoBytes ? base64FromBytes(message.authInfoBytes) : undefined; if (message.signatures) { - obj.signatures = message.signatures.map(e => e); + obj.signatures = message.signatures.map(e => base64FromBytes(e)); } else { obj.signatures = []; } @@ -731,6 +1020,8 @@ export const TxRaw = { }; } }; +GlobalDecoderRegistry.register(TxRaw.typeUrl, TxRaw); +GlobalDecoderRegistry.registerAminoProtoMapping(TxRaw.aminoType, TxRaw.typeUrl); function createBaseSignDoc(): SignDoc { return { bodyBytes: new Uint8Array(), @@ -741,6 +1032,16 @@ function createBaseSignDoc(): SignDoc { } export const SignDoc = { typeUrl: "/cosmos.tx.v1beta1.SignDoc", + aminoType: "cosmos-sdk/SignDoc", + is(o: any): o is SignDoc { + return o && (o.$typeUrl === SignDoc.typeUrl || (o.bodyBytes instanceof Uint8Array || typeof o.bodyBytes === "string") && (o.authInfoBytes instanceof Uint8Array || typeof o.authInfoBytes === "string") && typeof o.chainId === "string" && typeof o.accountNumber === "bigint"); + }, + isSDK(o: any): o is SignDocSDKType { + return o && (o.$typeUrl === SignDoc.typeUrl || (o.body_bytes instanceof Uint8Array || typeof o.body_bytes === "string") && (o.auth_info_bytes instanceof Uint8Array || typeof o.auth_info_bytes === "string") && typeof o.chain_id === "string" && typeof o.account_number === "bigint"); + }, + isAmino(o: any): o is SignDocAmino { + return o && (o.$typeUrl === SignDoc.typeUrl || (o.body_bytes instanceof Uint8Array || typeof o.body_bytes === "string") && (o.auth_info_bytes instanceof Uint8Array || typeof o.auth_info_bytes === "string") && typeof o.chain_id === "string" && typeof o.account_number === "bigint"); + }, encode(message: SignDoc, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.bodyBytes.length !== 0) { writer.uint32(10).bytes(message.bodyBytes); @@ -782,6 +1083,22 @@ export const SignDoc = { } 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(), + chainId: isSet(object.chainId) ? String(object.chainId) : "", + accountNumber: isSet(object.accountNumber) ? BigInt(object.accountNumber.toString()) : BigInt(0) + }; + }, + toJSON(message: SignDoc): unknown { + const obj: any = {}; + message.bodyBytes !== undefined && (obj.bodyBytes = base64FromBytes(message.bodyBytes !== undefined ? message.bodyBytes : new Uint8Array())); + message.authInfoBytes !== undefined && (obj.authInfoBytes = base64FromBytes(message.authInfoBytes !== undefined ? message.authInfoBytes : new Uint8Array())); + message.chainId !== undefined && (obj.chainId = message.chainId); + message.accountNumber !== undefined && (obj.accountNumber = (message.accountNumber || BigInt(0)).toString()); + return obj; + }, fromPartial(object: Partial): SignDoc { const message = createBaseSignDoc(); message.bodyBytes = object.bodyBytes ?? new Uint8Array(); @@ -791,17 +1108,25 @@ export const SignDoc = { return message; }, fromAmino(object: SignDocAmino): SignDoc { - return { - bodyBytes: object.body_bytes, - authInfoBytes: object.auth_info_bytes, - chainId: object.chain_id, - accountNumber: BigInt(object.account_number) - }; + const message = createBaseSignDoc(); + if (object.body_bytes !== undefined && object.body_bytes !== null) { + message.bodyBytes = bytesFromBase64(object.body_bytes); + } + if (object.auth_info_bytes !== undefined && object.auth_info_bytes !== null) { + message.authInfoBytes = bytesFromBase64(object.auth_info_bytes); + } + if (object.chain_id !== undefined && object.chain_id !== null) { + message.chainId = object.chain_id; + } + if (object.account_number !== undefined && object.account_number !== null) { + message.accountNumber = BigInt(object.account_number); + } + return message; }, toAmino(message: SignDoc): SignDocAmino { const obj: any = {}; - obj.body_bytes = message.bodyBytes; - obj.auth_info_bytes = message.authInfoBytes; + obj.body_bytes = message.bodyBytes ? base64FromBytes(message.bodyBytes) : undefined; + obj.auth_info_bytes = message.authInfoBytes ? base64FromBytes(message.authInfoBytes) : undefined; obj.chain_id = message.chainId; obj.account_number = message.accountNumber ? message.accountNumber.toString() : undefined; return obj; @@ -828,6 +1153,169 @@ export const SignDoc = { }; } }; +GlobalDecoderRegistry.register(SignDoc.typeUrl, SignDoc); +GlobalDecoderRegistry.registerAminoProtoMapping(SignDoc.aminoType, SignDoc.typeUrl); +function createBaseSignDocDirectAux(): SignDocDirectAux { + return { + bodyBytes: new Uint8Array(), + publicKey: undefined, + chainId: "", + accountNumber: BigInt(0), + sequence: BigInt(0), + tip: undefined + }; +} +export const SignDocDirectAux = { + typeUrl: "/cosmos.tx.v1beta1.SignDocDirectAux", + aminoType: "cosmos-sdk/SignDocDirectAux", + is(o: any): o is SignDocDirectAux { + return o && (o.$typeUrl === SignDocDirectAux.typeUrl || (o.bodyBytes instanceof Uint8Array || typeof o.bodyBytes === "string") && typeof o.chainId === "string" && typeof o.accountNumber === "bigint" && typeof o.sequence === "bigint"); + }, + isSDK(o: any): o is SignDocDirectAuxSDKType { + return o && (o.$typeUrl === SignDocDirectAux.typeUrl || (o.body_bytes instanceof Uint8Array || typeof o.body_bytes === "string") && typeof o.chain_id === "string" && typeof o.account_number === "bigint" && typeof o.sequence === "bigint"); + }, + isAmino(o: any): o is SignDocDirectAuxAmino { + return o && (o.$typeUrl === SignDocDirectAux.typeUrl || (o.body_bytes instanceof Uint8Array || typeof o.body_bytes === "string") && typeof o.chain_id === "string" && typeof o.account_number === "bigint" && typeof o.sequence === "bigint"); + }, + encode(message: SignDocDirectAux, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.bodyBytes.length !== 0) { + writer.uint32(10).bytes(message.bodyBytes); + } + if (message.publicKey !== undefined) { + Any.encode(message.publicKey, writer.uint32(18).fork()).ldelim(); + } + if (message.chainId !== "") { + writer.uint32(26).string(message.chainId); + } + if (message.accountNumber !== BigInt(0)) { + writer.uint32(32).uint64(message.accountNumber); + } + if (message.sequence !== BigInt(0)) { + writer.uint32(40).uint64(message.sequence); + } + if (message.tip !== undefined) { + Tip.encode(message.tip, writer.uint32(50).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): SignDocDirectAux { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSignDocDirectAux(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.bodyBytes = reader.bytes(); + break; + case 2: + message.publicKey = Any.decode(reader, reader.uint32()); + break; + case 3: + message.chainId = reader.string(); + break; + case 4: + message.accountNumber = reader.uint64(); + break; + case 5: + message.sequence = reader.uint64(); + break; + case 6: + message.tip = Tip.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): SignDocDirectAux { + return { + bodyBytes: isSet(object.bodyBytes) ? bytesFromBase64(object.bodyBytes) : new Uint8Array(), + publicKey: isSet(object.publicKey) ? Any.fromJSON(object.publicKey) : undefined, + chainId: isSet(object.chainId) ? String(object.chainId) : "", + accountNumber: isSet(object.accountNumber) ? BigInt(object.accountNumber.toString()) : BigInt(0), + sequence: isSet(object.sequence) ? BigInt(object.sequence.toString()) : BigInt(0), + tip: isSet(object.tip) ? Tip.fromJSON(object.tip) : undefined + }; + }, + toJSON(message: SignDocDirectAux): unknown { + const obj: any = {}; + message.bodyBytes !== undefined && (obj.bodyBytes = base64FromBytes(message.bodyBytes !== undefined ? message.bodyBytes : new Uint8Array())); + message.publicKey !== undefined && (obj.publicKey = message.publicKey ? Any.toJSON(message.publicKey) : undefined); + message.chainId !== undefined && (obj.chainId = message.chainId); + message.accountNumber !== undefined && (obj.accountNumber = (message.accountNumber || BigInt(0)).toString()); + message.sequence !== undefined && (obj.sequence = (message.sequence || BigInt(0)).toString()); + message.tip !== undefined && (obj.tip = message.tip ? Tip.toJSON(message.tip) : undefined); + return obj; + }, + fromPartial(object: Partial): SignDocDirectAux { + const message = createBaseSignDocDirectAux(); + message.bodyBytes = object.bodyBytes ?? new Uint8Array(); + message.publicKey = object.publicKey !== undefined && object.publicKey !== null ? Any.fromPartial(object.publicKey) : undefined; + message.chainId = object.chainId ?? ""; + message.accountNumber = object.accountNumber !== undefined && object.accountNumber !== null ? BigInt(object.accountNumber.toString()) : BigInt(0); + message.sequence = object.sequence !== undefined && object.sequence !== null ? BigInt(object.sequence.toString()) : BigInt(0); + message.tip = object.tip !== undefined && object.tip !== null ? Tip.fromPartial(object.tip) : undefined; + return message; + }, + fromAmino(object: SignDocDirectAuxAmino): SignDocDirectAux { + const message = createBaseSignDocDirectAux(); + if (object.body_bytes !== undefined && object.body_bytes !== null) { + message.bodyBytes = bytesFromBase64(object.body_bytes); + } + if (object.public_key !== undefined && object.public_key !== null) { + message.publicKey = Any.fromAmino(object.public_key); + } + if (object.chain_id !== undefined && object.chain_id !== null) { + message.chainId = object.chain_id; + } + if (object.account_number !== undefined && object.account_number !== null) { + message.accountNumber = BigInt(object.account_number); + } + if (object.sequence !== undefined && object.sequence !== null) { + message.sequence = BigInt(object.sequence); + } + if (object.tip !== undefined && object.tip !== null) { + message.tip = Tip.fromAmino(object.tip); + } + return message; + }, + toAmino(message: SignDocDirectAux): SignDocDirectAuxAmino { + const obj: any = {}; + obj.body_bytes = message.bodyBytes ? base64FromBytes(message.bodyBytes) : undefined; + obj.public_key = message.publicKey ? Any.toAmino(message.publicKey) : undefined; + obj.chain_id = message.chainId; + obj.account_number = message.accountNumber ? message.accountNumber.toString() : undefined; + obj.sequence = message.sequence ? message.sequence.toString() : undefined; + obj.tip = message.tip ? Tip.toAmino(message.tip) : undefined; + return obj; + }, + fromAminoMsg(object: SignDocDirectAuxAminoMsg): SignDocDirectAux { + return SignDocDirectAux.fromAmino(object.value); + }, + toAminoMsg(message: SignDocDirectAux): SignDocDirectAuxAminoMsg { + return { + type: "cosmos-sdk/SignDocDirectAux", + value: SignDocDirectAux.toAmino(message) + }; + }, + fromProtoMsg(message: SignDocDirectAuxProtoMsg): SignDocDirectAux { + return SignDocDirectAux.decode(message.value); + }, + toProto(message: SignDocDirectAux): Uint8Array { + return SignDocDirectAux.encode(message).finish(); + }, + toProtoMsg(message: SignDocDirectAux): SignDocDirectAuxProtoMsg { + return { + typeUrl: "/cosmos.tx.v1beta1.SignDocDirectAux", + value: SignDocDirectAux.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(SignDocDirectAux.typeUrl, SignDocDirectAux); +GlobalDecoderRegistry.registerAminoProtoMapping(SignDocDirectAux.aminoType, SignDocDirectAux.typeUrl); function createBaseTxBody(): TxBody { return { messages: [], @@ -839,6 +1327,16 @@ function createBaseTxBody(): TxBody { } export const TxBody = { typeUrl: "/cosmos.tx.v1beta1.TxBody", + aminoType: "cosmos-sdk/TxBody", + is(o: any): o is TxBody { + return o && (o.$typeUrl === TxBody.typeUrl || Array.isArray(o.messages) && (!o.messages.length || Any.is(o.messages[0])) && typeof o.memo === "string" && typeof o.timeoutHeight === "bigint" && Array.isArray(o.extensionOptions) && (!o.extensionOptions.length || Any.is(o.extensionOptions[0])) && Array.isArray(o.nonCriticalExtensionOptions) && (!o.nonCriticalExtensionOptions.length || Any.is(o.nonCriticalExtensionOptions[0]))); + }, + isSDK(o: any): o is TxBodySDKType { + return o && (o.$typeUrl === TxBody.typeUrl || Array.isArray(o.messages) && (!o.messages.length || Any.isSDK(o.messages[0])) && typeof o.memo === "string" && typeof o.timeout_height === "bigint" && Array.isArray(o.extension_options) && (!o.extension_options.length || Any.isSDK(o.extension_options[0])) && Array.isArray(o.non_critical_extension_options) && (!o.non_critical_extension_options.length || Any.isSDK(o.non_critical_extension_options[0]))); + }, + isAmino(o: any): o is TxBodyAmino { + return o && (o.$typeUrl === TxBody.typeUrl || Array.isArray(o.messages) && (!o.messages.length || Any.isAmino(o.messages[0])) && typeof o.memo === "string" && typeof o.timeout_height === "bigint" && Array.isArray(o.extension_options) && (!o.extension_options.length || Any.isAmino(o.extension_options[0])) && Array.isArray(o.non_critical_extension_options) && (!o.non_critical_extension_options.length || Any.isAmino(o.non_critical_extension_options[0]))); + }, encode(message: TxBody, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.messages) { Any.encode(v!, writer.uint32(10).fork()).ldelim(); @@ -886,6 +1384,36 @@ export const TxBody = { } return message; }, + fromJSON(object: any): TxBody { + return { + messages: Array.isArray(object?.messages) ? object.messages.map((e: any) => Any.fromJSON(e)) : [], + memo: isSet(object.memo) ? String(object.memo) : "", + timeoutHeight: isSet(object.timeoutHeight) ? BigInt(object.timeoutHeight.toString()) : BigInt(0), + 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 = {}; + if (message.messages) { + obj.messages = message.messages.map(e => e ? Any.toJSON(e) : undefined); + } else { + obj.messages = []; + } + message.memo !== undefined && (obj.memo = message.memo); + message.timeoutHeight !== undefined && (obj.timeoutHeight = (message.timeoutHeight || BigInt(0)).toString()); + if (message.extensionOptions) { + obj.extensionOptions = message.extensionOptions.map(e => e ? Any.toJSON(e) : undefined); + } else { + obj.extensionOptions = []; + } + if (message.nonCriticalExtensionOptions) { + obj.nonCriticalExtensionOptions = message.nonCriticalExtensionOptions.map(e => e ? Any.toJSON(e) : undefined); + } else { + obj.nonCriticalExtensionOptions = []; + } + return obj; + }, fromPartial(object: Partial): TxBody { const message = createBaseTxBody(); message.messages = object.messages?.map(e => Any.fromPartial(e)) || []; @@ -896,13 +1424,17 @@ export const TxBody = { return message; }, fromAmino(object: TxBodyAmino): TxBody { - return { - messages: Array.isArray(object?.messages) ? object.messages.map((e: any) => Any.fromAmino(e)) : [], - memo: object.memo, - timeoutHeight: BigInt(object.timeout_height), - extensionOptions: Array.isArray(object?.extension_options) ? object.extension_options.map((e: any) => Any.fromAmino(e)) : [], - nonCriticalExtensionOptions: Array.isArray(object?.non_critical_extension_options) ? object.non_critical_extension_options.map((e: any) => Any.fromAmino(e)) : [] - }; + const message = createBaseTxBody(); + message.messages = object.messages?.map(e => Any.fromAmino(e)) || []; + if (object.memo !== undefined && object.memo !== null) { + message.memo = object.memo; + } + if (object.timeout_height !== undefined && object.timeout_height !== null) { + message.timeoutHeight = BigInt(object.timeout_height); + } + message.extensionOptions = object.extension_options?.map(e => Any.fromAmino(e)) || []; + message.nonCriticalExtensionOptions = object.non_critical_extension_options?.map(e => Any.fromAmino(e)) || []; + return message; }, toAmino(message: TxBody): TxBodyAmino { const obj: any = {}; @@ -947,14 +1479,27 @@ export const TxBody = { }; } }; +GlobalDecoderRegistry.register(TxBody.typeUrl, TxBody); +GlobalDecoderRegistry.registerAminoProtoMapping(TxBody.aminoType, TxBody.typeUrl); function createBaseAuthInfo(): AuthInfo { return { signerInfos: [], - fee: Fee.fromPartial({}) + fee: undefined, + tip: undefined }; } export const AuthInfo = { typeUrl: "/cosmos.tx.v1beta1.AuthInfo", + aminoType: "cosmos-sdk/AuthInfo", + is(o: any): o is AuthInfo { + return o && (o.$typeUrl === AuthInfo.typeUrl || Array.isArray(o.signerInfos) && (!o.signerInfos.length || SignerInfo.is(o.signerInfos[0]))); + }, + isSDK(o: any): o is AuthInfoSDKType { + return o && (o.$typeUrl === AuthInfo.typeUrl || Array.isArray(o.signer_infos) && (!o.signer_infos.length || SignerInfo.isSDK(o.signer_infos[0]))); + }, + isAmino(o: any): o is AuthInfoAmino { + return o && (o.$typeUrl === AuthInfo.typeUrl || Array.isArray(o.signer_infos) && (!o.signer_infos.length || SignerInfo.isAmino(o.signer_infos[0]))); + }, encode(message: AuthInfo, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.signerInfos) { SignerInfo.encode(v!, writer.uint32(10).fork()).ldelim(); @@ -962,6 +1507,9 @@ export const AuthInfo = { if (message.fee !== undefined) { Fee.encode(message.fee, writer.uint32(18).fork()).ldelim(); } + if (message.tip !== undefined) { + Tip.encode(message.tip, writer.uint32(26).fork()).ldelim(); + } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): AuthInfo { @@ -977,6 +1525,9 @@ export const AuthInfo = { case 2: message.fee = Fee.decode(reader, reader.uint32()); break; + case 3: + message.tip = Tip.decode(reader, reader.uint32()); + break; default: reader.skipType(tag & 7); break; @@ -984,17 +1535,41 @@ export const AuthInfo = { } return message; }, + fromJSON(object: any): AuthInfo { + return { + signerInfos: Array.isArray(object?.signerInfos) ? object.signerInfos.map((e: any) => SignerInfo.fromJSON(e)) : [], + fee: isSet(object.fee) ? Fee.fromJSON(object.fee) : undefined, + tip: isSet(object.tip) ? Tip.fromJSON(object.tip) : undefined + }; + }, + toJSON(message: AuthInfo): unknown { + const obj: any = {}; + if (message.signerInfos) { + obj.signerInfos = message.signerInfos.map(e => e ? SignerInfo.toJSON(e) : undefined); + } else { + obj.signerInfos = []; + } + message.fee !== undefined && (obj.fee = message.fee ? Fee.toJSON(message.fee) : undefined); + message.tip !== undefined && (obj.tip = message.tip ? Tip.toJSON(message.tip) : undefined); + return obj; + }, fromPartial(object: Partial): 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; + message.tip = object.tip !== undefined && object.tip !== null ? Tip.fromPartial(object.tip) : undefined; return message; }, fromAmino(object: AuthInfoAmino): AuthInfo { - return { - signerInfos: Array.isArray(object?.signer_infos) ? object.signer_infos.map((e: any) => SignerInfo.fromAmino(e)) : [], - fee: object?.fee ? Fee.fromAmino(object.fee) : undefined - }; + const message = createBaseAuthInfo(); + message.signerInfos = object.signer_infos?.map(e => SignerInfo.fromAmino(e)) || []; + if (object.fee !== undefined && object.fee !== null) { + message.fee = Fee.fromAmino(object.fee); + } + if (object.tip !== undefined && object.tip !== null) { + message.tip = Tip.fromAmino(object.tip); + } + return message; }, toAmino(message: AuthInfo): AuthInfoAmino { const obj: any = {}; @@ -1004,6 +1579,7 @@ export const AuthInfo = { obj.signer_infos = []; } obj.fee = message.fee ? Fee.toAmino(message.fee) : undefined; + obj.tip = message.tip ? Tip.toAmino(message.tip) : undefined; return obj; }, fromAminoMsg(object: AuthInfoAminoMsg): AuthInfo { @@ -1028,15 +1604,27 @@ export const AuthInfo = { }; } }; +GlobalDecoderRegistry.register(AuthInfo.typeUrl, AuthInfo); +GlobalDecoderRegistry.registerAminoProtoMapping(AuthInfo.aminoType, AuthInfo.typeUrl); function createBaseSignerInfo(): SignerInfo { return { publicKey: undefined, - modeInfo: ModeInfo.fromPartial({}), + modeInfo: undefined, sequence: BigInt(0) }; } export const SignerInfo = { typeUrl: "/cosmos.tx.v1beta1.SignerInfo", + aminoType: "cosmos-sdk/SignerInfo", + is(o: any): o is SignerInfo { + return o && (o.$typeUrl === SignerInfo.typeUrl || typeof o.sequence === "bigint"); + }, + isSDK(o: any): o is SignerInfoSDKType { + return o && (o.$typeUrl === SignerInfo.typeUrl || typeof o.sequence === "bigint"); + }, + isAmino(o: any): o is SignerInfoAmino { + return o && (o.$typeUrl === SignerInfo.typeUrl || typeof o.sequence === "bigint"); + }, encode(message: SignerInfo, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.publicKey !== undefined) { Any.encode(message.publicKey, writer.uint32(10).fork()).ldelim(); @@ -1072,6 +1660,20 @@ export const SignerInfo = { } return message; }, + fromJSON(object: any): SignerInfo { + return { + publicKey: isSet(object.publicKey) ? Any.fromJSON(object.publicKey) : undefined, + modeInfo: isSet(object.modeInfo) ? ModeInfo.fromJSON(object.modeInfo) : undefined, + sequence: isSet(object.sequence) ? BigInt(object.sequence.toString()) : BigInt(0) + }; + }, + 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 || BigInt(0)).toString()); + return obj; + }, fromPartial(object: Partial): SignerInfo { const message = createBaseSignerInfo(); message.publicKey = object.publicKey !== undefined && object.publicKey !== null ? Any.fromPartial(object.publicKey) : undefined; @@ -1080,11 +1682,17 @@ export const SignerInfo = { return message; }, fromAmino(object: SignerInfoAmino): SignerInfo { - return { - publicKey: object?.public_key ? Any.fromAmino(object.public_key) : undefined, - modeInfo: object?.mode_info ? ModeInfo.fromAmino(object.mode_info) : undefined, - sequence: BigInt(object.sequence) - }; + const message = createBaseSignerInfo(); + if (object.public_key !== undefined && object.public_key !== null) { + message.publicKey = Any.fromAmino(object.public_key); + } + if (object.mode_info !== undefined && object.mode_info !== null) { + message.modeInfo = ModeInfo.fromAmino(object.mode_info); + } + if (object.sequence !== undefined && object.sequence !== null) { + message.sequence = BigInt(object.sequence); + } + return message; }, toAmino(message: SignerInfo): SignerInfoAmino { const obj: any = {}; @@ -1115,6 +1723,8 @@ export const SignerInfo = { }; } }; +GlobalDecoderRegistry.register(SignerInfo.typeUrl, SignerInfo); +GlobalDecoderRegistry.registerAminoProtoMapping(SignerInfo.aminoType, SignerInfo.typeUrl); function createBaseModeInfo(): ModeInfo { return { single: undefined, @@ -1123,6 +1733,16 @@ function createBaseModeInfo(): ModeInfo { } export const ModeInfo = { typeUrl: "/cosmos.tx.v1beta1.ModeInfo", + aminoType: "cosmos-sdk/ModeInfo", + is(o: any): o is ModeInfo { + return o && o.$typeUrl === ModeInfo.typeUrl; + }, + isSDK(o: any): o is ModeInfoSDKType { + return o && o.$typeUrl === ModeInfo.typeUrl; + }, + isAmino(o: any): o is ModeInfoAmino { + return o && o.$typeUrl === ModeInfo.typeUrl; + }, encode(message: ModeInfo, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.single !== undefined) { ModeInfo_Single.encode(message.single, writer.uint32(10).fork()).ldelim(); @@ -1152,6 +1772,18 @@ export const ModeInfo = { } return message; }, + fromJSON(object: any): ModeInfo { + return { + 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; + }, fromPartial(object: Partial): ModeInfo { const message = createBaseModeInfo(); message.single = object.single !== undefined && object.single !== null ? ModeInfo_Single.fromPartial(object.single) : undefined; @@ -1159,10 +1791,14 @@ export const ModeInfo = { return message; }, fromAmino(object: ModeInfoAmino): ModeInfo { - return { - single: object?.single ? ModeInfo_Single.fromAmino(object.single) : undefined, - multi: object?.multi ? ModeInfo_Multi.fromAmino(object.multi) : undefined - }; + const message = createBaseModeInfo(); + if (object.single !== undefined && object.single !== null) { + message.single = ModeInfo_Single.fromAmino(object.single); + } + if (object.multi !== undefined && object.multi !== null) { + message.multi = ModeInfo_Multi.fromAmino(object.multi); + } + return message; }, toAmino(message: ModeInfo): ModeInfoAmino { const obj: any = {}; @@ -1192,6 +1828,8 @@ export const ModeInfo = { }; } }; +GlobalDecoderRegistry.register(ModeInfo.typeUrl, ModeInfo); +GlobalDecoderRegistry.registerAminoProtoMapping(ModeInfo.aminoType, ModeInfo.typeUrl); function createBaseModeInfo_Single(): ModeInfo_Single { return { mode: 0 @@ -1199,6 +1837,16 @@ function createBaseModeInfo_Single(): ModeInfo_Single { } export const ModeInfo_Single = { typeUrl: "/cosmos.tx.v1beta1.Single", + aminoType: "cosmos-sdk/Single", + is(o: any): o is ModeInfo_Single { + return o && (o.$typeUrl === ModeInfo_Single.typeUrl || isSet(o.mode)); + }, + isSDK(o: any): o is ModeInfo_SingleSDKType { + return o && (o.$typeUrl === ModeInfo_Single.typeUrl || isSet(o.mode)); + }, + isAmino(o: any): o is ModeInfo_SingleAmino { + return o && (o.$typeUrl === ModeInfo_Single.typeUrl || isSet(o.mode)); + }, encode(message: ModeInfo_Single, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.mode !== 0) { writer.uint32(8).int32(message.mode); @@ -1222,19 +1870,31 @@ export const ModeInfo_Single = { } return message; }, + fromJSON(object: any): ModeInfo_Single { + return { + mode: isSet(object.mode) ? signModeFromJSON(object.mode) : -1 + }; + }, + toJSON(message: ModeInfo_Single): unknown { + const obj: any = {}; + message.mode !== undefined && (obj.mode = signModeToJSON(message.mode)); + return obj; + }, fromPartial(object: Partial): ModeInfo_Single { const message = createBaseModeInfo_Single(); message.mode = object.mode ?? 0; return message; }, fromAmino(object: ModeInfo_SingleAmino): ModeInfo_Single { - return { - mode: isSet(object.mode) ? signModeFromJSON(object.mode) : -1 - }; + const message = createBaseModeInfo_Single(); + if (object.mode !== undefined && object.mode !== null) { + message.mode = signModeFromJSON(object.mode); + } + return message; }, toAmino(message: ModeInfo_Single): ModeInfo_SingleAmino { const obj: any = {}; - obj.mode = message.mode; + obj.mode = signModeToJSON(message.mode); return obj; }, fromAminoMsg(object: ModeInfo_SingleAminoMsg): ModeInfo_Single { @@ -1259,14 +1919,26 @@ export const ModeInfo_Single = { }; } }; +GlobalDecoderRegistry.register(ModeInfo_Single.typeUrl, ModeInfo_Single); +GlobalDecoderRegistry.registerAminoProtoMapping(ModeInfo_Single.aminoType, ModeInfo_Single.typeUrl); function createBaseModeInfo_Multi(): ModeInfo_Multi { return { - bitarray: CompactBitArray.fromPartial({}), + bitarray: undefined, modeInfos: [] }; } export const ModeInfo_Multi = { typeUrl: "/cosmos.tx.v1beta1.Multi", + aminoType: "cosmos-sdk/Multi", + is(o: any): o is ModeInfo_Multi { + return o && (o.$typeUrl === ModeInfo_Multi.typeUrl || Array.isArray(o.modeInfos) && (!o.modeInfos.length || ModeInfo.is(o.modeInfos[0]))); + }, + isSDK(o: any): o is ModeInfo_MultiSDKType { + return o && (o.$typeUrl === ModeInfo_Multi.typeUrl || Array.isArray(o.mode_infos) && (!o.mode_infos.length || ModeInfo.isSDK(o.mode_infos[0]))); + }, + isAmino(o: any): o is ModeInfo_MultiAmino { + return o && (o.$typeUrl === ModeInfo_Multi.typeUrl || Array.isArray(o.mode_infos) && (!o.mode_infos.length || ModeInfo.isAmino(o.mode_infos[0]))); + }, encode(message: ModeInfo_Multi, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.bitarray !== undefined) { CompactBitArray.encode(message.bitarray, writer.uint32(10).fork()).ldelim(); @@ -1296,6 +1968,22 @@ export const ModeInfo_Multi = { } 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)) : [] + }; + }, + toJSON(message: ModeInfo_Multi): unknown { + const obj: any = {}; + message.bitarray !== undefined && (obj.bitarray = message.bitarray ? CompactBitArray.toJSON(message.bitarray) : undefined); + if (message.modeInfos) { + obj.modeInfos = message.modeInfos.map(e => e ? ModeInfo.toJSON(e) : undefined); + } else { + obj.modeInfos = []; + } + return obj; + }, fromPartial(object: Partial): ModeInfo_Multi { const message = createBaseModeInfo_Multi(); message.bitarray = object.bitarray !== undefined && object.bitarray !== null ? CompactBitArray.fromPartial(object.bitarray) : undefined; @@ -1303,10 +1991,12 @@ export const ModeInfo_Multi = { return message; }, fromAmino(object: ModeInfo_MultiAmino): ModeInfo_Multi { - return { - bitarray: object?.bitarray ? CompactBitArray.fromAmino(object.bitarray) : undefined, - modeInfos: Array.isArray(object?.mode_infos) ? object.mode_infos.map((e: any) => ModeInfo.fromAmino(e)) : [] - }; + const message = createBaseModeInfo_Multi(); + if (object.bitarray !== undefined && object.bitarray !== null) { + message.bitarray = CompactBitArray.fromAmino(object.bitarray); + } + message.modeInfos = object.mode_infos?.map(e => ModeInfo.fromAmino(e)) || []; + return message; }, toAmino(message: ModeInfo_Multi): ModeInfo_MultiAmino { const obj: any = {}; @@ -1340,6 +2030,8 @@ export const ModeInfo_Multi = { }; } }; +GlobalDecoderRegistry.register(ModeInfo_Multi.typeUrl, ModeInfo_Multi); +GlobalDecoderRegistry.registerAminoProtoMapping(ModeInfo_Multi.aminoType, ModeInfo_Multi.typeUrl); function createBaseFee(): Fee { return { amount: [], @@ -1350,6 +2042,16 @@ function createBaseFee(): Fee { } export const Fee = { typeUrl: "/cosmos.tx.v1beta1.Fee", + aminoType: "cosmos-sdk/Fee", + is(o: any): o is Fee { + return o && (o.$typeUrl === Fee.typeUrl || Array.isArray(o.amount) && (!o.amount.length || Coin.is(o.amount[0])) && typeof o.gasLimit === "bigint" && typeof o.payer === "string" && typeof o.granter === "string"); + }, + isSDK(o: any): o is FeeSDKType { + return o && (o.$typeUrl === Fee.typeUrl || Array.isArray(o.amount) && (!o.amount.length || Coin.isSDK(o.amount[0])) && typeof o.gas_limit === "bigint" && typeof o.payer === "string" && typeof o.granter === "string"); + }, + isAmino(o: any): o is FeeAmino { + return o && (o.$typeUrl === Fee.typeUrl || Array.isArray(o.amount) && (!o.amount.length || Coin.isAmino(o.amount[0])) && typeof o.gas_limit === "bigint" && typeof o.payer === "string" && typeof o.granter === "string"); + }, encode(message: Fee, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.amount) { Coin.encode(v!, writer.uint32(10).fork()).ldelim(); @@ -1391,6 +2093,26 @@ export const Fee = { } return message; }, + fromJSON(object: any): Fee { + return { + amount: Array.isArray(object?.amount) ? object.amount.map((e: any) => Coin.fromJSON(e)) : [], + gasLimit: isSet(object.gasLimit) ? BigInt(object.gasLimit.toString()) : BigInt(0), + payer: isSet(object.payer) ? String(object.payer) : "", + granter: isSet(object.granter) ? String(object.granter) : "" + }; + }, + toJSON(message: Fee): unknown { + const obj: any = {}; + if (message.amount) { + obj.amount = message.amount.map(e => e ? Coin.toJSON(e) : undefined); + } else { + obj.amount = []; + } + message.gasLimit !== undefined && (obj.gasLimit = (message.gasLimit || BigInt(0)).toString()); + message.payer !== undefined && (obj.payer = message.payer); + message.granter !== undefined && (obj.granter = message.granter); + return obj; + }, fromPartial(object: Partial): Fee { const message = createBaseFee(); message.amount = object.amount?.map(e => Coin.fromPartial(e)) || []; @@ -1400,12 +2122,18 @@ export const Fee = { return message; }, fromAmino(object: FeeAmino): Fee { - return { - amount: Array.isArray(object?.amount) ? object.amount.map((e: any) => Coin.fromAmino(e)) : [], - gasLimit: BigInt(object.gas_limit), - payer: object.payer, - granter: object.granter - }; + const message = createBaseFee(); + message.amount = object.amount?.map(e => Coin.fromAmino(e)) || []; + if (object.gas_limit !== undefined && object.gas_limit !== null) { + message.gasLimit = BigInt(object.gas_limit); + } + if (object.payer !== undefined && object.payer !== null) { + message.payer = object.payer; + } + if (object.granter !== undefined && object.granter !== null) { + message.granter = object.granter; + } + return message; }, toAmino(message: Fee): FeeAmino { const obj: any = {}; @@ -1440,4 +2168,250 @@ export const Fee = { value: Fee.encode(message).finish() }; } -}; \ No newline at end of file +}; +GlobalDecoderRegistry.register(Fee.typeUrl, Fee); +GlobalDecoderRegistry.registerAminoProtoMapping(Fee.aminoType, Fee.typeUrl); +function createBaseTip(): Tip { + return { + amount: [], + tipper: "" + }; +} +export const Tip = { + typeUrl: "/cosmos.tx.v1beta1.Tip", + aminoType: "cosmos-sdk/Tip", + is(o: any): o is Tip { + return o && (o.$typeUrl === Tip.typeUrl || Array.isArray(o.amount) && (!o.amount.length || Coin.is(o.amount[0])) && typeof o.tipper === "string"); + }, + isSDK(o: any): o is TipSDKType { + return o && (o.$typeUrl === Tip.typeUrl || Array.isArray(o.amount) && (!o.amount.length || Coin.isSDK(o.amount[0])) && typeof o.tipper === "string"); + }, + isAmino(o: any): o is TipAmino { + return o && (o.$typeUrl === Tip.typeUrl || Array.isArray(o.amount) && (!o.amount.length || Coin.isAmino(o.amount[0])) && typeof o.tipper === "string"); + }, + encode(message: Tip, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.amount) { + Coin.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.tipper !== "") { + writer.uint32(18).string(message.tipper); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): Tip { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseTip(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.amount.push(Coin.decode(reader, reader.uint32())); + break; + case 2: + message.tipper = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): Tip { + return { + amount: Array.isArray(object?.amount) ? object.amount.map((e: any) => Coin.fromJSON(e)) : [], + tipper: isSet(object.tipper) ? String(object.tipper) : "" + }; + }, + toJSON(message: Tip): unknown { + const obj: any = {}; + if (message.amount) { + obj.amount = message.amount.map(e => e ? Coin.toJSON(e) : undefined); + } else { + obj.amount = []; + } + message.tipper !== undefined && (obj.tipper = message.tipper); + return obj; + }, + fromPartial(object: Partial): Tip { + const message = createBaseTip(); + message.amount = object.amount?.map(e => Coin.fromPartial(e)) || []; + message.tipper = object.tipper ?? ""; + return message; + }, + fromAmino(object: TipAmino): Tip { + const message = createBaseTip(); + message.amount = object.amount?.map(e => Coin.fromAmino(e)) || []; + if (object.tipper !== undefined && object.tipper !== null) { + message.tipper = object.tipper; + } + return message; + }, + toAmino(message: Tip): TipAmino { + const obj: any = {}; + if (message.amount) { + obj.amount = message.amount.map(e => e ? Coin.toAmino(e) : undefined); + } else { + obj.amount = []; + } + obj.tipper = message.tipper; + return obj; + }, + fromAminoMsg(object: TipAminoMsg): Tip { + return Tip.fromAmino(object.value); + }, + toAminoMsg(message: Tip): TipAminoMsg { + return { + type: "cosmos-sdk/Tip", + value: Tip.toAmino(message) + }; + }, + fromProtoMsg(message: TipProtoMsg): Tip { + return Tip.decode(message.value); + }, + toProto(message: Tip): Uint8Array { + return Tip.encode(message).finish(); + }, + toProtoMsg(message: Tip): TipProtoMsg { + return { + typeUrl: "/cosmos.tx.v1beta1.Tip", + value: Tip.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(Tip.typeUrl, Tip); +GlobalDecoderRegistry.registerAminoProtoMapping(Tip.aminoType, Tip.typeUrl); +function createBaseAuxSignerData(): AuxSignerData { + return { + address: "", + signDoc: undefined, + mode: 0, + sig: new Uint8Array() + }; +} +export const AuxSignerData = { + typeUrl: "/cosmos.tx.v1beta1.AuxSignerData", + aminoType: "cosmos-sdk/AuxSignerData", + is(o: any): o is AuxSignerData { + return o && (o.$typeUrl === AuxSignerData.typeUrl || typeof o.address === "string" && isSet(o.mode) && (o.sig instanceof Uint8Array || typeof o.sig === "string")); + }, + isSDK(o: any): o is AuxSignerDataSDKType { + return o && (o.$typeUrl === AuxSignerData.typeUrl || typeof o.address === "string" && isSet(o.mode) && (o.sig instanceof Uint8Array || typeof o.sig === "string")); + }, + isAmino(o: any): o is AuxSignerDataAmino { + return o && (o.$typeUrl === AuxSignerData.typeUrl || typeof o.address === "string" && isSet(o.mode) && (o.sig instanceof Uint8Array || typeof o.sig === "string")); + }, + encode(message: AuxSignerData, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.address !== "") { + writer.uint32(10).string(message.address); + } + if (message.signDoc !== undefined) { + SignDocDirectAux.encode(message.signDoc, writer.uint32(18).fork()).ldelim(); + } + if (message.mode !== 0) { + writer.uint32(24).int32(message.mode); + } + if (message.sig.length !== 0) { + writer.uint32(34).bytes(message.sig); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): AuxSignerData { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseAuxSignerData(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.address = reader.string(); + break; + case 2: + message.signDoc = SignDocDirectAux.decode(reader, reader.uint32()); + break; + case 3: + message.mode = (reader.int32() as any); + break; + case 4: + message.sig = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): AuxSignerData { + return { + address: isSet(object.address) ? String(object.address) : "", + signDoc: isSet(object.signDoc) ? SignDocDirectAux.fromJSON(object.signDoc) : undefined, + mode: isSet(object.mode) ? signModeFromJSON(object.mode) : -1, + sig: isSet(object.sig) ? bytesFromBase64(object.sig) : new Uint8Array() + }; + }, + toJSON(message: AuxSignerData): unknown { + const obj: any = {}; + message.address !== undefined && (obj.address = message.address); + message.signDoc !== undefined && (obj.signDoc = message.signDoc ? SignDocDirectAux.toJSON(message.signDoc) : undefined); + message.mode !== undefined && (obj.mode = signModeToJSON(message.mode)); + message.sig !== undefined && (obj.sig = base64FromBytes(message.sig !== undefined ? message.sig : new Uint8Array())); + return obj; + }, + fromPartial(object: Partial): AuxSignerData { + const message = createBaseAuxSignerData(); + message.address = object.address ?? ""; + message.signDoc = object.signDoc !== undefined && object.signDoc !== null ? SignDocDirectAux.fromPartial(object.signDoc) : undefined; + message.mode = object.mode ?? 0; + message.sig = object.sig ?? new Uint8Array(); + return message; + }, + fromAmino(object: AuxSignerDataAmino): AuxSignerData { + const message = createBaseAuxSignerData(); + if (object.address !== undefined && object.address !== null) { + message.address = object.address; + } + if (object.sign_doc !== undefined && object.sign_doc !== null) { + message.signDoc = SignDocDirectAux.fromAmino(object.sign_doc); + } + if (object.mode !== undefined && object.mode !== null) { + message.mode = signModeFromJSON(object.mode); + } + if (object.sig !== undefined && object.sig !== null) { + message.sig = bytesFromBase64(object.sig); + } + return message; + }, + toAmino(message: AuxSignerData): AuxSignerDataAmino { + const obj: any = {}; + obj.address = message.address; + obj.sign_doc = message.signDoc ? SignDocDirectAux.toAmino(message.signDoc) : undefined; + obj.mode = signModeToJSON(message.mode); + obj.sig = message.sig ? base64FromBytes(message.sig) : undefined; + return obj; + }, + fromAminoMsg(object: AuxSignerDataAminoMsg): AuxSignerData { + return AuxSignerData.fromAmino(object.value); + }, + toAminoMsg(message: AuxSignerData): AuxSignerDataAminoMsg { + return { + type: "cosmos-sdk/AuxSignerData", + value: AuxSignerData.toAmino(message) + }; + }, + fromProtoMsg(message: AuxSignerDataProtoMsg): AuxSignerData { + return AuxSignerData.decode(message.value); + }, + toProto(message: AuxSignerData): Uint8Array { + return AuxSignerData.encode(message).finish(); + }, + toProtoMsg(message: AuxSignerData): AuxSignerDataProtoMsg { + return { + typeUrl: "/cosmos.tx.v1beta1.AuxSignerData", + value: AuxSignerData.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(AuxSignerData.typeUrl, AuxSignerData); +GlobalDecoderRegistry.registerAminoProtoMapping(AuxSignerData.aminoType, AuxSignerData.typeUrl); \ No newline at end of file diff --git a/packages/osmojs/src/codegen/cosmos/upgrade/v1beta1/query.lcd.ts b/packages/osmojs/src/codegen/cosmos/upgrade/v1beta1/query.lcd.ts index 49a57f788..40543d689 100644 --- a/packages/osmojs/src/codegen/cosmos/upgrade/v1beta1/query.lcd.ts +++ b/packages/osmojs/src/codegen/cosmos/upgrade/v1beta1/query.lcd.ts @@ -1,5 +1,5 @@ import { LCDClient } from "@cosmology/lcd"; -import { QueryCurrentPlanRequest, QueryCurrentPlanResponseSDKType, QueryAppliedPlanRequest, QueryAppliedPlanResponseSDKType, QueryUpgradedConsensusStateRequest, QueryUpgradedConsensusStateResponseSDKType, QueryModuleVersionsRequest, QueryModuleVersionsResponseSDKType } from "./query"; +import { QueryCurrentPlanRequest, QueryCurrentPlanResponseSDKType, QueryAppliedPlanRequest, QueryAppliedPlanResponseSDKType, QueryUpgradedConsensusStateRequest, QueryUpgradedConsensusStateResponseSDKType, QueryModuleVersionsRequest, QueryModuleVersionsResponseSDKType, QueryAuthorityRequest, QueryAuthorityResponseSDKType } from "./query"; export class LCDQueryClient { req: LCDClient; constructor({ @@ -12,6 +12,7 @@ export class LCDQueryClient { this.appliedPlan = this.appliedPlan.bind(this); this.upgradedConsensusState = this.upgradedConsensusState.bind(this); this.moduleVersions = this.moduleVersions.bind(this); + this.authority = this.authority.bind(this); } /* CurrentPlan queries the current upgrade plan. */ async currentPlan(_params: QueryCurrentPlanRequest = {}): Promise { @@ -46,4 +47,11 @@ export class LCDQueryClient { const endpoint = `cosmos/upgrade/v1beta1/module_versions`; return await this.req.get(endpoint, options); } + /* Returns the account with authority to conduct upgrades + + Since: cosmos-sdk 0.46 */ + async authority(_params: QueryAuthorityRequest = {}): Promise { + const endpoint = `cosmos/upgrade/v1beta1/authority`; + return await this.req.get(endpoint); + } } \ No newline at end of file diff --git a/packages/osmojs/src/codegen/cosmos/upgrade/v1beta1/query.rpc.Query.ts b/packages/osmojs/src/codegen/cosmos/upgrade/v1beta1/query.rpc.Query.ts index df47fb33b..042c6fdef 100644 --- a/packages/osmojs/src/codegen/cosmos/upgrade/v1beta1/query.rpc.Query.ts +++ b/packages/osmojs/src/codegen/cosmos/upgrade/v1beta1/query.rpc.Query.ts @@ -1,7 +1,7 @@ import { Rpc } from "../../../helpers"; import { BinaryReader } from "../../../binary"; import { QueryClient, createProtobufRpcClient } from "@cosmjs/stargate"; -import { QueryCurrentPlanRequest, QueryCurrentPlanResponse, QueryAppliedPlanRequest, QueryAppliedPlanResponse, QueryUpgradedConsensusStateRequest, QueryUpgradedConsensusStateResponse, QueryModuleVersionsRequest, QueryModuleVersionsResponse } from "./query"; +import { QueryCurrentPlanRequest, QueryCurrentPlanResponse, QueryAppliedPlanRequest, QueryAppliedPlanResponse, QueryUpgradedConsensusStateRequest, QueryUpgradedConsensusStateResponse, QueryModuleVersionsRequest, QueryModuleVersionsResponse, QueryAuthorityRequest, QueryAuthorityResponse } from "./query"; /** Query defines the gRPC upgrade querier service. */ export interface Query { /** CurrentPlan queries the current upgrade plan. */ @@ -23,6 +23,12 @@ export interface Query { * Since: cosmos-sdk 0.43 */ moduleVersions(request: QueryModuleVersionsRequest): Promise; + /** + * Returns the account with authority to conduct upgrades + * + * Since: cosmos-sdk 0.46 + */ + authority(request?: QueryAuthorityRequest): Promise; } export class QueryClientImpl implements Query { private readonly rpc: Rpc; @@ -32,6 +38,7 @@ export class QueryClientImpl implements Query { this.appliedPlan = this.appliedPlan.bind(this); this.upgradedConsensusState = this.upgradedConsensusState.bind(this); this.moduleVersions = this.moduleVersions.bind(this); + this.authority = this.authority.bind(this); } currentPlan(request: QueryCurrentPlanRequest = {}): Promise { const data = QueryCurrentPlanRequest.encode(request).finish(); @@ -53,6 +60,11 @@ export class QueryClientImpl implements Query { const promise = this.rpc.request("cosmos.upgrade.v1beta1.Query", "ModuleVersions", data); return promise.then(data => QueryModuleVersionsResponse.decode(new BinaryReader(data))); } + authority(request: QueryAuthorityRequest = {}): Promise { + const data = QueryAuthorityRequest.encode(request).finish(); + const promise = this.rpc.request("cosmos.upgrade.v1beta1.Query", "Authority", data); + return promise.then(data => QueryAuthorityResponse.decode(new BinaryReader(data))); + } } export const createRpcQueryExtension = (base: QueryClient) => { const rpc = createProtobufRpcClient(base); @@ -69,6 +81,9 @@ export const createRpcQueryExtension = (base: QueryClient) => { }, moduleVersions(request: QueryModuleVersionsRequest): Promise { return queryService.moduleVersions(request); + }, + authority(request?: QueryAuthorityRequest): Promise { + return queryService.authority(request); } }; }; \ No newline at end of file diff --git a/packages/osmojs/src/codegen/cosmos/upgrade/v1beta1/query.ts b/packages/osmojs/src/codegen/cosmos/upgrade/v1beta1/query.ts index ef453f174..97aa67fa0 100644 --- a/packages/osmojs/src/codegen/cosmos/upgrade/v1beta1/query.ts +++ b/packages/osmojs/src/codegen/cosmos/upgrade/v1beta1/query.ts @@ -1,5 +1,7 @@ import { Plan, PlanAmino, PlanSDKType, ModuleVersion, ModuleVersionAmino, ModuleVersionSDKType } from "./upgrade"; import { BinaryReader, BinaryWriter } from "../../../binary"; +import { GlobalDecoderRegistry } from "../../../registry"; +import { isSet, bytesFromBase64, base64FromBytes } from "../../../helpers"; /** * QueryCurrentPlanRequest is the request type for the Query/CurrentPlan RPC * method. @@ -29,7 +31,7 @@ export interface QueryCurrentPlanRequestSDKType {} */ export interface QueryCurrentPlanResponse { /** plan is the current upgrade plan. */ - plan: Plan; + plan?: Plan; } export interface QueryCurrentPlanResponseProtoMsg { typeUrl: "/cosmos.upgrade.v1beta1.QueryCurrentPlanResponse"; @@ -52,7 +54,7 @@ export interface QueryCurrentPlanResponseAminoMsg { * method. */ export interface QueryCurrentPlanResponseSDKType { - plan: PlanSDKType; + plan?: PlanSDKType; } /** * QueryCurrentPlanRequest is the request type for the Query/AppliedPlan RPC @@ -72,7 +74,7 @@ export interface QueryAppliedPlanRequestProtoMsg { */ export interface QueryAppliedPlanRequestAmino { /** name is the name of the applied plan to query for. */ - name: string; + name?: string; } export interface QueryAppliedPlanRequestAminoMsg { type: "cosmos-sdk/QueryAppliedPlanRequest"; @@ -103,7 +105,7 @@ export interface QueryAppliedPlanResponseProtoMsg { */ export interface QueryAppliedPlanResponseAmino { /** height is the block height at which the plan was applied. */ - height: string; + height?: string; } export interface QueryAppliedPlanResponseAminoMsg { type: "cosmos-sdk/QueryAppliedPlanResponse"; @@ -142,7 +144,7 @@ export interface QueryUpgradedConsensusStateRequestAmino { * last height of the current chain must be sent in request * as this is the height under which next consensus state is stored */ - last_height: string; + last_height?: string; } export interface QueryUpgradedConsensusStateRequestAminoMsg { type: "cosmos-sdk/QueryUpgradedConsensusStateRequest"; @@ -176,7 +178,7 @@ export interface QueryUpgradedConsensusStateResponseProtoMsg { /** @deprecated */ export interface QueryUpgradedConsensusStateResponseAmino { /** Since: cosmos-sdk 0.43 */ - upgraded_consensus_state: Uint8Array; + upgraded_consensus_state?: string; } export interface QueryUpgradedConsensusStateResponseAminoMsg { type: "cosmos-sdk/QueryUpgradedConsensusStateResponse"; @@ -220,7 +222,7 @@ export interface QueryModuleVersionsRequestAmino { * consensus version from state. Leaving this empty will * fetch the full list of module versions from state */ - module_name: string; + module_name?: string; } export interface QueryModuleVersionsRequestAminoMsg { type: "cosmos-sdk/QueryModuleVersionsRequest"; @@ -257,7 +259,7 @@ export interface QueryModuleVersionsResponseProtoMsg { */ export interface QueryModuleVersionsResponseAmino { /** module_versions is a list of module names with their consensus versions. */ - module_versions: ModuleVersionAmino[]; + module_versions?: ModuleVersionAmino[]; } export interface QueryModuleVersionsResponseAminoMsg { type: "cosmos-sdk/QueryModuleVersionsResponse"; @@ -272,11 +274,79 @@ export interface QueryModuleVersionsResponseAminoMsg { export interface QueryModuleVersionsResponseSDKType { module_versions: ModuleVersionSDKType[]; } +/** + * QueryAuthorityRequest is the request type for Query/Authority + * + * Since: cosmos-sdk 0.46 + */ +export interface QueryAuthorityRequest {} +export interface QueryAuthorityRequestProtoMsg { + typeUrl: "/cosmos.upgrade.v1beta1.QueryAuthorityRequest"; + value: Uint8Array; +} +/** + * QueryAuthorityRequest is the request type for Query/Authority + * + * Since: cosmos-sdk 0.46 + */ +export interface QueryAuthorityRequestAmino {} +export interface QueryAuthorityRequestAminoMsg { + type: "cosmos-sdk/QueryAuthorityRequest"; + value: QueryAuthorityRequestAmino; +} +/** + * QueryAuthorityRequest is the request type for Query/Authority + * + * Since: cosmos-sdk 0.46 + */ +export interface QueryAuthorityRequestSDKType {} +/** + * QueryAuthorityResponse is the response type for Query/Authority + * + * Since: cosmos-sdk 0.46 + */ +export interface QueryAuthorityResponse { + address: string; +} +export interface QueryAuthorityResponseProtoMsg { + typeUrl: "/cosmos.upgrade.v1beta1.QueryAuthorityResponse"; + value: Uint8Array; +} +/** + * QueryAuthorityResponse is the response type for Query/Authority + * + * Since: cosmos-sdk 0.46 + */ +export interface QueryAuthorityResponseAmino { + address?: string; +} +export interface QueryAuthorityResponseAminoMsg { + type: "cosmos-sdk/QueryAuthorityResponse"; + value: QueryAuthorityResponseAmino; +} +/** + * QueryAuthorityResponse is the response type for Query/Authority + * + * Since: cosmos-sdk 0.46 + */ +export interface QueryAuthorityResponseSDKType { + address: string; +} function createBaseQueryCurrentPlanRequest(): QueryCurrentPlanRequest { return {}; } export const QueryCurrentPlanRequest = { typeUrl: "/cosmos.upgrade.v1beta1.QueryCurrentPlanRequest", + aminoType: "cosmos-sdk/QueryCurrentPlanRequest", + is(o: any): o is QueryCurrentPlanRequest { + return o && o.$typeUrl === QueryCurrentPlanRequest.typeUrl; + }, + isSDK(o: any): o is QueryCurrentPlanRequestSDKType { + return o && o.$typeUrl === QueryCurrentPlanRequest.typeUrl; + }, + isAmino(o: any): o is QueryCurrentPlanRequestAmino { + return o && o.$typeUrl === QueryCurrentPlanRequest.typeUrl; + }, encode(_: QueryCurrentPlanRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, @@ -294,12 +364,20 @@ export const QueryCurrentPlanRequest = { } return message; }, + fromJSON(_: any): QueryCurrentPlanRequest { + return {}; + }, + toJSON(_: QueryCurrentPlanRequest): unknown { + const obj: any = {}; + return obj; + }, fromPartial(_: Partial): QueryCurrentPlanRequest { const message = createBaseQueryCurrentPlanRequest(); return message; }, fromAmino(_: QueryCurrentPlanRequestAmino): QueryCurrentPlanRequest { - return {}; + const message = createBaseQueryCurrentPlanRequest(); + return message; }, toAmino(_: QueryCurrentPlanRequest): QueryCurrentPlanRequestAmino { const obj: any = {}; @@ -327,13 +405,25 @@ export const QueryCurrentPlanRequest = { }; } }; +GlobalDecoderRegistry.register(QueryCurrentPlanRequest.typeUrl, QueryCurrentPlanRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryCurrentPlanRequest.aminoType, QueryCurrentPlanRequest.typeUrl); function createBaseQueryCurrentPlanResponse(): QueryCurrentPlanResponse { return { - plan: Plan.fromPartial({}) + plan: undefined }; } export const QueryCurrentPlanResponse = { typeUrl: "/cosmos.upgrade.v1beta1.QueryCurrentPlanResponse", + aminoType: "cosmos-sdk/QueryCurrentPlanResponse", + is(o: any): o is QueryCurrentPlanResponse { + return o && o.$typeUrl === QueryCurrentPlanResponse.typeUrl; + }, + isSDK(o: any): o is QueryCurrentPlanResponseSDKType { + return o && o.$typeUrl === QueryCurrentPlanResponse.typeUrl; + }, + isAmino(o: any): o is QueryCurrentPlanResponseAmino { + return o && o.$typeUrl === QueryCurrentPlanResponse.typeUrl; + }, encode(message: QueryCurrentPlanResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.plan !== undefined) { Plan.encode(message.plan, writer.uint32(10).fork()).ldelim(); @@ -357,15 +447,27 @@ export const QueryCurrentPlanResponse = { } return message; }, + fromJSON(object: any): QueryCurrentPlanResponse { + 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; + }, fromPartial(object: Partial): QueryCurrentPlanResponse { const message = createBaseQueryCurrentPlanResponse(); message.plan = object.plan !== undefined && object.plan !== null ? Plan.fromPartial(object.plan) : undefined; return message; }, fromAmino(object: QueryCurrentPlanResponseAmino): QueryCurrentPlanResponse { - return { - plan: object?.plan ? Plan.fromAmino(object.plan) : undefined - }; + const message = createBaseQueryCurrentPlanResponse(); + if (object.plan !== undefined && object.plan !== null) { + message.plan = Plan.fromAmino(object.plan); + } + return message; }, toAmino(message: QueryCurrentPlanResponse): QueryCurrentPlanResponseAmino { const obj: any = {}; @@ -394,6 +496,8 @@ export const QueryCurrentPlanResponse = { }; } }; +GlobalDecoderRegistry.register(QueryCurrentPlanResponse.typeUrl, QueryCurrentPlanResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryCurrentPlanResponse.aminoType, QueryCurrentPlanResponse.typeUrl); function createBaseQueryAppliedPlanRequest(): QueryAppliedPlanRequest { return { name: "" @@ -401,6 +505,16 @@ function createBaseQueryAppliedPlanRequest(): QueryAppliedPlanRequest { } export const QueryAppliedPlanRequest = { typeUrl: "/cosmos.upgrade.v1beta1.QueryAppliedPlanRequest", + aminoType: "cosmos-sdk/QueryAppliedPlanRequest", + is(o: any): o is QueryAppliedPlanRequest { + return o && (o.$typeUrl === QueryAppliedPlanRequest.typeUrl || typeof o.name === "string"); + }, + isSDK(o: any): o is QueryAppliedPlanRequestSDKType { + return o && (o.$typeUrl === QueryAppliedPlanRequest.typeUrl || typeof o.name === "string"); + }, + isAmino(o: any): o is QueryAppliedPlanRequestAmino { + return o && (o.$typeUrl === QueryAppliedPlanRequest.typeUrl || typeof o.name === "string"); + }, encode(message: QueryAppliedPlanRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.name !== "") { writer.uint32(10).string(message.name); @@ -424,15 +538,27 @@ export const QueryAppliedPlanRequest = { } return message; }, + fromJSON(object: any): QueryAppliedPlanRequest { + return { + name: isSet(object.name) ? String(object.name) : "" + }; + }, + toJSON(message: QueryAppliedPlanRequest): unknown { + const obj: any = {}; + message.name !== undefined && (obj.name = message.name); + return obj; + }, fromPartial(object: Partial): QueryAppliedPlanRequest { const message = createBaseQueryAppliedPlanRequest(); message.name = object.name ?? ""; return message; }, fromAmino(object: QueryAppliedPlanRequestAmino): QueryAppliedPlanRequest { - return { - name: object.name - }; + const message = createBaseQueryAppliedPlanRequest(); + if (object.name !== undefined && object.name !== null) { + message.name = object.name; + } + return message; }, toAmino(message: QueryAppliedPlanRequest): QueryAppliedPlanRequestAmino { const obj: any = {}; @@ -461,6 +587,8 @@ export const QueryAppliedPlanRequest = { }; } }; +GlobalDecoderRegistry.register(QueryAppliedPlanRequest.typeUrl, QueryAppliedPlanRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryAppliedPlanRequest.aminoType, QueryAppliedPlanRequest.typeUrl); function createBaseQueryAppliedPlanResponse(): QueryAppliedPlanResponse { return { height: BigInt(0) @@ -468,6 +596,16 @@ function createBaseQueryAppliedPlanResponse(): QueryAppliedPlanResponse { } export const QueryAppliedPlanResponse = { typeUrl: "/cosmos.upgrade.v1beta1.QueryAppliedPlanResponse", + aminoType: "cosmos-sdk/QueryAppliedPlanResponse", + is(o: any): o is QueryAppliedPlanResponse { + return o && (o.$typeUrl === QueryAppliedPlanResponse.typeUrl || typeof o.height === "bigint"); + }, + isSDK(o: any): o is QueryAppliedPlanResponseSDKType { + return o && (o.$typeUrl === QueryAppliedPlanResponse.typeUrl || typeof o.height === "bigint"); + }, + isAmino(o: any): o is QueryAppliedPlanResponseAmino { + return o && (o.$typeUrl === QueryAppliedPlanResponse.typeUrl || typeof o.height === "bigint"); + }, encode(message: QueryAppliedPlanResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.height !== BigInt(0)) { writer.uint32(8).int64(message.height); @@ -491,15 +629,27 @@ export const QueryAppliedPlanResponse = { } return message; }, + fromJSON(object: any): QueryAppliedPlanResponse { + return { + height: isSet(object.height) ? BigInt(object.height.toString()) : BigInt(0) + }; + }, + toJSON(message: QueryAppliedPlanResponse): unknown { + const obj: any = {}; + message.height !== undefined && (obj.height = (message.height || BigInt(0)).toString()); + return obj; + }, fromPartial(object: Partial): QueryAppliedPlanResponse { const message = createBaseQueryAppliedPlanResponse(); message.height = object.height !== undefined && object.height !== null ? BigInt(object.height.toString()) : BigInt(0); return message; }, fromAmino(object: QueryAppliedPlanResponseAmino): QueryAppliedPlanResponse { - return { - height: BigInt(object.height) - }; + const message = createBaseQueryAppliedPlanResponse(); + if (object.height !== undefined && object.height !== null) { + message.height = BigInt(object.height); + } + return message; }, toAmino(message: QueryAppliedPlanResponse): QueryAppliedPlanResponseAmino { const obj: any = {}; @@ -528,6 +678,8 @@ export const QueryAppliedPlanResponse = { }; } }; +GlobalDecoderRegistry.register(QueryAppliedPlanResponse.typeUrl, QueryAppliedPlanResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryAppliedPlanResponse.aminoType, QueryAppliedPlanResponse.typeUrl); function createBaseQueryUpgradedConsensusStateRequest(): QueryUpgradedConsensusStateRequest { return { lastHeight: BigInt(0) @@ -535,6 +687,16 @@ function createBaseQueryUpgradedConsensusStateRequest(): QueryUpgradedConsensusS } export const QueryUpgradedConsensusStateRequest = { typeUrl: "/cosmos.upgrade.v1beta1.QueryUpgradedConsensusStateRequest", + aminoType: "cosmos-sdk/QueryUpgradedConsensusStateRequest", + is(o: any): o is QueryUpgradedConsensusStateRequest { + return o && (o.$typeUrl === QueryUpgradedConsensusStateRequest.typeUrl || typeof o.lastHeight === "bigint"); + }, + isSDK(o: any): o is QueryUpgradedConsensusStateRequestSDKType { + return o && (o.$typeUrl === QueryUpgradedConsensusStateRequest.typeUrl || typeof o.last_height === "bigint"); + }, + isAmino(o: any): o is QueryUpgradedConsensusStateRequestAmino { + return o && (o.$typeUrl === QueryUpgradedConsensusStateRequest.typeUrl || typeof o.last_height === "bigint"); + }, encode(message: QueryUpgradedConsensusStateRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.lastHeight !== BigInt(0)) { writer.uint32(8).int64(message.lastHeight); @@ -558,15 +720,27 @@ export const QueryUpgradedConsensusStateRequest = { } return message; }, + fromJSON(object: any): QueryUpgradedConsensusStateRequest { + return { + lastHeight: isSet(object.lastHeight) ? BigInt(object.lastHeight.toString()) : BigInt(0) + }; + }, + toJSON(message: QueryUpgradedConsensusStateRequest): unknown { + const obj: any = {}; + message.lastHeight !== undefined && (obj.lastHeight = (message.lastHeight || BigInt(0)).toString()); + return obj; + }, fromPartial(object: Partial): QueryUpgradedConsensusStateRequest { const message = createBaseQueryUpgradedConsensusStateRequest(); message.lastHeight = object.lastHeight !== undefined && object.lastHeight !== null ? BigInt(object.lastHeight.toString()) : BigInt(0); return message; }, fromAmino(object: QueryUpgradedConsensusStateRequestAmino): QueryUpgradedConsensusStateRequest { - return { - lastHeight: BigInt(object.last_height) - }; + const message = createBaseQueryUpgradedConsensusStateRequest(); + if (object.last_height !== undefined && object.last_height !== null) { + message.lastHeight = BigInt(object.last_height); + } + return message; }, toAmino(message: QueryUpgradedConsensusStateRequest): QueryUpgradedConsensusStateRequestAmino { const obj: any = {}; @@ -595,6 +769,8 @@ export const QueryUpgradedConsensusStateRequest = { }; } }; +GlobalDecoderRegistry.register(QueryUpgradedConsensusStateRequest.typeUrl, QueryUpgradedConsensusStateRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryUpgradedConsensusStateRequest.aminoType, QueryUpgradedConsensusStateRequest.typeUrl); function createBaseQueryUpgradedConsensusStateResponse(): QueryUpgradedConsensusStateResponse { return { upgradedConsensusState: new Uint8Array() @@ -602,6 +778,16 @@ function createBaseQueryUpgradedConsensusStateResponse(): QueryUpgradedConsensus } export const QueryUpgradedConsensusStateResponse = { typeUrl: "/cosmos.upgrade.v1beta1.QueryUpgradedConsensusStateResponse", + aminoType: "cosmos-sdk/QueryUpgradedConsensusStateResponse", + is(o: any): o is QueryUpgradedConsensusStateResponse { + return o && (o.$typeUrl === QueryUpgradedConsensusStateResponse.typeUrl || o.upgradedConsensusState instanceof Uint8Array || typeof o.upgradedConsensusState === "string"); + }, + isSDK(o: any): o is QueryUpgradedConsensusStateResponseSDKType { + return o && (o.$typeUrl === QueryUpgradedConsensusStateResponse.typeUrl || o.upgraded_consensus_state instanceof Uint8Array || typeof o.upgraded_consensus_state === "string"); + }, + isAmino(o: any): o is QueryUpgradedConsensusStateResponseAmino { + return o && (o.$typeUrl === QueryUpgradedConsensusStateResponse.typeUrl || o.upgraded_consensus_state instanceof Uint8Array || typeof o.upgraded_consensus_state === "string"); + }, encode(message: QueryUpgradedConsensusStateResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.upgradedConsensusState.length !== 0) { writer.uint32(18).bytes(message.upgradedConsensusState); @@ -625,19 +811,31 @@ export const QueryUpgradedConsensusStateResponse = { } return message; }, + fromJSON(object: any): QueryUpgradedConsensusStateResponse { + return { + upgradedConsensusState: isSet(object.upgradedConsensusState) ? bytesFromBase64(object.upgradedConsensusState) : new Uint8Array() + }; + }, + toJSON(message: QueryUpgradedConsensusStateResponse): unknown { + const obj: any = {}; + message.upgradedConsensusState !== undefined && (obj.upgradedConsensusState = base64FromBytes(message.upgradedConsensusState !== undefined ? message.upgradedConsensusState : new Uint8Array())); + return obj; + }, fromPartial(object: Partial): QueryUpgradedConsensusStateResponse { const message = createBaseQueryUpgradedConsensusStateResponse(); message.upgradedConsensusState = object.upgradedConsensusState ?? new Uint8Array(); return message; }, fromAmino(object: QueryUpgradedConsensusStateResponseAmino): QueryUpgradedConsensusStateResponse { - return { - upgradedConsensusState: object.upgraded_consensus_state - }; + const message = createBaseQueryUpgradedConsensusStateResponse(); + if (object.upgraded_consensus_state !== undefined && object.upgraded_consensus_state !== null) { + message.upgradedConsensusState = bytesFromBase64(object.upgraded_consensus_state); + } + return message; }, toAmino(message: QueryUpgradedConsensusStateResponse): QueryUpgradedConsensusStateResponseAmino { const obj: any = {}; - obj.upgraded_consensus_state = message.upgradedConsensusState; + obj.upgraded_consensus_state = message.upgradedConsensusState ? base64FromBytes(message.upgradedConsensusState) : undefined; return obj; }, fromAminoMsg(object: QueryUpgradedConsensusStateResponseAminoMsg): QueryUpgradedConsensusStateResponse { @@ -662,6 +860,8 @@ export const QueryUpgradedConsensusStateResponse = { }; } }; +GlobalDecoderRegistry.register(QueryUpgradedConsensusStateResponse.typeUrl, QueryUpgradedConsensusStateResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryUpgradedConsensusStateResponse.aminoType, QueryUpgradedConsensusStateResponse.typeUrl); function createBaseQueryModuleVersionsRequest(): QueryModuleVersionsRequest { return { moduleName: "" @@ -669,6 +869,16 @@ function createBaseQueryModuleVersionsRequest(): QueryModuleVersionsRequest { } export const QueryModuleVersionsRequest = { typeUrl: "/cosmos.upgrade.v1beta1.QueryModuleVersionsRequest", + aminoType: "cosmos-sdk/QueryModuleVersionsRequest", + is(o: any): o is QueryModuleVersionsRequest { + return o && (o.$typeUrl === QueryModuleVersionsRequest.typeUrl || typeof o.moduleName === "string"); + }, + isSDK(o: any): o is QueryModuleVersionsRequestSDKType { + return o && (o.$typeUrl === QueryModuleVersionsRequest.typeUrl || typeof o.module_name === "string"); + }, + isAmino(o: any): o is QueryModuleVersionsRequestAmino { + return o && (o.$typeUrl === QueryModuleVersionsRequest.typeUrl || typeof o.module_name === "string"); + }, encode(message: QueryModuleVersionsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.moduleName !== "") { writer.uint32(10).string(message.moduleName); @@ -692,15 +902,27 @@ export const QueryModuleVersionsRequest = { } return message; }, + fromJSON(object: any): QueryModuleVersionsRequest { + return { + moduleName: isSet(object.moduleName) ? String(object.moduleName) : "" + }; + }, + toJSON(message: QueryModuleVersionsRequest): unknown { + const obj: any = {}; + message.moduleName !== undefined && (obj.moduleName = message.moduleName); + return obj; + }, fromPartial(object: Partial): QueryModuleVersionsRequest { const message = createBaseQueryModuleVersionsRequest(); message.moduleName = object.moduleName ?? ""; return message; }, fromAmino(object: QueryModuleVersionsRequestAmino): QueryModuleVersionsRequest { - return { - moduleName: object.module_name - }; + const message = createBaseQueryModuleVersionsRequest(); + if (object.module_name !== undefined && object.module_name !== null) { + message.moduleName = object.module_name; + } + return message; }, toAmino(message: QueryModuleVersionsRequest): QueryModuleVersionsRequestAmino { const obj: any = {}; @@ -729,6 +951,8 @@ export const QueryModuleVersionsRequest = { }; } }; +GlobalDecoderRegistry.register(QueryModuleVersionsRequest.typeUrl, QueryModuleVersionsRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryModuleVersionsRequest.aminoType, QueryModuleVersionsRequest.typeUrl); function createBaseQueryModuleVersionsResponse(): QueryModuleVersionsResponse { return { moduleVersions: [] @@ -736,6 +960,16 @@ function createBaseQueryModuleVersionsResponse(): QueryModuleVersionsResponse { } export const QueryModuleVersionsResponse = { typeUrl: "/cosmos.upgrade.v1beta1.QueryModuleVersionsResponse", + aminoType: "cosmos-sdk/QueryModuleVersionsResponse", + is(o: any): o is QueryModuleVersionsResponse { + return o && (o.$typeUrl === QueryModuleVersionsResponse.typeUrl || Array.isArray(o.moduleVersions) && (!o.moduleVersions.length || ModuleVersion.is(o.moduleVersions[0]))); + }, + isSDK(o: any): o is QueryModuleVersionsResponseSDKType { + return o && (o.$typeUrl === QueryModuleVersionsResponse.typeUrl || Array.isArray(o.module_versions) && (!o.module_versions.length || ModuleVersion.isSDK(o.module_versions[0]))); + }, + isAmino(o: any): o is QueryModuleVersionsResponseAmino { + return o && (o.$typeUrl === QueryModuleVersionsResponse.typeUrl || Array.isArray(o.module_versions) && (!o.module_versions.length || ModuleVersion.isAmino(o.module_versions[0]))); + }, encode(message: QueryModuleVersionsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.moduleVersions) { ModuleVersion.encode(v!, writer.uint32(10).fork()).ldelim(); @@ -759,15 +993,29 @@ export const QueryModuleVersionsResponse = { } return message; }, + fromJSON(object: any): QueryModuleVersionsResponse { + return { + moduleVersions: Array.isArray(object?.moduleVersions) ? object.moduleVersions.map((e: any) => ModuleVersion.fromJSON(e)) : [] + }; + }, + toJSON(message: QueryModuleVersionsResponse): unknown { + const obj: any = {}; + if (message.moduleVersions) { + obj.moduleVersions = message.moduleVersions.map(e => e ? ModuleVersion.toJSON(e) : undefined); + } else { + obj.moduleVersions = []; + } + return obj; + }, fromPartial(object: Partial): QueryModuleVersionsResponse { const message = createBaseQueryModuleVersionsResponse(); message.moduleVersions = object.moduleVersions?.map(e => ModuleVersion.fromPartial(e)) || []; return message; }, fromAmino(object: QueryModuleVersionsResponseAmino): QueryModuleVersionsResponse { - return { - moduleVersions: Array.isArray(object?.module_versions) ? object.module_versions.map((e: any) => ModuleVersion.fromAmino(e)) : [] - }; + const message = createBaseQueryModuleVersionsResponse(); + message.moduleVersions = object.module_versions?.map(e => ModuleVersion.fromAmino(e)) || []; + return message; }, toAmino(message: QueryModuleVersionsResponse): QueryModuleVersionsResponseAmino { const obj: any = {}; @@ -799,4 +1047,172 @@ export const QueryModuleVersionsResponse = { value: QueryModuleVersionsResponse.encode(message).finish() }; } -}; \ No newline at end of file +}; +GlobalDecoderRegistry.register(QueryModuleVersionsResponse.typeUrl, QueryModuleVersionsResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryModuleVersionsResponse.aminoType, QueryModuleVersionsResponse.typeUrl); +function createBaseQueryAuthorityRequest(): QueryAuthorityRequest { + return {}; +} +export const QueryAuthorityRequest = { + typeUrl: "/cosmos.upgrade.v1beta1.QueryAuthorityRequest", + aminoType: "cosmos-sdk/QueryAuthorityRequest", + is(o: any): o is QueryAuthorityRequest { + return o && o.$typeUrl === QueryAuthorityRequest.typeUrl; + }, + isSDK(o: any): o is QueryAuthorityRequestSDKType { + return o && o.$typeUrl === QueryAuthorityRequest.typeUrl; + }, + isAmino(o: any): o is QueryAuthorityRequestAmino { + return o && o.$typeUrl === QueryAuthorityRequest.typeUrl; + }, + encode(_: QueryAuthorityRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryAuthorityRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryAuthorityRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(_: any): QueryAuthorityRequest { + return {}; + }, + toJSON(_: QueryAuthorityRequest): unknown { + const obj: any = {}; + return obj; + }, + fromPartial(_: Partial): QueryAuthorityRequest { + const message = createBaseQueryAuthorityRequest(); + return message; + }, + fromAmino(_: QueryAuthorityRequestAmino): QueryAuthorityRequest { + const message = createBaseQueryAuthorityRequest(); + return message; + }, + toAmino(_: QueryAuthorityRequest): QueryAuthorityRequestAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: QueryAuthorityRequestAminoMsg): QueryAuthorityRequest { + return QueryAuthorityRequest.fromAmino(object.value); + }, + toAminoMsg(message: QueryAuthorityRequest): QueryAuthorityRequestAminoMsg { + return { + type: "cosmos-sdk/QueryAuthorityRequest", + value: QueryAuthorityRequest.toAmino(message) + }; + }, + fromProtoMsg(message: QueryAuthorityRequestProtoMsg): QueryAuthorityRequest { + return QueryAuthorityRequest.decode(message.value); + }, + toProto(message: QueryAuthorityRequest): Uint8Array { + return QueryAuthorityRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryAuthorityRequest): QueryAuthorityRequestProtoMsg { + return { + typeUrl: "/cosmos.upgrade.v1beta1.QueryAuthorityRequest", + value: QueryAuthorityRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryAuthorityRequest.typeUrl, QueryAuthorityRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryAuthorityRequest.aminoType, QueryAuthorityRequest.typeUrl); +function createBaseQueryAuthorityResponse(): QueryAuthorityResponse { + return { + address: "" + }; +} +export const QueryAuthorityResponse = { + typeUrl: "/cosmos.upgrade.v1beta1.QueryAuthorityResponse", + aminoType: "cosmos-sdk/QueryAuthorityResponse", + is(o: any): o is QueryAuthorityResponse { + return o && (o.$typeUrl === QueryAuthorityResponse.typeUrl || typeof o.address === "string"); + }, + isSDK(o: any): o is QueryAuthorityResponseSDKType { + return o && (o.$typeUrl === QueryAuthorityResponse.typeUrl || typeof o.address === "string"); + }, + isAmino(o: any): o is QueryAuthorityResponseAmino { + return o && (o.$typeUrl === QueryAuthorityResponse.typeUrl || typeof o.address === "string"); + }, + encode(message: QueryAuthorityResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.address !== "") { + writer.uint32(10).string(message.address); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryAuthorityResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryAuthorityResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.address = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): QueryAuthorityResponse { + return { + address: isSet(object.address) ? String(object.address) : "" + }; + }, + toJSON(message: QueryAuthorityResponse): unknown { + const obj: any = {}; + message.address !== undefined && (obj.address = message.address); + return obj; + }, + fromPartial(object: Partial): QueryAuthorityResponse { + const message = createBaseQueryAuthorityResponse(); + message.address = object.address ?? ""; + return message; + }, + fromAmino(object: QueryAuthorityResponseAmino): QueryAuthorityResponse { + const message = createBaseQueryAuthorityResponse(); + if (object.address !== undefined && object.address !== null) { + message.address = object.address; + } + return message; + }, + toAmino(message: QueryAuthorityResponse): QueryAuthorityResponseAmino { + const obj: any = {}; + obj.address = message.address; + return obj; + }, + fromAminoMsg(object: QueryAuthorityResponseAminoMsg): QueryAuthorityResponse { + return QueryAuthorityResponse.fromAmino(object.value); + }, + toAminoMsg(message: QueryAuthorityResponse): QueryAuthorityResponseAminoMsg { + return { + type: "cosmos-sdk/QueryAuthorityResponse", + value: QueryAuthorityResponse.toAmino(message) + }; + }, + fromProtoMsg(message: QueryAuthorityResponseProtoMsg): QueryAuthorityResponse { + return QueryAuthorityResponse.decode(message.value); + }, + toProto(message: QueryAuthorityResponse): Uint8Array { + return QueryAuthorityResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryAuthorityResponse): QueryAuthorityResponseProtoMsg { + return { + typeUrl: "/cosmos.upgrade.v1beta1.QueryAuthorityResponse", + value: QueryAuthorityResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryAuthorityResponse.typeUrl, QueryAuthorityResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryAuthorityResponse.aminoType, QueryAuthorityResponse.typeUrl); \ No newline at end of file diff --git a/packages/osmojs/src/codegen/cosmos/upgrade/v1beta1/tx.amino.ts b/packages/osmojs/src/codegen/cosmos/upgrade/v1beta1/tx.amino.ts new file mode 100644 index 000000000..59e87c086 --- /dev/null +++ b/packages/osmojs/src/codegen/cosmos/upgrade/v1beta1/tx.amino.ts @@ -0,0 +1,14 @@ +//@ts-nocheck +import { MsgSoftwareUpgrade, MsgCancelUpgrade } from "./tx"; +export const AminoConverter = { + "/cosmos.upgrade.v1beta1.MsgSoftwareUpgrade": { + aminoType: "cosmos-sdk/MsgSoftwareUpgrade", + toAmino: MsgSoftwareUpgrade.toAmino, + fromAmino: MsgSoftwareUpgrade.fromAmino + }, + "/cosmos.upgrade.v1beta1.MsgCancelUpgrade": { + aminoType: "cosmos-sdk/MsgCancelUpgrade", + toAmino: MsgCancelUpgrade.toAmino, + fromAmino: MsgCancelUpgrade.fromAmino + } +}; \ No newline at end of file diff --git a/packages/osmojs/src/codegen/cosmos/upgrade/v1beta1/tx.registry.ts b/packages/osmojs/src/codegen/cosmos/upgrade/v1beta1/tx.registry.ts new file mode 100644 index 000000000..e57c26fd6 --- /dev/null +++ b/packages/osmojs/src/codegen/cosmos/upgrade/v1beta1/tx.registry.ts @@ -0,0 +1,81 @@ +//@ts-nocheck +import { GeneratedType, Registry } from "@cosmjs/proto-signing"; +import { MsgSoftwareUpgrade, MsgCancelUpgrade } from "./tx"; +export const registry: ReadonlyArray<[string, GeneratedType]> = [["/cosmos.upgrade.v1beta1.MsgSoftwareUpgrade", MsgSoftwareUpgrade], ["/cosmos.upgrade.v1beta1.MsgCancelUpgrade", MsgCancelUpgrade]]; +export const load = (protoRegistry: Registry) => { + registry.forEach(([typeUrl, mod]) => { + protoRegistry.register(typeUrl, mod); + }); +}; +export const MessageComposer = { + encoded: { + softwareUpgrade(value: MsgSoftwareUpgrade) { + return { + typeUrl: "/cosmos.upgrade.v1beta1.MsgSoftwareUpgrade", + value: MsgSoftwareUpgrade.encode(value).finish() + }; + }, + cancelUpgrade(value: MsgCancelUpgrade) { + return { + typeUrl: "/cosmos.upgrade.v1beta1.MsgCancelUpgrade", + value: MsgCancelUpgrade.encode(value).finish() + }; + } + }, + withTypeUrl: { + softwareUpgrade(value: MsgSoftwareUpgrade) { + return { + typeUrl: "/cosmos.upgrade.v1beta1.MsgSoftwareUpgrade", + value + }; + }, + cancelUpgrade(value: MsgCancelUpgrade) { + return { + typeUrl: "/cosmos.upgrade.v1beta1.MsgCancelUpgrade", + value + }; + } + }, + toJSON: { + softwareUpgrade(value: MsgSoftwareUpgrade) { + return { + typeUrl: "/cosmos.upgrade.v1beta1.MsgSoftwareUpgrade", + value: MsgSoftwareUpgrade.toJSON(value) + }; + }, + cancelUpgrade(value: MsgCancelUpgrade) { + return { + typeUrl: "/cosmos.upgrade.v1beta1.MsgCancelUpgrade", + value: MsgCancelUpgrade.toJSON(value) + }; + } + }, + fromJSON: { + softwareUpgrade(value: any) { + return { + typeUrl: "/cosmos.upgrade.v1beta1.MsgSoftwareUpgrade", + value: MsgSoftwareUpgrade.fromJSON(value) + }; + }, + cancelUpgrade(value: any) { + return { + typeUrl: "/cosmos.upgrade.v1beta1.MsgCancelUpgrade", + value: MsgCancelUpgrade.fromJSON(value) + }; + } + }, + fromPartial: { + softwareUpgrade(value: MsgSoftwareUpgrade) { + return { + typeUrl: "/cosmos.upgrade.v1beta1.MsgSoftwareUpgrade", + value: MsgSoftwareUpgrade.fromPartial(value) + }; + }, + cancelUpgrade(value: MsgCancelUpgrade) { + return { + typeUrl: "/cosmos.upgrade.v1beta1.MsgCancelUpgrade", + value: MsgCancelUpgrade.fromPartial(value) + }; + } + } +}; \ No newline at end of file diff --git a/packages/osmojs/src/codegen/cosmos/upgrade/v1beta1/tx.rpc.msg.ts b/packages/osmojs/src/codegen/cosmos/upgrade/v1beta1/tx.rpc.msg.ts new file mode 100644 index 000000000..74f5d8f5b --- /dev/null +++ b/packages/osmojs/src/codegen/cosmos/upgrade/v1beta1/tx.rpc.msg.ts @@ -0,0 +1,40 @@ +import { Rpc } from "../../../helpers"; +import { BinaryReader } from "../../../binary"; +import { MsgSoftwareUpgrade, MsgSoftwareUpgradeResponse, MsgCancelUpgrade, MsgCancelUpgradeResponse } from "./tx"; +/** Msg defines the upgrade Msg service. */ +export interface Msg { + /** + * SoftwareUpgrade is a governance operation for initiating a software upgrade. + * + * Since: cosmos-sdk 0.46 + */ + softwareUpgrade(request: MsgSoftwareUpgrade): Promise; + /** + * CancelUpgrade is a governance operation for cancelling a previously + * approved software upgrade. + * + * Since: cosmos-sdk 0.46 + */ + cancelUpgrade(request: MsgCancelUpgrade): Promise; +} +export class MsgClientImpl implements Msg { + private readonly rpc: Rpc; + constructor(rpc: Rpc) { + this.rpc = rpc; + this.softwareUpgrade = this.softwareUpgrade.bind(this); + this.cancelUpgrade = this.cancelUpgrade.bind(this); + } + softwareUpgrade(request: MsgSoftwareUpgrade): Promise { + const data = MsgSoftwareUpgrade.encode(request).finish(); + const promise = this.rpc.request("cosmos.upgrade.v1beta1.Msg", "SoftwareUpgrade", data); + return promise.then(data => MsgSoftwareUpgradeResponse.decode(new BinaryReader(data))); + } + cancelUpgrade(request: MsgCancelUpgrade): Promise { + const data = MsgCancelUpgrade.encode(request).finish(); + const promise = this.rpc.request("cosmos.upgrade.v1beta1.Msg", "CancelUpgrade", data); + return promise.then(data => MsgCancelUpgradeResponse.decode(new BinaryReader(data))); + } +} +export const createClientImpl = (rpc: Rpc) => { + return new MsgClientImpl(rpc); +}; \ No newline at end of file diff --git a/packages/osmojs/src/codegen/cosmos/upgrade/v1beta1/tx.ts b/packages/osmojs/src/codegen/cosmos/upgrade/v1beta1/tx.ts new file mode 100644 index 000000000..5a4d563e2 --- /dev/null +++ b/packages/osmojs/src/codegen/cosmos/upgrade/v1beta1/tx.ts @@ -0,0 +1,475 @@ +import { Plan, PlanAmino, PlanSDKType } from "./upgrade"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { isSet } from "../../../helpers"; +import { GlobalDecoderRegistry } from "../../../registry"; +/** + * MsgSoftwareUpgrade is the Msg/SoftwareUpgrade request type. + * + * Since: cosmos-sdk 0.46 + */ +export interface MsgSoftwareUpgrade { + /** authority is the address that controls the module (defaults to x/gov unless overwritten). */ + authority: string; + /** plan is the upgrade plan. */ + plan: Plan; +} +export interface MsgSoftwareUpgradeProtoMsg { + typeUrl: "/cosmos.upgrade.v1beta1.MsgSoftwareUpgrade"; + value: Uint8Array; +} +/** + * MsgSoftwareUpgrade is the Msg/SoftwareUpgrade request type. + * + * Since: cosmos-sdk 0.46 + */ +export interface MsgSoftwareUpgradeAmino { + /** authority is the address that controls the module (defaults to x/gov unless overwritten). */ + authority?: string; + /** plan is the upgrade plan. */ + plan: PlanAmino; +} +export interface MsgSoftwareUpgradeAminoMsg { + type: "cosmos-sdk/MsgSoftwareUpgrade"; + value: MsgSoftwareUpgradeAmino; +} +/** + * MsgSoftwareUpgrade is the Msg/SoftwareUpgrade request type. + * + * Since: cosmos-sdk 0.46 + */ +export interface MsgSoftwareUpgradeSDKType { + authority: string; + plan: PlanSDKType; +} +/** + * MsgSoftwareUpgradeResponse is the Msg/SoftwareUpgrade response type. + * + * Since: cosmos-sdk 0.46 + */ +export interface MsgSoftwareUpgradeResponse {} +export interface MsgSoftwareUpgradeResponseProtoMsg { + typeUrl: "/cosmos.upgrade.v1beta1.MsgSoftwareUpgradeResponse"; + value: Uint8Array; +} +/** + * MsgSoftwareUpgradeResponse is the Msg/SoftwareUpgrade response type. + * + * Since: cosmos-sdk 0.46 + */ +export interface MsgSoftwareUpgradeResponseAmino {} +export interface MsgSoftwareUpgradeResponseAminoMsg { + type: "cosmos-sdk/MsgSoftwareUpgradeResponse"; + value: MsgSoftwareUpgradeResponseAmino; +} +/** + * MsgSoftwareUpgradeResponse is the Msg/SoftwareUpgrade response type. + * + * Since: cosmos-sdk 0.46 + */ +export interface MsgSoftwareUpgradeResponseSDKType {} +/** + * MsgCancelUpgrade is the Msg/CancelUpgrade request type. + * + * Since: cosmos-sdk 0.46 + */ +export interface MsgCancelUpgrade { + /** authority is the address that controls the module (defaults to x/gov unless overwritten). */ + authority: string; +} +export interface MsgCancelUpgradeProtoMsg { + typeUrl: "/cosmos.upgrade.v1beta1.MsgCancelUpgrade"; + value: Uint8Array; +} +/** + * MsgCancelUpgrade is the Msg/CancelUpgrade request type. + * + * Since: cosmos-sdk 0.46 + */ +export interface MsgCancelUpgradeAmino { + /** authority is the address that controls the module (defaults to x/gov unless overwritten). */ + authority?: string; +} +export interface MsgCancelUpgradeAminoMsg { + type: "cosmos-sdk/MsgCancelUpgrade"; + value: MsgCancelUpgradeAmino; +} +/** + * MsgCancelUpgrade is the Msg/CancelUpgrade request type. + * + * Since: cosmos-sdk 0.46 + */ +export interface MsgCancelUpgradeSDKType { + authority: string; +} +/** + * MsgCancelUpgradeResponse is the Msg/CancelUpgrade response type. + * + * Since: cosmos-sdk 0.46 + */ +export interface MsgCancelUpgradeResponse {} +export interface MsgCancelUpgradeResponseProtoMsg { + typeUrl: "/cosmos.upgrade.v1beta1.MsgCancelUpgradeResponse"; + value: Uint8Array; +} +/** + * MsgCancelUpgradeResponse is the Msg/CancelUpgrade response type. + * + * Since: cosmos-sdk 0.46 + */ +export interface MsgCancelUpgradeResponseAmino {} +export interface MsgCancelUpgradeResponseAminoMsg { + type: "cosmos-sdk/MsgCancelUpgradeResponse"; + value: MsgCancelUpgradeResponseAmino; +} +/** + * MsgCancelUpgradeResponse is the Msg/CancelUpgrade response type. + * + * Since: cosmos-sdk 0.46 + */ +export interface MsgCancelUpgradeResponseSDKType {} +function createBaseMsgSoftwareUpgrade(): MsgSoftwareUpgrade { + return { + authority: "", + plan: Plan.fromPartial({}) + }; +} +export const MsgSoftwareUpgrade = { + typeUrl: "/cosmos.upgrade.v1beta1.MsgSoftwareUpgrade", + aminoType: "cosmos-sdk/MsgSoftwareUpgrade", + is(o: any): o is MsgSoftwareUpgrade { + return o && (o.$typeUrl === MsgSoftwareUpgrade.typeUrl || typeof o.authority === "string" && Plan.is(o.plan)); + }, + isSDK(o: any): o is MsgSoftwareUpgradeSDKType { + return o && (o.$typeUrl === MsgSoftwareUpgrade.typeUrl || typeof o.authority === "string" && Plan.isSDK(o.plan)); + }, + isAmino(o: any): o is MsgSoftwareUpgradeAmino { + return o && (o.$typeUrl === MsgSoftwareUpgrade.typeUrl || typeof o.authority === "string" && Plan.isAmino(o.plan)); + }, + encode(message: MsgSoftwareUpgrade, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.authority !== "") { + writer.uint32(10).string(message.authority); + } + if (message.plan !== undefined) { + Plan.encode(message.plan, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgSoftwareUpgrade { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgSoftwareUpgrade(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.authority = reader.string(); + break; + case 2: + message.plan = Plan.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): MsgSoftwareUpgrade { + return { + authority: isSet(object.authority) ? String(object.authority) : "", + plan: isSet(object.plan) ? Plan.fromJSON(object.plan) : undefined + }; + }, + toJSON(message: MsgSoftwareUpgrade): unknown { + const obj: any = {}; + message.authority !== undefined && (obj.authority = message.authority); + message.plan !== undefined && (obj.plan = message.plan ? Plan.toJSON(message.plan) : undefined); + return obj; + }, + fromPartial(object: Partial): MsgSoftwareUpgrade { + const message = createBaseMsgSoftwareUpgrade(); + message.authority = object.authority ?? ""; + message.plan = object.plan !== undefined && object.plan !== null ? Plan.fromPartial(object.plan) : undefined; + return message; + }, + fromAmino(object: MsgSoftwareUpgradeAmino): MsgSoftwareUpgrade { + const message = createBaseMsgSoftwareUpgrade(); + if (object.authority !== undefined && object.authority !== null) { + message.authority = object.authority; + } + if (object.plan !== undefined && object.plan !== null) { + message.plan = Plan.fromAmino(object.plan); + } + return message; + }, + toAmino(message: MsgSoftwareUpgrade): MsgSoftwareUpgradeAmino { + const obj: any = {}; + obj.authority = message.authority; + obj.plan = message.plan ? Plan.toAmino(message.plan) : Plan.fromPartial({}); + return obj; + }, + fromAminoMsg(object: MsgSoftwareUpgradeAminoMsg): MsgSoftwareUpgrade { + return MsgSoftwareUpgrade.fromAmino(object.value); + }, + toAminoMsg(message: MsgSoftwareUpgrade): MsgSoftwareUpgradeAminoMsg { + return { + type: "cosmos-sdk/MsgSoftwareUpgrade", + value: MsgSoftwareUpgrade.toAmino(message) + }; + }, + fromProtoMsg(message: MsgSoftwareUpgradeProtoMsg): MsgSoftwareUpgrade { + return MsgSoftwareUpgrade.decode(message.value); + }, + toProto(message: MsgSoftwareUpgrade): Uint8Array { + return MsgSoftwareUpgrade.encode(message).finish(); + }, + toProtoMsg(message: MsgSoftwareUpgrade): MsgSoftwareUpgradeProtoMsg { + return { + typeUrl: "/cosmos.upgrade.v1beta1.MsgSoftwareUpgrade", + value: MsgSoftwareUpgrade.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgSoftwareUpgrade.typeUrl, MsgSoftwareUpgrade); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgSoftwareUpgrade.aminoType, MsgSoftwareUpgrade.typeUrl); +function createBaseMsgSoftwareUpgradeResponse(): MsgSoftwareUpgradeResponse { + return {}; +} +export const MsgSoftwareUpgradeResponse = { + typeUrl: "/cosmos.upgrade.v1beta1.MsgSoftwareUpgradeResponse", + aminoType: "cosmos-sdk/MsgSoftwareUpgradeResponse", + is(o: any): o is MsgSoftwareUpgradeResponse { + return o && o.$typeUrl === MsgSoftwareUpgradeResponse.typeUrl; + }, + isSDK(o: any): o is MsgSoftwareUpgradeResponseSDKType { + return o && o.$typeUrl === MsgSoftwareUpgradeResponse.typeUrl; + }, + isAmino(o: any): o is MsgSoftwareUpgradeResponseAmino { + return o && o.$typeUrl === MsgSoftwareUpgradeResponse.typeUrl; + }, + encode(_: MsgSoftwareUpgradeResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgSoftwareUpgradeResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgSoftwareUpgradeResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(_: any): MsgSoftwareUpgradeResponse { + return {}; + }, + toJSON(_: MsgSoftwareUpgradeResponse): unknown { + const obj: any = {}; + return obj; + }, + fromPartial(_: Partial): MsgSoftwareUpgradeResponse { + const message = createBaseMsgSoftwareUpgradeResponse(); + return message; + }, + fromAmino(_: MsgSoftwareUpgradeResponseAmino): MsgSoftwareUpgradeResponse { + const message = createBaseMsgSoftwareUpgradeResponse(); + return message; + }, + toAmino(_: MsgSoftwareUpgradeResponse): MsgSoftwareUpgradeResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgSoftwareUpgradeResponseAminoMsg): MsgSoftwareUpgradeResponse { + return MsgSoftwareUpgradeResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgSoftwareUpgradeResponse): MsgSoftwareUpgradeResponseAminoMsg { + return { + type: "cosmos-sdk/MsgSoftwareUpgradeResponse", + value: MsgSoftwareUpgradeResponse.toAmino(message) + }; + }, + fromProtoMsg(message: MsgSoftwareUpgradeResponseProtoMsg): MsgSoftwareUpgradeResponse { + return MsgSoftwareUpgradeResponse.decode(message.value); + }, + toProto(message: MsgSoftwareUpgradeResponse): Uint8Array { + return MsgSoftwareUpgradeResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgSoftwareUpgradeResponse): MsgSoftwareUpgradeResponseProtoMsg { + return { + typeUrl: "/cosmos.upgrade.v1beta1.MsgSoftwareUpgradeResponse", + value: MsgSoftwareUpgradeResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgSoftwareUpgradeResponse.typeUrl, MsgSoftwareUpgradeResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgSoftwareUpgradeResponse.aminoType, MsgSoftwareUpgradeResponse.typeUrl); +function createBaseMsgCancelUpgrade(): MsgCancelUpgrade { + return { + authority: "" + }; +} +export const MsgCancelUpgrade = { + typeUrl: "/cosmos.upgrade.v1beta1.MsgCancelUpgrade", + aminoType: "cosmos-sdk/MsgCancelUpgrade", + is(o: any): o is MsgCancelUpgrade { + return o && (o.$typeUrl === MsgCancelUpgrade.typeUrl || typeof o.authority === "string"); + }, + isSDK(o: any): o is MsgCancelUpgradeSDKType { + return o && (o.$typeUrl === MsgCancelUpgrade.typeUrl || typeof o.authority === "string"); + }, + isAmino(o: any): o is MsgCancelUpgradeAmino { + return o && (o.$typeUrl === MsgCancelUpgrade.typeUrl || typeof o.authority === "string"); + }, + encode(message: MsgCancelUpgrade, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.authority !== "") { + writer.uint32(10).string(message.authority); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgCancelUpgrade { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgCancelUpgrade(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.authority = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): MsgCancelUpgrade { + return { + authority: isSet(object.authority) ? String(object.authority) : "" + }; + }, + toJSON(message: MsgCancelUpgrade): unknown { + const obj: any = {}; + message.authority !== undefined && (obj.authority = message.authority); + return obj; + }, + fromPartial(object: Partial): MsgCancelUpgrade { + const message = createBaseMsgCancelUpgrade(); + message.authority = object.authority ?? ""; + return message; + }, + fromAmino(object: MsgCancelUpgradeAmino): MsgCancelUpgrade { + const message = createBaseMsgCancelUpgrade(); + if (object.authority !== undefined && object.authority !== null) { + message.authority = object.authority; + } + return message; + }, + toAmino(message: MsgCancelUpgrade): MsgCancelUpgradeAmino { + const obj: any = {}; + obj.authority = message.authority; + return obj; + }, + fromAminoMsg(object: MsgCancelUpgradeAminoMsg): MsgCancelUpgrade { + return MsgCancelUpgrade.fromAmino(object.value); + }, + toAminoMsg(message: MsgCancelUpgrade): MsgCancelUpgradeAminoMsg { + return { + type: "cosmos-sdk/MsgCancelUpgrade", + value: MsgCancelUpgrade.toAmino(message) + }; + }, + fromProtoMsg(message: MsgCancelUpgradeProtoMsg): MsgCancelUpgrade { + return MsgCancelUpgrade.decode(message.value); + }, + toProto(message: MsgCancelUpgrade): Uint8Array { + return MsgCancelUpgrade.encode(message).finish(); + }, + toProtoMsg(message: MsgCancelUpgrade): MsgCancelUpgradeProtoMsg { + return { + typeUrl: "/cosmos.upgrade.v1beta1.MsgCancelUpgrade", + value: MsgCancelUpgrade.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgCancelUpgrade.typeUrl, MsgCancelUpgrade); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgCancelUpgrade.aminoType, MsgCancelUpgrade.typeUrl); +function createBaseMsgCancelUpgradeResponse(): MsgCancelUpgradeResponse { + return {}; +} +export const MsgCancelUpgradeResponse = { + typeUrl: "/cosmos.upgrade.v1beta1.MsgCancelUpgradeResponse", + aminoType: "cosmos-sdk/MsgCancelUpgradeResponse", + is(o: any): o is MsgCancelUpgradeResponse { + return o && o.$typeUrl === MsgCancelUpgradeResponse.typeUrl; + }, + isSDK(o: any): o is MsgCancelUpgradeResponseSDKType { + return o && o.$typeUrl === MsgCancelUpgradeResponse.typeUrl; + }, + isAmino(o: any): o is MsgCancelUpgradeResponseAmino { + return o && o.$typeUrl === MsgCancelUpgradeResponse.typeUrl; + }, + encode(_: MsgCancelUpgradeResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgCancelUpgradeResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgCancelUpgradeResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(_: any): MsgCancelUpgradeResponse { + return {}; + }, + toJSON(_: MsgCancelUpgradeResponse): unknown { + const obj: any = {}; + return obj; + }, + fromPartial(_: Partial): MsgCancelUpgradeResponse { + const message = createBaseMsgCancelUpgradeResponse(); + return message; + }, + fromAmino(_: MsgCancelUpgradeResponseAmino): MsgCancelUpgradeResponse { + const message = createBaseMsgCancelUpgradeResponse(); + return message; + }, + toAmino(_: MsgCancelUpgradeResponse): MsgCancelUpgradeResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgCancelUpgradeResponseAminoMsg): MsgCancelUpgradeResponse { + return MsgCancelUpgradeResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgCancelUpgradeResponse): MsgCancelUpgradeResponseAminoMsg { + return { + type: "cosmos-sdk/MsgCancelUpgradeResponse", + value: MsgCancelUpgradeResponse.toAmino(message) + }; + }, + fromProtoMsg(message: MsgCancelUpgradeResponseProtoMsg): MsgCancelUpgradeResponse { + return MsgCancelUpgradeResponse.decode(message.value); + }, + toProto(message: MsgCancelUpgradeResponse): Uint8Array { + return MsgCancelUpgradeResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgCancelUpgradeResponse): MsgCancelUpgradeResponseProtoMsg { + return { + typeUrl: "/cosmos.upgrade.v1beta1.MsgCancelUpgradeResponse", + value: MsgCancelUpgradeResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgCancelUpgradeResponse.typeUrl, MsgCancelUpgradeResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgCancelUpgradeResponse.aminoType, MsgCancelUpgradeResponse.typeUrl); \ No newline at end of file diff --git a/packages/osmojs/src/codegen/cosmos/upgrade/v1beta1/upgrade.ts b/packages/osmojs/src/codegen/cosmos/upgrade/v1beta1/upgrade.ts index 26e473411..b59214814 100644 --- a/packages/osmojs/src/codegen/cosmos/upgrade/v1beta1/upgrade.ts +++ b/packages/osmojs/src/codegen/cosmos/upgrade/v1beta1/upgrade.ts @@ -1,7 +1,8 @@ import { Timestamp } from "../../../google/protobuf/timestamp"; import { Any, AnyAmino, AnySDKType } from "../../../google/protobuf/any"; import { BinaryReader, BinaryWriter } from "../../../binary"; -import { toTimestamp, fromTimestamp } from "../../../helpers"; +import { toTimestamp, fromTimestamp, isSet } from "../../../helpers"; +import { GlobalDecoderRegistry } from "../../../registry"; /** Plan specifies information about a planned upgrade and when it should occur. */ export interface Plan { /** @@ -21,10 +22,7 @@ export interface Plan { */ /** @deprecated */ time: Date; - /** - * The height at which the upgrade must be performed. - * Only used if Time is not set. - */ + /** The height at which the upgrade must be performed. */ height: bigint; /** * Any application specific upgrade info to be included on-chain @@ -37,7 +35,7 @@ export interface Plan { * If this field is not empty, an error will be thrown. */ /** @deprecated */ - upgradedClientState: Any; + upgradedClientState?: Any; } export interface PlanProtoMsg { typeUrl: "/cosmos.upgrade.v1beta1.Plan"; @@ -54,24 +52,21 @@ export interface PlanAmino { * 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. * If this field is not empty, an error will be thrown. */ /** @deprecated */ - time?: Date; - /** - * The height at which the upgrade must be performed. - * Only used if Time is not set. - */ - height: string; + time: string; + /** The height at which the upgrade must be performed. */ + height?: string; /** * 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. @@ -92,15 +87,22 @@ export interface PlanSDKType { height: bigint; info: string; /** @deprecated */ - upgraded_client_state: AnySDKType; + upgraded_client_state?: AnySDKType; } /** * SoftwareUpgradeProposal is a gov Content type for initiating a software * upgrade. + * Deprecated: This legacy proposal is deprecated in favor of Msg-based gov + * proposals, see MsgSoftwareUpgrade. */ +/** @deprecated */ export interface SoftwareUpgradeProposal { + $typeUrl?: "/cosmos.upgrade.v1beta1.SoftwareUpgradeProposal"; + /** title of the proposal */ title: string; + /** description of the proposal */ description: string; + /** plan of the proposal */ plan: Plan; } export interface SoftwareUpgradeProposalProtoMsg { @@ -110,11 +112,17 @@ export interface SoftwareUpgradeProposalProtoMsg { /** * SoftwareUpgradeProposal is a gov Content type for initiating a software * upgrade. + * Deprecated: This legacy proposal is deprecated in favor of Msg-based gov + * proposals, see MsgSoftwareUpgrade. */ +/** @deprecated */ export interface SoftwareUpgradeProposalAmino { - title: string; - description: string; - plan?: PlanAmino; + /** title of the proposal */ + title?: string; + /** description of the proposal */ + description?: string; + /** plan of the proposal */ + plan: PlanAmino; } export interface SoftwareUpgradeProposalAminoMsg { type: "cosmos-sdk/SoftwareUpgradeProposal"; @@ -123,8 +131,12 @@ export interface SoftwareUpgradeProposalAminoMsg { /** * SoftwareUpgradeProposal is a gov Content type for initiating a software * upgrade. + * Deprecated: This legacy proposal is deprecated in favor of Msg-based gov + * proposals, see MsgSoftwareUpgrade. */ +/** @deprecated */ export interface SoftwareUpgradeProposalSDKType { + $typeUrl?: "/cosmos.upgrade.v1beta1.SoftwareUpgradeProposal"; title: string; description: string; plan: PlanSDKType; @@ -132,9 +144,15 @@ export interface SoftwareUpgradeProposalSDKType { /** * CancelSoftwareUpgradeProposal is a gov Content type for cancelling a software * upgrade. + * Deprecated: This legacy proposal is deprecated in favor of Msg-based gov + * proposals, see MsgCancelUpgrade. */ +/** @deprecated */ export interface CancelSoftwareUpgradeProposal { + $typeUrl?: "/cosmos.upgrade.v1beta1.CancelSoftwareUpgradeProposal"; + /** title of the proposal */ title: string; + /** description of the proposal */ description: string; } export interface CancelSoftwareUpgradeProposalProtoMsg { @@ -144,10 +162,15 @@ export interface CancelSoftwareUpgradeProposalProtoMsg { /** * CancelSoftwareUpgradeProposal is a gov Content type for cancelling a software * upgrade. + * Deprecated: This legacy proposal is deprecated in favor of Msg-based gov + * proposals, see MsgCancelUpgrade. */ +/** @deprecated */ export interface CancelSoftwareUpgradeProposalAmino { - title: string; - description: string; + /** title of the proposal */ + title?: string; + /** description of the proposal */ + description?: string; } export interface CancelSoftwareUpgradeProposalAminoMsg { type: "cosmos-sdk/CancelSoftwareUpgradeProposal"; @@ -156,8 +179,12 @@ export interface CancelSoftwareUpgradeProposalAminoMsg { /** * CancelSoftwareUpgradeProposal is a gov Content type for cancelling a software * upgrade. + * Deprecated: This legacy proposal is deprecated in favor of Msg-based gov + * proposals, see MsgCancelUpgrade. */ +/** @deprecated */ export interface CancelSoftwareUpgradeProposalSDKType { + $typeUrl?: "/cosmos.upgrade.v1beta1.CancelSoftwareUpgradeProposal"; title: string; description: string; } @@ -183,9 +210,9 @@ export interface ModuleVersionProtoMsg { */ export interface ModuleVersionAmino { /** name of the app module */ - name: string; + name?: string; /** consensus version of the app module */ - version: string; + version?: string; } export interface ModuleVersionAminoMsg { type: "cosmos-sdk/ModuleVersion"; @@ -203,7 +230,7 @@ export interface ModuleVersionSDKType { function createBasePlan(): Plan { return { name: "", - time: undefined, + time: new Date(), height: BigInt(0), info: "", upgradedClientState: undefined @@ -211,6 +238,16 @@ function createBasePlan(): Plan { } export const Plan = { typeUrl: "/cosmos.upgrade.v1beta1.Plan", + aminoType: "cosmos-sdk/Plan", + is(o: any): o is Plan { + return o && (o.$typeUrl === Plan.typeUrl || typeof o.name === "string" && Timestamp.is(o.time) && typeof o.height === "bigint" && typeof o.info === "string"); + }, + isSDK(o: any): o is PlanSDKType { + return o && (o.$typeUrl === Plan.typeUrl || typeof o.name === "string" && Timestamp.isSDK(o.time) && typeof o.height === "bigint" && typeof o.info === "string"); + }, + isAmino(o: any): o is PlanAmino { + return o && (o.$typeUrl === Plan.typeUrl || typeof o.name === "string" && Timestamp.isAmino(o.time) && typeof o.height === "bigint" && typeof o.info === "string"); + }, encode(message: Plan, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.name !== "") { writer.uint32(10).string(message.name); @@ -258,6 +295,24 @@ export const Plan = { } return message; }, + fromJSON(object: any): Plan { + return { + name: isSet(object.name) ? String(object.name) : "", + time: isSet(object.time) ? new Date(object.time) : undefined, + height: isSet(object.height) ? BigInt(object.height.toString()) : BigInt(0), + info: isSet(object.info) ? String(object.info) : "", + 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 || BigInt(0)).toString()); + message.info !== undefined && (obj.info = message.info); + message.upgradedClientState !== undefined && (obj.upgradedClientState = message.upgradedClientState ? Any.toJSON(message.upgradedClientState) : undefined); + return obj; + }, fromPartial(object: Partial): Plan { const message = createBasePlan(); message.name = object.name ?? ""; @@ -268,18 +323,28 @@ export const Plan = { return message; }, fromAmino(object: PlanAmino): Plan { - return { - name: object.name, - time: object.time, - height: BigInt(object.height), - info: object.info, - upgradedClientState: object?.upgraded_client_state ? Any.fromAmino(object.upgraded_client_state) : undefined - }; + const message = createBasePlan(); + if (object.name !== undefined && object.name !== null) { + message.name = object.name; + } + if (object.time !== undefined && object.time !== null) { + message.time = fromTimestamp(Timestamp.fromAmino(object.time)); + } + if (object.height !== undefined && object.height !== null) { + message.height = BigInt(object.height); + } + if (object.info !== undefined && object.info !== null) { + message.info = object.info; + } + if (object.upgraded_client_state !== undefined && object.upgraded_client_state !== null) { + message.upgradedClientState = Any.fromAmino(object.upgraded_client_state); + } + return message; }, toAmino(message: Plan): PlanAmino { const obj: any = {}; obj.name = message.name; - obj.time = message.time; + obj.time = message.time ? Timestamp.toAmino(toTimestamp(message.time)) : new Date(); obj.height = message.height ? message.height.toString() : undefined; obj.info = message.info; obj.upgraded_client_state = message.upgradedClientState ? Any.toAmino(message.upgradedClientState) : undefined; @@ -307,8 +372,11 @@ export const Plan = { }; } }; +GlobalDecoderRegistry.register(Plan.typeUrl, Plan); +GlobalDecoderRegistry.registerAminoProtoMapping(Plan.aminoType, Plan.typeUrl); function createBaseSoftwareUpgradeProposal(): SoftwareUpgradeProposal { return { + $typeUrl: "/cosmos.upgrade.v1beta1.SoftwareUpgradeProposal", title: "", description: "", plan: Plan.fromPartial({}) @@ -316,6 +384,16 @@ function createBaseSoftwareUpgradeProposal(): SoftwareUpgradeProposal { } export const SoftwareUpgradeProposal = { typeUrl: "/cosmos.upgrade.v1beta1.SoftwareUpgradeProposal", + aminoType: "cosmos-sdk/SoftwareUpgradeProposal", + is(o: any): o is SoftwareUpgradeProposal { + return o && (o.$typeUrl === SoftwareUpgradeProposal.typeUrl || typeof o.title === "string" && typeof o.description === "string" && Plan.is(o.plan)); + }, + isSDK(o: any): o is SoftwareUpgradeProposalSDKType { + return o && (o.$typeUrl === SoftwareUpgradeProposal.typeUrl || typeof o.title === "string" && typeof o.description === "string" && Plan.isSDK(o.plan)); + }, + isAmino(o: any): o is SoftwareUpgradeProposalAmino { + return o && (o.$typeUrl === SoftwareUpgradeProposal.typeUrl || typeof o.title === "string" && typeof o.description === "string" && Plan.isAmino(o.plan)); + }, encode(message: SoftwareUpgradeProposal, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.title !== "") { writer.uint32(10).string(message.title); @@ -351,6 +429,20 @@ export const SoftwareUpgradeProposal = { } return message; }, + fromJSON(object: any): SoftwareUpgradeProposal { + return { + 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; + }, fromPartial(object: Partial): SoftwareUpgradeProposal { const message = createBaseSoftwareUpgradeProposal(); message.title = object.title ?? ""; @@ -359,17 +451,23 @@ export const SoftwareUpgradeProposal = { return message; }, fromAmino(object: SoftwareUpgradeProposalAmino): SoftwareUpgradeProposal { - return { - title: object.title, - description: object.description, - plan: object?.plan ? Plan.fromAmino(object.plan) : undefined - }; + const message = createBaseSoftwareUpgradeProposal(); + if (object.title !== undefined && object.title !== null) { + message.title = object.title; + } + if (object.description !== undefined && object.description !== null) { + message.description = object.description; + } + if (object.plan !== undefined && object.plan !== null) { + message.plan = Plan.fromAmino(object.plan); + } + return message; }, toAmino(message: SoftwareUpgradeProposal): SoftwareUpgradeProposalAmino { const obj: any = {}; obj.title = message.title; obj.description = message.description; - obj.plan = message.plan ? Plan.toAmino(message.plan) : undefined; + obj.plan = message.plan ? Plan.toAmino(message.plan) : Plan.fromPartial({}); return obj; }, fromAminoMsg(object: SoftwareUpgradeProposalAminoMsg): SoftwareUpgradeProposal { @@ -394,14 +492,27 @@ export const SoftwareUpgradeProposal = { }; } }; +GlobalDecoderRegistry.register(SoftwareUpgradeProposal.typeUrl, SoftwareUpgradeProposal); +GlobalDecoderRegistry.registerAminoProtoMapping(SoftwareUpgradeProposal.aminoType, SoftwareUpgradeProposal.typeUrl); function createBaseCancelSoftwareUpgradeProposal(): CancelSoftwareUpgradeProposal { return { + $typeUrl: "/cosmos.upgrade.v1beta1.CancelSoftwareUpgradeProposal", title: "", description: "" }; } export const CancelSoftwareUpgradeProposal = { typeUrl: "/cosmos.upgrade.v1beta1.CancelSoftwareUpgradeProposal", + aminoType: "cosmos-sdk/CancelSoftwareUpgradeProposal", + is(o: any): o is CancelSoftwareUpgradeProposal { + return o && (o.$typeUrl === CancelSoftwareUpgradeProposal.typeUrl || typeof o.title === "string" && typeof o.description === "string"); + }, + isSDK(o: any): o is CancelSoftwareUpgradeProposalSDKType { + return o && (o.$typeUrl === CancelSoftwareUpgradeProposal.typeUrl || typeof o.title === "string" && typeof o.description === "string"); + }, + isAmino(o: any): o is CancelSoftwareUpgradeProposalAmino { + return o && (o.$typeUrl === CancelSoftwareUpgradeProposal.typeUrl || typeof o.title === "string" && typeof o.description === "string"); + }, encode(message: CancelSoftwareUpgradeProposal, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.title !== "") { writer.uint32(10).string(message.title); @@ -431,6 +542,18 @@ export const CancelSoftwareUpgradeProposal = { } 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; + }, fromPartial(object: Partial): CancelSoftwareUpgradeProposal { const message = createBaseCancelSoftwareUpgradeProposal(); message.title = object.title ?? ""; @@ -438,10 +561,14 @@ export const CancelSoftwareUpgradeProposal = { return message; }, fromAmino(object: CancelSoftwareUpgradeProposalAmino): CancelSoftwareUpgradeProposal { - return { - title: object.title, - description: object.description - }; + const message = createBaseCancelSoftwareUpgradeProposal(); + if (object.title !== undefined && object.title !== null) { + message.title = object.title; + } + if (object.description !== undefined && object.description !== null) { + message.description = object.description; + } + return message; }, toAmino(message: CancelSoftwareUpgradeProposal): CancelSoftwareUpgradeProposalAmino { const obj: any = {}; @@ -471,6 +598,8 @@ export const CancelSoftwareUpgradeProposal = { }; } }; +GlobalDecoderRegistry.register(CancelSoftwareUpgradeProposal.typeUrl, CancelSoftwareUpgradeProposal); +GlobalDecoderRegistry.registerAminoProtoMapping(CancelSoftwareUpgradeProposal.aminoType, CancelSoftwareUpgradeProposal.typeUrl); function createBaseModuleVersion(): ModuleVersion { return { name: "", @@ -479,6 +608,16 @@ function createBaseModuleVersion(): ModuleVersion { } export const ModuleVersion = { typeUrl: "/cosmos.upgrade.v1beta1.ModuleVersion", + aminoType: "cosmos-sdk/ModuleVersion", + is(o: any): o is ModuleVersion { + return o && (o.$typeUrl === ModuleVersion.typeUrl || typeof o.name === "string" && typeof o.version === "bigint"); + }, + isSDK(o: any): o is ModuleVersionSDKType { + return o && (o.$typeUrl === ModuleVersion.typeUrl || typeof o.name === "string" && typeof o.version === "bigint"); + }, + isAmino(o: any): o is ModuleVersionAmino { + return o && (o.$typeUrl === ModuleVersion.typeUrl || typeof o.name === "string" && typeof o.version === "bigint"); + }, encode(message: ModuleVersion, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.name !== "") { writer.uint32(10).string(message.name); @@ -508,6 +647,18 @@ export const ModuleVersion = { } return message; }, + fromJSON(object: any): ModuleVersion { + return { + name: isSet(object.name) ? String(object.name) : "", + version: isSet(object.version) ? BigInt(object.version.toString()) : BigInt(0) + }; + }, + toJSON(message: ModuleVersion): unknown { + const obj: any = {}; + message.name !== undefined && (obj.name = message.name); + message.version !== undefined && (obj.version = (message.version || BigInt(0)).toString()); + return obj; + }, fromPartial(object: Partial): ModuleVersion { const message = createBaseModuleVersion(); message.name = object.name ?? ""; @@ -515,10 +666,14 @@ export const ModuleVersion = { return message; }, fromAmino(object: ModuleVersionAmino): ModuleVersion { - return { - name: object.name, - version: BigInt(object.version) - }; + const message = createBaseModuleVersion(); + if (object.name !== undefined && object.name !== null) { + message.name = object.name; + } + if (object.version !== undefined && object.version !== null) { + message.version = BigInt(object.version); + } + return message; }, toAmino(message: ModuleVersion): ModuleVersionAmino { const obj: any = {}; @@ -547,4 +702,6 @@ export const ModuleVersion = { value: ModuleVersion.encode(message).finish() }; } -}; \ No newline at end of file +}; +GlobalDecoderRegistry.register(ModuleVersion.typeUrl, ModuleVersion); +GlobalDecoderRegistry.registerAminoProtoMapping(ModuleVersion.aminoType, ModuleVersion.typeUrl); \ No newline at end of file diff --git a/packages/osmojs/src/codegen/cosmos_proto/bundle.ts b/packages/osmojs/src/codegen/cosmos_proto/bundle.ts index b1006fb9c..582512679 100644 --- a/packages/osmojs/src/codegen/cosmos_proto/bundle.ts +++ b/packages/osmojs/src/codegen/cosmos_proto/bundle.ts @@ -1,4 +1,4 @@ -import * as _172 from "./cosmos"; +import * as _230 from "./cosmos"; export const cosmos_proto = { - ..._172 + ..._230 }; \ No newline at end of file diff --git a/packages/osmojs/src/codegen/cosmos_proto/cosmos.ts b/packages/osmojs/src/codegen/cosmos_proto/cosmos.ts index 52b443e99..6be50b41d 100644 --- a/packages/osmojs/src/codegen/cosmos_proto/cosmos.ts +++ b/packages/osmojs/src/codegen/cosmos_proto/cosmos.ts @@ -1,4 +1,6 @@ import { BinaryReader, BinaryWriter } from "../binary"; +import { isSet } from "../helpers"; +import { GlobalDecoderRegistry } from "../registry"; export enum ScalarType { SCALAR_TYPE_UNSPECIFIED = 0, SCALAR_TYPE_STRING = 1, @@ -70,12 +72,12 @@ export interface InterfaceDescriptorAmino { * package.name, ex. for the package a.b and interface named C, the * fully-qualified name will be a.b.C. */ - name: string; + name?: string; /** * description is a human-readable description of the interface and its * purpose. */ - description: string; + description?: string; } export interface InterfaceDescriptorAminoMsg { type: "/cosmos_proto.InterfaceDescriptor"; @@ -140,20 +142,20 @@ export interface ScalarDescriptorAmino { * package.name, ex. for the package a.b and scalar named C, the * fully-qualified name will be a.b.C. */ - name: string; + name?: string; /** * description is a human-readable description of the scalar and its * encoding format. For instance a big integer or decimal scalar should * specify precisely the expected encoding format. */ - description: string; + description?: string; /** * field_type is the type of field with which this scalar can be used. * Scalars can be used with one and only one type of field so that * encoding standards and simple and clear. Currently only string and * bytes fields are supported for scalars. */ - field_type: ScalarType[]; + field_type?: ScalarType[]; } export interface ScalarDescriptorAminoMsg { type: "/cosmos_proto.ScalarDescriptor"; @@ -181,6 +183,15 @@ function createBaseInterfaceDescriptor(): InterfaceDescriptor { } export const InterfaceDescriptor = { typeUrl: "/cosmos_proto.InterfaceDescriptor", + is(o: any): o is InterfaceDescriptor { + return o && (o.$typeUrl === InterfaceDescriptor.typeUrl || typeof o.name === "string" && typeof o.description === "string"); + }, + isSDK(o: any): o is InterfaceDescriptorSDKType { + return o && (o.$typeUrl === InterfaceDescriptor.typeUrl || typeof o.name === "string" && typeof o.description === "string"); + }, + isAmino(o: any): o is InterfaceDescriptorAmino { + return o && (o.$typeUrl === InterfaceDescriptor.typeUrl || typeof o.name === "string" && typeof o.description === "string"); + }, encode(message: InterfaceDescriptor, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.name !== "") { writer.uint32(10).string(message.name); @@ -210,6 +221,18 @@ export const InterfaceDescriptor = { } return message; }, + fromJSON(object: any): InterfaceDescriptor { + return { + name: isSet(object.name) ? String(object.name) : "", + description: isSet(object.description) ? String(object.description) : "" + }; + }, + toJSON(message: InterfaceDescriptor): unknown { + const obj: any = {}; + message.name !== undefined && (obj.name = message.name); + message.description !== undefined && (obj.description = message.description); + return obj; + }, fromPartial(object: Partial): InterfaceDescriptor { const message = createBaseInterfaceDescriptor(); message.name = object.name ?? ""; @@ -217,10 +240,14 @@ export const InterfaceDescriptor = { return message; }, fromAmino(object: InterfaceDescriptorAmino): InterfaceDescriptor { - return { - name: object.name, - description: object.description - }; + const message = createBaseInterfaceDescriptor(); + if (object.name !== undefined && object.name !== null) { + message.name = object.name; + } + if (object.description !== undefined && object.description !== null) { + message.description = object.description; + } + return message; }, toAmino(message: InterfaceDescriptor): InterfaceDescriptorAmino { const obj: any = {}; @@ -244,6 +271,7 @@ export const InterfaceDescriptor = { }; } }; +GlobalDecoderRegistry.register(InterfaceDescriptor.typeUrl, InterfaceDescriptor); function createBaseScalarDescriptor(): ScalarDescriptor { return { name: "", @@ -253,6 +281,15 @@ function createBaseScalarDescriptor(): ScalarDescriptor { } export const ScalarDescriptor = { typeUrl: "/cosmos_proto.ScalarDescriptor", + is(o: any): o is ScalarDescriptor { + return o && (o.$typeUrl === ScalarDescriptor.typeUrl || typeof o.name === "string" && typeof o.description === "string" && Array.isArray(o.fieldType)); + }, + isSDK(o: any): o is ScalarDescriptorSDKType { + return o && (o.$typeUrl === ScalarDescriptor.typeUrl || typeof o.name === "string" && typeof o.description === "string" && Array.isArray(o.field_type)); + }, + isAmino(o: any): o is ScalarDescriptorAmino { + return o && (o.$typeUrl === ScalarDescriptor.typeUrl || typeof o.name === "string" && typeof o.description === "string" && Array.isArray(o.field_type)); + }, encode(message: ScalarDescriptor, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.name !== "") { writer.uint32(10).string(message.name); @@ -297,6 +334,24 @@ export const ScalarDescriptor = { } return message; }, + fromJSON(object: any): ScalarDescriptor { + return { + name: isSet(object.name) ? String(object.name) : "", + description: isSet(object.description) ? String(object.description) : "", + fieldType: Array.isArray(object?.fieldType) ? object.fieldType.map((e: any) => scalarTypeFromJSON(e)) : [] + }; + }, + toJSON(message: ScalarDescriptor): unknown { + const obj: any = {}; + message.name !== undefined && (obj.name = message.name); + message.description !== undefined && (obj.description = message.description); + if (message.fieldType) { + obj.fieldType = message.fieldType.map(e => scalarTypeToJSON(e)); + } else { + obj.fieldType = []; + } + return obj; + }, fromPartial(object: Partial): ScalarDescriptor { const message = createBaseScalarDescriptor(); message.name = object.name ?? ""; @@ -305,11 +360,15 @@ export const ScalarDescriptor = { return message; }, fromAmino(object: ScalarDescriptorAmino): ScalarDescriptor { - return { - name: object.name, - description: object.description, - fieldType: Array.isArray(object?.field_type) ? object.field_type.map((e: any) => scalarTypeFromJSON(e)) : [] - }; + const message = createBaseScalarDescriptor(); + if (object.name !== undefined && object.name !== null) { + message.name = object.name; + } + if (object.description !== undefined && object.description !== null) { + message.description = object.description; + } + message.fieldType = object.field_type?.map(e => scalarTypeFromJSON(e)) || []; + return message; }, toAmino(message: ScalarDescriptor): ScalarDescriptorAmino { const obj: any = {}; @@ -337,4 +396,5 @@ export const ScalarDescriptor = { value: ScalarDescriptor.encode(message).finish() }; } -}; \ No newline at end of file +}; +GlobalDecoderRegistry.register(ScalarDescriptor.typeUrl, ScalarDescriptor); \ No newline at end of file diff --git a/packages/osmojs/src/codegen/cosmwasm/bundle.ts b/packages/osmojs/src/codegen/cosmwasm/bundle.ts index ce8e13222..95c13af28 100644 --- a/packages/osmojs/src/codegen/cosmwasm/bundle.ts +++ b/packages/osmojs/src/codegen/cosmwasm/bundle.ts @@ -1,38 +1,38 @@ -import * as _82 from "./wasm/v1/authz"; -import * as _83 from "./wasm/v1/genesis"; -import * as _84 from "./wasm/v1/ibc"; -import * as _85 from "./wasm/v1/proposal"; -import * as _86 from "./wasm/v1/query"; -import * as _87 from "./wasm/v1/tx"; -import * as _88 from "./wasm/v1/types"; -import * as _255 from "./wasm/v1/tx.amino"; -import * as _256 from "./wasm/v1/tx.registry"; -import * as _257 from "./wasm/v1/query.lcd"; -import * as _258 from "./wasm/v1/query.rpc.Query"; -import * as _259 from "./wasm/v1/tx.rpc.msg"; -import * as _338 from "./lcd"; -import * as _339 from "./rpc.query"; -import * as _340 from "./rpc.tx"; +import * as _132 from "./wasm/v1/authz"; +import * as _133 from "./wasm/v1/genesis"; +import * as _134 from "./wasm/v1/ibc"; +import * as _135 from "./wasm/v1/proposal_legacy"; +import * as _136 from "./wasm/v1/query"; +import * as _137 from "./wasm/v1/tx"; +import * as _138 from "./wasm/v1/types"; +import * as _324 from "./wasm/v1/tx.amino"; +import * as _325 from "./wasm/v1/tx.registry"; +import * as _326 from "./wasm/v1/query.lcd"; +import * as _327 from "./wasm/v1/query.rpc.Query"; +import * as _328 from "./wasm/v1/tx.rpc.msg"; +import * as _412 from "./lcd"; +import * as _413 from "./rpc.query"; +import * as _414 from "./rpc.tx"; export namespace cosmwasm { export namespace wasm { export const v1 = { - ..._82, - ..._83, - ..._84, - ..._85, - ..._86, - ..._87, - ..._88, - ..._255, - ..._256, - ..._257, - ..._258, - ..._259 + ..._132, + ..._133, + ..._134, + ..._135, + ..._136, + ..._137, + ..._138, + ..._324, + ..._325, + ..._326, + ..._327, + ..._328 }; } export const ClientFactory = { - ..._338, - ..._339, - ..._340 + ..._412, + ..._413, + ..._414 }; } \ No newline at end of file diff --git a/packages/osmojs/src/codegen/cosmwasm/lcd.ts b/packages/osmojs/src/codegen/cosmwasm/lcd.ts index 9903c8950..a2e0874f1 100644 --- a/packages/osmojs/src/codegen/cosmwasm/lcd.ts +++ b/packages/osmojs/src/codegen/cosmwasm/lcd.ts @@ -31,6 +31,11 @@ export const createLCDClient = async ({ }) } }, + consensus: { + v1: new (await import("../cosmos/consensus/v1/query.lcd")).LCDQueryClient({ + requestClient + }) + }, distribution: { v1beta1: new (await import("../cosmos/distribution/v1beta1/query.lcd")).LCDQueryClient({ requestClient @@ -41,6 +46,11 @@ export const createLCDClient = async ({ requestClient }) }, + params: { + v1beta1: new (await import("../cosmos/params/v1beta1/query.lcd")).LCDQueryClient({ + requestClient + }) + }, staking: { v1beta1: new (await import("../cosmos/staking/v1beta1/query.lcd")).LCDQueryClient({ requestClient diff --git a/packages/osmojs/src/codegen/cosmwasm/rpc.query.ts b/packages/osmojs/src/codegen/cosmwasm/rpc.query.ts index d4d5bbabc..cd5c3e581 100644 --- a/packages/osmojs/src/codegen/cosmwasm/rpc.query.ts +++ b/packages/osmojs/src/codegen/cosmwasm/rpc.query.ts @@ -1,4 +1,4 @@ -import { HttpEndpoint, connectComet } from "@cosmjs/tendermint-rpc"; +import { connectComet, HttpEndpoint } from "@cosmjs/tendermint-rpc"; import { QueryClient } from "@cosmjs/stargate"; export const createRPCQueryClient = async ({ rpcEndpoint @@ -23,12 +23,23 @@ export const createRPCQueryClient = async ({ v1beta1: (await import("../cosmos/base/node/v1beta1/query.rpc.Service")).createRpcQueryExtension(client) } }, + consensus: { + v1: (await import("../cosmos/consensus/v1/query.rpc.Query")).createRpcQueryExtension(client) + }, distribution: { v1beta1: (await import("../cosmos/distribution/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) }, gov: { v1beta1: (await import("../cosmos/gov/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) }, + orm: { + query: { + v1alpha1: (await import("../cosmos/orm/query/v1alpha1/query.rpc.Query")).createRpcQueryExtension(client) + } + }, + params: { + v1beta1: (await import("../cosmos/params/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) + }, staking: { v1beta1: (await import("../cosmos/staking/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) }, diff --git a/packages/osmojs/src/codegen/cosmwasm/rpc.tx.ts b/packages/osmojs/src/codegen/cosmwasm/rpc.tx.ts index 7e0c81782..7c8765105 100644 --- a/packages/osmojs/src/codegen/cosmwasm/rpc.tx.ts +++ b/packages/osmojs/src/codegen/cosmwasm/rpc.tx.ts @@ -5,12 +5,18 @@ export const createRPCMsgClient = async ({ rpc: Rpc; }) => ({ cosmos: { + auth: { + v1beta1: new (await import("../cosmos/auth/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) + }, authz: { v1beta1: new (await import("../cosmos/authz/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) }, bank: { v1beta1: new (await import("../cosmos/bank/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) }, + consensus: { + v1: new (await import("../cosmos/consensus/v1/tx.rpc.msg")).MsgClientImpl(rpc) + }, distribution: { v1beta1: new (await import("../cosmos/distribution/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) }, @@ -19,6 +25,9 @@ export const createRPCMsgClient = async ({ }, staking: { v1beta1: new (await import("../cosmos/staking/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) + }, + upgrade: { + v1beta1: new (await import("../cosmos/upgrade/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) } }, cosmwasm: { diff --git a/packages/osmojs/src/codegen/cosmwasm/wasm/v1/authz.ts b/packages/osmojs/src/codegen/cosmwasm/wasm/v1/authz.ts index 7975dea7b..a9496de6f 100644 --- a/packages/osmojs/src/codegen/cosmwasm/wasm/v1/authz.ts +++ b/packages/osmojs/src/codegen/cosmwasm/wasm/v1/authz.ts @@ -1,12 +1,49 @@ +import { AccessConfig, AccessConfigAmino, AccessConfigSDKType } from "./types"; import { Any, AnyProtoMsg, AnyAmino, AnySDKType } from "../../../google/protobuf/any"; import { Coin, CoinAmino, CoinSDKType } from "../../../cosmos/base/v1beta1/coin"; import { BinaryReader, BinaryWriter } from "../../../binary"; +import { GlobalDecoderRegistry } from "../../../registry"; +import { isSet, bytesFromBase64, base64FromBytes } from "../../../helpers"; +import { toUtf8, fromUtf8 } from "@cosmjs/encoding"; +/** + * StoreCodeAuthorization defines authorization for wasm code upload. + * Since: wasmd 0.42 + */ +export interface StoreCodeAuthorization { + $typeUrl?: "/cosmwasm.wasm.v1.StoreCodeAuthorization"; + /** Grants for code upload */ + grants: CodeGrant[]; +} +export interface StoreCodeAuthorizationProtoMsg { + typeUrl: "/cosmwasm.wasm.v1.StoreCodeAuthorization"; + value: Uint8Array; +} +/** + * StoreCodeAuthorization defines authorization for wasm code upload. + * Since: wasmd 0.42 + */ +export interface StoreCodeAuthorizationAmino { + /** Grants for code upload */ + grants: CodeGrantAmino[]; +} +export interface StoreCodeAuthorizationAminoMsg { + type: "wasm/StoreCodeAuthorization"; + value: StoreCodeAuthorizationAmino; +} +/** + * StoreCodeAuthorization defines authorization for wasm code upload. + * Since: wasmd 0.42 + */ +export interface StoreCodeAuthorizationSDKType { + $typeUrl?: "/cosmwasm.wasm.v1.StoreCodeAuthorization"; + grants: CodeGrantSDKType[]; +} /** * ContractExecutionAuthorization defines authorization for wasm execute. * Since: wasmd 0.30 */ export interface ContractExecutionAuthorization { - $typeUrl?: string; + $typeUrl?: "/cosmwasm.wasm.v1.ContractExecutionAuthorization"; /** Grants for contract executions */ grants: ContractGrant[]; } @@ -31,7 +68,7 @@ export interface ContractExecutionAuthorizationAminoMsg { * Since: wasmd 0.30 */ export interface ContractExecutionAuthorizationSDKType { - $typeUrl?: string; + $typeUrl?: "/cosmwasm.wasm.v1.ContractExecutionAuthorization"; grants: ContractGrantSDKType[]; } /** @@ -39,7 +76,7 @@ export interface ContractExecutionAuthorizationSDKType { * migration. Since: wasmd 0.30 */ export interface ContractMigrationAuthorization { - $typeUrl?: string; + $typeUrl?: "/cosmwasm.wasm.v1.ContractMigrationAuthorization"; /** Grants for contract migrations */ grants: ContractGrant[]; } @@ -64,9 +101,50 @@ export interface ContractMigrationAuthorizationAminoMsg { * migration. Since: wasmd 0.30 */ export interface ContractMigrationAuthorizationSDKType { - $typeUrl?: string; + $typeUrl?: "/cosmwasm.wasm.v1.ContractMigrationAuthorization"; grants: ContractGrantSDKType[]; } +/** CodeGrant a granted permission for a single code */ +export interface CodeGrant { + /** + * CodeHash is the unique identifier created by wasmvm + * Wildcard "*" is used to specify any kind of grant. + */ + codeHash: Uint8Array; + /** + * InstantiatePermission is the superset access control to apply + * on contract creation. + * Optional + */ + instantiatePermission?: AccessConfig; +} +export interface CodeGrantProtoMsg { + typeUrl: "/cosmwasm.wasm.v1.CodeGrant"; + value: Uint8Array; +} +/** CodeGrant a granted permission for a single code */ +export interface CodeGrantAmino { + /** + * CodeHash is the unique identifier created by wasmvm + * Wildcard "*" is used to specify any kind of grant. + */ + code_hash?: string; + /** + * InstantiatePermission is the superset access control to apply + * on contract creation. + * Optional + */ + instantiate_permission?: AccessConfigAmino; +} +export interface CodeGrantAminoMsg { + type: "wasm/CodeGrant"; + value: CodeGrantAmino; +} +/** CodeGrant a granted permission for a single code */ +export interface CodeGrantSDKType { + code_hash: Uint8Array; + instantiate_permission?: AccessConfigSDKType; +} /** * ContractGrant a granted permission for a single contract * Since: wasmd 0.30 @@ -78,13 +156,13 @@ export interface ContractGrant { * Limit defines execution limits that are enforced and updated when the grant * is applied. When the limit lapsed the grant is removed. */ - limit: (MaxCallsLimit & MaxFundsLimit & CombinedLimit & Any) | undefined; + limit?: MaxCallsLimit | MaxFundsLimit | CombinedLimit | Any | undefined; /** * Filter define more fine-grained control on the message payload passed * to the contract in the operation. When no filter applies on execution, the * operation is prohibited. */ - filter: (AllowAllMessagesFilter & AcceptedMessageKeysFilter & AcceptedMessagesFilter & Any) | undefined; + filter?: AllowAllMessagesFilter | AcceptedMessageKeysFilter | AcceptedMessagesFilter | Any | undefined; } export interface ContractGrantProtoMsg { typeUrl: "/cosmwasm.wasm.v1.ContractGrant"; @@ -109,7 +187,7 @@ export type ContractGrantEncoded = Omit & { */ export interface ContractGrantAmino { /** Contract is the bech32 address of the smart contract */ - contract: string; + contract?: string; /** * Limit defines execution limits that are enforced and updated when the grant * is applied. When the limit lapsed the grant is removed. @@ -132,15 +210,15 @@ export interface ContractGrantAminoMsg { */ export interface ContractGrantSDKType { contract: string; - limit: MaxCallsLimitSDKType | MaxFundsLimitSDKType | CombinedLimitSDKType | AnySDKType | undefined; - filter: AllowAllMessagesFilterSDKType | AcceptedMessageKeysFilterSDKType | AcceptedMessagesFilterSDKType | AnySDKType | undefined; + limit?: MaxCallsLimitSDKType | MaxFundsLimitSDKType | CombinedLimitSDKType | AnySDKType | undefined; + filter?: AllowAllMessagesFilterSDKType | AcceptedMessageKeysFilterSDKType | AcceptedMessagesFilterSDKType | AnySDKType | undefined; } /** * MaxCallsLimit limited number of calls to the contract. No funds transferable. * Since: wasmd 0.30 */ export interface MaxCallsLimit { - $typeUrl?: string; + $typeUrl?: "/cosmwasm.wasm.v1.MaxCallsLimit"; /** Remaining number that is decremented on each execution */ remaining: bigint; } @@ -154,7 +232,7 @@ export interface MaxCallsLimitProtoMsg { */ export interface MaxCallsLimitAmino { /** Remaining number that is decremented on each execution */ - remaining: string; + remaining?: string; } export interface MaxCallsLimitAminoMsg { type: "wasm/MaxCallsLimit"; @@ -165,7 +243,7 @@ export interface MaxCallsLimitAminoMsg { * Since: wasmd 0.30 */ export interface MaxCallsLimitSDKType { - $typeUrl?: string; + $typeUrl?: "/cosmwasm.wasm.v1.MaxCallsLimit"; remaining: bigint; } /** @@ -173,7 +251,7 @@ export interface MaxCallsLimitSDKType { * Since: wasmd 0.30 */ export interface MaxFundsLimit { - $typeUrl?: string; + $typeUrl?: "/cosmwasm.wasm.v1.MaxFundsLimit"; /** Amounts is the maximal amount of tokens transferable to the contract. */ amounts: Coin[]; } @@ -198,7 +276,7 @@ export interface MaxFundsLimitAminoMsg { * Since: wasmd 0.30 */ export interface MaxFundsLimitSDKType { - $typeUrl?: string; + $typeUrl?: "/cosmwasm.wasm.v1.MaxFundsLimit"; amounts: CoinSDKType[]; } /** @@ -207,7 +285,7 @@ export interface MaxFundsLimitSDKType { * Since: wasmd 0.30 */ export interface CombinedLimit { - $typeUrl?: string; + $typeUrl?: "/cosmwasm.wasm.v1.CombinedLimit"; /** Remaining number that is decremented on each execution */ callsRemaining: bigint; /** Amounts is the maximal amount of tokens transferable to the contract. */ @@ -224,7 +302,7 @@ export interface CombinedLimitProtoMsg { */ export interface CombinedLimitAmino { /** Remaining number that is decremented on each execution */ - calls_remaining: string; + calls_remaining?: string; /** Amounts is the maximal amount of tokens transferable to the contract. */ amounts: CoinAmino[]; } @@ -238,7 +316,7 @@ export interface CombinedLimitAminoMsg { * Since: wasmd 0.30 */ export interface CombinedLimitSDKType { - $typeUrl?: string; + $typeUrl?: "/cosmwasm.wasm.v1.CombinedLimit"; calls_remaining: bigint; amounts: CoinSDKType[]; } @@ -248,7 +326,7 @@ export interface CombinedLimitSDKType { * Since: wasmd 0.30 */ export interface AllowAllMessagesFilter { - $typeUrl?: string; + $typeUrl?: "/cosmwasm.wasm.v1.AllowAllMessagesFilter"; } export interface AllowAllMessagesFilterProtoMsg { typeUrl: "/cosmwasm.wasm.v1.AllowAllMessagesFilter"; @@ -270,7 +348,7 @@ export interface AllowAllMessagesFilterAminoMsg { * Since: wasmd 0.30 */ export interface AllowAllMessagesFilterSDKType { - $typeUrl?: string; + $typeUrl?: "/cosmwasm.wasm.v1.AllowAllMessagesFilter"; } /** * AcceptedMessageKeysFilter accept only the specific contract message keys in @@ -278,7 +356,7 @@ export interface AllowAllMessagesFilterSDKType { * Since: wasmd 0.30 */ export interface AcceptedMessageKeysFilter { - $typeUrl?: string; + $typeUrl?: "/cosmwasm.wasm.v1.AcceptedMessageKeysFilter"; /** Messages is the list of unique keys */ keys: string[]; } @@ -293,7 +371,7 @@ export interface AcceptedMessageKeysFilterProtoMsg { */ export interface AcceptedMessageKeysFilterAmino { /** Messages is the list of unique keys */ - keys: string[]; + keys?: string[]; } export interface AcceptedMessageKeysFilterAminoMsg { type: "wasm/AcceptedMessageKeysFilter"; @@ -305,7 +383,7 @@ export interface AcceptedMessageKeysFilterAminoMsg { * Since: wasmd 0.30 */ export interface AcceptedMessageKeysFilterSDKType { - $typeUrl?: string; + $typeUrl?: "/cosmwasm.wasm.v1.AcceptedMessageKeysFilter"; keys: string[]; } /** @@ -314,7 +392,7 @@ export interface AcceptedMessageKeysFilterSDKType { * Since: wasmd 0.30 */ export interface AcceptedMessagesFilter { - $typeUrl?: string; + $typeUrl?: "/cosmwasm.wasm.v1.AcceptedMessagesFilter"; /** Messages is the list of raw contract messages */ messages: Uint8Array[]; } @@ -329,7 +407,7 @@ export interface AcceptedMessagesFilterProtoMsg { */ export interface AcceptedMessagesFilterAmino { /** Messages is the list of raw contract messages */ - messages: Uint8Array[]; + messages?: any[]; } export interface AcceptedMessagesFilterAminoMsg { type: "wasm/AcceptedMessagesFilter"; @@ -341,9 +419,107 @@ export interface AcceptedMessagesFilterAminoMsg { * Since: wasmd 0.30 */ export interface AcceptedMessagesFilterSDKType { - $typeUrl?: string; + $typeUrl?: "/cosmwasm.wasm.v1.AcceptedMessagesFilter"; messages: Uint8Array[]; } +function createBaseStoreCodeAuthorization(): StoreCodeAuthorization { + return { + $typeUrl: "/cosmwasm.wasm.v1.StoreCodeAuthorization", + grants: [] + }; +} +export const StoreCodeAuthorization = { + typeUrl: "/cosmwasm.wasm.v1.StoreCodeAuthorization", + aminoType: "wasm/StoreCodeAuthorization", + is(o: any): o is StoreCodeAuthorization { + return o && (o.$typeUrl === StoreCodeAuthorization.typeUrl || Array.isArray(o.grants) && (!o.grants.length || CodeGrant.is(o.grants[0]))); + }, + isSDK(o: any): o is StoreCodeAuthorizationSDKType { + return o && (o.$typeUrl === StoreCodeAuthorization.typeUrl || Array.isArray(o.grants) && (!o.grants.length || CodeGrant.isSDK(o.grants[0]))); + }, + isAmino(o: any): o is StoreCodeAuthorizationAmino { + return o && (o.$typeUrl === StoreCodeAuthorization.typeUrl || Array.isArray(o.grants) && (!o.grants.length || CodeGrant.isAmino(o.grants[0]))); + }, + encode(message: StoreCodeAuthorization, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.grants) { + CodeGrant.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): StoreCodeAuthorization { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseStoreCodeAuthorization(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.grants.push(CodeGrant.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): StoreCodeAuthorization { + return { + grants: Array.isArray(object?.grants) ? object.grants.map((e: any) => CodeGrant.fromJSON(e)) : [] + }; + }, + toJSON(message: StoreCodeAuthorization): unknown { + const obj: any = {}; + if (message.grants) { + obj.grants = message.grants.map(e => e ? CodeGrant.toJSON(e) : undefined); + } else { + obj.grants = []; + } + return obj; + }, + fromPartial(object: Partial): StoreCodeAuthorization { + const message = createBaseStoreCodeAuthorization(); + message.grants = object.grants?.map(e => CodeGrant.fromPartial(e)) || []; + return message; + }, + fromAmino(object: StoreCodeAuthorizationAmino): StoreCodeAuthorization { + const message = createBaseStoreCodeAuthorization(); + message.grants = object.grants?.map(e => CodeGrant.fromAmino(e)) || []; + return message; + }, + toAmino(message: StoreCodeAuthorization): StoreCodeAuthorizationAmino { + const obj: any = {}; + if (message.grants) { + obj.grants = message.grants.map(e => e ? CodeGrant.toAmino(e) : undefined); + } else { + obj.grants = []; + } + return obj; + }, + fromAminoMsg(object: StoreCodeAuthorizationAminoMsg): StoreCodeAuthorization { + return StoreCodeAuthorization.fromAmino(object.value); + }, + toAminoMsg(message: StoreCodeAuthorization): StoreCodeAuthorizationAminoMsg { + return { + type: "wasm/StoreCodeAuthorization", + value: StoreCodeAuthorization.toAmino(message) + }; + }, + fromProtoMsg(message: StoreCodeAuthorizationProtoMsg): StoreCodeAuthorization { + return StoreCodeAuthorization.decode(message.value); + }, + toProto(message: StoreCodeAuthorization): Uint8Array { + return StoreCodeAuthorization.encode(message).finish(); + }, + toProtoMsg(message: StoreCodeAuthorization): StoreCodeAuthorizationProtoMsg { + return { + typeUrl: "/cosmwasm.wasm.v1.StoreCodeAuthorization", + value: StoreCodeAuthorization.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(StoreCodeAuthorization.typeUrl, StoreCodeAuthorization); +GlobalDecoderRegistry.registerAminoProtoMapping(StoreCodeAuthorization.aminoType, StoreCodeAuthorization.typeUrl); function createBaseContractExecutionAuthorization(): ContractExecutionAuthorization { return { $typeUrl: "/cosmwasm.wasm.v1.ContractExecutionAuthorization", @@ -352,6 +528,16 @@ function createBaseContractExecutionAuthorization(): ContractExecutionAuthorizat } export const ContractExecutionAuthorization = { typeUrl: "/cosmwasm.wasm.v1.ContractExecutionAuthorization", + aminoType: "wasm/ContractExecutionAuthorization", + is(o: any): o is ContractExecutionAuthorization { + return o && (o.$typeUrl === ContractExecutionAuthorization.typeUrl || Array.isArray(o.grants) && (!o.grants.length || ContractGrant.is(o.grants[0]))); + }, + isSDK(o: any): o is ContractExecutionAuthorizationSDKType { + return o && (o.$typeUrl === ContractExecutionAuthorization.typeUrl || Array.isArray(o.grants) && (!o.grants.length || ContractGrant.isSDK(o.grants[0]))); + }, + isAmino(o: any): o is ContractExecutionAuthorizationAmino { + return o && (o.$typeUrl === ContractExecutionAuthorization.typeUrl || Array.isArray(o.grants) && (!o.grants.length || ContractGrant.isAmino(o.grants[0]))); + }, encode(message: ContractExecutionAuthorization, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.grants) { ContractGrant.encode(v!, writer.uint32(10).fork()).ldelim(); @@ -375,15 +561,29 @@ export const ContractExecutionAuthorization = { } return message; }, + fromJSON(object: any): ContractExecutionAuthorization { + return { + grants: Array.isArray(object?.grants) ? object.grants.map((e: any) => ContractGrant.fromJSON(e)) : [] + }; + }, + toJSON(message: ContractExecutionAuthorization): unknown { + const obj: any = {}; + if (message.grants) { + obj.grants = message.grants.map(e => e ? ContractGrant.toJSON(e) : undefined); + } else { + obj.grants = []; + } + return obj; + }, fromPartial(object: Partial): ContractExecutionAuthorization { const message = createBaseContractExecutionAuthorization(); message.grants = object.grants?.map(e => ContractGrant.fromPartial(e)) || []; return message; }, fromAmino(object: ContractExecutionAuthorizationAmino): ContractExecutionAuthorization { - return { - grants: Array.isArray(object?.grants) ? object.grants.map((e: any) => ContractGrant.fromAmino(e)) : [] - }; + const message = createBaseContractExecutionAuthorization(); + message.grants = object.grants?.map(e => ContractGrant.fromAmino(e)) || []; + return message; }, toAmino(message: ContractExecutionAuthorization): ContractExecutionAuthorizationAmino { const obj: any = {}; @@ -416,6 +616,8 @@ export const ContractExecutionAuthorization = { }; } }; +GlobalDecoderRegistry.register(ContractExecutionAuthorization.typeUrl, ContractExecutionAuthorization); +GlobalDecoderRegistry.registerAminoProtoMapping(ContractExecutionAuthorization.aminoType, ContractExecutionAuthorization.typeUrl); function createBaseContractMigrationAuthorization(): ContractMigrationAuthorization { return { $typeUrl: "/cosmwasm.wasm.v1.ContractMigrationAuthorization", @@ -424,6 +626,16 @@ function createBaseContractMigrationAuthorization(): ContractMigrationAuthorizat } export const ContractMigrationAuthorization = { typeUrl: "/cosmwasm.wasm.v1.ContractMigrationAuthorization", + aminoType: "wasm/ContractMigrationAuthorization", + is(o: any): o is ContractMigrationAuthorization { + return o && (o.$typeUrl === ContractMigrationAuthorization.typeUrl || Array.isArray(o.grants) && (!o.grants.length || ContractGrant.is(o.grants[0]))); + }, + isSDK(o: any): o is ContractMigrationAuthorizationSDKType { + return o && (o.$typeUrl === ContractMigrationAuthorization.typeUrl || Array.isArray(o.grants) && (!o.grants.length || ContractGrant.isSDK(o.grants[0]))); + }, + isAmino(o: any): o is ContractMigrationAuthorizationAmino { + return o && (o.$typeUrl === ContractMigrationAuthorization.typeUrl || Array.isArray(o.grants) && (!o.grants.length || ContractGrant.isAmino(o.grants[0]))); + }, encode(message: ContractMigrationAuthorization, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.grants) { ContractGrant.encode(v!, writer.uint32(10).fork()).ldelim(); @@ -447,15 +659,29 @@ export const ContractMigrationAuthorization = { } return message; }, + fromJSON(object: any): ContractMigrationAuthorization { + return { + grants: Array.isArray(object?.grants) ? object.grants.map((e: any) => ContractGrant.fromJSON(e)) : [] + }; + }, + toJSON(message: ContractMigrationAuthorization): unknown { + const obj: any = {}; + if (message.grants) { + obj.grants = message.grants.map(e => e ? ContractGrant.toJSON(e) : undefined); + } else { + obj.grants = []; + } + return obj; + }, fromPartial(object: Partial): ContractMigrationAuthorization { const message = createBaseContractMigrationAuthorization(); message.grants = object.grants?.map(e => ContractGrant.fromPartial(e)) || []; return message; }, fromAmino(object: ContractMigrationAuthorizationAmino): ContractMigrationAuthorization { - return { - grants: Array.isArray(object?.grants) ? object.grants.map((e: any) => ContractGrant.fromAmino(e)) : [] - }; + const message = createBaseContractMigrationAuthorization(); + message.grants = object.grants?.map(e => ContractGrant.fromAmino(e)) || []; + return message; }, toAmino(message: ContractMigrationAuthorization): ContractMigrationAuthorizationAmino { const obj: any = {}; @@ -488,6 +714,113 @@ export const ContractMigrationAuthorization = { }; } }; +GlobalDecoderRegistry.register(ContractMigrationAuthorization.typeUrl, ContractMigrationAuthorization); +GlobalDecoderRegistry.registerAminoProtoMapping(ContractMigrationAuthorization.aminoType, ContractMigrationAuthorization.typeUrl); +function createBaseCodeGrant(): CodeGrant { + return { + codeHash: new Uint8Array(), + instantiatePermission: undefined + }; +} +export const CodeGrant = { + typeUrl: "/cosmwasm.wasm.v1.CodeGrant", + aminoType: "wasm/CodeGrant", + is(o: any): o is CodeGrant { + return o && (o.$typeUrl === CodeGrant.typeUrl || o.codeHash instanceof Uint8Array || typeof o.codeHash === "string"); + }, + isSDK(o: any): o is CodeGrantSDKType { + return o && (o.$typeUrl === CodeGrant.typeUrl || o.code_hash instanceof Uint8Array || typeof o.code_hash === "string"); + }, + isAmino(o: any): o is CodeGrantAmino { + return o && (o.$typeUrl === CodeGrant.typeUrl || o.code_hash instanceof Uint8Array || typeof o.code_hash === "string"); + }, + encode(message: CodeGrant, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.codeHash.length !== 0) { + writer.uint32(10).bytes(message.codeHash); + } + if (message.instantiatePermission !== undefined) { + AccessConfig.encode(message.instantiatePermission, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): CodeGrant { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseCodeGrant(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.codeHash = reader.bytes(); + break; + case 2: + message.instantiatePermission = AccessConfig.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): CodeGrant { + return { + codeHash: isSet(object.codeHash) ? bytesFromBase64(object.codeHash) : new Uint8Array(), + instantiatePermission: isSet(object.instantiatePermission) ? AccessConfig.fromJSON(object.instantiatePermission) : undefined + }; + }, + toJSON(message: CodeGrant): unknown { + const obj: any = {}; + message.codeHash !== undefined && (obj.codeHash = base64FromBytes(message.codeHash !== undefined ? message.codeHash : new Uint8Array())); + message.instantiatePermission !== undefined && (obj.instantiatePermission = message.instantiatePermission ? AccessConfig.toJSON(message.instantiatePermission) : undefined); + return obj; + }, + fromPartial(object: Partial): CodeGrant { + const message = createBaseCodeGrant(); + message.codeHash = object.codeHash ?? new Uint8Array(); + message.instantiatePermission = object.instantiatePermission !== undefined && object.instantiatePermission !== null ? AccessConfig.fromPartial(object.instantiatePermission) : undefined; + return message; + }, + fromAmino(object: CodeGrantAmino): CodeGrant { + const message = createBaseCodeGrant(); + if (object.code_hash !== undefined && object.code_hash !== null) { + message.codeHash = bytesFromBase64(object.code_hash); + } + if (object.instantiate_permission !== undefined && object.instantiate_permission !== null) { + message.instantiatePermission = AccessConfig.fromAmino(object.instantiate_permission); + } + return message; + }, + toAmino(message: CodeGrant): CodeGrantAmino { + const obj: any = {}; + obj.code_hash = message.codeHash ? base64FromBytes(message.codeHash) : undefined; + obj.instantiate_permission = message.instantiatePermission ? AccessConfig.toAmino(message.instantiatePermission) : undefined; + return obj; + }, + fromAminoMsg(object: CodeGrantAminoMsg): CodeGrant { + return CodeGrant.fromAmino(object.value); + }, + toAminoMsg(message: CodeGrant): CodeGrantAminoMsg { + return { + type: "wasm/CodeGrant", + value: CodeGrant.toAmino(message) + }; + }, + fromProtoMsg(message: CodeGrantProtoMsg): CodeGrant { + return CodeGrant.decode(message.value); + }, + toProto(message: CodeGrant): Uint8Array { + return CodeGrant.encode(message).finish(); + }, + toProtoMsg(message: CodeGrant): CodeGrantProtoMsg { + return { + typeUrl: "/cosmwasm.wasm.v1.CodeGrant", + value: CodeGrant.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(CodeGrant.typeUrl, CodeGrant); +GlobalDecoderRegistry.registerAminoProtoMapping(CodeGrant.aminoType, CodeGrant.typeUrl); function createBaseContractGrant(): ContractGrant { return { contract: "", @@ -497,15 +830,25 @@ function createBaseContractGrant(): ContractGrant { } export const ContractGrant = { typeUrl: "/cosmwasm.wasm.v1.ContractGrant", + aminoType: "wasm/ContractGrant", + is(o: any): o is ContractGrant { + return o && (o.$typeUrl === ContractGrant.typeUrl || typeof o.contract === "string"); + }, + isSDK(o: any): o is ContractGrantSDKType { + return o && (o.$typeUrl === ContractGrant.typeUrl || typeof o.contract === "string"); + }, + isAmino(o: any): o is ContractGrantAmino { + return o && (o.$typeUrl === ContractGrant.typeUrl || typeof o.contract === "string"); + }, encode(message: ContractGrant, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.contract !== "") { writer.uint32(10).string(message.contract); } if (message.limit !== undefined) { - Any.encode((message.limit as Any), writer.uint32(18).fork()).ldelim(); + Any.encode(GlobalDecoderRegistry.wrapAny(message.limit), writer.uint32(18).fork()).ldelim(); } if (message.filter !== undefined) { - Any.encode((message.filter as Any), writer.uint32(26).fork()).ldelim(); + Any.encode(GlobalDecoderRegistry.wrapAny(message.filter), writer.uint32(26).fork()).ldelim(); } return writer; }, @@ -520,10 +863,10 @@ export const ContractGrant = { message.contract = reader.string(); break; case 2: - message.limit = (Cosmwasm_wasmv1ContractAuthzLimitX_InterfaceDecoder(reader) as Any); + message.limit = GlobalDecoderRegistry.unwrapAny(reader); break; case 3: - message.filter = (Cosmwasm_wasmv1ContractAuthzFilterX_InterfaceDecoder(reader) as Any); + message.filter = GlobalDecoderRegistry.unwrapAny(reader); break; default: reader.skipType(tag & 7); @@ -532,25 +875,45 @@ export const ContractGrant = { } return message; }, + fromJSON(object: any): ContractGrant { + return { + contract: isSet(object.contract) ? String(object.contract) : "", + limit: isSet(object.limit) ? GlobalDecoderRegistry.fromJSON(object.limit) : undefined, + filter: isSet(object.filter) ? GlobalDecoderRegistry.fromJSON(object.filter) : undefined + }; + }, + toJSON(message: ContractGrant): unknown { + const obj: any = {}; + message.contract !== undefined && (obj.contract = message.contract); + message.limit !== undefined && (obj.limit = message.limit ? GlobalDecoderRegistry.toJSON(message.limit) : undefined); + message.filter !== undefined && (obj.filter = message.filter ? GlobalDecoderRegistry.toJSON(message.filter) : undefined); + return obj; + }, fromPartial(object: Partial): ContractGrant { const message = createBaseContractGrant(); message.contract = object.contract ?? ""; - message.limit = object.limit !== undefined && object.limit !== null ? Any.fromPartial(object.limit) : undefined; - message.filter = object.filter !== undefined && object.filter !== null ? Any.fromPartial(object.filter) : undefined; + message.limit = object.limit !== undefined && object.limit !== null ? GlobalDecoderRegistry.fromPartial(object.limit) : undefined; + message.filter = object.filter !== undefined && object.filter !== null ? GlobalDecoderRegistry.fromPartial(object.filter) : undefined; return message; }, fromAmino(object: ContractGrantAmino): ContractGrant { - return { - contract: object.contract, - limit: object?.limit ? Cosmwasm_wasmv1ContractAuthzLimitX_FromAmino(object.limit) : undefined, - filter: object?.filter ? Cosmwasm_wasmv1ContractAuthzFilterX_FromAmino(object.filter) : undefined - }; + const message = createBaseContractGrant(); + if (object.contract !== undefined && object.contract !== null) { + message.contract = object.contract; + } + if (object.limit !== undefined && object.limit !== null) { + message.limit = GlobalDecoderRegistry.fromAminoMsg(object.limit); + } + if (object.filter !== undefined && object.filter !== null) { + message.filter = GlobalDecoderRegistry.fromAminoMsg(object.filter); + } + return message; }, toAmino(message: ContractGrant): ContractGrantAmino { const obj: any = {}; obj.contract = message.contract; - obj.limit = message.limit ? Cosmwasm_wasmv1ContractAuthzLimitX_ToAmino((message.limit as Any)) : undefined; - obj.filter = message.filter ? Cosmwasm_wasmv1ContractAuthzFilterX_ToAmino((message.filter as Any)) : undefined; + obj.limit = message.limit ? GlobalDecoderRegistry.toAminoMsg(message.limit) : undefined; + obj.filter = message.filter ? GlobalDecoderRegistry.toAminoMsg(message.filter) : undefined; return obj; }, fromAminoMsg(object: ContractGrantAminoMsg): ContractGrant { @@ -575,6 +938,8 @@ export const ContractGrant = { }; } }; +GlobalDecoderRegistry.register(ContractGrant.typeUrl, ContractGrant); +GlobalDecoderRegistry.registerAminoProtoMapping(ContractGrant.aminoType, ContractGrant.typeUrl); function createBaseMaxCallsLimit(): MaxCallsLimit { return { $typeUrl: "/cosmwasm.wasm.v1.MaxCallsLimit", @@ -583,6 +948,16 @@ function createBaseMaxCallsLimit(): MaxCallsLimit { } export const MaxCallsLimit = { typeUrl: "/cosmwasm.wasm.v1.MaxCallsLimit", + aminoType: "wasm/MaxCallsLimit", + is(o: any): o is MaxCallsLimit { + return o && (o.$typeUrl === MaxCallsLimit.typeUrl || typeof o.remaining === "bigint"); + }, + isSDK(o: any): o is MaxCallsLimitSDKType { + return o && (o.$typeUrl === MaxCallsLimit.typeUrl || typeof o.remaining === "bigint"); + }, + isAmino(o: any): o is MaxCallsLimitAmino { + return o && (o.$typeUrl === MaxCallsLimit.typeUrl || typeof o.remaining === "bigint"); + }, encode(message: MaxCallsLimit, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.remaining !== BigInt(0)) { writer.uint32(8).uint64(message.remaining); @@ -606,15 +981,27 @@ export const MaxCallsLimit = { } return message; }, + fromJSON(object: any): MaxCallsLimit { + return { + remaining: isSet(object.remaining) ? BigInt(object.remaining.toString()) : BigInt(0) + }; + }, + toJSON(message: MaxCallsLimit): unknown { + const obj: any = {}; + message.remaining !== undefined && (obj.remaining = (message.remaining || BigInt(0)).toString()); + return obj; + }, fromPartial(object: Partial): MaxCallsLimit { const message = createBaseMaxCallsLimit(); message.remaining = object.remaining !== undefined && object.remaining !== null ? BigInt(object.remaining.toString()) : BigInt(0); return message; }, fromAmino(object: MaxCallsLimitAmino): MaxCallsLimit { - return { - remaining: BigInt(object.remaining) - }; + const message = createBaseMaxCallsLimit(); + if (object.remaining !== undefined && object.remaining !== null) { + message.remaining = BigInt(object.remaining); + } + return message; }, toAmino(message: MaxCallsLimit): MaxCallsLimitAmino { const obj: any = {}; @@ -643,6 +1030,8 @@ export const MaxCallsLimit = { }; } }; +GlobalDecoderRegistry.register(MaxCallsLimit.typeUrl, MaxCallsLimit); +GlobalDecoderRegistry.registerAminoProtoMapping(MaxCallsLimit.aminoType, MaxCallsLimit.typeUrl); function createBaseMaxFundsLimit(): MaxFundsLimit { return { $typeUrl: "/cosmwasm.wasm.v1.MaxFundsLimit", @@ -651,6 +1040,16 @@ function createBaseMaxFundsLimit(): MaxFundsLimit { } export const MaxFundsLimit = { typeUrl: "/cosmwasm.wasm.v1.MaxFundsLimit", + aminoType: "wasm/MaxFundsLimit", + is(o: any): o is MaxFundsLimit { + return o && (o.$typeUrl === MaxFundsLimit.typeUrl || Array.isArray(o.amounts) && (!o.amounts.length || Coin.is(o.amounts[0]))); + }, + isSDK(o: any): o is MaxFundsLimitSDKType { + return o && (o.$typeUrl === MaxFundsLimit.typeUrl || Array.isArray(o.amounts) && (!o.amounts.length || Coin.isSDK(o.amounts[0]))); + }, + isAmino(o: any): o is MaxFundsLimitAmino { + return o && (o.$typeUrl === MaxFundsLimit.typeUrl || Array.isArray(o.amounts) && (!o.amounts.length || Coin.isAmino(o.amounts[0]))); + }, encode(message: MaxFundsLimit, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.amounts) { Coin.encode(v!, writer.uint32(10).fork()).ldelim(); @@ -674,15 +1073,29 @@ export const MaxFundsLimit = { } return message; }, + fromJSON(object: any): MaxFundsLimit { + return { + amounts: Array.isArray(object?.amounts) ? object.amounts.map((e: any) => Coin.fromJSON(e)) : [] + }; + }, + toJSON(message: MaxFundsLimit): unknown { + const obj: any = {}; + if (message.amounts) { + obj.amounts = message.amounts.map(e => e ? Coin.toJSON(e) : undefined); + } else { + obj.amounts = []; + } + return obj; + }, fromPartial(object: Partial): MaxFundsLimit { const message = createBaseMaxFundsLimit(); message.amounts = object.amounts?.map(e => Coin.fromPartial(e)) || []; return message; }, fromAmino(object: MaxFundsLimitAmino): MaxFundsLimit { - return { - amounts: Array.isArray(object?.amounts) ? object.amounts.map((e: any) => Coin.fromAmino(e)) : [] - }; + const message = createBaseMaxFundsLimit(); + message.amounts = object.amounts?.map(e => Coin.fromAmino(e)) || []; + return message; }, toAmino(message: MaxFundsLimit): MaxFundsLimitAmino { const obj: any = {}; @@ -715,6 +1128,8 @@ export const MaxFundsLimit = { }; } }; +GlobalDecoderRegistry.register(MaxFundsLimit.typeUrl, MaxFundsLimit); +GlobalDecoderRegistry.registerAminoProtoMapping(MaxFundsLimit.aminoType, MaxFundsLimit.typeUrl); function createBaseCombinedLimit(): CombinedLimit { return { $typeUrl: "/cosmwasm.wasm.v1.CombinedLimit", @@ -724,6 +1139,16 @@ function createBaseCombinedLimit(): CombinedLimit { } export const CombinedLimit = { typeUrl: "/cosmwasm.wasm.v1.CombinedLimit", + aminoType: "wasm/CombinedLimit", + is(o: any): o is CombinedLimit { + return o && (o.$typeUrl === CombinedLimit.typeUrl || typeof o.callsRemaining === "bigint" && Array.isArray(o.amounts) && (!o.amounts.length || Coin.is(o.amounts[0]))); + }, + isSDK(o: any): o is CombinedLimitSDKType { + return o && (o.$typeUrl === CombinedLimit.typeUrl || typeof o.calls_remaining === "bigint" && Array.isArray(o.amounts) && (!o.amounts.length || Coin.isSDK(o.amounts[0]))); + }, + isAmino(o: any): o is CombinedLimitAmino { + return o && (o.$typeUrl === CombinedLimit.typeUrl || typeof o.calls_remaining === "bigint" && Array.isArray(o.amounts) && (!o.amounts.length || Coin.isAmino(o.amounts[0]))); + }, encode(message: CombinedLimit, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.callsRemaining !== BigInt(0)) { writer.uint32(8).uint64(message.callsRemaining); @@ -753,6 +1178,22 @@ export const CombinedLimit = { } return message; }, + fromJSON(object: any): CombinedLimit { + return { + callsRemaining: isSet(object.callsRemaining) ? BigInt(object.callsRemaining.toString()) : BigInt(0), + amounts: Array.isArray(object?.amounts) ? object.amounts.map((e: any) => Coin.fromJSON(e)) : [] + }; + }, + toJSON(message: CombinedLimit): unknown { + const obj: any = {}; + message.callsRemaining !== undefined && (obj.callsRemaining = (message.callsRemaining || BigInt(0)).toString()); + if (message.amounts) { + obj.amounts = message.amounts.map(e => e ? Coin.toJSON(e) : undefined); + } else { + obj.amounts = []; + } + return obj; + }, fromPartial(object: Partial): CombinedLimit { const message = createBaseCombinedLimit(); message.callsRemaining = object.callsRemaining !== undefined && object.callsRemaining !== null ? BigInt(object.callsRemaining.toString()) : BigInt(0); @@ -760,10 +1201,12 @@ export const CombinedLimit = { return message; }, fromAmino(object: CombinedLimitAmino): CombinedLimit { - return { - callsRemaining: BigInt(object.calls_remaining), - amounts: Array.isArray(object?.amounts) ? object.amounts.map((e: any) => Coin.fromAmino(e)) : [] - }; + const message = createBaseCombinedLimit(); + if (object.calls_remaining !== undefined && object.calls_remaining !== null) { + message.callsRemaining = BigInt(object.calls_remaining); + } + message.amounts = object.amounts?.map(e => Coin.fromAmino(e)) || []; + return message; }, toAmino(message: CombinedLimit): CombinedLimitAmino { const obj: any = {}; @@ -797,6 +1240,8 @@ export const CombinedLimit = { }; } }; +GlobalDecoderRegistry.register(CombinedLimit.typeUrl, CombinedLimit); +GlobalDecoderRegistry.registerAminoProtoMapping(CombinedLimit.aminoType, CombinedLimit.typeUrl); function createBaseAllowAllMessagesFilter(): AllowAllMessagesFilter { return { $typeUrl: "/cosmwasm.wasm.v1.AllowAllMessagesFilter" @@ -804,6 +1249,16 @@ function createBaseAllowAllMessagesFilter(): AllowAllMessagesFilter { } export const AllowAllMessagesFilter = { typeUrl: "/cosmwasm.wasm.v1.AllowAllMessagesFilter", + aminoType: "wasm/AllowAllMessagesFilter", + is(o: any): o is AllowAllMessagesFilter { + return o && o.$typeUrl === AllowAllMessagesFilter.typeUrl; + }, + isSDK(o: any): o is AllowAllMessagesFilterSDKType { + return o && o.$typeUrl === AllowAllMessagesFilter.typeUrl; + }, + isAmino(o: any): o is AllowAllMessagesFilterAmino { + return o && o.$typeUrl === AllowAllMessagesFilter.typeUrl; + }, encode(_: AllowAllMessagesFilter, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, @@ -821,12 +1276,20 @@ export const AllowAllMessagesFilter = { } return message; }, + fromJSON(_: any): AllowAllMessagesFilter { + return {}; + }, + toJSON(_: AllowAllMessagesFilter): unknown { + const obj: any = {}; + return obj; + }, fromPartial(_: Partial): AllowAllMessagesFilter { const message = createBaseAllowAllMessagesFilter(); return message; }, fromAmino(_: AllowAllMessagesFilterAmino): AllowAllMessagesFilter { - return {}; + const message = createBaseAllowAllMessagesFilter(); + return message; }, toAmino(_: AllowAllMessagesFilter): AllowAllMessagesFilterAmino { const obj: any = {}; @@ -854,6 +1317,8 @@ export const AllowAllMessagesFilter = { }; } }; +GlobalDecoderRegistry.register(AllowAllMessagesFilter.typeUrl, AllowAllMessagesFilter); +GlobalDecoderRegistry.registerAminoProtoMapping(AllowAllMessagesFilter.aminoType, AllowAllMessagesFilter.typeUrl); function createBaseAcceptedMessageKeysFilter(): AcceptedMessageKeysFilter { return { $typeUrl: "/cosmwasm.wasm.v1.AcceptedMessageKeysFilter", @@ -862,6 +1327,16 @@ function createBaseAcceptedMessageKeysFilter(): AcceptedMessageKeysFilter { } export const AcceptedMessageKeysFilter = { typeUrl: "/cosmwasm.wasm.v1.AcceptedMessageKeysFilter", + aminoType: "wasm/AcceptedMessageKeysFilter", + is(o: any): o is AcceptedMessageKeysFilter { + return o && (o.$typeUrl === AcceptedMessageKeysFilter.typeUrl || Array.isArray(o.keys) && (!o.keys.length || typeof o.keys[0] === "string")); + }, + isSDK(o: any): o is AcceptedMessageKeysFilterSDKType { + return o && (o.$typeUrl === AcceptedMessageKeysFilter.typeUrl || Array.isArray(o.keys) && (!o.keys.length || typeof o.keys[0] === "string")); + }, + isAmino(o: any): o is AcceptedMessageKeysFilterAmino { + return o && (o.$typeUrl === AcceptedMessageKeysFilter.typeUrl || Array.isArray(o.keys) && (!o.keys.length || typeof o.keys[0] === "string")); + }, encode(message: AcceptedMessageKeysFilter, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.keys) { writer.uint32(10).string(v!); @@ -885,15 +1360,29 @@ export const AcceptedMessageKeysFilter = { } return message; }, + fromJSON(object: any): AcceptedMessageKeysFilter { + return { + keys: Array.isArray(object?.keys) ? object.keys.map((e: any) => String(e)) : [] + }; + }, + toJSON(message: AcceptedMessageKeysFilter): unknown { + const obj: any = {}; + if (message.keys) { + obj.keys = message.keys.map(e => e); + } else { + obj.keys = []; + } + return obj; + }, fromPartial(object: Partial): AcceptedMessageKeysFilter { const message = createBaseAcceptedMessageKeysFilter(); message.keys = object.keys?.map(e => e) || []; return message; }, fromAmino(object: AcceptedMessageKeysFilterAmino): AcceptedMessageKeysFilter { - return { - keys: Array.isArray(object?.keys) ? object.keys.map((e: any) => e) : [] - }; + const message = createBaseAcceptedMessageKeysFilter(); + message.keys = object.keys?.map(e => e) || []; + return message; }, toAmino(message: AcceptedMessageKeysFilter): AcceptedMessageKeysFilterAmino { const obj: any = {}; @@ -926,6 +1415,8 @@ export const AcceptedMessageKeysFilter = { }; } }; +GlobalDecoderRegistry.register(AcceptedMessageKeysFilter.typeUrl, AcceptedMessageKeysFilter); +GlobalDecoderRegistry.registerAminoProtoMapping(AcceptedMessageKeysFilter.aminoType, AcceptedMessageKeysFilter.typeUrl); function createBaseAcceptedMessagesFilter(): AcceptedMessagesFilter { return { $typeUrl: "/cosmwasm.wasm.v1.AcceptedMessagesFilter", @@ -934,6 +1425,16 @@ function createBaseAcceptedMessagesFilter(): AcceptedMessagesFilter { } export const AcceptedMessagesFilter = { typeUrl: "/cosmwasm.wasm.v1.AcceptedMessagesFilter", + aminoType: "wasm/AcceptedMessagesFilter", + is(o: any): o is AcceptedMessagesFilter { + return o && (o.$typeUrl === AcceptedMessagesFilter.typeUrl || Array.isArray(o.messages) && (!o.messages.length || o.messages[0] instanceof Uint8Array || typeof o.messages[0] === "string")); + }, + isSDK(o: any): o is AcceptedMessagesFilterSDKType { + return o && (o.$typeUrl === AcceptedMessagesFilter.typeUrl || Array.isArray(o.messages) && (!o.messages.length || o.messages[0] instanceof Uint8Array || typeof o.messages[0] === "string")); + }, + isAmino(o: any): o is AcceptedMessagesFilterAmino { + return o && (o.$typeUrl === AcceptedMessagesFilter.typeUrl || Array.isArray(o.messages) && (!o.messages.length || o.messages[0] instanceof Uint8Array || typeof o.messages[0] === "string")); + }, encode(message: AcceptedMessagesFilter, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.messages) { writer.uint32(10).bytes(v!); @@ -957,20 +1458,34 @@ export const AcceptedMessagesFilter = { } return message; }, + fromJSON(object: any): AcceptedMessagesFilter { + return { + messages: Array.isArray(object?.messages) ? object.messages.map((e: any) => bytesFromBase64(e)) : [] + }; + }, + toJSON(message: AcceptedMessagesFilter): unknown { + const obj: any = {}; + if (message.messages) { + obj.messages = message.messages.map(e => base64FromBytes(e !== undefined ? e : new Uint8Array())); + } else { + obj.messages = []; + } + return obj; + }, fromPartial(object: Partial): AcceptedMessagesFilter { const message = createBaseAcceptedMessagesFilter(); message.messages = object.messages?.map(e => e) || []; return message; }, fromAmino(object: AcceptedMessagesFilterAmino): AcceptedMessagesFilter { - return { - messages: Array.isArray(object?.messages) ? object.messages.map((e: any) => e) : [] - }; + const message = createBaseAcceptedMessagesFilter(); + message.messages = object.messages?.map(e => toUtf8(JSON.stringify(e))) || []; + return message; }, toAmino(message: AcceptedMessagesFilter): AcceptedMessagesFilterAmino { const obj: any = {}; if (message.messages) { - obj.messages = message.messages.map(e => e); + obj.messages = message.messages.map(e => JSON.parse(fromUtf8(e))); } else { obj.messages = []; } @@ -998,115 +1513,5 @@ export const AcceptedMessagesFilter = { }; } }; -export const Cosmwasm_wasmv1ContractAuthzLimitX_InterfaceDecoder = (input: BinaryReader | Uint8Array): MaxCallsLimit | MaxFundsLimit | CombinedLimit | Any => { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - const data = Any.decode(reader, reader.uint32()); - switch (data.typeUrl) { - case "/cosmwasm.wasm.v1.MaxCallsLimit": - return MaxCallsLimit.decode(data.value); - case "/cosmwasm.wasm.v1.MaxFundsLimit": - return MaxFundsLimit.decode(data.value); - case "/cosmwasm.wasm.v1.CombinedLimit": - return CombinedLimit.decode(data.value); - default: - return data; - } -}; -export const Cosmwasm_wasmv1ContractAuthzLimitX_FromAmino = (content: AnyAmino) => { - switch (content.type) { - case "wasm/MaxCallsLimit": - return Any.fromPartial({ - typeUrl: "/cosmwasm.wasm.v1.MaxCallsLimit", - value: MaxCallsLimit.encode(MaxCallsLimit.fromPartial(MaxCallsLimit.fromAmino(content.value))).finish() - }); - case "wasm/MaxFundsLimit": - return Any.fromPartial({ - typeUrl: "/cosmwasm.wasm.v1.MaxFundsLimit", - value: MaxFundsLimit.encode(MaxFundsLimit.fromPartial(MaxFundsLimit.fromAmino(content.value))).finish() - }); - case "wasm/CombinedLimit": - return Any.fromPartial({ - typeUrl: "/cosmwasm.wasm.v1.CombinedLimit", - value: CombinedLimit.encode(CombinedLimit.fromPartial(CombinedLimit.fromAmino(content.value))).finish() - }); - default: - return Any.fromAmino(content); - } -}; -export const Cosmwasm_wasmv1ContractAuthzLimitX_ToAmino = (content: Any) => { - switch (content.typeUrl) { - case "/cosmwasm.wasm.v1.MaxCallsLimit": - return { - type: "wasm/MaxCallsLimit", - value: MaxCallsLimit.toAmino(MaxCallsLimit.decode(content.value)) - }; - case "/cosmwasm.wasm.v1.MaxFundsLimit": - return { - type: "wasm/MaxFundsLimit", - value: MaxFundsLimit.toAmino(MaxFundsLimit.decode(content.value)) - }; - case "/cosmwasm.wasm.v1.CombinedLimit": - return { - type: "wasm/CombinedLimit", - value: CombinedLimit.toAmino(CombinedLimit.decode(content.value)) - }; - default: - return Any.toAmino(content); - } -}; -export const Cosmwasm_wasmv1ContractAuthzFilterX_InterfaceDecoder = (input: BinaryReader | Uint8Array): AllowAllMessagesFilter | AcceptedMessageKeysFilter | AcceptedMessagesFilter | Any => { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - const data = Any.decode(reader, reader.uint32()); - switch (data.typeUrl) { - case "/cosmwasm.wasm.v1.AllowAllMessagesFilter": - return AllowAllMessagesFilter.decode(data.value); - case "/cosmwasm.wasm.v1.AcceptedMessageKeysFilter": - return AcceptedMessageKeysFilter.decode(data.value); - case "/cosmwasm.wasm.v1.AcceptedMessagesFilter": - return AcceptedMessagesFilter.decode(data.value); - default: - return data; - } -}; -export const Cosmwasm_wasmv1ContractAuthzFilterX_FromAmino = (content: AnyAmino) => { - switch (content.type) { - case "wasm/AllowAllMessagesFilter": - return Any.fromPartial({ - typeUrl: "/cosmwasm.wasm.v1.AllowAllMessagesFilter", - value: AllowAllMessagesFilter.encode(AllowAllMessagesFilter.fromPartial(AllowAllMessagesFilter.fromAmino(content.value))).finish() - }); - case "wasm/AcceptedMessageKeysFilter": - return Any.fromPartial({ - typeUrl: "/cosmwasm.wasm.v1.AcceptedMessageKeysFilter", - value: AcceptedMessageKeysFilter.encode(AcceptedMessageKeysFilter.fromPartial(AcceptedMessageKeysFilter.fromAmino(content.value))).finish() - }); - case "wasm/AcceptedMessagesFilter": - return Any.fromPartial({ - typeUrl: "/cosmwasm.wasm.v1.AcceptedMessagesFilter", - value: AcceptedMessagesFilter.encode(AcceptedMessagesFilter.fromPartial(AcceptedMessagesFilter.fromAmino(content.value))).finish() - }); - default: - return Any.fromAmino(content); - } -}; -export const Cosmwasm_wasmv1ContractAuthzFilterX_ToAmino = (content: Any) => { - switch (content.typeUrl) { - case "/cosmwasm.wasm.v1.AllowAllMessagesFilter": - return { - type: "wasm/AllowAllMessagesFilter", - value: AllowAllMessagesFilter.toAmino(AllowAllMessagesFilter.decode(content.value)) - }; - case "/cosmwasm.wasm.v1.AcceptedMessageKeysFilter": - return { - type: "wasm/AcceptedMessageKeysFilter", - value: AcceptedMessageKeysFilter.toAmino(AcceptedMessageKeysFilter.decode(content.value)) - }; - case "/cosmwasm.wasm.v1.AcceptedMessagesFilter": - return { - type: "wasm/AcceptedMessagesFilter", - value: AcceptedMessagesFilter.toAmino(AcceptedMessagesFilter.decode(content.value)) - }; - default: - return Any.toAmino(content); - } -}; \ No newline at end of file +GlobalDecoderRegistry.register(AcceptedMessagesFilter.typeUrl, AcceptedMessagesFilter); +GlobalDecoderRegistry.registerAminoProtoMapping(AcceptedMessagesFilter.aminoType, AcceptedMessagesFilter.typeUrl); \ No newline at end of file diff --git a/packages/osmojs/src/codegen/cosmwasm/wasm/v1/genesis.ts b/packages/osmojs/src/codegen/cosmwasm/wasm/v1/genesis.ts index acdfef68a..35f062507 100644 --- a/packages/osmojs/src/codegen/cosmwasm/wasm/v1/genesis.ts +++ b/packages/osmojs/src/codegen/cosmwasm/wasm/v1/genesis.ts @@ -1,5 +1,7 @@ import { Params, ParamsAmino, ParamsSDKType, CodeInfo, CodeInfoAmino, CodeInfoSDKType, ContractInfo, ContractInfoAmino, ContractInfoSDKType, Model, ModelAmino, ModelSDKType, ContractCodeHistoryEntry, ContractCodeHistoryEntryAmino, ContractCodeHistoryEntrySDKType } from "./types"; import { BinaryReader, BinaryWriter } from "../../../binary"; +import { isSet, bytesFromBase64, base64FromBytes } from "../../../helpers"; +import { GlobalDecoderRegistry } from "../../../registry"; /** GenesisState - genesis state of x/wasm */ export interface GenesisState { params: Params; @@ -13,7 +15,7 @@ export interface GenesisStateProtoMsg { } /** GenesisState - genesis state of x/wasm */ export interface GenesisStateAmino { - params?: ParamsAmino; + params: ParamsAmino; codes: CodeAmino[]; contracts: ContractAmino[]; sequences: SequenceAmino[]; @@ -43,11 +45,11 @@ export interface CodeProtoMsg { } /** Code struct encompasses CodeInfo and CodeBytes */ export interface CodeAmino { - code_id: string; - code_info?: CodeInfoAmino; - code_bytes: Uint8Array; + code_id?: string; + code_info: CodeInfoAmino; + code_bytes?: string; /** Pinned to wasmvm cache */ - pinned: boolean; + pinned?: boolean; } export interface CodeAminoMsg { type: "wasm/Code"; @@ -73,8 +75,8 @@ export interface ContractProtoMsg { } /** Contract struct encompasses ContractAddress, ContractInfo, and ContractState */ export interface ContractAmino { - contract_address: string; - contract_info?: ContractInfoAmino; + contract_address?: string; + contract_info: ContractInfoAmino; contract_state: ModelAmino[]; contract_code_history: ContractCodeHistoryEntryAmino[]; } @@ -100,8 +102,8 @@ export interface SequenceProtoMsg { } /** Sequence key and value of an id generation counter */ export interface SequenceAmino { - id_key: Uint8Array; - value: string; + id_key?: string; + value?: string; } export interface SequenceAminoMsg { type: "wasm/Sequence"; @@ -122,6 +124,16 @@ function createBaseGenesisState(): GenesisState { } export const GenesisState = { typeUrl: "/cosmwasm.wasm.v1.GenesisState", + aminoType: "wasm/GenesisState", + is(o: any): o is GenesisState { + return o && (o.$typeUrl === GenesisState.typeUrl || Params.is(o.params) && Array.isArray(o.codes) && (!o.codes.length || Code.is(o.codes[0])) && Array.isArray(o.contracts) && (!o.contracts.length || Contract.is(o.contracts[0])) && Array.isArray(o.sequences) && (!o.sequences.length || Sequence.is(o.sequences[0]))); + }, + isSDK(o: any): o is GenesisStateSDKType { + return o && (o.$typeUrl === GenesisState.typeUrl || Params.isSDK(o.params) && Array.isArray(o.codes) && (!o.codes.length || Code.isSDK(o.codes[0])) && Array.isArray(o.contracts) && (!o.contracts.length || Contract.isSDK(o.contracts[0])) && Array.isArray(o.sequences) && (!o.sequences.length || Sequence.isSDK(o.sequences[0]))); + }, + isAmino(o: any): o is GenesisStateAmino { + return o && (o.$typeUrl === GenesisState.typeUrl || Params.isAmino(o.params) && Array.isArray(o.codes) && (!o.codes.length || Code.isAmino(o.codes[0])) && Array.isArray(o.contracts) && (!o.contracts.length || Contract.isAmino(o.contracts[0])) && Array.isArray(o.sequences) && (!o.sequences.length || Sequence.isAmino(o.sequences[0]))); + }, encode(message: GenesisState, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.params !== undefined) { Params.encode(message.params, writer.uint32(10).fork()).ldelim(); @@ -163,6 +175,34 @@ export const GenesisState = { } return message; }, + fromJSON(object: any): GenesisState { + return { + params: isSet(object.params) ? Params.fromJSON(object.params) : undefined, + codes: Array.isArray(object?.codes) ? object.codes.map((e: any) => Code.fromJSON(e)) : [], + contracts: Array.isArray(object?.contracts) ? object.contracts.map((e: any) => Contract.fromJSON(e)) : [], + sequences: Array.isArray(object?.sequences) ? object.sequences.map((e: any) => Sequence.fromJSON(e)) : [] + }; + }, + toJSON(message: GenesisState): unknown { + const obj: any = {}; + message.params !== undefined && (obj.params = message.params ? Params.toJSON(message.params) : undefined); + if (message.codes) { + obj.codes = message.codes.map(e => e ? Code.toJSON(e) : undefined); + } else { + obj.codes = []; + } + if (message.contracts) { + obj.contracts = message.contracts.map(e => e ? Contract.toJSON(e) : undefined); + } else { + obj.contracts = []; + } + if (message.sequences) { + obj.sequences = message.sequences.map(e => e ? Sequence.toJSON(e) : undefined); + } else { + obj.sequences = []; + } + return obj; + }, fromPartial(object: Partial): GenesisState { const message = createBaseGenesisState(); message.params = object.params !== undefined && object.params !== null ? Params.fromPartial(object.params) : undefined; @@ -172,16 +212,18 @@ export const GenesisState = { return message; }, fromAmino(object: GenesisStateAmino): GenesisState { - return { - params: object?.params ? Params.fromAmino(object.params) : undefined, - codes: Array.isArray(object?.codes) ? object.codes.map((e: any) => Code.fromAmino(e)) : [], - contracts: Array.isArray(object?.contracts) ? object.contracts.map((e: any) => Contract.fromAmino(e)) : [], - sequences: Array.isArray(object?.sequences) ? object.sequences.map((e: any) => Sequence.fromAmino(e)) : [] - }; + const message = createBaseGenesisState(); + if (object.params !== undefined && object.params !== null) { + message.params = Params.fromAmino(object.params); + } + message.codes = object.codes?.map(e => Code.fromAmino(e)) || []; + message.contracts = object.contracts?.map(e => Contract.fromAmino(e)) || []; + message.sequences = object.sequences?.map(e => Sequence.fromAmino(e)) || []; + return message; }, toAmino(message: GenesisState): GenesisStateAmino { const obj: any = {}; - obj.params = message.params ? Params.toAmino(message.params) : undefined; + obj.params = message.params ? Params.toAmino(message.params) : Params.fromPartial({}); if (message.codes) { obj.codes = message.codes.map(e => e ? Code.toAmino(e) : undefined); } else { @@ -221,6 +263,8 @@ export const GenesisState = { }; } }; +GlobalDecoderRegistry.register(GenesisState.typeUrl, GenesisState); +GlobalDecoderRegistry.registerAminoProtoMapping(GenesisState.aminoType, GenesisState.typeUrl); function createBaseCode(): Code { return { codeId: BigInt(0), @@ -231,6 +275,16 @@ function createBaseCode(): Code { } export const Code = { typeUrl: "/cosmwasm.wasm.v1.Code", + aminoType: "wasm/Code", + is(o: any): o is Code { + return o && (o.$typeUrl === Code.typeUrl || typeof o.codeId === "bigint" && CodeInfo.is(o.codeInfo) && (o.codeBytes instanceof Uint8Array || typeof o.codeBytes === "string") && typeof o.pinned === "boolean"); + }, + isSDK(o: any): o is CodeSDKType { + return o && (o.$typeUrl === Code.typeUrl || typeof o.code_id === "bigint" && CodeInfo.isSDK(o.code_info) && (o.code_bytes instanceof Uint8Array || typeof o.code_bytes === "string") && typeof o.pinned === "boolean"); + }, + isAmino(o: any): o is CodeAmino { + return o && (o.$typeUrl === Code.typeUrl || typeof o.code_id === "bigint" && CodeInfo.isAmino(o.code_info) && (o.code_bytes instanceof Uint8Array || typeof o.code_bytes === "string") && typeof o.pinned === "boolean"); + }, encode(message: Code, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.codeId !== BigInt(0)) { writer.uint32(8).uint64(message.codeId); @@ -272,6 +326,22 @@ export const Code = { } return message; }, + fromJSON(object: any): Code { + return { + codeId: isSet(object.codeId) ? BigInt(object.codeId.toString()) : BigInt(0), + codeInfo: isSet(object.codeInfo) ? CodeInfo.fromJSON(object.codeInfo) : undefined, + codeBytes: isSet(object.codeBytes) ? bytesFromBase64(object.codeBytes) : new Uint8Array(), + pinned: isSet(object.pinned) ? Boolean(object.pinned) : false + }; + }, + toJSON(message: Code): unknown { + const obj: any = {}; + message.codeId !== undefined && (obj.codeId = (message.codeId || BigInt(0)).toString()); + message.codeInfo !== undefined && (obj.codeInfo = message.codeInfo ? CodeInfo.toJSON(message.codeInfo) : undefined); + message.codeBytes !== undefined && (obj.codeBytes = base64FromBytes(message.codeBytes !== undefined ? message.codeBytes : new Uint8Array())); + message.pinned !== undefined && (obj.pinned = message.pinned); + return obj; + }, fromPartial(object: Partial): Code { const message = createBaseCode(); message.codeId = object.codeId !== undefined && object.codeId !== null ? BigInt(object.codeId.toString()) : BigInt(0); @@ -281,18 +351,26 @@ export const Code = { return message; }, fromAmino(object: CodeAmino): Code { - return { - codeId: BigInt(object.code_id), - codeInfo: object?.code_info ? CodeInfo.fromAmino(object.code_info) : undefined, - codeBytes: object.code_bytes, - pinned: object.pinned - }; + const message = createBaseCode(); + if (object.code_id !== undefined && object.code_id !== null) { + message.codeId = BigInt(object.code_id); + } + if (object.code_info !== undefined && object.code_info !== null) { + message.codeInfo = CodeInfo.fromAmino(object.code_info); + } + if (object.code_bytes !== undefined && object.code_bytes !== null) { + message.codeBytes = bytesFromBase64(object.code_bytes); + } + if (object.pinned !== undefined && object.pinned !== null) { + message.pinned = object.pinned; + } + return message; }, toAmino(message: Code): CodeAmino { const obj: any = {}; obj.code_id = message.codeId ? message.codeId.toString() : undefined; - obj.code_info = message.codeInfo ? CodeInfo.toAmino(message.codeInfo) : undefined; - obj.code_bytes = message.codeBytes; + obj.code_info = message.codeInfo ? CodeInfo.toAmino(message.codeInfo) : CodeInfo.fromPartial({}); + obj.code_bytes = message.codeBytes ? base64FromBytes(message.codeBytes) : undefined; obj.pinned = message.pinned; return obj; }, @@ -318,6 +396,8 @@ export const Code = { }; } }; +GlobalDecoderRegistry.register(Code.typeUrl, Code); +GlobalDecoderRegistry.registerAminoProtoMapping(Code.aminoType, Code.typeUrl); function createBaseContract(): Contract { return { contractAddress: "", @@ -328,6 +408,16 @@ function createBaseContract(): Contract { } export const Contract = { typeUrl: "/cosmwasm.wasm.v1.Contract", + aminoType: "wasm/Contract", + is(o: any): o is Contract { + return o && (o.$typeUrl === Contract.typeUrl || typeof o.contractAddress === "string" && ContractInfo.is(o.contractInfo) && Array.isArray(o.contractState) && (!o.contractState.length || Model.is(o.contractState[0])) && Array.isArray(o.contractCodeHistory) && (!o.contractCodeHistory.length || ContractCodeHistoryEntry.is(o.contractCodeHistory[0]))); + }, + isSDK(o: any): o is ContractSDKType { + return o && (o.$typeUrl === Contract.typeUrl || typeof o.contract_address === "string" && ContractInfo.isSDK(o.contract_info) && Array.isArray(o.contract_state) && (!o.contract_state.length || Model.isSDK(o.contract_state[0])) && Array.isArray(o.contract_code_history) && (!o.contract_code_history.length || ContractCodeHistoryEntry.isSDK(o.contract_code_history[0]))); + }, + isAmino(o: any): o is ContractAmino { + return o && (o.$typeUrl === Contract.typeUrl || typeof o.contract_address === "string" && ContractInfo.isAmino(o.contract_info) && Array.isArray(o.contract_state) && (!o.contract_state.length || Model.isAmino(o.contract_state[0])) && Array.isArray(o.contract_code_history) && (!o.contract_code_history.length || ContractCodeHistoryEntry.isAmino(o.contract_code_history[0]))); + }, encode(message: Contract, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.contractAddress !== "") { writer.uint32(10).string(message.contractAddress); @@ -369,6 +459,30 @@ export const Contract = { } return message; }, + fromJSON(object: any): Contract { + return { + contractAddress: isSet(object.contractAddress) ? String(object.contractAddress) : "", + contractInfo: isSet(object.contractInfo) ? ContractInfo.fromJSON(object.contractInfo) : undefined, + contractState: Array.isArray(object?.contractState) ? object.contractState.map((e: any) => Model.fromJSON(e)) : [], + contractCodeHistory: Array.isArray(object?.contractCodeHistory) ? object.contractCodeHistory.map((e: any) => ContractCodeHistoryEntry.fromJSON(e)) : [] + }; + }, + toJSON(message: Contract): unknown { + const obj: any = {}; + message.contractAddress !== undefined && (obj.contractAddress = message.contractAddress); + message.contractInfo !== undefined && (obj.contractInfo = message.contractInfo ? ContractInfo.toJSON(message.contractInfo) : undefined); + if (message.contractState) { + obj.contractState = message.contractState.map(e => e ? Model.toJSON(e) : undefined); + } else { + obj.contractState = []; + } + if (message.contractCodeHistory) { + obj.contractCodeHistory = message.contractCodeHistory.map(e => e ? ContractCodeHistoryEntry.toJSON(e) : undefined); + } else { + obj.contractCodeHistory = []; + } + return obj; + }, fromPartial(object: Partial): Contract { const message = createBaseContract(); message.contractAddress = object.contractAddress ?? ""; @@ -378,17 +492,21 @@ export const Contract = { return message; }, fromAmino(object: ContractAmino): Contract { - return { - contractAddress: object.contract_address, - contractInfo: object?.contract_info ? ContractInfo.fromAmino(object.contract_info) : undefined, - contractState: Array.isArray(object?.contract_state) ? object.contract_state.map((e: any) => Model.fromAmino(e)) : [], - contractCodeHistory: Array.isArray(object?.contract_code_history) ? object.contract_code_history.map((e: any) => ContractCodeHistoryEntry.fromAmino(e)) : [] - }; + const message = createBaseContract(); + if (object.contract_address !== undefined && object.contract_address !== null) { + message.contractAddress = object.contract_address; + } + if (object.contract_info !== undefined && object.contract_info !== null) { + message.contractInfo = ContractInfo.fromAmino(object.contract_info); + } + message.contractState = object.contract_state?.map(e => Model.fromAmino(e)) || []; + message.contractCodeHistory = object.contract_code_history?.map(e => ContractCodeHistoryEntry.fromAmino(e)) || []; + return message; }, toAmino(message: Contract): ContractAmino { const obj: any = {}; obj.contract_address = message.contractAddress; - obj.contract_info = message.contractInfo ? ContractInfo.toAmino(message.contractInfo) : undefined; + obj.contract_info = message.contractInfo ? ContractInfo.toAmino(message.contractInfo) : ContractInfo.fromPartial({}); if (message.contractState) { obj.contract_state = message.contractState.map(e => e ? Model.toAmino(e) : undefined); } else { @@ -423,6 +541,8 @@ export const Contract = { }; } }; +GlobalDecoderRegistry.register(Contract.typeUrl, Contract); +GlobalDecoderRegistry.registerAminoProtoMapping(Contract.aminoType, Contract.typeUrl); function createBaseSequence(): Sequence { return { idKey: new Uint8Array(), @@ -431,6 +551,16 @@ function createBaseSequence(): Sequence { } export const Sequence = { typeUrl: "/cosmwasm.wasm.v1.Sequence", + aminoType: "wasm/Sequence", + is(o: any): o is Sequence { + return o && (o.$typeUrl === Sequence.typeUrl || (o.idKey instanceof Uint8Array || typeof o.idKey === "string") && typeof o.value === "bigint"); + }, + isSDK(o: any): o is SequenceSDKType { + return o && (o.$typeUrl === Sequence.typeUrl || (o.id_key instanceof Uint8Array || typeof o.id_key === "string") && typeof o.value === "bigint"); + }, + isAmino(o: any): o is SequenceAmino { + return o && (o.$typeUrl === Sequence.typeUrl || (o.id_key instanceof Uint8Array || typeof o.id_key === "string") && typeof o.value === "bigint"); + }, encode(message: Sequence, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.idKey.length !== 0) { writer.uint32(10).bytes(message.idKey); @@ -460,6 +590,18 @@ export const Sequence = { } return message; }, + fromJSON(object: any): Sequence { + return { + idKey: isSet(object.idKey) ? bytesFromBase64(object.idKey) : new Uint8Array(), + value: isSet(object.value) ? BigInt(object.value.toString()) : BigInt(0) + }; + }, + toJSON(message: Sequence): unknown { + const obj: any = {}; + message.idKey !== undefined && (obj.idKey = base64FromBytes(message.idKey !== undefined ? message.idKey : new Uint8Array())); + message.value !== undefined && (obj.value = (message.value || BigInt(0)).toString()); + return obj; + }, fromPartial(object: Partial): Sequence { const message = createBaseSequence(); message.idKey = object.idKey ?? new Uint8Array(); @@ -467,14 +609,18 @@ export const Sequence = { return message; }, fromAmino(object: SequenceAmino): Sequence { - return { - idKey: object.id_key, - value: BigInt(object.value) - }; + const message = createBaseSequence(); + if (object.id_key !== undefined && object.id_key !== null) { + message.idKey = bytesFromBase64(object.id_key); + } + if (object.value !== undefined && object.value !== null) { + message.value = BigInt(object.value); + } + return message; }, toAmino(message: Sequence): SequenceAmino { const obj: any = {}; - obj.id_key = message.idKey; + obj.id_key = message.idKey ? base64FromBytes(message.idKey) : undefined; obj.value = message.value ? message.value.toString() : undefined; return obj; }, @@ -499,4 +645,6 @@ export const Sequence = { value: Sequence.encode(message).finish() }; } -}; \ No newline at end of file +}; +GlobalDecoderRegistry.register(Sequence.typeUrl, Sequence); +GlobalDecoderRegistry.registerAminoProtoMapping(Sequence.aminoType, Sequence.typeUrl); \ No newline at end of file diff --git a/packages/osmojs/src/codegen/cosmwasm/wasm/v1/ibc.ts b/packages/osmojs/src/codegen/cosmwasm/wasm/v1/ibc.ts index 628b26b46..121c0478c 100644 --- a/packages/osmojs/src/codegen/cosmwasm/wasm/v1/ibc.ts +++ b/packages/osmojs/src/codegen/cosmwasm/wasm/v1/ibc.ts @@ -1,4 +1,6 @@ import { BinaryReader, BinaryWriter } from "../../../binary"; +import { isSet, bytesFromBase64, base64FromBytes } from "../../../helpers"; +import { GlobalDecoderRegistry } from "../../../registry"; /** MsgIBCSend */ export interface MsgIBCSend { /** the channel by which the packet will be sent */ @@ -26,22 +28,22 @@ export interface MsgIBCSendProtoMsg { /** MsgIBCSend */ export interface MsgIBCSendAmino { /** the channel by which the packet will be sent */ - channel: string; + channel?: string; /** * Timeout height relative to the current block height. * The timeout is disabled when set to 0. */ - timeout_height: string; + timeout_height?: string; /** * Timeout timestamp (in nanoseconds) relative to the current block timestamp. * The timeout is disabled when set to 0. */ - timeout_timestamp: string; + timeout_timestamp?: string; /** * Data is the payload to transfer. We must not make assumption what format or * content is in here. */ - data: Uint8Array; + data?: string; } export interface MsgIBCSendAminoMsg { type: "wasm/MsgIBCSend"; @@ -66,7 +68,7 @@ export interface MsgIBCSendResponseProtoMsg { /** MsgIBCSendResponse */ export interface MsgIBCSendResponseAmino { /** Sequence number of the IBC packet sent */ - sequence: string; + sequence?: string; } export interface MsgIBCSendResponseAminoMsg { type: "wasm/MsgIBCSendResponse"; @@ -86,7 +88,7 @@ export interface MsgIBCCloseChannelProtoMsg { } /** MsgIBCCloseChannel port and channel need to be owned by the contract */ export interface MsgIBCCloseChannelAmino { - channel: string; + channel?: string; } export interface MsgIBCCloseChannelAminoMsg { type: "wasm/MsgIBCCloseChannel"; @@ -106,6 +108,16 @@ function createBaseMsgIBCSend(): MsgIBCSend { } export const MsgIBCSend = { typeUrl: "/cosmwasm.wasm.v1.MsgIBCSend", + aminoType: "wasm/MsgIBCSend", + is(o: any): o is MsgIBCSend { + return o && (o.$typeUrl === MsgIBCSend.typeUrl || typeof o.channel === "string" && typeof o.timeoutHeight === "bigint" && typeof o.timeoutTimestamp === "bigint" && (o.data instanceof Uint8Array || typeof o.data === "string")); + }, + isSDK(o: any): o is MsgIBCSendSDKType { + return o && (o.$typeUrl === MsgIBCSend.typeUrl || typeof o.channel === "string" && typeof o.timeout_height === "bigint" && typeof o.timeout_timestamp === "bigint" && (o.data instanceof Uint8Array || typeof o.data === "string")); + }, + isAmino(o: any): o is MsgIBCSendAmino { + return o && (o.$typeUrl === MsgIBCSend.typeUrl || typeof o.channel === "string" && typeof o.timeout_height === "bigint" && typeof o.timeout_timestamp === "bigint" && (o.data instanceof Uint8Array || typeof o.data === "string")); + }, encode(message: MsgIBCSend, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.channel !== "") { writer.uint32(18).string(message.channel); @@ -147,6 +159,22 @@ export const MsgIBCSend = { } return message; }, + fromJSON(object: any): MsgIBCSend { + return { + channel: isSet(object.channel) ? String(object.channel) : "", + timeoutHeight: isSet(object.timeoutHeight) ? BigInt(object.timeoutHeight.toString()) : BigInt(0), + timeoutTimestamp: isSet(object.timeoutTimestamp) ? BigInt(object.timeoutTimestamp.toString()) : BigInt(0), + data: isSet(object.data) ? bytesFromBase64(object.data) : new Uint8Array() + }; + }, + toJSON(message: MsgIBCSend): unknown { + const obj: any = {}; + message.channel !== undefined && (obj.channel = message.channel); + message.timeoutHeight !== undefined && (obj.timeoutHeight = (message.timeoutHeight || BigInt(0)).toString()); + message.timeoutTimestamp !== undefined && (obj.timeoutTimestamp = (message.timeoutTimestamp || BigInt(0)).toString()); + message.data !== undefined && (obj.data = base64FromBytes(message.data !== undefined ? message.data : new Uint8Array())); + return obj; + }, fromPartial(object: Partial): MsgIBCSend { const message = createBaseMsgIBCSend(); message.channel = object.channel ?? ""; @@ -156,19 +184,27 @@ export const MsgIBCSend = { return message; }, fromAmino(object: MsgIBCSendAmino): MsgIBCSend { - return { - channel: object.channel, - timeoutHeight: BigInt(object.timeout_height), - timeoutTimestamp: BigInt(object.timeout_timestamp), - data: object.data - }; + const message = createBaseMsgIBCSend(); + if (object.channel !== undefined && object.channel !== null) { + message.channel = object.channel; + } + if (object.timeout_height !== undefined && object.timeout_height !== null) { + message.timeoutHeight = BigInt(object.timeout_height); + } + if (object.timeout_timestamp !== undefined && object.timeout_timestamp !== null) { + message.timeoutTimestamp = BigInt(object.timeout_timestamp); + } + if (object.data !== undefined && object.data !== null) { + message.data = bytesFromBase64(object.data); + } + return message; }, toAmino(message: MsgIBCSend): MsgIBCSendAmino { const obj: any = {}; obj.channel = message.channel; obj.timeout_height = message.timeoutHeight ? message.timeoutHeight.toString() : undefined; obj.timeout_timestamp = message.timeoutTimestamp ? message.timeoutTimestamp.toString() : undefined; - obj.data = message.data; + obj.data = message.data ? base64FromBytes(message.data) : undefined; return obj; }, fromAminoMsg(object: MsgIBCSendAminoMsg): MsgIBCSend { @@ -193,6 +229,8 @@ export const MsgIBCSend = { }; } }; +GlobalDecoderRegistry.register(MsgIBCSend.typeUrl, MsgIBCSend); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgIBCSend.aminoType, MsgIBCSend.typeUrl); function createBaseMsgIBCSendResponse(): MsgIBCSendResponse { return { sequence: BigInt(0) @@ -200,6 +238,16 @@ function createBaseMsgIBCSendResponse(): MsgIBCSendResponse { } export const MsgIBCSendResponse = { typeUrl: "/cosmwasm.wasm.v1.MsgIBCSendResponse", + aminoType: "wasm/MsgIBCSendResponse", + is(o: any): o is MsgIBCSendResponse { + return o && (o.$typeUrl === MsgIBCSendResponse.typeUrl || typeof o.sequence === "bigint"); + }, + isSDK(o: any): o is MsgIBCSendResponseSDKType { + return o && (o.$typeUrl === MsgIBCSendResponse.typeUrl || typeof o.sequence === "bigint"); + }, + isAmino(o: any): o is MsgIBCSendResponseAmino { + return o && (o.$typeUrl === MsgIBCSendResponse.typeUrl || typeof o.sequence === "bigint"); + }, encode(message: MsgIBCSendResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.sequence !== BigInt(0)) { writer.uint32(8).uint64(message.sequence); @@ -223,15 +271,27 @@ export const MsgIBCSendResponse = { } return message; }, + fromJSON(object: any): MsgIBCSendResponse { + return { + sequence: isSet(object.sequence) ? BigInt(object.sequence.toString()) : BigInt(0) + }; + }, + toJSON(message: MsgIBCSendResponse): unknown { + const obj: any = {}; + message.sequence !== undefined && (obj.sequence = (message.sequence || BigInt(0)).toString()); + return obj; + }, fromPartial(object: Partial): MsgIBCSendResponse { const message = createBaseMsgIBCSendResponse(); message.sequence = object.sequence !== undefined && object.sequence !== null ? BigInt(object.sequence.toString()) : BigInt(0); return message; }, fromAmino(object: MsgIBCSendResponseAmino): MsgIBCSendResponse { - return { - sequence: BigInt(object.sequence) - }; + const message = createBaseMsgIBCSendResponse(); + if (object.sequence !== undefined && object.sequence !== null) { + message.sequence = BigInt(object.sequence); + } + return message; }, toAmino(message: MsgIBCSendResponse): MsgIBCSendResponseAmino { const obj: any = {}; @@ -260,6 +320,8 @@ export const MsgIBCSendResponse = { }; } }; +GlobalDecoderRegistry.register(MsgIBCSendResponse.typeUrl, MsgIBCSendResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgIBCSendResponse.aminoType, MsgIBCSendResponse.typeUrl); function createBaseMsgIBCCloseChannel(): MsgIBCCloseChannel { return { channel: "" @@ -267,6 +329,16 @@ function createBaseMsgIBCCloseChannel(): MsgIBCCloseChannel { } export const MsgIBCCloseChannel = { typeUrl: "/cosmwasm.wasm.v1.MsgIBCCloseChannel", + aminoType: "wasm/MsgIBCCloseChannel", + is(o: any): o is MsgIBCCloseChannel { + return o && (o.$typeUrl === MsgIBCCloseChannel.typeUrl || typeof o.channel === "string"); + }, + isSDK(o: any): o is MsgIBCCloseChannelSDKType { + return o && (o.$typeUrl === MsgIBCCloseChannel.typeUrl || typeof o.channel === "string"); + }, + isAmino(o: any): o is MsgIBCCloseChannelAmino { + return o && (o.$typeUrl === MsgIBCCloseChannel.typeUrl || typeof o.channel === "string"); + }, encode(message: MsgIBCCloseChannel, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.channel !== "") { writer.uint32(18).string(message.channel); @@ -290,15 +362,27 @@ export const MsgIBCCloseChannel = { } return message; }, + fromJSON(object: any): MsgIBCCloseChannel { + return { + channel: isSet(object.channel) ? String(object.channel) : "" + }; + }, + toJSON(message: MsgIBCCloseChannel): unknown { + const obj: any = {}; + message.channel !== undefined && (obj.channel = message.channel); + return obj; + }, fromPartial(object: Partial): MsgIBCCloseChannel { const message = createBaseMsgIBCCloseChannel(); message.channel = object.channel ?? ""; return message; }, fromAmino(object: MsgIBCCloseChannelAmino): MsgIBCCloseChannel { - return { - channel: object.channel - }; + const message = createBaseMsgIBCCloseChannel(); + if (object.channel !== undefined && object.channel !== null) { + message.channel = object.channel; + } + return message; }, toAmino(message: MsgIBCCloseChannel): MsgIBCCloseChannelAmino { const obj: any = {}; @@ -326,4 +410,6 @@ export const MsgIBCCloseChannel = { value: MsgIBCCloseChannel.encode(message).finish() }; } -}; \ No newline at end of file +}; +GlobalDecoderRegistry.register(MsgIBCCloseChannel.typeUrl, MsgIBCCloseChannel); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgIBCCloseChannel.aminoType, MsgIBCCloseChannel.typeUrl); \ No newline at end of file diff --git a/packages/osmojs/src/codegen/cosmwasm/wasm/v1/proposal.ts b/packages/osmojs/src/codegen/cosmwasm/wasm/v1/proposal_legacy.ts similarity index 55% rename from packages/osmojs/src/codegen/cosmwasm/wasm/v1/proposal.ts rename to packages/osmojs/src/codegen/cosmwasm/wasm/v1/proposal_legacy.ts index 4266f68fa..1d4b16f28 100644 --- a/packages/osmojs/src/codegen/cosmwasm/wasm/v1/proposal.ts +++ b/packages/osmojs/src/codegen/cosmwasm/wasm/v1/proposal_legacy.ts @@ -1,10 +1,18 @@ import { AccessConfig, AccessConfigAmino, AccessConfigSDKType } from "./types"; import { Coin, CoinAmino, CoinSDKType } from "../../../cosmos/base/v1beta1/coin"; import { BinaryReader, BinaryWriter } from "../../../binary"; +import { isSet, bytesFromBase64, base64FromBytes } from "../../../helpers"; import { fromBase64, toBase64, toUtf8, fromUtf8 } from "@cosmjs/encoding"; -/** StoreCodeProposal gov proposal content type to submit WASM code to the system */ +import { GlobalDecoderRegistry } from "../../../registry"; +/** + * Deprecated: Do not use. Since wasmd v0.40, there is no longer a need for + * an explicit StoreCodeProposal. To submit WASM code to the system, + * a simple MsgStoreCode can be invoked from the x/gov module via + * a v1 governance proposal. + */ +/** @deprecated */ export interface StoreCodeProposal { - $typeUrl?: string; + $typeUrl?: "/cosmwasm.wasm.v1.StoreCodeProposal"; /** Title is a short summary */ title: string; /** Description is a human readable text */ @@ -14,7 +22,7 @@ export interface StoreCodeProposal { /** WASMByteCode can be raw or gzip compressed */ wasmByteCode: Uint8Array; /** InstantiatePermission to apply on contract creation, optional */ - instantiatePermission: AccessConfig; + instantiatePermission?: AccessConfig; /** UnpinCode code on upload, optional */ unpinCode: boolean; /** Source is the URL where the code is hosted */ @@ -34,56 +42,71 @@ export interface StoreCodeProposalProtoMsg { typeUrl: "/cosmwasm.wasm.v1.StoreCodeProposal"; value: Uint8Array; } -/** StoreCodeProposal gov proposal content type to submit WASM code to the system */ +/** + * Deprecated: Do not use. Since wasmd v0.40, there is no longer a need for + * an explicit StoreCodeProposal. To submit WASM code to the system, + * a simple MsgStoreCode can be invoked from the x/gov module via + * a v1 governance proposal. + */ +/** @deprecated */ export interface StoreCodeProposalAmino { /** Title is a short summary */ - title: string; + title?: string; /** Description is a human readable text */ - description: string; + description?: string; /** RunAs is the address that is passed to the contract's environment as sender */ - run_as: string; + run_as?: string; /** WASMByteCode can be raw or gzip compressed */ - wasm_byte_code: string; + wasm_byte_code?: string; /** InstantiatePermission to apply on contract creation, optional */ instantiate_permission?: AccessConfigAmino; /** UnpinCode code on upload, optional */ - unpin_code: boolean; + unpin_code?: boolean; /** Source is the URL where the code is hosted */ - source: string; + source?: string; /** * Builder is the docker image used to build the code deterministically, used * for smart contract verification */ - builder: string; + builder?: string; /** * CodeHash is the SHA256 sum of the code outputted by builder, used for smart * contract verification */ - code_hash: Uint8Array; + code_hash?: string; } export interface StoreCodeProposalAminoMsg { type: "wasm/StoreCodeProposal"; value: StoreCodeProposalAmino; } -/** StoreCodeProposal gov proposal content type to submit WASM code to the system */ +/** + * Deprecated: Do not use. Since wasmd v0.40, there is no longer a need for + * an explicit StoreCodeProposal. To submit WASM code to the system, + * a simple MsgStoreCode can be invoked from the x/gov module via + * a v1 governance proposal. + */ +/** @deprecated */ export interface StoreCodeProposalSDKType { - $typeUrl?: string; + $typeUrl?: "/cosmwasm.wasm.v1.StoreCodeProposal"; title: string; description: string; run_as: string; wasm_byte_code: Uint8Array; - instantiate_permission: AccessConfigSDKType; + instantiate_permission?: AccessConfigSDKType; unpin_code: boolean; source: string; builder: string; code_hash: Uint8Array; } /** - * InstantiateContractProposal gov proposal content type to instantiate a - * contract. + * Deprecated: Do not use. Since wasmd v0.40, there is no longer a need for + * an explicit InstantiateContractProposal. To instantiate a contract, + * a simple MsgInstantiateContract can be invoked from the x/gov module via + * a v1 governance proposal. */ +/** @deprecated */ export interface InstantiateContractProposal { - $typeUrl?: string; + $typeUrl?: "/cosmwasm.wasm.v1.InstantiateContractProposal"; /** Title is a short summary */ title: string; /** Description is a human readable text */ @@ -106,24 +129,27 @@ export interface InstantiateContractProposalProtoMsg { value: Uint8Array; } /** - * InstantiateContractProposal gov proposal content type to instantiate a - * contract. + * Deprecated: Do not use. Since wasmd v0.40, there is no longer a need for + * an explicit InstantiateContractProposal. To instantiate a contract, + * a simple MsgInstantiateContract can be invoked from the x/gov module via + * a v1 governance proposal. */ +/** @deprecated */ export interface InstantiateContractProposalAmino { /** Title is a short summary */ - title: string; + title?: string; /** Description is a human readable text */ - description: string; + description?: string; /** RunAs is the address that is passed to the contract's environment as sender */ - run_as: string; + run_as?: string; /** Admin is an optional address that can execute migrations */ - admin: string; + admin?: string; /** CodeID is the reference to the stored WASM code */ - code_id: string; + code_id?: string; /** Label is optional metadata to be stored with a constract instance. */ - label: string; + label?: string; /** Msg json encoded message to be passed to the contract on instantiation */ - msg: Uint8Array; + msg?: any; /** Funds coins that are transferred to the contract on instantiation */ funds: CoinAmino[]; } @@ -132,11 +158,14 @@ export interface InstantiateContractProposalAminoMsg { value: InstantiateContractProposalAmino; } /** - * InstantiateContractProposal gov proposal content type to instantiate a - * contract. + * Deprecated: Do not use. Since wasmd v0.40, there is no longer a need for + * an explicit InstantiateContractProposal. To instantiate a contract, + * a simple MsgInstantiateContract can be invoked from the x/gov module via + * a v1 governance proposal. */ +/** @deprecated */ export interface InstantiateContractProposalSDKType { - $typeUrl?: string; + $typeUrl?: "/cosmwasm.wasm.v1.InstantiateContractProposal"; title: string; description: string; run_as: string; @@ -147,11 +176,14 @@ export interface InstantiateContractProposalSDKType { funds: CoinSDKType[]; } /** - * InstantiateContract2Proposal gov proposal content type to instantiate - * contract 2 + * Deprecated: Do not use. Since wasmd v0.40, there is no longer a need for + * an explicit InstantiateContract2Proposal. To instantiate contract 2, + * a simple MsgInstantiateContract2 can be invoked from the x/gov module via + * a v1 governance proposal. */ +/** @deprecated */ export interface InstantiateContract2Proposal { - $typeUrl?: string; + $typeUrl?: "/cosmwasm.wasm.v1.InstantiateContract2Proposal"; /** Title is a short summary */ title: string; /** Description is a human readable text */ @@ -181,44 +213,50 @@ export interface InstantiateContract2ProposalProtoMsg { value: Uint8Array; } /** - * InstantiateContract2Proposal gov proposal content type to instantiate - * contract 2 + * Deprecated: Do not use. Since wasmd v0.40, there is no longer a need for + * an explicit InstantiateContract2Proposal. To instantiate contract 2, + * a simple MsgInstantiateContract2 can be invoked from the x/gov module via + * a v1 governance proposal. */ +/** @deprecated */ export interface InstantiateContract2ProposalAmino { /** Title is a short summary */ - title: string; + title?: string; /** Description is a human readable text */ - description: string; + description?: string; /** RunAs is the address that is passed to the contract's enviroment as sender */ - run_as: string; + run_as?: string; /** Admin is an optional address that can execute migrations */ - admin: string; + admin?: string; /** CodeID is the reference to the stored WASM code */ - code_id: string; + code_id?: string; /** Label is optional metadata to be stored with a constract instance. */ - label: string; + label?: string; /** Msg json encode message to be passed to the contract on instantiation */ - msg: Uint8Array; + msg?: any; /** Funds coins that are transferred to the contract on instantiation */ funds: CoinAmino[]; /** Salt is an arbitrary value provided by the sender. Size can be 1 to 64. */ - salt: Uint8Array; + salt?: string; /** * FixMsg include the msg value into the hash for the predictable address. * Default is false */ - fix_msg: boolean; + fix_msg?: boolean; } export interface InstantiateContract2ProposalAminoMsg { type: "wasm/InstantiateContract2Proposal"; value: InstantiateContract2ProposalAmino; } /** - * InstantiateContract2Proposal gov proposal content type to instantiate - * contract 2 + * Deprecated: Do not use. Since wasmd v0.40, there is no longer a need for + * an explicit InstantiateContract2Proposal. To instantiate contract 2, + * a simple MsgInstantiateContract2 can be invoked from the x/gov module via + * a v1 governance proposal. */ +/** @deprecated */ export interface InstantiateContract2ProposalSDKType { - $typeUrl?: string; + $typeUrl?: "/cosmwasm.wasm.v1.InstantiateContract2Proposal"; title: string; description: string; run_as: string; @@ -230,9 +268,15 @@ export interface InstantiateContract2ProposalSDKType { salt: Uint8Array; fix_msg: boolean; } -/** MigrateContractProposal gov proposal content type to migrate a contract. */ +/** + * Deprecated: Do not use. Since wasmd v0.40, there is no longer a need for + * an explicit MigrateContractProposal. To migrate a contract, + * a simple MsgMigrateContract can be invoked from the x/gov module via + * a v1 governance proposal. + */ +/** @deprecated */ export interface MigrateContractProposal { - $typeUrl?: string; + $typeUrl?: "/cosmwasm.wasm.v1.MigrateContractProposal"; /** Title is a short summary */ title: string; /** Description is a human readable text */ @@ -248,35 +292,53 @@ export interface MigrateContractProposalProtoMsg { typeUrl: "/cosmwasm.wasm.v1.MigrateContractProposal"; value: Uint8Array; } -/** MigrateContractProposal gov proposal content type to migrate a contract. */ +/** + * Deprecated: Do not use. Since wasmd v0.40, there is no longer a need for + * an explicit MigrateContractProposal. To migrate a contract, + * a simple MsgMigrateContract can be invoked from the x/gov module via + * a v1 governance proposal. + */ +/** @deprecated */ export interface MigrateContractProposalAmino { /** Title is a short summary */ - title: string; + title?: string; /** Description is a human readable text */ - description: string; + description?: string; /** Contract is the address of the smart contract */ - contract: string; + contract?: string; /** CodeID references the new WASM code */ - code_id: string; + code_id?: string; /** Msg json encoded message to be passed to the contract on migration */ - msg: Uint8Array; + msg?: any; } export interface MigrateContractProposalAminoMsg { type: "wasm/MigrateContractProposal"; value: MigrateContractProposalAmino; } -/** MigrateContractProposal gov proposal content type to migrate a contract. */ +/** + * Deprecated: Do not use. Since wasmd v0.40, there is no longer a need for + * an explicit MigrateContractProposal. To migrate a contract, + * a simple MsgMigrateContract can be invoked from the x/gov module via + * a v1 governance proposal. + */ +/** @deprecated */ export interface MigrateContractProposalSDKType { - $typeUrl?: string; + $typeUrl?: "/cosmwasm.wasm.v1.MigrateContractProposal"; title: string; description: string; contract: string; code_id: bigint; msg: Uint8Array; } -/** SudoContractProposal gov proposal content type to call sudo on a contract. */ +/** + * Deprecated: Do not use. Since wasmd v0.40, there is no longer a need for + * an explicit SudoContractProposal. To call sudo on a contract, + * a simple MsgSudoContract can be invoked from the x/gov module via + * a v1 governance proposal. + */ +/** @deprecated */ export interface SudoContractProposal { - $typeUrl?: string; + $typeUrl?: "/cosmwasm.wasm.v1.SudoContractProposal"; /** Title is a short summary */ title: string; /** Description is a human readable text */ @@ -290,35 +352,50 @@ export interface SudoContractProposalProtoMsg { typeUrl: "/cosmwasm.wasm.v1.SudoContractProposal"; value: Uint8Array; } -/** SudoContractProposal gov proposal content type to call sudo on a contract. */ +/** + * Deprecated: Do not use. Since wasmd v0.40, there is no longer a need for + * an explicit SudoContractProposal. To call sudo on a contract, + * a simple MsgSudoContract can be invoked from the x/gov module via + * a v1 governance proposal. + */ +/** @deprecated */ export interface SudoContractProposalAmino { /** Title is a short summary */ - title: string; + title?: string; /** Description is a human readable text */ - description: string; + description?: string; /** Contract is the address of the smart contract */ - contract: string; + contract?: string; /** Msg json encoded message to be passed to the contract as sudo */ - msg: Uint8Array; + msg?: any; } export interface SudoContractProposalAminoMsg { type: "wasm/SudoContractProposal"; value: SudoContractProposalAmino; } -/** SudoContractProposal gov proposal content type to call sudo on a contract. */ +/** + * Deprecated: Do not use. Since wasmd v0.40, there is no longer a need for + * an explicit SudoContractProposal. To call sudo on a contract, + * a simple MsgSudoContract can be invoked from the x/gov module via + * a v1 governance proposal. + */ +/** @deprecated */ export interface SudoContractProposalSDKType { - $typeUrl?: string; + $typeUrl?: "/cosmwasm.wasm.v1.SudoContractProposal"; title: string; description: string; contract: string; msg: Uint8Array; } /** - * ExecuteContractProposal gov proposal content type to call execute on a - * contract. + * Deprecated: Do not use. Since wasmd v0.40, there is no longer a need for + * an explicit ExecuteContractProposal. To call execute on a contract, + * a simple MsgExecuteContract can be invoked from the x/gov module via + * a v1 governance proposal. */ +/** @deprecated */ export interface ExecuteContractProposal { - $typeUrl?: string; + $typeUrl?: "/cosmwasm.wasm.v1.ExecuteContractProposal"; /** Title is a short summary */ title: string; /** Description is a human readable text */ @@ -337,20 +414,23 @@ export interface ExecuteContractProposalProtoMsg { value: Uint8Array; } /** - * ExecuteContractProposal gov proposal content type to call execute on a - * contract. + * Deprecated: Do not use. Since wasmd v0.40, there is no longer a need for + * an explicit ExecuteContractProposal. To call execute on a contract, + * a simple MsgExecuteContract can be invoked from the x/gov module via + * a v1 governance proposal. */ +/** @deprecated */ export interface ExecuteContractProposalAmino { /** Title is a short summary */ - title: string; + title?: string; /** Description is a human readable text */ - description: string; + description?: string; /** RunAs is the address that is passed to the contract's environment as sender */ - run_as: string; + run_as?: string; /** Contract is the address of the smart contract */ - contract: string; + contract?: string; /** Msg json encoded message to be passed to the contract as execute */ - msg: Uint8Array; + msg?: any; /** Funds coins that are transferred to the contract on instantiation */ funds: CoinAmino[]; } @@ -359,11 +439,14 @@ export interface ExecuteContractProposalAminoMsg { value: ExecuteContractProposalAmino; } /** - * ExecuteContractProposal gov proposal content type to call execute on a - * contract. + * Deprecated: Do not use. Since wasmd v0.40, there is no longer a need for + * an explicit ExecuteContractProposal. To call execute on a contract, + * a simple MsgExecuteContract can be invoked from the x/gov module via + * a v1 governance proposal. */ +/** @deprecated */ export interface ExecuteContractProposalSDKType { - $typeUrl?: string; + $typeUrl?: "/cosmwasm.wasm.v1.ExecuteContractProposal"; title: string; description: string; run_as: string; @@ -371,9 +454,15 @@ export interface ExecuteContractProposalSDKType { msg: Uint8Array; funds: CoinSDKType[]; } -/** UpdateAdminProposal gov proposal content type to set an admin for a contract. */ +/** + * Deprecated: Do not use. Since wasmd v0.40, there is no longer a need for + * an explicit UpdateAdminProposal. To set an admin for a contract, + * a simple MsgUpdateAdmin can be invoked from the x/gov module via + * a v1 governance proposal. + */ +/** @deprecated */ export interface UpdateAdminProposal { - $typeUrl?: string; + $typeUrl?: "/cosmwasm.wasm.v1.UpdateAdminProposal"; /** Title is a short summary */ title: string; /** Description is a human readable text */ @@ -387,35 +476,50 @@ export interface UpdateAdminProposalProtoMsg { typeUrl: "/cosmwasm.wasm.v1.UpdateAdminProposal"; value: Uint8Array; } -/** UpdateAdminProposal gov proposal content type to set an admin for a contract. */ +/** + * Deprecated: Do not use. Since wasmd v0.40, there is no longer a need for + * an explicit UpdateAdminProposal. To set an admin for a contract, + * a simple MsgUpdateAdmin can be invoked from the x/gov module via + * a v1 governance proposal. + */ +/** @deprecated */ export interface UpdateAdminProposalAmino { /** Title is a short summary */ - title: string; + title?: string; /** Description is a human readable text */ - description: string; + description?: string; /** NewAdmin address to be set */ - new_admin: string; + new_admin?: string; /** Contract is the address of the smart contract */ - contract: string; + contract?: string; } export interface UpdateAdminProposalAminoMsg { type: "wasm/UpdateAdminProposal"; value: UpdateAdminProposalAmino; } -/** UpdateAdminProposal gov proposal content type to set an admin for a contract. */ +/** + * Deprecated: Do not use. Since wasmd v0.40, there is no longer a need for + * an explicit UpdateAdminProposal. To set an admin for a contract, + * a simple MsgUpdateAdmin can be invoked from the x/gov module via + * a v1 governance proposal. + */ +/** @deprecated */ export interface UpdateAdminProposalSDKType { - $typeUrl?: string; + $typeUrl?: "/cosmwasm.wasm.v1.UpdateAdminProposal"; title: string; description: string; new_admin: string; contract: string; } /** - * ClearAdminProposal gov proposal content type to clear the admin of a - * contract. + * Deprecated: Do not use. Since wasmd v0.40, there is no longer a need for + * an explicit ClearAdminProposal. To clear the admin of a contract, + * a simple MsgClearAdmin can be invoked from the x/gov module via + * a v1 governance proposal. */ +/** @deprecated */ export interface ClearAdminProposal { - $typeUrl?: string; + $typeUrl?: "/cosmwasm.wasm.v1.ClearAdminProposal"; /** Title is a short summary */ title: string; /** Description is a human readable text */ @@ -428,37 +532,46 @@ export interface ClearAdminProposalProtoMsg { value: Uint8Array; } /** - * ClearAdminProposal gov proposal content type to clear the admin of a - * contract. + * Deprecated: Do not use. Since wasmd v0.40, there is no longer a need for + * an explicit ClearAdminProposal. To clear the admin of a contract, + * a simple MsgClearAdmin can be invoked from the x/gov module via + * a v1 governance proposal. */ +/** @deprecated */ export interface ClearAdminProposalAmino { /** Title is a short summary */ - title: string; + title?: string; /** Description is a human readable text */ - description: string; + description?: string; /** Contract is the address of the smart contract */ - contract: string; + contract?: string; } export interface ClearAdminProposalAminoMsg { type: "wasm/ClearAdminProposal"; value: ClearAdminProposalAmino; } /** - * ClearAdminProposal gov proposal content type to clear the admin of a - * contract. + * Deprecated: Do not use. Since wasmd v0.40, there is no longer a need for + * an explicit ClearAdminProposal. To clear the admin of a contract, + * a simple MsgClearAdmin can be invoked from the x/gov module via + * a v1 governance proposal. */ +/** @deprecated */ export interface ClearAdminProposalSDKType { - $typeUrl?: string; + $typeUrl?: "/cosmwasm.wasm.v1.ClearAdminProposal"; title: string; description: string; contract: string; } /** - * PinCodesProposal gov proposal content type to pin a set of code ids in the - * wasmvm cache. + * Deprecated: Do not use. Since wasmd v0.40, there is no longer a need for + * an explicit PinCodesProposal. To pin a set of code ids in the wasmvm + * cache, a simple MsgPinCodes can be invoked from the x/gov module via + * a v1 governance proposal. */ +/** @deprecated */ export interface PinCodesProposal { - $typeUrl?: string; + $typeUrl?: "/cosmwasm.wasm.v1.PinCodesProposal"; /** Title is a short summary */ title: string; /** Description is a human readable text */ @@ -471,37 +584,46 @@ export interface PinCodesProposalProtoMsg { value: Uint8Array; } /** - * PinCodesProposal gov proposal content type to pin a set of code ids in the - * wasmvm cache. + * Deprecated: Do not use. Since wasmd v0.40, there is no longer a need for + * an explicit PinCodesProposal. To pin a set of code ids in the wasmvm + * cache, a simple MsgPinCodes can be invoked from the x/gov module via + * a v1 governance proposal. */ +/** @deprecated */ export interface PinCodesProposalAmino { /** Title is a short summary */ - title: string; + title?: string; /** Description is a human readable text */ - description: string; + description?: string; /** CodeIDs references the new WASM codes */ - code_ids: string[]; + code_ids?: string[]; } export interface PinCodesProposalAminoMsg { type: "wasm/PinCodesProposal"; value: PinCodesProposalAmino; } /** - * PinCodesProposal gov proposal content type to pin a set of code ids in the - * wasmvm cache. + * Deprecated: Do not use. Since wasmd v0.40, there is no longer a need for + * an explicit PinCodesProposal. To pin a set of code ids in the wasmvm + * cache, a simple MsgPinCodes can be invoked from the x/gov module via + * a v1 governance proposal. */ +/** @deprecated */ export interface PinCodesProposalSDKType { - $typeUrl?: string; + $typeUrl?: "/cosmwasm.wasm.v1.PinCodesProposal"; title: string; description: string; code_ids: bigint[]; } /** - * UnpinCodesProposal gov proposal content type to unpin a set of code ids in - * the wasmvm cache. + * Deprecated: Do not use. Since wasmd v0.40, there is no longer a need for + * an explicit UnpinCodesProposal. To unpin a set of code ids in the wasmvm + * cache, a simple MsgUnpinCodes can be invoked from the x/gov module via + * a v1 governance proposal. */ +/** @deprecated */ export interface UnpinCodesProposal { - $typeUrl?: string; + $typeUrl?: "/cosmwasm.wasm.v1.UnpinCodesProposal"; /** Title is a short summary */ title: string; /** Description is a human readable text */ @@ -514,27 +636,33 @@ export interface UnpinCodesProposalProtoMsg { value: Uint8Array; } /** - * UnpinCodesProposal gov proposal content type to unpin a set of code ids in - * the wasmvm cache. + * Deprecated: Do not use. Since wasmd v0.40, there is no longer a need for + * an explicit UnpinCodesProposal. To unpin a set of code ids in the wasmvm + * cache, a simple MsgUnpinCodes can be invoked from the x/gov module via + * a v1 governance proposal. */ +/** @deprecated */ export interface UnpinCodesProposalAmino { /** Title is a short summary */ - title: string; + title?: string; /** Description is a human readable text */ - description: string; + description?: string; /** CodeIDs references the WASM codes */ - code_ids: string[]; + code_ids?: string[]; } export interface UnpinCodesProposalAminoMsg { type: "wasm/UnpinCodesProposal"; value: UnpinCodesProposalAmino; } /** - * UnpinCodesProposal gov proposal content type to unpin a set of code ids in - * the wasmvm cache. + * Deprecated: Do not use. Since wasmd v0.40, there is no longer a need for + * an explicit UnpinCodesProposal. To unpin a set of code ids in the wasmvm + * cache, a simple MsgUnpinCodes can be invoked from the x/gov module via + * a v1 governance proposal. */ +/** @deprecated */ export interface UnpinCodesProposalSDKType { - $typeUrl?: string; + $typeUrl?: "/cosmwasm.wasm.v1.UnpinCodesProposal"; title: string; description: string; code_ids: bigint[]; @@ -559,9 +687,9 @@ export interface AccessConfigUpdateProtoMsg { */ export interface AccessConfigUpdateAmino { /** CodeID is the reference to the stored WASM code to be updated */ - code_id: string; + code_id?: string; /** InstantiatePermission to apply to the set of code ids */ - instantiate_permission?: AccessConfigAmino; + instantiate_permission: AccessConfigAmino; } export interface AccessConfigUpdateAminoMsg { type: "wasm/AccessConfigUpdate"; @@ -576,11 +704,14 @@ export interface AccessConfigUpdateSDKType { instantiate_permission: AccessConfigSDKType; } /** - * UpdateInstantiateConfigProposal gov proposal content type to update - * instantiate config to a set of code ids. + * Deprecated: Do not use. Since wasmd v0.40, there is no longer a need for + * an explicit UpdateInstantiateConfigProposal. To update instantiate config + * to a set of code ids, a simple MsgUpdateInstantiateConfig can be invoked from + * the x/gov module via a v1 governance proposal. */ +/** @deprecated */ export interface UpdateInstantiateConfigProposal { - $typeUrl?: string; + $typeUrl?: "/cosmwasm.wasm.v1.UpdateInstantiateConfigProposal"; /** Title is a short summary */ title: string; /** Description is a human readable text */ @@ -596,14 +727,17 @@ export interface UpdateInstantiateConfigProposalProtoMsg { value: Uint8Array; } /** - * UpdateInstantiateConfigProposal gov proposal content type to update - * instantiate config to a set of code ids. + * Deprecated: Do not use. Since wasmd v0.40, there is no longer a need for + * an explicit UpdateInstantiateConfigProposal. To update instantiate config + * to a set of code ids, a simple MsgUpdateInstantiateConfig can be invoked from + * the x/gov module via a v1 governance proposal. */ +/** @deprecated */ export interface UpdateInstantiateConfigProposalAmino { /** Title is a short summary */ - title: string; + title?: string; /** Description is a human readable text */ - description: string; + description?: string; /** * AccessConfigUpdate contains the list of code ids and the access config * to be applied. @@ -615,21 +749,27 @@ export interface UpdateInstantiateConfigProposalAminoMsg { value: UpdateInstantiateConfigProposalAmino; } /** - * UpdateInstantiateConfigProposal gov proposal content type to update - * instantiate config to a set of code ids. + * Deprecated: Do not use. Since wasmd v0.40, there is no longer a need for + * an explicit UpdateInstantiateConfigProposal. To update instantiate config + * to a set of code ids, a simple MsgUpdateInstantiateConfig can be invoked from + * the x/gov module via a v1 governance proposal. */ +/** @deprecated */ export interface UpdateInstantiateConfigProposalSDKType { - $typeUrl?: string; + $typeUrl?: "/cosmwasm.wasm.v1.UpdateInstantiateConfigProposal"; title: string; description: string; access_config_updates: AccessConfigUpdateSDKType[]; } /** - * StoreAndInstantiateContractProposal gov proposal content type to store - * and instantiate the contract. + * Deprecated: Do not use. Since wasmd v0.40, there is no longer a need for + * an explicit StoreAndInstantiateContractProposal. To store and instantiate + * the contract, a simple MsgStoreAndInstantiateContract can be invoked from + * the x/gov module via a v1 governance proposal. */ +/** @deprecated */ export interface StoreAndInstantiateContractProposal { - $typeUrl?: string; + $typeUrl?: "/cosmwasm.wasm.v1.StoreAndInstantiateContractProposal"; /** Title is a short summary */ title: string; /** Description is a human readable text */ @@ -639,7 +779,7 @@ export interface StoreAndInstantiateContractProposal { /** WASMByteCode can be raw or gzip compressed */ wasmByteCode: Uint8Array; /** InstantiatePermission to apply on contract creation, optional */ - instantiatePermission: AccessConfig; + instantiatePermission?: AccessConfig; /** UnpinCode code on upload, optional */ unpinCode: boolean; /** Admin is an optional address that can execute migrations */ @@ -668,58 +808,64 @@ export interface StoreAndInstantiateContractProposalProtoMsg { value: Uint8Array; } /** - * StoreAndInstantiateContractProposal gov proposal content type to store - * and instantiate the contract. + * Deprecated: Do not use. Since wasmd v0.40, there is no longer a need for + * an explicit StoreAndInstantiateContractProposal. To store and instantiate + * the contract, a simple MsgStoreAndInstantiateContract can be invoked from + * the x/gov module via a v1 governance proposal. */ +/** @deprecated */ export interface StoreAndInstantiateContractProposalAmino { /** Title is a short summary */ - title: string; + title?: string; /** Description is a human readable text */ - description: string; + description?: string; /** RunAs is the address that is passed to the contract's environment as sender */ - run_as: string; + run_as?: string; /** WASMByteCode can be raw or gzip compressed */ - wasm_byte_code: string; + wasm_byte_code?: string; /** InstantiatePermission to apply on contract creation, optional */ instantiate_permission?: AccessConfigAmino; /** UnpinCode code on upload, optional */ - unpin_code: boolean; + unpin_code?: boolean; /** Admin is an optional address that can execute migrations */ - admin: string; + admin?: string; /** Label is optional metadata to be stored with a constract instance. */ - label: string; + label?: string; /** Msg json encoded message to be passed to the contract on instantiation */ - msg: Uint8Array; + msg?: any; /** Funds coins that are transferred to the contract on instantiation */ funds: CoinAmino[]; /** Source is the URL where the code is hosted */ - source: string; + source?: string; /** * Builder is the docker image used to build the code deterministically, used * for smart contract verification */ - builder: string; + builder?: string; /** * CodeHash is the SHA256 sum of the code outputted by builder, used for smart * contract verification */ - code_hash: Uint8Array; + code_hash?: string; } export interface StoreAndInstantiateContractProposalAminoMsg { type: "wasm/StoreAndInstantiateContractProposal"; value: StoreAndInstantiateContractProposalAmino; } /** - * StoreAndInstantiateContractProposal gov proposal content type to store - * and instantiate the contract. + * Deprecated: Do not use. Since wasmd v0.40, there is no longer a need for + * an explicit StoreAndInstantiateContractProposal. To store and instantiate + * the contract, a simple MsgStoreAndInstantiateContract can be invoked from + * the x/gov module via a v1 governance proposal. */ +/** @deprecated */ export interface StoreAndInstantiateContractProposalSDKType { - $typeUrl?: string; + $typeUrl?: "/cosmwasm.wasm.v1.StoreAndInstantiateContractProposal"; title: string; description: string; run_as: string; wasm_byte_code: Uint8Array; - instantiate_permission: AccessConfigSDKType; + instantiate_permission?: AccessConfigSDKType; unpin_code: boolean; admin: string; label: string; @@ -736,7 +882,7 @@ function createBaseStoreCodeProposal(): StoreCodeProposal { description: "", runAs: "", wasmByteCode: new Uint8Array(), - instantiatePermission: AccessConfig.fromPartial({}), + instantiatePermission: undefined, unpinCode: false, source: "", builder: "", @@ -745,6 +891,16 @@ function createBaseStoreCodeProposal(): StoreCodeProposal { } export const StoreCodeProposal = { typeUrl: "/cosmwasm.wasm.v1.StoreCodeProposal", + aminoType: "wasm/StoreCodeProposal", + is(o: any): o is StoreCodeProposal { + return o && (o.$typeUrl === StoreCodeProposal.typeUrl || typeof o.title === "string" && typeof o.description === "string" && typeof o.runAs === "string" && (o.wasmByteCode instanceof Uint8Array || typeof o.wasmByteCode === "string") && typeof o.unpinCode === "boolean" && typeof o.source === "string" && typeof o.builder === "string" && (o.codeHash instanceof Uint8Array || typeof o.codeHash === "string")); + }, + isSDK(o: any): o is StoreCodeProposalSDKType { + return o && (o.$typeUrl === StoreCodeProposal.typeUrl || typeof o.title === "string" && typeof o.description === "string" && typeof o.run_as === "string" && (o.wasm_byte_code instanceof Uint8Array || typeof o.wasm_byte_code === "string") && typeof o.unpin_code === "boolean" && typeof o.source === "string" && typeof o.builder === "string" && (o.code_hash instanceof Uint8Array || typeof o.code_hash === "string")); + }, + isAmino(o: any): o is StoreCodeProposalAmino { + return o && (o.$typeUrl === StoreCodeProposal.typeUrl || typeof o.title === "string" && typeof o.description === "string" && typeof o.run_as === "string" && (o.wasm_byte_code instanceof Uint8Array || typeof o.wasm_byte_code === "string") && typeof o.unpin_code === "boolean" && typeof o.source === "string" && typeof o.builder === "string" && (o.code_hash instanceof Uint8Array || typeof o.code_hash === "string")); + }, encode(message: StoreCodeProposal, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.title !== "") { writer.uint32(10).string(message.title); @@ -816,6 +972,32 @@ export const StoreCodeProposal = { } return message; }, + fromJSON(object: any): StoreCodeProposal { + return { + title: isSet(object.title) ? String(object.title) : "", + description: isSet(object.description) ? String(object.description) : "", + runAs: isSet(object.runAs) ? String(object.runAs) : "", + wasmByteCode: isSet(object.wasmByteCode) ? bytesFromBase64(object.wasmByteCode) : new Uint8Array(), + instantiatePermission: isSet(object.instantiatePermission) ? AccessConfig.fromJSON(object.instantiatePermission) : undefined, + unpinCode: isSet(object.unpinCode) ? Boolean(object.unpinCode) : false, + source: isSet(object.source) ? String(object.source) : "", + builder: isSet(object.builder) ? String(object.builder) : "", + codeHash: isSet(object.codeHash) ? bytesFromBase64(object.codeHash) : new Uint8Array() + }; + }, + toJSON(message: StoreCodeProposal): unknown { + const obj: any = {}; + message.title !== undefined && (obj.title = message.title); + message.description !== undefined && (obj.description = message.description); + message.runAs !== undefined && (obj.runAs = message.runAs); + message.wasmByteCode !== undefined && (obj.wasmByteCode = base64FromBytes(message.wasmByteCode !== undefined ? message.wasmByteCode : new Uint8Array())); + message.instantiatePermission !== undefined && (obj.instantiatePermission = message.instantiatePermission ? AccessConfig.toJSON(message.instantiatePermission) : undefined); + message.unpinCode !== undefined && (obj.unpinCode = message.unpinCode); + message.source !== undefined && (obj.source = message.source); + message.builder !== undefined && (obj.builder = message.builder); + message.codeHash !== undefined && (obj.codeHash = base64FromBytes(message.codeHash !== undefined ? message.codeHash : new Uint8Array())); + return obj; + }, fromPartial(object: Partial): StoreCodeProposal { const message = createBaseStoreCodeProposal(); message.title = object.title ?? ""; @@ -830,17 +1012,35 @@ export const StoreCodeProposal = { return message; }, fromAmino(object: StoreCodeProposalAmino): StoreCodeProposal { - return { - title: object.title, - description: object.description, - runAs: object.run_as, - wasmByteCode: fromBase64(object.wasm_byte_code), - instantiatePermission: object?.instantiate_permission ? AccessConfig.fromAmino(object.instantiate_permission) : undefined, - unpinCode: object.unpin_code, - source: object.source, - builder: object.builder, - codeHash: object.code_hash - }; + const message = createBaseStoreCodeProposal(); + if (object.title !== undefined && object.title !== null) { + message.title = object.title; + } + if (object.description !== undefined && object.description !== null) { + message.description = object.description; + } + if (object.run_as !== undefined && object.run_as !== null) { + message.runAs = object.run_as; + } + if (object.wasm_byte_code !== undefined && object.wasm_byte_code !== null) { + message.wasmByteCode = fromBase64(object.wasm_byte_code); + } + if (object.instantiate_permission !== undefined && object.instantiate_permission !== null) { + message.instantiatePermission = AccessConfig.fromAmino(object.instantiate_permission); + } + if (object.unpin_code !== undefined && object.unpin_code !== null) { + message.unpinCode = object.unpin_code; + } + if (object.source !== undefined && object.source !== null) { + message.source = object.source; + } + if (object.builder !== undefined && object.builder !== null) { + message.builder = object.builder; + } + if (object.code_hash !== undefined && object.code_hash !== null) { + message.codeHash = bytesFromBase64(object.code_hash); + } + return message; }, toAmino(message: StoreCodeProposal): StoreCodeProposalAmino { const obj: any = {}; @@ -852,7 +1052,7 @@ export const StoreCodeProposal = { obj.unpin_code = message.unpinCode; obj.source = message.source; obj.builder = message.builder; - obj.code_hash = message.codeHash; + obj.code_hash = message.codeHash ? base64FromBytes(message.codeHash) : undefined; return obj; }, fromAminoMsg(object: StoreCodeProposalAminoMsg): StoreCodeProposal { @@ -877,6 +1077,8 @@ export const StoreCodeProposal = { }; } }; +GlobalDecoderRegistry.register(StoreCodeProposal.typeUrl, StoreCodeProposal); +GlobalDecoderRegistry.registerAminoProtoMapping(StoreCodeProposal.aminoType, StoreCodeProposal.typeUrl); function createBaseInstantiateContractProposal(): InstantiateContractProposal { return { $typeUrl: "/cosmwasm.wasm.v1.InstantiateContractProposal", @@ -892,6 +1094,16 @@ function createBaseInstantiateContractProposal(): InstantiateContractProposal { } export const InstantiateContractProposal = { typeUrl: "/cosmwasm.wasm.v1.InstantiateContractProposal", + aminoType: "wasm/InstantiateContractProposal", + is(o: any): o is InstantiateContractProposal { + return o && (o.$typeUrl === InstantiateContractProposal.typeUrl || typeof o.title === "string" && typeof o.description === "string" && typeof o.runAs === "string" && typeof o.admin === "string" && typeof o.codeId === "bigint" && typeof o.label === "string" && (o.msg instanceof Uint8Array || typeof o.msg === "string") && Array.isArray(o.funds) && (!o.funds.length || Coin.is(o.funds[0]))); + }, + isSDK(o: any): o is InstantiateContractProposalSDKType { + return o && (o.$typeUrl === InstantiateContractProposal.typeUrl || typeof o.title === "string" && typeof o.description === "string" && typeof o.run_as === "string" && typeof o.admin === "string" && typeof o.code_id === "bigint" && typeof o.label === "string" && (o.msg instanceof Uint8Array || typeof o.msg === "string") && Array.isArray(o.funds) && (!o.funds.length || Coin.isSDK(o.funds[0]))); + }, + isAmino(o: any): o is InstantiateContractProposalAmino { + return o && (o.$typeUrl === InstantiateContractProposal.typeUrl || typeof o.title === "string" && typeof o.description === "string" && typeof o.run_as === "string" && typeof o.admin === "string" && typeof o.code_id === "bigint" && typeof o.label === "string" && (o.msg instanceof Uint8Array || typeof o.msg === "string") && Array.isArray(o.funds) && (!o.funds.length || Coin.isAmino(o.funds[0]))); + }, encode(message: InstantiateContractProposal, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.title !== "") { writer.uint32(10).string(message.title); @@ -957,6 +1169,34 @@ export const InstantiateContractProposal = { } return message; }, + fromJSON(object: any): InstantiateContractProposal { + return { + title: isSet(object.title) ? String(object.title) : "", + description: isSet(object.description) ? String(object.description) : "", + runAs: isSet(object.runAs) ? String(object.runAs) : "", + admin: isSet(object.admin) ? String(object.admin) : "", + codeId: isSet(object.codeId) ? BigInt(object.codeId.toString()) : BigInt(0), + label: isSet(object.label) ? String(object.label) : "", + msg: isSet(object.msg) ? bytesFromBase64(object.msg) : new Uint8Array(), + funds: Array.isArray(object?.funds) ? object.funds.map((e: any) => Coin.fromJSON(e)) : [] + }; + }, + toJSON(message: InstantiateContractProposal): unknown { + const obj: any = {}; + message.title !== undefined && (obj.title = message.title); + message.description !== undefined && (obj.description = message.description); + message.runAs !== undefined && (obj.runAs = message.runAs); + message.admin !== undefined && (obj.admin = message.admin); + message.codeId !== undefined && (obj.codeId = (message.codeId || BigInt(0)).toString()); + message.label !== undefined && (obj.label = message.label); + message.msg !== undefined && (obj.msg = base64FromBytes(message.msg !== undefined ? message.msg : new Uint8Array())); + if (message.funds) { + obj.funds = message.funds.map(e => e ? Coin.toJSON(e) : undefined); + } else { + obj.funds = []; + } + return obj; + }, fromPartial(object: Partial): InstantiateContractProposal { const message = createBaseInstantiateContractProposal(); message.title = object.title ?? ""; @@ -970,16 +1210,30 @@ export const InstantiateContractProposal = { return message; }, fromAmino(object: InstantiateContractProposalAmino): InstantiateContractProposal { - return { - title: object.title, - description: object.description, - runAs: object.run_as, - admin: object.admin, - codeId: BigInt(object.code_id), - label: object.label, - msg: toUtf8(JSON.stringify(object.msg)), - funds: Array.isArray(object?.funds) ? object.funds.map((e: any) => Coin.fromAmino(e)) : [] - }; + const message = createBaseInstantiateContractProposal(); + if (object.title !== undefined && object.title !== null) { + message.title = object.title; + } + if (object.description !== undefined && object.description !== null) { + message.description = object.description; + } + if (object.run_as !== undefined && object.run_as !== null) { + message.runAs = object.run_as; + } + if (object.admin !== undefined && object.admin !== null) { + message.admin = object.admin; + } + if (object.code_id !== undefined && object.code_id !== null) { + message.codeId = BigInt(object.code_id); + } + if (object.label !== undefined && object.label !== null) { + message.label = object.label; + } + if (object.msg !== undefined && object.msg !== null) { + message.msg = toUtf8(JSON.stringify(object.msg)); + } + message.funds = object.funds?.map(e => Coin.fromAmino(e)) || []; + return message; }, toAmino(message: InstantiateContractProposal): InstantiateContractProposalAmino { const obj: any = {}; @@ -1019,6 +1273,8 @@ export const InstantiateContractProposal = { }; } }; +GlobalDecoderRegistry.register(InstantiateContractProposal.typeUrl, InstantiateContractProposal); +GlobalDecoderRegistry.registerAminoProtoMapping(InstantiateContractProposal.aminoType, InstantiateContractProposal.typeUrl); function createBaseInstantiateContract2Proposal(): InstantiateContract2Proposal { return { $typeUrl: "/cosmwasm.wasm.v1.InstantiateContract2Proposal", @@ -1036,6 +1292,16 @@ function createBaseInstantiateContract2Proposal(): InstantiateContract2Proposal } export const InstantiateContract2Proposal = { typeUrl: "/cosmwasm.wasm.v1.InstantiateContract2Proposal", + aminoType: "wasm/InstantiateContract2Proposal", + is(o: any): o is InstantiateContract2Proposal { + return o && (o.$typeUrl === InstantiateContract2Proposal.typeUrl || typeof o.title === "string" && typeof o.description === "string" && typeof o.runAs === "string" && typeof o.admin === "string" && typeof o.codeId === "bigint" && typeof o.label === "string" && (o.msg instanceof Uint8Array || typeof o.msg === "string") && Array.isArray(o.funds) && (!o.funds.length || Coin.is(o.funds[0])) && (o.salt instanceof Uint8Array || typeof o.salt === "string") && typeof o.fixMsg === "boolean"); + }, + isSDK(o: any): o is InstantiateContract2ProposalSDKType { + return o && (o.$typeUrl === InstantiateContract2Proposal.typeUrl || typeof o.title === "string" && typeof o.description === "string" && typeof o.run_as === "string" && typeof o.admin === "string" && typeof o.code_id === "bigint" && typeof o.label === "string" && (o.msg instanceof Uint8Array || typeof o.msg === "string") && Array.isArray(o.funds) && (!o.funds.length || Coin.isSDK(o.funds[0])) && (o.salt instanceof Uint8Array || typeof o.salt === "string") && typeof o.fix_msg === "boolean"); + }, + isAmino(o: any): o is InstantiateContract2ProposalAmino { + return o && (o.$typeUrl === InstantiateContract2Proposal.typeUrl || typeof o.title === "string" && typeof o.description === "string" && typeof o.run_as === "string" && typeof o.admin === "string" && typeof o.code_id === "bigint" && typeof o.label === "string" && (o.msg instanceof Uint8Array || typeof o.msg === "string") && Array.isArray(o.funds) && (!o.funds.length || Coin.isAmino(o.funds[0])) && (o.salt instanceof Uint8Array || typeof o.salt === "string") && typeof o.fix_msg === "boolean"); + }, encode(message: InstantiateContract2Proposal, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.title !== "") { writer.uint32(10).string(message.title); @@ -1113,6 +1379,38 @@ export const InstantiateContract2Proposal = { } return message; }, + fromJSON(object: any): InstantiateContract2Proposal { + return { + title: isSet(object.title) ? String(object.title) : "", + description: isSet(object.description) ? String(object.description) : "", + runAs: isSet(object.runAs) ? String(object.runAs) : "", + admin: isSet(object.admin) ? String(object.admin) : "", + codeId: isSet(object.codeId) ? BigInt(object.codeId.toString()) : BigInt(0), + label: isSet(object.label) ? String(object.label) : "", + msg: isSet(object.msg) ? bytesFromBase64(object.msg) : new Uint8Array(), + funds: Array.isArray(object?.funds) ? object.funds.map((e: any) => Coin.fromJSON(e)) : [], + salt: isSet(object.salt) ? bytesFromBase64(object.salt) : new Uint8Array(), + fixMsg: isSet(object.fixMsg) ? Boolean(object.fixMsg) : false + }; + }, + toJSON(message: InstantiateContract2Proposal): unknown { + const obj: any = {}; + message.title !== undefined && (obj.title = message.title); + message.description !== undefined && (obj.description = message.description); + message.runAs !== undefined && (obj.runAs = message.runAs); + message.admin !== undefined && (obj.admin = message.admin); + message.codeId !== undefined && (obj.codeId = (message.codeId || BigInt(0)).toString()); + message.label !== undefined && (obj.label = message.label); + message.msg !== undefined && (obj.msg = base64FromBytes(message.msg !== undefined ? message.msg : new Uint8Array())); + if (message.funds) { + obj.funds = message.funds.map(e => e ? Coin.toJSON(e) : undefined); + } else { + obj.funds = []; + } + message.salt !== undefined && (obj.salt = base64FromBytes(message.salt !== undefined ? message.salt : new Uint8Array())); + message.fixMsg !== undefined && (obj.fixMsg = message.fixMsg); + return obj; + }, fromPartial(object: Partial): InstantiateContract2Proposal { const message = createBaseInstantiateContract2Proposal(); message.title = object.title ?? ""; @@ -1128,18 +1426,36 @@ export const InstantiateContract2Proposal = { return message; }, fromAmino(object: InstantiateContract2ProposalAmino): InstantiateContract2Proposal { - return { - title: object.title, - description: object.description, - runAs: object.run_as, - admin: object.admin, - codeId: BigInt(object.code_id), - label: object.label, - msg: toUtf8(JSON.stringify(object.msg)), - funds: Array.isArray(object?.funds) ? object.funds.map((e: any) => Coin.fromAmino(e)) : [], - salt: object.salt, - fixMsg: object.fix_msg - }; + const message = createBaseInstantiateContract2Proposal(); + if (object.title !== undefined && object.title !== null) { + message.title = object.title; + } + if (object.description !== undefined && object.description !== null) { + message.description = object.description; + } + if (object.run_as !== undefined && object.run_as !== null) { + message.runAs = object.run_as; + } + if (object.admin !== undefined && object.admin !== null) { + message.admin = object.admin; + } + if (object.code_id !== undefined && object.code_id !== null) { + message.codeId = BigInt(object.code_id); + } + if (object.label !== undefined && object.label !== null) { + message.label = object.label; + } + if (object.msg !== undefined && object.msg !== null) { + message.msg = toUtf8(JSON.stringify(object.msg)); + } + message.funds = object.funds?.map(e => Coin.fromAmino(e)) || []; + if (object.salt !== undefined && object.salt !== null) { + message.salt = bytesFromBase64(object.salt); + } + if (object.fix_msg !== undefined && object.fix_msg !== null) { + message.fixMsg = object.fix_msg; + } + return message; }, toAmino(message: InstantiateContract2Proposal): InstantiateContract2ProposalAmino { const obj: any = {}; @@ -1155,7 +1471,7 @@ export const InstantiateContract2Proposal = { } else { obj.funds = []; } - obj.salt = message.salt; + obj.salt = message.salt ? base64FromBytes(message.salt) : undefined; obj.fix_msg = message.fixMsg; return obj; }, @@ -1181,6 +1497,8 @@ export const InstantiateContract2Proposal = { }; } }; +GlobalDecoderRegistry.register(InstantiateContract2Proposal.typeUrl, InstantiateContract2Proposal); +GlobalDecoderRegistry.registerAminoProtoMapping(InstantiateContract2Proposal.aminoType, InstantiateContract2Proposal.typeUrl); function createBaseMigrateContractProposal(): MigrateContractProposal { return { $typeUrl: "/cosmwasm.wasm.v1.MigrateContractProposal", @@ -1193,6 +1511,16 @@ function createBaseMigrateContractProposal(): MigrateContractProposal { } export const MigrateContractProposal = { typeUrl: "/cosmwasm.wasm.v1.MigrateContractProposal", + aminoType: "wasm/MigrateContractProposal", + is(o: any): o is MigrateContractProposal { + return o && (o.$typeUrl === MigrateContractProposal.typeUrl || typeof o.title === "string" && typeof o.description === "string" && typeof o.contract === "string" && typeof o.codeId === "bigint" && (o.msg instanceof Uint8Array || typeof o.msg === "string")); + }, + isSDK(o: any): o is MigrateContractProposalSDKType { + return o && (o.$typeUrl === MigrateContractProposal.typeUrl || typeof o.title === "string" && typeof o.description === "string" && typeof o.contract === "string" && typeof o.code_id === "bigint" && (o.msg instanceof Uint8Array || typeof o.msg === "string")); + }, + isAmino(o: any): o is MigrateContractProposalAmino { + return o && (o.$typeUrl === MigrateContractProposal.typeUrl || typeof o.title === "string" && typeof o.description === "string" && typeof o.contract === "string" && typeof o.code_id === "bigint" && (o.msg instanceof Uint8Array || typeof o.msg === "string")); + }, encode(message: MigrateContractProposal, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.title !== "") { writer.uint32(10).string(message.title); @@ -1240,6 +1568,24 @@ export const MigrateContractProposal = { } return message; }, + fromJSON(object: any): MigrateContractProposal { + return { + title: isSet(object.title) ? String(object.title) : "", + description: isSet(object.description) ? String(object.description) : "", + contract: isSet(object.contract) ? String(object.contract) : "", + codeId: isSet(object.codeId) ? BigInt(object.codeId.toString()) : BigInt(0), + msg: isSet(object.msg) ? bytesFromBase64(object.msg) : new Uint8Array() + }; + }, + toJSON(message: MigrateContractProposal): unknown { + const obj: any = {}; + message.title !== undefined && (obj.title = message.title); + message.description !== undefined && (obj.description = message.description); + message.contract !== undefined && (obj.contract = message.contract); + message.codeId !== undefined && (obj.codeId = (message.codeId || BigInt(0)).toString()); + message.msg !== undefined && (obj.msg = base64FromBytes(message.msg !== undefined ? message.msg : new Uint8Array())); + return obj; + }, fromPartial(object: Partial): MigrateContractProposal { const message = createBaseMigrateContractProposal(); message.title = object.title ?? ""; @@ -1250,13 +1596,23 @@ export const MigrateContractProposal = { return message; }, fromAmino(object: MigrateContractProposalAmino): MigrateContractProposal { - return { - title: object.title, - description: object.description, - contract: object.contract, - codeId: BigInt(object.code_id), - msg: toUtf8(JSON.stringify(object.msg)) - }; + const message = createBaseMigrateContractProposal(); + if (object.title !== undefined && object.title !== null) { + message.title = object.title; + } + if (object.description !== undefined && object.description !== null) { + message.description = object.description; + } + if (object.contract !== undefined && object.contract !== null) { + message.contract = object.contract; + } + if (object.code_id !== undefined && object.code_id !== null) { + message.codeId = BigInt(object.code_id); + } + if (object.msg !== undefined && object.msg !== null) { + message.msg = toUtf8(JSON.stringify(object.msg)); + } + return message; }, toAmino(message: MigrateContractProposal): MigrateContractProposalAmino { const obj: any = {}; @@ -1289,6 +1645,8 @@ export const MigrateContractProposal = { }; } }; +GlobalDecoderRegistry.register(MigrateContractProposal.typeUrl, MigrateContractProposal); +GlobalDecoderRegistry.registerAminoProtoMapping(MigrateContractProposal.aminoType, MigrateContractProposal.typeUrl); function createBaseSudoContractProposal(): SudoContractProposal { return { $typeUrl: "/cosmwasm.wasm.v1.SudoContractProposal", @@ -1300,6 +1658,16 @@ function createBaseSudoContractProposal(): SudoContractProposal { } export const SudoContractProposal = { typeUrl: "/cosmwasm.wasm.v1.SudoContractProposal", + aminoType: "wasm/SudoContractProposal", + is(o: any): o is SudoContractProposal { + return o && (o.$typeUrl === SudoContractProposal.typeUrl || typeof o.title === "string" && typeof o.description === "string" && typeof o.contract === "string" && (o.msg instanceof Uint8Array || typeof o.msg === "string")); + }, + isSDK(o: any): o is SudoContractProposalSDKType { + return o && (o.$typeUrl === SudoContractProposal.typeUrl || typeof o.title === "string" && typeof o.description === "string" && typeof o.contract === "string" && (o.msg instanceof Uint8Array || typeof o.msg === "string")); + }, + isAmino(o: any): o is SudoContractProposalAmino { + return o && (o.$typeUrl === SudoContractProposal.typeUrl || typeof o.title === "string" && typeof o.description === "string" && typeof o.contract === "string" && (o.msg instanceof Uint8Array || typeof o.msg === "string")); + }, encode(message: SudoContractProposal, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.title !== "") { writer.uint32(10).string(message.title); @@ -1341,6 +1709,22 @@ export const SudoContractProposal = { } return message; }, + fromJSON(object: any): SudoContractProposal { + return { + title: isSet(object.title) ? String(object.title) : "", + description: isSet(object.description) ? String(object.description) : "", + contract: isSet(object.contract) ? String(object.contract) : "", + msg: isSet(object.msg) ? bytesFromBase64(object.msg) : new Uint8Array() + }; + }, + toJSON(message: SudoContractProposal): unknown { + const obj: any = {}; + message.title !== undefined && (obj.title = message.title); + message.description !== undefined && (obj.description = message.description); + message.contract !== undefined && (obj.contract = message.contract); + message.msg !== undefined && (obj.msg = base64FromBytes(message.msg !== undefined ? message.msg : new Uint8Array())); + return obj; + }, fromPartial(object: Partial): SudoContractProposal { const message = createBaseSudoContractProposal(); message.title = object.title ?? ""; @@ -1350,12 +1734,20 @@ export const SudoContractProposal = { return message; }, fromAmino(object: SudoContractProposalAmino): SudoContractProposal { - return { - title: object.title, - description: object.description, - contract: object.contract, - msg: toUtf8(JSON.stringify(object.msg)) - }; + const message = createBaseSudoContractProposal(); + if (object.title !== undefined && object.title !== null) { + message.title = object.title; + } + if (object.description !== undefined && object.description !== null) { + message.description = object.description; + } + if (object.contract !== undefined && object.contract !== null) { + message.contract = object.contract; + } + if (object.msg !== undefined && object.msg !== null) { + message.msg = toUtf8(JSON.stringify(object.msg)); + } + return message; }, toAmino(message: SudoContractProposal): SudoContractProposalAmino { const obj: any = {}; @@ -1387,6 +1779,8 @@ export const SudoContractProposal = { }; } }; +GlobalDecoderRegistry.register(SudoContractProposal.typeUrl, SudoContractProposal); +GlobalDecoderRegistry.registerAminoProtoMapping(SudoContractProposal.aminoType, SudoContractProposal.typeUrl); function createBaseExecuteContractProposal(): ExecuteContractProposal { return { $typeUrl: "/cosmwasm.wasm.v1.ExecuteContractProposal", @@ -1400,6 +1794,16 @@ function createBaseExecuteContractProposal(): ExecuteContractProposal { } export const ExecuteContractProposal = { typeUrl: "/cosmwasm.wasm.v1.ExecuteContractProposal", + aminoType: "wasm/ExecuteContractProposal", + is(o: any): o is ExecuteContractProposal { + return o && (o.$typeUrl === ExecuteContractProposal.typeUrl || typeof o.title === "string" && typeof o.description === "string" && typeof o.runAs === "string" && typeof o.contract === "string" && (o.msg instanceof Uint8Array || typeof o.msg === "string") && Array.isArray(o.funds) && (!o.funds.length || Coin.is(o.funds[0]))); + }, + isSDK(o: any): o is ExecuteContractProposalSDKType { + return o && (o.$typeUrl === ExecuteContractProposal.typeUrl || typeof o.title === "string" && typeof o.description === "string" && typeof o.run_as === "string" && typeof o.contract === "string" && (o.msg instanceof Uint8Array || typeof o.msg === "string") && Array.isArray(o.funds) && (!o.funds.length || Coin.isSDK(o.funds[0]))); + }, + isAmino(o: any): o is ExecuteContractProposalAmino { + return o && (o.$typeUrl === ExecuteContractProposal.typeUrl || typeof o.title === "string" && typeof o.description === "string" && typeof o.run_as === "string" && typeof o.contract === "string" && (o.msg instanceof Uint8Array || typeof o.msg === "string") && Array.isArray(o.funds) && (!o.funds.length || Coin.isAmino(o.funds[0]))); + }, encode(message: ExecuteContractProposal, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.title !== "") { writer.uint32(10).string(message.title); @@ -1453,6 +1857,30 @@ export const ExecuteContractProposal = { } return message; }, + fromJSON(object: any): ExecuteContractProposal { + return { + title: isSet(object.title) ? String(object.title) : "", + description: isSet(object.description) ? String(object.description) : "", + runAs: isSet(object.runAs) ? String(object.runAs) : "", + contract: isSet(object.contract) ? String(object.contract) : "", + msg: isSet(object.msg) ? bytesFromBase64(object.msg) : new Uint8Array(), + funds: Array.isArray(object?.funds) ? object.funds.map((e: any) => Coin.fromJSON(e)) : [] + }; + }, + toJSON(message: ExecuteContractProposal): unknown { + const obj: any = {}; + message.title !== undefined && (obj.title = message.title); + message.description !== undefined && (obj.description = message.description); + message.runAs !== undefined && (obj.runAs = message.runAs); + message.contract !== undefined && (obj.contract = message.contract); + message.msg !== undefined && (obj.msg = base64FromBytes(message.msg !== undefined ? message.msg : new Uint8Array())); + if (message.funds) { + obj.funds = message.funds.map(e => e ? Coin.toJSON(e) : undefined); + } else { + obj.funds = []; + } + return obj; + }, fromPartial(object: Partial): ExecuteContractProposal { const message = createBaseExecuteContractProposal(); message.title = object.title ?? ""; @@ -1464,14 +1892,24 @@ export const ExecuteContractProposal = { return message; }, fromAmino(object: ExecuteContractProposalAmino): ExecuteContractProposal { - return { - title: object.title, - description: object.description, - runAs: object.run_as, - contract: object.contract, - msg: toUtf8(JSON.stringify(object.msg)), - funds: Array.isArray(object?.funds) ? object.funds.map((e: any) => Coin.fromAmino(e)) : [] - }; + const message = createBaseExecuteContractProposal(); + if (object.title !== undefined && object.title !== null) { + message.title = object.title; + } + if (object.description !== undefined && object.description !== null) { + message.description = object.description; + } + if (object.run_as !== undefined && object.run_as !== null) { + message.runAs = object.run_as; + } + if (object.contract !== undefined && object.contract !== null) { + message.contract = object.contract; + } + if (object.msg !== undefined && object.msg !== null) { + message.msg = toUtf8(JSON.stringify(object.msg)); + } + message.funds = object.funds?.map(e => Coin.fromAmino(e)) || []; + return message; }, toAmino(message: ExecuteContractProposal): ExecuteContractProposalAmino { const obj: any = {}; @@ -1509,6 +1947,8 @@ export const ExecuteContractProposal = { }; } }; +GlobalDecoderRegistry.register(ExecuteContractProposal.typeUrl, ExecuteContractProposal); +GlobalDecoderRegistry.registerAminoProtoMapping(ExecuteContractProposal.aminoType, ExecuteContractProposal.typeUrl); function createBaseUpdateAdminProposal(): UpdateAdminProposal { return { $typeUrl: "/cosmwasm.wasm.v1.UpdateAdminProposal", @@ -1520,6 +1960,16 @@ function createBaseUpdateAdminProposal(): UpdateAdminProposal { } export const UpdateAdminProposal = { typeUrl: "/cosmwasm.wasm.v1.UpdateAdminProposal", + aminoType: "wasm/UpdateAdminProposal", + is(o: any): o is UpdateAdminProposal { + return o && (o.$typeUrl === UpdateAdminProposal.typeUrl || typeof o.title === "string" && typeof o.description === "string" && typeof o.newAdmin === "string" && typeof o.contract === "string"); + }, + isSDK(o: any): o is UpdateAdminProposalSDKType { + return o && (o.$typeUrl === UpdateAdminProposal.typeUrl || typeof o.title === "string" && typeof o.description === "string" && typeof o.new_admin === "string" && typeof o.contract === "string"); + }, + isAmino(o: any): o is UpdateAdminProposalAmino { + return o && (o.$typeUrl === UpdateAdminProposal.typeUrl || typeof o.title === "string" && typeof o.description === "string" && typeof o.new_admin === "string" && typeof o.contract === "string"); + }, encode(message: UpdateAdminProposal, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.title !== "") { writer.uint32(10).string(message.title); @@ -1561,6 +2011,22 @@ export const UpdateAdminProposal = { } return message; }, + fromJSON(object: any): UpdateAdminProposal { + return { + title: isSet(object.title) ? String(object.title) : "", + description: isSet(object.description) ? String(object.description) : "", + newAdmin: isSet(object.newAdmin) ? String(object.newAdmin) : "", + contract: isSet(object.contract) ? String(object.contract) : "" + }; + }, + toJSON(message: UpdateAdminProposal): unknown { + const obj: any = {}; + message.title !== undefined && (obj.title = message.title); + message.description !== undefined && (obj.description = message.description); + message.newAdmin !== undefined && (obj.newAdmin = message.newAdmin); + message.contract !== undefined && (obj.contract = message.contract); + return obj; + }, fromPartial(object: Partial): UpdateAdminProposal { const message = createBaseUpdateAdminProposal(); message.title = object.title ?? ""; @@ -1570,12 +2036,20 @@ export const UpdateAdminProposal = { return message; }, fromAmino(object: UpdateAdminProposalAmino): UpdateAdminProposal { - return { - title: object.title, - description: object.description, - newAdmin: object.new_admin, - contract: object.contract - }; + const message = createBaseUpdateAdminProposal(); + if (object.title !== undefined && object.title !== null) { + message.title = object.title; + } + if (object.description !== undefined && object.description !== null) { + message.description = object.description; + } + if (object.new_admin !== undefined && object.new_admin !== null) { + message.newAdmin = object.new_admin; + } + if (object.contract !== undefined && object.contract !== null) { + message.contract = object.contract; + } + return message; }, toAmino(message: UpdateAdminProposal): UpdateAdminProposalAmino { const obj: any = {}; @@ -1607,6 +2081,8 @@ export const UpdateAdminProposal = { }; } }; +GlobalDecoderRegistry.register(UpdateAdminProposal.typeUrl, UpdateAdminProposal); +GlobalDecoderRegistry.registerAminoProtoMapping(UpdateAdminProposal.aminoType, UpdateAdminProposal.typeUrl); function createBaseClearAdminProposal(): ClearAdminProposal { return { $typeUrl: "/cosmwasm.wasm.v1.ClearAdminProposal", @@ -1617,6 +2093,16 @@ function createBaseClearAdminProposal(): ClearAdminProposal { } export const ClearAdminProposal = { typeUrl: "/cosmwasm.wasm.v1.ClearAdminProposal", + aminoType: "wasm/ClearAdminProposal", + is(o: any): o is ClearAdminProposal { + return o && (o.$typeUrl === ClearAdminProposal.typeUrl || typeof o.title === "string" && typeof o.description === "string" && typeof o.contract === "string"); + }, + isSDK(o: any): o is ClearAdminProposalSDKType { + return o && (o.$typeUrl === ClearAdminProposal.typeUrl || typeof o.title === "string" && typeof o.description === "string" && typeof o.contract === "string"); + }, + isAmino(o: any): o is ClearAdminProposalAmino { + return o && (o.$typeUrl === ClearAdminProposal.typeUrl || typeof o.title === "string" && typeof o.description === "string" && typeof o.contract === "string"); + }, encode(message: ClearAdminProposal, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.title !== "") { writer.uint32(10).string(message.title); @@ -1652,6 +2138,20 @@ export const ClearAdminProposal = { } return message; }, + fromJSON(object: any): ClearAdminProposal { + return { + title: isSet(object.title) ? String(object.title) : "", + description: isSet(object.description) ? String(object.description) : "", + contract: isSet(object.contract) ? String(object.contract) : "" + }; + }, + toJSON(message: ClearAdminProposal): unknown { + const obj: any = {}; + message.title !== undefined && (obj.title = message.title); + message.description !== undefined && (obj.description = message.description); + message.contract !== undefined && (obj.contract = message.contract); + return obj; + }, fromPartial(object: Partial): ClearAdminProposal { const message = createBaseClearAdminProposal(); message.title = object.title ?? ""; @@ -1660,11 +2160,17 @@ export const ClearAdminProposal = { return message; }, fromAmino(object: ClearAdminProposalAmino): ClearAdminProposal { - return { - title: object.title, - description: object.description, - contract: object.contract - }; + const message = createBaseClearAdminProposal(); + if (object.title !== undefined && object.title !== null) { + message.title = object.title; + } + if (object.description !== undefined && object.description !== null) { + message.description = object.description; + } + if (object.contract !== undefined && object.contract !== null) { + message.contract = object.contract; + } + return message; }, toAmino(message: ClearAdminProposal): ClearAdminProposalAmino { const obj: any = {}; @@ -1695,6 +2201,8 @@ export const ClearAdminProposal = { }; } }; +GlobalDecoderRegistry.register(ClearAdminProposal.typeUrl, ClearAdminProposal); +GlobalDecoderRegistry.registerAminoProtoMapping(ClearAdminProposal.aminoType, ClearAdminProposal.typeUrl); function createBasePinCodesProposal(): PinCodesProposal { return { $typeUrl: "/cosmwasm.wasm.v1.PinCodesProposal", @@ -1705,6 +2213,16 @@ function createBasePinCodesProposal(): PinCodesProposal { } export const PinCodesProposal = { typeUrl: "/cosmwasm.wasm.v1.PinCodesProposal", + aminoType: "wasm/PinCodesProposal", + is(o: any): o is PinCodesProposal { + return o && (o.$typeUrl === PinCodesProposal.typeUrl || typeof o.title === "string" && typeof o.description === "string" && Array.isArray(o.codeIds) && (!o.codeIds.length || typeof o.codeIds[0] === "bigint")); + }, + isSDK(o: any): o is PinCodesProposalSDKType { + return o && (o.$typeUrl === PinCodesProposal.typeUrl || typeof o.title === "string" && typeof o.description === "string" && Array.isArray(o.code_ids) && (!o.code_ids.length || typeof o.code_ids[0] === "bigint")); + }, + isAmino(o: any): o is PinCodesProposalAmino { + return o && (o.$typeUrl === PinCodesProposal.typeUrl || typeof o.title === "string" && typeof o.description === "string" && Array.isArray(o.code_ids) && (!o.code_ids.length || typeof o.code_ids[0] === "bigint")); + }, encode(message: PinCodesProposal, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.title !== "") { writer.uint32(10).string(message.title); @@ -1749,6 +2267,24 @@ export const PinCodesProposal = { } return message; }, + fromJSON(object: any): PinCodesProposal { + return { + title: isSet(object.title) ? String(object.title) : "", + description: isSet(object.description) ? String(object.description) : "", + codeIds: Array.isArray(object?.codeIds) ? object.codeIds.map((e: any) => BigInt(e.toString())) : [] + }; + }, + toJSON(message: PinCodesProposal): unknown { + const obj: any = {}; + message.title !== undefined && (obj.title = message.title); + message.description !== undefined && (obj.description = message.description); + if (message.codeIds) { + obj.codeIds = message.codeIds.map(e => (e || BigInt(0)).toString()); + } else { + obj.codeIds = []; + } + return obj; + }, fromPartial(object: Partial): PinCodesProposal { const message = createBasePinCodesProposal(); message.title = object.title ?? ""; @@ -1757,11 +2293,15 @@ export const PinCodesProposal = { return message; }, fromAmino(object: PinCodesProposalAmino): PinCodesProposal { - return { - title: object.title, - description: object.description, - codeIds: Array.isArray(object?.code_ids) ? object.code_ids.map((e: any) => BigInt(e)) : [] - }; + const message = createBasePinCodesProposal(); + if (object.title !== undefined && object.title !== null) { + message.title = object.title; + } + if (object.description !== undefined && object.description !== null) { + message.description = object.description; + } + message.codeIds = object.code_ids?.map(e => BigInt(e)) || []; + return message; }, toAmino(message: PinCodesProposal): PinCodesProposalAmino { const obj: any = {}; @@ -1796,6 +2336,8 @@ export const PinCodesProposal = { }; } }; +GlobalDecoderRegistry.register(PinCodesProposal.typeUrl, PinCodesProposal); +GlobalDecoderRegistry.registerAminoProtoMapping(PinCodesProposal.aminoType, PinCodesProposal.typeUrl); function createBaseUnpinCodesProposal(): UnpinCodesProposal { return { $typeUrl: "/cosmwasm.wasm.v1.UnpinCodesProposal", @@ -1806,6 +2348,16 @@ function createBaseUnpinCodesProposal(): UnpinCodesProposal { } export const UnpinCodesProposal = { typeUrl: "/cosmwasm.wasm.v1.UnpinCodesProposal", + aminoType: "wasm/UnpinCodesProposal", + is(o: any): o is UnpinCodesProposal { + return o && (o.$typeUrl === UnpinCodesProposal.typeUrl || typeof o.title === "string" && typeof o.description === "string" && Array.isArray(o.codeIds) && (!o.codeIds.length || typeof o.codeIds[0] === "bigint")); + }, + isSDK(o: any): o is UnpinCodesProposalSDKType { + return o && (o.$typeUrl === UnpinCodesProposal.typeUrl || typeof o.title === "string" && typeof o.description === "string" && Array.isArray(o.code_ids) && (!o.code_ids.length || typeof o.code_ids[0] === "bigint")); + }, + isAmino(o: any): o is UnpinCodesProposalAmino { + return o && (o.$typeUrl === UnpinCodesProposal.typeUrl || typeof o.title === "string" && typeof o.description === "string" && Array.isArray(o.code_ids) && (!o.code_ids.length || typeof o.code_ids[0] === "bigint")); + }, encode(message: UnpinCodesProposal, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.title !== "") { writer.uint32(10).string(message.title); @@ -1850,6 +2402,24 @@ export const UnpinCodesProposal = { } return message; }, + fromJSON(object: any): UnpinCodesProposal { + return { + title: isSet(object.title) ? String(object.title) : "", + description: isSet(object.description) ? String(object.description) : "", + codeIds: Array.isArray(object?.codeIds) ? object.codeIds.map((e: any) => BigInt(e.toString())) : [] + }; + }, + toJSON(message: UnpinCodesProposal): unknown { + const obj: any = {}; + message.title !== undefined && (obj.title = message.title); + message.description !== undefined && (obj.description = message.description); + if (message.codeIds) { + obj.codeIds = message.codeIds.map(e => (e || BigInt(0)).toString()); + } else { + obj.codeIds = []; + } + return obj; + }, fromPartial(object: Partial): UnpinCodesProposal { const message = createBaseUnpinCodesProposal(); message.title = object.title ?? ""; @@ -1858,11 +2428,15 @@ export const UnpinCodesProposal = { return message; }, fromAmino(object: UnpinCodesProposalAmino): UnpinCodesProposal { - return { - title: object.title, - description: object.description, - codeIds: Array.isArray(object?.code_ids) ? object.code_ids.map((e: any) => BigInt(e)) : [] - }; + const message = createBaseUnpinCodesProposal(); + if (object.title !== undefined && object.title !== null) { + message.title = object.title; + } + if (object.description !== undefined && object.description !== null) { + message.description = object.description; + } + message.codeIds = object.code_ids?.map(e => BigInt(e)) || []; + return message; }, toAmino(message: UnpinCodesProposal): UnpinCodesProposalAmino { const obj: any = {}; @@ -1897,6 +2471,8 @@ export const UnpinCodesProposal = { }; } }; +GlobalDecoderRegistry.register(UnpinCodesProposal.typeUrl, UnpinCodesProposal); +GlobalDecoderRegistry.registerAminoProtoMapping(UnpinCodesProposal.aminoType, UnpinCodesProposal.typeUrl); function createBaseAccessConfigUpdate(): AccessConfigUpdate { return { codeId: BigInt(0), @@ -1905,6 +2481,16 @@ function createBaseAccessConfigUpdate(): AccessConfigUpdate { } export const AccessConfigUpdate = { typeUrl: "/cosmwasm.wasm.v1.AccessConfigUpdate", + aminoType: "wasm/AccessConfigUpdate", + is(o: any): o is AccessConfigUpdate { + return o && (o.$typeUrl === AccessConfigUpdate.typeUrl || typeof o.codeId === "bigint" && AccessConfig.is(o.instantiatePermission)); + }, + isSDK(o: any): o is AccessConfigUpdateSDKType { + return o && (o.$typeUrl === AccessConfigUpdate.typeUrl || typeof o.code_id === "bigint" && AccessConfig.isSDK(o.instantiate_permission)); + }, + isAmino(o: any): o is AccessConfigUpdateAmino { + return o && (o.$typeUrl === AccessConfigUpdate.typeUrl || typeof o.code_id === "bigint" && AccessConfig.isAmino(o.instantiate_permission)); + }, encode(message: AccessConfigUpdate, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.codeId !== BigInt(0)) { writer.uint32(8).uint64(message.codeId); @@ -1934,6 +2520,18 @@ export const AccessConfigUpdate = { } return message; }, + fromJSON(object: any): AccessConfigUpdate { + return { + codeId: isSet(object.codeId) ? BigInt(object.codeId.toString()) : BigInt(0), + instantiatePermission: isSet(object.instantiatePermission) ? AccessConfig.fromJSON(object.instantiatePermission) : undefined + }; + }, + toJSON(message: AccessConfigUpdate): unknown { + const obj: any = {}; + message.codeId !== undefined && (obj.codeId = (message.codeId || BigInt(0)).toString()); + message.instantiatePermission !== undefined && (obj.instantiatePermission = message.instantiatePermission ? AccessConfig.toJSON(message.instantiatePermission) : undefined); + return obj; + }, fromPartial(object: Partial): AccessConfigUpdate { const message = createBaseAccessConfigUpdate(); message.codeId = object.codeId !== undefined && object.codeId !== null ? BigInt(object.codeId.toString()) : BigInt(0); @@ -1941,15 +2539,19 @@ export const AccessConfigUpdate = { return message; }, fromAmino(object: AccessConfigUpdateAmino): AccessConfigUpdate { - return { - codeId: BigInt(object.code_id), - instantiatePermission: object?.instantiate_permission ? AccessConfig.fromAmino(object.instantiate_permission) : undefined - }; + const message = createBaseAccessConfigUpdate(); + if (object.code_id !== undefined && object.code_id !== null) { + message.codeId = BigInt(object.code_id); + } + if (object.instantiate_permission !== undefined && object.instantiate_permission !== null) { + message.instantiatePermission = AccessConfig.fromAmino(object.instantiate_permission); + } + return message; }, toAmino(message: AccessConfigUpdate): AccessConfigUpdateAmino { const obj: any = {}; obj.code_id = message.codeId ? message.codeId.toString() : undefined; - obj.instantiate_permission = message.instantiatePermission ? AccessConfig.toAmino(message.instantiatePermission) : undefined; + obj.instantiate_permission = message.instantiatePermission ? AccessConfig.toAmino(message.instantiatePermission) : AccessConfig.fromPartial({}); return obj; }, fromAminoMsg(object: AccessConfigUpdateAminoMsg): AccessConfigUpdate { @@ -1974,6 +2576,8 @@ export const AccessConfigUpdate = { }; } }; +GlobalDecoderRegistry.register(AccessConfigUpdate.typeUrl, AccessConfigUpdate); +GlobalDecoderRegistry.registerAminoProtoMapping(AccessConfigUpdate.aminoType, AccessConfigUpdate.typeUrl); function createBaseUpdateInstantiateConfigProposal(): UpdateInstantiateConfigProposal { return { $typeUrl: "/cosmwasm.wasm.v1.UpdateInstantiateConfigProposal", @@ -1984,6 +2588,16 @@ function createBaseUpdateInstantiateConfigProposal(): UpdateInstantiateConfigPro } export const UpdateInstantiateConfigProposal = { typeUrl: "/cosmwasm.wasm.v1.UpdateInstantiateConfigProposal", + aminoType: "wasm/UpdateInstantiateConfigProposal", + is(o: any): o is UpdateInstantiateConfigProposal { + return o && (o.$typeUrl === UpdateInstantiateConfigProposal.typeUrl || typeof o.title === "string" && typeof o.description === "string" && Array.isArray(o.accessConfigUpdates) && (!o.accessConfigUpdates.length || AccessConfigUpdate.is(o.accessConfigUpdates[0]))); + }, + isSDK(o: any): o is UpdateInstantiateConfigProposalSDKType { + return o && (o.$typeUrl === UpdateInstantiateConfigProposal.typeUrl || typeof o.title === "string" && typeof o.description === "string" && Array.isArray(o.access_config_updates) && (!o.access_config_updates.length || AccessConfigUpdate.isSDK(o.access_config_updates[0]))); + }, + isAmino(o: any): o is UpdateInstantiateConfigProposalAmino { + return o && (o.$typeUrl === UpdateInstantiateConfigProposal.typeUrl || typeof o.title === "string" && typeof o.description === "string" && Array.isArray(o.access_config_updates) && (!o.access_config_updates.length || AccessConfigUpdate.isAmino(o.access_config_updates[0]))); + }, encode(message: UpdateInstantiateConfigProposal, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.title !== "") { writer.uint32(10).string(message.title); @@ -2019,6 +2633,24 @@ export const UpdateInstantiateConfigProposal = { } return message; }, + fromJSON(object: any): UpdateInstantiateConfigProposal { + return { + title: isSet(object.title) ? String(object.title) : "", + description: isSet(object.description) ? String(object.description) : "", + accessConfigUpdates: Array.isArray(object?.accessConfigUpdates) ? object.accessConfigUpdates.map((e: any) => AccessConfigUpdate.fromJSON(e)) : [] + }; + }, + toJSON(message: UpdateInstantiateConfigProposal): unknown { + const obj: any = {}; + message.title !== undefined && (obj.title = message.title); + message.description !== undefined && (obj.description = message.description); + if (message.accessConfigUpdates) { + obj.accessConfigUpdates = message.accessConfigUpdates.map(e => e ? AccessConfigUpdate.toJSON(e) : undefined); + } else { + obj.accessConfigUpdates = []; + } + return obj; + }, fromPartial(object: Partial): UpdateInstantiateConfigProposal { const message = createBaseUpdateInstantiateConfigProposal(); message.title = object.title ?? ""; @@ -2027,11 +2659,15 @@ export const UpdateInstantiateConfigProposal = { return message; }, fromAmino(object: UpdateInstantiateConfigProposalAmino): UpdateInstantiateConfigProposal { - return { - title: object.title, - description: object.description, - accessConfigUpdates: Array.isArray(object?.access_config_updates) ? object.access_config_updates.map((e: any) => AccessConfigUpdate.fromAmino(e)) : [] - }; + const message = createBaseUpdateInstantiateConfigProposal(); + if (object.title !== undefined && object.title !== null) { + message.title = object.title; + } + if (object.description !== undefined && object.description !== null) { + message.description = object.description; + } + message.accessConfigUpdates = object.access_config_updates?.map(e => AccessConfigUpdate.fromAmino(e)) || []; + return message; }, toAmino(message: UpdateInstantiateConfigProposal): UpdateInstantiateConfigProposalAmino { const obj: any = {}; @@ -2066,6 +2702,8 @@ export const UpdateInstantiateConfigProposal = { }; } }; +GlobalDecoderRegistry.register(UpdateInstantiateConfigProposal.typeUrl, UpdateInstantiateConfigProposal); +GlobalDecoderRegistry.registerAminoProtoMapping(UpdateInstantiateConfigProposal.aminoType, UpdateInstantiateConfigProposal.typeUrl); function createBaseStoreAndInstantiateContractProposal(): StoreAndInstantiateContractProposal { return { $typeUrl: "/cosmwasm.wasm.v1.StoreAndInstantiateContractProposal", @@ -2073,7 +2711,7 @@ function createBaseStoreAndInstantiateContractProposal(): StoreAndInstantiateCon description: "", runAs: "", wasmByteCode: new Uint8Array(), - instantiatePermission: AccessConfig.fromPartial({}), + instantiatePermission: undefined, unpinCode: false, admin: "", label: "", @@ -2086,6 +2724,16 @@ function createBaseStoreAndInstantiateContractProposal(): StoreAndInstantiateCon } export const StoreAndInstantiateContractProposal = { typeUrl: "/cosmwasm.wasm.v1.StoreAndInstantiateContractProposal", + aminoType: "wasm/StoreAndInstantiateContractProposal", + is(o: any): o is StoreAndInstantiateContractProposal { + return o && (o.$typeUrl === StoreAndInstantiateContractProposal.typeUrl || typeof o.title === "string" && typeof o.description === "string" && typeof o.runAs === "string" && (o.wasmByteCode instanceof Uint8Array || typeof o.wasmByteCode === "string") && typeof o.unpinCode === "boolean" && typeof o.admin === "string" && typeof o.label === "string" && (o.msg instanceof Uint8Array || typeof o.msg === "string") && Array.isArray(o.funds) && (!o.funds.length || Coin.is(o.funds[0])) && typeof o.source === "string" && typeof o.builder === "string" && (o.codeHash instanceof Uint8Array || typeof o.codeHash === "string")); + }, + isSDK(o: any): o is StoreAndInstantiateContractProposalSDKType { + return o && (o.$typeUrl === StoreAndInstantiateContractProposal.typeUrl || typeof o.title === "string" && typeof o.description === "string" && typeof o.run_as === "string" && (o.wasm_byte_code instanceof Uint8Array || typeof o.wasm_byte_code === "string") && typeof o.unpin_code === "boolean" && typeof o.admin === "string" && typeof o.label === "string" && (o.msg instanceof Uint8Array || typeof o.msg === "string") && Array.isArray(o.funds) && (!o.funds.length || Coin.isSDK(o.funds[0])) && typeof o.source === "string" && typeof o.builder === "string" && (o.code_hash instanceof Uint8Array || typeof o.code_hash === "string")); + }, + isAmino(o: any): o is StoreAndInstantiateContractProposalAmino { + return o && (o.$typeUrl === StoreAndInstantiateContractProposal.typeUrl || typeof o.title === "string" && typeof o.description === "string" && typeof o.run_as === "string" && (o.wasm_byte_code instanceof Uint8Array || typeof o.wasm_byte_code === "string") && typeof o.unpin_code === "boolean" && typeof o.admin === "string" && typeof o.label === "string" && (o.msg instanceof Uint8Array || typeof o.msg === "string") && Array.isArray(o.funds) && (!o.funds.length || Coin.isAmino(o.funds[0])) && typeof o.source === "string" && typeof o.builder === "string" && (o.code_hash instanceof Uint8Array || typeof o.code_hash === "string")); + }, encode(message: StoreAndInstantiateContractProposal, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.title !== "") { writer.uint32(10).string(message.title); @@ -2181,6 +2829,44 @@ export const StoreAndInstantiateContractProposal = { } return message; }, + fromJSON(object: any): StoreAndInstantiateContractProposal { + return { + title: isSet(object.title) ? String(object.title) : "", + description: isSet(object.description) ? String(object.description) : "", + runAs: isSet(object.runAs) ? String(object.runAs) : "", + wasmByteCode: isSet(object.wasmByteCode) ? bytesFromBase64(object.wasmByteCode) : new Uint8Array(), + instantiatePermission: isSet(object.instantiatePermission) ? AccessConfig.fromJSON(object.instantiatePermission) : undefined, + unpinCode: isSet(object.unpinCode) ? Boolean(object.unpinCode) : false, + admin: isSet(object.admin) ? String(object.admin) : "", + label: isSet(object.label) ? String(object.label) : "", + msg: isSet(object.msg) ? bytesFromBase64(object.msg) : new Uint8Array(), + funds: Array.isArray(object?.funds) ? object.funds.map((e: any) => Coin.fromJSON(e)) : [], + source: isSet(object.source) ? String(object.source) : "", + builder: isSet(object.builder) ? String(object.builder) : "", + codeHash: isSet(object.codeHash) ? bytesFromBase64(object.codeHash) : new Uint8Array() + }; + }, + toJSON(message: StoreAndInstantiateContractProposal): unknown { + const obj: any = {}; + message.title !== undefined && (obj.title = message.title); + message.description !== undefined && (obj.description = message.description); + message.runAs !== undefined && (obj.runAs = message.runAs); + message.wasmByteCode !== undefined && (obj.wasmByteCode = base64FromBytes(message.wasmByteCode !== undefined ? message.wasmByteCode : new Uint8Array())); + message.instantiatePermission !== undefined && (obj.instantiatePermission = message.instantiatePermission ? AccessConfig.toJSON(message.instantiatePermission) : undefined); + message.unpinCode !== undefined && (obj.unpinCode = message.unpinCode); + message.admin !== undefined && (obj.admin = message.admin); + message.label !== undefined && (obj.label = message.label); + message.msg !== undefined && (obj.msg = base64FromBytes(message.msg !== undefined ? message.msg : new Uint8Array())); + if (message.funds) { + obj.funds = message.funds.map(e => e ? Coin.toJSON(e) : undefined); + } else { + obj.funds = []; + } + message.source !== undefined && (obj.source = message.source); + message.builder !== undefined && (obj.builder = message.builder); + message.codeHash !== undefined && (obj.codeHash = base64FromBytes(message.codeHash !== undefined ? message.codeHash : new Uint8Array())); + return obj; + }, fromPartial(object: Partial): StoreAndInstantiateContractProposal { const message = createBaseStoreAndInstantiateContractProposal(); message.title = object.title ?? ""; @@ -2199,21 +2885,45 @@ export const StoreAndInstantiateContractProposal = { return message; }, fromAmino(object: StoreAndInstantiateContractProposalAmino): StoreAndInstantiateContractProposal { - return { - title: object.title, - description: object.description, - runAs: object.run_as, - wasmByteCode: fromBase64(object.wasm_byte_code), - instantiatePermission: object?.instantiate_permission ? AccessConfig.fromAmino(object.instantiate_permission) : undefined, - unpinCode: object.unpin_code, - admin: object.admin, - label: object.label, - msg: toUtf8(JSON.stringify(object.msg)), - funds: Array.isArray(object?.funds) ? object.funds.map((e: any) => Coin.fromAmino(e)) : [], - source: object.source, - builder: object.builder, - codeHash: object.code_hash - }; + const message = createBaseStoreAndInstantiateContractProposal(); + if (object.title !== undefined && object.title !== null) { + message.title = object.title; + } + if (object.description !== undefined && object.description !== null) { + message.description = object.description; + } + if (object.run_as !== undefined && object.run_as !== null) { + message.runAs = object.run_as; + } + if (object.wasm_byte_code !== undefined && object.wasm_byte_code !== null) { + message.wasmByteCode = fromBase64(object.wasm_byte_code); + } + if (object.instantiate_permission !== undefined && object.instantiate_permission !== null) { + message.instantiatePermission = AccessConfig.fromAmino(object.instantiate_permission); + } + if (object.unpin_code !== undefined && object.unpin_code !== null) { + message.unpinCode = object.unpin_code; + } + if (object.admin !== undefined && object.admin !== null) { + message.admin = object.admin; + } + if (object.label !== undefined && object.label !== null) { + message.label = object.label; + } + if (object.msg !== undefined && object.msg !== null) { + message.msg = toUtf8(JSON.stringify(object.msg)); + } + message.funds = object.funds?.map(e => Coin.fromAmino(e)) || []; + if (object.source !== undefined && object.source !== null) { + message.source = object.source; + } + if (object.builder !== undefined && object.builder !== null) { + message.builder = object.builder; + } + if (object.code_hash !== undefined && object.code_hash !== null) { + message.codeHash = bytesFromBase64(object.code_hash); + } + return message; }, toAmino(message: StoreAndInstantiateContractProposal): StoreAndInstantiateContractProposalAmino { const obj: any = {}; @@ -2233,7 +2943,7 @@ export const StoreAndInstantiateContractProposal = { } obj.source = message.source; obj.builder = message.builder; - obj.code_hash = message.codeHash; + obj.code_hash = message.codeHash ? base64FromBytes(message.codeHash) : undefined; return obj; }, fromAminoMsg(object: StoreAndInstantiateContractProposalAminoMsg): StoreAndInstantiateContractProposal { @@ -2257,4 +2967,6 @@ export const StoreAndInstantiateContractProposal = { value: StoreAndInstantiateContractProposal.encode(message).finish() }; } -}; \ No newline at end of file +}; +GlobalDecoderRegistry.register(StoreAndInstantiateContractProposal.typeUrl, StoreAndInstantiateContractProposal); +GlobalDecoderRegistry.registerAminoProtoMapping(StoreAndInstantiateContractProposal.aminoType, StoreAndInstantiateContractProposal.typeUrl); \ No newline at end of file diff --git a/packages/osmojs/src/codegen/cosmwasm/wasm/v1/query.ts b/packages/osmojs/src/codegen/cosmwasm/wasm/v1/query.ts index b32812dd3..50db00b52 100644 --- a/packages/osmojs/src/codegen/cosmwasm/wasm/v1/query.ts +++ b/packages/osmojs/src/codegen/cosmwasm/wasm/v1/query.ts @@ -1,6 +1,8 @@ import { PageRequest, PageRequestAmino, PageRequestSDKType, PageResponse, PageResponseAmino, PageResponseSDKType } from "../../../cosmos/base/query/v1beta1/pagination"; import { ContractInfo, ContractInfoAmino, ContractInfoSDKType, ContractCodeHistoryEntry, ContractCodeHistoryEntryAmino, ContractCodeHistoryEntrySDKType, Model, ModelAmino, ModelSDKType, AccessConfig, AccessConfigAmino, AccessConfigSDKType, Params, ParamsAmino, ParamsSDKType } from "./types"; import { BinaryReader, BinaryWriter } from "../../../binary"; +import { isSet, bytesFromBase64, base64FromBytes } from "../../../helpers"; +import { GlobalDecoderRegistry } from "../../../registry"; import { toUtf8, fromUtf8 } from "@cosmjs/encoding"; /** * QueryContractInfoRequest is the request type for the Query/ContractInfo RPC @@ -20,7 +22,7 @@ export interface QueryContractInfoRequestProtoMsg { */ export interface QueryContractInfoRequestAmino { /** address is the address of the contract to query */ - address: string; + address?: string; } export interface QueryContractInfoRequestAminoMsg { type: "wasm/QueryContractInfoRequest"; @@ -52,8 +54,8 @@ export interface QueryContractInfoResponseProtoMsg { */ export interface QueryContractInfoResponseAmino { /** address is the address of the contract */ - address: string; - contract_info?: ContractInfoAmino; + address?: string; + contract_info: ContractInfoAmino; } export interface QueryContractInfoResponseAminoMsg { type: "wasm/QueryContractInfoResponse"; @@ -75,7 +77,7 @@ export interface QueryContractHistoryRequest { /** address is the address of the contract to query */ address: string; /** pagination defines an optional pagination for the request. */ - pagination: PageRequest; + pagination?: PageRequest; } export interface QueryContractHistoryRequestProtoMsg { typeUrl: "/cosmwasm.wasm.v1.QueryContractHistoryRequest"; @@ -87,7 +89,7 @@ export interface QueryContractHistoryRequestProtoMsg { */ export interface QueryContractHistoryRequestAmino { /** address is the address of the contract to query */ - address: string; + address?: string; /** pagination defines an optional pagination for the request. */ pagination?: PageRequestAmino; } @@ -101,7 +103,7 @@ export interface QueryContractHistoryRequestAminoMsg { */ export interface QueryContractHistoryRequestSDKType { address: string; - pagination: PageRequestSDKType; + pagination?: PageRequestSDKType; } /** * QueryContractHistoryResponse is the response type for the @@ -110,7 +112,7 @@ export interface QueryContractHistoryRequestSDKType { export interface QueryContractHistoryResponse { entries: ContractCodeHistoryEntry[]; /** pagination defines the pagination in the response. */ - pagination: PageResponse; + pagination?: PageResponse; } export interface QueryContractHistoryResponseProtoMsg { typeUrl: "/cosmwasm.wasm.v1.QueryContractHistoryResponse"; @@ -135,7 +137,7 @@ export interface QueryContractHistoryResponseAminoMsg { */ export interface QueryContractHistoryResponseSDKType { entries: ContractCodeHistoryEntrySDKType[]; - pagination: PageResponseSDKType; + pagination?: PageResponseSDKType; } /** * QueryContractsByCodeRequest is the request type for the Query/ContractsByCode @@ -147,7 +149,7 @@ export interface QueryContractsByCodeRequest { * pagination defines an optional pagination for the request. */ codeId: bigint; - pagination: PageRequest; + pagination?: PageRequest; } export interface QueryContractsByCodeRequestProtoMsg { typeUrl: "/cosmwasm.wasm.v1.QueryContractsByCodeRequest"; @@ -162,7 +164,7 @@ export interface QueryContractsByCodeRequestAmino { * grpc-gateway_out does not support Go style CodID * pagination defines an optional pagination for the request. */ - code_id: string; + code_id?: string; pagination?: PageRequestAmino; } export interface QueryContractsByCodeRequestAminoMsg { @@ -175,7 +177,7 @@ export interface QueryContractsByCodeRequestAminoMsg { */ export interface QueryContractsByCodeRequestSDKType { code_id: bigint; - pagination: PageRequestSDKType; + pagination?: PageRequestSDKType; } /** * QueryContractsByCodeResponse is the response type for the @@ -185,7 +187,7 @@ export interface QueryContractsByCodeResponse { /** contracts are a set of contract addresses */ contracts: string[]; /** pagination defines the pagination in the response. */ - pagination: PageResponse; + pagination?: PageResponse; } export interface QueryContractsByCodeResponseProtoMsg { typeUrl: "/cosmwasm.wasm.v1.QueryContractsByCodeResponse"; @@ -197,7 +199,7 @@ export interface QueryContractsByCodeResponseProtoMsg { */ export interface QueryContractsByCodeResponseAmino { /** contracts are a set of contract addresses */ - contracts: string[]; + contracts?: string[]; /** pagination defines the pagination in the response. */ pagination?: PageResponseAmino; } @@ -211,7 +213,7 @@ export interface QueryContractsByCodeResponseAminoMsg { */ export interface QueryContractsByCodeResponseSDKType { contracts: string[]; - pagination: PageResponseSDKType; + pagination?: PageResponseSDKType; } /** * QueryAllContractStateRequest is the request type for the @@ -221,7 +223,7 @@ export interface QueryAllContractStateRequest { /** address is the address of the contract */ address: string; /** pagination defines an optional pagination for the request. */ - pagination: PageRequest; + pagination?: PageRequest; } export interface QueryAllContractStateRequestProtoMsg { typeUrl: "/cosmwasm.wasm.v1.QueryAllContractStateRequest"; @@ -233,7 +235,7 @@ export interface QueryAllContractStateRequestProtoMsg { */ export interface QueryAllContractStateRequestAmino { /** address is the address of the contract */ - address: string; + address?: string; /** pagination defines an optional pagination for the request. */ pagination?: PageRequestAmino; } @@ -247,7 +249,7 @@ export interface QueryAllContractStateRequestAminoMsg { */ export interface QueryAllContractStateRequestSDKType { address: string; - pagination: PageRequestSDKType; + pagination?: PageRequestSDKType; } /** * QueryAllContractStateResponse is the response type for the @@ -256,7 +258,7 @@ export interface QueryAllContractStateRequestSDKType { export interface QueryAllContractStateResponse { models: Model[]; /** pagination defines the pagination in the response. */ - pagination: PageResponse; + pagination?: PageResponse; } export interface QueryAllContractStateResponseProtoMsg { typeUrl: "/cosmwasm.wasm.v1.QueryAllContractStateResponse"; @@ -281,7 +283,7 @@ export interface QueryAllContractStateResponseAminoMsg { */ export interface QueryAllContractStateResponseSDKType { models: ModelSDKType[]; - pagination: PageResponseSDKType; + pagination?: PageResponseSDKType; } /** * QueryRawContractStateRequest is the request type for the @@ -302,8 +304,8 @@ export interface QueryRawContractStateRequestProtoMsg { */ export interface QueryRawContractStateRequestAmino { /** address is the address of the contract */ - address: string; - query_data: Uint8Array; + address?: string; + query_data?: string; } export interface QueryRawContractStateRequestAminoMsg { type: "wasm/QueryRawContractStateRequest"; @@ -335,7 +337,7 @@ export interface QueryRawContractStateResponseProtoMsg { */ export interface QueryRawContractStateResponseAmino { /** Data contains the raw store data */ - data: Uint8Array; + data?: string; } export interface QueryRawContractStateResponseAminoMsg { type: "wasm/QueryRawContractStateResponse"; @@ -368,9 +370,9 @@ export interface QuerySmartContractStateRequestProtoMsg { */ export interface QuerySmartContractStateRequestAmino { /** address is the address of the contract */ - address: string; + address?: string; /** QueryData contains the query data passed to the contract */ - query_data: Uint8Array; + query_data?: any; } export interface QuerySmartContractStateRequestAminoMsg { type: "wasm/QuerySmartContractStateRequest"; @@ -402,7 +404,7 @@ export interface QuerySmartContractStateResponseProtoMsg { */ export interface QuerySmartContractStateResponseAmino { /** Data contains the json data returned from the smart contract */ - data: Uint8Array; + data?: any; } export interface QuerySmartContractStateResponseAminoMsg { type: "wasm/QuerySmartContractStateResponse"; @@ -427,7 +429,7 @@ export interface QueryCodeRequestProtoMsg { /** QueryCodeRequest is the request type for the Query/Code RPC method */ export interface QueryCodeRequestAmino { /** grpc-gateway_out does not support Go style CodID */ - code_id: string; + code_id?: string; } export interface QueryCodeRequestAminoMsg { type: "wasm/QueryCodeRequest"; @@ -450,10 +452,10 @@ export interface CodeInfoResponseProtoMsg { } /** CodeInfoResponse contains code meta data from CodeInfo */ export interface CodeInfoResponseAmino { - code_id: string; - creator: string; - data_hash: Uint8Array; - instantiate_permission?: AccessConfigAmino; + code_id?: string; + creator?: string; + data_hash?: string; + instantiate_permission: AccessConfigAmino; } export interface CodeInfoResponseAminoMsg { type: "wasm/CodeInfoResponse"; @@ -468,7 +470,7 @@ export interface CodeInfoResponseSDKType { } /** QueryCodeResponse is the response type for the Query/Code RPC method */ export interface QueryCodeResponse { - codeInfo: CodeInfoResponse; + codeInfo?: CodeInfoResponse; data: Uint8Array; } export interface QueryCodeResponseProtoMsg { @@ -478,7 +480,7 @@ export interface QueryCodeResponseProtoMsg { /** QueryCodeResponse is the response type for the Query/Code RPC method */ export interface QueryCodeResponseAmino { code_info?: CodeInfoResponseAmino; - data: Uint8Array; + data?: string; } export interface QueryCodeResponseAminoMsg { type: "wasm/QueryCodeResponse"; @@ -486,13 +488,13 @@ export interface QueryCodeResponseAminoMsg { } /** QueryCodeResponse is the response type for the Query/Code RPC method */ export interface QueryCodeResponseSDKType { - code_info: CodeInfoResponseSDKType; + code_info?: CodeInfoResponseSDKType; data: Uint8Array; } /** QueryCodesRequest is the request type for the Query/Codes RPC method */ export interface QueryCodesRequest { /** pagination defines an optional pagination for the request. */ - pagination: PageRequest; + pagination?: PageRequest; } export interface QueryCodesRequestProtoMsg { typeUrl: "/cosmwasm.wasm.v1.QueryCodesRequest"; @@ -509,13 +511,13 @@ export interface QueryCodesRequestAminoMsg { } /** QueryCodesRequest is the request type for the Query/Codes RPC method */ export interface QueryCodesRequestSDKType { - pagination: PageRequestSDKType; + pagination?: PageRequestSDKType; } /** QueryCodesResponse is the response type for the Query/Codes RPC method */ export interface QueryCodesResponse { codeInfos: CodeInfoResponse[]; /** pagination defines the pagination in the response. */ - pagination: PageResponse; + pagination?: PageResponse; } export interface QueryCodesResponseProtoMsg { typeUrl: "/cosmwasm.wasm.v1.QueryCodesResponse"; @@ -534,7 +536,7 @@ export interface QueryCodesResponseAminoMsg { /** QueryCodesResponse is the response type for the Query/Codes RPC method */ export interface QueryCodesResponseSDKType { code_infos: CodeInfoResponseSDKType[]; - pagination: PageResponseSDKType; + pagination?: PageResponseSDKType; } /** * QueryPinnedCodesRequest is the request type for the Query/PinnedCodes @@ -542,7 +544,7 @@ export interface QueryCodesResponseSDKType { */ export interface QueryPinnedCodesRequest { /** pagination defines an optional pagination for the request. */ - pagination: PageRequest; + pagination?: PageRequest; } export interface QueryPinnedCodesRequestProtoMsg { typeUrl: "/cosmwasm.wasm.v1.QueryPinnedCodesRequest"; @@ -565,7 +567,7 @@ export interface QueryPinnedCodesRequestAminoMsg { * RPC method */ export interface QueryPinnedCodesRequestSDKType { - pagination: PageRequestSDKType; + pagination?: PageRequestSDKType; } /** * QueryPinnedCodesResponse is the response type for the @@ -574,7 +576,7 @@ export interface QueryPinnedCodesRequestSDKType { export interface QueryPinnedCodesResponse { codeIds: bigint[]; /** pagination defines the pagination in the response. */ - pagination: PageResponse; + pagination?: PageResponse; } export interface QueryPinnedCodesResponseProtoMsg { typeUrl: "/cosmwasm.wasm.v1.QueryPinnedCodesResponse"; @@ -585,7 +587,7 @@ export interface QueryPinnedCodesResponseProtoMsg { * Query/PinnedCodes RPC method */ export interface QueryPinnedCodesResponseAmino { - code_ids: string[]; + code_ids?: string[]; /** pagination defines the pagination in the response. */ pagination?: PageResponseAmino; } @@ -599,7 +601,7 @@ export interface QueryPinnedCodesResponseAminoMsg { */ export interface QueryPinnedCodesResponseSDKType { code_ids: bigint[]; - pagination: PageResponseSDKType; + pagination?: PageResponseSDKType; } /** QueryParamsRequest is the request type for the Query/Params RPC method. */ export interface QueryParamsRequest {} @@ -627,7 +629,7 @@ export interface QueryParamsResponseProtoMsg { /** QueryParamsResponse is the response type for the Query/Params RPC method. */ export interface QueryParamsResponseAmino { /** params defines the parameters of the module. */ - params?: ParamsAmino; + params: ParamsAmino; } export interface QueryParamsResponseAminoMsg { type: "wasm/QueryParamsResponse"; @@ -645,7 +647,7 @@ export interface QueryContractsByCreatorRequest { /** CreatorAddress is the address of contract creator */ creatorAddress: string; /** Pagination defines an optional pagination for the request. */ - pagination: PageRequest; + pagination?: PageRequest; } export interface QueryContractsByCreatorRequestProtoMsg { typeUrl: "/cosmwasm.wasm.v1.QueryContractsByCreatorRequest"; @@ -657,7 +659,7 @@ export interface QueryContractsByCreatorRequestProtoMsg { */ export interface QueryContractsByCreatorRequestAmino { /** CreatorAddress is the address of contract creator */ - creator_address: string; + creator_address?: string; /** Pagination defines an optional pagination for the request. */ pagination?: PageRequestAmino; } @@ -671,7 +673,7 @@ export interface QueryContractsByCreatorRequestAminoMsg { */ export interface QueryContractsByCreatorRequestSDKType { creator_address: string; - pagination: PageRequestSDKType; + pagination?: PageRequestSDKType; } /** * QueryContractsByCreatorResponse is the response type for the @@ -681,7 +683,7 @@ export interface QueryContractsByCreatorResponse { /** ContractAddresses result set */ contractAddresses: string[]; /** Pagination defines the pagination in the response. */ - pagination: PageResponse; + pagination?: PageResponse; } export interface QueryContractsByCreatorResponseProtoMsg { typeUrl: "/cosmwasm.wasm.v1.QueryContractsByCreatorResponse"; @@ -693,7 +695,7 @@ export interface QueryContractsByCreatorResponseProtoMsg { */ export interface QueryContractsByCreatorResponseAmino { /** ContractAddresses result set */ - contract_addresses: string[]; + contract_addresses?: string[]; /** Pagination defines the pagination in the response. */ pagination?: PageResponseAmino; } @@ -707,7 +709,7 @@ export interface QueryContractsByCreatorResponseAminoMsg { */ export interface QueryContractsByCreatorResponseSDKType { contract_addresses: string[]; - pagination: PageResponseSDKType; + pagination?: PageResponseSDKType; } function createBaseQueryContractInfoRequest(): QueryContractInfoRequest { return { @@ -716,6 +718,16 @@ function createBaseQueryContractInfoRequest(): QueryContractInfoRequest { } export const QueryContractInfoRequest = { typeUrl: "/cosmwasm.wasm.v1.QueryContractInfoRequest", + aminoType: "wasm/QueryContractInfoRequest", + is(o: any): o is QueryContractInfoRequest { + return o && (o.$typeUrl === QueryContractInfoRequest.typeUrl || typeof o.address === "string"); + }, + isSDK(o: any): o is QueryContractInfoRequestSDKType { + return o && (o.$typeUrl === QueryContractInfoRequest.typeUrl || typeof o.address === "string"); + }, + isAmino(o: any): o is QueryContractInfoRequestAmino { + return o && (o.$typeUrl === QueryContractInfoRequest.typeUrl || typeof o.address === "string"); + }, encode(message: QueryContractInfoRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.address !== "") { writer.uint32(10).string(message.address); @@ -739,15 +751,27 @@ export const QueryContractInfoRequest = { } return message; }, + fromJSON(object: any): QueryContractInfoRequest { + return { + address: isSet(object.address) ? String(object.address) : "" + }; + }, + toJSON(message: QueryContractInfoRequest): unknown { + const obj: any = {}; + message.address !== undefined && (obj.address = message.address); + return obj; + }, fromPartial(object: Partial): QueryContractInfoRequest { const message = createBaseQueryContractInfoRequest(); message.address = object.address ?? ""; return message; }, fromAmino(object: QueryContractInfoRequestAmino): QueryContractInfoRequest { - return { - address: object.address - }; + const message = createBaseQueryContractInfoRequest(); + if (object.address !== undefined && object.address !== null) { + message.address = object.address; + } + return message; }, toAmino(message: QueryContractInfoRequest): QueryContractInfoRequestAmino { const obj: any = {}; @@ -776,6 +800,8 @@ export const QueryContractInfoRequest = { }; } }; +GlobalDecoderRegistry.register(QueryContractInfoRequest.typeUrl, QueryContractInfoRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryContractInfoRequest.aminoType, QueryContractInfoRequest.typeUrl); function createBaseQueryContractInfoResponse(): QueryContractInfoResponse { return { address: "", @@ -784,6 +810,16 @@ function createBaseQueryContractInfoResponse(): QueryContractInfoResponse { } export const QueryContractInfoResponse = { typeUrl: "/cosmwasm.wasm.v1.QueryContractInfoResponse", + aminoType: "wasm/QueryContractInfoResponse", + is(o: any): o is QueryContractInfoResponse { + return o && (o.$typeUrl === QueryContractInfoResponse.typeUrl || typeof o.address === "string" && ContractInfo.is(o.contractInfo)); + }, + isSDK(o: any): o is QueryContractInfoResponseSDKType { + return o && (o.$typeUrl === QueryContractInfoResponse.typeUrl || typeof o.address === "string" && ContractInfo.isSDK(o.contract_info)); + }, + isAmino(o: any): o is QueryContractInfoResponseAmino { + return o && (o.$typeUrl === QueryContractInfoResponse.typeUrl || typeof o.address === "string" && ContractInfo.isAmino(o.contract_info)); + }, encode(message: QueryContractInfoResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.address !== "") { writer.uint32(10).string(message.address); @@ -813,6 +849,18 @@ export const QueryContractInfoResponse = { } return message; }, + fromJSON(object: any): QueryContractInfoResponse { + return { + address: isSet(object.address) ? String(object.address) : "", + contractInfo: isSet(object.contractInfo) ? ContractInfo.fromJSON(object.contractInfo) : undefined + }; + }, + toJSON(message: QueryContractInfoResponse): unknown { + const obj: any = {}; + message.address !== undefined && (obj.address = message.address); + message.contractInfo !== undefined && (obj.contractInfo = message.contractInfo ? ContractInfo.toJSON(message.contractInfo) : undefined); + return obj; + }, fromPartial(object: Partial): QueryContractInfoResponse { const message = createBaseQueryContractInfoResponse(); message.address = object.address ?? ""; @@ -820,15 +868,19 @@ export const QueryContractInfoResponse = { return message; }, fromAmino(object: QueryContractInfoResponseAmino): QueryContractInfoResponse { - return { - address: object.address, - contractInfo: object?.contract_info ? ContractInfo.fromAmino(object.contract_info) : undefined - }; + const message = createBaseQueryContractInfoResponse(); + if (object.address !== undefined && object.address !== null) { + message.address = object.address; + } + if (object.contract_info !== undefined && object.contract_info !== null) { + message.contractInfo = ContractInfo.fromAmino(object.contract_info); + } + return message; }, toAmino(message: QueryContractInfoResponse): QueryContractInfoResponseAmino { const obj: any = {}; obj.address = message.address; - obj.contract_info = message.contractInfo ? ContractInfo.toAmino(message.contractInfo) : undefined; + obj.contract_info = message.contractInfo ? ContractInfo.toAmino(message.contractInfo) : ContractInfo.fromPartial({}); return obj; }, fromAminoMsg(object: QueryContractInfoResponseAminoMsg): QueryContractInfoResponse { @@ -853,14 +905,26 @@ export const QueryContractInfoResponse = { }; } }; +GlobalDecoderRegistry.register(QueryContractInfoResponse.typeUrl, QueryContractInfoResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryContractInfoResponse.aminoType, QueryContractInfoResponse.typeUrl); function createBaseQueryContractHistoryRequest(): QueryContractHistoryRequest { return { address: "", - pagination: PageRequest.fromPartial({}) + pagination: undefined }; } export const QueryContractHistoryRequest = { typeUrl: "/cosmwasm.wasm.v1.QueryContractHistoryRequest", + aminoType: "wasm/QueryContractHistoryRequest", + is(o: any): o is QueryContractHistoryRequest { + return o && (o.$typeUrl === QueryContractHistoryRequest.typeUrl || typeof o.address === "string"); + }, + isSDK(o: any): o is QueryContractHistoryRequestSDKType { + return o && (o.$typeUrl === QueryContractHistoryRequest.typeUrl || typeof o.address === "string"); + }, + isAmino(o: any): o is QueryContractHistoryRequestAmino { + return o && (o.$typeUrl === QueryContractHistoryRequest.typeUrl || typeof o.address === "string"); + }, encode(message: QueryContractHistoryRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.address !== "") { writer.uint32(10).string(message.address); @@ -890,6 +954,18 @@ export const QueryContractHistoryRequest = { } return message; }, + fromJSON(object: any): QueryContractHistoryRequest { + return { + address: isSet(object.address) ? String(object.address) : "", + pagination: isSet(object.pagination) ? PageRequest.fromJSON(object.pagination) : undefined + }; + }, + toJSON(message: QueryContractHistoryRequest): unknown { + const obj: any = {}; + message.address !== undefined && (obj.address = message.address); + message.pagination !== undefined && (obj.pagination = message.pagination ? PageRequest.toJSON(message.pagination) : undefined); + return obj; + }, fromPartial(object: Partial): QueryContractHistoryRequest { const message = createBaseQueryContractHistoryRequest(); message.address = object.address ?? ""; @@ -897,10 +973,14 @@ export const QueryContractHistoryRequest = { return message; }, fromAmino(object: QueryContractHistoryRequestAmino): QueryContractHistoryRequest { - return { - address: object.address, - pagination: object?.pagination ? PageRequest.fromAmino(object.pagination) : undefined - }; + const message = createBaseQueryContractHistoryRequest(); + if (object.address !== undefined && object.address !== null) { + message.address = object.address; + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromAmino(object.pagination); + } + return message; }, toAmino(message: QueryContractHistoryRequest): QueryContractHistoryRequestAmino { const obj: any = {}; @@ -930,14 +1010,26 @@ export const QueryContractHistoryRequest = { }; } }; +GlobalDecoderRegistry.register(QueryContractHistoryRequest.typeUrl, QueryContractHistoryRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryContractHistoryRequest.aminoType, QueryContractHistoryRequest.typeUrl); function createBaseQueryContractHistoryResponse(): QueryContractHistoryResponse { return { entries: [], - pagination: PageResponse.fromPartial({}) + pagination: undefined }; } export const QueryContractHistoryResponse = { typeUrl: "/cosmwasm.wasm.v1.QueryContractHistoryResponse", + aminoType: "wasm/QueryContractHistoryResponse", + is(o: any): o is QueryContractHistoryResponse { + return o && (o.$typeUrl === QueryContractHistoryResponse.typeUrl || Array.isArray(o.entries) && (!o.entries.length || ContractCodeHistoryEntry.is(o.entries[0]))); + }, + isSDK(o: any): o is QueryContractHistoryResponseSDKType { + return o && (o.$typeUrl === QueryContractHistoryResponse.typeUrl || Array.isArray(o.entries) && (!o.entries.length || ContractCodeHistoryEntry.isSDK(o.entries[0]))); + }, + isAmino(o: any): o is QueryContractHistoryResponseAmino { + return o && (o.$typeUrl === QueryContractHistoryResponse.typeUrl || Array.isArray(o.entries) && (!o.entries.length || ContractCodeHistoryEntry.isAmino(o.entries[0]))); + }, encode(message: QueryContractHistoryResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.entries) { ContractCodeHistoryEntry.encode(v!, writer.uint32(10).fork()).ldelim(); @@ -967,6 +1059,22 @@ export const QueryContractHistoryResponse = { } return message; }, + fromJSON(object: any): QueryContractHistoryResponse { + return { + entries: Array.isArray(object?.entries) ? object.entries.map((e: any) => ContractCodeHistoryEntry.fromJSON(e)) : [], + pagination: isSet(object.pagination) ? PageResponse.fromJSON(object.pagination) : undefined + }; + }, + toJSON(message: QueryContractHistoryResponse): unknown { + const obj: any = {}; + if (message.entries) { + obj.entries = message.entries.map(e => e ? ContractCodeHistoryEntry.toJSON(e) : undefined); + } else { + obj.entries = []; + } + message.pagination !== undefined && (obj.pagination = message.pagination ? PageResponse.toJSON(message.pagination) : undefined); + return obj; + }, fromPartial(object: Partial): QueryContractHistoryResponse { const message = createBaseQueryContractHistoryResponse(); message.entries = object.entries?.map(e => ContractCodeHistoryEntry.fromPartial(e)) || []; @@ -974,10 +1082,12 @@ export const QueryContractHistoryResponse = { return message; }, fromAmino(object: QueryContractHistoryResponseAmino): QueryContractHistoryResponse { - return { - entries: Array.isArray(object?.entries) ? object.entries.map((e: any) => ContractCodeHistoryEntry.fromAmino(e)) : [], - pagination: object?.pagination ? PageResponse.fromAmino(object.pagination) : undefined - }; + const message = createBaseQueryContractHistoryResponse(); + message.entries = object.entries?.map(e => ContractCodeHistoryEntry.fromAmino(e)) || []; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromAmino(object.pagination); + } + return message; }, toAmino(message: QueryContractHistoryResponse): QueryContractHistoryResponseAmino { const obj: any = {}; @@ -1011,14 +1121,26 @@ export const QueryContractHistoryResponse = { }; } }; +GlobalDecoderRegistry.register(QueryContractHistoryResponse.typeUrl, QueryContractHistoryResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryContractHistoryResponse.aminoType, QueryContractHistoryResponse.typeUrl); function createBaseQueryContractsByCodeRequest(): QueryContractsByCodeRequest { return { codeId: BigInt(0), - pagination: PageRequest.fromPartial({}) + pagination: undefined }; } export const QueryContractsByCodeRequest = { typeUrl: "/cosmwasm.wasm.v1.QueryContractsByCodeRequest", + aminoType: "wasm/QueryContractsByCodeRequest", + is(o: any): o is QueryContractsByCodeRequest { + return o && (o.$typeUrl === QueryContractsByCodeRequest.typeUrl || typeof o.codeId === "bigint"); + }, + isSDK(o: any): o is QueryContractsByCodeRequestSDKType { + return o && (o.$typeUrl === QueryContractsByCodeRequest.typeUrl || typeof o.code_id === "bigint"); + }, + isAmino(o: any): o is QueryContractsByCodeRequestAmino { + return o && (o.$typeUrl === QueryContractsByCodeRequest.typeUrl || typeof o.code_id === "bigint"); + }, encode(message: QueryContractsByCodeRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.codeId !== BigInt(0)) { writer.uint32(8).uint64(message.codeId); @@ -1048,6 +1170,18 @@ export const QueryContractsByCodeRequest = { } return message; }, + fromJSON(object: any): QueryContractsByCodeRequest { + return { + codeId: isSet(object.codeId) ? BigInt(object.codeId.toString()) : BigInt(0), + pagination: isSet(object.pagination) ? PageRequest.fromJSON(object.pagination) : undefined + }; + }, + toJSON(message: QueryContractsByCodeRequest): unknown { + const obj: any = {}; + message.codeId !== undefined && (obj.codeId = (message.codeId || BigInt(0)).toString()); + message.pagination !== undefined && (obj.pagination = message.pagination ? PageRequest.toJSON(message.pagination) : undefined); + return obj; + }, fromPartial(object: Partial): QueryContractsByCodeRequest { const message = createBaseQueryContractsByCodeRequest(); message.codeId = object.codeId !== undefined && object.codeId !== null ? BigInt(object.codeId.toString()) : BigInt(0); @@ -1055,10 +1189,14 @@ export const QueryContractsByCodeRequest = { return message; }, fromAmino(object: QueryContractsByCodeRequestAmino): QueryContractsByCodeRequest { - return { - codeId: BigInt(object.code_id), - pagination: object?.pagination ? PageRequest.fromAmino(object.pagination) : undefined - }; + const message = createBaseQueryContractsByCodeRequest(); + if (object.code_id !== undefined && object.code_id !== null) { + message.codeId = BigInt(object.code_id); + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromAmino(object.pagination); + } + return message; }, toAmino(message: QueryContractsByCodeRequest): QueryContractsByCodeRequestAmino { const obj: any = {}; @@ -1088,14 +1226,26 @@ export const QueryContractsByCodeRequest = { }; } }; +GlobalDecoderRegistry.register(QueryContractsByCodeRequest.typeUrl, QueryContractsByCodeRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryContractsByCodeRequest.aminoType, QueryContractsByCodeRequest.typeUrl); function createBaseQueryContractsByCodeResponse(): QueryContractsByCodeResponse { return { contracts: [], - pagination: PageResponse.fromPartial({}) + pagination: undefined }; } export const QueryContractsByCodeResponse = { typeUrl: "/cosmwasm.wasm.v1.QueryContractsByCodeResponse", + aminoType: "wasm/QueryContractsByCodeResponse", + is(o: any): o is QueryContractsByCodeResponse { + return o && (o.$typeUrl === QueryContractsByCodeResponse.typeUrl || Array.isArray(o.contracts) && (!o.contracts.length || typeof o.contracts[0] === "string")); + }, + isSDK(o: any): o is QueryContractsByCodeResponseSDKType { + return o && (o.$typeUrl === QueryContractsByCodeResponse.typeUrl || Array.isArray(o.contracts) && (!o.contracts.length || typeof o.contracts[0] === "string")); + }, + isAmino(o: any): o is QueryContractsByCodeResponseAmino { + return o && (o.$typeUrl === QueryContractsByCodeResponse.typeUrl || Array.isArray(o.contracts) && (!o.contracts.length || typeof o.contracts[0] === "string")); + }, encode(message: QueryContractsByCodeResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.contracts) { writer.uint32(10).string(v!); @@ -1125,6 +1275,22 @@ export const QueryContractsByCodeResponse = { } return message; }, + fromJSON(object: any): QueryContractsByCodeResponse { + return { + contracts: Array.isArray(object?.contracts) ? object.contracts.map((e: any) => String(e)) : [], + pagination: isSet(object.pagination) ? PageResponse.fromJSON(object.pagination) : undefined + }; + }, + toJSON(message: QueryContractsByCodeResponse): unknown { + const obj: any = {}; + if (message.contracts) { + obj.contracts = message.contracts.map(e => e); + } else { + obj.contracts = []; + } + message.pagination !== undefined && (obj.pagination = message.pagination ? PageResponse.toJSON(message.pagination) : undefined); + return obj; + }, fromPartial(object: Partial): QueryContractsByCodeResponse { const message = createBaseQueryContractsByCodeResponse(); message.contracts = object.contracts?.map(e => e) || []; @@ -1132,10 +1298,12 @@ export const QueryContractsByCodeResponse = { return message; }, fromAmino(object: QueryContractsByCodeResponseAmino): QueryContractsByCodeResponse { - return { - contracts: Array.isArray(object?.contracts) ? object.contracts.map((e: any) => e) : [], - pagination: object?.pagination ? PageResponse.fromAmino(object.pagination) : undefined - }; + const message = createBaseQueryContractsByCodeResponse(); + message.contracts = object.contracts?.map(e => e) || []; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromAmino(object.pagination); + } + return message; }, toAmino(message: QueryContractsByCodeResponse): QueryContractsByCodeResponseAmino { const obj: any = {}; @@ -1169,14 +1337,26 @@ export const QueryContractsByCodeResponse = { }; } }; +GlobalDecoderRegistry.register(QueryContractsByCodeResponse.typeUrl, QueryContractsByCodeResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryContractsByCodeResponse.aminoType, QueryContractsByCodeResponse.typeUrl); function createBaseQueryAllContractStateRequest(): QueryAllContractStateRequest { return { address: "", - pagination: PageRequest.fromPartial({}) + pagination: undefined }; } export const QueryAllContractStateRequest = { typeUrl: "/cosmwasm.wasm.v1.QueryAllContractStateRequest", + aminoType: "wasm/QueryAllContractStateRequest", + is(o: any): o is QueryAllContractStateRequest { + return o && (o.$typeUrl === QueryAllContractStateRequest.typeUrl || typeof o.address === "string"); + }, + isSDK(o: any): o is QueryAllContractStateRequestSDKType { + return o && (o.$typeUrl === QueryAllContractStateRequest.typeUrl || typeof o.address === "string"); + }, + isAmino(o: any): o is QueryAllContractStateRequestAmino { + return o && (o.$typeUrl === QueryAllContractStateRequest.typeUrl || typeof o.address === "string"); + }, encode(message: QueryAllContractStateRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.address !== "") { writer.uint32(10).string(message.address); @@ -1206,6 +1386,18 @@ export const QueryAllContractStateRequest = { } return message; }, + fromJSON(object: any): QueryAllContractStateRequest { + return { + address: isSet(object.address) ? String(object.address) : "", + pagination: isSet(object.pagination) ? PageRequest.fromJSON(object.pagination) : undefined + }; + }, + toJSON(message: QueryAllContractStateRequest): unknown { + const obj: any = {}; + message.address !== undefined && (obj.address = message.address); + message.pagination !== undefined && (obj.pagination = message.pagination ? PageRequest.toJSON(message.pagination) : undefined); + return obj; + }, fromPartial(object: Partial): QueryAllContractStateRequest { const message = createBaseQueryAllContractStateRequest(); message.address = object.address ?? ""; @@ -1213,10 +1405,14 @@ export const QueryAllContractStateRequest = { return message; }, fromAmino(object: QueryAllContractStateRequestAmino): QueryAllContractStateRequest { - return { - address: object.address, - pagination: object?.pagination ? PageRequest.fromAmino(object.pagination) : undefined - }; + const message = createBaseQueryAllContractStateRequest(); + if (object.address !== undefined && object.address !== null) { + message.address = object.address; + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromAmino(object.pagination); + } + return message; }, toAmino(message: QueryAllContractStateRequest): QueryAllContractStateRequestAmino { const obj: any = {}; @@ -1246,14 +1442,26 @@ export const QueryAllContractStateRequest = { }; } }; +GlobalDecoderRegistry.register(QueryAllContractStateRequest.typeUrl, QueryAllContractStateRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryAllContractStateRequest.aminoType, QueryAllContractStateRequest.typeUrl); function createBaseQueryAllContractStateResponse(): QueryAllContractStateResponse { return { models: [], - pagination: PageResponse.fromPartial({}) + pagination: undefined }; } export const QueryAllContractStateResponse = { typeUrl: "/cosmwasm.wasm.v1.QueryAllContractStateResponse", + aminoType: "wasm/QueryAllContractStateResponse", + is(o: any): o is QueryAllContractStateResponse { + return o && (o.$typeUrl === QueryAllContractStateResponse.typeUrl || Array.isArray(o.models) && (!o.models.length || Model.is(o.models[0]))); + }, + isSDK(o: any): o is QueryAllContractStateResponseSDKType { + return o && (o.$typeUrl === QueryAllContractStateResponse.typeUrl || Array.isArray(o.models) && (!o.models.length || Model.isSDK(o.models[0]))); + }, + isAmino(o: any): o is QueryAllContractStateResponseAmino { + return o && (o.$typeUrl === QueryAllContractStateResponse.typeUrl || Array.isArray(o.models) && (!o.models.length || Model.isAmino(o.models[0]))); + }, encode(message: QueryAllContractStateResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.models) { Model.encode(v!, writer.uint32(10).fork()).ldelim(); @@ -1283,6 +1491,22 @@ export const QueryAllContractStateResponse = { } return message; }, + fromJSON(object: any): QueryAllContractStateResponse { + return { + models: Array.isArray(object?.models) ? object.models.map((e: any) => Model.fromJSON(e)) : [], + pagination: isSet(object.pagination) ? PageResponse.fromJSON(object.pagination) : undefined + }; + }, + toJSON(message: QueryAllContractStateResponse): unknown { + const obj: any = {}; + if (message.models) { + obj.models = message.models.map(e => e ? Model.toJSON(e) : undefined); + } else { + obj.models = []; + } + message.pagination !== undefined && (obj.pagination = message.pagination ? PageResponse.toJSON(message.pagination) : undefined); + return obj; + }, fromPartial(object: Partial): QueryAllContractStateResponse { const message = createBaseQueryAllContractStateResponse(); message.models = object.models?.map(e => Model.fromPartial(e)) || []; @@ -1290,10 +1514,12 @@ export const QueryAllContractStateResponse = { return message; }, fromAmino(object: QueryAllContractStateResponseAmino): QueryAllContractStateResponse { - return { - models: Array.isArray(object?.models) ? object.models.map((e: any) => Model.fromAmino(e)) : [], - pagination: object?.pagination ? PageResponse.fromAmino(object.pagination) : undefined - }; + const message = createBaseQueryAllContractStateResponse(); + message.models = object.models?.map(e => Model.fromAmino(e)) || []; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromAmino(object.pagination); + } + return message; }, toAmino(message: QueryAllContractStateResponse): QueryAllContractStateResponseAmino { const obj: any = {}; @@ -1327,6 +1553,8 @@ export const QueryAllContractStateResponse = { }; } }; +GlobalDecoderRegistry.register(QueryAllContractStateResponse.typeUrl, QueryAllContractStateResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryAllContractStateResponse.aminoType, QueryAllContractStateResponse.typeUrl); function createBaseQueryRawContractStateRequest(): QueryRawContractStateRequest { return { address: "", @@ -1335,6 +1563,16 @@ function createBaseQueryRawContractStateRequest(): QueryRawContractStateRequest } export const QueryRawContractStateRequest = { typeUrl: "/cosmwasm.wasm.v1.QueryRawContractStateRequest", + aminoType: "wasm/QueryRawContractStateRequest", + is(o: any): o is QueryRawContractStateRequest { + return o && (o.$typeUrl === QueryRawContractStateRequest.typeUrl || typeof o.address === "string" && (o.queryData instanceof Uint8Array || typeof o.queryData === "string")); + }, + isSDK(o: any): o is QueryRawContractStateRequestSDKType { + return o && (o.$typeUrl === QueryRawContractStateRequest.typeUrl || typeof o.address === "string" && (o.query_data instanceof Uint8Array || typeof o.query_data === "string")); + }, + isAmino(o: any): o is QueryRawContractStateRequestAmino { + return o && (o.$typeUrl === QueryRawContractStateRequest.typeUrl || typeof o.address === "string" && (o.query_data instanceof Uint8Array || typeof o.query_data === "string")); + }, encode(message: QueryRawContractStateRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.address !== "") { writer.uint32(10).string(message.address); @@ -1364,6 +1602,18 @@ export const QueryRawContractStateRequest = { } return message; }, + fromJSON(object: any): QueryRawContractStateRequest { + return { + address: isSet(object.address) ? String(object.address) : "", + queryData: isSet(object.queryData) ? bytesFromBase64(object.queryData) : new Uint8Array() + }; + }, + toJSON(message: QueryRawContractStateRequest): unknown { + const obj: any = {}; + message.address !== undefined && (obj.address = message.address); + message.queryData !== undefined && (obj.queryData = base64FromBytes(message.queryData !== undefined ? message.queryData : new Uint8Array())); + return obj; + }, fromPartial(object: Partial): QueryRawContractStateRequest { const message = createBaseQueryRawContractStateRequest(); message.address = object.address ?? ""; @@ -1371,15 +1621,19 @@ export const QueryRawContractStateRequest = { return message; }, fromAmino(object: QueryRawContractStateRequestAmino): QueryRawContractStateRequest { - return { - address: object.address, - queryData: object.query_data - }; + const message = createBaseQueryRawContractStateRequest(); + if (object.address !== undefined && object.address !== null) { + message.address = object.address; + } + if (object.query_data !== undefined && object.query_data !== null) { + message.queryData = bytesFromBase64(object.query_data); + } + return message; }, toAmino(message: QueryRawContractStateRequest): QueryRawContractStateRequestAmino { const obj: any = {}; obj.address = message.address; - obj.query_data = message.queryData; + obj.query_data = message.queryData ? base64FromBytes(message.queryData) : undefined; return obj; }, fromAminoMsg(object: QueryRawContractStateRequestAminoMsg): QueryRawContractStateRequest { @@ -1404,6 +1658,8 @@ export const QueryRawContractStateRequest = { }; } }; +GlobalDecoderRegistry.register(QueryRawContractStateRequest.typeUrl, QueryRawContractStateRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryRawContractStateRequest.aminoType, QueryRawContractStateRequest.typeUrl); function createBaseQueryRawContractStateResponse(): QueryRawContractStateResponse { return { data: new Uint8Array() @@ -1411,6 +1667,16 @@ function createBaseQueryRawContractStateResponse(): QueryRawContractStateRespons } export const QueryRawContractStateResponse = { typeUrl: "/cosmwasm.wasm.v1.QueryRawContractStateResponse", + aminoType: "wasm/QueryRawContractStateResponse", + is(o: any): o is QueryRawContractStateResponse { + return o && (o.$typeUrl === QueryRawContractStateResponse.typeUrl || o.data instanceof Uint8Array || typeof o.data === "string"); + }, + isSDK(o: any): o is QueryRawContractStateResponseSDKType { + return o && (o.$typeUrl === QueryRawContractStateResponse.typeUrl || o.data instanceof Uint8Array || typeof o.data === "string"); + }, + isAmino(o: any): o is QueryRawContractStateResponseAmino { + return o && (o.$typeUrl === QueryRawContractStateResponse.typeUrl || o.data instanceof Uint8Array || typeof o.data === "string"); + }, encode(message: QueryRawContractStateResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.data.length !== 0) { writer.uint32(10).bytes(message.data); @@ -1434,19 +1700,31 @@ export const QueryRawContractStateResponse = { } return message; }, + fromJSON(object: any): QueryRawContractStateResponse { + return { + data: isSet(object.data) ? bytesFromBase64(object.data) : new Uint8Array() + }; + }, + toJSON(message: QueryRawContractStateResponse): unknown { + const obj: any = {}; + message.data !== undefined && (obj.data = base64FromBytes(message.data !== undefined ? message.data : new Uint8Array())); + return obj; + }, fromPartial(object: Partial): QueryRawContractStateResponse { const message = createBaseQueryRawContractStateResponse(); message.data = object.data ?? new Uint8Array(); return message; }, fromAmino(object: QueryRawContractStateResponseAmino): QueryRawContractStateResponse { - return { - data: object.data - }; + const message = createBaseQueryRawContractStateResponse(); + if (object.data !== undefined && object.data !== null) { + message.data = bytesFromBase64(object.data); + } + return message; }, toAmino(message: QueryRawContractStateResponse): QueryRawContractStateResponseAmino { const obj: any = {}; - obj.data = message.data; + obj.data = message.data ? base64FromBytes(message.data) : undefined; return obj; }, fromAminoMsg(object: QueryRawContractStateResponseAminoMsg): QueryRawContractStateResponse { @@ -1471,6 +1749,8 @@ export const QueryRawContractStateResponse = { }; } }; +GlobalDecoderRegistry.register(QueryRawContractStateResponse.typeUrl, QueryRawContractStateResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryRawContractStateResponse.aminoType, QueryRawContractStateResponse.typeUrl); function createBaseQuerySmartContractStateRequest(): QuerySmartContractStateRequest { return { address: "", @@ -1479,6 +1759,16 @@ function createBaseQuerySmartContractStateRequest(): QuerySmartContractStateRequ } export const QuerySmartContractStateRequest = { typeUrl: "/cosmwasm.wasm.v1.QuerySmartContractStateRequest", + aminoType: "wasm/QuerySmartContractStateRequest", + is(o: any): o is QuerySmartContractStateRequest { + return o && (o.$typeUrl === QuerySmartContractStateRequest.typeUrl || typeof o.address === "string" && (o.queryData instanceof Uint8Array || typeof o.queryData === "string")); + }, + isSDK(o: any): o is QuerySmartContractStateRequestSDKType { + return o && (o.$typeUrl === QuerySmartContractStateRequest.typeUrl || typeof o.address === "string" && (o.query_data instanceof Uint8Array || typeof o.query_data === "string")); + }, + isAmino(o: any): o is QuerySmartContractStateRequestAmino { + return o && (o.$typeUrl === QuerySmartContractStateRequest.typeUrl || typeof o.address === "string" && (o.query_data instanceof Uint8Array || typeof o.query_data === "string")); + }, encode(message: QuerySmartContractStateRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.address !== "") { writer.uint32(10).string(message.address); @@ -1508,6 +1798,18 @@ export const QuerySmartContractStateRequest = { } return message; }, + fromJSON(object: any): QuerySmartContractStateRequest { + return { + address: isSet(object.address) ? String(object.address) : "", + queryData: isSet(object.queryData) ? bytesFromBase64(object.queryData) : new Uint8Array() + }; + }, + toJSON(message: QuerySmartContractStateRequest): unknown { + const obj: any = {}; + message.address !== undefined && (obj.address = message.address); + message.queryData !== undefined && (obj.queryData = base64FromBytes(message.queryData !== undefined ? message.queryData : new Uint8Array())); + return obj; + }, fromPartial(object: Partial): QuerySmartContractStateRequest { const message = createBaseQuerySmartContractStateRequest(); message.address = object.address ?? ""; @@ -1515,10 +1817,14 @@ export const QuerySmartContractStateRequest = { return message; }, fromAmino(object: QuerySmartContractStateRequestAmino): QuerySmartContractStateRequest { - return { - address: object.address, - queryData: toUtf8(JSON.stringify(object.query_data)) - }; + const message = createBaseQuerySmartContractStateRequest(); + if (object.address !== undefined && object.address !== null) { + message.address = object.address; + } + if (object.query_data !== undefined && object.query_data !== null) { + message.queryData = toUtf8(JSON.stringify(object.query_data)); + } + return message; }, toAmino(message: QuerySmartContractStateRequest): QuerySmartContractStateRequestAmino { const obj: any = {}; @@ -1548,6 +1854,8 @@ export const QuerySmartContractStateRequest = { }; } }; +GlobalDecoderRegistry.register(QuerySmartContractStateRequest.typeUrl, QuerySmartContractStateRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(QuerySmartContractStateRequest.aminoType, QuerySmartContractStateRequest.typeUrl); function createBaseQuerySmartContractStateResponse(): QuerySmartContractStateResponse { return { data: new Uint8Array() @@ -1555,6 +1863,16 @@ function createBaseQuerySmartContractStateResponse(): QuerySmartContractStateRes } export const QuerySmartContractStateResponse = { typeUrl: "/cosmwasm.wasm.v1.QuerySmartContractStateResponse", + aminoType: "wasm/QuerySmartContractStateResponse", + is(o: any): o is QuerySmartContractStateResponse { + return o && (o.$typeUrl === QuerySmartContractStateResponse.typeUrl || o.data instanceof Uint8Array || typeof o.data === "string"); + }, + isSDK(o: any): o is QuerySmartContractStateResponseSDKType { + return o && (o.$typeUrl === QuerySmartContractStateResponse.typeUrl || o.data instanceof Uint8Array || typeof o.data === "string"); + }, + isAmino(o: any): o is QuerySmartContractStateResponseAmino { + return o && (o.$typeUrl === QuerySmartContractStateResponse.typeUrl || o.data instanceof Uint8Array || typeof o.data === "string"); + }, encode(message: QuerySmartContractStateResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.data.length !== 0) { writer.uint32(10).bytes(message.data); @@ -1578,15 +1896,27 @@ export const QuerySmartContractStateResponse = { } return message; }, + fromJSON(object: any): QuerySmartContractStateResponse { + return { + data: isSet(object.data) ? bytesFromBase64(object.data) : new Uint8Array() + }; + }, + toJSON(message: QuerySmartContractStateResponse): unknown { + const obj: any = {}; + message.data !== undefined && (obj.data = base64FromBytes(message.data !== undefined ? message.data : new Uint8Array())); + return obj; + }, fromPartial(object: Partial): QuerySmartContractStateResponse { const message = createBaseQuerySmartContractStateResponse(); message.data = object.data ?? new Uint8Array(); return message; }, fromAmino(object: QuerySmartContractStateResponseAmino): QuerySmartContractStateResponse { - return { - data: toUtf8(JSON.stringify(object.data)) - }; + const message = createBaseQuerySmartContractStateResponse(); + if (object.data !== undefined && object.data !== null) { + message.data = toUtf8(JSON.stringify(object.data)); + } + return message; }, toAmino(message: QuerySmartContractStateResponse): QuerySmartContractStateResponseAmino { const obj: any = {}; @@ -1615,6 +1945,8 @@ export const QuerySmartContractStateResponse = { }; } }; +GlobalDecoderRegistry.register(QuerySmartContractStateResponse.typeUrl, QuerySmartContractStateResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(QuerySmartContractStateResponse.aminoType, QuerySmartContractStateResponse.typeUrl); function createBaseQueryCodeRequest(): QueryCodeRequest { return { codeId: BigInt(0) @@ -1622,6 +1954,16 @@ function createBaseQueryCodeRequest(): QueryCodeRequest { } export const QueryCodeRequest = { typeUrl: "/cosmwasm.wasm.v1.QueryCodeRequest", + aminoType: "wasm/QueryCodeRequest", + is(o: any): o is QueryCodeRequest { + return o && (o.$typeUrl === QueryCodeRequest.typeUrl || typeof o.codeId === "bigint"); + }, + isSDK(o: any): o is QueryCodeRequestSDKType { + return o && (o.$typeUrl === QueryCodeRequest.typeUrl || typeof o.code_id === "bigint"); + }, + isAmino(o: any): o is QueryCodeRequestAmino { + return o && (o.$typeUrl === QueryCodeRequest.typeUrl || typeof o.code_id === "bigint"); + }, encode(message: QueryCodeRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.codeId !== BigInt(0)) { writer.uint32(8).uint64(message.codeId); @@ -1645,15 +1987,27 @@ export const QueryCodeRequest = { } return message; }, + fromJSON(object: any): QueryCodeRequest { + return { + codeId: isSet(object.codeId) ? BigInt(object.codeId.toString()) : BigInt(0) + }; + }, + toJSON(message: QueryCodeRequest): unknown { + const obj: any = {}; + message.codeId !== undefined && (obj.codeId = (message.codeId || BigInt(0)).toString()); + return obj; + }, fromPartial(object: Partial): QueryCodeRequest { const message = createBaseQueryCodeRequest(); message.codeId = object.codeId !== undefined && object.codeId !== null ? BigInt(object.codeId.toString()) : BigInt(0); return message; }, fromAmino(object: QueryCodeRequestAmino): QueryCodeRequest { - return { - codeId: BigInt(object.code_id) - }; + const message = createBaseQueryCodeRequest(); + if (object.code_id !== undefined && object.code_id !== null) { + message.codeId = BigInt(object.code_id); + } + return message; }, toAmino(message: QueryCodeRequest): QueryCodeRequestAmino { const obj: any = {}; @@ -1682,6 +2036,8 @@ export const QueryCodeRequest = { }; } }; +GlobalDecoderRegistry.register(QueryCodeRequest.typeUrl, QueryCodeRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryCodeRequest.aminoType, QueryCodeRequest.typeUrl); function createBaseCodeInfoResponse(): CodeInfoResponse { return { codeId: BigInt(0), @@ -1692,6 +2048,16 @@ function createBaseCodeInfoResponse(): CodeInfoResponse { } export const CodeInfoResponse = { typeUrl: "/cosmwasm.wasm.v1.CodeInfoResponse", + aminoType: "wasm/CodeInfoResponse", + is(o: any): o is CodeInfoResponse { + return o && (o.$typeUrl === CodeInfoResponse.typeUrl || typeof o.codeId === "bigint" && typeof o.creator === "string" && (o.dataHash instanceof Uint8Array || typeof o.dataHash === "string") && AccessConfig.is(o.instantiatePermission)); + }, + isSDK(o: any): o is CodeInfoResponseSDKType { + return o && (o.$typeUrl === CodeInfoResponse.typeUrl || typeof o.code_id === "bigint" && typeof o.creator === "string" && (o.data_hash instanceof Uint8Array || typeof o.data_hash === "string") && AccessConfig.isSDK(o.instantiate_permission)); + }, + isAmino(o: any): o is CodeInfoResponseAmino { + return o && (o.$typeUrl === CodeInfoResponse.typeUrl || typeof o.code_id === "bigint" && typeof o.creator === "string" && (o.data_hash instanceof Uint8Array || typeof o.data_hash === "string") && AccessConfig.isAmino(o.instantiate_permission)); + }, encode(message: CodeInfoResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.codeId !== BigInt(0)) { writer.uint32(8).uint64(message.codeId); @@ -1733,6 +2099,22 @@ export const CodeInfoResponse = { } return message; }, + fromJSON(object: any): CodeInfoResponse { + return { + codeId: isSet(object.codeId) ? BigInt(object.codeId.toString()) : BigInt(0), + creator: isSet(object.creator) ? String(object.creator) : "", + dataHash: isSet(object.dataHash) ? bytesFromBase64(object.dataHash) : new Uint8Array(), + instantiatePermission: isSet(object.instantiatePermission) ? AccessConfig.fromJSON(object.instantiatePermission) : undefined + }; + }, + toJSON(message: CodeInfoResponse): unknown { + const obj: any = {}; + message.codeId !== undefined && (obj.codeId = (message.codeId || BigInt(0)).toString()); + message.creator !== undefined && (obj.creator = message.creator); + message.dataHash !== undefined && (obj.dataHash = base64FromBytes(message.dataHash !== undefined ? message.dataHash : new Uint8Array())); + message.instantiatePermission !== undefined && (obj.instantiatePermission = message.instantiatePermission ? AccessConfig.toJSON(message.instantiatePermission) : undefined); + return obj; + }, fromPartial(object: Partial): CodeInfoResponse { const message = createBaseCodeInfoResponse(); message.codeId = object.codeId !== undefined && object.codeId !== null ? BigInt(object.codeId.toString()) : BigInt(0); @@ -1742,19 +2124,27 @@ export const CodeInfoResponse = { return message; }, fromAmino(object: CodeInfoResponseAmino): CodeInfoResponse { - return { - codeId: BigInt(object.code_id), - creator: object.creator, - dataHash: object.data_hash, - instantiatePermission: object?.instantiate_permission ? AccessConfig.fromAmino(object.instantiate_permission) : undefined - }; + const message = createBaseCodeInfoResponse(); + if (object.code_id !== undefined && object.code_id !== null) { + message.codeId = BigInt(object.code_id); + } + if (object.creator !== undefined && object.creator !== null) { + message.creator = object.creator; + } + if (object.data_hash !== undefined && object.data_hash !== null) { + message.dataHash = bytesFromBase64(object.data_hash); + } + if (object.instantiate_permission !== undefined && object.instantiate_permission !== null) { + message.instantiatePermission = AccessConfig.fromAmino(object.instantiate_permission); + } + return message; }, toAmino(message: CodeInfoResponse): CodeInfoResponseAmino { const obj: any = {}; obj.code_id = message.codeId ? message.codeId.toString() : undefined; obj.creator = message.creator; - obj.data_hash = message.dataHash; - obj.instantiate_permission = message.instantiatePermission ? AccessConfig.toAmino(message.instantiatePermission) : undefined; + obj.data_hash = message.dataHash ? base64FromBytes(message.dataHash) : undefined; + obj.instantiate_permission = message.instantiatePermission ? AccessConfig.toAmino(message.instantiatePermission) : AccessConfig.fromPartial({}); return obj; }, fromAminoMsg(object: CodeInfoResponseAminoMsg): CodeInfoResponse { @@ -1779,14 +2169,26 @@ export const CodeInfoResponse = { }; } }; +GlobalDecoderRegistry.register(CodeInfoResponse.typeUrl, CodeInfoResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(CodeInfoResponse.aminoType, CodeInfoResponse.typeUrl); function createBaseQueryCodeResponse(): QueryCodeResponse { return { - codeInfo: CodeInfoResponse.fromPartial({}), + codeInfo: undefined, data: new Uint8Array() }; } export const QueryCodeResponse = { typeUrl: "/cosmwasm.wasm.v1.QueryCodeResponse", + aminoType: "wasm/QueryCodeResponse", + is(o: any): o is QueryCodeResponse { + return o && (o.$typeUrl === QueryCodeResponse.typeUrl || o.data instanceof Uint8Array || typeof o.data === "string"); + }, + isSDK(o: any): o is QueryCodeResponseSDKType { + return o && (o.$typeUrl === QueryCodeResponse.typeUrl || o.data instanceof Uint8Array || typeof o.data === "string"); + }, + isAmino(o: any): o is QueryCodeResponseAmino { + return o && (o.$typeUrl === QueryCodeResponse.typeUrl || o.data instanceof Uint8Array || typeof o.data === "string"); + }, encode(message: QueryCodeResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.codeInfo !== undefined) { CodeInfoResponse.encode(message.codeInfo, writer.uint32(10).fork()).ldelim(); @@ -1816,6 +2218,18 @@ export const QueryCodeResponse = { } return message; }, + fromJSON(object: any): QueryCodeResponse { + return { + codeInfo: isSet(object.codeInfo) ? CodeInfoResponse.fromJSON(object.codeInfo) : undefined, + data: isSet(object.data) ? bytesFromBase64(object.data) : new Uint8Array() + }; + }, + toJSON(message: QueryCodeResponse): unknown { + const obj: any = {}; + message.codeInfo !== undefined && (obj.codeInfo = message.codeInfo ? CodeInfoResponse.toJSON(message.codeInfo) : undefined); + message.data !== undefined && (obj.data = base64FromBytes(message.data !== undefined ? message.data : new Uint8Array())); + return obj; + }, fromPartial(object: Partial): QueryCodeResponse { const message = createBaseQueryCodeResponse(); message.codeInfo = object.codeInfo !== undefined && object.codeInfo !== null ? CodeInfoResponse.fromPartial(object.codeInfo) : undefined; @@ -1823,15 +2237,19 @@ export const QueryCodeResponse = { return message; }, fromAmino(object: QueryCodeResponseAmino): QueryCodeResponse { - return { - codeInfo: object?.code_info ? CodeInfoResponse.fromAmino(object.code_info) : undefined, - data: object.data - }; + const message = createBaseQueryCodeResponse(); + if (object.code_info !== undefined && object.code_info !== null) { + message.codeInfo = CodeInfoResponse.fromAmino(object.code_info); + } + if (object.data !== undefined && object.data !== null) { + message.data = bytesFromBase64(object.data); + } + return message; }, toAmino(message: QueryCodeResponse): QueryCodeResponseAmino { const obj: any = {}; obj.code_info = message.codeInfo ? CodeInfoResponse.toAmino(message.codeInfo) : undefined; - obj.data = message.data; + obj.data = message.data ? base64FromBytes(message.data) : undefined; return obj; }, fromAminoMsg(object: QueryCodeResponseAminoMsg): QueryCodeResponse { @@ -1856,13 +2274,25 @@ export const QueryCodeResponse = { }; } }; +GlobalDecoderRegistry.register(QueryCodeResponse.typeUrl, QueryCodeResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryCodeResponse.aminoType, QueryCodeResponse.typeUrl); function createBaseQueryCodesRequest(): QueryCodesRequest { return { - pagination: PageRequest.fromPartial({}) + pagination: undefined }; } export const QueryCodesRequest = { typeUrl: "/cosmwasm.wasm.v1.QueryCodesRequest", + aminoType: "wasm/QueryCodesRequest", + is(o: any): o is QueryCodesRequest { + return o && o.$typeUrl === QueryCodesRequest.typeUrl; + }, + isSDK(o: any): o is QueryCodesRequestSDKType { + return o && o.$typeUrl === QueryCodesRequest.typeUrl; + }, + isAmino(o: any): o is QueryCodesRequestAmino { + return o && o.$typeUrl === QueryCodesRequest.typeUrl; + }, encode(message: QueryCodesRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.pagination !== undefined) { PageRequest.encode(message.pagination, writer.uint32(10).fork()).ldelim(); @@ -1886,15 +2316,27 @@ export const QueryCodesRequest = { } return message; }, + fromJSON(object: any): QueryCodesRequest { + return { + pagination: isSet(object.pagination) ? PageRequest.fromJSON(object.pagination) : undefined + }; + }, + toJSON(message: QueryCodesRequest): unknown { + const obj: any = {}; + message.pagination !== undefined && (obj.pagination = message.pagination ? PageRequest.toJSON(message.pagination) : undefined); + return obj; + }, fromPartial(object: Partial): QueryCodesRequest { const message = createBaseQueryCodesRequest(); message.pagination = object.pagination !== undefined && object.pagination !== null ? PageRequest.fromPartial(object.pagination) : undefined; return message; }, fromAmino(object: QueryCodesRequestAmino): QueryCodesRequest { - return { - pagination: object?.pagination ? PageRequest.fromAmino(object.pagination) : undefined - }; + const message = createBaseQueryCodesRequest(); + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromAmino(object.pagination); + } + return message; }, toAmino(message: QueryCodesRequest): QueryCodesRequestAmino { const obj: any = {}; @@ -1923,14 +2365,26 @@ export const QueryCodesRequest = { }; } }; +GlobalDecoderRegistry.register(QueryCodesRequest.typeUrl, QueryCodesRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryCodesRequest.aminoType, QueryCodesRequest.typeUrl); function createBaseQueryCodesResponse(): QueryCodesResponse { return { codeInfos: [], - pagination: PageResponse.fromPartial({}) + pagination: undefined }; } export const QueryCodesResponse = { typeUrl: "/cosmwasm.wasm.v1.QueryCodesResponse", + aminoType: "wasm/QueryCodesResponse", + is(o: any): o is QueryCodesResponse { + return o && (o.$typeUrl === QueryCodesResponse.typeUrl || Array.isArray(o.codeInfos) && (!o.codeInfos.length || CodeInfoResponse.is(o.codeInfos[0]))); + }, + isSDK(o: any): o is QueryCodesResponseSDKType { + return o && (o.$typeUrl === QueryCodesResponse.typeUrl || Array.isArray(o.code_infos) && (!o.code_infos.length || CodeInfoResponse.isSDK(o.code_infos[0]))); + }, + isAmino(o: any): o is QueryCodesResponseAmino { + return o && (o.$typeUrl === QueryCodesResponse.typeUrl || Array.isArray(o.code_infos) && (!o.code_infos.length || CodeInfoResponse.isAmino(o.code_infos[0]))); + }, encode(message: QueryCodesResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.codeInfos) { CodeInfoResponse.encode(v!, writer.uint32(10).fork()).ldelim(); @@ -1960,6 +2414,22 @@ export const QueryCodesResponse = { } return message; }, + fromJSON(object: any): QueryCodesResponse { + return { + codeInfos: Array.isArray(object?.codeInfos) ? object.codeInfos.map((e: any) => CodeInfoResponse.fromJSON(e)) : [], + pagination: isSet(object.pagination) ? PageResponse.fromJSON(object.pagination) : undefined + }; + }, + toJSON(message: QueryCodesResponse): unknown { + const obj: any = {}; + if (message.codeInfos) { + obj.codeInfos = message.codeInfos.map(e => e ? CodeInfoResponse.toJSON(e) : undefined); + } else { + obj.codeInfos = []; + } + message.pagination !== undefined && (obj.pagination = message.pagination ? PageResponse.toJSON(message.pagination) : undefined); + return obj; + }, fromPartial(object: Partial): QueryCodesResponse { const message = createBaseQueryCodesResponse(); message.codeInfos = object.codeInfos?.map(e => CodeInfoResponse.fromPartial(e)) || []; @@ -1967,10 +2437,12 @@ export const QueryCodesResponse = { return message; }, fromAmino(object: QueryCodesResponseAmino): QueryCodesResponse { - return { - codeInfos: Array.isArray(object?.code_infos) ? object.code_infos.map((e: any) => CodeInfoResponse.fromAmino(e)) : [], - pagination: object?.pagination ? PageResponse.fromAmino(object.pagination) : undefined - }; + const message = createBaseQueryCodesResponse(); + message.codeInfos = object.code_infos?.map(e => CodeInfoResponse.fromAmino(e)) || []; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromAmino(object.pagination); + } + return message; }, toAmino(message: QueryCodesResponse): QueryCodesResponseAmino { const obj: any = {}; @@ -2004,13 +2476,25 @@ export const QueryCodesResponse = { }; } }; +GlobalDecoderRegistry.register(QueryCodesResponse.typeUrl, QueryCodesResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryCodesResponse.aminoType, QueryCodesResponse.typeUrl); function createBaseQueryPinnedCodesRequest(): QueryPinnedCodesRequest { return { - pagination: PageRequest.fromPartial({}) + pagination: undefined }; } export const QueryPinnedCodesRequest = { typeUrl: "/cosmwasm.wasm.v1.QueryPinnedCodesRequest", + aminoType: "wasm/QueryPinnedCodesRequest", + is(o: any): o is QueryPinnedCodesRequest { + return o && o.$typeUrl === QueryPinnedCodesRequest.typeUrl; + }, + isSDK(o: any): o is QueryPinnedCodesRequestSDKType { + return o && o.$typeUrl === QueryPinnedCodesRequest.typeUrl; + }, + isAmino(o: any): o is QueryPinnedCodesRequestAmino { + return o && o.$typeUrl === QueryPinnedCodesRequest.typeUrl; + }, encode(message: QueryPinnedCodesRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.pagination !== undefined) { PageRequest.encode(message.pagination, writer.uint32(18).fork()).ldelim(); @@ -2034,15 +2518,27 @@ export const QueryPinnedCodesRequest = { } return message; }, + fromJSON(object: any): QueryPinnedCodesRequest { + return { + pagination: isSet(object.pagination) ? PageRequest.fromJSON(object.pagination) : undefined + }; + }, + toJSON(message: QueryPinnedCodesRequest): unknown { + const obj: any = {}; + message.pagination !== undefined && (obj.pagination = message.pagination ? PageRequest.toJSON(message.pagination) : undefined); + return obj; + }, fromPartial(object: Partial): QueryPinnedCodesRequest { const message = createBaseQueryPinnedCodesRequest(); message.pagination = object.pagination !== undefined && object.pagination !== null ? PageRequest.fromPartial(object.pagination) : undefined; return message; }, fromAmino(object: QueryPinnedCodesRequestAmino): QueryPinnedCodesRequest { - return { - pagination: object?.pagination ? PageRequest.fromAmino(object.pagination) : undefined - }; + const message = createBaseQueryPinnedCodesRequest(); + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromAmino(object.pagination); + } + return message; }, toAmino(message: QueryPinnedCodesRequest): QueryPinnedCodesRequestAmino { const obj: any = {}; @@ -2071,14 +2567,26 @@ export const QueryPinnedCodesRequest = { }; } }; +GlobalDecoderRegistry.register(QueryPinnedCodesRequest.typeUrl, QueryPinnedCodesRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryPinnedCodesRequest.aminoType, QueryPinnedCodesRequest.typeUrl); function createBaseQueryPinnedCodesResponse(): QueryPinnedCodesResponse { return { codeIds: [], - pagination: PageResponse.fromPartial({}) + pagination: undefined }; } export const QueryPinnedCodesResponse = { typeUrl: "/cosmwasm.wasm.v1.QueryPinnedCodesResponse", + aminoType: "wasm/QueryPinnedCodesResponse", + is(o: any): o is QueryPinnedCodesResponse { + return o && (o.$typeUrl === QueryPinnedCodesResponse.typeUrl || Array.isArray(o.codeIds) && (!o.codeIds.length || typeof o.codeIds[0] === "bigint")); + }, + isSDK(o: any): o is QueryPinnedCodesResponseSDKType { + return o && (o.$typeUrl === QueryPinnedCodesResponse.typeUrl || Array.isArray(o.code_ids) && (!o.code_ids.length || typeof o.code_ids[0] === "bigint")); + }, + isAmino(o: any): o is QueryPinnedCodesResponseAmino { + return o && (o.$typeUrl === QueryPinnedCodesResponse.typeUrl || Array.isArray(o.code_ids) && (!o.code_ids.length || typeof o.code_ids[0] === "bigint")); + }, encode(message: QueryPinnedCodesResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { writer.uint32(10).fork(); for (const v of message.codeIds) { @@ -2117,6 +2625,22 @@ export const QueryPinnedCodesResponse = { } return message; }, + fromJSON(object: any): QueryPinnedCodesResponse { + return { + codeIds: Array.isArray(object?.codeIds) ? object.codeIds.map((e: any) => BigInt(e.toString())) : [], + pagination: isSet(object.pagination) ? PageResponse.fromJSON(object.pagination) : undefined + }; + }, + toJSON(message: QueryPinnedCodesResponse): unknown { + const obj: any = {}; + if (message.codeIds) { + obj.codeIds = message.codeIds.map(e => (e || BigInt(0)).toString()); + } else { + obj.codeIds = []; + } + message.pagination !== undefined && (obj.pagination = message.pagination ? PageResponse.toJSON(message.pagination) : undefined); + return obj; + }, fromPartial(object: Partial): QueryPinnedCodesResponse { const message = createBaseQueryPinnedCodesResponse(); message.codeIds = object.codeIds?.map(e => BigInt(e.toString())) || []; @@ -2124,10 +2648,12 @@ export const QueryPinnedCodesResponse = { return message; }, fromAmino(object: QueryPinnedCodesResponseAmino): QueryPinnedCodesResponse { - return { - codeIds: Array.isArray(object?.code_ids) ? object.code_ids.map((e: any) => BigInt(e)) : [], - pagination: object?.pagination ? PageResponse.fromAmino(object.pagination) : undefined - }; + const message = createBaseQueryPinnedCodesResponse(); + message.codeIds = object.code_ids?.map(e => BigInt(e)) || []; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromAmino(object.pagination); + } + return message; }, toAmino(message: QueryPinnedCodesResponse): QueryPinnedCodesResponseAmino { const obj: any = {}; @@ -2161,11 +2687,23 @@ export const QueryPinnedCodesResponse = { }; } }; +GlobalDecoderRegistry.register(QueryPinnedCodesResponse.typeUrl, QueryPinnedCodesResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryPinnedCodesResponse.aminoType, QueryPinnedCodesResponse.typeUrl); function createBaseQueryParamsRequest(): QueryParamsRequest { return {}; } export const QueryParamsRequest = { typeUrl: "/cosmwasm.wasm.v1.QueryParamsRequest", + aminoType: "wasm/QueryParamsRequest", + is(o: any): o is QueryParamsRequest { + return o && o.$typeUrl === QueryParamsRequest.typeUrl; + }, + isSDK(o: any): o is QueryParamsRequestSDKType { + return o && o.$typeUrl === QueryParamsRequest.typeUrl; + }, + isAmino(o: any): o is QueryParamsRequestAmino { + return o && o.$typeUrl === QueryParamsRequest.typeUrl; + }, encode(_: QueryParamsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, @@ -2183,12 +2721,20 @@ export const QueryParamsRequest = { } return message; }, + fromJSON(_: any): QueryParamsRequest { + return {}; + }, + toJSON(_: QueryParamsRequest): unknown { + const obj: any = {}; + return obj; + }, fromPartial(_: Partial): QueryParamsRequest { const message = createBaseQueryParamsRequest(); return message; }, fromAmino(_: QueryParamsRequestAmino): QueryParamsRequest { - return {}; + const message = createBaseQueryParamsRequest(); + return message; }, toAmino(_: QueryParamsRequest): QueryParamsRequestAmino { const obj: any = {}; @@ -2216,6 +2762,8 @@ export const QueryParamsRequest = { }; } }; +GlobalDecoderRegistry.register(QueryParamsRequest.typeUrl, QueryParamsRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryParamsRequest.aminoType, QueryParamsRequest.typeUrl); function createBaseQueryParamsResponse(): QueryParamsResponse { return { params: Params.fromPartial({}) @@ -2223,6 +2771,16 @@ function createBaseQueryParamsResponse(): QueryParamsResponse { } export const QueryParamsResponse = { typeUrl: "/cosmwasm.wasm.v1.QueryParamsResponse", + aminoType: "wasm/QueryParamsResponse", + is(o: any): o is QueryParamsResponse { + return o && (o.$typeUrl === QueryParamsResponse.typeUrl || Params.is(o.params)); + }, + isSDK(o: any): o is QueryParamsResponseSDKType { + return o && (o.$typeUrl === QueryParamsResponse.typeUrl || Params.isSDK(o.params)); + }, + isAmino(o: any): o is QueryParamsResponseAmino { + return o && (o.$typeUrl === QueryParamsResponse.typeUrl || Params.isAmino(o.params)); + }, encode(message: QueryParamsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.params !== undefined) { Params.encode(message.params, writer.uint32(10).fork()).ldelim(); @@ -2246,19 +2804,31 @@ export const QueryParamsResponse = { } return message; }, + fromJSON(object: any): QueryParamsResponse { + 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; + }, fromPartial(object: Partial): QueryParamsResponse { const message = createBaseQueryParamsResponse(); message.params = object.params !== undefined && object.params !== null ? Params.fromPartial(object.params) : undefined; return message; }, fromAmino(object: QueryParamsResponseAmino): QueryParamsResponse { - return { - params: object?.params ? Params.fromAmino(object.params) : undefined - }; + const message = createBaseQueryParamsResponse(); + if (object.params !== undefined && object.params !== null) { + message.params = Params.fromAmino(object.params); + } + return message; }, toAmino(message: QueryParamsResponse): QueryParamsResponseAmino { const obj: any = {}; - obj.params = message.params ? Params.toAmino(message.params) : undefined; + obj.params = message.params ? Params.toAmino(message.params) : Params.fromPartial({}); return obj; }, fromAminoMsg(object: QueryParamsResponseAminoMsg): QueryParamsResponse { @@ -2283,14 +2853,26 @@ export const QueryParamsResponse = { }; } }; +GlobalDecoderRegistry.register(QueryParamsResponse.typeUrl, QueryParamsResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryParamsResponse.aminoType, QueryParamsResponse.typeUrl); function createBaseQueryContractsByCreatorRequest(): QueryContractsByCreatorRequest { return { creatorAddress: "", - pagination: PageRequest.fromPartial({}) + pagination: undefined }; } export const QueryContractsByCreatorRequest = { typeUrl: "/cosmwasm.wasm.v1.QueryContractsByCreatorRequest", + aminoType: "wasm/QueryContractsByCreatorRequest", + is(o: any): o is QueryContractsByCreatorRequest { + return o && (o.$typeUrl === QueryContractsByCreatorRequest.typeUrl || typeof o.creatorAddress === "string"); + }, + isSDK(o: any): o is QueryContractsByCreatorRequestSDKType { + return o && (o.$typeUrl === QueryContractsByCreatorRequest.typeUrl || typeof o.creator_address === "string"); + }, + isAmino(o: any): o is QueryContractsByCreatorRequestAmino { + return o && (o.$typeUrl === QueryContractsByCreatorRequest.typeUrl || typeof o.creator_address === "string"); + }, encode(message: QueryContractsByCreatorRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.creatorAddress !== "") { writer.uint32(10).string(message.creatorAddress); @@ -2320,6 +2902,18 @@ export const QueryContractsByCreatorRequest = { } return message; }, + fromJSON(object: any): QueryContractsByCreatorRequest { + return { + creatorAddress: isSet(object.creatorAddress) ? String(object.creatorAddress) : "", + pagination: isSet(object.pagination) ? PageRequest.fromJSON(object.pagination) : undefined + }; + }, + toJSON(message: QueryContractsByCreatorRequest): unknown { + const obj: any = {}; + message.creatorAddress !== undefined && (obj.creatorAddress = message.creatorAddress); + message.pagination !== undefined && (obj.pagination = message.pagination ? PageRequest.toJSON(message.pagination) : undefined); + return obj; + }, fromPartial(object: Partial): QueryContractsByCreatorRequest { const message = createBaseQueryContractsByCreatorRequest(); message.creatorAddress = object.creatorAddress ?? ""; @@ -2327,10 +2921,14 @@ export const QueryContractsByCreatorRequest = { return message; }, fromAmino(object: QueryContractsByCreatorRequestAmino): QueryContractsByCreatorRequest { - return { - creatorAddress: object.creator_address, - pagination: object?.pagination ? PageRequest.fromAmino(object.pagination) : undefined - }; + const message = createBaseQueryContractsByCreatorRequest(); + if (object.creator_address !== undefined && object.creator_address !== null) { + message.creatorAddress = object.creator_address; + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromAmino(object.pagination); + } + return message; }, toAmino(message: QueryContractsByCreatorRequest): QueryContractsByCreatorRequestAmino { const obj: any = {}; @@ -2360,14 +2958,26 @@ export const QueryContractsByCreatorRequest = { }; } }; +GlobalDecoderRegistry.register(QueryContractsByCreatorRequest.typeUrl, QueryContractsByCreatorRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryContractsByCreatorRequest.aminoType, QueryContractsByCreatorRequest.typeUrl); function createBaseQueryContractsByCreatorResponse(): QueryContractsByCreatorResponse { return { contractAddresses: [], - pagination: PageResponse.fromPartial({}) + pagination: undefined }; } export const QueryContractsByCreatorResponse = { typeUrl: "/cosmwasm.wasm.v1.QueryContractsByCreatorResponse", + aminoType: "wasm/QueryContractsByCreatorResponse", + is(o: any): o is QueryContractsByCreatorResponse { + return o && (o.$typeUrl === QueryContractsByCreatorResponse.typeUrl || Array.isArray(o.contractAddresses) && (!o.contractAddresses.length || typeof o.contractAddresses[0] === "string")); + }, + isSDK(o: any): o is QueryContractsByCreatorResponseSDKType { + return o && (o.$typeUrl === QueryContractsByCreatorResponse.typeUrl || Array.isArray(o.contract_addresses) && (!o.contract_addresses.length || typeof o.contract_addresses[0] === "string")); + }, + isAmino(o: any): o is QueryContractsByCreatorResponseAmino { + return o && (o.$typeUrl === QueryContractsByCreatorResponse.typeUrl || Array.isArray(o.contract_addresses) && (!o.contract_addresses.length || typeof o.contract_addresses[0] === "string")); + }, encode(message: QueryContractsByCreatorResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.contractAddresses) { writer.uint32(10).string(v!); @@ -2397,6 +3007,22 @@ export const QueryContractsByCreatorResponse = { } return message; }, + fromJSON(object: any): QueryContractsByCreatorResponse { + return { + contractAddresses: Array.isArray(object?.contractAddresses) ? object.contractAddresses.map((e: any) => String(e)) : [], + pagination: isSet(object.pagination) ? PageResponse.fromJSON(object.pagination) : undefined + }; + }, + toJSON(message: QueryContractsByCreatorResponse): unknown { + const obj: any = {}; + if (message.contractAddresses) { + obj.contractAddresses = message.contractAddresses.map(e => e); + } else { + obj.contractAddresses = []; + } + message.pagination !== undefined && (obj.pagination = message.pagination ? PageResponse.toJSON(message.pagination) : undefined); + return obj; + }, fromPartial(object: Partial): QueryContractsByCreatorResponse { const message = createBaseQueryContractsByCreatorResponse(); message.contractAddresses = object.contractAddresses?.map(e => e) || []; @@ -2404,10 +3030,12 @@ export const QueryContractsByCreatorResponse = { return message; }, fromAmino(object: QueryContractsByCreatorResponseAmino): QueryContractsByCreatorResponse { - return { - contractAddresses: Array.isArray(object?.contract_addresses) ? object.contract_addresses.map((e: any) => e) : [], - pagination: object?.pagination ? PageResponse.fromAmino(object.pagination) : undefined - }; + const message = createBaseQueryContractsByCreatorResponse(); + message.contractAddresses = object.contract_addresses?.map(e => e) || []; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromAmino(object.pagination); + } + return message; }, toAmino(message: QueryContractsByCreatorResponse): QueryContractsByCreatorResponseAmino { const obj: any = {}; @@ -2440,4 +3068,6 @@ export const QueryContractsByCreatorResponse = { value: QueryContractsByCreatorResponse.encode(message).finish() }; } -}; \ No newline at end of file +}; +GlobalDecoderRegistry.register(QueryContractsByCreatorResponse.typeUrl, QueryContractsByCreatorResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryContractsByCreatorResponse.aminoType, QueryContractsByCreatorResponse.typeUrl); \ No newline at end of file diff --git a/packages/osmojs/src/codegen/cosmwasm/wasm/v1/tx.amino.ts b/packages/osmojs/src/codegen/cosmwasm/wasm/v1/tx.amino.ts index 2b9cd59b2..83c7a1ab9 100644 --- a/packages/osmojs/src/codegen/cosmwasm/wasm/v1/tx.amino.ts +++ b/packages/osmojs/src/codegen/cosmwasm/wasm/v1/tx.amino.ts @@ -1,5 +1,5 @@ //@ts-nocheck -import { MsgStoreCode, MsgInstantiateContract, MsgInstantiateContract2, MsgExecuteContract, MsgMigrateContract, MsgUpdateAdmin, MsgClearAdmin, MsgUpdateInstantiateConfig } from "./tx"; +import { MsgStoreCode, MsgInstantiateContract, MsgInstantiateContract2, MsgExecuteContract, MsgMigrateContract, MsgUpdateAdmin, MsgClearAdmin, MsgUpdateInstantiateConfig, MsgUpdateParams, MsgSudoContract, MsgPinCodes, MsgUnpinCodes, MsgStoreAndInstantiateContract, MsgRemoveCodeUploadParamsAddresses, MsgAddCodeUploadParamsAddresses, MsgStoreAndMigrateContract, MsgUpdateContractLabel } from "./tx"; export const AminoConverter = { "/cosmwasm.wasm.v1.MsgStoreCode": { aminoType: "wasm/MsgStoreCode", @@ -40,5 +40,50 @@ export const AminoConverter = { aminoType: "wasm/MsgUpdateInstantiateConfig", toAmino: MsgUpdateInstantiateConfig.toAmino, fromAmino: MsgUpdateInstantiateConfig.fromAmino + }, + "/cosmwasm.wasm.v1.MsgUpdateParams": { + aminoType: "wasm/MsgUpdateParams", + toAmino: MsgUpdateParams.toAmino, + fromAmino: MsgUpdateParams.fromAmino + }, + "/cosmwasm.wasm.v1.MsgSudoContract": { + aminoType: "wasm/MsgSudoContract", + toAmino: MsgSudoContract.toAmino, + fromAmino: MsgSudoContract.fromAmino + }, + "/cosmwasm.wasm.v1.MsgPinCodes": { + aminoType: "wasm/MsgPinCodes", + toAmino: MsgPinCodes.toAmino, + fromAmino: MsgPinCodes.fromAmino + }, + "/cosmwasm.wasm.v1.MsgUnpinCodes": { + aminoType: "wasm/MsgUnpinCodes", + toAmino: MsgUnpinCodes.toAmino, + fromAmino: MsgUnpinCodes.fromAmino + }, + "/cosmwasm.wasm.v1.MsgStoreAndInstantiateContract": { + aminoType: "wasm/MsgStoreAndInstantiateContract", + toAmino: MsgStoreAndInstantiateContract.toAmino, + fromAmino: MsgStoreAndInstantiateContract.fromAmino + }, + "/cosmwasm.wasm.v1.MsgRemoveCodeUploadParamsAddresses": { + aminoType: "wasm/MsgRemoveCodeUploadParamsAddresses", + toAmino: MsgRemoveCodeUploadParamsAddresses.toAmino, + fromAmino: MsgRemoveCodeUploadParamsAddresses.fromAmino + }, + "/cosmwasm.wasm.v1.MsgAddCodeUploadParamsAddresses": { + aminoType: "wasm/MsgAddCodeUploadParamsAddresses", + toAmino: MsgAddCodeUploadParamsAddresses.toAmino, + fromAmino: MsgAddCodeUploadParamsAddresses.fromAmino + }, + "/cosmwasm.wasm.v1.MsgStoreAndMigrateContract": { + aminoType: "wasm/MsgStoreAndMigrateContract", + toAmino: MsgStoreAndMigrateContract.toAmino, + fromAmino: MsgStoreAndMigrateContract.fromAmino + }, + "/cosmwasm.wasm.v1.MsgUpdateContractLabel": { + aminoType: "wasm/MsgUpdateContractLabel", + toAmino: MsgUpdateContractLabel.toAmino, + fromAmino: MsgUpdateContractLabel.fromAmino } }; \ No newline at end of file diff --git a/packages/osmojs/src/codegen/cosmwasm/wasm/v1/tx.registry.ts b/packages/osmojs/src/codegen/cosmwasm/wasm/v1/tx.registry.ts index 16b45c68b..a79f0f63c 100644 --- a/packages/osmojs/src/codegen/cosmwasm/wasm/v1/tx.registry.ts +++ b/packages/osmojs/src/codegen/cosmwasm/wasm/v1/tx.registry.ts @@ -1,7 +1,7 @@ //@ts-nocheck import { GeneratedType, Registry } from "@cosmjs/proto-signing"; -import { MsgStoreCode, MsgInstantiateContract, MsgInstantiateContract2, MsgExecuteContract, MsgMigrateContract, MsgUpdateAdmin, MsgClearAdmin, MsgUpdateInstantiateConfig } from "./tx"; -export const registry: ReadonlyArray<[string, GeneratedType]> = [["/cosmwasm.wasm.v1.MsgStoreCode", MsgStoreCode], ["/cosmwasm.wasm.v1.MsgInstantiateContract", MsgInstantiateContract], ["/cosmwasm.wasm.v1.MsgInstantiateContract2", MsgInstantiateContract2], ["/cosmwasm.wasm.v1.MsgExecuteContract", MsgExecuteContract], ["/cosmwasm.wasm.v1.MsgMigrateContract", MsgMigrateContract], ["/cosmwasm.wasm.v1.MsgUpdateAdmin", MsgUpdateAdmin], ["/cosmwasm.wasm.v1.MsgClearAdmin", MsgClearAdmin], ["/cosmwasm.wasm.v1.MsgUpdateInstantiateConfig", MsgUpdateInstantiateConfig]]; +import { MsgStoreCode, MsgInstantiateContract, MsgInstantiateContract2, MsgExecuteContract, MsgMigrateContract, MsgUpdateAdmin, MsgClearAdmin, MsgUpdateInstantiateConfig, MsgUpdateParams, MsgSudoContract, MsgPinCodes, MsgUnpinCodes, MsgStoreAndInstantiateContract, MsgRemoveCodeUploadParamsAddresses, MsgAddCodeUploadParamsAddresses, MsgStoreAndMigrateContract, MsgUpdateContractLabel } from "./tx"; +export const registry: ReadonlyArray<[string, GeneratedType]> = [["/cosmwasm.wasm.v1.MsgStoreCode", MsgStoreCode], ["/cosmwasm.wasm.v1.MsgInstantiateContract", MsgInstantiateContract], ["/cosmwasm.wasm.v1.MsgInstantiateContract2", MsgInstantiateContract2], ["/cosmwasm.wasm.v1.MsgExecuteContract", MsgExecuteContract], ["/cosmwasm.wasm.v1.MsgMigrateContract", MsgMigrateContract], ["/cosmwasm.wasm.v1.MsgUpdateAdmin", MsgUpdateAdmin], ["/cosmwasm.wasm.v1.MsgClearAdmin", MsgClearAdmin], ["/cosmwasm.wasm.v1.MsgUpdateInstantiateConfig", MsgUpdateInstantiateConfig], ["/cosmwasm.wasm.v1.MsgUpdateParams", MsgUpdateParams], ["/cosmwasm.wasm.v1.MsgSudoContract", MsgSudoContract], ["/cosmwasm.wasm.v1.MsgPinCodes", MsgPinCodes], ["/cosmwasm.wasm.v1.MsgUnpinCodes", MsgUnpinCodes], ["/cosmwasm.wasm.v1.MsgStoreAndInstantiateContract", MsgStoreAndInstantiateContract], ["/cosmwasm.wasm.v1.MsgRemoveCodeUploadParamsAddresses", MsgRemoveCodeUploadParamsAddresses], ["/cosmwasm.wasm.v1.MsgAddCodeUploadParamsAddresses", MsgAddCodeUploadParamsAddresses], ["/cosmwasm.wasm.v1.MsgStoreAndMigrateContract", MsgStoreAndMigrateContract], ["/cosmwasm.wasm.v1.MsgUpdateContractLabel", MsgUpdateContractLabel]]; export const load = (protoRegistry: Registry) => { registry.forEach(([typeUrl, mod]) => { protoRegistry.register(typeUrl, mod); @@ -56,6 +56,60 @@ export const MessageComposer = { typeUrl: "/cosmwasm.wasm.v1.MsgUpdateInstantiateConfig", value: MsgUpdateInstantiateConfig.encode(value).finish() }; + }, + updateParams(value: MsgUpdateParams) { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgUpdateParams", + value: MsgUpdateParams.encode(value).finish() + }; + }, + sudoContract(value: MsgSudoContract) { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgSudoContract", + value: MsgSudoContract.encode(value).finish() + }; + }, + pinCodes(value: MsgPinCodes) { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgPinCodes", + value: MsgPinCodes.encode(value).finish() + }; + }, + unpinCodes(value: MsgUnpinCodes) { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgUnpinCodes", + value: MsgUnpinCodes.encode(value).finish() + }; + }, + storeAndInstantiateContract(value: MsgStoreAndInstantiateContract) { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgStoreAndInstantiateContract", + value: MsgStoreAndInstantiateContract.encode(value).finish() + }; + }, + removeCodeUploadParamsAddresses(value: MsgRemoveCodeUploadParamsAddresses) { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgRemoveCodeUploadParamsAddresses", + value: MsgRemoveCodeUploadParamsAddresses.encode(value).finish() + }; + }, + addCodeUploadParamsAddresses(value: MsgAddCodeUploadParamsAddresses) { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgAddCodeUploadParamsAddresses", + value: MsgAddCodeUploadParamsAddresses.encode(value).finish() + }; + }, + storeAndMigrateContract(value: MsgStoreAndMigrateContract) { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgStoreAndMigrateContract", + value: MsgStoreAndMigrateContract.encode(value).finish() + }; + }, + updateContractLabel(value: MsgUpdateContractLabel) { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgUpdateContractLabel", + value: MsgUpdateContractLabel.encode(value).finish() + }; } }, withTypeUrl: { @@ -106,6 +160,268 @@ export const MessageComposer = { typeUrl: "/cosmwasm.wasm.v1.MsgUpdateInstantiateConfig", value }; + }, + updateParams(value: MsgUpdateParams) { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgUpdateParams", + value + }; + }, + sudoContract(value: MsgSudoContract) { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgSudoContract", + value + }; + }, + pinCodes(value: MsgPinCodes) { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgPinCodes", + value + }; + }, + unpinCodes(value: MsgUnpinCodes) { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgUnpinCodes", + value + }; + }, + storeAndInstantiateContract(value: MsgStoreAndInstantiateContract) { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgStoreAndInstantiateContract", + value + }; + }, + removeCodeUploadParamsAddresses(value: MsgRemoveCodeUploadParamsAddresses) { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgRemoveCodeUploadParamsAddresses", + value + }; + }, + addCodeUploadParamsAddresses(value: MsgAddCodeUploadParamsAddresses) { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgAddCodeUploadParamsAddresses", + value + }; + }, + storeAndMigrateContract(value: MsgStoreAndMigrateContract) { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgStoreAndMigrateContract", + value + }; + }, + updateContractLabel(value: MsgUpdateContractLabel) { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgUpdateContractLabel", + value + }; + } + }, + toJSON: { + storeCode(value: MsgStoreCode) { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgStoreCode", + value: MsgStoreCode.toJSON(value) + }; + }, + instantiateContract(value: MsgInstantiateContract) { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgInstantiateContract", + value: MsgInstantiateContract.toJSON(value) + }; + }, + instantiateContract2(value: MsgInstantiateContract2) { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgInstantiateContract2", + value: MsgInstantiateContract2.toJSON(value) + }; + }, + executeContract(value: MsgExecuteContract) { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", + value: MsgExecuteContract.toJSON(value) + }; + }, + migrateContract(value: MsgMigrateContract) { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgMigrateContract", + value: MsgMigrateContract.toJSON(value) + }; + }, + updateAdmin(value: MsgUpdateAdmin) { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgUpdateAdmin", + value: MsgUpdateAdmin.toJSON(value) + }; + }, + clearAdmin(value: MsgClearAdmin) { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgClearAdmin", + value: MsgClearAdmin.toJSON(value) + }; + }, + updateInstantiateConfig(value: MsgUpdateInstantiateConfig) { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgUpdateInstantiateConfig", + value: MsgUpdateInstantiateConfig.toJSON(value) + }; + }, + updateParams(value: MsgUpdateParams) { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgUpdateParams", + value: MsgUpdateParams.toJSON(value) + }; + }, + sudoContract(value: MsgSudoContract) { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgSudoContract", + value: MsgSudoContract.toJSON(value) + }; + }, + pinCodes(value: MsgPinCodes) { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgPinCodes", + value: MsgPinCodes.toJSON(value) + }; + }, + unpinCodes(value: MsgUnpinCodes) { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgUnpinCodes", + value: MsgUnpinCodes.toJSON(value) + }; + }, + storeAndInstantiateContract(value: MsgStoreAndInstantiateContract) { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgStoreAndInstantiateContract", + value: MsgStoreAndInstantiateContract.toJSON(value) + }; + }, + removeCodeUploadParamsAddresses(value: MsgRemoveCodeUploadParamsAddresses) { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgRemoveCodeUploadParamsAddresses", + value: MsgRemoveCodeUploadParamsAddresses.toJSON(value) + }; + }, + addCodeUploadParamsAddresses(value: MsgAddCodeUploadParamsAddresses) { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgAddCodeUploadParamsAddresses", + value: MsgAddCodeUploadParamsAddresses.toJSON(value) + }; + }, + storeAndMigrateContract(value: MsgStoreAndMigrateContract) { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgStoreAndMigrateContract", + value: MsgStoreAndMigrateContract.toJSON(value) + }; + }, + updateContractLabel(value: MsgUpdateContractLabel) { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgUpdateContractLabel", + value: MsgUpdateContractLabel.toJSON(value) + }; + } + }, + fromJSON: { + storeCode(value: any) { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgStoreCode", + value: MsgStoreCode.fromJSON(value) + }; + }, + instantiateContract(value: any) { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgInstantiateContract", + value: MsgInstantiateContract.fromJSON(value) + }; + }, + instantiateContract2(value: any) { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgInstantiateContract2", + value: MsgInstantiateContract2.fromJSON(value) + }; + }, + executeContract(value: any) { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", + value: MsgExecuteContract.fromJSON(value) + }; + }, + migrateContract(value: any) { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgMigrateContract", + value: MsgMigrateContract.fromJSON(value) + }; + }, + updateAdmin(value: any) { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgUpdateAdmin", + value: MsgUpdateAdmin.fromJSON(value) + }; + }, + clearAdmin(value: any) { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgClearAdmin", + value: MsgClearAdmin.fromJSON(value) + }; + }, + updateInstantiateConfig(value: any) { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgUpdateInstantiateConfig", + value: MsgUpdateInstantiateConfig.fromJSON(value) + }; + }, + updateParams(value: any) { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgUpdateParams", + value: MsgUpdateParams.fromJSON(value) + }; + }, + sudoContract(value: any) { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgSudoContract", + value: MsgSudoContract.fromJSON(value) + }; + }, + pinCodes(value: any) { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgPinCodes", + value: MsgPinCodes.fromJSON(value) + }; + }, + unpinCodes(value: any) { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgUnpinCodes", + value: MsgUnpinCodes.fromJSON(value) + }; + }, + storeAndInstantiateContract(value: any) { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgStoreAndInstantiateContract", + value: MsgStoreAndInstantiateContract.fromJSON(value) + }; + }, + removeCodeUploadParamsAddresses(value: any) { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgRemoveCodeUploadParamsAddresses", + value: MsgRemoveCodeUploadParamsAddresses.fromJSON(value) + }; + }, + addCodeUploadParamsAddresses(value: any) { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgAddCodeUploadParamsAddresses", + value: MsgAddCodeUploadParamsAddresses.fromJSON(value) + }; + }, + storeAndMigrateContract(value: any) { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgStoreAndMigrateContract", + value: MsgStoreAndMigrateContract.fromJSON(value) + }; + }, + updateContractLabel(value: any) { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgUpdateContractLabel", + value: MsgUpdateContractLabel.fromJSON(value) + }; } }, fromPartial: { @@ -156,6 +472,60 @@ export const MessageComposer = { typeUrl: "/cosmwasm.wasm.v1.MsgUpdateInstantiateConfig", value: MsgUpdateInstantiateConfig.fromPartial(value) }; + }, + updateParams(value: MsgUpdateParams) { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgUpdateParams", + value: MsgUpdateParams.fromPartial(value) + }; + }, + sudoContract(value: MsgSudoContract) { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgSudoContract", + value: MsgSudoContract.fromPartial(value) + }; + }, + pinCodes(value: MsgPinCodes) { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgPinCodes", + value: MsgPinCodes.fromPartial(value) + }; + }, + unpinCodes(value: MsgUnpinCodes) { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgUnpinCodes", + value: MsgUnpinCodes.fromPartial(value) + }; + }, + storeAndInstantiateContract(value: MsgStoreAndInstantiateContract) { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgStoreAndInstantiateContract", + value: MsgStoreAndInstantiateContract.fromPartial(value) + }; + }, + removeCodeUploadParamsAddresses(value: MsgRemoveCodeUploadParamsAddresses) { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgRemoveCodeUploadParamsAddresses", + value: MsgRemoveCodeUploadParamsAddresses.fromPartial(value) + }; + }, + addCodeUploadParamsAddresses(value: MsgAddCodeUploadParamsAddresses) { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgAddCodeUploadParamsAddresses", + value: MsgAddCodeUploadParamsAddresses.fromPartial(value) + }; + }, + storeAndMigrateContract(value: MsgStoreAndMigrateContract) { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgStoreAndMigrateContract", + value: MsgStoreAndMigrateContract.fromPartial(value) + }; + }, + updateContractLabel(value: MsgUpdateContractLabel) { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgUpdateContractLabel", + value: MsgUpdateContractLabel.fromPartial(value) + }; } } }; \ No newline at end of file diff --git a/packages/osmojs/src/codegen/cosmwasm/wasm/v1/tx.rpc.msg.ts b/packages/osmojs/src/codegen/cosmwasm/wasm/v1/tx.rpc.msg.ts index 7fdd8a748..5d68d4d1f 100644 --- a/packages/osmojs/src/codegen/cosmwasm/wasm/v1/tx.rpc.msg.ts +++ b/packages/osmojs/src/codegen/cosmwasm/wasm/v1/tx.rpc.msg.ts @@ -1,6 +1,6 @@ import { Rpc } from "../../../helpers"; import { BinaryReader } from "../../../binary"; -import { MsgStoreCode, MsgStoreCodeResponse, MsgInstantiateContract, MsgInstantiateContractResponse, MsgInstantiateContract2, MsgInstantiateContract2Response, MsgExecuteContract, MsgExecuteContractResponse, MsgMigrateContract, MsgMigrateContractResponse, MsgUpdateAdmin, MsgUpdateAdminResponse, MsgClearAdmin, MsgClearAdminResponse, MsgUpdateInstantiateConfig, MsgUpdateInstantiateConfigResponse } from "./tx"; +import { MsgStoreCode, MsgStoreCodeResponse, MsgInstantiateContract, MsgInstantiateContractResponse, MsgInstantiateContract2, MsgInstantiateContract2Response, MsgExecuteContract, MsgExecuteContractResponse, MsgMigrateContract, MsgMigrateContractResponse, MsgUpdateAdmin, MsgUpdateAdminResponse, MsgClearAdmin, MsgClearAdminResponse, MsgUpdateInstantiateConfig, MsgUpdateInstantiateConfigResponse, MsgUpdateParams, MsgUpdateParamsResponse, MsgSudoContract, MsgSudoContractResponse, MsgPinCodes, MsgPinCodesResponse, MsgUnpinCodes, MsgUnpinCodesResponse, MsgStoreAndInstantiateContract, MsgStoreAndInstantiateContractResponse, MsgRemoveCodeUploadParamsAddresses, MsgRemoveCodeUploadParamsAddressesResponse, MsgAddCodeUploadParamsAddresses, MsgAddCodeUploadParamsAddressesResponse, MsgStoreAndMigrateContract, MsgStoreAndMigrateContractResponse, MsgUpdateContractLabel, MsgUpdateContractLabelResponse } from "./tx"; /** Msg defines the wasm Msg service. */ export interface Msg { /** StoreCode to submit Wasm code to the system */ @@ -19,12 +19,72 @@ export interface Msg { executeContract(request: MsgExecuteContract): Promise; /** Migrate runs a code upgrade/ downgrade for a smart contract */ migrateContract(request: MsgMigrateContract): Promise; - /** UpdateAdmin sets a new admin for a smart contract */ + /** UpdateAdmin sets a new admin for a smart contract */ updateAdmin(request: MsgUpdateAdmin): Promise; /** ClearAdmin removes any admin stored for a smart contract */ clearAdmin(request: MsgClearAdmin): Promise; /** UpdateInstantiateConfig updates instantiate config for a smart contract */ updateInstantiateConfig(request: MsgUpdateInstantiateConfig): Promise; + /** + * UpdateParams defines a governance operation for updating the x/wasm + * module parameters. The authority is defined in the keeper. + * + * Since: 0.40 + */ + updateParams(request: MsgUpdateParams): Promise; + /** + * SudoContract defines a governance operation for calling sudo + * on a contract. The authority is defined in the keeper. + * + * Since: 0.40 + */ + sudoContract(request: MsgSudoContract): Promise; + /** + * PinCodes defines a governance operation for pinning a set of + * code ids in the wasmvm cache. The authority is defined in the keeper. + * + * Since: 0.40 + */ + pinCodes(request: MsgPinCodes): Promise; + /** + * UnpinCodes defines a governance operation for unpinning a set of + * code ids in the wasmvm cache. The authority is defined in the keeper. + * + * Since: 0.40 + */ + unpinCodes(request: MsgUnpinCodes): Promise; + /** + * StoreAndInstantiateContract defines a governance operation for storing + * and instantiating the contract. The authority is defined in the keeper. + * + * Since: 0.40 + */ + storeAndInstantiateContract(request: MsgStoreAndInstantiateContract): Promise; + /** + * RemoveCodeUploadParamsAddresses defines a governance operation for + * removing addresses from code upload params. + * The authority is defined in the keeper. + */ + removeCodeUploadParamsAddresses(request: MsgRemoveCodeUploadParamsAddresses): Promise; + /** + * AddCodeUploadParamsAddresses defines a governance operation for + * adding addresses to code upload params. + * The authority is defined in the keeper. + */ + addCodeUploadParamsAddresses(request: MsgAddCodeUploadParamsAddresses): Promise; + /** + * StoreAndMigrateContract defines a governance operation for storing + * and migrating the contract. The authority is defined in the keeper. + * + * Since: 0.42 + */ + storeAndMigrateContract(request: MsgStoreAndMigrateContract): Promise; + /** + * UpdateContractLabel sets a new label for a smart contract + * + * Since: 0.43 + */ + updateContractLabel(request: MsgUpdateContractLabel): Promise; } export class MsgClientImpl implements Msg { private readonly rpc: Rpc; @@ -38,6 +98,15 @@ export class MsgClientImpl implements Msg { this.updateAdmin = this.updateAdmin.bind(this); this.clearAdmin = this.clearAdmin.bind(this); this.updateInstantiateConfig = this.updateInstantiateConfig.bind(this); + this.updateParams = this.updateParams.bind(this); + this.sudoContract = this.sudoContract.bind(this); + this.pinCodes = this.pinCodes.bind(this); + this.unpinCodes = this.unpinCodes.bind(this); + this.storeAndInstantiateContract = this.storeAndInstantiateContract.bind(this); + this.removeCodeUploadParamsAddresses = this.removeCodeUploadParamsAddresses.bind(this); + this.addCodeUploadParamsAddresses = this.addCodeUploadParamsAddresses.bind(this); + this.storeAndMigrateContract = this.storeAndMigrateContract.bind(this); + this.updateContractLabel = this.updateContractLabel.bind(this); } storeCode(request: MsgStoreCode): Promise { const data = MsgStoreCode.encode(request).finish(); @@ -79,4 +148,52 @@ export class MsgClientImpl implements Msg { const promise = this.rpc.request("cosmwasm.wasm.v1.Msg", "UpdateInstantiateConfig", data); return promise.then(data => MsgUpdateInstantiateConfigResponse.decode(new BinaryReader(data))); } -} \ No newline at end of file + updateParams(request: MsgUpdateParams): Promise { + const data = MsgUpdateParams.encode(request).finish(); + const promise = this.rpc.request("cosmwasm.wasm.v1.Msg", "UpdateParams", data); + return promise.then(data => MsgUpdateParamsResponse.decode(new BinaryReader(data))); + } + sudoContract(request: MsgSudoContract): Promise { + const data = MsgSudoContract.encode(request).finish(); + const promise = this.rpc.request("cosmwasm.wasm.v1.Msg", "SudoContract", data); + return promise.then(data => MsgSudoContractResponse.decode(new BinaryReader(data))); + } + pinCodes(request: MsgPinCodes): Promise { + const data = MsgPinCodes.encode(request).finish(); + const promise = this.rpc.request("cosmwasm.wasm.v1.Msg", "PinCodes", data); + return promise.then(data => MsgPinCodesResponse.decode(new BinaryReader(data))); + } + unpinCodes(request: MsgUnpinCodes): Promise { + const data = MsgUnpinCodes.encode(request).finish(); + const promise = this.rpc.request("cosmwasm.wasm.v1.Msg", "UnpinCodes", data); + return promise.then(data => MsgUnpinCodesResponse.decode(new BinaryReader(data))); + } + storeAndInstantiateContract(request: MsgStoreAndInstantiateContract): Promise { + const data = MsgStoreAndInstantiateContract.encode(request).finish(); + const promise = this.rpc.request("cosmwasm.wasm.v1.Msg", "StoreAndInstantiateContract", data); + return promise.then(data => MsgStoreAndInstantiateContractResponse.decode(new BinaryReader(data))); + } + removeCodeUploadParamsAddresses(request: MsgRemoveCodeUploadParamsAddresses): Promise { + const data = MsgRemoveCodeUploadParamsAddresses.encode(request).finish(); + const promise = this.rpc.request("cosmwasm.wasm.v1.Msg", "RemoveCodeUploadParamsAddresses", data); + return promise.then(data => MsgRemoveCodeUploadParamsAddressesResponse.decode(new BinaryReader(data))); + } + addCodeUploadParamsAddresses(request: MsgAddCodeUploadParamsAddresses): Promise { + const data = MsgAddCodeUploadParamsAddresses.encode(request).finish(); + const promise = this.rpc.request("cosmwasm.wasm.v1.Msg", "AddCodeUploadParamsAddresses", data); + return promise.then(data => MsgAddCodeUploadParamsAddressesResponse.decode(new BinaryReader(data))); + } + storeAndMigrateContract(request: MsgStoreAndMigrateContract): Promise { + const data = MsgStoreAndMigrateContract.encode(request).finish(); + const promise = this.rpc.request("cosmwasm.wasm.v1.Msg", "StoreAndMigrateContract", data); + return promise.then(data => MsgStoreAndMigrateContractResponse.decode(new BinaryReader(data))); + } + updateContractLabel(request: MsgUpdateContractLabel): Promise { + const data = MsgUpdateContractLabel.encode(request).finish(); + const promise = this.rpc.request("cosmwasm.wasm.v1.Msg", "UpdateContractLabel", data); + return promise.then(data => MsgUpdateContractLabelResponse.decode(new BinaryReader(data))); + } +} +export const createClientImpl = (rpc: Rpc) => { + return new MsgClientImpl(rpc); +}; \ No newline at end of file diff --git a/packages/osmojs/src/codegen/cosmwasm/wasm/v1/tx.ts b/packages/osmojs/src/codegen/cosmwasm/wasm/v1/tx.ts index e5e760aab..c401fa10a 100644 --- a/packages/osmojs/src/codegen/cosmwasm/wasm/v1/tx.ts +++ b/packages/osmojs/src/codegen/cosmwasm/wasm/v1/tx.ts @@ -1,7 +1,9 @@ -import { AccessConfig, AccessConfigAmino, AccessConfigSDKType } from "./types"; +import { AccessConfig, AccessConfigAmino, AccessConfigSDKType, Params, ParamsAmino, ParamsSDKType } from "./types"; import { Coin, CoinAmino, CoinSDKType } from "../../../cosmos/base/v1beta1/coin"; import { BinaryReader, BinaryWriter } from "../../../binary"; +import { isSet, bytesFromBase64, base64FromBytes } from "../../../helpers"; import { fromBase64, toBase64, toUtf8, fromUtf8 } from "@cosmjs/encoding"; +import { GlobalDecoderRegistry } from "../../../registry"; /** MsgStoreCode submit Wasm code to the system */ export interface MsgStoreCode { /** Sender is the actor that signed the messages */ @@ -12,7 +14,7 @@ export interface MsgStoreCode { * InstantiatePermission access control to apply on contract creation, * optional */ - instantiatePermission: AccessConfig; + instantiatePermission?: AccessConfig; } export interface MsgStoreCodeProtoMsg { typeUrl: "/cosmwasm.wasm.v1.MsgStoreCode"; @@ -21,9 +23,9 @@ export interface MsgStoreCodeProtoMsg { /** MsgStoreCode submit Wasm code to the system */ export interface MsgStoreCodeAmino { /** Sender is the actor that signed the messages */ - sender: string; + sender?: string; /** WASMByteCode can be raw or gzip compressed */ - wasm_byte_code: string; + wasm_byte_code?: string; /** * InstantiatePermission access control to apply on contract creation, * optional @@ -38,7 +40,7 @@ export interface MsgStoreCodeAminoMsg { export interface MsgStoreCodeSDKType { sender: string; wasm_byte_code: Uint8Array; - instantiate_permission: AccessConfigSDKType; + instantiate_permission?: AccessConfigSDKType; } /** MsgStoreCodeResponse returns store result data. */ export interface MsgStoreCodeResponse { @@ -54,9 +56,9 @@ export interface MsgStoreCodeResponseProtoMsg { /** MsgStoreCodeResponse returns store result data. */ export interface MsgStoreCodeResponseAmino { /** CodeID is the reference to the stored WASM code */ - code_id: string; + code_id?: string; /** Checksum is the sha256 hash of the stored code */ - checksum: Uint8Array; + checksum?: string; } export interface MsgStoreCodeResponseAminoMsg { type: "wasm/MsgStoreCodeResponse"; @@ -95,15 +97,15 @@ export interface MsgInstantiateContractProtoMsg { */ export interface MsgInstantiateContractAmino { /** Sender is the that actor that signed the messages */ - sender: string; + sender?: string; /** Admin is an optional address that can execute migrations */ - admin: string; + admin?: string; /** CodeID is the reference to the stored WASM code */ - code_id: string; + code_id?: string; /** Label is optional metadata to be stored with a contract instance. */ - label: string; + label?: string; /** Msg json encoded message to be passed to the contract on instantiation */ - msg: Uint8Array; + msg?: any; /** Funds coins that are transferred to the contract on instantiation */ funds: CoinAmino[]; } @@ -123,6 +125,33 @@ export interface MsgInstantiateContractSDKType { msg: Uint8Array; funds: CoinSDKType[]; } +/** MsgInstantiateContractResponse return instantiation result data */ +export interface MsgInstantiateContractResponse { + /** Address is the bech32 address of the new contract instance. */ + address: string; + /** Data contains bytes to returned from the contract */ + data: Uint8Array; +} +export interface MsgInstantiateContractResponseProtoMsg { + typeUrl: "/cosmwasm.wasm.v1.MsgInstantiateContractResponse"; + value: Uint8Array; +} +/** MsgInstantiateContractResponse return instantiation result data */ +export interface MsgInstantiateContractResponseAmino { + /** Address is the bech32 address of the new contract instance. */ + address?: string; + /** Data contains bytes to returned from the contract */ + data?: string; +} +export interface MsgInstantiateContractResponseAminoMsg { + type: "wasm/MsgInstantiateContractResponse"; + value: MsgInstantiateContractResponseAmino; +} +/** MsgInstantiateContractResponse return instantiation result data */ +export interface MsgInstantiateContractResponseSDKType { + address: string; + data: Uint8Array; +} /** * MsgInstantiateContract2 create a new smart contract instance for the given * code id with a predicable address. @@ -158,24 +187,24 @@ export interface MsgInstantiateContract2ProtoMsg { */ export interface MsgInstantiateContract2Amino { /** Sender is the that actor that signed the messages */ - sender: string; + sender?: string; /** Admin is an optional address that can execute migrations */ - admin: string; + admin?: string; /** CodeID is the reference to the stored WASM code */ - code_id: string; + code_id?: string; /** Label is optional metadata to be stored with a contract instance. */ - label: string; + label?: string; /** Msg json encoded message to be passed to the contract on instantiation */ - msg: Uint8Array; + msg?: any; /** Funds coins that are transferred to the contract on instantiation */ funds: CoinAmino[]; /** Salt is an arbitrary value provided by the sender. Size can be 1 to 64. */ - salt: Uint8Array; + salt?: string; /** * FixMsg include the msg value into the hash for the predictable address. * Default is false */ - fix_msg: boolean; + fix_msg?: boolean; } export interface MsgInstantiateContract2AminoMsg { type: "wasm/MsgInstantiateContract2"; @@ -195,33 +224,6 @@ export interface MsgInstantiateContract2SDKType { salt: Uint8Array; fix_msg: boolean; } -/** MsgInstantiateContractResponse return instantiation result data */ -export interface MsgInstantiateContractResponse { - /** Address is the bech32 address of the new contract instance. */ - address: string; - /** Data contains bytes to returned from the contract */ - data: Uint8Array; -} -export interface MsgInstantiateContractResponseProtoMsg { - typeUrl: "/cosmwasm.wasm.v1.MsgInstantiateContractResponse"; - value: Uint8Array; -} -/** MsgInstantiateContractResponse return instantiation result data */ -export interface MsgInstantiateContractResponseAmino { - /** Address is the bech32 address of the new contract instance. */ - address: string; - /** Data contains bytes to returned from the contract */ - data: Uint8Array; -} -export interface MsgInstantiateContractResponseAminoMsg { - type: "wasm/MsgInstantiateContractResponse"; - value: MsgInstantiateContractResponseAmino; -} -/** MsgInstantiateContractResponse return instantiation result data */ -export interface MsgInstantiateContractResponseSDKType { - address: string; - data: Uint8Array; -} /** MsgInstantiateContract2Response return instantiation result data */ export interface MsgInstantiateContract2Response { /** Address is the bech32 address of the new contract instance. */ @@ -236,9 +238,9 @@ export interface MsgInstantiateContract2ResponseProtoMsg { /** MsgInstantiateContract2Response return instantiation result data */ export interface MsgInstantiateContract2ResponseAmino { /** Address is the bech32 address of the new contract instance. */ - address: string; + address?: string; /** Data contains bytes to returned from the contract */ - data: Uint8Array; + data?: string; } export interface MsgInstantiateContract2ResponseAminoMsg { type: "wasm/MsgInstantiateContract2Response"; @@ -267,11 +269,11 @@ export interface MsgExecuteContractProtoMsg { /** MsgExecuteContract submits the given message data to a smart contract */ export interface MsgExecuteContractAmino { /** Sender is the that actor that signed the messages */ - sender: string; + sender?: string; /** Contract is the address of the smart contract */ - contract: string; + contract?: string; /** Msg json encoded message to be passed to the contract */ - msg: Uint8Array; + msg?: any; /** Funds coins that are transferred to the contract on execution */ funds: CoinAmino[]; } @@ -298,7 +300,7 @@ export interface MsgExecuteContractResponseProtoMsg { /** MsgExecuteContractResponse returns execution result data. */ export interface MsgExecuteContractResponseAmino { /** Data contains bytes to returned from the contract */ - data: Uint8Array; + data?: string; } export interface MsgExecuteContractResponseAminoMsg { type: "wasm/MsgExecuteContractResponse"; @@ -326,13 +328,13 @@ export interface MsgMigrateContractProtoMsg { /** MsgMigrateContract runs a code upgrade/ downgrade for a smart contract */ export interface MsgMigrateContractAmino { /** Sender is the that actor that signed the messages */ - sender: string; + sender?: string; /** Contract is the address of the smart contract */ - contract: string; + contract?: string; /** CodeID references the new WASM code */ - code_id: string; + code_id?: string; /** Msg json encoded message to be passed to the contract on migration */ - msg: Uint8Array; + msg?: any; } export interface MsgMigrateContractAminoMsg { type: "wasm/MsgMigrateContract"; @@ -363,7 +365,7 @@ export interface MsgMigrateContractResponseAmino { * Data contains same raw bytes returned as data from the wasm contract. * (May be empty) */ - data: Uint8Array; + data?: string; } export interface MsgMigrateContractResponseAminoMsg { type: "wasm/MsgMigrateContractResponse"; @@ -389,11 +391,11 @@ export interface MsgUpdateAdminProtoMsg { /** MsgUpdateAdmin sets a new admin for a smart contract */ export interface MsgUpdateAdminAmino { /** Sender is the that actor that signed the messages */ - sender: string; + sender?: string; /** NewAdmin address to be set */ - new_admin: string; + new_admin?: string; /** Contract is the address of the smart contract */ - contract: string; + contract?: string; } export interface MsgUpdateAdminAminoMsg { type: "wasm/MsgUpdateAdmin"; @@ -433,9 +435,9 @@ export interface MsgClearAdminProtoMsg { /** MsgClearAdmin removes any admin stored for a smart contract */ export interface MsgClearAdminAmino { /** Sender is the actor that signed the messages */ - sender: string; + sender?: string; /** Contract is the address of the smart contract */ - contract: string; + contract?: string; } export interface MsgClearAdminAminoMsg { type: "wasm/MsgClearAdmin"; @@ -467,7 +469,7 @@ export interface MsgUpdateInstantiateConfig { /** CodeID references the stored WASM code */ codeId: bigint; /** NewInstantiatePermission is the new access control */ - newInstantiatePermission: AccessConfig; + newInstantiatePermission?: AccessConfig; } export interface MsgUpdateInstantiateConfigProtoMsg { typeUrl: "/cosmwasm.wasm.v1.MsgUpdateInstantiateConfig"; @@ -476,9 +478,9 @@ export interface MsgUpdateInstantiateConfigProtoMsg { /** MsgUpdateInstantiateConfig updates instantiate config for a smart contract */ export interface MsgUpdateInstantiateConfigAmino { /** Sender is the that actor that signed the messages */ - sender: string; + sender?: string; /** CodeID references the stored WASM code */ - code_id: string; + code_id?: string; /** NewInstantiatePermission is the new access control */ new_instantiate_permission?: AccessConfigAmino; } @@ -490,7 +492,7 @@ export interface MsgUpdateInstantiateConfigAminoMsg { export interface MsgUpdateInstantiateConfigSDKType { sender: string; code_id: bigint; - new_instantiate_permission: AccessConfigSDKType; + new_instantiate_permission?: AccessConfigSDKType; } /** MsgUpdateInstantiateConfigResponse returns empty data */ export interface MsgUpdateInstantiateConfigResponse {} @@ -506,228 +508,2761 @@ export interface MsgUpdateInstantiateConfigResponseAminoMsg { } /** MsgUpdateInstantiateConfigResponse returns empty data */ export interface MsgUpdateInstantiateConfigResponseSDKType {} -function createBaseMsgStoreCode(): MsgStoreCode { - return { - sender: "", - wasmByteCode: new Uint8Array(), - instantiatePermission: AccessConfig.fromPartial({}) - }; +/** + * MsgUpdateParams is the MsgUpdateParams request type. + * + * Since: 0.40 + */ +export interface MsgUpdateParams { + /** Authority is the address of the governance account. */ + authority: string; + /** + * params defines the x/wasm parameters to update. + * + * NOTE: All parameters must be supplied. + */ + params: Params; } -export const MsgStoreCode = { - typeUrl: "/cosmwasm.wasm.v1.MsgStoreCode", - encode(message: MsgStoreCode, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { - if (message.sender !== "") { - writer.uint32(10).string(message.sender); - } - if (message.wasmByteCode.length !== 0) { - writer.uint32(18).bytes(message.wasmByteCode); - } - if (message.instantiatePermission !== undefined) { - AccessConfig.encode(message.instantiatePermission, writer.uint32(42).fork()).ldelim(); - } - return writer; - }, - decode(input: BinaryReader | Uint8Array, length?: number): MsgStoreCode { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseMsgStoreCode(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.sender = reader.string(); - break; - case 2: - message.wasmByteCode = reader.bytes(); - break; - case 5: - message.instantiatePermission = AccessConfig.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - fromPartial(object: Partial): MsgStoreCode { - const message = createBaseMsgStoreCode(); - message.sender = object.sender ?? ""; - message.wasmByteCode = object.wasmByteCode ?? new Uint8Array(); - message.instantiatePermission = object.instantiatePermission !== undefined && object.instantiatePermission !== null ? AccessConfig.fromPartial(object.instantiatePermission) : undefined; - return message; - }, - fromAmino(object: MsgStoreCodeAmino): MsgStoreCode { - return { - sender: object.sender, - wasmByteCode: fromBase64(object.wasm_byte_code), - instantiatePermission: object?.instantiate_permission ? AccessConfig.fromAmino(object.instantiate_permission) : undefined - }; - }, - toAmino(message: MsgStoreCode): MsgStoreCodeAmino { - const obj: any = {}; - obj.sender = message.sender; - obj.wasm_byte_code = message.wasmByteCode ? toBase64(message.wasmByteCode) : undefined; - obj.instantiate_permission = message.instantiatePermission ? AccessConfig.toAmino(message.instantiatePermission) : undefined; - return obj; - }, - fromAminoMsg(object: MsgStoreCodeAminoMsg): MsgStoreCode { - return MsgStoreCode.fromAmino(object.value); - }, - toAminoMsg(message: MsgStoreCode): MsgStoreCodeAminoMsg { - return { - type: "wasm/MsgStoreCode", - value: MsgStoreCode.toAmino(message) - }; - }, - fromProtoMsg(message: MsgStoreCodeProtoMsg): MsgStoreCode { - return MsgStoreCode.decode(message.value); - }, - toProto(message: MsgStoreCode): Uint8Array { - return MsgStoreCode.encode(message).finish(); - }, - toProtoMsg(message: MsgStoreCode): MsgStoreCodeProtoMsg { - return { - typeUrl: "/cosmwasm.wasm.v1.MsgStoreCode", - value: MsgStoreCode.encode(message).finish() - }; - } -}; -function createBaseMsgStoreCodeResponse(): MsgStoreCodeResponse { - return { - codeId: BigInt(0), - checksum: new Uint8Array() - }; +export interface MsgUpdateParamsProtoMsg { + typeUrl: "/cosmwasm.wasm.v1.MsgUpdateParams"; + value: Uint8Array; } -export const MsgStoreCodeResponse = { - typeUrl: "/cosmwasm.wasm.v1.MsgStoreCodeResponse", - encode(message: MsgStoreCodeResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { - if (message.codeId !== BigInt(0)) { - writer.uint32(8).uint64(message.codeId); - } - if (message.checksum.length !== 0) { - writer.uint32(18).bytes(message.checksum); - } - return writer; - }, - decode(input: BinaryReader | Uint8Array, length?: number): MsgStoreCodeResponse { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseMsgStoreCodeResponse(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.codeId = reader.uint64(); - break; - case 2: - message.checksum = reader.bytes(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - fromPartial(object: Partial): MsgStoreCodeResponse { - const message = createBaseMsgStoreCodeResponse(); - message.codeId = object.codeId !== undefined && object.codeId !== null ? BigInt(object.codeId.toString()) : BigInt(0); - message.checksum = object.checksum ?? new Uint8Array(); - return message; - }, - fromAmino(object: MsgStoreCodeResponseAmino): MsgStoreCodeResponse { - return { - codeId: BigInt(object.code_id), - checksum: object.checksum - }; - }, - toAmino(message: MsgStoreCodeResponse): MsgStoreCodeResponseAmino { - const obj: any = {}; - obj.code_id = message.codeId ? message.codeId.toString() : undefined; - obj.checksum = message.checksum; - return obj; - }, - fromAminoMsg(object: MsgStoreCodeResponseAminoMsg): MsgStoreCodeResponse { - return MsgStoreCodeResponse.fromAmino(object.value); - }, - toAminoMsg(message: MsgStoreCodeResponse): MsgStoreCodeResponseAminoMsg { - return { - type: "wasm/MsgStoreCodeResponse", - value: MsgStoreCodeResponse.toAmino(message) - }; - }, - fromProtoMsg(message: MsgStoreCodeResponseProtoMsg): MsgStoreCodeResponse { - return MsgStoreCodeResponse.decode(message.value); - }, - toProto(message: MsgStoreCodeResponse): Uint8Array { - return MsgStoreCodeResponse.encode(message).finish(); - }, - toProtoMsg(message: MsgStoreCodeResponse): MsgStoreCodeResponseProtoMsg { - return { - typeUrl: "/cosmwasm.wasm.v1.MsgStoreCodeResponse", - value: MsgStoreCodeResponse.encode(message).finish() - }; - } -}; -function createBaseMsgInstantiateContract(): MsgInstantiateContract { - return { - sender: "", - admin: "", - codeId: BigInt(0), - label: "", - msg: new Uint8Array(), - funds: [] - }; +/** + * MsgUpdateParams is the MsgUpdateParams request type. + * + * Since: 0.40 + */ +export interface MsgUpdateParamsAmino { + /** Authority is the address of the governance account. */ + authority?: string; + /** + * params defines the x/wasm parameters to update. + * + * NOTE: All parameters must be supplied. + */ + params: ParamsAmino; } -export const MsgInstantiateContract = { - typeUrl: "/cosmwasm.wasm.v1.MsgInstantiateContract", - encode(message: MsgInstantiateContract, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { +export interface MsgUpdateParamsAminoMsg { + type: "wasm/MsgUpdateParams"; + value: MsgUpdateParamsAmino; +} +/** + * MsgUpdateParams is the MsgUpdateParams request type. + * + * Since: 0.40 + */ +export interface MsgUpdateParamsSDKType { + authority: string; + params: ParamsSDKType; +} +/** + * MsgUpdateParamsResponse defines the response structure for executing a + * MsgUpdateParams message. + * + * Since: 0.40 + */ +export interface MsgUpdateParamsResponse {} +export interface MsgUpdateParamsResponseProtoMsg { + typeUrl: "/cosmwasm.wasm.v1.MsgUpdateParamsResponse"; + value: Uint8Array; +} +/** + * MsgUpdateParamsResponse defines the response structure for executing a + * MsgUpdateParams message. + * + * Since: 0.40 + */ +export interface MsgUpdateParamsResponseAmino {} +export interface MsgUpdateParamsResponseAminoMsg { + type: "wasm/MsgUpdateParamsResponse"; + value: MsgUpdateParamsResponseAmino; +} +/** + * MsgUpdateParamsResponse defines the response structure for executing a + * MsgUpdateParams message. + * + * Since: 0.40 + */ +export interface MsgUpdateParamsResponseSDKType {} +/** + * MsgSudoContract is the MsgSudoContract request type. + * + * Since: 0.40 + */ +export interface MsgSudoContract { + /** Authority is the address of the governance account. */ + authority: string; + /** Contract is the address of the smart contract */ + contract: string; + /** Msg json encoded message to be passed to the contract as sudo */ + msg: Uint8Array; +} +export interface MsgSudoContractProtoMsg { + typeUrl: "/cosmwasm.wasm.v1.MsgSudoContract"; + value: Uint8Array; +} +/** + * MsgSudoContract is the MsgSudoContract request type. + * + * Since: 0.40 + */ +export interface MsgSudoContractAmino { + /** Authority is the address of the governance account. */ + authority?: string; + /** Contract is the address of the smart contract */ + contract?: string; + /** Msg json encoded message to be passed to the contract as sudo */ + msg?: any; +} +export interface MsgSudoContractAminoMsg { + type: "wasm/MsgSudoContract"; + value: MsgSudoContractAmino; +} +/** + * MsgSudoContract is the MsgSudoContract request type. + * + * Since: 0.40 + */ +export interface MsgSudoContractSDKType { + authority: string; + contract: string; + msg: Uint8Array; +} +/** + * MsgSudoContractResponse defines the response structure for executing a + * MsgSudoContract message. + * + * Since: 0.40 + */ +export interface MsgSudoContractResponse { + /** Data contains bytes to returned from the contract */ + data: Uint8Array; +} +export interface MsgSudoContractResponseProtoMsg { + typeUrl: "/cosmwasm.wasm.v1.MsgSudoContractResponse"; + value: Uint8Array; +} +/** + * MsgSudoContractResponse defines the response structure for executing a + * MsgSudoContract message. + * + * Since: 0.40 + */ +export interface MsgSudoContractResponseAmino { + /** Data contains bytes to returned from the contract */ + data?: string; +} +export interface MsgSudoContractResponseAminoMsg { + type: "wasm/MsgSudoContractResponse"; + value: MsgSudoContractResponseAmino; +} +/** + * MsgSudoContractResponse defines the response structure for executing a + * MsgSudoContract message. + * + * Since: 0.40 + */ +export interface MsgSudoContractResponseSDKType { + data: Uint8Array; +} +/** + * MsgPinCodes is the MsgPinCodes request type. + * + * Since: 0.40 + */ +export interface MsgPinCodes { + /** Authority is the address of the governance account. */ + authority: string; + /** CodeIDs references the new WASM codes */ + codeIds: bigint[]; +} +export interface MsgPinCodesProtoMsg { + typeUrl: "/cosmwasm.wasm.v1.MsgPinCodes"; + value: Uint8Array; +} +/** + * MsgPinCodes is the MsgPinCodes request type. + * + * Since: 0.40 + */ +export interface MsgPinCodesAmino { + /** Authority is the address of the governance account. */ + authority?: string; + /** CodeIDs references the new WASM codes */ + code_ids?: string[]; +} +export interface MsgPinCodesAminoMsg { + type: "wasm/MsgPinCodes"; + value: MsgPinCodesAmino; +} +/** + * MsgPinCodes is the MsgPinCodes request type. + * + * Since: 0.40 + */ +export interface MsgPinCodesSDKType { + authority: string; + code_ids: bigint[]; +} +/** + * MsgPinCodesResponse defines the response structure for executing a + * MsgPinCodes message. + * + * Since: 0.40 + */ +export interface MsgPinCodesResponse {} +export interface MsgPinCodesResponseProtoMsg { + typeUrl: "/cosmwasm.wasm.v1.MsgPinCodesResponse"; + value: Uint8Array; +} +/** + * MsgPinCodesResponse defines the response structure for executing a + * MsgPinCodes message. + * + * Since: 0.40 + */ +export interface MsgPinCodesResponseAmino {} +export interface MsgPinCodesResponseAminoMsg { + type: "wasm/MsgPinCodesResponse"; + value: MsgPinCodesResponseAmino; +} +/** + * MsgPinCodesResponse defines the response structure for executing a + * MsgPinCodes message. + * + * Since: 0.40 + */ +export interface MsgPinCodesResponseSDKType {} +/** + * MsgUnpinCodes is the MsgUnpinCodes request type. + * + * Since: 0.40 + */ +export interface MsgUnpinCodes { + /** Authority is the address of the governance account. */ + authority: string; + /** CodeIDs references the WASM codes */ + codeIds: bigint[]; +} +export interface MsgUnpinCodesProtoMsg { + typeUrl: "/cosmwasm.wasm.v1.MsgUnpinCodes"; + value: Uint8Array; +} +/** + * MsgUnpinCodes is the MsgUnpinCodes request type. + * + * Since: 0.40 + */ +export interface MsgUnpinCodesAmino { + /** Authority is the address of the governance account. */ + authority?: string; + /** CodeIDs references the WASM codes */ + code_ids?: string[]; +} +export interface MsgUnpinCodesAminoMsg { + type: "wasm/MsgUnpinCodes"; + value: MsgUnpinCodesAmino; +} +/** + * MsgUnpinCodes is the MsgUnpinCodes request type. + * + * Since: 0.40 + */ +export interface MsgUnpinCodesSDKType { + authority: string; + code_ids: bigint[]; +} +/** + * MsgUnpinCodesResponse defines the response structure for executing a + * MsgUnpinCodes message. + * + * Since: 0.40 + */ +export interface MsgUnpinCodesResponse {} +export interface MsgUnpinCodesResponseProtoMsg { + typeUrl: "/cosmwasm.wasm.v1.MsgUnpinCodesResponse"; + value: Uint8Array; +} +/** + * MsgUnpinCodesResponse defines the response structure for executing a + * MsgUnpinCodes message. + * + * Since: 0.40 + */ +export interface MsgUnpinCodesResponseAmino {} +export interface MsgUnpinCodesResponseAminoMsg { + type: "wasm/MsgUnpinCodesResponse"; + value: MsgUnpinCodesResponseAmino; +} +/** + * MsgUnpinCodesResponse defines the response structure for executing a + * MsgUnpinCodes message. + * + * Since: 0.40 + */ +export interface MsgUnpinCodesResponseSDKType {} +/** + * MsgStoreAndInstantiateContract is the MsgStoreAndInstantiateContract + * request type. + * + * Since: 0.40 + */ +export interface MsgStoreAndInstantiateContract { + /** Authority is the address of the governance account. */ + authority: string; + /** WASMByteCode can be raw or gzip compressed */ + wasmByteCode: Uint8Array; + /** InstantiatePermission to apply on contract creation, optional */ + instantiatePermission?: AccessConfig; + /** + * UnpinCode code on upload, optional. As default the uploaded contract is + * pinned to cache. + */ + unpinCode: boolean; + /** Admin is an optional address that can execute migrations */ + admin: string; + /** Label is optional metadata to be stored with a constract instance. */ + label: string; + /** Msg json encoded message to be passed to the contract on instantiation */ + msg: Uint8Array; + /** + * Funds coins that are transferred from the authority account to the contract + * on instantiation + */ + funds: Coin[]; + /** Source is the URL where the code is hosted */ + source: string; + /** + * Builder is the docker image used to build the code deterministically, used + * for smart contract verification + */ + builder: string; + /** + * CodeHash is the SHA256 sum of the code outputted by builder, used for smart + * contract verification + */ + codeHash: Uint8Array; +} +export interface MsgStoreAndInstantiateContractProtoMsg { + typeUrl: "/cosmwasm.wasm.v1.MsgStoreAndInstantiateContract"; + value: Uint8Array; +} +/** + * MsgStoreAndInstantiateContract is the MsgStoreAndInstantiateContract + * request type. + * + * Since: 0.40 + */ +export interface MsgStoreAndInstantiateContractAmino { + /** Authority is the address of the governance account. */ + authority?: string; + /** WASMByteCode can be raw or gzip compressed */ + wasm_byte_code?: string; + /** InstantiatePermission to apply on contract creation, optional */ + instantiate_permission?: AccessConfigAmino; + /** + * UnpinCode code on upload, optional. As default the uploaded contract is + * pinned to cache. + */ + unpin_code?: boolean; + /** Admin is an optional address that can execute migrations */ + admin?: string; + /** Label is optional metadata to be stored with a constract instance. */ + label?: string; + /** Msg json encoded message to be passed to the contract on instantiation */ + msg?: any; + /** + * Funds coins that are transferred from the authority account to the contract + * on instantiation + */ + funds: CoinAmino[]; + /** Source is the URL where the code is hosted */ + source?: string; + /** + * Builder is the docker image used to build the code deterministically, used + * for smart contract verification + */ + builder?: string; + /** + * CodeHash is the SHA256 sum of the code outputted by builder, used for smart + * contract verification + */ + code_hash?: string; +} +export interface MsgStoreAndInstantiateContractAminoMsg { + type: "wasm/MsgStoreAndInstantiateContract"; + value: MsgStoreAndInstantiateContractAmino; +} +/** + * MsgStoreAndInstantiateContract is the MsgStoreAndInstantiateContract + * request type. + * + * Since: 0.40 + */ +export interface MsgStoreAndInstantiateContractSDKType { + authority: string; + wasm_byte_code: Uint8Array; + instantiate_permission?: AccessConfigSDKType; + unpin_code: boolean; + admin: string; + label: string; + msg: Uint8Array; + funds: CoinSDKType[]; + source: string; + builder: string; + code_hash: Uint8Array; +} +/** + * MsgStoreAndInstantiateContractResponse defines the response structure + * for executing a MsgStoreAndInstantiateContract message. + * + * Since: 0.40 + */ +export interface MsgStoreAndInstantiateContractResponse { + /** Address is the bech32 address of the new contract instance. */ + address: string; + /** Data contains bytes to returned from the contract */ + data: Uint8Array; +} +export interface MsgStoreAndInstantiateContractResponseProtoMsg { + typeUrl: "/cosmwasm.wasm.v1.MsgStoreAndInstantiateContractResponse"; + value: Uint8Array; +} +/** + * MsgStoreAndInstantiateContractResponse defines the response structure + * for executing a MsgStoreAndInstantiateContract message. + * + * Since: 0.40 + */ +export interface MsgStoreAndInstantiateContractResponseAmino { + /** Address is the bech32 address of the new contract instance. */ + address?: string; + /** Data contains bytes to returned from the contract */ + data?: string; +} +export interface MsgStoreAndInstantiateContractResponseAminoMsg { + type: "wasm/MsgStoreAndInstantiateContractResponse"; + value: MsgStoreAndInstantiateContractResponseAmino; +} +/** + * MsgStoreAndInstantiateContractResponse defines the response structure + * for executing a MsgStoreAndInstantiateContract message. + * + * Since: 0.40 + */ +export interface MsgStoreAndInstantiateContractResponseSDKType { + address: string; + data: Uint8Array; +} +/** + * MsgAddCodeUploadParamsAddresses is the + * MsgAddCodeUploadParamsAddresses request type. + */ +export interface MsgAddCodeUploadParamsAddresses { + /** Authority is the address of the governance account. */ + authority: string; + addresses: string[]; +} +export interface MsgAddCodeUploadParamsAddressesProtoMsg { + typeUrl: "/cosmwasm.wasm.v1.MsgAddCodeUploadParamsAddresses"; + value: Uint8Array; +} +/** + * MsgAddCodeUploadParamsAddresses is the + * MsgAddCodeUploadParamsAddresses request type. + */ +export interface MsgAddCodeUploadParamsAddressesAmino { + /** Authority is the address of the governance account. */ + authority?: string; + addresses?: string[]; +} +export interface MsgAddCodeUploadParamsAddressesAminoMsg { + type: "wasm/MsgAddCodeUploadParamsAddresses"; + value: MsgAddCodeUploadParamsAddressesAmino; +} +/** + * MsgAddCodeUploadParamsAddresses is the + * MsgAddCodeUploadParamsAddresses request type. + */ +export interface MsgAddCodeUploadParamsAddressesSDKType { + authority: string; + addresses: string[]; +} +/** + * MsgAddCodeUploadParamsAddressesResponse defines the response + * structure for executing a MsgAddCodeUploadParamsAddresses message. + */ +export interface MsgAddCodeUploadParamsAddressesResponse {} +export interface MsgAddCodeUploadParamsAddressesResponseProtoMsg { + typeUrl: "/cosmwasm.wasm.v1.MsgAddCodeUploadParamsAddressesResponse"; + value: Uint8Array; +} +/** + * MsgAddCodeUploadParamsAddressesResponse defines the response + * structure for executing a MsgAddCodeUploadParamsAddresses message. + */ +export interface MsgAddCodeUploadParamsAddressesResponseAmino {} +export interface MsgAddCodeUploadParamsAddressesResponseAminoMsg { + type: "wasm/MsgAddCodeUploadParamsAddressesResponse"; + value: MsgAddCodeUploadParamsAddressesResponseAmino; +} +/** + * MsgAddCodeUploadParamsAddressesResponse defines the response + * structure for executing a MsgAddCodeUploadParamsAddresses message. + */ +export interface MsgAddCodeUploadParamsAddressesResponseSDKType {} +/** + * MsgRemoveCodeUploadParamsAddresses is the + * MsgRemoveCodeUploadParamsAddresses request type. + */ +export interface MsgRemoveCodeUploadParamsAddresses { + /** Authority is the address of the governance account. */ + authority: string; + addresses: string[]; +} +export interface MsgRemoveCodeUploadParamsAddressesProtoMsg { + typeUrl: "/cosmwasm.wasm.v1.MsgRemoveCodeUploadParamsAddresses"; + value: Uint8Array; +} +/** + * MsgRemoveCodeUploadParamsAddresses is the + * MsgRemoveCodeUploadParamsAddresses request type. + */ +export interface MsgRemoveCodeUploadParamsAddressesAmino { + /** Authority is the address of the governance account. */ + authority?: string; + addresses?: string[]; +} +export interface MsgRemoveCodeUploadParamsAddressesAminoMsg { + type: "wasm/MsgRemoveCodeUploadParamsAddresses"; + value: MsgRemoveCodeUploadParamsAddressesAmino; +} +/** + * MsgRemoveCodeUploadParamsAddresses is the + * MsgRemoveCodeUploadParamsAddresses request type. + */ +export interface MsgRemoveCodeUploadParamsAddressesSDKType { + authority: string; + addresses: string[]; +} +/** + * MsgRemoveCodeUploadParamsAddressesResponse defines the response + * structure for executing a MsgRemoveCodeUploadParamsAddresses message. + */ +export interface MsgRemoveCodeUploadParamsAddressesResponse {} +export interface MsgRemoveCodeUploadParamsAddressesResponseProtoMsg { + typeUrl: "/cosmwasm.wasm.v1.MsgRemoveCodeUploadParamsAddressesResponse"; + value: Uint8Array; +} +/** + * MsgRemoveCodeUploadParamsAddressesResponse defines the response + * structure for executing a MsgRemoveCodeUploadParamsAddresses message. + */ +export interface MsgRemoveCodeUploadParamsAddressesResponseAmino {} +export interface MsgRemoveCodeUploadParamsAddressesResponseAminoMsg { + type: "wasm/MsgRemoveCodeUploadParamsAddressesResponse"; + value: MsgRemoveCodeUploadParamsAddressesResponseAmino; +} +/** + * MsgRemoveCodeUploadParamsAddressesResponse defines the response + * structure for executing a MsgRemoveCodeUploadParamsAddresses message. + */ +export interface MsgRemoveCodeUploadParamsAddressesResponseSDKType {} +/** + * MsgStoreAndMigrateContract is the MsgStoreAndMigrateContract + * request type. + * + * Since: 0.42 + */ +export interface MsgStoreAndMigrateContract { + /** Authority is the address of the governance account. */ + authority: string; + /** WASMByteCode can be raw or gzip compressed */ + wasmByteCode: Uint8Array; + /** InstantiatePermission to apply on contract creation, optional */ + instantiatePermission?: AccessConfig; + /** Contract is the address of the smart contract */ + contract: string; + /** Msg json encoded message to be passed to the contract on migration */ + msg: Uint8Array; +} +export interface MsgStoreAndMigrateContractProtoMsg { + typeUrl: "/cosmwasm.wasm.v1.MsgStoreAndMigrateContract"; + value: Uint8Array; +} +/** + * MsgStoreAndMigrateContract is the MsgStoreAndMigrateContract + * request type. + * + * Since: 0.42 + */ +export interface MsgStoreAndMigrateContractAmino { + /** Authority is the address of the governance account. */ + authority?: string; + /** WASMByteCode can be raw or gzip compressed */ + wasm_byte_code?: string; + /** InstantiatePermission to apply on contract creation, optional */ + instantiate_permission?: AccessConfigAmino; + /** Contract is the address of the smart contract */ + contract?: string; + /** Msg json encoded message to be passed to the contract on migration */ + msg?: any; +} +export interface MsgStoreAndMigrateContractAminoMsg { + type: "wasm/MsgStoreAndMigrateContract"; + value: MsgStoreAndMigrateContractAmino; +} +/** + * MsgStoreAndMigrateContract is the MsgStoreAndMigrateContract + * request type. + * + * Since: 0.42 + */ +export interface MsgStoreAndMigrateContractSDKType { + authority: string; + wasm_byte_code: Uint8Array; + instantiate_permission?: AccessConfigSDKType; + contract: string; + msg: Uint8Array; +} +/** + * MsgStoreAndMigrateContractResponse defines the response structure + * for executing a MsgStoreAndMigrateContract message. + * + * Since: 0.42 + */ +export interface MsgStoreAndMigrateContractResponse { + /** CodeID is the reference to the stored WASM code */ + codeId: bigint; + /** Checksum is the sha256 hash of the stored code */ + checksum: Uint8Array; + /** Data contains bytes to returned from the contract */ + data: Uint8Array; +} +export interface MsgStoreAndMigrateContractResponseProtoMsg { + typeUrl: "/cosmwasm.wasm.v1.MsgStoreAndMigrateContractResponse"; + value: Uint8Array; +} +/** + * MsgStoreAndMigrateContractResponse defines the response structure + * for executing a MsgStoreAndMigrateContract message. + * + * Since: 0.42 + */ +export interface MsgStoreAndMigrateContractResponseAmino { + /** CodeID is the reference to the stored WASM code */ + code_id?: string; + /** Checksum is the sha256 hash of the stored code */ + checksum?: string; + /** Data contains bytes to returned from the contract */ + data?: string; +} +export interface MsgStoreAndMigrateContractResponseAminoMsg { + type: "wasm/MsgStoreAndMigrateContractResponse"; + value: MsgStoreAndMigrateContractResponseAmino; +} +/** + * MsgStoreAndMigrateContractResponse defines the response structure + * for executing a MsgStoreAndMigrateContract message. + * + * Since: 0.42 + */ +export interface MsgStoreAndMigrateContractResponseSDKType { + code_id: bigint; + checksum: Uint8Array; + data: Uint8Array; +} +/** MsgUpdateContractLabel sets a new label for a smart contract */ +export interface MsgUpdateContractLabel { + /** Sender is the that actor that signed the messages */ + sender: string; + /** NewLabel string to be set */ + newLabel: string; + /** Contract is the address of the smart contract */ + contract: string; +} +export interface MsgUpdateContractLabelProtoMsg { + typeUrl: "/cosmwasm.wasm.v1.MsgUpdateContractLabel"; + value: Uint8Array; +} +/** MsgUpdateContractLabel sets a new label for a smart contract */ +export interface MsgUpdateContractLabelAmino { + /** Sender is the that actor that signed the messages */ + sender?: string; + /** NewLabel string to be set */ + new_label?: string; + /** Contract is the address of the smart contract */ + contract?: string; +} +export interface MsgUpdateContractLabelAminoMsg { + type: "wasm/MsgUpdateContractLabel"; + value: MsgUpdateContractLabelAmino; +} +/** MsgUpdateContractLabel sets a new label for a smart contract */ +export interface MsgUpdateContractLabelSDKType { + sender: string; + new_label: string; + contract: string; +} +/** MsgUpdateContractLabelResponse returns empty data */ +export interface MsgUpdateContractLabelResponse {} +export interface MsgUpdateContractLabelResponseProtoMsg { + typeUrl: "/cosmwasm.wasm.v1.MsgUpdateContractLabelResponse"; + value: Uint8Array; +} +/** MsgUpdateContractLabelResponse returns empty data */ +export interface MsgUpdateContractLabelResponseAmino {} +export interface MsgUpdateContractLabelResponseAminoMsg { + type: "wasm/MsgUpdateContractLabelResponse"; + value: MsgUpdateContractLabelResponseAmino; +} +/** MsgUpdateContractLabelResponse returns empty data */ +export interface MsgUpdateContractLabelResponseSDKType {} +function createBaseMsgStoreCode(): MsgStoreCode { + return { + sender: "", + wasmByteCode: new Uint8Array(), + instantiatePermission: undefined + }; +} +export const MsgStoreCode = { + typeUrl: "/cosmwasm.wasm.v1.MsgStoreCode", + aminoType: "wasm/MsgStoreCode", + is(o: any): o is MsgStoreCode { + return o && (o.$typeUrl === MsgStoreCode.typeUrl || typeof o.sender === "string" && (o.wasmByteCode instanceof Uint8Array || typeof o.wasmByteCode === "string")); + }, + isSDK(o: any): o is MsgStoreCodeSDKType { + return o && (o.$typeUrl === MsgStoreCode.typeUrl || typeof o.sender === "string" && (o.wasm_byte_code instanceof Uint8Array || typeof o.wasm_byte_code === "string")); + }, + isAmino(o: any): o is MsgStoreCodeAmino { + return o && (o.$typeUrl === MsgStoreCode.typeUrl || typeof o.sender === "string" && (o.wasm_byte_code instanceof Uint8Array || typeof o.wasm_byte_code === "string")); + }, + encode(message: MsgStoreCode, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.sender !== "") { + writer.uint32(10).string(message.sender); + } + if (message.wasmByteCode.length !== 0) { + writer.uint32(18).bytes(message.wasmByteCode); + } + if (message.instantiatePermission !== undefined) { + AccessConfig.encode(message.instantiatePermission, writer.uint32(42).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgStoreCode { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgStoreCode(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.sender = reader.string(); + break; + case 2: + message.wasmByteCode = reader.bytes(); + break; + case 5: + message.instantiatePermission = AccessConfig.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): MsgStoreCode { + return { + sender: isSet(object.sender) ? String(object.sender) : "", + wasmByteCode: isSet(object.wasmByteCode) ? bytesFromBase64(object.wasmByteCode) : new Uint8Array(), + instantiatePermission: isSet(object.instantiatePermission) ? AccessConfig.fromJSON(object.instantiatePermission) : undefined + }; + }, + toJSON(message: MsgStoreCode): unknown { + const obj: any = {}; + message.sender !== undefined && (obj.sender = message.sender); + message.wasmByteCode !== undefined && (obj.wasmByteCode = base64FromBytes(message.wasmByteCode !== undefined ? message.wasmByteCode : new Uint8Array())); + message.instantiatePermission !== undefined && (obj.instantiatePermission = message.instantiatePermission ? AccessConfig.toJSON(message.instantiatePermission) : undefined); + return obj; + }, + fromPartial(object: Partial): MsgStoreCode { + const message = createBaseMsgStoreCode(); + message.sender = object.sender ?? ""; + message.wasmByteCode = object.wasmByteCode ?? new Uint8Array(); + message.instantiatePermission = object.instantiatePermission !== undefined && object.instantiatePermission !== null ? AccessConfig.fromPartial(object.instantiatePermission) : undefined; + return message; + }, + fromAmino(object: MsgStoreCodeAmino): MsgStoreCode { + const message = createBaseMsgStoreCode(); + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + if (object.wasm_byte_code !== undefined && object.wasm_byte_code !== null) { + message.wasmByteCode = fromBase64(object.wasm_byte_code); + } + if (object.instantiate_permission !== undefined && object.instantiate_permission !== null) { + message.instantiatePermission = AccessConfig.fromAmino(object.instantiate_permission); + } + return message; + }, + toAmino(message: MsgStoreCode): MsgStoreCodeAmino { + const obj: any = {}; + obj.sender = message.sender; + obj.wasm_byte_code = message.wasmByteCode ? toBase64(message.wasmByteCode) : undefined; + obj.instantiate_permission = message.instantiatePermission ? AccessConfig.toAmino(message.instantiatePermission) : undefined; + return obj; + }, + fromAminoMsg(object: MsgStoreCodeAminoMsg): MsgStoreCode { + return MsgStoreCode.fromAmino(object.value); + }, + toAminoMsg(message: MsgStoreCode): MsgStoreCodeAminoMsg { + return { + type: "wasm/MsgStoreCode", + value: MsgStoreCode.toAmino(message) + }; + }, + fromProtoMsg(message: MsgStoreCodeProtoMsg): MsgStoreCode { + return MsgStoreCode.decode(message.value); + }, + toProto(message: MsgStoreCode): Uint8Array { + return MsgStoreCode.encode(message).finish(); + }, + toProtoMsg(message: MsgStoreCode): MsgStoreCodeProtoMsg { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgStoreCode", + value: MsgStoreCode.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgStoreCode.typeUrl, MsgStoreCode); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgStoreCode.aminoType, MsgStoreCode.typeUrl); +function createBaseMsgStoreCodeResponse(): MsgStoreCodeResponse { + return { + codeId: BigInt(0), + checksum: new Uint8Array() + }; +} +export const MsgStoreCodeResponse = { + typeUrl: "/cosmwasm.wasm.v1.MsgStoreCodeResponse", + aminoType: "wasm/MsgStoreCodeResponse", + is(o: any): o is MsgStoreCodeResponse { + return o && (o.$typeUrl === MsgStoreCodeResponse.typeUrl || typeof o.codeId === "bigint" && (o.checksum instanceof Uint8Array || typeof o.checksum === "string")); + }, + isSDK(o: any): o is MsgStoreCodeResponseSDKType { + return o && (o.$typeUrl === MsgStoreCodeResponse.typeUrl || typeof o.code_id === "bigint" && (o.checksum instanceof Uint8Array || typeof o.checksum === "string")); + }, + isAmino(o: any): o is MsgStoreCodeResponseAmino { + return o && (o.$typeUrl === MsgStoreCodeResponse.typeUrl || typeof o.code_id === "bigint" && (o.checksum instanceof Uint8Array || typeof o.checksum === "string")); + }, + encode(message: MsgStoreCodeResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.codeId !== BigInt(0)) { + writer.uint32(8).uint64(message.codeId); + } + if (message.checksum.length !== 0) { + writer.uint32(18).bytes(message.checksum); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgStoreCodeResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgStoreCodeResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.codeId = reader.uint64(); + break; + case 2: + message.checksum = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): MsgStoreCodeResponse { + return { + codeId: isSet(object.codeId) ? BigInt(object.codeId.toString()) : BigInt(0), + checksum: isSet(object.checksum) ? bytesFromBase64(object.checksum) : new Uint8Array() + }; + }, + toJSON(message: MsgStoreCodeResponse): unknown { + const obj: any = {}; + message.codeId !== undefined && (obj.codeId = (message.codeId || BigInt(0)).toString()); + message.checksum !== undefined && (obj.checksum = base64FromBytes(message.checksum !== undefined ? message.checksum : new Uint8Array())); + return obj; + }, + fromPartial(object: Partial): MsgStoreCodeResponse { + const message = createBaseMsgStoreCodeResponse(); + message.codeId = object.codeId !== undefined && object.codeId !== null ? BigInt(object.codeId.toString()) : BigInt(0); + message.checksum = object.checksum ?? new Uint8Array(); + return message; + }, + fromAmino(object: MsgStoreCodeResponseAmino): MsgStoreCodeResponse { + const message = createBaseMsgStoreCodeResponse(); + if (object.code_id !== undefined && object.code_id !== null) { + message.codeId = BigInt(object.code_id); + } + if (object.checksum !== undefined && object.checksum !== null) { + message.checksum = bytesFromBase64(object.checksum); + } + return message; + }, + toAmino(message: MsgStoreCodeResponse): MsgStoreCodeResponseAmino { + const obj: any = {}; + obj.code_id = message.codeId ? message.codeId.toString() : undefined; + obj.checksum = message.checksum ? base64FromBytes(message.checksum) : undefined; + return obj; + }, + fromAminoMsg(object: MsgStoreCodeResponseAminoMsg): MsgStoreCodeResponse { + return MsgStoreCodeResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgStoreCodeResponse): MsgStoreCodeResponseAminoMsg { + return { + type: "wasm/MsgStoreCodeResponse", + value: MsgStoreCodeResponse.toAmino(message) + }; + }, + fromProtoMsg(message: MsgStoreCodeResponseProtoMsg): MsgStoreCodeResponse { + return MsgStoreCodeResponse.decode(message.value); + }, + toProto(message: MsgStoreCodeResponse): Uint8Array { + return MsgStoreCodeResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgStoreCodeResponse): MsgStoreCodeResponseProtoMsg { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgStoreCodeResponse", + value: MsgStoreCodeResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgStoreCodeResponse.typeUrl, MsgStoreCodeResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgStoreCodeResponse.aminoType, MsgStoreCodeResponse.typeUrl); +function createBaseMsgInstantiateContract(): MsgInstantiateContract { + return { + sender: "", + admin: "", + codeId: BigInt(0), + label: "", + msg: new Uint8Array(), + funds: [] + }; +} +export const MsgInstantiateContract = { + typeUrl: "/cosmwasm.wasm.v1.MsgInstantiateContract", + aminoType: "wasm/MsgInstantiateContract", + is(o: any): o is MsgInstantiateContract { + return o && (o.$typeUrl === MsgInstantiateContract.typeUrl || typeof o.sender === "string" && typeof o.admin === "string" && typeof o.codeId === "bigint" && typeof o.label === "string" && (o.msg instanceof Uint8Array || typeof o.msg === "string") && Array.isArray(o.funds) && (!o.funds.length || Coin.is(o.funds[0]))); + }, + isSDK(o: any): o is MsgInstantiateContractSDKType { + return o && (o.$typeUrl === MsgInstantiateContract.typeUrl || typeof o.sender === "string" && typeof o.admin === "string" && typeof o.code_id === "bigint" && typeof o.label === "string" && (o.msg instanceof Uint8Array || typeof o.msg === "string") && Array.isArray(o.funds) && (!o.funds.length || Coin.isSDK(o.funds[0]))); + }, + isAmino(o: any): o is MsgInstantiateContractAmino { + return o && (o.$typeUrl === MsgInstantiateContract.typeUrl || typeof o.sender === "string" && typeof o.admin === "string" && typeof o.code_id === "bigint" && typeof o.label === "string" && (o.msg instanceof Uint8Array || typeof o.msg === "string") && Array.isArray(o.funds) && (!o.funds.length || Coin.isAmino(o.funds[0]))); + }, + encode(message: MsgInstantiateContract, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.sender !== "") { + writer.uint32(10).string(message.sender); + } + if (message.admin !== "") { + writer.uint32(18).string(message.admin); + } + if (message.codeId !== BigInt(0)) { + writer.uint32(24).uint64(message.codeId); + } + if (message.label !== "") { + writer.uint32(34).string(message.label); + } + if (message.msg.length !== 0) { + writer.uint32(42).bytes(message.msg); + } + for (const v of message.funds) { + Coin.encode(v!, writer.uint32(50).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgInstantiateContract { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgInstantiateContract(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.sender = reader.string(); + break; + case 2: + message.admin = reader.string(); + break; + case 3: + message.codeId = reader.uint64(); + break; + case 4: + message.label = reader.string(); + break; + case 5: + message.msg = reader.bytes(); + break; + case 6: + message.funds.push(Coin.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): MsgInstantiateContract { + return { + sender: isSet(object.sender) ? String(object.sender) : "", + admin: isSet(object.admin) ? String(object.admin) : "", + codeId: isSet(object.codeId) ? BigInt(object.codeId.toString()) : BigInt(0), + label: isSet(object.label) ? String(object.label) : "", + msg: isSet(object.msg) ? bytesFromBase64(object.msg) : new Uint8Array(), + funds: Array.isArray(object?.funds) ? object.funds.map((e: any) => Coin.fromJSON(e)) : [] + }; + }, + toJSON(message: MsgInstantiateContract): unknown { + const obj: any = {}; + message.sender !== undefined && (obj.sender = message.sender); + message.admin !== undefined && (obj.admin = message.admin); + message.codeId !== undefined && (obj.codeId = (message.codeId || BigInt(0)).toString()); + message.label !== undefined && (obj.label = message.label); + message.msg !== undefined && (obj.msg = base64FromBytes(message.msg !== undefined ? message.msg : new Uint8Array())); + if (message.funds) { + obj.funds = message.funds.map(e => e ? Coin.toJSON(e) : undefined); + } else { + obj.funds = []; + } + return obj; + }, + fromPartial(object: Partial): MsgInstantiateContract { + const message = createBaseMsgInstantiateContract(); + message.sender = object.sender ?? ""; + message.admin = object.admin ?? ""; + message.codeId = object.codeId !== undefined && object.codeId !== null ? BigInt(object.codeId.toString()) : BigInt(0); + message.label = object.label ?? ""; + message.msg = object.msg ?? new Uint8Array(); + message.funds = object.funds?.map(e => Coin.fromPartial(e)) || []; + return message; + }, + fromAmino(object: MsgInstantiateContractAmino): MsgInstantiateContract { + const message = createBaseMsgInstantiateContract(); + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + if (object.admin !== undefined && object.admin !== null) { + message.admin = object.admin; + } + if (object.code_id !== undefined && object.code_id !== null) { + message.codeId = BigInt(object.code_id); + } + if (object.label !== undefined && object.label !== null) { + message.label = object.label; + } + if (object.msg !== undefined && object.msg !== null) { + message.msg = toUtf8(JSON.stringify(object.msg)); + } + message.funds = object.funds?.map(e => Coin.fromAmino(e)) || []; + return message; + }, + toAmino(message: MsgInstantiateContract): MsgInstantiateContractAmino { + const obj: any = {}; + obj.sender = message.sender; + obj.admin = message.admin; + obj.code_id = message.codeId ? message.codeId.toString() : undefined; + obj.label = message.label; + obj.msg = message.msg ? JSON.parse(fromUtf8(message.msg)) : undefined; + if (message.funds) { + obj.funds = message.funds.map(e => e ? Coin.toAmino(e) : undefined); + } else { + obj.funds = []; + } + return obj; + }, + fromAminoMsg(object: MsgInstantiateContractAminoMsg): MsgInstantiateContract { + return MsgInstantiateContract.fromAmino(object.value); + }, + toAminoMsg(message: MsgInstantiateContract): MsgInstantiateContractAminoMsg { + return { + type: "wasm/MsgInstantiateContract", + value: MsgInstantiateContract.toAmino(message) + }; + }, + fromProtoMsg(message: MsgInstantiateContractProtoMsg): MsgInstantiateContract { + return MsgInstantiateContract.decode(message.value); + }, + toProto(message: MsgInstantiateContract): Uint8Array { + return MsgInstantiateContract.encode(message).finish(); + }, + toProtoMsg(message: MsgInstantiateContract): MsgInstantiateContractProtoMsg { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgInstantiateContract", + value: MsgInstantiateContract.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgInstantiateContract.typeUrl, MsgInstantiateContract); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgInstantiateContract.aminoType, MsgInstantiateContract.typeUrl); +function createBaseMsgInstantiateContractResponse(): MsgInstantiateContractResponse { + return { + address: "", + data: new Uint8Array() + }; +} +export const MsgInstantiateContractResponse = { + typeUrl: "/cosmwasm.wasm.v1.MsgInstantiateContractResponse", + aminoType: "wasm/MsgInstantiateContractResponse", + is(o: any): o is MsgInstantiateContractResponse { + return o && (o.$typeUrl === MsgInstantiateContractResponse.typeUrl || typeof o.address === "string" && (o.data instanceof Uint8Array || typeof o.data === "string")); + }, + isSDK(o: any): o is MsgInstantiateContractResponseSDKType { + return o && (o.$typeUrl === MsgInstantiateContractResponse.typeUrl || typeof o.address === "string" && (o.data instanceof Uint8Array || typeof o.data === "string")); + }, + isAmino(o: any): o is MsgInstantiateContractResponseAmino { + return o && (o.$typeUrl === MsgInstantiateContractResponse.typeUrl || typeof o.address === "string" && (o.data instanceof Uint8Array || typeof o.data === "string")); + }, + encode(message: MsgInstantiateContractResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.address !== "") { + writer.uint32(10).string(message.address); + } + if (message.data.length !== 0) { + writer.uint32(18).bytes(message.data); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgInstantiateContractResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgInstantiateContractResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.address = reader.string(); + break; + case 2: + message.data = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): MsgInstantiateContractResponse { + return { + address: isSet(object.address) ? String(object.address) : "", + data: isSet(object.data) ? bytesFromBase64(object.data) : new Uint8Array() + }; + }, + toJSON(message: MsgInstantiateContractResponse): unknown { + const obj: any = {}; + message.address !== undefined && (obj.address = message.address); + message.data !== undefined && (obj.data = base64FromBytes(message.data !== undefined ? message.data : new Uint8Array())); + return obj; + }, + fromPartial(object: Partial): MsgInstantiateContractResponse { + const message = createBaseMsgInstantiateContractResponse(); + message.address = object.address ?? ""; + message.data = object.data ?? new Uint8Array(); + return message; + }, + fromAmino(object: MsgInstantiateContractResponseAmino): MsgInstantiateContractResponse { + const message = createBaseMsgInstantiateContractResponse(); + if (object.address !== undefined && object.address !== null) { + message.address = object.address; + } + if (object.data !== undefined && object.data !== null) { + message.data = bytesFromBase64(object.data); + } + return message; + }, + toAmino(message: MsgInstantiateContractResponse): MsgInstantiateContractResponseAmino { + const obj: any = {}; + obj.address = message.address; + obj.data = message.data ? base64FromBytes(message.data) : undefined; + return obj; + }, + fromAminoMsg(object: MsgInstantiateContractResponseAminoMsg): MsgInstantiateContractResponse { + return MsgInstantiateContractResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgInstantiateContractResponse): MsgInstantiateContractResponseAminoMsg { + return { + type: "wasm/MsgInstantiateContractResponse", + value: MsgInstantiateContractResponse.toAmino(message) + }; + }, + fromProtoMsg(message: MsgInstantiateContractResponseProtoMsg): MsgInstantiateContractResponse { + return MsgInstantiateContractResponse.decode(message.value); + }, + toProto(message: MsgInstantiateContractResponse): Uint8Array { + return MsgInstantiateContractResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgInstantiateContractResponse): MsgInstantiateContractResponseProtoMsg { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgInstantiateContractResponse", + value: MsgInstantiateContractResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgInstantiateContractResponse.typeUrl, MsgInstantiateContractResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgInstantiateContractResponse.aminoType, MsgInstantiateContractResponse.typeUrl); +function createBaseMsgInstantiateContract2(): MsgInstantiateContract2 { + return { + sender: "", + admin: "", + codeId: BigInt(0), + label: "", + msg: new Uint8Array(), + funds: [], + salt: new Uint8Array(), + fixMsg: false + }; +} +export const MsgInstantiateContract2 = { + typeUrl: "/cosmwasm.wasm.v1.MsgInstantiateContract2", + aminoType: "wasm/MsgInstantiateContract2", + is(o: any): o is MsgInstantiateContract2 { + return o && (o.$typeUrl === MsgInstantiateContract2.typeUrl || typeof o.sender === "string" && typeof o.admin === "string" && typeof o.codeId === "bigint" && typeof o.label === "string" && (o.msg instanceof Uint8Array || typeof o.msg === "string") && Array.isArray(o.funds) && (!o.funds.length || Coin.is(o.funds[0])) && (o.salt instanceof Uint8Array || typeof o.salt === "string") && typeof o.fixMsg === "boolean"); + }, + isSDK(o: any): o is MsgInstantiateContract2SDKType { + return o && (o.$typeUrl === MsgInstantiateContract2.typeUrl || typeof o.sender === "string" && typeof o.admin === "string" && typeof o.code_id === "bigint" && typeof o.label === "string" && (o.msg instanceof Uint8Array || typeof o.msg === "string") && Array.isArray(o.funds) && (!o.funds.length || Coin.isSDK(o.funds[0])) && (o.salt instanceof Uint8Array || typeof o.salt === "string") && typeof o.fix_msg === "boolean"); + }, + isAmino(o: any): o is MsgInstantiateContract2Amino { + return o && (o.$typeUrl === MsgInstantiateContract2.typeUrl || typeof o.sender === "string" && typeof o.admin === "string" && typeof o.code_id === "bigint" && typeof o.label === "string" && (o.msg instanceof Uint8Array || typeof o.msg === "string") && Array.isArray(o.funds) && (!o.funds.length || Coin.isAmino(o.funds[0])) && (o.salt instanceof Uint8Array || typeof o.salt === "string") && typeof o.fix_msg === "boolean"); + }, + encode(message: MsgInstantiateContract2, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.sender !== "") { + writer.uint32(10).string(message.sender); + } + if (message.admin !== "") { + writer.uint32(18).string(message.admin); + } + if (message.codeId !== BigInt(0)) { + writer.uint32(24).uint64(message.codeId); + } + if (message.label !== "") { + writer.uint32(34).string(message.label); + } + if (message.msg.length !== 0) { + writer.uint32(42).bytes(message.msg); + } + for (const v of message.funds) { + Coin.encode(v!, writer.uint32(50).fork()).ldelim(); + } + if (message.salt.length !== 0) { + writer.uint32(58).bytes(message.salt); + } + if (message.fixMsg === true) { + writer.uint32(64).bool(message.fixMsg); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgInstantiateContract2 { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgInstantiateContract2(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.sender = reader.string(); + break; + case 2: + message.admin = reader.string(); + break; + case 3: + message.codeId = reader.uint64(); + break; + case 4: + message.label = reader.string(); + break; + case 5: + message.msg = reader.bytes(); + break; + case 6: + message.funds.push(Coin.decode(reader, reader.uint32())); + break; + case 7: + message.salt = reader.bytes(); + break; + case 8: + message.fixMsg = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): MsgInstantiateContract2 { + return { + sender: isSet(object.sender) ? String(object.sender) : "", + admin: isSet(object.admin) ? String(object.admin) : "", + codeId: isSet(object.codeId) ? BigInt(object.codeId.toString()) : BigInt(0), + label: isSet(object.label) ? String(object.label) : "", + msg: isSet(object.msg) ? bytesFromBase64(object.msg) : new Uint8Array(), + funds: Array.isArray(object?.funds) ? object.funds.map((e: any) => Coin.fromJSON(e)) : [], + salt: isSet(object.salt) ? bytesFromBase64(object.salt) : new Uint8Array(), + fixMsg: isSet(object.fixMsg) ? Boolean(object.fixMsg) : false + }; + }, + toJSON(message: MsgInstantiateContract2): unknown { + const obj: any = {}; + message.sender !== undefined && (obj.sender = message.sender); + message.admin !== undefined && (obj.admin = message.admin); + message.codeId !== undefined && (obj.codeId = (message.codeId || BigInt(0)).toString()); + message.label !== undefined && (obj.label = message.label); + message.msg !== undefined && (obj.msg = base64FromBytes(message.msg !== undefined ? message.msg : new Uint8Array())); + if (message.funds) { + obj.funds = message.funds.map(e => e ? Coin.toJSON(e) : undefined); + } else { + obj.funds = []; + } + message.salt !== undefined && (obj.salt = base64FromBytes(message.salt !== undefined ? message.salt : new Uint8Array())); + message.fixMsg !== undefined && (obj.fixMsg = message.fixMsg); + return obj; + }, + fromPartial(object: Partial): MsgInstantiateContract2 { + const message = createBaseMsgInstantiateContract2(); + message.sender = object.sender ?? ""; + message.admin = object.admin ?? ""; + message.codeId = object.codeId !== undefined && object.codeId !== null ? BigInt(object.codeId.toString()) : BigInt(0); + message.label = object.label ?? ""; + message.msg = object.msg ?? new Uint8Array(); + message.funds = object.funds?.map(e => Coin.fromPartial(e)) || []; + message.salt = object.salt ?? new Uint8Array(); + message.fixMsg = object.fixMsg ?? false; + return message; + }, + fromAmino(object: MsgInstantiateContract2Amino): MsgInstantiateContract2 { + const message = createBaseMsgInstantiateContract2(); + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + if (object.admin !== undefined && object.admin !== null) { + message.admin = object.admin; + } + if (object.code_id !== undefined && object.code_id !== null) { + message.codeId = BigInt(object.code_id); + } + if (object.label !== undefined && object.label !== null) { + message.label = object.label; + } + if (object.msg !== undefined && object.msg !== null) { + message.msg = toUtf8(JSON.stringify(object.msg)); + } + message.funds = object.funds?.map(e => Coin.fromAmino(e)) || []; + if (object.salt !== undefined && object.salt !== null) { + message.salt = bytesFromBase64(object.salt); + } + if (object.fix_msg !== undefined && object.fix_msg !== null) { + message.fixMsg = object.fix_msg; + } + return message; + }, + toAmino(message: MsgInstantiateContract2): MsgInstantiateContract2Amino { + const obj: any = {}; + obj.sender = message.sender; + obj.admin = message.admin; + obj.code_id = message.codeId ? message.codeId.toString() : undefined; + obj.label = message.label; + obj.msg = message.msg ? JSON.parse(fromUtf8(message.msg)) : undefined; + if (message.funds) { + obj.funds = message.funds.map(e => e ? Coin.toAmino(e) : undefined); + } else { + obj.funds = []; + } + obj.salt = message.salt ? base64FromBytes(message.salt) : undefined; + obj.fix_msg = message.fixMsg; + return obj; + }, + fromAminoMsg(object: MsgInstantiateContract2AminoMsg): MsgInstantiateContract2 { + return MsgInstantiateContract2.fromAmino(object.value); + }, + toAminoMsg(message: MsgInstantiateContract2): MsgInstantiateContract2AminoMsg { + return { + type: "wasm/MsgInstantiateContract2", + value: MsgInstantiateContract2.toAmino(message) + }; + }, + fromProtoMsg(message: MsgInstantiateContract2ProtoMsg): MsgInstantiateContract2 { + return MsgInstantiateContract2.decode(message.value); + }, + toProto(message: MsgInstantiateContract2): Uint8Array { + return MsgInstantiateContract2.encode(message).finish(); + }, + toProtoMsg(message: MsgInstantiateContract2): MsgInstantiateContract2ProtoMsg { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgInstantiateContract2", + value: MsgInstantiateContract2.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgInstantiateContract2.typeUrl, MsgInstantiateContract2); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgInstantiateContract2.aminoType, MsgInstantiateContract2.typeUrl); +function createBaseMsgInstantiateContract2Response(): MsgInstantiateContract2Response { + return { + address: "", + data: new Uint8Array() + }; +} +export const MsgInstantiateContract2Response = { + typeUrl: "/cosmwasm.wasm.v1.MsgInstantiateContract2Response", + aminoType: "wasm/MsgInstantiateContract2Response", + is(o: any): o is MsgInstantiateContract2Response { + return o && (o.$typeUrl === MsgInstantiateContract2Response.typeUrl || typeof o.address === "string" && (o.data instanceof Uint8Array || typeof o.data === "string")); + }, + isSDK(o: any): o is MsgInstantiateContract2ResponseSDKType { + return o && (o.$typeUrl === MsgInstantiateContract2Response.typeUrl || typeof o.address === "string" && (o.data instanceof Uint8Array || typeof o.data === "string")); + }, + isAmino(o: any): o is MsgInstantiateContract2ResponseAmino { + return o && (o.$typeUrl === MsgInstantiateContract2Response.typeUrl || typeof o.address === "string" && (o.data instanceof Uint8Array || typeof o.data === "string")); + }, + encode(message: MsgInstantiateContract2Response, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.address !== "") { + writer.uint32(10).string(message.address); + } + if (message.data.length !== 0) { + writer.uint32(18).bytes(message.data); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgInstantiateContract2Response { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgInstantiateContract2Response(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.address = reader.string(); + break; + case 2: + message.data = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): MsgInstantiateContract2Response { + return { + address: isSet(object.address) ? String(object.address) : "", + data: isSet(object.data) ? bytesFromBase64(object.data) : new Uint8Array() + }; + }, + toJSON(message: MsgInstantiateContract2Response): unknown { + const obj: any = {}; + message.address !== undefined && (obj.address = message.address); + message.data !== undefined && (obj.data = base64FromBytes(message.data !== undefined ? message.data : new Uint8Array())); + return obj; + }, + fromPartial(object: Partial): MsgInstantiateContract2Response { + const message = createBaseMsgInstantiateContract2Response(); + message.address = object.address ?? ""; + message.data = object.data ?? new Uint8Array(); + return message; + }, + fromAmino(object: MsgInstantiateContract2ResponseAmino): MsgInstantiateContract2Response { + const message = createBaseMsgInstantiateContract2Response(); + if (object.address !== undefined && object.address !== null) { + message.address = object.address; + } + if (object.data !== undefined && object.data !== null) { + message.data = bytesFromBase64(object.data); + } + return message; + }, + toAmino(message: MsgInstantiateContract2Response): MsgInstantiateContract2ResponseAmino { + const obj: any = {}; + obj.address = message.address; + obj.data = message.data ? base64FromBytes(message.data) : undefined; + return obj; + }, + fromAminoMsg(object: MsgInstantiateContract2ResponseAminoMsg): MsgInstantiateContract2Response { + return MsgInstantiateContract2Response.fromAmino(object.value); + }, + toAminoMsg(message: MsgInstantiateContract2Response): MsgInstantiateContract2ResponseAminoMsg { + return { + type: "wasm/MsgInstantiateContract2Response", + value: MsgInstantiateContract2Response.toAmino(message) + }; + }, + fromProtoMsg(message: MsgInstantiateContract2ResponseProtoMsg): MsgInstantiateContract2Response { + return MsgInstantiateContract2Response.decode(message.value); + }, + toProto(message: MsgInstantiateContract2Response): Uint8Array { + return MsgInstantiateContract2Response.encode(message).finish(); + }, + toProtoMsg(message: MsgInstantiateContract2Response): MsgInstantiateContract2ResponseProtoMsg { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgInstantiateContract2Response", + value: MsgInstantiateContract2Response.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgInstantiateContract2Response.typeUrl, MsgInstantiateContract2Response); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgInstantiateContract2Response.aminoType, MsgInstantiateContract2Response.typeUrl); +function createBaseMsgExecuteContract(): MsgExecuteContract { + return { + sender: "", + contract: "", + msg: new Uint8Array(), + funds: [] + }; +} +export const MsgExecuteContract = { + typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", + aminoType: "wasm/MsgExecuteContract", + is(o: any): o is MsgExecuteContract { + return o && (o.$typeUrl === MsgExecuteContract.typeUrl || typeof o.sender === "string" && typeof o.contract === "string" && (o.msg instanceof Uint8Array || typeof o.msg === "string") && Array.isArray(o.funds) && (!o.funds.length || Coin.is(o.funds[0]))); + }, + isSDK(o: any): o is MsgExecuteContractSDKType { + return o && (o.$typeUrl === MsgExecuteContract.typeUrl || typeof o.sender === "string" && typeof o.contract === "string" && (o.msg instanceof Uint8Array || typeof o.msg === "string") && Array.isArray(o.funds) && (!o.funds.length || Coin.isSDK(o.funds[0]))); + }, + isAmino(o: any): o is MsgExecuteContractAmino { + return o && (o.$typeUrl === MsgExecuteContract.typeUrl || typeof o.sender === "string" && typeof o.contract === "string" && (o.msg instanceof Uint8Array || typeof o.msg === "string") && Array.isArray(o.funds) && (!o.funds.length || Coin.isAmino(o.funds[0]))); + }, + encode(message: MsgExecuteContract, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.sender !== "") { + writer.uint32(10).string(message.sender); + } + if (message.contract !== "") { + writer.uint32(18).string(message.contract); + } + if (message.msg.length !== 0) { + writer.uint32(26).bytes(message.msg); + } + for (const v of message.funds) { + Coin.encode(v!, writer.uint32(42).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgExecuteContract { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgExecuteContract(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.sender = reader.string(); + break; + case 2: + message.contract = reader.string(); + break; + case 3: + message.msg = reader.bytes(); + break; + case 5: + message.funds.push(Coin.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): MsgExecuteContract { + return { + sender: isSet(object.sender) ? String(object.sender) : "", + contract: isSet(object.contract) ? String(object.contract) : "", + msg: isSet(object.msg) ? bytesFromBase64(object.msg) : new Uint8Array(), + funds: Array.isArray(object?.funds) ? object.funds.map((e: any) => Coin.fromJSON(e)) : [] + }; + }, + toJSON(message: MsgExecuteContract): unknown { + const obj: any = {}; + message.sender !== undefined && (obj.sender = message.sender); + message.contract !== undefined && (obj.contract = message.contract); + message.msg !== undefined && (obj.msg = base64FromBytes(message.msg !== undefined ? message.msg : new Uint8Array())); + if (message.funds) { + obj.funds = message.funds.map(e => e ? Coin.toJSON(e) : undefined); + } else { + obj.funds = []; + } + return obj; + }, + fromPartial(object: Partial): MsgExecuteContract { + const message = createBaseMsgExecuteContract(); + message.sender = object.sender ?? ""; + message.contract = object.contract ?? ""; + message.msg = object.msg ?? new Uint8Array(); + message.funds = object.funds?.map(e => Coin.fromPartial(e)) || []; + return message; + }, + fromAmino(object: MsgExecuteContractAmino): MsgExecuteContract { + const message = createBaseMsgExecuteContract(); + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + if (object.contract !== undefined && object.contract !== null) { + message.contract = object.contract; + } + if (object.msg !== undefined && object.msg !== null) { + message.msg = toUtf8(JSON.stringify(object.msg)); + } + message.funds = object.funds?.map(e => Coin.fromAmino(e)) || []; + return message; + }, + toAmino(message: MsgExecuteContract): MsgExecuteContractAmino { + const obj: any = {}; + obj.sender = message.sender; + obj.contract = message.contract; + obj.msg = message.msg ? JSON.parse(fromUtf8(message.msg)) : undefined; + if (message.funds) { + obj.funds = message.funds.map(e => e ? Coin.toAmino(e) : undefined); + } else { + obj.funds = []; + } + return obj; + }, + fromAminoMsg(object: MsgExecuteContractAminoMsg): MsgExecuteContract { + return MsgExecuteContract.fromAmino(object.value); + }, + toAminoMsg(message: MsgExecuteContract): MsgExecuteContractAminoMsg { + return { + type: "wasm/MsgExecuteContract", + value: MsgExecuteContract.toAmino(message) + }; + }, + fromProtoMsg(message: MsgExecuteContractProtoMsg): MsgExecuteContract { + return MsgExecuteContract.decode(message.value); + }, + toProto(message: MsgExecuteContract): Uint8Array { + return MsgExecuteContract.encode(message).finish(); + }, + toProtoMsg(message: MsgExecuteContract): MsgExecuteContractProtoMsg { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", + value: MsgExecuteContract.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgExecuteContract.typeUrl, MsgExecuteContract); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgExecuteContract.aminoType, MsgExecuteContract.typeUrl); +function createBaseMsgExecuteContractResponse(): MsgExecuteContractResponse { + return { + data: new Uint8Array() + }; +} +export const MsgExecuteContractResponse = { + typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContractResponse", + aminoType: "wasm/MsgExecuteContractResponse", + is(o: any): o is MsgExecuteContractResponse { + return o && (o.$typeUrl === MsgExecuteContractResponse.typeUrl || o.data instanceof Uint8Array || typeof o.data === "string"); + }, + isSDK(o: any): o is MsgExecuteContractResponseSDKType { + return o && (o.$typeUrl === MsgExecuteContractResponse.typeUrl || o.data instanceof Uint8Array || typeof o.data === "string"); + }, + isAmino(o: any): o is MsgExecuteContractResponseAmino { + return o && (o.$typeUrl === MsgExecuteContractResponse.typeUrl || o.data instanceof Uint8Array || typeof o.data === "string"); + }, + encode(message: MsgExecuteContractResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.data.length !== 0) { + writer.uint32(10).bytes(message.data); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgExecuteContractResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgExecuteContractResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.data = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): MsgExecuteContractResponse { + return { + data: isSet(object.data) ? bytesFromBase64(object.data) : new Uint8Array() + }; + }, + toJSON(message: MsgExecuteContractResponse): unknown { + const obj: any = {}; + message.data !== undefined && (obj.data = base64FromBytes(message.data !== undefined ? message.data : new Uint8Array())); + return obj; + }, + fromPartial(object: Partial): MsgExecuteContractResponse { + const message = createBaseMsgExecuteContractResponse(); + message.data = object.data ?? new Uint8Array(); + return message; + }, + fromAmino(object: MsgExecuteContractResponseAmino): MsgExecuteContractResponse { + const message = createBaseMsgExecuteContractResponse(); + if (object.data !== undefined && object.data !== null) { + message.data = bytesFromBase64(object.data); + } + return message; + }, + toAmino(message: MsgExecuteContractResponse): MsgExecuteContractResponseAmino { + const obj: any = {}; + obj.data = message.data ? base64FromBytes(message.data) : undefined; + return obj; + }, + fromAminoMsg(object: MsgExecuteContractResponseAminoMsg): MsgExecuteContractResponse { + return MsgExecuteContractResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgExecuteContractResponse): MsgExecuteContractResponseAminoMsg { + return { + type: "wasm/MsgExecuteContractResponse", + value: MsgExecuteContractResponse.toAmino(message) + }; + }, + fromProtoMsg(message: MsgExecuteContractResponseProtoMsg): MsgExecuteContractResponse { + return MsgExecuteContractResponse.decode(message.value); + }, + toProto(message: MsgExecuteContractResponse): Uint8Array { + return MsgExecuteContractResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgExecuteContractResponse): MsgExecuteContractResponseProtoMsg { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContractResponse", + value: MsgExecuteContractResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgExecuteContractResponse.typeUrl, MsgExecuteContractResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgExecuteContractResponse.aminoType, MsgExecuteContractResponse.typeUrl); +function createBaseMsgMigrateContract(): MsgMigrateContract { + return { + sender: "", + contract: "", + codeId: BigInt(0), + msg: new Uint8Array() + }; +} +export const MsgMigrateContract = { + typeUrl: "/cosmwasm.wasm.v1.MsgMigrateContract", + aminoType: "wasm/MsgMigrateContract", + is(o: any): o is MsgMigrateContract { + return o && (o.$typeUrl === MsgMigrateContract.typeUrl || typeof o.sender === "string" && typeof o.contract === "string" && typeof o.codeId === "bigint" && (o.msg instanceof Uint8Array || typeof o.msg === "string")); + }, + isSDK(o: any): o is MsgMigrateContractSDKType { + return o && (o.$typeUrl === MsgMigrateContract.typeUrl || typeof o.sender === "string" && typeof o.contract === "string" && typeof o.code_id === "bigint" && (o.msg instanceof Uint8Array || typeof o.msg === "string")); + }, + isAmino(o: any): o is MsgMigrateContractAmino { + return o && (o.$typeUrl === MsgMigrateContract.typeUrl || typeof o.sender === "string" && typeof o.contract === "string" && typeof o.code_id === "bigint" && (o.msg instanceof Uint8Array || typeof o.msg === "string")); + }, + encode(message: MsgMigrateContract, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.sender !== "") { + writer.uint32(10).string(message.sender); + } + if (message.contract !== "") { + writer.uint32(18).string(message.contract); + } + if (message.codeId !== BigInt(0)) { + writer.uint32(24).uint64(message.codeId); + } + if (message.msg.length !== 0) { + writer.uint32(34).bytes(message.msg); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgMigrateContract { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgMigrateContract(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.sender = reader.string(); + break; + case 2: + message.contract = reader.string(); + break; + case 3: + message.codeId = reader.uint64(); + break; + case 4: + message.msg = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): MsgMigrateContract { + return { + sender: isSet(object.sender) ? String(object.sender) : "", + contract: isSet(object.contract) ? String(object.contract) : "", + codeId: isSet(object.codeId) ? BigInt(object.codeId.toString()) : BigInt(0), + msg: isSet(object.msg) ? bytesFromBase64(object.msg) : new Uint8Array() + }; + }, + toJSON(message: MsgMigrateContract): unknown { + const obj: any = {}; + message.sender !== undefined && (obj.sender = message.sender); + message.contract !== undefined && (obj.contract = message.contract); + message.codeId !== undefined && (obj.codeId = (message.codeId || BigInt(0)).toString()); + message.msg !== undefined && (obj.msg = base64FromBytes(message.msg !== undefined ? message.msg : new Uint8Array())); + return obj; + }, + fromPartial(object: Partial): MsgMigrateContract { + const message = createBaseMsgMigrateContract(); + message.sender = object.sender ?? ""; + message.contract = object.contract ?? ""; + message.codeId = object.codeId !== undefined && object.codeId !== null ? BigInt(object.codeId.toString()) : BigInt(0); + message.msg = object.msg ?? new Uint8Array(); + return message; + }, + fromAmino(object: MsgMigrateContractAmino): MsgMigrateContract { + const message = createBaseMsgMigrateContract(); + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + if (object.contract !== undefined && object.contract !== null) { + message.contract = object.contract; + } + if (object.code_id !== undefined && object.code_id !== null) { + message.codeId = BigInt(object.code_id); + } + if (object.msg !== undefined && object.msg !== null) { + message.msg = toUtf8(JSON.stringify(object.msg)); + } + return message; + }, + toAmino(message: MsgMigrateContract): MsgMigrateContractAmino { + const obj: any = {}; + obj.sender = message.sender; + obj.contract = message.contract; + obj.code_id = message.codeId ? message.codeId.toString() : undefined; + obj.msg = message.msg ? JSON.parse(fromUtf8(message.msg)) : undefined; + return obj; + }, + fromAminoMsg(object: MsgMigrateContractAminoMsg): MsgMigrateContract { + return MsgMigrateContract.fromAmino(object.value); + }, + toAminoMsg(message: MsgMigrateContract): MsgMigrateContractAminoMsg { + return { + type: "wasm/MsgMigrateContract", + value: MsgMigrateContract.toAmino(message) + }; + }, + fromProtoMsg(message: MsgMigrateContractProtoMsg): MsgMigrateContract { + return MsgMigrateContract.decode(message.value); + }, + toProto(message: MsgMigrateContract): Uint8Array { + return MsgMigrateContract.encode(message).finish(); + }, + toProtoMsg(message: MsgMigrateContract): MsgMigrateContractProtoMsg { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgMigrateContract", + value: MsgMigrateContract.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgMigrateContract.typeUrl, MsgMigrateContract); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgMigrateContract.aminoType, MsgMigrateContract.typeUrl); +function createBaseMsgMigrateContractResponse(): MsgMigrateContractResponse { + return { + data: new Uint8Array() + }; +} +export const MsgMigrateContractResponse = { + typeUrl: "/cosmwasm.wasm.v1.MsgMigrateContractResponse", + aminoType: "wasm/MsgMigrateContractResponse", + is(o: any): o is MsgMigrateContractResponse { + return o && (o.$typeUrl === MsgMigrateContractResponse.typeUrl || o.data instanceof Uint8Array || typeof o.data === "string"); + }, + isSDK(o: any): o is MsgMigrateContractResponseSDKType { + return o && (o.$typeUrl === MsgMigrateContractResponse.typeUrl || o.data instanceof Uint8Array || typeof o.data === "string"); + }, + isAmino(o: any): o is MsgMigrateContractResponseAmino { + return o && (o.$typeUrl === MsgMigrateContractResponse.typeUrl || o.data instanceof Uint8Array || typeof o.data === "string"); + }, + encode(message: MsgMigrateContractResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.data.length !== 0) { + writer.uint32(10).bytes(message.data); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgMigrateContractResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgMigrateContractResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.data = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): MsgMigrateContractResponse { + return { + data: isSet(object.data) ? bytesFromBase64(object.data) : new Uint8Array() + }; + }, + toJSON(message: MsgMigrateContractResponse): unknown { + const obj: any = {}; + message.data !== undefined && (obj.data = base64FromBytes(message.data !== undefined ? message.data : new Uint8Array())); + return obj; + }, + fromPartial(object: Partial): MsgMigrateContractResponse { + const message = createBaseMsgMigrateContractResponse(); + message.data = object.data ?? new Uint8Array(); + return message; + }, + fromAmino(object: MsgMigrateContractResponseAmino): MsgMigrateContractResponse { + const message = createBaseMsgMigrateContractResponse(); + if (object.data !== undefined && object.data !== null) { + message.data = bytesFromBase64(object.data); + } + return message; + }, + toAmino(message: MsgMigrateContractResponse): MsgMigrateContractResponseAmino { + const obj: any = {}; + obj.data = message.data ? base64FromBytes(message.data) : undefined; + return obj; + }, + fromAminoMsg(object: MsgMigrateContractResponseAminoMsg): MsgMigrateContractResponse { + return MsgMigrateContractResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgMigrateContractResponse): MsgMigrateContractResponseAminoMsg { + return { + type: "wasm/MsgMigrateContractResponse", + value: MsgMigrateContractResponse.toAmino(message) + }; + }, + fromProtoMsg(message: MsgMigrateContractResponseProtoMsg): MsgMigrateContractResponse { + return MsgMigrateContractResponse.decode(message.value); + }, + toProto(message: MsgMigrateContractResponse): Uint8Array { + return MsgMigrateContractResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgMigrateContractResponse): MsgMigrateContractResponseProtoMsg { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgMigrateContractResponse", + value: MsgMigrateContractResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgMigrateContractResponse.typeUrl, MsgMigrateContractResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgMigrateContractResponse.aminoType, MsgMigrateContractResponse.typeUrl); +function createBaseMsgUpdateAdmin(): MsgUpdateAdmin { + return { + sender: "", + newAdmin: "", + contract: "" + }; +} +export const MsgUpdateAdmin = { + typeUrl: "/cosmwasm.wasm.v1.MsgUpdateAdmin", + aminoType: "wasm/MsgUpdateAdmin", + is(o: any): o is MsgUpdateAdmin { + return o && (o.$typeUrl === MsgUpdateAdmin.typeUrl || typeof o.sender === "string" && typeof o.newAdmin === "string" && typeof o.contract === "string"); + }, + isSDK(o: any): o is MsgUpdateAdminSDKType { + return o && (o.$typeUrl === MsgUpdateAdmin.typeUrl || typeof o.sender === "string" && typeof o.new_admin === "string" && typeof o.contract === "string"); + }, + isAmino(o: any): o is MsgUpdateAdminAmino { + return o && (o.$typeUrl === MsgUpdateAdmin.typeUrl || typeof o.sender === "string" && typeof o.new_admin === "string" && typeof o.contract === "string"); + }, + encode(message: MsgUpdateAdmin, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.sender !== "") { + writer.uint32(10).string(message.sender); + } + if (message.newAdmin !== "") { + writer.uint32(18).string(message.newAdmin); + } + if (message.contract !== "") { + writer.uint32(26).string(message.contract); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgUpdateAdmin { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUpdateAdmin(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.sender = reader.string(); + break; + case 2: + message.newAdmin = reader.string(); + break; + case 3: + message.contract = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): MsgUpdateAdmin { + return { + sender: isSet(object.sender) ? String(object.sender) : "", + newAdmin: isSet(object.newAdmin) ? String(object.newAdmin) : "", + contract: isSet(object.contract) ? String(object.contract) : "" + }; + }, + toJSON(message: MsgUpdateAdmin): unknown { + const obj: any = {}; + message.sender !== undefined && (obj.sender = message.sender); + message.newAdmin !== undefined && (obj.newAdmin = message.newAdmin); + message.contract !== undefined && (obj.contract = message.contract); + return obj; + }, + fromPartial(object: Partial): MsgUpdateAdmin { + const message = createBaseMsgUpdateAdmin(); + message.sender = object.sender ?? ""; + message.newAdmin = object.newAdmin ?? ""; + message.contract = object.contract ?? ""; + return message; + }, + fromAmino(object: MsgUpdateAdminAmino): MsgUpdateAdmin { + const message = createBaseMsgUpdateAdmin(); + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + if (object.new_admin !== undefined && object.new_admin !== null) { + message.newAdmin = object.new_admin; + } + if (object.contract !== undefined && object.contract !== null) { + message.contract = object.contract; + } + return message; + }, + toAmino(message: MsgUpdateAdmin): MsgUpdateAdminAmino { + const obj: any = {}; + obj.sender = message.sender; + obj.new_admin = message.newAdmin; + obj.contract = message.contract; + return obj; + }, + fromAminoMsg(object: MsgUpdateAdminAminoMsg): MsgUpdateAdmin { + return MsgUpdateAdmin.fromAmino(object.value); + }, + toAminoMsg(message: MsgUpdateAdmin): MsgUpdateAdminAminoMsg { + return { + type: "wasm/MsgUpdateAdmin", + value: MsgUpdateAdmin.toAmino(message) + }; + }, + fromProtoMsg(message: MsgUpdateAdminProtoMsg): MsgUpdateAdmin { + return MsgUpdateAdmin.decode(message.value); + }, + toProto(message: MsgUpdateAdmin): Uint8Array { + return MsgUpdateAdmin.encode(message).finish(); + }, + toProtoMsg(message: MsgUpdateAdmin): MsgUpdateAdminProtoMsg { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgUpdateAdmin", + value: MsgUpdateAdmin.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgUpdateAdmin.typeUrl, MsgUpdateAdmin); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgUpdateAdmin.aminoType, MsgUpdateAdmin.typeUrl); +function createBaseMsgUpdateAdminResponse(): MsgUpdateAdminResponse { + return {}; +} +export const MsgUpdateAdminResponse = { + typeUrl: "/cosmwasm.wasm.v1.MsgUpdateAdminResponse", + aminoType: "wasm/MsgUpdateAdminResponse", + is(o: any): o is MsgUpdateAdminResponse { + return o && o.$typeUrl === MsgUpdateAdminResponse.typeUrl; + }, + isSDK(o: any): o is MsgUpdateAdminResponseSDKType { + return o && o.$typeUrl === MsgUpdateAdminResponse.typeUrl; + }, + isAmino(o: any): o is MsgUpdateAdminResponseAmino { + return o && o.$typeUrl === MsgUpdateAdminResponse.typeUrl; + }, + encode(_: MsgUpdateAdminResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgUpdateAdminResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUpdateAdminResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(_: any): MsgUpdateAdminResponse { + return {}; + }, + toJSON(_: MsgUpdateAdminResponse): unknown { + const obj: any = {}; + return obj; + }, + fromPartial(_: Partial): MsgUpdateAdminResponse { + const message = createBaseMsgUpdateAdminResponse(); + return message; + }, + fromAmino(_: MsgUpdateAdminResponseAmino): MsgUpdateAdminResponse { + const message = createBaseMsgUpdateAdminResponse(); + return message; + }, + toAmino(_: MsgUpdateAdminResponse): MsgUpdateAdminResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgUpdateAdminResponseAminoMsg): MsgUpdateAdminResponse { + return MsgUpdateAdminResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgUpdateAdminResponse): MsgUpdateAdminResponseAminoMsg { + return { + type: "wasm/MsgUpdateAdminResponse", + value: MsgUpdateAdminResponse.toAmino(message) + }; + }, + fromProtoMsg(message: MsgUpdateAdminResponseProtoMsg): MsgUpdateAdminResponse { + return MsgUpdateAdminResponse.decode(message.value); + }, + toProto(message: MsgUpdateAdminResponse): Uint8Array { + return MsgUpdateAdminResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgUpdateAdminResponse): MsgUpdateAdminResponseProtoMsg { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgUpdateAdminResponse", + value: MsgUpdateAdminResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgUpdateAdminResponse.typeUrl, MsgUpdateAdminResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgUpdateAdminResponse.aminoType, MsgUpdateAdminResponse.typeUrl); +function createBaseMsgClearAdmin(): MsgClearAdmin { + return { + sender: "", + contract: "" + }; +} +export const MsgClearAdmin = { + typeUrl: "/cosmwasm.wasm.v1.MsgClearAdmin", + aminoType: "wasm/MsgClearAdmin", + is(o: any): o is MsgClearAdmin { + return o && (o.$typeUrl === MsgClearAdmin.typeUrl || typeof o.sender === "string" && typeof o.contract === "string"); + }, + isSDK(o: any): o is MsgClearAdminSDKType { + return o && (o.$typeUrl === MsgClearAdmin.typeUrl || typeof o.sender === "string" && typeof o.contract === "string"); + }, + isAmino(o: any): o is MsgClearAdminAmino { + return o && (o.$typeUrl === MsgClearAdmin.typeUrl || typeof o.sender === "string" && typeof o.contract === "string"); + }, + encode(message: MsgClearAdmin, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.sender !== "") { + writer.uint32(10).string(message.sender); + } + if (message.contract !== "") { + writer.uint32(26).string(message.contract); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgClearAdmin { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgClearAdmin(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.sender = reader.string(); + break; + case 3: + message.contract = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): MsgClearAdmin { + return { + sender: isSet(object.sender) ? String(object.sender) : "", + contract: isSet(object.contract) ? String(object.contract) : "" + }; + }, + toJSON(message: MsgClearAdmin): unknown { + const obj: any = {}; + message.sender !== undefined && (obj.sender = message.sender); + message.contract !== undefined && (obj.contract = message.contract); + return obj; + }, + fromPartial(object: Partial): MsgClearAdmin { + const message = createBaseMsgClearAdmin(); + message.sender = object.sender ?? ""; + message.contract = object.contract ?? ""; + return message; + }, + fromAmino(object: MsgClearAdminAmino): MsgClearAdmin { + const message = createBaseMsgClearAdmin(); + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + if (object.contract !== undefined && object.contract !== null) { + message.contract = object.contract; + } + return message; + }, + toAmino(message: MsgClearAdmin): MsgClearAdminAmino { + const obj: any = {}; + obj.sender = message.sender; + obj.contract = message.contract; + return obj; + }, + fromAminoMsg(object: MsgClearAdminAminoMsg): MsgClearAdmin { + return MsgClearAdmin.fromAmino(object.value); + }, + toAminoMsg(message: MsgClearAdmin): MsgClearAdminAminoMsg { + return { + type: "wasm/MsgClearAdmin", + value: MsgClearAdmin.toAmino(message) + }; + }, + fromProtoMsg(message: MsgClearAdminProtoMsg): MsgClearAdmin { + return MsgClearAdmin.decode(message.value); + }, + toProto(message: MsgClearAdmin): Uint8Array { + return MsgClearAdmin.encode(message).finish(); + }, + toProtoMsg(message: MsgClearAdmin): MsgClearAdminProtoMsg { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgClearAdmin", + value: MsgClearAdmin.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgClearAdmin.typeUrl, MsgClearAdmin); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgClearAdmin.aminoType, MsgClearAdmin.typeUrl); +function createBaseMsgClearAdminResponse(): MsgClearAdminResponse { + return {}; +} +export const MsgClearAdminResponse = { + typeUrl: "/cosmwasm.wasm.v1.MsgClearAdminResponse", + aminoType: "wasm/MsgClearAdminResponse", + is(o: any): o is MsgClearAdminResponse { + return o && o.$typeUrl === MsgClearAdminResponse.typeUrl; + }, + isSDK(o: any): o is MsgClearAdminResponseSDKType { + return o && o.$typeUrl === MsgClearAdminResponse.typeUrl; + }, + isAmino(o: any): o is MsgClearAdminResponseAmino { + return o && o.$typeUrl === MsgClearAdminResponse.typeUrl; + }, + encode(_: MsgClearAdminResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgClearAdminResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgClearAdminResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(_: any): MsgClearAdminResponse { + return {}; + }, + toJSON(_: MsgClearAdminResponse): unknown { + const obj: any = {}; + return obj; + }, + fromPartial(_: Partial): MsgClearAdminResponse { + const message = createBaseMsgClearAdminResponse(); + return message; + }, + fromAmino(_: MsgClearAdminResponseAmino): MsgClearAdminResponse { + const message = createBaseMsgClearAdminResponse(); + return message; + }, + toAmino(_: MsgClearAdminResponse): MsgClearAdminResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgClearAdminResponseAminoMsg): MsgClearAdminResponse { + return MsgClearAdminResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgClearAdminResponse): MsgClearAdminResponseAminoMsg { + return { + type: "wasm/MsgClearAdminResponse", + value: MsgClearAdminResponse.toAmino(message) + }; + }, + fromProtoMsg(message: MsgClearAdminResponseProtoMsg): MsgClearAdminResponse { + return MsgClearAdminResponse.decode(message.value); + }, + toProto(message: MsgClearAdminResponse): Uint8Array { + return MsgClearAdminResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgClearAdminResponse): MsgClearAdminResponseProtoMsg { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgClearAdminResponse", + value: MsgClearAdminResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgClearAdminResponse.typeUrl, MsgClearAdminResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgClearAdminResponse.aminoType, MsgClearAdminResponse.typeUrl); +function createBaseMsgUpdateInstantiateConfig(): MsgUpdateInstantiateConfig { + return { + sender: "", + codeId: BigInt(0), + newInstantiatePermission: undefined + }; +} +export const MsgUpdateInstantiateConfig = { + typeUrl: "/cosmwasm.wasm.v1.MsgUpdateInstantiateConfig", + aminoType: "wasm/MsgUpdateInstantiateConfig", + is(o: any): o is MsgUpdateInstantiateConfig { + return o && (o.$typeUrl === MsgUpdateInstantiateConfig.typeUrl || typeof o.sender === "string" && typeof o.codeId === "bigint"); + }, + isSDK(o: any): o is MsgUpdateInstantiateConfigSDKType { + return o && (o.$typeUrl === MsgUpdateInstantiateConfig.typeUrl || typeof o.sender === "string" && typeof o.code_id === "bigint"); + }, + isAmino(o: any): o is MsgUpdateInstantiateConfigAmino { + return o && (o.$typeUrl === MsgUpdateInstantiateConfig.typeUrl || typeof o.sender === "string" && typeof o.code_id === "bigint"); + }, + encode(message: MsgUpdateInstantiateConfig, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.sender !== "") { writer.uint32(10).string(message.sender); } - if (message.admin !== "") { - writer.uint32(18).string(message.admin); + if (message.codeId !== BigInt(0)) { + writer.uint32(16).uint64(message.codeId); + } + if (message.newInstantiatePermission !== undefined) { + AccessConfig.encode(message.newInstantiatePermission, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgUpdateInstantiateConfig { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUpdateInstantiateConfig(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.sender = reader.string(); + break; + case 2: + message.codeId = reader.uint64(); + break; + case 3: + message.newInstantiatePermission = AccessConfig.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): MsgUpdateInstantiateConfig { + return { + sender: isSet(object.sender) ? String(object.sender) : "", + codeId: isSet(object.codeId) ? BigInt(object.codeId.toString()) : BigInt(0), + newInstantiatePermission: isSet(object.newInstantiatePermission) ? AccessConfig.fromJSON(object.newInstantiatePermission) : undefined + }; + }, + toJSON(message: MsgUpdateInstantiateConfig): unknown { + const obj: any = {}; + message.sender !== undefined && (obj.sender = message.sender); + message.codeId !== undefined && (obj.codeId = (message.codeId || BigInt(0)).toString()); + message.newInstantiatePermission !== undefined && (obj.newInstantiatePermission = message.newInstantiatePermission ? AccessConfig.toJSON(message.newInstantiatePermission) : undefined); + return obj; + }, + fromPartial(object: Partial): MsgUpdateInstantiateConfig { + const message = createBaseMsgUpdateInstantiateConfig(); + message.sender = object.sender ?? ""; + message.codeId = object.codeId !== undefined && object.codeId !== null ? BigInt(object.codeId.toString()) : BigInt(0); + message.newInstantiatePermission = object.newInstantiatePermission !== undefined && object.newInstantiatePermission !== null ? AccessConfig.fromPartial(object.newInstantiatePermission) : undefined; + return message; + }, + fromAmino(object: MsgUpdateInstantiateConfigAmino): MsgUpdateInstantiateConfig { + const message = createBaseMsgUpdateInstantiateConfig(); + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + if (object.code_id !== undefined && object.code_id !== null) { + message.codeId = BigInt(object.code_id); + } + if (object.new_instantiate_permission !== undefined && object.new_instantiate_permission !== null) { + message.newInstantiatePermission = AccessConfig.fromAmino(object.new_instantiate_permission); + } + return message; + }, + toAmino(message: MsgUpdateInstantiateConfig): MsgUpdateInstantiateConfigAmino { + const obj: any = {}; + obj.sender = message.sender; + obj.code_id = message.codeId ? message.codeId.toString() : undefined; + obj.new_instantiate_permission = message.newInstantiatePermission ? AccessConfig.toAmino(message.newInstantiatePermission) : undefined; + return obj; + }, + fromAminoMsg(object: MsgUpdateInstantiateConfigAminoMsg): MsgUpdateInstantiateConfig { + return MsgUpdateInstantiateConfig.fromAmino(object.value); + }, + toAminoMsg(message: MsgUpdateInstantiateConfig): MsgUpdateInstantiateConfigAminoMsg { + return { + type: "wasm/MsgUpdateInstantiateConfig", + value: MsgUpdateInstantiateConfig.toAmino(message) + }; + }, + fromProtoMsg(message: MsgUpdateInstantiateConfigProtoMsg): MsgUpdateInstantiateConfig { + return MsgUpdateInstantiateConfig.decode(message.value); + }, + toProto(message: MsgUpdateInstantiateConfig): Uint8Array { + return MsgUpdateInstantiateConfig.encode(message).finish(); + }, + toProtoMsg(message: MsgUpdateInstantiateConfig): MsgUpdateInstantiateConfigProtoMsg { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgUpdateInstantiateConfig", + value: MsgUpdateInstantiateConfig.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgUpdateInstantiateConfig.typeUrl, MsgUpdateInstantiateConfig); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgUpdateInstantiateConfig.aminoType, MsgUpdateInstantiateConfig.typeUrl); +function createBaseMsgUpdateInstantiateConfigResponse(): MsgUpdateInstantiateConfigResponse { + return {}; +} +export const MsgUpdateInstantiateConfigResponse = { + typeUrl: "/cosmwasm.wasm.v1.MsgUpdateInstantiateConfigResponse", + aminoType: "wasm/MsgUpdateInstantiateConfigResponse", + is(o: any): o is MsgUpdateInstantiateConfigResponse { + return o && o.$typeUrl === MsgUpdateInstantiateConfigResponse.typeUrl; + }, + isSDK(o: any): o is MsgUpdateInstantiateConfigResponseSDKType { + return o && o.$typeUrl === MsgUpdateInstantiateConfigResponse.typeUrl; + }, + isAmino(o: any): o is MsgUpdateInstantiateConfigResponseAmino { + return o && o.$typeUrl === MsgUpdateInstantiateConfigResponse.typeUrl; + }, + encode(_: MsgUpdateInstantiateConfigResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgUpdateInstantiateConfigResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUpdateInstantiateConfigResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(_: any): MsgUpdateInstantiateConfigResponse { + return {}; + }, + toJSON(_: MsgUpdateInstantiateConfigResponse): unknown { + const obj: any = {}; + return obj; + }, + fromPartial(_: Partial): MsgUpdateInstantiateConfigResponse { + const message = createBaseMsgUpdateInstantiateConfigResponse(); + return message; + }, + fromAmino(_: MsgUpdateInstantiateConfigResponseAmino): MsgUpdateInstantiateConfigResponse { + const message = createBaseMsgUpdateInstantiateConfigResponse(); + return message; + }, + toAmino(_: MsgUpdateInstantiateConfigResponse): MsgUpdateInstantiateConfigResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgUpdateInstantiateConfigResponseAminoMsg): MsgUpdateInstantiateConfigResponse { + return MsgUpdateInstantiateConfigResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgUpdateInstantiateConfigResponse): MsgUpdateInstantiateConfigResponseAminoMsg { + return { + type: "wasm/MsgUpdateInstantiateConfigResponse", + value: MsgUpdateInstantiateConfigResponse.toAmino(message) + }; + }, + fromProtoMsg(message: MsgUpdateInstantiateConfigResponseProtoMsg): MsgUpdateInstantiateConfigResponse { + return MsgUpdateInstantiateConfigResponse.decode(message.value); + }, + toProto(message: MsgUpdateInstantiateConfigResponse): Uint8Array { + return MsgUpdateInstantiateConfigResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgUpdateInstantiateConfigResponse): MsgUpdateInstantiateConfigResponseProtoMsg { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgUpdateInstantiateConfigResponse", + value: MsgUpdateInstantiateConfigResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgUpdateInstantiateConfigResponse.typeUrl, MsgUpdateInstantiateConfigResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgUpdateInstantiateConfigResponse.aminoType, MsgUpdateInstantiateConfigResponse.typeUrl); +function createBaseMsgUpdateParams(): MsgUpdateParams { + return { + authority: "", + params: Params.fromPartial({}) + }; +} +export const MsgUpdateParams = { + typeUrl: "/cosmwasm.wasm.v1.MsgUpdateParams", + aminoType: "wasm/MsgUpdateParams", + is(o: any): o is MsgUpdateParams { + return o && (o.$typeUrl === MsgUpdateParams.typeUrl || typeof o.authority === "string" && Params.is(o.params)); + }, + isSDK(o: any): o is MsgUpdateParamsSDKType { + return o && (o.$typeUrl === MsgUpdateParams.typeUrl || typeof o.authority === "string" && Params.isSDK(o.params)); + }, + isAmino(o: any): o is MsgUpdateParamsAmino { + return o && (o.$typeUrl === MsgUpdateParams.typeUrl || typeof o.authority === "string" && Params.isAmino(o.params)); + }, + encode(message: MsgUpdateParams, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.authority !== "") { + writer.uint32(10).string(message.authority); + } + if (message.params !== undefined) { + Params.encode(message.params, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgUpdateParams { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUpdateParams(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.authority = reader.string(); + break; + case 2: + message.params = Params.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): MsgUpdateParams { + return { + authority: isSet(object.authority) ? String(object.authority) : "", + params: isSet(object.params) ? Params.fromJSON(object.params) : undefined + }; + }, + toJSON(message: MsgUpdateParams): unknown { + const obj: any = {}; + message.authority !== undefined && (obj.authority = message.authority); + message.params !== undefined && (obj.params = message.params ? Params.toJSON(message.params) : undefined); + return obj; + }, + fromPartial(object: Partial): MsgUpdateParams { + const message = createBaseMsgUpdateParams(); + message.authority = object.authority ?? ""; + message.params = object.params !== undefined && object.params !== null ? Params.fromPartial(object.params) : undefined; + return message; + }, + fromAmino(object: MsgUpdateParamsAmino): MsgUpdateParams { + const message = createBaseMsgUpdateParams(); + if (object.authority !== undefined && object.authority !== null) { + message.authority = object.authority; + } + if (object.params !== undefined && object.params !== null) { + message.params = Params.fromAmino(object.params); } - if (message.codeId !== BigInt(0)) { - writer.uint32(24).uint64(message.codeId); + return message; + }, + toAmino(message: MsgUpdateParams): MsgUpdateParamsAmino { + const obj: any = {}; + obj.authority = message.authority; + obj.params = message.params ? Params.toAmino(message.params) : Params.fromPartial({}); + return obj; + }, + fromAminoMsg(object: MsgUpdateParamsAminoMsg): MsgUpdateParams { + return MsgUpdateParams.fromAmino(object.value); + }, + toAminoMsg(message: MsgUpdateParams): MsgUpdateParamsAminoMsg { + return { + type: "wasm/MsgUpdateParams", + value: MsgUpdateParams.toAmino(message) + }; + }, + fromProtoMsg(message: MsgUpdateParamsProtoMsg): MsgUpdateParams { + return MsgUpdateParams.decode(message.value); + }, + toProto(message: MsgUpdateParams): Uint8Array { + return MsgUpdateParams.encode(message).finish(); + }, + toProtoMsg(message: MsgUpdateParams): MsgUpdateParamsProtoMsg { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgUpdateParams", + value: MsgUpdateParams.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgUpdateParams.typeUrl, MsgUpdateParams); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgUpdateParams.aminoType, MsgUpdateParams.typeUrl); +function createBaseMsgUpdateParamsResponse(): MsgUpdateParamsResponse { + return {}; +} +export const MsgUpdateParamsResponse = { + typeUrl: "/cosmwasm.wasm.v1.MsgUpdateParamsResponse", + aminoType: "wasm/MsgUpdateParamsResponse", + is(o: any): o is MsgUpdateParamsResponse { + return o && o.$typeUrl === MsgUpdateParamsResponse.typeUrl; + }, + isSDK(o: any): o is MsgUpdateParamsResponseSDKType { + return o && o.$typeUrl === MsgUpdateParamsResponse.typeUrl; + }, + isAmino(o: any): o is MsgUpdateParamsResponseAmino { + return o && o.$typeUrl === MsgUpdateParamsResponse.typeUrl; + }, + encode(_: MsgUpdateParamsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgUpdateParamsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUpdateParamsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } } - if (message.label !== "") { - writer.uint32(34).string(message.label); + return message; + }, + fromJSON(_: any): MsgUpdateParamsResponse { + return {}; + }, + toJSON(_: MsgUpdateParamsResponse): unknown { + const obj: any = {}; + return obj; + }, + fromPartial(_: Partial): MsgUpdateParamsResponse { + const message = createBaseMsgUpdateParamsResponse(); + return message; + }, + fromAmino(_: MsgUpdateParamsResponseAmino): MsgUpdateParamsResponse { + const message = createBaseMsgUpdateParamsResponse(); + return message; + }, + toAmino(_: MsgUpdateParamsResponse): MsgUpdateParamsResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgUpdateParamsResponseAminoMsg): MsgUpdateParamsResponse { + return MsgUpdateParamsResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgUpdateParamsResponse): MsgUpdateParamsResponseAminoMsg { + return { + type: "wasm/MsgUpdateParamsResponse", + value: MsgUpdateParamsResponse.toAmino(message) + }; + }, + fromProtoMsg(message: MsgUpdateParamsResponseProtoMsg): MsgUpdateParamsResponse { + return MsgUpdateParamsResponse.decode(message.value); + }, + toProto(message: MsgUpdateParamsResponse): Uint8Array { + return MsgUpdateParamsResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgUpdateParamsResponse): MsgUpdateParamsResponseProtoMsg { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgUpdateParamsResponse", + value: MsgUpdateParamsResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgUpdateParamsResponse.typeUrl, MsgUpdateParamsResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgUpdateParamsResponse.aminoType, MsgUpdateParamsResponse.typeUrl); +function createBaseMsgSudoContract(): MsgSudoContract { + return { + authority: "", + contract: "", + msg: new Uint8Array() + }; +} +export const MsgSudoContract = { + typeUrl: "/cosmwasm.wasm.v1.MsgSudoContract", + aminoType: "wasm/MsgSudoContract", + is(o: any): o is MsgSudoContract { + return o && (o.$typeUrl === MsgSudoContract.typeUrl || typeof o.authority === "string" && typeof o.contract === "string" && (o.msg instanceof Uint8Array || typeof o.msg === "string")); + }, + isSDK(o: any): o is MsgSudoContractSDKType { + return o && (o.$typeUrl === MsgSudoContract.typeUrl || typeof o.authority === "string" && typeof o.contract === "string" && (o.msg instanceof Uint8Array || typeof o.msg === "string")); + }, + isAmino(o: any): o is MsgSudoContractAmino { + return o && (o.$typeUrl === MsgSudoContract.typeUrl || typeof o.authority === "string" && typeof o.contract === "string" && (o.msg instanceof Uint8Array || typeof o.msg === "string")); + }, + encode(message: MsgSudoContract, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.authority !== "") { + writer.uint32(10).string(message.authority); } - if (message.msg.length !== 0) { - writer.uint32(42).bytes(message.msg); + if (message.contract !== "") { + writer.uint32(18).string(message.contract); } - for (const v of message.funds) { - Coin.encode(v!, writer.uint32(50).fork()).ldelim(); + if (message.msg.length !== 0) { + writer.uint32(26).bytes(message.msg); } return writer; }, - decode(input: BinaryReader | Uint8Array, length?: number): MsgInstantiateContract { + decode(input: BinaryReader | Uint8Array, length?: number): MsgSudoContract { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseMsgInstantiateContract(); + const message = createBaseMsgSudoContract(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.sender = reader.string(); + message.authority = reader.string(); break; case 2: - message.admin = reader.string(); + message.contract = reader.string(); break; case 3: - message.codeId = reader.uint64(); - break; - case 4: - message.label = reader.string(); - break; - case 5: message.msg = reader.bytes(); break; - case 6: - message.funds.push(Coin.decode(reader, reader.uint32())); - break; default: reader.skipType(tag & 7); break; @@ -735,134 +3270,307 @@ export const MsgInstantiateContract = { } return message; }, - fromPartial(object: Partial): MsgInstantiateContract { - const message = createBaseMsgInstantiateContract(); - message.sender = object.sender ?? ""; - message.admin = object.admin ?? ""; - message.codeId = object.codeId !== undefined && object.codeId !== null ? BigInt(object.codeId.toString()) : BigInt(0); - message.label = object.label ?? ""; + fromJSON(object: any): MsgSudoContract { + return { + authority: isSet(object.authority) ? String(object.authority) : "", + contract: isSet(object.contract) ? String(object.contract) : "", + msg: isSet(object.msg) ? bytesFromBase64(object.msg) : new Uint8Array() + }; + }, + toJSON(message: MsgSudoContract): unknown { + const obj: any = {}; + message.authority !== undefined && (obj.authority = message.authority); + message.contract !== undefined && (obj.contract = message.contract); + message.msg !== undefined && (obj.msg = base64FromBytes(message.msg !== undefined ? message.msg : new Uint8Array())); + return obj; + }, + fromPartial(object: Partial): MsgSudoContract { + const message = createBaseMsgSudoContract(); + message.authority = object.authority ?? ""; + message.contract = object.contract ?? ""; message.msg = object.msg ?? new Uint8Array(); - message.funds = object.funds?.map(e => Coin.fromPartial(e)) || []; return message; }, - fromAmino(object: MsgInstantiateContractAmino): MsgInstantiateContract { - return { - sender: object.sender, - admin: object.admin, - codeId: BigInt(object.code_id), - label: object.label, - msg: toUtf8(JSON.stringify(object.msg)), - funds: Array.isArray(object?.funds) ? object.funds.map((e: any) => Coin.fromAmino(e)) : [] - }; + fromAmino(object: MsgSudoContractAmino): MsgSudoContract { + const message = createBaseMsgSudoContract(); + if (object.authority !== undefined && object.authority !== null) { + message.authority = object.authority; + } + if (object.contract !== undefined && object.contract !== null) { + message.contract = object.contract; + } + if (object.msg !== undefined && object.msg !== null) { + message.msg = toUtf8(JSON.stringify(object.msg)); + } + return message; }, - toAmino(message: MsgInstantiateContract): MsgInstantiateContractAmino { + toAmino(message: MsgSudoContract): MsgSudoContractAmino { const obj: any = {}; - obj.sender = message.sender; - obj.admin = message.admin; - obj.code_id = message.codeId ? message.codeId.toString() : undefined; - obj.label = message.label; + obj.authority = message.authority; + obj.contract = message.contract; obj.msg = message.msg ? JSON.parse(fromUtf8(message.msg)) : undefined; - if (message.funds) { - obj.funds = message.funds.map(e => e ? Coin.toAmino(e) : undefined); - } else { - obj.funds = []; - } return obj; }, - fromAminoMsg(object: MsgInstantiateContractAminoMsg): MsgInstantiateContract { - return MsgInstantiateContract.fromAmino(object.value); + fromAminoMsg(object: MsgSudoContractAminoMsg): MsgSudoContract { + return MsgSudoContract.fromAmino(object.value); }, - toAminoMsg(message: MsgInstantiateContract): MsgInstantiateContractAminoMsg { + toAminoMsg(message: MsgSudoContract): MsgSudoContractAminoMsg { return { - type: "wasm/MsgInstantiateContract", - value: MsgInstantiateContract.toAmino(message) + type: "wasm/MsgSudoContract", + value: MsgSudoContract.toAmino(message) }; }, - fromProtoMsg(message: MsgInstantiateContractProtoMsg): MsgInstantiateContract { - return MsgInstantiateContract.decode(message.value); + fromProtoMsg(message: MsgSudoContractProtoMsg): MsgSudoContract { + return MsgSudoContract.decode(message.value); }, - toProto(message: MsgInstantiateContract): Uint8Array { - return MsgInstantiateContract.encode(message).finish(); + toProto(message: MsgSudoContract): Uint8Array { + return MsgSudoContract.encode(message).finish(); }, - toProtoMsg(message: MsgInstantiateContract): MsgInstantiateContractProtoMsg { + toProtoMsg(message: MsgSudoContract): MsgSudoContractProtoMsg { return { - typeUrl: "/cosmwasm.wasm.v1.MsgInstantiateContract", - value: MsgInstantiateContract.encode(message).finish() + typeUrl: "/cosmwasm.wasm.v1.MsgSudoContract", + value: MsgSudoContract.encode(message).finish() }; } }; -function createBaseMsgInstantiateContract2(): MsgInstantiateContract2 { +GlobalDecoderRegistry.register(MsgSudoContract.typeUrl, MsgSudoContract); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgSudoContract.aminoType, MsgSudoContract.typeUrl); +function createBaseMsgSudoContractResponse(): MsgSudoContractResponse { return { - sender: "", - admin: "", - codeId: BigInt(0), - label: "", - msg: new Uint8Array(), - funds: [], - salt: new Uint8Array(), - fixMsg: false + data: new Uint8Array() }; } -export const MsgInstantiateContract2 = { - typeUrl: "/cosmwasm.wasm.v1.MsgInstantiateContract2", - encode(message: MsgInstantiateContract2, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { - if (message.sender !== "") { - writer.uint32(10).string(message.sender); +export const MsgSudoContractResponse = { + typeUrl: "/cosmwasm.wasm.v1.MsgSudoContractResponse", + aminoType: "wasm/MsgSudoContractResponse", + is(o: any): o is MsgSudoContractResponse { + return o && (o.$typeUrl === MsgSudoContractResponse.typeUrl || o.data instanceof Uint8Array || typeof o.data === "string"); + }, + isSDK(o: any): o is MsgSudoContractResponseSDKType { + return o && (o.$typeUrl === MsgSudoContractResponse.typeUrl || o.data instanceof Uint8Array || typeof o.data === "string"); + }, + isAmino(o: any): o is MsgSudoContractResponseAmino { + return o && (o.$typeUrl === MsgSudoContractResponse.typeUrl || o.data instanceof Uint8Array || typeof o.data === "string"); + }, + encode(message: MsgSudoContractResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.data.length !== 0) { + writer.uint32(10).bytes(message.data); } - if (message.admin !== "") { - writer.uint32(18).string(message.admin); + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgSudoContractResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgSudoContractResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.data = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } } - if (message.codeId !== BigInt(0)) { - writer.uint32(24).uint64(message.codeId); + return message; + }, + fromJSON(object: any): MsgSudoContractResponse { + return { + data: isSet(object.data) ? bytesFromBase64(object.data) : new Uint8Array() + }; + }, + toJSON(message: MsgSudoContractResponse): unknown { + const obj: any = {}; + message.data !== undefined && (obj.data = base64FromBytes(message.data !== undefined ? message.data : new Uint8Array())); + return obj; + }, + fromPartial(object: Partial): MsgSudoContractResponse { + const message = createBaseMsgSudoContractResponse(); + message.data = object.data ?? new Uint8Array(); + return message; + }, + fromAmino(object: MsgSudoContractResponseAmino): MsgSudoContractResponse { + const message = createBaseMsgSudoContractResponse(); + if (object.data !== undefined && object.data !== null) { + message.data = bytesFromBase64(object.data); } - if (message.label !== "") { - writer.uint32(34).string(message.label); + return message; + }, + toAmino(message: MsgSudoContractResponse): MsgSudoContractResponseAmino { + const obj: any = {}; + obj.data = message.data ? base64FromBytes(message.data) : undefined; + return obj; + }, + fromAminoMsg(object: MsgSudoContractResponseAminoMsg): MsgSudoContractResponse { + return MsgSudoContractResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgSudoContractResponse): MsgSudoContractResponseAminoMsg { + return { + type: "wasm/MsgSudoContractResponse", + value: MsgSudoContractResponse.toAmino(message) + }; + }, + fromProtoMsg(message: MsgSudoContractResponseProtoMsg): MsgSudoContractResponse { + return MsgSudoContractResponse.decode(message.value); + }, + toProto(message: MsgSudoContractResponse): Uint8Array { + return MsgSudoContractResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgSudoContractResponse): MsgSudoContractResponseProtoMsg { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgSudoContractResponse", + value: MsgSudoContractResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgSudoContractResponse.typeUrl, MsgSudoContractResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgSudoContractResponse.aminoType, MsgSudoContractResponse.typeUrl); +function createBaseMsgPinCodes(): MsgPinCodes { + return { + authority: "", + codeIds: [] + }; +} +export const MsgPinCodes = { + typeUrl: "/cosmwasm.wasm.v1.MsgPinCodes", + aminoType: "wasm/MsgPinCodes", + is(o: any): o is MsgPinCodes { + return o && (o.$typeUrl === MsgPinCodes.typeUrl || typeof o.authority === "string" && Array.isArray(o.codeIds) && (!o.codeIds.length || typeof o.codeIds[0] === "bigint")); + }, + isSDK(o: any): o is MsgPinCodesSDKType { + return o && (o.$typeUrl === MsgPinCodes.typeUrl || typeof o.authority === "string" && Array.isArray(o.code_ids) && (!o.code_ids.length || typeof o.code_ids[0] === "bigint")); + }, + isAmino(o: any): o is MsgPinCodesAmino { + return o && (o.$typeUrl === MsgPinCodes.typeUrl || typeof o.authority === "string" && Array.isArray(o.code_ids) && (!o.code_ids.length || typeof o.code_ids[0] === "bigint")); + }, + encode(message: MsgPinCodes, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.authority !== "") { + writer.uint32(10).string(message.authority); } - if (message.msg.length !== 0) { - writer.uint32(42).bytes(message.msg); + writer.uint32(18).fork(); + for (const v of message.codeIds) { + writer.uint64(v); } - for (const v of message.funds) { - Coin.encode(v!, writer.uint32(50).fork()).ldelim(); + writer.ldelim(); + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgPinCodes { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgPinCodes(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.authority = reader.string(); + break; + case 2: + if ((tag & 7) === 2) { + const end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) { + message.codeIds.push(reader.uint64()); + } + } else { + message.codeIds.push(reader.uint64()); + } + break; + default: + reader.skipType(tag & 7); + break; + } } - if (message.salt.length !== 0) { - writer.uint32(58).bytes(message.salt); + return message; + }, + fromJSON(object: any): MsgPinCodes { + return { + authority: isSet(object.authority) ? String(object.authority) : "", + codeIds: Array.isArray(object?.codeIds) ? object.codeIds.map((e: any) => BigInt(e.toString())) : [] + }; + }, + toJSON(message: MsgPinCodes): unknown { + const obj: any = {}; + message.authority !== undefined && (obj.authority = message.authority); + if (message.codeIds) { + obj.codeIds = message.codeIds.map(e => (e || BigInt(0)).toString()); + } else { + obj.codeIds = []; } - if (message.fixMsg === true) { - writer.uint32(64).bool(message.fixMsg); + return obj; + }, + fromPartial(object: Partial): MsgPinCodes { + const message = createBaseMsgPinCodes(); + message.authority = object.authority ?? ""; + message.codeIds = object.codeIds?.map(e => BigInt(e.toString())) || []; + return message; + }, + fromAmino(object: MsgPinCodesAmino): MsgPinCodes { + const message = createBaseMsgPinCodes(); + if (object.authority !== undefined && object.authority !== null) { + message.authority = object.authority; + } + message.codeIds = object.code_ids?.map(e => BigInt(e)) || []; + return message; + }, + toAmino(message: MsgPinCodes): MsgPinCodesAmino { + const obj: any = {}; + obj.authority = message.authority; + if (message.codeIds) { + obj.code_ids = message.codeIds.map(e => e.toString()); + } else { + obj.code_ids = []; } + return obj; + }, + fromAminoMsg(object: MsgPinCodesAminoMsg): MsgPinCodes { + return MsgPinCodes.fromAmino(object.value); + }, + toAminoMsg(message: MsgPinCodes): MsgPinCodesAminoMsg { + return { + type: "wasm/MsgPinCodes", + value: MsgPinCodes.toAmino(message) + }; + }, + fromProtoMsg(message: MsgPinCodesProtoMsg): MsgPinCodes { + return MsgPinCodes.decode(message.value); + }, + toProto(message: MsgPinCodes): Uint8Array { + return MsgPinCodes.encode(message).finish(); + }, + toProtoMsg(message: MsgPinCodes): MsgPinCodesProtoMsg { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgPinCodes", + value: MsgPinCodes.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgPinCodes.typeUrl, MsgPinCodes); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgPinCodes.aminoType, MsgPinCodes.typeUrl); +function createBaseMsgPinCodesResponse(): MsgPinCodesResponse { + return {}; +} +export const MsgPinCodesResponse = { + typeUrl: "/cosmwasm.wasm.v1.MsgPinCodesResponse", + aminoType: "wasm/MsgPinCodesResponse", + is(o: any): o is MsgPinCodesResponse { + return o && o.$typeUrl === MsgPinCodesResponse.typeUrl; + }, + isSDK(o: any): o is MsgPinCodesResponseSDKType { + return o && o.$typeUrl === MsgPinCodesResponse.typeUrl; + }, + isAmino(o: any): o is MsgPinCodesResponseAmino { + return o && o.$typeUrl === MsgPinCodesResponse.typeUrl; + }, + encode(_: MsgPinCodesResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, - decode(input: BinaryReader | Uint8Array, length?: number): MsgInstantiateContract2 { + decode(input: BinaryReader | Uint8Array, length?: number): MsgPinCodesResponse { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseMsgInstantiateContract2(); + const message = createBaseMsgPinCodesResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.sender = reader.string(); - break; - case 2: - message.admin = reader.string(); - break; - case 3: - message.codeId = reader.uint64(); - break; - case 4: - message.label = reader.string(); - break; - case 5: - message.msg = reader.bytes(); - break; - case 6: - message.funds.push(Coin.decode(reader, reader.uint32())); - break; - case 7: - message.salt = reader.bytes(); - break; - case 8: - message.fixMsg = reader.bool(); - break; default: reader.skipType(tag & 7); break; @@ -870,97 +3578,97 @@ export const MsgInstantiateContract2 = { } return message; }, - fromPartial(object: Partial): MsgInstantiateContract2 { - const message = createBaseMsgInstantiateContract2(); - message.sender = object.sender ?? ""; - message.admin = object.admin ?? ""; - message.codeId = object.codeId !== undefined && object.codeId !== null ? BigInt(object.codeId.toString()) : BigInt(0); - message.label = object.label ?? ""; - message.msg = object.msg ?? new Uint8Array(); - message.funds = object.funds?.map(e => Coin.fromPartial(e)) || []; - message.salt = object.salt ?? new Uint8Array(); - message.fixMsg = object.fixMsg ?? false; + fromJSON(_: any): MsgPinCodesResponse { + return {}; + }, + toJSON(_: MsgPinCodesResponse): unknown { + const obj: any = {}; + return obj; + }, + fromPartial(_: Partial): MsgPinCodesResponse { + const message = createBaseMsgPinCodesResponse(); return message; }, - fromAmino(object: MsgInstantiateContract2Amino): MsgInstantiateContract2 { - return { - sender: object.sender, - admin: object.admin, - codeId: BigInt(object.code_id), - label: object.label, - msg: toUtf8(JSON.stringify(object.msg)), - funds: Array.isArray(object?.funds) ? object.funds.map((e: any) => Coin.fromAmino(e)) : [], - salt: object.salt, - fixMsg: object.fix_msg - }; + fromAmino(_: MsgPinCodesResponseAmino): MsgPinCodesResponse { + const message = createBaseMsgPinCodesResponse(); + return message; }, - toAmino(message: MsgInstantiateContract2): MsgInstantiateContract2Amino { + toAmino(_: MsgPinCodesResponse): MsgPinCodesResponseAmino { const obj: any = {}; - obj.sender = message.sender; - obj.admin = message.admin; - obj.code_id = message.codeId ? message.codeId.toString() : undefined; - obj.label = message.label; - obj.msg = message.msg ? JSON.parse(fromUtf8(message.msg)) : undefined; - if (message.funds) { - obj.funds = message.funds.map(e => e ? Coin.toAmino(e) : undefined); - } else { - obj.funds = []; - } - obj.salt = message.salt; - obj.fix_msg = message.fixMsg; return obj; }, - fromAminoMsg(object: MsgInstantiateContract2AminoMsg): MsgInstantiateContract2 { - return MsgInstantiateContract2.fromAmino(object.value); + fromAminoMsg(object: MsgPinCodesResponseAminoMsg): MsgPinCodesResponse { + return MsgPinCodesResponse.fromAmino(object.value); }, - toAminoMsg(message: MsgInstantiateContract2): MsgInstantiateContract2AminoMsg { + toAminoMsg(message: MsgPinCodesResponse): MsgPinCodesResponseAminoMsg { return { - type: "wasm/MsgInstantiateContract2", - value: MsgInstantiateContract2.toAmino(message) + type: "wasm/MsgPinCodesResponse", + value: MsgPinCodesResponse.toAmino(message) }; }, - fromProtoMsg(message: MsgInstantiateContract2ProtoMsg): MsgInstantiateContract2 { - return MsgInstantiateContract2.decode(message.value); + fromProtoMsg(message: MsgPinCodesResponseProtoMsg): MsgPinCodesResponse { + return MsgPinCodesResponse.decode(message.value); }, - toProto(message: MsgInstantiateContract2): Uint8Array { - return MsgInstantiateContract2.encode(message).finish(); + toProto(message: MsgPinCodesResponse): Uint8Array { + return MsgPinCodesResponse.encode(message).finish(); }, - toProtoMsg(message: MsgInstantiateContract2): MsgInstantiateContract2ProtoMsg { + toProtoMsg(message: MsgPinCodesResponse): MsgPinCodesResponseProtoMsg { return { - typeUrl: "/cosmwasm.wasm.v1.MsgInstantiateContract2", - value: MsgInstantiateContract2.encode(message).finish() + typeUrl: "/cosmwasm.wasm.v1.MsgPinCodesResponse", + value: MsgPinCodesResponse.encode(message).finish() }; } }; -function createBaseMsgInstantiateContractResponse(): MsgInstantiateContractResponse { +GlobalDecoderRegistry.register(MsgPinCodesResponse.typeUrl, MsgPinCodesResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgPinCodesResponse.aminoType, MsgPinCodesResponse.typeUrl); +function createBaseMsgUnpinCodes(): MsgUnpinCodes { return { - address: "", - data: new Uint8Array() + authority: "", + codeIds: [] }; } -export const MsgInstantiateContractResponse = { - typeUrl: "/cosmwasm.wasm.v1.MsgInstantiateContractResponse", - encode(message: MsgInstantiateContractResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { - if (message.address !== "") { - writer.uint32(10).string(message.address); +export const MsgUnpinCodes = { + typeUrl: "/cosmwasm.wasm.v1.MsgUnpinCodes", + aminoType: "wasm/MsgUnpinCodes", + is(o: any): o is MsgUnpinCodes { + return o && (o.$typeUrl === MsgUnpinCodes.typeUrl || typeof o.authority === "string" && Array.isArray(o.codeIds) && (!o.codeIds.length || typeof o.codeIds[0] === "bigint")); + }, + isSDK(o: any): o is MsgUnpinCodesSDKType { + return o && (o.$typeUrl === MsgUnpinCodes.typeUrl || typeof o.authority === "string" && Array.isArray(o.code_ids) && (!o.code_ids.length || typeof o.code_ids[0] === "bigint")); + }, + isAmino(o: any): o is MsgUnpinCodesAmino { + return o && (o.$typeUrl === MsgUnpinCodes.typeUrl || typeof o.authority === "string" && Array.isArray(o.code_ids) && (!o.code_ids.length || typeof o.code_ids[0] === "bigint")); + }, + encode(message: MsgUnpinCodes, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.authority !== "") { + writer.uint32(10).string(message.authority); } - if (message.data.length !== 0) { - writer.uint32(18).bytes(message.data); + writer.uint32(18).fork(); + for (const v of message.codeIds) { + writer.uint64(v); } + writer.ldelim(); return writer; }, - decode(input: BinaryReader | Uint8Array, length?: number): MsgInstantiateContractResponse { + decode(input: BinaryReader | Uint8Array, length?: number): MsgUnpinCodes { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseMsgInstantiateContractResponse(); + const message = createBaseMsgUnpinCodes(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.address = reader.string(); + message.authority = reader.string(); break; case 2: - message.data = reader.bytes(); + if ((tag & 7) === 2) { + const end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) { + message.codeIds.push(reader.uint64()); + } + } else { + message.codeIds.push(reader.uint64()); + } break; default: reader.skipType(tag & 7); @@ -969,76 +3677,95 @@ export const MsgInstantiateContractResponse = { } return message; }, - fromPartial(object: Partial): MsgInstantiateContractResponse { - const message = createBaseMsgInstantiateContractResponse(); - message.address = object.address ?? ""; - message.data = object.data ?? new Uint8Array(); - return message; - }, - fromAmino(object: MsgInstantiateContractResponseAmino): MsgInstantiateContractResponse { + fromJSON(object: any): MsgUnpinCodes { return { - address: object.address, - data: object.data + authority: isSet(object.authority) ? String(object.authority) : "", + codeIds: Array.isArray(object?.codeIds) ? object.codeIds.map((e: any) => BigInt(e.toString())) : [] }; }, - toAmino(message: MsgInstantiateContractResponse): MsgInstantiateContractResponseAmino { + toJSON(message: MsgUnpinCodes): unknown { const obj: any = {}; - obj.address = message.address; - obj.data = message.data; + message.authority !== undefined && (obj.authority = message.authority); + if (message.codeIds) { + obj.codeIds = message.codeIds.map(e => (e || BigInt(0)).toString()); + } else { + obj.codeIds = []; + } return obj; }, - fromAminoMsg(object: MsgInstantiateContractResponseAminoMsg): MsgInstantiateContractResponse { - return MsgInstantiateContractResponse.fromAmino(object.value); + fromPartial(object: Partial): MsgUnpinCodes { + const message = createBaseMsgUnpinCodes(); + message.authority = object.authority ?? ""; + message.codeIds = object.codeIds?.map(e => BigInt(e.toString())) || []; + return message; }, - toAminoMsg(message: MsgInstantiateContractResponse): MsgInstantiateContractResponseAminoMsg { + fromAmino(object: MsgUnpinCodesAmino): MsgUnpinCodes { + const message = createBaseMsgUnpinCodes(); + if (object.authority !== undefined && object.authority !== null) { + message.authority = object.authority; + } + message.codeIds = object.code_ids?.map(e => BigInt(e)) || []; + return message; + }, + toAmino(message: MsgUnpinCodes): MsgUnpinCodesAmino { + const obj: any = {}; + obj.authority = message.authority; + if (message.codeIds) { + obj.code_ids = message.codeIds.map(e => e.toString()); + } else { + obj.code_ids = []; + } + return obj; + }, + fromAminoMsg(object: MsgUnpinCodesAminoMsg): MsgUnpinCodes { + return MsgUnpinCodes.fromAmino(object.value); + }, + toAminoMsg(message: MsgUnpinCodes): MsgUnpinCodesAminoMsg { return { - type: "wasm/MsgInstantiateContractResponse", - value: MsgInstantiateContractResponse.toAmino(message) + type: "wasm/MsgUnpinCodes", + value: MsgUnpinCodes.toAmino(message) }; }, - fromProtoMsg(message: MsgInstantiateContractResponseProtoMsg): MsgInstantiateContractResponse { - return MsgInstantiateContractResponse.decode(message.value); + fromProtoMsg(message: MsgUnpinCodesProtoMsg): MsgUnpinCodes { + return MsgUnpinCodes.decode(message.value); }, - toProto(message: MsgInstantiateContractResponse): Uint8Array { - return MsgInstantiateContractResponse.encode(message).finish(); + toProto(message: MsgUnpinCodes): Uint8Array { + return MsgUnpinCodes.encode(message).finish(); }, - toProtoMsg(message: MsgInstantiateContractResponse): MsgInstantiateContractResponseProtoMsg { + toProtoMsg(message: MsgUnpinCodes): MsgUnpinCodesProtoMsg { return { - typeUrl: "/cosmwasm.wasm.v1.MsgInstantiateContractResponse", - value: MsgInstantiateContractResponse.encode(message).finish() + typeUrl: "/cosmwasm.wasm.v1.MsgUnpinCodes", + value: MsgUnpinCodes.encode(message).finish() }; } }; -function createBaseMsgInstantiateContract2Response(): MsgInstantiateContract2Response { - return { - address: "", - data: new Uint8Array() - }; +GlobalDecoderRegistry.register(MsgUnpinCodes.typeUrl, MsgUnpinCodes); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgUnpinCodes.aminoType, MsgUnpinCodes.typeUrl); +function createBaseMsgUnpinCodesResponse(): MsgUnpinCodesResponse { + return {}; } -export const MsgInstantiateContract2Response = { - typeUrl: "/cosmwasm.wasm.v1.MsgInstantiateContract2Response", - encode(message: MsgInstantiateContract2Response, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { - if (message.address !== "") { - writer.uint32(10).string(message.address); - } - if (message.data.length !== 0) { - writer.uint32(18).bytes(message.data); - } +export const MsgUnpinCodesResponse = { + typeUrl: "/cosmwasm.wasm.v1.MsgUnpinCodesResponse", + aminoType: "wasm/MsgUnpinCodesResponse", + is(o: any): o is MsgUnpinCodesResponse { + return o && o.$typeUrl === MsgUnpinCodesResponse.typeUrl; + }, + isSDK(o: any): o is MsgUnpinCodesResponseSDKType { + return o && o.$typeUrl === MsgUnpinCodesResponse.typeUrl; + }, + isAmino(o: any): o is MsgUnpinCodesResponseAmino { + return o && o.$typeUrl === MsgUnpinCodesResponse.typeUrl; + }, + encode(_: MsgUnpinCodesResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, - decode(input: BinaryReader | Uint8Array, length?: number): MsgInstantiateContract2Response { + decode(input: BinaryReader | Uint8Array, length?: number): MsgUnpinCodesResponse { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseMsgInstantiateContract2Response(); + const message = createBaseMsgUnpinCodesResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.address = reader.string(); - break; - case 2: - message.data = reader.bytes(); - break; default: reader.skipType(tag & 7); break; @@ -1046,90 +3773,152 @@ export const MsgInstantiateContract2Response = { } return message; }, - fromPartial(object: Partial): MsgInstantiateContract2Response { - const message = createBaseMsgInstantiateContract2Response(); - message.address = object.address ?? ""; - message.data = object.data ?? new Uint8Array(); + fromJSON(_: any): MsgUnpinCodesResponse { + return {}; + }, + toJSON(_: MsgUnpinCodesResponse): unknown { + const obj: any = {}; + return obj; + }, + fromPartial(_: Partial): MsgUnpinCodesResponse { + const message = createBaseMsgUnpinCodesResponse(); return message; }, - fromAmino(object: MsgInstantiateContract2ResponseAmino): MsgInstantiateContract2Response { - return { - address: object.address, - data: object.data - }; + fromAmino(_: MsgUnpinCodesResponseAmino): MsgUnpinCodesResponse { + const message = createBaseMsgUnpinCodesResponse(); + return message; }, - toAmino(message: MsgInstantiateContract2Response): MsgInstantiateContract2ResponseAmino { + toAmino(_: MsgUnpinCodesResponse): MsgUnpinCodesResponseAmino { const obj: any = {}; - obj.address = message.address; - obj.data = message.data; return obj; }, - fromAminoMsg(object: MsgInstantiateContract2ResponseAminoMsg): MsgInstantiateContract2Response { - return MsgInstantiateContract2Response.fromAmino(object.value); + fromAminoMsg(object: MsgUnpinCodesResponseAminoMsg): MsgUnpinCodesResponse { + return MsgUnpinCodesResponse.fromAmino(object.value); }, - toAminoMsg(message: MsgInstantiateContract2Response): MsgInstantiateContract2ResponseAminoMsg { + toAminoMsg(message: MsgUnpinCodesResponse): MsgUnpinCodesResponseAminoMsg { return { - type: "wasm/MsgInstantiateContract2Response", - value: MsgInstantiateContract2Response.toAmino(message) + type: "wasm/MsgUnpinCodesResponse", + value: MsgUnpinCodesResponse.toAmino(message) }; }, - fromProtoMsg(message: MsgInstantiateContract2ResponseProtoMsg): MsgInstantiateContract2Response { - return MsgInstantiateContract2Response.decode(message.value); + fromProtoMsg(message: MsgUnpinCodesResponseProtoMsg): MsgUnpinCodesResponse { + return MsgUnpinCodesResponse.decode(message.value); }, - toProto(message: MsgInstantiateContract2Response): Uint8Array { - return MsgInstantiateContract2Response.encode(message).finish(); + toProto(message: MsgUnpinCodesResponse): Uint8Array { + return MsgUnpinCodesResponse.encode(message).finish(); }, - toProtoMsg(message: MsgInstantiateContract2Response): MsgInstantiateContract2ResponseProtoMsg { + toProtoMsg(message: MsgUnpinCodesResponse): MsgUnpinCodesResponseProtoMsg { return { - typeUrl: "/cosmwasm.wasm.v1.MsgInstantiateContract2Response", - value: MsgInstantiateContract2Response.encode(message).finish() + typeUrl: "/cosmwasm.wasm.v1.MsgUnpinCodesResponse", + value: MsgUnpinCodesResponse.encode(message).finish() }; } }; -function createBaseMsgExecuteContract(): MsgExecuteContract { +GlobalDecoderRegistry.register(MsgUnpinCodesResponse.typeUrl, MsgUnpinCodesResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgUnpinCodesResponse.aminoType, MsgUnpinCodesResponse.typeUrl); +function createBaseMsgStoreAndInstantiateContract(): MsgStoreAndInstantiateContract { return { - sender: "", - contract: "", + authority: "", + wasmByteCode: new Uint8Array(), + instantiatePermission: undefined, + unpinCode: false, + admin: "", + label: "", msg: new Uint8Array(), - funds: [] + funds: [], + source: "", + builder: "", + codeHash: new Uint8Array() }; } -export const MsgExecuteContract = { - typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", - encode(message: MsgExecuteContract, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { - if (message.sender !== "") { - writer.uint32(10).string(message.sender); +export const MsgStoreAndInstantiateContract = { + typeUrl: "/cosmwasm.wasm.v1.MsgStoreAndInstantiateContract", + aminoType: "wasm/MsgStoreAndInstantiateContract", + is(o: any): o is MsgStoreAndInstantiateContract { + return o && (o.$typeUrl === MsgStoreAndInstantiateContract.typeUrl || typeof o.authority === "string" && (o.wasmByteCode instanceof Uint8Array || typeof o.wasmByteCode === "string") && typeof o.unpinCode === "boolean" && typeof o.admin === "string" && typeof o.label === "string" && (o.msg instanceof Uint8Array || typeof o.msg === "string") && Array.isArray(o.funds) && (!o.funds.length || Coin.is(o.funds[0])) && typeof o.source === "string" && typeof o.builder === "string" && (o.codeHash instanceof Uint8Array || typeof o.codeHash === "string")); + }, + isSDK(o: any): o is MsgStoreAndInstantiateContractSDKType { + return o && (o.$typeUrl === MsgStoreAndInstantiateContract.typeUrl || typeof o.authority === "string" && (o.wasm_byte_code instanceof Uint8Array || typeof o.wasm_byte_code === "string") && typeof o.unpin_code === "boolean" && typeof o.admin === "string" && typeof o.label === "string" && (o.msg instanceof Uint8Array || typeof o.msg === "string") && Array.isArray(o.funds) && (!o.funds.length || Coin.isSDK(o.funds[0])) && typeof o.source === "string" && typeof o.builder === "string" && (o.code_hash instanceof Uint8Array || typeof o.code_hash === "string")); + }, + isAmino(o: any): o is MsgStoreAndInstantiateContractAmino { + return o && (o.$typeUrl === MsgStoreAndInstantiateContract.typeUrl || typeof o.authority === "string" && (o.wasm_byte_code instanceof Uint8Array || typeof o.wasm_byte_code === "string") && typeof o.unpin_code === "boolean" && typeof o.admin === "string" && typeof o.label === "string" && (o.msg instanceof Uint8Array || typeof o.msg === "string") && Array.isArray(o.funds) && (!o.funds.length || Coin.isAmino(o.funds[0])) && typeof o.source === "string" && typeof o.builder === "string" && (o.code_hash instanceof Uint8Array || typeof o.code_hash === "string")); + }, + encode(message: MsgStoreAndInstantiateContract, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.authority !== "") { + writer.uint32(10).string(message.authority); } - if (message.contract !== "") { - writer.uint32(18).string(message.contract); + if (message.wasmByteCode.length !== 0) { + writer.uint32(26).bytes(message.wasmByteCode); + } + if (message.instantiatePermission !== undefined) { + AccessConfig.encode(message.instantiatePermission, writer.uint32(34).fork()).ldelim(); + } + if (message.unpinCode === true) { + writer.uint32(40).bool(message.unpinCode); + } + if (message.admin !== "") { + writer.uint32(50).string(message.admin); + } + if (message.label !== "") { + writer.uint32(58).string(message.label); } if (message.msg.length !== 0) { - writer.uint32(26).bytes(message.msg); + writer.uint32(66).bytes(message.msg); } for (const v of message.funds) { - Coin.encode(v!, writer.uint32(42).fork()).ldelim(); + Coin.encode(v!, writer.uint32(74).fork()).ldelim(); + } + if (message.source !== "") { + writer.uint32(82).string(message.source); + } + if (message.builder !== "") { + writer.uint32(90).string(message.builder); + } + if (message.codeHash.length !== 0) { + writer.uint32(98).bytes(message.codeHash); } return writer; }, - decode(input: BinaryReader | Uint8Array, length?: number): MsgExecuteContract { + decode(input: BinaryReader | Uint8Array, length?: number): MsgStoreAndInstantiateContract { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseMsgExecuteContract(); + const message = createBaseMsgStoreAndInstantiateContract(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.sender = reader.string(); - break; - case 2: - message.contract = reader.string(); + message.authority = reader.string(); break; case 3: - message.msg = reader.bytes(); + message.wasmByteCode = reader.bytes(); + break; + case 4: + message.instantiatePermission = AccessConfig.decode(reader, reader.uint32()); break; case 5: + message.unpinCode = reader.bool(); + break; + case 6: + message.admin = reader.string(); + break; + case 7: + message.label = reader.string(); + break; + case 8: + message.msg = reader.bytes(); + break; + case 9: message.funds.push(Coin.decode(reader, reader.uint32())); break; + case 10: + message.source = reader.string(); + break; + case 11: + message.builder = reader.string(); + break; + case 12: + message.codeHash = reader.bytes(); + break; default: reader.skipType(tag & 7); break; @@ -1137,77 +3926,171 @@ export const MsgExecuteContract = { } return message; }, - fromPartial(object: Partial): MsgExecuteContract { - const message = createBaseMsgExecuteContract(); - message.sender = object.sender ?? ""; - message.contract = object.contract ?? ""; + fromJSON(object: any): MsgStoreAndInstantiateContract { + return { + authority: isSet(object.authority) ? String(object.authority) : "", + wasmByteCode: isSet(object.wasmByteCode) ? bytesFromBase64(object.wasmByteCode) : new Uint8Array(), + instantiatePermission: isSet(object.instantiatePermission) ? AccessConfig.fromJSON(object.instantiatePermission) : undefined, + unpinCode: isSet(object.unpinCode) ? Boolean(object.unpinCode) : false, + admin: isSet(object.admin) ? String(object.admin) : "", + label: isSet(object.label) ? String(object.label) : "", + msg: isSet(object.msg) ? bytesFromBase64(object.msg) : new Uint8Array(), + funds: Array.isArray(object?.funds) ? object.funds.map((e: any) => Coin.fromJSON(e)) : [], + source: isSet(object.source) ? String(object.source) : "", + builder: isSet(object.builder) ? String(object.builder) : "", + codeHash: isSet(object.codeHash) ? bytesFromBase64(object.codeHash) : new Uint8Array() + }; + }, + toJSON(message: MsgStoreAndInstantiateContract): unknown { + const obj: any = {}; + message.authority !== undefined && (obj.authority = message.authority); + message.wasmByteCode !== undefined && (obj.wasmByteCode = base64FromBytes(message.wasmByteCode !== undefined ? message.wasmByteCode : new Uint8Array())); + message.instantiatePermission !== undefined && (obj.instantiatePermission = message.instantiatePermission ? AccessConfig.toJSON(message.instantiatePermission) : undefined); + message.unpinCode !== undefined && (obj.unpinCode = message.unpinCode); + message.admin !== undefined && (obj.admin = message.admin); + message.label !== undefined && (obj.label = message.label); + message.msg !== undefined && (obj.msg = base64FromBytes(message.msg !== undefined ? message.msg : new Uint8Array())); + if (message.funds) { + obj.funds = message.funds.map(e => e ? Coin.toJSON(e) : undefined); + } else { + obj.funds = []; + } + message.source !== undefined && (obj.source = message.source); + message.builder !== undefined && (obj.builder = message.builder); + message.codeHash !== undefined && (obj.codeHash = base64FromBytes(message.codeHash !== undefined ? message.codeHash : new Uint8Array())); + return obj; + }, + fromPartial(object: Partial): MsgStoreAndInstantiateContract { + const message = createBaseMsgStoreAndInstantiateContract(); + message.authority = object.authority ?? ""; + message.wasmByteCode = object.wasmByteCode ?? new Uint8Array(); + message.instantiatePermission = object.instantiatePermission !== undefined && object.instantiatePermission !== null ? AccessConfig.fromPartial(object.instantiatePermission) : undefined; + message.unpinCode = object.unpinCode ?? false; + message.admin = object.admin ?? ""; + message.label = object.label ?? ""; message.msg = object.msg ?? new Uint8Array(); message.funds = object.funds?.map(e => Coin.fromPartial(e)) || []; + message.source = object.source ?? ""; + message.builder = object.builder ?? ""; + message.codeHash = object.codeHash ?? new Uint8Array(); return message; }, - fromAmino(object: MsgExecuteContractAmino): MsgExecuteContract { - return { - sender: object.sender, - contract: object.contract, - msg: toUtf8(JSON.stringify(object.msg)), - funds: Array.isArray(object?.funds) ? object.funds.map((e: any) => Coin.fromAmino(e)) : [] - }; + fromAmino(object: MsgStoreAndInstantiateContractAmino): MsgStoreAndInstantiateContract { + const message = createBaseMsgStoreAndInstantiateContract(); + if (object.authority !== undefined && object.authority !== null) { + message.authority = object.authority; + } + if (object.wasm_byte_code !== undefined && object.wasm_byte_code !== null) { + message.wasmByteCode = fromBase64(object.wasm_byte_code); + } + if (object.instantiate_permission !== undefined && object.instantiate_permission !== null) { + message.instantiatePermission = AccessConfig.fromAmino(object.instantiate_permission); + } + if (object.unpin_code !== undefined && object.unpin_code !== null) { + message.unpinCode = object.unpin_code; + } + if (object.admin !== undefined && object.admin !== null) { + message.admin = object.admin; + } + if (object.label !== undefined && object.label !== null) { + message.label = object.label; + } + if (object.msg !== undefined && object.msg !== null) { + message.msg = toUtf8(JSON.stringify(object.msg)); + } + message.funds = object.funds?.map(e => Coin.fromAmino(e)) || []; + if (object.source !== undefined && object.source !== null) { + message.source = object.source; + } + if (object.builder !== undefined && object.builder !== null) { + message.builder = object.builder; + } + if (object.code_hash !== undefined && object.code_hash !== null) { + message.codeHash = bytesFromBase64(object.code_hash); + } + return message; }, - toAmino(message: MsgExecuteContract): MsgExecuteContractAmino { + toAmino(message: MsgStoreAndInstantiateContract): MsgStoreAndInstantiateContractAmino { const obj: any = {}; - obj.sender = message.sender; - obj.contract = message.contract; + obj.authority = message.authority; + obj.wasm_byte_code = message.wasmByteCode ? toBase64(message.wasmByteCode) : undefined; + obj.instantiate_permission = message.instantiatePermission ? AccessConfig.toAmino(message.instantiatePermission) : undefined; + obj.unpin_code = message.unpinCode; + obj.admin = message.admin; + obj.label = message.label; obj.msg = message.msg ? JSON.parse(fromUtf8(message.msg)) : undefined; if (message.funds) { obj.funds = message.funds.map(e => e ? Coin.toAmino(e) : undefined); } else { obj.funds = []; } + obj.source = message.source; + obj.builder = message.builder; + obj.code_hash = message.codeHash ? base64FromBytes(message.codeHash) : undefined; return obj; }, - fromAminoMsg(object: MsgExecuteContractAminoMsg): MsgExecuteContract { - return MsgExecuteContract.fromAmino(object.value); + fromAminoMsg(object: MsgStoreAndInstantiateContractAminoMsg): MsgStoreAndInstantiateContract { + return MsgStoreAndInstantiateContract.fromAmino(object.value); }, - toAminoMsg(message: MsgExecuteContract): MsgExecuteContractAminoMsg { + toAminoMsg(message: MsgStoreAndInstantiateContract): MsgStoreAndInstantiateContractAminoMsg { return { - type: "wasm/MsgExecuteContract", - value: MsgExecuteContract.toAmino(message) + type: "wasm/MsgStoreAndInstantiateContract", + value: MsgStoreAndInstantiateContract.toAmino(message) }; }, - fromProtoMsg(message: MsgExecuteContractProtoMsg): MsgExecuteContract { - return MsgExecuteContract.decode(message.value); + fromProtoMsg(message: MsgStoreAndInstantiateContractProtoMsg): MsgStoreAndInstantiateContract { + return MsgStoreAndInstantiateContract.decode(message.value); }, - toProto(message: MsgExecuteContract): Uint8Array { - return MsgExecuteContract.encode(message).finish(); + toProto(message: MsgStoreAndInstantiateContract): Uint8Array { + return MsgStoreAndInstantiateContract.encode(message).finish(); }, - toProtoMsg(message: MsgExecuteContract): MsgExecuteContractProtoMsg { + toProtoMsg(message: MsgStoreAndInstantiateContract): MsgStoreAndInstantiateContractProtoMsg { return { - typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", - value: MsgExecuteContract.encode(message).finish() + typeUrl: "/cosmwasm.wasm.v1.MsgStoreAndInstantiateContract", + value: MsgStoreAndInstantiateContract.encode(message).finish() }; } }; -function createBaseMsgExecuteContractResponse(): MsgExecuteContractResponse { +GlobalDecoderRegistry.register(MsgStoreAndInstantiateContract.typeUrl, MsgStoreAndInstantiateContract); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgStoreAndInstantiateContract.aminoType, MsgStoreAndInstantiateContract.typeUrl); +function createBaseMsgStoreAndInstantiateContractResponse(): MsgStoreAndInstantiateContractResponse { return { + address: "", data: new Uint8Array() }; } -export const MsgExecuteContractResponse = { - typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContractResponse", - encode(message: MsgExecuteContractResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { +export const MsgStoreAndInstantiateContractResponse = { + typeUrl: "/cosmwasm.wasm.v1.MsgStoreAndInstantiateContractResponse", + aminoType: "wasm/MsgStoreAndInstantiateContractResponse", + is(o: any): o is MsgStoreAndInstantiateContractResponse { + return o && (o.$typeUrl === MsgStoreAndInstantiateContractResponse.typeUrl || typeof o.address === "string" && (o.data instanceof Uint8Array || typeof o.data === "string")); + }, + isSDK(o: any): o is MsgStoreAndInstantiateContractResponseSDKType { + return o && (o.$typeUrl === MsgStoreAndInstantiateContractResponse.typeUrl || typeof o.address === "string" && (o.data instanceof Uint8Array || typeof o.data === "string")); + }, + isAmino(o: any): o is MsgStoreAndInstantiateContractResponseAmino { + return o && (o.$typeUrl === MsgStoreAndInstantiateContractResponse.typeUrl || typeof o.address === "string" && (o.data instanceof Uint8Array || typeof o.data === "string")); + }, + encode(message: MsgStoreAndInstantiateContractResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.address !== "") { + writer.uint32(10).string(message.address); + } if (message.data.length !== 0) { - writer.uint32(10).bytes(message.data); + writer.uint32(18).bytes(message.data); } return writer; }, - decode(input: BinaryReader | Uint8Array, length?: number): MsgExecuteContractResponse { + decode(input: BinaryReader | Uint8Array, length?: number): MsgStoreAndInstantiateContractResponse { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseMsgExecuteContractResponse(); + const message = createBaseMsgStoreAndInstantiateContractResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: + message.address = reader.string(); + break; + case 2: message.data = reader.bytes(); break; default: @@ -1217,86 +4100,103 @@ export const MsgExecuteContractResponse = { } return message; }, - fromPartial(object: Partial): MsgExecuteContractResponse { - const message = createBaseMsgExecuteContractResponse(); + fromJSON(object: any): MsgStoreAndInstantiateContractResponse { + return { + address: isSet(object.address) ? String(object.address) : "", + data: isSet(object.data) ? bytesFromBase64(object.data) : new Uint8Array() + }; + }, + toJSON(message: MsgStoreAndInstantiateContractResponse): unknown { + const obj: any = {}; + message.address !== undefined && (obj.address = message.address); + message.data !== undefined && (obj.data = base64FromBytes(message.data !== undefined ? message.data : new Uint8Array())); + return obj; + }, + fromPartial(object: Partial): MsgStoreAndInstantiateContractResponse { + const message = createBaseMsgStoreAndInstantiateContractResponse(); + message.address = object.address ?? ""; message.data = object.data ?? new Uint8Array(); return message; }, - fromAmino(object: MsgExecuteContractResponseAmino): MsgExecuteContractResponse { - return { - data: object.data - }; + fromAmino(object: MsgStoreAndInstantiateContractResponseAmino): MsgStoreAndInstantiateContractResponse { + const message = createBaseMsgStoreAndInstantiateContractResponse(); + if (object.address !== undefined && object.address !== null) { + message.address = object.address; + } + if (object.data !== undefined && object.data !== null) { + message.data = bytesFromBase64(object.data); + } + return message; }, - toAmino(message: MsgExecuteContractResponse): MsgExecuteContractResponseAmino { + toAmino(message: MsgStoreAndInstantiateContractResponse): MsgStoreAndInstantiateContractResponseAmino { const obj: any = {}; - obj.data = message.data; + obj.address = message.address; + obj.data = message.data ? base64FromBytes(message.data) : undefined; return obj; }, - fromAminoMsg(object: MsgExecuteContractResponseAminoMsg): MsgExecuteContractResponse { - return MsgExecuteContractResponse.fromAmino(object.value); + fromAminoMsg(object: MsgStoreAndInstantiateContractResponseAminoMsg): MsgStoreAndInstantiateContractResponse { + return MsgStoreAndInstantiateContractResponse.fromAmino(object.value); }, - toAminoMsg(message: MsgExecuteContractResponse): MsgExecuteContractResponseAminoMsg { + toAminoMsg(message: MsgStoreAndInstantiateContractResponse): MsgStoreAndInstantiateContractResponseAminoMsg { return { - type: "wasm/MsgExecuteContractResponse", - value: MsgExecuteContractResponse.toAmino(message) + type: "wasm/MsgStoreAndInstantiateContractResponse", + value: MsgStoreAndInstantiateContractResponse.toAmino(message) }; }, - fromProtoMsg(message: MsgExecuteContractResponseProtoMsg): MsgExecuteContractResponse { - return MsgExecuteContractResponse.decode(message.value); + fromProtoMsg(message: MsgStoreAndInstantiateContractResponseProtoMsg): MsgStoreAndInstantiateContractResponse { + return MsgStoreAndInstantiateContractResponse.decode(message.value); }, - toProto(message: MsgExecuteContractResponse): Uint8Array { - return MsgExecuteContractResponse.encode(message).finish(); + toProto(message: MsgStoreAndInstantiateContractResponse): Uint8Array { + return MsgStoreAndInstantiateContractResponse.encode(message).finish(); }, - toProtoMsg(message: MsgExecuteContractResponse): MsgExecuteContractResponseProtoMsg { + toProtoMsg(message: MsgStoreAndInstantiateContractResponse): MsgStoreAndInstantiateContractResponseProtoMsg { return { - typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContractResponse", - value: MsgExecuteContractResponse.encode(message).finish() + typeUrl: "/cosmwasm.wasm.v1.MsgStoreAndInstantiateContractResponse", + value: MsgStoreAndInstantiateContractResponse.encode(message).finish() }; } }; -function createBaseMsgMigrateContract(): MsgMigrateContract { +GlobalDecoderRegistry.register(MsgStoreAndInstantiateContractResponse.typeUrl, MsgStoreAndInstantiateContractResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgStoreAndInstantiateContractResponse.aminoType, MsgStoreAndInstantiateContractResponse.typeUrl); +function createBaseMsgAddCodeUploadParamsAddresses(): MsgAddCodeUploadParamsAddresses { return { - sender: "", - contract: "", - codeId: BigInt(0), - msg: new Uint8Array() + authority: "", + addresses: [] }; } -export const MsgMigrateContract = { - typeUrl: "/cosmwasm.wasm.v1.MsgMigrateContract", - encode(message: MsgMigrateContract, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { - if (message.sender !== "") { - writer.uint32(10).string(message.sender); - } - if (message.contract !== "") { - writer.uint32(18).string(message.contract); - } - if (message.codeId !== BigInt(0)) { - writer.uint32(24).uint64(message.codeId); +export const MsgAddCodeUploadParamsAddresses = { + typeUrl: "/cosmwasm.wasm.v1.MsgAddCodeUploadParamsAddresses", + aminoType: "wasm/MsgAddCodeUploadParamsAddresses", + is(o: any): o is MsgAddCodeUploadParamsAddresses { + return o && (o.$typeUrl === MsgAddCodeUploadParamsAddresses.typeUrl || typeof o.authority === "string" && Array.isArray(o.addresses) && (!o.addresses.length || typeof o.addresses[0] === "string")); + }, + isSDK(o: any): o is MsgAddCodeUploadParamsAddressesSDKType { + return o && (o.$typeUrl === MsgAddCodeUploadParamsAddresses.typeUrl || typeof o.authority === "string" && Array.isArray(o.addresses) && (!o.addresses.length || typeof o.addresses[0] === "string")); + }, + isAmino(o: any): o is MsgAddCodeUploadParamsAddressesAmino { + return o && (o.$typeUrl === MsgAddCodeUploadParamsAddresses.typeUrl || typeof o.authority === "string" && Array.isArray(o.addresses) && (!o.addresses.length || typeof o.addresses[0] === "string")); + }, + encode(message: MsgAddCodeUploadParamsAddresses, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.authority !== "") { + writer.uint32(10).string(message.authority); } - if (message.msg.length !== 0) { - writer.uint32(34).bytes(message.msg); + for (const v of message.addresses) { + writer.uint32(18).string(v!); } return writer; }, - decode(input: BinaryReader | Uint8Array, length?: number): MsgMigrateContract { + decode(input: BinaryReader | Uint8Array, length?: number): MsgAddCodeUploadParamsAddresses { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseMsgMigrateContract(); + const message = createBaseMsgAddCodeUploadParamsAddresses(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.sender = reader.string(); + message.authority = reader.string(); break; case 2: - message.contract = reader.string(); - break; - case 3: - message.codeId = reader.uint64(); - break; - case 4: - message.msg = reader.bytes(); + message.addresses.push(reader.string()); break; default: reader.skipType(tag & 7); @@ -1305,75 +4205,95 @@ export const MsgMigrateContract = { } return message; }, - fromPartial(object: Partial): MsgMigrateContract { - const message = createBaseMsgMigrateContract(); - message.sender = object.sender ?? ""; - message.contract = object.contract ?? ""; - message.codeId = object.codeId !== undefined && object.codeId !== null ? BigInt(object.codeId.toString()) : BigInt(0); - message.msg = object.msg ?? new Uint8Array(); - return message; - }, - fromAmino(object: MsgMigrateContractAmino): MsgMigrateContract { + fromJSON(object: any): MsgAddCodeUploadParamsAddresses { return { - sender: object.sender, - contract: object.contract, - codeId: BigInt(object.code_id), - msg: toUtf8(JSON.stringify(object.msg)) + authority: isSet(object.authority) ? String(object.authority) : "", + addresses: Array.isArray(object?.addresses) ? object.addresses.map((e: any) => String(e)) : [] }; }, - toAmino(message: MsgMigrateContract): MsgMigrateContractAmino { + toJSON(message: MsgAddCodeUploadParamsAddresses): unknown { const obj: any = {}; - obj.sender = message.sender; - obj.contract = message.contract; - obj.code_id = message.codeId ? message.codeId.toString() : undefined; - obj.msg = message.msg ? JSON.parse(fromUtf8(message.msg)) : undefined; + message.authority !== undefined && (obj.authority = message.authority); + if (message.addresses) { + obj.addresses = message.addresses.map(e => e); + } else { + obj.addresses = []; + } return obj; }, - fromAminoMsg(object: MsgMigrateContractAminoMsg): MsgMigrateContract { - return MsgMigrateContract.fromAmino(object.value); + fromPartial(object: Partial): MsgAddCodeUploadParamsAddresses { + const message = createBaseMsgAddCodeUploadParamsAddresses(); + message.authority = object.authority ?? ""; + message.addresses = object.addresses?.map(e => e) || []; + return message; }, - toAminoMsg(message: MsgMigrateContract): MsgMigrateContractAminoMsg { + fromAmino(object: MsgAddCodeUploadParamsAddressesAmino): MsgAddCodeUploadParamsAddresses { + const message = createBaseMsgAddCodeUploadParamsAddresses(); + if (object.authority !== undefined && object.authority !== null) { + message.authority = object.authority; + } + message.addresses = object.addresses?.map(e => e) || []; + return message; + }, + toAmino(message: MsgAddCodeUploadParamsAddresses): MsgAddCodeUploadParamsAddressesAmino { + const obj: any = {}; + obj.authority = message.authority; + if (message.addresses) { + obj.addresses = message.addresses.map(e => e); + } else { + obj.addresses = []; + } + return obj; + }, + fromAminoMsg(object: MsgAddCodeUploadParamsAddressesAminoMsg): MsgAddCodeUploadParamsAddresses { + return MsgAddCodeUploadParamsAddresses.fromAmino(object.value); + }, + toAminoMsg(message: MsgAddCodeUploadParamsAddresses): MsgAddCodeUploadParamsAddressesAminoMsg { return { - type: "wasm/MsgMigrateContract", - value: MsgMigrateContract.toAmino(message) + type: "wasm/MsgAddCodeUploadParamsAddresses", + value: MsgAddCodeUploadParamsAddresses.toAmino(message) }; }, - fromProtoMsg(message: MsgMigrateContractProtoMsg): MsgMigrateContract { - return MsgMigrateContract.decode(message.value); + fromProtoMsg(message: MsgAddCodeUploadParamsAddressesProtoMsg): MsgAddCodeUploadParamsAddresses { + return MsgAddCodeUploadParamsAddresses.decode(message.value); }, - toProto(message: MsgMigrateContract): Uint8Array { - return MsgMigrateContract.encode(message).finish(); + toProto(message: MsgAddCodeUploadParamsAddresses): Uint8Array { + return MsgAddCodeUploadParamsAddresses.encode(message).finish(); }, - toProtoMsg(message: MsgMigrateContract): MsgMigrateContractProtoMsg { + toProtoMsg(message: MsgAddCodeUploadParamsAddresses): MsgAddCodeUploadParamsAddressesProtoMsg { return { - typeUrl: "/cosmwasm.wasm.v1.MsgMigrateContract", - value: MsgMigrateContract.encode(message).finish() + typeUrl: "/cosmwasm.wasm.v1.MsgAddCodeUploadParamsAddresses", + value: MsgAddCodeUploadParamsAddresses.encode(message).finish() }; } }; -function createBaseMsgMigrateContractResponse(): MsgMigrateContractResponse { - return { - data: new Uint8Array() - }; +GlobalDecoderRegistry.register(MsgAddCodeUploadParamsAddresses.typeUrl, MsgAddCodeUploadParamsAddresses); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgAddCodeUploadParamsAddresses.aminoType, MsgAddCodeUploadParamsAddresses.typeUrl); +function createBaseMsgAddCodeUploadParamsAddressesResponse(): MsgAddCodeUploadParamsAddressesResponse { + return {}; } -export const MsgMigrateContractResponse = { - typeUrl: "/cosmwasm.wasm.v1.MsgMigrateContractResponse", - encode(message: MsgMigrateContractResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { - if (message.data.length !== 0) { - writer.uint32(10).bytes(message.data); - } +export const MsgAddCodeUploadParamsAddressesResponse = { + typeUrl: "/cosmwasm.wasm.v1.MsgAddCodeUploadParamsAddressesResponse", + aminoType: "wasm/MsgAddCodeUploadParamsAddressesResponse", + is(o: any): o is MsgAddCodeUploadParamsAddressesResponse { + return o && o.$typeUrl === MsgAddCodeUploadParamsAddressesResponse.typeUrl; + }, + isSDK(o: any): o is MsgAddCodeUploadParamsAddressesResponseSDKType { + return o && o.$typeUrl === MsgAddCodeUploadParamsAddressesResponse.typeUrl; + }, + isAmino(o: any): o is MsgAddCodeUploadParamsAddressesResponseAmino { + return o && o.$typeUrl === MsgAddCodeUploadParamsAddressesResponse.typeUrl; + }, + encode(_: MsgAddCodeUploadParamsAddressesResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, - decode(input: BinaryReader | Uint8Array, length?: number): MsgMigrateContractResponse { + decode(input: BinaryReader | Uint8Array, length?: number): MsgAddCodeUploadParamsAddressesResponse { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseMsgMigrateContractResponse(); + const message = createBaseMsgAddCodeUploadParamsAddressesResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.data = reader.bytes(); - break; default: reader.skipType(tag & 7); break; @@ -1381,79 +4301,88 @@ export const MsgMigrateContractResponse = { } return message; }, - fromPartial(object: Partial): MsgMigrateContractResponse { - const message = createBaseMsgMigrateContractResponse(); - message.data = object.data ?? new Uint8Array(); + fromJSON(_: any): MsgAddCodeUploadParamsAddressesResponse { + return {}; + }, + toJSON(_: MsgAddCodeUploadParamsAddressesResponse): unknown { + const obj: any = {}; + return obj; + }, + fromPartial(_: Partial): MsgAddCodeUploadParamsAddressesResponse { + const message = createBaseMsgAddCodeUploadParamsAddressesResponse(); return message; }, - fromAmino(object: MsgMigrateContractResponseAmino): MsgMigrateContractResponse { - return { - data: object.data - }; + fromAmino(_: MsgAddCodeUploadParamsAddressesResponseAmino): MsgAddCodeUploadParamsAddressesResponse { + const message = createBaseMsgAddCodeUploadParamsAddressesResponse(); + return message; }, - toAmino(message: MsgMigrateContractResponse): MsgMigrateContractResponseAmino { + toAmino(_: MsgAddCodeUploadParamsAddressesResponse): MsgAddCodeUploadParamsAddressesResponseAmino { const obj: any = {}; - obj.data = message.data; return obj; }, - fromAminoMsg(object: MsgMigrateContractResponseAminoMsg): MsgMigrateContractResponse { - return MsgMigrateContractResponse.fromAmino(object.value); + fromAminoMsg(object: MsgAddCodeUploadParamsAddressesResponseAminoMsg): MsgAddCodeUploadParamsAddressesResponse { + return MsgAddCodeUploadParamsAddressesResponse.fromAmino(object.value); }, - toAminoMsg(message: MsgMigrateContractResponse): MsgMigrateContractResponseAminoMsg { + toAminoMsg(message: MsgAddCodeUploadParamsAddressesResponse): MsgAddCodeUploadParamsAddressesResponseAminoMsg { return { - type: "wasm/MsgMigrateContractResponse", - value: MsgMigrateContractResponse.toAmino(message) + type: "wasm/MsgAddCodeUploadParamsAddressesResponse", + value: MsgAddCodeUploadParamsAddressesResponse.toAmino(message) }; }, - fromProtoMsg(message: MsgMigrateContractResponseProtoMsg): MsgMigrateContractResponse { - return MsgMigrateContractResponse.decode(message.value); + fromProtoMsg(message: MsgAddCodeUploadParamsAddressesResponseProtoMsg): MsgAddCodeUploadParamsAddressesResponse { + return MsgAddCodeUploadParamsAddressesResponse.decode(message.value); }, - toProto(message: MsgMigrateContractResponse): Uint8Array { - return MsgMigrateContractResponse.encode(message).finish(); + toProto(message: MsgAddCodeUploadParamsAddressesResponse): Uint8Array { + return MsgAddCodeUploadParamsAddressesResponse.encode(message).finish(); }, - toProtoMsg(message: MsgMigrateContractResponse): MsgMigrateContractResponseProtoMsg { + toProtoMsg(message: MsgAddCodeUploadParamsAddressesResponse): MsgAddCodeUploadParamsAddressesResponseProtoMsg { return { - typeUrl: "/cosmwasm.wasm.v1.MsgMigrateContractResponse", - value: MsgMigrateContractResponse.encode(message).finish() + typeUrl: "/cosmwasm.wasm.v1.MsgAddCodeUploadParamsAddressesResponse", + value: MsgAddCodeUploadParamsAddressesResponse.encode(message).finish() }; } }; -function createBaseMsgUpdateAdmin(): MsgUpdateAdmin { +GlobalDecoderRegistry.register(MsgAddCodeUploadParamsAddressesResponse.typeUrl, MsgAddCodeUploadParamsAddressesResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgAddCodeUploadParamsAddressesResponse.aminoType, MsgAddCodeUploadParamsAddressesResponse.typeUrl); +function createBaseMsgRemoveCodeUploadParamsAddresses(): MsgRemoveCodeUploadParamsAddresses { return { - sender: "", - newAdmin: "", - contract: "" + authority: "", + addresses: [] }; } -export const MsgUpdateAdmin = { - typeUrl: "/cosmwasm.wasm.v1.MsgUpdateAdmin", - encode(message: MsgUpdateAdmin, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { - if (message.sender !== "") { - writer.uint32(10).string(message.sender); - } - if (message.newAdmin !== "") { - writer.uint32(18).string(message.newAdmin); +export const MsgRemoveCodeUploadParamsAddresses = { + typeUrl: "/cosmwasm.wasm.v1.MsgRemoveCodeUploadParamsAddresses", + aminoType: "wasm/MsgRemoveCodeUploadParamsAddresses", + is(o: any): o is MsgRemoveCodeUploadParamsAddresses { + return o && (o.$typeUrl === MsgRemoveCodeUploadParamsAddresses.typeUrl || typeof o.authority === "string" && Array.isArray(o.addresses) && (!o.addresses.length || typeof o.addresses[0] === "string")); + }, + isSDK(o: any): o is MsgRemoveCodeUploadParamsAddressesSDKType { + return o && (o.$typeUrl === MsgRemoveCodeUploadParamsAddresses.typeUrl || typeof o.authority === "string" && Array.isArray(o.addresses) && (!o.addresses.length || typeof o.addresses[0] === "string")); + }, + isAmino(o: any): o is MsgRemoveCodeUploadParamsAddressesAmino { + return o && (o.$typeUrl === MsgRemoveCodeUploadParamsAddresses.typeUrl || typeof o.authority === "string" && Array.isArray(o.addresses) && (!o.addresses.length || typeof o.addresses[0] === "string")); + }, + encode(message: MsgRemoveCodeUploadParamsAddresses, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.authority !== "") { + writer.uint32(10).string(message.authority); } - if (message.contract !== "") { - writer.uint32(26).string(message.contract); + for (const v of message.addresses) { + writer.uint32(18).string(v!); } return writer; }, - decode(input: BinaryReader | Uint8Array, length?: number): MsgUpdateAdmin { + decode(input: BinaryReader | Uint8Array, length?: number): MsgRemoveCodeUploadParamsAddresses { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseMsgUpdateAdmin(); + const message = createBaseMsgRemoveCodeUploadParamsAddresses(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.sender = reader.string(); + message.authority = reader.string(); break; case 2: - message.newAdmin = reader.string(); - break; - case 3: - message.contract = reader.string(); + message.addresses.push(reader.string()); break; default: reader.skipType(tag & 7); @@ -1462,61 +4391,92 @@ export const MsgUpdateAdmin = { } return message; }, - fromPartial(object: Partial): MsgUpdateAdmin { - const message = createBaseMsgUpdateAdmin(); - message.sender = object.sender ?? ""; - message.newAdmin = object.newAdmin ?? ""; - message.contract = object.contract ?? ""; - return message; - }, - fromAmino(object: MsgUpdateAdminAmino): MsgUpdateAdmin { + fromJSON(object: any): MsgRemoveCodeUploadParamsAddresses { return { - sender: object.sender, - newAdmin: object.new_admin, - contract: object.contract + authority: isSet(object.authority) ? String(object.authority) : "", + addresses: Array.isArray(object?.addresses) ? object.addresses.map((e: any) => String(e)) : [] }; }, - toAmino(message: MsgUpdateAdmin): MsgUpdateAdminAmino { + toJSON(message: MsgRemoveCodeUploadParamsAddresses): unknown { const obj: any = {}; - obj.sender = message.sender; - obj.new_admin = message.newAdmin; - obj.contract = message.contract; + message.authority !== undefined && (obj.authority = message.authority); + if (message.addresses) { + obj.addresses = message.addresses.map(e => e); + } else { + obj.addresses = []; + } return obj; }, - fromAminoMsg(object: MsgUpdateAdminAminoMsg): MsgUpdateAdmin { - return MsgUpdateAdmin.fromAmino(object.value); + fromPartial(object: Partial): MsgRemoveCodeUploadParamsAddresses { + const message = createBaseMsgRemoveCodeUploadParamsAddresses(); + message.authority = object.authority ?? ""; + message.addresses = object.addresses?.map(e => e) || []; + return message; }, - toAminoMsg(message: MsgUpdateAdmin): MsgUpdateAdminAminoMsg { + fromAmino(object: MsgRemoveCodeUploadParamsAddressesAmino): MsgRemoveCodeUploadParamsAddresses { + const message = createBaseMsgRemoveCodeUploadParamsAddresses(); + if (object.authority !== undefined && object.authority !== null) { + message.authority = object.authority; + } + message.addresses = object.addresses?.map(e => e) || []; + return message; + }, + toAmino(message: MsgRemoveCodeUploadParamsAddresses): MsgRemoveCodeUploadParamsAddressesAmino { + const obj: any = {}; + obj.authority = message.authority; + if (message.addresses) { + obj.addresses = message.addresses.map(e => e); + } else { + obj.addresses = []; + } + return obj; + }, + fromAminoMsg(object: MsgRemoveCodeUploadParamsAddressesAminoMsg): MsgRemoveCodeUploadParamsAddresses { + return MsgRemoveCodeUploadParamsAddresses.fromAmino(object.value); + }, + toAminoMsg(message: MsgRemoveCodeUploadParamsAddresses): MsgRemoveCodeUploadParamsAddressesAminoMsg { return { - type: "wasm/MsgUpdateAdmin", - value: MsgUpdateAdmin.toAmino(message) + type: "wasm/MsgRemoveCodeUploadParamsAddresses", + value: MsgRemoveCodeUploadParamsAddresses.toAmino(message) }; }, - fromProtoMsg(message: MsgUpdateAdminProtoMsg): MsgUpdateAdmin { - return MsgUpdateAdmin.decode(message.value); + fromProtoMsg(message: MsgRemoveCodeUploadParamsAddressesProtoMsg): MsgRemoveCodeUploadParamsAddresses { + return MsgRemoveCodeUploadParamsAddresses.decode(message.value); }, - toProto(message: MsgUpdateAdmin): Uint8Array { - return MsgUpdateAdmin.encode(message).finish(); + toProto(message: MsgRemoveCodeUploadParamsAddresses): Uint8Array { + return MsgRemoveCodeUploadParamsAddresses.encode(message).finish(); }, - toProtoMsg(message: MsgUpdateAdmin): MsgUpdateAdminProtoMsg { + toProtoMsg(message: MsgRemoveCodeUploadParamsAddresses): MsgRemoveCodeUploadParamsAddressesProtoMsg { return { - typeUrl: "/cosmwasm.wasm.v1.MsgUpdateAdmin", - value: MsgUpdateAdmin.encode(message).finish() + typeUrl: "/cosmwasm.wasm.v1.MsgRemoveCodeUploadParamsAddresses", + value: MsgRemoveCodeUploadParamsAddresses.encode(message).finish() }; } }; -function createBaseMsgUpdateAdminResponse(): MsgUpdateAdminResponse { +GlobalDecoderRegistry.register(MsgRemoveCodeUploadParamsAddresses.typeUrl, MsgRemoveCodeUploadParamsAddresses); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgRemoveCodeUploadParamsAddresses.aminoType, MsgRemoveCodeUploadParamsAddresses.typeUrl); +function createBaseMsgRemoveCodeUploadParamsAddressesResponse(): MsgRemoveCodeUploadParamsAddressesResponse { return {}; } -export const MsgUpdateAdminResponse = { - typeUrl: "/cosmwasm.wasm.v1.MsgUpdateAdminResponse", - encode(_: MsgUpdateAdminResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { +export const MsgRemoveCodeUploadParamsAddressesResponse = { + typeUrl: "/cosmwasm.wasm.v1.MsgRemoveCodeUploadParamsAddressesResponse", + aminoType: "wasm/MsgRemoveCodeUploadParamsAddressesResponse", + is(o: any): o is MsgRemoveCodeUploadParamsAddressesResponse { + return o && o.$typeUrl === MsgRemoveCodeUploadParamsAddressesResponse.typeUrl; + }, + isSDK(o: any): o is MsgRemoveCodeUploadParamsAddressesResponseSDKType { + return o && o.$typeUrl === MsgRemoveCodeUploadParamsAddressesResponse.typeUrl; + }, + isAmino(o: any): o is MsgRemoveCodeUploadParamsAddressesResponseAmino { + return o && o.$typeUrl === MsgRemoveCodeUploadParamsAddressesResponse.typeUrl; + }, + encode(_: MsgRemoveCodeUploadParamsAddressesResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, - decode(input: BinaryReader | Uint8Array, length?: number): MsgUpdateAdminResponse { + decode(input: BinaryReader | Uint8Array, length?: number): MsgRemoveCodeUploadParamsAddressesResponse { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseMsgUpdateAdminResponse(); + const message = createBaseMsgRemoveCodeUploadParamsAddressesResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -1527,69 +4487,110 @@ export const MsgUpdateAdminResponse = { } return message; }, - fromPartial(_: Partial): MsgUpdateAdminResponse { - const message = createBaseMsgUpdateAdminResponse(); + fromJSON(_: any): MsgRemoveCodeUploadParamsAddressesResponse { + return {}; + }, + toJSON(_: MsgRemoveCodeUploadParamsAddressesResponse): unknown { + const obj: any = {}; + return obj; + }, + fromPartial(_: Partial): MsgRemoveCodeUploadParamsAddressesResponse { + const message = createBaseMsgRemoveCodeUploadParamsAddressesResponse(); return message; }, - fromAmino(_: MsgUpdateAdminResponseAmino): MsgUpdateAdminResponse { - return {}; + fromAmino(_: MsgRemoveCodeUploadParamsAddressesResponseAmino): MsgRemoveCodeUploadParamsAddressesResponse { + const message = createBaseMsgRemoveCodeUploadParamsAddressesResponse(); + return message; }, - toAmino(_: MsgUpdateAdminResponse): MsgUpdateAdminResponseAmino { + toAmino(_: MsgRemoveCodeUploadParamsAddressesResponse): MsgRemoveCodeUploadParamsAddressesResponseAmino { const obj: any = {}; return obj; }, - fromAminoMsg(object: MsgUpdateAdminResponseAminoMsg): MsgUpdateAdminResponse { - return MsgUpdateAdminResponse.fromAmino(object.value); + fromAminoMsg(object: MsgRemoveCodeUploadParamsAddressesResponseAminoMsg): MsgRemoveCodeUploadParamsAddressesResponse { + return MsgRemoveCodeUploadParamsAddressesResponse.fromAmino(object.value); }, - toAminoMsg(message: MsgUpdateAdminResponse): MsgUpdateAdminResponseAminoMsg { + toAminoMsg(message: MsgRemoveCodeUploadParamsAddressesResponse): MsgRemoveCodeUploadParamsAddressesResponseAminoMsg { return { - type: "wasm/MsgUpdateAdminResponse", - value: MsgUpdateAdminResponse.toAmino(message) + type: "wasm/MsgRemoveCodeUploadParamsAddressesResponse", + value: MsgRemoveCodeUploadParamsAddressesResponse.toAmino(message) }; }, - fromProtoMsg(message: MsgUpdateAdminResponseProtoMsg): MsgUpdateAdminResponse { - return MsgUpdateAdminResponse.decode(message.value); + fromProtoMsg(message: MsgRemoveCodeUploadParamsAddressesResponseProtoMsg): MsgRemoveCodeUploadParamsAddressesResponse { + return MsgRemoveCodeUploadParamsAddressesResponse.decode(message.value); }, - toProto(message: MsgUpdateAdminResponse): Uint8Array { - return MsgUpdateAdminResponse.encode(message).finish(); + toProto(message: MsgRemoveCodeUploadParamsAddressesResponse): Uint8Array { + return MsgRemoveCodeUploadParamsAddressesResponse.encode(message).finish(); }, - toProtoMsg(message: MsgUpdateAdminResponse): MsgUpdateAdminResponseProtoMsg { + toProtoMsg(message: MsgRemoveCodeUploadParamsAddressesResponse): MsgRemoveCodeUploadParamsAddressesResponseProtoMsg { return { - typeUrl: "/cosmwasm.wasm.v1.MsgUpdateAdminResponse", - value: MsgUpdateAdminResponse.encode(message).finish() + typeUrl: "/cosmwasm.wasm.v1.MsgRemoveCodeUploadParamsAddressesResponse", + value: MsgRemoveCodeUploadParamsAddressesResponse.encode(message).finish() }; } }; -function createBaseMsgClearAdmin(): MsgClearAdmin { +GlobalDecoderRegistry.register(MsgRemoveCodeUploadParamsAddressesResponse.typeUrl, MsgRemoveCodeUploadParamsAddressesResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgRemoveCodeUploadParamsAddressesResponse.aminoType, MsgRemoveCodeUploadParamsAddressesResponse.typeUrl); +function createBaseMsgStoreAndMigrateContract(): MsgStoreAndMigrateContract { return { - sender: "", - contract: "" + authority: "", + wasmByteCode: new Uint8Array(), + instantiatePermission: undefined, + contract: "", + msg: new Uint8Array() }; } -export const MsgClearAdmin = { - typeUrl: "/cosmwasm.wasm.v1.MsgClearAdmin", - encode(message: MsgClearAdmin, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { - if (message.sender !== "") { - writer.uint32(10).string(message.sender); +export const MsgStoreAndMigrateContract = { + typeUrl: "/cosmwasm.wasm.v1.MsgStoreAndMigrateContract", + aminoType: "wasm/MsgStoreAndMigrateContract", + is(o: any): o is MsgStoreAndMigrateContract { + return o && (o.$typeUrl === MsgStoreAndMigrateContract.typeUrl || typeof o.authority === "string" && (o.wasmByteCode instanceof Uint8Array || typeof o.wasmByteCode === "string") && typeof o.contract === "string" && (o.msg instanceof Uint8Array || typeof o.msg === "string")); + }, + isSDK(o: any): o is MsgStoreAndMigrateContractSDKType { + return o && (o.$typeUrl === MsgStoreAndMigrateContract.typeUrl || typeof o.authority === "string" && (o.wasm_byte_code instanceof Uint8Array || typeof o.wasm_byte_code === "string") && typeof o.contract === "string" && (o.msg instanceof Uint8Array || typeof o.msg === "string")); + }, + isAmino(o: any): o is MsgStoreAndMigrateContractAmino { + return o && (o.$typeUrl === MsgStoreAndMigrateContract.typeUrl || typeof o.authority === "string" && (o.wasm_byte_code instanceof Uint8Array || typeof o.wasm_byte_code === "string") && typeof o.contract === "string" && (o.msg instanceof Uint8Array || typeof o.msg === "string")); + }, + encode(message: MsgStoreAndMigrateContract, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.authority !== "") { + writer.uint32(10).string(message.authority); + } + if (message.wasmByteCode.length !== 0) { + writer.uint32(18).bytes(message.wasmByteCode); + } + if (message.instantiatePermission !== undefined) { + AccessConfig.encode(message.instantiatePermission, writer.uint32(26).fork()).ldelim(); } if (message.contract !== "") { - writer.uint32(26).string(message.contract); + writer.uint32(34).string(message.contract); + } + if (message.msg.length !== 0) { + writer.uint32(42).bytes(message.msg); } return writer; }, - decode(input: BinaryReader | Uint8Array, length?: number): MsgClearAdmin { + decode(input: BinaryReader | Uint8Array, length?: number): MsgStoreAndMigrateContract { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseMsgClearAdmin(); + const message = createBaseMsgStoreAndMigrateContract(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.sender = reader.string(); + message.authority = reader.string(); + break; + case 2: + message.wasmByteCode = reader.bytes(); break; case 3: + message.instantiatePermission = AccessConfig.decode(reader, reader.uint32()); + break; + case 4: message.contract = reader.string(); break; + case 5: + message.msg = reader.bytes(); + break; default: reader.skipType(tag & 7); break; @@ -1597,61 +4598,132 @@ export const MsgClearAdmin = { } return message; }, - fromPartial(object: Partial): MsgClearAdmin { - const message = createBaseMsgClearAdmin(); - message.sender = object.sender ?? ""; + fromJSON(object: any): MsgStoreAndMigrateContract { + return { + authority: isSet(object.authority) ? String(object.authority) : "", + wasmByteCode: isSet(object.wasmByteCode) ? bytesFromBase64(object.wasmByteCode) : new Uint8Array(), + instantiatePermission: isSet(object.instantiatePermission) ? AccessConfig.fromJSON(object.instantiatePermission) : undefined, + contract: isSet(object.contract) ? String(object.contract) : "", + msg: isSet(object.msg) ? bytesFromBase64(object.msg) : new Uint8Array() + }; + }, + toJSON(message: MsgStoreAndMigrateContract): unknown { + const obj: any = {}; + message.authority !== undefined && (obj.authority = message.authority); + message.wasmByteCode !== undefined && (obj.wasmByteCode = base64FromBytes(message.wasmByteCode !== undefined ? message.wasmByteCode : new Uint8Array())); + message.instantiatePermission !== undefined && (obj.instantiatePermission = message.instantiatePermission ? AccessConfig.toJSON(message.instantiatePermission) : undefined); + message.contract !== undefined && (obj.contract = message.contract); + message.msg !== undefined && (obj.msg = base64FromBytes(message.msg !== undefined ? message.msg : new Uint8Array())); + return obj; + }, + fromPartial(object: Partial): MsgStoreAndMigrateContract { + const message = createBaseMsgStoreAndMigrateContract(); + message.authority = object.authority ?? ""; + message.wasmByteCode = object.wasmByteCode ?? new Uint8Array(); + message.instantiatePermission = object.instantiatePermission !== undefined && object.instantiatePermission !== null ? AccessConfig.fromPartial(object.instantiatePermission) : undefined; message.contract = object.contract ?? ""; + message.msg = object.msg ?? new Uint8Array(); return message; }, - fromAmino(object: MsgClearAdminAmino): MsgClearAdmin { - return { - sender: object.sender, - contract: object.contract - }; + fromAmino(object: MsgStoreAndMigrateContractAmino): MsgStoreAndMigrateContract { + const message = createBaseMsgStoreAndMigrateContract(); + if (object.authority !== undefined && object.authority !== null) { + message.authority = object.authority; + } + if (object.wasm_byte_code !== undefined && object.wasm_byte_code !== null) { + message.wasmByteCode = fromBase64(object.wasm_byte_code); + } + if (object.instantiate_permission !== undefined && object.instantiate_permission !== null) { + message.instantiatePermission = AccessConfig.fromAmino(object.instantiate_permission); + } + if (object.contract !== undefined && object.contract !== null) { + message.contract = object.contract; + } + if (object.msg !== undefined && object.msg !== null) { + message.msg = toUtf8(JSON.stringify(object.msg)); + } + return message; }, - toAmino(message: MsgClearAdmin): MsgClearAdminAmino { + toAmino(message: MsgStoreAndMigrateContract): MsgStoreAndMigrateContractAmino { const obj: any = {}; - obj.sender = message.sender; + obj.authority = message.authority; + obj.wasm_byte_code = message.wasmByteCode ? toBase64(message.wasmByteCode) : undefined; + obj.instantiate_permission = message.instantiatePermission ? AccessConfig.toAmino(message.instantiatePermission) : undefined; obj.contract = message.contract; + obj.msg = message.msg ? JSON.parse(fromUtf8(message.msg)) : undefined; return obj; }, - fromAminoMsg(object: MsgClearAdminAminoMsg): MsgClearAdmin { - return MsgClearAdmin.fromAmino(object.value); + fromAminoMsg(object: MsgStoreAndMigrateContractAminoMsg): MsgStoreAndMigrateContract { + return MsgStoreAndMigrateContract.fromAmino(object.value); }, - toAminoMsg(message: MsgClearAdmin): MsgClearAdminAminoMsg { + toAminoMsg(message: MsgStoreAndMigrateContract): MsgStoreAndMigrateContractAminoMsg { return { - type: "wasm/MsgClearAdmin", - value: MsgClearAdmin.toAmino(message) + type: "wasm/MsgStoreAndMigrateContract", + value: MsgStoreAndMigrateContract.toAmino(message) }; }, - fromProtoMsg(message: MsgClearAdminProtoMsg): MsgClearAdmin { - return MsgClearAdmin.decode(message.value); + fromProtoMsg(message: MsgStoreAndMigrateContractProtoMsg): MsgStoreAndMigrateContract { + return MsgStoreAndMigrateContract.decode(message.value); }, - toProto(message: MsgClearAdmin): Uint8Array { - return MsgClearAdmin.encode(message).finish(); + toProto(message: MsgStoreAndMigrateContract): Uint8Array { + return MsgStoreAndMigrateContract.encode(message).finish(); }, - toProtoMsg(message: MsgClearAdmin): MsgClearAdminProtoMsg { + toProtoMsg(message: MsgStoreAndMigrateContract): MsgStoreAndMigrateContractProtoMsg { return { - typeUrl: "/cosmwasm.wasm.v1.MsgClearAdmin", - value: MsgClearAdmin.encode(message).finish() + typeUrl: "/cosmwasm.wasm.v1.MsgStoreAndMigrateContract", + value: MsgStoreAndMigrateContract.encode(message).finish() }; } }; -function createBaseMsgClearAdminResponse(): MsgClearAdminResponse { - return {}; +GlobalDecoderRegistry.register(MsgStoreAndMigrateContract.typeUrl, MsgStoreAndMigrateContract); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgStoreAndMigrateContract.aminoType, MsgStoreAndMigrateContract.typeUrl); +function createBaseMsgStoreAndMigrateContractResponse(): MsgStoreAndMigrateContractResponse { + return { + codeId: BigInt(0), + checksum: new Uint8Array(), + data: new Uint8Array() + }; } -export const MsgClearAdminResponse = { - typeUrl: "/cosmwasm.wasm.v1.MsgClearAdminResponse", - encode(_: MsgClearAdminResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { +export const MsgStoreAndMigrateContractResponse = { + typeUrl: "/cosmwasm.wasm.v1.MsgStoreAndMigrateContractResponse", + aminoType: "wasm/MsgStoreAndMigrateContractResponse", + is(o: any): o is MsgStoreAndMigrateContractResponse { + return o && (o.$typeUrl === MsgStoreAndMigrateContractResponse.typeUrl || typeof o.codeId === "bigint" && (o.checksum instanceof Uint8Array || typeof o.checksum === "string") && (o.data instanceof Uint8Array || typeof o.data === "string")); + }, + isSDK(o: any): o is MsgStoreAndMigrateContractResponseSDKType { + return o && (o.$typeUrl === MsgStoreAndMigrateContractResponse.typeUrl || typeof o.code_id === "bigint" && (o.checksum instanceof Uint8Array || typeof o.checksum === "string") && (o.data instanceof Uint8Array || typeof o.data === "string")); + }, + isAmino(o: any): o is MsgStoreAndMigrateContractResponseAmino { + return o && (o.$typeUrl === MsgStoreAndMigrateContractResponse.typeUrl || typeof o.code_id === "bigint" && (o.checksum instanceof Uint8Array || typeof o.checksum === "string") && (o.data instanceof Uint8Array || typeof o.data === "string")); + }, + encode(message: MsgStoreAndMigrateContractResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.codeId !== BigInt(0)) { + writer.uint32(8).uint64(message.codeId); + } + if (message.checksum.length !== 0) { + writer.uint32(18).bytes(message.checksum); + } + if (message.data.length !== 0) { + writer.uint32(26).bytes(message.data); + } return writer; }, - decode(input: BinaryReader | Uint8Array, length?: number): MsgClearAdminResponse { + decode(input: BinaryReader | Uint8Array, length?: number): MsgStoreAndMigrateContractResponse { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseMsgClearAdminResponse(); + const message = createBaseMsgStoreAndMigrateContractResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { + case 1: + message.codeId = reader.uint64(); + break; + case 2: + message.checksum = reader.bytes(); + break; + case 3: + message.data = reader.bytes(); + break; default: reader.skipType(tag & 7); break; @@ -1659,64 +4731,106 @@ export const MsgClearAdminResponse = { } return message; }, - fromPartial(_: Partial): MsgClearAdminResponse { - const message = createBaseMsgClearAdminResponse(); + fromJSON(object: any): MsgStoreAndMigrateContractResponse { + return { + codeId: isSet(object.codeId) ? BigInt(object.codeId.toString()) : BigInt(0), + checksum: isSet(object.checksum) ? bytesFromBase64(object.checksum) : new Uint8Array(), + data: isSet(object.data) ? bytesFromBase64(object.data) : new Uint8Array() + }; + }, + toJSON(message: MsgStoreAndMigrateContractResponse): unknown { + const obj: any = {}; + message.codeId !== undefined && (obj.codeId = (message.codeId || BigInt(0)).toString()); + message.checksum !== undefined && (obj.checksum = base64FromBytes(message.checksum !== undefined ? message.checksum : new Uint8Array())); + message.data !== undefined && (obj.data = base64FromBytes(message.data !== undefined ? message.data : new Uint8Array())); + return obj; + }, + fromPartial(object: Partial): MsgStoreAndMigrateContractResponse { + const message = createBaseMsgStoreAndMigrateContractResponse(); + message.codeId = object.codeId !== undefined && object.codeId !== null ? BigInt(object.codeId.toString()) : BigInt(0); + message.checksum = object.checksum ?? new Uint8Array(); + message.data = object.data ?? new Uint8Array(); return message; }, - fromAmino(_: MsgClearAdminResponseAmino): MsgClearAdminResponse { - return {}; + fromAmino(object: MsgStoreAndMigrateContractResponseAmino): MsgStoreAndMigrateContractResponse { + const message = createBaseMsgStoreAndMigrateContractResponse(); + if (object.code_id !== undefined && object.code_id !== null) { + message.codeId = BigInt(object.code_id); + } + if (object.checksum !== undefined && object.checksum !== null) { + message.checksum = bytesFromBase64(object.checksum); + } + if (object.data !== undefined && object.data !== null) { + message.data = bytesFromBase64(object.data); + } + return message; }, - toAmino(_: MsgClearAdminResponse): MsgClearAdminResponseAmino { + toAmino(message: MsgStoreAndMigrateContractResponse): MsgStoreAndMigrateContractResponseAmino { const obj: any = {}; + obj.code_id = message.codeId ? message.codeId.toString() : undefined; + obj.checksum = message.checksum ? base64FromBytes(message.checksum) : undefined; + obj.data = message.data ? base64FromBytes(message.data) : undefined; return obj; }, - fromAminoMsg(object: MsgClearAdminResponseAminoMsg): MsgClearAdminResponse { - return MsgClearAdminResponse.fromAmino(object.value); + fromAminoMsg(object: MsgStoreAndMigrateContractResponseAminoMsg): MsgStoreAndMigrateContractResponse { + return MsgStoreAndMigrateContractResponse.fromAmino(object.value); }, - toAminoMsg(message: MsgClearAdminResponse): MsgClearAdminResponseAminoMsg { + toAminoMsg(message: MsgStoreAndMigrateContractResponse): MsgStoreAndMigrateContractResponseAminoMsg { return { - type: "wasm/MsgClearAdminResponse", - value: MsgClearAdminResponse.toAmino(message) + type: "wasm/MsgStoreAndMigrateContractResponse", + value: MsgStoreAndMigrateContractResponse.toAmino(message) }; }, - fromProtoMsg(message: MsgClearAdminResponseProtoMsg): MsgClearAdminResponse { - return MsgClearAdminResponse.decode(message.value); + fromProtoMsg(message: MsgStoreAndMigrateContractResponseProtoMsg): MsgStoreAndMigrateContractResponse { + return MsgStoreAndMigrateContractResponse.decode(message.value); }, - toProto(message: MsgClearAdminResponse): Uint8Array { - return MsgClearAdminResponse.encode(message).finish(); + toProto(message: MsgStoreAndMigrateContractResponse): Uint8Array { + return MsgStoreAndMigrateContractResponse.encode(message).finish(); }, - toProtoMsg(message: MsgClearAdminResponse): MsgClearAdminResponseProtoMsg { + toProtoMsg(message: MsgStoreAndMigrateContractResponse): MsgStoreAndMigrateContractResponseProtoMsg { return { - typeUrl: "/cosmwasm.wasm.v1.MsgClearAdminResponse", - value: MsgClearAdminResponse.encode(message).finish() + typeUrl: "/cosmwasm.wasm.v1.MsgStoreAndMigrateContractResponse", + value: MsgStoreAndMigrateContractResponse.encode(message).finish() }; } }; -function createBaseMsgUpdateInstantiateConfig(): MsgUpdateInstantiateConfig { +GlobalDecoderRegistry.register(MsgStoreAndMigrateContractResponse.typeUrl, MsgStoreAndMigrateContractResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgStoreAndMigrateContractResponse.aminoType, MsgStoreAndMigrateContractResponse.typeUrl); +function createBaseMsgUpdateContractLabel(): MsgUpdateContractLabel { return { sender: "", - codeId: BigInt(0), - newInstantiatePermission: AccessConfig.fromPartial({}) + newLabel: "", + contract: "" }; } -export const MsgUpdateInstantiateConfig = { - typeUrl: "/cosmwasm.wasm.v1.MsgUpdateInstantiateConfig", - encode(message: MsgUpdateInstantiateConfig, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { +export const MsgUpdateContractLabel = { + typeUrl: "/cosmwasm.wasm.v1.MsgUpdateContractLabel", + aminoType: "wasm/MsgUpdateContractLabel", + is(o: any): o is MsgUpdateContractLabel { + return o && (o.$typeUrl === MsgUpdateContractLabel.typeUrl || typeof o.sender === "string" && typeof o.newLabel === "string" && typeof o.contract === "string"); + }, + isSDK(o: any): o is MsgUpdateContractLabelSDKType { + return o && (o.$typeUrl === MsgUpdateContractLabel.typeUrl || typeof o.sender === "string" && typeof o.new_label === "string" && typeof o.contract === "string"); + }, + isAmino(o: any): o is MsgUpdateContractLabelAmino { + return o && (o.$typeUrl === MsgUpdateContractLabel.typeUrl || typeof o.sender === "string" && typeof o.new_label === "string" && typeof o.contract === "string"); + }, + encode(message: MsgUpdateContractLabel, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.sender !== "") { writer.uint32(10).string(message.sender); } - if (message.codeId !== BigInt(0)) { - writer.uint32(16).uint64(message.codeId); + if (message.newLabel !== "") { + writer.uint32(18).string(message.newLabel); } - if (message.newInstantiatePermission !== undefined) { - AccessConfig.encode(message.newInstantiatePermission, writer.uint32(26).fork()).ldelim(); + if (message.contract !== "") { + writer.uint32(26).string(message.contract); } return writer; }, - decode(input: BinaryReader | Uint8Array, length?: number): MsgUpdateInstantiateConfig { + decode(input: BinaryReader | Uint8Array, length?: number): MsgUpdateContractLabel { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseMsgUpdateInstantiateConfig(); + const message = createBaseMsgUpdateContractLabel(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -1724,10 +4838,10 @@ export const MsgUpdateInstantiateConfig = { message.sender = reader.string(); break; case 2: - message.codeId = reader.uint64(); + message.newLabel = reader.string(); break; case 3: - message.newInstantiatePermission = AccessConfig.decode(reader, reader.uint32()); + message.contract = reader.string(); break; default: reader.skipType(tag & 7); @@ -1736,61 +4850,93 @@ export const MsgUpdateInstantiateConfig = { } return message; }, - fromPartial(object: Partial): MsgUpdateInstantiateConfig { - const message = createBaseMsgUpdateInstantiateConfig(); + fromJSON(object: any): MsgUpdateContractLabel { + return { + sender: isSet(object.sender) ? String(object.sender) : "", + newLabel: isSet(object.newLabel) ? String(object.newLabel) : "", + contract: isSet(object.contract) ? String(object.contract) : "" + }; + }, + toJSON(message: MsgUpdateContractLabel): unknown { + const obj: any = {}; + message.sender !== undefined && (obj.sender = message.sender); + message.newLabel !== undefined && (obj.newLabel = message.newLabel); + message.contract !== undefined && (obj.contract = message.contract); + return obj; + }, + fromPartial(object: Partial): MsgUpdateContractLabel { + const message = createBaseMsgUpdateContractLabel(); message.sender = object.sender ?? ""; - message.codeId = object.codeId !== undefined && object.codeId !== null ? BigInt(object.codeId.toString()) : BigInt(0); - message.newInstantiatePermission = object.newInstantiatePermission !== undefined && object.newInstantiatePermission !== null ? AccessConfig.fromPartial(object.newInstantiatePermission) : undefined; + message.newLabel = object.newLabel ?? ""; + message.contract = object.contract ?? ""; return message; }, - fromAmino(object: MsgUpdateInstantiateConfigAmino): MsgUpdateInstantiateConfig { - return { - sender: object.sender, - codeId: BigInt(object.code_id), - newInstantiatePermission: object?.new_instantiate_permission ? AccessConfig.fromAmino(object.new_instantiate_permission) : undefined - }; + fromAmino(object: MsgUpdateContractLabelAmino): MsgUpdateContractLabel { + const message = createBaseMsgUpdateContractLabel(); + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + if (object.new_label !== undefined && object.new_label !== null) { + message.newLabel = object.new_label; + } + if (object.contract !== undefined && object.contract !== null) { + message.contract = object.contract; + } + return message; }, - toAmino(message: MsgUpdateInstantiateConfig): MsgUpdateInstantiateConfigAmino { + toAmino(message: MsgUpdateContractLabel): MsgUpdateContractLabelAmino { const obj: any = {}; obj.sender = message.sender; - obj.code_id = message.codeId ? message.codeId.toString() : undefined; - obj.new_instantiate_permission = message.newInstantiatePermission ? AccessConfig.toAmino(message.newInstantiatePermission) : undefined; + obj.new_label = message.newLabel; + obj.contract = message.contract; return obj; }, - fromAminoMsg(object: MsgUpdateInstantiateConfigAminoMsg): MsgUpdateInstantiateConfig { - return MsgUpdateInstantiateConfig.fromAmino(object.value); + fromAminoMsg(object: MsgUpdateContractLabelAminoMsg): MsgUpdateContractLabel { + return MsgUpdateContractLabel.fromAmino(object.value); }, - toAminoMsg(message: MsgUpdateInstantiateConfig): MsgUpdateInstantiateConfigAminoMsg { + toAminoMsg(message: MsgUpdateContractLabel): MsgUpdateContractLabelAminoMsg { return { - type: "wasm/MsgUpdateInstantiateConfig", - value: MsgUpdateInstantiateConfig.toAmino(message) + type: "wasm/MsgUpdateContractLabel", + value: MsgUpdateContractLabel.toAmino(message) }; }, - fromProtoMsg(message: MsgUpdateInstantiateConfigProtoMsg): MsgUpdateInstantiateConfig { - return MsgUpdateInstantiateConfig.decode(message.value); + fromProtoMsg(message: MsgUpdateContractLabelProtoMsg): MsgUpdateContractLabel { + return MsgUpdateContractLabel.decode(message.value); }, - toProto(message: MsgUpdateInstantiateConfig): Uint8Array { - return MsgUpdateInstantiateConfig.encode(message).finish(); + toProto(message: MsgUpdateContractLabel): Uint8Array { + return MsgUpdateContractLabel.encode(message).finish(); }, - toProtoMsg(message: MsgUpdateInstantiateConfig): MsgUpdateInstantiateConfigProtoMsg { + toProtoMsg(message: MsgUpdateContractLabel): MsgUpdateContractLabelProtoMsg { return { - typeUrl: "/cosmwasm.wasm.v1.MsgUpdateInstantiateConfig", - value: MsgUpdateInstantiateConfig.encode(message).finish() + typeUrl: "/cosmwasm.wasm.v1.MsgUpdateContractLabel", + value: MsgUpdateContractLabel.encode(message).finish() }; } }; -function createBaseMsgUpdateInstantiateConfigResponse(): MsgUpdateInstantiateConfigResponse { +GlobalDecoderRegistry.register(MsgUpdateContractLabel.typeUrl, MsgUpdateContractLabel); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgUpdateContractLabel.aminoType, MsgUpdateContractLabel.typeUrl); +function createBaseMsgUpdateContractLabelResponse(): MsgUpdateContractLabelResponse { return {}; } -export const MsgUpdateInstantiateConfigResponse = { - typeUrl: "/cosmwasm.wasm.v1.MsgUpdateInstantiateConfigResponse", - encode(_: MsgUpdateInstantiateConfigResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { +export const MsgUpdateContractLabelResponse = { + typeUrl: "/cosmwasm.wasm.v1.MsgUpdateContractLabelResponse", + aminoType: "wasm/MsgUpdateContractLabelResponse", + is(o: any): o is MsgUpdateContractLabelResponse { + return o && o.$typeUrl === MsgUpdateContractLabelResponse.typeUrl; + }, + isSDK(o: any): o is MsgUpdateContractLabelResponseSDKType { + return o && o.$typeUrl === MsgUpdateContractLabelResponse.typeUrl; + }, + isAmino(o: any): o is MsgUpdateContractLabelResponseAmino { + return o && o.$typeUrl === MsgUpdateContractLabelResponse.typeUrl; + }, + encode(_: MsgUpdateContractLabelResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, - decode(input: BinaryReader | Uint8Array, length?: number): MsgUpdateInstantiateConfigResponse { + decode(input: BinaryReader | Uint8Array, length?: number): MsgUpdateContractLabelResponse { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseMsgUpdateInstantiateConfigResponse(); + const message = createBaseMsgUpdateContractLabelResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -1801,36 +4947,46 @@ export const MsgUpdateInstantiateConfigResponse = { } return message; }, - fromPartial(_: Partial): MsgUpdateInstantiateConfigResponse { - const message = createBaseMsgUpdateInstantiateConfigResponse(); + fromJSON(_: any): MsgUpdateContractLabelResponse { + return {}; + }, + toJSON(_: MsgUpdateContractLabelResponse): unknown { + const obj: any = {}; + return obj; + }, + fromPartial(_: Partial): MsgUpdateContractLabelResponse { + const message = createBaseMsgUpdateContractLabelResponse(); return message; }, - fromAmino(_: MsgUpdateInstantiateConfigResponseAmino): MsgUpdateInstantiateConfigResponse { - return {}; + fromAmino(_: MsgUpdateContractLabelResponseAmino): MsgUpdateContractLabelResponse { + const message = createBaseMsgUpdateContractLabelResponse(); + return message; }, - toAmino(_: MsgUpdateInstantiateConfigResponse): MsgUpdateInstantiateConfigResponseAmino { + toAmino(_: MsgUpdateContractLabelResponse): MsgUpdateContractLabelResponseAmino { const obj: any = {}; return obj; }, - fromAminoMsg(object: MsgUpdateInstantiateConfigResponseAminoMsg): MsgUpdateInstantiateConfigResponse { - return MsgUpdateInstantiateConfigResponse.fromAmino(object.value); + fromAminoMsg(object: MsgUpdateContractLabelResponseAminoMsg): MsgUpdateContractLabelResponse { + return MsgUpdateContractLabelResponse.fromAmino(object.value); }, - toAminoMsg(message: MsgUpdateInstantiateConfigResponse): MsgUpdateInstantiateConfigResponseAminoMsg { + toAminoMsg(message: MsgUpdateContractLabelResponse): MsgUpdateContractLabelResponseAminoMsg { return { - type: "wasm/MsgUpdateInstantiateConfigResponse", - value: MsgUpdateInstantiateConfigResponse.toAmino(message) + type: "wasm/MsgUpdateContractLabelResponse", + value: MsgUpdateContractLabelResponse.toAmino(message) }; }, - fromProtoMsg(message: MsgUpdateInstantiateConfigResponseProtoMsg): MsgUpdateInstantiateConfigResponse { - return MsgUpdateInstantiateConfigResponse.decode(message.value); + fromProtoMsg(message: MsgUpdateContractLabelResponseProtoMsg): MsgUpdateContractLabelResponse { + return MsgUpdateContractLabelResponse.decode(message.value); }, - toProto(message: MsgUpdateInstantiateConfigResponse): Uint8Array { - return MsgUpdateInstantiateConfigResponse.encode(message).finish(); + toProto(message: MsgUpdateContractLabelResponse): Uint8Array { + return MsgUpdateContractLabelResponse.encode(message).finish(); }, - toProtoMsg(message: MsgUpdateInstantiateConfigResponse): MsgUpdateInstantiateConfigResponseProtoMsg { + toProtoMsg(message: MsgUpdateContractLabelResponse): MsgUpdateContractLabelResponseProtoMsg { return { - typeUrl: "/cosmwasm.wasm.v1.MsgUpdateInstantiateConfigResponse", - value: MsgUpdateInstantiateConfigResponse.encode(message).finish() + typeUrl: "/cosmwasm.wasm.v1.MsgUpdateContractLabelResponse", + value: MsgUpdateContractLabelResponse.encode(message).finish() }; } -}; \ No newline at end of file +}; +GlobalDecoderRegistry.register(MsgUpdateContractLabelResponse.typeUrl, MsgUpdateContractLabelResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgUpdateContractLabelResponse.aminoType, MsgUpdateContractLabelResponse.typeUrl); \ No newline at end of file diff --git a/packages/osmojs/src/codegen/cosmwasm/wasm/v1/types.ts b/packages/osmojs/src/codegen/cosmwasm/wasm/v1/types.ts index 957838760..7a763ea82 100644 --- a/packages/osmojs/src/codegen/cosmwasm/wasm/v1/types.ts +++ b/packages/osmojs/src/codegen/cosmwasm/wasm/v1/types.ts @@ -1,6 +1,7 @@ import { Any, AnyProtoMsg, AnyAmino, AnySDKType } from "../../../google/protobuf/any"; +import { isSet, bytesFromBase64, base64FromBytes } from "../../../helpers"; import { BinaryReader, BinaryWriter } from "../../../binary"; -import { isSet } from "../../../helpers"; +import { GlobalDecoderRegistry } from "../../../registry"; import { toUtf8, fromUtf8 } from "@cosmjs/encoding"; /** AccessType permission types */ export enum AccessType { @@ -8,11 +9,6 @@ export enum AccessType { ACCESS_TYPE_UNSPECIFIED = 0, /** ACCESS_TYPE_NOBODY - AccessTypeNobody forbidden */ ACCESS_TYPE_NOBODY = 1, - /** - * ACCESS_TYPE_ONLY_ADDRESS - AccessTypeOnlyAddress restricted to a single address - * Deprecated: use AccessTypeAnyOfAddresses instead - */ - ACCESS_TYPE_ONLY_ADDRESS = 2, /** ACCESS_TYPE_EVERYBODY - AccessTypeEverybody unrestricted */ ACCESS_TYPE_EVERYBODY = 3, /** ACCESS_TYPE_ANY_OF_ADDRESSES - AccessTypeAnyOfAddresses allow any of the addresses */ @@ -29,9 +25,6 @@ export function accessTypeFromJSON(object: any): AccessType { case 1: case "ACCESS_TYPE_NOBODY": return AccessType.ACCESS_TYPE_NOBODY; - case 2: - case "ACCESS_TYPE_ONLY_ADDRESS": - return AccessType.ACCESS_TYPE_ONLY_ADDRESS; case 3: case "ACCESS_TYPE_EVERYBODY": return AccessType.ACCESS_TYPE_EVERYBODY; @@ -50,8 +43,6 @@ export function accessTypeToJSON(object: AccessType): string { return "ACCESS_TYPE_UNSPECIFIED"; case AccessType.ACCESS_TYPE_NOBODY: return "ACCESS_TYPE_NOBODY"; - case AccessType.ACCESS_TYPE_ONLY_ADDRESS: - return "ACCESS_TYPE_ONLY_ADDRESS"; case AccessType.ACCESS_TYPE_EVERYBODY: return "ACCESS_TYPE_EVERYBODY"; case AccessType.ACCESS_TYPE_ANY_OF_ADDRESSES: @@ -120,7 +111,7 @@ export interface AccessTypeParamProtoMsg { } /** AccessTypeParam */ export interface AccessTypeParamAmino { - value: AccessType; + value?: AccessType; } export interface AccessTypeParamAminoMsg { type: "wasm/AccessTypeParam"; @@ -133,11 +124,6 @@ export interface AccessTypeParamSDKType { /** AccessConfig access control type. */ export interface AccessConfig { permission: AccessType; - /** - * Address - * Deprecated: replaced by addresses - */ - address: string; addresses: string[]; } export interface AccessConfigProtoMsg { @@ -146,13 +132,8 @@ export interface AccessConfigProtoMsg { } /** AccessConfig access control type. */ export interface AccessConfigAmino { - permission: AccessType; - /** - * Address - * Deprecated: replaced by addresses - */ - address: string; - addresses: string[]; + permission?: AccessType; + addresses?: string[]; } export interface AccessConfigAminoMsg { type: "wasm/AccessConfig"; @@ -161,7 +142,6 @@ export interface AccessConfigAminoMsg { /** AccessConfig access control type. */ export interface AccessConfigSDKType { permission: AccessType; - address: string; addresses: string[]; } /** Params defines the set of wasm parameters. */ @@ -175,8 +155,8 @@ export interface ParamsProtoMsg { } /** Params defines the set of wasm parameters. */ export interface ParamsAmino { - code_upload_access?: AccessConfigAmino; - instantiate_default_permission: AccessType; + code_upload_access: AccessConfigAmino; + instantiate_default_permission?: AccessType; } export interface ParamsAminoMsg { type: "wasm/Params"; @@ -203,11 +183,11 @@ export interface CodeInfoProtoMsg { /** CodeInfo is data for the uploaded contract WASM code */ export interface CodeInfoAmino { /** CodeHash is the unique identifier created by wasmvm */ - code_hash: Uint8Array; + code_hash?: string; /** Creator address who initially stored the code */ - creator: string; + creator?: string; /** InstantiateConfig access control to apply on contract creation, optional */ - instantiate_config?: AccessConfigAmino; + instantiate_config: AccessConfigAmino; } export interface CodeInfoAminoMsg { type: "wasm/CodeInfo"; @@ -230,13 +210,13 @@ export interface ContractInfo { /** Label is optional metadata to be stored with a contract instance. */ label: string; /** Created Tx position when the contract was instantiated. */ - created: AbsoluteTxPosition; + created?: AbsoluteTxPosition; ibcPortId: string; /** * Extension is an extension point to store custom metadata within the * persistence model. */ - extension: (Any) | undefined; + extension?: Any | undefined; } export interface ContractInfoProtoMsg { typeUrl: "/cosmwasm.wasm.v1.ContractInfo"; @@ -252,16 +232,16 @@ export type ContractInfoEncoded = Omit & { /** ContractInfo stores a WASM contract instance */ export interface ContractInfoAmino { /** CodeID is the reference to the stored Wasm code */ - code_id: string; + code_id?: string; /** Creator address who initially instantiated the contract */ - creator: string; + creator?: string; /** Admin is an optional address that can execute migrations */ - admin: string; + admin?: string; /** Label is optional metadata to be stored with a contract instance. */ - label: string; + label?: string; /** Created Tx position when the contract was instantiated. */ created?: AbsoluteTxPositionAmino; - ibc_port_id: string; + ibc_port_id?: string; /** * Extension is an extension point to store custom metadata within the * persistence model. @@ -278,9 +258,9 @@ export interface ContractInfoSDKType { creator: string; admin: string; label: string; - created: AbsoluteTxPositionSDKType; + created?: AbsoluteTxPositionSDKType; ibc_port_id: string; - extension: AnySDKType | undefined; + extension?: AnySDKType | undefined; } /** ContractCodeHistoryEntry metadata to a contract. */ export interface ContractCodeHistoryEntry { @@ -288,7 +268,7 @@ export interface ContractCodeHistoryEntry { /** CodeID is the reference to the stored WASM code */ codeId: bigint; /** Updated Tx position when the operation was executed. */ - updated: AbsoluteTxPosition; + updated?: AbsoluteTxPosition; msg: Uint8Array; } export interface ContractCodeHistoryEntryProtoMsg { @@ -297,12 +277,12 @@ export interface ContractCodeHistoryEntryProtoMsg { } /** ContractCodeHistoryEntry metadata to a contract. */ export interface ContractCodeHistoryEntryAmino { - operation: ContractCodeHistoryOperationType; + operation?: ContractCodeHistoryOperationType; /** CodeID is the reference to the stored WASM code */ - code_id: string; + code_id?: string; /** Updated Tx position when the operation was executed. */ updated?: AbsoluteTxPositionAmino; - msg: Uint8Array; + msg?: any; } export interface ContractCodeHistoryEntryAminoMsg { type: "wasm/ContractCodeHistoryEntry"; @@ -312,7 +292,7 @@ export interface ContractCodeHistoryEntryAminoMsg { export interface ContractCodeHistoryEntrySDKType { operation: ContractCodeHistoryOperationType; code_id: bigint; - updated: AbsoluteTxPositionSDKType; + updated?: AbsoluteTxPositionSDKType; msg: Uint8Array; } /** @@ -338,12 +318,12 @@ export interface AbsoluteTxPositionProtoMsg { */ export interface AbsoluteTxPositionAmino { /** BlockHeight is the block the contract was created at */ - block_height: string; + block_height?: string; /** * TxIndex is a monotonic counter within the block (actual transaction index, * or gas consumed) */ - tx_index: string; + tx_index?: string; } export interface AbsoluteTxPositionAminoMsg { type: "wasm/AbsoluteTxPosition"; @@ -371,9 +351,9 @@ export interface ModelProtoMsg { /** Model is a struct that holds a KV pair */ export interface ModelAmino { /** hex-encode key to read it better (this is often ascii) */ - key: Uint8Array; + key?: string; /** base64-encode raw value */ - value: Uint8Array; + value?: string; } export interface ModelAminoMsg { type: "wasm/Model"; @@ -391,6 +371,16 @@ function createBaseAccessTypeParam(): AccessTypeParam { } export const AccessTypeParam = { typeUrl: "/cosmwasm.wasm.v1.AccessTypeParam", + aminoType: "wasm/AccessTypeParam", + is(o: any): o is AccessTypeParam { + return o && (o.$typeUrl === AccessTypeParam.typeUrl || isSet(o.value)); + }, + isSDK(o: any): o is AccessTypeParamSDKType { + return o && (o.$typeUrl === AccessTypeParam.typeUrl || isSet(o.value)); + }, + isAmino(o: any): o is AccessTypeParamAmino { + return o && (o.$typeUrl === AccessTypeParam.typeUrl || isSet(o.value)); + }, encode(message: AccessTypeParam, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.value !== 0) { writer.uint32(8).int32(message.value); @@ -414,19 +404,31 @@ export const AccessTypeParam = { } return message; }, + fromJSON(object: any): AccessTypeParam { + return { + value: isSet(object.value) ? accessTypeFromJSON(object.value) : -1 + }; + }, + toJSON(message: AccessTypeParam): unknown { + const obj: any = {}; + message.value !== undefined && (obj.value = accessTypeToJSON(message.value)); + return obj; + }, fromPartial(object: Partial): AccessTypeParam { const message = createBaseAccessTypeParam(); message.value = object.value ?? 0; return message; }, fromAmino(object: AccessTypeParamAmino): AccessTypeParam { - return { - value: isSet(object.value) ? accessTypeFromJSON(object.value) : -1 - }; + const message = createBaseAccessTypeParam(); + if (object.value !== undefined && object.value !== null) { + message.value = accessTypeFromJSON(object.value); + } + return message; }, toAmino(message: AccessTypeParam): AccessTypeParamAmino { const obj: any = {}; - obj.value = message.value; + obj.value = accessTypeToJSON(message.value); return obj; }, fromAminoMsg(object: AccessTypeParamAminoMsg): AccessTypeParam { @@ -451,22 +453,30 @@ export const AccessTypeParam = { }; } }; +GlobalDecoderRegistry.register(AccessTypeParam.typeUrl, AccessTypeParam); +GlobalDecoderRegistry.registerAminoProtoMapping(AccessTypeParam.aminoType, AccessTypeParam.typeUrl); function createBaseAccessConfig(): AccessConfig { return { permission: 0, - address: "", addresses: [] }; } export const AccessConfig = { typeUrl: "/cosmwasm.wasm.v1.AccessConfig", + aminoType: "wasm/AccessConfig", + is(o: any): o is AccessConfig { + return o && (o.$typeUrl === AccessConfig.typeUrl || isSet(o.permission) && Array.isArray(o.addresses) && (!o.addresses.length || typeof o.addresses[0] === "string")); + }, + isSDK(o: any): o is AccessConfigSDKType { + return o && (o.$typeUrl === AccessConfig.typeUrl || isSet(o.permission) && Array.isArray(o.addresses) && (!o.addresses.length || typeof o.addresses[0] === "string")); + }, + isAmino(o: any): o is AccessConfigAmino { + return o && (o.$typeUrl === AccessConfig.typeUrl || isSet(o.permission) && Array.isArray(o.addresses) && (!o.addresses.length || typeof o.addresses[0] === "string")); + }, encode(message: AccessConfig, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.permission !== 0) { writer.uint32(8).int32(message.permission); } - if (message.address !== "") { - writer.uint32(18).string(message.address); - } for (const v of message.addresses) { writer.uint32(26).string(v!); } @@ -482,9 +492,6 @@ export const AccessConfig = { case 1: message.permission = (reader.int32() as any); break; - case 2: - message.address = reader.string(); - break; case 3: message.addresses.push(reader.string()); break; @@ -495,24 +502,39 @@ export const AccessConfig = { } return message; }, + fromJSON(object: any): AccessConfig { + return { + permission: isSet(object.permission) ? accessTypeFromJSON(object.permission) : -1, + addresses: Array.isArray(object?.addresses) ? object.addresses.map((e: any) => String(e)) : [] + }; + }, + toJSON(message: AccessConfig): unknown { + const obj: any = {}; + message.permission !== undefined && (obj.permission = accessTypeToJSON(message.permission)); + if (message.addresses) { + obj.addresses = message.addresses.map(e => e); + } else { + obj.addresses = []; + } + return obj; + }, fromPartial(object: Partial): AccessConfig { const message = createBaseAccessConfig(); message.permission = object.permission ?? 0; - message.address = object.address ?? ""; message.addresses = object.addresses?.map(e => e) || []; return message; }, fromAmino(object: AccessConfigAmino): AccessConfig { - return { - permission: isSet(object.permission) ? accessTypeFromJSON(object.permission) : -1, - address: object.address, - addresses: Array.isArray(object?.addresses) ? object.addresses.map((e: any) => e) : [] - }; + const message = createBaseAccessConfig(); + if (object.permission !== undefined && object.permission !== null) { + message.permission = accessTypeFromJSON(object.permission); + } + message.addresses = object.addresses?.map(e => e) || []; + return message; }, toAmino(message: AccessConfig): AccessConfigAmino { const obj: any = {}; - obj.permission = message.permission; - obj.address = message.address; + obj.permission = accessTypeToJSON(message.permission); if (message.addresses) { obj.addresses = message.addresses.map(e => e); } else { @@ -542,6 +564,8 @@ export const AccessConfig = { }; } }; +GlobalDecoderRegistry.register(AccessConfig.typeUrl, AccessConfig); +GlobalDecoderRegistry.registerAminoProtoMapping(AccessConfig.aminoType, AccessConfig.typeUrl); function createBaseParams(): Params { return { codeUploadAccess: AccessConfig.fromPartial({}), @@ -550,6 +574,16 @@ function createBaseParams(): Params { } export const Params = { typeUrl: "/cosmwasm.wasm.v1.Params", + aminoType: "wasm/Params", + is(o: any): o is Params { + return o && (o.$typeUrl === Params.typeUrl || AccessConfig.is(o.codeUploadAccess) && isSet(o.instantiateDefaultPermission)); + }, + isSDK(o: any): o is ParamsSDKType { + return o && (o.$typeUrl === Params.typeUrl || AccessConfig.isSDK(o.code_upload_access) && isSet(o.instantiate_default_permission)); + }, + isAmino(o: any): o is ParamsAmino { + return o && (o.$typeUrl === Params.typeUrl || AccessConfig.isAmino(o.code_upload_access) && isSet(o.instantiate_default_permission)); + }, encode(message: Params, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.codeUploadAccess !== undefined) { AccessConfig.encode(message.codeUploadAccess, writer.uint32(10).fork()).ldelim(); @@ -579,6 +613,18 @@ export const Params = { } return message; }, + fromJSON(object: any): Params { + return { + codeUploadAccess: isSet(object.codeUploadAccess) ? AccessConfig.fromJSON(object.codeUploadAccess) : undefined, + instantiateDefaultPermission: isSet(object.instantiateDefaultPermission) ? accessTypeFromJSON(object.instantiateDefaultPermission) : -1 + }; + }, + toJSON(message: Params): unknown { + const obj: any = {}; + message.codeUploadAccess !== undefined && (obj.codeUploadAccess = message.codeUploadAccess ? AccessConfig.toJSON(message.codeUploadAccess) : undefined); + message.instantiateDefaultPermission !== undefined && (obj.instantiateDefaultPermission = accessTypeToJSON(message.instantiateDefaultPermission)); + return obj; + }, fromPartial(object: Partial): Params { const message = createBaseParams(); message.codeUploadAccess = object.codeUploadAccess !== undefined && object.codeUploadAccess !== null ? AccessConfig.fromPartial(object.codeUploadAccess) : undefined; @@ -586,15 +632,19 @@ export const Params = { return message; }, fromAmino(object: ParamsAmino): Params { - return { - codeUploadAccess: object?.code_upload_access ? AccessConfig.fromAmino(object.code_upload_access) : undefined, - instantiateDefaultPermission: isSet(object.instantiate_default_permission) ? accessTypeFromJSON(object.instantiate_default_permission) : -1 - }; + const message = createBaseParams(); + if (object.code_upload_access !== undefined && object.code_upload_access !== null) { + message.codeUploadAccess = AccessConfig.fromAmino(object.code_upload_access); + } + if (object.instantiate_default_permission !== undefined && object.instantiate_default_permission !== null) { + message.instantiateDefaultPermission = accessTypeFromJSON(object.instantiate_default_permission); + } + return message; }, toAmino(message: Params): ParamsAmino { const obj: any = {}; - obj.code_upload_access = message.codeUploadAccess ? AccessConfig.toAmino(message.codeUploadAccess) : undefined; - obj.instantiate_default_permission = message.instantiateDefaultPermission; + obj.code_upload_access = message.codeUploadAccess ? AccessConfig.toAmino(message.codeUploadAccess) : AccessConfig.fromPartial({}); + obj.instantiate_default_permission = accessTypeToJSON(message.instantiateDefaultPermission); return obj; }, fromAminoMsg(object: ParamsAminoMsg): Params { @@ -619,6 +669,8 @@ export const Params = { }; } }; +GlobalDecoderRegistry.register(Params.typeUrl, Params); +GlobalDecoderRegistry.registerAminoProtoMapping(Params.aminoType, Params.typeUrl); function createBaseCodeInfo(): CodeInfo { return { codeHash: new Uint8Array(), @@ -628,6 +680,16 @@ function createBaseCodeInfo(): CodeInfo { } export const CodeInfo = { typeUrl: "/cosmwasm.wasm.v1.CodeInfo", + aminoType: "wasm/CodeInfo", + is(o: any): o is CodeInfo { + return o && (o.$typeUrl === CodeInfo.typeUrl || (o.codeHash instanceof Uint8Array || typeof o.codeHash === "string") && typeof o.creator === "string" && AccessConfig.is(o.instantiateConfig)); + }, + isSDK(o: any): o is CodeInfoSDKType { + return o && (o.$typeUrl === CodeInfo.typeUrl || (o.code_hash instanceof Uint8Array || typeof o.code_hash === "string") && typeof o.creator === "string" && AccessConfig.isSDK(o.instantiate_config)); + }, + isAmino(o: any): o is CodeInfoAmino { + return o && (o.$typeUrl === CodeInfo.typeUrl || (o.code_hash instanceof Uint8Array || typeof o.code_hash === "string") && typeof o.creator === "string" && AccessConfig.isAmino(o.instantiate_config)); + }, encode(message: CodeInfo, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.codeHash.length !== 0) { writer.uint32(10).bytes(message.codeHash); @@ -663,6 +725,20 @@ export const CodeInfo = { } return message; }, + fromJSON(object: any): CodeInfo { + return { + codeHash: isSet(object.codeHash) ? bytesFromBase64(object.codeHash) : new Uint8Array(), + creator: isSet(object.creator) ? String(object.creator) : "", + instantiateConfig: isSet(object.instantiateConfig) ? AccessConfig.fromJSON(object.instantiateConfig) : undefined + }; + }, + toJSON(message: CodeInfo): unknown { + const obj: any = {}; + message.codeHash !== undefined && (obj.codeHash = base64FromBytes(message.codeHash !== undefined ? message.codeHash : new Uint8Array())); + message.creator !== undefined && (obj.creator = message.creator); + message.instantiateConfig !== undefined && (obj.instantiateConfig = message.instantiateConfig ? AccessConfig.toJSON(message.instantiateConfig) : undefined); + return obj; + }, fromPartial(object: Partial): CodeInfo { const message = createBaseCodeInfo(); message.codeHash = object.codeHash ?? new Uint8Array(); @@ -671,17 +747,23 @@ export const CodeInfo = { return message; }, fromAmino(object: CodeInfoAmino): CodeInfo { - return { - codeHash: object.code_hash, - creator: object.creator, - instantiateConfig: object?.instantiate_config ? AccessConfig.fromAmino(object.instantiate_config) : undefined - }; + const message = createBaseCodeInfo(); + if (object.code_hash !== undefined && object.code_hash !== null) { + message.codeHash = bytesFromBase64(object.code_hash); + } + if (object.creator !== undefined && object.creator !== null) { + message.creator = object.creator; + } + if (object.instantiate_config !== undefined && object.instantiate_config !== null) { + message.instantiateConfig = AccessConfig.fromAmino(object.instantiate_config); + } + return message; }, toAmino(message: CodeInfo): CodeInfoAmino { const obj: any = {}; - obj.code_hash = message.codeHash; + obj.code_hash = message.codeHash ? base64FromBytes(message.codeHash) : undefined; obj.creator = message.creator; - obj.instantiate_config = message.instantiateConfig ? AccessConfig.toAmino(message.instantiateConfig) : undefined; + obj.instantiate_config = message.instantiateConfig ? AccessConfig.toAmino(message.instantiateConfig) : AccessConfig.fromPartial({}); return obj; }, fromAminoMsg(object: CodeInfoAminoMsg): CodeInfo { @@ -706,19 +788,31 @@ export const CodeInfo = { }; } }; +GlobalDecoderRegistry.register(CodeInfo.typeUrl, CodeInfo); +GlobalDecoderRegistry.registerAminoProtoMapping(CodeInfo.aminoType, CodeInfo.typeUrl); function createBaseContractInfo(): ContractInfo { return { codeId: BigInt(0), creator: "", admin: "", label: "", - created: AbsoluteTxPosition.fromPartial({}), + created: undefined, ibcPortId: "", extension: undefined }; } export const ContractInfo = { typeUrl: "/cosmwasm.wasm.v1.ContractInfo", + aminoType: "wasm/ContractInfo", + is(o: any): o is ContractInfo { + return o && (o.$typeUrl === ContractInfo.typeUrl || typeof o.codeId === "bigint" && typeof o.creator === "string" && typeof o.admin === "string" && typeof o.label === "string" && typeof o.ibcPortId === "string"); + }, + isSDK(o: any): o is ContractInfoSDKType { + return o && (o.$typeUrl === ContractInfo.typeUrl || typeof o.code_id === "bigint" && typeof o.creator === "string" && typeof o.admin === "string" && typeof o.label === "string" && typeof o.ibc_port_id === "string"); + }, + isAmino(o: any): o is ContractInfoAmino { + return o && (o.$typeUrl === ContractInfo.typeUrl || typeof o.code_id === "bigint" && typeof o.creator === "string" && typeof o.admin === "string" && typeof o.label === "string" && typeof o.ibc_port_id === "string"); + }, encode(message: ContractInfo, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.codeId !== BigInt(0)) { writer.uint32(8).uint64(message.codeId); @@ -739,7 +833,7 @@ export const ContractInfo = { writer.uint32(50).string(message.ibcPortId); } if (message.extension !== undefined) { - Any.encode((message.extension as Any), writer.uint32(58).fork()).ldelim(); + Any.encode(GlobalDecoderRegistry.wrapAny(message.extension), writer.uint32(58).fork()).ldelim(); } return writer; }, @@ -769,7 +863,7 @@ export const ContractInfo = { message.ibcPortId = reader.string(); break; case 7: - message.extension = (Cosmwasm_wasmv1ContractInfoExtension_InterfaceDecoder(reader) as Any); + message.extension = GlobalDecoderRegistry.unwrapAny(reader); break; default: reader.skipType(tag & 7); @@ -778,6 +872,28 @@ export const ContractInfo = { } return message; }, + fromJSON(object: any): ContractInfo { + return { + codeId: isSet(object.codeId) ? BigInt(object.codeId.toString()) : BigInt(0), + creator: isSet(object.creator) ? String(object.creator) : "", + admin: isSet(object.admin) ? String(object.admin) : "", + label: isSet(object.label) ? String(object.label) : "", + created: isSet(object.created) ? AbsoluteTxPosition.fromJSON(object.created) : undefined, + ibcPortId: isSet(object.ibcPortId) ? String(object.ibcPortId) : "", + extension: isSet(object.extension) ? GlobalDecoderRegistry.fromJSON(object.extension) : undefined + }; + }, + toJSON(message: ContractInfo): unknown { + const obj: any = {}; + message.codeId !== undefined && (obj.codeId = (message.codeId || BigInt(0)).toString()); + message.creator !== undefined && (obj.creator = message.creator); + message.admin !== undefined && (obj.admin = message.admin); + message.label !== undefined && (obj.label = message.label); + message.created !== undefined && (obj.created = message.created ? AbsoluteTxPosition.toJSON(message.created) : undefined); + message.ibcPortId !== undefined && (obj.ibcPortId = message.ibcPortId); + message.extension !== undefined && (obj.extension = message.extension ? GlobalDecoderRegistry.toJSON(message.extension) : undefined); + return obj; + }, fromPartial(object: Partial): ContractInfo { const message = createBaseContractInfo(); message.codeId = object.codeId !== undefined && object.codeId !== null ? BigInt(object.codeId.toString()) : BigInt(0); @@ -786,19 +902,33 @@ export const ContractInfo = { message.label = object.label ?? ""; message.created = object.created !== undefined && object.created !== null ? AbsoluteTxPosition.fromPartial(object.created) : undefined; message.ibcPortId = object.ibcPortId ?? ""; - message.extension = object.extension !== undefined && object.extension !== null ? Any.fromPartial(object.extension) : undefined; + message.extension = object.extension !== undefined && object.extension !== null ? GlobalDecoderRegistry.fromPartial(object.extension) : undefined; return message; }, fromAmino(object: ContractInfoAmino): ContractInfo { - return { - codeId: BigInt(object.code_id), - creator: object.creator, - admin: object.admin, - label: object.label, - created: object?.created ? AbsoluteTxPosition.fromAmino(object.created) : undefined, - ibcPortId: object.ibc_port_id, - extension: object?.extension ? Cosmwasm_wasmv1ContractInfoExtension_FromAmino(object.extension) : undefined - }; + const message = createBaseContractInfo(); + if (object.code_id !== undefined && object.code_id !== null) { + message.codeId = BigInt(object.code_id); + } + if (object.creator !== undefined && object.creator !== null) { + message.creator = object.creator; + } + if (object.admin !== undefined && object.admin !== null) { + message.admin = object.admin; + } + if (object.label !== undefined && object.label !== null) { + message.label = object.label; + } + if (object.created !== undefined && object.created !== null) { + message.created = AbsoluteTxPosition.fromAmino(object.created); + } + if (object.ibc_port_id !== undefined && object.ibc_port_id !== null) { + message.ibcPortId = object.ibc_port_id; + } + if (object.extension !== undefined && object.extension !== null) { + message.extension = GlobalDecoderRegistry.fromAminoMsg(object.extension); + } + return message; }, toAmino(message: ContractInfo): ContractInfoAmino { const obj: any = {}; @@ -808,7 +938,7 @@ export const ContractInfo = { obj.label = message.label; obj.created = message.created ? AbsoluteTxPosition.toAmino(message.created) : undefined; obj.ibc_port_id = message.ibcPortId; - obj.extension = message.extension ? Cosmwasm_wasmv1ContractInfoExtension_ToAmino((message.extension as Any)) : undefined; + obj.extension = message.extension ? GlobalDecoderRegistry.toAminoMsg(message.extension) : undefined; return obj; }, fromAminoMsg(object: ContractInfoAminoMsg): ContractInfo { @@ -833,16 +963,28 @@ export const ContractInfo = { }; } }; +GlobalDecoderRegistry.register(ContractInfo.typeUrl, ContractInfo); +GlobalDecoderRegistry.registerAminoProtoMapping(ContractInfo.aminoType, ContractInfo.typeUrl); function createBaseContractCodeHistoryEntry(): ContractCodeHistoryEntry { return { operation: 0, codeId: BigInt(0), - updated: AbsoluteTxPosition.fromPartial({}), + updated: undefined, msg: new Uint8Array() }; } export const ContractCodeHistoryEntry = { typeUrl: "/cosmwasm.wasm.v1.ContractCodeHistoryEntry", + aminoType: "wasm/ContractCodeHistoryEntry", + is(o: any): o is ContractCodeHistoryEntry { + return o && (o.$typeUrl === ContractCodeHistoryEntry.typeUrl || isSet(o.operation) && typeof o.codeId === "bigint" && (o.msg instanceof Uint8Array || typeof o.msg === "string")); + }, + isSDK(o: any): o is ContractCodeHistoryEntrySDKType { + return o && (o.$typeUrl === ContractCodeHistoryEntry.typeUrl || isSet(o.operation) && typeof o.code_id === "bigint" && (o.msg instanceof Uint8Array || typeof o.msg === "string")); + }, + isAmino(o: any): o is ContractCodeHistoryEntryAmino { + return o && (o.$typeUrl === ContractCodeHistoryEntry.typeUrl || isSet(o.operation) && typeof o.code_id === "bigint" && (o.msg instanceof Uint8Array || typeof o.msg === "string")); + }, encode(message: ContractCodeHistoryEntry, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.operation !== 0) { writer.uint32(8).int32(message.operation); @@ -884,6 +1026,22 @@ export const ContractCodeHistoryEntry = { } return message; }, + fromJSON(object: any): ContractCodeHistoryEntry { + return { + operation: isSet(object.operation) ? contractCodeHistoryOperationTypeFromJSON(object.operation) : -1, + codeId: isSet(object.codeId) ? BigInt(object.codeId.toString()) : BigInt(0), + updated: isSet(object.updated) ? AbsoluteTxPosition.fromJSON(object.updated) : undefined, + msg: isSet(object.msg) ? bytesFromBase64(object.msg) : new Uint8Array() + }; + }, + toJSON(message: ContractCodeHistoryEntry): unknown { + const obj: any = {}; + message.operation !== undefined && (obj.operation = contractCodeHistoryOperationTypeToJSON(message.operation)); + message.codeId !== undefined && (obj.codeId = (message.codeId || BigInt(0)).toString()); + message.updated !== undefined && (obj.updated = message.updated ? AbsoluteTxPosition.toJSON(message.updated) : undefined); + message.msg !== undefined && (obj.msg = base64FromBytes(message.msg !== undefined ? message.msg : new Uint8Array())); + return obj; + }, fromPartial(object: Partial): ContractCodeHistoryEntry { const message = createBaseContractCodeHistoryEntry(); message.operation = object.operation ?? 0; @@ -893,16 +1051,24 @@ export const ContractCodeHistoryEntry = { return message; }, fromAmino(object: ContractCodeHistoryEntryAmino): ContractCodeHistoryEntry { - return { - operation: isSet(object.operation) ? contractCodeHistoryOperationTypeFromJSON(object.operation) : -1, - codeId: BigInt(object.code_id), - updated: object?.updated ? AbsoluteTxPosition.fromAmino(object.updated) : undefined, - msg: toUtf8(JSON.stringify(object.msg)) - }; + const message = createBaseContractCodeHistoryEntry(); + if (object.operation !== undefined && object.operation !== null) { + message.operation = contractCodeHistoryOperationTypeFromJSON(object.operation); + } + if (object.code_id !== undefined && object.code_id !== null) { + message.codeId = BigInt(object.code_id); + } + if (object.updated !== undefined && object.updated !== null) { + message.updated = AbsoluteTxPosition.fromAmino(object.updated); + } + if (object.msg !== undefined && object.msg !== null) { + message.msg = toUtf8(JSON.stringify(object.msg)); + } + return message; }, toAmino(message: ContractCodeHistoryEntry): ContractCodeHistoryEntryAmino { const obj: any = {}; - obj.operation = message.operation; + obj.operation = contractCodeHistoryOperationTypeToJSON(message.operation); obj.code_id = message.codeId ? message.codeId.toString() : undefined; obj.updated = message.updated ? AbsoluteTxPosition.toAmino(message.updated) : undefined; obj.msg = message.msg ? JSON.parse(fromUtf8(message.msg)) : undefined; @@ -930,6 +1096,8 @@ export const ContractCodeHistoryEntry = { }; } }; +GlobalDecoderRegistry.register(ContractCodeHistoryEntry.typeUrl, ContractCodeHistoryEntry); +GlobalDecoderRegistry.registerAminoProtoMapping(ContractCodeHistoryEntry.aminoType, ContractCodeHistoryEntry.typeUrl); function createBaseAbsoluteTxPosition(): AbsoluteTxPosition { return { blockHeight: BigInt(0), @@ -938,6 +1106,16 @@ function createBaseAbsoluteTxPosition(): AbsoluteTxPosition { } export const AbsoluteTxPosition = { typeUrl: "/cosmwasm.wasm.v1.AbsoluteTxPosition", + aminoType: "wasm/AbsoluteTxPosition", + is(o: any): o is AbsoluteTxPosition { + return o && (o.$typeUrl === AbsoluteTxPosition.typeUrl || typeof o.blockHeight === "bigint" && typeof o.txIndex === "bigint"); + }, + isSDK(o: any): o is AbsoluteTxPositionSDKType { + return o && (o.$typeUrl === AbsoluteTxPosition.typeUrl || typeof o.block_height === "bigint" && typeof o.tx_index === "bigint"); + }, + isAmino(o: any): o is AbsoluteTxPositionAmino { + return o && (o.$typeUrl === AbsoluteTxPosition.typeUrl || typeof o.block_height === "bigint" && typeof o.tx_index === "bigint"); + }, encode(message: AbsoluteTxPosition, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.blockHeight !== BigInt(0)) { writer.uint32(8).uint64(message.blockHeight); @@ -967,6 +1145,18 @@ export const AbsoluteTxPosition = { } return message; }, + fromJSON(object: any): AbsoluteTxPosition { + return { + blockHeight: isSet(object.blockHeight) ? BigInt(object.blockHeight.toString()) : BigInt(0), + txIndex: isSet(object.txIndex) ? BigInt(object.txIndex.toString()) : BigInt(0) + }; + }, + toJSON(message: AbsoluteTxPosition): unknown { + const obj: any = {}; + message.blockHeight !== undefined && (obj.blockHeight = (message.blockHeight || BigInt(0)).toString()); + message.txIndex !== undefined && (obj.txIndex = (message.txIndex || BigInt(0)).toString()); + return obj; + }, fromPartial(object: Partial): AbsoluteTxPosition { const message = createBaseAbsoluteTxPosition(); message.blockHeight = object.blockHeight !== undefined && object.blockHeight !== null ? BigInt(object.blockHeight.toString()) : BigInt(0); @@ -974,10 +1164,14 @@ export const AbsoluteTxPosition = { return message; }, fromAmino(object: AbsoluteTxPositionAmino): AbsoluteTxPosition { - return { - blockHeight: BigInt(object.block_height), - txIndex: BigInt(object.tx_index) - }; + const message = createBaseAbsoluteTxPosition(); + if (object.block_height !== undefined && object.block_height !== null) { + message.blockHeight = BigInt(object.block_height); + } + if (object.tx_index !== undefined && object.tx_index !== null) { + message.txIndex = BigInt(object.tx_index); + } + return message; }, toAmino(message: AbsoluteTxPosition): AbsoluteTxPositionAmino { const obj: any = {}; @@ -1007,6 +1201,8 @@ export const AbsoluteTxPosition = { }; } }; +GlobalDecoderRegistry.register(AbsoluteTxPosition.typeUrl, AbsoluteTxPosition); +GlobalDecoderRegistry.registerAminoProtoMapping(AbsoluteTxPosition.aminoType, AbsoluteTxPosition.typeUrl); function createBaseModel(): Model { return { key: new Uint8Array(), @@ -1015,6 +1211,16 @@ function createBaseModel(): Model { } export const Model = { typeUrl: "/cosmwasm.wasm.v1.Model", + aminoType: "wasm/Model", + is(o: any): o is Model { + return o && (o.$typeUrl === Model.typeUrl || (o.key instanceof Uint8Array || typeof o.key === "string") && (o.value instanceof Uint8Array || typeof o.value === "string")); + }, + isSDK(o: any): o is ModelSDKType { + return o && (o.$typeUrl === Model.typeUrl || (o.key instanceof Uint8Array || typeof o.key === "string") && (o.value instanceof Uint8Array || typeof o.value === "string")); + }, + isAmino(o: any): o is ModelAmino { + return o && (o.$typeUrl === Model.typeUrl || (o.key instanceof Uint8Array || typeof o.key === "string") && (o.value instanceof Uint8Array || typeof o.value === "string")); + }, encode(message: Model, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.key.length !== 0) { writer.uint32(10).bytes(message.key); @@ -1044,6 +1250,18 @@ export const Model = { } return message; }, + fromJSON(object: any): Model { + return { + key: isSet(object.key) ? bytesFromBase64(object.key) : new Uint8Array(), + value: isSet(object.value) ? bytesFromBase64(object.value) : new Uint8Array() + }; + }, + toJSON(message: Model): unknown { + const obj: any = {}; + message.key !== undefined && (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; + }, fromPartial(object: Partial): Model { const message = createBaseModel(); message.key = object.key ?? new Uint8Array(); @@ -1051,15 +1269,19 @@ export const Model = { return message; }, fromAmino(object: ModelAmino): Model { - return { - key: object.key, - value: object.value - }; + const message = createBaseModel(); + if (object.key !== undefined && object.key !== null) { + message.key = bytesFromBase64(object.key); + } + if (object.value !== undefined && object.value !== null) { + message.value = bytesFromBase64(object.value); + } + return message; }, toAmino(message: Model): ModelAmino { const obj: any = {}; - obj.key = message.key; - obj.value = message.value; + obj.key = message.key ? base64FromBytes(message.key) : undefined; + obj.value = message.value ? base64FromBytes(message.value) : undefined; return obj; }, fromAminoMsg(object: ModelAminoMsg): Model { @@ -1084,17 +1306,5 @@ export const Model = { }; } }; -export const Cosmwasm_wasmv1ContractInfoExtension_InterfaceDecoder = (input: BinaryReader | Uint8Array): Any => { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - const data = Any.decode(reader, reader.uint32()); - switch (data.typeUrl) { - default: - return data; - } -}; -export const Cosmwasm_wasmv1ContractInfoExtension_FromAmino = (content: AnyAmino) => { - return Any.fromAmino(content); -}; -export const Cosmwasm_wasmv1ContractInfoExtension_ToAmino = (content: Any) => { - return Any.toAmino(content); -}; \ No newline at end of file +GlobalDecoderRegistry.register(Model.typeUrl, Model); +GlobalDecoderRegistry.registerAminoProtoMapping(Model.aminoType, Model.typeUrl); \ No newline at end of file diff --git a/packages/osmojs/src/codegen/gogoproto/bundle.ts b/packages/osmojs/src/codegen/gogoproto/bundle.ts index 17083f96a..2fdcf7b84 100644 --- a/packages/osmojs/src/codegen/gogoproto/bundle.ts +++ b/packages/osmojs/src/codegen/gogoproto/bundle.ts @@ -1,4 +1,4 @@ -import * as _173 from "./gogo"; +import * as _231 from "./gogo"; export const gogoproto = { - ..._173 + ..._231 }; \ No newline at end of file diff --git a/packages/osmojs/src/codegen/google/api/http.ts b/packages/osmojs/src/codegen/google/api/http.ts index d91fd573f..1d7086098 100644 --- a/packages/osmojs/src/codegen/google/api/http.ts +++ b/packages/osmojs/src/codegen/google/api/http.ts @@ -1,4 +1,6 @@ import { BinaryReader, BinaryWriter } from "../../binary"; +import { isSet } from "../../helpers"; +import { GlobalDecoderRegistry } from "../../registry"; /** * Defines the HTTP configuration for an API service. It contains a list of * [HttpRule][google.api.HttpRule], each specifying the mapping of an RPC method @@ -36,7 +38,7 @@ export interface HttpAmino { * * **NOTE:** All service configuration rules follow "last one wins" order. */ - rules: HttpRuleAmino[]; + rules?: HttpRuleAmino[]; /** * When set to true, URL path parameters will be fully URI-decoded except in * cases of single segment matches in reserved expansion, where "%2F" will be @@ -45,7 +47,7 @@ export interface HttpAmino { * The default behavior is to not decode RFC 6570 reserved characters in multi * segment matches. */ - fully_decode_reserved_expansion: boolean; + fully_decode_reserved_expansion?: boolean; } export interface HttpAminoMsg { type: "/google.api.Http"; @@ -664,7 +666,7 @@ export interface HttpRuleAmino { * * Refer to [selector][google.api.DocumentationRule.selector] for syntax details. */ - selector: string; + selector?: string; /** * Maps to HTTP GET. Used for listing and getting information about * resources. @@ -693,7 +695,7 @@ export interface HttpRuleAmino { * NOTE: the referred field must be present at the top-level of the request * message type. */ - body: string; + body?: string; /** * Optional. The name of the response field whose value is mapped to the HTTP * response body. When omitted, the entire response message will be used @@ -702,13 +704,13 @@ export interface HttpRuleAmino { * NOTE: The referred field must be present at the top-level of the response * message type. */ - response_body: string; + response_body?: 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). */ - additional_bindings: HttpRuleAmino[]; + additional_bindings?: HttpRuleAmino[]; } export interface HttpRuleAminoMsg { type: "/google.api.HttpRule"; @@ -1011,9 +1013,9 @@ export interface CustomHttpPatternProtoMsg { /** A custom pattern is used for defining custom HTTP verb. */ export interface CustomHttpPatternAmino { /** The name of this custom HTTP verb. */ - kind: string; + kind?: string; /** The path matched by this custom verb. */ - path: string; + path?: string; } export interface CustomHttpPatternAminoMsg { type: "/google.api.CustomHttpPattern"; @@ -1032,6 +1034,15 @@ function createBaseHttp(): Http { } export const Http = { typeUrl: "/google.api.Http", + is(o: any): o is Http { + return o && (o.$typeUrl === Http.typeUrl || Array.isArray(o.rules) && (!o.rules.length || HttpRule.is(o.rules[0])) && typeof o.fullyDecodeReservedExpansion === "boolean"); + }, + isSDK(o: any): o is HttpSDKType { + return o && (o.$typeUrl === Http.typeUrl || Array.isArray(o.rules) && (!o.rules.length || HttpRule.isSDK(o.rules[0])) && typeof o.fully_decode_reserved_expansion === "boolean"); + }, + isAmino(o: any): o is HttpAmino { + return o && (o.$typeUrl === Http.typeUrl || Array.isArray(o.rules) && (!o.rules.length || HttpRule.isAmino(o.rules[0])) && typeof o.fully_decode_reserved_expansion === "boolean"); + }, encode(message: Http, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.rules) { HttpRule.encode(v!, writer.uint32(10).fork()).ldelim(); @@ -1061,6 +1072,22 @@ export const Http = { } return message; }, + fromJSON(object: any): Http { + return { + 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 = {}; + if (message.rules) { + obj.rules = message.rules.map(e => e ? HttpRule.toJSON(e) : undefined); + } else { + obj.rules = []; + } + message.fullyDecodeReservedExpansion !== undefined && (obj.fullyDecodeReservedExpansion = message.fullyDecodeReservedExpansion); + return obj; + }, fromPartial(object: Partial): Http { const message = createBaseHttp(); message.rules = object.rules?.map(e => HttpRule.fromPartial(e)) || []; @@ -1068,10 +1095,12 @@ export const Http = { return message; }, fromAmino(object: HttpAmino): Http { - return { - rules: Array.isArray(object?.rules) ? object.rules.map((e: any) => HttpRule.fromAmino(e)) : [], - fullyDecodeReservedExpansion: object.fully_decode_reserved_expansion - }; + const message = createBaseHttp(); + message.rules = object.rules?.map(e => HttpRule.fromAmino(e)) || []; + if (object.fully_decode_reserved_expansion !== undefined && object.fully_decode_reserved_expansion !== null) { + message.fullyDecodeReservedExpansion = object.fully_decode_reserved_expansion; + } + return message; }, toAmino(message: Http): HttpAmino { const obj: any = {}; @@ -1099,6 +1128,7 @@ export const Http = { }; } }; +GlobalDecoderRegistry.register(Http.typeUrl, Http); function createBaseHttpRule(): HttpRule { return { selector: "", @@ -1115,6 +1145,15 @@ function createBaseHttpRule(): HttpRule { } export const HttpRule = { typeUrl: "/google.api.HttpRule", + is(o: any): o is HttpRule { + return o && (o.$typeUrl === HttpRule.typeUrl || typeof o.selector === "string" && typeof o.body === "string" && typeof o.responseBody === "string" && Array.isArray(o.additionalBindings) && (!o.additionalBindings.length || HttpRule.is(o.additionalBindings[0]))); + }, + isSDK(o: any): o is HttpRuleSDKType { + return o && (o.$typeUrl === HttpRule.typeUrl || typeof o.selector === "string" && typeof o.body === "string" && typeof o.response_body === "string" && Array.isArray(o.additional_bindings) && (!o.additional_bindings.length || HttpRule.isSDK(o.additional_bindings[0]))); + }, + isAmino(o: any): o is HttpRuleAmino { + return o && (o.$typeUrl === HttpRule.typeUrl || typeof o.selector === "string" && typeof o.body === "string" && typeof o.response_body === "string" && Array.isArray(o.additional_bindings) && (!o.additional_bindings.length || HttpRule.isAmino(o.additional_bindings[0]))); + }, encode(message: HttpRule, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.selector !== "") { writer.uint32(10).string(message.selector); @@ -1192,6 +1231,38 @@ export const HttpRule = { } return message; }, + fromJSON(object: any): HttpRule { + return { + selector: isSet(object.selector) ? String(object.selector) : "", + get: isSet(object.get) ? String(object.get) : undefined, + put: isSet(object.put) ? String(object.put) : undefined, + 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, + 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); + 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); + if (message.additionalBindings) { + obj.additionalBindings = message.additionalBindings.map(e => e ? HttpRule.toJSON(e) : undefined); + } else { + obj.additionalBindings = []; + } + return obj; + }, fromPartial(object: Partial): HttpRule { const message = createBaseHttpRule(); message.selector = object.selector ?? ""; @@ -1207,18 +1278,36 @@ export const HttpRule = { return message; }, fromAmino(object: HttpRuleAmino): HttpRule { - return { - selector: object.selector, - get: object?.get, - put: object?.put, - post: object?.post, - delete: object?.delete, - patch: object?.patch, - custom: object?.custom ? CustomHttpPattern.fromAmino(object.custom) : undefined, - body: object.body, - responseBody: object.response_body, - additionalBindings: Array.isArray(object?.additional_bindings) ? object.additional_bindings.map((e: any) => HttpRule.fromAmino(e)) : [] - }; + const message = createBaseHttpRule(); + if (object.selector !== undefined && object.selector !== null) { + message.selector = object.selector; + } + if (object.get !== undefined && object.get !== null) { + message.get = object.get; + } + if (object.put !== undefined && object.put !== null) { + message.put = object.put; + } + if (object.post !== undefined && object.post !== null) { + message.post = object.post; + } + if (object.delete !== undefined && object.delete !== null) { + message.delete = object.delete; + } + if (object.patch !== undefined && object.patch !== null) { + message.patch = object.patch; + } + if (object.custom !== undefined && object.custom !== null) { + message.custom = CustomHttpPattern.fromAmino(object.custom); + } + if (object.body !== undefined && object.body !== null) { + message.body = object.body; + } + if (object.response_body !== undefined && object.response_body !== null) { + message.responseBody = object.response_body; + } + message.additionalBindings = object.additional_bindings?.map(e => HttpRule.fromAmino(e)) || []; + return message; }, toAmino(message: HttpRule): HttpRuleAmino { const obj: any = {}; @@ -1254,6 +1343,7 @@ export const HttpRule = { }; } }; +GlobalDecoderRegistry.register(HttpRule.typeUrl, HttpRule); function createBaseCustomHttpPattern(): CustomHttpPattern { return { kind: "", @@ -1262,6 +1352,15 @@ function createBaseCustomHttpPattern(): CustomHttpPattern { } export const CustomHttpPattern = { typeUrl: "/google.api.CustomHttpPattern", + is(o: any): o is CustomHttpPattern { + return o && (o.$typeUrl === CustomHttpPattern.typeUrl || typeof o.kind === "string" && typeof o.path === "string"); + }, + isSDK(o: any): o is CustomHttpPatternSDKType { + return o && (o.$typeUrl === CustomHttpPattern.typeUrl || typeof o.kind === "string" && typeof o.path === "string"); + }, + isAmino(o: any): o is CustomHttpPatternAmino { + return o && (o.$typeUrl === CustomHttpPattern.typeUrl || typeof o.kind === "string" && typeof o.path === "string"); + }, encode(message: CustomHttpPattern, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.kind !== "") { writer.uint32(10).string(message.kind); @@ -1291,6 +1390,18 @@ export const CustomHttpPattern = { } return message; }, + fromJSON(object: any): CustomHttpPattern { + 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; + }, fromPartial(object: Partial): CustomHttpPattern { const message = createBaseCustomHttpPattern(); message.kind = object.kind ?? ""; @@ -1298,10 +1409,14 @@ export const CustomHttpPattern = { return message; }, fromAmino(object: CustomHttpPatternAmino): CustomHttpPattern { - return { - kind: object.kind, - path: object.path - }; + const message = createBaseCustomHttpPattern(); + if (object.kind !== undefined && object.kind !== null) { + message.kind = object.kind; + } + if (object.path !== undefined && object.path !== null) { + message.path = object.path; + } + return message; }, toAmino(message: CustomHttpPattern): CustomHttpPatternAmino { const obj: any = {}; @@ -1324,4 +1439,5 @@ export const CustomHttpPattern = { value: CustomHttpPattern.encode(message).finish() }; } -}; \ No newline at end of file +}; +GlobalDecoderRegistry.register(CustomHttpPattern.typeUrl, CustomHttpPattern); \ No newline at end of file diff --git a/packages/osmojs/src/codegen/google/bundle.ts b/packages/osmojs/src/codegen/google/bundle.ts index b198fe56a..1c351441a 100644 --- a/packages/osmojs/src/codegen/google/bundle.ts +++ b/packages/osmojs/src/codegen/google/bundle.ts @@ -1,14 +1,14 @@ -import * as _174 from "./protobuf/any"; -import * as _175 from "./protobuf/descriptor"; -import * as _176 from "./protobuf/duration"; -import * as _177 from "./protobuf/empty"; -import * as _178 from "./protobuf/timestamp"; +import * as _232 from "./protobuf/any"; +import * as _233 from "./protobuf/descriptor"; +import * as _234 from "./protobuf/duration"; +import * as _235 from "./protobuf/empty"; +import * as _236 from "./protobuf/timestamp"; export namespace google { export const protobuf = { - ..._174, - ..._175, - ..._176, - ..._177, - ..._178 + ..._232, + ..._233, + ..._234, + ..._235, + ..._236 }; } \ No newline at end of file diff --git a/packages/osmojs/src/codegen/google/protobuf/any.ts b/packages/osmojs/src/codegen/google/protobuf/any.ts index 6c8e97ada..cf9d206f7 100644 --- a/packages/osmojs/src/codegen/google/protobuf/any.ts +++ b/packages/osmojs/src/codegen/google/protobuf/any.ts @@ -1,4 +1,5 @@ import { BinaryReader, BinaryWriter } from "../../binary"; +import { isSet, bytesFromBase64, base64FromBytes } from "../../helpers"; /** * `Any` contains an arbitrary serialized protocol buffer message along with a * URL that describes the type of the serialized message. @@ -81,7 +82,7 @@ import { BinaryReader, BinaryWriter } from "../../binary"; * } */ export interface Any { - $typeUrl?: string; + $typeUrl?: "/google.protobuf.Any"; /** * A URL/resource name that uniquely identifies the type of the serialized * protocol buffer message. This string must contain at least @@ -320,7 +321,7 @@ export interface AnyAminoMsg { * } */ export interface AnySDKType { - $typeUrl?: string; + $typeUrl?: "/google.protobuf.Any"; type_url: string; value: Uint8Array; } @@ -333,6 +334,15 @@ function createBaseAny(): Any { } export const Any = { typeUrl: "/google.protobuf.Any", + is(o: any): o is Any { + return o && (o.$typeUrl === Any.typeUrl || typeof o.typeUrl === "string" && (o.value instanceof Uint8Array || typeof o.value === "string")); + }, + isSDK(o: any): o is AnySDKType { + return o && (o.$typeUrl === Any.typeUrl || typeof o.type_url === "string" && (o.value instanceof Uint8Array || typeof o.value === "string")); + }, + isAmino(o: any): o is AnyAmino { + return o && (o.$typeUrl === Any.typeUrl || typeof o.type === "string" && (o.value instanceof Uint8Array || typeof o.value === "string")); + }, encode(message: Any, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.typeUrl !== "") { writer.uint32(10).string(message.typeUrl); @@ -362,6 +372,18 @@ export const Any = { } 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); + message.value !== undefined && (obj.value = base64FromBytes(message.value !== undefined ? message.value : new Uint8Array())); + return obj; + }, fromPartial(object: Partial): Any { const message = createBaseAny(); message.typeUrl = object.typeUrl ?? ""; diff --git a/packages/osmojs/src/codegen/google/protobuf/descriptor.ts b/packages/osmojs/src/codegen/google/protobuf/descriptor.ts index d350846c4..fdb5a6915 100644 --- a/packages/osmojs/src/codegen/google/protobuf/descriptor.ts +++ b/packages/osmojs/src/codegen/google/protobuf/descriptor.ts @@ -1,5 +1,6 @@ import { BinaryReader, BinaryWriter } from "../../binary"; -import { isSet } from "../../helpers"; +import { GlobalDecoderRegistry } from "../../registry"; +import { isSet, bytesFromBase64, base64FromBytes } from "../../helpers"; export enum FieldDescriptorProto_Type { /** * TYPE_DOUBLE - 0 is reserved for errors. @@ -374,7 +375,7 @@ export interface FileDescriptorSetProtoMsg { * files it parses. */ export interface FileDescriptorSetAmino { - file: FileDescriptorProtoAmino[]; + file?: FileDescriptorProtoAmino[]; } export interface FileDescriptorSetAminoMsg { type: "/google.protobuf.FileDescriptorSet"; @@ -406,14 +407,14 @@ export interface FileDescriptorProto { enumType: EnumDescriptorProto[]; service: ServiceDescriptorProto[]; extension: FieldDescriptorProto[]; - options: FileOptions; + 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". @@ -427,22 +428,22 @@ export interface FileDescriptorProtoProtoMsg { /** Describes a complete .proto file. */ export interface FileDescriptorProtoAmino { /** file name, relative to root of source tree */ - name: string; - package: string; + name?: 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. */ - public_dependency: number[]; + public_dependency?: number[]; /** * Indexes of the weak imported files in the dependency list. * For Google-internal migration only. Do not use. */ - weak_dependency: number[]; + weak_dependency?: number[]; /** All top-level definitions in this file. */ - message_type: DescriptorProtoAmino[]; - enum_type: EnumDescriptorProtoAmino[]; - service: ServiceDescriptorProtoAmino[]; - extension: FieldDescriptorProtoAmino[]; + message_type?: DescriptorProtoAmino[]; + enum_type?: EnumDescriptorProtoAmino[]; + service?: ServiceDescriptorProtoAmino[]; + extension?: FieldDescriptorProtoAmino[]; options?: FileOptionsAmino; /** * This field contains optional information about the original source code. @@ -455,7 +456,7 @@ export interface FileDescriptorProtoAmino { * The syntax of the proto file. * The supported values are "proto2" and "proto3". */ - syntax: string; + syntax?: string; } export interface FileDescriptorProtoAminoMsg { type: "/google.protobuf.FileDescriptorProto"; @@ -472,8 +473,8 @@ export interface FileDescriptorProtoSDKType { enum_type: EnumDescriptorProtoSDKType[]; service: ServiceDescriptorProtoSDKType[]; extension: FieldDescriptorProtoSDKType[]; - options: FileOptionsSDKType; - source_code_info: SourceCodeInfoSDKType; + options?: FileOptionsSDKType; + source_code_info?: SourceCodeInfoSDKType; syntax: string; } /** Describes a message type. */ @@ -485,7 +486,7 @@ export interface DescriptorProto { enumType: EnumDescriptorProto[]; extensionRange: DescriptorProto_ExtensionRange[]; oneofDecl: OneofDescriptorProto[]; - options: MessageOptions; + options?: MessageOptions; reservedRange: DescriptorProto_ReservedRange[]; /** * Reserved field names, which may not be used by fields in the same message. @@ -499,20 +500,20 @@ export interface DescriptorProtoProtoMsg { } /** Describes a message type. */ export interface DescriptorProtoAmino { - name: string; - field: FieldDescriptorProtoAmino[]; - extension: FieldDescriptorProtoAmino[]; - nested_type: DescriptorProtoAmino[]; - enum_type: EnumDescriptorProtoAmino[]; - extension_range: DescriptorProto_ExtensionRangeAmino[]; - oneof_decl: OneofDescriptorProtoAmino[]; + name?: string; + field?: FieldDescriptorProtoAmino[]; + extension?: FieldDescriptorProtoAmino[]; + nested_type?: DescriptorProtoAmino[]; + enum_type?: EnumDescriptorProtoAmino[]; + extension_range?: DescriptorProto_ExtensionRangeAmino[]; + oneof_decl?: OneofDescriptorProtoAmino[]; options?: MessageOptionsAmino; - reserved_range: DescriptorProto_ReservedRangeAmino[]; + reserved_range?: DescriptorProto_ReservedRangeAmino[]; /** * Reserved field names, which may not be used by fields in the same message. * A given name may only be reserved once. */ - reserved_name: string[]; + reserved_name?: string[]; } export interface DescriptorProtoAminoMsg { type: "/google.protobuf.DescriptorProto"; @@ -527,7 +528,7 @@ export interface DescriptorProtoSDKType { enum_type: EnumDescriptorProtoSDKType[]; extension_range: DescriptorProto_ExtensionRangeSDKType[]; oneof_decl: OneofDescriptorProtoSDKType[]; - options: MessageOptionsSDKType; + options?: MessageOptionsSDKType; reserved_range: DescriptorProto_ReservedRangeSDKType[]; reserved_name: string[]; } @@ -536,7 +537,7 @@ export interface DescriptorProto_ExtensionRange { start: number; /** Exclusive. */ end: number; - options: ExtensionRangeOptions; + options?: ExtensionRangeOptions; } export interface DescriptorProto_ExtensionRangeProtoMsg { typeUrl: "/google.protobuf.ExtensionRange"; @@ -544,9 +545,9 @@ export interface DescriptorProto_ExtensionRangeProtoMsg { } export interface DescriptorProto_ExtensionRangeAmino { /** Inclusive. */ - start: number; + start?: number; /** Exclusive. */ - end: number; + end?: number; options?: ExtensionRangeOptionsAmino; } export interface DescriptorProto_ExtensionRangeAminoMsg { @@ -556,7 +557,7 @@ export interface DescriptorProto_ExtensionRangeAminoMsg { export interface DescriptorProto_ExtensionRangeSDKType { start: number; end: number; - options: ExtensionRangeOptionsSDKType; + options?: ExtensionRangeOptionsSDKType; } /** * Range of reserved tag numbers. Reserved tag numbers may not be used by @@ -580,9 +581,9 @@ export interface DescriptorProto_ReservedRangeProtoMsg { */ export interface DescriptorProto_ReservedRangeAmino { /** Inclusive. */ - start: number; + start?: number; /** Exclusive. */ - end: number; + end?: number; } export interface DescriptorProto_ReservedRangeAminoMsg { type: "/google.protobuf.ReservedRange"; @@ -607,7 +608,7 @@ export interface ExtensionRangeOptionsProtoMsg { } export interface ExtensionRangeOptionsAmino { /** The parser stores options it doesn't recognize here. See above. */ - uninterpreted_option: UninterpretedOptionAmino[]; + uninterpreted_option?: UninterpretedOptionAmino[]; } export interface ExtensionRangeOptionsAminoMsg { type: "/google.protobuf.ExtensionRangeOptions"; @@ -659,7 +660,7 @@ export interface FieldDescriptorProto { * it to camelCase. */ jsonName: string; - options: FieldOptions; + options?: FieldOptions; } export interface FieldDescriptorProtoProtoMsg { typeUrl: "/google.protobuf.FieldDescriptorProto"; @@ -667,14 +668,14 @@ export interface FieldDescriptorProtoProtoMsg { } /** Describes a field within a message. */ export interface FieldDescriptorProtoAmino { - 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 @@ -682,12 +683,12 @@ export interface FieldDescriptorProtoAmino { * message are searched, then within the parent, on up to the root * namespace). */ - type_name: string; + type_name?: 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". @@ -695,19 +696,19 @@ export interface FieldDescriptorProtoAmino { * For bytes, contains the C escaped value. All bytes >= 128 are escaped. * TODO(kenton): Base-64 encode? */ - default_value: string; + default_value?: 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. */ - oneof_index: number; + oneof_index?: 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. */ - json_name: string; + json_name?: string; options?: FieldOptionsAmino; } export interface FieldDescriptorProtoAminoMsg { @@ -725,12 +726,12 @@ export interface FieldDescriptorProtoSDKType { default_value: string; oneof_index: number; json_name: string; - options: FieldOptionsSDKType; + options?: FieldOptionsSDKType; } /** Describes a oneof. */ export interface OneofDescriptorProto { name: string; - options: OneofOptions; + options?: OneofOptions; } export interface OneofDescriptorProtoProtoMsg { typeUrl: "/google.protobuf.OneofDescriptorProto"; @@ -738,7 +739,7 @@ export interface OneofDescriptorProtoProtoMsg { } /** Describes a oneof. */ export interface OneofDescriptorProtoAmino { - name: string; + name?: string; options?: OneofOptionsAmino; } export interface OneofDescriptorProtoAminoMsg { @@ -748,13 +749,13 @@ export interface OneofDescriptorProtoAminoMsg { /** Describes a oneof. */ export interface OneofDescriptorProtoSDKType { name: string; - options: OneofOptionsSDKType; + options?: OneofOptionsSDKType; } /** Describes an enum type. */ export interface EnumDescriptorProto { name: string; value: EnumValueDescriptorProto[]; - options: EnumOptions; + 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 @@ -773,20 +774,20 @@ export interface EnumDescriptorProtoProtoMsg { } /** Describes an enum type. */ export interface EnumDescriptorProtoAmino { - name: string; - value: EnumValueDescriptorProtoAmino[]; + name?: string; + value?: EnumValueDescriptorProtoAmino[]; options?: EnumOptionsAmino; /** * 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. */ - reserved_range: EnumDescriptorProto_EnumReservedRangeAmino[]; + reserved_range?: EnumDescriptorProto_EnumReservedRangeAmino[]; /** * Reserved enum value names, which may not be reused. A given name may only * be reserved once. */ - reserved_name: string[]; + reserved_name?: string[]; } export interface EnumDescriptorProtoAminoMsg { type: "/google.protobuf.EnumDescriptorProto"; @@ -796,7 +797,7 @@ export interface EnumDescriptorProtoAminoMsg { export interface EnumDescriptorProtoSDKType { name: string; value: EnumValueDescriptorProtoSDKType[]; - options: EnumOptionsSDKType; + options?: EnumOptionsSDKType; reserved_range: EnumDescriptorProto_EnumReservedRangeSDKType[]; reserved_name: string[]; } @@ -828,9 +829,9 @@ export interface EnumDescriptorProto_EnumReservedRangeProtoMsg { */ export interface EnumDescriptorProto_EnumReservedRangeAmino { /** Inclusive. */ - start: number; + start?: number; /** Inclusive. */ - end: number; + end?: number; } export interface EnumDescriptorProto_EnumReservedRangeAminoMsg { type: "/google.protobuf.EnumReservedRange"; @@ -852,7 +853,7 @@ export interface EnumDescriptorProto_EnumReservedRangeSDKType { export interface EnumValueDescriptorProto { name: string; number: number; - options: EnumValueOptions; + options?: EnumValueOptions; } export interface EnumValueDescriptorProtoProtoMsg { typeUrl: "/google.protobuf.EnumValueDescriptorProto"; @@ -860,8 +861,8 @@ export interface EnumValueDescriptorProtoProtoMsg { } /** Describes a value within an enum. */ export interface EnumValueDescriptorProtoAmino { - name: string; - number: number; + name?: string; + number?: number; options?: EnumValueOptionsAmino; } export interface EnumValueDescriptorProtoAminoMsg { @@ -872,13 +873,13 @@ export interface EnumValueDescriptorProtoAminoMsg { export interface EnumValueDescriptorProtoSDKType { name: string; number: number; - options: EnumValueOptionsSDKType; + options?: EnumValueOptionsSDKType; } /** Describes a service. */ export interface ServiceDescriptorProto { name: string; method: MethodDescriptorProto[]; - options: ServiceOptions; + options?: ServiceOptions; } export interface ServiceDescriptorProtoProtoMsg { typeUrl: "/google.protobuf.ServiceDescriptorProto"; @@ -886,8 +887,8 @@ export interface ServiceDescriptorProtoProtoMsg { } /** Describes a service. */ export interface ServiceDescriptorProtoAmino { - name: string; - method: MethodDescriptorProtoAmino[]; + name?: string; + method?: MethodDescriptorProtoAmino[]; options?: ServiceOptionsAmino; } export interface ServiceDescriptorProtoAminoMsg { @@ -898,7 +899,7 @@ export interface ServiceDescriptorProtoAminoMsg { export interface ServiceDescriptorProtoSDKType { name: string; method: MethodDescriptorProtoSDKType[]; - options: ServiceOptionsSDKType; + options?: ServiceOptionsSDKType; } /** Describes a method of a service. */ export interface MethodDescriptorProto { @@ -909,7 +910,7 @@ export interface MethodDescriptorProto { */ inputType: string; outputType: string; - options: MethodOptions; + options?: MethodOptions; /** Identifies if client streams multiple client messages */ clientStreaming: boolean; /** Identifies if server streams multiple server messages */ @@ -921,18 +922,18 @@ export interface MethodDescriptorProtoProtoMsg { } /** Describes a method of a service. */ export interface MethodDescriptorProtoAmino { - 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. */ - input_type: string; - output_type: string; + input_type?: string; + output_type?: string; options?: MethodOptionsAmino; /** Identifies if client streams multiple client messages */ - client_streaming: boolean; + client_streaming?: boolean; /** Identifies if server streams multiple server messages */ - server_streaming: boolean; + server_streaming?: boolean; } export interface MethodDescriptorProtoAminoMsg { type: "/google.protobuf.MethodDescriptorProto"; @@ -943,7 +944,7 @@ export interface MethodDescriptorProtoSDKType { name: string; input_type: string; output_type: string; - options: MethodOptionsSDKType; + options?: MethodOptionsSDKType; client_streaming: boolean; server_streaming: boolean; } @@ -1075,7 +1076,7 @@ export interface FileOptionsAmino { * inappropriate because proto packages do not normally start with backwards * domain names. */ - java_package: string; + java_package?: 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 @@ -1083,7 +1084,7 @@ export interface FileOptionsAmino { * a .proto always translates to a single class, but you may want to * explicitly choose the class name). */ - java_outer_classname: string; + java_outer_classname?: string; /** * If set true, then the Java code generator will generate a separate .java * file for each top-level message, enum, and service defined in the .proto @@ -1092,10 +1093,10 @@ export interface FileOptionsAmino { * generated to contain the file's getDescriptor() method as well as any * top-level extensions defined in the file. */ - java_multiple_files: boolean; + java_multiple_files?: boolean; /** This option does nothing. */ /** @deprecated */ - java_generate_equals_and_hash: boolean; + java_generate_equals_and_hash?: 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 @@ -1104,8 +1105,8 @@ export interface FileOptionsAmino { * However, an extension field still accepts non-UTF-8 byte sequences. * This option has no effect on when used with the lite runtime. */ - java_string_check_utf8: boolean; - optimize_for: FileOptions_OptimizeMode; + java_string_check_utf8?: boolean; + optimize_for?: 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: @@ -1113,7 +1114,7 @@ export interface FileOptionsAmino { * - Otherwise, the package statement in the .proto file, if present. * - Otherwise, the basename of the .proto file, without extension. */ - go_package: string; + go_package?: string; /** * Should generic services be generated in each language? "Generic" services * are not specific to any particular RPC system. They are generated by the @@ -1126,64 +1127,64 @@ export interface FileOptionsAmino { * these default to false. Old code which depends on generic services should * explicitly set them to true. */ - cc_generic_services: boolean; - java_generic_services: boolean; - py_generic_services: boolean; - php_generic_services: boolean; + cc_generic_services?: boolean; + java_generic_services?: boolean; + py_generic_services?: boolean; + php_generic_services?: 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++. */ - cc_enable_arenas: boolean; + cc_enable_arenas?: boolean; /** * Sets the objective c class prefix which is prepended to all objective c * generated classes from this .proto. There is no default. */ - objc_class_prefix: string; + objc_class_prefix?: string; /** Namespace for generated classes; defaults to the package. */ - csharp_namespace: string; + csharp_namespace?: 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. */ - swift_prefix: string; + swift_prefix?: string; /** * Sets the php class prefix which is prepended to all php generated classes * from this .proto. Default is empty. */ - php_class_prefix: string; + php_class_prefix?: 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. */ - php_namespace: string; + php_namespace?: 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. */ - php_metadata_namespace: string; + php_metadata_namespace?: 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. */ - ruby_package: string; + ruby_package?: string; /** * The parser stores options it doesn't recognize here. * See the documentation for the "Options" section above. */ - uninterpreted_option: UninterpretedOptionAmino[]; + uninterpreted_option?: UninterpretedOptionAmino[]; } export interface FileOptionsAminoMsg { type: "/google.protobuf.FileOptions"; @@ -1300,20 +1301,20 @@ export interface MessageOptionsAmino { * Because this is an option, the above two restrictions are not enforced by * the protocol compiler. */ - message_set_wire_format: boolean; + message_set_wire_format?: 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". */ - no_standard_descriptor_accessor: boolean; + no_standard_descriptor_accessor?: 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. @@ -1337,9 +1338,9 @@ export interface MessageOptionsAmino { * instead. The option should only be implicitly set by the proto compiler * parser. */ - map_entry: boolean; + map_entry?: boolean; /** The parser stores options it doesn't recognize here. See above. */ - uninterpreted_option: UninterpretedOptionAmino[]; + uninterpreted_option?: UninterpretedOptionAmino[]; } export interface MessageOptionsAminoMsg { type: "/google.protobuf.MessageOptions"; @@ -1436,7 +1437,7 @@ export interface FieldOptionsAmino { * 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 @@ -1444,7 +1445,7 @@ export interface FieldOptionsAmino { * 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 @@ -1458,7 +1459,7 @@ export interface FieldOptionsAmino { * 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 @@ -1489,18 +1490,18 @@ export interface FieldOptionsAmino { * check its required fields, regardless of whether or not the message has * been parsed. */ - lazy: boolean; + lazy?: boolean; /** * Is this field deprecated? * Depending on the target platform, this can emit Deprecated annotations * for accessors, or it will be completely ignored; in the very least, this * is a formalization for deprecating fields. */ - deprecated: boolean; + 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. */ - uninterpreted_option: UninterpretedOptionAmino[]; + uninterpreted_option?: UninterpretedOptionAmino[]; } export interface FieldOptionsAminoMsg { type: "/google.protobuf.FieldOptions"; @@ -1525,7 +1526,7 @@ export interface OneofOptionsProtoMsg { } export interface OneofOptionsAmino { /** The parser stores options it doesn't recognize here. See above. */ - uninterpreted_option: UninterpretedOptionAmino[]; + uninterpreted_option?: UninterpretedOptionAmino[]; } export interface OneofOptionsAminoMsg { type: "/google.protobuf.OneofOptions"; @@ -1559,16 +1560,16 @@ export interface EnumOptionsAmino { * Set this option to true to allow mapping different tag names to the same * value. */ - allow_alias: boolean; + allow_alias?: 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. */ - uninterpreted_option: UninterpretedOptionAmino[]; + uninterpreted_option?: UninterpretedOptionAmino[]; } export interface EnumOptionsAminoMsg { type: "/google.protobuf.EnumOptions"; @@ -1601,9 +1602,9 @@ export interface EnumValueOptionsAmino { * 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. */ - uninterpreted_option: UninterpretedOptionAmino[]; + uninterpreted_option?: UninterpretedOptionAmino[]; } export interface EnumValueOptionsAminoMsg { type: "/google.protobuf.EnumValueOptions"; @@ -1635,9 +1636,9 @@ export interface ServiceOptionsAmino { * 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. */ - uninterpreted_option: UninterpretedOptionAmino[]; + uninterpreted_option?: UninterpretedOptionAmino[]; } export interface ServiceOptionsAminoMsg { type: "/google.protobuf.ServiceOptions"; @@ -1670,10 +1671,10 @@ export interface MethodOptionsAmino { * for the method, or it will be completely ignored; in the very least, * this is a formalization for deprecating methods. */ - deprecated: boolean; - idempotency_level: MethodOptions_IdempotencyLevel; + deprecated?: boolean; + idempotency_level?: MethodOptions_IdempotencyLevel; /** The parser stores options it doesn't recognize here. See above. */ - uninterpreted_option: UninterpretedOptionAmino[]; + uninterpreted_option?: UninterpretedOptionAmino[]; } export interface MethodOptionsAminoMsg { type: "/google.protobuf.MethodOptions"; @@ -1718,17 +1719,17 @@ export interface UninterpretedOptionProtoMsg { * in them. */ export interface UninterpretedOptionAmino { - name: UninterpretedOption_NamePartAmino[]; + name?: UninterpretedOption_NamePartAmino[]; /** * The value of the uninterpreted option, in whatever type the tokenizer * identified it as during parsing. Exactly one of these should be set. */ - identifier_value: string; - positive_int_value: string; - negative_int_value: string; - double_value: number; - string_value: Uint8Array; - aggregate_value: string; + identifier_value?: string; + positive_int_value?: string; + negative_int_value?: string; + double_value?: number; + string_value?: string; + aggregate_value?: string; } export interface UninterpretedOptionAminoMsg { type: "/google.protobuf.UninterpretedOption"; @@ -1774,8 +1775,8 @@ export interface UninterpretedOption_NamePartProtoMsg { * "foo.(bar.baz).qux". */ export interface UninterpretedOption_NamePartAmino { - name_part: string; - is_extension: boolean; + name_part?: string; + is_extension?: boolean; } export interface UninterpretedOption_NamePartAminoMsg { type: "/google.protobuf.NamePart"; @@ -1898,7 +1899,7 @@ export interface SourceCodeInfoAmino { * ignore those that it doesn't understand, as more types of locations could * be recorded in the future. */ - location: SourceCodeInfo_LocationAmino[]; + location?: SourceCodeInfo_LocationAmino[]; } export interface SourceCodeInfoAminoMsg { type: "/google.protobuf.SourceCodeInfo"; @@ -2029,7 +2030,7 @@ export interface SourceCodeInfo_LocationAmino { * 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. @@ -2037,7 +2038,7 @@ export interface SourceCodeInfo_LocationAmino { * 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 @@ -2087,9 +2088,9 @@ export interface SourceCodeInfo_LocationAmino { * * // ignored detached comments. */ - leading_comments: string; - trailing_comments: string; - leading_detached_comments: string[]; + leading_comments?: string; + trailing_comments?: string; + leading_detached_comments?: string[]; } export interface SourceCodeInfo_LocationAminoMsg { type: "/google.protobuf.Location"; @@ -2128,7 +2129,7 @@ export interface GeneratedCodeInfoAmino { * An Annotation connects some span of text in generated code to an element * of its generating .proto file. */ - annotation: GeneratedCodeInfo_AnnotationAmino[]; + annotation?: GeneratedCodeInfo_AnnotationAmino[]; } export interface GeneratedCodeInfoAminoMsg { type: "/google.protobuf.GeneratedCodeInfo"; @@ -2171,20 +2172,20 @@ export interface GeneratedCodeInfo_AnnotationAmino { * 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. */ - source_file: string; + source_file?: 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; } export interface GeneratedCodeInfo_AnnotationAminoMsg { type: "/google.protobuf.Annotation"; @@ -2203,6 +2204,15 @@ function createBaseFileDescriptorSet(): FileDescriptorSet { } export const FileDescriptorSet = { typeUrl: "/google.protobuf.FileDescriptorSet", + is(o: any): o is FileDescriptorSet { + return o && (o.$typeUrl === FileDescriptorSet.typeUrl || Array.isArray(o.file) && (!o.file.length || FileDescriptorProto.is(o.file[0]))); + }, + isSDK(o: any): o is FileDescriptorSetSDKType { + return o && (o.$typeUrl === FileDescriptorSet.typeUrl || Array.isArray(o.file) && (!o.file.length || FileDescriptorProto.isSDK(o.file[0]))); + }, + isAmino(o: any): o is FileDescriptorSetAmino { + return o && (o.$typeUrl === FileDescriptorSet.typeUrl || Array.isArray(o.file) && (!o.file.length || FileDescriptorProto.isAmino(o.file[0]))); + }, encode(message: FileDescriptorSet, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.file) { FileDescriptorProto.encode(v!, writer.uint32(10).fork()).ldelim(); @@ -2226,15 +2236,29 @@ export const FileDescriptorSet = { } return message; }, + fromJSON(object: any): FileDescriptorSet { + return { + file: Array.isArray(object?.file) ? object.file.map((e: any) => FileDescriptorProto.fromJSON(e)) : [] + }; + }, + toJSON(message: FileDescriptorSet): unknown { + const obj: any = {}; + if (message.file) { + obj.file = message.file.map(e => e ? FileDescriptorProto.toJSON(e) : undefined); + } else { + obj.file = []; + } + return obj; + }, fromPartial(object: Partial): FileDescriptorSet { const message = createBaseFileDescriptorSet(); message.file = object.file?.map(e => FileDescriptorProto.fromPartial(e)) || []; return message; }, fromAmino(object: FileDescriptorSetAmino): FileDescriptorSet { - return { - file: Array.isArray(object?.file) ? object.file.map((e: any) => FileDescriptorProto.fromAmino(e)) : [] - }; + const message = createBaseFileDescriptorSet(); + message.file = object.file?.map(e => FileDescriptorProto.fromAmino(e)) || []; + return message; }, toAmino(message: FileDescriptorSet): FileDescriptorSetAmino { const obj: any = {}; @@ -2261,6 +2285,7 @@ export const FileDescriptorSet = { }; } }; +GlobalDecoderRegistry.register(FileDescriptorSet.typeUrl, FileDescriptorSet); function createBaseFileDescriptorProto(): FileDescriptorProto { return { name: "", @@ -2272,13 +2297,22 @@ function createBaseFileDescriptorProto(): FileDescriptorProto { enumType: [], service: [], extension: [], - options: FileOptions.fromPartial({}), - sourceCodeInfo: SourceCodeInfo.fromPartial({}), + options: undefined, + sourceCodeInfo: undefined, syntax: "" }; } export const FileDescriptorProto = { typeUrl: "/google.protobuf.FileDescriptorProto", + is(o: any): o is FileDescriptorProto { + return o && (o.$typeUrl === FileDescriptorProto.typeUrl || typeof o.name === "string" && typeof o.package === "string" && Array.isArray(o.dependency) && (!o.dependency.length || typeof o.dependency[0] === "string") && Array.isArray(o.publicDependency) && (!o.publicDependency.length || typeof o.publicDependency[0] === "number") && Array.isArray(o.weakDependency) && (!o.weakDependency.length || typeof o.weakDependency[0] === "number") && Array.isArray(o.messageType) && (!o.messageType.length || DescriptorProto.is(o.messageType[0])) && Array.isArray(o.enumType) && (!o.enumType.length || EnumDescriptorProto.is(o.enumType[0])) && Array.isArray(o.service) && (!o.service.length || ServiceDescriptorProto.is(o.service[0])) && Array.isArray(o.extension) && (!o.extension.length || FieldDescriptorProto.is(o.extension[0])) && typeof o.syntax === "string"); + }, + isSDK(o: any): o is FileDescriptorProtoSDKType { + return o && (o.$typeUrl === FileDescriptorProto.typeUrl || typeof o.name === "string" && typeof o.package === "string" && Array.isArray(o.dependency) && (!o.dependency.length || typeof o.dependency[0] === "string") && Array.isArray(o.public_dependency) && (!o.public_dependency.length || typeof o.public_dependency[0] === "number") && Array.isArray(o.weak_dependency) && (!o.weak_dependency.length || typeof o.weak_dependency[0] === "number") && Array.isArray(o.message_type) && (!o.message_type.length || DescriptorProto.isSDK(o.message_type[0])) && Array.isArray(o.enum_type) && (!o.enum_type.length || EnumDescriptorProto.isSDK(o.enum_type[0])) && Array.isArray(o.service) && (!o.service.length || ServiceDescriptorProto.isSDK(o.service[0])) && Array.isArray(o.extension) && (!o.extension.length || FieldDescriptorProto.isSDK(o.extension[0])) && typeof o.syntax === "string"); + }, + isAmino(o: any): o is FileDescriptorProtoAmino { + return o && (o.$typeUrl === FileDescriptorProto.typeUrl || typeof o.name === "string" && typeof o.package === "string" && Array.isArray(o.dependency) && (!o.dependency.length || typeof o.dependency[0] === "string") && Array.isArray(o.public_dependency) && (!o.public_dependency.length || typeof o.public_dependency[0] === "number") && Array.isArray(o.weak_dependency) && (!o.weak_dependency.length || typeof o.weak_dependency[0] === "number") && Array.isArray(o.message_type) && (!o.message_type.length || DescriptorProto.isAmino(o.message_type[0])) && Array.isArray(o.enum_type) && (!o.enum_type.length || EnumDescriptorProto.isAmino(o.enum_type[0])) && Array.isArray(o.service) && (!o.service.length || ServiceDescriptorProto.isAmino(o.service[0])) && Array.isArray(o.extension) && (!o.extension.length || FieldDescriptorProto.isAmino(o.extension[0])) && typeof o.syntax === "string"); + }, encode(message: FileDescriptorProto, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.name !== "") { writer.uint32(10).string(message.name); @@ -2386,6 +2420,66 @@ export const FileDescriptorProto = { } 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)) : [], + publicDependency: Array.isArray(object?.publicDependency) ? object.publicDependency.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)) : [], + 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, + 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); + if (message.dependency) { + obj.dependency = message.dependency.map(e => e); + } else { + obj.dependency = []; + } + if (message.publicDependency) { + obj.publicDependency = message.publicDependency.map(e => Math.round(e)); + } else { + obj.publicDependency = []; + } + if (message.weakDependency) { + obj.weakDependency = message.weakDependency.map(e => Math.round(e)); + } else { + obj.weakDependency = []; + } + if (message.messageType) { + obj.messageType = message.messageType.map(e => e ? DescriptorProto.toJSON(e) : undefined); + } else { + obj.messageType = []; + } + if (message.enumType) { + obj.enumType = message.enumType.map(e => e ? EnumDescriptorProto.toJSON(e) : undefined); + } else { + obj.enumType = []; + } + if (message.service) { + obj.service = message.service.map(e => e ? ServiceDescriptorProto.toJSON(e) : undefined); + } else { + obj.service = []; + } + if (message.extension) { + obj.extension = message.extension.map(e => e ? FieldDescriptorProto.toJSON(e) : undefined); + } else { + obj.extension = []; + } + message.options !== undefined && (obj.options = message.options ? FileOptions.toJSON(message.options) : undefined); + message.sourceCodeInfo !== undefined && (obj.sourceCodeInfo = message.sourceCodeInfo ? SourceCodeInfo.toJSON(message.sourceCodeInfo) : undefined); + message.syntax !== undefined && (obj.syntax = message.syntax); + return obj; + }, fromPartial(object: Partial): FileDescriptorProto { const message = createBaseFileDescriptorProto(); message.name = object.name ?? ""; @@ -2403,20 +2497,30 @@ export const FileDescriptorProto = { return message; }, fromAmino(object: FileDescriptorProtoAmino): FileDescriptorProto { - return { - name: object.name, - package: object.package, - dependency: Array.isArray(object?.dependency) ? object.dependency.map((e: any) => e) : [], - publicDependency: Array.isArray(object?.public_dependency) ? object.public_dependency.map((e: any) => e) : [], - weakDependency: Array.isArray(object?.weak_dependency) ? object.weak_dependency.map((e: any) => e) : [], - messageType: Array.isArray(object?.message_type) ? object.message_type.map((e: any) => DescriptorProto.fromAmino(e)) : [], - enumType: Array.isArray(object?.enum_type) ? object.enum_type.map((e: any) => EnumDescriptorProto.fromAmino(e)) : [], - service: Array.isArray(object?.service) ? object.service.map((e: any) => ServiceDescriptorProto.fromAmino(e)) : [], - extension: Array.isArray(object?.extension) ? object.extension.map((e: any) => FieldDescriptorProto.fromAmino(e)) : [], - options: object?.options ? FileOptions.fromAmino(object.options) : undefined, - sourceCodeInfo: object?.source_code_info ? SourceCodeInfo.fromAmino(object.source_code_info) : undefined, - syntax: object.syntax - }; + const message = createBaseFileDescriptorProto(); + if (object.name !== undefined && object.name !== null) { + message.name = object.name; + } + if (object.package !== undefined && object.package !== null) { + message.package = object.package; + } + message.dependency = object.dependency?.map(e => e) || []; + message.publicDependency = object.public_dependency?.map(e => e) || []; + message.weakDependency = object.weak_dependency?.map(e => e) || []; + message.messageType = object.message_type?.map(e => DescriptorProto.fromAmino(e)) || []; + message.enumType = object.enum_type?.map(e => EnumDescriptorProto.fromAmino(e)) || []; + message.service = object.service?.map(e => ServiceDescriptorProto.fromAmino(e)) || []; + message.extension = object.extension?.map(e => FieldDescriptorProto.fromAmino(e)) || []; + if (object.options !== undefined && object.options !== null) { + message.options = FileOptions.fromAmino(object.options); + } + if (object.source_code_info !== undefined && object.source_code_info !== null) { + message.sourceCodeInfo = SourceCodeInfo.fromAmino(object.source_code_info); + } + if (object.syntax !== undefined && object.syntax !== null) { + message.syntax = object.syntax; + } + return message; }, toAmino(message: FileDescriptorProto): FileDescriptorProtoAmino { const obj: any = {}; @@ -2478,6 +2582,7 @@ export const FileDescriptorProto = { }; } }; +GlobalDecoderRegistry.register(FileDescriptorProto.typeUrl, FileDescriptorProto); function createBaseDescriptorProto(): DescriptorProto { return { name: "", @@ -2487,13 +2592,22 @@ function createBaseDescriptorProto(): DescriptorProto { enumType: [], extensionRange: [], oneofDecl: [], - options: MessageOptions.fromPartial({}), + options: undefined, reservedRange: [], reservedName: [] }; } export const DescriptorProto = { typeUrl: "/google.protobuf.DescriptorProto", + is(o: any): o is DescriptorProto { + return o && (o.$typeUrl === DescriptorProto.typeUrl || typeof o.name === "string" && Array.isArray(o.field) && (!o.field.length || FieldDescriptorProto.is(o.field[0])) && Array.isArray(o.extension) && (!o.extension.length || FieldDescriptorProto.is(o.extension[0])) && Array.isArray(o.nestedType) && (!o.nestedType.length || DescriptorProto.is(o.nestedType[0])) && Array.isArray(o.enumType) && (!o.enumType.length || EnumDescriptorProto.is(o.enumType[0])) && Array.isArray(o.extensionRange) && (!o.extensionRange.length || DescriptorProto_ExtensionRange.is(o.extensionRange[0])) && Array.isArray(o.oneofDecl) && (!o.oneofDecl.length || OneofDescriptorProto.is(o.oneofDecl[0])) && Array.isArray(o.reservedRange) && (!o.reservedRange.length || DescriptorProto_ReservedRange.is(o.reservedRange[0])) && Array.isArray(o.reservedName) && (!o.reservedName.length || typeof o.reservedName[0] === "string")); + }, + isSDK(o: any): o is DescriptorProtoSDKType { + return o && (o.$typeUrl === DescriptorProto.typeUrl || typeof o.name === "string" && Array.isArray(o.field) && (!o.field.length || FieldDescriptorProto.isSDK(o.field[0])) && Array.isArray(o.extension) && (!o.extension.length || FieldDescriptorProto.isSDK(o.extension[0])) && Array.isArray(o.nested_type) && (!o.nested_type.length || DescriptorProto.isSDK(o.nested_type[0])) && Array.isArray(o.enum_type) && (!o.enum_type.length || EnumDescriptorProto.isSDK(o.enum_type[0])) && Array.isArray(o.extension_range) && (!o.extension_range.length || DescriptorProto_ExtensionRange.isSDK(o.extension_range[0])) && Array.isArray(o.oneof_decl) && (!o.oneof_decl.length || OneofDescriptorProto.isSDK(o.oneof_decl[0])) && Array.isArray(o.reserved_range) && (!o.reserved_range.length || DescriptorProto_ReservedRange.isSDK(o.reserved_range[0])) && Array.isArray(o.reserved_name) && (!o.reserved_name.length || typeof o.reserved_name[0] === "string")); + }, + isAmino(o: any): o is DescriptorProtoAmino { + return o && (o.$typeUrl === DescriptorProto.typeUrl || typeof o.name === "string" && Array.isArray(o.field) && (!o.field.length || FieldDescriptorProto.isAmino(o.field[0])) && Array.isArray(o.extension) && (!o.extension.length || FieldDescriptorProto.isAmino(o.extension[0])) && Array.isArray(o.nested_type) && (!o.nested_type.length || DescriptorProto.isAmino(o.nested_type[0])) && Array.isArray(o.enum_type) && (!o.enum_type.length || EnumDescriptorProto.isAmino(o.enum_type[0])) && Array.isArray(o.extension_range) && (!o.extension_range.length || DescriptorProto_ExtensionRange.isAmino(o.extension_range[0])) && Array.isArray(o.oneof_decl) && (!o.oneof_decl.length || OneofDescriptorProto.isAmino(o.oneof_decl[0])) && Array.isArray(o.reserved_range) && (!o.reserved_range.length || DescriptorProto_ReservedRange.isAmino(o.reserved_range[0])) && Array.isArray(o.reserved_name) && (!o.reserved_name.length || typeof o.reserved_name[0] === "string")); + }, encode(message: DescriptorProto, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.name !== "") { writer.uint32(10).string(message.name); @@ -2571,6 +2685,66 @@ export const DescriptorProto = { } 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)) : [], + 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)) : [], + extensionRange: Array.isArray(object?.extensionRange) ? 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, + reservedRange: Array.isArray(object?.reservedRange) ? object.reservedRange.map((e: any) => DescriptorProto_ReservedRange.fromJSON(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); + if (message.field) { + obj.field = message.field.map(e => e ? FieldDescriptorProto.toJSON(e) : undefined); + } else { + obj.field = []; + } + if (message.extension) { + obj.extension = message.extension.map(e => e ? FieldDescriptorProto.toJSON(e) : undefined); + } else { + obj.extension = []; + } + if (message.nestedType) { + obj.nestedType = message.nestedType.map(e => e ? DescriptorProto.toJSON(e) : undefined); + } else { + obj.nestedType = []; + } + if (message.enumType) { + obj.enumType = message.enumType.map(e => e ? EnumDescriptorProto.toJSON(e) : undefined); + } else { + obj.enumType = []; + } + if (message.extensionRange) { + obj.extensionRange = message.extensionRange.map(e => e ? DescriptorProto_ExtensionRange.toJSON(e) : undefined); + } else { + obj.extensionRange = []; + } + if (message.oneofDecl) { + obj.oneofDecl = message.oneofDecl.map(e => e ? OneofDescriptorProto.toJSON(e) : undefined); + } else { + obj.oneofDecl = []; + } + message.options !== undefined && (obj.options = message.options ? MessageOptions.toJSON(message.options) : undefined); + if (message.reservedRange) { + obj.reservedRange = message.reservedRange.map(e => e ? DescriptorProto_ReservedRange.toJSON(e) : undefined); + } else { + obj.reservedRange = []; + } + if (message.reservedName) { + obj.reservedName = message.reservedName.map(e => e); + } else { + obj.reservedName = []; + } + return obj; + }, fromPartial(object: Partial): DescriptorProto { const message = createBaseDescriptorProto(); message.name = object.name ?? ""; @@ -2586,18 +2760,22 @@ export const DescriptorProto = { return message; }, fromAmino(object: DescriptorProtoAmino): DescriptorProto { - return { - name: object.name, - field: Array.isArray(object?.field) ? object.field.map((e: any) => FieldDescriptorProto.fromAmino(e)) : [], - extension: Array.isArray(object?.extension) ? object.extension.map((e: any) => FieldDescriptorProto.fromAmino(e)) : [], - nestedType: Array.isArray(object?.nested_type) ? object.nested_type.map((e: any) => DescriptorProto.fromAmino(e)) : [], - enumType: Array.isArray(object?.enum_type) ? object.enum_type.map((e: any) => EnumDescriptorProto.fromAmino(e)) : [], - extensionRange: Array.isArray(object?.extension_range) ? object.extension_range.map((e: any) => DescriptorProto_ExtensionRange.fromAmino(e)) : [], - oneofDecl: Array.isArray(object?.oneof_decl) ? object.oneof_decl.map((e: any) => OneofDescriptorProto.fromAmino(e)) : [], - options: object?.options ? MessageOptions.fromAmino(object.options) : undefined, - reservedRange: Array.isArray(object?.reserved_range) ? object.reserved_range.map((e: any) => DescriptorProto_ReservedRange.fromAmino(e)) : [], - reservedName: Array.isArray(object?.reserved_name) ? object.reserved_name.map((e: any) => e) : [] - }; + const message = createBaseDescriptorProto(); + if (object.name !== undefined && object.name !== null) { + message.name = object.name; + } + message.field = object.field?.map(e => FieldDescriptorProto.fromAmino(e)) || []; + message.extension = object.extension?.map(e => FieldDescriptorProto.fromAmino(e)) || []; + message.nestedType = object.nested_type?.map(e => DescriptorProto.fromAmino(e)) || []; + message.enumType = object.enum_type?.map(e => EnumDescriptorProto.fromAmino(e)) || []; + message.extensionRange = object.extension_range?.map(e => DescriptorProto_ExtensionRange.fromAmino(e)) || []; + message.oneofDecl = object.oneof_decl?.map(e => OneofDescriptorProto.fromAmino(e)) || []; + if (object.options !== undefined && object.options !== null) { + message.options = MessageOptions.fromAmino(object.options); + } + message.reservedRange = object.reserved_range?.map(e => DescriptorProto_ReservedRange.fromAmino(e)) || []; + message.reservedName = object.reserved_name?.map(e => e) || []; + return message; }, toAmino(message: DescriptorProto): DescriptorProtoAmino { const obj: any = {}; @@ -2661,15 +2839,25 @@ export const DescriptorProto = { }; } }; +GlobalDecoderRegistry.register(DescriptorProto.typeUrl, DescriptorProto); function createBaseDescriptorProto_ExtensionRange(): DescriptorProto_ExtensionRange { return { start: 0, end: 0, - options: ExtensionRangeOptions.fromPartial({}) + options: undefined }; } export const DescriptorProto_ExtensionRange = { typeUrl: "/google.protobuf.ExtensionRange", + is(o: any): o is DescriptorProto_ExtensionRange { + return o && (o.$typeUrl === DescriptorProto_ExtensionRange.typeUrl || typeof o.start === "number" && typeof o.end === "number"); + }, + isSDK(o: any): o is DescriptorProto_ExtensionRangeSDKType { + return o && (o.$typeUrl === DescriptorProto_ExtensionRange.typeUrl || typeof o.start === "number" && typeof o.end === "number"); + }, + isAmino(o: any): o is DescriptorProto_ExtensionRangeAmino { + return o && (o.$typeUrl === DescriptorProto_ExtensionRange.typeUrl || typeof o.start === "number" && typeof o.end === "number"); + }, encode(message: DescriptorProto_ExtensionRange, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.start !== 0) { writer.uint32(8).int32(message.start); @@ -2705,6 +2893,20 @@ export const DescriptorProto_ExtensionRange = { } 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 + }; + }, + 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)); + message.options !== undefined && (obj.options = message.options ? ExtensionRangeOptions.toJSON(message.options) : undefined); + return obj; + }, fromPartial(object: Partial): DescriptorProto_ExtensionRange { const message = createBaseDescriptorProto_ExtensionRange(); message.start = object.start ?? 0; @@ -2713,11 +2915,17 @@ export const DescriptorProto_ExtensionRange = { return message; }, fromAmino(object: DescriptorProto_ExtensionRangeAmino): DescriptorProto_ExtensionRange { - return { - start: object.start, - end: object.end, - options: object?.options ? ExtensionRangeOptions.fromAmino(object.options) : undefined - }; + const message = createBaseDescriptorProto_ExtensionRange(); + if (object.start !== undefined && object.start !== null) { + message.start = object.start; + } + if (object.end !== undefined && object.end !== null) { + message.end = object.end; + } + if (object.options !== undefined && object.options !== null) { + message.options = ExtensionRangeOptions.fromAmino(object.options); + } + return message; }, toAmino(message: DescriptorProto_ExtensionRange): DescriptorProto_ExtensionRangeAmino { const obj: any = {}; @@ -2742,6 +2950,7 @@ export const DescriptorProto_ExtensionRange = { }; } }; +GlobalDecoderRegistry.register(DescriptorProto_ExtensionRange.typeUrl, DescriptorProto_ExtensionRange); function createBaseDescriptorProto_ReservedRange(): DescriptorProto_ReservedRange { return { start: 0, @@ -2750,6 +2959,15 @@ function createBaseDescriptorProto_ReservedRange(): DescriptorProto_ReservedRang } export const DescriptorProto_ReservedRange = { typeUrl: "/google.protobuf.ReservedRange", + is(o: any): o is DescriptorProto_ReservedRange { + return o && (o.$typeUrl === DescriptorProto_ReservedRange.typeUrl || typeof o.start === "number" && typeof o.end === "number"); + }, + isSDK(o: any): o is DescriptorProto_ReservedRangeSDKType { + return o && (o.$typeUrl === DescriptorProto_ReservedRange.typeUrl || typeof o.start === "number" && typeof o.end === "number"); + }, + isAmino(o: any): o is DescriptorProto_ReservedRangeAmino { + return o && (o.$typeUrl === DescriptorProto_ReservedRange.typeUrl || typeof o.start === "number" && typeof o.end === "number"); + }, encode(message: DescriptorProto_ReservedRange, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.start !== 0) { writer.uint32(8).int32(message.start); @@ -2779,6 +2997,18 @@ export const DescriptorProto_ReservedRange = { } return message; }, + fromJSON(object: any): DescriptorProto_ReservedRange { + 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; + }, fromPartial(object: Partial): DescriptorProto_ReservedRange { const message = createBaseDescriptorProto_ReservedRange(); message.start = object.start ?? 0; @@ -2786,10 +3016,14 @@ export const DescriptorProto_ReservedRange = { return message; }, fromAmino(object: DescriptorProto_ReservedRangeAmino): DescriptorProto_ReservedRange { - return { - start: object.start, - end: object.end - }; + const message = createBaseDescriptorProto_ReservedRange(); + if (object.start !== undefined && object.start !== null) { + message.start = object.start; + } + if (object.end !== undefined && object.end !== null) { + message.end = object.end; + } + return message; }, toAmino(message: DescriptorProto_ReservedRange): DescriptorProto_ReservedRangeAmino { const obj: any = {}; @@ -2813,6 +3047,7 @@ export const DescriptorProto_ReservedRange = { }; } }; +GlobalDecoderRegistry.register(DescriptorProto_ReservedRange.typeUrl, DescriptorProto_ReservedRange); function createBaseExtensionRangeOptions(): ExtensionRangeOptions { return { uninterpretedOption: [] @@ -2820,6 +3055,15 @@ function createBaseExtensionRangeOptions(): ExtensionRangeOptions { } export const ExtensionRangeOptions = { typeUrl: "/google.protobuf.ExtensionRangeOptions", + is(o: any): o is ExtensionRangeOptions { + return o && (o.$typeUrl === ExtensionRangeOptions.typeUrl || Array.isArray(o.uninterpretedOption) && (!o.uninterpretedOption.length || UninterpretedOption.is(o.uninterpretedOption[0]))); + }, + isSDK(o: any): o is ExtensionRangeOptionsSDKType { + return o && (o.$typeUrl === ExtensionRangeOptions.typeUrl || Array.isArray(o.uninterpreted_option) && (!o.uninterpreted_option.length || UninterpretedOption.isSDK(o.uninterpreted_option[0]))); + }, + isAmino(o: any): o is ExtensionRangeOptionsAmino { + return o && (o.$typeUrl === ExtensionRangeOptions.typeUrl || Array.isArray(o.uninterpreted_option) && (!o.uninterpreted_option.length || UninterpretedOption.isAmino(o.uninterpreted_option[0]))); + }, encode(message: ExtensionRangeOptions, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.uninterpretedOption) { UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); @@ -2843,15 +3087,29 @@ export const ExtensionRangeOptions = { } return message; }, + fromJSON(object: any): ExtensionRangeOptions { + return { + uninterpretedOption: Array.isArray(object?.uninterpretedOption) ? object.uninterpretedOption.map((e: any) => UninterpretedOption.fromJSON(e)) : [] + }; + }, + toJSON(message: ExtensionRangeOptions): unknown { + const obj: any = {}; + if (message.uninterpretedOption) { + obj.uninterpretedOption = message.uninterpretedOption.map(e => e ? UninterpretedOption.toJSON(e) : undefined); + } else { + obj.uninterpretedOption = []; + } + return obj; + }, fromPartial(object: Partial): ExtensionRangeOptions { const message = createBaseExtensionRangeOptions(); message.uninterpretedOption = object.uninterpretedOption?.map(e => UninterpretedOption.fromPartial(e)) || []; return message; }, fromAmino(object: ExtensionRangeOptionsAmino): ExtensionRangeOptions { - return { - uninterpretedOption: Array.isArray(object?.uninterpreted_option) ? object.uninterpreted_option.map((e: any) => UninterpretedOption.fromAmino(e)) : [] - }; + const message = createBaseExtensionRangeOptions(); + message.uninterpretedOption = object.uninterpreted_option?.map(e => UninterpretedOption.fromAmino(e)) || []; + return message; }, toAmino(message: ExtensionRangeOptions): ExtensionRangeOptionsAmino { const obj: any = {}; @@ -2878,6 +3136,7 @@ export const ExtensionRangeOptions = { }; } }; +GlobalDecoderRegistry.register(ExtensionRangeOptions.typeUrl, ExtensionRangeOptions); function createBaseFieldDescriptorProto(): FieldDescriptorProto { return { name: "", @@ -2889,11 +3148,20 @@ function createBaseFieldDescriptorProto(): FieldDescriptorProto { defaultValue: "", oneofIndex: 0, jsonName: "", - options: FieldOptions.fromPartial({}) + options: undefined }; } export const FieldDescriptorProto = { typeUrl: "/google.protobuf.FieldDescriptorProto", + is(o: any): o is FieldDescriptorProto { + return o && (o.$typeUrl === FieldDescriptorProto.typeUrl || typeof o.name === "string" && typeof o.number === "number" && isSet(o.label) && isSet(o.type) && typeof o.typeName === "string" && typeof o.extendee === "string" && typeof o.defaultValue === "string" && typeof o.oneofIndex === "number" && typeof o.jsonName === "string"); + }, + isSDK(o: any): o is FieldDescriptorProtoSDKType { + return o && (o.$typeUrl === FieldDescriptorProto.typeUrl || typeof o.name === "string" && typeof o.number === "number" && isSet(o.label) && isSet(o.type) && typeof o.type_name === "string" && typeof o.extendee === "string" && typeof o.default_value === "string" && typeof o.oneof_index === "number" && typeof o.json_name === "string"); + }, + isAmino(o: any): o is FieldDescriptorProtoAmino { + return o && (o.$typeUrl === FieldDescriptorProto.typeUrl || typeof o.name === "string" && typeof o.number === "number" && isSet(o.label) && isSet(o.type) && typeof o.type_name === "string" && typeof o.extendee === "string" && typeof o.default_value === "string" && typeof o.oneof_index === "number" && typeof o.json_name === "string"); + }, encode(message: FieldDescriptorProto, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.name !== "") { writer.uint32(10).string(message.name); @@ -2971,6 +3239,34 @@ export const FieldDescriptorProto = { } return message; }, + fromJSON(object: any): FieldDescriptorProto { + return { + name: isSet(object.name) ? String(object.name) : "", + number: isSet(object.number) ? Number(object.number) : 0, + label: isSet(object.label) ? fieldDescriptorProto_LabelFromJSON(object.label) : -1, + type: isSet(object.type) ? fieldDescriptorProto_TypeFromJSON(object.type) : -1, + typeName: isSet(object.typeName) ? String(object.typeName) : "", + extendee: isSet(object.extendee) ? String(object.extendee) : "", + 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 + }; + }, + 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(object: Partial): FieldDescriptorProto { const message = createBaseFieldDescriptorProto(); message.name = object.name ?? ""; @@ -2986,29 +3282,49 @@ export const FieldDescriptorProto = { return message; }, fromAmino(object: FieldDescriptorProtoAmino): FieldDescriptorProto { - return { - name: object.name, - number: object.number, - label: isSet(object.label) ? fieldDescriptorProto_LabelFromJSON(object.label) : -1, - type: isSet(object.type) ? fieldDescriptorProto_TypeFromJSON(object.type) : -1, - typeName: object.type_name, - extendee: object.extendee, - defaultValue: object.default_value, - oneofIndex: object.oneof_index, - jsonName: object.json_name, - options: object?.options ? FieldOptions.fromAmino(object.options) : undefined - }; - }, - toAmino(message: FieldDescriptorProto): FieldDescriptorProtoAmino { - const obj: any = {}; - obj.name = message.name; - obj.number = message.number; - obj.label = message.label; - obj.type = message.type; - obj.type_name = message.typeName; - obj.extendee = message.extendee; - obj.default_value = message.defaultValue; - obj.oneof_index = message.oneofIndex; + const message = createBaseFieldDescriptorProto(); + if (object.name !== undefined && object.name !== null) { + message.name = object.name; + } + if (object.number !== undefined && object.number !== null) { + message.number = object.number; + } + if (object.label !== undefined && object.label !== null) { + message.label = fieldDescriptorProto_LabelFromJSON(object.label); + } + if (object.type !== undefined && object.type !== null) { + message.type = fieldDescriptorProto_TypeFromJSON(object.type); + } + if (object.type_name !== undefined && object.type_name !== null) { + message.typeName = object.type_name; + } + if (object.extendee !== undefined && object.extendee !== null) { + message.extendee = object.extendee; + } + if (object.default_value !== undefined && object.default_value !== null) { + message.defaultValue = object.default_value; + } + if (object.oneof_index !== undefined && object.oneof_index !== null) { + message.oneofIndex = object.oneof_index; + } + if (object.json_name !== undefined && object.json_name !== null) { + message.jsonName = object.json_name; + } + if (object.options !== undefined && object.options !== null) { + message.options = FieldOptions.fromAmino(object.options); + } + return message; + }, + toAmino(message: FieldDescriptorProto): FieldDescriptorProtoAmino { + const obj: any = {}; + obj.name = message.name; + obj.number = message.number; + obj.label = fieldDescriptorProto_LabelToJSON(message.label); + obj.type = fieldDescriptorProto_TypeToJSON(message.type); + obj.type_name = message.typeName; + obj.extendee = message.extendee; + obj.default_value = message.defaultValue; + obj.oneof_index = message.oneofIndex; obj.json_name = message.jsonName; obj.options = message.options ? FieldOptions.toAmino(message.options) : undefined; return obj; @@ -3029,14 +3345,24 @@ export const FieldDescriptorProto = { }; } }; +GlobalDecoderRegistry.register(FieldDescriptorProto.typeUrl, FieldDescriptorProto); function createBaseOneofDescriptorProto(): OneofDescriptorProto { return { name: "", - options: OneofOptions.fromPartial({}) + options: undefined }; } export const OneofDescriptorProto = { typeUrl: "/google.protobuf.OneofDescriptorProto", + is(o: any): o is OneofDescriptorProto { + return o && (o.$typeUrl === OneofDescriptorProto.typeUrl || typeof o.name === "string"); + }, + isSDK(o: any): o is OneofDescriptorProtoSDKType { + return o && (o.$typeUrl === OneofDescriptorProto.typeUrl || typeof o.name === "string"); + }, + isAmino(o: any): o is OneofDescriptorProtoAmino { + return o && (o.$typeUrl === OneofDescriptorProto.typeUrl || typeof o.name === "string"); + }, encode(message: OneofDescriptorProto, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.name !== "") { writer.uint32(10).string(message.name); @@ -3066,6 +3392,18 @@ export const OneofDescriptorProto = { } return message; }, + fromJSON(object: any): OneofDescriptorProto { + return { + name: isSet(object.name) ? String(object.name) : "", + 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; + }, fromPartial(object: Partial): OneofDescriptorProto { const message = createBaseOneofDescriptorProto(); message.name = object.name ?? ""; @@ -3073,10 +3411,14 @@ export const OneofDescriptorProto = { return message; }, fromAmino(object: OneofDescriptorProtoAmino): OneofDescriptorProto { - return { - name: object.name, - options: object?.options ? OneofOptions.fromAmino(object.options) : undefined - }; + const message = createBaseOneofDescriptorProto(); + if (object.name !== undefined && object.name !== null) { + message.name = object.name; + } + if (object.options !== undefined && object.options !== null) { + message.options = OneofOptions.fromAmino(object.options); + } + return message; }, toAmino(message: OneofDescriptorProto): OneofDescriptorProtoAmino { const obj: any = {}; @@ -3100,17 +3442,27 @@ export const OneofDescriptorProto = { }; } }; +GlobalDecoderRegistry.register(OneofDescriptorProto.typeUrl, OneofDescriptorProto); function createBaseEnumDescriptorProto(): EnumDescriptorProto { return { name: "", value: [], - options: EnumOptions.fromPartial({}), + options: undefined, reservedRange: [], reservedName: [] }; } export const EnumDescriptorProto = { typeUrl: "/google.protobuf.EnumDescriptorProto", + is(o: any): o is EnumDescriptorProto { + return o && (o.$typeUrl === EnumDescriptorProto.typeUrl || typeof o.name === "string" && Array.isArray(o.value) && (!o.value.length || EnumValueDescriptorProto.is(o.value[0])) && Array.isArray(o.reservedRange) && (!o.reservedRange.length || EnumDescriptorProto_EnumReservedRange.is(o.reservedRange[0])) && Array.isArray(o.reservedName) && (!o.reservedName.length || typeof o.reservedName[0] === "string")); + }, + isSDK(o: any): o is EnumDescriptorProtoSDKType { + return o && (o.$typeUrl === EnumDescriptorProto.typeUrl || typeof o.name === "string" && Array.isArray(o.value) && (!o.value.length || EnumValueDescriptorProto.isSDK(o.value[0])) && Array.isArray(o.reserved_range) && (!o.reserved_range.length || EnumDescriptorProto_EnumReservedRange.isSDK(o.reserved_range[0])) && Array.isArray(o.reserved_name) && (!o.reserved_name.length || typeof o.reserved_name[0] === "string")); + }, + isAmino(o: any): o is EnumDescriptorProtoAmino { + return o && (o.$typeUrl === EnumDescriptorProto.typeUrl || typeof o.name === "string" && Array.isArray(o.value) && (!o.value.length || EnumValueDescriptorProto.isAmino(o.value[0])) && Array.isArray(o.reserved_range) && (!o.reserved_range.length || EnumDescriptorProto_EnumReservedRange.isAmino(o.reserved_range[0])) && Array.isArray(o.reserved_name) && (!o.reserved_name.length || typeof o.reserved_name[0] === "string")); + }, encode(message: EnumDescriptorProto, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.name !== "") { writer.uint32(10).string(message.name); @@ -3158,6 +3510,36 @@ export const EnumDescriptorProto = { } 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)) : [], + options: isSet(object.options) ? EnumOptions.fromJSON(object.options) : undefined, + reservedRange: Array.isArray(object?.reservedRange) ? object.reservedRange.map((e: any) => EnumDescriptorProto_EnumReservedRange.fromJSON(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); + if (message.value) { + obj.value = message.value.map(e => e ? EnumValueDescriptorProto.toJSON(e) : undefined); + } else { + obj.value = []; + } + message.options !== undefined && (obj.options = message.options ? EnumOptions.toJSON(message.options) : undefined); + if (message.reservedRange) { + obj.reservedRange = message.reservedRange.map(e => e ? EnumDescriptorProto_EnumReservedRange.toJSON(e) : undefined); + } else { + obj.reservedRange = []; + } + if (message.reservedName) { + obj.reservedName = message.reservedName.map(e => e); + } else { + obj.reservedName = []; + } + return obj; + }, fromPartial(object: Partial): EnumDescriptorProto { const message = createBaseEnumDescriptorProto(); message.name = object.name ?? ""; @@ -3168,13 +3550,17 @@ export const EnumDescriptorProto = { return message; }, fromAmino(object: EnumDescriptorProtoAmino): EnumDescriptorProto { - return { - name: object.name, - value: Array.isArray(object?.value) ? object.value.map((e: any) => EnumValueDescriptorProto.fromAmino(e)) : [], - options: object?.options ? EnumOptions.fromAmino(object.options) : undefined, - reservedRange: Array.isArray(object?.reserved_range) ? object.reserved_range.map((e: any) => EnumDescriptorProto_EnumReservedRange.fromAmino(e)) : [], - reservedName: Array.isArray(object?.reserved_name) ? object.reserved_name.map((e: any) => e) : [] - }; + const message = createBaseEnumDescriptorProto(); + if (object.name !== undefined && object.name !== null) { + message.name = object.name; + } + message.value = object.value?.map(e => EnumValueDescriptorProto.fromAmino(e)) || []; + if (object.options !== undefined && object.options !== null) { + message.options = EnumOptions.fromAmino(object.options); + } + message.reservedRange = object.reserved_range?.map(e => EnumDescriptorProto_EnumReservedRange.fromAmino(e)) || []; + message.reservedName = object.reserved_name?.map(e => e) || []; + return message; }, toAmino(message: EnumDescriptorProto): EnumDescriptorProtoAmino { const obj: any = {}; @@ -3213,6 +3599,7 @@ export const EnumDescriptorProto = { }; } }; +GlobalDecoderRegistry.register(EnumDescriptorProto.typeUrl, EnumDescriptorProto); function createBaseEnumDescriptorProto_EnumReservedRange(): EnumDescriptorProto_EnumReservedRange { return { start: 0, @@ -3221,6 +3608,15 @@ function createBaseEnumDescriptorProto_EnumReservedRange(): EnumDescriptorProto_ } export const EnumDescriptorProto_EnumReservedRange = { typeUrl: "/google.protobuf.EnumReservedRange", + is(o: any): o is EnumDescriptorProto_EnumReservedRange { + return o && (o.$typeUrl === EnumDescriptorProto_EnumReservedRange.typeUrl || typeof o.start === "number" && typeof o.end === "number"); + }, + isSDK(o: any): o is EnumDescriptorProto_EnumReservedRangeSDKType { + return o && (o.$typeUrl === EnumDescriptorProto_EnumReservedRange.typeUrl || typeof o.start === "number" && typeof o.end === "number"); + }, + isAmino(o: any): o is EnumDescriptorProto_EnumReservedRangeAmino { + return o && (o.$typeUrl === EnumDescriptorProto_EnumReservedRange.typeUrl || typeof o.start === "number" && typeof o.end === "number"); + }, encode(message: EnumDescriptorProto_EnumReservedRange, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.start !== 0) { writer.uint32(8).int32(message.start); @@ -3250,6 +3646,18 @@ export const EnumDescriptorProto_EnumReservedRange = { } return message; }, + fromJSON(object: any): EnumDescriptorProto_EnumReservedRange { + 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; + }, fromPartial(object: Partial): EnumDescriptorProto_EnumReservedRange { const message = createBaseEnumDescriptorProto_EnumReservedRange(); message.start = object.start ?? 0; @@ -3257,10 +3665,14 @@ export const EnumDescriptorProto_EnumReservedRange = { return message; }, fromAmino(object: EnumDescriptorProto_EnumReservedRangeAmino): EnumDescriptorProto_EnumReservedRange { - return { - start: object.start, - end: object.end - }; + const message = createBaseEnumDescriptorProto_EnumReservedRange(); + if (object.start !== undefined && object.start !== null) { + message.start = object.start; + } + if (object.end !== undefined && object.end !== null) { + message.end = object.end; + } + return message; }, toAmino(message: EnumDescriptorProto_EnumReservedRange): EnumDescriptorProto_EnumReservedRangeAmino { const obj: any = {}; @@ -3284,15 +3696,25 @@ export const EnumDescriptorProto_EnumReservedRange = { }; } }; +GlobalDecoderRegistry.register(EnumDescriptorProto_EnumReservedRange.typeUrl, EnumDescriptorProto_EnumReservedRange); function createBaseEnumValueDescriptorProto(): EnumValueDescriptorProto { return { name: "", number: 0, - options: EnumValueOptions.fromPartial({}) + options: undefined }; } export const EnumValueDescriptorProto = { typeUrl: "/google.protobuf.EnumValueDescriptorProto", + is(o: any): o is EnumValueDescriptorProto { + return o && (o.$typeUrl === EnumValueDescriptorProto.typeUrl || typeof o.name === "string" && typeof o.number === "number"); + }, + isSDK(o: any): o is EnumValueDescriptorProtoSDKType { + return o && (o.$typeUrl === EnumValueDescriptorProto.typeUrl || typeof o.name === "string" && typeof o.number === "number"); + }, + isAmino(o: any): o is EnumValueDescriptorProtoAmino { + return o && (o.$typeUrl === EnumValueDescriptorProto.typeUrl || typeof o.name === "string" && typeof o.number === "number"); + }, encode(message: EnumValueDescriptorProto, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.name !== "") { writer.uint32(10).string(message.name); @@ -3328,6 +3750,20 @@ export const EnumValueDescriptorProto = { } 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 + }; + }, + toJSON(message: EnumValueDescriptorProto): unknown { + 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; + }, fromPartial(object: Partial): EnumValueDescriptorProto { const message = createBaseEnumValueDescriptorProto(); message.name = object.name ?? ""; @@ -3336,11 +3772,17 @@ export const EnumValueDescriptorProto = { return message; }, fromAmino(object: EnumValueDescriptorProtoAmino): EnumValueDescriptorProto { - return { - name: object.name, - number: object.number, - options: object?.options ? EnumValueOptions.fromAmino(object.options) : undefined - }; + const message = createBaseEnumValueDescriptorProto(); + if (object.name !== undefined && object.name !== null) { + message.name = object.name; + } + if (object.number !== undefined && object.number !== null) { + message.number = object.number; + } + if (object.options !== undefined && object.options !== null) { + message.options = EnumValueOptions.fromAmino(object.options); + } + return message; }, toAmino(message: EnumValueDescriptorProto): EnumValueDescriptorProtoAmino { const obj: any = {}; @@ -3365,15 +3807,25 @@ export const EnumValueDescriptorProto = { }; } }; +GlobalDecoderRegistry.register(EnumValueDescriptorProto.typeUrl, EnumValueDescriptorProto); function createBaseServiceDescriptorProto(): ServiceDescriptorProto { return { name: "", method: [], - options: ServiceOptions.fromPartial({}) + options: undefined }; } export const ServiceDescriptorProto = { typeUrl: "/google.protobuf.ServiceDescriptorProto", + is(o: any): o is ServiceDescriptorProto { + return o && (o.$typeUrl === ServiceDescriptorProto.typeUrl || typeof o.name === "string" && Array.isArray(o.method) && (!o.method.length || MethodDescriptorProto.is(o.method[0]))); + }, + isSDK(o: any): o is ServiceDescriptorProtoSDKType { + return o && (o.$typeUrl === ServiceDescriptorProto.typeUrl || typeof o.name === "string" && Array.isArray(o.method) && (!o.method.length || MethodDescriptorProto.isSDK(o.method[0]))); + }, + isAmino(o: any): o is ServiceDescriptorProtoAmino { + return o && (o.$typeUrl === ServiceDescriptorProto.typeUrl || typeof o.name === "string" && Array.isArray(o.method) && (!o.method.length || MethodDescriptorProto.isAmino(o.method[0]))); + }, encode(message: ServiceDescriptorProto, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.name !== "") { writer.uint32(10).string(message.name); @@ -3409,6 +3861,24 @@ export const ServiceDescriptorProto = { } 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 + }; + }, + toJSON(message: ServiceDescriptorProto): unknown { + const obj: any = {}; + message.name !== undefined && (obj.name = message.name); + if (message.method) { + obj.method = message.method.map(e => e ? MethodDescriptorProto.toJSON(e) : undefined); + } else { + obj.method = []; + } + message.options !== undefined && (obj.options = message.options ? ServiceOptions.toJSON(message.options) : undefined); + return obj; + }, fromPartial(object: Partial): ServiceDescriptorProto { const message = createBaseServiceDescriptorProto(); message.name = object.name ?? ""; @@ -3417,11 +3887,15 @@ export const ServiceDescriptorProto = { return message; }, fromAmino(object: ServiceDescriptorProtoAmino): ServiceDescriptorProto { - return { - name: object.name, - method: Array.isArray(object?.method) ? object.method.map((e: any) => MethodDescriptorProto.fromAmino(e)) : [], - options: object?.options ? ServiceOptions.fromAmino(object.options) : undefined - }; + const message = createBaseServiceDescriptorProto(); + if (object.name !== undefined && object.name !== null) { + message.name = object.name; + } + message.method = object.method?.map(e => MethodDescriptorProto.fromAmino(e)) || []; + if (object.options !== undefined && object.options !== null) { + message.options = ServiceOptions.fromAmino(object.options); + } + return message; }, toAmino(message: ServiceDescriptorProto): ServiceDescriptorProtoAmino { const obj: any = {}; @@ -3450,18 +3924,28 @@ export const ServiceDescriptorProto = { }; } }; +GlobalDecoderRegistry.register(ServiceDescriptorProto.typeUrl, ServiceDescriptorProto); function createBaseMethodDescriptorProto(): MethodDescriptorProto { return { name: "", inputType: "", outputType: "", - options: MethodOptions.fromPartial({}), + options: undefined, clientStreaming: false, serverStreaming: false }; } export const MethodDescriptorProto = { typeUrl: "/google.protobuf.MethodDescriptorProto", + is(o: any): o is MethodDescriptorProto { + return o && (o.$typeUrl === MethodDescriptorProto.typeUrl || typeof o.name === "string" && typeof o.inputType === "string" && typeof o.outputType === "string" && typeof o.clientStreaming === "boolean" && typeof o.serverStreaming === "boolean"); + }, + isSDK(o: any): o is MethodDescriptorProtoSDKType { + return o && (o.$typeUrl === MethodDescriptorProto.typeUrl || typeof o.name === "string" && typeof o.input_type === "string" && typeof o.output_type === "string" && typeof o.client_streaming === "boolean" && typeof o.server_streaming === "boolean"); + }, + isAmino(o: any): o is MethodDescriptorProtoAmino { + return o && (o.$typeUrl === MethodDescriptorProto.typeUrl || typeof o.name === "string" && typeof o.input_type === "string" && typeof o.output_type === "string" && typeof o.client_streaming === "boolean" && typeof o.server_streaming === "boolean"); + }, encode(message: MethodDescriptorProto, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.name !== "") { writer.uint32(10).string(message.name); @@ -3515,6 +3999,26 @@ export const MethodDescriptorProto = { } return message; }, + fromJSON(object: any): MethodDescriptorProto { + return { + 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 + }; + }, + toJSON(message: MethodDescriptorProto): unknown { + const obj: any = {}; + message.name !== undefined && (obj.name = message.name); + message.inputType !== undefined && (obj.inputType = message.inputType); + message.outputType !== undefined && (obj.outputType = message.outputType); + message.options !== undefined && (obj.options = message.options ? MethodOptions.toJSON(message.options) : undefined); + message.clientStreaming !== undefined && (obj.clientStreaming = message.clientStreaming); + message.serverStreaming !== undefined && (obj.serverStreaming = message.serverStreaming); + return obj; + }, fromPartial(object: Partial): MethodDescriptorProto { const message = createBaseMethodDescriptorProto(); message.name = object.name ?? ""; @@ -3526,14 +4030,26 @@ export const MethodDescriptorProto = { return message; }, fromAmino(object: MethodDescriptorProtoAmino): MethodDescriptorProto { - return { - name: object.name, - inputType: object.input_type, - outputType: object.output_type, - options: object?.options ? MethodOptions.fromAmino(object.options) : undefined, - clientStreaming: object.client_streaming, - serverStreaming: object.server_streaming - }; + const message = createBaseMethodDescriptorProto(); + if (object.name !== undefined && object.name !== null) { + message.name = object.name; + } + if (object.input_type !== undefined && object.input_type !== null) { + message.inputType = object.input_type; + } + if (object.output_type !== undefined && object.output_type !== null) { + message.outputType = object.output_type; + } + if (object.options !== undefined && object.options !== null) { + message.options = MethodOptions.fromAmino(object.options); + } + if (object.client_streaming !== undefined && object.client_streaming !== null) { + message.clientStreaming = object.client_streaming; + } + if (object.server_streaming !== undefined && object.server_streaming !== null) { + message.serverStreaming = object.server_streaming; + } + return message; }, toAmino(message: MethodDescriptorProto): MethodDescriptorProtoAmino { const obj: any = {}; @@ -3561,6 +4077,7 @@ export const MethodDescriptorProto = { }; } }; +GlobalDecoderRegistry.register(MethodDescriptorProto.typeUrl, MethodDescriptorProto); function createBaseFileOptions(): FileOptions { return { javaPackage: "", @@ -3588,6 +4105,15 @@ function createBaseFileOptions(): FileOptions { } export const FileOptions = { typeUrl: "/google.protobuf.FileOptions", + is(o: any): o is FileOptions { + return o && (o.$typeUrl === FileOptions.typeUrl || typeof o.javaPackage === "string" && typeof o.javaOuterClassname === "string" && typeof o.javaMultipleFiles === "boolean" && typeof o.javaGenerateEqualsAndHash === "boolean" && typeof o.javaStringCheckUtf8 === "boolean" && isSet(o.optimizeFor) && typeof o.goPackage === "string" && typeof o.ccGenericServices === "boolean" && typeof o.javaGenericServices === "boolean" && typeof o.pyGenericServices === "boolean" && typeof o.phpGenericServices === "boolean" && typeof o.deprecated === "boolean" && typeof o.ccEnableArenas === "boolean" && typeof o.objcClassPrefix === "string" && typeof o.csharpNamespace === "string" && typeof o.swiftPrefix === "string" && typeof o.phpClassPrefix === "string" && typeof o.phpNamespace === "string" && typeof o.phpMetadataNamespace === "string" && typeof o.rubyPackage === "string" && Array.isArray(o.uninterpretedOption) && (!o.uninterpretedOption.length || UninterpretedOption.is(o.uninterpretedOption[0]))); + }, + isSDK(o: any): o is FileOptionsSDKType { + return o && (o.$typeUrl === FileOptions.typeUrl || typeof o.java_package === "string" && typeof o.java_outer_classname === "string" && typeof o.java_multiple_files === "boolean" && typeof o.java_generate_equals_and_hash === "boolean" && typeof o.java_string_check_utf8 === "boolean" && isSet(o.optimize_for) && typeof o.go_package === "string" && typeof o.cc_generic_services === "boolean" && typeof o.java_generic_services === "boolean" && typeof o.py_generic_services === "boolean" && typeof o.php_generic_services === "boolean" && typeof o.deprecated === "boolean" && typeof o.cc_enable_arenas === "boolean" && typeof o.objc_class_prefix === "string" && typeof o.csharp_namespace === "string" && typeof o.swift_prefix === "string" && typeof o.php_class_prefix === "string" && typeof o.php_namespace === "string" && typeof o.php_metadata_namespace === "string" && typeof o.ruby_package === "string" && Array.isArray(o.uninterpreted_option) && (!o.uninterpreted_option.length || UninterpretedOption.isSDK(o.uninterpreted_option[0]))); + }, + isAmino(o: any): o is FileOptionsAmino { + return o && (o.$typeUrl === FileOptions.typeUrl || typeof o.java_package === "string" && typeof o.java_outer_classname === "string" && typeof o.java_multiple_files === "boolean" && typeof o.java_generate_equals_and_hash === "boolean" && typeof o.java_string_check_utf8 === "boolean" && isSet(o.optimize_for) && typeof o.go_package === "string" && typeof o.cc_generic_services === "boolean" && typeof o.java_generic_services === "boolean" && typeof o.py_generic_services === "boolean" && typeof o.php_generic_services === "boolean" && typeof o.deprecated === "boolean" && typeof o.cc_enable_arenas === "boolean" && typeof o.objc_class_prefix === "string" && typeof o.csharp_namespace === "string" && typeof o.swift_prefix === "string" && typeof o.php_class_prefix === "string" && typeof o.php_namespace === "string" && typeof o.php_metadata_namespace === "string" && typeof o.ruby_package === "string" && Array.isArray(o.uninterpreted_option) && (!o.uninterpreted_option.length || UninterpretedOption.isAmino(o.uninterpreted_option[0]))); + }, encode(message: FileOptions, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.javaPackage !== "") { writer.uint32(10).string(message.javaPackage); @@ -3731,6 +4257,60 @@ export const FileOptions = { } 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, + 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, + 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, + 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) : "", + 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) : "", + 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); + message.javaGenerateEqualsAndHash !== undefined && (obj.javaGenerateEqualsAndHash = message.javaGenerateEqualsAndHash); + message.javaStringCheckUtf8 !== undefined && (obj.javaStringCheckUtf8 = message.javaStringCheckUtf8); + message.optimizeFor !== undefined && (obj.optimizeFor = fileOptions_OptimizeModeToJSON(message.optimizeFor)); + message.goPackage !== undefined && (obj.goPackage = message.goPackage); + message.ccGenericServices !== undefined && (obj.ccGenericServices = message.ccGenericServices); + message.javaGenericServices !== undefined && (obj.javaGenericServices = message.javaGenericServices); + message.pyGenericServices !== undefined && (obj.pyGenericServices = message.pyGenericServices); + message.phpGenericServices !== undefined && (obj.phpGenericServices = message.phpGenericServices); + message.deprecated !== undefined && (obj.deprecated = message.deprecated); + message.ccEnableArenas !== undefined && (obj.ccEnableArenas = message.ccEnableArenas); + message.objcClassPrefix !== undefined && (obj.objcClassPrefix = message.objcClassPrefix); + message.csharpNamespace !== undefined && (obj.csharpNamespace = message.csharpNamespace); + message.swiftPrefix !== undefined && (obj.swiftPrefix = message.swiftPrefix); + message.phpClassPrefix !== undefined && (obj.phpClassPrefix = message.phpClassPrefix); + message.phpNamespace !== undefined && (obj.phpNamespace = message.phpNamespace); + message.phpMetadataNamespace !== undefined && (obj.phpMetadataNamespace = message.phpMetadataNamespace); + message.rubyPackage !== undefined && (obj.rubyPackage = message.rubyPackage); + if (message.uninterpretedOption) { + obj.uninterpretedOption = message.uninterpretedOption.map(e => e ? UninterpretedOption.toJSON(e) : undefined); + } else { + obj.uninterpretedOption = []; + } + return obj; + }, fromPartial(object: Partial): FileOptions { const message = createBaseFileOptions(); message.javaPackage = object.javaPackage ?? ""; @@ -3757,29 +4337,69 @@ export const FileOptions = { return message; }, fromAmino(object: FileOptionsAmino): FileOptions { - return { - javaPackage: object.java_package, - javaOuterClassname: object.java_outer_classname, - javaMultipleFiles: object.java_multiple_files, - javaGenerateEqualsAndHash: object.java_generate_equals_and_hash, - javaStringCheckUtf8: object.java_string_check_utf8, - optimizeFor: isSet(object.optimize_for) ? fileOptions_OptimizeModeFromJSON(object.optimize_for) : -1, - goPackage: object.go_package, - ccGenericServices: object.cc_generic_services, - javaGenericServices: object.java_generic_services, - pyGenericServices: object.py_generic_services, - phpGenericServices: object.php_generic_services, - deprecated: object.deprecated, - ccEnableArenas: object.cc_enable_arenas, - objcClassPrefix: object.objc_class_prefix, - csharpNamespace: object.csharp_namespace, - swiftPrefix: object.swift_prefix, - phpClassPrefix: object.php_class_prefix, - phpNamespace: object.php_namespace, - phpMetadataNamespace: object.php_metadata_namespace, - rubyPackage: object.ruby_package, - uninterpretedOption: Array.isArray(object?.uninterpreted_option) ? object.uninterpreted_option.map((e: any) => UninterpretedOption.fromAmino(e)) : [] - }; + const message = createBaseFileOptions(); + if (object.java_package !== undefined && object.java_package !== null) { + message.javaPackage = object.java_package; + } + if (object.java_outer_classname !== undefined && object.java_outer_classname !== null) { + message.javaOuterClassname = object.java_outer_classname; + } + if (object.java_multiple_files !== undefined && object.java_multiple_files !== null) { + message.javaMultipleFiles = object.java_multiple_files; + } + if (object.java_generate_equals_and_hash !== undefined && object.java_generate_equals_and_hash !== null) { + message.javaGenerateEqualsAndHash = object.java_generate_equals_and_hash; + } + if (object.java_string_check_utf8 !== undefined && object.java_string_check_utf8 !== null) { + message.javaStringCheckUtf8 = object.java_string_check_utf8; + } + if (object.optimize_for !== undefined && object.optimize_for !== null) { + message.optimizeFor = fileOptions_OptimizeModeFromJSON(object.optimize_for); + } + if (object.go_package !== undefined && object.go_package !== null) { + message.goPackage = object.go_package; + } + if (object.cc_generic_services !== undefined && object.cc_generic_services !== null) { + message.ccGenericServices = object.cc_generic_services; + } + if (object.java_generic_services !== undefined && object.java_generic_services !== null) { + message.javaGenericServices = object.java_generic_services; + } + if (object.py_generic_services !== undefined && object.py_generic_services !== null) { + message.pyGenericServices = object.py_generic_services; + } + if (object.php_generic_services !== undefined && object.php_generic_services !== null) { + message.phpGenericServices = object.php_generic_services; + } + if (object.deprecated !== undefined && object.deprecated !== null) { + message.deprecated = object.deprecated; + } + if (object.cc_enable_arenas !== undefined && object.cc_enable_arenas !== null) { + message.ccEnableArenas = object.cc_enable_arenas; + } + if (object.objc_class_prefix !== undefined && object.objc_class_prefix !== null) { + message.objcClassPrefix = object.objc_class_prefix; + } + if (object.csharp_namespace !== undefined && object.csharp_namespace !== null) { + message.csharpNamespace = object.csharp_namespace; + } + if (object.swift_prefix !== undefined && object.swift_prefix !== null) { + message.swiftPrefix = object.swift_prefix; + } + if (object.php_class_prefix !== undefined && object.php_class_prefix !== null) { + message.phpClassPrefix = object.php_class_prefix; + } + if (object.php_namespace !== undefined && object.php_namespace !== null) { + message.phpNamespace = object.php_namespace; + } + if (object.php_metadata_namespace !== undefined && object.php_metadata_namespace !== null) { + message.phpMetadataNamespace = object.php_metadata_namespace; + } + if (object.ruby_package !== undefined && object.ruby_package !== null) { + message.rubyPackage = object.ruby_package; + } + message.uninterpretedOption = object.uninterpreted_option?.map(e => UninterpretedOption.fromAmino(e)) || []; + return message; }, toAmino(message: FileOptions): FileOptionsAmino { const obj: any = {}; @@ -3788,7 +4408,7 @@ export const FileOptions = { obj.java_multiple_files = message.javaMultipleFiles; obj.java_generate_equals_and_hash = message.javaGenerateEqualsAndHash; obj.java_string_check_utf8 = message.javaStringCheckUtf8; - obj.optimize_for = message.optimizeFor; + obj.optimize_for = fileOptions_OptimizeModeToJSON(message.optimizeFor); obj.go_package = message.goPackage; obj.cc_generic_services = message.ccGenericServices; obj.java_generic_services = message.javaGenericServices; @@ -3826,6 +4446,7 @@ export const FileOptions = { }; } }; +GlobalDecoderRegistry.register(FileOptions.typeUrl, FileOptions); function createBaseMessageOptions(): MessageOptions { return { messageSetWireFormat: false, @@ -3837,6 +4458,15 @@ function createBaseMessageOptions(): MessageOptions { } export const MessageOptions = { typeUrl: "/google.protobuf.MessageOptions", + is(o: any): o is MessageOptions { + return o && (o.$typeUrl === MessageOptions.typeUrl || typeof o.messageSetWireFormat === "boolean" && typeof o.noStandardDescriptorAccessor === "boolean" && typeof o.deprecated === "boolean" && typeof o.mapEntry === "boolean" && Array.isArray(o.uninterpretedOption) && (!o.uninterpretedOption.length || UninterpretedOption.is(o.uninterpretedOption[0]))); + }, + isSDK(o: any): o is MessageOptionsSDKType { + return o && (o.$typeUrl === MessageOptions.typeUrl || typeof o.message_set_wire_format === "boolean" && typeof o.no_standard_descriptor_accessor === "boolean" && typeof o.deprecated === "boolean" && typeof o.map_entry === "boolean" && Array.isArray(o.uninterpreted_option) && (!o.uninterpreted_option.length || UninterpretedOption.isSDK(o.uninterpreted_option[0]))); + }, + isAmino(o: any): o is MessageOptionsAmino { + return o && (o.$typeUrl === MessageOptions.typeUrl || typeof o.message_set_wire_format === "boolean" && typeof o.no_standard_descriptor_accessor === "boolean" && typeof o.deprecated === "boolean" && typeof o.map_entry === "boolean" && Array.isArray(o.uninterpreted_option) && (!o.uninterpreted_option.length || UninterpretedOption.isAmino(o.uninterpreted_option[0]))); + }, encode(message: MessageOptions, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.messageSetWireFormat === true) { writer.uint32(8).bool(message.messageSetWireFormat); @@ -3884,6 +4514,28 @@ export const MessageOptions = { } return message; }, + fromJSON(object: any): MessageOptions { + return { + messageSetWireFormat: isSet(object.messageSetWireFormat) ? Boolean(object.messageSetWireFormat) : false, + noStandardDescriptorAccessor: isSet(object.noStandardDescriptorAccessor) ? Boolean(object.noStandardDescriptorAccessor) : false, + deprecated: isSet(object.deprecated) ? Boolean(object.deprecated) : false, + mapEntry: isSet(object.mapEntry) ? Boolean(object.mapEntry) : false, + 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); + message.noStandardDescriptorAccessor !== undefined && (obj.noStandardDescriptorAccessor = message.noStandardDescriptorAccessor); + message.deprecated !== undefined && (obj.deprecated = message.deprecated); + message.mapEntry !== undefined && (obj.mapEntry = message.mapEntry); + if (message.uninterpretedOption) { + obj.uninterpretedOption = message.uninterpretedOption.map(e => e ? UninterpretedOption.toJSON(e) : undefined); + } else { + obj.uninterpretedOption = []; + } + return obj; + }, fromPartial(object: Partial): MessageOptions { const message = createBaseMessageOptions(); message.messageSetWireFormat = object.messageSetWireFormat ?? false; @@ -3894,13 +4546,21 @@ export const MessageOptions = { return message; }, fromAmino(object: MessageOptionsAmino): MessageOptions { - return { - messageSetWireFormat: object.message_set_wire_format, - noStandardDescriptorAccessor: object.no_standard_descriptor_accessor, - deprecated: object.deprecated, - mapEntry: object.map_entry, - uninterpretedOption: Array.isArray(object?.uninterpreted_option) ? object.uninterpreted_option.map((e: any) => UninterpretedOption.fromAmino(e)) : [] - }; + const message = createBaseMessageOptions(); + if (object.message_set_wire_format !== undefined && object.message_set_wire_format !== null) { + message.messageSetWireFormat = object.message_set_wire_format; + } + if (object.no_standard_descriptor_accessor !== undefined && object.no_standard_descriptor_accessor !== null) { + message.noStandardDescriptorAccessor = object.no_standard_descriptor_accessor; + } + if (object.deprecated !== undefined && object.deprecated !== null) { + message.deprecated = object.deprecated; + } + if (object.map_entry !== undefined && object.map_entry !== null) { + message.mapEntry = object.map_entry; + } + message.uninterpretedOption = object.uninterpreted_option?.map(e => UninterpretedOption.fromAmino(e)) || []; + return message; }, toAmino(message: MessageOptions): MessageOptionsAmino { const obj: any = {}; @@ -3931,6 +4591,7 @@ export const MessageOptions = { }; } }; +GlobalDecoderRegistry.register(MessageOptions.typeUrl, MessageOptions); function createBaseFieldOptions(): FieldOptions { return { ctype: 1, @@ -3944,6 +4605,15 @@ function createBaseFieldOptions(): FieldOptions { } export const FieldOptions = { typeUrl: "/google.protobuf.FieldOptions", + is(o: any): o is FieldOptions { + return o && (o.$typeUrl === FieldOptions.typeUrl || isSet(o.ctype) && typeof o.packed === "boolean" && isSet(o.jstype) && typeof o.lazy === "boolean" && typeof o.deprecated === "boolean" && typeof o.weak === "boolean" && Array.isArray(o.uninterpretedOption) && (!o.uninterpretedOption.length || UninterpretedOption.is(o.uninterpretedOption[0]))); + }, + isSDK(o: any): o is FieldOptionsSDKType { + return o && (o.$typeUrl === FieldOptions.typeUrl || isSet(o.ctype) && typeof o.packed === "boolean" && isSet(o.jstype) && typeof o.lazy === "boolean" && typeof o.deprecated === "boolean" && typeof o.weak === "boolean" && Array.isArray(o.uninterpreted_option) && (!o.uninterpreted_option.length || UninterpretedOption.isSDK(o.uninterpreted_option[0]))); + }, + isAmino(o: any): o is FieldOptionsAmino { + return o && (o.$typeUrl === FieldOptions.typeUrl || isSet(o.ctype) && typeof o.packed === "boolean" && isSet(o.jstype) && typeof o.lazy === "boolean" && typeof o.deprecated === "boolean" && typeof o.weak === "boolean" && Array.isArray(o.uninterpreted_option) && (!o.uninterpreted_option.length || UninterpretedOption.isAmino(o.uninterpreted_option[0]))); + }, encode(message: FieldOptions, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.ctype !== 1) { writer.uint32(8).int32(message.ctype); @@ -4003,6 +4673,32 @@ export const FieldOptions = { } return message; }, + fromJSON(object: any): FieldOptions { + return { + ctype: isSet(object.ctype) ? fieldOptions_CTypeFromJSON(object.ctype) : -1, + packed: isSet(object.packed) ? Boolean(object.packed) : false, + jstype: isSet(object.jstype) ? fieldOptions_JSTypeFromJSON(object.jstype) : -1, + lazy: isSet(object.lazy) ? Boolean(object.lazy) : 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); + if (message.uninterpretedOption) { + obj.uninterpretedOption = message.uninterpretedOption.map(e => e ? UninterpretedOption.toJSON(e) : undefined); + } else { + obj.uninterpretedOption = []; + } + return obj; + }, fromPartial(object: Partial): FieldOptions { const message = createBaseFieldOptions(); message.ctype = object.ctype ?? 1; @@ -4015,21 +4711,33 @@ export const FieldOptions = { return message; }, fromAmino(object: FieldOptionsAmino): FieldOptions { - return { - ctype: isSet(object.ctype) ? fieldOptions_CTypeFromJSON(object.ctype) : -1, - packed: object.packed, - jstype: isSet(object.jstype) ? fieldOptions_JSTypeFromJSON(object.jstype) : -1, - lazy: object.lazy, - deprecated: object.deprecated, - weak: object.weak, - uninterpretedOption: Array.isArray(object?.uninterpreted_option) ? object.uninterpreted_option.map((e: any) => UninterpretedOption.fromAmino(e)) : [] - }; + const message = createBaseFieldOptions(); + if (object.ctype !== undefined && object.ctype !== null) { + message.ctype = fieldOptions_CTypeFromJSON(object.ctype); + } + if (object.packed !== undefined && object.packed !== null) { + message.packed = object.packed; + } + if (object.jstype !== undefined && object.jstype !== null) { + message.jstype = fieldOptions_JSTypeFromJSON(object.jstype); + } + if (object.lazy !== undefined && object.lazy !== null) { + message.lazy = object.lazy; + } + if (object.deprecated !== undefined && object.deprecated !== null) { + message.deprecated = object.deprecated; + } + if (object.weak !== undefined && object.weak !== null) { + message.weak = object.weak; + } + message.uninterpretedOption = object.uninterpreted_option?.map(e => UninterpretedOption.fromAmino(e)) || []; + return message; }, toAmino(message: FieldOptions): FieldOptionsAmino { const obj: any = {}; - obj.ctype = message.ctype; + obj.ctype = fieldOptions_CTypeToJSON(message.ctype); obj.packed = message.packed; - obj.jstype = message.jstype; + obj.jstype = fieldOptions_JSTypeToJSON(message.jstype); obj.lazy = message.lazy; obj.deprecated = message.deprecated; obj.weak = message.weak; @@ -4056,6 +4764,7 @@ export const FieldOptions = { }; } }; +GlobalDecoderRegistry.register(FieldOptions.typeUrl, FieldOptions); function createBaseOneofOptions(): OneofOptions { return { uninterpretedOption: [] @@ -4063,6 +4772,15 @@ function createBaseOneofOptions(): OneofOptions { } export const OneofOptions = { typeUrl: "/google.protobuf.OneofOptions", + is(o: any): o is OneofOptions { + return o && (o.$typeUrl === OneofOptions.typeUrl || Array.isArray(o.uninterpretedOption) && (!o.uninterpretedOption.length || UninterpretedOption.is(o.uninterpretedOption[0]))); + }, + isSDK(o: any): o is OneofOptionsSDKType { + return o && (o.$typeUrl === OneofOptions.typeUrl || Array.isArray(o.uninterpreted_option) && (!o.uninterpreted_option.length || UninterpretedOption.isSDK(o.uninterpreted_option[0]))); + }, + isAmino(o: any): o is OneofOptionsAmino { + return o && (o.$typeUrl === OneofOptions.typeUrl || Array.isArray(o.uninterpreted_option) && (!o.uninterpreted_option.length || UninterpretedOption.isAmino(o.uninterpreted_option[0]))); + }, encode(message: OneofOptions, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.uninterpretedOption) { UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); @@ -4086,15 +4804,29 @@ export const OneofOptions = { } return message; }, + fromJSON(object: any): OneofOptions { + return { + uninterpretedOption: Array.isArray(object?.uninterpretedOption) ? object.uninterpretedOption.map((e: any) => UninterpretedOption.fromJSON(e)) : [] + }; + }, + toJSON(message: OneofOptions): unknown { + const obj: any = {}; + if (message.uninterpretedOption) { + obj.uninterpretedOption = message.uninterpretedOption.map(e => e ? UninterpretedOption.toJSON(e) : undefined); + } else { + obj.uninterpretedOption = []; + } + return obj; + }, fromPartial(object: Partial): OneofOptions { const message = createBaseOneofOptions(); message.uninterpretedOption = object.uninterpretedOption?.map(e => UninterpretedOption.fromPartial(e)) || []; return message; }, fromAmino(object: OneofOptionsAmino): OneofOptions { - return { - uninterpretedOption: Array.isArray(object?.uninterpreted_option) ? object.uninterpreted_option.map((e: any) => UninterpretedOption.fromAmino(e)) : [] - }; + const message = createBaseOneofOptions(); + message.uninterpretedOption = object.uninterpreted_option?.map(e => UninterpretedOption.fromAmino(e)) || []; + return message; }, toAmino(message: OneofOptions): OneofOptionsAmino { const obj: any = {}; @@ -4121,6 +4853,7 @@ export const OneofOptions = { }; } }; +GlobalDecoderRegistry.register(OneofOptions.typeUrl, OneofOptions); function createBaseEnumOptions(): EnumOptions { return { allowAlias: false, @@ -4130,6 +4863,15 @@ function createBaseEnumOptions(): EnumOptions { } export const EnumOptions = { typeUrl: "/google.protobuf.EnumOptions", + is(o: any): o is EnumOptions { + return o && (o.$typeUrl === EnumOptions.typeUrl || typeof o.allowAlias === "boolean" && typeof o.deprecated === "boolean" && Array.isArray(o.uninterpretedOption) && (!o.uninterpretedOption.length || UninterpretedOption.is(o.uninterpretedOption[0]))); + }, + isSDK(o: any): o is EnumOptionsSDKType { + return o && (o.$typeUrl === EnumOptions.typeUrl || typeof o.allow_alias === "boolean" && typeof o.deprecated === "boolean" && Array.isArray(o.uninterpreted_option) && (!o.uninterpreted_option.length || UninterpretedOption.isSDK(o.uninterpreted_option[0]))); + }, + isAmino(o: any): o is EnumOptionsAmino { + return o && (o.$typeUrl === EnumOptions.typeUrl || typeof o.allow_alias === "boolean" && typeof o.deprecated === "boolean" && Array.isArray(o.uninterpreted_option) && (!o.uninterpreted_option.length || UninterpretedOption.isAmino(o.uninterpreted_option[0]))); + }, encode(message: EnumOptions, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.allowAlias === true) { writer.uint32(16).bool(message.allowAlias); @@ -4165,6 +4907,24 @@ export const EnumOptions = { } return message; }, + fromJSON(object: any): EnumOptions { + return { + allowAlias: isSet(object.allowAlias) ? Boolean(object.allowAlias) : false, + deprecated: isSet(object.deprecated) ? Boolean(object.deprecated) : false, + 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); + if (message.uninterpretedOption) { + obj.uninterpretedOption = message.uninterpretedOption.map(e => e ? UninterpretedOption.toJSON(e) : undefined); + } else { + obj.uninterpretedOption = []; + } + return obj; + }, fromPartial(object: Partial): EnumOptions { const message = createBaseEnumOptions(); message.allowAlias = object.allowAlias ?? false; @@ -4173,11 +4933,15 @@ export const EnumOptions = { return message; }, fromAmino(object: EnumOptionsAmino): EnumOptions { - return { - allowAlias: object.allow_alias, - deprecated: object.deprecated, - uninterpretedOption: Array.isArray(object?.uninterpreted_option) ? object.uninterpreted_option.map((e: any) => UninterpretedOption.fromAmino(e)) : [] - }; + const message = createBaseEnumOptions(); + if (object.allow_alias !== undefined && object.allow_alias !== null) { + message.allowAlias = object.allow_alias; + } + if (object.deprecated !== undefined && object.deprecated !== null) { + message.deprecated = object.deprecated; + } + message.uninterpretedOption = object.uninterpreted_option?.map(e => UninterpretedOption.fromAmino(e)) || []; + return message; }, toAmino(message: EnumOptions): EnumOptionsAmino { const obj: any = {}; @@ -4206,6 +4970,7 @@ export const EnumOptions = { }; } }; +GlobalDecoderRegistry.register(EnumOptions.typeUrl, EnumOptions); function createBaseEnumValueOptions(): EnumValueOptions { return { deprecated: false, @@ -4214,6 +4979,15 @@ function createBaseEnumValueOptions(): EnumValueOptions { } export const EnumValueOptions = { typeUrl: "/google.protobuf.EnumValueOptions", + is(o: any): o is EnumValueOptions { + return o && (o.$typeUrl === EnumValueOptions.typeUrl || typeof o.deprecated === "boolean" && Array.isArray(o.uninterpretedOption) && (!o.uninterpretedOption.length || UninterpretedOption.is(o.uninterpretedOption[0]))); + }, + isSDK(o: any): o is EnumValueOptionsSDKType { + return o && (o.$typeUrl === EnumValueOptions.typeUrl || typeof o.deprecated === "boolean" && Array.isArray(o.uninterpreted_option) && (!o.uninterpreted_option.length || UninterpretedOption.isSDK(o.uninterpreted_option[0]))); + }, + isAmino(o: any): o is EnumValueOptionsAmino { + return o && (o.$typeUrl === EnumValueOptions.typeUrl || typeof o.deprecated === "boolean" && Array.isArray(o.uninterpreted_option) && (!o.uninterpreted_option.length || UninterpretedOption.isAmino(o.uninterpreted_option[0]))); + }, encode(message: EnumValueOptions, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.deprecated === true) { writer.uint32(8).bool(message.deprecated); @@ -4243,6 +5017,22 @@ export const EnumValueOptions = { } return message; }, + fromJSON(object: any): EnumValueOptions { + return { + deprecated: isSet(object.deprecated) ? Boolean(object.deprecated) : false, + 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); + if (message.uninterpretedOption) { + obj.uninterpretedOption = message.uninterpretedOption.map(e => e ? UninterpretedOption.toJSON(e) : undefined); + } else { + obj.uninterpretedOption = []; + } + return obj; + }, fromPartial(object: Partial): EnumValueOptions { const message = createBaseEnumValueOptions(); message.deprecated = object.deprecated ?? false; @@ -4250,10 +5040,12 @@ export const EnumValueOptions = { return message; }, fromAmino(object: EnumValueOptionsAmino): EnumValueOptions { - return { - deprecated: object.deprecated, - uninterpretedOption: Array.isArray(object?.uninterpreted_option) ? object.uninterpreted_option.map((e: any) => UninterpretedOption.fromAmino(e)) : [] - }; + const message = createBaseEnumValueOptions(); + if (object.deprecated !== undefined && object.deprecated !== null) { + message.deprecated = object.deprecated; + } + message.uninterpretedOption = object.uninterpreted_option?.map(e => UninterpretedOption.fromAmino(e)) || []; + return message; }, toAmino(message: EnumValueOptions): EnumValueOptionsAmino { const obj: any = {}; @@ -4281,6 +5073,7 @@ export const EnumValueOptions = { }; } }; +GlobalDecoderRegistry.register(EnumValueOptions.typeUrl, EnumValueOptions); function createBaseServiceOptions(): ServiceOptions { return { deprecated: false, @@ -4289,6 +5082,15 @@ function createBaseServiceOptions(): ServiceOptions { } export const ServiceOptions = { typeUrl: "/google.protobuf.ServiceOptions", + is(o: any): o is ServiceOptions { + return o && (o.$typeUrl === ServiceOptions.typeUrl || typeof o.deprecated === "boolean" && Array.isArray(o.uninterpretedOption) && (!o.uninterpretedOption.length || UninterpretedOption.is(o.uninterpretedOption[0]))); + }, + isSDK(o: any): o is ServiceOptionsSDKType { + return o && (o.$typeUrl === ServiceOptions.typeUrl || typeof o.deprecated === "boolean" && Array.isArray(o.uninterpreted_option) && (!o.uninterpreted_option.length || UninterpretedOption.isSDK(o.uninterpreted_option[0]))); + }, + isAmino(o: any): o is ServiceOptionsAmino { + return o && (o.$typeUrl === ServiceOptions.typeUrl || typeof o.deprecated === "boolean" && Array.isArray(o.uninterpreted_option) && (!o.uninterpreted_option.length || UninterpretedOption.isAmino(o.uninterpreted_option[0]))); + }, encode(message: ServiceOptions, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.deprecated === true) { writer.uint32(264).bool(message.deprecated); @@ -4318,6 +5120,22 @@ export const ServiceOptions = { } return message; }, + fromJSON(object: any): ServiceOptions { + return { + deprecated: isSet(object.deprecated) ? Boolean(object.deprecated) : false, + 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); + if (message.uninterpretedOption) { + obj.uninterpretedOption = message.uninterpretedOption.map(e => e ? UninterpretedOption.toJSON(e) : undefined); + } else { + obj.uninterpretedOption = []; + } + return obj; + }, fromPartial(object: Partial): ServiceOptions { const message = createBaseServiceOptions(); message.deprecated = object.deprecated ?? false; @@ -4325,10 +5143,12 @@ export const ServiceOptions = { return message; }, fromAmino(object: ServiceOptionsAmino): ServiceOptions { - return { - deprecated: object.deprecated, - uninterpretedOption: Array.isArray(object?.uninterpreted_option) ? object.uninterpreted_option.map((e: any) => UninterpretedOption.fromAmino(e)) : [] - }; + const message = createBaseServiceOptions(); + if (object.deprecated !== undefined && object.deprecated !== null) { + message.deprecated = object.deprecated; + } + message.uninterpretedOption = object.uninterpreted_option?.map(e => UninterpretedOption.fromAmino(e)) || []; + return message; }, toAmino(message: ServiceOptions): ServiceOptionsAmino { const obj: any = {}; @@ -4356,6 +5176,7 @@ export const ServiceOptions = { }; } }; +GlobalDecoderRegistry.register(ServiceOptions.typeUrl, ServiceOptions); function createBaseMethodOptions(): MethodOptions { return { deprecated: false, @@ -4365,6 +5186,15 @@ function createBaseMethodOptions(): MethodOptions { } export const MethodOptions = { typeUrl: "/google.protobuf.MethodOptions", + is(o: any): o is MethodOptions { + return o && (o.$typeUrl === MethodOptions.typeUrl || typeof o.deprecated === "boolean" && isSet(o.idempotencyLevel) && Array.isArray(o.uninterpretedOption) && (!o.uninterpretedOption.length || UninterpretedOption.is(o.uninterpretedOption[0]))); + }, + isSDK(o: any): o is MethodOptionsSDKType { + return o && (o.$typeUrl === MethodOptions.typeUrl || typeof o.deprecated === "boolean" && isSet(o.idempotency_level) && Array.isArray(o.uninterpreted_option) && (!o.uninterpreted_option.length || UninterpretedOption.isSDK(o.uninterpreted_option[0]))); + }, + isAmino(o: any): o is MethodOptionsAmino { + return o && (o.$typeUrl === MethodOptions.typeUrl || typeof o.deprecated === "boolean" && isSet(o.idempotency_level) && Array.isArray(o.uninterpreted_option) && (!o.uninterpreted_option.length || UninterpretedOption.isAmino(o.uninterpreted_option[0]))); + }, encode(message: MethodOptions, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.deprecated === true) { writer.uint32(264).bool(message.deprecated); @@ -4400,6 +5230,24 @@ export const MethodOptions = { } return message; }, + fromJSON(object: any): MethodOptions { + return { + deprecated: isSet(object.deprecated) ? Boolean(object.deprecated) : false, + idempotencyLevel: isSet(object.idempotencyLevel) ? methodOptions_IdempotencyLevelFromJSON(object.idempotencyLevel) : -1, + 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); + message.idempotencyLevel !== undefined && (obj.idempotencyLevel = methodOptions_IdempotencyLevelToJSON(message.idempotencyLevel)); + if (message.uninterpretedOption) { + obj.uninterpretedOption = message.uninterpretedOption.map(e => e ? UninterpretedOption.toJSON(e) : undefined); + } else { + obj.uninterpretedOption = []; + } + return obj; + }, fromPartial(object: Partial): MethodOptions { const message = createBaseMethodOptions(); message.deprecated = object.deprecated ?? false; @@ -4408,16 +5256,20 @@ export const MethodOptions = { return message; }, fromAmino(object: MethodOptionsAmino): MethodOptions { - return { - deprecated: object.deprecated, - idempotencyLevel: isSet(object.idempotency_level) ? methodOptions_IdempotencyLevelFromJSON(object.idempotency_level) : -1, - uninterpretedOption: Array.isArray(object?.uninterpreted_option) ? object.uninterpreted_option.map((e: any) => UninterpretedOption.fromAmino(e)) : [] - }; + const message = createBaseMethodOptions(); + if (object.deprecated !== undefined && object.deprecated !== null) { + message.deprecated = object.deprecated; + } + if (object.idempotency_level !== undefined && object.idempotency_level !== null) { + message.idempotencyLevel = methodOptions_IdempotencyLevelFromJSON(object.idempotency_level); + } + message.uninterpretedOption = object.uninterpreted_option?.map(e => UninterpretedOption.fromAmino(e)) || []; + return message; }, toAmino(message: MethodOptions): MethodOptionsAmino { const obj: any = {}; obj.deprecated = message.deprecated; - obj.idempotency_level = message.idempotencyLevel; + obj.idempotency_level = methodOptions_IdempotencyLevelToJSON(message.idempotencyLevel); if (message.uninterpretedOption) { obj.uninterpreted_option = message.uninterpretedOption.map(e => e ? UninterpretedOption.toAmino(e) : undefined); } else { @@ -4441,6 +5293,7 @@ export const MethodOptions = { }; } }; +GlobalDecoderRegistry.register(MethodOptions.typeUrl, MethodOptions); function createBaseUninterpretedOption(): UninterpretedOption { return { name: [], @@ -4454,6 +5307,15 @@ function createBaseUninterpretedOption(): UninterpretedOption { } export const UninterpretedOption = { typeUrl: "/google.protobuf.UninterpretedOption", + is(o: any): o is UninterpretedOption { + return o && (o.$typeUrl === UninterpretedOption.typeUrl || Array.isArray(o.name) && (!o.name.length || UninterpretedOption_NamePart.is(o.name[0])) && typeof o.identifierValue === "string" && typeof o.positiveIntValue === "bigint" && typeof o.negativeIntValue === "bigint" && typeof o.doubleValue === "number" && (o.stringValue instanceof Uint8Array || typeof o.stringValue === "string") && typeof o.aggregateValue === "string"); + }, + isSDK(o: any): o is UninterpretedOptionSDKType { + return o && (o.$typeUrl === UninterpretedOption.typeUrl || Array.isArray(o.name) && (!o.name.length || UninterpretedOption_NamePart.isSDK(o.name[0])) && typeof o.identifier_value === "string" && typeof o.positive_int_value === "bigint" && typeof o.negative_int_value === "bigint" && typeof o.double_value === "number" && (o.string_value instanceof Uint8Array || typeof o.string_value === "string") && typeof o.aggregate_value === "string"); + }, + isAmino(o: any): o is UninterpretedOptionAmino { + return o && (o.$typeUrl === UninterpretedOption.typeUrl || Array.isArray(o.name) && (!o.name.length || UninterpretedOption_NamePart.isAmino(o.name[0])) && typeof o.identifier_value === "string" && typeof o.positive_int_value === "bigint" && typeof o.negative_int_value === "bigint" && typeof o.double_value === "number" && (o.string_value instanceof Uint8Array || typeof o.string_value === "string") && typeof o.aggregate_value === "string"); + }, encode(message: UninterpretedOption, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.name) { UninterpretedOption_NamePart.encode(v!, writer.uint32(18).fork()).ldelim(); @@ -4513,6 +5375,32 @@ export const UninterpretedOption = { } 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) ? BigInt(object.positiveIntValue.toString()) : BigInt(0), + negativeIntValue: isSet(object.negativeIntValue) ? BigInt(object.negativeIntValue.toString()) : BigInt(0), + doubleValue: isSet(object.doubleValue) ? Number(object.doubleValue) : 0, + stringValue: isSet(object.stringValue) ? bytesFromBase64(object.stringValue) : new Uint8Array(), + aggregateValue: isSet(object.aggregateValue) ? String(object.aggregateValue) : "" + }; + }, + toJSON(message: UninterpretedOption): unknown { + const obj: any = {}; + if (message.name) { + obj.name = message.name.map(e => e ? UninterpretedOption_NamePart.toJSON(e) : undefined); + } else { + obj.name = []; + } + message.identifierValue !== undefined && (obj.identifierValue = message.identifierValue); + message.positiveIntValue !== undefined && (obj.positiveIntValue = (message.positiveIntValue || BigInt(0)).toString()); + message.negativeIntValue !== undefined && (obj.negativeIntValue = (message.negativeIntValue || BigInt(0)).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(object: Partial): UninterpretedOption { const message = createBaseUninterpretedOption(); message.name = object.name?.map(e => UninterpretedOption_NamePart.fromPartial(e)) || []; @@ -4525,15 +5413,27 @@ export const UninterpretedOption = { return message; }, fromAmino(object: UninterpretedOptionAmino): UninterpretedOption { - return { - name: Array.isArray(object?.name) ? object.name.map((e: any) => UninterpretedOption_NamePart.fromAmino(e)) : [], - identifierValue: object.identifier_value, - positiveIntValue: BigInt(object.positive_int_value), - negativeIntValue: BigInt(object.negative_int_value), - doubleValue: object.double_value, - stringValue: object.string_value, - aggregateValue: object.aggregate_value - }; + const message = createBaseUninterpretedOption(); + message.name = object.name?.map(e => UninterpretedOption_NamePart.fromAmino(e)) || []; + if (object.identifier_value !== undefined && object.identifier_value !== null) { + message.identifierValue = object.identifier_value; + } + if (object.positive_int_value !== undefined && object.positive_int_value !== null) { + message.positiveIntValue = BigInt(object.positive_int_value); + } + if (object.negative_int_value !== undefined && object.negative_int_value !== null) { + message.negativeIntValue = BigInt(object.negative_int_value); + } + if (object.double_value !== undefined && object.double_value !== null) { + message.doubleValue = object.double_value; + } + if (object.string_value !== undefined && object.string_value !== null) { + message.stringValue = bytesFromBase64(object.string_value); + } + if (object.aggregate_value !== undefined && object.aggregate_value !== null) { + message.aggregateValue = object.aggregate_value; + } + return message; }, toAmino(message: UninterpretedOption): UninterpretedOptionAmino { const obj: any = {}; @@ -4546,7 +5446,7 @@ export const UninterpretedOption = { obj.positive_int_value = message.positiveIntValue ? message.positiveIntValue.toString() : undefined; obj.negative_int_value = message.negativeIntValue ? message.negativeIntValue.toString() : undefined; obj.double_value = message.doubleValue; - obj.string_value = message.stringValue; + obj.string_value = message.stringValue ? base64FromBytes(message.stringValue) : undefined; obj.aggregate_value = message.aggregateValue; return obj; }, @@ -4566,6 +5466,7 @@ export const UninterpretedOption = { }; } }; +GlobalDecoderRegistry.register(UninterpretedOption.typeUrl, UninterpretedOption); function createBaseUninterpretedOption_NamePart(): UninterpretedOption_NamePart { return { namePart: "", @@ -4574,6 +5475,15 @@ function createBaseUninterpretedOption_NamePart(): UninterpretedOption_NamePart } export const UninterpretedOption_NamePart = { typeUrl: "/google.protobuf.NamePart", + is(o: any): o is UninterpretedOption_NamePart { + return o && (o.$typeUrl === UninterpretedOption_NamePart.typeUrl || typeof o.namePart === "string" && typeof o.isExtension === "boolean"); + }, + isSDK(o: any): o is UninterpretedOption_NamePartSDKType { + return o && (o.$typeUrl === UninterpretedOption_NamePart.typeUrl || typeof o.name_part === "string" && typeof o.is_extension === "boolean"); + }, + isAmino(o: any): o is UninterpretedOption_NamePartAmino { + return o && (o.$typeUrl === UninterpretedOption_NamePart.typeUrl || typeof o.name_part === "string" && typeof o.is_extension === "boolean"); + }, encode(message: UninterpretedOption_NamePart, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.namePart !== "") { writer.uint32(10).string(message.namePart); @@ -4603,6 +5513,18 @@ export const UninterpretedOption_NamePart = { } 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; + }, fromPartial(object: Partial): UninterpretedOption_NamePart { const message = createBaseUninterpretedOption_NamePart(); message.namePart = object.namePart ?? ""; @@ -4610,10 +5532,14 @@ export const UninterpretedOption_NamePart = { return message; }, fromAmino(object: UninterpretedOption_NamePartAmino): UninterpretedOption_NamePart { - return { - namePart: object.name_part, - isExtension: object.is_extension - }; + const message = createBaseUninterpretedOption_NamePart(); + if (object.name_part !== undefined && object.name_part !== null) { + message.namePart = object.name_part; + } + if (object.is_extension !== undefined && object.is_extension !== null) { + message.isExtension = object.is_extension; + } + return message; }, toAmino(message: UninterpretedOption_NamePart): UninterpretedOption_NamePartAmino { const obj: any = {}; @@ -4637,6 +5563,7 @@ export const UninterpretedOption_NamePart = { }; } }; +GlobalDecoderRegistry.register(UninterpretedOption_NamePart.typeUrl, UninterpretedOption_NamePart); function createBaseSourceCodeInfo(): SourceCodeInfo { return { location: [] @@ -4644,6 +5571,15 @@ function createBaseSourceCodeInfo(): SourceCodeInfo { } export const SourceCodeInfo = { typeUrl: "/google.protobuf.SourceCodeInfo", + is(o: any): o is SourceCodeInfo { + return o && (o.$typeUrl === SourceCodeInfo.typeUrl || Array.isArray(o.location) && (!o.location.length || SourceCodeInfo_Location.is(o.location[0]))); + }, + isSDK(o: any): o is SourceCodeInfoSDKType { + return o && (o.$typeUrl === SourceCodeInfo.typeUrl || Array.isArray(o.location) && (!o.location.length || SourceCodeInfo_Location.isSDK(o.location[0]))); + }, + isAmino(o: any): o is SourceCodeInfoAmino { + return o && (o.$typeUrl === SourceCodeInfo.typeUrl || Array.isArray(o.location) && (!o.location.length || SourceCodeInfo_Location.isAmino(o.location[0]))); + }, encode(message: SourceCodeInfo, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.location) { SourceCodeInfo_Location.encode(v!, writer.uint32(10).fork()).ldelim(); @@ -4667,15 +5603,29 @@ export const SourceCodeInfo = { } return message; }, + fromJSON(object: any): SourceCodeInfo { + return { + location: Array.isArray(object?.location) ? object.location.map((e: any) => SourceCodeInfo_Location.fromJSON(e)) : [] + }; + }, + toJSON(message: SourceCodeInfo): unknown { + const obj: any = {}; + if (message.location) { + obj.location = message.location.map(e => e ? SourceCodeInfo_Location.toJSON(e) : undefined); + } else { + obj.location = []; + } + return obj; + }, fromPartial(object: Partial): SourceCodeInfo { const message = createBaseSourceCodeInfo(); message.location = object.location?.map(e => SourceCodeInfo_Location.fromPartial(e)) || []; return message; }, fromAmino(object: SourceCodeInfoAmino): SourceCodeInfo { - return { - location: Array.isArray(object?.location) ? object.location.map((e: any) => SourceCodeInfo_Location.fromAmino(e)) : [] - }; + const message = createBaseSourceCodeInfo(); + message.location = object.location?.map(e => SourceCodeInfo_Location.fromAmino(e)) || []; + return message; }, toAmino(message: SourceCodeInfo): SourceCodeInfoAmino { const obj: any = {}; @@ -4702,6 +5652,7 @@ export const SourceCodeInfo = { }; } }; +GlobalDecoderRegistry.register(SourceCodeInfo.typeUrl, SourceCodeInfo); function createBaseSourceCodeInfo_Location(): SourceCodeInfo_Location { return { path: [], @@ -4713,6 +5664,15 @@ function createBaseSourceCodeInfo_Location(): SourceCodeInfo_Location { } export const SourceCodeInfo_Location = { typeUrl: "/google.protobuf.Location", + is(o: any): o is SourceCodeInfo_Location { + return o && (o.$typeUrl === SourceCodeInfo_Location.typeUrl || Array.isArray(o.path) && (!o.path.length || typeof o.path[0] === "number") && Array.isArray(o.span) && (!o.span.length || typeof o.span[0] === "number") && typeof o.leadingComments === "string" && typeof o.trailingComments === "string" && Array.isArray(o.leadingDetachedComments) && (!o.leadingDetachedComments.length || typeof o.leadingDetachedComments[0] === "string")); + }, + isSDK(o: any): o is SourceCodeInfo_LocationSDKType { + return o && (o.$typeUrl === SourceCodeInfo_Location.typeUrl || Array.isArray(o.path) && (!o.path.length || typeof o.path[0] === "number") && Array.isArray(o.span) && (!o.span.length || typeof o.span[0] === "number") && typeof o.leading_comments === "string" && typeof o.trailing_comments === "string" && Array.isArray(o.leading_detached_comments) && (!o.leading_detached_comments.length || typeof o.leading_detached_comments[0] === "string")); + }, + isAmino(o: any): o is SourceCodeInfo_LocationAmino { + return o && (o.$typeUrl === SourceCodeInfo_Location.typeUrl || Array.isArray(o.path) && (!o.path.length || typeof o.path[0] === "number") && Array.isArray(o.span) && (!o.span.length || typeof o.span[0] === "number") && typeof o.leading_comments === "string" && typeof o.trailing_comments === "string" && Array.isArray(o.leading_detached_comments) && (!o.leading_detached_comments.length || typeof o.leading_detached_comments[0] === "string")); + }, encode(message: SourceCodeInfo_Location, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { writer.uint32(10).fork(); for (const v of message.path) { @@ -4778,6 +5738,36 @@ export const SourceCodeInfo_Location = { } 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) : "", + leadingDetachedComments: Array.isArray(object?.leadingDetachedComments) ? object.leadingDetachedComments.map((e: any) => String(e)) : [] + }; + }, + toJSON(message: SourceCodeInfo_Location): unknown { + const obj: any = {}; + if (message.path) { + obj.path = message.path.map(e => Math.round(e)); + } else { + obj.path = []; + } + if (message.span) { + obj.span = message.span.map(e => Math.round(e)); + } else { + obj.span = []; + } + message.leadingComments !== undefined && (obj.leadingComments = message.leadingComments); + message.trailingComments !== undefined && (obj.trailingComments = message.trailingComments); + if (message.leadingDetachedComments) { + obj.leadingDetachedComments = message.leadingDetachedComments.map(e => e); + } else { + obj.leadingDetachedComments = []; + } + return obj; + }, fromPartial(object: Partial): SourceCodeInfo_Location { const message = createBaseSourceCodeInfo_Location(); message.path = object.path?.map(e => e) || []; @@ -4788,13 +5778,17 @@ export const SourceCodeInfo_Location = { return message; }, fromAmino(object: SourceCodeInfo_LocationAmino): SourceCodeInfo_Location { - return { - path: Array.isArray(object?.path) ? object.path.map((e: any) => e) : [], - span: Array.isArray(object?.span) ? object.span.map((e: any) => e) : [], - leadingComments: object.leading_comments, - trailingComments: object.trailing_comments, - leadingDetachedComments: Array.isArray(object?.leading_detached_comments) ? object.leading_detached_comments.map((e: any) => e) : [] - }; + const message = createBaseSourceCodeInfo_Location(); + message.path = object.path?.map(e => e) || []; + message.span = object.span?.map(e => e) || []; + if (object.leading_comments !== undefined && object.leading_comments !== null) { + message.leadingComments = object.leading_comments; + } + if (object.trailing_comments !== undefined && object.trailing_comments !== null) { + message.trailingComments = object.trailing_comments; + } + message.leadingDetachedComments = object.leading_detached_comments?.map(e => e) || []; + return message; }, toAmino(message: SourceCodeInfo_Location): SourceCodeInfo_LocationAmino { const obj: any = {}; @@ -4833,6 +5827,7 @@ export const SourceCodeInfo_Location = { }; } }; +GlobalDecoderRegistry.register(SourceCodeInfo_Location.typeUrl, SourceCodeInfo_Location); function createBaseGeneratedCodeInfo(): GeneratedCodeInfo { return { annotation: [] @@ -4840,6 +5835,15 @@ function createBaseGeneratedCodeInfo(): GeneratedCodeInfo { } export const GeneratedCodeInfo = { typeUrl: "/google.protobuf.GeneratedCodeInfo", + is(o: any): o is GeneratedCodeInfo { + return o && (o.$typeUrl === GeneratedCodeInfo.typeUrl || Array.isArray(o.annotation) && (!o.annotation.length || GeneratedCodeInfo_Annotation.is(o.annotation[0]))); + }, + isSDK(o: any): o is GeneratedCodeInfoSDKType { + return o && (o.$typeUrl === GeneratedCodeInfo.typeUrl || Array.isArray(o.annotation) && (!o.annotation.length || GeneratedCodeInfo_Annotation.isSDK(o.annotation[0]))); + }, + isAmino(o: any): o is GeneratedCodeInfoAmino { + return o && (o.$typeUrl === GeneratedCodeInfo.typeUrl || Array.isArray(o.annotation) && (!o.annotation.length || GeneratedCodeInfo_Annotation.isAmino(o.annotation[0]))); + }, encode(message: GeneratedCodeInfo, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.annotation) { GeneratedCodeInfo_Annotation.encode(v!, writer.uint32(10).fork()).ldelim(); @@ -4863,15 +5867,29 @@ export const GeneratedCodeInfo = { } return message; }, + fromJSON(object: any): GeneratedCodeInfo { + return { + annotation: Array.isArray(object?.annotation) ? object.annotation.map((e: any) => GeneratedCodeInfo_Annotation.fromJSON(e)) : [] + }; + }, + toJSON(message: GeneratedCodeInfo): unknown { + const obj: any = {}; + if (message.annotation) { + obj.annotation = message.annotation.map(e => e ? GeneratedCodeInfo_Annotation.toJSON(e) : undefined); + } else { + obj.annotation = []; + } + return obj; + }, fromPartial(object: Partial): GeneratedCodeInfo { const message = createBaseGeneratedCodeInfo(); message.annotation = object.annotation?.map(e => GeneratedCodeInfo_Annotation.fromPartial(e)) || []; return message; }, fromAmino(object: GeneratedCodeInfoAmino): GeneratedCodeInfo { - return { - annotation: Array.isArray(object?.annotation) ? object.annotation.map((e: any) => GeneratedCodeInfo_Annotation.fromAmino(e)) : [] - }; + const message = createBaseGeneratedCodeInfo(); + message.annotation = object.annotation?.map(e => GeneratedCodeInfo_Annotation.fromAmino(e)) || []; + return message; }, toAmino(message: GeneratedCodeInfo): GeneratedCodeInfoAmino { const obj: any = {}; @@ -4898,6 +5916,7 @@ export const GeneratedCodeInfo = { }; } }; +GlobalDecoderRegistry.register(GeneratedCodeInfo.typeUrl, GeneratedCodeInfo); function createBaseGeneratedCodeInfo_Annotation(): GeneratedCodeInfo_Annotation { return { path: [], @@ -4908,6 +5927,15 @@ function createBaseGeneratedCodeInfo_Annotation(): GeneratedCodeInfo_Annotation } export const GeneratedCodeInfo_Annotation = { typeUrl: "/google.protobuf.Annotation", + is(o: any): o is GeneratedCodeInfo_Annotation { + return o && (o.$typeUrl === GeneratedCodeInfo_Annotation.typeUrl || Array.isArray(o.path) && (!o.path.length || typeof o.path[0] === "number") && typeof o.sourceFile === "string" && typeof o.begin === "number" && typeof o.end === "number"); + }, + isSDK(o: any): o is GeneratedCodeInfo_AnnotationSDKType { + return o && (o.$typeUrl === GeneratedCodeInfo_Annotation.typeUrl || Array.isArray(o.path) && (!o.path.length || typeof o.path[0] === "number") && typeof o.source_file === "string" && typeof o.begin === "number" && typeof o.end === "number"); + }, + isAmino(o: any): o is GeneratedCodeInfo_AnnotationAmino { + return o && (o.$typeUrl === GeneratedCodeInfo_Annotation.typeUrl || Array.isArray(o.path) && (!o.path.length || typeof o.path[0] === "number") && typeof o.source_file === "string" && typeof o.begin === "number" && typeof o.end === "number"); + }, encode(message: GeneratedCodeInfo_Annotation, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { writer.uint32(10).fork(); for (const v of message.path) { @@ -4958,6 +5986,26 @@ export const GeneratedCodeInfo_Annotation = { } return message; }, + fromJSON(object: any): GeneratedCodeInfo_Annotation { + return { + path: Array.isArray(object?.path) ? object.path.map((e: any) => Number(e)) : [], + 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 = {}; + if (message.path) { + obj.path = message.path.map(e => Math.round(e)); + } else { + 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; + }, fromPartial(object: Partial): GeneratedCodeInfo_Annotation { const message = createBaseGeneratedCodeInfo_Annotation(); message.path = object.path?.map(e => e) || []; @@ -4967,12 +6015,18 @@ export const GeneratedCodeInfo_Annotation = { return message; }, fromAmino(object: GeneratedCodeInfo_AnnotationAmino): GeneratedCodeInfo_Annotation { - return { - path: Array.isArray(object?.path) ? object.path.map((e: any) => e) : [], - sourceFile: object.source_file, - begin: object.begin, - end: object.end - }; + const message = createBaseGeneratedCodeInfo_Annotation(); + message.path = object.path?.map(e => e) || []; + if (object.source_file !== undefined && object.source_file !== null) { + message.sourceFile = object.source_file; + } + if (object.begin !== undefined && object.begin !== null) { + message.begin = object.begin; + } + if (object.end !== undefined && object.end !== null) { + message.end = object.end; + } + return message; }, toAmino(message: GeneratedCodeInfo_Annotation): GeneratedCodeInfo_AnnotationAmino { const obj: any = {}; @@ -5001,4 +6055,5 @@ export const GeneratedCodeInfo_Annotation = { value: GeneratedCodeInfo_Annotation.encode(message).finish() }; } -}; \ No newline at end of file +}; +GlobalDecoderRegistry.register(GeneratedCodeInfo_Annotation.typeUrl, GeneratedCodeInfo_Annotation); \ No newline at end of file diff --git a/packages/osmojs/src/codegen/google/protobuf/duration.ts b/packages/osmojs/src/codegen/google/protobuf/duration.ts index 29ed9b451..ed2212d28 100644 --- a/packages/osmojs/src/codegen/google/protobuf/duration.ts +++ b/packages/osmojs/src/codegen/google/protobuf/duration.ts @@ -1,4 +1,6 @@ import { BinaryReader, BinaryWriter } from "../../binary"; +import { isSet } from "../../helpers"; +import { GlobalDecoderRegistry } from "../../registry"; /** * A Duration represents a signed, fixed-length span of time represented * as a count of seconds and fractions of seconds at nanosecond @@ -217,6 +219,15 @@ function createBaseDuration(): Duration { } export const Duration = { typeUrl: "/google.protobuf.Duration", + is(o: any): o is Duration { + return o && (o.$typeUrl === Duration.typeUrl || typeof o.seconds === "bigint" && typeof o.nanos === "number"); + }, + isSDK(o: any): o is DurationSDKType { + return o && (o.$typeUrl === Duration.typeUrl || typeof o.seconds === "bigint" && typeof o.nanos === "number"); + }, + isAmino(o: any): o is DurationAmino { + return o && (o.$typeUrl === Duration.typeUrl || typeof o.seconds === "bigint" && typeof o.nanos === "number"); + }, encode(message: Duration, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.seconds !== BigInt(0)) { writer.uint32(8).int64(message.seconds); @@ -246,6 +257,18 @@ export const Duration = { } return message; }, + fromJSON(object: any): Duration { + return { + seconds: isSet(object.seconds) ? BigInt(object.seconds.toString()) : BigInt(0), + nanos: isSet(object.nanos) ? Number(object.nanos) : 0 + }; + }, + toJSON(message: Duration): unknown { + const obj: any = {}; + message.seconds !== undefined && (obj.seconds = (message.seconds || BigInt(0)).toString()); + message.nanos !== undefined && (obj.nanos = Math.round(message.nanos)); + return obj; + }, fromPartial(object: Partial): Duration { const message = createBaseDuration(); message.seconds = object.seconds !== undefined && object.seconds !== null ? BigInt(object.seconds.toString()) : BigInt(0); @@ -277,4 +300,5 @@ export const Duration = { value: Duration.encode(message).finish() }; } -}; \ No newline at end of file +}; +GlobalDecoderRegistry.register(Duration.typeUrl, Duration); \ No newline at end of file diff --git a/packages/osmojs/src/codegen/google/protobuf/empty.ts b/packages/osmojs/src/codegen/google/protobuf/empty.ts index 90da59cee..75e98dd69 100644 --- a/packages/osmojs/src/codegen/google/protobuf/empty.ts +++ b/packages/osmojs/src/codegen/google/protobuf/empty.ts @@ -1,4 +1,5 @@ import { BinaryReader, BinaryWriter } from "../../binary"; +import { GlobalDecoderRegistry } from "../../registry"; /** * A generic empty message that you can re-use to avoid defining duplicated * empty messages in your APIs. A typical example is to use it as the request @@ -48,6 +49,15 @@ function createBaseEmpty(): Empty { } export const Empty = { typeUrl: "/google.protobuf.Empty", + is(o: any): o is Empty { + return o && o.$typeUrl === Empty.typeUrl; + }, + isSDK(o: any): o is EmptySDKType { + return o && o.$typeUrl === Empty.typeUrl; + }, + isAmino(o: any): o is EmptyAmino { + return o && o.$typeUrl === Empty.typeUrl; + }, encode(_: Empty, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, @@ -65,12 +75,20 @@ export const Empty = { } return message; }, + fromJSON(_: any): Empty { + return {}; + }, + toJSON(_: Empty): unknown { + const obj: any = {}; + return obj; + }, fromPartial(_: Partial): Empty { const message = createBaseEmpty(); return message; }, fromAmino(_: EmptyAmino): Empty { - return {}; + const message = createBaseEmpty(); + return message; }, toAmino(_: Empty): EmptyAmino { const obj: any = {}; @@ -91,4 +109,5 @@ export const Empty = { value: Empty.encode(message).finish() }; } -}; \ No newline at end of file +}; +GlobalDecoderRegistry.register(Empty.typeUrl, Empty); \ No newline at end of file diff --git a/packages/osmojs/src/codegen/google/protobuf/timestamp.ts b/packages/osmojs/src/codegen/google/protobuf/timestamp.ts index 9b9b5f23d..33f1d6931 100644 --- a/packages/osmojs/src/codegen/google/protobuf/timestamp.ts +++ b/packages/osmojs/src/codegen/google/protobuf/timestamp.ts @@ -1,5 +1,6 @@ import { BinaryReader, BinaryWriter } from "../../binary"; -import { fromJsonTimestamp, fromTimestamp } from "../../helpers"; +import { isSet, fromJsonTimestamp, fromTimestamp } from "../../helpers"; +import { GlobalDecoderRegistry } from "../../registry"; /** * 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 @@ -288,6 +289,15 @@ function createBaseTimestamp(): Timestamp { } export const Timestamp = { typeUrl: "/google.protobuf.Timestamp", + is(o: any): o is Timestamp { + return o && (o.$typeUrl === Timestamp.typeUrl || typeof o.seconds === "bigint" && typeof o.nanos === "number"); + }, + isSDK(o: any): o is TimestampSDKType { + return o && (o.$typeUrl === Timestamp.typeUrl || typeof o.seconds === "bigint" && typeof o.nanos === "number"); + }, + isAmino(o: any): o is TimestampAmino { + return o && (o.$typeUrl === Timestamp.typeUrl || typeof o.seconds === "bigint" && typeof o.nanos === "number"); + }, encode(message: Timestamp, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.seconds !== BigInt(0)) { writer.uint32(8).int64(message.seconds); @@ -317,6 +327,18 @@ export const Timestamp = { } return message; }, + fromJSON(object: any): Timestamp { + return { + seconds: isSet(object.seconds) ? BigInt(object.seconds.toString()) : BigInt(0), + nanos: isSet(object.nanos) ? Number(object.nanos) : 0 + }; + }, + toJSON(message: Timestamp): unknown { + const obj: any = {}; + message.seconds !== undefined && (obj.seconds = (message.seconds || BigInt(0)).toString()); + message.nanos !== undefined && (obj.nanos = Math.round(message.nanos)); + return obj; + }, fromPartial(object: Partial): Timestamp { const message = createBaseTimestamp(); message.seconds = object.seconds !== undefined && object.seconds !== null ? BigInt(object.seconds.toString()) : BigInt(0); @@ -327,7 +349,7 @@ export const Timestamp = { return fromJsonTimestamp(object); }, toAmino(message: Timestamp): TimestampAmino { - return fromTimestamp(message).toString(); + return fromTimestamp(message).toISOString().replace(/\.\d+Z$/, "Z"); }, fromAminoMsg(object: TimestampAminoMsg): Timestamp { return Timestamp.fromAmino(object.value); @@ -344,4 +366,5 @@ export const Timestamp = { value: Timestamp.encode(message).finish() }; } -}; \ No newline at end of file +}; +GlobalDecoderRegistry.register(Timestamp.typeUrl, Timestamp); \ No newline at end of file diff --git a/packages/osmojs/src/codegen/helpers.ts b/packages/osmojs/src/codegen/helpers.ts index 105ad0991..26b89dece 100644 --- a/packages/osmojs/src/codegen/helpers.ts +++ b/packages/osmojs/src/codegen/helpers.ts @@ -1,5 +1,5 @@ /** -* This file and any referenced files were automatically generated by @cosmology/telescope@0.99.12 +* This file and any referenced files were automatically generated by @cosmology/telescope@1.4.1 * DO NOT MODIFY BY HAND. Instead, download the latest proto files for your chain * and run the transpile command or yarn proto command to regenerate this bundle. */ @@ -182,9 +182,9 @@ type KeysOfUnion = T extends T ? keyof T : never; export type Exact = P extends Builtin ? P : P & { [K in keyof P]: Exact } & Record< - Exclude>, - never - >; + Exclude>, + never + >; export interface Rpc { request( @@ -226,13 +226,6 @@ export function fromTimestamp(t: Timestamp): Date { return new Date(millis); } -const fromJSON = (object: any): Timestamp => { - return { - seconds: isSet(object.seconds) ? BigInt(object.seconds) : BigInt(0), - nanos: isSet(object.nanos) ? Number(object.nanos) : 0 - }; -}; - const timestampFromJSON = (object: any): Timestamp => { return { seconds: isSet(object.seconds) @@ -253,5 +246,5 @@ export function fromJsonTimestamp(o: any): Timestamp { } function numberToLong(number: number) { - return BigInt(number); + return BigInt(Math.trunc(number)); } diff --git a/packages/osmojs/src/codegen/ibc/applications/fee/v1/ack.ts b/packages/osmojs/src/codegen/ibc/applications/fee/v1/ack.ts index e7999c409..377d1f9ca 100644 --- a/packages/osmojs/src/codegen/ibc/applications/fee/v1/ack.ts +++ b/packages/osmojs/src/codegen/ibc/applications/fee/v1/ack.ts @@ -1,4 +1,6 @@ import { BinaryReader, BinaryWriter } from "../../../../binary"; +import { isSet, bytesFromBase64, base64FromBytes } from "../../../../helpers"; +import { GlobalDecoderRegistry } from "../../../../registry"; /** IncentivizedAcknowledgement is the acknowledgement format to be used by applications wrapped in the fee middleware */ export interface IncentivizedAcknowledgement { /** the underlying app acknowledgement bytes */ @@ -15,11 +17,11 @@ export interface IncentivizedAcknowledgementProtoMsg { /** IncentivizedAcknowledgement is the acknowledgement format to be used by applications wrapped in the fee middleware */ export interface IncentivizedAcknowledgementAmino { /** the underlying app acknowledgement bytes */ - app_acknowledgement: Uint8Array; + app_acknowledgement?: string; /** the relayer address which submits the recv packet message */ - forward_relayer_address: string; + forward_relayer_address?: string; /** success flag of the base application callback */ - underlying_app_success: boolean; + underlying_app_success?: boolean; } export interface IncentivizedAcknowledgementAminoMsg { type: "cosmos-sdk/IncentivizedAcknowledgement"; @@ -40,6 +42,16 @@ function createBaseIncentivizedAcknowledgement(): IncentivizedAcknowledgement { } export const IncentivizedAcknowledgement = { typeUrl: "/ibc.applications.fee.v1.IncentivizedAcknowledgement", + aminoType: "cosmos-sdk/IncentivizedAcknowledgement", + is(o: any): o is IncentivizedAcknowledgement { + return o && (o.$typeUrl === IncentivizedAcknowledgement.typeUrl || (o.appAcknowledgement instanceof Uint8Array || typeof o.appAcknowledgement === "string") && typeof o.forwardRelayerAddress === "string" && typeof o.underlyingAppSuccess === "boolean"); + }, + isSDK(o: any): o is IncentivizedAcknowledgementSDKType { + return o && (o.$typeUrl === IncentivizedAcknowledgement.typeUrl || (o.app_acknowledgement instanceof Uint8Array || typeof o.app_acknowledgement === "string") && typeof o.forward_relayer_address === "string" && typeof o.underlying_app_success === "boolean"); + }, + isAmino(o: any): o is IncentivizedAcknowledgementAmino { + return o && (o.$typeUrl === IncentivizedAcknowledgement.typeUrl || (o.app_acknowledgement instanceof Uint8Array || typeof o.app_acknowledgement === "string") && typeof o.forward_relayer_address === "string" && typeof o.underlying_app_success === "boolean"); + }, encode(message: IncentivizedAcknowledgement, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.appAcknowledgement.length !== 0) { writer.uint32(10).bytes(message.appAcknowledgement); @@ -75,6 +87,20 @@ export const IncentivizedAcknowledgement = { } return message; }, + fromJSON(object: any): IncentivizedAcknowledgement { + return { + appAcknowledgement: isSet(object.appAcknowledgement) ? bytesFromBase64(object.appAcknowledgement) : new Uint8Array(), + forwardRelayerAddress: isSet(object.forwardRelayerAddress) ? String(object.forwardRelayerAddress) : "", + underlyingAppSuccess: isSet(object.underlyingAppSuccess) ? Boolean(object.underlyingAppSuccess) : false + }; + }, + toJSON(message: IncentivizedAcknowledgement): unknown { + const obj: any = {}; + message.appAcknowledgement !== undefined && (obj.appAcknowledgement = base64FromBytes(message.appAcknowledgement !== undefined ? message.appAcknowledgement : new Uint8Array())); + message.forwardRelayerAddress !== undefined && (obj.forwardRelayerAddress = message.forwardRelayerAddress); + message.underlyingAppSuccess !== undefined && (obj.underlyingAppSuccess = message.underlyingAppSuccess); + return obj; + }, fromPartial(object: Partial): IncentivizedAcknowledgement { const message = createBaseIncentivizedAcknowledgement(); message.appAcknowledgement = object.appAcknowledgement ?? new Uint8Array(); @@ -83,15 +109,21 @@ export const IncentivizedAcknowledgement = { return message; }, fromAmino(object: IncentivizedAcknowledgementAmino): IncentivizedAcknowledgement { - return { - appAcknowledgement: object.app_acknowledgement, - forwardRelayerAddress: object.forward_relayer_address, - underlyingAppSuccess: object.underlying_app_success - }; + const message = createBaseIncentivizedAcknowledgement(); + if (object.app_acknowledgement !== undefined && object.app_acknowledgement !== null) { + message.appAcknowledgement = bytesFromBase64(object.app_acknowledgement); + } + if (object.forward_relayer_address !== undefined && object.forward_relayer_address !== null) { + message.forwardRelayerAddress = object.forward_relayer_address; + } + if (object.underlying_app_success !== undefined && object.underlying_app_success !== null) { + message.underlyingAppSuccess = object.underlying_app_success; + } + return message; }, toAmino(message: IncentivizedAcknowledgement): IncentivizedAcknowledgementAmino { const obj: any = {}; - obj.app_acknowledgement = message.appAcknowledgement; + obj.app_acknowledgement = message.appAcknowledgement ? base64FromBytes(message.appAcknowledgement) : undefined; obj.forward_relayer_address = message.forwardRelayerAddress; obj.underlying_app_success = message.underlyingAppSuccess; return obj; @@ -117,4 +149,6 @@ export const IncentivizedAcknowledgement = { value: IncentivizedAcknowledgement.encode(message).finish() }; } -}; \ No newline at end of file +}; +GlobalDecoderRegistry.register(IncentivizedAcknowledgement.typeUrl, IncentivizedAcknowledgement); +GlobalDecoderRegistry.registerAminoProtoMapping(IncentivizedAcknowledgement.aminoType, IncentivizedAcknowledgement.typeUrl); \ No newline at end of file diff --git a/packages/osmojs/src/codegen/ibc/applications/fee/v1/fee.ts b/packages/osmojs/src/codegen/ibc/applications/fee/v1/fee.ts index 0bd6561e0..8962f2463 100644 --- a/packages/osmojs/src/codegen/ibc/applications/fee/v1/fee.ts +++ b/packages/osmojs/src/codegen/ibc/applications/fee/v1/fee.ts @@ -1,6 +1,8 @@ import { Coin, CoinAmino, CoinSDKType } from "../../../../cosmos/base/v1beta1/coin"; import { PacketId, PacketIdAmino, PacketIdSDKType } from "../../../core/channel/v1/channel"; import { BinaryReader, BinaryWriter } from "../../../../binary"; +import { GlobalDecoderRegistry } from "../../../../registry"; +import { isSet } from "../../../../helpers"; /** Fee defines the ICS29 receive, acknowledgement and timeout fees */ export interface Fee { /** the packet receive fee */ @@ -17,11 +19,11 @@ export interface FeeProtoMsg { /** Fee defines the ICS29 receive, acknowledgement and timeout fees */ export interface FeeAmino { /** the packet receive fee */ - recv_fee: CoinAmino[]; + recv_fee?: CoinAmino[]; /** the packet acknowledgement fee */ - ack_fee: CoinAmino[]; + ack_fee?: CoinAmino[]; /** the packet timeout fee */ - timeout_fee: CoinAmino[]; + timeout_fee?: CoinAmino[]; } export interface FeeAminoMsg { type: "cosmos-sdk/Fee"; @@ -51,9 +53,9 @@ export interface PacketFeeAmino { /** fee encapsulates the recv, ack and timeout fees associated with an IBC packet */ fee?: FeeAmino; /** the refund address for unspent fees */ - refund_address: string; + refund_address?: string; /** optional list of relayers permitted to receive fees */ - relayers: string[]; + relayers?: string[]; } export interface PacketFeeAminoMsg { type: "cosmos-sdk/PacketFee"; @@ -77,7 +79,7 @@ export interface PacketFeesProtoMsg { /** PacketFees contains a list of type PacketFee */ export interface PacketFeesAmino { /** list of packet fees */ - packet_fees: PacketFeeAmino[]; + packet_fees?: PacketFeeAmino[]; } export interface PacketFeesAminoMsg { type: "cosmos-sdk/PacketFees"; @@ -103,7 +105,7 @@ export interface IdentifiedPacketFeesAmino { /** unique packet identifier comprised of the channel ID, port ID and sequence */ packet_id?: PacketIdAmino; /** list of packet fees */ - packet_fees: PacketFeeAmino[]; + packet_fees?: PacketFeeAmino[]; } export interface IdentifiedPacketFeesAminoMsg { type: "cosmos-sdk/IdentifiedPacketFees"; @@ -123,6 +125,16 @@ function createBaseFee(): Fee { } export const Fee = { typeUrl: "/ibc.applications.fee.v1.Fee", + aminoType: "cosmos-sdk/Fee", + is(o: any): o is Fee { + return o && (o.$typeUrl === Fee.typeUrl || Array.isArray(o.recvFee) && (!o.recvFee.length || Coin.is(o.recvFee[0])) && Array.isArray(o.ackFee) && (!o.ackFee.length || Coin.is(o.ackFee[0])) && Array.isArray(o.timeoutFee) && (!o.timeoutFee.length || Coin.is(o.timeoutFee[0]))); + }, + isSDK(o: any): o is FeeSDKType { + return o && (o.$typeUrl === Fee.typeUrl || Array.isArray(o.recv_fee) && (!o.recv_fee.length || Coin.isSDK(o.recv_fee[0])) && Array.isArray(o.ack_fee) && (!o.ack_fee.length || Coin.isSDK(o.ack_fee[0])) && Array.isArray(o.timeout_fee) && (!o.timeout_fee.length || Coin.isSDK(o.timeout_fee[0]))); + }, + isAmino(o: any): o is FeeAmino { + return o && (o.$typeUrl === Fee.typeUrl || Array.isArray(o.recv_fee) && (!o.recv_fee.length || Coin.isAmino(o.recv_fee[0])) && Array.isArray(o.ack_fee) && (!o.ack_fee.length || Coin.isAmino(o.ack_fee[0])) && Array.isArray(o.timeout_fee) && (!o.timeout_fee.length || Coin.isAmino(o.timeout_fee[0]))); + }, encode(message: Fee, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.recvFee) { Coin.encode(v!, writer.uint32(10).fork()).ldelim(); @@ -158,6 +170,32 @@ export const Fee = { } return message; }, + fromJSON(object: any): Fee { + return { + recvFee: Array.isArray(object?.recvFee) ? object.recvFee.map((e: any) => Coin.fromJSON(e)) : [], + ackFee: Array.isArray(object?.ackFee) ? object.ackFee.map((e: any) => Coin.fromJSON(e)) : [], + timeoutFee: Array.isArray(object?.timeoutFee) ? object.timeoutFee.map((e: any) => Coin.fromJSON(e)) : [] + }; + }, + toJSON(message: Fee): unknown { + const obj: any = {}; + if (message.recvFee) { + obj.recvFee = message.recvFee.map(e => e ? Coin.toJSON(e) : undefined); + } else { + obj.recvFee = []; + } + if (message.ackFee) { + obj.ackFee = message.ackFee.map(e => e ? Coin.toJSON(e) : undefined); + } else { + obj.ackFee = []; + } + if (message.timeoutFee) { + obj.timeoutFee = message.timeoutFee.map(e => e ? Coin.toJSON(e) : undefined); + } else { + obj.timeoutFee = []; + } + return obj; + }, fromPartial(object: Partial): Fee { const message = createBaseFee(); message.recvFee = object.recvFee?.map(e => Coin.fromPartial(e)) || []; @@ -166,11 +204,11 @@ export const Fee = { return message; }, fromAmino(object: FeeAmino): Fee { - return { - recvFee: Array.isArray(object?.recv_fee) ? object.recv_fee.map((e: any) => Coin.fromAmino(e)) : [], - ackFee: Array.isArray(object?.ack_fee) ? object.ack_fee.map((e: any) => Coin.fromAmino(e)) : [], - timeoutFee: Array.isArray(object?.timeout_fee) ? object.timeout_fee.map((e: any) => Coin.fromAmino(e)) : [] - }; + const message = createBaseFee(); + message.recvFee = object.recv_fee?.map(e => Coin.fromAmino(e)) || []; + message.ackFee = object.ack_fee?.map(e => Coin.fromAmino(e)) || []; + message.timeoutFee = object.timeout_fee?.map(e => Coin.fromAmino(e)) || []; + return message; }, toAmino(message: Fee): FeeAmino { const obj: any = {}; @@ -213,6 +251,8 @@ export const Fee = { }; } }; +GlobalDecoderRegistry.register(Fee.typeUrl, Fee); +GlobalDecoderRegistry.registerAminoProtoMapping(Fee.aminoType, Fee.typeUrl); function createBasePacketFee(): PacketFee { return { fee: Fee.fromPartial({}), @@ -222,6 +262,16 @@ function createBasePacketFee(): PacketFee { } export const PacketFee = { typeUrl: "/ibc.applications.fee.v1.PacketFee", + aminoType: "cosmos-sdk/PacketFee", + is(o: any): o is PacketFee { + return o && (o.$typeUrl === PacketFee.typeUrl || Fee.is(o.fee) && typeof o.refundAddress === "string" && Array.isArray(o.relayers) && (!o.relayers.length || typeof o.relayers[0] === "string")); + }, + isSDK(o: any): o is PacketFeeSDKType { + return o && (o.$typeUrl === PacketFee.typeUrl || Fee.isSDK(o.fee) && typeof o.refund_address === "string" && Array.isArray(o.relayers) && (!o.relayers.length || typeof o.relayers[0] === "string")); + }, + isAmino(o: any): o is PacketFeeAmino { + return o && (o.$typeUrl === PacketFee.typeUrl || Fee.isAmino(o.fee) && typeof o.refund_address === "string" && Array.isArray(o.relayers) && (!o.relayers.length || typeof o.relayers[0] === "string")); + }, encode(message: PacketFee, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.fee !== undefined) { Fee.encode(message.fee, writer.uint32(10).fork()).ldelim(); @@ -257,6 +307,24 @@ export const PacketFee = { } return message; }, + fromJSON(object: any): PacketFee { + return { + fee: isSet(object.fee) ? Fee.fromJSON(object.fee) : undefined, + refundAddress: isSet(object.refundAddress) ? String(object.refundAddress) : "", + relayers: Array.isArray(object?.relayers) ? object.relayers.map((e: any) => String(e)) : [] + }; + }, + toJSON(message: PacketFee): unknown { + const obj: any = {}; + message.fee !== undefined && (obj.fee = message.fee ? Fee.toJSON(message.fee) : undefined); + message.refundAddress !== undefined && (obj.refundAddress = message.refundAddress); + if (message.relayers) { + obj.relayers = message.relayers.map(e => e); + } else { + obj.relayers = []; + } + return obj; + }, fromPartial(object: Partial): PacketFee { const message = createBasePacketFee(); message.fee = object.fee !== undefined && object.fee !== null ? Fee.fromPartial(object.fee) : undefined; @@ -265,11 +333,15 @@ export const PacketFee = { return message; }, fromAmino(object: PacketFeeAmino): PacketFee { - return { - fee: object?.fee ? Fee.fromAmino(object.fee) : undefined, - refundAddress: object.refund_address, - relayers: Array.isArray(object?.relayers) ? object.relayers.map((e: any) => e) : [] - }; + const message = createBasePacketFee(); + if (object.fee !== undefined && object.fee !== null) { + message.fee = Fee.fromAmino(object.fee); + } + if (object.refund_address !== undefined && object.refund_address !== null) { + message.refundAddress = object.refund_address; + } + message.relayers = object.relayers?.map(e => e) || []; + return message; }, toAmino(message: PacketFee): PacketFeeAmino { const obj: any = {}; @@ -304,6 +376,8 @@ export const PacketFee = { }; } }; +GlobalDecoderRegistry.register(PacketFee.typeUrl, PacketFee); +GlobalDecoderRegistry.registerAminoProtoMapping(PacketFee.aminoType, PacketFee.typeUrl); function createBasePacketFees(): PacketFees { return { packetFees: [] @@ -311,6 +385,16 @@ function createBasePacketFees(): PacketFees { } export const PacketFees = { typeUrl: "/ibc.applications.fee.v1.PacketFees", + aminoType: "cosmos-sdk/PacketFees", + is(o: any): o is PacketFees { + return o && (o.$typeUrl === PacketFees.typeUrl || Array.isArray(o.packetFees) && (!o.packetFees.length || PacketFee.is(o.packetFees[0]))); + }, + isSDK(o: any): o is PacketFeesSDKType { + return o && (o.$typeUrl === PacketFees.typeUrl || Array.isArray(o.packet_fees) && (!o.packet_fees.length || PacketFee.isSDK(o.packet_fees[0]))); + }, + isAmino(o: any): o is PacketFeesAmino { + return o && (o.$typeUrl === PacketFees.typeUrl || Array.isArray(o.packet_fees) && (!o.packet_fees.length || PacketFee.isAmino(o.packet_fees[0]))); + }, encode(message: PacketFees, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.packetFees) { PacketFee.encode(v!, writer.uint32(10).fork()).ldelim(); @@ -334,15 +418,29 @@ export const PacketFees = { } return message; }, + fromJSON(object: any): PacketFees { + return { + packetFees: Array.isArray(object?.packetFees) ? object.packetFees.map((e: any) => PacketFee.fromJSON(e)) : [] + }; + }, + toJSON(message: PacketFees): unknown { + const obj: any = {}; + if (message.packetFees) { + obj.packetFees = message.packetFees.map(e => e ? PacketFee.toJSON(e) : undefined); + } else { + obj.packetFees = []; + } + return obj; + }, fromPartial(object: Partial): PacketFees { const message = createBasePacketFees(); message.packetFees = object.packetFees?.map(e => PacketFee.fromPartial(e)) || []; return message; }, fromAmino(object: PacketFeesAmino): PacketFees { - return { - packetFees: Array.isArray(object?.packet_fees) ? object.packet_fees.map((e: any) => PacketFee.fromAmino(e)) : [] - }; + const message = createBasePacketFees(); + message.packetFees = object.packet_fees?.map(e => PacketFee.fromAmino(e)) || []; + return message; }, toAmino(message: PacketFees): PacketFeesAmino { const obj: any = {}; @@ -375,6 +473,8 @@ export const PacketFees = { }; } }; +GlobalDecoderRegistry.register(PacketFees.typeUrl, PacketFees); +GlobalDecoderRegistry.registerAminoProtoMapping(PacketFees.aminoType, PacketFees.typeUrl); function createBaseIdentifiedPacketFees(): IdentifiedPacketFees { return { packetId: PacketId.fromPartial({}), @@ -383,6 +483,16 @@ function createBaseIdentifiedPacketFees(): IdentifiedPacketFees { } export const IdentifiedPacketFees = { typeUrl: "/ibc.applications.fee.v1.IdentifiedPacketFees", + aminoType: "cosmos-sdk/IdentifiedPacketFees", + is(o: any): o is IdentifiedPacketFees { + return o && (o.$typeUrl === IdentifiedPacketFees.typeUrl || PacketId.is(o.packetId) && Array.isArray(o.packetFees) && (!o.packetFees.length || PacketFee.is(o.packetFees[0]))); + }, + isSDK(o: any): o is IdentifiedPacketFeesSDKType { + return o && (o.$typeUrl === IdentifiedPacketFees.typeUrl || PacketId.isSDK(o.packet_id) && Array.isArray(o.packet_fees) && (!o.packet_fees.length || PacketFee.isSDK(o.packet_fees[0]))); + }, + isAmino(o: any): o is IdentifiedPacketFeesAmino { + return o && (o.$typeUrl === IdentifiedPacketFees.typeUrl || PacketId.isAmino(o.packet_id) && Array.isArray(o.packet_fees) && (!o.packet_fees.length || PacketFee.isAmino(o.packet_fees[0]))); + }, encode(message: IdentifiedPacketFees, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.packetId !== undefined) { PacketId.encode(message.packetId, writer.uint32(10).fork()).ldelim(); @@ -412,6 +522,22 @@ export const IdentifiedPacketFees = { } return message; }, + fromJSON(object: any): IdentifiedPacketFees { + return { + packetId: isSet(object.packetId) ? PacketId.fromJSON(object.packetId) : undefined, + packetFees: Array.isArray(object?.packetFees) ? object.packetFees.map((e: any) => PacketFee.fromJSON(e)) : [] + }; + }, + toJSON(message: IdentifiedPacketFees): unknown { + const obj: any = {}; + message.packetId !== undefined && (obj.packetId = message.packetId ? PacketId.toJSON(message.packetId) : undefined); + if (message.packetFees) { + obj.packetFees = message.packetFees.map(e => e ? PacketFee.toJSON(e) : undefined); + } else { + obj.packetFees = []; + } + return obj; + }, fromPartial(object: Partial): IdentifiedPacketFees { const message = createBaseIdentifiedPacketFees(); message.packetId = object.packetId !== undefined && object.packetId !== null ? PacketId.fromPartial(object.packetId) : undefined; @@ -419,10 +545,12 @@ export const IdentifiedPacketFees = { return message; }, fromAmino(object: IdentifiedPacketFeesAmino): IdentifiedPacketFees { - return { - packetId: object?.packet_id ? PacketId.fromAmino(object.packet_id) : undefined, - packetFees: Array.isArray(object?.packet_fees) ? object.packet_fees.map((e: any) => PacketFee.fromAmino(e)) : [] - }; + const message = createBaseIdentifiedPacketFees(); + if (object.packet_id !== undefined && object.packet_id !== null) { + message.packetId = PacketId.fromAmino(object.packet_id); + } + message.packetFees = object.packet_fees?.map(e => PacketFee.fromAmino(e)) || []; + return message; }, toAmino(message: IdentifiedPacketFees): IdentifiedPacketFeesAmino { const obj: any = {}; @@ -455,4 +583,6 @@ export const IdentifiedPacketFees = { value: IdentifiedPacketFees.encode(message).finish() }; } -}; \ No newline at end of file +}; +GlobalDecoderRegistry.register(IdentifiedPacketFees.typeUrl, IdentifiedPacketFees); +GlobalDecoderRegistry.registerAminoProtoMapping(IdentifiedPacketFees.aminoType, IdentifiedPacketFees.typeUrl); \ No newline at end of file diff --git a/packages/osmojs/src/codegen/ibc/applications/fee/v1/genesis.ts b/packages/osmojs/src/codegen/ibc/applications/fee/v1/genesis.ts index 98ffcbecc..57a7acc25 100644 --- a/packages/osmojs/src/codegen/ibc/applications/fee/v1/genesis.ts +++ b/packages/osmojs/src/codegen/ibc/applications/fee/v1/genesis.ts @@ -1,6 +1,8 @@ import { IdentifiedPacketFees, IdentifiedPacketFeesAmino, IdentifiedPacketFeesSDKType } from "./fee"; import { PacketId, PacketIdAmino, PacketIdSDKType } from "../../../core/channel/v1/channel"; import { BinaryReader, BinaryWriter } from "../../../../binary"; +import { GlobalDecoderRegistry } from "../../../../registry"; +import { isSet } from "../../../../helpers"; /** GenesisState defines the ICS29 fee middleware genesis state */ export interface GenesisState { /** list of identified packet fees */ @@ -21,15 +23,15 @@ export interface GenesisStateProtoMsg { /** GenesisState defines the ICS29 fee middleware genesis state */ export interface GenesisStateAmino { /** list of identified packet fees */ - identified_fees: IdentifiedPacketFeesAmino[]; + identified_fees?: IdentifiedPacketFeesAmino[]; /** list of fee enabled channels */ - fee_enabled_channels: FeeEnabledChannelAmino[]; + fee_enabled_channels?: FeeEnabledChannelAmino[]; /** list of registered payees */ - registered_payees: RegisteredPayeeAmino[]; + registered_payees?: RegisteredPayeeAmino[]; /** list of registered counterparty payees */ - registered_counterparty_payees: RegisteredCounterpartyPayeeAmino[]; + registered_counterparty_payees?: RegisteredCounterpartyPayeeAmino[]; /** list of forward relayer addresses */ - forward_relayers: ForwardRelayerAddressAmino[]; + forward_relayers?: ForwardRelayerAddressAmino[]; } export interface GenesisStateAminoMsg { type: "cosmos-sdk/GenesisState"; @@ -57,9 +59,9 @@ export interface FeeEnabledChannelProtoMsg { /** FeeEnabledChannel contains the PortID & ChannelID for a fee enabled channel */ export interface FeeEnabledChannelAmino { /** unique port identifier */ - port_id: string; + port_id?: string; /** unique channel identifier */ - channel_id: string; + channel_id?: string; } export interface FeeEnabledChannelAminoMsg { type: "cosmos-sdk/FeeEnabledChannel"; @@ -86,11 +88,11 @@ export interface RegisteredPayeeProtoMsg { /** RegisteredPayee contains the relayer address and payee address for a specific channel */ export interface RegisteredPayeeAmino { /** unique channel identifier */ - channel_id: string; + channel_id?: string; /** the relayer address */ - relayer: string; + relayer?: string; /** the payee address */ - payee: string; + payee?: string; } export interface RegisteredPayeeAminoMsg { type: "cosmos-sdk/RegisteredPayee"; @@ -124,11 +126,11 @@ export interface RegisteredCounterpartyPayeeProtoMsg { */ export interface RegisteredCounterpartyPayeeAmino { /** unique channel identifier */ - channel_id: string; + channel_id?: string; /** the relayer address */ - relayer: string; + relayer?: string; /** the counterparty payee address */ - counterparty_payee: string; + counterparty_payee?: string; } export interface RegisteredCounterpartyPayeeAminoMsg { type: "cosmos-sdk/RegisteredCounterpartyPayee"; @@ -147,7 +149,7 @@ export interface RegisteredCounterpartyPayeeSDKType { export interface ForwardRelayerAddress { /** the forward relayer address */ address: string; - /** unique packet identifer comprised of the channel ID, port ID and sequence */ + /** unique packet identifier comprised of the channel ID, port ID and sequence */ packetId: PacketId; } export interface ForwardRelayerAddressProtoMsg { @@ -157,8 +159,8 @@ export interface ForwardRelayerAddressProtoMsg { /** ForwardRelayerAddress contains the forward relayer address and PacketId used for async acknowledgements */ export interface ForwardRelayerAddressAmino { /** the forward relayer address */ - address: string; - /** unique packet identifer comprised of the channel ID, port ID and sequence */ + address?: string; + /** unique packet identifier comprised of the channel ID, port ID and sequence */ packet_id?: PacketIdAmino; } export interface ForwardRelayerAddressAminoMsg { @@ -181,6 +183,16 @@ function createBaseGenesisState(): GenesisState { } export const GenesisState = { typeUrl: "/ibc.applications.fee.v1.GenesisState", + aminoType: "cosmos-sdk/GenesisState", + is(o: any): o is GenesisState { + return o && (o.$typeUrl === GenesisState.typeUrl || Array.isArray(o.identifiedFees) && (!o.identifiedFees.length || IdentifiedPacketFees.is(o.identifiedFees[0])) && Array.isArray(o.feeEnabledChannels) && (!o.feeEnabledChannels.length || FeeEnabledChannel.is(o.feeEnabledChannels[0])) && Array.isArray(o.registeredPayees) && (!o.registeredPayees.length || RegisteredPayee.is(o.registeredPayees[0])) && Array.isArray(o.registeredCounterpartyPayees) && (!o.registeredCounterpartyPayees.length || RegisteredCounterpartyPayee.is(o.registeredCounterpartyPayees[0])) && Array.isArray(o.forwardRelayers) && (!o.forwardRelayers.length || ForwardRelayerAddress.is(o.forwardRelayers[0]))); + }, + isSDK(o: any): o is GenesisStateSDKType { + return o && (o.$typeUrl === GenesisState.typeUrl || Array.isArray(o.identified_fees) && (!o.identified_fees.length || IdentifiedPacketFees.isSDK(o.identified_fees[0])) && Array.isArray(o.fee_enabled_channels) && (!o.fee_enabled_channels.length || FeeEnabledChannel.isSDK(o.fee_enabled_channels[0])) && Array.isArray(o.registered_payees) && (!o.registered_payees.length || RegisteredPayee.isSDK(o.registered_payees[0])) && Array.isArray(o.registered_counterparty_payees) && (!o.registered_counterparty_payees.length || RegisteredCounterpartyPayee.isSDK(o.registered_counterparty_payees[0])) && Array.isArray(o.forward_relayers) && (!o.forward_relayers.length || ForwardRelayerAddress.isSDK(o.forward_relayers[0]))); + }, + isAmino(o: any): o is GenesisStateAmino { + return o && (o.$typeUrl === GenesisState.typeUrl || Array.isArray(o.identified_fees) && (!o.identified_fees.length || IdentifiedPacketFees.isAmino(o.identified_fees[0])) && Array.isArray(o.fee_enabled_channels) && (!o.fee_enabled_channels.length || FeeEnabledChannel.isAmino(o.fee_enabled_channels[0])) && Array.isArray(o.registered_payees) && (!o.registered_payees.length || RegisteredPayee.isAmino(o.registered_payees[0])) && Array.isArray(o.registered_counterparty_payees) && (!o.registered_counterparty_payees.length || RegisteredCounterpartyPayee.isAmino(o.registered_counterparty_payees[0])) && Array.isArray(o.forward_relayers) && (!o.forward_relayers.length || ForwardRelayerAddress.isAmino(o.forward_relayers[0]))); + }, encode(message: GenesisState, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.identifiedFees) { IdentifiedPacketFees.encode(v!, writer.uint32(10).fork()).ldelim(); @@ -228,6 +240,44 @@ export const GenesisState = { } return message; }, + fromJSON(object: any): GenesisState { + return { + identifiedFees: Array.isArray(object?.identifiedFees) ? object.identifiedFees.map((e: any) => IdentifiedPacketFees.fromJSON(e)) : [], + feeEnabledChannels: Array.isArray(object?.feeEnabledChannels) ? object.feeEnabledChannels.map((e: any) => FeeEnabledChannel.fromJSON(e)) : [], + registeredPayees: Array.isArray(object?.registeredPayees) ? object.registeredPayees.map((e: any) => RegisteredPayee.fromJSON(e)) : [], + registeredCounterpartyPayees: Array.isArray(object?.registeredCounterpartyPayees) ? object.registeredCounterpartyPayees.map((e: any) => RegisteredCounterpartyPayee.fromJSON(e)) : [], + forwardRelayers: Array.isArray(object?.forwardRelayers) ? object.forwardRelayers.map((e: any) => ForwardRelayerAddress.fromJSON(e)) : [] + }; + }, + toJSON(message: GenesisState): unknown { + const obj: any = {}; + if (message.identifiedFees) { + obj.identifiedFees = message.identifiedFees.map(e => e ? IdentifiedPacketFees.toJSON(e) : undefined); + } else { + obj.identifiedFees = []; + } + if (message.feeEnabledChannels) { + obj.feeEnabledChannels = message.feeEnabledChannels.map(e => e ? FeeEnabledChannel.toJSON(e) : undefined); + } else { + obj.feeEnabledChannels = []; + } + if (message.registeredPayees) { + obj.registeredPayees = message.registeredPayees.map(e => e ? RegisteredPayee.toJSON(e) : undefined); + } else { + obj.registeredPayees = []; + } + if (message.registeredCounterpartyPayees) { + obj.registeredCounterpartyPayees = message.registeredCounterpartyPayees.map(e => e ? RegisteredCounterpartyPayee.toJSON(e) : undefined); + } else { + obj.registeredCounterpartyPayees = []; + } + if (message.forwardRelayers) { + obj.forwardRelayers = message.forwardRelayers.map(e => e ? ForwardRelayerAddress.toJSON(e) : undefined); + } else { + obj.forwardRelayers = []; + } + return obj; + }, fromPartial(object: Partial): GenesisState { const message = createBaseGenesisState(); message.identifiedFees = object.identifiedFees?.map(e => IdentifiedPacketFees.fromPartial(e)) || []; @@ -238,13 +288,13 @@ export const GenesisState = { return message; }, fromAmino(object: GenesisStateAmino): GenesisState { - return { - identifiedFees: Array.isArray(object?.identified_fees) ? object.identified_fees.map((e: any) => IdentifiedPacketFees.fromAmino(e)) : [], - feeEnabledChannels: Array.isArray(object?.fee_enabled_channels) ? object.fee_enabled_channels.map((e: any) => FeeEnabledChannel.fromAmino(e)) : [], - registeredPayees: Array.isArray(object?.registered_payees) ? object.registered_payees.map((e: any) => RegisteredPayee.fromAmino(e)) : [], - registeredCounterpartyPayees: Array.isArray(object?.registered_counterparty_payees) ? object.registered_counterparty_payees.map((e: any) => RegisteredCounterpartyPayee.fromAmino(e)) : [], - forwardRelayers: Array.isArray(object?.forward_relayers) ? object.forward_relayers.map((e: any) => ForwardRelayerAddress.fromAmino(e)) : [] - }; + const message = createBaseGenesisState(); + message.identifiedFees = object.identified_fees?.map(e => IdentifiedPacketFees.fromAmino(e)) || []; + message.feeEnabledChannels = object.fee_enabled_channels?.map(e => FeeEnabledChannel.fromAmino(e)) || []; + message.registeredPayees = object.registered_payees?.map(e => RegisteredPayee.fromAmino(e)) || []; + message.registeredCounterpartyPayees = object.registered_counterparty_payees?.map(e => RegisteredCounterpartyPayee.fromAmino(e)) || []; + message.forwardRelayers = object.forward_relayers?.map(e => ForwardRelayerAddress.fromAmino(e)) || []; + return message; }, toAmino(message: GenesisState): GenesisStateAmino { const obj: any = {}; @@ -297,6 +347,8 @@ export const GenesisState = { }; } }; +GlobalDecoderRegistry.register(GenesisState.typeUrl, GenesisState); +GlobalDecoderRegistry.registerAminoProtoMapping(GenesisState.aminoType, GenesisState.typeUrl); function createBaseFeeEnabledChannel(): FeeEnabledChannel { return { portId: "", @@ -305,6 +357,16 @@ function createBaseFeeEnabledChannel(): FeeEnabledChannel { } export const FeeEnabledChannel = { typeUrl: "/ibc.applications.fee.v1.FeeEnabledChannel", + aminoType: "cosmos-sdk/FeeEnabledChannel", + is(o: any): o is FeeEnabledChannel { + return o && (o.$typeUrl === FeeEnabledChannel.typeUrl || typeof o.portId === "string" && typeof o.channelId === "string"); + }, + isSDK(o: any): o is FeeEnabledChannelSDKType { + return o && (o.$typeUrl === FeeEnabledChannel.typeUrl || typeof o.port_id === "string" && typeof o.channel_id === "string"); + }, + isAmino(o: any): o is FeeEnabledChannelAmino { + return o && (o.$typeUrl === FeeEnabledChannel.typeUrl || typeof o.port_id === "string" && typeof o.channel_id === "string"); + }, encode(message: FeeEnabledChannel, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.portId !== "") { writer.uint32(10).string(message.portId); @@ -334,6 +396,18 @@ export const FeeEnabledChannel = { } return message; }, + fromJSON(object: any): FeeEnabledChannel { + return { + portId: isSet(object.portId) ? String(object.portId) : "", + channelId: isSet(object.channelId) ? String(object.channelId) : "" + }; + }, + toJSON(message: FeeEnabledChannel): unknown { + const obj: any = {}; + message.portId !== undefined && (obj.portId = message.portId); + message.channelId !== undefined && (obj.channelId = message.channelId); + return obj; + }, fromPartial(object: Partial): FeeEnabledChannel { const message = createBaseFeeEnabledChannel(); message.portId = object.portId ?? ""; @@ -341,10 +415,14 @@ export const FeeEnabledChannel = { return message; }, fromAmino(object: FeeEnabledChannelAmino): FeeEnabledChannel { - return { - portId: object.port_id, - channelId: object.channel_id - }; + const message = createBaseFeeEnabledChannel(); + if (object.port_id !== undefined && object.port_id !== null) { + message.portId = object.port_id; + } + if (object.channel_id !== undefined && object.channel_id !== null) { + message.channelId = object.channel_id; + } + return message; }, toAmino(message: FeeEnabledChannel): FeeEnabledChannelAmino { const obj: any = {}; @@ -374,6 +452,8 @@ export const FeeEnabledChannel = { }; } }; +GlobalDecoderRegistry.register(FeeEnabledChannel.typeUrl, FeeEnabledChannel); +GlobalDecoderRegistry.registerAminoProtoMapping(FeeEnabledChannel.aminoType, FeeEnabledChannel.typeUrl); function createBaseRegisteredPayee(): RegisteredPayee { return { channelId: "", @@ -383,6 +463,16 @@ function createBaseRegisteredPayee(): RegisteredPayee { } export const RegisteredPayee = { typeUrl: "/ibc.applications.fee.v1.RegisteredPayee", + aminoType: "cosmos-sdk/RegisteredPayee", + is(o: any): o is RegisteredPayee { + return o && (o.$typeUrl === RegisteredPayee.typeUrl || typeof o.channelId === "string" && typeof o.relayer === "string" && typeof o.payee === "string"); + }, + isSDK(o: any): o is RegisteredPayeeSDKType { + return o && (o.$typeUrl === RegisteredPayee.typeUrl || typeof o.channel_id === "string" && typeof o.relayer === "string" && typeof o.payee === "string"); + }, + isAmino(o: any): o is RegisteredPayeeAmino { + return o && (o.$typeUrl === RegisteredPayee.typeUrl || typeof o.channel_id === "string" && typeof o.relayer === "string" && typeof o.payee === "string"); + }, encode(message: RegisteredPayee, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.channelId !== "") { writer.uint32(10).string(message.channelId); @@ -418,6 +508,20 @@ export const RegisteredPayee = { } return message; }, + fromJSON(object: any): RegisteredPayee { + return { + channelId: isSet(object.channelId) ? String(object.channelId) : "", + relayer: isSet(object.relayer) ? String(object.relayer) : "", + payee: isSet(object.payee) ? String(object.payee) : "" + }; + }, + toJSON(message: RegisteredPayee): unknown { + const obj: any = {}; + message.channelId !== undefined && (obj.channelId = message.channelId); + message.relayer !== undefined && (obj.relayer = message.relayer); + message.payee !== undefined && (obj.payee = message.payee); + return obj; + }, fromPartial(object: Partial): RegisteredPayee { const message = createBaseRegisteredPayee(); message.channelId = object.channelId ?? ""; @@ -426,11 +530,17 @@ export const RegisteredPayee = { return message; }, fromAmino(object: RegisteredPayeeAmino): RegisteredPayee { - return { - channelId: object.channel_id, - relayer: object.relayer, - payee: object.payee - }; + const message = createBaseRegisteredPayee(); + if (object.channel_id !== undefined && object.channel_id !== null) { + message.channelId = object.channel_id; + } + if (object.relayer !== undefined && object.relayer !== null) { + message.relayer = object.relayer; + } + if (object.payee !== undefined && object.payee !== null) { + message.payee = object.payee; + } + return message; }, toAmino(message: RegisteredPayee): RegisteredPayeeAmino { const obj: any = {}; @@ -461,6 +571,8 @@ export const RegisteredPayee = { }; } }; +GlobalDecoderRegistry.register(RegisteredPayee.typeUrl, RegisteredPayee); +GlobalDecoderRegistry.registerAminoProtoMapping(RegisteredPayee.aminoType, RegisteredPayee.typeUrl); function createBaseRegisteredCounterpartyPayee(): RegisteredCounterpartyPayee { return { channelId: "", @@ -470,6 +582,16 @@ function createBaseRegisteredCounterpartyPayee(): RegisteredCounterpartyPayee { } export const RegisteredCounterpartyPayee = { typeUrl: "/ibc.applications.fee.v1.RegisteredCounterpartyPayee", + aminoType: "cosmos-sdk/RegisteredCounterpartyPayee", + is(o: any): o is RegisteredCounterpartyPayee { + return o && (o.$typeUrl === RegisteredCounterpartyPayee.typeUrl || typeof o.channelId === "string" && typeof o.relayer === "string" && typeof o.counterpartyPayee === "string"); + }, + isSDK(o: any): o is RegisteredCounterpartyPayeeSDKType { + return o && (o.$typeUrl === RegisteredCounterpartyPayee.typeUrl || typeof o.channel_id === "string" && typeof o.relayer === "string" && typeof o.counterparty_payee === "string"); + }, + isAmino(o: any): o is RegisteredCounterpartyPayeeAmino { + return o && (o.$typeUrl === RegisteredCounterpartyPayee.typeUrl || typeof o.channel_id === "string" && typeof o.relayer === "string" && typeof o.counterparty_payee === "string"); + }, encode(message: RegisteredCounterpartyPayee, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.channelId !== "") { writer.uint32(10).string(message.channelId); @@ -505,6 +627,20 @@ export const RegisteredCounterpartyPayee = { } return message; }, + fromJSON(object: any): RegisteredCounterpartyPayee { + return { + channelId: isSet(object.channelId) ? String(object.channelId) : "", + relayer: isSet(object.relayer) ? String(object.relayer) : "", + counterpartyPayee: isSet(object.counterpartyPayee) ? String(object.counterpartyPayee) : "" + }; + }, + toJSON(message: RegisteredCounterpartyPayee): unknown { + const obj: any = {}; + message.channelId !== undefined && (obj.channelId = message.channelId); + message.relayer !== undefined && (obj.relayer = message.relayer); + message.counterpartyPayee !== undefined && (obj.counterpartyPayee = message.counterpartyPayee); + return obj; + }, fromPartial(object: Partial): RegisteredCounterpartyPayee { const message = createBaseRegisteredCounterpartyPayee(); message.channelId = object.channelId ?? ""; @@ -513,11 +649,17 @@ export const RegisteredCounterpartyPayee = { return message; }, fromAmino(object: RegisteredCounterpartyPayeeAmino): RegisteredCounterpartyPayee { - return { - channelId: object.channel_id, - relayer: object.relayer, - counterpartyPayee: object.counterparty_payee - }; + const message = createBaseRegisteredCounterpartyPayee(); + if (object.channel_id !== undefined && object.channel_id !== null) { + message.channelId = object.channel_id; + } + if (object.relayer !== undefined && object.relayer !== null) { + message.relayer = object.relayer; + } + if (object.counterparty_payee !== undefined && object.counterparty_payee !== null) { + message.counterpartyPayee = object.counterparty_payee; + } + return message; }, toAmino(message: RegisteredCounterpartyPayee): RegisteredCounterpartyPayeeAmino { const obj: any = {}; @@ -548,6 +690,8 @@ export const RegisteredCounterpartyPayee = { }; } }; +GlobalDecoderRegistry.register(RegisteredCounterpartyPayee.typeUrl, RegisteredCounterpartyPayee); +GlobalDecoderRegistry.registerAminoProtoMapping(RegisteredCounterpartyPayee.aminoType, RegisteredCounterpartyPayee.typeUrl); function createBaseForwardRelayerAddress(): ForwardRelayerAddress { return { address: "", @@ -556,6 +700,16 @@ function createBaseForwardRelayerAddress(): ForwardRelayerAddress { } export const ForwardRelayerAddress = { typeUrl: "/ibc.applications.fee.v1.ForwardRelayerAddress", + aminoType: "cosmos-sdk/ForwardRelayerAddress", + is(o: any): o is ForwardRelayerAddress { + return o && (o.$typeUrl === ForwardRelayerAddress.typeUrl || typeof o.address === "string" && PacketId.is(o.packetId)); + }, + isSDK(o: any): o is ForwardRelayerAddressSDKType { + return o && (o.$typeUrl === ForwardRelayerAddress.typeUrl || typeof o.address === "string" && PacketId.isSDK(o.packet_id)); + }, + isAmino(o: any): o is ForwardRelayerAddressAmino { + return o && (o.$typeUrl === ForwardRelayerAddress.typeUrl || typeof o.address === "string" && PacketId.isAmino(o.packet_id)); + }, encode(message: ForwardRelayerAddress, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.address !== "") { writer.uint32(10).string(message.address); @@ -585,6 +739,18 @@ export const ForwardRelayerAddress = { } return message; }, + fromJSON(object: any): ForwardRelayerAddress { + return { + address: isSet(object.address) ? String(object.address) : "", + packetId: isSet(object.packetId) ? PacketId.fromJSON(object.packetId) : undefined + }; + }, + toJSON(message: ForwardRelayerAddress): unknown { + const obj: any = {}; + message.address !== undefined && (obj.address = message.address); + message.packetId !== undefined && (obj.packetId = message.packetId ? PacketId.toJSON(message.packetId) : undefined); + return obj; + }, fromPartial(object: Partial): ForwardRelayerAddress { const message = createBaseForwardRelayerAddress(); message.address = object.address ?? ""; @@ -592,10 +758,14 @@ export const ForwardRelayerAddress = { return message; }, fromAmino(object: ForwardRelayerAddressAmino): ForwardRelayerAddress { - return { - address: object.address, - packetId: object?.packet_id ? PacketId.fromAmino(object.packet_id) : undefined - }; + const message = createBaseForwardRelayerAddress(); + if (object.address !== undefined && object.address !== null) { + message.address = object.address; + } + if (object.packet_id !== undefined && object.packet_id !== null) { + message.packetId = PacketId.fromAmino(object.packet_id); + } + return message; }, toAmino(message: ForwardRelayerAddress): ForwardRelayerAddressAmino { const obj: any = {}; @@ -624,4 +794,6 @@ export const ForwardRelayerAddress = { value: ForwardRelayerAddress.encode(message).finish() }; } -}; \ No newline at end of file +}; +GlobalDecoderRegistry.register(ForwardRelayerAddress.typeUrl, ForwardRelayerAddress); +GlobalDecoderRegistry.registerAminoProtoMapping(ForwardRelayerAddress.aminoType, ForwardRelayerAddress.typeUrl); \ No newline at end of file diff --git a/packages/osmojs/src/codegen/ibc/applications/fee/v1/metadata.ts b/packages/osmojs/src/codegen/ibc/applications/fee/v1/metadata.ts index f552a2e2e..3a80567a9 100644 --- a/packages/osmojs/src/codegen/ibc/applications/fee/v1/metadata.ts +++ b/packages/osmojs/src/codegen/ibc/applications/fee/v1/metadata.ts @@ -1,4 +1,6 @@ import { BinaryReader, BinaryWriter } from "../../../../binary"; +import { isSet } from "../../../../helpers"; +import { GlobalDecoderRegistry } from "../../../../registry"; /** * Metadata defines the ICS29 channel specific metadata encoded into the channel version bytestring * See ICS004: https://github.com/cosmos/ibc/tree/master/spec/core/ics-004-channel-and-packet-semantics#Versioning @@ -19,9 +21,9 @@ export interface MetadataProtoMsg { */ export interface MetadataAmino { /** fee_version defines the ICS29 fee version */ - fee_version: string; + fee_version?: string; /** app_version defines the underlying application version, which may or may not be a JSON encoded bytestring */ - app_version: string; + app_version?: string; } export interface MetadataAminoMsg { type: "cosmos-sdk/Metadata"; @@ -43,6 +45,16 @@ function createBaseMetadata(): Metadata { } export const Metadata = { typeUrl: "/ibc.applications.fee.v1.Metadata", + aminoType: "cosmos-sdk/Metadata", + is(o: any): o is Metadata { + return o && (o.$typeUrl === Metadata.typeUrl || typeof o.feeVersion === "string" && typeof o.appVersion === "string"); + }, + isSDK(o: any): o is MetadataSDKType { + return o && (o.$typeUrl === Metadata.typeUrl || typeof o.fee_version === "string" && typeof o.app_version === "string"); + }, + isAmino(o: any): o is MetadataAmino { + return o && (o.$typeUrl === Metadata.typeUrl || typeof o.fee_version === "string" && typeof o.app_version === "string"); + }, encode(message: Metadata, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.feeVersion !== "") { writer.uint32(10).string(message.feeVersion); @@ -72,6 +84,18 @@ export const Metadata = { } return message; }, + fromJSON(object: any): Metadata { + return { + feeVersion: isSet(object.feeVersion) ? String(object.feeVersion) : "", + appVersion: isSet(object.appVersion) ? String(object.appVersion) : "" + }; + }, + toJSON(message: Metadata): unknown { + const obj: any = {}; + message.feeVersion !== undefined && (obj.feeVersion = message.feeVersion); + message.appVersion !== undefined && (obj.appVersion = message.appVersion); + return obj; + }, fromPartial(object: Partial): Metadata { const message = createBaseMetadata(); message.feeVersion = object.feeVersion ?? ""; @@ -79,10 +103,14 @@ export const Metadata = { return message; }, fromAmino(object: MetadataAmino): Metadata { - return { - feeVersion: object.fee_version, - appVersion: object.app_version - }; + const message = createBaseMetadata(); + if (object.fee_version !== undefined && object.fee_version !== null) { + message.feeVersion = object.fee_version; + } + if (object.app_version !== undefined && object.app_version !== null) { + message.appVersion = object.app_version; + } + return message; }, toAmino(message: Metadata): MetadataAmino { const obj: any = {}; @@ -111,4 +139,6 @@ export const Metadata = { value: Metadata.encode(message).finish() }; } -}; \ No newline at end of file +}; +GlobalDecoderRegistry.register(Metadata.typeUrl, Metadata); +GlobalDecoderRegistry.registerAminoProtoMapping(Metadata.aminoType, Metadata.typeUrl); \ No newline at end of file diff --git a/packages/osmojs/src/codegen/ibc/applications/fee/v1/query.ts b/packages/osmojs/src/codegen/ibc/applications/fee/v1/query.ts index e7593dd86..f52ccb8e5 100644 --- a/packages/osmojs/src/codegen/ibc/applications/fee/v1/query.ts +++ b/packages/osmojs/src/codegen/ibc/applications/fee/v1/query.ts @@ -4,10 +4,12 @@ import { IdentifiedPacketFees, IdentifiedPacketFeesAmino, IdentifiedPacketFeesSD import { Coin, CoinAmino, CoinSDKType } from "../../../../cosmos/base/v1beta1/coin"; import { FeeEnabledChannel, FeeEnabledChannelAmino, FeeEnabledChannelSDKType } from "./genesis"; import { BinaryReader, BinaryWriter } from "../../../../binary"; +import { isSet } from "../../../../helpers"; +import { GlobalDecoderRegistry } from "../../../../registry"; /** QueryIncentivizedPacketsRequest defines the request type for the IncentivizedPackets rpc */ export interface QueryIncentivizedPacketsRequest { /** pagination defines an optional pagination for the request. */ - pagination: PageRequest; + pagination?: PageRequest; /** block height at which to query */ queryHeight: bigint; } @@ -20,7 +22,7 @@ export interface QueryIncentivizedPacketsRequestAmino { /** pagination defines an optional pagination for the request. */ pagination?: PageRequestAmino; /** block height at which to query */ - query_height: string; + query_height?: string; } export interface QueryIncentivizedPacketsRequestAminoMsg { type: "cosmos-sdk/QueryIncentivizedPacketsRequest"; @@ -28,7 +30,7 @@ export interface QueryIncentivizedPacketsRequestAminoMsg { } /** QueryIncentivizedPacketsRequest defines the request type for the IncentivizedPackets rpc */ export interface QueryIncentivizedPacketsRequestSDKType { - pagination: PageRequestSDKType; + pagination?: PageRequestSDKType; query_height: bigint; } /** QueryIncentivizedPacketsResponse defines the response type for the IncentivizedPackets rpc */ @@ -36,7 +38,7 @@ export interface QueryIncentivizedPacketsResponse { /** list of identified fees for incentivized packets */ incentivizedPackets: IdentifiedPacketFees[]; /** pagination defines the pagination in the response. */ - pagination: PageResponse; + pagination?: PageResponse; } export interface QueryIncentivizedPacketsResponseProtoMsg { typeUrl: "/ibc.applications.fee.v1.QueryIncentivizedPacketsResponse"; @@ -45,7 +47,7 @@ export interface QueryIncentivizedPacketsResponseProtoMsg { /** QueryIncentivizedPacketsResponse defines the response type for the IncentivizedPackets rpc */ export interface QueryIncentivizedPacketsResponseAmino { /** list of identified fees for incentivized packets */ - incentivized_packets: IdentifiedPacketFeesAmino[]; + incentivized_packets?: IdentifiedPacketFeesAmino[]; /** pagination defines the pagination in the response. */ pagination?: PageResponseAmino; } @@ -56,7 +58,7 @@ export interface QueryIncentivizedPacketsResponseAminoMsg { /** QueryIncentivizedPacketsResponse defines the response type for the IncentivizedPackets rpc */ export interface QueryIncentivizedPacketsResponseSDKType { incentivized_packets: IdentifiedPacketFeesSDKType[]; - pagination: PageResponseSDKType; + pagination?: PageResponseSDKType; } /** QueryIncentivizedPacketRequest defines the request type for the IncentivizedPacket rpc */ export interface QueryIncentivizedPacketRequest { @@ -74,7 +76,7 @@ export interface QueryIncentivizedPacketRequestAmino { /** unique packet identifier comprised of channel ID, port ID and sequence */ packet_id?: PacketIdAmino; /** block height at which to query */ - query_height: string; + query_height?: string; } export interface QueryIncentivizedPacketRequestAminoMsg { type: "cosmos-sdk/QueryIncentivizedPacketRequest"; @@ -113,7 +115,7 @@ export interface QueryIncentivizedPacketResponseSDKType { */ export interface QueryIncentivizedPacketsForChannelRequest { /** pagination defines an optional pagination for the request. */ - pagination: PageRequest; + pagination?: PageRequest; portId: string; channelId: string; /** Height to query at */ @@ -130,10 +132,10 @@ export interface QueryIncentivizedPacketsForChannelRequestProtoMsg { export interface QueryIncentivizedPacketsForChannelRequestAmino { /** pagination defines an optional pagination for the request. */ pagination?: PageRequestAmino; - port_id: string; - channel_id: string; + port_id?: string; + channel_id?: string; /** Height to query at */ - query_height: string; + query_height?: string; } export interface QueryIncentivizedPacketsForChannelRequestAminoMsg { type: "cosmos-sdk/QueryIncentivizedPacketsForChannelRequest"; @@ -144,7 +146,7 @@ export interface QueryIncentivizedPacketsForChannelRequestAminoMsg { * for a specific channel */ export interface QueryIncentivizedPacketsForChannelRequestSDKType { - pagination: PageRequestSDKType; + pagination?: PageRequestSDKType; port_id: string; channel_id: string; query_height: bigint; @@ -154,7 +156,7 @@ export interface QueryIncentivizedPacketsForChannelResponse { /** Map of all incentivized_packets */ incentivizedPackets: IdentifiedPacketFees[]; /** pagination defines the pagination in the response. */ - pagination: PageResponse; + pagination?: PageResponse; } export interface QueryIncentivizedPacketsForChannelResponseProtoMsg { typeUrl: "/ibc.applications.fee.v1.QueryIncentivizedPacketsForChannelResponse"; @@ -163,7 +165,7 @@ export interface QueryIncentivizedPacketsForChannelResponseProtoMsg { /** QueryIncentivizedPacketsResponse defines the response type for the incentivized packets RPC */ export interface QueryIncentivizedPacketsForChannelResponseAmino { /** Map of all incentivized_packets */ - incentivized_packets: IdentifiedPacketFeesAmino[]; + incentivized_packets?: IdentifiedPacketFeesAmino[]; /** pagination defines the pagination in the response. */ pagination?: PageResponseAmino; } @@ -174,7 +176,7 @@ export interface QueryIncentivizedPacketsForChannelResponseAminoMsg { /** QueryIncentivizedPacketsResponse defines the response type for the incentivized packets RPC */ export interface QueryIncentivizedPacketsForChannelResponseSDKType { incentivized_packets: IdentifiedPacketFeesSDKType[]; - pagination: PageResponseSDKType; + pagination?: PageResponseSDKType; } /** QueryTotalRecvFeesRequest defines the request type for the TotalRecvFees rpc */ export interface QueryTotalRecvFeesRequest { @@ -210,7 +212,7 @@ export interface QueryTotalRecvFeesResponseProtoMsg { /** QueryTotalRecvFeesResponse defines the response type for the TotalRecvFees rpc */ export interface QueryTotalRecvFeesResponseAmino { /** the total packet receive fees */ - recv_fees: CoinAmino[]; + recv_fees?: CoinAmino[]; } export interface QueryTotalRecvFeesResponseAminoMsg { type: "cosmos-sdk/QueryTotalRecvFeesResponse"; @@ -254,7 +256,7 @@ export interface QueryTotalAckFeesResponseProtoMsg { /** QueryTotalAckFeesResponse defines the response type for the TotalAckFees rpc */ export interface QueryTotalAckFeesResponseAmino { /** the total packet acknowledgement fees */ - ack_fees: CoinAmino[]; + ack_fees?: CoinAmino[]; } export interface QueryTotalAckFeesResponseAminoMsg { type: "cosmos-sdk/QueryTotalAckFeesResponse"; @@ -298,7 +300,7 @@ export interface QueryTotalTimeoutFeesResponseProtoMsg { /** QueryTotalTimeoutFeesResponse defines the response type for the TotalTimeoutFees rpc */ export interface QueryTotalTimeoutFeesResponseAmino { /** the total packet timeout fees */ - timeout_fees: CoinAmino[]; + timeout_fees?: CoinAmino[]; } export interface QueryTotalTimeoutFeesResponseAminoMsg { type: "cosmos-sdk/QueryTotalTimeoutFeesResponse"; @@ -322,9 +324,9 @@ export interface QueryPayeeRequestProtoMsg { /** QueryPayeeRequest defines the request type for the Payee rpc */ export interface QueryPayeeRequestAmino { /** unique channel identifier */ - channel_id: string; + channel_id?: string; /** the relayer address to which the distribution address is registered */ - relayer: string; + relayer?: string; } export interface QueryPayeeRequestAminoMsg { type: "cosmos-sdk/QueryPayeeRequest"; @@ -347,7 +349,7 @@ export interface QueryPayeeResponseProtoMsg { /** QueryPayeeResponse defines the response type for the Payee rpc */ export interface QueryPayeeResponseAmino { /** the payee address to which packet fees are paid out */ - payee_address: string; + payee_address?: string; } export interface QueryPayeeResponseAminoMsg { type: "cosmos-sdk/QueryPayeeResponse"; @@ -371,9 +373,9 @@ export interface QueryCounterpartyPayeeRequestProtoMsg { /** QueryCounterpartyPayeeRequest defines the request type for the CounterpartyPayee rpc */ export interface QueryCounterpartyPayeeRequestAmino { /** unique channel identifier */ - channel_id: string; + channel_id?: string; /** the relayer address to which the counterparty is registered */ - relayer: string; + relayer?: string; } export interface QueryCounterpartyPayeeRequestAminoMsg { type: "cosmos-sdk/QueryCounterpartyPayeeRequest"; @@ -396,7 +398,7 @@ export interface QueryCounterpartyPayeeResponseProtoMsg { /** QueryCounterpartyPayeeResponse defines the response type for the CounterpartyPayee rpc */ export interface QueryCounterpartyPayeeResponseAmino { /** the counterparty payee address used to compensate forward relaying */ - counterparty_payee: string; + counterparty_payee?: string; } export interface QueryCounterpartyPayeeResponseAminoMsg { type: "cosmos-sdk/QueryCounterpartyPayeeResponse"; @@ -409,7 +411,7 @@ export interface QueryCounterpartyPayeeResponseSDKType { /** QueryFeeEnabledChannelsRequest defines the request type for the FeeEnabledChannels rpc */ export interface QueryFeeEnabledChannelsRequest { /** pagination defines an optional pagination for the request. */ - pagination: PageRequest; + pagination?: PageRequest; /** block height at which to query */ queryHeight: bigint; } @@ -422,7 +424,7 @@ export interface QueryFeeEnabledChannelsRequestAmino { /** pagination defines an optional pagination for the request. */ pagination?: PageRequestAmino; /** block height at which to query */ - query_height: string; + query_height?: string; } export interface QueryFeeEnabledChannelsRequestAminoMsg { type: "cosmos-sdk/QueryFeeEnabledChannelsRequest"; @@ -430,7 +432,7 @@ export interface QueryFeeEnabledChannelsRequestAminoMsg { } /** QueryFeeEnabledChannelsRequest defines the request type for the FeeEnabledChannels rpc */ export interface QueryFeeEnabledChannelsRequestSDKType { - pagination: PageRequestSDKType; + pagination?: PageRequestSDKType; query_height: bigint; } /** QueryFeeEnabledChannelsResponse defines the response type for the FeeEnabledChannels rpc */ @@ -438,7 +440,7 @@ export interface QueryFeeEnabledChannelsResponse { /** list of fee enabled channels */ feeEnabledChannels: FeeEnabledChannel[]; /** pagination defines the pagination in the response. */ - pagination: PageResponse; + pagination?: PageResponse; } export interface QueryFeeEnabledChannelsResponseProtoMsg { typeUrl: "/ibc.applications.fee.v1.QueryFeeEnabledChannelsResponse"; @@ -447,7 +449,7 @@ export interface QueryFeeEnabledChannelsResponseProtoMsg { /** QueryFeeEnabledChannelsResponse defines the response type for the FeeEnabledChannels rpc */ export interface QueryFeeEnabledChannelsResponseAmino { /** list of fee enabled channels */ - fee_enabled_channels: FeeEnabledChannelAmino[]; + fee_enabled_channels?: FeeEnabledChannelAmino[]; /** pagination defines the pagination in the response. */ pagination?: PageResponseAmino; } @@ -458,7 +460,7 @@ export interface QueryFeeEnabledChannelsResponseAminoMsg { /** QueryFeeEnabledChannelsResponse defines the response type for the FeeEnabledChannels rpc */ export interface QueryFeeEnabledChannelsResponseSDKType { fee_enabled_channels: FeeEnabledChannelSDKType[]; - pagination: PageResponseSDKType; + pagination?: PageResponseSDKType; } /** QueryFeeEnabledChannelRequest defines the request type for the FeeEnabledChannel rpc */ export interface QueryFeeEnabledChannelRequest { @@ -474,9 +476,9 @@ export interface QueryFeeEnabledChannelRequestProtoMsg { /** QueryFeeEnabledChannelRequest defines the request type for the FeeEnabledChannel rpc */ export interface QueryFeeEnabledChannelRequestAmino { /** unique port identifier */ - port_id: string; + port_id?: string; /** unique channel identifier */ - channel_id: string; + channel_id?: string; } export interface QueryFeeEnabledChannelRequestAminoMsg { type: "cosmos-sdk/QueryFeeEnabledChannelRequest"; @@ -499,7 +501,7 @@ export interface QueryFeeEnabledChannelResponseProtoMsg { /** QueryFeeEnabledChannelResponse defines the response type for the FeeEnabledChannel rpc */ export interface QueryFeeEnabledChannelResponseAmino { /** boolean flag representing the fee enabled channel status */ - fee_enabled: boolean; + fee_enabled?: boolean; } export interface QueryFeeEnabledChannelResponseAminoMsg { type: "cosmos-sdk/QueryFeeEnabledChannelResponse"; @@ -511,12 +513,22 @@ export interface QueryFeeEnabledChannelResponseSDKType { } function createBaseQueryIncentivizedPacketsRequest(): QueryIncentivizedPacketsRequest { return { - pagination: PageRequest.fromPartial({}), + pagination: undefined, queryHeight: BigInt(0) }; } export const QueryIncentivizedPacketsRequest = { typeUrl: "/ibc.applications.fee.v1.QueryIncentivizedPacketsRequest", + aminoType: "cosmos-sdk/QueryIncentivizedPacketsRequest", + is(o: any): o is QueryIncentivizedPacketsRequest { + return o && (o.$typeUrl === QueryIncentivizedPacketsRequest.typeUrl || typeof o.queryHeight === "bigint"); + }, + isSDK(o: any): o is QueryIncentivizedPacketsRequestSDKType { + return o && (o.$typeUrl === QueryIncentivizedPacketsRequest.typeUrl || typeof o.query_height === "bigint"); + }, + isAmino(o: any): o is QueryIncentivizedPacketsRequestAmino { + return o && (o.$typeUrl === QueryIncentivizedPacketsRequest.typeUrl || typeof o.query_height === "bigint"); + }, encode(message: QueryIncentivizedPacketsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.pagination !== undefined) { PageRequest.encode(message.pagination, writer.uint32(10).fork()).ldelim(); @@ -546,6 +558,18 @@ export const QueryIncentivizedPacketsRequest = { } return message; }, + fromJSON(object: any): QueryIncentivizedPacketsRequest { + return { + pagination: isSet(object.pagination) ? PageRequest.fromJSON(object.pagination) : undefined, + queryHeight: isSet(object.queryHeight) ? BigInt(object.queryHeight.toString()) : BigInt(0) + }; + }, + toJSON(message: QueryIncentivizedPacketsRequest): unknown { + const obj: any = {}; + message.pagination !== undefined && (obj.pagination = message.pagination ? PageRequest.toJSON(message.pagination) : undefined); + message.queryHeight !== undefined && (obj.queryHeight = (message.queryHeight || BigInt(0)).toString()); + return obj; + }, fromPartial(object: Partial): QueryIncentivizedPacketsRequest { const message = createBaseQueryIncentivizedPacketsRequest(); message.pagination = object.pagination !== undefined && object.pagination !== null ? PageRequest.fromPartial(object.pagination) : undefined; @@ -553,10 +577,14 @@ export const QueryIncentivizedPacketsRequest = { return message; }, fromAmino(object: QueryIncentivizedPacketsRequestAmino): QueryIncentivizedPacketsRequest { - return { - pagination: object?.pagination ? PageRequest.fromAmino(object.pagination) : undefined, - queryHeight: BigInt(object.query_height) - }; + const message = createBaseQueryIncentivizedPacketsRequest(); + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromAmino(object.pagination); + } + if (object.query_height !== undefined && object.query_height !== null) { + message.queryHeight = BigInt(object.query_height); + } + return message; }, toAmino(message: QueryIncentivizedPacketsRequest): QueryIncentivizedPacketsRequestAmino { const obj: any = {}; @@ -586,14 +614,26 @@ export const QueryIncentivizedPacketsRequest = { }; } }; +GlobalDecoderRegistry.register(QueryIncentivizedPacketsRequest.typeUrl, QueryIncentivizedPacketsRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryIncentivizedPacketsRequest.aminoType, QueryIncentivizedPacketsRequest.typeUrl); function createBaseQueryIncentivizedPacketsResponse(): QueryIncentivizedPacketsResponse { return { incentivizedPackets: [], - pagination: PageResponse.fromPartial({}) + pagination: undefined }; } export const QueryIncentivizedPacketsResponse = { typeUrl: "/ibc.applications.fee.v1.QueryIncentivizedPacketsResponse", + aminoType: "cosmos-sdk/QueryIncentivizedPacketsResponse", + is(o: any): o is QueryIncentivizedPacketsResponse { + return o && (o.$typeUrl === QueryIncentivizedPacketsResponse.typeUrl || Array.isArray(o.incentivizedPackets) && (!o.incentivizedPackets.length || IdentifiedPacketFees.is(o.incentivizedPackets[0]))); + }, + isSDK(o: any): o is QueryIncentivizedPacketsResponseSDKType { + return o && (o.$typeUrl === QueryIncentivizedPacketsResponse.typeUrl || Array.isArray(o.incentivized_packets) && (!o.incentivized_packets.length || IdentifiedPacketFees.isSDK(o.incentivized_packets[0]))); + }, + isAmino(o: any): o is QueryIncentivizedPacketsResponseAmino { + return o && (o.$typeUrl === QueryIncentivizedPacketsResponse.typeUrl || Array.isArray(o.incentivized_packets) && (!o.incentivized_packets.length || IdentifiedPacketFees.isAmino(o.incentivized_packets[0]))); + }, encode(message: QueryIncentivizedPacketsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.incentivizedPackets) { IdentifiedPacketFees.encode(v!, writer.uint32(10).fork()).ldelim(); @@ -623,6 +663,22 @@ export const QueryIncentivizedPacketsResponse = { } return message; }, + fromJSON(object: any): QueryIncentivizedPacketsResponse { + return { + incentivizedPackets: Array.isArray(object?.incentivizedPackets) ? object.incentivizedPackets.map((e: any) => IdentifiedPacketFees.fromJSON(e)) : [], + pagination: isSet(object.pagination) ? PageResponse.fromJSON(object.pagination) : undefined + }; + }, + toJSON(message: QueryIncentivizedPacketsResponse): unknown { + const obj: any = {}; + if (message.incentivizedPackets) { + obj.incentivizedPackets = message.incentivizedPackets.map(e => e ? IdentifiedPacketFees.toJSON(e) : undefined); + } else { + obj.incentivizedPackets = []; + } + message.pagination !== undefined && (obj.pagination = message.pagination ? PageResponse.toJSON(message.pagination) : undefined); + return obj; + }, fromPartial(object: Partial): QueryIncentivizedPacketsResponse { const message = createBaseQueryIncentivizedPacketsResponse(); message.incentivizedPackets = object.incentivizedPackets?.map(e => IdentifiedPacketFees.fromPartial(e)) || []; @@ -630,10 +686,12 @@ export const QueryIncentivizedPacketsResponse = { return message; }, fromAmino(object: QueryIncentivizedPacketsResponseAmino): QueryIncentivizedPacketsResponse { - return { - incentivizedPackets: Array.isArray(object?.incentivized_packets) ? object.incentivized_packets.map((e: any) => IdentifiedPacketFees.fromAmino(e)) : [], - pagination: object?.pagination ? PageResponse.fromAmino(object.pagination) : undefined - }; + const message = createBaseQueryIncentivizedPacketsResponse(); + message.incentivizedPackets = object.incentivized_packets?.map(e => IdentifiedPacketFees.fromAmino(e)) || []; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromAmino(object.pagination); + } + return message; }, toAmino(message: QueryIncentivizedPacketsResponse): QueryIncentivizedPacketsResponseAmino { const obj: any = {}; @@ -667,6 +725,8 @@ export const QueryIncentivizedPacketsResponse = { }; } }; +GlobalDecoderRegistry.register(QueryIncentivizedPacketsResponse.typeUrl, QueryIncentivizedPacketsResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryIncentivizedPacketsResponse.aminoType, QueryIncentivizedPacketsResponse.typeUrl); function createBaseQueryIncentivizedPacketRequest(): QueryIncentivizedPacketRequest { return { packetId: PacketId.fromPartial({}), @@ -675,6 +735,16 @@ function createBaseQueryIncentivizedPacketRequest(): QueryIncentivizedPacketRequ } export const QueryIncentivizedPacketRequest = { typeUrl: "/ibc.applications.fee.v1.QueryIncentivizedPacketRequest", + aminoType: "cosmos-sdk/QueryIncentivizedPacketRequest", + is(o: any): o is QueryIncentivizedPacketRequest { + return o && (o.$typeUrl === QueryIncentivizedPacketRequest.typeUrl || PacketId.is(o.packetId) && typeof o.queryHeight === "bigint"); + }, + isSDK(o: any): o is QueryIncentivizedPacketRequestSDKType { + return o && (o.$typeUrl === QueryIncentivizedPacketRequest.typeUrl || PacketId.isSDK(o.packet_id) && typeof o.query_height === "bigint"); + }, + isAmino(o: any): o is QueryIncentivizedPacketRequestAmino { + return o && (o.$typeUrl === QueryIncentivizedPacketRequest.typeUrl || PacketId.isAmino(o.packet_id) && typeof o.query_height === "bigint"); + }, encode(message: QueryIncentivizedPacketRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.packetId !== undefined) { PacketId.encode(message.packetId, writer.uint32(10).fork()).ldelim(); @@ -704,6 +774,18 @@ export const QueryIncentivizedPacketRequest = { } return message; }, + fromJSON(object: any): QueryIncentivizedPacketRequest { + return { + packetId: isSet(object.packetId) ? PacketId.fromJSON(object.packetId) : undefined, + queryHeight: isSet(object.queryHeight) ? BigInt(object.queryHeight.toString()) : BigInt(0) + }; + }, + toJSON(message: QueryIncentivizedPacketRequest): unknown { + const obj: any = {}; + message.packetId !== undefined && (obj.packetId = message.packetId ? PacketId.toJSON(message.packetId) : undefined); + message.queryHeight !== undefined && (obj.queryHeight = (message.queryHeight || BigInt(0)).toString()); + return obj; + }, fromPartial(object: Partial): QueryIncentivizedPacketRequest { const message = createBaseQueryIncentivizedPacketRequest(); message.packetId = object.packetId !== undefined && object.packetId !== null ? PacketId.fromPartial(object.packetId) : undefined; @@ -711,10 +793,14 @@ export const QueryIncentivizedPacketRequest = { return message; }, fromAmino(object: QueryIncentivizedPacketRequestAmino): QueryIncentivizedPacketRequest { - return { - packetId: object?.packet_id ? PacketId.fromAmino(object.packet_id) : undefined, - queryHeight: BigInt(object.query_height) - }; + const message = createBaseQueryIncentivizedPacketRequest(); + if (object.packet_id !== undefined && object.packet_id !== null) { + message.packetId = PacketId.fromAmino(object.packet_id); + } + if (object.query_height !== undefined && object.query_height !== null) { + message.queryHeight = BigInt(object.query_height); + } + return message; }, toAmino(message: QueryIncentivizedPacketRequest): QueryIncentivizedPacketRequestAmino { const obj: any = {}; @@ -744,6 +830,8 @@ export const QueryIncentivizedPacketRequest = { }; } }; +GlobalDecoderRegistry.register(QueryIncentivizedPacketRequest.typeUrl, QueryIncentivizedPacketRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryIncentivizedPacketRequest.aminoType, QueryIncentivizedPacketRequest.typeUrl); function createBaseQueryIncentivizedPacketResponse(): QueryIncentivizedPacketResponse { return { incentivizedPacket: IdentifiedPacketFees.fromPartial({}) @@ -751,6 +839,16 @@ function createBaseQueryIncentivizedPacketResponse(): QueryIncentivizedPacketRes } export const QueryIncentivizedPacketResponse = { typeUrl: "/ibc.applications.fee.v1.QueryIncentivizedPacketResponse", + aminoType: "cosmos-sdk/QueryIncentivizedPacketResponse", + is(o: any): o is QueryIncentivizedPacketResponse { + return o && (o.$typeUrl === QueryIncentivizedPacketResponse.typeUrl || IdentifiedPacketFees.is(o.incentivizedPacket)); + }, + isSDK(o: any): o is QueryIncentivizedPacketResponseSDKType { + return o && (o.$typeUrl === QueryIncentivizedPacketResponse.typeUrl || IdentifiedPacketFees.isSDK(o.incentivized_packet)); + }, + isAmino(o: any): o is QueryIncentivizedPacketResponseAmino { + return o && (o.$typeUrl === QueryIncentivizedPacketResponse.typeUrl || IdentifiedPacketFees.isAmino(o.incentivized_packet)); + }, encode(message: QueryIncentivizedPacketResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.incentivizedPacket !== undefined) { IdentifiedPacketFees.encode(message.incentivizedPacket, writer.uint32(10).fork()).ldelim(); @@ -774,15 +872,27 @@ export const QueryIncentivizedPacketResponse = { } return message; }, + fromJSON(object: any): QueryIncentivizedPacketResponse { + return { + incentivizedPacket: isSet(object.incentivizedPacket) ? IdentifiedPacketFees.fromJSON(object.incentivizedPacket) : undefined + }; + }, + toJSON(message: QueryIncentivizedPacketResponse): unknown { + const obj: any = {}; + message.incentivizedPacket !== undefined && (obj.incentivizedPacket = message.incentivizedPacket ? IdentifiedPacketFees.toJSON(message.incentivizedPacket) : undefined); + return obj; + }, fromPartial(object: Partial): QueryIncentivizedPacketResponse { const message = createBaseQueryIncentivizedPacketResponse(); message.incentivizedPacket = object.incentivizedPacket !== undefined && object.incentivizedPacket !== null ? IdentifiedPacketFees.fromPartial(object.incentivizedPacket) : undefined; return message; }, fromAmino(object: QueryIncentivizedPacketResponseAmino): QueryIncentivizedPacketResponse { - return { - incentivizedPacket: object?.incentivized_packet ? IdentifiedPacketFees.fromAmino(object.incentivized_packet) : undefined - }; + const message = createBaseQueryIncentivizedPacketResponse(); + if (object.incentivized_packet !== undefined && object.incentivized_packet !== null) { + message.incentivizedPacket = IdentifiedPacketFees.fromAmino(object.incentivized_packet); + } + return message; }, toAmino(message: QueryIncentivizedPacketResponse): QueryIncentivizedPacketResponseAmino { const obj: any = {}; @@ -811,9 +921,11 @@ export const QueryIncentivizedPacketResponse = { }; } }; +GlobalDecoderRegistry.register(QueryIncentivizedPacketResponse.typeUrl, QueryIncentivizedPacketResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryIncentivizedPacketResponse.aminoType, QueryIncentivizedPacketResponse.typeUrl); function createBaseQueryIncentivizedPacketsForChannelRequest(): QueryIncentivizedPacketsForChannelRequest { return { - pagination: PageRequest.fromPartial({}), + pagination: undefined, portId: "", channelId: "", queryHeight: BigInt(0) @@ -821,6 +933,16 @@ function createBaseQueryIncentivizedPacketsForChannelRequest(): QueryIncentivize } export const QueryIncentivizedPacketsForChannelRequest = { typeUrl: "/ibc.applications.fee.v1.QueryIncentivizedPacketsForChannelRequest", + aminoType: "cosmos-sdk/QueryIncentivizedPacketsForChannelRequest", + is(o: any): o is QueryIncentivizedPacketsForChannelRequest { + return o && (o.$typeUrl === QueryIncentivizedPacketsForChannelRequest.typeUrl || typeof o.portId === "string" && typeof o.channelId === "string" && typeof o.queryHeight === "bigint"); + }, + isSDK(o: any): o is QueryIncentivizedPacketsForChannelRequestSDKType { + return o && (o.$typeUrl === QueryIncentivizedPacketsForChannelRequest.typeUrl || typeof o.port_id === "string" && typeof o.channel_id === "string" && typeof o.query_height === "bigint"); + }, + isAmino(o: any): o is QueryIncentivizedPacketsForChannelRequestAmino { + return o && (o.$typeUrl === QueryIncentivizedPacketsForChannelRequest.typeUrl || typeof o.port_id === "string" && typeof o.channel_id === "string" && typeof o.query_height === "bigint"); + }, encode(message: QueryIncentivizedPacketsForChannelRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.pagination !== undefined) { PageRequest.encode(message.pagination, writer.uint32(10).fork()).ldelim(); @@ -862,6 +984,22 @@ export const QueryIncentivizedPacketsForChannelRequest = { } return message; }, + fromJSON(object: any): QueryIncentivizedPacketsForChannelRequest { + return { + pagination: isSet(object.pagination) ? PageRequest.fromJSON(object.pagination) : undefined, + portId: isSet(object.portId) ? String(object.portId) : "", + channelId: isSet(object.channelId) ? String(object.channelId) : "", + queryHeight: isSet(object.queryHeight) ? BigInt(object.queryHeight.toString()) : BigInt(0) + }; + }, + toJSON(message: QueryIncentivizedPacketsForChannelRequest): unknown { + const obj: any = {}; + message.pagination !== undefined && (obj.pagination = message.pagination ? PageRequest.toJSON(message.pagination) : undefined); + message.portId !== undefined && (obj.portId = message.portId); + message.channelId !== undefined && (obj.channelId = message.channelId); + message.queryHeight !== undefined && (obj.queryHeight = (message.queryHeight || BigInt(0)).toString()); + return obj; + }, fromPartial(object: Partial): QueryIncentivizedPacketsForChannelRequest { const message = createBaseQueryIncentivizedPacketsForChannelRequest(); message.pagination = object.pagination !== undefined && object.pagination !== null ? PageRequest.fromPartial(object.pagination) : undefined; @@ -871,12 +1009,20 @@ export const QueryIncentivizedPacketsForChannelRequest = { return message; }, fromAmino(object: QueryIncentivizedPacketsForChannelRequestAmino): QueryIncentivizedPacketsForChannelRequest { - return { - pagination: object?.pagination ? PageRequest.fromAmino(object.pagination) : undefined, - portId: object.port_id, - channelId: object.channel_id, - queryHeight: BigInt(object.query_height) - }; + const message = createBaseQueryIncentivizedPacketsForChannelRequest(); + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromAmino(object.pagination); + } + if (object.port_id !== undefined && object.port_id !== null) { + message.portId = object.port_id; + } + if (object.channel_id !== undefined && object.channel_id !== null) { + message.channelId = object.channel_id; + } + if (object.query_height !== undefined && object.query_height !== null) { + message.queryHeight = BigInt(object.query_height); + } + return message; }, toAmino(message: QueryIncentivizedPacketsForChannelRequest): QueryIncentivizedPacketsForChannelRequestAmino { const obj: any = {}; @@ -908,14 +1054,26 @@ export const QueryIncentivizedPacketsForChannelRequest = { }; } }; +GlobalDecoderRegistry.register(QueryIncentivizedPacketsForChannelRequest.typeUrl, QueryIncentivizedPacketsForChannelRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryIncentivizedPacketsForChannelRequest.aminoType, QueryIncentivizedPacketsForChannelRequest.typeUrl); function createBaseQueryIncentivizedPacketsForChannelResponse(): QueryIncentivizedPacketsForChannelResponse { return { incentivizedPackets: [], - pagination: PageResponse.fromPartial({}) + pagination: undefined }; } export const QueryIncentivizedPacketsForChannelResponse = { typeUrl: "/ibc.applications.fee.v1.QueryIncentivizedPacketsForChannelResponse", + aminoType: "cosmos-sdk/QueryIncentivizedPacketsForChannelResponse", + is(o: any): o is QueryIncentivizedPacketsForChannelResponse { + return o && (o.$typeUrl === QueryIncentivizedPacketsForChannelResponse.typeUrl || Array.isArray(o.incentivizedPackets) && (!o.incentivizedPackets.length || IdentifiedPacketFees.is(o.incentivizedPackets[0]))); + }, + isSDK(o: any): o is QueryIncentivizedPacketsForChannelResponseSDKType { + return o && (o.$typeUrl === QueryIncentivizedPacketsForChannelResponse.typeUrl || Array.isArray(o.incentivized_packets) && (!o.incentivized_packets.length || IdentifiedPacketFees.isSDK(o.incentivized_packets[0]))); + }, + isAmino(o: any): o is QueryIncentivizedPacketsForChannelResponseAmino { + return o && (o.$typeUrl === QueryIncentivizedPacketsForChannelResponse.typeUrl || Array.isArray(o.incentivized_packets) && (!o.incentivized_packets.length || IdentifiedPacketFees.isAmino(o.incentivized_packets[0]))); + }, encode(message: QueryIncentivizedPacketsForChannelResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.incentivizedPackets) { IdentifiedPacketFees.encode(v!, writer.uint32(10).fork()).ldelim(); @@ -945,6 +1103,22 @@ export const QueryIncentivizedPacketsForChannelResponse = { } return message; }, + fromJSON(object: any): QueryIncentivizedPacketsForChannelResponse { + return { + incentivizedPackets: Array.isArray(object?.incentivizedPackets) ? object.incentivizedPackets.map((e: any) => IdentifiedPacketFees.fromJSON(e)) : [], + pagination: isSet(object.pagination) ? PageResponse.fromJSON(object.pagination) : undefined + }; + }, + toJSON(message: QueryIncentivizedPacketsForChannelResponse): unknown { + const obj: any = {}; + if (message.incentivizedPackets) { + obj.incentivizedPackets = message.incentivizedPackets.map(e => e ? IdentifiedPacketFees.toJSON(e) : undefined); + } else { + obj.incentivizedPackets = []; + } + message.pagination !== undefined && (obj.pagination = message.pagination ? PageResponse.toJSON(message.pagination) : undefined); + return obj; + }, fromPartial(object: Partial): QueryIncentivizedPacketsForChannelResponse { const message = createBaseQueryIncentivizedPacketsForChannelResponse(); message.incentivizedPackets = object.incentivizedPackets?.map(e => IdentifiedPacketFees.fromPartial(e)) || []; @@ -952,10 +1126,12 @@ export const QueryIncentivizedPacketsForChannelResponse = { return message; }, fromAmino(object: QueryIncentivizedPacketsForChannelResponseAmino): QueryIncentivizedPacketsForChannelResponse { - return { - incentivizedPackets: Array.isArray(object?.incentivized_packets) ? object.incentivized_packets.map((e: any) => IdentifiedPacketFees.fromAmino(e)) : [], - pagination: object?.pagination ? PageResponse.fromAmino(object.pagination) : undefined - }; + const message = createBaseQueryIncentivizedPacketsForChannelResponse(); + message.incentivizedPackets = object.incentivized_packets?.map(e => IdentifiedPacketFees.fromAmino(e)) || []; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromAmino(object.pagination); + } + return message; }, toAmino(message: QueryIncentivizedPacketsForChannelResponse): QueryIncentivizedPacketsForChannelResponseAmino { const obj: any = {}; @@ -989,6 +1165,8 @@ export const QueryIncentivizedPacketsForChannelResponse = { }; } }; +GlobalDecoderRegistry.register(QueryIncentivizedPacketsForChannelResponse.typeUrl, QueryIncentivizedPacketsForChannelResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryIncentivizedPacketsForChannelResponse.aminoType, QueryIncentivizedPacketsForChannelResponse.typeUrl); function createBaseQueryTotalRecvFeesRequest(): QueryTotalRecvFeesRequest { return { packetId: PacketId.fromPartial({}) @@ -996,6 +1174,16 @@ function createBaseQueryTotalRecvFeesRequest(): QueryTotalRecvFeesRequest { } export const QueryTotalRecvFeesRequest = { typeUrl: "/ibc.applications.fee.v1.QueryTotalRecvFeesRequest", + aminoType: "cosmos-sdk/QueryTotalRecvFeesRequest", + is(o: any): o is QueryTotalRecvFeesRequest { + return o && (o.$typeUrl === QueryTotalRecvFeesRequest.typeUrl || PacketId.is(o.packetId)); + }, + isSDK(o: any): o is QueryTotalRecvFeesRequestSDKType { + return o && (o.$typeUrl === QueryTotalRecvFeesRequest.typeUrl || PacketId.isSDK(o.packet_id)); + }, + isAmino(o: any): o is QueryTotalRecvFeesRequestAmino { + return o && (o.$typeUrl === QueryTotalRecvFeesRequest.typeUrl || PacketId.isAmino(o.packet_id)); + }, encode(message: QueryTotalRecvFeesRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.packetId !== undefined) { PacketId.encode(message.packetId, writer.uint32(10).fork()).ldelim(); @@ -1019,15 +1207,27 @@ export const QueryTotalRecvFeesRequest = { } return message; }, + fromJSON(object: any): QueryTotalRecvFeesRequest { + return { + packetId: isSet(object.packetId) ? PacketId.fromJSON(object.packetId) : undefined + }; + }, + toJSON(message: QueryTotalRecvFeesRequest): unknown { + const obj: any = {}; + message.packetId !== undefined && (obj.packetId = message.packetId ? PacketId.toJSON(message.packetId) : undefined); + return obj; + }, fromPartial(object: Partial): QueryTotalRecvFeesRequest { const message = createBaseQueryTotalRecvFeesRequest(); message.packetId = object.packetId !== undefined && object.packetId !== null ? PacketId.fromPartial(object.packetId) : undefined; return message; }, fromAmino(object: QueryTotalRecvFeesRequestAmino): QueryTotalRecvFeesRequest { - return { - packetId: object?.packet_id ? PacketId.fromAmino(object.packet_id) : undefined - }; + const message = createBaseQueryTotalRecvFeesRequest(); + if (object.packet_id !== undefined && object.packet_id !== null) { + message.packetId = PacketId.fromAmino(object.packet_id); + } + return message; }, toAmino(message: QueryTotalRecvFeesRequest): QueryTotalRecvFeesRequestAmino { const obj: any = {}; @@ -1056,6 +1256,8 @@ export const QueryTotalRecvFeesRequest = { }; } }; +GlobalDecoderRegistry.register(QueryTotalRecvFeesRequest.typeUrl, QueryTotalRecvFeesRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryTotalRecvFeesRequest.aminoType, QueryTotalRecvFeesRequest.typeUrl); function createBaseQueryTotalRecvFeesResponse(): QueryTotalRecvFeesResponse { return { recvFees: [] @@ -1063,6 +1265,16 @@ function createBaseQueryTotalRecvFeesResponse(): QueryTotalRecvFeesResponse { } export const QueryTotalRecvFeesResponse = { typeUrl: "/ibc.applications.fee.v1.QueryTotalRecvFeesResponse", + aminoType: "cosmos-sdk/QueryTotalRecvFeesResponse", + is(o: any): o is QueryTotalRecvFeesResponse { + return o && (o.$typeUrl === QueryTotalRecvFeesResponse.typeUrl || Array.isArray(o.recvFees) && (!o.recvFees.length || Coin.is(o.recvFees[0]))); + }, + isSDK(o: any): o is QueryTotalRecvFeesResponseSDKType { + return o && (o.$typeUrl === QueryTotalRecvFeesResponse.typeUrl || Array.isArray(o.recv_fees) && (!o.recv_fees.length || Coin.isSDK(o.recv_fees[0]))); + }, + isAmino(o: any): o is QueryTotalRecvFeesResponseAmino { + return o && (o.$typeUrl === QueryTotalRecvFeesResponse.typeUrl || Array.isArray(o.recv_fees) && (!o.recv_fees.length || Coin.isAmino(o.recv_fees[0]))); + }, encode(message: QueryTotalRecvFeesResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.recvFees) { Coin.encode(v!, writer.uint32(10).fork()).ldelim(); @@ -1086,15 +1298,29 @@ export const QueryTotalRecvFeesResponse = { } return message; }, + fromJSON(object: any): QueryTotalRecvFeesResponse { + return { + recvFees: Array.isArray(object?.recvFees) ? object.recvFees.map((e: any) => Coin.fromJSON(e)) : [] + }; + }, + toJSON(message: QueryTotalRecvFeesResponse): unknown { + const obj: any = {}; + if (message.recvFees) { + obj.recvFees = message.recvFees.map(e => e ? Coin.toJSON(e) : undefined); + } else { + obj.recvFees = []; + } + return obj; + }, fromPartial(object: Partial): QueryTotalRecvFeesResponse { const message = createBaseQueryTotalRecvFeesResponse(); message.recvFees = object.recvFees?.map(e => Coin.fromPartial(e)) || []; return message; }, fromAmino(object: QueryTotalRecvFeesResponseAmino): QueryTotalRecvFeesResponse { - return { - recvFees: Array.isArray(object?.recv_fees) ? object.recv_fees.map((e: any) => Coin.fromAmino(e)) : [] - }; + const message = createBaseQueryTotalRecvFeesResponse(); + message.recvFees = object.recv_fees?.map(e => Coin.fromAmino(e)) || []; + return message; }, toAmino(message: QueryTotalRecvFeesResponse): QueryTotalRecvFeesResponseAmino { const obj: any = {}; @@ -1127,6 +1353,8 @@ export const QueryTotalRecvFeesResponse = { }; } }; +GlobalDecoderRegistry.register(QueryTotalRecvFeesResponse.typeUrl, QueryTotalRecvFeesResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryTotalRecvFeesResponse.aminoType, QueryTotalRecvFeesResponse.typeUrl); function createBaseQueryTotalAckFeesRequest(): QueryTotalAckFeesRequest { return { packetId: PacketId.fromPartial({}) @@ -1134,6 +1362,16 @@ function createBaseQueryTotalAckFeesRequest(): QueryTotalAckFeesRequest { } export const QueryTotalAckFeesRequest = { typeUrl: "/ibc.applications.fee.v1.QueryTotalAckFeesRequest", + aminoType: "cosmos-sdk/QueryTotalAckFeesRequest", + is(o: any): o is QueryTotalAckFeesRequest { + return o && (o.$typeUrl === QueryTotalAckFeesRequest.typeUrl || PacketId.is(o.packetId)); + }, + isSDK(o: any): o is QueryTotalAckFeesRequestSDKType { + return o && (o.$typeUrl === QueryTotalAckFeesRequest.typeUrl || PacketId.isSDK(o.packet_id)); + }, + isAmino(o: any): o is QueryTotalAckFeesRequestAmino { + return o && (o.$typeUrl === QueryTotalAckFeesRequest.typeUrl || PacketId.isAmino(o.packet_id)); + }, encode(message: QueryTotalAckFeesRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.packetId !== undefined) { PacketId.encode(message.packetId, writer.uint32(10).fork()).ldelim(); @@ -1157,15 +1395,27 @@ export const QueryTotalAckFeesRequest = { } return message; }, + fromJSON(object: any): QueryTotalAckFeesRequest { + return { + packetId: isSet(object.packetId) ? PacketId.fromJSON(object.packetId) : undefined + }; + }, + toJSON(message: QueryTotalAckFeesRequest): unknown { + const obj: any = {}; + message.packetId !== undefined && (obj.packetId = message.packetId ? PacketId.toJSON(message.packetId) : undefined); + return obj; + }, fromPartial(object: Partial): QueryTotalAckFeesRequest { const message = createBaseQueryTotalAckFeesRequest(); message.packetId = object.packetId !== undefined && object.packetId !== null ? PacketId.fromPartial(object.packetId) : undefined; return message; }, fromAmino(object: QueryTotalAckFeesRequestAmino): QueryTotalAckFeesRequest { - return { - packetId: object?.packet_id ? PacketId.fromAmino(object.packet_id) : undefined - }; + const message = createBaseQueryTotalAckFeesRequest(); + if (object.packet_id !== undefined && object.packet_id !== null) { + message.packetId = PacketId.fromAmino(object.packet_id); + } + return message; }, toAmino(message: QueryTotalAckFeesRequest): QueryTotalAckFeesRequestAmino { const obj: any = {}; @@ -1194,6 +1444,8 @@ export const QueryTotalAckFeesRequest = { }; } }; +GlobalDecoderRegistry.register(QueryTotalAckFeesRequest.typeUrl, QueryTotalAckFeesRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryTotalAckFeesRequest.aminoType, QueryTotalAckFeesRequest.typeUrl); function createBaseQueryTotalAckFeesResponse(): QueryTotalAckFeesResponse { return { ackFees: [] @@ -1201,6 +1453,16 @@ function createBaseQueryTotalAckFeesResponse(): QueryTotalAckFeesResponse { } export const QueryTotalAckFeesResponse = { typeUrl: "/ibc.applications.fee.v1.QueryTotalAckFeesResponse", + aminoType: "cosmos-sdk/QueryTotalAckFeesResponse", + is(o: any): o is QueryTotalAckFeesResponse { + return o && (o.$typeUrl === QueryTotalAckFeesResponse.typeUrl || Array.isArray(o.ackFees) && (!o.ackFees.length || Coin.is(o.ackFees[0]))); + }, + isSDK(o: any): o is QueryTotalAckFeesResponseSDKType { + return o && (o.$typeUrl === QueryTotalAckFeesResponse.typeUrl || Array.isArray(o.ack_fees) && (!o.ack_fees.length || Coin.isSDK(o.ack_fees[0]))); + }, + isAmino(o: any): o is QueryTotalAckFeesResponseAmino { + return o && (o.$typeUrl === QueryTotalAckFeesResponse.typeUrl || Array.isArray(o.ack_fees) && (!o.ack_fees.length || Coin.isAmino(o.ack_fees[0]))); + }, encode(message: QueryTotalAckFeesResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.ackFees) { Coin.encode(v!, writer.uint32(10).fork()).ldelim(); @@ -1224,15 +1486,29 @@ export const QueryTotalAckFeesResponse = { } return message; }, + fromJSON(object: any): QueryTotalAckFeesResponse { + return { + ackFees: Array.isArray(object?.ackFees) ? object.ackFees.map((e: any) => Coin.fromJSON(e)) : [] + }; + }, + toJSON(message: QueryTotalAckFeesResponse): unknown { + const obj: any = {}; + if (message.ackFees) { + obj.ackFees = message.ackFees.map(e => e ? Coin.toJSON(e) : undefined); + } else { + obj.ackFees = []; + } + return obj; + }, fromPartial(object: Partial): QueryTotalAckFeesResponse { const message = createBaseQueryTotalAckFeesResponse(); message.ackFees = object.ackFees?.map(e => Coin.fromPartial(e)) || []; return message; }, fromAmino(object: QueryTotalAckFeesResponseAmino): QueryTotalAckFeesResponse { - return { - ackFees: Array.isArray(object?.ack_fees) ? object.ack_fees.map((e: any) => Coin.fromAmino(e)) : [] - }; + const message = createBaseQueryTotalAckFeesResponse(); + message.ackFees = object.ack_fees?.map(e => Coin.fromAmino(e)) || []; + return message; }, toAmino(message: QueryTotalAckFeesResponse): QueryTotalAckFeesResponseAmino { const obj: any = {}; @@ -1265,6 +1541,8 @@ export const QueryTotalAckFeesResponse = { }; } }; +GlobalDecoderRegistry.register(QueryTotalAckFeesResponse.typeUrl, QueryTotalAckFeesResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryTotalAckFeesResponse.aminoType, QueryTotalAckFeesResponse.typeUrl); function createBaseQueryTotalTimeoutFeesRequest(): QueryTotalTimeoutFeesRequest { return { packetId: PacketId.fromPartial({}) @@ -1272,6 +1550,16 @@ function createBaseQueryTotalTimeoutFeesRequest(): QueryTotalTimeoutFeesRequest } export const QueryTotalTimeoutFeesRequest = { typeUrl: "/ibc.applications.fee.v1.QueryTotalTimeoutFeesRequest", + aminoType: "cosmos-sdk/QueryTotalTimeoutFeesRequest", + is(o: any): o is QueryTotalTimeoutFeesRequest { + return o && (o.$typeUrl === QueryTotalTimeoutFeesRequest.typeUrl || PacketId.is(o.packetId)); + }, + isSDK(o: any): o is QueryTotalTimeoutFeesRequestSDKType { + return o && (o.$typeUrl === QueryTotalTimeoutFeesRequest.typeUrl || PacketId.isSDK(o.packet_id)); + }, + isAmino(o: any): o is QueryTotalTimeoutFeesRequestAmino { + return o && (o.$typeUrl === QueryTotalTimeoutFeesRequest.typeUrl || PacketId.isAmino(o.packet_id)); + }, encode(message: QueryTotalTimeoutFeesRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.packetId !== undefined) { PacketId.encode(message.packetId, writer.uint32(10).fork()).ldelim(); @@ -1295,15 +1583,27 @@ export const QueryTotalTimeoutFeesRequest = { } return message; }, + fromJSON(object: any): QueryTotalTimeoutFeesRequest { + return { + packetId: isSet(object.packetId) ? PacketId.fromJSON(object.packetId) : undefined + }; + }, + toJSON(message: QueryTotalTimeoutFeesRequest): unknown { + const obj: any = {}; + message.packetId !== undefined && (obj.packetId = message.packetId ? PacketId.toJSON(message.packetId) : undefined); + return obj; + }, fromPartial(object: Partial): QueryTotalTimeoutFeesRequest { const message = createBaseQueryTotalTimeoutFeesRequest(); message.packetId = object.packetId !== undefined && object.packetId !== null ? PacketId.fromPartial(object.packetId) : undefined; return message; }, fromAmino(object: QueryTotalTimeoutFeesRequestAmino): QueryTotalTimeoutFeesRequest { - return { - packetId: object?.packet_id ? PacketId.fromAmino(object.packet_id) : undefined - }; + const message = createBaseQueryTotalTimeoutFeesRequest(); + if (object.packet_id !== undefined && object.packet_id !== null) { + message.packetId = PacketId.fromAmino(object.packet_id); + } + return message; }, toAmino(message: QueryTotalTimeoutFeesRequest): QueryTotalTimeoutFeesRequestAmino { const obj: any = {}; @@ -1332,6 +1632,8 @@ export const QueryTotalTimeoutFeesRequest = { }; } }; +GlobalDecoderRegistry.register(QueryTotalTimeoutFeesRequest.typeUrl, QueryTotalTimeoutFeesRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryTotalTimeoutFeesRequest.aminoType, QueryTotalTimeoutFeesRequest.typeUrl); function createBaseQueryTotalTimeoutFeesResponse(): QueryTotalTimeoutFeesResponse { return { timeoutFees: [] @@ -1339,6 +1641,16 @@ function createBaseQueryTotalTimeoutFeesResponse(): QueryTotalTimeoutFeesRespons } export const QueryTotalTimeoutFeesResponse = { typeUrl: "/ibc.applications.fee.v1.QueryTotalTimeoutFeesResponse", + aminoType: "cosmos-sdk/QueryTotalTimeoutFeesResponse", + is(o: any): o is QueryTotalTimeoutFeesResponse { + return o && (o.$typeUrl === QueryTotalTimeoutFeesResponse.typeUrl || Array.isArray(o.timeoutFees) && (!o.timeoutFees.length || Coin.is(o.timeoutFees[0]))); + }, + isSDK(o: any): o is QueryTotalTimeoutFeesResponseSDKType { + return o && (o.$typeUrl === QueryTotalTimeoutFeesResponse.typeUrl || Array.isArray(o.timeout_fees) && (!o.timeout_fees.length || Coin.isSDK(o.timeout_fees[0]))); + }, + isAmino(o: any): o is QueryTotalTimeoutFeesResponseAmino { + return o && (o.$typeUrl === QueryTotalTimeoutFeesResponse.typeUrl || Array.isArray(o.timeout_fees) && (!o.timeout_fees.length || Coin.isAmino(o.timeout_fees[0]))); + }, encode(message: QueryTotalTimeoutFeesResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.timeoutFees) { Coin.encode(v!, writer.uint32(10).fork()).ldelim(); @@ -1362,15 +1674,29 @@ export const QueryTotalTimeoutFeesResponse = { } return message; }, + fromJSON(object: any): QueryTotalTimeoutFeesResponse { + return { + timeoutFees: Array.isArray(object?.timeoutFees) ? object.timeoutFees.map((e: any) => Coin.fromJSON(e)) : [] + }; + }, + toJSON(message: QueryTotalTimeoutFeesResponse): unknown { + const obj: any = {}; + if (message.timeoutFees) { + obj.timeoutFees = message.timeoutFees.map(e => e ? Coin.toJSON(e) : undefined); + } else { + obj.timeoutFees = []; + } + return obj; + }, fromPartial(object: Partial): QueryTotalTimeoutFeesResponse { const message = createBaseQueryTotalTimeoutFeesResponse(); message.timeoutFees = object.timeoutFees?.map(e => Coin.fromPartial(e)) || []; return message; }, fromAmino(object: QueryTotalTimeoutFeesResponseAmino): QueryTotalTimeoutFeesResponse { - return { - timeoutFees: Array.isArray(object?.timeout_fees) ? object.timeout_fees.map((e: any) => Coin.fromAmino(e)) : [] - }; + const message = createBaseQueryTotalTimeoutFeesResponse(); + message.timeoutFees = object.timeout_fees?.map(e => Coin.fromAmino(e)) || []; + return message; }, toAmino(message: QueryTotalTimeoutFeesResponse): QueryTotalTimeoutFeesResponseAmino { const obj: any = {}; @@ -1403,6 +1729,8 @@ export const QueryTotalTimeoutFeesResponse = { }; } }; +GlobalDecoderRegistry.register(QueryTotalTimeoutFeesResponse.typeUrl, QueryTotalTimeoutFeesResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryTotalTimeoutFeesResponse.aminoType, QueryTotalTimeoutFeesResponse.typeUrl); function createBaseQueryPayeeRequest(): QueryPayeeRequest { return { channelId: "", @@ -1411,6 +1739,16 @@ function createBaseQueryPayeeRequest(): QueryPayeeRequest { } export const QueryPayeeRequest = { typeUrl: "/ibc.applications.fee.v1.QueryPayeeRequest", + aminoType: "cosmos-sdk/QueryPayeeRequest", + is(o: any): o is QueryPayeeRequest { + return o && (o.$typeUrl === QueryPayeeRequest.typeUrl || typeof o.channelId === "string" && typeof o.relayer === "string"); + }, + isSDK(o: any): o is QueryPayeeRequestSDKType { + return o && (o.$typeUrl === QueryPayeeRequest.typeUrl || typeof o.channel_id === "string" && typeof o.relayer === "string"); + }, + isAmino(o: any): o is QueryPayeeRequestAmino { + return o && (o.$typeUrl === QueryPayeeRequest.typeUrl || typeof o.channel_id === "string" && typeof o.relayer === "string"); + }, encode(message: QueryPayeeRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.channelId !== "") { writer.uint32(10).string(message.channelId); @@ -1440,6 +1778,18 @@ export const QueryPayeeRequest = { } return message; }, + fromJSON(object: any): QueryPayeeRequest { + return { + channelId: isSet(object.channelId) ? String(object.channelId) : "", + relayer: isSet(object.relayer) ? String(object.relayer) : "" + }; + }, + toJSON(message: QueryPayeeRequest): unknown { + const obj: any = {}; + message.channelId !== undefined && (obj.channelId = message.channelId); + message.relayer !== undefined && (obj.relayer = message.relayer); + return obj; + }, fromPartial(object: Partial): QueryPayeeRequest { const message = createBaseQueryPayeeRequest(); message.channelId = object.channelId ?? ""; @@ -1447,10 +1797,14 @@ export const QueryPayeeRequest = { return message; }, fromAmino(object: QueryPayeeRequestAmino): QueryPayeeRequest { - return { - channelId: object.channel_id, - relayer: object.relayer - }; + const message = createBaseQueryPayeeRequest(); + if (object.channel_id !== undefined && object.channel_id !== null) { + message.channelId = object.channel_id; + } + if (object.relayer !== undefined && object.relayer !== null) { + message.relayer = object.relayer; + } + return message; }, toAmino(message: QueryPayeeRequest): QueryPayeeRequestAmino { const obj: any = {}; @@ -1480,6 +1834,8 @@ export const QueryPayeeRequest = { }; } }; +GlobalDecoderRegistry.register(QueryPayeeRequest.typeUrl, QueryPayeeRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryPayeeRequest.aminoType, QueryPayeeRequest.typeUrl); function createBaseQueryPayeeResponse(): QueryPayeeResponse { return { payeeAddress: "" @@ -1487,6 +1843,16 @@ function createBaseQueryPayeeResponse(): QueryPayeeResponse { } export const QueryPayeeResponse = { typeUrl: "/ibc.applications.fee.v1.QueryPayeeResponse", + aminoType: "cosmos-sdk/QueryPayeeResponse", + is(o: any): o is QueryPayeeResponse { + return o && (o.$typeUrl === QueryPayeeResponse.typeUrl || typeof o.payeeAddress === "string"); + }, + isSDK(o: any): o is QueryPayeeResponseSDKType { + return o && (o.$typeUrl === QueryPayeeResponse.typeUrl || typeof o.payee_address === "string"); + }, + isAmino(o: any): o is QueryPayeeResponseAmino { + return o && (o.$typeUrl === QueryPayeeResponse.typeUrl || typeof o.payee_address === "string"); + }, encode(message: QueryPayeeResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.payeeAddress !== "") { writer.uint32(10).string(message.payeeAddress); @@ -1510,15 +1876,27 @@ export const QueryPayeeResponse = { } return message; }, + fromJSON(object: any): QueryPayeeResponse { + return { + payeeAddress: isSet(object.payeeAddress) ? String(object.payeeAddress) : "" + }; + }, + toJSON(message: QueryPayeeResponse): unknown { + const obj: any = {}; + message.payeeAddress !== undefined && (obj.payeeAddress = message.payeeAddress); + return obj; + }, fromPartial(object: Partial): QueryPayeeResponse { const message = createBaseQueryPayeeResponse(); message.payeeAddress = object.payeeAddress ?? ""; return message; }, fromAmino(object: QueryPayeeResponseAmino): QueryPayeeResponse { - return { - payeeAddress: object.payee_address - }; + const message = createBaseQueryPayeeResponse(); + if (object.payee_address !== undefined && object.payee_address !== null) { + message.payeeAddress = object.payee_address; + } + return message; }, toAmino(message: QueryPayeeResponse): QueryPayeeResponseAmino { const obj: any = {}; @@ -1547,6 +1925,8 @@ export const QueryPayeeResponse = { }; } }; +GlobalDecoderRegistry.register(QueryPayeeResponse.typeUrl, QueryPayeeResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryPayeeResponse.aminoType, QueryPayeeResponse.typeUrl); function createBaseQueryCounterpartyPayeeRequest(): QueryCounterpartyPayeeRequest { return { channelId: "", @@ -1555,6 +1935,16 @@ function createBaseQueryCounterpartyPayeeRequest(): QueryCounterpartyPayeeReques } export const QueryCounterpartyPayeeRequest = { typeUrl: "/ibc.applications.fee.v1.QueryCounterpartyPayeeRequest", + aminoType: "cosmos-sdk/QueryCounterpartyPayeeRequest", + is(o: any): o is QueryCounterpartyPayeeRequest { + return o && (o.$typeUrl === QueryCounterpartyPayeeRequest.typeUrl || typeof o.channelId === "string" && typeof o.relayer === "string"); + }, + isSDK(o: any): o is QueryCounterpartyPayeeRequestSDKType { + return o && (o.$typeUrl === QueryCounterpartyPayeeRequest.typeUrl || typeof o.channel_id === "string" && typeof o.relayer === "string"); + }, + isAmino(o: any): o is QueryCounterpartyPayeeRequestAmino { + return o && (o.$typeUrl === QueryCounterpartyPayeeRequest.typeUrl || typeof o.channel_id === "string" && typeof o.relayer === "string"); + }, encode(message: QueryCounterpartyPayeeRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.channelId !== "") { writer.uint32(10).string(message.channelId); @@ -1584,6 +1974,18 @@ export const QueryCounterpartyPayeeRequest = { } return message; }, + fromJSON(object: any): QueryCounterpartyPayeeRequest { + return { + channelId: isSet(object.channelId) ? String(object.channelId) : "", + relayer: isSet(object.relayer) ? String(object.relayer) : "" + }; + }, + toJSON(message: QueryCounterpartyPayeeRequest): unknown { + const obj: any = {}; + message.channelId !== undefined && (obj.channelId = message.channelId); + message.relayer !== undefined && (obj.relayer = message.relayer); + return obj; + }, fromPartial(object: Partial): QueryCounterpartyPayeeRequest { const message = createBaseQueryCounterpartyPayeeRequest(); message.channelId = object.channelId ?? ""; @@ -1591,10 +1993,14 @@ export const QueryCounterpartyPayeeRequest = { return message; }, fromAmino(object: QueryCounterpartyPayeeRequestAmino): QueryCounterpartyPayeeRequest { - return { - channelId: object.channel_id, - relayer: object.relayer - }; + const message = createBaseQueryCounterpartyPayeeRequest(); + if (object.channel_id !== undefined && object.channel_id !== null) { + message.channelId = object.channel_id; + } + if (object.relayer !== undefined && object.relayer !== null) { + message.relayer = object.relayer; + } + return message; }, toAmino(message: QueryCounterpartyPayeeRequest): QueryCounterpartyPayeeRequestAmino { const obj: any = {}; @@ -1624,6 +2030,8 @@ export const QueryCounterpartyPayeeRequest = { }; } }; +GlobalDecoderRegistry.register(QueryCounterpartyPayeeRequest.typeUrl, QueryCounterpartyPayeeRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryCounterpartyPayeeRequest.aminoType, QueryCounterpartyPayeeRequest.typeUrl); function createBaseQueryCounterpartyPayeeResponse(): QueryCounterpartyPayeeResponse { return { counterpartyPayee: "" @@ -1631,6 +2039,16 @@ function createBaseQueryCounterpartyPayeeResponse(): QueryCounterpartyPayeeRespo } export const QueryCounterpartyPayeeResponse = { typeUrl: "/ibc.applications.fee.v1.QueryCounterpartyPayeeResponse", + aminoType: "cosmos-sdk/QueryCounterpartyPayeeResponse", + is(o: any): o is QueryCounterpartyPayeeResponse { + return o && (o.$typeUrl === QueryCounterpartyPayeeResponse.typeUrl || typeof o.counterpartyPayee === "string"); + }, + isSDK(o: any): o is QueryCounterpartyPayeeResponseSDKType { + return o && (o.$typeUrl === QueryCounterpartyPayeeResponse.typeUrl || typeof o.counterparty_payee === "string"); + }, + isAmino(o: any): o is QueryCounterpartyPayeeResponseAmino { + return o && (o.$typeUrl === QueryCounterpartyPayeeResponse.typeUrl || typeof o.counterparty_payee === "string"); + }, encode(message: QueryCounterpartyPayeeResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.counterpartyPayee !== "") { writer.uint32(10).string(message.counterpartyPayee); @@ -1654,15 +2072,27 @@ export const QueryCounterpartyPayeeResponse = { } return message; }, + fromJSON(object: any): QueryCounterpartyPayeeResponse { + return { + counterpartyPayee: isSet(object.counterpartyPayee) ? String(object.counterpartyPayee) : "" + }; + }, + toJSON(message: QueryCounterpartyPayeeResponse): unknown { + const obj: any = {}; + message.counterpartyPayee !== undefined && (obj.counterpartyPayee = message.counterpartyPayee); + return obj; + }, fromPartial(object: Partial): QueryCounterpartyPayeeResponse { const message = createBaseQueryCounterpartyPayeeResponse(); message.counterpartyPayee = object.counterpartyPayee ?? ""; return message; }, fromAmino(object: QueryCounterpartyPayeeResponseAmino): QueryCounterpartyPayeeResponse { - return { - counterpartyPayee: object.counterparty_payee - }; + const message = createBaseQueryCounterpartyPayeeResponse(); + if (object.counterparty_payee !== undefined && object.counterparty_payee !== null) { + message.counterpartyPayee = object.counterparty_payee; + } + return message; }, toAmino(message: QueryCounterpartyPayeeResponse): QueryCounterpartyPayeeResponseAmino { const obj: any = {}; @@ -1691,14 +2121,26 @@ export const QueryCounterpartyPayeeResponse = { }; } }; +GlobalDecoderRegistry.register(QueryCounterpartyPayeeResponse.typeUrl, QueryCounterpartyPayeeResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryCounterpartyPayeeResponse.aminoType, QueryCounterpartyPayeeResponse.typeUrl); function createBaseQueryFeeEnabledChannelsRequest(): QueryFeeEnabledChannelsRequest { return { - pagination: PageRequest.fromPartial({}), + pagination: undefined, queryHeight: BigInt(0) }; } export const QueryFeeEnabledChannelsRequest = { typeUrl: "/ibc.applications.fee.v1.QueryFeeEnabledChannelsRequest", + aminoType: "cosmos-sdk/QueryFeeEnabledChannelsRequest", + is(o: any): o is QueryFeeEnabledChannelsRequest { + return o && (o.$typeUrl === QueryFeeEnabledChannelsRequest.typeUrl || typeof o.queryHeight === "bigint"); + }, + isSDK(o: any): o is QueryFeeEnabledChannelsRequestSDKType { + return o && (o.$typeUrl === QueryFeeEnabledChannelsRequest.typeUrl || typeof o.query_height === "bigint"); + }, + isAmino(o: any): o is QueryFeeEnabledChannelsRequestAmino { + return o && (o.$typeUrl === QueryFeeEnabledChannelsRequest.typeUrl || typeof o.query_height === "bigint"); + }, encode(message: QueryFeeEnabledChannelsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.pagination !== undefined) { PageRequest.encode(message.pagination, writer.uint32(10).fork()).ldelim(); @@ -1728,6 +2170,18 @@ export const QueryFeeEnabledChannelsRequest = { } return message; }, + fromJSON(object: any): QueryFeeEnabledChannelsRequest { + return { + pagination: isSet(object.pagination) ? PageRequest.fromJSON(object.pagination) : undefined, + queryHeight: isSet(object.queryHeight) ? BigInt(object.queryHeight.toString()) : BigInt(0) + }; + }, + toJSON(message: QueryFeeEnabledChannelsRequest): unknown { + const obj: any = {}; + message.pagination !== undefined && (obj.pagination = message.pagination ? PageRequest.toJSON(message.pagination) : undefined); + message.queryHeight !== undefined && (obj.queryHeight = (message.queryHeight || BigInt(0)).toString()); + return obj; + }, fromPartial(object: Partial): QueryFeeEnabledChannelsRequest { const message = createBaseQueryFeeEnabledChannelsRequest(); message.pagination = object.pagination !== undefined && object.pagination !== null ? PageRequest.fromPartial(object.pagination) : undefined; @@ -1735,10 +2189,14 @@ export const QueryFeeEnabledChannelsRequest = { return message; }, fromAmino(object: QueryFeeEnabledChannelsRequestAmino): QueryFeeEnabledChannelsRequest { - return { - pagination: object?.pagination ? PageRequest.fromAmino(object.pagination) : undefined, - queryHeight: BigInt(object.query_height) - }; + const message = createBaseQueryFeeEnabledChannelsRequest(); + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromAmino(object.pagination); + } + if (object.query_height !== undefined && object.query_height !== null) { + message.queryHeight = BigInt(object.query_height); + } + return message; }, toAmino(message: QueryFeeEnabledChannelsRequest): QueryFeeEnabledChannelsRequestAmino { const obj: any = {}; @@ -1768,14 +2226,26 @@ export const QueryFeeEnabledChannelsRequest = { }; } }; +GlobalDecoderRegistry.register(QueryFeeEnabledChannelsRequest.typeUrl, QueryFeeEnabledChannelsRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryFeeEnabledChannelsRequest.aminoType, QueryFeeEnabledChannelsRequest.typeUrl); function createBaseQueryFeeEnabledChannelsResponse(): QueryFeeEnabledChannelsResponse { return { feeEnabledChannels: [], - pagination: PageResponse.fromPartial({}) + pagination: undefined }; } export const QueryFeeEnabledChannelsResponse = { typeUrl: "/ibc.applications.fee.v1.QueryFeeEnabledChannelsResponse", + aminoType: "cosmos-sdk/QueryFeeEnabledChannelsResponse", + is(o: any): o is QueryFeeEnabledChannelsResponse { + return o && (o.$typeUrl === QueryFeeEnabledChannelsResponse.typeUrl || Array.isArray(o.feeEnabledChannels) && (!o.feeEnabledChannels.length || FeeEnabledChannel.is(o.feeEnabledChannels[0]))); + }, + isSDK(o: any): o is QueryFeeEnabledChannelsResponseSDKType { + return o && (o.$typeUrl === QueryFeeEnabledChannelsResponse.typeUrl || Array.isArray(o.fee_enabled_channels) && (!o.fee_enabled_channels.length || FeeEnabledChannel.isSDK(o.fee_enabled_channels[0]))); + }, + isAmino(o: any): o is QueryFeeEnabledChannelsResponseAmino { + return o && (o.$typeUrl === QueryFeeEnabledChannelsResponse.typeUrl || Array.isArray(o.fee_enabled_channels) && (!o.fee_enabled_channels.length || FeeEnabledChannel.isAmino(o.fee_enabled_channels[0]))); + }, encode(message: QueryFeeEnabledChannelsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.feeEnabledChannels) { FeeEnabledChannel.encode(v!, writer.uint32(10).fork()).ldelim(); @@ -1805,6 +2275,22 @@ export const QueryFeeEnabledChannelsResponse = { } return message; }, + fromJSON(object: any): QueryFeeEnabledChannelsResponse { + return { + feeEnabledChannels: Array.isArray(object?.feeEnabledChannels) ? object.feeEnabledChannels.map((e: any) => FeeEnabledChannel.fromJSON(e)) : [], + pagination: isSet(object.pagination) ? PageResponse.fromJSON(object.pagination) : undefined + }; + }, + toJSON(message: QueryFeeEnabledChannelsResponse): unknown { + const obj: any = {}; + if (message.feeEnabledChannels) { + obj.feeEnabledChannels = message.feeEnabledChannels.map(e => e ? FeeEnabledChannel.toJSON(e) : undefined); + } else { + obj.feeEnabledChannels = []; + } + message.pagination !== undefined && (obj.pagination = message.pagination ? PageResponse.toJSON(message.pagination) : undefined); + return obj; + }, fromPartial(object: Partial): QueryFeeEnabledChannelsResponse { const message = createBaseQueryFeeEnabledChannelsResponse(); message.feeEnabledChannels = object.feeEnabledChannels?.map(e => FeeEnabledChannel.fromPartial(e)) || []; @@ -1812,10 +2298,12 @@ export const QueryFeeEnabledChannelsResponse = { return message; }, fromAmino(object: QueryFeeEnabledChannelsResponseAmino): QueryFeeEnabledChannelsResponse { - return { - feeEnabledChannels: Array.isArray(object?.fee_enabled_channels) ? object.fee_enabled_channels.map((e: any) => FeeEnabledChannel.fromAmino(e)) : [], - pagination: object?.pagination ? PageResponse.fromAmino(object.pagination) : undefined - }; + const message = createBaseQueryFeeEnabledChannelsResponse(); + message.feeEnabledChannels = object.fee_enabled_channels?.map(e => FeeEnabledChannel.fromAmino(e)) || []; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromAmino(object.pagination); + } + return message; }, toAmino(message: QueryFeeEnabledChannelsResponse): QueryFeeEnabledChannelsResponseAmino { const obj: any = {}; @@ -1849,6 +2337,8 @@ export const QueryFeeEnabledChannelsResponse = { }; } }; +GlobalDecoderRegistry.register(QueryFeeEnabledChannelsResponse.typeUrl, QueryFeeEnabledChannelsResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryFeeEnabledChannelsResponse.aminoType, QueryFeeEnabledChannelsResponse.typeUrl); function createBaseQueryFeeEnabledChannelRequest(): QueryFeeEnabledChannelRequest { return { portId: "", @@ -1857,6 +2347,16 @@ function createBaseQueryFeeEnabledChannelRequest(): QueryFeeEnabledChannelReques } export const QueryFeeEnabledChannelRequest = { typeUrl: "/ibc.applications.fee.v1.QueryFeeEnabledChannelRequest", + aminoType: "cosmos-sdk/QueryFeeEnabledChannelRequest", + is(o: any): o is QueryFeeEnabledChannelRequest { + return o && (o.$typeUrl === QueryFeeEnabledChannelRequest.typeUrl || typeof o.portId === "string" && typeof o.channelId === "string"); + }, + isSDK(o: any): o is QueryFeeEnabledChannelRequestSDKType { + return o && (o.$typeUrl === QueryFeeEnabledChannelRequest.typeUrl || typeof o.port_id === "string" && typeof o.channel_id === "string"); + }, + isAmino(o: any): o is QueryFeeEnabledChannelRequestAmino { + return o && (o.$typeUrl === QueryFeeEnabledChannelRequest.typeUrl || typeof o.port_id === "string" && typeof o.channel_id === "string"); + }, encode(message: QueryFeeEnabledChannelRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.portId !== "") { writer.uint32(10).string(message.portId); @@ -1886,6 +2386,18 @@ export const QueryFeeEnabledChannelRequest = { } return message; }, + fromJSON(object: any): QueryFeeEnabledChannelRequest { + return { + portId: isSet(object.portId) ? String(object.portId) : "", + channelId: isSet(object.channelId) ? String(object.channelId) : "" + }; + }, + toJSON(message: QueryFeeEnabledChannelRequest): unknown { + const obj: any = {}; + message.portId !== undefined && (obj.portId = message.portId); + message.channelId !== undefined && (obj.channelId = message.channelId); + return obj; + }, fromPartial(object: Partial): QueryFeeEnabledChannelRequest { const message = createBaseQueryFeeEnabledChannelRequest(); message.portId = object.portId ?? ""; @@ -1893,10 +2405,14 @@ export const QueryFeeEnabledChannelRequest = { return message; }, fromAmino(object: QueryFeeEnabledChannelRequestAmino): QueryFeeEnabledChannelRequest { - return { - portId: object.port_id, - channelId: object.channel_id - }; + const message = createBaseQueryFeeEnabledChannelRequest(); + if (object.port_id !== undefined && object.port_id !== null) { + message.portId = object.port_id; + } + if (object.channel_id !== undefined && object.channel_id !== null) { + message.channelId = object.channel_id; + } + return message; }, toAmino(message: QueryFeeEnabledChannelRequest): QueryFeeEnabledChannelRequestAmino { const obj: any = {}; @@ -1926,6 +2442,8 @@ export const QueryFeeEnabledChannelRequest = { }; } }; +GlobalDecoderRegistry.register(QueryFeeEnabledChannelRequest.typeUrl, QueryFeeEnabledChannelRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryFeeEnabledChannelRequest.aminoType, QueryFeeEnabledChannelRequest.typeUrl); function createBaseQueryFeeEnabledChannelResponse(): QueryFeeEnabledChannelResponse { return { feeEnabled: false @@ -1933,6 +2451,16 @@ function createBaseQueryFeeEnabledChannelResponse(): QueryFeeEnabledChannelRespo } export const QueryFeeEnabledChannelResponse = { typeUrl: "/ibc.applications.fee.v1.QueryFeeEnabledChannelResponse", + aminoType: "cosmos-sdk/QueryFeeEnabledChannelResponse", + is(o: any): o is QueryFeeEnabledChannelResponse { + return o && (o.$typeUrl === QueryFeeEnabledChannelResponse.typeUrl || typeof o.feeEnabled === "boolean"); + }, + isSDK(o: any): o is QueryFeeEnabledChannelResponseSDKType { + return o && (o.$typeUrl === QueryFeeEnabledChannelResponse.typeUrl || typeof o.fee_enabled === "boolean"); + }, + isAmino(o: any): o is QueryFeeEnabledChannelResponseAmino { + return o && (o.$typeUrl === QueryFeeEnabledChannelResponse.typeUrl || typeof o.fee_enabled === "boolean"); + }, encode(message: QueryFeeEnabledChannelResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.feeEnabled === true) { writer.uint32(8).bool(message.feeEnabled); @@ -1956,15 +2484,27 @@ export const QueryFeeEnabledChannelResponse = { } return message; }, + fromJSON(object: any): QueryFeeEnabledChannelResponse { + return { + feeEnabled: isSet(object.feeEnabled) ? Boolean(object.feeEnabled) : false + }; + }, + toJSON(message: QueryFeeEnabledChannelResponse): unknown { + const obj: any = {}; + message.feeEnabled !== undefined && (obj.feeEnabled = message.feeEnabled); + return obj; + }, fromPartial(object: Partial): QueryFeeEnabledChannelResponse { const message = createBaseQueryFeeEnabledChannelResponse(); message.feeEnabled = object.feeEnabled ?? false; return message; }, fromAmino(object: QueryFeeEnabledChannelResponseAmino): QueryFeeEnabledChannelResponse { - return { - feeEnabled: object.fee_enabled - }; + const message = createBaseQueryFeeEnabledChannelResponse(); + if (object.fee_enabled !== undefined && object.fee_enabled !== null) { + message.feeEnabled = object.fee_enabled; + } + return message; }, toAmino(message: QueryFeeEnabledChannelResponse): QueryFeeEnabledChannelResponseAmino { const obj: any = {}; @@ -1992,4 +2532,6 @@ export const QueryFeeEnabledChannelResponse = { value: QueryFeeEnabledChannelResponse.encode(message).finish() }; } -}; \ No newline at end of file +}; +GlobalDecoderRegistry.register(QueryFeeEnabledChannelResponse.typeUrl, QueryFeeEnabledChannelResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryFeeEnabledChannelResponse.aminoType, QueryFeeEnabledChannelResponse.typeUrl); \ No newline at end of file diff --git a/packages/osmojs/src/codegen/ibc/applications/fee/v1/tx.registry.ts b/packages/osmojs/src/codegen/ibc/applications/fee/v1/tx.registry.ts index 1f508d7b7..6f5ec1279 100644 --- a/packages/osmojs/src/codegen/ibc/applications/fee/v1/tx.registry.ts +++ b/packages/osmojs/src/codegen/ibc/applications/fee/v1/tx.registry.ts @@ -60,6 +60,58 @@ export const MessageComposer = { }; } }, + toJSON: { + registerPayee(value: MsgRegisterPayee) { + return { + typeUrl: "/ibc.applications.fee.v1.MsgRegisterPayee", + value: MsgRegisterPayee.toJSON(value) + }; + }, + registerCounterpartyPayee(value: MsgRegisterCounterpartyPayee) { + return { + typeUrl: "/ibc.applications.fee.v1.MsgRegisterCounterpartyPayee", + value: MsgRegisterCounterpartyPayee.toJSON(value) + }; + }, + payPacketFee(value: MsgPayPacketFee) { + return { + typeUrl: "/ibc.applications.fee.v1.MsgPayPacketFee", + value: MsgPayPacketFee.toJSON(value) + }; + }, + payPacketFeeAsync(value: MsgPayPacketFeeAsync) { + return { + typeUrl: "/ibc.applications.fee.v1.MsgPayPacketFeeAsync", + value: MsgPayPacketFeeAsync.toJSON(value) + }; + } + }, + fromJSON: { + registerPayee(value: any) { + return { + typeUrl: "/ibc.applications.fee.v1.MsgRegisterPayee", + value: MsgRegisterPayee.fromJSON(value) + }; + }, + registerCounterpartyPayee(value: any) { + return { + typeUrl: "/ibc.applications.fee.v1.MsgRegisterCounterpartyPayee", + value: MsgRegisterCounterpartyPayee.fromJSON(value) + }; + }, + payPacketFee(value: any) { + return { + typeUrl: "/ibc.applications.fee.v1.MsgPayPacketFee", + value: MsgPayPacketFee.fromJSON(value) + }; + }, + payPacketFeeAsync(value: any) { + return { + typeUrl: "/ibc.applications.fee.v1.MsgPayPacketFeeAsync", + value: MsgPayPacketFeeAsync.fromJSON(value) + }; + } + }, fromPartial: { registerPayee(value: MsgRegisterPayee) { return { diff --git a/packages/osmojs/src/codegen/ibc/applications/fee/v1/tx.rpc.msg.ts b/packages/osmojs/src/codegen/ibc/applications/fee/v1/tx.rpc.msg.ts index 269265c2c..ce7084243 100644 --- a/packages/osmojs/src/codegen/ibc/applications/fee/v1/tx.rpc.msg.ts +++ b/packages/osmojs/src/codegen/ibc/applications/fee/v1/tx.rpc.msg.ts @@ -63,4 +63,7 @@ export class MsgClientImpl implements Msg { const promise = this.rpc.request("ibc.applications.fee.v1.Msg", "PayPacketFeeAsync", data); return promise.then(data => MsgPayPacketFeeAsyncResponse.decode(new BinaryReader(data))); } -} \ No newline at end of file +} +export const createClientImpl = (rpc: Rpc) => { + return new MsgClientImpl(rpc); +}; \ No newline at end of file diff --git a/packages/osmojs/src/codegen/ibc/applications/fee/v1/tx.ts b/packages/osmojs/src/codegen/ibc/applications/fee/v1/tx.ts index 86b99e0f8..f20cad7d9 100644 --- a/packages/osmojs/src/codegen/ibc/applications/fee/v1/tx.ts +++ b/packages/osmojs/src/codegen/ibc/applications/fee/v1/tx.ts @@ -1,6 +1,8 @@ import { Fee, FeeAmino, FeeSDKType, PacketFee, PacketFeeAmino, PacketFeeSDKType } from "./fee"; import { PacketId, PacketIdAmino, PacketIdSDKType } from "../../../core/channel/v1/channel"; import { BinaryReader, BinaryWriter } from "../../../../binary"; +import { isSet } from "../../../../helpers"; +import { GlobalDecoderRegistry } from "../../../../registry"; /** MsgRegisterPayee defines the request type for the RegisterPayee rpc */ export interface MsgRegisterPayee { /** unique port identifier */ @@ -19,13 +21,13 @@ export interface MsgRegisterPayeeProtoMsg { /** MsgRegisterPayee defines the request type for the RegisterPayee rpc */ export interface MsgRegisterPayeeAmino { /** unique port identifier */ - port_id: string; + port_id?: string; /** unique channel identifier */ - channel_id: string; + channel_id?: string; /** the relayer address */ - relayer: string; + relayer?: string; /** the payee address */ - payee: string; + payee?: string; } export interface MsgRegisterPayeeAminoMsg { type: "cosmos-sdk/MsgRegisterPayee"; @@ -70,13 +72,13 @@ export interface MsgRegisterCounterpartyPayeeProtoMsg { /** MsgRegisterCounterpartyPayee defines the request type for the RegisterCounterpartyPayee rpc */ export interface MsgRegisterCounterpartyPayeeAmino { /** unique port identifier */ - port_id: string; + port_id?: string; /** unique channel identifier */ - channel_id: string; + channel_id?: string; /** the relayer address */ - relayer: string; + relayer?: string; /** the counterparty payee address */ - counterparty_payee: string; + counterparty_payee?: string; } export interface MsgRegisterCounterpartyPayeeAminoMsg { type: "cosmos-sdk/MsgRegisterCounterpartyPayee"; @@ -113,7 +115,7 @@ export interface MsgPayPacketFee { fee: Fee; /** the source port unique identifier */ sourcePortId: string; - /** the source channel unique identifer */ + /** the source channel unique identifier */ sourceChannelId: string; /** account address to refund fee if necessary */ signer: string; @@ -131,15 +133,15 @@ export interface MsgPayPacketFeeProtoMsg { */ export interface MsgPayPacketFeeAmino { /** fee encapsulates the recv, ack and timeout fees associated with an IBC packet */ - fee?: FeeAmino; + fee: FeeAmino; /** the source port unique identifier */ - source_port_id: string; - /** the source channel unique identifer */ - source_channel_id: string; + source_port_id?: string; + /** the source channel unique identifier */ + source_channel_id?: string; /** account address to refund fee if necessary */ - signer: string; + signer?: string; /** optional list of relayers permitted to the receive packet fees */ - relayers: string[]; + relayers?: string[]; } export interface MsgPayPacketFeeAminoMsg { type: "cosmos-sdk/MsgPayPacketFee"; @@ -191,9 +193,9 @@ export interface MsgPayPacketFeeAsyncProtoMsg { */ export interface MsgPayPacketFeeAsyncAmino { /** unique packet identifier comprised of the channel ID, port ID and sequence */ - packet_id?: PacketIdAmino; + packet_id: PacketIdAmino; /** the packet fee associated with a particular IBC packet */ - packet_fee?: PacketFeeAmino; + packet_fee: PacketFeeAmino; } export interface MsgPayPacketFeeAsyncAminoMsg { type: "cosmos-sdk/MsgPayPacketFeeAsync"; @@ -231,6 +233,16 @@ function createBaseMsgRegisterPayee(): MsgRegisterPayee { } export const MsgRegisterPayee = { typeUrl: "/ibc.applications.fee.v1.MsgRegisterPayee", + aminoType: "cosmos-sdk/MsgRegisterPayee", + is(o: any): o is MsgRegisterPayee { + return o && (o.$typeUrl === MsgRegisterPayee.typeUrl || typeof o.portId === "string" && typeof o.channelId === "string" && typeof o.relayer === "string" && typeof o.payee === "string"); + }, + isSDK(o: any): o is MsgRegisterPayeeSDKType { + return o && (o.$typeUrl === MsgRegisterPayee.typeUrl || typeof o.port_id === "string" && typeof o.channel_id === "string" && typeof o.relayer === "string" && typeof o.payee === "string"); + }, + isAmino(o: any): o is MsgRegisterPayeeAmino { + return o && (o.$typeUrl === MsgRegisterPayee.typeUrl || typeof o.port_id === "string" && typeof o.channel_id === "string" && typeof o.relayer === "string" && typeof o.payee === "string"); + }, encode(message: MsgRegisterPayee, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.portId !== "") { writer.uint32(10).string(message.portId); @@ -272,6 +284,22 @@ export const MsgRegisterPayee = { } return message; }, + fromJSON(object: any): MsgRegisterPayee { + return { + portId: isSet(object.portId) ? String(object.portId) : "", + channelId: isSet(object.channelId) ? String(object.channelId) : "", + relayer: isSet(object.relayer) ? String(object.relayer) : "", + payee: isSet(object.payee) ? String(object.payee) : "" + }; + }, + toJSON(message: MsgRegisterPayee): unknown { + const obj: any = {}; + message.portId !== undefined && (obj.portId = message.portId); + message.channelId !== undefined && (obj.channelId = message.channelId); + message.relayer !== undefined && (obj.relayer = message.relayer); + message.payee !== undefined && (obj.payee = message.payee); + return obj; + }, fromPartial(object: Partial): MsgRegisterPayee { const message = createBaseMsgRegisterPayee(); message.portId = object.portId ?? ""; @@ -281,12 +309,20 @@ export const MsgRegisterPayee = { return message; }, fromAmino(object: MsgRegisterPayeeAmino): MsgRegisterPayee { - return { - portId: object.port_id, - channelId: object.channel_id, - relayer: object.relayer, - payee: object.payee - }; + const message = createBaseMsgRegisterPayee(); + if (object.port_id !== undefined && object.port_id !== null) { + message.portId = object.port_id; + } + if (object.channel_id !== undefined && object.channel_id !== null) { + message.channelId = object.channel_id; + } + if (object.relayer !== undefined && object.relayer !== null) { + message.relayer = object.relayer; + } + if (object.payee !== undefined && object.payee !== null) { + message.payee = object.payee; + } + return message; }, toAmino(message: MsgRegisterPayee): MsgRegisterPayeeAmino { const obj: any = {}; @@ -318,11 +354,23 @@ export const MsgRegisterPayee = { }; } }; +GlobalDecoderRegistry.register(MsgRegisterPayee.typeUrl, MsgRegisterPayee); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgRegisterPayee.aminoType, MsgRegisterPayee.typeUrl); function createBaseMsgRegisterPayeeResponse(): MsgRegisterPayeeResponse { return {}; } export const MsgRegisterPayeeResponse = { typeUrl: "/ibc.applications.fee.v1.MsgRegisterPayeeResponse", + aminoType: "cosmos-sdk/MsgRegisterPayeeResponse", + is(o: any): o is MsgRegisterPayeeResponse { + return o && o.$typeUrl === MsgRegisterPayeeResponse.typeUrl; + }, + isSDK(o: any): o is MsgRegisterPayeeResponseSDKType { + return o && o.$typeUrl === MsgRegisterPayeeResponse.typeUrl; + }, + isAmino(o: any): o is MsgRegisterPayeeResponseAmino { + return o && o.$typeUrl === MsgRegisterPayeeResponse.typeUrl; + }, encode(_: MsgRegisterPayeeResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, @@ -340,12 +388,20 @@ export const MsgRegisterPayeeResponse = { } return message; }, + fromJSON(_: any): MsgRegisterPayeeResponse { + return {}; + }, + toJSON(_: MsgRegisterPayeeResponse): unknown { + const obj: any = {}; + return obj; + }, fromPartial(_: Partial): MsgRegisterPayeeResponse { const message = createBaseMsgRegisterPayeeResponse(); return message; }, fromAmino(_: MsgRegisterPayeeResponseAmino): MsgRegisterPayeeResponse { - return {}; + const message = createBaseMsgRegisterPayeeResponse(); + return message; }, toAmino(_: MsgRegisterPayeeResponse): MsgRegisterPayeeResponseAmino { const obj: any = {}; @@ -373,6 +429,8 @@ export const MsgRegisterPayeeResponse = { }; } }; +GlobalDecoderRegistry.register(MsgRegisterPayeeResponse.typeUrl, MsgRegisterPayeeResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgRegisterPayeeResponse.aminoType, MsgRegisterPayeeResponse.typeUrl); function createBaseMsgRegisterCounterpartyPayee(): MsgRegisterCounterpartyPayee { return { portId: "", @@ -383,6 +441,16 @@ function createBaseMsgRegisterCounterpartyPayee(): MsgRegisterCounterpartyPayee } export const MsgRegisterCounterpartyPayee = { typeUrl: "/ibc.applications.fee.v1.MsgRegisterCounterpartyPayee", + aminoType: "cosmos-sdk/MsgRegisterCounterpartyPayee", + is(o: any): o is MsgRegisterCounterpartyPayee { + return o && (o.$typeUrl === MsgRegisterCounterpartyPayee.typeUrl || typeof o.portId === "string" && typeof o.channelId === "string" && typeof o.relayer === "string" && typeof o.counterpartyPayee === "string"); + }, + isSDK(o: any): o is MsgRegisterCounterpartyPayeeSDKType { + return o && (o.$typeUrl === MsgRegisterCounterpartyPayee.typeUrl || typeof o.port_id === "string" && typeof o.channel_id === "string" && typeof o.relayer === "string" && typeof o.counterparty_payee === "string"); + }, + isAmino(o: any): o is MsgRegisterCounterpartyPayeeAmino { + return o && (o.$typeUrl === MsgRegisterCounterpartyPayee.typeUrl || typeof o.port_id === "string" && typeof o.channel_id === "string" && typeof o.relayer === "string" && typeof o.counterparty_payee === "string"); + }, encode(message: MsgRegisterCounterpartyPayee, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.portId !== "") { writer.uint32(10).string(message.portId); @@ -424,6 +492,22 @@ export const MsgRegisterCounterpartyPayee = { } return message; }, + fromJSON(object: any): MsgRegisterCounterpartyPayee { + return { + portId: isSet(object.portId) ? String(object.portId) : "", + channelId: isSet(object.channelId) ? String(object.channelId) : "", + relayer: isSet(object.relayer) ? String(object.relayer) : "", + counterpartyPayee: isSet(object.counterpartyPayee) ? String(object.counterpartyPayee) : "" + }; + }, + toJSON(message: MsgRegisterCounterpartyPayee): unknown { + const obj: any = {}; + message.portId !== undefined && (obj.portId = message.portId); + message.channelId !== undefined && (obj.channelId = message.channelId); + message.relayer !== undefined && (obj.relayer = message.relayer); + message.counterpartyPayee !== undefined && (obj.counterpartyPayee = message.counterpartyPayee); + return obj; + }, fromPartial(object: Partial): MsgRegisterCounterpartyPayee { const message = createBaseMsgRegisterCounterpartyPayee(); message.portId = object.portId ?? ""; @@ -433,12 +517,20 @@ export const MsgRegisterCounterpartyPayee = { return message; }, fromAmino(object: MsgRegisterCounterpartyPayeeAmino): MsgRegisterCounterpartyPayee { - return { - portId: object.port_id, - channelId: object.channel_id, - relayer: object.relayer, - counterpartyPayee: object.counterparty_payee - }; + const message = createBaseMsgRegisterCounterpartyPayee(); + if (object.port_id !== undefined && object.port_id !== null) { + message.portId = object.port_id; + } + if (object.channel_id !== undefined && object.channel_id !== null) { + message.channelId = object.channel_id; + } + if (object.relayer !== undefined && object.relayer !== null) { + message.relayer = object.relayer; + } + if (object.counterparty_payee !== undefined && object.counterparty_payee !== null) { + message.counterpartyPayee = object.counterparty_payee; + } + return message; }, toAmino(message: MsgRegisterCounterpartyPayee): MsgRegisterCounterpartyPayeeAmino { const obj: any = {}; @@ -470,11 +562,23 @@ export const MsgRegisterCounterpartyPayee = { }; } }; +GlobalDecoderRegistry.register(MsgRegisterCounterpartyPayee.typeUrl, MsgRegisterCounterpartyPayee); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgRegisterCounterpartyPayee.aminoType, MsgRegisterCounterpartyPayee.typeUrl); function createBaseMsgRegisterCounterpartyPayeeResponse(): MsgRegisterCounterpartyPayeeResponse { return {}; } export const MsgRegisterCounterpartyPayeeResponse = { typeUrl: "/ibc.applications.fee.v1.MsgRegisterCounterpartyPayeeResponse", + aminoType: "cosmos-sdk/MsgRegisterCounterpartyPayeeResponse", + is(o: any): o is MsgRegisterCounterpartyPayeeResponse { + return o && o.$typeUrl === MsgRegisterCounterpartyPayeeResponse.typeUrl; + }, + isSDK(o: any): o is MsgRegisterCounterpartyPayeeResponseSDKType { + return o && o.$typeUrl === MsgRegisterCounterpartyPayeeResponse.typeUrl; + }, + isAmino(o: any): o is MsgRegisterCounterpartyPayeeResponseAmino { + return o && o.$typeUrl === MsgRegisterCounterpartyPayeeResponse.typeUrl; + }, encode(_: MsgRegisterCounterpartyPayeeResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, @@ -492,12 +596,20 @@ export const MsgRegisterCounterpartyPayeeResponse = { } return message; }, + fromJSON(_: any): MsgRegisterCounterpartyPayeeResponse { + return {}; + }, + toJSON(_: MsgRegisterCounterpartyPayeeResponse): unknown { + const obj: any = {}; + return obj; + }, fromPartial(_: Partial): MsgRegisterCounterpartyPayeeResponse { const message = createBaseMsgRegisterCounterpartyPayeeResponse(); return message; }, fromAmino(_: MsgRegisterCounterpartyPayeeResponseAmino): MsgRegisterCounterpartyPayeeResponse { - return {}; + const message = createBaseMsgRegisterCounterpartyPayeeResponse(); + return message; }, toAmino(_: MsgRegisterCounterpartyPayeeResponse): MsgRegisterCounterpartyPayeeResponseAmino { const obj: any = {}; @@ -525,6 +637,8 @@ export const MsgRegisterCounterpartyPayeeResponse = { }; } }; +GlobalDecoderRegistry.register(MsgRegisterCounterpartyPayeeResponse.typeUrl, MsgRegisterCounterpartyPayeeResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgRegisterCounterpartyPayeeResponse.aminoType, MsgRegisterCounterpartyPayeeResponse.typeUrl); function createBaseMsgPayPacketFee(): MsgPayPacketFee { return { fee: Fee.fromPartial({}), @@ -536,6 +650,16 @@ function createBaseMsgPayPacketFee(): MsgPayPacketFee { } export const MsgPayPacketFee = { typeUrl: "/ibc.applications.fee.v1.MsgPayPacketFee", + aminoType: "cosmos-sdk/MsgPayPacketFee", + is(o: any): o is MsgPayPacketFee { + return o && (o.$typeUrl === MsgPayPacketFee.typeUrl || Fee.is(o.fee) && typeof o.sourcePortId === "string" && typeof o.sourceChannelId === "string" && typeof o.signer === "string" && Array.isArray(o.relayers) && (!o.relayers.length || typeof o.relayers[0] === "string")); + }, + isSDK(o: any): o is MsgPayPacketFeeSDKType { + return o && (o.$typeUrl === MsgPayPacketFee.typeUrl || Fee.isSDK(o.fee) && typeof o.source_port_id === "string" && typeof o.source_channel_id === "string" && typeof o.signer === "string" && Array.isArray(o.relayers) && (!o.relayers.length || typeof o.relayers[0] === "string")); + }, + isAmino(o: any): o is MsgPayPacketFeeAmino { + return o && (o.$typeUrl === MsgPayPacketFee.typeUrl || Fee.isAmino(o.fee) && typeof o.source_port_id === "string" && typeof o.source_channel_id === "string" && typeof o.signer === "string" && Array.isArray(o.relayers) && (!o.relayers.length || typeof o.relayers[0] === "string")); + }, encode(message: MsgPayPacketFee, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.fee !== undefined) { Fee.encode(message.fee, writer.uint32(10).fork()).ldelim(); @@ -583,6 +707,28 @@ export const MsgPayPacketFee = { } return message; }, + fromJSON(object: any): MsgPayPacketFee { + return { + fee: isSet(object.fee) ? Fee.fromJSON(object.fee) : undefined, + sourcePortId: isSet(object.sourcePortId) ? String(object.sourcePortId) : "", + sourceChannelId: isSet(object.sourceChannelId) ? String(object.sourceChannelId) : "", + signer: isSet(object.signer) ? String(object.signer) : "", + relayers: Array.isArray(object?.relayers) ? object.relayers.map((e: any) => String(e)) : [] + }; + }, + toJSON(message: MsgPayPacketFee): unknown { + const obj: any = {}; + message.fee !== undefined && (obj.fee = message.fee ? Fee.toJSON(message.fee) : undefined); + message.sourcePortId !== undefined && (obj.sourcePortId = message.sourcePortId); + message.sourceChannelId !== undefined && (obj.sourceChannelId = message.sourceChannelId); + message.signer !== undefined && (obj.signer = message.signer); + if (message.relayers) { + obj.relayers = message.relayers.map(e => e); + } else { + obj.relayers = []; + } + return obj; + }, fromPartial(object: Partial): MsgPayPacketFee { const message = createBaseMsgPayPacketFee(); message.fee = object.fee !== undefined && object.fee !== null ? Fee.fromPartial(object.fee) : undefined; @@ -593,17 +739,25 @@ export const MsgPayPacketFee = { return message; }, fromAmino(object: MsgPayPacketFeeAmino): MsgPayPacketFee { - return { - fee: object?.fee ? Fee.fromAmino(object.fee) : undefined, - sourcePortId: object.source_port_id, - sourceChannelId: object.source_channel_id, - signer: object.signer, - relayers: Array.isArray(object?.relayers) ? object.relayers.map((e: any) => e) : [] - }; + const message = createBaseMsgPayPacketFee(); + if (object.fee !== undefined && object.fee !== null) { + message.fee = Fee.fromAmino(object.fee); + } + if (object.source_port_id !== undefined && object.source_port_id !== null) { + message.sourcePortId = object.source_port_id; + } + if (object.source_channel_id !== undefined && object.source_channel_id !== null) { + message.sourceChannelId = object.source_channel_id; + } + if (object.signer !== undefined && object.signer !== null) { + message.signer = object.signer; + } + message.relayers = object.relayers?.map(e => e) || []; + return message; }, toAmino(message: MsgPayPacketFee): MsgPayPacketFeeAmino { const obj: any = {}; - obj.fee = message.fee ? Fee.toAmino(message.fee) : undefined; + obj.fee = message.fee ? Fee.toAmino(message.fee) : Fee.fromPartial({}); obj.source_port_id = message.sourcePortId; obj.source_channel_id = message.sourceChannelId; obj.signer = message.signer; @@ -636,11 +790,23 @@ export const MsgPayPacketFee = { }; } }; +GlobalDecoderRegistry.register(MsgPayPacketFee.typeUrl, MsgPayPacketFee); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgPayPacketFee.aminoType, MsgPayPacketFee.typeUrl); function createBaseMsgPayPacketFeeResponse(): MsgPayPacketFeeResponse { return {}; } export const MsgPayPacketFeeResponse = { typeUrl: "/ibc.applications.fee.v1.MsgPayPacketFeeResponse", + aminoType: "cosmos-sdk/MsgPayPacketFeeResponse", + is(o: any): o is MsgPayPacketFeeResponse { + return o && o.$typeUrl === MsgPayPacketFeeResponse.typeUrl; + }, + isSDK(o: any): o is MsgPayPacketFeeResponseSDKType { + return o && o.$typeUrl === MsgPayPacketFeeResponse.typeUrl; + }, + isAmino(o: any): o is MsgPayPacketFeeResponseAmino { + return o && o.$typeUrl === MsgPayPacketFeeResponse.typeUrl; + }, encode(_: MsgPayPacketFeeResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, @@ -658,12 +824,20 @@ export const MsgPayPacketFeeResponse = { } return message; }, + fromJSON(_: any): MsgPayPacketFeeResponse { + return {}; + }, + toJSON(_: MsgPayPacketFeeResponse): unknown { + const obj: any = {}; + return obj; + }, fromPartial(_: Partial): MsgPayPacketFeeResponse { const message = createBaseMsgPayPacketFeeResponse(); return message; }, fromAmino(_: MsgPayPacketFeeResponseAmino): MsgPayPacketFeeResponse { - return {}; + const message = createBaseMsgPayPacketFeeResponse(); + return message; }, toAmino(_: MsgPayPacketFeeResponse): MsgPayPacketFeeResponseAmino { const obj: any = {}; @@ -691,6 +865,8 @@ export const MsgPayPacketFeeResponse = { }; } }; +GlobalDecoderRegistry.register(MsgPayPacketFeeResponse.typeUrl, MsgPayPacketFeeResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgPayPacketFeeResponse.aminoType, MsgPayPacketFeeResponse.typeUrl); function createBaseMsgPayPacketFeeAsync(): MsgPayPacketFeeAsync { return { packetId: PacketId.fromPartial({}), @@ -699,6 +875,16 @@ function createBaseMsgPayPacketFeeAsync(): MsgPayPacketFeeAsync { } export const MsgPayPacketFeeAsync = { typeUrl: "/ibc.applications.fee.v1.MsgPayPacketFeeAsync", + aminoType: "cosmos-sdk/MsgPayPacketFeeAsync", + is(o: any): o is MsgPayPacketFeeAsync { + return o && (o.$typeUrl === MsgPayPacketFeeAsync.typeUrl || PacketId.is(o.packetId) && PacketFee.is(o.packetFee)); + }, + isSDK(o: any): o is MsgPayPacketFeeAsyncSDKType { + return o && (o.$typeUrl === MsgPayPacketFeeAsync.typeUrl || PacketId.isSDK(o.packet_id) && PacketFee.isSDK(o.packet_fee)); + }, + isAmino(o: any): o is MsgPayPacketFeeAsyncAmino { + return o && (o.$typeUrl === MsgPayPacketFeeAsync.typeUrl || PacketId.isAmino(o.packet_id) && PacketFee.isAmino(o.packet_fee)); + }, encode(message: MsgPayPacketFeeAsync, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.packetId !== undefined) { PacketId.encode(message.packetId, writer.uint32(10).fork()).ldelim(); @@ -728,6 +914,18 @@ export const MsgPayPacketFeeAsync = { } return message; }, + fromJSON(object: any): MsgPayPacketFeeAsync { + return { + packetId: isSet(object.packetId) ? PacketId.fromJSON(object.packetId) : undefined, + packetFee: isSet(object.packetFee) ? PacketFee.fromJSON(object.packetFee) : undefined + }; + }, + toJSON(message: MsgPayPacketFeeAsync): unknown { + const obj: any = {}; + message.packetId !== undefined && (obj.packetId = message.packetId ? PacketId.toJSON(message.packetId) : undefined); + message.packetFee !== undefined && (obj.packetFee = message.packetFee ? PacketFee.toJSON(message.packetFee) : undefined); + return obj; + }, fromPartial(object: Partial): MsgPayPacketFeeAsync { const message = createBaseMsgPayPacketFeeAsync(); message.packetId = object.packetId !== undefined && object.packetId !== null ? PacketId.fromPartial(object.packetId) : undefined; @@ -735,15 +933,19 @@ export const MsgPayPacketFeeAsync = { return message; }, fromAmino(object: MsgPayPacketFeeAsyncAmino): MsgPayPacketFeeAsync { - return { - packetId: object?.packet_id ? PacketId.fromAmino(object.packet_id) : undefined, - packetFee: object?.packet_fee ? PacketFee.fromAmino(object.packet_fee) : undefined - }; + const message = createBaseMsgPayPacketFeeAsync(); + if (object.packet_id !== undefined && object.packet_id !== null) { + message.packetId = PacketId.fromAmino(object.packet_id); + } + if (object.packet_fee !== undefined && object.packet_fee !== null) { + message.packetFee = PacketFee.fromAmino(object.packet_fee); + } + return message; }, toAmino(message: MsgPayPacketFeeAsync): MsgPayPacketFeeAsyncAmino { const obj: any = {}; - obj.packet_id = message.packetId ? PacketId.toAmino(message.packetId) : undefined; - obj.packet_fee = message.packetFee ? PacketFee.toAmino(message.packetFee) : undefined; + obj.packet_id = message.packetId ? PacketId.toAmino(message.packetId) : PacketId.fromPartial({}); + obj.packet_fee = message.packetFee ? PacketFee.toAmino(message.packetFee) : PacketFee.fromPartial({}); return obj; }, fromAminoMsg(object: MsgPayPacketFeeAsyncAminoMsg): MsgPayPacketFeeAsync { @@ -768,11 +970,23 @@ export const MsgPayPacketFeeAsync = { }; } }; +GlobalDecoderRegistry.register(MsgPayPacketFeeAsync.typeUrl, MsgPayPacketFeeAsync); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgPayPacketFeeAsync.aminoType, MsgPayPacketFeeAsync.typeUrl); function createBaseMsgPayPacketFeeAsyncResponse(): MsgPayPacketFeeAsyncResponse { return {}; } export const MsgPayPacketFeeAsyncResponse = { typeUrl: "/ibc.applications.fee.v1.MsgPayPacketFeeAsyncResponse", + aminoType: "cosmos-sdk/MsgPayPacketFeeAsyncResponse", + is(o: any): o is MsgPayPacketFeeAsyncResponse { + return o && o.$typeUrl === MsgPayPacketFeeAsyncResponse.typeUrl; + }, + isSDK(o: any): o is MsgPayPacketFeeAsyncResponseSDKType { + return o && o.$typeUrl === MsgPayPacketFeeAsyncResponse.typeUrl; + }, + isAmino(o: any): o is MsgPayPacketFeeAsyncResponseAmino { + return o && o.$typeUrl === MsgPayPacketFeeAsyncResponse.typeUrl; + }, encode(_: MsgPayPacketFeeAsyncResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, @@ -790,12 +1004,20 @@ export const MsgPayPacketFeeAsyncResponse = { } return message; }, + fromJSON(_: any): MsgPayPacketFeeAsyncResponse { + return {}; + }, + toJSON(_: MsgPayPacketFeeAsyncResponse): unknown { + const obj: any = {}; + return obj; + }, fromPartial(_: Partial): MsgPayPacketFeeAsyncResponse { const message = createBaseMsgPayPacketFeeAsyncResponse(); return message; }, fromAmino(_: MsgPayPacketFeeAsyncResponseAmino): MsgPayPacketFeeAsyncResponse { - return {}; + const message = createBaseMsgPayPacketFeeAsyncResponse(); + return message; }, toAmino(_: MsgPayPacketFeeAsyncResponse): MsgPayPacketFeeAsyncResponseAmino { const obj: any = {}; @@ -822,4 +1044,6 @@ export const MsgPayPacketFeeAsyncResponse = { value: MsgPayPacketFeeAsyncResponse.encode(message).finish() }; } -}; \ No newline at end of file +}; +GlobalDecoderRegistry.register(MsgPayPacketFeeAsyncResponse.typeUrl, MsgPayPacketFeeAsyncResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgPayPacketFeeAsyncResponse.aminoType, MsgPayPacketFeeAsyncResponse.typeUrl); \ No newline at end of file diff --git a/packages/osmojs/src/codegen/ibc/applications/interchain_accounts/controller/v1/controller.ts b/packages/osmojs/src/codegen/ibc/applications/interchain_accounts/controller/v1/controller.ts index c07167950..2a0f00b11 100644 --- a/packages/osmojs/src/codegen/ibc/applications/interchain_accounts/controller/v1/controller.ts +++ b/packages/osmojs/src/codegen/ibc/applications/interchain_accounts/controller/v1/controller.ts @@ -1,4 +1,6 @@ import { BinaryReader, BinaryWriter } from "../../../../../binary"; +import { isSet } from "../../../../../helpers"; +import { GlobalDecoderRegistry } from "../../../../../registry"; /** * Params defines the set of on-chain interchain accounts parameters. * The following parameters may be used to disable the controller submodule. @@ -17,7 +19,7 @@ export interface ParamsProtoMsg { */ export interface ParamsAmino { /** controller_enabled enables or disables the controller submodule. */ - controller_enabled: boolean; + controller_enabled?: boolean; } export interface ParamsAminoMsg { type: "cosmos-sdk/Params"; @@ -37,6 +39,16 @@ function createBaseParams(): Params { } export const Params = { typeUrl: "/ibc.applications.interchain_accounts.controller.v1.Params", + aminoType: "cosmos-sdk/Params", + is(o: any): o is Params { + return o && (o.$typeUrl === Params.typeUrl || typeof o.controllerEnabled === "boolean"); + }, + isSDK(o: any): o is ParamsSDKType { + return o && (o.$typeUrl === Params.typeUrl || typeof o.controller_enabled === "boolean"); + }, + isAmino(o: any): o is ParamsAmino { + return o && (o.$typeUrl === Params.typeUrl || typeof o.controller_enabled === "boolean"); + }, encode(message: Params, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.controllerEnabled === true) { writer.uint32(8).bool(message.controllerEnabled); @@ -60,15 +72,27 @@ export const Params = { } return message; }, + fromJSON(object: any): Params { + return { + controllerEnabled: isSet(object.controllerEnabled) ? Boolean(object.controllerEnabled) : false + }; + }, + toJSON(message: Params): unknown { + const obj: any = {}; + message.controllerEnabled !== undefined && (obj.controllerEnabled = message.controllerEnabled); + return obj; + }, fromPartial(object: Partial): Params { const message = createBaseParams(); message.controllerEnabled = object.controllerEnabled ?? false; return message; }, fromAmino(object: ParamsAmino): Params { - return { - controllerEnabled: object.controller_enabled - }; + const message = createBaseParams(); + if (object.controller_enabled !== undefined && object.controller_enabled !== null) { + message.controllerEnabled = object.controller_enabled; + } + return message; }, toAmino(message: Params): ParamsAmino { const obj: any = {}; @@ -96,4 +120,6 @@ export const Params = { value: Params.encode(message).finish() }; } -}; \ No newline at end of file +}; +GlobalDecoderRegistry.register(Params.typeUrl, Params); +GlobalDecoderRegistry.registerAminoProtoMapping(Params.aminoType, Params.typeUrl); \ No newline at end of file diff --git a/packages/osmojs/src/codegen/ibc/applications/interchain_accounts/controller/v1/query.ts b/packages/osmojs/src/codegen/ibc/applications/interchain_accounts/controller/v1/query.ts index 218435d41..23124a8c7 100644 --- a/packages/osmojs/src/codegen/ibc/applications/interchain_accounts/controller/v1/query.ts +++ b/packages/osmojs/src/codegen/ibc/applications/interchain_accounts/controller/v1/query.ts @@ -1,5 +1,7 @@ import { Params, ParamsAmino, ParamsSDKType } from "./controller"; import { BinaryReader, BinaryWriter } from "../../../../../binary"; +import { isSet } from "../../../../../helpers"; +import { GlobalDecoderRegistry } from "../../../../../registry"; /** QueryInterchainAccountRequest is the request type for the Query/InterchainAccount RPC method. */ export interface QueryInterchainAccountRequest { owner: string; @@ -11,8 +13,8 @@ export interface QueryInterchainAccountRequestProtoMsg { } /** QueryInterchainAccountRequest is the request type for the Query/InterchainAccount RPC method. */ export interface QueryInterchainAccountRequestAmino { - owner: string; - connection_id: string; + owner?: string; + connection_id?: string; } export interface QueryInterchainAccountRequestAminoMsg { type: "cosmos-sdk/QueryInterchainAccountRequest"; @@ -33,7 +35,7 @@ export interface QueryInterchainAccountResponseProtoMsg { } /** QueryInterchainAccountResponse the response type for the Query/InterchainAccount RPC method. */ export interface QueryInterchainAccountResponseAmino { - address: string; + address?: string; } export interface QueryInterchainAccountResponseAminoMsg { type: "cosmos-sdk/QueryInterchainAccountResponse"; @@ -60,7 +62,7 @@ export interface QueryParamsRequestSDKType {} /** 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; } export interface QueryParamsResponseProtoMsg { typeUrl: "/ibc.applications.interchain_accounts.controller.v1.QueryParamsResponse"; @@ -77,7 +79,7 @@ export interface QueryParamsResponseAminoMsg { } /** QueryParamsResponse is the response type for the Query/Params RPC method. */ export interface QueryParamsResponseSDKType { - params: ParamsSDKType; + params?: ParamsSDKType; } function createBaseQueryInterchainAccountRequest(): QueryInterchainAccountRequest { return { @@ -87,6 +89,16 @@ function createBaseQueryInterchainAccountRequest(): QueryInterchainAccountReques } export const QueryInterchainAccountRequest = { typeUrl: "/ibc.applications.interchain_accounts.controller.v1.QueryInterchainAccountRequest", + aminoType: "cosmos-sdk/QueryInterchainAccountRequest", + is(o: any): o is QueryInterchainAccountRequest { + return o && (o.$typeUrl === QueryInterchainAccountRequest.typeUrl || typeof o.owner === "string" && typeof o.connectionId === "string"); + }, + isSDK(o: any): o is QueryInterchainAccountRequestSDKType { + return o && (o.$typeUrl === QueryInterchainAccountRequest.typeUrl || typeof o.owner === "string" && typeof o.connection_id === "string"); + }, + isAmino(o: any): o is QueryInterchainAccountRequestAmino { + return o && (o.$typeUrl === QueryInterchainAccountRequest.typeUrl || typeof o.owner === "string" && typeof o.connection_id === "string"); + }, encode(message: QueryInterchainAccountRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.owner !== "") { writer.uint32(10).string(message.owner); @@ -116,6 +128,18 @@ export const QueryInterchainAccountRequest = { } return message; }, + fromJSON(object: any): QueryInterchainAccountRequest { + return { + owner: isSet(object.owner) ? String(object.owner) : "", + connectionId: isSet(object.connectionId) ? String(object.connectionId) : "" + }; + }, + toJSON(message: QueryInterchainAccountRequest): unknown { + const obj: any = {}; + message.owner !== undefined && (obj.owner = message.owner); + message.connectionId !== undefined && (obj.connectionId = message.connectionId); + return obj; + }, fromPartial(object: Partial): QueryInterchainAccountRequest { const message = createBaseQueryInterchainAccountRequest(); message.owner = object.owner ?? ""; @@ -123,10 +147,14 @@ export const QueryInterchainAccountRequest = { return message; }, fromAmino(object: QueryInterchainAccountRequestAmino): QueryInterchainAccountRequest { - return { - owner: object.owner, - connectionId: object.connection_id - }; + const message = createBaseQueryInterchainAccountRequest(); + if (object.owner !== undefined && object.owner !== null) { + message.owner = object.owner; + } + if (object.connection_id !== undefined && object.connection_id !== null) { + message.connectionId = object.connection_id; + } + return message; }, toAmino(message: QueryInterchainAccountRequest): QueryInterchainAccountRequestAmino { const obj: any = {}; @@ -156,6 +184,8 @@ export const QueryInterchainAccountRequest = { }; } }; +GlobalDecoderRegistry.register(QueryInterchainAccountRequest.typeUrl, QueryInterchainAccountRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryInterchainAccountRequest.aminoType, QueryInterchainAccountRequest.typeUrl); function createBaseQueryInterchainAccountResponse(): QueryInterchainAccountResponse { return { address: "" @@ -163,6 +193,16 @@ function createBaseQueryInterchainAccountResponse(): QueryInterchainAccountRespo } export const QueryInterchainAccountResponse = { typeUrl: "/ibc.applications.interchain_accounts.controller.v1.QueryInterchainAccountResponse", + aminoType: "cosmos-sdk/QueryInterchainAccountResponse", + is(o: any): o is QueryInterchainAccountResponse { + return o && (o.$typeUrl === QueryInterchainAccountResponse.typeUrl || typeof o.address === "string"); + }, + isSDK(o: any): o is QueryInterchainAccountResponseSDKType { + return o && (o.$typeUrl === QueryInterchainAccountResponse.typeUrl || typeof o.address === "string"); + }, + isAmino(o: any): o is QueryInterchainAccountResponseAmino { + return o && (o.$typeUrl === QueryInterchainAccountResponse.typeUrl || typeof o.address === "string"); + }, encode(message: QueryInterchainAccountResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.address !== "") { writer.uint32(10).string(message.address); @@ -186,15 +226,27 @@ export const QueryInterchainAccountResponse = { } return message; }, + fromJSON(object: any): QueryInterchainAccountResponse { + return { + address: isSet(object.address) ? String(object.address) : "" + }; + }, + toJSON(message: QueryInterchainAccountResponse): unknown { + const obj: any = {}; + message.address !== undefined && (obj.address = message.address); + return obj; + }, fromPartial(object: Partial): QueryInterchainAccountResponse { const message = createBaseQueryInterchainAccountResponse(); message.address = object.address ?? ""; return message; }, fromAmino(object: QueryInterchainAccountResponseAmino): QueryInterchainAccountResponse { - return { - address: object.address - }; + const message = createBaseQueryInterchainAccountResponse(); + if (object.address !== undefined && object.address !== null) { + message.address = object.address; + } + return message; }, toAmino(message: QueryInterchainAccountResponse): QueryInterchainAccountResponseAmino { const obj: any = {}; @@ -223,11 +275,23 @@ export const QueryInterchainAccountResponse = { }; } }; +GlobalDecoderRegistry.register(QueryInterchainAccountResponse.typeUrl, QueryInterchainAccountResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryInterchainAccountResponse.aminoType, QueryInterchainAccountResponse.typeUrl); function createBaseQueryParamsRequest(): QueryParamsRequest { return {}; } export const QueryParamsRequest = { typeUrl: "/ibc.applications.interchain_accounts.controller.v1.QueryParamsRequest", + aminoType: "cosmos-sdk/QueryParamsRequest", + is(o: any): o is QueryParamsRequest { + return o && o.$typeUrl === QueryParamsRequest.typeUrl; + }, + isSDK(o: any): o is QueryParamsRequestSDKType { + return o && o.$typeUrl === QueryParamsRequest.typeUrl; + }, + isAmino(o: any): o is QueryParamsRequestAmino { + return o && o.$typeUrl === QueryParamsRequest.typeUrl; + }, encode(_: QueryParamsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, @@ -245,12 +309,20 @@ export const QueryParamsRequest = { } return message; }, + fromJSON(_: any): QueryParamsRequest { + return {}; + }, + toJSON(_: QueryParamsRequest): unknown { + const obj: any = {}; + return obj; + }, fromPartial(_: Partial): QueryParamsRequest { const message = createBaseQueryParamsRequest(); return message; }, fromAmino(_: QueryParamsRequestAmino): QueryParamsRequest { - return {}; + const message = createBaseQueryParamsRequest(); + return message; }, toAmino(_: QueryParamsRequest): QueryParamsRequestAmino { const obj: any = {}; @@ -278,13 +350,25 @@ export const QueryParamsRequest = { }; } }; +GlobalDecoderRegistry.register(QueryParamsRequest.typeUrl, QueryParamsRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryParamsRequest.aminoType, QueryParamsRequest.typeUrl); function createBaseQueryParamsResponse(): QueryParamsResponse { return { - params: Params.fromPartial({}) + params: undefined }; } export const QueryParamsResponse = { typeUrl: "/ibc.applications.interchain_accounts.controller.v1.QueryParamsResponse", + aminoType: "cosmos-sdk/QueryParamsResponse", + is(o: any): o is QueryParamsResponse { + return o && o.$typeUrl === QueryParamsResponse.typeUrl; + }, + isSDK(o: any): o is QueryParamsResponseSDKType { + return o && o.$typeUrl === QueryParamsResponse.typeUrl; + }, + isAmino(o: any): o is QueryParamsResponseAmino { + return o && o.$typeUrl === QueryParamsResponse.typeUrl; + }, encode(message: QueryParamsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.params !== undefined) { Params.encode(message.params, writer.uint32(10).fork()).ldelim(); @@ -308,15 +392,27 @@ export const QueryParamsResponse = { } return message; }, + fromJSON(object: any): QueryParamsResponse { + 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; + }, fromPartial(object: Partial): QueryParamsResponse { const message = createBaseQueryParamsResponse(); message.params = object.params !== undefined && object.params !== null ? Params.fromPartial(object.params) : undefined; return message; }, fromAmino(object: QueryParamsResponseAmino): QueryParamsResponse { - return { - params: object?.params ? Params.fromAmino(object.params) : undefined - }; + const message = createBaseQueryParamsResponse(); + if (object.params !== undefined && object.params !== null) { + message.params = Params.fromAmino(object.params); + } + return message; }, toAmino(message: QueryParamsResponse): QueryParamsResponseAmino { const obj: any = {}; @@ -344,4 +440,6 @@ export const QueryParamsResponse = { value: QueryParamsResponse.encode(message).finish() }; } -}; \ No newline at end of file +}; +GlobalDecoderRegistry.register(QueryParamsResponse.typeUrl, QueryParamsResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryParamsResponse.aminoType, QueryParamsResponse.typeUrl); \ No newline at end of file diff --git a/packages/osmojs/src/codegen/ibc/applications/interchain_accounts/controller/v1/tx.amino.ts b/packages/osmojs/src/codegen/ibc/applications/interchain_accounts/controller/v1/tx.amino.ts index 52a890cd7..2632e412a 100644 --- a/packages/osmojs/src/codegen/ibc/applications/interchain_accounts/controller/v1/tx.amino.ts +++ b/packages/osmojs/src/codegen/ibc/applications/interchain_accounts/controller/v1/tx.amino.ts @@ -1,5 +1,5 @@ //@ts-nocheck -import { MsgRegisterInterchainAccount, MsgSendTx } from "./tx"; +import { MsgRegisterInterchainAccount, MsgSendTx, MsgUpdateParams } from "./tx"; export const AminoConverter = { "/ibc.applications.interchain_accounts.controller.v1.MsgRegisterInterchainAccount": { aminoType: "cosmos-sdk/MsgRegisterInterchainAccount", @@ -10,5 +10,10 @@ export const AminoConverter = { aminoType: "cosmos-sdk/MsgSendTx", toAmino: MsgSendTx.toAmino, fromAmino: MsgSendTx.fromAmino + }, + "/ibc.applications.interchain_accounts.controller.v1.MsgUpdateParams": { + aminoType: "cosmos-sdk/MsgUpdateParams", + toAmino: MsgUpdateParams.toAmino, + fromAmino: MsgUpdateParams.fromAmino } }; \ No newline at end of file diff --git a/packages/osmojs/src/codegen/ibc/applications/interchain_accounts/controller/v1/tx.registry.ts b/packages/osmojs/src/codegen/ibc/applications/interchain_accounts/controller/v1/tx.registry.ts index eaeddc0b3..78f8a82a9 100644 --- a/packages/osmojs/src/codegen/ibc/applications/interchain_accounts/controller/v1/tx.registry.ts +++ b/packages/osmojs/src/codegen/ibc/applications/interchain_accounts/controller/v1/tx.registry.ts @@ -1,7 +1,7 @@ //@ts-nocheck import { GeneratedType, Registry } from "@cosmjs/proto-signing"; -import { MsgRegisterInterchainAccount, MsgSendTx } from "./tx"; -export const registry: ReadonlyArray<[string, GeneratedType]> = [["/ibc.applications.interchain_accounts.controller.v1.MsgRegisterInterchainAccount", MsgRegisterInterchainAccount], ["/ibc.applications.interchain_accounts.controller.v1.MsgSendTx", MsgSendTx]]; +import { MsgRegisterInterchainAccount, MsgSendTx, MsgUpdateParams } from "./tx"; +export const registry: ReadonlyArray<[string, GeneratedType]> = [["/ibc.applications.interchain_accounts.controller.v1.MsgRegisterInterchainAccount", MsgRegisterInterchainAccount], ["/ibc.applications.interchain_accounts.controller.v1.MsgSendTx", MsgSendTx], ["/ibc.applications.interchain_accounts.controller.v1.MsgUpdateParams", MsgUpdateParams]]; export const load = (protoRegistry: Registry) => { registry.forEach(([typeUrl, mod]) => { protoRegistry.register(typeUrl, mod); @@ -20,6 +20,12 @@ export const MessageComposer = { typeUrl: "/ibc.applications.interchain_accounts.controller.v1.MsgSendTx", value: MsgSendTx.encode(value).finish() }; + }, + updateParams(value: MsgUpdateParams) { + return { + typeUrl: "/ibc.applications.interchain_accounts.controller.v1.MsgUpdateParams", + value: MsgUpdateParams.encode(value).finish() + }; } }, withTypeUrl: { @@ -34,6 +40,52 @@ export const MessageComposer = { typeUrl: "/ibc.applications.interchain_accounts.controller.v1.MsgSendTx", value }; + }, + updateParams(value: MsgUpdateParams) { + return { + typeUrl: "/ibc.applications.interchain_accounts.controller.v1.MsgUpdateParams", + value + }; + } + }, + toJSON: { + registerInterchainAccount(value: MsgRegisterInterchainAccount) { + return { + typeUrl: "/ibc.applications.interchain_accounts.controller.v1.MsgRegisterInterchainAccount", + value: MsgRegisterInterchainAccount.toJSON(value) + }; + }, + sendTx(value: MsgSendTx) { + return { + typeUrl: "/ibc.applications.interchain_accounts.controller.v1.MsgSendTx", + value: MsgSendTx.toJSON(value) + }; + }, + updateParams(value: MsgUpdateParams) { + return { + typeUrl: "/ibc.applications.interchain_accounts.controller.v1.MsgUpdateParams", + value: MsgUpdateParams.toJSON(value) + }; + } + }, + fromJSON: { + registerInterchainAccount(value: any) { + return { + typeUrl: "/ibc.applications.interchain_accounts.controller.v1.MsgRegisterInterchainAccount", + value: MsgRegisterInterchainAccount.fromJSON(value) + }; + }, + sendTx(value: any) { + return { + typeUrl: "/ibc.applications.interchain_accounts.controller.v1.MsgSendTx", + value: MsgSendTx.fromJSON(value) + }; + }, + updateParams(value: any) { + return { + typeUrl: "/ibc.applications.interchain_accounts.controller.v1.MsgUpdateParams", + value: MsgUpdateParams.fromJSON(value) + }; } }, fromPartial: { @@ -48,6 +100,12 @@ export const MessageComposer = { typeUrl: "/ibc.applications.interchain_accounts.controller.v1.MsgSendTx", value: MsgSendTx.fromPartial(value) }; + }, + updateParams(value: MsgUpdateParams) { + return { + typeUrl: "/ibc.applications.interchain_accounts.controller.v1.MsgUpdateParams", + value: MsgUpdateParams.fromPartial(value) + }; } } }; \ No newline at end of file diff --git a/packages/osmojs/src/codegen/ibc/applications/interchain_accounts/controller/v1/tx.rpc.msg.ts b/packages/osmojs/src/codegen/ibc/applications/interchain_accounts/controller/v1/tx.rpc.msg.ts index a9ff2ceba..b0651dacd 100644 --- a/packages/osmojs/src/codegen/ibc/applications/interchain_accounts/controller/v1/tx.rpc.msg.ts +++ b/packages/osmojs/src/codegen/ibc/applications/interchain_accounts/controller/v1/tx.rpc.msg.ts @@ -1,12 +1,14 @@ import { Rpc } from "../../../../../helpers"; import { BinaryReader } from "../../../../../binary"; -import { MsgRegisterInterchainAccount, MsgRegisterInterchainAccountResponse, MsgSendTx, MsgSendTxResponse } from "./tx"; +import { MsgRegisterInterchainAccount, MsgRegisterInterchainAccountResponse, MsgSendTx, MsgSendTxResponse, MsgUpdateParams, MsgUpdateParamsResponse } from "./tx"; /** Msg defines the 27-interchain-accounts/controller Msg service. */ export interface Msg { /** RegisterInterchainAccount defines a rpc handler for MsgRegisterInterchainAccount. */ registerInterchainAccount(request: MsgRegisterInterchainAccount): Promise; /** SendTx defines a rpc handler for MsgSendTx. */ sendTx(request: MsgSendTx): Promise; + /** UpdateParams defines a rpc handler for MsgUpdateParams. */ + updateParams(request: MsgUpdateParams): Promise; } export class MsgClientImpl implements Msg { private readonly rpc: Rpc; @@ -14,6 +16,7 @@ export class MsgClientImpl implements Msg { this.rpc = rpc; this.registerInterchainAccount = this.registerInterchainAccount.bind(this); this.sendTx = this.sendTx.bind(this); + this.updateParams = this.updateParams.bind(this); } registerInterchainAccount(request: MsgRegisterInterchainAccount): Promise { const data = MsgRegisterInterchainAccount.encode(request).finish(); @@ -25,4 +28,12 @@ export class MsgClientImpl implements Msg { const promise = this.rpc.request("ibc.applications.interchain_accounts.controller.v1.Msg", "SendTx", data); return promise.then(data => MsgSendTxResponse.decode(new BinaryReader(data))); } -} \ No newline at end of file + updateParams(request: MsgUpdateParams): Promise { + const data = MsgUpdateParams.encode(request).finish(); + const promise = this.rpc.request("ibc.applications.interchain_accounts.controller.v1.Msg", "UpdateParams", data); + return promise.then(data => MsgUpdateParamsResponse.decode(new BinaryReader(data))); + } +} +export const createClientImpl = (rpc: Rpc) => { + return new MsgClientImpl(rpc); +}; \ No newline at end of file diff --git a/packages/osmojs/src/codegen/ibc/applications/interchain_accounts/controller/v1/tx.ts b/packages/osmojs/src/codegen/ibc/applications/interchain_accounts/controller/v1/tx.ts index da390f23c..88fb10bf1 100644 --- a/packages/osmojs/src/codegen/ibc/applications/interchain_accounts/controller/v1/tx.ts +++ b/packages/osmojs/src/codegen/ibc/applications/interchain_accounts/controller/v1/tx.ts @@ -1,5 +1,8 @@ import { InterchainAccountPacketData, InterchainAccountPacketDataAmino, InterchainAccountPacketDataSDKType } from "../../v1/packet"; +import { Params, ParamsAmino, ParamsSDKType } from "./controller"; import { BinaryReader, BinaryWriter } from "../../../../../binary"; +import { isSet } from "../../../../../helpers"; +import { GlobalDecoderRegistry } from "../../../../../registry"; /** MsgRegisterInterchainAccount defines the payload for Msg/RegisterAccount */ export interface MsgRegisterInterchainAccount { owner: string; @@ -12,9 +15,9 @@ export interface MsgRegisterInterchainAccountProtoMsg { } /** MsgRegisterInterchainAccount defines the payload for Msg/RegisterAccount */ export interface MsgRegisterInterchainAccountAmino { - owner: string; - connection_id: string; - version: string; + owner?: string; + connection_id?: string; + version?: string; } export interface MsgRegisterInterchainAccountAminoMsg { type: "cosmos-sdk/MsgRegisterInterchainAccount"; @@ -37,8 +40,8 @@ export interface MsgRegisterInterchainAccountResponseProtoMsg { } /** MsgRegisterInterchainAccountResponse defines the response for Msg/RegisterAccount */ export interface MsgRegisterInterchainAccountResponseAmino { - channel_id: string; - port_id: string; + channel_id?: string; + port_id?: string; } export interface MsgRegisterInterchainAccountResponseAminoMsg { type: "cosmos-sdk/MsgRegisterInterchainAccountResponse"; @@ -66,14 +69,14 @@ export interface MsgSendTxProtoMsg { } /** MsgSendTx defines the payload for Msg/SendTx */ export interface MsgSendTxAmino { - owner: string; - connection_id: string; + owner?: string; + connection_id?: string; packet_data?: InterchainAccountPacketDataAmino; /** * Relative timeout timestamp provided will be added to the current block time during transaction execution. * The timeout timestamp must be non-zero. */ - relative_timeout: string; + relative_timeout?: string; } export interface MsgSendTxAminoMsg { type: "cosmos-sdk/MsgSendTx"; @@ -96,7 +99,7 @@ export interface MsgSendTxResponseProtoMsg { } /** MsgSendTxResponse defines the response for MsgSendTx */ export interface MsgSendTxResponseAmino { - sequence: string; + sequence?: string; } export interface MsgSendTxResponseAminoMsg { type: "cosmos-sdk/MsgSendTxResponse"; @@ -106,6 +109,55 @@ export interface MsgSendTxResponseAminoMsg { export interface MsgSendTxResponseSDKType { sequence: bigint; } +/** MsgUpdateParams defines the payload for Msg/UpdateParams */ +export interface MsgUpdateParams { + /** signer address */ + signer: string; + /** + * params defines the 27-interchain-accounts/controller parameters to update. + * + * NOTE: All parameters must be supplied. + */ + params: Params; +} +export interface MsgUpdateParamsProtoMsg { + typeUrl: "/ibc.applications.interchain_accounts.controller.v1.MsgUpdateParams"; + value: Uint8Array; +} +/** MsgUpdateParams defines the payload for Msg/UpdateParams */ +export interface MsgUpdateParamsAmino { + /** signer address */ + signer?: string; + /** + * params defines the 27-interchain-accounts/controller parameters to update. + * + * NOTE: All parameters must be supplied. + */ + params?: ParamsAmino; +} +export interface MsgUpdateParamsAminoMsg { + type: "cosmos-sdk/MsgUpdateParams"; + value: MsgUpdateParamsAmino; +} +/** MsgUpdateParams defines the payload for Msg/UpdateParams */ +export interface MsgUpdateParamsSDKType { + signer: string; + params: ParamsSDKType; +} +/** MsgUpdateParamsResponse defines the response for Msg/UpdateParams */ +export interface MsgUpdateParamsResponse {} +export interface MsgUpdateParamsResponseProtoMsg { + typeUrl: "/ibc.applications.interchain_accounts.controller.v1.MsgUpdateParamsResponse"; + value: Uint8Array; +} +/** MsgUpdateParamsResponse defines the response for Msg/UpdateParams */ +export interface MsgUpdateParamsResponseAmino {} +export interface MsgUpdateParamsResponseAminoMsg { + type: "cosmos-sdk/MsgUpdateParamsResponse"; + value: MsgUpdateParamsResponseAmino; +} +/** MsgUpdateParamsResponse defines the response for Msg/UpdateParams */ +export interface MsgUpdateParamsResponseSDKType {} function createBaseMsgRegisterInterchainAccount(): MsgRegisterInterchainAccount { return { owner: "", @@ -115,6 +167,16 @@ function createBaseMsgRegisterInterchainAccount(): MsgRegisterInterchainAccount } export const MsgRegisterInterchainAccount = { typeUrl: "/ibc.applications.interchain_accounts.controller.v1.MsgRegisterInterchainAccount", + aminoType: "cosmos-sdk/MsgRegisterInterchainAccount", + is(o: any): o is MsgRegisterInterchainAccount { + return o && (o.$typeUrl === MsgRegisterInterchainAccount.typeUrl || typeof o.owner === "string" && typeof o.connectionId === "string" && typeof o.version === "string"); + }, + isSDK(o: any): o is MsgRegisterInterchainAccountSDKType { + return o && (o.$typeUrl === MsgRegisterInterchainAccount.typeUrl || typeof o.owner === "string" && typeof o.connection_id === "string" && typeof o.version === "string"); + }, + isAmino(o: any): o is MsgRegisterInterchainAccountAmino { + return o && (o.$typeUrl === MsgRegisterInterchainAccount.typeUrl || typeof o.owner === "string" && typeof o.connection_id === "string" && typeof o.version === "string"); + }, encode(message: MsgRegisterInterchainAccount, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.owner !== "") { writer.uint32(10).string(message.owner); @@ -150,6 +212,20 @@ export const MsgRegisterInterchainAccount = { } return message; }, + fromJSON(object: any): MsgRegisterInterchainAccount { + return { + owner: isSet(object.owner) ? String(object.owner) : "", + connectionId: isSet(object.connectionId) ? String(object.connectionId) : "", + version: isSet(object.version) ? String(object.version) : "" + }; + }, + toJSON(message: MsgRegisterInterchainAccount): unknown { + const obj: any = {}; + message.owner !== undefined && (obj.owner = message.owner); + message.connectionId !== undefined && (obj.connectionId = message.connectionId); + message.version !== undefined && (obj.version = message.version); + return obj; + }, fromPartial(object: Partial): MsgRegisterInterchainAccount { const message = createBaseMsgRegisterInterchainAccount(); message.owner = object.owner ?? ""; @@ -158,11 +234,17 @@ export const MsgRegisterInterchainAccount = { return message; }, fromAmino(object: MsgRegisterInterchainAccountAmino): MsgRegisterInterchainAccount { - return { - owner: object.owner, - connectionId: object.connection_id, - version: object.version - }; + const message = createBaseMsgRegisterInterchainAccount(); + if (object.owner !== undefined && object.owner !== null) { + message.owner = object.owner; + } + if (object.connection_id !== undefined && object.connection_id !== null) { + message.connectionId = object.connection_id; + } + if (object.version !== undefined && object.version !== null) { + message.version = object.version; + } + return message; }, toAmino(message: MsgRegisterInterchainAccount): MsgRegisterInterchainAccountAmino { const obj: any = {}; @@ -193,6 +275,8 @@ export const MsgRegisterInterchainAccount = { }; } }; +GlobalDecoderRegistry.register(MsgRegisterInterchainAccount.typeUrl, MsgRegisterInterchainAccount); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgRegisterInterchainAccount.aminoType, MsgRegisterInterchainAccount.typeUrl); function createBaseMsgRegisterInterchainAccountResponse(): MsgRegisterInterchainAccountResponse { return { channelId: "", @@ -201,6 +285,16 @@ function createBaseMsgRegisterInterchainAccountResponse(): MsgRegisterInterchain } export const MsgRegisterInterchainAccountResponse = { typeUrl: "/ibc.applications.interchain_accounts.controller.v1.MsgRegisterInterchainAccountResponse", + aminoType: "cosmos-sdk/MsgRegisterInterchainAccountResponse", + is(o: any): o is MsgRegisterInterchainAccountResponse { + return o && (o.$typeUrl === MsgRegisterInterchainAccountResponse.typeUrl || typeof o.channelId === "string" && typeof o.portId === "string"); + }, + isSDK(o: any): o is MsgRegisterInterchainAccountResponseSDKType { + return o && (o.$typeUrl === MsgRegisterInterchainAccountResponse.typeUrl || typeof o.channel_id === "string" && typeof o.port_id === "string"); + }, + isAmino(o: any): o is MsgRegisterInterchainAccountResponseAmino { + return o && (o.$typeUrl === MsgRegisterInterchainAccountResponse.typeUrl || typeof o.channel_id === "string" && typeof o.port_id === "string"); + }, encode(message: MsgRegisterInterchainAccountResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.channelId !== "") { writer.uint32(10).string(message.channelId); @@ -230,6 +324,18 @@ export const MsgRegisterInterchainAccountResponse = { } return message; }, + fromJSON(object: any): MsgRegisterInterchainAccountResponse { + return { + channelId: isSet(object.channelId) ? String(object.channelId) : "", + portId: isSet(object.portId) ? String(object.portId) : "" + }; + }, + toJSON(message: MsgRegisterInterchainAccountResponse): unknown { + const obj: any = {}; + message.channelId !== undefined && (obj.channelId = message.channelId); + message.portId !== undefined && (obj.portId = message.portId); + return obj; + }, fromPartial(object: Partial): MsgRegisterInterchainAccountResponse { const message = createBaseMsgRegisterInterchainAccountResponse(); message.channelId = object.channelId ?? ""; @@ -237,10 +343,14 @@ export const MsgRegisterInterchainAccountResponse = { return message; }, fromAmino(object: MsgRegisterInterchainAccountResponseAmino): MsgRegisterInterchainAccountResponse { - return { - channelId: object.channel_id, - portId: object.port_id - }; + const message = createBaseMsgRegisterInterchainAccountResponse(); + if (object.channel_id !== undefined && object.channel_id !== null) { + message.channelId = object.channel_id; + } + if (object.port_id !== undefined && object.port_id !== null) { + message.portId = object.port_id; + } + return message; }, toAmino(message: MsgRegisterInterchainAccountResponse): MsgRegisterInterchainAccountResponseAmino { const obj: any = {}; @@ -270,6 +380,8 @@ export const MsgRegisterInterchainAccountResponse = { }; } }; +GlobalDecoderRegistry.register(MsgRegisterInterchainAccountResponse.typeUrl, MsgRegisterInterchainAccountResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgRegisterInterchainAccountResponse.aminoType, MsgRegisterInterchainAccountResponse.typeUrl); function createBaseMsgSendTx(): MsgSendTx { return { owner: "", @@ -280,6 +392,16 @@ function createBaseMsgSendTx(): MsgSendTx { } export const MsgSendTx = { typeUrl: "/ibc.applications.interchain_accounts.controller.v1.MsgSendTx", + aminoType: "cosmos-sdk/MsgSendTx", + is(o: any): o is MsgSendTx { + return o && (o.$typeUrl === MsgSendTx.typeUrl || typeof o.owner === "string" && typeof o.connectionId === "string" && InterchainAccountPacketData.is(o.packetData) && typeof o.relativeTimeout === "bigint"); + }, + isSDK(o: any): o is MsgSendTxSDKType { + return o && (o.$typeUrl === MsgSendTx.typeUrl || typeof o.owner === "string" && typeof o.connection_id === "string" && InterchainAccountPacketData.isSDK(o.packet_data) && typeof o.relative_timeout === "bigint"); + }, + isAmino(o: any): o is MsgSendTxAmino { + return o && (o.$typeUrl === MsgSendTx.typeUrl || typeof o.owner === "string" && typeof o.connection_id === "string" && InterchainAccountPacketData.isAmino(o.packet_data) && typeof o.relative_timeout === "bigint"); + }, encode(message: MsgSendTx, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.owner !== "") { writer.uint32(10).string(message.owner); @@ -321,6 +443,22 @@ export const MsgSendTx = { } return message; }, + fromJSON(object: any): MsgSendTx { + return { + owner: isSet(object.owner) ? String(object.owner) : "", + connectionId: isSet(object.connectionId) ? String(object.connectionId) : "", + packetData: isSet(object.packetData) ? InterchainAccountPacketData.fromJSON(object.packetData) : undefined, + relativeTimeout: isSet(object.relativeTimeout) ? BigInt(object.relativeTimeout.toString()) : BigInt(0) + }; + }, + toJSON(message: MsgSendTx): unknown { + const obj: any = {}; + message.owner !== undefined && (obj.owner = message.owner); + message.connectionId !== undefined && (obj.connectionId = message.connectionId); + message.packetData !== undefined && (obj.packetData = message.packetData ? InterchainAccountPacketData.toJSON(message.packetData) : undefined); + message.relativeTimeout !== undefined && (obj.relativeTimeout = (message.relativeTimeout || BigInt(0)).toString()); + return obj; + }, fromPartial(object: Partial): MsgSendTx { const message = createBaseMsgSendTx(); message.owner = object.owner ?? ""; @@ -330,12 +468,20 @@ export const MsgSendTx = { return message; }, fromAmino(object: MsgSendTxAmino): MsgSendTx { - return { - owner: object.owner, - connectionId: object.connection_id, - packetData: object?.packet_data ? InterchainAccountPacketData.fromAmino(object.packet_data) : undefined, - relativeTimeout: BigInt(object.relative_timeout) - }; + const message = createBaseMsgSendTx(); + if (object.owner !== undefined && object.owner !== null) { + message.owner = object.owner; + } + if (object.connection_id !== undefined && object.connection_id !== null) { + message.connectionId = object.connection_id; + } + if (object.packet_data !== undefined && object.packet_data !== null) { + message.packetData = InterchainAccountPacketData.fromAmino(object.packet_data); + } + if (object.relative_timeout !== undefined && object.relative_timeout !== null) { + message.relativeTimeout = BigInt(object.relative_timeout); + } + return message; }, toAmino(message: MsgSendTx): MsgSendTxAmino { const obj: any = {}; @@ -367,6 +513,8 @@ export const MsgSendTx = { }; } }; +GlobalDecoderRegistry.register(MsgSendTx.typeUrl, MsgSendTx); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgSendTx.aminoType, MsgSendTx.typeUrl); function createBaseMsgSendTxResponse(): MsgSendTxResponse { return { sequence: BigInt(0) @@ -374,6 +522,16 @@ function createBaseMsgSendTxResponse(): MsgSendTxResponse { } export const MsgSendTxResponse = { typeUrl: "/ibc.applications.interchain_accounts.controller.v1.MsgSendTxResponse", + aminoType: "cosmos-sdk/MsgSendTxResponse", + is(o: any): o is MsgSendTxResponse { + return o && (o.$typeUrl === MsgSendTxResponse.typeUrl || typeof o.sequence === "bigint"); + }, + isSDK(o: any): o is MsgSendTxResponseSDKType { + return o && (o.$typeUrl === MsgSendTxResponse.typeUrl || typeof o.sequence === "bigint"); + }, + isAmino(o: any): o is MsgSendTxResponseAmino { + return o && (o.$typeUrl === MsgSendTxResponse.typeUrl || typeof o.sequence === "bigint"); + }, encode(message: MsgSendTxResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.sequence !== BigInt(0)) { writer.uint32(8).uint64(message.sequence); @@ -397,15 +555,27 @@ export const MsgSendTxResponse = { } return message; }, + fromJSON(object: any): MsgSendTxResponse { + return { + sequence: isSet(object.sequence) ? BigInt(object.sequence.toString()) : BigInt(0) + }; + }, + toJSON(message: MsgSendTxResponse): unknown { + const obj: any = {}; + message.sequence !== undefined && (obj.sequence = (message.sequence || BigInt(0)).toString()); + return obj; + }, fromPartial(object: Partial): MsgSendTxResponse { const message = createBaseMsgSendTxResponse(); message.sequence = object.sequence !== undefined && object.sequence !== null ? BigInt(object.sequence.toString()) : BigInt(0); return message; }, fromAmino(object: MsgSendTxResponseAmino): MsgSendTxResponse { - return { - sequence: BigInt(object.sequence) - }; + const message = createBaseMsgSendTxResponse(); + if (object.sequence !== undefined && object.sequence !== null) { + message.sequence = BigInt(object.sequence); + } + return message; }, toAmino(message: MsgSendTxResponse): MsgSendTxResponseAmino { const obj: any = {}; @@ -433,4 +603,186 @@ export const MsgSendTxResponse = { value: MsgSendTxResponse.encode(message).finish() }; } -}; \ No newline at end of file +}; +GlobalDecoderRegistry.register(MsgSendTxResponse.typeUrl, MsgSendTxResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgSendTxResponse.aminoType, MsgSendTxResponse.typeUrl); +function createBaseMsgUpdateParams(): MsgUpdateParams { + return { + signer: "", + params: Params.fromPartial({}) + }; +} +export const MsgUpdateParams = { + typeUrl: "/ibc.applications.interchain_accounts.controller.v1.MsgUpdateParams", + aminoType: "cosmos-sdk/MsgUpdateParams", + is(o: any): o is MsgUpdateParams { + return o && (o.$typeUrl === MsgUpdateParams.typeUrl || typeof o.signer === "string" && Params.is(o.params)); + }, + isSDK(o: any): o is MsgUpdateParamsSDKType { + return o && (o.$typeUrl === MsgUpdateParams.typeUrl || typeof o.signer === "string" && Params.isSDK(o.params)); + }, + isAmino(o: any): o is MsgUpdateParamsAmino { + return o && (o.$typeUrl === MsgUpdateParams.typeUrl || typeof o.signer === "string" && Params.isAmino(o.params)); + }, + encode(message: MsgUpdateParams, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.signer !== "") { + writer.uint32(10).string(message.signer); + } + if (message.params !== undefined) { + Params.encode(message.params, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgUpdateParams { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUpdateParams(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.signer = reader.string(); + break; + case 2: + message.params = Params.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): MsgUpdateParams { + return { + signer: isSet(object.signer) ? String(object.signer) : "", + params: isSet(object.params) ? Params.fromJSON(object.params) : undefined + }; + }, + toJSON(message: MsgUpdateParams): unknown { + const obj: any = {}; + message.signer !== undefined && (obj.signer = message.signer); + message.params !== undefined && (obj.params = message.params ? Params.toJSON(message.params) : undefined); + return obj; + }, + fromPartial(object: Partial): MsgUpdateParams { + const message = createBaseMsgUpdateParams(); + message.signer = object.signer ?? ""; + message.params = object.params !== undefined && object.params !== null ? Params.fromPartial(object.params) : undefined; + return message; + }, + fromAmino(object: MsgUpdateParamsAmino): MsgUpdateParams { + const message = createBaseMsgUpdateParams(); + if (object.signer !== undefined && object.signer !== null) { + message.signer = object.signer; + } + if (object.params !== undefined && object.params !== null) { + message.params = Params.fromAmino(object.params); + } + return message; + }, + toAmino(message: MsgUpdateParams): MsgUpdateParamsAmino { + const obj: any = {}; + obj.signer = message.signer; + obj.params = message.params ? Params.toAmino(message.params) : undefined; + return obj; + }, + fromAminoMsg(object: MsgUpdateParamsAminoMsg): MsgUpdateParams { + return MsgUpdateParams.fromAmino(object.value); + }, + toAminoMsg(message: MsgUpdateParams): MsgUpdateParamsAminoMsg { + return { + type: "cosmos-sdk/MsgUpdateParams", + value: MsgUpdateParams.toAmino(message) + }; + }, + fromProtoMsg(message: MsgUpdateParamsProtoMsg): MsgUpdateParams { + return MsgUpdateParams.decode(message.value); + }, + toProto(message: MsgUpdateParams): Uint8Array { + return MsgUpdateParams.encode(message).finish(); + }, + toProtoMsg(message: MsgUpdateParams): MsgUpdateParamsProtoMsg { + return { + typeUrl: "/ibc.applications.interchain_accounts.controller.v1.MsgUpdateParams", + value: MsgUpdateParams.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgUpdateParams.typeUrl, MsgUpdateParams); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgUpdateParams.aminoType, MsgUpdateParams.typeUrl); +function createBaseMsgUpdateParamsResponse(): MsgUpdateParamsResponse { + return {}; +} +export const MsgUpdateParamsResponse = { + typeUrl: "/ibc.applications.interchain_accounts.controller.v1.MsgUpdateParamsResponse", + aminoType: "cosmos-sdk/MsgUpdateParamsResponse", + is(o: any): o is MsgUpdateParamsResponse { + return o && o.$typeUrl === MsgUpdateParamsResponse.typeUrl; + }, + isSDK(o: any): o is MsgUpdateParamsResponseSDKType { + return o && o.$typeUrl === MsgUpdateParamsResponse.typeUrl; + }, + isAmino(o: any): o is MsgUpdateParamsResponseAmino { + return o && o.$typeUrl === MsgUpdateParamsResponse.typeUrl; + }, + encode(_: MsgUpdateParamsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgUpdateParamsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUpdateParamsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(_: any): MsgUpdateParamsResponse { + return {}; + }, + toJSON(_: MsgUpdateParamsResponse): unknown { + const obj: any = {}; + return obj; + }, + fromPartial(_: Partial): MsgUpdateParamsResponse { + const message = createBaseMsgUpdateParamsResponse(); + return message; + }, + fromAmino(_: MsgUpdateParamsResponseAmino): MsgUpdateParamsResponse { + const message = createBaseMsgUpdateParamsResponse(); + return message; + }, + toAmino(_: MsgUpdateParamsResponse): MsgUpdateParamsResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgUpdateParamsResponseAminoMsg): MsgUpdateParamsResponse { + return MsgUpdateParamsResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgUpdateParamsResponse): MsgUpdateParamsResponseAminoMsg { + return { + type: "cosmos-sdk/MsgUpdateParamsResponse", + value: MsgUpdateParamsResponse.toAmino(message) + }; + }, + fromProtoMsg(message: MsgUpdateParamsResponseProtoMsg): MsgUpdateParamsResponse { + return MsgUpdateParamsResponse.decode(message.value); + }, + toProto(message: MsgUpdateParamsResponse): Uint8Array { + return MsgUpdateParamsResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgUpdateParamsResponse): MsgUpdateParamsResponseProtoMsg { + return { + typeUrl: "/ibc.applications.interchain_accounts.controller.v1.MsgUpdateParamsResponse", + value: MsgUpdateParamsResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgUpdateParamsResponse.typeUrl, MsgUpdateParamsResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgUpdateParamsResponse.aminoType, MsgUpdateParamsResponse.typeUrl); \ No newline at end of file diff --git a/packages/osmojs/src/codegen/ibc/applications/interchain_accounts/genesis/v1/genesis.ts b/packages/osmojs/src/codegen/ibc/applications/interchain_accounts/genesis/v1/genesis.ts index d2ffd0c39..c110535ae 100644 --- a/packages/osmojs/src/codegen/ibc/applications/interchain_accounts/genesis/v1/genesis.ts +++ b/packages/osmojs/src/codegen/ibc/applications/interchain_accounts/genesis/v1/genesis.ts @@ -5,6 +5,8 @@ import { Params as Params2 } from "../../host/v1/host"; import { ParamsAmino as Params2Amino } from "../../host/v1/host"; import { ParamsSDKType as Params2SDKType } from "../../host/v1/host"; import { BinaryReader, BinaryWriter } from "../../../../../binary"; +import { isSet } from "../../../../../helpers"; +import { GlobalDecoderRegistry } from "../../../../../registry"; /** GenesisState defines the interchain accounts genesis state */ export interface GenesisState { controllerGenesisState: ControllerGenesisState; @@ -41,9 +43,9 @@ export interface ControllerGenesisStateProtoMsg { } /** ControllerGenesisState defines the interchain accounts controller genesis state */ export interface ControllerGenesisStateAmino { - active_channels: ActiveChannelAmino[]; - interchain_accounts: RegisteredInterchainAccountAmino[]; - ports: string[]; + active_channels?: ActiveChannelAmino[]; + interchain_accounts?: RegisteredInterchainAccountAmino[]; + ports?: string[]; params?: Params1Amino; } export interface ControllerGenesisStateAminoMsg { @@ -70,9 +72,9 @@ export interface HostGenesisStateProtoMsg { } /** HostGenesisState defines the interchain accounts host genesis state */ export interface HostGenesisStateAmino { - active_channels: ActiveChannelAmino[]; - interchain_accounts: RegisteredInterchainAccountAmino[]; - port: string; + active_channels?: ActiveChannelAmino[]; + interchain_accounts?: RegisteredInterchainAccountAmino[]; + port?: string; params?: Params2Amino; } export interface HostGenesisStateAminoMsg { @@ -105,10 +107,10 @@ export interface ActiveChannelProtoMsg { * indicate if the channel is middleware enabled */ export interface ActiveChannelAmino { - connection_id: string; - port_id: string; - channel_id: string; - is_middleware_enabled: boolean; + connection_id?: string; + port_id?: string; + channel_id?: string; + is_middleware_enabled?: boolean; } export interface ActiveChannelAminoMsg { type: "cosmos-sdk/ActiveChannel"; @@ -136,9 +138,9 @@ export interface RegisteredInterchainAccountProtoMsg { } /** RegisteredInterchainAccount contains a connection ID, port ID and associated interchain account address */ export interface RegisteredInterchainAccountAmino { - connection_id: string; - port_id: string; - account_address: string; + connection_id?: string; + port_id?: string; + account_address?: string; } export interface RegisteredInterchainAccountAminoMsg { type: "cosmos-sdk/RegisteredInterchainAccount"; @@ -158,6 +160,16 @@ function createBaseGenesisState(): GenesisState { } export const GenesisState = { typeUrl: "/ibc.applications.interchain_accounts.genesis.v1.GenesisState", + aminoType: "cosmos-sdk/GenesisState", + is(o: any): o is GenesisState { + return o && (o.$typeUrl === GenesisState.typeUrl || ControllerGenesisState.is(o.controllerGenesisState) && HostGenesisState.is(o.hostGenesisState)); + }, + isSDK(o: any): o is GenesisStateSDKType { + return o && (o.$typeUrl === GenesisState.typeUrl || ControllerGenesisState.isSDK(o.controller_genesis_state) && HostGenesisState.isSDK(o.host_genesis_state)); + }, + isAmino(o: any): o is GenesisStateAmino { + return o && (o.$typeUrl === GenesisState.typeUrl || ControllerGenesisState.isAmino(o.controller_genesis_state) && HostGenesisState.isAmino(o.host_genesis_state)); + }, encode(message: GenesisState, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.controllerGenesisState !== undefined) { ControllerGenesisState.encode(message.controllerGenesisState, writer.uint32(10).fork()).ldelim(); @@ -187,6 +199,18 @@ export const GenesisState = { } return message; }, + fromJSON(object: any): GenesisState { + return { + controllerGenesisState: isSet(object.controllerGenesisState) ? ControllerGenesisState.fromJSON(object.controllerGenesisState) : undefined, + hostGenesisState: isSet(object.hostGenesisState) ? HostGenesisState.fromJSON(object.hostGenesisState) : undefined + }; + }, + toJSON(message: GenesisState): unknown { + const obj: any = {}; + message.controllerGenesisState !== undefined && (obj.controllerGenesisState = message.controllerGenesisState ? ControllerGenesisState.toJSON(message.controllerGenesisState) : undefined); + message.hostGenesisState !== undefined && (obj.hostGenesisState = message.hostGenesisState ? HostGenesisState.toJSON(message.hostGenesisState) : undefined); + return obj; + }, fromPartial(object: Partial): GenesisState { const message = createBaseGenesisState(); message.controllerGenesisState = object.controllerGenesisState !== undefined && object.controllerGenesisState !== null ? ControllerGenesisState.fromPartial(object.controllerGenesisState) : undefined; @@ -194,10 +218,14 @@ export const GenesisState = { return message; }, fromAmino(object: GenesisStateAmino): GenesisState { - return { - controllerGenesisState: object?.controller_genesis_state ? ControllerGenesisState.fromAmino(object.controller_genesis_state) : undefined, - hostGenesisState: object?.host_genesis_state ? HostGenesisState.fromAmino(object.host_genesis_state) : undefined - }; + const message = createBaseGenesisState(); + if (object.controller_genesis_state !== undefined && object.controller_genesis_state !== null) { + message.controllerGenesisState = ControllerGenesisState.fromAmino(object.controller_genesis_state); + } + if (object.host_genesis_state !== undefined && object.host_genesis_state !== null) { + message.hostGenesisState = HostGenesisState.fromAmino(object.host_genesis_state); + } + return message; }, toAmino(message: GenesisState): GenesisStateAmino { const obj: any = {}; @@ -227,16 +255,28 @@ export const GenesisState = { }; } }; +GlobalDecoderRegistry.register(GenesisState.typeUrl, GenesisState); +GlobalDecoderRegistry.registerAminoProtoMapping(GenesisState.aminoType, GenesisState.typeUrl); function createBaseControllerGenesisState(): ControllerGenesisState { return { activeChannels: [], interchainAccounts: [], ports: [], - params: Params.fromPartial({}) + params: Params1.fromPartial({}) }; } export const ControllerGenesisState = { typeUrl: "/ibc.applications.interchain_accounts.genesis.v1.ControllerGenesisState", + aminoType: "cosmos-sdk/ControllerGenesisState", + is(o: any): o is ControllerGenesisState { + return o && (o.$typeUrl === ControllerGenesisState.typeUrl || Array.isArray(o.activeChannels) && (!o.activeChannels.length || ActiveChannel.is(o.activeChannels[0])) && Array.isArray(o.interchainAccounts) && (!o.interchainAccounts.length || RegisteredInterchainAccount.is(o.interchainAccounts[0])) && Array.isArray(o.ports) && (!o.ports.length || typeof o.ports[0] === "string") && Params1.is(o.params)); + }, + isSDK(o: any): o is ControllerGenesisStateSDKType { + return o && (o.$typeUrl === ControllerGenesisState.typeUrl || Array.isArray(o.active_channels) && (!o.active_channels.length || ActiveChannel.isSDK(o.active_channels[0])) && Array.isArray(o.interchain_accounts) && (!o.interchain_accounts.length || RegisteredInterchainAccount.isSDK(o.interchain_accounts[0])) && Array.isArray(o.ports) && (!o.ports.length || typeof o.ports[0] === "string") && Params1.isSDK(o.params)); + }, + isAmino(o: any): o is ControllerGenesisStateAmino { + return o && (o.$typeUrl === ControllerGenesisState.typeUrl || Array.isArray(o.active_channels) && (!o.active_channels.length || ActiveChannel.isAmino(o.active_channels[0])) && Array.isArray(o.interchain_accounts) && (!o.interchain_accounts.length || RegisteredInterchainAccount.isAmino(o.interchain_accounts[0])) && Array.isArray(o.ports) && (!o.ports.length || typeof o.ports[0] === "string") && Params1.isAmino(o.params)); + }, encode(message: ControllerGenesisState, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.activeChannels) { ActiveChannel.encode(v!, writer.uint32(10).fork()).ldelim(); @@ -278,6 +318,34 @@ export const ControllerGenesisState = { } return message; }, + fromJSON(object: any): ControllerGenesisState { + return { + activeChannels: Array.isArray(object?.activeChannels) ? object.activeChannels.map((e: any) => ActiveChannel.fromJSON(e)) : [], + interchainAccounts: Array.isArray(object?.interchainAccounts) ? object.interchainAccounts.map((e: any) => RegisteredInterchainAccount.fromJSON(e)) : [], + ports: Array.isArray(object?.ports) ? object.ports.map((e: any) => String(e)) : [], + params: isSet(object.params) ? Params1.fromJSON(object.params) : undefined + }; + }, + toJSON(message: ControllerGenesisState): unknown { + const obj: any = {}; + if (message.activeChannels) { + obj.activeChannels = message.activeChannels.map(e => e ? ActiveChannel.toJSON(e) : undefined); + } else { + obj.activeChannels = []; + } + if (message.interchainAccounts) { + obj.interchainAccounts = message.interchainAccounts.map(e => e ? RegisteredInterchainAccount.toJSON(e) : undefined); + } else { + obj.interchainAccounts = []; + } + if (message.ports) { + obj.ports = message.ports.map(e => e); + } else { + obj.ports = []; + } + message.params !== undefined && (obj.params = message.params ? Params1.toJSON(message.params) : undefined); + return obj; + }, fromPartial(object: Partial): ControllerGenesisState { const message = createBaseControllerGenesisState(); message.activeChannels = object.activeChannels?.map(e => ActiveChannel.fromPartial(e)) || []; @@ -287,12 +355,14 @@ export const ControllerGenesisState = { return message; }, fromAmino(object: ControllerGenesisStateAmino): ControllerGenesisState { - return { - activeChannels: Array.isArray(object?.active_channels) ? object.active_channels.map((e: any) => ActiveChannel.fromAmino(e)) : [], - interchainAccounts: Array.isArray(object?.interchain_accounts) ? object.interchain_accounts.map((e: any) => RegisteredInterchainAccount.fromAmino(e)) : [], - ports: Array.isArray(object?.ports) ? object.ports.map((e: any) => e) : [], - params: object?.params ? Params1.fromAmino(object.params) : undefined - }; + const message = createBaseControllerGenesisState(); + message.activeChannels = object.active_channels?.map(e => ActiveChannel.fromAmino(e)) || []; + message.interchainAccounts = object.interchain_accounts?.map(e => RegisteredInterchainAccount.fromAmino(e)) || []; + message.ports = object.ports?.map(e => e) || []; + if (object.params !== undefined && object.params !== null) { + message.params = Params1.fromAmino(object.params); + } + return message; }, toAmino(message: ControllerGenesisState): ControllerGenesisStateAmino { const obj: any = {}; @@ -336,16 +406,28 @@ export const ControllerGenesisState = { }; } }; +GlobalDecoderRegistry.register(ControllerGenesisState.typeUrl, ControllerGenesisState); +GlobalDecoderRegistry.registerAminoProtoMapping(ControllerGenesisState.aminoType, ControllerGenesisState.typeUrl); function createBaseHostGenesisState(): HostGenesisState { return { activeChannels: [], interchainAccounts: [], port: "", - params: Params.fromPartial({}) + params: Params2.fromPartial({}) }; } export const HostGenesisState = { typeUrl: "/ibc.applications.interchain_accounts.genesis.v1.HostGenesisState", + aminoType: "cosmos-sdk/HostGenesisState", + is(o: any): o is HostGenesisState { + return o && (o.$typeUrl === HostGenesisState.typeUrl || Array.isArray(o.activeChannels) && (!o.activeChannels.length || ActiveChannel.is(o.activeChannels[0])) && Array.isArray(o.interchainAccounts) && (!o.interchainAccounts.length || RegisteredInterchainAccount.is(o.interchainAccounts[0])) && typeof o.port === "string" && Params2.is(o.params)); + }, + isSDK(o: any): o is HostGenesisStateSDKType { + return o && (o.$typeUrl === HostGenesisState.typeUrl || Array.isArray(o.active_channels) && (!o.active_channels.length || ActiveChannel.isSDK(o.active_channels[0])) && Array.isArray(o.interchain_accounts) && (!o.interchain_accounts.length || RegisteredInterchainAccount.isSDK(o.interchain_accounts[0])) && typeof o.port === "string" && Params2.isSDK(o.params)); + }, + isAmino(o: any): o is HostGenesisStateAmino { + return o && (o.$typeUrl === HostGenesisState.typeUrl || Array.isArray(o.active_channels) && (!o.active_channels.length || ActiveChannel.isAmino(o.active_channels[0])) && Array.isArray(o.interchain_accounts) && (!o.interchain_accounts.length || RegisteredInterchainAccount.isAmino(o.interchain_accounts[0])) && typeof o.port === "string" && Params2.isAmino(o.params)); + }, encode(message: HostGenesisState, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.activeChannels) { ActiveChannel.encode(v!, writer.uint32(10).fork()).ldelim(); @@ -387,6 +469,30 @@ export const HostGenesisState = { } return message; }, + fromJSON(object: any): HostGenesisState { + return { + activeChannels: Array.isArray(object?.activeChannels) ? object.activeChannels.map((e: any) => ActiveChannel.fromJSON(e)) : [], + interchainAccounts: Array.isArray(object?.interchainAccounts) ? object.interchainAccounts.map((e: any) => RegisteredInterchainAccount.fromJSON(e)) : [], + port: isSet(object.port) ? String(object.port) : "", + params: isSet(object.params) ? Params2.fromJSON(object.params) : undefined + }; + }, + toJSON(message: HostGenesisState): unknown { + const obj: any = {}; + if (message.activeChannels) { + obj.activeChannels = message.activeChannels.map(e => e ? ActiveChannel.toJSON(e) : undefined); + } else { + obj.activeChannels = []; + } + if (message.interchainAccounts) { + obj.interchainAccounts = message.interchainAccounts.map(e => e ? RegisteredInterchainAccount.toJSON(e) : undefined); + } else { + obj.interchainAccounts = []; + } + message.port !== undefined && (obj.port = message.port); + message.params !== undefined && (obj.params = message.params ? Params2.toJSON(message.params) : undefined); + return obj; + }, fromPartial(object: Partial): HostGenesisState { const message = createBaseHostGenesisState(); message.activeChannels = object.activeChannels?.map(e => ActiveChannel.fromPartial(e)) || []; @@ -396,12 +502,16 @@ export const HostGenesisState = { return message; }, fromAmino(object: HostGenesisStateAmino): HostGenesisState { - return { - activeChannels: Array.isArray(object?.active_channels) ? object.active_channels.map((e: any) => ActiveChannel.fromAmino(e)) : [], - interchainAccounts: Array.isArray(object?.interchain_accounts) ? object.interchain_accounts.map((e: any) => RegisteredInterchainAccount.fromAmino(e)) : [], - port: object.port, - params: object?.params ? Params2.fromAmino(object.params) : undefined - }; + const message = createBaseHostGenesisState(); + message.activeChannels = object.active_channels?.map(e => ActiveChannel.fromAmino(e)) || []; + message.interchainAccounts = object.interchain_accounts?.map(e => RegisteredInterchainAccount.fromAmino(e)) || []; + if (object.port !== undefined && object.port !== null) { + message.port = object.port; + } + if (object.params !== undefined && object.params !== null) { + message.params = Params2.fromAmino(object.params); + } + return message; }, toAmino(message: HostGenesisState): HostGenesisStateAmino { const obj: any = {}; @@ -441,6 +551,8 @@ export const HostGenesisState = { }; } }; +GlobalDecoderRegistry.register(HostGenesisState.typeUrl, HostGenesisState); +GlobalDecoderRegistry.registerAminoProtoMapping(HostGenesisState.aminoType, HostGenesisState.typeUrl); function createBaseActiveChannel(): ActiveChannel { return { connectionId: "", @@ -451,6 +563,16 @@ function createBaseActiveChannel(): ActiveChannel { } export const ActiveChannel = { typeUrl: "/ibc.applications.interchain_accounts.genesis.v1.ActiveChannel", + aminoType: "cosmos-sdk/ActiveChannel", + is(o: any): o is ActiveChannel { + return o && (o.$typeUrl === ActiveChannel.typeUrl || typeof o.connectionId === "string" && typeof o.portId === "string" && typeof o.channelId === "string" && typeof o.isMiddlewareEnabled === "boolean"); + }, + isSDK(o: any): o is ActiveChannelSDKType { + return o && (o.$typeUrl === ActiveChannel.typeUrl || typeof o.connection_id === "string" && typeof o.port_id === "string" && typeof o.channel_id === "string" && typeof o.is_middleware_enabled === "boolean"); + }, + isAmino(o: any): o is ActiveChannelAmino { + return o && (o.$typeUrl === ActiveChannel.typeUrl || typeof o.connection_id === "string" && typeof o.port_id === "string" && typeof o.channel_id === "string" && typeof o.is_middleware_enabled === "boolean"); + }, encode(message: ActiveChannel, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.connectionId !== "") { writer.uint32(10).string(message.connectionId); @@ -492,6 +614,22 @@ export const ActiveChannel = { } return message; }, + fromJSON(object: any): ActiveChannel { + return { + connectionId: isSet(object.connectionId) ? String(object.connectionId) : "", + portId: isSet(object.portId) ? String(object.portId) : "", + channelId: isSet(object.channelId) ? String(object.channelId) : "", + isMiddlewareEnabled: isSet(object.isMiddlewareEnabled) ? Boolean(object.isMiddlewareEnabled) : false + }; + }, + toJSON(message: ActiveChannel): unknown { + const obj: any = {}; + message.connectionId !== undefined && (obj.connectionId = message.connectionId); + message.portId !== undefined && (obj.portId = message.portId); + message.channelId !== undefined && (obj.channelId = message.channelId); + message.isMiddlewareEnabled !== undefined && (obj.isMiddlewareEnabled = message.isMiddlewareEnabled); + return obj; + }, fromPartial(object: Partial): ActiveChannel { const message = createBaseActiveChannel(); message.connectionId = object.connectionId ?? ""; @@ -501,12 +639,20 @@ export const ActiveChannel = { return message; }, fromAmino(object: ActiveChannelAmino): ActiveChannel { - return { - connectionId: object.connection_id, - portId: object.port_id, - channelId: object.channel_id, - isMiddlewareEnabled: object.is_middleware_enabled - }; + const message = createBaseActiveChannel(); + if (object.connection_id !== undefined && object.connection_id !== null) { + message.connectionId = object.connection_id; + } + if (object.port_id !== undefined && object.port_id !== null) { + message.portId = object.port_id; + } + if (object.channel_id !== undefined && object.channel_id !== null) { + message.channelId = object.channel_id; + } + if (object.is_middleware_enabled !== undefined && object.is_middleware_enabled !== null) { + message.isMiddlewareEnabled = object.is_middleware_enabled; + } + return message; }, toAmino(message: ActiveChannel): ActiveChannelAmino { const obj: any = {}; @@ -538,6 +684,8 @@ export const ActiveChannel = { }; } }; +GlobalDecoderRegistry.register(ActiveChannel.typeUrl, ActiveChannel); +GlobalDecoderRegistry.registerAminoProtoMapping(ActiveChannel.aminoType, ActiveChannel.typeUrl); function createBaseRegisteredInterchainAccount(): RegisteredInterchainAccount { return { connectionId: "", @@ -547,6 +695,16 @@ function createBaseRegisteredInterchainAccount(): RegisteredInterchainAccount { } export const RegisteredInterchainAccount = { typeUrl: "/ibc.applications.interchain_accounts.genesis.v1.RegisteredInterchainAccount", + aminoType: "cosmos-sdk/RegisteredInterchainAccount", + is(o: any): o is RegisteredInterchainAccount { + return o && (o.$typeUrl === RegisteredInterchainAccount.typeUrl || typeof o.connectionId === "string" && typeof o.portId === "string" && typeof o.accountAddress === "string"); + }, + isSDK(o: any): o is RegisteredInterchainAccountSDKType { + return o && (o.$typeUrl === RegisteredInterchainAccount.typeUrl || typeof o.connection_id === "string" && typeof o.port_id === "string" && typeof o.account_address === "string"); + }, + isAmino(o: any): o is RegisteredInterchainAccountAmino { + return o && (o.$typeUrl === RegisteredInterchainAccount.typeUrl || typeof o.connection_id === "string" && typeof o.port_id === "string" && typeof o.account_address === "string"); + }, encode(message: RegisteredInterchainAccount, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.connectionId !== "") { writer.uint32(10).string(message.connectionId); @@ -582,6 +740,20 @@ export const RegisteredInterchainAccount = { } return message; }, + fromJSON(object: any): RegisteredInterchainAccount { + return { + connectionId: isSet(object.connectionId) ? String(object.connectionId) : "", + portId: isSet(object.portId) ? String(object.portId) : "", + accountAddress: isSet(object.accountAddress) ? String(object.accountAddress) : "" + }; + }, + toJSON(message: RegisteredInterchainAccount): unknown { + const obj: any = {}; + message.connectionId !== undefined && (obj.connectionId = message.connectionId); + message.portId !== undefined && (obj.portId = message.portId); + message.accountAddress !== undefined && (obj.accountAddress = message.accountAddress); + return obj; + }, fromPartial(object: Partial): RegisteredInterchainAccount { const message = createBaseRegisteredInterchainAccount(); message.connectionId = object.connectionId ?? ""; @@ -590,11 +762,17 @@ export const RegisteredInterchainAccount = { return message; }, fromAmino(object: RegisteredInterchainAccountAmino): RegisteredInterchainAccount { - return { - connectionId: object.connection_id, - portId: object.port_id, - accountAddress: object.account_address - }; + const message = createBaseRegisteredInterchainAccount(); + if (object.connection_id !== undefined && object.connection_id !== null) { + message.connectionId = object.connection_id; + } + if (object.port_id !== undefined && object.port_id !== null) { + message.portId = object.port_id; + } + if (object.account_address !== undefined && object.account_address !== null) { + message.accountAddress = object.account_address; + } + return message; }, toAmino(message: RegisteredInterchainAccount): RegisteredInterchainAccountAmino { const obj: any = {}; @@ -624,4 +802,6 @@ export const RegisteredInterchainAccount = { value: RegisteredInterchainAccount.encode(message).finish() }; } -}; \ No newline at end of file +}; +GlobalDecoderRegistry.register(RegisteredInterchainAccount.typeUrl, RegisteredInterchainAccount); +GlobalDecoderRegistry.registerAminoProtoMapping(RegisteredInterchainAccount.aminoType, RegisteredInterchainAccount.typeUrl); \ No newline at end of file diff --git a/packages/osmojs/src/codegen/ibc/applications/interchain_accounts/host/v1/host.ts b/packages/osmojs/src/codegen/ibc/applications/interchain_accounts/host/v1/host.ts index 4448c9dcd..3cd52553d 100644 --- a/packages/osmojs/src/codegen/ibc/applications/interchain_accounts/host/v1/host.ts +++ b/packages/osmojs/src/codegen/ibc/applications/interchain_accounts/host/v1/host.ts @@ -1,4 +1,6 @@ import { BinaryReader, BinaryWriter } from "../../../../../binary"; +import { isSet } from "../../../../../helpers"; +import { GlobalDecoderRegistry } from "../../../../../registry"; /** * Params defines the set of on-chain interchain accounts parameters. * The following parameters may be used to disable the host submodule. @@ -19,9 +21,9 @@ export interface ParamsProtoMsg { */ export interface ParamsAmino { /** host_enabled enables or disables the host submodule. */ - host_enabled: boolean; + host_enabled?: boolean; /** allow_messages defines a list of sdk message typeURLs allowed to be executed on a host chain. */ - allow_messages: string[]; + allow_messages?: string[]; } export interface ParamsAminoMsg { type: "cosmos-sdk/Params"; @@ -43,6 +45,16 @@ function createBaseParams(): Params { } export const Params = { typeUrl: "/ibc.applications.interchain_accounts.host.v1.Params", + aminoType: "cosmos-sdk/Params", + is(o: any): o is Params { + return o && (o.$typeUrl === Params.typeUrl || typeof o.hostEnabled === "boolean" && Array.isArray(o.allowMessages) && (!o.allowMessages.length || typeof o.allowMessages[0] === "string")); + }, + isSDK(o: any): o is ParamsSDKType { + return o && (o.$typeUrl === Params.typeUrl || typeof o.host_enabled === "boolean" && Array.isArray(o.allow_messages) && (!o.allow_messages.length || typeof o.allow_messages[0] === "string")); + }, + isAmino(o: any): o is ParamsAmino { + return o && (o.$typeUrl === Params.typeUrl || typeof o.host_enabled === "boolean" && Array.isArray(o.allow_messages) && (!o.allow_messages.length || typeof o.allow_messages[0] === "string")); + }, encode(message: Params, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.hostEnabled === true) { writer.uint32(8).bool(message.hostEnabled); @@ -72,6 +84,22 @@ export const Params = { } return message; }, + fromJSON(object: any): Params { + return { + hostEnabled: isSet(object.hostEnabled) ? Boolean(object.hostEnabled) : false, + allowMessages: Array.isArray(object?.allowMessages) ? object.allowMessages.map((e: any) => String(e)) : [] + }; + }, + toJSON(message: Params): unknown { + const obj: any = {}; + message.hostEnabled !== undefined && (obj.hostEnabled = message.hostEnabled); + if (message.allowMessages) { + obj.allowMessages = message.allowMessages.map(e => e); + } else { + obj.allowMessages = []; + } + return obj; + }, fromPartial(object: Partial): Params { const message = createBaseParams(); message.hostEnabled = object.hostEnabled ?? false; @@ -79,10 +107,12 @@ export const Params = { return message; }, fromAmino(object: ParamsAmino): Params { - return { - hostEnabled: object.host_enabled, - allowMessages: Array.isArray(object?.allow_messages) ? object.allow_messages.map((e: any) => e) : [] - }; + const message = createBaseParams(); + if (object.host_enabled !== undefined && object.host_enabled !== null) { + message.hostEnabled = object.host_enabled; + } + message.allowMessages = object.allow_messages?.map(e => e) || []; + return message; }, toAmino(message: Params): ParamsAmino { const obj: any = {}; @@ -115,4 +145,6 @@ export const Params = { value: Params.encode(message).finish() }; } -}; \ No newline at end of file +}; +GlobalDecoderRegistry.register(Params.typeUrl, Params); +GlobalDecoderRegistry.registerAminoProtoMapping(Params.aminoType, Params.typeUrl); \ No newline at end of file diff --git a/packages/osmojs/src/codegen/ibc/applications/interchain_accounts/host/v1/query.ts b/packages/osmojs/src/codegen/ibc/applications/interchain_accounts/host/v1/query.ts index 58675be2c..88a9b2dde 100644 --- a/packages/osmojs/src/codegen/ibc/applications/interchain_accounts/host/v1/query.ts +++ b/packages/osmojs/src/codegen/ibc/applications/interchain_accounts/host/v1/query.ts @@ -1,5 +1,7 @@ import { Params, ParamsAmino, ParamsSDKType } from "./host"; import { BinaryReader, BinaryWriter } from "../../../../../binary"; +import { GlobalDecoderRegistry } from "../../../../../registry"; +import { isSet } from "../../../../../helpers"; /** QueryParamsRequest is the request type for the Query/Params RPC method. */ export interface QueryParamsRequest {} export interface QueryParamsRequestProtoMsg { @@ -17,7 +19,7 @@ export interface QueryParamsRequestSDKType {} /** 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; } export interface QueryParamsResponseProtoMsg { typeUrl: "/ibc.applications.interchain_accounts.host.v1.QueryParamsResponse"; @@ -34,13 +36,23 @@ export interface QueryParamsResponseAminoMsg { } /** QueryParamsResponse is the response type for the Query/Params RPC method. */ export interface QueryParamsResponseSDKType { - params: ParamsSDKType; + params?: ParamsSDKType; } function createBaseQueryParamsRequest(): QueryParamsRequest { return {}; } export const QueryParamsRequest = { typeUrl: "/ibc.applications.interchain_accounts.host.v1.QueryParamsRequest", + aminoType: "cosmos-sdk/QueryParamsRequest", + is(o: any): o is QueryParamsRequest { + return o && o.$typeUrl === QueryParamsRequest.typeUrl; + }, + isSDK(o: any): o is QueryParamsRequestSDKType { + return o && o.$typeUrl === QueryParamsRequest.typeUrl; + }, + isAmino(o: any): o is QueryParamsRequestAmino { + return o && o.$typeUrl === QueryParamsRequest.typeUrl; + }, encode(_: QueryParamsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, @@ -58,12 +70,20 @@ export const QueryParamsRequest = { } return message; }, + fromJSON(_: any): QueryParamsRequest { + return {}; + }, + toJSON(_: QueryParamsRequest): unknown { + const obj: any = {}; + return obj; + }, fromPartial(_: Partial): QueryParamsRequest { const message = createBaseQueryParamsRequest(); return message; }, fromAmino(_: QueryParamsRequestAmino): QueryParamsRequest { - return {}; + const message = createBaseQueryParamsRequest(); + return message; }, toAmino(_: QueryParamsRequest): QueryParamsRequestAmino { const obj: any = {}; @@ -91,13 +111,25 @@ export const QueryParamsRequest = { }; } }; +GlobalDecoderRegistry.register(QueryParamsRequest.typeUrl, QueryParamsRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryParamsRequest.aminoType, QueryParamsRequest.typeUrl); function createBaseQueryParamsResponse(): QueryParamsResponse { return { - params: Params.fromPartial({}) + params: undefined }; } export const QueryParamsResponse = { typeUrl: "/ibc.applications.interchain_accounts.host.v1.QueryParamsResponse", + aminoType: "cosmos-sdk/QueryParamsResponse", + is(o: any): o is QueryParamsResponse { + return o && o.$typeUrl === QueryParamsResponse.typeUrl; + }, + isSDK(o: any): o is QueryParamsResponseSDKType { + return o && o.$typeUrl === QueryParamsResponse.typeUrl; + }, + isAmino(o: any): o is QueryParamsResponseAmino { + return o && o.$typeUrl === QueryParamsResponse.typeUrl; + }, encode(message: QueryParamsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.params !== undefined) { Params.encode(message.params, writer.uint32(10).fork()).ldelim(); @@ -121,15 +153,27 @@ export const QueryParamsResponse = { } return message; }, + fromJSON(object: any): QueryParamsResponse { + 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; + }, fromPartial(object: Partial): QueryParamsResponse { const message = createBaseQueryParamsResponse(); message.params = object.params !== undefined && object.params !== null ? Params.fromPartial(object.params) : undefined; return message; }, fromAmino(object: QueryParamsResponseAmino): QueryParamsResponse { - return { - params: object?.params ? Params.fromAmino(object.params) : undefined - }; + const message = createBaseQueryParamsResponse(); + if (object.params !== undefined && object.params !== null) { + message.params = Params.fromAmino(object.params); + } + return message; }, toAmino(message: QueryParamsResponse): QueryParamsResponseAmino { const obj: any = {}; @@ -157,4 +201,6 @@ export const QueryParamsResponse = { value: QueryParamsResponse.encode(message).finish() }; } -}; \ No newline at end of file +}; +GlobalDecoderRegistry.register(QueryParamsResponse.typeUrl, QueryParamsResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryParamsResponse.aminoType, QueryParamsResponse.typeUrl); \ No newline at end of file diff --git a/packages/osmojs/src/codegen/ibc/applications/interchain_accounts/host/v1/tx.amino.ts b/packages/osmojs/src/codegen/ibc/applications/interchain_accounts/host/v1/tx.amino.ts new file mode 100644 index 000000000..638601b21 --- /dev/null +++ b/packages/osmojs/src/codegen/ibc/applications/interchain_accounts/host/v1/tx.amino.ts @@ -0,0 +1,9 @@ +//@ts-nocheck +import { MsgUpdateParams } from "./tx"; +export const AminoConverter = { + "/ibc.applications.interchain_accounts.host.v1.MsgUpdateParams": { + aminoType: "cosmos-sdk/MsgUpdateParams", + toAmino: MsgUpdateParams.toAmino, + fromAmino: MsgUpdateParams.fromAmino + } +}; \ No newline at end of file diff --git a/packages/osmojs/src/codegen/ibc/applications/interchain_accounts/host/v1/tx.registry.ts b/packages/osmojs/src/codegen/ibc/applications/interchain_accounts/host/v1/tx.registry.ts new file mode 100644 index 000000000..657305056 --- /dev/null +++ b/packages/osmojs/src/codegen/ibc/applications/interchain_accounts/host/v1/tx.registry.ts @@ -0,0 +1,51 @@ +//@ts-nocheck +import { GeneratedType, Registry } from "@cosmjs/proto-signing"; +import { MsgUpdateParams } from "./tx"; +export const registry: ReadonlyArray<[string, GeneratedType]> = [["/ibc.applications.interchain_accounts.host.v1.MsgUpdateParams", MsgUpdateParams]]; +export const load = (protoRegistry: Registry) => { + registry.forEach(([typeUrl, mod]) => { + protoRegistry.register(typeUrl, mod); + }); +}; +export const MessageComposer = { + encoded: { + updateParams(value: MsgUpdateParams) { + return { + typeUrl: "/ibc.applications.interchain_accounts.host.v1.MsgUpdateParams", + value: MsgUpdateParams.encode(value).finish() + }; + } + }, + withTypeUrl: { + updateParams(value: MsgUpdateParams) { + return { + typeUrl: "/ibc.applications.interchain_accounts.host.v1.MsgUpdateParams", + value + }; + } + }, + toJSON: { + updateParams(value: MsgUpdateParams) { + return { + typeUrl: "/ibc.applications.interchain_accounts.host.v1.MsgUpdateParams", + value: MsgUpdateParams.toJSON(value) + }; + } + }, + fromJSON: { + updateParams(value: any) { + return { + typeUrl: "/ibc.applications.interchain_accounts.host.v1.MsgUpdateParams", + value: MsgUpdateParams.fromJSON(value) + }; + } + }, + fromPartial: { + updateParams(value: MsgUpdateParams) { + return { + typeUrl: "/ibc.applications.interchain_accounts.host.v1.MsgUpdateParams", + value: MsgUpdateParams.fromPartial(value) + }; + } + } +}; \ No newline at end of file diff --git a/packages/osmojs/src/codegen/ibc/applications/interchain_accounts/host/v1/tx.rpc.msg.ts b/packages/osmojs/src/codegen/ibc/applications/interchain_accounts/host/v1/tx.rpc.msg.ts new file mode 100644 index 000000000..1433fc5f3 --- /dev/null +++ b/packages/osmojs/src/codegen/ibc/applications/interchain_accounts/host/v1/tx.rpc.msg.ts @@ -0,0 +1,23 @@ +import { Rpc } from "../../../../../helpers"; +import { BinaryReader } from "../../../../../binary"; +import { MsgUpdateParams, MsgUpdateParamsResponse } from "./tx"; +/** Msg defines the 27-interchain-accounts/host Msg service. */ +export interface Msg { + /** UpdateParams defines a rpc handler for MsgUpdateParams. */ + updateParams(request: MsgUpdateParams): Promise; +} +export class MsgClientImpl implements Msg { + private readonly rpc: Rpc; + constructor(rpc: Rpc) { + this.rpc = rpc; + this.updateParams = this.updateParams.bind(this); + } + updateParams(request: MsgUpdateParams): Promise { + const data = MsgUpdateParams.encode(request).finish(); + const promise = this.rpc.request("ibc.applications.interchain_accounts.host.v1.Msg", "UpdateParams", data); + return promise.then(data => MsgUpdateParamsResponse.decode(new BinaryReader(data))); + } +} +export const createClientImpl = (rpc: Rpc) => { + return new MsgClientImpl(rpc); +}; \ No newline at end of file diff --git a/packages/osmojs/src/codegen/ibc/applications/interchain_accounts/host/v1/tx.ts b/packages/osmojs/src/codegen/ibc/applications/interchain_accounts/host/v1/tx.ts new file mode 100644 index 000000000..21fd0cfcc --- /dev/null +++ b/packages/osmojs/src/codegen/ibc/applications/interchain_accounts/host/v1/tx.ts @@ -0,0 +1,233 @@ +import { Params, ParamsAmino, ParamsSDKType } from "./host"; +import { BinaryReader, BinaryWriter } from "../../../../../binary"; +import { isSet } from "../../../../../helpers"; +import { GlobalDecoderRegistry } from "../../../../../registry"; +/** MsgUpdateParams defines the payload for Msg/UpdateParams */ +export interface MsgUpdateParams { + /** signer address */ + signer: string; + /** + * params defines the 27-interchain-accounts/host parameters to update. + * + * NOTE: All parameters must be supplied. + */ + params: Params; +} +export interface MsgUpdateParamsProtoMsg { + typeUrl: "/ibc.applications.interchain_accounts.host.v1.MsgUpdateParams"; + value: Uint8Array; +} +/** MsgUpdateParams defines the payload for Msg/UpdateParams */ +export interface MsgUpdateParamsAmino { + /** signer address */ + signer?: string; + /** + * params defines the 27-interchain-accounts/host parameters to update. + * + * NOTE: All parameters must be supplied. + */ + params?: ParamsAmino; +} +export interface MsgUpdateParamsAminoMsg { + type: "cosmos-sdk/MsgUpdateParams"; + value: MsgUpdateParamsAmino; +} +/** MsgUpdateParams defines the payload for Msg/UpdateParams */ +export interface MsgUpdateParamsSDKType { + signer: string; + params: ParamsSDKType; +} +/** MsgUpdateParamsResponse defines the response for Msg/UpdateParams */ +export interface MsgUpdateParamsResponse {} +export interface MsgUpdateParamsResponseProtoMsg { + typeUrl: "/ibc.applications.interchain_accounts.host.v1.MsgUpdateParamsResponse"; + value: Uint8Array; +} +/** MsgUpdateParamsResponse defines the response for Msg/UpdateParams */ +export interface MsgUpdateParamsResponseAmino {} +export interface MsgUpdateParamsResponseAminoMsg { + type: "cosmos-sdk/MsgUpdateParamsResponse"; + value: MsgUpdateParamsResponseAmino; +} +/** MsgUpdateParamsResponse defines the response for Msg/UpdateParams */ +export interface MsgUpdateParamsResponseSDKType {} +function createBaseMsgUpdateParams(): MsgUpdateParams { + return { + signer: "", + params: Params.fromPartial({}) + }; +} +export const MsgUpdateParams = { + typeUrl: "/ibc.applications.interchain_accounts.host.v1.MsgUpdateParams", + aminoType: "cosmos-sdk/MsgUpdateParams", + is(o: any): o is MsgUpdateParams { + return o && (o.$typeUrl === MsgUpdateParams.typeUrl || typeof o.signer === "string" && Params.is(o.params)); + }, + isSDK(o: any): o is MsgUpdateParamsSDKType { + return o && (o.$typeUrl === MsgUpdateParams.typeUrl || typeof o.signer === "string" && Params.isSDK(o.params)); + }, + isAmino(o: any): o is MsgUpdateParamsAmino { + return o && (o.$typeUrl === MsgUpdateParams.typeUrl || typeof o.signer === "string" && Params.isAmino(o.params)); + }, + encode(message: MsgUpdateParams, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.signer !== "") { + writer.uint32(10).string(message.signer); + } + if (message.params !== undefined) { + Params.encode(message.params, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgUpdateParams { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUpdateParams(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.signer = reader.string(); + break; + case 2: + message.params = Params.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): MsgUpdateParams { + return { + signer: isSet(object.signer) ? String(object.signer) : "", + params: isSet(object.params) ? Params.fromJSON(object.params) : undefined + }; + }, + toJSON(message: MsgUpdateParams): unknown { + const obj: any = {}; + message.signer !== undefined && (obj.signer = message.signer); + message.params !== undefined && (obj.params = message.params ? Params.toJSON(message.params) : undefined); + return obj; + }, + fromPartial(object: Partial): MsgUpdateParams { + const message = createBaseMsgUpdateParams(); + message.signer = object.signer ?? ""; + message.params = object.params !== undefined && object.params !== null ? Params.fromPartial(object.params) : undefined; + return message; + }, + fromAmino(object: MsgUpdateParamsAmino): MsgUpdateParams { + const message = createBaseMsgUpdateParams(); + if (object.signer !== undefined && object.signer !== null) { + message.signer = object.signer; + } + if (object.params !== undefined && object.params !== null) { + message.params = Params.fromAmino(object.params); + } + return message; + }, + toAmino(message: MsgUpdateParams): MsgUpdateParamsAmino { + const obj: any = {}; + obj.signer = message.signer; + obj.params = message.params ? Params.toAmino(message.params) : undefined; + return obj; + }, + fromAminoMsg(object: MsgUpdateParamsAminoMsg): MsgUpdateParams { + return MsgUpdateParams.fromAmino(object.value); + }, + toAminoMsg(message: MsgUpdateParams): MsgUpdateParamsAminoMsg { + return { + type: "cosmos-sdk/MsgUpdateParams", + value: MsgUpdateParams.toAmino(message) + }; + }, + fromProtoMsg(message: MsgUpdateParamsProtoMsg): MsgUpdateParams { + return MsgUpdateParams.decode(message.value); + }, + toProto(message: MsgUpdateParams): Uint8Array { + return MsgUpdateParams.encode(message).finish(); + }, + toProtoMsg(message: MsgUpdateParams): MsgUpdateParamsProtoMsg { + return { + typeUrl: "/ibc.applications.interchain_accounts.host.v1.MsgUpdateParams", + value: MsgUpdateParams.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgUpdateParams.typeUrl, MsgUpdateParams); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgUpdateParams.aminoType, MsgUpdateParams.typeUrl); +function createBaseMsgUpdateParamsResponse(): MsgUpdateParamsResponse { + return {}; +} +export const MsgUpdateParamsResponse = { + typeUrl: "/ibc.applications.interchain_accounts.host.v1.MsgUpdateParamsResponse", + aminoType: "cosmos-sdk/MsgUpdateParamsResponse", + is(o: any): o is MsgUpdateParamsResponse { + return o && o.$typeUrl === MsgUpdateParamsResponse.typeUrl; + }, + isSDK(o: any): o is MsgUpdateParamsResponseSDKType { + return o && o.$typeUrl === MsgUpdateParamsResponse.typeUrl; + }, + isAmino(o: any): o is MsgUpdateParamsResponseAmino { + return o && o.$typeUrl === MsgUpdateParamsResponse.typeUrl; + }, + encode(_: MsgUpdateParamsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgUpdateParamsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUpdateParamsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(_: any): MsgUpdateParamsResponse { + return {}; + }, + toJSON(_: MsgUpdateParamsResponse): unknown { + const obj: any = {}; + return obj; + }, + fromPartial(_: Partial): MsgUpdateParamsResponse { + const message = createBaseMsgUpdateParamsResponse(); + return message; + }, + fromAmino(_: MsgUpdateParamsResponseAmino): MsgUpdateParamsResponse { + const message = createBaseMsgUpdateParamsResponse(); + return message; + }, + toAmino(_: MsgUpdateParamsResponse): MsgUpdateParamsResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgUpdateParamsResponseAminoMsg): MsgUpdateParamsResponse { + return MsgUpdateParamsResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgUpdateParamsResponse): MsgUpdateParamsResponseAminoMsg { + return { + type: "cosmos-sdk/MsgUpdateParamsResponse", + value: MsgUpdateParamsResponse.toAmino(message) + }; + }, + fromProtoMsg(message: MsgUpdateParamsResponseProtoMsg): MsgUpdateParamsResponse { + return MsgUpdateParamsResponse.decode(message.value); + }, + toProto(message: MsgUpdateParamsResponse): Uint8Array { + return MsgUpdateParamsResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgUpdateParamsResponse): MsgUpdateParamsResponseProtoMsg { + return { + typeUrl: "/ibc.applications.interchain_accounts.host.v1.MsgUpdateParamsResponse", + value: MsgUpdateParamsResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgUpdateParamsResponse.typeUrl, MsgUpdateParamsResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgUpdateParamsResponse.aminoType, MsgUpdateParamsResponse.typeUrl); \ No newline at end of file diff --git a/packages/osmojs/src/codegen/ibc/applications/interchain_accounts/v1/account.ts b/packages/osmojs/src/codegen/ibc/applications/interchain_accounts/v1/account.ts index 9ad94f144..4c5354419 100644 --- a/packages/osmojs/src/codegen/ibc/applications/interchain_accounts/v1/account.ts +++ b/packages/osmojs/src/codegen/ibc/applications/interchain_accounts/v1/account.ts @@ -1,9 +1,11 @@ import { BaseAccount, BaseAccountAmino, BaseAccountSDKType } from "../../../../cosmos/auth/v1beta1/auth"; import { BinaryReader, BinaryWriter } from "../../../../binary"; +import { isSet } from "../../../../helpers"; +import { GlobalDecoderRegistry } from "../../../../registry"; /** An InterchainAccount is defined as a BaseAccount & the address of the account owner on the controller chain */ export interface InterchainAccount { - $typeUrl?: string; - baseAccount: BaseAccount; + $typeUrl?: "/ibc.applications.interchain_accounts.v1.InterchainAccount"; + baseAccount?: BaseAccount; accountOwner: string; } export interface InterchainAccountProtoMsg { @@ -13,7 +15,7 @@ export interface InterchainAccountProtoMsg { /** An InterchainAccount is defined as a BaseAccount & the address of the account owner on the controller chain */ export interface InterchainAccountAmino { base_account?: BaseAccountAmino; - account_owner: string; + account_owner?: string; } export interface InterchainAccountAminoMsg { type: "cosmos-sdk/InterchainAccount"; @@ -21,19 +23,29 @@ export interface InterchainAccountAminoMsg { } /** An InterchainAccount is defined as a BaseAccount & the address of the account owner on the controller chain */ export interface InterchainAccountSDKType { - $typeUrl?: string; - base_account: BaseAccountSDKType; + $typeUrl?: "/ibc.applications.interchain_accounts.v1.InterchainAccount"; + base_account?: BaseAccountSDKType; account_owner: string; } function createBaseInterchainAccount(): InterchainAccount { return { $typeUrl: "/ibc.applications.interchain_accounts.v1.InterchainAccount", - baseAccount: BaseAccount.fromPartial({}), + baseAccount: undefined, accountOwner: "" }; } export const InterchainAccount = { typeUrl: "/ibc.applications.interchain_accounts.v1.InterchainAccount", + aminoType: "cosmos-sdk/InterchainAccount", + is(o: any): o is InterchainAccount { + return o && (o.$typeUrl === InterchainAccount.typeUrl || typeof o.accountOwner === "string"); + }, + isSDK(o: any): o is InterchainAccountSDKType { + return o && (o.$typeUrl === InterchainAccount.typeUrl || typeof o.account_owner === "string"); + }, + isAmino(o: any): o is InterchainAccountAmino { + return o && (o.$typeUrl === InterchainAccount.typeUrl || typeof o.account_owner === "string"); + }, encode(message: InterchainAccount, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.baseAccount !== undefined) { BaseAccount.encode(message.baseAccount, writer.uint32(10).fork()).ldelim(); @@ -63,6 +75,18 @@ export const InterchainAccount = { } return message; }, + fromJSON(object: any): InterchainAccount { + return { + baseAccount: isSet(object.baseAccount) ? BaseAccount.fromJSON(object.baseAccount) : undefined, + accountOwner: isSet(object.accountOwner) ? String(object.accountOwner) : "" + }; + }, + toJSON(message: InterchainAccount): unknown { + const obj: any = {}; + message.baseAccount !== undefined && (obj.baseAccount = message.baseAccount ? BaseAccount.toJSON(message.baseAccount) : undefined); + message.accountOwner !== undefined && (obj.accountOwner = message.accountOwner); + return obj; + }, fromPartial(object: Partial): InterchainAccount { const message = createBaseInterchainAccount(); message.baseAccount = object.baseAccount !== undefined && object.baseAccount !== null ? BaseAccount.fromPartial(object.baseAccount) : undefined; @@ -70,10 +94,14 @@ export const InterchainAccount = { return message; }, fromAmino(object: InterchainAccountAmino): InterchainAccount { - return { - baseAccount: object?.base_account ? BaseAccount.fromAmino(object.base_account) : undefined, - accountOwner: object.account_owner - }; + const message = createBaseInterchainAccount(); + if (object.base_account !== undefined && object.base_account !== null) { + message.baseAccount = BaseAccount.fromAmino(object.base_account); + } + if (object.account_owner !== undefined && object.account_owner !== null) { + message.accountOwner = object.account_owner; + } + return message; }, toAmino(message: InterchainAccount): InterchainAccountAmino { const obj: any = {}; @@ -102,4 +130,6 @@ export const InterchainAccount = { value: InterchainAccount.encode(message).finish() }; } -}; \ No newline at end of file +}; +GlobalDecoderRegistry.register(InterchainAccount.typeUrl, InterchainAccount); +GlobalDecoderRegistry.registerAminoProtoMapping(InterchainAccount.aminoType, InterchainAccount.typeUrl); \ No newline at end of file diff --git a/packages/osmojs/src/codegen/ibc/applications/interchain_accounts/v1/metadata.ts b/packages/osmojs/src/codegen/ibc/applications/interchain_accounts/v1/metadata.ts index 9849975d7..db7ad54e6 100644 --- a/packages/osmojs/src/codegen/ibc/applications/interchain_accounts/v1/metadata.ts +++ b/packages/osmojs/src/codegen/ibc/applications/interchain_accounts/v1/metadata.ts @@ -1,4 +1,6 @@ import { BinaryReader, BinaryWriter } from "../../../../binary"; +import { isSet } from "../../../../helpers"; +import { GlobalDecoderRegistry } from "../../../../registry"; /** * Metadata defines a set of protocol specific data encoded into the ICS27 channel version bytestring * See ICS004: https://github.com/cosmos/ibc/tree/master/spec/core/ics-004-channel-and-packet-semantics#Versioning @@ -30,20 +32,20 @@ export interface MetadataProtoMsg { */ export interface MetadataAmino { /** version defines the ICS27 protocol version */ - version: string; + version?: string; /** controller_connection_id is the connection identifier associated with the controller chain */ - controller_connection_id: string; + controller_connection_id?: string; /** host_connection_id is the connection identifier associated with the host chain */ - host_connection_id: string; + host_connection_id?: string; /** * address defines the interchain account address to be fulfilled upon the OnChanOpenTry handshake step * NOTE: the address field is empty on the OnChanOpenInit handshake step */ - address: string; + address?: string; /** encoding defines the supported codec format */ - encoding: string; + encoding?: string; /** tx_type defines the type of transactions the interchain account can execute */ - tx_type: string; + tx_type?: string; } export interface MetadataAminoMsg { type: "cosmos-sdk/Metadata"; @@ -73,6 +75,16 @@ function createBaseMetadata(): Metadata { } export const Metadata = { typeUrl: "/ibc.applications.interchain_accounts.v1.Metadata", + aminoType: "cosmos-sdk/Metadata", + is(o: any): o is Metadata { + return o && (o.$typeUrl === Metadata.typeUrl || typeof o.version === "string" && typeof o.controllerConnectionId === "string" && typeof o.hostConnectionId === "string" && typeof o.address === "string" && typeof o.encoding === "string" && typeof o.txType === "string"); + }, + isSDK(o: any): o is MetadataSDKType { + return o && (o.$typeUrl === Metadata.typeUrl || typeof o.version === "string" && typeof o.controller_connection_id === "string" && typeof o.host_connection_id === "string" && typeof o.address === "string" && typeof o.encoding === "string" && typeof o.tx_type === "string"); + }, + isAmino(o: any): o is MetadataAmino { + return o && (o.$typeUrl === Metadata.typeUrl || typeof o.version === "string" && typeof o.controller_connection_id === "string" && typeof o.host_connection_id === "string" && typeof o.address === "string" && typeof o.encoding === "string" && typeof o.tx_type === "string"); + }, encode(message: Metadata, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.version !== "") { writer.uint32(10).string(message.version); @@ -126,6 +138,26 @@ export const Metadata = { } return message; }, + fromJSON(object: any): Metadata { + return { + version: isSet(object.version) ? String(object.version) : "", + controllerConnectionId: isSet(object.controllerConnectionId) ? String(object.controllerConnectionId) : "", + hostConnectionId: isSet(object.hostConnectionId) ? String(object.hostConnectionId) : "", + address: isSet(object.address) ? String(object.address) : "", + encoding: isSet(object.encoding) ? String(object.encoding) : "", + txType: isSet(object.txType) ? String(object.txType) : "" + }; + }, + toJSON(message: Metadata): unknown { + const obj: any = {}; + message.version !== undefined && (obj.version = message.version); + message.controllerConnectionId !== undefined && (obj.controllerConnectionId = message.controllerConnectionId); + message.hostConnectionId !== undefined && (obj.hostConnectionId = message.hostConnectionId); + message.address !== undefined && (obj.address = message.address); + message.encoding !== undefined && (obj.encoding = message.encoding); + message.txType !== undefined && (obj.txType = message.txType); + return obj; + }, fromPartial(object: Partial): Metadata { const message = createBaseMetadata(); message.version = object.version ?? ""; @@ -137,14 +169,26 @@ export const Metadata = { return message; }, fromAmino(object: MetadataAmino): Metadata { - return { - version: object.version, - controllerConnectionId: object.controller_connection_id, - hostConnectionId: object.host_connection_id, - address: object.address, - encoding: object.encoding, - txType: object.tx_type - }; + const message = createBaseMetadata(); + if (object.version !== undefined && object.version !== null) { + message.version = object.version; + } + if (object.controller_connection_id !== undefined && object.controller_connection_id !== null) { + message.controllerConnectionId = object.controller_connection_id; + } + if (object.host_connection_id !== undefined && object.host_connection_id !== null) { + message.hostConnectionId = object.host_connection_id; + } + if (object.address !== undefined && object.address !== null) { + message.address = object.address; + } + if (object.encoding !== undefined && object.encoding !== null) { + message.encoding = object.encoding; + } + if (object.tx_type !== undefined && object.tx_type !== null) { + message.txType = object.tx_type; + } + return message; }, toAmino(message: Metadata): MetadataAmino { const obj: any = {}; @@ -177,4 +221,6 @@ export const Metadata = { value: Metadata.encode(message).finish() }; } -}; \ No newline at end of file +}; +GlobalDecoderRegistry.register(Metadata.typeUrl, Metadata); +GlobalDecoderRegistry.registerAminoProtoMapping(Metadata.aminoType, Metadata.typeUrl); \ No newline at end of file diff --git a/packages/osmojs/src/codegen/ibc/applications/interchain_accounts/v1/packet.ts b/packages/osmojs/src/codegen/ibc/applications/interchain_accounts/v1/packet.ts index caef90e6a..01ac01794 100644 --- a/packages/osmojs/src/codegen/ibc/applications/interchain_accounts/v1/packet.ts +++ b/packages/osmojs/src/codegen/ibc/applications/interchain_accounts/v1/packet.ts @@ -1,6 +1,7 @@ import { Any, AnyAmino, AnySDKType } from "../../../../google/protobuf/any"; +import { isSet, bytesFromBase64, base64FromBytes } from "../../../../helpers"; import { BinaryReader, BinaryWriter } from "../../../../binary"; -import { isSet } from "../../../../helpers"; +import { GlobalDecoderRegistry } from "../../../../registry"; /** * Type defines a classification of message issued from a controller chain to its associated interchain accounts * host @@ -51,9 +52,9 @@ export interface InterchainAccountPacketDataProtoMsg { } /** InterchainAccountPacketData is comprised of a raw transaction, type of transaction and optional memo field. */ export interface InterchainAccountPacketDataAmino { - type: Type; - data: Uint8Array; - memo: string; + type?: Type; + data?: string; + memo?: string; } export interface InterchainAccountPacketDataAminoMsg { type: "cosmos-sdk/InterchainAccountPacketData"; @@ -75,7 +76,7 @@ export interface CosmosTxProtoMsg { } /** CosmosTx contains a list of sdk.Msg's. It should be used when sending transactions to an SDK host chain. */ export interface CosmosTxAmino { - messages: AnyAmino[]; + messages?: AnyAmino[]; } export interface CosmosTxAminoMsg { type: "cosmos-sdk/CosmosTx"; @@ -94,6 +95,16 @@ function createBaseInterchainAccountPacketData(): InterchainAccountPacketData { } export const InterchainAccountPacketData = { typeUrl: "/ibc.applications.interchain_accounts.v1.InterchainAccountPacketData", + aminoType: "cosmos-sdk/InterchainAccountPacketData", + is(o: any): o is InterchainAccountPacketData { + return o && (o.$typeUrl === InterchainAccountPacketData.typeUrl || isSet(o.type) && (o.data instanceof Uint8Array || typeof o.data === "string") && typeof o.memo === "string"); + }, + isSDK(o: any): o is InterchainAccountPacketDataSDKType { + return o && (o.$typeUrl === InterchainAccountPacketData.typeUrl || isSet(o.type) && (o.data instanceof Uint8Array || typeof o.data === "string") && typeof o.memo === "string"); + }, + isAmino(o: any): o is InterchainAccountPacketDataAmino { + return o && (o.$typeUrl === InterchainAccountPacketData.typeUrl || isSet(o.type) && (o.data instanceof Uint8Array || typeof o.data === "string") && typeof o.memo === "string"); + }, encode(message: InterchainAccountPacketData, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.type !== 0) { writer.uint32(8).int32(message.type); @@ -129,6 +140,20 @@ export const InterchainAccountPacketData = { } return message; }, + fromJSON(object: any): InterchainAccountPacketData { + return { + type: isSet(object.type) ? typeFromJSON(object.type) : -1, + data: isSet(object.data) ? bytesFromBase64(object.data) : new Uint8Array(), + memo: isSet(object.memo) ? String(object.memo) : "" + }; + }, + toJSON(message: InterchainAccountPacketData): unknown { + const obj: any = {}; + message.type !== undefined && (obj.type = typeToJSON(message.type)); + message.data !== undefined && (obj.data = base64FromBytes(message.data !== undefined ? message.data : new Uint8Array())); + message.memo !== undefined && (obj.memo = message.memo); + return obj; + }, fromPartial(object: Partial): InterchainAccountPacketData { const message = createBaseInterchainAccountPacketData(); message.type = object.type ?? 0; @@ -137,16 +162,22 @@ export const InterchainAccountPacketData = { return message; }, fromAmino(object: InterchainAccountPacketDataAmino): InterchainAccountPacketData { - return { - type: isSet(object.type) ? typeFromJSON(object.type) : -1, - data: object.data, - memo: object.memo - }; + const message = createBaseInterchainAccountPacketData(); + if (object.type !== undefined && object.type !== null) { + message.type = typeFromJSON(object.type); + } + if (object.data !== undefined && object.data !== null) { + message.data = bytesFromBase64(object.data); + } + if (object.memo !== undefined && object.memo !== null) { + message.memo = object.memo; + } + return message; }, toAmino(message: InterchainAccountPacketData): InterchainAccountPacketDataAmino { const obj: any = {}; - obj.type = message.type; - obj.data = message.data; + obj.type = typeToJSON(message.type); + obj.data = message.data ? base64FromBytes(message.data) : undefined; obj.memo = message.memo; return obj; }, @@ -172,6 +203,8 @@ export const InterchainAccountPacketData = { }; } }; +GlobalDecoderRegistry.register(InterchainAccountPacketData.typeUrl, InterchainAccountPacketData); +GlobalDecoderRegistry.registerAminoProtoMapping(InterchainAccountPacketData.aminoType, InterchainAccountPacketData.typeUrl); function createBaseCosmosTx(): CosmosTx { return { messages: [] @@ -179,6 +212,16 @@ function createBaseCosmosTx(): CosmosTx { } export const CosmosTx = { typeUrl: "/ibc.applications.interchain_accounts.v1.CosmosTx", + aminoType: "cosmos-sdk/CosmosTx", + is(o: any): o is CosmosTx { + return o && (o.$typeUrl === CosmosTx.typeUrl || Array.isArray(o.messages) && (!o.messages.length || Any.is(o.messages[0]))); + }, + isSDK(o: any): o is CosmosTxSDKType { + return o && (o.$typeUrl === CosmosTx.typeUrl || Array.isArray(o.messages) && (!o.messages.length || Any.isSDK(o.messages[0]))); + }, + isAmino(o: any): o is CosmosTxAmino { + return o && (o.$typeUrl === CosmosTx.typeUrl || Array.isArray(o.messages) && (!o.messages.length || Any.isAmino(o.messages[0]))); + }, encode(message: CosmosTx, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.messages) { Any.encode(v!, writer.uint32(10).fork()).ldelim(); @@ -202,15 +245,29 @@ export const CosmosTx = { } return message; }, + fromJSON(object: any): CosmosTx { + return { + messages: Array.isArray(object?.messages) ? object.messages.map((e: any) => Any.fromJSON(e)) : [] + }; + }, + toJSON(message: CosmosTx): unknown { + const obj: any = {}; + if (message.messages) { + obj.messages = message.messages.map(e => e ? Any.toJSON(e) : undefined); + } else { + obj.messages = []; + } + return obj; + }, fromPartial(object: Partial): CosmosTx { const message = createBaseCosmosTx(); message.messages = object.messages?.map(e => Any.fromPartial(e)) || []; return message; }, fromAmino(object: CosmosTxAmino): CosmosTx { - return { - messages: Array.isArray(object?.messages) ? object.messages.map((e: any) => Any.fromAmino(e)) : [] - }; + const message = createBaseCosmosTx(); + message.messages = object.messages?.map(e => Any.fromAmino(e)) || []; + return message; }, toAmino(message: CosmosTx): CosmosTxAmino { const obj: any = {}; @@ -242,4 +299,6 @@ export const CosmosTx = { value: CosmosTx.encode(message).finish() }; } -}; \ No newline at end of file +}; +GlobalDecoderRegistry.register(CosmosTx.typeUrl, CosmosTx); +GlobalDecoderRegistry.registerAminoProtoMapping(CosmosTx.aminoType, CosmosTx.typeUrl); \ No newline at end of file diff --git a/packages/osmojs/src/codegen/ibc/applications/transfer/v1/authz.ts b/packages/osmojs/src/codegen/ibc/applications/transfer/v1/authz.ts index 9f6c3ce47..a1a608ded 100644 --- a/packages/osmojs/src/codegen/ibc/applications/transfer/v1/authz.ts +++ b/packages/osmojs/src/codegen/ibc/applications/transfer/v1/authz.ts @@ -1,5 +1,7 @@ import { Coin, CoinAmino, CoinSDKType } from "../../../../cosmos/base/v1beta1/coin"; import { BinaryReader, BinaryWriter } from "../../../../binary"; +import { isSet } from "../../../../helpers"; +import { GlobalDecoderRegistry } from "../../../../registry"; /** Allocation defines the spend limit for a particular port and channel */ export interface Allocation { /** the port on which the packet will be sent */ @@ -10,6 +12,11 @@ export interface Allocation { spendLimit: Coin[]; /** allow list of receivers, an empty allow list permits any receiver address */ allowList: string[]; + /** + * allow list of packet data keys, an empty list prohibits all packet data keys; + * a list only with "*" permits any packet data key + */ + allowedPacketData: string[]; } export interface AllocationProtoMsg { typeUrl: "/ibc.applications.transfer.v1.Allocation"; @@ -18,13 +25,18 @@ export interface AllocationProtoMsg { /** Allocation defines the spend limit for a particular port and channel */ export interface AllocationAmino { /** the port on which the packet will be sent */ - source_port: string; + source_port?: string; /** the channel by which the packet will be sent */ - source_channel: string; + source_channel?: string; /** spend limitation on the channel */ - spend_limit: CoinAmino[]; + spend_limit?: CoinAmino[]; /** allow list of receivers, an empty allow list permits any receiver address */ - allow_list: string[]; + allow_list?: string[]; + /** + * allow list of packet data keys, an empty list prohibits all packet data keys; + * a list only with "*" permits any packet data key + */ + allowed_packet_data?: string[]; } export interface AllocationAminoMsg { type: "cosmos-sdk/Allocation"; @@ -36,13 +48,14 @@ export interface AllocationSDKType { source_channel: string; spend_limit: CoinSDKType[]; allow_list: string[]; + allowed_packet_data: string[]; } /** * TransferAuthorization allows the grantee to spend up to spend_limit coins from * the granter's account for ibc transfer on a specific channel */ export interface TransferAuthorization { - $typeUrl?: string; + $typeUrl?: "/ibc.applications.transfer.v1.TransferAuthorization"; /** port and channel amounts */ allocations: Allocation[]; } @@ -56,7 +69,7 @@ export interface TransferAuthorizationProtoMsg { */ export interface TransferAuthorizationAmino { /** port and channel amounts */ - allocations: AllocationAmino[]; + allocations?: AllocationAmino[]; } export interface TransferAuthorizationAminoMsg { type: "cosmos-sdk/TransferAuthorization"; @@ -67,7 +80,7 @@ export interface TransferAuthorizationAminoMsg { * the granter's account for ibc transfer on a specific channel */ export interface TransferAuthorizationSDKType { - $typeUrl?: string; + $typeUrl?: "/ibc.applications.transfer.v1.TransferAuthorization"; allocations: AllocationSDKType[]; } function createBaseAllocation(): Allocation { @@ -75,11 +88,22 @@ function createBaseAllocation(): Allocation { sourcePort: "", sourceChannel: "", spendLimit: [], - allowList: [] + allowList: [], + allowedPacketData: [] }; } export const Allocation = { typeUrl: "/ibc.applications.transfer.v1.Allocation", + aminoType: "cosmos-sdk/Allocation", + is(o: any): o is Allocation { + return o && (o.$typeUrl === Allocation.typeUrl || typeof o.sourcePort === "string" && typeof o.sourceChannel === "string" && Array.isArray(o.spendLimit) && (!o.spendLimit.length || Coin.is(o.spendLimit[0])) && Array.isArray(o.allowList) && (!o.allowList.length || typeof o.allowList[0] === "string") && Array.isArray(o.allowedPacketData) && (!o.allowedPacketData.length || typeof o.allowedPacketData[0] === "string")); + }, + isSDK(o: any): o is AllocationSDKType { + return o && (o.$typeUrl === Allocation.typeUrl || typeof o.source_port === "string" && typeof o.source_channel === "string" && Array.isArray(o.spend_limit) && (!o.spend_limit.length || Coin.isSDK(o.spend_limit[0])) && Array.isArray(o.allow_list) && (!o.allow_list.length || typeof o.allow_list[0] === "string") && Array.isArray(o.allowed_packet_data) && (!o.allowed_packet_data.length || typeof o.allowed_packet_data[0] === "string")); + }, + isAmino(o: any): o is AllocationAmino { + return o && (o.$typeUrl === Allocation.typeUrl || typeof o.source_port === "string" && typeof o.source_channel === "string" && Array.isArray(o.spend_limit) && (!o.spend_limit.length || Coin.isAmino(o.spend_limit[0])) && Array.isArray(o.allow_list) && (!o.allow_list.length || typeof o.allow_list[0] === "string") && Array.isArray(o.allowed_packet_data) && (!o.allowed_packet_data.length || typeof o.allowed_packet_data[0] === "string")); + }, encode(message: Allocation, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.sourcePort !== "") { writer.uint32(10).string(message.sourcePort); @@ -93,6 +117,9 @@ export const Allocation = { for (const v of message.allowList) { writer.uint32(34).string(v!); } + for (const v of message.allowedPacketData) { + writer.uint32(42).string(v!); + } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): Allocation { @@ -114,6 +141,9 @@ export const Allocation = { case 4: message.allowList.push(reader.string()); break; + case 5: + message.allowedPacketData.push(reader.string()); + break; default: reader.skipType(tag & 7); break; @@ -121,21 +151,57 @@ export const Allocation = { } return message; }, + fromJSON(object: any): Allocation { + return { + sourcePort: isSet(object.sourcePort) ? String(object.sourcePort) : "", + sourceChannel: isSet(object.sourceChannel) ? String(object.sourceChannel) : "", + spendLimit: Array.isArray(object?.spendLimit) ? object.spendLimit.map((e: any) => Coin.fromJSON(e)) : [], + allowList: Array.isArray(object?.allowList) ? object.allowList.map((e: any) => String(e)) : [], + allowedPacketData: Array.isArray(object?.allowedPacketData) ? object.allowedPacketData.map((e: any) => String(e)) : [] + }; + }, + toJSON(message: Allocation): unknown { + const obj: any = {}; + message.sourcePort !== undefined && (obj.sourcePort = message.sourcePort); + message.sourceChannel !== undefined && (obj.sourceChannel = message.sourceChannel); + if (message.spendLimit) { + obj.spendLimit = message.spendLimit.map(e => e ? Coin.toJSON(e) : undefined); + } else { + obj.spendLimit = []; + } + if (message.allowList) { + obj.allowList = message.allowList.map(e => e); + } else { + obj.allowList = []; + } + if (message.allowedPacketData) { + obj.allowedPacketData = message.allowedPacketData.map(e => e); + } else { + obj.allowedPacketData = []; + } + return obj; + }, fromPartial(object: Partial): Allocation { const message = createBaseAllocation(); message.sourcePort = object.sourcePort ?? ""; message.sourceChannel = object.sourceChannel ?? ""; message.spendLimit = object.spendLimit?.map(e => Coin.fromPartial(e)) || []; message.allowList = object.allowList?.map(e => e) || []; + message.allowedPacketData = object.allowedPacketData?.map(e => e) || []; return message; }, fromAmino(object: AllocationAmino): Allocation { - return { - sourcePort: object.source_port, - sourceChannel: object.source_channel, - spendLimit: Array.isArray(object?.spend_limit) ? object.spend_limit.map((e: any) => Coin.fromAmino(e)) : [], - allowList: Array.isArray(object?.allow_list) ? object.allow_list.map((e: any) => e) : [] - }; + const message = createBaseAllocation(); + if (object.source_port !== undefined && object.source_port !== null) { + message.sourcePort = object.source_port; + } + if (object.source_channel !== undefined && object.source_channel !== null) { + message.sourceChannel = object.source_channel; + } + message.spendLimit = object.spend_limit?.map(e => Coin.fromAmino(e)) || []; + message.allowList = object.allow_list?.map(e => e) || []; + message.allowedPacketData = object.allowed_packet_data?.map(e => e) || []; + return message; }, toAmino(message: Allocation): AllocationAmino { const obj: any = {}; @@ -151,6 +217,11 @@ export const Allocation = { } else { obj.allow_list = []; } + if (message.allowedPacketData) { + obj.allowed_packet_data = message.allowedPacketData.map(e => e); + } else { + obj.allowed_packet_data = []; + } return obj; }, fromAminoMsg(object: AllocationAminoMsg): Allocation { @@ -175,6 +246,8 @@ export const Allocation = { }; } }; +GlobalDecoderRegistry.register(Allocation.typeUrl, Allocation); +GlobalDecoderRegistry.registerAminoProtoMapping(Allocation.aminoType, Allocation.typeUrl); function createBaseTransferAuthorization(): TransferAuthorization { return { $typeUrl: "/ibc.applications.transfer.v1.TransferAuthorization", @@ -183,6 +256,16 @@ function createBaseTransferAuthorization(): TransferAuthorization { } export const TransferAuthorization = { typeUrl: "/ibc.applications.transfer.v1.TransferAuthorization", + aminoType: "cosmos-sdk/TransferAuthorization", + is(o: any): o is TransferAuthorization { + return o && (o.$typeUrl === TransferAuthorization.typeUrl || Array.isArray(o.allocations) && (!o.allocations.length || Allocation.is(o.allocations[0]))); + }, + isSDK(o: any): o is TransferAuthorizationSDKType { + return o && (o.$typeUrl === TransferAuthorization.typeUrl || Array.isArray(o.allocations) && (!o.allocations.length || Allocation.isSDK(o.allocations[0]))); + }, + isAmino(o: any): o is TransferAuthorizationAmino { + return o && (o.$typeUrl === TransferAuthorization.typeUrl || Array.isArray(o.allocations) && (!o.allocations.length || Allocation.isAmino(o.allocations[0]))); + }, encode(message: TransferAuthorization, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.allocations) { Allocation.encode(v!, writer.uint32(10).fork()).ldelim(); @@ -206,15 +289,29 @@ export const TransferAuthorization = { } return message; }, + fromJSON(object: any): TransferAuthorization { + return { + allocations: Array.isArray(object?.allocations) ? object.allocations.map((e: any) => Allocation.fromJSON(e)) : [] + }; + }, + toJSON(message: TransferAuthorization): unknown { + const obj: any = {}; + if (message.allocations) { + obj.allocations = message.allocations.map(e => e ? Allocation.toJSON(e) : undefined); + } else { + obj.allocations = []; + } + return obj; + }, fromPartial(object: Partial): TransferAuthorization { const message = createBaseTransferAuthorization(); message.allocations = object.allocations?.map(e => Allocation.fromPartial(e)) || []; return message; }, fromAmino(object: TransferAuthorizationAmino): TransferAuthorization { - return { - allocations: Array.isArray(object?.allocations) ? object.allocations.map((e: any) => Allocation.fromAmino(e)) : [] - }; + const message = createBaseTransferAuthorization(); + message.allocations = object.allocations?.map(e => Allocation.fromAmino(e)) || []; + return message; }, toAmino(message: TransferAuthorization): TransferAuthorizationAmino { const obj: any = {}; @@ -246,4 +343,6 @@ export const TransferAuthorization = { value: TransferAuthorization.encode(message).finish() }; } -}; \ No newline at end of file +}; +GlobalDecoderRegistry.register(TransferAuthorization.typeUrl, TransferAuthorization); +GlobalDecoderRegistry.registerAminoProtoMapping(TransferAuthorization.aminoType, TransferAuthorization.typeUrl); \ No newline at end of file diff --git a/packages/osmojs/src/codegen/ibc/applications/transfer/v1/genesis.ts b/packages/osmojs/src/codegen/ibc/applications/transfer/v1/genesis.ts index 087006140..1853f5f69 100644 --- a/packages/osmojs/src/codegen/ibc/applications/transfer/v1/genesis.ts +++ b/packages/osmojs/src/codegen/ibc/applications/transfer/v1/genesis.ts @@ -1,10 +1,18 @@ import { DenomTrace, DenomTraceAmino, DenomTraceSDKType, Params, ParamsAmino, ParamsSDKType } from "./transfer"; +import { Coin, CoinAmino, CoinSDKType } from "../../../../cosmos/base/v1beta1/coin"; import { BinaryReader, BinaryWriter } from "../../../../binary"; +import { isSet } from "../../../../helpers"; +import { GlobalDecoderRegistry } from "../../../../registry"; /** GenesisState defines the ibc-transfer genesis state */ export interface GenesisState { portId: string; denomTraces: DenomTrace[]; params: Params; + /** + * total_escrowed contains the total amount of tokens escrowed + * by the transfer module + */ + totalEscrowed: Coin[]; } export interface GenesisStateProtoMsg { typeUrl: "/ibc.applications.transfer.v1.GenesisState"; @@ -12,9 +20,14 @@ export interface GenesisStateProtoMsg { } /** GenesisState defines the ibc-transfer genesis state */ export interface GenesisStateAmino { - port_id: string; - denom_traces: DenomTraceAmino[]; + port_id?: string; + denom_traces?: DenomTraceAmino[]; params?: ParamsAmino; + /** + * total_escrowed contains the total amount of tokens escrowed + * by the transfer module + */ + total_escrowed?: CoinAmino[]; } export interface GenesisStateAminoMsg { type: "cosmos-sdk/GenesisState"; @@ -25,16 +38,28 @@ export interface GenesisStateSDKType { port_id: string; denom_traces: DenomTraceSDKType[]; params: ParamsSDKType; + total_escrowed: CoinSDKType[]; } function createBaseGenesisState(): GenesisState { return { portId: "", denomTraces: [], - params: Params.fromPartial({}) + params: Params.fromPartial({}), + totalEscrowed: [] }; } export const GenesisState = { typeUrl: "/ibc.applications.transfer.v1.GenesisState", + aminoType: "cosmos-sdk/GenesisState", + is(o: any): o is GenesisState { + return o && (o.$typeUrl === GenesisState.typeUrl || typeof o.portId === "string" && Array.isArray(o.denomTraces) && (!o.denomTraces.length || DenomTrace.is(o.denomTraces[0])) && Params.is(o.params) && Array.isArray(o.totalEscrowed) && (!o.totalEscrowed.length || Coin.is(o.totalEscrowed[0]))); + }, + isSDK(o: any): o is GenesisStateSDKType { + return o && (o.$typeUrl === GenesisState.typeUrl || typeof o.port_id === "string" && Array.isArray(o.denom_traces) && (!o.denom_traces.length || DenomTrace.isSDK(o.denom_traces[0])) && Params.isSDK(o.params) && Array.isArray(o.total_escrowed) && (!o.total_escrowed.length || Coin.isSDK(o.total_escrowed[0]))); + }, + isAmino(o: any): o is GenesisStateAmino { + return o && (o.$typeUrl === GenesisState.typeUrl || typeof o.port_id === "string" && Array.isArray(o.denom_traces) && (!o.denom_traces.length || DenomTrace.isAmino(o.denom_traces[0])) && Params.isAmino(o.params) && Array.isArray(o.total_escrowed) && (!o.total_escrowed.length || Coin.isAmino(o.total_escrowed[0]))); + }, encode(message: GenesisState, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.portId !== "") { writer.uint32(10).string(message.portId); @@ -45,6 +70,9 @@ export const GenesisState = { if (message.params !== undefined) { Params.encode(message.params, writer.uint32(26).fork()).ldelim(); } + for (const v of message.totalEscrowed) { + Coin.encode(v!, writer.uint32(34).fork()).ldelim(); + } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): GenesisState { @@ -63,6 +91,9 @@ export const GenesisState = { case 3: message.params = Params.decode(reader, reader.uint32()); break; + case 4: + message.totalEscrowed.push(Coin.decode(reader, reader.uint32())); + break; default: reader.skipType(tag & 7); break; @@ -70,19 +101,49 @@ export const GenesisState = { } return message; }, + fromJSON(object: any): GenesisState { + return { + portId: isSet(object.portId) ? String(object.portId) : "", + denomTraces: Array.isArray(object?.denomTraces) ? object.denomTraces.map((e: any) => DenomTrace.fromJSON(e)) : [], + params: isSet(object.params) ? Params.fromJSON(object.params) : undefined, + totalEscrowed: Array.isArray(object?.totalEscrowed) ? object.totalEscrowed.map((e: any) => Coin.fromJSON(e)) : [] + }; + }, + toJSON(message: GenesisState): unknown { + const obj: any = {}; + message.portId !== undefined && (obj.portId = message.portId); + if (message.denomTraces) { + obj.denomTraces = message.denomTraces.map(e => e ? DenomTrace.toJSON(e) : undefined); + } else { + obj.denomTraces = []; + } + message.params !== undefined && (obj.params = message.params ? Params.toJSON(message.params) : undefined); + if (message.totalEscrowed) { + obj.totalEscrowed = message.totalEscrowed.map(e => e ? Coin.toJSON(e) : undefined); + } else { + obj.totalEscrowed = []; + } + return obj; + }, fromPartial(object: Partial): GenesisState { const message = createBaseGenesisState(); message.portId = object.portId ?? ""; message.denomTraces = object.denomTraces?.map(e => DenomTrace.fromPartial(e)) || []; message.params = object.params !== undefined && object.params !== null ? Params.fromPartial(object.params) : undefined; + message.totalEscrowed = object.totalEscrowed?.map(e => Coin.fromPartial(e)) || []; return message; }, fromAmino(object: GenesisStateAmino): GenesisState { - return { - portId: object.port_id, - denomTraces: Array.isArray(object?.denom_traces) ? object.denom_traces.map((e: any) => DenomTrace.fromAmino(e)) : [], - params: object?.params ? Params.fromAmino(object.params) : undefined - }; + const message = createBaseGenesisState(); + if (object.port_id !== undefined && object.port_id !== null) { + message.portId = object.port_id; + } + message.denomTraces = object.denom_traces?.map(e => DenomTrace.fromAmino(e)) || []; + if (object.params !== undefined && object.params !== null) { + message.params = Params.fromAmino(object.params); + } + message.totalEscrowed = object.total_escrowed?.map(e => Coin.fromAmino(e)) || []; + return message; }, toAmino(message: GenesisState): GenesisStateAmino { const obj: any = {}; @@ -93,6 +154,11 @@ export const GenesisState = { obj.denom_traces = []; } obj.params = message.params ? Params.toAmino(message.params) : undefined; + if (message.totalEscrowed) { + obj.total_escrowed = message.totalEscrowed.map(e => e ? Coin.toAmino(e) : undefined); + } else { + obj.total_escrowed = []; + } return obj; }, fromAminoMsg(object: GenesisStateAminoMsg): GenesisState { @@ -116,4 +182,6 @@ export const GenesisState = { value: GenesisState.encode(message).finish() }; } -}; \ No newline at end of file +}; +GlobalDecoderRegistry.register(GenesisState.typeUrl, GenesisState); +GlobalDecoderRegistry.registerAminoProtoMapping(GenesisState.aminoType, GenesisState.typeUrl); \ No newline at end of file diff --git a/packages/osmojs/src/codegen/ibc/applications/transfer/v1/query.lcd.ts b/packages/osmojs/src/codegen/ibc/applications/transfer/v1/query.lcd.ts index e5c67d3fc..28cf41a68 100644 --- a/packages/osmojs/src/codegen/ibc/applications/transfer/v1/query.lcd.ts +++ b/packages/osmojs/src/codegen/ibc/applications/transfer/v1/query.lcd.ts @@ -1,6 +1,6 @@ import { setPaginationParams } from "../../../../helpers"; import { LCDClient } from "@cosmology/lcd"; -import { QueryDenomTraceRequest, QueryDenomTraceResponseSDKType, QueryDenomTracesRequest, QueryDenomTracesResponseSDKType, QueryParamsRequest, QueryParamsResponseSDKType, QueryDenomHashRequest, QueryDenomHashResponseSDKType, QueryEscrowAddressRequest, QueryEscrowAddressResponseSDKType } from "./query"; +import { QueryDenomTracesRequest, QueryDenomTracesResponseSDKType, QueryDenomTraceRequest, QueryDenomTraceResponseSDKType, QueryParamsRequest, QueryParamsResponseSDKType, QueryDenomHashRequest, QueryDenomHashResponseSDKType, QueryEscrowAddressRequest, QueryEscrowAddressResponseSDKType, QueryTotalEscrowForDenomRequest, QueryTotalEscrowForDenomResponseSDKType } from "./query"; export class LCDQueryClient { req: LCDClient; constructor({ @@ -9,22 +9,12 @@ export class LCDQueryClient { requestClient: LCDClient; }) { this.req = requestClient; - this.denomTrace = this.denomTrace.bind(this); this.denomTraces = this.denomTraces.bind(this); + this.denomTrace = this.denomTrace.bind(this); this.params = this.params.bind(this); this.denomHash = this.denomHash.bind(this); this.escrowAddress = this.escrowAddress.bind(this); - } - /* DenomTrace queries a denomination trace information. */ - async denomTrace(params: QueryDenomTraceRequest): Promise { - const options: any = { - params: {} - }; - if (typeof params?.hash !== "undefined") { - options.params.hash = params.hash; - } - const endpoint = `ibc/apps/transfer/v1/denom_traces/${params.hash}`; - return await this.req.get(endpoint, options); + this.totalEscrowForDenom = this.totalEscrowForDenom.bind(this); } /* DenomTraces queries all denomination traces. */ async denomTraces(params: QueryDenomTracesRequest = { @@ -39,6 +29,17 @@ export class LCDQueryClient { const endpoint = `ibc/apps/transfer/v1/denom_traces`; return await this.req.get(endpoint, options); } + /* DenomTrace queries a denomination trace information. */ + async denomTrace(params: QueryDenomTraceRequest): Promise { + const options: any = { + params: {} + }; + if (typeof params?.hash !== "undefined") { + options.params.hash = params.hash; + } + const endpoint = `ibc/apps/transfer/v1/denom_traces/${params.hash}`; + return await this.req.get(endpoint, options); + } /* Params queries all parameters of the ibc-transfer module. */ async params(_params: QueryParamsRequest = {}): Promise { const endpoint = `ibc/apps/transfer/v1/params`; @@ -60,4 +61,15 @@ export class LCDQueryClient { const endpoint = `ibc/apps/transfer/v1/channels/${params.channelId}/ports/${params.portId}/escrow_address`; return await this.req.get(endpoint); } + /* TotalEscrowForDenom returns the total amount of tokens in escrow based on the denom. */ + async totalEscrowForDenom(params: QueryTotalEscrowForDenomRequest): Promise { + const options: any = { + params: {} + }; + if (typeof params?.denom !== "undefined") { + options.params.denom = params.denom; + } + const endpoint = `ibc/apps/transfer/v1/denoms/${params.denom}/total_escrow`; + return await this.req.get(endpoint, options); + } } \ No newline at end of file diff --git a/packages/osmojs/src/codegen/ibc/applications/transfer/v1/query.rpc.Query.ts b/packages/osmojs/src/codegen/ibc/applications/transfer/v1/query.rpc.Query.ts index d05b79df9..2bb450c6a 100644 --- a/packages/osmojs/src/codegen/ibc/applications/transfer/v1/query.rpc.Query.ts +++ b/packages/osmojs/src/codegen/ibc/applications/transfer/v1/query.rpc.Query.ts @@ -1,34 +1,32 @@ import { Rpc } from "../../../../helpers"; import { BinaryReader } from "../../../../binary"; import { QueryClient, createProtobufRpcClient } from "@cosmjs/stargate"; -import { QueryDenomTraceRequest, QueryDenomTraceResponse, QueryDenomTracesRequest, QueryDenomTracesResponse, QueryParamsRequest, QueryParamsResponse, QueryDenomHashRequest, QueryDenomHashResponse, QueryEscrowAddressRequest, QueryEscrowAddressResponse } from "./query"; +import { QueryDenomTracesRequest, QueryDenomTracesResponse, QueryDenomTraceRequest, QueryDenomTraceResponse, QueryParamsRequest, QueryParamsResponse, QueryDenomHashRequest, QueryDenomHashResponse, QueryEscrowAddressRequest, QueryEscrowAddressResponse, QueryTotalEscrowForDenomRequest, QueryTotalEscrowForDenomResponse } from "./query"; /** Query provides defines the gRPC querier service. */ export interface Query { - /** DenomTrace queries a denomination trace information. */ - denomTrace(request: QueryDenomTraceRequest): Promise; /** DenomTraces queries all denomination traces. */ denomTraces(request?: QueryDenomTracesRequest): Promise; + /** DenomTrace queries a denomination trace information. */ + denomTrace(request: QueryDenomTraceRequest): Promise; /** Params queries all parameters of the ibc-transfer module. */ params(request?: QueryParamsRequest): Promise; /** DenomHash queries a denomination hash information. */ denomHash(request: QueryDenomHashRequest): Promise; /** EscrowAddress returns the escrow address for a particular port and channel id. */ escrowAddress(request: QueryEscrowAddressRequest): Promise; + /** TotalEscrowForDenom returns the total amount of tokens in escrow based on the denom. */ + totalEscrowForDenom(request: QueryTotalEscrowForDenomRequest): Promise; } export class QueryClientImpl implements Query { private readonly rpc: Rpc; constructor(rpc: Rpc) { this.rpc = rpc; - this.denomTrace = this.denomTrace.bind(this); this.denomTraces = this.denomTraces.bind(this); + this.denomTrace = this.denomTrace.bind(this); this.params = this.params.bind(this); this.denomHash = this.denomHash.bind(this); this.escrowAddress = this.escrowAddress.bind(this); - } - denomTrace(request: QueryDenomTraceRequest): Promise { - const data = QueryDenomTraceRequest.encode(request).finish(); - const promise = this.rpc.request("ibc.applications.transfer.v1.Query", "DenomTrace", data); - return promise.then(data => QueryDenomTraceResponse.decode(new BinaryReader(data))); + this.totalEscrowForDenom = this.totalEscrowForDenom.bind(this); } denomTraces(request: QueryDenomTracesRequest = { pagination: undefined @@ -37,6 +35,11 @@ export class QueryClientImpl implements Query { const promise = this.rpc.request("ibc.applications.transfer.v1.Query", "DenomTraces", data); return promise.then(data => QueryDenomTracesResponse.decode(new BinaryReader(data))); } + denomTrace(request: QueryDenomTraceRequest): Promise { + const data = QueryDenomTraceRequest.encode(request).finish(); + const promise = this.rpc.request("ibc.applications.transfer.v1.Query", "DenomTrace", data); + return promise.then(data => QueryDenomTraceResponse.decode(new BinaryReader(data))); + } params(request: QueryParamsRequest = {}): Promise { const data = QueryParamsRequest.encode(request).finish(); const promise = this.rpc.request("ibc.applications.transfer.v1.Query", "Params", data); @@ -52,17 +55,22 @@ export class QueryClientImpl implements Query { const promise = this.rpc.request("ibc.applications.transfer.v1.Query", "EscrowAddress", data); return promise.then(data => QueryEscrowAddressResponse.decode(new BinaryReader(data))); } + totalEscrowForDenom(request: QueryTotalEscrowForDenomRequest): Promise { + const data = QueryTotalEscrowForDenomRequest.encode(request).finish(); + const promise = this.rpc.request("ibc.applications.transfer.v1.Query", "TotalEscrowForDenom", data); + return promise.then(data => QueryTotalEscrowForDenomResponse.decode(new BinaryReader(data))); + } } export const createRpcQueryExtension = (base: QueryClient) => { const rpc = createProtobufRpcClient(base); const queryService = new QueryClientImpl(rpc); return { - denomTrace(request: QueryDenomTraceRequest): Promise { - return queryService.denomTrace(request); - }, denomTraces(request?: QueryDenomTracesRequest): Promise { return queryService.denomTraces(request); }, + denomTrace(request: QueryDenomTraceRequest): Promise { + return queryService.denomTrace(request); + }, params(request?: QueryParamsRequest): Promise { return queryService.params(request); }, @@ -71,6 +79,9 @@ export const createRpcQueryExtension = (base: QueryClient) => { }, escrowAddress(request: QueryEscrowAddressRequest): Promise { return queryService.escrowAddress(request); + }, + totalEscrowForDenom(request: QueryTotalEscrowForDenomRequest): Promise { + return queryService.totalEscrowForDenom(request); } }; }; \ No newline at end of file diff --git a/packages/osmojs/src/codegen/ibc/applications/transfer/v1/query.ts b/packages/osmojs/src/codegen/ibc/applications/transfer/v1/query.ts index 4f6510614..42be63d10 100644 --- a/packages/osmojs/src/codegen/ibc/applications/transfer/v1/query.ts +++ b/packages/osmojs/src/codegen/ibc/applications/transfer/v1/query.ts @@ -1,6 +1,9 @@ import { PageRequest, PageRequestAmino, PageRequestSDKType, PageResponse, PageResponseAmino, PageResponseSDKType } from "../../../../cosmos/base/query/v1beta1/pagination"; import { DenomTrace, DenomTraceAmino, DenomTraceSDKType, Params, ParamsAmino, ParamsSDKType } from "./transfer"; +import { Coin, CoinAmino, CoinSDKType } from "../../../../cosmos/base/v1beta1/coin"; import { BinaryReader, BinaryWriter } from "../../../../binary"; +import { isSet } from "../../../../helpers"; +import { GlobalDecoderRegistry } from "../../../../registry"; /** * QueryDenomTraceRequest is the request type for the Query/DenomTrace RPC * method @@ -19,7 +22,7 @@ export interface QueryDenomTraceRequestProtoMsg { */ export interface QueryDenomTraceRequestAmino { /** hash (in hex format) or denom (full denom with ibc prefix) of the denomination trace information. */ - hash: string; + hash?: string; } export interface QueryDenomTraceRequestAminoMsg { type: "cosmos-sdk/QueryDenomTraceRequest"; @@ -38,7 +41,7 @@ export interface QueryDenomTraceRequestSDKType { */ export interface QueryDenomTraceResponse { /** denom_trace returns the requested denomination trace information. */ - denomTrace: DenomTrace; + denomTrace?: DenomTrace; } export interface QueryDenomTraceResponseProtoMsg { typeUrl: "/ibc.applications.transfer.v1.QueryDenomTraceResponse"; @@ -61,7 +64,7 @@ export interface QueryDenomTraceResponseAminoMsg { * method. */ export interface QueryDenomTraceResponseSDKType { - denom_trace: DenomTraceSDKType; + denom_trace?: DenomTraceSDKType; } /** * QueryConnectionsRequest is the request type for the Query/DenomTraces RPC @@ -69,7 +72,7 @@ export interface QueryDenomTraceResponseSDKType { */ export interface QueryDenomTracesRequest { /** pagination defines an optional pagination for the request. */ - pagination: PageRequest; + pagination?: PageRequest; } export interface QueryDenomTracesRequestProtoMsg { typeUrl: "/ibc.applications.transfer.v1.QueryDenomTracesRequest"; @@ -92,7 +95,7 @@ export interface QueryDenomTracesRequestAminoMsg { * method */ export interface QueryDenomTracesRequestSDKType { - pagination: PageRequestSDKType; + pagination?: PageRequestSDKType; } /** * QueryConnectionsResponse is the response type for the Query/DenomTraces RPC @@ -102,7 +105,7 @@ export interface QueryDenomTracesResponse { /** denom_traces returns all denominations trace information. */ denomTraces: DenomTrace[]; /** pagination defines the pagination in the response. */ - pagination: PageResponse; + pagination?: PageResponse; } export interface QueryDenomTracesResponseProtoMsg { typeUrl: "/ibc.applications.transfer.v1.QueryDenomTracesResponse"; @@ -114,7 +117,7 @@ export interface QueryDenomTracesResponseProtoMsg { */ export interface QueryDenomTracesResponseAmino { /** denom_traces returns all denominations trace information. */ - denom_traces: DenomTraceAmino[]; + denom_traces?: DenomTraceAmino[]; /** pagination defines the pagination in the response. */ pagination?: PageResponseAmino; } @@ -128,7 +131,7 @@ export interface QueryDenomTracesResponseAminoMsg { */ export interface QueryDenomTracesResponseSDKType { denom_traces: DenomTraceSDKType[]; - pagination: PageResponseSDKType; + pagination?: PageResponseSDKType; } /** QueryParamsRequest is the request type for the Query/Params RPC method. */ export interface QueryParamsRequest {} @@ -147,7 +150,7 @@ export interface QueryParamsRequestSDKType {} /** 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; } export interface QueryParamsResponseProtoMsg { typeUrl: "/ibc.applications.transfer.v1.QueryParamsResponse"; @@ -164,7 +167,7 @@ export interface QueryParamsResponseAminoMsg { } /** QueryParamsResponse is the response type for the Query/Params RPC method. */ export interface QueryParamsResponseSDKType { - params: ParamsSDKType; + params?: ParamsSDKType; } /** * QueryDenomHashRequest is the request type for the Query/DenomHash RPC @@ -184,7 +187,7 @@ export interface QueryDenomHashRequestProtoMsg { */ export interface QueryDenomHashRequestAmino { /** The denomination trace ([port_id]/[channel_id])+/[denom] */ - trace: string; + trace?: string; } export interface QueryDenomHashRequestAminoMsg { type: "cosmos-sdk/QueryDenomHashRequest"; @@ -215,7 +218,7 @@ export interface QueryDenomHashResponseProtoMsg { */ export interface QueryDenomHashResponseAmino { /** hash (in hex format) of the denomination trace information. */ - hash: string; + hash?: string; } export interface QueryDenomHashResponseAminoMsg { type: "cosmos-sdk/QueryDenomHashResponse"; @@ -242,9 +245,9 @@ export interface QueryEscrowAddressRequestProtoMsg { /** QueryEscrowAddressRequest is the request type for the EscrowAddress RPC method. */ export interface QueryEscrowAddressRequestAmino { /** unique port identifier */ - port_id: string; + port_id?: string; /** unique channel identifier */ - channel_id: string; + channel_id?: string; } export interface QueryEscrowAddressRequestAminoMsg { type: "cosmos-sdk/QueryEscrowAddressRequest"; @@ -267,7 +270,7 @@ export interface QueryEscrowAddressResponseProtoMsg { /** QueryEscrowAddressResponse is the response type of the EscrowAddress RPC method. */ export interface QueryEscrowAddressResponseAmino { /** the escrow account address */ - escrow_address: string; + escrow_address?: string; } export interface QueryEscrowAddressResponseAminoMsg { type: "cosmos-sdk/QueryEscrowAddressResponse"; @@ -277,6 +280,46 @@ export interface QueryEscrowAddressResponseAminoMsg { export interface QueryEscrowAddressResponseSDKType { escrow_address: string; } +/** QueryTotalEscrowForDenomRequest is the request type for TotalEscrowForDenom RPC method. */ +export interface QueryTotalEscrowForDenomRequest { + denom: string; +} +export interface QueryTotalEscrowForDenomRequestProtoMsg { + typeUrl: "/ibc.applications.transfer.v1.QueryTotalEscrowForDenomRequest"; + value: Uint8Array; +} +/** QueryTotalEscrowForDenomRequest is the request type for TotalEscrowForDenom RPC method. */ +export interface QueryTotalEscrowForDenomRequestAmino { + denom?: string; +} +export interface QueryTotalEscrowForDenomRequestAminoMsg { + type: "cosmos-sdk/QueryTotalEscrowForDenomRequest"; + value: QueryTotalEscrowForDenomRequestAmino; +} +/** QueryTotalEscrowForDenomRequest is the request type for TotalEscrowForDenom RPC method. */ +export interface QueryTotalEscrowForDenomRequestSDKType { + denom: string; +} +/** QueryTotalEscrowForDenomResponse is the response type for TotalEscrowForDenom RPC method. */ +export interface QueryTotalEscrowForDenomResponse { + amount: Coin; +} +export interface QueryTotalEscrowForDenomResponseProtoMsg { + typeUrl: "/ibc.applications.transfer.v1.QueryTotalEscrowForDenomResponse"; + value: Uint8Array; +} +/** QueryTotalEscrowForDenomResponse is the response type for TotalEscrowForDenom RPC method. */ +export interface QueryTotalEscrowForDenomResponseAmino { + amount?: CoinAmino; +} +export interface QueryTotalEscrowForDenomResponseAminoMsg { + type: "cosmos-sdk/QueryTotalEscrowForDenomResponse"; + value: QueryTotalEscrowForDenomResponseAmino; +} +/** QueryTotalEscrowForDenomResponse is the response type for TotalEscrowForDenom RPC method. */ +export interface QueryTotalEscrowForDenomResponseSDKType { + amount: CoinSDKType; +} function createBaseQueryDenomTraceRequest(): QueryDenomTraceRequest { return { hash: "" @@ -284,6 +327,16 @@ function createBaseQueryDenomTraceRequest(): QueryDenomTraceRequest { } export const QueryDenomTraceRequest = { typeUrl: "/ibc.applications.transfer.v1.QueryDenomTraceRequest", + aminoType: "cosmos-sdk/QueryDenomTraceRequest", + is(o: any): o is QueryDenomTraceRequest { + return o && (o.$typeUrl === QueryDenomTraceRequest.typeUrl || typeof o.hash === "string"); + }, + isSDK(o: any): o is QueryDenomTraceRequestSDKType { + return o && (o.$typeUrl === QueryDenomTraceRequest.typeUrl || typeof o.hash === "string"); + }, + isAmino(o: any): o is QueryDenomTraceRequestAmino { + return o && (o.$typeUrl === QueryDenomTraceRequest.typeUrl || typeof o.hash === "string"); + }, encode(message: QueryDenomTraceRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.hash !== "") { writer.uint32(10).string(message.hash); @@ -307,15 +360,27 @@ export const QueryDenomTraceRequest = { } return message; }, + fromJSON(object: any): QueryDenomTraceRequest { + return { + hash: isSet(object.hash) ? String(object.hash) : "" + }; + }, + toJSON(message: QueryDenomTraceRequest): unknown { + const obj: any = {}; + message.hash !== undefined && (obj.hash = message.hash); + return obj; + }, fromPartial(object: Partial): QueryDenomTraceRequest { const message = createBaseQueryDenomTraceRequest(); message.hash = object.hash ?? ""; return message; }, fromAmino(object: QueryDenomTraceRequestAmino): QueryDenomTraceRequest { - return { - hash: object.hash - }; + const message = createBaseQueryDenomTraceRequest(); + if (object.hash !== undefined && object.hash !== null) { + message.hash = object.hash; + } + return message; }, toAmino(message: QueryDenomTraceRequest): QueryDenomTraceRequestAmino { const obj: any = {}; @@ -344,13 +409,25 @@ export const QueryDenomTraceRequest = { }; } }; +GlobalDecoderRegistry.register(QueryDenomTraceRequest.typeUrl, QueryDenomTraceRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryDenomTraceRequest.aminoType, QueryDenomTraceRequest.typeUrl); function createBaseQueryDenomTraceResponse(): QueryDenomTraceResponse { return { - denomTrace: DenomTrace.fromPartial({}) + denomTrace: undefined }; } export const QueryDenomTraceResponse = { typeUrl: "/ibc.applications.transfer.v1.QueryDenomTraceResponse", + aminoType: "cosmos-sdk/QueryDenomTraceResponse", + is(o: any): o is QueryDenomTraceResponse { + return o && o.$typeUrl === QueryDenomTraceResponse.typeUrl; + }, + isSDK(o: any): o is QueryDenomTraceResponseSDKType { + return o && o.$typeUrl === QueryDenomTraceResponse.typeUrl; + }, + isAmino(o: any): o is QueryDenomTraceResponseAmino { + return o && o.$typeUrl === QueryDenomTraceResponse.typeUrl; + }, encode(message: QueryDenomTraceResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.denomTrace !== undefined) { DenomTrace.encode(message.denomTrace, writer.uint32(10).fork()).ldelim(); @@ -374,15 +451,27 @@ export const QueryDenomTraceResponse = { } return message; }, + fromJSON(object: any): QueryDenomTraceResponse { + return { + denomTrace: isSet(object.denomTrace) ? DenomTrace.fromJSON(object.denomTrace) : undefined + }; + }, + toJSON(message: QueryDenomTraceResponse): unknown { + const obj: any = {}; + message.denomTrace !== undefined && (obj.denomTrace = message.denomTrace ? DenomTrace.toJSON(message.denomTrace) : undefined); + return obj; + }, fromPartial(object: Partial): QueryDenomTraceResponse { const message = createBaseQueryDenomTraceResponse(); message.denomTrace = object.denomTrace !== undefined && object.denomTrace !== null ? DenomTrace.fromPartial(object.denomTrace) : undefined; return message; }, fromAmino(object: QueryDenomTraceResponseAmino): QueryDenomTraceResponse { - return { - denomTrace: object?.denom_trace ? DenomTrace.fromAmino(object.denom_trace) : undefined - }; + const message = createBaseQueryDenomTraceResponse(); + if (object.denom_trace !== undefined && object.denom_trace !== null) { + message.denomTrace = DenomTrace.fromAmino(object.denom_trace); + } + return message; }, toAmino(message: QueryDenomTraceResponse): QueryDenomTraceResponseAmino { const obj: any = {}; @@ -411,13 +500,25 @@ export const QueryDenomTraceResponse = { }; } }; +GlobalDecoderRegistry.register(QueryDenomTraceResponse.typeUrl, QueryDenomTraceResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryDenomTraceResponse.aminoType, QueryDenomTraceResponse.typeUrl); function createBaseQueryDenomTracesRequest(): QueryDenomTracesRequest { return { - pagination: PageRequest.fromPartial({}) + pagination: undefined }; } export const QueryDenomTracesRequest = { typeUrl: "/ibc.applications.transfer.v1.QueryDenomTracesRequest", + aminoType: "cosmos-sdk/QueryDenomTracesRequest", + is(o: any): o is QueryDenomTracesRequest { + return o && o.$typeUrl === QueryDenomTracesRequest.typeUrl; + }, + isSDK(o: any): o is QueryDenomTracesRequestSDKType { + return o && o.$typeUrl === QueryDenomTracesRequest.typeUrl; + }, + isAmino(o: any): o is QueryDenomTracesRequestAmino { + return o && o.$typeUrl === QueryDenomTracesRequest.typeUrl; + }, encode(message: QueryDenomTracesRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.pagination !== undefined) { PageRequest.encode(message.pagination, writer.uint32(10).fork()).ldelim(); @@ -441,15 +542,27 @@ export const QueryDenomTracesRequest = { } return message; }, + fromJSON(object: any): QueryDenomTracesRequest { + return { + pagination: isSet(object.pagination) ? PageRequest.fromJSON(object.pagination) : undefined + }; + }, + toJSON(message: QueryDenomTracesRequest): unknown { + const obj: any = {}; + message.pagination !== undefined && (obj.pagination = message.pagination ? PageRequest.toJSON(message.pagination) : undefined); + return obj; + }, fromPartial(object: Partial): QueryDenomTracesRequest { const message = createBaseQueryDenomTracesRequest(); message.pagination = object.pagination !== undefined && object.pagination !== null ? PageRequest.fromPartial(object.pagination) : undefined; return message; }, fromAmino(object: QueryDenomTracesRequestAmino): QueryDenomTracesRequest { - return { - pagination: object?.pagination ? PageRequest.fromAmino(object.pagination) : undefined - }; + const message = createBaseQueryDenomTracesRequest(); + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromAmino(object.pagination); + } + return message; }, toAmino(message: QueryDenomTracesRequest): QueryDenomTracesRequestAmino { const obj: any = {}; @@ -478,14 +591,26 @@ export const QueryDenomTracesRequest = { }; } }; +GlobalDecoderRegistry.register(QueryDenomTracesRequest.typeUrl, QueryDenomTracesRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryDenomTracesRequest.aminoType, QueryDenomTracesRequest.typeUrl); function createBaseQueryDenomTracesResponse(): QueryDenomTracesResponse { return { denomTraces: [], - pagination: PageResponse.fromPartial({}) + pagination: undefined }; } export const QueryDenomTracesResponse = { typeUrl: "/ibc.applications.transfer.v1.QueryDenomTracesResponse", + aminoType: "cosmos-sdk/QueryDenomTracesResponse", + is(o: any): o is QueryDenomTracesResponse { + return o && (o.$typeUrl === QueryDenomTracesResponse.typeUrl || Array.isArray(o.denomTraces) && (!o.denomTraces.length || DenomTrace.is(o.denomTraces[0]))); + }, + isSDK(o: any): o is QueryDenomTracesResponseSDKType { + return o && (o.$typeUrl === QueryDenomTracesResponse.typeUrl || Array.isArray(o.denom_traces) && (!o.denom_traces.length || DenomTrace.isSDK(o.denom_traces[0]))); + }, + isAmino(o: any): o is QueryDenomTracesResponseAmino { + return o && (o.$typeUrl === QueryDenomTracesResponse.typeUrl || Array.isArray(o.denom_traces) && (!o.denom_traces.length || DenomTrace.isAmino(o.denom_traces[0]))); + }, encode(message: QueryDenomTracesResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.denomTraces) { DenomTrace.encode(v!, writer.uint32(10).fork()).ldelim(); @@ -515,6 +640,22 @@ export const QueryDenomTracesResponse = { } return message; }, + fromJSON(object: any): QueryDenomTracesResponse { + return { + denomTraces: Array.isArray(object?.denomTraces) ? object.denomTraces.map((e: any) => DenomTrace.fromJSON(e)) : [], + pagination: isSet(object.pagination) ? PageResponse.fromJSON(object.pagination) : undefined + }; + }, + toJSON(message: QueryDenomTracesResponse): unknown { + const obj: any = {}; + if (message.denomTraces) { + obj.denomTraces = message.denomTraces.map(e => e ? DenomTrace.toJSON(e) : undefined); + } else { + obj.denomTraces = []; + } + message.pagination !== undefined && (obj.pagination = message.pagination ? PageResponse.toJSON(message.pagination) : undefined); + return obj; + }, fromPartial(object: Partial): QueryDenomTracesResponse { const message = createBaseQueryDenomTracesResponse(); message.denomTraces = object.denomTraces?.map(e => DenomTrace.fromPartial(e)) || []; @@ -522,10 +663,12 @@ export const QueryDenomTracesResponse = { return message; }, fromAmino(object: QueryDenomTracesResponseAmino): QueryDenomTracesResponse { - return { - denomTraces: Array.isArray(object?.denom_traces) ? object.denom_traces.map((e: any) => DenomTrace.fromAmino(e)) : [], - pagination: object?.pagination ? PageResponse.fromAmino(object.pagination) : undefined - }; + const message = createBaseQueryDenomTracesResponse(); + message.denomTraces = object.denom_traces?.map(e => DenomTrace.fromAmino(e)) || []; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromAmino(object.pagination); + } + return message; }, toAmino(message: QueryDenomTracesResponse): QueryDenomTracesResponseAmino { const obj: any = {}; @@ -559,11 +702,23 @@ export const QueryDenomTracesResponse = { }; } }; +GlobalDecoderRegistry.register(QueryDenomTracesResponse.typeUrl, QueryDenomTracesResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryDenomTracesResponse.aminoType, QueryDenomTracesResponse.typeUrl); function createBaseQueryParamsRequest(): QueryParamsRequest { return {}; } export const QueryParamsRequest = { typeUrl: "/ibc.applications.transfer.v1.QueryParamsRequest", + aminoType: "cosmos-sdk/QueryParamsRequest", + is(o: any): o is QueryParamsRequest { + return o && o.$typeUrl === QueryParamsRequest.typeUrl; + }, + isSDK(o: any): o is QueryParamsRequestSDKType { + return o && o.$typeUrl === QueryParamsRequest.typeUrl; + }, + isAmino(o: any): o is QueryParamsRequestAmino { + return o && o.$typeUrl === QueryParamsRequest.typeUrl; + }, encode(_: QueryParamsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, @@ -581,12 +736,20 @@ export const QueryParamsRequest = { } return message; }, + fromJSON(_: any): QueryParamsRequest { + return {}; + }, + toJSON(_: QueryParamsRequest): unknown { + const obj: any = {}; + return obj; + }, fromPartial(_: Partial): QueryParamsRequest { const message = createBaseQueryParamsRequest(); return message; }, fromAmino(_: QueryParamsRequestAmino): QueryParamsRequest { - return {}; + const message = createBaseQueryParamsRequest(); + return message; }, toAmino(_: QueryParamsRequest): QueryParamsRequestAmino { const obj: any = {}; @@ -614,13 +777,25 @@ export const QueryParamsRequest = { }; } }; +GlobalDecoderRegistry.register(QueryParamsRequest.typeUrl, QueryParamsRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryParamsRequest.aminoType, QueryParamsRequest.typeUrl); function createBaseQueryParamsResponse(): QueryParamsResponse { return { - params: Params.fromPartial({}) + params: undefined }; } export const QueryParamsResponse = { typeUrl: "/ibc.applications.transfer.v1.QueryParamsResponse", + aminoType: "cosmos-sdk/QueryParamsResponse", + is(o: any): o is QueryParamsResponse { + return o && o.$typeUrl === QueryParamsResponse.typeUrl; + }, + isSDK(o: any): o is QueryParamsResponseSDKType { + return o && o.$typeUrl === QueryParamsResponse.typeUrl; + }, + isAmino(o: any): o is QueryParamsResponseAmino { + return o && o.$typeUrl === QueryParamsResponse.typeUrl; + }, encode(message: QueryParamsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.params !== undefined) { Params.encode(message.params, writer.uint32(10).fork()).ldelim(); @@ -644,15 +819,27 @@ export const QueryParamsResponse = { } return message; }, + fromJSON(object: any): QueryParamsResponse { + 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; + }, fromPartial(object: Partial): QueryParamsResponse { const message = createBaseQueryParamsResponse(); message.params = object.params !== undefined && object.params !== null ? Params.fromPartial(object.params) : undefined; return message; }, fromAmino(object: QueryParamsResponseAmino): QueryParamsResponse { - return { - params: object?.params ? Params.fromAmino(object.params) : undefined - }; + const message = createBaseQueryParamsResponse(); + if (object.params !== undefined && object.params !== null) { + message.params = Params.fromAmino(object.params); + } + return message; }, toAmino(message: QueryParamsResponse): QueryParamsResponseAmino { const obj: any = {}; @@ -681,6 +868,8 @@ export const QueryParamsResponse = { }; } }; +GlobalDecoderRegistry.register(QueryParamsResponse.typeUrl, QueryParamsResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryParamsResponse.aminoType, QueryParamsResponse.typeUrl); function createBaseQueryDenomHashRequest(): QueryDenomHashRequest { return { trace: "" @@ -688,6 +877,16 @@ function createBaseQueryDenomHashRequest(): QueryDenomHashRequest { } export const QueryDenomHashRequest = { typeUrl: "/ibc.applications.transfer.v1.QueryDenomHashRequest", + aminoType: "cosmos-sdk/QueryDenomHashRequest", + is(o: any): o is QueryDenomHashRequest { + return o && (o.$typeUrl === QueryDenomHashRequest.typeUrl || typeof o.trace === "string"); + }, + isSDK(o: any): o is QueryDenomHashRequestSDKType { + return o && (o.$typeUrl === QueryDenomHashRequest.typeUrl || typeof o.trace === "string"); + }, + isAmino(o: any): o is QueryDenomHashRequestAmino { + return o && (o.$typeUrl === QueryDenomHashRequest.typeUrl || typeof o.trace === "string"); + }, encode(message: QueryDenomHashRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.trace !== "") { writer.uint32(10).string(message.trace); @@ -711,15 +910,27 @@ export const QueryDenomHashRequest = { } return message; }, + fromJSON(object: any): QueryDenomHashRequest { + return { + trace: isSet(object.trace) ? String(object.trace) : "" + }; + }, + toJSON(message: QueryDenomHashRequest): unknown { + const obj: any = {}; + message.trace !== undefined && (obj.trace = message.trace); + return obj; + }, fromPartial(object: Partial): QueryDenomHashRequest { const message = createBaseQueryDenomHashRequest(); message.trace = object.trace ?? ""; return message; }, fromAmino(object: QueryDenomHashRequestAmino): QueryDenomHashRequest { - return { - trace: object.trace - }; + const message = createBaseQueryDenomHashRequest(); + if (object.trace !== undefined && object.trace !== null) { + message.trace = object.trace; + } + return message; }, toAmino(message: QueryDenomHashRequest): QueryDenomHashRequestAmino { const obj: any = {}; @@ -748,6 +959,8 @@ export const QueryDenomHashRequest = { }; } }; +GlobalDecoderRegistry.register(QueryDenomHashRequest.typeUrl, QueryDenomHashRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryDenomHashRequest.aminoType, QueryDenomHashRequest.typeUrl); function createBaseQueryDenomHashResponse(): QueryDenomHashResponse { return { hash: "" @@ -755,6 +968,16 @@ function createBaseQueryDenomHashResponse(): QueryDenomHashResponse { } export const QueryDenomHashResponse = { typeUrl: "/ibc.applications.transfer.v1.QueryDenomHashResponse", + aminoType: "cosmos-sdk/QueryDenomHashResponse", + is(o: any): o is QueryDenomHashResponse { + return o && (o.$typeUrl === QueryDenomHashResponse.typeUrl || typeof o.hash === "string"); + }, + isSDK(o: any): o is QueryDenomHashResponseSDKType { + return o && (o.$typeUrl === QueryDenomHashResponse.typeUrl || typeof o.hash === "string"); + }, + isAmino(o: any): o is QueryDenomHashResponseAmino { + return o && (o.$typeUrl === QueryDenomHashResponse.typeUrl || typeof o.hash === "string"); + }, encode(message: QueryDenomHashResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.hash !== "") { writer.uint32(10).string(message.hash); @@ -778,15 +1001,27 @@ export const QueryDenomHashResponse = { } return message; }, + fromJSON(object: any): QueryDenomHashResponse { + return { + hash: isSet(object.hash) ? String(object.hash) : "" + }; + }, + toJSON(message: QueryDenomHashResponse): unknown { + const obj: any = {}; + message.hash !== undefined && (obj.hash = message.hash); + return obj; + }, fromPartial(object: Partial): QueryDenomHashResponse { const message = createBaseQueryDenomHashResponse(); message.hash = object.hash ?? ""; return message; }, fromAmino(object: QueryDenomHashResponseAmino): QueryDenomHashResponse { - return { - hash: object.hash - }; + const message = createBaseQueryDenomHashResponse(); + if (object.hash !== undefined && object.hash !== null) { + message.hash = object.hash; + } + return message; }, toAmino(message: QueryDenomHashResponse): QueryDenomHashResponseAmino { const obj: any = {}; @@ -815,6 +1050,8 @@ export const QueryDenomHashResponse = { }; } }; +GlobalDecoderRegistry.register(QueryDenomHashResponse.typeUrl, QueryDenomHashResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryDenomHashResponse.aminoType, QueryDenomHashResponse.typeUrl); function createBaseQueryEscrowAddressRequest(): QueryEscrowAddressRequest { return { portId: "", @@ -823,6 +1060,16 @@ function createBaseQueryEscrowAddressRequest(): QueryEscrowAddressRequest { } export const QueryEscrowAddressRequest = { typeUrl: "/ibc.applications.transfer.v1.QueryEscrowAddressRequest", + aminoType: "cosmos-sdk/QueryEscrowAddressRequest", + is(o: any): o is QueryEscrowAddressRequest { + return o && (o.$typeUrl === QueryEscrowAddressRequest.typeUrl || typeof o.portId === "string" && typeof o.channelId === "string"); + }, + isSDK(o: any): o is QueryEscrowAddressRequestSDKType { + return o && (o.$typeUrl === QueryEscrowAddressRequest.typeUrl || typeof o.port_id === "string" && typeof o.channel_id === "string"); + }, + isAmino(o: any): o is QueryEscrowAddressRequestAmino { + return o && (o.$typeUrl === QueryEscrowAddressRequest.typeUrl || typeof o.port_id === "string" && typeof o.channel_id === "string"); + }, encode(message: QueryEscrowAddressRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.portId !== "") { writer.uint32(10).string(message.portId); @@ -852,6 +1099,18 @@ export const QueryEscrowAddressRequest = { } return message; }, + fromJSON(object: any): QueryEscrowAddressRequest { + return { + portId: isSet(object.portId) ? String(object.portId) : "", + channelId: isSet(object.channelId) ? String(object.channelId) : "" + }; + }, + toJSON(message: QueryEscrowAddressRequest): unknown { + const obj: any = {}; + message.portId !== undefined && (obj.portId = message.portId); + message.channelId !== undefined && (obj.channelId = message.channelId); + return obj; + }, fromPartial(object: Partial): QueryEscrowAddressRequest { const message = createBaseQueryEscrowAddressRequest(); message.portId = object.portId ?? ""; @@ -859,10 +1118,14 @@ export const QueryEscrowAddressRequest = { return message; }, fromAmino(object: QueryEscrowAddressRequestAmino): QueryEscrowAddressRequest { - return { - portId: object.port_id, - channelId: object.channel_id - }; + const message = createBaseQueryEscrowAddressRequest(); + if (object.port_id !== undefined && object.port_id !== null) { + message.portId = object.port_id; + } + if (object.channel_id !== undefined && object.channel_id !== null) { + message.channelId = object.channel_id; + } + return message; }, toAmino(message: QueryEscrowAddressRequest): QueryEscrowAddressRequestAmino { const obj: any = {}; @@ -892,6 +1155,8 @@ export const QueryEscrowAddressRequest = { }; } }; +GlobalDecoderRegistry.register(QueryEscrowAddressRequest.typeUrl, QueryEscrowAddressRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryEscrowAddressRequest.aminoType, QueryEscrowAddressRequest.typeUrl); function createBaseQueryEscrowAddressResponse(): QueryEscrowAddressResponse { return { escrowAddress: "" @@ -899,6 +1164,16 @@ function createBaseQueryEscrowAddressResponse(): QueryEscrowAddressResponse { } export const QueryEscrowAddressResponse = { typeUrl: "/ibc.applications.transfer.v1.QueryEscrowAddressResponse", + aminoType: "cosmos-sdk/QueryEscrowAddressResponse", + is(o: any): o is QueryEscrowAddressResponse { + return o && (o.$typeUrl === QueryEscrowAddressResponse.typeUrl || typeof o.escrowAddress === "string"); + }, + isSDK(o: any): o is QueryEscrowAddressResponseSDKType { + return o && (o.$typeUrl === QueryEscrowAddressResponse.typeUrl || typeof o.escrow_address === "string"); + }, + isAmino(o: any): o is QueryEscrowAddressResponseAmino { + return o && (o.$typeUrl === QueryEscrowAddressResponse.typeUrl || typeof o.escrow_address === "string"); + }, encode(message: QueryEscrowAddressResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.escrowAddress !== "") { writer.uint32(10).string(message.escrowAddress); @@ -922,15 +1197,27 @@ export const QueryEscrowAddressResponse = { } return message; }, + fromJSON(object: any): QueryEscrowAddressResponse { + return { + escrowAddress: isSet(object.escrowAddress) ? String(object.escrowAddress) : "" + }; + }, + toJSON(message: QueryEscrowAddressResponse): unknown { + const obj: any = {}; + message.escrowAddress !== undefined && (obj.escrowAddress = message.escrowAddress); + return obj; + }, fromPartial(object: Partial): QueryEscrowAddressResponse { const message = createBaseQueryEscrowAddressResponse(); message.escrowAddress = object.escrowAddress ?? ""; return message; }, fromAmino(object: QueryEscrowAddressResponseAmino): QueryEscrowAddressResponse { - return { - escrowAddress: object.escrow_address - }; + const message = createBaseQueryEscrowAddressResponse(); + if (object.escrow_address !== undefined && object.escrow_address !== null) { + message.escrowAddress = object.escrow_address; + } + return message; }, toAmino(message: QueryEscrowAddressResponse): QueryEscrowAddressResponseAmino { const obj: any = {}; @@ -958,4 +1245,188 @@ export const QueryEscrowAddressResponse = { value: QueryEscrowAddressResponse.encode(message).finish() }; } -}; \ No newline at end of file +}; +GlobalDecoderRegistry.register(QueryEscrowAddressResponse.typeUrl, QueryEscrowAddressResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryEscrowAddressResponse.aminoType, QueryEscrowAddressResponse.typeUrl); +function createBaseQueryTotalEscrowForDenomRequest(): QueryTotalEscrowForDenomRequest { + return { + denom: "" + }; +} +export const QueryTotalEscrowForDenomRequest = { + typeUrl: "/ibc.applications.transfer.v1.QueryTotalEscrowForDenomRequest", + aminoType: "cosmos-sdk/QueryTotalEscrowForDenomRequest", + is(o: any): o is QueryTotalEscrowForDenomRequest { + return o && (o.$typeUrl === QueryTotalEscrowForDenomRequest.typeUrl || typeof o.denom === "string"); + }, + isSDK(o: any): o is QueryTotalEscrowForDenomRequestSDKType { + return o && (o.$typeUrl === QueryTotalEscrowForDenomRequest.typeUrl || typeof o.denom === "string"); + }, + isAmino(o: any): o is QueryTotalEscrowForDenomRequestAmino { + return o && (o.$typeUrl === QueryTotalEscrowForDenomRequest.typeUrl || typeof o.denom === "string"); + }, + encode(message: QueryTotalEscrowForDenomRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.denom !== "") { + writer.uint32(10).string(message.denom); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryTotalEscrowForDenomRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryTotalEscrowForDenomRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.denom = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): QueryTotalEscrowForDenomRequest { + return { + denom: isSet(object.denom) ? String(object.denom) : "" + }; + }, + toJSON(message: QueryTotalEscrowForDenomRequest): unknown { + const obj: any = {}; + message.denom !== undefined && (obj.denom = message.denom); + return obj; + }, + fromPartial(object: Partial): QueryTotalEscrowForDenomRequest { + const message = createBaseQueryTotalEscrowForDenomRequest(); + message.denom = object.denom ?? ""; + return message; + }, + fromAmino(object: QueryTotalEscrowForDenomRequestAmino): QueryTotalEscrowForDenomRequest { + const message = createBaseQueryTotalEscrowForDenomRequest(); + if (object.denom !== undefined && object.denom !== null) { + message.denom = object.denom; + } + return message; + }, + toAmino(message: QueryTotalEscrowForDenomRequest): QueryTotalEscrowForDenomRequestAmino { + const obj: any = {}; + obj.denom = message.denom; + return obj; + }, + fromAminoMsg(object: QueryTotalEscrowForDenomRequestAminoMsg): QueryTotalEscrowForDenomRequest { + return QueryTotalEscrowForDenomRequest.fromAmino(object.value); + }, + toAminoMsg(message: QueryTotalEscrowForDenomRequest): QueryTotalEscrowForDenomRequestAminoMsg { + return { + type: "cosmos-sdk/QueryTotalEscrowForDenomRequest", + value: QueryTotalEscrowForDenomRequest.toAmino(message) + }; + }, + fromProtoMsg(message: QueryTotalEscrowForDenomRequestProtoMsg): QueryTotalEscrowForDenomRequest { + return QueryTotalEscrowForDenomRequest.decode(message.value); + }, + toProto(message: QueryTotalEscrowForDenomRequest): Uint8Array { + return QueryTotalEscrowForDenomRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryTotalEscrowForDenomRequest): QueryTotalEscrowForDenomRequestProtoMsg { + return { + typeUrl: "/ibc.applications.transfer.v1.QueryTotalEscrowForDenomRequest", + value: QueryTotalEscrowForDenomRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryTotalEscrowForDenomRequest.typeUrl, QueryTotalEscrowForDenomRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryTotalEscrowForDenomRequest.aminoType, QueryTotalEscrowForDenomRequest.typeUrl); +function createBaseQueryTotalEscrowForDenomResponse(): QueryTotalEscrowForDenomResponse { + return { + amount: Coin.fromPartial({}) + }; +} +export const QueryTotalEscrowForDenomResponse = { + typeUrl: "/ibc.applications.transfer.v1.QueryTotalEscrowForDenomResponse", + aminoType: "cosmos-sdk/QueryTotalEscrowForDenomResponse", + is(o: any): o is QueryTotalEscrowForDenomResponse { + return o && (o.$typeUrl === QueryTotalEscrowForDenomResponse.typeUrl || Coin.is(o.amount)); + }, + isSDK(o: any): o is QueryTotalEscrowForDenomResponseSDKType { + return o && (o.$typeUrl === QueryTotalEscrowForDenomResponse.typeUrl || Coin.isSDK(o.amount)); + }, + isAmino(o: any): o is QueryTotalEscrowForDenomResponseAmino { + return o && (o.$typeUrl === QueryTotalEscrowForDenomResponse.typeUrl || Coin.isAmino(o.amount)); + }, + encode(message: QueryTotalEscrowForDenomResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.amount !== undefined) { + Coin.encode(message.amount, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryTotalEscrowForDenomResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryTotalEscrowForDenomResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.amount = Coin.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): QueryTotalEscrowForDenomResponse { + return { + amount: isSet(object.amount) ? Coin.fromJSON(object.amount) : undefined + }; + }, + toJSON(message: QueryTotalEscrowForDenomResponse): unknown { + const obj: any = {}; + message.amount !== undefined && (obj.amount = message.amount ? Coin.toJSON(message.amount) : undefined); + return obj; + }, + fromPartial(object: Partial): QueryTotalEscrowForDenomResponse { + const message = createBaseQueryTotalEscrowForDenomResponse(); + message.amount = object.amount !== undefined && object.amount !== null ? Coin.fromPartial(object.amount) : undefined; + return message; + }, + fromAmino(object: QueryTotalEscrowForDenomResponseAmino): QueryTotalEscrowForDenomResponse { + const message = createBaseQueryTotalEscrowForDenomResponse(); + if (object.amount !== undefined && object.amount !== null) { + message.amount = Coin.fromAmino(object.amount); + } + return message; + }, + toAmino(message: QueryTotalEscrowForDenomResponse): QueryTotalEscrowForDenomResponseAmino { + const obj: any = {}; + obj.amount = message.amount ? Coin.toAmino(message.amount) : undefined; + return obj; + }, + fromAminoMsg(object: QueryTotalEscrowForDenomResponseAminoMsg): QueryTotalEscrowForDenomResponse { + return QueryTotalEscrowForDenomResponse.fromAmino(object.value); + }, + toAminoMsg(message: QueryTotalEscrowForDenomResponse): QueryTotalEscrowForDenomResponseAminoMsg { + return { + type: "cosmos-sdk/QueryTotalEscrowForDenomResponse", + value: QueryTotalEscrowForDenomResponse.toAmino(message) + }; + }, + fromProtoMsg(message: QueryTotalEscrowForDenomResponseProtoMsg): QueryTotalEscrowForDenomResponse { + return QueryTotalEscrowForDenomResponse.decode(message.value); + }, + toProto(message: QueryTotalEscrowForDenomResponse): Uint8Array { + return QueryTotalEscrowForDenomResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryTotalEscrowForDenomResponse): QueryTotalEscrowForDenomResponseProtoMsg { + return { + typeUrl: "/ibc.applications.transfer.v1.QueryTotalEscrowForDenomResponse", + value: QueryTotalEscrowForDenomResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryTotalEscrowForDenomResponse.typeUrl, QueryTotalEscrowForDenomResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryTotalEscrowForDenomResponse.aminoType, QueryTotalEscrowForDenomResponse.typeUrl); \ No newline at end of file diff --git a/packages/osmojs/src/codegen/ibc/applications/transfer/v1/transfer.ts b/packages/osmojs/src/codegen/ibc/applications/transfer/v1/transfer.ts index 5c9105ebe..f75f34b1c 100644 --- a/packages/osmojs/src/codegen/ibc/applications/transfer/v1/transfer.ts +++ b/packages/osmojs/src/codegen/ibc/applications/transfer/v1/transfer.ts @@ -1,4 +1,6 @@ import { BinaryReader, BinaryWriter } from "../../../../binary"; +import { isSet } from "../../../../helpers"; +import { GlobalDecoderRegistry } from "../../../../registry"; /** * DenomTrace contains the base denomination for ICS20 fungible tokens and the * source tracing information path. @@ -25,9 +27,9 @@ export interface DenomTraceAmino { * path defines the chain of port/channel identifiers used for tracing the * source of the fungible token. */ - path: string; + path?: string; /** base denomination of the relayed fungible token. */ - base_denom: string; + base_denom?: string; } export interface DenomTraceAminoMsg { type: "cosmos-sdk/DenomTrace"; @@ -74,12 +76,12 @@ export interface ParamsAmino { * send_enabled enables or disables all cross-chain token transfers from this * chain. */ - send_enabled: boolean; + send_enabled?: boolean; /** * receive_enabled enables or disables all cross-chain token transfers to this * chain. */ - receive_enabled: boolean; + receive_enabled?: boolean; } export interface ParamsAminoMsg { type: "cosmos-sdk/Params"; @@ -103,6 +105,16 @@ function createBaseDenomTrace(): DenomTrace { } export const DenomTrace = { typeUrl: "/ibc.applications.transfer.v1.DenomTrace", + aminoType: "cosmos-sdk/DenomTrace", + is(o: any): o is DenomTrace { + return o && (o.$typeUrl === DenomTrace.typeUrl || typeof o.path === "string" && typeof o.baseDenom === "string"); + }, + isSDK(o: any): o is DenomTraceSDKType { + return o && (o.$typeUrl === DenomTrace.typeUrl || typeof o.path === "string" && typeof o.base_denom === "string"); + }, + isAmino(o: any): o is DenomTraceAmino { + return o && (o.$typeUrl === DenomTrace.typeUrl || typeof o.path === "string" && typeof o.base_denom === "string"); + }, encode(message: DenomTrace, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.path !== "") { writer.uint32(10).string(message.path); @@ -132,6 +144,18 @@ export const DenomTrace = { } return message; }, + fromJSON(object: any): DenomTrace { + return { + path: isSet(object.path) ? String(object.path) : "", + baseDenom: isSet(object.baseDenom) ? String(object.baseDenom) : "" + }; + }, + toJSON(message: DenomTrace): unknown { + const obj: any = {}; + message.path !== undefined && (obj.path = message.path); + message.baseDenom !== undefined && (obj.baseDenom = message.baseDenom); + return obj; + }, fromPartial(object: Partial): DenomTrace { const message = createBaseDenomTrace(); message.path = object.path ?? ""; @@ -139,10 +163,14 @@ export const DenomTrace = { return message; }, fromAmino(object: DenomTraceAmino): DenomTrace { - return { - path: object.path, - baseDenom: object.base_denom - }; + const message = createBaseDenomTrace(); + if (object.path !== undefined && object.path !== null) { + message.path = object.path; + } + if (object.base_denom !== undefined && object.base_denom !== null) { + message.baseDenom = object.base_denom; + } + return message; }, toAmino(message: DenomTrace): DenomTraceAmino { const obj: any = {}; @@ -172,6 +200,8 @@ export const DenomTrace = { }; } }; +GlobalDecoderRegistry.register(DenomTrace.typeUrl, DenomTrace); +GlobalDecoderRegistry.registerAminoProtoMapping(DenomTrace.aminoType, DenomTrace.typeUrl); function createBaseParams(): Params { return { sendEnabled: false, @@ -180,6 +210,16 @@ function createBaseParams(): Params { } export const Params = { typeUrl: "/ibc.applications.transfer.v1.Params", + aminoType: "cosmos-sdk/Params", + is(o: any): o is Params { + return o && (o.$typeUrl === Params.typeUrl || typeof o.sendEnabled === "boolean" && typeof o.receiveEnabled === "boolean"); + }, + isSDK(o: any): o is ParamsSDKType { + return o && (o.$typeUrl === Params.typeUrl || typeof o.send_enabled === "boolean" && typeof o.receive_enabled === "boolean"); + }, + isAmino(o: any): o is ParamsAmino { + return o && (o.$typeUrl === Params.typeUrl || typeof o.send_enabled === "boolean" && typeof o.receive_enabled === "boolean"); + }, encode(message: Params, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.sendEnabled === true) { writer.uint32(8).bool(message.sendEnabled); @@ -209,6 +249,18 @@ export const Params = { } return message; }, + fromJSON(object: any): Params { + return { + sendEnabled: isSet(object.sendEnabled) ? Boolean(object.sendEnabled) : false, + receiveEnabled: isSet(object.receiveEnabled) ? Boolean(object.receiveEnabled) : false + }; + }, + toJSON(message: Params): unknown { + const obj: any = {}; + message.sendEnabled !== undefined && (obj.sendEnabled = message.sendEnabled); + message.receiveEnabled !== undefined && (obj.receiveEnabled = message.receiveEnabled); + return obj; + }, fromPartial(object: Partial): Params { const message = createBaseParams(); message.sendEnabled = object.sendEnabled ?? false; @@ -216,10 +268,14 @@ export const Params = { return message; }, fromAmino(object: ParamsAmino): Params { - return { - sendEnabled: object.send_enabled, - receiveEnabled: object.receive_enabled - }; + const message = createBaseParams(); + if (object.send_enabled !== undefined && object.send_enabled !== null) { + message.sendEnabled = object.send_enabled; + } + if (object.receive_enabled !== undefined && object.receive_enabled !== null) { + message.receiveEnabled = object.receive_enabled; + } + return message; }, toAmino(message: Params): ParamsAmino { const obj: any = {}; @@ -248,4 +304,6 @@ export const Params = { value: Params.encode(message).finish() }; } -}; \ No newline at end of file +}; +GlobalDecoderRegistry.register(Params.typeUrl, Params); +GlobalDecoderRegistry.registerAminoProtoMapping(Params.aminoType, Params.typeUrl); \ No newline at end of file diff --git a/packages/osmojs/src/codegen/ibc/applications/transfer/v1/tx.amino.ts b/packages/osmojs/src/codegen/ibc/applications/transfer/v1/tx.amino.ts index 7295985b5..f220cd069 100644 --- a/packages/osmojs/src/codegen/ibc/applications/transfer/v1/tx.amino.ts +++ b/packages/osmojs/src/codegen/ibc/applications/transfer/v1/tx.amino.ts @@ -1,9 +1,14 @@ //@ts-nocheck -import { MsgTransfer } from "./tx"; +import { MsgTransfer, MsgUpdateParams } from "./tx"; export const AminoConverter = { "/ibc.applications.transfer.v1.MsgTransfer": { aminoType: "cosmos-sdk/MsgTransfer", toAmino: MsgTransfer.toAmino, fromAmino: MsgTransfer.fromAmino + }, + "/ibc.applications.transfer.v1.MsgUpdateParams": { + aminoType: "cosmos-sdk/MsgUpdateParams", + toAmino: MsgUpdateParams.toAmino, + fromAmino: MsgUpdateParams.fromAmino } }; \ No newline at end of file diff --git a/packages/osmojs/src/codegen/ibc/applications/transfer/v1/tx.registry.ts b/packages/osmojs/src/codegen/ibc/applications/transfer/v1/tx.registry.ts index dae96a3a7..4befe1a7a 100644 --- a/packages/osmojs/src/codegen/ibc/applications/transfer/v1/tx.registry.ts +++ b/packages/osmojs/src/codegen/ibc/applications/transfer/v1/tx.registry.ts @@ -1,7 +1,7 @@ //@ts-nocheck import { GeneratedType, Registry } from "@cosmjs/proto-signing"; -import { MsgTransfer } from "./tx"; -export const registry: ReadonlyArray<[string, GeneratedType]> = [["/ibc.applications.transfer.v1.MsgTransfer", MsgTransfer]]; +import { MsgTransfer, MsgUpdateParams } from "./tx"; +export const registry: ReadonlyArray<[string, GeneratedType]> = [["/ibc.applications.transfer.v1.MsgTransfer", MsgTransfer], ["/ibc.applications.transfer.v1.MsgUpdateParams", MsgUpdateParams]]; export const load = (protoRegistry: Registry) => { registry.forEach(([typeUrl, mod]) => { protoRegistry.register(typeUrl, mod); @@ -14,6 +14,12 @@ export const MessageComposer = { typeUrl: "/ibc.applications.transfer.v1.MsgTransfer", value: MsgTransfer.encode(value).finish() }; + }, + updateParams(value: MsgUpdateParams) { + return { + typeUrl: "/ibc.applications.transfer.v1.MsgUpdateParams", + value: MsgUpdateParams.encode(value).finish() + }; } }, withTypeUrl: { @@ -22,6 +28,40 @@ export const MessageComposer = { typeUrl: "/ibc.applications.transfer.v1.MsgTransfer", value }; + }, + updateParams(value: MsgUpdateParams) { + return { + typeUrl: "/ibc.applications.transfer.v1.MsgUpdateParams", + value + }; + } + }, + toJSON: { + transfer(value: MsgTransfer) { + return { + typeUrl: "/ibc.applications.transfer.v1.MsgTransfer", + value: MsgTransfer.toJSON(value) + }; + }, + updateParams(value: MsgUpdateParams) { + return { + typeUrl: "/ibc.applications.transfer.v1.MsgUpdateParams", + value: MsgUpdateParams.toJSON(value) + }; + } + }, + fromJSON: { + transfer(value: any) { + return { + typeUrl: "/ibc.applications.transfer.v1.MsgTransfer", + value: MsgTransfer.fromJSON(value) + }; + }, + updateParams(value: any) { + return { + typeUrl: "/ibc.applications.transfer.v1.MsgUpdateParams", + value: MsgUpdateParams.fromJSON(value) + }; } }, fromPartial: { @@ -30,6 +70,12 @@ export const MessageComposer = { typeUrl: "/ibc.applications.transfer.v1.MsgTransfer", value: MsgTransfer.fromPartial(value) }; + }, + updateParams(value: MsgUpdateParams) { + return { + typeUrl: "/ibc.applications.transfer.v1.MsgUpdateParams", + value: MsgUpdateParams.fromPartial(value) + }; } } }; \ No newline at end of file diff --git a/packages/osmojs/src/codegen/ibc/applications/transfer/v1/tx.rpc.msg.ts b/packages/osmojs/src/codegen/ibc/applications/transfer/v1/tx.rpc.msg.ts index c4f28579a..572e99567 100644 --- a/packages/osmojs/src/codegen/ibc/applications/transfer/v1/tx.rpc.msg.ts +++ b/packages/osmojs/src/codegen/ibc/applications/transfer/v1/tx.rpc.msg.ts @@ -1,20 +1,31 @@ import { Rpc } from "../../../../helpers"; import { BinaryReader } from "../../../../binary"; -import { MsgTransfer, MsgTransferResponse } from "./tx"; +import { MsgTransfer, MsgTransferResponse, MsgUpdateParams, MsgUpdateParamsResponse } from "./tx"; /** Msg defines the ibc/transfer Msg service. */ export interface Msg { /** Transfer defines a rpc handler method for MsgTransfer. */ transfer(request: MsgTransfer): Promise; + /** UpdateParams defines a rpc handler for MsgUpdateParams. */ + updateParams(request: MsgUpdateParams): Promise; } export class MsgClientImpl implements Msg { private readonly rpc: Rpc; constructor(rpc: Rpc) { this.rpc = rpc; this.transfer = this.transfer.bind(this); + this.updateParams = this.updateParams.bind(this); } transfer(request: MsgTransfer): Promise { const data = MsgTransfer.encode(request).finish(); const promise = this.rpc.request("ibc.applications.transfer.v1.Msg", "Transfer", data); return promise.then(data => MsgTransferResponse.decode(new BinaryReader(data))); } -} \ No newline at end of file + updateParams(request: MsgUpdateParams): Promise { + const data = MsgUpdateParams.encode(request).finish(); + const promise = this.rpc.request("ibc.applications.transfer.v1.Msg", "UpdateParams", data); + return promise.then(data => MsgUpdateParamsResponse.decode(new BinaryReader(data))); + } +} +export const createClientImpl = (rpc: Rpc) => { + return new MsgClientImpl(rpc); +}; \ No newline at end of file diff --git a/packages/osmojs/src/codegen/ibc/applications/transfer/v1/tx.ts b/packages/osmojs/src/codegen/ibc/applications/transfer/v1/tx.ts index 1769db596..d87daf083 100644 --- a/packages/osmojs/src/codegen/ibc/applications/transfer/v1/tx.ts +++ b/packages/osmojs/src/codegen/ibc/applications/transfer/v1/tx.ts @@ -1,6 +1,8 @@ import { Coin, CoinAmino, CoinSDKType } from "../../../../cosmos/base/v1beta1/coin"; -import { Height, HeightAmino, HeightSDKType } from "../../../core/client/v1/client"; +import { Height, HeightAmino, HeightSDKType, Params, ParamsAmino, ParamsSDKType } from "../../../core/client/v1/client"; import { BinaryReader, BinaryWriter } from "../../../../binary"; +import { isSet } from "../../../../helpers"; +import { GlobalDecoderRegistry } from "../../../../registry"; /** * MsgTransfer defines a msg to transfer fungible tokens (i.e Coins) between * ICS20 enabled chains. See ICS Spec here: @@ -41,27 +43,27 @@ export interface MsgTransferProtoMsg { */ export interface MsgTransferAmino { /** the port on which the packet will be sent */ - source_port: string; + source_port?: string; /** the channel by which the packet will be sent */ - source_channel: string; + source_channel?: string; /** the tokens to be transferred */ - token?: CoinAmino; + token: CoinAmino; /** the sender address */ - sender: string; + sender?: string; /** the recipient address on the destination chain */ - receiver: string; + receiver?: string; /** * Timeout height relative to the current block height. * The timeout is disabled when set to 0. */ - timeout_height?: HeightAmino; + timeout_height: HeightAmino; /** * Timeout timestamp in absolute nanoseconds since unix epoch. * The timeout is disabled when set to 0. */ - timeout_timestamp: string; + timeout_timestamp?: string; /** optional memo */ - memo: string; + memo?: string; } export interface MsgTransferAminoMsg { type: "cosmos-sdk/MsgTransfer"; @@ -94,7 +96,7 @@ export interface MsgTransferResponseProtoMsg { /** MsgTransferResponse defines the Msg/Transfer response type. */ export interface MsgTransferResponseAmino { /** sequence number of the transfer packet sent */ - sequence: string; + sequence?: string; } export interface MsgTransferResponseAminoMsg { type: "cosmos-sdk/MsgTransferResponse"; @@ -104,11 +106,69 @@ export interface MsgTransferResponseAminoMsg { export interface MsgTransferResponseSDKType { sequence: bigint; } +/** MsgUpdateParams is the Msg/UpdateParams request type. */ +export interface MsgUpdateParams { + /** signer address */ + signer: string; + /** + * params defines the transfer parameters to update. + * + * NOTE: All parameters must be supplied. + */ + params: Params; +} +export interface MsgUpdateParamsProtoMsg { + typeUrl: "/ibc.applications.transfer.v1.MsgUpdateParams"; + value: Uint8Array; +} +/** MsgUpdateParams is the Msg/UpdateParams request type. */ +export interface MsgUpdateParamsAmino { + /** signer address */ + signer?: string; + /** + * params defines the transfer parameters to update. + * + * NOTE: All parameters must be supplied. + */ + params?: ParamsAmino; +} +export interface MsgUpdateParamsAminoMsg { + type: "cosmos-sdk/MsgUpdateParams"; + value: MsgUpdateParamsAmino; +} +/** MsgUpdateParams is the Msg/UpdateParams request type. */ +export interface MsgUpdateParamsSDKType { + signer: string; + params: ParamsSDKType; +} +/** + * MsgUpdateParamsResponse defines the response structure for executing a + * MsgUpdateParams message. + */ +export interface MsgUpdateParamsResponse {} +export interface MsgUpdateParamsResponseProtoMsg { + typeUrl: "/ibc.applications.transfer.v1.MsgUpdateParamsResponse"; + value: Uint8Array; +} +/** + * MsgUpdateParamsResponse defines the response structure for executing a + * MsgUpdateParams message. + */ +export interface MsgUpdateParamsResponseAmino {} +export interface MsgUpdateParamsResponseAminoMsg { + type: "cosmos-sdk/MsgUpdateParamsResponse"; + value: MsgUpdateParamsResponseAmino; +} +/** + * MsgUpdateParamsResponse defines the response structure for executing a + * MsgUpdateParams message. + */ +export interface MsgUpdateParamsResponseSDKType {} function createBaseMsgTransfer(): MsgTransfer { return { sourcePort: "", sourceChannel: "", - token: undefined, + token: Coin.fromPartial({}), sender: "", receiver: "", timeoutHeight: Height.fromPartial({}), @@ -118,6 +178,16 @@ function createBaseMsgTransfer(): MsgTransfer { } export const MsgTransfer = { typeUrl: "/ibc.applications.transfer.v1.MsgTransfer", + aminoType: "cosmos-sdk/MsgTransfer", + is(o: any): o is MsgTransfer { + return o && (o.$typeUrl === MsgTransfer.typeUrl || typeof o.sourcePort === "string" && typeof o.sourceChannel === "string" && Coin.is(o.token) && typeof o.sender === "string" && typeof o.receiver === "string" && Height.is(o.timeoutHeight) && typeof o.timeoutTimestamp === "bigint" && typeof o.memo === "string"); + }, + isSDK(o: any): o is MsgTransferSDKType { + return o && (o.$typeUrl === MsgTransfer.typeUrl || typeof o.source_port === "string" && typeof o.source_channel === "string" && Coin.isSDK(o.token) && typeof o.sender === "string" && typeof o.receiver === "string" && Height.isSDK(o.timeout_height) && typeof o.timeout_timestamp === "bigint" && typeof o.memo === "string"); + }, + isAmino(o: any): o is MsgTransferAmino { + return o && (o.$typeUrl === MsgTransfer.typeUrl || typeof o.source_port === "string" && typeof o.source_channel === "string" && Coin.isAmino(o.token) && typeof o.sender === "string" && typeof o.receiver === "string" && Height.isAmino(o.timeout_height) && typeof o.timeout_timestamp === "bigint" && typeof o.memo === "string"); + }, encode(message: MsgTransfer, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.sourcePort !== "") { writer.uint32(10).string(message.sourcePort); @@ -183,6 +253,30 @@ export const MsgTransfer = { } return message; }, + fromJSON(object: any): MsgTransfer { + return { + sourcePort: isSet(object.sourcePort) ? String(object.sourcePort) : "", + sourceChannel: isSet(object.sourceChannel) ? String(object.sourceChannel) : "", + token: isSet(object.token) ? Coin.fromJSON(object.token) : undefined, + sender: isSet(object.sender) ? String(object.sender) : "", + receiver: isSet(object.receiver) ? String(object.receiver) : "", + timeoutHeight: isSet(object.timeoutHeight) ? Height.fromJSON(object.timeoutHeight) : undefined, + timeoutTimestamp: isSet(object.timeoutTimestamp) ? BigInt(object.timeoutTimestamp.toString()) : BigInt(0), + memo: isSet(object.memo) ? String(object.memo) : "" + }; + }, + toJSON(message: MsgTransfer): unknown { + const obj: any = {}; + message.sourcePort !== undefined && (obj.sourcePort = message.sourcePort); + message.sourceChannel !== undefined && (obj.sourceChannel = message.sourceChannel); + message.token !== undefined && (obj.token = message.token ? Coin.toJSON(message.token) : undefined); + message.sender !== undefined && (obj.sender = message.sender); + message.receiver !== undefined && (obj.receiver = message.receiver); + message.timeoutHeight !== undefined && (obj.timeoutHeight = message.timeoutHeight ? Height.toJSON(message.timeoutHeight) : undefined); + message.timeoutTimestamp !== undefined && (obj.timeoutTimestamp = (message.timeoutTimestamp || BigInt(0)).toString()); + message.memo !== undefined && (obj.memo = message.memo); + return obj; + }, fromPartial(object: Partial): MsgTransfer { const message = createBaseMsgTransfer(); message.sourcePort = object.sourcePort ?? ""; @@ -196,22 +290,38 @@ export const MsgTransfer = { return message; }, fromAmino(object: MsgTransferAmino): MsgTransfer { - return { - sourcePort: object.source_port, - sourceChannel: object.source_channel, - token: object?.token ? Coin.fromAmino(object.token) : undefined, - sender: object.sender, - receiver: object.receiver, - timeoutHeight: object?.timeout_height ? Height.fromAmino(object.timeout_height) : undefined, - timeoutTimestamp: BigInt(object.timeout_timestamp), - memo: object.memo - }; + const message = createBaseMsgTransfer(); + if (object.source_port !== undefined && object.source_port !== null) { + message.sourcePort = object.source_port; + } + if (object.source_channel !== undefined && object.source_channel !== null) { + message.sourceChannel = object.source_channel; + } + if (object.token !== undefined && object.token !== null) { + message.token = Coin.fromAmino(object.token); + } + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + if (object.receiver !== undefined && object.receiver !== null) { + message.receiver = object.receiver; + } + if (object.timeout_height !== undefined && object.timeout_height !== null) { + message.timeoutHeight = Height.fromAmino(object.timeout_height); + } + if (object.timeout_timestamp !== undefined && object.timeout_timestamp !== null) { + message.timeoutTimestamp = BigInt(object.timeout_timestamp); + } + if (object.memo !== undefined && object.memo !== null) { + message.memo = object.memo; + } + return message; }, toAmino(message: MsgTransfer): MsgTransferAmino { const obj: any = {}; obj.source_port = message.sourcePort; obj.source_channel = message.sourceChannel; - obj.token = message.token ? Coin.toAmino(message.token) : undefined; + obj.token = message.token ? Coin.toAmino(message.token) : Coin.fromPartial({}); obj.sender = message.sender; obj.receiver = message.receiver; obj.timeout_height = message.timeoutHeight ? Height.toAmino(message.timeoutHeight) : {}; @@ -241,6 +351,8 @@ export const MsgTransfer = { }; } }; +GlobalDecoderRegistry.register(MsgTransfer.typeUrl, MsgTransfer); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgTransfer.aminoType, MsgTransfer.typeUrl); function createBaseMsgTransferResponse(): MsgTransferResponse { return { sequence: BigInt(0) @@ -248,6 +360,16 @@ function createBaseMsgTransferResponse(): MsgTransferResponse { } export const MsgTransferResponse = { typeUrl: "/ibc.applications.transfer.v1.MsgTransferResponse", + aminoType: "cosmos-sdk/MsgTransferResponse", + is(o: any): o is MsgTransferResponse { + return o && (o.$typeUrl === MsgTransferResponse.typeUrl || typeof o.sequence === "bigint"); + }, + isSDK(o: any): o is MsgTransferResponseSDKType { + return o && (o.$typeUrl === MsgTransferResponse.typeUrl || typeof o.sequence === "bigint"); + }, + isAmino(o: any): o is MsgTransferResponseAmino { + return o && (o.$typeUrl === MsgTransferResponse.typeUrl || typeof o.sequence === "bigint"); + }, encode(message: MsgTransferResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.sequence !== BigInt(0)) { writer.uint32(8).uint64(message.sequence); @@ -271,15 +393,27 @@ export const MsgTransferResponse = { } return message; }, + fromJSON(object: any): MsgTransferResponse { + return { + sequence: isSet(object.sequence) ? BigInt(object.sequence.toString()) : BigInt(0) + }; + }, + toJSON(message: MsgTransferResponse): unknown { + const obj: any = {}; + message.sequence !== undefined && (obj.sequence = (message.sequence || BigInt(0)).toString()); + return obj; + }, fromPartial(object: Partial): MsgTransferResponse { const message = createBaseMsgTransferResponse(); message.sequence = object.sequence !== undefined && object.sequence !== null ? BigInt(object.sequence.toString()) : BigInt(0); return message; }, fromAmino(object: MsgTransferResponseAmino): MsgTransferResponse { - return { - sequence: BigInt(object.sequence) - }; + const message = createBaseMsgTransferResponse(); + if (object.sequence !== undefined && object.sequence !== null) { + message.sequence = BigInt(object.sequence); + } + return message; }, toAmino(message: MsgTransferResponse): MsgTransferResponseAmino { const obj: any = {}; @@ -307,4 +441,186 @@ export const MsgTransferResponse = { value: MsgTransferResponse.encode(message).finish() }; } -}; \ No newline at end of file +}; +GlobalDecoderRegistry.register(MsgTransferResponse.typeUrl, MsgTransferResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgTransferResponse.aminoType, MsgTransferResponse.typeUrl); +function createBaseMsgUpdateParams(): MsgUpdateParams { + return { + signer: "", + params: Params.fromPartial({}) + }; +} +export const MsgUpdateParams = { + typeUrl: "/ibc.applications.transfer.v1.MsgUpdateParams", + aminoType: "cosmos-sdk/MsgUpdateParams", + is(o: any): o is MsgUpdateParams { + return o && (o.$typeUrl === MsgUpdateParams.typeUrl || typeof o.signer === "string" && Params.is(o.params)); + }, + isSDK(o: any): o is MsgUpdateParamsSDKType { + return o && (o.$typeUrl === MsgUpdateParams.typeUrl || typeof o.signer === "string" && Params.isSDK(o.params)); + }, + isAmino(o: any): o is MsgUpdateParamsAmino { + return o && (o.$typeUrl === MsgUpdateParams.typeUrl || typeof o.signer === "string" && Params.isAmino(o.params)); + }, + encode(message: MsgUpdateParams, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.signer !== "") { + writer.uint32(10).string(message.signer); + } + if (message.params !== undefined) { + Params.encode(message.params, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgUpdateParams { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUpdateParams(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.signer = reader.string(); + break; + case 2: + message.params = Params.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): MsgUpdateParams { + return { + signer: isSet(object.signer) ? String(object.signer) : "", + params: isSet(object.params) ? Params.fromJSON(object.params) : undefined + }; + }, + toJSON(message: MsgUpdateParams): unknown { + const obj: any = {}; + message.signer !== undefined && (obj.signer = message.signer); + message.params !== undefined && (obj.params = message.params ? Params.toJSON(message.params) : undefined); + return obj; + }, + fromPartial(object: Partial): MsgUpdateParams { + const message = createBaseMsgUpdateParams(); + message.signer = object.signer ?? ""; + message.params = object.params !== undefined && object.params !== null ? Params.fromPartial(object.params) : undefined; + return message; + }, + fromAmino(object: MsgUpdateParamsAmino): MsgUpdateParams { + const message = createBaseMsgUpdateParams(); + if (object.signer !== undefined && object.signer !== null) { + message.signer = object.signer; + } + if (object.params !== undefined && object.params !== null) { + message.params = Params.fromAmino(object.params); + } + return message; + }, + toAmino(message: MsgUpdateParams): MsgUpdateParamsAmino { + const obj: any = {}; + obj.signer = message.signer; + obj.params = message.params ? Params.toAmino(message.params) : undefined; + return obj; + }, + fromAminoMsg(object: MsgUpdateParamsAminoMsg): MsgUpdateParams { + return MsgUpdateParams.fromAmino(object.value); + }, + toAminoMsg(message: MsgUpdateParams): MsgUpdateParamsAminoMsg { + return { + type: "cosmos-sdk/MsgUpdateParams", + value: MsgUpdateParams.toAmino(message) + }; + }, + fromProtoMsg(message: MsgUpdateParamsProtoMsg): MsgUpdateParams { + return MsgUpdateParams.decode(message.value); + }, + toProto(message: MsgUpdateParams): Uint8Array { + return MsgUpdateParams.encode(message).finish(); + }, + toProtoMsg(message: MsgUpdateParams): MsgUpdateParamsProtoMsg { + return { + typeUrl: "/ibc.applications.transfer.v1.MsgUpdateParams", + value: MsgUpdateParams.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgUpdateParams.typeUrl, MsgUpdateParams); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgUpdateParams.aminoType, MsgUpdateParams.typeUrl); +function createBaseMsgUpdateParamsResponse(): MsgUpdateParamsResponse { + return {}; +} +export const MsgUpdateParamsResponse = { + typeUrl: "/ibc.applications.transfer.v1.MsgUpdateParamsResponse", + aminoType: "cosmos-sdk/MsgUpdateParamsResponse", + is(o: any): o is MsgUpdateParamsResponse { + return o && o.$typeUrl === MsgUpdateParamsResponse.typeUrl; + }, + isSDK(o: any): o is MsgUpdateParamsResponseSDKType { + return o && o.$typeUrl === MsgUpdateParamsResponse.typeUrl; + }, + isAmino(o: any): o is MsgUpdateParamsResponseAmino { + return o && o.$typeUrl === MsgUpdateParamsResponse.typeUrl; + }, + encode(_: MsgUpdateParamsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgUpdateParamsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUpdateParamsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(_: any): MsgUpdateParamsResponse { + return {}; + }, + toJSON(_: MsgUpdateParamsResponse): unknown { + const obj: any = {}; + return obj; + }, + fromPartial(_: Partial): MsgUpdateParamsResponse { + const message = createBaseMsgUpdateParamsResponse(); + return message; + }, + fromAmino(_: MsgUpdateParamsResponseAmino): MsgUpdateParamsResponse { + const message = createBaseMsgUpdateParamsResponse(); + return message; + }, + toAmino(_: MsgUpdateParamsResponse): MsgUpdateParamsResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgUpdateParamsResponseAminoMsg): MsgUpdateParamsResponse { + return MsgUpdateParamsResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgUpdateParamsResponse): MsgUpdateParamsResponseAminoMsg { + return { + type: "cosmos-sdk/MsgUpdateParamsResponse", + value: MsgUpdateParamsResponse.toAmino(message) + }; + }, + fromProtoMsg(message: MsgUpdateParamsResponseProtoMsg): MsgUpdateParamsResponse { + return MsgUpdateParamsResponse.decode(message.value); + }, + toProto(message: MsgUpdateParamsResponse): Uint8Array { + return MsgUpdateParamsResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgUpdateParamsResponse): MsgUpdateParamsResponseProtoMsg { + return { + typeUrl: "/ibc.applications.transfer.v1.MsgUpdateParamsResponse", + value: MsgUpdateParamsResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgUpdateParamsResponse.typeUrl, MsgUpdateParamsResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgUpdateParamsResponse.aminoType, MsgUpdateParamsResponse.typeUrl); \ No newline at end of file diff --git a/packages/osmojs/src/codegen/ibc/applications/transfer/v2/packet.ts b/packages/osmojs/src/codegen/ibc/applications/transfer/v2/packet.ts index a056a5f1d..0ed803605 100644 --- a/packages/osmojs/src/codegen/ibc/applications/transfer/v2/packet.ts +++ b/packages/osmojs/src/codegen/ibc/applications/transfer/v2/packet.ts @@ -1,4 +1,6 @@ import { BinaryReader, BinaryWriter } from "../../../../binary"; +import { isSet } from "../../../../helpers"; +import { GlobalDecoderRegistry } from "../../../../registry"; /** * FungibleTokenPacketData defines a struct for the packet payload * See FungibleTokenPacketData spec: @@ -27,15 +29,15 @@ export interface FungibleTokenPacketDataProtoMsg { */ export interface FungibleTokenPacketDataAmino { /** the token denomination to be transferred */ - denom: string; + denom?: string; /** the token amount to be transferred */ - amount: string; + amount?: string; /** the sender address */ - sender: string; + sender?: string; /** the recipient address on the destination chain */ - receiver: string; + receiver?: string; /** optional memo */ - memo: string; + memo?: string; } export interface FungibleTokenPacketDataAminoMsg { type: "cosmos-sdk/FungibleTokenPacketData"; @@ -64,6 +66,16 @@ function createBaseFungibleTokenPacketData(): FungibleTokenPacketData { } export const FungibleTokenPacketData = { typeUrl: "/ibc.applications.transfer.v2.FungibleTokenPacketData", + aminoType: "cosmos-sdk/FungibleTokenPacketData", + is(o: any): o is FungibleTokenPacketData { + return o && (o.$typeUrl === FungibleTokenPacketData.typeUrl || typeof o.denom === "string" && typeof o.amount === "string" && typeof o.sender === "string" && typeof o.receiver === "string" && typeof o.memo === "string"); + }, + isSDK(o: any): o is FungibleTokenPacketDataSDKType { + return o && (o.$typeUrl === FungibleTokenPacketData.typeUrl || typeof o.denom === "string" && typeof o.amount === "string" && typeof o.sender === "string" && typeof o.receiver === "string" && typeof o.memo === "string"); + }, + isAmino(o: any): o is FungibleTokenPacketDataAmino { + return o && (o.$typeUrl === FungibleTokenPacketData.typeUrl || typeof o.denom === "string" && typeof o.amount === "string" && typeof o.sender === "string" && typeof o.receiver === "string" && typeof o.memo === "string"); + }, encode(message: FungibleTokenPacketData, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.denom !== "") { writer.uint32(10).string(message.denom); @@ -111,6 +123,24 @@ export const FungibleTokenPacketData = { } return message; }, + fromJSON(object: any): FungibleTokenPacketData { + return { + denom: isSet(object.denom) ? String(object.denom) : "", + amount: isSet(object.amount) ? String(object.amount) : "", + sender: isSet(object.sender) ? String(object.sender) : "", + receiver: isSet(object.receiver) ? String(object.receiver) : "", + memo: isSet(object.memo) ? String(object.memo) : "" + }; + }, + toJSON(message: FungibleTokenPacketData): unknown { + const obj: any = {}; + message.denom !== undefined && (obj.denom = message.denom); + message.amount !== undefined && (obj.amount = message.amount); + message.sender !== undefined && (obj.sender = message.sender); + message.receiver !== undefined && (obj.receiver = message.receiver); + message.memo !== undefined && (obj.memo = message.memo); + return obj; + }, fromPartial(object: Partial): FungibleTokenPacketData { const message = createBaseFungibleTokenPacketData(); message.denom = object.denom ?? ""; @@ -121,13 +151,23 @@ export const FungibleTokenPacketData = { return message; }, fromAmino(object: FungibleTokenPacketDataAmino): FungibleTokenPacketData { - return { - denom: object.denom, - amount: object.amount, - sender: object.sender, - receiver: object.receiver, - memo: object.memo - }; + const message = createBaseFungibleTokenPacketData(); + if (object.denom !== undefined && object.denom !== null) { + message.denom = object.denom; + } + if (object.amount !== undefined && object.amount !== null) { + message.amount = object.amount; + } + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + if (object.receiver !== undefined && object.receiver !== null) { + message.receiver = object.receiver; + } + if (object.memo !== undefined && object.memo !== null) { + message.memo = object.memo; + } + return message; }, toAmino(message: FungibleTokenPacketData): FungibleTokenPacketDataAmino { const obj: any = {}; @@ -159,4 +199,6 @@ export const FungibleTokenPacketData = { value: FungibleTokenPacketData.encode(message).finish() }; } -}; \ No newline at end of file +}; +GlobalDecoderRegistry.register(FungibleTokenPacketData.typeUrl, FungibleTokenPacketData); +GlobalDecoderRegistry.registerAminoProtoMapping(FungibleTokenPacketData.aminoType, FungibleTokenPacketData.typeUrl); \ No newline at end of file diff --git a/packages/osmojs/src/codegen/ibc/bundle.ts b/packages/osmojs/src/codegen/ibc/bundle.ts index a4fb5c624..255e79662 100644 --- a/packages/osmojs/src/codegen/ibc/bundle.ts +++ b/packages/osmojs/src/codegen/ibc/bundle.ts @@ -1,212 +1,244 @@ -import * as _44 from "./applications/fee/v1/ack"; -import * as _45 from "./applications/fee/v1/fee"; -import * as _46 from "./applications/fee/v1/genesis"; -import * as _47 from "./applications/fee/v1/metadata"; -import * as _48 from "./applications/fee/v1/query"; -import * as _49 from "./applications/fee/v1/tx"; -import * as _50 from "./applications/interchain_accounts/controller/v1/controller"; -import * as _51 from "./applications/interchain_accounts/controller/v1/query"; -import * as _52 from "./applications/interchain_accounts/controller/v1/tx"; -import * as _53 from "./applications/interchain_accounts/genesis/v1/genesis"; -import * as _54 from "./applications/interchain_accounts/host/v1/host"; -import * as _55 from "./applications/interchain_accounts/host/v1/query"; -import * as _56 from "./applications/interchain_accounts/v1/account"; -import * as _57 from "./applications/interchain_accounts/v1/metadata"; -import * as _58 from "./applications/interchain_accounts/v1/packet"; -import * as _59 from "./applications/transfer/v1/authz"; -import * as _60 from "./applications/transfer/v1/genesis"; -import * as _61 from "./applications/transfer/v1/query"; -import * as _62 from "./applications/transfer/v1/transfer"; -import * as _63 from "./applications/transfer/v1/tx"; -import * as _64 from "./applications/transfer/v2/packet"; -import * as _65 from "./core/channel/v1/channel"; -import * as _66 from "./core/channel/v1/genesis"; -import * as _67 from "./core/channel/v1/query"; -import * as _68 from "./core/channel/v1/tx"; -import * as _69 from "./core/client/v1/client"; -import * as _70 from "./core/client/v1/genesis"; -import * as _71 from "./core/client/v1/query"; -import * as _72 from "./core/client/v1/tx"; -import * as _73 from "./core/commitment/v1/commitment"; -import * as _74 from "./core/connection/v1/connection"; -import * as _75 from "./core/connection/v1/genesis"; -import * as _76 from "./core/connection/v1/query"; -import * as _77 from "./core/connection/v1/tx"; -import * as _78 from "./lightclients/localhost/v2/localhost"; -import * as _79 from "./lightclients/solomachine/v2/solomachine"; -import * as _80 from "./lightclients/solomachine/v3/solomachine"; -import * as _81 from "./lightclients/tendermint/v1/tendermint"; -import * as _223 from "./applications/fee/v1/tx.amino"; -import * as _224 from "./applications/interchain_accounts/controller/v1/tx.amino"; -import * as _225 from "./applications/transfer/v1/tx.amino"; -import * as _226 from "./core/channel/v1/tx.amino"; -import * as _227 from "./core/client/v1/tx.amino"; -import * as _228 from "./core/connection/v1/tx.amino"; -import * as _229 from "./applications/fee/v1/tx.registry"; -import * as _230 from "./applications/interchain_accounts/controller/v1/tx.registry"; -import * as _231 from "./applications/transfer/v1/tx.registry"; -import * as _232 from "./core/channel/v1/tx.registry"; -import * as _233 from "./core/client/v1/tx.registry"; -import * as _234 from "./core/connection/v1/tx.registry"; -import * as _235 from "./applications/fee/v1/query.lcd"; -import * as _236 from "./applications/interchain_accounts/controller/v1/query.lcd"; -import * as _237 from "./applications/interchain_accounts/host/v1/query.lcd"; -import * as _238 from "./applications/transfer/v1/query.lcd"; -import * as _239 from "./core/channel/v1/query.lcd"; -import * as _240 from "./core/client/v1/query.lcd"; -import * as _241 from "./core/connection/v1/query.lcd"; -import * as _242 from "./applications/fee/v1/query.rpc.Query"; -import * as _243 from "./applications/interchain_accounts/controller/v1/query.rpc.Query"; -import * as _244 from "./applications/interchain_accounts/host/v1/query.rpc.Query"; -import * as _245 from "./applications/transfer/v1/query.rpc.Query"; -import * as _246 from "./core/channel/v1/query.rpc.Query"; -import * as _247 from "./core/client/v1/query.rpc.Query"; -import * as _248 from "./core/connection/v1/query.rpc.Query"; -import * as _249 from "./applications/fee/v1/tx.rpc.msg"; -import * as _250 from "./applications/interchain_accounts/controller/v1/tx.rpc.msg"; -import * as _251 from "./applications/transfer/v1/tx.rpc.msg"; -import * as _252 from "./core/channel/v1/tx.rpc.msg"; -import * as _253 from "./core/client/v1/tx.rpc.msg"; -import * as _254 from "./core/connection/v1/tx.rpc.msg"; -import * as _335 from "./lcd"; -import * as _336 from "./rpc.query"; -import * as _337 from "./rpc.tx"; +import * as _88 from "./applications/fee/v1/ack"; +import * as _89 from "./applications/fee/v1/fee"; +import * as _90 from "./applications/fee/v1/genesis"; +import * as _91 from "./applications/fee/v1/metadata"; +import * as _92 from "./applications/fee/v1/query"; +import * as _93 from "./applications/fee/v1/tx"; +import * as _94 from "./applications/interchain_accounts/controller/v1/controller"; +import * as _95 from "./applications/interchain_accounts/controller/v1/query"; +import * as _96 from "./applications/interchain_accounts/controller/v1/tx"; +import * as _97 from "./applications/interchain_accounts/genesis/v1/genesis"; +import * as _98 from "./applications/interchain_accounts/host/v1/host"; +import * as _99 from "./applications/interchain_accounts/host/v1/query"; +import * as _100 from "./applications/interchain_accounts/host/v1/tx"; +import * as _101 from "./applications/interchain_accounts/v1/account"; +import * as _102 from "./applications/interchain_accounts/v1/metadata"; +import * as _103 from "./applications/interchain_accounts/v1/packet"; +import * as _104 from "./applications/transfer/v1/authz"; +import * as _105 from "./applications/transfer/v1/genesis"; +import * as _106 from "./applications/transfer/v1/query"; +import * as _107 from "./applications/transfer/v1/transfer"; +import * as _108 from "./applications/transfer/v1/tx"; +import * as _109 from "./applications/transfer/v2/packet"; +import * as _110 from "./core/channel/v1/channel"; +import * as _111 from "./core/channel/v1/genesis"; +import * as _112 from "./core/channel/v1/query"; +import * as _113 from "./core/channel/v1/tx"; +import * as _114 from "./core/channel/v1/upgrade"; +import * as _115 from "./core/client/v1/client"; +import * as _116 from "./core/client/v1/genesis"; +import * as _117 from "./core/client/v1/query"; +import * as _118 from "./core/client/v1/tx"; +import * as _119 from "./core/commitment/v1/commitment"; +import * as _120 from "./core/connection/v1/connection"; +import * as _121 from "./core/connection/v1/genesis"; +import * as _122 from "./core/connection/v1/query"; +import * as _123 from "./core/connection/v1/tx"; +import * as _124 from "./lightclients/localhost/v2/localhost"; +import * as _125 from "./lightclients/solomachine/v2/solomachine"; +import * as _126 from "./lightclients/solomachine/v3/solomachine"; +import * as _127 from "./lightclients/tendermint/v1/tendermint"; +import * as _128 from "./lightclients/wasm/v1/genesis"; +import * as _129 from "./lightclients/wasm/v1/query"; +import * as _130 from "./lightclients/wasm/v1/tx"; +import * as _131 from "./lightclients/wasm/v1/wasm"; +import * as _284 from "./applications/fee/v1/tx.amino"; +import * as _285 from "./applications/interchain_accounts/controller/v1/tx.amino"; +import * as _286 from "./applications/interchain_accounts/host/v1/tx.amino"; +import * as _287 from "./applications/transfer/v1/tx.amino"; +import * as _288 from "./core/channel/v1/tx.amino"; +import * as _289 from "./core/client/v1/tx.amino"; +import * as _290 from "./core/connection/v1/tx.amino"; +import * as _291 from "./lightclients/wasm/v1/tx.amino"; +import * as _292 from "./applications/fee/v1/tx.registry"; +import * as _293 from "./applications/interchain_accounts/controller/v1/tx.registry"; +import * as _294 from "./applications/interchain_accounts/host/v1/tx.registry"; +import * as _295 from "./applications/transfer/v1/tx.registry"; +import * as _296 from "./core/channel/v1/tx.registry"; +import * as _297 from "./core/client/v1/tx.registry"; +import * as _298 from "./core/connection/v1/tx.registry"; +import * as _299 from "./lightclients/wasm/v1/tx.registry"; +import * as _300 from "./applications/fee/v1/query.lcd"; +import * as _301 from "./applications/interchain_accounts/controller/v1/query.lcd"; +import * as _302 from "./applications/interchain_accounts/host/v1/query.lcd"; +import * as _303 from "./applications/transfer/v1/query.lcd"; +import * as _304 from "./core/channel/v1/query.lcd"; +import * as _305 from "./core/client/v1/query.lcd"; +import * as _306 from "./core/connection/v1/query.lcd"; +import * as _307 from "./lightclients/wasm/v1/query.lcd"; +import * as _308 from "./applications/fee/v1/query.rpc.Query"; +import * as _309 from "./applications/interchain_accounts/controller/v1/query.rpc.Query"; +import * as _310 from "./applications/interchain_accounts/host/v1/query.rpc.Query"; +import * as _311 from "./applications/transfer/v1/query.rpc.Query"; +import * as _312 from "./core/channel/v1/query.rpc.Query"; +import * as _313 from "./core/client/v1/query.rpc.Query"; +import * as _314 from "./core/connection/v1/query.rpc.Query"; +import * as _315 from "./lightclients/wasm/v1/query.rpc.Query"; +import * as _316 from "./applications/fee/v1/tx.rpc.msg"; +import * as _317 from "./applications/interchain_accounts/controller/v1/tx.rpc.msg"; +import * as _318 from "./applications/interchain_accounts/host/v1/tx.rpc.msg"; +import * as _319 from "./applications/transfer/v1/tx.rpc.msg"; +import * as _320 from "./core/channel/v1/tx.rpc.msg"; +import * as _321 from "./core/client/v1/tx.rpc.msg"; +import * as _322 from "./core/connection/v1/tx.rpc.msg"; +import * as _323 from "./lightclients/wasm/v1/tx.rpc.msg"; +import * as _409 from "./lcd"; +import * as _410 from "./rpc.query"; +import * as _411 from "./rpc.tx"; export namespace ibc { export namespace applications { export namespace fee { export const v1 = { - ..._44, - ..._45, - ..._46, - ..._47, - ..._48, - ..._49, - ..._223, - ..._229, - ..._235, - ..._242, - ..._249 + ..._88, + ..._89, + ..._90, + ..._91, + ..._92, + ..._93, + ..._284, + ..._292, + ..._300, + ..._308, + ..._316 }; } export namespace interchain_accounts { export namespace controller { export const v1 = { - ..._50, - ..._51, - ..._52, - ..._224, - ..._230, - ..._236, - ..._243, - ..._250 + ..._94, + ..._95, + ..._96, + ..._285, + ..._293, + ..._301, + ..._309, + ..._317 }; } export namespace genesis { export const v1 = { - ..._53 + ..._97 }; } export namespace host { export const v1 = { - ..._54, - ..._55, - ..._237, - ..._244 + ..._98, + ..._99, + ..._100, + ..._286, + ..._294, + ..._302, + ..._310, + ..._318 }; } export const v1 = { - ..._56, - ..._57, - ..._58 + ..._101, + ..._102, + ..._103 }; } export namespace transfer { export const v1 = { - ..._59, - ..._60, - ..._61, - ..._62, - ..._63, - ..._225, - ..._231, - ..._238, - ..._245, - ..._251 + ..._104, + ..._105, + ..._106, + ..._107, + ..._108, + ..._287, + ..._295, + ..._303, + ..._311, + ..._319 }; export const v2 = { - ..._64 + ..._109 }; } } export namespace core { export namespace channel { export const v1 = { - ..._65, - ..._66, - ..._67, - ..._68, - ..._226, - ..._232, - ..._239, - ..._246, - ..._252 + ..._110, + ..._111, + ..._112, + ..._113, + ..._114, + ..._288, + ..._296, + ..._304, + ..._312, + ..._320 }; } export namespace client { export const v1 = { - ..._69, - ..._70, - ..._71, - ..._72, - ..._227, - ..._233, - ..._240, - ..._247, - ..._253 + ..._115, + ..._116, + ..._117, + ..._118, + ..._289, + ..._297, + ..._305, + ..._313, + ..._321 }; } export namespace commitment { export const v1 = { - ..._73 + ..._119 }; } export namespace connection { export const v1 = { - ..._74, - ..._75, - ..._76, - ..._77, - ..._228, - ..._234, - ..._241, - ..._248, - ..._254 + ..._120, + ..._121, + ..._122, + ..._123, + ..._290, + ..._298, + ..._306, + ..._314, + ..._322 }; } } export namespace lightclients { export namespace localhost { export const v2 = { - ..._78 + ..._124 }; } export namespace solomachine { export const v2 = { - ..._79 + ..._125 }; export const v3 = { - ..._80 + ..._126 }; } export namespace tendermint { export const v1 = { - ..._81 + ..._127 + }; + } + export namespace wasm { + export const v1 = { + ..._128, + ..._129, + ..._130, + ..._131, + ..._291, + ..._299, + ..._307, + ..._315, + ..._323 }; } } export const ClientFactory = { - ..._335, - ..._336, - ..._337 + ..._409, + ..._410, + ..._411 }; } \ No newline at end of file diff --git a/packages/osmojs/src/codegen/ibc/client.ts b/packages/osmojs/src/codegen/ibc/client.ts index 434d025d9..5b1c2f68a 100644 --- a/packages/osmojs/src/codegen/ibc/client.ts +++ b/packages/osmojs/src/codegen/ibc/client.ts @@ -3,25 +3,31 @@ import { defaultRegistryTypes, AminoTypes, SigningStargateClient } from "@cosmjs import { HttpEndpoint } from "@cosmjs/tendermint-rpc"; import * as ibcApplicationsFeeV1TxRegistry from "./applications/fee/v1/tx.registry"; import * as ibcApplicationsInterchainAccountsControllerV1TxRegistry from "./applications/interchain_accounts/controller/v1/tx.registry"; +import * as ibcApplicationsInterchainAccountsHostV1TxRegistry from "./applications/interchain_accounts/host/v1/tx.registry"; import * as ibcApplicationsTransferV1TxRegistry from "./applications/transfer/v1/tx.registry"; import * as ibcCoreChannelV1TxRegistry from "./core/channel/v1/tx.registry"; import * as ibcCoreClientV1TxRegistry from "./core/client/v1/tx.registry"; import * as ibcCoreConnectionV1TxRegistry from "./core/connection/v1/tx.registry"; +import * as ibcLightclientsWasmV1TxRegistry from "./lightclients/wasm/v1/tx.registry"; import * as ibcApplicationsFeeV1TxAmino from "./applications/fee/v1/tx.amino"; import * as ibcApplicationsInterchainAccountsControllerV1TxAmino from "./applications/interchain_accounts/controller/v1/tx.amino"; +import * as ibcApplicationsInterchainAccountsHostV1TxAmino from "./applications/interchain_accounts/host/v1/tx.amino"; import * as ibcApplicationsTransferV1TxAmino from "./applications/transfer/v1/tx.amino"; import * as ibcCoreChannelV1TxAmino from "./core/channel/v1/tx.amino"; import * as ibcCoreClientV1TxAmino from "./core/client/v1/tx.amino"; import * as ibcCoreConnectionV1TxAmino from "./core/connection/v1/tx.amino"; +import * as ibcLightclientsWasmV1TxAmino from "./lightclients/wasm/v1/tx.amino"; export const ibcAminoConverters = { ...ibcApplicationsFeeV1TxAmino.AminoConverter, ...ibcApplicationsInterchainAccountsControllerV1TxAmino.AminoConverter, + ...ibcApplicationsInterchainAccountsHostV1TxAmino.AminoConverter, ...ibcApplicationsTransferV1TxAmino.AminoConverter, ...ibcCoreChannelV1TxAmino.AminoConverter, ...ibcCoreClientV1TxAmino.AminoConverter, - ...ibcCoreConnectionV1TxAmino.AminoConverter + ...ibcCoreConnectionV1TxAmino.AminoConverter, + ...ibcLightclientsWasmV1TxAmino.AminoConverter }; -export const ibcProtoRegistry: ReadonlyArray<[string, GeneratedType]> = [...ibcApplicationsFeeV1TxRegistry.registry, ...ibcApplicationsInterchainAccountsControllerV1TxRegistry.registry, ...ibcApplicationsTransferV1TxRegistry.registry, ...ibcCoreChannelV1TxRegistry.registry, ...ibcCoreClientV1TxRegistry.registry, ...ibcCoreConnectionV1TxRegistry.registry]; +export const ibcProtoRegistry: ReadonlyArray<[string, GeneratedType]> = [...ibcApplicationsFeeV1TxRegistry.registry, ...ibcApplicationsInterchainAccountsControllerV1TxRegistry.registry, ...ibcApplicationsInterchainAccountsHostV1TxRegistry.registry, ...ibcApplicationsTransferV1TxRegistry.registry, ...ibcCoreChannelV1TxRegistry.registry, ...ibcCoreClientV1TxRegistry.registry, ...ibcCoreConnectionV1TxRegistry.registry, ...ibcLightclientsWasmV1TxRegistry.registry]; export const getSigningIbcClientOptions = ({ defaultTypes = defaultRegistryTypes }: { diff --git a/packages/osmojs/src/codegen/ibc/core/channel/v1/channel.ts b/packages/osmojs/src/codegen/ibc/core/channel/v1/channel.ts index cb4f9cded..6a197c917 100644 --- a/packages/osmojs/src/codegen/ibc/core/channel/v1/channel.ts +++ b/packages/osmojs/src/codegen/ibc/core/channel/v1/channel.ts @@ -1,9 +1,10 @@ import { Height, HeightAmino, HeightSDKType } from "../../client/v1/client"; +import { isSet, bytesFromBase64, base64FromBytes } from "../../../../helpers"; import { BinaryReader, BinaryWriter } from "../../../../binary"; -import { isSet } from "../../../../helpers"; +import { GlobalDecoderRegistry } from "../../../../registry"; /** * State defines if a channel is in one of the following states: - * CLOSED, INIT, TRYOPEN, OPEN or UNINITIALIZED. + * CLOSED, INIT, TRYOPEN, OPEN, FLUSHING, FLUSHCOMPLETE or UNINITIALIZED. */ export enum State { /** STATE_UNINITIALIZED_UNSPECIFIED - Default State */ @@ -22,6 +23,10 @@ export enum State { * packets. */ STATE_CLOSED = 4, + /** STATE_FLUSHING - A channel has just accepted the upgrade handshake attempt and is flushing in-flight packets. */ + STATE_FLUSHING = 5, + /** STATE_FLUSHCOMPLETE - A channel has just completed flushing any in-flight packets. */ + STATE_FLUSHCOMPLETE = 6, UNRECOGNIZED = -1, } export const StateSDKType = State; @@ -43,6 +48,12 @@ export function stateFromJSON(object: any): State { case 4: case "STATE_CLOSED": return State.STATE_CLOSED; + case 5: + case "STATE_FLUSHING": + return State.STATE_FLUSHING; + case 6: + case "STATE_FLUSHCOMPLETE": + return State.STATE_FLUSHCOMPLETE; case -1: case "UNRECOGNIZED": default: @@ -61,6 +72,10 @@ export function stateToJSON(object: State): string { return "STATE_OPEN"; case State.STATE_CLOSED: return "STATE_CLOSED"; + case State.STATE_FLUSHING: + return "STATE_FLUSHING"; + case State.STATE_FLUSHCOMPLETE: + return "STATE_FLUSHCOMPLETE"; case State.UNRECOGNIZED: default: return "UNRECOGNIZED"; @@ -130,6 +145,11 @@ export interface Channel { connectionHops: string[]; /** opaque channel version, which is agreed upon during the handshake */ version: string; + /** + * upgrade sequence indicates the latest upgrade attempt performed by this channel + * the value of 0 indicates the channel has never been upgraded + */ + upgradeSequence: bigint; } export interface ChannelProtoMsg { typeUrl: "/ibc.core.channel.v1.Channel"; @@ -142,18 +162,23 @@ export interface ChannelProtoMsg { */ export interface ChannelAmino { /** current state of the channel end */ - state: State; + state?: State; /** whether the channel is ordered or unordered */ - ordering: Order; + ordering?: Order; /** counterparty channel end */ counterparty?: CounterpartyAmino; /** * list of connection identifiers, in order, along which packets sent on * this channel will travel */ - connection_hops: string[]; + connection_hops?: string[]; /** opaque channel version, which is agreed upon during the handshake */ - version: string; + version?: string; + /** + * upgrade sequence indicates the latest upgrade attempt performed by this channel + * the value of 0 indicates the channel has never been upgraded + */ + upgrade_sequence?: string; } export interface ChannelAminoMsg { type: "cosmos-sdk/Channel"; @@ -170,6 +195,7 @@ export interface ChannelSDKType { counterparty: CounterpartySDKType; connection_hops: string[]; version: string; + upgrade_sequence: bigint; } /** * IdentifiedChannel defines a channel with additional port and channel @@ -193,6 +219,11 @@ export interface IdentifiedChannel { portId: string; /** channel identifier */ channelId: string; + /** + * upgrade sequence indicates the latest upgrade attempt performed by this channel + * the value of 0 indicates the channel has never been upgraded + */ + upgradeSequence: bigint; } export interface IdentifiedChannelProtoMsg { typeUrl: "/ibc.core.channel.v1.IdentifiedChannel"; @@ -204,22 +235,27 @@ export interface IdentifiedChannelProtoMsg { */ export interface IdentifiedChannelAmino { /** current state of the channel end */ - state: State; + state?: State; /** whether the channel is ordered or unordered */ - ordering: Order; + ordering?: Order; /** counterparty channel end */ counterparty?: CounterpartyAmino; /** * list of connection identifiers, in order, along which packets sent on * this channel will travel */ - connection_hops: string[]; + connection_hops?: string[]; /** opaque channel version, which is agreed upon during the handshake */ - version: string; + version?: string; /** port identifier */ - port_id: string; + port_id?: string; /** channel identifier */ - channel_id: string; + channel_id?: string; + /** + * upgrade sequence indicates the latest upgrade attempt performed by this channel + * the value of 0 indicates the channel has never been upgraded + */ + upgrade_sequence?: string; } export interface IdentifiedChannelAminoMsg { type: "cosmos-sdk/IdentifiedChannel"; @@ -237,6 +273,7 @@ export interface IdentifiedChannelSDKType { version: string; port_id: string; channel_id: string; + upgrade_sequence: bigint; } /** Counterparty defines a channel end counterparty */ export interface Counterparty { @@ -252,9 +289,9 @@ export interface CounterpartyProtoMsg { /** Counterparty defines a channel end counterparty */ export interface CounterpartyAmino { /** port on the counterparty chain which owns the other end of the channel. */ - port_id: string; + port_id?: string; /** channel end on the counterparty chain */ - channel_id: string; + channel_id?: string; } export interface CounterpartyAminoMsg { type: "cosmos-sdk/Counterparty"; @@ -299,21 +336,21 @@ export interface PacketAmino { * with an earlier sequence number must be sent and received before a Packet * with a later sequence number. */ - sequence: string; + sequence?: string; /** identifies the port on the sending chain. */ - source_port: string; + source_port?: string; /** identifies the channel end on the sending chain. */ - source_channel: string; + source_channel?: string; /** identifies the port on the receiving chain. */ - destination_port: string; + destination_port?: string; /** identifies the channel end on the receiving chain. */ - destination_channel: string; + destination_channel?: string; /** actual opaque bytes transferred directly to the application module */ - data: Uint8Array; + data?: string; /** block height after which the packet times out */ timeout_height?: HeightAmino; /** block timestamp (in nanoseconds) after which the packet times out */ - timeout_timestamp: string; + timeout_timestamp?: string; } export interface PacketAminoMsg { type: "cosmos-sdk/Packet"; @@ -358,13 +395,13 @@ export interface PacketStateProtoMsg { */ export interface PacketStateAmino { /** channel port identifier. */ - port_id: string; + port_id?: string; /** channel unique identifier. */ - channel_id: string; + channel_id?: string; /** packet sequence. */ - sequence: string; + sequence?: string; /** embedded data that represents packet state. */ - data: Uint8Array; + data?: string; } export interface PacketStateAminoMsg { type: "cosmos-sdk/PacketState"; @@ -383,7 +420,7 @@ export interface PacketStateSDKType { data: Uint8Array; } /** - * PacketId is an identifer for a unique Packet + * PacketId is an identifier for a unique Packet * Source chains refer to packets by source port/channel * Destination chains refer to packets by destination port/channel */ @@ -400,24 +437,24 @@ export interface PacketIdProtoMsg { value: Uint8Array; } /** - * PacketId is an identifer for a unique Packet + * PacketId is an identifier for a unique Packet * Source chains refer to packets by source port/channel * Destination chains refer to packets by destination port/channel */ export interface PacketIdAmino { /** channel port identifier */ - port_id: string; + port_id?: string; /** channel unique identifier */ - channel_id: string; + channel_id?: string; /** packet sequence */ - sequence: string; + sequence?: string; } export interface PacketIdAminoMsg { type: "cosmos-sdk/PacketId"; value: PacketIdAmino; } /** - * PacketId is an identifer for a unique Packet + * PacketId is an identifier for a unique Packet * Source chains refer to packets by source port/channel * Destination chains refer to packets by destination port/channel */ @@ -453,7 +490,7 @@ export interface AcknowledgementProtoMsg { * https://github.com/cosmos/ibc/tree/master/spec/core/ics-004-channel-and-packet-semantics#acknowledgement-envelope */ export interface AcknowledgementAmino { - result?: Uint8Array; + result?: string; error?: string; } export interface AcknowledgementAminoMsg { @@ -473,17 +510,89 @@ export interface AcknowledgementSDKType { result?: Uint8Array; error?: string; } +/** + * Timeout defines an execution deadline structure for 04-channel handlers. + * This includes packet lifecycle handlers as well as the upgrade handshake handlers. + * A valid Timeout contains either one or both of a timestamp and block height (sequence). + */ +export interface Timeout { + /** block height after which the packet or upgrade times out */ + height: Height; + /** block timestamp (in nanoseconds) after which the packet or upgrade times out */ + timestamp: bigint; +} +export interface TimeoutProtoMsg { + typeUrl: "/ibc.core.channel.v1.Timeout"; + value: Uint8Array; +} +/** + * Timeout defines an execution deadline structure for 04-channel handlers. + * This includes packet lifecycle handlers as well as the upgrade handshake handlers. + * A valid Timeout contains either one or both of a timestamp and block height (sequence). + */ +export interface TimeoutAmino { + /** block height after which the packet or upgrade times out */ + height?: HeightAmino; + /** block timestamp (in nanoseconds) after which the packet or upgrade times out */ + timestamp?: string; +} +export interface TimeoutAminoMsg { + type: "cosmos-sdk/Timeout"; + value: TimeoutAmino; +} +/** + * Timeout defines an execution deadline structure for 04-channel handlers. + * This includes packet lifecycle handlers as well as the upgrade handshake handlers. + * A valid Timeout contains either one or both of a timestamp and block height (sequence). + */ +export interface TimeoutSDKType { + height: HeightSDKType; + timestamp: bigint; +} +/** Params defines the set of IBC channel parameters. */ +export interface Params { + /** the relative timeout after which channel upgrades will time out. */ + upgradeTimeout: Timeout; +} +export interface ParamsProtoMsg { + typeUrl: "/ibc.core.channel.v1.Params"; + value: Uint8Array; +} +/** Params defines the set of IBC channel parameters. */ +export interface ParamsAmino { + /** the relative timeout after which channel upgrades will time out. */ + upgrade_timeout?: TimeoutAmino; +} +export interface ParamsAminoMsg { + type: "cosmos-sdk/Params"; + value: ParamsAmino; +} +/** Params defines the set of IBC channel parameters. */ +export interface ParamsSDKType { + upgrade_timeout: TimeoutSDKType; +} function createBaseChannel(): Channel { return { state: 0, ordering: 0, counterparty: Counterparty.fromPartial({}), connectionHops: [], - version: "" + version: "", + upgradeSequence: BigInt(0) }; } export const Channel = { typeUrl: "/ibc.core.channel.v1.Channel", + aminoType: "cosmos-sdk/Channel", + is(o: any): o is Channel { + return o && (o.$typeUrl === Channel.typeUrl || isSet(o.state) && isSet(o.ordering) && Counterparty.is(o.counterparty) && Array.isArray(o.connectionHops) && (!o.connectionHops.length || typeof o.connectionHops[0] === "string") && typeof o.version === "string" && typeof o.upgradeSequence === "bigint"); + }, + isSDK(o: any): o is ChannelSDKType { + return o && (o.$typeUrl === Channel.typeUrl || isSet(o.state) && isSet(o.ordering) && Counterparty.isSDK(o.counterparty) && Array.isArray(o.connection_hops) && (!o.connection_hops.length || typeof o.connection_hops[0] === "string") && typeof o.version === "string" && typeof o.upgrade_sequence === "bigint"); + }, + isAmino(o: any): o is ChannelAmino { + return o && (o.$typeUrl === Channel.typeUrl || isSet(o.state) && isSet(o.ordering) && Counterparty.isAmino(o.counterparty) && Array.isArray(o.connection_hops) && (!o.connection_hops.length || typeof o.connection_hops[0] === "string") && typeof o.version === "string" && typeof o.upgrade_sequence === "bigint"); + }, encode(message: Channel, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.state !== 0) { writer.uint32(8).int32(message.state); @@ -500,6 +609,9 @@ export const Channel = { if (message.version !== "") { writer.uint32(42).string(message.version); } + if (message.upgradeSequence !== BigInt(0)) { + writer.uint32(48).uint64(message.upgradeSequence); + } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): Channel { @@ -524,6 +636,9 @@ export const Channel = { case 5: message.version = reader.string(); break; + case 6: + message.upgradeSequence = reader.uint64(); + break; default: reader.skipType(tag & 7); break; @@ -531,6 +646,30 @@ export const Channel = { } return message; }, + fromJSON(object: any): Channel { + return { + state: isSet(object.state) ? stateFromJSON(object.state) : -1, + ordering: isSet(object.ordering) ? orderFromJSON(object.ordering) : -1, + counterparty: isSet(object.counterparty) ? Counterparty.fromJSON(object.counterparty) : undefined, + connectionHops: Array.isArray(object?.connectionHops) ? object.connectionHops.map((e: any) => String(e)) : [], + version: isSet(object.version) ? String(object.version) : "", + upgradeSequence: isSet(object.upgradeSequence) ? BigInt(object.upgradeSequence.toString()) : BigInt(0) + }; + }, + toJSON(message: Channel): unknown { + const obj: any = {}; + message.state !== undefined && (obj.state = stateToJSON(message.state)); + message.ordering !== undefined && (obj.ordering = orderToJSON(message.ordering)); + message.counterparty !== undefined && (obj.counterparty = message.counterparty ? Counterparty.toJSON(message.counterparty) : undefined); + if (message.connectionHops) { + obj.connectionHops = message.connectionHops.map(e => e); + } else { + obj.connectionHops = []; + } + message.version !== undefined && (obj.version = message.version); + message.upgradeSequence !== undefined && (obj.upgradeSequence = (message.upgradeSequence || BigInt(0)).toString()); + return obj; + }, fromPartial(object: Partial): Channel { const message = createBaseChannel(); message.state = object.state ?? 0; @@ -538,21 +677,33 @@ export const Channel = { message.counterparty = object.counterparty !== undefined && object.counterparty !== null ? Counterparty.fromPartial(object.counterparty) : undefined; message.connectionHops = object.connectionHops?.map(e => e) || []; message.version = object.version ?? ""; + message.upgradeSequence = object.upgradeSequence !== undefined && object.upgradeSequence !== null ? BigInt(object.upgradeSequence.toString()) : BigInt(0); return message; }, fromAmino(object: ChannelAmino): Channel { - return { - state: isSet(object.state) ? stateFromJSON(object.state) : -1, - ordering: isSet(object.ordering) ? orderFromJSON(object.ordering) : -1, - counterparty: object?.counterparty ? Counterparty.fromAmino(object.counterparty) : undefined, - connectionHops: Array.isArray(object?.connection_hops) ? object.connection_hops.map((e: any) => e) : [], - version: object.version - }; + const message = createBaseChannel(); + if (object.state !== undefined && object.state !== null) { + message.state = stateFromJSON(object.state); + } + if (object.ordering !== undefined && object.ordering !== null) { + message.ordering = orderFromJSON(object.ordering); + } + if (object.counterparty !== undefined && object.counterparty !== null) { + message.counterparty = Counterparty.fromAmino(object.counterparty); + } + message.connectionHops = object.connection_hops?.map(e => e) || []; + if (object.version !== undefined && object.version !== null) { + message.version = object.version; + } + if (object.upgrade_sequence !== undefined && object.upgrade_sequence !== null) { + message.upgradeSequence = BigInt(object.upgrade_sequence); + } + return message; }, toAmino(message: Channel): ChannelAmino { const obj: any = {}; - obj.state = message.state; - obj.ordering = message.ordering; + obj.state = stateToJSON(message.state); + obj.ordering = orderToJSON(message.ordering); obj.counterparty = message.counterparty ? Counterparty.toAmino(message.counterparty) : undefined; if (message.connectionHops) { obj.connection_hops = message.connectionHops.map(e => e); @@ -560,6 +711,7 @@ export const Channel = { obj.connection_hops = []; } obj.version = message.version; + obj.upgrade_sequence = message.upgradeSequence ? message.upgradeSequence.toString() : undefined; return obj; }, fromAminoMsg(object: ChannelAminoMsg): Channel { @@ -584,6 +736,8 @@ export const Channel = { }; } }; +GlobalDecoderRegistry.register(Channel.typeUrl, Channel); +GlobalDecoderRegistry.registerAminoProtoMapping(Channel.aminoType, Channel.typeUrl); function createBaseIdentifiedChannel(): IdentifiedChannel { return { state: 0, @@ -592,11 +746,22 @@ function createBaseIdentifiedChannel(): IdentifiedChannel { connectionHops: [], version: "", portId: "", - channelId: "" + channelId: "", + upgradeSequence: BigInt(0) }; } export const IdentifiedChannel = { typeUrl: "/ibc.core.channel.v1.IdentifiedChannel", + aminoType: "cosmos-sdk/IdentifiedChannel", + is(o: any): o is IdentifiedChannel { + return o && (o.$typeUrl === IdentifiedChannel.typeUrl || isSet(o.state) && isSet(o.ordering) && Counterparty.is(o.counterparty) && Array.isArray(o.connectionHops) && (!o.connectionHops.length || typeof o.connectionHops[0] === "string") && typeof o.version === "string" && typeof o.portId === "string" && typeof o.channelId === "string" && typeof o.upgradeSequence === "bigint"); + }, + isSDK(o: any): o is IdentifiedChannelSDKType { + return o && (o.$typeUrl === IdentifiedChannel.typeUrl || isSet(o.state) && isSet(o.ordering) && Counterparty.isSDK(o.counterparty) && Array.isArray(o.connection_hops) && (!o.connection_hops.length || typeof o.connection_hops[0] === "string") && typeof o.version === "string" && typeof o.port_id === "string" && typeof o.channel_id === "string" && typeof o.upgrade_sequence === "bigint"); + }, + isAmino(o: any): o is IdentifiedChannelAmino { + return o && (o.$typeUrl === IdentifiedChannel.typeUrl || isSet(o.state) && isSet(o.ordering) && Counterparty.isAmino(o.counterparty) && Array.isArray(o.connection_hops) && (!o.connection_hops.length || typeof o.connection_hops[0] === "string") && typeof o.version === "string" && typeof o.port_id === "string" && typeof o.channel_id === "string" && typeof o.upgrade_sequence === "bigint"); + }, encode(message: IdentifiedChannel, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.state !== 0) { writer.uint32(8).int32(message.state); @@ -619,6 +784,9 @@ export const IdentifiedChannel = { if (message.channelId !== "") { writer.uint32(58).string(message.channelId); } + if (message.upgradeSequence !== BigInt(0)) { + writer.uint32(64).uint64(message.upgradeSequence); + } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): IdentifiedChannel { @@ -649,6 +817,9 @@ export const IdentifiedChannel = { case 7: message.channelId = reader.string(); break; + case 8: + message.upgradeSequence = reader.uint64(); + break; default: reader.skipType(tag & 7); break; @@ -656,6 +827,34 @@ export const IdentifiedChannel = { } return message; }, + fromJSON(object: any): IdentifiedChannel { + return { + state: isSet(object.state) ? stateFromJSON(object.state) : -1, + ordering: isSet(object.ordering) ? orderFromJSON(object.ordering) : -1, + counterparty: isSet(object.counterparty) ? Counterparty.fromJSON(object.counterparty) : undefined, + connectionHops: Array.isArray(object?.connectionHops) ? object.connectionHops.map((e: any) => String(e)) : [], + version: isSet(object.version) ? String(object.version) : "", + portId: isSet(object.portId) ? String(object.portId) : "", + channelId: isSet(object.channelId) ? String(object.channelId) : "", + upgradeSequence: isSet(object.upgradeSequence) ? BigInt(object.upgradeSequence.toString()) : BigInt(0) + }; + }, + toJSON(message: IdentifiedChannel): unknown { + const obj: any = {}; + message.state !== undefined && (obj.state = stateToJSON(message.state)); + message.ordering !== undefined && (obj.ordering = orderToJSON(message.ordering)); + message.counterparty !== undefined && (obj.counterparty = message.counterparty ? Counterparty.toJSON(message.counterparty) : undefined); + if (message.connectionHops) { + obj.connectionHops = message.connectionHops.map(e => e); + } else { + obj.connectionHops = []; + } + message.version !== undefined && (obj.version = message.version); + message.portId !== undefined && (obj.portId = message.portId); + message.channelId !== undefined && (obj.channelId = message.channelId); + message.upgradeSequence !== undefined && (obj.upgradeSequence = (message.upgradeSequence || BigInt(0)).toString()); + return obj; + }, fromPartial(object: Partial): IdentifiedChannel { const message = createBaseIdentifiedChannel(); message.state = object.state ?? 0; @@ -665,23 +864,39 @@ export const IdentifiedChannel = { message.version = object.version ?? ""; message.portId = object.portId ?? ""; message.channelId = object.channelId ?? ""; + message.upgradeSequence = object.upgradeSequence !== undefined && object.upgradeSequence !== null ? BigInt(object.upgradeSequence.toString()) : BigInt(0); return message; }, fromAmino(object: IdentifiedChannelAmino): IdentifiedChannel { - return { - state: isSet(object.state) ? stateFromJSON(object.state) : -1, - ordering: isSet(object.ordering) ? orderFromJSON(object.ordering) : -1, - counterparty: object?.counterparty ? Counterparty.fromAmino(object.counterparty) : undefined, - connectionHops: Array.isArray(object?.connection_hops) ? object.connection_hops.map((e: any) => e) : [], - version: object.version, - portId: object.port_id, - channelId: object.channel_id - }; + const message = createBaseIdentifiedChannel(); + if (object.state !== undefined && object.state !== null) { + message.state = stateFromJSON(object.state); + } + if (object.ordering !== undefined && object.ordering !== null) { + message.ordering = orderFromJSON(object.ordering); + } + if (object.counterparty !== undefined && object.counterparty !== null) { + message.counterparty = Counterparty.fromAmino(object.counterparty); + } + message.connectionHops = object.connection_hops?.map(e => e) || []; + if (object.version !== undefined && object.version !== null) { + message.version = object.version; + } + if (object.port_id !== undefined && object.port_id !== null) { + message.portId = object.port_id; + } + if (object.channel_id !== undefined && object.channel_id !== null) { + message.channelId = object.channel_id; + } + if (object.upgrade_sequence !== undefined && object.upgrade_sequence !== null) { + message.upgradeSequence = BigInt(object.upgrade_sequence); + } + return message; }, toAmino(message: IdentifiedChannel): IdentifiedChannelAmino { const obj: any = {}; - obj.state = message.state; - obj.ordering = message.ordering; + obj.state = stateToJSON(message.state); + obj.ordering = orderToJSON(message.ordering); obj.counterparty = message.counterparty ? Counterparty.toAmino(message.counterparty) : undefined; if (message.connectionHops) { obj.connection_hops = message.connectionHops.map(e => e); @@ -691,6 +906,7 @@ export const IdentifiedChannel = { obj.version = message.version; obj.port_id = message.portId; obj.channel_id = message.channelId; + obj.upgrade_sequence = message.upgradeSequence ? message.upgradeSequence.toString() : undefined; return obj; }, fromAminoMsg(object: IdentifiedChannelAminoMsg): IdentifiedChannel { @@ -715,6 +931,8 @@ export const IdentifiedChannel = { }; } }; +GlobalDecoderRegistry.register(IdentifiedChannel.typeUrl, IdentifiedChannel); +GlobalDecoderRegistry.registerAminoProtoMapping(IdentifiedChannel.aminoType, IdentifiedChannel.typeUrl); function createBaseCounterparty(): Counterparty { return { portId: "", @@ -723,6 +941,16 @@ function createBaseCounterparty(): Counterparty { } export const Counterparty = { typeUrl: "/ibc.core.channel.v1.Counterparty", + aminoType: "cosmos-sdk/Counterparty", + is(o: any): o is Counterparty { + return o && (o.$typeUrl === Counterparty.typeUrl || typeof o.portId === "string" && typeof o.channelId === "string"); + }, + isSDK(o: any): o is CounterpartySDKType { + return o && (o.$typeUrl === Counterparty.typeUrl || typeof o.port_id === "string" && typeof o.channel_id === "string"); + }, + isAmino(o: any): o is CounterpartyAmino { + return o && (o.$typeUrl === Counterparty.typeUrl || typeof o.port_id === "string" && typeof o.channel_id === "string"); + }, encode(message: Counterparty, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.portId !== "") { writer.uint32(10).string(message.portId); @@ -752,6 +980,18 @@ export const Counterparty = { } return message; }, + fromJSON(object: any): Counterparty { + return { + portId: isSet(object.portId) ? String(object.portId) : "", + channelId: isSet(object.channelId) ? String(object.channelId) : "" + }; + }, + toJSON(message: Counterparty): unknown { + const obj: any = {}; + message.portId !== undefined && (obj.portId = message.portId); + message.channelId !== undefined && (obj.channelId = message.channelId); + return obj; + }, fromPartial(object: Partial): Counterparty { const message = createBaseCounterparty(); message.portId = object.portId ?? ""; @@ -759,10 +999,14 @@ export const Counterparty = { return message; }, fromAmino(object: CounterpartyAmino): Counterparty { - return { - portId: object.port_id, - channelId: object.channel_id - }; + const message = createBaseCounterparty(); + if (object.port_id !== undefined && object.port_id !== null) { + message.portId = object.port_id; + } + if (object.channel_id !== undefined && object.channel_id !== null) { + message.channelId = object.channel_id; + } + return message; }, toAmino(message: Counterparty): CounterpartyAmino { const obj: any = {}; @@ -792,6 +1036,8 @@ export const Counterparty = { }; } }; +GlobalDecoderRegistry.register(Counterparty.typeUrl, Counterparty); +GlobalDecoderRegistry.registerAminoProtoMapping(Counterparty.aminoType, Counterparty.typeUrl); function createBasePacket(): Packet { return { sequence: BigInt(0), @@ -806,6 +1052,16 @@ function createBasePacket(): Packet { } export const Packet = { typeUrl: "/ibc.core.channel.v1.Packet", + aminoType: "cosmos-sdk/Packet", + is(o: any): o is Packet { + return o && (o.$typeUrl === Packet.typeUrl || typeof o.sequence === "bigint" && typeof o.sourcePort === "string" && typeof o.sourceChannel === "string" && typeof o.destinationPort === "string" && typeof o.destinationChannel === "string" && (o.data instanceof Uint8Array || typeof o.data === "string") && Height.is(o.timeoutHeight) && typeof o.timeoutTimestamp === "bigint"); + }, + isSDK(o: any): o is PacketSDKType { + return o && (o.$typeUrl === Packet.typeUrl || typeof o.sequence === "bigint" && typeof o.source_port === "string" && typeof o.source_channel === "string" && typeof o.destination_port === "string" && typeof o.destination_channel === "string" && (o.data instanceof Uint8Array || typeof o.data === "string") && Height.isSDK(o.timeout_height) && typeof o.timeout_timestamp === "bigint"); + }, + isAmino(o: any): o is PacketAmino { + return o && (o.$typeUrl === Packet.typeUrl || typeof o.sequence === "bigint" && typeof o.source_port === "string" && typeof o.source_channel === "string" && typeof o.destination_port === "string" && typeof o.destination_channel === "string" && (o.data instanceof Uint8Array || typeof o.data === "string") && Height.isAmino(o.timeout_height) && typeof o.timeout_timestamp === "bigint"); + }, encode(message: Packet, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.sequence !== BigInt(0)) { writer.uint32(8).uint64(message.sequence); @@ -871,6 +1127,30 @@ export const Packet = { } return message; }, + fromJSON(object: any): Packet { + return { + sequence: isSet(object.sequence) ? BigInt(object.sequence.toString()) : BigInt(0), + sourcePort: isSet(object.sourcePort) ? String(object.sourcePort) : "", + sourceChannel: isSet(object.sourceChannel) ? String(object.sourceChannel) : "", + destinationPort: isSet(object.destinationPort) ? String(object.destinationPort) : "", + destinationChannel: isSet(object.destinationChannel) ? String(object.destinationChannel) : "", + data: isSet(object.data) ? bytesFromBase64(object.data) : new Uint8Array(), + timeoutHeight: isSet(object.timeoutHeight) ? Height.fromJSON(object.timeoutHeight) : undefined, + timeoutTimestamp: isSet(object.timeoutTimestamp) ? BigInt(object.timeoutTimestamp.toString()) : BigInt(0) + }; + }, + toJSON(message: Packet): unknown { + const obj: any = {}; + message.sequence !== undefined && (obj.sequence = (message.sequence || BigInt(0)).toString()); + message.sourcePort !== undefined && (obj.sourcePort = message.sourcePort); + message.sourceChannel !== undefined && (obj.sourceChannel = message.sourceChannel); + message.destinationPort !== undefined && (obj.destinationPort = message.destinationPort); + message.destinationChannel !== undefined && (obj.destinationChannel = message.destinationChannel); + message.data !== undefined && (obj.data = base64FromBytes(message.data !== undefined ? message.data : new Uint8Array())); + message.timeoutHeight !== undefined && (obj.timeoutHeight = message.timeoutHeight ? Height.toJSON(message.timeoutHeight) : undefined); + message.timeoutTimestamp !== undefined && (obj.timeoutTimestamp = (message.timeoutTimestamp || BigInt(0)).toString()); + return obj; + }, fromPartial(object: Partial): Packet { const message = createBasePacket(); message.sequence = object.sequence !== undefined && object.sequence !== null ? BigInt(object.sequence.toString()) : BigInt(0); @@ -884,16 +1164,32 @@ export const Packet = { return message; }, fromAmino(object: PacketAmino): Packet { - return { - sequence: BigInt(object.sequence), - sourcePort: object.source_port, - sourceChannel: object.source_channel, - destinationPort: object.destination_port, - destinationChannel: object.destination_channel, - data: object.data, - timeoutHeight: object?.timeout_height ? Height.fromAmino(object.timeout_height) : undefined, - timeoutTimestamp: BigInt(object.timeout_timestamp) - }; + const message = createBasePacket(); + if (object.sequence !== undefined && object.sequence !== null) { + message.sequence = BigInt(object.sequence); + } + if (object.source_port !== undefined && object.source_port !== null) { + message.sourcePort = object.source_port; + } + if (object.source_channel !== undefined && object.source_channel !== null) { + message.sourceChannel = object.source_channel; + } + if (object.destination_port !== undefined && object.destination_port !== null) { + message.destinationPort = object.destination_port; + } + if (object.destination_channel !== undefined && object.destination_channel !== null) { + message.destinationChannel = object.destination_channel; + } + if (object.data !== undefined && object.data !== null) { + message.data = bytesFromBase64(object.data); + } + if (object.timeout_height !== undefined && object.timeout_height !== null) { + message.timeoutHeight = Height.fromAmino(object.timeout_height); + } + if (object.timeout_timestamp !== undefined && object.timeout_timestamp !== null) { + message.timeoutTimestamp = BigInt(object.timeout_timestamp); + } + return message; }, toAmino(message: Packet): PacketAmino { const obj: any = {}; @@ -902,7 +1198,7 @@ export const Packet = { obj.source_channel = message.sourceChannel; obj.destination_port = message.destinationPort; obj.destination_channel = message.destinationChannel; - obj.data = message.data; + obj.data = message.data ? base64FromBytes(message.data) : undefined; obj.timeout_height = message.timeoutHeight ? Height.toAmino(message.timeoutHeight) : {}; obj.timeout_timestamp = message.timeoutTimestamp ? message.timeoutTimestamp.toString() : undefined; return obj; @@ -929,6 +1225,8 @@ export const Packet = { }; } }; +GlobalDecoderRegistry.register(Packet.typeUrl, Packet); +GlobalDecoderRegistry.registerAminoProtoMapping(Packet.aminoType, Packet.typeUrl); function createBasePacketState(): PacketState { return { portId: "", @@ -939,6 +1237,16 @@ function createBasePacketState(): PacketState { } export const PacketState = { typeUrl: "/ibc.core.channel.v1.PacketState", + aminoType: "cosmos-sdk/PacketState", + is(o: any): o is PacketState { + return o && (o.$typeUrl === PacketState.typeUrl || typeof o.portId === "string" && typeof o.channelId === "string" && typeof o.sequence === "bigint" && (o.data instanceof Uint8Array || typeof o.data === "string")); + }, + isSDK(o: any): o is PacketStateSDKType { + return o && (o.$typeUrl === PacketState.typeUrl || typeof o.port_id === "string" && typeof o.channel_id === "string" && typeof o.sequence === "bigint" && (o.data instanceof Uint8Array || typeof o.data === "string")); + }, + isAmino(o: any): o is PacketStateAmino { + return o && (o.$typeUrl === PacketState.typeUrl || typeof o.port_id === "string" && typeof o.channel_id === "string" && typeof o.sequence === "bigint" && (o.data instanceof Uint8Array || typeof o.data === "string")); + }, encode(message: PacketState, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.portId !== "") { writer.uint32(10).string(message.portId); @@ -980,6 +1288,22 @@ export const PacketState = { } return message; }, + fromJSON(object: any): PacketState { + return { + portId: isSet(object.portId) ? String(object.portId) : "", + channelId: isSet(object.channelId) ? String(object.channelId) : "", + sequence: isSet(object.sequence) ? BigInt(object.sequence.toString()) : BigInt(0), + data: isSet(object.data) ? bytesFromBase64(object.data) : new Uint8Array() + }; + }, + toJSON(message: PacketState): unknown { + const obj: any = {}; + message.portId !== undefined && (obj.portId = message.portId); + message.channelId !== undefined && (obj.channelId = message.channelId); + message.sequence !== undefined && (obj.sequence = (message.sequence || BigInt(0)).toString()); + message.data !== undefined && (obj.data = base64FromBytes(message.data !== undefined ? message.data : new Uint8Array())); + return obj; + }, fromPartial(object: Partial): PacketState { const message = createBasePacketState(); message.portId = object.portId ?? ""; @@ -989,19 +1313,27 @@ export const PacketState = { return message; }, fromAmino(object: PacketStateAmino): PacketState { - return { - portId: object.port_id, - channelId: object.channel_id, - sequence: BigInt(object.sequence), - data: object.data - }; + const message = createBasePacketState(); + if (object.port_id !== undefined && object.port_id !== null) { + message.portId = object.port_id; + } + if (object.channel_id !== undefined && object.channel_id !== null) { + message.channelId = object.channel_id; + } + if (object.sequence !== undefined && object.sequence !== null) { + message.sequence = BigInt(object.sequence); + } + if (object.data !== undefined && object.data !== null) { + message.data = bytesFromBase64(object.data); + } + return message; }, toAmino(message: PacketState): PacketStateAmino { const obj: any = {}; obj.port_id = message.portId; obj.channel_id = message.channelId; obj.sequence = message.sequence ? message.sequence.toString() : undefined; - obj.data = message.data; + obj.data = message.data ? base64FromBytes(message.data) : undefined; return obj; }, fromAminoMsg(object: PacketStateAminoMsg): PacketState { @@ -1026,6 +1358,8 @@ export const PacketState = { }; } }; +GlobalDecoderRegistry.register(PacketState.typeUrl, PacketState); +GlobalDecoderRegistry.registerAminoProtoMapping(PacketState.aminoType, PacketState.typeUrl); function createBasePacketId(): PacketId { return { portId: "", @@ -1035,6 +1369,16 @@ function createBasePacketId(): PacketId { } export const PacketId = { typeUrl: "/ibc.core.channel.v1.PacketId", + aminoType: "cosmos-sdk/PacketId", + is(o: any): o is PacketId { + return o && (o.$typeUrl === PacketId.typeUrl || typeof o.portId === "string" && typeof o.channelId === "string" && typeof o.sequence === "bigint"); + }, + isSDK(o: any): o is PacketIdSDKType { + return o && (o.$typeUrl === PacketId.typeUrl || typeof o.port_id === "string" && typeof o.channel_id === "string" && typeof o.sequence === "bigint"); + }, + isAmino(o: any): o is PacketIdAmino { + return o && (o.$typeUrl === PacketId.typeUrl || typeof o.port_id === "string" && typeof o.channel_id === "string" && typeof o.sequence === "bigint"); + }, encode(message: PacketId, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.portId !== "") { writer.uint32(10).string(message.portId); @@ -1070,6 +1414,20 @@ export const PacketId = { } return message; }, + fromJSON(object: any): PacketId { + return { + portId: isSet(object.portId) ? String(object.portId) : "", + channelId: isSet(object.channelId) ? String(object.channelId) : "", + sequence: isSet(object.sequence) ? BigInt(object.sequence.toString()) : BigInt(0) + }; + }, + toJSON(message: PacketId): unknown { + const obj: any = {}; + message.portId !== undefined && (obj.portId = message.portId); + message.channelId !== undefined && (obj.channelId = message.channelId); + message.sequence !== undefined && (obj.sequence = (message.sequence || BigInt(0)).toString()); + return obj; + }, fromPartial(object: Partial): PacketId { const message = createBasePacketId(); message.portId = object.portId ?? ""; @@ -1078,11 +1436,17 @@ export const PacketId = { return message; }, fromAmino(object: PacketIdAmino): PacketId { - return { - portId: object.port_id, - channelId: object.channel_id, - sequence: BigInt(object.sequence) - }; + const message = createBasePacketId(); + if (object.port_id !== undefined && object.port_id !== null) { + message.portId = object.port_id; + } + if (object.channel_id !== undefined && object.channel_id !== null) { + message.channelId = object.channel_id; + } + if (object.sequence !== undefined && object.sequence !== null) { + message.sequence = BigInt(object.sequence); + } + return message; }, toAmino(message: PacketId): PacketIdAmino { const obj: any = {}; @@ -1113,6 +1477,8 @@ export const PacketId = { }; } }; +GlobalDecoderRegistry.register(PacketId.typeUrl, PacketId); +GlobalDecoderRegistry.registerAminoProtoMapping(PacketId.aminoType, PacketId.typeUrl); function createBaseAcknowledgement(): Acknowledgement { return { result: undefined, @@ -1121,6 +1487,16 @@ function createBaseAcknowledgement(): Acknowledgement { } export const Acknowledgement = { typeUrl: "/ibc.core.channel.v1.Acknowledgement", + aminoType: "cosmos-sdk/Acknowledgement", + is(o: any): o is Acknowledgement { + return o && o.$typeUrl === Acknowledgement.typeUrl; + }, + isSDK(o: any): o is AcknowledgementSDKType { + return o && o.$typeUrl === Acknowledgement.typeUrl; + }, + isAmino(o: any): o is AcknowledgementAmino { + return o && o.$typeUrl === Acknowledgement.typeUrl; + }, encode(message: Acknowledgement, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.result !== undefined) { writer.uint32(170).bytes(message.result); @@ -1150,6 +1526,18 @@ export const Acknowledgement = { } return message; }, + fromJSON(object: any): Acknowledgement { + return { + result: isSet(object.result) ? bytesFromBase64(object.result) : undefined, + error: isSet(object.error) ? String(object.error) : undefined + }; + }, + toJSON(message: Acknowledgement): unknown { + const obj: any = {}; + message.result !== undefined && (obj.result = message.result !== undefined ? base64FromBytes(message.result) : undefined); + message.error !== undefined && (obj.error = message.error); + return obj; + }, fromPartial(object: Partial): Acknowledgement { const message = createBaseAcknowledgement(); message.result = object.result ?? undefined; @@ -1157,14 +1545,18 @@ export const Acknowledgement = { return message; }, fromAmino(object: AcknowledgementAmino): Acknowledgement { - return { - result: object?.result, - error: object?.error - }; + const message = createBaseAcknowledgement(); + if (object.result !== undefined && object.result !== null) { + message.result = bytesFromBase64(object.result); + } + if (object.error !== undefined && object.error !== null) { + message.error = object.error; + } + return message; }, toAmino(message: Acknowledgement): AcknowledgementAmino { const obj: any = {}; - obj.result = message.result; + obj.result = message.result ? base64FromBytes(message.result) : undefined; obj.error = message.error; return obj; }, @@ -1189,4 +1581,202 @@ export const Acknowledgement = { value: Acknowledgement.encode(message).finish() }; } -}; \ No newline at end of file +}; +GlobalDecoderRegistry.register(Acknowledgement.typeUrl, Acknowledgement); +GlobalDecoderRegistry.registerAminoProtoMapping(Acknowledgement.aminoType, Acknowledgement.typeUrl); +function createBaseTimeout(): Timeout { + return { + height: Height.fromPartial({}), + timestamp: BigInt(0) + }; +} +export const Timeout = { + typeUrl: "/ibc.core.channel.v1.Timeout", + aminoType: "cosmos-sdk/Timeout", + is(o: any): o is Timeout { + return o && (o.$typeUrl === Timeout.typeUrl || Height.is(o.height) && typeof o.timestamp === "bigint"); + }, + isSDK(o: any): o is TimeoutSDKType { + return o && (o.$typeUrl === Timeout.typeUrl || Height.isSDK(o.height) && typeof o.timestamp === "bigint"); + }, + isAmino(o: any): o is TimeoutAmino { + return o && (o.$typeUrl === Timeout.typeUrl || Height.isAmino(o.height) && typeof o.timestamp === "bigint"); + }, + encode(message: Timeout, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.height !== undefined) { + Height.encode(message.height, writer.uint32(10).fork()).ldelim(); + } + if (message.timestamp !== BigInt(0)) { + writer.uint32(16).uint64(message.timestamp); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): Timeout { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseTimeout(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.height = Height.decode(reader, reader.uint32()); + break; + case 2: + message.timestamp = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): Timeout { + return { + height: isSet(object.height) ? Height.fromJSON(object.height) : undefined, + timestamp: isSet(object.timestamp) ? BigInt(object.timestamp.toString()) : BigInt(0) + }; + }, + toJSON(message: Timeout): unknown { + const obj: any = {}; + message.height !== undefined && (obj.height = message.height ? Height.toJSON(message.height) : undefined); + message.timestamp !== undefined && (obj.timestamp = (message.timestamp || BigInt(0)).toString()); + return obj; + }, + fromPartial(object: Partial): Timeout { + const message = createBaseTimeout(); + message.height = object.height !== undefined && object.height !== null ? Height.fromPartial(object.height) : undefined; + message.timestamp = object.timestamp !== undefined && object.timestamp !== null ? BigInt(object.timestamp.toString()) : BigInt(0); + return message; + }, + fromAmino(object: TimeoutAmino): Timeout { + const message = createBaseTimeout(); + if (object.height !== undefined && object.height !== null) { + message.height = Height.fromAmino(object.height); + } + if (object.timestamp !== undefined && object.timestamp !== null) { + message.timestamp = BigInt(object.timestamp); + } + return message; + }, + toAmino(message: Timeout): TimeoutAmino { + const obj: any = {}; + obj.height = message.height ? Height.toAmino(message.height) : {}; + obj.timestamp = message.timestamp ? message.timestamp.toString() : undefined; + return obj; + }, + fromAminoMsg(object: TimeoutAminoMsg): Timeout { + return Timeout.fromAmino(object.value); + }, + toAminoMsg(message: Timeout): TimeoutAminoMsg { + return { + type: "cosmos-sdk/Timeout", + value: Timeout.toAmino(message) + }; + }, + fromProtoMsg(message: TimeoutProtoMsg): Timeout { + return Timeout.decode(message.value); + }, + toProto(message: Timeout): Uint8Array { + return Timeout.encode(message).finish(); + }, + toProtoMsg(message: Timeout): TimeoutProtoMsg { + return { + typeUrl: "/ibc.core.channel.v1.Timeout", + value: Timeout.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(Timeout.typeUrl, Timeout); +GlobalDecoderRegistry.registerAminoProtoMapping(Timeout.aminoType, Timeout.typeUrl); +function createBaseParams(): Params { + return { + upgradeTimeout: Timeout.fromPartial({}) + }; +} +export const Params = { + typeUrl: "/ibc.core.channel.v1.Params", + aminoType: "cosmos-sdk/Params", + is(o: any): o is Params { + return o && (o.$typeUrl === Params.typeUrl || Timeout.is(o.upgradeTimeout)); + }, + isSDK(o: any): o is ParamsSDKType { + return o && (o.$typeUrl === Params.typeUrl || Timeout.isSDK(o.upgrade_timeout)); + }, + isAmino(o: any): o is ParamsAmino { + return o && (o.$typeUrl === Params.typeUrl || Timeout.isAmino(o.upgrade_timeout)); + }, + encode(message: Params, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.upgradeTimeout !== undefined) { + Timeout.encode(message.upgradeTimeout, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): Params { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseParams(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.upgradeTimeout = Timeout.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): Params { + return { + upgradeTimeout: isSet(object.upgradeTimeout) ? Timeout.fromJSON(object.upgradeTimeout) : undefined + }; + }, + toJSON(message: Params): unknown { + const obj: any = {}; + message.upgradeTimeout !== undefined && (obj.upgradeTimeout = message.upgradeTimeout ? Timeout.toJSON(message.upgradeTimeout) : undefined); + return obj; + }, + fromPartial(object: Partial): Params { + const message = createBaseParams(); + message.upgradeTimeout = object.upgradeTimeout !== undefined && object.upgradeTimeout !== null ? Timeout.fromPartial(object.upgradeTimeout) : undefined; + return message; + }, + fromAmino(object: ParamsAmino): Params { + const message = createBaseParams(); + if (object.upgrade_timeout !== undefined && object.upgrade_timeout !== null) { + message.upgradeTimeout = Timeout.fromAmino(object.upgrade_timeout); + } + return message; + }, + toAmino(message: Params): ParamsAmino { + const obj: any = {}; + obj.upgrade_timeout = message.upgradeTimeout ? Timeout.toAmino(message.upgradeTimeout) : undefined; + return obj; + }, + fromAminoMsg(object: ParamsAminoMsg): Params { + return Params.fromAmino(object.value); + }, + toAminoMsg(message: Params): ParamsAminoMsg { + return { + type: "cosmos-sdk/Params", + value: Params.toAmino(message) + }; + }, + fromProtoMsg(message: ParamsProtoMsg): Params { + return Params.decode(message.value); + }, + toProto(message: Params): Uint8Array { + return Params.encode(message).finish(); + }, + toProtoMsg(message: Params): ParamsProtoMsg { + return { + typeUrl: "/ibc.core.channel.v1.Params", + value: Params.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(Params.typeUrl, Params); +GlobalDecoderRegistry.registerAminoProtoMapping(Params.aminoType, Params.typeUrl); \ No newline at end of file diff --git a/packages/osmojs/src/codegen/ibc/core/channel/v1/genesis.ts b/packages/osmojs/src/codegen/ibc/core/channel/v1/genesis.ts index 122d887b8..417ad6546 100644 --- a/packages/osmojs/src/codegen/ibc/core/channel/v1/genesis.ts +++ b/packages/osmojs/src/codegen/ibc/core/channel/v1/genesis.ts @@ -1,5 +1,7 @@ -import { IdentifiedChannel, IdentifiedChannelAmino, IdentifiedChannelSDKType, PacketState, PacketStateAmino, PacketStateSDKType } from "./channel"; +import { IdentifiedChannel, IdentifiedChannelAmino, IdentifiedChannelSDKType, PacketState, PacketStateAmino, PacketStateSDKType, Params, ParamsAmino, ParamsSDKType } from "./channel"; import { BinaryReader, BinaryWriter } from "../../../../binary"; +import { isSet } from "../../../../helpers"; +import { GlobalDecoderRegistry } from "../../../../registry"; /** GenesisState defines the ibc channel submodule's genesis state. */ export interface GenesisState { channels: IdentifiedChannel[]; @@ -11,6 +13,7 @@ export interface GenesisState { ackSequences: PacketSequence[]; /** the sequence for the next generated channel identifier */ nextChannelSequence: bigint; + params: Params; } export interface GenesisStateProtoMsg { typeUrl: "/ibc.core.channel.v1.GenesisState"; @@ -18,15 +21,16 @@ export interface GenesisStateProtoMsg { } /** GenesisState defines the ibc channel submodule's genesis state. */ export interface GenesisStateAmino { - channels: IdentifiedChannelAmino[]; - acknowledgements: PacketStateAmino[]; - commitments: PacketStateAmino[]; - receipts: PacketStateAmino[]; - send_sequences: PacketSequenceAmino[]; - recv_sequences: PacketSequenceAmino[]; - ack_sequences: PacketSequenceAmino[]; + channels?: IdentifiedChannelAmino[]; + acknowledgements?: PacketStateAmino[]; + commitments?: PacketStateAmino[]; + receipts?: PacketStateAmino[]; + send_sequences?: PacketSequenceAmino[]; + recv_sequences?: PacketSequenceAmino[]; + ack_sequences?: PacketSequenceAmino[]; /** the sequence for the next generated channel identifier */ - next_channel_sequence: string; + next_channel_sequence?: string; + params?: ParamsAmino; } export interface GenesisStateAminoMsg { type: "cosmos-sdk/GenesisState"; @@ -42,6 +46,7 @@ export interface GenesisStateSDKType { recv_sequences: PacketSequenceSDKType[]; ack_sequences: PacketSequenceSDKType[]; next_channel_sequence: bigint; + params: ParamsSDKType; } /** * PacketSequence defines the genesis type necessary to retrieve and store @@ -61,9 +66,9 @@ export interface PacketSequenceProtoMsg { * next send and receive sequences. */ export interface PacketSequenceAmino { - port_id: string; - channel_id: string; - sequence: string; + port_id?: string; + channel_id?: string; + sequence?: string; } export interface PacketSequenceAminoMsg { type: "cosmos-sdk/PacketSequence"; @@ -87,11 +92,22 @@ function createBaseGenesisState(): GenesisState { sendSequences: [], recvSequences: [], ackSequences: [], - nextChannelSequence: BigInt(0) + nextChannelSequence: BigInt(0), + params: Params.fromPartial({}) }; } export const GenesisState = { typeUrl: "/ibc.core.channel.v1.GenesisState", + aminoType: "cosmos-sdk/GenesisState", + is(o: any): o is GenesisState { + return o && (o.$typeUrl === GenesisState.typeUrl || Array.isArray(o.channels) && (!o.channels.length || IdentifiedChannel.is(o.channels[0])) && Array.isArray(o.acknowledgements) && (!o.acknowledgements.length || PacketState.is(o.acknowledgements[0])) && Array.isArray(o.commitments) && (!o.commitments.length || PacketState.is(o.commitments[0])) && Array.isArray(o.receipts) && (!o.receipts.length || PacketState.is(o.receipts[0])) && Array.isArray(o.sendSequences) && (!o.sendSequences.length || PacketSequence.is(o.sendSequences[0])) && Array.isArray(o.recvSequences) && (!o.recvSequences.length || PacketSequence.is(o.recvSequences[0])) && Array.isArray(o.ackSequences) && (!o.ackSequences.length || PacketSequence.is(o.ackSequences[0])) && typeof o.nextChannelSequence === "bigint" && Params.is(o.params)); + }, + isSDK(o: any): o is GenesisStateSDKType { + return o && (o.$typeUrl === GenesisState.typeUrl || Array.isArray(o.channels) && (!o.channels.length || IdentifiedChannel.isSDK(o.channels[0])) && Array.isArray(o.acknowledgements) && (!o.acknowledgements.length || PacketState.isSDK(o.acknowledgements[0])) && Array.isArray(o.commitments) && (!o.commitments.length || PacketState.isSDK(o.commitments[0])) && Array.isArray(o.receipts) && (!o.receipts.length || PacketState.isSDK(o.receipts[0])) && Array.isArray(o.send_sequences) && (!o.send_sequences.length || PacketSequence.isSDK(o.send_sequences[0])) && Array.isArray(o.recv_sequences) && (!o.recv_sequences.length || PacketSequence.isSDK(o.recv_sequences[0])) && Array.isArray(o.ack_sequences) && (!o.ack_sequences.length || PacketSequence.isSDK(o.ack_sequences[0])) && typeof o.next_channel_sequence === "bigint" && Params.isSDK(o.params)); + }, + isAmino(o: any): o is GenesisStateAmino { + return o && (o.$typeUrl === GenesisState.typeUrl || Array.isArray(o.channels) && (!o.channels.length || IdentifiedChannel.isAmino(o.channels[0])) && Array.isArray(o.acknowledgements) && (!o.acknowledgements.length || PacketState.isAmino(o.acknowledgements[0])) && Array.isArray(o.commitments) && (!o.commitments.length || PacketState.isAmino(o.commitments[0])) && Array.isArray(o.receipts) && (!o.receipts.length || PacketState.isAmino(o.receipts[0])) && Array.isArray(o.send_sequences) && (!o.send_sequences.length || PacketSequence.isAmino(o.send_sequences[0])) && Array.isArray(o.recv_sequences) && (!o.recv_sequences.length || PacketSequence.isAmino(o.recv_sequences[0])) && Array.isArray(o.ack_sequences) && (!o.ack_sequences.length || PacketSequence.isAmino(o.ack_sequences[0])) && typeof o.next_channel_sequence === "bigint" && Params.isAmino(o.params)); + }, encode(message: GenesisState, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.channels) { IdentifiedChannel.encode(v!, writer.uint32(10).fork()).ldelim(); @@ -117,6 +133,9 @@ export const GenesisState = { if (message.nextChannelSequence !== BigInt(0)) { writer.uint32(64).uint64(message.nextChannelSequence); } + if (message.params !== undefined) { + Params.encode(message.params, writer.uint32(74).fork()).ldelim(); + } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): GenesisState { @@ -150,6 +169,9 @@ export const GenesisState = { case 8: message.nextChannelSequence = reader.uint64(); break; + case 9: + message.params = Params.decode(reader, reader.uint32()); + break; default: reader.skipType(tag & 7); break; @@ -157,6 +179,60 @@ export const GenesisState = { } return message; }, + fromJSON(object: any): GenesisState { + return { + channels: Array.isArray(object?.channels) ? object.channels.map((e: any) => IdentifiedChannel.fromJSON(e)) : [], + acknowledgements: Array.isArray(object?.acknowledgements) ? object.acknowledgements.map((e: any) => PacketState.fromJSON(e)) : [], + commitments: Array.isArray(object?.commitments) ? object.commitments.map((e: any) => PacketState.fromJSON(e)) : [], + receipts: Array.isArray(object?.receipts) ? object.receipts.map((e: any) => PacketState.fromJSON(e)) : [], + sendSequences: Array.isArray(object?.sendSequences) ? object.sendSequences.map((e: any) => PacketSequence.fromJSON(e)) : [], + recvSequences: Array.isArray(object?.recvSequences) ? object.recvSequences.map((e: any) => PacketSequence.fromJSON(e)) : [], + ackSequences: Array.isArray(object?.ackSequences) ? object.ackSequences.map((e: any) => PacketSequence.fromJSON(e)) : [], + nextChannelSequence: isSet(object.nextChannelSequence) ? BigInt(object.nextChannelSequence.toString()) : BigInt(0), + params: isSet(object.params) ? Params.fromJSON(object.params) : undefined + }; + }, + toJSON(message: GenesisState): unknown { + const obj: any = {}; + if (message.channels) { + obj.channels = message.channels.map(e => e ? IdentifiedChannel.toJSON(e) : undefined); + } else { + obj.channels = []; + } + if (message.acknowledgements) { + obj.acknowledgements = message.acknowledgements.map(e => e ? PacketState.toJSON(e) : undefined); + } else { + obj.acknowledgements = []; + } + if (message.commitments) { + obj.commitments = message.commitments.map(e => e ? PacketState.toJSON(e) : undefined); + } else { + obj.commitments = []; + } + if (message.receipts) { + obj.receipts = message.receipts.map(e => e ? PacketState.toJSON(e) : undefined); + } else { + obj.receipts = []; + } + if (message.sendSequences) { + obj.sendSequences = message.sendSequences.map(e => e ? PacketSequence.toJSON(e) : undefined); + } else { + obj.sendSequences = []; + } + if (message.recvSequences) { + obj.recvSequences = message.recvSequences.map(e => e ? PacketSequence.toJSON(e) : undefined); + } else { + obj.recvSequences = []; + } + if (message.ackSequences) { + obj.ackSequences = message.ackSequences.map(e => e ? PacketSequence.toJSON(e) : undefined); + } else { + obj.ackSequences = []; + } + message.nextChannelSequence !== undefined && (obj.nextChannelSequence = (message.nextChannelSequence || BigInt(0)).toString()); + message.params !== undefined && (obj.params = message.params ? Params.toJSON(message.params) : undefined); + return obj; + }, fromPartial(object: Partial): GenesisState { const message = createBaseGenesisState(); message.channels = object.channels?.map(e => IdentifiedChannel.fromPartial(e)) || []; @@ -167,19 +243,25 @@ export const GenesisState = { message.recvSequences = object.recvSequences?.map(e => PacketSequence.fromPartial(e)) || []; message.ackSequences = object.ackSequences?.map(e => PacketSequence.fromPartial(e)) || []; message.nextChannelSequence = object.nextChannelSequence !== undefined && object.nextChannelSequence !== null ? BigInt(object.nextChannelSequence.toString()) : BigInt(0); + message.params = object.params !== undefined && object.params !== null ? Params.fromPartial(object.params) : undefined; return message; }, fromAmino(object: GenesisStateAmino): GenesisState { - return { - channels: Array.isArray(object?.channels) ? object.channels.map((e: any) => IdentifiedChannel.fromAmino(e)) : [], - acknowledgements: Array.isArray(object?.acknowledgements) ? object.acknowledgements.map((e: any) => PacketState.fromAmino(e)) : [], - commitments: Array.isArray(object?.commitments) ? object.commitments.map((e: any) => PacketState.fromAmino(e)) : [], - receipts: Array.isArray(object?.receipts) ? object.receipts.map((e: any) => PacketState.fromAmino(e)) : [], - sendSequences: Array.isArray(object?.send_sequences) ? object.send_sequences.map((e: any) => PacketSequence.fromAmino(e)) : [], - recvSequences: Array.isArray(object?.recv_sequences) ? object.recv_sequences.map((e: any) => PacketSequence.fromAmino(e)) : [], - ackSequences: Array.isArray(object?.ack_sequences) ? object.ack_sequences.map((e: any) => PacketSequence.fromAmino(e)) : [], - nextChannelSequence: BigInt(object.next_channel_sequence) - }; + const message = createBaseGenesisState(); + message.channels = object.channels?.map(e => IdentifiedChannel.fromAmino(e)) || []; + message.acknowledgements = object.acknowledgements?.map(e => PacketState.fromAmino(e)) || []; + message.commitments = object.commitments?.map(e => PacketState.fromAmino(e)) || []; + message.receipts = object.receipts?.map(e => PacketState.fromAmino(e)) || []; + message.sendSequences = object.send_sequences?.map(e => PacketSequence.fromAmino(e)) || []; + message.recvSequences = object.recv_sequences?.map(e => PacketSequence.fromAmino(e)) || []; + message.ackSequences = object.ack_sequences?.map(e => PacketSequence.fromAmino(e)) || []; + if (object.next_channel_sequence !== undefined && object.next_channel_sequence !== null) { + message.nextChannelSequence = BigInt(object.next_channel_sequence); + } + if (object.params !== undefined && object.params !== null) { + message.params = Params.fromAmino(object.params); + } + return message; }, toAmino(message: GenesisState): GenesisStateAmino { const obj: any = {}; @@ -219,6 +301,7 @@ export const GenesisState = { obj.ack_sequences = []; } obj.next_channel_sequence = message.nextChannelSequence ? message.nextChannelSequence.toString() : undefined; + obj.params = message.params ? Params.toAmino(message.params) : undefined; return obj; }, fromAminoMsg(object: GenesisStateAminoMsg): GenesisState { @@ -243,6 +326,8 @@ export const GenesisState = { }; } }; +GlobalDecoderRegistry.register(GenesisState.typeUrl, GenesisState); +GlobalDecoderRegistry.registerAminoProtoMapping(GenesisState.aminoType, GenesisState.typeUrl); function createBasePacketSequence(): PacketSequence { return { portId: "", @@ -252,6 +337,16 @@ function createBasePacketSequence(): PacketSequence { } export const PacketSequence = { typeUrl: "/ibc.core.channel.v1.PacketSequence", + aminoType: "cosmos-sdk/PacketSequence", + is(o: any): o is PacketSequence { + return o && (o.$typeUrl === PacketSequence.typeUrl || typeof o.portId === "string" && typeof o.channelId === "string" && typeof o.sequence === "bigint"); + }, + isSDK(o: any): o is PacketSequenceSDKType { + return o && (o.$typeUrl === PacketSequence.typeUrl || typeof o.port_id === "string" && typeof o.channel_id === "string" && typeof o.sequence === "bigint"); + }, + isAmino(o: any): o is PacketSequenceAmino { + return o && (o.$typeUrl === PacketSequence.typeUrl || typeof o.port_id === "string" && typeof o.channel_id === "string" && typeof o.sequence === "bigint"); + }, encode(message: PacketSequence, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.portId !== "") { writer.uint32(10).string(message.portId); @@ -287,6 +382,20 @@ export const PacketSequence = { } return message; }, + fromJSON(object: any): PacketSequence { + return { + portId: isSet(object.portId) ? String(object.portId) : "", + channelId: isSet(object.channelId) ? String(object.channelId) : "", + sequence: isSet(object.sequence) ? BigInt(object.sequence.toString()) : BigInt(0) + }; + }, + toJSON(message: PacketSequence): unknown { + const obj: any = {}; + message.portId !== undefined && (obj.portId = message.portId); + message.channelId !== undefined && (obj.channelId = message.channelId); + message.sequence !== undefined && (obj.sequence = (message.sequence || BigInt(0)).toString()); + return obj; + }, fromPartial(object: Partial): PacketSequence { const message = createBasePacketSequence(); message.portId = object.portId ?? ""; @@ -295,11 +404,17 @@ export const PacketSequence = { return message; }, fromAmino(object: PacketSequenceAmino): PacketSequence { - return { - portId: object.port_id, - channelId: object.channel_id, - sequence: BigInt(object.sequence) - }; + const message = createBasePacketSequence(); + if (object.port_id !== undefined && object.port_id !== null) { + message.portId = object.port_id; + } + if (object.channel_id !== undefined && object.channel_id !== null) { + message.channelId = object.channel_id; + } + if (object.sequence !== undefined && object.sequence !== null) { + message.sequence = BigInt(object.sequence); + } + return message; }, toAmino(message: PacketSequence): PacketSequenceAmino { const obj: any = {}; @@ -329,4 +444,6 @@ export const PacketSequence = { value: PacketSequence.encode(message).finish() }; } -}; \ No newline at end of file +}; +GlobalDecoderRegistry.register(PacketSequence.typeUrl, PacketSequence); +GlobalDecoderRegistry.registerAminoProtoMapping(PacketSequence.aminoType, PacketSequence.typeUrl); \ No newline at end of file diff --git a/packages/osmojs/src/codegen/ibc/core/channel/v1/query.lcd.ts b/packages/osmojs/src/codegen/ibc/core/channel/v1/query.lcd.ts index 758cdbf1d..d94588a3e 100644 --- a/packages/osmojs/src/codegen/ibc/core/channel/v1/query.lcd.ts +++ b/packages/osmojs/src/codegen/ibc/core/channel/v1/query.lcd.ts @@ -1,6 +1,6 @@ import { setPaginationParams } from "../../../../helpers"; import { LCDClient } from "@cosmology/lcd"; -import { QueryChannelRequest, QueryChannelResponseSDKType, QueryChannelsRequest, QueryChannelsResponseSDKType, QueryConnectionChannelsRequest, QueryConnectionChannelsResponseSDKType, QueryChannelClientStateRequest, QueryChannelClientStateResponseSDKType, QueryChannelConsensusStateRequest, QueryChannelConsensusStateResponseSDKType, QueryPacketCommitmentRequest, QueryPacketCommitmentResponseSDKType, QueryPacketCommitmentsRequest, QueryPacketCommitmentsResponseSDKType, QueryPacketReceiptRequest, QueryPacketReceiptResponseSDKType, QueryPacketAcknowledgementRequest, QueryPacketAcknowledgementResponseSDKType, QueryPacketAcknowledgementsRequest, QueryPacketAcknowledgementsResponseSDKType, QueryUnreceivedPacketsRequest, QueryUnreceivedPacketsResponseSDKType, QueryUnreceivedAcksRequest, QueryUnreceivedAcksResponseSDKType, QueryNextSequenceReceiveRequest, QueryNextSequenceReceiveResponseSDKType } from "./query"; +import { QueryChannelRequest, QueryChannelResponseSDKType, QueryChannelsRequest, QueryChannelsResponseSDKType, QueryConnectionChannelsRequest, QueryConnectionChannelsResponseSDKType, QueryChannelClientStateRequest, QueryChannelClientStateResponseSDKType, QueryChannelConsensusStateRequest, QueryChannelConsensusStateResponseSDKType, QueryPacketCommitmentRequest, QueryPacketCommitmentResponseSDKType, QueryPacketCommitmentsRequest, QueryPacketCommitmentsResponseSDKType, QueryPacketReceiptRequest, QueryPacketReceiptResponseSDKType, QueryPacketAcknowledgementRequest, QueryPacketAcknowledgementResponseSDKType, QueryPacketAcknowledgementsRequest, QueryPacketAcknowledgementsResponseSDKType, QueryUnreceivedPacketsRequest, QueryUnreceivedPacketsResponseSDKType, QueryUnreceivedAcksRequest, QueryUnreceivedAcksResponseSDKType, QueryNextSequenceReceiveRequest, QueryNextSequenceReceiveResponseSDKType, QueryNextSequenceSendRequest, QueryNextSequenceSendResponseSDKType, QueryUpgradeErrorRequest, QueryUpgradeErrorResponseSDKType, QueryUpgradeRequest, QueryUpgradeResponseSDKType, QueryChannelParamsRequest, QueryChannelParamsResponseSDKType } from "./query"; export class LCDQueryClient { req: LCDClient; constructor({ @@ -22,6 +22,10 @@ export class LCDQueryClient { this.unreceivedPackets = this.unreceivedPackets.bind(this); this.unreceivedAcks = this.unreceivedAcks.bind(this); this.nextSequenceReceive = this.nextSequenceReceive.bind(this); + this.nextSequenceSend = this.nextSequenceSend.bind(this); + this.upgradeError = this.upgradeError.bind(this); + this.upgrade = this.upgrade.bind(this); + this.channelParams = this.channelParams.bind(this); } /* Channel queries an IBC Channel. */ async channel(params: QueryChannelRequest): Promise { @@ -125,4 +129,24 @@ export class LCDQueryClient { const endpoint = `ibc/core/channel/v1/channels/${params.channelId}/ports/${params.portId}/next_sequence`; return await this.req.get(endpoint); } + /* NextSequenceSend returns the next send sequence for a given channel. */ + async nextSequenceSend(params: QueryNextSequenceSendRequest): Promise { + const endpoint = `ibc/core/channel/v1/channels/${params.channelId}/ports/${params.portId}/next_sequence_send`; + return await this.req.get(endpoint); + } + /* UpgradeError returns the error receipt if the upgrade handshake failed. */ + async upgradeError(params: QueryUpgradeErrorRequest): Promise { + const endpoint = `ibc/core/channel/v1/channels/${params.channelId}/ports/${params.portId}/upgrade_error`; + return await this.req.get(endpoint); + } + /* Upgrade returns the upgrade for a given port and channel id. */ + async upgrade(params: QueryUpgradeRequest): Promise { + const endpoint = `ibc/core/channel/v1/channels/${params.channelId}/ports/${params.portId}/upgrade`; + return await this.req.get(endpoint); + } + /* ChannelParams queries all parameters of the ibc channel submodule. */ + async channelParams(_params: QueryChannelParamsRequest = {}): Promise { + const endpoint = `ibc/core/channel/v1/params`; + return await this.req.get(endpoint); + } } \ No newline at end of file diff --git a/packages/osmojs/src/codegen/ibc/core/channel/v1/query.rpc.Query.ts b/packages/osmojs/src/codegen/ibc/core/channel/v1/query.rpc.Query.ts index 72075c5d3..2c3b5e69a 100644 --- a/packages/osmojs/src/codegen/ibc/core/channel/v1/query.rpc.Query.ts +++ b/packages/osmojs/src/codegen/ibc/core/channel/v1/query.rpc.Query.ts @@ -1,7 +1,7 @@ import { Rpc } from "../../../../helpers"; import { BinaryReader } from "../../../../binary"; import { QueryClient, createProtobufRpcClient } from "@cosmjs/stargate"; -import { QueryChannelRequest, QueryChannelResponse, QueryChannelsRequest, QueryChannelsResponse, QueryConnectionChannelsRequest, QueryConnectionChannelsResponse, QueryChannelClientStateRequest, QueryChannelClientStateResponse, QueryChannelConsensusStateRequest, QueryChannelConsensusStateResponse, QueryPacketCommitmentRequest, QueryPacketCommitmentResponse, QueryPacketCommitmentsRequest, QueryPacketCommitmentsResponse, QueryPacketReceiptRequest, QueryPacketReceiptResponse, QueryPacketAcknowledgementRequest, QueryPacketAcknowledgementResponse, QueryPacketAcknowledgementsRequest, QueryPacketAcknowledgementsResponse, QueryUnreceivedPacketsRequest, QueryUnreceivedPacketsResponse, QueryUnreceivedAcksRequest, QueryUnreceivedAcksResponse, QueryNextSequenceReceiveRequest, QueryNextSequenceReceiveResponse } from "./query"; +import { QueryChannelRequest, QueryChannelResponse, QueryChannelsRequest, QueryChannelsResponse, QueryConnectionChannelsRequest, QueryConnectionChannelsResponse, QueryChannelClientStateRequest, QueryChannelClientStateResponse, QueryChannelConsensusStateRequest, QueryChannelConsensusStateResponse, QueryPacketCommitmentRequest, QueryPacketCommitmentResponse, QueryPacketCommitmentsRequest, QueryPacketCommitmentsResponse, QueryPacketReceiptRequest, QueryPacketReceiptResponse, QueryPacketAcknowledgementRequest, QueryPacketAcknowledgementResponse, QueryPacketAcknowledgementsRequest, QueryPacketAcknowledgementsResponse, QueryUnreceivedPacketsRequest, QueryUnreceivedPacketsResponse, QueryUnreceivedAcksRequest, QueryUnreceivedAcksResponse, QueryNextSequenceReceiveRequest, QueryNextSequenceReceiveResponse, QueryNextSequenceSendRequest, QueryNextSequenceSendResponse, QueryUpgradeErrorRequest, QueryUpgradeErrorResponse, QueryUpgradeRequest, QueryUpgradeResponse, QueryChannelParamsRequest, QueryChannelParamsResponse } from "./query"; /** Query provides defines the gRPC querier service */ export interface Query { /** Channel queries an IBC Channel. */ @@ -54,6 +54,14 @@ export interface Query { unreceivedAcks(request: QueryUnreceivedAcksRequest): Promise; /** NextSequenceReceive returns the next receive sequence for a given channel. */ nextSequenceReceive(request: QueryNextSequenceReceiveRequest): Promise; + /** NextSequenceSend returns the next send sequence for a given channel. */ + nextSequenceSend(request: QueryNextSequenceSendRequest): Promise; + /** UpgradeError returns the error receipt if the upgrade handshake failed. */ + upgradeError(request: QueryUpgradeErrorRequest): Promise; + /** Upgrade returns the upgrade for a given port and channel id. */ + upgrade(request: QueryUpgradeRequest): Promise; + /** ChannelParams queries all parameters of the ibc channel submodule. */ + channelParams(request?: QueryChannelParamsRequest): Promise; } export class QueryClientImpl implements Query { private readonly rpc: Rpc; @@ -72,6 +80,10 @@ export class QueryClientImpl implements Query { this.unreceivedPackets = this.unreceivedPackets.bind(this); this.unreceivedAcks = this.unreceivedAcks.bind(this); this.nextSequenceReceive = this.nextSequenceReceive.bind(this); + this.nextSequenceSend = this.nextSequenceSend.bind(this); + this.upgradeError = this.upgradeError.bind(this); + this.upgrade = this.upgrade.bind(this); + this.channelParams = this.channelParams.bind(this); } channel(request: QueryChannelRequest): Promise { const data = QueryChannelRequest.encode(request).finish(); @@ -140,6 +152,26 @@ export class QueryClientImpl implements Query { const promise = this.rpc.request("ibc.core.channel.v1.Query", "NextSequenceReceive", data); return promise.then(data => QueryNextSequenceReceiveResponse.decode(new BinaryReader(data))); } + nextSequenceSend(request: QueryNextSequenceSendRequest): Promise { + const data = QueryNextSequenceSendRequest.encode(request).finish(); + const promise = this.rpc.request("ibc.core.channel.v1.Query", "NextSequenceSend", data); + return promise.then(data => QueryNextSequenceSendResponse.decode(new BinaryReader(data))); + } + upgradeError(request: QueryUpgradeErrorRequest): Promise { + const data = QueryUpgradeErrorRequest.encode(request).finish(); + const promise = this.rpc.request("ibc.core.channel.v1.Query", "UpgradeError", data); + return promise.then(data => QueryUpgradeErrorResponse.decode(new BinaryReader(data))); + } + upgrade(request: QueryUpgradeRequest): Promise { + const data = QueryUpgradeRequest.encode(request).finish(); + const promise = this.rpc.request("ibc.core.channel.v1.Query", "Upgrade", data); + return promise.then(data => QueryUpgradeResponse.decode(new BinaryReader(data))); + } + channelParams(request: QueryChannelParamsRequest = {}): Promise { + const data = QueryChannelParamsRequest.encode(request).finish(); + const promise = this.rpc.request("ibc.core.channel.v1.Query", "ChannelParams", data); + return promise.then(data => QueryChannelParamsResponse.decode(new BinaryReader(data))); + } } export const createRpcQueryExtension = (base: QueryClient) => { const rpc = createProtobufRpcClient(base); @@ -183,6 +215,18 @@ export const createRpcQueryExtension = (base: QueryClient) => { }, nextSequenceReceive(request: QueryNextSequenceReceiveRequest): Promise { return queryService.nextSequenceReceive(request); + }, + nextSequenceSend(request: QueryNextSequenceSendRequest): Promise { + return queryService.nextSequenceSend(request); + }, + upgradeError(request: QueryUpgradeErrorRequest): Promise { + return queryService.upgradeError(request); + }, + upgrade(request: QueryUpgradeRequest): Promise { + return queryService.upgrade(request); + }, + channelParams(request?: QueryChannelParamsRequest): Promise { + return queryService.channelParams(request); } }; }; \ No newline at end of file diff --git a/packages/osmojs/src/codegen/ibc/core/channel/v1/query.ts b/packages/osmojs/src/codegen/ibc/core/channel/v1/query.ts index eadfa84a6..5afdeb8a5 100644 --- a/packages/osmojs/src/codegen/ibc/core/channel/v1/query.ts +++ b/packages/osmojs/src/codegen/ibc/core/channel/v1/query.ts @@ -1,8 +1,11 @@ import { PageRequest, PageRequestAmino, PageRequestSDKType, PageResponse, PageResponseAmino, PageResponseSDKType } from "../../../../cosmos/base/query/v1beta1/pagination"; import { Channel, ChannelAmino, ChannelSDKType, IdentifiedChannel, IdentifiedChannelAmino, IdentifiedChannelSDKType, PacketState, PacketStateAmino, PacketStateSDKType } from "./channel"; -import { Height, HeightAmino, HeightSDKType, IdentifiedClientState, IdentifiedClientStateAmino, IdentifiedClientStateSDKType } from "../../client/v1/client"; +import { Height, HeightAmino, HeightSDKType, IdentifiedClientState, IdentifiedClientStateAmino, IdentifiedClientStateSDKType, Params, ParamsAmino, ParamsSDKType } from "../../client/v1/client"; import { Any, AnyAmino, AnySDKType } from "../../../../google/protobuf/any"; +import { ErrorReceipt, ErrorReceiptAmino, ErrorReceiptSDKType, Upgrade, UpgradeAmino, UpgradeSDKType } from "./upgrade"; import { BinaryReader, BinaryWriter } from "../../../../binary"; +import { isSet, bytesFromBase64, base64FromBytes } from "../../../../helpers"; +import { GlobalDecoderRegistry } from "../../../../registry"; /** QueryChannelRequest is the request type for the Query/Channel RPC method */ export interface QueryChannelRequest { /** port unique identifier */ @@ -17,9 +20,9 @@ export interface QueryChannelRequestProtoMsg { /** QueryChannelRequest is the request type for the Query/Channel RPC method */ export interface QueryChannelRequestAmino { /** port unique identifier */ - port_id: string; + port_id?: string; /** channel unique identifier */ - channel_id: string; + channel_id?: string; } export interface QueryChannelRequestAminoMsg { type: "cosmos-sdk/QueryChannelRequest"; @@ -37,7 +40,7 @@ export interface QueryChannelRequestSDKType { */ export interface QueryChannelResponse { /** channel associated with the request identifiers */ - channel: Channel; + channel?: Channel; /** merkle proof of existence */ proof: Uint8Array; /** height at which the proof was retrieved */ @@ -56,7 +59,7 @@ export interface QueryChannelResponseAmino { /** channel associated with the request identifiers */ channel?: ChannelAmino; /** merkle proof of existence */ - proof: Uint8Array; + proof?: string; /** height at which the proof was retrieved */ proof_height?: HeightAmino; } @@ -70,14 +73,14 @@ export interface QueryChannelResponseAminoMsg { * proof was retrieved. */ export interface QueryChannelResponseSDKType { - channel: ChannelSDKType; + channel?: ChannelSDKType; proof: Uint8Array; proof_height: HeightSDKType; } /** QueryChannelsRequest is the request type for the Query/Channels RPC method */ export interface QueryChannelsRequest { /** pagination request */ - pagination: PageRequest; + pagination?: PageRequest; } export interface QueryChannelsRequestProtoMsg { typeUrl: "/ibc.core.channel.v1.QueryChannelsRequest"; @@ -94,14 +97,14 @@ export interface QueryChannelsRequestAminoMsg { } /** QueryChannelsRequest is the request type for the Query/Channels RPC method */ export interface QueryChannelsRequestSDKType { - pagination: PageRequestSDKType; + pagination?: PageRequestSDKType; } /** QueryChannelsResponse is the response type for the Query/Channels RPC method. */ export interface QueryChannelsResponse { /** list of stored channels of the chain. */ channels: IdentifiedChannel[]; /** pagination response */ - pagination: PageResponse; + pagination?: PageResponse; /** query block height */ height: Height; } @@ -112,7 +115,7 @@ export interface QueryChannelsResponseProtoMsg { /** QueryChannelsResponse is the response type for the Query/Channels RPC method. */ export interface QueryChannelsResponseAmino { /** list of stored channels of the chain. */ - channels: IdentifiedChannelAmino[]; + channels?: IdentifiedChannelAmino[]; /** pagination response */ pagination?: PageResponseAmino; /** query block height */ @@ -125,7 +128,7 @@ export interface QueryChannelsResponseAminoMsg { /** QueryChannelsResponse is the response type for the Query/Channels RPC method. */ export interface QueryChannelsResponseSDKType { channels: IdentifiedChannelSDKType[]; - pagination: PageResponseSDKType; + pagination?: PageResponseSDKType; height: HeightSDKType; } /** @@ -136,7 +139,7 @@ export interface QueryConnectionChannelsRequest { /** connection unique identifier */ connection: string; /** pagination request */ - pagination: PageRequest; + pagination?: PageRequest; } export interface QueryConnectionChannelsRequestProtoMsg { typeUrl: "/ibc.core.channel.v1.QueryConnectionChannelsRequest"; @@ -148,7 +151,7 @@ export interface QueryConnectionChannelsRequestProtoMsg { */ export interface QueryConnectionChannelsRequestAmino { /** connection unique identifier */ - connection: string; + connection?: string; /** pagination request */ pagination?: PageRequestAmino; } @@ -162,7 +165,7 @@ export interface QueryConnectionChannelsRequestAminoMsg { */ export interface QueryConnectionChannelsRequestSDKType { connection: string; - pagination: PageRequestSDKType; + pagination?: PageRequestSDKType; } /** * QueryConnectionChannelsResponse is the Response type for the @@ -172,7 +175,7 @@ export interface QueryConnectionChannelsResponse { /** list of channels associated with a connection. */ channels: IdentifiedChannel[]; /** pagination response */ - pagination: PageResponse; + pagination?: PageResponse; /** query block height */ height: Height; } @@ -186,7 +189,7 @@ export interface QueryConnectionChannelsResponseProtoMsg { */ export interface QueryConnectionChannelsResponseAmino { /** list of channels associated with a connection. */ - channels: IdentifiedChannelAmino[]; + channels?: IdentifiedChannelAmino[]; /** pagination response */ pagination?: PageResponseAmino; /** query block height */ @@ -202,7 +205,7 @@ export interface QueryConnectionChannelsResponseAminoMsg { */ export interface QueryConnectionChannelsResponseSDKType { channels: IdentifiedChannelSDKType[]; - pagination: PageResponseSDKType; + pagination?: PageResponseSDKType; height: HeightSDKType; } /** @@ -225,9 +228,9 @@ export interface QueryChannelClientStateRequestProtoMsg { */ export interface QueryChannelClientStateRequestAmino { /** port unique identifier */ - port_id: string; + port_id?: string; /** channel unique identifier */ - channel_id: string; + channel_id?: string; } export interface QueryChannelClientStateRequestAminoMsg { type: "cosmos-sdk/QueryChannelClientStateRequest"; @@ -247,7 +250,7 @@ export interface QueryChannelClientStateRequestSDKType { */ export interface QueryChannelClientStateResponse { /** client state associated with the channel */ - identifiedClientState: IdentifiedClientState; + identifiedClientState?: IdentifiedClientState; /** merkle proof of existence */ proof: Uint8Array; /** height at which the proof was retrieved */ @@ -265,7 +268,7 @@ export interface QueryChannelClientStateResponseAmino { /** client state associated with the channel */ identified_client_state?: IdentifiedClientStateAmino; /** merkle proof of existence */ - proof: Uint8Array; + proof?: string; /** height at which the proof was retrieved */ proof_height?: HeightAmino; } @@ -278,7 +281,7 @@ export interface QueryChannelClientStateResponseAminoMsg { * Query/QueryChannelClientState RPC method */ export interface QueryChannelClientStateResponseSDKType { - identified_client_state: IdentifiedClientStateSDKType; + identified_client_state?: IdentifiedClientStateSDKType; proof: Uint8Array; proof_height: HeightSDKType; } @@ -306,13 +309,13 @@ export interface QueryChannelConsensusStateRequestProtoMsg { */ export interface QueryChannelConsensusStateRequestAmino { /** port unique identifier */ - port_id: string; + port_id?: string; /** channel unique identifier */ - channel_id: string; + channel_id?: string; /** revision number of the consensus state */ - revision_number: string; + revision_number?: string; /** revision height of the consensus state */ - revision_height: string; + revision_height?: string; } export interface QueryChannelConsensusStateRequestAminoMsg { type: "cosmos-sdk/QueryChannelConsensusStateRequest"; @@ -334,7 +337,7 @@ export interface QueryChannelConsensusStateRequestSDKType { */ export interface QueryChannelConsensusStateResponse { /** consensus state associated with the channel */ - consensusState: Any; + consensusState?: Any; /** client ID associated with the consensus state */ clientId: string; /** merkle proof of existence */ @@ -354,9 +357,9 @@ export interface QueryChannelConsensusStateResponseAmino { /** consensus state associated with the channel */ consensus_state?: AnyAmino; /** client ID associated with the consensus state */ - client_id: string; + client_id?: string; /** merkle proof of existence */ - proof: Uint8Array; + proof?: string; /** height at which the proof was retrieved */ proof_height?: HeightAmino; } @@ -369,7 +372,7 @@ export interface QueryChannelConsensusStateResponseAminoMsg { * Query/QueryChannelClientState RPC method */ export interface QueryChannelConsensusStateResponseSDKType { - consensus_state: AnySDKType; + consensus_state?: AnySDKType; client_id: string; proof: Uint8Array; proof_height: HeightSDKType; @@ -396,11 +399,11 @@ export interface QueryPacketCommitmentRequestProtoMsg { */ export interface QueryPacketCommitmentRequestAmino { /** port unique identifier */ - port_id: string; + port_id?: string; /** channel unique identifier */ - channel_id: string; + channel_id?: string; /** packet sequence */ - sequence: string; + sequence?: string; } export interface QueryPacketCommitmentRequestAminoMsg { type: "cosmos-sdk/QueryPacketCommitmentRequest"; @@ -439,9 +442,9 @@ export interface QueryPacketCommitmentResponseProtoMsg { */ export interface QueryPacketCommitmentResponseAmino { /** packet associated with the request fields */ - commitment: Uint8Array; + commitment?: string; /** merkle proof of existence */ - proof: Uint8Array; + proof?: string; /** height at which the proof was retrieved */ proof_height?: HeightAmino; } @@ -469,7 +472,7 @@ export interface QueryPacketCommitmentsRequest { /** channel unique identifier */ channelId: string; /** pagination request */ - pagination: PageRequest; + pagination?: PageRequest; } export interface QueryPacketCommitmentsRequestProtoMsg { typeUrl: "/ibc.core.channel.v1.QueryPacketCommitmentsRequest"; @@ -481,9 +484,9 @@ export interface QueryPacketCommitmentsRequestProtoMsg { */ export interface QueryPacketCommitmentsRequestAmino { /** port unique identifier */ - port_id: string; + port_id?: string; /** channel unique identifier */ - channel_id: string; + channel_id?: string; /** pagination request */ pagination?: PageRequestAmino; } @@ -498,7 +501,7 @@ export interface QueryPacketCommitmentsRequestAminoMsg { export interface QueryPacketCommitmentsRequestSDKType { port_id: string; channel_id: string; - pagination: PageRequestSDKType; + pagination?: PageRequestSDKType; } /** * QueryPacketCommitmentsResponse is the request type for the @@ -507,7 +510,7 @@ export interface QueryPacketCommitmentsRequestSDKType { export interface QueryPacketCommitmentsResponse { commitments: PacketState[]; /** pagination response */ - pagination: PageResponse; + pagination?: PageResponse; /** query block height */ height: Height; } @@ -520,7 +523,7 @@ export interface QueryPacketCommitmentsResponseProtoMsg { * Query/QueryPacketCommitments RPC method */ export interface QueryPacketCommitmentsResponseAmino { - commitments: PacketStateAmino[]; + commitments?: PacketStateAmino[]; /** pagination response */ pagination?: PageResponseAmino; /** query block height */ @@ -536,7 +539,7 @@ export interface QueryPacketCommitmentsResponseAminoMsg { */ export interface QueryPacketCommitmentsResponseSDKType { commitments: PacketStateSDKType[]; - pagination: PageResponseSDKType; + pagination?: PageResponseSDKType; height: HeightSDKType; } /** @@ -561,11 +564,11 @@ export interface QueryPacketReceiptRequestProtoMsg { */ export interface QueryPacketReceiptRequestAmino { /** port unique identifier */ - port_id: string; + port_id?: string; /** channel unique identifier */ - channel_id: string; + channel_id?: string; /** packet sequence */ - sequence: string; + sequence?: string; } export interface QueryPacketReceiptRequestAminoMsg { type: "cosmos-sdk/QueryPacketReceiptRequest"; @@ -604,9 +607,9 @@ export interface QueryPacketReceiptResponseProtoMsg { */ export interface QueryPacketReceiptResponseAmino { /** success flag for if receipt exists */ - received: boolean; + received?: boolean; /** merkle proof of existence */ - proof: Uint8Array; + proof?: string; /** height at which the proof was retrieved */ proof_height?: HeightAmino; } @@ -646,11 +649,11 @@ export interface QueryPacketAcknowledgementRequestProtoMsg { */ export interface QueryPacketAcknowledgementRequestAmino { /** port unique identifier */ - port_id: string; + port_id?: string; /** channel unique identifier */ - channel_id: string; + channel_id?: string; /** packet sequence */ - sequence: string; + sequence?: string; } export interface QueryPacketAcknowledgementRequestAminoMsg { type: "cosmos-sdk/QueryPacketAcknowledgementRequest"; @@ -689,9 +692,9 @@ export interface QueryPacketAcknowledgementResponseProtoMsg { */ export interface QueryPacketAcknowledgementResponseAmino { /** packet associated with the request fields */ - acknowledgement: Uint8Array; + acknowledgement?: string; /** merkle proof of existence */ - proof: Uint8Array; + proof?: string; /** height at which the proof was retrieved */ proof_height?: HeightAmino; } @@ -719,7 +722,7 @@ export interface QueryPacketAcknowledgementsRequest { /** channel unique identifier */ channelId: string; /** pagination request */ - pagination: PageRequest; + pagination?: PageRequest; /** list of packet sequences */ packetCommitmentSequences: bigint[]; } @@ -733,13 +736,13 @@ export interface QueryPacketAcknowledgementsRequestProtoMsg { */ export interface QueryPacketAcknowledgementsRequestAmino { /** port unique identifier */ - port_id: string; + port_id?: string; /** channel unique identifier */ - channel_id: string; + channel_id?: string; /** pagination request */ pagination?: PageRequestAmino; /** list of packet sequences */ - packet_commitment_sequences: string[]; + packet_commitment_sequences?: string[]; } export interface QueryPacketAcknowledgementsRequestAminoMsg { type: "cosmos-sdk/QueryPacketAcknowledgementsRequest"; @@ -752,7 +755,7 @@ export interface QueryPacketAcknowledgementsRequestAminoMsg { export interface QueryPacketAcknowledgementsRequestSDKType { port_id: string; channel_id: string; - pagination: PageRequestSDKType; + pagination?: PageRequestSDKType; packet_commitment_sequences: bigint[]; } /** @@ -762,7 +765,7 @@ export interface QueryPacketAcknowledgementsRequestSDKType { export interface QueryPacketAcknowledgementsResponse { acknowledgements: PacketState[]; /** pagination response */ - pagination: PageResponse; + pagination?: PageResponse; /** query block height */ height: Height; } @@ -775,7 +778,7 @@ export interface QueryPacketAcknowledgementsResponseProtoMsg { * Query/QueryPacketAcknowledgements RPC method */ export interface QueryPacketAcknowledgementsResponseAmino { - acknowledgements: PacketStateAmino[]; + acknowledgements?: PacketStateAmino[]; /** pagination response */ pagination?: PageResponseAmino; /** query block height */ @@ -791,7 +794,7 @@ export interface QueryPacketAcknowledgementsResponseAminoMsg { */ export interface QueryPacketAcknowledgementsResponseSDKType { acknowledgements: PacketStateSDKType[]; - pagination: PageResponseSDKType; + pagination?: PageResponseSDKType; height: HeightSDKType; } /** @@ -816,11 +819,11 @@ export interface QueryUnreceivedPacketsRequestProtoMsg { */ export interface QueryUnreceivedPacketsRequestAmino { /** port unique identifier */ - port_id: string; + port_id?: string; /** channel unique identifier */ - channel_id: string; + channel_id?: string; /** list of packet sequences */ - packet_commitment_sequences: string[]; + packet_commitment_sequences?: string[]; } export interface QueryUnreceivedPacketsRequestAminoMsg { type: "cosmos-sdk/QueryUnreceivedPacketsRequest"; @@ -855,7 +858,7 @@ export interface QueryUnreceivedPacketsResponseProtoMsg { */ export interface QueryUnreceivedPacketsResponseAmino { /** list of unreceived packet sequences */ - sequences: string[]; + sequences?: string[]; /** query block height */ height?: HeightAmino; } @@ -893,11 +896,11 @@ export interface QueryUnreceivedAcksRequestProtoMsg { */ export interface QueryUnreceivedAcksRequestAmino { /** port unique identifier */ - port_id: string; + port_id?: string; /** channel unique identifier */ - channel_id: string; + channel_id?: string; /** list of acknowledgement sequences */ - packet_ack_sequences: string[]; + packet_ack_sequences?: string[]; } export interface QueryUnreceivedAcksRequestAminoMsg { type: "cosmos-sdk/QueryUnreceivedAcksRequest"; @@ -932,7 +935,7 @@ export interface QueryUnreceivedAcksResponseProtoMsg { */ export interface QueryUnreceivedAcksResponseAmino { /** list of unreceived acknowledgement sequences */ - sequences: string[]; + sequences?: string[]; /** query block height */ height?: HeightAmino; } @@ -968,9 +971,9 @@ export interface QueryNextSequenceReceiveRequestProtoMsg { */ export interface QueryNextSequenceReceiveRequestAmino { /** port unique identifier */ - port_id: string; + port_id?: string; /** channel unique identifier */ - channel_id: string; + channel_id?: string; } export interface QueryNextSequenceReceiveRequestAminoMsg { type: "cosmos-sdk/QueryNextSequenceReceiveRequest"; @@ -985,7 +988,7 @@ export interface QueryNextSequenceReceiveRequestSDKType { channel_id: string; } /** - * QuerySequenceResponse is the request type for the + * QuerySequenceResponse is the response type for the * Query/QueryNextSequenceReceiveResponse RPC method */ export interface QueryNextSequenceReceiveResponse { @@ -1001,14 +1004,14 @@ export interface QueryNextSequenceReceiveResponseProtoMsg { value: Uint8Array; } /** - * QuerySequenceResponse is the request type for the + * QuerySequenceResponse is the response type for the * Query/QueryNextSequenceReceiveResponse RPC method */ export interface QueryNextSequenceReceiveResponseAmino { /** next sequence receive number */ - next_sequence_receive: string; + next_sequence_receive?: string; /** merkle proof of existence */ - proof: Uint8Array; + proof?: string; /** height at which the proof was retrieved */ proof_height?: HeightAmino; } @@ -1017,7 +1020,7 @@ export interface QueryNextSequenceReceiveResponseAminoMsg { value: QueryNextSequenceReceiveResponseAmino; } /** - * QuerySequenceResponse is the request type for the + * QuerySequenceResponse is the response type for the * Query/QueryNextSequenceReceiveResponse RPC method */ export interface QueryNextSequenceReceiveResponseSDKType { @@ -1025,6 +1028,225 @@ export interface QueryNextSequenceReceiveResponseSDKType { proof: Uint8Array; proof_height: HeightSDKType; } +/** + * QueryNextSequenceSendRequest is the request type for the + * Query/QueryNextSequenceSend RPC method + */ +export interface QueryNextSequenceSendRequest { + /** port unique identifier */ + portId: string; + /** channel unique identifier */ + channelId: string; +} +export interface QueryNextSequenceSendRequestProtoMsg { + typeUrl: "/ibc.core.channel.v1.QueryNextSequenceSendRequest"; + value: Uint8Array; +} +/** + * QueryNextSequenceSendRequest is the request type for the + * Query/QueryNextSequenceSend RPC method + */ +export interface QueryNextSequenceSendRequestAmino { + /** port unique identifier */ + port_id?: string; + /** channel unique identifier */ + channel_id?: string; +} +export interface QueryNextSequenceSendRequestAminoMsg { + type: "cosmos-sdk/QueryNextSequenceSendRequest"; + value: QueryNextSequenceSendRequestAmino; +} +/** + * QueryNextSequenceSendRequest is the request type for the + * Query/QueryNextSequenceSend RPC method + */ +export interface QueryNextSequenceSendRequestSDKType { + port_id: string; + channel_id: string; +} +/** + * QueryNextSequenceSendResponse is the request type for the + * Query/QueryNextSequenceSend RPC method + */ +export interface QueryNextSequenceSendResponse { + /** next sequence send number */ + nextSequenceSend: bigint; + /** merkle proof of existence */ + proof: Uint8Array; + /** height at which the proof was retrieved */ + proofHeight: Height; +} +export interface QueryNextSequenceSendResponseProtoMsg { + typeUrl: "/ibc.core.channel.v1.QueryNextSequenceSendResponse"; + value: Uint8Array; +} +/** + * QueryNextSequenceSendResponse is the request type for the + * Query/QueryNextSequenceSend RPC method + */ +export interface QueryNextSequenceSendResponseAmino { + /** next sequence send number */ + next_sequence_send?: string; + /** merkle proof of existence */ + proof?: string; + /** height at which the proof was retrieved */ + proof_height?: HeightAmino; +} +export interface QueryNextSequenceSendResponseAminoMsg { + type: "cosmos-sdk/QueryNextSequenceSendResponse"; + value: QueryNextSequenceSendResponseAmino; +} +/** + * QueryNextSequenceSendResponse is the request type for the + * Query/QueryNextSequenceSend RPC method + */ +export interface QueryNextSequenceSendResponseSDKType { + next_sequence_send: bigint; + proof: Uint8Array; + proof_height: HeightSDKType; +} +/** QueryUpgradeErrorRequest is the request type for the Query/QueryUpgradeError RPC method */ +export interface QueryUpgradeErrorRequest { + portId: string; + channelId: string; +} +export interface QueryUpgradeErrorRequestProtoMsg { + typeUrl: "/ibc.core.channel.v1.QueryUpgradeErrorRequest"; + value: Uint8Array; +} +/** QueryUpgradeErrorRequest is the request type for the Query/QueryUpgradeError RPC method */ +export interface QueryUpgradeErrorRequestAmino { + port_id?: string; + channel_id?: string; +} +export interface QueryUpgradeErrorRequestAminoMsg { + type: "cosmos-sdk/QueryUpgradeErrorRequest"; + value: QueryUpgradeErrorRequestAmino; +} +/** QueryUpgradeErrorRequest is the request type for the Query/QueryUpgradeError RPC method */ +export interface QueryUpgradeErrorRequestSDKType { + port_id: string; + channel_id: string; +} +/** QueryUpgradeErrorResponse is the response type for the Query/QueryUpgradeError RPC method */ +export interface QueryUpgradeErrorResponse { + errorReceipt: ErrorReceipt; + /** merkle proof of existence */ + proof: Uint8Array; + /** height at which the proof was retrieved */ + proofHeight: Height; +} +export interface QueryUpgradeErrorResponseProtoMsg { + typeUrl: "/ibc.core.channel.v1.QueryUpgradeErrorResponse"; + value: Uint8Array; +} +/** QueryUpgradeErrorResponse is the response type for the Query/QueryUpgradeError RPC method */ +export interface QueryUpgradeErrorResponseAmino { + error_receipt?: ErrorReceiptAmino; + /** merkle proof of existence */ + proof?: string; + /** height at which the proof was retrieved */ + proof_height?: HeightAmino; +} +export interface QueryUpgradeErrorResponseAminoMsg { + type: "cosmos-sdk/QueryUpgradeErrorResponse"; + value: QueryUpgradeErrorResponseAmino; +} +/** QueryUpgradeErrorResponse is the response type for the Query/QueryUpgradeError RPC method */ +export interface QueryUpgradeErrorResponseSDKType { + error_receipt: ErrorReceiptSDKType; + proof: Uint8Array; + proof_height: HeightSDKType; +} +/** QueryUpgradeRequest is the request type for the QueryUpgradeRequest RPC method */ +export interface QueryUpgradeRequest { + portId: string; + channelId: string; +} +export interface QueryUpgradeRequestProtoMsg { + typeUrl: "/ibc.core.channel.v1.QueryUpgradeRequest"; + value: Uint8Array; +} +/** QueryUpgradeRequest is the request type for the QueryUpgradeRequest RPC method */ +export interface QueryUpgradeRequestAmino { + port_id?: string; + channel_id?: string; +} +export interface QueryUpgradeRequestAminoMsg { + type: "cosmos-sdk/QueryUpgradeRequest"; + value: QueryUpgradeRequestAmino; +} +/** QueryUpgradeRequest is the request type for the QueryUpgradeRequest RPC method */ +export interface QueryUpgradeRequestSDKType { + port_id: string; + channel_id: string; +} +/** QueryUpgradeResponse is the response type for the QueryUpgradeResponse RPC method */ +export interface QueryUpgradeResponse { + upgrade: Upgrade; + /** merkle proof of existence */ + proof: Uint8Array; + /** height at which the proof was retrieved */ + proofHeight: Height; +} +export interface QueryUpgradeResponseProtoMsg { + typeUrl: "/ibc.core.channel.v1.QueryUpgradeResponse"; + value: Uint8Array; +} +/** QueryUpgradeResponse is the response type for the QueryUpgradeResponse RPC method */ +export interface QueryUpgradeResponseAmino { + upgrade?: UpgradeAmino; + /** merkle proof of existence */ + proof?: string; + /** height at which the proof was retrieved */ + proof_height?: HeightAmino; +} +export interface QueryUpgradeResponseAminoMsg { + type: "cosmos-sdk/QueryUpgradeResponse"; + value: QueryUpgradeResponseAmino; +} +/** QueryUpgradeResponse is the response type for the QueryUpgradeResponse RPC method */ +export interface QueryUpgradeResponseSDKType { + upgrade: UpgradeSDKType; + proof: Uint8Array; + proof_height: HeightSDKType; +} +/** QueryChannelParamsRequest is the request type for the Query/ChannelParams RPC method. */ +export interface QueryChannelParamsRequest {} +export interface QueryChannelParamsRequestProtoMsg { + typeUrl: "/ibc.core.channel.v1.QueryChannelParamsRequest"; + value: Uint8Array; +} +/** QueryChannelParamsRequest is the request type for the Query/ChannelParams RPC method. */ +export interface QueryChannelParamsRequestAmino {} +export interface QueryChannelParamsRequestAminoMsg { + type: "cosmos-sdk/QueryChannelParamsRequest"; + value: QueryChannelParamsRequestAmino; +} +/** QueryChannelParamsRequest is the request type for the Query/ChannelParams RPC method. */ +export interface QueryChannelParamsRequestSDKType {} +/** QueryChannelParamsResponse is the response type for the Query/ChannelParams RPC method. */ +export interface QueryChannelParamsResponse { + /** params defines the parameters of the module. */ + params?: Params; +} +export interface QueryChannelParamsResponseProtoMsg { + typeUrl: "/ibc.core.channel.v1.QueryChannelParamsResponse"; + value: Uint8Array; +} +/** QueryChannelParamsResponse is the response type for the Query/ChannelParams RPC method. */ +export interface QueryChannelParamsResponseAmino { + /** params defines the parameters of the module. */ + params?: ParamsAmino; +} +export interface QueryChannelParamsResponseAminoMsg { + type: "cosmos-sdk/QueryChannelParamsResponse"; + value: QueryChannelParamsResponseAmino; +} +/** QueryChannelParamsResponse is the response type for the Query/ChannelParams RPC method. */ +export interface QueryChannelParamsResponseSDKType { + params?: ParamsSDKType; +} function createBaseQueryChannelRequest(): QueryChannelRequest { return { portId: "", @@ -1033,6 +1255,16 @@ function createBaseQueryChannelRequest(): QueryChannelRequest { } export const QueryChannelRequest = { typeUrl: "/ibc.core.channel.v1.QueryChannelRequest", + aminoType: "cosmos-sdk/QueryChannelRequest", + is(o: any): o is QueryChannelRequest { + return o && (o.$typeUrl === QueryChannelRequest.typeUrl || typeof o.portId === "string" && typeof o.channelId === "string"); + }, + isSDK(o: any): o is QueryChannelRequestSDKType { + return o && (o.$typeUrl === QueryChannelRequest.typeUrl || typeof o.port_id === "string" && typeof o.channel_id === "string"); + }, + isAmino(o: any): o is QueryChannelRequestAmino { + return o && (o.$typeUrl === QueryChannelRequest.typeUrl || typeof o.port_id === "string" && typeof o.channel_id === "string"); + }, encode(message: QueryChannelRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.portId !== "") { writer.uint32(10).string(message.portId); @@ -1062,6 +1294,18 @@ export const QueryChannelRequest = { } return message; }, + fromJSON(object: any): QueryChannelRequest { + return { + portId: isSet(object.portId) ? String(object.portId) : "", + channelId: isSet(object.channelId) ? String(object.channelId) : "" + }; + }, + toJSON(message: QueryChannelRequest): unknown { + const obj: any = {}; + message.portId !== undefined && (obj.portId = message.portId); + message.channelId !== undefined && (obj.channelId = message.channelId); + return obj; + }, fromPartial(object: Partial): QueryChannelRequest { const message = createBaseQueryChannelRequest(); message.portId = object.portId ?? ""; @@ -1069,10 +1313,14 @@ export const QueryChannelRequest = { return message; }, fromAmino(object: QueryChannelRequestAmino): QueryChannelRequest { - return { - portId: object.port_id, - channelId: object.channel_id - }; + const message = createBaseQueryChannelRequest(); + if (object.port_id !== undefined && object.port_id !== null) { + message.portId = object.port_id; + } + if (object.channel_id !== undefined && object.channel_id !== null) { + message.channelId = object.channel_id; + } + return message; }, toAmino(message: QueryChannelRequest): QueryChannelRequestAmino { const obj: any = {}; @@ -1102,15 +1350,27 @@ export const QueryChannelRequest = { }; } }; +GlobalDecoderRegistry.register(QueryChannelRequest.typeUrl, QueryChannelRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryChannelRequest.aminoType, QueryChannelRequest.typeUrl); function createBaseQueryChannelResponse(): QueryChannelResponse { return { - channel: Channel.fromPartial({}), + channel: undefined, proof: new Uint8Array(), proofHeight: Height.fromPartial({}) }; } export const QueryChannelResponse = { typeUrl: "/ibc.core.channel.v1.QueryChannelResponse", + aminoType: "cosmos-sdk/QueryChannelResponse", + is(o: any): o is QueryChannelResponse { + return o && (o.$typeUrl === QueryChannelResponse.typeUrl || (o.proof instanceof Uint8Array || typeof o.proof === "string") && Height.is(o.proofHeight)); + }, + isSDK(o: any): o is QueryChannelResponseSDKType { + return o && (o.$typeUrl === QueryChannelResponse.typeUrl || (o.proof instanceof Uint8Array || typeof o.proof === "string") && Height.isSDK(o.proof_height)); + }, + isAmino(o: any): o is QueryChannelResponseAmino { + return o && (o.$typeUrl === QueryChannelResponse.typeUrl || (o.proof instanceof Uint8Array || typeof o.proof === "string") && Height.isAmino(o.proof_height)); + }, encode(message: QueryChannelResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.channel !== undefined) { Channel.encode(message.channel, writer.uint32(10).fork()).ldelim(); @@ -1146,6 +1406,20 @@ export const QueryChannelResponse = { } return message; }, + fromJSON(object: any): QueryChannelResponse { + return { + channel: isSet(object.channel) ? Channel.fromJSON(object.channel) : undefined, + proof: isSet(object.proof) ? bytesFromBase64(object.proof) : new Uint8Array(), + proofHeight: isSet(object.proofHeight) ? Height.fromJSON(object.proofHeight) : undefined + }; + }, + toJSON(message: QueryChannelResponse): unknown { + const obj: any = {}; + message.channel !== undefined && (obj.channel = message.channel ? Channel.toJSON(message.channel) : undefined); + message.proof !== undefined && (obj.proof = base64FromBytes(message.proof !== undefined ? message.proof : new Uint8Array())); + message.proofHeight !== undefined && (obj.proofHeight = message.proofHeight ? Height.toJSON(message.proofHeight) : undefined); + return obj; + }, fromPartial(object: Partial): QueryChannelResponse { const message = createBaseQueryChannelResponse(); message.channel = object.channel !== undefined && object.channel !== null ? Channel.fromPartial(object.channel) : undefined; @@ -1154,16 +1428,22 @@ export const QueryChannelResponse = { return message; }, fromAmino(object: QueryChannelResponseAmino): QueryChannelResponse { - return { - channel: object?.channel ? Channel.fromAmino(object.channel) : undefined, - proof: object.proof, - proofHeight: object?.proof_height ? Height.fromAmino(object.proof_height) : undefined - }; + const message = createBaseQueryChannelResponse(); + if (object.channel !== undefined && object.channel !== null) { + message.channel = Channel.fromAmino(object.channel); + } + if (object.proof !== undefined && object.proof !== null) { + message.proof = bytesFromBase64(object.proof); + } + if (object.proof_height !== undefined && object.proof_height !== null) { + message.proofHeight = Height.fromAmino(object.proof_height); + } + return message; }, toAmino(message: QueryChannelResponse): QueryChannelResponseAmino { const obj: any = {}; obj.channel = message.channel ? Channel.toAmino(message.channel) : undefined; - obj.proof = message.proof; + obj.proof = message.proof ? base64FromBytes(message.proof) : undefined; obj.proof_height = message.proofHeight ? Height.toAmino(message.proofHeight) : {}; return obj; }, @@ -1189,13 +1469,25 @@ export const QueryChannelResponse = { }; } }; +GlobalDecoderRegistry.register(QueryChannelResponse.typeUrl, QueryChannelResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryChannelResponse.aminoType, QueryChannelResponse.typeUrl); function createBaseQueryChannelsRequest(): QueryChannelsRequest { return { - pagination: PageRequest.fromPartial({}) + pagination: undefined }; } export const QueryChannelsRequest = { typeUrl: "/ibc.core.channel.v1.QueryChannelsRequest", + aminoType: "cosmos-sdk/QueryChannelsRequest", + is(o: any): o is QueryChannelsRequest { + return o && o.$typeUrl === QueryChannelsRequest.typeUrl; + }, + isSDK(o: any): o is QueryChannelsRequestSDKType { + return o && o.$typeUrl === QueryChannelsRequest.typeUrl; + }, + isAmino(o: any): o is QueryChannelsRequestAmino { + return o && o.$typeUrl === QueryChannelsRequest.typeUrl; + }, encode(message: QueryChannelsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.pagination !== undefined) { PageRequest.encode(message.pagination, writer.uint32(10).fork()).ldelim(); @@ -1219,15 +1511,27 @@ export const QueryChannelsRequest = { } return message; }, + fromJSON(object: any): QueryChannelsRequest { + return { + pagination: isSet(object.pagination) ? PageRequest.fromJSON(object.pagination) : undefined + }; + }, + toJSON(message: QueryChannelsRequest): unknown { + const obj: any = {}; + message.pagination !== undefined && (obj.pagination = message.pagination ? PageRequest.toJSON(message.pagination) : undefined); + return obj; + }, fromPartial(object: Partial): QueryChannelsRequest { const message = createBaseQueryChannelsRequest(); message.pagination = object.pagination !== undefined && object.pagination !== null ? PageRequest.fromPartial(object.pagination) : undefined; return message; }, fromAmino(object: QueryChannelsRequestAmino): QueryChannelsRequest { - return { - pagination: object?.pagination ? PageRequest.fromAmino(object.pagination) : undefined - }; + const message = createBaseQueryChannelsRequest(); + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromAmino(object.pagination); + } + return message; }, toAmino(message: QueryChannelsRequest): QueryChannelsRequestAmino { const obj: any = {}; @@ -1256,15 +1560,27 @@ export const QueryChannelsRequest = { }; } }; +GlobalDecoderRegistry.register(QueryChannelsRequest.typeUrl, QueryChannelsRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryChannelsRequest.aminoType, QueryChannelsRequest.typeUrl); function createBaseQueryChannelsResponse(): QueryChannelsResponse { return { channels: [], - pagination: PageResponse.fromPartial({}), + pagination: undefined, height: Height.fromPartial({}) }; } export const QueryChannelsResponse = { typeUrl: "/ibc.core.channel.v1.QueryChannelsResponse", + aminoType: "cosmos-sdk/QueryChannelsResponse", + is(o: any): o is QueryChannelsResponse { + return o && (o.$typeUrl === QueryChannelsResponse.typeUrl || Array.isArray(o.channels) && (!o.channels.length || IdentifiedChannel.is(o.channels[0])) && Height.is(o.height)); + }, + isSDK(o: any): o is QueryChannelsResponseSDKType { + return o && (o.$typeUrl === QueryChannelsResponse.typeUrl || Array.isArray(o.channels) && (!o.channels.length || IdentifiedChannel.isSDK(o.channels[0])) && Height.isSDK(o.height)); + }, + isAmino(o: any): o is QueryChannelsResponseAmino { + return o && (o.$typeUrl === QueryChannelsResponse.typeUrl || Array.isArray(o.channels) && (!o.channels.length || IdentifiedChannel.isAmino(o.channels[0])) && Height.isAmino(o.height)); + }, encode(message: QueryChannelsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.channels) { IdentifiedChannel.encode(v!, writer.uint32(10).fork()).ldelim(); @@ -1300,6 +1616,24 @@ export const QueryChannelsResponse = { } return message; }, + fromJSON(object: any): QueryChannelsResponse { + return { + channels: Array.isArray(object?.channels) ? object.channels.map((e: any) => IdentifiedChannel.fromJSON(e)) : [], + pagination: isSet(object.pagination) ? PageResponse.fromJSON(object.pagination) : undefined, + height: isSet(object.height) ? Height.fromJSON(object.height) : undefined + }; + }, + toJSON(message: QueryChannelsResponse): unknown { + const obj: any = {}; + if (message.channels) { + obj.channels = message.channels.map(e => e ? IdentifiedChannel.toJSON(e) : undefined); + } else { + obj.channels = []; + } + message.pagination !== undefined && (obj.pagination = message.pagination ? PageResponse.toJSON(message.pagination) : undefined); + message.height !== undefined && (obj.height = message.height ? Height.toJSON(message.height) : undefined); + return obj; + }, fromPartial(object: Partial): QueryChannelsResponse { const message = createBaseQueryChannelsResponse(); message.channels = object.channels?.map(e => IdentifiedChannel.fromPartial(e)) || []; @@ -1308,11 +1642,15 @@ export const QueryChannelsResponse = { return message; }, fromAmino(object: QueryChannelsResponseAmino): QueryChannelsResponse { - return { - channels: Array.isArray(object?.channels) ? object.channels.map((e: any) => IdentifiedChannel.fromAmino(e)) : [], - pagination: object?.pagination ? PageResponse.fromAmino(object.pagination) : undefined, - height: object?.height ? Height.fromAmino(object.height) : undefined - }; + const message = createBaseQueryChannelsResponse(); + message.channels = object.channels?.map(e => IdentifiedChannel.fromAmino(e)) || []; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromAmino(object.pagination); + } + if (object.height !== undefined && object.height !== null) { + message.height = Height.fromAmino(object.height); + } + return message; }, toAmino(message: QueryChannelsResponse): QueryChannelsResponseAmino { const obj: any = {}; @@ -1347,14 +1685,26 @@ export const QueryChannelsResponse = { }; } }; +GlobalDecoderRegistry.register(QueryChannelsResponse.typeUrl, QueryChannelsResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryChannelsResponse.aminoType, QueryChannelsResponse.typeUrl); function createBaseQueryConnectionChannelsRequest(): QueryConnectionChannelsRequest { return { connection: "", - pagination: PageRequest.fromPartial({}) + pagination: undefined }; } export const QueryConnectionChannelsRequest = { typeUrl: "/ibc.core.channel.v1.QueryConnectionChannelsRequest", + aminoType: "cosmos-sdk/QueryConnectionChannelsRequest", + is(o: any): o is QueryConnectionChannelsRequest { + return o && (o.$typeUrl === QueryConnectionChannelsRequest.typeUrl || typeof o.connection === "string"); + }, + isSDK(o: any): o is QueryConnectionChannelsRequestSDKType { + return o && (o.$typeUrl === QueryConnectionChannelsRequest.typeUrl || typeof o.connection === "string"); + }, + isAmino(o: any): o is QueryConnectionChannelsRequestAmino { + return o && (o.$typeUrl === QueryConnectionChannelsRequest.typeUrl || typeof o.connection === "string"); + }, encode(message: QueryConnectionChannelsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.connection !== "") { writer.uint32(10).string(message.connection); @@ -1384,6 +1734,18 @@ export const QueryConnectionChannelsRequest = { } return message; }, + fromJSON(object: any): QueryConnectionChannelsRequest { + return { + connection: isSet(object.connection) ? String(object.connection) : "", + pagination: isSet(object.pagination) ? PageRequest.fromJSON(object.pagination) : undefined + }; + }, + toJSON(message: QueryConnectionChannelsRequest): unknown { + const obj: any = {}; + message.connection !== undefined && (obj.connection = message.connection); + message.pagination !== undefined && (obj.pagination = message.pagination ? PageRequest.toJSON(message.pagination) : undefined); + return obj; + }, fromPartial(object: Partial): QueryConnectionChannelsRequest { const message = createBaseQueryConnectionChannelsRequest(); message.connection = object.connection ?? ""; @@ -1391,10 +1753,14 @@ export const QueryConnectionChannelsRequest = { return message; }, fromAmino(object: QueryConnectionChannelsRequestAmino): QueryConnectionChannelsRequest { - return { - connection: object.connection, - pagination: object?.pagination ? PageRequest.fromAmino(object.pagination) : undefined - }; + const message = createBaseQueryConnectionChannelsRequest(); + if (object.connection !== undefined && object.connection !== null) { + message.connection = object.connection; + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromAmino(object.pagination); + } + return message; }, toAmino(message: QueryConnectionChannelsRequest): QueryConnectionChannelsRequestAmino { const obj: any = {}; @@ -1424,15 +1790,27 @@ export const QueryConnectionChannelsRequest = { }; } }; +GlobalDecoderRegistry.register(QueryConnectionChannelsRequest.typeUrl, QueryConnectionChannelsRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryConnectionChannelsRequest.aminoType, QueryConnectionChannelsRequest.typeUrl); function createBaseQueryConnectionChannelsResponse(): QueryConnectionChannelsResponse { return { channels: [], - pagination: PageResponse.fromPartial({}), + pagination: undefined, height: Height.fromPartial({}) }; } export const QueryConnectionChannelsResponse = { typeUrl: "/ibc.core.channel.v1.QueryConnectionChannelsResponse", + aminoType: "cosmos-sdk/QueryConnectionChannelsResponse", + is(o: any): o is QueryConnectionChannelsResponse { + return o && (o.$typeUrl === QueryConnectionChannelsResponse.typeUrl || Array.isArray(o.channels) && (!o.channels.length || IdentifiedChannel.is(o.channels[0])) && Height.is(o.height)); + }, + isSDK(o: any): o is QueryConnectionChannelsResponseSDKType { + return o && (o.$typeUrl === QueryConnectionChannelsResponse.typeUrl || Array.isArray(o.channels) && (!o.channels.length || IdentifiedChannel.isSDK(o.channels[0])) && Height.isSDK(o.height)); + }, + isAmino(o: any): o is QueryConnectionChannelsResponseAmino { + return o && (o.$typeUrl === QueryConnectionChannelsResponse.typeUrl || Array.isArray(o.channels) && (!o.channels.length || IdentifiedChannel.isAmino(o.channels[0])) && Height.isAmino(o.height)); + }, encode(message: QueryConnectionChannelsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.channels) { IdentifiedChannel.encode(v!, writer.uint32(10).fork()).ldelim(); @@ -1468,6 +1846,24 @@ export const QueryConnectionChannelsResponse = { } return message; }, + fromJSON(object: any): QueryConnectionChannelsResponse { + return { + channels: Array.isArray(object?.channels) ? object.channels.map((e: any) => IdentifiedChannel.fromJSON(e)) : [], + pagination: isSet(object.pagination) ? PageResponse.fromJSON(object.pagination) : undefined, + height: isSet(object.height) ? Height.fromJSON(object.height) : undefined + }; + }, + toJSON(message: QueryConnectionChannelsResponse): unknown { + const obj: any = {}; + if (message.channels) { + obj.channels = message.channels.map(e => e ? IdentifiedChannel.toJSON(e) : undefined); + } else { + obj.channels = []; + } + message.pagination !== undefined && (obj.pagination = message.pagination ? PageResponse.toJSON(message.pagination) : undefined); + message.height !== undefined && (obj.height = message.height ? Height.toJSON(message.height) : undefined); + return obj; + }, fromPartial(object: Partial): QueryConnectionChannelsResponse { const message = createBaseQueryConnectionChannelsResponse(); message.channels = object.channels?.map(e => IdentifiedChannel.fromPartial(e)) || []; @@ -1476,11 +1872,15 @@ export const QueryConnectionChannelsResponse = { return message; }, fromAmino(object: QueryConnectionChannelsResponseAmino): QueryConnectionChannelsResponse { - return { - channels: Array.isArray(object?.channels) ? object.channels.map((e: any) => IdentifiedChannel.fromAmino(e)) : [], - pagination: object?.pagination ? PageResponse.fromAmino(object.pagination) : undefined, - height: object?.height ? Height.fromAmino(object.height) : undefined - }; + const message = createBaseQueryConnectionChannelsResponse(); + message.channels = object.channels?.map(e => IdentifiedChannel.fromAmino(e)) || []; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromAmino(object.pagination); + } + if (object.height !== undefined && object.height !== null) { + message.height = Height.fromAmino(object.height); + } + return message; }, toAmino(message: QueryConnectionChannelsResponse): QueryConnectionChannelsResponseAmino { const obj: any = {}; @@ -1515,6 +1915,8 @@ export const QueryConnectionChannelsResponse = { }; } }; +GlobalDecoderRegistry.register(QueryConnectionChannelsResponse.typeUrl, QueryConnectionChannelsResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryConnectionChannelsResponse.aminoType, QueryConnectionChannelsResponse.typeUrl); function createBaseQueryChannelClientStateRequest(): QueryChannelClientStateRequest { return { portId: "", @@ -1523,6 +1925,16 @@ function createBaseQueryChannelClientStateRequest(): QueryChannelClientStateRequ } export const QueryChannelClientStateRequest = { typeUrl: "/ibc.core.channel.v1.QueryChannelClientStateRequest", + aminoType: "cosmos-sdk/QueryChannelClientStateRequest", + is(o: any): o is QueryChannelClientStateRequest { + return o && (o.$typeUrl === QueryChannelClientStateRequest.typeUrl || typeof o.portId === "string" && typeof o.channelId === "string"); + }, + isSDK(o: any): o is QueryChannelClientStateRequestSDKType { + return o && (o.$typeUrl === QueryChannelClientStateRequest.typeUrl || typeof o.port_id === "string" && typeof o.channel_id === "string"); + }, + isAmino(o: any): o is QueryChannelClientStateRequestAmino { + return o && (o.$typeUrl === QueryChannelClientStateRequest.typeUrl || typeof o.port_id === "string" && typeof o.channel_id === "string"); + }, encode(message: QueryChannelClientStateRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.portId !== "") { writer.uint32(10).string(message.portId); @@ -1552,6 +1964,18 @@ export const QueryChannelClientStateRequest = { } return message; }, + fromJSON(object: any): QueryChannelClientStateRequest { + return { + portId: isSet(object.portId) ? String(object.portId) : "", + channelId: isSet(object.channelId) ? String(object.channelId) : "" + }; + }, + toJSON(message: QueryChannelClientStateRequest): unknown { + const obj: any = {}; + message.portId !== undefined && (obj.portId = message.portId); + message.channelId !== undefined && (obj.channelId = message.channelId); + return obj; + }, fromPartial(object: Partial): QueryChannelClientStateRequest { const message = createBaseQueryChannelClientStateRequest(); message.portId = object.portId ?? ""; @@ -1559,10 +1983,14 @@ export const QueryChannelClientStateRequest = { return message; }, fromAmino(object: QueryChannelClientStateRequestAmino): QueryChannelClientStateRequest { - return { - portId: object.port_id, - channelId: object.channel_id - }; + const message = createBaseQueryChannelClientStateRequest(); + if (object.port_id !== undefined && object.port_id !== null) { + message.portId = object.port_id; + } + if (object.channel_id !== undefined && object.channel_id !== null) { + message.channelId = object.channel_id; + } + return message; }, toAmino(message: QueryChannelClientStateRequest): QueryChannelClientStateRequestAmino { const obj: any = {}; @@ -1592,15 +2020,27 @@ export const QueryChannelClientStateRequest = { }; } }; +GlobalDecoderRegistry.register(QueryChannelClientStateRequest.typeUrl, QueryChannelClientStateRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryChannelClientStateRequest.aminoType, QueryChannelClientStateRequest.typeUrl); function createBaseQueryChannelClientStateResponse(): QueryChannelClientStateResponse { return { - identifiedClientState: IdentifiedClientState.fromPartial({}), + identifiedClientState: undefined, proof: new Uint8Array(), proofHeight: Height.fromPartial({}) }; } export const QueryChannelClientStateResponse = { typeUrl: "/ibc.core.channel.v1.QueryChannelClientStateResponse", + aminoType: "cosmos-sdk/QueryChannelClientStateResponse", + is(o: any): o is QueryChannelClientStateResponse { + return o && (o.$typeUrl === QueryChannelClientStateResponse.typeUrl || (o.proof instanceof Uint8Array || typeof o.proof === "string") && Height.is(o.proofHeight)); + }, + isSDK(o: any): o is QueryChannelClientStateResponseSDKType { + return o && (o.$typeUrl === QueryChannelClientStateResponse.typeUrl || (o.proof instanceof Uint8Array || typeof o.proof === "string") && Height.isSDK(o.proof_height)); + }, + isAmino(o: any): o is QueryChannelClientStateResponseAmino { + return o && (o.$typeUrl === QueryChannelClientStateResponse.typeUrl || (o.proof instanceof Uint8Array || typeof o.proof === "string") && Height.isAmino(o.proof_height)); + }, encode(message: QueryChannelClientStateResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.identifiedClientState !== undefined) { IdentifiedClientState.encode(message.identifiedClientState, writer.uint32(10).fork()).ldelim(); @@ -1636,6 +2076,20 @@ export const QueryChannelClientStateResponse = { } return message; }, + fromJSON(object: any): QueryChannelClientStateResponse { + return { + identifiedClientState: isSet(object.identifiedClientState) ? IdentifiedClientState.fromJSON(object.identifiedClientState) : undefined, + proof: isSet(object.proof) ? bytesFromBase64(object.proof) : new Uint8Array(), + proofHeight: isSet(object.proofHeight) ? Height.fromJSON(object.proofHeight) : undefined + }; + }, + toJSON(message: QueryChannelClientStateResponse): unknown { + const obj: any = {}; + message.identifiedClientState !== undefined && (obj.identifiedClientState = message.identifiedClientState ? IdentifiedClientState.toJSON(message.identifiedClientState) : undefined); + message.proof !== undefined && (obj.proof = base64FromBytes(message.proof !== undefined ? message.proof : new Uint8Array())); + message.proofHeight !== undefined && (obj.proofHeight = message.proofHeight ? Height.toJSON(message.proofHeight) : undefined); + return obj; + }, fromPartial(object: Partial): QueryChannelClientStateResponse { const message = createBaseQueryChannelClientStateResponse(); message.identifiedClientState = object.identifiedClientState !== undefined && object.identifiedClientState !== null ? IdentifiedClientState.fromPartial(object.identifiedClientState) : undefined; @@ -1644,16 +2098,22 @@ export const QueryChannelClientStateResponse = { return message; }, fromAmino(object: QueryChannelClientStateResponseAmino): QueryChannelClientStateResponse { - return { - identifiedClientState: object?.identified_client_state ? IdentifiedClientState.fromAmino(object.identified_client_state) : undefined, - proof: object.proof, - proofHeight: object?.proof_height ? Height.fromAmino(object.proof_height) : undefined - }; + const message = createBaseQueryChannelClientStateResponse(); + if (object.identified_client_state !== undefined && object.identified_client_state !== null) { + message.identifiedClientState = IdentifiedClientState.fromAmino(object.identified_client_state); + } + if (object.proof !== undefined && object.proof !== null) { + message.proof = bytesFromBase64(object.proof); + } + if (object.proof_height !== undefined && object.proof_height !== null) { + message.proofHeight = Height.fromAmino(object.proof_height); + } + return message; }, toAmino(message: QueryChannelClientStateResponse): QueryChannelClientStateResponseAmino { const obj: any = {}; obj.identified_client_state = message.identifiedClientState ? IdentifiedClientState.toAmino(message.identifiedClientState) : undefined; - obj.proof = message.proof; + obj.proof = message.proof ? base64FromBytes(message.proof) : undefined; obj.proof_height = message.proofHeight ? Height.toAmino(message.proofHeight) : {}; return obj; }, @@ -1679,6 +2139,8 @@ export const QueryChannelClientStateResponse = { }; } }; +GlobalDecoderRegistry.register(QueryChannelClientStateResponse.typeUrl, QueryChannelClientStateResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryChannelClientStateResponse.aminoType, QueryChannelClientStateResponse.typeUrl); function createBaseQueryChannelConsensusStateRequest(): QueryChannelConsensusStateRequest { return { portId: "", @@ -1689,6 +2151,16 @@ function createBaseQueryChannelConsensusStateRequest(): QueryChannelConsensusSta } export const QueryChannelConsensusStateRequest = { typeUrl: "/ibc.core.channel.v1.QueryChannelConsensusStateRequest", + aminoType: "cosmos-sdk/QueryChannelConsensusStateRequest", + is(o: any): o is QueryChannelConsensusStateRequest { + return o && (o.$typeUrl === QueryChannelConsensusStateRequest.typeUrl || typeof o.portId === "string" && typeof o.channelId === "string" && typeof o.revisionNumber === "bigint" && typeof o.revisionHeight === "bigint"); + }, + isSDK(o: any): o is QueryChannelConsensusStateRequestSDKType { + return o && (o.$typeUrl === QueryChannelConsensusStateRequest.typeUrl || typeof o.port_id === "string" && typeof o.channel_id === "string" && typeof o.revision_number === "bigint" && typeof o.revision_height === "bigint"); + }, + isAmino(o: any): o is QueryChannelConsensusStateRequestAmino { + return o && (o.$typeUrl === QueryChannelConsensusStateRequest.typeUrl || typeof o.port_id === "string" && typeof o.channel_id === "string" && typeof o.revision_number === "bigint" && typeof o.revision_height === "bigint"); + }, encode(message: QueryChannelConsensusStateRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.portId !== "") { writer.uint32(10).string(message.portId); @@ -1730,6 +2202,22 @@ export const QueryChannelConsensusStateRequest = { } return message; }, + fromJSON(object: any): QueryChannelConsensusStateRequest { + return { + portId: isSet(object.portId) ? String(object.portId) : "", + channelId: isSet(object.channelId) ? String(object.channelId) : "", + revisionNumber: isSet(object.revisionNumber) ? BigInt(object.revisionNumber.toString()) : BigInt(0), + revisionHeight: isSet(object.revisionHeight) ? BigInt(object.revisionHeight.toString()) : BigInt(0) + }; + }, + toJSON(message: QueryChannelConsensusStateRequest): unknown { + const obj: any = {}; + message.portId !== undefined && (obj.portId = message.portId); + message.channelId !== undefined && (obj.channelId = message.channelId); + message.revisionNumber !== undefined && (obj.revisionNumber = (message.revisionNumber || BigInt(0)).toString()); + message.revisionHeight !== undefined && (obj.revisionHeight = (message.revisionHeight || BigInt(0)).toString()); + return obj; + }, fromPartial(object: Partial): QueryChannelConsensusStateRequest { const message = createBaseQueryChannelConsensusStateRequest(); message.portId = object.portId ?? ""; @@ -1739,12 +2227,20 @@ export const QueryChannelConsensusStateRequest = { return message; }, fromAmino(object: QueryChannelConsensusStateRequestAmino): QueryChannelConsensusStateRequest { - return { - portId: object.port_id, - channelId: object.channel_id, - revisionNumber: BigInt(object.revision_number), - revisionHeight: BigInt(object.revision_height) - }; + const message = createBaseQueryChannelConsensusStateRequest(); + if (object.port_id !== undefined && object.port_id !== null) { + message.portId = object.port_id; + } + if (object.channel_id !== undefined && object.channel_id !== null) { + message.channelId = object.channel_id; + } + if (object.revision_number !== undefined && object.revision_number !== null) { + message.revisionNumber = BigInt(object.revision_number); + } + if (object.revision_height !== undefined && object.revision_height !== null) { + message.revisionHeight = BigInt(object.revision_height); + } + return message; }, toAmino(message: QueryChannelConsensusStateRequest): QueryChannelConsensusStateRequestAmino { const obj: any = {}; @@ -1776,6 +2272,8 @@ export const QueryChannelConsensusStateRequest = { }; } }; +GlobalDecoderRegistry.register(QueryChannelConsensusStateRequest.typeUrl, QueryChannelConsensusStateRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryChannelConsensusStateRequest.aminoType, QueryChannelConsensusStateRequest.typeUrl); function createBaseQueryChannelConsensusStateResponse(): QueryChannelConsensusStateResponse { return { consensusState: undefined, @@ -1786,6 +2284,16 @@ function createBaseQueryChannelConsensusStateResponse(): QueryChannelConsensusSt } export const QueryChannelConsensusStateResponse = { typeUrl: "/ibc.core.channel.v1.QueryChannelConsensusStateResponse", + aminoType: "cosmos-sdk/QueryChannelConsensusStateResponse", + is(o: any): o is QueryChannelConsensusStateResponse { + return o && (o.$typeUrl === QueryChannelConsensusStateResponse.typeUrl || typeof o.clientId === "string" && (o.proof instanceof Uint8Array || typeof o.proof === "string") && Height.is(o.proofHeight)); + }, + isSDK(o: any): o is QueryChannelConsensusStateResponseSDKType { + return o && (o.$typeUrl === QueryChannelConsensusStateResponse.typeUrl || typeof o.client_id === "string" && (o.proof instanceof Uint8Array || typeof o.proof === "string") && Height.isSDK(o.proof_height)); + }, + isAmino(o: any): o is QueryChannelConsensusStateResponseAmino { + return o && (o.$typeUrl === QueryChannelConsensusStateResponse.typeUrl || typeof o.client_id === "string" && (o.proof instanceof Uint8Array || typeof o.proof === "string") && Height.isAmino(o.proof_height)); + }, encode(message: QueryChannelConsensusStateResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.consensusState !== undefined) { Any.encode(message.consensusState, writer.uint32(10).fork()).ldelim(); @@ -1827,6 +2335,22 @@ export const QueryChannelConsensusStateResponse = { } return message; }, + fromJSON(object: any): QueryChannelConsensusStateResponse { + return { + consensusState: isSet(object.consensusState) ? Any.fromJSON(object.consensusState) : undefined, + clientId: isSet(object.clientId) ? String(object.clientId) : "", + proof: isSet(object.proof) ? bytesFromBase64(object.proof) : new Uint8Array(), + proofHeight: isSet(object.proofHeight) ? Height.fromJSON(object.proofHeight) : undefined + }; + }, + toJSON(message: QueryChannelConsensusStateResponse): unknown { + const obj: any = {}; + message.consensusState !== undefined && (obj.consensusState = message.consensusState ? Any.toJSON(message.consensusState) : undefined); + message.clientId !== undefined && (obj.clientId = message.clientId); + message.proof !== undefined && (obj.proof = base64FromBytes(message.proof !== undefined ? message.proof : new Uint8Array())); + message.proofHeight !== undefined && (obj.proofHeight = message.proofHeight ? Height.toJSON(message.proofHeight) : undefined); + return obj; + }, fromPartial(object: Partial): QueryChannelConsensusStateResponse { const message = createBaseQueryChannelConsensusStateResponse(); message.consensusState = object.consensusState !== undefined && object.consensusState !== null ? Any.fromPartial(object.consensusState) : undefined; @@ -1836,18 +2360,26 @@ export const QueryChannelConsensusStateResponse = { return message; }, fromAmino(object: QueryChannelConsensusStateResponseAmino): QueryChannelConsensusStateResponse { - return { - consensusState: object?.consensus_state ? Any.fromAmino(object.consensus_state) : undefined, - clientId: object.client_id, - proof: object.proof, - proofHeight: object?.proof_height ? Height.fromAmino(object.proof_height) : undefined - }; + const message = createBaseQueryChannelConsensusStateResponse(); + if (object.consensus_state !== undefined && object.consensus_state !== null) { + message.consensusState = Any.fromAmino(object.consensus_state); + } + if (object.client_id !== undefined && object.client_id !== null) { + message.clientId = object.client_id; + } + if (object.proof !== undefined && object.proof !== null) { + message.proof = bytesFromBase64(object.proof); + } + if (object.proof_height !== undefined && object.proof_height !== null) { + message.proofHeight = Height.fromAmino(object.proof_height); + } + return message; }, toAmino(message: QueryChannelConsensusStateResponse): QueryChannelConsensusStateResponseAmino { const obj: any = {}; obj.consensus_state = message.consensusState ? Any.toAmino(message.consensusState) : undefined; obj.client_id = message.clientId; - obj.proof = message.proof; + obj.proof = message.proof ? base64FromBytes(message.proof) : undefined; obj.proof_height = message.proofHeight ? Height.toAmino(message.proofHeight) : {}; return obj; }, @@ -1873,6 +2405,8 @@ export const QueryChannelConsensusStateResponse = { }; } }; +GlobalDecoderRegistry.register(QueryChannelConsensusStateResponse.typeUrl, QueryChannelConsensusStateResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryChannelConsensusStateResponse.aminoType, QueryChannelConsensusStateResponse.typeUrl); function createBaseQueryPacketCommitmentRequest(): QueryPacketCommitmentRequest { return { portId: "", @@ -1882,6 +2416,16 @@ function createBaseQueryPacketCommitmentRequest(): QueryPacketCommitmentRequest } export const QueryPacketCommitmentRequest = { typeUrl: "/ibc.core.channel.v1.QueryPacketCommitmentRequest", + aminoType: "cosmos-sdk/QueryPacketCommitmentRequest", + is(o: any): o is QueryPacketCommitmentRequest { + return o && (o.$typeUrl === QueryPacketCommitmentRequest.typeUrl || typeof o.portId === "string" && typeof o.channelId === "string" && typeof o.sequence === "bigint"); + }, + isSDK(o: any): o is QueryPacketCommitmentRequestSDKType { + return o && (o.$typeUrl === QueryPacketCommitmentRequest.typeUrl || typeof o.port_id === "string" && typeof o.channel_id === "string" && typeof o.sequence === "bigint"); + }, + isAmino(o: any): o is QueryPacketCommitmentRequestAmino { + return o && (o.$typeUrl === QueryPacketCommitmentRequest.typeUrl || typeof o.port_id === "string" && typeof o.channel_id === "string" && typeof o.sequence === "bigint"); + }, encode(message: QueryPacketCommitmentRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.portId !== "") { writer.uint32(10).string(message.portId); @@ -1917,6 +2461,20 @@ export const QueryPacketCommitmentRequest = { } return message; }, + fromJSON(object: any): QueryPacketCommitmentRequest { + return { + portId: isSet(object.portId) ? String(object.portId) : "", + channelId: isSet(object.channelId) ? String(object.channelId) : "", + sequence: isSet(object.sequence) ? BigInt(object.sequence.toString()) : BigInt(0) + }; + }, + toJSON(message: QueryPacketCommitmentRequest): unknown { + const obj: any = {}; + message.portId !== undefined && (obj.portId = message.portId); + message.channelId !== undefined && (obj.channelId = message.channelId); + message.sequence !== undefined && (obj.sequence = (message.sequence || BigInt(0)).toString()); + return obj; + }, fromPartial(object: Partial): QueryPacketCommitmentRequest { const message = createBaseQueryPacketCommitmentRequest(); message.portId = object.portId ?? ""; @@ -1925,11 +2483,17 @@ export const QueryPacketCommitmentRequest = { return message; }, fromAmino(object: QueryPacketCommitmentRequestAmino): QueryPacketCommitmentRequest { - return { - portId: object.port_id, - channelId: object.channel_id, - sequence: BigInt(object.sequence) - }; + const message = createBaseQueryPacketCommitmentRequest(); + if (object.port_id !== undefined && object.port_id !== null) { + message.portId = object.port_id; + } + if (object.channel_id !== undefined && object.channel_id !== null) { + message.channelId = object.channel_id; + } + if (object.sequence !== undefined && object.sequence !== null) { + message.sequence = BigInt(object.sequence); + } + return message; }, toAmino(message: QueryPacketCommitmentRequest): QueryPacketCommitmentRequestAmino { const obj: any = {}; @@ -1960,6 +2524,8 @@ export const QueryPacketCommitmentRequest = { }; } }; +GlobalDecoderRegistry.register(QueryPacketCommitmentRequest.typeUrl, QueryPacketCommitmentRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryPacketCommitmentRequest.aminoType, QueryPacketCommitmentRequest.typeUrl); function createBaseQueryPacketCommitmentResponse(): QueryPacketCommitmentResponse { return { commitment: new Uint8Array(), @@ -1969,6 +2535,16 @@ function createBaseQueryPacketCommitmentResponse(): QueryPacketCommitmentRespons } export const QueryPacketCommitmentResponse = { typeUrl: "/ibc.core.channel.v1.QueryPacketCommitmentResponse", + aminoType: "cosmos-sdk/QueryPacketCommitmentResponse", + is(o: any): o is QueryPacketCommitmentResponse { + return o && (o.$typeUrl === QueryPacketCommitmentResponse.typeUrl || (o.commitment instanceof Uint8Array || typeof o.commitment === "string") && (o.proof instanceof Uint8Array || typeof o.proof === "string") && Height.is(o.proofHeight)); + }, + isSDK(o: any): o is QueryPacketCommitmentResponseSDKType { + return o && (o.$typeUrl === QueryPacketCommitmentResponse.typeUrl || (o.commitment instanceof Uint8Array || typeof o.commitment === "string") && (o.proof instanceof Uint8Array || typeof o.proof === "string") && Height.isSDK(o.proof_height)); + }, + isAmino(o: any): o is QueryPacketCommitmentResponseAmino { + return o && (o.$typeUrl === QueryPacketCommitmentResponse.typeUrl || (o.commitment instanceof Uint8Array || typeof o.commitment === "string") && (o.proof instanceof Uint8Array || typeof o.proof === "string") && Height.isAmino(o.proof_height)); + }, encode(message: QueryPacketCommitmentResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.commitment.length !== 0) { writer.uint32(10).bytes(message.commitment); @@ -2004,6 +2580,20 @@ export const QueryPacketCommitmentResponse = { } return message; }, + fromJSON(object: any): QueryPacketCommitmentResponse { + return { + commitment: isSet(object.commitment) ? bytesFromBase64(object.commitment) : new Uint8Array(), + proof: isSet(object.proof) ? bytesFromBase64(object.proof) : new Uint8Array(), + proofHeight: isSet(object.proofHeight) ? Height.fromJSON(object.proofHeight) : undefined + }; + }, + toJSON(message: QueryPacketCommitmentResponse): unknown { + const obj: any = {}; + message.commitment !== undefined && (obj.commitment = base64FromBytes(message.commitment !== undefined ? message.commitment : new Uint8Array())); + message.proof !== undefined && (obj.proof = base64FromBytes(message.proof !== undefined ? message.proof : new Uint8Array())); + message.proofHeight !== undefined && (obj.proofHeight = message.proofHeight ? Height.toJSON(message.proofHeight) : undefined); + return obj; + }, fromPartial(object: Partial): QueryPacketCommitmentResponse { const message = createBaseQueryPacketCommitmentResponse(); message.commitment = object.commitment ?? new Uint8Array(); @@ -2012,16 +2602,22 @@ export const QueryPacketCommitmentResponse = { return message; }, fromAmino(object: QueryPacketCommitmentResponseAmino): QueryPacketCommitmentResponse { - return { - commitment: object.commitment, - proof: object.proof, - proofHeight: object?.proof_height ? Height.fromAmino(object.proof_height) : undefined - }; + const message = createBaseQueryPacketCommitmentResponse(); + if (object.commitment !== undefined && object.commitment !== null) { + message.commitment = bytesFromBase64(object.commitment); + } + if (object.proof !== undefined && object.proof !== null) { + message.proof = bytesFromBase64(object.proof); + } + if (object.proof_height !== undefined && object.proof_height !== null) { + message.proofHeight = Height.fromAmino(object.proof_height); + } + return message; }, toAmino(message: QueryPacketCommitmentResponse): QueryPacketCommitmentResponseAmino { const obj: any = {}; - obj.commitment = message.commitment; - obj.proof = message.proof; + obj.commitment = message.commitment ? base64FromBytes(message.commitment) : undefined; + obj.proof = message.proof ? base64FromBytes(message.proof) : undefined; obj.proof_height = message.proofHeight ? Height.toAmino(message.proofHeight) : {}; return obj; }, @@ -2047,15 +2643,27 @@ export const QueryPacketCommitmentResponse = { }; } }; +GlobalDecoderRegistry.register(QueryPacketCommitmentResponse.typeUrl, QueryPacketCommitmentResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryPacketCommitmentResponse.aminoType, QueryPacketCommitmentResponse.typeUrl); function createBaseQueryPacketCommitmentsRequest(): QueryPacketCommitmentsRequest { return { portId: "", channelId: "", - pagination: PageRequest.fromPartial({}) + pagination: undefined }; } export const QueryPacketCommitmentsRequest = { typeUrl: "/ibc.core.channel.v1.QueryPacketCommitmentsRequest", + aminoType: "cosmos-sdk/QueryPacketCommitmentsRequest", + is(o: any): o is QueryPacketCommitmentsRequest { + return o && (o.$typeUrl === QueryPacketCommitmentsRequest.typeUrl || typeof o.portId === "string" && typeof o.channelId === "string"); + }, + isSDK(o: any): o is QueryPacketCommitmentsRequestSDKType { + return o && (o.$typeUrl === QueryPacketCommitmentsRequest.typeUrl || typeof o.port_id === "string" && typeof o.channel_id === "string"); + }, + isAmino(o: any): o is QueryPacketCommitmentsRequestAmino { + return o && (o.$typeUrl === QueryPacketCommitmentsRequest.typeUrl || typeof o.port_id === "string" && typeof o.channel_id === "string"); + }, encode(message: QueryPacketCommitmentsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.portId !== "") { writer.uint32(10).string(message.portId); @@ -2091,6 +2699,20 @@ export const QueryPacketCommitmentsRequest = { } return message; }, + fromJSON(object: any): QueryPacketCommitmentsRequest { + return { + portId: isSet(object.portId) ? String(object.portId) : "", + channelId: isSet(object.channelId) ? String(object.channelId) : "", + pagination: isSet(object.pagination) ? PageRequest.fromJSON(object.pagination) : undefined + }; + }, + toJSON(message: QueryPacketCommitmentsRequest): unknown { + const obj: any = {}; + message.portId !== undefined && (obj.portId = message.portId); + message.channelId !== undefined && (obj.channelId = message.channelId); + message.pagination !== undefined && (obj.pagination = message.pagination ? PageRequest.toJSON(message.pagination) : undefined); + return obj; + }, fromPartial(object: Partial): QueryPacketCommitmentsRequest { const message = createBaseQueryPacketCommitmentsRequest(); message.portId = object.portId ?? ""; @@ -2099,11 +2721,17 @@ export const QueryPacketCommitmentsRequest = { return message; }, fromAmino(object: QueryPacketCommitmentsRequestAmino): QueryPacketCommitmentsRequest { - return { - portId: object.port_id, - channelId: object.channel_id, - pagination: object?.pagination ? PageRequest.fromAmino(object.pagination) : undefined - }; + const message = createBaseQueryPacketCommitmentsRequest(); + if (object.port_id !== undefined && object.port_id !== null) { + message.portId = object.port_id; + } + if (object.channel_id !== undefined && object.channel_id !== null) { + message.channelId = object.channel_id; + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromAmino(object.pagination); + } + return message; }, toAmino(message: QueryPacketCommitmentsRequest): QueryPacketCommitmentsRequestAmino { const obj: any = {}; @@ -2134,15 +2762,27 @@ export const QueryPacketCommitmentsRequest = { }; } }; +GlobalDecoderRegistry.register(QueryPacketCommitmentsRequest.typeUrl, QueryPacketCommitmentsRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryPacketCommitmentsRequest.aminoType, QueryPacketCommitmentsRequest.typeUrl); function createBaseQueryPacketCommitmentsResponse(): QueryPacketCommitmentsResponse { return { commitments: [], - pagination: PageResponse.fromPartial({}), + pagination: undefined, height: Height.fromPartial({}) }; } export const QueryPacketCommitmentsResponse = { typeUrl: "/ibc.core.channel.v1.QueryPacketCommitmentsResponse", + aminoType: "cosmos-sdk/QueryPacketCommitmentsResponse", + is(o: any): o is QueryPacketCommitmentsResponse { + return o && (o.$typeUrl === QueryPacketCommitmentsResponse.typeUrl || Array.isArray(o.commitments) && (!o.commitments.length || PacketState.is(o.commitments[0])) && Height.is(o.height)); + }, + isSDK(o: any): o is QueryPacketCommitmentsResponseSDKType { + return o && (o.$typeUrl === QueryPacketCommitmentsResponse.typeUrl || Array.isArray(o.commitments) && (!o.commitments.length || PacketState.isSDK(o.commitments[0])) && Height.isSDK(o.height)); + }, + isAmino(o: any): o is QueryPacketCommitmentsResponseAmino { + return o && (o.$typeUrl === QueryPacketCommitmentsResponse.typeUrl || Array.isArray(o.commitments) && (!o.commitments.length || PacketState.isAmino(o.commitments[0])) && Height.isAmino(o.height)); + }, encode(message: QueryPacketCommitmentsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.commitments) { PacketState.encode(v!, writer.uint32(10).fork()).ldelim(); @@ -2178,6 +2818,24 @@ export const QueryPacketCommitmentsResponse = { } return message; }, + fromJSON(object: any): QueryPacketCommitmentsResponse { + return { + commitments: Array.isArray(object?.commitments) ? object.commitments.map((e: any) => PacketState.fromJSON(e)) : [], + pagination: isSet(object.pagination) ? PageResponse.fromJSON(object.pagination) : undefined, + height: isSet(object.height) ? Height.fromJSON(object.height) : undefined + }; + }, + toJSON(message: QueryPacketCommitmentsResponse): unknown { + const obj: any = {}; + if (message.commitments) { + obj.commitments = message.commitments.map(e => e ? PacketState.toJSON(e) : undefined); + } else { + obj.commitments = []; + } + message.pagination !== undefined && (obj.pagination = message.pagination ? PageResponse.toJSON(message.pagination) : undefined); + message.height !== undefined && (obj.height = message.height ? Height.toJSON(message.height) : undefined); + return obj; + }, fromPartial(object: Partial): QueryPacketCommitmentsResponse { const message = createBaseQueryPacketCommitmentsResponse(); message.commitments = object.commitments?.map(e => PacketState.fromPartial(e)) || []; @@ -2186,11 +2844,15 @@ export const QueryPacketCommitmentsResponse = { return message; }, fromAmino(object: QueryPacketCommitmentsResponseAmino): QueryPacketCommitmentsResponse { - return { - commitments: Array.isArray(object?.commitments) ? object.commitments.map((e: any) => PacketState.fromAmino(e)) : [], - pagination: object?.pagination ? PageResponse.fromAmino(object.pagination) : undefined, - height: object?.height ? Height.fromAmino(object.height) : undefined - }; + const message = createBaseQueryPacketCommitmentsResponse(); + message.commitments = object.commitments?.map(e => PacketState.fromAmino(e)) || []; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromAmino(object.pagination); + } + if (object.height !== undefined && object.height !== null) { + message.height = Height.fromAmino(object.height); + } + return message; }, toAmino(message: QueryPacketCommitmentsResponse): QueryPacketCommitmentsResponseAmino { const obj: any = {}; @@ -2225,6 +2887,8 @@ export const QueryPacketCommitmentsResponse = { }; } }; +GlobalDecoderRegistry.register(QueryPacketCommitmentsResponse.typeUrl, QueryPacketCommitmentsResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryPacketCommitmentsResponse.aminoType, QueryPacketCommitmentsResponse.typeUrl); function createBaseQueryPacketReceiptRequest(): QueryPacketReceiptRequest { return { portId: "", @@ -2234,6 +2898,16 @@ function createBaseQueryPacketReceiptRequest(): QueryPacketReceiptRequest { } export const QueryPacketReceiptRequest = { typeUrl: "/ibc.core.channel.v1.QueryPacketReceiptRequest", + aminoType: "cosmos-sdk/QueryPacketReceiptRequest", + is(o: any): o is QueryPacketReceiptRequest { + return o && (o.$typeUrl === QueryPacketReceiptRequest.typeUrl || typeof o.portId === "string" && typeof o.channelId === "string" && typeof o.sequence === "bigint"); + }, + isSDK(o: any): o is QueryPacketReceiptRequestSDKType { + return o && (o.$typeUrl === QueryPacketReceiptRequest.typeUrl || typeof o.port_id === "string" && typeof o.channel_id === "string" && typeof o.sequence === "bigint"); + }, + isAmino(o: any): o is QueryPacketReceiptRequestAmino { + return o && (o.$typeUrl === QueryPacketReceiptRequest.typeUrl || typeof o.port_id === "string" && typeof o.channel_id === "string" && typeof o.sequence === "bigint"); + }, encode(message: QueryPacketReceiptRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.portId !== "") { writer.uint32(10).string(message.portId); @@ -2269,6 +2943,20 @@ export const QueryPacketReceiptRequest = { } return message; }, + fromJSON(object: any): QueryPacketReceiptRequest { + return { + portId: isSet(object.portId) ? String(object.portId) : "", + channelId: isSet(object.channelId) ? String(object.channelId) : "", + sequence: isSet(object.sequence) ? BigInt(object.sequence.toString()) : BigInt(0) + }; + }, + toJSON(message: QueryPacketReceiptRequest): unknown { + const obj: any = {}; + message.portId !== undefined && (obj.portId = message.portId); + message.channelId !== undefined && (obj.channelId = message.channelId); + message.sequence !== undefined && (obj.sequence = (message.sequence || BigInt(0)).toString()); + return obj; + }, fromPartial(object: Partial): QueryPacketReceiptRequest { const message = createBaseQueryPacketReceiptRequest(); message.portId = object.portId ?? ""; @@ -2277,11 +2965,17 @@ export const QueryPacketReceiptRequest = { return message; }, fromAmino(object: QueryPacketReceiptRequestAmino): QueryPacketReceiptRequest { - return { - portId: object.port_id, - channelId: object.channel_id, - sequence: BigInt(object.sequence) - }; + const message = createBaseQueryPacketReceiptRequest(); + if (object.port_id !== undefined && object.port_id !== null) { + message.portId = object.port_id; + } + if (object.channel_id !== undefined && object.channel_id !== null) { + message.channelId = object.channel_id; + } + if (object.sequence !== undefined && object.sequence !== null) { + message.sequence = BigInt(object.sequence); + } + return message; }, toAmino(message: QueryPacketReceiptRequest): QueryPacketReceiptRequestAmino { const obj: any = {}; @@ -2312,6 +3006,8 @@ export const QueryPacketReceiptRequest = { }; } }; +GlobalDecoderRegistry.register(QueryPacketReceiptRequest.typeUrl, QueryPacketReceiptRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryPacketReceiptRequest.aminoType, QueryPacketReceiptRequest.typeUrl); function createBaseQueryPacketReceiptResponse(): QueryPacketReceiptResponse { return { received: false, @@ -2321,6 +3017,16 @@ function createBaseQueryPacketReceiptResponse(): QueryPacketReceiptResponse { } export const QueryPacketReceiptResponse = { typeUrl: "/ibc.core.channel.v1.QueryPacketReceiptResponse", + aminoType: "cosmos-sdk/QueryPacketReceiptResponse", + is(o: any): o is QueryPacketReceiptResponse { + return o && (o.$typeUrl === QueryPacketReceiptResponse.typeUrl || typeof o.received === "boolean" && (o.proof instanceof Uint8Array || typeof o.proof === "string") && Height.is(o.proofHeight)); + }, + isSDK(o: any): o is QueryPacketReceiptResponseSDKType { + return o && (o.$typeUrl === QueryPacketReceiptResponse.typeUrl || typeof o.received === "boolean" && (o.proof instanceof Uint8Array || typeof o.proof === "string") && Height.isSDK(o.proof_height)); + }, + isAmino(o: any): o is QueryPacketReceiptResponseAmino { + return o && (o.$typeUrl === QueryPacketReceiptResponse.typeUrl || typeof o.received === "boolean" && (o.proof instanceof Uint8Array || typeof o.proof === "string") && Height.isAmino(o.proof_height)); + }, encode(message: QueryPacketReceiptResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.received === true) { writer.uint32(16).bool(message.received); @@ -2356,6 +3062,20 @@ export const QueryPacketReceiptResponse = { } return message; }, + fromJSON(object: any): QueryPacketReceiptResponse { + return { + received: isSet(object.received) ? Boolean(object.received) : false, + proof: isSet(object.proof) ? bytesFromBase64(object.proof) : new Uint8Array(), + proofHeight: isSet(object.proofHeight) ? Height.fromJSON(object.proofHeight) : undefined + }; + }, + toJSON(message: QueryPacketReceiptResponse): unknown { + const obj: any = {}; + message.received !== undefined && (obj.received = message.received); + message.proof !== undefined && (obj.proof = base64FromBytes(message.proof !== undefined ? message.proof : new Uint8Array())); + message.proofHeight !== undefined && (obj.proofHeight = message.proofHeight ? Height.toJSON(message.proofHeight) : undefined); + return obj; + }, fromPartial(object: Partial): QueryPacketReceiptResponse { const message = createBaseQueryPacketReceiptResponse(); message.received = object.received ?? false; @@ -2364,16 +3084,22 @@ export const QueryPacketReceiptResponse = { return message; }, fromAmino(object: QueryPacketReceiptResponseAmino): QueryPacketReceiptResponse { - return { - received: object.received, - proof: object.proof, - proofHeight: object?.proof_height ? Height.fromAmino(object.proof_height) : undefined - }; + const message = createBaseQueryPacketReceiptResponse(); + if (object.received !== undefined && object.received !== null) { + message.received = object.received; + } + if (object.proof !== undefined && object.proof !== null) { + message.proof = bytesFromBase64(object.proof); + } + if (object.proof_height !== undefined && object.proof_height !== null) { + message.proofHeight = Height.fromAmino(object.proof_height); + } + return message; }, toAmino(message: QueryPacketReceiptResponse): QueryPacketReceiptResponseAmino { const obj: any = {}; obj.received = message.received; - obj.proof = message.proof; + obj.proof = message.proof ? base64FromBytes(message.proof) : undefined; obj.proof_height = message.proofHeight ? Height.toAmino(message.proofHeight) : {}; return obj; }, @@ -2399,6 +3125,8 @@ export const QueryPacketReceiptResponse = { }; } }; +GlobalDecoderRegistry.register(QueryPacketReceiptResponse.typeUrl, QueryPacketReceiptResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryPacketReceiptResponse.aminoType, QueryPacketReceiptResponse.typeUrl); function createBaseQueryPacketAcknowledgementRequest(): QueryPacketAcknowledgementRequest { return { portId: "", @@ -2408,6 +3136,16 @@ function createBaseQueryPacketAcknowledgementRequest(): QueryPacketAcknowledgeme } export const QueryPacketAcknowledgementRequest = { typeUrl: "/ibc.core.channel.v1.QueryPacketAcknowledgementRequest", + aminoType: "cosmos-sdk/QueryPacketAcknowledgementRequest", + is(o: any): o is QueryPacketAcknowledgementRequest { + return o && (o.$typeUrl === QueryPacketAcknowledgementRequest.typeUrl || typeof o.portId === "string" && typeof o.channelId === "string" && typeof o.sequence === "bigint"); + }, + isSDK(o: any): o is QueryPacketAcknowledgementRequestSDKType { + return o && (o.$typeUrl === QueryPacketAcknowledgementRequest.typeUrl || typeof o.port_id === "string" && typeof o.channel_id === "string" && typeof o.sequence === "bigint"); + }, + isAmino(o: any): o is QueryPacketAcknowledgementRequestAmino { + return o && (o.$typeUrl === QueryPacketAcknowledgementRequest.typeUrl || typeof o.port_id === "string" && typeof o.channel_id === "string" && typeof o.sequence === "bigint"); + }, encode(message: QueryPacketAcknowledgementRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.portId !== "") { writer.uint32(10).string(message.portId); @@ -2443,6 +3181,20 @@ export const QueryPacketAcknowledgementRequest = { } return message; }, + fromJSON(object: any): QueryPacketAcknowledgementRequest { + return { + portId: isSet(object.portId) ? String(object.portId) : "", + channelId: isSet(object.channelId) ? String(object.channelId) : "", + sequence: isSet(object.sequence) ? BigInt(object.sequence.toString()) : BigInt(0) + }; + }, + toJSON(message: QueryPacketAcknowledgementRequest): unknown { + const obj: any = {}; + message.portId !== undefined && (obj.portId = message.portId); + message.channelId !== undefined && (obj.channelId = message.channelId); + message.sequence !== undefined && (obj.sequence = (message.sequence || BigInt(0)).toString()); + return obj; + }, fromPartial(object: Partial): QueryPacketAcknowledgementRequest { const message = createBaseQueryPacketAcknowledgementRequest(); message.portId = object.portId ?? ""; @@ -2451,11 +3203,17 @@ export const QueryPacketAcknowledgementRequest = { return message; }, fromAmino(object: QueryPacketAcknowledgementRequestAmino): QueryPacketAcknowledgementRequest { - return { - portId: object.port_id, - channelId: object.channel_id, - sequence: BigInt(object.sequence) - }; + const message = createBaseQueryPacketAcknowledgementRequest(); + if (object.port_id !== undefined && object.port_id !== null) { + message.portId = object.port_id; + } + if (object.channel_id !== undefined && object.channel_id !== null) { + message.channelId = object.channel_id; + } + if (object.sequence !== undefined && object.sequence !== null) { + message.sequence = BigInt(object.sequence); + } + return message; }, toAmino(message: QueryPacketAcknowledgementRequest): QueryPacketAcknowledgementRequestAmino { const obj: any = {}; @@ -2486,6 +3244,8 @@ export const QueryPacketAcknowledgementRequest = { }; } }; +GlobalDecoderRegistry.register(QueryPacketAcknowledgementRequest.typeUrl, QueryPacketAcknowledgementRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryPacketAcknowledgementRequest.aminoType, QueryPacketAcknowledgementRequest.typeUrl); function createBaseQueryPacketAcknowledgementResponse(): QueryPacketAcknowledgementResponse { return { acknowledgement: new Uint8Array(), @@ -2495,6 +3255,16 @@ function createBaseQueryPacketAcknowledgementResponse(): QueryPacketAcknowledgem } export const QueryPacketAcknowledgementResponse = { typeUrl: "/ibc.core.channel.v1.QueryPacketAcknowledgementResponse", + aminoType: "cosmos-sdk/QueryPacketAcknowledgementResponse", + is(o: any): o is QueryPacketAcknowledgementResponse { + return o && (o.$typeUrl === QueryPacketAcknowledgementResponse.typeUrl || (o.acknowledgement instanceof Uint8Array || typeof o.acknowledgement === "string") && (o.proof instanceof Uint8Array || typeof o.proof === "string") && Height.is(o.proofHeight)); + }, + isSDK(o: any): o is QueryPacketAcknowledgementResponseSDKType { + return o && (o.$typeUrl === QueryPacketAcknowledgementResponse.typeUrl || (o.acknowledgement instanceof Uint8Array || typeof o.acknowledgement === "string") && (o.proof instanceof Uint8Array || typeof o.proof === "string") && Height.isSDK(o.proof_height)); + }, + isAmino(o: any): o is QueryPacketAcknowledgementResponseAmino { + return o && (o.$typeUrl === QueryPacketAcknowledgementResponse.typeUrl || (o.acknowledgement instanceof Uint8Array || typeof o.acknowledgement === "string") && (o.proof instanceof Uint8Array || typeof o.proof === "string") && Height.isAmino(o.proof_height)); + }, encode(message: QueryPacketAcknowledgementResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.acknowledgement.length !== 0) { writer.uint32(10).bytes(message.acknowledgement); @@ -2530,6 +3300,20 @@ export const QueryPacketAcknowledgementResponse = { } return message; }, + fromJSON(object: any): QueryPacketAcknowledgementResponse { + return { + acknowledgement: isSet(object.acknowledgement) ? bytesFromBase64(object.acknowledgement) : new Uint8Array(), + proof: isSet(object.proof) ? bytesFromBase64(object.proof) : new Uint8Array(), + proofHeight: isSet(object.proofHeight) ? Height.fromJSON(object.proofHeight) : undefined + }; + }, + toJSON(message: QueryPacketAcknowledgementResponse): unknown { + const obj: any = {}; + message.acknowledgement !== undefined && (obj.acknowledgement = base64FromBytes(message.acknowledgement !== undefined ? message.acknowledgement : new Uint8Array())); + message.proof !== undefined && (obj.proof = base64FromBytes(message.proof !== undefined ? message.proof : new Uint8Array())); + message.proofHeight !== undefined && (obj.proofHeight = message.proofHeight ? Height.toJSON(message.proofHeight) : undefined); + return obj; + }, fromPartial(object: Partial): QueryPacketAcknowledgementResponse { const message = createBaseQueryPacketAcknowledgementResponse(); message.acknowledgement = object.acknowledgement ?? new Uint8Array(); @@ -2538,16 +3322,22 @@ export const QueryPacketAcknowledgementResponse = { return message; }, fromAmino(object: QueryPacketAcknowledgementResponseAmino): QueryPacketAcknowledgementResponse { - return { - acknowledgement: object.acknowledgement, - proof: object.proof, - proofHeight: object?.proof_height ? Height.fromAmino(object.proof_height) : undefined - }; + const message = createBaseQueryPacketAcknowledgementResponse(); + if (object.acknowledgement !== undefined && object.acknowledgement !== null) { + message.acknowledgement = bytesFromBase64(object.acknowledgement); + } + if (object.proof !== undefined && object.proof !== null) { + message.proof = bytesFromBase64(object.proof); + } + if (object.proof_height !== undefined && object.proof_height !== null) { + message.proofHeight = Height.fromAmino(object.proof_height); + } + return message; }, toAmino(message: QueryPacketAcknowledgementResponse): QueryPacketAcknowledgementResponseAmino { const obj: any = {}; - obj.acknowledgement = message.acknowledgement; - obj.proof = message.proof; + obj.acknowledgement = message.acknowledgement ? base64FromBytes(message.acknowledgement) : undefined; + obj.proof = message.proof ? base64FromBytes(message.proof) : undefined; obj.proof_height = message.proofHeight ? Height.toAmino(message.proofHeight) : {}; return obj; }, @@ -2573,16 +3363,28 @@ export const QueryPacketAcknowledgementResponse = { }; } }; +GlobalDecoderRegistry.register(QueryPacketAcknowledgementResponse.typeUrl, QueryPacketAcknowledgementResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryPacketAcknowledgementResponse.aminoType, QueryPacketAcknowledgementResponse.typeUrl); function createBaseQueryPacketAcknowledgementsRequest(): QueryPacketAcknowledgementsRequest { return { portId: "", channelId: "", - pagination: PageRequest.fromPartial({}), + pagination: undefined, packetCommitmentSequences: [] }; } export const QueryPacketAcknowledgementsRequest = { typeUrl: "/ibc.core.channel.v1.QueryPacketAcknowledgementsRequest", + aminoType: "cosmos-sdk/QueryPacketAcknowledgementsRequest", + is(o: any): o is QueryPacketAcknowledgementsRequest { + return o && (o.$typeUrl === QueryPacketAcknowledgementsRequest.typeUrl || typeof o.portId === "string" && typeof o.channelId === "string" && Array.isArray(o.packetCommitmentSequences) && (!o.packetCommitmentSequences.length || typeof o.packetCommitmentSequences[0] === "bigint")); + }, + isSDK(o: any): o is QueryPacketAcknowledgementsRequestSDKType { + return o && (o.$typeUrl === QueryPacketAcknowledgementsRequest.typeUrl || typeof o.port_id === "string" && typeof o.channel_id === "string" && Array.isArray(o.packet_commitment_sequences) && (!o.packet_commitment_sequences.length || typeof o.packet_commitment_sequences[0] === "bigint")); + }, + isAmino(o: any): o is QueryPacketAcknowledgementsRequestAmino { + return o && (o.$typeUrl === QueryPacketAcknowledgementsRequest.typeUrl || typeof o.port_id === "string" && typeof o.channel_id === "string" && Array.isArray(o.packet_commitment_sequences) && (!o.packet_commitment_sequences.length || typeof o.packet_commitment_sequences[0] === "bigint")); + }, encode(message: QueryPacketAcknowledgementsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.portId !== "") { writer.uint32(10).string(message.portId); @@ -2633,6 +3435,26 @@ export const QueryPacketAcknowledgementsRequest = { } return message; }, + fromJSON(object: any): QueryPacketAcknowledgementsRequest { + return { + portId: isSet(object.portId) ? String(object.portId) : "", + channelId: isSet(object.channelId) ? String(object.channelId) : "", + pagination: isSet(object.pagination) ? PageRequest.fromJSON(object.pagination) : undefined, + packetCommitmentSequences: Array.isArray(object?.packetCommitmentSequences) ? object.packetCommitmentSequences.map((e: any) => BigInt(e.toString())) : [] + }; + }, + toJSON(message: QueryPacketAcknowledgementsRequest): unknown { + const obj: any = {}; + message.portId !== undefined && (obj.portId = message.portId); + message.channelId !== undefined && (obj.channelId = message.channelId); + message.pagination !== undefined && (obj.pagination = message.pagination ? PageRequest.toJSON(message.pagination) : undefined); + if (message.packetCommitmentSequences) { + obj.packetCommitmentSequences = message.packetCommitmentSequences.map(e => (e || BigInt(0)).toString()); + } else { + obj.packetCommitmentSequences = []; + } + return obj; + }, fromPartial(object: Partial): QueryPacketAcknowledgementsRequest { const message = createBaseQueryPacketAcknowledgementsRequest(); message.portId = object.portId ?? ""; @@ -2642,12 +3464,18 @@ export const QueryPacketAcknowledgementsRequest = { return message; }, fromAmino(object: QueryPacketAcknowledgementsRequestAmino): QueryPacketAcknowledgementsRequest { - return { - portId: object.port_id, - channelId: object.channel_id, - pagination: object?.pagination ? PageRequest.fromAmino(object.pagination) : undefined, - packetCommitmentSequences: Array.isArray(object?.packet_commitment_sequences) ? object.packet_commitment_sequences.map((e: any) => BigInt(e)) : [] - }; + const message = createBaseQueryPacketAcknowledgementsRequest(); + if (object.port_id !== undefined && object.port_id !== null) { + message.portId = object.port_id; + } + if (object.channel_id !== undefined && object.channel_id !== null) { + message.channelId = object.channel_id; + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromAmino(object.pagination); + } + message.packetCommitmentSequences = object.packet_commitment_sequences?.map(e => BigInt(e)) || []; + return message; }, toAmino(message: QueryPacketAcknowledgementsRequest): QueryPacketAcknowledgementsRequestAmino { const obj: any = {}; @@ -2683,15 +3511,27 @@ export const QueryPacketAcknowledgementsRequest = { }; } }; +GlobalDecoderRegistry.register(QueryPacketAcknowledgementsRequest.typeUrl, QueryPacketAcknowledgementsRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryPacketAcknowledgementsRequest.aminoType, QueryPacketAcknowledgementsRequest.typeUrl); function createBaseQueryPacketAcknowledgementsResponse(): QueryPacketAcknowledgementsResponse { return { acknowledgements: [], - pagination: PageResponse.fromPartial({}), + pagination: undefined, height: Height.fromPartial({}) }; } export const QueryPacketAcknowledgementsResponse = { typeUrl: "/ibc.core.channel.v1.QueryPacketAcknowledgementsResponse", + aminoType: "cosmos-sdk/QueryPacketAcknowledgementsResponse", + is(o: any): o is QueryPacketAcknowledgementsResponse { + return o && (o.$typeUrl === QueryPacketAcknowledgementsResponse.typeUrl || Array.isArray(o.acknowledgements) && (!o.acknowledgements.length || PacketState.is(o.acknowledgements[0])) && Height.is(o.height)); + }, + isSDK(o: any): o is QueryPacketAcknowledgementsResponseSDKType { + return o && (o.$typeUrl === QueryPacketAcknowledgementsResponse.typeUrl || Array.isArray(o.acknowledgements) && (!o.acknowledgements.length || PacketState.isSDK(o.acknowledgements[0])) && Height.isSDK(o.height)); + }, + isAmino(o: any): o is QueryPacketAcknowledgementsResponseAmino { + return o && (o.$typeUrl === QueryPacketAcknowledgementsResponse.typeUrl || Array.isArray(o.acknowledgements) && (!o.acknowledgements.length || PacketState.isAmino(o.acknowledgements[0])) && Height.isAmino(o.height)); + }, encode(message: QueryPacketAcknowledgementsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.acknowledgements) { PacketState.encode(v!, writer.uint32(10).fork()).ldelim(); @@ -2727,6 +3567,24 @@ export const QueryPacketAcknowledgementsResponse = { } return message; }, + fromJSON(object: any): QueryPacketAcknowledgementsResponse { + return { + acknowledgements: Array.isArray(object?.acknowledgements) ? object.acknowledgements.map((e: any) => PacketState.fromJSON(e)) : [], + pagination: isSet(object.pagination) ? PageResponse.fromJSON(object.pagination) : undefined, + height: isSet(object.height) ? Height.fromJSON(object.height) : undefined + }; + }, + toJSON(message: QueryPacketAcknowledgementsResponse): unknown { + const obj: any = {}; + if (message.acknowledgements) { + obj.acknowledgements = message.acknowledgements.map(e => e ? PacketState.toJSON(e) : undefined); + } else { + obj.acknowledgements = []; + } + message.pagination !== undefined && (obj.pagination = message.pagination ? PageResponse.toJSON(message.pagination) : undefined); + message.height !== undefined && (obj.height = message.height ? Height.toJSON(message.height) : undefined); + return obj; + }, fromPartial(object: Partial): QueryPacketAcknowledgementsResponse { const message = createBaseQueryPacketAcknowledgementsResponse(); message.acknowledgements = object.acknowledgements?.map(e => PacketState.fromPartial(e)) || []; @@ -2735,11 +3593,15 @@ export const QueryPacketAcknowledgementsResponse = { return message; }, fromAmino(object: QueryPacketAcknowledgementsResponseAmino): QueryPacketAcknowledgementsResponse { - return { - acknowledgements: Array.isArray(object?.acknowledgements) ? object.acknowledgements.map((e: any) => PacketState.fromAmino(e)) : [], - pagination: object?.pagination ? PageResponse.fromAmino(object.pagination) : undefined, - height: object?.height ? Height.fromAmino(object.height) : undefined - }; + const message = createBaseQueryPacketAcknowledgementsResponse(); + message.acknowledgements = object.acknowledgements?.map(e => PacketState.fromAmino(e)) || []; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromAmino(object.pagination); + } + if (object.height !== undefined && object.height !== null) { + message.height = Height.fromAmino(object.height); + } + return message; }, toAmino(message: QueryPacketAcknowledgementsResponse): QueryPacketAcknowledgementsResponseAmino { const obj: any = {}; @@ -2774,6 +3636,8 @@ export const QueryPacketAcknowledgementsResponse = { }; } }; +GlobalDecoderRegistry.register(QueryPacketAcknowledgementsResponse.typeUrl, QueryPacketAcknowledgementsResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryPacketAcknowledgementsResponse.aminoType, QueryPacketAcknowledgementsResponse.typeUrl); function createBaseQueryUnreceivedPacketsRequest(): QueryUnreceivedPacketsRequest { return { portId: "", @@ -2783,6 +3647,16 @@ function createBaseQueryUnreceivedPacketsRequest(): QueryUnreceivedPacketsReques } export const QueryUnreceivedPacketsRequest = { typeUrl: "/ibc.core.channel.v1.QueryUnreceivedPacketsRequest", + aminoType: "cosmos-sdk/QueryUnreceivedPacketsRequest", + is(o: any): o is QueryUnreceivedPacketsRequest { + return o && (o.$typeUrl === QueryUnreceivedPacketsRequest.typeUrl || typeof o.portId === "string" && typeof o.channelId === "string" && Array.isArray(o.packetCommitmentSequences) && (!o.packetCommitmentSequences.length || typeof o.packetCommitmentSequences[0] === "bigint")); + }, + isSDK(o: any): o is QueryUnreceivedPacketsRequestSDKType { + return o && (o.$typeUrl === QueryUnreceivedPacketsRequest.typeUrl || typeof o.port_id === "string" && typeof o.channel_id === "string" && Array.isArray(o.packet_commitment_sequences) && (!o.packet_commitment_sequences.length || typeof o.packet_commitment_sequences[0] === "bigint")); + }, + isAmino(o: any): o is QueryUnreceivedPacketsRequestAmino { + return o && (o.$typeUrl === QueryUnreceivedPacketsRequest.typeUrl || typeof o.port_id === "string" && typeof o.channel_id === "string" && Array.isArray(o.packet_commitment_sequences) && (!o.packet_commitment_sequences.length || typeof o.packet_commitment_sequences[0] === "bigint")); + }, encode(message: QueryUnreceivedPacketsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.portId !== "") { writer.uint32(10).string(message.portId); @@ -2827,6 +3701,24 @@ export const QueryUnreceivedPacketsRequest = { } return message; }, + fromJSON(object: any): QueryUnreceivedPacketsRequest { + return { + portId: isSet(object.portId) ? String(object.portId) : "", + channelId: isSet(object.channelId) ? String(object.channelId) : "", + packetCommitmentSequences: Array.isArray(object?.packetCommitmentSequences) ? object.packetCommitmentSequences.map((e: any) => BigInt(e.toString())) : [] + }; + }, + toJSON(message: QueryUnreceivedPacketsRequest): unknown { + const obj: any = {}; + message.portId !== undefined && (obj.portId = message.portId); + message.channelId !== undefined && (obj.channelId = message.channelId); + if (message.packetCommitmentSequences) { + obj.packetCommitmentSequences = message.packetCommitmentSequences.map(e => (e || BigInt(0)).toString()); + } else { + obj.packetCommitmentSequences = []; + } + return obj; + }, fromPartial(object: Partial): QueryUnreceivedPacketsRequest { const message = createBaseQueryUnreceivedPacketsRequest(); message.portId = object.portId ?? ""; @@ -2835,11 +3727,15 @@ export const QueryUnreceivedPacketsRequest = { return message; }, fromAmino(object: QueryUnreceivedPacketsRequestAmino): QueryUnreceivedPacketsRequest { - return { - portId: object.port_id, - channelId: object.channel_id, - packetCommitmentSequences: Array.isArray(object?.packet_commitment_sequences) ? object.packet_commitment_sequences.map((e: any) => BigInt(e)) : [] - }; + const message = createBaseQueryUnreceivedPacketsRequest(); + if (object.port_id !== undefined && object.port_id !== null) { + message.portId = object.port_id; + } + if (object.channel_id !== undefined && object.channel_id !== null) { + message.channelId = object.channel_id; + } + message.packetCommitmentSequences = object.packet_commitment_sequences?.map(e => BigInt(e)) || []; + return message; }, toAmino(message: QueryUnreceivedPacketsRequest): QueryUnreceivedPacketsRequestAmino { const obj: any = {}; @@ -2874,6 +3770,8 @@ export const QueryUnreceivedPacketsRequest = { }; } }; +GlobalDecoderRegistry.register(QueryUnreceivedPacketsRequest.typeUrl, QueryUnreceivedPacketsRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryUnreceivedPacketsRequest.aminoType, QueryUnreceivedPacketsRequest.typeUrl); function createBaseQueryUnreceivedPacketsResponse(): QueryUnreceivedPacketsResponse { return { sequences: [], @@ -2882,6 +3780,16 @@ function createBaseQueryUnreceivedPacketsResponse(): QueryUnreceivedPacketsRespo } export const QueryUnreceivedPacketsResponse = { typeUrl: "/ibc.core.channel.v1.QueryUnreceivedPacketsResponse", + aminoType: "cosmos-sdk/QueryUnreceivedPacketsResponse", + is(o: any): o is QueryUnreceivedPacketsResponse { + return o && (o.$typeUrl === QueryUnreceivedPacketsResponse.typeUrl || Array.isArray(o.sequences) && (!o.sequences.length || typeof o.sequences[0] === "bigint") && Height.is(o.height)); + }, + isSDK(o: any): o is QueryUnreceivedPacketsResponseSDKType { + return o && (o.$typeUrl === QueryUnreceivedPacketsResponse.typeUrl || Array.isArray(o.sequences) && (!o.sequences.length || typeof o.sequences[0] === "bigint") && Height.isSDK(o.height)); + }, + isAmino(o: any): o is QueryUnreceivedPacketsResponseAmino { + return o && (o.$typeUrl === QueryUnreceivedPacketsResponse.typeUrl || Array.isArray(o.sequences) && (!o.sequences.length || typeof o.sequences[0] === "bigint") && Height.isAmino(o.height)); + }, encode(message: QueryUnreceivedPacketsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { writer.uint32(10).fork(); for (const v of message.sequences) { @@ -2920,6 +3828,22 @@ export const QueryUnreceivedPacketsResponse = { } return message; }, + fromJSON(object: any): QueryUnreceivedPacketsResponse { + return { + sequences: Array.isArray(object?.sequences) ? object.sequences.map((e: any) => BigInt(e.toString())) : [], + height: isSet(object.height) ? Height.fromJSON(object.height) : undefined + }; + }, + toJSON(message: QueryUnreceivedPacketsResponse): unknown { + const obj: any = {}; + if (message.sequences) { + obj.sequences = message.sequences.map(e => (e || BigInt(0)).toString()); + } else { + obj.sequences = []; + } + message.height !== undefined && (obj.height = message.height ? Height.toJSON(message.height) : undefined); + return obj; + }, fromPartial(object: Partial): QueryUnreceivedPacketsResponse { const message = createBaseQueryUnreceivedPacketsResponse(); message.sequences = object.sequences?.map(e => BigInt(e.toString())) || []; @@ -2927,10 +3851,12 @@ export const QueryUnreceivedPacketsResponse = { return message; }, fromAmino(object: QueryUnreceivedPacketsResponseAmino): QueryUnreceivedPacketsResponse { - return { - sequences: Array.isArray(object?.sequences) ? object.sequences.map((e: any) => BigInt(e)) : [], - height: object?.height ? Height.fromAmino(object.height) : undefined - }; + const message = createBaseQueryUnreceivedPacketsResponse(); + message.sequences = object.sequences?.map(e => BigInt(e)) || []; + if (object.height !== undefined && object.height !== null) { + message.height = Height.fromAmino(object.height); + } + return message; }, toAmino(message: QueryUnreceivedPacketsResponse): QueryUnreceivedPacketsResponseAmino { const obj: any = {}; @@ -2964,6 +3890,8 @@ export const QueryUnreceivedPacketsResponse = { }; } }; +GlobalDecoderRegistry.register(QueryUnreceivedPacketsResponse.typeUrl, QueryUnreceivedPacketsResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryUnreceivedPacketsResponse.aminoType, QueryUnreceivedPacketsResponse.typeUrl); function createBaseQueryUnreceivedAcksRequest(): QueryUnreceivedAcksRequest { return { portId: "", @@ -2973,6 +3901,16 @@ function createBaseQueryUnreceivedAcksRequest(): QueryUnreceivedAcksRequest { } export const QueryUnreceivedAcksRequest = { typeUrl: "/ibc.core.channel.v1.QueryUnreceivedAcksRequest", + aminoType: "cosmos-sdk/QueryUnreceivedAcksRequest", + is(o: any): o is QueryUnreceivedAcksRequest { + return o && (o.$typeUrl === QueryUnreceivedAcksRequest.typeUrl || typeof o.portId === "string" && typeof o.channelId === "string" && Array.isArray(o.packetAckSequences) && (!o.packetAckSequences.length || typeof o.packetAckSequences[0] === "bigint")); + }, + isSDK(o: any): o is QueryUnreceivedAcksRequestSDKType { + return o && (o.$typeUrl === QueryUnreceivedAcksRequest.typeUrl || typeof o.port_id === "string" && typeof o.channel_id === "string" && Array.isArray(o.packet_ack_sequences) && (!o.packet_ack_sequences.length || typeof o.packet_ack_sequences[0] === "bigint")); + }, + isAmino(o: any): o is QueryUnreceivedAcksRequestAmino { + return o && (o.$typeUrl === QueryUnreceivedAcksRequest.typeUrl || typeof o.port_id === "string" && typeof o.channel_id === "string" && Array.isArray(o.packet_ack_sequences) && (!o.packet_ack_sequences.length || typeof o.packet_ack_sequences[0] === "bigint")); + }, encode(message: QueryUnreceivedAcksRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.portId !== "") { writer.uint32(10).string(message.portId); @@ -3017,6 +3955,24 @@ export const QueryUnreceivedAcksRequest = { } return message; }, + fromJSON(object: any): QueryUnreceivedAcksRequest { + return { + portId: isSet(object.portId) ? String(object.portId) : "", + channelId: isSet(object.channelId) ? String(object.channelId) : "", + packetAckSequences: Array.isArray(object?.packetAckSequences) ? object.packetAckSequences.map((e: any) => BigInt(e.toString())) : [] + }; + }, + toJSON(message: QueryUnreceivedAcksRequest): unknown { + const obj: any = {}; + message.portId !== undefined && (obj.portId = message.portId); + message.channelId !== undefined && (obj.channelId = message.channelId); + if (message.packetAckSequences) { + obj.packetAckSequences = message.packetAckSequences.map(e => (e || BigInt(0)).toString()); + } else { + obj.packetAckSequences = []; + } + return obj; + }, fromPartial(object: Partial): QueryUnreceivedAcksRequest { const message = createBaseQueryUnreceivedAcksRequest(); message.portId = object.portId ?? ""; @@ -3025,11 +3981,15 @@ export const QueryUnreceivedAcksRequest = { return message; }, fromAmino(object: QueryUnreceivedAcksRequestAmino): QueryUnreceivedAcksRequest { - return { - portId: object.port_id, - channelId: object.channel_id, - packetAckSequences: Array.isArray(object?.packet_ack_sequences) ? object.packet_ack_sequences.map((e: any) => BigInt(e)) : [] - }; + const message = createBaseQueryUnreceivedAcksRequest(); + if (object.port_id !== undefined && object.port_id !== null) { + message.portId = object.port_id; + } + if (object.channel_id !== undefined && object.channel_id !== null) { + message.channelId = object.channel_id; + } + message.packetAckSequences = object.packet_ack_sequences?.map(e => BigInt(e)) || []; + return message; }, toAmino(message: QueryUnreceivedAcksRequest): QueryUnreceivedAcksRequestAmino { const obj: any = {}; @@ -3064,6 +4024,8 @@ export const QueryUnreceivedAcksRequest = { }; } }; +GlobalDecoderRegistry.register(QueryUnreceivedAcksRequest.typeUrl, QueryUnreceivedAcksRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryUnreceivedAcksRequest.aminoType, QueryUnreceivedAcksRequest.typeUrl); function createBaseQueryUnreceivedAcksResponse(): QueryUnreceivedAcksResponse { return { sequences: [], @@ -3072,6 +4034,16 @@ function createBaseQueryUnreceivedAcksResponse(): QueryUnreceivedAcksResponse { } export const QueryUnreceivedAcksResponse = { typeUrl: "/ibc.core.channel.v1.QueryUnreceivedAcksResponse", + aminoType: "cosmos-sdk/QueryUnreceivedAcksResponse", + is(o: any): o is QueryUnreceivedAcksResponse { + return o && (o.$typeUrl === QueryUnreceivedAcksResponse.typeUrl || Array.isArray(o.sequences) && (!o.sequences.length || typeof o.sequences[0] === "bigint") && Height.is(o.height)); + }, + isSDK(o: any): o is QueryUnreceivedAcksResponseSDKType { + return o && (o.$typeUrl === QueryUnreceivedAcksResponse.typeUrl || Array.isArray(o.sequences) && (!o.sequences.length || typeof o.sequences[0] === "bigint") && Height.isSDK(o.height)); + }, + isAmino(o: any): o is QueryUnreceivedAcksResponseAmino { + return o && (o.$typeUrl === QueryUnreceivedAcksResponse.typeUrl || Array.isArray(o.sequences) && (!o.sequences.length || typeof o.sequences[0] === "bigint") && Height.isAmino(o.height)); + }, encode(message: QueryUnreceivedAcksResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { writer.uint32(10).fork(); for (const v of message.sequences) { @@ -3110,6 +4082,22 @@ export const QueryUnreceivedAcksResponse = { } return message; }, + fromJSON(object: any): QueryUnreceivedAcksResponse { + return { + sequences: Array.isArray(object?.sequences) ? object.sequences.map((e: any) => BigInt(e.toString())) : [], + height: isSet(object.height) ? Height.fromJSON(object.height) : undefined + }; + }, + toJSON(message: QueryUnreceivedAcksResponse): unknown { + const obj: any = {}; + if (message.sequences) { + obj.sequences = message.sequences.map(e => (e || BigInt(0)).toString()); + } else { + obj.sequences = []; + } + message.height !== undefined && (obj.height = message.height ? Height.toJSON(message.height) : undefined); + return obj; + }, fromPartial(object: Partial): QueryUnreceivedAcksResponse { const message = createBaseQueryUnreceivedAcksResponse(); message.sequences = object.sequences?.map(e => BigInt(e.toString())) || []; @@ -3117,10 +4105,12 @@ export const QueryUnreceivedAcksResponse = { return message; }, fromAmino(object: QueryUnreceivedAcksResponseAmino): QueryUnreceivedAcksResponse { - return { - sequences: Array.isArray(object?.sequences) ? object.sequences.map((e: any) => BigInt(e)) : [], - height: object?.height ? Height.fromAmino(object.height) : undefined - }; + const message = createBaseQueryUnreceivedAcksResponse(); + message.sequences = object.sequences?.map(e => BigInt(e)) || []; + if (object.height !== undefined && object.height !== null) { + message.height = Height.fromAmino(object.height); + } + return message; }, toAmino(message: QueryUnreceivedAcksResponse): QueryUnreceivedAcksResponseAmino { const obj: any = {}; @@ -3154,6 +4144,8 @@ export const QueryUnreceivedAcksResponse = { }; } }; +GlobalDecoderRegistry.register(QueryUnreceivedAcksResponse.typeUrl, QueryUnreceivedAcksResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryUnreceivedAcksResponse.aminoType, QueryUnreceivedAcksResponse.typeUrl); function createBaseQueryNextSequenceReceiveRequest(): QueryNextSequenceReceiveRequest { return { portId: "", @@ -3162,6 +4154,16 @@ function createBaseQueryNextSequenceReceiveRequest(): QueryNextSequenceReceiveRe } export const QueryNextSequenceReceiveRequest = { typeUrl: "/ibc.core.channel.v1.QueryNextSequenceReceiveRequest", + aminoType: "cosmos-sdk/QueryNextSequenceReceiveRequest", + is(o: any): o is QueryNextSequenceReceiveRequest { + return o && (o.$typeUrl === QueryNextSequenceReceiveRequest.typeUrl || typeof o.portId === "string" && typeof o.channelId === "string"); + }, + isSDK(o: any): o is QueryNextSequenceReceiveRequestSDKType { + return o && (o.$typeUrl === QueryNextSequenceReceiveRequest.typeUrl || typeof o.port_id === "string" && typeof o.channel_id === "string"); + }, + isAmino(o: any): o is QueryNextSequenceReceiveRequestAmino { + return o && (o.$typeUrl === QueryNextSequenceReceiveRequest.typeUrl || typeof o.port_id === "string" && typeof o.channel_id === "string"); + }, encode(message: QueryNextSequenceReceiveRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.portId !== "") { writer.uint32(10).string(message.portId); @@ -3191,6 +4193,18 @@ export const QueryNextSequenceReceiveRequest = { } return message; }, + fromJSON(object: any): QueryNextSequenceReceiveRequest { + return { + portId: isSet(object.portId) ? String(object.portId) : "", + channelId: isSet(object.channelId) ? String(object.channelId) : "" + }; + }, + toJSON(message: QueryNextSequenceReceiveRequest): unknown { + const obj: any = {}; + message.portId !== undefined && (obj.portId = message.portId); + message.channelId !== undefined && (obj.channelId = message.channelId); + return obj; + }, fromPartial(object: Partial): QueryNextSequenceReceiveRequest { const message = createBaseQueryNextSequenceReceiveRequest(); message.portId = object.portId ?? ""; @@ -3198,10 +4212,14 @@ export const QueryNextSequenceReceiveRequest = { return message; }, fromAmino(object: QueryNextSequenceReceiveRequestAmino): QueryNextSequenceReceiveRequest { - return { - portId: object.port_id, - channelId: object.channel_id - }; + const message = createBaseQueryNextSequenceReceiveRequest(); + if (object.port_id !== undefined && object.port_id !== null) { + message.portId = object.port_id; + } + if (object.channel_id !== undefined && object.channel_id !== null) { + message.channelId = object.channel_id; + } + return message; }, toAmino(message: QueryNextSequenceReceiveRequest): QueryNextSequenceReceiveRequestAmino { const obj: any = {}; @@ -3231,6 +4249,8 @@ export const QueryNextSequenceReceiveRequest = { }; } }; +GlobalDecoderRegistry.register(QueryNextSequenceReceiveRequest.typeUrl, QueryNextSequenceReceiveRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryNextSequenceReceiveRequest.aminoType, QueryNextSequenceReceiveRequest.typeUrl); function createBaseQueryNextSequenceReceiveResponse(): QueryNextSequenceReceiveResponse { return { nextSequenceReceive: BigInt(0), @@ -3240,6 +4260,16 @@ function createBaseQueryNextSequenceReceiveResponse(): QueryNextSequenceReceiveR } export const QueryNextSequenceReceiveResponse = { typeUrl: "/ibc.core.channel.v1.QueryNextSequenceReceiveResponse", + aminoType: "cosmos-sdk/QueryNextSequenceReceiveResponse", + is(o: any): o is QueryNextSequenceReceiveResponse { + return o && (o.$typeUrl === QueryNextSequenceReceiveResponse.typeUrl || typeof o.nextSequenceReceive === "bigint" && (o.proof instanceof Uint8Array || typeof o.proof === "string") && Height.is(o.proofHeight)); + }, + isSDK(o: any): o is QueryNextSequenceReceiveResponseSDKType { + return o && (o.$typeUrl === QueryNextSequenceReceiveResponse.typeUrl || typeof o.next_sequence_receive === "bigint" && (o.proof instanceof Uint8Array || typeof o.proof === "string") && Height.isSDK(o.proof_height)); + }, + isAmino(o: any): o is QueryNextSequenceReceiveResponseAmino { + return o && (o.$typeUrl === QueryNextSequenceReceiveResponse.typeUrl || typeof o.next_sequence_receive === "bigint" && (o.proof instanceof Uint8Array || typeof o.proof === "string") && Height.isAmino(o.proof_height)); + }, encode(message: QueryNextSequenceReceiveResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.nextSequenceReceive !== BigInt(0)) { writer.uint32(8).uint64(message.nextSequenceReceive); @@ -3275,6 +4305,20 @@ export const QueryNextSequenceReceiveResponse = { } return message; }, + fromJSON(object: any): QueryNextSequenceReceiveResponse { + return { + nextSequenceReceive: isSet(object.nextSequenceReceive) ? BigInt(object.nextSequenceReceive.toString()) : BigInt(0), + proof: isSet(object.proof) ? bytesFromBase64(object.proof) : new Uint8Array(), + proofHeight: isSet(object.proofHeight) ? Height.fromJSON(object.proofHeight) : undefined + }; + }, + toJSON(message: QueryNextSequenceReceiveResponse): unknown { + const obj: any = {}; + message.nextSequenceReceive !== undefined && (obj.nextSequenceReceive = (message.nextSequenceReceive || BigInt(0)).toString()); + message.proof !== undefined && (obj.proof = base64FromBytes(message.proof !== undefined ? message.proof : new Uint8Array())); + message.proofHeight !== undefined && (obj.proofHeight = message.proofHeight ? Height.toJSON(message.proofHeight) : undefined); + return obj; + }, fromPartial(object: Partial): QueryNextSequenceReceiveResponse { const message = createBaseQueryNextSequenceReceiveResponse(); message.nextSequenceReceive = object.nextSequenceReceive !== undefined && object.nextSequenceReceive !== null ? BigInt(object.nextSequenceReceive.toString()) : BigInt(0); @@ -3283,16 +4327,22 @@ export const QueryNextSequenceReceiveResponse = { return message; }, fromAmino(object: QueryNextSequenceReceiveResponseAmino): QueryNextSequenceReceiveResponse { - return { - nextSequenceReceive: BigInt(object.next_sequence_receive), - proof: object.proof, - proofHeight: object?.proof_height ? Height.fromAmino(object.proof_height) : undefined - }; + const message = createBaseQueryNextSequenceReceiveResponse(); + if (object.next_sequence_receive !== undefined && object.next_sequence_receive !== null) { + message.nextSequenceReceive = BigInt(object.next_sequence_receive); + } + if (object.proof !== undefined && object.proof !== null) { + message.proof = bytesFromBase64(object.proof); + } + if (object.proof_height !== undefined && object.proof_height !== null) { + message.proofHeight = Height.fromAmino(object.proof_height); + } + return message; }, toAmino(message: QueryNextSequenceReceiveResponse): QueryNextSequenceReceiveResponseAmino { const obj: any = {}; obj.next_sequence_receive = message.nextSequenceReceive ? message.nextSequenceReceive.toString() : undefined; - obj.proof = message.proof; + obj.proof = message.proof ? base64FromBytes(message.proof) : undefined; obj.proof_height = message.proofHeight ? Height.toAmino(message.proofHeight) : {}; return obj; }, @@ -3317,4 +4367,844 @@ export const QueryNextSequenceReceiveResponse = { value: QueryNextSequenceReceiveResponse.encode(message).finish() }; } -}; \ No newline at end of file +}; +GlobalDecoderRegistry.register(QueryNextSequenceReceiveResponse.typeUrl, QueryNextSequenceReceiveResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryNextSequenceReceiveResponse.aminoType, QueryNextSequenceReceiveResponse.typeUrl); +function createBaseQueryNextSequenceSendRequest(): QueryNextSequenceSendRequest { + return { + portId: "", + channelId: "" + }; +} +export const QueryNextSequenceSendRequest = { + typeUrl: "/ibc.core.channel.v1.QueryNextSequenceSendRequest", + aminoType: "cosmos-sdk/QueryNextSequenceSendRequest", + is(o: any): o is QueryNextSequenceSendRequest { + return o && (o.$typeUrl === QueryNextSequenceSendRequest.typeUrl || typeof o.portId === "string" && typeof o.channelId === "string"); + }, + isSDK(o: any): o is QueryNextSequenceSendRequestSDKType { + return o && (o.$typeUrl === QueryNextSequenceSendRequest.typeUrl || typeof o.port_id === "string" && typeof o.channel_id === "string"); + }, + isAmino(o: any): o is QueryNextSequenceSendRequestAmino { + return o && (o.$typeUrl === QueryNextSequenceSendRequest.typeUrl || typeof o.port_id === "string" && typeof o.channel_id === "string"); + }, + encode(message: QueryNextSequenceSendRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.portId !== "") { + writer.uint32(10).string(message.portId); + } + if (message.channelId !== "") { + writer.uint32(18).string(message.channelId); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryNextSequenceSendRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryNextSequenceSendRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.portId = reader.string(); + break; + case 2: + message.channelId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): QueryNextSequenceSendRequest { + return { + portId: isSet(object.portId) ? String(object.portId) : "", + channelId: isSet(object.channelId) ? String(object.channelId) : "" + }; + }, + toJSON(message: QueryNextSequenceSendRequest): unknown { + const obj: any = {}; + message.portId !== undefined && (obj.portId = message.portId); + message.channelId !== undefined && (obj.channelId = message.channelId); + return obj; + }, + fromPartial(object: Partial): QueryNextSequenceSendRequest { + const message = createBaseQueryNextSequenceSendRequest(); + message.portId = object.portId ?? ""; + message.channelId = object.channelId ?? ""; + return message; + }, + fromAmino(object: QueryNextSequenceSendRequestAmino): QueryNextSequenceSendRequest { + const message = createBaseQueryNextSequenceSendRequest(); + if (object.port_id !== undefined && object.port_id !== null) { + message.portId = object.port_id; + } + if (object.channel_id !== undefined && object.channel_id !== null) { + message.channelId = object.channel_id; + } + return message; + }, + toAmino(message: QueryNextSequenceSendRequest): QueryNextSequenceSendRequestAmino { + const obj: any = {}; + obj.port_id = message.portId; + obj.channel_id = message.channelId; + return obj; + }, + fromAminoMsg(object: QueryNextSequenceSendRequestAminoMsg): QueryNextSequenceSendRequest { + return QueryNextSequenceSendRequest.fromAmino(object.value); + }, + toAminoMsg(message: QueryNextSequenceSendRequest): QueryNextSequenceSendRequestAminoMsg { + return { + type: "cosmos-sdk/QueryNextSequenceSendRequest", + value: QueryNextSequenceSendRequest.toAmino(message) + }; + }, + fromProtoMsg(message: QueryNextSequenceSendRequestProtoMsg): QueryNextSequenceSendRequest { + return QueryNextSequenceSendRequest.decode(message.value); + }, + toProto(message: QueryNextSequenceSendRequest): Uint8Array { + return QueryNextSequenceSendRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryNextSequenceSendRequest): QueryNextSequenceSendRequestProtoMsg { + return { + typeUrl: "/ibc.core.channel.v1.QueryNextSequenceSendRequest", + value: QueryNextSequenceSendRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryNextSequenceSendRequest.typeUrl, QueryNextSequenceSendRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryNextSequenceSendRequest.aminoType, QueryNextSequenceSendRequest.typeUrl); +function createBaseQueryNextSequenceSendResponse(): QueryNextSequenceSendResponse { + return { + nextSequenceSend: BigInt(0), + proof: new Uint8Array(), + proofHeight: Height.fromPartial({}) + }; +} +export const QueryNextSequenceSendResponse = { + typeUrl: "/ibc.core.channel.v1.QueryNextSequenceSendResponse", + aminoType: "cosmos-sdk/QueryNextSequenceSendResponse", + is(o: any): o is QueryNextSequenceSendResponse { + return o && (o.$typeUrl === QueryNextSequenceSendResponse.typeUrl || typeof o.nextSequenceSend === "bigint" && (o.proof instanceof Uint8Array || typeof o.proof === "string") && Height.is(o.proofHeight)); + }, + isSDK(o: any): o is QueryNextSequenceSendResponseSDKType { + return o && (o.$typeUrl === QueryNextSequenceSendResponse.typeUrl || typeof o.next_sequence_send === "bigint" && (o.proof instanceof Uint8Array || typeof o.proof === "string") && Height.isSDK(o.proof_height)); + }, + isAmino(o: any): o is QueryNextSequenceSendResponseAmino { + return o && (o.$typeUrl === QueryNextSequenceSendResponse.typeUrl || typeof o.next_sequence_send === "bigint" && (o.proof instanceof Uint8Array || typeof o.proof === "string") && Height.isAmino(o.proof_height)); + }, + encode(message: QueryNextSequenceSendResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.nextSequenceSend !== BigInt(0)) { + writer.uint32(8).uint64(message.nextSequenceSend); + } + if (message.proof.length !== 0) { + writer.uint32(18).bytes(message.proof); + } + if (message.proofHeight !== undefined) { + Height.encode(message.proofHeight, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryNextSequenceSendResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryNextSequenceSendResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.nextSequenceSend = reader.uint64(); + break; + case 2: + message.proof = reader.bytes(); + break; + case 3: + message.proofHeight = Height.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): QueryNextSequenceSendResponse { + return { + nextSequenceSend: isSet(object.nextSequenceSend) ? BigInt(object.nextSequenceSend.toString()) : BigInt(0), + proof: isSet(object.proof) ? bytesFromBase64(object.proof) : new Uint8Array(), + proofHeight: isSet(object.proofHeight) ? Height.fromJSON(object.proofHeight) : undefined + }; + }, + toJSON(message: QueryNextSequenceSendResponse): unknown { + const obj: any = {}; + message.nextSequenceSend !== undefined && (obj.nextSequenceSend = (message.nextSequenceSend || BigInt(0)).toString()); + message.proof !== undefined && (obj.proof = base64FromBytes(message.proof !== undefined ? message.proof : new Uint8Array())); + message.proofHeight !== undefined && (obj.proofHeight = message.proofHeight ? Height.toJSON(message.proofHeight) : undefined); + return obj; + }, + fromPartial(object: Partial): QueryNextSequenceSendResponse { + const message = createBaseQueryNextSequenceSendResponse(); + message.nextSequenceSend = object.nextSequenceSend !== undefined && object.nextSequenceSend !== null ? BigInt(object.nextSequenceSend.toString()) : BigInt(0); + message.proof = object.proof ?? new Uint8Array(); + message.proofHeight = object.proofHeight !== undefined && object.proofHeight !== null ? Height.fromPartial(object.proofHeight) : undefined; + return message; + }, + fromAmino(object: QueryNextSequenceSendResponseAmino): QueryNextSequenceSendResponse { + const message = createBaseQueryNextSequenceSendResponse(); + if (object.next_sequence_send !== undefined && object.next_sequence_send !== null) { + message.nextSequenceSend = BigInt(object.next_sequence_send); + } + if (object.proof !== undefined && object.proof !== null) { + message.proof = bytesFromBase64(object.proof); + } + if (object.proof_height !== undefined && object.proof_height !== null) { + message.proofHeight = Height.fromAmino(object.proof_height); + } + return message; + }, + toAmino(message: QueryNextSequenceSendResponse): QueryNextSequenceSendResponseAmino { + const obj: any = {}; + obj.next_sequence_send = message.nextSequenceSend ? message.nextSequenceSend.toString() : undefined; + obj.proof = message.proof ? base64FromBytes(message.proof) : undefined; + obj.proof_height = message.proofHeight ? Height.toAmino(message.proofHeight) : {}; + return obj; + }, + fromAminoMsg(object: QueryNextSequenceSendResponseAminoMsg): QueryNextSequenceSendResponse { + return QueryNextSequenceSendResponse.fromAmino(object.value); + }, + toAminoMsg(message: QueryNextSequenceSendResponse): QueryNextSequenceSendResponseAminoMsg { + return { + type: "cosmos-sdk/QueryNextSequenceSendResponse", + value: QueryNextSequenceSendResponse.toAmino(message) + }; + }, + fromProtoMsg(message: QueryNextSequenceSendResponseProtoMsg): QueryNextSequenceSendResponse { + return QueryNextSequenceSendResponse.decode(message.value); + }, + toProto(message: QueryNextSequenceSendResponse): Uint8Array { + return QueryNextSequenceSendResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryNextSequenceSendResponse): QueryNextSequenceSendResponseProtoMsg { + return { + typeUrl: "/ibc.core.channel.v1.QueryNextSequenceSendResponse", + value: QueryNextSequenceSendResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryNextSequenceSendResponse.typeUrl, QueryNextSequenceSendResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryNextSequenceSendResponse.aminoType, QueryNextSequenceSendResponse.typeUrl); +function createBaseQueryUpgradeErrorRequest(): QueryUpgradeErrorRequest { + return { + portId: "", + channelId: "" + }; +} +export const QueryUpgradeErrorRequest = { + typeUrl: "/ibc.core.channel.v1.QueryUpgradeErrorRequest", + aminoType: "cosmos-sdk/QueryUpgradeErrorRequest", + is(o: any): o is QueryUpgradeErrorRequest { + return o && (o.$typeUrl === QueryUpgradeErrorRequest.typeUrl || typeof o.portId === "string" && typeof o.channelId === "string"); + }, + isSDK(o: any): o is QueryUpgradeErrorRequestSDKType { + return o && (o.$typeUrl === QueryUpgradeErrorRequest.typeUrl || typeof o.port_id === "string" && typeof o.channel_id === "string"); + }, + isAmino(o: any): o is QueryUpgradeErrorRequestAmino { + return o && (o.$typeUrl === QueryUpgradeErrorRequest.typeUrl || typeof o.port_id === "string" && typeof o.channel_id === "string"); + }, + encode(message: QueryUpgradeErrorRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.portId !== "") { + writer.uint32(10).string(message.portId); + } + if (message.channelId !== "") { + writer.uint32(18).string(message.channelId); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryUpgradeErrorRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryUpgradeErrorRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.portId = reader.string(); + break; + case 2: + message.channelId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): QueryUpgradeErrorRequest { + return { + portId: isSet(object.portId) ? String(object.portId) : "", + channelId: isSet(object.channelId) ? String(object.channelId) : "" + }; + }, + toJSON(message: QueryUpgradeErrorRequest): unknown { + const obj: any = {}; + message.portId !== undefined && (obj.portId = message.portId); + message.channelId !== undefined && (obj.channelId = message.channelId); + return obj; + }, + fromPartial(object: Partial): QueryUpgradeErrorRequest { + const message = createBaseQueryUpgradeErrorRequest(); + message.portId = object.portId ?? ""; + message.channelId = object.channelId ?? ""; + return message; + }, + fromAmino(object: QueryUpgradeErrorRequestAmino): QueryUpgradeErrorRequest { + const message = createBaseQueryUpgradeErrorRequest(); + if (object.port_id !== undefined && object.port_id !== null) { + message.portId = object.port_id; + } + if (object.channel_id !== undefined && object.channel_id !== null) { + message.channelId = object.channel_id; + } + return message; + }, + toAmino(message: QueryUpgradeErrorRequest): QueryUpgradeErrorRequestAmino { + const obj: any = {}; + obj.port_id = message.portId; + obj.channel_id = message.channelId; + return obj; + }, + fromAminoMsg(object: QueryUpgradeErrorRequestAminoMsg): QueryUpgradeErrorRequest { + return QueryUpgradeErrorRequest.fromAmino(object.value); + }, + toAminoMsg(message: QueryUpgradeErrorRequest): QueryUpgradeErrorRequestAminoMsg { + return { + type: "cosmos-sdk/QueryUpgradeErrorRequest", + value: QueryUpgradeErrorRequest.toAmino(message) + }; + }, + fromProtoMsg(message: QueryUpgradeErrorRequestProtoMsg): QueryUpgradeErrorRequest { + return QueryUpgradeErrorRequest.decode(message.value); + }, + toProto(message: QueryUpgradeErrorRequest): Uint8Array { + return QueryUpgradeErrorRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryUpgradeErrorRequest): QueryUpgradeErrorRequestProtoMsg { + return { + typeUrl: "/ibc.core.channel.v1.QueryUpgradeErrorRequest", + value: QueryUpgradeErrorRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryUpgradeErrorRequest.typeUrl, QueryUpgradeErrorRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryUpgradeErrorRequest.aminoType, QueryUpgradeErrorRequest.typeUrl); +function createBaseQueryUpgradeErrorResponse(): QueryUpgradeErrorResponse { + return { + errorReceipt: ErrorReceipt.fromPartial({}), + proof: new Uint8Array(), + proofHeight: Height.fromPartial({}) + }; +} +export const QueryUpgradeErrorResponse = { + typeUrl: "/ibc.core.channel.v1.QueryUpgradeErrorResponse", + aminoType: "cosmos-sdk/QueryUpgradeErrorResponse", + is(o: any): o is QueryUpgradeErrorResponse { + return o && (o.$typeUrl === QueryUpgradeErrorResponse.typeUrl || ErrorReceipt.is(o.errorReceipt) && (o.proof instanceof Uint8Array || typeof o.proof === "string") && Height.is(o.proofHeight)); + }, + isSDK(o: any): o is QueryUpgradeErrorResponseSDKType { + return o && (o.$typeUrl === QueryUpgradeErrorResponse.typeUrl || ErrorReceipt.isSDK(o.error_receipt) && (o.proof instanceof Uint8Array || typeof o.proof === "string") && Height.isSDK(o.proof_height)); + }, + isAmino(o: any): o is QueryUpgradeErrorResponseAmino { + return o && (o.$typeUrl === QueryUpgradeErrorResponse.typeUrl || ErrorReceipt.isAmino(o.error_receipt) && (o.proof instanceof Uint8Array || typeof o.proof === "string") && Height.isAmino(o.proof_height)); + }, + encode(message: QueryUpgradeErrorResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.errorReceipt !== undefined) { + ErrorReceipt.encode(message.errorReceipt, writer.uint32(10).fork()).ldelim(); + } + if (message.proof.length !== 0) { + writer.uint32(18).bytes(message.proof); + } + if (message.proofHeight !== undefined) { + Height.encode(message.proofHeight, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryUpgradeErrorResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryUpgradeErrorResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.errorReceipt = ErrorReceipt.decode(reader, reader.uint32()); + break; + case 2: + message.proof = reader.bytes(); + break; + case 3: + message.proofHeight = Height.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): QueryUpgradeErrorResponse { + return { + errorReceipt: isSet(object.errorReceipt) ? ErrorReceipt.fromJSON(object.errorReceipt) : undefined, + proof: isSet(object.proof) ? bytesFromBase64(object.proof) : new Uint8Array(), + proofHeight: isSet(object.proofHeight) ? Height.fromJSON(object.proofHeight) : undefined + }; + }, + toJSON(message: QueryUpgradeErrorResponse): unknown { + const obj: any = {}; + message.errorReceipt !== undefined && (obj.errorReceipt = message.errorReceipt ? ErrorReceipt.toJSON(message.errorReceipt) : undefined); + message.proof !== undefined && (obj.proof = base64FromBytes(message.proof !== undefined ? message.proof : new Uint8Array())); + message.proofHeight !== undefined && (obj.proofHeight = message.proofHeight ? Height.toJSON(message.proofHeight) : undefined); + return obj; + }, + fromPartial(object: Partial): QueryUpgradeErrorResponse { + const message = createBaseQueryUpgradeErrorResponse(); + message.errorReceipt = object.errorReceipt !== undefined && object.errorReceipt !== null ? ErrorReceipt.fromPartial(object.errorReceipt) : undefined; + message.proof = object.proof ?? new Uint8Array(); + message.proofHeight = object.proofHeight !== undefined && object.proofHeight !== null ? Height.fromPartial(object.proofHeight) : undefined; + return message; + }, + fromAmino(object: QueryUpgradeErrorResponseAmino): QueryUpgradeErrorResponse { + const message = createBaseQueryUpgradeErrorResponse(); + if (object.error_receipt !== undefined && object.error_receipt !== null) { + message.errorReceipt = ErrorReceipt.fromAmino(object.error_receipt); + } + if (object.proof !== undefined && object.proof !== null) { + message.proof = bytesFromBase64(object.proof); + } + if (object.proof_height !== undefined && object.proof_height !== null) { + message.proofHeight = Height.fromAmino(object.proof_height); + } + return message; + }, + toAmino(message: QueryUpgradeErrorResponse): QueryUpgradeErrorResponseAmino { + const obj: any = {}; + obj.error_receipt = message.errorReceipt ? ErrorReceipt.toAmino(message.errorReceipt) : undefined; + obj.proof = message.proof ? base64FromBytes(message.proof) : undefined; + obj.proof_height = message.proofHeight ? Height.toAmino(message.proofHeight) : {}; + return obj; + }, + fromAminoMsg(object: QueryUpgradeErrorResponseAminoMsg): QueryUpgradeErrorResponse { + return QueryUpgradeErrorResponse.fromAmino(object.value); + }, + toAminoMsg(message: QueryUpgradeErrorResponse): QueryUpgradeErrorResponseAminoMsg { + return { + type: "cosmos-sdk/QueryUpgradeErrorResponse", + value: QueryUpgradeErrorResponse.toAmino(message) + }; + }, + fromProtoMsg(message: QueryUpgradeErrorResponseProtoMsg): QueryUpgradeErrorResponse { + return QueryUpgradeErrorResponse.decode(message.value); + }, + toProto(message: QueryUpgradeErrorResponse): Uint8Array { + return QueryUpgradeErrorResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryUpgradeErrorResponse): QueryUpgradeErrorResponseProtoMsg { + return { + typeUrl: "/ibc.core.channel.v1.QueryUpgradeErrorResponse", + value: QueryUpgradeErrorResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryUpgradeErrorResponse.typeUrl, QueryUpgradeErrorResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryUpgradeErrorResponse.aminoType, QueryUpgradeErrorResponse.typeUrl); +function createBaseQueryUpgradeRequest(): QueryUpgradeRequest { + return { + portId: "", + channelId: "" + }; +} +export const QueryUpgradeRequest = { + typeUrl: "/ibc.core.channel.v1.QueryUpgradeRequest", + aminoType: "cosmos-sdk/QueryUpgradeRequest", + is(o: any): o is QueryUpgradeRequest { + return o && (o.$typeUrl === QueryUpgradeRequest.typeUrl || typeof o.portId === "string" && typeof o.channelId === "string"); + }, + isSDK(o: any): o is QueryUpgradeRequestSDKType { + return o && (o.$typeUrl === QueryUpgradeRequest.typeUrl || typeof o.port_id === "string" && typeof o.channel_id === "string"); + }, + isAmino(o: any): o is QueryUpgradeRequestAmino { + return o && (o.$typeUrl === QueryUpgradeRequest.typeUrl || typeof o.port_id === "string" && typeof o.channel_id === "string"); + }, + encode(message: QueryUpgradeRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.portId !== "") { + writer.uint32(10).string(message.portId); + } + if (message.channelId !== "") { + writer.uint32(18).string(message.channelId); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryUpgradeRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryUpgradeRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.portId = reader.string(); + break; + case 2: + message.channelId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): QueryUpgradeRequest { + return { + portId: isSet(object.portId) ? String(object.portId) : "", + channelId: isSet(object.channelId) ? String(object.channelId) : "" + }; + }, + toJSON(message: QueryUpgradeRequest): unknown { + const obj: any = {}; + message.portId !== undefined && (obj.portId = message.portId); + message.channelId !== undefined && (obj.channelId = message.channelId); + return obj; + }, + fromPartial(object: Partial): QueryUpgradeRequest { + const message = createBaseQueryUpgradeRequest(); + message.portId = object.portId ?? ""; + message.channelId = object.channelId ?? ""; + return message; + }, + fromAmino(object: QueryUpgradeRequestAmino): QueryUpgradeRequest { + const message = createBaseQueryUpgradeRequest(); + if (object.port_id !== undefined && object.port_id !== null) { + message.portId = object.port_id; + } + if (object.channel_id !== undefined && object.channel_id !== null) { + message.channelId = object.channel_id; + } + return message; + }, + toAmino(message: QueryUpgradeRequest): QueryUpgradeRequestAmino { + const obj: any = {}; + obj.port_id = message.portId; + obj.channel_id = message.channelId; + return obj; + }, + fromAminoMsg(object: QueryUpgradeRequestAminoMsg): QueryUpgradeRequest { + return QueryUpgradeRequest.fromAmino(object.value); + }, + toAminoMsg(message: QueryUpgradeRequest): QueryUpgradeRequestAminoMsg { + return { + type: "cosmos-sdk/QueryUpgradeRequest", + value: QueryUpgradeRequest.toAmino(message) + }; + }, + fromProtoMsg(message: QueryUpgradeRequestProtoMsg): QueryUpgradeRequest { + return QueryUpgradeRequest.decode(message.value); + }, + toProto(message: QueryUpgradeRequest): Uint8Array { + return QueryUpgradeRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryUpgradeRequest): QueryUpgradeRequestProtoMsg { + return { + typeUrl: "/ibc.core.channel.v1.QueryUpgradeRequest", + value: QueryUpgradeRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryUpgradeRequest.typeUrl, QueryUpgradeRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryUpgradeRequest.aminoType, QueryUpgradeRequest.typeUrl); +function createBaseQueryUpgradeResponse(): QueryUpgradeResponse { + return { + upgrade: Upgrade.fromPartial({}), + proof: new Uint8Array(), + proofHeight: Height.fromPartial({}) + }; +} +export const QueryUpgradeResponse = { + typeUrl: "/ibc.core.channel.v1.QueryUpgradeResponse", + aminoType: "cosmos-sdk/QueryUpgradeResponse", + is(o: any): o is QueryUpgradeResponse { + return o && (o.$typeUrl === QueryUpgradeResponse.typeUrl || Upgrade.is(o.upgrade) && (o.proof instanceof Uint8Array || typeof o.proof === "string") && Height.is(o.proofHeight)); + }, + isSDK(o: any): o is QueryUpgradeResponseSDKType { + return o && (o.$typeUrl === QueryUpgradeResponse.typeUrl || Upgrade.isSDK(o.upgrade) && (o.proof instanceof Uint8Array || typeof o.proof === "string") && Height.isSDK(o.proof_height)); + }, + isAmino(o: any): o is QueryUpgradeResponseAmino { + return o && (o.$typeUrl === QueryUpgradeResponse.typeUrl || Upgrade.isAmino(o.upgrade) && (o.proof instanceof Uint8Array || typeof o.proof === "string") && Height.isAmino(o.proof_height)); + }, + encode(message: QueryUpgradeResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.upgrade !== undefined) { + Upgrade.encode(message.upgrade, writer.uint32(10).fork()).ldelim(); + } + if (message.proof.length !== 0) { + writer.uint32(18).bytes(message.proof); + } + if (message.proofHeight !== undefined) { + Height.encode(message.proofHeight, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryUpgradeResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryUpgradeResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.upgrade = Upgrade.decode(reader, reader.uint32()); + break; + case 2: + message.proof = reader.bytes(); + break; + case 3: + message.proofHeight = Height.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): QueryUpgradeResponse { + return { + upgrade: isSet(object.upgrade) ? Upgrade.fromJSON(object.upgrade) : undefined, + proof: isSet(object.proof) ? bytesFromBase64(object.proof) : new Uint8Array(), + proofHeight: isSet(object.proofHeight) ? Height.fromJSON(object.proofHeight) : undefined + }; + }, + toJSON(message: QueryUpgradeResponse): unknown { + const obj: any = {}; + message.upgrade !== undefined && (obj.upgrade = message.upgrade ? Upgrade.toJSON(message.upgrade) : undefined); + message.proof !== undefined && (obj.proof = base64FromBytes(message.proof !== undefined ? message.proof : new Uint8Array())); + message.proofHeight !== undefined && (obj.proofHeight = message.proofHeight ? Height.toJSON(message.proofHeight) : undefined); + return obj; + }, + fromPartial(object: Partial): QueryUpgradeResponse { + const message = createBaseQueryUpgradeResponse(); + message.upgrade = object.upgrade !== undefined && object.upgrade !== null ? Upgrade.fromPartial(object.upgrade) : undefined; + message.proof = object.proof ?? new Uint8Array(); + message.proofHeight = object.proofHeight !== undefined && object.proofHeight !== null ? Height.fromPartial(object.proofHeight) : undefined; + return message; + }, + fromAmino(object: QueryUpgradeResponseAmino): QueryUpgradeResponse { + const message = createBaseQueryUpgradeResponse(); + if (object.upgrade !== undefined && object.upgrade !== null) { + message.upgrade = Upgrade.fromAmino(object.upgrade); + } + if (object.proof !== undefined && object.proof !== null) { + message.proof = bytesFromBase64(object.proof); + } + if (object.proof_height !== undefined && object.proof_height !== null) { + message.proofHeight = Height.fromAmino(object.proof_height); + } + return message; + }, + toAmino(message: QueryUpgradeResponse): QueryUpgradeResponseAmino { + const obj: any = {}; + obj.upgrade = message.upgrade ? Upgrade.toAmino(message.upgrade) : undefined; + obj.proof = message.proof ? base64FromBytes(message.proof) : undefined; + obj.proof_height = message.proofHeight ? Height.toAmino(message.proofHeight) : {}; + return obj; + }, + fromAminoMsg(object: QueryUpgradeResponseAminoMsg): QueryUpgradeResponse { + return QueryUpgradeResponse.fromAmino(object.value); + }, + toAminoMsg(message: QueryUpgradeResponse): QueryUpgradeResponseAminoMsg { + return { + type: "cosmos-sdk/QueryUpgradeResponse", + value: QueryUpgradeResponse.toAmino(message) + }; + }, + fromProtoMsg(message: QueryUpgradeResponseProtoMsg): QueryUpgradeResponse { + return QueryUpgradeResponse.decode(message.value); + }, + toProto(message: QueryUpgradeResponse): Uint8Array { + return QueryUpgradeResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryUpgradeResponse): QueryUpgradeResponseProtoMsg { + return { + typeUrl: "/ibc.core.channel.v1.QueryUpgradeResponse", + value: QueryUpgradeResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryUpgradeResponse.typeUrl, QueryUpgradeResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryUpgradeResponse.aminoType, QueryUpgradeResponse.typeUrl); +function createBaseQueryChannelParamsRequest(): QueryChannelParamsRequest { + return {}; +} +export const QueryChannelParamsRequest = { + typeUrl: "/ibc.core.channel.v1.QueryChannelParamsRequest", + aminoType: "cosmos-sdk/QueryChannelParamsRequest", + is(o: any): o is QueryChannelParamsRequest { + return o && o.$typeUrl === QueryChannelParamsRequest.typeUrl; + }, + isSDK(o: any): o is QueryChannelParamsRequestSDKType { + return o && o.$typeUrl === QueryChannelParamsRequest.typeUrl; + }, + isAmino(o: any): o is QueryChannelParamsRequestAmino { + return o && o.$typeUrl === QueryChannelParamsRequest.typeUrl; + }, + encode(_: QueryChannelParamsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryChannelParamsRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryChannelParamsRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(_: any): QueryChannelParamsRequest { + return {}; + }, + toJSON(_: QueryChannelParamsRequest): unknown { + const obj: any = {}; + return obj; + }, + fromPartial(_: Partial): QueryChannelParamsRequest { + const message = createBaseQueryChannelParamsRequest(); + return message; + }, + fromAmino(_: QueryChannelParamsRequestAmino): QueryChannelParamsRequest { + const message = createBaseQueryChannelParamsRequest(); + return message; + }, + toAmino(_: QueryChannelParamsRequest): QueryChannelParamsRequestAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: QueryChannelParamsRequestAminoMsg): QueryChannelParamsRequest { + return QueryChannelParamsRequest.fromAmino(object.value); + }, + toAminoMsg(message: QueryChannelParamsRequest): QueryChannelParamsRequestAminoMsg { + return { + type: "cosmos-sdk/QueryChannelParamsRequest", + value: QueryChannelParamsRequest.toAmino(message) + }; + }, + fromProtoMsg(message: QueryChannelParamsRequestProtoMsg): QueryChannelParamsRequest { + return QueryChannelParamsRequest.decode(message.value); + }, + toProto(message: QueryChannelParamsRequest): Uint8Array { + return QueryChannelParamsRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryChannelParamsRequest): QueryChannelParamsRequestProtoMsg { + return { + typeUrl: "/ibc.core.channel.v1.QueryChannelParamsRequest", + value: QueryChannelParamsRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryChannelParamsRequest.typeUrl, QueryChannelParamsRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryChannelParamsRequest.aminoType, QueryChannelParamsRequest.typeUrl); +function createBaseQueryChannelParamsResponse(): QueryChannelParamsResponse { + return { + params: undefined + }; +} +export const QueryChannelParamsResponse = { + typeUrl: "/ibc.core.channel.v1.QueryChannelParamsResponse", + aminoType: "cosmos-sdk/QueryChannelParamsResponse", + is(o: any): o is QueryChannelParamsResponse { + return o && o.$typeUrl === QueryChannelParamsResponse.typeUrl; + }, + isSDK(o: any): o is QueryChannelParamsResponseSDKType { + return o && o.$typeUrl === QueryChannelParamsResponse.typeUrl; + }, + isAmino(o: any): o is QueryChannelParamsResponseAmino { + return o && o.$typeUrl === QueryChannelParamsResponse.typeUrl; + }, + encode(message: QueryChannelParamsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.params !== undefined) { + Params.encode(message.params, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryChannelParamsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryChannelParamsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.params = Params.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): QueryChannelParamsResponse { + return { + params: isSet(object.params) ? Params.fromJSON(object.params) : undefined + }; + }, + toJSON(message: QueryChannelParamsResponse): unknown { + const obj: any = {}; + message.params !== undefined && (obj.params = message.params ? Params.toJSON(message.params) : undefined); + return obj; + }, + fromPartial(object: Partial): QueryChannelParamsResponse { + const message = createBaseQueryChannelParamsResponse(); + message.params = object.params !== undefined && object.params !== null ? Params.fromPartial(object.params) : undefined; + return message; + }, + fromAmino(object: QueryChannelParamsResponseAmino): QueryChannelParamsResponse { + const message = createBaseQueryChannelParamsResponse(); + if (object.params !== undefined && object.params !== null) { + message.params = Params.fromAmino(object.params); + } + return message; + }, + toAmino(message: QueryChannelParamsResponse): QueryChannelParamsResponseAmino { + const obj: any = {}; + obj.params = message.params ? Params.toAmino(message.params) : undefined; + return obj; + }, + fromAminoMsg(object: QueryChannelParamsResponseAminoMsg): QueryChannelParamsResponse { + return QueryChannelParamsResponse.fromAmino(object.value); + }, + toAminoMsg(message: QueryChannelParamsResponse): QueryChannelParamsResponseAminoMsg { + return { + type: "cosmos-sdk/QueryChannelParamsResponse", + value: QueryChannelParamsResponse.toAmino(message) + }; + }, + fromProtoMsg(message: QueryChannelParamsResponseProtoMsg): QueryChannelParamsResponse { + return QueryChannelParamsResponse.decode(message.value); + }, + toProto(message: QueryChannelParamsResponse): Uint8Array { + return QueryChannelParamsResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryChannelParamsResponse): QueryChannelParamsResponseProtoMsg { + return { + typeUrl: "/ibc.core.channel.v1.QueryChannelParamsResponse", + value: QueryChannelParamsResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryChannelParamsResponse.typeUrl, QueryChannelParamsResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryChannelParamsResponse.aminoType, QueryChannelParamsResponse.typeUrl); \ No newline at end of file diff --git a/packages/osmojs/src/codegen/ibc/core/channel/v1/tx.amino.ts b/packages/osmojs/src/codegen/ibc/core/channel/v1/tx.amino.ts index 1e278a9dc..99a75e608 100644 --- a/packages/osmojs/src/codegen/ibc/core/channel/v1/tx.amino.ts +++ b/packages/osmojs/src/codegen/ibc/core/channel/v1/tx.amino.ts @@ -1,5 +1,5 @@ //@ts-nocheck -import { MsgChannelOpenInit, MsgChannelOpenTry, MsgChannelOpenAck, MsgChannelOpenConfirm, MsgChannelCloseInit, MsgChannelCloseConfirm, MsgRecvPacket, MsgTimeout, MsgTimeoutOnClose, MsgAcknowledgement } from "./tx"; +import { MsgChannelOpenInit, MsgChannelOpenTry, MsgChannelOpenAck, MsgChannelOpenConfirm, MsgChannelCloseInit, MsgChannelCloseConfirm, MsgRecvPacket, MsgTimeout, MsgTimeoutOnClose, MsgAcknowledgement, MsgChannelUpgradeInit, MsgChannelUpgradeTry, MsgChannelUpgradeAck, MsgChannelUpgradeConfirm, MsgChannelUpgradeOpen, MsgChannelUpgradeTimeout, MsgChannelUpgradeCancel, MsgUpdateParams, MsgPruneAcknowledgements } from "./tx"; export const AminoConverter = { "/ibc.core.channel.v1.MsgChannelOpenInit": { aminoType: "cosmos-sdk/MsgChannelOpenInit", @@ -50,5 +50,50 @@ export const AminoConverter = { aminoType: "cosmos-sdk/MsgAcknowledgement", toAmino: MsgAcknowledgement.toAmino, fromAmino: MsgAcknowledgement.fromAmino + }, + "/ibc.core.channel.v1.MsgChannelUpgradeInit": { + aminoType: "cosmos-sdk/MsgChannelUpgradeInit", + toAmino: MsgChannelUpgradeInit.toAmino, + fromAmino: MsgChannelUpgradeInit.fromAmino + }, + "/ibc.core.channel.v1.MsgChannelUpgradeTry": { + aminoType: "cosmos-sdk/MsgChannelUpgradeTry", + toAmino: MsgChannelUpgradeTry.toAmino, + fromAmino: MsgChannelUpgradeTry.fromAmino + }, + "/ibc.core.channel.v1.MsgChannelUpgradeAck": { + aminoType: "cosmos-sdk/MsgChannelUpgradeAck", + toAmino: MsgChannelUpgradeAck.toAmino, + fromAmino: MsgChannelUpgradeAck.fromAmino + }, + "/ibc.core.channel.v1.MsgChannelUpgradeConfirm": { + aminoType: "cosmos-sdk/MsgChannelUpgradeConfirm", + toAmino: MsgChannelUpgradeConfirm.toAmino, + fromAmino: MsgChannelUpgradeConfirm.fromAmino + }, + "/ibc.core.channel.v1.MsgChannelUpgradeOpen": { + aminoType: "cosmos-sdk/MsgChannelUpgradeOpen", + toAmino: MsgChannelUpgradeOpen.toAmino, + fromAmino: MsgChannelUpgradeOpen.fromAmino + }, + "/ibc.core.channel.v1.MsgChannelUpgradeTimeout": { + aminoType: "cosmos-sdk/MsgChannelUpgradeTimeout", + toAmino: MsgChannelUpgradeTimeout.toAmino, + fromAmino: MsgChannelUpgradeTimeout.fromAmino + }, + "/ibc.core.channel.v1.MsgChannelUpgradeCancel": { + aminoType: "cosmos-sdk/MsgChannelUpgradeCancel", + toAmino: MsgChannelUpgradeCancel.toAmino, + fromAmino: MsgChannelUpgradeCancel.fromAmino + }, + "/ibc.core.channel.v1.MsgUpdateParams": { + aminoType: "cosmos-sdk/MsgUpdateParams", + toAmino: MsgUpdateParams.toAmino, + fromAmino: MsgUpdateParams.fromAmino + }, + "/ibc.core.channel.v1.MsgPruneAcknowledgements": { + aminoType: "cosmos-sdk/MsgPruneAcknowledgements", + toAmino: MsgPruneAcknowledgements.toAmino, + fromAmino: MsgPruneAcknowledgements.fromAmino } }; \ No newline at end of file diff --git a/packages/osmojs/src/codegen/ibc/core/channel/v1/tx.registry.ts b/packages/osmojs/src/codegen/ibc/core/channel/v1/tx.registry.ts index dbcbbecd7..7b42fecf6 100644 --- a/packages/osmojs/src/codegen/ibc/core/channel/v1/tx.registry.ts +++ b/packages/osmojs/src/codegen/ibc/core/channel/v1/tx.registry.ts @@ -1,7 +1,7 @@ //@ts-nocheck import { GeneratedType, Registry } from "@cosmjs/proto-signing"; -import { MsgChannelOpenInit, MsgChannelOpenTry, MsgChannelOpenAck, MsgChannelOpenConfirm, MsgChannelCloseInit, MsgChannelCloseConfirm, MsgRecvPacket, MsgTimeout, MsgTimeoutOnClose, MsgAcknowledgement } from "./tx"; -export const registry: ReadonlyArray<[string, GeneratedType]> = [["/ibc.core.channel.v1.MsgChannelOpenInit", MsgChannelOpenInit], ["/ibc.core.channel.v1.MsgChannelOpenTry", MsgChannelOpenTry], ["/ibc.core.channel.v1.MsgChannelOpenAck", MsgChannelOpenAck], ["/ibc.core.channel.v1.MsgChannelOpenConfirm", MsgChannelOpenConfirm], ["/ibc.core.channel.v1.MsgChannelCloseInit", MsgChannelCloseInit], ["/ibc.core.channel.v1.MsgChannelCloseConfirm", MsgChannelCloseConfirm], ["/ibc.core.channel.v1.MsgRecvPacket", MsgRecvPacket], ["/ibc.core.channel.v1.MsgTimeout", MsgTimeout], ["/ibc.core.channel.v1.MsgTimeoutOnClose", MsgTimeoutOnClose], ["/ibc.core.channel.v1.MsgAcknowledgement", MsgAcknowledgement]]; +import { MsgChannelOpenInit, MsgChannelOpenTry, MsgChannelOpenAck, MsgChannelOpenConfirm, MsgChannelCloseInit, MsgChannelCloseConfirm, MsgRecvPacket, MsgTimeout, MsgTimeoutOnClose, MsgAcknowledgement, MsgChannelUpgradeInit, MsgChannelUpgradeTry, MsgChannelUpgradeAck, MsgChannelUpgradeConfirm, MsgChannelUpgradeOpen, MsgChannelUpgradeTimeout, MsgChannelUpgradeCancel, MsgUpdateParams, MsgPruneAcknowledgements } from "./tx"; +export const registry: ReadonlyArray<[string, GeneratedType]> = [["/ibc.core.channel.v1.MsgChannelOpenInit", MsgChannelOpenInit], ["/ibc.core.channel.v1.MsgChannelOpenTry", MsgChannelOpenTry], ["/ibc.core.channel.v1.MsgChannelOpenAck", MsgChannelOpenAck], ["/ibc.core.channel.v1.MsgChannelOpenConfirm", MsgChannelOpenConfirm], ["/ibc.core.channel.v1.MsgChannelCloseInit", MsgChannelCloseInit], ["/ibc.core.channel.v1.MsgChannelCloseConfirm", MsgChannelCloseConfirm], ["/ibc.core.channel.v1.MsgRecvPacket", MsgRecvPacket], ["/ibc.core.channel.v1.MsgTimeout", MsgTimeout], ["/ibc.core.channel.v1.MsgTimeoutOnClose", MsgTimeoutOnClose], ["/ibc.core.channel.v1.MsgAcknowledgement", MsgAcknowledgement], ["/ibc.core.channel.v1.MsgChannelUpgradeInit", MsgChannelUpgradeInit], ["/ibc.core.channel.v1.MsgChannelUpgradeTry", MsgChannelUpgradeTry], ["/ibc.core.channel.v1.MsgChannelUpgradeAck", MsgChannelUpgradeAck], ["/ibc.core.channel.v1.MsgChannelUpgradeConfirm", MsgChannelUpgradeConfirm], ["/ibc.core.channel.v1.MsgChannelUpgradeOpen", MsgChannelUpgradeOpen], ["/ibc.core.channel.v1.MsgChannelUpgradeTimeout", MsgChannelUpgradeTimeout], ["/ibc.core.channel.v1.MsgChannelUpgradeCancel", MsgChannelUpgradeCancel], ["/ibc.core.channel.v1.MsgUpdateParams", MsgUpdateParams], ["/ibc.core.channel.v1.MsgPruneAcknowledgements", MsgPruneAcknowledgements]]; export const load = (protoRegistry: Registry) => { registry.forEach(([typeUrl, mod]) => { protoRegistry.register(typeUrl, mod); @@ -68,6 +68,60 @@ export const MessageComposer = { typeUrl: "/ibc.core.channel.v1.MsgAcknowledgement", value: MsgAcknowledgement.encode(value).finish() }; + }, + channelUpgradeInit(value: MsgChannelUpgradeInit) { + return { + typeUrl: "/ibc.core.channel.v1.MsgChannelUpgradeInit", + value: MsgChannelUpgradeInit.encode(value).finish() + }; + }, + channelUpgradeTry(value: MsgChannelUpgradeTry) { + return { + typeUrl: "/ibc.core.channel.v1.MsgChannelUpgradeTry", + value: MsgChannelUpgradeTry.encode(value).finish() + }; + }, + channelUpgradeAck(value: MsgChannelUpgradeAck) { + return { + typeUrl: "/ibc.core.channel.v1.MsgChannelUpgradeAck", + value: MsgChannelUpgradeAck.encode(value).finish() + }; + }, + channelUpgradeConfirm(value: MsgChannelUpgradeConfirm) { + return { + typeUrl: "/ibc.core.channel.v1.MsgChannelUpgradeConfirm", + value: MsgChannelUpgradeConfirm.encode(value).finish() + }; + }, + channelUpgradeOpen(value: MsgChannelUpgradeOpen) { + return { + typeUrl: "/ibc.core.channel.v1.MsgChannelUpgradeOpen", + value: MsgChannelUpgradeOpen.encode(value).finish() + }; + }, + channelUpgradeTimeout(value: MsgChannelUpgradeTimeout) { + return { + typeUrl: "/ibc.core.channel.v1.MsgChannelUpgradeTimeout", + value: MsgChannelUpgradeTimeout.encode(value).finish() + }; + }, + channelUpgradeCancel(value: MsgChannelUpgradeCancel) { + return { + typeUrl: "/ibc.core.channel.v1.MsgChannelUpgradeCancel", + value: MsgChannelUpgradeCancel.encode(value).finish() + }; + }, + updateChannelParams(value: MsgUpdateParams) { + return { + typeUrl: "/ibc.core.channel.v1.MsgUpdateParams", + value: MsgUpdateParams.encode(value).finish() + }; + }, + pruneAcknowledgements(value: MsgPruneAcknowledgements) { + return { + typeUrl: "/ibc.core.channel.v1.MsgPruneAcknowledgements", + value: MsgPruneAcknowledgements.encode(value).finish() + }; } }, withTypeUrl: { @@ -130,6 +184,292 @@ export const MessageComposer = { typeUrl: "/ibc.core.channel.v1.MsgAcknowledgement", value }; + }, + channelUpgradeInit(value: MsgChannelUpgradeInit) { + return { + typeUrl: "/ibc.core.channel.v1.MsgChannelUpgradeInit", + value + }; + }, + channelUpgradeTry(value: MsgChannelUpgradeTry) { + return { + typeUrl: "/ibc.core.channel.v1.MsgChannelUpgradeTry", + value + }; + }, + channelUpgradeAck(value: MsgChannelUpgradeAck) { + return { + typeUrl: "/ibc.core.channel.v1.MsgChannelUpgradeAck", + value + }; + }, + channelUpgradeConfirm(value: MsgChannelUpgradeConfirm) { + return { + typeUrl: "/ibc.core.channel.v1.MsgChannelUpgradeConfirm", + value + }; + }, + channelUpgradeOpen(value: MsgChannelUpgradeOpen) { + return { + typeUrl: "/ibc.core.channel.v1.MsgChannelUpgradeOpen", + value + }; + }, + channelUpgradeTimeout(value: MsgChannelUpgradeTimeout) { + return { + typeUrl: "/ibc.core.channel.v1.MsgChannelUpgradeTimeout", + value + }; + }, + channelUpgradeCancel(value: MsgChannelUpgradeCancel) { + return { + typeUrl: "/ibc.core.channel.v1.MsgChannelUpgradeCancel", + value + }; + }, + updateChannelParams(value: MsgUpdateParams) { + return { + typeUrl: "/ibc.core.channel.v1.MsgUpdateParams", + value + }; + }, + pruneAcknowledgements(value: MsgPruneAcknowledgements) { + return { + typeUrl: "/ibc.core.channel.v1.MsgPruneAcknowledgements", + value + }; + } + }, + toJSON: { + channelOpenInit(value: MsgChannelOpenInit) { + return { + typeUrl: "/ibc.core.channel.v1.MsgChannelOpenInit", + value: MsgChannelOpenInit.toJSON(value) + }; + }, + channelOpenTry(value: MsgChannelOpenTry) { + return { + typeUrl: "/ibc.core.channel.v1.MsgChannelOpenTry", + value: MsgChannelOpenTry.toJSON(value) + }; + }, + channelOpenAck(value: MsgChannelOpenAck) { + return { + typeUrl: "/ibc.core.channel.v1.MsgChannelOpenAck", + value: MsgChannelOpenAck.toJSON(value) + }; + }, + channelOpenConfirm(value: MsgChannelOpenConfirm) { + return { + typeUrl: "/ibc.core.channel.v1.MsgChannelOpenConfirm", + value: MsgChannelOpenConfirm.toJSON(value) + }; + }, + channelCloseInit(value: MsgChannelCloseInit) { + return { + typeUrl: "/ibc.core.channel.v1.MsgChannelCloseInit", + value: MsgChannelCloseInit.toJSON(value) + }; + }, + channelCloseConfirm(value: MsgChannelCloseConfirm) { + return { + typeUrl: "/ibc.core.channel.v1.MsgChannelCloseConfirm", + value: MsgChannelCloseConfirm.toJSON(value) + }; + }, + recvPacket(value: MsgRecvPacket) { + return { + typeUrl: "/ibc.core.channel.v1.MsgRecvPacket", + value: MsgRecvPacket.toJSON(value) + }; + }, + timeout(value: MsgTimeout) { + return { + typeUrl: "/ibc.core.channel.v1.MsgTimeout", + value: MsgTimeout.toJSON(value) + }; + }, + timeoutOnClose(value: MsgTimeoutOnClose) { + return { + typeUrl: "/ibc.core.channel.v1.MsgTimeoutOnClose", + value: MsgTimeoutOnClose.toJSON(value) + }; + }, + acknowledgement(value: MsgAcknowledgement) { + return { + typeUrl: "/ibc.core.channel.v1.MsgAcknowledgement", + value: MsgAcknowledgement.toJSON(value) + }; + }, + channelUpgradeInit(value: MsgChannelUpgradeInit) { + return { + typeUrl: "/ibc.core.channel.v1.MsgChannelUpgradeInit", + value: MsgChannelUpgradeInit.toJSON(value) + }; + }, + channelUpgradeTry(value: MsgChannelUpgradeTry) { + return { + typeUrl: "/ibc.core.channel.v1.MsgChannelUpgradeTry", + value: MsgChannelUpgradeTry.toJSON(value) + }; + }, + channelUpgradeAck(value: MsgChannelUpgradeAck) { + return { + typeUrl: "/ibc.core.channel.v1.MsgChannelUpgradeAck", + value: MsgChannelUpgradeAck.toJSON(value) + }; + }, + channelUpgradeConfirm(value: MsgChannelUpgradeConfirm) { + return { + typeUrl: "/ibc.core.channel.v1.MsgChannelUpgradeConfirm", + value: MsgChannelUpgradeConfirm.toJSON(value) + }; + }, + channelUpgradeOpen(value: MsgChannelUpgradeOpen) { + return { + typeUrl: "/ibc.core.channel.v1.MsgChannelUpgradeOpen", + value: MsgChannelUpgradeOpen.toJSON(value) + }; + }, + channelUpgradeTimeout(value: MsgChannelUpgradeTimeout) { + return { + typeUrl: "/ibc.core.channel.v1.MsgChannelUpgradeTimeout", + value: MsgChannelUpgradeTimeout.toJSON(value) + }; + }, + channelUpgradeCancel(value: MsgChannelUpgradeCancel) { + return { + typeUrl: "/ibc.core.channel.v1.MsgChannelUpgradeCancel", + value: MsgChannelUpgradeCancel.toJSON(value) + }; + }, + updateChannelParams(value: MsgUpdateParams) { + return { + typeUrl: "/ibc.core.channel.v1.MsgUpdateParams", + value: MsgUpdateParams.toJSON(value) + }; + }, + pruneAcknowledgements(value: MsgPruneAcknowledgements) { + return { + typeUrl: "/ibc.core.channel.v1.MsgPruneAcknowledgements", + value: MsgPruneAcknowledgements.toJSON(value) + }; + } + }, + fromJSON: { + channelOpenInit(value: any) { + return { + typeUrl: "/ibc.core.channel.v1.MsgChannelOpenInit", + value: MsgChannelOpenInit.fromJSON(value) + }; + }, + channelOpenTry(value: any) { + return { + typeUrl: "/ibc.core.channel.v1.MsgChannelOpenTry", + value: MsgChannelOpenTry.fromJSON(value) + }; + }, + channelOpenAck(value: any) { + return { + typeUrl: "/ibc.core.channel.v1.MsgChannelOpenAck", + value: MsgChannelOpenAck.fromJSON(value) + }; + }, + channelOpenConfirm(value: any) { + return { + typeUrl: "/ibc.core.channel.v1.MsgChannelOpenConfirm", + value: MsgChannelOpenConfirm.fromJSON(value) + }; + }, + channelCloseInit(value: any) { + return { + typeUrl: "/ibc.core.channel.v1.MsgChannelCloseInit", + value: MsgChannelCloseInit.fromJSON(value) + }; + }, + channelCloseConfirm(value: any) { + return { + typeUrl: "/ibc.core.channel.v1.MsgChannelCloseConfirm", + value: MsgChannelCloseConfirm.fromJSON(value) + }; + }, + recvPacket(value: any) { + return { + typeUrl: "/ibc.core.channel.v1.MsgRecvPacket", + value: MsgRecvPacket.fromJSON(value) + }; + }, + timeout(value: any) { + return { + typeUrl: "/ibc.core.channel.v1.MsgTimeout", + value: MsgTimeout.fromJSON(value) + }; + }, + timeoutOnClose(value: any) { + return { + typeUrl: "/ibc.core.channel.v1.MsgTimeoutOnClose", + value: MsgTimeoutOnClose.fromJSON(value) + }; + }, + acknowledgement(value: any) { + return { + typeUrl: "/ibc.core.channel.v1.MsgAcknowledgement", + value: MsgAcknowledgement.fromJSON(value) + }; + }, + channelUpgradeInit(value: any) { + return { + typeUrl: "/ibc.core.channel.v1.MsgChannelUpgradeInit", + value: MsgChannelUpgradeInit.fromJSON(value) + }; + }, + channelUpgradeTry(value: any) { + return { + typeUrl: "/ibc.core.channel.v1.MsgChannelUpgradeTry", + value: MsgChannelUpgradeTry.fromJSON(value) + }; + }, + channelUpgradeAck(value: any) { + return { + typeUrl: "/ibc.core.channel.v1.MsgChannelUpgradeAck", + value: MsgChannelUpgradeAck.fromJSON(value) + }; + }, + channelUpgradeConfirm(value: any) { + return { + typeUrl: "/ibc.core.channel.v1.MsgChannelUpgradeConfirm", + value: MsgChannelUpgradeConfirm.fromJSON(value) + }; + }, + channelUpgradeOpen(value: any) { + return { + typeUrl: "/ibc.core.channel.v1.MsgChannelUpgradeOpen", + value: MsgChannelUpgradeOpen.fromJSON(value) + }; + }, + channelUpgradeTimeout(value: any) { + return { + typeUrl: "/ibc.core.channel.v1.MsgChannelUpgradeTimeout", + value: MsgChannelUpgradeTimeout.fromJSON(value) + }; + }, + channelUpgradeCancel(value: any) { + return { + typeUrl: "/ibc.core.channel.v1.MsgChannelUpgradeCancel", + value: MsgChannelUpgradeCancel.fromJSON(value) + }; + }, + updateChannelParams(value: any) { + return { + typeUrl: "/ibc.core.channel.v1.MsgUpdateParams", + value: MsgUpdateParams.fromJSON(value) + }; + }, + pruneAcknowledgements(value: any) { + return { + typeUrl: "/ibc.core.channel.v1.MsgPruneAcknowledgements", + value: MsgPruneAcknowledgements.fromJSON(value) + }; } }, fromPartial: { @@ -192,6 +532,60 @@ export const MessageComposer = { typeUrl: "/ibc.core.channel.v1.MsgAcknowledgement", value: MsgAcknowledgement.fromPartial(value) }; + }, + channelUpgradeInit(value: MsgChannelUpgradeInit) { + return { + typeUrl: "/ibc.core.channel.v1.MsgChannelUpgradeInit", + value: MsgChannelUpgradeInit.fromPartial(value) + }; + }, + channelUpgradeTry(value: MsgChannelUpgradeTry) { + return { + typeUrl: "/ibc.core.channel.v1.MsgChannelUpgradeTry", + value: MsgChannelUpgradeTry.fromPartial(value) + }; + }, + channelUpgradeAck(value: MsgChannelUpgradeAck) { + return { + typeUrl: "/ibc.core.channel.v1.MsgChannelUpgradeAck", + value: MsgChannelUpgradeAck.fromPartial(value) + }; + }, + channelUpgradeConfirm(value: MsgChannelUpgradeConfirm) { + return { + typeUrl: "/ibc.core.channel.v1.MsgChannelUpgradeConfirm", + value: MsgChannelUpgradeConfirm.fromPartial(value) + }; + }, + channelUpgradeOpen(value: MsgChannelUpgradeOpen) { + return { + typeUrl: "/ibc.core.channel.v1.MsgChannelUpgradeOpen", + value: MsgChannelUpgradeOpen.fromPartial(value) + }; + }, + channelUpgradeTimeout(value: MsgChannelUpgradeTimeout) { + return { + typeUrl: "/ibc.core.channel.v1.MsgChannelUpgradeTimeout", + value: MsgChannelUpgradeTimeout.fromPartial(value) + }; + }, + channelUpgradeCancel(value: MsgChannelUpgradeCancel) { + return { + typeUrl: "/ibc.core.channel.v1.MsgChannelUpgradeCancel", + value: MsgChannelUpgradeCancel.fromPartial(value) + }; + }, + updateChannelParams(value: MsgUpdateParams) { + return { + typeUrl: "/ibc.core.channel.v1.MsgUpdateParams", + value: MsgUpdateParams.fromPartial(value) + }; + }, + pruneAcknowledgements(value: MsgPruneAcknowledgements) { + return { + typeUrl: "/ibc.core.channel.v1.MsgPruneAcknowledgements", + value: MsgPruneAcknowledgements.fromPartial(value) + }; } } }; \ No newline at end of file diff --git a/packages/osmojs/src/codegen/ibc/core/channel/v1/tx.rpc.msg.ts b/packages/osmojs/src/codegen/ibc/core/channel/v1/tx.rpc.msg.ts index 1429bd672..1b3e68450 100644 --- a/packages/osmojs/src/codegen/ibc/core/channel/v1/tx.rpc.msg.ts +++ b/packages/osmojs/src/codegen/ibc/core/channel/v1/tx.rpc.msg.ts @@ -1,6 +1,6 @@ import { Rpc } from "../../../../helpers"; import { BinaryReader } from "../../../../binary"; -import { MsgChannelOpenInit, MsgChannelOpenInitResponse, MsgChannelOpenTry, MsgChannelOpenTryResponse, MsgChannelOpenAck, MsgChannelOpenAckResponse, MsgChannelOpenConfirm, MsgChannelOpenConfirmResponse, MsgChannelCloseInit, MsgChannelCloseInitResponse, MsgChannelCloseConfirm, MsgChannelCloseConfirmResponse, MsgRecvPacket, MsgRecvPacketResponse, MsgTimeout, MsgTimeoutResponse, MsgTimeoutOnClose, MsgTimeoutOnCloseResponse, MsgAcknowledgement, MsgAcknowledgementResponse } from "./tx"; +import { MsgChannelOpenInit, MsgChannelOpenInitResponse, MsgChannelOpenTry, MsgChannelOpenTryResponse, MsgChannelOpenAck, MsgChannelOpenAckResponse, MsgChannelOpenConfirm, MsgChannelOpenConfirmResponse, MsgChannelCloseInit, MsgChannelCloseInitResponse, MsgChannelCloseConfirm, MsgChannelCloseConfirmResponse, MsgRecvPacket, MsgRecvPacketResponse, MsgTimeout, MsgTimeoutResponse, MsgTimeoutOnClose, MsgTimeoutOnCloseResponse, MsgAcknowledgement, MsgAcknowledgementResponse, MsgChannelUpgradeInit, MsgChannelUpgradeInitResponse, MsgChannelUpgradeTry, MsgChannelUpgradeTryResponse, MsgChannelUpgradeAck, MsgChannelUpgradeAckResponse, MsgChannelUpgradeConfirm, MsgChannelUpgradeConfirmResponse, MsgChannelUpgradeOpen, MsgChannelUpgradeOpenResponse, MsgChannelUpgradeTimeout, MsgChannelUpgradeTimeoutResponse, MsgChannelUpgradeCancel, MsgChannelUpgradeCancelResponse, MsgUpdateParams, MsgUpdateParamsResponse, MsgPruneAcknowledgements, MsgPruneAcknowledgementsResponse } from "./tx"; /** Msg defines the ibc/channel Msg service. */ export interface Msg { /** ChannelOpenInit defines a rpc handler method for MsgChannelOpenInit. */ @@ -26,6 +26,24 @@ export interface Msg { timeoutOnClose(request: MsgTimeoutOnClose): Promise; /** Acknowledgement defines a rpc handler method for MsgAcknowledgement. */ acknowledgement(request: MsgAcknowledgement): Promise; + /** ChannelUpgradeInit defines a rpc handler method for MsgChannelUpgradeInit. */ + channelUpgradeInit(request: MsgChannelUpgradeInit): Promise; + /** ChannelUpgradeTry defines a rpc handler method for MsgChannelUpgradeTry. */ + channelUpgradeTry(request: MsgChannelUpgradeTry): Promise; + /** ChannelUpgradeAck defines a rpc handler method for MsgChannelUpgradeAck. */ + channelUpgradeAck(request: MsgChannelUpgradeAck): Promise; + /** ChannelUpgradeConfirm defines a rpc handler method for MsgChannelUpgradeConfirm. */ + channelUpgradeConfirm(request: MsgChannelUpgradeConfirm): Promise; + /** ChannelUpgradeOpen defines a rpc handler method for MsgChannelUpgradeOpen. */ + channelUpgradeOpen(request: MsgChannelUpgradeOpen): Promise; + /** ChannelUpgradeTimeout defines a rpc handler method for MsgChannelUpgradeTimeout. */ + channelUpgradeTimeout(request: MsgChannelUpgradeTimeout): Promise; + /** ChannelUpgradeCancel defines a rpc handler method for MsgChannelUpgradeCancel. */ + channelUpgradeCancel(request: MsgChannelUpgradeCancel): Promise; + /** UpdateChannelParams defines a rpc handler method for MsgUpdateParams. */ + updateChannelParams(request: MsgUpdateParams): Promise; + /** PruneAcknowledgements defines a rpc handler method for MsgPruneAcknowledgements. */ + pruneAcknowledgements(request: MsgPruneAcknowledgements): Promise; } export class MsgClientImpl implements Msg { private readonly rpc: Rpc; @@ -41,6 +59,15 @@ export class MsgClientImpl implements Msg { this.timeout = this.timeout.bind(this); this.timeoutOnClose = this.timeoutOnClose.bind(this); this.acknowledgement = this.acknowledgement.bind(this); + this.channelUpgradeInit = this.channelUpgradeInit.bind(this); + this.channelUpgradeTry = this.channelUpgradeTry.bind(this); + this.channelUpgradeAck = this.channelUpgradeAck.bind(this); + this.channelUpgradeConfirm = this.channelUpgradeConfirm.bind(this); + this.channelUpgradeOpen = this.channelUpgradeOpen.bind(this); + this.channelUpgradeTimeout = this.channelUpgradeTimeout.bind(this); + this.channelUpgradeCancel = this.channelUpgradeCancel.bind(this); + this.updateChannelParams = this.updateChannelParams.bind(this); + this.pruneAcknowledgements = this.pruneAcknowledgements.bind(this); } channelOpenInit(request: MsgChannelOpenInit): Promise { const data = MsgChannelOpenInit.encode(request).finish(); @@ -92,4 +119,52 @@ export class MsgClientImpl implements Msg { const promise = this.rpc.request("ibc.core.channel.v1.Msg", "Acknowledgement", data); return promise.then(data => MsgAcknowledgementResponse.decode(new BinaryReader(data))); } -} \ No newline at end of file + channelUpgradeInit(request: MsgChannelUpgradeInit): Promise { + const data = MsgChannelUpgradeInit.encode(request).finish(); + const promise = this.rpc.request("ibc.core.channel.v1.Msg", "ChannelUpgradeInit", data); + return promise.then(data => MsgChannelUpgradeInitResponse.decode(new BinaryReader(data))); + } + channelUpgradeTry(request: MsgChannelUpgradeTry): Promise { + const data = MsgChannelUpgradeTry.encode(request).finish(); + const promise = this.rpc.request("ibc.core.channel.v1.Msg", "ChannelUpgradeTry", data); + return promise.then(data => MsgChannelUpgradeTryResponse.decode(new BinaryReader(data))); + } + channelUpgradeAck(request: MsgChannelUpgradeAck): Promise { + const data = MsgChannelUpgradeAck.encode(request).finish(); + const promise = this.rpc.request("ibc.core.channel.v1.Msg", "ChannelUpgradeAck", data); + return promise.then(data => MsgChannelUpgradeAckResponse.decode(new BinaryReader(data))); + } + channelUpgradeConfirm(request: MsgChannelUpgradeConfirm): Promise { + const data = MsgChannelUpgradeConfirm.encode(request).finish(); + const promise = this.rpc.request("ibc.core.channel.v1.Msg", "ChannelUpgradeConfirm", data); + return promise.then(data => MsgChannelUpgradeConfirmResponse.decode(new BinaryReader(data))); + } + channelUpgradeOpen(request: MsgChannelUpgradeOpen): Promise { + const data = MsgChannelUpgradeOpen.encode(request).finish(); + const promise = this.rpc.request("ibc.core.channel.v1.Msg", "ChannelUpgradeOpen", data); + return promise.then(data => MsgChannelUpgradeOpenResponse.decode(new BinaryReader(data))); + } + channelUpgradeTimeout(request: MsgChannelUpgradeTimeout): Promise { + const data = MsgChannelUpgradeTimeout.encode(request).finish(); + const promise = this.rpc.request("ibc.core.channel.v1.Msg", "ChannelUpgradeTimeout", data); + return promise.then(data => MsgChannelUpgradeTimeoutResponse.decode(new BinaryReader(data))); + } + channelUpgradeCancel(request: MsgChannelUpgradeCancel): Promise { + const data = MsgChannelUpgradeCancel.encode(request).finish(); + const promise = this.rpc.request("ibc.core.channel.v1.Msg", "ChannelUpgradeCancel", data); + return promise.then(data => MsgChannelUpgradeCancelResponse.decode(new BinaryReader(data))); + } + updateChannelParams(request: MsgUpdateParams): Promise { + const data = MsgUpdateParams.encode(request).finish(); + const promise = this.rpc.request("ibc.core.channel.v1.Msg", "UpdateChannelParams", data); + return promise.then(data => MsgUpdateParamsResponse.decode(new BinaryReader(data))); + } + pruneAcknowledgements(request: MsgPruneAcknowledgements): Promise { + const data = MsgPruneAcknowledgements.encode(request).finish(); + const promise = this.rpc.request("ibc.core.channel.v1.Msg", "PruneAcknowledgements", data); + return promise.then(data => MsgPruneAcknowledgementsResponse.decode(new BinaryReader(data))); + } +} +export const createClientImpl = (rpc: Rpc) => { + return new MsgClientImpl(rpc); +}; \ No newline at end of file diff --git a/packages/osmojs/src/codegen/ibc/core/channel/v1/tx.ts b/packages/osmojs/src/codegen/ibc/core/channel/v1/tx.ts index f6f7344ca..c07e160fe 100644 --- a/packages/osmojs/src/codegen/ibc/core/channel/v1/tx.ts +++ b/packages/osmojs/src/codegen/ibc/core/channel/v1/tx.ts @@ -1,7 +1,9 @@ -import { Channel, ChannelAmino, ChannelSDKType, Packet, PacketAmino, PacketSDKType } from "./channel"; -import { Height, HeightAmino, HeightSDKType } from "../../client/v1/client"; +import { Channel, ChannelAmino, ChannelSDKType, Packet, PacketAmino, PacketSDKType, State, stateFromJSON, stateToJSON } from "./channel"; +import { Height, HeightAmino, HeightSDKType, Params, ParamsAmino, ParamsSDKType } from "../../client/v1/client"; +import { UpgradeFields, UpgradeFieldsAmino, UpgradeFieldsSDKType, Upgrade, UpgradeAmino, UpgradeSDKType, ErrorReceipt, ErrorReceiptAmino, ErrorReceiptSDKType } from "./upgrade"; import { BinaryReader, BinaryWriter } from "../../../../binary"; -import { isSet } from "../../../../helpers"; +import { isSet, bytesFromBase64, base64FromBytes } from "../../../../helpers"; +import { GlobalDecoderRegistry } from "../../../../registry"; /** ResponseResultType defines the possible outcomes of the execution of a message */ export enum ResponseResultType { /** RESPONSE_RESULT_TYPE_UNSPECIFIED - Default zero value enumeration */ @@ -10,6 +12,8 @@ export enum ResponseResultType { RESPONSE_RESULT_TYPE_NOOP = 1, /** RESPONSE_RESULT_TYPE_SUCCESS - The message was executed successfully */ RESPONSE_RESULT_TYPE_SUCCESS = 2, + /** RESPONSE_RESULT_TYPE_FAILURE - The message was executed unsuccessfully */ + RESPONSE_RESULT_TYPE_FAILURE = 3, UNRECOGNIZED = -1, } export const ResponseResultTypeSDKType = ResponseResultType; @@ -25,6 +29,9 @@ export function responseResultTypeFromJSON(object: any): ResponseResultType { case 2: case "RESPONSE_RESULT_TYPE_SUCCESS": return ResponseResultType.RESPONSE_RESULT_TYPE_SUCCESS; + case 3: + case "RESPONSE_RESULT_TYPE_FAILURE": + return ResponseResultType.RESPONSE_RESULT_TYPE_FAILURE; case -1: case "UNRECOGNIZED": default: @@ -39,6 +46,8 @@ export function responseResultTypeToJSON(object: ResponseResultType): string { return "RESPONSE_RESULT_TYPE_NOOP"; case ResponseResultType.RESPONSE_RESULT_TYPE_SUCCESS: return "RESPONSE_RESULT_TYPE_SUCCESS"; + case ResponseResultType.RESPONSE_RESULT_TYPE_FAILURE: + return "RESPONSE_RESULT_TYPE_FAILURE"; case ResponseResultType.UNRECOGNIZED: default: return "UNRECOGNIZED"; @@ -62,9 +71,9 @@ export interface MsgChannelOpenInitProtoMsg { * is called by a relayer on Chain A. */ export interface MsgChannelOpenInitAmino { - port_id: string; + port_id?: string; channel?: ChannelAmino; - signer: string; + signer?: string; } export interface MsgChannelOpenInitAminoMsg { type: "cosmos-sdk/MsgChannelOpenInit"; @@ -90,8 +99,8 @@ export interface MsgChannelOpenInitResponseProtoMsg { } /** MsgChannelOpenInitResponse defines the Msg/ChannelOpenInit response type. */ export interface MsgChannelOpenInitResponseAmino { - channel_id: string; - version: string; + channel_id?: string; + version?: string; } export interface MsgChannelOpenInitResponseAminoMsg { type: "cosmos-sdk/MsgChannelOpenInitResponse"; @@ -129,16 +138,16 @@ export interface MsgChannelOpenTryProtoMsg { * value will be ignored by core IBC. */ export interface MsgChannelOpenTryAmino { - port_id: string; + port_id?: string; /** Deprecated: this field is unused. Crossing hello's are no longer supported in core IBC. */ /** @deprecated */ - previous_channel_id: string; + previous_channel_id?: string; /** NOTE: the version field within the channel has been deprecated. Its value will be ignored by core IBC. */ channel?: ChannelAmino; - counterparty_version: string; - proof_init: Uint8Array; + counterparty_version?: string; + proof_init?: string; proof_height?: HeightAmino; - signer: string; + signer?: string; } export interface MsgChannelOpenTryAminoMsg { type: "cosmos-sdk/MsgChannelOpenTry"; @@ -170,8 +179,8 @@ export interface MsgChannelOpenTryResponseProtoMsg { } /** MsgChannelOpenTryResponse defines the Msg/ChannelOpenTry response type. */ export interface MsgChannelOpenTryResponseAmino { - version: string; - channel_id: string; + version?: string; + channel_id?: string; } export interface MsgChannelOpenTryResponseAminoMsg { type: "cosmos-sdk/MsgChannelOpenTryResponse"; @@ -204,13 +213,13 @@ export interface MsgChannelOpenAckProtoMsg { * the change of channel state to TRYOPEN on Chain B. */ export interface MsgChannelOpenAckAmino { - port_id: string; - channel_id: string; - counterparty_channel_id: string; - counterparty_version: string; - proof_try: Uint8Array; + port_id?: string; + channel_id?: string; + counterparty_channel_id?: string; + counterparty_version?: string; + proof_try?: string; proof_height?: HeightAmino; - signer: string; + signer?: string; } export interface MsgChannelOpenAckAminoMsg { type: "cosmos-sdk/MsgChannelOpenAck"; @@ -263,11 +272,11 @@ export interface MsgChannelOpenConfirmProtoMsg { * acknowledge the change of channel state to OPEN on Chain A. */ export interface MsgChannelOpenConfirmAmino { - port_id: string; - channel_id: string; - proof_ack: Uint8Array; + port_id?: string; + channel_id?: string; + proof_ack?: string; proof_height?: HeightAmino; - signer: string; + signer?: string; } export interface MsgChannelOpenConfirmAminoMsg { type: "cosmos-sdk/MsgChannelOpenConfirm"; @@ -325,9 +334,9 @@ export interface MsgChannelCloseInitProtoMsg { * to close a channel with Chain B. */ export interface MsgChannelCloseInitAmino { - port_id: string; - channel_id: string; - signer: string; + port_id?: string; + channel_id?: string; + signer?: string; } export interface MsgChannelCloseInitAminoMsg { type: "cosmos-sdk/MsgChannelCloseInit"; @@ -366,6 +375,7 @@ export interface MsgChannelCloseConfirm { proofInit: Uint8Array; proofHeight: Height; signer: string; + counterpartyUpgradeSequence: bigint; } export interface MsgChannelCloseConfirmProtoMsg { typeUrl: "/ibc.core.channel.v1.MsgChannelCloseConfirm"; @@ -376,11 +386,12 @@ export interface MsgChannelCloseConfirmProtoMsg { * to acknowledge the change of channel state to CLOSED on Chain A. */ export interface MsgChannelCloseConfirmAmino { - port_id: string; - channel_id: string; - proof_init: Uint8Array; + port_id?: string; + channel_id?: string; + proof_init?: string; proof_height?: HeightAmino; - signer: string; + signer?: string; + counterparty_upgrade_sequence?: string; } export interface MsgChannelCloseConfirmAminoMsg { type: "cosmos-sdk/MsgChannelCloseConfirm"; @@ -396,6 +407,7 @@ export interface MsgChannelCloseConfirmSDKType { proof_init: Uint8Array; proof_height: HeightSDKType; signer: string; + counterparty_upgrade_sequence: bigint; } /** * MsgChannelCloseConfirmResponse defines the Msg/ChannelCloseConfirm response @@ -434,9 +446,9 @@ export interface MsgRecvPacketProtoMsg { /** MsgRecvPacket receives incoming IBC packet */ export interface MsgRecvPacketAmino { packet?: PacketAmino; - proof_commitment: Uint8Array; + proof_commitment?: string; proof_height?: HeightAmino; - signer: string; + signer?: string; } export interface MsgRecvPacketAminoMsg { type: "cosmos-sdk/MsgRecvPacket"; @@ -459,7 +471,7 @@ export interface MsgRecvPacketResponseProtoMsg { } /** MsgRecvPacketResponse defines the Msg/RecvPacket response type. */ export interface MsgRecvPacketResponseAmino { - result: ResponseResultType; + result?: ResponseResultType; } export interface MsgRecvPacketResponseAminoMsg { type: "cosmos-sdk/MsgRecvPacketResponse"; @@ -484,10 +496,10 @@ export interface MsgTimeoutProtoMsg { /** MsgTimeout receives timed-out packet */ export interface MsgTimeoutAmino { packet?: PacketAmino; - proof_unreceived: Uint8Array; + proof_unreceived?: string; proof_height?: HeightAmino; - next_sequence_recv: string; - signer: string; + next_sequence_recv?: string; + signer?: string; } export interface MsgTimeoutAminoMsg { type: "cosmos-sdk/MsgTimeout"; @@ -511,7 +523,7 @@ export interface MsgTimeoutResponseProtoMsg { } /** MsgTimeoutResponse defines the Msg/Timeout response type. */ export interface MsgTimeoutResponseAmino { - result: ResponseResultType; + result?: ResponseResultType; } export interface MsgTimeoutResponseAminoMsg { type: "cosmos-sdk/MsgTimeoutResponse"; @@ -529,6 +541,7 @@ export interface MsgTimeoutOnClose { proofHeight: Height; nextSequenceRecv: bigint; signer: string; + counterpartyUpgradeSequence: bigint; } export interface MsgTimeoutOnCloseProtoMsg { typeUrl: "/ibc.core.channel.v1.MsgTimeoutOnClose"; @@ -537,11 +550,12 @@ export interface MsgTimeoutOnCloseProtoMsg { /** MsgTimeoutOnClose timed-out packet upon counterparty channel closure. */ export interface MsgTimeoutOnCloseAmino { packet?: PacketAmino; - proof_unreceived: Uint8Array; - proof_close: Uint8Array; + proof_unreceived?: string; + proof_close?: string; proof_height?: HeightAmino; - next_sequence_recv: string; - signer: string; + next_sequence_recv?: string; + signer?: string; + counterparty_upgrade_sequence?: string; } export interface MsgTimeoutOnCloseAminoMsg { type: "cosmos-sdk/MsgTimeoutOnClose"; @@ -555,6 +569,7 @@ export interface MsgTimeoutOnCloseSDKType { proof_height: HeightSDKType; next_sequence_recv: bigint; signer: string; + counterparty_upgrade_sequence: bigint; } /** MsgTimeoutOnCloseResponse defines the Msg/TimeoutOnClose response type. */ export interface MsgTimeoutOnCloseResponse { @@ -566,7 +581,7 @@ export interface MsgTimeoutOnCloseResponseProtoMsg { } /** MsgTimeoutOnCloseResponse defines the Msg/TimeoutOnClose response type. */ export interface MsgTimeoutOnCloseResponseAmino { - result: ResponseResultType; + result?: ResponseResultType; } export interface MsgTimeoutOnCloseResponseAminoMsg { type: "cosmos-sdk/MsgTimeoutOnCloseResponse"; @@ -591,10 +606,10 @@ export interface MsgAcknowledgementProtoMsg { /** MsgAcknowledgement receives incoming IBC acknowledgement */ export interface MsgAcknowledgementAmino { packet?: PacketAmino; - acknowledgement: Uint8Array; - proof_acked: Uint8Array; + acknowledgement?: string; + proof_acked?: string; proof_height?: HeightAmino; - signer: string; + signer?: string; } export interface MsgAcknowledgementAminoMsg { type: "cosmos-sdk/MsgAcknowledgement"; @@ -618,7 +633,7 @@ export interface MsgAcknowledgementResponseProtoMsg { } /** MsgAcknowledgementResponse defines the Msg/Acknowledgement response type. */ export interface MsgAcknowledgementResponseAmino { - result: ResponseResultType; + result?: ResponseResultType; } export interface MsgAcknowledgementResponseAminoMsg { type: "cosmos-sdk/MsgAcknowledgementResponse"; @@ -628,6 +643,499 @@ export interface MsgAcknowledgementResponseAminoMsg { export interface MsgAcknowledgementResponseSDKType { result: ResponseResultType; } +/** MsgChannelUpgradeInit defines the request type for the ChannelUpgradeInit rpc */ +export interface MsgChannelUpgradeInit { + portId: string; + channelId: string; + fields: UpgradeFields; + signer: string; +} +export interface MsgChannelUpgradeInitProtoMsg { + typeUrl: "/ibc.core.channel.v1.MsgChannelUpgradeInit"; + value: Uint8Array; +} +/** MsgChannelUpgradeInit defines the request type for the ChannelUpgradeInit rpc */ +export interface MsgChannelUpgradeInitAmino { + port_id?: string; + channel_id?: string; + fields?: UpgradeFieldsAmino; + signer?: string; +} +export interface MsgChannelUpgradeInitAminoMsg { + type: "cosmos-sdk/MsgChannelUpgradeInit"; + value: MsgChannelUpgradeInitAmino; +} +/** MsgChannelUpgradeInit defines the request type for the ChannelUpgradeInit rpc */ +export interface MsgChannelUpgradeInitSDKType { + port_id: string; + channel_id: string; + fields: UpgradeFieldsSDKType; + signer: string; +} +/** MsgChannelUpgradeInitResponse defines the MsgChannelUpgradeInit response type */ +export interface MsgChannelUpgradeInitResponse { + upgrade: Upgrade; + upgradeSequence: bigint; +} +export interface MsgChannelUpgradeInitResponseProtoMsg { + typeUrl: "/ibc.core.channel.v1.MsgChannelUpgradeInitResponse"; + value: Uint8Array; +} +/** MsgChannelUpgradeInitResponse defines the MsgChannelUpgradeInit response type */ +export interface MsgChannelUpgradeInitResponseAmino { + upgrade?: UpgradeAmino; + upgrade_sequence?: string; +} +export interface MsgChannelUpgradeInitResponseAminoMsg { + type: "cosmos-sdk/MsgChannelUpgradeInitResponse"; + value: MsgChannelUpgradeInitResponseAmino; +} +/** MsgChannelUpgradeInitResponse defines the MsgChannelUpgradeInit response type */ +export interface MsgChannelUpgradeInitResponseSDKType { + upgrade: UpgradeSDKType; + upgrade_sequence: bigint; +} +/** MsgChannelUpgradeTry defines the request type for the ChannelUpgradeTry rpc */ +export interface MsgChannelUpgradeTry { + portId: string; + channelId: string; + proposedUpgradeConnectionHops: string[]; + counterpartyUpgradeFields: UpgradeFields; + counterpartyUpgradeSequence: bigint; + proofChannel: Uint8Array; + proofUpgrade: Uint8Array; + proofHeight: Height; + signer: string; +} +export interface MsgChannelUpgradeTryProtoMsg { + typeUrl: "/ibc.core.channel.v1.MsgChannelUpgradeTry"; + value: Uint8Array; +} +/** MsgChannelUpgradeTry defines the request type for the ChannelUpgradeTry rpc */ +export interface MsgChannelUpgradeTryAmino { + port_id?: string; + channel_id?: string; + proposed_upgrade_connection_hops?: string[]; + counterparty_upgrade_fields?: UpgradeFieldsAmino; + counterparty_upgrade_sequence?: string; + proof_channel?: string; + proof_upgrade?: string; + proof_height?: HeightAmino; + signer?: string; +} +export interface MsgChannelUpgradeTryAminoMsg { + type: "cosmos-sdk/MsgChannelUpgradeTry"; + value: MsgChannelUpgradeTryAmino; +} +/** MsgChannelUpgradeTry defines the request type for the ChannelUpgradeTry rpc */ +export interface MsgChannelUpgradeTrySDKType { + port_id: string; + channel_id: string; + proposed_upgrade_connection_hops: string[]; + counterparty_upgrade_fields: UpgradeFieldsSDKType; + counterparty_upgrade_sequence: bigint; + proof_channel: Uint8Array; + proof_upgrade: Uint8Array; + proof_height: HeightSDKType; + signer: string; +} +/** MsgChannelUpgradeTryResponse defines the MsgChannelUpgradeTry response type */ +export interface MsgChannelUpgradeTryResponse { + upgrade: Upgrade; + upgradeSequence: bigint; + result: ResponseResultType; +} +export interface MsgChannelUpgradeTryResponseProtoMsg { + typeUrl: "/ibc.core.channel.v1.MsgChannelUpgradeTryResponse"; + value: Uint8Array; +} +/** MsgChannelUpgradeTryResponse defines the MsgChannelUpgradeTry response type */ +export interface MsgChannelUpgradeTryResponseAmino { + upgrade?: UpgradeAmino; + upgrade_sequence?: string; + result?: ResponseResultType; +} +export interface MsgChannelUpgradeTryResponseAminoMsg { + type: "cosmos-sdk/MsgChannelUpgradeTryResponse"; + value: MsgChannelUpgradeTryResponseAmino; +} +/** MsgChannelUpgradeTryResponse defines the MsgChannelUpgradeTry response type */ +export interface MsgChannelUpgradeTryResponseSDKType { + upgrade: UpgradeSDKType; + upgrade_sequence: bigint; + result: ResponseResultType; +} +/** MsgChannelUpgradeAck defines the request type for the ChannelUpgradeAck rpc */ +export interface MsgChannelUpgradeAck { + portId: string; + channelId: string; + counterpartyUpgrade: Upgrade; + proofChannel: Uint8Array; + proofUpgrade: Uint8Array; + proofHeight: Height; + signer: string; +} +export interface MsgChannelUpgradeAckProtoMsg { + typeUrl: "/ibc.core.channel.v1.MsgChannelUpgradeAck"; + value: Uint8Array; +} +/** MsgChannelUpgradeAck defines the request type for the ChannelUpgradeAck rpc */ +export interface MsgChannelUpgradeAckAmino { + port_id?: string; + channel_id?: string; + counterparty_upgrade?: UpgradeAmino; + proof_channel?: string; + proof_upgrade?: string; + proof_height?: HeightAmino; + signer?: string; +} +export interface MsgChannelUpgradeAckAminoMsg { + type: "cosmos-sdk/MsgChannelUpgradeAck"; + value: MsgChannelUpgradeAckAmino; +} +/** MsgChannelUpgradeAck defines the request type for the ChannelUpgradeAck rpc */ +export interface MsgChannelUpgradeAckSDKType { + port_id: string; + channel_id: string; + counterparty_upgrade: UpgradeSDKType; + proof_channel: Uint8Array; + proof_upgrade: Uint8Array; + proof_height: HeightSDKType; + signer: string; +} +/** MsgChannelUpgradeAckResponse defines MsgChannelUpgradeAck response type */ +export interface MsgChannelUpgradeAckResponse { + result: ResponseResultType; +} +export interface MsgChannelUpgradeAckResponseProtoMsg { + typeUrl: "/ibc.core.channel.v1.MsgChannelUpgradeAckResponse"; + value: Uint8Array; +} +/** MsgChannelUpgradeAckResponse defines MsgChannelUpgradeAck response type */ +export interface MsgChannelUpgradeAckResponseAmino { + result?: ResponseResultType; +} +export interface MsgChannelUpgradeAckResponseAminoMsg { + type: "cosmos-sdk/MsgChannelUpgradeAckResponse"; + value: MsgChannelUpgradeAckResponseAmino; +} +/** MsgChannelUpgradeAckResponse defines MsgChannelUpgradeAck response type */ +export interface MsgChannelUpgradeAckResponseSDKType { + result: ResponseResultType; +} +/** MsgChannelUpgradeConfirm defines the request type for the ChannelUpgradeConfirm rpc */ +export interface MsgChannelUpgradeConfirm { + portId: string; + channelId: string; + counterpartyChannelState: State; + counterpartyUpgrade: Upgrade; + proofChannel: Uint8Array; + proofUpgrade: Uint8Array; + proofHeight: Height; + signer: string; +} +export interface MsgChannelUpgradeConfirmProtoMsg { + typeUrl: "/ibc.core.channel.v1.MsgChannelUpgradeConfirm"; + value: Uint8Array; +} +/** MsgChannelUpgradeConfirm defines the request type for the ChannelUpgradeConfirm rpc */ +export interface MsgChannelUpgradeConfirmAmino { + port_id?: string; + channel_id?: string; + counterparty_channel_state?: State; + counterparty_upgrade?: UpgradeAmino; + proof_channel?: string; + proof_upgrade?: string; + proof_height?: HeightAmino; + signer?: string; +} +export interface MsgChannelUpgradeConfirmAminoMsg { + type: "cosmos-sdk/MsgChannelUpgradeConfirm"; + value: MsgChannelUpgradeConfirmAmino; +} +/** MsgChannelUpgradeConfirm defines the request type for the ChannelUpgradeConfirm rpc */ +export interface MsgChannelUpgradeConfirmSDKType { + port_id: string; + channel_id: string; + counterparty_channel_state: State; + counterparty_upgrade: UpgradeSDKType; + proof_channel: Uint8Array; + proof_upgrade: Uint8Array; + proof_height: HeightSDKType; + signer: string; +} +/** MsgChannelUpgradeConfirmResponse defines MsgChannelUpgradeConfirm response type */ +export interface MsgChannelUpgradeConfirmResponse { + result: ResponseResultType; +} +export interface MsgChannelUpgradeConfirmResponseProtoMsg { + typeUrl: "/ibc.core.channel.v1.MsgChannelUpgradeConfirmResponse"; + value: Uint8Array; +} +/** MsgChannelUpgradeConfirmResponse defines MsgChannelUpgradeConfirm response type */ +export interface MsgChannelUpgradeConfirmResponseAmino { + result?: ResponseResultType; +} +export interface MsgChannelUpgradeConfirmResponseAminoMsg { + type: "cosmos-sdk/MsgChannelUpgradeConfirmResponse"; + value: MsgChannelUpgradeConfirmResponseAmino; +} +/** MsgChannelUpgradeConfirmResponse defines MsgChannelUpgradeConfirm response type */ +export interface MsgChannelUpgradeConfirmResponseSDKType { + result: ResponseResultType; +} +/** MsgChannelUpgradeOpen defines the request type for the ChannelUpgradeOpen rpc */ +export interface MsgChannelUpgradeOpen { + portId: string; + channelId: string; + counterpartyChannelState: State; + proofChannel: Uint8Array; + proofHeight: Height; + signer: string; +} +export interface MsgChannelUpgradeOpenProtoMsg { + typeUrl: "/ibc.core.channel.v1.MsgChannelUpgradeOpen"; + value: Uint8Array; +} +/** MsgChannelUpgradeOpen defines the request type for the ChannelUpgradeOpen rpc */ +export interface MsgChannelUpgradeOpenAmino { + port_id?: string; + channel_id?: string; + counterparty_channel_state?: State; + proof_channel?: string; + proof_height?: HeightAmino; + signer?: string; +} +export interface MsgChannelUpgradeOpenAminoMsg { + type: "cosmos-sdk/MsgChannelUpgradeOpen"; + value: MsgChannelUpgradeOpenAmino; +} +/** MsgChannelUpgradeOpen defines the request type for the ChannelUpgradeOpen rpc */ +export interface MsgChannelUpgradeOpenSDKType { + port_id: string; + channel_id: string; + counterparty_channel_state: State; + proof_channel: Uint8Array; + proof_height: HeightSDKType; + signer: string; +} +/** MsgChannelUpgradeOpenResponse defines the MsgChannelUpgradeOpen response type */ +export interface MsgChannelUpgradeOpenResponse {} +export interface MsgChannelUpgradeOpenResponseProtoMsg { + typeUrl: "/ibc.core.channel.v1.MsgChannelUpgradeOpenResponse"; + value: Uint8Array; +} +/** MsgChannelUpgradeOpenResponse defines the MsgChannelUpgradeOpen response type */ +export interface MsgChannelUpgradeOpenResponseAmino {} +export interface MsgChannelUpgradeOpenResponseAminoMsg { + type: "cosmos-sdk/MsgChannelUpgradeOpenResponse"; + value: MsgChannelUpgradeOpenResponseAmino; +} +/** MsgChannelUpgradeOpenResponse defines the MsgChannelUpgradeOpen response type */ +export interface MsgChannelUpgradeOpenResponseSDKType {} +/** MsgChannelUpgradeTimeout defines the request type for the ChannelUpgradeTimeout rpc */ +export interface MsgChannelUpgradeTimeout { + portId: string; + channelId: string; + counterpartyChannel: Channel; + proofChannel: Uint8Array; + proofHeight: Height; + signer: string; +} +export interface MsgChannelUpgradeTimeoutProtoMsg { + typeUrl: "/ibc.core.channel.v1.MsgChannelUpgradeTimeout"; + value: Uint8Array; +} +/** MsgChannelUpgradeTimeout defines the request type for the ChannelUpgradeTimeout rpc */ +export interface MsgChannelUpgradeTimeoutAmino { + port_id?: string; + channel_id?: string; + counterparty_channel?: ChannelAmino; + proof_channel?: string; + proof_height?: HeightAmino; + signer?: string; +} +export interface MsgChannelUpgradeTimeoutAminoMsg { + type: "cosmos-sdk/MsgChannelUpgradeTimeout"; + value: MsgChannelUpgradeTimeoutAmino; +} +/** MsgChannelUpgradeTimeout defines the request type for the ChannelUpgradeTimeout rpc */ +export interface MsgChannelUpgradeTimeoutSDKType { + port_id: string; + channel_id: string; + counterparty_channel: ChannelSDKType; + proof_channel: Uint8Array; + proof_height: HeightSDKType; + signer: string; +} +/** MsgChannelUpgradeTimeoutRepsonse defines the MsgChannelUpgradeTimeout response type */ +export interface MsgChannelUpgradeTimeoutResponse {} +export interface MsgChannelUpgradeTimeoutResponseProtoMsg { + typeUrl: "/ibc.core.channel.v1.MsgChannelUpgradeTimeoutResponse"; + value: Uint8Array; +} +/** MsgChannelUpgradeTimeoutRepsonse defines the MsgChannelUpgradeTimeout response type */ +export interface MsgChannelUpgradeTimeoutResponseAmino {} +export interface MsgChannelUpgradeTimeoutResponseAminoMsg { + type: "cosmos-sdk/MsgChannelUpgradeTimeoutResponse"; + value: MsgChannelUpgradeTimeoutResponseAmino; +} +/** MsgChannelUpgradeTimeoutRepsonse defines the MsgChannelUpgradeTimeout response type */ +export interface MsgChannelUpgradeTimeoutResponseSDKType {} +/** MsgChannelUpgradeCancel defines the request type for the ChannelUpgradeCancel rpc */ +export interface MsgChannelUpgradeCancel { + portId: string; + channelId: string; + errorReceipt: ErrorReceipt; + proofErrorReceipt: Uint8Array; + proofHeight: Height; + signer: string; +} +export interface MsgChannelUpgradeCancelProtoMsg { + typeUrl: "/ibc.core.channel.v1.MsgChannelUpgradeCancel"; + value: Uint8Array; +} +/** MsgChannelUpgradeCancel defines the request type for the ChannelUpgradeCancel rpc */ +export interface MsgChannelUpgradeCancelAmino { + port_id?: string; + channel_id?: string; + error_receipt?: ErrorReceiptAmino; + proof_error_receipt?: string; + proof_height?: HeightAmino; + signer?: string; +} +export interface MsgChannelUpgradeCancelAminoMsg { + type: "cosmos-sdk/MsgChannelUpgradeCancel"; + value: MsgChannelUpgradeCancelAmino; +} +/** MsgChannelUpgradeCancel defines the request type for the ChannelUpgradeCancel rpc */ +export interface MsgChannelUpgradeCancelSDKType { + port_id: string; + channel_id: string; + error_receipt: ErrorReceiptSDKType; + proof_error_receipt: Uint8Array; + proof_height: HeightSDKType; + signer: string; +} +/** MsgChannelUpgradeCancelResponse defines the MsgChannelUpgradeCancel response type */ +export interface MsgChannelUpgradeCancelResponse {} +export interface MsgChannelUpgradeCancelResponseProtoMsg { + typeUrl: "/ibc.core.channel.v1.MsgChannelUpgradeCancelResponse"; + value: Uint8Array; +} +/** MsgChannelUpgradeCancelResponse defines the MsgChannelUpgradeCancel response type */ +export interface MsgChannelUpgradeCancelResponseAmino {} +export interface MsgChannelUpgradeCancelResponseAminoMsg { + type: "cosmos-sdk/MsgChannelUpgradeCancelResponse"; + value: MsgChannelUpgradeCancelResponseAmino; +} +/** MsgChannelUpgradeCancelResponse defines the MsgChannelUpgradeCancel response type */ +export interface MsgChannelUpgradeCancelResponseSDKType {} +/** MsgUpdateParams is the MsgUpdateParams request type. */ +export interface MsgUpdateParams { + /** authority is the address that controls the module (defaults to x/gov unless overwritten). */ + authority: string; + /** + * params defines the channel parameters to update. + * + * NOTE: All parameters must be supplied. + */ + params: Params; +} +export interface MsgUpdateParamsProtoMsg { + typeUrl: "/ibc.core.channel.v1.MsgUpdateParams"; + value: Uint8Array; +} +/** MsgUpdateParams is the MsgUpdateParams request type. */ +export interface MsgUpdateParamsAmino { + /** authority is the address that controls the module (defaults to x/gov unless overwritten). */ + authority?: string; + /** + * params defines the channel parameters to update. + * + * NOTE: All parameters must be supplied. + */ + params?: ParamsAmino; +} +export interface MsgUpdateParamsAminoMsg { + type: "cosmos-sdk/MsgUpdateParams"; + value: MsgUpdateParamsAmino; +} +/** MsgUpdateParams is the MsgUpdateParams request type. */ +export interface MsgUpdateParamsSDKType { + authority: string; + params: ParamsSDKType; +} +/** MsgUpdateParamsResponse defines the MsgUpdateParams response type. */ +export interface MsgUpdateParamsResponse {} +export interface MsgUpdateParamsResponseProtoMsg { + typeUrl: "/ibc.core.channel.v1.MsgUpdateParamsResponse"; + value: Uint8Array; +} +/** MsgUpdateParamsResponse defines the MsgUpdateParams response type. */ +export interface MsgUpdateParamsResponseAmino {} +export interface MsgUpdateParamsResponseAminoMsg { + type: "cosmos-sdk/MsgUpdateParamsResponse"; + value: MsgUpdateParamsResponseAmino; +} +/** MsgUpdateParamsResponse defines the MsgUpdateParams response type. */ +export interface MsgUpdateParamsResponseSDKType {} +/** MsgPruneAcknowledgements defines the request type for the PruneAcknowledgements rpc. */ +export interface MsgPruneAcknowledgements { + portId: string; + channelId: string; + limit: bigint; + signer: string; +} +export interface MsgPruneAcknowledgementsProtoMsg { + typeUrl: "/ibc.core.channel.v1.MsgPruneAcknowledgements"; + value: Uint8Array; +} +/** MsgPruneAcknowledgements defines the request type for the PruneAcknowledgements rpc. */ +export interface MsgPruneAcknowledgementsAmino { + port_id?: string; + channel_id?: string; + limit?: string; + signer?: string; +} +export interface MsgPruneAcknowledgementsAminoMsg { + type: "cosmos-sdk/MsgPruneAcknowledgements"; + value: MsgPruneAcknowledgementsAmino; +} +/** MsgPruneAcknowledgements defines the request type for the PruneAcknowledgements rpc. */ +export interface MsgPruneAcknowledgementsSDKType { + port_id: string; + channel_id: string; + limit: bigint; + signer: string; +} +/** MsgPruneAcknowledgementsResponse defines the response type for the PruneAcknowledgements rpc. */ +export interface MsgPruneAcknowledgementsResponse { + /** Number of sequences pruned (includes both packet acknowledgements and packet receipts where appropriate). */ + totalPrunedSequences: bigint; + /** Number of sequences left after pruning. */ + totalRemainingSequences: bigint; +} +export interface MsgPruneAcknowledgementsResponseProtoMsg { + typeUrl: "/ibc.core.channel.v1.MsgPruneAcknowledgementsResponse"; + value: Uint8Array; +} +/** MsgPruneAcknowledgementsResponse defines the response type for the PruneAcknowledgements rpc. */ +export interface MsgPruneAcknowledgementsResponseAmino { + /** Number of sequences pruned (includes both packet acknowledgements and packet receipts where appropriate). */ + total_pruned_sequences?: string; + /** Number of sequences left after pruning. */ + total_remaining_sequences?: string; +} +export interface MsgPruneAcknowledgementsResponseAminoMsg { + type: "cosmos-sdk/MsgPruneAcknowledgementsResponse"; + value: MsgPruneAcknowledgementsResponseAmino; +} +/** MsgPruneAcknowledgementsResponse defines the response type for the PruneAcknowledgements rpc. */ +export interface MsgPruneAcknowledgementsResponseSDKType { + total_pruned_sequences: bigint; + total_remaining_sequences: bigint; +} function createBaseMsgChannelOpenInit(): MsgChannelOpenInit { return { portId: "", @@ -637,6 +1145,16 @@ function createBaseMsgChannelOpenInit(): MsgChannelOpenInit { } export const MsgChannelOpenInit = { typeUrl: "/ibc.core.channel.v1.MsgChannelOpenInit", + aminoType: "cosmos-sdk/MsgChannelOpenInit", + is(o: any): o is MsgChannelOpenInit { + return o && (o.$typeUrl === MsgChannelOpenInit.typeUrl || typeof o.portId === "string" && Channel.is(o.channel) && typeof o.signer === "string"); + }, + isSDK(o: any): o is MsgChannelOpenInitSDKType { + return o && (o.$typeUrl === MsgChannelOpenInit.typeUrl || typeof o.port_id === "string" && Channel.isSDK(o.channel) && typeof o.signer === "string"); + }, + isAmino(o: any): o is MsgChannelOpenInitAmino { + return o && (o.$typeUrl === MsgChannelOpenInit.typeUrl || typeof o.port_id === "string" && Channel.isAmino(o.channel) && typeof o.signer === "string"); + }, encode(message: MsgChannelOpenInit, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.portId !== "") { writer.uint32(10).string(message.portId); @@ -672,6 +1190,20 @@ export const MsgChannelOpenInit = { } return message; }, + fromJSON(object: any): MsgChannelOpenInit { + return { + portId: isSet(object.portId) ? String(object.portId) : "", + channel: isSet(object.channel) ? Channel.fromJSON(object.channel) : undefined, + signer: isSet(object.signer) ? String(object.signer) : "" + }; + }, + toJSON(message: MsgChannelOpenInit): unknown { + const obj: any = {}; + message.portId !== undefined && (obj.portId = message.portId); + message.channel !== undefined && (obj.channel = message.channel ? Channel.toJSON(message.channel) : undefined); + message.signer !== undefined && (obj.signer = message.signer); + return obj; + }, fromPartial(object: Partial): MsgChannelOpenInit { const message = createBaseMsgChannelOpenInit(); message.portId = object.portId ?? ""; @@ -680,11 +1212,17 @@ export const MsgChannelOpenInit = { return message; }, fromAmino(object: MsgChannelOpenInitAmino): MsgChannelOpenInit { - return { - portId: object.port_id, - channel: object?.channel ? Channel.fromAmino(object.channel) : undefined, - signer: object.signer - }; + const message = createBaseMsgChannelOpenInit(); + if (object.port_id !== undefined && object.port_id !== null) { + message.portId = object.port_id; + } + if (object.channel !== undefined && object.channel !== null) { + message.channel = Channel.fromAmino(object.channel); + } + if (object.signer !== undefined && object.signer !== null) { + message.signer = object.signer; + } + return message; }, toAmino(message: MsgChannelOpenInit): MsgChannelOpenInitAmino { const obj: any = {}; @@ -715,6 +1253,8 @@ export const MsgChannelOpenInit = { }; } }; +GlobalDecoderRegistry.register(MsgChannelOpenInit.typeUrl, MsgChannelOpenInit); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgChannelOpenInit.aminoType, MsgChannelOpenInit.typeUrl); function createBaseMsgChannelOpenInitResponse(): MsgChannelOpenInitResponse { return { channelId: "", @@ -723,6 +1263,16 @@ function createBaseMsgChannelOpenInitResponse(): MsgChannelOpenInitResponse { } export const MsgChannelOpenInitResponse = { typeUrl: "/ibc.core.channel.v1.MsgChannelOpenInitResponse", + aminoType: "cosmos-sdk/MsgChannelOpenInitResponse", + is(o: any): o is MsgChannelOpenInitResponse { + return o && (o.$typeUrl === MsgChannelOpenInitResponse.typeUrl || typeof o.channelId === "string" && typeof o.version === "string"); + }, + isSDK(o: any): o is MsgChannelOpenInitResponseSDKType { + return o && (o.$typeUrl === MsgChannelOpenInitResponse.typeUrl || typeof o.channel_id === "string" && typeof o.version === "string"); + }, + isAmino(o: any): o is MsgChannelOpenInitResponseAmino { + return o && (o.$typeUrl === MsgChannelOpenInitResponse.typeUrl || typeof o.channel_id === "string" && typeof o.version === "string"); + }, encode(message: MsgChannelOpenInitResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.channelId !== "") { writer.uint32(10).string(message.channelId); @@ -752,6 +1302,18 @@ export const MsgChannelOpenInitResponse = { } return message; }, + fromJSON(object: any): MsgChannelOpenInitResponse { + return { + channelId: isSet(object.channelId) ? String(object.channelId) : "", + version: isSet(object.version) ? String(object.version) : "" + }; + }, + toJSON(message: MsgChannelOpenInitResponse): unknown { + const obj: any = {}; + message.channelId !== undefined && (obj.channelId = message.channelId); + message.version !== undefined && (obj.version = message.version); + return obj; + }, fromPartial(object: Partial): MsgChannelOpenInitResponse { const message = createBaseMsgChannelOpenInitResponse(); message.channelId = object.channelId ?? ""; @@ -759,10 +1321,14 @@ export const MsgChannelOpenInitResponse = { return message; }, fromAmino(object: MsgChannelOpenInitResponseAmino): MsgChannelOpenInitResponse { - return { - channelId: object.channel_id, - version: object.version - }; + const message = createBaseMsgChannelOpenInitResponse(); + if (object.channel_id !== undefined && object.channel_id !== null) { + message.channelId = object.channel_id; + } + if (object.version !== undefined && object.version !== null) { + message.version = object.version; + } + return message; }, toAmino(message: MsgChannelOpenInitResponse): MsgChannelOpenInitResponseAmino { const obj: any = {}; @@ -792,6 +1358,8 @@ export const MsgChannelOpenInitResponse = { }; } }; +GlobalDecoderRegistry.register(MsgChannelOpenInitResponse.typeUrl, MsgChannelOpenInitResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgChannelOpenInitResponse.aminoType, MsgChannelOpenInitResponse.typeUrl); function createBaseMsgChannelOpenTry(): MsgChannelOpenTry { return { portId: "", @@ -805,6 +1373,16 @@ function createBaseMsgChannelOpenTry(): MsgChannelOpenTry { } export const MsgChannelOpenTry = { typeUrl: "/ibc.core.channel.v1.MsgChannelOpenTry", + aminoType: "cosmos-sdk/MsgChannelOpenTry", + is(o: any): o is MsgChannelOpenTry { + return o && (o.$typeUrl === MsgChannelOpenTry.typeUrl || typeof o.portId === "string" && typeof o.previousChannelId === "string" && Channel.is(o.channel) && typeof o.counterpartyVersion === "string" && (o.proofInit instanceof Uint8Array || typeof o.proofInit === "string") && Height.is(o.proofHeight) && typeof o.signer === "string"); + }, + isSDK(o: any): o is MsgChannelOpenTrySDKType { + return o && (o.$typeUrl === MsgChannelOpenTry.typeUrl || typeof o.port_id === "string" && typeof o.previous_channel_id === "string" && Channel.isSDK(o.channel) && typeof o.counterparty_version === "string" && (o.proof_init instanceof Uint8Array || typeof o.proof_init === "string") && Height.isSDK(o.proof_height) && typeof o.signer === "string"); + }, + isAmino(o: any): o is MsgChannelOpenTryAmino { + return o && (o.$typeUrl === MsgChannelOpenTry.typeUrl || typeof o.port_id === "string" && typeof o.previous_channel_id === "string" && Channel.isAmino(o.channel) && typeof o.counterparty_version === "string" && (o.proof_init instanceof Uint8Array || typeof o.proof_init === "string") && Height.isAmino(o.proof_height) && typeof o.signer === "string"); + }, encode(message: MsgChannelOpenTry, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.portId !== "") { writer.uint32(10).string(message.portId); @@ -864,6 +1442,28 @@ export const MsgChannelOpenTry = { } return message; }, + fromJSON(object: any): MsgChannelOpenTry { + return { + portId: isSet(object.portId) ? String(object.portId) : "", + previousChannelId: isSet(object.previousChannelId) ? String(object.previousChannelId) : "", + channel: isSet(object.channel) ? Channel.fromJSON(object.channel) : undefined, + counterpartyVersion: isSet(object.counterpartyVersion) ? String(object.counterpartyVersion) : "", + proofInit: isSet(object.proofInit) ? bytesFromBase64(object.proofInit) : new Uint8Array(), + proofHeight: isSet(object.proofHeight) ? Height.fromJSON(object.proofHeight) : undefined, + signer: isSet(object.signer) ? String(object.signer) : "" + }; + }, + toJSON(message: MsgChannelOpenTry): unknown { + const obj: any = {}; + message.portId !== undefined && (obj.portId = message.portId); + message.previousChannelId !== undefined && (obj.previousChannelId = message.previousChannelId); + message.channel !== undefined && (obj.channel = message.channel ? Channel.toJSON(message.channel) : undefined); + message.counterpartyVersion !== undefined && (obj.counterpartyVersion = message.counterpartyVersion); + message.proofInit !== undefined && (obj.proofInit = base64FromBytes(message.proofInit !== undefined ? message.proofInit : new Uint8Array())); + message.proofHeight !== undefined && (obj.proofHeight = message.proofHeight ? Height.toJSON(message.proofHeight) : undefined); + message.signer !== undefined && (obj.signer = message.signer); + return obj; + }, fromPartial(object: Partial): MsgChannelOpenTry { const message = createBaseMsgChannelOpenTry(); message.portId = object.portId ?? ""; @@ -876,23 +1476,37 @@ export const MsgChannelOpenTry = { return message; }, fromAmino(object: MsgChannelOpenTryAmino): MsgChannelOpenTry { - return { - portId: object.port_id, - previousChannelId: object.previous_channel_id, - channel: object?.channel ? Channel.fromAmino(object.channel) : undefined, - counterpartyVersion: object.counterparty_version, - proofInit: object.proof_init, - proofHeight: object?.proof_height ? Height.fromAmino(object.proof_height) : undefined, - signer: object.signer - }; - }, - toAmino(message: MsgChannelOpenTry): MsgChannelOpenTryAmino { - const obj: any = {}; - obj.port_id = message.portId; + const message = createBaseMsgChannelOpenTry(); + if (object.port_id !== undefined && object.port_id !== null) { + message.portId = object.port_id; + } + if (object.previous_channel_id !== undefined && object.previous_channel_id !== null) { + message.previousChannelId = object.previous_channel_id; + } + if (object.channel !== undefined && object.channel !== null) { + message.channel = Channel.fromAmino(object.channel); + } + if (object.counterparty_version !== undefined && object.counterparty_version !== null) { + message.counterpartyVersion = object.counterparty_version; + } + if (object.proof_init !== undefined && object.proof_init !== null) { + message.proofInit = bytesFromBase64(object.proof_init); + } + if (object.proof_height !== undefined && object.proof_height !== null) { + message.proofHeight = Height.fromAmino(object.proof_height); + } + if (object.signer !== undefined && object.signer !== null) { + message.signer = object.signer; + } + return message; + }, + toAmino(message: MsgChannelOpenTry): MsgChannelOpenTryAmino { + const obj: any = {}; + obj.port_id = message.portId; obj.previous_channel_id = message.previousChannelId; obj.channel = message.channel ? Channel.toAmino(message.channel) : undefined; obj.counterparty_version = message.counterpartyVersion; - obj.proof_init = message.proofInit; + obj.proof_init = message.proofInit ? base64FromBytes(message.proofInit) : undefined; obj.proof_height = message.proofHeight ? Height.toAmino(message.proofHeight) : {}; obj.signer = message.signer; return obj; @@ -919,6 +1533,8 @@ export const MsgChannelOpenTry = { }; } }; +GlobalDecoderRegistry.register(MsgChannelOpenTry.typeUrl, MsgChannelOpenTry); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgChannelOpenTry.aminoType, MsgChannelOpenTry.typeUrl); function createBaseMsgChannelOpenTryResponse(): MsgChannelOpenTryResponse { return { version: "", @@ -927,6 +1543,16 @@ function createBaseMsgChannelOpenTryResponse(): MsgChannelOpenTryResponse { } export const MsgChannelOpenTryResponse = { typeUrl: "/ibc.core.channel.v1.MsgChannelOpenTryResponse", + aminoType: "cosmos-sdk/MsgChannelOpenTryResponse", + is(o: any): o is MsgChannelOpenTryResponse { + return o && (o.$typeUrl === MsgChannelOpenTryResponse.typeUrl || typeof o.version === "string" && typeof o.channelId === "string"); + }, + isSDK(o: any): o is MsgChannelOpenTryResponseSDKType { + return o && (o.$typeUrl === MsgChannelOpenTryResponse.typeUrl || typeof o.version === "string" && typeof o.channel_id === "string"); + }, + isAmino(o: any): o is MsgChannelOpenTryResponseAmino { + return o && (o.$typeUrl === MsgChannelOpenTryResponse.typeUrl || typeof o.version === "string" && typeof o.channel_id === "string"); + }, encode(message: MsgChannelOpenTryResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.version !== "") { writer.uint32(10).string(message.version); @@ -956,6 +1582,18 @@ export const MsgChannelOpenTryResponse = { } return message; }, + fromJSON(object: any): MsgChannelOpenTryResponse { + return { + version: isSet(object.version) ? String(object.version) : "", + channelId: isSet(object.channelId) ? String(object.channelId) : "" + }; + }, + toJSON(message: MsgChannelOpenTryResponse): unknown { + const obj: any = {}; + message.version !== undefined && (obj.version = message.version); + message.channelId !== undefined && (obj.channelId = message.channelId); + return obj; + }, fromPartial(object: Partial): MsgChannelOpenTryResponse { const message = createBaseMsgChannelOpenTryResponse(); message.version = object.version ?? ""; @@ -963,10 +1601,14 @@ export const MsgChannelOpenTryResponse = { return message; }, fromAmino(object: MsgChannelOpenTryResponseAmino): MsgChannelOpenTryResponse { - return { - version: object.version, - channelId: object.channel_id - }; + const message = createBaseMsgChannelOpenTryResponse(); + if (object.version !== undefined && object.version !== null) { + message.version = object.version; + } + if (object.channel_id !== undefined && object.channel_id !== null) { + message.channelId = object.channel_id; + } + return message; }, toAmino(message: MsgChannelOpenTryResponse): MsgChannelOpenTryResponseAmino { const obj: any = {}; @@ -996,6 +1638,8 @@ export const MsgChannelOpenTryResponse = { }; } }; +GlobalDecoderRegistry.register(MsgChannelOpenTryResponse.typeUrl, MsgChannelOpenTryResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgChannelOpenTryResponse.aminoType, MsgChannelOpenTryResponse.typeUrl); function createBaseMsgChannelOpenAck(): MsgChannelOpenAck { return { portId: "", @@ -1009,6 +1653,16 @@ function createBaseMsgChannelOpenAck(): MsgChannelOpenAck { } export const MsgChannelOpenAck = { typeUrl: "/ibc.core.channel.v1.MsgChannelOpenAck", + aminoType: "cosmos-sdk/MsgChannelOpenAck", + is(o: any): o is MsgChannelOpenAck { + return o && (o.$typeUrl === MsgChannelOpenAck.typeUrl || typeof o.portId === "string" && typeof o.channelId === "string" && typeof o.counterpartyChannelId === "string" && typeof o.counterpartyVersion === "string" && (o.proofTry instanceof Uint8Array || typeof o.proofTry === "string") && Height.is(o.proofHeight) && typeof o.signer === "string"); + }, + isSDK(o: any): o is MsgChannelOpenAckSDKType { + return o && (o.$typeUrl === MsgChannelOpenAck.typeUrl || typeof o.port_id === "string" && typeof o.channel_id === "string" && typeof o.counterparty_channel_id === "string" && typeof o.counterparty_version === "string" && (o.proof_try instanceof Uint8Array || typeof o.proof_try === "string") && Height.isSDK(o.proof_height) && typeof o.signer === "string"); + }, + isAmino(o: any): o is MsgChannelOpenAckAmino { + return o && (o.$typeUrl === MsgChannelOpenAck.typeUrl || typeof o.port_id === "string" && typeof o.channel_id === "string" && typeof o.counterparty_channel_id === "string" && typeof o.counterparty_version === "string" && (o.proof_try instanceof Uint8Array || typeof o.proof_try === "string") && Height.isAmino(o.proof_height) && typeof o.signer === "string"); + }, encode(message: MsgChannelOpenAck, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.portId !== "") { writer.uint32(10).string(message.portId); @@ -1068,6 +1722,28 @@ export const MsgChannelOpenAck = { } return message; }, + fromJSON(object: any): MsgChannelOpenAck { + return { + portId: isSet(object.portId) ? String(object.portId) : "", + channelId: isSet(object.channelId) ? String(object.channelId) : "", + counterpartyChannelId: isSet(object.counterpartyChannelId) ? String(object.counterpartyChannelId) : "", + counterpartyVersion: isSet(object.counterpartyVersion) ? String(object.counterpartyVersion) : "", + proofTry: isSet(object.proofTry) ? bytesFromBase64(object.proofTry) : new Uint8Array(), + proofHeight: isSet(object.proofHeight) ? Height.fromJSON(object.proofHeight) : undefined, + signer: isSet(object.signer) ? String(object.signer) : "" + }; + }, + toJSON(message: MsgChannelOpenAck): unknown { + const obj: any = {}; + message.portId !== undefined && (obj.portId = message.portId); + message.channelId !== undefined && (obj.channelId = message.channelId); + message.counterpartyChannelId !== undefined && (obj.counterpartyChannelId = message.counterpartyChannelId); + message.counterpartyVersion !== undefined && (obj.counterpartyVersion = message.counterpartyVersion); + message.proofTry !== undefined && (obj.proofTry = base64FromBytes(message.proofTry !== undefined ? message.proofTry : new Uint8Array())); + message.proofHeight !== undefined && (obj.proofHeight = message.proofHeight ? Height.toJSON(message.proofHeight) : undefined); + message.signer !== undefined && (obj.signer = message.signer); + return obj; + }, fromPartial(object: Partial): MsgChannelOpenAck { const message = createBaseMsgChannelOpenAck(); message.portId = object.portId ?? ""; @@ -1080,15 +1756,29 @@ export const MsgChannelOpenAck = { return message; }, fromAmino(object: MsgChannelOpenAckAmino): MsgChannelOpenAck { - return { - portId: object.port_id, - channelId: object.channel_id, - counterpartyChannelId: object.counterparty_channel_id, - counterpartyVersion: object.counterparty_version, - proofTry: object.proof_try, - proofHeight: object?.proof_height ? Height.fromAmino(object.proof_height) : undefined, - signer: object.signer - }; + const message = createBaseMsgChannelOpenAck(); + if (object.port_id !== undefined && object.port_id !== null) { + message.portId = object.port_id; + } + if (object.channel_id !== undefined && object.channel_id !== null) { + message.channelId = object.channel_id; + } + if (object.counterparty_channel_id !== undefined && object.counterparty_channel_id !== null) { + message.counterpartyChannelId = object.counterparty_channel_id; + } + if (object.counterparty_version !== undefined && object.counterparty_version !== null) { + message.counterpartyVersion = object.counterparty_version; + } + if (object.proof_try !== undefined && object.proof_try !== null) { + message.proofTry = bytesFromBase64(object.proof_try); + } + if (object.proof_height !== undefined && object.proof_height !== null) { + message.proofHeight = Height.fromAmino(object.proof_height); + } + if (object.signer !== undefined && object.signer !== null) { + message.signer = object.signer; + } + return message; }, toAmino(message: MsgChannelOpenAck): MsgChannelOpenAckAmino { const obj: any = {}; @@ -1096,7 +1786,7 @@ export const MsgChannelOpenAck = { obj.channel_id = message.channelId; obj.counterparty_channel_id = message.counterpartyChannelId; obj.counterparty_version = message.counterpartyVersion; - obj.proof_try = message.proofTry; + obj.proof_try = message.proofTry ? base64FromBytes(message.proofTry) : undefined; obj.proof_height = message.proofHeight ? Height.toAmino(message.proofHeight) : {}; obj.signer = message.signer; return obj; @@ -1123,11 +1813,23 @@ export const MsgChannelOpenAck = { }; } }; +GlobalDecoderRegistry.register(MsgChannelOpenAck.typeUrl, MsgChannelOpenAck); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgChannelOpenAck.aminoType, MsgChannelOpenAck.typeUrl); function createBaseMsgChannelOpenAckResponse(): MsgChannelOpenAckResponse { return {}; } export const MsgChannelOpenAckResponse = { typeUrl: "/ibc.core.channel.v1.MsgChannelOpenAckResponse", + aminoType: "cosmos-sdk/MsgChannelOpenAckResponse", + is(o: any): o is MsgChannelOpenAckResponse { + return o && o.$typeUrl === MsgChannelOpenAckResponse.typeUrl; + }, + isSDK(o: any): o is MsgChannelOpenAckResponseSDKType { + return o && o.$typeUrl === MsgChannelOpenAckResponse.typeUrl; + }, + isAmino(o: any): o is MsgChannelOpenAckResponseAmino { + return o && o.$typeUrl === MsgChannelOpenAckResponse.typeUrl; + }, encode(_: MsgChannelOpenAckResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, @@ -1145,12 +1847,20 @@ export const MsgChannelOpenAckResponse = { } return message; }, + fromJSON(_: any): MsgChannelOpenAckResponse { + return {}; + }, + toJSON(_: MsgChannelOpenAckResponse): unknown { + const obj: any = {}; + return obj; + }, fromPartial(_: Partial): MsgChannelOpenAckResponse { const message = createBaseMsgChannelOpenAckResponse(); return message; }, fromAmino(_: MsgChannelOpenAckResponseAmino): MsgChannelOpenAckResponse { - return {}; + const message = createBaseMsgChannelOpenAckResponse(); + return message; }, toAmino(_: MsgChannelOpenAckResponse): MsgChannelOpenAckResponseAmino { const obj: any = {}; @@ -1178,6 +1888,8 @@ export const MsgChannelOpenAckResponse = { }; } }; +GlobalDecoderRegistry.register(MsgChannelOpenAckResponse.typeUrl, MsgChannelOpenAckResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgChannelOpenAckResponse.aminoType, MsgChannelOpenAckResponse.typeUrl); function createBaseMsgChannelOpenConfirm(): MsgChannelOpenConfirm { return { portId: "", @@ -1189,6 +1901,16 @@ function createBaseMsgChannelOpenConfirm(): MsgChannelOpenConfirm { } export const MsgChannelOpenConfirm = { typeUrl: "/ibc.core.channel.v1.MsgChannelOpenConfirm", + aminoType: "cosmos-sdk/MsgChannelOpenConfirm", + is(o: any): o is MsgChannelOpenConfirm { + return o && (o.$typeUrl === MsgChannelOpenConfirm.typeUrl || typeof o.portId === "string" && typeof o.channelId === "string" && (o.proofAck instanceof Uint8Array || typeof o.proofAck === "string") && Height.is(o.proofHeight) && typeof o.signer === "string"); + }, + isSDK(o: any): o is MsgChannelOpenConfirmSDKType { + return o && (o.$typeUrl === MsgChannelOpenConfirm.typeUrl || typeof o.port_id === "string" && typeof o.channel_id === "string" && (o.proof_ack instanceof Uint8Array || typeof o.proof_ack === "string") && Height.isSDK(o.proof_height) && typeof o.signer === "string"); + }, + isAmino(o: any): o is MsgChannelOpenConfirmAmino { + return o && (o.$typeUrl === MsgChannelOpenConfirm.typeUrl || typeof o.port_id === "string" && typeof o.channel_id === "string" && (o.proof_ack instanceof Uint8Array || typeof o.proof_ack === "string") && Height.isAmino(o.proof_height) && typeof o.signer === "string"); + }, encode(message: MsgChannelOpenConfirm, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.portId !== "") { writer.uint32(10).string(message.portId); @@ -1236,6 +1958,24 @@ export const MsgChannelOpenConfirm = { } return message; }, + fromJSON(object: any): MsgChannelOpenConfirm { + return { + portId: isSet(object.portId) ? String(object.portId) : "", + channelId: isSet(object.channelId) ? String(object.channelId) : "", + proofAck: isSet(object.proofAck) ? bytesFromBase64(object.proofAck) : new Uint8Array(), + proofHeight: isSet(object.proofHeight) ? Height.fromJSON(object.proofHeight) : undefined, + signer: isSet(object.signer) ? String(object.signer) : "" + }; + }, + toJSON(message: MsgChannelOpenConfirm): unknown { + const obj: any = {}; + message.portId !== undefined && (obj.portId = message.portId); + message.channelId !== undefined && (obj.channelId = message.channelId); + message.proofAck !== undefined && (obj.proofAck = base64FromBytes(message.proofAck !== undefined ? message.proofAck : new Uint8Array())); + message.proofHeight !== undefined && (obj.proofHeight = message.proofHeight ? Height.toJSON(message.proofHeight) : undefined); + message.signer !== undefined && (obj.signer = message.signer); + return obj; + }, fromPartial(object: Partial): MsgChannelOpenConfirm { const message = createBaseMsgChannelOpenConfirm(); message.portId = object.portId ?? ""; @@ -1246,19 +1986,29 @@ export const MsgChannelOpenConfirm = { return message; }, fromAmino(object: MsgChannelOpenConfirmAmino): MsgChannelOpenConfirm { - return { - portId: object.port_id, - channelId: object.channel_id, - proofAck: object.proof_ack, - proofHeight: object?.proof_height ? Height.fromAmino(object.proof_height) : undefined, - signer: object.signer - }; + const message = createBaseMsgChannelOpenConfirm(); + if (object.port_id !== undefined && object.port_id !== null) { + message.portId = object.port_id; + } + if (object.channel_id !== undefined && object.channel_id !== null) { + message.channelId = object.channel_id; + } + if (object.proof_ack !== undefined && object.proof_ack !== null) { + message.proofAck = bytesFromBase64(object.proof_ack); + } + if (object.proof_height !== undefined && object.proof_height !== null) { + message.proofHeight = Height.fromAmino(object.proof_height); + } + if (object.signer !== undefined && object.signer !== null) { + message.signer = object.signer; + } + return message; }, toAmino(message: MsgChannelOpenConfirm): MsgChannelOpenConfirmAmino { const obj: any = {}; obj.port_id = message.portId; obj.channel_id = message.channelId; - obj.proof_ack = message.proofAck; + obj.proof_ack = message.proofAck ? base64FromBytes(message.proofAck) : undefined; obj.proof_height = message.proofHeight ? Height.toAmino(message.proofHeight) : {}; obj.signer = message.signer; return obj; @@ -1285,11 +2035,23 @@ export const MsgChannelOpenConfirm = { }; } }; +GlobalDecoderRegistry.register(MsgChannelOpenConfirm.typeUrl, MsgChannelOpenConfirm); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgChannelOpenConfirm.aminoType, MsgChannelOpenConfirm.typeUrl); function createBaseMsgChannelOpenConfirmResponse(): MsgChannelOpenConfirmResponse { return {}; } export const MsgChannelOpenConfirmResponse = { typeUrl: "/ibc.core.channel.v1.MsgChannelOpenConfirmResponse", + aminoType: "cosmos-sdk/MsgChannelOpenConfirmResponse", + is(o: any): o is MsgChannelOpenConfirmResponse { + return o && o.$typeUrl === MsgChannelOpenConfirmResponse.typeUrl; + }, + isSDK(o: any): o is MsgChannelOpenConfirmResponseSDKType { + return o && o.$typeUrl === MsgChannelOpenConfirmResponse.typeUrl; + }, + isAmino(o: any): o is MsgChannelOpenConfirmResponseAmino { + return o && o.$typeUrl === MsgChannelOpenConfirmResponse.typeUrl; + }, encode(_: MsgChannelOpenConfirmResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, @@ -1307,12 +2069,20 @@ export const MsgChannelOpenConfirmResponse = { } return message; }, + fromJSON(_: any): MsgChannelOpenConfirmResponse { + return {}; + }, + toJSON(_: MsgChannelOpenConfirmResponse): unknown { + const obj: any = {}; + return obj; + }, fromPartial(_: Partial): MsgChannelOpenConfirmResponse { const message = createBaseMsgChannelOpenConfirmResponse(); return message; }, fromAmino(_: MsgChannelOpenConfirmResponseAmino): MsgChannelOpenConfirmResponse { - return {}; + const message = createBaseMsgChannelOpenConfirmResponse(); + return message; }, toAmino(_: MsgChannelOpenConfirmResponse): MsgChannelOpenConfirmResponseAmino { const obj: any = {}; @@ -1340,6 +2110,8 @@ export const MsgChannelOpenConfirmResponse = { }; } }; +GlobalDecoderRegistry.register(MsgChannelOpenConfirmResponse.typeUrl, MsgChannelOpenConfirmResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgChannelOpenConfirmResponse.aminoType, MsgChannelOpenConfirmResponse.typeUrl); function createBaseMsgChannelCloseInit(): MsgChannelCloseInit { return { portId: "", @@ -1349,6 +2121,16 @@ function createBaseMsgChannelCloseInit(): MsgChannelCloseInit { } export const MsgChannelCloseInit = { typeUrl: "/ibc.core.channel.v1.MsgChannelCloseInit", + aminoType: "cosmos-sdk/MsgChannelCloseInit", + is(o: any): o is MsgChannelCloseInit { + return o && (o.$typeUrl === MsgChannelCloseInit.typeUrl || typeof o.portId === "string" && typeof o.channelId === "string" && typeof o.signer === "string"); + }, + isSDK(o: any): o is MsgChannelCloseInitSDKType { + return o && (o.$typeUrl === MsgChannelCloseInit.typeUrl || typeof o.port_id === "string" && typeof o.channel_id === "string" && typeof o.signer === "string"); + }, + isAmino(o: any): o is MsgChannelCloseInitAmino { + return o && (o.$typeUrl === MsgChannelCloseInit.typeUrl || typeof o.port_id === "string" && typeof o.channel_id === "string" && typeof o.signer === "string"); + }, encode(message: MsgChannelCloseInit, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.portId !== "") { writer.uint32(10).string(message.portId); @@ -1384,6 +2166,20 @@ export const MsgChannelCloseInit = { } return message; }, + fromJSON(object: any): MsgChannelCloseInit { + return { + portId: isSet(object.portId) ? String(object.portId) : "", + channelId: isSet(object.channelId) ? String(object.channelId) : "", + signer: isSet(object.signer) ? String(object.signer) : "" + }; + }, + toJSON(message: MsgChannelCloseInit): unknown { + const obj: any = {}; + message.portId !== undefined && (obj.portId = message.portId); + message.channelId !== undefined && (obj.channelId = message.channelId); + message.signer !== undefined && (obj.signer = message.signer); + return obj; + }, fromPartial(object: Partial): MsgChannelCloseInit { const message = createBaseMsgChannelCloseInit(); message.portId = object.portId ?? ""; @@ -1392,11 +2188,17 @@ export const MsgChannelCloseInit = { return message; }, fromAmino(object: MsgChannelCloseInitAmino): MsgChannelCloseInit { - return { - portId: object.port_id, - channelId: object.channel_id, - signer: object.signer - }; + const message = createBaseMsgChannelCloseInit(); + if (object.port_id !== undefined && object.port_id !== null) { + message.portId = object.port_id; + } + if (object.channel_id !== undefined && object.channel_id !== null) { + message.channelId = object.channel_id; + } + if (object.signer !== undefined && object.signer !== null) { + message.signer = object.signer; + } + return message; }, toAmino(message: MsgChannelCloseInit): MsgChannelCloseInitAmino { const obj: any = {}; @@ -1427,11 +2229,23 @@ export const MsgChannelCloseInit = { }; } }; +GlobalDecoderRegistry.register(MsgChannelCloseInit.typeUrl, MsgChannelCloseInit); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgChannelCloseInit.aminoType, MsgChannelCloseInit.typeUrl); function createBaseMsgChannelCloseInitResponse(): MsgChannelCloseInitResponse { return {}; } export const MsgChannelCloseInitResponse = { typeUrl: "/ibc.core.channel.v1.MsgChannelCloseInitResponse", + aminoType: "cosmos-sdk/MsgChannelCloseInitResponse", + is(o: any): o is MsgChannelCloseInitResponse { + return o && o.$typeUrl === MsgChannelCloseInitResponse.typeUrl; + }, + isSDK(o: any): o is MsgChannelCloseInitResponseSDKType { + return o && o.$typeUrl === MsgChannelCloseInitResponse.typeUrl; + }, + isAmino(o: any): o is MsgChannelCloseInitResponseAmino { + return o && o.$typeUrl === MsgChannelCloseInitResponse.typeUrl; + }, encode(_: MsgChannelCloseInitResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, @@ -1449,12 +2263,20 @@ export const MsgChannelCloseInitResponse = { } return message; }, + fromJSON(_: any): MsgChannelCloseInitResponse { + return {}; + }, + toJSON(_: MsgChannelCloseInitResponse): unknown { + const obj: any = {}; + return obj; + }, fromPartial(_: Partial): MsgChannelCloseInitResponse { const message = createBaseMsgChannelCloseInitResponse(); return message; }, fromAmino(_: MsgChannelCloseInitResponseAmino): MsgChannelCloseInitResponse { - return {}; + const message = createBaseMsgChannelCloseInitResponse(); + return message; }, toAmino(_: MsgChannelCloseInitResponse): MsgChannelCloseInitResponseAmino { const obj: any = {}; @@ -1482,17 +2304,30 @@ export const MsgChannelCloseInitResponse = { }; } }; +GlobalDecoderRegistry.register(MsgChannelCloseInitResponse.typeUrl, MsgChannelCloseInitResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgChannelCloseInitResponse.aminoType, MsgChannelCloseInitResponse.typeUrl); function createBaseMsgChannelCloseConfirm(): MsgChannelCloseConfirm { return { portId: "", channelId: "", proofInit: new Uint8Array(), proofHeight: Height.fromPartial({}), - signer: "" + signer: "", + counterpartyUpgradeSequence: BigInt(0) }; } export const MsgChannelCloseConfirm = { typeUrl: "/ibc.core.channel.v1.MsgChannelCloseConfirm", + aminoType: "cosmos-sdk/MsgChannelCloseConfirm", + is(o: any): o is MsgChannelCloseConfirm { + return o && (o.$typeUrl === MsgChannelCloseConfirm.typeUrl || typeof o.portId === "string" && typeof o.channelId === "string" && (o.proofInit instanceof Uint8Array || typeof o.proofInit === "string") && Height.is(o.proofHeight) && typeof o.signer === "string" && typeof o.counterpartyUpgradeSequence === "bigint"); + }, + isSDK(o: any): o is MsgChannelCloseConfirmSDKType { + return o && (o.$typeUrl === MsgChannelCloseConfirm.typeUrl || typeof o.port_id === "string" && typeof o.channel_id === "string" && (o.proof_init instanceof Uint8Array || typeof o.proof_init === "string") && Height.isSDK(o.proof_height) && typeof o.signer === "string" && typeof o.counterparty_upgrade_sequence === "bigint"); + }, + isAmino(o: any): o is MsgChannelCloseConfirmAmino { + return o && (o.$typeUrl === MsgChannelCloseConfirm.typeUrl || typeof o.port_id === "string" && typeof o.channel_id === "string" && (o.proof_init instanceof Uint8Array || typeof o.proof_init === "string") && Height.isAmino(o.proof_height) && typeof o.signer === "string" && typeof o.counterparty_upgrade_sequence === "bigint"); + }, encode(message: MsgChannelCloseConfirm, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.portId !== "") { writer.uint32(10).string(message.portId); @@ -1509,6 +2344,9 @@ export const MsgChannelCloseConfirm = { if (message.signer !== "") { writer.uint32(42).string(message.signer); } + if (message.counterpartyUpgradeSequence !== BigInt(0)) { + writer.uint32(48).uint64(message.counterpartyUpgradeSequence); + } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): MsgChannelCloseConfirm { @@ -1533,6 +2371,9 @@ export const MsgChannelCloseConfirm = { case 5: message.signer = reader.string(); break; + case 6: + message.counterpartyUpgradeSequence = reader.uint64(); + break; default: reader.skipType(tag & 7); break; @@ -1540,6 +2381,26 @@ export const MsgChannelCloseConfirm = { } return message; }, + fromJSON(object: any): MsgChannelCloseConfirm { + return { + portId: isSet(object.portId) ? String(object.portId) : "", + channelId: isSet(object.channelId) ? String(object.channelId) : "", + proofInit: isSet(object.proofInit) ? bytesFromBase64(object.proofInit) : new Uint8Array(), + proofHeight: isSet(object.proofHeight) ? Height.fromJSON(object.proofHeight) : undefined, + signer: isSet(object.signer) ? String(object.signer) : "", + counterpartyUpgradeSequence: isSet(object.counterpartyUpgradeSequence) ? BigInt(object.counterpartyUpgradeSequence.toString()) : BigInt(0) + }; + }, + toJSON(message: MsgChannelCloseConfirm): unknown { + const obj: any = {}; + message.portId !== undefined && (obj.portId = message.portId); + message.channelId !== undefined && (obj.channelId = message.channelId); + message.proofInit !== undefined && (obj.proofInit = base64FromBytes(message.proofInit !== undefined ? message.proofInit : new Uint8Array())); + message.proofHeight !== undefined && (obj.proofHeight = message.proofHeight ? Height.toJSON(message.proofHeight) : undefined); + message.signer !== undefined && (obj.signer = message.signer); + message.counterpartyUpgradeSequence !== undefined && (obj.counterpartyUpgradeSequence = (message.counterpartyUpgradeSequence || BigInt(0)).toString()); + return obj; + }, fromPartial(object: Partial): MsgChannelCloseConfirm { const message = createBaseMsgChannelCloseConfirm(); message.portId = object.portId ?? ""; @@ -1547,24 +2408,39 @@ export const MsgChannelCloseConfirm = { message.proofInit = object.proofInit ?? new Uint8Array(); message.proofHeight = object.proofHeight !== undefined && object.proofHeight !== null ? Height.fromPartial(object.proofHeight) : undefined; message.signer = object.signer ?? ""; + message.counterpartyUpgradeSequence = object.counterpartyUpgradeSequence !== undefined && object.counterpartyUpgradeSequence !== null ? BigInt(object.counterpartyUpgradeSequence.toString()) : BigInt(0); return message; }, fromAmino(object: MsgChannelCloseConfirmAmino): MsgChannelCloseConfirm { - return { - portId: object.port_id, - channelId: object.channel_id, - proofInit: object.proof_init, - proofHeight: object?.proof_height ? Height.fromAmino(object.proof_height) : undefined, - signer: object.signer - }; + const message = createBaseMsgChannelCloseConfirm(); + if (object.port_id !== undefined && object.port_id !== null) { + message.portId = object.port_id; + } + if (object.channel_id !== undefined && object.channel_id !== null) { + message.channelId = object.channel_id; + } + if (object.proof_init !== undefined && object.proof_init !== null) { + message.proofInit = bytesFromBase64(object.proof_init); + } + if (object.proof_height !== undefined && object.proof_height !== null) { + message.proofHeight = Height.fromAmino(object.proof_height); + } + if (object.signer !== undefined && object.signer !== null) { + message.signer = object.signer; + } + if (object.counterparty_upgrade_sequence !== undefined && object.counterparty_upgrade_sequence !== null) { + message.counterpartyUpgradeSequence = BigInt(object.counterparty_upgrade_sequence); + } + return message; }, toAmino(message: MsgChannelCloseConfirm): MsgChannelCloseConfirmAmino { const obj: any = {}; obj.port_id = message.portId; obj.channel_id = message.channelId; - obj.proof_init = message.proofInit; + obj.proof_init = message.proofInit ? base64FromBytes(message.proofInit) : undefined; obj.proof_height = message.proofHeight ? Height.toAmino(message.proofHeight) : {}; obj.signer = message.signer; + obj.counterparty_upgrade_sequence = message.counterpartyUpgradeSequence ? message.counterpartyUpgradeSequence.toString() : undefined; return obj; }, fromAminoMsg(object: MsgChannelCloseConfirmAminoMsg): MsgChannelCloseConfirm { @@ -1589,11 +2465,23 @@ export const MsgChannelCloseConfirm = { }; } }; +GlobalDecoderRegistry.register(MsgChannelCloseConfirm.typeUrl, MsgChannelCloseConfirm); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgChannelCloseConfirm.aminoType, MsgChannelCloseConfirm.typeUrl); function createBaseMsgChannelCloseConfirmResponse(): MsgChannelCloseConfirmResponse { return {}; } export const MsgChannelCloseConfirmResponse = { typeUrl: "/ibc.core.channel.v1.MsgChannelCloseConfirmResponse", + aminoType: "cosmos-sdk/MsgChannelCloseConfirmResponse", + is(o: any): o is MsgChannelCloseConfirmResponse { + return o && o.$typeUrl === MsgChannelCloseConfirmResponse.typeUrl; + }, + isSDK(o: any): o is MsgChannelCloseConfirmResponseSDKType { + return o && o.$typeUrl === MsgChannelCloseConfirmResponse.typeUrl; + }, + isAmino(o: any): o is MsgChannelCloseConfirmResponseAmino { + return o && o.$typeUrl === MsgChannelCloseConfirmResponse.typeUrl; + }, encode(_: MsgChannelCloseConfirmResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, @@ -1611,12 +2499,20 @@ export const MsgChannelCloseConfirmResponse = { } return message; }, + fromJSON(_: any): MsgChannelCloseConfirmResponse { + return {}; + }, + toJSON(_: MsgChannelCloseConfirmResponse): unknown { + const obj: any = {}; + return obj; + }, fromPartial(_: Partial): MsgChannelCloseConfirmResponse { const message = createBaseMsgChannelCloseConfirmResponse(); return message; }, fromAmino(_: MsgChannelCloseConfirmResponseAmino): MsgChannelCloseConfirmResponse { - return {}; + const message = createBaseMsgChannelCloseConfirmResponse(); + return message; }, toAmino(_: MsgChannelCloseConfirmResponse): MsgChannelCloseConfirmResponseAmino { const obj: any = {}; @@ -1644,6 +2540,8 @@ export const MsgChannelCloseConfirmResponse = { }; } }; +GlobalDecoderRegistry.register(MsgChannelCloseConfirmResponse.typeUrl, MsgChannelCloseConfirmResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgChannelCloseConfirmResponse.aminoType, MsgChannelCloseConfirmResponse.typeUrl); function createBaseMsgRecvPacket(): MsgRecvPacket { return { packet: Packet.fromPartial({}), @@ -1654,6 +2552,16 @@ function createBaseMsgRecvPacket(): MsgRecvPacket { } export const MsgRecvPacket = { typeUrl: "/ibc.core.channel.v1.MsgRecvPacket", + aminoType: "cosmos-sdk/MsgRecvPacket", + is(o: any): o is MsgRecvPacket { + return o && (o.$typeUrl === MsgRecvPacket.typeUrl || Packet.is(o.packet) && (o.proofCommitment instanceof Uint8Array || typeof o.proofCommitment === "string") && Height.is(o.proofHeight) && typeof o.signer === "string"); + }, + isSDK(o: any): o is MsgRecvPacketSDKType { + return o && (o.$typeUrl === MsgRecvPacket.typeUrl || Packet.isSDK(o.packet) && (o.proof_commitment instanceof Uint8Array || typeof o.proof_commitment === "string") && Height.isSDK(o.proof_height) && typeof o.signer === "string"); + }, + isAmino(o: any): o is MsgRecvPacketAmino { + return o && (o.$typeUrl === MsgRecvPacket.typeUrl || Packet.isAmino(o.packet) && (o.proof_commitment instanceof Uint8Array || typeof o.proof_commitment === "string") && Height.isAmino(o.proof_height) && typeof o.signer === "string"); + }, encode(message: MsgRecvPacket, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.packet !== undefined) { Packet.encode(message.packet, writer.uint32(10).fork()).ldelim(); @@ -1695,6 +2603,22 @@ export const MsgRecvPacket = { } return message; }, + fromJSON(object: any): MsgRecvPacket { + return { + packet: isSet(object.packet) ? Packet.fromJSON(object.packet) : undefined, + proofCommitment: isSet(object.proofCommitment) ? bytesFromBase64(object.proofCommitment) : new Uint8Array(), + proofHeight: isSet(object.proofHeight) ? Height.fromJSON(object.proofHeight) : undefined, + signer: isSet(object.signer) ? String(object.signer) : "" + }; + }, + toJSON(message: MsgRecvPacket): unknown { + const obj: any = {}; + message.packet !== undefined && (obj.packet = message.packet ? Packet.toJSON(message.packet) : undefined); + message.proofCommitment !== undefined && (obj.proofCommitment = base64FromBytes(message.proofCommitment !== undefined ? message.proofCommitment : new Uint8Array())); + message.proofHeight !== undefined && (obj.proofHeight = message.proofHeight ? Height.toJSON(message.proofHeight) : undefined); + message.signer !== undefined && (obj.signer = message.signer); + return obj; + }, fromPartial(object: Partial): MsgRecvPacket { const message = createBaseMsgRecvPacket(); message.packet = object.packet !== undefined && object.packet !== null ? Packet.fromPartial(object.packet) : undefined; @@ -1704,17 +2628,25 @@ export const MsgRecvPacket = { return message; }, fromAmino(object: MsgRecvPacketAmino): MsgRecvPacket { - return { - packet: object?.packet ? Packet.fromAmino(object.packet) : undefined, - proofCommitment: object.proof_commitment, - proofHeight: object?.proof_height ? Height.fromAmino(object.proof_height) : undefined, - signer: object.signer - }; + const message = createBaseMsgRecvPacket(); + if (object.packet !== undefined && object.packet !== null) { + message.packet = Packet.fromAmino(object.packet); + } + if (object.proof_commitment !== undefined && object.proof_commitment !== null) { + message.proofCommitment = bytesFromBase64(object.proof_commitment); + } + if (object.proof_height !== undefined && object.proof_height !== null) { + message.proofHeight = Height.fromAmino(object.proof_height); + } + if (object.signer !== undefined && object.signer !== null) { + message.signer = object.signer; + } + return message; }, toAmino(message: MsgRecvPacket): MsgRecvPacketAmino { const obj: any = {}; obj.packet = message.packet ? Packet.toAmino(message.packet) : undefined; - obj.proof_commitment = message.proofCommitment; + obj.proof_commitment = message.proofCommitment ? base64FromBytes(message.proofCommitment) : undefined; obj.proof_height = message.proofHeight ? Height.toAmino(message.proofHeight) : {}; obj.signer = message.signer; return obj; @@ -1741,6 +2673,8 @@ export const MsgRecvPacket = { }; } }; +GlobalDecoderRegistry.register(MsgRecvPacket.typeUrl, MsgRecvPacket); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgRecvPacket.aminoType, MsgRecvPacket.typeUrl); function createBaseMsgRecvPacketResponse(): MsgRecvPacketResponse { return { result: 0 @@ -1748,6 +2682,16 @@ function createBaseMsgRecvPacketResponse(): MsgRecvPacketResponse { } export const MsgRecvPacketResponse = { typeUrl: "/ibc.core.channel.v1.MsgRecvPacketResponse", + aminoType: "cosmos-sdk/MsgRecvPacketResponse", + is(o: any): o is MsgRecvPacketResponse { + return o && (o.$typeUrl === MsgRecvPacketResponse.typeUrl || isSet(o.result)); + }, + isSDK(o: any): o is MsgRecvPacketResponseSDKType { + return o && (o.$typeUrl === MsgRecvPacketResponse.typeUrl || isSet(o.result)); + }, + isAmino(o: any): o is MsgRecvPacketResponseAmino { + return o && (o.$typeUrl === MsgRecvPacketResponse.typeUrl || isSet(o.result)); + }, encode(message: MsgRecvPacketResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.result !== 0) { writer.uint32(8).int32(message.result); @@ -1771,19 +2715,31 @@ export const MsgRecvPacketResponse = { } return message; }, + fromJSON(object: any): MsgRecvPacketResponse { + return { + result: isSet(object.result) ? responseResultTypeFromJSON(object.result) : -1 + }; + }, + toJSON(message: MsgRecvPacketResponse): unknown { + const obj: any = {}; + message.result !== undefined && (obj.result = responseResultTypeToJSON(message.result)); + return obj; + }, fromPartial(object: Partial): MsgRecvPacketResponse { const message = createBaseMsgRecvPacketResponse(); message.result = object.result ?? 0; return message; }, fromAmino(object: MsgRecvPacketResponseAmino): MsgRecvPacketResponse { - return { - result: isSet(object.result) ? responseResultTypeFromJSON(object.result) : -1 - }; + const message = createBaseMsgRecvPacketResponse(); + if (object.result !== undefined && object.result !== null) { + message.result = responseResultTypeFromJSON(object.result); + } + return message; }, toAmino(message: MsgRecvPacketResponse): MsgRecvPacketResponseAmino { const obj: any = {}; - obj.result = message.result; + obj.result = responseResultTypeToJSON(message.result); return obj; }, fromAminoMsg(object: MsgRecvPacketResponseAminoMsg): MsgRecvPacketResponse { @@ -1808,6 +2764,8 @@ export const MsgRecvPacketResponse = { }; } }; +GlobalDecoderRegistry.register(MsgRecvPacketResponse.typeUrl, MsgRecvPacketResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgRecvPacketResponse.aminoType, MsgRecvPacketResponse.typeUrl); function createBaseMsgTimeout(): MsgTimeout { return { packet: Packet.fromPartial({}), @@ -1819,6 +2777,16 @@ function createBaseMsgTimeout(): MsgTimeout { } export const MsgTimeout = { typeUrl: "/ibc.core.channel.v1.MsgTimeout", + aminoType: "cosmos-sdk/MsgTimeout", + is(o: any): o is MsgTimeout { + return o && (o.$typeUrl === MsgTimeout.typeUrl || Packet.is(o.packet) && (o.proofUnreceived instanceof Uint8Array || typeof o.proofUnreceived === "string") && Height.is(o.proofHeight) && typeof o.nextSequenceRecv === "bigint" && typeof o.signer === "string"); + }, + isSDK(o: any): o is MsgTimeoutSDKType { + return o && (o.$typeUrl === MsgTimeout.typeUrl || Packet.isSDK(o.packet) && (o.proof_unreceived instanceof Uint8Array || typeof o.proof_unreceived === "string") && Height.isSDK(o.proof_height) && typeof o.next_sequence_recv === "bigint" && typeof o.signer === "string"); + }, + isAmino(o: any): o is MsgTimeoutAmino { + return o && (o.$typeUrl === MsgTimeout.typeUrl || Packet.isAmino(o.packet) && (o.proof_unreceived instanceof Uint8Array || typeof o.proof_unreceived === "string") && Height.isAmino(o.proof_height) && typeof o.next_sequence_recv === "bigint" && typeof o.signer === "string"); + }, encode(message: MsgTimeout, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.packet !== undefined) { Packet.encode(message.packet, writer.uint32(10).fork()).ldelim(); @@ -1866,6 +2834,24 @@ export const MsgTimeout = { } return message; }, + fromJSON(object: any): MsgTimeout { + return { + packet: isSet(object.packet) ? Packet.fromJSON(object.packet) : undefined, + proofUnreceived: isSet(object.proofUnreceived) ? bytesFromBase64(object.proofUnreceived) : new Uint8Array(), + proofHeight: isSet(object.proofHeight) ? Height.fromJSON(object.proofHeight) : undefined, + nextSequenceRecv: isSet(object.nextSequenceRecv) ? BigInt(object.nextSequenceRecv.toString()) : BigInt(0), + signer: isSet(object.signer) ? String(object.signer) : "" + }; + }, + toJSON(message: MsgTimeout): unknown { + const obj: any = {}; + message.packet !== undefined && (obj.packet = message.packet ? Packet.toJSON(message.packet) : undefined); + message.proofUnreceived !== undefined && (obj.proofUnreceived = base64FromBytes(message.proofUnreceived !== undefined ? message.proofUnreceived : new Uint8Array())); + message.proofHeight !== undefined && (obj.proofHeight = message.proofHeight ? Height.toJSON(message.proofHeight) : undefined); + message.nextSequenceRecv !== undefined && (obj.nextSequenceRecv = (message.nextSequenceRecv || BigInt(0)).toString()); + message.signer !== undefined && (obj.signer = message.signer); + return obj; + }, fromPartial(object: Partial): MsgTimeout { const message = createBaseMsgTimeout(); message.packet = object.packet !== undefined && object.packet !== null ? Packet.fromPartial(object.packet) : undefined; @@ -1876,18 +2862,28 @@ export const MsgTimeout = { return message; }, fromAmino(object: MsgTimeoutAmino): MsgTimeout { - return { - packet: object?.packet ? Packet.fromAmino(object.packet) : undefined, - proofUnreceived: object.proof_unreceived, - proofHeight: object?.proof_height ? Height.fromAmino(object.proof_height) : undefined, - nextSequenceRecv: BigInt(object.next_sequence_recv), - signer: object.signer - }; + const message = createBaseMsgTimeout(); + if (object.packet !== undefined && object.packet !== null) { + message.packet = Packet.fromAmino(object.packet); + } + if (object.proof_unreceived !== undefined && object.proof_unreceived !== null) { + message.proofUnreceived = bytesFromBase64(object.proof_unreceived); + } + if (object.proof_height !== undefined && object.proof_height !== null) { + message.proofHeight = Height.fromAmino(object.proof_height); + } + if (object.next_sequence_recv !== undefined && object.next_sequence_recv !== null) { + message.nextSequenceRecv = BigInt(object.next_sequence_recv); + } + if (object.signer !== undefined && object.signer !== null) { + message.signer = object.signer; + } + return message; }, toAmino(message: MsgTimeout): MsgTimeoutAmino { const obj: any = {}; obj.packet = message.packet ? Packet.toAmino(message.packet) : undefined; - obj.proof_unreceived = message.proofUnreceived; + obj.proof_unreceived = message.proofUnreceived ? base64FromBytes(message.proofUnreceived) : undefined; obj.proof_height = message.proofHeight ? Height.toAmino(message.proofHeight) : {}; obj.next_sequence_recv = message.nextSequenceRecv ? message.nextSequenceRecv.toString() : undefined; obj.signer = message.signer; @@ -1915,6 +2911,8 @@ export const MsgTimeout = { }; } }; +GlobalDecoderRegistry.register(MsgTimeout.typeUrl, MsgTimeout); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgTimeout.aminoType, MsgTimeout.typeUrl); function createBaseMsgTimeoutResponse(): MsgTimeoutResponse { return { result: 0 @@ -1922,6 +2920,16 @@ function createBaseMsgTimeoutResponse(): MsgTimeoutResponse { } export const MsgTimeoutResponse = { typeUrl: "/ibc.core.channel.v1.MsgTimeoutResponse", + aminoType: "cosmos-sdk/MsgTimeoutResponse", + is(o: any): o is MsgTimeoutResponse { + return o && (o.$typeUrl === MsgTimeoutResponse.typeUrl || isSet(o.result)); + }, + isSDK(o: any): o is MsgTimeoutResponseSDKType { + return o && (o.$typeUrl === MsgTimeoutResponse.typeUrl || isSet(o.result)); + }, + isAmino(o: any): o is MsgTimeoutResponseAmino { + return o && (o.$typeUrl === MsgTimeoutResponse.typeUrl || isSet(o.result)); + }, encode(message: MsgTimeoutResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.result !== 0) { writer.uint32(8).int32(message.result); @@ -1945,19 +2953,31 @@ export const MsgTimeoutResponse = { } return message; }, + fromJSON(object: any): MsgTimeoutResponse { + return { + result: isSet(object.result) ? responseResultTypeFromJSON(object.result) : -1 + }; + }, + toJSON(message: MsgTimeoutResponse): unknown { + const obj: any = {}; + message.result !== undefined && (obj.result = responseResultTypeToJSON(message.result)); + return obj; + }, fromPartial(object: Partial): MsgTimeoutResponse { const message = createBaseMsgTimeoutResponse(); message.result = object.result ?? 0; return message; }, fromAmino(object: MsgTimeoutResponseAmino): MsgTimeoutResponse { - return { - result: isSet(object.result) ? responseResultTypeFromJSON(object.result) : -1 - }; + const message = createBaseMsgTimeoutResponse(); + if (object.result !== undefined && object.result !== null) { + message.result = responseResultTypeFromJSON(object.result); + } + return message; }, toAmino(message: MsgTimeoutResponse): MsgTimeoutResponseAmino { const obj: any = {}; - obj.result = message.result; + obj.result = responseResultTypeToJSON(message.result); return obj; }, fromAminoMsg(object: MsgTimeoutResponseAminoMsg): MsgTimeoutResponse { @@ -1982,6 +3002,8 @@ export const MsgTimeoutResponse = { }; } }; +GlobalDecoderRegistry.register(MsgTimeoutResponse.typeUrl, MsgTimeoutResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgTimeoutResponse.aminoType, MsgTimeoutResponse.typeUrl); function createBaseMsgTimeoutOnClose(): MsgTimeoutOnClose { return { packet: Packet.fromPartial({}), @@ -1989,11 +3011,22 @@ function createBaseMsgTimeoutOnClose(): MsgTimeoutOnClose { proofClose: new Uint8Array(), proofHeight: Height.fromPartial({}), nextSequenceRecv: BigInt(0), - signer: "" + signer: "", + counterpartyUpgradeSequence: BigInt(0) }; } export const MsgTimeoutOnClose = { typeUrl: "/ibc.core.channel.v1.MsgTimeoutOnClose", + aminoType: "cosmos-sdk/MsgTimeoutOnClose", + is(o: any): o is MsgTimeoutOnClose { + return o && (o.$typeUrl === MsgTimeoutOnClose.typeUrl || Packet.is(o.packet) && (o.proofUnreceived instanceof Uint8Array || typeof o.proofUnreceived === "string") && (o.proofClose instanceof Uint8Array || typeof o.proofClose === "string") && Height.is(o.proofHeight) && typeof o.nextSequenceRecv === "bigint" && typeof o.signer === "string" && typeof o.counterpartyUpgradeSequence === "bigint"); + }, + isSDK(o: any): o is MsgTimeoutOnCloseSDKType { + return o && (o.$typeUrl === MsgTimeoutOnClose.typeUrl || Packet.isSDK(o.packet) && (o.proof_unreceived instanceof Uint8Array || typeof o.proof_unreceived === "string") && (o.proof_close instanceof Uint8Array || typeof o.proof_close === "string") && Height.isSDK(o.proof_height) && typeof o.next_sequence_recv === "bigint" && typeof o.signer === "string" && typeof o.counterparty_upgrade_sequence === "bigint"); + }, + isAmino(o: any): o is MsgTimeoutOnCloseAmino { + return o && (o.$typeUrl === MsgTimeoutOnClose.typeUrl || Packet.isAmino(o.packet) && (o.proof_unreceived instanceof Uint8Array || typeof o.proof_unreceived === "string") && (o.proof_close instanceof Uint8Array || typeof o.proof_close === "string") && Height.isAmino(o.proof_height) && typeof o.next_sequence_recv === "bigint" && typeof o.signer === "string" && typeof o.counterparty_upgrade_sequence === "bigint"); + }, encode(message: MsgTimeoutOnClose, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.packet !== undefined) { Packet.encode(message.packet, writer.uint32(10).fork()).ldelim(); @@ -2013,6 +3046,9 @@ export const MsgTimeoutOnClose = { if (message.signer !== "") { writer.uint32(50).string(message.signer); } + if (message.counterpartyUpgradeSequence !== BigInt(0)) { + writer.uint32(56).uint64(message.counterpartyUpgradeSequence); + } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): MsgTimeoutOnClose { @@ -2040,6 +3076,9 @@ export const MsgTimeoutOnClose = { case 6: message.signer = reader.string(); break; + case 7: + message.counterpartyUpgradeSequence = reader.uint64(); + break; default: reader.skipType(tag & 7); break; @@ -2047,6 +3086,28 @@ export const MsgTimeoutOnClose = { } return message; }, + fromJSON(object: any): MsgTimeoutOnClose { + return { + packet: isSet(object.packet) ? Packet.fromJSON(object.packet) : undefined, + proofUnreceived: isSet(object.proofUnreceived) ? bytesFromBase64(object.proofUnreceived) : new Uint8Array(), + proofClose: isSet(object.proofClose) ? bytesFromBase64(object.proofClose) : new Uint8Array(), + proofHeight: isSet(object.proofHeight) ? Height.fromJSON(object.proofHeight) : undefined, + nextSequenceRecv: isSet(object.nextSequenceRecv) ? BigInt(object.nextSequenceRecv.toString()) : BigInt(0), + signer: isSet(object.signer) ? String(object.signer) : "", + counterpartyUpgradeSequence: isSet(object.counterpartyUpgradeSequence) ? BigInt(object.counterpartyUpgradeSequence.toString()) : BigInt(0) + }; + }, + toJSON(message: MsgTimeoutOnClose): unknown { + const obj: any = {}; + message.packet !== undefined && (obj.packet = message.packet ? Packet.toJSON(message.packet) : undefined); + message.proofUnreceived !== undefined && (obj.proofUnreceived = base64FromBytes(message.proofUnreceived !== undefined ? message.proofUnreceived : new Uint8Array())); + message.proofClose !== undefined && (obj.proofClose = base64FromBytes(message.proofClose !== undefined ? message.proofClose : new Uint8Array())); + message.proofHeight !== undefined && (obj.proofHeight = message.proofHeight ? Height.toJSON(message.proofHeight) : undefined); + message.nextSequenceRecv !== undefined && (obj.nextSequenceRecv = (message.nextSequenceRecv || BigInt(0)).toString()); + message.signer !== undefined && (obj.signer = message.signer); + message.counterpartyUpgradeSequence !== undefined && (obj.counterpartyUpgradeSequence = (message.counterpartyUpgradeSequence || BigInt(0)).toString()); + return obj; + }, fromPartial(object: Partial): MsgTimeoutOnClose { const message = createBaseMsgTimeoutOnClose(); message.packet = object.packet !== undefined && object.packet !== null ? Packet.fromPartial(object.packet) : undefined; @@ -2055,26 +3116,43 @@ export const MsgTimeoutOnClose = { message.proofHeight = object.proofHeight !== undefined && object.proofHeight !== null ? Height.fromPartial(object.proofHeight) : undefined; message.nextSequenceRecv = object.nextSequenceRecv !== undefined && object.nextSequenceRecv !== null ? BigInt(object.nextSequenceRecv.toString()) : BigInt(0); message.signer = object.signer ?? ""; + message.counterpartyUpgradeSequence = object.counterpartyUpgradeSequence !== undefined && object.counterpartyUpgradeSequence !== null ? BigInt(object.counterpartyUpgradeSequence.toString()) : BigInt(0); return message; }, fromAmino(object: MsgTimeoutOnCloseAmino): MsgTimeoutOnClose { - return { - packet: object?.packet ? Packet.fromAmino(object.packet) : undefined, - proofUnreceived: object.proof_unreceived, - proofClose: object.proof_close, - proofHeight: object?.proof_height ? Height.fromAmino(object.proof_height) : undefined, - nextSequenceRecv: BigInt(object.next_sequence_recv), - signer: object.signer - }; + const message = createBaseMsgTimeoutOnClose(); + if (object.packet !== undefined && object.packet !== null) { + message.packet = Packet.fromAmino(object.packet); + } + if (object.proof_unreceived !== undefined && object.proof_unreceived !== null) { + message.proofUnreceived = bytesFromBase64(object.proof_unreceived); + } + if (object.proof_close !== undefined && object.proof_close !== null) { + message.proofClose = bytesFromBase64(object.proof_close); + } + if (object.proof_height !== undefined && object.proof_height !== null) { + message.proofHeight = Height.fromAmino(object.proof_height); + } + if (object.next_sequence_recv !== undefined && object.next_sequence_recv !== null) { + message.nextSequenceRecv = BigInt(object.next_sequence_recv); + } + if (object.signer !== undefined && object.signer !== null) { + message.signer = object.signer; + } + if (object.counterparty_upgrade_sequence !== undefined && object.counterparty_upgrade_sequence !== null) { + message.counterpartyUpgradeSequence = BigInt(object.counterparty_upgrade_sequence); + } + return message; }, toAmino(message: MsgTimeoutOnClose): MsgTimeoutOnCloseAmino { const obj: any = {}; obj.packet = message.packet ? Packet.toAmino(message.packet) : undefined; - obj.proof_unreceived = message.proofUnreceived; - obj.proof_close = message.proofClose; + obj.proof_unreceived = message.proofUnreceived ? base64FromBytes(message.proofUnreceived) : undefined; + obj.proof_close = message.proofClose ? base64FromBytes(message.proofClose) : undefined; obj.proof_height = message.proofHeight ? Height.toAmino(message.proofHeight) : {}; obj.next_sequence_recv = message.nextSequenceRecv ? message.nextSequenceRecv.toString() : undefined; obj.signer = message.signer; + obj.counterparty_upgrade_sequence = message.counterpartyUpgradeSequence ? message.counterpartyUpgradeSequence.toString() : undefined; return obj; }, fromAminoMsg(object: MsgTimeoutOnCloseAminoMsg): MsgTimeoutOnClose { @@ -2099,6 +3177,8 @@ export const MsgTimeoutOnClose = { }; } }; +GlobalDecoderRegistry.register(MsgTimeoutOnClose.typeUrl, MsgTimeoutOnClose); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgTimeoutOnClose.aminoType, MsgTimeoutOnClose.typeUrl); function createBaseMsgTimeoutOnCloseResponse(): MsgTimeoutOnCloseResponse { return { result: 0 @@ -2106,6 +3186,16 @@ function createBaseMsgTimeoutOnCloseResponse(): MsgTimeoutOnCloseResponse { } export const MsgTimeoutOnCloseResponse = { typeUrl: "/ibc.core.channel.v1.MsgTimeoutOnCloseResponse", + aminoType: "cosmos-sdk/MsgTimeoutOnCloseResponse", + is(o: any): o is MsgTimeoutOnCloseResponse { + return o && (o.$typeUrl === MsgTimeoutOnCloseResponse.typeUrl || isSet(o.result)); + }, + isSDK(o: any): o is MsgTimeoutOnCloseResponseSDKType { + return o && (o.$typeUrl === MsgTimeoutOnCloseResponse.typeUrl || isSet(o.result)); + }, + isAmino(o: any): o is MsgTimeoutOnCloseResponseAmino { + return o && (o.$typeUrl === MsgTimeoutOnCloseResponse.typeUrl || isSet(o.result)); + }, encode(message: MsgTimeoutOnCloseResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.result !== 0) { writer.uint32(8).int32(message.result); @@ -2129,19 +3219,31 @@ export const MsgTimeoutOnCloseResponse = { } return message; }, + fromJSON(object: any): MsgTimeoutOnCloseResponse { + return { + result: isSet(object.result) ? responseResultTypeFromJSON(object.result) : -1 + }; + }, + toJSON(message: MsgTimeoutOnCloseResponse): unknown { + const obj: any = {}; + message.result !== undefined && (obj.result = responseResultTypeToJSON(message.result)); + return obj; + }, fromPartial(object: Partial): MsgTimeoutOnCloseResponse { const message = createBaseMsgTimeoutOnCloseResponse(); message.result = object.result ?? 0; return message; }, fromAmino(object: MsgTimeoutOnCloseResponseAmino): MsgTimeoutOnCloseResponse { - return { - result: isSet(object.result) ? responseResultTypeFromJSON(object.result) : -1 - }; + const message = createBaseMsgTimeoutOnCloseResponse(); + if (object.result !== undefined && object.result !== null) { + message.result = responseResultTypeFromJSON(object.result); + } + return message; }, toAmino(message: MsgTimeoutOnCloseResponse): MsgTimeoutOnCloseResponseAmino { const obj: any = {}; - obj.result = message.result; + obj.result = responseResultTypeToJSON(message.result); return obj; }, fromAminoMsg(object: MsgTimeoutOnCloseResponseAminoMsg): MsgTimeoutOnCloseResponse { @@ -2166,6 +3268,8 @@ export const MsgTimeoutOnCloseResponse = { }; } }; +GlobalDecoderRegistry.register(MsgTimeoutOnCloseResponse.typeUrl, MsgTimeoutOnCloseResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgTimeoutOnCloseResponse.aminoType, MsgTimeoutOnCloseResponse.typeUrl); function createBaseMsgAcknowledgement(): MsgAcknowledgement { return { packet: Packet.fromPartial({}), @@ -2177,6 +3281,16 @@ function createBaseMsgAcknowledgement(): MsgAcknowledgement { } export const MsgAcknowledgement = { typeUrl: "/ibc.core.channel.v1.MsgAcknowledgement", + aminoType: "cosmos-sdk/MsgAcknowledgement", + is(o: any): o is MsgAcknowledgement { + return o && (o.$typeUrl === MsgAcknowledgement.typeUrl || Packet.is(o.packet) && (o.acknowledgement instanceof Uint8Array || typeof o.acknowledgement === "string") && (o.proofAcked instanceof Uint8Array || typeof o.proofAcked === "string") && Height.is(o.proofHeight) && typeof o.signer === "string"); + }, + isSDK(o: any): o is MsgAcknowledgementSDKType { + return o && (o.$typeUrl === MsgAcknowledgement.typeUrl || Packet.isSDK(o.packet) && (o.acknowledgement instanceof Uint8Array || typeof o.acknowledgement === "string") && (o.proof_acked instanceof Uint8Array || typeof o.proof_acked === "string") && Height.isSDK(o.proof_height) && typeof o.signer === "string"); + }, + isAmino(o: any): o is MsgAcknowledgementAmino { + return o && (o.$typeUrl === MsgAcknowledgement.typeUrl || Packet.isAmino(o.packet) && (o.acknowledgement instanceof Uint8Array || typeof o.acknowledgement === "string") && (o.proof_acked instanceof Uint8Array || typeof o.proof_acked === "string") && Height.isAmino(o.proof_height) && typeof o.signer === "string"); + }, encode(message: MsgAcknowledgement, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.packet !== undefined) { Packet.encode(message.packet, writer.uint32(10).fork()).ldelim(); @@ -2224,6 +3338,24 @@ export const MsgAcknowledgement = { } return message; }, + fromJSON(object: any): MsgAcknowledgement { + return { + packet: isSet(object.packet) ? Packet.fromJSON(object.packet) : undefined, + acknowledgement: isSet(object.acknowledgement) ? bytesFromBase64(object.acknowledgement) : new Uint8Array(), + proofAcked: isSet(object.proofAcked) ? bytesFromBase64(object.proofAcked) : new Uint8Array(), + proofHeight: isSet(object.proofHeight) ? Height.fromJSON(object.proofHeight) : undefined, + signer: isSet(object.signer) ? String(object.signer) : "" + }; + }, + toJSON(message: MsgAcknowledgement): unknown { + const obj: any = {}; + message.packet !== undefined && (obj.packet = message.packet ? Packet.toJSON(message.packet) : undefined); + message.acknowledgement !== undefined && (obj.acknowledgement = base64FromBytes(message.acknowledgement !== undefined ? message.acknowledgement : new Uint8Array())); + message.proofAcked !== undefined && (obj.proofAcked = base64FromBytes(message.proofAcked !== undefined ? message.proofAcked : new Uint8Array())); + message.proofHeight !== undefined && (obj.proofHeight = message.proofHeight ? Height.toJSON(message.proofHeight) : undefined); + message.signer !== undefined && (obj.signer = message.signer); + return obj; + }, fromPartial(object: Partial): MsgAcknowledgement { const message = createBaseMsgAcknowledgement(); message.packet = object.packet !== undefined && object.packet !== null ? Packet.fromPartial(object.packet) : undefined; @@ -2234,19 +3366,29 @@ export const MsgAcknowledgement = { return message; }, fromAmino(object: MsgAcknowledgementAmino): MsgAcknowledgement { - return { - packet: object?.packet ? Packet.fromAmino(object.packet) : undefined, - acknowledgement: object.acknowledgement, - proofAcked: object.proof_acked, - proofHeight: object?.proof_height ? Height.fromAmino(object.proof_height) : undefined, - signer: object.signer - }; + const message = createBaseMsgAcknowledgement(); + if (object.packet !== undefined && object.packet !== null) { + message.packet = Packet.fromAmino(object.packet); + } + if (object.acknowledgement !== undefined && object.acknowledgement !== null) { + message.acknowledgement = bytesFromBase64(object.acknowledgement); + } + if (object.proof_acked !== undefined && object.proof_acked !== null) { + message.proofAcked = bytesFromBase64(object.proof_acked); + } + if (object.proof_height !== undefined && object.proof_height !== null) { + message.proofHeight = Height.fromAmino(object.proof_height); + } + if (object.signer !== undefined && object.signer !== null) { + message.signer = object.signer; + } + return message; }, toAmino(message: MsgAcknowledgement): MsgAcknowledgementAmino { const obj: any = {}; obj.packet = message.packet ? Packet.toAmino(message.packet) : undefined; - obj.acknowledgement = message.acknowledgement; - obj.proof_acked = message.proofAcked; + obj.acknowledgement = message.acknowledgement ? base64FromBytes(message.acknowledgement) : undefined; + obj.proof_acked = message.proofAcked ? base64FromBytes(message.proofAcked) : undefined; obj.proof_height = message.proofHeight ? Height.toAmino(message.proofHeight) : {}; obj.signer = message.signer; return obj; @@ -2273,6 +3415,8 @@ export const MsgAcknowledgement = { }; } }; +GlobalDecoderRegistry.register(MsgAcknowledgement.typeUrl, MsgAcknowledgement); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgAcknowledgement.aminoType, MsgAcknowledgement.typeUrl); function createBaseMsgAcknowledgementResponse(): MsgAcknowledgementResponse { return { result: 0 @@ -2280,6 +3424,16 @@ function createBaseMsgAcknowledgementResponse(): MsgAcknowledgementResponse { } export const MsgAcknowledgementResponse = { typeUrl: "/ibc.core.channel.v1.MsgAcknowledgementResponse", + aminoType: "cosmos-sdk/MsgAcknowledgementResponse", + is(o: any): o is MsgAcknowledgementResponse { + return o && (o.$typeUrl === MsgAcknowledgementResponse.typeUrl || isSet(o.result)); + }, + isSDK(o: any): o is MsgAcknowledgementResponseSDKType { + return o && (o.$typeUrl === MsgAcknowledgementResponse.typeUrl || isSet(o.result)); + }, + isAmino(o: any): o is MsgAcknowledgementResponseAmino { + return o && (o.$typeUrl === MsgAcknowledgementResponse.typeUrl || isSet(o.result)); + }, encode(message: MsgAcknowledgementResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.result !== 0) { writer.uint32(8).int32(message.result); @@ -2303,19 +3457,31 @@ export const MsgAcknowledgementResponse = { } return message; }, + fromJSON(object: any): MsgAcknowledgementResponse { + return { + result: isSet(object.result) ? responseResultTypeFromJSON(object.result) : -1 + }; + }, + toJSON(message: MsgAcknowledgementResponse): unknown { + const obj: any = {}; + message.result !== undefined && (obj.result = responseResultTypeToJSON(message.result)); + return obj; + }, fromPartial(object: Partial): MsgAcknowledgementResponse { const message = createBaseMsgAcknowledgementResponse(); message.result = object.result ?? 0; return message; }, fromAmino(object: MsgAcknowledgementResponseAmino): MsgAcknowledgementResponse { - return { - result: isSet(object.result) ? responseResultTypeFromJSON(object.result) : -1 - }; + const message = createBaseMsgAcknowledgementResponse(); + if (object.result !== undefined && object.result !== null) { + message.result = responseResultTypeFromJSON(object.result); + } + return message; }, toAmino(message: MsgAcknowledgementResponse): MsgAcknowledgementResponseAmino { const obj: any = {}; - obj.result = message.result; + obj.result = responseResultTypeToJSON(message.result); return obj; }, fromAminoMsg(object: MsgAcknowledgementResponseAminoMsg): MsgAcknowledgementResponse { @@ -2339,4 +3505,2244 @@ export const MsgAcknowledgementResponse = { value: MsgAcknowledgementResponse.encode(message).finish() }; } -}; \ No newline at end of file +}; +GlobalDecoderRegistry.register(MsgAcknowledgementResponse.typeUrl, MsgAcknowledgementResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgAcknowledgementResponse.aminoType, MsgAcknowledgementResponse.typeUrl); +function createBaseMsgChannelUpgradeInit(): MsgChannelUpgradeInit { + return { + portId: "", + channelId: "", + fields: UpgradeFields.fromPartial({}), + signer: "" + }; +} +export const MsgChannelUpgradeInit = { + typeUrl: "/ibc.core.channel.v1.MsgChannelUpgradeInit", + aminoType: "cosmos-sdk/MsgChannelUpgradeInit", + is(o: any): o is MsgChannelUpgradeInit { + return o && (o.$typeUrl === MsgChannelUpgradeInit.typeUrl || typeof o.portId === "string" && typeof o.channelId === "string" && UpgradeFields.is(o.fields) && typeof o.signer === "string"); + }, + isSDK(o: any): o is MsgChannelUpgradeInitSDKType { + return o && (o.$typeUrl === MsgChannelUpgradeInit.typeUrl || typeof o.port_id === "string" && typeof o.channel_id === "string" && UpgradeFields.isSDK(o.fields) && typeof o.signer === "string"); + }, + isAmino(o: any): o is MsgChannelUpgradeInitAmino { + return o && (o.$typeUrl === MsgChannelUpgradeInit.typeUrl || typeof o.port_id === "string" && typeof o.channel_id === "string" && UpgradeFields.isAmino(o.fields) && typeof o.signer === "string"); + }, + encode(message: MsgChannelUpgradeInit, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.portId !== "") { + writer.uint32(10).string(message.portId); + } + if (message.channelId !== "") { + writer.uint32(18).string(message.channelId); + } + if (message.fields !== undefined) { + UpgradeFields.encode(message.fields, writer.uint32(26).fork()).ldelim(); + } + if (message.signer !== "") { + writer.uint32(34).string(message.signer); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgChannelUpgradeInit { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgChannelUpgradeInit(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.portId = reader.string(); + break; + case 2: + message.channelId = reader.string(); + break; + case 3: + message.fields = UpgradeFields.decode(reader, reader.uint32()); + break; + case 4: + message.signer = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): MsgChannelUpgradeInit { + return { + portId: isSet(object.portId) ? String(object.portId) : "", + channelId: isSet(object.channelId) ? String(object.channelId) : "", + fields: isSet(object.fields) ? UpgradeFields.fromJSON(object.fields) : undefined, + signer: isSet(object.signer) ? String(object.signer) : "" + }; + }, + toJSON(message: MsgChannelUpgradeInit): unknown { + const obj: any = {}; + message.portId !== undefined && (obj.portId = message.portId); + message.channelId !== undefined && (obj.channelId = message.channelId); + message.fields !== undefined && (obj.fields = message.fields ? UpgradeFields.toJSON(message.fields) : undefined); + message.signer !== undefined && (obj.signer = message.signer); + return obj; + }, + fromPartial(object: Partial): MsgChannelUpgradeInit { + const message = createBaseMsgChannelUpgradeInit(); + message.portId = object.portId ?? ""; + message.channelId = object.channelId ?? ""; + message.fields = object.fields !== undefined && object.fields !== null ? UpgradeFields.fromPartial(object.fields) : undefined; + message.signer = object.signer ?? ""; + return message; + }, + fromAmino(object: MsgChannelUpgradeInitAmino): MsgChannelUpgradeInit { + const message = createBaseMsgChannelUpgradeInit(); + if (object.port_id !== undefined && object.port_id !== null) { + message.portId = object.port_id; + } + if (object.channel_id !== undefined && object.channel_id !== null) { + message.channelId = object.channel_id; + } + if (object.fields !== undefined && object.fields !== null) { + message.fields = UpgradeFields.fromAmino(object.fields); + } + if (object.signer !== undefined && object.signer !== null) { + message.signer = object.signer; + } + return message; + }, + toAmino(message: MsgChannelUpgradeInit): MsgChannelUpgradeInitAmino { + const obj: any = {}; + obj.port_id = message.portId; + obj.channel_id = message.channelId; + obj.fields = message.fields ? UpgradeFields.toAmino(message.fields) : undefined; + obj.signer = message.signer; + return obj; + }, + fromAminoMsg(object: MsgChannelUpgradeInitAminoMsg): MsgChannelUpgradeInit { + return MsgChannelUpgradeInit.fromAmino(object.value); + }, + toAminoMsg(message: MsgChannelUpgradeInit): MsgChannelUpgradeInitAminoMsg { + return { + type: "cosmos-sdk/MsgChannelUpgradeInit", + value: MsgChannelUpgradeInit.toAmino(message) + }; + }, + fromProtoMsg(message: MsgChannelUpgradeInitProtoMsg): MsgChannelUpgradeInit { + return MsgChannelUpgradeInit.decode(message.value); + }, + toProto(message: MsgChannelUpgradeInit): Uint8Array { + return MsgChannelUpgradeInit.encode(message).finish(); + }, + toProtoMsg(message: MsgChannelUpgradeInit): MsgChannelUpgradeInitProtoMsg { + return { + typeUrl: "/ibc.core.channel.v1.MsgChannelUpgradeInit", + value: MsgChannelUpgradeInit.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgChannelUpgradeInit.typeUrl, MsgChannelUpgradeInit); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgChannelUpgradeInit.aminoType, MsgChannelUpgradeInit.typeUrl); +function createBaseMsgChannelUpgradeInitResponse(): MsgChannelUpgradeInitResponse { + return { + upgrade: Upgrade.fromPartial({}), + upgradeSequence: BigInt(0) + }; +} +export const MsgChannelUpgradeInitResponse = { + typeUrl: "/ibc.core.channel.v1.MsgChannelUpgradeInitResponse", + aminoType: "cosmos-sdk/MsgChannelUpgradeInitResponse", + is(o: any): o is MsgChannelUpgradeInitResponse { + return o && (o.$typeUrl === MsgChannelUpgradeInitResponse.typeUrl || Upgrade.is(o.upgrade) && typeof o.upgradeSequence === "bigint"); + }, + isSDK(o: any): o is MsgChannelUpgradeInitResponseSDKType { + return o && (o.$typeUrl === MsgChannelUpgradeInitResponse.typeUrl || Upgrade.isSDK(o.upgrade) && typeof o.upgrade_sequence === "bigint"); + }, + isAmino(o: any): o is MsgChannelUpgradeInitResponseAmino { + return o && (o.$typeUrl === MsgChannelUpgradeInitResponse.typeUrl || Upgrade.isAmino(o.upgrade) && typeof o.upgrade_sequence === "bigint"); + }, + encode(message: MsgChannelUpgradeInitResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.upgrade !== undefined) { + Upgrade.encode(message.upgrade, writer.uint32(10).fork()).ldelim(); + } + if (message.upgradeSequence !== BigInt(0)) { + writer.uint32(16).uint64(message.upgradeSequence); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgChannelUpgradeInitResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgChannelUpgradeInitResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.upgrade = Upgrade.decode(reader, reader.uint32()); + break; + case 2: + message.upgradeSequence = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): MsgChannelUpgradeInitResponse { + return { + upgrade: isSet(object.upgrade) ? Upgrade.fromJSON(object.upgrade) : undefined, + upgradeSequence: isSet(object.upgradeSequence) ? BigInt(object.upgradeSequence.toString()) : BigInt(0) + }; + }, + toJSON(message: MsgChannelUpgradeInitResponse): unknown { + const obj: any = {}; + message.upgrade !== undefined && (obj.upgrade = message.upgrade ? Upgrade.toJSON(message.upgrade) : undefined); + message.upgradeSequence !== undefined && (obj.upgradeSequence = (message.upgradeSequence || BigInt(0)).toString()); + return obj; + }, + fromPartial(object: Partial): MsgChannelUpgradeInitResponse { + const message = createBaseMsgChannelUpgradeInitResponse(); + message.upgrade = object.upgrade !== undefined && object.upgrade !== null ? Upgrade.fromPartial(object.upgrade) : undefined; + message.upgradeSequence = object.upgradeSequence !== undefined && object.upgradeSequence !== null ? BigInt(object.upgradeSequence.toString()) : BigInt(0); + return message; + }, + fromAmino(object: MsgChannelUpgradeInitResponseAmino): MsgChannelUpgradeInitResponse { + const message = createBaseMsgChannelUpgradeInitResponse(); + if (object.upgrade !== undefined && object.upgrade !== null) { + message.upgrade = Upgrade.fromAmino(object.upgrade); + } + if (object.upgrade_sequence !== undefined && object.upgrade_sequence !== null) { + message.upgradeSequence = BigInt(object.upgrade_sequence); + } + return message; + }, + toAmino(message: MsgChannelUpgradeInitResponse): MsgChannelUpgradeInitResponseAmino { + const obj: any = {}; + obj.upgrade = message.upgrade ? Upgrade.toAmino(message.upgrade) : undefined; + obj.upgrade_sequence = message.upgradeSequence ? message.upgradeSequence.toString() : undefined; + return obj; + }, + fromAminoMsg(object: MsgChannelUpgradeInitResponseAminoMsg): MsgChannelUpgradeInitResponse { + return MsgChannelUpgradeInitResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgChannelUpgradeInitResponse): MsgChannelUpgradeInitResponseAminoMsg { + return { + type: "cosmos-sdk/MsgChannelUpgradeInitResponse", + value: MsgChannelUpgradeInitResponse.toAmino(message) + }; + }, + fromProtoMsg(message: MsgChannelUpgradeInitResponseProtoMsg): MsgChannelUpgradeInitResponse { + return MsgChannelUpgradeInitResponse.decode(message.value); + }, + toProto(message: MsgChannelUpgradeInitResponse): Uint8Array { + return MsgChannelUpgradeInitResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgChannelUpgradeInitResponse): MsgChannelUpgradeInitResponseProtoMsg { + return { + typeUrl: "/ibc.core.channel.v1.MsgChannelUpgradeInitResponse", + value: MsgChannelUpgradeInitResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgChannelUpgradeInitResponse.typeUrl, MsgChannelUpgradeInitResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgChannelUpgradeInitResponse.aminoType, MsgChannelUpgradeInitResponse.typeUrl); +function createBaseMsgChannelUpgradeTry(): MsgChannelUpgradeTry { + return { + portId: "", + channelId: "", + proposedUpgradeConnectionHops: [], + counterpartyUpgradeFields: UpgradeFields.fromPartial({}), + counterpartyUpgradeSequence: BigInt(0), + proofChannel: new Uint8Array(), + proofUpgrade: new Uint8Array(), + proofHeight: Height.fromPartial({}), + signer: "" + }; +} +export const MsgChannelUpgradeTry = { + typeUrl: "/ibc.core.channel.v1.MsgChannelUpgradeTry", + aminoType: "cosmos-sdk/MsgChannelUpgradeTry", + is(o: any): o is MsgChannelUpgradeTry { + return o && (o.$typeUrl === MsgChannelUpgradeTry.typeUrl || typeof o.portId === "string" && typeof o.channelId === "string" && Array.isArray(o.proposedUpgradeConnectionHops) && (!o.proposedUpgradeConnectionHops.length || typeof o.proposedUpgradeConnectionHops[0] === "string") && UpgradeFields.is(o.counterpartyUpgradeFields) && typeof o.counterpartyUpgradeSequence === "bigint" && (o.proofChannel instanceof Uint8Array || typeof o.proofChannel === "string") && (o.proofUpgrade instanceof Uint8Array || typeof o.proofUpgrade === "string") && Height.is(o.proofHeight) && typeof o.signer === "string"); + }, + isSDK(o: any): o is MsgChannelUpgradeTrySDKType { + return o && (o.$typeUrl === MsgChannelUpgradeTry.typeUrl || typeof o.port_id === "string" && typeof o.channel_id === "string" && Array.isArray(o.proposed_upgrade_connection_hops) && (!o.proposed_upgrade_connection_hops.length || typeof o.proposed_upgrade_connection_hops[0] === "string") && UpgradeFields.isSDK(o.counterparty_upgrade_fields) && typeof o.counterparty_upgrade_sequence === "bigint" && (o.proof_channel instanceof Uint8Array || typeof o.proof_channel === "string") && (o.proof_upgrade instanceof Uint8Array || typeof o.proof_upgrade === "string") && Height.isSDK(o.proof_height) && typeof o.signer === "string"); + }, + isAmino(o: any): o is MsgChannelUpgradeTryAmino { + return o && (o.$typeUrl === MsgChannelUpgradeTry.typeUrl || typeof o.port_id === "string" && typeof o.channel_id === "string" && Array.isArray(o.proposed_upgrade_connection_hops) && (!o.proposed_upgrade_connection_hops.length || typeof o.proposed_upgrade_connection_hops[0] === "string") && UpgradeFields.isAmino(o.counterparty_upgrade_fields) && typeof o.counterparty_upgrade_sequence === "bigint" && (o.proof_channel instanceof Uint8Array || typeof o.proof_channel === "string") && (o.proof_upgrade instanceof Uint8Array || typeof o.proof_upgrade === "string") && Height.isAmino(o.proof_height) && typeof o.signer === "string"); + }, + encode(message: MsgChannelUpgradeTry, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.portId !== "") { + writer.uint32(10).string(message.portId); + } + if (message.channelId !== "") { + writer.uint32(18).string(message.channelId); + } + for (const v of message.proposedUpgradeConnectionHops) { + writer.uint32(26).string(v!); + } + if (message.counterpartyUpgradeFields !== undefined) { + UpgradeFields.encode(message.counterpartyUpgradeFields, writer.uint32(34).fork()).ldelim(); + } + if (message.counterpartyUpgradeSequence !== BigInt(0)) { + writer.uint32(40).uint64(message.counterpartyUpgradeSequence); + } + if (message.proofChannel.length !== 0) { + writer.uint32(50).bytes(message.proofChannel); + } + if (message.proofUpgrade.length !== 0) { + writer.uint32(58).bytes(message.proofUpgrade); + } + if (message.proofHeight !== undefined) { + Height.encode(message.proofHeight, writer.uint32(66).fork()).ldelim(); + } + if (message.signer !== "") { + writer.uint32(74).string(message.signer); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgChannelUpgradeTry { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgChannelUpgradeTry(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.portId = reader.string(); + break; + case 2: + message.channelId = reader.string(); + break; + case 3: + message.proposedUpgradeConnectionHops.push(reader.string()); + break; + case 4: + message.counterpartyUpgradeFields = UpgradeFields.decode(reader, reader.uint32()); + break; + case 5: + message.counterpartyUpgradeSequence = reader.uint64(); + break; + case 6: + message.proofChannel = reader.bytes(); + break; + case 7: + message.proofUpgrade = reader.bytes(); + break; + case 8: + message.proofHeight = Height.decode(reader, reader.uint32()); + break; + case 9: + message.signer = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): MsgChannelUpgradeTry { + return { + portId: isSet(object.portId) ? String(object.portId) : "", + channelId: isSet(object.channelId) ? String(object.channelId) : "", + proposedUpgradeConnectionHops: Array.isArray(object?.proposedUpgradeConnectionHops) ? object.proposedUpgradeConnectionHops.map((e: any) => String(e)) : [], + counterpartyUpgradeFields: isSet(object.counterpartyUpgradeFields) ? UpgradeFields.fromJSON(object.counterpartyUpgradeFields) : undefined, + counterpartyUpgradeSequence: isSet(object.counterpartyUpgradeSequence) ? BigInt(object.counterpartyUpgradeSequence.toString()) : BigInt(0), + proofChannel: isSet(object.proofChannel) ? bytesFromBase64(object.proofChannel) : new Uint8Array(), + proofUpgrade: isSet(object.proofUpgrade) ? bytesFromBase64(object.proofUpgrade) : new Uint8Array(), + proofHeight: isSet(object.proofHeight) ? Height.fromJSON(object.proofHeight) : undefined, + signer: isSet(object.signer) ? String(object.signer) : "" + }; + }, + toJSON(message: MsgChannelUpgradeTry): unknown { + const obj: any = {}; + message.portId !== undefined && (obj.portId = message.portId); + message.channelId !== undefined && (obj.channelId = message.channelId); + if (message.proposedUpgradeConnectionHops) { + obj.proposedUpgradeConnectionHops = message.proposedUpgradeConnectionHops.map(e => e); + } else { + obj.proposedUpgradeConnectionHops = []; + } + message.counterpartyUpgradeFields !== undefined && (obj.counterpartyUpgradeFields = message.counterpartyUpgradeFields ? UpgradeFields.toJSON(message.counterpartyUpgradeFields) : undefined); + message.counterpartyUpgradeSequence !== undefined && (obj.counterpartyUpgradeSequence = (message.counterpartyUpgradeSequence || BigInt(0)).toString()); + message.proofChannel !== undefined && (obj.proofChannel = base64FromBytes(message.proofChannel !== undefined ? message.proofChannel : new Uint8Array())); + message.proofUpgrade !== undefined && (obj.proofUpgrade = base64FromBytes(message.proofUpgrade !== undefined ? message.proofUpgrade : new Uint8Array())); + message.proofHeight !== undefined && (obj.proofHeight = message.proofHeight ? Height.toJSON(message.proofHeight) : undefined); + message.signer !== undefined && (obj.signer = message.signer); + return obj; + }, + fromPartial(object: Partial): MsgChannelUpgradeTry { + const message = createBaseMsgChannelUpgradeTry(); + message.portId = object.portId ?? ""; + message.channelId = object.channelId ?? ""; + message.proposedUpgradeConnectionHops = object.proposedUpgradeConnectionHops?.map(e => e) || []; + message.counterpartyUpgradeFields = object.counterpartyUpgradeFields !== undefined && object.counterpartyUpgradeFields !== null ? UpgradeFields.fromPartial(object.counterpartyUpgradeFields) : undefined; + message.counterpartyUpgradeSequence = object.counterpartyUpgradeSequence !== undefined && object.counterpartyUpgradeSequence !== null ? BigInt(object.counterpartyUpgradeSequence.toString()) : BigInt(0); + message.proofChannel = object.proofChannel ?? new Uint8Array(); + message.proofUpgrade = object.proofUpgrade ?? new Uint8Array(); + message.proofHeight = object.proofHeight !== undefined && object.proofHeight !== null ? Height.fromPartial(object.proofHeight) : undefined; + message.signer = object.signer ?? ""; + return message; + }, + fromAmino(object: MsgChannelUpgradeTryAmino): MsgChannelUpgradeTry { + const message = createBaseMsgChannelUpgradeTry(); + if (object.port_id !== undefined && object.port_id !== null) { + message.portId = object.port_id; + } + if (object.channel_id !== undefined && object.channel_id !== null) { + message.channelId = object.channel_id; + } + message.proposedUpgradeConnectionHops = object.proposed_upgrade_connection_hops?.map(e => e) || []; + if (object.counterparty_upgrade_fields !== undefined && object.counterparty_upgrade_fields !== null) { + message.counterpartyUpgradeFields = UpgradeFields.fromAmino(object.counterparty_upgrade_fields); + } + if (object.counterparty_upgrade_sequence !== undefined && object.counterparty_upgrade_sequence !== null) { + message.counterpartyUpgradeSequence = BigInt(object.counterparty_upgrade_sequence); + } + if (object.proof_channel !== undefined && object.proof_channel !== null) { + message.proofChannel = bytesFromBase64(object.proof_channel); + } + if (object.proof_upgrade !== undefined && object.proof_upgrade !== null) { + message.proofUpgrade = bytesFromBase64(object.proof_upgrade); + } + if (object.proof_height !== undefined && object.proof_height !== null) { + message.proofHeight = Height.fromAmino(object.proof_height); + } + if (object.signer !== undefined && object.signer !== null) { + message.signer = object.signer; + } + return message; + }, + toAmino(message: MsgChannelUpgradeTry): MsgChannelUpgradeTryAmino { + const obj: any = {}; + obj.port_id = message.portId; + obj.channel_id = message.channelId; + if (message.proposedUpgradeConnectionHops) { + obj.proposed_upgrade_connection_hops = message.proposedUpgradeConnectionHops.map(e => e); + } else { + obj.proposed_upgrade_connection_hops = []; + } + obj.counterparty_upgrade_fields = message.counterpartyUpgradeFields ? UpgradeFields.toAmino(message.counterpartyUpgradeFields) : undefined; + obj.counterparty_upgrade_sequence = message.counterpartyUpgradeSequence ? message.counterpartyUpgradeSequence.toString() : undefined; + obj.proof_channel = message.proofChannel ? base64FromBytes(message.proofChannel) : undefined; + obj.proof_upgrade = message.proofUpgrade ? base64FromBytes(message.proofUpgrade) : undefined; + obj.proof_height = message.proofHeight ? Height.toAmino(message.proofHeight) : {}; + obj.signer = message.signer; + return obj; + }, + fromAminoMsg(object: MsgChannelUpgradeTryAminoMsg): MsgChannelUpgradeTry { + return MsgChannelUpgradeTry.fromAmino(object.value); + }, + toAminoMsg(message: MsgChannelUpgradeTry): MsgChannelUpgradeTryAminoMsg { + return { + type: "cosmos-sdk/MsgChannelUpgradeTry", + value: MsgChannelUpgradeTry.toAmino(message) + }; + }, + fromProtoMsg(message: MsgChannelUpgradeTryProtoMsg): MsgChannelUpgradeTry { + return MsgChannelUpgradeTry.decode(message.value); + }, + toProto(message: MsgChannelUpgradeTry): Uint8Array { + return MsgChannelUpgradeTry.encode(message).finish(); + }, + toProtoMsg(message: MsgChannelUpgradeTry): MsgChannelUpgradeTryProtoMsg { + return { + typeUrl: "/ibc.core.channel.v1.MsgChannelUpgradeTry", + value: MsgChannelUpgradeTry.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgChannelUpgradeTry.typeUrl, MsgChannelUpgradeTry); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgChannelUpgradeTry.aminoType, MsgChannelUpgradeTry.typeUrl); +function createBaseMsgChannelUpgradeTryResponse(): MsgChannelUpgradeTryResponse { + return { + upgrade: Upgrade.fromPartial({}), + upgradeSequence: BigInt(0), + result: 0 + }; +} +export const MsgChannelUpgradeTryResponse = { + typeUrl: "/ibc.core.channel.v1.MsgChannelUpgradeTryResponse", + aminoType: "cosmos-sdk/MsgChannelUpgradeTryResponse", + is(o: any): o is MsgChannelUpgradeTryResponse { + return o && (o.$typeUrl === MsgChannelUpgradeTryResponse.typeUrl || Upgrade.is(o.upgrade) && typeof o.upgradeSequence === "bigint" && isSet(o.result)); + }, + isSDK(o: any): o is MsgChannelUpgradeTryResponseSDKType { + return o && (o.$typeUrl === MsgChannelUpgradeTryResponse.typeUrl || Upgrade.isSDK(o.upgrade) && typeof o.upgrade_sequence === "bigint" && isSet(o.result)); + }, + isAmino(o: any): o is MsgChannelUpgradeTryResponseAmino { + return o && (o.$typeUrl === MsgChannelUpgradeTryResponse.typeUrl || Upgrade.isAmino(o.upgrade) && typeof o.upgrade_sequence === "bigint" && isSet(o.result)); + }, + encode(message: MsgChannelUpgradeTryResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.upgrade !== undefined) { + Upgrade.encode(message.upgrade, writer.uint32(10).fork()).ldelim(); + } + if (message.upgradeSequence !== BigInt(0)) { + writer.uint32(16).uint64(message.upgradeSequence); + } + if (message.result !== 0) { + writer.uint32(24).int32(message.result); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgChannelUpgradeTryResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgChannelUpgradeTryResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.upgrade = Upgrade.decode(reader, reader.uint32()); + break; + case 2: + message.upgradeSequence = reader.uint64(); + break; + case 3: + message.result = (reader.int32() as any); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): MsgChannelUpgradeTryResponse { + return { + upgrade: isSet(object.upgrade) ? Upgrade.fromJSON(object.upgrade) : undefined, + upgradeSequence: isSet(object.upgradeSequence) ? BigInt(object.upgradeSequence.toString()) : BigInt(0), + result: isSet(object.result) ? responseResultTypeFromJSON(object.result) : -1 + }; + }, + toJSON(message: MsgChannelUpgradeTryResponse): unknown { + const obj: any = {}; + message.upgrade !== undefined && (obj.upgrade = message.upgrade ? Upgrade.toJSON(message.upgrade) : undefined); + message.upgradeSequence !== undefined && (obj.upgradeSequence = (message.upgradeSequence || BigInt(0)).toString()); + message.result !== undefined && (obj.result = responseResultTypeToJSON(message.result)); + return obj; + }, + fromPartial(object: Partial): MsgChannelUpgradeTryResponse { + const message = createBaseMsgChannelUpgradeTryResponse(); + message.upgrade = object.upgrade !== undefined && object.upgrade !== null ? Upgrade.fromPartial(object.upgrade) : undefined; + message.upgradeSequence = object.upgradeSequence !== undefined && object.upgradeSequence !== null ? BigInt(object.upgradeSequence.toString()) : BigInt(0); + message.result = object.result ?? 0; + return message; + }, + fromAmino(object: MsgChannelUpgradeTryResponseAmino): MsgChannelUpgradeTryResponse { + const message = createBaseMsgChannelUpgradeTryResponse(); + if (object.upgrade !== undefined && object.upgrade !== null) { + message.upgrade = Upgrade.fromAmino(object.upgrade); + } + if (object.upgrade_sequence !== undefined && object.upgrade_sequence !== null) { + message.upgradeSequence = BigInt(object.upgrade_sequence); + } + if (object.result !== undefined && object.result !== null) { + message.result = responseResultTypeFromJSON(object.result); + } + return message; + }, + toAmino(message: MsgChannelUpgradeTryResponse): MsgChannelUpgradeTryResponseAmino { + const obj: any = {}; + obj.upgrade = message.upgrade ? Upgrade.toAmino(message.upgrade) : undefined; + obj.upgrade_sequence = message.upgradeSequence ? message.upgradeSequence.toString() : undefined; + obj.result = responseResultTypeToJSON(message.result); + return obj; + }, + fromAminoMsg(object: MsgChannelUpgradeTryResponseAminoMsg): MsgChannelUpgradeTryResponse { + return MsgChannelUpgradeTryResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgChannelUpgradeTryResponse): MsgChannelUpgradeTryResponseAminoMsg { + return { + type: "cosmos-sdk/MsgChannelUpgradeTryResponse", + value: MsgChannelUpgradeTryResponse.toAmino(message) + }; + }, + fromProtoMsg(message: MsgChannelUpgradeTryResponseProtoMsg): MsgChannelUpgradeTryResponse { + return MsgChannelUpgradeTryResponse.decode(message.value); + }, + toProto(message: MsgChannelUpgradeTryResponse): Uint8Array { + return MsgChannelUpgradeTryResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgChannelUpgradeTryResponse): MsgChannelUpgradeTryResponseProtoMsg { + return { + typeUrl: "/ibc.core.channel.v1.MsgChannelUpgradeTryResponse", + value: MsgChannelUpgradeTryResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgChannelUpgradeTryResponse.typeUrl, MsgChannelUpgradeTryResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgChannelUpgradeTryResponse.aminoType, MsgChannelUpgradeTryResponse.typeUrl); +function createBaseMsgChannelUpgradeAck(): MsgChannelUpgradeAck { + return { + portId: "", + channelId: "", + counterpartyUpgrade: Upgrade.fromPartial({}), + proofChannel: new Uint8Array(), + proofUpgrade: new Uint8Array(), + proofHeight: Height.fromPartial({}), + signer: "" + }; +} +export const MsgChannelUpgradeAck = { + typeUrl: "/ibc.core.channel.v1.MsgChannelUpgradeAck", + aminoType: "cosmos-sdk/MsgChannelUpgradeAck", + is(o: any): o is MsgChannelUpgradeAck { + return o && (o.$typeUrl === MsgChannelUpgradeAck.typeUrl || typeof o.portId === "string" && typeof o.channelId === "string" && Upgrade.is(o.counterpartyUpgrade) && (o.proofChannel instanceof Uint8Array || typeof o.proofChannel === "string") && (o.proofUpgrade instanceof Uint8Array || typeof o.proofUpgrade === "string") && Height.is(o.proofHeight) && typeof o.signer === "string"); + }, + isSDK(o: any): o is MsgChannelUpgradeAckSDKType { + return o && (o.$typeUrl === MsgChannelUpgradeAck.typeUrl || typeof o.port_id === "string" && typeof o.channel_id === "string" && Upgrade.isSDK(o.counterparty_upgrade) && (o.proof_channel instanceof Uint8Array || typeof o.proof_channel === "string") && (o.proof_upgrade instanceof Uint8Array || typeof o.proof_upgrade === "string") && Height.isSDK(o.proof_height) && typeof o.signer === "string"); + }, + isAmino(o: any): o is MsgChannelUpgradeAckAmino { + return o && (o.$typeUrl === MsgChannelUpgradeAck.typeUrl || typeof o.port_id === "string" && typeof o.channel_id === "string" && Upgrade.isAmino(o.counterparty_upgrade) && (o.proof_channel instanceof Uint8Array || typeof o.proof_channel === "string") && (o.proof_upgrade instanceof Uint8Array || typeof o.proof_upgrade === "string") && Height.isAmino(o.proof_height) && typeof o.signer === "string"); + }, + encode(message: MsgChannelUpgradeAck, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.portId !== "") { + writer.uint32(10).string(message.portId); + } + if (message.channelId !== "") { + writer.uint32(18).string(message.channelId); + } + if (message.counterpartyUpgrade !== undefined) { + Upgrade.encode(message.counterpartyUpgrade, writer.uint32(26).fork()).ldelim(); + } + if (message.proofChannel.length !== 0) { + writer.uint32(34).bytes(message.proofChannel); + } + if (message.proofUpgrade.length !== 0) { + writer.uint32(42).bytes(message.proofUpgrade); + } + if (message.proofHeight !== undefined) { + Height.encode(message.proofHeight, writer.uint32(50).fork()).ldelim(); + } + if (message.signer !== "") { + writer.uint32(58).string(message.signer); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgChannelUpgradeAck { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgChannelUpgradeAck(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.portId = reader.string(); + break; + case 2: + message.channelId = reader.string(); + break; + case 3: + message.counterpartyUpgrade = Upgrade.decode(reader, reader.uint32()); + break; + case 4: + message.proofChannel = reader.bytes(); + break; + case 5: + message.proofUpgrade = reader.bytes(); + break; + case 6: + message.proofHeight = Height.decode(reader, reader.uint32()); + break; + case 7: + message.signer = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): MsgChannelUpgradeAck { + return { + portId: isSet(object.portId) ? String(object.portId) : "", + channelId: isSet(object.channelId) ? String(object.channelId) : "", + counterpartyUpgrade: isSet(object.counterpartyUpgrade) ? Upgrade.fromJSON(object.counterpartyUpgrade) : undefined, + proofChannel: isSet(object.proofChannel) ? bytesFromBase64(object.proofChannel) : new Uint8Array(), + proofUpgrade: isSet(object.proofUpgrade) ? bytesFromBase64(object.proofUpgrade) : new Uint8Array(), + proofHeight: isSet(object.proofHeight) ? Height.fromJSON(object.proofHeight) : undefined, + signer: isSet(object.signer) ? String(object.signer) : "" + }; + }, + toJSON(message: MsgChannelUpgradeAck): unknown { + const obj: any = {}; + message.portId !== undefined && (obj.portId = message.portId); + message.channelId !== undefined && (obj.channelId = message.channelId); + message.counterpartyUpgrade !== undefined && (obj.counterpartyUpgrade = message.counterpartyUpgrade ? Upgrade.toJSON(message.counterpartyUpgrade) : undefined); + message.proofChannel !== undefined && (obj.proofChannel = base64FromBytes(message.proofChannel !== undefined ? message.proofChannel : new Uint8Array())); + message.proofUpgrade !== undefined && (obj.proofUpgrade = base64FromBytes(message.proofUpgrade !== undefined ? message.proofUpgrade : new Uint8Array())); + message.proofHeight !== undefined && (obj.proofHeight = message.proofHeight ? Height.toJSON(message.proofHeight) : undefined); + message.signer !== undefined && (obj.signer = message.signer); + return obj; + }, + fromPartial(object: Partial): MsgChannelUpgradeAck { + const message = createBaseMsgChannelUpgradeAck(); + message.portId = object.portId ?? ""; + message.channelId = object.channelId ?? ""; + message.counterpartyUpgrade = object.counterpartyUpgrade !== undefined && object.counterpartyUpgrade !== null ? Upgrade.fromPartial(object.counterpartyUpgrade) : undefined; + message.proofChannel = object.proofChannel ?? new Uint8Array(); + message.proofUpgrade = object.proofUpgrade ?? new Uint8Array(); + message.proofHeight = object.proofHeight !== undefined && object.proofHeight !== null ? Height.fromPartial(object.proofHeight) : undefined; + message.signer = object.signer ?? ""; + return message; + }, + fromAmino(object: MsgChannelUpgradeAckAmino): MsgChannelUpgradeAck { + const message = createBaseMsgChannelUpgradeAck(); + if (object.port_id !== undefined && object.port_id !== null) { + message.portId = object.port_id; + } + if (object.channel_id !== undefined && object.channel_id !== null) { + message.channelId = object.channel_id; + } + if (object.counterparty_upgrade !== undefined && object.counterparty_upgrade !== null) { + message.counterpartyUpgrade = Upgrade.fromAmino(object.counterparty_upgrade); + } + if (object.proof_channel !== undefined && object.proof_channel !== null) { + message.proofChannel = bytesFromBase64(object.proof_channel); + } + if (object.proof_upgrade !== undefined && object.proof_upgrade !== null) { + message.proofUpgrade = bytesFromBase64(object.proof_upgrade); + } + if (object.proof_height !== undefined && object.proof_height !== null) { + message.proofHeight = Height.fromAmino(object.proof_height); + } + if (object.signer !== undefined && object.signer !== null) { + message.signer = object.signer; + } + return message; + }, + toAmino(message: MsgChannelUpgradeAck): MsgChannelUpgradeAckAmino { + const obj: any = {}; + obj.port_id = message.portId; + obj.channel_id = message.channelId; + obj.counterparty_upgrade = message.counterpartyUpgrade ? Upgrade.toAmino(message.counterpartyUpgrade) : undefined; + obj.proof_channel = message.proofChannel ? base64FromBytes(message.proofChannel) : undefined; + obj.proof_upgrade = message.proofUpgrade ? base64FromBytes(message.proofUpgrade) : undefined; + obj.proof_height = message.proofHeight ? Height.toAmino(message.proofHeight) : {}; + obj.signer = message.signer; + return obj; + }, + fromAminoMsg(object: MsgChannelUpgradeAckAminoMsg): MsgChannelUpgradeAck { + return MsgChannelUpgradeAck.fromAmino(object.value); + }, + toAminoMsg(message: MsgChannelUpgradeAck): MsgChannelUpgradeAckAminoMsg { + return { + type: "cosmos-sdk/MsgChannelUpgradeAck", + value: MsgChannelUpgradeAck.toAmino(message) + }; + }, + fromProtoMsg(message: MsgChannelUpgradeAckProtoMsg): MsgChannelUpgradeAck { + return MsgChannelUpgradeAck.decode(message.value); + }, + toProto(message: MsgChannelUpgradeAck): Uint8Array { + return MsgChannelUpgradeAck.encode(message).finish(); + }, + toProtoMsg(message: MsgChannelUpgradeAck): MsgChannelUpgradeAckProtoMsg { + return { + typeUrl: "/ibc.core.channel.v1.MsgChannelUpgradeAck", + value: MsgChannelUpgradeAck.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgChannelUpgradeAck.typeUrl, MsgChannelUpgradeAck); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgChannelUpgradeAck.aminoType, MsgChannelUpgradeAck.typeUrl); +function createBaseMsgChannelUpgradeAckResponse(): MsgChannelUpgradeAckResponse { + return { + result: 0 + }; +} +export const MsgChannelUpgradeAckResponse = { + typeUrl: "/ibc.core.channel.v1.MsgChannelUpgradeAckResponse", + aminoType: "cosmos-sdk/MsgChannelUpgradeAckResponse", + is(o: any): o is MsgChannelUpgradeAckResponse { + return o && (o.$typeUrl === MsgChannelUpgradeAckResponse.typeUrl || isSet(o.result)); + }, + isSDK(o: any): o is MsgChannelUpgradeAckResponseSDKType { + return o && (o.$typeUrl === MsgChannelUpgradeAckResponse.typeUrl || isSet(o.result)); + }, + isAmino(o: any): o is MsgChannelUpgradeAckResponseAmino { + return o && (o.$typeUrl === MsgChannelUpgradeAckResponse.typeUrl || isSet(o.result)); + }, + encode(message: MsgChannelUpgradeAckResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.result !== 0) { + writer.uint32(8).int32(message.result); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgChannelUpgradeAckResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgChannelUpgradeAckResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.result = (reader.int32() as any); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): MsgChannelUpgradeAckResponse { + return { + result: isSet(object.result) ? responseResultTypeFromJSON(object.result) : -1 + }; + }, + toJSON(message: MsgChannelUpgradeAckResponse): unknown { + const obj: any = {}; + message.result !== undefined && (obj.result = responseResultTypeToJSON(message.result)); + return obj; + }, + fromPartial(object: Partial): MsgChannelUpgradeAckResponse { + const message = createBaseMsgChannelUpgradeAckResponse(); + message.result = object.result ?? 0; + return message; + }, + fromAmino(object: MsgChannelUpgradeAckResponseAmino): MsgChannelUpgradeAckResponse { + const message = createBaseMsgChannelUpgradeAckResponse(); + if (object.result !== undefined && object.result !== null) { + message.result = responseResultTypeFromJSON(object.result); + } + return message; + }, + toAmino(message: MsgChannelUpgradeAckResponse): MsgChannelUpgradeAckResponseAmino { + const obj: any = {}; + obj.result = responseResultTypeToJSON(message.result); + return obj; + }, + fromAminoMsg(object: MsgChannelUpgradeAckResponseAminoMsg): MsgChannelUpgradeAckResponse { + return MsgChannelUpgradeAckResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgChannelUpgradeAckResponse): MsgChannelUpgradeAckResponseAminoMsg { + return { + type: "cosmos-sdk/MsgChannelUpgradeAckResponse", + value: MsgChannelUpgradeAckResponse.toAmino(message) + }; + }, + fromProtoMsg(message: MsgChannelUpgradeAckResponseProtoMsg): MsgChannelUpgradeAckResponse { + return MsgChannelUpgradeAckResponse.decode(message.value); + }, + toProto(message: MsgChannelUpgradeAckResponse): Uint8Array { + return MsgChannelUpgradeAckResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgChannelUpgradeAckResponse): MsgChannelUpgradeAckResponseProtoMsg { + return { + typeUrl: "/ibc.core.channel.v1.MsgChannelUpgradeAckResponse", + value: MsgChannelUpgradeAckResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgChannelUpgradeAckResponse.typeUrl, MsgChannelUpgradeAckResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgChannelUpgradeAckResponse.aminoType, MsgChannelUpgradeAckResponse.typeUrl); +function createBaseMsgChannelUpgradeConfirm(): MsgChannelUpgradeConfirm { + return { + portId: "", + channelId: "", + counterpartyChannelState: 0, + counterpartyUpgrade: Upgrade.fromPartial({}), + proofChannel: new Uint8Array(), + proofUpgrade: new Uint8Array(), + proofHeight: Height.fromPartial({}), + signer: "" + }; +} +export const MsgChannelUpgradeConfirm = { + typeUrl: "/ibc.core.channel.v1.MsgChannelUpgradeConfirm", + aminoType: "cosmos-sdk/MsgChannelUpgradeConfirm", + is(o: any): o is MsgChannelUpgradeConfirm { + return o && (o.$typeUrl === MsgChannelUpgradeConfirm.typeUrl || typeof o.portId === "string" && typeof o.channelId === "string" && isSet(o.counterpartyChannelState) && Upgrade.is(o.counterpartyUpgrade) && (o.proofChannel instanceof Uint8Array || typeof o.proofChannel === "string") && (o.proofUpgrade instanceof Uint8Array || typeof o.proofUpgrade === "string") && Height.is(o.proofHeight) && typeof o.signer === "string"); + }, + isSDK(o: any): o is MsgChannelUpgradeConfirmSDKType { + return o && (o.$typeUrl === MsgChannelUpgradeConfirm.typeUrl || typeof o.port_id === "string" && typeof o.channel_id === "string" && isSet(o.counterparty_channel_state) && Upgrade.isSDK(o.counterparty_upgrade) && (o.proof_channel instanceof Uint8Array || typeof o.proof_channel === "string") && (o.proof_upgrade instanceof Uint8Array || typeof o.proof_upgrade === "string") && Height.isSDK(o.proof_height) && typeof o.signer === "string"); + }, + isAmino(o: any): o is MsgChannelUpgradeConfirmAmino { + return o && (o.$typeUrl === MsgChannelUpgradeConfirm.typeUrl || typeof o.port_id === "string" && typeof o.channel_id === "string" && isSet(o.counterparty_channel_state) && Upgrade.isAmino(o.counterparty_upgrade) && (o.proof_channel instanceof Uint8Array || typeof o.proof_channel === "string") && (o.proof_upgrade instanceof Uint8Array || typeof o.proof_upgrade === "string") && Height.isAmino(o.proof_height) && typeof o.signer === "string"); + }, + encode(message: MsgChannelUpgradeConfirm, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.portId !== "") { + writer.uint32(10).string(message.portId); + } + if (message.channelId !== "") { + writer.uint32(18).string(message.channelId); + } + if (message.counterpartyChannelState !== 0) { + writer.uint32(24).int32(message.counterpartyChannelState); + } + if (message.counterpartyUpgrade !== undefined) { + Upgrade.encode(message.counterpartyUpgrade, writer.uint32(34).fork()).ldelim(); + } + if (message.proofChannel.length !== 0) { + writer.uint32(42).bytes(message.proofChannel); + } + if (message.proofUpgrade.length !== 0) { + writer.uint32(50).bytes(message.proofUpgrade); + } + if (message.proofHeight !== undefined) { + Height.encode(message.proofHeight, writer.uint32(58).fork()).ldelim(); + } + if (message.signer !== "") { + writer.uint32(66).string(message.signer); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgChannelUpgradeConfirm { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgChannelUpgradeConfirm(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.portId = reader.string(); + break; + case 2: + message.channelId = reader.string(); + break; + case 3: + message.counterpartyChannelState = (reader.int32() as any); + break; + case 4: + message.counterpartyUpgrade = Upgrade.decode(reader, reader.uint32()); + break; + case 5: + message.proofChannel = reader.bytes(); + break; + case 6: + message.proofUpgrade = reader.bytes(); + break; + case 7: + message.proofHeight = Height.decode(reader, reader.uint32()); + break; + case 8: + message.signer = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): MsgChannelUpgradeConfirm { + return { + portId: isSet(object.portId) ? String(object.portId) : "", + channelId: isSet(object.channelId) ? String(object.channelId) : "", + counterpartyChannelState: isSet(object.counterpartyChannelState) ? stateFromJSON(object.counterpartyChannelState) : -1, + counterpartyUpgrade: isSet(object.counterpartyUpgrade) ? Upgrade.fromJSON(object.counterpartyUpgrade) : undefined, + proofChannel: isSet(object.proofChannel) ? bytesFromBase64(object.proofChannel) : new Uint8Array(), + proofUpgrade: isSet(object.proofUpgrade) ? bytesFromBase64(object.proofUpgrade) : new Uint8Array(), + proofHeight: isSet(object.proofHeight) ? Height.fromJSON(object.proofHeight) : undefined, + signer: isSet(object.signer) ? String(object.signer) : "" + }; + }, + toJSON(message: MsgChannelUpgradeConfirm): unknown { + const obj: any = {}; + message.portId !== undefined && (obj.portId = message.portId); + message.channelId !== undefined && (obj.channelId = message.channelId); + message.counterpartyChannelState !== undefined && (obj.counterpartyChannelState = stateToJSON(message.counterpartyChannelState)); + message.counterpartyUpgrade !== undefined && (obj.counterpartyUpgrade = message.counterpartyUpgrade ? Upgrade.toJSON(message.counterpartyUpgrade) : undefined); + message.proofChannel !== undefined && (obj.proofChannel = base64FromBytes(message.proofChannel !== undefined ? message.proofChannel : new Uint8Array())); + message.proofUpgrade !== undefined && (obj.proofUpgrade = base64FromBytes(message.proofUpgrade !== undefined ? message.proofUpgrade : new Uint8Array())); + message.proofHeight !== undefined && (obj.proofHeight = message.proofHeight ? Height.toJSON(message.proofHeight) : undefined); + message.signer !== undefined && (obj.signer = message.signer); + return obj; + }, + fromPartial(object: Partial): MsgChannelUpgradeConfirm { + const message = createBaseMsgChannelUpgradeConfirm(); + message.portId = object.portId ?? ""; + message.channelId = object.channelId ?? ""; + message.counterpartyChannelState = object.counterpartyChannelState ?? 0; + message.counterpartyUpgrade = object.counterpartyUpgrade !== undefined && object.counterpartyUpgrade !== null ? Upgrade.fromPartial(object.counterpartyUpgrade) : undefined; + message.proofChannel = object.proofChannel ?? new Uint8Array(); + message.proofUpgrade = object.proofUpgrade ?? new Uint8Array(); + message.proofHeight = object.proofHeight !== undefined && object.proofHeight !== null ? Height.fromPartial(object.proofHeight) : undefined; + message.signer = object.signer ?? ""; + return message; + }, + fromAmino(object: MsgChannelUpgradeConfirmAmino): MsgChannelUpgradeConfirm { + const message = createBaseMsgChannelUpgradeConfirm(); + if (object.port_id !== undefined && object.port_id !== null) { + message.portId = object.port_id; + } + if (object.channel_id !== undefined && object.channel_id !== null) { + message.channelId = object.channel_id; + } + if (object.counterparty_channel_state !== undefined && object.counterparty_channel_state !== null) { + message.counterpartyChannelState = stateFromJSON(object.counterparty_channel_state); + } + if (object.counterparty_upgrade !== undefined && object.counterparty_upgrade !== null) { + message.counterpartyUpgrade = Upgrade.fromAmino(object.counterparty_upgrade); + } + if (object.proof_channel !== undefined && object.proof_channel !== null) { + message.proofChannel = bytesFromBase64(object.proof_channel); + } + if (object.proof_upgrade !== undefined && object.proof_upgrade !== null) { + message.proofUpgrade = bytesFromBase64(object.proof_upgrade); + } + if (object.proof_height !== undefined && object.proof_height !== null) { + message.proofHeight = Height.fromAmino(object.proof_height); + } + if (object.signer !== undefined && object.signer !== null) { + message.signer = object.signer; + } + return message; + }, + toAmino(message: MsgChannelUpgradeConfirm): MsgChannelUpgradeConfirmAmino { + const obj: any = {}; + obj.port_id = message.portId; + obj.channel_id = message.channelId; + obj.counterparty_channel_state = stateToJSON(message.counterpartyChannelState); + obj.counterparty_upgrade = message.counterpartyUpgrade ? Upgrade.toAmino(message.counterpartyUpgrade) : undefined; + obj.proof_channel = message.proofChannel ? base64FromBytes(message.proofChannel) : undefined; + obj.proof_upgrade = message.proofUpgrade ? base64FromBytes(message.proofUpgrade) : undefined; + obj.proof_height = message.proofHeight ? Height.toAmino(message.proofHeight) : {}; + obj.signer = message.signer; + return obj; + }, + fromAminoMsg(object: MsgChannelUpgradeConfirmAminoMsg): MsgChannelUpgradeConfirm { + return MsgChannelUpgradeConfirm.fromAmino(object.value); + }, + toAminoMsg(message: MsgChannelUpgradeConfirm): MsgChannelUpgradeConfirmAminoMsg { + return { + type: "cosmos-sdk/MsgChannelUpgradeConfirm", + value: MsgChannelUpgradeConfirm.toAmino(message) + }; + }, + fromProtoMsg(message: MsgChannelUpgradeConfirmProtoMsg): MsgChannelUpgradeConfirm { + return MsgChannelUpgradeConfirm.decode(message.value); + }, + toProto(message: MsgChannelUpgradeConfirm): Uint8Array { + return MsgChannelUpgradeConfirm.encode(message).finish(); + }, + toProtoMsg(message: MsgChannelUpgradeConfirm): MsgChannelUpgradeConfirmProtoMsg { + return { + typeUrl: "/ibc.core.channel.v1.MsgChannelUpgradeConfirm", + value: MsgChannelUpgradeConfirm.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgChannelUpgradeConfirm.typeUrl, MsgChannelUpgradeConfirm); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgChannelUpgradeConfirm.aminoType, MsgChannelUpgradeConfirm.typeUrl); +function createBaseMsgChannelUpgradeConfirmResponse(): MsgChannelUpgradeConfirmResponse { + return { + result: 0 + }; +} +export const MsgChannelUpgradeConfirmResponse = { + typeUrl: "/ibc.core.channel.v1.MsgChannelUpgradeConfirmResponse", + aminoType: "cosmos-sdk/MsgChannelUpgradeConfirmResponse", + is(o: any): o is MsgChannelUpgradeConfirmResponse { + return o && (o.$typeUrl === MsgChannelUpgradeConfirmResponse.typeUrl || isSet(o.result)); + }, + isSDK(o: any): o is MsgChannelUpgradeConfirmResponseSDKType { + return o && (o.$typeUrl === MsgChannelUpgradeConfirmResponse.typeUrl || isSet(o.result)); + }, + isAmino(o: any): o is MsgChannelUpgradeConfirmResponseAmino { + return o && (o.$typeUrl === MsgChannelUpgradeConfirmResponse.typeUrl || isSet(o.result)); + }, + encode(message: MsgChannelUpgradeConfirmResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.result !== 0) { + writer.uint32(8).int32(message.result); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgChannelUpgradeConfirmResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgChannelUpgradeConfirmResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.result = (reader.int32() as any); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): MsgChannelUpgradeConfirmResponse { + return { + result: isSet(object.result) ? responseResultTypeFromJSON(object.result) : -1 + }; + }, + toJSON(message: MsgChannelUpgradeConfirmResponse): unknown { + const obj: any = {}; + message.result !== undefined && (obj.result = responseResultTypeToJSON(message.result)); + return obj; + }, + fromPartial(object: Partial): MsgChannelUpgradeConfirmResponse { + const message = createBaseMsgChannelUpgradeConfirmResponse(); + message.result = object.result ?? 0; + return message; + }, + fromAmino(object: MsgChannelUpgradeConfirmResponseAmino): MsgChannelUpgradeConfirmResponse { + const message = createBaseMsgChannelUpgradeConfirmResponse(); + if (object.result !== undefined && object.result !== null) { + message.result = responseResultTypeFromJSON(object.result); + } + return message; + }, + toAmino(message: MsgChannelUpgradeConfirmResponse): MsgChannelUpgradeConfirmResponseAmino { + const obj: any = {}; + obj.result = responseResultTypeToJSON(message.result); + return obj; + }, + fromAminoMsg(object: MsgChannelUpgradeConfirmResponseAminoMsg): MsgChannelUpgradeConfirmResponse { + return MsgChannelUpgradeConfirmResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgChannelUpgradeConfirmResponse): MsgChannelUpgradeConfirmResponseAminoMsg { + return { + type: "cosmos-sdk/MsgChannelUpgradeConfirmResponse", + value: MsgChannelUpgradeConfirmResponse.toAmino(message) + }; + }, + fromProtoMsg(message: MsgChannelUpgradeConfirmResponseProtoMsg): MsgChannelUpgradeConfirmResponse { + return MsgChannelUpgradeConfirmResponse.decode(message.value); + }, + toProto(message: MsgChannelUpgradeConfirmResponse): Uint8Array { + return MsgChannelUpgradeConfirmResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgChannelUpgradeConfirmResponse): MsgChannelUpgradeConfirmResponseProtoMsg { + return { + typeUrl: "/ibc.core.channel.v1.MsgChannelUpgradeConfirmResponse", + value: MsgChannelUpgradeConfirmResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgChannelUpgradeConfirmResponse.typeUrl, MsgChannelUpgradeConfirmResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgChannelUpgradeConfirmResponse.aminoType, MsgChannelUpgradeConfirmResponse.typeUrl); +function createBaseMsgChannelUpgradeOpen(): MsgChannelUpgradeOpen { + return { + portId: "", + channelId: "", + counterpartyChannelState: 0, + proofChannel: new Uint8Array(), + proofHeight: Height.fromPartial({}), + signer: "" + }; +} +export const MsgChannelUpgradeOpen = { + typeUrl: "/ibc.core.channel.v1.MsgChannelUpgradeOpen", + aminoType: "cosmos-sdk/MsgChannelUpgradeOpen", + is(o: any): o is MsgChannelUpgradeOpen { + return o && (o.$typeUrl === MsgChannelUpgradeOpen.typeUrl || typeof o.portId === "string" && typeof o.channelId === "string" && isSet(o.counterpartyChannelState) && (o.proofChannel instanceof Uint8Array || typeof o.proofChannel === "string") && Height.is(o.proofHeight) && typeof o.signer === "string"); + }, + isSDK(o: any): o is MsgChannelUpgradeOpenSDKType { + return o && (o.$typeUrl === MsgChannelUpgradeOpen.typeUrl || typeof o.port_id === "string" && typeof o.channel_id === "string" && isSet(o.counterparty_channel_state) && (o.proof_channel instanceof Uint8Array || typeof o.proof_channel === "string") && Height.isSDK(o.proof_height) && typeof o.signer === "string"); + }, + isAmino(o: any): o is MsgChannelUpgradeOpenAmino { + return o && (o.$typeUrl === MsgChannelUpgradeOpen.typeUrl || typeof o.port_id === "string" && typeof o.channel_id === "string" && isSet(o.counterparty_channel_state) && (o.proof_channel instanceof Uint8Array || typeof o.proof_channel === "string") && Height.isAmino(o.proof_height) && typeof o.signer === "string"); + }, + encode(message: MsgChannelUpgradeOpen, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.portId !== "") { + writer.uint32(10).string(message.portId); + } + if (message.channelId !== "") { + writer.uint32(18).string(message.channelId); + } + if (message.counterpartyChannelState !== 0) { + writer.uint32(24).int32(message.counterpartyChannelState); + } + if (message.proofChannel.length !== 0) { + writer.uint32(34).bytes(message.proofChannel); + } + if (message.proofHeight !== undefined) { + Height.encode(message.proofHeight, writer.uint32(42).fork()).ldelim(); + } + if (message.signer !== "") { + writer.uint32(50).string(message.signer); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgChannelUpgradeOpen { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgChannelUpgradeOpen(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.portId = reader.string(); + break; + case 2: + message.channelId = reader.string(); + break; + case 3: + message.counterpartyChannelState = (reader.int32() as any); + break; + case 4: + message.proofChannel = reader.bytes(); + break; + case 5: + message.proofHeight = Height.decode(reader, reader.uint32()); + break; + case 6: + message.signer = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): MsgChannelUpgradeOpen { + return { + portId: isSet(object.portId) ? String(object.portId) : "", + channelId: isSet(object.channelId) ? String(object.channelId) : "", + counterpartyChannelState: isSet(object.counterpartyChannelState) ? stateFromJSON(object.counterpartyChannelState) : -1, + proofChannel: isSet(object.proofChannel) ? bytesFromBase64(object.proofChannel) : new Uint8Array(), + proofHeight: isSet(object.proofHeight) ? Height.fromJSON(object.proofHeight) : undefined, + signer: isSet(object.signer) ? String(object.signer) : "" + }; + }, + toJSON(message: MsgChannelUpgradeOpen): unknown { + const obj: any = {}; + message.portId !== undefined && (obj.portId = message.portId); + message.channelId !== undefined && (obj.channelId = message.channelId); + message.counterpartyChannelState !== undefined && (obj.counterpartyChannelState = stateToJSON(message.counterpartyChannelState)); + message.proofChannel !== undefined && (obj.proofChannel = base64FromBytes(message.proofChannel !== undefined ? message.proofChannel : new Uint8Array())); + message.proofHeight !== undefined && (obj.proofHeight = message.proofHeight ? Height.toJSON(message.proofHeight) : undefined); + message.signer !== undefined && (obj.signer = message.signer); + return obj; + }, + fromPartial(object: Partial): MsgChannelUpgradeOpen { + const message = createBaseMsgChannelUpgradeOpen(); + message.portId = object.portId ?? ""; + message.channelId = object.channelId ?? ""; + message.counterpartyChannelState = object.counterpartyChannelState ?? 0; + message.proofChannel = object.proofChannel ?? new Uint8Array(); + message.proofHeight = object.proofHeight !== undefined && object.proofHeight !== null ? Height.fromPartial(object.proofHeight) : undefined; + message.signer = object.signer ?? ""; + return message; + }, + fromAmino(object: MsgChannelUpgradeOpenAmino): MsgChannelUpgradeOpen { + const message = createBaseMsgChannelUpgradeOpen(); + if (object.port_id !== undefined && object.port_id !== null) { + message.portId = object.port_id; + } + if (object.channel_id !== undefined && object.channel_id !== null) { + message.channelId = object.channel_id; + } + if (object.counterparty_channel_state !== undefined && object.counterparty_channel_state !== null) { + message.counterpartyChannelState = stateFromJSON(object.counterparty_channel_state); + } + if (object.proof_channel !== undefined && object.proof_channel !== null) { + message.proofChannel = bytesFromBase64(object.proof_channel); + } + if (object.proof_height !== undefined && object.proof_height !== null) { + message.proofHeight = Height.fromAmino(object.proof_height); + } + if (object.signer !== undefined && object.signer !== null) { + message.signer = object.signer; + } + return message; + }, + toAmino(message: MsgChannelUpgradeOpen): MsgChannelUpgradeOpenAmino { + const obj: any = {}; + obj.port_id = message.portId; + obj.channel_id = message.channelId; + obj.counterparty_channel_state = stateToJSON(message.counterpartyChannelState); + obj.proof_channel = message.proofChannel ? base64FromBytes(message.proofChannel) : undefined; + obj.proof_height = message.proofHeight ? Height.toAmino(message.proofHeight) : {}; + obj.signer = message.signer; + return obj; + }, + fromAminoMsg(object: MsgChannelUpgradeOpenAminoMsg): MsgChannelUpgradeOpen { + return MsgChannelUpgradeOpen.fromAmino(object.value); + }, + toAminoMsg(message: MsgChannelUpgradeOpen): MsgChannelUpgradeOpenAminoMsg { + return { + type: "cosmos-sdk/MsgChannelUpgradeOpen", + value: MsgChannelUpgradeOpen.toAmino(message) + }; + }, + fromProtoMsg(message: MsgChannelUpgradeOpenProtoMsg): MsgChannelUpgradeOpen { + return MsgChannelUpgradeOpen.decode(message.value); + }, + toProto(message: MsgChannelUpgradeOpen): Uint8Array { + return MsgChannelUpgradeOpen.encode(message).finish(); + }, + toProtoMsg(message: MsgChannelUpgradeOpen): MsgChannelUpgradeOpenProtoMsg { + return { + typeUrl: "/ibc.core.channel.v1.MsgChannelUpgradeOpen", + value: MsgChannelUpgradeOpen.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgChannelUpgradeOpen.typeUrl, MsgChannelUpgradeOpen); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgChannelUpgradeOpen.aminoType, MsgChannelUpgradeOpen.typeUrl); +function createBaseMsgChannelUpgradeOpenResponse(): MsgChannelUpgradeOpenResponse { + return {}; +} +export const MsgChannelUpgradeOpenResponse = { + typeUrl: "/ibc.core.channel.v1.MsgChannelUpgradeOpenResponse", + aminoType: "cosmos-sdk/MsgChannelUpgradeOpenResponse", + is(o: any): o is MsgChannelUpgradeOpenResponse { + return o && o.$typeUrl === MsgChannelUpgradeOpenResponse.typeUrl; + }, + isSDK(o: any): o is MsgChannelUpgradeOpenResponseSDKType { + return o && o.$typeUrl === MsgChannelUpgradeOpenResponse.typeUrl; + }, + isAmino(o: any): o is MsgChannelUpgradeOpenResponseAmino { + return o && o.$typeUrl === MsgChannelUpgradeOpenResponse.typeUrl; + }, + encode(_: MsgChannelUpgradeOpenResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgChannelUpgradeOpenResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgChannelUpgradeOpenResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(_: any): MsgChannelUpgradeOpenResponse { + return {}; + }, + toJSON(_: MsgChannelUpgradeOpenResponse): unknown { + const obj: any = {}; + return obj; + }, + fromPartial(_: Partial): MsgChannelUpgradeOpenResponse { + const message = createBaseMsgChannelUpgradeOpenResponse(); + return message; + }, + fromAmino(_: MsgChannelUpgradeOpenResponseAmino): MsgChannelUpgradeOpenResponse { + const message = createBaseMsgChannelUpgradeOpenResponse(); + return message; + }, + toAmino(_: MsgChannelUpgradeOpenResponse): MsgChannelUpgradeOpenResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgChannelUpgradeOpenResponseAminoMsg): MsgChannelUpgradeOpenResponse { + return MsgChannelUpgradeOpenResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgChannelUpgradeOpenResponse): MsgChannelUpgradeOpenResponseAminoMsg { + return { + type: "cosmos-sdk/MsgChannelUpgradeOpenResponse", + value: MsgChannelUpgradeOpenResponse.toAmino(message) + }; + }, + fromProtoMsg(message: MsgChannelUpgradeOpenResponseProtoMsg): MsgChannelUpgradeOpenResponse { + return MsgChannelUpgradeOpenResponse.decode(message.value); + }, + toProto(message: MsgChannelUpgradeOpenResponse): Uint8Array { + return MsgChannelUpgradeOpenResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgChannelUpgradeOpenResponse): MsgChannelUpgradeOpenResponseProtoMsg { + return { + typeUrl: "/ibc.core.channel.v1.MsgChannelUpgradeOpenResponse", + value: MsgChannelUpgradeOpenResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgChannelUpgradeOpenResponse.typeUrl, MsgChannelUpgradeOpenResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgChannelUpgradeOpenResponse.aminoType, MsgChannelUpgradeOpenResponse.typeUrl); +function createBaseMsgChannelUpgradeTimeout(): MsgChannelUpgradeTimeout { + return { + portId: "", + channelId: "", + counterpartyChannel: Channel.fromPartial({}), + proofChannel: new Uint8Array(), + proofHeight: Height.fromPartial({}), + signer: "" + }; +} +export const MsgChannelUpgradeTimeout = { + typeUrl: "/ibc.core.channel.v1.MsgChannelUpgradeTimeout", + aminoType: "cosmos-sdk/MsgChannelUpgradeTimeout", + is(o: any): o is MsgChannelUpgradeTimeout { + return o && (o.$typeUrl === MsgChannelUpgradeTimeout.typeUrl || typeof o.portId === "string" && typeof o.channelId === "string" && Channel.is(o.counterpartyChannel) && (o.proofChannel instanceof Uint8Array || typeof o.proofChannel === "string") && Height.is(o.proofHeight) && typeof o.signer === "string"); + }, + isSDK(o: any): o is MsgChannelUpgradeTimeoutSDKType { + return o && (o.$typeUrl === MsgChannelUpgradeTimeout.typeUrl || typeof o.port_id === "string" && typeof o.channel_id === "string" && Channel.isSDK(o.counterparty_channel) && (o.proof_channel instanceof Uint8Array || typeof o.proof_channel === "string") && Height.isSDK(o.proof_height) && typeof o.signer === "string"); + }, + isAmino(o: any): o is MsgChannelUpgradeTimeoutAmino { + return o && (o.$typeUrl === MsgChannelUpgradeTimeout.typeUrl || typeof o.port_id === "string" && typeof o.channel_id === "string" && Channel.isAmino(o.counterparty_channel) && (o.proof_channel instanceof Uint8Array || typeof o.proof_channel === "string") && Height.isAmino(o.proof_height) && typeof o.signer === "string"); + }, + encode(message: MsgChannelUpgradeTimeout, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.portId !== "") { + writer.uint32(10).string(message.portId); + } + if (message.channelId !== "") { + writer.uint32(18).string(message.channelId); + } + if (message.counterpartyChannel !== undefined) { + Channel.encode(message.counterpartyChannel, writer.uint32(26).fork()).ldelim(); + } + if (message.proofChannel.length !== 0) { + writer.uint32(34).bytes(message.proofChannel); + } + if (message.proofHeight !== undefined) { + Height.encode(message.proofHeight, writer.uint32(42).fork()).ldelim(); + } + if (message.signer !== "") { + writer.uint32(50).string(message.signer); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgChannelUpgradeTimeout { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgChannelUpgradeTimeout(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.portId = reader.string(); + break; + case 2: + message.channelId = reader.string(); + break; + case 3: + message.counterpartyChannel = Channel.decode(reader, reader.uint32()); + break; + case 4: + message.proofChannel = reader.bytes(); + break; + case 5: + message.proofHeight = Height.decode(reader, reader.uint32()); + break; + case 6: + message.signer = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): MsgChannelUpgradeTimeout { + return { + portId: isSet(object.portId) ? String(object.portId) : "", + channelId: isSet(object.channelId) ? String(object.channelId) : "", + counterpartyChannel: isSet(object.counterpartyChannel) ? Channel.fromJSON(object.counterpartyChannel) : undefined, + proofChannel: isSet(object.proofChannel) ? bytesFromBase64(object.proofChannel) : new Uint8Array(), + proofHeight: isSet(object.proofHeight) ? Height.fromJSON(object.proofHeight) : undefined, + signer: isSet(object.signer) ? String(object.signer) : "" + }; + }, + toJSON(message: MsgChannelUpgradeTimeout): unknown { + const obj: any = {}; + message.portId !== undefined && (obj.portId = message.portId); + message.channelId !== undefined && (obj.channelId = message.channelId); + message.counterpartyChannel !== undefined && (obj.counterpartyChannel = message.counterpartyChannel ? Channel.toJSON(message.counterpartyChannel) : undefined); + message.proofChannel !== undefined && (obj.proofChannel = base64FromBytes(message.proofChannel !== undefined ? message.proofChannel : new Uint8Array())); + message.proofHeight !== undefined && (obj.proofHeight = message.proofHeight ? Height.toJSON(message.proofHeight) : undefined); + message.signer !== undefined && (obj.signer = message.signer); + return obj; + }, + fromPartial(object: Partial): MsgChannelUpgradeTimeout { + const message = createBaseMsgChannelUpgradeTimeout(); + message.portId = object.portId ?? ""; + message.channelId = object.channelId ?? ""; + message.counterpartyChannel = object.counterpartyChannel !== undefined && object.counterpartyChannel !== null ? Channel.fromPartial(object.counterpartyChannel) : undefined; + message.proofChannel = object.proofChannel ?? new Uint8Array(); + message.proofHeight = object.proofHeight !== undefined && object.proofHeight !== null ? Height.fromPartial(object.proofHeight) : undefined; + message.signer = object.signer ?? ""; + return message; + }, + fromAmino(object: MsgChannelUpgradeTimeoutAmino): MsgChannelUpgradeTimeout { + const message = createBaseMsgChannelUpgradeTimeout(); + if (object.port_id !== undefined && object.port_id !== null) { + message.portId = object.port_id; + } + if (object.channel_id !== undefined && object.channel_id !== null) { + message.channelId = object.channel_id; + } + if (object.counterparty_channel !== undefined && object.counterparty_channel !== null) { + message.counterpartyChannel = Channel.fromAmino(object.counterparty_channel); + } + if (object.proof_channel !== undefined && object.proof_channel !== null) { + message.proofChannel = bytesFromBase64(object.proof_channel); + } + if (object.proof_height !== undefined && object.proof_height !== null) { + message.proofHeight = Height.fromAmino(object.proof_height); + } + if (object.signer !== undefined && object.signer !== null) { + message.signer = object.signer; + } + return message; + }, + toAmino(message: MsgChannelUpgradeTimeout): MsgChannelUpgradeTimeoutAmino { + const obj: any = {}; + obj.port_id = message.portId; + obj.channel_id = message.channelId; + obj.counterparty_channel = message.counterpartyChannel ? Channel.toAmino(message.counterpartyChannel) : undefined; + obj.proof_channel = message.proofChannel ? base64FromBytes(message.proofChannel) : undefined; + obj.proof_height = message.proofHeight ? Height.toAmino(message.proofHeight) : {}; + obj.signer = message.signer; + return obj; + }, + fromAminoMsg(object: MsgChannelUpgradeTimeoutAminoMsg): MsgChannelUpgradeTimeout { + return MsgChannelUpgradeTimeout.fromAmino(object.value); + }, + toAminoMsg(message: MsgChannelUpgradeTimeout): MsgChannelUpgradeTimeoutAminoMsg { + return { + type: "cosmos-sdk/MsgChannelUpgradeTimeout", + value: MsgChannelUpgradeTimeout.toAmino(message) + }; + }, + fromProtoMsg(message: MsgChannelUpgradeTimeoutProtoMsg): MsgChannelUpgradeTimeout { + return MsgChannelUpgradeTimeout.decode(message.value); + }, + toProto(message: MsgChannelUpgradeTimeout): Uint8Array { + return MsgChannelUpgradeTimeout.encode(message).finish(); + }, + toProtoMsg(message: MsgChannelUpgradeTimeout): MsgChannelUpgradeTimeoutProtoMsg { + return { + typeUrl: "/ibc.core.channel.v1.MsgChannelUpgradeTimeout", + value: MsgChannelUpgradeTimeout.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgChannelUpgradeTimeout.typeUrl, MsgChannelUpgradeTimeout); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgChannelUpgradeTimeout.aminoType, MsgChannelUpgradeTimeout.typeUrl); +function createBaseMsgChannelUpgradeTimeoutResponse(): MsgChannelUpgradeTimeoutResponse { + return {}; +} +export const MsgChannelUpgradeTimeoutResponse = { + typeUrl: "/ibc.core.channel.v1.MsgChannelUpgradeTimeoutResponse", + aminoType: "cosmos-sdk/MsgChannelUpgradeTimeoutResponse", + is(o: any): o is MsgChannelUpgradeTimeoutResponse { + return o && o.$typeUrl === MsgChannelUpgradeTimeoutResponse.typeUrl; + }, + isSDK(o: any): o is MsgChannelUpgradeTimeoutResponseSDKType { + return o && o.$typeUrl === MsgChannelUpgradeTimeoutResponse.typeUrl; + }, + isAmino(o: any): o is MsgChannelUpgradeTimeoutResponseAmino { + return o && o.$typeUrl === MsgChannelUpgradeTimeoutResponse.typeUrl; + }, + encode(_: MsgChannelUpgradeTimeoutResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgChannelUpgradeTimeoutResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgChannelUpgradeTimeoutResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(_: any): MsgChannelUpgradeTimeoutResponse { + return {}; + }, + toJSON(_: MsgChannelUpgradeTimeoutResponse): unknown { + const obj: any = {}; + return obj; + }, + fromPartial(_: Partial): MsgChannelUpgradeTimeoutResponse { + const message = createBaseMsgChannelUpgradeTimeoutResponse(); + return message; + }, + fromAmino(_: MsgChannelUpgradeTimeoutResponseAmino): MsgChannelUpgradeTimeoutResponse { + const message = createBaseMsgChannelUpgradeTimeoutResponse(); + return message; + }, + toAmino(_: MsgChannelUpgradeTimeoutResponse): MsgChannelUpgradeTimeoutResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgChannelUpgradeTimeoutResponseAminoMsg): MsgChannelUpgradeTimeoutResponse { + return MsgChannelUpgradeTimeoutResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgChannelUpgradeTimeoutResponse): MsgChannelUpgradeTimeoutResponseAminoMsg { + return { + type: "cosmos-sdk/MsgChannelUpgradeTimeoutResponse", + value: MsgChannelUpgradeTimeoutResponse.toAmino(message) + }; + }, + fromProtoMsg(message: MsgChannelUpgradeTimeoutResponseProtoMsg): MsgChannelUpgradeTimeoutResponse { + return MsgChannelUpgradeTimeoutResponse.decode(message.value); + }, + toProto(message: MsgChannelUpgradeTimeoutResponse): Uint8Array { + return MsgChannelUpgradeTimeoutResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgChannelUpgradeTimeoutResponse): MsgChannelUpgradeTimeoutResponseProtoMsg { + return { + typeUrl: "/ibc.core.channel.v1.MsgChannelUpgradeTimeoutResponse", + value: MsgChannelUpgradeTimeoutResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgChannelUpgradeTimeoutResponse.typeUrl, MsgChannelUpgradeTimeoutResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgChannelUpgradeTimeoutResponse.aminoType, MsgChannelUpgradeTimeoutResponse.typeUrl); +function createBaseMsgChannelUpgradeCancel(): MsgChannelUpgradeCancel { + return { + portId: "", + channelId: "", + errorReceipt: ErrorReceipt.fromPartial({}), + proofErrorReceipt: new Uint8Array(), + proofHeight: Height.fromPartial({}), + signer: "" + }; +} +export const MsgChannelUpgradeCancel = { + typeUrl: "/ibc.core.channel.v1.MsgChannelUpgradeCancel", + aminoType: "cosmos-sdk/MsgChannelUpgradeCancel", + is(o: any): o is MsgChannelUpgradeCancel { + return o && (o.$typeUrl === MsgChannelUpgradeCancel.typeUrl || typeof o.portId === "string" && typeof o.channelId === "string" && ErrorReceipt.is(o.errorReceipt) && (o.proofErrorReceipt instanceof Uint8Array || typeof o.proofErrorReceipt === "string") && Height.is(o.proofHeight) && typeof o.signer === "string"); + }, + isSDK(o: any): o is MsgChannelUpgradeCancelSDKType { + return o && (o.$typeUrl === MsgChannelUpgradeCancel.typeUrl || typeof o.port_id === "string" && typeof o.channel_id === "string" && ErrorReceipt.isSDK(o.error_receipt) && (o.proof_error_receipt instanceof Uint8Array || typeof o.proof_error_receipt === "string") && Height.isSDK(o.proof_height) && typeof o.signer === "string"); + }, + isAmino(o: any): o is MsgChannelUpgradeCancelAmino { + return o && (o.$typeUrl === MsgChannelUpgradeCancel.typeUrl || typeof o.port_id === "string" && typeof o.channel_id === "string" && ErrorReceipt.isAmino(o.error_receipt) && (o.proof_error_receipt instanceof Uint8Array || typeof o.proof_error_receipt === "string") && Height.isAmino(o.proof_height) && typeof o.signer === "string"); + }, + encode(message: MsgChannelUpgradeCancel, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.portId !== "") { + writer.uint32(10).string(message.portId); + } + if (message.channelId !== "") { + writer.uint32(18).string(message.channelId); + } + if (message.errorReceipt !== undefined) { + ErrorReceipt.encode(message.errorReceipt, writer.uint32(26).fork()).ldelim(); + } + if (message.proofErrorReceipt.length !== 0) { + writer.uint32(34).bytes(message.proofErrorReceipt); + } + if (message.proofHeight !== undefined) { + Height.encode(message.proofHeight, writer.uint32(42).fork()).ldelim(); + } + if (message.signer !== "") { + writer.uint32(50).string(message.signer); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgChannelUpgradeCancel { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgChannelUpgradeCancel(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.portId = reader.string(); + break; + case 2: + message.channelId = reader.string(); + break; + case 3: + message.errorReceipt = ErrorReceipt.decode(reader, reader.uint32()); + break; + case 4: + message.proofErrorReceipt = reader.bytes(); + break; + case 5: + message.proofHeight = Height.decode(reader, reader.uint32()); + break; + case 6: + message.signer = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): MsgChannelUpgradeCancel { + return { + portId: isSet(object.portId) ? String(object.portId) : "", + channelId: isSet(object.channelId) ? String(object.channelId) : "", + errorReceipt: isSet(object.errorReceipt) ? ErrorReceipt.fromJSON(object.errorReceipt) : undefined, + proofErrorReceipt: isSet(object.proofErrorReceipt) ? bytesFromBase64(object.proofErrorReceipt) : new Uint8Array(), + proofHeight: isSet(object.proofHeight) ? Height.fromJSON(object.proofHeight) : undefined, + signer: isSet(object.signer) ? String(object.signer) : "" + }; + }, + toJSON(message: MsgChannelUpgradeCancel): unknown { + const obj: any = {}; + message.portId !== undefined && (obj.portId = message.portId); + message.channelId !== undefined && (obj.channelId = message.channelId); + message.errorReceipt !== undefined && (obj.errorReceipt = message.errorReceipt ? ErrorReceipt.toJSON(message.errorReceipt) : undefined); + message.proofErrorReceipt !== undefined && (obj.proofErrorReceipt = base64FromBytes(message.proofErrorReceipt !== undefined ? message.proofErrorReceipt : new Uint8Array())); + message.proofHeight !== undefined && (obj.proofHeight = message.proofHeight ? Height.toJSON(message.proofHeight) : undefined); + message.signer !== undefined && (obj.signer = message.signer); + return obj; + }, + fromPartial(object: Partial): MsgChannelUpgradeCancel { + const message = createBaseMsgChannelUpgradeCancel(); + message.portId = object.portId ?? ""; + message.channelId = object.channelId ?? ""; + message.errorReceipt = object.errorReceipt !== undefined && object.errorReceipt !== null ? ErrorReceipt.fromPartial(object.errorReceipt) : undefined; + message.proofErrorReceipt = object.proofErrorReceipt ?? new Uint8Array(); + message.proofHeight = object.proofHeight !== undefined && object.proofHeight !== null ? Height.fromPartial(object.proofHeight) : undefined; + message.signer = object.signer ?? ""; + return message; + }, + fromAmino(object: MsgChannelUpgradeCancelAmino): MsgChannelUpgradeCancel { + const message = createBaseMsgChannelUpgradeCancel(); + if (object.port_id !== undefined && object.port_id !== null) { + message.portId = object.port_id; + } + if (object.channel_id !== undefined && object.channel_id !== null) { + message.channelId = object.channel_id; + } + if (object.error_receipt !== undefined && object.error_receipt !== null) { + message.errorReceipt = ErrorReceipt.fromAmino(object.error_receipt); + } + if (object.proof_error_receipt !== undefined && object.proof_error_receipt !== null) { + message.proofErrorReceipt = bytesFromBase64(object.proof_error_receipt); + } + if (object.proof_height !== undefined && object.proof_height !== null) { + message.proofHeight = Height.fromAmino(object.proof_height); + } + if (object.signer !== undefined && object.signer !== null) { + message.signer = object.signer; + } + return message; + }, + toAmino(message: MsgChannelUpgradeCancel): MsgChannelUpgradeCancelAmino { + const obj: any = {}; + obj.port_id = message.portId; + obj.channel_id = message.channelId; + obj.error_receipt = message.errorReceipt ? ErrorReceipt.toAmino(message.errorReceipt) : undefined; + obj.proof_error_receipt = message.proofErrorReceipt ? base64FromBytes(message.proofErrorReceipt) : undefined; + obj.proof_height = message.proofHeight ? Height.toAmino(message.proofHeight) : {}; + obj.signer = message.signer; + return obj; + }, + fromAminoMsg(object: MsgChannelUpgradeCancelAminoMsg): MsgChannelUpgradeCancel { + return MsgChannelUpgradeCancel.fromAmino(object.value); + }, + toAminoMsg(message: MsgChannelUpgradeCancel): MsgChannelUpgradeCancelAminoMsg { + return { + type: "cosmos-sdk/MsgChannelUpgradeCancel", + value: MsgChannelUpgradeCancel.toAmino(message) + }; + }, + fromProtoMsg(message: MsgChannelUpgradeCancelProtoMsg): MsgChannelUpgradeCancel { + return MsgChannelUpgradeCancel.decode(message.value); + }, + toProto(message: MsgChannelUpgradeCancel): Uint8Array { + return MsgChannelUpgradeCancel.encode(message).finish(); + }, + toProtoMsg(message: MsgChannelUpgradeCancel): MsgChannelUpgradeCancelProtoMsg { + return { + typeUrl: "/ibc.core.channel.v1.MsgChannelUpgradeCancel", + value: MsgChannelUpgradeCancel.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgChannelUpgradeCancel.typeUrl, MsgChannelUpgradeCancel); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgChannelUpgradeCancel.aminoType, MsgChannelUpgradeCancel.typeUrl); +function createBaseMsgChannelUpgradeCancelResponse(): MsgChannelUpgradeCancelResponse { + return {}; +} +export const MsgChannelUpgradeCancelResponse = { + typeUrl: "/ibc.core.channel.v1.MsgChannelUpgradeCancelResponse", + aminoType: "cosmos-sdk/MsgChannelUpgradeCancelResponse", + is(o: any): o is MsgChannelUpgradeCancelResponse { + return o && o.$typeUrl === MsgChannelUpgradeCancelResponse.typeUrl; + }, + isSDK(o: any): o is MsgChannelUpgradeCancelResponseSDKType { + return o && o.$typeUrl === MsgChannelUpgradeCancelResponse.typeUrl; + }, + isAmino(o: any): o is MsgChannelUpgradeCancelResponseAmino { + return o && o.$typeUrl === MsgChannelUpgradeCancelResponse.typeUrl; + }, + encode(_: MsgChannelUpgradeCancelResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgChannelUpgradeCancelResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgChannelUpgradeCancelResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(_: any): MsgChannelUpgradeCancelResponse { + return {}; + }, + toJSON(_: MsgChannelUpgradeCancelResponse): unknown { + const obj: any = {}; + return obj; + }, + fromPartial(_: Partial): MsgChannelUpgradeCancelResponse { + const message = createBaseMsgChannelUpgradeCancelResponse(); + return message; + }, + fromAmino(_: MsgChannelUpgradeCancelResponseAmino): MsgChannelUpgradeCancelResponse { + const message = createBaseMsgChannelUpgradeCancelResponse(); + return message; + }, + toAmino(_: MsgChannelUpgradeCancelResponse): MsgChannelUpgradeCancelResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgChannelUpgradeCancelResponseAminoMsg): MsgChannelUpgradeCancelResponse { + return MsgChannelUpgradeCancelResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgChannelUpgradeCancelResponse): MsgChannelUpgradeCancelResponseAminoMsg { + return { + type: "cosmos-sdk/MsgChannelUpgradeCancelResponse", + value: MsgChannelUpgradeCancelResponse.toAmino(message) + }; + }, + fromProtoMsg(message: MsgChannelUpgradeCancelResponseProtoMsg): MsgChannelUpgradeCancelResponse { + return MsgChannelUpgradeCancelResponse.decode(message.value); + }, + toProto(message: MsgChannelUpgradeCancelResponse): Uint8Array { + return MsgChannelUpgradeCancelResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgChannelUpgradeCancelResponse): MsgChannelUpgradeCancelResponseProtoMsg { + return { + typeUrl: "/ibc.core.channel.v1.MsgChannelUpgradeCancelResponse", + value: MsgChannelUpgradeCancelResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgChannelUpgradeCancelResponse.typeUrl, MsgChannelUpgradeCancelResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgChannelUpgradeCancelResponse.aminoType, MsgChannelUpgradeCancelResponse.typeUrl); +function createBaseMsgUpdateParams(): MsgUpdateParams { + return { + authority: "", + params: Params.fromPartial({}) + }; +} +export const MsgUpdateParams = { + typeUrl: "/ibc.core.channel.v1.MsgUpdateParams", + aminoType: "cosmos-sdk/MsgUpdateParams", + is(o: any): o is MsgUpdateParams { + return o && (o.$typeUrl === MsgUpdateParams.typeUrl || typeof o.authority === "string" && Params.is(o.params)); + }, + isSDK(o: any): o is MsgUpdateParamsSDKType { + return o && (o.$typeUrl === MsgUpdateParams.typeUrl || typeof o.authority === "string" && Params.isSDK(o.params)); + }, + isAmino(o: any): o is MsgUpdateParamsAmino { + return o && (o.$typeUrl === MsgUpdateParams.typeUrl || typeof o.authority === "string" && Params.isAmino(o.params)); + }, + encode(message: MsgUpdateParams, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.authority !== "") { + writer.uint32(10).string(message.authority); + } + if (message.params !== undefined) { + Params.encode(message.params, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgUpdateParams { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUpdateParams(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.authority = reader.string(); + break; + case 2: + message.params = Params.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): MsgUpdateParams { + return { + authority: isSet(object.authority) ? String(object.authority) : "", + params: isSet(object.params) ? Params.fromJSON(object.params) : undefined + }; + }, + toJSON(message: MsgUpdateParams): unknown { + const obj: any = {}; + message.authority !== undefined && (obj.authority = message.authority); + message.params !== undefined && (obj.params = message.params ? Params.toJSON(message.params) : undefined); + return obj; + }, + fromPartial(object: Partial): MsgUpdateParams { + const message = createBaseMsgUpdateParams(); + message.authority = object.authority ?? ""; + message.params = object.params !== undefined && object.params !== null ? Params.fromPartial(object.params) : undefined; + return message; + }, + fromAmino(object: MsgUpdateParamsAmino): MsgUpdateParams { + const message = createBaseMsgUpdateParams(); + if (object.authority !== undefined && object.authority !== null) { + message.authority = object.authority; + } + if (object.params !== undefined && object.params !== null) { + message.params = Params.fromAmino(object.params); + } + return message; + }, + toAmino(message: MsgUpdateParams): MsgUpdateParamsAmino { + const obj: any = {}; + obj.authority = message.authority; + obj.params = message.params ? Params.toAmino(message.params) : undefined; + return obj; + }, + fromAminoMsg(object: MsgUpdateParamsAminoMsg): MsgUpdateParams { + return MsgUpdateParams.fromAmino(object.value); + }, + toAminoMsg(message: MsgUpdateParams): MsgUpdateParamsAminoMsg { + return { + type: "cosmos-sdk/MsgUpdateParams", + value: MsgUpdateParams.toAmino(message) + }; + }, + fromProtoMsg(message: MsgUpdateParamsProtoMsg): MsgUpdateParams { + return MsgUpdateParams.decode(message.value); + }, + toProto(message: MsgUpdateParams): Uint8Array { + return MsgUpdateParams.encode(message).finish(); + }, + toProtoMsg(message: MsgUpdateParams): MsgUpdateParamsProtoMsg { + return { + typeUrl: "/ibc.core.channel.v1.MsgUpdateParams", + value: MsgUpdateParams.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgUpdateParams.typeUrl, MsgUpdateParams); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgUpdateParams.aminoType, MsgUpdateParams.typeUrl); +function createBaseMsgUpdateParamsResponse(): MsgUpdateParamsResponse { + return {}; +} +export const MsgUpdateParamsResponse = { + typeUrl: "/ibc.core.channel.v1.MsgUpdateParamsResponse", + aminoType: "cosmos-sdk/MsgUpdateParamsResponse", + is(o: any): o is MsgUpdateParamsResponse { + return o && o.$typeUrl === MsgUpdateParamsResponse.typeUrl; + }, + isSDK(o: any): o is MsgUpdateParamsResponseSDKType { + return o && o.$typeUrl === MsgUpdateParamsResponse.typeUrl; + }, + isAmino(o: any): o is MsgUpdateParamsResponseAmino { + return o && o.$typeUrl === MsgUpdateParamsResponse.typeUrl; + }, + encode(_: MsgUpdateParamsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgUpdateParamsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUpdateParamsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(_: any): MsgUpdateParamsResponse { + return {}; + }, + toJSON(_: MsgUpdateParamsResponse): unknown { + const obj: any = {}; + return obj; + }, + fromPartial(_: Partial): MsgUpdateParamsResponse { + const message = createBaseMsgUpdateParamsResponse(); + return message; + }, + fromAmino(_: MsgUpdateParamsResponseAmino): MsgUpdateParamsResponse { + const message = createBaseMsgUpdateParamsResponse(); + return message; + }, + toAmino(_: MsgUpdateParamsResponse): MsgUpdateParamsResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgUpdateParamsResponseAminoMsg): MsgUpdateParamsResponse { + return MsgUpdateParamsResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgUpdateParamsResponse): MsgUpdateParamsResponseAminoMsg { + return { + type: "cosmos-sdk/MsgUpdateParamsResponse", + value: MsgUpdateParamsResponse.toAmino(message) + }; + }, + fromProtoMsg(message: MsgUpdateParamsResponseProtoMsg): MsgUpdateParamsResponse { + return MsgUpdateParamsResponse.decode(message.value); + }, + toProto(message: MsgUpdateParamsResponse): Uint8Array { + return MsgUpdateParamsResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgUpdateParamsResponse): MsgUpdateParamsResponseProtoMsg { + return { + typeUrl: "/ibc.core.channel.v1.MsgUpdateParamsResponse", + value: MsgUpdateParamsResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgUpdateParamsResponse.typeUrl, MsgUpdateParamsResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgUpdateParamsResponse.aminoType, MsgUpdateParamsResponse.typeUrl); +function createBaseMsgPruneAcknowledgements(): MsgPruneAcknowledgements { + return { + portId: "", + channelId: "", + limit: BigInt(0), + signer: "" + }; +} +export const MsgPruneAcknowledgements = { + typeUrl: "/ibc.core.channel.v1.MsgPruneAcknowledgements", + aminoType: "cosmos-sdk/MsgPruneAcknowledgements", + is(o: any): o is MsgPruneAcknowledgements { + return o && (o.$typeUrl === MsgPruneAcknowledgements.typeUrl || typeof o.portId === "string" && typeof o.channelId === "string" && typeof o.limit === "bigint" && typeof o.signer === "string"); + }, + isSDK(o: any): o is MsgPruneAcknowledgementsSDKType { + return o && (o.$typeUrl === MsgPruneAcknowledgements.typeUrl || typeof o.port_id === "string" && typeof o.channel_id === "string" && typeof o.limit === "bigint" && typeof o.signer === "string"); + }, + isAmino(o: any): o is MsgPruneAcknowledgementsAmino { + return o && (o.$typeUrl === MsgPruneAcknowledgements.typeUrl || typeof o.port_id === "string" && typeof o.channel_id === "string" && typeof o.limit === "bigint" && typeof o.signer === "string"); + }, + encode(message: MsgPruneAcknowledgements, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.portId !== "") { + writer.uint32(10).string(message.portId); + } + if (message.channelId !== "") { + writer.uint32(18).string(message.channelId); + } + if (message.limit !== BigInt(0)) { + writer.uint32(24).uint64(message.limit); + } + if (message.signer !== "") { + writer.uint32(34).string(message.signer); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgPruneAcknowledgements { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgPruneAcknowledgements(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.portId = reader.string(); + break; + case 2: + message.channelId = reader.string(); + break; + case 3: + message.limit = reader.uint64(); + break; + case 4: + message.signer = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): MsgPruneAcknowledgements { + return { + portId: isSet(object.portId) ? String(object.portId) : "", + channelId: isSet(object.channelId) ? String(object.channelId) : "", + limit: isSet(object.limit) ? BigInt(object.limit.toString()) : BigInt(0), + signer: isSet(object.signer) ? String(object.signer) : "" + }; + }, + toJSON(message: MsgPruneAcknowledgements): unknown { + const obj: any = {}; + message.portId !== undefined && (obj.portId = message.portId); + message.channelId !== undefined && (obj.channelId = message.channelId); + message.limit !== undefined && (obj.limit = (message.limit || BigInt(0)).toString()); + message.signer !== undefined && (obj.signer = message.signer); + return obj; + }, + fromPartial(object: Partial): MsgPruneAcknowledgements { + const message = createBaseMsgPruneAcknowledgements(); + message.portId = object.portId ?? ""; + message.channelId = object.channelId ?? ""; + message.limit = object.limit !== undefined && object.limit !== null ? BigInt(object.limit.toString()) : BigInt(0); + message.signer = object.signer ?? ""; + return message; + }, + fromAmino(object: MsgPruneAcknowledgementsAmino): MsgPruneAcknowledgements { + const message = createBaseMsgPruneAcknowledgements(); + if (object.port_id !== undefined && object.port_id !== null) { + message.portId = object.port_id; + } + if (object.channel_id !== undefined && object.channel_id !== null) { + message.channelId = object.channel_id; + } + if (object.limit !== undefined && object.limit !== null) { + message.limit = BigInt(object.limit); + } + if (object.signer !== undefined && object.signer !== null) { + message.signer = object.signer; + } + return message; + }, + toAmino(message: MsgPruneAcknowledgements): MsgPruneAcknowledgementsAmino { + const obj: any = {}; + obj.port_id = message.portId; + obj.channel_id = message.channelId; + obj.limit = message.limit ? message.limit.toString() : undefined; + obj.signer = message.signer; + return obj; + }, + fromAminoMsg(object: MsgPruneAcknowledgementsAminoMsg): MsgPruneAcknowledgements { + return MsgPruneAcknowledgements.fromAmino(object.value); + }, + toAminoMsg(message: MsgPruneAcknowledgements): MsgPruneAcknowledgementsAminoMsg { + return { + type: "cosmos-sdk/MsgPruneAcknowledgements", + value: MsgPruneAcknowledgements.toAmino(message) + }; + }, + fromProtoMsg(message: MsgPruneAcknowledgementsProtoMsg): MsgPruneAcknowledgements { + return MsgPruneAcknowledgements.decode(message.value); + }, + toProto(message: MsgPruneAcknowledgements): Uint8Array { + return MsgPruneAcknowledgements.encode(message).finish(); + }, + toProtoMsg(message: MsgPruneAcknowledgements): MsgPruneAcknowledgementsProtoMsg { + return { + typeUrl: "/ibc.core.channel.v1.MsgPruneAcknowledgements", + value: MsgPruneAcknowledgements.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgPruneAcknowledgements.typeUrl, MsgPruneAcknowledgements); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgPruneAcknowledgements.aminoType, MsgPruneAcknowledgements.typeUrl); +function createBaseMsgPruneAcknowledgementsResponse(): MsgPruneAcknowledgementsResponse { + return { + totalPrunedSequences: BigInt(0), + totalRemainingSequences: BigInt(0) + }; +} +export const MsgPruneAcknowledgementsResponse = { + typeUrl: "/ibc.core.channel.v1.MsgPruneAcknowledgementsResponse", + aminoType: "cosmos-sdk/MsgPruneAcknowledgementsResponse", + is(o: any): o is MsgPruneAcknowledgementsResponse { + return o && (o.$typeUrl === MsgPruneAcknowledgementsResponse.typeUrl || typeof o.totalPrunedSequences === "bigint" && typeof o.totalRemainingSequences === "bigint"); + }, + isSDK(o: any): o is MsgPruneAcknowledgementsResponseSDKType { + return o && (o.$typeUrl === MsgPruneAcknowledgementsResponse.typeUrl || typeof o.total_pruned_sequences === "bigint" && typeof o.total_remaining_sequences === "bigint"); + }, + isAmino(o: any): o is MsgPruneAcknowledgementsResponseAmino { + return o && (o.$typeUrl === MsgPruneAcknowledgementsResponse.typeUrl || typeof o.total_pruned_sequences === "bigint" && typeof o.total_remaining_sequences === "bigint"); + }, + encode(message: MsgPruneAcknowledgementsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.totalPrunedSequences !== BigInt(0)) { + writer.uint32(8).uint64(message.totalPrunedSequences); + } + if (message.totalRemainingSequences !== BigInt(0)) { + writer.uint32(16).uint64(message.totalRemainingSequences); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgPruneAcknowledgementsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgPruneAcknowledgementsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.totalPrunedSequences = reader.uint64(); + break; + case 2: + message.totalRemainingSequences = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): MsgPruneAcknowledgementsResponse { + return { + totalPrunedSequences: isSet(object.totalPrunedSequences) ? BigInt(object.totalPrunedSequences.toString()) : BigInt(0), + totalRemainingSequences: isSet(object.totalRemainingSequences) ? BigInt(object.totalRemainingSequences.toString()) : BigInt(0) + }; + }, + toJSON(message: MsgPruneAcknowledgementsResponse): unknown { + const obj: any = {}; + message.totalPrunedSequences !== undefined && (obj.totalPrunedSequences = (message.totalPrunedSequences || BigInt(0)).toString()); + message.totalRemainingSequences !== undefined && (obj.totalRemainingSequences = (message.totalRemainingSequences || BigInt(0)).toString()); + return obj; + }, + fromPartial(object: Partial): MsgPruneAcknowledgementsResponse { + const message = createBaseMsgPruneAcknowledgementsResponse(); + message.totalPrunedSequences = object.totalPrunedSequences !== undefined && object.totalPrunedSequences !== null ? BigInt(object.totalPrunedSequences.toString()) : BigInt(0); + message.totalRemainingSequences = object.totalRemainingSequences !== undefined && object.totalRemainingSequences !== null ? BigInt(object.totalRemainingSequences.toString()) : BigInt(0); + return message; + }, + fromAmino(object: MsgPruneAcknowledgementsResponseAmino): MsgPruneAcknowledgementsResponse { + const message = createBaseMsgPruneAcknowledgementsResponse(); + if (object.total_pruned_sequences !== undefined && object.total_pruned_sequences !== null) { + message.totalPrunedSequences = BigInt(object.total_pruned_sequences); + } + if (object.total_remaining_sequences !== undefined && object.total_remaining_sequences !== null) { + message.totalRemainingSequences = BigInt(object.total_remaining_sequences); + } + return message; + }, + toAmino(message: MsgPruneAcknowledgementsResponse): MsgPruneAcknowledgementsResponseAmino { + const obj: any = {}; + obj.total_pruned_sequences = message.totalPrunedSequences ? message.totalPrunedSequences.toString() : undefined; + obj.total_remaining_sequences = message.totalRemainingSequences ? message.totalRemainingSequences.toString() : undefined; + return obj; + }, + fromAminoMsg(object: MsgPruneAcknowledgementsResponseAminoMsg): MsgPruneAcknowledgementsResponse { + return MsgPruneAcknowledgementsResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgPruneAcknowledgementsResponse): MsgPruneAcknowledgementsResponseAminoMsg { + return { + type: "cosmos-sdk/MsgPruneAcknowledgementsResponse", + value: MsgPruneAcknowledgementsResponse.toAmino(message) + }; + }, + fromProtoMsg(message: MsgPruneAcknowledgementsResponseProtoMsg): MsgPruneAcknowledgementsResponse { + return MsgPruneAcknowledgementsResponse.decode(message.value); + }, + toProto(message: MsgPruneAcknowledgementsResponse): Uint8Array { + return MsgPruneAcknowledgementsResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgPruneAcknowledgementsResponse): MsgPruneAcknowledgementsResponseProtoMsg { + return { + typeUrl: "/ibc.core.channel.v1.MsgPruneAcknowledgementsResponse", + value: MsgPruneAcknowledgementsResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgPruneAcknowledgementsResponse.typeUrl, MsgPruneAcknowledgementsResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgPruneAcknowledgementsResponse.aminoType, MsgPruneAcknowledgementsResponse.typeUrl); \ No newline at end of file diff --git a/packages/osmojs/src/codegen/ibc/core/channel/v1/upgrade.ts b/packages/osmojs/src/codegen/ibc/core/channel/v1/upgrade.ts new file mode 100644 index 000000000..716b8b30c --- /dev/null +++ b/packages/osmojs/src/codegen/ibc/core/channel/v1/upgrade.ts @@ -0,0 +1,471 @@ +import { Timeout, TimeoutAmino, TimeoutSDKType, Order, orderFromJSON, orderToJSON } from "./channel"; +import { BinaryReader, BinaryWriter } from "../../../../binary"; +import { isSet } from "../../../../helpers"; +import { GlobalDecoderRegistry } from "../../../../registry"; +/** + * Upgrade is a verifiable type which contains the relevant information + * for an attempted upgrade. It provides the proposed changes to the channel + * end, the timeout for this upgrade attempt and the next packet sequence + * which allows the counterparty to efficiently know the highest sequence it has received. + * The next sequence send is used for pruning and upgrading from unordered to ordered channels. + */ +export interface Upgrade { + fields: UpgradeFields; + timeout: Timeout; + nextSequenceSend: bigint; +} +export interface UpgradeProtoMsg { + typeUrl: "/ibc.core.channel.v1.Upgrade"; + value: Uint8Array; +} +/** + * Upgrade is a verifiable type which contains the relevant information + * for an attempted upgrade. It provides the proposed changes to the channel + * end, the timeout for this upgrade attempt and the next packet sequence + * which allows the counterparty to efficiently know the highest sequence it has received. + * The next sequence send is used for pruning and upgrading from unordered to ordered channels. + */ +export interface UpgradeAmino { + fields?: UpgradeFieldsAmino; + timeout?: TimeoutAmino; + next_sequence_send?: string; +} +export interface UpgradeAminoMsg { + type: "cosmos-sdk/Upgrade"; + value: UpgradeAmino; +} +/** + * Upgrade is a verifiable type which contains the relevant information + * for an attempted upgrade. It provides the proposed changes to the channel + * end, the timeout for this upgrade attempt and the next packet sequence + * which allows the counterparty to efficiently know the highest sequence it has received. + * The next sequence send is used for pruning and upgrading from unordered to ordered channels. + */ +export interface UpgradeSDKType { + fields: UpgradeFieldsSDKType; + timeout: TimeoutSDKType; + next_sequence_send: bigint; +} +/** + * UpgradeFields are the fields in a channel end which may be changed + * during a channel upgrade. + */ +export interface UpgradeFields { + ordering: Order; + connectionHops: string[]; + version: string; +} +export interface UpgradeFieldsProtoMsg { + typeUrl: "/ibc.core.channel.v1.UpgradeFields"; + value: Uint8Array; +} +/** + * UpgradeFields are the fields in a channel end which may be changed + * during a channel upgrade. + */ +export interface UpgradeFieldsAmino { + ordering?: Order; + connection_hops?: string[]; + version?: string; +} +export interface UpgradeFieldsAminoMsg { + type: "cosmos-sdk/UpgradeFields"; + value: UpgradeFieldsAmino; +} +/** + * UpgradeFields are the fields in a channel end which may be changed + * during a channel upgrade. + */ +export interface UpgradeFieldsSDKType { + ordering: Order; + connection_hops: string[]; + version: string; +} +/** + * ErrorReceipt defines a type which encapsulates the upgrade sequence and error associated with the + * upgrade handshake failure. When a channel upgrade handshake is aborted both chains are expected to increment to the + * next sequence. + */ +export interface ErrorReceipt { + /** the channel upgrade sequence */ + sequence: bigint; + /** the error message detailing the cause of failure */ + message: string; +} +export interface ErrorReceiptProtoMsg { + typeUrl: "/ibc.core.channel.v1.ErrorReceipt"; + value: Uint8Array; +} +/** + * ErrorReceipt defines a type which encapsulates the upgrade sequence and error associated with the + * upgrade handshake failure. When a channel upgrade handshake is aborted both chains are expected to increment to the + * next sequence. + */ +export interface ErrorReceiptAmino { + /** the channel upgrade sequence */ + sequence?: string; + /** the error message detailing the cause of failure */ + message?: string; +} +export interface ErrorReceiptAminoMsg { + type: "cosmos-sdk/ErrorReceipt"; + value: ErrorReceiptAmino; +} +/** + * ErrorReceipt defines a type which encapsulates the upgrade sequence and error associated with the + * upgrade handshake failure. When a channel upgrade handshake is aborted both chains are expected to increment to the + * next sequence. + */ +export interface ErrorReceiptSDKType { + sequence: bigint; + message: string; +} +function createBaseUpgrade(): Upgrade { + return { + fields: UpgradeFields.fromPartial({}), + timeout: Timeout.fromPartial({}), + nextSequenceSend: BigInt(0) + }; +} +export const Upgrade = { + typeUrl: "/ibc.core.channel.v1.Upgrade", + aminoType: "cosmos-sdk/Upgrade", + is(o: any): o is Upgrade { + return o && (o.$typeUrl === Upgrade.typeUrl || UpgradeFields.is(o.fields) && Timeout.is(o.timeout) && typeof o.nextSequenceSend === "bigint"); + }, + isSDK(o: any): o is UpgradeSDKType { + return o && (o.$typeUrl === Upgrade.typeUrl || UpgradeFields.isSDK(o.fields) && Timeout.isSDK(o.timeout) && typeof o.next_sequence_send === "bigint"); + }, + isAmino(o: any): o is UpgradeAmino { + return o && (o.$typeUrl === Upgrade.typeUrl || UpgradeFields.isAmino(o.fields) && Timeout.isAmino(o.timeout) && typeof o.next_sequence_send === "bigint"); + }, + encode(message: Upgrade, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.fields !== undefined) { + UpgradeFields.encode(message.fields, writer.uint32(10).fork()).ldelim(); + } + if (message.timeout !== undefined) { + Timeout.encode(message.timeout, writer.uint32(18).fork()).ldelim(); + } + if (message.nextSequenceSend !== BigInt(0)) { + writer.uint32(24).uint64(message.nextSequenceSend); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): Upgrade { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseUpgrade(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.fields = UpgradeFields.decode(reader, reader.uint32()); + break; + case 2: + message.timeout = Timeout.decode(reader, reader.uint32()); + break; + case 3: + message.nextSequenceSend = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): Upgrade { + return { + fields: isSet(object.fields) ? UpgradeFields.fromJSON(object.fields) : undefined, + timeout: isSet(object.timeout) ? Timeout.fromJSON(object.timeout) : undefined, + nextSequenceSend: isSet(object.nextSequenceSend) ? BigInt(object.nextSequenceSend.toString()) : BigInt(0) + }; + }, + toJSON(message: Upgrade): unknown { + const obj: any = {}; + message.fields !== undefined && (obj.fields = message.fields ? UpgradeFields.toJSON(message.fields) : undefined); + message.timeout !== undefined && (obj.timeout = message.timeout ? Timeout.toJSON(message.timeout) : undefined); + message.nextSequenceSend !== undefined && (obj.nextSequenceSend = (message.nextSequenceSend || BigInt(0)).toString()); + return obj; + }, + fromPartial(object: Partial): Upgrade { + const message = createBaseUpgrade(); + message.fields = object.fields !== undefined && object.fields !== null ? UpgradeFields.fromPartial(object.fields) : undefined; + message.timeout = object.timeout !== undefined && object.timeout !== null ? Timeout.fromPartial(object.timeout) : undefined; + message.nextSequenceSend = object.nextSequenceSend !== undefined && object.nextSequenceSend !== null ? BigInt(object.nextSequenceSend.toString()) : BigInt(0); + return message; + }, + fromAmino(object: UpgradeAmino): Upgrade { + const message = createBaseUpgrade(); + if (object.fields !== undefined && object.fields !== null) { + message.fields = UpgradeFields.fromAmino(object.fields); + } + if (object.timeout !== undefined && object.timeout !== null) { + message.timeout = Timeout.fromAmino(object.timeout); + } + if (object.next_sequence_send !== undefined && object.next_sequence_send !== null) { + message.nextSequenceSend = BigInt(object.next_sequence_send); + } + return message; + }, + toAmino(message: Upgrade): UpgradeAmino { + const obj: any = {}; + obj.fields = message.fields ? UpgradeFields.toAmino(message.fields) : undefined; + obj.timeout = message.timeout ? Timeout.toAmino(message.timeout) : undefined; + obj.next_sequence_send = message.nextSequenceSend ? message.nextSequenceSend.toString() : undefined; + return obj; + }, + fromAminoMsg(object: UpgradeAminoMsg): Upgrade { + return Upgrade.fromAmino(object.value); + }, + toAminoMsg(message: Upgrade): UpgradeAminoMsg { + return { + type: "cosmos-sdk/Upgrade", + value: Upgrade.toAmino(message) + }; + }, + fromProtoMsg(message: UpgradeProtoMsg): Upgrade { + return Upgrade.decode(message.value); + }, + toProto(message: Upgrade): Uint8Array { + return Upgrade.encode(message).finish(); + }, + toProtoMsg(message: Upgrade): UpgradeProtoMsg { + return { + typeUrl: "/ibc.core.channel.v1.Upgrade", + value: Upgrade.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(Upgrade.typeUrl, Upgrade); +GlobalDecoderRegistry.registerAminoProtoMapping(Upgrade.aminoType, Upgrade.typeUrl); +function createBaseUpgradeFields(): UpgradeFields { + return { + ordering: 0, + connectionHops: [], + version: "" + }; +} +export const UpgradeFields = { + typeUrl: "/ibc.core.channel.v1.UpgradeFields", + aminoType: "cosmos-sdk/UpgradeFields", + is(o: any): o is UpgradeFields { + return o && (o.$typeUrl === UpgradeFields.typeUrl || isSet(o.ordering) && Array.isArray(o.connectionHops) && (!o.connectionHops.length || typeof o.connectionHops[0] === "string") && typeof o.version === "string"); + }, + isSDK(o: any): o is UpgradeFieldsSDKType { + return o && (o.$typeUrl === UpgradeFields.typeUrl || isSet(o.ordering) && Array.isArray(o.connection_hops) && (!o.connection_hops.length || typeof o.connection_hops[0] === "string") && typeof o.version === "string"); + }, + isAmino(o: any): o is UpgradeFieldsAmino { + return o && (o.$typeUrl === UpgradeFields.typeUrl || isSet(o.ordering) && Array.isArray(o.connection_hops) && (!o.connection_hops.length || typeof o.connection_hops[0] === "string") && typeof o.version === "string"); + }, + encode(message: UpgradeFields, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.ordering !== 0) { + writer.uint32(8).int32(message.ordering); + } + for (const v of message.connectionHops) { + writer.uint32(18).string(v!); + } + if (message.version !== "") { + writer.uint32(26).string(message.version); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): UpgradeFields { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseUpgradeFields(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.ordering = (reader.int32() as any); + break; + case 2: + message.connectionHops.push(reader.string()); + break; + case 3: + message.version = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): UpgradeFields { + return { + ordering: isSet(object.ordering) ? orderFromJSON(object.ordering) : -1, + connectionHops: Array.isArray(object?.connectionHops) ? object.connectionHops.map((e: any) => String(e)) : [], + version: isSet(object.version) ? String(object.version) : "" + }; + }, + toJSON(message: UpgradeFields): unknown { + const obj: any = {}; + message.ordering !== undefined && (obj.ordering = orderToJSON(message.ordering)); + if (message.connectionHops) { + obj.connectionHops = message.connectionHops.map(e => e); + } else { + obj.connectionHops = []; + } + message.version !== undefined && (obj.version = message.version); + return obj; + }, + fromPartial(object: Partial): UpgradeFields { + const message = createBaseUpgradeFields(); + message.ordering = object.ordering ?? 0; + message.connectionHops = object.connectionHops?.map(e => e) || []; + message.version = object.version ?? ""; + return message; + }, + fromAmino(object: UpgradeFieldsAmino): UpgradeFields { + const message = createBaseUpgradeFields(); + if (object.ordering !== undefined && object.ordering !== null) { + message.ordering = orderFromJSON(object.ordering); + } + message.connectionHops = object.connection_hops?.map(e => e) || []; + if (object.version !== undefined && object.version !== null) { + message.version = object.version; + } + return message; + }, + toAmino(message: UpgradeFields): UpgradeFieldsAmino { + const obj: any = {}; + obj.ordering = orderToJSON(message.ordering); + if (message.connectionHops) { + obj.connection_hops = message.connectionHops.map(e => e); + } else { + obj.connection_hops = []; + } + obj.version = message.version; + return obj; + }, + fromAminoMsg(object: UpgradeFieldsAminoMsg): UpgradeFields { + return UpgradeFields.fromAmino(object.value); + }, + toAminoMsg(message: UpgradeFields): UpgradeFieldsAminoMsg { + return { + type: "cosmos-sdk/UpgradeFields", + value: UpgradeFields.toAmino(message) + }; + }, + fromProtoMsg(message: UpgradeFieldsProtoMsg): UpgradeFields { + return UpgradeFields.decode(message.value); + }, + toProto(message: UpgradeFields): Uint8Array { + return UpgradeFields.encode(message).finish(); + }, + toProtoMsg(message: UpgradeFields): UpgradeFieldsProtoMsg { + return { + typeUrl: "/ibc.core.channel.v1.UpgradeFields", + value: UpgradeFields.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(UpgradeFields.typeUrl, UpgradeFields); +GlobalDecoderRegistry.registerAminoProtoMapping(UpgradeFields.aminoType, UpgradeFields.typeUrl); +function createBaseErrorReceipt(): ErrorReceipt { + return { + sequence: BigInt(0), + message: "" + }; +} +export const ErrorReceipt = { + typeUrl: "/ibc.core.channel.v1.ErrorReceipt", + aminoType: "cosmos-sdk/ErrorReceipt", + is(o: any): o is ErrorReceipt { + return o && (o.$typeUrl === ErrorReceipt.typeUrl || typeof o.sequence === "bigint" && typeof o.message === "string"); + }, + isSDK(o: any): o is ErrorReceiptSDKType { + return o && (o.$typeUrl === ErrorReceipt.typeUrl || typeof o.sequence === "bigint" && typeof o.message === "string"); + }, + isAmino(o: any): o is ErrorReceiptAmino { + return o && (o.$typeUrl === ErrorReceipt.typeUrl || typeof o.sequence === "bigint" && typeof o.message === "string"); + }, + encode(message: ErrorReceipt, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.sequence !== BigInt(0)) { + writer.uint32(8).uint64(message.sequence); + } + if (message.message !== "") { + writer.uint32(18).string(message.message); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): ErrorReceipt { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseErrorReceipt(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.sequence = reader.uint64(); + break; + case 2: + message.message = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): ErrorReceipt { + return { + sequence: isSet(object.sequence) ? BigInt(object.sequence.toString()) : BigInt(0), + message: isSet(object.message) ? String(object.message) : "" + }; + }, + toJSON(message: ErrorReceipt): unknown { + const obj: any = {}; + message.sequence !== undefined && (obj.sequence = (message.sequence || BigInt(0)).toString()); + message.message !== undefined && (obj.message = message.message); + return obj; + }, + fromPartial(object: Partial): ErrorReceipt { + const message = createBaseErrorReceipt(); + message.sequence = object.sequence !== undefined && object.sequence !== null ? BigInt(object.sequence.toString()) : BigInt(0); + message.message = object.message ?? ""; + return message; + }, + fromAmino(object: ErrorReceiptAmino): ErrorReceipt { + const message = createBaseErrorReceipt(); + if (object.sequence !== undefined && object.sequence !== null) { + message.sequence = BigInt(object.sequence); + } + if (object.message !== undefined && object.message !== null) { + message.message = object.message; + } + return message; + }, + toAmino(message: ErrorReceipt): ErrorReceiptAmino { + const obj: any = {}; + obj.sequence = message.sequence ? message.sequence.toString() : undefined; + obj.message = message.message; + return obj; + }, + fromAminoMsg(object: ErrorReceiptAminoMsg): ErrorReceipt { + return ErrorReceipt.fromAmino(object.value); + }, + toAminoMsg(message: ErrorReceipt): ErrorReceiptAminoMsg { + return { + type: "cosmos-sdk/ErrorReceipt", + value: ErrorReceipt.toAmino(message) + }; + }, + fromProtoMsg(message: ErrorReceiptProtoMsg): ErrorReceipt { + return ErrorReceipt.decode(message.value); + }, + toProto(message: ErrorReceipt): Uint8Array { + return ErrorReceipt.encode(message).finish(); + }, + toProtoMsg(message: ErrorReceipt): ErrorReceiptProtoMsg { + return { + typeUrl: "/ibc.core.channel.v1.ErrorReceipt", + value: ErrorReceipt.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(ErrorReceipt.typeUrl, ErrorReceipt); +GlobalDecoderRegistry.registerAminoProtoMapping(ErrorReceipt.aminoType, ErrorReceipt.typeUrl); \ No newline at end of file diff --git a/packages/osmojs/src/codegen/ibc/core/client/v1/client.ts b/packages/osmojs/src/codegen/ibc/core/client/v1/client.ts index 203cd359b..1e15e8e63 100644 --- a/packages/osmojs/src/codegen/ibc/core/client/v1/client.ts +++ b/packages/osmojs/src/codegen/ibc/core/client/v1/client.ts @@ -1,6 +1,8 @@ import { Any, AnyAmino, AnySDKType } from "../../../../google/protobuf/any"; import { Plan, PlanAmino, PlanSDKType } from "../../../../cosmos/upgrade/v1beta1/upgrade"; import { BinaryReader, BinaryWriter } from "../../../../binary"; +import { isSet } from "../../../../helpers"; +import { GlobalDecoderRegistry } from "../../../../registry"; /** * IdentifiedClientState defines a client state with an additional client * identifier field. @@ -9,7 +11,7 @@ export interface IdentifiedClientState { /** client identifier */ clientId: string; /** client state */ - clientState: Any; + clientState?: Any; } export interface IdentifiedClientStateProtoMsg { typeUrl: "/ibc.core.client.v1.IdentifiedClientState"; @@ -21,7 +23,7 @@ export interface IdentifiedClientStateProtoMsg { */ export interface IdentifiedClientStateAmino { /** client identifier */ - client_id: string; + client_id?: string; /** client state */ client_state?: AnyAmino; } @@ -35,7 +37,7 @@ export interface IdentifiedClientStateAminoMsg { */ export interface IdentifiedClientStateSDKType { client_id: string; - client_state: AnySDKType; + client_state?: AnySDKType; } /** * ConsensusStateWithHeight defines a consensus state with an additional height @@ -45,7 +47,7 @@ export interface ConsensusStateWithHeight { /** consensus state height */ height: Height; /** consensus state */ - consensusState: Any; + consensusState?: Any; } export interface ConsensusStateWithHeightProtoMsg { typeUrl: "/ibc.core.client.v1.ConsensusStateWithHeight"; @@ -71,7 +73,7 @@ export interface ConsensusStateWithHeightAminoMsg { */ export interface ConsensusStateWithHeightSDKType { height: HeightSDKType; - consensus_state: AnySDKType; + consensus_state?: AnySDKType; } /** * ClientConsensusStates defines all the stored consensus states for a given @@ -93,9 +95,9 @@ export interface ClientConsensusStatesProtoMsg { */ export interface ClientConsensusStatesAmino { /** client identifier */ - client_id: string; + client_id?: string; /** consensus states and their heights associated with the client */ - consensus_states: ConsensusStateWithHeightAmino[]; + consensus_states?: ConsensusStateWithHeightAmino[]; } export interface ClientConsensusStatesAminoMsg { type: "cosmos-sdk/ClientConsensusStates"; @@ -110,13 +112,106 @@ export interface ClientConsensusStatesSDKType { consensus_states: ConsensusStateWithHeightSDKType[]; } /** - * ClientUpdateProposal is a governance proposal. If it passes, the substitute + * Height is a monotonically increasing data type + * that can be compared against another Height for the purposes of updating and + * freezing clients + * + * Normally the RevisionHeight is incremented at each height while keeping + * RevisionNumber the same. However some consensus algorithms may choose to + * reset the height in certain conditions e.g. hard forks, state-machine + * breaking changes In these cases, the RevisionNumber is incremented so that + * height continues to be monitonically increasing even as the RevisionHeight + * gets reset + */ +export interface Height { + /** the revision that the client is currently on */ + revisionNumber: bigint; + /** the height within the given revision */ + revisionHeight: bigint; +} +export interface HeightProtoMsg { + typeUrl: "/ibc.core.client.v1.Height"; + value: Uint8Array; +} +/** + * Height is a monotonically increasing data type + * that can be compared against another Height for the purposes of updating and + * freezing clients + * + * Normally the RevisionHeight is incremented at each height while keeping + * RevisionNumber the same. However some consensus algorithms may choose to + * reset the height in certain conditions e.g. hard forks, state-machine + * breaking changes In these cases, the RevisionNumber is incremented so that + * height continues to be monitonically increasing even as the RevisionHeight + * gets reset + */ +export interface HeightAmino { + /** the revision that the client is currently on */ + revision_number?: string; + /** the height within the given revision */ + revision_height?: string; +} +export interface HeightAminoMsg { + type: "cosmos-sdk/Height"; + value: HeightAmino; +} +/** + * Height is a monotonically increasing data type + * that can be compared against another Height for the purposes of updating and + * freezing clients + * + * Normally the RevisionHeight is incremented at each height while keeping + * RevisionNumber the same. However some consensus algorithms may choose to + * reset the height in certain conditions e.g. hard forks, state-machine + * breaking changes In these cases, the RevisionNumber is incremented so that + * height continues to be monitonically increasing even as the RevisionHeight + * gets reset + */ +export interface HeightSDKType { + revision_number: bigint; + revision_height: bigint; +} +/** Params defines the set of IBC light client parameters. */ +export interface Params { + /** + * allowed_clients defines the list of allowed client state types which can be created + * and interacted with. If a client type is removed from the allowed clients list, usage + * of this client will be disabled until it is added again to the list. + */ + allowedClients: string[]; +} +export interface ParamsProtoMsg { + typeUrl: "/ibc.core.client.v1.Params"; + value: Uint8Array; +} +/** Params defines the set of IBC light client parameters. */ +export interface ParamsAmino { + /** + * allowed_clients defines the list of allowed client state types which can be created + * and interacted with. If a client type is removed from the allowed clients list, usage + * of this client will be disabled until it is added again to the list. + */ + allowed_clients?: string[]; +} +export interface ParamsAminoMsg { + type: "cosmos-sdk/Params"; + value: ParamsAmino; +} +/** Params defines the set of IBC light client parameters. */ +export interface ParamsSDKType { + allowed_clients: string[]; +} +/** + * ClientUpdateProposal is a legacy governance proposal. If it passes, the substitute * client's latest consensus state is copied over to the subject client. The proposal * handler may fail if the subject and the substitute do not match in client and * chain parameters (with exception to latest height, frozen height, and chain-id). + * + * Deprecated: Please use MsgRecoverClient in favour of this message type. */ +/** @deprecated */ export interface ClientUpdateProposal { - $typeUrl?: string; + $typeUrl?: "/ibc.core.client.v1.ClientUpdateProposal"; /** the title of the update proposal */ title: string; /** the description of the proposal */ @@ -134,36 +229,42 @@ export interface ClientUpdateProposalProtoMsg { value: Uint8Array; } /** - * ClientUpdateProposal is a governance proposal. If it passes, the substitute + * ClientUpdateProposal is a legacy governance proposal. If it passes, the substitute * client's latest consensus state is copied over to the subject client. The proposal * handler may fail if the subject and the substitute do not match in client and * chain parameters (with exception to latest height, frozen height, and chain-id). + * + * Deprecated: Please use MsgRecoverClient in favour of this message type. */ +/** @deprecated */ export interface ClientUpdateProposalAmino { /** the title of the update proposal */ - title: string; + title?: string; /** the description of the proposal */ - description: string; + description?: string; /** the client identifier for the client to be updated if the proposal passes */ - subject_client_id: string; + subject_client_id?: string; /** * the substitute client identifier for the client standing in for the subject * client */ - substitute_client_id: string; + substitute_client_id?: string; } export interface ClientUpdateProposalAminoMsg { type: "cosmos-sdk/ClientUpdateProposal"; value: ClientUpdateProposalAmino; } /** - * ClientUpdateProposal is a governance proposal. If it passes, the substitute + * ClientUpdateProposal is a legacy governance proposal. If it passes, the substitute * client's latest consensus state is copied over to the subject client. The proposal * handler may fail if the subject and the substitute do not match in client and * chain parameters (with exception to latest height, frozen height, and chain-id). + * + * Deprecated: Please use MsgRecoverClient in favour of this message type. */ +/** @deprecated */ export interface ClientUpdateProposalSDKType { - $typeUrl?: string; + $typeUrl?: "/ibc.core.client.v1.ClientUpdateProposal"; title: string; description: string; subject_client_id: string; @@ -172,9 +273,12 @@ export interface ClientUpdateProposalSDKType { /** * UpgradeProposal is a gov Content type for initiating an IBC breaking * upgrade. + * + * Deprecated: Please use MsgIBCSoftwareUpgrade in favour of this message type. */ +/** @deprecated */ export interface UpgradeProposal { - $typeUrl?: string; + $typeUrl?: "/ibc.core.client.v1.UpgradeProposal"; title: string; description: string; plan: Plan; @@ -186,7 +290,7 @@ export interface UpgradeProposal { * of the chain. This will allow IBC connections to persist smoothly across * planned chain upgrades */ - upgradedClientState: Any; + upgradedClientState?: Any; } export interface UpgradeProposalProtoMsg { typeUrl: "/ibc.core.client.v1.UpgradeProposal"; @@ -195,10 +299,13 @@ export interface UpgradeProposalProtoMsg { /** * UpgradeProposal is a gov Content type for initiating an IBC breaking * upgrade. + * + * Deprecated: Please use MsgIBCSoftwareUpgrade in favour of this message type. */ +/** @deprecated */ export interface UpgradeProposalAmino { - title: string; - description: string; + title?: string; + description?: string; plan?: PlanAmino; /** * An UpgradedClientState must be provided to perform an IBC breaking upgrade. @@ -217,103 +324,16 @@ export interface UpgradeProposalAminoMsg { /** * UpgradeProposal is a gov Content type for initiating an IBC breaking * upgrade. + * + * Deprecated: Please use MsgIBCSoftwareUpgrade in favour of this message type. */ +/** @deprecated */ export interface UpgradeProposalSDKType { - $typeUrl?: string; + $typeUrl?: "/ibc.core.client.v1.UpgradeProposal"; title: string; description: string; plan: PlanSDKType; - upgraded_client_state: AnySDKType; -} -/** - * Height is a monotonically increasing data type - * that can be compared against another Height for the purposes of updating and - * freezing clients - * - * Normally the RevisionHeight is incremented at each height while keeping - * RevisionNumber the same. However some consensus algorithms may choose to - * reset the height in certain conditions e.g. hard forks, state-machine - * breaking changes In these cases, the RevisionNumber is incremented so that - * height continues to be monitonically increasing even as the RevisionHeight - * gets reset - */ -export interface Height { - /** the revision that the client is currently on */ - revisionNumber: bigint; - /** the height within the given revision */ - revisionHeight: bigint; -} -export interface HeightProtoMsg { - typeUrl: "/ibc.core.client.v1.Height"; - value: Uint8Array; -} -/** - * Height is a monotonically increasing data type - * that can be compared against another Height for the purposes of updating and - * freezing clients - * - * Normally the RevisionHeight is incremented at each height while keeping - * RevisionNumber the same. However some consensus algorithms may choose to - * reset the height in certain conditions e.g. hard forks, state-machine - * breaking changes In these cases, the RevisionNumber is incremented so that - * height continues to be monitonically increasing even as the RevisionHeight - * gets reset - */ -export interface HeightAmino { - /** the revision that the client is currently on */ - revision_number: string; - /** the height within the given revision */ - revision_height: string; -} -export interface HeightAminoMsg { - type: "cosmos-sdk/Height"; - value: HeightAmino; -} -/** - * Height is a monotonically increasing data type - * that can be compared against another Height for the purposes of updating and - * freezing clients - * - * Normally the RevisionHeight is incremented at each height while keeping - * RevisionNumber the same. However some consensus algorithms may choose to - * reset the height in certain conditions e.g. hard forks, state-machine - * breaking changes In these cases, the RevisionNumber is incremented so that - * height continues to be monitonically increasing even as the RevisionHeight - * gets reset - */ -export interface HeightSDKType { - revision_number: bigint; - revision_height: bigint; -} -/** Params defines the set of IBC light client parameters. */ -export interface Params { - /** - * allowed_clients defines the list of allowed client state types which can be created - * and interacted with. If a client type is removed from the allowed clients list, usage - * of this client will be disabled until it is added again to the list. - */ - allowedClients: string[]; -} -export interface ParamsProtoMsg { - typeUrl: "/ibc.core.client.v1.Params"; - value: Uint8Array; -} -/** Params defines the set of IBC light client parameters. */ -export interface ParamsAmino { - /** - * allowed_clients defines the list of allowed client state types which can be created - * and interacted with. If a client type is removed from the allowed clients list, usage - * of this client will be disabled until it is added again to the list. - */ - allowed_clients: string[]; -} -export interface ParamsAminoMsg { - type: "cosmos-sdk/Params"; - value: ParamsAmino; -} -/** Params defines the set of IBC light client parameters. */ -export interface ParamsSDKType { - allowed_clients: string[]; + upgraded_client_state?: AnySDKType; } function createBaseIdentifiedClientState(): IdentifiedClientState { return { @@ -323,6 +343,16 @@ function createBaseIdentifiedClientState(): IdentifiedClientState { } export const IdentifiedClientState = { typeUrl: "/ibc.core.client.v1.IdentifiedClientState", + aminoType: "cosmos-sdk/IdentifiedClientState", + is(o: any): o is IdentifiedClientState { + return o && (o.$typeUrl === IdentifiedClientState.typeUrl || typeof o.clientId === "string"); + }, + isSDK(o: any): o is IdentifiedClientStateSDKType { + return o && (o.$typeUrl === IdentifiedClientState.typeUrl || typeof o.client_id === "string"); + }, + isAmino(o: any): o is IdentifiedClientStateAmino { + return o && (o.$typeUrl === IdentifiedClientState.typeUrl || typeof o.client_id === "string"); + }, encode(message: IdentifiedClientState, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.clientId !== "") { writer.uint32(10).string(message.clientId); @@ -352,6 +382,18 @@ export const IdentifiedClientState = { } return message; }, + fromJSON(object: any): IdentifiedClientState { + return { + clientId: isSet(object.clientId) ? String(object.clientId) : "", + clientState: isSet(object.clientState) ? Any.fromJSON(object.clientState) : undefined + }; + }, + toJSON(message: IdentifiedClientState): unknown { + const obj: any = {}; + message.clientId !== undefined && (obj.clientId = message.clientId); + message.clientState !== undefined && (obj.clientState = message.clientState ? Any.toJSON(message.clientState) : undefined); + return obj; + }, fromPartial(object: Partial): IdentifiedClientState { const message = createBaseIdentifiedClientState(); message.clientId = object.clientId ?? ""; @@ -359,10 +401,14 @@ export const IdentifiedClientState = { return message; }, fromAmino(object: IdentifiedClientStateAmino): IdentifiedClientState { - return { - clientId: object.client_id, - clientState: object?.client_state ? Any.fromAmino(object.client_state) : undefined - }; + const message = createBaseIdentifiedClientState(); + if (object.client_id !== undefined && object.client_id !== null) { + message.clientId = object.client_id; + } + if (object.client_state !== undefined && object.client_state !== null) { + message.clientState = Any.fromAmino(object.client_state); + } + return message; }, toAmino(message: IdentifiedClientState): IdentifiedClientStateAmino { const obj: any = {}; @@ -392,6 +438,8 @@ export const IdentifiedClientState = { }; } }; +GlobalDecoderRegistry.register(IdentifiedClientState.typeUrl, IdentifiedClientState); +GlobalDecoderRegistry.registerAminoProtoMapping(IdentifiedClientState.aminoType, IdentifiedClientState.typeUrl); function createBaseConsensusStateWithHeight(): ConsensusStateWithHeight { return { height: Height.fromPartial({}), @@ -400,6 +448,16 @@ function createBaseConsensusStateWithHeight(): ConsensusStateWithHeight { } export const ConsensusStateWithHeight = { typeUrl: "/ibc.core.client.v1.ConsensusStateWithHeight", + aminoType: "cosmos-sdk/ConsensusStateWithHeight", + is(o: any): o is ConsensusStateWithHeight { + return o && (o.$typeUrl === ConsensusStateWithHeight.typeUrl || Height.is(o.height)); + }, + isSDK(o: any): o is ConsensusStateWithHeightSDKType { + return o && (o.$typeUrl === ConsensusStateWithHeight.typeUrl || Height.isSDK(o.height)); + }, + isAmino(o: any): o is ConsensusStateWithHeightAmino { + return o && (o.$typeUrl === ConsensusStateWithHeight.typeUrl || Height.isAmino(o.height)); + }, encode(message: ConsensusStateWithHeight, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.height !== undefined) { Height.encode(message.height, writer.uint32(10).fork()).ldelim(); @@ -429,6 +487,18 @@ export const ConsensusStateWithHeight = { } return message; }, + fromJSON(object: any): ConsensusStateWithHeight { + return { + height: isSet(object.height) ? Height.fromJSON(object.height) : undefined, + consensusState: isSet(object.consensusState) ? Any.fromJSON(object.consensusState) : undefined + }; + }, + toJSON(message: ConsensusStateWithHeight): unknown { + const obj: any = {}; + message.height !== undefined && (obj.height = message.height ? Height.toJSON(message.height) : undefined); + message.consensusState !== undefined && (obj.consensusState = message.consensusState ? Any.toJSON(message.consensusState) : undefined); + return obj; + }, fromPartial(object: Partial): ConsensusStateWithHeight { const message = createBaseConsensusStateWithHeight(); message.height = object.height !== undefined && object.height !== null ? Height.fromPartial(object.height) : undefined; @@ -436,10 +506,14 @@ export const ConsensusStateWithHeight = { return message; }, fromAmino(object: ConsensusStateWithHeightAmino): ConsensusStateWithHeight { - return { - height: object?.height ? Height.fromAmino(object.height) : undefined, - consensusState: object?.consensus_state ? Any.fromAmino(object.consensus_state) : undefined - }; + const message = createBaseConsensusStateWithHeight(); + if (object.height !== undefined && object.height !== null) { + message.height = Height.fromAmino(object.height); + } + if (object.consensus_state !== undefined && object.consensus_state !== null) { + message.consensusState = Any.fromAmino(object.consensus_state); + } + return message; }, toAmino(message: ConsensusStateWithHeight): ConsensusStateWithHeightAmino { const obj: any = {}; @@ -469,6 +543,8 @@ export const ConsensusStateWithHeight = { }; } }; +GlobalDecoderRegistry.register(ConsensusStateWithHeight.typeUrl, ConsensusStateWithHeight); +GlobalDecoderRegistry.registerAminoProtoMapping(ConsensusStateWithHeight.aminoType, ConsensusStateWithHeight.typeUrl); function createBaseClientConsensusStates(): ClientConsensusStates { return { clientId: "", @@ -477,6 +553,16 @@ function createBaseClientConsensusStates(): ClientConsensusStates { } export const ClientConsensusStates = { typeUrl: "/ibc.core.client.v1.ClientConsensusStates", + aminoType: "cosmos-sdk/ClientConsensusStates", + is(o: any): o is ClientConsensusStates { + return o && (o.$typeUrl === ClientConsensusStates.typeUrl || typeof o.clientId === "string" && Array.isArray(o.consensusStates) && (!o.consensusStates.length || ConsensusStateWithHeight.is(o.consensusStates[0]))); + }, + isSDK(o: any): o is ClientConsensusStatesSDKType { + return o && (o.$typeUrl === ClientConsensusStates.typeUrl || typeof o.client_id === "string" && Array.isArray(o.consensus_states) && (!o.consensus_states.length || ConsensusStateWithHeight.isSDK(o.consensus_states[0]))); + }, + isAmino(o: any): o is ClientConsensusStatesAmino { + return o && (o.$typeUrl === ClientConsensusStates.typeUrl || typeof o.client_id === "string" && Array.isArray(o.consensus_states) && (!o.consensus_states.length || ConsensusStateWithHeight.isAmino(o.consensus_states[0]))); + }, encode(message: ClientConsensusStates, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.clientId !== "") { writer.uint32(10).string(message.clientId); @@ -506,6 +592,22 @@ export const ClientConsensusStates = { } return message; }, + fromJSON(object: any): ClientConsensusStates { + return { + clientId: isSet(object.clientId) ? String(object.clientId) : "", + consensusStates: Array.isArray(object?.consensusStates) ? object.consensusStates.map((e: any) => ConsensusStateWithHeight.fromJSON(e)) : [] + }; + }, + toJSON(message: ClientConsensusStates): unknown { + const obj: any = {}; + message.clientId !== undefined && (obj.clientId = message.clientId); + if (message.consensusStates) { + obj.consensusStates = message.consensusStates.map(e => e ? ConsensusStateWithHeight.toJSON(e) : undefined); + } else { + obj.consensusStates = []; + } + return obj; + }, fromPartial(object: Partial): ClientConsensusStates { const message = createBaseClientConsensusStates(); message.clientId = object.clientId ?? ""; @@ -513,10 +615,12 @@ export const ClientConsensusStates = { return message; }, fromAmino(object: ClientConsensusStatesAmino): ClientConsensusStates { - return { - clientId: object.client_id, - consensusStates: Array.isArray(object?.consensus_states) ? object.consensus_states.map((e: any) => ConsensusStateWithHeight.fromAmino(e)) : [] - }; + const message = createBaseClientConsensusStates(); + if (object.client_id !== undefined && object.client_id !== null) { + message.clientId = object.client_id; + } + message.consensusStates = object.consensus_states?.map(e => ConsensusStateWithHeight.fromAmino(e)) || []; + return message; }, toAmino(message: ClientConsensusStates): ClientConsensusStatesAmino { const obj: any = {}; @@ -550,26 +654,236 @@ export const ClientConsensusStates = { }; } }; -function createBaseClientUpdateProposal(): ClientUpdateProposal { +GlobalDecoderRegistry.register(ClientConsensusStates.typeUrl, ClientConsensusStates); +GlobalDecoderRegistry.registerAminoProtoMapping(ClientConsensusStates.aminoType, ClientConsensusStates.typeUrl); +function createBaseHeight(): Height { return { - $typeUrl: "/ibc.core.client.v1.ClientUpdateProposal", - title: "", - description: "", - subjectClientId: "", - substituteClientId: "" + revisionNumber: BigInt(0), + revisionHeight: BigInt(0) }; } -export const ClientUpdateProposal = { - typeUrl: "/ibc.core.client.v1.ClientUpdateProposal", - encode(message: ClientUpdateProposal, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { - if (message.title !== "") { - writer.uint32(10).string(message.title); - } - if (message.description !== "") { - writer.uint32(18).string(message.description); - } - if (message.subjectClientId !== "") { - writer.uint32(26).string(message.subjectClientId); +export const Height = { + typeUrl: "/ibc.core.client.v1.Height", + aminoType: "cosmos-sdk/Height", + is(o: any): o is Height { + return o && (o.$typeUrl === Height.typeUrl || typeof o.revisionNumber === "bigint" && typeof o.revisionHeight === "bigint"); + }, + isSDK(o: any): o is HeightSDKType { + return o && (o.$typeUrl === Height.typeUrl || typeof o.revision_number === "bigint" && typeof o.revision_height === "bigint"); + }, + isAmino(o: any): o is HeightAmino { + return o && (o.$typeUrl === Height.typeUrl || typeof o.revision_number === "bigint" && typeof o.revision_height === "bigint"); + }, + encode(message: Height, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.revisionNumber !== BigInt(0)) { + writer.uint32(8).uint64(message.revisionNumber); + } + if (message.revisionHeight !== BigInt(0)) { + writer.uint32(16).uint64(message.revisionHeight); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): Height { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseHeight(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.revisionNumber = reader.uint64(); + break; + case 2: + message.revisionHeight = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): Height { + return { + revisionNumber: isSet(object.revisionNumber) ? BigInt(object.revisionNumber.toString()) : BigInt(0), + revisionHeight: isSet(object.revisionHeight) ? BigInt(object.revisionHeight.toString()) : BigInt(0) + }; + }, + toJSON(message: Height): unknown { + const obj: any = {}; + message.revisionNumber !== undefined && (obj.revisionNumber = (message.revisionNumber || BigInt(0)).toString()); + message.revisionHeight !== undefined && (obj.revisionHeight = (message.revisionHeight || BigInt(0)).toString()); + return obj; + }, + fromPartial(object: Partial): Height { + const message = createBaseHeight(); + message.revisionNumber = object.revisionNumber !== undefined && object.revisionNumber !== null ? BigInt(object.revisionNumber.toString()) : BigInt(0); + message.revisionHeight = object.revisionHeight !== undefined && object.revisionHeight !== null ? BigInt(object.revisionHeight.toString()) : BigInt(0); + return message; + }, + fromAmino(object: HeightAmino): Height { + return { + revisionNumber: BigInt(object.revision_number || "0"), + revisionHeight: BigInt(object.revision_height || "0") + }; + }, + toAmino(message: Height): HeightAmino { + const obj: any = {}; + obj.revision_number = message.revisionNumber ? message.revisionNumber.toString() : undefined; + obj.revision_height = message.revisionHeight ? message.revisionHeight.toString() : undefined; + return obj; + }, + fromAminoMsg(object: HeightAminoMsg): Height { + return Height.fromAmino(object.value); + }, + toAminoMsg(message: Height): HeightAminoMsg { + return { + type: "cosmos-sdk/Height", + value: Height.toAmino(message) + }; + }, + fromProtoMsg(message: HeightProtoMsg): Height { + return Height.decode(message.value); + }, + toProto(message: Height): Uint8Array { + return Height.encode(message).finish(); + }, + toProtoMsg(message: Height): HeightProtoMsg { + return { + typeUrl: "/ibc.core.client.v1.Height", + value: Height.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(Height.typeUrl, Height); +GlobalDecoderRegistry.registerAminoProtoMapping(Height.aminoType, Height.typeUrl); +function createBaseParams(): Params { + return { + allowedClients: [] + }; +} +export const Params = { + typeUrl: "/ibc.core.client.v1.Params", + aminoType: "cosmos-sdk/Params", + is(o: any): o is Params { + return o && (o.$typeUrl === Params.typeUrl || Array.isArray(o.allowedClients) && (!o.allowedClients.length || typeof o.allowedClients[0] === "string")); + }, + isSDK(o: any): o is ParamsSDKType { + return o && (o.$typeUrl === Params.typeUrl || Array.isArray(o.allowed_clients) && (!o.allowed_clients.length || typeof o.allowed_clients[0] === "string")); + }, + isAmino(o: any): o is ParamsAmino { + return o && (o.$typeUrl === Params.typeUrl || Array.isArray(o.allowed_clients) && (!o.allowed_clients.length || typeof o.allowed_clients[0] === "string")); + }, + encode(message: Params, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.allowedClients) { + writer.uint32(10).string(v!); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): Params { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseParams(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.allowedClients.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): Params { + return { + allowedClients: Array.isArray(object?.allowedClients) ? object.allowedClients.map((e: any) => String(e)) : [] + }; + }, + toJSON(message: Params): unknown { + const obj: any = {}; + if (message.allowedClients) { + obj.allowedClients = message.allowedClients.map(e => e); + } else { + obj.allowedClients = []; + } + return obj; + }, + fromPartial(object: Partial): Params { + const message = createBaseParams(); + message.allowedClients = object.allowedClients?.map(e => e) || []; + return message; + }, + fromAmino(object: ParamsAmino): Params { + const message = createBaseParams(); + message.allowedClients = object.allowed_clients?.map(e => e) || []; + return message; + }, + toAmino(message: Params): ParamsAmino { + const obj: any = {}; + if (message.allowedClients) { + obj.allowed_clients = message.allowedClients.map(e => e); + } else { + obj.allowed_clients = []; + } + return obj; + }, + fromAminoMsg(object: ParamsAminoMsg): Params { + return Params.fromAmino(object.value); + }, + toAminoMsg(message: Params): ParamsAminoMsg { + return { + type: "cosmos-sdk/Params", + value: Params.toAmino(message) + }; + }, + fromProtoMsg(message: ParamsProtoMsg): Params { + return Params.decode(message.value); + }, + toProto(message: Params): Uint8Array { + return Params.encode(message).finish(); + }, + toProtoMsg(message: Params): ParamsProtoMsg { + return { + typeUrl: "/ibc.core.client.v1.Params", + value: Params.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(Params.typeUrl, Params); +GlobalDecoderRegistry.registerAminoProtoMapping(Params.aminoType, Params.typeUrl); +function createBaseClientUpdateProposal(): ClientUpdateProposal { + return { + $typeUrl: "/ibc.core.client.v1.ClientUpdateProposal", + title: "", + description: "", + subjectClientId: "", + substituteClientId: "" + }; +} +export const ClientUpdateProposal = { + typeUrl: "/ibc.core.client.v1.ClientUpdateProposal", + aminoType: "cosmos-sdk/ClientUpdateProposal", + is(o: any): o is ClientUpdateProposal { + return o && (o.$typeUrl === ClientUpdateProposal.typeUrl || typeof o.title === "string" && typeof o.description === "string" && typeof o.subjectClientId === "string" && typeof o.substituteClientId === "string"); + }, + isSDK(o: any): o is ClientUpdateProposalSDKType { + return o && (o.$typeUrl === ClientUpdateProposal.typeUrl || typeof o.title === "string" && typeof o.description === "string" && typeof o.subject_client_id === "string" && typeof o.substitute_client_id === "string"); + }, + isAmino(o: any): o is ClientUpdateProposalAmino { + return o && (o.$typeUrl === ClientUpdateProposal.typeUrl || typeof o.title === "string" && typeof o.description === "string" && typeof o.subject_client_id === "string" && typeof o.substitute_client_id === "string"); + }, + encode(message: ClientUpdateProposal, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.title !== "") { + writer.uint32(10).string(message.title); + } + if (message.description !== "") { + writer.uint32(18).string(message.description); + } + if (message.subjectClientId !== "") { + writer.uint32(26).string(message.subjectClientId); } if (message.substituteClientId !== "") { writer.uint32(34).string(message.substituteClientId); @@ -602,6 +916,22 @@ export const ClientUpdateProposal = { } return message; }, + fromJSON(object: any): ClientUpdateProposal { + return { + title: isSet(object.title) ? String(object.title) : "", + description: isSet(object.description) ? String(object.description) : "", + subjectClientId: isSet(object.subjectClientId) ? String(object.subjectClientId) : "", + substituteClientId: isSet(object.substituteClientId) ? String(object.substituteClientId) : "" + }; + }, + toJSON(message: ClientUpdateProposal): unknown { + const obj: any = {}; + message.title !== undefined && (obj.title = message.title); + message.description !== undefined && (obj.description = message.description); + message.subjectClientId !== undefined && (obj.subjectClientId = message.subjectClientId); + message.substituteClientId !== undefined && (obj.substituteClientId = message.substituteClientId); + return obj; + }, fromPartial(object: Partial): ClientUpdateProposal { const message = createBaseClientUpdateProposal(); message.title = object.title ?? ""; @@ -611,12 +941,20 @@ export const ClientUpdateProposal = { return message; }, fromAmino(object: ClientUpdateProposalAmino): ClientUpdateProposal { - return { - title: object.title, - description: object.description, - subjectClientId: object.subject_client_id, - substituteClientId: object.substitute_client_id - }; + const message = createBaseClientUpdateProposal(); + if (object.title !== undefined && object.title !== null) { + message.title = object.title; + } + if (object.description !== undefined && object.description !== null) { + message.description = object.description; + } + if (object.subject_client_id !== undefined && object.subject_client_id !== null) { + message.subjectClientId = object.subject_client_id; + } + if (object.substitute_client_id !== undefined && object.substitute_client_id !== null) { + message.substituteClientId = object.substitute_client_id; + } + return message; }, toAmino(message: ClientUpdateProposal): ClientUpdateProposalAmino { const obj: any = {}; @@ -648,6 +986,8 @@ export const ClientUpdateProposal = { }; } }; +GlobalDecoderRegistry.register(ClientUpdateProposal.typeUrl, ClientUpdateProposal); +GlobalDecoderRegistry.registerAminoProtoMapping(ClientUpdateProposal.aminoType, ClientUpdateProposal.typeUrl); function createBaseUpgradeProposal(): UpgradeProposal { return { $typeUrl: "/ibc.core.client.v1.UpgradeProposal", @@ -659,6 +999,16 @@ function createBaseUpgradeProposal(): UpgradeProposal { } export const UpgradeProposal = { typeUrl: "/ibc.core.client.v1.UpgradeProposal", + aminoType: "cosmos-sdk/UpgradeProposal", + is(o: any): o is UpgradeProposal { + return o && (o.$typeUrl === UpgradeProposal.typeUrl || typeof o.title === "string" && typeof o.description === "string" && Plan.is(o.plan)); + }, + isSDK(o: any): o is UpgradeProposalSDKType { + return o && (o.$typeUrl === UpgradeProposal.typeUrl || typeof o.title === "string" && typeof o.description === "string" && Plan.isSDK(o.plan)); + }, + isAmino(o: any): o is UpgradeProposalAmino { + return o && (o.$typeUrl === UpgradeProposal.typeUrl || typeof o.title === "string" && typeof o.description === "string" && Plan.isAmino(o.plan)); + }, encode(message: UpgradeProposal, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.title !== "") { writer.uint32(10).string(message.title); @@ -700,6 +1050,22 @@ export const UpgradeProposal = { } return message; }, + fromJSON(object: any): UpgradeProposal { + return { + title: isSet(object.title) ? String(object.title) : "", + description: isSet(object.description) ? String(object.description) : "", + plan: isSet(object.plan) ? Plan.fromJSON(object.plan) : undefined, + upgradedClientState: isSet(object.upgradedClientState) ? Any.fromJSON(object.upgradedClientState) : undefined + }; + }, + toJSON(message: UpgradeProposal): 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); + message.upgradedClientState !== undefined && (obj.upgradedClientState = message.upgradedClientState ? Any.toJSON(message.upgradedClientState) : undefined); + return obj; + }, fromPartial(object: Partial): UpgradeProposal { const message = createBaseUpgradeProposal(); message.title = object.title ?? ""; @@ -709,12 +1075,20 @@ export const UpgradeProposal = { return message; }, fromAmino(object: UpgradeProposalAmino): UpgradeProposal { - return { - title: object.title, - description: object.description, - plan: object?.plan ? Plan.fromAmino(object.plan) : undefined, - upgradedClientState: object?.upgraded_client_state ? Any.fromAmino(object.upgraded_client_state) : undefined - }; + const message = createBaseUpgradeProposal(); + if (object.title !== undefined && object.title !== null) { + message.title = object.title; + } + if (object.description !== undefined && object.description !== null) { + message.description = object.description; + } + if (object.plan !== undefined && object.plan !== null) { + message.plan = Plan.fromAmino(object.plan); + } + if (object.upgraded_client_state !== undefined && object.upgraded_client_state !== null) { + message.upgradedClientState = Any.fromAmino(object.upgraded_client_state); + } + return message; }, toAmino(message: UpgradeProposal): UpgradeProposalAmino { const obj: any = {}; @@ -746,151 +1120,5 @@ export const UpgradeProposal = { }; } }; -function createBaseHeight(): Height { - return { - revisionNumber: BigInt(0), - revisionHeight: BigInt(0) - }; -} -export const Height = { - typeUrl: "/ibc.core.client.v1.Height", - encode(message: Height, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { - if (message.revisionNumber !== BigInt(0)) { - writer.uint32(8).uint64(message.revisionNumber); - } - if (message.revisionHeight !== BigInt(0)) { - writer.uint32(16).uint64(message.revisionHeight); - } - return writer; - }, - decode(input: BinaryReader | Uint8Array, length?: number): Height { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseHeight(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.revisionNumber = reader.uint64(); - break; - case 2: - message.revisionHeight = reader.uint64(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - fromPartial(object: Partial): Height { - const message = createBaseHeight(); - message.revisionNumber = object.revisionNumber !== undefined && object.revisionNumber !== null ? BigInt(object.revisionNumber.toString()) : BigInt(0); - message.revisionHeight = object.revisionHeight !== undefined && object.revisionHeight !== null ? BigInt(object.revisionHeight.toString()) : BigInt(0); - return message; - }, - fromAmino(object: HeightAmino): Height { - return { - revisionNumber: BigInt(object.revision_number || "0"), - revisionHeight: BigInt(object.revision_height || "0") - }; - }, - toAmino(message: Height): HeightAmino { - const obj: any = {}; - obj.revision_number = message.revisionNumber ? message.revisionNumber.toString() : undefined; - obj.revision_height = message.revisionHeight ? message.revisionHeight.toString() : undefined; - return obj; - }, - fromAminoMsg(object: HeightAminoMsg): Height { - return Height.fromAmino(object.value); - }, - toAminoMsg(message: Height): HeightAminoMsg { - return { - type: "cosmos-sdk/Height", - value: Height.toAmino(message) - }; - }, - fromProtoMsg(message: HeightProtoMsg): Height { - return Height.decode(message.value); - }, - toProto(message: Height): Uint8Array { - return Height.encode(message).finish(); - }, - toProtoMsg(message: Height): HeightProtoMsg { - return { - typeUrl: "/ibc.core.client.v1.Height", - value: Height.encode(message).finish() - }; - } -}; -function createBaseParams(): Params { - return { - allowedClients: [] - }; -} -export const Params = { - typeUrl: "/ibc.core.client.v1.Params", - encode(message: Params, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { - for (const v of message.allowedClients) { - writer.uint32(10).string(v!); - } - return writer; - }, - decode(input: BinaryReader | Uint8Array, length?: number): Params { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseParams(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.allowedClients.push(reader.string()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - fromPartial(object: Partial): Params { - const message = createBaseParams(); - message.allowedClients = object.allowedClients?.map(e => e) || []; - return message; - }, - fromAmino(object: ParamsAmino): Params { - return { - allowedClients: Array.isArray(object?.allowed_clients) ? object.allowed_clients.map((e: any) => e) : [] - }; - }, - toAmino(message: Params): ParamsAmino { - const obj: any = {}; - if (message.allowedClients) { - obj.allowed_clients = message.allowedClients.map(e => e); - } else { - obj.allowed_clients = []; - } - return obj; - }, - fromAminoMsg(object: ParamsAminoMsg): Params { - return Params.fromAmino(object.value); - }, - toAminoMsg(message: Params): ParamsAminoMsg { - return { - type: "cosmos-sdk/Params", - value: Params.toAmino(message) - }; - }, - fromProtoMsg(message: ParamsProtoMsg): Params { - return Params.decode(message.value); - }, - toProto(message: Params): Uint8Array { - return Params.encode(message).finish(); - }, - toProtoMsg(message: Params): ParamsProtoMsg { - return { - typeUrl: "/ibc.core.client.v1.Params", - value: Params.encode(message).finish() - }; - } -}; \ No newline at end of file +GlobalDecoderRegistry.register(UpgradeProposal.typeUrl, UpgradeProposal); +GlobalDecoderRegistry.registerAminoProtoMapping(UpgradeProposal.aminoType, UpgradeProposal.typeUrl); \ No newline at end of file diff --git a/packages/osmojs/src/codegen/ibc/core/client/v1/genesis.ts b/packages/osmojs/src/codegen/ibc/core/client/v1/genesis.ts index 1d0f80ada..0f3f834c8 100644 --- a/packages/osmojs/src/codegen/ibc/core/client/v1/genesis.ts +++ b/packages/osmojs/src/codegen/ibc/core/client/v1/genesis.ts @@ -1,5 +1,7 @@ import { IdentifiedClientState, IdentifiedClientStateAmino, IdentifiedClientStateSDKType, ClientConsensusStates, ClientConsensusStatesAmino, ClientConsensusStatesSDKType, Params, ParamsAmino, ParamsSDKType } from "./client"; import { BinaryReader, BinaryWriter } from "../../../../binary"; +import { isSet, bytesFromBase64, base64FromBytes } from "../../../../helpers"; +import { GlobalDecoderRegistry } from "../../../../registry"; /** GenesisState defines the ibc client submodule's genesis state. */ export interface GenesisState { /** client states with their corresponding identifiers */ @@ -9,7 +11,11 @@ export interface GenesisState { /** metadata from each client */ clientsMetadata: IdentifiedGenesisMetadata[]; params: Params; - /** create localhost on initialization */ + /** + * Deprecated: create_localhost has been deprecated. + * The localhost client is automatically created at genesis. + */ + /** @deprecated */ createLocalhost: boolean; /** the sequence for the next generated client identifier */ nextClientSequence: bigint; @@ -21,16 +27,20 @@ export interface GenesisStateProtoMsg { /** GenesisState defines the ibc client submodule's genesis state. */ export interface GenesisStateAmino { /** client states with their corresponding identifiers */ - clients: IdentifiedClientStateAmino[]; + clients?: IdentifiedClientStateAmino[]; /** consensus states from each client */ - clients_consensus: ClientConsensusStatesAmino[]; + clients_consensus?: ClientConsensusStatesAmino[]; /** metadata from each client */ - clients_metadata: IdentifiedGenesisMetadataAmino[]; + clients_metadata?: IdentifiedGenesisMetadataAmino[]; params?: ParamsAmino; - /** create localhost on initialization */ - create_localhost: boolean; + /** + * Deprecated: create_localhost has been deprecated. + * The localhost client is automatically created at genesis. + */ + /** @deprecated */ + create_localhost?: boolean; /** the sequence for the next generated client identifier */ - next_client_sequence: string; + next_client_sequence?: string; } export interface GenesisStateAminoMsg { type: "cosmos-sdk/GenesisState"; @@ -42,6 +52,7 @@ export interface GenesisStateSDKType { clients_consensus: ClientConsensusStatesSDKType[]; clients_metadata: IdentifiedGenesisMetadataSDKType[]; params: ParamsSDKType; + /** @deprecated */ create_localhost: boolean; next_client_sequence: bigint; } @@ -65,9 +76,9 @@ export interface GenesisMetadataProtoMsg { */ export interface GenesisMetadataAmino { /** store key of metadata without clientID-prefix */ - key: Uint8Array; + key?: string; /** metadata value */ - value: Uint8Array; + value?: string; } export interface GenesisMetadataAminoMsg { type: "cosmos-sdk/GenesisMetadata"; @@ -98,8 +109,8 @@ export interface IdentifiedGenesisMetadataProtoMsg { * client id. */ export interface IdentifiedGenesisMetadataAmino { - client_id: string; - client_metadata: GenesisMetadataAmino[]; + client_id?: string; + client_metadata?: GenesisMetadataAmino[]; } export interface IdentifiedGenesisMetadataAminoMsg { type: "cosmos-sdk/IdentifiedGenesisMetadata"; @@ -125,6 +136,16 @@ function createBaseGenesisState(): GenesisState { } export const GenesisState = { typeUrl: "/ibc.core.client.v1.GenesisState", + aminoType: "cosmos-sdk/GenesisState", + is(o: any): o is GenesisState { + return o && (o.$typeUrl === GenesisState.typeUrl || Array.isArray(o.clients) && (!o.clients.length || IdentifiedClientState.is(o.clients[0])) && Array.isArray(o.clientsConsensus) && (!o.clientsConsensus.length || ClientConsensusStates.is(o.clientsConsensus[0])) && Array.isArray(o.clientsMetadata) && (!o.clientsMetadata.length || IdentifiedGenesisMetadata.is(o.clientsMetadata[0])) && Params.is(o.params) && typeof o.createLocalhost === "boolean" && typeof o.nextClientSequence === "bigint"); + }, + isSDK(o: any): o is GenesisStateSDKType { + return o && (o.$typeUrl === GenesisState.typeUrl || Array.isArray(o.clients) && (!o.clients.length || IdentifiedClientState.isSDK(o.clients[0])) && Array.isArray(o.clients_consensus) && (!o.clients_consensus.length || ClientConsensusStates.isSDK(o.clients_consensus[0])) && Array.isArray(o.clients_metadata) && (!o.clients_metadata.length || IdentifiedGenesisMetadata.isSDK(o.clients_metadata[0])) && Params.isSDK(o.params) && typeof o.create_localhost === "boolean" && typeof o.next_client_sequence === "bigint"); + }, + isAmino(o: any): o is GenesisStateAmino { + return o && (o.$typeUrl === GenesisState.typeUrl || Array.isArray(o.clients) && (!o.clients.length || IdentifiedClientState.isAmino(o.clients[0])) && Array.isArray(o.clients_consensus) && (!o.clients_consensus.length || ClientConsensusStates.isAmino(o.clients_consensus[0])) && Array.isArray(o.clients_metadata) && (!o.clients_metadata.length || IdentifiedGenesisMetadata.isAmino(o.clients_metadata[0])) && Params.isAmino(o.params) && typeof o.create_localhost === "boolean" && typeof o.next_client_sequence === "bigint"); + }, encode(message: GenesisState, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.clients) { IdentifiedClientState.encode(v!, writer.uint32(10).fork()).ldelim(); @@ -178,6 +199,38 @@ export const GenesisState = { } return message; }, + fromJSON(object: any): GenesisState { + return { + clients: Array.isArray(object?.clients) ? object.clients.map((e: any) => IdentifiedClientState.fromJSON(e)) : [], + clientsConsensus: Array.isArray(object?.clientsConsensus) ? object.clientsConsensus.map((e: any) => ClientConsensusStates.fromJSON(e)) : [], + clientsMetadata: Array.isArray(object?.clientsMetadata) ? object.clientsMetadata.map((e: any) => IdentifiedGenesisMetadata.fromJSON(e)) : [], + params: isSet(object.params) ? Params.fromJSON(object.params) : undefined, + createLocalhost: isSet(object.createLocalhost) ? Boolean(object.createLocalhost) : false, + nextClientSequence: isSet(object.nextClientSequence) ? BigInt(object.nextClientSequence.toString()) : BigInt(0) + }; + }, + toJSON(message: GenesisState): unknown { + const obj: any = {}; + if (message.clients) { + obj.clients = message.clients.map(e => e ? IdentifiedClientState.toJSON(e) : undefined); + } else { + obj.clients = []; + } + if (message.clientsConsensus) { + obj.clientsConsensus = message.clientsConsensus.map(e => e ? ClientConsensusStates.toJSON(e) : undefined); + } else { + obj.clientsConsensus = []; + } + if (message.clientsMetadata) { + obj.clientsMetadata = message.clientsMetadata.map(e => e ? IdentifiedGenesisMetadata.toJSON(e) : undefined); + } else { + obj.clientsMetadata = []; + } + message.params !== undefined && (obj.params = message.params ? Params.toJSON(message.params) : undefined); + message.createLocalhost !== undefined && (obj.createLocalhost = message.createLocalhost); + message.nextClientSequence !== undefined && (obj.nextClientSequence = (message.nextClientSequence || BigInt(0)).toString()); + return obj; + }, fromPartial(object: Partial): GenesisState { const message = createBaseGenesisState(); message.clients = object.clients?.map(e => IdentifiedClientState.fromPartial(e)) || []; @@ -189,14 +242,20 @@ export const GenesisState = { return message; }, fromAmino(object: GenesisStateAmino): GenesisState { - return { - clients: Array.isArray(object?.clients) ? object.clients.map((e: any) => IdentifiedClientState.fromAmino(e)) : [], - clientsConsensus: Array.isArray(object?.clients_consensus) ? object.clients_consensus.map((e: any) => ClientConsensusStates.fromAmino(e)) : [], - clientsMetadata: Array.isArray(object?.clients_metadata) ? object.clients_metadata.map((e: any) => IdentifiedGenesisMetadata.fromAmino(e)) : [], - params: object?.params ? Params.fromAmino(object.params) : undefined, - createLocalhost: object.create_localhost, - nextClientSequence: BigInt(object.next_client_sequence) - }; + const message = createBaseGenesisState(); + message.clients = object.clients?.map(e => IdentifiedClientState.fromAmino(e)) || []; + message.clientsConsensus = object.clients_consensus?.map(e => ClientConsensusStates.fromAmino(e)) || []; + message.clientsMetadata = object.clients_metadata?.map(e => IdentifiedGenesisMetadata.fromAmino(e)) || []; + if (object.params !== undefined && object.params !== null) { + message.params = Params.fromAmino(object.params); + } + if (object.create_localhost !== undefined && object.create_localhost !== null) { + message.createLocalhost = object.create_localhost; + } + if (object.next_client_sequence !== undefined && object.next_client_sequence !== null) { + message.nextClientSequence = BigInt(object.next_client_sequence); + } + return message; }, toAmino(message: GenesisState): GenesisStateAmino { const obj: any = {}; @@ -242,6 +301,8 @@ export const GenesisState = { }; } }; +GlobalDecoderRegistry.register(GenesisState.typeUrl, GenesisState); +GlobalDecoderRegistry.registerAminoProtoMapping(GenesisState.aminoType, GenesisState.typeUrl); function createBaseGenesisMetadata(): GenesisMetadata { return { key: new Uint8Array(), @@ -250,6 +311,16 @@ function createBaseGenesisMetadata(): GenesisMetadata { } export const GenesisMetadata = { typeUrl: "/ibc.core.client.v1.GenesisMetadata", + aminoType: "cosmos-sdk/GenesisMetadata", + is(o: any): o is GenesisMetadata { + return o && (o.$typeUrl === GenesisMetadata.typeUrl || (o.key instanceof Uint8Array || typeof o.key === "string") && (o.value instanceof Uint8Array || typeof o.value === "string")); + }, + isSDK(o: any): o is GenesisMetadataSDKType { + return o && (o.$typeUrl === GenesisMetadata.typeUrl || (o.key instanceof Uint8Array || typeof o.key === "string") && (o.value instanceof Uint8Array || typeof o.value === "string")); + }, + isAmino(o: any): o is GenesisMetadataAmino { + return o && (o.$typeUrl === GenesisMetadata.typeUrl || (o.key instanceof Uint8Array || typeof o.key === "string") && (o.value instanceof Uint8Array || typeof o.value === "string")); + }, encode(message: GenesisMetadata, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.key.length !== 0) { writer.uint32(10).bytes(message.key); @@ -279,6 +350,18 @@ export const GenesisMetadata = { } return message; }, + fromJSON(object: any): GenesisMetadata { + return { + key: isSet(object.key) ? bytesFromBase64(object.key) : new Uint8Array(), + value: isSet(object.value) ? bytesFromBase64(object.value) : new Uint8Array() + }; + }, + toJSON(message: GenesisMetadata): unknown { + const obj: any = {}; + message.key !== undefined && (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; + }, fromPartial(object: Partial): GenesisMetadata { const message = createBaseGenesisMetadata(); message.key = object.key ?? new Uint8Array(); @@ -286,15 +369,19 @@ export const GenesisMetadata = { return message; }, fromAmino(object: GenesisMetadataAmino): GenesisMetadata { - return { - key: object.key, - value: object.value - }; + const message = createBaseGenesisMetadata(); + if (object.key !== undefined && object.key !== null) { + message.key = bytesFromBase64(object.key); + } + if (object.value !== undefined && object.value !== null) { + message.value = bytesFromBase64(object.value); + } + return message; }, toAmino(message: GenesisMetadata): GenesisMetadataAmino { const obj: any = {}; - obj.key = message.key; - obj.value = message.value; + obj.key = message.key ? base64FromBytes(message.key) : undefined; + obj.value = message.value ? base64FromBytes(message.value) : undefined; return obj; }, fromAminoMsg(object: GenesisMetadataAminoMsg): GenesisMetadata { @@ -319,6 +406,8 @@ export const GenesisMetadata = { }; } }; +GlobalDecoderRegistry.register(GenesisMetadata.typeUrl, GenesisMetadata); +GlobalDecoderRegistry.registerAminoProtoMapping(GenesisMetadata.aminoType, GenesisMetadata.typeUrl); function createBaseIdentifiedGenesisMetadata(): IdentifiedGenesisMetadata { return { clientId: "", @@ -327,6 +416,16 @@ function createBaseIdentifiedGenesisMetadata(): IdentifiedGenesisMetadata { } export const IdentifiedGenesisMetadata = { typeUrl: "/ibc.core.client.v1.IdentifiedGenesisMetadata", + aminoType: "cosmos-sdk/IdentifiedGenesisMetadata", + is(o: any): o is IdentifiedGenesisMetadata { + return o && (o.$typeUrl === IdentifiedGenesisMetadata.typeUrl || typeof o.clientId === "string" && Array.isArray(o.clientMetadata) && (!o.clientMetadata.length || GenesisMetadata.is(o.clientMetadata[0]))); + }, + isSDK(o: any): o is IdentifiedGenesisMetadataSDKType { + return o && (o.$typeUrl === IdentifiedGenesisMetadata.typeUrl || typeof o.client_id === "string" && Array.isArray(o.client_metadata) && (!o.client_metadata.length || GenesisMetadata.isSDK(o.client_metadata[0]))); + }, + isAmino(o: any): o is IdentifiedGenesisMetadataAmino { + return o && (o.$typeUrl === IdentifiedGenesisMetadata.typeUrl || typeof o.client_id === "string" && Array.isArray(o.client_metadata) && (!o.client_metadata.length || GenesisMetadata.isAmino(o.client_metadata[0]))); + }, encode(message: IdentifiedGenesisMetadata, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.clientId !== "") { writer.uint32(10).string(message.clientId); @@ -356,6 +455,22 @@ export const IdentifiedGenesisMetadata = { } return message; }, + fromJSON(object: any): IdentifiedGenesisMetadata { + return { + clientId: isSet(object.clientId) ? String(object.clientId) : "", + clientMetadata: Array.isArray(object?.clientMetadata) ? object.clientMetadata.map((e: any) => GenesisMetadata.fromJSON(e)) : [] + }; + }, + toJSON(message: IdentifiedGenesisMetadata): unknown { + const obj: any = {}; + message.clientId !== undefined && (obj.clientId = message.clientId); + if (message.clientMetadata) { + obj.clientMetadata = message.clientMetadata.map(e => e ? GenesisMetadata.toJSON(e) : undefined); + } else { + obj.clientMetadata = []; + } + return obj; + }, fromPartial(object: Partial): IdentifiedGenesisMetadata { const message = createBaseIdentifiedGenesisMetadata(); message.clientId = object.clientId ?? ""; @@ -363,10 +478,12 @@ export const IdentifiedGenesisMetadata = { return message; }, fromAmino(object: IdentifiedGenesisMetadataAmino): IdentifiedGenesisMetadata { - return { - clientId: object.client_id, - clientMetadata: Array.isArray(object?.client_metadata) ? object.client_metadata.map((e: any) => GenesisMetadata.fromAmino(e)) : [] - }; + const message = createBaseIdentifiedGenesisMetadata(); + if (object.client_id !== undefined && object.client_id !== null) { + message.clientId = object.client_id; + } + message.clientMetadata = object.client_metadata?.map(e => GenesisMetadata.fromAmino(e)) || []; + return message; }, toAmino(message: IdentifiedGenesisMetadata): IdentifiedGenesisMetadataAmino { const obj: any = {}; @@ -399,4 +516,6 @@ export const IdentifiedGenesisMetadata = { value: IdentifiedGenesisMetadata.encode(message).finish() }; } -}; \ No newline at end of file +}; +GlobalDecoderRegistry.register(IdentifiedGenesisMetadata.typeUrl, IdentifiedGenesisMetadata); +GlobalDecoderRegistry.registerAminoProtoMapping(IdentifiedGenesisMetadata.aminoType, IdentifiedGenesisMetadata.typeUrl); \ No newline at end of file diff --git a/packages/osmojs/src/codegen/ibc/core/client/v1/query.ts b/packages/osmojs/src/codegen/ibc/core/client/v1/query.ts index ac90b9124..5e213a015 100644 --- a/packages/osmojs/src/codegen/ibc/core/client/v1/query.ts +++ b/packages/osmojs/src/codegen/ibc/core/client/v1/query.ts @@ -2,6 +2,8 @@ import { PageRequest, PageRequestAmino, PageRequestSDKType, PageResponse, PageRe import { Any, AnyAmino, AnySDKType } from "../../../../google/protobuf/any"; import { Height, HeightAmino, HeightSDKType, IdentifiedClientState, IdentifiedClientStateAmino, IdentifiedClientStateSDKType, ConsensusStateWithHeight, ConsensusStateWithHeightAmino, ConsensusStateWithHeightSDKType, Params, ParamsAmino, ParamsSDKType } from "./client"; import { BinaryReader, BinaryWriter } from "../../../../binary"; +import { isSet, bytesFromBase64, base64FromBytes } from "../../../../helpers"; +import { GlobalDecoderRegistry } from "../../../../registry"; /** * QueryClientStateRequest is the request type for the Query/ClientState RPC * method @@ -20,7 +22,7 @@ export interface QueryClientStateRequestProtoMsg { */ export interface QueryClientStateRequestAmino { /** client state unique identifier */ - client_id: string; + client_id?: string; } export interface QueryClientStateRequestAminoMsg { type: "cosmos-sdk/QueryClientStateRequest"; @@ -40,7 +42,7 @@ export interface QueryClientStateRequestSDKType { */ export interface QueryClientStateResponse { /** client state associated with the request identifier */ - clientState: Any; + clientState?: Any; /** merkle proof of existence */ proof: Uint8Array; /** height at which the proof was retrieved */ @@ -59,7 +61,7 @@ export interface QueryClientStateResponseAmino { /** client state associated with the request identifier */ client_state?: AnyAmino; /** merkle proof of existence */ - proof: Uint8Array; + proof?: string; /** height at which the proof was retrieved */ proof_height?: HeightAmino; } @@ -73,7 +75,7 @@ export interface QueryClientStateResponseAminoMsg { * which the proof was retrieved. */ export interface QueryClientStateResponseSDKType { - client_state: AnySDKType; + client_state?: AnySDKType; proof: Uint8Array; proof_height: HeightSDKType; } @@ -83,7 +85,7 @@ export interface QueryClientStateResponseSDKType { */ export interface QueryClientStatesRequest { /** pagination request */ - pagination: PageRequest; + pagination?: PageRequest; } export interface QueryClientStatesRequestProtoMsg { typeUrl: "/ibc.core.client.v1.QueryClientStatesRequest"; @@ -106,7 +108,7 @@ export interface QueryClientStatesRequestAminoMsg { * method */ export interface QueryClientStatesRequestSDKType { - pagination: PageRequestSDKType; + pagination?: PageRequestSDKType; } /** * QueryClientStatesResponse is the response type for the Query/ClientStates RPC @@ -116,7 +118,7 @@ export interface QueryClientStatesResponse { /** list of stored ClientStates of the chain. */ clientStates: IdentifiedClientState[]; /** pagination response */ - pagination: PageResponse; + pagination?: PageResponse; } export interface QueryClientStatesResponseProtoMsg { typeUrl: "/ibc.core.client.v1.QueryClientStatesResponse"; @@ -128,7 +130,7 @@ export interface QueryClientStatesResponseProtoMsg { */ export interface QueryClientStatesResponseAmino { /** list of stored ClientStates of the chain. */ - client_states: IdentifiedClientStateAmino[]; + client_states?: IdentifiedClientStateAmino[]; /** pagination response */ pagination?: PageResponseAmino; } @@ -142,7 +144,7 @@ export interface QueryClientStatesResponseAminoMsg { */ export interface QueryClientStatesResponseSDKType { client_states: IdentifiedClientStateSDKType[]; - pagination: PageResponseSDKType; + pagination?: PageResponseSDKType; } /** * QueryConsensusStateRequest is the request type for the Query/ConsensusState @@ -157,7 +159,7 @@ export interface QueryConsensusStateRequest { /** consensus state revision height */ revisionHeight: bigint; /** - * latest_height overrrides the height field and queries the latest stored + * latest_height overrides the height field and queries the latest stored * ConsensusState */ latestHeight: boolean; @@ -173,16 +175,16 @@ export interface QueryConsensusStateRequestProtoMsg { */ export interface QueryConsensusStateRequestAmino { /** client identifier */ - client_id: string; + client_id?: string; /** consensus state revision number */ - revision_number: string; + revision_number?: string; /** consensus state revision height */ - revision_height: string; + revision_height?: string; /** - * latest_height overrrides the height field and queries the latest stored + * latest_height overrides the height field and queries the latest stored * ConsensusState */ - latest_height: boolean; + latest_height?: boolean; } export interface QueryConsensusStateRequestAminoMsg { type: "cosmos-sdk/QueryConsensusStateRequest"; @@ -205,7 +207,7 @@ export interface QueryConsensusStateRequestSDKType { */ export interface QueryConsensusStateResponse { /** consensus state associated with the client identifier at the given height */ - consensusState: Any; + consensusState?: Any; /** merkle proof of existence */ proof: Uint8Array; /** height at which the proof was retrieved */ @@ -223,7 +225,7 @@ export interface QueryConsensusStateResponseAmino { /** consensus state associated with the client identifier at the given height */ consensus_state?: AnyAmino; /** merkle proof of existence */ - proof: Uint8Array; + proof?: string; /** height at which the proof was retrieved */ proof_height?: HeightAmino; } @@ -236,7 +238,7 @@ export interface QueryConsensusStateResponseAminoMsg { * RPC method */ export interface QueryConsensusStateResponseSDKType { - consensus_state: AnySDKType; + consensus_state?: AnySDKType; proof: Uint8Array; proof_height: HeightSDKType; } @@ -248,7 +250,7 @@ export interface QueryConsensusStatesRequest { /** client identifier */ clientId: string; /** pagination request */ - pagination: PageRequest; + pagination?: PageRequest; } export interface QueryConsensusStatesRequestProtoMsg { typeUrl: "/ibc.core.client.v1.QueryConsensusStatesRequest"; @@ -260,7 +262,7 @@ export interface QueryConsensusStatesRequestProtoMsg { */ export interface QueryConsensusStatesRequestAmino { /** client identifier */ - client_id: string; + client_id?: string; /** pagination request */ pagination?: PageRequestAmino; } @@ -274,7 +276,7 @@ export interface QueryConsensusStatesRequestAminoMsg { */ export interface QueryConsensusStatesRequestSDKType { client_id: string; - pagination: PageRequestSDKType; + pagination?: PageRequestSDKType; } /** * QueryConsensusStatesResponse is the response type for the @@ -284,7 +286,7 @@ export interface QueryConsensusStatesResponse { /** consensus states associated with the identifier */ consensusStates: ConsensusStateWithHeight[]; /** pagination response */ - pagination: PageResponse; + pagination?: PageResponse; } export interface QueryConsensusStatesResponseProtoMsg { typeUrl: "/ibc.core.client.v1.QueryConsensusStatesResponse"; @@ -296,7 +298,7 @@ export interface QueryConsensusStatesResponseProtoMsg { */ export interface QueryConsensusStatesResponseAmino { /** consensus states associated with the identifier */ - consensus_states: ConsensusStateWithHeightAmino[]; + consensus_states?: ConsensusStateWithHeightAmino[]; /** pagination response */ pagination?: PageResponseAmino; } @@ -310,7 +312,7 @@ export interface QueryConsensusStatesResponseAminoMsg { */ export interface QueryConsensusStatesResponseSDKType { consensus_states: ConsensusStateWithHeightSDKType[]; - pagination: PageResponseSDKType; + pagination?: PageResponseSDKType; } /** * QueryConsensusStateHeightsRequest is the request type for Query/ConsensusStateHeights @@ -320,7 +322,7 @@ export interface QueryConsensusStateHeightsRequest { /** client identifier */ clientId: string; /** pagination request */ - pagination: PageRequest; + pagination?: PageRequest; } export interface QueryConsensusStateHeightsRequestProtoMsg { typeUrl: "/ibc.core.client.v1.QueryConsensusStateHeightsRequest"; @@ -332,7 +334,7 @@ export interface QueryConsensusStateHeightsRequestProtoMsg { */ export interface QueryConsensusStateHeightsRequestAmino { /** client identifier */ - client_id: string; + client_id?: string; /** pagination request */ pagination?: PageRequestAmino; } @@ -346,7 +348,7 @@ export interface QueryConsensusStateHeightsRequestAminoMsg { */ export interface QueryConsensusStateHeightsRequestSDKType { client_id: string; - pagination: PageRequestSDKType; + pagination?: PageRequestSDKType; } /** * QueryConsensusStateHeightsResponse is the response type for the @@ -356,7 +358,7 @@ export interface QueryConsensusStateHeightsResponse { /** consensus state heights */ consensusStateHeights: Height[]; /** pagination response */ - pagination: PageResponse; + pagination?: PageResponse; } export interface QueryConsensusStateHeightsResponseProtoMsg { typeUrl: "/ibc.core.client.v1.QueryConsensusStateHeightsResponse"; @@ -368,7 +370,7 @@ export interface QueryConsensusStateHeightsResponseProtoMsg { */ export interface QueryConsensusStateHeightsResponseAmino { /** consensus state heights */ - consensus_state_heights: HeightAmino[]; + consensus_state_heights?: HeightAmino[]; /** pagination response */ pagination?: PageResponseAmino; } @@ -382,7 +384,7 @@ export interface QueryConsensusStateHeightsResponseAminoMsg { */ export interface QueryConsensusStateHeightsResponseSDKType { consensus_state_heights: HeightSDKType[]; - pagination: PageResponseSDKType; + pagination?: PageResponseSDKType; } /** * QueryClientStatusRequest is the request type for the Query/ClientStatus RPC @@ -402,7 +404,7 @@ export interface QueryClientStatusRequestProtoMsg { */ export interface QueryClientStatusRequestAmino { /** client unique identifier */ - client_id: string; + client_id?: string; } export interface QueryClientStatusRequestAminoMsg { type: "cosmos-sdk/QueryClientStatusRequest"; @@ -431,7 +433,7 @@ export interface QueryClientStatusResponseProtoMsg { * method. It returns the current status of the IBC client. */ export interface QueryClientStatusResponseAmino { - status: string; + status?: string; } export interface QueryClientStatusResponseAminoMsg { type: "cosmos-sdk/QueryClientStatusResponse"; @@ -473,7 +475,7 @@ export interface QueryClientParamsRequestSDKType {} */ export interface QueryClientParamsResponse { /** params defines the parameters of the module. */ - params: Params; + params?: Params; } export interface QueryClientParamsResponseProtoMsg { typeUrl: "/ibc.core.client.v1.QueryClientParamsResponse"; @@ -496,7 +498,7 @@ export interface QueryClientParamsResponseAminoMsg { * method. */ export interface QueryClientParamsResponseSDKType { - params: ParamsSDKType; + params?: ParamsSDKType; } /** * QueryUpgradedClientStateRequest is the request type for the @@ -527,7 +529,7 @@ export interface QueryUpgradedClientStateRequestSDKType {} */ export interface QueryUpgradedClientStateResponse { /** client state associated with the request identifier */ - upgradedClientState: Any; + upgradedClientState?: Any; } export interface QueryUpgradedClientStateResponseProtoMsg { typeUrl: "/ibc.core.client.v1.QueryUpgradedClientStateResponse"; @@ -550,7 +552,7 @@ export interface QueryUpgradedClientStateResponseAminoMsg { * Query/UpgradedClientState RPC method. */ export interface QueryUpgradedClientStateResponseSDKType { - upgraded_client_state: AnySDKType; + upgraded_client_state?: AnySDKType; } /** * QueryUpgradedConsensusStateRequest is the request type for the @@ -581,7 +583,7 @@ export interface QueryUpgradedConsensusStateRequestSDKType {} */ export interface QueryUpgradedConsensusStateResponse { /** Consensus state associated with the request identifier */ - upgradedConsensusState: Any; + upgradedConsensusState?: Any; } export interface QueryUpgradedConsensusStateResponseProtoMsg { typeUrl: "/ibc.core.client.v1.QueryUpgradedConsensusStateResponse"; @@ -604,7 +606,7 @@ export interface QueryUpgradedConsensusStateResponseAminoMsg { * Query/UpgradedConsensusState RPC method. */ export interface QueryUpgradedConsensusStateResponseSDKType { - upgraded_consensus_state: AnySDKType; + upgraded_consensus_state?: AnySDKType; } function createBaseQueryClientStateRequest(): QueryClientStateRequest { return { @@ -613,6 +615,16 @@ function createBaseQueryClientStateRequest(): QueryClientStateRequest { } export const QueryClientStateRequest = { typeUrl: "/ibc.core.client.v1.QueryClientStateRequest", + aminoType: "cosmos-sdk/QueryClientStateRequest", + is(o: any): o is QueryClientStateRequest { + return o && (o.$typeUrl === QueryClientStateRequest.typeUrl || typeof o.clientId === "string"); + }, + isSDK(o: any): o is QueryClientStateRequestSDKType { + return o && (o.$typeUrl === QueryClientStateRequest.typeUrl || typeof o.client_id === "string"); + }, + isAmino(o: any): o is QueryClientStateRequestAmino { + return o && (o.$typeUrl === QueryClientStateRequest.typeUrl || typeof o.client_id === "string"); + }, encode(message: QueryClientStateRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.clientId !== "") { writer.uint32(10).string(message.clientId); @@ -636,15 +648,27 @@ export const QueryClientStateRequest = { } return message; }, + fromJSON(object: any): QueryClientStateRequest { + return { + clientId: isSet(object.clientId) ? String(object.clientId) : "" + }; + }, + toJSON(message: QueryClientStateRequest): unknown { + const obj: any = {}; + message.clientId !== undefined && (obj.clientId = message.clientId); + return obj; + }, fromPartial(object: Partial): QueryClientStateRequest { const message = createBaseQueryClientStateRequest(); message.clientId = object.clientId ?? ""; return message; }, fromAmino(object: QueryClientStateRequestAmino): QueryClientStateRequest { - return { - clientId: object.client_id - }; + const message = createBaseQueryClientStateRequest(); + if (object.client_id !== undefined && object.client_id !== null) { + message.clientId = object.client_id; + } + return message; }, toAmino(message: QueryClientStateRequest): QueryClientStateRequestAmino { const obj: any = {}; @@ -673,6 +697,8 @@ export const QueryClientStateRequest = { }; } }; +GlobalDecoderRegistry.register(QueryClientStateRequest.typeUrl, QueryClientStateRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryClientStateRequest.aminoType, QueryClientStateRequest.typeUrl); function createBaseQueryClientStateResponse(): QueryClientStateResponse { return { clientState: undefined, @@ -682,6 +708,16 @@ function createBaseQueryClientStateResponse(): QueryClientStateResponse { } export const QueryClientStateResponse = { typeUrl: "/ibc.core.client.v1.QueryClientStateResponse", + aminoType: "cosmos-sdk/QueryClientStateResponse", + is(o: any): o is QueryClientStateResponse { + return o && (o.$typeUrl === QueryClientStateResponse.typeUrl || (o.proof instanceof Uint8Array || typeof o.proof === "string") && Height.is(o.proofHeight)); + }, + isSDK(o: any): o is QueryClientStateResponseSDKType { + return o && (o.$typeUrl === QueryClientStateResponse.typeUrl || (o.proof instanceof Uint8Array || typeof o.proof === "string") && Height.isSDK(o.proof_height)); + }, + isAmino(o: any): o is QueryClientStateResponseAmino { + return o && (o.$typeUrl === QueryClientStateResponse.typeUrl || (o.proof instanceof Uint8Array || typeof o.proof === "string") && Height.isAmino(o.proof_height)); + }, encode(message: QueryClientStateResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.clientState !== undefined) { Any.encode(message.clientState, writer.uint32(10).fork()).ldelim(); @@ -717,6 +753,20 @@ export const QueryClientStateResponse = { } return message; }, + fromJSON(object: any): QueryClientStateResponse { + return { + clientState: isSet(object.clientState) ? Any.fromJSON(object.clientState) : undefined, + proof: isSet(object.proof) ? bytesFromBase64(object.proof) : new Uint8Array(), + proofHeight: isSet(object.proofHeight) ? Height.fromJSON(object.proofHeight) : undefined + }; + }, + toJSON(message: QueryClientStateResponse): unknown { + const obj: any = {}; + message.clientState !== undefined && (obj.clientState = message.clientState ? Any.toJSON(message.clientState) : undefined); + message.proof !== undefined && (obj.proof = base64FromBytes(message.proof !== undefined ? message.proof : new Uint8Array())); + message.proofHeight !== undefined && (obj.proofHeight = message.proofHeight ? Height.toJSON(message.proofHeight) : undefined); + return obj; + }, fromPartial(object: Partial): QueryClientStateResponse { const message = createBaseQueryClientStateResponse(); message.clientState = object.clientState !== undefined && object.clientState !== null ? Any.fromPartial(object.clientState) : undefined; @@ -725,16 +775,22 @@ export const QueryClientStateResponse = { return message; }, fromAmino(object: QueryClientStateResponseAmino): QueryClientStateResponse { - return { - clientState: object?.client_state ? Any.fromAmino(object.client_state) : undefined, - proof: object.proof, - proofHeight: object?.proof_height ? Height.fromAmino(object.proof_height) : undefined - }; + const message = createBaseQueryClientStateResponse(); + if (object.client_state !== undefined && object.client_state !== null) { + message.clientState = Any.fromAmino(object.client_state); + } + if (object.proof !== undefined && object.proof !== null) { + message.proof = bytesFromBase64(object.proof); + } + if (object.proof_height !== undefined && object.proof_height !== null) { + message.proofHeight = Height.fromAmino(object.proof_height); + } + return message; }, toAmino(message: QueryClientStateResponse): QueryClientStateResponseAmino { const obj: any = {}; obj.client_state = message.clientState ? Any.toAmino(message.clientState) : undefined; - obj.proof = message.proof; + obj.proof = message.proof ? base64FromBytes(message.proof) : undefined; obj.proof_height = message.proofHeight ? Height.toAmino(message.proofHeight) : {}; return obj; }, @@ -760,13 +816,25 @@ export const QueryClientStateResponse = { }; } }; +GlobalDecoderRegistry.register(QueryClientStateResponse.typeUrl, QueryClientStateResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryClientStateResponse.aminoType, QueryClientStateResponse.typeUrl); function createBaseQueryClientStatesRequest(): QueryClientStatesRequest { return { - pagination: PageRequest.fromPartial({}) + pagination: undefined }; } export const QueryClientStatesRequest = { typeUrl: "/ibc.core.client.v1.QueryClientStatesRequest", + aminoType: "cosmos-sdk/QueryClientStatesRequest", + is(o: any): o is QueryClientStatesRequest { + return o && o.$typeUrl === QueryClientStatesRequest.typeUrl; + }, + isSDK(o: any): o is QueryClientStatesRequestSDKType { + return o && o.$typeUrl === QueryClientStatesRequest.typeUrl; + }, + isAmino(o: any): o is QueryClientStatesRequestAmino { + return o && o.$typeUrl === QueryClientStatesRequest.typeUrl; + }, encode(message: QueryClientStatesRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.pagination !== undefined) { PageRequest.encode(message.pagination, writer.uint32(10).fork()).ldelim(); @@ -790,15 +858,27 @@ export const QueryClientStatesRequest = { } return message; }, + fromJSON(object: any): QueryClientStatesRequest { + return { + pagination: isSet(object.pagination) ? PageRequest.fromJSON(object.pagination) : undefined + }; + }, + toJSON(message: QueryClientStatesRequest): unknown { + const obj: any = {}; + message.pagination !== undefined && (obj.pagination = message.pagination ? PageRequest.toJSON(message.pagination) : undefined); + return obj; + }, fromPartial(object: Partial): QueryClientStatesRequest { const message = createBaseQueryClientStatesRequest(); message.pagination = object.pagination !== undefined && object.pagination !== null ? PageRequest.fromPartial(object.pagination) : undefined; return message; }, fromAmino(object: QueryClientStatesRequestAmino): QueryClientStatesRequest { - return { - pagination: object?.pagination ? PageRequest.fromAmino(object.pagination) : undefined - }; + const message = createBaseQueryClientStatesRequest(); + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromAmino(object.pagination); + } + return message; }, toAmino(message: QueryClientStatesRequest): QueryClientStatesRequestAmino { const obj: any = {}; @@ -827,14 +907,26 @@ export const QueryClientStatesRequest = { }; } }; +GlobalDecoderRegistry.register(QueryClientStatesRequest.typeUrl, QueryClientStatesRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryClientStatesRequest.aminoType, QueryClientStatesRequest.typeUrl); function createBaseQueryClientStatesResponse(): QueryClientStatesResponse { return { clientStates: [], - pagination: PageResponse.fromPartial({}) + pagination: undefined }; } export const QueryClientStatesResponse = { typeUrl: "/ibc.core.client.v1.QueryClientStatesResponse", + aminoType: "cosmos-sdk/QueryClientStatesResponse", + is(o: any): o is QueryClientStatesResponse { + return o && (o.$typeUrl === QueryClientStatesResponse.typeUrl || Array.isArray(o.clientStates) && (!o.clientStates.length || IdentifiedClientState.is(o.clientStates[0]))); + }, + isSDK(o: any): o is QueryClientStatesResponseSDKType { + return o && (o.$typeUrl === QueryClientStatesResponse.typeUrl || Array.isArray(o.client_states) && (!o.client_states.length || IdentifiedClientState.isSDK(o.client_states[0]))); + }, + isAmino(o: any): o is QueryClientStatesResponseAmino { + return o && (o.$typeUrl === QueryClientStatesResponse.typeUrl || Array.isArray(o.client_states) && (!o.client_states.length || IdentifiedClientState.isAmino(o.client_states[0]))); + }, encode(message: QueryClientStatesResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.clientStates) { IdentifiedClientState.encode(v!, writer.uint32(10).fork()).ldelim(); @@ -864,6 +956,22 @@ export const QueryClientStatesResponse = { } return message; }, + fromJSON(object: any): QueryClientStatesResponse { + return { + clientStates: Array.isArray(object?.clientStates) ? object.clientStates.map((e: any) => IdentifiedClientState.fromJSON(e)) : [], + pagination: isSet(object.pagination) ? PageResponse.fromJSON(object.pagination) : undefined + }; + }, + toJSON(message: QueryClientStatesResponse): unknown { + const obj: any = {}; + if (message.clientStates) { + obj.clientStates = message.clientStates.map(e => e ? IdentifiedClientState.toJSON(e) : undefined); + } else { + obj.clientStates = []; + } + message.pagination !== undefined && (obj.pagination = message.pagination ? PageResponse.toJSON(message.pagination) : undefined); + return obj; + }, fromPartial(object: Partial): QueryClientStatesResponse { const message = createBaseQueryClientStatesResponse(); message.clientStates = object.clientStates?.map(e => IdentifiedClientState.fromPartial(e)) || []; @@ -871,10 +979,12 @@ export const QueryClientStatesResponse = { return message; }, fromAmino(object: QueryClientStatesResponseAmino): QueryClientStatesResponse { - return { - clientStates: Array.isArray(object?.client_states) ? object.client_states.map((e: any) => IdentifiedClientState.fromAmino(e)) : [], - pagination: object?.pagination ? PageResponse.fromAmino(object.pagination) : undefined - }; + const message = createBaseQueryClientStatesResponse(); + message.clientStates = object.client_states?.map(e => IdentifiedClientState.fromAmino(e)) || []; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromAmino(object.pagination); + } + return message; }, toAmino(message: QueryClientStatesResponse): QueryClientStatesResponseAmino { const obj: any = {}; @@ -908,6 +1018,8 @@ export const QueryClientStatesResponse = { }; } }; +GlobalDecoderRegistry.register(QueryClientStatesResponse.typeUrl, QueryClientStatesResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryClientStatesResponse.aminoType, QueryClientStatesResponse.typeUrl); function createBaseQueryConsensusStateRequest(): QueryConsensusStateRequest { return { clientId: "", @@ -918,6 +1030,16 @@ function createBaseQueryConsensusStateRequest(): QueryConsensusStateRequest { } export const QueryConsensusStateRequest = { typeUrl: "/ibc.core.client.v1.QueryConsensusStateRequest", + aminoType: "cosmos-sdk/QueryConsensusStateRequest", + is(o: any): o is QueryConsensusStateRequest { + return o && (o.$typeUrl === QueryConsensusStateRequest.typeUrl || typeof o.clientId === "string" && typeof o.revisionNumber === "bigint" && typeof o.revisionHeight === "bigint" && typeof o.latestHeight === "boolean"); + }, + isSDK(o: any): o is QueryConsensusStateRequestSDKType { + return o && (o.$typeUrl === QueryConsensusStateRequest.typeUrl || typeof o.client_id === "string" && typeof o.revision_number === "bigint" && typeof o.revision_height === "bigint" && typeof o.latest_height === "boolean"); + }, + isAmino(o: any): o is QueryConsensusStateRequestAmino { + return o && (o.$typeUrl === QueryConsensusStateRequest.typeUrl || typeof o.client_id === "string" && typeof o.revision_number === "bigint" && typeof o.revision_height === "bigint" && typeof o.latest_height === "boolean"); + }, encode(message: QueryConsensusStateRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.clientId !== "") { writer.uint32(10).string(message.clientId); @@ -959,6 +1081,22 @@ export const QueryConsensusStateRequest = { } return message; }, + fromJSON(object: any): QueryConsensusStateRequest { + return { + clientId: isSet(object.clientId) ? String(object.clientId) : "", + revisionNumber: isSet(object.revisionNumber) ? BigInt(object.revisionNumber.toString()) : BigInt(0), + revisionHeight: isSet(object.revisionHeight) ? BigInt(object.revisionHeight.toString()) : BigInt(0), + latestHeight: isSet(object.latestHeight) ? Boolean(object.latestHeight) : false + }; + }, + toJSON(message: QueryConsensusStateRequest): unknown { + const obj: any = {}; + message.clientId !== undefined && (obj.clientId = message.clientId); + message.revisionNumber !== undefined && (obj.revisionNumber = (message.revisionNumber || BigInt(0)).toString()); + message.revisionHeight !== undefined && (obj.revisionHeight = (message.revisionHeight || BigInt(0)).toString()); + message.latestHeight !== undefined && (obj.latestHeight = message.latestHeight); + return obj; + }, fromPartial(object: Partial): QueryConsensusStateRequest { const message = createBaseQueryConsensusStateRequest(); message.clientId = object.clientId ?? ""; @@ -968,12 +1106,20 @@ export const QueryConsensusStateRequest = { return message; }, fromAmino(object: QueryConsensusStateRequestAmino): QueryConsensusStateRequest { - return { - clientId: object.client_id, - revisionNumber: BigInt(object.revision_number), - revisionHeight: BigInt(object.revision_height), - latestHeight: object.latest_height - }; + const message = createBaseQueryConsensusStateRequest(); + if (object.client_id !== undefined && object.client_id !== null) { + message.clientId = object.client_id; + } + if (object.revision_number !== undefined && object.revision_number !== null) { + message.revisionNumber = BigInt(object.revision_number); + } + if (object.revision_height !== undefined && object.revision_height !== null) { + message.revisionHeight = BigInt(object.revision_height); + } + if (object.latest_height !== undefined && object.latest_height !== null) { + message.latestHeight = object.latest_height; + } + return message; }, toAmino(message: QueryConsensusStateRequest): QueryConsensusStateRequestAmino { const obj: any = {}; @@ -1005,6 +1151,8 @@ export const QueryConsensusStateRequest = { }; } }; +GlobalDecoderRegistry.register(QueryConsensusStateRequest.typeUrl, QueryConsensusStateRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryConsensusStateRequest.aminoType, QueryConsensusStateRequest.typeUrl); function createBaseQueryConsensusStateResponse(): QueryConsensusStateResponse { return { consensusState: undefined, @@ -1014,6 +1162,16 @@ function createBaseQueryConsensusStateResponse(): QueryConsensusStateResponse { } export const QueryConsensusStateResponse = { typeUrl: "/ibc.core.client.v1.QueryConsensusStateResponse", + aminoType: "cosmos-sdk/QueryConsensusStateResponse", + is(o: any): o is QueryConsensusStateResponse { + return o && (o.$typeUrl === QueryConsensusStateResponse.typeUrl || (o.proof instanceof Uint8Array || typeof o.proof === "string") && Height.is(o.proofHeight)); + }, + isSDK(o: any): o is QueryConsensusStateResponseSDKType { + return o && (o.$typeUrl === QueryConsensusStateResponse.typeUrl || (o.proof instanceof Uint8Array || typeof o.proof === "string") && Height.isSDK(o.proof_height)); + }, + isAmino(o: any): o is QueryConsensusStateResponseAmino { + return o && (o.$typeUrl === QueryConsensusStateResponse.typeUrl || (o.proof instanceof Uint8Array || typeof o.proof === "string") && Height.isAmino(o.proof_height)); + }, encode(message: QueryConsensusStateResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.consensusState !== undefined) { Any.encode(message.consensusState, writer.uint32(10).fork()).ldelim(); @@ -1049,6 +1207,20 @@ export const QueryConsensusStateResponse = { } return message; }, + fromJSON(object: any): QueryConsensusStateResponse { + return { + consensusState: isSet(object.consensusState) ? Any.fromJSON(object.consensusState) : undefined, + proof: isSet(object.proof) ? bytesFromBase64(object.proof) : new Uint8Array(), + proofHeight: isSet(object.proofHeight) ? Height.fromJSON(object.proofHeight) : undefined + }; + }, + toJSON(message: QueryConsensusStateResponse): unknown { + const obj: any = {}; + message.consensusState !== undefined && (obj.consensusState = message.consensusState ? Any.toJSON(message.consensusState) : undefined); + message.proof !== undefined && (obj.proof = base64FromBytes(message.proof !== undefined ? message.proof : new Uint8Array())); + message.proofHeight !== undefined && (obj.proofHeight = message.proofHeight ? Height.toJSON(message.proofHeight) : undefined); + return obj; + }, fromPartial(object: Partial): QueryConsensusStateResponse { const message = createBaseQueryConsensusStateResponse(); message.consensusState = object.consensusState !== undefined && object.consensusState !== null ? Any.fromPartial(object.consensusState) : undefined; @@ -1057,16 +1229,22 @@ export const QueryConsensusStateResponse = { return message; }, fromAmino(object: QueryConsensusStateResponseAmino): QueryConsensusStateResponse { - return { - consensusState: object?.consensus_state ? Any.fromAmino(object.consensus_state) : undefined, - proof: object.proof, - proofHeight: object?.proof_height ? Height.fromAmino(object.proof_height) : undefined - }; + const message = createBaseQueryConsensusStateResponse(); + if (object.consensus_state !== undefined && object.consensus_state !== null) { + message.consensusState = Any.fromAmino(object.consensus_state); + } + if (object.proof !== undefined && object.proof !== null) { + message.proof = bytesFromBase64(object.proof); + } + if (object.proof_height !== undefined && object.proof_height !== null) { + message.proofHeight = Height.fromAmino(object.proof_height); + } + return message; }, toAmino(message: QueryConsensusStateResponse): QueryConsensusStateResponseAmino { const obj: any = {}; obj.consensus_state = message.consensusState ? Any.toAmino(message.consensusState) : undefined; - obj.proof = message.proof; + obj.proof = message.proof ? base64FromBytes(message.proof) : undefined; obj.proof_height = message.proofHeight ? Height.toAmino(message.proofHeight) : {}; return obj; }, @@ -1092,14 +1270,26 @@ export const QueryConsensusStateResponse = { }; } }; +GlobalDecoderRegistry.register(QueryConsensusStateResponse.typeUrl, QueryConsensusStateResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryConsensusStateResponse.aminoType, QueryConsensusStateResponse.typeUrl); function createBaseQueryConsensusStatesRequest(): QueryConsensusStatesRequest { return { clientId: "", - pagination: PageRequest.fromPartial({}) + pagination: undefined }; } export const QueryConsensusStatesRequest = { typeUrl: "/ibc.core.client.v1.QueryConsensusStatesRequest", + aminoType: "cosmos-sdk/QueryConsensusStatesRequest", + is(o: any): o is QueryConsensusStatesRequest { + return o && (o.$typeUrl === QueryConsensusStatesRequest.typeUrl || typeof o.clientId === "string"); + }, + isSDK(o: any): o is QueryConsensusStatesRequestSDKType { + return o && (o.$typeUrl === QueryConsensusStatesRequest.typeUrl || typeof o.client_id === "string"); + }, + isAmino(o: any): o is QueryConsensusStatesRequestAmino { + return o && (o.$typeUrl === QueryConsensusStatesRequest.typeUrl || typeof o.client_id === "string"); + }, encode(message: QueryConsensusStatesRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.clientId !== "") { writer.uint32(10).string(message.clientId); @@ -1129,6 +1319,18 @@ export const QueryConsensusStatesRequest = { } return message; }, + fromJSON(object: any): QueryConsensusStatesRequest { + return { + clientId: isSet(object.clientId) ? String(object.clientId) : "", + pagination: isSet(object.pagination) ? PageRequest.fromJSON(object.pagination) : undefined + }; + }, + toJSON(message: QueryConsensusStatesRequest): unknown { + const obj: any = {}; + message.clientId !== undefined && (obj.clientId = message.clientId); + message.pagination !== undefined && (obj.pagination = message.pagination ? PageRequest.toJSON(message.pagination) : undefined); + return obj; + }, fromPartial(object: Partial): QueryConsensusStatesRequest { const message = createBaseQueryConsensusStatesRequest(); message.clientId = object.clientId ?? ""; @@ -1136,10 +1338,14 @@ export const QueryConsensusStatesRequest = { return message; }, fromAmino(object: QueryConsensusStatesRequestAmino): QueryConsensusStatesRequest { - return { - clientId: object.client_id, - pagination: object?.pagination ? PageRequest.fromAmino(object.pagination) : undefined - }; + const message = createBaseQueryConsensusStatesRequest(); + if (object.client_id !== undefined && object.client_id !== null) { + message.clientId = object.client_id; + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromAmino(object.pagination); + } + return message; }, toAmino(message: QueryConsensusStatesRequest): QueryConsensusStatesRequestAmino { const obj: any = {}; @@ -1169,14 +1375,26 @@ export const QueryConsensusStatesRequest = { }; } }; +GlobalDecoderRegistry.register(QueryConsensusStatesRequest.typeUrl, QueryConsensusStatesRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryConsensusStatesRequest.aminoType, QueryConsensusStatesRequest.typeUrl); function createBaseQueryConsensusStatesResponse(): QueryConsensusStatesResponse { return { consensusStates: [], - pagination: PageResponse.fromPartial({}) + pagination: undefined }; } export const QueryConsensusStatesResponse = { typeUrl: "/ibc.core.client.v1.QueryConsensusStatesResponse", + aminoType: "cosmos-sdk/QueryConsensusStatesResponse", + is(o: any): o is QueryConsensusStatesResponse { + return o && (o.$typeUrl === QueryConsensusStatesResponse.typeUrl || Array.isArray(o.consensusStates) && (!o.consensusStates.length || ConsensusStateWithHeight.is(o.consensusStates[0]))); + }, + isSDK(o: any): o is QueryConsensusStatesResponseSDKType { + return o && (o.$typeUrl === QueryConsensusStatesResponse.typeUrl || Array.isArray(o.consensus_states) && (!o.consensus_states.length || ConsensusStateWithHeight.isSDK(o.consensus_states[0]))); + }, + isAmino(o: any): o is QueryConsensusStatesResponseAmino { + return o && (o.$typeUrl === QueryConsensusStatesResponse.typeUrl || Array.isArray(o.consensus_states) && (!o.consensus_states.length || ConsensusStateWithHeight.isAmino(o.consensus_states[0]))); + }, encode(message: QueryConsensusStatesResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.consensusStates) { ConsensusStateWithHeight.encode(v!, writer.uint32(10).fork()).ldelim(); @@ -1206,6 +1424,22 @@ export const QueryConsensusStatesResponse = { } return message; }, + fromJSON(object: any): QueryConsensusStatesResponse { + return { + consensusStates: Array.isArray(object?.consensusStates) ? object.consensusStates.map((e: any) => ConsensusStateWithHeight.fromJSON(e)) : [], + pagination: isSet(object.pagination) ? PageResponse.fromJSON(object.pagination) : undefined + }; + }, + toJSON(message: QueryConsensusStatesResponse): unknown { + const obj: any = {}; + if (message.consensusStates) { + obj.consensusStates = message.consensusStates.map(e => e ? ConsensusStateWithHeight.toJSON(e) : undefined); + } else { + obj.consensusStates = []; + } + message.pagination !== undefined && (obj.pagination = message.pagination ? PageResponse.toJSON(message.pagination) : undefined); + return obj; + }, fromPartial(object: Partial): QueryConsensusStatesResponse { const message = createBaseQueryConsensusStatesResponse(); message.consensusStates = object.consensusStates?.map(e => ConsensusStateWithHeight.fromPartial(e)) || []; @@ -1213,10 +1447,12 @@ export const QueryConsensusStatesResponse = { return message; }, fromAmino(object: QueryConsensusStatesResponseAmino): QueryConsensusStatesResponse { - return { - consensusStates: Array.isArray(object?.consensus_states) ? object.consensus_states.map((e: any) => ConsensusStateWithHeight.fromAmino(e)) : [], - pagination: object?.pagination ? PageResponse.fromAmino(object.pagination) : undefined - }; + const message = createBaseQueryConsensusStatesResponse(); + message.consensusStates = object.consensus_states?.map(e => ConsensusStateWithHeight.fromAmino(e)) || []; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromAmino(object.pagination); + } + return message; }, toAmino(message: QueryConsensusStatesResponse): QueryConsensusStatesResponseAmino { const obj: any = {}; @@ -1250,14 +1486,26 @@ export const QueryConsensusStatesResponse = { }; } }; +GlobalDecoderRegistry.register(QueryConsensusStatesResponse.typeUrl, QueryConsensusStatesResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryConsensusStatesResponse.aminoType, QueryConsensusStatesResponse.typeUrl); function createBaseQueryConsensusStateHeightsRequest(): QueryConsensusStateHeightsRequest { return { clientId: "", - pagination: PageRequest.fromPartial({}) + pagination: undefined }; } export const QueryConsensusStateHeightsRequest = { typeUrl: "/ibc.core.client.v1.QueryConsensusStateHeightsRequest", + aminoType: "cosmos-sdk/QueryConsensusStateHeightsRequest", + is(o: any): o is QueryConsensusStateHeightsRequest { + return o && (o.$typeUrl === QueryConsensusStateHeightsRequest.typeUrl || typeof o.clientId === "string"); + }, + isSDK(o: any): o is QueryConsensusStateHeightsRequestSDKType { + return o && (o.$typeUrl === QueryConsensusStateHeightsRequest.typeUrl || typeof o.client_id === "string"); + }, + isAmino(o: any): o is QueryConsensusStateHeightsRequestAmino { + return o && (o.$typeUrl === QueryConsensusStateHeightsRequest.typeUrl || typeof o.client_id === "string"); + }, encode(message: QueryConsensusStateHeightsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.clientId !== "") { writer.uint32(10).string(message.clientId); @@ -1287,6 +1535,18 @@ export const QueryConsensusStateHeightsRequest = { } return message; }, + fromJSON(object: any): QueryConsensusStateHeightsRequest { + return { + clientId: isSet(object.clientId) ? String(object.clientId) : "", + pagination: isSet(object.pagination) ? PageRequest.fromJSON(object.pagination) : undefined + }; + }, + toJSON(message: QueryConsensusStateHeightsRequest): unknown { + const obj: any = {}; + message.clientId !== undefined && (obj.clientId = message.clientId); + message.pagination !== undefined && (obj.pagination = message.pagination ? PageRequest.toJSON(message.pagination) : undefined); + return obj; + }, fromPartial(object: Partial): QueryConsensusStateHeightsRequest { const message = createBaseQueryConsensusStateHeightsRequest(); message.clientId = object.clientId ?? ""; @@ -1294,10 +1554,14 @@ export const QueryConsensusStateHeightsRequest = { return message; }, fromAmino(object: QueryConsensusStateHeightsRequestAmino): QueryConsensusStateHeightsRequest { - return { - clientId: object.client_id, - pagination: object?.pagination ? PageRequest.fromAmino(object.pagination) : undefined - }; + const message = createBaseQueryConsensusStateHeightsRequest(); + if (object.client_id !== undefined && object.client_id !== null) { + message.clientId = object.client_id; + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromAmino(object.pagination); + } + return message; }, toAmino(message: QueryConsensusStateHeightsRequest): QueryConsensusStateHeightsRequestAmino { const obj: any = {}; @@ -1327,14 +1591,26 @@ export const QueryConsensusStateHeightsRequest = { }; } }; +GlobalDecoderRegistry.register(QueryConsensusStateHeightsRequest.typeUrl, QueryConsensusStateHeightsRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryConsensusStateHeightsRequest.aminoType, QueryConsensusStateHeightsRequest.typeUrl); function createBaseQueryConsensusStateHeightsResponse(): QueryConsensusStateHeightsResponse { return { consensusStateHeights: [], - pagination: PageResponse.fromPartial({}) + pagination: undefined }; } export const QueryConsensusStateHeightsResponse = { typeUrl: "/ibc.core.client.v1.QueryConsensusStateHeightsResponse", + aminoType: "cosmos-sdk/QueryConsensusStateHeightsResponse", + is(o: any): o is QueryConsensusStateHeightsResponse { + return o && (o.$typeUrl === QueryConsensusStateHeightsResponse.typeUrl || Array.isArray(o.consensusStateHeights) && (!o.consensusStateHeights.length || Height.is(o.consensusStateHeights[0]))); + }, + isSDK(o: any): o is QueryConsensusStateHeightsResponseSDKType { + return o && (o.$typeUrl === QueryConsensusStateHeightsResponse.typeUrl || Array.isArray(o.consensus_state_heights) && (!o.consensus_state_heights.length || Height.isSDK(o.consensus_state_heights[0]))); + }, + isAmino(o: any): o is QueryConsensusStateHeightsResponseAmino { + return o && (o.$typeUrl === QueryConsensusStateHeightsResponse.typeUrl || Array.isArray(o.consensus_state_heights) && (!o.consensus_state_heights.length || Height.isAmino(o.consensus_state_heights[0]))); + }, encode(message: QueryConsensusStateHeightsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.consensusStateHeights) { Height.encode(v!, writer.uint32(10).fork()).ldelim(); @@ -1364,6 +1640,22 @@ export const QueryConsensusStateHeightsResponse = { } return message; }, + fromJSON(object: any): QueryConsensusStateHeightsResponse { + return { + consensusStateHeights: Array.isArray(object?.consensusStateHeights) ? object.consensusStateHeights.map((e: any) => Height.fromJSON(e)) : [], + pagination: isSet(object.pagination) ? PageResponse.fromJSON(object.pagination) : undefined + }; + }, + toJSON(message: QueryConsensusStateHeightsResponse): unknown { + const obj: any = {}; + if (message.consensusStateHeights) { + obj.consensusStateHeights = message.consensusStateHeights.map(e => e ? Height.toJSON(e) : undefined); + } else { + obj.consensusStateHeights = []; + } + message.pagination !== undefined && (obj.pagination = message.pagination ? PageResponse.toJSON(message.pagination) : undefined); + return obj; + }, fromPartial(object: Partial): QueryConsensusStateHeightsResponse { const message = createBaseQueryConsensusStateHeightsResponse(); message.consensusStateHeights = object.consensusStateHeights?.map(e => Height.fromPartial(e)) || []; @@ -1371,10 +1663,12 @@ export const QueryConsensusStateHeightsResponse = { return message; }, fromAmino(object: QueryConsensusStateHeightsResponseAmino): QueryConsensusStateHeightsResponse { - return { - consensusStateHeights: Array.isArray(object?.consensus_state_heights) ? object.consensus_state_heights.map((e: any) => Height.fromAmino(e)) : [], - pagination: object?.pagination ? PageResponse.fromAmino(object.pagination) : undefined - }; + const message = createBaseQueryConsensusStateHeightsResponse(); + message.consensusStateHeights = object.consensus_state_heights?.map(e => Height.fromAmino(e)) || []; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromAmino(object.pagination); + } + return message; }, toAmino(message: QueryConsensusStateHeightsResponse): QueryConsensusStateHeightsResponseAmino { const obj: any = {}; @@ -1408,6 +1702,8 @@ export const QueryConsensusStateHeightsResponse = { }; } }; +GlobalDecoderRegistry.register(QueryConsensusStateHeightsResponse.typeUrl, QueryConsensusStateHeightsResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryConsensusStateHeightsResponse.aminoType, QueryConsensusStateHeightsResponse.typeUrl); function createBaseQueryClientStatusRequest(): QueryClientStatusRequest { return { clientId: "" @@ -1415,6 +1711,16 @@ function createBaseQueryClientStatusRequest(): QueryClientStatusRequest { } export const QueryClientStatusRequest = { typeUrl: "/ibc.core.client.v1.QueryClientStatusRequest", + aminoType: "cosmos-sdk/QueryClientStatusRequest", + is(o: any): o is QueryClientStatusRequest { + return o && (o.$typeUrl === QueryClientStatusRequest.typeUrl || typeof o.clientId === "string"); + }, + isSDK(o: any): o is QueryClientStatusRequestSDKType { + return o && (o.$typeUrl === QueryClientStatusRequest.typeUrl || typeof o.client_id === "string"); + }, + isAmino(o: any): o is QueryClientStatusRequestAmino { + return o && (o.$typeUrl === QueryClientStatusRequest.typeUrl || typeof o.client_id === "string"); + }, encode(message: QueryClientStatusRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.clientId !== "") { writer.uint32(10).string(message.clientId); @@ -1438,15 +1744,27 @@ export const QueryClientStatusRequest = { } return message; }, + fromJSON(object: any): QueryClientStatusRequest { + return { + clientId: isSet(object.clientId) ? String(object.clientId) : "" + }; + }, + toJSON(message: QueryClientStatusRequest): unknown { + const obj: any = {}; + message.clientId !== undefined && (obj.clientId = message.clientId); + return obj; + }, fromPartial(object: Partial): QueryClientStatusRequest { const message = createBaseQueryClientStatusRequest(); message.clientId = object.clientId ?? ""; return message; }, fromAmino(object: QueryClientStatusRequestAmino): QueryClientStatusRequest { - return { - clientId: object.client_id - }; + const message = createBaseQueryClientStatusRequest(); + if (object.client_id !== undefined && object.client_id !== null) { + message.clientId = object.client_id; + } + return message; }, toAmino(message: QueryClientStatusRequest): QueryClientStatusRequestAmino { const obj: any = {}; @@ -1475,6 +1793,8 @@ export const QueryClientStatusRequest = { }; } }; +GlobalDecoderRegistry.register(QueryClientStatusRequest.typeUrl, QueryClientStatusRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryClientStatusRequest.aminoType, QueryClientStatusRequest.typeUrl); function createBaseQueryClientStatusResponse(): QueryClientStatusResponse { return { status: "" @@ -1482,6 +1802,16 @@ function createBaseQueryClientStatusResponse(): QueryClientStatusResponse { } export const QueryClientStatusResponse = { typeUrl: "/ibc.core.client.v1.QueryClientStatusResponse", + aminoType: "cosmos-sdk/QueryClientStatusResponse", + is(o: any): o is QueryClientStatusResponse { + return o && (o.$typeUrl === QueryClientStatusResponse.typeUrl || typeof o.status === "string"); + }, + isSDK(o: any): o is QueryClientStatusResponseSDKType { + return o && (o.$typeUrl === QueryClientStatusResponse.typeUrl || typeof o.status === "string"); + }, + isAmino(o: any): o is QueryClientStatusResponseAmino { + return o && (o.$typeUrl === QueryClientStatusResponse.typeUrl || typeof o.status === "string"); + }, encode(message: QueryClientStatusResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.status !== "") { writer.uint32(10).string(message.status); @@ -1505,15 +1835,27 @@ export const QueryClientStatusResponse = { } return message; }, + fromJSON(object: any): QueryClientStatusResponse { + return { + status: isSet(object.status) ? String(object.status) : "" + }; + }, + toJSON(message: QueryClientStatusResponse): unknown { + const obj: any = {}; + message.status !== undefined && (obj.status = message.status); + return obj; + }, fromPartial(object: Partial): QueryClientStatusResponse { const message = createBaseQueryClientStatusResponse(); message.status = object.status ?? ""; return message; }, fromAmino(object: QueryClientStatusResponseAmino): QueryClientStatusResponse { - return { - status: object.status - }; + const message = createBaseQueryClientStatusResponse(); + if (object.status !== undefined && object.status !== null) { + message.status = object.status; + } + return message; }, toAmino(message: QueryClientStatusResponse): QueryClientStatusResponseAmino { const obj: any = {}; @@ -1542,11 +1884,23 @@ export const QueryClientStatusResponse = { }; } }; +GlobalDecoderRegistry.register(QueryClientStatusResponse.typeUrl, QueryClientStatusResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryClientStatusResponse.aminoType, QueryClientStatusResponse.typeUrl); function createBaseQueryClientParamsRequest(): QueryClientParamsRequest { return {}; } export const QueryClientParamsRequest = { typeUrl: "/ibc.core.client.v1.QueryClientParamsRequest", + aminoType: "cosmos-sdk/QueryClientParamsRequest", + is(o: any): o is QueryClientParamsRequest { + return o && o.$typeUrl === QueryClientParamsRequest.typeUrl; + }, + isSDK(o: any): o is QueryClientParamsRequestSDKType { + return o && o.$typeUrl === QueryClientParamsRequest.typeUrl; + }, + isAmino(o: any): o is QueryClientParamsRequestAmino { + return o && o.$typeUrl === QueryClientParamsRequest.typeUrl; + }, encode(_: QueryClientParamsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, @@ -1564,12 +1918,20 @@ export const QueryClientParamsRequest = { } return message; }, + fromJSON(_: any): QueryClientParamsRequest { + return {}; + }, + toJSON(_: QueryClientParamsRequest): unknown { + const obj: any = {}; + return obj; + }, fromPartial(_: Partial): QueryClientParamsRequest { const message = createBaseQueryClientParamsRequest(); return message; }, fromAmino(_: QueryClientParamsRequestAmino): QueryClientParamsRequest { - return {}; + const message = createBaseQueryClientParamsRequest(); + return message; }, toAmino(_: QueryClientParamsRequest): QueryClientParamsRequestAmino { const obj: any = {}; @@ -1597,13 +1959,25 @@ export const QueryClientParamsRequest = { }; } }; +GlobalDecoderRegistry.register(QueryClientParamsRequest.typeUrl, QueryClientParamsRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryClientParamsRequest.aminoType, QueryClientParamsRequest.typeUrl); function createBaseQueryClientParamsResponse(): QueryClientParamsResponse { return { - params: Params.fromPartial({}) + params: undefined }; } export const QueryClientParamsResponse = { typeUrl: "/ibc.core.client.v1.QueryClientParamsResponse", + aminoType: "cosmos-sdk/QueryClientParamsResponse", + is(o: any): o is QueryClientParamsResponse { + return o && o.$typeUrl === QueryClientParamsResponse.typeUrl; + }, + isSDK(o: any): o is QueryClientParamsResponseSDKType { + return o && o.$typeUrl === QueryClientParamsResponse.typeUrl; + }, + isAmino(o: any): o is QueryClientParamsResponseAmino { + return o && o.$typeUrl === QueryClientParamsResponse.typeUrl; + }, encode(message: QueryClientParamsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.params !== undefined) { Params.encode(message.params, writer.uint32(10).fork()).ldelim(); @@ -1627,15 +2001,27 @@ export const QueryClientParamsResponse = { } return message; }, + fromJSON(object: any): QueryClientParamsResponse { + return { + params: isSet(object.params) ? Params.fromJSON(object.params) : undefined + }; + }, + toJSON(message: QueryClientParamsResponse): unknown { + const obj: any = {}; + message.params !== undefined && (obj.params = message.params ? Params.toJSON(message.params) : undefined); + return obj; + }, fromPartial(object: Partial): QueryClientParamsResponse { const message = createBaseQueryClientParamsResponse(); message.params = object.params !== undefined && object.params !== null ? Params.fromPartial(object.params) : undefined; return message; }, fromAmino(object: QueryClientParamsResponseAmino): QueryClientParamsResponse { - return { - params: object?.params ? Params.fromAmino(object.params) : undefined - }; + const message = createBaseQueryClientParamsResponse(); + if (object.params !== undefined && object.params !== null) { + message.params = Params.fromAmino(object.params); + } + return message; }, toAmino(message: QueryClientParamsResponse): QueryClientParamsResponseAmino { const obj: any = {}; @@ -1664,11 +2050,23 @@ export const QueryClientParamsResponse = { }; } }; +GlobalDecoderRegistry.register(QueryClientParamsResponse.typeUrl, QueryClientParamsResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryClientParamsResponse.aminoType, QueryClientParamsResponse.typeUrl); function createBaseQueryUpgradedClientStateRequest(): QueryUpgradedClientStateRequest { return {}; } export const QueryUpgradedClientStateRequest = { typeUrl: "/ibc.core.client.v1.QueryUpgradedClientStateRequest", + aminoType: "cosmos-sdk/QueryUpgradedClientStateRequest", + is(o: any): o is QueryUpgradedClientStateRequest { + return o && o.$typeUrl === QueryUpgradedClientStateRequest.typeUrl; + }, + isSDK(o: any): o is QueryUpgradedClientStateRequestSDKType { + return o && o.$typeUrl === QueryUpgradedClientStateRequest.typeUrl; + }, + isAmino(o: any): o is QueryUpgradedClientStateRequestAmino { + return o && o.$typeUrl === QueryUpgradedClientStateRequest.typeUrl; + }, encode(_: QueryUpgradedClientStateRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, @@ -1686,12 +2084,20 @@ export const QueryUpgradedClientStateRequest = { } return message; }, + fromJSON(_: any): QueryUpgradedClientStateRequest { + return {}; + }, + toJSON(_: QueryUpgradedClientStateRequest): unknown { + const obj: any = {}; + return obj; + }, fromPartial(_: Partial): QueryUpgradedClientStateRequest { const message = createBaseQueryUpgradedClientStateRequest(); return message; }, fromAmino(_: QueryUpgradedClientStateRequestAmino): QueryUpgradedClientStateRequest { - return {}; + const message = createBaseQueryUpgradedClientStateRequest(); + return message; }, toAmino(_: QueryUpgradedClientStateRequest): QueryUpgradedClientStateRequestAmino { const obj: any = {}; @@ -1719,6 +2125,8 @@ export const QueryUpgradedClientStateRequest = { }; } }; +GlobalDecoderRegistry.register(QueryUpgradedClientStateRequest.typeUrl, QueryUpgradedClientStateRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryUpgradedClientStateRequest.aminoType, QueryUpgradedClientStateRequest.typeUrl); function createBaseQueryUpgradedClientStateResponse(): QueryUpgradedClientStateResponse { return { upgradedClientState: undefined @@ -1726,6 +2134,16 @@ function createBaseQueryUpgradedClientStateResponse(): QueryUpgradedClientStateR } export const QueryUpgradedClientStateResponse = { typeUrl: "/ibc.core.client.v1.QueryUpgradedClientStateResponse", + aminoType: "cosmos-sdk/QueryUpgradedClientStateResponse", + is(o: any): o is QueryUpgradedClientStateResponse { + return o && o.$typeUrl === QueryUpgradedClientStateResponse.typeUrl; + }, + isSDK(o: any): o is QueryUpgradedClientStateResponseSDKType { + return o && o.$typeUrl === QueryUpgradedClientStateResponse.typeUrl; + }, + isAmino(o: any): o is QueryUpgradedClientStateResponseAmino { + return o && o.$typeUrl === QueryUpgradedClientStateResponse.typeUrl; + }, encode(message: QueryUpgradedClientStateResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.upgradedClientState !== undefined) { Any.encode(message.upgradedClientState, writer.uint32(10).fork()).ldelim(); @@ -1749,15 +2167,27 @@ export const QueryUpgradedClientStateResponse = { } return message; }, + fromJSON(object: any): QueryUpgradedClientStateResponse { + return { + upgradedClientState: isSet(object.upgradedClientState) ? Any.fromJSON(object.upgradedClientState) : undefined + }; + }, + toJSON(message: QueryUpgradedClientStateResponse): unknown { + const obj: any = {}; + message.upgradedClientState !== undefined && (obj.upgradedClientState = message.upgradedClientState ? Any.toJSON(message.upgradedClientState) : undefined); + return obj; + }, fromPartial(object: Partial): QueryUpgradedClientStateResponse { const message = createBaseQueryUpgradedClientStateResponse(); message.upgradedClientState = object.upgradedClientState !== undefined && object.upgradedClientState !== null ? Any.fromPartial(object.upgradedClientState) : undefined; return message; }, fromAmino(object: QueryUpgradedClientStateResponseAmino): QueryUpgradedClientStateResponse { - return { - upgradedClientState: object?.upgraded_client_state ? Any.fromAmino(object.upgraded_client_state) : undefined - }; + const message = createBaseQueryUpgradedClientStateResponse(); + if (object.upgraded_client_state !== undefined && object.upgraded_client_state !== null) { + message.upgradedClientState = Any.fromAmino(object.upgraded_client_state); + } + return message; }, toAmino(message: QueryUpgradedClientStateResponse): QueryUpgradedClientStateResponseAmino { const obj: any = {}; @@ -1786,11 +2216,23 @@ export const QueryUpgradedClientStateResponse = { }; } }; +GlobalDecoderRegistry.register(QueryUpgradedClientStateResponse.typeUrl, QueryUpgradedClientStateResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryUpgradedClientStateResponse.aminoType, QueryUpgradedClientStateResponse.typeUrl); function createBaseQueryUpgradedConsensusStateRequest(): QueryUpgradedConsensusStateRequest { return {}; } export const QueryUpgradedConsensusStateRequest = { typeUrl: "/ibc.core.client.v1.QueryUpgradedConsensusStateRequest", + aminoType: "cosmos-sdk/QueryUpgradedConsensusStateRequest", + is(o: any): o is QueryUpgradedConsensusStateRequest { + return o && o.$typeUrl === QueryUpgradedConsensusStateRequest.typeUrl; + }, + isSDK(o: any): o is QueryUpgradedConsensusStateRequestSDKType { + return o && o.$typeUrl === QueryUpgradedConsensusStateRequest.typeUrl; + }, + isAmino(o: any): o is QueryUpgradedConsensusStateRequestAmino { + return o && o.$typeUrl === QueryUpgradedConsensusStateRequest.typeUrl; + }, encode(_: QueryUpgradedConsensusStateRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, @@ -1808,12 +2250,20 @@ export const QueryUpgradedConsensusStateRequest = { } return message; }, + fromJSON(_: any): QueryUpgradedConsensusStateRequest { + return {}; + }, + toJSON(_: QueryUpgradedConsensusStateRequest): unknown { + const obj: any = {}; + return obj; + }, fromPartial(_: Partial): QueryUpgradedConsensusStateRequest { const message = createBaseQueryUpgradedConsensusStateRequest(); return message; }, fromAmino(_: QueryUpgradedConsensusStateRequestAmino): QueryUpgradedConsensusStateRequest { - return {}; + const message = createBaseQueryUpgradedConsensusStateRequest(); + return message; }, toAmino(_: QueryUpgradedConsensusStateRequest): QueryUpgradedConsensusStateRequestAmino { const obj: any = {}; @@ -1841,6 +2291,8 @@ export const QueryUpgradedConsensusStateRequest = { }; } }; +GlobalDecoderRegistry.register(QueryUpgradedConsensusStateRequest.typeUrl, QueryUpgradedConsensusStateRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryUpgradedConsensusStateRequest.aminoType, QueryUpgradedConsensusStateRequest.typeUrl); function createBaseQueryUpgradedConsensusStateResponse(): QueryUpgradedConsensusStateResponse { return { upgradedConsensusState: undefined @@ -1848,6 +2300,16 @@ function createBaseQueryUpgradedConsensusStateResponse(): QueryUpgradedConsensus } export const QueryUpgradedConsensusStateResponse = { typeUrl: "/ibc.core.client.v1.QueryUpgradedConsensusStateResponse", + aminoType: "cosmos-sdk/QueryUpgradedConsensusStateResponse", + is(o: any): o is QueryUpgradedConsensusStateResponse { + return o && o.$typeUrl === QueryUpgradedConsensusStateResponse.typeUrl; + }, + isSDK(o: any): o is QueryUpgradedConsensusStateResponseSDKType { + return o && o.$typeUrl === QueryUpgradedConsensusStateResponse.typeUrl; + }, + isAmino(o: any): o is QueryUpgradedConsensusStateResponseAmino { + return o && o.$typeUrl === QueryUpgradedConsensusStateResponse.typeUrl; + }, encode(message: QueryUpgradedConsensusStateResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.upgradedConsensusState !== undefined) { Any.encode(message.upgradedConsensusState, writer.uint32(10).fork()).ldelim(); @@ -1871,15 +2333,27 @@ export const QueryUpgradedConsensusStateResponse = { } return message; }, + fromJSON(object: any): QueryUpgradedConsensusStateResponse { + return { + upgradedConsensusState: isSet(object.upgradedConsensusState) ? Any.fromJSON(object.upgradedConsensusState) : undefined + }; + }, + toJSON(message: QueryUpgradedConsensusStateResponse): unknown { + const obj: any = {}; + message.upgradedConsensusState !== undefined && (obj.upgradedConsensusState = message.upgradedConsensusState ? Any.toJSON(message.upgradedConsensusState) : undefined); + return obj; + }, fromPartial(object: Partial): QueryUpgradedConsensusStateResponse { const message = createBaseQueryUpgradedConsensusStateResponse(); message.upgradedConsensusState = object.upgradedConsensusState !== undefined && object.upgradedConsensusState !== null ? Any.fromPartial(object.upgradedConsensusState) : undefined; return message; }, fromAmino(object: QueryUpgradedConsensusStateResponseAmino): QueryUpgradedConsensusStateResponse { - return { - upgradedConsensusState: object?.upgraded_consensus_state ? Any.fromAmino(object.upgraded_consensus_state) : undefined - }; + const message = createBaseQueryUpgradedConsensusStateResponse(); + if (object.upgraded_consensus_state !== undefined && object.upgraded_consensus_state !== null) { + message.upgradedConsensusState = Any.fromAmino(object.upgraded_consensus_state); + } + return message; }, toAmino(message: QueryUpgradedConsensusStateResponse): QueryUpgradedConsensusStateResponseAmino { const obj: any = {}; @@ -1907,4 +2381,6 @@ export const QueryUpgradedConsensusStateResponse = { value: QueryUpgradedConsensusStateResponse.encode(message).finish() }; } -}; \ No newline at end of file +}; +GlobalDecoderRegistry.register(QueryUpgradedConsensusStateResponse.typeUrl, QueryUpgradedConsensusStateResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryUpgradedConsensusStateResponse.aminoType, QueryUpgradedConsensusStateResponse.typeUrl); \ No newline at end of file diff --git a/packages/osmojs/src/codegen/ibc/core/client/v1/tx.amino.ts b/packages/osmojs/src/codegen/ibc/core/client/v1/tx.amino.ts index 1e8e1dca1..b299f61d0 100644 --- a/packages/osmojs/src/codegen/ibc/core/client/v1/tx.amino.ts +++ b/packages/osmojs/src/codegen/ibc/core/client/v1/tx.amino.ts @@ -1,5 +1,5 @@ //@ts-nocheck -import { MsgCreateClient, MsgUpdateClient, MsgUpgradeClient, MsgSubmitMisbehaviour } from "./tx"; +import { MsgCreateClient, MsgUpdateClient, MsgUpgradeClient, MsgSubmitMisbehaviour, MsgRecoverClient, MsgIBCSoftwareUpgrade, MsgUpdateParams } from "./tx"; export const AminoConverter = { "/ibc.core.client.v1.MsgCreateClient": { aminoType: "cosmos-sdk/MsgCreateClient", @@ -20,5 +20,20 @@ export const AminoConverter = { aminoType: "cosmos-sdk/MsgSubmitMisbehaviour", toAmino: MsgSubmitMisbehaviour.toAmino, fromAmino: MsgSubmitMisbehaviour.fromAmino + }, + "/ibc.core.client.v1.MsgRecoverClient": { + aminoType: "cosmos-sdk/MsgRecoverClient", + toAmino: MsgRecoverClient.toAmino, + fromAmino: MsgRecoverClient.fromAmino + }, + "/ibc.core.client.v1.MsgIBCSoftwareUpgrade": { + aminoType: "cosmos-sdk/MsgIBCSoftwareUpgrade", + toAmino: MsgIBCSoftwareUpgrade.toAmino, + fromAmino: MsgIBCSoftwareUpgrade.fromAmino + }, + "/ibc.core.client.v1.MsgUpdateParams": { + aminoType: "cosmos-sdk/MsgUpdateParams", + toAmino: MsgUpdateParams.toAmino, + fromAmino: MsgUpdateParams.fromAmino } }; \ No newline at end of file diff --git a/packages/osmojs/src/codegen/ibc/core/client/v1/tx.registry.ts b/packages/osmojs/src/codegen/ibc/core/client/v1/tx.registry.ts index fe83153f9..d20eaa2e8 100644 --- a/packages/osmojs/src/codegen/ibc/core/client/v1/tx.registry.ts +++ b/packages/osmojs/src/codegen/ibc/core/client/v1/tx.registry.ts @@ -1,7 +1,7 @@ //@ts-nocheck import { GeneratedType, Registry } from "@cosmjs/proto-signing"; -import { MsgCreateClient, MsgUpdateClient, MsgUpgradeClient, MsgSubmitMisbehaviour } from "./tx"; -export const registry: ReadonlyArray<[string, GeneratedType]> = [["/ibc.core.client.v1.MsgCreateClient", MsgCreateClient], ["/ibc.core.client.v1.MsgUpdateClient", MsgUpdateClient], ["/ibc.core.client.v1.MsgUpgradeClient", MsgUpgradeClient], ["/ibc.core.client.v1.MsgSubmitMisbehaviour", MsgSubmitMisbehaviour]]; +import { MsgCreateClient, MsgUpdateClient, MsgUpgradeClient, MsgSubmitMisbehaviour, MsgRecoverClient, MsgIBCSoftwareUpgrade, MsgUpdateParams } from "./tx"; +export const registry: ReadonlyArray<[string, GeneratedType]> = [["/ibc.core.client.v1.MsgCreateClient", MsgCreateClient], ["/ibc.core.client.v1.MsgUpdateClient", MsgUpdateClient], ["/ibc.core.client.v1.MsgUpgradeClient", MsgUpgradeClient], ["/ibc.core.client.v1.MsgSubmitMisbehaviour", MsgSubmitMisbehaviour], ["/ibc.core.client.v1.MsgRecoverClient", MsgRecoverClient], ["/ibc.core.client.v1.MsgIBCSoftwareUpgrade", MsgIBCSoftwareUpgrade], ["/ibc.core.client.v1.MsgUpdateParams", MsgUpdateParams]]; export const load = (protoRegistry: Registry) => { registry.forEach(([typeUrl, mod]) => { protoRegistry.register(typeUrl, mod); @@ -32,6 +32,24 @@ export const MessageComposer = { typeUrl: "/ibc.core.client.v1.MsgSubmitMisbehaviour", value: MsgSubmitMisbehaviour.encode(value).finish() }; + }, + recoverClient(value: MsgRecoverClient) { + return { + typeUrl: "/ibc.core.client.v1.MsgRecoverClient", + value: MsgRecoverClient.encode(value).finish() + }; + }, + iBCSoftwareUpgrade(value: MsgIBCSoftwareUpgrade) { + return { + typeUrl: "/ibc.core.client.v1.MsgIBCSoftwareUpgrade", + value: MsgIBCSoftwareUpgrade.encode(value).finish() + }; + }, + updateClientParams(value: MsgUpdateParams) { + return { + typeUrl: "/ibc.core.client.v1.MsgUpdateParams", + value: MsgUpdateParams.encode(value).finish() + }; } }, withTypeUrl: { @@ -58,6 +76,112 @@ export const MessageComposer = { typeUrl: "/ibc.core.client.v1.MsgSubmitMisbehaviour", value }; + }, + recoverClient(value: MsgRecoverClient) { + return { + typeUrl: "/ibc.core.client.v1.MsgRecoverClient", + value + }; + }, + iBCSoftwareUpgrade(value: MsgIBCSoftwareUpgrade) { + return { + typeUrl: "/ibc.core.client.v1.MsgIBCSoftwareUpgrade", + value + }; + }, + updateClientParams(value: MsgUpdateParams) { + return { + typeUrl: "/ibc.core.client.v1.MsgUpdateParams", + value + }; + } + }, + toJSON: { + createClient(value: MsgCreateClient) { + return { + typeUrl: "/ibc.core.client.v1.MsgCreateClient", + value: MsgCreateClient.toJSON(value) + }; + }, + updateClient(value: MsgUpdateClient) { + return { + typeUrl: "/ibc.core.client.v1.MsgUpdateClient", + value: MsgUpdateClient.toJSON(value) + }; + }, + upgradeClient(value: MsgUpgradeClient) { + return { + typeUrl: "/ibc.core.client.v1.MsgUpgradeClient", + value: MsgUpgradeClient.toJSON(value) + }; + }, + submitMisbehaviour(value: MsgSubmitMisbehaviour) { + return { + typeUrl: "/ibc.core.client.v1.MsgSubmitMisbehaviour", + value: MsgSubmitMisbehaviour.toJSON(value) + }; + }, + recoverClient(value: MsgRecoverClient) { + return { + typeUrl: "/ibc.core.client.v1.MsgRecoverClient", + value: MsgRecoverClient.toJSON(value) + }; + }, + iBCSoftwareUpgrade(value: MsgIBCSoftwareUpgrade) { + return { + typeUrl: "/ibc.core.client.v1.MsgIBCSoftwareUpgrade", + value: MsgIBCSoftwareUpgrade.toJSON(value) + }; + }, + updateClientParams(value: MsgUpdateParams) { + return { + typeUrl: "/ibc.core.client.v1.MsgUpdateParams", + value: MsgUpdateParams.toJSON(value) + }; + } + }, + fromJSON: { + createClient(value: any) { + return { + typeUrl: "/ibc.core.client.v1.MsgCreateClient", + value: MsgCreateClient.fromJSON(value) + }; + }, + updateClient(value: any) { + return { + typeUrl: "/ibc.core.client.v1.MsgUpdateClient", + value: MsgUpdateClient.fromJSON(value) + }; + }, + upgradeClient(value: any) { + return { + typeUrl: "/ibc.core.client.v1.MsgUpgradeClient", + value: MsgUpgradeClient.fromJSON(value) + }; + }, + submitMisbehaviour(value: any) { + return { + typeUrl: "/ibc.core.client.v1.MsgSubmitMisbehaviour", + value: MsgSubmitMisbehaviour.fromJSON(value) + }; + }, + recoverClient(value: any) { + return { + typeUrl: "/ibc.core.client.v1.MsgRecoverClient", + value: MsgRecoverClient.fromJSON(value) + }; + }, + iBCSoftwareUpgrade(value: any) { + return { + typeUrl: "/ibc.core.client.v1.MsgIBCSoftwareUpgrade", + value: MsgIBCSoftwareUpgrade.fromJSON(value) + }; + }, + updateClientParams(value: any) { + return { + typeUrl: "/ibc.core.client.v1.MsgUpdateParams", + value: MsgUpdateParams.fromJSON(value) + }; } }, fromPartial: { @@ -84,6 +208,24 @@ export const MessageComposer = { typeUrl: "/ibc.core.client.v1.MsgSubmitMisbehaviour", value: MsgSubmitMisbehaviour.fromPartial(value) }; + }, + recoverClient(value: MsgRecoverClient) { + return { + typeUrl: "/ibc.core.client.v1.MsgRecoverClient", + value: MsgRecoverClient.fromPartial(value) + }; + }, + iBCSoftwareUpgrade(value: MsgIBCSoftwareUpgrade) { + return { + typeUrl: "/ibc.core.client.v1.MsgIBCSoftwareUpgrade", + value: MsgIBCSoftwareUpgrade.fromPartial(value) + }; + }, + updateClientParams(value: MsgUpdateParams) { + return { + typeUrl: "/ibc.core.client.v1.MsgUpdateParams", + value: MsgUpdateParams.fromPartial(value) + }; } } }; \ No newline at end of file diff --git a/packages/osmojs/src/codegen/ibc/core/client/v1/tx.rpc.msg.ts b/packages/osmojs/src/codegen/ibc/core/client/v1/tx.rpc.msg.ts index 29890ac80..bd71c4037 100644 --- a/packages/osmojs/src/codegen/ibc/core/client/v1/tx.rpc.msg.ts +++ b/packages/osmojs/src/codegen/ibc/core/client/v1/tx.rpc.msg.ts @@ -1,6 +1,6 @@ import { Rpc } from "../../../../helpers"; import { BinaryReader } from "../../../../binary"; -import { MsgCreateClient, MsgCreateClientResponse, MsgUpdateClient, MsgUpdateClientResponse, MsgUpgradeClient, MsgUpgradeClientResponse, MsgSubmitMisbehaviour, MsgSubmitMisbehaviourResponse } from "./tx"; +import { MsgCreateClient, MsgCreateClientResponse, MsgUpdateClient, MsgUpdateClientResponse, MsgUpgradeClient, MsgUpgradeClientResponse, MsgSubmitMisbehaviour, MsgSubmitMisbehaviourResponse, MsgRecoverClient, MsgRecoverClientResponse, MsgIBCSoftwareUpgrade, MsgIBCSoftwareUpgradeResponse, MsgUpdateParams, MsgUpdateParamsResponse } from "./tx"; /** Msg defines the ibc/client Msg service. */ export interface Msg { /** CreateClient defines a rpc handler method for MsgCreateClient. */ @@ -11,6 +11,12 @@ export interface Msg { upgradeClient(request: MsgUpgradeClient): Promise; /** SubmitMisbehaviour defines a rpc handler method for MsgSubmitMisbehaviour. */ submitMisbehaviour(request: MsgSubmitMisbehaviour): Promise; + /** RecoverClient defines a rpc handler method for MsgRecoverClient. */ + recoverClient(request: MsgRecoverClient): Promise; + /** IBCSoftwareUpgrade defines a rpc handler method for MsgIBCSoftwareUpgrade. */ + iBCSoftwareUpgrade(request: MsgIBCSoftwareUpgrade): Promise; + /** UpdateClientParams defines a rpc handler method for MsgUpdateParams. */ + updateClientParams(request: MsgUpdateParams): Promise; } export class MsgClientImpl implements Msg { private readonly rpc: Rpc; @@ -20,6 +26,9 @@ export class MsgClientImpl implements Msg { this.updateClient = this.updateClient.bind(this); this.upgradeClient = this.upgradeClient.bind(this); this.submitMisbehaviour = this.submitMisbehaviour.bind(this); + this.recoverClient = this.recoverClient.bind(this); + this.iBCSoftwareUpgrade = this.iBCSoftwareUpgrade.bind(this); + this.updateClientParams = this.updateClientParams.bind(this); } createClient(request: MsgCreateClient): Promise { const data = MsgCreateClient.encode(request).finish(); @@ -41,4 +50,22 @@ export class MsgClientImpl implements Msg { const promise = this.rpc.request("ibc.core.client.v1.Msg", "SubmitMisbehaviour", data); return promise.then(data => MsgSubmitMisbehaviourResponse.decode(new BinaryReader(data))); } -} \ No newline at end of file + recoverClient(request: MsgRecoverClient): Promise { + const data = MsgRecoverClient.encode(request).finish(); + const promise = this.rpc.request("ibc.core.client.v1.Msg", "RecoverClient", data); + return promise.then(data => MsgRecoverClientResponse.decode(new BinaryReader(data))); + } + iBCSoftwareUpgrade(request: MsgIBCSoftwareUpgrade): Promise { + const data = MsgIBCSoftwareUpgrade.encode(request).finish(); + const promise = this.rpc.request("ibc.core.client.v1.Msg", "IBCSoftwareUpgrade", data); + return promise.then(data => MsgIBCSoftwareUpgradeResponse.decode(new BinaryReader(data))); + } + updateClientParams(request: MsgUpdateParams): Promise { + const data = MsgUpdateParams.encode(request).finish(); + const promise = this.rpc.request("ibc.core.client.v1.Msg", "UpdateClientParams", data); + return promise.then(data => MsgUpdateParamsResponse.decode(new BinaryReader(data))); + } +} +export const createClientImpl = (rpc: Rpc) => { + return new MsgClientImpl(rpc); +}; \ No newline at end of file diff --git a/packages/osmojs/src/codegen/ibc/core/client/v1/tx.ts b/packages/osmojs/src/codegen/ibc/core/client/v1/tx.ts index 6e629ae28..b75305f47 100644 --- a/packages/osmojs/src/codegen/ibc/core/client/v1/tx.ts +++ b/packages/osmojs/src/codegen/ibc/core/client/v1/tx.ts @@ -1,14 +1,18 @@ import { Any, AnyAmino, AnySDKType } from "../../../../google/protobuf/any"; +import { Plan, PlanAmino, PlanSDKType } from "../../../../cosmos/upgrade/v1beta1/upgrade"; +import { Params, ParamsAmino, ParamsSDKType } from "./client"; import { BinaryReader, BinaryWriter } from "../../../../binary"; +import { isSet, bytesFromBase64, base64FromBytes } from "../../../../helpers"; +import { GlobalDecoderRegistry } from "../../../../registry"; /** MsgCreateClient defines a message to create an IBC client */ export interface MsgCreateClient { /** light client state */ - clientState: Any; + clientState?: Any; /** * consensus state associated with the client that corresponds to a given * height. */ - consensusState: Any; + consensusState?: Any; /** signer address */ signer: string; } @@ -26,7 +30,7 @@ export interface MsgCreateClientAmino { */ consensus_state?: AnyAmino; /** signer address */ - signer: string; + signer?: string; } export interface MsgCreateClientAminoMsg { type: "cosmos-sdk/MsgCreateClient"; @@ -34,8 +38,8 @@ export interface MsgCreateClientAminoMsg { } /** MsgCreateClient defines a message to create an IBC client */ export interface MsgCreateClientSDKType { - client_state: AnySDKType; - consensus_state: AnySDKType; + client_state?: AnySDKType; + consensus_state?: AnySDKType; signer: string; } /** MsgCreateClientResponse defines the Msg/CreateClient response type. */ @@ -60,7 +64,7 @@ export interface MsgUpdateClient { /** client unique identifier */ clientId: string; /** client message to update the light client */ - clientMessage: Any; + clientMessage?: Any; /** signer address */ signer: string; } @@ -74,11 +78,11 @@ export interface MsgUpdateClientProtoMsg { */ export interface MsgUpdateClientAmino { /** client unique identifier */ - client_id: string; + client_id?: string; /** client message to update the light client */ client_message?: AnyAmino; /** signer address */ - signer: string; + signer?: string; } export interface MsgUpdateClientAminoMsg { type: "cosmos-sdk/MsgUpdateClient"; @@ -90,7 +94,7 @@ export interface MsgUpdateClientAminoMsg { */ export interface MsgUpdateClientSDKType { client_id: string; - client_message: AnySDKType; + client_message?: AnySDKType; signer: string; } /** MsgUpdateClientResponse defines the Msg/UpdateClient response type. */ @@ -115,12 +119,12 @@ export interface MsgUpgradeClient { /** client unique identifier */ clientId: string; /** upgraded client state */ - clientState: Any; + clientState?: Any; /** * upgraded consensus state, only contains enough information to serve as a * basis of trust in update logic */ - consensusState: Any; + consensusState?: Any; /** proof that old chain committed to new client */ proofUpgradeClient: Uint8Array; /** proof that old chain committed to new consensus state */ @@ -138,7 +142,7 @@ export interface MsgUpgradeClientProtoMsg { */ export interface MsgUpgradeClientAmino { /** client unique identifier */ - client_id: string; + client_id?: string; /** upgraded client state */ client_state?: AnyAmino; /** @@ -147,11 +151,11 @@ export interface MsgUpgradeClientAmino { */ consensus_state?: AnyAmino; /** proof that old chain committed to new client */ - proof_upgrade_client: Uint8Array; + proof_upgrade_client?: string; /** proof that old chain committed to new consensus state */ - proof_upgrade_consensus_state: Uint8Array; + proof_upgrade_consensus_state?: string; /** signer address */ - signer: string; + signer?: string; } export interface MsgUpgradeClientAminoMsg { type: "cosmos-sdk/MsgUpgradeClient"; @@ -163,8 +167,8 @@ export interface MsgUpgradeClientAminoMsg { */ export interface MsgUpgradeClientSDKType { client_id: string; - client_state: AnySDKType; - consensus_state: AnySDKType; + client_state?: AnySDKType; + consensus_state?: AnySDKType; proof_upgrade_client: Uint8Array; proof_upgrade_consensus_state: Uint8Array; signer: string; @@ -186,17 +190,15 @@ export interface MsgUpgradeClientResponseSDKType {} /** * MsgSubmitMisbehaviour defines an sdk.Msg type that submits Evidence for * light client misbehaviour. - * Warning: DEPRECATED + * This message has been deprecated. Use MsgUpdateClient instead. */ +/** @deprecated */ export interface MsgSubmitMisbehaviour { /** client unique identifier */ - /** @deprecated */ clientId: string; /** misbehaviour used for freezing the light client */ - /** @deprecated */ - misbehaviour: Any; + misbehaviour?: Any; /** signer address */ - /** @deprecated */ signer: string; } export interface MsgSubmitMisbehaviourProtoMsg { @@ -206,18 +208,16 @@ export interface MsgSubmitMisbehaviourProtoMsg { /** * MsgSubmitMisbehaviour defines an sdk.Msg type that submits Evidence for * light client misbehaviour. - * Warning: DEPRECATED + * This message has been deprecated. Use MsgUpdateClient instead. */ +/** @deprecated */ export interface MsgSubmitMisbehaviourAmino { /** client unique identifier */ - /** @deprecated */ - client_id: string; + client_id?: string; /** misbehaviour used for freezing the light client */ - /** @deprecated */ misbehaviour?: AnyAmino; /** signer address */ - /** @deprecated */ - signer: string; + signer?: string; } export interface MsgSubmitMisbehaviourAminoMsg { type: "cosmos-sdk/MsgSubmitMisbehaviour"; @@ -226,14 +226,12 @@ export interface MsgSubmitMisbehaviourAminoMsg { /** * MsgSubmitMisbehaviour defines an sdk.Msg type that submits Evidence for * light client misbehaviour. - * Warning: DEPRECATED + * This message has been deprecated. Use MsgUpdateClient instead. */ +/** @deprecated */ export interface MsgSubmitMisbehaviourSDKType { - /** @deprecated */ client_id: string; - /** @deprecated */ - misbehaviour: AnySDKType; - /** @deprecated */ + misbehaviour?: AnySDKType; signer: string; } /** @@ -259,6 +257,169 @@ export interface MsgSubmitMisbehaviourResponseAminoMsg { * type. */ export interface MsgSubmitMisbehaviourResponseSDKType {} +/** MsgRecoverClient defines the message used to recover a frozen or expired client. */ +export interface MsgRecoverClient { + /** the client identifier for the client to be updated if the proposal passes */ + subjectClientId: string; + /** + * the substitute client identifier for the client which will replace the subject + * client + */ + substituteClientId: string; + /** signer address */ + signer: string; +} +export interface MsgRecoverClientProtoMsg { + typeUrl: "/ibc.core.client.v1.MsgRecoverClient"; + value: Uint8Array; +} +/** MsgRecoverClient defines the message used to recover a frozen or expired client. */ +export interface MsgRecoverClientAmino { + /** the client identifier for the client to be updated if the proposal passes */ + subject_client_id?: string; + /** + * the substitute client identifier for the client which will replace the subject + * client + */ + substitute_client_id?: string; + /** signer address */ + signer?: string; +} +export interface MsgRecoverClientAminoMsg { + type: "cosmos-sdk/MsgRecoverClient"; + value: MsgRecoverClientAmino; +} +/** MsgRecoverClient defines the message used to recover a frozen or expired client. */ +export interface MsgRecoverClientSDKType { + subject_client_id: string; + substitute_client_id: string; + signer: string; +} +/** MsgRecoverClientResponse defines the Msg/RecoverClient response type. */ +export interface MsgRecoverClientResponse {} +export interface MsgRecoverClientResponseProtoMsg { + typeUrl: "/ibc.core.client.v1.MsgRecoverClientResponse"; + value: Uint8Array; +} +/** MsgRecoverClientResponse defines the Msg/RecoverClient response type. */ +export interface MsgRecoverClientResponseAmino {} +export interface MsgRecoverClientResponseAminoMsg { + type: "cosmos-sdk/MsgRecoverClientResponse"; + value: MsgRecoverClientResponseAmino; +} +/** MsgRecoverClientResponse defines the Msg/RecoverClient response type. */ +export interface MsgRecoverClientResponseSDKType {} +/** MsgIBCSoftwareUpgrade defines the message used to schedule an upgrade of an IBC client using a v1 governance proposal */ +export interface MsgIBCSoftwareUpgrade { + plan: Plan; + /** + * An UpgradedClientState must be provided to perform an IBC breaking upgrade. + * This will make the chain commit to the correct upgraded (self) client state + * before the upgrade occurs, so that connecting chains can verify that the + * new upgraded client is valid by verifying a proof on the previous version + * of the chain. This will allow IBC connections to persist smoothly across + * planned chain upgrades. Correspondingly, the UpgradedClientState field has been + * deprecated in the Cosmos SDK to allow for this logic to exist solely in + * the 02-client module. + */ + upgradedClientState?: Any; + /** signer address */ + signer: string; +} +export interface MsgIBCSoftwareUpgradeProtoMsg { + typeUrl: "/ibc.core.client.v1.MsgIBCSoftwareUpgrade"; + value: Uint8Array; +} +/** MsgIBCSoftwareUpgrade defines the message used to schedule an upgrade of an IBC client using a v1 governance proposal */ +export interface MsgIBCSoftwareUpgradeAmino { + plan?: PlanAmino; + /** + * An UpgradedClientState must be provided to perform an IBC breaking upgrade. + * This will make the chain commit to the correct upgraded (self) client state + * before the upgrade occurs, so that connecting chains can verify that the + * new upgraded client is valid by verifying a proof on the previous version + * of the chain. This will allow IBC connections to persist smoothly across + * planned chain upgrades. Correspondingly, the UpgradedClientState field has been + * deprecated in the Cosmos SDK to allow for this logic to exist solely in + * the 02-client module. + */ + upgraded_client_state?: AnyAmino; + /** signer address */ + signer?: string; +} +export interface MsgIBCSoftwareUpgradeAminoMsg { + type: "cosmos-sdk/MsgIBCSoftwareUpgrade"; + value: MsgIBCSoftwareUpgradeAmino; +} +/** MsgIBCSoftwareUpgrade defines the message used to schedule an upgrade of an IBC client using a v1 governance proposal */ +export interface MsgIBCSoftwareUpgradeSDKType { + plan: PlanSDKType; + upgraded_client_state?: AnySDKType; + signer: string; +} +/** MsgIBCSoftwareUpgradeResponse defines the Msg/IBCSoftwareUpgrade response type. */ +export interface MsgIBCSoftwareUpgradeResponse {} +export interface MsgIBCSoftwareUpgradeResponseProtoMsg { + typeUrl: "/ibc.core.client.v1.MsgIBCSoftwareUpgradeResponse"; + value: Uint8Array; +} +/** MsgIBCSoftwareUpgradeResponse defines the Msg/IBCSoftwareUpgrade response type. */ +export interface MsgIBCSoftwareUpgradeResponseAmino {} +export interface MsgIBCSoftwareUpgradeResponseAminoMsg { + type: "cosmos-sdk/MsgIBCSoftwareUpgradeResponse"; + value: MsgIBCSoftwareUpgradeResponseAmino; +} +/** MsgIBCSoftwareUpgradeResponse defines the Msg/IBCSoftwareUpgrade response type. */ +export interface MsgIBCSoftwareUpgradeResponseSDKType {} +/** MsgUpdateParams defines the sdk.Msg type to update the client parameters. */ +export interface MsgUpdateParams { + /** signer address */ + signer: string; + /** + * params defines the client parameters to update. + * + * NOTE: All parameters must be supplied. + */ + params: Params; +} +export interface MsgUpdateParamsProtoMsg { + typeUrl: "/ibc.core.client.v1.MsgUpdateParams"; + value: Uint8Array; +} +/** MsgUpdateParams defines the sdk.Msg type to update the client parameters. */ +export interface MsgUpdateParamsAmino { + /** signer address */ + signer?: string; + /** + * params defines the client parameters to update. + * + * NOTE: All parameters must be supplied. + */ + params?: ParamsAmino; +} +export interface MsgUpdateParamsAminoMsg { + type: "cosmos-sdk/MsgUpdateParams"; + value: MsgUpdateParamsAmino; +} +/** MsgUpdateParams defines the sdk.Msg type to update the client parameters. */ +export interface MsgUpdateParamsSDKType { + signer: string; + params: ParamsSDKType; +} +/** MsgUpdateParamsResponse defines the MsgUpdateParams response type. */ +export interface MsgUpdateParamsResponse {} +export interface MsgUpdateParamsResponseProtoMsg { + typeUrl: "/ibc.core.client.v1.MsgUpdateParamsResponse"; + value: Uint8Array; +} +/** MsgUpdateParamsResponse defines the MsgUpdateParams response type. */ +export interface MsgUpdateParamsResponseAmino {} +export interface MsgUpdateParamsResponseAminoMsg { + type: "cosmos-sdk/MsgUpdateParamsResponse"; + value: MsgUpdateParamsResponseAmino; +} +/** MsgUpdateParamsResponse defines the MsgUpdateParams response type. */ +export interface MsgUpdateParamsResponseSDKType {} function createBaseMsgCreateClient(): MsgCreateClient { return { clientState: undefined, @@ -268,6 +429,16 @@ function createBaseMsgCreateClient(): MsgCreateClient { } export const MsgCreateClient = { typeUrl: "/ibc.core.client.v1.MsgCreateClient", + aminoType: "cosmos-sdk/MsgCreateClient", + is(o: any): o is MsgCreateClient { + return o && (o.$typeUrl === MsgCreateClient.typeUrl || typeof o.signer === "string"); + }, + isSDK(o: any): o is MsgCreateClientSDKType { + return o && (o.$typeUrl === MsgCreateClient.typeUrl || typeof o.signer === "string"); + }, + isAmino(o: any): o is MsgCreateClientAmino { + return o && (o.$typeUrl === MsgCreateClient.typeUrl || typeof o.signer === "string"); + }, encode(message: MsgCreateClient, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.clientState !== undefined) { Any.encode(message.clientState, writer.uint32(10).fork()).ldelim(); @@ -303,6 +474,20 @@ export const MsgCreateClient = { } return message; }, + fromJSON(object: any): MsgCreateClient { + return { + clientState: isSet(object.clientState) ? Any.fromJSON(object.clientState) : undefined, + consensusState: isSet(object.consensusState) ? Any.fromJSON(object.consensusState) : undefined, + signer: isSet(object.signer) ? String(object.signer) : "" + }; + }, + toJSON(message: MsgCreateClient): unknown { + const obj: any = {}; + message.clientState !== undefined && (obj.clientState = message.clientState ? Any.toJSON(message.clientState) : undefined); + message.consensusState !== undefined && (obj.consensusState = message.consensusState ? Any.toJSON(message.consensusState) : undefined); + message.signer !== undefined && (obj.signer = message.signer); + return obj; + }, fromPartial(object: Partial): MsgCreateClient { const message = createBaseMsgCreateClient(); message.clientState = object.clientState !== undefined && object.clientState !== null ? Any.fromPartial(object.clientState) : undefined; @@ -311,11 +496,17 @@ export const MsgCreateClient = { return message; }, fromAmino(object: MsgCreateClientAmino): MsgCreateClient { - return { - clientState: object?.client_state ? Any.fromAmino(object.client_state) : undefined, - consensusState: object?.consensus_state ? Any.fromAmino(object.consensus_state) : undefined, - signer: object.signer - }; + const message = createBaseMsgCreateClient(); + if (object.client_state !== undefined && object.client_state !== null) { + message.clientState = Any.fromAmino(object.client_state); + } + if (object.consensus_state !== undefined && object.consensus_state !== null) { + message.consensusState = Any.fromAmino(object.consensus_state); + } + if (object.signer !== undefined && object.signer !== null) { + message.signer = object.signer; + } + return message; }, toAmino(message: MsgCreateClient): MsgCreateClientAmino { const obj: any = {}; @@ -346,11 +537,23 @@ export const MsgCreateClient = { }; } }; +GlobalDecoderRegistry.register(MsgCreateClient.typeUrl, MsgCreateClient); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgCreateClient.aminoType, MsgCreateClient.typeUrl); function createBaseMsgCreateClientResponse(): MsgCreateClientResponse { return {}; } export const MsgCreateClientResponse = { typeUrl: "/ibc.core.client.v1.MsgCreateClientResponse", + aminoType: "cosmos-sdk/MsgCreateClientResponse", + is(o: any): o is MsgCreateClientResponse { + return o && o.$typeUrl === MsgCreateClientResponse.typeUrl; + }, + isSDK(o: any): o is MsgCreateClientResponseSDKType { + return o && o.$typeUrl === MsgCreateClientResponse.typeUrl; + }, + isAmino(o: any): o is MsgCreateClientResponseAmino { + return o && o.$typeUrl === MsgCreateClientResponse.typeUrl; + }, encode(_: MsgCreateClientResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, @@ -368,12 +571,20 @@ export const MsgCreateClientResponse = { } return message; }, + fromJSON(_: any): MsgCreateClientResponse { + return {}; + }, + toJSON(_: MsgCreateClientResponse): unknown { + const obj: any = {}; + return obj; + }, fromPartial(_: Partial): MsgCreateClientResponse { const message = createBaseMsgCreateClientResponse(); return message; }, fromAmino(_: MsgCreateClientResponseAmino): MsgCreateClientResponse { - return {}; + const message = createBaseMsgCreateClientResponse(); + return message; }, toAmino(_: MsgCreateClientResponse): MsgCreateClientResponseAmino { const obj: any = {}; @@ -401,6 +612,8 @@ export const MsgCreateClientResponse = { }; } }; +GlobalDecoderRegistry.register(MsgCreateClientResponse.typeUrl, MsgCreateClientResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgCreateClientResponse.aminoType, MsgCreateClientResponse.typeUrl); function createBaseMsgUpdateClient(): MsgUpdateClient { return { clientId: "", @@ -410,6 +623,16 @@ function createBaseMsgUpdateClient(): MsgUpdateClient { } export const MsgUpdateClient = { typeUrl: "/ibc.core.client.v1.MsgUpdateClient", + aminoType: "cosmos-sdk/MsgUpdateClient", + is(o: any): o is MsgUpdateClient { + return o && (o.$typeUrl === MsgUpdateClient.typeUrl || typeof o.clientId === "string" && typeof o.signer === "string"); + }, + isSDK(o: any): o is MsgUpdateClientSDKType { + return o && (o.$typeUrl === MsgUpdateClient.typeUrl || typeof o.client_id === "string" && typeof o.signer === "string"); + }, + isAmino(o: any): o is MsgUpdateClientAmino { + return o && (o.$typeUrl === MsgUpdateClient.typeUrl || typeof o.client_id === "string" && typeof o.signer === "string"); + }, encode(message: MsgUpdateClient, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.clientId !== "") { writer.uint32(10).string(message.clientId); @@ -445,6 +668,20 @@ export const MsgUpdateClient = { } return message; }, + fromJSON(object: any): MsgUpdateClient { + return { + clientId: isSet(object.clientId) ? String(object.clientId) : "", + clientMessage: isSet(object.clientMessage) ? Any.fromJSON(object.clientMessage) : undefined, + signer: isSet(object.signer) ? String(object.signer) : "" + }; + }, + toJSON(message: MsgUpdateClient): unknown { + const obj: any = {}; + message.clientId !== undefined && (obj.clientId = message.clientId); + message.clientMessage !== undefined && (obj.clientMessage = message.clientMessage ? Any.toJSON(message.clientMessage) : undefined); + message.signer !== undefined && (obj.signer = message.signer); + return obj; + }, fromPartial(object: Partial): MsgUpdateClient { const message = createBaseMsgUpdateClient(); message.clientId = object.clientId ?? ""; @@ -453,11 +690,17 @@ export const MsgUpdateClient = { return message; }, fromAmino(object: MsgUpdateClientAmino): MsgUpdateClient { - return { - clientId: object.client_id, - clientMessage: object?.client_message ? Any.fromAmino(object.client_message) : undefined, - signer: object.signer - }; + const message = createBaseMsgUpdateClient(); + if (object.client_id !== undefined && object.client_id !== null) { + message.clientId = object.client_id; + } + if (object.client_message !== undefined && object.client_message !== null) { + message.clientMessage = Any.fromAmino(object.client_message); + } + if (object.signer !== undefined && object.signer !== null) { + message.signer = object.signer; + } + return message; }, toAmino(message: MsgUpdateClient): MsgUpdateClientAmino { const obj: any = {}; @@ -488,11 +731,23 @@ export const MsgUpdateClient = { }; } }; +GlobalDecoderRegistry.register(MsgUpdateClient.typeUrl, MsgUpdateClient); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgUpdateClient.aminoType, MsgUpdateClient.typeUrl); function createBaseMsgUpdateClientResponse(): MsgUpdateClientResponse { return {}; } export const MsgUpdateClientResponse = { typeUrl: "/ibc.core.client.v1.MsgUpdateClientResponse", + aminoType: "cosmos-sdk/MsgUpdateClientResponse", + is(o: any): o is MsgUpdateClientResponse { + return o && o.$typeUrl === MsgUpdateClientResponse.typeUrl; + }, + isSDK(o: any): o is MsgUpdateClientResponseSDKType { + return o && o.$typeUrl === MsgUpdateClientResponse.typeUrl; + }, + isAmino(o: any): o is MsgUpdateClientResponseAmino { + return o && o.$typeUrl === MsgUpdateClientResponse.typeUrl; + }, encode(_: MsgUpdateClientResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, @@ -510,12 +765,20 @@ export const MsgUpdateClientResponse = { } return message; }, + fromJSON(_: any): MsgUpdateClientResponse { + return {}; + }, + toJSON(_: MsgUpdateClientResponse): unknown { + const obj: any = {}; + return obj; + }, fromPartial(_: Partial): MsgUpdateClientResponse { const message = createBaseMsgUpdateClientResponse(); return message; }, fromAmino(_: MsgUpdateClientResponseAmino): MsgUpdateClientResponse { - return {}; + const message = createBaseMsgUpdateClientResponse(); + return message; }, toAmino(_: MsgUpdateClientResponse): MsgUpdateClientResponseAmino { const obj: any = {}; @@ -543,6 +806,8 @@ export const MsgUpdateClientResponse = { }; } }; +GlobalDecoderRegistry.register(MsgUpdateClientResponse.typeUrl, MsgUpdateClientResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgUpdateClientResponse.aminoType, MsgUpdateClientResponse.typeUrl); function createBaseMsgUpgradeClient(): MsgUpgradeClient { return { clientId: "", @@ -555,6 +820,16 @@ function createBaseMsgUpgradeClient(): MsgUpgradeClient { } export const MsgUpgradeClient = { typeUrl: "/ibc.core.client.v1.MsgUpgradeClient", + aminoType: "cosmos-sdk/MsgUpgradeClient", + is(o: any): o is MsgUpgradeClient { + return o && (o.$typeUrl === MsgUpgradeClient.typeUrl || typeof o.clientId === "string" && (o.proofUpgradeClient instanceof Uint8Array || typeof o.proofUpgradeClient === "string") && (o.proofUpgradeConsensusState instanceof Uint8Array || typeof o.proofUpgradeConsensusState === "string") && typeof o.signer === "string"); + }, + isSDK(o: any): o is MsgUpgradeClientSDKType { + return o && (o.$typeUrl === MsgUpgradeClient.typeUrl || typeof o.client_id === "string" && (o.proof_upgrade_client instanceof Uint8Array || typeof o.proof_upgrade_client === "string") && (o.proof_upgrade_consensus_state instanceof Uint8Array || typeof o.proof_upgrade_consensus_state === "string") && typeof o.signer === "string"); + }, + isAmino(o: any): o is MsgUpgradeClientAmino { + return o && (o.$typeUrl === MsgUpgradeClient.typeUrl || typeof o.client_id === "string" && (o.proof_upgrade_client instanceof Uint8Array || typeof o.proof_upgrade_client === "string") && (o.proof_upgrade_consensus_state instanceof Uint8Array || typeof o.proof_upgrade_consensus_state === "string") && typeof o.signer === "string"); + }, encode(message: MsgUpgradeClient, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.clientId !== "") { writer.uint32(10).string(message.clientId); @@ -608,6 +883,26 @@ export const MsgUpgradeClient = { } return message; }, + fromJSON(object: any): MsgUpgradeClient { + return { + clientId: isSet(object.clientId) ? String(object.clientId) : "", + clientState: isSet(object.clientState) ? Any.fromJSON(object.clientState) : undefined, + consensusState: isSet(object.consensusState) ? Any.fromJSON(object.consensusState) : undefined, + proofUpgradeClient: isSet(object.proofUpgradeClient) ? bytesFromBase64(object.proofUpgradeClient) : new Uint8Array(), + proofUpgradeConsensusState: isSet(object.proofUpgradeConsensusState) ? bytesFromBase64(object.proofUpgradeConsensusState) : new Uint8Array(), + signer: isSet(object.signer) ? String(object.signer) : "" + }; + }, + toJSON(message: MsgUpgradeClient): unknown { + const obj: any = {}; + message.clientId !== undefined && (obj.clientId = message.clientId); + message.clientState !== undefined && (obj.clientState = message.clientState ? Any.toJSON(message.clientState) : undefined); + message.consensusState !== undefined && (obj.consensusState = message.consensusState ? Any.toJSON(message.consensusState) : undefined); + message.proofUpgradeClient !== undefined && (obj.proofUpgradeClient = base64FromBytes(message.proofUpgradeClient !== undefined ? message.proofUpgradeClient : new Uint8Array())); + message.proofUpgradeConsensusState !== undefined && (obj.proofUpgradeConsensusState = base64FromBytes(message.proofUpgradeConsensusState !== undefined ? message.proofUpgradeConsensusState : new Uint8Array())); + message.signer !== undefined && (obj.signer = message.signer); + return obj; + }, fromPartial(object: Partial): MsgUpgradeClient { const message = createBaseMsgUpgradeClient(); message.clientId = object.clientId ?? ""; @@ -619,22 +914,34 @@ export const MsgUpgradeClient = { return message; }, fromAmino(object: MsgUpgradeClientAmino): MsgUpgradeClient { - return { - clientId: object.client_id, - clientState: object?.client_state ? Any.fromAmino(object.client_state) : undefined, - consensusState: object?.consensus_state ? Any.fromAmino(object.consensus_state) : undefined, - proofUpgradeClient: object.proof_upgrade_client, - proofUpgradeConsensusState: object.proof_upgrade_consensus_state, - signer: object.signer - }; + const message = createBaseMsgUpgradeClient(); + if (object.client_id !== undefined && object.client_id !== null) { + message.clientId = object.client_id; + } + if (object.client_state !== undefined && object.client_state !== null) { + message.clientState = Any.fromAmino(object.client_state); + } + if (object.consensus_state !== undefined && object.consensus_state !== null) { + message.consensusState = Any.fromAmino(object.consensus_state); + } + if (object.proof_upgrade_client !== undefined && object.proof_upgrade_client !== null) { + message.proofUpgradeClient = bytesFromBase64(object.proof_upgrade_client); + } + if (object.proof_upgrade_consensus_state !== undefined && object.proof_upgrade_consensus_state !== null) { + message.proofUpgradeConsensusState = bytesFromBase64(object.proof_upgrade_consensus_state); + } + if (object.signer !== undefined && object.signer !== null) { + message.signer = object.signer; + } + return message; }, toAmino(message: MsgUpgradeClient): MsgUpgradeClientAmino { const obj: any = {}; obj.client_id = message.clientId; obj.client_state = message.clientState ? Any.toAmino(message.clientState) : undefined; obj.consensus_state = message.consensusState ? Any.toAmino(message.consensusState) : undefined; - obj.proof_upgrade_client = message.proofUpgradeClient; - obj.proof_upgrade_consensus_state = message.proofUpgradeConsensusState; + obj.proof_upgrade_client = message.proofUpgradeClient ? base64FromBytes(message.proofUpgradeClient) : undefined; + obj.proof_upgrade_consensus_state = message.proofUpgradeConsensusState ? base64FromBytes(message.proofUpgradeConsensusState) : undefined; obj.signer = message.signer; return obj; }, @@ -660,11 +967,23 @@ export const MsgUpgradeClient = { }; } }; +GlobalDecoderRegistry.register(MsgUpgradeClient.typeUrl, MsgUpgradeClient); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgUpgradeClient.aminoType, MsgUpgradeClient.typeUrl); function createBaseMsgUpgradeClientResponse(): MsgUpgradeClientResponse { return {}; } export const MsgUpgradeClientResponse = { typeUrl: "/ibc.core.client.v1.MsgUpgradeClientResponse", + aminoType: "cosmos-sdk/MsgUpgradeClientResponse", + is(o: any): o is MsgUpgradeClientResponse { + return o && o.$typeUrl === MsgUpgradeClientResponse.typeUrl; + }, + isSDK(o: any): o is MsgUpgradeClientResponseSDKType { + return o && o.$typeUrl === MsgUpgradeClientResponse.typeUrl; + }, + isAmino(o: any): o is MsgUpgradeClientResponseAmino { + return o && o.$typeUrl === MsgUpgradeClientResponse.typeUrl; + }, encode(_: MsgUpgradeClientResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, @@ -682,12 +1001,20 @@ export const MsgUpgradeClientResponse = { } return message; }, + fromJSON(_: any): MsgUpgradeClientResponse { + return {}; + }, + toJSON(_: MsgUpgradeClientResponse): unknown { + const obj: any = {}; + return obj; + }, fromPartial(_: Partial): MsgUpgradeClientResponse { const message = createBaseMsgUpgradeClientResponse(); return message; }, fromAmino(_: MsgUpgradeClientResponseAmino): MsgUpgradeClientResponse { - return {}; + const message = createBaseMsgUpgradeClientResponse(); + return message; }, toAmino(_: MsgUpgradeClientResponse): MsgUpgradeClientResponseAmino { const obj: any = {}; @@ -715,6 +1042,8 @@ export const MsgUpgradeClientResponse = { }; } }; +GlobalDecoderRegistry.register(MsgUpgradeClientResponse.typeUrl, MsgUpgradeClientResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgUpgradeClientResponse.aminoType, MsgUpgradeClientResponse.typeUrl); function createBaseMsgSubmitMisbehaviour(): MsgSubmitMisbehaviour { return { clientId: "", @@ -724,6 +1053,16 @@ function createBaseMsgSubmitMisbehaviour(): MsgSubmitMisbehaviour { } export const MsgSubmitMisbehaviour = { typeUrl: "/ibc.core.client.v1.MsgSubmitMisbehaviour", + aminoType: "cosmos-sdk/MsgSubmitMisbehaviour", + is(o: any): o is MsgSubmitMisbehaviour { + return o && (o.$typeUrl === MsgSubmitMisbehaviour.typeUrl || typeof o.clientId === "string" && typeof o.signer === "string"); + }, + isSDK(o: any): o is MsgSubmitMisbehaviourSDKType { + return o && (o.$typeUrl === MsgSubmitMisbehaviour.typeUrl || typeof o.client_id === "string" && typeof o.signer === "string"); + }, + isAmino(o: any): o is MsgSubmitMisbehaviourAmino { + return o && (o.$typeUrl === MsgSubmitMisbehaviour.typeUrl || typeof o.client_id === "string" && typeof o.signer === "string"); + }, encode(message: MsgSubmitMisbehaviour, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.clientId !== "") { writer.uint32(10).string(message.clientId); @@ -759,6 +1098,20 @@ export const MsgSubmitMisbehaviour = { } return message; }, + fromJSON(object: any): MsgSubmitMisbehaviour { + return { + clientId: isSet(object.clientId) ? String(object.clientId) : "", + misbehaviour: isSet(object.misbehaviour) ? Any.fromJSON(object.misbehaviour) : undefined, + signer: isSet(object.signer) ? String(object.signer) : "" + }; + }, + toJSON(message: MsgSubmitMisbehaviour): unknown { + const obj: any = {}; + message.clientId !== undefined && (obj.clientId = message.clientId); + message.misbehaviour !== undefined && (obj.misbehaviour = message.misbehaviour ? Any.toJSON(message.misbehaviour) : undefined); + message.signer !== undefined && (obj.signer = message.signer); + return obj; + }, fromPartial(object: Partial): MsgSubmitMisbehaviour { const message = createBaseMsgSubmitMisbehaviour(); message.clientId = object.clientId ?? ""; @@ -767,11 +1120,17 @@ export const MsgSubmitMisbehaviour = { return message; }, fromAmino(object: MsgSubmitMisbehaviourAmino): MsgSubmitMisbehaviour { - return { - clientId: object.client_id, - misbehaviour: object?.misbehaviour ? Any.fromAmino(object.misbehaviour) : undefined, - signer: object.signer - }; + const message = createBaseMsgSubmitMisbehaviour(); + if (object.client_id !== undefined && object.client_id !== null) { + message.clientId = object.client_id; + } + if (object.misbehaviour !== undefined && object.misbehaviour !== null) { + message.misbehaviour = Any.fromAmino(object.misbehaviour); + } + if (object.signer !== undefined && object.signer !== null) { + message.signer = object.signer; + } + return message; }, toAmino(message: MsgSubmitMisbehaviour): MsgSubmitMisbehaviourAmino { const obj: any = {}; @@ -802,11 +1161,23 @@ export const MsgSubmitMisbehaviour = { }; } }; +GlobalDecoderRegistry.register(MsgSubmitMisbehaviour.typeUrl, MsgSubmitMisbehaviour); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgSubmitMisbehaviour.aminoType, MsgSubmitMisbehaviour.typeUrl); function createBaseMsgSubmitMisbehaviourResponse(): MsgSubmitMisbehaviourResponse { return {}; } export const MsgSubmitMisbehaviourResponse = { typeUrl: "/ibc.core.client.v1.MsgSubmitMisbehaviourResponse", + aminoType: "cosmos-sdk/MsgSubmitMisbehaviourResponse", + is(o: any): o is MsgSubmitMisbehaviourResponse { + return o && o.$typeUrl === MsgSubmitMisbehaviourResponse.typeUrl; + }, + isSDK(o: any): o is MsgSubmitMisbehaviourResponseSDKType { + return o && o.$typeUrl === MsgSubmitMisbehaviourResponse.typeUrl; + }, + isAmino(o: any): o is MsgSubmitMisbehaviourResponseAmino { + return o && o.$typeUrl === MsgSubmitMisbehaviourResponse.typeUrl; + }, encode(_: MsgSubmitMisbehaviourResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, @@ -824,12 +1195,20 @@ export const MsgSubmitMisbehaviourResponse = { } return message; }, + fromJSON(_: any): MsgSubmitMisbehaviourResponse { + return {}; + }, + toJSON(_: MsgSubmitMisbehaviourResponse): unknown { + const obj: any = {}; + return obj; + }, fromPartial(_: Partial): MsgSubmitMisbehaviourResponse { const message = createBaseMsgSubmitMisbehaviourResponse(); return message; }, fromAmino(_: MsgSubmitMisbehaviourResponseAmino): MsgSubmitMisbehaviourResponse { - return {}; + const message = createBaseMsgSubmitMisbehaviourResponse(); + return message; }, toAmino(_: MsgSubmitMisbehaviourResponse): MsgSubmitMisbehaviourResponseAmino { const obj: any = {}; @@ -856,4 +1235,574 @@ export const MsgSubmitMisbehaviourResponse = { value: MsgSubmitMisbehaviourResponse.encode(message).finish() }; } -}; \ No newline at end of file +}; +GlobalDecoderRegistry.register(MsgSubmitMisbehaviourResponse.typeUrl, MsgSubmitMisbehaviourResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgSubmitMisbehaviourResponse.aminoType, MsgSubmitMisbehaviourResponse.typeUrl); +function createBaseMsgRecoverClient(): MsgRecoverClient { + return { + subjectClientId: "", + substituteClientId: "", + signer: "" + }; +} +export const MsgRecoverClient = { + typeUrl: "/ibc.core.client.v1.MsgRecoverClient", + aminoType: "cosmos-sdk/MsgRecoverClient", + is(o: any): o is MsgRecoverClient { + return o && (o.$typeUrl === MsgRecoverClient.typeUrl || typeof o.subjectClientId === "string" && typeof o.substituteClientId === "string" && typeof o.signer === "string"); + }, + isSDK(o: any): o is MsgRecoverClientSDKType { + return o && (o.$typeUrl === MsgRecoverClient.typeUrl || typeof o.subject_client_id === "string" && typeof o.substitute_client_id === "string" && typeof o.signer === "string"); + }, + isAmino(o: any): o is MsgRecoverClientAmino { + return o && (o.$typeUrl === MsgRecoverClient.typeUrl || typeof o.subject_client_id === "string" && typeof o.substitute_client_id === "string" && typeof o.signer === "string"); + }, + encode(message: MsgRecoverClient, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.subjectClientId !== "") { + writer.uint32(10).string(message.subjectClientId); + } + if (message.substituteClientId !== "") { + writer.uint32(18).string(message.substituteClientId); + } + if (message.signer !== "") { + writer.uint32(26).string(message.signer); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgRecoverClient { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgRecoverClient(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.subjectClientId = reader.string(); + break; + case 2: + message.substituteClientId = reader.string(); + break; + case 3: + message.signer = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): MsgRecoverClient { + return { + subjectClientId: isSet(object.subjectClientId) ? String(object.subjectClientId) : "", + substituteClientId: isSet(object.substituteClientId) ? String(object.substituteClientId) : "", + signer: isSet(object.signer) ? String(object.signer) : "" + }; + }, + toJSON(message: MsgRecoverClient): unknown { + const obj: any = {}; + message.subjectClientId !== undefined && (obj.subjectClientId = message.subjectClientId); + message.substituteClientId !== undefined && (obj.substituteClientId = message.substituteClientId); + message.signer !== undefined && (obj.signer = message.signer); + return obj; + }, + fromPartial(object: Partial): MsgRecoverClient { + const message = createBaseMsgRecoverClient(); + message.subjectClientId = object.subjectClientId ?? ""; + message.substituteClientId = object.substituteClientId ?? ""; + message.signer = object.signer ?? ""; + return message; + }, + fromAmino(object: MsgRecoverClientAmino): MsgRecoverClient { + const message = createBaseMsgRecoverClient(); + if (object.subject_client_id !== undefined && object.subject_client_id !== null) { + message.subjectClientId = object.subject_client_id; + } + if (object.substitute_client_id !== undefined && object.substitute_client_id !== null) { + message.substituteClientId = object.substitute_client_id; + } + if (object.signer !== undefined && object.signer !== null) { + message.signer = object.signer; + } + return message; + }, + toAmino(message: MsgRecoverClient): MsgRecoverClientAmino { + const obj: any = {}; + obj.subject_client_id = message.subjectClientId; + obj.substitute_client_id = message.substituteClientId; + obj.signer = message.signer; + return obj; + }, + fromAminoMsg(object: MsgRecoverClientAminoMsg): MsgRecoverClient { + return MsgRecoverClient.fromAmino(object.value); + }, + toAminoMsg(message: MsgRecoverClient): MsgRecoverClientAminoMsg { + return { + type: "cosmos-sdk/MsgRecoverClient", + value: MsgRecoverClient.toAmino(message) + }; + }, + fromProtoMsg(message: MsgRecoverClientProtoMsg): MsgRecoverClient { + return MsgRecoverClient.decode(message.value); + }, + toProto(message: MsgRecoverClient): Uint8Array { + return MsgRecoverClient.encode(message).finish(); + }, + toProtoMsg(message: MsgRecoverClient): MsgRecoverClientProtoMsg { + return { + typeUrl: "/ibc.core.client.v1.MsgRecoverClient", + value: MsgRecoverClient.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgRecoverClient.typeUrl, MsgRecoverClient); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgRecoverClient.aminoType, MsgRecoverClient.typeUrl); +function createBaseMsgRecoverClientResponse(): MsgRecoverClientResponse { + return {}; +} +export const MsgRecoverClientResponse = { + typeUrl: "/ibc.core.client.v1.MsgRecoverClientResponse", + aminoType: "cosmos-sdk/MsgRecoverClientResponse", + is(o: any): o is MsgRecoverClientResponse { + return o && o.$typeUrl === MsgRecoverClientResponse.typeUrl; + }, + isSDK(o: any): o is MsgRecoverClientResponseSDKType { + return o && o.$typeUrl === MsgRecoverClientResponse.typeUrl; + }, + isAmino(o: any): o is MsgRecoverClientResponseAmino { + return o && o.$typeUrl === MsgRecoverClientResponse.typeUrl; + }, + encode(_: MsgRecoverClientResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgRecoverClientResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgRecoverClientResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(_: any): MsgRecoverClientResponse { + return {}; + }, + toJSON(_: MsgRecoverClientResponse): unknown { + const obj: any = {}; + return obj; + }, + fromPartial(_: Partial): MsgRecoverClientResponse { + const message = createBaseMsgRecoverClientResponse(); + return message; + }, + fromAmino(_: MsgRecoverClientResponseAmino): MsgRecoverClientResponse { + const message = createBaseMsgRecoverClientResponse(); + return message; + }, + toAmino(_: MsgRecoverClientResponse): MsgRecoverClientResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgRecoverClientResponseAminoMsg): MsgRecoverClientResponse { + return MsgRecoverClientResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgRecoverClientResponse): MsgRecoverClientResponseAminoMsg { + return { + type: "cosmos-sdk/MsgRecoverClientResponse", + value: MsgRecoverClientResponse.toAmino(message) + }; + }, + fromProtoMsg(message: MsgRecoverClientResponseProtoMsg): MsgRecoverClientResponse { + return MsgRecoverClientResponse.decode(message.value); + }, + toProto(message: MsgRecoverClientResponse): Uint8Array { + return MsgRecoverClientResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgRecoverClientResponse): MsgRecoverClientResponseProtoMsg { + return { + typeUrl: "/ibc.core.client.v1.MsgRecoverClientResponse", + value: MsgRecoverClientResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgRecoverClientResponse.typeUrl, MsgRecoverClientResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgRecoverClientResponse.aminoType, MsgRecoverClientResponse.typeUrl); +function createBaseMsgIBCSoftwareUpgrade(): MsgIBCSoftwareUpgrade { + return { + plan: Plan.fromPartial({}), + upgradedClientState: undefined, + signer: "" + }; +} +export const MsgIBCSoftwareUpgrade = { + typeUrl: "/ibc.core.client.v1.MsgIBCSoftwareUpgrade", + aminoType: "cosmos-sdk/MsgIBCSoftwareUpgrade", + is(o: any): o is MsgIBCSoftwareUpgrade { + return o && (o.$typeUrl === MsgIBCSoftwareUpgrade.typeUrl || Plan.is(o.plan) && typeof o.signer === "string"); + }, + isSDK(o: any): o is MsgIBCSoftwareUpgradeSDKType { + return o && (o.$typeUrl === MsgIBCSoftwareUpgrade.typeUrl || Plan.isSDK(o.plan) && typeof o.signer === "string"); + }, + isAmino(o: any): o is MsgIBCSoftwareUpgradeAmino { + return o && (o.$typeUrl === MsgIBCSoftwareUpgrade.typeUrl || Plan.isAmino(o.plan) && typeof o.signer === "string"); + }, + encode(message: MsgIBCSoftwareUpgrade, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.plan !== undefined) { + Plan.encode(message.plan, writer.uint32(10).fork()).ldelim(); + } + if (message.upgradedClientState !== undefined) { + Any.encode(message.upgradedClientState, writer.uint32(18).fork()).ldelim(); + } + if (message.signer !== "") { + writer.uint32(26).string(message.signer); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgIBCSoftwareUpgrade { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgIBCSoftwareUpgrade(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.plan = Plan.decode(reader, reader.uint32()); + break; + case 2: + message.upgradedClientState = Any.decode(reader, reader.uint32()); + break; + case 3: + message.signer = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): MsgIBCSoftwareUpgrade { + return { + plan: isSet(object.plan) ? Plan.fromJSON(object.plan) : undefined, + upgradedClientState: isSet(object.upgradedClientState) ? Any.fromJSON(object.upgradedClientState) : undefined, + signer: isSet(object.signer) ? String(object.signer) : "" + }; + }, + toJSON(message: MsgIBCSoftwareUpgrade): unknown { + const obj: any = {}; + message.plan !== undefined && (obj.plan = message.plan ? Plan.toJSON(message.plan) : undefined); + message.upgradedClientState !== undefined && (obj.upgradedClientState = message.upgradedClientState ? Any.toJSON(message.upgradedClientState) : undefined); + message.signer !== undefined && (obj.signer = message.signer); + return obj; + }, + fromPartial(object: Partial): MsgIBCSoftwareUpgrade { + const message = createBaseMsgIBCSoftwareUpgrade(); + message.plan = object.plan !== undefined && object.plan !== null ? Plan.fromPartial(object.plan) : undefined; + message.upgradedClientState = object.upgradedClientState !== undefined && object.upgradedClientState !== null ? Any.fromPartial(object.upgradedClientState) : undefined; + message.signer = object.signer ?? ""; + return message; + }, + fromAmino(object: MsgIBCSoftwareUpgradeAmino): MsgIBCSoftwareUpgrade { + const message = createBaseMsgIBCSoftwareUpgrade(); + if (object.plan !== undefined && object.plan !== null) { + message.plan = Plan.fromAmino(object.plan); + } + if (object.upgraded_client_state !== undefined && object.upgraded_client_state !== null) { + message.upgradedClientState = Any.fromAmino(object.upgraded_client_state); + } + if (object.signer !== undefined && object.signer !== null) { + message.signer = object.signer; + } + return message; + }, + toAmino(message: MsgIBCSoftwareUpgrade): MsgIBCSoftwareUpgradeAmino { + const obj: any = {}; + obj.plan = message.plan ? Plan.toAmino(message.plan) : undefined; + obj.upgraded_client_state = message.upgradedClientState ? Any.toAmino(message.upgradedClientState) : undefined; + obj.signer = message.signer; + return obj; + }, + fromAminoMsg(object: MsgIBCSoftwareUpgradeAminoMsg): MsgIBCSoftwareUpgrade { + return MsgIBCSoftwareUpgrade.fromAmino(object.value); + }, + toAminoMsg(message: MsgIBCSoftwareUpgrade): MsgIBCSoftwareUpgradeAminoMsg { + return { + type: "cosmos-sdk/MsgIBCSoftwareUpgrade", + value: MsgIBCSoftwareUpgrade.toAmino(message) + }; + }, + fromProtoMsg(message: MsgIBCSoftwareUpgradeProtoMsg): MsgIBCSoftwareUpgrade { + return MsgIBCSoftwareUpgrade.decode(message.value); + }, + toProto(message: MsgIBCSoftwareUpgrade): Uint8Array { + return MsgIBCSoftwareUpgrade.encode(message).finish(); + }, + toProtoMsg(message: MsgIBCSoftwareUpgrade): MsgIBCSoftwareUpgradeProtoMsg { + return { + typeUrl: "/ibc.core.client.v1.MsgIBCSoftwareUpgrade", + value: MsgIBCSoftwareUpgrade.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgIBCSoftwareUpgrade.typeUrl, MsgIBCSoftwareUpgrade); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgIBCSoftwareUpgrade.aminoType, MsgIBCSoftwareUpgrade.typeUrl); +function createBaseMsgIBCSoftwareUpgradeResponse(): MsgIBCSoftwareUpgradeResponse { + return {}; +} +export const MsgIBCSoftwareUpgradeResponse = { + typeUrl: "/ibc.core.client.v1.MsgIBCSoftwareUpgradeResponse", + aminoType: "cosmos-sdk/MsgIBCSoftwareUpgradeResponse", + is(o: any): o is MsgIBCSoftwareUpgradeResponse { + return o && o.$typeUrl === MsgIBCSoftwareUpgradeResponse.typeUrl; + }, + isSDK(o: any): o is MsgIBCSoftwareUpgradeResponseSDKType { + return o && o.$typeUrl === MsgIBCSoftwareUpgradeResponse.typeUrl; + }, + isAmino(o: any): o is MsgIBCSoftwareUpgradeResponseAmino { + return o && o.$typeUrl === MsgIBCSoftwareUpgradeResponse.typeUrl; + }, + encode(_: MsgIBCSoftwareUpgradeResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgIBCSoftwareUpgradeResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgIBCSoftwareUpgradeResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(_: any): MsgIBCSoftwareUpgradeResponse { + return {}; + }, + toJSON(_: MsgIBCSoftwareUpgradeResponse): unknown { + const obj: any = {}; + return obj; + }, + fromPartial(_: Partial): MsgIBCSoftwareUpgradeResponse { + const message = createBaseMsgIBCSoftwareUpgradeResponse(); + return message; + }, + fromAmino(_: MsgIBCSoftwareUpgradeResponseAmino): MsgIBCSoftwareUpgradeResponse { + const message = createBaseMsgIBCSoftwareUpgradeResponse(); + return message; + }, + toAmino(_: MsgIBCSoftwareUpgradeResponse): MsgIBCSoftwareUpgradeResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgIBCSoftwareUpgradeResponseAminoMsg): MsgIBCSoftwareUpgradeResponse { + return MsgIBCSoftwareUpgradeResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgIBCSoftwareUpgradeResponse): MsgIBCSoftwareUpgradeResponseAminoMsg { + return { + type: "cosmos-sdk/MsgIBCSoftwareUpgradeResponse", + value: MsgIBCSoftwareUpgradeResponse.toAmino(message) + }; + }, + fromProtoMsg(message: MsgIBCSoftwareUpgradeResponseProtoMsg): MsgIBCSoftwareUpgradeResponse { + return MsgIBCSoftwareUpgradeResponse.decode(message.value); + }, + toProto(message: MsgIBCSoftwareUpgradeResponse): Uint8Array { + return MsgIBCSoftwareUpgradeResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgIBCSoftwareUpgradeResponse): MsgIBCSoftwareUpgradeResponseProtoMsg { + return { + typeUrl: "/ibc.core.client.v1.MsgIBCSoftwareUpgradeResponse", + value: MsgIBCSoftwareUpgradeResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgIBCSoftwareUpgradeResponse.typeUrl, MsgIBCSoftwareUpgradeResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgIBCSoftwareUpgradeResponse.aminoType, MsgIBCSoftwareUpgradeResponse.typeUrl); +function createBaseMsgUpdateParams(): MsgUpdateParams { + return { + signer: "", + params: Params.fromPartial({}) + }; +} +export const MsgUpdateParams = { + typeUrl: "/ibc.core.client.v1.MsgUpdateParams", + aminoType: "cosmos-sdk/MsgUpdateParams", + is(o: any): o is MsgUpdateParams { + return o && (o.$typeUrl === MsgUpdateParams.typeUrl || typeof o.signer === "string" && Params.is(o.params)); + }, + isSDK(o: any): o is MsgUpdateParamsSDKType { + return o && (o.$typeUrl === MsgUpdateParams.typeUrl || typeof o.signer === "string" && Params.isSDK(o.params)); + }, + isAmino(o: any): o is MsgUpdateParamsAmino { + return o && (o.$typeUrl === MsgUpdateParams.typeUrl || typeof o.signer === "string" && Params.isAmino(o.params)); + }, + encode(message: MsgUpdateParams, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.signer !== "") { + writer.uint32(10).string(message.signer); + } + if (message.params !== undefined) { + Params.encode(message.params, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgUpdateParams { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUpdateParams(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.signer = reader.string(); + break; + case 2: + message.params = Params.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): MsgUpdateParams { + return { + signer: isSet(object.signer) ? String(object.signer) : "", + params: isSet(object.params) ? Params.fromJSON(object.params) : undefined + }; + }, + toJSON(message: MsgUpdateParams): unknown { + const obj: any = {}; + message.signer !== undefined && (obj.signer = message.signer); + message.params !== undefined && (obj.params = message.params ? Params.toJSON(message.params) : undefined); + return obj; + }, + fromPartial(object: Partial): MsgUpdateParams { + const message = createBaseMsgUpdateParams(); + message.signer = object.signer ?? ""; + message.params = object.params !== undefined && object.params !== null ? Params.fromPartial(object.params) : undefined; + return message; + }, + fromAmino(object: MsgUpdateParamsAmino): MsgUpdateParams { + const message = createBaseMsgUpdateParams(); + if (object.signer !== undefined && object.signer !== null) { + message.signer = object.signer; + } + if (object.params !== undefined && object.params !== null) { + message.params = Params.fromAmino(object.params); + } + return message; + }, + toAmino(message: MsgUpdateParams): MsgUpdateParamsAmino { + const obj: any = {}; + obj.signer = message.signer; + obj.params = message.params ? Params.toAmino(message.params) : undefined; + return obj; + }, + fromAminoMsg(object: MsgUpdateParamsAminoMsg): MsgUpdateParams { + return MsgUpdateParams.fromAmino(object.value); + }, + toAminoMsg(message: MsgUpdateParams): MsgUpdateParamsAminoMsg { + return { + type: "cosmos-sdk/MsgUpdateParams", + value: MsgUpdateParams.toAmino(message) + }; + }, + fromProtoMsg(message: MsgUpdateParamsProtoMsg): MsgUpdateParams { + return MsgUpdateParams.decode(message.value); + }, + toProto(message: MsgUpdateParams): Uint8Array { + return MsgUpdateParams.encode(message).finish(); + }, + toProtoMsg(message: MsgUpdateParams): MsgUpdateParamsProtoMsg { + return { + typeUrl: "/ibc.core.client.v1.MsgUpdateParams", + value: MsgUpdateParams.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgUpdateParams.typeUrl, MsgUpdateParams); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgUpdateParams.aminoType, MsgUpdateParams.typeUrl); +function createBaseMsgUpdateParamsResponse(): MsgUpdateParamsResponse { + return {}; +} +export const MsgUpdateParamsResponse = { + typeUrl: "/ibc.core.client.v1.MsgUpdateParamsResponse", + aminoType: "cosmos-sdk/MsgUpdateParamsResponse", + is(o: any): o is MsgUpdateParamsResponse { + return o && o.$typeUrl === MsgUpdateParamsResponse.typeUrl; + }, + isSDK(o: any): o is MsgUpdateParamsResponseSDKType { + return o && o.$typeUrl === MsgUpdateParamsResponse.typeUrl; + }, + isAmino(o: any): o is MsgUpdateParamsResponseAmino { + return o && o.$typeUrl === MsgUpdateParamsResponse.typeUrl; + }, + encode(_: MsgUpdateParamsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgUpdateParamsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUpdateParamsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(_: any): MsgUpdateParamsResponse { + return {}; + }, + toJSON(_: MsgUpdateParamsResponse): unknown { + const obj: any = {}; + return obj; + }, + fromPartial(_: Partial): MsgUpdateParamsResponse { + const message = createBaseMsgUpdateParamsResponse(); + return message; + }, + fromAmino(_: MsgUpdateParamsResponseAmino): MsgUpdateParamsResponse { + const message = createBaseMsgUpdateParamsResponse(); + return message; + }, + toAmino(_: MsgUpdateParamsResponse): MsgUpdateParamsResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgUpdateParamsResponseAminoMsg): MsgUpdateParamsResponse { + return MsgUpdateParamsResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgUpdateParamsResponse): MsgUpdateParamsResponseAminoMsg { + return { + type: "cosmos-sdk/MsgUpdateParamsResponse", + value: MsgUpdateParamsResponse.toAmino(message) + }; + }, + fromProtoMsg(message: MsgUpdateParamsResponseProtoMsg): MsgUpdateParamsResponse { + return MsgUpdateParamsResponse.decode(message.value); + }, + toProto(message: MsgUpdateParamsResponse): Uint8Array { + return MsgUpdateParamsResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgUpdateParamsResponse): MsgUpdateParamsResponseProtoMsg { + return { + typeUrl: "/ibc.core.client.v1.MsgUpdateParamsResponse", + value: MsgUpdateParamsResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgUpdateParamsResponse.typeUrl, MsgUpdateParamsResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgUpdateParamsResponse.aminoType, MsgUpdateParamsResponse.typeUrl); \ No newline at end of file diff --git a/packages/osmojs/src/codegen/ibc/core/commitment/v1/commitment.ts b/packages/osmojs/src/codegen/ibc/core/commitment/v1/commitment.ts index 2d958d44e..b8a710306 100644 --- a/packages/osmojs/src/codegen/ibc/core/commitment/v1/commitment.ts +++ b/packages/osmojs/src/codegen/ibc/core/commitment/v1/commitment.ts @@ -1,5 +1,7 @@ import { CommitmentProof, CommitmentProofAmino, CommitmentProofSDKType } from "../../../../cosmos/ics23/v1/proofs"; import { BinaryReader, BinaryWriter } from "../../../../binary"; +import { isSet, bytesFromBase64, base64FromBytes } from "../../../../helpers"; +import { GlobalDecoderRegistry } from "../../../../registry"; /** * MerkleRoot defines a merkle root hash. * In the Cosmos SDK, the AppHash of a block header becomes the root. @@ -16,7 +18,7 @@ export interface MerkleRootProtoMsg { * In the Cosmos SDK, the AppHash of a block header becomes the root. */ export interface MerkleRootAmino { - hash: Uint8Array; + hash?: string; } export interface MerkleRootAminoMsg { type: "cosmos-sdk/MerkleRoot"; @@ -47,7 +49,7 @@ export interface MerklePrefixProtoMsg { * append(Path.KeyPrefix, key...)) */ export interface MerklePrefixAmino { - key_prefix: Uint8Array; + key_prefix?: string; } export interface MerklePrefixAminoMsg { type: "cosmos-sdk/MerklePrefix"; @@ -79,7 +81,7 @@ export interface MerklePathProtoMsg { * MerklePath is represented from root-to-leaf */ export interface MerklePathAmino { - key_path: string[]; + key_path?: string[]; } export interface MerklePathAminoMsg { type: "cosmos-sdk/MerklePath"; @@ -115,7 +117,7 @@ export interface MerkleProofProtoMsg { * MerkleProofs are ordered from leaf-to-root */ export interface MerkleProofAmino { - proofs: CommitmentProofAmino[]; + proofs?: CommitmentProofAmino[]; } export interface MerkleProofAminoMsg { type: "cosmos-sdk/MerkleProof"; @@ -138,6 +140,16 @@ function createBaseMerkleRoot(): MerkleRoot { } export const MerkleRoot = { typeUrl: "/ibc.core.commitment.v1.MerkleRoot", + aminoType: "cosmos-sdk/MerkleRoot", + is(o: any): o is MerkleRoot { + return o && (o.$typeUrl === MerkleRoot.typeUrl || o.hash instanceof Uint8Array || typeof o.hash === "string"); + }, + isSDK(o: any): o is MerkleRootSDKType { + return o && (o.$typeUrl === MerkleRoot.typeUrl || o.hash instanceof Uint8Array || typeof o.hash === "string"); + }, + isAmino(o: any): o is MerkleRootAmino { + return o && (o.$typeUrl === MerkleRoot.typeUrl || o.hash instanceof Uint8Array || typeof o.hash === "string"); + }, encode(message: MerkleRoot, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.hash.length !== 0) { writer.uint32(10).bytes(message.hash); @@ -161,19 +173,31 @@ export const MerkleRoot = { } return message; }, + fromJSON(object: any): MerkleRoot { + return { + hash: isSet(object.hash) ? bytesFromBase64(object.hash) : new Uint8Array() + }; + }, + toJSON(message: MerkleRoot): unknown { + const obj: any = {}; + message.hash !== undefined && (obj.hash = base64FromBytes(message.hash !== undefined ? message.hash : new Uint8Array())); + return obj; + }, fromPartial(object: Partial): MerkleRoot { const message = createBaseMerkleRoot(); message.hash = object.hash ?? new Uint8Array(); return message; }, fromAmino(object: MerkleRootAmino): MerkleRoot { - return { - hash: object.hash - }; + const message = createBaseMerkleRoot(); + if (object.hash !== undefined && object.hash !== null) { + message.hash = bytesFromBase64(object.hash); + } + return message; }, toAmino(message: MerkleRoot): MerkleRootAmino { const obj: any = {}; - obj.hash = message.hash; + obj.hash = message.hash ? base64FromBytes(message.hash) : undefined; return obj; }, fromAminoMsg(object: MerkleRootAminoMsg): MerkleRoot { @@ -198,6 +222,8 @@ export const MerkleRoot = { }; } }; +GlobalDecoderRegistry.register(MerkleRoot.typeUrl, MerkleRoot); +GlobalDecoderRegistry.registerAminoProtoMapping(MerkleRoot.aminoType, MerkleRoot.typeUrl); function createBaseMerklePrefix(): MerklePrefix { return { keyPrefix: new Uint8Array() @@ -205,6 +231,16 @@ function createBaseMerklePrefix(): MerklePrefix { } export const MerklePrefix = { typeUrl: "/ibc.core.commitment.v1.MerklePrefix", + aminoType: "cosmos-sdk/MerklePrefix", + is(o: any): o is MerklePrefix { + return o && (o.$typeUrl === MerklePrefix.typeUrl || o.keyPrefix instanceof Uint8Array || typeof o.keyPrefix === "string"); + }, + isSDK(o: any): o is MerklePrefixSDKType { + return o && (o.$typeUrl === MerklePrefix.typeUrl || o.key_prefix instanceof Uint8Array || typeof o.key_prefix === "string"); + }, + isAmino(o: any): o is MerklePrefixAmino { + return o && (o.$typeUrl === MerklePrefix.typeUrl || o.key_prefix instanceof Uint8Array || typeof o.key_prefix === "string"); + }, encode(message: MerklePrefix, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.keyPrefix.length !== 0) { writer.uint32(10).bytes(message.keyPrefix); @@ -228,19 +264,31 @@ export const MerklePrefix = { } return message; }, + fromJSON(object: any): MerklePrefix { + return { + keyPrefix: isSet(object.keyPrefix) ? bytesFromBase64(object.keyPrefix) : new Uint8Array() + }; + }, + toJSON(message: MerklePrefix): unknown { + const obj: any = {}; + message.keyPrefix !== undefined && (obj.keyPrefix = base64FromBytes(message.keyPrefix !== undefined ? message.keyPrefix : new Uint8Array())); + return obj; + }, fromPartial(object: Partial): MerklePrefix { const message = createBaseMerklePrefix(); message.keyPrefix = object.keyPrefix ?? new Uint8Array(); return message; }, fromAmino(object: MerklePrefixAmino): MerklePrefix { - return { - keyPrefix: object.key_prefix - }; + const message = createBaseMerklePrefix(); + if (object.key_prefix !== undefined && object.key_prefix !== null) { + message.keyPrefix = bytesFromBase64(object.key_prefix); + } + return message; }, toAmino(message: MerklePrefix): MerklePrefixAmino { const obj: any = {}; - obj.key_prefix = message.keyPrefix; + obj.key_prefix = message.keyPrefix ? base64FromBytes(message.keyPrefix) : undefined; return obj; }, fromAminoMsg(object: MerklePrefixAminoMsg): MerklePrefix { @@ -265,6 +313,8 @@ export const MerklePrefix = { }; } }; +GlobalDecoderRegistry.register(MerklePrefix.typeUrl, MerklePrefix); +GlobalDecoderRegistry.registerAminoProtoMapping(MerklePrefix.aminoType, MerklePrefix.typeUrl); function createBaseMerklePath(): MerklePath { return { keyPath: [] @@ -272,6 +322,16 @@ function createBaseMerklePath(): MerklePath { } export const MerklePath = { typeUrl: "/ibc.core.commitment.v1.MerklePath", + aminoType: "cosmos-sdk/MerklePath", + is(o: any): o is MerklePath { + return o && (o.$typeUrl === MerklePath.typeUrl || Array.isArray(o.keyPath) && (!o.keyPath.length || typeof o.keyPath[0] === "string")); + }, + isSDK(o: any): o is MerklePathSDKType { + return o && (o.$typeUrl === MerklePath.typeUrl || Array.isArray(o.key_path) && (!o.key_path.length || typeof o.key_path[0] === "string")); + }, + isAmino(o: any): o is MerklePathAmino { + return o && (o.$typeUrl === MerklePath.typeUrl || Array.isArray(o.key_path) && (!o.key_path.length || typeof o.key_path[0] === "string")); + }, encode(message: MerklePath, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.keyPath) { writer.uint32(10).string(v!); @@ -295,15 +355,29 @@ export const MerklePath = { } return message; }, + fromJSON(object: any): MerklePath { + return { + keyPath: Array.isArray(object?.keyPath) ? object.keyPath.map((e: any) => String(e)) : [] + }; + }, + toJSON(message: MerklePath): unknown { + const obj: any = {}; + if (message.keyPath) { + obj.keyPath = message.keyPath.map(e => e); + } else { + obj.keyPath = []; + } + return obj; + }, fromPartial(object: Partial): MerklePath { const message = createBaseMerklePath(); message.keyPath = object.keyPath?.map(e => e) || []; return message; }, fromAmino(object: MerklePathAmino): MerklePath { - return { - keyPath: Array.isArray(object?.key_path) ? object.key_path.map((e: any) => e) : [] - }; + const message = createBaseMerklePath(); + message.keyPath = object.key_path?.map(e => e) || []; + return message; }, toAmino(message: MerklePath): MerklePathAmino { const obj: any = {}; @@ -336,6 +410,8 @@ export const MerklePath = { }; } }; +GlobalDecoderRegistry.register(MerklePath.typeUrl, MerklePath); +GlobalDecoderRegistry.registerAminoProtoMapping(MerklePath.aminoType, MerklePath.typeUrl); function createBaseMerkleProof(): MerkleProof { return { proofs: [] @@ -343,6 +419,16 @@ function createBaseMerkleProof(): MerkleProof { } export const MerkleProof = { typeUrl: "/ibc.core.commitment.v1.MerkleProof", + aminoType: "cosmos-sdk/MerkleProof", + is(o: any): o is MerkleProof { + return o && (o.$typeUrl === MerkleProof.typeUrl || Array.isArray(o.proofs) && (!o.proofs.length || CommitmentProof.is(o.proofs[0]))); + }, + isSDK(o: any): o is MerkleProofSDKType { + return o && (o.$typeUrl === MerkleProof.typeUrl || Array.isArray(o.proofs) && (!o.proofs.length || CommitmentProof.isSDK(o.proofs[0]))); + }, + isAmino(o: any): o is MerkleProofAmino { + return o && (o.$typeUrl === MerkleProof.typeUrl || Array.isArray(o.proofs) && (!o.proofs.length || CommitmentProof.isAmino(o.proofs[0]))); + }, encode(message: MerkleProof, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.proofs) { CommitmentProof.encode(v!, writer.uint32(10).fork()).ldelim(); @@ -366,15 +452,29 @@ export const MerkleProof = { } return message; }, + fromJSON(object: any): MerkleProof { + return { + proofs: Array.isArray(object?.proofs) ? object.proofs.map((e: any) => CommitmentProof.fromJSON(e)) : [] + }; + }, + toJSON(message: MerkleProof): unknown { + const obj: any = {}; + if (message.proofs) { + obj.proofs = message.proofs.map(e => e ? CommitmentProof.toJSON(e) : undefined); + } else { + obj.proofs = []; + } + return obj; + }, fromPartial(object: Partial): MerkleProof { const message = createBaseMerkleProof(); message.proofs = object.proofs?.map(e => CommitmentProof.fromPartial(e)) || []; return message; }, fromAmino(object: MerkleProofAmino): MerkleProof { - return { - proofs: Array.isArray(object?.proofs) ? object.proofs.map((e: any) => CommitmentProof.fromAmino(e)) : [] - }; + const message = createBaseMerkleProof(); + message.proofs = object.proofs?.map(e => CommitmentProof.fromAmino(e)) || []; + return message; }, toAmino(message: MerkleProof): MerkleProofAmino { const obj: any = {}; @@ -406,4 +506,6 @@ export const MerkleProof = { value: MerkleProof.encode(message).finish() }; } -}; \ No newline at end of file +}; +GlobalDecoderRegistry.register(MerkleProof.typeUrl, MerkleProof); +GlobalDecoderRegistry.registerAminoProtoMapping(MerkleProof.aminoType, MerkleProof.typeUrl); \ No newline at end of file diff --git a/packages/osmojs/src/codegen/ibc/core/connection/v1/connection.ts b/packages/osmojs/src/codegen/ibc/core/connection/v1/connection.ts index b156a0925..16de90556 100644 --- a/packages/osmojs/src/codegen/ibc/core/connection/v1/connection.ts +++ b/packages/osmojs/src/codegen/ibc/core/connection/v1/connection.ts @@ -1,6 +1,7 @@ import { MerklePrefix, MerklePrefixAmino, MerklePrefixSDKType } from "../../commitment/v1/commitment"; -import { BinaryReader, BinaryWriter } from "../../../../binary"; import { isSet } from "../../../../helpers"; +import { BinaryReader, BinaryWriter } from "../../../../binary"; +import { GlobalDecoderRegistry } from "../../../../registry"; /** * State defines if a connection is in one of the following states: * INIT, TRYOPEN, OPEN or UNINITIALIZED. @@ -93,14 +94,14 @@ export interface ConnectionEndProtoMsg { */ export interface ConnectionEndAmino { /** client associated with this connection. */ - client_id: string; + client_id?: string; /** * IBC version which can be utilised to determine encodings or protocols for * channels or packets utilising this connection. */ - versions: VersionAmino[]; + versions?: VersionAmino[]; /** current state of the connection end. */ - state: State; + state?: State; /** counterparty chain associated with this connection. */ counterparty?: CounterpartyAmino; /** @@ -108,7 +109,7 @@ export interface ConnectionEndAmino { * packet-verification NOTE: delay period logic is only implemented by some * clients. */ - delay_period: string; + delay_period?: string; } export interface ConnectionEndAminoMsg { type: "cosmos-sdk/ConnectionEnd"; @@ -158,20 +159,20 @@ export interface IdentifiedConnectionProtoMsg { */ export interface IdentifiedConnectionAmino { /** connection identifier. */ - id: string; + id?: string; /** client associated with this connection. */ - client_id: string; + client_id?: string; /** * IBC version which can be utilised to determine encodings or protocols for * channels or packets utilising this connection */ - versions: VersionAmino[]; + versions?: VersionAmino[]; /** current state of the connection end. */ - state: State; + state?: State; /** counterparty chain associated with this connection. */ counterparty?: CounterpartyAmino; /** delay period associated with this connection. */ - delay_period: string; + delay_period?: string; } export interface IdentifiedConnectionAminoMsg { type: "cosmos-sdk/IdentifiedConnection"; @@ -214,12 +215,12 @@ export interface CounterpartyAmino { * identifies the client on the counterparty chain associated with a given * connection. */ - client_id: string; + client_id?: string; /** * identifies the connection end on the counterparty chain associated with a * given connection. */ - connection_id: string; + connection_id?: string; /** commitment merkle prefix of the counterparty chain. */ prefix?: MerklePrefixAmino; } @@ -245,7 +246,7 @@ export interface ClientPathsProtoMsg { /** ClientPaths define all the connection paths for a client state. */ export interface ClientPathsAmino { /** list of connection paths */ - paths: string[]; + paths?: string[]; } export interface ClientPathsAminoMsg { type: "cosmos-sdk/ClientPaths"; @@ -269,9 +270,9 @@ export interface ConnectionPathsProtoMsg { /** ConnectionPaths define all the connection paths for a given client state. */ export interface ConnectionPathsAmino { /** client state unique identifier */ - client_id: string; + client_id?: string; /** list of connection paths */ - paths: string[]; + paths?: string[]; } export interface ConnectionPathsAminoMsg { type: "cosmos-sdk/ConnectionPaths"; @@ -283,7 +284,7 @@ export interface ConnectionPathsSDKType { paths: string[]; } /** - * Version defines the versioning scheme used to negotiate the IBC verison in + * Version defines the versioning scheme used to negotiate the IBC version in * the connection handshake. */ export interface Version { @@ -297,21 +298,21 @@ export interface VersionProtoMsg { value: Uint8Array; } /** - * Version defines the versioning scheme used to negotiate the IBC verison in + * Version defines the versioning scheme used to negotiate the IBC version in * the connection handshake. */ export interface VersionAmino { /** unique version identifier */ - identifier: string; + identifier?: string; /** list of features compatible with the specified identifier */ - features: string[]; + features?: string[]; } export interface VersionAminoMsg { type: "cosmos-sdk/Version"; value: VersionAmino; } /** - * Version defines the versioning scheme used to negotiate the IBC verison in + * Version defines the versioning scheme used to negotiate the IBC version in * the connection handshake. */ export interface VersionSDKType { @@ -338,7 +339,7 @@ export interface ParamsAmino { * largest amount of time that the chain might reasonably take to produce the next block under normal operating * conditions. A safe choice is 3-5x the expected time per block. */ - max_expected_time_per_block: string; + max_expected_time_per_block?: string; } export interface ParamsAminoMsg { type: "cosmos-sdk/Params"; @@ -359,6 +360,16 @@ function createBaseConnectionEnd(): ConnectionEnd { } export const ConnectionEnd = { typeUrl: "/ibc.core.connection.v1.ConnectionEnd", + aminoType: "cosmos-sdk/ConnectionEnd", + is(o: any): o is ConnectionEnd { + return o && (o.$typeUrl === ConnectionEnd.typeUrl || typeof o.clientId === "string" && Array.isArray(o.versions) && (!o.versions.length || Version.is(o.versions[0])) && isSet(o.state) && Counterparty.is(o.counterparty) && typeof o.delayPeriod === "bigint"); + }, + isSDK(o: any): o is ConnectionEndSDKType { + return o && (o.$typeUrl === ConnectionEnd.typeUrl || typeof o.client_id === "string" && Array.isArray(o.versions) && (!o.versions.length || Version.isSDK(o.versions[0])) && isSet(o.state) && Counterparty.isSDK(o.counterparty) && typeof o.delay_period === "bigint"); + }, + isAmino(o: any): o is ConnectionEndAmino { + return o && (o.$typeUrl === ConnectionEnd.typeUrl || typeof o.client_id === "string" && Array.isArray(o.versions) && (!o.versions.length || Version.isAmino(o.versions[0])) && isSet(o.state) && Counterparty.isAmino(o.counterparty) && typeof o.delay_period === "bigint"); + }, encode(message: ConnectionEnd, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.clientId !== "") { writer.uint32(10).string(message.clientId); @@ -406,6 +417,28 @@ export const ConnectionEnd = { } return message; }, + fromJSON(object: any): ConnectionEnd { + return { + clientId: isSet(object.clientId) ? String(object.clientId) : "", + versions: Array.isArray(object?.versions) ? object.versions.map((e: any) => Version.fromJSON(e)) : [], + state: isSet(object.state) ? stateFromJSON(object.state) : -1, + counterparty: isSet(object.counterparty) ? Counterparty.fromJSON(object.counterparty) : undefined, + delayPeriod: isSet(object.delayPeriod) ? BigInt(object.delayPeriod.toString()) : BigInt(0) + }; + }, + toJSON(message: ConnectionEnd): unknown { + const obj: any = {}; + message.clientId !== undefined && (obj.clientId = message.clientId); + if (message.versions) { + obj.versions = message.versions.map(e => e ? Version.toJSON(e) : undefined); + } else { + obj.versions = []; + } + message.state !== undefined && (obj.state = stateToJSON(message.state)); + message.counterparty !== undefined && (obj.counterparty = message.counterparty ? Counterparty.toJSON(message.counterparty) : undefined); + message.delayPeriod !== undefined && (obj.delayPeriod = (message.delayPeriod || BigInt(0)).toString()); + return obj; + }, fromPartial(object: Partial): ConnectionEnd { const message = createBaseConnectionEnd(); message.clientId = object.clientId ?? ""; @@ -416,13 +449,21 @@ export const ConnectionEnd = { return message; }, fromAmino(object: ConnectionEndAmino): ConnectionEnd { - return { - clientId: object.client_id, - versions: Array.isArray(object?.versions) ? object.versions.map((e: any) => Version.fromAmino(e)) : [], - state: isSet(object.state) ? stateFromJSON(object.state) : -1, - counterparty: object?.counterparty ? Counterparty.fromAmino(object.counterparty) : undefined, - delayPeriod: BigInt(object.delay_period) - }; + const message = createBaseConnectionEnd(); + if (object.client_id !== undefined && object.client_id !== null) { + message.clientId = object.client_id; + } + message.versions = object.versions?.map(e => Version.fromAmino(e)) || []; + if (object.state !== undefined && object.state !== null) { + message.state = stateFromJSON(object.state); + } + if (object.counterparty !== undefined && object.counterparty !== null) { + message.counterparty = Counterparty.fromAmino(object.counterparty); + } + if (object.delay_period !== undefined && object.delay_period !== null) { + message.delayPeriod = BigInt(object.delay_period); + } + return message; }, toAmino(message: ConnectionEnd): ConnectionEndAmino { const obj: any = {}; @@ -432,7 +473,7 @@ export const ConnectionEnd = { } else { obj.versions = []; } - obj.state = message.state; + obj.state = stateToJSON(message.state); obj.counterparty = message.counterparty ? Counterparty.toAmino(message.counterparty) : undefined; obj.delay_period = message.delayPeriod ? message.delayPeriod.toString() : undefined; return obj; @@ -459,6 +500,8 @@ export const ConnectionEnd = { }; } }; +GlobalDecoderRegistry.register(ConnectionEnd.typeUrl, ConnectionEnd); +GlobalDecoderRegistry.registerAminoProtoMapping(ConnectionEnd.aminoType, ConnectionEnd.typeUrl); function createBaseIdentifiedConnection(): IdentifiedConnection { return { id: "", @@ -471,6 +514,16 @@ function createBaseIdentifiedConnection(): IdentifiedConnection { } export const IdentifiedConnection = { typeUrl: "/ibc.core.connection.v1.IdentifiedConnection", + aminoType: "cosmos-sdk/IdentifiedConnection", + is(o: any): o is IdentifiedConnection { + return o && (o.$typeUrl === IdentifiedConnection.typeUrl || typeof o.id === "string" && typeof o.clientId === "string" && Array.isArray(o.versions) && (!o.versions.length || Version.is(o.versions[0])) && isSet(o.state) && Counterparty.is(o.counterparty) && typeof o.delayPeriod === "bigint"); + }, + isSDK(o: any): o is IdentifiedConnectionSDKType { + return o && (o.$typeUrl === IdentifiedConnection.typeUrl || typeof o.id === "string" && typeof o.client_id === "string" && Array.isArray(o.versions) && (!o.versions.length || Version.isSDK(o.versions[0])) && isSet(o.state) && Counterparty.isSDK(o.counterparty) && typeof o.delay_period === "bigint"); + }, + isAmino(o: any): o is IdentifiedConnectionAmino { + return o && (o.$typeUrl === IdentifiedConnection.typeUrl || typeof o.id === "string" && typeof o.client_id === "string" && Array.isArray(o.versions) && (!o.versions.length || Version.isAmino(o.versions[0])) && isSet(o.state) && Counterparty.isAmino(o.counterparty) && typeof o.delay_period === "bigint"); + }, encode(message: IdentifiedConnection, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.id !== "") { writer.uint32(10).string(message.id); @@ -524,6 +577,30 @@ export const IdentifiedConnection = { } return message; }, + fromJSON(object: any): IdentifiedConnection { + return { + id: isSet(object.id) ? String(object.id) : "", + clientId: isSet(object.clientId) ? String(object.clientId) : "", + versions: Array.isArray(object?.versions) ? object.versions.map((e: any) => Version.fromJSON(e)) : [], + state: isSet(object.state) ? stateFromJSON(object.state) : -1, + counterparty: isSet(object.counterparty) ? Counterparty.fromJSON(object.counterparty) : undefined, + delayPeriod: isSet(object.delayPeriod) ? BigInt(object.delayPeriod.toString()) : BigInt(0) + }; + }, + toJSON(message: IdentifiedConnection): unknown { + const obj: any = {}; + message.id !== undefined && (obj.id = message.id); + message.clientId !== undefined && (obj.clientId = message.clientId); + if (message.versions) { + obj.versions = message.versions.map(e => e ? Version.toJSON(e) : undefined); + } else { + obj.versions = []; + } + message.state !== undefined && (obj.state = stateToJSON(message.state)); + message.counterparty !== undefined && (obj.counterparty = message.counterparty ? Counterparty.toJSON(message.counterparty) : undefined); + message.delayPeriod !== undefined && (obj.delayPeriod = (message.delayPeriod || BigInt(0)).toString()); + return obj; + }, fromPartial(object: Partial): IdentifiedConnection { const message = createBaseIdentifiedConnection(); message.id = object.id ?? ""; @@ -535,14 +612,24 @@ export const IdentifiedConnection = { return message; }, fromAmino(object: IdentifiedConnectionAmino): IdentifiedConnection { - return { - id: object.id, - clientId: object.client_id, - versions: Array.isArray(object?.versions) ? object.versions.map((e: any) => Version.fromAmino(e)) : [], - state: isSet(object.state) ? stateFromJSON(object.state) : -1, - counterparty: object?.counterparty ? Counterparty.fromAmino(object.counterparty) : undefined, - delayPeriod: BigInt(object.delay_period) - }; + const message = createBaseIdentifiedConnection(); + if (object.id !== undefined && object.id !== null) { + message.id = object.id; + } + if (object.client_id !== undefined && object.client_id !== null) { + message.clientId = object.client_id; + } + message.versions = object.versions?.map(e => Version.fromAmino(e)) || []; + if (object.state !== undefined && object.state !== null) { + message.state = stateFromJSON(object.state); + } + if (object.counterparty !== undefined && object.counterparty !== null) { + message.counterparty = Counterparty.fromAmino(object.counterparty); + } + if (object.delay_period !== undefined && object.delay_period !== null) { + message.delayPeriod = BigInt(object.delay_period); + } + return message; }, toAmino(message: IdentifiedConnection): IdentifiedConnectionAmino { const obj: any = {}; @@ -553,7 +640,7 @@ export const IdentifiedConnection = { } else { obj.versions = []; } - obj.state = message.state; + obj.state = stateToJSON(message.state); obj.counterparty = message.counterparty ? Counterparty.toAmino(message.counterparty) : undefined; obj.delay_period = message.delayPeriod ? message.delayPeriod.toString() : undefined; return obj; @@ -580,6 +667,8 @@ export const IdentifiedConnection = { }; } }; +GlobalDecoderRegistry.register(IdentifiedConnection.typeUrl, IdentifiedConnection); +GlobalDecoderRegistry.registerAminoProtoMapping(IdentifiedConnection.aminoType, IdentifiedConnection.typeUrl); function createBaseCounterparty(): Counterparty { return { clientId: "", @@ -589,6 +678,16 @@ function createBaseCounterparty(): Counterparty { } export const Counterparty = { typeUrl: "/ibc.core.connection.v1.Counterparty", + aminoType: "cosmos-sdk/Counterparty", + is(o: any): o is Counterparty { + return o && (o.$typeUrl === Counterparty.typeUrl || typeof o.clientId === "string" && typeof o.connectionId === "string" && MerklePrefix.is(o.prefix)); + }, + isSDK(o: any): o is CounterpartySDKType { + return o && (o.$typeUrl === Counterparty.typeUrl || typeof o.client_id === "string" && typeof o.connection_id === "string" && MerklePrefix.isSDK(o.prefix)); + }, + isAmino(o: any): o is CounterpartyAmino { + return o && (o.$typeUrl === Counterparty.typeUrl || typeof o.client_id === "string" && typeof o.connection_id === "string" && MerklePrefix.isAmino(o.prefix)); + }, encode(message: Counterparty, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.clientId !== "") { writer.uint32(10).string(message.clientId); @@ -624,6 +723,20 @@ export const Counterparty = { } return message; }, + fromJSON(object: any): Counterparty { + return { + clientId: isSet(object.clientId) ? String(object.clientId) : "", + connectionId: isSet(object.connectionId) ? String(object.connectionId) : "", + prefix: isSet(object.prefix) ? MerklePrefix.fromJSON(object.prefix) : undefined + }; + }, + toJSON(message: Counterparty): unknown { + const obj: any = {}; + message.clientId !== undefined && (obj.clientId = message.clientId); + message.connectionId !== undefined && (obj.connectionId = message.connectionId); + message.prefix !== undefined && (obj.prefix = message.prefix ? MerklePrefix.toJSON(message.prefix) : undefined); + return obj; + }, fromPartial(object: Partial): Counterparty { const message = createBaseCounterparty(); message.clientId = object.clientId ?? ""; @@ -632,11 +745,17 @@ export const Counterparty = { return message; }, fromAmino(object: CounterpartyAmino): Counterparty { - return { - clientId: object.client_id, - connectionId: object.connection_id, - prefix: object?.prefix ? MerklePrefix.fromAmino(object.prefix) : undefined - }; + const message = createBaseCounterparty(); + if (object.client_id !== undefined && object.client_id !== null) { + message.clientId = object.client_id; + } + if (object.connection_id !== undefined && object.connection_id !== null) { + message.connectionId = object.connection_id; + } + if (object.prefix !== undefined && object.prefix !== null) { + message.prefix = MerklePrefix.fromAmino(object.prefix); + } + return message; }, toAmino(message: Counterparty): CounterpartyAmino { const obj: any = {}; @@ -667,6 +786,8 @@ export const Counterparty = { }; } }; +GlobalDecoderRegistry.register(Counterparty.typeUrl, Counterparty); +GlobalDecoderRegistry.registerAminoProtoMapping(Counterparty.aminoType, Counterparty.typeUrl); function createBaseClientPaths(): ClientPaths { return { paths: [] @@ -674,6 +795,16 @@ function createBaseClientPaths(): ClientPaths { } export const ClientPaths = { typeUrl: "/ibc.core.connection.v1.ClientPaths", + aminoType: "cosmos-sdk/ClientPaths", + is(o: any): o is ClientPaths { + return o && (o.$typeUrl === ClientPaths.typeUrl || Array.isArray(o.paths) && (!o.paths.length || typeof o.paths[0] === "string")); + }, + isSDK(o: any): o is ClientPathsSDKType { + return o && (o.$typeUrl === ClientPaths.typeUrl || Array.isArray(o.paths) && (!o.paths.length || typeof o.paths[0] === "string")); + }, + isAmino(o: any): o is ClientPathsAmino { + return o && (o.$typeUrl === ClientPaths.typeUrl || Array.isArray(o.paths) && (!o.paths.length || typeof o.paths[0] === "string")); + }, encode(message: ClientPaths, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.paths) { writer.uint32(10).string(v!); @@ -697,15 +828,29 @@ export const ClientPaths = { } return message; }, + fromJSON(object: any): ClientPaths { + return { + paths: Array.isArray(object?.paths) ? object.paths.map((e: any) => String(e)) : [] + }; + }, + toJSON(message: ClientPaths): unknown { + const obj: any = {}; + if (message.paths) { + obj.paths = message.paths.map(e => e); + } else { + obj.paths = []; + } + return obj; + }, fromPartial(object: Partial): ClientPaths { const message = createBaseClientPaths(); message.paths = object.paths?.map(e => e) || []; return message; }, fromAmino(object: ClientPathsAmino): ClientPaths { - return { - paths: Array.isArray(object?.paths) ? object.paths.map((e: any) => e) : [] - }; + const message = createBaseClientPaths(); + message.paths = object.paths?.map(e => e) || []; + return message; }, toAmino(message: ClientPaths): ClientPathsAmino { const obj: any = {}; @@ -738,6 +883,8 @@ export const ClientPaths = { }; } }; +GlobalDecoderRegistry.register(ClientPaths.typeUrl, ClientPaths); +GlobalDecoderRegistry.registerAminoProtoMapping(ClientPaths.aminoType, ClientPaths.typeUrl); function createBaseConnectionPaths(): ConnectionPaths { return { clientId: "", @@ -746,6 +893,16 @@ function createBaseConnectionPaths(): ConnectionPaths { } export const ConnectionPaths = { typeUrl: "/ibc.core.connection.v1.ConnectionPaths", + aminoType: "cosmos-sdk/ConnectionPaths", + is(o: any): o is ConnectionPaths { + return o && (o.$typeUrl === ConnectionPaths.typeUrl || typeof o.clientId === "string" && Array.isArray(o.paths) && (!o.paths.length || typeof o.paths[0] === "string")); + }, + isSDK(o: any): o is ConnectionPathsSDKType { + return o && (o.$typeUrl === ConnectionPaths.typeUrl || typeof o.client_id === "string" && Array.isArray(o.paths) && (!o.paths.length || typeof o.paths[0] === "string")); + }, + isAmino(o: any): o is ConnectionPathsAmino { + return o && (o.$typeUrl === ConnectionPaths.typeUrl || typeof o.client_id === "string" && Array.isArray(o.paths) && (!o.paths.length || typeof o.paths[0] === "string")); + }, encode(message: ConnectionPaths, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.clientId !== "") { writer.uint32(10).string(message.clientId); @@ -775,6 +932,22 @@ export const ConnectionPaths = { } return message; }, + fromJSON(object: any): ConnectionPaths { + return { + clientId: isSet(object.clientId) ? String(object.clientId) : "", + paths: Array.isArray(object?.paths) ? object.paths.map((e: any) => String(e)) : [] + }; + }, + toJSON(message: ConnectionPaths): unknown { + const obj: any = {}; + message.clientId !== undefined && (obj.clientId = message.clientId); + if (message.paths) { + obj.paths = message.paths.map(e => e); + } else { + obj.paths = []; + } + return obj; + }, fromPartial(object: Partial): ConnectionPaths { const message = createBaseConnectionPaths(); message.clientId = object.clientId ?? ""; @@ -782,10 +955,12 @@ export const ConnectionPaths = { return message; }, fromAmino(object: ConnectionPathsAmino): ConnectionPaths { - return { - clientId: object.client_id, - paths: Array.isArray(object?.paths) ? object.paths.map((e: any) => e) : [] - }; + const message = createBaseConnectionPaths(); + if (object.client_id !== undefined && object.client_id !== null) { + message.clientId = object.client_id; + } + message.paths = object.paths?.map(e => e) || []; + return message; }, toAmino(message: ConnectionPaths): ConnectionPathsAmino { const obj: any = {}; @@ -819,6 +994,8 @@ export const ConnectionPaths = { }; } }; +GlobalDecoderRegistry.register(ConnectionPaths.typeUrl, ConnectionPaths); +GlobalDecoderRegistry.registerAminoProtoMapping(ConnectionPaths.aminoType, ConnectionPaths.typeUrl); function createBaseVersion(): Version { return { identifier: "", @@ -827,6 +1004,16 @@ function createBaseVersion(): Version { } export const Version = { typeUrl: "/ibc.core.connection.v1.Version", + aminoType: "cosmos-sdk/Version", + is(o: any): o is Version { + return o && (o.$typeUrl === Version.typeUrl || typeof o.identifier === "string" && Array.isArray(o.features) && (!o.features.length || typeof o.features[0] === "string")); + }, + isSDK(o: any): o is VersionSDKType { + return o && (o.$typeUrl === Version.typeUrl || typeof o.identifier === "string" && Array.isArray(o.features) && (!o.features.length || typeof o.features[0] === "string")); + }, + isAmino(o: any): o is VersionAmino { + return o && (o.$typeUrl === Version.typeUrl || typeof o.identifier === "string" && Array.isArray(o.features) && (!o.features.length || typeof o.features[0] === "string")); + }, encode(message: Version, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.identifier !== "") { writer.uint32(10).string(message.identifier); @@ -856,6 +1043,22 @@ export const Version = { } return message; }, + fromJSON(object: any): Version { + return { + identifier: isSet(object.identifier) ? String(object.identifier) : "", + features: Array.isArray(object?.features) ? object.features.map((e: any) => String(e)) : [] + }; + }, + toJSON(message: Version): unknown { + const obj: any = {}; + message.identifier !== undefined && (obj.identifier = message.identifier); + if (message.features) { + obj.features = message.features.map(e => e); + } else { + obj.features = []; + } + return obj; + }, fromPartial(object: Partial): Version { const message = createBaseVersion(); message.identifier = object.identifier ?? ""; @@ -863,10 +1066,12 @@ export const Version = { return message; }, fromAmino(object: VersionAmino): Version { - return { - identifier: object.identifier, - features: Array.isArray(object?.features) ? object.features.map((e: any) => e) : [] - }; + const message = createBaseVersion(); + if (object.identifier !== undefined && object.identifier !== null) { + message.identifier = object.identifier; + } + message.features = object.features?.map(e => e) || []; + return message; }, toAmino(message: Version): VersionAmino { const obj: any = {}; @@ -900,6 +1105,8 @@ export const Version = { }; } }; +GlobalDecoderRegistry.register(Version.typeUrl, Version); +GlobalDecoderRegistry.registerAminoProtoMapping(Version.aminoType, Version.typeUrl); function createBaseParams(): Params { return { maxExpectedTimePerBlock: BigInt(0) @@ -907,6 +1114,16 @@ function createBaseParams(): Params { } export const Params = { typeUrl: "/ibc.core.connection.v1.Params", + aminoType: "cosmos-sdk/Params", + is(o: any): o is Params { + return o && (o.$typeUrl === Params.typeUrl || typeof o.maxExpectedTimePerBlock === "bigint"); + }, + isSDK(o: any): o is ParamsSDKType { + return o && (o.$typeUrl === Params.typeUrl || typeof o.max_expected_time_per_block === "bigint"); + }, + isAmino(o: any): o is ParamsAmino { + return o && (o.$typeUrl === Params.typeUrl || typeof o.max_expected_time_per_block === "bigint"); + }, encode(message: Params, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.maxExpectedTimePerBlock !== BigInt(0)) { writer.uint32(8).uint64(message.maxExpectedTimePerBlock); @@ -930,15 +1147,27 @@ export const Params = { } return message; }, + fromJSON(object: any): Params { + return { + maxExpectedTimePerBlock: isSet(object.maxExpectedTimePerBlock) ? BigInt(object.maxExpectedTimePerBlock.toString()) : BigInt(0) + }; + }, + toJSON(message: Params): unknown { + const obj: any = {}; + message.maxExpectedTimePerBlock !== undefined && (obj.maxExpectedTimePerBlock = (message.maxExpectedTimePerBlock || BigInt(0)).toString()); + return obj; + }, fromPartial(object: Partial): Params { const message = createBaseParams(); message.maxExpectedTimePerBlock = object.maxExpectedTimePerBlock !== undefined && object.maxExpectedTimePerBlock !== null ? BigInt(object.maxExpectedTimePerBlock.toString()) : BigInt(0); return message; }, fromAmino(object: ParamsAmino): Params { - return { - maxExpectedTimePerBlock: BigInt(object.max_expected_time_per_block) - }; + const message = createBaseParams(); + if (object.max_expected_time_per_block !== undefined && object.max_expected_time_per_block !== null) { + message.maxExpectedTimePerBlock = BigInt(object.max_expected_time_per_block); + } + return message; }, toAmino(message: Params): ParamsAmino { const obj: any = {}; @@ -966,4 +1195,6 @@ export const Params = { value: Params.encode(message).finish() }; } -}; \ No newline at end of file +}; +GlobalDecoderRegistry.register(Params.typeUrl, Params); +GlobalDecoderRegistry.registerAminoProtoMapping(Params.aminoType, Params.typeUrl); \ No newline at end of file diff --git a/packages/osmojs/src/codegen/ibc/core/connection/v1/genesis.ts b/packages/osmojs/src/codegen/ibc/core/connection/v1/genesis.ts index eb6e911a3..3aacdb46c 100644 --- a/packages/osmojs/src/codegen/ibc/core/connection/v1/genesis.ts +++ b/packages/osmojs/src/codegen/ibc/core/connection/v1/genesis.ts @@ -1,5 +1,7 @@ import { IdentifiedConnection, IdentifiedConnectionAmino, IdentifiedConnectionSDKType, ConnectionPaths, ConnectionPathsAmino, ConnectionPathsSDKType, Params, ParamsAmino, ParamsSDKType } from "./connection"; import { BinaryReader, BinaryWriter } from "../../../../binary"; +import { isSet } from "../../../../helpers"; +import { GlobalDecoderRegistry } from "../../../../registry"; /** GenesisState defines the ibc connection submodule's genesis state. */ export interface GenesisState { connections: IdentifiedConnection[]; @@ -14,10 +16,10 @@ export interface GenesisStateProtoMsg { } /** GenesisState defines the ibc connection submodule's genesis state. */ export interface GenesisStateAmino { - connections: IdentifiedConnectionAmino[]; - client_connection_paths: ConnectionPathsAmino[]; + connections?: IdentifiedConnectionAmino[]; + client_connection_paths?: ConnectionPathsAmino[]; /** the sequence for the next generated connection identifier */ - next_connection_sequence: string; + next_connection_sequence?: string; params?: ParamsAmino; } export interface GenesisStateAminoMsg { @@ -41,6 +43,16 @@ function createBaseGenesisState(): GenesisState { } export const GenesisState = { typeUrl: "/ibc.core.connection.v1.GenesisState", + aminoType: "cosmos-sdk/GenesisState", + is(o: any): o is GenesisState { + return o && (o.$typeUrl === GenesisState.typeUrl || Array.isArray(o.connections) && (!o.connections.length || IdentifiedConnection.is(o.connections[0])) && Array.isArray(o.clientConnectionPaths) && (!o.clientConnectionPaths.length || ConnectionPaths.is(o.clientConnectionPaths[0])) && typeof o.nextConnectionSequence === "bigint" && Params.is(o.params)); + }, + isSDK(o: any): o is GenesisStateSDKType { + return o && (o.$typeUrl === GenesisState.typeUrl || Array.isArray(o.connections) && (!o.connections.length || IdentifiedConnection.isSDK(o.connections[0])) && Array.isArray(o.client_connection_paths) && (!o.client_connection_paths.length || ConnectionPaths.isSDK(o.client_connection_paths[0])) && typeof o.next_connection_sequence === "bigint" && Params.isSDK(o.params)); + }, + isAmino(o: any): o is GenesisStateAmino { + return o && (o.$typeUrl === GenesisState.typeUrl || Array.isArray(o.connections) && (!o.connections.length || IdentifiedConnection.isAmino(o.connections[0])) && Array.isArray(o.client_connection_paths) && (!o.client_connection_paths.length || ConnectionPaths.isAmino(o.client_connection_paths[0])) && typeof o.next_connection_sequence === "bigint" && Params.isAmino(o.params)); + }, encode(message: GenesisState, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.connections) { IdentifiedConnection.encode(v!, writer.uint32(10).fork()).ldelim(); @@ -82,6 +94,30 @@ export const GenesisState = { } return message; }, + fromJSON(object: any): GenesisState { + return { + connections: Array.isArray(object?.connections) ? object.connections.map((e: any) => IdentifiedConnection.fromJSON(e)) : [], + clientConnectionPaths: Array.isArray(object?.clientConnectionPaths) ? object.clientConnectionPaths.map((e: any) => ConnectionPaths.fromJSON(e)) : [], + nextConnectionSequence: isSet(object.nextConnectionSequence) ? BigInt(object.nextConnectionSequence.toString()) : BigInt(0), + params: isSet(object.params) ? Params.fromJSON(object.params) : undefined + }; + }, + toJSON(message: GenesisState): unknown { + const obj: any = {}; + if (message.connections) { + obj.connections = message.connections.map(e => e ? IdentifiedConnection.toJSON(e) : undefined); + } else { + obj.connections = []; + } + if (message.clientConnectionPaths) { + obj.clientConnectionPaths = message.clientConnectionPaths.map(e => e ? ConnectionPaths.toJSON(e) : undefined); + } else { + obj.clientConnectionPaths = []; + } + message.nextConnectionSequence !== undefined && (obj.nextConnectionSequence = (message.nextConnectionSequence || BigInt(0)).toString()); + message.params !== undefined && (obj.params = message.params ? Params.toJSON(message.params) : undefined); + return obj; + }, fromPartial(object: Partial): GenesisState { const message = createBaseGenesisState(); message.connections = object.connections?.map(e => IdentifiedConnection.fromPartial(e)) || []; @@ -91,12 +127,16 @@ export const GenesisState = { return message; }, fromAmino(object: GenesisStateAmino): GenesisState { - return { - connections: Array.isArray(object?.connections) ? object.connections.map((e: any) => IdentifiedConnection.fromAmino(e)) : [], - clientConnectionPaths: Array.isArray(object?.client_connection_paths) ? object.client_connection_paths.map((e: any) => ConnectionPaths.fromAmino(e)) : [], - nextConnectionSequence: BigInt(object.next_connection_sequence), - params: object?.params ? Params.fromAmino(object.params) : undefined - }; + const message = createBaseGenesisState(); + message.connections = object.connections?.map(e => IdentifiedConnection.fromAmino(e)) || []; + message.clientConnectionPaths = object.client_connection_paths?.map(e => ConnectionPaths.fromAmino(e)) || []; + if (object.next_connection_sequence !== undefined && object.next_connection_sequence !== null) { + message.nextConnectionSequence = BigInt(object.next_connection_sequence); + } + if (object.params !== undefined && object.params !== null) { + message.params = Params.fromAmino(object.params); + } + return message; }, toAmino(message: GenesisState): GenesisStateAmino { const obj: any = {}; @@ -135,4 +175,6 @@ export const GenesisState = { value: GenesisState.encode(message).finish() }; } -}; \ No newline at end of file +}; +GlobalDecoderRegistry.register(GenesisState.typeUrl, GenesisState); +GlobalDecoderRegistry.registerAminoProtoMapping(GenesisState.aminoType, GenesisState.typeUrl); \ No newline at end of file diff --git a/packages/osmojs/src/codegen/ibc/core/connection/v1/query.ts b/packages/osmojs/src/codegen/ibc/core/connection/v1/query.ts index bfb5f5dd8..73547fd48 100644 --- a/packages/osmojs/src/codegen/ibc/core/connection/v1/query.ts +++ b/packages/osmojs/src/codegen/ibc/core/connection/v1/query.ts @@ -3,6 +3,8 @@ import { ConnectionEnd, ConnectionEndAmino, ConnectionEndSDKType, IdentifiedConn import { Height, HeightAmino, HeightSDKType, IdentifiedClientState, IdentifiedClientStateAmino, IdentifiedClientStateSDKType, Params, ParamsAmino, ParamsSDKType } from "../../client/v1/client"; import { Any, AnyAmino, AnySDKType } from "../../../../google/protobuf/any"; import { BinaryReader, BinaryWriter } from "../../../../binary"; +import { isSet, bytesFromBase64, base64FromBytes } from "../../../../helpers"; +import { GlobalDecoderRegistry } from "../../../../registry"; /** * QueryConnectionRequest is the request type for the Query/Connection RPC * method @@ -21,7 +23,7 @@ export interface QueryConnectionRequestProtoMsg { */ export interface QueryConnectionRequestAmino { /** connection unique identifier */ - connection_id: string; + connection_id?: string; } export interface QueryConnectionRequestAminoMsg { type: "cosmos-sdk/QueryConnectionRequest"; @@ -41,7 +43,7 @@ export interface QueryConnectionRequestSDKType { */ export interface QueryConnectionResponse { /** connection associated with the request identifier */ - connection: ConnectionEnd; + connection?: ConnectionEnd; /** merkle proof of existence */ proof: Uint8Array; /** height at which the proof was retrieved */ @@ -60,7 +62,7 @@ export interface QueryConnectionResponseAmino { /** connection associated with the request identifier */ connection?: ConnectionEndAmino; /** merkle proof of existence */ - proof: Uint8Array; + proof?: string; /** height at which the proof was retrieved */ proof_height?: HeightAmino; } @@ -74,7 +76,7 @@ export interface QueryConnectionResponseAminoMsg { * which the proof was retrieved. */ export interface QueryConnectionResponseSDKType { - connection: ConnectionEndSDKType; + connection?: ConnectionEndSDKType; proof: Uint8Array; proof_height: HeightSDKType; } @@ -83,7 +85,7 @@ export interface QueryConnectionResponseSDKType { * method */ export interface QueryConnectionsRequest { - pagination: PageRequest; + pagination?: PageRequest; } export interface QueryConnectionsRequestProtoMsg { typeUrl: "/ibc.core.connection.v1.QueryConnectionsRequest"; @@ -105,7 +107,7 @@ export interface QueryConnectionsRequestAminoMsg { * method */ export interface QueryConnectionsRequestSDKType { - pagination: PageRequestSDKType; + pagination?: PageRequestSDKType; } /** * QueryConnectionsResponse is the response type for the Query/Connections RPC @@ -115,7 +117,7 @@ export interface QueryConnectionsResponse { /** list of stored connections of the chain. */ connections: IdentifiedConnection[]; /** pagination response */ - pagination: PageResponse; + pagination?: PageResponse; /** query block height */ height: Height; } @@ -129,7 +131,7 @@ export interface QueryConnectionsResponseProtoMsg { */ export interface QueryConnectionsResponseAmino { /** list of stored connections of the chain. */ - connections: IdentifiedConnectionAmino[]; + connections?: IdentifiedConnectionAmino[]; /** pagination response */ pagination?: PageResponseAmino; /** query block height */ @@ -145,7 +147,7 @@ export interface QueryConnectionsResponseAminoMsg { */ export interface QueryConnectionsResponseSDKType { connections: IdentifiedConnectionSDKType[]; - pagination: PageResponseSDKType; + pagination?: PageResponseSDKType; height: HeightSDKType; } /** @@ -166,7 +168,7 @@ export interface QueryClientConnectionsRequestProtoMsg { */ export interface QueryClientConnectionsRequestAmino { /** client identifier associated with a connection */ - client_id: string; + client_id?: string; } export interface QueryClientConnectionsRequestAminoMsg { type: "cosmos-sdk/QueryClientConnectionsRequest"; @@ -201,9 +203,9 @@ export interface QueryClientConnectionsResponseProtoMsg { */ export interface QueryClientConnectionsResponseAmino { /** slice of all the connection paths associated with a client. */ - connection_paths: string[]; + connection_paths?: string[]; /** merkle proof of existence */ - proof: Uint8Array; + proof?: string; /** height at which the proof was generated */ proof_height?: HeightAmino; } @@ -238,7 +240,7 @@ export interface QueryConnectionClientStateRequestProtoMsg { */ export interface QueryConnectionClientStateRequestAmino { /** connection identifier */ - connection_id: string; + connection_id?: string; } export interface QueryConnectionClientStateRequestAminoMsg { type: "cosmos-sdk/QueryConnectionClientStateRequest"; @@ -257,7 +259,7 @@ export interface QueryConnectionClientStateRequestSDKType { */ export interface QueryConnectionClientStateResponse { /** client state associated with the channel */ - identifiedClientState: IdentifiedClientState; + identifiedClientState?: IdentifiedClientState; /** merkle proof of existence */ proof: Uint8Array; /** height at which the proof was retrieved */ @@ -275,7 +277,7 @@ export interface QueryConnectionClientStateResponseAmino { /** client state associated with the channel */ identified_client_state?: IdentifiedClientStateAmino; /** merkle proof of existence */ - proof: Uint8Array; + proof?: string; /** height at which the proof was retrieved */ proof_height?: HeightAmino; } @@ -288,7 +290,7 @@ export interface QueryConnectionClientStateResponseAminoMsg { * Query/ConnectionClientState RPC method */ export interface QueryConnectionClientStateResponseSDKType { - identified_client_state: IdentifiedClientStateSDKType; + identified_client_state?: IdentifiedClientStateSDKType; proof: Uint8Array; proof_height: HeightSDKType; } @@ -312,9 +314,9 @@ export interface QueryConnectionConsensusStateRequestProtoMsg { */ export interface QueryConnectionConsensusStateRequestAmino { /** connection identifier */ - connection_id: string; - revision_number: string; - revision_height: string; + connection_id?: string; + revision_number?: string; + revision_height?: string; } export interface QueryConnectionConsensusStateRequestAminoMsg { type: "cosmos-sdk/QueryConnectionConsensusStateRequest"; @@ -335,7 +337,7 @@ export interface QueryConnectionConsensusStateRequestSDKType { */ export interface QueryConnectionConsensusStateResponse { /** consensus state associated with the channel */ - consensusState: Any; + consensusState?: Any; /** client ID associated with the consensus state */ clientId: string; /** merkle proof of existence */ @@ -355,9 +357,9 @@ export interface QueryConnectionConsensusStateResponseAmino { /** consensus state associated with the channel */ consensus_state?: AnyAmino; /** client ID associated with the consensus state */ - client_id: string; + client_id?: string; /** merkle proof of existence */ - proof: Uint8Array; + proof?: string; /** height at which the proof was retrieved */ proof_height?: HeightAmino; } @@ -370,7 +372,7 @@ export interface QueryConnectionConsensusStateResponseAminoMsg { * Query/ConnectionConsensusState RPC method */ export interface QueryConnectionConsensusStateResponseSDKType { - consensus_state: AnySDKType; + consensus_state?: AnySDKType; client_id: string; proof: Uint8Array; proof_height: HeightSDKType; @@ -392,7 +394,7 @@ export interface QueryConnectionParamsRequestSDKType {} /** QueryConnectionParamsResponse is the response type for the Query/ConnectionParams RPC method. */ export interface QueryConnectionParamsResponse { /** params defines the parameters of the module. */ - params: Params; + params?: Params; } export interface QueryConnectionParamsResponseProtoMsg { typeUrl: "/ibc.core.connection.v1.QueryConnectionParamsResponse"; @@ -409,7 +411,7 @@ export interface QueryConnectionParamsResponseAminoMsg { } /** QueryConnectionParamsResponse is the response type for the Query/ConnectionParams RPC method. */ export interface QueryConnectionParamsResponseSDKType { - params: ParamsSDKType; + params?: ParamsSDKType; } function createBaseQueryConnectionRequest(): QueryConnectionRequest { return { @@ -418,6 +420,16 @@ function createBaseQueryConnectionRequest(): QueryConnectionRequest { } export const QueryConnectionRequest = { typeUrl: "/ibc.core.connection.v1.QueryConnectionRequest", + aminoType: "cosmos-sdk/QueryConnectionRequest", + is(o: any): o is QueryConnectionRequest { + return o && (o.$typeUrl === QueryConnectionRequest.typeUrl || typeof o.connectionId === "string"); + }, + isSDK(o: any): o is QueryConnectionRequestSDKType { + return o && (o.$typeUrl === QueryConnectionRequest.typeUrl || typeof o.connection_id === "string"); + }, + isAmino(o: any): o is QueryConnectionRequestAmino { + return o && (o.$typeUrl === QueryConnectionRequest.typeUrl || typeof o.connection_id === "string"); + }, encode(message: QueryConnectionRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.connectionId !== "") { writer.uint32(10).string(message.connectionId); @@ -441,15 +453,27 @@ export const QueryConnectionRequest = { } return message; }, + fromJSON(object: any): QueryConnectionRequest { + return { + connectionId: isSet(object.connectionId) ? String(object.connectionId) : "" + }; + }, + toJSON(message: QueryConnectionRequest): unknown { + const obj: any = {}; + message.connectionId !== undefined && (obj.connectionId = message.connectionId); + return obj; + }, fromPartial(object: Partial): QueryConnectionRequest { const message = createBaseQueryConnectionRequest(); message.connectionId = object.connectionId ?? ""; return message; }, fromAmino(object: QueryConnectionRequestAmino): QueryConnectionRequest { - return { - connectionId: object.connection_id - }; + const message = createBaseQueryConnectionRequest(); + if (object.connection_id !== undefined && object.connection_id !== null) { + message.connectionId = object.connection_id; + } + return message; }, toAmino(message: QueryConnectionRequest): QueryConnectionRequestAmino { const obj: any = {}; @@ -478,15 +502,27 @@ export const QueryConnectionRequest = { }; } }; +GlobalDecoderRegistry.register(QueryConnectionRequest.typeUrl, QueryConnectionRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryConnectionRequest.aminoType, QueryConnectionRequest.typeUrl); function createBaseQueryConnectionResponse(): QueryConnectionResponse { return { - connection: ConnectionEnd.fromPartial({}), + connection: undefined, proof: new Uint8Array(), proofHeight: Height.fromPartial({}) }; } export const QueryConnectionResponse = { typeUrl: "/ibc.core.connection.v1.QueryConnectionResponse", + aminoType: "cosmos-sdk/QueryConnectionResponse", + is(o: any): o is QueryConnectionResponse { + return o && (o.$typeUrl === QueryConnectionResponse.typeUrl || (o.proof instanceof Uint8Array || typeof o.proof === "string") && Height.is(o.proofHeight)); + }, + isSDK(o: any): o is QueryConnectionResponseSDKType { + return o && (o.$typeUrl === QueryConnectionResponse.typeUrl || (o.proof instanceof Uint8Array || typeof o.proof === "string") && Height.isSDK(o.proof_height)); + }, + isAmino(o: any): o is QueryConnectionResponseAmino { + return o && (o.$typeUrl === QueryConnectionResponse.typeUrl || (o.proof instanceof Uint8Array || typeof o.proof === "string") && Height.isAmino(o.proof_height)); + }, encode(message: QueryConnectionResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.connection !== undefined) { ConnectionEnd.encode(message.connection, writer.uint32(10).fork()).ldelim(); @@ -522,6 +558,20 @@ export const QueryConnectionResponse = { } return message; }, + fromJSON(object: any): QueryConnectionResponse { + return { + connection: isSet(object.connection) ? ConnectionEnd.fromJSON(object.connection) : undefined, + proof: isSet(object.proof) ? bytesFromBase64(object.proof) : new Uint8Array(), + proofHeight: isSet(object.proofHeight) ? Height.fromJSON(object.proofHeight) : undefined + }; + }, + toJSON(message: QueryConnectionResponse): unknown { + const obj: any = {}; + message.connection !== undefined && (obj.connection = message.connection ? ConnectionEnd.toJSON(message.connection) : undefined); + message.proof !== undefined && (obj.proof = base64FromBytes(message.proof !== undefined ? message.proof : new Uint8Array())); + message.proofHeight !== undefined && (obj.proofHeight = message.proofHeight ? Height.toJSON(message.proofHeight) : undefined); + return obj; + }, fromPartial(object: Partial): QueryConnectionResponse { const message = createBaseQueryConnectionResponse(); message.connection = object.connection !== undefined && object.connection !== null ? ConnectionEnd.fromPartial(object.connection) : undefined; @@ -530,16 +580,22 @@ export const QueryConnectionResponse = { return message; }, fromAmino(object: QueryConnectionResponseAmino): QueryConnectionResponse { - return { - connection: object?.connection ? ConnectionEnd.fromAmino(object.connection) : undefined, - proof: object.proof, - proofHeight: object?.proof_height ? Height.fromAmino(object.proof_height) : undefined - }; + const message = createBaseQueryConnectionResponse(); + if (object.connection !== undefined && object.connection !== null) { + message.connection = ConnectionEnd.fromAmino(object.connection); + } + if (object.proof !== undefined && object.proof !== null) { + message.proof = bytesFromBase64(object.proof); + } + if (object.proof_height !== undefined && object.proof_height !== null) { + message.proofHeight = Height.fromAmino(object.proof_height); + } + return message; }, toAmino(message: QueryConnectionResponse): QueryConnectionResponseAmino { const obj: any = {}; obj.connection = message.connection ? ConnectionEnd.toAmino(message.connection) : undefined; - obj.proof = message.proof; + obj.proof = message.proof ? base64FromBytes(message.proof) : undefined; obj.proof_height = message.proofHeight ? Height.toAmino(message.proofHeight) : {}; return obj; }, @@ -565,13 +621,25 @@ export const QueryConnectionResponse = { }; } }; +GlobalDecoderRegistry.register(QueryConnectionResponse.typeUrl, QueryConnectionResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryConnectionResponse.aminoType, QueryConnectionResponse.typeUrl); function createBaseQueryConnectionsRequest(): QueryConnectionsRequest { return { - pagination: PageRequest.fromPartial({}) + pagination: undefined }; } export const QueryConnectionsRequest = { typeUrl: "/ibc.core.connection.v1.QueryConnectionsRequest", + aminoType: "cosmos-sdk/QueryConnectionsRequest", + is(o: any): o is QueryConnectionsRequest { + return o && o.$typeUrl === QueryConnectionsRequest.typeUrl; + }, + isSDK(o: any): o is QueryConnectionsRequestSDKType { + return o && o.$typeUrl === QueryConnectionsRequest.typeUrl; + }, + isAmino(o: any): o is QueryConnectionsRequestAmino { + return o && o.$typeUrl === QueryConnectionsRequest.typeUrl; + }, encode(message: QueryConnectionsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.pagination !== undefined) { PageRequest.encode(message.pagination, writer.uint32(10).fork()).ldelim(); @@ -595,15 +663,27 @@ export const QueryConnectionsRequest = { } return message; }, + fromJSON(object: any): QueryConnectionsRequest { + return { + pagination: isSet(object.pagination) ? PageRequest.fromJSON(object.pagination) : undefined + }; + }, + toJSON(message: QueryConnectionsRequest): unknown { + const obj: any = {}; + message.pagination !== undefined && (obj.pagination = message.pagination ? PageRequest.toJSON(message.pagination) : undefined); + return obj; + }, fromPartial(object: Partial): QueryConnectionsRequest { const message = createBaseQueryConnectionsRequest(); message.pagination = object.pagination !== undefined && object.pagination !== null ? PageRequest.fromPartial(object.pagination) : undefined; return message; }, fromAmino(object: QueryConnectionsRequestAmino): QueryConnectionsRequest { - return { - pagination: object?.pagination ? PageRequest.fromAmino(object.pagination) : undefined - }; + const message = createBaseQueryConnectionsRequest(); + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromAmino(object.pagination); + } + return message; }, toAmino(message: QueryConnectionsRequest): QueryConnectionsRequestAmino { const obj: any = {}; @@ -632,15 +712,27 @@ export const QueryConnectionsRequest = { }; } }; +GlobalDecoderRegistry.register(QueryConnectionsRequest.typeUrl, QueryConnectionsRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryConnectionsRequest.aminoType, QueryConnectionsRequest.typeUrl); function createBaseQueryConnectionsResponse(): QueryConnectionsResponse { return { connections: [], - pagination: PageResponse.fromPartial({}), + pagination: undefined, height: Height.fromPartial({}) }; } export const QueryConnectionsResponse = { typeUrl: "/ibc.core.connection.v1.QueryConnectionsResponse", + aminoType: "cosmos-sdk/QueryConnectionsResponse", + is(o: any): o is QueryConnectionsResponse { + return o && (o.$typeUrl === QueryConnectionsResponse.typeUrl || Array.isArray(o.connections) && (!o.connections.length || IdentifiedConnection.is(o.connections[0])) && Height.is(o.height)); + }, + isSDK(o: any): o is QueryConnectionsResponseSDKType { + return o && (o.$typeUrl === QueryConnectionsResponse.typeUrl || Array.isArray(o.connections) && (!o.connections.length || IdentifiedConnection.isSDK(o.connections[0])) && Height.isSDK(o.height)); + }, + isAmino(o: any): o is QueryConnectionsResponseAmino { + return o && (o.$typeUrl === QueryConnectionsResponse.typeUrl || Array.isArray(o.connections) && (!o.connections.length || IdentifiedConnection.isAmino(o.connections[0])) && Height.isAmino(o.height)); + }, encode(message: QueryConnectionsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.connections) { IdentifiedConnection.encode(v!, writer.uint32(10).fork()).ldelim(); @@ -676,6 +768,24 @@ export const QueryConnectionsResponse = { } return message; }, + fromJSON(object: any): QueryConnectionsResponse { + return { + connections: Array.isArray(object?.connections) ? object.connections.map((e: any) => IdentifiedConnection.fromJSON(e)) : [], + pagination: isSet(object.pagination) ? PageResponse.fromJSON(object.pagination) : undefined, + height: isSet(object.height) ? Height.fromJSON(object.height) : undefined + }; + }, + toJSON(message: QueryConnectionsResponse): unknown { + const obj: any = {}; + if (message.connections) { + obj.connections = message.connections.map(e => e ? IdentifiedConnection.toJSON(e) : undefined); + } else { + obj.connections = []; + } + message.pagination !== undefined && (obj.pagination = message.pagination ? PageResponse.toJSON(message.pagination) : undefined); + message.height !== undefined && (obj.height = message.height ? Height.toJSON(message.height) : undefined); + return obj; + }, fromPartial(object: Partial): QueryConnectionsResponse { const message = createBaseQueryConnectionsResponse(); message.connections = object.connections?.map(e => IdentifiedConnection.fromPartial(e)) || []; @@ -684,11 +794,15 @@ export const QueryConnectionsResponse = { return message; }, fromAmino(object: QueryConnectionsResponseAmino): QueryConnectionsResponse { - return { - connections: Array.isArray(object?.connections) ? object.connections.map((e: any) => IdentifiedConnection.fromAmino(e)) : [], - pagination: object?.pagination ? PageResponse.fromAmino(object.pagination) : undefined, - height: object?.height ? Height.fromAmino(object.height) : undefined - }; + const message = createBaseQueryConnectionsResponse(); + message.connections = object.connections?.map(e => IdentifiedConnection.fromAmino(e)) || []; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromAmino(object.pagination); + } + if (object.height !== undefined && object.height !== null) { + message.height = Height.fromAmino(object.height); + } + return message; }, toAmino(message: QueryConnectionsResponse): QueryConnectionsResponseAmino { const obj: any = {}; @@ -723,6 +837,8 @@ export const QueryConnectionsResponse = { }; } }; +GlobalDecoderRegistry.register(QueryConnectionsResponse.typeUrl, QueryConnectionsResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryConnectionsResponse.aminoType, QueryConnectionsResponse.typeUrl); function createBaseQueryClientConnectionsRequest(): QueryClientConnectionsRequest { return { clientId: "" @@ -730,6 +846,16 @@ function createBaseQueryClientConnectionsRequest(): QueryClientConnectionsReques } export const QueryClientConnectionsRequest = { typeUrl: "/ibc.core.connection.v1.QueryClientConnectionsRequest", + aminoType: "cosmos-sdk/QueryClientConnectionsRequest", + is(o: any): o is QueryClientConnectionsRequest { + return o && (o.$typeUrl === QueryClientConnectionsRequest.typeUrl || typeof o.clientId === "string"); + }, + isSDK(o: any): o is QueryClientConnectionsRequestSDKType { + return o && (o.$typeUrl === QueryClientConnectionsRequest.typeUrl || typeof o.client_id === "string"); + }, + isAmino(o: any): o is QueryClientConnectionsRequestAmino { + return o && (o.$typeUrl === QueryClientConnectionsRequest.typeUrl || typeof o.client_id === "string"); + }, encode(message: QueryClientConnectionsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.clientId !== "") { writer.uint32(10).string(message.clientId); @@ -753,15 +879,27 @@ export const QueryClientConnectionsRequest = { } return message; }, + fromJSON(object: any): QueryClientConnectionsRequest { + return { + clientId: isSet(object.clientId) ? String(object.clientId) : "" + }; + }, + toJSON(message: QueryClientConnectionsRequest): unknown { + const obj: any = {}; + message.clientId !== undefined && (obj.clientId = message.clientId); + return obj; + }, fromPartial(object: Partial): QueryClientConnectionsRequest { const message = createBaseQueryClientConnectionsRequest(); message.clientId = object.clientId ?? ""; return message; }, fromAmino(object: QueryClientConnectionsRequestAmino): QueryClientConnectionsRequest { - return { - clientId: object.client_id - }; + const message = createBaseQueryClientConnectionsRequest(); + if (object.client_id !== undefined && object.client_id !== null) { + message.clientId = object.client_id; + } + return message; }, toAmino(message: QueryClientConnectionsRequest): QueryClientConnectionsRequestAmino { const obj: any = {}; @@ -790,6 +928,8 @@ export const QueryClientConnectionsRequest = { }; } }; +GlobalDecoderRegistry.register(QueryClientConnectionsRequest.typeUrl, QueryClientConnectionsRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryClientConnectionsRequest.aminoType, QueryClientConnectionsRequest.typeUrl); function createBaseQueryClientConnectionsResponse(): QueryClientConnectionsResponse { return { connectionPaths: [], @@ -799,6 +939,16 @@ function createBaseQueryClientConnectionsResponse(): QueryClientConnectionsRespo } export const QueryClientConnectionsResponse = { typeUrl: "/ibc.core.connection.v1.QueryClientConnectionsResponse", + aminoType: "cosmos-sdk/QueryClientConnectionsResponse", + is(o: any): o is QueryClientConnectionsResponse { + return o && (o.$typeUrl === QueryClientConnectionsResponse.typeUrl || Array.isArray(o.connectionPaths) && (!o.connectionPaths.length || typeof o.connectionPaths[0] === "string") && (o.proof instanceof Uint8Array || typeof o.proof === "string") && Height.is(o.proofHeight)); + }, + isSDK(o: any): o is QueryClientConnectionsResponseSDKType { + return o && (o.$typeUrl === QueryClientConnectionsResponse.typeUrl || Array.isArray(o.connection_paths) && (!o.connection_paths.length || typeof o.connection_paths[0] === "string") && (o.proof instanceof Uint8Array || typeof o.proof === "string") && Height.isSDK(o.proof_height)); + }, + isAmino(o: any): o is QueryClientConnectionsResponseAmino { + return o && (o.$typeUrl === QueryClientConnectionsResponse.typeUrl || Array.isArray(o.connection_paths) && (!o.connection_paths.length || typeof o.connection_paths[0] === "string") && (o.proof instanceof Uint8Array || typeof o.proof === "string") && Height.isAmino(o.proof_height)); + }, encode(message: QueryClientConnectionsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.connectionPaths) { writer.uint32(10).string(v!); @@ -834,6 +984,24 @@ export const QueryClientConnectionsResponse = { } return message; }, + fromJSON(object: any): QueryClientConnectionsResponse { + return { + connectionPaths: Array.isArray(object?.connectionPaths) ? object.connectionPaths.map((e: any) => String(e)) : [], + proof: isSet(object.proof) ? bytesFromBase64(object.proof) : new Uint8Array(), + proofHeight: isSet(object.proofHeight) ? Height.fromJSON(object.proofHeight) : undefined + }; + }, + toJSON(message: QueryClientConnectionsResponse): unknown { + const obj: any = {}; + if (message.connectionPaths) { + obj.connectionPaths = message.connectionPaths.map(e => e); + } else { + obj.connectionPaths = []; + } + message.proof !== undefined && (obj.proof = base64FromBytes(message.proof !== undefined ? message.proof : new Uint8Array())); + message.proofHeight !== undefined && (obj.proofHeight = message.proofHeight ? Height.toJSON(message.proofHeight) : undefined); + return obj; + }, fromPartial(object: Partial): QueryClientConnectionsResponse { const message = createBaseQueryClientConnectionsResponse(); message.connectionPaths = object.connectionPaths?.map(e => e) || []; @@ -842,11 +1010,15 @@ export const QueryClientConnectionsResponse = { return message; }, fromAmino(object: QueryClientConnectionsResponseAmino): QueryClientConnectionsResponse { - return { - connectionPaths: Array.isArray(object?.connection_paths) ? object.connection_paths.map((e: any) => e) : [], - proof: object.proof, - proofHeight: object?.proof_height ? Height.fromAmino(object.proof_height) : undefined - }; + const message = createBaseQueryClientConnectionsResponse(); + message.connectionPaths = object.connection_paths?.map(e => e) || []; + if (object.proof !== undefined && object.proof !== null) { + message.proof = bytesFromBase64(object.proof); + } + if (object.proof_height !== undefined && object.proof_height !== null) { + message.proofHeight = Height.fromAmino(object.proof_height); + } + return message; }, toAmino(message: QueryClientConnectionsResponse): QueryClientConnectionsResponseAmino { const obj: any = {}; @@ -855,7 +1027,7 @@ export const QueryClientConnectionsResponse = { } else { obj.connection_paths = []; } - obj.proof = message.proof; + obj.proof = message.proof ? base64FromBytes(message.proof) : undefined; obj.proof_height = message.proofHeight ? Height.toAmino(message.proofHeight) : {}; return obj; }, @@ -881,6 +1053,8 @@ export const QueryClientConnectionsResponse = { }; } }; +GlobalDecoderRegistry.register(QueryClientConnectionsResponse.typeUrl, QueryClientConnectionsResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryClientConnectionsResponse.aminoType, QueryClientConnectionsResponse.typeUrl); function createBaseQueryConnectionClientStateRequest(): QueryConnectionClientStateRequest { return { connectionId: "" @@ -888,6 +1062,16 @@ function createBaseQueryConnectionClientStateRequest(): QueryConnectionClientSta } export const QueryConnectionClientStateRequest = { typeUrl: "/ibc.core.connection.v1.QueryConnectionClientStateRequest", + aminoType: "cosmos-sdk/QueryConnectionClientStateRequest", + is(o: any): o is QueryConnectionClientStateRequest { + return o && (o.$typeUrl === QueryConnectionClientStateRequest.typeUrl || typeof o.connectionId === "string"); + }, + isSDK(o: any): o is QueryConnectionClientStateRequestSDKType { + return o && (o.$typeUrl === QueryConnectionClientStateRequest.typeUrl || typeof o.connection_id === "string"); + }, + isAmino(o: any): o is QueryConnectionClientStateRequestAmino { + return o && (o.$typeUrl === QueryConnectionClientStateRequest.typeUrl || typeof o.connection_id === "string"); + }, encode(message: QueryConnectionClientStateRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.connectionId !== "") { writer.uint32(10).string(message.connectionId); @@ -911,15 +1095,27 @@ export const QueryConnectionClientStateRequest = { } return message; }, + fromJSON(object: any): QueryConnectionClientStateRequest { + return { + connectionId: isSet(object.connectionId) ? String(object.connectionId) : "" + }; + }, + toJSON(message: QueryConnectionClientStateRequest): unknown { + const obj: any = {}; + message.connectionId !== undefined && (obj.connectionId = message.connectionId); + return obj; + }, fromPartial(object: Partial): QueryConnectionClientStateRequest { const message = createBaseQueryConnectionClientStateRequest(); message.connectionId = object.connectionId ?? ""; return message; }, fromAmino(object: QueryConnectionClientStateRequestAmino): QueryConnectionClientStateRequest { - return { - connectionId: object.connection_id - }; + const message = createBaseQueryConnectionClientStateRequest(); + if (object.connection_id !== undefined && object.connection_id !== null) { + message.connectionId = object.connection_id; + } + return message; }, toAmino(message: QueryConnectionClientStateRequest): QueryConnectionClientStateRequestAmino { const obj: any = {}; @@ -948,15 +1144,27 @@ export const QueryConnectionClientStateRequest = { }; } }; +GlobalDecoderRegistry.register(QueryConnectionClientStateRequest.typeUrl, QueryConnectionClientStateRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryConnectionClientStateRequest.aminoType, QueryConnectionClientStateRequest.typeUrl); function createBaseQueryConnectionClientStateResponse(): QueryConnectionClientStateResponse { return { - identifiedClientState: IdentifiedClientState.fromPartial({}), + identifiedClientState: undefined, proof: new Uint8Array(), proofHeight: Height.fromPartial({}) }; } export const QueryConnectionClientStateResponse = { typeUrl: "/ibc.core.connection.v1.QueryConnectionClientStateResponse", + aminoType: "cosmos-sdk/QueryConnectionClientStateResponse", + is(o: any): o is QueryConnectionClientStateResponse { + return o && (o.$typeUrl === QueryConnectionClientStateResponse.typeUrl || (o.proof instanceof Uint8Array || typeof o.proof === "string") && Height.is(o.proofHeight)); + }, + isSDK(o: any): o is QueryConnectionClientStateResponseSDKType { + return o && (o.$typeUrl === QueryConnectionClientStateResponse.typeUrl || (o.proof instanceof Uint8Array || typeof o.proof === "string") && Height.isSDK(o.proof_height)); + }, + isAmino(o: any): o is QueryConnectionClientStateResponseAmino { + return o && (o.$typeUrl === QueryConnectionClientStateResponse.typeUrl || (o.proof instanceof Uint8Array || typeof o.proof === "string") && Height.isAmino(o.proof_height)); + }, encode(message: QueryConnectionClientStateResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.identifiedClientState !== undefined) { IdentifiedClientState.encode(message.identifiedClientState, writer.uint32(10).fork()).ldelim(); @@ -992,6 +1200,20 @@ export const QueryConnectionClientStateResponse = { } return message; }, + fromJSON(object: any): QueryConnectionClientStateResponse { + return { + identifiedClientState: isSet(object.identifiedClientState) ? IdentifiedClientState.fromJSON(object.identifiedClientState) : undefined, + proof: isSet(object.proof) ? bytesFromBase64(object.proof) : new Uint8Array(), + proofHeight: isSet(object.proofHeight) ? Height.fromJSON(object.proofHeight) : undefined + }; + }, + toJSON(message: QueryConnectionClientStateResponse): unknown { + const obj: any = {}; + message.identifiedClientState !== undefined && (obj.identifiedClientState = message.identifiedClientState ? IdentifiedClientState.toJSON(message.identifiedClientState) : undefined); + message.proof !== undefined && (obj.proof = base64FromBytes(message.proof !== undefined ? message.proof : new Uint8Array())); + message.proofHeight !== undefined && (obj.proofHeight = message.proofHeight ? Height.toJSON(message.proofHeight) : undefined); + return obj; + }, fromPartial(object: Partial): QueryConnectionClientStateResponse { const message = createBaseQueryConnectionClientStateResponse(); message.identifiedClientState = object.identifiedClientState !== undefined && object.identifiedClientState !== null ? IdentifiedClientState.fromPartial(object.identifiedClientState) : undefined; @@ -1000,16 +1222,22 @@ export const QueryConnectionClientStateResponse = { return message; }, fromAmino(object: QueryConnectionClientStateResponseAmino): QueryConnectionClientStateResponse { - return { - identifiedClientState: object?.identified_client_state ? IdentifiedClientState.fromAmino(object.identified_client_state) : undefined, - proof: object.proof, - proofHeight: object?.proof_height ? Height.fromAmino(object.proof_height) : undefined - }; + const message = createBaseQueryConnectionClientStateResponse(); + if (object.identified_client_state !== undefined && object.identified_client_state !== null) { + message.identifiedClientState = IdentifiedClientState.fromAmino(object.identified_client_state); + } + if (object.proof !== undefined && object.proof !== null) { + message.proof = bytesFromBase64(object.proof); + } + if (object.proof_height !== undefined && object.proof_height !== null) { + message.proofHeight = Height.fromAmino(object.proof_height); + } + return message; }, toAmino(message: QueryConnectionClientStateResponse): QueryConnectionClientStateResponseAmino { const obj: any = {}; obj.identified_client_state = message.identifiedClientState ? IdentifiedClientState.toAmino(message.identifiedClientState) : undefined; - obj.proof = message.proof; + obj.proof = message.proof ? base64FromBytes(message.proof) : undefined; obj.proof_height = message.proofHeight ? Height.toAmino(message.proofHeight) : {}; return obj; }, @@ -1035,6 +1263,8 @@ export const QueryConnectionClientStateResponse = { }; } }; +GlobalDecoderRegistry.register(QueryConnectionClientStateResponse.typeUrl, QueryConnectionClientStateResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryConnectionClientStateResponse.aminoType, QueryConnectionClientStateResponse.typeUrl); function createBaseQueryConnectionConsensusStateRequest(): QueryConnectionConsensusStateRequest { return { connectionId: "", @@ -1044,6 +1274,16 @@ function createBaseQueryConnectionConsensusStateRequest(): QueryConnectionConsen } export const QueryConnectionConsensusStateRequest = { typeUrl: "/ibc.core.connection.v1.QueryConnectionConsensusStateRequest", + aminoType: "cosmos-sdk/QueryConnectionConsensusStateRequest", + is(o: any): o is QueryConnectionConsensusStateRequest { + return o && (o.$typeUrl === QueryConnectionConsensusStateRequest.typeUrl || typeof o.connectionId === "string" && typeof o.revisionNumber === "bigint" && typeof o.revisionHeight === "bigint"); + }, + isSDK(o: any): o is QueryConnectionConsensusStateRequestSDKType { + return o && (o.$typeUrl === QueryConnectionConsensusStateRequest.typeUrl || typeof o.connection_id === "string" && typeof o.revision_number === "bigint" && typeof o.revision_height === "bigint"); + }, + isAmino(o: any): o is QueryConnectionConsensusStateRequestAmino { + return o && (o.$typeUrl === QueryConnectionConsensusStateRequest.typeUrl || typeof o.connection_id === "string" && typeof o.revision_number === "bigint" && typeof o.revision_height === "bigint"); + }, encode(message: QueryConnectionConsensusStateRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.connectionId !== "") { writer.uint32(10).string(message.connectionId); @@ -1079,6 +1319,20 @@ export const QueryConnectionConsensusStateRequest = { } return message; }, + fromJSON(object: any): QueryConnectionConsensusStateRequest { + return { + connectionId: isSet(object.connectionId) ? String(object.connectionId) : "", + revisionNumber: isSet(object.revisionNumber) ? BigInt(object.revisionNumber.toString()) : BigInt(0), + revisionHeight: isSet(object.revisionHeight) ? BigInt(object.revisionHeight.toString()) : BigInt(0) + }; + }, + toJSON(message: QueryConnectionConsensusStateRequest): unknown { + const obj: any = {}; + message.connectionId !== undefined && (obj.connectionId = message.connectionId); + message.revisionNumber !== undefined && (obj.revisionNumber = (message.revisionNumber || BigInt(0)).toString()); + message.revisionHeight !== undefined && (obj.revisionHeight = (message.revisionHeight || BigInt(0)).toString()); + return obj; + }, fromPartial(object: Partial): QueryConnectionConsensusStateRequest { const message = createBaseQueryConnectionConsensusStateRequest(); message.connectionId = object.connectionId ?? ""; @@ -1087,11 +1341,17 @@ export const QueryConnectionConsensusStateRequest = { return message; }, fromAmino(object: QueryConnectionConsensusStateRequestAmino): QueryConnectionConsensusStateRequest { - return { - connectionId: object.connection_id, - revisionNumber: BigInt(object.revision_number), - revisionHeight: BigInt(object.revision_height) - }; + const message = createBaseQueryConnectionConsensusStateRequest(); + if (object.connection_id !== undefined && object.connection_id !== null) { + message.connectionId = object.connection_id; + } + if (object.revision_number !== undefined && object.revision_number !== null) { + message.revisionNumber = BigInt(object.revision_number); + } + if (object.revision_height !== undefined && object.revision_height !== null) { + message.revisionHeight = BigInt(object.revision_height); + } + return message; }, toAmino(message: QueryConnectionConsensusStateRequest): QueryConnectionConsensusStateRequestAmino { const obj: any = {}; @@ -1122,6 +1382,8 @@ export const QueryConnectionConsensusStateRequest = { }; } }; +GlobalDecoderRegistry.register(QueryConnectionConsensusStateRequest.typeUrl, QueryConnectionConsensusStateRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryConnectionConsensusStateRequest.aminoType, QueryConnectionConsensusStateRequest.typeUrl); function createBaseQueryConnectionConsensusStateResponse(): QueryConnectionConsensusStateResponse { return { consensusState: undefined, @@ -1132,6 +1394,16 @@ function createBaseQueryConnectionConsensusStateResponse(): QueryConnectionConse } export const QueryConnectionConsensusStateResponse = { typeUrl: "/ibc.core.connection.v1.QueryConnectionConsensusStateResponse", + aminoType: "cosmos-sdk/QueryConnectionConsensusStateResponse", + is(o: any): o is QueryConnectionConsensusStateResponse { + return o && (o.$typeUrl === QueryConnectionConsensusStateResponse.typeUrl || typeof o.clientId === "string" && (o.proof instanceof Uint8Array || typeof o.proof === "string") && Height.is(o.proofHeight)); + }, + isSDK(o: any): o is QueryConnectionConsensusStateResponseSDKType { + return o && (o.$typeUrl === QueryConnectionConsensusStateResponse.typeUrl || typeof o.client_id === "string" && (o.proof instanceof Uint8Array || typeof o.proof === "string") && Height.isSDK(o.proof_height)); + }, + isAmino(o: any): o is QueryConnectionConsensusStateResponseAmino { + return o && (o.$typeUrl === QueryConnectionConsensusStateResponse.typeUrl || typeof o.client_id === "string" && (o.proof instanceof Uint8Array || typeof o.proof === "string") && Height.isAmino(o.proof_height)); + }, encode(message: QueryConnectionConsensusStateResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.consensusState !== undefined) { Any.encode(message.consensusState, writer.uint32(10).fork()).ldelim(); @@ -1173,6 +1445,22 @@ export const QueryConnectionConsensusStateResponse = { } return message; }, + fromJSON(object: any): QueryConnectionConsensusStateResponse { + return { + consensusState: isSet(object.consensusState) ? Any.fromJSON(object.consensusState) : undefined, + clientId: isSet(object.clientId) ? String(object.clientId) : "", + proof: isSet(object.proof) ? bytesFromBase64(object.proof) : new Uint8Array(), + proofHeight: isSet(object.proofHeight) ? Height.fromJSON(object.proofHeight) : undefined + }; + }, + toJSON(message: QueryConnectionConsensusStateResponse): unknown { + const obj: any = {}; + message.consensusState !== undefined && (obj.consensusState = message.consensusState ? Any.toJSON(message.consensusState) : undefined); + message.clientId !== undefined && (obj.clientId = message.clientId); + message.proof !== undefined && (obj.proof = base64FromBytes(message.proof !== undefined ? message.proof : new Uint8Array())); + message.proofHeight !== undefined && (obj.proofHeight = message.proofHeight ? Height.toJSON(message.proofHeight) : undefined); + return obj; + }, fromPartial(object: Partial): QueryConnectionConsensusStateResponse { const message = createBaseQueryConnectionConsensusStateResponse(); message.consensusState = object.consensusState !== undefined && object.consensusState !== null ? Any.fromPartial(object.consensusState) : undefined; @@ -1182,18 +1470,26 @@ export const QueryConnectionConsensusStateResponse = { return message; }, fromAmino(object: QueryConnectionConsensusStateResponseAmino): QueryConnectionConsensusStateResponse { - return { - consensusState: object?.consensus_state ? Any.fromAmino(object.consensus_state) : undefined, - clientId: object.client_id, - proof: object.proof, - proofHeight: object?.proof_height ? Height.fromAmino(object.proof_height) : undefined - }; + const message = createBaseQueryConnectionConsensusStateResponse(); + if (object.consensus_state !== undefined && object.consensus_state !== null) { + message.consensusState = Any.fromAmino(object.consensus_state); + } + if (object.client_id !== undefined && object.client_id !== null) { + message.clientId = object.client_id; + } + if (object.proof !== undefined && object.proof !== null) { + message.proof = bytesFromBase64(object.proof); + } + if (object.proof_height !== undefined && object.proof_height !== null) { + message.proofHeight = Height.fromAmino(object.proof_height); + } + return message; }, toAmino(message: QueryConnectionConsensusStateResponse): QueryConnectionConsensusStateResponseAmino { const obj: any = {}; obj.consensus_state = message.consensusState ? Any.toAmino(message.consensusState) : undefined; obj.client_id = message.clientId; - obj.proof = message.proof; + obj.proof = message.proof ? base64FromBytes(message.proof) : undefined; obj.proof_height = message.proofHeight ? Height.toAmino(message.proofHeight) : {}; return obj; }, @@ -1219,11 +1515,23 @@ export const QueryConnectionConsensusStateResponse = { }; } }; +GlobalDecoderRegistry.register(QueryConnectionConsensusStateResponse.typeUrl, QueryConnectionConsensusStateResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryConnectionConsensusStateResponse.aminoType, QueryConnectionConsensusStateResponse.typeUrl); function createBaseQueryConnectionParamsRequest(): QueryConnectionParamsRequest { return {}; } export const QueryConnectionParamsRequest = { typeUrl: "/ibc.core.connection.v1.QueryConnectionParamsRequest", + aminoType: "cosmos-sdk/QueryConnectionParamsRequest", + is(o: any): o is QueryConnectionParamsRequest { + return o && o.$typeUrl === QueryConnectionParamsRequest.typeUrl; + }, + isSDK(o: any): o is QueryConnectionParamsRequestSDKType { + return o && o.$typeUrl === QueryConnectionParamsRequest.typeUrl; + }, + isAmino(o: any): o is QueryConnectionParamsRequestAmino { + return o && o.$typeUrl === QueryConnectionParamsRequest.typeUrl; + }, encode(_: QueryConnectionParamsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, @@ -1241,12 +1549,20 @@ export const QueryConnectionParamsRequest = { } return message; }, + fromJSON(_: any): QueryConnectionParamsRequest { + return {}; + }, + toJSON(_: QueryConnectionParamsRequest): unknown { + const obj: any = {}; + return obj; + }, fromPartial(_: Partial): QueryConnectionParamsRequest { const message = createBaseQueryConnectionParamsRequest(); return message; }, fromAmino(_: QueryConnectionParamsRequestAmino): QueryConnectionParamsRequest { - return {}; + const message = createBaseQueryConnectionParamsRequest(); + return message; }, toAmino(_: QueryConnectionParamsRequest): QueryConnectionParamsRequestAmino { const obj: any = {}; @@ -1274,13 +1590,25 @@ export const QueryConnectionParamsRequest = { }; } }; +GlobalDecoderRegistry.register(QueryConnectionParamsRequest.typeUrl, QueryConnectionParamsRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryConnectionParamsRequest.aminoType, QueryConnectionParamsRequest.typeUrl); function createBaseQueryConnectionParamsResponse(): QueryConnectionParamsResponse { return { - params: Params.fromPartial({}) + params: undefined }; } export const QueryConnectionParamsResponse = { typeUrl: "/ibc.core.connection.v1.QueryConnectionParamsResponse", + aminoType: "cosmos-sdk/QueryConnectionParamsResponse", + is(o: any): o is QueryConnectionParamsResponse { + return o && o.$typeUrl === QueryConnectionParamsResponse.typeUrl; + }, + isSDK(o: any): o is QueryConnectionParamsResponseSDKType { + return o && o.$typeUrl === QueryConnectionParamsResponse.typeUrl; + }, + isAmino(o: any): o is QueryConnectionParamsResponseAmino { + return o && o.$typeUrl === QueryConnectionParamsResponse.typeUrl; + }, encode(message: QueryConnectionParamsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.params !== undefined) { Params.encode(message.params, writer.uint32(10).fork()).ldelim(); @@ -1304,15 +1632,27 @@ export const QueryConnectionParamsResponse = { } return message; }, + fromJSON(object: any): QueryConnectionParamsResponse { + return { + params: isSet(object.params) ? Params.fromJSON(object.params) : undefined + }; + }, + toJSON(message: QueryConnectionParamsResponse): unknown { + const obj: any = {}; + message.params !== undefined && (obj.params = message.params ? Params.toJSON(message.params) : undefined); + return obj; + }, fromPartial(object: Partial): QueryConnectionParamsResponse { const message = createBaseQueryConnectionParamsResponse(); message.params = object.params !== undefined && object.params !== null ? Params.fromPartial(object.params) : undefined; return message; }, fromAmino(object: QueryConnectionParamsResponseAmino): QueryConnectionParamsResponse { - return { - params: object?.params ? Params.fromAmino(object.params) : undefined - }; + const message = createBaseQueryConnectionParamsResponse(); + if (object.params !== undefined && object.params !== null) { + message.params = Params.fromAmino(object.params); + } + return message; }, toAmino(message: QueryConnectionParamsResponse): QueryConnectionParamsResponseAmino { const obj: any = {}; @@ -1340,4 +1680,6 @@ export const QueryConnectionParamsResponse = { value: QueryConnectionParamsResponse.encode(message).finish() }; } -}; \ No newline at end of file +}; +GlobalDecoderRegistry.register(QueryConnectionParamsResponse.typeUrl, QueryConnectionParamsResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryConnectionParamsResponse.aminoType, QueryConnectionParamsResponse.typeUrl); \ No newline at end of file diff --git a/packages/osmojs/src/codegen/ibc/core/connection/v1/tx.amino.ts b/packages/osmojs/src/codegen/ibc/core/connection/v1/tx.amino.ts index d30beafa3..ecfa448ce 100644 --- a/packages/osmojs/src/codegen/ibc/core/connection/v1/tx.amino.ts +++ b/packages/osmojs/src/codegen/ibc/core/connection/v1/tx.amino.ts @@ -1,5 +1,5 @@ //@ts-nocheck -import { MsgConnectionOpenInit, MsgConnectionOpenTry, MsgConnectionOpenAck, MsgConnectionOpenConfirm } from "./tx"; +import { MsgConnectionOpenInit, MsgConnectionOpenTry, MsgConnectionOpenAck, MsgConnectionOpenConfirm, MsgUpdateParams } from "./tx"; export const AminoConverter = { "/ibc.core.connection.v1.MsgConnectionOpenInit": { aminoType: "cosmos-sdk/MsgConnectionOpenInit", @@ -20,5 +20,10 @@ export const AminoConverter = { aminoType: "cosmos-sdk/MsgConnectionOpenConfirm", toAmino: MsgConnectionOpenConfirm.toAmino, fromAmino: MsgConnectionOpenConfirm.fromAmino + }, + "/ibc.core.connection.v1.MsgUpdateParams": { + aminoType: "cosmos-sdk/MsgUpdateParams", + toAmino: MsgUpdateParams.toAmino, + fromAmino: MsgUpdateParams.fromAmino } }; \ No newline at end of file diff --git a/packages/osmojs/src/codegen/ibc/core/connection/v1/tx.registry.ts b/packages/osmojs/src/codegen/ibc/core/connection/v1/tx.registry.ts index ea9df730a..5a4f03797 100644 --- a/packages/osmojs/src/codegen/ibc/core/connection/v1/tx.registry.ts +++ b/packages/osmojs/src/codegen/ibc/core/connection/v1/tx.registry.ts @@ -1,7 +1,7 @@ //@ts-nocheck import { GeneratedType, Registry } from "@cosmjs/proto-signing"; -import { MsgConnectionOpenInit, MsgConnectionOpenTry, MsgConnectionOpenAck, MsgConnectionOpenConfirm } from "./tx"; -export const registry: ReadonlyArray<[string, GeneratedType]> = [["/ibc.core.connection.v1.MsgConnectionOpenInit", MsgConnectionOpenInit], ["/ibc.core.connection.v1.MsgConnectionOpenTry", MsgConnectionOpenTry], ["/ibc.core.connection.v1.MsgConnectionOpenAck", MsgConnectionOpenAck], ["/ibc.core.connection.v1.MsgConnectionOpenConfirm", MsgConnectionOpenConfirm]]; +import { MsgConnectionOpenInit, MsgConnectionOpenTry, MsgConnectionOpenAck, MsgConnectionOpenConfirm, MsgUpdateParams } from "./tx"; +export const registry: ReadonlyArray<[string, GeneratedType]> = [["/ibc.core.connection.v1.MsgConnectionOpenInit", MsgConnectionOpenInit], ["/ibc.core.connection.v1.MsgConnectionOpenTry", MsgConnectionOpenTry], ["/ibc.core.connection.v1.MsgConnectionOpenAck", MsgConnectionOpenAck], ["/ibc.core.connection.v1.MsgConnectionOpenConfirm", MsgConnectionOpenConfirm], ["/ibc.core.connection.v1.MsgUpdateParams", MsgUpdateParams]]; export const load = (protoRegistry: Registry) => { registry.forEach(([typeUrl, mod]) => { protoRegistry.register(typeUrl, mod); @@ -32,6 +32,12 @@ export const MessageComposer = { typeUrl: "/ibc.core.connection.v1.MsgConnectionOpenConfirm", value: MsgConnectionOpenConfirm.encode(value).finish() }; + }, + updateConnectionParams(value: MsgUpdateParams) { + return { + typeUrl: "/ibc.core.connection.v1.MsgUpdateParams", + value: MsgUpdateParams.encode(value).finish() + }; } }, withTypeUrl: { @@ -58,6 +64,76 @@ export const MessageComposer = { typeUrl: "/ibc.core.connection.v1.MsgConnectionOpenConfirm", value }; + }, + updateConnectionParams(value: MsgUpdateParams) { + return { + typeUrl: "/ibc.core.connection.v1.MsgUpdateParams", + value + }; + } + }, + toJSON: { + connectionOpenInit(value: MsgConnectionOpenInit) { + return { + typeUrl: "/ibc.core.connection.v1.MsgConnectionOpenInit", + value: MsgConnectionOpenInit.toJSON(value) + }; + }, + connectionOpenTry(value: MsgConnectionOpenTry) { + return { + typeUrl: "/ibc.core.connection.v1.MsgConnectionOpenTry", + value: MsgConnectionOpenTry.toJSON(value) + }; + }, + connectionOpenAck(value: MsgConnectionOpenAck) { + return { + typeUrl: "/ibc.core.connection.v1.MsgConnectionOpenAck", + value: MsgConnectionOpenAck.toJSON(value) + }; + }, + connectionOpenConfirm(value: MsgConnectionOpenConfirm) { + return { + typeUrl: "/ibc.core.connection.v1.MsgConnectionOpenConfirm", + value: MsgConnectionOpenConfirm.toJSON(value) + }; + }, + updateConnectionParams(value: MsgUpdateParams) { + return { + typeUrl: "/ibc.core.connection.v1.MsgUpdateParams", + value: MsgUpdateParams.toJSON(value) + }; + } + }, + fromJSON: { + connectionOpenInit(value: any) { + return { + typeUrl: "/ibc.core.connection.v1.MsgConnectionOpenInit", + value: MsgConnectionOpenInit.fromJSON(value) + }; + }, + connectionOpenTry(value: any) { + return { + typeUrl: "/ibc.core.connection.v1.MsgConnectionOpenTry", + value: MsgConnectionOpenTry.fromJSON(value) + }; + }, + connectionOpenAck(value: any) { + return { + typeUrl: "/ibc.core.connection.v1.MsgConnectionOpenAck", + value: MsgConnectionOpenAck.fromJSON(value) + }; + }, + connectionOpenConfirm(value: any) { + return { + typeUrl: "/ibc.core.connection.v1.MsgConnectionOpenConfirm", + value: MsgConnectionOpenConfirm.fromJSON(value) + }; + }, + updateConnectionParams(value: any) { + return { + typeUrl: "/ibc.core.connection.v1.MsgUpdateParams", + value: MsgUpdateParams.fromJSON(value) + }; } }, fromPartial: { @@ -84,6 +160,12 @@ export const MessageComposer = { typeUrl: "/ibc.core.connection.v1.MsgConnectionOpenConfirm", value: MsgConnectionOpenConfirm.fromPartial(value) }; + }, + updateConnectionParams(value: MsgUpdateParams) { + return { + typeUrl: "/ibc.core.connection.v1.MsgUpdateParams", + value: MsgUpdateParams.fromPartial(value) + }; } } }; \ No newline at end of file diff --git a/packages/osmojs/src/codegen/ibc/core/connection/v1/tx.rpc.msg.ts b/packages/osmojs/src/codegen/ibc/core/connection/v1/tx.rpc.msg.ts index d5a212793..bc23da0b3 100644 --- a/packages/osmojs/src/codegen/ibc/core/connection/v1/tx.rpc.msg.ts +++ b/packages/osmojs/src/codegen/ibc/core/connection/v1/tx.rpc.msg.ts @@ -1,6 +1,6 @@ import { Rpc } from "../../../../helpers"; import { BinaryReader } from "../../../../binary"; -import { MsgConnectionOpenInit, MsgConnectionOpenInitResponse, MsgConnectionOpenTry, MsgConnectionOpenTryResponse, MsgConnectionOpenAck, MsgConnectionOpenAckResponse, MsgConnectionOpenConfirm, MsgConnectionOpenConfirmResponse } from "./tx"; +import { MsgConnectionOpenInit, MsgConnectionOpenInitResponse, MsgConnectionOpenTry, MsgConnectionOpenTryResponse, MsgConnectionOpenAck, MsgConnectionOpenAckResponse, MsgConnectionOpenConfirm, MsgConnectionOpenConfirmResponse, MsgUpdateParams, MsgUpdateParamsResponse } from "./tx"; /** Msg defines the ibc/connection Msg service. */ export interface Msg { /** ConnectionOpenInit defines a rpc handler method for MsgConnectionOpenInit. */ @@ -14,6 +14,11 @@ export interface Msg { * MsgConnectionOpenConfirm. */ connectionOpenConfirm(request: MsgConnectionOpenConfirm): Promise; + /** + * UpdateConnectionParams defines a rpc handler method for + * MsgUpdateParams. + */ + updateConnectionParams(request: MsgUpdateParams): Promise; } export class MsgClientImpl implements Msg { private readonly rpc: Rpc; @@ -23,6 +28,7 @@ export class MsgClientImpl implements Msg { this.connectionOpenTry = this.connectionOpenTry.bind(this); this.connectionOpenAck = this.connectionOpenAck.bind(this); this.connectionOpenConfirm = this.connectionOpenConfirm.bind(this); + this.updateConnectionParams = this.updateConnectionParams.bind(this); } connectionOpenInit(request: MsgConnectionOpenInit): Promise { const data = MsgConnectionOpenInit.encode(request).finish(); @@ -44,4 +50,12 @@ export class MsgClientImpl implements Msg { const promise = this.rpc.request("ibc.core.connection.v1.Msg", "ConnectionOpenConfirm", data); return promise.then(data => MsgConnectionOpenConfirmResponse.decode(new BinaryReader(data))); } -} \ No newline at end of file + updateConnectionParams(request: MsgUpdateParams): Promise { + const data = MsgUpdateParams.encode(request).finish(); + const promise = this.rpc.request("ibc.core.connection.v1.Msg", "UpdateConnectionParams", data); + return promise.then(data => MsgUpdateParamsResponse.decode(new BinaryReader(data))); + } +} +export const createClientImpl = (rpc: Rpc) => { + return new MsgClientImpl(rpc); +}; \ No newline at end of file diff --git a/packages/osmojs/src/codegen/ibc/core/connection/v1/tx.ts b/packages/osmojs/src/codegen/ibc/core/connection/v1/tx.ts index 684893d72..4c170d008 100644 --- a/packages/osmojs/src/codegen/ibc/core/connection/v1/tx.ts +++ b/packages/osmojs/src/codegen/ibc/core/connection/v1/tx.ts @@ -1,7 +1,9 @@ import { Counterparty, CounterpartyAmino, CounterpartySDKType, Version, VersionAmino, VersionSDKType } from "./connection"; import { Any, AnyAmino, AnySDKType } from "../../../../google/protobuf/any"; -import { Height, HeightAmino, HeightSDKType } from "../../client/v1/client"; +import { Height, HeightAmino, HeightSDKType, Params, ParamsAmino, ParamsSDKType } from "../../client/v1/client"; import { BinaryReader, BinaryWriter } from "../../../../binary"; +import { isSet, bytesFromBase64, base64FromBytes } from "../../../../helpers"; +import { GlobalDecoderRegistry } from "../../../../registry"; /** * MsgConnectionOpenInit defines the msg sent by an account on Chain A to * initialize a connection with Chain B. @@ -9,7 +11,7 @@ import { BinaryReader, BinaryWriter } from "../../../../binary"; export interface MsgConnectionOpenInit { clientId: string; counterparty: Counterparty; - version: Version; + version?: Version; delayPeriod: bigint; signer: string; } @@ -22,11 +24,11 @@ export interface MsgConnectionOpenInitProtoMsg { * initialize a connection with Chain B. */ export interface MsgConnectionOpenInitAmino { - client_id: string; + client_id?: string; counterparty?: CounterpartyAmino; version?: VersionAmino; - delay_period: string; - signer: string; + delay_period?: string; + signer?: string; } export interface MsgConnectionOpenInitAminoMsg { type: "cosmos-sdk/MsgConnectionOpenInit"; @@ -39,7 +41,7 @@ export interface MsgConnectionOpenInitAminoMsg { export interface MsgConnectionOpenInitSDKType { client_id: string; counterparty: CounterpartySDKType; - version: VersionSDKType; + version?: VersionSDKType; delay_period: bigint; signer: string; } @@ -75,13 +77,13 @@ export interface MsgConnectionOpenTry { /** Deprecated: this field is unused. Crossing hellos are no longer supported in core IBC. */ /** @deprecated */ previousConnectionId: string; - clientState: Any; + clientState?: Any; counterparty: Counterparty; delayPeriod: bigint; counterpartyVersions: Version[]; proofHeight: Height; /** - * proof of the initialization the connection on Chain A: `UNITIALIZED -> + * proof of the initialization the connection on Chain A: `UNINITIALIZED -> * INIT` */ proofInit: Uint8Array; @@ -103,28 +105,28 @@ export interface MsgConnectionOpenTryProtoMsg { * connection on Chain B. */ export interface MsgConnectionOpenTryAmino { - client_id: string; + client_id?: string; /** Deprecated: this field is unused. Crossing hellos are no longer supported in core IBC. */ /** @deprecated */ - previous_connection_id: string; + previous_connection_id?: string; client_state?: AnyAmino; counterparty?: CounterpartyAmino; - delay_period: string; - counterparty_versions: VersionAmino[]; + delay_period?: string; + counterparty_versions?: VersionAmino[]; proof_height?: HeightAmino; /** - * proof of the initialization the connection on Chain A: `UNITIALIZED -> + * proof of the initialization the connection on Chain A: `UNINITIALIZED -> * INIT` */ - proof_init: Uint8Array; + proof_init?: string; /** proof of client state included in message */ - proof_client: Uint8Array; + proof_client?: string; /** proof of client consensus state */ - proof_consensus: Uint8Array; + proof_consensus?: string; consensus_height?: HeightAmino; - signer: string; + signer?: string; /** optional proof data for host state machines that are unable to introspect their own consensus state */ - host_consensus_state_proof: Uint8Array; + host_consensus_state_proof?: string; } export interface MsgConnectionOpenTryAminoMsg { type: "cosmos-sdk/MsgConnectionOpenTry"; @@ -138,7 +140,7 @@ export interface MsgConnectionOpenTrySDKType { client_id: string; /** @deprecated */ previous_connection_id: string; - client_state: AnySDKType; + client_state?: AnySDKType; counterparty: CounterpartySDKType; delay_period: bigint; counterparty_versions: VersionSDKType[]; @@ -171,11 +173,11 @@ export interface MsgConnectionOpenTryResponseSDKType {} export interface MsgConnectionOpenAck { connectionId: string; counterpartyConnectionId: string; - version: Version; - clientState: Any; + version?: Version; + clientState?: Any; proofHeight: Height; /** - * proof of the initialization the connection on Chain B: `UNITIALIZED -> + * proof of the initialization the connection on Chain B: `UNINITIALIZED -> * TRYOPEN` */ proofTry: Uint8Array; @@ -197,24 +199,24 @@ export interface MsgConnectionOpenAckProtoMsg { * acknowledge the change of connection state to TRYOPEN on Chain B. */ export interface MsgConnectionOpenAckAmino { - connection_id: string; - counterparty_connection_id: string; + connection_id?: string; + counterparty_connection_id?: string; version?: VersionAmino; client_state?: AnyAmino; proof_height?: HeightAmino; /** - * proof of the initialization the connection on Chain B: `UNITIALIZED -> + * proof of the initialization the connection on Chain B: `UNINITIALIZED -> * TRYOPEN` */ - proof_try: Uint8Array; + proof_try?: string; /** proof of client state included in message */ - proof_client: Uint8Array; + proof_client?: string; /** proof of client consensus state */ - proof_consensus: Uint8Array; + proof_consensus?: string; consensus_height?: HeightAmino; - signer: string; + signer?: string; /** optional proof data for host state machines that are unable to introspect their own consensus state */ - host_consensus_state_proof: Uint8Array; + host_consensus_state_proof?: string; } export interface MsgConnectionOpenAckAminoMsg { type: "cosmos-sdk/MsgConnectionOpenAck"; @@ -227,8 +229,8 @@ export interface MsgConnectionOpenAckAminoMsg { export interface MsgConnectionOpenAckSDKType { connection_id: string; counterparty_connection_id: string; - version: VersionSDKType; - client_state: AnySDKType; + version?: VersionSDKType; + client_state?: AnySDKType; proof_height: HeightSDKType; proof_try: Uint8Array; proof_client: Uint8Array; @@ -271,11 +273,11 @@ export interface MsgConnectionOpenConfirmProtoMsg { * acknowledge the change of connection state to OPEN on Chain A. */ export interface MsgConnectionOpenConfirmAmino { - connection_id: string; + connection_id?: string; /** proof for the change of the connection state on Chain A: `INIT -> OPEN` */ - proof_ack: Uint8Array; + proof_ack?: string; proof_height?: HeightAmino; - signer: string; + signer?: string; } export interface MsgConnectionOpenConfirmAminoMsg { type: "cosmos-sdk/MsgConnectionOpenConfirm"; @@ -314,17 +316,76 @@ export interface MsgConnectionOpenConfirmResponseAminoMsg { * response type. */ export interface MsgConnectionOpenConfirmResponseSDKType {} +/** MsgUpdateParams defines the sdk.Msg type to update the connection parameters. */ +export interface MsgUpdateParams { + /** signer address */ + signer: string; + /** + * params defines the connection parameters to update. + * + * NOTE: All parameters must be supplied. + */ + params: Params; +} +export interface MsgUpdateParamsProtoMsg { + typeUrl: "/ibc.core.connection.v1.MsgUpdateParams"; + value: Uint8Array; +} +/** MsgUpdateParams defines the sdk.Msg type to update the connection parameters. */ +export interface MsgUpdateParamsAmino { + /** signer address */ + signer?: string; + /** + * params defines the connection parameters to update. + * + * NOTE: All parameters must be supplied. + */ + params?: ParamsAmino; +} +export interface MsgUpdateParamsAminoMsg { + type: "cosmos-sdk/MsgUpdateParams"; + value: MsgUpdateParamsAmino; +} +/** MsgUpdateParams defines the sdk.Msg type to update the connection parameters. */ +export interface MsgUpdateParamsSDKType { + signer: string; + params: ParamsSDKType; +} +/** MsgUpdateParamsResponse defines the MsgUpdateParams response type. */ +export interface MsgUpdateParamsResponse {} +export interface MsgUpdateParamsResponseProtoMsg { + typeUrl: "/ibc.core.connection.v1.MsgUpdateParamsResponse"; + value: Uint8Array; +} +/** MsgUpdateParamsResponse defines the MsgUpdateParams response type. */ +export interface MsgUpdateParamsResponseAmino {} +export interface MsgUpdateParamsResponseAminoMsg { + type: "cosmos-sdk/MsgUpdateParamsResponse"; + value: MsgUpdateParamsResponseAmino; +} +/** MsgUpdateParamsResponse defines the MsgUpdateParams response type. */ +export interface MsgUpdateParamsResponseSDKType {} function createBaseMsgConnectionOpenInit(): MsgConnectionOpenInit { return { clientId: "", counterparty: Counterparty.fromPartial({}), - version: Version.fromPartial({}), + version: undefined, delayPeriod: BigInt(0), signer: "" }; } export const MsgConnectionOpenInit = { typeUrl: "/ibc.core.connection.v1.MsgConnectionOpenInit", + aminoType: "cosmos-sdk/MsgConnectionOpenInit", + is(o: any): o is MsgConnectionOpenInit { + return o && (o.$typeUrl === MsgConnectionOpenInit.typeUrl || typeof o.clientId === "string" && Counterparty.is(o.counterparty) && typeof o.delayPeriod === "bigint" && typeof o.signer === "string"); + }, + isSDK(o: any): o is MsgConnectionOpenInitSDKType { + return o && (o.$typeUrl === MsgConnectionOpenInit.typeUrl || typeof o.client_id === "string" && Counterparty.isSDK(o.counterparty) && typeof o.delay_period === "bigint" && typeof o.signer === "string"); + }, + isAmino(o: any): o is MsgConnectionOpenInitAmino { + return o && (o.$typeUrl === MsgConnectionOpenInit.typeUrl || typeof o.client_id === "string" && Counterparty.isAmino(o.counterparty) && typeof o.delay_period === "bigint" && typeof o.signer === "string"); + }, encode(message: MsgConnectionOpenInit, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.clientId !== "") { writer.uint32(10).string(message.clientId); @@ -372,6 +433,24 @@ export const MsgConnectionOpenInit = { } return message; }, + fromJSON(object: any): MsgConnectionOpenInit { + return { + clientId: isSet(object.clientId) ? String(object.clientId) : "", + counterparty: isSet(object.counterparty) ? Counterparty.fromJSON(object.counterparty) : undefined, + version: isSet(object.version) ? Version.fromJSON(object.version) : undefined, + delayPeriod: isSet(object.delayPeriod) ? BigInt(object.delayPeriod.toString()) : BigInt(0), + signer: isSet(object.signer) ? String(object.signer) : "" + }; + }, + toJSON(message: MsgConnectionOpenInit): unknown { + const obj: any = {}; + message.clientId !== undefined && (obj.clientId = message.clientId); + message.counterparty !== undefined && (obj.counterparty = message.counterparty ? Counterparty.toJSON(message.counterparty) : undefined); + message.version !== undefined && (obj.version = message.version ? Version.toJSON(message.version) : undefined); + message.delayPeriod !== undefined && (obj.delayPeriod = (message.delayPeriod || BigInt(0)).toString()); + message.signer !== undefined && (obj.signer = message.signer); + return obj; + }, fromPartial(object: Partial): MsgConnectionOpenInit { const message = createBaseMsgConnectionOpenInit(); message.clientId = object.clientId ?? ""; @@ -382,13 +461,23 @@ export const MsgConnectionOpenInit = { return message; }, fromAmino(object: MsgConnectionOpenInitAmino): MsgConnectionOpenInit { - return { - clientId: object.client_id, - counterparty: object?.counterparty ? Counterparty.fromAmino(object.counterparty) : undefined, - version: object?.version ? Version.fromAmino(object.version) : undefined, - delayPeriod: BigInt(object.delay_period), - signer: object.signer - }; + const message = createBaseMsgConnectionOpenInit(); + if (object.client_id !== undefined && object.client_id !== null) { + message.clientId = object.client_id; + } + if (object.counterparty !== undefined && object.counterparty !== null) { + message.counterparty = Counterparty.fromAmino(object.counterparty); + } + if (object.version !== undefined && object.version !== null) { + message.version = Version.fromAmino(object.version); + } + if (object.delay_period !== undefined && object.delay_period !== null) { + message.delayPeriod = BigInt(object.delay_period); + } + if (object.signer !== undefined && object.signer !== null) { + message.signer = object.signer; + } + return message; }, toAmino(message: MsgConnectionOpenInit): MsgConnectionOpenInitAmino { const obj: any = {}; @@ -421,11 +510,23 @@ export const MsgConnectionOpenInit = { }; } }; +GlobalDecoderRegistry.register(MsgConnectionOpenInit.typeUrl, MsgConnectionOpenInit); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgConnectionOpenInit.aminoType, MsgConnectionOpenInit.typeUrl); function createBaseMsgConnectionOpenInitResponse(): MsgConnectionOpenInitResponse { return {}; } export const MsgConnectionOpenInitResponse = { typeUrl: "/ibc.core.connection.v1.MsgConnectionOpenInitResponse", + aminoType: "cosmos-sdk/MsgConnectionOpenInitResponse", + is(o: any): o is MsgConnectionOpenInitResponse { + return o && o.$typeUrl === MsgConnectionOpenInitResponse.typeUrl; + }, + isSDK(o: any): o is MsgConnectionOpenInitResponseSDKType { + return o && o.$typeUrl === MsgConnectionOpenInitResponse.typeUrl; + }, + isAmino(o: any): o is MsgConnectionOpenInitResponseAmino { + return o && o.$typeUrl === MsgConnectionOpenInitResponse.typeUrl; + }, encode(_: MsgConnectionOpenInitResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, @@ -443,12 +544,20 @@ export const MsgConnectionOpenInitResponse = { } return message; }, + fromJSON(_: any): MsgConnectionOpenInitResponse { + return {}; + }, + toJSON(_: MsgConnectionOpenInitResponse): unknown { + const obj: any = {}; + return obj; + }, fromPartial(_: Partial): MsgConnectionOpenInitResponse { const message = createBaseMsgConnectionOpenInitResponse(); return message; }, fromAmino(_: MsgConnectionOpenInitResponseAmino): MsgConnectionOpenInitResponse { - return {}; + const message = createBaseMsgConnectionOpenInitResponse(); + return message; }, toAmino(_: MsgConnectionOpenInitResponse): MsgConnectionOpenInitResponseAmino { const obj: any = {}; @@ -476,6 +585,8 @@ export const MsgConnectionOpenInitResponse = { }; } }; +GlobalDecoderRegistry.register(MsgConnectionOpenInitResponse.typeUrl, MsgConnectionOpenInitResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgConnectionOpenInitResponse.aminoType, MsgConnectionOpenInitResponse.typeUrl); function createBaseMsgConnectionOpenTry(): MsgConnectionOpenTry { return { clientId: "", @@ -495,6 +606,16 @@ function createBaseMsgConnectionOpenTry(): MsgConnectionOpenTry { } export const MsgConnectionOpenTry = { typeUrl: "/ibc.core.connection.v1.MsgConnectionOpenTry", + aminoType: "cosmos-sdk/MsgConnectionOpenTry", + is(o: any): o is MsgConnectionOpenTry { + return o && (o.$typeUrl === MsgConnectionOpenTry.typeUrl || typeof o.clientId === "string" && typeof o.previousConnectionId === "string" && Counterparty.is(o.counterparty) && typeof o.delayPeriod === "bigint" && Array.isArray(o.counterpartyVersions) && (!o.counterpartyVersions.length || Version.is(o.counterpartyVersions[0])) && Height.is(o.proofHeight) && (o.proofInit instanceof Uint8Array || typeof o.proofInit === "string") && (o.proofClient instanceof Uint8Array || typeof o.proofClient === "string") && (o.proofConsensus instanceof Uint8Array || typeof o.proofConsensus === "string") && Height.is(o.consensusHeight) && typeof o.signer === "string" && (o.hostConsensusStateProof instanceof Uint8Array || typeof o.hostConsensusStateProof === "string")); + }, + isSDK(o: any): o is MsgConnectionOpenTrySDKType { + return o && (o.$typeUrl === MsgConnectionOpenTry.typeUrl || typeof o.client_id === "string" && typeof o.previous_connection_id === "string" && Counterparty.isSDK(o.counterparty) && typeof o.delay_period === "bigint" && Array.isArray(o.counterparty_versions) && (!o.counterparty_versions.length || Version.isSDK(o.counterparty_versions[0])) && Height.isSDK(o.proof_height) && (o.proof_init instanceof Uint8Array || typeof o.proof_init === "string") && (o.proof_client instanceof Uint8Array || typeof o.proof_client === "string") && (o.proof_consensus instanceof Uint8Array || typeof o.proof_consensus === "string") && Height.isSDK(o.consensus_height) && typeof o.signer === "string" && (o.host_consensus_state_proof instanceof Uint8Array || typeof o.host_consensus_state_proof === "string")); + }, + isAmino(o: any): o is MsgConnectionOpenTryAmino { + return o && (o.$typeUrl === MsgConnectionOpenTry.typeUrl || typeof o.client_id === "string" && typeof o.previous_connection_id === "string" && Counterparty.isAmino(o.counterparty) && typeof o.delay_period === "bigint" && Array.isArray(o.counterparty_versions) && (!o.counterparty_versions.length || Version.isAmino(o.counterparty_versions[0])) && Height.isAmino(o.proof_height) && (o.proof_init instanceof Uint8Array || typeof o.proof_init === "string") && (o.proof_client instanceof Uint8Array || typeof o.proof_client === "string") && (o.proof_consensus instanceof Uint8Array || typeof o.proof_consensus === "string") && Height.isAmino(o.consensus_height) && typeof o.signer === "string" && (o.host_consensus_state_proof instanceof Uint8Array || typeof o.host_consensus_state_proof === "string")); + }, encode(message: MsgConnectionOpenTry, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.clientId !== "") { writer.uint32(10).string(message.clientId); @@ -590,6 +711,44 @@ export const MsgConnectionOpenTry = { } return message; }, + fromJSON(object: any): MsgConnectionOpenTry { + return { + clientId: isSet(object.clientId) ? String(object.clientId) : "", + previousConnectionId: isSet(object.previousConnectionId) ? String(object.previousConnectionId) : "", + clientState: isSet(object.clientState) ? Any.fromJSON(object.clientState) : undefined, + counterparty: isSet(object.counterparty) ? Counterparty.fromJSON(object.counterparty) : undefined, + delayPeriod: isSet(object.delayPeriod) ? BigInt(object.delayPeriod.toString()) : BigInt(0), + counterpartyVersions: Array.isArray(object?.counterpartyVersions) ? object.counterpartyVersions.map((e: any) => Version.fromJSON(e)) : [], + proofHeight: isSet(object.proofHeight) ? Height.fromJSON(object.proofHeight) : undefined, + proofInit: isSet(object.proofInit) ? bytesFromBase64(object.proofInit) : new Uint8Array(), + proofClient: isSet(object.proofClient) ? bytesFromBase64(object.proofClient) : new Uint8Array(), + proofConsensus: isSet(object.proofConsensus) ? bytesFromBase64(object.proofConsensus) : new Uint8Array(), + consensusHeight: isSet(object.consensusHeight) ? Height.fromJSON(object.consensusHeight) : undefined, + signer: isSet(object.signer) ? String(object.signer) : "", + hostConsensusStateProof: isSet(object.hostConsensusStateProof) ? bytesFromBase64(object.hostConsensusStateProof) : new Uint8Array() + }; + }, + toJSON(message: MsgConnectionOpenTry): unknown { + const obj: any = {}; + message.clientId !== undefined && (obj.clientId = message.clientId); + message.previousConnectionId !== undefined && (obj.previousConnectionId = message.previousConnectionId); + message.clientState !== undefined && (obj.clientState = message.clientState ? Any.toJSON(message.clientState) : undefined); + message.counterparty !== undefined && (obj.counterparty = message.counterparty ? Counterparty.toJSON(message.counterparty) : undefined); + message.delayPeriod !== undefined && (obj.delayPeriod = (message.delayPeriod || BigInt(0)).toString()); + if (message.counterpartyVersions) { + obj.counterpartyVersions = message.counterpartyVersions.map(e => e ? Version.toJSON(e) : undefined); + } else { + obj.counterpartyVersions = []; + } + message.proofHeight !== undefined && (obj.proofHeight = message.proofHeight ? Height.toJSON(message.proofHeight) : undefined); + message.proofInit !== undefined && (obj.proofInit = base64FromBytes(message.proofInit !== undefined ? message.proofInit : new Uint8Array())); + message.proofClient !== undefined && (obj.proofClient = base64FromBytes(message.proofClient !== undefined ? message.proofClient : new Uint8Array())); + message.proofConsensus !== undefined && (obj.proofConsensus = base64FromBytes(message.proofConsensus !== undefined ? message.proofConsensus : new Uint8Array())); + message.consensusHeight !== undefined && (obj.consensusHeight = message.consensusHeight ? Height.toJSON(message.consensusHeight) : undefined); + message.signer !== undefined && (obj.signer = message.signer); + message.hostConsensusStateProof !== undefined && (obj.hostConsensusStateProof = base64FromBytes(message.hostConsensusStateProof !== undefined ? message.hostConsensusStateProof : new Uint8Array())); + return obj; + }, fromPartial(object: Partial): MsgConnectionOpenTry { const message = createBaseMsgConnectionOpenTry(); message.clientId = object.clientId ?? ""; @@ -608,21 +767,45 @@ export const MsgConnectionOpenTry = { return message; }, fromAmino(object: MsgConnectionOpenTryAmino): MsgConnectionOpenTry { - return { - clientId: object.client_id, - previousConnectionId: object.previous_connection_id, - clientState: object?.client_state ? Any.fromAmino(object.client_state) : undefined, - counterparty: object?.counterparty ? Counterparty.fromAmino(object.counterparty) : undefined, - delayPeriod: BigInt(object.delay_period), - counterpartyVersions: Array.isArray(object?.counterparty_versions) ? object.counterparty_versions.map((e: any) => Version.fromAmino(e)) : [], - proofHeight: object?.proof_height ? Height.fromAmino(object.proof_height) : undefined, - proofInit: object.proof_init, - proofClient: object.proof_client, - proofConsensus: object.proof_consensus, - consensusHeight: object?.consensus_height ? Height.fromAmino(object.consensus_height) : undefined, - signer: object.signer, - hostConsensusStateProof: object.host_consensus_state_proof - }; + const message = createBaseMsgConnectionOpenTry(); + if (object.client_id !== undefined && object.client_id !== null) { + message.clientId = object.client_id; + } + if (object.previous_connection_id !== undefined && object.previous_connection_id !== null) { + message.previousConnectionId = object.previous_connection_id; + } + if (object.client_state !== undefined && object.client_state !== null) { + message.clientState = Any.fromAmino(object.client_state); + } + if (object.counterparty !== undefined && object.counterparty !== null) { + message.counterparty = Counterparty.fromAmino(object.counterparty); + } + if (object.delay_period !== undefined && object.delay_period !== null) { + message.delayPeriod = BigInt(object.delay_period); + } + message.counterpartyVersions = object.counterparty_versions?.map(e => Version.fromAmino(e)) || []; + if (object.proof_height !== undefined && object.proof_height !== null) { + message.proofHeight = Height.fromAmino(object.proof_height); + } + if (object.proof_init !== undefined && object.proof_init !== null) { + message.proofInit = bytesFromBase64(object.proof_init); + } + if (object.proof_client !== undefined && object.proof_client !== null) { + message.proofClient = bytesFromBase64(object.proof_client); + } + if (object.proof_consensus !== undefined && object.proof_consensus !== null) { + message.proofConsensus = bytesFromBase64(object.proof_consensus); + } + if (object.consensus_height !== undefined && object.consensus_height !== null) { + message.consensusHeight = Height.fromAmino(object.consensus_height); + } + if (object.signer !== undefined && object.signer !== null) { + message.signer = object.signer; + } + if (object.host_consensus_state_proof !== undefined && object.host_consensus_state_proof !== null) { + message.hostConsensusStateProof = bytesFromBase64(object.host_consensus_state_proof); + } + return message; }, toAmino(message: MsgConnectionOpenTry): MsgConnectionOpenTryAmino { const obj: any = {}; @@ -637,12 +820,12 @@ export const MsgConnectionOpenTry = { obj.counterparty_versions = []; } obj.proof_height = message.proofHeight ? Height.toAmino(message.proofHeight) : {}; - obj.proof_init = message.proofInit; - obj.proof_client = message.proofClient; - obj.proof_consensus = message.proofConsensus; + obj.proof_init = message.proofInit ? base64FromBytes(message.proofInit) : undefined; + obj.proof_client = message.proofClient ? base64FromBytes(message.proofClient) : undefined; + obj.proof_consensus = message.proofConsensus ? base64FromBytes(message.proofConsensus) : undefined; obj.consensus_height = message.consensusHeight ? Height.toAmino(message.consensusHeight) : {}; obj.signer = message.signer; - obj.host_consensus_state_proof = message.hostConsensusStateProof; + obj.host_consensus_state_proof = message.hostConsensusStateProof ? base64FromBytes(message.hostConsensusStateProof) : undefined; return obj; }, fromAminoMsg(object: MsgConnectionOpenTryAminoMsg): MsgConnectionOpenTry { @@ -667,11 +850,23 @@ export const MsgConnectionOpenTry = { }; } }; +GlobalDecoderRegistry.register(MsgConnectionOpenTry.typeUrl, MsgConnectionOpenTry); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgConnectionOpenTry.aminoType, MsgConnectionOpenTry.typeUrl); function createBaseMsgConnectionOpenTryResponse(): MsgConnectionOpenTryResponse { return {}; } export const MsgConnectionOpenTryResponse = { typeUrl: "/ibc.core.connection.v1.MsgConnectionOpenTryResponse", + aminoType: "cosmos-sdk/MsgConnectionOpenTryResponse", + is(o: any): o is MsgConnectionOpenTryResponse { + return o && o.$typeUrl === MsgConnectionOpenTryResponse.typeUrl; + }, + isSDK(o: any): o is MsgConnectionOpenTryResponseSDKType { + return o && o.$typeUrl === MsgConnectionOpenTryResponse.typeUrl; + }, + isAmino(o: any): o is MsgConnectionOpenTryResponseAmino { + return o && o.$typeUrl === MsgConnectionOpenTryResponse.typeUrl; + }, encode(_: MsgConnectionOpenTryResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, @@ -689,12 +884,20 @@ export const MsgConnectionOpenTryResponse = { } return message; }, + fromJSON(_: any): MsgConnectionOpenTryResponse { + return {}; + }, + toJSON(_: MsgConnectionOpenTryResponse): unknown { + const obj: any = {}; + return obj; + }, fromPartial(_: Partial): MsgConnectionOpenTryResponse { const message = createBaseMsgConnectionOpenTryResponse(); return message; }, fromAmino(_: MsgConnectionOpenTryResponseAmino): MsgConnectionOpenTryResponse { - return {}; + const message = createBaseMsgConnectionOpenTryResponse(); + return message; }, toAmino(_: MsgConnectionOpenTryResponse): MsgConnectionOpenTryResponseAmino { const obj: any = {}; @@ -722,11 +925,13 @@ export const MsgConnectionOpenTryResponse = { }; } }; +GlobalDecoderRegistry.register(MsgConnectionOpenTryResponse.typeUrl, MsgConnectionOpenTryResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgConnectionOpenTryResponse.aminoType, MsgConnectionOpenTryResponse.typeUrl); function createBaseMsgConnectionOpenAck(): MsgConnectionOpenAck { return { connectionId: "", counterpartyConnectionId: "", - version: Version.fromPartial({}), + version: undefined, clientState: undefined, proofHeight: Height.fromPartial({}), proofTry: new Uint8Array(), @@ -739,6 +944,16 @@ function createBaseMsgConnectionOpenAck(): MsgConnectionOpenAck { } export const MsgConnectionOpenAck = { typeUrl: "/ibc.core.connection.v1.MsgConnectionOpenAck", + aminoType: "cosmos-sdk/MsgConnectionOpenAck", + is(o: any): o is MsgConnectionOpenAck { + return o && (o.$typeUrl === MsgConnectionOpenAck.typeUrl || typeof o.connectionId === "string" && typeof o.counterpartyConnectionId === "string" && Height.is(o.proofHeight) && (o.proofTry instanceof Uint8Array || typeof o.proofTry === "string") && (o.proofClient instanceof Uint8Array || typeof o.proofClient === "string") && (o.proofConsensus instanceof Uint8Array || typeof o.proofConsensus === "string") && Height.is(o.consensusHeight) && typeof o.signer === "string" && (o.hostConsensusStateProof instanceof Uint8Array || typeof o.hostConsensusStateProof === "string")); + }, + isSDK(o: any): o is MsgConnectionOpenAckSDKType { + return o && (o.$typeUrl === MsgConnectionOpenAck.typeUrl || typeof o.connection_id === "string" && typeof o.counterparty_connection_id === "string" && Height.isSDK(o.proof_height) && (o.proof_try instanceof Uint8Array || typeof o.proof_try === "string") && (o.proof_client instanceof Uint8Array || typeof o.proof_client === "string") && (o.proof_consensus instanceof Uint8Array || typeof o.proof_consensus === "string") && Height.isSDK(o.consensus_height) && typeof o.signer === "string" && (o.host_consensus_state_proof instanceof Uint8Array || typeof o.host_consensus_state_proof === "string")); + }, + isAmino(o: any): o is MsgConnectionOpenAckAmino { + return o && (o.$typeUrl === MsgConnectionOpenAck.typeUrl || typeof o.connection_id === "string" && typeof o.counterparty_connection_id === "string" && Height.isAmino(o.proof_height) && (o.proof_try instanceof Uint8Array || typeof o.proof_try === "string") && (o.proof_client instanceof Uint8Array || typeof o.proof_client === "string") && (o.proof_consensus instanceof Uint8Array || typeof o.proof_consensus === "string") && Height.isAmino(o.consensus_height) && typeof o.signer === "string" && (o.host_consensus_state_proof instanceof Uint8Array || typeof o.host_consensus_state_proof === "string")); + }, encode(message: MsgConnectionOpenAck, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.connectionId !== "") { writer.uint32(10).string(message.connectionId); @@ -822,6 +1037,36 @@ export const MsgConnectionOpenAck = { } return message; }, + fromJSON(object: any): MsgConnectionOpenAck { + return { + connectionId: isSet(object.connectionId) ? String(object.connectionId) : "", + counterpartyConnectionId: isSet(object.counterpartyConnectionId) ? String(object.counterpartyConnectionId) : "", + version: isSet(object.version) ? Version.fromJSON(object.version) : undefined, + clientState: isSet(object.clientState) ? Any.fromJSON(object.clientState) : undefined, + proofHeight: isSet(object.proofHeight) ? Height.fromJSON(object.proofHeight) : undefined, + proofTry: isSet(object.proofTry) ? bytesFromBase64(object.proofTry) : new Uint8Array(), + proofClient: isSet(object.proofClient) ? bytesFromBase64(object.proofClient) : new Uint8Array(), + proofConsensus: isSet(object.proofConsensus) ? bytesFromBase64(object.proofConsensus) : new Uint8Array(), + consensusHeight: isSet(object.consensusHeight) ? Height.fromJSON(object.consensusHeight) : undefined, + signer: isSet(object.signer) ? String(object.signer) : "", + hostConsensusStateProof: isSet(object.hostConsensusStateProof) ? bytesFromBase64(object.hostConsensusStateProof) : new Uint8Array() + }; + }, + toJSON(message: MsgConnectionOpenAck): unknown { + const obj: any = {}; + message.connectionId !== undefined && (obj.connectionId = message.connectionId); + message.counterpartyConnectionId !== undefined && (obj.counterpartyConnectionId = message.counterpartyConnectionId); + message.version !== undefined && (obj.version = message.version ? Version.toJSON(message.version) : undefined); + message.clientState !== undefined && (obj.clientState = message.clientState ? Any.toJSON(message.clientState) : undefined); + message.proofHeight !== undefined && (obj.proofHeight = message.proofHeight ? Height.toJSON(message.proofHeight) : undefined); + message.proofTry !== undefined && (obj.proofTry = base64FromBytes(message.proofTry !== undefined ? message.proofTry : new Uint8Array())); + message.proofClient !== undefined && (obj.proofClient = base64FromBytes(message.proofClient !== undefined ? message.proofClient : new Uint8Array())); + message.proofConsensus !== undefined && (obj.proofConsensus = base64FromBytes(message.proofConsensus !== undefined ? message.proofConsensus : new Uint8Array())); + message.consensusHeight !== undefined && (obj.consensusHeight = message.consensusHeight ? Height.toJSON(message.consensusHeight) : undefined); + message.signer !== undefined && (obj.signer = message.signer); + message.hostConsensusStateProof !== undefined && (obj.hostConsensusStateProof = base64FromBytes(message.hostConsensusStateProof !== undefined ? message.hostConsensusStateProof : new Uint8Array())); + return obj; + }, fromPartial(object: Partial): MsgConnectionOpenAck { const message = createBaseMsgConnectionOpenAck(); message.connectionId = object.connectionId ?? ""; @@ -838,19 +1083,41 @@ export const MsgConnectionOpenAck = { return message; }, fromAmino(object: MsgConnectionOpenAckAmino): MsgConnectionOpenAck { - return { - connectionId: object.connection_id, - counterpartyConnectionId: object.counterparty_connection_id, - version: object?.version ? Version.fromAmino(object.version) : undefined, - clientState: object?.client_state ? Any.fromAmino(object.client_state) : undefined, - proofHeight: object?.proof_height ? Height.fromAmino(object.proof_height) : undefined, - proofTry: object.proof_try, - proofClient: object.proof_client, - proofConsensus: object.proof_consensus, - consensusHeight: object?.consensus_height ? Height.fromAmino(object.consensus_height) : undefined, - signer: object.signer, - hostConsensusStateProof: object.host_consensus_state_proof - }; + const message = createBaseMsgConnectionOpenAck(); + if (object.connection_id !== undefined && object.connection_id !== null) { + message.connectionId = object.connection_id; + } + if (object.counterparty_connection_id !== undefined && object.counterparty_connection_id !== null) { + message.counterpartyConnectionId = object.counterparty_connection_id; + } + if (object.version !== undefined && object.version !== null) { + message.version = Version.fromAmino(object.version); + } + if (object.client_state !== undefined && object.client_state !== null) { + message.clientState = Any.fromAmino(object.client_state); + } + if (object.proof_height !== undefined && object.proof_height !== null) { + message.proofHeight = Height.fromAmino(object.proof_height); + } + if (object.proof_try !== undefined && object.proof_try !== null) { + message.proofTry = bytesFromBase64(object.proof_try); + } + if (object.proof_client !== undefined && object.proof_client !== null) { + message.proofClient = bytesFromBase64(object.proof_client); + } + if (object.proof_consensus !== undefined && object.proof_consensus !== null) { + message.proofConsensus = bytesFromBase64(object.proof_consensus); + } + if (object.consensus_height !== undefined && object.consensus_height !== null) { + message.consensusHeight = Height.fromAmino(object.consensus_height); + } + if (object.signer !== undefined && object.signer !== null) { + message.signer = object.signer; + } + if (object.host_consensus_state_proof !== undefined && object.host_consensus_state_proof !== null) { + message.hostConsensusStateProof = bytesFromBase64(object.host_consensus_state_proof); + } + return message; }, toAmino(message: MsgConnectionOpenAck): MsgConnectionOpenAckAmino { const obj: any = {}; @@ -859,12 +1126,12 @@ export const MsgConnectionOpenAck = { obj.version = message.version ? Version.toAmino(message.version) : undefined; obj.client_state = message.clientState ? Any.toAmino(message.clientState) : undefined; obj.proof_height = message.proofHeight ? Height.toAmino(message.proofHeight) : {}; - obj.proof_try = message.proofTry; - obj.proof_client = message.proofClient; - obj.proof_consensus = message.proofConsensus; + obj.proof_try = message.proofTry ? base64FromBytes(message.proofTry) : undefined; + obj.proof_client = message.proofClient ? base64FromBytes(message.proofClient) : undefined; + obj.proof_consensus = message.proofConsensus ? base64FromBytes(message.proofConsensus) : undefined; obj.consensus_height = message.consensusHeight ? Height.toAmino(message.consensusHeight) : {}; obj.signer = message.signer; - obj.host_consensus_state_proof = message.hostConsensusStateProof; + obj.host_consensus_state_proof = message.hostConsensusStateProof ? base64FromBytes(message.hostConsensusStateProof) : undefined; return obj; }, fromAminoMsg(object: MsgConnectionOpenAckAminoMsg): MsgConnectionOpenAck { @@ -889,11 +1156,23 @@ export const MsgConnectionOpenAck = { }; } }; +GlobalDecoderRegistry.register(MsgConnectionOpenAck.typeUrl, MsgConnectionOpenAck); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgConnectionOpenAck.aminoType, MsgConnectionOpenAck.typeUrl); function createBaseMsgConnectionOpenAckResponse(): MsgConnectionOpenAckResponse { return {}; } export const MsgConnectionOpenAckResponse = { typeUrl: "/ibc.core.connection.v1.MsgConnectionOpenAckResponse", + aminoType: "cosmos-sdk/MsgConnectionOpenAckResponse", + is(o: any): o is MsgConnectionOpenAckResponse { + return o && o.$typeUrl === MsgConnectionOpenAckResponse.typeUrl; + }, + isSDK(o: any): o is MsgConnectionOpenAckResponseSDKType { + return o && o.$typeUrl === MsgConnectionOpenAckResponse.typeUrl; + }, + isAmino(o: any): o is MsgConnectionOpenAckResponseAmino { + return o && o.$typeUrl === MsgConnectionOpenAckResponse.typeUrl; + }, encode(_: MsgConnectionOpenAckResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, @@ -911,12 +1190,20 @@ export const MsgConnectionOpenAckResponse = { } return message; }, + fromJSON(_: any): MsgConnectionOpenAckResponse { + return {}; + }, + toJSON(_: MsgConnectionOpenAckResponse): unknown { + const obj: any = {}; + return obj; + }, fromPartial(_: Partial): MsgConnectionOpenAckResponse { const message = createBaseMsgConnectionOpenAckResponse(); return message; }, fromAmino(_: MsgConnectionOpenAckResponseAmino): MsgConnectionOpenAckResponse { - return {}; + const message = createBaseMsgConnectionOpenAckResponse(); + return message; }, toAmino(_: MsgConnectionOpenAckResponse): MsgConnectionOpenAckResponseAmino { const obj: any = {}; @@ -944,6 +1231,8 @@ export const MsgConnectionOpenAckResponse = { }; } }; +GlobalDecoderRegistry.register(MsgConnectionOpenAckResponse.typeUrl, MsgConnectionOpenAckResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgConnectionOpenAckResponse.aminoType, MsgConnectionOpenAckResponse.typeUrl); function createBaseMsgConnectionOpenConfirm(): MsgConnectionOpenConfirm { return { connectionId: "", @@ -954,6 +1243,16 @@ function createBaseMsgConnectionOpenConfirm(): MsgConnectionOpenConfirm { } export const MsgConnectionOpenConfirm = { typeUrl: "/ibc.core.connection.v1.MsgConnectionOpenConfirm", + aminoType: "cosmos-sdk/MsgConnectionOpenConfirm", + is(o: any): o is MsgConnectionOpenConfirm { + return o && (o.$typeUrl === MsgConnectionOpenConfirm.typeUrl || typeof o.connectionId === "string" && (o.proofAck instanceof Uint8Array || typeof o.proofAck === "string") && Height.is(o.proofHeight) && typeof o.signer === "string"); + }, + isSDK(o: any): o is MsgConnectionOpenConfirmSDKType { + return o && (o.$typeUrl === MsgConnectionOpenConfirm.typeUrl || typeof o.connection_id === "string" && (o.proof_ack instanceof Uint8Array || typeof o.proof_ack === "string") && Height.isSDK(o.proof_height) && typeof o.signer === "string"); + }, + isAmino(o: any): o is MsgConnectionOpenConfirmAmino { + return o && (o.$typeUrl === MsgConnectionOpenConfirm.typeUrl || typeof o.connection_id === "string" && (o.proof_ack instanceof Uint8Array || typeof o.proof_ack === "string") && Height.isAmino(o.proof_height) && typeof o.signer === "string"); + }, encode(message: MsgConnectionOpenConfirm, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.connectionId !== "") { writer.uint32(10).string(message.connectionId); @@ -995,6 +1294,22 @@ export const MsgConnectionOpenConfirm = { } return message; }, + fromJSON(object: any): MsgConnectionOpenConfirm { + return { + connectionId: isSet(object.connectionId) ? String(object.connectionId) : "", + proofAck: isSet(object.proofAck) ? bytesFromBase64(object.proofAck) : new Uint8Array(), + proofHeight: isSet(object.proofHeight) ? Height.fromJSON(object.proofHeight) : undefined, + signer: isSet(object.signer) ? String(object.signer) : "" + }; + }, + toJSON(message: MsgConnectionOpenConfirm): unknown { + const obj: any = {}; + message.connectionId !== undefined && (obj.connectionId = message.connectionId); + message.proofAck !== undefined && (obj.proofAck = base64FromBytes(message.proofAck !== undefined ? message.proofAck : new Uint8Array())); + message.proofHeight !== undefined && (obj.proofHeight = message.proofHeight ? Height.toJSON(message.proofHeight) : undefined); + message.signer !== undefined && (obj.signer = message.signer); + return obj; + }, fromPartial(object: Partial): MsgConnectionOpenConfirm { const message = createBaseMsgConnectionOpenConfirm(); message.connectionId = object.connectionId ?? ""; @@ -1004,17 +1319,25 @@ export const MsgConnectionOpenConfirm = { return message; }, fromAmino(object: MsgConnectionOpenConfirmAmino): MsgConnectionOpenConfirm { - return { - connectionId: object.connection_id, - proofAck: object.proof_ack, - proofHeight: object?.proof_height ? Height.fromAmino(object.proof_height) : undefined, - signer: object.signer - }; + const message = createBaseMsgConnectionOpenConfirm(); + if (object.connection_id !== undefined && object.connection_id !== null) { + message.connectionId = object.connection_id; + } + if (object.proof_ack !== undefined && object.proof_ack !== null) { + message.proofAck = bytesFromBase64(object.proof_ack); + } + if (object.proof_height !== undefined && object.proof_height !== null) { + message.proofHeight = Height.fromAmino(object.proof_height); + } + if (object.signer !== undefined && object.signer !== null) { + message.signer = object.signer; + } + return message; }, toAmino(message: MsgConnectionOpenConfirm): MsgConnectionOpenConfirmAmino { const obj: any = {}; obj.connection_id = message.connectionId; - obj.proof_ack = message.proofAck; + obj.proof_ack = message.proofAck ? base64FromBytes(message.proofAck) : undefined; obj.proof_height = message.proofHeight ? Height.toAmino(message.proofHeight) : {}; obj.signer = message.signer; return obj; @@ -1041,11 +1364,23 @@ export const MsgConnectionOpenConfirm = { }; } }; +GlobalDecoderRegistry.register(MsgConnectionOpenConfirm.typeUrl, MsgConnectionOpenConfirm); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgConnectionOpenConfirm.aminoType, MsgConnectionOpenConfirm.typeUrl); function createBaseMsgConnectionOpenConfirmResponse(): MsgConnectionOpenConfirmResponse { return {}; } export const MsgConnectionOpenConfirmResponse = { typeUrl: "/ibc.core.connection.v1.MsgConnectionOpenConfirmResponse", + aminoType: "cosmos-sdk/MsgConnectionOpenConfirmResponse", + is(o: any): o is MsgConnectionOpenConfirmResponse { + return o && o.$typeUrl === MsgConnectionOpenConfirmResponse.typeUrl; + }, + isSDK(o: any): o is MsgConnectionOpenConfirmResponseSDKType { + return o && o.$typeUrl === MsgConnectionOpenConfirmResponse.typeUrl; + }, + isAmino(o: any): o is MsgConnectionOpenConfirmResponseAmino { + return o && o.$typeUrl === MsgConnectionOpenConfirmResponse.typeUrl; + }, encode(_: MsgConnectionOpenConfirmResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, @@ -1063,12 +1398,20 @@ export const MsgConnectionOpenConfirmResponse = { } return message; }, + fromJSON(_: any): MsgConnectionOpenConfirmResponse { + return {}; + }, + toJSON(_: MsgConnectionOpenConfirmResponse): unknown { + const obj: any = {}; + return obj; + }, fromPartial(_: Partial): MsgConnectionOpenConfirmResponse { const message = createBaseMsgConnectionOpenConfirmResponse(); return message; }, fromAmino(_: MsgConnectionOpenConfirmResponseAmino): MsgConnectionOpenConfirmResponse { - return {}; + const message = createBaseMsgConnectionOpenConfirmResponse(); + return message; }, toAmino(_: MsgConnectionOpenConfirmResponse): MsgConnectionOpenConfirmResponseAmino { const obj: any = {}; @@ -1095,4 +1438,186 @@ export const MsgConnectionOpenConfirmResponse = { value: MsgConnectionOpenConfirmResponse.encode(message).finish() }; } -}; \ No newline at end of file +}; +GlobalDecoderRegistry.register(MsgConnectionOpenConfirmResponse.typeUrl, MsgConnectionOpenConfirmResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgConnectionOpenConfirmResponse.aminoType, MsgConnectionOpenConfirmResponse.typeUrl); +function createBaseMsgUpdateParams(): MsgUpdateParams { + return { + signer: "", + params: Params.fromPartial({}) + }; +} +export const MsgUpdateParams = { + typeUrl: "/ibc.core.connection.v1.MsgUpdateParams", + aminoType: "cosmos-sdk/MsgUpdateParams", + is(o: any): o is MsgUpdateParams { + return o && (o.$typeUrl === MsgUpdateParams.typeUrl || typeof o.signer === "string" && Params.is(o.params)); + }, + isSDK(o: any): o is MsgUpdateParamsSDKType { + return o && (o.$typeUrl === MsgUpdateParams.typeUrl || typeof o.signer === "string" && Params.isSDK(o.params)); + }, + isAmino(o: any): o is MsgUpdateParamsAmino { + return o && (o.$typeUrl === MsgUpdateParams.typeUrl || typeof o.signer === "string" && Params.isAmino(o.params)); + }, + encode(message: MsgUpdateParams, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.signer !== "") { + writer.uint32(10).string(message.signer); + } + if (message.params !== undefined) { + Params.encode(message.params, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgUpdateParams { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUpdateParams(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.signer = reader.string(); + break; + case 2: + message.params = Params.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): MsgUpdateParams { + return { + signer: isSet(object.signer) ? String(object.signer) : "", + params: isSet(object.params) ? Params.fromJSON(object.params) : undefined + }; + }, + toJSON(message: MsgUpdateParams): unknown { + const obj: any = {}; + message.signer !== undefined && (obj.signer = message.signer); + message.params !== undefined && (obj.params = message.params ? Params.toJSON(message.params) : undefined); + return obj; + }, + fromPartial(object: Partial): MsgUpdateParams { + const message = createBaseMsgUpdateParams(); + message.signer = object.signer ?? ""; + message.params = object.params !== undefined && object.params !== null ? Params.fromPartial(object.params) : undefined; + return message; + }, + fromAmino(object: MsgUpdateParamsAmino): MsgUpdateParams { + const message = createBaseMsgUpdateParams(); + if (object.signer !== undefined && object.signer !== null) { + message.signer = object.signer; + } + if (object.params !== undefined && object.params !== null) { + message.params = Params.fromAmino(object.params); + } + return message; + }, + toAmino(message: MsgUpdateParams): MsgUpdateParamsAmino { + const obj: any = {}; + obj.signer = message.signer; + obj.params = message.params ? Params.toAmino(message.params) : undefined; + return obj; + }, + fromAminoMsg(object: MsgUpdateParamsAminoMsg): MsgUpdateParams { + return MsgUpdateParams.fromAmino(object.value); + }, + toAminoMsg(message: MsgUpdateParams): MsgUpdateParamsAminoMsg { + return { + type: "cosmos-sdk/MsgUpdateParams", + value: MsgUpdateParams.toAmino(message) + }; + }, + fromProtoMsg(message: MsgUpdateParamsProtoMsg): MsgUpdateParams { + return MsgUpdateParams.decode(message.value); + }, + toProto(message: MsgUpdateParams): Uint8Array { + return MsgUpdateParams.encode(message).finish(); + }, + toProtoMsg(message: MsgUpdateParams): MsgUpdateParamsProtoMsg { + return { + typeUrl: "/ibc.core.connection.v1.MsgUpdateParams", + value: MsgUpdateParams.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgUpdateParams.typeUrl, MsgUpdateParams); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgUpdateParams.aminoType, MsgUpdateParams.typeUrl); +function createBaseMsgUpdateParamsResponse(): MsgUpdateParamsResponse { + return {}; +} +export const MsgUpdateParamsResponse = { + typeUrl: "/ibc.core.connection.v1.MsgUpdateParamsResponse", + aminoType: "cosmos-sdk/MsgUpdateParamsResponse", + is(o: any): o is MsgUpdateParamsResponse { + return o && o.$typeUrl === MsgUpdateParamsResponse.typeUrl; + }, + isSDK(o: any): o is MsgUpdateParamsResponseSDKType { + return o && o.$typeUrl === MsgUpdateParamsResponse.typeUrl; + }, + isAmino(o: any): o is MsgUpdateParamsResponseAmino { + return o && o.$typeUrl === MsgUpdateParamsResponse.typeUrl; + }, + encode(_: MsgUpdateParamsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgUpdateParamsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUpdateParamsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(_: any): MsgUpdateParamsResponse { + return {}; + }, + toJSON(_: MsgUpdateParamsResponse): unknown { + const obj: any = {}; + return obj; + }, + fromPartial(_: Partial): MsgUpdateParamsResponse { + const message = createBaseMsgUpdateParamsResponse(); + return message; + }, + fromAmino(_: MsgUpdateParamsResponseAmino): MsgUpdateParamsResponse { + const message = createBaseMsgUpdateParamsResponse(); + return message; + }, + toAmino(_: MsgUpdateParamsResponse): MsgUpdateParamsResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgUpdateParamsResponseAminoMsg): MsgUpdateParamsResponse { + return MsgUpdateParamsResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgUpdateParamsResponse): MsgUpdateParamsResponseAminoMsg { + return { + type: "cosmos-sdk/MsgUpdateParamsResponse", + value: MsgUpdateParamsResponse.toAmino(message) + }; + }, + fromProtoMsg(message: MsgUpdateParamsResponseProtoMsg): MsgUpdateParamsResponse { + return MsgUpdateParamsResponse.decode(message.value); + }, + toProto(message: MsgUpdateParamsResponse): Uint8Array { + return MsgUpdateParamsResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgUpdateParamsResponse): MsgUpdateParamsResponseProtoMsg { + return { + typeUrl: "/ibc.core.connection.v1.MsgUpdateParamsResponse", + value: MsgUpdateParamsResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgUpdateParamsResponse.typeUrl, MsgUpdateParamsResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgUpdateParamsResponse.aminoType, MsgUpdateParamsResponse.typeUrl); \ No newline at end of file diff --git a/packages/osmojs/src/codegen/ibc/lcd.ts b/packages/osmojs/src/codegen/ibc/lcd.ts index 182d85ab6..1a77e9da0 100644 --- a/packages/osmojs/src/codegen/ibc/lcd.ts +++ b/packages/osmojs/src/codegen/ibc/lcd.ts @@ -31,6 +31,11 @@ export const createLCDClient = async ({ }) } }, + consensus: { + v1: new (await import("../cosmos/consensus/v1/query.lcd")).LCDQueryClient({ + requestClient + }) + }, distribution: { v1beta1: new (await import("../cosmos/distribution/v1beta1/query.lcd")).LCDQueryClient({ requestClient @@ -41,6 +46,11 @@ export const createLCDClient = async ({ requestClient }) }, + params: { + v1beta1: new (await import("../cosmos/params/v1beta1/query.lcd")).LCDQueryClient({ + requestClient + }) + }, staking: { v1beta1: new (await import("../cosmos/staking/v1beta1/query.lcd")).LCDQueryClient({ requestClient @@ -98,6 +108,13 @@ export const createLCDClient = async ({ requestClient }) } + }, + lightclients: { + wasm: { + v1: new (await import("./lightclients/wasm/v1/query.lcd")).LCDQueryClient({ + requestClient + }) + } } } }; diff --git a/packages/osmojs/src/codegen/ibc/lightclients/localhost/v2/localhost.ts b/packages/osmojs/src/codegen/ibc/lightclients/localhost/v2/localhost.ts index 617f7b4d1..c26def2ff 100644 --- a/packages/osmojs/src/codegen/ibc/lightclients/localhost/v2/localhost.ts +++ b/packages/osmojs/src/codegen/ibc/lightclients/localhost/v2/localhost.ts @@ -1,5 +1,7 @@ import { Height, HeightAmino, HeightSDKType } from "../../../core/client/v1/client"; import { BinaryReader, BinaryWriter } from "../../../../binary"; +import { isSet } from "../../../../helpers"; +import { GlobalDecoderRegistry } from "../../../../registry"; /** ClientState defines the 09-localhost client state */ export interface ClientState { /** the latest block height */ @@ -29,6 +31,16 @@ function createBaseClientState(): ClientState { } export const ClientState = { typeUrl: "/ibc.lightclients.localhost.v2.ClientState", + aminoType: "cosmos-sdk/ClientState", + is(o: any): o is ClientState { + return o && (o.$typeUrl === ClientState.typeUrl || Height.is(o.latestHeight)); + }, + isSDK(o: any): o is ClientStateSDKType { + return o && (o.$typeUrl === ClientState.typeUrl || Height.isSDK(o.latest_height)); + }, + isAmino(o: any): o is ClientStateAmino { + return o && (o.$typeUrl === ClientState.typeUrl || Height.isAmino(o.latest_height)); + }, encode(message: ClientState, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.latestHeight !== undefined) { Height.encode(message.latestHeight, writer.uint32(10).fork()).ldelim(); @@ -52,15 +64,27 @@ export const ClientState = { } return message; }, + fromJSON(object: any): ClientState { + return { + latestHeight: isSet(object.latestHeight) ? Height.fromJSON(object.latestHeight) : undefined + }; + }, + toJSON(message: ClientState): unknown { + const obj: any = {}; + message.latestHeight !== undefined && (obj.latestHeight = message.latestHeight ? Height.toJSON(message.latestHeight) : undefined); + return obj; + }, fromPartial(object: Partial): ClientState { const message = createBaseClientState(); message.latestHeight = object.latestHeight !== undefined && object.latestHeight !== null ? Height.fromPartial(object.latestHeight) : undefined; return message; }, fromAmino(object: ClientStateAmino): ClientState { - return { - latestHeight: object?.latest_height ? Height.fromAmino(object.latest_height) : undefined - }; + const message = createBaseClientState(); + if (object.latest_height !== undefined && object.latest_height !== null) { + message.latestHeight = Height.fromAmino(object.latest_height); + } + return message; }, toAmino(message: ClientState): ClientStateAmino { const obj: any = {}; @@ -88,4 +112,6 @@ export const ClientState = { value: ClientState.encode(message).finish() }; } -}; \ No newline at end of file +}; +GlobalDecoderRegistry.register(ClientState.typeUrl, ClientState); +GlobalDecoderRegistry.registerAminoProtoMapping(ClientState.aminoType, ClientState.typeUrl); \ No newline at end of file diff --git a/packages/osmojs/src/codegen/ibc/lightclients/solomachine/v2/solomachine.ts b/packages/osmojs/src/codegen/ibc/lightclients/solomachine/v2/solomachine.ts index 7c3953a05..f271d27fe 100644 --- a/packages/osmojs/src/codegen/ibc/lightclients/solomachine/v2/solomachine.ts +++ b/packages/osmojs/src/codegen/ibc/lightclients/solomachine/v2/solomachine.ts @@ -2,7 +2,8 @@ import { Any, AnyAmino, AnySDKType } from "../../../../google/protobuf/any"; import { ConnectionEnd, ConnectionEndAmino, ConnectionEndSDKType } from "../../../core/connection/v1/connection"; import { Channel, ChannelAmino, ChannelSDKType } from "../../../core/channel/v1/channel"; import { BinaryReader, BinaryWriter } from "../../../../binary"; -import { isSet } from "../../../../helpers"; +import { isSet, bytesFromBase64, base64FromBytes } from "../../../../helpers"; +import { GlobalDecoderRegistry } from "../../../../registry"; /** * DataType defines the type of solo machine proof being created. This is done * to preserve uniqueness of different data sign byte encodings. @@ -106,7 +107,7 @@ export interface ClientState { sequence: bigint; /** frozen sequence of the solo machine */ isFrozen: boolean; - consensusState: ConsensusState; + consensusState?: ConsensusState; /** * when set to true, will allow governance to update a solo machine client. * The client will be unfrozen if it is frozen. @@ -123,15 +124,15 @@ export interface ClientStateProtoMsg { */ export interface ClientStateAmino { /** latest sequence of the client state */ - sequence: string; + sequence?: string; /** frozen sequence of the solo machine */ - is_frozen: boolean; + is_frozen?: boolean; consensus_state?: ConsensusStateAmino; /** * when set to true, will allow governance to update a solo machine client. * The client will be unfrozen if it is frozen. */ - allow_update_after_proposal: boolean; + allow_update_after_proposal?: boolean; } export interface ClientStateAminoMsg { type: "cosmos-sdk/ClientState"; @@ -144,7 +145,7 @@ export interface ClientStateAminoMsg { export interface ClientStateSDKType { sequence: bigint; is_frozen: boolean; - consensus_state: ConsensusStateSDKType; + consensus_state?: ConsensusStateSDKType; allow_update_after_proposal: boolean; } /** @@ -154,7 +155,7 @@ export interface ClientStateSDKType { */ export interface ConsensusState { /** public key of the solo machine */ - publicKey: Any; + publicKey?: Any; /** * diversifier allows the same public key to be re-used across different solo * machine clients (potentially on different chains) without being considered @@ -180,8 +181,8 @@ export interface ConsensusStateAmino { * machine clients (potentially on different chains) without being considered * misbehaviour. */ - diversifier: string; - timestamp: string; + diversifier?: string; + timestamp?: string; } export interface ConsensusStateAminoMsg { type: "cosmos-sdk/ConsensusState"; @@ -193,7 +194,7 @@ export interface ConsensusStateAminoMsg { * consensus state. */ export interface ConsensusStateSDKType { - public_key: AnySDKType; + public_key?: AnySDKType; diversifier: string; timestamp: bigint; } @@ -203,7 +204,7 @@ export interface Header { sequence: bigint; timestamp: bigint; signature: Uint8Array; - newPublicKey: Any; + newPublicKey?: Any; newDiversifier: string; } export interface HeaderProtoMsg { @@ -213,11 +214,11 @@ export interface HeaderProtoMsg { /** Header defines a solo machine consensus header */ export interface HeaderAmino { /** sequence to update solo machine public key at */ - sequence: string; - timestamp: string; - signature: Uint8Array; + sequence?: string; + timestamp?: string; + signature?: string; new_public_key?: AnyAmino; - new_diversifier: string; + new_diversifier?: string; } export interface HeaderAminoMsg { type: "cosmos-sdk/Header"; @@ -228,7 +229,7 @@ export interface HeaderSDKType { sequence: bigint; timestamp: bigint; signature: Uint8Array; - new_public_key: AnySDKType; + new_public_key?: AnySDKType; new_diversifier: string; } /** @@ -238,8 +239,8 @@ export interface HeaderSDKType { export interface Misbehaviour { clientId: string; sequence: bigint; - signatureOne: SignatureAndData; - signatureTwo: SignatureAndData; + signatureOne?: SignatureAndData; + signatureTwo?: SignatureAndData; } export interface MisbehaviourProtoMsg { typeUrl: "/ibc.lightclients.solomachine.v2.Misbehaviour"; @@ -250,8 +251,8 @@ export interface MisbehaviourProtoMsg { * of a sequence and two signatures over different messages at that sequence. */ export interface MisbehaviourAmino { - client_id: string; - sequence: string; + client_id?: string; + sequence?: string; signature_one?: SignatureAndDataAmino; signature_two?: SignatureAndDataAmino; } @@ -266,8 +267,8 @@ export interface MisbehaviourAminoMsg { export interface MisbehaviourSDKType { client_id: string; sequence: bigint; - signature_one: SignatureAndDataSDKType; - signature_two: SignatureAndDataSDKType; + signature_one?: SignatureAndDataSDKType; + signature_two?: SignatureAndDataSDKType; } /** * SignatureAndData contains a signature and the data signed over to create that @@ -288,10 +289,10 @@ export interface SignatureAndDataProtoMsg { * signature. */ export interface SignatureAndDataAmino { - signature: Uint8Array; - data_type: DataType; - data: Uint8Array; - timestamp: string; + signature?: string; + data_type?: DataType; + data?: string; + timestamp?: string; } export interface SignatureAndDataAminoMsg { type: "cosmos-sdk/SignatureAndData"; @@ -324,8 +325,8 @@ export interface TimestampedSignatureDataProtoMsg { * signature. */ export interface TimestampedSignatureDataAmino { - signature_data: Uint8Array; - timestamp: string; + signature_data?: string; + timestamp?: string; } export interface TimestampedSignatureDataAminoMsg { type: "cosmos-sdk/TimestampedSignatureData"; @@ -355,13 +356,13 @@ export interface SignBytesProtoMsg { } /** SignBytes defines the signed bytes used for signature verification. */ export interface SignBytesAmino { - sequence: string; - timestamp: string; - diversifier: string; + sequence?: string; + timestamp?: string; + diversifier?: string; /** type of the data used */ - data_type: DataType; + data_type?: DataType; /** marshaled data */ - data: Uint8Array; + data?: string; } export interface SignBytesAminoMsg { type: "cosmos-sdk/SignBytes"; @@ -378,7 +379,7 @@ export interface SignBytesSDKType { /** HeaderData returns the SignBytes data for update verification. */ export interface HeaderData { /** header public key */ - newPubKey: Any; + newPubKey?: Any; /** header diversifier */ newDiversifier: string; } @@ -391,7 +392,7 @@ export interface HeaderDataAmino { /** header public key */ new_pub_key?: AnyAmino; /** header diversifier */ - new_diversifier: string; + new_diversifier?: string; } export interface HeaderDataAminoMsg { type: "cosmos-sdk/HeaderData"; @@ -399,13 +400,13 @@ export interface HeaderDataAminoMsg { } /** HeaderData returns the SignBytes data for update verification. */ export interface HeaderDataSDKType { - new_pub_key: AnySDKType; + new_pub_key?: AnySDKType; new_diversifier: string; } /** ClientStateData returns the SignBytes data for client state verification. */ export interface ClientStateData { path: Uint8Array; - clientState: Any; + clientState?: Any; } export interface ClientStateDataProtoMsg { typeUrl: "/ibc.lightclients.solomachine.v2.ClientStateData"; @@ -413,7 +414,7 @@ export interface ClientStateDataProtoMsg { } /** ClientStateData returns the SignBytes data for client state verification. */ export interface ClientStateDataAmino { - path: Uint8Array; + path?: string; client_state?: AnyAmino; } export interface ClientStateDataAminoMsg { @@ -423,7 +424,7 @@ export interface ClientStateDataAminoMsg { /** ClientStateData returns the SignBytes data for client state verification. */ export interface ClientStateDataSDKType { path: Uint8Array; - client_state: AnySDKType; + client_state?: AnySDKType; } /** * ConsensusStateData returns the SignBytes data for consensus state @@ -431,7 +432,7 @@ export interface ClientStateDataSDKType { */ export interface ConsensusStateData { path: Uint8Array; - consensusState: Any; + consensusState?: Any; } export interface ConsensusStateDataProtoMsg { typeUrl: "/ibc.lightclients.solomachine.v2.ConsensusStateData"; @@ -442,7 +443,7 @@ export interface ConsensusStateDataProtoMsg { * verification. */ export interface ConsensusStateDataAmino { - path: Uint8Array; + path?: string; consensus_state?: AnyAmino; } export interface ConsensusStateDataAminoMsg { @@ -455,7 +456,7 @@ export interface ConsensusStateDataAminoMsg { */ export interface ConsensusStateDataSDKType { path: Uint8Array; - consensus_state: AnySDKType; + consensus_state?: AnySDKType; } /** * ConnectionStateData returns the SignBytes data for connection state @@ -463,7 +464,7 @@ export interface ConsensusStateDataSDKType { */ export interface ConnectionStateData { path: Uint8Array; - connection: ConnectionEnd; + connection?: ConnectionEnd; } export interface ConnectionStateDataProtoMsg { typeUrl: "/ibc.lightclients.solomachine.v2.ConnectionStateData"; @@ -474,7 +475,7 @@ export interface ConnectionStateDataProtoMsg { * verification. */ export interface ConnectionStateDataAmino { - path: Uint8Array; + path?: string; connection?: ConnectionEndAmino; } export interface ConnectionStateDataAminoMsg { @@ -487,7 +488,7 @@ export interface ConnectionStateDataAminoMsg { */ export interface ConnectionStateDataSDKType { path: Uint8Array; - connection: ConnectionEndSDKType; + connection?: ConnectionEndSDKType; } /** * ChannelStateData returns the SignBytes data for channel state @@ -495,7 +496,7 @@ export interface ConnectionStateDataSDKType { */ export interface ChannelStateData { path: Uint8Array; - channel: Channel; + channel?: Channel; } export interface ChannelStateDataProtoMsg { typeUrl: "/ibc.lightclients.solomachine.v2.ChannelStateData"; @@ -506,7 +507,7 @@ export interface ChannelStateDataProtoMsg { * verification. */ export interface ChannelStateDataAmino { - path: Uint8Array; + path?: string; channel?: ChannelAmino; } export interface ChannelStateDataAminoMsg { @@ -519,7 +520,7 @@ export interface ChannelStateDataAminoMsg { */ export interface ChannelStateDataSDKType { path: Uint8Array; - channel: ChannelSDKType; + channel?: ChannelSDKType; } /** * PacketCommitmentData returns the SignBytes data for packet commitment @@ -538,8 +539,8 @@ export interface PacketCommitmentDataProtoMsg { * verification. */ export interface PacketCommitmentDataAmino { - path: Uint8Array; - commitment: Uint8Array; + path?: string; + commitment?: string; } export interface PacketCommitmentDataAminoMsg { type: "cosmos-sdk/PacketCommitmentData"; @@ -570,8 +571,8 @@ export interface PacketAcknowledgementDataProtoMsg { * verification. */ export interface PacketAcknowledgementDataAmino { - path: Uint8Array; - acknowledgement: Uint8Array; + path?: string; + acknowledgement?: string; } export interface PacketAcknowledgementDataAminoMsg { type: "cosmos-sdk/PacketAcknowledgementData"; @@ -601,7 +602,7 @@ export interface PacketReceiptAbsenceDataProtoMsg { * packet receipt absence verification. */ export interface PacketReceiptAbsenceDataAmino { - path: Uint8Array; + path?: string; } export interface PacketReceiptAbsenceDataAminoMsg { type: "cosmos-sdk/PacketReceiptAbsenceData"; @@ -631,8 +632,8 @@ export interface NextSequenceRecvDataProtoMsg { * sequence to be received. */ export interface NextSequenceRecvDataAmino { - path: Uint8Array; - next_seq_recv: string; + path?: string; + next_seq_recv?: string; } export interface NextSequenceRecvDataAminoMsg { type: "cosmos-sdk/NextSequenceRecvData"; @@ -650,12 +651,22 @@ function createBaseClientState(): ClientState { return { sequence: BigInt(0), isFrozen: false, - consensusState: ConsensusState.fromPartial({}), + consensusState: undefined, allowUpdateAfterProposal: false }; } export const ClientState = { typeUrl: "/ibc.lightclients.solomachine.v2.ClientState", + aminoType: "cosmos-sdk/ClientState", + is(o: any): o is ClientState { + return o && (o.$typeUrl === ClientState.typeUrl || typeof o.sequence === "bigint" && typeof o.isFrozen === "boolean" && typeof o.allowUpdateAfterProposal === "boolean"); + }, + isSDK(o: any): o is ClientStateSDKType { + return o && (o.$typeUrl === ClientState.typeUrl || typeof o.sequence === "bigint" && typeof o.is_frozen === "boolean" && typeof o.allow_update_after_proposal === "boolean"); + }, + isAmino(o: any): o is ClientStateAmino { + return o && (o.$typeUrl === ClientState.typeUrl || typeof o.sequence === "bigint" && typeof o.is_frozen === "boolean" && typeof o.allow_update_after_proposal === "boolean"); + }, encode(message: ClientState, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.sequence !== BigInt(0)) { writer.uint32(8).uint64(message.sequence); @@ -697,6 +708,22 @@ export const ClientState = { } return message; }, + fromJSON(object: any): ClientState { + return { + sequence: isSet(object.sequence) ? BigInt(object.sequence.toString()) : BigInt(0), + isFrozen: isSet(object.isFrozen) ? Boolean(object.isFrozen) : false, + consensusState: isSet(object.consensusState) ? ConsensusState.fromJSON(object.consensusState) : undefined, + allowUpdateAfterProposal: isSet(object.allowUpdateAfterProposal) ? Boolean(object.allowUpdateAfterProposal) : false + }; + }, + toJSON(message: ClientState): unknown { + const obj: any = {}; + message.sequence !== undefined && (obj.sequence = (message.sequence || BigInt(0)).toString()); + message.isFrozen !== undefined && (obj.isFrozen = message.isFrozen); + message.consensusState !== undefined && (obj.consensusState = message.consensusState ? ConsensusState.toJSON(message.consensusState) : undefined); + message.allowUpdateAfterProposal !== undefined && (obj.allowUpdateAfterProposal = message.allowUpdateAfterProposal); + return obj; + }, fromPartial(object: Partial): ClientState { const message = createBaseClientState(); message.sequence = object.sequence !== undefined && object.sequence !== null ? BigInt(object.sequence.toString()) : BigInt(0); @@ -706,12 +733,20 @@ export const ClientState = { return message; }, fromAmino(object: ClientStateAmino): ClientState { - return { - sequence: BigInt(object.sequence), - isFrozen: object.is_frozen, - consensusState: object?.consensus_state ? ConsensusState.fromAmino(object.consensus_state) : undefined, - allowUpdateAfterProposal: object.allow_update_after_proposal - }; + const message = createBaseClientState(); + if (object.sequence !== undefined && object.sequence !== null) { + message.sequence = BigInt(object.sequence); + } + if (object.is_frozen !== undefined && object.is_frozen !== null) { + message.isFrozen = object.is_frozen; + } + if (object.consensus_state !== undefined && object.consensus_state !== null) { + message.consensusState = ConsensusState.fromAmino(object.consensus_state); + } + if (object.allow_update_after_proposal !== undefined && object.allow_update_after_proposal !== null) { + message.allowUpdateAfterProposal = object.allow_update_after_proposal; + } + return message; }, toAmino(message: ClientState): ClientStateAmino { const obj: any = {}; @@ -743,6 +778,8 @@ export const ClientState = { }; } }; +GlobalDecoderRegistry.register(ClientState.typeUrl, ClientState); +GlobalDecoderRegistry.registerAminoProtoMapping(ClientState.aminoType, ClientState.typeUrl); function createBaseConsensusState(): ConsensusState { return { publicKey: undefined, @@ -752,6 +789,16 @@ function createBaseConsensusState(): ConsensusState { } export const ConsensusState = { typeUrl: "/ibc.lightclients.solomachine.v2.ConsensusState", + aminoType: "cosmos-sdk/ConsensusState", + is(o: any): o is ConsensusState { + return o && (o.$typeUrl === ConsensusState.typeUrl || typeof o.diversifier === "string" && typeof o.timestamp === "bigint"); + }, + isSDK(o: any): o is ConsensusStateSDKType { + return o && (o.$typeUrl === ConsensusState.typeUrl || typeof o.diversifier === "string" && typeof o.timestamp === "bigint"); + }, + isAmino(o: any): o is ConsensusStateAmino { + return o && (o.$typeUrl === ConsensusState.typeUrl || typeof o.diversifier === "string" && typeof o.timestamp === "bigint"); + }, encode(message: ConsensusState, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.publicKey !== undefined) { Any.encode(message.publicKey, writer.uint32(10).fork()).ldelim(); @@ -787,6 +834,20 @@ export const ConsensusState = { } return message; }, + fromJSON(object: any): ConsensusState { + return { + publicKey: isSet(object.publicKey) ? Any.fromJSON(object.publicKey) : undefined, + diversifier: isSet(object.diversifier) ? String(object.diversifier) : "", + timestamp: isSet(object.timestamp) ? BigInt(object.timestamp.toString()) : BigInt(0) + }; + }, + toJSON(message: ConsensusState): unknown { + const obj: any = {}; + message.publicKey !== undefined && (obj.publicKey = message.publicKey ? Any.toJSON(message.publicKey) : undefined); + message.diversifier !== undefined && (obj.diversifier = message.diversifier); + message.timestamp !== undefined && (obj.timestamp = (message.timestamp || BigInt(0)).toString()); + return obj; + }, fromPartial(object: Partial): ConsensusState { const message = createBaseConsensusState(); message.publicKey = object.publicKey !== undefined && object.publicKey !== null ? Any.fromPartial(object.publicKey) : undefined; @@ -795,11 +856,17 @@ export const ConsensusState = { return message; }, fromAmino(object: ConsensusStateAmino): ConsensusState { - return { - publicKey: object?.public_key ? Any.fromAmino(object.public_key) : undefined, - diversifier: object.diversifier, - timestamp: BigInt(object.timestamp) - }; + const message = createBaseConsensusState(); + if (object.public_key !== undefined && object.public_key !== null) { + message.publicKey = Any.fromAmino(object.public_key); + } + if (object.diversifier !== undefined && object.diversifier !== null) { + message.diversifier = object.diversifier; + } + if (object.timestamp !== undefined && object.timestamp !== null) { + message.timestamp = BigInt(object.timestamp); + } + return message; }, toAmino(message: ConsensusState): ConsensusStateAmino { const obj: any = {}; @@ -830,6 +897,8 @@ export const ConsensusState = { }; } }; +GlobalDecoderRegistry.register(ConsensusState.typeUrl, ConsensusState); +GlobalDecoderRegistry.registerAminoProtoMapping(ConsensusState.aminoType, ConsensusState.typeUrl); function createBaseHeader(): Header { return { sequence: BigInt(0), @@ -841,6 +910,16 @@ function createBaseHeader(): Header { } export const Header = { typeUrl: "/ibc.lightclients.solomachine.v2.Header", + aminoType: "cosmos-sdk/Header", + is(o: any): o is Header { + return o && (o.$typeUrl === Header.typeUrl || typeof o.sequence === "bigint" && typeof o.timestamp === "bigint" && (o.signature instanceof Uint8Array || typeof o.signature === "string") && typeof o.newDiversifier === "string"); + }, + isSDK(o: any): o is HeaderSDKType { + return o && (o.$typeUrl === Header.typeUrl || typeof o.sequence === "bigint" && typeof o.timestamp === "bigint" && (o.signature instanceof Uint8Array || typeof o.signature === "string") && typeof o.new_diversifier === "string"); + }, + isAmino(o: any): o is HeaderAmino { + return o && (o.$typeUrl === Header.typeUrl || typeof o.sequence === "bigint" && typeof o.timestamp === "bigint" && (o.signature instanceof Uint8Array || typeof o.signature === "string") && typeof o.new_diversifier === "string"); + }, encode(message: Header, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.sequence !== BigInt(0)) { writer.uint32(8).uint64(message.sequence); @@ -888,6 +967,24 @@ export const Header = { } return message; }, + fromJSON(object: any): Header { + return { + sequence: isSet(object.sequence) ? BigInt(object.sequence.toString()) : BigInt(0), + timestamp: isSet(object.timestamp) ? BigInt(object.timestamp.toString()) : BigInt(0), + signature: isSet(object.signature) ? bytesFromBase64(object.signature) : new Uint8Array(), + newPublicKey: isSet(object.newPublicKey) ? Any.fromJSON(object.newPublicKey) : undefined, + newDiversifier: isSet(object.newDiversifier) ? String(object.newDiversifier) : "" + }; + }, + toJSON(message: Header): unknown { + const obj: any = {}; + message.sequence !== undefined && (obj.sequence = (message.sequence || BigInt(0)).toString()); + message.timestamp !== undefined && (obj.timestamp = (message.timestamp || BigInt(0)).toString()); + message.signature !== undefined && (obj.signature = base64FromBytes(message.signature !== undefined ? message.signature : new Uint8Array())); + message.newPublicKey !== undefined && (obj.newPublicKey = message.newPublicKey ? Any.toJSON(message.newPublicKey) : undefined); + message.newDiversifier !== undefined && (obj.newDiversifier = message.newDiversifier); + return obj; + }, fromPartial(object: Partial
): Header { const message = createBaseHeader(); message.sequence = object.sequence !== undefined && object.sequence !== null ? BigInt(object.sequence.toString()) : BigInt(0); @@ -898,19 +995,29 @@ export const Header = { return message; }, fromAmino(object: HeaderAmino): Header { - return { - sequence: BigInt(object.sequence), - timestamp: BigInt(object.timestamp), - signature: object.signature, - newPublicKey: object?.new_public_key ? Any.fromAmino(object.new_public_key) : undefined, - newDiversifier: object.new_diversifier - }; + const message = createBaseHeader(); + if (object.sequence !== undefined && object.sequence !== null) { + message.sequence = BigInt(object.sequence); + } + if (object.timestamp !== undefined && object.timestamp !== null) { + message.timestamp = BigInt(object.timestamp); + } + if (object.signature !== undefined && object.signature !== null) { + message.signature = bytesFromBase64(object.signature); + } + if (object.new_public_key !== undefined && object.new_public_key !== null) { + message.newPublicKey = Any.fromAmino(object.new_public_key); + } + if (object.new_diversifier !== undefined && object.new_diversifier !== null) { + message.newDiversifier = object.new_diversifier; + } + return message; }, toAmino(message: Header): HeaderAmino { const obj: any = {}; obj.sequence = message.sequence ? message.sequence.toString() : undefined; obj.timestamp = message.timestamp ? message.timestamp.toString() : undefined; - obj.signature = message.signature; + obj.signature = message.signature ? base64FromBytes(message.signature) : undefined; obj.new_public_key = message.newPublicKey ? Any.toAmino(message.newPublicKey) : undefined; obj.new_diversifier = message.newDiversifier; return obj; @@ -937,16 +1044,28 @@ export const Header = { }; } }; +GlobalDecoderRegistry.register(Header.typeUrl, Header); +GlobalDecoderRegistry.registerAminoProtoMapping(Header.aminoType, Header.typeUrl); function createBaseMisbehaviour(): Misbehaviour { return { clientId: "", sequence: BigInt(0), - signatureOne: SignatureAndData.fromPartial({}), - signatureTwo: SignatureAndData.fromPartial({}) + signatureOne: undefined, + signatureTwo: undefined }; } export const Misbehaviour = { typeUrl: "/ibc.lightclients.solomachine.v2.Misbehaviour", + aminoType: "cosmos-sdk/Misbehaviour", + is(o: any): o is Misbehaviour { + return o && (o.$typeUrl === Misbehaviour.typeUrl || typeof o.clientId === "string" && typeof o.sequence === "bigint"); + }, + isSDK(o: any): o is MisbehaviourSDKType { + return o && (o.$typeUrl === Misbehaviour.typeUrl || typeof o.client_id === "string" && typeof o.sequence === "bigint"); + }, + isAmino(o: any): o is MisbehaviourAmino { + return o && (o.$typeUrl === Misbehaviour.typeUrl || typeof o.client_id === "string" && typeof o.sequence === "bigint"); + }, encode(message: Misbehaviour, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.clientId !== "") { writer.uint32(10).string(message.clientId); @@ -988,6 +1107,22 @@ export const Misbehaviour = { } return message; }, + fromJSON(object: any): Misbehaviour { + return { + clientId: isSet(object.clientId) ? String(object.clientId) : "", + sequence: isSet(object.sequence) ? BigInt(object.sequence.toString()) : BigInt(0), + signatureOne: isSet(object.signatureOne) ? SignatureAndData.fromJSON(object.signatureOne) : undefined, + signatureTwo: isSet(object.signatureTwo) ? SignatureAndData.fromJSON(object.signatureTwo) : undefined + }; + }, + toJSON(message: Misbehaviour): unknown { + const obj: any = {}; + message.clientId !== undefined && (obj.clientId = message.clientId); + message.sequence !== undefined && (obj.sequence = (message.sequence || BigInt(0)).toString()); + message.signatureOne !== undefined && (obj.signatureOne = message.signatureOne ? SignatureAndData.toJSON(message.signatureOne) : undefined); + message.signatureTwo !== undefined && (obj.signatureTwo = message.signatureTwo ? SignatureAndData.toJSON(message.signatureTwo) : undefined); + return obj; + }, fromPartial(object: Partial): Misbehaviour { const message = createBaseMisbehaviour(); message.clientId = object.clientId ?? ""; @@ -997,12 +1132,20 @@ export const Misbehaviour = { return message; }, fromAmino(object: MisbehaviourAmino): Misbehaviour { - return { - clientId: object.client_id, - sequence: BigInt(object.sequence), - signatureOne: object?.signature_one ? SignatureAndData.fromAmino(object.signature_one) : undefined, - signatureTwo: object?.signature_two ? SignatureAndData.fromAmino(object.signature_two) : undefined - }; + const message = createBaseMisbehaviour(); + if (object.client_id !== undefined && object.client_id !== null) { + message.clientId = object.client_id; + } + if (object.sequence !== undefined && object.sequence !== null) { + message.sequence = BigInt(object.sequence); + } + if (object.signature_one !== undefined && object.signature_one !== null) { + message.signatureOne = SignatureAndData.fromAmino(object.signature_one); + } + if (object.signature_two !== undefined && object.signature_two !== null) { + message.signatureTwo = SignatureAndData.fromAmino(object.signature_two); + } + return message; }, toAmino(message: Misbehaviour): MisbehaviourAmino { const obj: any = {}; @@ -1034,6 +1177,8 @@ export const Misbehaviour = { }; } }; +GlobalDecoderRegistry.register(Misbehaviour.typeUrl, Misbehaviour); +GlobalDecoderRegistry.registerAminoProtoMapping(Misbehaviour.aminoType, Misbehaviour.typeUrl); function createBaseSignatureAndData(): SignatureAndData { return { signature: new Uint8Array(), @@ -1044,6 +1189,16 @@ function createBaseSignatureAndData(): SignatureAndData { } export const SignatureAndData = { typeUrl: "/ibc.lightclients.solomachine.v2.SignatureAndData", + aminoType: "cosmos-sdk/SignatureAndData", + is(o: any): o is SignatureAndData { + return o && (o.$typeUrl === SignatureAndData.typeUrl || (o.signature instanceof Uint8Array || typeof o.signature === "string") && isSet(o.dataType) && (o.data instanceof Uint8Array || typeof o.data === "string") && typeof o.timestamp === "bigint"); + }, + isSDK(o: any): o is SignatureAndDataSDKType { + return o && (o.$typeUrl === SignatureAndData.typeUrl || (o.signature instanceof Uint8Array || typeof o.signature === "string") && isSet(o.data_type) && (o.data instanceof Uint8Array || typeof o.data === "string") && typeof o.timestamp === "bigint"); + }, + isAmino(o: any): o is SignatureAndDataAmino { + return o && (o.$typeUrl === SignatureAndData.typeUrl || (o.signature instanceof Uint8Array || typeof o.signature === "string") && isSet(o.data_type) && (o.data instanceof Uint8Array || typeof o.data === "string") && typeof o.timestamp === "bigint"); + }, encode(message: SignatureAndData, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.signature.length !== 0) { writer.uint32(10).bytes(message.signature); @@ -1085,6 +1240,22 @@ export const SignatureAndData = { } return message; }, + fromJSON(object: any): SignatureAndData { + return { + signature: isSet(object.signature) ? bytesFromBase64(object.signature) : new Uint8Array(), + dataType: isSet(object.dataType) ? dataTypeFromJSON(object.dataType) : -1, + data: isSet(object.data) ? bytesFromBase64(object.data) : new Uint8Array(), + timestamp: isSet(object.timestamp) ? BigInt(object.timestamp.toString()) : BigInt(0) + }; + }, + toJSON(message: SignatureAndData): unknown { + const obj: any = {}; + message.signature !== undefined && (obj.signature = base64FromBytes(message.signature !== undefined ? message.signature : new Uint8Array())); + message.dataType !== undefined && (obj.dataType = dataTypeToJSON(message.dataType)); + message.data !== undefined && (obj.data = base64FromBytes(message.data !== undefined ? message.data : new Uint8Array())); + message.timestamp !== undefined && (obj.timestamp = (message.timestamp || BigInt(0)).toString()); + return obj; + }, fromPartial(object: Partial): SignatureAndData { const message = createBaseSignatureAndData(); message.signature = object.signature ?? new Uint8Array(); @@ -1094,18 +1265,26 @@ export const SignatureAndData = { return message; }, fromAmino(object: SignatureAndDataAmino): SignatureAndData { - return { - signature: object.signature, - dataType: isSet(object.data_type) ? dataTypeFromJSON(object.data_type) : -1, - data: object.data, - timestamp: BigInt(object.timestamp) - }; + const message = createBaseSignatureAndData(); + if (object.signature !== undefined && object.signature !== null) { + message.signature = bytesFromBase64(object.signature); + } + if (object.data_type !== undefined && object.data_type !== null) { + message.dataType = dataTypeFromJSON(object.data_type); + } + if (object.data !== undefined && object.data !== null) { + message.data = bytesFromBase64(object.data); + } + if (object.timestamp !== undefined && object.timestamp !== null) { + message.timestamp = BigInt(object.timestamp); + } + return message; }, toAmino(message: SignatureAndData): SignatureAndDataAmino { const obj: any = {}; - obj.signature = message.signature; - obj.data_type = message.dataType; - obj.data = message.data; + obj.signature = message.signature ? base64FromBytes(message.signature) : undefined; + obj.data_type = dataTypeToJSON(message.dataType); + obj.data = message.data ? base64FromBytes(message.data) : undefined; obj.timestamp = message.timestamp ? message.timestamp.toString() : undefined; return obj; }, @@ -1131,6 +1310,8 @@ export const SignatureAndData = { }; } }; +GlobalDecoderRegistry.register(SignatureAndData.typeUrl, SignatureAndData); +GlobalDecoderRegistry.registerAminoProtoMapping(SignatureAndData.aminoType, SignatureAndData.typeUrl); function createBaseTimestampedSignatureData(): TimestampedSignatureData { return { signatureData: new Uint8Array(), @@ -1139,6 +1320,16 @@ function createBaseTimestampedSignatureData(): TimestampedSignatureData { } export const TimestampedSignatureData = { typeUrl: "/ibc.lightclients.solomachine.v2.TimestampedSignatureData", + aminoType: "cosmos-sdk/TimestampedSignatureData", + is(o: any): o is TimestampedSignatureData { + return o && (o.$typeUrl === TimestampedSignatureData.typeUrl || (o.signatureData instanceof Uint8Array || typeof o.signatureData === "string") && typeof o.timestamp === "bigint"); + }, + isSDK(o: any): o is TimestampedSignatureDataSDKType { + return o && (o.$typeUrl === TimestampedSignatureData.typeUrl || (o.signature_data instanceof Uint8Array || typeof o.signature_data === "string") && typeof o.timestamp === "bigint"); + }, + isAmino(o: any): o is TimestampedSignatureDataAmino { + return o && (o.$typeUrl === TimestampedSignatureData.typeUrl || (o.signature_data instanceof Uint8Array || typeof o.signature_data === "string") && typeof o.timestamp === "bigint"); + }, encode(message: TimestampedSignatureData, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.signatureData.length !== 0) { writer.uint32(10).bytes(message.signatureData); @@ -1168,6 +1359,18 @@ export const TimestampedSignatureData = { } return message; }, + fromJSON(object: any): TimestampedSignatureData { + return { + signatureData: isSet(object.signatureData) ? bytesFromBase64(object.signatureData) : new Uint8Array(), + timestamp: isSet(object.timestamp) ? BigInt(object.timestamp.toString()) : BigInt(0) + }; + }, + toJSON(message: TimestampedSignatureData): unknown { + const obj: any = {}; + message.signatureData !== undefined && (obj.signatureData = base64FromBytes(message.signatureData !== undefined ? message.signatureData : new Uint8Array())); + message.timestamp !== undefined && (obj.timestamp = (message.timestamp || BigInt(0)).toString()); + return obj; + }, fromPartial(object: Partial): TimestampedSignatureData { const message = createBaseTimestampedSignatureData(); message.signatureData = object.signatureData ?? new Uint8Array(); @@ -1175,14 +1378,18 @@ export const TimestampedSignatureData = { return message; }, fromAmino(object: TimestampedSignatureDataAmino): TimestampedSignatureData { - return { - signatureData: object.signature_data, - timestamp: BigInt(object.timestamp) - }; + const message = createBaseTimestampedSignatureData(); + if (object.signature_data !== undefined && object.signature_data !== null) { + message.signatureData = bytesFromBase64(object.signature_data); + } + if (object.timestamp !== undefined && object.timestamp !== null) { + message.timestamp = BigInt(object.timestamp); + } + return message; }, toAmino(message: TimestampedSignatureData): TimestampedSignatureDataAmino { const obj: any = {}; - obj.signature_data = message.signatureData; + obj.signature_data = message.signatureData ? base64FromBytes(message.signatureData) : undefined; obj.timestamp = message.timestamp ? message.timestamp.toString() : undefined; return obj; }, @@ -1208,6 +1415,8 @@ export const TimestampedSignatureData = { }; } }; +GlobalDecoderRegistry.register(TimestampedSignatureData.typeUrl, TimestampedSignatureData); +GlobalDecoderRegistry.registerAminoProtoMapping(TimestampedSignatureData.aminoType, TimestampedSignatureData.typeUrl); function createBaseSignBytes(): SignBytes { return { sequence: BigInt(0), @@ -1219,6 +1428,16 @@ function createBaseSignBytes(): SignBytes { } export const SignBytes = { typeUrl: "/ibc.lightclients.solomachine.v2.SignBytes", + aminoType: "cosmos-sdk/SignBytes", + is(o: any): o is SignBytes { + return o && (o.$typeUrl === SignBytes.typeUrl || typeof o.sequence === "bigint" && typeof o.timestamp === "bigint" && typeof o.diversifier === "string" && isSet(o.dataType) && (o.data instanceof Uint8Array || typeof o.data === "string")); + }, + isSDK(o: any): o is SignBytesSDKType { + return o && (o.$typeUrl === SignBytes.typeUrl || typeof o.sequence === "bigint" && typeof o.timestamp === "bigint" && typeof o.diversifier === "string" && isSet(o.data_type) && (o.data instanceof Uint8Array || typeof o.data === "string")); + }, + isAmino(o: any): o is SignBytesAmino { + return o && (o.$typeUrl === SignBytes.typeUrl || typeof o.sequence === "bigint" && typeof o.timestamp === "bigint" && typeof o.diversifier === "string" && isSet(o.data_type) && (o.data instanceof Uint8Array || typeof o.data === "string")); + }, encode(message: SignBytes, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.sequence !== BigInt(0)) { writer.uint32(8).uint64(message.sequence); @@ -1266,6 +1485,24 @@ export const SignBytes = { } return message; }, + fromJSON(object: any): SignBytes { + return { + sequence: isSet(object.sequence) ? BigInt(object.sequence.toString()) : BigInt(0), + timestamp: isSet(object.timestamp) ? BigInt(object.timestamp.toString()) : BigInt(0), + diversifier: isSet(object.diversifier) ? String(object.diversifier) : "", + dataType: isSet(object.dataType) ? dataTypeFromJSON(object.dataType) : -1, + data: isSet(object.data) ? bytesFromBase64(object.data) : new Uint8Array() + }; + }, + toJSON(message: SignBytes): unknown { + const obj: any = {}; + message.sequence !== undefined && (obj.sequence = (message.sequence || BigInt(0)).toString()); + message.timestamp !== undefined && (obj.timestamp = (message.timestamp || BigInt(0)).toString()); + message.diversifier !== undefined && (obj.diversifier = message.diversifier); + message.dataType !== undefined && (obj.dataType = dataTypeToJSON(message.dataType)); + message.data !== undefined && (obj.data = base64FromBytes(message.data !== undefined ? message.data : new Uint8Array())); + return obj; + }, fromPartial(object: Partial): SignBytes { const message = createBaseSignBytes(); message.sequence = object.sequence !== undefined && object.sequence !== null ? BigInt(object.sequence.toString()) : BigInt(0); @@ -1276,21 +1513,31 @@ export const SignBytes = { return message; }, fromAmino(object: SignBytesAmino): SignBytes { - return { - sequence: BigInt(object.sequence), - timestamp: BigInt(object.timestamp), - diversifier: object.diversifier, - dataType: isSet(object.data_type) ? dataTypeFromJSON(object.data_type) : -1, - data: object.data - }; + const message = createBaseSignBytes(); + if (object.sequence !== undefined && object.sequence !== null) { + message.sequence = BigInt(object.sequence); + } + if (object.timestamp !== undefined && object.timestamp !== null) { + message.timestamp = BigInt(object.timestamp); + } + if (object.diversifier !== undefined && object.diversifier !== null) { + message.diversifier = object.diversifier; + } + if (object.data_type !== undefined && object.data_type !== null) { + message.dataType = dataTypeFromJSON(object.data_type); + } + if (object.data !== undefined && object.data !== null) { + message.data = bytesFromBase64(object.data); + } + return message; }, toAmino(message: SignBytes): SignBytesAmino { const obj: any = {}; obj.sequence = message.sequence ? message.sequence.toString() : undefined; obj.timestamp = message.timestamp ? message.timestamp.toString() : undefined; obj.diversifier = message.diversifier; - obj.data_type = message.dataType; - obj.data = message.data; + obj.data_type = dataTypeToJSON(message.dataType); + obj.data = message.data ? base64FromBytes(message.data) : undefined; return obj; }, fromAminoMsg(object: SignBytesAminoMsg): SignBytes { @@ -1315,6 +1562,8 @@ export const SignBytes = { }; } }; +GlobalDecoderRegistry.register(SignBytes.typeUrl, SignBytes); +GlobalDecoderRegistry.registerAminoProtoMapping(SignBytes.aminoType, SignBytes.typeUrl); function createBaseHeaderData(): HeaderData { return { newPubKey: undefined, @@ -1323,6 +1572,16 @@ function createBaseHeaderData(): HeaderData { } export const HeaderData = { typeUrl: "/ibc.lightclients.solomachine.v2.HeaderData", + aminoType: "cosmos-sdk/HeaderData", + is(o: any): o is HeaderData { + return o && (o.$typeUrl === HeaderData.typeUrl || typeof o.newDiversifier === "string"); + }, + isSDK(o: any): o is HeaderDataSDKType { + return o && (o.$typeUrl === HeaderData.typeUrl || typeof o.new_diversifier === "string"); + }, + isAmino(o: any): o is HeaderDataAmino { + return o && (o.$typeUrl === HeaderData.typeUrl || typeof o.new_diversifier === "string"); + }, encode(message: HeaderData, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.newPubKey !== undefined) { Any.encode(message.newPubKey, writer.uint32(10).fork()).ldelim(); @@ -1352,6 +1611,18 @@ export const HeaderData = { } return message; }, + fromJSON(object: any): HeaderData { + return { + newPubKey: isSet(object.newPubKey) ? Any.fromJSON(object.newPubKey) : undefined, + newDiversifier: isSet(object.newDiversifier) ? String(object.newDiversifier) : "" + }; + }, + toJSON(message: HeaderData): unknown { + const obj: any = {}; + message.newPubKey !== undefined && (obj.newPubKey = message.newPubKey ? Any.toJSON(message.newPubKey) : undefined); + message.newDiversifier !== undefined && (obj.newDiversifier = message.newDiversifier); + return obj; + }, fromPartial(object: Partial): HeaderData { const message = createBaseHeaderData(); message.newPubKey = object.newPubKey !== undefined && object.newPubKey !== null ? Any.fromPartial(object.newPubKey) : undefined; @@ -1359,10 +1630,14 @@ export const HeaderData = { return message; }, fromAmino(object: HeaderDataAmino): HeaderData { - return { - newPubKey: object?.new_pub_key ? Any.fromAmino(object.new_pub_key) : undefined, - newDiversifier: object.new_diversifier - }; + const message = createBaseHeaderData(); + if (object.new_pub_key !== undefined && object.new_pub_key !== null) { + message.newPubKey = Any.fromAmino(object.new_pub_key); + } + if (object.new_diversifier !== undefined && object.new_diversifier !== null) { + message.newDiversifier = object.new_diversifier; + } + return message; }, toAmino(message: HeaderData): HeaderDataAmino { const obj: any = {}; @@ -1392,6 +1667,8 @@ export const HeaderData = { }; } }; +GlobalDecoderRegistry.register(HeaderData.typeUrl, HeaderData); +GlobalDecoderRegistry.registerAminoProtoMapping(HeaderData.aminoType, HeaderData.typeUrl); function createBaseClientStateData(): ClientStateData { return { path: new Uint8Array(), @@ -1400,6 +1677,16 @@ function createBaseClientStateData(): ClientStateData { } export const ClientStateData = { typeUrl: "/ibc.lightclients.solomachine.v2.ClientStateData", + aminoType: "cosmos-sdk/ClientStateData", + is(o: any): o is ClientStateData { + return o && (o.$typeUrl === ClientStateData.typeUrl || o.path instanceof Uint8Array || typeof o.path === "string"); + }, + isSDK(o: any): o is ClientStateDataSDKType { + return o && (o.$typeUrl === ClientStateData.typeUrl || o.path instanceof Uint8Array || typeof o.path === "string"); + }, + isAmino(o: any): o is ClientStateDataAmino { + return o && (o.$typeUrl === ClientStateData.typeUrl || o.path instanceof Uint8Array || typeof o.path === "string"); + }, encode(message: ClientStateData, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.path.length !== 0) { writer.uint32(10).bytes(message.path); @@ -1429,6 +1716,18 @@ export const ClientStateData = { } return message; }, + fromJSON(object: any): ClientStateData { + return { + path: isSet(object.path) ? bytesFromBase64(object.path) : new Uint8Array(), + clientState: isSet(object.clientState) ? Any.fromJSON(object.clientState) : undefined + }; + }, + toJSON(message: ClientStateData): unknown { + const obj: any = {}; + message.path !== undefined && (obj.path = base64FromBytes(message.path !== undefined ? message.path : new Uint8Array())); + message.clientState !== undefined && (obj.clientState = message.clientState ? Any.toJSON(message.clientState) : undefined); + return obj; + }, fromPartial(object: Partial): ClientStateData { const message = createBaseClientStateData(); message.path = object.path ?? new Uint8Array(); @@ -1436,14 +1735,18 @@ export const ClientStateData = { return message; }, fromAmino(object: ClientStateDataAmino): ClientStateData { - return { - path: object.path, - clientState: object?.client_state ? Any.fromAmino(object.client_state) : undefined - }; + const message = createBaseClientStateData(); + if (object.path !== undefined && object.path !== null) { + message.path = bytesFromBase64(object.path); + } + if (object.client_state !== undefined && object.client_state !== null) { + message.clientState = Any.fromAmino(object.client_state); + } + return message; }, toAmino(message: ClientStateData): ClientStateDataAmino { const obj: any = {}; - obj.path = message.path; + obj.path = message.path ? base64FromBytes(message.path) : undefined; obj.client_state = message.clientState ? Any.toAmino(message.clientState) : undefined; return obj; }, @@ -1469,6 +1772,8 @@ export const ClientStateData = { }; } }; +GlobalDecoderRegistry.register(ClientStateData.typeUrl, ClientStateData); +GlobalDecoderRegistry.registerAminoProtoMapping(ClientStateData.aminoType, ClientStateData.typeUrl); function createBaseConsensusStateData(): ConsensusStateData { return { path: new Uint8Array(), @@ -1477,6 +1782,16 @@ function createBaseConsensusStateData(): ConsensusStateData { } export const ConsensusStateData = { typeUrl: "/ibc.lightclients.solomachine.v2.ConsensusStateData", + aminoType: "cosmos-sdk/ConsensusStateData", + is(o: any): o is ConsensusStateData { + return o && (o.$typeUrl === ConsensusStateData.typeUrl || o.path instanceof Uint8Array || typeof o.path === "string"); + }, + isSDK(o: any): o is ConsensusStateDataSDKType { + return o && (o.$typeUrl === ConsensusStateData.typeUrl || o.path instanceof Uint8Array || typeof o.path === "string"); + }, + isAmino(o: any): o is ConsensusStateDataAmino { + return o && (o.$typeUrl === ConsensusStateData.typeUrl || o.path instanceof Uint8Array || typeof o.path === "string"); + }, encode(message: ConsensusStateData, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.path.length !== 0) { writer.uint32(10).bytes(message.path); @@ -1506,6 +1821,18 @@ export const ConsensusStateData = { } return message; }, + fromJSON(object: any): ConsensusStateData { + return { + path: isSet(object.path) ? bytesFromBase64(object.path) : new Uint8Array(), + consensusState: isSet(object.consensusState) ? Any.fromJSON(object.consensusState) : undefined + }; + }, + toJSON(message: ConsensusStateData): unknown { + const obj: any = {}; + message.path !== undefined && (obj.path = base64FromBytes(message.path !== undefined ? message.path : new Uint8Array())); + message.consensusState !== undefined && (obj.consensusState = message.consensusState ? Any.toJSON(message.consensusState) : undefined); + return obj; + }, fromPartial(object: Partial): ConsensusStateData { const message = createBaseConsensusStateData(); message.path = object.path ?? new Uint8Array(); @@ -1513,14 +1840,18 @@ export const ConsensusStateData = { return message; }, fromAmino(object: ConsensusStateDataAmino): ConsensusStateData { - return { - path: object.path, - consensusState: object?.consensus_state ? Any.fromAmino(object.consensus_state) : undefined - }; + const message = createBaseConsensusStateData(); + if (object.path !== undefined && object.path !== null) { + message.path = bytesFromBase64(object.path); + } + if (object.consensus_state !== undefined && object.consensus_state !== null) { + message.consensusState = Any.fromAmino(object.consensus_state); + } + return message; }, toAmino(message: ConsensusStateData): ConsensusStateDataAmino { const obj: any = {}; - obj.path = message.path; + obj.path = message.path ? base64FromBytes(message.path) : undefined; obj.consensus_state = message.consensusState ? Any.toAmino(message.consensusState) : undefined; return obj; }, @@ -1546,14 +1877,26 @@ export const ConsensusStateData = { }; } }; +GlobalDecoderRegistry.register(ConsensusStateData.typeUrl, ConsensusStateData); +GlobalDecoderRegistry.registerAminoProtoMapping(ConsensusStateData.aminoType, ConsensusStateData.typeUrl); function createBaseConnectionStateData(): ConnectionStateData { return { path: new Uint8Array(), - connection: ConnectionEnd.fromPartial({}) + connection: undefined }; } export const ConnectionStateData = { typeUrl: "/ibc.lightclients.solomachine.v2.ConnectionStateData", + aminoType: "cosmos-sdk/ConnectionStateData", + is(o: any): o is ConnectionStateData { + return o && (o.$typeUrl === ConnectionStateData.typeUrl || o.path instanceof Uint8Array || typeof o.path === "string"); + }, + isSDK(o: any): o is ConnectionStateDataSDKType { + return o && (o.$typeUrl === ConnectionStateData.typeUrl || o.path instanceof Uint8Array || typeof o.path === "string"); + }, + isAmino(o: any): o is ConnectionStateDataAmino { + return o && (o.$typeUrl === ConnectionStateData.typeUrl || o.path instanceof Uint8Array || typeof o.path === "string"); + }, encode(message: ConnectionStateData, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.path.length !== 0) { writer.uint32(10).bytes(message.path); @@ -1583,6 +1926,18 @@ export const ConnectionStateData = { } return message; }, + fromJSON(object: any): ConnectionStateData { + return { + path: isSet(object.path) ? bytesFromBase64(object.path) : new Uint8Array(), + connection: isSet(object.connection) ? ConnectionEnd.fromJSON(object.connection) : undefined + }; + }, + toJSON(message: ConnectionStateData): unknown { + const obj: any = {}; + message.path !== undefined && (obj.path = base64FromBytes(message.path !== undefined ? message.path : new Uint8Array())); + message.connection !== undefined && (obj.connection = message.connection ? ConnectionEnd.toJSON(message.connection) : undefined); + return obj; + }, fromPartial(object: Partial): ConnectionStateData { const message = createBaseConnectionStateData(); message.path = object.path ?? new Uint8Array(); @@ -1590,14 +1945,18 @@ export const ConnectionStateData = { return message; }, fromAmino(object: ConnectionStateDataAmino): ConnectionStateData { - return { - path: object.path, - connection: object?.connection ? ConnectionEnd.fromAmino(object.connection) : undefined - }; + const message = createBaseConnectionStateData(); + if (object.path !== undefined && object.path !== null) { + message.path = bytesFromBase64(object.path); + } + if (object.connection !== undefined && object.connection !== null) { + message.connection = ConnectionEnd.fromAmino(object.connection); + } + return message; }, toAmino(message: ConnectionStateData): ConnectionStateDataAmino { const obj: any = {}; - obj.path = message.path; + obj.path = message.path ? base64FromBytes(message.path) : undefined; obj.connection = message.connection ? ConnectionEnd.toAmino(message.connection) : undefined; return obj; }, @@ -1623,14 +1982,26 @@ export const ConnectionStateData = { }; } }; +GlobalDecoderRegistry.register(ConnectionStateData.typeUrl, ConnectionStateData); +GlobalDecoderRegistry.registerAminoProtoMapping(ConnectionStateData.aminoType, ConnectionStateData.typeUrl); function createBaseChannelStateData(): ChannelStateData { return { path: new Uint8Array(), - channel: Channel.fromPartial({}) + channel: undefined }; } export const ChannelStateData = { typeUrl: "/ibc.lightclients.solomachine.v2.ChannelStateData", + aminoType: "cosmos-sdk/ChannelStateData", + is(o: any): o is ChannelStateData { + return o && (o.$typeUrl === ChannelStateData.typeUrl || o.path instanceof Uint8Array || typeof o.path === "string"); + }, + isSDK(o: any): o is ChannelStateDataSDKType { + return o && (o.$typeUrl === ChannelStateData.typeUrl || o.path instanceof Uint8Array || typeof o.path === "string"); + }, + isAmino(o: any): o is ChannelStateDataAmino { + return o && (o.$typeUrl === ChannelStateData.typeUrl || o.path instanceof Uint8Array || typeof o.path === "string"); + }, encode(message: ChannelStateData, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.path.length !== 0) { writer.uint32(10).bytes(message.path); @@ -1660,6 +2031,18 @@ export const ChannelStateData = { } return message; }, + fromJSON(object: any): ChannelStateData { + return { + path: isSet(object.path) ? bytesFromBase64(object.path) : new Uint8Array(), + channel: isSet(object.channel) ? Channel.fromJSON(object.channel) : undefined + }; + }, + toJSON(message: ChannelStateData): unknown { + const obj: any = {}; + message.path !== undefined && (obj.path = base64FromBytes(message.path !== undefined ? message.path : new Uint8Array())); + message.channel !== undefined && (obj.channel = message.channel ? Channel.toJSON(message.channel) : undefined); + return obj; + }, fromPartial(object: Partial): ChannelStateData { const message = createBaseChannelStateData(); message.path = object.path ?? new Uint8Array(); @@ -1667,14 +2050,18 @@ export const ChannelStateData = { return message; }, fromAmino(object: ChannelStateDataAmino): ChannelStateData { - return { - path: object.path, - channel: object?.channel ? Channel.fromAmino(object.channel) : undefined - }; + const message = createBaseChannelStateData(); + if (object.path !== undefined && object.path !== null) { + message.path = bytesFromBase64(object.path); + } + if (object.channel !== undefined && object.channel !== null) { + message.channel = Channel.fromAmino(object.channel); + } + return message; }, toAmino(message: ChannelStateData): ChannelStateDataAmino { const obj: any = {}; - obj.path = message.path; + obj.path = message.path ? base64FromBytes(message.path) : undefined; obj.channel = message.channel ? Channel.toAmino(message.channel) : undefined; return obj; }, @@ -1700,6 +2087,8 @@ export const ChannelStateData = { }; } }; +GlobalDecoderRegistry.register(ChannelStateData.typeUrl, ChannelStateData); +GlobalDecoderRegistry.registerAminoProtoMapping(ChannelStateData.aminoType, ChannelStateData.typeUrl); function createBasePacketCommitmentData(): PacketCommitmentData { return { path: new Uint8Array(), @@ -1708,6 +2097,16 @@ function createBasePacketCommitmentData(): PacketCommitmentData { } export const PacketCommitmentData = { typeUrl: "/ibc.lightclients.solomachine.v2.PacketCommitmentData", + aminoType: "cosmos-sdk/PacketCommitmentData", + is(o: any): o is PacketCommitmentData { + return o && (o.$typeUrl === PacketCommitmentData.typeUrl || (o.path instanceof Uint8Array || typeof o.path === "string") && (o.commitment instanceof Uint8Array || typeof o.commitment === "string")); + }, + isSDK(o: any): o is PacketCommitmentDataSDKType { + return o && (o.$typeUrl === PacketCommitmentData.typeUrl || (o.path instanceof Uint8Array || typeof o.path === "string") && (o.commitment instanceof Uint8Array || typeof o.commitment === "string")); + }, + isAmino(o: any): o is PacketCommitmentDataAmino { + return o && (o.$typeUrl === PacketCommitmentData.typeUrl || (o.path instanceof Uint8Array || typeof o.path === "string") && (o.commitment instanceof Uint8Array || typeof o.commitment === "string")); + }, encode(message: PacketCommitmentData, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.path.length !== 0) { writer.uint32(10).bytes(message.path); @@ -1737,6 +2136,18 @@ export const PacketCommitmentData = { } return message; }, + fromJSON(object: any): PacketCommitmentData { + return { + path: isSet(object.path) ? bytesFromBase64(object.path) : new Uint8Array(), + commitment: isSet(object.commitment) ? bytesFromBase64(object.commitment) : new Uint8Array() + }; + }, + toJSON(message: PacketCommitmentData): unknown { + const obj: any = {}; + message.path !== undefined && (obj.path = base64FromBytes(message.path !== undefined ? message.path : new Uint8Array())); + message.commitment !== undefined && (obj.commitment = base64FromBytes(message.commitment !== undefined ? message.commitment : new Uint8Array())); + return obj; + }, fromPartial(object: Partial): PacketCommitmentData { const message = createBasePacketCommitmentData(); message.path = object.path ?? new Uint8Array(); @@ -1744,15 +2155,19 @@ export const PacketCommitmentData = { return message; }, fromAmino(object: PacketCommitmentDataAmino): PacketCommitmentData { - return { - path: object.path, - commitment: object.commitment - }; + const message = createBasePacketCommitmentData(); + if (object.path !== undefined && object.path !== null) { + message.path = bytesFromBase64(object.path); + } + if (object.commitment !== undefined && object.commitment !== null) { + message.commitment = bytesFromBase64(object.commitment); + } + return message; }, toAmino(message: PacketCommitmentData): PacketCommitmentDataAmino { const obj: any = {}; - obj.path = message.path; - obj.commitment = message.commitment; + obj.path = message.path ? base64FromBytes(message.path) : undefined; + obj.commitment = message.commitment ? base64FromBytes(message.commitment) : undefined; return obj; }, fromAminoMsg(object: PacketCommitmentDataAminoMsg): PacketCommitmentData { @@ -1777,6 +2192,8 @@ export const PacketCommitmentData = { }; } }; +GlobalDecoderRegistry.register(PacketCommitmentData.typeUrl, PacketCommitmentData); +GlobalDecoderRegistry.registerAminoProtoMapping(PacketCommitmentData.aminoType, PacketCommitmentData.typeUrl); function createBasePacketAcknowledgementData(): PacketAcknowledgementData { return { path: new Uint8Array(), @@ -1785,6 +2202,16 @@ function createBasePacketAcknowledgementData(): PacketAcknowledgementData { } export const PacketAcknowledgementData = { typeUrl: "/ibc.lightclients.solomachine.v2.PacketAcknowledgementData", + aminoType: "cosmos-sdk/PacketAcknowledgementData", + is(o: any): o is PacketAcknowledgementData { + return o && (o.$typeUrl === PacketAcknowledgementData.typeUrl || (o.path instanceof Uint8Array || typeof o.path === "string") && (o.acknowledgement instanceof Uint8Array || typeof o.acknowledgement === "string")); + }, + isSDK(o: any): o is PacketAcknowledgementDataSDKType { + return o && (o.$typeUrl === PacketAcknowledgementData.typeUrl || (o.path instanceof Uint8Array || typeof o.path === "string") && (o.acknowledgement instanceof Uint8Array || typeof o.acknowledgement === "string")); + }, + isAmino(o: any): o is PacketAcknowledgementDataAmino { + return o && (o.$typeUrl === PacketAcknowledgementData.typeUrl || (o.path instanceof Uint8Array || typeof o.path === "string") && (o.acknowledgement instanceof Uint8Array || typeof o.acknowledgement === "string")); + }, encode(message: PacketAcknowledgementData, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.path.length !== 0) { writer.uint32(10).bytes(message.path); @@ -1814,6 +2241,18 @@ export const PacketAcknowledgementData = { } return message; }, + fromJSON(object: any): PacketAcknowledgementData { + return { + path: isSet(object.path) ? bytesFromBase64(object.path) : new Uint8Array(), + acknowledgement: isSet(object.acknowledgement) ? bytesFromBase64(object.acknowledgement) : new Uint8Array() + }; + }, + toJSON(message: PacketAcknowledgementData): unknown { + const obj: any = {}; + message.path !== undefined && (obj.path = base64FromBytes(message.path !== undefined ? message.path : new Uint8Array())); + message.acknowledgement !== undefined && (obj.acknowledgement = base64FromBytes(message.acknowledgement !== undefined ? message.acknowledgement : new Uint8Array())); + return obj; + }, fromPartial(object: Partial): PacketAcknowledgementData { const message = createBasePacketAcknowledgementData(); message.path = object.path ?? new Uint8Array(); @@ -1821,15 +2260,19 @@ export const PacketAcknowledgementData = { return message; }, fromAmino(object: PacketAcknowledgementDataAmino): PacketAcknowledgementData { - return { - path: object.path, - acknowledgement: object.acknowledgement - }; + const message = createBasePacketAcknowledgementData(); + if (object.path !== undefined && object.path !== null) { + message.path = bytesFromBase64(object.path); + } + if (object.acknowledgement !== undefined && object.acknowledgement !== null) { + message.acknowledgement = bytesFromBase64(object.acknowledgement); + } + return message; }, toAmino(message: PacketAcknowledgementData): PacketAcknowledgementDataAmino { const obj: any = {}; - obj.path = message.path; - obj.acknowledgement = message.acknowledgement; + obj.path = message.path ? base64FromBytes(message.path) : undefined; + obj.acknowledgement = message.acknowledgement ? base64FromBytes(message.acknowledgement) : undefined; return obj; }, fromAminoMsg(object: PacketAcknowledgementDataAminoMsg): PacketAcknowledgementData { @@ -1854,6 +2297,8 @@ export const PacketAcknowledgementData = { }; } }; +GlobalDecoderRegistry.register(PacketAcknowledgementData.typeUrl, PacketAcknowledgementData); +GlobalDecoderRegistry.registerAminoProtoMapping(PacketAcknowledgementData.aminoType, PacketAcknowledgementData.typeUrl); function createBasePacketReceiptAbsenceData(): PacketReceiptAbsenceData { return { path: new Uint8Array() @@ -1861,6 +2306,16 @@ function createBasePacketReceiptAbsenceData(): PacketReceiptAbsenceData { } export const PacketReceiptAbsenceData = { typeUrl: "/ibc.lightclients.solomachine.v2.PacketReceiptAbsenceData", + aminoType: "cosmos-sdk/PacketReceiptAbsenceData", + is(o: any): o is PacketReceiptAbsenceData { + return o && (o.$typeUrl === PacketReceiptAbsenceData.typeUrl || o.path instanceof Uint8Array || typeof o.path === "string"); + }, + isSDK(o: any): o is PacketReceiptAbsenceDataSDKType { + return o && (o.$typeUrl === PacketReceiptAbsenceData.typeUrl || o.path instanceof Uint8Array || typeof o.path === "string"); + }, + isAmino(o: any): o is PacketReceiptAbsenceDataAmino { + return o && (o.$typeUrl === PacketReceiptAbsenceData.typeUrl || o.path instanceof Uint8Array || typeof o.path === "string"); + }, encode(message: PacketReceiptAbsenceData, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.path.length !== 0) { writer.uint32(10).bytes(message.path); @@ -1884,19 +2339,31 @@ export const PacketReceiptAbsenceData = { } return message; }, + fromJSON(object: any): PacketReceiptAbsenceData { + return { + path: isSet(object.path) ? bytesFromBase64(object.path) : new Uint8Array() + }; + }, + toJSON(message: PacketReceiptAbsenceData): unknown { + const obj: any = {}; + message.path !== undefined && (obj.path = base64FromBytes(message.path !== undefined ? message.path : new Uint8Array())); + return obj; + }, fromPartial(object: Partial): PacketReceiptAbsenceData { const message = createBasePacketReceiptAbsenceData(); message.path = object.path ?? new Uint8Array(); return message; }, fromAmino(object: PacketReceiptAbsenceDataAmino): PacketReceiptAbsenceData { - return { - path: object.path - }; + const message = createBasePacketReceiptAbsenceData(); + if (object.path !== undefined && object.path !== null) { + message.path = bytesFromBase64(object.path); + } + return message; }, toAmino(message: PacketReceiptAbsenceData): PacketReceiptAbsenceDataAmino { const obj: any = {}; - obj.path = message.path; + obj.path = message.path ? base64FromBytes(message.path) : undefined; return obj; }, fromAminoMsg(object: PacketReceiptAbsenceDataAminoMsg): PacketReceiptAbsenceData { @@ -1921,6 +2388,8 @@ export const PacketReceiptAbsenceData = { }; } }; +GlobalDecoderRegistry.register(PacketReceiptAbsenceData.typeUrl, PacketReceiptAbsenceData); +GlobalDecoderRegistry.registerAminoProtoMapping(PacketReceiptAbsenceData.aminoType, PacketReceiptAbsenceData.typeUrl); function createBaseNextSequenceRecvData(): NextSequenceRecvData { return { path: new Uint8Array(), @@ -1929,6 +2398,16 @@ function createBaseNextSequenceRecvData(): NextSequenceRecvData { } export const NextSequenceRecvData = { typeUrl: "/ibc.lightclients.solomachine.v2.NextSequenceRecvData", + aminoType: "cosmos-sdk/NextSequenceRecvData", + is(o: any): o is NextSequenceRecvData { + return o && (o.$typeUrl === NextSequenceRecvData.typeUrl || (o.path instanceof Uint8Array || typeof o.path === "string") && typeof o.nextSeqRecv === "bigint"); + }, + isSDK(o: any): o is NextSequenceRecvDataSDKType { + return o && (o.$typeUrl === NextSequenceRecvData.typeUrl || (o.path instanceof Uint8Array || typeof o.path === "string") && typeof o.next_seq_recv === "bigint"); + }, + isAmino(o: any): o is NextSequenceRecvDataAmino { + return o && (o.$typeUrl === NextSequenceRecvData.typeUrl || (o.path instanceof Uint8Array || typeof o.path === "string") && typeof o.next_seq_recv === "bigint"); + }, encode(message: NextSequenceRecvData, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.path.length !== 0) { writer.uint32(10).bytes(message.path); @@ -1958,6 +2437,18 @@ export const NextSequenceRecvData = { } return message; }, + fromJSON(object: any): NextSequenceRecvData { + return { + path: isSet(object.path) ? bytesFromBase64(object.path) : new Uint8Array(), + nextSeqRecv: isSet(object.nextSeqRecv) ? BigInt(object.nextSeqRecv.toString()) : BigInt(0) + }; + }, + toJSON(message: NextSequenceRecvData): unknown { + const obj: any = {}; + message.path !== undefined && (obj.path = base64FromBytes(message.path !== undefined ? message.path : new Uint8Array())); + message.nextSeqRecv !== undefined && (obj.nextSeqRecv = (message.nextSeqRecv || BigInt(0)).toString()); + return obj; + }, fromPartial(object: Partial): NextSequenceRecvData { const message = createBaseNextSequenceRecvData(); message.path = object.path ?? new Uint8Array(); @@ -1965,14 +2456,18 @@ export const NextSequenceRecvData = { return message; }, fromAmino(object: NextSequenceRecvDataAmino): NextSequenceRecvData { - return { - path: object.path, - nextSeqRecv: BigInt(object.next_seq_recv) - }; + const message = createBaseNextSequenceRecvData(); + if (object.path !== undefined && object.path !== null) { + message.path = bytesFromBase64(object.path); + } + if (object.next_seq_recv !== undefined && object.next_seq_recv !== null) { + message.nextSeqRecv = BigInt(object.next_seq_recv); + } + return message; }, toAmino(message: NextSequenceRecvData): NextSequenceRecvDataAmino { const obj: any = {}; - obj.path = message.path; + obj.path = message.path ? base64FromBytes(message.path) : undefined; obj.next_seq_recv = message.nextSeqRecv ? message.nextSeqRecv.toString() : undefined; return obj; }, @@ -1997,4 +2492,6 @@ export const NextSequenceRecvData = { value: NextSequenceRecvData.encode(message).finish() }; } -}; \ No newline at end of file +}; +GlobalDecoderRegistry.register(NextSequenceRecvData.typeUrl, NextSequenceRecvData); +GlobalDecoderRegistry.registerAminoProtoMapping(NextSequenceRecvData.aminoType, NextSequenceRecvData.typeUrl); \ No newline at end of file diff --git a/packages/osmojs/src/codegen/ibc/lightclients/solomachine/v3/solomachine.ts b/packages/osmojs/src/codegen/ibc/lightclients/solomachine/v3/solomachine.ts index 51a5b97e8..db4072ed3 100644 --- a/packages/osmojs/src/codegen/ibc/lightclients/solomachine/v3/solomachine.ts +++ b/packages/osmojs/src/codegen/ibc/lightclients/solomachine/v3/solomachine.ts @@ -1,5 +1,7 @@ import { Any, AnyAmino, AnySDKType } from "../../../../google/protobuf/any"; import { BinaryReader, BinaryWriter } from "../../../../binary"; +import { isSet, bytesFromBase64, base64FromBytes } from "../../../../helpers"; +import { GlobalDecoderRegistry } from "../../../../registry"; /** * ClientState defines a solo machine client that tracks the current consensus * state and if the client is frozen. @@ -9,7 +11,7 @@ export interface ClientState { sequence: bigint; /** frozen sequence of the solo machine */ isFrozen: boolean; - consensusState: ConsensusState; + consensusState?: ConsensusState; } export interface ClientStateProtoMsg { typeUrl: "/ibc.lightclients.solomachine.v3.ClientState"; @@ -21,9 +23,9 @@ export interface ClientStateProtoMsg { */ export interface ClientStateAmino { /** latest sequence of the client state */ - sequence: string; + sequence?: string; /** frozen sequence of the solo machine */ - is_frozen: boolean; + is_frozen?: boolean; consensus_state?: ConsensusStateAmino; } export interface ClientStateAminoMsg { @@ -37,7 +39,7 @@ export interface ClientStateAminoMsg { export interface ClientStateSDKType { sequence: bigint; is_frozen: boolean; - consensus_state: ConsensusStateSDKType; + consensus_state?: ConsensusStateSDKType; } /** * ConsensusState defines a solo machine consensus state. The sequence of a @@ -46,7 +48,7 @@ export interface ClientStateSDKType { */ export interface ConsensusState { /** public key of the solo machine */ - publicKey: Any; + publicKey?: Any; /** * diversifier allows the same public key to be re-used across different solo * machine clients (potentially on different chains) without being considered @@ -72,8 +74,8 @@ export interface ConsensusStateAmino { * machine clients (potentially on different chains) without being considered * misbehaviour. */ - diversifier: string; - timestamp: string; + diversifier?: string; + timestamp?: string; } export interface ConsensusStateAminoMsg { type: "cosmos-sdk/ConsensusState"; @@ -85,7 +87,7 @@ export interface ConsensusStateAminoMsg { * consensus state. */ export interface ConsensusStateSDKType { - public_key: AnySDKType; + public_key?: AnySDKType; diversifier: string; timestamp: bigint; } @@ -93,7 +95,7 @@ export interface ConsensusStateSDKType { export interface Header { timestamp: bigint; signature: Uint8Array; - newPublicKey: Any; + newPublicKey?: Any; newDiversifier: string; } export interface HeaderProtoMsg { @@ -102,10 +104,10 @@ export interface HeaderProtoMsg { } /** Header defines a solo machine consensus header */ export interface HeaderAmino { - timestamp: string; - signature: Uint8Array; + timestamp?: string; + signature?: string; new_public_key?: AnyAmino; - new_diversifier: string; + new_diversifier?: string; } export interface HeaderAminoMsg { type: "cosmos-sdk/Header"; @@ -115,7 +117,7 @@ export interface HeaderAminoMsg { export interface HeaderSDKType { timestamp: bigint; signature: Uint8Array; - new_public_key: AnySDKType; + new_public_key?: AnySDKType; new_diversifier: string; } /** @@ -124,8 +126,8 @@ export interface HeaderSDKType { */ export interface Misbehaviour { sequence: bigint; - signatureOne: SignatureAndData; - signatureTwo: SignatureAndData; + signatureOne?: SignatureAndData; + signatureTwo?: SignatureAndData; } export interface MisbehaviourProtoMsg { typeUrl: "/ibc.lightclients.solomachine.v3.Misbehaviour"; @@ -136,7 +138,7 @@ export interface MisbehaviourProtoMsg { * of a sequence and two signatures over different messages at that sequence. */ export interface MisbehaviourAmino { - sequence: string; + sequence?: string; signature_one?: SignatureAndDataAmino; signature_two?: SignatureAndDataAmino; } @@ -150,8 +152,8 @@ export interface MisbehaviourAminoMsg { */ export interface MisbehaviourSDKType { sequence: bigint; - signature_one: SignatureAndDataSDKType; - signature_two: SignatureAndDataSDKType; + signature_one?: SignatureAndDataSDKType; + signature_two?: SignatureAndDataSDKType; } /** * SignatureAndData contains a signature and the data signed over to create that @@ -172,10 +174,10 @@ export interface SignatureAndDataProtoMsg { * signature. */ export interface SignatureAndDataAmino { - signature: Uint8Array; - path: Uint8Array; - data: Uint8Array; - timestamp: string; + signature?: string; + path?: string; + data?: string; + timestamp?: string; } export interface SignatureAndDataAminoMsg { type: "cosmos-sdk/SignatureAndData"; @@ -208,8 +210,8 @@ export interface TimestampedSignatureDataProtoMsg { * signature. */ export interface TimestampedSignatureDataAmino { - signature_data: Uint8Array; - timestamp: string; + signature_data?: string; + timestamp?: string; } export interface TimestampedSignatureDataAminoMsg { type: "cosmos-sdk/TimestampedSignatureData"; @@ -243,15 +245,15 @@ export interface SignBytesProtoMsg { /** SignBytes defines the signed bytes used for signature verification. */ export interface SignBytesAmino { /** the sequence number */ - sequence: string; + sequence?: string; /** the proof timestamp */ - timestamp: string; + timestamp?: string; /** the public key diversifier */ - diversifier: string; + diversifier?: string; /** the standardised path bytes */ - path: Uint8Array; + path?: string; /** the marshaled data bytes */ - data: Uint8Array; + data?: string; } export interface SignBytesAminoMsg { type: "cosmos-sdk/SignBytes"; @@ -268,7 +270,7 @@ export interface SignBytesSDKType { /** HeaderData returns the SignBytes data for update verification. */ export interface HeaderData { /** header public key */ - newPubKey: Any; + newPubKey?: Any; /** header diversifier */ newDiversifier: string; } @@ -281,7 +283,7 @@ export interface HeaderDataAmino { /** header public key */ new_pub_key?: AnyAmino; /** header diversifier */ - new_diversifier: string; + new_diversifier?: string; } export interface HeaderDataAminoMsg { type: "cosmos-sdk/HeaderData"; @@ -289,18 +291,28 @@ export interface HeaderDataAminoMsg { } /** HeaderData returns the SignBytes data for update verification. */ export interface HeaderDataSDKType { - new_pub_key: AnySDKType; + new_pub_key?: AnySDKType; new_diversifier: string; } function createBaseClientState(): ClientState { return { sequence: BigInt(0), isFrozen: false, - consensusState: ConsensusState.fromPartial({}) + consensusState: undefined }; } export const ClientState = { typeUrl: "/ibc.lightclients.solomachine.v3.ClientState", + aminoType: "cosmos-sdk/ClientState", + is(o: any): o is ClientState { + return o && (o.$typeUrl === ClientState.typeUrl || typeof o.sequence === "bigint" && typeof o.isFrozen === "boolean"); + }, + isSDK(o: any): o is ClientStateSDKType { + return o && (o.$typeUrl === ClientState.typeUrl || typeof o.sequence === "bigint" && typeof o.is_frozen === "boolean"); + }, + isAmino(o: any): o is ClientStateAmino { + return o && (o.$typeUrl === ClientState.typeUrl || typeof o.sequence === "bigint" && typeof o.is_frozen === "boolean"); + }, encode(message: ClientState, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.sequence !== BigInt(0)) { writer.uint32(8).uint64(message.sequence); @@ -336,6 +348,20 @@ export const ClientState = { } return message; }, + fromJSON(object: any): ClientState { + return { + sequence: isSet(object.sequence) ? BigInt(object.sequence.toString()) : BigInt(0), + isFrozen: isSet(object.isFrozen) ? Boolean(object.isFrozen) : false, + consensusState: isSet(object.consensusState) ? ConsensusState.fromJSON(object.consensusState) : undefined + }; + }, + toJSON(message: ClientState): unknown { + const obj: any = {}; + message.sequence !== undefined && (obj.sequence = (message.sequence || BigInt(0)).toString()); + message.isFrozen !== undefined && (obj.isFrozen = message.isFrozen); + message.consensusState !== undefined && (obj.consensusState = message.consensusState ? ConsensusState.toJSON(message.consensusState) : undefined); + return obj; + }, fromPartial(object: Partial): ClientState { const message = createBaseClientState(); message.sequence = object.sequence !== undefined && object.sequence !== null ? BigInt(object.sequence.toString()) : BigInt(0); @@ -344,11 +370,17 @@ export const ClientState = { return message; }, fromAmino(object: ClientStateAmino): ClientState { - return { - sequence: BigInt(object.sequence), - isFrozen: object.is_frozen, - consensusState: object?.consensus_state ? ConsensusState.fromAmino(object.consensus_state) : undefined - }; + const message = createBaseClientState(); + if (object.sequence !== undefined && object.sequence !== null) { + message.sequence = BigInt(object.sequence); + } + if (object.is_frozen !== undefined && object.is_frozen !== null) { + message.isFrozen = object.is_frozen; + } + if (object.consensus_state !== undefined && object.consensus_state !== null) { + message.consensusState = ConsensusState.fromAmino(object.consensus_state); + } + return message; }, toAmino(message: ClientState): ClientStateAmino { const obj: any = {}; @@ -379,6 +411,8 @@ export const ClientState = { }; } }; +GlobalDecoderRegistry.register(ClientState.typeUrl, ClientState); +GlobalDecoderRegistry.registerAminoProtoMapping(ClientState.aminoType, ClientState.typeUrl); function createBaseConsensusState(): ConsensusState { return { publicKey: undefined, @@ -388,6 +422,16 @@ function createBaseConsensusState(): ConsensusState { } export const ConsensusState = { typeUrl: "/ibc.lightclients.solomachine.v3.ConsensusState", + aminoType: "cosmos-sdk/ConsensusState", + is(o: any): o is ConsensusState { + return o && (o.$typeUrl === ConsensusState.typeUrl || typeof o.diversifier === "string" && typeof o.timestamp === "bigint"); + }, + isSDK(o: any): o is ConsensusStateSDKType { + return o && (o.$typeUrl === ConsensusState.typeUrl || typeof o.diversifier === "string" && typeof o.timestamp === "bigint"); + }, + isAmino(o: any): o is ConsensusStateAmino { + return o && (o.$typeUrl === ConsensusState.typeUrl || typeof o.diversifier === "string" && typeof o.timestamp === "bigint"); + }, encode(message: ConsensusState, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.publicKey !== undefined) { Any.encode(message.publicKey, writer.uint32(10).fork()).ldelim(); @@ -423,6 +467,20 @@ export const ConsensusState = { } return message; }, + fromJSON(object: any): ConsensusState { + return { + publicKey: isSet(object.publicKey) ? Any.fromJSON(object.publicKey) : undefined, + diversifier: isSet(object.diversifier) ? String(object.diversifier) : "", + timestamp: isSet(object.timestamp) ? BigInt(object.timestamp.toString()) : BigInt(0) + }; + }, + toJSON(message: ConsensusState): unknown { + const obj: any = {}; + message.publicKey !== undefined && (obj.publicKey = message.publicKey ? Any.toJSON(message.publicKey) : undefined); + message.diversifier !== undefined && (obj.diversifier = message.diversifier); + message.timestamp !== undefined && (obj.timestamp = (message.timestamp || BigInt(0)).toString()); + return obj; + }, fromPartial(object: Partial): ConsensusState { const message = createBaseConsensusState(); message.publicKey = object.publicKey !== undefined && object.publicKey !== null ? Any.fromPartial(object.publicKey) : undefined; @@ -431,11 +489,17 @@ export const ConsensusState = { return message; }, fromAmino(object: ConsensusStateAmino): ConsensusState { - return { - publicKey: object?.public_key ? Any.fromAmino(object.public_key) : undefined, - diversifier: object.diversifier, - timestamp: BigInt(object.timestamp) - }; + const message = createBaseConsensusState(); + if (object.public_key !== undefined && object.public_key !== null) { + message.publicKey = Any.fromAmino(object.public_key); + } + if (object.diversifier !== undefined && object.diversifier !== null) { + message.diversifier = object.diversifier; + } + if (object.timestamp !== undefined && object.timestamp !== null) { + message.timestamp = BigInt(object.timestamp); + } + return message; }, toAmino(message: ConsensusState): ConsensusStateAmino { const obj: any = {}; @@ -466,6 +530,8 @@ export const ConsensusState = { }; } }; +GlobalDecoderRegistry.register(ConsensusState.typeUrl, ConsensusState); +GlobalDecoderRegistry.registerAminoProtoMapping(ConsensusState.aminoType, ConsensusState.typeUrl); function createBaseHeader(): Header { return { timestamp: BigInt(0), @@ -476,6 +542,16 @@ function createBaseHeader(): Header { } export const Header = { typeUrl: "/ibc.lightclients.solomachine.v3.Header", + aminoType: "cosmos-sdk/Header", + is(o: any): o is Header { + return o && (o.$typeUrl === Header.typeUrl || typeof o.timestamp === "bigint" && (o.signature instanceof Uint8Array || typeof o.signature === "string") && typeof o.newDiversifier === "string"); + }, + isSDK(o: any): o is HeaderSDKType { + return o && (o.$typeUrl === Header.typeUrl || typeof o.timestamp === "bigint" && (o.signature instanceof Uint8Array || typeof o.signature === "string") && typeof o.new_diversifier === "string"); + }, + isAmino(o: any): o is HeaderAmino { + return o && (o.$typeUrl === Header.typeUrl || typeof o.timestamp === "bigint" && (o.signature instanceof Uint8Array || typeof o.signature === "string") && typeof o.new_diversifier === "string"); + }, encode(message: Header, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.timestamp !== BigInt(0)) { writer.uint32(8).uint64(message.timestamp); @@ -517,6 +593,22 @@ export const Header = { } return message; }, + fromJSON(object: any): Header { + return { + timestamp: isSet(object.timestamp) ? BigInt(object.timestamp.toString()) : BigInt(0), + signature: isSet(object.signature) ? bytesFromBase64(object.signature) : new Uint8Array(), + newPublicKey: isSet(object.newPublicKey) ? Any.fromJSON(object.newPublicKey) : undefined, + newDiversifier: isSet(object.newDiversifier) ? String(object.newDiversifier) : "" + }; + }, + toJSON(message: Header): unknown { + const obj: any = {}; + message.timestamp !== undefined && (obj.timestamp = (message.timestamp || BigInt(0)).toString()); + message.signature !== undefined && (obj.signature = base64FromBytes(message.signature !== undefined ? message.signature : new Uint8Array())); + message.newPublicKey !== undefined && (obj.newPublicKey = message.newPublicKey ? Any.toJSON(message.newPublicKey) : undefined); + message.newDiversifier !== undefined && (obj.newDiversifier = message.newDiversifier); + return obj; + }, fromPartial(object: Partial
): Header { const message = createBaseHeader(); message.timestamp = object.timestamp !== undefined && object.timestamp !== null ? BigInt(object.timestamp.toString()) : BigInt(0); @@ -526,17 +618,25 @@ export const Header = { return message; }, fromAmino(object: HeaderAmino): Header { - return { - timestamp: BigInt(object.timestamp), - signature: object.signature, - newPublicKey: object?.new_public_key ? Any.fromAmino(object.new_public_key) : undefined, - newDiversifier: object.new_diversifier - }; + const message = createBaseHeader(); + if (object.timestamp !== undefined && object.timestamp !== null) { + message.timestamp = BigInt(object.timestamp); + } + if (object.signature !== undefined && object.signature !== null) { + message.signature = bytesFromBase64(object.signature); + } + if (object.new_public_key !== undefined && object.new_public_key !== null) { + message.newPublicKey = Any.fromAmino(object.new_public_key); + } + if (object.new_diversifier !== undefined && object.new_diversifier !== null) { + message.newDiversifier = object.new_diversifier; + } + return message; }, toAmino(message: Header): HeaderAmino { const obj: any = {}; obj.timestamp = message.timestamp ? message.timestamp.toString() : undefined; - obj.signature = message.signature; + obj.signature = message.signature ? base64FromBytes(message.signature) : undefined; obj.new_public_key = message.newPublicKey ? Any.toAmino(message.newPublicKey) : undefined; obj.new_diversifier = message.newDiversifier; return obj; @@ -563,15 +663,27 @@ export const Header = { }; } }; +GlobalDecoderRegistry.register(Header.typeUrl, Header); +GlobalDecoderRegistry.registerAminoProtoMapping(Header.aminoType, Header.typeUrl); function createBaseMisbehaviour(): Misbehaviour { return { sequence: BigInt(0), - signatureOne: SignatureAndData.fromPartial({}), - signatureTwo: SignatureAndData.fromPartial({}) + signatureOne: undefined, + signatureTwo: undefined }; } export const Misbehaviour = { typeUrl: "/ibc.lightclients.solomachine.v3.Misbehaviour", + aminoType: "cosmos-sdk/Misbehaviour", + is(o: any): o is Misbehaviour { + return o && (o.$typeUrl === Misbehaviour.typeUrl || typeof o.sequence === "bigint"); + }, + isSDK(o: any): o is MisbehaviourSDKType { + return o && (o.$typeUrl === Misbehaviour.typeUrl || typeof o.sequence === "bigint"); + }, + isAmino(o: any): o is MisbehaviourAmino { + return o && (o.$typeUrl === Misbehaviour.typeUrl || typeof o.sequence === "bigint"); + }, encode(message: Misbehaviour, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.sequence !== BigInt(0)) { writer.uint32(8).uint64(message.sequence); @@ -607,6 +719,20 @@ export const Misbehaviour = { } return message; }, + fromJSON(object: any): Misbehaviour { + return { + sequence: isSet(object.sequence) ? BigInt(object.sequence.toString()) : BigInt(0), + signatureOne: isSet(object.signatureOne) ? SignatureAndData.fromJSON(object.signatureOne) : undefined, + signatureTwo: isSet(object.signatureTwo) ? SignatureAndData.fromJSON(object.signatureTwo) : undefined + }; + }, + toJSON(message: Misbehaviour): unknown { + const obj: any = {}; + message.sequence !== undefined && (obj.sequence = (message.sequence || BigInt(0)).toString()); + message.signatureOne !== undefined && (obj.signatureOne = message.signatureOne ? SignatureAndData.toJSON(message.signatureOne) : undefined); + message.signatureTwo !== undefined && (obj.signatureTwo = message.signatureTwo ? SignatureAndData.toJSON(message.signatureTwo) : undefined); + return obj; + }, fromPartial(object: Partial): Misbehaviour { const message = createBaseMisbehaviour(); message.sequence = object.sequence !== undefined && object.sequence !== null ? BigInt(object.sequence.toString()) : BigInt(0); @@ -615,11 +741,17 @@ export const Misbehaviour = { return message; }, fromAmino(object: MisbehaviourAmino): Misbehaviour { - return { - sequence: BigInt(object.sequence), - signatureOne: object?.signature_one ? SignatureAndData.fromAmino(object.signature_one) : undefined, - signatureTwo: object?.signature_two ? SignatureAndData.fromAmino(object.signature_two) : undefined - }; + const message = createBaseMisbehaviour(); + if (object.sequence !== undefined && object.sequence !== null) { + message.sequence = BigInt(object.sequence); + } + if (object.signature_one !== undefined && object.signature_one !== null) { + message.signatureOne = SignatureAndData.fromAmino(object.signature_one); + } + if (object.signature_two !== undefined && object.signature_two !== null) { + message.signatureTwo = SignatureAndData.fromAmino(object.signature_two); + } + return message; }, toAmino(message: Misbehaviour): MisbehaviourAmino { const obj: any = {}; @@ -650,6 +782,8 @@ export const Misbehaviour = { }; } }; +GlobalDecoderRegistry.register(Misbehaviour.typeUrl, Misbehaviour); +GlobalDecoderRegistry.registerAminoProtoMapping(Misbehaviour.aminoType, Misbehaviour.typeUrl); function createBaseSignatureAndData(): SignatureAndData { return { signature: new Uint8Array(), @@ -660,6 +794,16 @@ function createBaseSignatureAndData(): SignatureAndData { } export const SignatureAndData = { typeUrl: "/ibc.lightclients.solomachine.v3.SignatureAndData", + aminoType: "cosmos-sdk/SignatureAndData", + is(o: any): o is SignatureAndData { + return o && (o.$typeUrl === SignatureAndData.typeUrl || (o.signature instanceof Uint8Array || typeof o.signature === "string") && (o.path instanceof Uint8Array || typeof o.path === "string") && (o.data instanceof Uint8Array || typeof o.data === "string") && typeof o.timestamp === "bigint"); + }, + isSDK(o: any): o is SignatureAndDataSDKType { + return o && (o.$typeUrl === SignatureAndData.typeUrl || (o.signature instanceof Uint8Array || typeof o.signature === "string") && (o.path instanceof Uint8Array || typeof o.path === "string") && (o.data instanceof Uint8Array || typeof o.data === "string") && typeof o.timestamp === "bigint"); + }, + isAmino(o: any): o is SignatureAndDataAmino { + return o && (o.$typeUrl === SignatureAndData.typeUrl || (o.signature instanceof Uint8Array || typeof o.signature === "string") && (o.path instanceof Uint8Array || typeof o.path === "string") && (o.data instanceof Uint8Array || typeof o.data === "string") && typeof o.timestamp === "bigint"); + }, encode(message: SignatureAndData, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.signature.length !== 0) { writer.uint32(10).bytes(message.signature); @@ -701,6 +845,22 @@ export const SignatureAndData = { } return message; }, + fromJSON(object: any): SignatureAndData { + return { + signature: isSet(object.signature) ? bytesFromBase64(object.signature) : new Uint8Array(), + path: isSet(object.path) ? bytesFromBase64(object.path) : new Uint8Array(), + data: isSet(object.data) ? bytesFromBase64(object.data) : new Uint8Array(), + timestamp: isSet(object.timestamp) ? BigInt(object.timestamp.toString()) : BigInt(0) + }; + }, + toJSON(message: SignatureAndData): unknown { + const obj: any = {}; + message.signature !== undefined && (obj.signature = base64FromBytes(message.signature !== undefined ? message.signature : new Uint8Array())); + message.path !== undefined && (obj.path = base64FromBytes(message.path !== undefined ? message.path : new Uint8Array())); + message.data !== undefined && (obj.data = base64FromBytes(message.data !== undefined ? message.data : new Uint8Array())); + message.timestamp !== undefined && (obj.timestamp = (message.timestamp || BigInt(0)).toString()); + return obj; + }, fromPartial(object: Partial): SignatureAndData { const message = createBaseSignatureAndData(); message.signature = object.signature ?? new Uint8Array(); @@ -710,18 +870,26 @@ export const SignatureAndData = { return message; }, fromAmino(object: SignatureAndDataAmino): SignatureAndData { - return { - signature: object.signature, - path: object.path, - data: object.data, - timestamp: BigInt(object.timestamp) - }; + const message = createBaseSignatureAndData(); + if (object.signature !== undefined && object.signature !== null) { + message.signature = bytesFromBase64(object.signature); + } + if (object.path !== undefined && object.path !== null) { + message.path = bytesFromBase64(object.path); + } + if (object.data !== undefined && object.data !== null) { + message.data = bytesFromBase64(object.data); + } + if (object.timestamp !== undefined && object.timestamp !== null) { + message.timestamp = BigInt(object.timestamp); + } + return message; }, toAmino(message: SignatureAndData): SignatureAndDataAmino { const obj: any = {}; - obj.signature = message.signature; - obj.path = message.path; - obj.data = message.data; + obj.signature = message.signature ? base64FromBytes(message.signature) : undefined; + obj.path = message.path ? base64FromBytes(message.path) : undefined; + obj.data = message.data ? base64FromBytes(message.data) : undefined; obj.timestamp = message.timestamp ? message.timestamp.toString() : undefined; return obj; }, @@ -747,6 +915,8 @@ export const SignatureAndData = { }; } }; +GlobalDecoderRegistry.register(SignatureAndData.typeUrl, SignatureAndData); +GlobalDecoderRegistry.registerAminoProtoMapping(SignatureAndData.aminoType, SignatureAndData.typeUrl); function createBaseTimestampedSignatureData(): TimestampedSignatureData { return { signatureData: new Uint8Array(), @@ -755,6 +925,16 @@ function createBaseTimestampedSignatureData(): TimestampedSignatureData { } export const TimestampedSignatureData = { typeUrl: "/ibc.lightclients.solomachine.v3.TimestampedSignatureData", + aminoType: "cosmos-sdk/TimestampedSignatureData", + is(o: any): o is TimestampedSignatureData { + return o && (o.$typeUrl === TimestampedSignatureData.typeUrl || (o.signatureData instanceof Uint8Array || typeof o.signatureData === "string") && typeof o.timestamp === "bigint"); + }, + isSDK(o: any): o is TimestampedSignatureDataSDKType { + return o && (o.$typeUrl === TimestampedSignatureData.typeUrl || (o.signature_data instanceof Uint8Array || typeof o.signature_data === "string") && typeof o.timestamp === "bigint"); + }, + isAmino(o: any): o is TimestampedSignatureDataAmino { + return o && (o.$typeUrl === TimestampedSignatureData.typeUrl || (o.signature_data instanceof Uint8Array || typeof o.signature_data === "string") && typeof o.timestamp === "bigint"); + }, encode(message: TimestampedSignatureData, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.signatureData.length !== 0) { writer.uint32(10).bytes(message.signatureData); @@ -784,6 +964,18 @@ export const TimestampedSignatureData = { } return message; }, + fromJSON(object: any): TimestampedSignatureData { + return { + signatureData: isSet(object.signatureData) ? bytesFromBase64(object.signatureData) : new Uint8Array(), + timestamp: isSet(object.timestamp) ? BigInt(object.timestamp.toString()) : BigInt(0) + }; + }, + toJSON(message: TimestampedSignatureData): unknown { + const obj: any = {}; + message.signatureData !== undefined && (obj.signatureData = base64FromBytes(message.signatureData !== undefined ? message.signatureData : new Uint8Array())); + message.timestamp !== undefined && (obj.timestamp = (message.timestamp || BigInt(0)).toString()); + return obj; + }, fromPartial(object: Partial): TimestampedSignatureData { const message = createBaseTimestampedSignatureData(); message.signatureData = object.signatureData ?? new Uint8Array(); @@ -791,14 +983,18 @@ export const TimestampedSignatureData = { return message; }, fromAmino(object: TimestampedSignatureDataAmino): TimestampedSignatureData { - return { - signatureData: object.signature_data, - timestamp: BigInt(object.timestamp) - }; + const message = createBaseTimestampedSignatureData(); + if (object.signature_data !== undefined && object.signature_data !== null) { + message.signatureData = bytesFromBase64(object.signature_data); + } + if (object.timestamp !== undefined && object.timestamp !== null) { + message.timestamp = BigInt(object.timestamp); + } + return message; }, toAmino(message: TimestampedSignatureData): TimestampedSignatureDataAmino { const obj: any = {}; - obj.signature_data = message.signatureData; + obj.signature_data = message.signatureData ? base64FromBytes(message.signatureData) : undefined; obj.timestamp = message.timestamp ? message.timestamp.toString() : undefined; return obj; }, @@ -824,6 +1020,8 @@ export const TimestampedSignatureData = { }; } }; +GlobalDecoderRegistry.register(TimestampedSignatureData.typeUrl, TimestampedSignatureData); +GlobalDecoderRegistry.registerAminoProtoMapping(TimestampedSignatureData.aminoType, TimestampedSignatureData.typeUrl); function createBaseSignBytes(): SignBytes { return { sequence: BigInt(0), @@ -835,6 +1033,16 @@ function createBaseSignBytes(): SignBytes { } export const SignBytes = { typeUrl: "/ibc.lightclients.solomachine.v3.SignBytes", + aminoType: "cosmos-sdk/SignBytes", + is(o: any): o is SignBytes { + return o && (o.$typeUrl === SignBytes.typeUrl || typeof o.sequence === "bigint" && typeof o.timestamp === "bigint" && typeof o.diversifier === "string" && (o.path instanceof Uint8Array || typeof o.path === "string") && (o.data instanceof Uint8Array || typeof o.data === "string")); + }, + isSDK(o: any): o is SignBytesSDKType { + return o && (o.$typeUrl === SignBytes.typeUrl || typeof o.sequence === "bigint" && typeof o.timestamp === "bigint" && typeof o.diversifier === "string" && (o.path instanceof Uint8Array || typeof o.path === "string") && (o.data instanceof Uint8Array || typeof o.data === "string")); + }, + isAmino(o: any): o is SignBytesAmino { + return o && (o.$typeUrl === SignBytes.typeUrl || typeof o.sequence === "bigint" && typeof o.timestamp === "bigint" && typeof o.diversifier === "string" && (o.path instanceof Uint8Array || typeof o.path === "string") && (o.data instanceof Uint8Array || typeof o.data === "string")); + }, encode(message: SignBytes, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.sequence !== BigInt(0)) { writer.uint32(8).uint64(message.sequence); @@ -882,6 +1090,24 @@ export const SignBytes = { } return message; }, + fromJSON(object: any): SignBytes { + return { + sequence: isSet(object.sequence) ? BigInt(object.sequence.toString()) : BigInt(0), + timestamp: isSet(object.timestamp) ? BigInt(object.timestamp.toString()) : BigInt(0), + diversifier: isSet(object.diversifier) ? String(object.diversifier) : "", + path: isSet(object.path) ? bytesFromBase64(object.path) : new Uint8Array(), + data: isSet(object.data) ? bytesFromBase64(object.data) : new Uint8Array() + }; + }, + toJSON(message: SignBytes): unknown { + const obj: any = {}; + message.sequence !== undefined && (obj.sequence = (message.sequence || BigInt(0)).toString()); + message.timestamp !== undefined && (obj.timestamp = (message.timestamp || BigInt(0)).toString()); + message.diversifier !== undefined && (obj.diversifier = message.diversifier); + message.path !== undefined && (obj.path = base64FromBytes(message.path !== undefined ? message.path : new Uint8Array())); + message.data !== undefined && (obj.data = base64FromBytes(message.data !== undefined ? message.data : new Uint8Array())); + return obj; + }, fromPartial(object: Partial): SignBytes { const message = createBaseSignBytes(); message.sequence = object.sequence !== undefined && object.sequence !== null ? BigInt(object.sequence.toString()) : BigInt(0); @@ -892,21 +1118,31 @@ export const SignBytes = { return message; }, fromAmino(object: SignBytesAmino): SignBytes { - return { - sequence: BigInt(object.sequence), - timestamp: BigInt(object.timestamp), - diversifier: object.diversifier, - path: object.path, - data: object.data - }; + const message = createBaseSignBytes(); + if (object.sequence !== undefined && object.sequence !== null) { + message.sequence = BigInt(object.sequence); + } + if (object.timestamp !== undefined && object.timestamp !== null) { + message.timestamp = BigInt(object.timestamp); + } + if (object.diversifier !== undefined && object.diversifier !== null) { + message.diversifier = object.diversifier; + } + if (object.path !== undefined && object.path !== null) { + message.path = bytesFromBase64(object.path); + } + if (object.data !== undefined && object.data !== null) { + message.data = bytesFromBase64(object.data); + } + return message; }, toAmino(message: SignBytes): SignBytesAmino { const obj: any = {}; obj.sequence = message.sequence ? message.sequence.toString() : undefined; obj.timestamp = message.timestamp ? message.timestamp.toString() : undefined; obj.diversifier = message.diversifier; - obj.path = message.path; - obj.data = message.data; + obj.path = message.path ? base64FromBytes(message.path) : undefined; + obj.data = message.data ? base64FromBytes(message.data) : undefined; return obj; }, fromAminoMsg(object: SignBytesAminoMsg): SignBytes { @@ -931,6 +1167,8 @@ export const SignBytes = { }; } }; +GlobalDecoderRegistry.register(SignBytes.typeUrl, SignBytes); +GlobalDecoderRegistry.registerAminoProtoMapping(SignBytes.aminoType, SignBytes.typeUrl); function createBaseHeaderData(): HeaderData { return { newPubKey: undefined, @@ -939,6 +1177,16 @@ function createBaseHeaderData(): HeaderData { } export const HeaderData = { typeUrl: "/ibc.lightclients.solomachine.v3.HeaderData", + aminoType: "cosmos-sdk/HeaderData", + is(o: any): o is HeaderData { + return o && (o.$typeUrl === HeaderData.typeUrl || typeof o.newDiversifier === "string"); + }, + isSDK(o: any): o is HeaderDataSDKType { + return o && (o.$typeUrl === HeaderData.typeUrl || typeof o.new_diversifier === "string"); + }, + isAmino(o: any): o is HeaderDataAmino { + return o && (o.$typeUrl === HeaderData.typeUrl || typeof o.new_diversifier === "string"); + }, encode(message: HeaderData, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.newPubKey !== undefined) { Any.encode(message.newPubKey, writer.uint32(10).fork()).ldelim(); @@ -968,6 +1216,18 @@ export const HeaderData = { } return message; }, + fromJSON(object: any): HeaderData { + return { + newPubKey: isSet(object.newPubKey) ? Any.fromJSON(object.newPubKey) : undefined, + newDiversifier: isSet(object.newDiversifier) ? String(object.newDiversifier) : "" + }; + }, + toJSON(message: HeaderData): unknown { + const obj: any = {}; + message.newPubKey !== undefined && (obj.newPubKey = message.newPubKey ? Any.toJSON(message.newPubKey) : undefined); + message.newDiversifier !== undefined && (obj.newDiversifier = message.newDiversifier); + return obj; + }, fromPartial(object: Partial): HeaderData { const message = createBaseHeaderData(); message.newPubKey = object.newPubKey !== undefined && object.newPubKey !== null ? Any.fromPartial(object.newPubKey) : undefined; @@ -975,10 +1235,14 @@ export const HeaderData = { return message; }, fromAmino(object: HeaderDataAmino): HeaderData { - return { - newPubKey: object?.new_pub_key ? Any.fromAmino(object.new_pub_key) : undefined, - newDiversifier: object.new_diversifier - }; + const message = createBaseHeaderData(); + if (object.new_pub_key !== undefined && object.new_pub_key !== null) { + message.newPubKey = Any.fromAmino(object.new_pub_key); + } + if (object.new_diversifier !== undefined && object.new_diversifier !== null) { + message.newDiversifier = object.new_diversifier; + } + return message; }, toAmino(message: HeaderData): HeaderDataAmino { const obj: any = {}; @@ -1007,4 +1271,6 @@ export const HeaderData = { value: HeaderData.encode(message).finish() }; } -}; \ No newline at end of file +}; +GlobalDecoderRegistry.register(HeaderData.typeUrl, HeaderData); +GlobalDecoderRegistry.registerAminoProtoMapping(HeaderData.aminoType, HeaderData.typeUrl); \ No newline at end of file diff --git a/packages/osmojs/src/codegen/ibc/lightclients/tendermint/v1/tendermint.ts b/packages/osmojs/src/codegen/ibc/lightclients/tendermint/v1/tendermint.ts index 46ec90b65..6534d7e97 100644 --- a/packages/osmojs/src/codegen/ibc/lightclients/tendermint/v1/tendermint.ts +++ b/packages/osmojs/src/codegen/ibc/lightclients/tendermint/v1/tendermint.ts @@ -6,7 +6,8 @@ import { MerkleRoot, MerkleRootAmino, MerkleRootSDKType } from "../../../core/co import { SignedHeader, SignedHeaderAmino, SignedHeaderSDKType } from "../../../../tendermint/types/types"; import { ValidatorSet, ValidatorSetAmino, ValidatorSetSDKType } from "../../../../tendermint/types/validator"; import { BinaryReader, BinaryWriter } from "../../../../binary"; -import { toTimestamp, fromTimestamp } from "../../../../helpers"; +import { isSet, toTimestamp, fromTimestamp, bytesFromBase64, base64FromBytes } from "../../../../helpers"; +import { GlobalDecoderRegistry } from "../../../../registry"; /** * ClientState from Tendermint tracks the current validator set, latest height, * and a possible frozen height. @@ -55,7 +56,7 @@ export interface ClientStateProtoMsg { * and a possible frozen height. */ export interface ClientStateAmino { - chain_id: string; + chain_id?: string; trust_level?: FractionAmino; /** * duration of the period since the LastestTimestamp during which the @@ -71,7 +72,7 @@ export interface ClientStateAmino { /** Latest height the client was updated to */ latest_height?: HeightAmino; /** Proof specifications used in verifying counterparty state */ - proof_specs: ProofSpecAmino[]; + proof_specs?: ProofSpecAmino[]; /** * Path at which next upgraded client will be committed. * Each element corresponds to the key for a single CommitmentProof in the @@ -81,13 +82,13 @@ export interface ClientStateAmino { * the default upgrade module, upgrade_path should be []string{"upgrade", * "upgradedIBCState"}` */ - upgrade_path: string[]; + upgrade_path?: string[]; /** allow_update_after_expiry is deprecated */ /** @deprecated */ - allow_update_after_expiry: boolean; + allow_update_after_expiry?: boolean; /** allow_update_after_misbehaviour is deprecated */ /** @deprecated */ - allow_update_after_misbehaviour: boolean; + allow_update_after_misbehaviour?: boolean; } export interface ClientStateAminoMsg { type: "cosmos-sdk/ClientState"; @@ -133,10 +134,10 @@ export interface ConsensusStateAmino { * timestamp that corresponds to the block height in which the ConsensusState * was stored. */ - timestamp?: Date; + timestamp?: string; /** commitment root (i.e app hash) */ root?: MerkleRootAmino; - next_validators_hash: Uint8Array; + next_validators_hash?: string; } export interface ConsensusStateAminoMsg { type: "cosmos-sdk/ConsensusState"; @@ -156,8 +157,8 @@ export interface Misbehaviour { /** ClientID is deprecated */ /** @deprecated */ clientId: string; - header1: Header; - header2: Header; + header1?: Header; + header2?: Header; } export interface MisbehaviourProtoMsg { typeUrl: "/ibc.lightclients.tendermint.v1.Misbehaviour"; @@ -170,7 +171,7 @@ export interface MisbehaviourProtoMsg { export interface MisbehaviourAmino { /** ClientID is deprecated */ /** @deprecated */ - client_id: string; + client_id?: string; header_1?: HeaderAmino; header_2?: HeaderAmino; } @@ -185,8 +186,8 @@ export interface MisbehaviourAminoMsg { export interface MisbehaviourSDKType { /** @deprecated */ client_id: string; - header_1: HeaderSDKType; - header_2: HeaderSDKType; + header_1?: HeaderSDKType; + header_2?: HeaderSDKType; } /** * Header defines the Tendermint client consensus Header. @@ -203,10 +204,10 @@ export interface MisbehaviourSDKType { * trusted validator set at the TrustedHeight. */ export interface Header { - signedHeader: SignedHeader; - validatorSet: ValidatorSet; + signedHeader?: SignedHeader; + validatorSet?: ValidatorSet; trustedHeight: Height; - trustedValidators: ValidatorSet; + trustedValidators?: ValidatorSet; } export interface HeaderProtoMsg { typeUrl: "/ibc.lightclients.tendermint.v1.Header"; @@ -251,10 +252,10 @@ export interface HeaderAminoMsg { * trusted validator set at the TrustedHeight. */ export interface HeaderSDKType { - signed_header: SignedHeaderSDKType; - validator_set: ValidatorSetSDKType; + signed_header?: SignedHeaderSDKType; + validator_set?: ValidatorSetSDKType; trusted_height: HeightSDKType; - trusted_validators: ValidatorSetSDKType; + trusted_validators?: ValidatorSetSDKType; } /** * Fraction defines the protobuf message type for tmmath.Fraction that only @@ -273,8 +274,8 @@ export interface FractionProtoMsg { * supports positive values. */ export interface FractionAmino { - numerator: string; - denominator: string; + numerator?: string; + denominator?: string; } export interface FractionAminoMsg { type: "cosmos-sdk/Fraction"; @@ -292,9 +293,9 @@ function createBaseClientState(): ClientState { return { chainId: "", trustLevel: Fraction.fromPartial({}), - trustingPeriod: undefined, - unbondingPeriod: undefined, - maxClockDrift: undefined, + trustingPeriod: Duration.fromPartial({}), + unbondingPeriod: Duration.fromPartial({}), + maxClockDrift: Duration.fromPartial({}), frozenHeight: Height.fromPartial({}), latestHeight: Height.fromPartial({}), proofSpecs: [], @@ -305,6 +306,16 @@ function createBaseClientState(): ClientState { } export const ClientState = { typeUrl: "/ibc.lightclients.tendermint.v1.ClientState", + aminoType: "cosmos-sdk/ClientState", + is(o: any): o is ClientState { + return o && (o.$typeUrl === ClientState.typeUrl || typeof o.chainId === "string" && Fraction.is(o.trustLevel) && Duration.is(o.trustingPeriod) && Duration.is(o.unbondingPeriod) && Duration.is(o.maxClockDrift) && Height.is(o.frozenHeight) && Height.is(o.latestHeight) && Array.isArray(o.proofSpecs) && (!o.proofSpecs.length || ProofSpec.is(o.proofSpecs[0])) && Array.isArray(o.upgradePath) && (!o.upgradePath.length || typeof o.upgradePath[0] === "string") && typeof o.allowUpdateAfterExpiry === "boolean" && typeof o.allowUpdateAfterMisbehaviour === "boolean"); + }, + isSDK(o: any): o is ClientStateSDKType { + return o && (o.$typeUrl === ClientState.typeUrl || typeof o.chain_id === "string" && Fraction.isSDK(o.trust_level) && Duration.isSDK(o.trusting_period) && Duration.isSDK(o.unbonding_period) && Duration.isSDK(o.max_clock_drift) && Height.isSDK(o.frozen_height) && Height.isSDK(o.latest_height) && Array.isArray(o.proof_specs) && (!o.proof_specs.length || ProofSpec.isSDK(o.proof_specs[0])) && Array.isArray(o.upgrade_path) && (!o.upgrade_path.length || typeof o.upgrade_path[0] === "string") && typeof o.allow_update_after_expiry === "boolean" && typeof o.allow_update_after_misbehaviour === "boolean"); + }, + isAmino(o: any): o is ClientStateAmino { + return o && (o.$typeUrl === ClientState.typeUrl || typeof o.chain_id === "string" && Fraction.isAmino(o.trust_level) && Duration.isAmino(o.trusting_period) && Duration.isAmino(o.unbonding_period) && Duration.isAmino(o.max_clock_drift) && Height.isAmino(o.frozen_height) && Height.isAmino(o.latest_height) && Array.isArray(o.proof_specs) && (!o.proof_specs.length || ProofSpec.isAmino(o.proof_specs[0])) && Array.isArray(o.upgrade_path) && (!o.upgrade_path.length || typeof o.upgrade_path[0] === "string") && typeof o.allow_update_after_expiry === "boolean" && typeof o.allow_update_after_misbehaviour === "boolean"); + }, encode(message: ClientState, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.chainId !== "") { writer.uint32(10).string(message.chainId); @@ -388,6 +399,44 @@ export const ClientState = { } return message; }, + fromJSON(object: any): ClientState { + return { + chainId: isSet(object.chainId) ? String(object.chainId) : "", + trustLevel: isSet(object.trustLevel) ? Fraction.fromJSON(object.trustLevel) : undefined, + trustingPeriod: isSet(object.trustingPeriod) ? Duration.fromJSON(object.trustingPeriod) : undefined, + unbondingPeriod: isSet(object.unbondingPeriod) ? Duration.fromJSON(object.unbondingPeriod) : undefined, + maxClockDrift: isSet(object.maxClockDrift) ? Duration.fromJSON(object.maxClockDrift) : undefined, + frozenHeight: isSet(object.frozenHeight) ? Height.fromJSON(object.frozenHeight) : undefined, + latestHeight: isSet(object.latestHeight) ? Height.fromJSON(object.latestHeight) : undefined, + proofSpecs: Array.isArray(object?.proofSpecs) ? object.proofSpecs.map((e: any) => ProofSpec.fromJSON(e)) : [], + upgradePath: Array.isArray(object?.upgradePath) ? object.upgradePath.map((e: any) => String(e)) : [], + allowUpdateAfterExpiry: isSet(object.allowUpdateAfterExpiry) ? Boolean(object.allowUpdateAfterExpiry) : false, + allowUpdateAfterMisbehaviour: isSet(object.allowUpdateAfterMisbehaviour) ? Boolean(object.allowUpdateAfterMisbehaviour) : false + }; + }, + toJSON(message: ClientState): unknown { + const obj: any = {}; + message.chainId !== undefined && (obj.chainId = message.chainId); + message.trustLevel !== undefined && (obj.trustLevel = message.trustLevel ? Fraction.toJSON(message.trustLevel) : undefined); + message.trustingPeriod !== undefined && (obj.trustingPeriod = message.trustingPeriod ? Duration.toJSON(message.trustingPeriod) : undefined); + message.unbondingPeriod !== undefined && (obj.unbondingPeriod = message.unbondingPeriod ? Duration.toJSON(message.unbondingPeriod) : undefined); + message.maxClockDrift !== undefined && (obj.maxClockDrift = message.maxClockDrift ? Duration.toJSON(message.maxClockDrift) : undefined); + message.frozenHeight !== undefined && (obj.frozenHeight = message.frozenHeight ? Height.toJSON(message.frozenHeight) : undefined); + message.latestHeight !== undefined && (obj.latestHeight = message.latestHeight ? Height.toJSON(message.latestHeight) : undefined); + if (message.proofSpecs) { + obj.proofSpecs = message.proofSpecs.map(e => e ? ProofSpec.toJSON(e) : undefined); + } else { + obj.proofSpecs = []; + } + if (message.upgradePath) { + obj.upgradePath = message.upgradePath.map(e => e); + } else { + obj.upgradePath = []; + } + message.allowUpdateAfterExpiry !== undefined && (obj.allowUpdateAfterExpiry = message.allowUpdateAfterExpiry); + message.allowUpdateAfterMisbehaviour !== undefined && (obj.allowUpdateAfterMisbehaviour = message.allowUpdateAfterMisbehaviour); + return obj; + }, fromPartial(object: Partial): ClientState { const message = createBaseClientState(); message.chainId = object.chainId ?? ""; @@ -404,19 +453,37 @@ export const ClientState = { return message; }, fromAmino(object: ClientStateAmino): ClientState { - return { - chainId: object.chain_id, - trustLevel: object?.trust_level ? Fraction.fromAmino(object.trust_level) : undefined, - trustingPeriod: object?.trusting_period ? Duration.fromAmino(object.trusting_period) : undefined, - unbondingPeriod: object?.unbonding_period ? Duration.fromAmino(object.unbonding_period) : undefined, - maxClockDrift: object?.max_clock_drift ? Duration.fromAmino(object.max_clock_drift) : undefined, - frozenHeight: object?.frozen_height ? Height.fromAmino(object.frozen_height) : undefined, - latestHeight: object?.latest_height ? Height.fromAmino(object.latest_height) : undefined, - proofSpecs: Array.isArray(object?.proof_specs) ? object.proof_specs.map((e: any) => ProofSpec.fromAmino(e)) : [], - upgradePath: Array.isArray(object?.upgrade_path) ? object.upgrade_path.map((e: any) => e) : [], - allowUpdateAfterExpiry: object.allow_update_after_expiry, - allowUpdateAfterMisbehaviour: object.allow_update_after_misbehaviour - }; + const message = createBaseClientState(); + if (object.chain_id !== undefined && object.chain_id !== null) { + message.chainId = object.chain_id; + } + if (object.trust_level !== undefined && object.trust_level !== null) { + message.trustLevel = Fraction.fromAmino(object.trust_level); + } + if (object.trusting_period !== undefined && object.trusting_period !== null) { + message.trustingPeriod = Duration.fromAmino(object.trusting_period); + } + if (object.unbonding_period !== undefined && object.unbonding_period !== null) { + message.unbondingPeriod = Duration.fromAmino(object.unbonding_period); + } + if (object.max_clock_drift !== undefined && object.max_clock_drift !== null) { + message.maxClockDrift = Duration.fromAmino(object.max_clock_drift); + } + if (object.frozen_height !== undefined && object.frozen_height !== null) { + message.frozenHeight = Height.fromAmino(object.frozen_height); + } + if (object.latest_height !== undefined && object.latest_height !== null) { + message.latestHeight = Height.fromAmino(object.latest_height); + } + message.proofSpecs = object.proof_specs?.map(e => ProofSpec.fromAmino(e)) || []; + message.upgradePath = object.upgrade_path?.map(e => e) || []; + if (object.allow_update_after_expiry !== undefined && object.allow_update_after_expiry !== null) { + message.allowUpdateAfterExpiry = object.allow_update_after_expiry; + } + if (object.allow_update_after_misbehaviour !== undefined && object.allow_update_after_misbehaviour !== null) { + message.allowUpdateAfterMisbehaviour = object.allow_update_after_misbehaviour; + } + return message; }, toAmino(message: ClientState): ClientStateAmino { const obj: any = {}; @@ -463,15 +530,27 @@ export const ClientState = { }; } }; +GlobalDecoderRegistry.register(ClientState.typeUrl, ClientState); +GlobalDecoderRegistry.registerAminoProtoMapping(ClientState.aminoType, ClientState.typeUrl); function createBaseConsensusState(): ConsensusState { return { - timestamp: undefined, + timestamp: new Date(), root: MerkleRoot.fromPartial({}), nextValidatorsHash: new Uint8Array() }; } export const ConsensusState = { typeUrl: "/ibc.lightclients.tendermint.v1.ConsensusState", + aminoType: "cosmos-sdk/ConsensusState", + is(o: any): o is ConsensusState { + return o && (o.$typeUrl === ConsensusState.typeUrl || Timestamp.is(o.timestamp) && MerkleRoot.is(o.root) && (o.nextValidatorsHash instanceof Uint8Array || typeof o.nextValidatorsHash === "string")); + }, + isSDK(o: any): o is ConsensusStateSDKType { + return o && (o.$typeUrl === ConsensusState.typeUrl || Timestamp.isSDK(o.timestamp) && MerkleRoot.isSDK(o.root) && (o.next_validators_hash instanceof Uint8Array || typeof o.next_validators_hash === "string")); + }, + isAmino(o: any): o is ConsensusStateAmino { + return o && (o.$typeUrl === ConsensusState.typeUrl || Timestamp.isAmino(o.timestamp) && MerkleRoot.isAmino(o.root) && (o.next_validators_hash instanceof Uint8Array || typeof o.next_validators_hash === "string")); + }, encode(message: ConsensusState, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.timestamp !== undefined) { Timestamp.encode(toTimestamp(message.timestamp), writer.uint32(10).fork()).ldelim(); @@ -507,6 +586,20 @@ export const ConsensusState = { } return message; }, + fromJSON(object: any): ConsensusState { + return { + timestamp: isSet(object.timestamp) ? new Date(object.timestamp) : undefined, + root: isSet(object.root) ? MerkleRoot.fromJSON(object.root) : undefined, + nextValidatorsHash: isSet(object.nextValidatorsHash) ? bytesFromBase64(object.nextValidatorsHash) : new Uint8Array() + }; + }, + toJSON(message: ConsensusState): unknown { + const obj: any = {}; + message.timestamp !== undefined && (obj.timestamp = message.timestamp.toISOString()); + message.root !== undefined && (obj.root = message.root ? MerkleRoot.toJSON(message.root) : undefined); + message.nextValidatorsHash !== undefined && (obj.nextValidatorsHash = base64FromBytes(message.nextValidatorsHash !== undefined ? message.nextValidatorsHash : new Uint8Array())); + return obj; + }, fromPartial(object: Partial): ConsensusState { const message = createBaseConsensusState(); message.timestamp = object.timestamp ?? undefined; @@ -515,17 +608,23 @@ export const ConsensusState = { return message; }, fromAmino(object: ConsensusStateAmino): ConsensusState { - return { - timestamp: object.timestamp, - root: object?.root ? MerkleRoot.fromAmino(object.root) : undefined, - nextValidatorsHash: object.next_validators_hash - }; + const message = createBaseConsensusState(); + if (object.timestamp !== undefined && object.timestamp !== null) { + message.timestamp = fromTimestamp(Timestamp.fromAmino(object.timestamp)); + } + if (object.root !== undefined && object.root !== null) { + message.root = MerkleRoot.fromAmino(object.root); + } + if (object.next_validators_hash !== undefined && object.next_validators_hash !== null) { + message.nextValidatorsHash = bytesFromBase64(object.next_validators_hash); + } + return message; }, toAmino(message: ConsensusState): ConsensusStateAmino { const obj: any = {}; - obj.timestamp = message.timestamp; + obj.timestamp = message.timestamp ? Timestamp.toAmino(toTimestamp(message.timestamp)) : undefined; obj.root = message.root ? MerkleRoot.toAmino(message.root) : undefined; - obj.next_validators_hash = message.nextValidatorsHash; + obj.next_validators_hash = message.nextValidatorsHash ? base64FromBytes(message.nextValidatorsHash) : undefined; return obj; }, fromAminoMsg(object: ConsensusStateAminoMsg): ConsensusState { @@ -550,15 +649,27 @@ export const ConsensusState = { }; } }; +GlobalDecoderRegistry.register(ConsensusState.typeUrl, ConsensusState); +GlobalDecoderRegistry.registerAminoProtoMapping(ConsensusState.aminoType, ConsensusState.typeUrl); function createBaseMisbehaviour(): Misbehaviour { return { clientId: "", - header1: Header.fromPartial({}), - header2: Header.fromPartial({}) + header1: undefined, + header2: undefined }; } export const Misbehaviour = { typeUrl: "/ibc.lightclients.tendermint.v1.Misbehaviour", + aminoType: "cosmos-sdk/Misbehaviour", + is(o: any): o is Misbehaviour { + return o && (o.$typeUrl === Misbehaviour.typeUrl || typeof o.clientId === "string"); + }, + isSDK(o: any): o is MisbehaviourSDKType { + return o && (o.$typeUrl === Misbehaviour.typeUrl || typeof o.client_id === "string"); + }, + isAmino(o: any): o is MisbehaviourAmino { + return o && (o.$typeUrl === Misbehaviour.typeUrl || typeof o.client_id === "string"); + }, encode(message: Misbehaviour, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.clientId !== "") { writer.uint32(10).string(message.clientId); @@ -594,6 +705,20 @@ export const Misbehaviour = { } return message; }, + fromJSON(object: any): Misbehaviour { + return { + clientId: isSet(object.clientId) ? String(object.clientId) : "", + header1: isSet(object.header1) ? Header.fromJSON(object.header1) : undefined, + header2: isSet(object.header2) ? Header.fromJSON(object.header2) : undefined + }; + }, + toJSON(message: Misbehaviour): unknown { + const obj: any = {}; + message.clientId !== undefined && (obj.clientId = message.clientId); + message.header1 !== undefined && (obj.header1 = message.header1 ? Header.toJSON(message.header1) : undefined); + message.header2 !== undefined && (obj.header2 = message.header2 ? Header.toJSON(message.header2) : undefined); + return obj; + }, fromPartial(object: Partial): Misbehaviour { const message = createBaseMisbehaviour(); message.clientId = object.clientId ?? ""; @@ -602,11 +727,17 @@ export const Misbehaviour = { return message; }, fromAmino(object: MisbehaviourAmino): Misbehaviour { - return { - clientId: object.client_id, - header1: object?.header_1 ? Header.fromAmino(object.header_1) : undefined, - header2: object?.header_2 ? Header.fromAmino(object.header_2) : undefined - }; + const message = createBaseMisbehaviour(); + if (object.client_id !== undefined && object.client_id !== null) { + message.clientId = object.client_id; + } + if (object.header_1 !== undefined && object.header_1 !== null) { + message.header1 = Header.fromAmino(object.header_1); + } + if (object.header_2 !== undefined && object.header_2 !== null) { + message.header2 = Header.fromAmino(object.header_2); + } + return message; }, toAmino(message: Misbehaviour): MisbehaviourAmino { const obj: any = {}; @@ -637,16 +768,28 @@ export const Misbehaviour = { }; } }; +GlobalDecoderRegistry.register(Misbehaviour.typeUrl, Misbehaviour); +GlobalDecoderRegistry.registerAminoProtoMapping(Misbehaviour.aminoType, Misbehaviour.typeUrl); function createBaseHeader(): Header { return { - signedHeader: SignedHeader.fromPartial({}), - validatorSet: ValidatorSet.fromPartial({}), + signedHeader: undefined, + validatorSet: undefined, trustedHeight: Height.fromPartial({}), - trustedValidators: ValidatorSet.fromPartial({}) + trustedValidators: undefined }; } export const Header = { typeUrl: "/ibc.lightclients.tendermint.v1.Header", + aminoType: "cosmos-sdk/Header", + is(o: any): o is Header { + return o && (o.$typeUrl === Header.typeUrl || Height.is(o.trustedHeight)); + }, + isSDK(o: any): o is HeaderSDKType { + return o && (o.$typeUrl === Header.typeUrl || Height.isSDK(o.trusted_height)); + }, + isAmino(o: any): o is HeaderAmino { + return o && (o.$typeUrl === Header.typeUrl || Height.isAmino(o.trusted_height)); + }, encode(message: Header, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.signedHeader !== undefined) { SignedHeader.encode(message.signedHeader, writer.uint32(10).fork()).ldelim(); @@ -688,6 +831,22 @@ export const Header = { } return message; }, + fromJSON(object: any): Header { + return { + signedHeader: isSet(object.signedHeader) ? SignedHeader.fromJSON(object.signedHeader) : undefined, + validatorSet: isSet(object.validatorSet) ? ValidatorSet.fromJSON(object.validatorSet) : undefined, + trustedHeight: isSet(object.trustedHeight) ? Height.fromJSON(object.trustedHeight) : undefined, + trustedValidators: isSet(object.trustedValidators) ? ValidatorSet.fromJSON(object.trustedValidators) : undefined + }; + }, + toJSON(message: Header): unknown { + const obj: any = {}; + message.signedHeader !== undefined && (obj.signedHeader = message.signedHeader ? SignedHeader.toJSON(message.signedHeader) : undefined); + message.validatorSet !== undefined && (obj.validatorSet = message.validatorSet ? ValidatorSet.toJSON(message.validatorSet) : undefined); + message.trustedHeight !== undefined && (obj.trustedHeight = message.trustedHeight ? Height.toJSON(message.trustedHeight) : undefined); + message.trustedValidators !== undefined && (obj.trustedValidators = message.trustedValidators ? ValidatorSet.toJSON(message.trustedValidators) : undefined); + return obj; + }, fromPartial(object: Partial
): Header { const message = createBaseHeader(); message.signedHeader = object.signedHeader !== undefined && object.signedHeader !== null ? SignedHeader.fromPartial(object.signedHeader) : undefined; @@ -697,12 +856,20 @@ export const Header = { return message; }, fromAmino(object: HeaderAmino): Header { - return { - signedHeader: object?.signed_header ? SignedHeader.fromAmino(object.signed_header) : undefined, - validatorSet: object?.validator_set ? ValidatorSet.fromAmino(object.validator_set) : undefined, - trustedHeight: object?.trusted_height ? Height.fromAmino(object.trusted_height) : undefined, - trustedValidators: object?.trusted_validators ? ValidatorSet.fromAmino(object.trusted_validators) : undefined - }; + const message = createBaseHeader(); + if (object.signed_header !== undefined && object.signed_header !== null) { + message.signedHeader = SignedHeader.fromAmino(object.signed_header); + } + if (object.validator_set !== undefined && object.validator_set !== null) { + message.validatorSet = ValidatorSet.fromAmino(object.validator_set); + } + if (object.trusted_height !== undefined && object.trusted_height !== null) { + message.trustedHeight = Height.fromAmino(object.trusted_height); + } + if (object.trusted_validators !== undefined && object.trusted_validators !== null) { + message.trustedValidators = ValidatorSet.fromAmino(object.trusted_validators); + } + return message; }, toAmino(message: Header): HeaderAmino { const obj: any = {}; @@ -734,6 +901,8 @@ export const Header = { }; } }; +GlobalDecoderRegistry.register(Header.typeUrl, Header); +GlobalDecoderRegistry.registerAminoProtoMapping(Header.aminoType, Header.typeUrl); function createBaseFraction(): Fraction { return { numerator: BigInt(0), @@ -742,6 +911,16 @@ function createBaseFraction(): Fraction { } export const Fraction = { typeUrl: "/ibc.lightclients.tendermint.v1.Fraction", + aminoType: "cosmos-sdk/Fraction", + is(o: any): o is Fraction { + return o && (o.$typeUrl === Fraction.typeUrl || typeof o.numerator === "bigint" && typeof o.denominator === "bigint"); + }, + isSDK(o: any): o is FractionSDKType { + return o && (o.$typeUrl === Fraction.typeUrl || typeof o.numerator === "bigint" && typeof o.denominator === "bigint"); + }, + isAmino(o: any): o is FractionAmino { + return o && (o.$typeUrl === Fraction.typeUrl || typeof o.numerator === "bigint" && typeof o.denominator === "bigint"); + }, encode(message: Fraction, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.numerator !== BigInt(0)) { writer.uint32(8).uint64(message.numerator); @@ -771,6 +950,18 @@ export const Fraction = { } return message; }, + fromJSON(object: any): Fraction { + return { + numerator: isSet(object.numerator) ? BigInt(object.numerator.toString()) : BigInt(0), + denominator: isSet(object.denominator) ? BigInt(object.denominator.toString()) : BigInt(0) + }; + }, + toJSON(message: Fraction): unknown { + const obj: any = {}; + message.numerator !== undefined && (obj.numerator = (message.numerator || BigInt(0)).toString()); + message.denominator !== undefined && (obj.denominator = (message.denominator || BigInt(0)).toString()); + return obj; + }, fromPartial(object: Partial): Fraction { const message = createBaseFraction(); message.numerator = object.numerator !== undefined && object.numerator !== null ? BigInt(object.numerator.toString()) : BigInt(0); @@ -778,10 +969,14 @@ export const Fraction = { return message; }, fromAmino(object: FractionAmino): Fraction { - return { - numerator: BigInt(object.numerator), - denominator: BigInt(object.denominator) - }; + const message = createBaseFraction(); + if (object.numerator !== undefined && object.numerator !== null) { + message.numerator = BigInt(object.numerator); + } + if (object.denominator !== undefined && object.denominator !== null) { + message.denominator = BigInt(object.denominator); + } + return message; }, toAmino(message: Fraction): FractionAmino { const obj: any = {}; @@ -810,4 +1005,6 @@ export const Fraction = { value: Fraction.encode(message).finish() }; } -}; \ No newline at end of file +}; +GlobalDecoderRegistry.register(Fraction.typeUrl, Fraction); +GlobalDecoderRegistry.registerAminoProtoMapping(Fraction.aminoType, Fraction.typeUrl); \ No newline at end of file diff --git a/packages/osmojs/src/codegen/ibc/lightclients/wasm/v1/genesis.ts b/packages/osmojs/src/codegen/ibc/lightclients/wasm/v1/genesis.ts new file mode 100644 index 000000000..f28be5bf2 --- /dev/null +++ b/packages/osmojs/src/codegen/ibc/lightclients/wasm/v1/genesis.ts @@ -0,0 +1,235 @@ +import { BinaryReader, BinaryWriter } from "../../../../binary"; +import { GlobalDecoderRegistry } from "../../../../registry"; +import { isSet, bytesFromBase64, base64FromBytes } from "../../../../helpers"; +/** GenesisState defines 08-wasm's keeper genesis state */ +export interface GenesisState { + /** uploaded light client wasm contracts */ + contracts: Contract[]; +} +export interface GenesisStateProtoMsg { + typeUrl: "/ibc.lightclients.wasm.v1.GenesisState"; + value: Uint8Array; +} +/** GenesisState defines 08-wasm's keeper genesis state */ +export interface GenesisStateAmino { + /** uploaded light client wasm contracts */ + contracts?: ContractAmino[]; +} +export interface GenesisStateAminoMsg { + type: "cosmos-sdk/GenesisState"; + value: GenesisStateAmino; +} +/** GenesisState defines 08-wasm's keeper genesis state */ +export interface GenesisStateSDKType { + contracts: ContractSDKType[]; +} +/** Contract stores contract code */ +export interface Contract { + /** contract byte code */ + codeBytes: Uint8Array; +} +export interface ContractProtoMsg { + typeUrl: "/ibc.lightclients.wasm.v1.Contract"; + value: Uint8Array; +} +/** Contract stores contract code */ +export interface ContractAmino { + /** contract byte code */ + code_bytes?: string; +} +export interface ContractAminoMsg { + type: "cosmos-sdk/Contract"; + value: ContractAmino; +} +/** Contract stores contract code */ +export interface ContractSDKType { + code_bytes: Uint8Array; +} +function createBaseGenesisState(): GenesisState { + return { + contracts: [] + }; +} +export const GenesisState = { + typeUrl: "/ibc.lightclients.wasm.v1.GenesisState", + aminoType: "cosmos-sdk/GenesisState", + is(o: any): o is GenesisState { + return o && (o.$typeUrl === GenesisState.typeUrl || Array.isArray(o.contracts) && (!o.contracts.length || Contract.is(o.contracts[0]))); + }, + isSDK(o: any): o is GenesisStateSDKType { + return o && (o.$typeUrl === GenesisState.typeUrl || Array.isArray(o.contracts) && (!o.contracts.length || Contract.isSDK(o.contracts[0]))); + }, + isAmino(o: any): o is GenesisStateAmino { + return o && (o.$typeUrl === GenesisState.typeUrl || Array.isArray(o.contracts) && (!o.contracts.length || Contract.isAmino(o.contracts[0]))); + }, + encode(message: GenesisState, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.contracts) { + Contract.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): GenesisState { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGenesisState(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.contracts.push(Contract.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): GenesisState { + return { + contracts: Array.isArray(object?.contracts) ? object.contracts.map((e: any) => Contract.fromJSON(e)) : [] + }; + }, + toJSON(message: GenesisState): unknown { + const obj: any = {}; + if (message.contracts) { + obj.contracts = message.contracts.map(e => e ? Contract.toJSON(e) : undefined); + } else { + obj.contracts = []; + } + return obj; + }, + fromPartial(object: Partial): GenesisState { + const message = createBaseGenesisState(); + message.contracts = object.contracts?.map(e => Contract.fromPartial(e)) || []; + return message; + }, + fromAmino(object: GenesisStateAmino): GenesisState { + const message = createBaseGenesisState(); + message.contracts = object.contracts?.map(e => Contract.fromAmino(e)) || []; + return message; + }, + toAmino(message: GenesisState): GenesisStateAmino { + const obj: any = {}; + if (message.contracts) { + obj.contracts = message.contracts.map(e => e ? Contract.toAmino(e) : undefined); + } else { + obj.contracts = []; + } + return obj; + }, + fromAminoMsg(object: GenesisStateAminoMsg): GenesisState { + return GenesisState.fromAmino(object.value); + }, + toAminoMsg(message: GenesisState): GenesisStateAminoMsg { + return { + type: "cosmos-sdk/GenesisState", + value: GenesisState.toAmino(message) + }; + }, + fromProtoMsg(message: GenesisStateProtoMsg): GenesisState { + return GenesisState.decode(message.value); + }, + toProto(message: GenesisState): Uint8Array { + return GenesisState.encode(message).finish(); + }, + toProtoMsg(message: GenesisState): GenesisStateProtoMsg { + return { + typeUrl: "/ibc.lightclients.wasm.v1.GenesisState", + value: GenesisState.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(GenesisState.typeUrl, GenesisState); +GlobalDecoderRegistry.registerAminoProtoMapping(GenesisState.aminoType, GenesisState.typeUrl); +function createBaseContract(): Contract { + return { + codeBytes: new Uint8Array() + }; +} +export const Contract = { + typeUrl: "/ibc.lightclients.wasm.v1.Contract", + aminoType: "cosmos-sdk/Contract", + is(o: any): o is Contract { + return o && (o.$typeUrl === Contract.typeUrl || o.codeBytes instanceof Uint8Array || typeof o.codeBytes === "string"); + }, + isSDK(o: any): o is ContractSDKType { + return o && (o.$typeUrl === Contract.typeUrl || o.code_bytes instanceof Uint8Array || typeof o.code_bytes === "string"); + }, + isAmino(o: any): o is ContractAmino { + return o && (o.$typeUrl === Contract.typeUrl || o.code_bytes instanceof Uint8Array || typeof o.code_bytes === "string"); + }, + encode(message: Contract, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.codeBytes.length !== 0) { + writer.uint32(10).bytes(message.codeBytes); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): Contract { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseContract(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.codeBytes = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): Contract { + return { + codeBytes: isSet(object.codeBytes) ? bytesFromBase64(object.codeBytes) : new Uint8Array() + }; + }, + toJSON(message: Contract): unknown { + const obj: any = {}; + message.codeBytes !== undefined && (obj.codeBytes = base64FromBytes(message.codeBytes !== undefined ? message.codeBytes : new Uint8Array())); + return obj; + }, + fromPartial(object: Partial): Contract { + const message = createBaseContract(); + message.codeBytes = object.codeBytes ?? new Uint8Array(); + return message; + }, + fromAmino(object: ContractAmino): Contract { + const message = createBaseContract(); + if (object.code_bytes !== undefined && object.code_bytes !== null) { + message.codeBytes = bytesFromBase64(object.code_bytes); + } + return message; + }, + toAmino(message: Contract): ContractAmino { + const obj: any = {}; + obj.code_bytes = message.codeBytes ? base64FromBytes(message.codeBytes) : undefined; + return obj; + }, + fromAminoMsg(object: ContractAminoMsg): Contract { + return Contract.fromAmino(object.value); + }, + toAminoMsg(message: Contract): ContractAminoMsg { + return { + type: "cosmos-sdk/Contract", + value: Contract.toAmino(message) + }; + }, + fromProtoMsg(message: ContractProtoMsg): Contract { + return Contract.decode(message.value); + }, + toProto(message: Contract): Uint8Array { + return Contract.encode(message).finish(); + }, + toProtoMsg(message: Contract): ContractProtoMsg { + return { + typeUrl: "/ibc.lightclients.wasm.v1.Contract", + value: Contract.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(Contract.typeUrl, Contract); +GlobalDecoderRegistry.registerAminoProtoMapping(Contract.aminoType, Contract.typeUrl); \ No newline at end of file diff --git a/packages/osmojs/src/codegen/ibc/lightclients/wasm/v1/query.lcd.ts b/packages/osmojs/src/codegen/ibc/lightclients/wasm/v1/query.lcd.ts new file mode 100644 index 000000000..df9dd94a1 --- /dev/null +++ b/packages/osmojs/src/codegen/ibc/lightclients/wasm/v1/query.lcd.ts @@ -0,0 +1,33 @@ +import { setPaginationParams } from "../../../../helpers"; +import { LCDClient } from "@cosmology/lcd"; +import { QueryChecksumsRequest, QueryChecksumsResponseSDKType, QueryCodeRequest, QueryCodeResponseSDKType } from "./query"; +export class LCDQueryClient { + req: LCDClient; + constructor({ + requestClient + }: { + requestClient: LCDClient; + }) { + this.req = requestClient; + this.checksums = this.checksums.bind(this); + this.code = this.code.bind(this); + } + /* Get all Wasm checksums */ + async checksums(params: QueryChecksumsRequest = { + pagination: undefined + }): Promise { + const options: any = { + params: {} + }; + if (typeof params?.pagination !== "undefined") { + setPaginationParams(options, params.pagination); + } + const endpoint = `ibc/lightclients/wasm/v1/checksums`; + return await this.req.get(endpoint, options); + } + /* Get Wasm code for given checksum */ + async code(params: QueryCodeRequest): Promise { + const endpoint = `ibc/lightclients/wasm/v1/checksums/${params.checksum}/code`; + return await this.req.get(endpoint); + } +} \ No newline at end of file diff --git a/packages/osmojs/src/codegen/ibc/lightclients/wasm/v1/query.rpc.Query.ts b/packages/osmojs/src/codegen/ibc/lightclients/wasm/v1/query.rpc.Query.ts new file mode 100644 index 000000000..3641d12dc --- /dev/null +++ b/packages/osmojs/src/codegen/ibc/lightclients/wasm/v1/query.rpc.Query.ts @@ -0,0 +1,43 @@ +import { Rpc } from "../../../../helpers"; +import { BinaryReader } from "../../../../binary"; +import { QueryClient, createProtobufRpcClient } from "@cosmjs/stargate"; +import { QueryChecksumsRequest, QueryChecksumsResponse, QueryCodeRequest, QueryCodeResponse } from "./query"; +/** Query service for wasm module */ +export interface Query { + /** Get all Wasm checksums */ + checksums(request?: QueryChecksumsRequest): Promise; + /** Get Wasm code for given checksum */ + code(request: QueryCodeRequest): Promise; +} +export class QueryClientImpl implements Query { + private readonly rpc: Rpc; + constructor(rpc: Rpc) { + this.rpc = rpc; + this.checksums = this.checksums.bind(this); + this.code = this.code.bind(this); + } + checksums(request: QueryChecksumsRequest = { + pagination: undefined + }): Promise { + const data = QueryChecksumsRequest.encode(request).finish(); + const promise = this.rpc.request("ibc.lightclients.wasm.v1.Query", "Checksums", data); + return promise.then(data => QueryChecksumsResponse.decode(new BinaryReader(data))); + } + code(request: QueryCodeRequest): Promise { + const data = QueryCodeRequest.encode(request).finish(); + const promise = this.rpc.request("ibc.lightclients.wasm.v1.Query", "Code", data); + return promise.then(data => QueryCodeResponse.decode(new BinaryReader(data))); + } +} +export const createRpcQueryExtension = (base: QueryClient) => { + const rpc = createProtobufRpcClient(base); + const queryService = new QueryClientImpl(rpc); + return { + checksums(request?: QueryChecksumsRequest): Promise { + return queryService.checksums(request); + }, + code(request: QueryCodeRequest): Promise { + return queryService.code(request); + } + }; +}; \ No newline at end of file diff --git a/packages/osmojs/src/codegen/ibc/lightclients/wasm/v1/query.ts b/packages/osmojs/src/codegen/ibc/lightclients/wasm/v1/query.ts new file mode 100644 index 000000000..688d8dd6f --- /dev/null +++ b/packages/osmojs/src/codegen/ibc/lightclients/wasm/v1/query.ts @@ -0,0 +1,479 @@ +import { PageRequest, PageRequestAmino, PageRequestSDKType, PageResponse, PageResponseAmino, PageResponseSDKType } from "../../../../cosmos/base/query/v1beta1/pagination"; +import { BinaryReader, BinaryWriter } from "../../../../binary"; +import { isSet, bytesFromBase64, base64FromBytes } from "../../../../helpers"; +import { GlobalDecoderRegistry } from "../../../../registry"; +/** QueryChecksumsRequest is the request type for the Query/Checksums RPC method. */ +export interface QueryChecksumsRequest { + /** pagination defines an optional pagination for the request. */ + pagination?: PageRequest; +} +export interface QueryChecksumsRequestProtoMsg { + typeUrl: "/ibc.lightclients.wasm.v1.QueryChecksumsRequest"; + value: Uint8Array; +} +/** QueryChecksumsRequest is the request type for the Query/Checksums RPC method. */ +export interface QueryChecksumsRequestAmino { + /** pagination defines an optional pagination for the request. */ + pagination?: PageRequestAmino; +} +export interface QueryChecksumsRequestAminoMsg { + type: "cosmos-sdk/QueryChecksumsRequest"; + value: QueryChecksumsRequestAmino; +} +/** QueryChecksumsRequest is the request type for the Query/Checksums RPC method. */ +export interface QueryChecksumsRequestSDKType { + pagination?: PageRequestSDKType; +} +/** QueryChecksumsResponse is the response type for the Query/Checksums RPC method. */ +export interface QueryChecksumsResponse { + /** checksums is a list of the hex encoded checksums of all wasm codes stored. */ + checksums: string[]; + /** pagination defines the pagination in the response. */ + pagination?: PageResponse; +} +export interface QueryChecksumsResponseProtoMsg { + typeUrl: "/ibc.lightclients.wasm.v1.QueryChecksumsResponse"; + value: Uint8Array; +} +/** QueryChecksumsResponse is the response type for the Query/Checksums RPC method. */ +export interface QueryChecksumsResponseAmino { + /** checksums is a list of the hex encoded checksums of all wasm codes stored. */ + checksums?: string[]; + /** pagination defines the pagination in the response. */ + pagination?: PageResponseAmino; +} +export interface QueryChecksumsResponseAminoMsg { + type: "cosmos-sdk/QueryChecksumsResponse"; + value: QueryChecksumsResponseAmino; +} +/** QueryChecksumsResponse is the response type for the Query/Checksums RPC method. */ +export interface QueryChecksumsResponseSDKType { + checksums: string[]; + pagination?: PageResponseSDKType; +} +/** QueryCodeRequest is the request type for the Query/Code RPC method. */ +export interface QueryCodeRequest { + /** checksum is a hex encoded string of the code stored. */ + checksum: string; +} +export interface QueryCodeRequestProtoMsg { + typeUrl: "/ibc.lightclients.wasm.v1.QueryCodeRequest"; + value: Uint8Array; +} +/** QueryCodeRequest is the request type for the Query/Code RPC method. */ +export interface QueryCodeRequestAmino { + /** checksum is a hex encoded string of the code stored. */ + checksum?: string; +} +export interface QueryCodeRequestAminoMsg { + type: "cosmos-sdk/QueryCodeRequest"; + value: QueryCodeRequestAmino; +} +/** QueryCodeRequest is the request type for the Query/Code RPC method. */ +export interface QueryCodeRequestSDKType { + checksum: string; +} +/** QueryCodeResponse is the response type for the Query/Code RPC method. */ +export interface QueryCodeResponse { + data: Uint8Array; +} +export interface QueryCodeResponseProtoMsg { + typeUrl: "/ibc.lightclients.wasm.v1.QueryCodeResponse"; + value: Uint8Array; +} +/** QueryCodeResponse is the response type for the Query/Code RPC method. */ +export interface QueryCodeResponseAmino { + data?: string; +} +export interface QueryCodeResponseAminoMsg { + type: "cosmos-sdk/QueryCodeResponse"; + value: QueryCodeResponseAmino; +} +/** QueryCodeResponse is the response type for the Query/Code RPC method. */ +export interface QueryCodeResponseSDKType { + data: Uint8Array; +} +function createBaseQueryChecksumsRequest(): QueryChecksumsRequest { + return { + pagination: undefined + }; +} +export const QueryChecksumsRequest = { + typeUrl: "/ibc.lightclients.wasm.v1.QueryChecksumsRequest", + aminoType: "cosmos-sdk/QueryChecksumsRequest", + is(o: any): o is QueryChecksumsRequest { + return o && o.$typeUrl === QueryChecksumsRequest.typeUrl; + }, + isSDK(o: any): o is QueryChecksumsRequestSDKType { + return o && o.$typeUrl === QueryChecksumsRequest.typeUrl; + }, + isAmino(o: any): o is QueryChecksumsRequestAmino { + return o && o.$typeUrl === QueryChecksumsRequest.typeUrl; + }, + encode(message: QueryChecksumsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.pagination !== undefined) { + PageRequest.encode(message.pagination, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryChecksumsRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryChecksumsRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.pagination = PageRequest.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): QueryChecksumsRequest { + return { + pagination: isSet(object.pagination) ? PageRequest.fromJSON(object.pagination) : undefined + }; + }, + toJSON(message: QueryChecksumsRequest): unknown { + const obj: any = {}; + message.pagination !== undefined && (obj.pagination = message.pagination ? PageRequest.toJSON(message.pagination) : undefined); + return obj; + }, + fromPartial(object: Partial): QueryChecksumsRequest { + const message = createBaseQueryChecksumsRequest(); + message.pagination = object.pagination !== undefined && object.pagination !== null ? PageRequest.fromPartial(object.pagination) : undefined; + return message; + }, + fromAmino(object: QueryChecksumsRequestAmino): QueryChecksumsRequest { + const message = createBaseQueryChecksumsRequest(); + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromAmino(object.pagination); + } + return message; + }, + toAmino(message: QueryChecksumsRequest): QueryChecksumsRequestAmino { + const obj: any = {}; + obj.pagination = message.pagination ? PageRequest.toAmino(message.pagination) : undefined; + return obj; + }, + fromAminoMsg(object: QueryChecksumsRequestAminoMsg): QueryChecksumsRequest { + return QueryChecksumsRequest.fromAmino(object.value); + }, + toAminoMsg(message: QueryChecksumsRequest): QueryChecksumsRequestAminoMsg { + return { + type: "cosmos-sdk/QueryChecksumsRequest", + value: QueryChecksumsRequest.toAmino(message) + }; + }, + fromProtoMsg(message: QueryChecksumsRequestProtoMsg): QueryChecksumsRequest { + return QueryChecksumsRequest.decode(message.value); + }, + toProto(message: QueryChecksumsRequest): Uint8Array { + return QueryChecksumsRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryChecksumsRequest): QueryChecksumsRequestProtoMsg { + return { + typeUrl: "/ibc.lightclients.wasm.v1.QueryChecksumsRequest", + value: QueryChecksumsRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryChecksumsRequest.typeUrl, QueryChecksumsRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryChecksumsRequest.aminoType, QueryChecksumsRequest.typeUrl); +function createBaseQueryChecksumsResponse(): QueryChecksumsResponse { + return { + checksums: [], + pagination: undefined + }; +} +export const QueryChecksumsResponse = { + typeUrl: "/ibc.lightclients.wasm.v1.QueryChecksumsResponse", + aminoType: "cosmos-sdk/QueryChecksumsResponse", + is(o: any): o is QueryChecksumsResponse { + return o && (o.$typeUrl === QueryChecksumsResponse.typeUrl || Array.isArray(o.checksums) && (!o.checksums.length || typeof o.checksums[0] === "string")); + }, + isSDK(o: any): o is QueryChecksumsResponseSDKType { + return o && (o.$typeUrl === QueryChecksumsResponse.typeUrl || Array.isArray(o.checksums) && (!o.checksums.length || typeof o.checksums[0] === "string")); + }, + isAmino(o: any): o is QueryChecksumsResponseAmino { + return o && (o.$typeUrl === QueryChecksumsResponse.typeUrl || Array.isArray(o.checksums) && (!o.checksums.length || typeof o.checksums[0] === "string")); + }, + encode(message: QueryChecksumsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.checksums) { + writer.uint32(10).string(v!); + } + if (message.pagination !== undefined) { + PageResponse.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryChecksumsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryChecksumsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.checksums.push(reader.string()); + break; + case 2: + message.pagination = PageResponse.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): QueryChecksumsResponse { + return { + checksums: Array.isArray(object?.checksums) ? object.checksums.map((e: any) => String(e)) : [], + pagination: isSet(object.pagination) ? PageResponse.fromJSON(object.pagination) : undefined + }; + }, + toJSON(message: QueryChecksumsResponse): unknown { + const obj: any = {}; + if (message.checksums) { + obj.checksums = message.checksums.map(e => e); + } else { + obj.checksums = []; + } + message.pagination !== undefined && (obj.pagination = message.pagination ? PageResponse.toJSON(message.pagination) : undefined); + return obj; + }, + fromPartial(object: Partial): QueryChecksumsResponse { + const message = createBaseQueryChecksumsResponse(); + message.checksums = object.checksums?.map(e => e) || []; + message.pagination = object.pagination !== undefined && object.pagination !== null ? PageResponse.fromPartial(object.pagination) : undefined; + return message; + }, + fromAmino(object: QueryChecksumsResponseAmino): QueryChecksumsResponse { + const message = createBaseQueryChecksumsResponse(); + message.checksums = object.checksums?.map(e => e) || []; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromAmino(object.pagination); + } + return message; + }, + toAmino(message: QueryChecksumsResponse): QueryChecksumsResponseAmino { + const obj: any = {}; + if (message.checksums) { + obj.checksums = message.checksums.map(e => e); + } else { + obj.checksums = []; + } + obj.pagination = message.pagination ? PageResponse.toAmino(message.pagination) : undefined; + return obj; + }, + fromAminoMsg(object: QueryChecksumsResponseAminoMsg): QueryChecksumsResponse { + return QueryChecksumsResponse.fromAmino(object.value); + }, + toAminoMsg(message: QueryChecksumsResponse): QueryChecksumsResponseAminoMsg { + return { + type: "cosmos-sdk/QueryChecksumsResponse", + value: QueryChecksumsResponse.toAmino(message) + }; + }, + fromProtoMsg(message: QueryChecksumsResponseProtoMsg): QueryChecksumsResponse { + return QueryChecksumsResponse.decode(message.value); + }, + toProto(message: QueryChecksumsResponse): Uint8Array { + return QueryChecksumsResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryChecksumsResponse): QueryChecksumsResponseProtoMsg { + return { + typeUrl: "/ibc.lightclients.wasm.v1.QueryChecksumsResponse", + value: QueryChecksumsResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryChecksumsResponse.typeUrl, QueryChecksumsResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryChecksumsResponse.aminoType, QueryChecksumsResponse.typeUrl); +function createBaseQueryCodeRequest(): QueryCodeRequest { + return { + checksum: "" + }; +} +export const QueryCodeRequest = { + typeUrl: "/ibc.lightclients.wasm.v1.QueryCodeRequest", + aminoType: "cosmos-sdk/QueryCodeRequest", + is(o: any): o is QueryCodeRequest { + return o && (o.$typeUrl === QueryCodeRequest.typeUrl || typeof o.checksum === "string"); + }, + isSDK(o: any): o is QueryCodeRequestSDKType { + return o && (o.$typeUrl === QueryCodeRequest.typeUrl || typeof o.checksum === "string"); + }, + isAmino(o: any): o is QueryCodeRequestAmino { + return o && (o.$typeUrl === QueryCodeRequest.typeUrl || typeof o.checksum === "string"); + }, + encode(message: QueryCodeRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.checksum !== "") { + writer.uint32(10).string(message.checksum); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryCodeRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryCodeRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.checksum = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): QueryCodeRequest { + return { + checksum: isSet(object.checksum) ? String(object.checksum) : "" + }; + }, + toJSON(message: QueryCodeRequest): unknown { + const obj: any = {}; + message.checksum !== undefined && (obj.checksum = message.checksum); + return obj; + }, + fromPartial(object: Partial): QueryCodeRequest { + const message = createBaseQueryCodeRequest(); + message.checksum = object.checksum ?? ""; + return message; + }, + fromAmino(object: QueryCodeRequestAmino): QueryCodeRequest { + const message = createBaseQueryCodeRequest(); + if (object.checksum !== undefined && object.checksum !== null) { + message.checksum = object.checksum; + } + return message; + }, + toAmino(message: QueryCodeRequest): QueryCodeRequestAmino { + const obj: any = {}; + obj.checksum = message.checksum; + return obj; + }, + fromAminoMsg(object: QueryCodeRequestAminoMsg): QueryCodeRequest { + return QueryCodeRequest.fromAmino(object.value); + }, + toAminoMsg(message: QueryCodeRequest): QueryCodeRequestAminoMsg { + return { + type: "cosmos-sdk/QueryCodeRequest", + value: QueryCodeRequest.toAmino(message) + }; + }, + fromProtoMsg(message: QueryCodeRequestProtoMsg): QueryCodeRequest { + return QueryCodeRequest.decode(message.value); + }, + toProto(message: QueryCodeRequest): Uint8Array { + return QueryCodeRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryCodeRequest): QueryCodeRequestProtoMsg { + return { + typeUrl: "/ibc.lightclients.wasm.v1.QueryCodeRequest", + value: QueryCodeRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryCodeRequest.typeUrl, QueryCodeRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryCodeRequest.aminoType, QueryCodeRequest.typeUrl); +function createBaseQueryCodeResponse(): QueryCodeResponse { + return { + data: new Uint8Array() + }; +} +export const QueryCodeResponse = { + typeUrl: "/ibc.lightclients.wasm.v1.QueryCodeResponse", + aminoType: "cosmos-sdk/QueryCodeResponse", + is(o: any): o is QueryCodeResponse { + return o && (o.$typeUrl === QueryCodeResponse.typeUrl || o.data instanceof Uint8Array || typeof o.data === "string"); + }, + isSDK(o: any): o is QueryCodeResponseSDKType { + return o && (o.$typeUrl === QueryCodeResponse.typeUrl || o.data instanceof Uint8Array || typeof o.data === "string"); + }, + isAmino(o: any): o is QueryCodeResponseAmino { + return o && (o.$typeUrl === QueryCodeResponse.typeUrl || o.data instanceof Uint8Array || typeof o.data === "string"); + }, + encode(message: QueryCodeResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.data.length !== 0) { + writer.uint32(10).bytes(message.data); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryCodeResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryCodeResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.data = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): QueryCodeResponse { + return { + data: isSet(object.data) ? bytesFromBase64(object.data) : new Uint8Array() + }; + }, + toJSON(message: QueryCodeResponse): unknown { + const obj: any = {}; + message.data !== undefined && (obj.data = base64FromBytes(message.data !== undefined ? message.data : new Uint8Array())); + return obj; + }, + fromPartial(object: Partial): QueryCodeResponse { + const message = createBaseQueryCodeResponse(); + message.data = object.data ?? new Uint8Array(); + return message; + }, + fromAmino(object: QueryCodeResponseAmino): QueryCodeResponse { + const message = createBaseQueryCodeResponse(); + if (object.data !== undefined && object.data !== null) { + message.data = bytesFromBase64(object.data); + } + return message; + }, + toAmino(message: QueryCodeResponse): QueryCodeResponseAmino { + const obj: any = {}; + obj.data = message.data ? base64FromBytes(message.data) : undefined; + return obj; + }, + fromAminoMsg(object: QueryCodeResponseAminoMsg): QueryCodeResponse { + return QueryCodeResponse.fromAmino(object.value); + }, + toAminoMsg(message: QueryCodeResponse): QueryCodeResponseAminoMsg { + return { + type: "cosmos-sdk/QueryCodeResponse", + value: QueryCodeResponse.toAmino(message) + }; + }, + fromProtoMsg(message: QueryCodeResponseProtoMsg): QueryCodeResponse { + return QueryCodeResponse.decode(message.value); + }, + toProto(message: QueryCodeResponse): Uint8Array { + return QueryCodeResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryCodeResponse): QueryCodeResponseProtoMsg { + return { + typeUrl: "/ibc.lightclients.wasm.v1.QueryCodeResponse", + value: QueryCodeResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryCodeResponse.typeUrl, QueryCodeResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryCodeResponse.aminoType, QueryCodeResponse.typeUrl); \ No newline at end of file diff --git a/packages/osmojs/src/codegen/ibc/lightclients/wasm/v1/tx.amino.ts b/packages/osmojs/src/codegen/ibc/lightclients/wasm/v1/tx.amino.ts new file mode 100644 index 000000000..09e56fb66 --- /dev/null +++ b/packages/osmojs/src/codegen/ibc/lightclients/wasm/v1/tx.amino.ts @@ -0,0 +1,19 @@ +//@ts-nocheck +import { MsgStoreCode, MsgRemoveChecksum, MsgMigrateContract } from "./tx"; +export const AminoConverter = { + "/ibc.lightclients.wasm.v1.MsgStoreCode": { + aminoType: "cosmos-sdk/MsgStoreCode", + toAmino: MsgStoreCode.toAmino, + fromAmino: MsgStoreCode.fromAmino + }, + "/ibc.lightclients.wasm.v1.MsgRemoveChecksum": { + aminoType: "cosmos-sdk/MsgRemoveChecksum", + toAmino: MsgRemoveChecksum.toAmino, + fromAmino: MsgRemoveChecksum.fromAmino + }, + "/ibc.lightclients.wasm.v1.MsgMigrateContract": { + aminoType: "cosmos-sdk/MsgMigrateContract", + toAmino: MsgMigrateContract.toAmino, + fromAmino: MsgMigrateContract.fromAmino + } +}; \ No newline at end of file diff --git a/packages/osmojs/src/codegen/ibc/lightclients/wasm/v1/tx.registry.ts b/packages/osmojs/src/codegen/ibc/lightclients/wasm/v1/tx.registry.ts new file mode 100644 index 000000000..409ace775 --- /dev/null +++ b/packages/osmojs/src/codegen/ibc/lightclients/wasm/v1/tx.registry.ts @@ -0,0 +1,111 @@ +//@ts-nocheck +import { GeneratedType, Registry } from "@cosmjs/proto-signing"; +import { MsgStoreCode, MsgRemoveChecksum, MsgMigrateContract } from "./tx"; +export const registry: ReadonlyArray<[string, GeneratedType]> = [["/ibc.lightclients.wasm.v1.MsgStoreCode", MsgStoreCode], ["/ibc.lightclients.wasm.v1.MsgRemoveChecksum", MsgRemoveChecksum], ["/ibc.lightclients.wasm.v1.MsgMigrateContract", MsgMigrateContract]]; +export const load = (protoRegistry: Registry) => { + registry.forEach(([typeUrl, mod]) => { + protoRegistry.register(typeUrl, mod); + }); +}; +export const MessageComposer = { + encoded: { + storeCode(value: MsgStoreCode) { + return { + typeUrl: "/ibc.lightclients.wasm.v1.MsgStoreCode", + value: MsgStoreCode.encode(value).finish() + }; + }, + removeChecksum(value: MsgRemoveChecksum) { + return { + typeUrl: "/ibc.lightclients.wasm.v1.MsgRemoveChecksum", + value: MsgRemoveChecksum.encode(value).finish() + }; + }, + migrateContract(value: MsgMigrateContract) { + return { + typeUrl: "/ibc.lightclients.wasm.v1.MsgMigrateContract", + value: MsgMigrateContract.encode(value).finish() + }; + } + }, + withTypeUrl: { + storeCode(value: MsgStoreCode) { + return { + typeUrl: "/ibc.lightclients.wasm.v1.MsgStoreCode", + value + }; + }, + removeChecksum(value: MsgRemoveChecksum) { + return { + typeUrl: "/ibc.lightclients.wasm.v1.MsgRemoveChecksum", + value + }; + }, + migrateContract(value: MsgMigrateContract) { + return { + typeUrl: "/ibc.lightclients.wasm.v1.MsgMigrateContract", + value + }; + } + }, + toJSON: { + storeCode(value: MsgStoreCode) { + return { + typeUrl: "/ibc.lightclients.wasm.v1.MsgStoreCode", + value: MsgStoreCode.toJSON(value) + }; + }, + removeChecksum(value: MsgRemoveChecksum) { + return { + typeUrl: "/ibc.lightclients.wasm.v1.MsgRemoveChecksum", + value: MsgRemoveChecksum.toJSON(value) + }; + }, + migrateContract(value: MsgMigrateContract) { + return { + typeUrl: "/ibc.lightclients.wasm.v1.MsgMigrateContract", + value: MsgMigrateContract.toJSON(value) + }; + } + }, + fromJSON: { + storeCode(value: any) { + return { + typeUrl: "/ibc.lightclients.wasm.v1.MsgStoreCode", + value: MsgStoreCode.fromJSON(value) + }; + }, + removeChecksum(value: any) { + return { + typeUrl: "/ibc.lightclients.wasm.v1.MsgRemoveChecksum", + value: MsgRemoveChecksum.fromJSON(value) + }; + }, + migrateContract(value: any) { + return { + typeUrl: "/ibc.lightclients.wasm.v1.MsgMigrateContract", + value: MsgMigrateContract.fromJSON(value) + }; + } + }, + fromPartial: { + storeCode(value: MsgStoreCode) { + return { + typeUrl: "/ibc.lightclients.wasm.v1.MsgStoreCode", + value: MsgStoreCode.fromPartial(value) + }; + }, + removeChecksum(value: MsgRemoveChecksum) { + return { + typeUrl: "/ibc.lightclients.wasm.v1.MsgRemoveChecksum", + value: MsgRemoveChecksum.fromPartial(value) + }; + }, + migrateContract(value: MsgMigrateContract) { + return { + typeUrl: "/ibc.lightclients.wasm.v1.MsgMigrateContract", + value: MsgMigrateContract.fromPartial(value) + }; + } + } +}; \ No newline at end of file diff --git a/packages/osmojs/src/codegen/ibc/lightclients/wasm/v1/tx.rpc.msg.ts b/packages/osmojs/src/codegen/ibc/lightclients/wasm/v1/tx.rpc.msg.ts new file mode 100644 index 000000000..99553054b --- /dev/null +++ b/packages/osmojs/src/codegen/ibc/lightclients/wasm/v1/tx.rpc.msg.ts @@ -0,0 +1,39 @@ +import { Rpc } from "../../../../helpers"; +import { BinaryReader } from "../../../../binary"; +import { MsgStoreCode, MsgStoreCodeResponse, MsgRemoveChecksum, MsgRemoveChecksumResponse, MsgMigrateContract, MsgMigrateContractResponse } from "./tx"; +/** Msg defines the ibc/08-wasm Msg service. */ +export interface Msg { + /** StoreCode defines a rpc handler method for MsgStoreCode. */ + storeCode(request: MsgStoreCode): Promise; + /** RemoveChecksum defines a rpc handler method for MsgRemoveChecksum. */ + removeChecksum(request: MsgRemoveChecksum): Promise; + /** MigrateContract defines a rpc handler method for MsgMigrateContract. */ + migrateContract(request: MsgMigrateContract): Promise; +} +export class MsgClientImpl implements Msg { + private readonly rpc: Rpc; + constructor(rpc: Rpc) { + this.rpc = rpc; + this.storeCode = this.storeCode.bind(this); + this.removeChecksum = this.removeChecksum.bind(this); + this.migrateContract = this.migrateContract.bind(this); + } + storeCode(request: MsgStoreCode): Promise { + const data = MsgStoreCode.encode(request).finish(); + const promise = this.rpc.request("ibc.lightclients.wasm.v1.Msg", "StoreCode", data); + return promise.then(data => MsgStoreCodeResponse.decode(new BinaryReader(data))); + } + removeChecksum(request: MsgRemoveChecksum): Promise { + const data = MsgRemoveChecksum.encode(request).finish(); + const promise = this.rpc.request("ibc.lightclients.wasm.v1.Msg", "RemoveChecksum", data); + return promise.then(data => MsgRemoveChecksumResponse.decode(new BinaryReader(data))); + } + migrateContract(request: MsgMigrateContract): Promise { + const data = MsgMigrateContract.encode(request).finish(); + const promise = this.rpc.request("ibc.lightclients.wasm.v1.Msg", "MigrateContract", data); + return promise.then(data => MsgMigrateContractResponse.decode(new BinaryReader(data))); + } +} +export const createClientImpl = (rpc: Rpc) => { + return new MsgClientImpl(rpc); +}; \ No newline at end of file diff --git a/packages/osmojs/src/codegen/ibc/lightclients/wasm/v1/tx.ts b/packages/osmojs/src/codegen/ibc/lightclients/wasm/v1/tx.ts new file mode 100644 index 000000000..45ace75b7 --- /dev/null +++ b/packages/osmojs/src/codegen/ibc/lightclients/wasm/v1/tx.ts @@ -0,0 +1,728 @@ +import { BinaryReader, BinaryWriter } from "../../../../binary"; +import { isSet, bytesFromBase64, base64FromBytes } from "../../../../helpers"; +import { GlobalDecoderRegistry } from "../../../../registry"; +/** MsgStoreCode defines the request type for the StoreCode rpc. */ +export interface MsgStoreCode { + /** signer address */ + signer: string; + /** wasm byte code of light client contract. It can be raw or gzip compressed */ + wasmByteCode: Uint8Array; +} +export interface MsgStoreCodeProtoMsg { + typeUrl: "/ibc.lightclients.wasm.v1.MsgStoreCode"; + value: Uint8Array; +} +/** MsgStoreCode defines the request type for the StoreCode rpc. */ +export interface MsgStoreCodeAmino { + /** signer address */ + signer?: string; + /** wasm byte code of light client contract. It can be raw or gzip compressed */ + wasm_byte_code?: string; +} +export interface MsgStoreCodeAminoMsg { + type: "cosmos-sdk/MsgStoreCode"; + value: MsgStoreCodeAmino; +} +/** MsgStoreCode defines the request type for the StoreCode rpc. */ +export interface MsgStoreCodeSDKType { + signer: string; + wasm_byte_code: Uint8Array; +} +/** MsgStoreCodeResponse defines the response type for the StoreCode rpc */ +export interface MsgStoreCodeResponse { + /** checksum is the sha256 hash of the stored code */ + checksum: Uint8Array; +} +export interface MsgStoreCodeResponseProtoMsg { + typeUrl: "/ibc.lightclients.wasm.v1.MsgStoreCodeResponse"; + value: Uint8Array; +} +/** MsgStoreCodeResponse defines the response type for the StoreCode rpc */ +export interface MsgStoreCodeResponseAmino { + /** checksum is the sha256 hash of the stored code */ + checksum?: string; +} +export interface MsgStoreCodeResponseAminoMsg { + type: "cosmos-sdk/MsgStoreCodeResponse"; + value: MsgStoreCodeResponseAmino; +} +/** MsgStoreCodeResponse defines the response type for the StoreCode rpc */ +export interface MsgStoreCodeResponseSDKType { + checksum: Uint8Array; +} +/** MsgRemoveChecksum defines the request type for the MsgRemoveChecksum rpc. */ +export interface MsgRemoveChecksum { + /** signer address */ + signer: string; + /** checksum is the sha256 hash to be removed from the store */ + checksum: Uint8Array; +} +export interface MsgRemoveChecksumProtoMsg { + typeUrl: "/ibc.lightclients.wasm.v1.MsgRemoveChecksum"; + value: Uint8Array; +} +/** MsgRemoveChecksum defines the request type for the MsgRemoveChecksum rpc. */ +export interface MsgRemoveChecksumAmino { + /** signer address */ + signer?: string; + /** checksum is the sha256 hash to be removed from the store */ + checksum?: string; +} +export interface MsgRemoveChecksumAminoMsg { + type: "cosmos-sdk/MsgRemoveChecksum"; + value: MsgRemoveChecksumAmino; +} +/** MsgRemoveChecksum defines the request type for the MsgRemoveChecksum rpc. */ +export interface MsgRemoveChecksumSDKType { + signer: string; + checksum: Uint8Array; +} +/** MsgStoreChecksumResponse defines the response type for the StoreCode rpc */ +export interface MsgRemoveChecksumResponse {} +export interface MsgRemoveChecksumResponseProtoMsg { + typeUrl: "/ibc.lightclients.wasm.v1.MsgRemoveChecksumResponse"; + value: Uint8Array; +} +/** MsgStoreChecksumResponse defines the response type for the StoreCode rpc */ +export interface MsgRemoveChecksumResponseAmino {} +export interface MsgRemoveChecksumResponseAminoMsg { + type: "cosmos-sdk/MsgRemoveChecksumResponse"; + value: MsgRemoveChecksumResponseAmino; +} +/** MsgStoreChecksumResponse defines the response type for the StoreCode rpc */ +export interface MsgRemoveChecksumResponseSDKType {} +/** MsgMigrateContract defines the request type for the MigrateContract rpc. */ +export interface MsgMigrateContract { + /** signer address */ + signer: string; + /** the client id of the contract */ + clientId: string; + /** checksum is the sha256 hash of the new wasm byte code for the contract */ + checksum: Uint8Array; + /** the json encoded message to be passed to the contract on migration */ + msg: Uint8Array; +} +export interface MsgMigrateContractProtoMsg { + typeUrl: "/ibc.lightclients.wasm.v1.MsgMigrateContract"; + value: Uint8Array; +} +/** MsgMigrateContract defines the request type for the MigrateContract rpc. */ +export interface MsgMigrateContractAmino { + /** signer address */ + signer?: string; + /** the client id of the contract */ + client_id?: string; + /** checksum is the sha256 hash of the new wasm byte code for the contract */ + checksum?: string; + /** the json encoded message to be passed to the contract on migration */ + msg?: string; +} +export interface MsgMigrateContractAminoMsg { + type: "cosmos-sdk/MsgMigrateContract"; + value: MsgMigrateContractAmino; +} +/** MsgMigrateContract defines the request type for the MigrateContract rpc. */ +export interface MsgMigrateContractSDKType { + signer: string; + client_id: string; + checksum: Uint8Array; + msg: Uint8Array; +} +/** MsgMigrateContractResponse defines the response type for the MigrateContract rpc */ +export interface MsgMigrateContractResponse {} +export interface MsgMigrateContractResponseProtoMsg { + typeUrl: "/ibc.lightclients.wasm.v1.MsgMigrateContractResponse"; + value: Uint8Array; +} +/** MsgMigrateContractResponse defines the response type for the MigrateContract rpc */ +export interface MsgMigrateContractResponseAmino {} +export interface MsgMigrateContractResponseAminoMsg { + type: "cosmos-sdk/MsgMigrateContractResponse"; + value: MsgMigrateContractResponseAmino; +} +/** MsgMigrateContractResponse defines the response type for the MigrateContract rpc */ +export interface MsgMigrateContractResponseSDKType {} +function createBaseMsgStoreCode(): MsgStoreCode { + return { + signer: "", + wasmByteCode: new Uint8Array() + }; +} +export const MsgStoreCode = { + typeUrl: "/ibc.lightclients.wasm.v1.MsgStoreCode", + aminoType: "cosmos-sdk/MsgStoreCode", + is(o: any): o is MsgStoreCode { + return o && (o.$typeUrl === MsgStoreCode.typeUrl || typeof o.signer === "string" && (o.wasmByteCode instanceof Uint8Array || typeof o.wasmByteCode === "string")); + }, + isSDK(o: any): o is MsgStoreCodeSDKType { + return o && (o.$typeUrl === MsgStoreCode.typeUrl || typeof o.signer === "string" && (o.wasm_byte_code instanceof Uint8Array || typeof o.wasm_byte_code === "string")); + }, + isAmino(o: any): o is MsgStoreCodeAmino { + return o && (o.$typeUrl === MsgStoreCode.typeUrl || typeof o.signer === "string" && (o.wasm_byte_code instanceof Uint8Array || typeof o.wasm_byte_code === "string")); + }, + encode(message: MsgStoreCode, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.signer !== "") { + writer.uint32(10).string(message.signer); + } + if (message.wasmByteCode.length !== 0) { + writer.uint32(18).bytes(message.wasmByteCode); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgStoreCode { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgStoreCode(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.signer = reader.string(); + break; + case 2: + message.wasmByteCode = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): MsgStoreCode { + return { + signer: isSet(object.signer) ? String(object.signer) : "", + wasmByteCode: isSet(object.wasmByteCode) ? bytesFromBase64(object.wasmByteCode) : new Uint8Array() + }; + }, + toJSON(message: MsgStoreCode): unknown { + const obj: any = {}; + message.signer !== undefined && (obj.signer = message.signer); + message.wasmByteCode !== undefined && (obj.wasmByteCode = base64FromBytes(message.wasmByteCode !== undefined ? message.wasmByteCode : new Uint8Array())); + return obj; + }, + fromPartial(object: Partial): MsgStoreCode { + const message = createBaseMsgStoreCode(); + message.signer = object.signer ?? ""; + message.wasmByteCode = object.wasmByteCode ?? new Uint8Array(); + return message; + }, + fromAmino(object: MsgStoreCodeAmino): MsgStoreCode { + const message = createBaseMsgStoreCode(); + if (object.signer !== undefined && object.signer !== null) { + message.signer = object.signer; + } + if (object.wasm_byte_code !== undefined && object.wasm_byte_code !== null) { + message.wasmByteCode = bytesFromBase64(object.wasm_byte_code); + } + return message; + }, + toAmino(message: MsgStoreCode): MsgStoreCodeAmino { + const obj: any = {}; + obj.signer = message.signer; + obj.wasm_byte_code = message.wasmByteCode ? base64FromBytes(message.wasmByteCode) : undefined; + return obj; + }, + fromAminoMsg(object: MsgStoreCodeAminoMsg): MsgStoreCode { + return MsgStoreCode.fromAmino(object.value); + }, + toAminoMsg(message: MsgStoreCode): MsgStoreCodeAminoMsg { + return { + type: "cosmos-sdk/MsgStoreCode", + value: MsgStoreCode.toAmino(message) + }; + }, + fromProtoMsg(message: MsgStoreCodeProtoMsg): MsgStoreCode { + return MsgStoreCode.decode(message.value); + }, + toProto(message: MsgStoreCode): Uint8Array { + return MsgStoreCode.encode(message).finish(); + }, + toProtoMsg(message: MsgStoreCode): MsgStoreCodeProtoMsg { + return { + typeUrl: "/ibc.lightclients.wasm.v1.MsgStoreCode", + value: MsgStoreCode.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgStoreCode.typeUrl, MsgStoreCode); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgStoreCode.aminoType, MsgStoreCode.typeUrl); +function createBaseMsgStoreCodeResponse(): MsgStoreCodeResponse { + return { + checksum: new Uint8Array() + }; +} +export const MsgStoreCodeResponse = { + typeUrl: "/ibc.lightclients.wasm.v1.MsgStoreCodeResponse", + aminoType: "cosmos-sdk/MsgStoreCodeResponse", + is(o: any): o is MsgStoreCodeResponse { + return o && (o.$typeUrl === MsgStoreCodeResponse.typeUrl || o.checksum instanceof Uint8Array || typeof o.checksum === "string"); + }, + isSDK(o: any): o is MsgStoreCodeResponseSDKType { + return o && (o.$typeUrl === MsgStoreCodeResponse.typeUrl || o.checksum instanceof Uint8Array || typeof o.checksum === "string"); + }, + isAmino(o: any): o is MsgStoreCodeResponseAmino { + return o && (o.$typeUrl === MsgStoreCodeResponse.typeUrl || o.checksum instanceof Uint8Array || typeof o.checksum === "string"); + }, + encode(message: MsgStoreCodeResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.checksum.length !== 0) { + writer.uint32(10).bytes(message.checksum); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgStoreCodeResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgStoreCodeResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.checksum = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): MsgStoreCodeResponse { + return { + checksum: isSet(object.checksum) ? bytesFromBase64(object.checksum) : new Uint8Array() + }; + }, + toJSON(message: MsgStoreCodeResponse): unknown { + const obj: any = {}; + message.checksum !== undefined && (obj.checksum = base64FromBytes(message.checksum !== undefined ? message.checksum : new Uint8Array())); + return obj; + }, + fromPartial(object: Partial): MsgStoreCodeResponse { + const message = createBaseMsgStoreCodeResponse(); + message.checksum = object.checksum ?? new Uint8Array(); + return message; + }, + fromAmino(object: MsgStoreCodeResponseAmino): MsgStoreCodeResponse { + const message = createBaseMsgStoreCodeResponse(); + if (object.checksum !== undefined && object.checksum !== null) { + message.checksum = bytesFromBase64(object.checksum); + } + return message; + }, + toAmino(message: MsgStoreCodeResponse): MsgStoreCodeResponseAmino { + const obj: any = {}; + obj.checksum = message.checksum ? base64FromBytes(message.checksum) : undefined; + return obj; + }, + fromAminoMsg(object: MsgStoreCodeResponseAminoMsg): MsgStoreCodeResponse { + return MsgStoreCodeResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgStoreCodeResponse): MsgStoreCodeResponseAminoMsg { + return { + type: "cosmos-sdk/MsgStoreCodeResponse", + value: MsgStoreCodeResponse.toAmino(message) + }; + }, + fromProtoMsg(message: MsgStoreCodeResponseProtoMsg): MsgStoreCodeResponse { + return MsgStoreCodeResponse.decode(message.value); + }, + toProto(message: MsgStoreCodeResponse): Uint8Array { + return MsgStoreCodeResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgStoreCodeResponse): MsgStoreCodeResponseProtoMsg { + return { + typeUrl: "/ibc.lightclients.wasm.v1.MsgStoreCodeResponse", + value: MsgStoreCodeResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgStoreCodeResponse.typeUrl, MsgStoreCodeResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgStoreCodeResponse.aminoType, MsgStoreCodeResponse.typeUrl); +function createBaseMsgRemoveChecksum(): MsgRemoveChecksum { + return { + signer: "", + checksum: new Uint8Array() + }; +} +export const MsgRemoveChecksum = { + typeUrl: "/ibc.lightclients.wasm.v1.MsgRemoveChecksum", + aminoType: "cosmos-sdk/MsgRemoveChecksum", + is(o: any): o is MsgRemoveChecksum { + return o && (o.$typeUrl === MsgRemoveChecksum.typeUrl || typeof o.signer === "string" && (o.checksum instanceof Uint8Array || typeof o.checksum === "string")); + }, + isSDK(o: any): o is MsgRemoveChecksumSDKType { + return o && (o.$typeUrl === MsgRemoveChecksum.typeUrl || typeof o.signer === "string" && (o.checksum instanceof Uint8Array || typeof o.checksum === "string")); + }, + isAmino(o: any): o is MsgRemoveChecksumAmino { + return o && (o.$typeUrl === MsgRemoveChecksum.typeUrl || typeof o.signer === "string" && (o.checksum instanceof Uint8Array || typeof o.checksum === "string")); + }, + encode(message: MsgRemoveChecksum, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.signer !== "") { + writer.uint32(10).string(message.signer); + } + if (message.checksum.length !== 0) { + writer.uint32(18).bytes(message.checksum); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgRemoveChecksum { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgRemoveChecksum(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.signer = reader.string(); + break; + case 2: + message.checksum = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): MsgRemoveChecksum { + return { + signer: isSet(object.signer) ? String(object.signer) : "", + checksum: isSet(object.checksum) ? bytesFromBase64(object.checksum) : new Uint8Array() + }; + }, + toJSON(message: MsgRemoveChecksum): unknown { + const obj: any = {}; + message.signer !== undefined && (obj.signer = message.signer); + message.checksum !== undefined && (obj.checksum = base64FromBytes(message.checksum !== undefined ? message.checksum : new Uint8Array())); + return obj; + }, + fromPartial(object: Partial): MsgRemoveChecksum { + const message = createBaseMsgRemoveChecksum(); + message.signer = object.signer ?? ""; + message.checksum = object.checksum ?? new Uint8Array(); + return message; + }, + fromAmino(object: MsgRemoveChecksumAmino): MsgRemoveChecksum { + const message = createBaseMsgRemoveChecksum(); + if (object.signer !== undefined && object.signer !== null) { + message.signer = object.signer; + } + if (object.checksum !== undefined && object.checksum !== null) { + message.checksum = bytesFromBase64(object.checksum); + } + return message; + }, + toAmino(message: MsgRemoveChecksum): MsgRemoveChecksumAmino { + const obj: any = {}; + obj.signer = message.signer; + obj.checksum = message.checksum ? base64FromBytes(message.checksum) : undefined; + return obj; + }, + fromAminoMsg(object: MsgRemoveChecksumAminoMsg): MsgRemoveChecksum { + return MsgRemoveChecksum.fromAmino(object.value); + }, + toAminoMsg(message: MsgRemoveChecksum): MsgRemoveChecksumAminoMsg { + return { + type: "cosmos-sdk/MsgRemoveChecksum", + value: MsgRemoveChecksum.toAmino(message) + }; + }, + fromProtoMsg(message: MsgRemoveChecksumProtoMsg): MsgRemoveChecksum { + return MsgRemoveChecksum.decode(message.value); + }, + toProto(message: MsgRemoveChecksum): Uint8Array { + return MsgRemoveChecksum.encode(message).finish(); + }, + toProtoMsg(message: MsgRemoveChecksum): MsgRemoveChecksumProtoMsg { + return { + typeUrl: "/ibc.lightclients.wasm.v1.MsgRemoveChecksum", + value: MsgRemoveChecksum.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgRemoveChecksum.typeUrl, MsgRemoveChecksum); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgRemoveChecksum.aminoType, MsgRemoveChecksum.typeUrl); +function createBaseMsgRemoveChecksumResponse(): MsgRemoveChecksumResponse { + return {}; +} +export const MsgRemoveChecksumResponse = { + typeUrl: "/ibc.lightclients.wasm.v1.MsgRemoveChecksumResponse", + aminoType: "cosmos-sdk/MsgRemoveChecksumResponse", + is(o: any): o is MsgRemoveChecksumResponse { + return o && o.$typeUrl === MsgRemoveChecksumResponse.typeUrl; + }, + isSDK(o: any): o is MsgRemoveChecksumResponseSDKType { + return o && o.$typeUrl === MsgRemoveChecksumResponse.typeUrl; + }, + isAmino(o: any): o is MsgRemoveChecksumResponseAmino { + return o && o.$typeUrl === MsgRemoveChecksumResponse.typeUrl; + }, + encode(_: MsgRemoveChecksumResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgRemoveChecksumResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgRemoveChecksumResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(_: any): MsgRemoveChecksumResponse { + return {}; + }, + toJSON(_: MsgRemoveChecksumResponse): unknown { + const obj: any = {}; + return obj; + }, + fromPartial(_: Partial): MsgRemoveChecksumResponse { + const message = createBaseMsgRemoveChecksumResponse(); + return message; + }, + fromAmino(_: MsgRemoveChecksumResponseAmino): MsgRemoveChecksumResponse { + const message = createBaseMsgRemoveChecksumResponse(); + return message; + }, + toAmino(_: MsgRemoveChecksumResponse): MsgRemoveChecksumResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgRemoveChecksumResponseAminoMsg): MsgRemoveChecksumResponse { + return MsgRemoveChecksumResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgRemoveChecksumResponse): MsgRemoveChecksumResponseAminoMsg { + return { + type: "cosmos-sdk/MsgRemoveChecksumResponse", + value: MsgRemoveChecksumResponse.toAmino(message) + }; + }, + fromProtoMsg(message: MsgRemoveChecksumResponseProtoMsg): MsgRemoveChecksumResponse { + return MsgRemoveChecksumResponse.decode(message.value); + }, + toProto(message: MsgRemoveChecksumResponse): Uint8Array { + return MsgRemoveChecksumResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgRemoveChecksumResponse): MsgRemoveChecksumResponseProtoMsg { + return { + typeUrl: "/ibc.lightclients.wasm.v1.MsgRemoveChecksumResponse", + value: MsgRemoveChecksumResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgRemoveChecksumResponse.typeUrl, MsgRemoveChecksumResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgRemoveChecksumResponse.aminoType, MsgRemoveChecksumResponse.typeUrl); +function createBaseMsgMigrateContract(): MsgMigrateContract { + return { + signer: "", + clientId: "", + checksum: new Uint8Array(), + msg: new Uint8Array() + }; +} +export const MsgMigrateContract = { + typeUrl: "/ibc.lightclients.wasm.v1.MsgMigrateContract", + aminoType: "cosmos-sdk/MsgMigrateContract", + is(o: any): o is MsgMigrateContract { + return o && (o.$typeUrl === MsgMigrateContract.typeUrl || typeof o.signer === "string" && typeof o.clientId === "string" && (o.checksum instanceof Uint8Array || typeof o.checksum === "string") && (o.msg instanceof Uint8Array || typeof o.msg === "string")); + }, + isSDK(o: any): o is MsgMigrateContractSDKType { + return o && (o.$typeUrl === MsgMigrateContract.typeUrl || typeof o.signer === "string" && typeof o.client_id === "string" && (o.checksum instanceof Uint8Array || typeof o.checksum === "string") && (o.msg instanceof Uint8Array || typeof o.msg === "string")); + }, + isAmino(o: any): o is MsgMigrateContractAmino { + return o && (o.$typeUrl === MsgMigrateContract.typeUrl || typeof o.signer === "string" && typeof o.client_id === "string" && (o.checksum instanceof Uint8Array || typeof o.checksum === "string") && (o.msg instanceof Uint8Array || typeof o.msg === "string")); + }, + encode(message: MsgMigrateContract, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.signer !== "") { + writer.uint32(10).string(message.signer); + } + if (message.clientId !== "") { + writer.uint32(18).string(message.clientId); + } + if (message.checksum.length !== 0) { + writer.uint32(26).bytes(message.checksum); + } + if (message.msg.length !== 0) { + writer.uint32(34).bytes(message.msg); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgMigrateContract { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgMigrateContract(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.signer = reader.string(); + break; + case 2: + message.clientId = reader.string(); + break; + case 3: + message.checksum = reader.bytes(); + break; + case 4: + message.msg = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): MsgMigrateContract { + return { + signer: isSet(object.signer) ? String(object.signer) : "", + clientId: isSet(object.clientId) ? String(object.clientId) : "", + checksum: isSet(object.checksum) ? bytesFromBase64(object.checksum) : new Uint8Array(), + msg: isSet(object.msg) ? bytesFromBase64(object.msg) : new Uint8Array() + }; + }, + toJSON(message: MsgMigrateContract): unknown { + const obj: any = {}; + message.signer !== undefined && (obj.signer = message.signer); + message.clientId !== undefined && (obj.clientId = message.clientId); + message.checksum !== undefined && (obj.checksum = base64FromBytes(message.checksum !== undefined ? message.checksum : new Uint8Array())); + message.msg !== undefined && (obj.msg = base64FromBytes(message.msg !== undefined ? message.msg : new Uint8Array())); + return obj; + }, + fromPartial(object: Partial): MsgMigrateContract { + const message = createBaseMsgMigrateContract(); + message.signer = object.signer ?? ""; + message.clientId = object.clientId ?? ""; + message.checksum = object.checksum ?? new Uint8Array(); + message.msg = object.msg ?? new Uint8Array(); + return message; + }, + fromAmino(object: MsgMigrateContractAmino): MsgMigrateContract { + const message = createBaseMsgMigrateContract(); + if (object.signer !== undefined && object.signer !== null) { + message.signer = object.signer; + } + if (object.client_id !== undefined && object.client_id !== null) { + message.clientId = object.client_id; + } + if (object.checksum !== undefined && object.checksum !== null) { + message.checksum = bytesFromBase64(object.checksum); + } + if (object.msg !== undefined && object.msg !== null) { + message.msg = bytesFromBase64(object.msg); + } + return message; + }, + toAmino(message: MsgMigrateContract): MsgMigrateContractAmino { + const obj: any = {}; + obj.signer = message.signer; + obj.client_id = message.clientId; + obj.checksum = message.checksum ? base64FromBytes(message.checksum) : undefined; + obj.msg = message.msg ? base64FromBytes(message.msg) : undefined; + return obj; + }, + fromAminoMsg(object: MsgMigrateContractAminoMsg): MsgMigrateContract { + return MsgMigrateContract.fromAmino(object.value); + }, + toAminoMsg(message: MsgMigrateContract): MsgMigrateContractAminoMsg { + return { + type: "cosmos-sdk/MsgMigrateContract", + value: MsgMigrateContract.toAmino(message) + }; + }, + fromProtoMsg(message: MsgMigrateContractProtoMsg): MsgMigrateContract { + return MsgMigrateContract.decode(message.value); + }, + toProto(message: MsgMigrateContract): Uint8Array { + return MsgMigrateContract.encode(message).finish(); + }, + toProtoMsg(message: MsgMigrateContract): MsgMigrateContractProtoMsg { + return { + typeUrl: "/ibc.lightclients.wasm.v1.MsgMigrateContract", + value: MsgMigrateContract.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgMigrateContract.typeUrl, MsgMigrateContract); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgMigrateContract.aminoType, MsgMigrateContract.typeUrl); +function createBaseMsgMigrateContractResponse(): MsgMigrateContractResponse { + return {}; +} +export const MsgMigrateContractResponse = { + typeUrl: "/ibc.lightclients.wasm.v1.MsgMigrateContractResponse", + aminoType: "cosmos-sdk/MsgMigrateContractResponse", + is(o: any): o is MsgMigrateContractResponse { + return o && o.$typeUrl === MsgMigrateContractResponse.typeUrl; + }, + isSDK(o: any): o is MsgMigrateContractResponseSDKType { + return o && o.$typeUrl === MsgMigrateContractResponse.typeUrl; + }, + isAmino(o: any): o is MsgMigrateContractResponseAmino { + return o && o.$typeUrl === MsgMigrateContractResponse.typeUrl; + }, + encode(_: MsgMigrateContractResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgMigrateContractResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgMigrateContractResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(_: any): MsgMigrateContractResponse { + return {}; + }, + toJSON(_: MsgMigrateContractResponse): unknown { + const obj: any = {}; + return obj; + }, + fromPartial(_: Partial): MsgMigrateContractResponse { + const message = createBaseMsgMigrateContractResponse(); + return message; + }, + fromAmino(_: MsgMigrateContractResponseAmino): MsgMigrateContractResponse { + const message = createBaseMsgMigrateContractResponse(); + return message; + }, + toAmino(_: MsgMigrateContractResponse): MsgMigrateContractResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgMigrateContractResponseAminoMsg): MsgMigrateContractResponse { + return MsgMigrateContractResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgMigrateContractResponse): MsgMigrateContractResponseAminoMsg { + return { + type: "cosmos-sdk/MsgMigrateContractResponse", + value: MsgMigrateContractResponse.toAmino(message) + }; + }, + fromProtoMsg(message: MsgMigrateContractResponseProtoMsg): MsgMigrateContractResponse { + return MsgMigrateContractResponse.decode(message.value); + }, + toProto(message: MsgMigrateContractResponse): Uint8Array { + return MsgMigrateContractResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgMigrateContractResponse): MsgMigrateContractResponseProtoMsg { + return { + typeUrl: "/ibc.lightclients.wasm.v1.MsgMigrateContractResponse", + value: MsgMigrateContractResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgMigrateContractResponse.typeUrl, MsgMigrateContractResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgMigrateContractResponse.aminoType, MsgMigrateContractResponse.typeUrl); \ No newline at end of file diff --git a/packages/osmojs/src/codegen/ibc/lightclients/wasm/v1/wasm.ts b/packages/osmojs/src/codegen/ibc/lightclients/wasm/v1/wasm.ts new file mode 100644 index 000000000..05fb7cf9d --- /dev/null +++ b/packages/osmojs/src/codegen/ibc/lightclients/wasm/v1/wasm.ts @@ -0,0 +1,522 @@ +import { Height, HeightAmino, HeightSDKType } from "../../../core/client/v1/client"; +import { BinaryReader, BinaryWriter } from "../../../../binary"; +import { isSet, bytesFromBase64, base64FromBytes } from "../../../../helpers"; +import { GlobalDecoderRegistry } from "../../../../registry"; +/** Wasm light client's Client state */ +export interface ClientState { + /** + * bytes encoding the client state of the underlying light client + * implemented as a Wasm contract. + */ + data: Uint8Array; + checksum: Uint8Array; + latestHeight: Height; +} +export interface ClientStateProtoMsg { + typeUrl: "/ibc.lightclients.wasm.v1.ClientState"; + value: Uint8Array; +} +/** Wasm light client's Client state */ +export interface ClientStateAmino { + /** + * bytes encoding the client state of the underlying light client + * implemented as a Wasm contract. + */ + data?: string; + checksum?: string; + latest_height?: HeightAmino; +} +export interface ClientStateAminoMsg { + type: "cosmos-sdk/ClientState"; + value: ClientStateAmino; +} +/** Wasm light client's Client state */ +export interface ClientStateSDKType { + data: Uint8Array; + checksum: Uint8Array; + latest_height: HeightSDKType; +} +/** Wasm light client's ConsensusState */ +export interface ConsensusState { + /** + * bytes encoding the consensus state of the underlying light client + * implemented as a Wasm contract. + */ + data: Uint8Array; +} +export interface ConsensusStateProtoMsg { + typeUrl: "/ibc.lightclients.wasm.v1.ConsensusState"; + value: Uint8Array; +} +/** Wasm light client's ConsensusState */ +export interface ConsensusStateAmino { + /** + * bytes encoding the consensus state of the underlying light client + * implemented as a Wasm contract. + */ + data?: string; +} +export interface ConsensusStateAminoMsg { + type: "cosmos-sdk/ConsensusState"; + value: ConsensusStateAmino; +} +/** Wasm light client's ConsensusState */ +export interface ConsensusStateSDKType { + data: Uint8Array; +} +/** Wasm light client message (either header(s) or misbehaviour) */ +export interface ClientMessage { + data: Uint8Array; +} +export interface ClientMessageProtoMsg { + typeUrl: "/ibc.lightclients.wasm.v1.ClientMessage"; + value: Uint8Array; +} +/** Wasm light client message (either header(s) or misbehaviour) */ +export interface ClientMessageAmino { + data?: string; +} +export interface ClientMessageAminoMsg { + type: "cosmos-sdk/ClientMessage"; + value: ClientMessageAmino; +} +/** Wasm light client message (either header(s) or misbehaviour) */ +export interface ClientMessageSDKType { + data: Uint8Array; +} +/** + * Checksums defines a list of all checksums that are stored + * + * Deprecated: This message is deprecated in favor of storing the checksums + * using a Collections.KeySet. + */ +/** @deprecated */ +export interface Checksums { + checksums: Uint8Array[]; +} +export interface ChecksumsProtoMsg { + typeUrl: "/ibc.lightclients.wasm.v1.Checksums"; + value: Uint8Array; +} +/** + * Checksums defines a list of all checksums that are stored + * + * Deprecated: This message is deprecated in favor of storing the checksums + * using a Collections.KeySet. + */ +/** @deprecated */ +export interface ChecksumsAmino { + checksums?: string[]; +} +export interface ChecksumsAminoMsg { + type: "cosmos-sdk/Checksums"; + value: ChecksumsAmino; +} +/** + * Checksums defines a list of all checksums that are stored + * + * Deprecated: This message is deprecated in favor of storing the checksums + * using a Collections.KeySet. + */ +/** @deprecated */ +export interface ChecksumsSDKType { + checksums: Uint8Array[]; +} +function createBaseClientState(): ClientState { + return { + data: new Uint8Array(), + checksum: new Uint8Array(), + latestHeight: Height.fromPartial({}) + }; +} +export const ClientState = { + typeUrl: "/ibc.lightclients.wasm.v1.ClientState", + aminoType: "cosmos-sdk/ClientState", + is(o: any): o is ClientState { + return o && (o.$typeUrl === ClientState.typeUrl || (o.data instanceof Uint8Array || typeof o.data === "string") && (o.checksum instanceof Uint8Array || typeof o.checksum === "string") && Height.is(o.latestHeight)); + }, + isSDK(o: any): o is ClientStateSDKType { + return o && (o.$typeUrl === ClientState.typeUrl || (o.data instanceof Uint8Array || typeof o.data === "string") && (o.checksum instanceof Uint8Array || typeof o.checksum === "string") && Height.isSDK(o.latest_height)); + }, + isAmino(o: any): o is ClientStateAmino { + return o && (o.$typeUrl === ClientState.typeUrl || (o.data instanceof Uint8Array || typeof o.data === "string") && (o.checksum instanceof Uint8Array || typeof o.checksum === "string") && Height.isAmino(o.latest_height)); + }, + encode(message: ClientState, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.data.length !== 0) { + writer.uint32(10).bytes(message.data); + } + if (message.checksum.length !== 0) { + writer.uint32(18).bytes(message.checksum); + } + if (message.latestHeight !== undefined) { + Height.encode(message.latestHeight, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): ClientState { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseClientState(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.data = reader.bytes(); + break; + case 2: + message.checksum = reader.bytes(); + break; + case 3: + message.latestHeight = Height.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): ClientState { + return { + data: isSet(object.data) ? bytesFromBase64(object.data) : new Uint8Array(), + checksum: isSet(object.checksum) ? bytesFromBase64(object.checksum) : new Uint8Array(), + latestHeight: isSet(object.latestHeight) ? Height.fromJSON(object.latestHeight) : undefined + }; + }, + toJSON(message: ClientState): unknown { + const obj: any = {}; + message.data !== undefined && (obj.data = base64FromBytes(message.data !== undefined ? message.data : new Uint8Array())); + message.checksum !== undefined && (obj.checksum = base64FromBytes(message.checksum !== undefined ? message.checksum : new Uint8Array())); + message.latestHeight !== undefined && (obj.latestHeight = message.latestHeight ? Height.toJSON(message.latestHeight) : undefined); + return obj; + }, + fromPartial(object: Partial): ClientState { + const message = createBaseClientState(); + message.data = object.data ?? new Uint8Array(); + message.checksum = object.checksum ?? new Uint8Array(); + message.latestHeight = object.latestHeight !== undefined && object.latestHeight !== null ? Height.fromPartial(object.latestHeight) : undefined; + return message; + }, + fromAmino(object: ClientStateAmino): ClientState { + const message = createBaseClientState(); + if (object.data !== undefined && object.data !== null) { + message.data = bytesFromBase64(object.data); + } + if (object.checksum !== undefined && object.checksum !== null) { + message.checksum = bytesFromBase64(object.checksum); + } + if (object.latest_height !== undefined && object.latest_height !== null) { + message.latestHeight = Height.fromAmino(object.latest_height); + } + return message; + }, + toAmino(message: ClientState): ClientStateAmino { + const obj: any = {}; + obj.data = message.data ? base64FromBytes(message.data) : undefined; + obj.checksum = message.checksum ? base64FromBytes(message.checksum) : undefined; + obj.latest_height = message.latestHeight ? Height.toAmino(message.latestHeight) : {}; + return obj; + }, + fromAminoMsg(object: ClientStateAminoMsg): ClientState { + return ClientState.fromAmino(object.value); + }, + toAminoMsg(message: ClientState): ClientStateAminoMsg { + return { + type: "cosmos-sdk/ClientState", + value: ClientState.toAmino(message) + }; + }, + fromProtoMsg(message: ClientStateProtoMsg): ClientState { + return ClientState.decode(message.value); + }, + toProto(message: ClientState): Uint8Array { + return ClientState.encode(message).finish(); + }, + toProtoMsg(message: ClientState): ClientStateProtoMsg { + return { + typeUrl: "/ibc.lightclients.wasm.v1.ClientState", + value: ClientState.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(ClientState.typeUrl, ClientState); +GlobalDecoderRegistry.registerAminoProtoMapping(ClientState.aminoType, ClientState.typeUrl); +function createBaseConsensusState(): ConsensusState { + return { + data: new Uint8Array() + }; +} +export const ConsensusState = { + typeUrl: "/ibc.lightclients.wasm.v1.ConsensusState", + aminoType: "cosmos-sdk/ConsensusState", + is(o: any): o is ConsensusState { + return o && (o.$typeUrl === ConsensusState.typeUrl || o.data instanceof Uint8Array || typeof o.data === "string"); + }, + isSDK(o: any): o is ConsensusStateSDKType { + return o && (o.$typeUrl === ConsensusState.typeUrl || o.data instanceof Uint8Array || typeof o.data === "string"); + }, + isAmino(o: any): o is ConsensusStateAmino { + return o && (o.$typeUrl === ConsensusState.typeUrl || o.data instanceof Uint8Array || typeof o.data === "string"); + }, + encode(message: ConsensusState, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.data.length !== 0) { + writer.uint32(10).bytes(message.data); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): ConsensusState { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseConsensusState(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.data = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): ConsensusState { + return { + data: isSet(object.data) ? bytesFromBase64(object.data) : new Uint8Array() + }; + }, + toJSON(message: ConsensusState): unknown { + const obj: any = {}; + message.data !== undefined && (obj.data = base64FromBytes(message.data !== undefined ? message.data : new Uint8Array())); + return obj; + }, + fromPartial(object: Partial): ConsensusState { + const message = createBaseConsensusState(); + message.data = object.data ?? new Uint8Array(); + return message; + }, + fromAmino(object: ConsensusStateAmino): ConsensusState { + const message = createBaseConsensusState(); + if (object.data !== undefined && object.data !== null) { + message.data = bytesFromBase64(object.data); + } + return message; + }, + toAmino(message: ConsensusState): ConsensusStateAmino { + const obj: any = {}; + obj.data = message.data ? base64FromBytes(message.data) : undefined; + return obj; + }, + fromAminoMsg(object: ConsensusStateAminoMsg): ConsensusState { + return ConsensusState.fromAmino(object.value); + }, + toAminoMsg(message: ConsensusState): ConsensusStateAminoMsg { + return { + type: "cosmos-sdk/ConsensusState", + value: ConsensusState.toAmino(message) + }; + }, + fromProtoMsg(message: ConsensusStateProtoMsg): ConsensusState { + return ConsensusState.decode(message.value); + }, + toProto(message: ConsensusState): Uint8Array { + return ConsensusState.encode(message).finish(); + }, + toProtoMsg(message: ConsensusState): ConsensusStateProtoMsg { + return { + typeUrl: "/ibc.lightclients.wasm.v1.ConsensusState", + value: ConsensusState.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(ConsensusState.typeUrl, ConsensusState); +GlobalDecoderRegistry.registerAminoProtoMapping(ConsensusState.aminoType, ConsensusState.typeUrl); +function createBaseClientMessage(): ClientMessage { + return { + data: new Uint8Array() + }; +} +export const ClientMessage = { + typeUrl: "/ibc.lightclients.wasm.v1.ClientMessage", + aminoType: "cosmos-sdk/ClientMessage", + is(o: any): o is ClientMessage { + return o && (o.$typeUrl === ClientMessage.typeUrl || o.data instanceof Uint8Array || typeof o.data === "string"); + }, + isSDK(o: any): o is ClientMessageSDKType { + return o && (o.$typeUrl === ClientMessage.typeUrl || o.data instanceof Uint8Array || typeof o.data === "string"); + }, + isAmino(o: any): o is ClientMessageAmino { + return o && (o.$typeUrl === ClientMessage.typeUrl || o.data instanceof Uint8Array || typeof o.data === "string"); + }, + encode(message: ClientMessage, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.data.length !== 0) { + writer.uint32(10).bytes(message.data); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): ClientMessage { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseClientMessage(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.data = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): ClientMessage { + return { + data: isSet(object.data) ? bytesFromBase64(object.data) : new Uint8Array() + }; + }, + toJSON(message: ClientMessage): unknown { + const obj: any = {}; + message.data !== undefined && (obj.data = base64FromBytes(message.data !== undefined ? message.data : new Uint8Array())); + return obj; + }, + fromPartial(object: Partial): ClientMessage { + const message = createBaseClientMessage(); + message.data = object.data ?? new Uint8Array(); + return message; + }, + fromAmino(object: ClientMessageAmino): ClientMessage { + const message = createBaseClientMessage(); + if (object.data !== undefined && object.data !== null) { + message.data = bytesFromBase64(object.data); + } + return message; + }, + toAmino(message: ClientMessage): ClientMessageAmino { + const obj: any = {}; + obj.data = message.data ? base64FromBytes(message.data) : undefined; + return obj; + }, + fromAminoMsg(object: ClientMessageAminoMsg): ClientMessage { + return ClientMessage.fromAmino(object.value); + }, + toAminoMsg(message: ClientMessage): ClientMessageAminoMsg { + return { + type: "cosmos-sdk/ClientMessage", + value: ClientMessage.toAmino(message) + }; + }, + fromProtoMsg(message: ClientMessageProtoMsg): ClientMessage { + return ClientMessage.decode(message.value); + }, + toProto(message: ClientMessage): Uint8Array { + return ClientMessage.encode(message).finish(); + }, + toProtoMsg(message: ClientMessage): ClientMessageProtoMsg { + return { + typeUrl: "/ibc.lightclients.wasm.v1.ClientMessage", + value: ClientMessage.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(ClientMessage.typeUrl, ClientMessage); +GlobalDecoderRegistry.registerAminoProtoMapping(ClientMessage.aminoType, ClientMessage.typeUrl); +function createBaseChecksums(): Checksums { + return { + checksums: [] + }; +} +export const Checksums = { + typeUrl: "/ibc.lightclients.wasm.v1.Checksums", + aminoType: "cosmos-sdk/Checksums", + is(o: any): o is Checksums { + return o && (o.$typeUrl === Checksums.typeUrl || Array.isArray(o.checksums) && (!o.checksums.length || o.checksums[0] instanceof Uint8Array || typeof o.checksums[0] === "string")); + }, + isSDK(o: any): o is ChecksumsSDKType { + return o && (o.$typeUrl === Checksums.typeUrl || Array.isArray(o.checksums) && (!o.checksums.length || o.checksums[0] instanceof Uint8Array || typeof o.checksums[0] === "string")); + }, + isAmino(o: any): o is ChecksumsAmino { + return o && (o.$typeUrl === Checksums.typeUrl || Array.isArray(o.checksums) && (!o.checksums.length || o.checksums[0] instanceof Uint8Array || typeof o.checksums[0] === "string")); + }, + encode(message: Checksums, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.checksums) { + writer.uint32(10).bytes(v!); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): Checksums { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseChecksums(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.checksums.push(reader.bytes()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): Checksums { + return { + checksums: Array.isArray(object?.checksums) ? object.checksums.map((e: any) => bytesFromBase64(e)) : [] + }; + }, + toJSON(message: Checksums): unknown { + const obj: any = {}; + if (message.checksums) { + obj.checksums = message.checksums.map(e => base64FromBytes(e !== undefined ? e : new Uint8Array())); + } else { + obj.checksums = []; + } + return obj; + }, + fromPartial(object: Partial): Checksums { + const message = createBaseChecksums(); + message.checksums = object.checksums?.map(e => e) || []; + return message; + }, + fromAmino(object: ChecksumsAmino): Checksums { + const message = createBaseChecksums(); + message.checksums = object.checksums?.map(e => bytesFromBase64(e)) || []; + return message; + }, + toAmino(message: Checksums): ChecksumsAmino { + const obj: any = {}; + if (message.checksums) { + obj.checksums = message.checksums.map(e => base64FromBytes(e)); + } else { + obj.checksums = []; + } + return obj; + }, + fromAminoMsg(object: ChecksumsAminoMsg): Checksums { + return Checksums.fromAmino(object.value); + }, + toAminoMsg(message: Checksums): ChecksumsAminoMsg { + return { + type: "cosmos-sdk/Checksums", + value: Checksums.toAmino(message) + }; + }, + fromProtoMsg(message: ChecksumsProtoMsg): Checksums { + return Checksums.decode(message.value); + }, + toProto(message: Checksums): Uint8Array { + return Checksums.encode(message).finish(); + }, + toProtoMsg(message: Checksums): ChecksumsProtoMsg { + return { + typeUrl: "/ibc.lightclients.wasm.v1.Checksums", + value: Checksums.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(Checksums.typeUrl, Checksums); +GlobalDecoderRegistry.registerAminoProtoMapping(Checksums.aminoType, Checksums.typeUrl); \ No newline at end of file diff --git a/packages/osmojs/src/codegen/ibc/rpc.query.ts b/packages/osmojs/src/codegen/ibc/rpc.query.ts index bcecd61eb..f9d040ea5 100644 --- a/packages/osmojs/src/codegen/ibc/rpc.query.ts +++ b/packages/osmojs/src/codegen/ibc/rpc.query.ts @@ -1,4 +1,4 @@ -import { HttpEndpoint, connectComet } from "@cosmjs/tendermint-rpc"; +import { connectComet, HttpEndpoint } from "@cosmjs/tendermint-rpc"; import { QueryClient } from "@cosmjs/stargate"; export const createRPCQueryClient = async ({ rpcEndpoint @@ -23,12 +23,23 @@ export const createRPCQueryClient = async ({ v1beta1: (await import("../cosmos/base/node/v1beta1/query.rpc.Service")).createRpcQueryExtension(client) } }, + consensus: { + v1: (await import("../cosmos/consensus/v1/query.rpc.Query")).createRpcQueryExtension(client) + }, distribution: { v1beta1: (await import("../cosmos/distribution/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) }, gov: { v1beta1: (await import("../cosmos/gov/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) }, + orm: { + query: { + v1alpha1: (await import("../cosmos/orm/query/v1alpha1/query.rpc.Query")).createRpcQueryExtension(client) + } + }, + params: { + v1beta1: (await import("../cosmos/params/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) + }, staking: { v1beta1: (await import("../cosmos/staking/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) }, @@ -66,6 +77,11 @@ export const createRPCQueryClient = async ({ connection: { v1: (await import("./core/connection/v1/query.rpc.Query")).createRpcQueryExtension(client) } + }, + lightclients: { + wasm: { + v1: (await import("./lightclients/wasm/v1/query.rpc.Query")).createRpcQueryExtension(client) + } } } }; diff --git a/packages/osmojs/src/codegen/ibc/rpc.tx.ts b/packages/osmojs/src/codegen/ibc/rpc.tx.ts index 1672f4018..b9f444d4f 100644 --- a/packages/osmojs/src/codegen/ibc/rpc.tx.ts +++ b/packages/osmojs/src/codegen/ibc/rpc.tx.ts @@ -5,12 +5,18 @@ export const createRPCMsgClient = async ({ rpc: Rpc; }) => ({ cosmos: { + auth: { + v1beta1: new (await import("../cosmos/auth/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) + }, authz: { v1beta1: new (await import("../cosmos/authz/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) }, bank: { v1beta1: new (await import("../cosmos/bank/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) }, + consensus: { + v1: new (await import("../cosmos/consensus/v1/tx.rpc.msg")).MsgClientImpl(rpc) + }, distribution: { v1beta1: new (await import("../cosmos/distribution/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) }, @@ -19,6 +25,9 @@ export const createRPCMsgClient = async ({ }, staking: { v1beta1: new (await import("../cosmos/staking/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) + }, + upgrade: { + v1beta1: new (await import("../cosmos/upgrade/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) } }, ibc: { @@ -29,6 +38,9 @@ export const createRPCMsgClient = async ({ interchain_accounts: { controller: { v1: new (await import("./applications/interchain_accounts/controller/v1/tx.rpc.msg")).MsgClientImpl(rpc) + }, + host: { + v1: new (await import("./applications/interchain_accounts/host/v1/tx.rpc.msg")).MsgClientImpl(rpc) } }, transfer: { @@ -45,6 +57,11 @@ export const createRPCMsgClient = async ({ connection: { v1: new (await import("./core/connection/v1/tx.rpc.msg")).MsgClientImpl(rpc) } + }, + lightclients: { + wasm: { + v1: new (await import("./lightclients/wasm/v1/tx.rpc.msg")).MsgClientImpl(rpc) + } } } }); \ No newline at end of file diff --git a/packages/osmojs/src/codegen/ics23/bundle.ts b/packages/osmojs/src/codegen/ics23/bundle.ts index ed4d55aef..386ad8937 100644 --- a/packages/osmojs/src/codegen/ics23/bundle.ts +++ b/packages/osmojs/src/codegen/ics23/bundle.ts @@ -1,4 +1,4 @@ -import * as _171 from "../confio/proofs"; +import * as _229 from "../confio/proofs"; export const ics23 = { - ..._171 + ..._229 }; \ No newline at end of file diff --git a/packages/osmojs/src/codegen/index.ts b/packages/osmojs/src/codegen/index.ts index 5dc8d8aa9..266c0a2b0 100644 --- a/packages/osmojs/src/codegen/index.ts +++ b/packages/osmojs/src/codegen/index.ts @@ -1,12 +1,13 @@ /** - * This file and any referenced files were automatically generated by @cosmology/telescope@0.99.12 + * This file and any referenced files were automatically generated by @cosmology/telescope@1.4.1 * DO NOT MODIFY BY HAND. Instead, download the latest proto files for your chain * and run the transpile command or yarn proto command to regenerate this bundle. */ - + export * from "./cosmos/bundle"; export * from "./cosmos/client"; export * from "./amino/bundle"; +export * from "./tendermint/bundle"; export * from "./capability/bundle"; export * from "./ibc/bundle"; export * from "./ibc/client"; @@ -18,7 +19,8 @@ export * from "./ics23/bundle"; export * from "./cosmos_proto/bundle"; export * from "./gogoproto/bundle"; export * from "./google/bundle"; -export * from "./tendermint/bundle"; export * from "./varint"; export * from "./utf8"; -export * from "./binary"; \ No newline at end of file +export * from "./binary"; +export * from "./types"; +export * from "./registry"; \ No newline at end of file diff --git a/packages/osmojs/src/codegen/osmosis/accum/v1beta1/accum.ts b/packages/osmojs/src/codegen/osmosis/accum/v1beta1/accum.ts index f1cc04c8b..1689a6af3 100644 --- a/packages/osmojs/src/codegen/osmosis/accum/v1beta1/accum.ts +++ b/packages/osmojs/src/codegen/osmosis/accum/v1beta1/accum.ts @@ -1,6 +1,8 @@ import { DecCoin, DecCoinAmino, DecCoinSDKType } from "../../../cosmos/base/v1beta1/coin"; import { BinaryReader, BinaryWriter } from "../../../binary"; import { Decimal } from "@cosmjs/math"; +import { isSet } from "../../../helpers"; +import { GlobalDecoderRegistry } from "../../../registry"; /** * AccumulatorContent is the state-entry for the global accumulator. * It contains the name of the global accumulator and the total value of @@ -20,8 +22,8 @@ export interface AccumulatorContentProtoMsg { * shares belonging to it from all positions. */ export interface AccumulatorContentAmino { - accum_value: DecCoinAmino[]; - total_shares: string; + accum_value?: DecCoinAmino[]; + total_shares?: string; } export interface AccumulatorContentAminoMsg { type: "osmosis/accum/accumulator-content"; @@ -85,7 +87,7 @@ export interface Record { * into a single one. */ unclaimedRewardsTotal: DecCoin[]; - options: Options; + options?: Options; } export interface RecordProtoMsg { typeUrl: "/osmosis.accum.v1beta1.Record"; @@ -100,7 +102,7 @@ export interface RecordAmino { * num_shares is the number of shares belonging to the position associated * with this record. */ - num_shares: string; + num_shares?: string; /** * accum_value_per_share is the subset of coins per shar of the global * accumulator value that allows to infer how much a position is entitled to @@ -120,7 +122,7 @@ export interface RecordAmino { * get the growth inside the interval from the time of last update up until * the current block time. */ - accum_value_per_share: DecCoinAmino[]; + accum_value_per_share?: DecCoinAmino[]; /** * unclaimed_rewards_total is the total amount of unclaimed rewards that the * position is entitled to. This value is updated whenever shares are added or @@ -128,7 +130,7 @@ export interface RecordAmino { * this value for some custom use cases such as merging pre-existing positions * into a single one. */ - unclaimed_rewards_total: DecCoinAmino[]; + unclaimed_rewards_total?: DecCoinAmino[]; options?: OptionsAmino; } export interface RecordAminoMsg { @@ -143,7 +145,7 @@ export interface RecordSDKType { num_shares: string; accum_value_per_share: DecCoinSDKType[]; unclaimed_rewards_total: DecCoinSDKType[]; - options: OptionsSDKType; + options?: OptionsSDKType; } function createBaseAccumulatorContent(): AccumulatorContent { return { @@ -153,6 +155,16 @@ function createBaseAccumulatorContent(): AccumulatorContent { } export const AccumulatorContent = { typeUrl: "/osmosis.accum.v1beta1.AccumulatorContent", + aminoType: "osmosis/accum/accumulator-content", + is(o: any): o is AccumulatorContent { + return o && (o.$typeUrl === AccumulatorContent.typeUrl || Array.isArray(o.accumValue) && (!o.accumValue.length || DecCoin.is(o.accumValue[0])) && typeof o.totalShares === "string"); + }, + isSDK(o: any): o is AccumulatorContentSDKType { + return o && (o.$typeUrl === AccumulatorContent.typeUrl || Array.isArray(o.accum_value) && (!o.accum_value.length || DecCoin.isSDK(o.accum_value[0])) && typeof o.total_shares === "string"); + }, + isAmino(o: any): o is AccumulatorContentAmino { + return o && (o.$typeUrl === AccumulatorContent.typeUrl || Array.isArray(o.accum_value) && (!o.accum_value.length || DecCoin.isAmino(o.accum_value[0])) && typeof o.total_shares === "string"); + }, encode(message: AccumulatorContent, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.accumValue) { DecCoin.encode(v!, writer.uint32(10).fork()).ldelim(); @@ -182,6 +194,22 @@ export const AccumulatorContent = { } return message; }, + fromJSON(object: any): AccumulatorContent { + return { + accumValue: Array.isArray(object?.accumValue) ? object.accumValue.map((e: any) => DecCoin.fromJSON(e)) : [], + totalShares: isSet(object.totalShares) ? String(object.totalShares) : "" + }; + }, + toJSON(message: AccumulatorContent): unknown { + const obj: any = {}; + if (message.accumValue) { + obj.accumValue = message.accumValue.map(e => e ? DecCoin.toJSON(e) : undefined); + } else { + obj.accumValue = []; + } + message.totalShares !== undefined && (obj.totalShares = message.totalShares); + return obj; + }, fromPartial(object: Partial): AccumulatorContent { const message = createBaseAccumulatorContent(); message.accumValue = object.accumValue?.map(e => DecCoin.fromPartial(e)) || []; @@ -189,10 +217,12 @@ export const AccumulatorContent = { return message; }, fromAmino(object: AccumulatorContentAmino): AccumulatorContent { - return { - accumValue: Array.isArray(object?.accum_value) ? object.accum_value.map((e: any) => DecCoin.fromAmino(e)) : [], - totalShares: object.total_shares - }; + const message = createBaseAccumulatorContent(); + message.accumValue = object.accum_value?.map(e => DecCoin.fromAmino(e)) || []; + if (object.total_shares !== undefined && object.total_shares !== null) { + message.totalShares = object.total_shares; + } + return message; }, toAmino(message: AccumulatorContent): AccumulatorContentAmino { const obj: any = {}; @@ -226,11 +256,23 @@ export const AccumulatorContent = { }; } }; +GlobalDecoderRegistry.register(AccumulatorContent.typeUrl, AccumulatorContent); +GlobalDecoderRegistry.registerAminoProtoMapping(AccumulatorContent.aminoType, AccumulatorContent.typeUrl); function createBaseOptions(): Options { return {}; } export const Options = { typeUrl: "/osmosis.accum.v1beta1.Options", + aminoType: "osmosis/accum/options", + is(o: any): o is Options { + return o && o.$typeUrl === Options.typeUrl; + }, + isSDK(o: any): o is OptionsSDKType { + return o && o.$typeUrl === Options.typeUrl; + }, + isAmino(o: any): o is OptionsAmino { + return o && o.$typeUrl === Options.typeUrl; + }, encode(_: Options, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, @@ -248,12 +290,20 @@ export const Options = { } return message; }, + fromJSON(_: any): Options { + return {}; + }, + toJSON(_: Options): unknown { + const obj: any = {}; + return obj; + }, fromPartial(_: Partial): Options { const message = createBaseOptions(); return message; }, fromAmino(_: OptionsAmino): Options { - return {}; + const message = createBaseOptions(); + return message; }, toAmino(_: Options): OptionsAmino { const obj: any = {}; @@ -281,16 +331,28 @@ export const Options = { }; } }; +GlobalDecoderRegistry.register(Options.typeUrl, Options); +GlobalDecoderRegistry.registerAminoProtoMapping(Options.aminoType, Options.typeUrl); function createBaseRecord(): Record { return { numShares: "", accumValuePerShare: [], unclaimedRewardsTotal: [], - options: Options.fromPartial({}) + options: undefined }; } export const Record = { typeUrl: "/osmosis.accum.v1beta1.Record", + aminoType: "osmosis/accum/record", + is(o: any): o is Record { + return o && (o.$typeUrl === Record.typeUrl || typeof o.numShares === "string" && Array.isArray(o.accumValuePerShare) && (!o.accumValuePerShare.length || DecCoin.is(o.accumValuePerShare[0])) && Array.isArray(o.unclaimedRewardsTotal) && (!o.unclaimedRewardsTotal.length || DecCoin.is(o.unclaimedRewardsTotal[0]))); + }, + isSDK(o: any): o is RecordSDKType { + return o && (o.$typeUrl === Record.typeUrl || typeof o.num_shares === "string" && Array.isArray(o.accum_value_per_share) && (!o.accum_value_per_share.length || DecCoin.isSDK(o.accum_value_per_share[0])) && Array.isArray(o.unclaimed_rewards_total) && (!o.unclaimed_rewards_total.length || DecCoin.isSDK(o.unclaimed_rewards_total[0]))); + }, + isAmino(o: any): o is RecordAmino { + return o && (o.$typeUrl === Record.typeUrl || typeof o.num_shares === "string" && Array.isArray(o.accum_value_per_share) && (!o.accum_value_per_share.length || DecCoin.isAmino(o.accum_value_per_share[0])) && Array.isArray(o.unclaimed_rewards_total) && (!o.unclaimed_rewards_total.length || DecCoin.isAmino(o.unclaimed_rewards_total[0]))); + }, encode(message: Record, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.numShares !== "") { writer.uint32(10).string(Decimal.fromUserInput(message.numShares, 18).atomics); @@ -332,6 +394,30 @@ export const Record = { } return message; }, + fromJSON(object: any): Record { + return { + numShares: isSet(object.numShares) ? String(object.numShares) : "", + accumValuePerShare: Array.isArray(object?.accumValuePerShare) ? object.accumValuePerShare.map((e: any) => DecCoin.fromJSON(e)) : [], + unclaimedRewardsTotal: Array.isArray(object?.unclaimedRewardsTotal) ? object.unclaimedRewardsTotal.map((e: any) => DecCoin.fromJSON(e)) : [], + options: isSet(object.options) ? Options.fromJSON(object.options) : undefined + }; + }, + toJSON(message: Record): unknown { + const obj: any = {}; + message.numShares !== undefined && (obj.numShares = message.numShares); + if (message.accumValuePerShare) { + obj.accumValuePerShare = message.accumValuePerShare.map(e => e ? DecCoin.toJSON(e) : undefined); + } else { + obj.accumValuePerShare = []; + } + if (message.unclaimedRewardsTotal) { + obj.unclaimedRewardsTotal = message.unclaimedRewardsTotal.map(e => e ? DecCoin.toJSON(e) : undefined); + } else { + obj.unclaimedRewardsTotal = []; + } + message.options !== undefined && (obj.options = message.options ? Options.toJSON(message.options) : undefined); + return obj; + }, fromPartial(object: Partial): Record { const message = createBaseRecord(); message.numShares = object.numShares ?? ""; @@ -341,12 +427,16 @@ export const Record = { return message; }, fromAmino(object: RecordAmino): Record { - return { - numShares: object.num_shares, - accumValuePerShare: Array.isArray(object?.accum_value_per_share) ? object.accum_value_per_share.map((e: any) => DecCoin.fromAmino(e)) : [], - unclaimedRewardsTotal: Array.isArray(object?.unclaimed_rewards_total) ? object.unclaimed_rewards_total.map((e: any) => DecCoin.fromAmino(e)) : [], - options: object?.options ? Options.fromAmino(object.options) : undefined - }; + const message = createBaseRecord(); + if (object.num_shares !== undefined && object.num_shares !== null) { + message.numShares = object.num_shares; + } + message.accumValuePerShare = object.accum_value_per_share?.map(e => DecCoin.fromAmino(e)) || []; + message.unclaimedRewardsTotal = object.unclaimed_rewards_total?.map(e => DecCoin.fromAmino(e)) || []; + if (object.options !== undefined && object.options !== null) { + message.options = Options.fromAmino(object.options); + } + return message; }, toAmino(message: Record): RecordAmino { const obj: any = {}; @@ -385,4 +475,6 @@ export const Record = { value: Record.encode(message).finish() }; } -}; \ No newline at end of file +}; +GlobalDecoderRegistry.register(Record.typeUrl, Record); +GlobalDecoderRegistry.registerAminoProtoMapping(Record.aminoType, Record.typeUrl); \ No newline at end of file diff --git a/packages/osmojs/src/codegen/osmosis/bundle.ts b/packages/osmojs/src/codegen/osmosis/bundle.ts index ae8d24f63..988aa991b 100644 --- a/packages/osmojs/src/codegen/osmosis/bundle.ts +++ b/packages/osmojs/src/codegen/osmosis/bundle.ts @@ -1,406 +1,436 @@ -import * as _89 from "./accum/v1beta1/accum"; -import * as _90 from "./concentrated-liquidity/params"; -import * as _91 from "./cosmwasmpool/v1beta1/genesis"; -import * as _92 from "./cosmwasmpool/v1beta1/gov"; -import * as _93 from "./cosmwasmpool/v1beta1/model/instantiate_msg"; -import * as _94 from "./cosmwasmpool/v1beta1/model/module_query_msg"; -import * as _95 from "./cosmwasmpool/v1beta1/model/module_sudo_msg"; -import * as _96 from "./cosmwasmpool/v1beta1/model/pool_query_msg"; -import * as _97 from "./cosmwasmpool/v1beta1/model/pool"; -import * as _98 from "./cosmwasmpool/v1beta1/model/transmuter_msgs"; -import * as _99 from "./cosmwasmpool/v1beta1/model/tx"; -import * as _100 from "./cosmwasmpool/v1beta1/params"; -import * as _101 from "./cosmwasmpool/v1beta1/query"; -import * as _102 from "./cosmwasmpool/v1beta1/tx"; -import * as _103 from "./downtime-detector/v1beta1/downtime_duration"; -import * as _104 from "./downtime-detector/v1beta1/genesis"; -import * as _105 from "./downtime-detector/v1beta1/query"; -import * as _106 from "./epochs/genesis"; -import * as _107 from "./epochs/query"; -import * as _108 from "./gamm/pool-models/balancer/balancerPool"; -import * as _109 from "./gamm/v1beta1/genesis"; -import * as _110 from "./gamm/v1beta1/gov"; -import * as _111 from "./gamm/v1beta1/query"; -import * as _112 from "./gamm/v1beta1/shared"; -import * as _113 from "./gamm/v1beta1/tx"; -import * as _114 from "./gamm/pool-models/balancer/tx/tx"; -import * as _115 from "./gamm/pool-models/stableswap/stableswap_pool"; -import * as _116 from "./gamm/pool-models/stableswap/tx"; -import * as _117 from "./gamm/v2/query"; -import * as _118 from "./ibc-rate-limit/v1beta1/genesis"; -import * as _119 from "./ibc-rate-limit/v1beta1/params"; -import * as _120 from "./ibc-rate-limit/v1beta1/query"; -import * as _121 from "./incentives/gauge"; -import * as _122 from "./incentives/genesis"; -import * as _123 from "./incentives/params"; -import * as _124 from "./incentives/query"; -import * as _125 from "./incentives/tx"; -import * as _126 from "./lockup/genesis"; -import * as _127 from "./lockup/lock"; -import * as _128 from "./lockup/params"; -import * as _129 from "./lockup/query"; -import * as _130 from "./lockup/tx"; -import * as _131 from "./mint/v1beta1/genesis"; -import * as _132 from "./mint/v1beta1/mint"; -import * as _133 from "./mint/v1beta1/query"; -import * as _134 from "./pool-incentives/v1beta1/genesis"; -import * as _135 from "./pool-incentives/v1beta1/gov"; -import * as _136 from "./pool-incentives/v1beta1/incentives"; -import * as _137 from "./pool-incentives/v1beta1/query"; -import * as _138 from "./pool-incentives/v1beta1/shared"; -import * as _139 from "./poolmanager/v1beta1/genesis"; -import * as _140 from "./poolmanager/v1beta1/module_route"; -import * as _141 from "./poolmanager/v1beta1/query"; -import * as _142 from "./poolmanager/v1beta1/swap_route"; -import * as _143 from "./poolmanager/v1beta1/tx"; -import * as _144 from "./protorev/v1beta1/genesis"; -import * as _145 from "./protorev/v1beta1/gov"; -import * as _146 from "./protorev/v1beta1/params"; -import * as _147 from "./protorev/v1beta1/protorev"; -import * as _148 from "./protorev/v1beta1/query"; -import * as _149 from "./protorev/v1beta1/tx"; -import * as _150 from "./sumtree/v1beta1/tree"; -import * as _151 from "./superfluid/genesis"; -import * as _152 from "./superfluid/params"; -import * as _153 from "./superfluid/query"; -import * as _154 from "./superfluid/superfluid"; -import * as _155 from "./superfluid/tx"; -import * as _156 from "./tokenfactory/v1beta1/authorityMetadata"; -import * as _157 from "./tokenfactory/v1beta1/genesis"; -import * as _158 from "./tokenfactory/v1beta1/params"; -import * as _159 from "./tokenfactory/v1beta1/query"; -import * as _160 from "./tokenfactory/v1beta1/tx"; -import * as _161 from "./twap/v1beta1/genesis"; -import * as _162 from "./twap/v1beta1/query"; -import * as _163 from "./twap/v1beta1/twap_record"; -import * as _164 from "./txfees/v1beta1/feetoken"; -import * as _165 from "./txfees/v1beta1/genesis"; -import * as _166 from "./txfees/v1beta1/gov"; -import * as _167 from "./txfees/v1beta1/query"; -import * as _168 from "./valset-pref/v1beta1/query"; -import * as _169 from "./valset-pref/v1beta1/state"; -import * as _170 from "./valset-pref/v1beta1/tx"; -import * as _260 from "./concentrated-liquidity/pool-model/concentrated/tx.amino"; -import * as _261 from "./concentrated-liquidity/tx.amino"; -import * as _262 from "./gamm/pool-models/balancer/tx/tx.amino"; -import * as _263 from "./gamm/pool-models/stableswap/tx.amino"; -import * as _264 from "./gamm/v1beta1/tx.amino"; -import * as _265 from "./incentives/tx.amino"; -import * as _266 from "./lockup/tx.amino"; -import * as _267 from "./poolmanager/v1beta1/tx.amino"; -import * as _268 from "./protorev/v1beta1/tx.amino"; -import * as _269 from "./superfluid/tx.amino"; -import * as _270 from "./tokenfactory/v1beta1/tx.amino"; -import * as _271 from "./valset-pref/v1beta1/tx.amino"; -import * as _272 from "./concentrated-liquidity/pool-model/concentrated/tx.registry"; -import * as _273 from "./concentrated-liquidity/tx.registry"; -import * as _274 from "./gamm/pool-models/balancer/tx/tx.registry"; -import * as _275 from "./gamm/pool-models/stableswap/tx.registry"; -import * as _276 from "./gamm/v1beta1/tx.registry"; -import * as _277 from "./incentives/tx.registry"; -import * as _278 from "./lockup/tx.registry"; -import * as _279 from "./poolmanager/v1beta1/tx.registry"; -import * as _280 from "./protorev/v1beta1/tx.registry"; -import * as _281 from "./superfluid/tx.registry"; -import * as _282 from "./tokenfactory/v1beta1/tx.registry"; -import * as _283 from "./valset-pref/v1beta1/tx.registry"; -import * as _284 from "./concentrated-liquidity/query.lcd"; -import * as _285 from "./cosmwasmpool/v1beta1/query.lcd"; -import * as _286 from "./downtime-detector/v1beta1/query.lcd"; -import * as _287 from "./epochs/query.lcd"; -import * as _288 from "./gamm/v1beta1/query.lcd"; -import * as _289 from "./gamm/v2/query.lcd"; -import * as _290 from "./ibc-rate-limit/v1beta1/query.lcd"; -import * as _291 from "./incentives/query.lcd"; -import * as _292 from "./lockup/query.lcd"; -import * as _293 from "./mint/v1beta1/query.lcd"; -import * as _294 from "./pool-incentives/v1beta1/query.lcd"; -import * as _295 from "./poolmanager/v1beta1/query.lcd"; -import * as _296 from "./protorev/v1beta1/query.lcd"; -import * as _297 from "./superfluid/query.lcd"; -import * as _298 from "./tokenfactory/v1beta1/query.lcd"; -import * as _299 from "./twap/v1beta1/query.lcd"; -import * as _300 from "./txfees/v1beta1/query.lcd"; -import * as _301 from "./valset-pref/v1beta1/query.lcd"; -import * as _302 from "./concentrated-liquidity/query.rpc.Query"; -import * as _303 from "./cosmwasmpool/v1beta1/query.rpc.Query"; -import * as _304 from "./downtime-detector/v1beta1/query.rpc.Query"; -import * as _305 from "./epochs/query.rpc.Query"; -import * as _306 from "./gamm/v1beta1/query.rpc.Query"; -import * as _307 from "./gamm/v2/query.rpc.Query"; -import * as _308 from "./ibc-rate-limit/v1beta1/query.rpc.Query"; -import * as _309 from "./incentives/query.rpc.Query"; -import * as _310 from "./lockup/query.rpc.Query"; -import * as _311 from "./mint/v1beta1/query.rpc.Query"; -import * as _312 from "./pool-incentives/v1beta1/query.rpc.Query"; -import * as _313 from "./poolmanager/v1beta1/query.rpc.Query"; -import * as _314 from "./protorev/v1beta1/query.rpc.Query"; -import * as _315 from "./superfluid/query.rpc.Query"; -import * as _316 from "./tokenfactory/v1beta1/query.rpc.Query"; -import * as _317 from "./twap/v1beta1/query.rpc.Query"; -import * as _318 from "./txfees/v1beta1/query.rpc.Query"; -import * as _319 from "./valset-pref/v1beta1/query.rpc.Query"; -import * as _320 from "./concentrated-liquidity/pool-model/concentrated/tx.rpc.msg"; -import * as _321 from "./concentrated-liquidity/tx.rpc.msg"; -import * as _322 from "./gamm/pool-models/balancer/tx/tx.rpc.msg"; -import * as _323 from "./gamm/pool-models/stableswap/tx.rpc.msg"; -import * as _324 from "./gamm/v1beta1/tx.rpc.msg"; -import * as _325 from "./incentives/tx.rpc.msg"; -import * as _326 from "./lockup/tx.rpc.msg"; -import * as _327 from "./poolmanager/v1beta1/tx.rpc.msg"; -import * as _328 from "./protorev/v1beta1/tx.rpc.msg"; -import * as _329 from "./superfluid/tx.rpc.msg"; -import * as _330 from "./tokenfactory/v1beta1/tx.rpc.msg"; -import * as _331 from "./valset-pref/v1beta1/tx.rpc.msg"; -import * as _341 from "./lcd"; -import * as _342 from "./rpc.query"; -import * as _343 from "./rpc.tx"; +import * as _139 from "./accum/v1beta1/accum"; +import * as _140 from "./concentratedliquidity/params"; +import * as _141 from "./cosmwasmpool/v1beta1/genesis"; +import * as _142 from "./cosmwasmpool/v1beta1/gov"; +import * as _143 from "./cosmwasmpool/v1beta1/model/instantiate_msg"; +import * as _144 from "./cosmwasmpool/v1beta1/model/module_query_msg"; +import * as _145 from "./cosmwasmpool/v1beta1/model/module_sudo_msg"; +import * as _146 from "./cosmwasmpool/v1beta1/model/pool_query_msg"; +import * as _147 from "./cosmwasmpool/v1beta1/model/pool"; +import * as _148 from "./cosmwasmpool/v1beta1/model/transmuter_msgs"; +import * as _149 from "./cosmwasmpool/v1beta1/model/tx"; +import * as _150 from "./cosmwasmpool/v1beta1/params"; +import * as _151 from "./cosmwasmpool/v1beta1/query"; +import * as _152 from "./cosmwasmpool/v1beta1/tx"; +import * as _153 from "./downtimedetector/v1beta1/downtime_duration"; +import * as _154 from "./downtimedetector/v1beta1/genesis"; +import * as _155 from "./downtimedetector/v1beta1/query"; +import * as _156 from "./epochs/v1beta1/genesis"; +import * as _157 from "./epochs/v1beta1/query"; +import * as _158 from "./gamm/poolmodels/balancer/v1beta1/tx"; +import * as _159 from "./gamm/poolmodels/stableswap/v1beta1/stableswap_pool"; +import * as _160 from "./gamm/poolmodels/stableswap/v1beta1/tx"; +import * as _161 from "./gamm/v1beta1/balancerPool"; +import * as _162 from "./gamm/v1beta1/genesis"; +import * as _163 from "./gamm/v1beta1/gov"; +import * as _164 from "./gamm/v1beta1/query"; +import * as _165 from "./gamm/v1beta1/shared"; +import * as _166 from "./gamm/v1beta1/tx"; +import * as _167 from "./gamm/v2/query"; +import * as _168 from "./ibchooks/genesis"; +import * as _169 from "./ibchooks/params"; +import * as _170 from "./ibchooks/tx"; +import * as _171 from "./ibcratelimit/v1beta1/genesis"; +import * as _172 from "./ibcratelimit/v1beta1/params"; +import * as _173 from "./ibcratelimit/v1beta1/query"; +import * as _174 from "./incentives/gauge"; +import * as _175 from "./incentives/genesis"; +import * as _176 from "./incentives/gov"; +import * as _177 from "./incentives/group"; +import * as _178 from "./incentives/params"; +import * as _179 from "./incentives/query"; +import * as _180 from "./incentives/tx"; +import * as _181 from "./lockup/genesis"; +import * as _182 from "./lockup/lock"; +import * as _183 from "./lockup/params"; +import * as _184 from "./lockup/query"; +import * as _185 from "./lockup/tx"; +import * as _186 from "./mint/v1beta1/genesis"; +import * as _187 from "./mint/v1beta1/mint"; +import * as _188 from "./mint/v1beta1/query"; +import * as _189 from "./poolincentives/v1beta1/genesis"; +import * as _190 from "./poolincentives/v1beta1/gov"; +import * as _191 from "./poolincentives/v1beta1/incentives"; +import * as _192 from "./poolincentives/v1beta1/query"; +import * as _193 from "./poolincentives/v1beta1/shared"; +import * as _194 from "./poolmanager/v1beta1/genesis"; +import * as _195 from "./poolmanager/v1beta1/gov"; +import * as _196 from "./poolmanager/v1beta1/module_route"; +import * as _197 from "./poolmanager/v1beta1/query"; +import * as _198 from "./poolmanager/v1beta1/swap_route"; +import * as _199 from "./poolmanager/v1beta1/tracked_volume"; +import * as _200 from "./poolmanager/v1beta1/tx"; +import * as _201 from "./poolmanager/v2/query"; +import * as _202 from "./protorev/v1beta1/genesis"; +import * as _203 from "./protorev/v1beta1/gov"; +import * as _204 from "./protorev/v1beta1/params"; +import * as _205 from "./protorev/v1beta1/protorev"; +import * as _206 from "./protorev/v1beta1/query"; +import * as _207 from "./protorev/v1beta1/tx"; +import * as _208 from "./store/v1beta1/tree"; +import * as _209 from "./superfluid/genesis"; +import * as _210 from "./superfluid/params"; +import * as _211 from "./superfluid/query"; +import * as _212 from "./superfluid/superfluid"; +import * as _213 from "./superfluid/tx"; +import * as _214 from "./tokenfactory/v1beta1/authorityMetadata"; +import * as _215 from "./tokenfactory/v1beta1/genesis"; +import * as _216 from "./tokenfactory/v1beta1/params"; +import * as _217 from "./tokenfactory/v1beta1/query"; +import * as _218 from "./tokenfactory/v1beta1/tx"; +import * as _219 from "./twap/v1beta1/genesis"; +import * as _220 from "./twap/v1beta1/query"; +import * as _221 from "./twap/v1beta1/twap_record"; +import * as _222 from "./txfees/v1beta1/feetoken"; +import * as _223 from "./txfees/v1beta1/genesis"; +import * as _224 from "./txfees/v1beta1/gov"; +import * as _225 from "./txfees/v1beta1/query"; +import * as _226 from "./valsetpref/v1beta1/query"; +import * as _227 from "./valsetpref/v1beta1/state"; +import * as _228 from "./valsetpref/v1beta1/tx"; +import * as _329 from "./concentratedliquidity/poolmodel/concentrated/v1beta1/tx.amino"; +import * as _330 from "./concentratedliquidity/v1beta1/tx.amino"; +import * as _331 from "./gamm/poolmodels/balancer/v1beta1/tx.amino"; +import * as _332 from "./gamm/poolmodels/stableswap/v1beta1/tx.amino"; +import * as _333 from "./gamm/v1beta1/tx.amino"; +import * as _334 from "./ibchooks/tx.amino"; +import * as _335 from "./incentives/tx.amino"; +import * as _336 from "./lockup/tx.amino"; +import * as _337 from "./poolmanager/v1beta1/tx.amino"; +import * as _338 from "./protorev/v1beta1/tx.amino"; +import * as _339 from "./superfluid/tx.amino"; +import * as _340 from "./tokenfactory/v1beta1/tx.amino"; +import * as _341 from "./valsetpref/v1beta1/tx.amino"; +import * as _342 from "./concentratedliquidity/poolmodel/concentrated/v1beta1/tx.registry"; +import * as _343 from "./concentratedliquidity/v1beta1/tx.registry"; +import * as _344 from "./gamm/poolmodels/balancer/v1beta1/tx.registry"; +import * as _345 from "./gamm/poolmodels/stableswap/v1beta1/tx.registry"; +import * as _346 from "./gamm/v1beta1/tx.registry"; +import * as _347 from "./ibchooks/tx.registry"; +import * as _348 from "./incentives/tx.registry"; +import * as _349 from "./lockup/tx.registry"; +import * as _350 from "./poolmanager/v1beta1/tx.registry"; +import * as _351 from "./protorev/v1beta1/tx.registry"; +import * as _352 from "./superfluid/tx.registry"; +import * as _353 from "./tokenfactory/v1beta1/tx.registry"; +import * as _354 from "./valsetpref/v1beta1/tx.registry"; +import * as _355 from "./concentratedliquidity/v1beta1/query.lcd"; +import * as _356 from "./cosmwasmpool/v1beta1/query.lcd"; +import * as _357 from "./downtimedetector/v1beta1/query.lcd"; +import * as _358 from "./epochs/v1beta1/query.lcd"; +import * as _359 from "./gamm/v1beta1/query.lcd"; +import * as _360 from "./gamm/v2/query.lcd"; +import * as _361 from "./ibcratelimit/v1beta1/query.lcd"; +import * as _362 from "./incentives/query.lcd"; +import * as _363 from "./lockup/query.lcd"; +import * as _364 from "./mint/v1beta1/query.lcd"; +import * as _365 from "./poolincentives/v1beta1/query.lcd"; +import * as _366 from "./poolmanager/v1beta1/query.lcd"; +import * as _367 from "./poolmanager/v2/query.lcd"; +import * as _368 from "./protorev/v1beta1/query.lcd"; +import * as _369 from "./superfluid/query.lcd"; +import * as _370 from "./tokenfactory/v1beta1/query.lcd"; +import * as _371 from "./twap/v1beta1/query.lcd"; +import * as _372 from "./txfees/v1beta1/query.lcd"; +import * as _373 from "./valsetpref/v1beta1/query.lcd"; +import * as _374 from "./concentratedliquidity/v1beta1/query.rpc.Query"; +import * as _375 from "./cosmwasmpool/v1beta1/query.rpc.Query"; +import * as _376 from "./downtimedetector/v1beta1/query.rpc.Query"; +import * as _377 from "./epochs/v1beta1/query.rpc.Query"; +import * as _378 from "./gamm/v1beta1/query.rpc.Query"; +import * as _379 from "./gamm/v2/query.rpc.Query"; +import * as _380 from "./ibcratelimit/v1beta1/query.rpc.Query"; +import * as _381 from "./incentives/query.rpc.Query"; +import * as _382 from "./lockup/query.rpc.Query"; +import * as _383 from "./mint/v1beta1/query.rpc.Query"; +import * as _384 from "./poolincentives/v1beta1/query.rpc.Query"; +import * as _385 from "./poolmanager/v1beta1/query.rpc.Query"; +import * as _386 from "./poolmanager/v2/query.rpc.Query"; +import * as _387 from "./protorev/v1beta1/query.rpc.Query"; +import * as _388 from "./superfluid/query.rpc.Query"; +import * as _389 from "./tokenfactory/v1beta1/query.rpc.Query"; +import * as _390 from "./twap/v1beta1/query.rpc.Query"; +import * as _391 from "./txfees/v1beta1/query.rpc.Query"; +import * as _392 from "./valsetpref/v1beta1/query.rpc.Query"; +import * as _393 from "./concentratedliquidity/poolmodel/concentrated/v1beta1/tx.rpc.msg"; +import * as _394 from "./concentratedliquidity/v1beta1/tx.rpc.msg"; +import * as _395 from "./gamm/poolmodels/balancer/v1beta1/tx.rpc.msg"; +import * as _396 from "./gamm/poolmodels/stableswap/v1beta1/tx.rpc.msg"; +import * as _397 from "./gamm/v1beta1/tx.rpc.msg"; +import * as _398 from "./ibchooks/tx.rpc.msg"; +import * as _399 from "./incentives/tx.rpc.msg"; +import * as _400 from "./lockup/tx.rpc.msg"; +import * as _401 from "./poolmanager/v1beta1/tx.rpc.msg"; +import * as _402 from "./protorev/v1beta1/tx.rpc.msg"; +import * as _403 from "./superfluid/tx.rpc.msg"; +import * as _404 from "./tokenfactory/v1beta1/tx.rpc.msg"; +import * as _405 from "./valsetpref/v1beta1/tx.rpc.msg"; +import * as _415 from "./lcd"; +import * as _416 from "./rpc.query"; +import * as _417 from "./rpc.tx"; export namespace osmosis { export namespace accum { export const v1beta1 = { - ..._89 + ..._139 }; } export const concentratedliquidity = { - ..._90, + ..._140, poolmodel: { concentrated: { v1beta1: { - ..._260, - ..._272, - ..._320 + ..._329, + ..._342, + ..._393 } } }, v1beta1: { - ..._261, - ..._273, - ..._284, - ..._302, - ..._321 + ..._330, + ..._343, + ..._355, + ..._374, + ..._394 } }; export namespace cosmwasmpool { export const v1beta1 = { - ..._91, - ..._92, - ..._93, - ..._94, - ..._95, - ..._96, - ..._97, - ..._98, - ..._99, - ..._100, - ..._101, - ..._102, - ..._285, - ..._303 + ..._141, + ..._142, + ..._143, + ..._144, + ..._145, + ..._146, + ..._147, + ..._148, + ..._149, + ..._150, + ..._151, + ..._152, + ..._356, + ..._375 }; } export namespace downtimedetector { export const v1beta1 = { - ..._103, - ..._104, - ..._105, - ..._286, - ..._304 + ..._153, + ..._154, + ..._155, + ..._357, + ..._376 }; } export namespace epochs { export const v1beta1 = { - ..._106, - ..._107, - ..._287, - ..._305 + ..._156, + ..._157, + ..._358, + ..._377 }; } export namespace gamm { - export const v1beta1 = { - ..._108, - ..._109, - ..._110, - ..._111, - ..._112, - ..._113, - ..._264, - ..._276, - ..._288, - ..._306, - ..._324 - }; export namespace poolmodels { export namespace balancer { export const v1beta1 = { - ..._114, - ..._262, - ..._274, - ..._322 + ..._158, + ..._331, + ..._344, + ..._395 }; } export namespace stableswap { export const v1beta1 = { - ..._115, - ..._116, - ..._263, - ..._275, - ..._323 + ..._159, + ..._160, + ..._332, + ..._345, + ..._396 }; } } + export const v1beta1 = { + ..._161, + ..._162, + ..._163, + ..._164, + ..._165, + ..._166, + ..._333, + ..._346, + ..._359, + ..._378, + ..._397 + }; export const v2 = { - ..._117, - ..._289, - ..._307 + ..._167, + ..._360, + ..._379 }; } + export const ibchooks = { + ..._168, + ..._169, + ..._170, + ..._334, + ..._347, + ..._398 + }; export namespace ibcratelimit { export const v1beta1 = { - ..._118, - ..._119, - ..._120, - ..._290, - ..._308 + ..._171, + ..._172, + ..._173, + ..._361, + ..._380 }; } export const incentives = { - ..._121, - ..._122, - ..._123, - ..._124, - ..._125, - ..._265, - ..._277, - ..._291, - ..._309, - ..._325 + ..._174, + ..._175, + ..._176, + ..._177, + ..._178, + ..._179, + ..._180, + ..._335, + ..._348, + ..._362, + ..._381, + ..._399 }; export const lockup = { - ..._126, - ..._127, - ..._128, - ..._129, - ..._130, - ..._266, - ..._278, - ..._292, - ..._310, - ..._326 + ..._181, + ..._182, + ..._183, + ..._184, + ..._185, + ..._336, + ..._349, + ..._363, + ..._382, + ..._400 }; export namespace mint { export const v1beta1 = { - ..._131, - ..._132, - ..._133, - ..._293, - ..._311 + ..._186, + ..._187, + ..._188, + ..._364, + ..._383 }; } export namespace poolincentives { export const v1beta1 = { - ..._134, - ..._135, - ..._136, - ..._137, - ..._138, - ..._294, - ..._312 + ..._189, + ..._190, + ..._191, + ..._192, + ..._193, + ..._365, + ..._384 }; } export namespace poolmanager { export const v1beta1 = { - ..._139, - ..._140, - ..._141, - ..._142, - ..._143, - ..._267, - ..._279, - ..._295, - ..._313, - ..._327 + ..._194, + ..._195, + ..._196, + ..._197, + ..._198, + ..._199, + ..._200, + ..._337, + ..._350, + ..._366, + ..._385, + ..._401 + }; + export const v2 = { + ..._201, + ..._367, + ..._386 }; } export namespace protorev { export const v1beta1 = { - ..._144, - ..._145, - ..._146, - ..._147, - ..._148, - ..._149, - ..._268, - ..._280, - ..._296, - ..._314, - ..._328 + ..._202, + ..._203, + ..._204, + ..._205, + ..._206, + ..._207, + ..._338, + ..._351, + ..._368, + ..._387, + ..._402 }; } export namespace store { export const v1beta1 = { - ..._150 + ..._208 }; } export const superfluid = { - ..._151, - ..._152, - ..._153, - ..._154, - ..._155, - ..._269, - ..._281, - ..._297, - ..._315, - ..._329 + ..._209, + ..._210, + ..._211, + ..._212, + ..._213, + ..._339, + ..._352, + ..._369, + ..._388, + ..._403 }; export namespace tokenfactory { export const v1beta1 = { - ..._156, - ..._157, - ..._158, - ..._159, - ..._160, - ..._270, - ..._282, - ..._298, - ..._316, - ..._330 + ..._214, + ..._215, + ..._216, + ..._217, + ..._218, + ..._340, + ..._353, + ..._370, + ..._389, + ..._404 }; } export namespace twap { export const v1beta1 = { - ..._161, - ..._162, - ..._163, - ..._299, - ..._317 + ..._219, + ..._220, + ..._221, + ..._371, + ..._390 }; } export namespace txfees { export const v1beta1 = { - ..._164, - ..._165, - ..._166, - ..._167, - ..._300, - ..._318 + ..._222, + ..._223, + ..._224, + ..._225, + ..._372, + ..._391 }; } export namespace valsetpref { export const v1beta1 = { - ..._168, - ..._169, - ..._170, - ..._271, - ..._283, - ..._301, - ..._319, - ..._331 + ..._226, + ..._227, + ..._228, + ..._341, + ..._354, + ..._373, + ..._392, + ..._405 }; } export const ClientFactory = { - ..._341, - ..._342, - ..._343 + ..._415, + ..._416, + ..._417 }; } \ No newline at end of file diff --git a/packages/osmojs/src/codegen/osmosis/client.ts b/packages/osmojs/src/codegen/osmosis/client.ts index 7caa9f0bc..4d6be5300 100644 --- a/packages/osmojs/src/codegen/osmosis/client.ts +++ b/packages/osmojs/src/codegen/osmosis/client.ts @@ -1,36 +1,39 @@ import { GeneratedType, Registry, OfflineSigner } from "@cosmjs/proto-signing"; import { defaultRegistryTypes, AminoTypes, SigningStargateClient } from "@cosmjs/stargate"; import { HttpEndpoint } from "@cosmjs/tendermint-rpc"; -import * as osmosisConcentratedliquidityPoolmodelConcentratedTxRegistry from "./concentrated-liquidity/pool-model/concentrated/tx.registry"; -import * as osmosisConcentratedliquidityTxRegistry from "./concentrated-liquidity/tx.registry"; -import * as osmosisGammPoolmodelsBalancerTxTxRegistry from "./gamm/pool-models/balancer/tx/tx.registry"; -import * as osmosisGammPoolmodelsStableswapTxRegistry from "./gamm/pool-models/stableswap/tx.registry"; +import * as osmosisConcentratedliquidityPoolmodelConcentratedV1beta1TxRegistry from "./concentratedliquidity/poolmodel/concentrated/v1beta1/tx.registry"; +import * as osmosisConcentratedliquidityV1beta1TxRegistry from "./concentratedliquidity/v1beta1/tx.registry"; +import * as osmosisGammPoolmodelsBalancerV1beta1TxRegistry from "./gamm/poolmodels/balancer/v1beta1/tx.registry"; +import * as osmosisGammPoolmodelsStableswapV1beta1TxRegistry from "./gamm/poolmodels/stableswap/v1beta1/tx.registry"; import * as osmosisGammV1beta1TxRegistry from "./gamm/v1beta1/tx.registry"; +import * as osmosisIbchooksTxRegistry from "./ibchooks/tx.registry"; import * as osmosisIncentivesTxRegistry from "./incentives/tx.registry"; import * as osmosisLockupTxRegistry from "./lockup/tx.registry"; import * as osmosisPoolmanagerV1beta1TxRegistry from "./poolmanager/v1beta1/tx.registry"; import * as osmosisProtorevV1beta1TxRegistry from "./protorev/v1beta1/tx.registry"; import * as osmosisSuperfluidTxRegistry from "./superfluid/tx.registry"; import * as osmosisTokenfactoryV1beta1TxRegistry from "./tokenfactory/v1beta1/tx.registry"; -import * as osmosisValsetprefV1beta1TxRegistry from "./valset-pref/v1beta1/tx.registry"; -import * as osmosisConcentratedliquidityPoolmodelConcentratedTxAmino from "./concentrated-liquidity/pool-model/concentrated/tx.amino"; -import * as osmosisConcentratedliquidityTxAmino from "./concentrated-liquidity/tx.amino"; -import * as osmosisGammPoolmodelsBalancerTxTxAmino from "./gamm/pool-models/balancer/tx/tx.amino"; -import * as osmosisGammPoolmodelsStableswapTxAmino from "./gamm/pool-models/stableswap/tx.amino"; +import * as osmosisValsetprefV1beta1TxRegistry from "./valsetpref/v1beta1/tx.registry"; +import * as osmosisConcentratedliquidityPoolmodelConcentratedV1beta1TxAmino from "./concentratedliquidity/poolmodel/concentrated/v1beta1/tx.amino"; +import * as osmosisConcentratedliquidityV1beta1TxAmino from "./concentratedliquidity/v1beta1/tx.amino"; +import * as osmosisGammPoolmodelsBalancerV1beta1TxAmino from "./gamm/poolmodels/balancer/v1beta1/tx.amino"; +import * as osmosisGammPoolmodelsStableswapV1beta1TxAmino from "./gamm/poolmodels/stableswap/v1beta1/tx.amino"; import * as osmosisGammV1beta1TxAmino from "./gamm/v1beta1/tx.amino"; +import * as osmosisIbchooksTxAmino from "./ibchooks/tx.amino"; import * as osmosisIncentivesTxAmino from "./incentives/tx.amino"; import * as osmosisLockupTxAmino from "./lockup/tx.amino"; import * as osmosisPoolmanagerV1beta1TxAmino from "./poolmanager/v1beta1/tx.amino"; import * as osmosisProtorevV1beta1TxAmino from "./protorev/v1beta1/tx.amino"; import * as osmosisSuperfluidTxAmino from "./superfluid/tx.amino"; import * as osmosisTokenfactoryV1beta1TxAmino from "./tokenfactory/v1beta1/tx.amino"; -import * as osmosisValsetprefV1beta1TxAmino from "./valset-pref/v1beta1/tx.amino"; +import * as osmosisValsetprefV1beta1TxAmino from "./valsetpref/v1beta1/tx.amino"; export const osmosisAminoConverters = { - ...osmosisConcentratedliquidityPoolmodelConcentratedTxAmino.AminoConverter, - ...osmosisConcentratedliquidityTxAmino.AminoConverter, - ...osmosisGammPoolmodelsBalancerTxTxAmino.AminoConverter, - ...osmosisGammPoolmodelsStableswapTxAmino.AminoConverter, + ...osmosisConcentratedliquidityPoolmodelConcentratedV1beta1TxAmino.AminoConverter, + ...osmosisConcentratedliquidityV1beta1TxAmino.AminoConverter, + ...osmosisGammPoolmodelsBalancerV1beta1TxAmino.AminoConverter, + ...osmosisGammPoolmodelsStableswapV1beta1TxAmino.AminoConverter, ...osmosisGammV1beta1TxAmino.AminoConverter, + ...osmosisIbchooksTxAmino.AminoConverter, ...osmosisIncentivesTxAmino.AminoConverter, ...osmosisLockupTxAmino.AminoConverter, ...osmosisPoolmanagerV1beta1TxAmino.AminoConverter, @@ -39,7 +42,7 @@ export const osmosisAminoConverters = { ...osmosisTokenfactoryV1beta1TxAmino.AminoConverter, ...osmosisValsetprefV1beta1TxAmino.AminoConverter }; -export const osmosisProtoRegistry: ReadonlyArray<[string, GeneratedType]> = [...osmosisConcentratedliquidityPoolmodelConcentratedTxRegistry.registry, ...osmosisConcentratedliquidityTxRegistry.registry, ...osmosisGammPoolmodelsBalancerTxTxRegistry.registry, ...osmosisGammPoolmodelsStableswapTxRegistry.registry, ...osmosisGammV1beta1TxRegistry.registry, ...osmosisIncentivesTxRegistry.registry, ...osmosisLockupTxRegistry.registry, ...osmosisPoolmanagerV1beta1TxRegistry.registry, ...osmosisProtorevV1beta1TxRegistry.registry, ...osmosisSuperfluidTxRegistry.registry, ...osmosisTokenfactoryV1beta1TxRegistry.registry, ...osmosisValsetprefV1beta1TxRegistry.registry]; +export const osmosisProtoRegistry: ReadonlyArray<[string, GeneratedType]> = [...osmosisConcentratedliquidityPoolmodelConcentratedV1beta1TxRegistry.registry, ...osmosisConcentratedliquidityV1beta1TxRegistry.registry, ...osmosisGammPoolmodelsBalancerV1beta1TxRegistry.registry, ...osmosisGammPoolmodelsStableswapV1beta1TxRegistry.registry, ...osmosisGammV1beta1TxRegistry.registry, ...osmosisIbchooksTxRegistry.registry, ...osmosisIncentivesTxRegistry.registry, ...osmosisLockupTxRegistry.registry, ...osmosisPoolmanagerV1beta1TxRegistry.registry, ...osmosisProtorevV1beta1TxRegistry.registry, ...osmosisSuperfluidTxRegistry.registry, ...osmosisTokenfactoryV1beta1TxRegistry.registry, ...osmosisValsetprefV1beta1TxRegistry.registry]; export const getSigningOsmosisClientOptions = ({ defaultTypes = defaultRegistryTypes }: { diff --git a/packages/osmojs/src/codegen/osmosis/concentrated-liquidity/params.ts b/packages/osmojs/src/codegen/osmosis/concentrated-liquidity/params.ts deleted file mode 100644 index 9078bd9ab..000000000 --- a/packages/osmojs/src/codegen/osmosis/concentrated-liquidity/params.ts +++ /dev/null @@ -1,237 +0,0 @@ -import { Duration, DurationAmino, DurationSDKType } from "../../google/protobuf/duration"; -import { BinaryReader, BinaryWriter } from "../../binary"; -import { Decimal } from "@cosmjs/math"; -export interface Params { - /** - * authorized_tick_spacing is an array of uint64s that represents the tick - * spacing values concentrated-liquidity pools can be created with. For - * example, an authorized_tick_spacing of [1, 10, 30] allows for pools - * to be created with tick spacing of 1, 10, or 30. - */ - authorizedTickSpacing: bigint[]; - authorizedSpreadFactors: string[]; - /** - * balancer_shares_reward_discount is the rate by which incentives flowing - * from CL to Balancer pools will be discounted to encourage LPs to migrate. - * e.g. a rate of 0.05 means Balancer LPs get 5% less incentives than full - * range CL LPs. - * This field can range from (0,1]. If set to 1, it indicates that all - * incentives stay at cl pool. - */ - balancerSharesRewardDiscount: string; - /** - * authorized_quote_denoms is a list of quote denoms that can be used as - * token1 when creating a pool. We limit the quote assets to a small set for - * the purposes of having convinient price increments stemming from tick to - * price conversion. These increments are in a human readable magnitude only - * for token1 as a quote. For limit orders in the future, this will be a - * desirable property in terms of UX as to allow users to set limit orders at - * prices in terms of token1 (quote asset) that are easy to reason about. - */ - authorizedQuoteDenoms: string[]; - authorizedUptimes: Duration[]; - /** - * is_permissionless_pool_creation_enabled is a boolean that determines if - * concentrated liquidity pools can be created via message. At launch, - * we consider allowing only governance to create pools, and then later - * allowing permissionless pool creation by switching this flag to true - * with a governance proposal. - */ - isPermissionlessPoolCreationEnabled: boolean; -} -export interface ParamsProtoMsg { - typeUrl: "/osmosis.concentratedliquidity.Params"; - value: Uint8Array; -} -export interface ParamsAmino { - /** - * authorized_tick_spacing is an array of uint64s that represents the tick - * spacing values concentrated-liquidity pools can be created with. For - * example, an authorized_tick_spacing of [1, 10, 30] allows for pools - * to be created with tick spacing of 1, 10, or 30. - */ - authorized_tick_spacing: string[]; - authorized_spread_factors: string[]; - /** - * balancer_shares_reward_discount is the rate by which incentives flowing - * from CL to Balancer pools will be discounted to encourage LPs to migrate. - * e.g. a rate of 0.05 means Balancer LPs get 5% less incentives than full - * range CL LPs. - * This field can range from (0,1]. If set to 1, it indicates that all - * incentives stay at cl pool. - */ - balancer_shares_reward_discount: string; - /** - * authorized_quote_denoms is a list of quote denoms that can be used as - * token1 when creating a pool. We limit the quote assets to a small set for - * the purposes of having convinient price increments stemming from tick to - * price conversion. These increments are in a human readable magnitude only - * for token1 as a quote. For limit orders in the future, this will be a - * desirable property in terms of UX as to allow users to set limit orders at - * prices in terms of token1 (quote asset) that are easy to reason about. - */ - authorized_quote_denoms: string[]; - authorized_uptimes: DurationAmino[]; - /** - * is_permissionless_pool_creation_enabled is a boolean that determines if - * concentrated liquidity pools can be created via message. At launch, - * we consider allowing only governance to create pools, and then later - * allowing permissionless pool creation by switching this flag to true - * with a governance proposal. - */ - is_permissionless_pool_creation_enabled: boolean; -} -export interface ParamsAminoMsg { - type: "osmosis/concentratedliquidity/params"; - value: ParamsAmino; -} -export interface ParamsSDKType { - authorized_tick_spacing: bigint[]; - authorized_spread_factors: string[]; - balancer_shares_reward_discount: string; - authorized_quote_denoms: string[]; - authorized_uptimes: DurationSDKType[]; - is_permissionless_pool_creation_enabled: boolean; -} -function createBaseParams(): Params { - return { - authorizedTickSpacing: [], - authorizedSpreadFactors: [], - balancerSharesRewardDiscount: "", - authorizedQuoteDenoms: [], - authorizedUptimes: [], - isPermissionlessPoolCreationEnabled: false - }; -} -export const Params = { - typeUrl: "/osmosis.concentratedliquidity.Params", - encode(message: Params, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { - writer.uint32(10).fork(); - for (const v of message.authorizedTickSpacing) { - writer.uint64(v); - } - writer.ldelim(); - for (const v of message.authorizedSpreadFactors) { - writer.uint32(18).string(Decimal.fromUserInput(v!, 18).atomics); - } - if (message.balancerSharesRewardDiscount !== "") { - writer.uint32(26).string(Decimal.fromUserInput(message.balancerSharesRewardDiscount, 18).atomics); - } - for (const v of message.authorizedQuoteDenoms) { - writer.uint32(34).string(v!); - } - for (const v of message.authorizedUptimes) { - Duration.encode(v!, writer.uint32(42).fork()).ldelim(); - } - if (message.isPermissionlessPoolCreationEnabled === true) { - writer.uint32(48).bool(message.isPermissionlessPoolCreationEnabled); - } - return writer; - }, - decode(input: BinaryReader | Uint8Array, length?: number): Params { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseParams(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if ((tag & 7) === 2) { - const end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) { - message.authorizedTickSpacing.push(reader.uint64()); - } - } else { - message.authorizedTickSpacing.push(reader.uint64()); - } - break; - case 2: - message.authorizedSpreadFactors.push(Decimal.fromAtomics(reader.string(), 18).toString()); - break; - case 3: - message.balancerSharesRewardDiscount = Decimal.fromAtomics(reader.string(), 18).toString(); - break; - case 4: - message.authorizedQuoteDenoms.push(reader.string()); - break; - case 5: - message.authorizedUptimes.push(Duration.decode(reader, reader.uint32())); - break; - case 6: - message.isPermissionlessPoolCreationEnabled = reader.bool(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - fromPartial(object: Partial): Params { - const message = createBaseParams(); - message.authorizedTickSpacing = object.authorizedTickSpacing?.map(e => BigInt(e.toString())) || []; - message.authorizedSpreadFactors = object.authorizedSpreadFactors?.map(e => e) || []; - message.balancerSharesRewardDiscount = object.balancerSharesRewardDiscount ?? ""; - message.authorizedQuoteDenoms = object.authorizedQuoteDenoms?.map(e => e) || []; - message.authorizedUptimes = object.authorizedUptimes?.map(e => Duration.fromPartial(e)) || []; - message.isPermissionlessPoolCreationEnabled = object.isPermissionlessPoolCreationEnabled ?? false; - return message; - }, - fromAmino(object: ParamsAmino): Params { - return { - authorizedTickSpacing: Array.isArray(object?.authorized_tick_spacing) ? object.authorized_tick_spacing.map((e: any) => BigInt(e)) : [], - authorizedSpreadFactors: Array.isArray(object?.authorized_spread_factors) ? object.authorized_spread_factors.map((e: any) => e) : [], - balancerSharesRewardDiscount: object.balancer_shares_reward_discount, - authorizedQuoteDenoms: Array.isArray(object?.authorized_quote_denoms) ? object.authorized_quote_denoms.map((e: any) => e) : [], - authorizedUptimes: Array.isArray(object?.authorized_uptimes) ? object.authorized_uptimes.map((e: any) => Duration.fromAmino(e)) : [], - isPermissionlessPoolCreationEnabled: object.is_permissionless_pool_creation_enabled - }; - }, - toAmino(message: Params): ParamsAmino { - const obj: any = {}; - if (message.authorizedTickSpacing) { - obj.authorized_tick_spacing = message.authorizedTickSpacing.map(e => e.toString()); - } else { - obj.authorized_tick_spacing = []; - } - if (message.authorizedSpreadFactors) { - obj.authorized_spread_factors = message.authorizedSpreadFactors.map(e => e); - } else { - obj.authorized_spread_factors = []; - } - obj.balancer_shares_reward_discount = message.balancerSharesRewardDiscount; - if (message.authorizedQuoteDenoms) { - obj.authorized_quote_denoms = message.authorizedQuoteDenoms.map(e => e); - } else { - obj.authorized_quote_denoms = []; - } - if (message.authorizedUptimes) { - obj.authorized_uptimes = message.authorizedUptimes.map(e => e ? Duration.toAmino(e) : undefined); - } else { - obj.authorized_uptimes = []; - } - obj.is_permissionless_pool_creation_enabled = message.isPermissionlessPoolCreationEnabled; - return obj; - }, - fromAminoMsg(object: ParamsAminoMsg): Params { - return Params.fromAmino(object.value); - }, - toAminoMsg(message: Params): ParamsAminoMsg { - return { - type: "osmosis/concentratedliquidity/params", - value: Params.toAmino(message) - }; - }, - fromProtoMsg(message: ParamsProtoMsg): Params { - return Params.decode(message.value); - }, - toProto(message: Params): Uint8Array { - return Params.encode(message).finish(); - }, - toProtoMsg(message: Params): ParamsProtoMsg { - return { - typeUrl: "/osmosis.concentratedliquidity.Params", - value: Params.encode(message).finish() - }; - } -}; \ No newline at end of file diff --git a/packages/osmojs/src/codegen/osmosis/concentratedliquidity/params.ts b/packages/osmojs/src/codegen/osmosis/concentratedliquidity/params.ts new file mode 100644 index 000000000..f15c70960 --- /dev/null +++ b/packages/osmojs/src/codegen/osmosis/concentratedliquidity/params.ts @@ -0,0 +1,343 @@ +import { Duration, DurationAmino, DurationSDKType } from "../../google/protobuf/duration"; +import { BinaryReader, BinaryWriter } from "../../binary"; +import { Decimal } from "@cosmjs/math"; +import { isSet } from "../../helpers"; +import { GlobalDecoderRegistry } from "../../registry"; +export interface Params { + /** + * authorized_tick_spacing is an array of uint64s that represents the tick + * spacing values concentrated-liquidity pools can be created with. For + * example, an authorized_tick_spacing of [1, 10, 30] allows for pools + * to be created with tick spacing of 1, 10, or 30. + */ + authorizedTickSpacing: bigint[]; + authorizedSpreadFactors: string[]; + /** + * balancer_shares_reward_discount is the rate by which incentives flowing + * from CL to Balancer pools will be discounted to encourage LPs to migrate. + * e.g. a rate of 0.05 means Balancer LPs get 5% less incentives than full + * range CL LPs. + * This field can range from (0,1]. If set to 1, it indicates that all + * incentives stay at cl pool. + */ + balancerSharesRewardDiscount: string; + /** + * authorized_quote_denoms is a list of quote denoms that can be used as + * token1 when creating a pool. We limit the quote assets to a small set for + * the purposes of having convenient price increments stemming from tick to + * price conversion. These increments are in a human readable magnitude only + * for token1 as a quote. For limit orders in the future, this will be a + * desirable property in terms of UX as to allow users to set limit orders at + * prices in terms of token1 (quote asset) that are easy to reason about. + */ + authorizedQuoteDenoms: string[]; + authorizedUptimes: Duration[]; + /** + * is_permissionless_pool_creation_enabled is a boolean that determines if + * concentrated liquidity pools can be created via message. At launch, + * we consider allowing only governance to create pools, and then later + * allowing permissionless pool creation by switching this flag to true + * with a governance proposal. + */ + isPermissionlessPoolCreationEnabled: boolean; + /** + * unrestricted_pool_creator_whitelist is a list of addresses that are + * allowed to bypass restrictions on permissionless supercharged pool + * creation, like pool_creation_enabled, restricted quote assets, no + * double creation of pools, etc. + */ + unrestrictedPoolCreatorWhitelist: string[]; + hookGasLimit: bigint; +} +export interface ParamsProtoMsg { + typeUrl: "/osmosis.concentratedliquidity.Params"; + value: Uint8Array; +} +export interface ParamsAmino { + /** + * authorized_tick_spacing is an array of uint64s that represents the tick + * spacing values concentrated-liquidity pools can be created with. For + * example, an authorized_tick_spacing of [1, 10, 30] allows for pools + * to be created with tick spacing of 1, 10, or 30. + */ + authorized_tick_spacing?: string[]; + authorized_spread_factors?: string[]; + /** + * balancer_shares_reward_discount is the rate by which incentives flowing + * from CL to Balancer pools will be discounted to encourage LPs to migrate. + * e.g. a rate of 0.05 means Balancer LPs get 5% less incentives than full + * range CL LPs. + * This field can range from (0,1]. If set to 1, it indicates that all + * incentives stay at cl pool. + */ + balancer_shares_reward_discount?: string; + /** + * authorized_quote_denoms is a list of quote denoms that can be used as + * token1 when creating a pool. We limit the quote assets to a small set for + * the purposes of having convenient price increments stemming from tick to + * price conversion. These increments are in a human readable magnitude only + * for token1 as a quote. For limit orders in the future, this will be a + * desirable property in terms of UX as to allow users to set limit orders at + * prices in terms of token1 (quote asset) that are easy to reason about. + */ + authorized_quote_denoms?: string[]; + authorized_uptimes?: DurationAmino[]; + /** + * is_permissionless_pool_creation_enabled is a boolean that determines if + * concentrated liquidity pools can be created via message. At launch, + * we consider allowing only governance to create pools, and then later + * allowing permissionless pool creation by switching this flag to true + * with a governance proposal. + */ + is_permissionless_pool_creation_enabled?: boolean; + /** + * unrestricted_pool_creator_whitelist is a list of addresses that are + * allowed to bypass restrictions on permissionless supercharged pool + * creation, like pool_creation_enabled, restricted quote assets, no + * double creation of pools, etc. + */ + unrestricted_pool_creator_whitelist?: string[]; + hook_gas_limit?: string; +} +export interface ParamsAminoMsg { + type: "osmosis/concentratedliquidity/params"; + value: ParamsAmino; +} +export interface ParamsSDKType { + authorized_tick_spacing: bigint[]; + authorized_spread_factors: string[]; + balancer_shares_reward_discount: string; + authorized_quote_denoms: string[]; + authorized_uptimes: DurationSDKType[]; + is_permissionless_pool_creation_enabled: boolean; + unrestricted_pool_creator_whitelist: string[]; + hook_gas_limit: bigint; +} +function createBaseParams(): Params { + return { + authorizedTickSpacing: [], + authorizedSpreadFactors: [], + balancerSharesRewardDiscount: "", + authorizedQuoteDenoms: [], + authorizedUptimes: [], + isPermissionlessPoolCreationEnabled: false, + unrestrictedPoolCreatorWhitelist: [], + hookGasLimit: BigInt(0) + }; +} +export const Params = { + typeUrl: "/osmosis.concentratedliquidity.Params", + aminoType: "osmosis/concentratedliquidity/params", + is(o: any): o is Params { + return o && (o.$typeUrl === Params.typeUrl || Array.isArray(o.authorizedTickSpacing) && (!o.authorizedTickSpacing.length || typeof o.authorizedTickSpacing[0] === "bigint") && Array.isArray(o.authorizedSpreadFactors) && (!o.authorizedSpreadFactors.length || typeof o.authorizedSpreadFactors[0] === "string") && typeof o.balancerSharesRewardDiscount === "string" && Array.isArray(o.authorizedQuoteDenoms) && (!o.authorizedQuoteDenoms.length || typeof o.authorizedQuoteDenoms[0] === "string") && Array.isArray(o.authorizedUptimes) && (!o.authorizedUptimes.length || Duration.is(o.authorizedUptimes[0])) && typeof o.isPermissionlessPoolCreationEnabled === "boolean" && Array.isArray(o.unrestrictedPoolCreatorWhitelist) && (!o.unrestrictedPoolCreatorWhitelist.length || typeof o.unrestrictedPoolCreatorWhitelist[0] === "string") && typeof o.hookGasLimit === "bigint"); + }, + isSDK(o: any): o is ParamsSDKType { + return o && (o.$typeUrl === Params.typeUrl || Array.isArray(o.authorized_tick_spacing) && (!o.authorized_tick_spacing.length || typeof o.authorized_tick_spacing[0] === "bigint") && Array.isArray(o.authorized_spread_factors) && (!o.authorized_spread_factors.length || typeof o.authorized_spread_factors[0] === "string") && typeof o.balancer_shares_reward_discount === "string" && Array.isArray(o.authorized_quote_denoms) && (!o.authorized_quote_denoms.length || typeof o.authorized_quote_denoms[0] === "string") && Array.isArray(o.authorized_uptimes) && (!o.authorized_uptimes.length || Duration.isSDK(o.authorized_uptimes[0])) && typeof o.is_permissionless_pool_creation_enabled === "boolean" && Array.isArray(o.unrestricted_pool_creator_whitelist) && (!o.unrestricted_pool_creator_whitelist.length || typeof o.unrestricted_pool_creator_whitelist[0] === "string") && typeof o.hook_gas_limit === "bigint"); + }, + isAmino(o: any): o is ParamsAmino { + return o && (o.$typeUrl === Params.typeUrl || Array.isArray(o.authorized_tick_spacing) && (!o.authorized_tick_spacing.length || typeof o.authorized_tick_spacing[0] === "bigint") && Array.isArray(o.authorized_spread_factors) && (!o.authorized_spread_factors.length || typeof o.authorized_spread_factors[0] === "string") && typeof o.balancer_shares_reward_discount === "string" && Array.isArray(o.authorized_quote_denoms) && (!o.authorized_quote_denoms.length || typeof o.authorized_quote_denoms[0] === "string") && Array.isArray(o.authorized_uptimes) && (!o.authorized_uptimes.length || Duration.isAmino(o.authorized_uptimes[0])) && typeof o.is_permissionless_pool_creation_enabled === "boolean" && Array.isArray(o.unrestricted_pool_creator_whitelist) && (!o.unrestricted_pool_creator_whitelist.length || typeof o.unrestricted_pool_creator_whitelist[0] === "string") && typeof o.hook_gas_limit === "bigint"); + }, + encode(message: Params, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + writer.uint32(10).fork(); + for (const v of message.authorizedTickSpacing) { + writer.uint64(v); + } + writer.ldelim(); + for (const v of message.authorizedSpreadFactors) { + writer.uint32(18).string(Decimal.fromUserInput(v!, 18).atomics); + } + if (message.balancerSharesRewardDiscount !== "") { + writer.uint32(26).string(Decimal.fromUserInput(message.balancerSharesRewardDiscount, 18).atomics); + } + for (const v of message.authorizedQuoteDenoms) { + writer.uint32(34).string(v!); + } + for (const v of message.authorizedUptimes) { + Duration.encode(v!, writer.uint32(42).fork()).ldelim(); + } + if (message.isPermissionlessPoolCreationEnabled === true) { + writer.uint32(48).bool(message.isPermissionlessPoolCreationEnabled); + } + for (const v of message.unrestrictedPoolCreatorWhitelist) { + writer.uint32(58).string(v!); + } + if (message.hookGasLimit !== BigInt(0)) { + writer.uint32(64).uint64(message.hookGasLimit); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): Params { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseParams(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if ((tag & 7) === 2) { + const end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) { + message.authorizedTickSpacing.push(reader.uint64()); + } + } else { + message.authorizedTickSpacing.push(reader.uint64()); + } + break; + case 2: + message.authorizedSpreadFactors.push(Decimal.fromAtomics(reader.string(), 18).toString()); + break; + case 3: + message.balancerSharesRewardDiscount = Decimal.fromAtomics(reader.string(), 18).toString(); + break; + case 4: + message.authorizedQuoteDenoms.push(reader.string()); + break; + case 5: + message.authorizedUptimes.push(Duration.decode(reader, reader.uint32())); + break; + case 6: + message.isPermissionlessPoolCreationEnabled = reader.bool(); + break; + case 7: + message.unrestrictedPoolCreatorWhitelist.push(reader.string()); + break; + case 8: + message.hookGasLimit = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): Params { + return { + authorizedTickSpacing: Array.isArray(object?.authorizedTickSpacing) ? object.authorizedTickSpacing.map((e: any) => BigInt(e.toString())) : [], + authorizedSpreadFactors: Array.isArray(object?.authorizedSpreadFactors) ? object.authorizedSpreadFactors.map((e: any) => String(e)) : [], + balancerSharesRewardDiscount: isSet(object.balancerSharesRewardDiscount) ? String(object.balancerSharesRewardDiscount) : "", + authorizedQuoteDenoms: Array.isArray(object?.authorizedQuoteDenoms) ? object.authorizedQuoteDenoms.map((e: any) => String(e)) : [], + authorizedUptimes: Array.isArray(object?.authorizedUptimes) ? object.authorizedUptimes.map((e: any) => Duration.fromJSON(e)) : [], + isPermissionlessPoolCreationEnabled: isSet(object.isPermissionlessPoolCreationEnabled) ? Boolean(object.isPermissionlessPoolCreationEnabled) : false, + unrestrictedPoolCreatorWhitelist: Array.isArray(object?.unrestrictedPoolCreatorWhitelist) ? object.unrestrictedPoolCreatorWhitelist.map((e: any) => String(e)) : [], + hookGasLimit: isSet(object.hookGasLimit) ? BigInt(object.hookGasLimit.toString()) : BigInt(0) + }; + }, + toJSON(message: Params): unknown { + const obj: any = {}; + if (message.authorizedTickSpacing) { + obj.authorizedTickSpacing = message.authorizedTickSpacing.map(e => (e || BigInt(0)).toString()); + } else { + obj.authorizedTickSpacing = []; + } + if (message.authorizedSpreadFactors) { + obj.authorizedSpreadFactors = message.authorizedSpreadFactors.map(e => e); + } else { + obj.authorizedSpreadFactors = []; + } + message.balancerSharesRewardDiscount !== undefined && (obj.balancerSharesRewardDiscount = message.balancerSharesRewardDiscount); + if (message.authorizedQuoteDenoms) { + obj.authorizedQuoteDenoms = message.authorizedQuoteDenoms.map(e => e); + } else { + obj.authorizedQuoteDenoms = []; + } + if (message.authorizedUptimes) { + obj.authorizedUptimes = message.authorizedUptimes.map(e => e ? Duration.toJSON(e) : undefined); + } else { + obj.authorizedUptimes = []; + } + message.isPermissionlessPoolCreationEnabled !== undefined && (obj.isPermissionlessPoolCreationEnabled = message.isPermissionlessPoolCreationEnabled); + if (message.unrestrictedPoolCreatorWhitelist) { + obj.unrestrictedPoolCreatorWhitelist = message.unrestrictedPoolCreatorWhitelist.map(e => e); + } else { + obj.unrestrictedPoolCreatorWhitelist = []; + } + message.hookGasLimit !== undefined && (obj.hookGasLimit = (message.hookGasLimit || BigInt(0)).toString()); + return obj; + }, + fromPartial(object: Partial): Params { + const message = createBaseParams(); + message.authorizedTickSpacing = object.authorizedTickSpacing?.map(e => BigInt(e.toString())) || []; + message.authorizedSpreadFactors = object.authorizedSpreadFactors?.map(e => e) || []; + message.balancerSharesRewardDiscount = object.balancerSharesRewardDiscount ?? ""; + message.authorizedQuoteDenoms = object.authorizedQuoteDenoms?.map(e => e) || []; + message.authorizedUptimes = object.authorizedUptimes?.map(e => Duration.fromPartial(e)) || []; + message.isPermissionlessPoolCreationEnabled = object.isPermissionlessPoolCreationEnabled ?? false; + message.unrestrictedPoolCreatorWhitelist = object.unrestrictedPoolCreatorWhitelist?.map(e => e) || []; + message.hookGasLimit = object.hookGasLimit !== undefined && object.hookGasLimit !== null ? BigInt(object.hookGasLimit.toString()) : BigInt(0); + return message; + }, + fromAmino(object: ParamsAmino): Params { + const message = createBaseParams(); + message.authorizedTickSpacing = object.authorized_tick_spacing?.map(e => BigInt(e)) || []; + message.authorizedSpreadFactors = object.authorized_spread_factors?.map(e => e) || []; + if (object.balancer_shares_reward_discount !== undefined && object.balancer_shares_reward_discount !== null) { + message.balancerSharesRewardDiscount = object.balancer_shares_reward_discount; + } + message.authorizedQuoteDenoms = object.authorized_quote_denoms?.map(e => e) || []; + message.authorizedUptimes = object.authorized_uptimes?.map(e => Duration.fromAmino(e)) || []; + if (object.is_permissionless_pool_creation_enabled !== undefined && object.is_permissionless_pool_creation_enabled !== null) { + message.isPermissionlessPoolCreationEnabled = object.is_permissionless_pool_creation_enabled; + } + message.unrestrictedPoolCreatorWhitelist = object.unrestricted_pool_creator_whitelist?.map(e => e) || []; + if (object.hook_gas_limit !== undefined && object.hook_gas_limit !== null) { + message.hookGasLimit = BigInt(object.hook_gas_limit); + } + return message; + }, + toAmino(message: Params): ParamsAmino { + const obj: any = {}; + if (message.authorizedTickSpacing) { + obj.authorized_tick_spacing = message.authorizedTickSpacing.map(e => e.toString()); + } else { + obj.authorized_tick_spacing = []; + } + if (message.authorizedSpreadFactors) { + obj.authorized_spread_factors = message.authorizedSpreadFactors.map(e => e); + } else { + obj.authorized_spread_factors = []; + } + obj.balancer_shares_reward_discount = message.balancerSharesRewardDiscount; + if (message.authorizedQuoteDenoms) { + obj.authorized_quote_denoms = message.authorizedQuoteDenoms.map(e => e); + } else { + obj.authorized_quote_denoms = []; + } + if (message.authorizedUptimes) { + obj.authorized_uptimes = message.authorizedUptimes.map(e => e ? Duration.toAmino(e) : undefined); + } else { + obj.authorized_uptimes = []; + } + obj.is_permissionless_pool_creation_enabled = message.isPermissionlessPoolCreationEnabled; + if (message.unrestrictedPoolCreatorWhitelist) { + obj.unrestricted_pool_creator_whitelist = message.unrestrictedPoolCreatorWhitelist.map(e => e); + } else { + obj.unrestricted_pool_creator_whitelist = []; + } + obj.hook_gas_limit = message.hookGasLimit ? message.hookGasLimit.toString() : undefined; + return obj; + }, + fromAminoMsg(object: ParamsAminoMsg): Params { + return Params.fromAmino(object.value); + }, + toAminoMsg(message: Params): ParamsAminoMsg { + return { + type: "osmosis/concentratedliquidity/params", + value: Params.toAmino(message) + }; + }, + fromProtoMsg(message: ParamsProtoMsg): Params { + return Params.decode(message.value); + }, + toProto(message: Params): Uint8Array { + return Params.encode(message).finish(); + }, + toProtoMsg(message: Params): ParamsProtoMsg { + return { + typeUrl: "/osmosis.concentratedliquidity.Params", + value: Params.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(Params.typeUrl, Params); +GlobalDecoderRegistry.registerAminoProtoMapping(Params.aminoType, Params.typeUrl); \ No newline at end of file diff --git a/packages/osmojs/src/codegen/osmosis/concentrated-liquidity/pool-model/concentrated/tx.amino.ts b/packages/osmojs/src/codegen/osmosis/concentratedliquidity/poolmodel/concentrated/v1beta1/tx.amino.ts similarity index 100% rename from packages/osmojs/src/codegen/osmosis/concentrated-liquidity/pool-model/concentrated/tx.amino.ts rename to packages/osmojs/src/codegen/osmosis/concentratedliquidity/poolmodel/concentrated/v1beta1/tx.amino.ts diff --git a/packages/osmojs/src/codegen/osmosis/concentrated-liquidity/pool-model/concentrated/tx.registry.ts b/packages/osmojs/src/codegen/osmosis/concentratedliquidity/poolmodel/concentrated/v1beta1/tx.registry.ts similarity index 71% rename from packages/osmojs/src/codegen/osmosis/concentrated-liquidity/pool-model/concentrated/tx.registry.ts rename to packages/osmojs/src/codegen/osmosis/concentratedliquidity/poolmodel/concentrated/v1beta1/tx.registry.ts index 784dc217e..3a4f050ed 100644 --- a/packages/osmojs/src/codegen/osmosis/concentrated-liquidity/pool-model/concentrated/tx.registry.ts +++ b/packages/osmojs/src/codegen/osmosis/concentratedliquidity/poolmodel/concentrated/v1beta1/tx.registry.ts @@ -24,6 +24,22 @@ export const MessageComposer = { }; } }, + toJSON: { + createConcentratedPool(value: MsgCreateConcentratedPool) { + return { + typeUrl: "/osmosis.concentratedliquidity.poolmodel.concentrated.v1beta1.MsgCreateConcentratedPool", + value: MsgCreateConcentratedPool.toJSON(value) + }; + } + }, + fromJSON: { + createConcentratedPool(value: any) { + return { + typeUrl: "/osmosis.concentratedliquidity.poolmodel.concentrated.v1beta1.MsgCreateConcentratedPool", + value: MsgCreateConcentratedPool.fromJSON(value) + }; + } + }, fromPartial: { createConcentratedPool(value: MsgCreateConcentratedPool) { return { diff --git a/packages/osmojs/src/codegen/osmosis/concentrated-liquidity/pool-model/concentrated/tx.rpc.msg.ts b/packages/osmojs/src/codegen/osmosis/concentratedliquidity/poolmodel/concentrated/v1beta1/tx.rpc.msg.ts similarity index 81% rename from packages/osmojs/src/codegen/osmosis/concentrated-liquidity/pool-model/concentrated/tx.rpc.msg.ts rename to packages/osmojs/src/codegen/osmosis/concentratedliquidity/poolmodel/concentrated/v1beta1/tx.rpc.msg.ts index 237bcb718..29cebffa8 100644 --- a/packages/osmojs/src/codegen/osmosis/concentrated-liquidity/pool-model/concentrated/tx.rpc.msg.ts +++ b/packages/osmojs/src/codegen/osmosis/concentratedliquidity/poolmodel/concentrated/v1beta1/tx.rpc.msg.ts @@ -1,5 +1,5 @@ -import { Rpc } from "../../../../helpers"; -import { BinaryReader } from "../../../../binary"; +import { Rpc } from "../../../../../helpers"; +import { BinaryReader } from "../../../../../binary"; import { MsgCreateConcentratedPool, MsgCreateConcentratedPoolResponse } from "./tx"; export interface Msg { createConcentratedPool(request: MsgCreateConcentratedPool): Promise; @@ -15,4 +15,7 @@ export class MsgClientImpl implements Msg { const promise = this.rpc.request("osmosis.concentratedliquidity.poolmodel.concentrated.v1beta1.Msg", "CreateConcentratedPool", data); return promise.then(data => MsgCreateConcentratedPoolResponse.decode(new BinaryReader(data))); } -} \ No newline at end of file +} +export const createClientImpl = (rpc: Rpc) => { + return new MsgClientImpl(rpc); +}; \ No newline at end of file diff --git a/packages/osmojs/src/codegen/osmosis/concentrated-liquidity/pool-model/concentrated/tx.ts b/packages/osmojs/src/codegen/osmosis/concentratedliquidity/poolmodel/concentrated/v1beta1/tx.ts similarity index 64% rename from packages/osmojs/src/codegen/osmosis/concentrated-liquidity/pool-model/concentrated/tx.ts rename to packages/osmojs/src/codegen/osmosis/concentratedliquidity/poolmodel/concentrated/v1beta1/tx.ts index 772fa37c5..c70ba07a6 100644 --- a/packages/osmojs/src/codegen/osmosis/concentrated-liquidity/pool-model/concentrated/tx.ts +++ b/packages/osmojs/src/codegen/osmosis/concentratedliquidity/poolmodel/concentrated/v1beta1/tx.ts @@ -1,5 +1,7 @@ -import { BinaryReader, BinaryWriter } from "../../../../binary"; +import { BinaryReader, BinaryWriter } from "../../../../../binary"; import { Decimal } from "@cosmjs/math"; +import { isSet } from "../../../../../helpers"; +import { GlobalDecoderRegistry } from "../../../../../registry"; /** ===================== MsgCreateConcentratedPool */ export interface MsgCreateConcentratedPool { sender: string; @@ -14,11 +16,11 @@ export interface MsgCreateConcentratedPoolProtoMsg { } /** ===================== MsgCreateConcentratedPool */ export interface MsgCreateConcentratedPoolAmino { - sender: string; - denom0: string; - denom1: string; - tick_spacing: string; - spread_factor: string; + sender?: string; + denom0?: string; + denom1?: string; + tick_spacing?: string; + spread_factor?: string; } export interface MsgCreateConcentratedPoolAminoMsg { type: "osmosis/concentratedliquidity/poolmodel/concentrated/create-concentrated-pool"; @@ -42,7 +44,7 @@ export interface MsgCreateConcentratedPoolResponseProtoMsg { } /** Returns a unique poolID to identify the pool with. */ export interface MsgCreateConcentratedPoolResponseAmino { - pool_id: string; + pool_id?: string; } export interface MsgCreateConcentratedPoolResponseAminoMsg { type: "osmosis/concentratedliquidity/poolmodel/concentrated/create-concentrated-pool-response"; @@ -63,6 +65,16 @@ function createBaseMsgCreateConcentratedPool(): MsgCreateConcentratedPool { } export const MsgCreateConcentratedPool = { typeUrl: "/osmosis.concentratedliquidity.poolmodel.concentrated.v1beta1.MsgCreateConcentratedPool", + aminoType: "osmosis/concentratedliquidity/poolmodel/concentrated/create-concentrated-pool", + is(o: any): o is MsgCreateConcentratedPool { + return o && (o.$typeUrl === MsgCreateConcentratedPool.typeUrl || typeof o.sender === "string" && typeof o.denom0 === "string" && typeof o.denom1 === "string" && typeof o.tickSpacing === "bigint" && typeof o.spreadFactor === "string"); + }, + isSDK(o: any): o is MsgCreateConcentratedPoolSDKType { + return o && (o.$typeUrl === MsgCreateConcentratedPool.typeUrl || typeof o.sender === "string" && typeof o.denom0 === "string" && typeof o.denom1 === "string" && typeof o.tick_spacing === "bigint" && typeof o.spread_factor === "string"); + }, + isAmino(o: any): o is MsgCreateConcentratedPoolAmino { + return o && (o.$typeUrl === MsgCreateConcentratedPool.typeUrl || typeof o.sender === "string" && typeof o.denom0 === "string" && typeof o.denom1 === "string" && typeof o.tick_spacing === "bigint" && typeof o.spread_factor === "string"); + }, encode(message: MsgCreateConcentratedPool, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.sender !== "") { writer.uint32(10).string(message.sender); @@ -110,6 +122,24 @@ export const MsgCreateConcentratedPool = { } return message; }, + fromJSON(object: any): MsgCreateConcentratedPool { + return { + sender: isSet(object.sender) ? String(object.sender) : "", + denom0: isSet(object.denom0) ? String(object.denom0) : "", + denom1: isSet(object.denom1) ? String(object.denom1) : "", + tickSpacing: isSet(object.tickSpacing) ? BigInt(object.tickSpacing.toString()) : BigInt(0), + spreadFactor: isSet(object.spreadFactor) ? String(object.spreadFactor) : "" + }; + }, + toJSON(message: MsgCreateConcentratedPool): unknown { + const obj: any = {}; + message.sender !== undefined && (obj.sender = message.sender); + message.denom0 !== undefined && (obj.denom0 = message.denom0); + message.denom1 !== undefined && (obj.denom1 = message.denom1); + message.tickSpacing !== undefined && (obj.tickSpacing = (message.tickSpacing || BigInt(0)).toString()); + message.spreadFactor !== undefined && (obj.spreadFactor = message.spreadFactor); + return obj; + }, fromPartial(object: Partial): MsgCreateConcentratedPool { const message = createBaseMsgCreateConcentratedPool(); message.sender = object.sender ?? ""; @@ -120,13 +150,23 @@ export const MsgCreateConcentratedPool = { return message; }, fromAmino(object: MsgCreateConcentratedPoolAmino): MsgCreateConcentratedPool { - return { - sender: object.sender, - denom0: object.denom0, - denom1: object.denom1, - tickSpacing: BigInt(object.tick_spacing), - spreadFactor: object.spread_factor - }; + const message = createBaseMsgCreateConcentratedPool(); + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + if (object.denom0 !== undefined && object.denom0 !== null) { + message.denom0 = object.denom0; + } + if (object.denom1 !== undefined && object.denom1 !== null) { + message.denom1 = object.denom1; + } + if (object.tick_spacing !== undefined && object.tick_spacing !== null) { + message.tickSpacing = BigInt(object.tick_spacing); + } + if (object.spread_factor !== undefined && object.spread_factor !== null) { + message.spreadFactor = object.spread_factor; + } + return message; }, toAmino(message: MsgCreateConcentratedPool): MsgCreateConcentratedPoolAmino { const obj: any = {}; @@ -159,6 +199,8 @@ export const MsgCreateConcentratedPool = { }; } }; +GlobalDecoderRegistry.register(MsgCreateConcentratedPool.typeUrl, MsgCreateConcentratedPool); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgCreateConcentratedPool.aminoType, MsgCreateConcentratedPool.typeUrl); function createBaseMsgCreateConcentratedPoolResponse(): MsgCreateConcentratedPoolResponse { return { poolId: BigInt(0) @@ -166,6 +208,16 @@ function createBaseMsgCreateConcentratedPoolResponse(): MsgCreateConcentratedPoo } export const MsgCreateConcentratedPoolResponse = { typeUrl: "/osmosis.concentratedliquidity.poolmodel.concentrated.v1beta1.MsgCreateConcentratedPoolResponse", + aminoType: "osmosis/concentratedliquidity/poolmodel/concentrated/create-concentrated-pool-response", + is(o: any): o is MsgCreateConcentratedPoolResponse { + return o && (o.$typeUrl === MsgCreateConcentratedPoolResponse.typeUrl || typeof o.poolId === "bigint"); + }, + isSDK(o: any): o is MsgCreateConcentratedPoolResponseSDKType { + return o && (o.$typeUrl === MsgCreateConcentratedPoolResponse.typeUrl || typeof o.pool_id === "bigint"); + }, + isAmino(o: any): o is MsgCreateConcentratedPoolResponseAmino { + return o && (o.$typeUrl === MsgCreateConcentratedPoolResponse.typeUrl || typeof o.pool_id === "bigint"); + }, encode(message: MsgCreateConcentratedPoolResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.poolId !== BigInt(0)) { writer.uint32(8).uint64(message.poolId); @@ -189,15 +241,27 @@ export const MsgCreateConcentratedPoolResponse = { } return message; }, + fromJSON(object: any): MsgCreateConcentratedPoolResponse { + return { + poolId: isSet(object.poolId) ? BigInt(object.poolId.toString()) : BigInt(0) + }; + }, + toJSON(message: MsgCreateConcentratedPoolResponse): unknown { + const obj: any = {}; + message.poolId !== undefined && (obj.poolId = (message.poolId || BigInt(0)).toString()); + return obj; + }, fromPartial(object: Partial): MsgCreateConcentratedPoolResponse { const message = createBaseMsgCreateConcentratedPoolResponse(); message.poolId = object.poolId !== undefined && object.poolId !== null ? BigInt(object.poolId.toString()) : BigInt(0); return message; }, fromAmino(object: MsgCreateConcentratedPoolResponseAmino): MsgCreateConcentratedPoolResponse { - return { - poolId: BigInt(object.pool_id) - }; + const message = createBaseMsgCreateConcentratedPoolResponse(); + if (object.pool_id !== undefined && object.pool_id !== null) { + message.poolId = BigInt(object.pool_id); + } + return message; }, toAmino(message: MsgCreateConcentratedPoolResponse): MsgCreateConcentratedPoolResponseAmino { const obj: any = {}; @@ -225,4 +289,6 @@ export const MsgCreateConcentratedPoolResponse = { value: MsgCreateConcentratedPoolResponse.encode(message).finish() }; } -}; \ No newline at end of file +}; +GlobalDecoderRegistry.register(MsgCreateConcentratedPoolResponse.typeUrl, MsgCreateConcentratedPoolResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgCreateConcentratedPoolResponse.aminoType, MsgCreateConcentratedPoolResponse.typeUrl); \ No newline at end of file diff --git a/packages/osmo-query/src/codegen/osmosis/concentrated-liquidity/genesis.ts b/packages/osmojs/src/codegen/osmosis/concentratedliquidity/v1beta1/genesis.ts similarity index 59% rename from packages/osmo-query/src/codegen/osmosis/concentrated-liquidity/genesis.ts rename to packages/osmojs/src/codegen/osmosis/concentratedliquidity/v1beta1/genesis.ts index 0a7e37037..5c773c404 100644 --- a/packages/osmo-query/src/codegen/osmosis/concentrated-liquidity/genesis.ts +++ b/packages/osmojs/src/codegen/osmosis/concentratedliquidity/v1beta1/genesis.ts @@ -1,20 +1,22 @@ import { TickInfo, TickInfoAmino, TickInfoSDKType } from "./tickInfo"; -import { Any, AnyProtoMsg, AnyAmino, AnySDKType } from "../../google/protobuf/any"; +import { Any, AnyProtoMsg, AnyAmino, AnySDKType } from "../../../google/protobuf/any"; import { IncentiveRecord, IncentiveRecordAmino, IncentiveRecordSDKType } from "./incentive_record"; import { Position, PositionAmino, PositionSDKType } from "./position"; -import { Record, RecordAmino, RecordSDKType, AccumulatorContent, AccumulatorContentAmino, AccumulatorContentSDKType } from "../accum/v1beta1/accum"; -import { Params, ParamsAmino, ParamsSDKType } from "./params"; +import { Record, RecordAmino, RecordSDKType, AccumulatorContent, AccumulatorContentAmino, AccumulatorContentSDKType } from "../../accum/v1beta1/accum"; +import { Params, ParamsAmino, ParamsSDKType } from "../params"; import { Pool as Pool1 } from "./pool"; import { PoolProtoMsg as Pool1ProtoMsg } from "./pool"; import { PoolSDKType as Pool1SDKType } from "./pool"; -import { CosmWasmPool, CosmWasmPoolProtoMsg, CosmWasmPoolSDKType } from "../cosmwasmpool/v1beta1/model/pool"; -import { Pool as Pool2 } from "../gamm/pool-models/balancer/balancerPool"; -import { PoolProtoMsg as Pool2ProtoMsg } from "../gamm/pool-models/balancer/balancerPool"; -import { PoolSDKType as Pool2SDKType } from "../gamm/pool-models/balancer/balancerPool"; -import { Pool as Pool3 } from "../gamm/pool-models/stableswap/stableswap_pool"; -import { PoolProtoMsg as Pool3ProtoMsg } from "../gamm/pool-models/stableswap/stableswap_pool"; -import { PoolSDKType as Pool3SDKType } from "../gamm/pool-models/stableswap/stableswap_pool"; -import { BinaryReader, BinaryWriter } from "../../binary"; +import { CosmWasmPool, CosmWasmPoolProtoMsg, CosmWasmPoolSDKType } from "../../cosmwasmpool/v1beta1/model/pool"; +import { Pool as Pool2 } from "../../gamm/poolmodels/stableswap/v1beta1/stableswap_pool"; +import { PoolProtoMsg as Pool2ProtoMsg } from "../../gamm/poolmodels/stableswap/v1beta1/stableswap_pool"; +import { PoolSDKType as Pool2SDKType } from "../../gamm/poolmodels/stableswap/v1beta1/stableswap_pool"; +import { Pool as Pool3 } from "../../gamm/v1beta1/balancerPool"; +import { PoolProtoMsg as Pool3ProtoMsg } from "../../gamm/v1beta1/balancerPool"; +import { PoolSDKType as Pool3SDKType } from "../../gamm/v1beta1/balancerPool"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { isSet } from "../../../helpers"; +import { GlobalDecoderRegistry } from "../../../registry"; /** * FullTick contains tick index and pool id along with other tick model * information. @@ -37,9 +39,9 @@ export interface FullTickProtoMsg { */ export interface FullTickAmino { /** pool id associated with the tick. */ - pool_id: string; + pool_id?: string; /** tick's index. */ - tick_index: string; + tick_index?: string; /** tick's info. */ info?: TickInfoAmino; } @@ -62,7 +64,7 @@ export interface FullTickSDKType { */ export interface PoolData { /** pool struct */ - pool: (Pool1 & CosmWasmPool & Pool2 & Pool3 & Any) | undefined; + pool?: Pool1 | CosmWasmPool | Pool2 | Pool3 | Any | undefined; /** pool's ticks */ ticks: FullTick[]; spreadRewardAccumulator: AccumObject; @@ -85,11 +87,11 @@ export interface PoolDataAmino { /** pool struct */ pool?: AnyAmino; /** pool's ticks */ - ticks: FullTickAmino[]; + ticks?: FullTickAmino[]; spread_reward_accumulator?: AccumObjectAmino; - incentives_accumulators: AccumObjectAmino[]; + incentives_accumulators?: AccumObjectAmino[]; /** incentive records to be set */ - incentive_records: IncentiveRecordAmino[]; + incentive_records?: IncentiveRecordAmino[]; } export interface PoolDataAminoMsg { type: "osmosis/concentratedliquidity/pool-data"; @@ -100,14 +102,14 @@ export interface PoolDataAminoMsg { * for genesis state. */ export interface PoolDataSDKType { - pool: Pool1SDKType | CosmWasmPoolSDKType | Pool2SDKType | Pool3SDKType | AnySDKType | undefined; + pool?: Pool1SDKType | CosmWasmPoolSDKType | Pool2SDKType | Pool3SDKType | AnySDKType | undefined; ticks: FullTickSDKType[]; spread_reward_accumulator: AccumObjectSDKType; incentives_accumulators: AccumObjectSDKType[]; incentive_records: IncentiveRecordSDKType[]; } export interface PositionData { - position: Position; + position?: Position; lockId: bigint; spreadRewardAccumRecord: Record; uptimeAccumRecords: Record[]; @@ -118,16 +120,16 @@ export interface PositionDataProtoMsg { } export interface PositionDataAmino { position?: PositionAmino; - lock_id: string; + lock_id?: string; spread_reward_accum_record?: RecordAmino; - uptime_accum_records: RecordAmino[]; + uptime_accum_records?: RecordAmino[]; } export interface PositionDataAminoMsg { type: "osmosis/concentratedliquidity/position-data"; value: PositionDataAmino; } export interface PositionDataSDKType { - position: PositionSDKType; + position?: PositionSDKType; lock_id: bigint; spread_reward_accum_record: RecordSDKType; uptime_accum_records: RecordSDKType[]; @@ -136,7 +138,7 @@ export interface PositionDataSDKType { export interface GenesisState { /** params are all the parameters of the module */ params: Params; - /** pool data containining serialized pool struct and ticks. */ + /** pool data containing serialized pool struct and ticks. */ poolData: PoolData[]; positionData: PositionData[]; nextPositionId: bigint; @@ -150,11 +152,11 @@ export interface GenesisStateProtoMsg { export interface GenesisStateAmino { /** params are all the parameters of the module */ params?: ParamsAmino; - /** pool data containining serialized pool struct and ticks. */ - pool_data: PoolDataAmino[]; - position_data: PositionDataAmino[]; - next_position_id: string; - next_incentive_record_id: string; + /** pool data containing serialized pool struct and ticks. */ + pool_data?: PoolDataAmino[]; + position_data?: PositionDataAmino[]; + next_position_id?: string; + next_incentive_record_id?: string; } export interface GenesisStateAminoMsg { type: "osmosis/concentratedliquidity/genesis-state"; @@ -171,7 +173,7 @@ export interface GenesisStateSDKType { export interface AccumObject { /** Accumulator's name (pulled from AccumulatorContent) */ name: string; - accumContent: AccumulatorContent; + accumContent?: AccumulatorContent; } export interface AccumObjectProtoMsg { typeUrl: "/osmosis.concentratedliquidity.v1beta1.AccumObject"; @@ -179,7 +181,7 @@ export interface AccumObjectProtoMsg { } export interface AccumObjectAmino { /** Accumulator's name (pulled from AccumulatorContent) */ - name: string; + name?: string; accum_content?: AccumulatorContentAmino; } export interface AccumObjectAminoMsg { @@ -188,7 +190,7 @@ export interface AccumObjectAminoMsg { } export interface AccumObjectSDKType { name: string; - accum_content: AccumulatorContentSDKType; + accum_content?: AccumulatorContentSDKType; } function createBaseFullTick(): FullTick { return { @@ -199,6 +201,16 @@ function createBaseFullTick(): FullTick { } export const FullTick = { typeUrl: "/osmosis.concentratedliquidity.v1beta1.FullTick", + aminoType: "osmosis/concentratedliquidity/full-tick", + is(o: any): o is FullTick { + return o && (o.$typeUrl === FullTick.typeUrl || typeof o.poolId === "bigint" && typeof o.tickIndex === "bigint" && TickInfo.is(o.info)); + }, + isSDK(o: any): o is FullTickSDKType { + return o && (o.$typeUrl === FullTick.typeUrl || typeof o.pool_id === "bigint" && typeof o.tick_index === "bigint" && TickInfo.isSDK(o.info)); + }, + isAmino(o: any): o is FullTickAmino { + return o && (o.$typeUrl === FullTick.typeUrl || typeof o.pool_id === "bigint" && typeof o.tick_index === "bigint" && TickInfo.isAmino(o.info)); + }, encode(message: FullTick, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.poolId !== BigInt(0)) { writer.uint32(8).uint64(message.poolId); @@ -234,6 +246,20 @@ export const FullTick = { } return message; }, + fromJSON(object: any): FullTick { + return { + poolId: isSet(object.poolId) ? BigInt(object.poolId.toString()) : BigInt(0), + tickIndex: isSet(object.tickIndex) ? BigInt(object.tickIndex.toString()) : BigInt(0), + info: isSet(object.info) ? TickInfo.fromJSON(object.info) : undefined + }; + }, + toJSON(message: FullTick): unknown { + const obj: any = {}; + message.poolId !== undefined && (obj.poolId = (message.poolId || BigInt(0)).toString()); + message.tickIndex !== undefined && (obj.tickIndex = (message.tickIndex || BigInt(0)).toString()); + message.info !== undefined && (obj.info = message.info ? TickInfo.toJSON(message.info) : undefined); + return obj; + }, fromPartial(object: Partial): FullTick { const message = createBaseFullTick(); message.poolId = object.poolId !== undefined && object.poolId !== null ? BigInt(object.poolId.toString()) : BigInt(0); @@ -242,11 +268,17 @@ export const FullTick = { return message; }, fromAmino(object: FullTickAmino): FullTick { - return { - poolId: BigInt(object.pool_id), - tickIndex: BigInt(object.tick_index), - info: object?.info ? TickInfo.fromAmino(object.info) : undefined - }; + const message = createBaseFullTick(); + if (object.pool_id !== undefined && object.pool_id !== null) { + message.poolId = BigInt(object.pool_id); + } + if (object.tick_index !== undefined && object.tick_index !== null) { + message.tickIndex = BigInt(object.tick_index); + } + if (object.info !== undefined && object.info !== null) { + message.info = TickInfo.fromAmino(object.info); + } + return message; }, toAmino(message: FullTick): FullTickAmino { const obj: any = {}; @@ -277,9 +309,11 @@ export const FullTick = { }; } }; +GlobalDecoderRegistry.register(FullTick.typeUrl, FullTick); +GlobalDecoderRegistry.registerAminoProtoMapping(FullTick.aminoType, FullTick.typeUrl); function createBasePoolData(): PoolData { return { - pool: Any.fromPartial({}), + pool: undefined, ticks: [], spreadRewardAccumulator: AccumObject.fromPartial({}), incentivesAccumulators: [], @@ -288,9 +322,19 @@ function createBasePoolData(): PoolData { } export const PoolData = { typeUrl: "/osmosis.concentratedliquidity.v1beta1.PoolData", + aminoType: "osmosis/concentratedliquidity/pool-data", + is(o: any): o is PoolData { + return o && (o.$typeUrl === PoolData.typeUrl || Array.isArray(o.ticks) && (!o.ticks.length || FullTick.is(o.ticks[0])) && AccumObject.is(o.spreadRewardAccumulator) && Array.isArray(o.incentivesAccumulators) && (!o.incentivesAccumulators.length || AccumObject.is(o.incentivesAccumulators[0])) && Array.isArray(o.incentiveRecords) && (!o.incentiveRecords.length || IncentiveRecord.is(o.incentiveRecords[0]))); + }, + isSDK(o: any): o is PoolDataSDKType { + return o && (o.$typeUrl === PoolData.typeUrl || Array.isArray(o.ticks) && (!o.ticks.length || FullTick.isSDK(o.ticks[0])) && AccumObject.isSDK(o.spread_reward_accumulator) && Array.isArray(o.incentives_accumulators) && (!o.incentives_accumulators.length || AccumObject.isSDK(o.incentives_accumulators[0])) && Array.isArray(o.incentive_records) && (!o.incentive_records.length || IncentiveRecord.isSDK(o.incentive_records[0]))); + }, + isAmino(o: any): o is PoolDataAmino { + return o && (o.$typeUrl === PoolData.typeUrl || Array.isArray(o.ticks) && (!o.ticks.length || FullTick.isAmino(o.ticks[0])) && AccumObject.isAmino(o.spread_reward_accumulator) && Array.isArray(o.incentives_accumulators) && (!o.incentives_accumulators.length || AccumObject.isAmino(o.incentives_accumulators[0])) && Array.isArray(o.incentive_records) && (!o.incentive_records.length || IncentiveRecord.isAmino(o.incentive_records[0]))); + }, encode(message: PoolData, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.pool !== undefined) { - Any.encode((message.pool as Any), writer.uint32(10).fork()).ldelim(); + Any.encode(GlobalDecoderRegistry.wrapAny(message.pool), writer.uint32(10).fork()).ldelim(); } for (const v of message.ticks) { FullTick.encode(v!, writer.uint32(18).fork()).ldelim(); @@ -314,7 +358,7 @@ export const PoolData = { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.pool = (PoolI_InterfaceDecoder(reader) as Any); + message.pool = GlobalDecoderRegistry.unwrapAny(reader); break; case 2: message.ticks.push(FullTick.decode(reader, reader.uint32())); @@ -335,9 +379,39 @@ export const PoolData = { } return message; }, + fromJSON(object: any): PoolData { + return { + pool: isSet(object.pool) ? GlobalDecoderRegistry.fromJSON(object.pool) : undefined, + ticks: Array.isArray(object?.ticks) ? object.ticks.map((e: any) => FullTick.fromJSON(e)) : [], + spreadRewardAccumulator: isSet(object.spreadRewardAccumulator) ? AccumObject.fromJSON(object.spreadRewardAccumulator) : undefined, + incentivesAccumulators: Array.isArray(object?.incentivesAccumulators) ? object.incentivesAccumulators.map((e: any) => AccumObject.fromJSON(e)) : [], + incentiveRecords: Array.isArray(object?.incentiveRecords) ? object.incentiveRecords.map((e: any) => IncentiveRecord.fromJSON(e)) : [] + }; + }, + toJSON(message: PoolData): unknown { + const obj: any = {}; + message.pool !== undefined && (obj.pool = message.pool ? GlobalDecoderRegistry.toJSON(message.pool) : undefined); + if (message.ticks) { + obj.ticks = message.ticks.map(e => e ? FullTick.toJSON(e) : undefined); + } else { + obj.ticks = []; + } + message.spreadRewardAccumulator !== undefined && (obj.spreadRewardAccumulator = message.spreadRewardAccumulator ? AccumObject.toJSON(message.spreadRewardAccumulator) : undefined); + if (message.incentivesAccumulators) { + obj.incentivesAccumulators = message.incentivesAccumulators.map(e => e ? AccumObject.toJSON(e) : undefined); + } else { + obj.incentivesAccumulators = []; + } + if (message.incentiveRecords) { + obj.incentiveRecords = message.incentiveRecords.map(e => e ? IncentiveRecord.toJSON(e) : undefined); + } else { + obj.incentiveRecords = []; + } + return obj; + }, fromPartial(object: Partial): PoolData { const message = createBasePoolData(); - message.pool = object.pool !== undefined && object.pool !== null ? Any.fromPartial(object.pool) : undefined; + message.pool = object.pool !== undefined && object.pool !== null ? GlobalDecoderRegistry.fromPartial(object.pool) : undefined; message.ticks = object.ticks?.map(e => FullTick.fromPartial(e)) || []; message.spreadRewardAccumulator = object.spreadRewardAccumulator !== undefined && object.spreadRewardAccumulator !== null ? AccumObject.fromPartial(object.spreadRewardAccumulator) : undefined; message.incentivesAccumulators = object.incentivesAccumulators?.map(e => AccumObject.fromPartial(e)) || []; @@ -345,17 +419,21 @@ export const PoolData = { return message; }, fromAmino(object: PoolDataAmino): PoolData { - return { - pool: object?.pool ? PoolI_FromAmino(object.pool) : undefined, - ticks: Array.isArray(object?.ticks) ? object.ticks.map((e: any) => FullTick.fromAmino(e)) : [], - spreadRewardAccumulator: object?.spread_reward_accumulator ? AccumObject.fromAmino(object.spread_reward_accumulator) : undefined, - incentivesAccumulators: Array.isArray(object?.incentives_accumulators) ? object.incentives_accumulators.map((e: any) => AccumObject.fromAmino(e)) : [], - incentiveRecords: Array.isArray(object?.incentive_records) ? object.incentive_records.map((e: any) => IncentiveRecord.fromAmino(e)) : [] - }; + const message = createBasePoolData(); + if (object.pool !== undefined && object.pool !== null) { + message.pool = GlobalDecoderRegistry.fromAminoMsg(object.pool); + } + message.ticks = object.ticks?.map(e => FullTick.fromAmino(e)) || []; + if (object.spread_reward_accumulator !== undefined && object.spread_reward_accumulator !== null) { + message.spreadRewardAccumulator = AccumObject.fromAmino(object.spread_reward_accumulator); + } + message.incentivesAccumulators = object.incentives_accumulators?.map(e => AccumObject.fromAmino(e)) || []; + message.incentiveRecords = object.incentive_records?.map(e => IncentiveRecord.fromAmino(e)) || []; + return message; }, toAmino(message: PoolData): PoolDataAmino { const obj: any = {}; - obj.pool = message.pool ? PoolI_ToAmino((message.pool as Any)) : undefined; + obj.pool = message.pool ? GlobalDecoderRegistry.toAminoMsg(message.pool) : undefined; if (message.ticks) { obj.ticks = message.ticks.map(e => e ? FullTick.toAmino(e) : undefined); } else { @@ -396,9 +474,11 @@ export const PoolData = { }; } }; +GlobalDecoderRegistry.register(PoolData.typeUrl, PoolData); +GlobalDecoderRegistry.registerAminoProtoMapping(PoolData.aminoType, PoolData.typeUrl); function createBasePositionData(): PositionData { return { - position: Position.fromPartial({}), + position: undefined, lockId: BigInt(0), spreadRewardAccumRecord: Record.fromPartial({}), uptimeAccumRecords: [] @@ -406,6 +486,16 @@ function createBasePositionData(): PositionData { } export const PositionData = { typeUrl: "/osmosis.concentratedliquidity.v1beta1.PositionData", + aminoType: "osmosis/concentratedliquidity/position-data", + is(o: any): o is PositionData { + return o && (o.$typeUrl === PositionData.typeUrl || typeof o.lockId === "bigint" && Record.is(o.spreadRewardAccumRecord) && Array.isArray(o.uptimeAccumRecords) && (!o.uptimeAccumRecords.length || Record.is(o.uptimeAccumRecords[0]))); + }, + isSDK(o: any): o is PositionDataSDKType { + return o && (o.$typeUrl === PositionData.typeUrl || typeof o.lock_id === "bigint" && Record.isSDK(o.spread_reward_accum_record) && Array.isArray(o.uptime_accum_records) && (!o.uptime_accum_records.length || Record.isSDK(o.uptime_accum_records[0]))); + }, + isAmino(o: any): o is PositionDataAmino { + return o && (o.$typeUrl === PositionData.typeUrl || typeof o.lock_id === "bigint" && Record.isAmino(o.spread_reward_accum_record) && Array.isArray(o.uptime_accum_records) && (!o.uptime_accum_records.length || Record.isAmino(o.uptime_accum_records[0]))); + }, encode(message: PositionData, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.position !== undefined) { Position.encode(message.position, writer.uint32(10).fork()).ldelim(); @@ -447,6 +537,26 @@ export const PositionData = { } return message; }, + fromJSON(object: any): PositionData { + return { + position: isSet(object.position) ? Position.fromJSON(object.position) : undefined, + lockId: isSet(object.lockId) ? BigInt(object.lockId.toString()) : BigInt(0), + spreadRewardAccumRecord: isSet(object.spreadRewardAccumRecord) ? Record.fromJSON(object.spreadRewardAccumRecord) : undefined, + uptimeAccumRecords: Array.isArray(object?.uptimeAccumRecords) ? object.uptimeAccumRecords.map((e: any) => Record.fromJSON(e)) : [] + }; + }, + toJSON(message: PositionData): unknown { + const obj: any = {}; + message.position !== undefined && (obj.position = message.position ? Position.toJSON(message.position) : undefined); + message.lockId !== undefined && (obj.lockId = (message.lockId || BigInt(0)).toString()); + message.spreadRewardAccumRecord !== undefined && (obj.spreadRewardAccumRecord = message.spreadRewardAccumRecord ? Record.toJSON(message.spreadRewardAccumRecord) : undefined); + if (message.uptimeAccumRecords) { + obj.uptimeAccumRecords = message.uptimeAccumRecords.map(e => e ? Record.toJSON(e) : undefined); + } else { + obj.uptimeAccumRecords = []; + } + return obj; + }, fromPartial(object: Partial): PositionData { const message = createBasePositionData(); message.position = object.position !== undefined && object.position !== null ? Position.fromPartial(object.position) : undefined; @@ -456,12 +566,18 @@ export const PositionData = { return message; }, fromAmino(object: PositionDataAmino): PositionData { - return { - position: object?.position ? Position.fromAmino(object.position) : undefined, - lockId: BigInt(object.lock_id), - spreadRewardAccumRecord: object?.spread_reward_accum_record ? Record.fromAmino(object.spread_reward_accum_record) : undefined, - uptimeAccumRecords: Array.isArray(object?.uptime_accum_records) ? object.uptime_accum_records.map((e: any) => Record.fromAmino(e)) : [] - }; + const message = createBasePositionData(); + if (object.position !== undefined && object.position !== null) { + message.position = Position.fromAmino(object.position); + } + if (object.lock_id !== undefined && object.lock_id !== null) { + message.lockId = BigInt(object.lock_id); + } + if (object.spread_reward_accum_record !== undefined && object.spread_reward_accum_record !== null) { + message.spreadRewardAccumRecord = Record.fromAmino(object.spread_reward_accum_record); + } + message.uptimeAccumRecords = object.uptime_accum_records?.map(e => Record.fromAmino(e)) || []; + return message; }, toAmino(message: PositionData): PositionDataAmino { const obj: any = {}; @@ -497,6 +613,8 @@ export const PositionData = { }; } }; +GlobalDecoderRegistry.register(PositionData.typeUrl, PositionData); +GlobalDecoderRegistry.registerAminoProtoMapping(PositionData.aminoType, PositionData.typeUrl); function createBaseGenesisState(): GenesisState { return { params: Params.fromPartial({}), @@ -508,6 +626,16 @@ function createBaseGenesisState(): GenesisState { } export const GenesisState = { typeUrl: "/osmosis.concentratedliquidity.v1beta1.GenesisState", + aminoType: "osmosis/concentratedliquidity/genesis-state", + is(o: any): o is GenesisState { + return o && (o.$typeUrl === GenesisState.typeUrl || Params.is(o.params) && Array.isArray(o.poolData) && (!o.poolData.length || PoolData.is(o.poolData[0])) && Array.isArray(o.positionData) && (!o.positionData.length || PositionData.is(o.positionData[0])) && typeof o.nextPositionId === "bigint" && typeof o.nextIncentiveRecordId === "bigint"); + }, + isSDK(o: any): o is GenesisStateSDKType { + return o && (o.$typeUrl === GenesisState.typeUrl || Params.isSDK(o.params) && Array.isArray(o.pool_data) && (!o.pool_data.length || PoolData.isSDK(o.pool_data[0])) && Array.isArray(o.position_data) && (!o.position_data.length || PositionData.isSDK(o.position_data[0])) && typeof o.next_position_id === "bigint" && typeof o.next_incentive_record_id === "bigint"); + }, + isAmino(o: any): o is GenesisStateAmino { + return o && (o.$typeUrl === GenesisState.typeUrl || Params.isAmino(o.params) && Array.isArray(o.pool_data) && (!o.pool_data.length || PoolData.isAmino(o.pool_data[0])) && Array.isArray(o.position_data) && (!o.position_data.length || PositionData.isAmino(o.position_data[0])) && typeof o.next_position_id === "bigint" && typeof o.next_incentive_record_id === "bigint"); + }, encode(message: GenesisState, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.params !== undefined) { Params.encode(message.params, writer.uint32(10).fork()).ldelim(); @@ -555,6 +683,32 @@ export const GenesisState = { } return message; }, + fromJSON(object: any): GenesisState { + return { + params: isSet(object.params) ? Params.fromJSON(object.params) : undefined, + poolData: Array.isArray(object?.poolData) ? object.poolData.map((e: any) => PoolData.fromJSON(e)) : [], + positionData: Array.isArray(object?.positionData) ? object.positionData.map((e: any) => PositionData.fromJSON(e)) : [], + nextPositionId: isSet(object.nextPositionId) ? BigInt(object.nextPositionId.toString()) : BigInt(0), + nextIncentiveRecordId: isSet(object.nextIncentiveRecordId) ? BigInt(object.nextIncentiveRecordId.toString()) : BigInt(0) + }; + }, + toJSON(message: GenesisState): unknown { + const obj: any = {}; + message.params !== undefined && (obj.params = message.params ? Params.toJSON(message.params) : undefined); + if (message.poolData) { + obj.poolData = message.poolData.map(e => e ? PoolData.toJSON(e) : undefined); + } else { + obj.poolData = []; + } + if (message.positionData) { + obj.positionData = message.positionData.map(e => e ? PositionData.toJSON(e) : undefined); + } else { + obj.positionData = []; + } + message.nextPositionId !== undefined && (obj.nextPositionId = (message.nextPositionId || BigInt(0)).toString()); + message.nextIncentiveRecordId !== undefined && (obj.nextIncentiveRecordId = (message.nextIncentiveRecordId || BigInt(0)).toString()); + return obj; + }, fromPartial(object: Partial): GenesisState { const message = createBaseGenesisState(); message.params = object.params !== undefined && object.params !== null ? Params.fromPartial(object.params) : undefined; @@ -565,13 +719,19 @@ export const GenesisState = { return message; }, fromAmino(object: GenesisStateAmino): GenesisState { - return { - params: object?.params ? Params.fromAmino(object.params) : undefined, - poolData: Array.isArray(object?.pool_data) ? object.pool_data.map((e: any) => PoolData.fromAmino(e)) : [], - positionData: Array.isArray(object?.position_data) ? object.position_data.map((e: any) => PositionData.fromAmino(e)) : [], - nextPositionId: BigInt(object.next_position_id), - nextIncentiveRecordId: BigInt(object.next_incentive_record_id) - }; + const message = createBaseGenesisState(); + if (object.params !== undefined && object.params !== null) { + message.params = Params.fromAmino(object.params); + } + message.poolData = object.pool_data?.map(e => PoolData.fromAmino(e)) || []; + message.positionData = object.position_data?.map(e => PositionData.fromAmino(e)) || []; + if (object.next_position_id !== undefined && object.next_position_id !== null) { + message.nextPositionId = BigInt(object.next_position_id); + } + if (object.next_incentive_record_id !== undefined && object.next_incentive_record_id !== null) { + message.nextIncentiveRecordId = BigInt(object.next_incentive_record_id); + } + return message; }, toAmino(message: GenesisState): GenesisStateAmino { const obj: any = {}; @@ -612,14 +772,26 @@ export const GenesisState = { }; } }; +GlobalDecoderRegistry.register(GenesisState.typeUrl, GenesisState); +GlobalDecoderRegistry.registerAminoProtoMapping(GenesisState.aminoType, GenesisState.typeUrl); function createBaseAccumObject(): AccumObject { return { name: "", - accumContent: AccumulatorContent.fromPartial({}) + accumContent: undefined }; } export const AccumObject = { typeUrl: "/osmosis.concentratedliquidity.v1beta1.AccumObject", + aminoType: "osmosis/concentratedliquidity/accum-object", + is(o: any): o is AccumObject { + return o && (o.$typeUrl === AccumObject.typeUrl || typeof o.name === "string"); + }, + isSDK(o: any): o is AccumObjectSDKType { + return o && (o.$typeUrl === AccumObject.typeUrl || typeof o.name === "string"); + }, + isAmino(o: any): o is AccumObjectAmino { + return o && (o.$typeUrl === AccumObject.typeUrl || typeof o.name === "string"); + }, encode(message: AccumObject, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.name !== "") { writer.uint32(10).string(message.name); @@ -649,6 +821,18 @@ export const AccumObject = { } return message; }, + fromJSON(object: any): AccumObject { + return { + name: isSet(object.name) ? String(object.name) : "", + accumContent: isSet(object.accumContent) ? AccumulatorContent.fromJSON(object.accumContent) : undefined + }; + }, + toJSON(message: AccumObject): unknown { + const obj: any = {}; + message.name !== undefined && (obj.name = message.name); + message.accumContent !== undefined && (obj.accumContent = message.accumContent ? AccumulatorContent.toJSON(message.accumContent) : undefined); + return obj; + }, fromPartial(object: Partial): AccumObject { const message = createBaseAccumObject(); message.name = object.name ?? ""; @@ -656,10 +840,14 @@ export const AccumObject = { return message; }, fromAmino(object: AccumObjectAmino): AccumObject { - return { - name: object.name, - accumContent: object?.accum_content ? AccumulatorContent.fromAmino(object.accum_content) : undefined - }; + const message = createBaseAccumObject(); + if (object.name !== undefined && object.name !== null) { + message.name = object.name; + } + if (object.accum_content !== undefined && object.accum_content !== null) { + message.accumContent = AccumulatorContent.fromAmino(object.accum_content); + } + return message; }, toAmino(message: AccumObject): AccumObjectAmino { const obj: any = {}; @@ -689,71 +877,5 @@ export const AccumObject = { }; } }; -export const PoolI_InterfaceDecoder = (input: BinaryReader | Uint8Array): Pool1 | CosmWasmPool | Pool2 | Pool3 | Any => { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - const data = Any.decode(reader, reader.uint32()); - switch (data.typeUrl) { - case "/osmosis.concentratedliquidity.v1beta1.Pool": - return Pool1.decode(data.value); - case "/osmosis.cosmwasmpool.v1beta1.CosmWasmPool": - return CosmWasmPool.decode(data.value); - case "/osmosis.gamm.v1beta1.Pool": - return Pool2.decode(data.value); - case "/osmosis.gamm.poolmodels.stableswap.v1beta1.Pool": - return Pool3.decode(data.value); - default: - return data; - } -}; -export const PoolI_FromAmino = (content: AnyAmino) => { - switch (content.type) { - case "osmosis/concentratedliquidity/pool": - return Any.fromPartial({ - typeUrl: "/osmosis.concentratedliquidity.v1beta1.Pool", - value: Pool1.encode(Pool1.fromPartial(Pool1.fromAmino(content.value))).finish() - }); - case "osmosis/cosmwasmpool/cosm-wasm-pool": - return Any.fromPartial({ - typeUrl: "/osmosis.cosmwasmpool.v1beta1.CosmWasmPool", - value: CosmWasmPool.encode(CosmWasmPool.fromPartial(CosmWasmPool.fromAmino(content.value))).finish() - }); - case "osmosis/gamm/BalancerPool": - return Any.fromPartial({ - typeUrl: "/osmosis.gamm.v1beta1.Pool", - value: Pool2.encode(Pool2.fromPartial(Pool2.fromAmino(content.value))).finish() - }); - case "osmosis/gamm/StableswapPool": - return Any.fromPartial({ - typeUrl: "/osmosis.gamm.poolmodels.stableswap.v1beta1.Pool", - value: Pool3.encode(Pool3.fromPartial(Pool3.fromAmino(content.value))).finish() - }); - default: - return Any.fromAmino(content); - } -}; -export const PoolI_ToAmino = (content: Any) => { - switch (content.typeUrl) { - case "/osmosis.concentratedliquidity.v1beta1.Pool": - return { - type: "osmosis/concentratedliquidity/pool", - value: Pool1.toAmino(Pool1.decode(content.value)) - }; - case "/osmosis.cosmwasmpool.v1beta1.CosmWasmPool": - return { - type: "osmosis/cosmwasmpool/cosm-wasm-pool", - value: CosmWasmPool.toAmino(CosmWasmPool.decode(content.value)) - }; - case "/osmosis.gamm.v1beta1.Pool": - return { - type: "osmosis/gamm/BalancerPool", - value: Pool2.toAmino(Pool2.decode(content.value)) - }; - case "/osmosis.gamm.poolmodels.stableswap.v1beta1.Pool": - return { - type: "osmosis/gamm/StableswapPool", - value: Pool3.toAmino(Pool3.decode(content.value)) - }; - default: - return Any.toAmino(content); - } -}; \ No newline at end of file +GlobalDecoderRegistry.register(AccumObject.typeUrl, AccumObject); +GlobalDecoderRegistry.registerAminoProtoMapping(AccumObject.aminoType, AccumObject.typeUrl); \ No newline at end of file diff --git a/packages/osmo-query/src/codegen/osmosis/concentrated-liquidity/gov.ts b/packages/osmojs/src/codegen/osmosis/concentratedliquidity/v1beta1/gov.ts similarity index 64% rename from packages/osmo-query/src/codegen/osmosis/concentrated-liquidity/gov.ts rename to packages/osmojs/src/codegen/osmosis/concentratedliquidity/v1beta1/gov.ts index 9c7f2cf7b..8def385fa 100644 --- a/packages/osmo-query/src/codegen/osmosis/concentrated-liquidity/gov.ts +++ b/packages/osmojs/src/codegen/osmosis/concentratedliquidity/v1beta1/gov.ts @@ -1,4 +1,6 @@ -import { BinaryReader, BinaryWriter } from "../../binary"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { isSet } from "../../../helpers"; +import { GlobalDecoderRegistry } from "../../../registry"; import { Decimal } from "@cosmjs/math"; /** * CreateConcentratedLiquidityPoolsProposal is a gov Content type for creating @@ -20,9 +22,9 @@ export interface CreateConcentratedLiquidityPoolsProposalProtoMsg { * passes, the pools are created via pool manager module account. */ export interface CreateConcentratedLiquidityPoolsProposalAmino { - title: string; - description: string; - pool_records: PoolRecordAmino[]; + title?: string; + description?: string; + pool_records?: PoolRecordAmino[]; } export interface CreateConcentratedLiquidityPoolsProposalAminoMsg { type: "osmosis/concentratedliquidity/create-concentrated-liquidity-pools-proposal"; @@ -60,9 +62,9 @@ export interface TickSpacingDecreaseProposalProtoMsg { * spacing. */ export interface TickSpacingDecreaseProposalAmino { - title: string; - description: string; - pool_id_to_tick_spacing_records: PoolIdToTickSpacingRecordAmino[]; + title?: string; + description?: string; + pool_id_to_tick_spacing_records?: PoolIdToTickSpacingRecordAmino[]; } export interface TickSpacingDecreaseProposalAminoMsg { type: "osmosis/concentratedliquidity/tick-spacing-decrease-proposal"; @@ -96,8 +98,8 @@ export interface PoolIdToTickSpacingRecordProtoMsg { * spacing pair. */ export interface PoolIdToTickSpacingRecordAmino { - pool_id: string; - new_tick_spacing: string; + pool_id?: string; + new_tick_spacing?: string; } export interface PoolIdToTickSpacingRecordAminoMsg { type: "osmosis/concentratedliquidity/pool-id-to-tick-spacing-record"; @@ -115,7 +117,6 @@ export interface PoolRecord { denom0: string; denom1: string; tickSpacing: bigint; - exponentAtPriceOne: string; spreadFactor: string; } export interface PoolRecordProtoMsg { @@ -123,11 +124,10 @@ export interface PoolRecordProtoMsg { value: Uint8Array; } export interface PoolRecordAmino { - denom0: string; - denom1: string; - tick_spacing: string; - exponent_at_price_one: string; - spread_factor: string; + denom0?: string; + denom1?: string; + tick_spacing?: string; + spread_factor?: string; } export interface PoolRecordAminoMsg { type: "osmosis/concentratedliquidity/pool-record"; @@ -137,7 +137,6 @@ export interface PoolRecordSDKType { denom0: string; denom1: string; tick_spacing: bigint; - exponent_at_price_one: string; spread_factor: string; } function createBaseCreateConcentratedLiquidityPoolsProposal(): CreateConcentratedLiquidityPoolsProposal { @@ -149,6 +148,16 @@ function createBaseCreateConcentratedLiquidityPoolsProposal(): CreateConcentrate } export const CreateConcentratedLiquidityPoolsProposal = { typeUrl: "/osmosis.concentratedliquidity.v1beta1.CreateConcentratedLiquidityPoolsProposal", + aminoType: "osmosis/concentratedliquidity/create-concentrated-liquidity-pools-proposal", + is(o: any): o is CreateConcentratedLiquidityPoolsProposal { + return o && (o.$typeUrl === CreateConcentratedLiquidityPoolsProposal.typeUrl || typeof o.title === "string" && typeof o.description === "string" && Array.isArray(o.poolRecords) && (!o.poolRecords.length || PoolRecord.is(o.poolRecords[0]))); + }, + isSDK(o: any): o is CreateConcentratedLiquidityPoolsProposalSDKType { + return o && (o.$typeUrl === CreateConcentratedLiquidityPoolsProposal.typeUrl || typeof o.title === "string" && typeof o.description === "string" && Array.isArray(o.pool_records) && (!o.pool_records.length || PoolRecord.isSDK(o.pool_records[0]))); + }, + isAmino(o: any): o is CreateConcentratedLiquidityPoolsProposalAmino { + return o && (o.$typeUrl === CreateConcentratedLiquidityPoolsProposal.typeUrl || typeof o.title === "string" && typeof o.description === "string" && Array.isArray(o.pool_records) && (!o.pool_records.length || PoolRecord.isAmino(o.pool_records[0]))); + }, encode(message: CreateConcentratedLiquidityPoolsProposal, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.title !== "") { writer.uint32(10).string(message.title); @@ -184,6 +193,24 @@ export const CreateConcentratedLiquidityPoolsProposal = { } return message; }, + fromJSON(object: any): CreateConcentratedLiquidityPoolsProposal { + return { + title: isSet(object.title) ? String(object.title) : "", + description: isSet(object.description) ? String(object.description) : "", + poolRecords: Array.isArray(object?.poolRecords) ? object.poolRecords.map((e: any) => PoolRecord.fromJSON(e)) : [] + }; + }, + toJSON(message: CreateConcentratedLiquidityPoolsProposal): unknown { + const obj: any = {}; + message.title !== undefined && (obj.title = message.title); + message.description !== undefined && (obj.description = message.description); + if (message.poolRecords) { + obj.poolRecords = message.poolRecords.map(e => e ? PoolRecord.toJSON(e) : undefined); + } else { + obj.poolRecords = []; + } + return obj; + }, fromPartial(object: Partial): CreateConcentratedLiquidityPoolsProposal { const message = createBaseCreateConcentratedLiquidityPoolsProposal(); message.title = object.title ?? ""; @@ -192,11 +219,15 @@ export const CreateConcentratedLiquidityPoolsProposal = { return message; }, fromAmino(object: CreateConcentratedLiquidityPoolsProposalAmino): CreateConcentratedLiquidityPoolsProposal { - return { - title: object.title, - description: object.description, - poolRecords: Array.isArray(object?.pool_records) ? object.pool_records.map((e: any) => PoolRecord.fromAmino(e)) : [] - }; + const message = createBaseCreateConcentratedLiquidityPoolsProposal(); + if (object.title !== undefined && object.title !== null) { + message.title = object.title; + } + if (object.description !== undefined && object.description !== null) { + message.description = object.description; + } + message.poolRecords = object.pool_records?.map(e => PoolRecord.fromAmino(e)) || []; + return message; }, toAmino(message: CreateConcentratedLiquidityPoolsProposal): CreateConcentratedLiquidityPoolsProposalAmino { const obj: any = {}; @@ -231,6 +262,8 @@ export const CreateConcentratedLiquidityPoolsProposal = { }; } }; +GlobalDecoderRegistry.register(CreateConcentratedLiquidityPoolsProposal.typeUrl, CreateConcentratedLiquidityPoolsProposal); +GlobalDecoderRegistry.registerAminoProtoMapping(CreateConcentratedLiquidityPoolsProposal.aminoType, CreateConcentratedLiquidityPoolsProposal.typeUrl); function createBaseTickSpacingDecreaseProposal(): TickSpacingDecreaseProposal { return { title: "", @@ -240,6 +273,16 @@ function createBaseTickSpacingDecreaseProposal(): TickSpacingDecreaseProposal { } export const TickSpacingDecreaseProposal = { typeUrl: "/osmosis.concentratedliquidity.v1beta1.TickSpacingDecreaseProposal", + aminoType: "osmosis/concentratedliquidity/tick-spacing-decrease-proposal", + is(o: any): o is TickSpacingDecreaseProposal { + return o && (o.$typeUrl === TickSpacingDecreaseProposal.typeUrl || typeof o.title === "string" && typeof o.description === "string" && Array.isArray(o.poolIdToTickSpacingRecords) && (!o.poolIdToTickSpacingRecords.length || PoolIdToTickSpacingRecord.is(o.poolIdToTickSpacingRecords[0]))); + }, + isSDK(o: any): o is TickSpacingDecreaseProposalSDKType { + return o && (o.$typeUrl === TickSpacingDecreaseProposal.typeUrl || typeof o.title === "string" && typeof o.description === "string" && Array.isArray(o.pool_id_to_tick_spacing_records) && (!o.pool_id_to_tick_spacing_records.length || PoolIdToTickSpacingRecord.isSDK(o.pool_id_to_tick_spacing_records[0]))); + }, + isAmino(o: any): o is TickSpacingDecreaseProposalAmino { + return o && (o.$typeUrl === TickSpacingDecreaseProposal.typeUrl || typeof o.title === "string" && typeof o.description === "string" && Array.isArray(o.pool_id_to_tick_spacing_records) && (!o.pool_id_to_tick_spacing_records.length || PoolIdToTickSpacingRecord.isAmino(o.pool_id_to_tick_spacing_records[0]))); + }, encode(message: TickSpacingDecreaseProposal, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.title !== "") { writer.uint32(10).string(message.title); @@ -275,6 +318,24 @@ export const TickSpacingDecreaseProposal = { } return message; }, + fromJSON(object: any): TickSpacingDecreaseProposal { + return { + title: isSet(object.title) ? String(object.title) : "", + description: isSet(object.description) ? String(object.description) : "", + poolIdToTickSpacingRecords: Array.isArray(object?.poolIdToTickSpacingRecords) ? object.poolIdToTickSpacingRecords.map((e: any) => PoolIdToTickSpacingRecord.fromJSON(e)) : [] + }; + }, + toJSON(message: TickSpacingDecreaseProposal): unknown { + const obj: any = {}; + message.title !== undefined && (obj.title = message.title); + message.description !== undefined && (obj.description = message.description); + if (message.poolIdToTickSpacingRecords) { + obj.poolIdToTickSpacingRecords = message.poolIdToTickSpacingRecords.map(e => e ? PoolIdToTickSpacingRecord.toJSON(e) : undefined); + } else { + obj.poolIdToTickSpacingRecords = []; + } + return obj; + }, fromPartial(object: Partial): TickSpacingDecreaseProposal { const message = createBaseTickSpacingDecreaseProposal(); message.title = object.title ?? ""; @@ -283,11 +344,15 @@ export const TickSpacingDecreaseProposal = { return message; }, fromAmino(object: TickSpacingDecreaseProposalAmino): TickSpacingDecreaseProposal { - return { - title: object.title, - description: object.description, - poolIdToTickSpacingRecords: Array.isArray(object?.pool_id_to_tick_spacing_records) ? object.pool_id_to_tick_spacing_records.map((e: any) => PoolIdToTickSpacingRecord.fromAmino(e)) : [] - }; + const message = createBaseTickSpacingDecreaseProposal(); + if (object.title !== undefined && object.title !== null) { + message.title = object.title; + } + if (object.description !== undefined && object.description !== null) { + message.description = object.description; + } + message.poolIdToTickSpacingRecords = object.pool_id_to_tick_spacing_records?.map(e => PoolIdToTickSpacingRecord.fromAmino(e)) || []; + return message; }, toAmino(message: TickSpacingDecreaseProposal): TickSpacingDecreaseProposalAmino { const obj: any = {}; @@ -322,6 +387,8 @@ export const TickSpacingDecreaseProposal = { }; } }; +GlobalDecoderRegistry.register(TickSpacingDecreaseProposal.typeUrl, TickSpacingDecreaseProposal); +GlobalDecoderRegistry.registerAminoProtoMapping(TickSpacingDecreaseProposal.aminoType, TickSpacingDecreaseProposal.typeUrl); function createBasePoolIdToTickSpacingRecord(): PoolIdToTickSpacingRecord { return { poolId: BigInt(0), @@ -330,6 +397,16 @@ function createBasePoolIdToTickSpacingRecord(): PoolIdToTickSpacingRecord { } export const PoolIdToTickSpacingRecord = { typeUrl: "/osmosis.concentratedliquidity.v1beta1.PoolIdToTickSpacingRecord", + aminoType: "osmosis/concentratedliquidity/pool-id-to-tick-spacing-record", + is(o: any): o is PoolIdToTickSpacingRecord { + return o && (o.$typeUrl === PoolIdToTickSpacingRecord.typeUrl || typeof o.poolId === "bigint" && typeof o.newTickSpacing === "bigint"); + }, + isSDK(o: any): o is PoolIdToTickSpacingRecordSDKType { + return o && (o.$typeUrl === PoolIdToTickSpacingRecord.typeUrl || typeof o.pool_id === "bigint" && typeof o.new_tick_spacing === "bigint"); + }, + isAmino(o: any): o is PoolIdToTickSpacingRecordAmino { + return o && (o.$typeUrl === PoolIdToTickSpacingRecord.typeUrl || typeof o.pool_id === "bigint" && typeof o.new_tick_spacing === "bigint"); + }, encode(message: PoolIdToTickSpacingRecord, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.poolId !== BigInt(0)) { writer.uint32(8).uint64(message.poolId); @@ -359,6 +436,18 @@ export const PoolIdToTickSpacingRecord = { } return message; }, + fromJSON(object: any): PoolIdToTickSpacingRecord { + return { + poolId: isSet(object.poolId) ? BigInt(object.poolId.toString()) : BigInt(0), + newTickSpacing: isSet(object.newTickSpacing) ? BigInt(object.newTickSpacing.toString()) : BigInt(0) + }; + }, + toJSON(message: PoolIdToTickSpacingRecord): unknown { + const obj: any = {}; + message.poolId !== undefined && (obj.poolId = (message.poolId || BigInt(0)).toString()); + message.newTickSpacing !== undefined && (obj.newTickSpacing = (message.newTickSpacing || BigInt(0)).toString()); + return obj; + }, fromPartial(object: Partial): PoolIdToTickSpacingRecord { const message = createBasePoolIdToTickSpacingRecord(); message.poolId = object.poolId !== undefined && object.poolId !== null ? BigInt(object.poolId.toString()) : BigInt(0); @@ -366,10 +455,14 @@ export const PoolIdToTickSpacingRecord = { return message; }, fromAmino(object: PoolIdToTickSpacingRecordAmino): PoolIdToTickSpacingRecord { - return { - poolId: BigInt(object.pool_id), - newTickSpacing: BigInt(object.new_tick_spacing) - }; + const message = createBasePoolIdToTickSpacingRecord(); + if (object.pool_id !== undefined && object.pool_id !== null) { + message.poolId = BigInt(object.pool_id); + } + if (object.new_tick_spacing !== undefined && object.new_tick_spacing !== null) { + message.newTickSpacing = BigInt(object.new_tick_spacing); + } + return message; }, toAmino(message: PoolIdToTickSpacingRecord): PoolIdToTickSpacingRecordAmino { const obj: any = {}; @@ -399,17 +492,28 @@ export const PoolIdToTickSpacingRecord = { }; } }; +GlobalDecoderRegistry.register(PoolIdToTickSpacingRecord.typeUrl, PoolIdToTickSpacingRecord); +GlobalDecoderRegistry.registerAminoProtoMapping(PoolIdToTickSpacingRecord.aminoType, PoolIdToTickSpacingRecord.typeUrl); function createBasePoolRecord(): PoolRecord { return { denom0: "", denom1: "", tickSpacing: BigInt(0), - exponentAtPriceOne: "", spreadFactor: "" }; } export const PoolRecord = { typeUrl: "/osmosis.concentratedliquidity.v1beta1.PoolRecord", + aminoType: "osmosis/concentratedliquidity/pool-record", + is(o: any): o is PoolRecord { + return o && (o.$typeUrl === PoolRecord.typeUrl || typeof o.denom0 === "string" && typeof o.denom1 === "string" && typeof o.tickSpacing === "bigint" && typeof o.spreadFactor === "string"); + }, + isSDK(o: any): o is PoolRecordSDKType { + return o && (o.$typeUrl === PoolRecord.typeUrl || typeof o.denom0 === "string" && typeof o.denom1 === "string" && typeof o.tick_spacing === "bigint" && typeof o.spread_factor === "string"); + }, + isAmino(o: any): o is PoolRecordAmino { + return o && (o.$typeUrl === PoolRecord.typeUrl || typeof o.denom0 === "string" && typeof o.denom1 === "string" && typeof o.tick_spacing === "bigint" && typeof o.spread_factor === "string"); + }, encode(message: PoolRecord, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.denom0 !== "") { writer.uint32(10).string(message.denom0); @@ -420,9 +524,6 @@ export const PoolRecord = { if (message.tickSpacing !== BigInt(0)) { writer.uint32(24).uint64(message.tickSpacing); } - if (message.exponentAtPriceOne !== "") { - writer.uint32(34).string(message.exponentAtPriceOne); - } if (message.spreadFactor !== "") { writer.uint32(42).string(Decimal.fromUserInput(message.spreadFactor, 18).atomics); } @@ -444,9 +545,6 @@ export const PoolRecord = { case 3: message.tickSpacing = reader.uint64(); break; - case 4: - message.exponentAtPriceOne = reader.string(); - break; case 5: message.spreadFactor = Decimal.fromAtomics(reader.string(), 18).toString(); break; @@ -457,30 +555,51 @@ export const PoolRecord = { } return message; }, + fromJSON(object: any): PoolRecord { + return { + denom0: isSet(object.denom0) ? String(object.denom0) : "", + denom1: isSet(object.denom1) ? String(object.denom1) : "", + tickSpacing: isSet(object.tickSpacing) ? BigInt(object.tickSpacing.toString()) : BigInt(0), + spreadFactor: isSet(object.spreadFactor) ? String(object.spreadFactor) : "" + }; + }, + toJSON(message: PoolRecord): unknown { + const obj: any = {}; + message.denom0 !== undefined && (obj.denom0 = message.denom0); + message.denom1 !== undefined && (obj.denom1 = message.denom1); + message.tickSpacing !== undefined && (obj.tickSpacing = (message.tickSpacing || BigInt(0)).toString()); + message.spreadFactor !== undefined && (obj.spreadFactor = message.spreadFactor); + return obj; + }, fromPartial(object: Partial): PoolRecord { const message = createBasePoolRecord(); message.denom0 = object.denom0 ?? ""; message.denom1 = object.denom1 ?? ""; message.tickSpacing = object.tickSpacing !== undefined && object.tickSpacing !== null ? BigInt(object.tickSpacing.toString()) : BigInt(0); - message.exponentAtPriceOne = object.exponentAtPriceOne ?? ""; message.spreadFactor = object.spreadFactor ?? ""; return message; }, fromAmino(object: PoolRecordAmino): PoolRecord { - return { - denom0: object.denom0, - denom1: object.denom1, - tickSpacing: BigInt(object.tick_spacing), - exponentAtPriceOne: object.exponent_at_price_one, - spreadFactor: object.spread_factor - }; + const message = createBasePoolRecord(); + if (object.denom0 !== undefined && object.denom0 !== null) { + message.denom0 = object.denom0; + } + if (object.denom1 !== undefined && object.denom1 !== null) { + message.denom1 = object.denom1; + } + if (object.tick_spacing !== undefined && object.tick_spacing !== null) { + message.tickSpacing = BigInt(object.tick_spacing); + } + if (object.spread_factor !== undefined && object.spread_factor !== null) { + message.spreadFactor = object.spread_factor; + } + return message; }, toAmino(message: PoolRecord): PoolRecordAmino { const obj: any = {}; obj.denom0 = message.denom0; obj.denom1 = message.denom1; obj.tick_spacing = message.tickSpacing ? message.tickSpacing.toString() : undefined; - obj.exponent_at_price_one = message.exponentAtPriceOne; obj.spread_factor = message.spreadFactor; return obj; }, @@ -505,4 +624,6 @@ export const PoolRecord = { value: PoolRecord.encode(message).finish() }; } -}; \ No newline at end of file +}; +GlobalDecoderRegistry.register(PoolRecord.typeUrl, PoolRecord); +GlobalDecoderRegistry.registerAminoProtoMapping(PoolRecord.aminoType, PoolRecord.typeUrl); \ No newline at end of file diff --git a/packages/osmojs/src/codegen/osmosis/concentrated-liquidity/incentive_record.ts b/packages/osmojs/src/codegen/osmosis/concentratedliquidity/v1beta1/incentive_record.ts similarity index 65% rename from packages/osmojs/src/codegen/osmosis/concentrated-liquidity/incentive_record.ts rename to packages/osmojs/src/codegen/osmosis/concentratedliquidity/v1beta1/incentive_record.ts index c90448a4a..7c02cf128 100644 --- a/packages/osmojs/src/codegen/osmosis/concentrated-liquidity/incentive_record.ts +++ b/packages/osmojs/src/codegen/osmosis/concentratedliquidity/v1beta1/incentive_record.ts @@ -1,9 +1,10 @@ -import { Duration, DurationAmino, DurationSDKType } from "../../google/protobuf/duration"; -import { DecCoin, DecCoinAmino, DecCoinSDKType } from "../../cosmos/base/v1beta1/coin"; -import { Timestamp } from "../../google/protobuf/timestamp"; -import { BinaryReader, BinaryWriter } from "../../binary"; +import { Duration, DurationAmino, DurationSDKType } from "../../../google/protobuf/duration"; +import { DecCoin, DecCoinAmino, DecCoinSDKType } from "../../../cosmos/base/v1beta1/coin"; +import { Timestamp } from "../../../google/protobuf/timestamp"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { isSet, toTimestamp, fromTimestamp } from "../../../helpers"; +import { GlobalDecoderRegistry } from "../../../registry"; import { Decimal } from "@cosmjs/math"; -import { toTimestamp, fromTimestamp } from "../../helpers"; /** * IncentiveRecord is the high-level struct we use to deal with an independent * incentive being distributed on a pool. Note that PoolId, Denom, and MinUptime @@ -35,8 +36,8 @@ export interface IncentiveRecordProtoMsg { */ export interface IncentiveRecordAmino { /** incentive_id is the id uniquely identifying this incentive record. */ - incentive_id: string; - pool_id: string; + incentive_id?: string; + pool_id?: string; /** incentive record body holds necessary */ incentive_record_body?: IncentiveRecordBodyAmino; /** @@ -86,9 +87,9 @@ export interface IncentiveRecordBodyAmino { /** remaining_coin is the total amount of incentives to be distributed */ remaining_coin?: DecCoinAmino; /** emission_rate is the incentive emission rate per second */ - emission_rate: string; + emission_rate?: string; /** start_time is the time when the incentive starts distributing */ - start_time?: Date; + start_time?: string; } export interface IncentiveRecordBodyAminoMsg { type: "osmosis/concentratedliquidity/incentive-record-body"; @@ -108,11 +109,21 @@ function createBaseIncentiveRecord(): IncentiveRecord { incentiveId: BigInt(0), poolId: BigInt(0), incentiveRecordBody: IncentiveRecordBody.fromPartial({}), - minUptime: undefined + minUptime: Duration.fromPartial({}) }; } export const IncentiveRecord = { typeUrl: "/osmosis.concentratedliquidity.v1beta1.IncentiveRecord", + aminoType: "osmosis/concentratedliquidity/incentive-record", + is(o: any): o is IncentiveRecord { + return o && (o.$typeUrl === IncentiveRecord.typeUrl || typeof o.incentiveId === "bigint" && typeof o.poolId === "bigint" && IncentiveRecordBody.is(o.incentiveRecordBody) && Duration.is(o.minUptime)); + }, + isSDK(o: any): o is IncentiveRecordSDKType { + return o && (o.$typeUrl === IncentiveRecord.typeUrl || typeof o.incentive_id === "bigint" && typeof o.pool_id === "bigint" && IncentiveRecordBody.isSDK(o.incentive_record_body) && Duration.isSDK(o.min_uptime)); + }, + isAmino(o: any): o is IncentiveRecordAmino { + return o && (o.$typeUrl === IncentiveRecord.typeUrl || typeof o.incentive_id === "bigint" && typeof o.pool_id === "bigint" && IncentiveRecordBody.isAmino(o.incentive_record_body) && Duration.isAmino(o.min_uptime)); + }, encode(message: IncentiveRecord, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.incentiveId !== BigInt(0)) { writer.uint32(8).uint64(message.incentiveId); @@ -154,6 +165,22 @@ export const IncentiveRecord = { } return message; }, + fromJSON(object: any): IncentiveRecord { + return { + incentiveId: isSet(object.incentiveId) ? BigInt(object.incentiveId.toString()) : BigInt(0), + poolId: isSet(object.poolId) ? BigInt(object.poolId.toString()) : BigInt(0), + incentiveRecordBody: isSet(object.incentiveRecordBody) ? IncentiveRecordBody.fromJSON(object.incentiveRecordBody) : undefined, + minUptime: isSet(object.minUptime) ? Duration.fromJSON(object.minUptime) : undefined + }; + }, + toJSON(message: IncentiveRecord): unknown { + const obj: any = {}; + message.incentiveId !== undefined && (obj.incentiveId = (message.incentiveId || BigInt(0)).toString()); + message.poolId !== undefined && (obj.poolId = (message.poolId || BigInt(0)).toString()); + message.incentiveRecordBody !== undefined && (obj.incentiveRecordBody = message.incentiveRecordBody ? IncentiveRecordBody.toJSON(message.incentiveRecordBody) : undefined); + message.minUptime !== undefined && (obj.minUptime = message.minUptime ? Duration.toJSON(message.minUptime) : undefined); + return obj; + }, fromPartial(object: Partial): IncentiveRecord { const message = createBaseIncentiveRecord(); message.incentiveId = object.incentiveId !== undefined && object.incentiveId !== null ? BigInt(object.incentiveId.toString()) : BigInt(0); @@ -163,12 +190,20 @@ export const IncentiveRecord = { return message; }, fromAmino(object: IncentiveRecordAmino): IncentiveRecord { - return { - incentiveId: BigInt(object.incentive_id), - poolId: BigInt(object.pool_id), - incentiveRecordBody: object?.incentive_record_body ? IncentiveRecordBody.fromAmino(object.incentive_record_body) : undefined, - minUptime: object?.min_uptime ? Duration.fromAmino(object.min_uptime) : undefined - }; + const message = createBaseIncentiveRecord(); + if (object.incentive_id !== undefined && object.incentive_id !== null) { + message.incentiveId = BigInt(object.incentive_id); + } + if (object.pool_id !== undefined && object.pool_id !== null) { + message.poolId = BigInt(object.pool_id); + } + if (object.incentive_record_body !== undefined && object.incentive_record_body !== null) { + message.incentiveRecordBody = IncentiveRecordBody.fromAmino(object.incentive_record_body); + } + if (object.min_uptime !== undefined && object.min_uptime !== null) { + message.minUptime = Duration.fromAmino(object.min_uptime); + } + return message; }, toAmino(message: IncentiveRecord): IncentiveRecordAmino { const obj: any = {}; @@ -200,15 +235,27 @@ export const IncentiveRecord = { }; } }; +GlobalDecoderRegistry.register(IncentiveRecord.typeUrl, IncentiveRecord); +GlobalDecoderRegistry.registerAminoProtoMapping(IncentiveRecord.aminoType, IncentiveRecord.typeUrl); function createBaseIncentiveRecordBody(): IncentiveRecordBody { return { remainingCoin: DecCoin.fromPartial({}), emissionRate: "", - startTime: undefined + startTime: new Date() }; } export const IncentiveRecordBody = { typeUrl: "/osmosis.concentratedliquidity.v1beta1.IncentiveRecordBody", + aminoType: "osmosis/concentratedliquidity/incentive-record-body", + is(o: any): o is IncentiveRecordBody { + return o && (o.$typeUrl === IncentiveRecordBody.typeUrl || DecCoin.is(o.remainingCoin) && typeof o.emissionRate === "string" && Timestamp.is(o.startTime)); + }, + isSDK(o: any): o is IncentiveRecordBodySDKType { + return o && (o.$typeUrl === IncentiveRecordBody.typeUrl || DecCoin.isSDK(o.remaining_coin) && typeof o.emission_rate === "string" && Timestamp.isSDK(o.start_time)); + }, + isAmino(o: any): o is IncentiveRecordBodyAmino { + return o && (o.$typeUrl === IncentiveRecordBody.typeUrl || DecCoin.isAmino(o.remaining_coin) && typeof o.emission_rate === "string" && Timestamp.isAmino(o.start_time)); + }, encode(message: IncentiveRecordBody, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.remainingCoin !== undefined) { DecCoin.encode(message.remainingCoin, writer.uint32(10).fork()).ldelim(); @@ -244,6 +291,20 @@ export const IncentiveRecordBody = { } return message; }, + fromJSON(object: any): IncentiveRecordBody { + return { + remainingCoin: isSet(object.remainingCoin) ? DecCoin.fromJSON(object.remainingCoin) : undefined, + emissionRate: isSet(object.emissionRate) ? String(object.emissionRate) : "", + startTime: isSet(object.startTime) ? new Date(object.startTime) : undefined + }; + }, + toJSON(message: IncentiveRecordBody): unknown { + const obj: any = {}; + message.remainingCoin !== undefined && (obj.remainingCoin = message.remainingCoin ? DecCoin.toJSON(message.remainingCoin) : undefined); + message.emissionRate !== undefined && (obj.emissionRate = message.emissionRate); + message.startTime !== undefined && (obj.startTime = message.startTime.toISOString()); + return obj; + }, fromPartial(object: Partial): IncentiveRecordBody { const message = createBaseIncentiveRecordBody(); message.remainingCoin = object.remainingCoin !== undefined && object.remainingCoin !== null ? DecCoin.fromPartial(object.remainingCoin) : undefined; @@ -252,17 +313,23 @@ export const IncentiveRecordBody = { return message; }, fromAmino(object: IncentiveRecordBodyAmino): IncentiveRecordBody { - return { - remainingCoin: object?.remaining_coin ? DecCoin.fromAmino(object.remaining_coin) : undefined, - emissionRate: object.emission_rate, - startTime: object.start_time - }; + const message = createBaseIncentiveRecordBody(); + if (object.remaining_coin !== undefined && object.remaining_coin !== null) { + message.remainingCoin = DecCoin.fromAmino(object.remaining_coin); + } + if (object.emission_rate !== undefined && object.emission_rate !== null) { + message.emissionRate = object.emission_rate; + } + if (object.start_time !== undefined && object.start_time !== null) { + message.startTime = fromTimestamp(Timestamp.fromAmino(object.start_time)); + } + return message; }, toAmino(message: IncentiveRecordBody): IncentiveRecordBodyAmino { const obj: any = {}; obj.remaining_coin = message.remainingCoin ? DecCoin.toAmino(message.remainingCoin) : undefined; obj.emission_rate = message.emissionRate; - obj.start_time = message.startTime; + obj.start_time = message.startTime ? Timestamp.toAmino(toTimestamp(message.startTime)) : undefined; return obj; }, fromAminoMsg(object: IncentiveRecordBodyAminoMsg): IncentiveRecordBody { @@ -286,4 +353,6 @@ export const IncentiveRecordBody = { value: IncentiveRecordBody.encode(message).finish() }; } -}; \ No newline at end of file +}; +GlobalDecoderRegistry.register(IncentiveRecordBody.typeUrl, IncentiveRecordBody); +GlobalDecoderRegistry.registerAminoProtoMapping(IncentiveRecordBody.aminoType, IncentiveRecordBody.typeUrl); \ No newline at end of file diff --git a/packages/osmojs/src/codegen/osmosis/concentrated-liquidity/pool.ts b/packages/osmojs/src/codegen/osmosis/concentratedliquidity/v1beta1/pool.ts similarity index 53% rename from packages/osmojs/src/codegen/osmosis/concentrated-liquidity/pool.ts rename to packages/osmojs/src/codegen/osmosis/concentratedliquidity/v1beta1/pool.ts index 9aa8f4924..54aa4b7a0 100644 --- a/packages/osmojs/src/codegen/osmosis/concentrated-liquidity/pool.ts +++ b/packages/osmojs/src/codegen/osmosis/concentratedliquidity/v1beta1/pool.ts @@ -1,9 +1,10 @@ -import { Timestamp } from "../../google/protobuf/timestamp"; -import { BinaryReader, BinaryWriter } from "../../binary"; +import { Timestamp } from "../../../google/protobuf/timestamp"; +import { BinaryReader, BinaryWriter } from "../../../binary"; import { Decimal } from "@cosmjs/math"; -import { toTimestamp, fromTimestamp } from "../../helpers"; +import { toTimestamp, fromTimestamp, isSet } from "../../../helpers"; +import { GlobalDecoderRegistry } from "../../../registry"; export interface Pool { - $typeUrl?: string; + $typeUrl?: "/osmosis.concentratedliquidity.v1beta1.Pool"; /** pool's address holding all liquidity tokens. */ address: string; /** address holding the incentives liquidity. */ @@ -37,38 +38,38 @@ export interface PoolProtoMsg { } export interface PoolAmino { /** pool's address holding all liquidity tokens. */ - address: string; + address?: string; /** address holding the incentives liquidity. */ - incentives_address: string; + incentives_address?: string; /** address holding spread rewards from swaps. */ - spread_rewards_address: string; - id: string; + spread_rewards_address?: string; + id?: string; /** Amount of total liquidity */ - current_tick_liquidity: string; - token0: string; - token1: string; - current_sqrt_price: string; - current_tick: string; + current_tick_liquidity?: string; + token0?: string; + token1?: string; + current_sqrt_price?: string; + current_tick?: string; /** * tick_spacing must be one of the authorized_tick_spacing values set in the * concentrated-liquidity parameters */ - tick_spacing: string; - exponent_at_price_one: string; + tick_spacing?: string; + exponent_at_price_one?: string; /** spread_factor is the ratio that is charged on the amount of token in. */ - spread_factor: string; + spread_factor?: string; /** * last_liquidity_update is the last time either the pool liquidity or the * active tick changed */ - last_liquidity_update?: Date; + last_liquidity_update?: string; } export interface PoolAminoMsg { type: "osmosis/concentratedliquidity/pool"; value: PoolAmino; } export interface PoolSDKType { - $typeUrl?: string; + $typeUrl?: "/osmosis.concentratedliquidity.v1beta1.Pool"; address: string; incentives_address: string; spread_rewards_address: string; @@ -98,11 +99,21 @@ function createBasePool(): Pool { tickSpacing: BigInt(0), exponentAtPriceOne: BigInt(0), spreadFactor: "", - lastLiquidityUpdate: undefined + lastLiquidityUpdate: new Date() }; } export const Pool = { typeUrl: "/osmosis.concentratedliquidity.v1beta1.Pool", + aminoType: "osmosis/concentratedliquidity/pool", + is(o: any): o is Pool { + return o && (o.$typeUrl === Pool.typeUrl || typeof o.address === "string" && typeof o.incentivesAddress === "string" && typeof o.spreadRewardsAddress === "string" && typeof o.id === "bigint" && typeof o.currentTickLiquidity === "string" && typeof o.token0 === "string" && typeof o.token1 === "string" && typeof o.currentSqrtPrice === "string" && typeof o.currentTick === "bigint" && typeof o.tickSpacing === "bigint" && typeof o.exponentAtPriceOne === "bigint" && typeof o.spreadFactor === "string" && Timestamp.is(o.lastLiquidityUpdate)); + }, + isSDK(o: any): o is PoolSDKType { + return o && (o.$typeUrl === Pool.typeUrl || typeof o.address === "string" && typeof o.incentives_address === "string" && typeof o.spread_rewards_address === "string" && typeof o.id === "bigint" && typeof o.current_tick_liquidity === "string" && typeof o.token0 === "string" && typeof o.token1 === "string" && typeof o.current_sqrt_price === "string" && typeof o.current_tick === "bigint" && typeof o.tick_spacing === "bigint" && typeof o.exponent_at_price_one === "bigint" && typeof o.spread_factor === "string" && Timestamp.isSDK(o.last_liquidity_update)); + }, + isAmino(o: any): o is PoolAmino { + return o && (o.$typeUrl === Pool.typeUrl || typeof o.address === "string" && typeof o.incentives_address === "string" && typeof o.spread_rewards_address === "string" && typeof o.id === "bigint" && typeof o.current_tick_liquidity === "string" && typeof o.token0 === "string" && typeof o.token1 === "string" && typeof o.current_sqrt_price === "string" && typeof o.current_tick === "bigint" && typeof o.tick_spacing === "bigint" && typeof o.exponent_at_price_one === "bigint" && typeof o.spread_factor === "string" && Timestamp.isAmino(o.last_liquidity_update)); + }, encode(message: Pool, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.address !== "") { writer.uint32(10).string(message.address); @@ -198,6 +209,40 @@ export const Pool = { } return message; }, + fromJSON(object: any): Pool { + return { + address: isSet(object.address) ? String(object.address) : "", + incentivesAddress: isSet(object.incentivesAddress) ? String(object.incentivesAddress) : "", + spreadRewardsAddress: isSet(object.spreadRewardsAddress) ? String(object.spreadRewardsAddress) : "", + id: isSet(object.id) ? BigInt(object.id.toString()) : BigInt(0), + currentTickLiquidity: isSet(object.currentTickLiquidity) ? String(object.currentTickLiquidity) : "", + token0: isSet(object.token0) ? String(object.token0) : "", + token1: isSet(object.token1) ? String(object.token1) : "", + currentSqrtPrice: isSet(object.currentSqrtPrice) ? String(object.currentSqrtPrice) : "", + currentTick: isSet(object.currentTick) ? BigInt(object.currentTick.toString()) : BigInt(0), + tickSpacing: isSet(object.tickSpacing) ? BigInt(object.tickSpacing.toString()) : BigInt(0), + exponentAtPriceOne: isSet(object.exponentAtPriceOne) ? BigInt(object.exponentAtPriceOne.toString()) : BigInt(0), + spreadFactor: isSet(object.spreadFactor) ? String(object.spreadFactor) : "", + lastLiquidityUpdate: isSet(object.lastLiquidityUpdate) ? new Date(object.lastLiquidityUpdate) : undefined + }; + }, + toJSON(message: Pool): unknown { + const obj: any = {}; + message.address !== undefined && (obj.address = message.address); + message.incentivesAddress !== undefined && (obj.incentivesAddress = message.incentivesAddress); + message.spreadRewardsAddress !== undefined && (obj.spreadRewardsAddress = message.spreadRewardsAddress); + message.id !== undefined && (obj.id = (message.id || BigInt(0)).toString()); + message.currentTickLiquidity !== undefined && (obj.currentTickLiquidity = message.currentTickLiquidity); + message.token0 !== undefined && (obj.token0 = message.token0); + message.token1 !== undefined && (obj.token1 = message.token1); + message.currentSqrtPrice !== undefined && (obj.currentSqrtPrice = message.currentSqrtPrice); + message.currentTick !== undefined && (obj.currentTick = (message.currentTick || BigInt(0)).toString()); + message.tickSpacing !== undefined && (obj.tickSpacing = (message.tickSpacing || BigInt(0)).toString()); + message.exponentAtPriceOne !== undefined && (obj.exponentAtPriceOne = (message.exponentAtPriceOne || BigInt(0)).toString()); + message.spreadFactor !== undefined && (obj.spreadFactor = message.spreadFactor); + message.lastLiquidityUpdate !== undefined && (obj.lastLiquidityUpdate = message.lastLiquidityUpdate.toISOString()); + return obj; + }, fromPartial(object: Partial): Pool { const message = createBasePool(); message.address = object.address ?? ""; @@ -216,21 +261,47 @@ export const Pool = { return message; }, fromAmino(object: PoolAmino): Pool { - return { - address: object.address, - incentivesAddress: object.incentives_address, - spreadRewardsAddress: object.spread_rewards_address, - id: BigInt(object.id), - currentTickLiquidity: object.current_tick_liquidity, - token0: object.token0, - token1: object.token1, - currentSqrtPrice: object.current_sqrt_price, - currentTick: BigInt(object.current_tick), - tickSpacing: BigInt(object.tick_spacing), - exponentAtPriceOne: BigInt(object.exponent_at_price_one), - spreadFactor: object.spread_factor, - lastLiquidityUpdate: object.last_liquidity_update - }; + const message = createBasePool(); + if (object.address !== undefined && object.address !== null) { + message.address = object.address; + } + if (object.incentives_address !== undefined && object.incentives_address !== null) { + message.incentivesAddress = object.incentives_address; + } + if (object.spread_rewards_address !== undefined && object.spread_rewards_address !== null) { + message.spreadRewardsAddress = object.spread_rewards_address; + } + if (object.id !== undefined && object.id !== null) { + message.id = BigInt(object.id); + } + if (object.current_tick_liquidity !== undefined && object.current_tick_liquidity !== null) { + message.currentTickLiquidity = object.current_tick_liquidity; + } + if (object.token0 !== undefined && object.token0 !== null) { + message.token0 = object.token0; + } + if (object.token1 !== undefined && object.token1 !== null) { + message.token1 = object.token1; + } + if (object.current_sqrt_price !== undefined && object.current_sqrt_price !== null) { + message.currentSqrtPrice = object.current_sqrt_price; + } + if (object.current_tick !== undefined && object.current_tick !== null) { + message.currentTick = BigInt(object.current_tick); + } + if (object.tick_spacing !== undefined && object.tick_spacing !== null) { + message.tickSpacing = BigInt(object.tick_spacing); + } + if (object.exponent_at_price_one !== undefined && object.exponent_at_price_one !== null) { + message.exponentAtPriceOne = BigInt(object.exponent_at_price_one); + } + if (object.spread_factor !== undefined && object.spread_factor !== null) { + message.spreadFactor = object.spread_factor; + } + if (object.last_liquidity_update !== undefined && object.last_liquidity_update !== null) { + message.lastLiquidityUpdate = fromTimestamp(Timestamp.fromAmino(object.last_liquidity_update)); + } + return message; }, toAmino(message: Pool): PoolAmino { const obj: any = {}; @@ -246,7 +317,7 @@ export const Pool = { obj.tick_spacing = message.tickSpacing ? message.tickSpacing.toString() : undefined; obj.exponent_at_price_one = message.exponentAtPriceOne ? message.exponentAtPriceOne.toString() : undefined; obj.spread_factor = message.spreadFactor; - obj.last_liquidity_update = message.lastLiquidityUpdate; + obj.last_liquidity_update = message.lastLiquidityUpdate ? Timestamp.toAmino(toTimestamp(message.lastLiquidityUpdate)) : undefined; return obj; }, fromAminoMsg(object: PoolAminoMsg): Pool { @@ -270,4 +341,6 @@ export const Pool = { value: Pool.encode(message).finish() }; } -}; \ No newline at end of file +}; +GlobalDecoderRegistry.register(Pool.typeUrl, Pool); +GlobalDecoderRegistry.registerAminoProtoMapping(Pool.aminoType, Pool.typeUrl); \ No newline at end of file diff --git a/packages/osmojs/src/codegen/osmosis/concentrated-liquidity/position.ts b/packages/osmojs/src/codegen/osmosis/concentratedliquidity/v1beta1/position.ts similarity index 60% rename from packages/osmojs/src/codegen/osmosis/concentrated-liquidity/position.ts rename to packages/osmojs/src/codegen/osmosis/concentratedliquidity/v1beta1/position.ts index f5207ecfc..d72aab439 100644 --- a/packages/osmojs/src/codegen/osmosis/concentrated-liquidity/position.ts +++ b/packages/osmojs/src/codegen/osmosis/concentratedliquidity/v1beta1/position.ts @@ -1,9 +1,10 @@ -import { Timestamp } from "../../google/protobuf/timestamp"; -import { Coin, CoinAmino, CoinSDKType } from "../../cosmos/base/v1beta1/coin"; -import { PeriodLock, PeriodLockAmino, PeriodLockSDKType } from "../lockup/lock"; -import { BinaryReader, BinaryWriter } from "../../binary"; -import { toTimestamp, fromTimestamp } from "../../helpers"; +import { Timestamp } from "../../../google/protobuf/timestamp"; +import { Coin, CoinAmino, CoinSDKType } from "../../../cosmos/base/v1beta1/coin"; +import { PeriodLock, PeriodLockAmino, PeriodLockSDKType } from "../../lockup/lock"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { toTimestamp, fromTimestamp, isSet } from "../../../helpers"; import { Decimal } from "@cosmjs/math"; +import { GlobalDecoderRegistry } from "../../../registry"; /** * Position contains position's id, address, pool id, lower tick, upper tick * join time, and liquidity. @@ -26,13 +27,13 @@ export interface PositionProtoMsg { * join time, and liquidity. */ export interface PositionAmino { - position_id: string; - address: string; - pool_id: string; - lower_tick: string; - upper_tick: string; - join_time?: Date; - liquidity: string; + position_id?: string; + address?: string; + pool_id?: string; + lower_tick?: string; + upper_tick?: string; + join_time?: string; + liquidity?: string; } export interface PositionAminoMsg { type: "osmosis/concentratedliquidity/position"; @@ -85,9 +86,9 @@ export interface FullPositionBreakdownAmino { position?: PositionAmino; asset0?: CoinAmino; asset1?: CoinAmino; - claimable_spread_rewards: CoinAmino[]; - claimable_incentives: CoinAmino[]; - forfeited_incentives: CoinAmino[]; + claimable_spread_rewards?: CoinAmino[]; + claimable_incentives?: CoinAmino[]; + forfeited_incentives?: CoinAmino[]; } export interface FullPositionBreakdownAminoMsg { type: "osmosis/concentratedliquidity/full-position-breakdown"; @@ -137,12 +138,22 @@ function createBasePosition(): Position { poolId: BigInt(0), lowerTick: BigInt(0), upperTick: BigInt(0), - joinTime: undefined, + joinTime: new Date(), liquidity: "" }; } export const Position = { typeUrl: "/osmosis.concentratedliquidity.v1beta1.Position", + aminoType: "osmosis/concentratedliquidity/position", + is(o: any): o is Position { + return o && (o.$typeUrl === Position.typeUrl || typeof o.positionId === "bigint" && typeof o.address === "string" && typeof o.poolId === "bigint" && typeof o.lowerTick === "bigint" && typeof o.upperTick === "bigint" && Timestamp.is(o.joinTime) && typeof o.liquidity === "string"); + }, + isSDK(o: any): o is PositionSDKType { + return o && (o.$typeUrl === Position.typeUrl || typeof o.position_id === "bigint" && typeof o.address === "string" && typeof o.pool_id === "bigint" && typeof o.lower_tick === "bigint" && typeof o.upper_tick === "bigint" && Timestamp.isSDK(o.join_time) && typeof o.liquidity === "string"); + }, + isAmino(o: any): o is PositionAmino { + return o && (o.$typeUrl === Position.typeUrl || typeof o.position_id === "bigint" && typeof o.address === "string" && typeof o.pool_id === "bigint" && typeof o.lower_tick === "bigint" && typeof o.upper_tick === "bigint" && Timestamp.isAmino(o.join_time) && typeof o.liquidity === "string"); + }, encode(message: Position, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.positionId !== BigInt(0)) { writer.uint32(8).uint64(message.positionId); @@ -202,6 +213,28 @@ export const Position = { } return message; }, + fromJSON(object: any): Position { + return { + positionId: isSet(object.positionId) ? BigInt(object.positionId.toString()) : BigInt(0), + address: isSet(object.address) ? String(object.address) : "", + poolId: isSet(object.poolId) ? BigInt(object.poolId.toString()) : BigInt(0), + lowerTick: isSet(object.lowerTick) ? BigInt(object.lowerTick.toString()) : BigInt(0), + upperTick: isSet(object.upperTick) ? BigInt(object.upperTick.toString()) : BigInt(0), + joinTime: isSet(object.joinTime) ? new Date(object.joinTime) : undefined, + liquidity: isSet(object.liquidity) ? String(object.liquidity) : "" + }; + }, + toJSON(message: Position): unknown { + const obj: any = {}; + message.positionId !== undefined && (obj.positionId = (message.positionId || BigInt(0)).toString()); + message.address !== undefined && (obj.address = message.address); + message.poolId !== undefined && (obj.poolId = (message.poolId || BigInt(0)).toString()); + message.lowerTick !== undefined && (obj.lowerTick = (message.lowerTick || BigInt(0)).toString()); + message.upperTick !== undefined && (obj.upperTick = (message.upperTick || BigInt(0)).toString()); + message.joinTime !== undefined && (obj.joinTime = message.joinTime.toISOString()); + message.liquidity !== undefined && (obj.liquidity = message.liquidity); + return obj; + }, fromPartial(object: Partial): Position { const message = createBasePosition(); message.positionId = object.positionId !== undefined && object.positionId !== null ? BigInt(object.positionId.toString()) : BigInt(0); @@ -214,15 +247,29 @@ export const Position = { return message; }, fromAmino(object: PositionAmino): Position { - return { - positionId: BigInt(object.position_id), - address: object.address, - poolId: BigInt(object.pool_id), - lowerTick: BigInt(object.lower_tick), - upperTick: BigInt(object.upper_tick), - joinTime: object.join_time, - liquidity: object.liquidity - }; + const message = createBasePosition(); + if (object.position_id !== undefined && object.position_id !== null) { + message.positionId = BigInt(object.position_id); + } + if (object.address !== undefined && object.address !== null) { + message.address = object.address; + } + if (object.pool_id !== undefined && object.pool_id !== null) { + message.poolId = BigInt(object.pool_id); + } + if (object.lower_tick !== undefined && object.lower_tick !== null) { + message.lowerTick = BigInt(object.lower_tick); + } + if (object.upper_tick !== undefined && object.upper_tick !== null) { + message.upperTick = BigInt(object.upper_tick); + } + if (object.join_time !== undefined && object.join_time !== null) { + message.joinTime = fromTimestamp(Timestamp.fromAmino(object.join_time)); + } + if (object.liquidity !== undefined && object.liquidity !== null) { + message.liquidity = object.liquidity; + } + return message; }, toAmino(message: Position): PositionAmino { const obj: any = {}; @@ -231,7 +278,7 @@ export const Position = { obj.pool_id = message.poolId ? message.poolId.toString() : undefined; obj.lower_tick = message.lowerTick ? message.lowerTick.toString() : undefined; obj.upper_tick = message.upperTick ? message.upperTick.toString() : undefined; - obj.join_time = message.joinTime; + obj.join_time = message.joinTime ? Timestamp.toAmino(toTimestamp(message.joinTime)) : undefined; obj.liquidity = message.liquidity; return obj; }, @@ -257,11 +304,13 @@ export const Position = { }; } }; +GlobalDecoderRegistry.register(Position.typeUrl, Position); +GlobalDecoderRegistry.registerAminoProtoMapping(Position.aminoType, Position.typeUrl); function createBaseFullPositionBreakdown(): FullPositionBreakdown { return { position: Position.fromPartial({}), - asset0: undefined, - asset1: undefined, + asset0: Coin.fromPartial({}), + asset1: Coin.fromPartial({}), claimableSpreadRewards: [], claimableIncentives: [], forfeitedIncentives: [] @@ -269,6 +318,16 @@ function createBaseFullPositionBreakdown(): FullPositionBreakdown { } export const FullPositionBreakdown = { typeUrl: "/osmosis.concentratedliquidity.v1beta1.FullPositionBreakdown", + aminoType: "osmosis/concentratedliquidity/full-position-breakdown", + is(o: any): o is FullPositionBreakdown { + return o && (o.$typeUrl === FullPositionBreakdown.typeUrl || Position.is(o.position) && Coin.is(o.asset0) && Coin.is(o.asset1) && Array.isArray(o.claimableSpreadRewards) && (!o.claimableSpreadRewards.length || Coin.is(o.claimableSpreadRewards[0])) && Array.isArray(o.claimableIncentives) && (!o.claimableIncentives.length || Coin.is(o.claimableIncentives[0])) && Array.isArray(o.forfeitedIncentives) && (!o.forfeitedIncentives.length || Coin.is(o.forfeitedIncentives[0]))); + }, + isSDK(o: any): o is FullPositionBreakdownSDKType { + return o && (o.$typeUrl === FullPositionBreakdown.typeUrl || Position.isSDK(o.position) && Coin.isSDK(o.asset0) && Coin.isSDK(o.asset1) && Array.isArray(o.claimable_spread_rewards) && (!o.claimable_spread_rewards.length || Coin.isSDK(o.claimable_spread_rewards[0])) && Array.isArray(o.claimable_incentives) && (!o.claimable_incentives.length || Coin.isSDK(o.claimable_incentives[0])) && Array.isArray(o.forfeited_incentives) && (!o.forfeited_incentives.length || Coin.isSDK(o.forfeited_incentives[0]))); + }, + isAmino(o: any): o is FullPositionBreakdownAmino { + return o && (o.$typeUrl === FullPositionBreakdown.typeUrl || Position.isAmino(o.position) && Coin.isAmino(o.asset0) && Coin.isAmino(o.asset1) && Array.isArray(o.claimable_spread_rewards) && (!o.claimable_spread_rewards.length || Coin.isAmino(o.claimable_spread_rewards[0])) && Array.isArray(o.claimable_incentives) && (!o.claimable_incentives.length || Coin.isAmino(o.claimable_incentives[0])) && Array.isArray(o.forfeited_incentives) && (!o.forfeited_incentives.length || Coin.isAmino(o.forfeited_incentives[0]))); + }, encode(message: FullPositionBreakdown, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.position !== undefined) { Position.encode(message.position, writer.uint32(10).fork()).ldelim(); @@ -322,6 +381,38 @@ export const FullPositionBreakdown = { } return message; }, + fromJSON(object: any): FullPositionBreakdown { + return { + position: isSet(object.position) ? Position.fromJSON(object.position) : undefined, + asset0: isSet(object.asset0) ? Coin.fromJSON(object.asset0) : undefined, + asset1: isSet(object.asset1) ? Coin.fromJSON(object.asset1) : undefined, + claimableSpreadRewards: Array.isArray(object?.claimableSpreadRewards) ? object.claimableSpreadRewards.map((e: any) => Coin.fromJSON(e)) : [], + claimableIncentives: Array.isArray(object?.claimableIncentives) ? object.claimableIncentives.map((e: any) => Coin.fromJSON(e)) : [], + forfeitedIncentives: Array.isArray(object?.forfeitedIncentives) ? object.forfeitedIncentives.map((e: any) => Coin.fromJSON(e)) : [] + }; + }, + toJSON(message: FullPositionBreakdown): unknown { + const obj: any = {}; + message.position !== undefined && (obj.position = message.position ? Position.toJSON(message.position) : undefined); + message.asset0 !== undefined && (obj.asset0 = message.asset0 ? Coin.toJSON(message.asset0) : undefined); + message.asset1 !== undefined && (obj.asset1 = message.asset1 ? Coin.toJSON(message.asset1) : undefined); + if (message.claimableSpreadRewards) { + obj.claimableSpreadRewards = message.claimableSpreadRewards.map(e => e ? Coin.toJSON(e) : undefined); + } else { + obj.claimableSpreadRewards = []; + } + if (message.claimableIncentives) { + obj.claimableIncentives = message.claimableIncentives.map(e => e ? Coin.toJSON(e) : undefined); + } else { + obj.claimableIncentives = []; + } + if (message.forfeitedIncentives) { + obj.forfeitedIncentives = message.forfeitedIncentives.map(e => e ? Coin.toJSON(e) : undefined); + } else { + obj.forfeitedIncentives = []; + } + return obj; + }, fromPartial(object: Partial): FullPositionBreakdown { const message = createBaseFullPositionBreakdown(); message.position = object.position !== undefined && object.position !== null ? Position.fromPartial(object.position) : undefined; @@ -333,14 +424,20 @@ export const FullPositionBreakdown = { return message; }, fromAmino(object: FullPositionBreakdownAmino): FullPositionBreakdown { - return { - position: object?.position ? Position.fromAmino(object.position) : undefined, - asset0: object?.asset0 ? Coin.fromAmino(object.asset0) : undefined, - asset1: object?.asset1 ? Coin.fromAmino(object.asset1) : undefined, - claimableSpreadRewards: Array.isArray(object?.claimable_spread_rewards) ? object.claimable_spread_rewards.map((e: any) => Coin.fromAmino(e)) : [], - claimableIncentives: Array.isArray(object?.claimable_incentives) ? object.claimable_incentives.map((e: any) => Coin.fromAmino(e)) : [], - forfeitedIncentives: Array.isArray(object?.forfeited_incentives) ? object.forfeited_incentives.map((e: any) => Coin.fromAmino(e)) : [] - }; + const message = createBaseFullPositionBreakdown(); + if (object.position !== undefined && object.position !== null) { + message.position = Position.fromAmino(object.position); + } + if (object.asset0 !== undefined && object.asset0 !== null) { + message.asset0 = Coin.fromAmino(object.asset0); + } + if (object.asset1 !== undefined && object.asset1 !== null) { + message.asset1 = Coin.fromAmino(object.asset1); + } + message.claimableSpreadRewards = object.claimable_spread_rewards?.map(e => Coin.fromAmino(e)) || []; + message.claimableIncentives = object.claimable_incentives?.map(e => Coin.fromAmino(e)) || []; + message.forfeitedIncentives = object.forfeited_incentives?.map(e => Coin.fromAmino(e)) || []; + return message; }, toAmino(message: FullPositionBreakdown): FullPositionBreakdownAmino { const obj: any = {}; @@ -386,6 +483,8 @@ export const FullPositionBreakdown = { }; } }; +GlobalDecoderRegistry.register(FullPositionBreakdown.typeUrl, FullPositionBreakdown); +GlobalDecoderRegistry.registerAminoProtoMapping(FullPositionBreakdown.aminoType, FullPositionBreakdown.typeUrl); function createBasePositionWithPeriodLock(): PositionWithPeriodLock { return { position: Position.fromPartial({}), @@ -394,6 +493,16 @@ function createBasePositionWithPeriodLock(): PositionWithPeriodLock { } export const PositionWithPeriodLock = { typeUrl: "/osmosis.concentratedliquidity.v1beta1.PositionWithPeriodLock", + aminoType: "osmosis/concentratedliquidity/position-with-period-lock", + is(o: any): o is PositionWithPeriodLock { + return o && (o.$typeUrl === PositionWithPeriodLock.typeUrl || Position.is(o.position) && PeriodLock.is(o.locks)); + }, + isSDK(o: any): o is PositionWithPeriodLockSDKType { + return o && (o.$typeUrl === PositionWithPeriodLock.typeUrl || Position.isSDK(o.position) && PeriodLock.isSDK(o.locks)); + }, + isAmino(o: any): o is PositionWithPeriodLockAmino { + return o && (o.$typeUrl === PositionWithPeriodLock.typeUrl || Position.isAmino(o.position) && PeriodLock.isAmino(o.locks)); + }, encode(message: PositionWithPeriodLock, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.position !== undefined) { Position.encode(message.position, writer.uint32(10).fork()).ldelim(); @@ -423,6 +532,18 @@ export const PositionWithPeriodLock = { } return message; }, + fromJSON(object: any): PositionWithPeriodLock { + return { + position: isSet(object.position) ? Position.fromJSON(object.position) : undefined, + locks: isSet(object.locks) ? PeriodLock.fromJSON(object.locks) : undefined + }; + }, + toJSON(message: PositionWithPeriodLock): unknown { + const obj: any = {}; + message.position !== undefined && (obj.position = message.position ? Position.toJSON(message.position) : undefined); + message.locks !== undefined && (obj.locks = message.locks ? PeriodLock.toJSON(message.locks) : undefined); + return obj; + }, fromPartial(object: Partial): PositionWithPeriodLock { const message = createBasePositionWithPeriodLock(); message.position = object.position !== undefined && object.position !== null ? Position.fromPartial(object.position) : undefined; @@ -430,10 +551,14 @@ export const PositionWithPeriodLock = { return message; }, fromAmino(object: PositionWithPeriodLockAmino): PositionWithPeriodLock { - return { - position: object?.position ? Position.fromAmino(object.position) : undefined, - locks: object?.locks ? PeriodLock.fromAmino(object.locks) : undefined - }; + const message = createBasePositionWithPeriodLock(); + if (object.position !== undefined && object.position !== null) { + message.position = Position.fromAmino(object.position); + } + if (object.locks !== undefined && object.locks !== null) { + message.locks = PeriodLock.fromAmino(object.locks); + } + return message; }, toAmino(message: PositionWithPeriodLock): PositionWithPeriodLockAmino { const obj: any = {}; @@ -462,4 +587,6 @@ export const PositionWithPeriodLock = { value: PositionWithPeriodLock.encode(message).finish() }; } -}; \ No newline at end of file +}; +GlobalDecoderRegistry.register(PositionWithPeriodLock.typeUrl, PositionWithPeriodLock); +GlobalDecoderRegistry.registerAminoProtoMapping(PositionWithPeriodLock.aminoType, PositionWithPeriodLock.typeUrl); \ No newline at end of file diff --git a/packages/osmojs/src/codegen/osmosis/concentrated-liquidity/query.lcd.ts b/packages/osmojs/src/codegen/osmosis/concentratedliquidity/v1beta1/query.lcd.ts similarity index 88% rename from packages/osmojs/src/codegen/osmosis/concentrated-liquidity/query.lcd.ts rename to packages/osmojs/src/codegen/osmosis/concentratedliquidity/v1beta1/query.lcd.ts index 327955ea6..e375ea5f0 100644 --- a/packages/osmojs/src/codegen/osmosis/concentrated-liquidity/query.lcd.ts +++ b/packages/osmojs/src/codegen/osmosis/concentratedliquidity/v1beta1/query.lcd.ts @@ -1,6 +1,6 @@ -import { setPaginationParams } from "../../helpers"; +import { setPaginationParams } from "../../../helpers"; import { LCDClient } from "@cosmology/lcd"; -import { PoolsRequest, PoolsResponseSDKType, ParamsRequest, ParamsResponseSDKType, UserPositionsRequest, UserPositionsResponseSDKType, LiquidityPerTickRangeRequest, LiquidityPerTickRangeResponseSDKType, LiquidityNetInDirectionRequest, LiquidityNetInDirectionResponseSDKType, ClaimableSpreadRewardsRequest, ClaimableSpreadRewardsResponseSDKType, ClaimableIncentivesRequest, ClaimableIncentivesResponseSDKType, PositionByIdRequest, PositionByIdResponseSDKType, PoolAccumulatorRewardsRequest, PoolAccumulatorRewardsResponseSDKType, IncentiveRecordsRequest, IncentiveRecordsResponseSDKType, TickAccumulatorTrackersRequest, TickAccumulatorTrackersResponseSDKType, CFMMPoolIdLinkFromConcentratedPoolIdRequest, CFMMPoolIdLinkFromConcentratedPoolIdResponseSDKType, UserUnbondingPositionsRequest, UserUnbondingPositionsResponseSDKType, GetTotalLiquidityRequest, GetTotalLiquidityResponseSDKType } from "./query"; +import { PoolsRequest, PoolsResponseSDKType, ParamsRequest, ParamsResponseSDKType, UserPositionsRequest, UserPositionsResponseSDKType, LiquidityPerTickRangeRequest, LiquidityPerTickRangeResponseSDKType, LiquidityNetInDirectionRequest, LiquidityNetInDirectionResponseSDKType, ClaimableSpreadRewardsRequest, ClaimableSpreadRewardsResponseSDKType, ClaimableIncentivesRequest, ClaimableIncentivesResponseSDKType, PositionByIdRequest, PositionByIdResponseSDKType, PoolAccumulatorRewardsRequest, PoolAccumulatorRewardsResponseSDKType, IncentiveRecordsRequest, IncentiveRecordsResponseSDKType, TickAccumulatorTrackersRequest, TickAccumulatorTrackersResponseSDKType, CFMMPoolIdLinkFromConcentratedPoolIdRequest, CFMMPoolIdLinkFromConcentratedPoolIdResponseSDKType, UserUnbondingPositionsRequest, UserUnbondingPositionsResponseSDKType, GetTotalLiquidityRequest, GetTotalLiquidityResponseSDKType, NumNextInitializedTicksRequest, NumNextInitializedTicksResponseSDKType } from "./query"; export class LCDQueryClient { req: LCDClient; constructor({ @@ -23,6 +23,7 @@ export class LCDQueryClient { this.cFMMPoolIdLinkFromConcentratedPoolId = this.cFMMPoolIdLinkFromConcentratedPoolId.bind(this); this.userUnbondingPositions = this.userUnbondingPositions.bind(this); this.getTotalLiquidity = this.getTotalLiquidity.bind(this); + this.numNextInitializedTicks = this.numNextInitializedTicks.bind(this); } /* Pools returns all concentrated liquidity pools */ async pools(params: PoolsRequest = { @@ -42,7 +43,7 @@ export class LCDQueryClient { const endpoint = `osmosis/concentratedliquidity/v1beta1/params`; return await this.req.get(endpoint); } - /* UserPositions returns all concentrated postitions of some address. */ + /* UserPositions returns all concentrated positions of some address. */ async userPositions(params: UserPositionsRequest): Promise { const options: any = { params: {} @@ -189,4 +190,22 @@ export class LCDQueryClient { const endpoint = `osmosis/concentratedliquidity/v1beta1/get_total_liquidity`; return await this.req.get(endpoint); } + /* NumNextInitializedTicks returns the provided number of next initialized + ticks in the direction of swapping the token in denom. */ + async numNextInitializedTicks(params: NumNextInitializedTicksRequest): Promise { + const options: any = { + params: {} + }; + if (typeof params?.poolId !== "undefined") { + options.params.pool_id = params.poolId; + } + if (typeof params?.tokenInDenom !== "undefined") { + options.params.token_in_denom = params.tokenInDenom; + } + if (typeof params?.numNextInitializedTicks !== "undefined") { + options.params.num_next_initialized_ticks = params.numNextInitializedTicks; + } + const endpoint = `osmosis/concentratedliquidity/v1beta1/num_next_initialized_ticks`; + return await this.req.get(endpoint, options); + } } \ No newline at end of file diff --git a/packages/osmojs/src/codegen/osmosis/concentrated-liquidity/query.rpc.Query.ts b/packages/osmojs/src/codegen/osmosis/concentratedliquidity/v1beta1/query.rpc.Query.ts similarity index 91% rename from packages/osmojs/src/codegen/osmosis/concentrated-liquidity/query.rpc.Query.ts rename to packages/osmojs/src/codegen/osmosis/concentratedliquidity/v1beta1/query.rpc.Query.ts index f7e9e53c8..0575556b1 100644 --- a/packages/osmojs/src/codegen/osmosis/concentrated-liquidity/query.rpc.Query.ts +++ b/packages/osmojs/src/codegen/osmosis/concentratedliquidity/v1beta1/query.rpc.Query.ts @@ -1,13 +1,13 @@ -import { Rpc } from "../../helpers"; -import { BinaryReader } from "../../binary"; +import { Rpc } from "../../../helpers"; +import { BinaryReader } from "../../../binary"; import { QueryClient, createProtobufRpcClient } from "@cosmjs/stargate"; -import { PoolsRequest, PoolsResponse, ParamsRequest, ParamsResponse, UserPositionsRequest, UserPositionsResponse, LiquidityPerTickRangeRequest, LiquidityPerTickRangeResponse, LiquidityNetInDirectionRequest, LiquidityNetInDirectionResponse, ClaimableSpreadRewardsRequest, ClaimableSpreadRewardsResponse, ClaimableIncentivesRequest, ClaimableIncentivesResponse, PositionByIdRequest, PositionByIdResponse, PoolAccumulatorRewardsRequest, PoolAccumulatorRewardsResponse, IncentiveRecordsRequest, IncentiveRecordsResponse, TickAccumulatorTrackersRequest, TickAccumulatorTrackersResponse, CFMMPoolIdLinkFromConcentratedPoolIdRequest, CFMMPoolIdLinkFromConcentratedPoolIdResponse, UserUnbondingPositionsRequest, UserUnbondingPositionsResponse, GetTotalLiquidityRequest, GetTotalLiquidityResponse } from "./query"; +import { PoolsRequest, PoolsResponse, ParamsRequest, ParamsResponse, UserPositionsRequest, UserPositionsResponse, LiquidityPerTickRangeRequest, LiquidityPerTickRangeResponse, LiquidityNetInDirectionRequest, LiquidityNetInDirectionResponse, ClaimableSpreadRewardsRequest, ClaimableSpreadRewardsResponse, ClaimableIncentivesRequest, ClaimableIncentivesResponse, PositionByIdRequest, PositionByIdResponse, PoolAccumulatorRewardsRequest, PoolAccumulatorRewardsResponse, IncentiveRecordsRequest, IncentiveRecordsResponse, TickAccumulatorTrackersRequest, TickAccumulatorTrackersResponse, CFMMPoolIdLinkFromConcentratedPoolIdRequest, CFMMPoolIdLinkFromConcentratedPoolIdResponse, UserUnbondingPositionsRequest, UserUnbondingPositionsResponse, GetTotalLiquidityRequest, GetTotalLiquidityResponse, NumNextInitializedTicksRequest, NumNextInitializedTicksResponse } from "./query"; export interface Query { /** Pools returns all concentrated liquidity pools */ pools(request?: PoolsRequest): Promise; /** Params returns concentrated liquidity module params. */ params(request?: ParamsRequest): Promise; - /** UserPositions returns all concentrated postitions of some address. */ + /** UserPositions returns all concentrated positions of some address. */ userPositions(request: UserPositionsRequest): Promise; /** * LiquidityPerTickRange returns the amount of liquidity per every tick range @@ -56,6 +56,11 @@ export interface Query { userUnbondingPositions(request: UserUnbondingPositionsRequest): Promise; /** GetTotalLiquidity returns total liquidity across all cl pools. */ getTotalLiquidity(request?: GetTotalLiquidityRequest): Promise; + /** + * NumNextInitializedTicks returns the provided number of next initialized + * ticks in the direction of swapping the token in denom. + */ + numNextInitializedTicks(request: NumNextInitializedTicksRequest): Promise; } export class QueryClientImpl implements Query { private readonly rpc: Rpc; @@ -75,6 +80,7 @@ export class QueryClientImpl implements Query { this.cFMMPoolIdLinkFromConcentratedPoolId = this.cFMMPoolIdLinkFromConcentratedPoolId.bind(this); this.userUnbondingPositions = this.userUnbondingPositions.bind(this); this.getTotalLiquidity = this.getTotalLiquidity.bind(this); + this.numNextInitializedTicks = this.numNextInitializedTicks.bind(this); } pools(request: PoolsRequest = { pagination: undefined @@ -148,6 +154,11 @@ export class QueryClientImpl implements Query { const promise = this.rpc.request("osmosis.concentratedliquidity.v1beta1.Query", "GetTotalLiquidity", data); return promise.then(data => GetTotalLiquidityResponse.decode(new BinaryReader(data))); } + numNextInitializedTicks(request: NumNextInitializedTicksRequest): Promise { + const data = NumNextInitializedTicksRequest.encode(request).finish(); + const promise = this.rpc.request("osmosis.concentratedliquidity.v1beta1.Query", "NumNextInitializedTicks", data); + return promise.then(data => NumNextInitializedTicksResponse.decode(new BinaryReader(data))); + } } export const createRpcQueryExtension = (base: QueryClient) => { const rpc = createProtobufRpcClient(base); @@ -194,6 +205,9 @@ export const createRpcQueryExtension = (base: QueryClient) => { }, getTotalLiquidity(request?: GetTotalLiquidityRequest): Promise { return queryService.getTotalLiquidity(request); + }, + numNextInitializedTicks(request: NumNextInitializedTicksRequest): Promise { + return queryService.numNextInitializedTicks(request); } }; }; \ No newline at end of file diff --git a/packages/osmojs/src/codegen/osmosis/concentrated-liquidity/query.ts b/packages/osmojs/src/codegen/osmosis/concentratedliquidity/v1beta1/query.ts similarity index 60% rename from packages/osmojs/src/codegen/osmosis/concentrated-liquidity/query.ts rename to packages/osmojs/src/codegen/osmosis/concentratedliquidity/v1beta1/query.ts index 690888652..4846295f5 100644 --- a/packages/osmojs/src/codegen/osmosis/concentrated-liquidity/query.ts +++ b/packages/osmojs/src/codegen/osmosis/concentratedliquidity/v1beta1/query.ts @@ -1,27 +1,29 @@ -import { PageRequest, PageRequestAmino, PageRequestSDKType, PageResponse, PageResponseAmino, PageResponseSDKType } from "../../cosmos/base/query/v1beta1/pagination"; +import { PageRequest, PageRequestAmino, PageRequestSDKType, PageResponse, PageResponseAmino, PageResponseSDKType } from "../../../cosmos/base/query/v1beta1/pagination"; import { FullPositionBreakdown, FullPositionBreakdownAmino, FullPositionBreakdownSDKType, PositionWithPeriodLock, PositionWithPeriodLockAmino, PositionWithPeriodLockSDKType } from "./position"; -import { Any, AnyProtoMsg, AnyAmino, AnySDKType } from "../../google/protobuf/any"; -import { Params, ParamsAmino, ParamsSDKType } from "./params"; -import { Coin, CoinAmino, CoinSDKType, DecCoin, DecCoinAmino, DecCoinSDKType } from "../../cosmos/base/v1beta1/coin"; +import { Any, AnyProtoMsg, AnyAmino, AnySDKType } from "../../../google/protobuf/any"; +import { Params, ParamsAmino, ParamsSDKType } from "../params"; +import { Coin, CoinAmino, CoinSDKType, DecCoin, DecCoinAmino, DecCoinSDKType } from "../../../cosmos/base/v1beta1/coin"; import { UptimeTracker, UptimeTrackerAmino, UptimeTrackerSDKType } from "./tickInfo"; import { IncentiveRecord, IncentiveRecordAmino, IncentiveRecordSDKType } from "./incentive_record"; import { Pool as Pool1 } from "./pool"; import { PoolProtoMsg as Pool1ProtoMsg } from "./pool"; import { PoolSDKType as Pool1SDKType } from "./pool"; -import { CosmWasmPool, CosmWasmPoolProtoMsg, CosmWasmPoolSDKType } from "../cosmwasmpool/v1beta1/model/pool"; -import { Pool as Pool2 } from "../gamm/pool-models/balancer/balancerPool"; -import { PoolProtoMsg as Pool2ProtoMsg } from "../gamm/pool-models/balancer/balancerPool"; -import { PoolSDKType as Pool2SDKType } from "../gamm/pool-models/balancer/balancerPool"; -import { Pool as Pool3 } from "../gamm/pool-models/stableswap/stableswap_pool"; -import { PoolProtoMsg as Pool3ProtoMsg } from "../gamm/pool-models/stableswap/stableswap_pool"; -import { PoolSDKType as Pool3SDKType } from "../gamm/pool-models/stableswap/stableswap_pool"; -import { BinaryReader, BinaryWriter } from "../../binary"; +import { CosmWasmPool, CosmWasmPoolProtoMsg, CosmWasmPoolSDKType } from "../../cosmwasmpool/v1beta1/model/pool"; +import { Pool as Pool2 } from "../../gamm/poolmodels/stableswap/v1beta1/stableswap_pool"; +import { PoolProtoMsg as Pool2ProtoMsg } from "../../gamm/poolmodels/stableswap/v1beta1/stableswap_pool"; +import { PoolSDKType as Pool2SDKType } from "../../gamm/poolmodels/stableswap/v1beta1/stableswap_pool"; +import { Pool as Pool3 } from "../../gamm/v1beta1/balancerPool"; +import { PoolProtoMsg as Pool3ProtoMsg } from "../../gamm/v1beta1/balancerPool"; +import { PoolSDKType as Pool3SDKType } from "../../gamm/v1beta1/balancerPool"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { isSet } from "../../../helpers"; +import { GlobalDecoderRegistry } from "../../../registry"; import { Decimal } from "@cosmjs/math"; /** =============================== UserPositions */ export interface UserPositionsRequest { address: string; poolId: bigint; - pagination: PageRequest; + pagination?: PageRequest; } export interface UserPositionsRequestProtoMsg { typeUrl: "/osmosis.concentratedliquidity.v1beta1.UserPositionsRequest"; @@ -29,8 +31,8 @@ export interface UserPositionsRequestProtoMsg { } /** =============================== UserPositions */ export interface UserPositionsRequestAmino { - address: string; - pool_id: string; + address?: string; + pool_id?: string; pagination?: PageRequestAmino; } export interface UserPositionsRequestAminoMsg { @@ -41,18 +43,18 @@ export interface UserPositionsRequestAminoMsg { export interface UserPositionsRequestSDKType { address: string; pool_id: bigint; - pagination: PageRequestSDKType; + pagination?: PageRequestSDKType; } export interface UserPositionsResponse { positions: FullPositionBreakdown[]; - pagination: PageResponse; + pagination?: PageResponse; } export interface UserPositionsResponseProtoMsg { typeUrl: "/osmosis.concentratedliquidity.v1beta1.UserPositionsResponse"; value: Uint8Array; } export interface UserPositionsResponseAmino { - positions: FullPositionBreakdownAmino[]; + positions?: FullPositionBreakdownAmino[]; pagination?: PageResponseAmino; } export interface UserPositionsResponseAminoMsg { @@ -61,7 +63,7 @@ export interface UserPositionsResponseAminoMsg { } export interface UserPositionsResponseSDKType { positions: FullPositionBreakdownSDKType[]; - pagination: PageResponseSDKType; + pagination?: PageResponseSDKType; } /** =============================== PositionById */ export interface PositionByIdRequest { @@ -73,7 +75,7 @@ export interface PositionByIdRequestProtoMsg { } /** =============================== PositionById */ export interface PositionByIdRequestAmino { - position_id: string; + position_id?: string; } export interface PositionByIdRequestAminoMsg { type: "osmosis/concentratedliquidity/position-by-id-request"; @@ -103,7 +105,7 @@ export interface PositionByIdResponseSDKType { /** =============================== Pools */ export interface PoolsRequest { /** pagination defines an optional pagination for the request. */ - pagination: PageRequest; + pagination?: PageRequest; } export interface PoolsRequestProtoMsg { typeUrl: "/osmosis.concentratedliquidity.v1beta1.PoolsRequest"; @@ -120,12 +122,12 @@ export interface PoolsRequestAminoMsg { } /** =============================== Pools */ export interface PoolsRequestSDKType { - pagination: PageRequestSDKType; + pagination?: PageRequestSDKType; } export interface PoolsResponse { - pools: (Pool1 & CosmWasmPool & Pool2 & Pool3 & Any)[] | Any[]; + pools: (Pool1 | CosmWasmPool | Pool2 | Pool3 | Any)[] | Any[]; /** pagination defines the pagination in the response. */ - pagination: PageResponse; + pagination?: PageResponse; } export interface PoolsResponseProtoMsg { typeUrl: "/osmosis.concentratedliquidity.v1beta1.PoolsResponse"; @@ -135,7 +137,7 @@ export type PoolsResponseEncoded = Omit & { pools: (Pool1ProtoMsg | CosmWasmPoolProtoMsg | Pool2ProtoMsg | Pool3ProtoMsg | AnyProtoMsg)[]; }; export interface PoolsResponseAmino { - pools: AnyAmino[]; + pools?: AnyAmino[]; /** pagination defines the pagination in the response. */ pagination?: PageResponseAmino; } @@ -145,7 +147,7 @@ export interface PoolsResponseAminoMsg { } export interface PoolsResponseSDKType { pools: (Pool1SDKType | CosmWasmPoolSDKType | Pool2SDKType | Pool3SDKType | AnySDKType)[]; - pagination: PageResponseSDKType; + pagination?: PageResponseSDKType; } /** =============================== ModuleParams */ export interface ParamsRequest {} @@ -187,8 +189,8 @@ export interface TickLiquidityNetProtoMsg { value: Uint8Array; } export interface TickLiquidityNetAmino { - liquidity_net: string; - tick_index: string; + liquidity_net?: string; + tick_index?: string; } export interface TickLiquidityNetAminoMsg { type: "osmosis/concentratedliquidity/tick-liquidity-net"; @@ -208,9 +210,9 @@ export interface LiquidityDepthWithRangeProtoMsg { value: Uint8Array; } export interface LiquidityDepthWithRangeAmino { - liquidity_amount: string; - lower_tick: string; - upper_tick: string; + liquidity_amount?: string; + lower_tick?: string; + upper_tick?: string; } export interface LiquidityDepthWithRangeAminoMsg { type: "osmosis/concentratedliquidity/liquidity-depth-with-range"; @@ -236,12 +238,12 @@ export interface LiquidityNetInDirectionRequestProtoMsg { } /** =============================== LiquidityNetInDirection */ export interface LiquidityNetInDirectionRequestAmino { - pool_id: string; - token_in: string; - start_tick: string; - use_cur_tick: boolean; - bound_tick: string; - use_no_bound: boolean; + pool_id?: string; + token_in?: string; + start_tick?: string; + use_cur_tick?: boolean; + bound_tick?: string; + use_no_bound?: boolean; } export interface LiquidityNetInDirectionRequestAminoMsg { type: "osmosis/concentratedliquidity/liquidity-net-in-direction-request"; @@ -260,15 +262,17 @@ export interface LiquidityNetInDirectionResponse { liquidityDepths: TickLiquidityNet[]; currentTick: bigint; currentLiquidity: string; + currentSqrtPrice: string; } export interface LiquidityNetInDirectionResponseProtoMsg { typeUrl: "/osmosis.concentratedliquidity.v1beta1.LiquidityNetInDirectionResponse"; value: Uint8Array; } export interface LiquidityNetInDirectionResponseAmino { - liquidity_depths: TickLiquidityNetAmino[]; - current_tick: string; - current_liquidity: string; + liquidity_depths?: TickLiquidityNetAmino[]; + current_tick?: string; + current_liquidity?: string; + current_sqrt_price?: string; } export interface LiquidityNetInDirectionResponseAminoMsg { type: "osmosis/concentratedliquidity/liquidity-net-in-direction-response"; @@ -278,6 +282,7 @@ export interface LiquidityNetInDirectionResponseSDKType { liquidity_depths: TickLiquidityNetSDKType[]; current_tick: bigint; current_liquidity: string; + current_sqrt_price: string; } /** =============================== LiquidityPerTickRange */ export interface LiquidityPerTickRangeRequest { @@ -289,7 +294,7 @@ export interface LiquidityPerTickRangeRequestProtoMsg { } /** =============================== LiquidityPerTickRange */ export interface LiquidityPerTickRangeRequestAmino { - pool_id: string; + pool_id?: string; } export interface LiquidityPerTickRangeRequestAminoMsg { type: "osmosis/concentratedliquidity/liquidity-per-tick-range-request"; @@ -301,13 +306,15 @@ export interface LiquidityPerTickRangeRequestSDKType { } export interface LiquidityPerTickRangeResponse { liquidity: LiquidityDepthWithRange[]; + bucketIndex: bigint; } export interface LiquidityPerTickRangeResponseProtoMsg { typeUrl: "/osmosis.concentratedliquidity.v1beta1.LiquidityPerTickRangeResponse"; value: Uint8Array; } export interface LiquidityPerTickRangeResponseAmino { - liquidity: LiquidityDepthWithRangeAmino[]; + liquidity?: LiquidityDepthWithRangeAmino[]; + bucket_index?: string; } export interface LiquidityPerTickRangeResponseAminoMsg { type: "osmosis/concentratedliquidity/liquidity-per-tick-range-response"; @@ -315,6 +322,7 @@ export interface LiquidityPerTickRangeResponseAminoMsg { } export interface LiquidityPerTickRangeResponseSDKType { liquidity: LiquidityDepthWithRangeSDKType[]; + bucket_index: bigint; } /** ===================== QueryClaimableSpreadRewards */ export interface ClaimableSpreadRewardsRequest { @@ -326,7 +334,7 @@ export interface ClaimableSpreadRewardsRequestProtoMsg { } /** ===================== QueryClaimableSpreadRewards */ export interface ClaimableSpreadRewardsRequestAmino { - position_id: string; + position_id?: string; } export interface ClaimableSpreadRewardsRequestAminoMsg { type: "osmosis/concentratedliquidity/claimable-spread-rewards-request"; @@ -344,7 +352,7 @@ export interface ClaimableSpreadRewardsResponseProtoMsg { value: Uint8Array; } export interface ClaimableSpreadRewardsResponseAmino { - claimable_spread_rewards: CoinAmino[]; + claimable_spread_rewards?: CoinAmino[]; } export interface ClaimableSpreadRewardsResponseAminoMsg { type: "osmosis/concentratedliquidity/claimable-spread-rewards-response"; @@ -363,7 +371,7 @@ export interface ClaimableIncentivesRequestProtoMsg { } /** ===================== QueryClaimableIncentives */ export interface ClaimableIncentivesRequestAmino { - position_id: string; + position_id?: string; } export interface ClaimableIncentivesRequestAminoMsg { type: "osmosis/concentratedliquidity/claimable-incentives-request"; @@ -382,8 +390,8 @@ export interface ClaimableIncentivesResponseProtoMsg { value: Uint8Array; } export interface ClaimableIncentivesResponseAmino { - claimable_incentives: CoinAmino[]; - forfeited_incentives: CoinAmino[]; + claimable_incentives?: CoinAmino[]; + forfeited_incentives?: CoinAmino[]; } export interface ClaimableIncentivesResponseAminoMsg { type: "osmosis/concentratedliquidity/claimable-incentives-response"; @@ -403,7 +411,7 @@ export interface PoolAccumulatorRewardsRequestProtoMsg { } /** ===================== QueryPoolAccumulatorRewards */ export interface PoolAccumulatorRewardsRequestAmino { - pool_id: string; + pool_id?: string; } export interface PoolAccumulatorRewardsRequestAminoMsg { type: "osmosis/concentratedliquidity/pool-accumulator-rewards-request"; @@ -422,8 +430,8 @@ export interface PoolAccumulatorRewardsResponseProtoMsg { value: Uint8Array; } export interface PoolAccumulatorRewardsResponseAmino { - spread_reward_growth_global: DecCoinAmino[]; - uptime_growth_global: UptimeTrackerAmino[]; + spread_reward_growth_global?: DecCoinAmino[]; + uptime_growth_global?: UptimeTrackerAmino[]; } export interface PoolAccumulatorRewardsResponseAminoMsg { type: "osmosis/concentratedliquidity/pool-accumulator-rewards-response"; @@ -444,8 +452,8 @@ export interface TickAccumulatorTrackersRequestProtoMsg { } /** ===================== QueryTickAccumulatorTrackers */ export interface TickAccumulatorTrackersRequestAmino { - pool_id: string; - tick_index: string; + pool_id?: string; + tick_index?: string; } export interface TickAccumulatorTrackersRequestAminoMsg { type: "osmosis/concentratedliquidity/tick-accumulator-trackers-request"; @@ -465,8 +473,8 @@ export interface TickAccumulatorTrackersResponseProtoMsg { value: Uint8Array; } export interface TickAccumulatorTrackersResponseAmino { - spread_reward_growth_opposite_direction_of_last_traversal: DecCoinAmino[]; - uptime_trackers: UptimeTrackerAmino[]; + spread_reward_growth_opposite_direction_of_last_traversal?: DecCoinAmino[]; + uptime_trackers?: UptimeTrackerAmino[]; } export interface TickAccumulatorTrackersResponseAminoMsg { type: "osmosis/concentratedliquidity/tick-accumulator-trackers-response"; @@ -479,7 +487,7 @@ export interface TickAccumulatorTrackersResponseSDKType { /** ===================== QueryIncentiveRecords */ export interface IncentiveRecordsRequest { poolId: bigint; - pagination: PageRequest; + pagination?: PageRequest; } export interface IncentiveRecordsRequestProtoMsg { typeUrl: "/osmosis.concentratedliquidity.v1beta1.IncentiveRecordsRequest"; @@ -487,7 +495,7 @@ export interface IncentiveRecordsRequestProtoMsg { } /** ===================== QueryIncentiveRecords */ export interface IncentiveRecordsRequestAmino { - pool_id: string; + pool_id?: string; pagination?: PageRequestAmino; } export interface IncentiveRecordsRequestAminoMsg { @@ -497,19 +505,19 @@ export interface IncentiveRecordsRequestAminoMsg { /** ===================== QueryIncentiveRecords */ export interface IncentiveRecordsRequestSDKType { pool_id: bigint; - pagination: PageRequestSDKType; + pagination?: PageRequestSDKType; } export interface IncentiveRecordsResponse { incentiveRecords: IncentiveRecord[]; /** pagination defines the pagination in the response. */ - pagination: PageResponse; + pagination?: PageResponse; } export interface IncentiveRecordsResponseProtoMsg { typeUrl: "/osmosis.concentratedliquidity.v1beta1.IncentiveRecordsResponse"; value: Uint8Array; } export interface IncentiveRecordsResponseAmino { - incentive_records: IncentiveRecordAmino[]; + incentive_records?: IncentiveRecordAmino[]; /** pagination defines the pagination in the response. */ pagination?: PageResponseAmino; } @@ -519,7 +527,7 @@ export interface IncentiveRecordsResponseAminoMsg { } export interface IncentiveRecordsResponseSDKType { incentive_records: IncentiveRecordSDKType[]; - pagination: PageResponseSDKType; + pagination?: PageResponseSDKType; } /** =============================== CFMMPoolIdLinkFromConcentratedPoolId */ export interface CFMMPoolIdLinkFromConcentratedPoolIdRequest { @@ -531,7 +539,7 @@ export interface CFMMPoolIdLinkFromConcentratedPoolIdRequestProtoMsg { } /** =============================== CFMMPoolIdLinkFromConcentratedPoolId */ export interface CFMMPoolIdLinkFromConcentratedPoolIdRequestAmino { - concentrated_pool_id: string; + concentrated_pool_id?: string; } export interface CFMMPoolIdLinkFromConcentratedPoolIdRequestAminoMsg { type: "osmosis/concentratedliquidity/cfmmpool-id-link-from-concentrated-pool-id-request"; @@ -549,7 +557,7 @@ export interface CFMMPoolIdLinkFromConcentratedPoolIdResponseProtoMsg { value: Uint8Array; } export interface CFMMPoolIdLinkFromConcentratedPoolIdResponseAmino { - cfmm_pool_id: string; + cfmm_pool_id?: string; } export interface CFMMPoolIdLinkFromConcentratedPoolIdResponseAminoMsg { type: "osmosis/concentratedliquidity/cfmmpool-id-link-from-concentrated-pool-id-response"; @@ -568,7 +576,7 @@ export interface UserUnbondingPositionsRequestProtoMsg { } /** =============================== UserUnbondingPositions */ export interface UserUnbondingPositionsRequestAmino { - address: string; + address?: string; } export interface UserUnbondingPositionsRequestAminoMsg { type: "osmosis/concentratedliquidity/user-unbonding-positions-request"; @@ -586,7 +594,7 @@ export interface UserUnbondingPositionsResponseProtoMsg { value: Uint8Array; } export interface UserUnbondingPositionsResponseAmino { - positions_with_period_lock: PositionWithPeriodLockAmino[]; + positions_with_period_lock?: PositionWithPeriodLockAmino[]; } export interface UserUnbondingPositionsResponseAminoMsg { type: "osmosis/concentratedliquidity/user-unbonding-positions-response"; @@ -617,7 +625,7 @@ export interface GetTotalLiquidityResponseProtoMsg { value: Uint8Array; } export interface GetTotalLiquidityResponseAmino { - total_liquidity: CoinAmino[]; + total_liquidity?: CoinAmino[]; } export interface GetTotalLiquidityResponseAminoMsg { type: "osmosis/concentratedliquidity/get-total-liquidity-response"; @@ -626,15 +634,74 @@ export interface GetTotalLiquidityResponseAminoMsg { export interface GetTotalLiquidityResponseSDKType { total_liquidity: CoinSDKType[]; } +/** =============================== NumNextInitializedTicks */ +export interface NumNextInitializedTicksRequest { + poolId: bigint; + tokenInDenom: string; + numNextInitializedTicks: bigint; +} +export interface NumNextInitializedTicksRequestProtoMsg { + typeUrl: "/osmosis.concentratedliquidity.v1beta1.NumNextInitializedTicksRequest"; + value: Uint8Array; +} +/** =============================== NumNextInitializedTicks */ +export interface NumNextInitializedTicksRequestAmino { + pool_id?: string; + token_in_denom?: string; + num_next_initialized_ticks?: string; +} +export interface NumNextInitializedTicksRequestAminoMsg { + type: "osmosis/concentratedliquidity/num-next-initialized-ticks-request"; + value: NumNextInitializedTicksRequestAmino; +} +/** =============================== NumNextInitializedTicks */ +export interface NumNextInitializedTicksRequestSDKType { + pool_id: bigint; + token_in_denom: string; + num_next_initialized_ticks: bigint; +} +export interface NumNextInitializedTicksResponse { + liquidityDepths: TickLiquidityNet[]; + currentTick: bigint; + currentLiquidity: string; +} +export interface NumNextInitializedTicksResponseProtoMsg { + typeUrl: "/osmosis.concentratedliquidity.v1beta1.NumNextInitializedTicksResponse"; + value: Uint8Array; +} +export interface NumNextInitializedTicksResponseAmino { + liquidity_depths?: TickLiquidityNetAmino[]; + current_tick?: string; + current_liquidity?: string; +} +export interface NumNextInitializedTicksResponseAminoMsg { + type: "osmosis/concentratedliquidity/num-next-initialized-ticks-response"; + value: NumNextInitializedTicksResponseAmino; +} +export interface NumNextInitializedTicksResponseSDKType { + liquidity_depths: TickLiquidityNetSDKType[]; + current_tick: bigint; + current_liquidity: string; +} function createBaseUserPositionsRequest(): UserPositionsRequest { return { address: "", poolId: BigInt(0), - pagination: PageRequest.fromPartial({}) + pagination: undefined }; } export const UserPositionsRequest = { typeUrl: "/osmosis.concentratedliquidity.v1beta1.UserPositionsRequest", + aminoType: "osmosis/concentratedliquidity/user-positions-request", + is(o: any): o is UserPositionsRequest { + return o && (o.$typeUrl === UserPositionsRequest.typeUrl || typeof o.address === "string" && typeof o.poolId === "bigint"); + }, + isSDK(o: any): o is UserPositionsRequestSDKType { + return o && (o.$typeUrl === UserPositionsRequest.typeUrl || typeof o.address === "string" && typeof o.pool_id === "bigint"); + }, + isAmino(o: any): o is UserPositionsRequestAmino { + return o && (o.$typeUrl === UserPositionsRequest.typeUrl || typeof o.address === "string" && typeof o.pool_id === "bigint"); + }, encode(message: UserPositionsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.address !== "") { writer.uint32(10).string(message.address); @@ -670,6 +737,20 @@ export const UserPositionsRequest = { } return message; }, + fromJSON(object: any): UserPositionsRequest { + return { + address: isSet(object.address) ? String(object.address) : "", + poolId: isSet(object.poolId) ? BigInt(object.poolId.toString()) : BigInt(0), + pagination: isSet(object.pagination) ? PageRequest.fromJSON(object.pagination) : undefined + }; + }, + toJSON(message: UserPositionsRequest): unknown { + const obj: any = {}; + message.address !== undefined && (obj.address = message.address); + message.poolId !== undefined && (obj.poolId = (message.poolId || BigInt(0)).toString()); + message.pagination !== undefined && (obj.pagination = message.pagination ? PageRequest.toJSON(message.pagination) : undefined); + return obj; + }, fromPartial(object: Partial): UserPositionsRequest { const message = createBaseUserPositionsRequest(); message.address = object.address ?? ""; @@ -678,11 +759,17 @@ export const UserPositionsRequest = { return message; }, fromAmino(object: UserPositionsRequestAmino): UserPositionsRequest { - return { - address: object.address, - poolId: BigInt(object.pool_id), - pagination: object?.pagination ? PageRequest.fromAmino(object.pagination) : undefined - }; + const message = createBaseUserPositionsRequest(); + if (object.address !== undefined && object.address !== null) { + message.address = object.address; + } + if (object.pool_id !== undefined && object.pool_id !== null) { + message.poolId = BigInt(object.pool_id); + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromAmino(object.pagination); + } + return message; }, toAmino(message: UserPositionsRequest): UserPositionsRequestAmino { const obj: any = {}; @@ -713,14 +800,26 @@ export const UserPositionsRequest = { }; } }; +GlobalDecoderRegistry.register(UserPositionsRequest.typeUrl, UserPositionsRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(UserPositionsRequest.aminoType, UserPositionsRequest.typeUrl); function createBaseUserPositionsResponse(): UserPositionsResponse { return { positions: [], - pagination: PageResponse.fromPartial({}) + pagination: undefined }; } export const UserPositionsResponse = { typeUrl: "/osmosis.concentratedliquidity.v1beta1.UserPositionsResponse", + aminoType: "osmosis/concentratedliquidity/user-positions-response", + is(o: any): o is UserPositionsResponse { + return o && (o.$typeUrl === UserPositionsResponse.typeUrl || Array.isArray(o.positions) && (!o.positions.length || FullPositionBreakdown.is(o.positions[0]))); + }, + isSDK(o: any): o is UserPositionsResponseSDKType { + return o && (o.$typeUrl === UserPositionsResponse.typeUrl || Array.isArray(o.positions) && (!o.positions.length || FullPositionBreakdown.isSDK(o.positions[0]))); + }, + isAmino(o: any): o is UserPositionsResponseAmino { + return o && (o.$typeUrl === UserPositionsResponse.typeUrl || Array.isArray(o.positions) && (!o.positions.length || FullPositionBreakdown.isAmino(o.positions[0]))); + }, encode(message: UserPositionsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.positions) { FullPositionBreakdown.encode(v!, writer.uint32(10).fork()).ldelim(); @@ -750,6 +849,22 @@ export const UserPositionsResponse = { } return message; }, + fromJSON(object: any): UserPositionsResponse { + return { + positions: Array.isArray(object?.positions) ? object.positions.map((e: any) => FullPositionBreakdown.fromJSON(e)) : [], + pagination: isSet(object.pagination) ? PageResponse.fromJSON(object.pagination) : undefined + }; + }, + toJSON(message: UserPositionsResponse): unknown { + const obj: any = {}; + if (message.positions) { + obj.positions = message.positions.map(e => e ? FullPositionBreakdown.toJSON(e) : undefined); + } else { + obj.positions = []; + } + message.pagination !== undefined && (obj.pagination = message.pagination ? PageResponse.toJSON(message.pagination) : undefined); + return obj; + }, fromPartial(object: Partial): UserPositionsResponse { const message = createBaseUserPositionsResponse(); message.positions = object.positions?.map(e => FullPositionBreakdown.fromPartial(e)) || []; @@ -757,10 +872,12 @@ export const UserPositionsResponse = { return message; }, fromAmino(object: UserPositionsResponseAmino): UserPositionsResponse { - return { - positions: Array.isArray(object?.positions) ? object.positions.map((e: any) => FullPositionBreakdown.fromAmino(e)) : [], - pagination: object?.pagination ? PageResponse.fromAmino(object.pagination) : undefined - }; + const message = createBaseUserPositionsResponse(); + message.positions = object.positions?.map(e => FullPositionBreakdown.fromAmino(e)) || []; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromAmino(object.pagination); + } + return message; }, toAmino(message: UserPositionsResponse): UserPositionsResponseAmino { const obj: any = {}; @@ -794,6 +911,8 @@ export const UserPositionsResponse = { }; } }; +GlobalDecoderRegistry.register(UserPositionsResponse.typeUrl, UserPositionsResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(UserPositionsResponse.aminoType, UserPositionsResponse.typeUrl); function createBasePositionByIdRequest(): PositionByIdRequest { return { positionId: BigInt(0) @@ -801,6 +920,16 @@ function createBasePositionByIdRequest(): PositionByIdRequest { } export const PositionByIdRequest = { typeUrl: "/osmosis.concentratedliquidity.v1beta1.PositionByIdRequest", + aminoType: "osmosis/concentratedliquidity/position-by-id-request", + is(o: any): o is PositionByIdRequest { + return o && (o.$typeUrl === PositionByIdRequest.typeUrl || typeof o.positionId === "bigint"); + }, + isSDK(o: any): o is PositionByIdRequestSDKType { + return o && (o.$typeUrl === PositionByIdRequest.typeUrl || typeof o.position_id === "bigint"); + }, + isAmino(o: any): o is PositionByIdRequestAmino { + return o && (o.$typeUrl === PositionByIdRequest.typeUrl || typeof o.position_id === "bigint"); + }, encode(message: PositionByIdRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.positionId !== BigInt(0)) { writer.uint32(8).uint64(message.positionId); @@ -824,15 +953,27 @@ export const PositionByIdRequest = { } return message; }, + fromJSON(object: any): PositionByIdRequest { + return { + positionId: isSet(object.positionId) ? BigInt(object.positionId.toString()) : BigInt(0) + }; + }, + toJSON(message: PositionByIdRequest): unknown { + const obj: any = {}; + message.positionId !== undefined && (obj.positionId = (message.positionId || BigInt(0)).toString()); + return obj; + }, fromPartial(object: Partial): PositionByIdRequest { const message = createBasePositionByIdRequest(); message.positionId = object.positionId !== undefined && object.positionId !== null ? BigInt(object.positionId.toString()) : BigInt(0); return message; }, fromAmino(object: PositionByIdRequestAmino): PositionByIdRequest { - return { - positionId: BigInt(object.position_id) - }; + const message = createBasePositionByIdRequest(); + if (object.position_id !== undefined && object.position_id !== null) { + message.positionId = BigInt(object.position_id); + } + return message; }, toAmino(message: PositionByIdRequest): PositionByIdRequestAmino { const obj: any = {}; @@ -861,6 +1002,8 @@ export const PositionByIdRequest = { }; } }; +GlobalDecoderRegistry.register(PositionByIdRequest.typeUrl, PositionByIdRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(PositionByIdRequest.aminoType, PositionByIdRequest.typeUrl); function createBasePositionByIdResponse(): PositionByIdResponse { return { position: FullPositionBreakdown.fromPartial({}) @@ -868,6 +1011,16 @@ function createBasePositionByIdResponse(): PositionByIdResponse { } export const PositionByIdResponse = { typeUrl: "/osmosis.concentratedliquidity.v1beta1.PositionByIdResponse", + aminoType: "osmosis/concentratedliquidity/position-by-id-response", + is(o: any): o is PositionByIdResponse { + return o && (o.$typeUrl === PositionByIdResponse.typeUrl || FullPositionBreakdown.is(o.position)); + }, + isSDK(o: any): o is PositionByIdResponseSDKType { + return o && (o.$typeUrl === PositionByIdResponse.typeUrl || FullPositionBreakdown.isSDK(o.position)); + }, + isAmino(o: any): o is PositionByIdResponseAmino { + return o && (o.$typeUrl === PositionByIdResponse.typeUrl || FullPositionBreakdown.isAmino(o.position)); + }, encode(message: PositionByIdResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.position !== undefined) { FullPositionBreakdown.encode(message.position, writer.uint32(10).fork()).ldelim(); @@ -891,15 +1044,27 @@ export const PositionByIdResponse = { } return message; }, + fromJSON(object: any): PositionByIdResponse { + return { + position: isSet(object.position) ? FullPositionBreakdown.fromJSON(object.position) : undefined + }; + }, + toJSON(message: PositionByIdResponse): unknown { + const obj: any = {}; + message.position !== undefined && (obj.position = message.position ? FullPositionBreakdown.toJSON(message.position) : undefined); + return obj; + }, fromPartial(object: Partial): PositionByIdResponse { const message = createBasePositionByIdResponse(); message.position = object.position !== undefined && object.position !== null ? FullPositionBreakdown.fromPartial(object.position) : undefined; return message; }, fromAmino(object: PositionByIdResponseAmino): PositionByIdResponse { - return { - position: object?.position ? FullPositionBreakdown.fromAmino(object.position) : undefined - }; + const message = createBasePositionByIdResponse(); + if (object.position !== undefined && object.position !== null) { + message.position = FullPositionBreakdown.fromAmino(object.position); + } + return message; }, toAmino(message: PositionByIdResponse): PositionByIdResponseAmino { const obj: any = {}; @@ -928,13 +1093,25 @@ export const PositionByIdResponse = { }; } }; +GlobalDecoderRegistry.register(PositionByIdResponse.typeUrl, PositionByIdResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(PositionByIdResponse.aminoType, PositionByIdResponse.typeUrl); function createBasePoolsRequest(): PoolsRequest { return { - pagination: PageRequest.fromPartial({}) + pagination: undefined }; } export const PoolsRequest = { typeUrl: "/osmosis.concentratedliquidity.v1beta1.PoolsRequest", + aminoType: "osmosis/concentratedliquidity/pools-request", + is(o: any): o is PoolsRequest { + return o && o.$typeUrl === PoolsRequest.typeUrl; + }, + isSDK(o: any): o is PoolsRequestSDKType { + return o && o.$typeUrl === PoolsRequest.typeUrl; + }, + isAmino(o: any): o is PoolsRequestAmino { + return o && o.$typeUrl === PoolsRequest.typeUrl; + }, encode(message: PoolsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.pagination !== undefined) { PageRequest.encode(message.pagination, writer.uint32(18).fork()).ldelim(); @@ -958,15 +1135,27 @@ export const PoolsRequest = { } return message; }, + fromJSON(object: any): PoolsRequest { + return { + pagination: isSet(object.pagination) ? PageRequest.fromJSON(object.pagination) : undefined + }; + }, + toJSON(message: PoolsRequest): unknown { + const obj: any = {}; + message.pagination !== undefined && (obj.pagination = message.pagination ? PageRequest.toJSON(message.pagination) : undefined); + return obj; + }, fromPartial(object: Partial): PoolsRequest { const message = createBasePoolsRequest(); message.pagination = object.pagination !== undefined && object.pagination !== null ? PageRequest.fromPartial(object.pagination) : undefined; return message; }, fromAmino(object: PoolsRequestAmino): PoolsRequest { - return { - pagination: object?.pagination ? PageRequest.fromAmino(object.pagination) : undefined - }; + const message = createBasePoolsRequest(); + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromAmino(object.pagination); + } + return message; }, toAmino(message: PoolsRequest): PoolsRequestAmino { const obj: any = {}; @@ -995,17 +1184,29 @@ export const PoolsRequest = { }; } }; +GlobalDecoderRegistry.register(PoolsRequest.typeUrl, PoolsRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(PoolsRequest.aminoType, PoolsRequest.typeUrl); function createBasePoolsResponse(): PoolsResponse { return { pools: [], - pagination: PageResponse.fromPartial({}) + pagination: undefined }; } export const PoolsResponse = { typeUrl: "/osmosis.concentratedliquidity.v1beta1.PoolsResponse", + aminoType: "osmosis/concentratedliquidity/pools-response", + is(o: any): o is PoolsResponse { + return o && (o.$typeUrl === PoolsResponse.typeUrl || Array.isArray(o.pools) && (!o.pools.length || Pool1.is(o.pools[0]) || CosmWasmPool.is(o.pools[0]) || Pool2.is(o.pools[0]) || Pool3.is(o.pools[0]) || Any.is(o.pools[0]))); + }, + isSDK(o: any): o is PoolsResponseSDKType { + return o && (o.$typeUrl === PoolsResponse.typeUrl || Array.isArray(o.pools) && (!o.pools.length || Pool1.isSDK(o.pools[0]) || CosmWasmPool.isSDK(o.pools[0]) || Pool2.isSDK(o.pools[0]) || Pool3.isSDK(o.pools[0]) || Any.isSDK(o.pools[0]))); + }, + isAmino(o: any): o is PoolsResponseAmino { + return o && (o.$typeUrl === PoolsResponse.typeUrl || Array.isArray(o.pools) && (!o.pools.length || Pool1.isAmino(o.pools[0]) || CosmWasmPool.isAmino(o.pools[0]) || Pool2.isAmino(o.pools[0]) || Pool3.isAmino(o.pools[0]) || Any.isAmino(o.pools[0]))); + }, encode(message: PoolsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.pools) { - Any.encode((v! as Any), writer.uint32(10).fork()).ldelim(); + Any.encode(GlobalDecoderRegistry.wrapAny(v!), writer.uint32(10).fork()).ldelim(); } if (message.pagination !== undefined) { PageResponse.encode(message.pagination, writer.uint32(18).fork()).ldelim(); @@ -1020,7 +1221,7 @@ export const PoolsResponse = { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.pools.push((PoolI_InterfaceDecoder(reader) as Any)); + message.pools.push(GlobalDecoderRegistry.unwrapAny(reader)); break; case 2: message.pagination = PageResponse.decode(reader, reader.uint32()); @@ -1032,22 +1233,40 @@ export const PoolsResponse = { } return message; }, + fromJSON(object: any): PoolsResponse { + return { + pools: Array.isArray(object?.pools) ? object.pools.map((e: any) => GlobalDecoderRegistry.fromJSON(e)) : [], + pagination: isSet(object.pagination) ? PageResponse.fromJSON(object.pagination) : undefined + }; + }, + toJSON(message: PoolsResponse): unknown { + const obj: any = {}; + if (message.pools) { + obj.pools = message.pools.map(e => e ? GlobalDecoderRegistry.toJSON(e) : undefined); + } else { + obj.pools = []; + } + message.pagination !== undefined && (obj.pagination = message.pagination ? PageResponse.toJSON(message.pagination) : undefined); + return obj; + }, fromPartial(object: Partial): PoolsResponse { const message = createBasePoolsResponse(); - message.pools = object.pools?.map(e => Any.fromPartial(e)) || []; + message.pools = object.pools?.map(e => (Any.fromPartial(e) as any)) || []; message.pagination = object.pagination !== undefined && object.pagination !== null ? PageResponse.fromPartial(object.pagination) : undefined; return message; }, fromAmino(object: PoolsResponseAmino): PoolsResponse { - return { - pools: Array.isArray(object?.pools) ? object.pools.map((e: any) => PoolI_FromAmino(e)) : [], - pagination: object?.pagination ? PageResponse.fromAmino(object.pagination) : undefined - }; + const message = createBasePoolsResponse(); + message.pools = object.pools?.map(e => GlobalDecoderRegistry.fromAminoMsg(e)) || []; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromAmino(object.pagination); + } + return message; }, toAmino(message: PoolsResponse): PoolsResponseAmino { const obj: any = {}; if (message.pools) { - obj.pools = message.pools.map(e => e ? PoolI_ToAmino((e as Any)) : undefined); + obj.pools = message.pools.map(e => e ? GlobalDecoderRegistry.toAminoMsg(e) : undefined); } else { obj.pools = []; } @@ -1076,11 +1295,23 @@ export const PoolsResponse = { }; } }; +GlobalDecoderRegistry.register(PoolsResponse.typeUrl, PoolsResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(PoolsResponse.aminoType, PoolsResponse.typeUrl); function createBaseParamsRequest(): ParamsRequest { return {}; } export const ParamsRequest = { typeUrl: "/osmosis.concentratedliquidity.v1beta1.ParamsRequest", + aminoType: "osmosis/concentratedliquidity/params-request", + is(o: any): o is ParamsRequest { + return o && o.$typeUrl === ParamsRequest.typeUrl; + }, + isSDK(o: any): o is ParamsRequestSDKType { + return o && o.$typeUrl === ParamsRequest.typeUrl; + }, + isAmino(o: any): o is ParamsRequestAmino { + return o && o.$typeUrl === ParamsRequest.typeUrl; + }, encode(_: ParamsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, @@ -1098,12 +1329,20 @@ export const ParamsRequest = { } return message; }, + fromJSON(_: any): ParamsRequest { + return {}; + }, + toJSON(_: ParamsRequest): unknown { + const obj: any = {}; + return obj; + }, fromPartial(_: Partial): ParamsRequest { const message = createBaseParamsRequest(); return message; }, fromAmino(_: ParamsRequestAmino): ParamsRequest { - return {}; + const message = createBaseParamsRequest(); + return message; }, toAmino(_: ParamsRequest): ParamsRequestAmino { const obj: any = {}; @@ -1131,6 +1370,8 @@ export const ParamsRequest = { }; } }; +GlobalDecoderRegistry.register(ParamsRequest.typeUrl, ParamsRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(ParamsRequest.aminoType, ParamsRequest.typeUrl); function createBaseParamsResponse(): ParamsResponse { return { params: Params.fromPartial({}) @@ -1138,6 +1379,16 @@ function createBaseParamsResponse(): ParamsResponse { } export const ParamsResponse = { typeUrl: "/osmosis.concentratedliquidity.v1beta1.ParamsResponse", + aminoType: "osmosis/concentratedliquidity/params-response", + is(o: any): o is ParamsResponse { + return o && (o.$typeUrl === ParamsResponse.typeUrl || Params.is(o.params)); + }, + isSDK(o: any): o is ParamsResponseSDKType { + return o && (o.$typeUrl === ParamsResponse.typeUrl || Params.isSDK(o.params)); + }, + isAmino(o: any): o is ParamsResponseAmino { + return o && (o.$typeUrl === ParamsResponse.typeUrl || Params.isAmino(o.params)); + }, encode(message: ParamsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.params !== undefined) { Params.encode(message.params, writer.uint32(10).fork()).ldelim(); @@ -1161,15 +1412,27 @@ export const ParamsResponse = { } return message; }, + fromJSON(object: any): ParamsResponse { + return { + params: isSet(object.params) ? Params.fromJSON(object.params) : undefined + }; + }, + toJSON(message: ParamsResponse): unknown { + const obj: any = {}; + message.params !== undefined && (obj.params = message.params ? Params.toJSON(message.params) : undefined); + return obj; + }, fromPartial(object: Partial): ParamsResponse { const message = createBaseParamsResponse(); message.params = object.params !== undefined && object.params !== null ? Params.fromPartial(object.params) : undefined; return message; }, fromAmino(object: ParamsResponseAmino): ParamsResponse { - return { - params: object?.params ? Params.fromAmino(object.params) : undefined - }; + const message = createBaseParamsResponse(); + if (object.params !== undefined && object.params !== null) { + message.params = Params.fromAmino(object.params); + } + return message; }, toAmino(message: ParamsResponse): ParamsResponseAmino { const obj: any = {}; @@ -1198,6 +1461,8 @@ export const ParamsResponse = { }; } }; +GlobalDecoderRegistry.register(ParamsResponse.typeUrl, ParamsResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(ParamsResponse.aminoType, ParamsResponse.typeUrl); function createBaseTickLiquidityNet(): TickLiquidityNet { return { liquidityNet: "", @@ -1206,6 +1471,16 @@ function createBaseTickLiquidityNet(): TickLiquidityNet { } export const TickLiquidityNet = { typeUrl: "/osmosis.concentratedliquidity.v1beta1.TickLiquidityNet", + aminoType: "osmosis/concentratedliquidity/tick-liquidity-net", + is(o: any): o is TickLiquidityNet { + return o && (o.$typeUrl === TickLiquidityNet.typeUrl || typeof o.liquidityNet === "string" && typeof o.tickIndex === "bigint"); + }, + isSDK(o: any): o is TickLiquidityNetSDKType { + return o && (o.$typeUrl === TickLiquidityNet.typeUrl || typeof o.liquidity_net === "string" && typeof o.tick_index === "bigint"); + }, + isAmino(o: any): o is TickLiquidityNetAmino { + return o && (o.$typeUrl === TickLiquidityNet.typeUrl || typeof o.liquidity_net === "string" && typeof o.tick_index === "bigint"); + }, encode(message: TickLiquidityNet, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.liquidityNet !== "") { writer.uint32(10).string(Decimal.fromUserInput(message.liquidityNet, 18).atomics); @@ -1235,6 +1510,18 @@ export const TickLiquidityNet = { } return message; }, + fromJSON(object: any): TickLiquidityNet { + return { + liquidityNet: isSet(object.liquidityNet) ? String(object.liquidityNet) : "", + tickIndex: isSet(object.tickIndex) ? BigInt(object.tickIndex.toString()) : BigInt(0) + }; + }, + toJSON(message: TickLiquidityNet): unknown { + const obj: any = {}; + message.liquidityNet !== undefined && (obj.liquidityNet = message.liquidityNet); + message.tickIndex !== undefined && (obj.tickIndex = (message.tickIndex || BigInt(0)).toString()); + return obj; + }, fromPartial(object: Partial): TickLiquidityNet { const message = createBaseTickLiquidityNet(); message.liquidityNet = object.liquidityNet ?? ""; @@ -1242,10 +1529,14 @@ export const TickLiquidityNet = { return message; }, fromAmino(object: TickLiquidityNetAmino): TickLiquidityNet { - return { - liquidityNet: object.liquidity_net, - tickIndex: BigInt(object.tick_index) - }; + const message = createBaseTickLiquidityNet(); + if (object.liquidity_net !== undefined && object.liquidity_net !== null) { + message.liquidityNet = object.liquidity_net; + } + if (object.tick_index !== undefined && object.tick_index !== null) { + message.tickIndex = BigInt(object.tick_index); + } + return message; }, toAmino(message: TickLiquidityNet): TickLiquidityNetAmino { const obj: any = {}; @@ -1275,6 +1566,8 @@ export const TickLiquidityNet = { }; } }; +GlobalDecoderRegistry.register(TickLiquidityNet.typeUrl, TickLiquidityNet); +GlobalDecoderRegistry.registerAminoProtoMapping(TickLiquidityNet.aminoType, TickLiquidityNet.typeUrl); function createBaseLiquidityDepthWithRange(): LiquidityDepthWithRange { return { liquidityAmount: "", @@ -1284,6 +1577,16 @@ function createBaseLiquidityDepthWithRange(): LiquidityDepthWithRange { } export const LiquidityDepthWithRange = { typeUrl: "/osmosis.concentratedliquidity.v1beta1.LiquidityDepthWithRange", + aminoType: "osmosis/concentratedliquidity/liquidity-depth-with-range", + is(o: any): o is LiquidityDepthWithRange { + return o && (o.$typeUrl === LiquidityDepthWithRange.typeUrl || typeof o.liquidityAmount === "string" && typeof o.lowerTick === "bigint" && typeof o.upperTick === "bigint"); + }, + isSDK(o: any): o is LiquidityDepthWithRangeSDKType { + return o && (o.$typeUrl === LiquidityDepthWithRange.typeUrl || typeof o.liquidity_amount === "string" && typeof o.lower_tick === "bigint" && typeof o.upper_tick === "bigint"); + }, + isAmino(o: any): o is LiquidityDepthWithRangeAmino { + return o && (o.$typeUrl === LiquidityDepthWithRange.typeUrl || typeof o.liquidity_amount === "string" && typeof o.lower_tick === "bigint" && typeof o.upper_tick === "bigint"); + }, encode(message: LiquidityDepthWithRange, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.liquidityAmount !== "") { writer.uint32(10).string(Decimal.fromUserInput(message.liquidityAmount, 18).atomics); @@ -1319,6 +1622,20 @@ export const LiquidityDepthWithRange = { } return message; }, + fromJSON(object: any): LiquidityDepthWithRange { + return { + liquidityAmount: isSet(object.liquidityAmount) ? String(object.liquidityAmount) : "", + lowerTick: isSet(object.lowerTick) ? BigInt(object.lowerTick.toString()) : BigInt(0), + upperTick: isSet(object.upperTick) ? BigInt(object.upperTick.toString()) : BigInt(0) + }; + }, + toJSON(message: LiquidityDepthWithRange): unknown { + const obj: any = {}; + message.liquidityAmount !== undefined && (obj.liquidityAmount = message.liquidityAmount); + message.lowerTick !== undefined && (obj.lowerTick = (message.lowerTick || BigInt(0)).toString()); + message.upperTick !== undefined && (obj.upperTick = (message.upperTick || BigInt(0)).toString()); + return obj; + }, fromPartial(object: Partial): LiquidityDepthWithRange { const message = createBaseLiquidityDepthWithRange(); message.liquidityAmount = object.liquidityAmount ?? ""; @@ -1327,11 +1644,17 @@ export const LiquidityDepthWithRange = { return message; }, fromAmino(object: LiquidityDepthWithRangeAmino): LiquidityDepthWithRange { - return { - liquidityAmount: object.liquidity_amount, - lowerTick: BigInt(object.lower_tick), - upperTick: BigInt(object.upper_tick) - }; + const message = createBaseLiquidityDepthWithRange(); + if (object.liquidity_amount !== undefined && object.liquidity_amount !== null) { + message.liquidityAmount = object.liquidity_amount; + } + if (object.lower_tick !== undefined && object.lower_tick !== null) { + message.lowerTick = BigInt(object.lower_tick); + } + if (object.upper_tick !== undefined && object.upper_tick !== null) { + message.upperTick = BigInt(object.upper_tick); + } + return message; }, toAmino(message: LiquidityDepthWithRange): LiquidityDepthWithRangeAmino { const obj: any = {}; @@ -1362,6 +1685,8 @@ export const LiquidityDepthWithRange = { }; } }; +GlobalDecoderRegistry.register(LiquidityDepthWithRange.typeUrl, LiquidityDepthWithRange); +GlobalDecoderRegistry.registerAminoProtoMapping(LiquidityDepthWithRange.aminoType, LiquidityDepthWithRange.typeUrl); function createBaseLiquidityNetInDirectionRequest(): LiquidityNetInDirectionRequest { return { poolId: BigInt(0), @@ -1374,6 +1699,16 @@ function createBaseLiquidityNetInDirectionRequest(): LiquidityNetInDirectionRequ } export const LiquidityNetInDirectionRequest = { typeUrl: "/osmosis.concentratedliquidity.v1beta1.LiquidityNetInDirectionRequest", + aminoType: "osmosis/concentratedliquidity/liquidity-net-in-direction-request", + is(o: any): o is LiquidityNetInDirectionRequest { + return o && (o.$typeUrl === LiquidityNetInDirectionRequest.typeUrl || typeof o.poolId === "bigint" && typeof o.tokenIn === "string" && typeof o.startTick === "bigint" && typeof o.useCurTick === "boolean" && typeof o.boundTick === "bigint" && typeof o.useNoBound === "boolean"); + }, + isSDK(o: any): o is LiquidityNetInDirectionRequestSDKType { + return o && (o.$typeUrl === LiquidityNetInDirectionRequest.typeUrl || typeof o.pool_id === "bigint" && typeof o.token_in === "string" && typeof o.start_tick === "bigint" && typeof o.use_cur_tick === "boolean" && typeof o.bound_tick === "bigint" && typeof o.use_no_bound === "boolean"); + }, + isAmino(o: any): o is LiquidityNetInDirectionRequestAmino { + return o && (o.$typeUrl === LiquidityNetInDirectionRequest.typeUrl || typeof o.pool_id === "bigint" && typeof o.token_in === "string" && typeof o.start_tick === "bigint" && typeof o.use_cur_tick === "boolean" && typeof o.bound_tick === "bigint" && typeof o.use_no_bound === "boolean"); + }, encode(message: LiquidityNetInDirectionRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.poolId !== BigInt(0)) { writer.uint32(8).uint64(message.poolId); @@ -1427,6 +1762,26 @@ export const LiquidityNetInDirectionRequest = { } return message; }, + fromJSON(object: any): LiquidityNetInDirectionRequest { + return { + poolId: isSet(object.poolId) ? BigInt(object.poolId.toString()) : BigInt(0), + tokenIn: isSet(object.tokenIn) ? String(object.tokenIn) : "", + startTick: isSet(object.startTick) ? BigInt(object.startTick.toString()) : BigInt(0), + useCurTick: isSet(object.useCurTick) ? Boolean(object.useCurTick) : false, + boundTick: isSet(object.boundTick) ? BigInt(object.boundTick.toString()) : BigInt(0), + useNoBound: isSet(object.useNoBound) ? Boolean(object.useNoBound) : false + }; + }, + toJSON(message: LiquidityNetInDirectionRequest): unknown { + const obj: any = {}; + message.poolId !== undefined && (obj.poolId = (message.poolId || BigInt(0)).toString()); + message.tokenIn !== undefined && (obj.tokenIn = message.tokenIn); + message.startTick !== undefined && (obj.startTick = (message.startTick || BigInt(0)).toString()); + message.useCurTick !== undefined && (obj.useCurTick = message.useCurTick); + message.boundTick !== undefined && (obj.boundTick = (message.boundTick || BigInt(0)).toString()); + message.useNoBound !== undefined && (obj.useNoBound = message.useNoBound); + return obj; + }, fromPartial(object: Partial): LiquidityNetInDirectionRequest { const message = createBaseLiquidityNetInDirectionRequest(); message.poolId = object.poolId !== undefined && object.poolId !== null ? BigInt(object.poolId.toString()) : BigInt(0); @@ -1438,14 +1793,26 @@ export const LiquidityNetInDirectionRequest = { return message; }, fromAmino(object: LiquidityNetInDirectionRequestAmino): LiquidityNetInDirectionRequest { - return { - poolId: BigInt(object.pool_id), - tokenIn: object.token_in, - startTick: BigInt(object.start_tick), - useCurTick: object.use_cur_tick, - boundTick: BigInt(object.bound_tick), - useNoBound: object.use_no_bound - }; + const message = createBaseLiquidityNetInDirectionRequest(); + if (object.pool_id !== undefined && object.pool_id !== null) { + message.poolId = BigInt(object.pool_id); + } + if (object.token_in !== undefined && object.token_in !== null) { + message.tokenIn = object.token_in; + } + if (object.start_tick !== undefined && object.start_tick !== null) { + message.startTick = BigInt(object.start_tick); + } + if (object.use_cur_tick !== undefined && object.use_cur_tick !== null) { + message.useCurTick = object.use_cur_tick; + } + if (object.bound_tick !== undefined && object.bound_tick !== null) { + message.boundTick = BigInt(object.bound_tick); + } + if (object.use_no_bound !== undefined && object.use_no_bound !== null) { + message.useNoBound = object.use_no_bound; + } + return message; }, toAmino(message: LiquidityNetInDirectionRequest): LiquidityNetInDirectionRequestAmino { const obj: any = {}; @@ -1479,15 +1846,28 @@ export const LiquidityNetInDirectionRequest = { }; } }; +GlobalDecoderRegistry.register(LiquidityNetInDirectionRequest.typeUrl, LiquidityNetInDirectionRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(LiquidityNetInDirectionRequest.aminoType, LiquidityNetInDirectionRequest.typeUrl); function createBaseLiquidityNetInDirectionResponse(): LiquidityNetInDirectionResponse { return { liquidityDepths: [], currentTick: BigInt(0), - currentLiquidity: "" + currentLiquidity: "", + currentSqrtPrice: "" }; } export const LiquidityNetInDirectionResponse = { typeUrl: "/osmosis.concentratedliquidity.v1beta1.LiquidityNetInDirectionResponse", + aminoType: "osmosis/concentratedliquidity/liquidity-net-in-direction-response", + is(o: any): o is LiquidityNetInDirectionResponse { + return o && (o.$typeUrl === LiquidityNetInDirectionResponse.typeUrl || Array.isArray(o.liquidityDepths) && (!o.liquidityDepths.length || TickLiquidityNet.is(o.liquidityDepths[0])) && typeof o.currentTick === "bigint" && typeof o.currentLiquidity === "string" && typeof o.currentSqrtPrice === "string"); + }, + isSDK(o: any): o is LiquidityNetInDirectionResponseSDKType { + return o && (o.$typeUrl === LiquidityNetInDirectionResponse.typeUrl || Array.isArray(o.liquidity_depths) && (!o.liquidity_depths.length || TickLiquidityNet.isSDK(o.liquidity_depths[0])) && typeof o.current_tick === "bigint" && typeof o.current_liquidity === "string" && typeof o.current_sqrt_price === "string"); + }, + isAmino(o: any): o is LiquidityNetInDirectionResponseAmino { + return o && (o.$typeUrl === LiquidityNetInDirectionResponse.typeUrl || Array.isArray(o.liquidity_depths) && (!o.liquidity_depths.length || TickLiquidityNet.isAmino(o.liquidity_depths[0])) && typeof o.current_tick === "bigint" && typeof o.current_liquidity === "string" && typeof o.current_sqrt_price === "string"); + }, encode(message: LiquidityNetInDirectionResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.liquidityDepths) { TickLiquidityNet.encode(v!, writer.uint32(10).fork()).ldelim(); @@ -1498,6 +1878,9 @@ export const LiquidityNetInDirectionResponse = { if (message.currentLiquidity !== "") { writer.uint32(26).string(Decimal.fromUserInput(message.currentLiquidity, 18).atomics); } + if (message.currentSqrtPrice !== "") { + writer.uint32(34).string(message.currentSqrtPrice); + } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): LiquidityNetInDirectionResponse { @@ -1516,6 +1899,9 @@ export const LiquidityNetInDirectionResponse = { case 3: message.currentLiquidity = Decimal.fromAtomics(reader.string(), 18).toString(); break; + case 4: + message.currentSqrtPrice = reader.string(); + break; default: reader.skipType(tag & 7); break; @@ -1523,19 +1909,47 @@ export const LiquidityNetInDirectionResponse = { } return message; }, + fromJSON(object: any): LiquidityNetInDirectionResponse { + return { + liquidityDepths: Array.isArray(object?.liquidityDepths) ? object.liquidityDepths.map((e: any) => TickLiquidityNet.fromJSON(e)) : [], + currentTick: isSet(object.currentTick) ? BigInt(object.currentTick.toString()) : BigInt(0), + currentLiquidity: isSet(object.currentLiquidity) ? String(object.currentLiquidity) : "", + currentSqrtPrice: isSet(object.currentSqrtPrice) ? String(object.currentSqrtPrice) : "" + }; + }, + toJSON(message: LiquidityNetInDirectionResponse): unknown { + const obj: any = {}; + if (message.liquidityDepths) { + obj.liquidityDepths = message.liquidityDepths.map(e => e ? TickLiquidityNet.toJSON(e) : undefined); + } else { + obj.liquidityDepths = []; + } + message.currentTick !== undefined && (obj.currentTick = (message.currentTick || BigInt(0)).toString()); + message.currentLiquidity !== undefined && (obj.currentLiquidity = message.currentLiquidity); + message.currentSqrtPrice !== undefined && (obj.currentSqrtPrice = message.currentSqrtPrice); + return obj; + }, fromPartial(object: Partial): LiquidityNetInDirectionResponse { const message = createBaseLiquidityNetInDirectionResponse(); message.liquidityDepths = object.liquidityDepths?.map(e => TickLiquidityNet.fromPartial(e)) || []; message.currentTick = object.currentTick !== undefined && object.currentTick !== null ? BigInt(object.currentTick.toString()) : BigInt(0); message.currentLiquidity = object.currentLiquidity ?? ""; + message.currentSqrtPrice = object.currentSqrtPrice ?? ""; return message; }, fromAmino(object: LiquidityNetInDirectionResponseAmino): LiquidityNetInDirectionResponse { - return { - liquidityDepths: Array.isArray(object?.liquidity_depths) ? object.liquidity_depths.map((e: any) => TickLiquidityNet.fromAmino(e)) : [], - currentTick: BigInt(object.current_tick), - currentLiquidity: object.current_liquidity - }; + const message = createBaseLiquidityNetInDirectionResponse(); + message.liquidityDepths = object.liquidity_depths?.map(e => TickLiquidityNet.fromAmino(e)) || []; + if (object.current_tick !== undefined && object.current_tick !== null) { + message.currentTick = BigInt(object.current_tick); + } + if (object.current_liquidity !== undefined && object.current_liquidity !== null) { + message.currentLiquidity = object.current_liquidity; + } + if (object.current_sqrt_price !== undefined && object.current_sqrt_price !== null) { + message.currentSqrtPrice = object.current_sqrt_price; + } + return message; }, toAmino(message: LiquidityNetInDirectionResponse): LiquidityNetInDirectionResponseAmino { const obj: any = {}; @@ -1546,6 +1960,7 @@ export const LiquidityNetInDirectionResponse = { } obj.current_tick = message.currentTick ? message.currentTick.toString() : undefined; obj.current_liquidity = message.currentLiquidity; + obj.current_sqrt_price = message.currentSqrtPrice; return obj; }, fromAminoMsg(object: LiquidityNetInDirectionResponseAminoMsg): LiquidityNetInDirectionResponse { @@ -1570,6 +1985,8 @@ export const LiquidityNetInDirectionResponse = { }; } }; +GlobalDecoderRegistry.register(LiquidityNetInDirectionResponse.typeUrl, LiquidityNetInDirectionResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(LiquidityNetInDirectionResponse.aminoType, LiquidityNetInDirectionResponse.typeUrl); function createBaseLiquidityPerTickRangeRequest(): LiquidityPerTickRangeRequest { return { poolId: BigInt(0) @@ -1577,6 +1994,16 @@ function createBaseLiquidityPerTickRangeRequest(): LiquidityPerTickRangeRequest } export const LiquidityPerTickRangeRequest = { typeUrl: "/osmosis.concentratedliquidity.v1beta1.LiquidityPerTickRangeRequest", + aminoType: "osmosis/concentratedliquidity/liquidity-per-tick-range-request", + is(o: any): o is LiquidityPerTickRangeRequest { + return o && (o.$typeUrl === LiquidityPerTickRangeRequest.typeUrl || typeof o.poolId === "bigint"); + }, + isSDK(o: any): o is LiquidityPerTickRangeRequestSDKType { + return o && (o.$typeUrl === LiquidityPerTickRangeRequest.typeUrl || typeof o.pool_id === "bigint"); + }, + isAmino(o: any): o is LiquidityPerTickRangeRequestAmino { + return o && (o.$typeUrl === LiquidityPerTickRangeRequest.typeUrl || typeof o.pool_id === "bigint"); + }, encode(message: LiquidityPerTickRangeRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.poolId !== BigInt(0)) { writer.uint32(8).uint64(message.poolId); @@ -1600,15 +2027,27 @@ export const LiquidityPerTickRangeRequest = { } return message; }, + fromJSON(object: any): LiquidityPerTickRangeRequest { + return { + poolId: isSet(object.poolId) ? BigInt(object.poolId.toString()) : BigInt(0) + }; + }, + toJSON(message: LiquidityPerTickRangeRequest): unknown { + const obj: any = {}; + message.poolId !== undefined && (obj.poolId = (message.poolId || BigInt(0)).toString()); + return obj; + }, fromPartial(object: Partial): LiquidityPerTickRangeRequest { const message = createBaseLiquidityPerTickRangeRequest(); message.poolId = object.poolId !== undefined && object.poolId !== null ? BigInt(object.poolId.toString()) : BigInt(0); return message; }, fromAmino(object: LiquidityPerTickRangeRequestAmino): LiquidityPerTickRangeRequest { - return { - poolId: BigInt(object.pool_id) - }; + const message = createBaseLiquidityPerTickRangeRequest(); + if (object.pool_id !== undefined && object.pool_id !== null) { + message.poolId = BigInt(object.pool_id); + } + return message; }, toAmino(message: LiquidityPerTickRangeRequest): LiquidityPerTickRangeRequestAmino { const obj: any = {}; @@ -1637,17 +2076,33 @@ export const LiquidityPerTickRangeRequest = { }; } }; +GlobalDecoderRegistry.register(LiquidityPerTickRangeRequest.typeUrl, LiquidityPerTickRangeRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(LiquidityPerTickRangeRequest.aminoType, LiquidityPerTickRangeRequest.typeUrl); function createBaseLiquidityPerTickRangeResponse(): LiquidityPerTickRangeResponse { return { - liquidity: [] + liquidity: [], + bucketIndex: BigInt(0) }; } export const LiquidityPerTickRangeResponse = { typeUrl: "/osmosis.concentratedliquidity.v1beta1.LiquidityPerTickRangeResponse", + aminoType: "osmosis/concentratedliquidity/liquidity-per-tick-range-response", + is(o: any): o is LiquidityPerTickRangeResponse { + return o && (o.$typeUrl === LiquidityPerTickRangeResponse.typeUrl || Array.isArray(o.liquidity) && (!o.liquidity.length || LiquidityDepthWithRange.is(o.liquidity[0])) && typeof o.bucketIndex === "bigint"); + }, + isSDK(o: any): o is LiquidityPerTickRangeResponseSDKType { + return o && (o.$typeUrl === LiquidityPerTickRangeResponse.typeUrl || Array.isArray(o.liquidity) && (!o.liquidity.length || LiquidityDepthWithRange.isSDK(o.liquidity[0])) && typeof o.bucket_index === "bigint"); + }, + isAmino(o: any): o is LiquidityPerTickRangeResponseAmino { + return o && (o.$typeUrl === LiquidityPerTickRangeResponse.typeUrl || Array.isArray(o.liquidity) && (!o.liquidity.length || LiquidityDepthWithRange.isAmino(o.liquidity[0])) && typeof o.bucket_index === "bigint"); + }, encode(message: LiquidityPerTickRangeResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.liquidity) { LiquidityDepthWithRange.encode(v!, writer.uint32(10).fork()).ldelim(); } + if (message.bucketIndex !== BigInt(0)) { + writer.uint32(16).int64(message.bucketIndex); + } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): LiquidityPerTickRangeResponse { @@ -1660,6 +2115,9 @@ export const LiquidityPerTickRangeResponse = { case 1: message.liquidity.push(LiquidityDepthWithRange.decode(reader, reader.uint32())); break; + case 2: + message.bucketIndex = reader.int64(); + break; default: reader.skipType(tag & 7); break; @@ -1667,15 +2125,35 @@ export const LiquidityPerTickRangeResponse = { } return message; }, + fromJSON(object: any): LiquidityPerTickRangeResponse { + return { + liquidity: Array.isArray(object?.liquidity) ? object.liquidity.map((e: any) => LiquidityDepthWithRange.fromJSON(e)) : [], + bucketIndex: isSet(object.bucketIndex) ? BigInt(object.bucketIndex.toString()) : BigInt(0) + }; + }, + toJSON(message: LiquidityPerTickRangeResponse): unknown { + const obj: any = {}; + if (message.liquidity) { + obj.liquidity = message.liquidity.map(e => e ? LiquidityDepthWithRange.toJSON(e) : undefined); + } else { + obj.liquidity = []; + } + message.bucketIndex !== undefined && (obj.bucketIndex = (message.bucketIndex || BigInt(0)).toString()); + return obj; + }, fromPartial(object: Partial): LiquidityPerTickRangeResponse { const message = createBaseLiquidityPerTickRangeResponse(); message.liquidity = object.liquidity?.map(e => LiquidityDepthWithRange.fromPartial(e)) || []; + message.bucketIndex = object.bucketIndex !== undefined && object.bucketIndex !== null ? BigInt(object.bucketIndex.toString()) : BigInt(0); return message; }, fromAmino(object: LiquidityPerTickRangeResponseAmino): LiquidityPerTickRangeResponse { - return { - liquidity: Array.isArray(object?.liquidity) ? object.liquidity.map((e: any) => LiquidityDepthWithRange.fromAmino(e)) : [] - }; + const message = createBaseLiquidityPerTickRangeResponse(); + message.liquidity = object.liquidity?.map(e => LiquidityDepthWithRange.fromAmino(e)) || []; + if (object.bucket_index !== undefined && object.bucket_index !== null) { + message.bucketIndex = BigInt(object.bucket_index); + } + return message; }, toAmino(message: LiquidityPerTickRangeResponse): LiquidityPerTickRangeResponseAmino { const obj: any = {}; @@ -1684,6 +2162,7 @@ export const LiquidityPerTickRangeResponse = { } else { obj.liquidity = []; } + obj.bucket_index = message.bucketIndex ? message.bucketIndex.toString() : undefined; return obj; }, fromAminoMsg(object: LiquidityPerTickRangeResponseAminoMsg): LiquidityPerTickRangeResponse { @@ -1708,6 +2187,8 @@ export const LiquidityPerTickRangeResponse = { }; } }; +GlobalDecoderRegistry.register(LiquidityPerTickRangeResponse.typeUrl, LiquidityPerTickRangeResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(LiquidityPerTickRangeResponse.aminoType, LiquidityPerTickRangeResponse.typeUrl); function createBaseClaimableSpreadRewardsRequest(): ClaimableSpreadRewardsRequest { return { positionId: BigInt(0) @@ -1715,7 +2196,17 @@ function createBaseClaimableSpreadRewardsRequest(): ClaimableSpreadRewardsReques } export const ClaimableSpreadRewardsRequest = { typeUrl: "/osmosis.concentratedliquidity.v1beta1.ClaimableSpreadRewardsRequest", - encode(message: ClaimableSpreadRewardsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + aminoType: "osmosis/concentratedliquidity/claimable-spread-rewards-request", + is(o: any): o is ClaimableSpreadRewardsRequest { + return o && (o.$typeUrl === ClaimableSpreadRewardsRequest.typeUrl || typeof o.positionId === "bigint"); + }, + isSDK(o: any): o is ClaimableSpreadRewardsRequestSDKType { + return o && (o.$typeUrl === ClaimableSpreadRewardsRequest.typeUrl || typeof o.position_id === "bigint"); + }, + isAmino(o: any): o is ClaimableSpreadRewardsRequestAmino { + return o && (o.$typeUrl === ClaimableSpreadRewardsRequest.typeUrl || typeof o.position_id === "bigint"); + }, + encode(message: ClaimableSpreadRewardsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.positionId !== BigInt(0)) { writer.uint32(8).uint64(message.positionId); } @@ -1738,15 +2229,27 @@ export const ClaimableSpreadRewardsRequest = { } return message; }, + fromJSON(object: any): ClaimableSpreadRewardsRequest { + return { + positionId: isSet(object.positionId) ? BigInt(object.positionId.toString()) : BigInt(0) + }; + }, + toJSON(message: ClaimableSpreadRewardsRequest): unknown { + const obj: any = {}; + message.positionId !== undefined && (obj.positionId = (message.positionId || BigInt(0)).toString()); + return obj; + }, fromPartial(object: Partial): ClaimableSpreadRewardsRequest { const message = createBaseClaimableSpreadRewardsRequest(); message.positionId = object.positionId !== undefined && object.positionId !== null ? BigInt(object.positionId.toString()) : BigInt(0); return message; }, fromAmino(object: ClaimableSpreadRewardsRequestAmino): ClaimableSpreadRewardsRequest { - return { - positionId: BigInt(object.position_id) - }; + const message = createBaseClaimableSpreadRewardsRequest(); + if (object.position_id !== undefined && object.position_id !== null) { + message.positionId = BigInt(object.position_id); + } + return message; }, toAmino(message: ClaimableSpreadRewardsRequest): ClaimableSpreadRewardsRequestAmino { const obj: any = {}; @@ -1775,6 +2278,8 @@ export const ClaimableSpreadRewardsRequest = { }; } }; +GlobalDecoderRegistry.register(ClaimableSpreadRewardsRequest.typeUrl, ClaimableSpreadRewardsRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(ClaimableSpreadRewardsRequest.aminoType, ClaimableSpreadRewardsRequest.typeUrl); function createBaseClaimableSpreadRewardsResponse(): ClaimableSpreadRewardsResponse { return { claimableSpreadRewards: [] @@ -1782,6 +2287,16 @@ function createBaseClaimableSpreadRewardsResponse(): ClaimableSpreadRewardsRespo } export const ClaimableSpreadRewardsResponse = { typeUrl: "/osmosis.concentratedliquidity.v1beta1.ClaimableSpreadRewardsResponse", + aminoType: "osmosis/concentratedliquidity/claimable-spread-rewards-response", + is(o: any): o is ClaimableSpreadRewardsResponse { + return o && (o.$typeUrl === ClaimableSpreadRewardsResponse.typeUrl || Array.isArray(o.claimableSpreadRewards) && (!o.claimableSpreadRewards.length || Coin.is(o.claimableSpreadRewards[0]))); + }, + isSDK(o: any): o is ClaimableSpreadRewardsResponseSDKType { + return o && (o.$typeUrl === ClaimableSpreadRewardsResponse.typeUrl || Array.isArray(o.claimable_spread_rewards) && (!o.claimable_spread_rewards.length || Coin.isSDK(o.claimable_spread_rewards[0]))); + }, + isAmino(o: any): o is ClaimableSpreadRewardsResponseAmino { + return o && (o.$typeUrl === ClaimableSpreadRewardsResponse.typeUrl || Array.isArray(o.claimable_spread_rewards) && (!o.claimable_spread_rewards.length || Coin.isAmino(o.claimable_spread_rewards[0]))); + }, encode(message: ClaimableSpreadRewardsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.claimableSpreadRewards) { Coin.encode(v!, writer.uint32(10).fork()).ldelim(); @@ -1805,15 +2320,29 @@ export const ClaimableSpreadRewardsResponse = { } return message; }, + fromJSON(object: any): ClaimableSpreadRewardsResponse { + return { + claimableSpreadRewards: Array.isArray(object?.claimableSpreadRewards) ? object.claimableSpreadRewards.map((e: any) => Coin.fromJSON(e)) : [] + }; + }, + toJSON(message: ClaimableSpreadRewardsResponse): unknown { + const obj: any = {}; + if (message.claimableSpreadRewards) { + obj.claimableSpreadRewards = message.claimableSpreadRewards.map(e => e ? Coin.toJSON(e) : undefined); + } else { + obj.claimableSpreadRewards = []; + } + return obj; + }, fromPartial(object: Partial): ClaimableSpreadRewardsResponse { const message = createBaseClaimableSpreadRewardsResponse(); message.claimableSpreadRewards = object.claimableSpreadRewards?.map(e => Coin.fromPartial(e)) || []; return message; }, fromAmino(object: ClaimableSpreadRewardsResponseAmino): ClaimableSpreadRewardsResponse { - return { - claimableSpreadRewards: Array.isArray(object?.claimable_spread_rewards) ? object.claimable_spread_rewards.map((e: any) => Coin.fromAmino(e)) : [] - }; + const message = createBaseClaimableSpreadRewardsResponse(); + message.claimableSpreadRewards = object.claimable_spread_rewards?.map(e => Coin.fromAmino(e)) || []; + return message; }, toAmino(message: ClaimableSpreadRewardsResponse): ClaimableSpreadRewardsResponseAmino { const obj: any = {}; @@ -1846,6 +2375,8 @@ export const ClaimableSpreadRewardsResponse = { }; } }; +GlobalDecoderRegistry.register(ClaimableSpreadRewardsResponse.typeUrl, ClaimableSpreadRewardsResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(ClaimableSpreadRewardsResponse.aminoType, ClaimableSpreadRewardsResponse.typeUrl); function createBaseClaimableIncentivesRequest(): ClaimableIncentivesRequest { return { positionId: BigInt(0) @@ -1853,6 +2384,16 @@ function createBaseClaimableIncentivesRequest(): ClaimableIncentivesRequest { } export const ClaimableIncentivesRequest = { typeUrl: "/osmosis.concentratedliquidity.v1beta1.ClaimableIncentivesRequest", + aminoType: "osmosis/concentratedliquidity/claimable-incentives-request", + is(o: any): o is ClaimableIncentivesRequest { + return o && (o.$typeUrl === ClaimableIncentivesRequest.typeUrl || typeof o.positionId === "bigint"); + }, + isSDK(o: any): o is ClaimableIncentivesRequestSDKType { + return o && (o.$typeUrl === ClaimableIncentivesRequest.typeUrl || typeof o.position_id === "bigint"); + }, + isAmino(o: any): o is ClaimableIncentivesRequestAmino { + return o && (o.$typeUrl === ClaimableIncentivesRequest.typeUrl || typeof o.position_id === "bigint"); + }, encode(message: ClaimableIncentivesRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.positionId !== BigInt(0)) { writer.uint32(8).uint64(message.positionId); @@ -1876,15 +2417,27 @@ export const ClaimableIncentivesRequest = { } return message; }, + fromJSON(object: any): ClaimableIncentivesRequest { + return { + positionId: isSet(object.positionId) ? BigInt(object.positionId.toString()) : BigInt(0) + }; + }, + toJSON(message: ClaimableIncentivesRequest): unknown { + const obj: any = {}; + message.positionId !== undefined && (obj.positionId = (message.positionId || BigInt(0)).toString()); + return obj; + }, fromPartial(object: Partial): ClaimableIncentivesRequest { const message = createBaseClaimableIncentivesRequest(); message.positionId = object.positionId !== undefined && object.positionId !== null ? BigInt(object.positionId.toString()) : BigInt(0); return message; }, fromAmino(object: ClaimableIncentivesRequestAmino): ClaimableIncentivesRequest { - return { - positionId: BigInt(object.position_id) - }; + const message = createBaseClaimableIncentivesRequest(); + if (object.position_id !== undefined && object.position_id !== null) { + message.positionId = BigInt(object.position_id); + } + return message; }, toAmino(message: ClaimableIncentivesRequest): ClaimableIncentivesRequestAmino { const obj: any = {}; @@ -1913,6 +2466,8 @@ export const ClaimableIncentivesRequest = { }; } }; +GlobalDecoderRegistry.register(ClaimableIncentivesRequest.typeUrl, ClaimableIncentivesRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(ClaimableIncentivesRequest.aminoType, ClaimableIncentivesRequest.typeUrl); function createBaseClaimableIncentivesResponse(): ClaimableIncentivesResponse { return { claimableIncentives: [], @@ -1921,6 +2476,16 @@ function createBaseClaimableIncentivesResponse(): ClaimableIncentivesResponse { } export const ClaimableIncentivesResponse = { typeUrl: "/osmosis.concentratedliquidity.v1beta1.ClaimableIncentivesResponse", + aminoType: "osmosis/concentratedliquidity/claimable-incentives-response", + is(o: any): o is ClaimableIncentivesResponse { + return o && (o.$typeUrl === ClaimableIncentivesResponse.typeUrl || Array.isArray(o.claimableIncentives) && (!o.claimableIncentives.length || Coin.is(o.claimableIncentives[0])) && Array.isArray(o.forfeitedIncentives) && (!o.forfeitedIncentives.length || Coin.is(o.forfeitedIncentives[0]))); + }, + isSDK(o: any): o is ClaimableIncentivesResponseSDKType { + return o && (o.$typeUrl === ClaimableIncentivesResponse.typeUrl || Array.isArray(o.claimable_incentives) && (!o.claimable_incentives.length || Coin.isSDK(o.claimable_incentives[0])) && Array.isArray(o.forfeited_incentives) && (!o.forfeited_incentives.length || Coin.isSDK(o.forfeited_incentives[0]))); + }, + isAmino(o: any): o is ClaimableIncentivesResponseAmino { + return o && (o.$typeUrl === ClaimableIncentivesResponse.typeUrl || Array.isArray(o.claimable_incentives) && (!o.claimable_incentives.length || Coin.isAmino(o.claimable_incentives[0])) && Array.isArray(o.forfeited_incentives) && (!o.forfeited_incentives.length || Coin.isAmino(o.forfeited_incentives[0]))); + }, encode(message: ClaimableIncentivesResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.claimableIncentives) { Coin.encode(v!, writer.uint32(10).fork()).ldelim(); @@ -1950,6 +2515,26 @@ export const ClaimableIncentivesResponse = { } return message; }, + fromJSON(object: any): ClaimableIncentivesResponse { + return { + claimableIncentives: Array.isArray(object?.claimableIncentives) ? object.claimableIncentives.map((e: any) => Coin.fromJSON(e)) : [], + forfeitedIncentives: Array.isArray(object?.forfeitedIncentives) ? object.forfeitedIncentives.map((e: any) => Coin.fromJSON(e)) : [] + }; + }, + toJSON(message: ClaimableIncentivesResponse): unknown { + const obj: any = {}; + if (message.claimableIncentives) { + obj.claimableIncentives = message.claimableIncentives.map(e => e ? Coin.toJSON(e) : undefined); + } else { + obj.claimableIncentives = []; + } + if (message.forfeitedIncentives) { + obj.forfeitedIncentives = message.forfeitedIncentives.map(e => e ? Coin.toJSON(e) : undefined); + } else { + obj.forfeitedIncentives = []; + } + return obj; + }, fromPartial(object: Partial): ClaimableIncentivesResponse { const message = createBaseClaimableIncentivesResponse(); message.claimableIncentives = object.claimableIncentives?.map(e => Coin.fromPartial(e)) || []; @@ -1957,10 +2542,10 @@ export const ClaimableIncentivesResponse = { return message; }, fromAmino(object: ClaimableIncentivesResponseAmino): ClaimableIncentivesResponse { - return { - claimableIncentives: Array.isArray(object?.claimable_incentives) ? object.claimable_incentives.map((e: any) => Coin.fromAmino(e)) : [], - forfeitedIncentives: Array.isArray(object?.forfeited_incentives) ? object.forfeited_incentives.map((e: any) => Coin.fromAmino(e)) : [] - }; + const message = createBaseClaimableIncentivesResponse(); + message.claimableIncentives = object.claimable_incentives?.map(e => Coin.fromAmino(e)) || []; + message.forfeitedIncentives = object.forfeited_incentives?.map(e => Coin.fromAmino(e)) || []; + return message; }, toAmino(message: ClaimableIncentivesResponse): ClaimableIncentivesResponseAmino { const obj: any = {}; @@ -1998,6 +2583,8 @@ export const ClaimableIncentivesResponse = { }; } }; +GlobalDecoderRegistry.register(ClaimableIncentivesResponse.typeUrl, ClaimableIncentivesResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(ClaimableIncentivesResponse.aminoType, ClaimableIncentivesResponse.typeUrl); function createBasePoolAccumulatorRewardsRequest(): PoolAccumulatorRewardsRequest { return { poolId: BigInt(0) @@ -2005,6 +2592,16 @@ function createBasePoolAccumulatorRewardsRequest(): PoolAccumulatorRewardsReques } export const PoolAccumulatorRewardsRequest = { typeUrl: "/osmosis.concentratedliquidity.v1beta1.PoolAccumulatorRewardsRequest", + aminoType: "osmosis/concentratedliquidity/pool-accumulator-rewards-request", + is(o: any): o is PoolAccumulatorRewardsRequest { + return o && (o.$typeUrl === PoolAccumulatorRewardsRequest.typeUrl || typeof o.poolId === "bigint"); + }, + isSDK(o: any): o is PoolAccumulatorRewardsRequestSDKType { + return o && (o.$typeUrl === PoolAccumulatorRewardsRequest.typeUrl || typeof o.pool_id === "bigint"); + }, + isAmino(o: any): o is PoolAccumulatorRewardsRequestAmino { + return o && (o.$typeUrl === PoolAccumulatorRewardsRequest.typeUrl || typeof o.pool_id === "bigint"); + }, encode(message: PoolAccumulatorRewardsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.poolId !== BigInt(0)) { writer.uint32(8).uint64(message.poolId); @@ -2028,15 +2625,27 @@ export const PoolAccumulatorRewardsRequest = { } return message; }, + fromJSON(object: any): PoolAccumulatorRewardsRequest { + return { + poolId: isSet(object.poolId) ? BigInt(object.poolId.toString()) : BigInt(0) + }; + }, + toJSON(message: PoolAccumulatorRewardsRequest): unknown { + const obj: any = {}; + message.poolId !== undefined && (obj.poolId = (message.poolId || BigInt(0)).toString()); + return obj; + }, fromPartial(object: Partial): PoolAccumulatorRewardsRequest { const message = createBasePoolAccumulatorRewardsRequest(); message.poolId = object.poolId !== undefined && object.poolId !== null ? BigInt(object.poolId.toString()) : BigInt(0); return message; }, fromAmino(object: PoolAccumulatorRewardsRequestAmino): PoolAccumulatorRewardsRequest { - return { - poolId: BigInt(object.pool_id) - }; + const message = createBasePoolAccumulatorRewardsRequest(); + if (object.pool_id !== undefined && object.pool_id !== null) { + message.poolId = BigInt(object.pool_id); + } + return message; }, toAmino(message: PoolAccumulatorRewardsRequest): PoolAccumulatorRewardsRequestAmino { const obj: any = {}; @@ -2065,6 +2674,8 @@ export const PoolAccumulatorRewardsRequest = { }; } }; +GlobalDecoderRegistry.register(PoolAccumulatorRewardsRequest.typeUrl, PoolAccumulatorRewardsRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(PoolAccumulatorRewardsRequest.aminoType, PoolAccumulatorRewardsRequest.typeUrl); function createBasePoolAccumulatorRewardsResponse(): PoolAccumulatorRewardsResponse { return { spreadRewardGrowthGlobal: [], @@ -2073,6 +2684,16 @@ function createBasePoolAccumulatorRewardsResponse(): PoolAccumulatorRewardsRespo } export const PoolAccumulatorRewardsResponse = { typeUrl: "/osmosis.concentratedliquidity.v1beta1.PoolAccumulatorRewardsResponse", + aminoType: "osmosis/concentratedliquidity/pool-accumulator-rewards-response", + is(o: any): o is PoolAccumulatorRewardsResponse { + return o && (o.$typeUrl === PoolAccumulatorRewardsResponse.typeUrl || Array.isArray(o.spreadRewardGrowthGlobal) && (!o.spreadRewardGrowthGlobal.length || DecCoin.is(o.spreadRewardGrowthGlobal[0])) && Array.isArray(o.uptimeGrowthGlobal) && (!o.uptimeGrowthGlobal.length || UptimeTracker.is(o.uptimeGrowthGlobal[0]))); + }, + isSDK(o: any): o is PoolAccumulatorRewardsResponseSDKType { + return o && (o.$typeUrl === PoolAccumulatorRewardsResponse.typeUrl || Array.isArray(o.spread_reward_growth_global) && (!o.spread_reward_growth_global.length || DecCoin.isSDK(o.spread_reward_growth_global[0])) && Array.isArray(o.uptime_growth_global) && (!o.uptime_growth_global.length || UptimeTracker.isSDK(o.uptime_growth_global[0]))); + }, + isAmino(o: any): o is PoolAccumulatorRewardsResponseAmino { + return o && (o.$typeUrl === PoolAccumulatorRewardsResponse.typeUrl || Array.isArray(o.spread_reward_growth_global) && (!o.spread_reward_growth_global.length || DecCoin.isAmino(o.spread_reward_growth_global[0])) && Array.isArray(o.uptime_growth_global) && (!o.uptime_growth_global.length || UptimeTracker.isAmino(o.uptime_growth_global[0]))); + }, encode(message: PoolAccumulatorRewardsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.spreadRewardGrowthGlobal) { DecCoin.encode(v!, writer.uint32(10).fork()).ldelim(); @@ -2102,6 +2723,26 @@ export const PoolAccumulatorRewardsResponse = { } return message; }, + fromJSON(object: any): PoolAccumulatorRewardsResponse { + return { + spreadRewardGrowthGlobal: Array.isArray(object?.spreadRewardGrowthGlobal) ? object.spreadRewardGrowthGlobal.map((e: any) => DecCoin.fromJSON(e)) : [], + uptimeGrowthGlobal: Array.isArray(object?.uptimeGrowthGlobal) ? object.uptimeGrowthGlobal.map((e: any) => UptimeTracker.fromJSON(e)) : [] + }; + }, + toJSON(message: PoolAccumulatorRewardsResponse): unknown { + const obj: any = {}; + if (message.spreadRewardGrowthGlobal) { + obj.spreadRewardGrowthGlobal = message.spreadRewardGrowthGlobal.map(e => e ? DecCoin.toJSON(e) : undefined); + } else { + obj.spreadRewardGrowthGlobal = []; + } + if (message.uptimeGrowthGlobal) { + obj.uptimeGrowthGlobal = message.uptimeGrowthGlobal.map(e => e ? UptimeTracker.toJSON(e) : undefined); + } else { + obj.uptimeGrowthGlobal = []; + } + return obj; + }, fromPartial(object: Partial): PoolAccumulatorRewardsResponse { const message = createBasePoolAccumulatorRewardsResponse(); message.spreadRewardGrowthGlobal = object.spreadRewardGrowthGlobal?.map(e => DecCoin.fromPartial(e)) || []; @@ -2109,10 +2750,10 @@ export const PoolAccumulatorRewardsResponse = { return message; }, fromAmino(object: PoolAccumulatorRewardsResponseAmino): PoolAccumulatorRewardsResponse { - return { - spreadRewardGrowthGlobal: Array.isArray(object?.spread_reward_growth_global) ? object.spread_reward_growth_global.map((e: any) => DecCoin.fromAmino(e)) : [], - uptimeGrowthGlobal: Array.isArray(object?.uptime_growth_global) ? object.uptime_growth_global.map((e: any) => UptimeTracker.fromAmino(e)) : [] - }; + const message = createBasePoolAccumulatorRewardsResponse(); + message.spreadRewardGrowthGlobal = object.spread_reward_growth_global?.map(e => DecCoin.fromAmino(e)) || []; + message.uptimeGrowthGlobal = object.uptime_growth_global?.map(e => UptimeTracker.fromAmino(e)) || []; + return message; }, toAmino(message: PoolAccumulatorRewardsResponse): PoolAccumulatorRewardsResponseAmino { const obj: any = {}; @@ -2150,6 +2791,8 @@ export const PoolAccumulatorRewardsResponse = { }; } }; +GlobalDecoderRegistry.register(PoolAccumulatorRewardsResponse.typeUrl, PoolAccumulatorRewardsResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(PoolAccumulatorRewardsResponse.aminoType, PoolAccumulatorRewardsResponse.typeUrl); function createBaseTickAccumulatorTrackersRequest(): TickAccumulatorTrackersRequest { return { poolId: BigInt(0), @@ -2158,6 +2801,16 @@ function createBaseTickAccumulatorTrackersRequest(): TickAccumulatorTrackersRequ } export const TickAccumulatorTrackersRequest = { typeUrl: "/osmosis.concentratedliquidity.v1beta1.TickAccumulatorTrackersRequest", + aminoType: "osmosis/concentratedliquidity/tick-accumulator-trackers-request", + is(o: any): o is TickAccumulatorTrackersRequest { + return o && (o.$typeUrl === TickAccumulatorTrackersRequest.typeUrl || typeof o.poolId === "bigint" && typeof o.tickIndex === "bigint"); + }, + isSDK(o: any): o is TickAccumulatorTrackersRequestSDKType { + return o && (o.$typeUrl === TickAccumulatorTrackersRequest.typeUrl || typeof o.pool_id === "bigint" && typeof o.tick_index === "bigint"); + }, + isAmino(o: any): o is TickAccumulatorTrackersRequestAmino { + return o && (o.$typeUrl === TickAccumulatorTrackersRequest.typeUrl || typeof o.pool_id === "bigint" && typeof o.tick_index === "bigint"); + }, encode(message: TickAccumulatorTrackersRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.poolId !== BigInt(0)) { writer.uint32(8).uint64(message.poolId); @@ -2187,6 +2840,18 @@ export const TickAccumulatorTrackersRequest = { } return message; }, + fromJSON(object: any): TickAccumulatorTrackersRequest { + return { + poolId: isSet(object.poolId) ? BigInt(object.poolId.toString()) : BigInt(0), + tickIndex: isSet(object.tickIndex) ? BigInt(object.tickIndex.toString()) : BigInt(0) + }; + }, + toJSON(message: TickAccumulatorTrackersRequest): unknown { + const obj: any = {}; + message.poolId !== undefined && (obj.poolId = (message.poolId || BigInt(0)).toString()); + message.tickIndex !== undefined && (obj.tickIndex = (message.tickIndex || BigInt(0)).toString()); + return obj; + }, fromPartial(object: Partial): TickAccumulatorTrackersRequest { const message = createBaseTickAccumulatorTrackersRequest(); message.poolId = object.poolId !== undefined && object.poolId !== null ? BigInt(object.poolId.toString()) : BigInt(0); @@ -2194,10 +2859,14 @@ export const TickAccumulatorTrackersRequest = { return message; }, fromAmino(object: TickAccumulatorTrackersRequestAmino): TickAccumulatorTrackersRequest { - return { - poolId: BigInt(object.pool_id), - tickIndex: BigInt(object.tick_index) - }; + const message = createBaseTickAccumulatorTrackersRequest(); + if (object.pool_id !== undefined && object.pool_id !== null) { + message.poolId = BigInt(object.pool_id); + } + if (object.tick_index !== undefined && object.tick_index !== null) { + message.tickIndex = BigInt(object.tick_index); + } + return message; }, toAmino(message: TickAccumulatorTrackersRequest): TickAccumulatorTrackersRequestAmino { const obj: any = {}; @@ -2227,6 +2896,8 @@ export const TickAccumulatorTrackersRequest = { }; } }; +GlobalDecoderRegistry.register(TickAccumulatorTrackersRequest.typeUrl, TickAccumulatorTrackersRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(TickAccumulatorTrackersRequest.aminoType, TickAccumulatorTrackersRequest.typeUrl); function createBaseTickAccumulatorTrackersResponse(): TickAccumulatorTrackersResponse { return { spreadRewardGrowthOppositeDirectionOfLastTraversal: [], @@ -2235,6 +2906,16 @@ function createBaseTickAccumulatorTrackersResponse(): TickAccumulatorTrackersRes } export const TickAccumulatorTrackersResponse = { typeUrl: "/osmosis.concentratedliquidity.v1beta1.TickAccumulatorTrackersResponse", + aminoType: "osmosis/concentratedliquidity/tick-accumulator-trackers-response", + is(o: any): o is TickAccumulatorTrackersResponse { + return o && (o.$typeUrl === TickAccumulatorTrackersResponse.typeUrl || Array.isArray(o.spreadRewardGrowthOppositeDirectionOfLastTraversal) && (!o.spreadRewardGrowthOppositeDirectionOfLastTraversal.length || DecCoin.is(o.spreadRewardGrowthOppositeDirectionOfLastTraversal[0])) && Array.isArray(o.uptimeTrackers) && (!o.uptimeTrackers.length || UptimeTracker.is(o.uptimeTrackers[0]))); + }, + isSDK(o: any): o is TickAccumulatorTrackersResponseSDKType { + return o && (o.$typeUrl === TickAccumulatorTrackersResponse.typeUrl || Array.isArray(o.spread_reward_growth_opposite_direction_of_last_traversal) && (!o.spread_reward_growth_opposite_direction_of_last_traversal.length || DecCoin.isSDK(o.spread_reward_growth_opposite_direction_of_last_traversal[0])) && Array.isArray(o.uptime_trackers) && (!o.uptime_trackers.length || UptimeTracker.isSDK(o.uptime_trackers[0]))); + }, + isAmino(o: any): o is TickAccumulatorTrackersResponseAmino { + return o && (o.$typeUrl === TickAccumulatorTrackersResponse.typeUrl || Array.isArray(o.spread_reward_growth_opposite_direction_of_last_traversal) && (!o.spread_reward_growth_opposite_direction_of_last_traversal.length || DecCoin.isAmino(o.spread_reward_growth_opposite_direction_of_last_traversal[0])) && Array.isArray(o.uptime_trackers) && (!o.uptime_trackers.length || UptimeTracker.isAmino(o.uptime_trackers[0]))); + }, encode(message: TickAccumulatorTrackersResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.spreadRewardGrowthOppositeDirectionOfLastTraversal) { DecCoin.encode(v!, writer.uint32(10).fork()).ldelim(); @@ -2264,6 +2945,26 @@ export const TickAccumulatorTrackersResponse = { } return message; }, + fromJSON(object: any): TickAccumulatorTrackersResponse { + return { + spreadRewardGrowthOppositeDirectionOfLastTraversal: Array.isArray(object?.spreadRewardGrowthOppositeDirectionOfLastTraversal) ? object.spreadRewardGrowthOppositeDirectionOfLastTraversal.map((e: any) => DecCoin.fromJSON(e)) : [], + uptimeTrackers: Array.isArray(object?.uptimeTrackers) ? object.uptimeTrackers.map((e: any) => UptimeTracker.fromJSON(e)) : [] + }; + }, + toJSON(message: TickAccumulatorTrackersResponse): unknown { + const obj: any = {}; + if (message.spreadRewardGrowthOppositeDirectionOfLastTraversal) { + obj.spreadRewardGrowthOppositeDirectionOfLastTraversal = message.spreadRewardGrowthOppositeDirectionOfLastTraversal.map(e => e ? DecCoin.toJSON(e) : undefined); + } else { + obj.spreadRewardGrowthOppositeDirectionOfLastTraversal = []; + } + if (message.uptimeTrackers) { + obj.uptimeTrackers = message.uptimeTrackers.map(e => e ? UptimeTracker.toJSON(e) : undefined); + } else { + obj.uptimeTrackers = []; + } + return obj; + }, fromPartial(object: Partial): TickAccumulatorTrackersResponse { const message = createBaseTickAccumulatorTrackersResponse(); message.spreadRewardGrowthOppositeDirectionOfLastTraversal = object.spreadRewardGrowthOppositeDirectionOfLastTraversal?.map(e => DecCoin.fromPartial(e)) || []; @@ -2271,10 +2972,10 @@ export const TickAccumulatorTrackersResponse = { return message; }, fromAmino(object: TickAccumulatorTrackersResponseAmino): TickAccumulatorTrackersResponse { - return { - spreadRewardGrowthOppositeDirectionOfLastTraversal: Array.isArray(object?.spread_reward_growth_opposite_direction_of_last_traversal) ? object.spread_reward_growth_opposite_direction_of_last_traversal.map((e: any) => DecCoin.fromAmino(e)) : [], - uptimeTrackers: Array.isArray(object?.uptime_trackers) ? object.uptime_trackers.map((e: any) => UptimeTracker.fromAmino(e)) : [] - }; + const message = createBaseTickAccumulatorTrackersResponse(); + message.spreadRewardGrowthOppositeDirectionOfLastTraversal = object.spread_reward_growth_opposite_direction_of_last_traversal?.map(e => DecCoin.fromAmino(e)) || []; + message.uptimeTrackers = object.uptime_trackers?.map(e => UptimeTracker.fromAmino(e)) || []; + return message; }, toAmino(message: TickAccumulatorTrackersResponse): TickAccumulatorTrackersResponseAmino { const obj: any = {}; @@ -2312,14 +3013,26 @@ export const TickAccumulatorTrackersResponse = { }; } }; +GlobalDecoderRegistry.register(TickAccumulatorTrackersResponse.typeUrl, TickAccumulatorTrackersResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(TickAccumulatorTrackersResponse.aminoType, TickAccumulatorTrackersResponse.typeUrl); function createBaseIncentiveRecordsRequest(): IncentiveRecordsRequest { return { poolId: BigInt(0), - pagination: PageRequest.fromPartial({}) + pagination: undefined }; } export const IncentiveRecordsRequest = { typeUrl: "/osmosis.concentratedliquidity.v1beta1.IncentiveRecordsRequest", + aminoType: "osmosis/concentratedliquidity/incentive-records-request", + is(o: any): o is IncentiveRecordsRequest { + return o && (o.$typeUrl === IncentiveRecordsRequest.typeUrl || typeof o.poolId === "bigint"); + }, + isSDK(o: any): o is IncentiveRecordsRequestSDKType { + return o && (o.$typeUrl === IncentiveRecordsRequest.typeUrl || typeof o.pool_id === "bigint"); + }, + isAmino(o: any): o is IncentiveRecordsRequestAmino { + return o && (o.$typeUrl === IncentiveRecordsRequest.typeUrl || typeof o.pool_id === "bigint"); + }, encode(message: IncentiveRecordsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.poolId !== BigInt(0)) { writer.uint32(8).uint64(message.poolId); @@ -2349,6 +3062,18 @@ export const IncentiveRecordsRequest = { } return message; }, + fromJSON(object: any): IncentiveRecordsRequest { + return { + poolId: isSet(object.poolId) ? BigInt(object.poolId.toString()) : BigInt(0), + pagination: isSet(object.pagination) ? PageRequest.fromJSON(object.pagination) : undefined + }; + }, + toJSON(message: IncentiveRecordsRequest): unknown { + const obj: any = {}; + message.poolId !== undefined && (obj.poolId = (message.poolId || BigInt(0)).toString()); + message.pagination !== undefined && (obj.pagination = message.pagination ? PageRequest.toJSON(message.pagination) : undefined); + return obj; + }, fromPartial(object: Partial): IncentiveRecordsRequest { const message = createBaseIncentiveRecordsRequest(); message.poolId = object.poolId !== undefined && object.poolId !== null ? BigInt(object.poolId.toString()) : BigInt(0); @@ -2356,10 +3081,14 @@ export const IncentiveRecordsRequest = { return message; }, fromAmino(object: IncentiveRecordsRequestAmino): IncentiveRecordsRequest { - return { - poolId: BigInt(object.pool_id), - pagination: object?.pagination ? PageRequest.fromAmino(object.pagination) : undefined - }; + const message = createBaseIncentiveRecordsRequest(); + if (object.pool_id !== undefined && object.pool_id !== null) { + message.poolId = BigInt(object.pool_id); + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromAmino(object.pagination); + } + return message; }, toAmino(message: IncentiveRecordsRequest): IncentiveRecordsRequestAmino { const obj: any = {}; @@ -2389,14 +3118,26 @@ export const IncentiveRecordsRequest = { }; } }; +GlobalDecoderRegistry.register(IncentiveRecordsRequest.typeUrl, IncentiveRecordsRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(IncentiveRecordsRequest.aminoType, IncentiveRecordsRequest.typeUrl); function createBaseIncentiveRecordsResponse(): IncentiveRecordsResponse { return { incentiveRecords: [], - pagination: PageResponse.fromPartial({}) + pagination: undefined }; } export const IncentiveRecordsResponse = { typeUrl: "/osmosis.concentratedliquidity.v1beta1.IncentiveRecordsResponse", + aminoType: "osmosis/concentratedliquidity/incentive-records-response", + is(o: any): o is IncentiveRecordsResponse { + return o && (o.$typeUrl === IncentiveRecordsResponse.typeUrl || Array.isArray(o.incentiveRecords) && (!o.incentiveRecords.length || IncentiveRecord.is(o.incentiveRecords[0]))); + }, + isSDK(o: any): o is IncentiveRecordsResponseSDKType { + return o && (o.$typeUrl === IncentiveRecordsResponse.typeUrl || Array.isArray(o.incentive_records) && (!o.incentive_records.length || IncentiveRecord.isSDK(o.incentive_records[0]))); + }, + isAmino(o: any): o is IncentiveRecordsResponseAmino { + return o && (o.$typeUrl === IncentiveRecordsResponse.typeUrl || Array.isArray(o.incentive_records) && (!o.incentive_records.length || IncentiveRecord.isAmino(o.incentive_records[0]))); + }, encode(message: IncentiveRecordsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.incentiveRecords) { IncentiveRecord.encode(v!, writer.uint32(10).fork()).ldelim(); @@ -2426,6 +3167,22 @@ export const IncentiveRecordsResponse = { } return message; }, + fromJSON(object: any): IncentiveRecordsResponse { + return { + incentiveRecords: Array.isArray(object?.incentiveRecords) ? object.incentiveRecords.map((e: any) => IncentiveRecord.fromJSON(e)) : [], + pagination: isSet(object.pagination) ? PageResponse.fromJSON(object.pagination) : undefined + }; + }, + toJSON(message: IncentiveRecordsResponse): unknown { + const obj: any = {}; + if (message.incentiveRecords) { + obj.incentiveRecords = message.incentiveRecords.map(e => e ? IncentiveRecord.toJSON(e) : undefined); + } else { + obj.incentiveRecords = []; + } + message.pagination !== undefined && (obj.pagination = message.pagination ? PageResponse.toJSON(message.pagination) : undefined); + return obj; + }, fromPartial(object: Partial): IncentiveRecordsResponse { const message = createBaseIncentiveRecordsResponse(); message.incentiveRecords = object.incentiveRecords?.map(e => IncentiveRecord.fromPartial(e)) || []; @@ -2433,10 +3190,12 @@ export const IncentiveRecordsResponse = { return message; }, fromAmino(object: IncentiveRecordsResponseAmino): IncentiveRecordsResponse { - return { - incentiveRecords: Array.isArray(object?.incentive_records) ? object.incentive_records.map((e: any) => IncentiveRecord.fromAmino(e)) : [], - pagination: object?.pagination ? PageResponse.fromAmino(object.pagination) : undefined - }; + const message = createBaseIncentiveRecordsResponse(); + message.incentiveRecords = object.incentive_records?.map(e => IncentiveRecord.fromAmino(e)) || []; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromAmino(object.pagination); + } + return message; }, toAmino(message: IncentiveRecordsResponse): IncentiveRecordsResponseAmino { const obj: any = {}; @@ -2470,6 +3229,8 @@ export const IncentiveRecordsResponse = { }; } }; +GlobalDecoderRegistry.register(IncentiveRecordsResponse.typeUrl, IncentiveRecordsResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(IncentiveRecordsResponse.aminoType, IncentiveRecordsResponse.typeUrl); function createBaseCFMMPoolIdLinkFromConcentratedPoolIdRequest(): CFMMPoolIdLinkFromConcentratedPoolIdRequest { return { concentratedPoolId: BigInt(0) @@ -2477,6 +3238,16 @@ function createBaseCFMMPoolIdLinkFromConcentratedPoolIdRequest(): CFMMPoolIdLink } export const CFMMPoolIdLinkFromConcentratedPoolIdRequest = { typeUrl: "/osmosis.concentratedliquidity.v1beta1.CFMMPoolIdLinkFromConcentratedPoolIdRequest", + aminoType: "osmosis/concentratedliquidity/cfmmpool-id-link-from-concentrated-pool-id-request", + is(o: any): o is CFMMPoolIdLinkFromConcentratedPoolIdRequest { + return o && (o.$typeUrl === CFMMPoolIdLinkFromConcentratedPoolIdRequest.typeUrl || typeof o.concentratedPoolId === "bigint"); + }, + isSDK(o: any): o is CFMMPoolIdLinkFromConcentratedPoolIdRequestSDKType { + return o && (o.$typeUrl === CFMMPoolIdLinkFromConcentratedPoolIdRequest.typeUrl || typeof o.concentrated_pool_id === "bigint"); + }, + isAmino(o: any): o is CFMMPoolIdLinkFromConcentratedPoolIdRequestAmino { + return o && (o.$typeUrl === CFMMPoolIdLinkFromConcentratedPoolIdRequest.typeUrl || typeof o.concentrated_pool_id === "bigint"); + }, encode(message: CFMMPoolIdLinkFromConcentratedPoolIdRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.concentratedPoolId !== BigInt(0)) { writer.uint32(8).uint64(message.concentratedPoolId); @@ -2500,15 +3271,27 @@ export const CFMMPoolIdLinkFromConcentratedPoolIdRequest = { } return message; }, + fromJSON(object: any): CFMMPoolIdLinkFromConcentratedPoolIdRequest { + return { + concentratedPoolId: isSet(object.concentratedPoolId) ? BigInt(object.concentratedPoolId.toString()) : BigInt(0) + }; + }, + toJSON(message: CFMMPoolIdLinkFromConcentratedPoolIdRequest): unknown { + const obj: any = {}; + message.concentratedPoolId !== undefined && (obj.concentratedPoolId = (message.concentratedPoolId || BigInt(0)).toString()); + return obj; + }, fromPartial(object: Partial): CFMMPoolIdLinkFromConcentratedPoolIdRequest { const message = createBaseCFMMPoolIdLinkFromConcentratedPoolIdRequest(); message.concentratedPoolId = object.concentratedPoolId !== undefined && object.concentratedPoolId !== null ? BigInt(object.concentratedPoolId.toString()) : BigInt(0); return message; }, fromAmino(object: CFMMPoolIdLinkFromConcentratedPoolIdRequestAmino): CFMMPoolIdLinkFromConcentratedPoolIdRequest { - return { - concentratedPoolId: BigInt(object.concentrated_pool_id) - }; + const message = createBaseCFMMPoolIdLinkFromConcentratedPoolIdRequest(); + if (object.concentrated_pool_id !== undefined && object.concentrated_pool_id !== null) { + message.concentratedPoolId = BigInt(object.concentrated_pool_id); + } + return message; }, toAmino(message: CFMMPoolIdLinkFromConcentratedPoolIdRequest): CFMMPoolIdLinkFromConcentratedPoolIdRequestAmino { const obj: any = {}; @@ -2537,6 +3320,8 @@ export const CFMMPoolIdLinkFromConcentratedPoolIdRequest = { }; } }; +GlobalDecoderRegistry.register(CFMMPoolIdLinkFromConcentratedPoolIdRequest.typeUrl, CFMMPoolIdLinkFromConcentratedPoolIdRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(CFMMPoolIdLinkFromConcentratedPoolIdRequest.aminoType, CFMMPoolIdLinkFromConcentratedPoolIdRequest.typeUrl); function createBaseCFMMPoolIdLinkFromConcentratedPoolIdResponse(): CFMMPoolIdLinkFromConcentratedPoolIdResponse { return { cfmmPoolId: BigInt(0) @@ -2544,6 +3329,16 @@ function createBaseCFMMPoolIdLinkFromConcentratedPoolIdResponse(): CFMMPoolIdLin } export const CFMMPoolIdLinkFromConcentratedPoolIdResponse = { typeUrl: "/osmosis.concentratedliquidity.v1beta1.CFMMPoolIdLinkFromConcentratedPoolIdResponse", + aminoType: "osmosis/concentratedliquidity/cfmmpool-id-link-from-concentrated-pool-id-response", + is(o: any): o is CFMMPoolIdLinkFromConcentratedPoolIdResponse { + return o && (o.$typeUrl === CFMMPoolIdLinkFromConcentratedPoolIdResponse.typeUrl || typeof o.cfmmPoolId === "bigint"); + }, + isSDK(o: any): o is CFMMPoolIdLinkFromConcentratedPoolIdResponseSDKType { + return o && (o.$typeUrl === CFMMPoolIdLinkFromConcentratedPoolIdResponse.typeUrl || typeof o.cfmm_pool_id === "bigint"); + }, + isAmino(o: any): o is CFMMPoolIdLinkFromConcentratedPoolIdResponseAmino { + return o && (o.$typeUrl === CFMMPoolIdLinkFromConcentratedPoolIdResponse.typeUrl || typeof o.cfmm_pool_id === "bigint"); + }, encode(message: CFMMPoolIdLinkFromConcentratedPoolIdResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.cfmmPoolId !== BigInt(0)) { writer.uint32(8).uint64(message.cfmmPoolId); @@ -2567,15 +3362,27 @@ export const CFMMPoolIdLinkFromConcentratedPoolIdResponse = { } return message; }, + fromJSON(object: any): CFMMPoolIdLinkFromConcentratedPoolIdResponse { + return { + cfmmPoolId: isSet(object.cfmmPoolId) ? BigInt(object.cfmmPoolId.toString()) : BigInt(0) + }; + }, + toJSON(message: CFMMPoolIdLinkFromConcentratedPoolIdResponse): unknown { + const obj: any = {}; + message.cfmmPoolId !== undefined && (obj.cfmmPoolId = (message.cfmmPoolId || BigInt(0)).toString()); + return obj; + }, fromPartial(object: Partial): CFMMPoolIdLinkFromConcentratedPoolIdResponse { const message = createBaseCFMMPoolIdLinkFromConcentratedPoolIdResponse(); message.cfmmPoolId = object.cfmmPoolId !== undefined && object.cfmmPoolId !== null ? BigInt(object.cfmmPoolId.toString()) : BigInt(0); return message; }, fromAmino(object: CFMMPoolIdLinkFromConcentratedPoolIdResponseAmino): CFMMPoolIdLinkFromConcentratedPoolIdResponse { - return { - cfmmPoolId: BigInt(object.cfmm_pool_id) - }; + const message = createBaseCFMMPoolIdLinkFromConcentratedPoolIdResponse(); + if (object.cfmm_pool_id !== undefined && object.cfmm_pool_id !== null) { + message.cfmmPoolId = BigInt(object.cfmm_pool_id); + } + return message; }, toAmino(message: CFMMPoolIdLinkFromConcentratedPoolIdResponse): CFMMPoolIdLinkFromConcentratedPoolIdResponseAmino { const obj: any = {}; @@ -2604,6 +3411,8 @@ export const CFMMPoolIdLinkFromConcentratedPoolIdResponse = { }; } }; +GlobalDecoderRegistry.register(CFMMPoolIdLinkFromConcentratedPoolIdResponse.typeUrl, CFMMPoolIdLinkFromConcentratedPoolIdResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(CFMMPoolIdLinkFromConcentratedPoolIdResponse.aminoType, CFMMPoolIdLinkFromConcentratedPoolIdResponse.typeUrl); function createBaseUserUnbondingPositionsRequest(): UserUnbondingPositionsRequest { return { address: "" @@ -2611,6 +3420,16 @@ function createBaseUserUnbondingPositionsRequest(): UserUnbondingPositionsReques } export const UserUnbondingPositionsRequest = { typeUrl: "/osmosis.concentratedliquidity.v1beta1.UserUnbondingPositionsRequest", + aminoType: "osmosis/concentratedliquidity/user-unbonding-positions-request", + is(o: any): o is UserUnbondingPositionsRequest { + return o && (o.$typeUrl === UserUnbondingPositionsRequest.typeUrl || typeof o.address === "string"); + }, + isSDK(o: any): o is UserUnbondingPositionsRequestSDKType { + return o && (o.$typeUrl === UserUnbondingPositionsRequest.typeUrl || typeof o.address === "string"); + }, + isAmino(o: any): o is UserUnbondingPositionsRequestAmino { + return o && (o.$typeUrl === UserUnbondingPositionsRequest.typeUrl || typeof o.address === "string"); + }, encode(message: UserUnbondingPositionsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.address !== "") { writer.uint32(10).string(message.address); @@ -2634,15 +3453,27 @@ export const UserUnbondingPositionsRequest = { } return message; }, + fromJSON(object: any): UserUnbondingPositionsRequest { + return { + address: isSet(object.address) ? String(object.address) : "" + }; + }, + toJSON(message: UserUnbondingPositionsRequest): unknown { + const obj: any = {}; + message.address !== undefined && (obj.address = message.address); + return obj; + }, fromPartial(object: Partial): UserUnbondingPositionsRequest { const message = createBaseUserUnbondingPositionsRequest(); message.address = object.address ?? ""; return message; }, fromAmino(object: UserUnbondingPositionsRequestAmino): UserUnbondingPositionsRequest { - return { - address: object.address - }; + const message = createBaseUserUnbondingPositionsRequest(); + if (object.address !== undefined && object.address !== null) { + message.address = object.address; + } + return message; }, toAmino(message: UserUnbondingPositionsRequest): UserUnbondingPositionsRequestAmino { const obj: any = {}; @@ -2671,6 +3502,8 @@ export const UserUnbondingPositionsRequest = { }; } }; +GlobalDecoderRegistry.register(UserUnbondingPositionsRequest.typeUrl, UserUnbondingPositionsRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(UserUnbondingPositionsRequest.aminoType, UserUnbondingPositionsRequest.typeUrl); function createBaseUserUnbondingPositionsResponse(): UserUnbondingPositionsResponse { return { positionsWithPeriodLock: [] @@ -2678,6 +3511,16 @@ function createBaseUserUnbondingPositionsResponse(): UserUnbondingPositionsRespo } export const UserUnbondingPositionsResponse = { typeUrl: "/osmosis.concentratedliquidity.v1beta1.UserUnbondingPositionsResponse", + aminoType: "osmosis/concentratedliquidity/user-unbonding-positions-response", + is(o: any): o is UserUnbondingPositionsResponse { + return o && (o.$typeUrl === UserUnbondingPositionsResponse.typeUrl || Array.isArray(o.positionsWithPeriodLock) && (!o.positionsWithPeriodLock.length || PositionWithPeriodLock.is(o.positionsWithPeriodLock[0]))); + }, + isSDK(o: any): o is UserUnbondingPositionsResponseSDKType { + return o && (o.$typeUrl === UserUnbondingPositionsResponse.typeUrl || Array.isArray(o.positions_with_period_lock) && (!o.positions_with_period_lock.length || PositionWithPeriodLock.isSDK(o.positions_with_period_lock[0]))); + }, + isAmino(o: any): o is UserUnbondingPositionsResponseAmino { + return o && (o.$typeUrl === UserUnbondingPositionsResponse.typeUrl || Array.isArray(o.positions_with_period_lock) && (!o.positions_with_period_lock.length || PositionWithPeriodLock.isAmino(o.positions_with_period_lock[0]))); + }, encode(message: UserUnbondingPositionsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.positionsWithPeriodLock) { PositionWithPeriodLock.encode(v!, writer.uint32(10).fork()).ldelim(); @@ -2701,15 +3544,29 @@ export const UserUnbondingPositionsResponse = { } return message; }, + fromJSON(object: any): UserUnbondingPositionsResponse { + return { + positionsWithPeriodLock: Array.isArray(object?.positionsWithPeriodLock) ? object.positionsWithPeriodLock.map((e: any) => PositionWithPeriodLock.fromJSON(e)) : [] + }; + }, + toJSON(message: UserUnbondingPositionsResponse): unknown { + const obj: any = {}; + if (message.positionsWithPeriodLock) { + obj.positionsWithPeriodLock = message.positionsWithPeriodLock.map(e => e ? PositionWithPeriodLock.toJSON(e) : undefined); + } else { + obj.positionsWithPeriodLock = []; + } + return obj; + }, fromPartial(object: Partial): UserUnbondingPositionsResponse { const message = createBaseUserUnbondingPositionsResponse(); message.positionsWithPeriodLock = object.positionsWithPeriodLock?.map(e => PositionWithPeriodLock.fromPartial(e)) || []; return message; }, fromAmino(object: UserUnbondingPositionsResponseAmino): UserUnbondingPositionsResponse { - return { - positionsWithPeriodLock: Array.isArray(object?.positions_with_period_lock) ? object.positions_with_period_lock.map((e: any) => PositionWithPeriodLock.fromAmino(e)) : [] - }; + const message = createBaseUserUnbondingPositionsResponse(); + message.positionsWithPeriodLock = object.positions_with_period_lock?.map(e => PositionWithPeriodLock.fromAmino(e)) || []; + return message; }, toAmino(message: UserUnbondingPositionsResponse): UserUnbondingPositionsResponseAmino { const obj: any = {}; @@ -2742,11 +3599,23 @@ export const UserUnbondingPositionsResponse = { }; } }; +GlobalDecoderRegistry.register(UserUnbondingPositionsResponse.typeUrl, UserUnbondingPositionsResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(UserUnbondingPositionsResponse.aminoType, UserUnbondingPositionsResponse.typeUrl); function createBaseGetTotalLiquidityRequest(): GetTotalLiquidityRequest { return {}; } export const GetTotalLiquidityRequest = { typeUrl: "/osmosis.concentratedliquidity.v1beta1.GetTotalLiquidityRequest", + aminoType: "osmosis/concentratedliquidity/get-total-liquidity-request", + is(o: any): o is GetTotalLiquidityRequest { + return o && o.$typeUrl === GetTotalLiquidityRequest.typeUrl; + }, + isSDK(o: any): o is GetTotalLiquidityRequestSDKType { + return o && o.$typeUrl === GetTotalLiquidityRequest.typeUrl; + }, + isAmino(o: any): o is GetTotalLiquidityRequestAmino { + return o && o.$typeUrl === GetTotalLiquidityRequest.typeUrl; + }, encode(_: GetTotalLiquidityRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, @@ -2764,12 +3633,20 @@ export const GetTotalLiquidityRequest = { } return message; }, + fromJSON(_: any): GetTotalLiquidityRequest { + return {}; + }, + toJSON(_: GetTotalLiquidityRequest): unknown { + const obj: any = {}; + return obj; + }, fromPartial(_: Partial): GetTotalLiquidityRequest { const message = createBaseGetTotalLiquidityRequest(); return message; }, fromAmino(_: GetTotalLiquidityRequestAmino): GetTotalLiquidityRequest { - return {}; + const message = createBaseGetTotalLiquidityRequest(); + return message; }, toAmino(_: GetTotalLiquidityRequest): GetTotalLiquidityRequestAmino { const obj: any = {}; @@ -2797,6 +3674,8 @@ export const GetTotalLiquidityRequest = { }; } }; +GlobalDecoderRegistry.register(GetTotalLiquidityRequest.typeUrl, GetTotalLiquidityRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(GetTotalLiquidityRequest.aminoType, GetTotalLiquidityRequest.typeUrl); function createBaseGetTotalLiquidityResponse(): GetTotalLiquidityResponse { return { totalLiquidity: [] @@ -2804,6 +3683,16 @@ function createBaseGetTotalLiquidityResponse(): GetTotalLiquidityResponse { } export const GetTotalLiquidityResponse = { typeUrl: "/osmosis.concentratedliquidity.v1beta1.GetTotalLiquidityResponse", + aminoType: "osmosis/concentratedliquidity/get-total-liquidity-response", + is(o: any): o is GetTotalLiquidityResponse { + return o && (o.$typeUrl === GetTotalLiquidityResponse.typeUrl || Array.isArray(o.totalLiquidity) && (!o.totalLiquidity.length || Coin.is(o.totalLiquidity[0]))); + }, + isSDK(o: any): o is GetTotalLiquidityResponseSDKType { + return o && (o.$typeUrl === GetTotalLiquidityResponse.typeUrl || Array.isArray(o.total_liquidity) && (!o.total_liquidity.length || Coin.isSDK(o.total_liquidity[0]))); + }, + isAmino(o: any): o is GetTotalLiquidityResponseAmino { + return o && (o.$typeUrl === GetTotalLiquidityResponse.typeUrl || Array.isArray(o.total_liquidity) && (!o.total_liquidity.length || Coin.isAmino(o.total_liquidity[0]))); + }, encode(message: GetTotalLiquidityResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.totalLiquidity) { Coin.encode(v!, writer.uint32(10).fork()).ldelim(); @@ -2827,15 +3716,29 @@ export const GetTotalLiquidityResponse = { } return message; }, + fromJSON(object: any): GetTotalLiquidityResponse { + return { + totalLiquidity: Array.isArray(object?.totalLiquidity) ? object.totalLiquidity.map((e: any) => Coin.fromJSON(e)) : [] + }; + }, + toJSON(message: GetTotalLiquidityResponse): unknown { + const obj: any = {}; + if (message.totalLiquidity) { + obj.totalLiquidity = message.totalLiquidity.map(e => e ? Coin.toJSON(e) : undefined); + } else { + obj.totalLiquidity = []; + } + return obj; + }, fromPartial(object: Partial): GetTotalLiquidityResponse { const message = createBaseGetTotalLiquidityResponse(); message.totalLiquidity = object.totalLiquidity?.map(e => Coin.fromPartial(e)) || []; return message; }, fromAmino(object: GetTotalLiquidityResponseAmino): GetTotalLiquidityResponse { - return { - totalLiquidity: Array.isArray(object?.total_liquidity) ? object.total_liquidity.map((e: any) => Coin.fromAmino(e)) : [] - }; + const message = createBaseGetTotalLiquidityResponse(); + message.totalLiquidity = object.total_liquidity?.map(e => Coin.fromAmino(e)) || []; + return message; }, toAmino(message: GetTotalLiquidityResponse): GetTotalLiquidityResponseAmino { const obj: any = {}; @@ -2868,71 +3771,249 @@ export const GetTotalLiquidityResponse = { }; } }; -export const PoolI_InterfaceDecoder = (input: BinaryReader | Uint8Array): Pool1 | CosmWasmPool | Pool2 | Pool3 | Any => { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - const data = Any.decode(reader, reader.uint32()); - switch (data.typeUrl) { - case "/osmosis.concentratedliquidity.v1beta1.Pool": - return Pool1.decode(data.value); - case "/osmosis.cosmwasmpool.v1beta1.CosmWasmPool": - return CosmWasmPool.decode(data.value); - case "/osmosis.gamm.v1beta1.Pool": - return Pool2.decode(data.value); - case "/osmosis.gamm.poolmodels.stableswap.v1beta1.Pool": - return Pool3.decode(data.value); - default: - return data; +GlobalDecoderRegistry.register(GetTotalLiquidityResponse.typeUrl, GetTotalLiquidityResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(GetTotalLiquidityResponse.aminoType, GetTotalLiquidityResponse.typeUrl); +function createBaseNumNextInitializedTicksRequest(): NumNextInitializedTicksRequest { + return { + poolId: BigInt(0), + tokenInDenom: "", + numNextInitializedTicks: BigInt(0) + }; +} +export const NumNextInitializedTicksRequest = { + typeUrl: "/osmosis.concentratedliquidity.v1beta1.NumNextInitializedTicksRequest", + aminoType: "osmosis/concentratedliquidity/num-next-initialized-ticks-request", + is(o: any): o is NumNextInitializedTicksRequest { + return o && (o.$typeUrl === NumNextInitializedTicksRequest.typeUrl || typeof o.poolId === "bigint" && typeof o.tokenInDenom === "string" && typeof o.numNextInitializedTicks === "bigint"); + }, + isSDK(o: any): o is NumNextInitializedTicksRequestSDKType { + return o && (o.$typeUrl === NumNextInitializedTicksRequest.typeUrl || typeof o.pool_id === "bigint" && typeof o.token_in_denom === "string" && typeof o.num_next_initialized_ticks === "bigint"); + }, + isAmino(o: any): o is NumNextInitializedTicksRequestAmino { + return o && (o.$typeUrl === NumNextInitializedTicksRequest.typeUrl || typeof o.pool_id === "bigint" && typeof o.token_in_denom === "string" && typeof o.num_next_initialized_ticks === "bigint"); + }, + encode(message: NumNextInitializedTicksRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.poolId !== BigInt(0)) { + writer.uint32(8).uint64(message.poolId); + } + if (message.tokenInDenom !== "") { + writer.uint32(18).string(message.tokenInDenom); + } + if (message.numNextInitializedTicks !== BigInt(0)) { + writer.uint32(24).uint64(message.numNextInitializedTicks); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): NumNextInitializedTicksRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseNumNextInitializedTicksRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.poolId = reader.uint64(); + break; + case 2: + message.tokenInDenom = reader.string(); + break; + case 3: + message.numNextInitializedTicks = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): NumNextInitializedTicksRequest { + return { + poolId: isSet(object.poolId) ? BigInt(object.poolId.toString()) : BigInt(0), + tokenInDenom: isSet(object.tokenInDenom) ? String(object.tokenInDenom) : "", + numNextInitializedTicks: isSet(object.numNextInitializedTicks) ? BigInt(object.numNextInitializedTicks.toString()) : BigInt(0) + }; + }, + toJSON(message: NumNextInitializedTicksRequest): unknown { + const obj: any = {}; + message.poolId !== undefined && (obj.poolId = (message.poolId || BigInt(0)).toString()); + message.tokenInDenom !== undefined && (obj.tokenInDenom = message.tokenInDenom); + message.numNextInitializedTicks !== undefined && (obj.numNextInitializedTicks = (message.numNextInitializedTicks || BigInt(0)).toString()); + return obj; + }, + fromPartial(object: Partial): NumNextInitializedTicksRequest { + const message = createBaseNumNextInitializedTicksRequest(); + message.poolId = object.poolId !== undefined && object.poolId !== null ? BigInt(object.poolId.toString()) : BigInt(0); + message.tokenInDenom = object.tokenInDenom ?? ""; + message.numNextInitializedTicks = object.numNextInitializedTicks !== undefined && object.numNextInitializedTicks !== null ? BigInt(object.numNextInitializedTicks.toString()) : BigInt(0); + return message; + }, + fromAmino(object: NumNextInitializedTicksRequestAmino): NumNextInitializedTicksRequest { + const message = createBaseNumNextInitializedTicksRequest(); + if (object.pool_id !== undefined && object.pool_id !== null) { + message.poolId = BigInt(object.pool_id); + } + if (object.token_in_denom !== undefined && object.token_in_denom !== null) { + message.tokenInDenom = object.token_in_denom; + } + if (object.num_next_initialized_ticks !== undefined && object.num_next_initialized_ticks !== null) { + message.numNextInitializedTicks = BigInt(object.num_next_initialized_ticks); + } + return message; + }, + toAmino(message: NumNextInitializedTicksRequest): NumNextInitializedTicksRequestAmino { + const obj: any = {}; + obj.pool_id = message.poolId ? message.poolId.toString() : undefined; + obj.token_in_denom = message.tokenInDenom; + obj.num_next_initialized_ticks = message.numNextInitializedTicks ? message.numNextInitializedTicks.toString() : undefined; + return obj; + }, + fromAminoMsg(object: NumNextInitializedTicksRequestAminoMsg): NumNextInitializedTicksRequest { + return NumNextInitializedTicksRequest.fromAmino(object.value); + }, + toAminoMsg(message: NumNextInitializedTicksRequest): NumNextInitializedTicksRequestAminoMsg { + return { + type: "osmosis/concentratedliquidity/num-next-initialized-ticks-request", + value: NumNextInitializedTicksRequest.toAmino(message) + }; + }, + fromProtoMsg(message: NumNextInitializedTicksRequestProtoMsg): NumNextInitializedTicksRequest { + return NumNextInitializedTicksRequest.decode(message.value); + }, + toProto(message: NumNextInitializedTicksRequest): Uint8Array { + return NumNextInitializedTicksRequest.encode(message).finish(); + }, + toProtoMsg(message: NumNextInitializedTicksRequest): NumNextInitializedTicksRequestProtoMsg { + return { + typeUrl: "/osmosis.concentratedliquidity.v1beta1.NumNextInitializedTicksRequest", + value: NumNextInitializedTicksRequest.encode(message).finish() + }; } }; -export const PoolI_FromAmino = (content: AnyAmino) => { - switch (content.type) { - case "osmosis/concentratedliquidity/pool": - return Any.fromPartial({ - typeUrl: "/osmosis.concentratedliquidity.v1beta1.Pool", - value: Pool1.encode(Pool1.fromPartial(Pool1.fromAmino(content.value))).finish() - }); - case "osmosis/cosmwasmpool/cosm-wasm-pool": - return Any.fromPartial({ - typeUrl: "/osmosis.cosmwasmpool.v1beta1.CosmWasmPool", - value: CosmWasmPool.encode(CosmWasmPool.fromPartial(CosmWasmPool.fromAmino(content.value))).finish() - }); - case "osmosis/gamm/BalancerPool": - return Any.fromPartial({ - typeUrl: "/osmosis.gamm.v1beta1.Pool", - value: Pool2.encode(Pool2.fromPartial(Pool2.fromAmino(content.value))).finish() - }); - case "osmosis/gamm/StableswapPool": - return Any.fromPartial({ - typeUrl: "/osmosis.gamm.poolmodels.stableswap.v1beta1.Pool", - value: Pool3.encode(Pool3.fromPartial(Pool3.fromAmino(content.value))).finish() - }); - default: - return Any.fromAmino(content); +GlobalDecoderRegistry.register(NumNextInitializedTicksRequest.typeUrl, NumNextInitializedTicksRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(NumNextInitializedTicksRequest.aminoType, NumNextInitializedTicksRequest.typeUrl); +function createBaseNumNextInitializedTicksResponse(): NumNextInitializedTicksResponse { + return { + liquidityDepths: [], + currentTick: BigInt(0), + currentLiquidity: "" + }; +} +export const NumNextInitializedTicksResponse = { + typeUrl: "/osmosis.concentratedliquidity.v1beta1.NumNextInitializedTicksResponse", + aminoType: "osmosis/concentratedliquidity/num-next-initialized-ticks-response", + is(o: any): o is NumNextInitializedTicksResponse { + return o && (o.$typeUrl === NumNextInitializedTicksResponse.typeUrl || Array.isArray(o.liquidityDepths) && (!o.liquidityDepths.length || TickLiquidityNet.is(o.liquidityDepths[0])) && typeof o.currentTick === "bigint" && typeof o.currentLiquidity === "string"); + }, + isSDK(o: any): o is NumNextInitializedTicksResponseSDKType { + return o && (o.$typeUrl === NumNextInitializedTicksResponse.typeUrl || Array.isArray(o.liquidity_depths) && (!o.liquidity_depths.length || TickLiquidityNet.isSDK(o.liquidity_depths[0])) && typeof o.current_tick === "bigint" && typeof o.current_liquidity === "string"); + }, + isAmino(o: any): o is NumNextInitializedTicksResponseAmino { + return o && (o.$typeUrl === NumNextInitializedTicksResponse.typeUrl || Array.isArray(o.liquidity_depths) && (!o.liquidity_depths.length || TickLiquidityNet.isAmino(o.liquidity_depths[0])) && typeof o.current_tick === "bigint" && typeof o.current_liquidity === "string"); + }, + encode(message: NumNextInitializedTicksResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.liquidityDepths) { + TickLiquidityNet.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.currentTick !== BigInt(0)) { + writer.uint32(16).int64(message.currentTick); + } + if (message.currentLiquidity !== "") { + writer.uint32(26).string(Decimal.fromUserInput(message.currentLiquidity, 18).atomics); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): NumNextInitializedTicksResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseNumNextInitializedTicksResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.liquidityDepths.push(TickLiquidityNet.decode(reader, reader.uint32())); + break; + case 2: + message.currentTick = reader.int64(); + break; + case 3: + message.currentLiquidity = Decimal.fromAtomics(reader.string(), 18).toString(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): NumNextInitializedTicksResponse { + return { + liquidityDepths: Array.isArray(object?.liquidityDepths) ? object.liquidityDepths.map((e: any) => TickLiquidityNet.fromJSON(e)) : [], + currentTick: isSet(object.currentTick) ? BigInt(object.currentTick.toString()) : BigInt(0), + currentLiquidity: isSet(object.currentLiquidity) ? String(object.currentLiquidity) : "" + }; + }, + toJSON(message: NumNextInitializedTicksResponse): unknown { + const obj: any = {}; + if (message.liquidityDepths) { + obj.liquidityDepths = message.liquidityDepths.map(e => e ? TickLiquidityNet.toJSON(e) : undefined); + } else { + obj.liquidityDepths = []; + } + message.currentTick !== undefined && (obj.currentTick = (message.currentTick || BigInt(0)).toString()); + message.currentLiquidity !== undefined && (obj.currentLiquidity = message.currentLiquidity); + return obj; + }, + fromPartial(object: Partial): NumNextInitializedTicksResponse { + const message = createBaseNumNextInitializedTicksResponse(); + message.liquidityDepths = object.liquidityDepths?.map(e => TickLiquidityNet.fromPartial(e)) || []; + message.currentTick = object.currentTick !== undefined && object.currentTick !== null ? BigInt(object.currentTick.toString()) : BigInt(0); + message.currentLiquidity = object.currentLiquidity ?? ""; + return message; + }, + fromAmino(object: NumNextInitializedTicksResponseAmino): NumNextInitializedTicksResponse { + const message = createBaseNumNextInitializedTicksResponse(); + message.liquidityDepths = object.liquidity_depths?.map(e => TickLiquidityNet.fromAmino(e)) || []; + if (object.current_tick !== undefined && object.current_tick !== null) { + message.currentTick = BigInt(object.current_tick); + } + if (object.current_liquidity !== undefined && object.current_liquidity !== null) { + message.currentLiquidity = object.current_liquidity; + } + return message; + }, + toAmino(message: NumNextInitializedTicksResponse): NumNextInitializedTicksResponseAmino { + const obj: any = {}; + if (message.liquidityDepths) { + obj.liquidity_depths = message.liquidityDepths.map(e => e ? TickLiquidityNet.toAmino(e) : undefined); + } else { + obj.liquidity_depths = []; + } + obj.current_tick = message.currentTick ? message.currentTick.toString() : undefined; + obj.current_liquidity = message.currentLiquidity; + return obj; + }, + fromAminoMsg(object: NumNextInitializedTicksResponseAminoMsg): NumNextInitializedTicksResponse { + return NumNextInitializedTicksResponse.fromAmino(object.value); + }, + toAminoMsg(message: NumNextInitializedTicksResponse): NumNextInitializedTicksResponseAminoMsg { + return { + type: "osmosis/concentratedliquidity/num-next-initialized-ticks-response", + value: NumNextInitializedTicksResponse.toAmino(message) + }; + }, + fromProtoMsg(message: NumNextInitializedTicksResponseProtoMsg): NumNextInitializedTicksResponse { + return NumNextInitializedTicksResponse.decode(message.value); + }, + toProto(message: NumNextInitializedTicksResponse): Uint8Array { + return NumNextInitializedTicksResponse.encode(message).finish(); + }, + toProtoMsg(message: NumNextInitializedTicksResponse): NumNextInitializedTicksResponseProtoMsg { + return { + typeUrl: "/osmosis.concentratedliquidity.v1beta1.NumNextInitializedTicksResponse", + value: NumNextInitializedTicksResponse.encode(message).finish() + }; } }; -export const PoolI_ToAmino = (content: Any) => { - switch (content.typeUrl) { - case "/osmosis.concentratedliquidity.v1beta1.Pool": - return { - type: "osmosis/concentratedliquidity/pool", - value: Pool1.toAmino(Pool1.decode(content.value)) - }; - case "/osmosis.cosmwasmpool.v1beta1.CosmWasmPool": - return { - type: "osmosis/cosmwasmpool/cosm-wasm-pool", - value: CosmWasmPool.toAmino(CosmWasmPool.decode(content.value)) - }; - case "/osmosis.gamm.v1beta1.Pool": - return { - type: "osmosis/gamm/BalancerPool", - value: Pool2.toAmino(Pool2.decode(content.value)) - }; - case "/osmosis.gamm.poolmodels.stableswap.v1beta1.Pool": - return { - type: "osmosis/gamm/StableswapPool", - value: Pool3.toAmino(Pool3.decode(content.value)) - }; - default: - return Any.toAmino(content); - } -}; \ No newline at end of file +GlobalDecoderRegistry.register(NumNextInitializedTicksResponse.typeUrl, NumNextInitializedTicksResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(NumNextInitializedTicksResponse.aminoType, NumNextInitializedTicksResponse.typeUrl); \ No newline at end of file diff --git a/packages/osmojs/src/codegen/osmosis/concentrated-liquidity/tickInfo.ts b/packages/osmojs/src/codegen/osmosis/concentratedliquidity/v1beta1/tickInfo.ts similarity index 61% rename from packages/osmojs/src/codegen/osmosis/concentrated-liquidity/tickInfo.ts rename to packages/osmojs/src/codegen/osmosis/concentratedliquidity/v1beta1/tickInfo.ts index ac30bbbd9..02fffb4bf 100644 --- a/packages/osmojs/src/codegen/osmosis/concentrated-liquidity/tickInfo.ts +++ b/packages/osmojs/src/codegen/osmosis/concentratedliquidity/v1beta1/tickInfo.ts @@ -1,6 +1,8 @@ -import { DecCoin, DecCoinAmino, DecCoinSDKType } from "../../cosmos/base/v1beta1/coin"; -import { BinaryReader, BinaryWriter } from "../../binary"; +import { DecCoin, DecCoinAmino, DecCoinSDKType } from "../../../cosmos/base/v1beta1/coin"; +import { BinaryReader, BinaryWriter } from "../../../binary"; import { Decimal } from "@cosmjs/math"; +import { isSet } from "../../../helpers"; +import { GlobalDecoderRegistry } from "../../../registry"; export interface TickInfo { liquidityGross: string; liquidityNet: string; @@ -18,9 +20,9 @@ export interface TickInfoProtoMsg { value: Uint8Array; } export interface TickInfoAmino { - liquidity_gross: string; - liquidity_net: string; - spread_reward_growth_opposite_direction_of_last_traversal: DecCoinAmino[]; + liquidity_gross?: string; + liquidity_net?: string; + spread_reward_growth_opposite_direction_of_last_traversal?: DecCoinAmino[]; /** * uptime_trackers is a container encapsulating the uptime trackers. * We use a container instead of a "repeated UptimeTracker" directly @@ -47,7 +49,7 @@ export interface UptimeTrackersProtoMsg { value: Uint8Array; } export interface UptimeTrackersAmino { - list: UptimeTrackerAmino[]; + list?: UptimeTrackerAmino[]; } export interface UptimeTrackersAminoMsg { type: "osmosis/concentratedliquidity/uptime-trackers"; @@ -64,7 +66,7 @@ export interface UptimeTrackerProtoMsg { value: Uint8Array; } export interface UptimeTrackerAmino { - uptime_growth_outside: DecCoinAmino[]; + uptime_growth_outside?: DecCoinAmino[]; } export interface UptimeTrackerAminoMsg { type: "osmosis/concentratedliquidity/uptime-tracker"; @@ -83,6 +85,16 @@ function createBaseTickInfo(): TickInfo { } export const TickInfo = { typeUrl: "/osmosis.concentratedliquidity.v1beta1.TickInfo", + aminoType: "osmosis/concentratedliquidity/tick-info", + is(o: any): o is TickInfo { + return o && (o.$typeUrl === TickInfo.typeUrl || typeof o.liquidityGross === "string" && typeof o.liquidityNet === "string" && Array.isArray(o.spreadRewardGrowthOppositeDirectionOfLastTraversal) && (!o.spreadRewardGrowthOppositeDirectionOfLastTraversal.length || DecCoin.is(o.spreadRewardGrowthOppositeDirectionOfLastTraversal[0])) && UptimeTrackers.is(o.uptimeTrackers)); + }, + isSDK(o: any): o is TickInfoSDKType { + return o && (o.$typeUrl === TickInfo.typeUrl || typeof o.liquidity_gross === "string" && typeof o.liquidity_net === "string" && Array.isArray(o.spread_reward_growth_opposite_direction_of_last_traversal) && (!o.spread_reward_growth_opposite_direction_of_last_traversal.length || DecCoin.isSDK(o.spread_reward_growth_opposite_direction_of_last_traversal[0])) && UptimeTrackers.isSDK(o.uptime_trackers)); + }, + isAmino(o: any): o is TickInfoAmino { + return o && (o.$typeUrl === TickInfo.typeUrl || typeof o.liquidity_gross === "string" && typeof o.liquidity_net === "string" && Array.isArray(o.spread_reward_growth_opposite_direction_of_last_traversal) && (!o.spread_reward_growth_opposite_direction_of_last_traversal.length || DecCoin.isAmino(o.spread_reward_growth_opposite_direction_of_last_traversal[0])) && UptimeTrackers.isAmino(o.uptime_trackers)); + }, encode(message: TickInfo, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.liquidityGross !== "") { writer.uint32(10).string(Decimal.fromUserInput(message.liquidityGross, 18).atomics); @@ -124,6 +136,26 @@ export const TickInfo = { } return message; }, + fromJSON(object: any): TickInfo { + return { + liquidityGross: isSet(object.liquidityGross) ? String(object.liquidityGross) : "", + liquidityNet: isSet(object.liquidityNet) ? String(object.liquidityNet) : "", + spreadRewardGrowthOppositeDirectionOfLastTraversal: Array.isArray(object?.spreadRewardGrowthOppositeDirectionOfLastTraversal) ? object.spreadRewardGrowthOppositeDirectionOfLastTraversal.map((e: any) => DecCoin.fromJSON(e)) : [], + uptimeTrackers: isSet(object.uptimeTrackers) ? UptimeTrackers.fromJSON(object.uptimeTrackers) : undefined + }; + }, + toJSON(message: TickInfo): unknown { + const obj: any = {}; + message.liquidityGross !== undefined && (obj.liquidityGross = message.liquidityGross); + message.liquidityNet !== undefined && (obj.liquidityNet = message.liquidityNet); + if (message.spreadRewardGrowthOppositeDirectionOfLastTraversal) { + obj.spreadRewardGrowthOppositeDirectionOfLastTraversal = message.spreadRewardGrowthOppositeDirectionOfLastTraversal.map(e => e ? DecCoin.toJSON(e) : undefined); + } else { + obj.spreadRewardGrowthOppositeDirectionOfLastTraversal = []; + } + message.uptimeTrackers !== undefined && (obj.uptimeTrackers = message.uptimeTrackers ? UptimeTrackers.toJSON(message.uptimeTrackers) : undefined); + return obj; + }, fromPartial(object: Partial): TickInfo { const message = createBaseTickInfo(); message.liquidityGross = object.liquidityGross ?? ""; @@ -133,12 +165,18 @@ export const TickInfo = { return message; }, fromAmino(object: TickInfoAmino): TickInfo { - return { - liquidityGross: object.liquidity_gross, - liquidityNet: object.liquidity_net, - spreadRewardGrowthOppositeDirectionOfLastTraversal: Array.isArray(object?.spread_reward_growth_opposite_direction_of_last_traversal) ? object.spread_reward_growth_opposite_direction_of_last_traversal.map((e: any) => DecCoin.fromAmino(e)) : [], - uptimeTrackers: object?.uptime_trackers ? UptimeTrackers.fromAmino(object.uptime_trackers) : undefined - }; + const message = createBaseTickInfo(); + if (object.liquidity_gross !== undefined && object.liquidity_gross !== null) { + message.liquidityGross = object.liquidity_gross; + } + if (object.liquidity_net !== undefined && object.liquidity_net !== null) { + message.liquidityNet = object.liquidity_net; + } + message.spreadRewardGrowthOppositeDirectionOfLastTraversal = object.spread_reward_growth_opposite_direction_of_last_traversal?.map(e => DecCoin.fromAmino(e)) || []; + if (object.uptime_trackers !== undefined && object.uptime_trackers !== null) { + message.uptimeTrackers = UptimeTrackers.fromAmino(object.uptime_trackers); + } + return message; }, toAmino(message: TickInfo): TickInfoAmino { const obj: any = {}; @@ -174,6 +212,8 @@ export const TickInfo = { }; } }; +GlobalDecoderRegistry.register(TickInfo.typeUrl, TickInfo); +GlobalDecoderRegistry.registerAminoProtoMapping(TickInfo.aminoType, TickInfo.typeUrl); function createBaseUptimeTrackers(): UptimeTrackers { return { list: [] @@ -181,6 +221,16 @@ function createBaseUptimeTrackers(): UptimeTrackers { } export const UptimeTrackers = { typeUrl: "/osmosis.concentratedliquidity.v1beta1.UptimeTrackers", + aminoType: "osmosis/concentratedliquidity/uptime-trackers", + is(o: any): o is UptimeTrackers { + return o && (o.$typeUrl === UptimeTrackers.typeUrl || Array.isArray(o.list) && (!o.list.length || UptimeTracker.is(o.list[0]))); + }, + isSDK(o: any): o is UptimeTrackersSDKType { + return o && (o.$typeUrl === UptimeTrackers.typeUrl || Array.isArray(o.list) && (!o.list.length || UptimeTracker.isSDK(o.list[0]))); + }, + isAmino(o: any): o is UptimeTrackersAmino { + return o && (o.$typeUrl === UptimeTrackers.typeUrl || Array.isArray(o.list) && (!o.list.length || UptimeTracker.isAmino(o.list[0]))); + }, encode(message: UptimeTrackers, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.list) { UptimeTracker.encode(v!, writer.uint32(10).fork()).ldelim(); @@ -204,15 +254,29 @@ export const UptimeTrackers = { } return message; }, + fromJSON(object: any): UptimeTrackers { + return { + list: Array.isArray(object?.list) ? object.list.map((e: any) => UptimeTracker.fromJSON(e)) : [] + }; + }, + toJSON(message: UptimeTrackers): unknown { + const obj: any = {}; + if (message.list) { + obj.list = message.list.map(e => e ? UptimeTracker.toJSON(e) : undefined); + } else { + obj.list = []; + } + return obj; + }, fromPartial(object: Partial): UptimeTrackers { const message = createBaseUptimeTrackers(); message.list = object.list?.map(e => UptimeTracker.fromPartial(e)) || []; return message; }, fromAmino(object: UptimeTrackersAmino): UptimeTrackers { - return { - list: Array.isArray(object?.list) ? object.list.map((e: any) => UptimeTracker.fromAmino(e)) : [] - }; + const message = createBaseUptimeTrackers(); + message.list = object.list?.map(e => UptimeTracker.fromAmino(e)) || []; + return message; }, toAmino(message: UptimeTrackers): UptimeTrackersAmino { const obj: any = {}; @@ -245,6 +309,8 @@ export const UptimeTrackers = { }; } }; +GlobalDecoderRegistry.register(UptimeTrackers.typeUrl, UptimeTrackers); +GlobalDecoderRegistry.registerAminoProtoMapping(UptimeTrackers.aminoType, UptimeTrackers.typeUrl); function createBaseUptimeTracker(): UptimeTracker { return { uptimeGrowthOutside: [] @@ -252,6 +318,16 @@ function createBaseUptimeTracker(): UptimeTracker { } export const UptimeTracker = { typeUrl: "/osmosis.concentratedliquidity.v1beta1.UptimeTracker", + aminoType: "osmosis/concentratedliquidity/uptime-tracker", + is(o: any): o is UptimeTracker { + return o && (o.$typeUrl === UptimeTracker.typeUrl || Array.isArray(o.uptimeGrowthOutside) && (!o.uptimeGrowthOutside.length || DecCoin.is(o.uptimeGrowthOutside[0]))); + }, + isSDK(o: any): o is UptimeTrackerSDKType { + return o && (o.$typeUrl === UptimeTracker.typeUrl || Array.isArray(o.uptime_growth_outside) && (!o.uptime_growth_outside.length || DecCoin.isSDK(o.uptime_growth_outside[0]))); + }, + isAmino(o: any): o is UptimeTrackerAmino { + return o && (o.$typeUrl === UptimeTracker.typeUrl || Array.isArray(o.uptime_growth_outside) && (!o.uptime_growth_outside.length || DecCoin.isAmino(o.uptime_growth_outside[0]))); + }, encode(message: UptimeTracker, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.uptimeGrowthOutside) { DecCoin.encode(v!, writer.uint32(10).fork()).ldelim(); @@ -275,15 +351,29 @@ export const UptimeTracker = { } return message; }, + fromJSON(object: any): UptimeTracker { + return { + uptimeGrowthOutside: Array.isArray(object?.uptimeGrowthOutside) ? object.uptimeGrowthOutside.map((e: any) => DecCoin.fromJSON(e)) : [] + }; + }, + toJSON(message: UptimeTracker): unknown { + const obj: any = {}; + if (message.uptimeGrowthOutside) { + obj.uptimeGrowthOutside = message.uptimeGrowthOutside.map(e => e ? DecCoin.toJSON(e) : undefined); + } else { + obj.uptimeGrowthOutside = []; + } + return obj; + }, fromPartial(object: Partial): UptimeTracker { const message = createBaseUptimeTracker(); message.uptimeGrowthOutside = object.uptimeGrowthOutside?.map(e => DecCoin.fromPartial(e)) || []; return message; }, fromAmino(object: UptimeTrackerAmino): UptimeTracker { - return { - uptimeGrowthOutside: Array.isArray(object?.uptime_growth_outside) ? object.uptime_growth_outside.map((e: any) => DecCoin.fromAmino(e)) : [] - }; + const message = createBaseUptimeTracker(); + message.uptimeGrowthOutside = object.uptime_growth_outside?.map(e => DecCoin.fromAmino(e)) || []; + return message; }, toAmino(message: UptimeTracker): UptimeTrackerAmino { const obj: any = {}; @@ -315,4 +405,6 @@ export const UptimeTracker = { value: UptimeTracker.encode(message).finish() }; } -}; \ No newline at end of file +}; +GlobalDecoderRegistry.register(UptimeTracker.typeUrl, UptimeTracker); +GlobalDecoderRegistry.registerAminoProtoMapping(UptimeTracker.aminoType, UptimeTracker.typeUrl); \ No newline at end of file diff --git a/packages/osmojs/src/codegen/osmosis/concentrated-liquidity/tx.amino.ts b/packages/osmojs/src/codegen/osmosis/concentratedliquidity/v1beta1/tx.amino.ts similarity index 63% rename from packages/osmojs/src/codegen/osmosis/concentrated-liquidity/tx.amino.ts rename to packages/osmojs/src/codegen/osmosis/concentratedliquidity/v1beta1/tx.amino.ts index 42b960a5a..9a1747e83 100644 --- a/packages/osmojs/src/codegen/osmosis/concentrated-liquidity/tx.amino.ts +++ b/packages/osmojs/src/codegen/osmosis/concentratedliquidity/v1beta1/tx.amino.ts @@ -1,29 +1,34 @@ //@ts-nocheck -import { MsgCreatePosition, MsgWithdrawPosition, MsgAddToPosition, MsgCollectSpreadRewards, MsgCollectIncentives } from "./tx"; +import { MsgCreatePosition, MsgWithdrawPosition, MsgAddToPosition, MsgCollectSpreadRewards, MsgCollectIncentives, MsgTransferPositions } from "./tx"; export const AminoConverter = { "/osmosis.concentratedliquidity.v1beta1.MsgCreatePosition": { - aminoType: "osmosis/concentratedliquidity/create-position", + aminoType: "osmosis/cl-create-position", toAmino: MsgCreatePosition.toAmino, fromAmino: MsgCreatePosition.fromAmino }, "/osmosis.concentratedliquidity.v1beta1.MsgWithdrawPosition": { - aminoType: "osmosis/concentratedliquidity/withdraw-position", + aminoType: "osmosis/cl-withdraw-position", toAmino: MsgWithdrawPosition.toAmino, fromAmino: MsgWithdrawPosition.fromAmino }, "/osmosis.concentratedliquidity.v1beta1.MsgAddToPosition": { - aminoType: "osmosis/concentratedliquidity/add-to-position", + aminoType: "osmosis/cl-add-to-position", toAmino: MsgAddToPosition.toAmino, fromAmino: MsgAddToPosition.fromAmino }, "/osmosis.concentratedliquidity.v1beta1.MsgCollectSpreadRewards": { - aminoType: "osmosis/concentratedliquidity/collect-spread-rewards", + aminoType: "osmosis/cl-col-sp-rewards", toAmino: MsgCollectSpreadRewards.toAmino, fromAmino: MsgCollectSpreadRewards.fromAmino }, "/osmosis.concentratedliquidity.v1beta1.MsgCollectIncentives": { - aminoType: "osmosis/concentratedliquidity/collect-incentives", + aminoType: "osmosis/cl-collect-incentives", toAmino: MsgCollectIncentives.toAmino, fromAmino: MsgCollectIncentives.fromAmino + }, + "/osmosis.concentratedliquidity.v1beta1.MsgTransferPositions": { + aminoType: "osmosis/cl-transfer-positions", + toAmino: MsgTransferPositions.toAmino, + fromAmino: MsgTransferPositions.fromAmino } }; \ No newline at end of file diff --git a/packages/osmojs/src/codegen/osmosis/concentrated-liquidity/tx.registry.ts b/packages/osmojs/src/codegen/osmosis/concentratedliquidity/v1beta1/tx.registry.ts similarity index 53% rename from packages/osmojs/src/codegen/osmosis/concentrated-liquidity/tx.registry.ts rename to packages/osmojs/src/codegen/osmosis/concentratedliquidity/v1beta1/tx.registry.ts index 965fa2714..a5b2dcc97 100644 --- a/packages/osmojs/src/codegen/osmosis/concentrated-liquidity/tx.registry.ts +++ b/packages/osmojs/src/codegen/osmosis/concentratedliquidity/v1beta1/tx.registry.ts @@ -1,7 +1,7 @@ //@ts-nocheck import { GeneratedType, Registry } from "@cosmjs/proto-signing"; -import { MsgCreatePosition, MsgWithdrawPosition, MsgAddToPosition, MsgCollectSpreadRewards, MsgCollectIncentives } from "./tx"; -export const registry: ReadonlyArray<[string, GeneratedType]> = [["/osmosis.concentratedliquidity.v1beta1.MsgCreatePosition", MsgCreatePosition], ["/osmosis.concentratedliquidity.v1beta1.MsgWithdrawPosition", MsgWithdrawPosition], ["/osmosis.concentratedliquidity.v1beta1.MsgAddToPosition", MsgAddToPosition], ["/osmosis.concentratedliquidity.v1beta1.MsgCollectSpreadRewards", MsgCollectSpreadRewards], ["/osmosis.concentratedliquidity.v1beta1.MsgCollectIncentives", MsgCollectIncentives]]; +import { MsgCreatePosition, MsgWithdrawPosition, MsgAddToPosition, MsgCollectSpreadRewards, MsgCollectIncentives, MsgTransferPositions } from "./tx"; +export const registry: ReadonlyArray<[string, GeneratedType]> = [["/osmosis.concentratedliquidity.v1beta1.MsgCreatePosition", MsgCreatePosition], ["/osmosis.concentratedliquidity.v1beta1.MsgWithdrawPosition", MsgWithdrawPosition], ["/osmosis.concentratedliquidity.v1beta1.MsgAddToPosition", MsgAddToPosition], ["/osmosis.concentratedliquidity.v1beta1.MsgCollectSpreadRewards", MsgCollectSpreadRewards], ["/osmosis.concentratedliquidity.v1beta1.MsgCollectIncentives", MsgCollectIncentives], ["/osmosis.concentratedliquidity.v1beta1.MsgTransferPositions", MsgTransferPositions]]; export const load = (protoRegistry: Registry) => { registry.forEach(([typeUrl, mod]) => { protoRegistry.register(typeUrl, mod); @@ -38,6 +38,12 @@ export const MessageComposer = { typeUrl: "/osmosis.concentratedliquidity.v1beta1.MsgCollectIncentives", value: MsgCollectIncentives.encode(value).finish() }; + }, + transferPositions(value: MsgTransferPositions) { + return { + typeUrl: "/osmosis.concentratedliquidity.v1beta1.MsgTransferPositions", + value: MsgTransferPositions.encode(value).finish() + }; } }, withTypeUrl: { @@ -70,6 +76,88 @@ export const MessageComposer = { typeUrl: "/osmosis.concentratedliquidity.v1beta1.MsgCollectIncentives", value }; + }, + transferPositions(value: MsgTransferPositions) { + return { + typeUrl: "/osmosis.concentratedliquidity.v1beta1.MsgTransferPositions", + value + }; + } + }, + toJSON: { + createPosition(value: MsgCreatePosition) { + return { + typeUrl: "/osmosis.concentratedliquidity.v1beta1.MsgCreatePosition", + value: MsgCreatePosition.toJSON(value) + }; + }, + withdrawPosition(value: MsgWithdrawPosition) { + return { + typeUrl: "/osmosis.concentratedliquidity.v1beta1.MsgWithdrawPosition", + value: MsgWithdrawPosition.toJSON(value) + }; + }, + addToPosition(value: MsgAddToPosition) { + return { + typeUrl: "/osmosis.concentratedliquidity.v1beta1.MsgAddToPosition", + value: MsgAddToPosition.toJSON(value) + }; + }, + collectSpreadRewards(value: MsgCollectSpreadRewards) { + return { + typeUrl: "/osmosis.concentratedliquidity.v1beta1.MsgCollectSpreadRewards", + value: MsgCollectSpreadRewards.toJSON(value) + }; + }, + collectIncentives(value: MsgCollectIncentives) { + return { + typeUrl: "/osmosis.concentratedliquidity.v1beta1.MsgCollectIncentives", + value: MsgCollectIncentives.toJSON(value) + }; + }, + transferPositions(value: MsgTransferPositions) { + return { + typeUrl: "/osmosis.concentratedliquidity.v1beta1.MsgTransferPositions", + value: MsgTransferPositions.toJSON(value) + }; + } + }, + fromJSON: { + createPosition(value: any) { + return { + typeUrl: "/osmosis.concentratedliquidity.v1beta1.MsgCreatePosition", + value: MsgCreatePosition.fromJSON(value) + }; + }, + withdrawPosition(value: any) { + return { + typeUrl: "/osmosis.concentratedliquidity.v1beta1.MsgWithdrawPosition", + value: MsgWithdrawPosition.fromJSON(value) + }; + }, + addToPosition(value: any) { + return { + typeUrl: "/osmosis.concentratedliquidity.v1beta1.MsgAddToPosition", + value: MsgAddToPosition.fromJSON(value) + }; + }, + collectSpreadRewards(value: any) { + return { + typeUrl: "/osmosis.concentratedliquidity.v1beta1.MsgCollectSpreadRewards", + value: MsgCollectSpreadRewards.fromJSON(value) + }; + }, + collectIncentives(value: any) { + return { + typeUrl: "/osmosis.concentratedliquidity.v1beta1.MsgCollectIncentives", + value: MsgCollectIncentives.fromJSON(value) + }; + }, + transferPositions(value: any) { + return { + typeUrl: "/osmosis.concentratedliquidity.v1beta1.MsgTransferPositions", + value: MsgTransferPositions.fromJSON(value) + }; } }, fromPartial: { @@ -102,6 +190,12 @@ export const MessageComposer = { typeUrl: "/osmosis.concentratedliquidity.v1beta1.MsgCollectIncentives", value: MsgCollectIncentives.fromPartial(value) }; + }, + transferPositions(value: MsgTransferPositions) { + return { + typeUrl: "/osmosis.concentratedliquidity.v1beta1.MsgTransferPositions", + value: MsgTransferPositions.fromPartial(value) + }; } } }; \ No newline at end of file diff --git a/packages/osmojs/src/codegen/osmosis/concentrated-liquidity/tx.rpc.msg.ts b/packages/osmojs/src/codegen/osmosis/concentratedliquidity/v1beta1/tx.rpc.msg.ts similarity index 78% rename from packages/osmojs/src/codegen/osmosis/concentrated-liquidity/tx.rpc.msg.ts rename to packages/osmojs/src/codegen/osmosis/concentratedliquidity/v1beta1/tx.rpc.msg.ts index 0de3af954..ef573cca1 100644 --- a/packages/osmojs/src/codegen/osmosis/concentrated-liquidity/tx.rpc.msg.ts +++ b/packages/osmojs/src/codegen/osmosis/concentratedliquidity/v1beta1/tx.rpc.msg.ts @@ -1,6 +1,6 @@ -import { Rpc } from "../../helpers"; -import { BinaryReader } from "../../binary"; -import { MsgCreatePosition, MsgCreatePositionResponse, MsgWithdrawPosition, MsgWithdrawPositionResponse, MsgAddToPosition, MsgAddToPositionResponse, MsgCollectSpreadRewards, MsgCollectSpreadRewardsResponse, MsgCollectIncentives, MsgCollectIncentivesResponse } from "./tx"; +import { Rpc } from "../../../helpers"; +import { BinaryReader } from "../../../binary"; +import { MsgCreatePosition, MsgCreatePositionResponse, MsgWithdrawPosition, MsgWithdrawPositionResponse, MsgAddToPosition, MsgAddToPositionResponse, MsgCollectSpreadRewards, MsgCollectSpreadRewardsResponse, MsgCollectIncentives, MsgCollectIncentivesResponse, MsgTransferPositions, MsgTransferPositionsResponse } from "./tx"; export interface Msg { createPosition(request: MsgCreatePosition): Promise; withdrawPosition(request: MsgWithdrawPosition): Promise; @@ -14,6 +14,11 @@ export interface Msg { addToPosition(request: MsgAddToPosition): Promise; collectSpreadRewards(request: MsgCollectSpreadRewards): Promise; collectIncentives(request: MsgCollectIncentives): Promise; + /** + * TransferPositions transfers ownership of a set of one or more positions + * from a sender to a recipient. + */ + transferPositions(request: MsgTransferPositions): Promise; } export class MsgClientImpl implements Msg { private readonly rpc: Rpc; @@ -24,6 +29,7 @@ export class MsgClientImpl implements Msg { this.addToPosition = this.addToPosition.bind(this); this.collectSpreadRewards = this.collectSpreadRewards.bind(this); this.collectIncentives = this.collectIncentives.bind(this); + this.transferPositions = this.transferPositions.bind(this); } createPosition(request: MsgCreatePosition): Promise { const data = MsgCreatePosition.encode(request).finish(); @@ -50,4 +56,12 @@ export class MsgClientImpl implements Msg { const promise = this.rpc.request("osmosis.concentratedliquidity.v1beta1.Msg", "CollectIncentives", data); return promise.then(data => MsgCollectIncentivesResponse.decode(new BinaryReader(data))); } -} \ No newline at end of file + transferPositions(request: MsgTransferPositions): Promise { + const data = MsgTransferPositions.encode(request).finish(); + const promise = this.rpc.request("osmosis.concentratedliquidity.v1beta1.Msg", "TransferPositions", data); + return promise.then(data => MsgTransferPositionsResponse.decode(new BinaryReader(data))); + } +} +export const createClientImpl = (rpc: Rpc) => { + return new MsgClientImpl(rpc); +}; \ No newline at end of file diff --git a/packages/osmo-query/src/codegen/osmosis/concentrated-liquidity/tx.ts b/packages/osmojs/src/codegen/osmosis/concentratedliquidity/v1beta1/tx.ts similarity index 56% rename from packages/osmo-query/src/codegen/osmosis/concentrated-liquidity/tx.ts rename to packages/osmojs/src/codegen/osmosis/concentratedliquidity/v1beta1/tx.ts index 52a00f6b5..ed7b6e53f 100644 --- a/packages/osmo-query/src/codegen/osmosis/concentrated-liquidity/tx.ts +++ b/packages/osmojs/src/codegen/osmosis/concentratedliquidity/v1beta1/tx.ts @@ -1,5 +1,7 @@ -import { Coin, CoinAmino, CoinSDKType } from "../../cosmos/base/v1beta1/coin"; -import { BinaryReader, BinaryWriter } from "../../binary"; +import { Coin, CoinAmino, CoinSDKType } from "../../../cosmos/base/v1beta1/coin"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { isSet } from "../../../helpers"; +import { GlobalDecoderRegistry } from "../../../registry"; import { Decimal } from "@cosmjs/math"; /** ===================== MsgCreatePosition */ export interface MsgCreatePosition { @@ -23,22 +25,22 @@ export interface MsgCreatePositionProtoMsg { } /** ===================== MsgCreatePosition */ export interface MsgCreatePositionAmino { - pool_id: string; - sender: string; - lower_tick: string; - upper_tick: string; + pool_id?: string; + sender?: string; + lower_tick?: string; + upper_tick?: string; /** * tokens_provided is the amount of tokens provided for the position. * It must at a minimum be of length 1 (for a single sided position) * and at a maximum be of length 2 (for a position that straddles the current * tick). */ - tokens_provided: CoinAmino[]; - token_min_amount0: string; - token_min_amount1: string; + tokens_provided?: CoinAmino[]; + token_min_amount0?: string; + token_min_amount1?: string; } export interface MsgCreatePositionAminoMsg { - type: "osmosis/concentratedliquidity/create-position"; + type: "osmosis/cl-create-position"; value: MsgCreatePositionAmino; } /** ===================== MsgCreatePosition */ @@ -70,18 +72,18 @@ export interface MsgCreatePositionResponseProtoMsg { value: Uint8Array; } export interface MsgCreatePositionResponseAmino { - position_id: string; - amount0: string; - amount1: string; - liquidity_created: string; + position_id?: string; + amount0?: string; + amount1?: string; + liquidity_created?: string; /** * the lower and upper tick are in the response because there are * instances in which multiple ticks represent the same price, so * we may move their provided tick to the canonical tick that represents * the same price. */ - lower_tick: string; - upper_tick: string; + lower_tick?: string; + upper_tick?: string; } export interface MsgCreatePositionResponseAminoMsg { type: "osmosis/concentratedliquidity/create-position-response"; @@ -124,29 +126,29 @@ export interface MsgAddToPositionProtoMsg { } /** ===================== MsgAddToPosition */ export interface MsgAddToPositionAmino { - position_id: string; - sender: string; + position_id?: string; + sender?: string; /** amount0 represents the amount of token0 willing to put in. */ - amount0: string; + amount0?: string; /** amount1 represents the amount of token1 willing to put in. */ - amount1: string; + amount1?: string; /** * token_min_amount0 represents the minimum amount of token0 desired from the * new position being created. Note that this field indicates the min amount0 * corresponding to the liquidity that is being added, not the total * liquidity of the position. */ - token_min_amount0: string; + token_min_amount0?: string; /** * token_min_amount1 represents the minimum amount of token1 desired from the * new position being created. Note that this field indicates the min amount1 * corresponding to the liquidity that is being added, not the total * liquidity of the position. */ - token_min_amount1: string; + token_min_amount1?: string; } export interface MsgAddToPositionAminoMsg { - type: "osmosis/concentratedliquidity/add-to-position"; + type: "osmosis/cl-add-to-position"; value: MsgAddToPositionAmino; } /** ===================== MsgAddToPosition */ @@ -168,9 +170,9 @@ export interface MsgAddToPositionResponseProtoMsg { value: Uint8Array; } export interface MsgAddToPositionResponseAmino { - position_id: string; - amount0: string; - amount1: string; + position_id?: string; + amount0?: string; + amount1?: string; } export interface MsgAddToPositionResponseAminoMsg { type: "osmosis/concentratedliquidity/add-to-position-response"; @@ -193,12 +195,12 @@ export interface MsgWithdrawPositionProtoMsg { } /** ===================== MsgWithdrawPosition */ export interface MsgWithdrawPositionAmino { - position_id: string; - sender: string; - liquidity_amount: string; + position_id?: string; + sender?: string; + liquidity_amount?: string; } export interface MsgWithdrawPositionAminoMsg { - type: "osmosis/concentratedliquidity/withdraw-position"; + type: "osmosis/cl-withdraw-position"; value: MsgWithdrawPositionAmino; } /** ===================== MsgWithdrawPosition */ @@ -216,8 +218,8 @@ export interface MsgWithdrawPositionResponseProtoMsg { value: Uint8Array; } export interface MsgWithdrawPositionResponseAmino { - amount0: string; - amount1: string; + amount0?: string; + amount1?: string; } export interface MsgWithdrawPositionResponseAminoMsg { type: "osmosis/concentratedliquidity/withdraw-position-response"; @@ -238,11 +240,11 @@ export interface MsgCollectSpreadRewardsProtoMsg { } /** ===================== MsgCollectSpreadRewards */ export interface MsgCollectSpreadRewardsAmino { - position_ids: string[]; - sender: string; + position_ids?: string[]; + sender?: string; } export interface MsgCollectSpreadRewardsAminoMsg { - type: "osmosis/concentratedliquidity/collect-spread-rewards"; + type: "osmosis/cl-col-sp-rewards"; value: MsgCollectSpreadRewardsAmino; } /** ===================== MsgCollectSpreadRewards */ @@ -258,7 +260,7 @@ export interface MsgCollectSpreadRewardsResponseProtoMsg { value: Uint8Array; } export interface MsgCollectSpreadRewardsResponseAmino { - collected_spread_rewards: CoinAmino[]; + collected_spread_rewards?: CoinAmino[]; } export interface MsgCollectSpreadRewardsResponseAminoMsg { type: "osmosis/concentratedliquidity/collect-spread-rewards-response"; @@ -278,11 +280,11 @@ export interface MsgCollectIncentivesProtoMsg { } /** ===================== MsgCollectIncentives */ export interface MsgCollectIncentivesAmino { - position_ids: string[]; - sender: string; + position_ids?: string[]; + sender?: string; } export interface MsgCollectIncentivesAminoMsg { - type: "osmosis/concentratedliquidity/collect-incentives"; + type: "osmosis/cl-collect-incentives"; value: MsgCollectIncentivesAmino; } /** ===================== MsgCollectIncentives */ @@ -299,8 +301,8 @@ export interface MsgCollectIncentivesResponseProtoMsg { value: Uint8Array; } export interface MsgCollectIncentivesResponseAmino { - collected_incentives: CoinAmino[]; - forfeited_incentives: CoinAmino[]; + collected_incentives?: CoinAmino[]; + forfeited_incentives?: CoinAmino[]; } export interface MsgCollectIncentivesResponseAminoMsg { type: "osmosis/concentratedliquidity/collect-incentives-response"; @@ -321,11 +323,11 @@ export interface MsgFungifyChargedPositionsProtoMsg { } /** ===================== MsgFungifyChargedPositions */ export interface MsgFungifyChargedPositionsAmino { - position_ids: string[]; - sender: string; + position_ids?: string[]; + sender?: string; } export interface MsgFungifyChargedPositionsAminoMsg { - type: "osmosis/concentratedliquidity/fungify-charged-positions"; + type: "osmosis/cl-fungify-charged-positions"; value: MsgFungifyChargedPositionsAmino; } /** ===================== MsgFungifyChargedPositions */ @@ -341,7 +343,7 @@ export interface MsgFungifyChargedPositionsResponseProtoMsg { value: Uint8Array; } export interface MsgFungifyChargedPositionsResponseAmino { - new_position_id: string; + new_position_id?: string; } export interface MsgFungifyChargedPositionsResponseAminoMsg { type: "osmosis/concentratedliquidity/fungify-charged-positions-response"; @@ -350,6 +352,43 @@ export interface MsgFungifyChargedPositionsResponseAminoMsg { export interface MsgFungifyChargedPositionsResponseSDKType { new_position_id: bigint; } +/** ===================== MsgTransferPositions */ +export interface MsgTransferPositions { + positionIds: bigint[]; + sender: string; + newOwner: string; +} +export interface MsgTransferPositionsProtoMsg { + typeUrl: "/osmosis.concentratedliquidity.v1beta1.MsgTransferPositions"; + value: Uint8Array; +} +/** ===================== MsgTransferPositions */ +export interface MsgTransferPositionsAmino { + position_ids?: string[]; + sender?: string; + new_owner?: string; +} +export interface MsgTransferPositionsAminoMsg { + type: "osmosis/cl-transfer-positions"; + value: MsgTransferPositionsAmino; +} +/** ===================== MsgTransferPositions */ +export interface MsgTransferPositionsSDKType { + position_ids: bigint[]; + sender: string; + new_owner: string; +} +export interface MsgTransferPositionsResponse {} +export interface MsgTransferPositionsResponseProtoMsg { + typeUrl: "/osmosis.concentratedliquidity.v1beta1.MsgTransferPositionsResponse"; + value: Uint8Array; +} +export interface MsgTransferPositionsResponseAmino {} +export interface MsgTransferPositionsResponseAminoMsg { + type: "osmosis/concentratedliquidity/transfer-positions-response"; + value: MsgTransferPositionsResponseAmino; +} +export interface MsgTransferPositionsResponseSDKType {} function createBaseMsgCreatePosition(): MsgCreatePosition { return { poolId: BigInt(0), @@ -363,6 +402,16 @@ function createBaseMsgCreatePosition(): MsgCreatePosition { } export const MsgCreatePosition = { typeUrl: "/osmosis.concentratedliquidity.v1beta1.MsgCreatePosition", + aminoType: "osmosis/cl-create-position", + is(o: any): o is MsgCreatePosition { + return o && (o.$typeUrl === MsgCreatePosition.typeUrl || typeof o.poolId === "bigint" && typeof o.sender === "string" && typeof o.lowerTick === "bigint" && typeof o.upperTick === "bigint" && Array.isArray(o.tokensProvided) && (!o.tokensProvided.length || Coin.is(o.tokensProvided[0])) && typeof o.tokenMinAmount0 === "string" && typeof o.tokenMinAmount1 === "string"); + }, + isSDK(o: any): o is MsgCreatePositionSDKType { + return o && (o.$typeUrl === MsgCreatePosition.typeUrl || typeof o.pool_id === "bigint" && typeof o.sender === "string" && typeof o.lower_tick === "bigint" && typeof o.upper_tick === "bigint" && Array.isArray(o.tokens_provided) && (!o.tokens_provided.length || Coin.isSDK(o.tokens_provided[0])) && typeof o.token_min_amount0 === "string" && typeof o.token_min_amount1 === "string"); + }, + isAmino(o: any): o is MsgCreatePositionAmino { + return o && (o.$typeUrl === MsgCreatePosition.typeUrl || typeof o.pool_id === "bigint" && typeof o.sender === "string" && typeof o.lower_tick === "bigint" && typeof o.upper_tick === "bigint" && Array.isArray(o.tokens_provided) && (!o.tokens_provided.length || Coin.isAmino(o.tokens_provided[0])) && typeof o.token_min_amount0 === "string" && typeof o.token_min_amount1 === "string"); + }, encode(message: MsgCreatePosition, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.poolId !== BigInt(0)) { writer.uint32(8).uint64(message.poolId); @@ -422,6 +471,32 @@ export const MsgCreatePosition = { } return message; }, + fromJSON(object: any): MsgCreatePosition { + return { + poolId: isSet(object.poolId) ? BigInt(object.poolId.toString()) : BigInt(0), + sender: isSet(object.sender) ? String(object.sender) : "", + lowerTick: isSet(object.lowerTick) ? BigInt(object.lowerTick.toString()) : BigInt(0), + upperTick: isSet(object.upperTick) ? BigInt(object.upperTick.toString()) : BigInt(0), + tokensProvided: Array.isArray(object?.tokensProvided) ? object.tokensProvided.map((e: any) => Coin.fromJSON(e)) : [], + tokenMinAmount0: isSet(object.tokenMinAmount0) ? String(object.tokenMinAmount0) : "", + tokenMinAmount1: isSet(object.tokenMinAmount1) ? String(object.tokenMinAmount1) : "" + }; + }, + toJSON(message: MsgCreatePosition): unknown { + const obj: any = {}; + message.poolId !== undefined && (obj.poolId = (message.poolId || BigInt(0)).toString()); + message.sender !== undefined && (obj.sender = message.sender); + message.lowerTick !== undefined && (obj.lowerTick = (message.lowerTick || BigInt(0)).toString()); + message.upperTick !== undefined && (obj.upperTick = (message.upperTick || BigInt(0)).toString()); + if (message.tokensProvided) { + obj.tokensProvided = message.tokensProvided.map(e => e ? Coin.toJSON(e) : undefined); + } else { + obj.tokensProvided = []; + } + message.tokenMinAmount0 !== undefined && (obj.tokenMinAmount0 = message.tokenMinAmount0); + message.tokenMinAmount1 !== undefined && (obj.tokenMinAmount1 = message.tokenMinAmount1); + return obj; + }, fromPartial(object: Partial): MsgCreatePosition { const message = createBaseMsgCreatePosition(); message.poolId = object.poolId !== undefined && object.poolId !== null ? BigInt(object.poolId.toString()) : BigInt(0); @@ -434,15 +509,27 @@ export const MsgCreatePosition = { return message; }, fromAmino(object: MsgCreatePositionAmino): MsgCreatePosition { - return { - poolId: BigInt(object.pool_id), - sender: object.sender, - lowerTick: BigInt(object.lower_tick), - upperTick: BigInt(object.upper_tick), - tokensProvided: Array.isArray(object?.tokens_provided) ? object.tokens_provided.map((e: any) => Coin.fromAmino(e)) : [], - tokenMinAmount0: object.token_min_amount0, - tokenMinAmount1: object.token_min_amount1 - }; + const message = createBaseMsgCreatePosition(); + if (object.pool_id !== undefined && object.pool_id !== null) { + message.poolId = BigInt(object.pool_id); + } + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + if (object.lower_tick !== undefined && object.lower_tick !== null) { + message.lowerTick = BigInt(object.lower_tick); + } + if (object.upper_tick !== undefined && object.upper_tick !== null) { + message.upperTick = BigInt(object.upper_tick); + } + message.tokensProvided = object.tokens_provided?.map(e => Coin.fromAmino(e)) || []; + if (object.token_min_amount0 !== undefined && object.token_min_amount0 !== null) { + message.tokenMinAmount0 = object.token_min_amount0; + } + if (object.token_min_amount1 !== undefined && object.token_min_amount1 !== null) { + message.tokenMinAmount1 = object.token_min_amount1; + } + return message; }, toAmino(message: MsgCreatePosition): MsgCreatePositionAmino { const obj: any = {}; @@ -464,7 +551,7 @@ export const MsgCreatePosition = { }, toAminoMsg(message: MsgCreatePosition): MsgCreatePositionAminoMsg { return { - type: "osmosis/concentratedliquidity/create-position", + type: "osmosis/cl-create-position", value: MsgCreatePosition.toAmino(message) }; }, @@ -481,6 +568,8 @@ export const MsgCreatePosition = { }; } }; +GlobalDecoderRegistry.register(MsgCreatePosition.typeUrl, MsgCreatePosition); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgCreatePosition.aminoType, MsgCreatePosition.typeUrl); function createBaseMsgCreatePositionResponse(): MsgCreatePositionResponse { return { positionId: BigInt(0), @@ -493,6 +582,16 @@ function createBaseMsgCreatePositionResponse(): MsgCreatePositionResponse { } export const MsgCreatePositionResponse = { typeUrl: "/osmosis.concentratedliquidity.v1beta1.MsgCreatePositionResponse", + aminoType: "osmosis/concentratedliquidity/create-position-response", + is(o: any): o is MsgCreatePositionResponse { + return o && (o.$typeUrl === MsgCreatePositionResponse.typeUrl || typeof o.positionId === "bigint" && typeof o.amount0 === "string" && typeof o.amount1 === "string" && typeof o.liquidityCreated === "string" && typeof o.lowerTick === "bigint" && typeof o.upperTick === "bigint"); + }, + isSDK(o: any): o is MsgCreatePositionResponseSDKType { + return o && (o.$typeUrl === MsgCreatePositionResponse.typeUrl || typeof o.position_id === "bigint" && typeof o.amount0 === "string" && typeof o.amount1 === "string" && typeof o.liquidity_created === "string" && typeof o.lower_tick === "bigint" && typeof o.upper_tick === "bigint"); + }, + isAmino(o: any): o is MsgCreatePositionResponseAmino { + return o && (o.$typeUrl === MsgCreatePositionResponse.typeUrl || typeof o.position_id === "bigint" && typeof o.amount0 === "string" && typeof o.amount1 === "string" && typeof o.liquidity_created === "string" && typeof o.lower_tick === "bigint" && typeof o.upper_tick === "bigint"); + }, encode(message: MsgCreatePositionResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.positionId !== BigInt(0)) { writer.uint32(8).uint64(message.positionId); @@ -546,6 +645,26 @@ export const MsgCreatePositionResponse = { } return message; }, + fromJSON(object: any): MsgCreatePositionResponse { + return { + positionId: isSet(object.positionId) ? BigInt(object.positionId.toString()) : BigInt(0), + amount0: isSet(object.amount0) ? String(object.amount0) : "", + amount1: isSet(object.amount1) ? String(object.amount1) : "", + liquidityCreated: isSet(object.liquidityCreated) ? String(object.liquidityCreated) : "", + lowerTick: isSet(object.lowerTick) ? BigInt(object.lowerTick.toString()) : BigInt(0), + upperTick: isSet(object.upperTick) ? BigInt(object.upperTick.toString()) : BigInt(0) + }; + }, + toJSON(message: MsgCreatePositionResponse): unknown { + const obj: any = {}; + message.positionId !== undefined && (obj.positionId = (message.positionId || BigInt(0)).toString()); + message.amount0 !== undefined && (obj.amount0 = message.amount0); + message.amount1 !== undefined && (obj.amount1 = message.amount1); + message.liquidityCreated !== undefined && (obj.liquidityCreated = message.liquidityCreated); + message.lowerTick !== undefined && (obj.lowerTick = (message.lowerTick || BigInt(0)).toString()); + message.upperTick !== undefined && (obj.upperTick = (message.upperTick || BigInt(0)).toString()); + return obj; + }, fromPartial(object: Partial): MsgCreatePositionResponse { const message = createBaseMsgCreatePositionResponse(); message.positionId = object.positionId !== undefined && object.positionId !== null ? BigInt(object.positionId.toString()) : BigInt(0); @@ -557,14 +676,26 @@ export const MsgCreatePositionResponse = { return message; }, fromAmino(object: MsgCreatePositionResponseAmino): MsgCreatePositionResponse { - return { - positionId: BigInt(object.position_id), - amount0: object.amount0, - amount1: object.amount1, - liquidityCreated: object.liquidity_created, - lowerTick: BigInt(object.lower_tick), - upperTick: BigInt(object.upper_tick) - }; + const message = createBaseMsgCreatePositionResponse(); + if (object.position_id !== undefined && object.position_id !== null) { + message.positionId = BigInt(object.position_id); + } + if (object.amount0 !== undefined && object.amount0 !== null) { + message.amount0 = object.amount0; + } + if (object.amount1 !== undefined && object.amount1 !== null) { + message.amount1 = object.amount1; + } + if (object.liquidity_created !== undefined && object.liquidity_created !== null) { + message.liquidityCreated = object.liquidity_created; + } + if (object.lower_tick !== undefined && object.lower_tick !== null) { + message.lowerTick = BigInt(object.lower_tick); + } + if (object.upper_tick !== undefined && object.upper_tick !== null) { + message.upperTick = BigInt(object.upper_tick); + } + return message; }, toAmino(message: MsgCreatePositionResponse): MsgCreatePositionResponseAmino { const obj: any = {}; @@ -598,6 +729,8 @@ export const MsgCreatePositionResponse = { }; } }; +GlobalDecoderRegistry.register(MsgCreatePositionResponse.typeUrl, MsgCreatePositionResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgCreatePositionResponse.aminoType, MsgCreatePositionResponse.typeUrl); function createBaseMsgAddToPosition(): MsgAddToPosition { return { positionId: BigInt(0), @@ -610,6 +743,16 @@ function createBaseMsgAddToPosition(): MsgAddToPosition { } export const MsgAddToPosition = { typeUrl: "/osmosis.concentratedliquidity.v1beta1.MsgAddToPosition", + aminoType: "osmosis/cl-add-to-position", + is(o: any): o is MsgAddToPosition { + return o && (o.$typeUrl === MsgAddToPosition.typeUrl || typeof o.positionId === "bigint" && typeof o.sender === "string" && typeof o.amount0 === "string" && typeof o.amount1 === "string" && typeof o.tokenMinAmount0 === "string" && typeof o.tokenMinAmount1 === "string"); + }, + isSDK(o: any): o is MsgAddToPositionSDKType { + return o && (o.$typeUrl === MsgAddToPosition.typeUrl || typeof o.position_id === "bigint" && typeof o.sender === "string" && typeof o.amount0 === "string" && typeof o.amount1 === "string" && typeof o.token_min_amount0 === "string" && typeof o.token_min_amount1 === "string"); + }, + isAmino(o: any): o is MsgAddToPositionAmino { + return o && (o.$typeUrl === MsgAddToPosition.typeUrl || typeof o.position_id === "bigint" && typeof o.sender === "string" && typeof o.amount0 === "string" && typeof o.amount1 === "string" && typeof o.token_min_amount0 === "string" && typeof o.token_min_amount1 === "string"); + }, encode(message: MsgAddToPosition, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.positionId !== BigInt(0)) { writer.uint32(8).uint64(message.positionId); @@ -663,6 +806,26 @@ export const MsgAddToPosition = { } return message; }, + fromJSON(object: any): MsgAddToPosition { + return { + positionId: isSet(object.positionId) ? BigInt(object.positionId.toString()) : BigInt(0), + sender: isSet(object.sender) ? String(object.sender) : "", + amount0: isSet(object.amount0) ? String(object.amount0) : "", + amount1: isSet(object.amount1) ? String(object.amount1) : "", + tokenMinAmount0: isSet(object.tokenMinAmount0) ? String(object.tokenMinAmount0) : "", + tokenMinAmount1: isSet(object.tokenMinAmount1) ? String(object.tokenMinAmount1) : "" + }; + }, + toJSON(message: MsgAddToPosition): unknown { + const obj: any = {}; + message.positionId !== undefined && (obj.positionId = (message.positionId || BigInt(0)).toString()); + message.sender !== undefined && (obj.sender = message.sender); + message.amount0 !== undefined && (obj.amount0 = message.amount0); + message.amount1 !== undefined && (obj.amount1 = message.amount1); + message.tokenMinAmount0 !== undefined && (obj.tokenMinAmount0 = message.tokenMinAmount0); + message.tokenMinAmount1 !== undefined && (obj.tokenMinAmount1 = message.tokenMinAmount1); + return obj; + }, fromPartial(object: Partial): MsgAddToPosition { const message = createBaseMsgAddToPosition(); message.positionId = object.positionId !== undefined && object.positionId !== null ? BigInt(object.positionId.toString()) : BigInt(0); @@ -674,14 +837,26 @@ export const MsgAddToPosition = { return message; }, fromAmino(object: MsgAddToPositionAmino): MsgAddToPosition { - return { - positionId: BigInt(object.position_id), - sender: object.sender, - amount0: object.amount0, - amount1: object.amount1, - tokenMinAmount0: object.token_min_amount0, - tokenMinAmount1: object.token_min_amount1 - }; + const message = createBaseMsgAddToPosition(); + if (object.position_id !== undefined && object.position_id !== null) { + message.positionId = BigInt(object.position_id); + } + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + if (object.amount0 !== undefined && object.amount0 !== null) { + message.amount0 = object.amount0; + } + if (object.amount1 !== undefined && object.amount1 !== null) { + message.amount1 = object.amount1; + } + if (object.token_min_amount0 !== undefined && object.token_min_amount0 !== null) { + message.tokenMinAmount0 = object.token_min_amount0; + } + if (object.token_min_amount1 !== undefined && object.token_min_amount1 !== null) { + message.tokenMinAmount1 = object.token_min_amount1; + } + return message; }, toAmino(message: MsgAddToPosition): MsgAddToPositionAmino { const obj: any = {}; @@ -698,7 +873,7 @@ export const MsgAddToPosition = { }, toAminoMsg(message: MsgAddToPosition): MsgAddToPositionAminoMsg { return { - type: "osmosis/concentratedliquidity/add-to-position", + type: "osmosis/cl-add-to-position", value: MsgAddToPosition.toAmino(message) }; }, @@ -715,6 +890,8 @@ export const MsgAddToPosition = { }; } }; +GlobalDecoderRegistry.register(MsgAddToPosition.typeUrl, MsgAddToPosition); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgAddToPosition.aminoType, MsgAddToPosition.typeUrl); function createBaseMsgAddToPositionResponse(): MsgAddToPositionResponse { return { positionId: BigInt(0), @@ -724,6 +901,16 @@ function createBaseMsgAddToPositionResponse(): MsgAddToPositionResponse { } export const MsgAddToPositionResponse = { typeUrl: "/osmosis.concentratedliquidity.v1beta1.MsgAddToPositionResponse", + aminoType: "osmosis/concentratedliquidity/add-to-position-response", + is(o: any): o is MsgAddToPositionResponse { + return o && (o.$typeUrl === MsgAddToPositionResponse.typeUrl || typeof o.positionId === "bigint" && typeof o.amount0 === "string" && typeof o.amount1 === "string"); + }, + isSDK(o: any): o is MsgAddToPositionResponseSDKType { + return o && (o.$typeUrl === MsgAddToPositionResponse.typeUrl || typeof o.position_id === "bigint" && typeof o.amount0 === "string" && typeof o.amount1 === "string"); + }, + isAmino(o: any): o is MsgAddToPositionResponseAmino { + return o && (o.$typeUrl === MsgAddToPositionResponse.typeUrl || typeof o.position_id === "bigint" && typeof o.amount0 === "string" && typeof o.amount1 === "string"); + }, encode(message: MsgAddToPositionResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.positionId !== BigInt(0)) { writer.uint32(8).uint64(message.positionId); @@ -759,6 +946,20 @@ export const MsgAddToPositionResponse = { } return message; }, + fromJSON(object: any): MsgAddToPositionResponse { + return { + positionId: isSet(object.positionId) ? BigInt(object.positionId.toString()) : BigInt(0), + amount0: isSet(object.amount0) ? String(object.amount0) : "", + amount1: isSet(object.amount1) ? String(object.amount1) : "" + }; + }, + toJSON(message: MsgAddToPositionResponse): unknown { + const obj: any = {}; + message.positionId !== undefined && (obj.positionId = (message.positionId || BigInt(0)).toString()); + message.amount0 !== undefined && (obj.amount0 = message.amount0); + message.amount1 !== undefined && (obj.amount1 = message.amount1); + return obj; + }, fromPartial(object: Partial): MsgAddToPositionResponse { const message = createBaseMsgAddToPositionResponse(); message.positionId = object.positionId !== undefined && object.positionId !== null ? BigInt(object.positionId.toString()) : BigInt(0); @@ -767,11 +968,17 @@ export const MsgAddToPositionResponse = { return message; }, fromAmino(object: MsgAddToPositionResponseAmino): MsgAddToPositionResponse { - return { - positionId: BigInt(object.position_id), - amount0: object.amount0, - amount1: object.amount1 - }; + const message = createBaseMsgAddToPositionResponse(); + if (object.position_id !== undefined && object.position_id !== null) { + message.positionId = BigInt(object.position_id); + } + if (object.amount0 !== undefined && object.amount0 !== null) { + message.amount0 = object.amount0; + } + if (object.amount1 !== undefined && object.amount1 !== null) { + message.amount1 = object.amount1; + } + return message; }, toAmino(message: MsgAddToPositionResponse): MsgAddToPositionResponseAmino { const obj: any = {}; @@ -802,6 +1009,8 @@ export const MsgAddToPositionResponse = { }; } }; +GlobalDecoderRegistry.register(MsgAddToPositionResponse.typeUrl, MsgAddToPositionResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgAddToPositionResponse.aminoType, MsgAddToPositionResponse.typeUrl); function createBaseMsgWithdrawPosition(): MsgWithdrawPosition { return { positionId: BigInt(0), @@ -811,6 +1020,16 @@ function createBaseMsgWithdrawPosition(): MsgWithdrawPosition { } export const MsgWithdrawPosition = { typeUrl: "/osmosis.concentratedliquidity.v1beta1.MsgWithdrawPosition", + aminoType: "osmosis/cl-withdraw-position", + is(o: any): o is MsgWithdrawPosition { + return o && (o.$typeUrl === MsgWithdrawPosition.typeUrl || typeof o.positionId === "bigint" && typeof o.sender === "string" && typeof o.liquidityAmount === "string"); + }, + isSDK(o: any): o is MsgWithdrawPositionSDKType { + return o && (o.$typeUrl === MsgWithdrawPosition.typeUrl || typeof o.position_id === "bigint" && typeof o.sender === "string" && typeof o.liquidity_amount === "string"); + }, + isAmino(o: any): o is MsgWithdrawPositionAmino { + return o && (o.$typeUrl === MsgWithdrawPosition.typeUrl || typeof o.position_id === "bigint" && typeof o.sender === "string" && typeof o.liquidity_amount === "string"); + }, encode(message: MsgWithdrawPosition, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.positionId !== BigInt(0)) { writer.uint32(8).uint64(message.positionId); @@ -846,6 +1065,20 @@ export const MsgWithdrawPosition = { } return message; }, + fromJSON(object: any): MsgWithdrawPosition { + return { + positionId: isSet(object.positionId) ? BigInt(object.positionId.toString()) : BigInt(0), + sender: isSet(object.sender) ? String(object.sender) : "", + liquidityAmount: isSet(object.liquidityAmount) ? String(object.liquidityAmount) : "" + }; + }, + toJSON(message: MsgWithdrawPosition): unknown { + const obj: any = {}; + message.positionId !== undefined && (obj.positionId = (message.positionId || BigInt(0)).toString()); + message.sender !== undefined && (obj.sender = message.sender); + message.liquidityAmount !== undefined && (obj.liquidityAmount = message.liquidityAmount); + return obj; + }, fromPartial(object: Partial): MsgWithdrawPosition { const message = createBaseMsgWithdrawPosition(); message.positionId = object.positionId !== undefined && object.positionId !== null ? BigInt(object.positionId.toString()) : BigInt(0); @@ -854,11 +1087,17 @@ export const MsgWithdrawPosition = { return message; }, fromAmino(object: MsgWithdrawPositionAmino): MsgWithdrawPosition { - return { - positionId: BigInt(object.position_id), - sender: object.sender, - liquidityAmount: object.liquidity_amount - }; + const message = createBaseMsgWithdrawPosition(); + if (object.position_id !== undefined && object.position_id !== null) { + message.positionId = BigInt(object.position_id); + } + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + if (object.liquidity_amount !== undefined && object.liquidity_amount !== null) { + message.liquidityAmount = object.liquidity_amount; + } + return message; }, toAmino(message: MsgWithdrawPosition): MsgWithdrawPositionAmino { const obj: any = {}; @@ -872,7 +1111,7 @@ export const MsgWithdrawPosition = { }, toAminoMsg(message: MsgWithdrawPosition): MsgWithdrawPositionAminoMsg { return { - type: "osmosis/concentratedliquidity/withdraw-position", + type: "osmosis/cl-withdraw-position", value: MsgWithdrawPosition.toAmino(message) }; }, @@ -889,6 +1128,8 @@ export const MsgWithdrawPosition = { }; } }; +GlobalDecoderRegistry.register(MsgWithdrawPosition.typeUrl, MsgWithdrawPosition); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgWithdrawPosition.aminoType, MsgWithdrawPosition.typeUrl); function createBaseMsgWithdrawPositionResponse(): MsgWithdrawPositionResponse { return { amount0: "", @@ -897,6 +1138,16 @@ function createBaseMsgWithdrawPositionResponse(): MsgWithdrawPositionResponse { } export const MsgWithdrawPositionResponse = { typeUrl: "/osmosis.concentratedliquidity.v1beta1.MsgWithdrawPositionResponse", + aminoType: "osmosis/concentratedliquidity/withdraw-position-response", + is(o: any): o is MsgWithdrawPositionResponse { + return o && (o.$typeUrl === MsgWithdrawPositionResponse.typeUrl || typeof o.amount0 === "string" && typeof o.amount1 === "string"); + }, + isSDK(o: any): o is MsgWithdrawPositionResponseSDKType { + return o && (o.$typeUrl === MsgWithdrawPositionResponse.typeUrl || typeof o.amount0 === "string" && typeof o.amount1 === "string"); + }, + isAmino(o: any): o is MsgWithdrawPositionResponseAmino { + return o && (o.$typeUrl === MsgWithdrawPositionResponse.typeUrl || typeof o.amount0 === "string" && typeof o.amount1 === "string"); + }, encode(message: MsgWithdrawPositionResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.amount0 !== "") { writer.uint32(10).string(message.amount0); @@ -926,6 +1177,18 @@ export const MsgWithdrawPositionResponse = { } return message; }, + fromJSON(object: any): MsgWithdrawPositionResponse { + return { + amount0: isSet(object.amount0) ? String(object.amount0) : "", + amount1: isSet(object.amount1) ? String(object.amount1) : "" + }; + }, + toJSON(message: MsgWithdrawPositionResponse): unknown { + const obj: any = {}; + message.amount0 !== undefined && (obj.amount0 = message.amount0); + message.amount1 !== undefined && (obj.amount1 = message.amount1); + return obj; + }, fromPartial(object: Partial): MsgWithdrawPositionResponse { const message = createBaseMsgWithdrawPositionResponse(); message.amount0 = object.amount0 ?? ""; @@ -933,10 +1196,14 @@ export const MsgWithdrawPositionResponse = { return message; }, fromAmino(object: MsgWithdrawPositionResponseAmino): MsgWithdrawPositionResponse { - return { - amount0: object.amount0, - amount1: object.amount1 - }; + const message = createBaseMsgWithdrawPositionResponse(); + if (object.amount0 !== undefined && object.amount0 !== null) { + message.amount0 = object.amount0; + } + if (object.amount1 !== undefined && object.amount1 !== null) { + message.amount1 = object.amount1; + } + return message; }, toAmino(message: MsgWithdrawPositionResponse): MsgWithdrawPositionResponseAmino { const obj: any = {}; @@ -966,6 +1233,8 @@ export const MsgWithdrawPositionResponse = { }; } }; +GlobalDecoderRegistry.register(MsgWithdrawPositionResponse.typeUrl, MsgWithdrawPositionResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgWithdrawPositionResponse.aminoType, MsgWithdrawPositionResponse.typeUrl); function createBaseMsgCollectSpreadRewards(): MsgCollectSpreadRewards { return { positionIds: [], @@ -974,6 +1243,16 @@ function createBaseMsgCollectSpreadRewards(): MsgCollectSpreadRewards { } export const MsgCollectSpreadRewards = { typeUrl: "/osmosis.concentratedliquidity.v1beta1.MsgCollectSpreadRewards", + aminoType: "osmosis/cl-col-sp-rewards", + is(o: any): o is MsgCollectSpreadRewards { + return o && (o.$typeUrl === MsgCollectSpreadRewards.typeUrl || Array.isArray(o.positionIds) && (!o.positionIds.length || typeof o.positionIds[0] === "bigint") && typeof o.sender === "string"); + }, + isSDK(o: any): o is MsgCollectSpreadRewardsSDKType { + return o && (o.$typeUrl === MsgCollectSpreadRewards.typeUrl || Array.isArray(o.position_ids) && (!o.position_ids.length || typeof o.position_ids[0] === "bigint") && typeof o.sender === "string"); + }, + isAmino(o: any): o is MsgCollectSpreadRewardsAmino { + return o && (o.$typeUrl === MsgCollectSpreadRewards.typeUrl || Array.isArray(o.position_ids) && (!o.position_ids.length || typeof o.position_ids[0] === "bigint") && typeof o.sender === "string"); + }, encode(message: MsgCollectSpreadRewards, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { writer.uint32(10).fork(); for (const v of message.positionIds) { @@ -1012,6 +1291,22 @@ export const MsgCollectSpreadRewards = { } return message; }, + fromJSON(object: any): MsgCollectSpreadRewards { + return { + positionIds: Array.isArray(object?.positionIds) ? object.positionIds.map((e: any) => BigInt(e.toString())) : [], + sender: isSet(object.sender) ? String(object.sender) : "" + }; + }, + toJSON(message: MsgCollectSpreadRewards): unknown { + const obj: any = {}; + if (message.positionIds) { + obj.positionIds = message.positionIds.map(e => (e || BigInt(0)).toString()); + } else { + obj.positionIds = []; + } + message.sender !== undefined && (obj.sender = message.sender); + return obj; + }, fromPartial(object: Partial): MsgCollectSpreadRewards { const message = createBaseMsgCollectSpreadRewards(); message.positionIds = object.positionIds?.map(e => BigInt(e.toString())) || []; @@ -1019,10 +1314,12 @@ export const MsgCollectSpreadRewards = { return message; }, fromAmino(object: MsgCollectSpreadRewardsAmino): MsgCollectSpreadRewards { - return { - positionIds: Array.isArray(object?.position_ids) ? object.position_ids.map((e: any) => BigInt(e)) : [], - sender: object.sender - }; + const message = createBaseMsgCollectSpreadRewards(); + message.positionIds = object.position_ids?.map(e => BigInt(e)) || []; + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + return message; }, toAmino(message: MsgCollectSpreadRewards): MsgCollectSpreadRewardsAmino { const obj: any = {}; @@ -1039,7 +1336,7 @@ export const MsgCollectSpreadRewards = { }, toAminoMsg(message: MsgCollectSpreadRewards): MsgCollectSpreadRewardsAminoMsg { return { - type: "osmosis/concentratedliquidity/collect-spread-rewards", + type: "osmosis/cl-col-sp-rewards", value: MsgCollectSpreadRewards.toAmino(message) }; }, @@ -1056,6 +1353,8 @@ export const MsgCollectSpreadRewards = { }; } }; +GlobalDecoderRegistry.register(MsgCollectSpreadRewards.typeUrl, MsgCollectSpreadRewards); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgCollectSpreadRewards.aminoType, MsgCollectSpreadRewards.typeUrl); function createBaseMsgCollectSpreadRewardsResponse(): MsgCollectSpreadRewardsResponse { return { collectedSpreadRewards: [] @@ -1063,6 +1362,16 @@ function createBaseMsgCollectSpreadRewardsResponse(): MsgCollectSpreadRewardsRes } export const MsgCollectSpreadRewardsResponse = { typeUrl: "/osmosis.concentratedliquidity.v1beta1.MsgCollectSpreadRewardsResponse", + aminoType: "osmosis/concentratedliquidity/collect-spread-rewards-response", + is(o: any): o is MsgCollectSpreadRewardsResponse { + return o && (o.$typeUrl === MsgCollectSpreadRewardsResponse.typeUrl || Array.isArray(o.collectedSpreadRewards) && (!o.collectedSpreadRewards.length || Coin.is(o.collectedSpreadRewards[0]))); + }, + isSDK(o: any): o is MsgCollectSpreadRewardsResponseSDKType { + return o && (o.$typeUrl === MsgCollectSpreadRewardsResponse.typeUrl || Array.isArray(o.collected_spread_rewards) && (!o.collected_spread_rewards.length || Coin.isSDK(o.collected_spread_rewards[0]))); + }, + isAmino(o: any): o is MsgCollectSpreadRewardsResponseAmino { + return o && (o.$typeUrl === MsgCollectSpreadRewardsResponse.typeUrl || Array.isArray(o.collected_spread_rewards) && (!o.collected_spread_rewards.length || Coin.isAmino(o.collected_spread_rewards[0]))); + }, encode(message: MsgCollectSpreadRewardsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.collectedSpreadRewards) { Coin.encode(v!, writer.uint32(10).fork()).ldelim(); @@ -1086,15 +1395,29 @@ export const MsgCollectSpreadRewardsResponse = { } return message; }, + fromJSON(object: any): MsgCollectSpreadRewardsResponse { + return { + collectedSpreadRewards: Array.isArray(object?.collectedSpreadRewards) ? object.collectedSpreadRewards.map((e: any) => Coin.fromJSON(e)) : [] + }; + }, + toJSON(message: MsgCollectSpreadRewardsResponse): unknown { + const obj: any = {}; + if (message.collectedSpreadRewards) { + obj.collectedSpreadRewards = message.collectedSpreadRewards.map(e => e ? Coin.toJSON(e) : undefined); + } else { + obj.collectedSpreadRewards = []; + } + return obj; + }, fromPartial(object: Partial): MsgCollectSpreadRewardsResponse { const message = createBaseMsgCollectSpreadRewardsResponse(); message.collectedSpreadRewards = object.collectedSpreadRewards?.map(e => Coin.fromPartial(e)) || []; return message; }, fromAmino(object: MsgCollectSpreadRewardsResponseAmino): MsgCollectSpreadRewardsResponse { - return { - collectedSpreadRewards: Array.isArray(object?.collected_spread_rewards) ? object.collected_spread_rewards.map((e: any) => Coin.fromAmino(e)) : [] - }; + const message = createBaseMsgCollectSpreadRewardsResponse(); + message.collectedSpreadRewards = object.collected_spread_rewards?.map(e => Coin.fromAmino(e)) || []; + return message; }, toAmino(message: MsgCollectSpreadRewardsResponse): MsgCollectSpreadRewardsResponseAmino { const obj: any = {}; @@ -1127,6 +1450,8 @@ export const MsgCollectSpreadRewardsResponse = { }; } }; +GlobalDecoderRegistry.register(MsgCollectSpreadRewardsResponse.typeUrl, MsgCollectSpreadRewardsResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgCollectSpreadRewardsResponse.aminoType, MsgCollectSpreadRewardsResponse.typeUrl); function createBaseMsgCollectIncentives(): MsgCollectIncentives { return { positionIds: [], @@ -1135,6 +1460,16 @@ function createBaseMsgCollectIncentives(): MsgCollectIncentives { } export const MsgCollectIncentives = { typeUrl: "/osmosis.concentratedliquidity.v1beta1.MsgCollectIncentives", + aminoType: "osmosis/cl-collect-incentives", + is(o: any): o is MsgCollectIncentives { + return o && (o.$typeUrl === MsgCollectIncentives.typeUrl || Array.isArray(o.positionIds) && (!o.positionIds.length || typeof o.positionIds[0] === "bigint") && typeof o.sender === "string"); + }, + isSDK(o: any): o is MsgCollectIncentivesSDKType { + return o && (o.$typeUrl === MsgCollectIncentives.typeUrl || Array.isArray(o.position_ids) && (!o.position_ids.length || typeof o.position_ids[0] === "bigint") && typeof o.sender === "string"); + }, + isAmino(o: any): o is MsgCollectIncentivesAmino { + return o && (o.$typeUrl === MsgCollectIncentives.typeUrl || Array.isArray(o.position_ids) && (!o.position_ids.length || typeof o.position_ids[0] === "bigint") && typeof o.sender === "string"); + }, encode(message: MsgCollectIncentives, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { writer.uint32(10).fork(); for (const v of message.positionIds) { @@ -1173,6 +1508,22 @@ export const MsgCollectIncentives = { } return message; }, + fromJSON(object: any): MsgCollectIncentives { + return { + positionIds: Array.isArray(object?.positionIds) ? object.positionIds.map((e: any) => BigInt(e.toString())) : [], + sender: isSet(object.sender) ? String(object.sender) : "" + }; + }, + toJSON(message: MsgCollectIncentives): unknown { + const obj: any = {}; + if (message.positionIds) { + obj.positionIds = message.positionIds.map(e => (e || BigInt(0)).toString()); + } else { + obj.positionIds = []; + } + message.sender !== undefined && (obj.sender = message.sender); + return obj; + }, fromPartial(object: Partial): MsgCollectIncentives { const message = createBaseMsgCollectIncentives(); message.positionIds = object.positionIds?.map(e => BigInt(e.toString())) || []; @@ -1180,10 +1531,12 @@ export const MsgCollectIncentives = { return message; }, fromAmino(object: MsgCollectIncentivesAmino): MsgCollectIncentives { - return { - positionIds: Array.isArray(object?.position_ids) ? object.position_ids.map((e: any) => BigInt(e)) : [], - sender: object.sender - }; + const message = createBaseMsgCollectIncentives(); + message.positionIds = object.position_ids?.map(e => BigInt(e)) || []; + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + return message; }, toAmino(message: MsgCollectIncentives): MsgCollectIncentivesAmino { const obj: any = {}; @@ -1200,7 +1553,7 @@ export const MsgCollectIncentives = { }, toAminoMsg(message: MsgCollectIncentives): MsgCollectIncentivesAminoMsg { return { - type: "osmosis/concentratedliquidity/collect-incentives", + type: "osmosis/cl-collect-incentives", value: MsgCollectIncentives.toAmino(message) }; }, @@ -1217,6 +1570,8 @@ export const MsgCollectIncentives = { }; } }; +GlobalDecoderRegistry.register(MsgCollectIncentives.typeUrl, MsgCollectIncentives); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgCollectIncentives.aminoType, MsgCollectIncentives.typeUrl); function createBaseMsgCollectIncentivesResponse(): MsgCollectIncentivesResponse { return { collectedIncentives: [], @@ -1225,6 +1580,16 @@ function createBaseMsgCollectIncentivesResponse(): MsgCollectIncentivesResponse } export const MsgCollectIncentivesResponse = { typeUrl: "/osmosis.concentratedliquidity.v1beta1.MsgCollectIncentivesResponse", + aminoType: "osmosis/concentratedliquidity/collect-incentives-response", + is(o: any): o is MsgCollectIncentivesResponse { + return o && (o.$typeUrl === MsgCollectIncentivesResponse.typeUrl || Array.isArray(o.collectedIncentives) && (!o.collectedIncentives.length || Coin.is(o.collectedIncentives[0])) && Array.isArray(o.forfeitedIncentives) && (!o.forfeitedIncentives.length || Coin.is(o.forfeitedIncentives[0]))); + }, + isSDK(o: any): o is MsgCollectIncentivesResponseSDKType { + return o && (o.$typeUrl === MsgCollectIncentivesResponse.typeUrl || Array.isArray(o.collected_incentives) && (!o.collected_incentives.length || Coin.isSDK(o.collected_incentives[0])) && Array.isArray(o.forfeited_incentives) && (!o.forfeited_incentives.length || Coin.isSDK(o.forfeited_incentives[0]))); + }, + isAmino(o: any): o is MsgCollectIncentivesResponseAmino { + return o && (o.$typeUrl === MsgCollectIncentivesResponse.typeUrl || Array.isArray(o.collected_incentives) && (!o.collected_incentives.length || Coin.isAmino(o.collected_incentives[0])) && Array.isArray(o.forfeited_incentives) && (!o.forfeited_incentives.length || Coin.isAmino(o.forfeited_incentives[0]))); + }, encode(message: MsgCollectIncentivesResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.collectedIncentives) { Coin.encode(v!, writer.uint32(10).fork()).ldelim(); @@ -1254,6 +1619,26 @@ export const MsgCollectIncentivesResponse = { } return message; }, + fromJSON(object: any): MsgCollectIncentivesResponse { + return { + collectedIncentives: Array.isArray(object?.collectedIncentives) ? object.collectedIncentives.map((e: any) => Coin.fromJSON(e)) : [], + forfeitedIncentives: Array.isArray(object?.forfeitedIncentives) ? object.forfeitedIncentives.map((e: any) => Coin.fromJSON(e)) : [] + }; + }, + toJSON(message: MsgCollectIncentivesResponse): unknown { + const obj: any = {}; + if (message.collectedIncentives) { + obj.collectedIncentives = message.collectedIncentives.map(e => e ? Coin.toJSON(e) : undefined); + } else { + obj.collectedIncentives = []; + } + if (message.forfeitedIncentives) { + obj.forfeitedIncentives = message.forfeitedIncentives.map(e => e ? Coin.toJSON(e) : undefined); + } else { + obj.forfeitedIncentives = []; + } + return obj; + }, fromPartial(object: Partial): MsgCollectIncentivesResponse { const message = createBaseMsgCollectIncentivesResponse(); message.collectedIncentives = object.collectedIncentives?.map(e => Coin.fromPartial(e)) || []; @@ -1261,10 +1646,10 @@ export const MsgCollectIncentivesResponse = { return message; }, fromAmino(object: MsgCollectIncentivesResponseAmino): MsgCollectIncentivesResponse { - return { - collectedIncentives: Array.isArray(object?.collected_incentives) ? object.collected_incentives.map((e: any) => Coin.fromAmino(e)) : [], - forfeitedIncentives: Array.isArray(object?.forfeited_incentives) ? object.forfeited_incentives.map((e: any) => Coin.fromAmino(e)) : [] - }; + const message = createBaseMsgCollectIncentivesResponse(); + message.collectedIncentives = object.collected_incentives?.map(e => Coin.fromAmino(e)) || []; + message.forfeitedIncentives = object.forfeited_incentives?.map(e => Coin.fromAmino(e)) || []; + return message; }, toAmino(message: MsgCollectIncentivesResponse): MsgCollectIncentivesResponseAmino { const obj: any = {}; @@ -1302,6 +1687,8 @@ export const MsgCollectIncentivesResponse = { }; } }; +GlobalDecoderRegistry.register(MsgCollectIncentivesResponse.typeUrl, MsgCollectIncentivesResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgCollectIncentivesResponse.aminoType, MsgCollectIncentivesResponse.typeUrl); function createBaseMsgFungifyChargedPositions(): MsgFungifyChargedPositions { return { positionIds: [], @@ -1310,6 +1697,16 @@ function createBaseMsgFungifyChargedPositions(): MsgFungifyChargedPositions { } export const MsgFungifyChargedPositions = { typeUrl: "/osmosis.concentratedliquidity.v1beta1.MsgFungifyChargedPositions", + aminoType: "osmosis/cl-fungify-charged-positions", + is(o: any): o is MsgFungifyChargedPositions { + return o && (o.$typeUrl === MsgFungifyChargedPositions.typeUrl || Array.isArray(o.positionIds) && (!o.positionIds.length || typeof o.positionIds[0] === "bigint") && typeof o.sender === "string"); + }, + isSDK(o: any): o is MsgFungifyChargedPositionsSDKType { + return o && (o.$typeUrl === MsgFungifyChargedPositions.typeUrl || Array.isArray(o.position_ids) && (!o.position_ids.length || typeof o.position_ids[0] === "bigint") && typeof o.sender === "string"); + }, + isAmino(o: any): o is MsgFungifyChargedPositionsAmino { + return o && (o.$typeUrl === MsgFungifyChargedPositions.typeUrl || Array.isArray(o.position_ids) && (!o.position_ids.length || typeof o.position_ids[0] === "bigint") && typeof o.sender === "string"); + }, encode(message: MsgFungifyChargedPositions, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { writer.uint32(10).fork(); for (const v of message.positionIds) { @@ -1348,6 +1745,22 @@ export const MsgFungifyChargedPositions = { } return message; }, + fromJSON(object: any): MsgFungifyChargedPositions { + return { + positionIds: Array.isArray(object?.positionIds) ? object.positionIds.map((e: any) => BigInt(e.toString())) : [], + sender: isSet(object.sender) ? String(object.sender) : "" + }; + }, + toJSON(message: MsgFungifyChargedPositions): unknown { + const obj: any = {}; + if (message.positionIds) { + obj.positionIds = message.positionIds.map(e => (e || BigInt(0)).toString()); + } else { + obj.positionIds = []; + } + message.sender !== undefined && (obj.sender = message.sender); + return obj; + }, fromPartial(object: Partial): MsgFungifyChargedPositions { const message = createBaseMsgFungifyChargedPositions(); message.positionIds = object.positionIds?.map(e => BigInt(e.toString())) || []; @@ -1355,10 +1768,12 @@ export const MsgFungifyChargedPositions = { return message; }, fromAmino(object: MsgFungifyChargedPositionsAmino): MsgFungifyChargedPositions { - return { - positionIds: Array.isArray(object?.position_ids) ? object.position_ids.map((e: any) => BigInt(e)) : [], - sender: object.sender - }; + const message = createBaseMsgFungifyChargedPositions(); + message.positionIds = object.position_ids?.map(e => BigInt(e)) || []; + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + return message; }, toAmino(message: MsgFungifyChargedPositions): MsgFungifyChargedPositionsAmino { const obj: any = {}; @@ -1375,7 +1790,7 @@ export const MsgFungifyChargedPositions = { }, toAminoMsg(message: MsgFungifyChargedPositions): MsgFungifyChargedPositionsAminoMsg { return { - type: "osmosis/concentratedliquidity/fungify-charged-positions", + type: "osmosis/cl-fungify-charged-positions", value: MsgFungifyChargedPositions.toAmino(message) }; }, @@ -1392,6 +1807,8 @@ export const MsgFungifyChargedPositions = { }; } }; +GlobalDecoderRegistry.register(MsgFungifyChargedPositions.typeUrl, MsgFungifyChargedPositions); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgFungifyChargedPositions.aminoType, MsgFungifyChargedPositions.typeUrl); function createBaseMsgFungifyChargedPositionsResponse(): MsgFungifyChargedPositionsResponse { return { newPositionId: BigInt(0) @@ -1399,6 +1816,16 @@ function createBaseMsgFungifyChargedPositionsResponse(): MsgFungifyChargedPositi } export const MsgFungifyChargedPositionsResponse = { typeUrl: "/osmosis.concentratedliquidity.v1beta1.MsgFungifyChargedPositionsResponse", + aminoType: "osmosis/concentratedliquidity/fungify-charged-positions-response", + is(o: any): o is MsgFungifyChargedPositionsResponse { + return o && (o.$typeUrl === MsgFungifyChargedPositionsResponse.typeUrl || typeof o.newPositionId === "bigint"); + }, + isSDK(o: any): o is MsgFungifyChargedPositionsResponseSDKType { + return o && (o.$typeUrl === MsgFungifyChargedPositionsResponse.typeUrl || typeof o.new_position_id === "bigint"); + }, + isAmino(o: any): o is MsgFungifyChargedPositionsResponseAmino { + return o && (o.$typeUrl === MsgFungifyChargedPositionsResponse.typeUrl || typeof o.new_position_id === "bigint"); + }, encode(message: MsgFungifyChargedPositionsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.newPositionId !== BigInt(0)) { writer.uint32(8).uint64(message.newPositionId); @@ -1422,15 +1849,27 @@ export const MsgFungifyChargedPositionsResponse = { } return message; }, + fromJSON(object: any): MsgFungifyChargedPositionsResponse { + return { + newPositionId: isSet(object.newPositionId) ? BigInt(object.newPositionId.toString()) : BigInt(0) + }; + }, + toJSON(message: MsgFungifyChargedPositionsResponse): unknown { + const obj: any = {}; + message.newPositionId !== undefined && (obj.newPositionId = (message.newPositionId || BigInt(0)).toString()); + return obj; + }, fromPartial(object: Partial): MsgFungifyChargedPositionsResponse { const message = createBaseMsgFungifyChargedPositionsResponse(); message.newPositionId = object.newPositionId !== undefined && object.newPositionId !== null ? BigInt(object.newPositionId.toString()) : BigInt(0); return message; }, fromAmino(object: MsgFungifyChargedPositionsResponseAmino): MsgFungifyChargedPositionsResponse { - return { - newPositionId: BigInt(object.new_position_id) - }; + const message = createBaseMsgFungifyChargedPositionsResponse(); + if (object.new_position_id !== undefined && object.new_position_id !== null) { + message.newPositionId = BigInt(object.new_position_id); + } + return message; }, toAmino(message: MsgFungifyChargedPositionsResponse): MsgFungifyChargedPositionsResponseAmino { const obj: any = {}; @@ -1458,4 +1897,215 @@ export const MsgFungifyChargedPositionsResponse = { value: MsgFungifyChargedPositionsResponse.encode(message).finish() }; } -}; \ No newline at end of file +}; +GlobalDecoderRegistry.register(MsgFungifyChargedPositionsResponse.typeUrl, MsgFungifyChargedPositionsResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgFungifyChargedPositionsResponse.aminoType, MsgFungifyChargedPositionsResponse.typeUrl); +function createBaseMsgTransferPositions(): MsgTransferPositions { + return { + positionIds: [], + sender: "", + newOwner: "" + }; +} +export const MsgTransferPositions = { + typeUrl: "/osmosis.concentratedliquidity.v1beta1.MsgTransferPositions", + aminoType: "osmosis/cl-transfer-positions", + is(o: any): o is MsgTransferPositions { + return o && (o.$typeUrl === MsgTransferPositions.typeUrl || Array.isArray(o.positionIds) && (!o.positionIds.length || typeof o.positionIds[0] === "bigint") && typeof o.sender === "string" && typeof o.newOwner === "string"); + }, + isSDK(o: any): o is MsgTransferPositionsSDKType { + return o && (o.$typeUrl === MsgTransferPositions.typeUrl || Array.isArray(o.position_ids) && (!o.position_ids.length || typeof o.position_ids[0] === "bigint") && typeof o.sender === "string" && typeof o.new_owner === "string"); + }, + isAmino(o: any): o is MsgTransferPositionsAmino { + return o && (o.$typeUrl === MsgTransferPositions.typeUrl || Array.isArray(o.position_ids) && (!o.position_ids.length || typeof o.position_ids[0] === "bigint") && typeof o.sender === "string" && typeof o.new_owner === "string"); + }, + encode(message: MsgTransferPositions, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + writer.uint32(10).fork(); + for (const v of message.positionIds) { + writer.uint64(v); + } + writer.ldelim(); + if (message.sender !== "") { + writer.uint32(18).string(message.sender); + } + if (message.newOwner !== "") { + writer.uint32(26).string(message.newOwner); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgTransferPositions { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgTransferPositions(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if ((tag & 7) === 2) { + const end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) { + message.positionIds.push(reader.uint64()); + } + } else { + message.positionIds.push(reader.uint64()); + } + break; + case 2: + message.sender = reader.string(); + break; + case 3: + message.newOwner = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): MsgTransferPositions { + return { + positionIds: Array.isArray(object?.positionIds) ? object.positionIds.map((e: any) => BigInt(e.toString())) : [], + sender: isSet(object.sender) ? String(object.sender) : "", + newOwner: isSet(object.newOwner) ? String(object.newOwner) : "" + }; + }, + toJSON(message: MsgTransferPositions): unknown { + const obj: any = {}; + if (message.positionIds) { + obj.positionIds = message.positionIds.map(e => (e || BigInt(0)).toString()); + } else { + obj.positionIds = []; + } + message.sender !== undefined && (obj.sender = message.sender); + message.newOwner !== undefined && (obj.newOwner = message.newOwner); + return obj; + }, + fromPartial(object: Partial): MsgTransferPositions { + const message = createBaseMsgTransferPositions(); + message.positionIds = object.positionIds?.map(e => BigInt(e.toString())) || []; + message.sender = object.sender ?? ""; + message.newOwner = object.newOwner ?? ""; + return message; + }, + fromAmino(object: MsgTransferPositionsAmino): MsgTransferPositions { + const message = createBaseMsgTransferPositions(); + message.positionIds = object.position_ids?.map(e => BigInt(e)) || []; + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + if (object.new_owner !== undefined && object.new_owner !== null) { + message.newOwner = object.new_owner; + } + return message; + }, + toAmino(message: MsgTransferPositions): MsgTransferPositionsAmino { + const obj: any = {}; + if (message.positionIds) { + obj.position_ids = message.positionIds.map(e => e.toString()); + } else { + obj.position_ids = []; + } + obj.sender = message.sender; + obj.new_owner = message.newOwner; + return obj; + }, + fromAminoMsg(object: MsgTransferPositionsAminoMsg): MsgTransferPositions { + return MsgTransferPositions.fromAmino(object.value); + }, + toAminoMsg(message: MsgTransferPositions): MsgTransferPositionsAminoMsg { + return { + type: "osmosis/cl-transfer-positions", + value: MsgTransferPositions.toAmino(message) + }; + }, + fromProtoMsg(message: MsgTransferPositionsProtoMsg): MsgTransferPositions { + return MsgTransferPositions.decode(message.value); + }, + toProto(message: MsgTransferPositions): Uint8Array { + return MsgTransferPositions.encode(message).finish(); + }, + toProtoMsg(message: MsgTransferPositions): MsgTransferPositionsProtoMsg { + return { + typeUrl: "/osmosis.concentratedliquidity.v1beta1.MsgTransferPositions", + value: MsgTransferPositions.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgTransferPositions.typeUrl, MsgTransferPositions); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgTransferPositions.aminoType, MsgTransferPositions.typeUrl); +function createBaseMsgTransferPositionsResponse(): MsgTransferPositionsResponse { + return {}; +} +export const MsgTransferPositionsResponse = { + typeUrl: "/osmosis.concentratedliquidity.v1beta1.MsgTransferPositionsResponse", + aminoType: "osmosis/concentratedliquidity/transfer-positions-response", + is(o: any): o is MsgTransferPositionsResponse { + return o && o.$typeUrl === MsgTransferPositionsResponse.typeUrl; + }, + isSDK(o: any): o is MsgTransferPositionsResponseSDKType { + return o && o.$typeUrl === MsgTransferPositionsResponse.typeUrl; + }, + isAmino(o: any): o is MsgTransferPositionsResponseAmino { + return o && o.$typeUrl === MsgTransferPositionsResponse.typeUrl; + }, + encode(_: MsgTransferPositionsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgTransferPositionsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgTransferPositionsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(_: any): MsgTransferPositionsResponse { + return {}; + }, + toJSON(_: MsgTransferPositionsResponse): unknown { + const obj: any = {}; + return obj; + }, + fromPartial(_: Partial): MsgTransferPositionsResponse { + const message = createBaseMsgTransferPositionsResponse(); + return message; + }, + fromAmino(_: MsgTransferPositionsResponseAmino): MsgTransferPositionsResponse { + const message = createBaseMsgTransferPositionsResponse(); + return message; + }, + toAmino(_: MsgTransferPositionsResponse): MsgTransferPositionsResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgTransferPositionsResponseAminoMsg): MsgTransferPositionsResponse { + return MsgTransferPositionsResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgTransferPositionsResponse): MsgTransferPositionsResponseAminoMsg { + return { + type: "osmosis/concentratedliquidity/transfer-positions-response", + value: MsgTransferPositionsResponse.toAmino(message) + }; + }, + fromProtoMsg(message: MsgTransferPositionsResponseProtoMsg): MsgTransferPositionsResponse { + return MsgTransferPositionsResponse.decode(message.value); + }, + toProto(message: MsgTransferPositionsResponse): Uint8Array { + return MsgTransferPositionsResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgTransferPositionsResponse): MsgTransferPositionsResponseProtoMsg { + return { + typeUrl: "/osmosis.concentratedliquidity.v1beta1.MsgTransferPositionsResponse", + value: MsgTransferPositionsResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgTransferPositionsResponse.typeUrl, MsgTransferPositionsResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgTransferPositionsResponse.aminoType, MsgTransferPositionsResponse.typeUrl); \ No newline at end of file diff --git a/packages/osmojs/src/codegen/osmosis/cosmwasmpool/v1beta1/genesis.ts b/packages/osmojs/src/codegen/osmosis/cosmwasmpool/v1beta1/genesis.ts index d19703641..c3b6e5448 100644 --- a/packages/osmojs/src/codegen/osmosis/cosmwasmpool/v1beta1/genesis.ts +++ b/packages/osmojs/src/codegen/osmosis/cosmwasmpool/v1beta1/genesis.ts @@ -1,21 +1,23 @@ import { Params, ParamsAmino, ParamsSDKType } from "./params"; import { Any, AnyProtoMsg, AnyAmino, AnySDKType } from "../../../google/protobuf/any"; -import { Pool as Pool1 } from "../../concentrated-liquidity/pool"; -import { PoolProtoMsg as Pool1ProtoMsg } from "../../concentrated-liquidity/pool"; -import { PoolSDKType as Pool1SDKType } from "../../concentrated-liquidity/pool"; +import { Pool as Pool1 } from "../../concentratedliquidity/v1beta1/pool"; +import { PoolProtoMsg as Pool1ProtoMsg } from "../../concentratedliquidity/v1beta1/pool"; +import { PoolSDKType as Pool1SDKType } from "../../concentratedliquidity/v1beta1/pool"; import { CosmWasmPool, CosmWasmPoolProtoMsg, CosmWasmPoolSDKType } from "./model/pool"; -import { Pool as Pool2 } from "../../gamm/pool-models/balancer/balancerPool"; -import { PoolProtoMsg as Pool2ProtoMsg } from "../../gamm/pool-models/balancer/balancerPool"; -import { PoolSDKType as Pool2SDKType } from "../../gamm/pool-models/balancer/balancerPool"; -import { Pool as Pool3 } from "../../gamm/pool-models/stableswap/stableswap_pool"; -import { PoolProtoMsg as Pool3ProtoMsg } from "../../gamm/pool-models/stableswap/stableswap_pool"; -import { PoolSDKType as Pool3SDKType } from "../../gamm/pool-models/stableswap/stableswap_pool"; +import { Pool as Pool2 } from "../../gamm/poolmodels/stableswap/v1beta1/stableswap_pool"; +import { PoolProtoMsg as Pool2ProtoMsg } from "../../gamm/poolmodels/stableswap/v1beta1/stableswap_pool"; +import { PoolSDKType as Pool2SDKType } from "../../gamm/poolmodels/stableswap/v1beta1/stableswap_pool"; +import { Pool as Pool3 } from "../../gamm/v1beta1/balancerPool"; +import { PoolProtoMsg as Pool3ProtoMsg } from "../../gamm/v1beta1/balancerPool"; +import { PoolSDKType as Pool3SDKType } from "../../gamm/v1beta1/balancerPool"; import { BinaryReader, BinaryWriter } from "../../../binary"; +import { isSet } from "../../../helpers"; +import { GlobalDecoderRegistry } from "../../../registry"; /** GenesisState defines the cosmwasmpool module's genesis state. */ export interface GenesisState { /** params is the container of cosmwasmpool parameters. */ params: Params; - pools: (Pool1 & CosmWasmPool & Pool2 & Pool3 & Any)[] | Any[]; + pools: (Pool1 | CosmWasmPool | Pool2 | Pool3 | Any)[] | Any[]; } export interface GenesisStateProtoMsg { typeUrl: "/osmosis.cosmwasmpool.v1beta1.GenesisState"; @@ -28,7 +30,7 @@ export type GenesisStateEncoded = Omit & { export interface GenesisStateAmino { /** params is the container of cosmwasmpool parameters. */ params?: ParamsAmino; - pools: AnyAmino[]; + pools?: AnyAmino[]; } export interface GenesisStateAminoMsg { type: "osmosis/cosmwasmpool/genesis-state"; @@ -47,12 +49,22 @@ function createBaseGenesisState(): GenesisState { } export const GenesisState = { typeUrl: "/osmosis.cosmwasmpool.v1beta1.GenesisState", + aminoType: "osmosis/cosmwasmpool/genesis-state", + is(o: any): o is GenesisState { + return o && (o.$typeUrl === GenesisState.typeUrl || Params.is(o.params) && Array.isArray(o.pools) && (!o.pools.length || Pool1.is(o.pools[0]) || CosmWasmPool.is(o.pools[0]) || Pool2.is(o.pools[0]) || Pool3.is(o.pools[0]) || Any.is(o.pools[0]))); + }, + isSDK(o: any): o is GenesisStateSDKType { + return o && (o.$typeUrl === GenesisState.typeUrl || Params.isSDK(o.params) && Array.isArray(o.pools) && (!o.pools.length || Pool1.isSDK(o.pools[0]) || CosmWasmPool.isSDK(o.pools[0]) || Pool2.isSDK(o.pools[0]) || Pool3.isSDK(o.pools[0]) || Any.isSDK(o.pools[0]))); + }, + isAmino(o: any): o is GenesisStateAmino { + return o && (o.$typeUrl === GenesisState.typeUrl || Params.isAmino(o.params) && Array.isArray(o.pools) && (!o.pools.length || Pool1.isAmino(o.pools[0]) || CosmWasmPool.isAmino(o.pools[0]) || Pool2.isAmino(o.pools[0]) || Pool3.isAmino(o.pools[0]) || Any.isAmino(o.pools[0]))); + }, encode(message: GenesisState, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.params !== undefined) { Params.encode(message.params, writer.uint32(10).fork()).ldelim(); } for (const v of message.pools) { - Any.encode((v! as Any), writer.uint32(18).fork()).ldelim(); + Any.encode(GlobalDecoderRegistry.wrapAny(v!), writer.uint32(18).fork()).ldelim(); } return writer; }, @@ -67,7 +79,7 @@ export const GenesisState = { message.params = Params.decode(reader, reader.uint32()); break; case 2: - message.pools.push((PoolI_InterfaceDecoder(reader) as Any)); + message.pools.push(GlobalDecoderRegistry.unwrapAny(reader)); break; default: reader.skipType(tag & 7); @@ -76,23 +88,41 @@ export const GenesisState = { } return message; }, + fromJSON(object: any): GenesisState { + return { + params: isSet(object.params) ? Params.fromJSON(object.params) : undefined, + pools: Array.isArray(object?.pools) ? object.pools.map((e: any) => GlobalDecoderRegistry.fromJSON(e)) : [] + }; + }, + toJSON(message: GenesisState): unknown { + const obj: any = {}; + message.params !== undefined && (obj.params = message.params ? Params.toJSON(message.params) : undefined); + if (message.pools) { + obj.pools = message.pools.map(e => e ? GlobalDecoderRegistry.toJSON(e) : undefined); + } else { + obj.pools = []; + } + return obj; + }, fromPartial(object: Partial): GenesisState { const message = createBaseGenesisState(); message.params = object.params !== undefined && object.params !== null ? Params.fromPartial(object.params) : undefined; - message.pools = object.pools?.map(e => Any.fromPartial(e)) || []; + message.pools = object.pools?.map(e => (Any.fromPartial(e) as any)) || []; return message; }, fromAmino(object: GenesisStateAmino): GenesisState { - return { - params: object?.params ? Params.fromAmino(object.params) : undefined, - pools: Array.isArray(object?.pools) ? object.pools.map((e: any) => PoolI_FromAmino(e)) : [] - }; + const message = createBaseGenesisState(); + if (object.params !== undefined && object.params !== null) { + message.params = Params.fromAmino(object.params); + } + message.pools = object.pools?.map(e => GlobalDecoderRegistry.fromAminoMsg(e)) || []; + return message; }, toAmino(message: GenesisState): GenesisStateAmino { const obj: any = {}; obj.params = message.params ? Params.toAmino(message.params) : undefined; if (message.pools) { - obj.pools = message.pools.map(e => e ? PoolI_ToAmino((e as Any)) : undefined); + obj.pools = message.pools.map(e => e ? GlobalDecoderRegistry.toAminoMsg(e) : undefined); } else { obj.pools = []; } @@ -120,71 +150,5 @@ export const GenesisState = { }; } }; -export const PoolI_InterfaceDecoder = (input: BinaryReader | Uint8Array): Pool1 | CosmWasmPool | Pool2 | Pool3 | Any => { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - const data = Any.decode(reader, reader.uint32()); - switch (data.typeUrl) { - case "/osmosis.concentratedliquidity.v1beta1.Pool": - return Pool1.decode(data.value); - case "/osmosis.cosmwasmpool.v1beta1.CosmWasmPool": - return CosmWasmPool.decode(data.value); - case "/osmosis.gamm.v1beta1.Pool": - return Pool2.decode(data.value); - case "/osmosis.gamm.poolmodels.stableswap.v1beta1.Pool": - return Pool3.decode(data.value); - default: - return data; - } -}; -export const PoolI_FromAmino = (content: AnyAmino) => { - switch (content.type) { - case "osmosis/concentratedliquidity/pool": - return Any.fromPartial({ - typeUrl: "/osmosis.concentratedliquidity.v1beta1.Pool", - value: Pool1.encode(Pool1.fromPartial(Pool1.fromAmino(content.value))).finish() - }); - case "osmosis/cosmwasmpool/cosm-wasm-pool": - return Any.fromPartial({ - typeUrl: "/osmosis.cosmwasmpool.v1beta1.CosmWasmPool", - value: CosmWasmPool.encode(CosmWasmPool.fromPartial(CosmWasmPool.fromAmino(content.value))).finish() - }); - case "osmosis/gamm/BalancerPool": - return Any.fromPartial({ - typeUrl: "/osmosis.gamm.v1beta1.Pool", - value: Pool2.encode(Pool2.fromPartial(Pool2.fromAmino(content.value))).finish() - }); - case "osmosis/gamm/StableswapPool": - return Any.fromPartial({ - typeUrl: "/osmosis.gamm.poolmodels.stableswap.v1beta1.Pool", - value: Pool3.encode(Pool3.fromPartial(Pool3.fromAmino(content.value))).finish() - }); - default: - return Any.fromAmino(content); - } -}; -export const PoolI_ToAmino = (content: Any) => { - switch (content.typeUrl) { - case "/osmosis.concentratedliquidity.v1beta1.Pool": - return { - type: "osmosis/concentratedliquidity/pool", - value: Pool1.toAmino(Pool1.decode(content.value)) - }; - case "/osmosis.cosmwasmpool.v1beta1.CosmWasmPool": - return { - type: "osmosis/cosmwasmpool/cosm-wasm-pool", - value: CosmWasmPool.toAmino(CosmWasmPool.decode(content.value)) - }; - case "/osmosis.gamm.v1beta1.Pool": - return { - type: "osmosis/gamm/BalancerPool", - value: Pool2.toAmino(Pool2.decode(content.value)) - }; - case "/osmosis.gamm.poolmodels.stableswap.v1beta1.Pool": - return { - type: "osmosis/gamm/StableswapPool", - value: Pool3.toAmino(Pool3.decode(content.value)) - }; - default: - return Any.toAmino(content); - } -}; \ No newline at end of file +GlobalDecoderRegistry.register(GenesisState.typeUrl, GenesisState); +GlobalDecoderRegistry.registerAminoProtoMapping(GenesisState.aminoType, GenesisState.typeUrl); \ No newline at end of file diff --git a/packages/osmojs/src/codegen/osmosis/cosmwasmpool/v1beta1/gov.ts b/packages/osmojs/src/codegen/osmosis/cosmwasmpool/v1beta1/gov.ts index ec833f7f9..126257a18 100644 --- a/packages/osmojs/src/codegen/osmosis/cosmwasmpool/v1beta1/gov.ts +++ b/packages/osmojs/src/codegen/osmosis/cosmwasmpool/v1beta1/gov.ts @@ -1,5 +1,7 @@ import { BinaryReader, BinaryWriter } from "../../../binary"; +import { isSet, bytesFromBase64, base64FromBytes } from "../../../helpers"; import { fromBase64, toBase64 } from "@cosmjs/encoding"; +import { GlobalDecoderRegistry } from "../../../registry"; /** * UploadCosmWasmPoolCodeAndWhiteListProposal is a gov Content type for * uploading coswasm pool code and adding it to internal whitelist. Only the @@ -21,10 +23,10 @@ export interface UploadCosmWasmPoolCodeAndWhiteListProposalProtoMsg { * code ids created by this message are eligible for being x/cosmwasmpool pools. */ export interface UploadCosmWasmPoolCodeAndWhiteListProposalAmino { - title: string; - description: string; + title?: string; + description?: string; /** WASMByteCode can be raw or gzip compressed */ - wasm_byte_code: string; + wasm_byte_code?: string; } export interface UploadCosmWasmPoolCodeAndWhiteListProposalAminoMsg { type: "osmosis/cosmwasmpool/upload-cosm-wasm-pool-code-and-white-list-proposal"; @@ -125,28 +127,28 @@ export interface MigratePoolContractsProposalProtoMsg { * be configured by a module parameter so it can be changed by a constant. */ export interface MigratePoolContractsProposalAmino { - title: string; - description: string; + title?: string; + description?: string; /** * pool_ids are the pool ids of the contracts to be migrated * either to the new_code_id that is already uploaded to chain or to * the given wasm_byte_code. */ - pool_ids: string[]; + pool_ids?: string[]; /** * new_code_id is the code id of the contract code to migrate to. * Assumes that the code is already uploaded to chain. Only one of * new_code_id and wasm_byte_code should be set. */ - new_code_id: string; + new_code_id?: string; /** * WASMByteCode can be raw or gzip compressed. Assumes that the code id * has not been uploaded yet so uploads the given code and migrates to it. * Only one of new_code_id and wasm_byte_code should be set. */ - wasm_byte_code: string; + wasm_byte_code?: string; /** MigrateMsg migrate message to be used for migrating the pool contracts. */ - migrate_msg: Uint8Array; + migrate_msg?: string; } export interface MigratePoolContractsProposalAminoMsg { type: "osmosis/cosmwasmpool/migrate-pool-contracts-proposal"; @@ -197,6 +199,16 @@ function createBaseUploadCosmWasmPoolCodeAndWhiteListProposal(): UploadCosmWasmP } export const UploadCosmWasmPoolCodeAndWhiteListProposal = { typeUrl: "/osmosis.cosmwasmpool.v1beta1.UploadCosmWasmPoolCodeAndWhiteListProposal", + aminoType: "osmosis/cosmwasmpool/upload-cosm-wasm-pool-code-and-white-list-proposal", + is(o: any): o is UploadCosmWasmPoolCodeAndWhiteListProposal { + return o && (o.$typeUrl === UploadCosmWasmPoolCodeAndWhiteListProposal.typeUrl || typeof o.title === "string" && typeof o.description === "string" && (o.wasmByteCode instanceof Uint8Array || typeof o.wasmByteCode === "string")); + }, + isSDK(o: any): o is UploadCosmWasmPoolCodeAndWhiteListProposalSDKType { + return o && (o.$typeUrl === UploadCosmWasmPoolCodeAndWhiteListProposal.typeUrl || typeof o.title === "string" && typeof o.description === "string" && (o.wasm_byte_code instanceof Uint8Array || typeof o.wasm_byte_code === "string")); + }, + isAmino(o: any): o is UploadCosmWasmPoolCodeAndWhiteListProposalAmino { + return o && (o.$typeUrl === UploadCosmWasmPoolCodeAndWhiteListProposal.typeUrl || typeof o.title === "string" && typeof o.description === "string" && (o.wasm_byte_code instanceof Uint8Array || typeof o.wasm_byte_code === "string")); + }, encode(message: UploadCosmWasmPoolCodeAndWhiteListProposal, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.title !== "") { writer.uint32(10).string(message.title); @@ -232,6 +244,20 @@ export const UploadCosmWasmPoolCodeAndWhiteListProposal = { } return message; }, + fromJSON(object: any): UploadCosmWasmPoolCodeAndWhiteListProposal { + return { + title: isSet(object.title) ? String(object.title) : "", + description: isSet(object.description) ? String(object.description) : "", + wasmByteCode: isSet(object.wasmByteCode) ? bytesFromBase64(object.wasmByteCode) : new Uint8Array() + }; + }, + toJSON(message: UploadCosmWasmPoolCodeAndWhiteListProposal): unknown { + const obj: any = {}; + message.title !== undefined && (obj.title = message.title); + message.description !== undefined && (obj.description = message.description); + message.wasmByteCode !== undefined && (obj.wasmByteCode = base64FromBytes(message.wasmByteCode !== undefined ? message.wasmByteCode : new Uint8Array())); + return obj; + }, fromPartial(object: Partial): UploadCosmWasmPoolCodeAndWhiteListProposal { const message = createBaseUploadCosmWasmPoolCodeAndWhiteListProposal(); message.title = object.title ?? ""; @@ -240,11 +266,17 @@ export const UploadCosmWasmPoolCodeAndWhiteListProposal = { return message; }, fromAmino(object: UploadCosmWasmPoolCodeAndWhiteListProposalAmino): UploadCosmWasmPoolCodeAndWhiteListProposal { - return { - title: object.title, - description: object.description, - wasmByteCode: fromBase64(object.wasm_byte_code) - }; + const message = createBaseUploadCosmWasmPoolCodeAndWhiteListProposal(); + if (object.title !== undefined && object.title !== null) { + message.title = object.title; + } + if (object.description !== undefined && object.description !== null) { + message.description = object.description; + } + if (object.wasm_byte_code !== undefined && object.wasm_byte_code !== null) { + message.wasmByteCode = fromBase64(object.wasm_byte_code); + } + return message; }, toAmino(message: UploadCosmWasmPoolCodeAndWhiteListProposal): UploadCosmWasmPoolCodeAndWhiteListProposalAmino { const obj: any = {}; @@ -275,6 +307,8 @@ export const UploadCosmWasmPoolCodeAndWhiteListProposal = { }; } }; +GlobalDecoderRegistry.register(UploadCosmWasmPoolCodeAndWhiteListProposal.typeUrl, UploadCosmWasmPoolCodeAndWhiteListProposal); +GlobalDecoderRegistry.registerAminoProtoMapping(UploadCosmWasmPoolCodeAndWhiteListProposal.aminoType, UploadCosmWasmPoolCodeAndWhiteListProposal.typeUrl); function createBaseMigratePoolContractsProposal(): MigratePoolContractsProposal { return { title: "", @@ -287,6 +321,16 @@ function createBaseMigratePoolContractsProposal(): MigratePoolContractsProposal } export const MigratePoolContractsProposal = { typeUrl: "/osmosis.cosmwasmpool.v1beta1.MigratePoolContractsProposal", + aminoType: "osmosis/cosmwasmpool/migrate-pool-contracts-proposal", + is(o: any): o is MigratePoolContractsProposal { + return o && (o.$typeUrl === MigratePoolContractsProposal.typeUrl || typeof o.title === "string" && typeof o.description === "string" && Array.isArray(o.poolIds) && (!o.poolIds.length || typeof o.poolIds[0] === "bigint") && typeof o.newCodeId === "bigint" && (o.wasmByteCode instanceof Uint8Array || typeof o.wasmByteCode === "string") && (o.migrateMsg instanceof Uint8Array || typeof o.migrateMsg === "string")); + }, + isSDK(o: any): o is MigratePoolContractsProposalSDKType { + return o && (o.$typeUrl === MigratePoolContractsProposal.typeUrl || typeof o.title === "string" && typeof o.description === "string" && Array.isArray(o.pool_ids) && (!o.pool_ids.length || typeof o.pool_ids[0] === "bigint") && typeof o.new_code_id === "bigint" && (o.wasm_byte_code instanceof Uint8Array || typeof o.wasm_byte_code === "string") && (o.migrate_msg instanceof Uint8Array || typeof o.migrate_msg === "string")); + }, + isAmino(o: any): o is MigratePoolContractsProposalAmino { + return o && (o.$typeUrl === MigratePoolContractsProposal.typeUrl || typeof o.title === "string" && typeof o.description === "string" && Array.isArray(o.pool_ids) && (!o.pool_ids.length || typeof o.pool_ids[0] === "bigint") && typeof o.new_code_id === "bigint" && (o.wasm_byte_code instanceof Uint8Array || typeof o.wasm_byte_code === "string") && (o.migrate_msg instanceof Uint8Array || typeof o.migrate_msg === "string")); + }, encode(message: MigratePoolContractsProposal, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.title !== "") { writer.uint32(10).string(message.title); @@ -349,6 +393,30 @@ export const MigratePoolContractsProposal = { } return message; }, + fromJSON(object: any): MigratePoolContractsProposal { + return { + title: isSet(object.title) ? String(object.title) : "", + description: isSet(object.description) ? String(object.description) : "", + poolIds: Array.isArray(object?.poolIds) ? object.poolIds.map((e: any) => BigInt(e.toString())) : [], + newCodeId: isSet(object.newCodeId) ? BigInt(object.newCodeId.toString()) : BigInt(0), + wasmByteCode: isSet(object.wasmByteCode) ? bytesFromBase64(object.wasmByteCode) : new Uint8Array(), + migrateMsg: isSet(object.migrateMsg) ? bytesFromBase64(object.migrateMsg) : new Uint8Array() + }; + }, + toJSON(message: MigratePoolContractsProposal): unknown { + const obj: any = {}; + message.title !== undefined && (obj.title = message.title); + message.description !== undefined && (obj.description = message.description); + if (message.poolIds) { + obj.poolIds = message.poolIds.map(e => (e || BigInt(0)).toString()); + } else { + obj.poolIds = []; + } + message.newCodeId !== undefined && (obj.newCodeId = (message.newCodeId || BigInt(0)).toString()); + message.wasmByteCode !== undefined && (obj.wasmByteCode = base64FromBytes(message.wasmByteCode !== undefined ? message.wasmByteCode : new Uint8Array())); + message.migrateMsg !== undefined && (obj.migrateMsg = base64FromBytes(message.migrateMsg !== undefined ? message.migrateMsg : new Uint8Array())); + return obj; + }, fromPartial(object: Partial): MigratePoolContractsProposal { const message = createBaseMigratePoolContractsProposal(); message.title = object.title ?? ""; @@ -360,14 +428,24 @@ export const MigratePoolContractsProposal = { return message; }, fromAmino(object: MigratePoolContractsProposalAmino): MigratePoolContractsProposal { - return { - title: object.title, - description: object.description, - poolIds: Array.isArray(object?.pool_ids) ? object.pool_ids.map((e: any) => BigInt(e)) : [], - newCodeId: BigInt(object.new_code_id), - wasmByteCode: fromBase64(object.wasm_byte_code), - migrateMsg: object.migrate_msg - }; + const message = createBaseMigratePoolContractsProposal(); + if (object.title !== undefined && object.title !== null) { + message.title = object.title; + } + if (object.description !== undefined && object.description !== null) { + message.description = object.description; + } + message.poolIds = object.pool_ids?.map(e => BigInt(e)) || []; + if (object.new_code_id !== undefined && object.new_code_id !== null) { + message.newCodeId = BigInt(object.new_code_id); + } + if (object.wasm_byte_code !== undefined && object.wasm_byte_code !== null) { + message.wasmByteCode = fromBase64(object.wasm_byte_code); + } + if (object.migrate_msg !== undefined && object.migrate_msg !== null) { + message.migrateMsg = bytesFromBase64(object.migrate_msg); + } + return message; }, toAmino(message: MigratePoolContractsProposal): MigratePoolContractsProposalAmino { const obj: any = {}; @@ -380,7 +458,7 @@ export const MigratePoolContractsProposal = { } obj.new_code_id = message.newCodeId ? message.newCodeId.toString() : undefined; obj.wasm_byte_code = message.wasmByteCode ? toBase64(message.wasmByteCode) : undefined; - obj.migrate_msg = message.migrateMsg; + obj.migrate_msg = message.migrateMsg ? base64FromBytes(message.migrateMsg) : undefined; return obj; }, fromAminoMsg(object: MigratePoolContractsProposalAminoMsg): MigratePoolContractsProposal { @@ -404,4 +482,6 @@ export const MigratePoolContractsProposal = { value: MigratePoolContractsProposal.encode(message).finish() }; } -}; \ No newline at end of file +}; +GlobalDecoderRegistry.register(MigratePoolContractsProposal.typeUrl, MigratePoolContractsProposal); +GlobalDecoderRegistry.registerAminoProtoMapping(MigratePoolContractsProposal.aminoType, MigratePoolContractsProposal.typeUrl); \ No newline at end of file diff --git a/packages/osmojs/src/codegen/osmosis/cosmwasmpool/v1beta1/model/instantiate_msg.ts b/packages/osmojs/src/codegen/osmosis/cosmwasmpool/v1beta1/model/instantiate_msg.ts index 800b249c4..5df86e9b7 100644 --- a/packages/osmojs/src/codegen/osmosis/cosmwasmpool/v1beta1/model/instantiate_msg.ts +++ b/packages/osmojs/src/codegen/osmosis/cosmwasmpool/v1beta1/model/instantiate_msg.ts @@ -1,4 +1,5 @@ import { BinaryReader, BinaryWriter } from "../../../../binary"; +import { GlobalDecoderRegistry } from "../../../../registry"; /** ===================== InstantiateMsg */ export interface InstantiateMsg { /** @@ -17,7 +18,7 @@ export interface InstantiateMsgAmino { * pool_asset_denoms is the list of asset denoms that are initialized * at pool creation time. */ - pool_asset_denoms: string[]; + pool_asset_denoms?: string[]; } export interface InstantiateMsgAminoMsg { type: "osmosis/cosmwasmpool/instantiate-msg"; @@ -34,6 +35,16 @@ function createBaseInstantiateMsg(): InstantiateMsg { } export const InstantiateMsg = { typeUrl: "/osmosis.cosmwasmpool.v1beta1.InstantiateMsg", + aminoType: "osmosis/cosmwasmpool/instantiate-msg", + is(o: any): o is InstantiateMsg { + return o && (o.$typeUrl === InstantiateMsg.typeUrl || Array.isArray(o.poolAssetDenoms) && (!o.poolAssetDenoms.length || typeof o.poolAssetDenoms[0] === "string")); + }, + isSDK(o: any): o is InstantiateMsgSDKType { + return o && (o.$typeUrl === InstantiateMsg.typeUrl || Array.isArray(o.pool_asset_denoms) && (!o.pool_asset_denoms.length || typeof o.pool_asset_denoms[0] === "string")); + }, + isAmino(o: any): o is InstantiateMsgAmino { + return o && (o.$typeUrl === InstantiateMsg.typeUrl || Array.isArray(o.pool_asset_denoms) && (!o.pool_asset_denoms.length || typeof o.pool_asset_denoms[0] === "string")); + }, encode(message: InstantiateMsg, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.poolAssetDenoms) { writer.uint32(10).string(v!); @@ -57,15 +68,29 @@ export const InstantiateMsg = { } return message; }, + fromJSON(object: any): InstantiateMsg { + return { + poolAssetDenoms: Array.isArray(object?.poolAssetDenoms) ? object.poolAssetDenoms.map((e: any) => String(e)) : [] + }; + }, + toJSON(message: InstantiateMsg): unknown { + const obj: any = {}; + if (message.poolAssetDenoms) { + obj.poolAssetDenoms = message.poolAssetDenoms.map(e => e); + } else { + obj.poolAssetDenoms = []; + } + return obj; + }, fromPartial(object: Partial): InstantiateMsg { const message = createBaseInstantiateMsg(); message.poolAssetDenoms = object.poolAssetDenoms?.map(e => e) || []; return message; }, fromAmino(object: InstantiateMsgAmino): InstantiateMsg { - return { - poolAssetDenoms: Array.isArray(object?.pool_asset_denoms) ? object.pool_asset_denoms.map((e: any) => e) : [] - }; + const message = createBaseInstantiateMsg(); + message.poolAssetDenoms = object.pool_asset_denoms?.map(e => e) || []; + return message; }, toAmino(message: InstantiateMsg): InstantiateMsgAmino { const obj: any = {}; @@ -97,4 +122,6 @@ export const InstantiateMsg = { value: InstantiateMsg.encode(message).finish() }; } -}; \ No newline at end of file +}; +GlobalDecoderRegistry.register(InstantiateMsg.typeUrl, InstantiateMsg); +GlobalDecoderRegistry.registerAminoProtoMapping(InstantiateMsg.aminoType, InstantiateMsg.typeUrl); \ No newline at end of file diff --git a/packages/osmojs/src/codegen/osmosis/cosmwasmpool/v1beta1/model/module_query_msg.ts b/packages/osmojs/src/codegen/osmosis/cosmwasmpool/v1beta1/model/module_query_msg.ts index 0bcc4dab8..02770faf0 100644 --- a/packages/osmojs/src/codegen/osmosis/cosmwasmpool/v1beta1/model/module_query_msg.ts +++ b/packages/osmojs/src/codegen/osmosis/cosmwasmpool/v1beta1/model/module_query_msg.ts @@ -1,6 +1,8 @@ import { Coin, CoinAmino, CoinSDKType } from "../../../../cosmos/base/v1beta1/coin"; import { BinaryReader, BinaryWriter } from "../../../../binary"; import { Decimal } from "@cosmjs/math"; +import { isSet } from "../../../../helpers"; +import { GlobalDecoderRegistry } from "../../../../registry"; /** ===================== CalcOutAmtGivenIn */ export interface CalcOutAmtGivenIn { /** token_in is the token to be sent to the pool. */ @@ -19,9 +21,9 @@ export interface CalcOutAmtGivenInAmino { /** token_in is the token to be sent to the pool. */ token_in?: CoinAmino; /** token_out_denom is the token denom to be received from the pool. */ - token_out_denom: string; + token_out_denom?: string; /** swap_fee is the swap fee for this swap estimate. */ - swap_fee: string; + swap_fee?: string; } export interface CalcOutAmtGivenInAminoMsg { type: "osmosis/cosmwasmpool/calc-out-amt-given-in"; @@ -95,9 +97,9 @@ export interface CalcInAmtGivenOutAmino { /** token_out is the token out to be receoved from the pool. */ token_out?: CoinAmino; /** token_in_denom is the token denom to be sentt to the pool. */ - token_in_denom: string; + token_in_denom?: string; /** swap_fee is the swap fee for this swap estimate. */ - swap_fee: string; + swap_fee?: string; } export interface CalcInAmtGivenOutAminoMsg { type: "osmosis/cosmwasmpool/calc-in-amt-given-out"; @@ -155,13 +157,23 @@ export interface CalcInAmtGivenOutResponseSDKType { } function createBaseCalcOutAmtGivenIn(): CalcOutAmtGivenIn { return { - tokenIn: undefined, + tokenIn: Coin.fromPartial({}), tokenOutDenom: "", swapFee: "" }; } export const CalcOutAmtGivenIn = { typeUrl: "/osmosis.cosmwasmpool.v1beta1.CalcOutAmtGivenIn", + aminoType: "osmosis/cosmwasmpool/calc-out-amt-given-in", + is(o: any): o is CalcOutAmtGivenIn { + return o && (o.$typeUrl === CalcOutAmtGivenIn.typeUrl || Coin.is(o.tokenIn) && typeof o.tokenOutDenom === "string" && typeof o.swapFee === "string"); + }, + isSDK(o: any): o is CalcOutAmtGivenInSDKType { + return o && (o.$typeUrl === CalcOutAmtGivenIn.typeUrl || Coin.isSDK(o.token_in) && typeof o.token_out_denom === "string" && typeof o.swap_fee === "string"); + }, + isAmino(o: any): o is CalcOutAmtGivenInAmino { + return o && (o.$typeUrl === CalcOutAmtGivenIn.typeUrl || Coin.isAmino(o.token_in) && typeof o.token_out_denom === "string" && typeof o.swap_fee === "string"); + }, encode(message: CalcOutAmtGivenIn, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.tokenIn !== undefined) { Coin.encode(message.tokenIn, writer.uint32(10).fork()).ldelim(); @@ -197,6 +209,20 @@ export const CalcOutAmtGivenIn = { } return message; }, + fromJSON(object: any): CalcOutAmtGivenIn { + return { + tokenIn: isSet(object.tokenIn) ? Coin.fromJSON(object.tokenIn) : undefined, + tokenOutDenom: isSet(object.tokenOutDenom) ? String(object.tokenOutDenom) : "", + swapFee: isSet(object.swapFee) ? String(object.swapFee) : "" + }; + }, + toJSON(message: CalcOutAmtGivenIn): unknown { + const obj: any = {}; + message.tokenIn !== undefined && (obj.tokenIn = message.tokenIn ? Coin.toJSON(message.tokenIn) : undefined); + message.tokenOutDenom !== undefined && (obj.tokenOutDenom = message.tokenOutDenom); + message.swapFee !== undefined && (obj.swapFee = message.swapFee); + return obj; + }, fromPartial(object: Partial): CalcOutAmtGivenIn { const message = createBaseCalcOutAmtGivenIn(); message.tokenIn = object.tokenIn !== undefined && object.tokenIn !== null ? Coin.fromPartial(object.tokenIn) : undefined; @@ -205,11 +231,17 @@ export const CalcOutAmtGivenIn = { return message; }, fromAmino(object: CalcOutAmtGivenInAmino): CalcOutAmtGivenIn { - return { - tokenIn: object?.token_in ? Coin.fromAmino(object.token_in) : undefined, - tokenOutDenom: object.token_out_denom, - swapFee: object.swap_fee - }; + const message = createBaseCalcOutAmtGivenIn(); + if (object.token_in !== undefined && object.token_in !== null) { + message.tokenIn = Coin.fromAmino(object.token_in); + } + if (object.token_out_denom !== undefined && object.token_out_denom !== null) { + message.tokenOutDenom = object.token_out_denom; + } + if (object.swap_fee !== undefined && object.swap_fee !== null) { + message.swapFee = object.swap_fee; + } + return message; }, toAmino(message: CalcOutAmtGivenIn): CalcOutAmtGivenInAmino { const obj: any = {}; @@ -240,6 +272,8 @@ export const CalcOutAmtGivenIn = { }; } }; +GlobalDecoderRegistry.register(CalcOutAmtGivenIn.typeUrl, CalcOutAmtGivenIn); +GlobalDecoderRegistry.registerAminoProtoMapping(CalcOutAmtGivenIn.aminoType, CalcOutAmtGivenIn.typeUrl); function createBaseCalcOutAmtGivenInRequest(): CalcOutAmtGivenInRequest { return { calcOutAmtGivenIn: CalcOutAmtGivenIn.fromPartial({}) @@ -247,6 +281,16 @@ function createBaseCalcOutAmtGivenInRequest(): CalcOutAmtGivenInRequest { } export const CalcOutAmtGivenInRequest = { typeUrl: "/osmosis.cosmwasmpool.v1beta1.CalcOutAmtGivenInRequest", + aminoType: "osmosis/cosmwasmpool/calc-out-amt-given-in-request", + is(o: any): o is CalcOutAmtGivenInRequest { + return o && (o.$typeUrl === CalcOutAmtGivenInRequest.typeUrl || CalcOutAmtGivenIn.is(o.calcOutAmtGivenIn)); + }, + isSDK(o: any): o is CalcOutAmtGivenInRequestSDKType { + return o && (o.$typeUrl === CalcOutAmtGivenInRequest.typeUrl || CalcOutAmtGivenIn.isSDK(o.calc_out_amt_given_in)); + }, + isAmino(o: any): o is CalcOutAmtGivenInRequestAmino { + return o && (o.$typeUrl === CalcOutAmtGivenInRequest.typeUrl || CalcOutAmtGivenIn.isAmino(o.calc_out_amt_given_in)); + }, encode(message: CalcOutAmtGivenInRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.calcOutAmtGivenIn !== undefined) { CalcOutAmtGivenIn.encode(message.calcOutAmtGivenIn, writer.uint32(10).fork()).ldelim(); @@ -270,15 +314,27 @@ export const CalcOutAmtGivenInRequest = { } return message; }, + fromJSON(object: any): CalcOutAmtGivenInRequest { + return { + calcOutAmtGivenIn: isSet(object.calcOutAmtGivenIn) ? CalcOutAmtGivenIn.fromJSON(object.calcOutAmtGivenIn) : undefined + }; + }, + toJSON(message: CalcOutAmtGivenInRequest): unknown { + const obj: any = {}; + message.calcOutAmtGivenIn !== undefined && (obj.calcOutAmtGivenIn = message.calcOutAmtGivenIn ? CalcOutAmtGivenIn.toJSON(message.calcOutAmtGivenIn) : undefined); + return obj; + }, fromPartial(object: Partial): CalcOutAmtGivenInRequest { const message = createBaseCalcOutAmtGivenInRequest(); message.calcOutAmtGivenIn = object.calcOutAmtGivenIn !== undefined && object.calcOutAmtGivenIn !== null ? CalcOutAmtGivenIn.fromPartial(object.calcOutAmtGivenIn) : undefined; return message; }, fromAmino(object: CalcOutAmtGivenInRequestAmino): CalcOutAmtGivenInRequest { - return { - calcOutAmtGivenIn: object?.calc_out_amt_given_in ? CalcOutAmtGivenIn.fromAmino(object.calc_out_amt_given_in) : undefined - }; + const message = createBaseCalcOutAmtGivenInRequest(); + if (object.calc_out_amt_given_in !== undefined && object.calc_out_amt_given_in !== null) { + message.calcOutAmtGivenIn = CalcOutAmtGivenIn.fromAmino(object.calc_out_amt_given_in); + } + return message; }, toAmino(message: CalcOutAmtGivenInRequest): CalcOutAmtGivenInRequestAmino { const obj: any = {}; @@ -307,13 +363,25 @@ export const CalcOutAmtGivenInRequest = { }; } }; +GlobalDecoderRegistry.register(CalcOutAmtGivenInRequest.typeUrl, CalcOutAmtGivenInRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(CalcOutAmtGivenInRequest.aminoType, CalcOutAmtGivenInRequest.typeUrl); function createBaseCalcOutAmtGivenInResponse(): CalcOutAmtGivenInResponse { return { - tokenOut: undefined + tokenOut: Coin.fromPartial({}) }; } export const CalcOutAmtGivenInResponse = { typeUrl: "/osmosis.cosmwasmpool.v1beta1.CalcOutAmtGivenInResponse", + aminoType: "osmosis/cosmwasmpool/calc-out-amt-given-in-response", + is(o: any): o is CalcOutAmtGivenInResponse { + return o && (o.$typeUrl === CalcOutAmtGivenInResponse.typeUrl || Coin.is(o.tokenOut)); + }, + isSDK(o: any): o is CalcOutAmtGivenInResponseSDKType { + return o && (o.$typeUrl === CalcOutAmtGivenInResponse.typeUrl || Coin.isSDK(o.token_out)); + }, + isAmino(o: any): o is CalcOutAmtGivenInResponseAmino { + return o && (o.$typeUrl === CalcOutAmtGivenInResponse.typeUrl || Coin.isAmino(o.token_out)); + }, encode(message: CalcOutAmtGivenInResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.tokenOut !== undefined) { Coin.encode(message.tokenOut, writer.uint32(10).fork()).ldelim(); @@ -337,15 +405,27 @@ export const CalcOutAmtGivenInResponse = { } return message; }, + fromJSON(object: any): CalcOutAmtGivenInResponse { + return { + tokenOut: isSet(object.tokenOut) ? Coin.fromJSON(object.tokenOut) : undefined + }; + }, + toJSON(message: CalcOutAmtGivenInResponse): unknown { + const obj: any = {}; + message.tokenOut !== undefined && (obj.tokenOut = message.tokenOut ? Coin.toJSON(message.tokenOut) : undefined); + return obj; + }, fromPartial(object: Partial): CalcOutAmtGivenInResponse { const message = createBaseCalcOutAmtGivenInResponse(); message.tokenOut = object.tokenOut !== undefined && object.tokenOut !== null ? Coin.fromPartial(object.tokenOut) : undefined; return message; }, fromAmino(object: CalcOutAmtGivenInResponseAmino): CalcOutAmtGivenInResponse { - return { - tokenOut: object?.token_out ? Coin.fromAmino(object.token_out) : undefined - }; + const message = createBaseCalcOutAmtGivenInResponse(); + if (object.token_out !== undefined && object.token_out !== null) { + message.tokenOut = Coin.fromAmino(object.token_out); + } + return message; }, toAmino(message: CalcOutAmtGivenInResponse): CalcOutAmtGivenInResponseAmino { const obj: any = {}; @@ -374,15 +454,27 @@ export const CalcOutAmtGivenInResponse = { }; } }; +GlobalDecoderRegistry.register(CalcOutAmtGivenInResponse.typeUrl, CalcOutAmtGivenInResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(CalcOutAmtGivenInResponse.aminoType, CalcOutAmtGivenInResponse.typeUrl); function createBaseCalcInAmtGivenOut(): CalcInAmtGivenOut { return { - tokenOut: undefined, + tokenOut: Coin.fromPartial({}), tokenInDenom: "", swapFee: "" }; } export const CalcInAmtGivenOut = { typeUrl: "/osmosis.cosmwasmpool.v1beta1.CalcInAmtGivenOut", + aminoType: "osmosis/cosmwasmpool/calc-in-amt-given-out", + is(o: any): o is CalcInAmtGivenOut { + return o && (o.$typeUrl === CalcInAmtGivenOut.typeUrl || Coin.is(o.tokenOut) && typeof o.tokenInDenom === "string" && typeof o.swapFee === "string"); + }, + isSDK(o: any): o is CalcInAmtGivenOutSDKType { + return o && (o.$typeUrl === CalcInAmtGivenOut.typeUrl || Coin.isSDK(o.token_out) && typeof o.token_in_denom === "string" && typeof o.swap_fee === "string"); + }, + isAmino(o: any): o is CalcInAmtGivenOutAmino { + return o && (o.$typeUrl === CalcInAmtGivenOut.typeUrl || Coin.isAmino(o.token_out) && typeof o.token_in_denom === "string" && typeof o.swap_fee === "string"); + }, encode(message: CalcInAmtGivenOut, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.tokenOut !== undefined) { Coin.encode(message.tokenOut, writer.uint32(10).fork()).ldelim(); @@ -418,6 +510,20 @@ export const CalcInAmtGivenOut = { } return message; }, + fromJSON(object: any): CalcInAmtGivenOut { + return { + tokenOut: isSet(object.tokenOut) ? Coin.fromJSON(object.tokenOut) : undefined, + tokenInDenom: isSet(object.tokenInDenom) ? String(object.tokenInDenom) : "", + swapFee: isSet(object.swapFee) ? String(object.swapFee) : "" + }; + }, + toJSON(message: CalcInAmtGivenOut): unknown { + const obj: any = {}; + message.tokenOut !== undefined && (obj.tokenOut = message.tokenOut ? Coin.toJSON(message.tokenOut) : undefined); + message.tokenInDenom !== undefined && (obj.tokenInDenom = message.tokenInDenom); + message.swapFee !== undefined && (obj.swapFee = message.swapFee); + return obj; + }, fromPartial(object: Partial): CalcInAmtGivenOut { const message = createBaseCalcInAmtGivenOut(); message.tokenOut = object.tokenOut !== undefined && object.tokenOut !== null ? Coin.fromPartial(object.tokenOut) : undefined; @@ -426,11 +532,17 @@ export const CalcInAmtGivenOut = { return message; }, fromAmino(object: CalcInAmtGivenOutAmino): CalcInAmtGivenOut { - return { - tokenOut: object?.token_out ? Coin.fromAmino(object.token_out) : undefined, - tokenInDenom: object.token_in_denom, - swapFee: object.swap_fee - }; + const message = createBaseCalcInAmtGivenOut(); + if (object.token_out !== undefined && object.token_out !== null) { + message.tokenOut = Coin.fromAmino(object.token_out); + } + if (object.token_in_denom !== undefined && object.token_in_denom !== null) { + message.tokenInDenom = object.token_in_denom; + } + if (object.swap_fee !== undefined && object.swap_fee !== null) { + message.swapFee = object.swap_fee; + } + return message; }, toAmino(message: CalcInAmtGivenOut): CalcInAmtGivenOutAmino { const obj: any = {}; @@ -461,6 +573,8 @@ export const CalcInAmtGivenOut = { }; } }; +GlobalDecoderRegistry.register(CalcInAmtGivenOut.typeUrl, CalcInAmtGivenOut); +GlobalDecoderRegistry.registerAminoProtoMapping(CalcInAmtGivenOut.aminoType, CalcInAmtGivenOut.typeUrl); function createBaseCalcInAmtGivenOutRequest(): CalcInAmtGivenOutRequest { return { calcInAmtGivenOut: CalcInAmtGivenOut.fromPartial({}) @@ -468,6 +582,16 @@ function createBaseCalcInAmtGivenOutRequest(): CalcInAmtGivenOutRequest { } export const CalcInAmtGivenOutRequest = { typeUrl: "/osmosis.cosmwasmpool.v1beta1.CalcInAmtGivenOutRequest", + aminoType: "osmosis/cosmwasmpool/calc-in-amt-given-out-request", + is(o: any): o is CalcInAmtGivenOutRequest { + return o && (o.$typeUrl === CalcInAmtGivenOutRequest.typeUrl || CalcInAmtGivenOut.is(o.calcInAmtGivenOut)); + }, + isSDK(o: any): o is CalcInAmtGivenOutRequestSDKType { + return o && (o.$typeUrl === CalcInAmtGivenOutRequest.typeUrl || CalcInAmtGivenOut.isSDK(o.calc_in_amt_given_out)); + }, + isAmino(o: any): o is CalcInAmtGivenOutRequestAmino { + return o && (o.$typeUrl === CalcInAmtGivenOutRequest.typeUrl || CalcInAmtGivenOut.isAmino(o.calc_in_amt_given_out)); + }, encode(message: CalcInAmtGivenOutRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.calcInAmtGivenOut !== undefined) { CalcInAmtGivenOut.encode(message.calcInAmtGivenOut, writer.uint32(10).fork()).ldelim(); @@ -491,15 +615,27 @@ export const CalcInAmtGivenOutRequest = { } return message; }, + fromJSON(object: any): CalcInAmtGivenOutRequest { + return { + calcInAmtGivenOut: isSet(object.calcInAmtGivenOut) ? CalcInAmtGivenOut.fromJSON(object.calcInAmtGivenOut) : undefined + }; + }, + toJSON(message: CalcInAmtGivenOutRequest): unknown { + const obj: any = {}; + message.calcInAmtGivenOut !== undefined && (obj.calcInAmtGivenOut = message.calcInAmtGivenOut ? CalcInAmtGivenOut.toJSON(message.calcInAmtGivenOut) : undefined); + return obj; + }, fromPartial(object: Partial): CalcInAmtGivenOutRequest { const message = createBaseCalcInAmtGivenOutRequest(); message.calcInAmtGivenOut = object.calcInAmtGivenOut !== undefined && object.calcInAmtGivenOut !== null ? CalcInAmtGivenOut.fromPartial(object.calcInAmtGivenOut) : undefined; return message; }, fromAmino(object: CalcInAmtGivenOutRequestAmino): CalcInAmtGivenOutRequest { - return { - calcInAmtGivenOut: object?.calc_in_amt_given_out ? CalcInAmtGivenOut.fromAmino(object.calc_in_amt_given_out) : undefined - }; + const message = createBaseCalcInAmtGivenOutRequest(); + if (object.calc_in_amt_given_out !== undefined && object.calc_in_amt_given_out !== null) { + message.calcInAmtGivenOut = CalcInAmtGivenOut.fromAmino(object.calc_in_amt_given_out); + } + return message; }, toAmino(message: CalcInAmtGivenOutRequest): CalcInAmtGivenOutRequestAmino { const obj: any = {}; @@ -528,13 +664,25 @@ export const CalcInAmtGivenOutRequest = { }; } }; +GlobalDecoderRegistry.register(CalcInAmtGivenOutRequest.typeUrl, CalcInAmtGivenOutRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(CalcInAmtGivenOutRequest.aminoType, CalcInAmtGivenOutRequest.typeUrl); function createBaseCalcInAmtGivenOutResponse(): CalcInAmtGivenOutResponse { return { - tokenIn: undefined + tokenIn: Coin.fromPartial({}) }; } export const CalcInAmtGivenOutResponse = { typeUrl: "/osmosis.cosmwasmpool.v1beta1.CalcInAmtGivenOutResponse", + aminoType: "osmosis/cosmwasmpool/calc-in-amt-given-out-response", + is(o: any): o is CalcInAmtGivenOutResponse { + return o && (o.$typeUrl === CalcInAmtGivenOutResponse.typeUrl || Coin.is(o.tokenIn)); + }, + isSDK(o: any): o is CalcInAmtGivenOutResponseSDKType { + return o && (o.$typeUrl === CalcInAmtGivenOutResponse.typeUrl || Coin.isSDK(o.token_in)); + }, + isAmino(o: any): o is CalcInAmtGivenOutResponseAmino { + return o && (o.$typeUrl === CalcInAmtGivenOutResponse.typeUrl || Coin.isAmino(o.token_in)); + }, encode(message: CalcInAmtGivenOutResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.tokenIn !== undefined) { Coin.encode(message.tokenIn, writer.uint32(10).fork()).ldelim(); @@ -558,15 +706,27 @@ export const CalcInAmtGivenOutResponse = { } return message; }, + fromJSON(object: any): CalcInAmtGivenOutResponse { + return { + tokenIn: isSet(object.tokenIn) ? Coin.fromJSON(object.tokenIn) : undefined + }; + }, + toJSON(message: CalcInAmtGivenOutResponse): unknown { + const obj: any = {}; + message.tokenIn !== undefined && (obj.tokenIn = message.tokenIn ? Coin.toJSON(message.tokenIn) : undefined); + return obj; + }, fromPartial(object: Partial): CalcInAmtGivenOutResponse { const message = createBaseCalcInAmtGivenOutResponse(); message.tokenIn = object.tokenIn !== undefined && object.tokenIn !== null ? Coin.fromPartial(object.tokenIn) : undefined; return message; }, fromAmino(object: CalcInAmtGivenOutResponseAmino): CalcInAmtGivenOutResponse { - return { - tokenIn: object?.token_in ? Coin.fromAmino(object.token_in) : undefined - }; + const message = createBaseCalcInAmtGivenOutResponse(); + if (object.token_in !== undefined && object.token_in !== null) { + message.tokenIn = Coin.fromAmino(object.token_in); + } + return message; }, toAmino(message: CalcInAmtGivenOutResponse): CalcInAmtGivenOutResponseAmino { const obj: any = {}; @@ -594,4 +754,6 @@ export const CalcInAmtGivenOutResponse = { value: CalcInAmtGivenOutResponse.encode(message).finish() }; } -}; \ No newline at end of file +}; +GlobalDecoderRegistry.register(CalcInAmtGivenOutResponse.typeUrl, CalcInAmtGivenOutResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(CalcInAmtGivenOutResponse.aminoType, CalcInAmtGivenOutResponse.typeUrl); \ No newline at end of file diff --git a/packages/osmojs/src/codegen/osmosis/cosmwasmpool/v1beta1/model/module_sudo_msg.ts b/packages/osmojs/src/codegen/osmosis/cosmwasmpool/v1beta1/model/module_sudo_msg.ts index ca77e5009..57ac31450 100644 --- a/packages/osmojs/src/codegen/osmosis/cosmwasmpool/v1beta1/model/module_sudo_msg.ts +++ b/packages/osmojs/src/codegen/osmosis/cosmwasmpool/v1beta1/model/module_sudo_msg.ts @@ -1,6 +1,8 @@ import { Coin, CoinAmino, CoinSDKType } from "../../../../cosmos/base/v1beta1/coin"; import { BinaryReader, BinaryWriter } from "../../../../binary"; import { Decimal } from "@cosmjs/math"; +import { isSet } from "../../../../helpers"; +import { GlobalDecoderRegistry } from "../../../../registry"; /** ===================== SwapExactAmountIn */ export interface SwapExactAmountIn { sender: string; @@ -22,18 +24,18 @@ export interface SwapExactAmountInProtoMsg { } /** ===================== SwapExactAmountIn */ export interface SwapExactAmountInAmino { - sender: string; + sender?: string; /** token_in is the token to be sent to the pool. */ token_in?: CoinAmino; /** token_out_denom is the token denom to be received from the pool. */ - token_out_denom: string; + token_out_denom?: string; /** * token_out_min_amount is the minimum amount of token_out to be received from * the pool. */ - token_out_min_amount: string; + token_out_min_amount?: string; /** swap_fee is the swap fee for this swap estimate. */ - swap_fee: string; + swap_fee?: string; } export interface SwapExactAmountInAminoMsg { type: "osmosis/cosmwasmpool/swap-exact-amount-in"; @@ -82,7 +84,7 @@ export interface SwapExactAmountInSudoMsgResponseProtoMsg { } export interface SwapExactAmountInSudoMsgResponseAmino { /** token_out_amount is the token out computed from this swap estimate call. */ - token_out_amount: string; + token_out_amount?: string; } export interface SwapExactAmountInSudoMsgResponseAminoMsg { type: "osmosis/cosmwasmpool/swap-exact-amount-in-sudo-msg-response"; @@ -112,18 +114,18 @@ export interface SwapExactAmountOutProtoMsg { } /** ===================== SwapExactAmountOut */ export interface SwapExactAmountOutAmino { - sender: string; + sender?: string; /** token_out is the token to be sent out of the pool. */ token_out?: CoinAmino; /** token_in_denom is the token denom to be sent too the pool. */ - token_in_denom: string; + token_in_denom?: string; /** * token_in_max_amount is the maximum amount of token_in to be sent to the * pool. */ - token_in_max_amount: string; + token_in_max_amount?: string; /** swap_fee is the swap fee for this swap estimate. */ - swap_fee: string; + swap_fee?: string; } export interface SwapExactAmountOutAminoMsg { type: "osmosis/cosmwasmpool/swap-exact-amount-out"; @@ -172,7 +174,7 @@ export interface SwapExactAmountOutSudoMsgResponseProtoMsg { } export interface SwapExactAmountOutSudoMsgResponseAmino { /** token_in_amount is the token in computed from this swap estimate call. */ - token_in_amount: string; + token_in_amount?: string; } export interface SwapExactAmountOutSudoMsgResponseAminoMsg { type: "osmosis/cosmwasmpool/swap-exact-amount-out-sudo-msg-response"; @@ -184,7 +186,7 @@ export interface SwapExactAmountOutSudoMsgResponseSDKType { function createBaseSwapExactAmountIn(): SwapExactAmountIn { return { sender: "", - tokenIn: undefined, + tokenIn: Coin.fromPartial({}), tokenOutDenom: "", tokenOutMinAmount: "", swapFee: "" @@ -192,6 +194,16 @@ function createBaseSwapExactAmountIn(): SwapExactAmountIn { } export const SwapExactAmountIn = { typeUrl: "/osmosis.cosmwasmpool.v1beta1.SwapExactAmountIn", + aminoType: "osmosis/cosmwasmpool/swap-exact-amount-in", + is(o: any): o is SwapExactAmountIn { + return o && (o.$typeUrl === SwapExactAmountIn.typeUrl || typeof o.sender === "string" && Coin.is(o.tokenIn) && typeof o.tokenOutDenom === "string" && typeof o.tokenOutMinAmount === "string" && typeof o.swapFee === "string"); + }, + isSDK(o: any): o is SwapExactAmountInSDKType { + return o && (o.$typeUrl === SwapExactAmountIn.typeUrl || typeof o.sender === "string" && Coin.isSDK(o.token_in) && typeof o.token_out_denom === "string" && typeof o.token_out_min_amount === "string" && typeof o.swap_fee === "string"); + }, + isAmino(o: any): o is SwapExactAmountInAmino { + return o && (o.$typeUrl === SwapExactAmountIn.typeUrl || typeof o.sender === "string" && Coin.isAmino(o.token_in) && typeof o.token_out_denom === "string" && typeof o.token_out_min_amount === "string" && typeof o.swap_fee === "string"); + }, encode(message: SwapExactAmountIn, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.sender !== "") { writer.uint32(10).string(message.sender); @@ -239,6 +251,24 @@ export const SwapExactAmountIn = { } return message; }, + fromJSON(object: any): SwapExactAmountIn { + return { + sender: isSet(object.sender) ? String(object.sender) : "", + tokenIn: isSet(object.tokenIn) ? Coin.fromJSON(object.tokenIn) : undefined, + tokenOutDenom: isSet(object.tokenOutDenom) ? String(object.tokenOutDenom) : "", + tokenOutMinAmount: isSet(object.tokenOutMinAmount) ? String(object.tokenOutMinAmount) : "", + swapFee: isSet(object.swapFee) ? String(object.swapFee) : "" + }; + }, + toJSON(message: SwapExactAmountIn): unknown { + const obj: any = {}; + message.sender !== undefined && (obj.sender = message.sender); + message.tokenIn !== undefined && (obj.tokenIn = message.tokenIn ? Coin.toJSON(message.tokenIn) : undefined); + message.tokenOutDenom !== undefined && (obj.tokenOutDenom = message.tokenOutDenom); + message.tokenOutMinAmount !== undefined && (obj.tokenOutMinAmount = message.tokenOutMinAmount); + message.swapFee !== undefined && (obj.swapFee = message.swapFee); + return obj; + }, fromPartial(object: Partial): SwapExactAmountIn { const message = createBaseSwapExactAmountIn(); message.sender = object.sender ?? ""; @@ -249,13 +279,23 @@ export const SwapExactAmountIn = { return message; }, fromAmino(object: SwapExactAmountInAmino): SwapExactAmountIn { - return { - sender: object.sender, - tokenIn: object?.token_in ? Coin.fromAmino(object.token_in) : undefined, - tokenOutDenom: object.token_out_denom, - tokenOutMinAmount: object.token_out_min_amount, - swapFee: object.swap_fee - }; + const message = createBaseSwapExactAmountIn(); + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + if (object.token_in !== undefined && object.token_in !== null) { + message.tokenIn = Coin.fromAmino(object.token_in); + } + if (object.token_out_denom !== undefined && object.token_out_denom !== null) { + message.tokenOutDenom = object.token_out_denom; + } + if (object.token_out_min_amount !== undefined && object.token_out_min_amount !== null) { + message.tokenOutMinAmount = object.token_out_min_amount; + } + if (object.swap_fee !== undefined && object.swap_fee !== null) { + message.swapFee = object.swap_fee; + } + return message; }, toAmino(message: SwapExactAmountIn): SwapExactAmountInAmino { const obj: any = {}; @@ -288,6 +328,8 @@ export const SwapExactAmountIn = { }; } }; +GlobalDecoderRegistry.register(SwapExactAmountIn.typeUrl, SwapExactAmountIn); +GlobalDecoderRegistry.registerAminoProtoMapping(SwapExactAmountIn.aminoType, SwapExactAmountIn.typeUrl); function createBaseSwapExactAmountInSudoMsg(): SwapExactAmountInSudoMsg { return { swapExactAmountIn: SwapExactAmountIn.fromPartial({}) @@ -295,6 +337,16 @@ function createBaseSwapExactAmountInSudoMsg(): SwapExactAmountInSudoMsg { } export const SwapExactAmountInSudoMsg = { typeUrl: "/osmosis.cosmwasmpool.v1beta1.SwapExactAmountInSudoMsg", + aminoType: "osmosis/cosmwasmpool/swap-exact-amount-in-sudo-msg", + is(o: any): o is SwapExactAmountInSudoMsg { + return o && (o.$typeUrl === SwapExactAmountInSudoMsg.typeUrl || SwapExactAmountIn.is(o.swapExactAmountIn)); + }, + isSDK(o: any): o is SwapExactAmountInSudoMsgSDKType { + return o && (o.$typeUrl === SwapExactAmountInSudoMsg.typeUrl || SwapExactAmountIn.isSDK(o.swap_exact_amount_in)); + }, + isAmino(o: any): o is SwapExactAmountInSudoMsgAmino { + return o && (o.$typeUrl === SwapExactAmountInSudoMsg.typeUrl || SwapExactAmountIn.isAmino(o.swap_exact_amount_in)); + }, encode(message: SwapExactAmountInSudoMsg, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.swapExactAmountIn !== undefined) { SwapExactAmountIn.encode(message.swapExactAmountIn, writer.uint32(10).fork()).ldelim(); @@ -318,15 +370,27 @@ export const SwapExactAmountInSudoMsg = { } return message; }, + fromJSON(object: any): SwapExactAmountInSudoMsg { + return { + swapExactAmountIn: isSet(object.swapExactAmountIn) ? SwapExactAmountIn.fromJSON(object.swapExactAmountIn) : undefined + }; + }, + toJSON(message: SwapExactAmountInSudoMsg): unknown { + const obj: any = {}; + message.swapExactAmountIn !== undefined && (obj.swapExactAmountIn = message.swapExactAmountIn ? SwapExactAmountIn.toJSON(message.swapExactAmountIn) : undefined); + return obj; + }, fromPartial(object: Partial): SwapExactAmountInSudoMsg { const message = createBaseSwapExactAmountInSudoMsg(); message.swapExactAmountIn = object.swapExactAmountIn !== undefined && object.swapExactAmountIn !== null ? SwapExactAmountIn.fromPartial(object.swapExactAmountIn) : undefined; return message; }, fromAmino(object: SwapExactAmountInSudoMsgAmino): SwapExactAmountInSudoMsg { - return { - swapExactAmountIn: object?.swap_exact_amount_in ? SwapExactAmountIn.fromAmino(object.swap_exact_amount_in) : undefined - }; + const message = createBaseSwapExactAmountInSudoMsg(); + if (object.swap_exact_amount_in !== undefined && object.swap_exact_amount_in !== null) { + message.swapExactAmountIn = SwapExactAmountIn.fromAmino(object.swap_exact_amount_in); + } + return message; }, toAmino(message: SwapExactAmountInSudoMsg): SwapExactAmountInSudoMsgAmino { const obj: any = {}; @@ -355,6 +419,8 @@ export const SwapExactAmountInSudoMsg = { }; } }; +GlobalDecoderRegistry.register(SwapExactAmountInSudoMsg.typeUrl, SwapExactAmountInSudoMsg); +GlobalDecoderRegistry.registerAminoProtoMapping(SwapExactAmountInSudoMsg.aminoType, SwapExactAmountInSudoMsg.typeUrl); function createBaseSwapExactAmountInSudoMsgResponse(): SwapExactAmountInSudoMsgResponse { return { tokenOutAmount: "" @@ -362,6 +428,16 @@ function createBaseSwapExactAmountInSudoMsgResponse(): SwapExactAmountInSudoMsgR } export const SwapExactAmountInSudoMsgResponse = { typeUrl: "/osmosis.cosmwasmpool.v1beta1.SwapExactAmountInSudoMsgResponse", + aminoType: "osmosis/cosmwasmpool/swap-exact-amount-in-sudo-msg-response", + is(o: any): o is SwapExactAmountInSudoMsgResponse { + return o && (o.$typeUrl === SwapExactAmountInSudoMsgResponse.typeUrl || typeof o.tokenOutAmount === "string"); + }, + isSDK(o: any): o is SwapExactAmountInSudoMsgResponseSDKType { + return o && (o.$typeUrl === SwapExactAmountInSudoMsgResponse.typeUrl || typeof o.token_out_amount === "string"); + }, + isAmino(o: any): o is SwapExactAmountInSudoMsgResponseAmino { + return o && (o.$typeUrl === SwapExactAmountInSudoMsgResponse.typeUrl || typeof o.token_out_amount === "string"); + }, encode(message: SwapExactAmountInSudoMsgResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.tokenOutAmount !== "") { writer.uint32(10).string(message.tokenOutAmount); @@ -385,15 +461,27 @@ export const SwapExactAmountInSudoMsgResponse = { } return message; }, + fromJSON(object: any): SwapExactAmountInSudoMsgResponse { + return { + tokenOutAmount: isSet(object.tokenOutAmount) ? String(object.tokenOutAmount) : "" + }; + }, + toJSON(message: SwapExactAmountInSudoMsgResponse): unknown { + const obj: any = {}; + message.tokenOutAmount !== undefined && (obj.tokenOutAmount = message.tokenOutAmount); + return obj; + }, fromPartial(object: Partial): SwapExactAmountInSudoMsgResponse { const message = createBaseSwapExactAmountInSudoMsgResponse(); message.tokenOutAmount = object.tokenOutAmount ?? ""; return message; }, fromAmino(object: SwapExactAmountInSudoMsgResponseAmino): SwapExactAmountInSudoMsgResponse { - return { - tokenOutAmount: object.token_out_amount - }; + const message = createBaseSwapExactAmountInSudoMsgResponse(); + if (object.token_out_amount !== undefined && object.token_out_amount !== null) { + message.tokenOutAmount = object.token_out_amount; + } + return message; }, toAmino(message: SwapExactAmountInSudoMsgResponse): SwapExactAmountInSudoMsgResponseAmino { const obj: any = {}; @@ -422,10 +510,12 @@ export const SwapExactAmountInSudoMsgResponse = { }; } }; +GlobalDecoderRegistry.register(SwapExactAmountInSudoMsgResponse.typeUrl, SwapExactAmountInSudoMsgResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(SwapExactAmountInSudoMsgResponse.aminoType, SwapExactAmountInSudoMsgResponse.typeUrl); function createBaseSwapExactAmountOut(): SwapExactAmountOut { return { sender: "", - tokenOut: undefined, + tokenOut: Coin.fromPartial({}), tokenInDenom: "", tokenInMaxAmount: "", swapFee: "" @@ -433,6 +523,16 @@ function createBaseSwapExactAmountOut(): SwapExactAmountOut { } export const SwapExactAmountOut = { typeUrl: "/osmosis.cosmwasmpool.v1beta1.SwapExactAmountOut", + aminoType: "osmosis/cosmwasmpool/swap-exact-amount-out", + is(o: any): o is SwapExactAmountOut { + return o && (o.$typeUrl === SwapExactAmountOut.typeUrl || typeof o.sender === "string" && Coin.is(o.tokenOut) && typeof o.tokenInDenom === "string" && typeof o.tokenInMaxAmount === "string" && typeof o.swapFee === "string"); + }, + isSDK(o: any): o is SwapExactAmountOutSDKType { + return o && (o.$typeUrl === SwapExactAmountOut.typeUrl || typeof o.sender === "string" && Coin.isSDK(o.token_out) && typeof o.token_in_denom === "string" && typeof o.token_in_max_amount === "string" && typeof o.swap_fee === "string"); + }, + isAmino(o: any): o is SwapExactAmountOutAmino { + return o && (o.$typeUrl === SwapExactAmountOut.typeUrl || typeof o.sender === "string" && Coin.isAmino(o.token_out) && typeof o.token_in_denom === "string" && typeof o.token_in_max_amount === "string" && typeof o.swap_fee === "string"); + }, encode(message: SwapExactAmountOut, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.sender !== "") { writer.uint32(10).string(message.sender); @@ -480,6 +580,24 @@ export const SwapExactAmountOut = { } return message; }, + fromJSON(object: any): SwapExactAmountOut { + return { + sender: isSet(object.sender) ? String(object.sender) : "", + tokenOut: isSet(object.tokenOut) ? Coin.fromJSON(object.tokenOut) : undefined, + tokenInDenom: isSet(object.tokenInDenom) ? String(object.tokenInDenom) : "", + tokenInMaxAmount: isSet(object.tokenInMaxAmount) ? String(object.tokenInMaxAmount) : "", + swapFee: isSet(object.swapFee) ? String(object.swapFee) : "" + }; + }, + toJSON(message: SwapExactAmountOut): unknown { + const obj: any = {}; + message.sender !== undefined && (obj.sender = message.sender); + message.tokenOut !== undefined && (obj.tokenOut = message.tokenOut ? Coin.toJSON(message.tokenOut) : undefined); + message.tokenInDenom !== undefined && (obj.tokenInDenom = message.tokenInDenom); + message.tokenInMaxAmount !== undefined && (obj.tokenInMaxAmount = message.tokenInMaxAmount); + message.swapFee !== undefined && (obj.swapFee = message.swapFee); + return obj; + }, fromPartial(object: Partial): SwapExactAmountOut { const message = createBaseSwapExactAmountOut(); message.sender = object.sender ?? ""; @@ -490,13 +608,23 @@ export const SwapExactAmountOut = { return message; }, fromAmino(object: SwapExactAmountOutAmino): SwapExactAmountOut { - return { - sender: object.sender, - tokenOut: object?.token_out ? Coin.fromAmino(object.token_out) : undefined, - tokenInDenom: object.token_in_denom, - tokenInMaxAmount: object.token_in_max_amount, - swapFee: object.swap_fee - }; + const message = createBaseSwapExactAmountOut(); + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + if (object.token_out !== undefined && object.token_out !== null) { + message.tokenOut = Coin.fromAmino(object.token_out); + } + if (object.token_in_denom !== undefined && object.token_in_denom !== null) { + message.tokenInDenom = object.token_in_denom; + } + if (object.token_in_max_amount !== undefined && object.token_in_max_amount !== null) { + message.tokenInMaxAmount = object.token_in_max_amount; + } + if (object.swap_fee !== undefined && object.swap_fee !== null) { + message.swapFee = object.swap_fee; + } + return message; }, toAmino(message: SwapExactAmountOut): SwapExactAmountOutAmino { const obj: any = {}; @@ -529,6 +657,8 @@ export const SwapExactAmountOut = { }; } }; +GlobalDecoderRegistry.register(SwapExactAmountOut.typeUrl, SwapExactAmountOut); +GlobalDecoderRegistry.registerAminoProtoMapping(SwapExactAmountOut.aminoType, SwapExactAmountOut.typeUrl); function createBaseSwapExactAmountOutSudoMsg(): SwapExactAmountOutSudoMsg { return { swapExactAmountOut: SwapExactAmountOut.fromPartial({}) @@ -536,6 +666,16 @@ function createBaseSwapExactAmountOutSudoMsg(): SwapExactAmountOutSudoMsg { } export const SwapExactAmountOutSudoMsg = { typeUrl: "/osmosis.cosmwasmpool.v1beta1.SwapExactAmountOutSudoMsg", + aminoType: "osmosis/cosmwasmpool/swap-exact-amount-out-sudo-msg", + is(o: any): o is SwapExactAmountOutSudoMsg { + return o && (o.$typeUrl === SwapExactAmountOutSudoMsg.typeUrl || SwapExactAmountOut.is(o.swapExactAmountOut)); + }, + isSDK(o: any): o is SwapExactAmountOutSudoMsgSDKType { + return o && (o.$typeUrl === SwapExactAmountOutSudoMsg.typeUrl || SwapExactAmountOut.isSDK(o.swap_exact_amount_out)); + }, + isAmino(o: any): o is SwapExactAmountOutSudoMsgAmino { + return o && (o.$typeUrl === SwapExactAmountOutSudoMsg.typeUrl || SwapExactAmountOut.isAmino(o.swap_exact_amount_out)); + }, encode(message: SwapExactAmountOutSudoMsg, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.swapExactAmountOut !== undefined) { SwapExactAmountOut.encode(message.swapExactAmountOut, writer.uint32(10).fork()).ldelim(); @@ -559,15 +699,27 @@ export const SwapExactAmountOutSudoMsg = { } return message; }, + fromJSON(object: any): SwapExactAmountOutSudoMsg { + return { + swapExactAmountOut: isSet(object.swapExactAmountOut) ? SwapExactAmountOut.fromJSON(object.swapExactAmountOut) : undefined + }; + }, + toJSON(message: SwapExactAmountOutSudoMsg): unknown { + const obj: any = {}; + message.swapExactAmountOut !== undefined && (obj.swapExactAmountOut = message.swapExactAmountOut ? SwapExactAmountOut.toJSON(message.swapExactAmountOut) : undefined); + return obj; + }, fromPartial(object: Partial): SwapExactAmountOutSudoMsg { const message = createBaseSwapExactAmountOutSudoMsg(); message.swapExactAmountOut = object.swapExactAmountOut !== undefined && object.swapExactAmountOut !== null ? SwapExactAmountOut.fromPartial(object.swapExactAmountOut) : undefined; return message; }, fromAmino(object: SwapExactAmountOutSudoMsgAmino): SwapExactAmountOutSudoMsg { - return { - swapExactAmountOut: object?.swap_exact_amount_out ? SwapExactAmountOut.fromAmino(object.swap_exact_amount_out) : undefined - }; + const message = createBaseSwapExactAmountOutSudoMsg(); + if (object.swap_exact_amount_out !== undefined && object.swap_exact_amount_out !== null) { + message.swapExactAmountOut = SwapExactAmountOut.fromAmino(object.swap_exact_amount_out); + } + return message; }, toAmino(message: SwapExactAmountOutSudoMsg): SwapExactAmountOutSudoMsgAmino { const obj: any = {}; @@ -596,6 +748,8 @@ export const SwapExactAmountOutSudoMsg = { }; } }; +GlobalDecoderRegistry.register(SwapExactAmountOutSudoMsg.typeUrl, SwapExactAmountOutSudoMsg); +GlobalDecoderRegistry.registerAminoProtoMapping(SwapExactAmountOutSudoMsg.aminoType, SwapExactAmountOutSudoMsg.typeUrl); function createBaseSwapExactAmountOutSudoMsgResponse(): SwapExactAmountOutSudoMsgResponse { return { tokenInAmount: "" @@ -603,6 +757,16 @@ function createBaseSwapExactAmountOutSudoMsgResponse(): SwapExactAmountOutSudoMs } export const SwapExactAmountOutSudoMsgResponse = { typeUrl: "/osmosis.cosmwasmpool.v1beta1.SwapExactAmountOutSudoMsgResponse", + aminoType: "osmosis/cosmwasmpool/swap-exact-amount-out-sudo-msg-response", + is(o: any): o is SwapExactAmountOutSudoMsgResponse { + return o && (o.$typeUrl === SwapExactAmountOutSudoMsgResponse.typeUrl || typeof o.tokenInAmount === "string"); + }, + isSDK(o: any): o is SwapExactAmountOutSudoMsgResponseSDKType { + return o && (o.$typeUrl === SwapExactAmountOutSudoMsgResponse.typeUrl || typeof o.token_in_amount === "string"); + }, + isAmino(o: any): o is SwapExactAmountOutSudoMsgResponseAmino { + return o && (o.$typeUrl === SwapExactAmountOutSudoMsgResponse.typeUrl || typeof o.token_in_amount === "string"); + }, encode(message: SwapExactAmountOutSudoMsgResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.tokenInAmount !== "") { writer.uint32(10).string(message.tokenInAmount); @@ -626,15 +790,27 @@ export const SwapExactAmountOutSudoMsgResponse = { } return message; }, + fromJSON(object: any): SwapExactAmountOutSudoMsgResponse { + return { + tokenInAmount: isSet(object.tokenInAmount) ? String(object.tokenInAmount) : "" + }; + }, + toJSON(message: SwapExactAmountOutSudoMsgResponse): unknown { + const obj: any = {}; + message.tokenInAmount !== undefined && (obj.tokenInAmount = message.tokenInAmount); + return obj; + }, fromPartial(object: Partial): SwapExactAmountOutSudoMsgResponse { const message = createBaseSwapExactAmountOutSudoMsgResponse(); message.tokenInAmount = object.tokenInAmount ?? ""; return message; }, fromAmino(object: SwapExactAmountOutSudoMsgResponseAmino): SwapExactAmountOutSudoMsgResponse { - return { - tokenInAmount: object.token_in_amount - }; + const message = createBaseSwapExactAmountOutSudoMsgResponse(); + if (object.token_in_amount !== undefined && object.token_in_amount !== null) { + message.tokenInAmount = object.token_in_amount; + } + return message; }, toAmino(message: SwapExactAmountOutSudoMsgResponse): SwapExactAmountOutSudoMsgResponseAmino { const obj: any = {}; @@ -662,4 +838,6 @@ export const SwapExactAmountOutSudoMsgResponse = { value: SwapExactAmountOutSudoMsgResponse.encode(message).finish() }; } -}; \ No newline at end of file +}; +GlobalDecoderRegistry.register(SwapExactAmountOutSudoMsgResponse.typeUrl, SwapExactAmountOutSudoMsgResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(SwapExactAmountOutSudoMsgResponse.aminoType, SwapExactAmountOutSudoMsgResponse.typeUrl); \ No newline at end of file diff --git a/packages/osmojs/src/codegen/osmosis/cosmwasmpool/v1beta1/model/pool.ts b/packages/osmojs/src/codegen/osmosis/cosmwasmpool/v1beta1/model/pool.ts index 4e044f4b1..940176f6e 100644 --- a/packages/osmojs/src/codegen/osmosis/cosmwasmpool/v1beta1/model/pool.ts +++ b/packages/osmojs/src/codegen/osmosis/cosmwasmpool/v1beta1/model/pool.ts @@ -1,6 +1,26 @@ import { BinaryReader, BinaryWriter } from "../../../../binary"; +import { isSet, bytesFromBase64, base64FromBytes } from "../../../../helpers"; +import { GlobalDecoderRegistry } from "../../../../registry"; +/** + * CosmWasmPool represents the data serialized into state for each CW pool. + * + * Note: CW Pool has 2 pool models: + * - CosmWasmPool which is a proto-generated store model used for serialization + * into state. + * - Pool struct that encapsulates the CosmWasmPool and wasmKeeper for calling + * the contract. + * + * CosmWasmPool implements the poolmanager.PoolI interface but it panics on all + * methods. The reason is that access to wasmKeeper is required to call the + * contract. + * + * Instead, all interactions and poolmanager.PoolI methods are to be performed + * on the Pool struct. The reason why we cannot have a Pool struct only is + * because it cannot be serialized into state due to having a non-serializable + * wasmKeeper field. + */ export interface CosmWasmPool { - $typeUrl?: string; + $typeUrl?: "/osmosis.cosmwasmpool.v1beta1.CosmWasmPool"; contractAddress: string; poolId: bigint; codeId: bigint; @@ -10,18 +30,54 @@ export interface CosmWasmPoolProtoMsg { typeUrl: "/osmosis.cosmwasmpool.v1beta1.CosmWasmPool"; value: Uint8Array; } +/** + * CosmWasmPool represents the data serialized into state for each CW pool. + * + * Note: CW Pool has 2 pool models: + * - CosmWasmPool which is a proto-generated store model used for serialization + * into state. + * - Pool struct that encapsulates the CosmWasmPool and wasmKeeper for calling + * the contract. + * + * CosmWasmPool implements the poolmanager.PoolI interface but it panics on all + * methods. The reason is that access to wasmKeeper is required to call the + * contract. + * + * Instead, all interactions and poolmanager.PoolI methods are to be performed + * on the Pool struct. The reason why we cannot have a Pool struct only is + * because it cannot be serialized into state due to having a non-serializable + * wasmKeeper field. + */ export interface CosmWasmPoolAmino { - contract_address: string; - pool_id: string; - code_id: string; - instantiate_msg: Uint8Array; + contract_address?: string; + pool_id?: string; + code_id?: string; + instantiate_msg?: string; } export interface CosmWasmPoolAminoMsg { type: "osmosis/cosmwasmpool/cosm-wasm-pool"; value: CosmWasmPoolAmino; } +/** + * CosmWasmPool represents the data serialized into state for each CW pool. + * + * Note: CW Pool has 2 pool models: + * - CosmWasmPool which is a proto-generated store model used for serialization + * into state. + * - Pool struct that encapsulates the CosmWasmPool and wasmKeeper for calling + * the contract. + * + * CosmWasmPool implements the poolmanager.PoolI interface but it panics on all + * methods. The reason is that access to wasmKeeper is required to call the + * contract. + * + * Instead, all interactions and poolmanager.PoolI methods are to be performed + * on the Pool struct. The reason why we cannot have a Pool struct only is + * because it cannot be serialized into state due to having a non-serializable + * wasmKeeper field. + */ export interface CosmWasmPoolSDKType { - $typeUrl?: string; + $typeUrl?: "/osmosis.cosmwasmpool.v1beta1.CosmWasmPool"; contract_address: string; pool_id: bigint; code_id: bigint; @@ -38,6 +94,16 @@ function createBaseCosmWasmPool(): CosmWasmPool { } export const CosmWasmPool = { typeUrl: "/osmosis.cosmwasmpool.v1beta1.CosmWasmPool", + aminoType: "osmosis/cosmwasmpool/cosm-wasm-pool", + is(o: any): o is CosmWasmPool { + return o && (o.$typeUrl === CosmWasmPool.typeUrl || typeof o.contractAddress === "string" && typeof o.poolId === "bigint" && typeof o.codeId === "bigint" && (o.instantiateMsg instanceof Uint8Array || typeof o.instantiateMsg === "string")); + }, + isSDK(o: any): o is CosmWasmPoolSDKType { + return o && (o.$typeUrl === CosmWasmPool.typeUrl || typeof o.contract_address === "string" && typeof o.pool_id === "bigint" && typeof o.code_id === "bigint" && (o.instantiate_msg instanceof Uint8Array || typeof o.instantiate_msg === "string")); + }, + isAmino(o: any): o is CosmWasmPoolAmino { + return o && (o.$typeUrl === CosmWasmPool.typeUrl || typeof o.contract_address === "string" && typeof o.pool_id === "bigint" && typeof o.code_id === "bigint" && (o.instantiate_msg instanceof Uint8Array || typeof o.instantiate_msg === "string")); + }, encode(message: CosmWasmPool, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.contractAddress !== "") { writer.uint32(10).string(message.contractAddress); @@ -79,6 +145,22 @@ export const CosmWasmPool = { } return message; }, + fromJSON(object: any): CosmWasmPool { + return { + contractAddress: isSet(object.contractAddress) ? String(object.contractAddress) : "", + poolId: isSet(object.poolId) ? BigInt(object.poolId.toString()) : BigInt(0), + codeId: isSet(object.codeId) ? BigInt(object.codeId.toString()) : BigInt(0), + instantiateMsg: isSet(object.instantiateMsg) ? bytesFromBase64(object.instantiateMsg) : new Uint8Array() + }; + }, + toJSON(message: CosmWasmPool): unknown { + const obj: any = {}; + message.contractAddress !== undefined && (obj.contractAddress = message.contractAddress); + message.poolId !== undefined && (obj.poolId = (message.poolId || BigInt(0)).toString()); + message.codeId !== undefined && (obj.codeId = (message.codeId || BigInt(0)).toString()); + message.instantiateMsg !== undefined && (obj.instantiateMsg = base64FromBytes(message.instantiateMsg !== undefined ? message.instantiateMsg : new Uint8Array())); + return obj; + }, fromPartial(object: Partial): CosmWasmPool { const message = createBaseCosmWasmPool(); message.contractAddress = object.contractAddress ?? ""; @@ -88,19 +170,27 @@ export const CosmWasmPool = { return message; }, fromAmino(object: CosmWasmPoolAmino): CosmWasmPool { - return { - contractAddress: object.contract_address, - poolId: BigInt(object.pool_id), - codeId: BigInt(object.code_id), - instantiateMsg: object.instantiate_msg - }; + const message = createBaseCosmWasmPool(); + if (object.contract_address !== undefined && object.contract_address !== null) { + message.contractAddress = object.contract_address; + } + if (object.pool_id !== undefined && object.pool_id !== null) { + message.poolId = BigInt(object.pool_id); + } + if (object.code_id !== undefined && object.code_id !== null) { + message.codeId = BigInt(object.code_id); + } + if (object.instantiate_msg !== undefined && object.instantiate_msg !== null) { + message.instantiateMsg = bytesFromBase64(object.instantiate_msg); + } + return message; }, toAmino(message: CosmWasmPool): CosmWasmPoolAmino { const obj: any = {}; obj.contract_address = message.contractAddress; obj.pool_id = message.poolId ? message.poolId.toString() : undefined; obj.code_id = message.codeId ? message.codeId.toString() : undefined; - obj.instantiate_msg = message.instantiateMsg; + obj.instantiate_msg = message.instantiateMsg ? base64FromBytes(message.instantiateMsg) : undefined; return obj; }, fromAminoMsg(object: CosmWasmPoolAminoMsg): CosmWasmPool { @@ -124,4 +214,6 @@ export const CosmWasmPool = { value: CosmWasmPool.encode(message).finish() }; } -}; \ No newline at end of file +}; +GlobalDecoderRegistry.register(CosmWasmPool.typeUrl, CosmWasmPool); +GlobalDecoderRegistry.registerAminoProtoMapping(CosmWasmPool.aminoType, CosmWasmPool.typeUrl); \ No newline at end of file diff --git a/packages/osmojs/src/codegen/osmosis/cosmwasmpool/v1beta1/model/pool_query_msg.ts b/packages/osmojs/src/codegen/osmosis/cosmwasmpool/v1beta1/model/pool_query_msg.ts index 4f6f9eb22..e5928841e 100644 --- a/packages/osmojs/src/codegen/osmosis/cosmwasmpool/v1beta1/model/pool_query_msg.ts +++ b/packages/osmojs/src/codegen/osmosis/cosmwasmpool/v1beta1/model/pool_query_msg.ts @@ -1,9 +1,11 @@ import { Coin, CoinAmino, CoinSDKType } from "../../../../cosmos/base/v1beta1/coin"; import { BinaryReader, BinaryWriter } from "../../../../binary"; +import { isSet } from "../../../../helpers"; +import { GlobalDecoderRegistry } from "../../../../registry"; import { Decimal } from "@cosmjs/math"; /** ===================== GetSwapFeeQueryMsg */ export interface GetSwapFeeQueryMsg { - /** get_swap_fee is the query strcuture to get swap fee. */ + /** get_swap_fee is the query structure to get swap fee. */ getSwapFee: EmptyStruct; } export interface GetSwapFeeQueryMsgProtoMsg { @@ -12,7 +14,7 @@ export interface GetSwapFeeQueryMsgProtoMsg { } /** ===================== GetSwapFeeQueryMsg */ export interface GetSwapFeeQueryMsgAmino { - /** get_swap_fee is the query strcuture to get swap fee. */ + /** get_swap_fee is the query structure to get swap fee. */ get_swap_fee?: EmptyStructAmino; } export interface GetSwapFeeQueryMsgAminoMsg { @@ -33,7 +35,7 @@ export interface GetSwapFeeQueryMsgResponseProtoMsg { } export interface GetSwapFeeQueryMsgResponseAmino { /** swap_fee is the swap fee for this swap estimate. */ - swap_fee: string; + swap_fee?: string; } export interface GetSwapFeeQueryMsgResponseAminoMsg { type: "osmosis/cosmwasmpool/get-swap-fee-query-msg-response"; @@ -56,9 +58,9 @@ export interface SpotPriceProtoMsg { /** ===================== SpotPriceQueryMsg */ export interface SpotPriceAmino { /** quote_asset_denom is the quote asset of the spot query. */ - quote_asset_denom: string; + quote_asset_denom?: string; /** base_asset_denom is the base asset of the spot query. */ - base_asset_denom: string; + base_asset_denom?: string; } export interface SpotPriceAminoMsg { type: "osmosis/cosmwasmpool/spot-price"; @@ -104,7 +106,7 @@ export interface SpotPriceQueryMsgResponseProtoMsg { } export interface SpotPriceQueryMsgResponseAmino { /** spot_price is the spot price returned. */ - spot_price: string; + spot_price?: string; } export interface SpotPriceQueryMsgResponseAminoMsg { type: "osmosis/cosmwasmpool/spot-price-query-msg-response"; @@ -168,7 +170,7 @@ export interface GetTotalPoolLiquidityQueryMsgResponseAmino { * total_pool_liquidity is the total liquidity in the pool denominated in * coins. */ - total_pool_liquidity: CoinAmino[]; + total_pool_liquidity?: CoinAmino[]; } export interface GetTotalPoolLiquidityQueryMsgResponseAminoMsg { type: "osmosis/cosmwasmpool/get-total-pool-liquidity-query-msg-response"; @@ -215,7 +217,7 @@ export interface GetTotalSharesQueryMsgResponseProtoMsg { } export interface GetTotalSharesQueryMsgResponseAmino { /** total_shares is the amount of shares returned. */ - total_shares: string; + total_shares?: string; } export interface GetTotalSharesQueryMsgResponseAminoMsg { type: "osmosis/cosmwasmpool/get-total-shares-query-msg-response"; @@ -231,6 +233,16 @@ function createBaseGetSwapFeeQueryMsg(): GetSwapFeeQueryMsg { } export const GetSwapFeeQueryMsg = { typeUrl: "/osmosis.cosmwasmpool.v1beta1.GetSwapFeeQueryMsg", + aminoType: "osmosis/cosmwasmpool/get-swap-fee-query-msg", + is(o: any): o is GetSwapFeeQueryMsg { + return o && (o.$typeUrl === GetSwapFeeQueryMsg.typeUrl || EmptyStruct.is(o.getSwapFee)); + }, + isSDK(o: any): o is GetSwapFeeQueryMsgSDKType { + return o && (o.$typeUrl === GetSwapFeeQueryMsg.typeUrl || EmptyStruct.isSDK(o.get_swap_fee)); + }, + isAmino(o: any): o is GetSwapFeeQueryMsgAmino { + return o && (o.$typeUrl === GetSwapFeeQueryMsg.typeUrl || EmptyStruct.isAmino(o.get_swap_fee)); + }, encode(message: GetSwapFeeQueryMsg, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.getSwapFee !== undefined) { EmptyStruct.encode(message.getSwapFee, writer.uint32(10).fork()).ldelim(); @@ -254,15 +266,27 @@ export const GetSwapFeeQueryMsg = { } return message; }, + fromJSON(object: any): GetSwapFeeQueryMsg { + return { + getSwapFee: isSet(object.getSwapFee) ? EmptyStruct.fromJSON(object.getSwapFee) : undefined + }; + }, + toJSON(message: GetSwapFeeQueryMsg): unknown { + const obj: any = {}; + message.getSwapFee !== undefined && (obj.getSwapFee = message.getSwapFee ? EmptyStruct.toJSON(message.getSwapFee) : undefined); + return obj; + }, fromPartial(object: Partial): GetSwapFeeQueryMsg { const message = createBaseGetSwapFeeQueryMsg(); message.getSwapFee = object.getSwapFee !== undefined && object.getSwapFee !== null ? EmptyStruct.fromPartial(object.getSwapFee) : undefined; return message; }, fromAmino(object: GetSwapFeeQueryMsgAmino): GetSwapFeeQueryMsg { - return { - getSwapFee: object?.get_swap_fee ? EmptyStruct.fromAmino(object.get_swap_fee) : undefined - }; + const message = createBaseGetSwapFeeQueryMsg(); + if (object.get_swap_fee !== undefined && object.get_swap_fee !== null) { + message.getSwapFee = EmptyStruct.fromAmino(object.get_swap_fee); + } + return message; }, toAmino(message: GetSwapFeeQueryMsg): GetSwapFeeQueryMsgAmino { const obj: any = {}; @@ -291,6 +315,8 @@ export const GetSwapFeeQueryMsg = { }; } }; +GlobalDecoderRegistry.register(GetSwapFeeQueryMsg.typeUrl, GetSwapFeeQueryMsg); +GlobalDecoderRegistry.registerAminoProtoMapping(GetSwapFeeQueryMsg.aminoType, GetSwapFeeQueryMsg.typeUrl); function createBaseGetSwapFeeQueryMsgResponse(): GetSwapFeeQueryMsgResponse { return { swapFee: "" @@ -298,6 +324,16 @@ function createBaseGetSwapFeeQueryMsgResponse(): GetSwapFeeQueryMsgResponse { } export const GetSwapFeeQueryMsgResponse = { typeUrl: "/osmosis.cosmwasmpool.v1beta1.GetSwapFeeQueryMsgResponse", + aminoType: "osmosis/cosmwasmpool/get-swap-fee-query-msg-response", + is(o: any): o is GetSwapFeeQueryMsgResponse { + return o && (o.$typeUrl === GetSwapFeeQueryMsgResponse.typeUrl || typeof o.swapFee === "string"); + }, + isSDK(o: any): o is GetSwapFeeQueryMsgResponseSDKType { + return o && (o.$typeUrl === GetSwapFeeQueryMsgResponse.typeUrl || typeof o.swap_fee === "string"); + }, + isAmino(o: any): o is GetSwapFeeQueryMsgResponseAmino { + return o && (o.$typeUrl === GetSwapFeeQueryMsgResponse.typeUrl || typeof o.swap_fee === "string"); + }, encode(message: GetSwapFeeQueryMsgResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.swapFee !== "") { writer.uint32(26).string(Decimal.fromUserInput(message.swapFee, 18).atomics); @@ -321,15 +357,27 @@ export const GetSwapFeeQueryMsgResponse = { } return message; }, + fromJSON(object: any): GetSwapFeeQueryMsgResponse { + return { + swapFee: isSet(object.swapFee) ? String(object.swapFee) : "" + }; + }, + toJSON(message: GetSwapFeeQueryMsgResponse): unknown { + const obj: any = {}; + message.swapFee !== undefined && (obj.swapFee = message.swapFee); + return obj; + }, fromPartial(object: Partial): GetSwapFeeQueryMsgResponse { const message = createBaseGetSwapFeeQueryMsgResponse(); message.swapFee = object.swapFee ?? ""; return message; }, fromAmino(object: GetSwapFeeQueryMsgResponseAmino): GetSwapFeeQueryMsgResponse { - return { - swapFee: object.swap_fee - }; + const message = createBaseGetSwapFeeQueryMsgResponse(); + if (object.swap_fee !== undefined && object.swap_fee !== null) { + message.swapFee = object.swap_fee; + } + return message; }, toAmino(message: GetSwapFeeQueryMsgResponse): GetSwapFeeQueryMsgResponseAmino { const obj: any = {}; @@ -358,6 +406,8 @@ export const GetSwapFeeQueryMsgResponse = { }; } }; +GlobalDecoderRegistry.register(GetSwapFeeQueryMsgResponse.typeUrl, GetSwapFeeQueryMsgResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(GetSwapFeeQueryMsgResponse.aminoType, GetSwapFeeQueryMsgResponse.typeUrl); function createBaseSpotPrice(): SpotPrice { return { quoteAssetDenom: "", @@ -366,6 +416,16 @@ function createBaseSpotPrice(): SpotPrice { } export const SpotPrice = { typeUrl: "/osmosis.cosmwasmpool.v1beta1.SpotPrice", + aminoType: "osmosis/cosmwasmpool/spot-price", + is(o: any): o is SpotPrice { + return o && (o.$typeUrl === SpotPrice.typeUrl || typeof o.quoteAssetDenom === "string" && typeof o.baseAssetDenom === "string"); + }, + isSDK(o: any): o is SpotPriceSDKType { + return o && (o.$typeUrl === SpotPrice.typeUrl || typeof o.quote_asset_denom === "string" && typeof o.base_asset_denom === "string"); + }, + isAmino(o: any): o is SpotPriceAmino { + return o && (o.$typeUrl === SpotPrice.typeUrl || typeof o.quote_asset_denom === "string" && typeof o.base_asset_denom === "string"); + }, encode(message: SpotPrice, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.quoteAssetDenom !== "") { writer.uint32(10).string(message.quoteAssetDenom); @@ -395,6 +455,18 @@ export const SpotPrice = { } return message; }, + fromJSON(object: any): SpotPrice { + return { + quoteAssetDenom: isSet(object.quoteAssetDenom) ? String(object.quoteAssetDenom) : "", + baseAssetDenom: isSet(object.baseAssetDenom) ? String(object.baseAssetDenom) : "" + }; + }, + toJSON(message: SpotPrice): unknown { + const obj: any = {}; + message.quoteAssetDenom !== undefined && (obj.quoteAssetDenom = message.quoteAssetDenom); + message.baseAssetDenom !== undefined && (obj.baseAssetDenom = message.baseAssetDenom); + return obj; + }, fromPartial(object: Partial): SpotPrice { const message = createBaseSpotPrice(); message.quoteAssetDenom = object.quoteAssetDenom ?? ""; @@ -402,10 +474,14 @@ export const SpotPrice = { return message; }, fromAmino(object: SpotPriceAmino): SpotPrice { - return { - quoteAssetDenom: object.quote_asset_denom, - baseAssetDenom: object.base_asset_denom - }; + const message = createBaseSpotPrice(); + if (object.quote_asset_denom !== undefined && object.quote_asset_denom !== null) { + message.quoteAssetDenom = object.quote_asset_denom; + } + if (object.base_asset_denom !== undefined && object.base_asset_denom !== null) { + message.baseAssetDenom = object.base_asset_denom; + } + return message; }, toAmino(message: SpotPrice): SpotPriceAmino { const obj: any = {}; @@ -435,6 +511,8 @@ export const SpotPrice = { }; } }; +GlobalDecoderRegistry.register(SpotPrice.typeUrl, SpotPrice); +GlobalDecoderRegistry.registerAminoProtoMapping(SpotPrice.aminoType, SpotPrice.typeUrl); function createBaseSpotPriceQueryMsg(): SpotPriceQueryMsg { return { spotPrice: SpotPrice.fromPartial({}) @@ -442,6 +520,16 @@ function createBaseSpotPriceQueryMsg(): SpotPriceQueryMsg { } export const SpotPriceQueryMsg = { typeUrl: "/osmosis.cosmwasmpool.v1beta1.SpotPriceQueryMsg", + aminoType: "osmosis/cosmwasmpool/spot-price-query-msg", + is(o: any): o is SpotPriceQueryMsg { + return o && (o.$typeUrl === SpotPriceQueryMsg.typeUrl || SpotPrice.is(o.spotPrice)); + }, + isSDK(o: any): o is SpotPriceQueryMsgSDKType { + return o && (o.$typeUrl === SpotPriceQueryMsg.typeUrl || SpotPrice.isSDK(o.spot_price)); + }, + isAmino(o: any): o is SpotPriceQueryMsgAmino { + return o && (o.$typeUrl === SpotPriceQueryMsg.typeUrl || SpotPrice.isAmino(o.spot_price)); + }, encode(message: SpotPriceQueryMsg, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.spotPrice !== undefined) { SpotPrice.encode(message.spotPrice, writer.uint32(10).fork()).ldelim(); @@ -465,15 +553,27 @@ export const SpotPriceQueryMsg = { } return message; }, + fromJSON(object: any): SpotPriceQueryMsg { + return { + spotPrice: isSet(object.spotPrice) ? SpotPrice.fromJSON(object.spotPrice) : undefined + }; + }, + toJSON(message: SpotPriceQueryMsg): unknown { + const obj: any = {}; + message.spotPrice !== undefined && (obj.spotPrice = message.spotPrice ? SpotPrice.toJSON(message.spotPrice) : undefined); + return obj; + }, fromPartial(object: Partial): SpotPriceQueryMsg { const message = createBaseSpotPriceQueryMsg(); message.spotPrice = object.spotPrice !== undefined && object.spotPrice !== null ? SpotPrice.fromPartial(object.spotPrice) : undefined; return message; }, fromAmino(object: SpotPriceQueryMsgAmino): SpotPriceQueryMsg { - return { - spotPrice: object?.spot_price ? SpotPrice.fromAmino(object.spot_price) : undefined - }; + const message = createBaseSpotPriceQueryMsg(); + if (object.spot_price !== undefined && object.spot_price !== null) { + message.spotPrice = SpotPrice.fromAmino(object.spot_price); + } + return message; }, toAmino(message: SpotPriceQueryMsg): SpotPriceQueryMsgAmino { const obj: any = {}; @@ -502,6 +602,8 @@ export const SpotPriceQueryMsg = { }; } }; +GlobalDecoderRegistry.register(SpotPriceQueryMsg.typeUrl, SpotPriceQueryMsg); +GlobalDecoderRegistry.registerAminoProtoMapping(SpotPriceQueryMsg.aminoType, SpotPriceQueryMsg.typeUrl); function createBaseSpotPriceQueryMsgResponse(): SpotPriceQueryMsgResponse { return { spotPrice: "" @@ -509,6 +611,16 @@ function createBaseSpotPriceQueryMsgResponse(): SpotPriceQueryMsgResponse { } export const SpotPriceQueryMsgResponse = { typeUrl: "/osmosis.cosmwasmpool.v1beta1.SpotPriceQueryMsgResponse", + aminoType: "osmosis/cosmwasmpool/spot-price-query-msg-response", + is(o: any): o is SpotPriceQueryMsgResponse { + return o && (o.$typeUrl === SpotPriceQueryMsgResponse.typeUrl || typeof o.spotPrice === "string"); + }, + isSDK(o: any): o is SpotPriceQueryMsgResponseSDKType { + return o && (o.$typeUrl === SpotPriceQueryMsgResponse.typeUrl || typeof o.spot_price === "string"); + }, + isAmino(o: any): o is SpotPriceQueryMsgResponseAmino { + return o && (o.$typeUrl === SpotPriceQueryMsgResponse.typeUrl || typeof o.spot_price === "string"); + }, encode(message: SpotPriceQueryMsgResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.spotPrice !== "") { writer.uint32(10).string(message.spotPrice); @@ -532,15 +644,27 @@ export const SpotPriceQueryMsgResponse = { } return message; }, + fromJSON(object: any): SpotPriceQueryMsgResponse { + return { + spotPrice: isSet(object.spotPrice) ? String(object.spotPrice) : "" + }; + }, + toJSON(message: SpotPriceQueryMsgResponse): unknown { + const obj: any = {}; + message.spotPrice !== undefined && (obj.spotPrice = message.spotPrice); + return obj; + }, fromPartial(object: Partial): SpotPriceQueryMsgResponse { const message = createBaseSpotPriceQueryMsgResponse(); message.spotPrice = object.spotPrice ?? ""; return message; }, fromAmino(object: SpotPriceQueryMsgResponseAmino): SpotPriceQueryMsgResponse { - return { - spotPrice: object.spot_price - }; + const message = createBaseSpotPriceQueryMsgResponse(); + if (object.spot_price !== undefined && object.spot_price !== null) { + message.spotPrice = object.spot_price; + } + return message; }, toAmino(message: SpotPriceQueryMsgResponse): SpotPriceQueryMsgResponseAmino { const obj: any = {}; @@ -569,11 +693,23 @@ export const SpotPriceQueryMsgResponse = { }; } }; +GlobalDecoderRegistry.register(SpotPriceQueryMsgResponse.typeUrl, SpotPriceQueryMsgResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(SpotPriceQueryMsgResponse.aminoType, SpotPriceQueryMsgResponse.typeUrl); function createBaseEmptyStruct(): EmptyStruct { return {}; } export const EmptyStruct = { typeUrl: "/osmosis.cosmwasmpool.v1beta1.EmptyStruct", + aminoType: "osmosis/cosmwasmpool/empty-struct", + is(o: any): o is EmptyStruct { + return o && o.$typeUrl === EmptyStruct.typeUrl; + }, + isSDK(o: any): o is EmptyStructSDKType { + return o && o.$typeUrl === EmptyStruct.typeUrl; + }, + isAmino(o: any): o is EmptyStructAmino { + return o && o.$typeUrl === EmptyStruct.typeUrl; + }, encode(_: EmptyStruct, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, @@ -591,12 +727,20 @@ export const EmptyStruct = { } return message; }, + fromJSON(_: any): EmptyStruct { + return {}; + }, + toJSON(_: EmptyStruct): unknown { + const obj: any = {}; + return obj; + }, fromPartial(_: Partial): EmptyStruct { const message = createBaseEmptyStruct(); return message; }, fromAmino(_: EmptyStructAmino): EmptyStruct { - return {}; + const message = createBaseEmptyStruct(); + return message; }, toAmino(_: EmptyStruct): EmptyStructAmino { const obj: any = {}; @@ -624,6 +768,8 @@ export const EmptyStruct = { }; } }; +GlobalDecoderRegistry.register(EmptyStruct.typeUrl, EmptyStruct); +GlobalDecoderRegistry.registerAminoProtoMapping(EmptyStruct.aminoType, EmptyStruct.typeUrl); function createBaseGetTotalPoolLiquidityQueryMsg(): GetTotalPoolLiquidityQueryMsg { return { getTotalPoolLiquidity: EmptyStruct.fromPartial({}) @@ -631,6 +777,16 @@ function createBaseGetTotalPoolLiquidityQueryMsg(): GetTotalPoolLiquidityQueryMs } export const GetTotalPoolLiquidityQueryMsg = { typeUrl: "/osmosis.cosmwasmpool.v1beta1.GetTotalPoolLiquidityQueryMsg", + aminoType: "osmosis/cosmwasmpool/get-total-pool-liquidity-query-msg", + is(o: any): o is GetTotalPoolLiquidityQueryMsg { + return o && (o.$typeUrl === GetTotalPoolLiquidityQueryMsg.typeUrl || EmptyStruct.is(o.getTotalPoolLiquidity)); + }, + isSDK(o: any): o is GetTotalPoolLiquidityQueryMsgSDKType { + return o && (o.$typeUrl === GetTotalPoolLiquidityQueryMsg.typeUrl || EmptyStruct.isSDK(o.get_total_pool_liquidity)); + }, + isAmino(o: any): o is GetTotalPoolLiquidityQueryMsgAmino { + return o && (o.$typeUrl === GetTotalPoolLiquidityQueryMsg.typeUrl || EmptyStruct.isAmino(o.get_total_pool_liquidity)); + }, encode(message: GetTotalPoolLiquidityQueryMsg, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.getTotalPoolLiquidity !== undefined) { EmptyStruct.encode(message.getTotalPoolLiquidity, writer.uint32(10).fork()).ldelim(); @@ -654,15 +810,27 @@ export const GetTotalPoolLiquidityQueryMsg = { } return message; }, + fromJSON(object: any): GetTotalPoolLiquidityQueryMsg { + return { + getTotalPoolLiquidity: isSet(object.getTotalPoolLiquidity) ? EmptyStruct.fromJSON(object.getTotalPoolLiquidity) : undefined + }; + }, + toJSON(message: GetTotalPoolLiquidityQueryMsg): unknown { + const obj: any = {}; + message.getTotalPoolLiquidity !== undefined && (obj.getTotalPoolLiquidity = message.getTotalPoolLiquidity ? EmptyStruct.toJSON(message.getTotalPoolLiquidity) : undefined); + return obj; + }, fromPartial(object: Partial): GetTotalPoolLiquidityQueryMsg { const message = createBaseGetTotalPoolLiquidityQueryMsg(); message.getTotalPoolLiquidity = object.getTotalPoolLiquidity !== undefined && object.getTotalPoolLiquidity !== null ? EmptyStruct.fromPartial(object.getTotalPoolLiquidity) : undefined; return message; }, fromAmino(object: GetTotalPoolLiquidityQueryMsgAmino): GetTotalPoolLiquidityQueryMsg { - return { - getTotalPoolLiquidity: object?.get_total_pool_liquidity ? EmptyStruct.fromAmino(object.get_total_pool_liquidity) : undefined - }; + const message = createBaseGetTotalPoolLiquidityQueryMsg(); + if (object.get_total_pool_liquidity !== undefined && object.get_total_pool_liquidity !== null) { + message.getTotalPoolLiquidity = EmptyStruct.fromAmino(object.get_total_pool_liquidity); + } + return message; }, toAmino(message: GetTotalPoolLiquidityQueryMsg): GetTotalPoolLiquidityQueryMsgAmino { const obj: any = {}; @@ -691,6 +859,8 @@ export const GetTotalPoolLiquidityQueryMsg = { }; } }; +GlobalDecoderRegistry.register(GetTotalPoolLiquidityQueryMsg.typeUrl, GetTotalPoolLiquidityQueryMsg); +GlobalDecoderRegistry.registerAminoProtoMapping(GetTotalPoolLiquidityQueryMsg.aminoType, GetTotalPoolLiquidityQueryMsg.typeUrl); function createBaseGetTotalPoolLiquidityQueryMsgResponse(): GetTotalPoolLiquidityQueryMsgResponse { return { totalPoolLiquidity: [] @@ -698,6 +868,16 @@ function createBaseGetTotalPoolLiquidityQueryMsgResponse(): GetTotalPoolLiquidit } export const GetTotalPoolLiquidityQueryMsgResponse = { typeUrl: "/osmosis.cosmwasmpool.v1beta1.GetTotalPoolLiquidityQueryMsgResponse", + aminoType: "osmosis/cosmwasmpool/get-total-pool-liquidity-query-msg-response", + is(o: any): o is GetTotalPoolLiquidityQueryMsgResponse { + return o && (o.$typeUrl === GetTotalPoolLiquidityQueryMsgResponse.typeUrl || Array.isArray(o.totalPoolLiquidity) && (!o.totalPoolLiquidity.length || Coin.is(o.totalPoolLiquidity[0]))); + }, + isSDK(o: any): o is GetTotalPoolLiquidityQueryMsgResponseSDKType { + return o && (o.$typeUrl === GetTotalPoolLiquidityQueryMsgResponse.typeUrl || Array.isArray(o.total_pool_liquidity) && (!o.total_pool_liquidity.length || Coin.isSDK(o.total_pool_liquidity[0]))); + }, + isAmino(o: any): o is GetTotalPoolLiquidityQueryMsgResponseAmino { + return o && (o.$typeUrl === GetTotalPoolLiquidityQueryMsgResponse.typeUrl || Array.isArray(o.total_pool_liquidity) && (!o.total_pool_liquidity.length || Coin.isAmino(o.total_pool_liquidity[0]))); + }, encode(message: GetTotalPoolLiquidityQueryMsgResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.totalPoolLiquidity) { Coin.encode(v!, writer.uint32(10).fork()).ldelim(); @@ -721,15 +901,29 @@ export const GetTotalPoolLiquidityQueryMsgResponse = { } return message; }, + fromJSON(object: any): GetTotalPoolLiquidityQueryMsgResponse { + return { + totalPoolLiquidity: Array.isArray(object?.totalPoolLiquidity) ? object.totalPoolLiquidity.map((e: any) => Coin.fromJSON(e)) : [] + }; + }, + toJSON(message: GetTotalPoolLiquidityQueryMsgResponse): unknown { + const obj: any = {}; + if (message.totalPoolLiquidity) { + obj.totalPoolLiquidity = message.totalPoolLiquidity.map(e => e ? Coin.toJSON(e) : undefined); + } else { + obj.totalPoolLiquidity = []; + } + return obj; + }, fromPartial(object: Partial): GetTotalPoolLiquidityQueryMsgResponse { const message = createBaseGetTotalPoolLiquidityQueryMsgResponse(); message.totalPoolLiquidity = object.totalPoolLiquidity?.map(e => Coin.fromPartial(e)) || []; return message; }, fromAmino(object: GetTotalPoolLiquidityQueryMsgResponseAmino): GetTotalPoolLiquidityQueryMsgResponse { - return { - totalPoolLiquidity: Array.isArray(object?.total_pool_liquidity) ? object.total_pool_liquidity.map((e: any) => Coin.fromAmino(e)) : [] - }; + const message = createBaseGetTotalPoolLiquidityQueryMsgResponse(); + message.totalPoolLiquidity = object.total_pool_liquidity?.map(e => Coin.fromAmino(e)) || []; + return message; }, toAmino(message: GetTotalPoolLiquidityQueryMsgResponse): GetTotalPoolLiquidityQueryMsgResponseAmino { const obj: any = {}; @@ -762,6 +956,8 @@ export const GetTotalPoolLiquidityQueryMsgResponse = { }; } }; +GlobalDecoderRegistry.register(GetTotalPoolLiquidityQueryMsgResponse.typeUrl, GetTotalPoolLiquidityQueryMsgResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(GetTotalPoolLiquidityQueryMsgResponse.aminoType, GetTotalPoolLiquidityQueryMsgResponse.typeUrl); function createBaseGetTotalSharesQueryMsg(): GetTotalSharesQueryMsg { return { getTotalShares: EmptyStruct.fromPartial({}) @@ -769,6 +965,16 @@ function createBaseGetTotalSharesQueryMsg(): GetTotalSharesQueryMsg { } export const GetTotalSharesQueryMsg = { typeUrl: "/osmosis.cosmwasmpool.v1beta1.GetTotalSharesQueryMsg", + aminoType: "osmosis/cosmwasmpool/get-total-shares-query-msg", + is(o: any): o is GetTotalSharesQueryMsg { + return o && (o.$typeUrl === GetTotalSharesQueryMsg.typeUrl || EmptyStruct.is(o.getTotalShares)); + }, + isSDK(o: any): o is GetTotalSharesQueryMsgSDKType { + return o && (o.$typeUrl === GetTotalSharesQueryMsg.typeUrl || EmptyStruct.isSDK(o.get_total_shares)); + }, + isAmino(o: any): o is GetTotalSharesQueryMsgAmino { + return o && (o.$typeUrl === GetTotalSharesQueryMsg.typeUrl || EmptyStruct.isAmino(o.get_total_shares)); + }, encode(message: GetTotalSharesQueryMsg, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.getTotalShares !== undefined) { EmptyStruct.encode(message.getTotalShares, writer.uint32(10).fork()).ldelim(); @@ -792,15 +998,27 @@ export const GetTotalSharesQueryMsg = { } return message; }, + fromJSON(object: any): GetTotalSharesQueryMsg { + return { + getTotalShares: isSet(object.getTotalShares) ? EmptyStruct.fromJSON(object.getTotalShares) : undefined + }; + }, + toJSON(message: GetTotalSharesQueryMsg): unknown { + const obj: any = {}; + message.getTotalShares !== undefined && (obj.getTotalShares = message.getTotalShares ? EmptyStruct.toJSON(message.getTotalShares) : undefined); + return obj; + }, fromPartial(object: Partial): GetTotalSharesQueryMsg { const message = createBaseGetTotalSharesQueryMsg(); message.getTotalShares = object.getTotalShares !== undefined && object.getTotalShares !== null ? EmptyStruct.fromPartial(object.getTotalShares) : undefined; return message; }, fromAmino(object: GetTotalSharesQueryMsgAmino): GetTotalSharesQueryMsg { - return { - getTotalShares: object?.get_total_shares ? EmptyStruct.fromAmino(object.get_total_shares) : undefined - }; + const message = createBaseGetTotalSharesQueryMsg(); + if (object.get_total_shares !== undefined && object.get_total_shares !== null) { + message.getTotalShares = EmptyStruct.fromAmino(object.get_total_shares); + } + return message; }, toAmino(message: GetTotalSharesQueryMsg): GetTotalSharesQueryMsgAmino { const obj: any = {}; @@ -829,6 +1047,8 @@ export const GetTotalSharesQueryMsg = { }; } }; +GlobalDecoderRegistry.register(GetTotalSharesQueryMsg.typeUrl, GetTotalSharesQueryMsg); +GlobalDecoderRegistry.registerAminoProtoMapping(GetTotalSharesQueryMsg.aminoType, GetTotalSharesQueryMsg.typeUrl); function createBaseGetTotalSharesQueryMsgResponse(): GetTotalSharesQueryMsgResponse { return { totalShares: "" @@ -836,6 +1056,16 @@ function createBaseGetTotalSharesQueryMsgResponse(): GetTotalSharesQueryMsgRespo } export const GetTotalSharesQueryMsgResponse = { typeUrl: "/osmosis.cosmwasmpool.v1beta1.GetTotalSharesQueryMsgResponse", + aminoType: "osmosis/cosmwasmpool/get-total-shares-query-msg-response", + is(o: any): o is GetTotalSharesQueryMsgResponse { + return o && (o.$typeUrl === GetTotalSharesQueryMsgResponse.typeUrl || typeof o.totalShares === "string"); + }, + isSDK(o: any): o is GetTotalSharesQueryMsgResponseSDKType { + return o && (o.$typeUrl === GetTotalSharesQueryMsgResponse.typeUrl || typeof o.total_shares === "string"); + }, + isAmino(o: any): o is GetTotalSharesQueryMsgResponseAmino { + return o && (o.$typeUrl === GetTotalSharesQueryMsgResponse.typeUrl || typeof o.total_shares === "string"); + }, encode(message: GetTotalSharesQueryMsgResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.totalShares !== "") { writer.uint32(10).string(message.totalShares); @@ -859,15 +1089,27 @@ export const GetTotalSharesQueryMsgResponse = { } return message; }, + fromJSON(object: any): GetTotalSharesQueryMsgResponse { + return { + totalShares: isSet(object.totalShares) ? String(object.totalShares) : "" + }; + }, + toJSON(message: GetTotalSharesQueryMsgResponse): unknown { + const obj: any = {}; + message.totalShares !== undefined && (obj.totalShares = message.totalShares); + return obj; + }, fromPartial(object: Partial): GetTotalSharesQueryMsgResponse { const message = createBaseGetTotalSharesQueryMsgResponse(); message.totalShares = object.totalShares ?? ""; return message; }, fromAmino(object: GetTotalSharesQueryMsgResponseAmino): GetTotalSharesQueryMsgResponse { - return { - totalShares: object.total_shares - }; + const message = createBaseGetTotalSharesQueryMsgResponse(); + if (object.total_shares !== undefined && object.total_shares !== null) { + message.totalShares = object.total_shares; + } + return message; }, toAmino(message: GetTotalSharesQueryMsgResponse): GetTotalSharesQueryMsgResponseAmino { const obj: any = {}; @@ -895,4 +1137,6 @@ export const GetTotalSharesQueryMsgResponse = { value: GetTotalSharesQueryMsgResponse.encode(message).finish() }; } -}; \ No newline at end of file +}; +GlobalDecoderRegistry.register(GetTotalSharesQueryMsgResponse.typeUrl, GetTotalSharesQueryMsgResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(GetTotalSharesQueryMsgResponse.aminoType, GetTotalSharesQueryMsgResponse.typeUrl); \ No newline at end of file diff --git a/packages/osmojs/src/codegen/osmosis/cosmwasmpool/v1beta1/model/transmuter_msgs.ts b/packages/osmojs/src/codegen/osmosis/cosmwasmpool/v1beta1/model/transmuter_msgs.ts index 11c03681b..ec8d7b244 100644 --- a/packages/osmojs/src/codegen/osmosis/cosmwasmpool/v1beta1/model/transmuter_msgs.ts +++ b/packages/osmojs/src/codegen/osmosis/cosmwasmpool/v1beta1/model/transmuter_msgs.ts @@ -1,4 +1,6 @@ import { BinaryReader, BinaryWriter } from "../../../../binary"; +import { GlobalDecoderRegistry } from "../../../../registry"; +import { isSet } from "../../../../helpers"; /** ===================== JoinPoolExecuteMsg */ export interface EmptyRequest {} export interface EmptyRequestProtoMsg { @@ -93,6 +95,16 @@ function createBaseEmptyRequest(): EmptyRequest { } export const EmptyRequest = { typeUrl: "/osmosis.cosmwasmpool.v1beta1.EmptyRequest", + aminoType: "osmosis/cosmwasmpool/empty-request", + is(o: any): o is EmptyRequest { + return o && o.$typeUrl === EmptyRequest.typeUrl; + }, + isSDK(o: any): o is EmptyRequestSDKType { + return o && o.$typeUrl === EmptyRequest.typeUrl; + }, + isAmino(o: any): o is EmptyRequestAmino { + return o && o.$typeUrl === EmptyRequest.typeUrl; + }, encode(_: EmptyRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, @@ -110,12 +122,20 @@ export const EmptyRequest = { } return message; }, + fromJSON(_: any): EmptyRequest { + return {}; + }, + toJSON(_: EmptyRequest): unknown { + const obj: any = {}; + return obj; + }, fromPartial(_: Partial): EmptyRequest { const message = createBaseEmptyRequest(); return message; }, fromAmino(_: EmptyRequestAmino): EmptyRequest { - return {}; + const message = createBaseEmptyRequest(); + return message; }, toAmino(_: EmptyRequest): EmptyRequestAmino { const obj: any = {}; @@ -143,6 +163,8 @@ export const EmptyRequest = { }; } }; +GlobalDecoderRegistry.register(EmptyRequest.typeUrl, EmptyRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(EmptyRequest.aminoType, EmptyRequest.typeUrl); function createBaseJoinPoolExecuteMsgRequest(): JoinPoolExecuteMsgRequest { return { joinPool: EmptyRequest.fromPartial({}) @@ -150,6 +172,16 @@ function createBaseJoinPoolExecuteMsgRequest(): JoinPoolExecuteMsgRequest { } export const JoinPoolExecuteMsgRequest = { typeUrl: "/osmosis.cosmwasmpool.v1beta1.JoinPoolExecuteMsgRequest", + aminoType: "osmosis/cosmwasmpool/join-pool-execute-msg-request", + is(o: any): o is JoinPoolExecuteMsgRequest { + return o && (o.$typeUrl === JoinPoolExecuteMsgRequest.typeUrl || EmptyRequest.is(o.joinPool)); + }, + isSDK(o: any): o is JoinPoolExecuteMsgRequestSDKType { + return o && (o.$typeUrl === JoinPoolExecuteMsgRequest.typeUrl || EmptyRequest.isSDK(o.join_pool)); + }, + isAmino(o: any): o is JoinPoolExecuteMsgRequestAmino { + return o && (o.$typeUrl === JoinPoolExecuteMsgRequest.typeUrl || EmptyRequest.isAmino(o.join_pool)); + }, encode(message: JoinPoolExecuteMsgRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.joinPool !== undefined) { EmptyRequest.encode(message.joinPool, writer.uint32(10).fork()).ldelim(); @@ -173,15 +205,27 @@ export const JoinPoolExecuteMsgRequest = { } return message; }, + fromJSON(object: any): JoinPoolExecuteMsgRequest { + return { + joinPool: isSet(object.joinPool) ? EmptyRequest.fromJSON(object.joinPool) : undefined + }; + }, + toJSON(message: JoinPoolExecuteMsgRequest): unknown { + const obj: any = {}; + message.joinPool !== undefined && (obj.joinPool = message.joinPool ? EmptyRequest.toJSON(message.joinPool) : undefined); + return obj; + }, fromPartial(object: Partial): JoinPoolExecuteMsgRequest { const message = createBaseJoinPoolExecuteMsgRequest(); message.joinPool = object.joinPool !== undefined && object.joinPool !== null ? EmptyRequest.fromPartial(object.joinPool) : undefined; return message; }, fromAmino(object: JoinPoolExecuteMsgRequestAmino): JoinPoolExecuteMsgRequest { - return { - joinPool: object?.join_pool ? EmptyRequest.fromAmino(object.join_pool) : undefined - }; + const message = createBaseJoinPoolExecuteMsgRequest(); + if (object.join_pool !== undefined && object.join_pool !== null) { + message.joinPool = EmptyRequest.fromAmino(object.join_pool); + } + return message; }, toAmino(message: JoinPoolExecuteMsgRequest): JoinPoolExecuteMsgRequestAmino { const obj: any = {}; @@ -210,11 +254,23 @@ export const JoinPoolExecuteMsgRequest = { }; } }; +GlobalDecoderRegistry.register(JoinPoolExecuteMsgRequest.typeUrl, JoinPoolExecuteMsgRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(JoinPoolExecuteMsgRequest.aminoType, JoinPoolExecuteMsgRequest.typeUrl); function createBaseJoinPoolExecuteMsgResponse(): JoinPoolExecuteMsgResponse { return {}; } export const JoinPoolExecuteMsgResponse = { typeUrl: "/osmosis.cosmwasmpool.v1beta1.JoinPoolExecuteMsgResponse", + aminoType: "osmosis/cosmwasmpool/join-pool-execute-msg-response", + is(o: any): o is JoinPoolExecuteMsgResponse { + return o && o.$typeUrl === JoinPoolExecuteMsgResponse.typeUrl; + }, + isSDK(o: any): o is JoinPoolExecuteMsgResponseSDKType { + return o && o.$typeUrl === JoinPoolExecuteMsgResponse.typeUrl; + }, + isAmino(o: any): o is JoinPoolExecuteMsgResponseAmino { + return o && o.$typeUrl === JoinPoolExecuteMsgResponse.typeUrl; + }, encode(_: JoinPoolExecuteMsgResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, @@ -232,12 +288,20 @@ export const JoinPoolExecuteMsgResponse = { } return message; }, + fromJSON(_: any): JoinPoolExecuteMsgResponse { + return {}; + }, + toJSON(_: JoinPoolExecuteMsgResponse): unknown { + const obj: any = {}; + return obj; + }, fromPartial(_: Partial): JoinPoolExecuteMsgResponse { const message = createBaseJoinPoolExecuteMsgResponse(); return message; }, fromAmino(_: JoinPoolExecuteMsgResponseAmino): JoinPoolExecuteMsgResponse { - return {}; + const message = createBaseJoinPoolExecuteMsgResponse(); + return message; }, toAmino(_: JoinPoolExecuteMsgResponse): JoinPoolExecuteMsgResponseAmino { const obj: any = {}; @@ -265,6 +329,8 @@ export const JoinPoolExecuteMsgResponse = { }; } }; +GlobalDecoderRegistry.register(JoinPoolExecuteMsgResponse.typeUrl, JoinPoolExecuteMsgResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(JoinPoolExecuteMsgResponse.aminoType, JoinPoolExecuteMsgResponse.typeUrl); function createBaseExitPoolExecuteMsgRequest(): ExitPoolExecuteMsgRequest { return { exitPool: EmptyRequest.fromPartial({}) @@ -272,6 +338,16 @@ function createBaseExitPoolExecuteMsgRequest(): ExitPoolExecuteMsgRequest { } export const ExitPoolExecuteMsgRequest = { typeUrl: "/osmosis.cosmwasmpool.v1beta1.ExitPoolExecuteMsgRequest", + aminoType: "osmosis/cosmwasmpool/exit-pool-execute-msg-request", + is(o: any): o is ExitPoolExecuteMsgRequest { + return o && (o.$typeUrl === ExitPoolExecuteMsgRequest.typeUrl || EmptyRequest.is(o.exitPool)); + }, + isSDK(o: any): o is ExitPoolExecuteMsgRequestSDKType { + return o && (o.$typeUrl === ExitPoolExecuteMsgRequest.typeUrl || EmptyRequest.isSDK(o.exit_pool)); + }, + isAmino(o: any): o is ExitPoolExecuteMsgRequestAmino { + return o && (o.$typeUrl === ExitPoolExecuteMsgRequest.typeUrl || EmptyRequest.isAmino(o.exit_pool)); + }, encode(message: ExitPoolExecuteMsgRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.exitPool !== undefined) { EmptyRequest.encode(message.exitPool, writer.uint32(10).fork()).ldelim(); @@ -295,15 +371,27 @@ export const ExitPoolExecuteMsgRequest = { } return message; }, + fromJSON(object: any): ExitPoolExecuteMsgRequest { + return { + exitPool: isSet(object.exitPool) ? EmptyRequest.fromJSON(object.exitPool) : undefined + }; + }, + toJSON(message: ExitPoolExecuteMsgRequest): unknown { + const obj: any = {}; + message.exitPool !== undefined && (obj.exitPool = message.exitPool ? EmptyRequest.toJSON(message.exitPool) : undefined); + return obj; + }, fromPartial(object: Partial): ExitPoolExecuteMsgRequest { const message = createBaseExitPoolExecuteMsgRequest(); message.exitPool = object.exitPool !== undefined && object.exitPool !== null ? EmptyRequest.fromPartial(object.exitPool) : undefined; return message; }, fromAmino(object: ExitPoolExecuteMsgRequestAmino): ExitPoolExecuteMsgRequest { - return { - exitPool: object?.exit_pool ? EmptyRequest.fromAmino(object.exit_pool) : undefined - }; + const message = createBaseExitPoolExecuteMsgRequest(); + if (object.exit_pool !== undefined && object.exit_pool !== null) { + message.exitPool = EmptyRequest.fromAmino(object.exit_pool); + } + return message; }, toAmino(message: ExitPoolExecuteMsgRequest): ExitPoolExecuteMsgRequestAmino { const obj: any = {}; @@ -332,11 +420,23 @@ export const ExitPoolExecuteMsgRequest = { }; } }; +GlobalDecoderRegistry.register(ExitPoolExecuteMsgRequest.typeUrl, ExitPoolExecuteMsgRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(ExitPoolExecuteMsgRequest.aminoType, ExitPoolExecuteMsgRequest.typeUrl); function createBaseExitPoolExecuteMsgResponse(): ExitPoolExecuteMsgResponse { return {}; } export const ExitPoolExecuteMsgResponse = { typeUrl: "/osmosis.cosmwasmpool.v1beta1.ExitPoolExecuteMsgResponse", + aminoType: "osmosis/cosmwasmpool/exit-pool-execute-msg-response", + is(o: any): o is ExitPoolExecuteMsgResponse { + return o && o.$typeUrl === ExitPoolExecuteMsgResponse.typeUrl; + }, + isSDK(o: any): o is ExitPoolExecuteMsgResponseSDKType { + return o && o.$typeUrl === ExitPoolExecuteMsgResponse.typeUrl; + }, + isAmino(o: any): o is ExitPoolExecuteMsgResponseAmino { + return o && o.$typeUrl === ExitPoolExecuteMsgResponse.typeUrl; + }, encode(_: ExitPoolExecuteMsgResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, @@ -354,12 +454,20 @@ export const ExitPoolExecuteMsgResponse = { } return message; }, + fromJSON(_: any): ExitPoolExecuteMsgResponse { + return {}; + }, + toJSON(_: ExitPoolExecuteMsgResponse): unknown { + const obj: any = {}; + return obj; + }, fromPartial(_: Partial): ExitPoolExecuteMsgResponse { const message = createBaseExitPoolExecuteMsgResponse(); return message; }, fromAmino(_: ExitPoolExecuteMsgResponseAmino): ExitPoolExecuteMsgResponse { - return {}; + const message = createBaseExitPoolExecuteMsgResponse(); + return message; }, toAmino(_: ExitPoolExecuteMsgResponse): ExitPoolExecuteMsgResponseAmino { const obj: any = {}; @@ -386,4 +494,6 @@ export const ExitPoolExecuteMsgResponse = { value: ExitPoolExecuteMsgResponse.encode(message).finish() }; } -}; \ No newline at end of file +}; +GlobalDecoderRegistry.register(ExitPoolExecuteMsgResponse.typeUrl, ExitPoolExecuteMsgResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(ExitPoolExecuteMsgResponse.aminoType, ExitPoolExecuteMsgResponse.typeUrl); \ No newline at end of file diff --git a/packages/osmojs/src/codegen/osmosis/cosmwasmpool/v1beta1/model/tx.ts b/packages/osmojs/src/codegen/osmosis/cosmwasmpool/v1beta1/model/tx.ts index 7d95dd6ec..8b5f63fb1 100644 --- a/packages/osmojs/src/codegen/osmosis/cosmwasmpool/v1beta1/model/tx.ts +++ b/packages/osmojs/src/codegen/osmosis/cosmwasmpool/v1beta1/model/tx.ts @@ -1,4 +1,6 @@ import { BinaryReader, BinaryWriter } from "../../../../binary"; +import { isSet, bytesFromBase64, base64FromBytes } from "../../../../helpers"; +import { GlobalDecoderRegistry } from "../../../../registry"; /** ===================== MsgCreateCosmwasmPool */ export interface MsgCreateCosmWasmPool { codeId: bigint; @@ -11,9 +13,9 @@ export interface MsgCreateCosmWasmPoolProtoMsg { } /** ===================== MsgCreateCosmwasmPool */ export interface MsgCreateCosmWasmPoolAmino { - code_id: string; - instantiate_msg: Uint8Array; - sender: string; + code_id?: string; + instantiate_msg?: string; + sender?: string; } export interface MsgCreateCosmWasmPoolAminoMsg { type: "osmosis/cosmwasmpool/create-cosm-wasm-pool"; @@ -35,7 +37,7 @@ export interface MsgCreateCosmWasmPoolResponseProtoMsg { } /** Returns a unique poolID to identify the pool with. */ export interface MsgCreateCosmWasmPoolResponseAmino { - pool_id: string; + pool_id?: string; } export interface MsgCreateCosmWasmPoolResponseAminoMsg { type: "osmosis/cosmwasmpool/create-cosm-wasm-pool-response"; @@ -54,6 +56,16 @@ function createBaseMsgCreateCosmWasmPool(): MsgCreateCosmWasmPool { } export const MsgCreateCosmWasmPool = { typeUrl: "/osmosis.cosmwasmpool.v1beta1.MsgCreateCosmWasmPool", + aminoType: "osmosis/cosmwasmpool/create-cosm-wasm-pool", + is(o: any): o is MsgCreateCosmWasmPool { + return o && (o.$typeUrl === MsgCreateCosmWasmPool.typeUrl || typeof o.codeId === "bigint" && (o.instantiateMsg instanceof Uint8Array || typeof o.instantiateMsg === "string") && typeof o.sender === "string"); + }, + isSDK(o: any): o is MsgCreateCosmWasmPoolSDKType { + return o && (o.$typeUrl === MsgCreateCosmWasmPool.typeUrl || typeof o.code_id === "bigint" && (o.instantiate_msg instanceof Uint8Array || typeof o.instantiate_msg === "string") && typeof o.sender === "string"); + }, + isAmino(o: any): o is MsgCreateCosmWasmPoolAmino { + return o && (o.$typeUrl === MsgCreateCosmWasmPool.typeUrl || typeof o.code_id === "bigint" && (o.instantiate_msg instanceof Uint8Array || typeof o.instantiate_msg === "string") && typeof o.sender === "string"); + }, encode(message: MsgCreateCosmWasmPool, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.codeId !== BigInt(0)) { writer.uint32(8).uint64(message.codeId); @@ -89,6 +101,20 @@ export const MsgCreateCosmWasmPool = { } return message; }, + fromJSON(object: any): MsgCreateCosmWasmPool { + return { + codeId: isSet(object.codeId) ? BigInt(object.codeId.toString()) : BigInt(0), + instantiateMsg: isSet(object.instantiateMsg) ? bytesFromBase64(object.instantiateMsg) : new Uint8Array(), + sender: isSet(object.sender) ? String(object.sender) : "" + }; + }, + toJSON(message: MsgCreateCosmWasmPool): unknown { + const obj: any = {}; + message.codeId !== undefined && (obj.codeId = (message.codeId || BigInt(0)).toString()); + message.instantiateMsg !== undefined && (obj.instantiateMsg = base64FromBytes(message.instantiateMsg !== undefined ? message.instantiateMsg : new Uint8Array())); + message.sender !== undefined && (obj.sender = message.sender); + return obj; + }, fromPartial(object: Partial): MsgCreateCosmWasmPool { const message = createBaseMsgCreateCosmWasmPool(); message.codeId = object.codeId !== undefined && object.codeId !== null ? BigInt(object.codeId.toString()) : BigInt(0); @@ -97,16 +123,22 @@ export const MsgCreateCosmWasmPool = { return message; }, fromAmino(object: MsgCreateCosmWasmPoolAmino): MsgCreateCosmWasmPool { - return { - codeId: BigInt(object.code_id), - instantiateMsg: object.instantiate_msg, - sender: object.sender - }; + const message = createBaseMsgCreateCosmWasmPool(); + if (object.code_id !== undefined && object.code_id !== null) { + message.codeId = BigInt(object.code_id); + } + if (object.instantiate_msg !== undefined && object.instantiate_msg !== null) { + message.instantiateMsg = bytesFromBase64(object.instantiate_msg); + } + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + return message; }, toAmino(message: MsgCreateCosmWasmPool): MsgCreateCosmWasmPoolAmino { const obj: any = {}; obj.code_id = message.codeId ? message.codeId.toString() : undefined; - obj.instantiate_msg = message.instantiateMsg; + obj.instantiate_msg = message.instantiateMsg ? base64FromBytes(message.instantiateMsg) : undefined; obj.sender = message.sender; return obj; }, @@ -132,6 +164,8 @@ export const MsgCreateCosmWasmPool = { }; } }; +GlobalDecoderRegistry.register(MsgCreateCosmWasmPool.typeUrl, MsgCreateCosmWasmPool); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgCreateCosmWasmPool.aminoType, MsgCreateCosmWasmPool.typeUrl); function createBaseMsgCreateCosmWasmPoolResponse(): MsgCreateCosmWasmPoolResponse { return { poolId: BigInt(0) @@ -139,6 +173,16 @@ function createBaseMsgCreateCosmWasmPoolResponse(): MsgCreateCosmWasmPoolRespons } export const MsgCreateCosmWasmPoolResponse = { typeUrl: "/osmosis.cosmwasmpool.v1beta1.MsgCreateCosmWasmPoolResponse", + aminoType: "osmosis/cosmwasmpool/create-cosm-wasm-pool-response", + is(o: any): o is MsgCreateCosmWasmPoolResponse { + return o && (o.$typeUrl === MsgCreateCosmWasmPoolResponse.typeUrl || typeof o.poolId === "bigint"); + }, + isSDK(o: any): o is MsgCreateCosmWasmPoolResponseSDKType { + return o && (o.$typeUrl === MsgCreateCosmWasmPoolResponse.typeUrl || typeof o.pool_id === "bigint"); + }, + isAmino(o: any): o is MsgCreateCosmWasmPoolResponseAmino { + return o && (o.$typeUrl === MsgCreateCosmWasmPoolResponse.typeUrl || typeof o.pool_id === "bigint"); + }, encode(message: MsgCreateCosmWasmPoolResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.poolId !== BigInt(0)) { writer.uint32(8).uint64(message.poolId); @@ -162,15 +206,27 @@ export const MsgCreateCosmWasmPoolResponse = { } return message; }, + fromJSON(object: any): MsgCreateCosmWasmPoolResponse { + return { + poolId: isSet(object.poolId) ? BigInt(object.poolId.toString()) : BigInt(0) + }; + }, + toJSON(message: MsgCreateCosmWasmPoolResponse): unknown { + const obj: any = {}; + message.poolId !== undefined && (obj.poolId = (message.poolId || BigInt(0)).toString()); + return obj; + }, fromPartial(object: Partial): MsgCreateCosmWasmPoolResponse { const message = createBaseMsgCreateCosmWasmPoolResponse(); message.poolId = object.poolId !== undefined && object.poolId !== null ? BigInt(object.poolId.toString()) : BigInt(0); return message; }, fromAmino(object: MsgCreateCosmWasmPoolResponseAmino): MsgCreateCosmWasmPoolResponse { - return { - poolId: BigInt(object.pool_id) - }; + const message = createBaseMsgCreateCosmWasmPoolResponse(); + if (object.pool_id !== undefined && object.pool_id !== null) { + message.poolId = BigInt(object.pool_id); + } + return message; }, toAmino(message: MsgCreateCosmWasmPoolResponse): MsgCreateCosmWasmPoolResponseAmino { const obj: any = {}; @@ -198,4 +254,6 @@ export const MsgCreateCosmWasmPoolResponse = { value: MsgCreateCosmWasmPoolResponse.encode(message).finish() }; } -}; \ No newline at end of file +}; +GlobalDecoderRegistry.register(MsgCreateCosmWasmPoolResponse.typeUrl, MsgCreateCosmWasmPoolResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgCreateCosmWasmPoolResponse.aminoType, MsgCreateCosmWasmPoolResponse.typeUrl); \ No newline at end of file diff --git a/packages/osmojs/src/codegen/osmosis/cosmwasmpool/v1beta1/params.ts b/packages/osmojs/src/codegen/osmosis/cosmwasmpool/v1beta1/params.ts index ab972baa2..61dbc2634 100644 --- a/packages/osmojs/src/codegen/osmosis/cosmwasmpool/v1beta1/params.ts +++ b/packages/osmojs/src/codegen/osmosis/cosmwasmpool/v1beta1/params.ts @@ -1,4 +1,6 @@ import { BinaryReader, BinaryWriter } from "../../../binary"; +import { isSet } from "../../../helpers"; +import { GlobalDecoderRegistry } from "../../../registry"; export interface Params { /** * code_ide_whitelist contains the list of code ids that are allowed to be @@ -22,14 +24,14 @@ export interface ParamsAmino { * code_ide_whitelist contains the list of code ids that are allowed to be * instantiated. */ - code_id_whitelist: string[]; + code_id_whitelist?: string[]; /** * pool_migration_limit is the maximum number of pools that can be migrated * at once via governance proposal. This is to have a constant bound on the * number of pools that can be migrated at once and remove the possibility * of an unlikely scenario of causing a chain halt due to a large migration. */ - pool_migration_limit: string; + pool_migration_limit?: string; } export interface ParamsAminoMsg { type: "osmosis/cosmwasmpool/params"; @@ -47,6 +49,16 @@ function createBaseParams(): Params { } export const Params = { typeUrl: "/osmosis.cosmwasmpool.v1beta1.Params", + aminoType: "osmosis/cosmwasmpool/params", + is(o: any): o is Params { + return o && (o.$typeUrl === Params.typeUrl || Array.isArray(o.codeIdWhitelist) && (!o.codeIdWhitelist.length || typeof o.codeIdWhitelist[0] === "bigint") && typeof o.poolMigrationLimit === "bigint"); + }, + isSDK(o: any): o is ParamsSDKType { + return o && (o.$typeUrl === Params.typeUrl || Array.isArray(o.code_id_whitelist) && (!o.code_id_whitelist.length || typeof o.code_id_whitelist[0] === "bigint") && typeof o.pool_migration_limit === "bigint"); + }, + isAmino(o: any): o is ParamsAmino { + return o && (o.$typeUrl === Params.typeUrl || Array.isArray(o.code_id_whitelist) && (!o.code_id_whitelist.length || typeof o.code_id_whitelist[0] === "bigint") && typeof o.pool_migration_limit === "bigint"); + }, encode(message: Params, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { writer.uint32(10).fork(); for (const v of message.codeIdWhitelist) { @@ -85,6 +97,22 @@ export const Params = { } return message; }, + fromJSON(object: any): Params { + return { + codeIdWhitelist: Array.isArray(object?.codeIdWhitelist) ? object.codeIdWhitelist.map((e: any) => BigInt(e.toString())) : [], + poolMigrationLimit: isSet(object.poolMigrationLimit) ? BigInt(object.poolMigrationLimit.toString()) : BigInt(0) + }; + }, + toJSON(message: Params): unknown { + const obj: any = {}; + if (message.codeIdWhitelist) { + obj.codeIdWhitelist = message.codeIdWhitelist.map(e => (e || BigInt(0)).toString()); + } else { + obj.codeIdWhitelist = []; + } + message.poolMigrationLimit !== undefined && (obj.poolMigrationLimit = (message.poolMigrationLimit || BigInt(0)).toString()); + return obj; + }, fromPartial(object: Partial): Params { const message = createBaseParams(); message.codeIdWhitelist = object.codeIdWhitelist?.map(e => BigInt(e.toString())) || []; @@ -92,10 +120,12 @@ export const Params = { return message; }, fromAmino(object: ParamsAmino): Params { - return { - codeIdWhitelist: Array.isArray(object?.code_id_whitelist) ? object.code_id_whitelist.map((e: any) => BigInt(e)) : [], - poolMigrationLimit: BigInt(object.pool_migration_limit) - }; + const message = createBaseParams(); + message.codeIdWhitelist = object.code_id_whitelist?.map(e => BigInt(e)) || []; + if (object.pool_migration_limit !== undefined && object.pool_migration_limit !== null) { + message.poolMigrationLimit = BigInt(object.pool_migration_limit); + } + return message; }, toAmino(message: Params): ParamsAmino { const obj: any = {}; @@ -128,4 +158,6 @@ export const Params = { value: Params.encode(message).finish() }; } -}; \ No newline at end of file +}; +GlobalDecoderRegistry.register(Params.typeUrl, Params); +GlobalDecoderRegistry.registerAminoProtoMapping(Params.aminoType, Params.typeUrl); \ No newline at end of file diff --git a/packages/osmojs/src/codegen/osmosis/cosmwasmpool/v1beta1/query.ts b/packages/osmojs/src/codegen/osmosis/cosmwasmpool/v1beta1/query.ts index b158bbae1..2a1fcaac5 100644 --- a/packages/osmojs/src/codegen/osmosis/cosmwasmpool/v1beta1/query.ts +++ b/packages/osmojs/src/codegen/osmosis/cosmwasmpool/v1beta1/query.ts @@ -1,17 +1,19 @@ import { PageRequest, PageRequestAmino, PageRequestSDKType, PageResponse, PageResponseAmino, PageResponseSDKType } from "../../../cosmos/base/query/v1beta1/pagination"; import { Params, ParamsAmino, ParamsSDKType } from "./params"; import { Any, AnyProtoMsg, AnyAmino, AnySDKType } from "../../../google/protobuf/any"; -import { Pool as Pool1 } from "../../concentrated-liquidity/pool"; -import { PoolProtoMsg as Pool1ProtoMsg } from "../../concentrated-liquidity/pool"; -import { PoolSDKType as Pool1SDKType } from "../../concentrated-liquidity/pool"; +import { Pool as Pool1 } from "../../concentratedliquidity/v1beta1/pool"; +import { PoolProtoMsg as Pool1ProtoMsg } from "../../concentratedliquidity/v1beta1/pool"; +import { PoolSDKType as Pool1SDKType } from "../../concentratedliquidity/v1beta1/pool"; import { CosmWasmPool, CosmWasmPoolProtoMsg, CosmWasmPoolSDKType } from "./model/pool"; -import { Pool as Pool2 } from "../../gamm/pool-models/balancer/balancerPool"; -import { PoolProtoMsg as Pool2ProtoMsg } from "../../gamm/pool-models/balancer/balancerPool"; -import { PoolSDKType as Pool2SDKType } from "../../gamm/pool-models/balancer/balancerPool"; -import { Pool as Pool3 } from "../../gamm/pool-models/stableswap/stableswap_pool"; -import { PoolProtoMsg as Pool3ProtoMsg } from "../../gamm/pool-models/stableswap/stableswap_pool"; -import { PoolSDKType as Pool3SDKType } from "../../gamm/pool-models/stableswap/stableswap_pool"; +import { Pool as Pool2 } from "../../gamm/poolmodels/stableswap/v1beta1/stableswap_pool"; +import { PoolProtoMsg as Pool2ProtoMsg } from "../../gamm/poolmodels/stableswap/v1beta1/stableswap_pool"; +import { PoolSDKType as Pool2SDKType } from "../../gamm/poolmodels/stableswap/v1beta1/stableswap_pool"; +import { Pool as Pool3 } from "../../gamm/v1beta1/balancerPool"; +import { PoolProtoMsg as Pool3ProtoMsg } from "../../gamm/v1beta1/balancerPool"; +import { PoolSDKType as Pool3SDKType } from "../../gamm/v1beta1/balancerPool"; import { BinaryReader, BinaryWriter } from "../../../binary"; +import { GlobalDecoderRegistry } from "../../../registry"; +import { isSet } from "../../../helpers"; /** =============================== ContractInfoByPoolId */ export interface ParamsRequest {} export interface ParamsRequestProtoMsg { @@ -46,7 +48,7 @@ export interface ParamsResponseSDKType { /** =============================== Pools */ export interface PoolsRequest { /** pagination defines an optional pagination for the request. */ - pagination: PageRequest; + pagination?: PageRequest; } export interface PoolsRequestProtoMsg { typeUrl: "/osmosis.cosmwasmpool.v1beta1.PoolsRequest"; @@ -63,12 +65,12 @@ export interface PoolsRequestAminoMsg { } /** =============================== Pools */ export interface PoolsRequestSDKType { - pagination: PageRequestSDKType; + pagination?: PageRequestSDKType; } export interface PoolsResponse { - pools: (Pool1 & CosmWasmPool & Pool2 & Pool3 & Any)[] | Any[]; + pools: (Pool1 | CosmWasmPool | Pool2 | Pool3 | Any)[] | Any[]; /** pagination defines the pagination in the response. */ - pagination: PageResponse; + pagination?: PageResponse; } export interface PoolsResponseProtoMsg { typeUrl: "/osmosis.cosmwasmpool.v1beta1.PoolsResponse"; @@ -78,7 +80,7 @@ export type PoolsResponseEncoded = Omit & { pools: (Pool1ProtoMsg | CosmWasmPoolProtoMsg | Pool2ProtoMsg | Pool3ProtoMsg | AnyProtoMsg)[]; }; export interface PoolsResponseAmino { - pools: AnyAmino[]; + pools?: AnyAmino[]; /** pagination defines the pagination in the response. */ pagination?: PageResponseAmino; } @@ -88,7 +90,7 @@ export interface PoolsResponseAminoMsg { } export interface PoolsResponseSDKType { pools: (Pool1SDKType | CosmWasmPoolSDKType | Pool2SDKType | Pool3SDKType | AnySDKType)[]; - pagination: PageResponseSDKType; + pagination?: PageResponseSDKType; } /** =============================== ContractInfoByPoolId */ export interface ContractInfoByPoolIdRequest { @@ -102,7 +104,7 @@ export interface ContractInfoByPoolIdRequestProtoMsg { /** =============================== ContractInfoByPoolId */ export interface ContractInfoByPoolIdRequestAmino { /** pool_id is the pool id of the requested pool. */ - pool_id: string; + pool_id?: string; } export interface ContractInfoByPoolIdRequestAminoMsg { type: "osmosis/cosmwasmpool/contract-info-by-pool-id-request"; @@ -130,9 +132,9 @@ export interface ContractInfoByPoolIdResponseAmino { * contract_address is the pool address and contract address * of the requested pool id. */ - contract_address: string; + contract_address?: string; /** code_id is the code id of the requested pool id. */ - code_id: string; + code_id?: string; } export interface ContractInfoByPoolIdResponseAminoMsg { type: "osmosis/cosmwasmpool/contract-info-by-pool-id-response"; @@ -147,6 +149,16 @@ function createBaseParamsRequest(): ParamsRequest { } export const ParamsRequest = { typeUrl: "/osmosis.cosmwasmpool.v1beta1.ParamsRequest", + aminoType: "osmosis/cosmwasmpool/params-request", + is(o: any): o is ParamsRequest { + return o && o.$typeUrl === ParamsRequest.typeUrl; + }, + isSDK(o: any): o is ParamsRequestSDKType { + return o && o.$typeUrl === ParamsRequest.typeUrl; + }, + isAmino(o: any): o is ParamsRequestAmino { + return o && o.$typeUrl === ParamsRequest.typeUrl; + }, encode(_: ParamsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, @@ -164,12 +176,20 @@ export const ParamsRequest = { } return message; }, + fromJSON(_: any): ParamsRequest { + return {}; + }, + toJSON(_: ParamsRequest): unknown { + const obj: any = {}; + return obj; + }, fromPartial(_: Partial): ParamsRequest { const message = createBaseParamsRequest(); return message; }, fromAmino(_: ParamsRequestAmino): ParamsRequest { - return {}; + const message = createBaseParamsRequest(); + return message; }, toAmino(_: ParamsRequest): ParamsRequestAmino { const obj: any = {}; @@ -197,6 +217,8 @@ export const ParamsRequest = { }; } }; +GlobalDecoderRegistry.register(ParamsRequest.typeUrl, ParamsRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(ParamsRequest.aminoType, ParamsRequest.typeUrl); function createBaseParamsResponse(): ParamsResponse { return { params: Params.fromPartial({}) @@ -204,6 +226,16 @@ function createBaseParamsResponse(): ParamsResponse { } export const ParamsResponse = { typeUrl: "/osmosis.cosmwasmpool.v1beta1.ParamsResponse", + aminoType: "osmosis/cosmwasmpool/params-response", + is(o: any): o is ParamsResponse { + return o && (o.$typeUrl === ParamsResponse.typeUrl || Params.is(o.params)); + }, + isSDK(o: any): o is ParamsResponseSDKType { + return o && (o.$typeUrl === ParamsResponse.typeUrl || Params.isSDK(o.params)); + }, + isAmino(o: any): o is ParamsResponseAmino { + return o && (o.$typeUrl === ParamsResponse.typeUrl || Params.isAmino(o.params)); + }, encode(message: ParamsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.params !== undefined) { Params.encode(message.params, writer.uint32(10).fork()).ldelim(); @@ -227,15 +259,27 @@ export const ParamsResponse = { } return message; }, + fromJSON(object: any): ParamsResponse { + return { + params: isSet(object.params) ? Params.fromJSON(object.params) : undefined + }; + }, + toJSON(message: ParamsResponse): unknown { + const obj: any = {}; + message.params !== undefined && (obj.params = message.params ? Params.toJSON(message.params) : undefined); + return obj; + }, fromPartial(object: Partial): ParamsResponse { const message = createBaseParamsResponse(); message.params = object.params !== undefined && object.params !== null ? Params.fromPartial(object.params) : undefined; return message; }, fromAmino(object: ParamsResponseAmino): ParamsResponse { - return { - params: object?.params ? Params.fromAmino(object.params) : undefined - }; + const message = createBaseParamsResponse(); + if (object.params !== undefined && object.params !== null) { + message.params = Params.fromAmino(object.params); + } + return message; }, toAmino(message: ParamsResponse): ParamsResponseAmino { const obj: any = {}; @@ -264,13 +308,25 @@ export const ParamsResponse = { }; } }; +GlobalDecoderRegistry.register(ParamsResponse.typeUrl, ParamsResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(ParamsResponse.aminoType, ParamsResponse.typeUrl); function createBasePoolsRequest(): PoolsRequest { return { - pagination: PageRequest.fromPartial({}) + pagination: undefined }; } export const PoolsRequest = { typeUrl: "/osmosis.cosmwasmpool.v1beta1.PoolsRequest", + aminoType: "osmosis/cosmwasmpool/pools-request", + is(o: any): o is PoolsRequest { + return o && o.$typeUrl === PoolsRequest.typeUrl; + }, + isSDK(o: any): o is PoolsRequestSDKType { + return o && o.$typeUrl === PoolsRequest.typeUrl; + }, + isAmino(o: any): o is PoolsRequestAmino { + return o && o.$typeUrl === PoolsRequest.typeUrl; + }, encode(message: PoolsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.pagination !== undefined) { PageRequest.encode(message.pagination, writer.uint32(18).fork()).ldelim(); @@ -294,15 +350,27 @@ export const PoolsRequest = { } return message; }, + fromJSON(object: any): PoolsRequest { + return { + pagination: isSet(object.pagination) ? PageRequest.fromJSON(object.pagination) : undefined + }; + }, + toJSON(message: PoolsRequest): unknown { + const obj: any = {}; + message.pagination !== undefined && (obj.pagination = message.pagination ? PageRequest.toJSON(message.pagination) : undefined); + return obj; + }, fromPartial(object: Partial): PoolsRequest { const message = createBasePoolsRequest(); message.pagination = object.pagination !== undefined && object.pagination !== null ? PageRequest.fromPartial(object.pagination) : undefined; return message; }, fromAmino(object: PoolsRequestAmino): PoolsRequest { - return { - pagination: object?.pagination ? PageRequest.fromAmino(object.pagination) : undefined - }; + const message = createBasePoolsRequest(); + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromAmino(object.pagination); + } + return message; }, toAmino(message: PoolsRequest): PoolsRequestAmino { const obj: any = {}; @@ -331,17 +399,29 @@ export const PoolsRequest = { }; } }; +GlobalDecoderRegistry.register(PoolsRequest.typeUrl, PoolsRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(PoolsRequest.aminoType, PoolsRequest.typeUrl); function createBasePoolsResponse(): PoolsResponse { return { pools: [], - pagination: PageResponse.fromPartial({}) + pagination: undefined }; } export const PoolsResponse = { typeUrl: "/osmosis.cosmwasmpool.v1beta1.PoolsResponse", + aminoType: "osmosis/cosmwasmpool/pools-response", + is(o: any): o is PoolsResponse { + return o && (o.$typeUrl === PoolsResponse.typeUrl || Array.isArray(o.pools) && (!o.pools.length || Pool1.is(o.pools[0]) || CosmWasmPool.is(o.pools[0]) || Pool2.is(o.pools[0]) || Pool3.is(o.pools[0]) || Any.is(o.pools[0]))); + }, + isSDK(o: any): o is PoolsResponseSDKType { + return o && (o.$typeUrl === PoolsResponse.typeUrl || Array.isArray(o.pools) && (!o.pools.length || Pool1.isSDK(o.pools[0]) || CosmWasmPool.isSDK(o.pools[0]) || Pool2.isSDK(o.pools[0]) || Pool3.isSDK(o.pools[0]) || Any.isSDK(o.pools[0]))); + }, + isAmino(o: any): o is PoolsResponseAmino { + return o && (o.$typeUrl === PoolsResponse.typeUrl || Array.isArray(o.pools) && (!o.pools.length || Pool1.isAmino(o.pools[0]) || CosmWasmPool.isAmino(o.pools[0]) || Pool2.isAmino(o.pools[0]) || Pool3.isAmino(o.pools[0]) || Any.isAmino(o.pools[0]))); + }, encode(message: PoolsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.pools) { - Any.encode((v! as Any), writer.uint32(10).fork()).ldelim(); + Any.encode(GlobalDecoderRegistry.wrapAny(v!), writer.uint32(10).fork()).ldelim(); } if (message.pagination !== undefined) { PageResponse.encode(message.pagination, writer.uint32(18).fork()).ldelim(); @@ -356,7 +436,7 @@ export const PoolsResponse = { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.pools.push((PoolI_InterfaceDecoder(reader) as Any)); + message.pools.push(GlobalDecoderRegistry.unwrapAny(reader)); break; case 2: message.pagination = PageResponse.decode(reader, reader.uint32()); @@ -368,22 +448,40 @@ export const PoolsResponse = { } return message; }, + fromJSON(object: any): PoolsResponse { + return { + pools: Array.isArray(object?.pools) ? object.pools.map((e: any) => GlobalDecoderRegistry.fromJSON(e)) : [], + pagination: isSet(object.pagination) ? PageResponse.fromJSON(object.pagination) : undefined + }; + }, + toJSON(message: PoolsResponse): unknown { + const obj: any = {}; + if (message.pools) { + obj.pools = message.pools.map(e => e ? GlobalDecoderRegistry.toJSON(e) : undefined); + } else { + obj.pools = []; + } + message.pagination !== undefined && (obj.pagination = message.pagination ? PageResponse.toJSON(message.pagination) : undefined); + return obj; + }, fromPartial(object: Partial): PoolsResponse { const message = createBasePoolsResponse(); - message.pools = object.pools?.map(e => Any.fromPartial(e)) || []; + message.pools = object.pools?.map(e => (Any.fromPartial(e) as any)) || []; message.pagination = object.pagination !== undefined && object.pagination !== null ? PageResponse.fromPartial(object.pagination) : undefined; return message; }, fromAmino(object: PoolsResponseAmino): PoolsResponse { - return { - pools: Array.isArray(object?.pools) ? object.pools.map((e: any) => PoolI_FromAmino(e)) : [], - pagination: object?.pagination ? PageResponse.fromAmino(object.pagination) : undefined - }; + const message = createBasePoolsResponse(); + message.pools = object.pools?.map(e => GlobalDecoderRegistry.fromAminoMsg(e)) || []; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromAmino(object.pagination); + } + return message; }, toAmino(message: PoolsResponse): PoolsResponseAmino { const obj: any = {}; if (message.pools) { - obj.pools = message.pools.map(e => e ? PoolI_ToAmino((e as Any)) : undefined); + obj.pools = message.pools.map(e => e ? GlobalDecoderRegistry.toAminoMsg(e) : undefined); } else { obj.pools = []; } @@ -412,6 +510,8 @@ export const PoolsResponse = { }; } }; +GlobalDecoderRegistry.register(PoolsResponse.typeUrl, PoolsResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(PoolsResponse.aminoType, PoolsResponse.typeUrl); function createBaseContractInfoByPoolIdRequest(): ContractInfoByPoolIdRequest { return { poolId: BigInt(0) @@ -419,6 +519,16 @@ function createBaseContractInfoByPoolIdRequest(): ContractInfoByPoolIdRequest { } export const ContractInfoByPoolIdRequest = { typeUrl: "/osmosis.cosmwasmpool.v1beta1.ContractInfoByPoolIdRequest", + aminoType: "osmosis/cosmwasmpool/contract-info-by-pool-id-request", + is(o: any): o is ContractInfoByPoolIdRequest { + return o && (o.$typeUrl === ContractInfoByPoolIdRequest.typeUrl || typeof o.poolId === "bigint"); + }, + isSDK(o: any): o is ContractInfoByPoolIdRequestSDKType { + return o && (o.$typeUrl === ContractInfoByPoolIdRequest.typeUrl || typeof o.pool_id === "bigint"); + }, + isAmino(o: any): o is ContractInfoByPoolIdRequestAmino { + return o && (o.$typeUrl === ContractInfoByPoolIdRequest.typeUrl || typeof o.pool_id === "bigint"); + }, encode(message: ContractInfoByPoolIdRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.poolId !== BigInt(0)) { writer.uint32(8).uint64(message.poolId); @@ -442,15 +552,27 @@ export const ContractInfoByPoolIdRequest = { } return message; }, + fromJSON(object: any): ContractInfoByPoolIdRequest { + return { + poolId: isSet(object.poolId) ? BigInt(object.poolId.toString()) : BigInt(0) + }; + }, + toJSON(message: ContractInfoByPoolIdRequest): unknown { + const obj: any = {}; + message.poolId !== undefined && (obj.poolId = (message.poolId || BigInt(0)).toString()); + return obj; + }, fromPartial(object: Partial): ContractInfoByPoolIdRequest { const message = createBaseContractInfoByPoolIdRequest(); message.poolId = object.poolId !== undefined && object.poolId !== null ? BigInt(object.poolId.toString()) : BigInt(0); return message; }, fromAmino(object: ContractInfoByPoolIdRequestAmino): ContractInfoByPoolIdRequest { - return { - poolId: BigInt(object.pool_id) - }; + const message = createBaseContractInfoByPoolIdRequest(); + if (object.pool_id !== undefined && object.pool_id !== null) { + message.poolId = BigInt(object.pool_id); + } + return message; }, toAmino(message: ContractInfoByPoolIdRequest): ContractInfoByPoolIdRequestAmino { const obj: any = {}; @@ -479,6 +601,8 @@ export const ContractInfoByPoolIdRequest = { }; } }; +GlobalDecoderRegistry.register(ContractInfoByPoolIdRequest.typeUrl, ContractInfoByPoolIdRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(ContractInfoByPoolIdRequest.aminoType, ContractInfoByPoolIdRequest.typeUrl); function createBaseContractInfoByPoolIdResponse(): ContractInfoByPoolIdResponse { return { contractAddress: "", @@ -487,6 +611,16 @@ function createBaseContractInfoByPoolIdResponse(): ContractInfoByPoolIdResponse } export const ContractInfoByPoolIdResponse = { typeUrl: "/osmosis.cosmwasmpool.v1beta1.ContractInfoByPoolIdResponse", + aminoType: "osmosis/cosmwasmpool/contract-info-by-pool-id-response", + is(o: any): o is ContractInfoByPoolIdResponse { + return o && (o.$typeUrl === ContractInfoByPoolIdResponse.typeUrl || typeof o.contractAddress === "string" && typeof o.codeId === "bigint"); + }, + isSDK(o: any): o is ContractInfoByPoolIdResponseSDKType { + return o && (o.$typeUrl === ContractInfoByPoolIdResponse.typeUrl || typeof o.contract_address === "string" && typeof o.code_id === "bigint"); + }, + isAmino(o: any): o is ContractInfoByPoolIdResponseAmino { + return o && (o.$typeUrl === ContractInfoByPoolIdResponse.typeUrl || typeof o.contract_address === "string" && typeof o.code_id === "bigint"); + }, encode(message: ContractInfoByPoolIdResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.contractAddress !== "") { writer.uint32(10).string(message.contractAddress); @@ -516,6 +650,18 @@ export const ContractInfoByPoolIdResponse = { } return message; }, + fromJSON(object: any): ContractInfoByPoolIdResponse { + return { + contractAddress: isSet(object.contractAddress) ? String(object.contractAddress) : "", + codeId: isSet(object.codeId) ? BigInt(object.codeId.toString()) : BigInt(0) + }; + }, + toJSON(message: ContractInfoByPoolIdResponse): unknown { + const obj: any = {}; + message.contractAddress !== undefined && (obj.contractAddress = message.contractAddress); + message.codeId !== undefined && (obj.codeId = (message.codeId || BigInt(0)).toString()); + return obj; + }, fromPartial(object: Partial): ContractInfoByPoolIdResponse { const message = createBaseContractInfoByPoolIdResponse(); message.contractAddress = object.contractAddress ?? ""; @@ -523,10 +669,14 @@ export const ContractInfoByPoolIdResponse = { return message; }, fromAmino(object: ContractInfoByPoolIdResponseAmino): ContractInfoByPoolIdResponse { - return { - contractAddress: object.contract_address, - codeId: BigInt(object.code_id) - }; + const message = createBaseContractInfoByPoolIdResponse(); + if (object.contract_address !== undefined && object.contract_address !== null) { + message.contractAddress = object.contract_address; + } + if (object.code_id !== undefined && object.code_id !== null) { + message.codeId = BigInt(object.code_id); + } + return message; }, toAmino(message: ContractInfoByPoolIdResponse): ContractInfoByPoolIdResponseAmino { const obj: any = {}; @@ -556,71 +706,5 @@ export const ContractInfoByPoolIdResponse = { }; } }; -export const PoolI_InterfaceDecoder = (input: BinaryReader | Uint8Array): Pool1 | CosmWasmPool | Pool2 | Pool3 | Any => { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - const data = Any.decode(reader, reader.uint32()); - switch (data.typeUrl) { - case "/osmosis.concentratedliquidity.v1beta1.Pool": - return Pool1.decode(data.value); - case "/osmosis.cosmwasmpool.v1beta1.CosmWasmPool": - return CosmWasmPool.decode(data.value); - case "/osmosis.gamm.v1beta1.Pool": - return Pool2.decode(data.value); - case "/osmosis.gamm.poolmodels.stableswap.v1beta1.Pool": - return Pool3.decode(data.value); - default: - return data; - } -}; -export const PoolI_FromAmino = (content: AnyAmino) => { - switch (content.type) { - case "osmosis/concentratedliquidity/pool": - return Any.fromPartial({ - typeUrl: "/osmosis.concentratedliquidity.v1beta1.Pool", - value: Pool1.encode(Pool1.fromPartial(Pool1.fromAmino(content.value))).finish() - }); - case "osmosis/cosmwasmpool/cosm-wasm-pool": - return Any.fromPartial({ - typeUrl: "/osmosis.cosmwasmpool.v1beta1.CosmWasmPool", - value: CosmWasmPool.encode(CosmWasmPool.fromPartial(CosmWasmPool.fromAmino(content.value))).finish() - }); - case "osmosis/gamm/BalancerPool": - return Any.fromPartial({ - typeUrl: "/osmosis.gamm.v1beta1.Pool", - value: Pool2.encode(Pool2.fromPartial(Pool2.fromAmino(content.value))).finish() - }); - case "osmosis/gamm/StableswapPool": - return Any.fromPartial({ - typeUrl: "/osmosis.gamm.poolmodels.stableswap.v1beta1.Pool", - value: Pool3.encode(Pool3.fromPartial(Pool3.fromAmino(content.value))).finish() - }); - default: - return Any.fromAmino(content); - } -}; -export const PoolI_ToAmino = (content: Any) => { - switch (content.typeUrl) { - case "/osmosis.concentratedliquidity.v1beta1.Pool": - return { - type: "osmosis/concentratedliquidity/pool", - value: Pool1.toAmino(Pool1.decode(content.value)) - }; - case "/osmosis.cosmwasmpool.v1beta1.CosmWasmPool": - return { - type: "osmosis/cosmwasmpool/cosm-wasm-pool", - value: CosmWasmPool.toAmino(CosmWasmPool.decode(content.value)) - }; - case "/osmosis.gamm.v1beta1.Pool": - return { - type: "osmosis/gamm/BalancerPool", - value: Pool2.toAmino(Pool2.decode(content.value)) - }; - case "/osmosis.gamm.poolmodels.stableswap.v1beta1.Pool": - return { - type: "osmosis/gamm/StableswapPool", - value: Pool3.toAmino(Pool3.decode(content.value)) - }; - default: - return Any.toAmino(content); - } -}; \ No newline at end of file +GlobalDecoderRegistry.register(ContractInfoByPoolIdResponse.typeUrl, ContractInfoByPoolIdResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(ContractInfoByPoolIdResponse.aminoType, ContractInfoByPoolIdResponse.typeUrl); \ No newline at end of file diff --git a/packages/osmojs/src/codegen/osmosis/downtime-detector/v1beta1/downtime_duration.ts b/packages/osmojs/src/codegen/osmosis/downtimedetector/v1beta1/downtime_duration.ts similarity index 100% rename from packages/osmojs/src/codegen/osmosis/downtime-detector/v1beta1/downtime_duration.ts rename to packages/osmojs/src/codegen/osmosis/downtimedetector/v1beta1/downtime_duration.ts diff --git a/packages/osmojs/src/codegen/osmosis/downtime-detector/v1beta1/genesis.ts b/packages/osmojs/src/codegen/osmosis/downtimedetector/v1beta1/genesis.ts similarity index 62% rename from packages/osmojs/src/codegen/osmosis/downtime-detector/v1beta1/genesis.ts rename to packages/osmojs/src/codegen/osmosis/downtimedetector/v1beta1/genesis.ts index e5d424945..83bada4a2 100644 --- a/packages/osmojs/src/codegen/osmosis/downtime-detector/v1beta1/genesis.ts +++ b/packages/osmojs/src/codegen/osmosis/downtimedetector/v1beta1/genesis.ts @@ -1,7 +1,8 @@ -import { Downtime, downtimeFromJSON } from "./downtime_duration"; +import { Downtime, downtimeFromJSON, downtimeToJSON } from "./downtime_duration"; import { Timestamp } from "../../../google/protobuf/timestamp"; +import { isSet, toTimestamp, fromTimestamp } from "../../../helpers"; import { BinaryReader, BinaryWriter } from "../../../binary"; -import { toTimestamp, fromTimestamp, isSet } from "../../../helpers"; +import { GlobalDecoderRegistry } from "../../../registry"; export interface GenesisDowntimeEntry { duration: Downtime; lastDowntime: Date; @@ -11,8 +12,8 @@ export interface GenesisDowntimeEntryProtoMsg { value: Uint8Array; } export interface GenesisDowntimeEntryAmino { - duration: Downtime; - last_downtime?: Date; + duration?: Downtime; + last_downtime?: string; } export interface GenesisDowntimeEntryAminoMsg { type: "osmosis/downtimedetector/genesis-downtime-entry"; @@ -33,8 +34,8 @@ export interface GenesisStateProtoMsg { } /** GenesisState defines the twap module's genesis state. */ export interface GenesisStateAmino { - downtimes: GenesisDowntimeEntryAmino[]; - last_block_time?: Date; + downtimes?: GenesisDowntimeEntryAmino[]; + last_block_time?: string; } export interface GenesisStateAminoMsg { type: "osmosis/downtimedetector/genesis-state"; @@ -48,11 +49,21 @@ export interface GenesisStateSDKType { function createBaseGenesisDowntimeEntry(): GenesisDowntimeEntry { return { duration: 0, - lastDowntime: undefined + lastDowntime: new Date() }; } export const GenesisDowntimeEntry = { typeUrl: "/osmosis.downtimedetector.v1beta1.GenesisDowntimeEntry", + aminoType: "osmosis/downtimedetector/genesis-downtime-entry", + is(o: any): o is GenesisDowntimeEntry { + return o && (o.$typeUrl === GenesisDowntimeEntry.typeUrl || isSet(o.duration) && Timestamp.is(o.lastDowntime)); + }, + isSDK(o: any): o is GenesisDowntimeEntrySDKType { + return o && (o.$typeUrl === GenesisDowntimeEntry.typeUrl || isSet(o.duration) && Timestamp.isSDK(o.last_downtime)); + }, + isAmino(o: any): o is GenesisDowntimeEntryAmino { + return o && (o.$typeUrl === GenesisDowntimeEntry.typeUrl || isSet(o.duration) && Timestamp.isAmino(o.last_downtime)); + }, encode(message: GenesisDowntimeEntry, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.duration !== 0) { writer.uint32(8).int32(message.duration); @@ -82,6 +93,18 @@ export const GenesisDowntimeEntry = { } return message; }, + fromJSON(object: any): GenesisDowntimeEntry { + return { + duration: isSet(object.duration) ? downtimeFromJSON(object.duration) : -1, + lastDowntime: isSet(object.lastDowntime) ? new Date(object.lastDowntime) : undefined + }; + }, + toJSON(message: GenesisDowntimeEntry): unknown { + const obj: any = {}; + message.duration !== undefined && (obj.duration = downtimeToJSON(message.duration)); + message.lastDowntime !== undefined && (obj.lastDowntime = message.lastDowntime.toISOString()); + return obj; + }, fromPartial(object: Partial): GenesisDowntimeEntry { const message = createBaseGenesisDowntimeEntry(); message.duration = object.duration ?? 0; @@ -89,15 +112,19 @@ export const GenesisDowntimeEntry = { return message; }, fromAmino(object: GenesisDowntimeEntryAmino): GenesisDowntimeEntry { - return { - duration: isSet(object.duration) ? downtimeFromJSON(object.duration) : -1, - lastDowntime: object.last_downtime - }; + const message = createBaseGenesisDowntimeEntry(); + if (object.duration !== undefined && object.duration !== null) { + message.duration = downtimeFromJSON(object.duration); + } + if (object.last_downtime !== undefined && object.last_downtime !== null) { + message.lastDowntime = fromTimestamp(Timestamp.fromAmino(object.last_downtime)); + } + return message; }, toAmino(message: GenesisDowntimeEntry): GenesisDowntimeEntryAmino { const obj: any = {}; - obj.duration = message.duration; - obj.last_downtime = message.lastDowntime; + obj.duration = downtimeToJSON(message.duration); + obj.last_downtime = message.lastDowntime ? Timestamp.toAmino(toTimestamp(message.lastDowntime)) : undefined; return obj; }, fromAminoMsg(object: GenesisDowntimeEntryAminoMsg): GenesisDowntimeEntry { @@ -122,14 +149,26 @@ export const GenesisDowntimeEntry = { }; } }; +GlobalDecoderRegistry.register(GenesisDowntimeEntry.typeUrl, GenesisDowntimeEntry); +GlobalDecoderRegistry.registerAminoProtoMapping(GenesisDowntimeEntry.aminoType, GenesisDowntimeEntry.typeUrl); function createBaseGenesisState(): GenesisState { return { downtimes: [], - lastBlockTime: undefined + lastBlockTime: new Date() }; } export const GenesisState = { typeUrl: "/osmosis.downtimedetector.v1beta1.GenesisState", + aminoType: "osmosis/downtimedetector/genesis-state", + is(o: any): o is GenesisState { + return o && (o.$typeUrl === GenesisState.typeUrl || Array.isArray(o.downtimes) && (!o.downtimes.length || GenesisDowntimeEntry.is(o.downtimes[0])) && Timestamp.is(o.lastBlockTime)); + }, + isSDK(o: any): o is GenesisStateSDKType { + return o && (o.$typeUrl === GenesisState.typeUrl || Array.isArray(o.downtimes) && (!o.downtimes.length || GenesisDowntimeEntry.isSDK(o.downtimes[0])) && Timestamp.isSDK(o.last_block_time)); + }, + isAmino(o: any): o is GenesisStateAmino { + return o && (o.$typeUrl === GenesisState.typeUrl || Array.isArray(o.downtimes) && (!o.downtimes.length || GenesisDowntimeEntry.isAmino(o.downtimes[0])) && Timestamp.isAmino(o.last_block_time)); + }, encode(message: GenesisState, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.downtimes) { GenesisDowntimeEntry.encode(v!, writer.uint32(10).fork()).ldelim(); @@ -159,6 +198,22 @@ export const GenesisState = { } return message; }, + fromJSON(object: any): GenesisState { + return { + downtimes: Array.isArray(object?.downtimes) ? object.downtimes.map((e: any) => GenesisDowntimeEntry.fromJSON(e)) : [], + lastBlockTime: isSet(object.lastBlockTime) ? new Date(object.lastBlockTime) : undefined + }; + }, + toJSON(message: GenesisState): unknown { + const obj: any = {}; + if (message.downtimes) { + obj.downtimes = message.downtimes.map(e => e ? GenesisDowntimeEntry.toJSON(e) : undefined); + } else { + obj.downtimes = []; + } + message.lastBlockTime !== undefined && (obj.lastBlockTime = message.lastBlockTime.toISOString()); + return obj; + }, fromPartial(object: Partial): GenesisState { const message = createBaseGenesisState(); message.downtimes = object.downtimes?.map(e => GenesisDowntimeEntry.fromPartial(e)) || []; @@ -166,10 +221,12 @@ export const GenesisState = { return message; }, fromAmino(object: GenesisStateAmino): GenesisState { - return { - downtimes: Array.isArray(object?.downtimes) ? object.downtimes.map((e: any) => GenesisDowntimeEntry.fromAmino(e)) : [], - lastBlockTime: object.last_block_time - }; + const message = createBaseGenesisState(); + message.downtimes = object.downtimes?.map(e => GenesisDowntimeEntry.fromAmino(e)) || []; + if (object.last_block_time !== undefined && object.last_block_time !== null) { + message.lastBlockTime = fromTimestamp(Timestamp.fromAmino(object.last_block_time)); + } + return message; }, toAmino(message: GenesisState): GenesisStateAmino { const obj: any = {}; @@ -178,7 +235,7 @@ export const GenesisState = { } else { obj.downtimes = []; } - obj.last_block_time = message.lastBlockTime; + obj.last_block_time = message.lastBlockTime ? Timestamp.toAmino(toTimestamp(message.lastBlockTime)) : undefined; return obj; }, fromAminoMsg(object: GenesisStateAminoMsg): GenesisState { @@ -202,4 +259,6 @@ export const GenesisState = { value: GenesisState.encode(message).finish() }; } -}; \ No newline at end of file +}; +GlobalDecoderRegistry.register(GenesisState.typeUrl, GenesisState); +GlobalDecoderRegistry.registerAminoProtoMapping(GenesisState.aminoType, GenesisState.typeUrl); \ No newline at end of file diff --git a/packages/osmojs/src/codegen/osmosis/downtime-detector/v1beta1/query.lcd.ts b/packages/osmojs/src/codegen/osmosis/downtimedetector/v1beta1/query.lcd.ts similarity index 100% rename from packages/osmojs/src/codegen/osmosis/downtime-detector/v1beta1/query.lcd.ts rename to packages/osmojs/src/codegen/osmosis/downtimedetector/v1beta1/query.lcd.ts diff --git a/packages/osmojs/src/codegen/osmosis/downtime-detector/v1beta1/query.rpc.Query.ts b/packages/osmojs/src/codegen/osmosis/downtimedetector/v1beta1/query.rpc.Query.ts similarity index 100% rename from packages/osmojs/src/codegen/osmosis/downtime-detector/v1beta1/query.rpc.Query.ts rename to packages/osmojs/src/codegen/osmosis/downtimedetector/v1beta1/query.rpc.Query.ts diff --git a/packages/osmojs/src/codegen/osmosis/downtime-detector/v1beta1/query.ts b/packages/osmojs/src/codegen/osmosis/downtimedetector/v1beta1/query.ts similarity index 68% rename from packages/osmojs/src/codegen/osmosis/downtime-detector/v1beta1/query.ts rename to packages/osmojs/src/codegen/osmosis/downtimedetector/v1beta1/query.ts index c950487d2..d3bc0e454 100644 --- a/packages/osmojs/src/codegen/osmosis/downtime-detector/v1beta1/query.ts +++ b/packages/osmojs/src/codegen/osmosis/downtimedetector/v1beta1/query.ts @@ -1,7 +1,8 @@ -import { Downtime, downtimeFromJSON } from "./downtime_duration"; +import { Downtime, downtimeFromJSON, downtimeToJSON } from "./downtime_duration"; import { Duration, DurationAmino, DurationSDKType } from "../../../google/protobuf/duration"; -import { BinaryReader, BinaryWriter } from "../../../binary"; import { isSet } from "../../../helpers"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { GlobalDecoderRegistry } from "../../../registry"; /** * Query for has it been at least $RECOVERY_DURATION units of time, * since the chain has been down for $DOWNTIME_DURATION. @@ -19,7 +20,7 @@ export interface RecoveredSinceDowntimeOfLengthRequestProtoMsg { * since the chain has been down for $DOWNTIME_DURATION. */ export interface RecoveredSinceDowntimeOfLengthRequestAmino { - downtime: Downtime; + downtime?: Downtime; recovery?: DurationAmino; } export interface RecoveredSinceDowntimeOfLengthRequestAminoMsg { @@ -42,7 +43,7 @@ export interface RecoveredSinceDowntimeOfLengthResponseProtoMsg { value: Uint8Array; } export interface RecoveredSinceDowntimeOfLengthResponseAmino { - succesfully_recovered: boolean; + succesfully_recovered?: boolean; } export interface RecoveredSinceDowntimeOfLengthResponseAminoMsg { type: "osmosis/downtimedetector/recovered-since-downtime-of-length-response"; @@ -54,11 +55,21 @@ export interface RecoveredSinceDowntimeOfLengthResponseSDKType { function createBaseRecoveredSinceDowntimeOfLengthRequest(): RecoveredSinceDowntimeOfLengthRequest { return { downtime: 0, - recovery: undefined + recovery: Duration.fromPartial({}) }; } export const RecoveredSinceDowntimeOfLengthRequest = { typeUrl: "/osmosis.downtimedetector.v1beta1.RecoveredSinceDowntimeOfLengthRequest", + aminoType: "osmosis/downtimedetector/recovered-since-downtime-of-length-request", + is(o: any): o is RecoveredSinceDowntimeOfLengthRequest { + return o && (o.$typeUrl === RecoveredSinceDowntimeOfLengthRequest.typeUrl || isSet(o.downtime) && Duration.is(o.recovery)); + }, + isSDK(o: any): o is RecoveredSinceDowntimeOfLengthRequestSDKType { + return o && (o.$typeUrl === RecoveredSinceDowntimeOfLengthRequest.typeUrl || isSet(o.downtime) && Duration.isSDK(o.recovery)); + }, + isAmino(o: any): o is RecoveredSinceDowntimeOfLengthRequestAmino { + return o && (o.$typeUrl === RecoveredSinceDowntimeOfLengthRequest.typeUrl || isSet(o.downtime) && Duration.isAmino(o.recovery)); + }, encode(message: RecoveredSinceDowntimeOfLengthRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.downtime !== 0) { writer.uint32(8).int32(message.downtime); @@ -88,6 +99,18 @@ export const RecoveredSinceDowntimeOfLengthRequest = { } return message; }, + fromJSON(object: any): RecoveredSinceDowntimeOfLengthRequest { + return { + downtime: isSet(object.downtime) ? downtimeFromJSON(object.downtime) : -1, + recovery: isSet(object.recovery) ? Duration.fromJSON(object.recovery) : undefined + }; + }, + toJSON(message: RecoveredSinceDowntimeOfLengthRequest): unknown { + const obj: any = {}; + message.downtime !== undefined && (obj.downtime = downtimeToJSON(message.downtime)); + message.recovery !== undefined && (obj.recovery = message.recovery ? Duration.toJSON(message.recovery) : undefined); + return obj; + }, fromPartial(object: Partial): RecoveredSinceDowntimeOfLengthRequest { const message = createBaseRecoveredSinceDowntimeOfLengthRequest(); message.downtime = object.downtime ?? 0; @@ -95,14 +118,18 @@ export const RecoveredSinceDowntimeOfLengthRequest = { return message; }, fromAmino(object: RecoveredSinceDowntimeOfLengthRequestAmino): RecoveredSinceDowntimeOfLengthRequest { - return { - downtime: isSet(object.downtime) ? downtimeFromJSON(object.downtime) : -1, - recovery: object?.recovery ? Duration.fromAmino(object.recovery) : undefined - }; + const message = createBaseRecoveredSinceDowntimeOfLengthRequest(); + if (object.downtime !== undefined && object.downtime !== null) { + message.downtime = downtimeFromJSON(object.downtime); + } + if (object.recovery !== undefined && object.recovery !== null) { + message.recovery = Duration.fromAmino(object.recovery); + } + return message; }, toAmino(message: RecoveredSinceDowntimeOfLengthRequest): RecoveredSinceDowntimeOfLengthRequestAmino { const obj: any = {}; - obj.downtime = message.downtime; + obj.downtime = downtimeToJSON(message.downtime); obj.recovery = message.recovery ? Duration.toAmino(message.recovery) : undefined; return obj; }, @@ -128,6 +155,8 @@ export const RecoveredSinceDowntimeOfLengthRequest = { }; } }; +GlobalDecoderRegistry.register(RecoveredSinceDowntimeOfLengthRequest.typeUrl, RecoveredSinceDowntimeOfLengthRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(RecoveredSinceDowntimeOfLengthRequest.aminoType, RecoveredSinceDowntimeOfLengthRequest.typeUrl); function createBaseRecoveredSinceDowntimeOfLengthResponse(): RecoveredSinceDowntimeOfLengthResponse { return { succesfullyRecovered: false @@ -135,6 +164,16 @@ function createBaseRecoveredSinceDowntimeOfLengthResponse(): RecoveredSinceDownt } export const RecoveredSinceDowntimeOfLengthResponse = { typeUrl: "/osmosis.downtimedetector.v1beta1.RecoveredSinceDowntimeOfLengthResponse", + aminoType: "osmosis/downtimedetector/recovered-since-downtime-of-length-response", + is(o: any): o is RecoveredSinceDowntimeOfLengthResponse { + return o && (o.$typeUrl === RecoveredSinceDowntimeOfLengthResponse.typeUrl || typeof o.succesfullyRecovered === "boolean"); + }, + isSDK(o: any): o is RecoveredSinceDowntimeOfLengthResponseSDKType { + return o && (o.$typeUrl === RecoveredSinceDowntimeOfLengthResponse.typeUrl || typeof o.succesfully_recovered === "boolean"); + }, + isAmino(o: any): o is RecoveredSinceDowntimeOfLengthResponseAmino { + return o && (o.$typeUrl === RecoveredSinceDowntimeOfLengthResponse.typeUrl || typeof o.succesfully_recovered === "boolean"); + }, encode(message: RecoveredSinceDowntimeOfLengthResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.succesfullyRecovered === true) { writer.uint32(8).bool(message.succesfullyRecovered); @@ -158,15 +197,27 @@ export const RecoveredSinceDowntimeOfLengthResponse = { } return message; }, + fromJSON(object: any): RecoveredSinceDowntimeOfLengthResponse { + return { + succesfullyRecovered: isSet(object.succesfullyRecovered) ? Boolean(object.succesfullyRecovered) : false + }; + }, + toJSON(message: RecoveredSinceDowntimeOfLengthResponse): unknown { + const obj: any = {}; + message.succesfullyRecovered !== undefined && (obj.succesfullyRecovered = message.succesfullyRecovered); + return obj; + }, fromPartial(object: Partial): RecoveredSinceDowntimeOfLengthResponse { const message = createBaseRecoveredSinceDowntimeOfLengthResponse(); message.succesfullyRecovered = object.succesfullyRecovered ?? false; return message; }, fromAmino(object: RecoveredSinceDowntimeOfLengthResponseAmino): RecoveredSinceDowntimeOfLengthResponse { - return { - succesfullyRecovered: object.succesfully_recovered - }; + const message = createBaseRecoveredSinceDowntimeOfLengthResponse(); + if (object.succesfully_recovered !== undefined && object.succesfully_recovered !== null) { + message.succesfullyRecovered = object.succesfully_recovered; + } + return message; }, toAmino(message: RecoveredSinceDowntimeOfLengthResponse): RecoveredSinceDowntimeOfLengthResponseAmino { const obj: any = {}; @@ -194,4 +245,6 @@ export const RecoveredSinceDowntimeOfLengthResponse = { value: RecoveredSinceDowntimeOfLengthResponse.encode(message).finish() }; } -}; \ No newline at end of file +}; +GlobalDecoderRegistry.register(RecoveredSinceDowntimeOfLengthResponse.typeUrl, RecoveredSinceDowntimeOfLengthResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(RecoveredSinceDowntimeOfLengthResponse.aminoType, RecoveredSinceDowntimeOfLengthResponse.typeUrl); \ No newline at end of file diff --git a/packages/osmojs/src/codegen/osmosis/epochs/genesis.ts b/packages/osmojs/src/codegen/osmosis/epochs/v1beta1/genesis.ts similarity index 67% rename from packages/osmojs/src/codegen/osmosis/epochs/genesis.ts rename to packages/osmojs/src/codegen/osmosis/epochs/v1beta1/genesis.ts index 63514f26d..4efd99172 100644 --- a/packages/osmojs/src/codegen/osmosis/epochs/genesis.ts +++ b/packages/osmojs/src/codegen/osmosis/epochs/v1beta1/genesis.ts @@ -1,7 +1,8 @@ -import { Timestamp } from "../../google/protobuf/timestamp"; -import { Duration, DurationAmino, DurationSDKType } from "../../google/protobuf/duration"; -import { BinaryReader, BinaryWriter } from "../../binary"; -import { toTimestamp, fromTimestamp } from "../../helpers"; +import { Timestamp } from "../../../google/protobuf/timestamp"; +import { Duration, DurationAmino, DurationSDKType } from "../../../google/protobuf/duration"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { toTimestamp, fromTimestamp, isSet } from "../../../helpers"; +import { GlobalDecoderRegistry } from "../../../registry"; /** * EpochInfo is a struct that describes the data going into * a timer defined by the x/epochs module. @@ -70,13 +71,13 @@ export interface EpochInfoProtoMsg { */ export interface EpochInfoAmino { /** identifier is a unique reference to this particular timer. */ - identifier: string; + identifier?: string; /** * start_time is the time at which the timer first ever ticks. * If start_time is in the future, the epoch will not begin until the start * time. */ - start_time?: Date; + start_time?: string; /** * duration is the time in between epoch ticks. * In order for intended behavior to be met, duration should @@ -90,7 +91,7 @@ export interface EpochInfoAmino { * The first tick (current_epoch=1) is defined as * the first block whose blocktime is greater than the EpochInfo start_time. */ - current_epoch: string; + current_epoch?: string; /** * current_epoch_start_time describes the start time of the current timer * interval. The interval is (current_epoch_start_time, @@ -110,17 +111,17 @@ export interface EpochInfoAmino { * * The t=34 block will start the epoch for (30, 35] * * The **t=36** block will start the epoch for (35, 40] */ - current_epoch_start_time?: Date; + current_epoch_start_time?: string; /** * epoch_counting_started is a boolean, that indicates whether this * epoch timer has began yet. */ - epoch_counting_started: boolean; + epoch_counting_started?: boolean; /** * current_epoch_start_height is the block height at which the current epoch * started. (The block height at which the timer last ticked) */ - current_epoch_start_height: string; + current_epoch_start_height?: string; } export interface EpochInfoAminoMsg { type: "osmosis/epochs/epoch-info"; @@ -149,7 +150,7 @@ export interface GenesisStateProtoMsg { } /** GenesisState defines the epochs module's genesis state. */ export interface GenesisStateAmino { - epochs: EpochInfoAmino[]; + epochs?: EpochInfoAmino[]; } export interface GenesisStateAminoMsg { type: "osmosis/epochs/genesis-state"; @@ -162,16 +163,26 @@ export interface GenesisStateSDKType { function createBaseEpochInfo(): EpochInfo { return { identifier: "", - startTime: undefined, - duration: undefined, + startTime: new Date(), + duration: Duration.fromPartial({}), currentEpoch: BigInt(0), - currentEpochStartTime: undefined, + currentEpochStartTime: new Date(), epochCountingStarted: false, currentEpochStartHeight: BigInt(0) }; } export const EpochInfo = { typeUrl: "/osmosis.epochs.v1beta1.EpochInfo", + aminoType: "osmosis/epochs/epoch-info", + is(o: any): o is EpochInfo { + return o && (o.$typeUrl === EpochInfo.typeUrl || typeof o.identifier === "string" && Timestamp.is(o.startTime) && Duration.is(o.duration) && typeof o.currentEpoch === "bigint" && Timestamp.is(o.currentEpochStartTime) && typeof o.epochCountingStarted === "boolean" && typeof o.currentEpochStartHeight === "bigint"); + }, + isSDK(o: any): o is EpochInfoSDKType { + return o && (o.$typeUrl === EpochInfo.typeUrl || typeof o.identifier === "string" && Timestamp.isSDK(o.start_time) && Duration.isSDK(o.duration) && typeof o.current_epoch === "bigint" && Timestamp.isSDK(o.current_epoch_start_time) && typeof o.epoch_counting_started === "boolean" && typeof o.current_epoch_start_height === "bigint"); + }, + isAmino(o: any): o is EpochInfoAmino { + return o && (o.$typeUrl === EpochInfo.typeUrl || typeof o.identifier === "string" && Timestamp.isAmino(o.start_time) && Duration.isAmino(o.duration) && typeof o.current_epoch === "bigint" && Timestamp.isAmino(o.current_epoch_start_time) && typeof o.epoch_counting_started === "boolean" && typeof o.current_epoch_start_height === "bigint"); + }, encode(message: EpochInfo, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.identifier !== "") { writer.uint32(10).string(message.identifier); @@ -231,6 +242,28 @@ export const EpochInfo = { } return message; }, + fromJSON(object: any): EpochInfo { + return { + identifier: isSet(object.identifier) ? String(object.identifier) : "", + startTime: isSet(object.startTime) ? new Date(object.startTime) : undefined, + duration: isSet(object.duration) ? Duration.fromJSON(object.duration) : undefined, + currentEpoch: isSet(object.currentEpoch) ? BigInt(object.currentEpoch.toString()) : BigInt(0), + currentEpochStartTime: isSet(object.currentEpochStartTime) ? new Date(object.currentEpochStartTime) : undefined, + epochCountingStarted: isSet(object.epochCountingStarted) ? Boolean(object.epochCountingStarted) : false, + currentEpochStartHeight: isSet(object.currentEpochStartHeight) ? BigInt(object.currentEpochStartHeight.toString()) : BigInt(0) + }; + }, + 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 || BigInt(0)).toString()); + message.currentEpochStartTime !== undefined && (obj.currentEpochStartTime = message.currentEpochStartTime.toISOString()); + message.epochCountingStarted !== undefined && (obj.epochCountingStarted = message.epochCountingStarted); + message.currentEpochStartHeight !== undefined && (obj.currentEpochStartHeight = (message.currentEpochStartHeight || BigInt(0)).toString()); + return obj; + }, fromPartial(object: Partial): EpochInfo { const message = createBaseEpochInfo(); message.identifier = object.identifier ?? ""; @@ -243,23 +276,37 @@ export const EpochInfo = { return message; }, fromAmino(object: EpochInfoAmino): EpochInfo { - return { - identifier: object.identifier, - startTime: object.start_time, - duration: object?.duration ? Duration.fromAmino(object.duration) : undefined, - currentEpoch: BigInt(object.current_epoch), - currentEpochStartTime: object.current_epoch_start_time, - epochCountingStarted: object.epoch_counting_started, - currentEpochStartHeight: BigInt(object.current_epoch_start_height) - }; + const message = createBaseEpochInfo(); + if (object.identifier !== undefined && object.identifier !== null) { + message.identifier = object.identifier; + } + if (object.start_time !== undefined && object.start_time !== null) { + message.startTime = fromTimestamp(Timestamp.fromAmino(object.start_time)); + } + if (object.duration !== undefined && object.duration !== null) { + message.duration = Duration.fromAmino(object.duration); + } + if (object.current_epoch !== undefined && object.current_epoch !== null) { + message.currentEpoch = BigInt(object.current_epoch); + } + if (object.current_epoch_start_time !== undefined && object.current_epoch_start_time !== null) { + message.currentEpochStartTime = fromTimestamp(Timestamp.fromAmino(object.current_epoch_start_time)); + } + if (object.epoch_counting_started !== undefined && object.epoch_counting_started !== null) { + message.epochCountingStarted = object.epoch_counting_started; + } + if (object.current_epoch_start_height !== undefined && object.current_epoch_start_height !== null) { + message.currentEpochStartHeight = BigInt(object.current_epoch_start_height); + } + return message; }, toAmino(message: EpochInfo): EpochInfoAmino { const obj: any = {}; obj.identifier = message.identifier; - obj.start_time = message.startTime; + obj.start_time = message.startTime ? Timestamp.toAmino(toTimestamp(message.startTime)) : undefined; obj.duration = message.duration ? Duration.toAmino(message.duration) : undefined; obj.current_epoch = message.currentEpoch ? message.currentEpoch.toString() : undefined; - obj.current_epoch_start_time = message.currentEpochStartTime; + obj.current_epoch_start_time = message.currentEpochStartTime ? Timestamp.toAmino(toTimestamp(message.currentEpochStartTime)) : undefined; obj.epoch_counting_started = message.epochCountingStarted; obj.current_epoch_start_height = message.currentEpochStartHeight ? message.currentEpochStartHeight.toString() : undefined; return obj; @@ -286,6 +333,8 @@ export const EpochInfo = { }; } }; +GlobalDecoderRegistry.register(EpochInfo.typeUrl, EpochInfo); +GlobalDecoderRegistry.registerAminoProtoMapping(EpochInfo.aminoType, EpochInfo.typeUrl); function createBaseGenesisState(): GenesisState { return { epochs: [] @@ -293,6 +342,16 @@ function createBaseGenesisState(): GenesisState { } export const GenesisState = { typeUrl: "/osmosis.epochs.v1beta1.GenesisState", + aminoType: "osmosis/epochs/genesis-state", + is(o: any): o is GenesisState { + return o && (o.$typeUrl === GenesisState.typeUrl || Array.isArray(o.epochs) && (!o.epochs.length || EpochInfo.is(o.epochs[0]))); + }, + isSDK(o: any): o is GenesisStateSDKType { + return o && (o.$typeUrl === GenesisState.typeUrl || Array.isArray(o.epochs) && (!o.epochs.length || EpochInfo.isSDK(o.epochs[0]))); + }, + isAmino(o: any): o is GenesisStateAmino { + return o && (o.$typeUrl === GenesisState.typeUrl || Array.isArray(o.epochs) && (!o.epochs.length || EpochInfo.isAmino(o.epochs[0]))); + }, encode(message: GenesisState, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.epochs) { EpochInfo.encode(v!, writer.uint32(10).fork()).ldelim(); @@ -316,15 +375,29 @@ export const GenesisState = { } return message; }, + fromJSON(object: any): GenesisState { + return { + epochs: Array.isArray(object?.epochs) ? object.epochs.map((e: any) => EpochInfo.fromJSON(e)) : [] + }; + }, + toJSON(message: GenesisState): unknown { + const obj: any = {}; + if (message.epochs) { + obj.epochs = message.epochs.map(e => e ? EpochInfo.toJSON(e) : undefined); + } else { + obj.epochs = []; + } + return obj; + }, fromPartial(object: Partial): GenesisState { const message = createBaseGenesisState(); message.epochs = object.epochs?.map(e => EpochInfo.fromPartial(e)) || []; return message; }, fromAmino(object: GenesisStateAmino): GenesisState { - return { - epochs: Array.isArray(object?.epochs) ? object.epochs.map((e: any) => EpochInfo.fromAmino(e)) : [] - }; + const message = createBaseGenesisState(); + message.epochs = object.epochs?.map(e => EpochInfo.fromAmino(e)) || []; + return message; }, toAmino(message: GenesisState): GenesisStateAmino { const obj: any = {}; @@ -356,4 +429,6 @@ export const GenesisState = { value: GenesisState.encode(message).finish() }; } -}; \ No newline at end of file +}; +GlobalDecoderRegistry.register(GenesisState.typeUrl, GenesisState); +GlobalDecoderRegistry.registerAminoProtoMapping(GenesisState.aminoType, GenesisState.typeUrl); \ No newline at end of file diff --git a/packages/osmojs/src/codegen/osmosis/epochs/query.lcd.ts b/packages/osmojs/src/codegen/osmosis/epochs/v1beta1/query.lcd.ts similarity index 100% rename from packages/osmojs/src/codegen/osmosis/epochs/query.lcd.ts rename to packages/osmojs/src/codegen/osmosis/epochs/v1beta1/query.lcd.ts diff --git a/packages/osmojs/src/codegen/osmosis/epochs/query.rpc.Query.ts b/packages/osmojs/src/codegen/osmosis/epochs/v1beta1/query.rpc.Query.ts similarity index 95% rename from packages/osmojs/src/codegen/osmosis/epochs/query.rpc.Query.ts rename to packages/osmojs/src/codegen/osmosis/epochs/v1beta1/query.rpc.Query.ts index d5a47deb7..bfb8624e0 100644 --- a/packages/osmojs/src/codegen/osmosis/epochs/query.rpc.Query.ts +++ b/packages/osmojs/src/codegen/osmosis/epochs/v1beta1/query.rpc.Query.ts @@ -1,5 +1,5 @@ -import { Rpc } from "../../helpers"; -import { BinaryReader } from "../../binary"; +import { Rpc } from "../../../helpers"; +import { BinaryReader } from "../../../binary"; import { QueryClient, createProtobufRpcClient } from "@cosmjs/stargate"; import { QueryEpochsInfoRequest, QueryEpochsInfoResponse, QueryCurrentEpochRequest, QueryCurrentEpochResponse } from "./query"; /** Query defines the gRPC querier service. */ diff --git a/packages/osmojs/src/codegen/osmosis/epochs/query.ts b/packages/osmojs/src/codegen/osmosis/epochs/v1beta1/query.ts similarity index 69% rename from packages/osmojs/src/codegen/osmosis/epochs/query.ts rename to packages/osmojs/src/codegen/osmosis/epochs/v1beta1/query.ts index a26528949..b7d587885 100644 --- a/packages/osmojs/src/codegen/osmosis/epochs/query.ts +++ b/packages/osmojs/src/codegen/osmosis/epochs/v1beta1/query.ts @@ -1,5 +1,7 @@ import { EpochInfo, EpochInfoAmino, EpochInfoSDKType } from "./genesis"; -import { BinaryReader, BinaryWriter } from "../../binary"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { GlobalDecoderRegistry } from "../../../registry"; +import { isSet } from "../../../helpers"; export interface QueryEpochsInfoRequest {} export interface QueryEpochsInfoRequestProtoMsg { typeUrl: "/osmosis.epochs.v1beta1.QueryEpochsInfoRequest"; @@ -19,7 +21,7 @@ export interface QueryEpochsInfoResponseProtoMsg { value: Uint8Array; } export interface QueryEpochsInfoResponseAmino { - epochs: EpochInfoAmino[]; + epochs?: EpochInfoAmino[]; } export interface QueryEpochsInfoResponseAminoMsg { type: "osmosis/epochs/query-epochs-info-response"; @@ -36,7 +38,7 @@ export interface QueryCurrentEpochRequestProtoMsg { value: Uint8Array; } export interface QueryCurrentEpochRequestAmino { - identifier: string; + identifier?: string; } export interface QueryCurrentEpochRequestAminoMsg { type: "osmosis/epochs/query-current-epoch-request"; @@ -53,7 +55,7 @@ export interface QueryCurrentEpochResponseProtoMsg { value: Uint8Array; } export interface QueryCurrentEpochResponseAmino { - current_epoch: string; + current_epoch?: string; } export interface QueryCurrentEpochResponseAminoMsg { type: "osmosis/epochs/query-current-epoch-response"; @@ -67,6 +69,16 @@ function createBaseQueryEpochsInfoRequest(): QueryEpochsInfoRequest { } export const QueryEpochsInfoRequest = { typeUrl: "/osmosis.epochs.v1beta1.QueryEpochsInfoRequest", + aminoType: "osmosis/epochs/query-epochs-info-request", + is(o: any): o is QueryEpochsInfoRequest { + return o && o.$typeUrl === QueryEpochsInfoRequest.typeUrl; + }, + isSDK(o: any): o is QueryEpochsInfoRequestSDKType { + return o && o.$typeUrl === QueryEpochsInfoRequest.typeUrl; + }, + isAmino(o: any): o is QueryEpochsInfoRequestAmino { + return o && o.$typeUrl === QueryEpochsInfoRequest.typeUrl; + }, encode(_: QueryEpochsInfoRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, @@ -84,12 +96,20 @@ export const QueryEpochsInfoRequest = { } return message; }, + fromJSON(_: any): QueryEpochsInfoRequest { + return {}; + }, + toJSON(_: QueryEpochsInfoRequest): unknown { + const obj: any = {}; + return obj; + }, fromPartial(_: Partial): QueryEpochsInfoRequest { const message = createBaseQueryEpochsInfoRequest(); return message; }, fromAmino(_: QueryEpochsInfoRequestAmino): QueryEpochsInfoRequest { - return {}; + const message = createBaseQueryEpochsInfoRequest(); + return message; }, toAmino(_: QueryEpochsInfoRequest): QueryEpochsInfoRequestAmino { const obj: any = {}; @@ -117,6 +137,8 @@ export const QueryEpochsInfoRequest = { }; } }; +GlobalDecoderRegistry.register(QueryEpochsInfoRequest.typeUrl, QueryEpochsInfoRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryEpochsInfoRequest.aminoType, QueryEpochsInfoRequest.typeUrl); function createBaseQueryEpochsInfoResponse(): QueryEpochsInfoResponse { return { epochs: [] @@ -124,6 +146,16 @@ function createBaseQueryEpochsInfoResponse(): QueryEpochsInfoResponse { } export const QueryEpochsInfoResponse = { typeUrl: "/osmosis.epochs.v1beta1.QueryEpochsInfoResponse", + aminoType: "osmosis/epochs/query-epochs-info-response", + is(o: any): o is QueryEpochsInfoResponse { + return o && (o.$typeUrl === QueryEpochsInfoResponse.typeUrl || Array.isArray(o.epochs) && (!o.epochs.length || EpochInfo.is(o.epochs[0]))); + }, + isSDK(o: any): o is QueryEpochsInfoResponseSDKType { + return o && (o.$typeUrl === QueryEpochsInfoResponse.typeUrl || Array.isArray(o.epochs) && (!o.epochs.length || EpochInfo.isSDK(o.epochs[0]))); + }, + isAmino(o: any): o is QueryEpochsInfoResponseAmino { + return o && (o.$typeUrl === QueryEpochsInfoResponse.typeUrl || Array.isArray(o.epochs) && (!o.epochs.length || EpochInfo.isAmino(o.epochs[0]))); + }, encode(message: QueryEpochsInfoResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.epochs) { EpochInfo.encode(v!, writer.uint32(10).fork()).ldelim(); @@ -147,15 +179,29 @@ export const QueryEpochsInfoResponse = { } return message; }, + fromJSON(object: any): QueryEpochsInfoResponse { + return { + epochs: Array.isArray(object?.epochs) ? object.epochs.map((e: any) => EpochInfo.fromJSON(e)) : [] + }; + }, + toJSON(message: QueryEpochsInfoResponse): unknown { + const obj: any = {}; + if (message.epochs) { + obj.epochs = message.epochs.map(e => e ? EpochInfo.toJSON(e) : undefined); + } else { + obj.epochs = []; + } + return obj; + }, fromPartial(object: Partial): QueryEpochsInfoResponse { const message = createBaseQueryEpochsInfoResponse(); message.epochs = object.epochs?.map(e => EpochInfo.fromPartial(e)) || []; return message; }, fromAmino(object: QueryEpochsInfoResponseAmino): QueryEpochsInfoResponse { - return { - epochs: Array.isArray(object?.epochs) ? object.epochs.map((e: any) => EpochInfo.fromAmino(e)) : [] - }; + const message = createBaseQueryEpochsInfoResponse(); + message.epochs = object.epochs?.map(e => EpochInfo.fromAmino(e)) || []; + return message; }, toAmino(message: QueryEpochsInfoResponse): QueryEpochsInfoResponseAmino { const obj: any = {}; @@ -188,6 +234,8 @@ export const QueryEpochsInfoResponse = { }; } }; +GlobalDecoderRegistry.register(QueryEpochsInfoResponse.typeUrl, QueryEpochsInfoResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryEpochsInfoResponse.aminoType, QueryEpochsInfoResponse.typeUrl); function createBaseQueryCurrentEpochRequest(): QueryCurrentEpochRequest { return { identifier: "" @@ -195,6 +243,16 @@ function createBaseQueryCurrentEpochRequest(): QueryCurrentEpochRequest { } export const QueryCurrentEpochRequest = { typeUrl: "/osmosis.epochs.v1beta1.QueryCurrentEpochRequest", + aminoType: "osmosis/epochs/query-current-epoch-request", + is(o: any): o is QueryCurrentEpochRequest { + return o && (o.$typeUrl === QueryCurrentEpochRequest.typeUrl || typeof o.identifier === "string"); + }, + isSDK(o: any): o is QueryCurrentEpochRequestSDKType { + return o && (o.$typeUrl === QueryCurrentEpochRequest.typeUrl || typeof o.identifier === "string"); + }, + isAmino(o: any): o is QueryCurrentEpochRequestAmino { + return o && (o.$typeUrl === QueryCurrentEpochRequest.typeUrl || typeof o.identifier === "string"); + }, encode(message: QueryCurrentEpochRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.identifier !== "") { writer.uint32(10).string(message.identifier); @@ -218,15 +276,27 @@ export const QueryCurrentEpochRequest = { } return message; }, + fromJSON(object: any): QueryCurrentEpochRequest { + return { + identifier: isSet(object.identifier) ? String(object.identifier) : "" + }; + }, + toJSON(message: QueryCurrentEpochRequest): unknown { + const obj: any = {}; + message.identifier !== undefined && (obj.identifier = message.identifier); + return obj; + }, fromPartial(object: Partial): QueryCurrentEpochRequest { const message = createBaseQueryCurrentEpochRequest(); message.identifier = object.identifier ?? ""; return message; }, fromAmino(object: QueryCurrentEpochRequestAmino): QueryCurrentEpochRequest { - return { - identifier: object.identifier - }; + const message = createBaseQueryCurrentEpochRequest(); + if (object.identifier !== undefined && object.identifier !== null) { + message.identifier = object.identifier; + } + return message; }, toAmino(message: QueryCurrentEpochRequest): QueryCurrentEpochRequestAmino { const obj: any = {}; @@ -255,6 +325,8 @@ export const QueryCurrentEpochRequest = { }; } }; +GlobalDecoderRegistry.register(QueryCurrentEpochRequest.typeUrl, QueryCurrentEpochRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryCurrentEpochRequest.aminoType, QueryCurrentEpochRequest.typeUrl); function createBaseQueryCurrentEpochResponse(): QueryCurrentEpochResponse { return { currentEpoch: BigInt(0) @@ -262,6 +334,16 @@ function createBaseQueryCurrentEpochResponse(): QueryCurrentEpochResponse { } export const QueryCurrentEpochResponse = { typeUrl: "/osmosis.epochs.v1beta1.QueryCurrentEpochResponse", + aminoType: "osmosis/epochs/query-current-epoch-response", + is(o: any): o is QueryCurrentEpochResponse { + return o && (o.$typeUrl === QueryCurrentEpochResponse.typeUrl || typeof o.currentEpoch === "bigint"); + }, + isSDK(o: any): o is QueryCurrentEpochResponseSDKType { + return o && (o.$typeUrl === QueryCurrentEpochResponse.typeUrl || typeof o.current_epoch === "bigint"); + }, + isAmino(o: any): o is QueryCurrentEpochResponseAmino { + return o && (o.$typeUrl === QueryCurrentEpochResponse.typeUrl || typeof o.current_epoch === "bigint"); + }, encode(message: QueryCurrentEpochResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.currentEpoch !== BigInt(0)) { writer.uint32(8).int64(message.currentEpoch); @@ -285,15 +367,27 @@ export const QueryCurrentEpochResponse = { } return message; }, + fromJSON(object: any): QueryCurrentEpochResponse { + return { + currentEpoch: isSet(object.currentEpoch) ? BigInt(object.currentEpoch.toString()) : BigInt(0) + }; + }, + toJSON(message: QueryCurrentEpochResponse): unknown { + const obj: any = {}; + message.currentEpoch !== undefined && (obj.currentEpoch = (message.currentEpoch || BigInt(0)).toString()); + return obj; + }, fromPartial(object: Partial): QueryCurrentEpochResponse { const message = createBaseQueryCurrentEpochResponse(); message.currentEpoch = object.currentEpoch !== undefined && object.currentEpoch !== null ? BigInt(object.currentEpoch.toString()) : BigInt(0); return message; }, fromAmino(object: QueryCurrentEpochResponseAmino): QueryCurrentEpochResponse { - return { - currentEpoch: BigInt(object.current_epoch) - }; + const message = createBaseQueryCurrentEpochResponse(); + if (object.current_epoch !== undefined && object.current_epoch !== null) { + message.currentEpoch = BigInt(object.current_epoch); + } + return message; }, toAmino(message: QueryCurrentEpochResponse): QueryCurrentEpochResponseAmino { const obj: any = {}; @@ -321,4 +415,6 @@ export const QueryCurrentEpochResponse = { value: QueryCurrentEpochResponse.encode(message).finish() }; } -}; \ No newline at end of file +}; +GlobalDecoderRegistry.register(QueryCurrentEpochResponse.typeUrl, QueryCurrentEpochResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryCurrentEpochResponse.aminoType, QueryCurrentEpochResponse.typeUrl); \ No newline at end of file diff --git a/packages/osmojs/src/codegen/osmosis/gamm/pool-models/balancer/tx/tx.amino.ts b/packages/osmojs/src/codegen/osmosis/gamm/poolmodels/balancer/v1beta1/tx.amino.ts similarity index 100% rename from packages/osmojs/src/codegen/osmosis/gamm/pool-models/balancer/tx/tx.amino.ts rename to packages/osmojs/src/codegen/osmosis/gamm/poolmodels/balancer/v1beta1/tx.amino.ts diff --git a/packages/osmojs/src/codegen/osmosis/gamm/pool-models/balancer/tx/tx.registry.ts b/packages/osmojs/src/codegen/osmosis/gamm/poolmodels/balancer/v1beta1/tx.registry.ts similarity index 71% rename from packages/osmojs/src/codegen/osmosis/gamm/pool-models/balancer/tx/tx.registry.ts rename to packages/osmojs/src/codegen/osmosis/gamm/poolmodels/balancer/v1beta1/tx.registry.ts index ded2bd788..ec61ee16d 100644 --- a/packages/osmojs/src/codegen/osmosis/gamm/pool-models/balancer/tx/tx.registry.ts +++ b/packages/osmojs/src/codegen/osmosis/gamm/poolmodels/balancer/v1beta1/tx.registry.ts @@ -24,6 +24,22 @@ export const MessageComposer = { }; } }, + toJSON: { + createBalancerPool(value: MsgCreateBalancerPool) { + return { + typeUrl: "/osmosis.gamm.poolmodels.balancer.v1beta1.MsgCreateBalancerPool", + value: MsgCreateBalancerPool.toJSON(value) + }; + } + }, + fromJSON: { + createBalancerPool(value: any) { + return { + typeUrl: "/osmosis.gamm.poolmodels.balancer.v1beta1.MsgCreateBalancerPool", + value: MsgCreateBalancerPool.fromJSON(value) + }; + } + }, fromPartial: { createBalancerPool(value: MsgCreateBalancerPool) { return { diff --git a/packages/osmojs/src/codegen/osmosis/gamm/pool-models/balancer/tx/tx.rpc.msg.ts b/packages/osmojs/src/codegen/osmosis/gamm/poolmodels/balancer/v1beta1/tx.rpc.msg.ts similarity index 90% rename from packages/osmojs/src/codegen/osmosis/gamm/pool-models/balancer/tx/tx.rpc.msg.ts rename to packages/osmojs/src/codegen/osmosis/gamm/poolmodels/balancer/v1beta1/tx.rpc.msg.ts index 049dae353..277653d3e 100644 --- a/packages/osmojs/src/codegen/osmosis/gamm/pool-models/balancer/tx/tx.rpc.msg.ts +++ b/packages/osmojs/src/codegen/osmosis/gamm/poolmodels/balancer/v1beta1/tx.rpc.msg.ts @@ -15,4 +15,7 @@ export class MsgClientImpl implements Msg { const promise = this.rpc.request("osmosis.gamm.poolmodels.balancer.v1beta1.Msg", "CreateBalancerPool", data); return promise.then(data => MsgCreateBalancerPoolResponse.decode(new BinaryReader(data))); } -} \ No newline at end of file +} +export const createClientImpl = (rpc: Rpc) => { + return new MsgClientImpl(rpc); +}; \ No newline at end of file diff --git a/packages/osmojs/src/codegen/osmosis/gamm/pool-models/balancer/tx/tx.ts b/packages/osmojs/src/codegen/osmosis/gamm/poolmodels/balancer/v1beta1/tx.ts similarity index 64% rename from packages/osmojs/src/codegen/osmosis/gamm/pool-models/balancer/tx/tx.ts rename to packages/osmojs/src/codegen/osmosis/gamm/poolmodels/balancer/v1beta1/tx.ts index 3d78e1c37..298508fc2 100644 --- a/packages/osmojs/src/codegen/osmosis/gamm/pool-models/balancer/tx/tx.ts +++ b/packages/osmojs/src/codegen/osmosis/gamm/poolmodels/balancer/v1beta1/tx.ts @@ -1,9 +1,11 @@ -import { PoolParams, PoolParamsAmino, PoolParamsSDKType, PoolAsset, PoolAssetAmino, PoolAssetSDKType } from "../balancerPool"; +import { PoolParams, PoolParamsAmino, PoolParamsSDKType, PoolAsset, PoolAssetAmino, PoolAssetSDKType } from "../../../v1beta1/balancerPool"; import { BinaryReader, BinaryWriter } from "../../../../../binary"; +import { isSet } from "../../../../../helpers"; +import { GlobalDecoderRegistry } from "../../../../../registry"; /** ===================== MsgCreatePool */ export interface MsgCreateBalancerPool { sender: string; - poolParams: PoolParams; + poolParams?: PoolParams; poolAssets: PoolAsset[]; futurePoolGovernor: string; } @@ -13,10 +15,10 @@ export interface MsgCreateBalancerPoolProtoMsg { } /** ===================== MsgCreatePool */ export interface MsgCreateBalancerPoolAmino { - sender: string; + sender?: string; pool_params?: PoolParamsAmino; - pool_assets: PoolAssetAmino[]; - future_pool_governor: string; + pool_assets?: PoolAssetAmino[]; + future_pool_governor?: string; } export interface MsgCreateBalancerPoolAminoMsg { type: "osmosis/gamm/create-balancer-pool"; @@ -25,7 +27,7 @@ export interface MsgCreateBalancerPoolAminoMsg { /** ===================== MsgCreatePool */ export interface MsgCreateBalancerPoolSDKType { sender: string; - pool_params: PoolParamsSDKType; + pool_params?: PoolParamsSDKType; pool_assets: PoolAssetSDKType[]; future_pool_governor: string; } @@ -39,7 +41,7 @@ export interface MsgCreateBalancerPoolResponseProtoMsg { } /** Returns the poolID */ export interface MsgCreateBalancerPoolResponseAmino { - pool_id: string; + pool_id?: string; } export interface MsgCreateBalancerPoolResponseAminoMsg { type: "osmosis/gamm/poolmodels/balancer/create-balancer-pool-response"; @@ -52,13 +54,23 @@ export interface MsgCreateBalancerPoolResponseSDKType { function createBaseMsgCreateBalancerPool(): MsgCreateBalancerPool { return { sender: "", - poolParams: PoolParams.fromPartial({}), + poolParams: undefined, poolAssets: [], futurePoolGovernor: "" }; } export const MsgCreateBalancerPool = { typeUrl: "/osmosis.gamm.poolmodels.balancer.v1beta1.MsgCreateBalancerPool", + aminoType: "osmosis/gamm/create-balancer-pool", + is(o: any): o is MsgCreateBalancerPool { + return o && (o.$typeUrl === MsgCreateBalancerPool.typeUrl || typeof o.sender === "string" && Array.isArray(o.poolAssets) && (!o.poolAssets.length || PoolAsset.is(o.poolAssets[0])) && typeof o.futurePoolGovernor === "string"); + }, + isSDK(o: any): o is MsgCreateBalancerPoolSDKType { + return o && (o.$typeUrl === MsgCreateBalancerPool.typeUrl || typeof o.sender === "string" && Array.isArray(o.pool_assets) && (!o.pool_assets.length || PoolAsset.isSDK(o.pool_assets[0])) && typeof o.future_pool_governor === "string"); + }, + isAmino(o: any): o is MsgCreateBalancerPoolAmino { + return o && (o.$typeUrl === MsgCreateBalancerPool.typeUrl || typeof o.sender === "string" && Array.isArray(o.pool_assets) && (!o.pool_assets.length || PoolAsset.isAmino(o.pool_assets[0])) && typeof o.future_pool_governor === "string"); + }, encode(message: MsgCreateBalancerPool, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.sender !== "") { writer.uint32(10).string(message.sender); @@ -100,6 +112,26 @@ export const MsgCreateBalancerPool = { } return message; }, + fromJSON(object: any): MsgCreateBalancerPool { + return { + sender: isSet(object.sender) ? String(object.sender) : "", + poolParams: isSet(object.poolParams) ? PoolParams.fromJSON(object.poolParams) : undefined, + poolAssets: Array.isArray(object?.poolAssets) ? object.poolAssets.map((e: any) => PoolAsset.fromJSON(e)) : [], + futurePoolGovernor: isSet(object.futurePoolGovernor) ? String(object.futurePoolGovernor) : "" + }; + }, + toJSON(message: MsgCreateBalancerPool): unknown { + const obj: any = {}; + message.sender !== undefined && (obj.sender = message.sender); + 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); + } else { + obj.poolAssets = []; + } + message.futurePoolGovernor !== undefined && (obj.futurePoolGovernor = message.futurePoolGovernor); + return obj; + }, fromPartial(object: Partial): MsgCreateBalancerPool { const message = createBaseMsgCreateBalancerPool(); message.sender = object.sender ?? ""; @@ -109,12 +141,18 @@ export const MsgCreateBalancerPool = { return message; }, fromAmino(object: MsgCreateBalancerPoolAmino): MsgCreateBalancerPool { - return { - sender: object.sender, - poolParams: object?.pool_params ? PoolParams.fromAmino(object.pool_params) : undefined, - poolAssets: Array.isArray(object?.pool_assets) ? object.pool_assets.map((e: any) => PoolAsset.fromAmino(e)) : [], - futurePoolGovernor: object.future_pool_governor - }; + const message = createBaseMsgCreateBalancerPool(); + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + if (object.pool_params !== undefined && object.pool_params !== null) { + message.poolParams = PoolParams.fromAmino(object.pool_params); + } + message.poolAssets = object.pool_assets?.map(e => PoolAsset.fromAmino(e)) || []; + if (object.future_pool_governor !== undefined && object.future_pool_governor !== null) { + message.futurePoolGovernor = object.future_pool_governor; + } + return message; }, toAmino(message: MsgCreateBalancerPool): MsgCreateBalancerPoolAmino { const obj: any = {}; @@ -150,6 +188,8 @@ export const MsgCreateBalancerPool = { }; } }; +GlobalDecoderRegistry.register(MsgCreateBalancerPool.typeUrl, MsgCreateBalancerPool); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgCreateBalancerPool.aminoType, MsgCreateBalancerPool.typeUrl); function createBaseMsgCreateBalancerPoolResponse(): MsgCreateBalancerPoolResponse { return { poolId: BigInt(0) @@ -157,6 +197,16 @@ function createBaseMsgCreateBalancerPoolResponse(): MsgCreateBalancerPoolRespons } export const MsgCreateBalancerPoolResponse = { typeUrl: "/osmosis.gamm.poolmodels.balancer.v1beta1.MsgCreateBalancerPoolResponse", + aminoType: "osmosis/gamm/poolmodels/balancer/create-balancer-pool-response", + is(o: any): o is MsgCreateBalancerPoolResponse { + return o && (o.$typeUrl === MsgCreateBalancerPoolResponse.typeUrl || typeof o.poolId === "bigint"); + }, + isSDK(o: any): o is MsgCreateBalancerPoolResponseSDKType { + return o && (o.$typeUrl === MsgCreateBalancerPoolResponse.typeUrl || typeof o.pool_id === "bigint"); + }, + isAmino(o: any): o is MsgCreateBalancerPoolResponseAmino { + return o && (o.$typeUrl === MsgCreateBalancerPoolResponse.typeUrl || typeof o.pool_id === "bigint"); + }, encode(message: MsgCreateBalancerPoolResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.poolId !== BigInt(0)) { writer.uint32(8).uint64(message.poolId); @@ -180,15 +230,27 @@ export const MsgCreateBalancerPoolResponse = { } return message; }, + fromJSON(object: any): MsgCreateBalancerPoolResponse { + return { + poolId: isSet(object.poolId) ? BigInt(object.poolId.toString()) : BigInt(0) + }; + }, + toJSON(message: MsgCreateBalancerPoolResponse): unknown { + const obj: any = {}; + message.poolId !== undefined && (obj.poolId = (message.poolId || BigInt(0)).toString()); + return obj; + }, fromPartial(object: Partial): MsgCreateBalancerPoolResponse { const message = createBaseMsgCreateBalancerPoolResponse(); message.poolId = object.poolId !== undefined && object.poolId !== null ? BigInt(object.poolId.toString()) : BigInt(0); return message; }, fromAmino(object: MsgCreateBalancerPoolResponseAmino): MsgCreateBalancerPoolResponse { - return { - poolId: BigInt(object.pool_id) - }; + const message = createBaseMsgCreateBalancerPoolResponse(); + if (object.pool_id !== undefined && object.pool_id !== null) { + message.poolId = BigInt(object.pool_id); + } + return message; }, toAmino(message: MsgCreateBalancerPoolResponse): MsgCreateBalancerPoolResponseAmino { const obj: any = {}; @@ -216,4 +278,6 @@ export const MsgCreateBalancerPoolResponse = { value: MsgCreateBalancerPoolResponse.encode(message).finish() }; } -}; \ No newline at end of file +}; +GlobalDecoderRegistry.register(MsgCreateBalancerPoolResponse.typeUrl, MsgCreateBalancerPoolResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgCreateBalancerPoolResponse.aminoType, MsgCreateBalancerPoolResponse.typeUrl); \ No newline at end of file diff --git a/packages/osmojs/src/codegen/osmosis/gamm/pool-models/stableswap/stableswap_pool.ts b/packages/osmojs/src/codegen/osmosis/gamm/poolmodels/stableswap/v1beta1/stableswap_pool.ts similarity index 63% rename from packages/osmojs/src/codegen/osmosis/gamm/pool-models/stableswap/stableswap_pool.ts rename to packages/osmojs/src/codegen/osmosis/gamm/poolmodels/stableswap/v1beta1/stableswap_pool.ts index 6b55d4606..8e1407f4f 100644 --- a/packages/osmojs/src/codegen/osmosis/gamm/pool-models/stableswap/stableswap_pool.ts +++ b/packages/osmojs/src/codegen/osmosis/gamm/poolmodels/stableswap/v1beta1/stableswap_pool.ts @@ -1,6 +1,8 @@ -import { Coin, CoinAmino, CoinSDKType } from "../../../../cosmos/base/v1beta1/coin"; -import { BinaryReader, BinaryWriter } from "../../../../binary"; +import { Coin, CoinAmino, CoinSDKType } from "../../../../../cosmos/base/v1beta1/coin"; +import { BinaryReader, BinaryWriter } from "../../../../../binary"; import { Decimal } from "@cosmjs/math"; +import { isSet } from "../../../../../helpers"; +import { GlobalDecoderRegistry } from "../../../../../registry"; /** * PoolParams defined the parameters that will be managed by the pool * governance in the future. This params are not managed by the chain @@ -27,13 +29,13 @@ export interface PoolParamsProtoMsg { * The pool's token holders are specified in future_pool_governor. */ export interface PoolParamsAmino { - swap_fee: string; + swap_fee?: string; /** * N.B.: exit fee is disabled during pool creation in x/poolmanager. While old * pools can maintain a non-zero fee. No new pool can be created with non-zero * fee anymore */ - exit_fee: string; + exit_fee?: string; } export interface PoolParamsAminoMsg { type: "osmosis/gamm/StableswapPoolParams"; @@ -51,7 +53,7 @@ export interface PoolParamsSDKType { } /** Pool is the stableswap Pool struct */ export interface Pool { - $typeUrl?: string; + $typeUrl?: "/osmosis.gamm.poolmodels.stableswap.v1beta1.Pool"; address: string; id: bigint; poolParams: PoolParams; @@ -81,8 +83,8 @@ export interface PoolProtoMsg { } /** Pool is the stableswap Pool struct */ export interface PoolAmino { - address: string; - id: string; + address?: string; + id?: string; pool_params?: PoolParamsAmino; /** * This string specifies who will govern the pool in the future. @@ -94,15 +96,15 @@ export interface PoolAmino { * a time specified as 0w,1w,2w, etc. which specifies how long the token * would need to be locked up to count in governance. 0w means no lockup. */ - future_pool_governor: string; + future_pool_governor?: string; /** sum of all LP shares */ total_shares?: CoinAmino; /** assets in the pool */ - pool_liquidity: CoinAmino[]; + pool_liquidity?: CoinAmino[]; /** for calculation amognst assets with different precisions */ - scaling_factors: string[]; + scaling_factors?: string[]; /** scaling_factor_controller is the address can adjust pool scaling factors */ - scaling_factor_controller: string; + scaling_factor_controller?: string; } export interface PoolAminoMsg { type: "osmosis/gamm/StableswapPool"; @@ -110,7 +112,7 @@ export interface PoolAminoMsg { } /** Pool is the stableswap Pool struct */ export interface PoolSDKType { - $typeUrl?: string; + $typeUrl?: "/osmosis.gamm.poolmodels.stableswap.v1beta1.Pool"; address: string; id: bigint; pool_params: PoolParamsSDKType; @@ -128,6 +130,16 @@ function createBasePoolParams(): PoolParams { } export const PoolParams = { typeUrl: "/osmosis.gamm.poolmodels.stableswap.v1beta1.PoolParams", + aminoType: "osmosis/gamm/StableswapPoolParams", + is(o: any): o is PoolParams { + return o && (o.$typeUrl === PoolParams.typeUrl || typeof o.swapFee === "string" && typeof o.exitFee === "string"); + }, + isSDK(o: any): o is PoolParamsSDKType { + return o && (o.$typeUrl === PoolParams.typeUrl || typeof o.swap_fee === "string" && typeof o.exit_fee === "string"); + }, + isAmino(o: any): o is PoolParamsAmino { + return o && (o.$typeUrl === PoolParams.typeUrl || typeof o.swap_fee === "string" && typeof o.exit_fee === "string"); + }, encode(message: PoolParams, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.swapFee !== "") { writer.uint32(10).string(Decimal.fromUserInput(message.swapFee, 18).atomics); @@ -157,6 +169,18 @@ export const PoolParams = { } return message; }, + fromJSON(object: any): PoolParams { + return { + swapFee: isSet(object.swapFee) ? String(object.swapFee) : "", + exitFee: isSet(object.exitFee) ? String(object.exitFee) : "" + }; + }, + toJSON(message: PoolParams): unknown { + const obj: any = {}; + message.swapFee !== undefined && (obj.swapFee = message.swapFee); + message.exitFee !== undefined && (obj.exitFee = message.exitFee); + return obj; + }, fromPartial(object: Partial): PoolParams { const message = createBasePoolParams(); message.swapFee = object.swapFee ?? ""; @@ -164,10 +188,14 @@ export const PoolParams = { return message; }, fromAmino(object: PoolParamsAmino): PoolParams { - return { - swapFee: object.swap_fee, - exitFee: object.exit_fee - }; + const message = createBasePoolParams(); + if (object.swap_fee !== undefined && object.swap_fee !== null) { + message.swapFee = object.swap_fee; + } + if (object.exit_fee !== undefined && object.exit_fee !== null) { + message.exitFee = object.exit_fee; + } + return message; }, toAmino(message: PoolParams): PoolParamsAmino { const obj: any = {}; @@ -197,6 +225,8 @@ export const PoolParams = { }; } }; +GlobalDecoderRegistry.register(PoolParams.typeUrl, PoolParams); +GlobalDecoderRegistry.registerAminoProtoMapping(PoolParams.aminoType, PoolParams.typeUrl); function createBasePool(): Pool { return { $typeUrl: "/osmosis.gamm.poolmodels.stableswap.v1beta1.Pool", @@ -204,7 +234,7 @@ function createBasePool(): Pool { id: BigInt(0), poolParams: PoolParams.fromPartial({}), futurePoolGovernor: "", - totalShares: undefined, + totalShares: Coin.fromPartial({}), poolLiquidity: [], scalingFactors: [], scalingFactorController: "" @@ -212,6 +242,16 @@ function createBasePool(): Pool { } export const Pool = { typeUrl: "/osmosis.gamm.poolmodels.stableswap.v1beta1.Pool", + aminoType: "osmosis/gamm/StableswapPool", + is(o: any): o is Pool { + return o && (o.$typeUrl === Pool.typeUrl || typeof o.address === "string" && typeof o.id === "bigint" && PoolParams.is(o.poolParams) && typeof o.futurePoolGovernor === "string" && Coin.is(o.totalShares) && Array.isArray(o.poolLiquidity) && (!o.poolLiquidity.length || Coin.is(o.poolLiquidity[0])) && Array.isArray(o.scalingFactors) && (!o.scalingFactors.length || typeof o.scalingFactors[0] === "bigint") && typeof o.scalingFactorController === "string"); + }, + isSDK(o: any): o is PoolSDKType { + return o && (o.$typeUrl === Pool.typeUrl || typeof o.address === "string" && typeof o.id === "bigint" && PoolParams.isSDK(o.pool_params) && typeof o.future_pool_governor === "string" && Coin.isSDK(o.total_shares) && Array.isArray(o.pool_liquidity) && (!o.pool_liquidity.length || Coin.isSDK(o.pool_liquidity[0])) && Array.isArray(o.scaling_factors) && (!o.scaling_factors.length || typeof o.scaling_factors[0] === "bigint") && typeof o.scaling_factor_controller === "string"); + }, + isAmino(o: any): o is PoolAmino { + return o && (o.$typeUrl === Pool.typeUrl || typeof o.address === "string" && typeof o.id === "bigint" && PoolParams.isAmino(o.pool_params) && typeof o.future_pool_governor === "string" && Coin.isAmino(o.total_shares) && Array.isArray(o.pool_liquidity) && (!o.pool_liquidity.length || Coin.isAmino(o.pool_liquidity[0])) && Array.isArray(o.scaling_factors) && (!o.scaling_factors.length || typeof o.scaling_factors[0] === "bigint") && typeof o.scaling_factor_controller === "string"); + }, encode(message: Pool, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.address !== "") { writer.uint32(10).string(message.address); @@ -286,6 +326,38 @@ export const Pool = { } return message; }, + fromJSON(object: any): Pool { + return { + address: isSet(object.address) ? String(object.address) : "", + id: isSet(object.id) ? BigInt(object.id.toString()) : BigInt(0), + poolParams: isSet(object.poolParams) ? PoolParams.fromJSON(object.poolParams) : undefined, + futurePoolGovernor: isSet(object.futurePoolGovernor) ? String(object.futurePoolGovernor) : "", + totalShares: isSet(object.totalShares) ? Coin.fromJSON(object.totalShares) : undefined, + poolLiquidity: Array.isArray(object?.poolLiquidity) ? object.poolLiquidity.map((e: any) => Coin.fromJSON(e)) : [], + scalingFactors: Array.isArray(object?.scalingFactors) ? object.scalingFactors.map((e: any) => BigInt(e.toString())) : [], + scalingFactorController: isSet(object.scalingFactorController) ? String(object.scalingFactorController) : "" + }; + }, + toJSON(message: Pool): unknown { + const obj: any = {}; + message.address !== undefined && (obj.address = message.address); + message.id !== undefined && (obj.id = (message.id || BigInt(0)).toString()); + message.poolParams !== undefined && (obj.poolParams = message.poolParams ? PoolParams.toJSON(message.poolParams) : undefined); + message.futurePoolGovernor !== undefined && (obj.futurePoolGovernor = message.futurePoolGovernor); + message.totalShares !== undefined && (obj.totalShares = message.totalShares ? Coin.toJSON(message.totalShares) : undefined); + if (message.poolLiquidity) { + obj.poolLiquidity = message.poolLiquidity.map(e => e ? Coin.toJSON(e) : undefined); + } else { + obj.poolLiquidity = []; + } + if (message.scalingFactors) { + obj.scalingFactors = message.scalingFactors.map(e => (e || BigInt(0)).toString()); + } else { + obj.scalingFactors = []; + } + message.scalingFactorController !== undefined && (obj.scalingFactorController = message.scalingFactorController); + return obj; + }, fromPartial(object: Partial): Pool { const message = createBasePool(); message.address = object.address ?? ""; @@ -299,16 +371,28 @@ export const Pool = { return message; }, fromAmino(object: PoolAmino): Pool { - return { - address: object.address, - id: BigInt(object.id), - poolParams: object?.pool_params ? PoolParams.fromAmino(object.pool_params) : undefined, - futurePoolGovernor: object.future_pool_governor, - totalShares: object?.total_shares ? Coin.fromAmino(object.total_shares) : undefined, - poolLiquidity: Array.isArray(object?.pool_liquidity) ? object.pool_liquidity.map((e: any) => Coin.fromAmino(e)) : [], - scalingFactors: Array.isArray(object?.scaling_factors) ? object.scaling_factors.map((e: any) => BigInt(e)) : [], - scalingFactorController: object.scaling_factor_controller - }; + const message = createBasePool(); + if (object.address !== undefined && object.address !== null) { + message.address = object.address; + } + if (object.id !== undefined && object.id !== null) { + message.id = BigInt(object.id); + } + if (object.pool_params !== undefined && object.pool_params !== null) { + message.poolParams = PoolParams.fromAmino(object.pool_params); + } + if (object.future_pool_governor !== undefined && object.future_pool_governor !== null) { + message.futurePoolGovernor = object.future_pool_governor; + } + if (object.total_shares !== undefined && object.total_shares !== null) { + message.totalShares = Coin.fromAmino(object.total_shares); + } + message.poolLiquidity = object.pool_liquidity?.map(e => Coin.fromAmino(e)) || []; + message.scalingFactors = object.scaling_factors?.map(e => BigInt(e)) || []; + if (object.scaling_factor_controller !== undefined && object.scaling_factor_controller !== null) { + message.scalingFactorController = object.scaling_factor_controller; + } + return message; }, toAmino(message: Pool): PoolAmino { const obj: any = {}; @@ -351,4 +435,6 @@ export const Pool = { value: Pool.encode(message).finish() }; } -}; \ No newline at end of file +}; +GlobalDecoderRegistry.register(Pool.typeUrl, Pool); +GlobalDecoderRegistry.registerAminoProtoMapping(Pool.aminoType, Pool.typeUrl); \ No newline at end of file diff --git a/packages/osmojs/src/codegen/osmosis/gamm/pool-models/stableswap/tx.amino.ts b/packages/osmojs/src/codegen/osmosis/gamm/poolmodels/stableswap/v1beta1/tx.amino.ts similarity index 100% rename from packages/osmojs/src/codegen/osmosis/gamm/pool-models/stableswap/tx.amino.ts rename to packages/osmojs/src/codegen/osmosis/gamm/poolmodels/stableswap/v1beta1/tx.amino.ts diff --git a/packages/osmojs/src/codegen/osmosis/gamm/pool-models/stableswap/tx.registry.ts b/packages/osmojs/src/codegen/osmosis/gamm/poolmodels/stableswap/v1beta1/tx.registry.ts similarity index 68% rename from packages/osmojs/src/codegen/osmosis/gamm/pool-models/stableswap/tx.registry.ts rename to packages/osmojs/src/codegen/osmosis/gamm/poolmodels/stableswap/v1beta1/tx.registry.ts index 23224dbe7..6389615d9 100644 --- a/packages/osmojs/src/codegen/osmosis/gamm/pool-models/stableswap/tx.registry.ts +++ b/packages/osmojs/src/codegen/osmosis/gamm/poolmodels/stableswap/v1beta1/tx.registry.ts @@ -36,6 +36,34 @@ export const MessageComposer = { }; } }, + toJSON: { + createStableswapPool(value: MsgCreateStableswapPool) { + return { + typeUrl: "/osmosis.gamm.poolmodels.stableswap.v1beta1.MsgCreateStableswapPool", + value: MsgCreateStableswapPool.toJSON(value) + }; + }, + stableSwapAdjustScalingFactors(value: MsgStableSwapAdjustScalingFactors) { + return { + typeUrl: "/osmosis.gamm.poolmodels.stableswap.v1beta1.MsgStableSwapAdjustScalingFactors", + value: MsgStableSwapAdjustScalingFactors.toJSON(value) + }; + } + }, + fromJSON: { + createStableswapPool(value: any) { + return { + typeUrl: "/osmosis.gamm.poolmodels.stableswap.v1beta1.MsgCreateStableswapPool", + value: MsgCreateStableswapPool.fromJSON(value) + }; + }, + stableSwapAdjustScalingFactors(value: any) { + return { + typeUrl: "/osmosis.gamm.poolmodels.stableswap.v1beta1.MsgStableSwapAdjustScalingFactors", + value: MsgStableSwapAdjustScalingFactors.fromJSON(value) + }; + } + }, fromPartial: { createStableswapPool(value: MsgCreateStableswapPool) { return { diff --git a/packages/osmo-query/src/codegen/osmosis/gamm/pool-models/stableswap/tx.rpc.msg.ts b/packages/osmojs/src/codegen/osmosis/gamm/poolmodels/stableswap/v1beta1/tx.rpc.msg.ts similarity index 89% rename from packages/osmo-query/src/codegen/osmosis/gamm/pool-models/stableswap/tx.rpc.msg.ts rename to packages/osmojs/src/codegen/osmosis/gamm/poolmodels/stableswap/v1beta1/tx.rpc.msg.ts index 94f40063e..f7b87b4b2 100644 --- a/packages/osmo-query/src/codegen/osmosis/gamm/pool-models/stableswap/tx.rpc.msg.ts +++ b/packages/osmojs/src/codegen/osmosis/gamm/poolmodels/stableswap/v1beta1/tx.rpc.msg.ts @@ -1,5 +1,5 @@ -import { Rpc } from "../../../../helpers"; -import { BinaryReader } from "../../../../binary"; +import { Rpc } from "../../../../../helpers"; +import { BinaryReader } from "../../../../../binary"; import { MsgCreateStableswapPool, MsgCreateStableswapPoolResponse, MsgStableSwapAdjustScalingFactors, MsgStableSwapAdjustScalingFactorsResponse } from "./tx"; export interface Msg { createStableswapPool(request: MsgCreateStableswapPool): Promise; @@ -22,4 +22,7 @@ export class MsgClientImpl implements Msg { const promise = this.rpc.request("osmosis.gamm.poolmodels.stableswap.v1beta1.Msg", "StableSwapAdjustScalingFactors", data); return promise.then(data => MsgStableSwapAdjustScalingFactorsResponse.decode(new BinaryReader(data))); } -} \ No newline at end of file +} +export const createClientImpl = (rpc: Rpc) => { + return new MsgClientImpl(rpc); +}; \ No newline at end of file diff --git a/packages/osmojs/src/codegen/osmosis/gamm/pool-models/stableswap/tx.ts b/packages/osmojs/src/codegen/osmosis/gamm/poolmodels/stableswap/v1beta1/tx.ts similarity index 64% rename from packages/osmojs/src/codegen/osmosis/gamm/pool-models/stableswap/tx.ts rename to packages/osmojs/src/codegen/osmosis/gamm/poolmodels/stableswap/v1beta1/tx.ts index d2dcc0230..b0cc2f8f7 100644 --- a/packages/osmojs/src/codegen/osmosis/gamm/pool-models/stableswap/tx.ts +++ b/packages/osmojs/src/codegen/osmosis/gamm/poolmodels/stableswap/v1beta1/tx.ts @@ -1,10 +1,12 @@ import { PoolParams, PoolParamsAmino, PoolParamsSDKType } from "./stableswap_pool"; -import { Coin, CoinAmino, CoinSDKType } from "../../../../cosmos/base/v1beta1/coin"; -import { BinaryReader, BinaryWriter } from "../../../../binary"; +import { Coin, CoinAmino, CoinSDKType } from "../../../../../cosmos/base/v1beta1/coin"; +import { BinaryReader, BinaryWriter } from "../../../../../binary"; +import { isSet } from "../../../../../helpers"; +import { GlobalDecoderRegistry } from "../../../../../registry"; /** ===================== MsgCreatePool */ export interface MsgCreateStableswapPool { sender: string; - poolParams: PoolParams; + poolParams?: PoolParams; initialPoolLiquidity: Coin[]; scalingFactors: bigint[]; futurePoolGovernor: string; @@ -16,12 +18,12 @@ export interface MsgCreateStableswapPoolProtoMsg { } /** ===================== MsgCreatePool */ export interface MsgCreateStableswapPoolAmino { - sender: string; + sender?: string; pool_params?: PoolParamsAmino; - initial_pool_liquidity: CoinAmino[]; - scaling_factors: string[]; - future_pool_governor: string; - scaling_factor_controller: string; + initial_pool_liquidity?: CoinAmino[]; + scaling_factors?: string[]; + future_pool_governor?: string; + scaling_factor_controller?: string; } export interface MsgCreateStableswapPoolAminoMsg { type: "osmosis/gamm/create-stableswap-pool"; @@ -30,7 +32,7 @@ export interface MsgCreateStableswapPoolAminoMsg { /** ===================== MsgCreatePool */ export interface MsgCreateStableswapPoolSDKType { sender: string; - pool_params: PoolParamsSDKType; + pool_params?: PoolParamsSDKType; initial_pool_liquidity: CoinSDKType[]; scaling_factors: bigint[]; future_pool_governor: string; @@ -46,7 +48,7 @@ export interface MsgCreateStableswapPoolResponseProtoMsg { } /** Returns a poolID with custom poolName. */ export interface MsgCreateStableswapPoolResponseAmino { - pool_id: string; + pool_id?: string; } export interface MsgCreateStableswapPoolResponseAminoMsg { type: "osmosis/gamm/create-stableswap-pool-response"; @@ -74,9 +76,9 @@ export interface MsgStableSwapAdjustScalingFactorsProtoMsg { * succeed. Adjusts stableswap scaling factors. */ export interface MsgStableSwapAdjustScalingFactorsAmino { - sender: string; - pool_id: string; - scaling_factors: string[]; + sender?: string; + pool_id?: string; + scaling_factors?: string[]; } export interface MsgStableSwapAdjustScalingFactorsAminoMsg { type: "osmosis/gamm/stableswap-adjust-scaling-factors"; @@ -105,7 +107,7 @@ export interface MsgStableSwapAdjustScalingFactorsResponseSDKType {} function createBaseMsgCreateStableswapPool(): MsgCreateStableswapPool { return { sender: "", - poolParams: PoolParams.fromPartial({}), + poolParams: undefined, initialPoolLiquidity: [], scalingFactors: [], futurePoolGovernor: "", @@ -114,6 +116,16 @@ function createBaseMsgCreateStableswapPool(): MsgCreateStableswapPool { } export const MsgCreateStableswapPool = { typeUrl: "/osmosis.gamm.poolmodels.stableswap.v1beta1.MsgCreateStableswapPool", + aminoType: "osmosis/gamm/create-stableswap-pool", + is(o: any): o is MsgCreateStableswapPool { + return o && (o.$typeUrl === MsgCreateStableswapPool.typeUrl || typeof o.sender === "string" && Array.isArray(o.initialPoolLiquidity) && (!o.initialPoolLiquidity.length || Coin.is(o.initialPoolLiquidity[0])) && Array.isArray(o.scalingFactors) && (!o.scalingFactors.length || typeof o.scalingFactors[0] === "bigint") && typeof o.futurePoolGovernor === "string" && typeof o.scalingFactorController === "string"); + }, + isSDK(o: any): o is MsgCreateStableswapPoolSDKType { + return o && (o.$typeUrl === MsgCreateStableswapPool.typeUrl || typeof o.sender === "string" && Array.isArray(o.initial_pool_liquidity) && (!o.initial_pool_liquidity.length || Coin.isSDK(o.initial_pool_liquidity[0])) && Array.isArray(o.scaling_factors) && (!o.scaling_factors.length || typeof o.scaling_factors[0] === "bigint") && typeof o.future_pool_governor === "string" && typeof o.scaling_factor_controller === "string"); + }, + isAmino(o: any): o is MsgCreateStableswapPoolAmino { + return o && (o.$typeUrl === MsgCreateStableswapPool.typeUrl || typeof o.sender === "string" && Array.isArray(o.initial_pool_liquidity) && (!o.initial_pool_liquidity.length || Coin.isAmino(o.initial_pool_liquidity[0])) && Array.isArray(o.scaling_factors) && (!o.scaling_factors.length || typeof o.scaling_factors[0] === "bigint") && typeof o.future_pool_governor === "string" && typeof o.scaling_factor_controller === "string"); + }, encode(message: MsgCreateStableswapPool, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.sender !== "") { writer.uint32(10).string(message.sender); @@ -176,6 +188,34 @@ export const MsgCreateStableswapPool = { } return message; }, + fromJSON(object: any): MsgCreateStableswapPool { + return { + sender: isSet(object.sender) ? String(object.sender) : "", + poolParams: isSet(object.poolParams) ? PoolParams.fromJSON(object.poolParams) : undefined, + initialPoolLiquidity: Array.isArray(object?.initialPoolLiquidity) ? object.initialPoolLiquidity.map((e: any) => Coin.fromJSON(e)) : [], + scalingFactors: Array.isArray(object?.scalingFactors) ? object.scalingFactors.map((e: any) => BigInt(e.toString())) : [], + futurePoolGovernor: isSet(object.futurePoolGovernor) ? String(object.futurePoolGovernor) : "", + scalingFactorController: isSet(object.scalingFactorController) ? String(object.scalingFactorController) : "" + }; + }, + toJSON(message: MsgCreateStableswapPool): unknown { + const obj: any = {}; + message.sender !== undefined && (obj.sender = message.sender); + message.poolParams !== undefined && (obj.poolParams = message.poolParams ? PoolParams.toJSON(message.poolParams) : undefined); + if (message.initialPoolLiquidity) { + obj.initialPoolLiquidity = message.initialPoolLiquidity.map(e => e ? Coin.toJSON(e) : undefined); + } else { + obj.initialPoolLiquidity = []; + } + if (message.scalingFactors) { + obj.scalingFactors = message.scalingFactors.map(e => (e || BigInt(0)).toString()); + } else { + obj.scalingFactors = []; + } + message.futurePoolGovernor !== undefined && (obj.futurePoolGovernor = message.futurePoolGovernor); + message.scalingFactorController !== undefined && (obj.scalingFactorController = message.scalingFactorController); + return obj; + }, fromPartial(object: Partial): MsgCreateStableswapPool { const message = createBaseMsgCreateStableswapPool(); message.sender = object.sender ?? ""; @@ -187,14 +227,22 @@ export const MsgCreateStableswapPool = { return message; }, fromAmino(object: MsgCreateStableswapPoolAmino): MsgCreateStableswapPool { - return { - sender: object.sender, - poolParams: object?.pool_params ? PoolParams.fromAmino(object.pool_params) : undefined, - initialPoolLiquidity: Array.isArray(object?.initial_pool_liquidity) ? object.initial_pool_liquidity.map((e: any) => Coin.fromAmino(e)) : [], - scalingFactors: Array.isArray(object?.scaling_factors) ? object.scaling_factors.map((e: any) => BigInt(e)) : [], - futurePoolGovernor: object.future_pool_governor, - scalingFactorController: object.scaling_factor_controller - }; + const message = createBaseMsgCreateStableswapPool(); + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + if (object.pool_params !== undefined && object.pool_params !== null) { + message.poolParams = PoolParams.fromAmino(object.pool_params); + } + message.initialPoolLiquidity = object.initial_pool_liquidity?.map(e => Coin.fromAmino(e)) || []; + message.scalingFactors = object.scaling_factors?.map(e => BigInt(e)) || []; + if (object.future_pool_governor !== undefined && object.future_pool_governor !== null) { + message.futurePoolGovernor = object.future_pool_governor; + } + if (object.scaling_factor_controller !== undefined && object.scaling_factor_controller !== null) { + message.scalingFactorController = object.scaling_factor_controller; + } + return message; }, toAmino(message: MsgCreateStableswapPool): MsgCreateStableswapPoolAmino { const obj: any = {}; @@ -236,6 +284,8 @@ export const MsgCreateStableswapPool = { }; } }; +GlobalDecoderRegistry.register(MsgCreateStableswapPool.typeUrl, MsgCreateStableswapPool); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgCreateStableswapPool.aminoType, MsgCreateStableswapPool.typeUrl); function createBaseMsgCreateStableswapPoolResponse(): MsgCreateStableswapPoolResponse { return { poolId: BigInt(0) @@ -243,6 +293,16 @@ function createBaseMsgCreateStableswapPoolResponse(): MsgCreateStableswapPoolRes } export const MsgCreateStableswapPoolResponse = { typeUrl: "/osmosis.gamm.poolmodels.stableswap.v1beta1.MsgCreateStableswapPoolResponse", + aminoType: "osmosis/gamm/create-stableswap-pool-response", + is(o: any): o is MsgCreateStableswapPoolResponse { + return o && (o.$typeUrl === MsgCreateStableswapPoolResponse.typeUrl || typeof o.poolId === "bigint"); + }, + isSDK(o: any): o is MsgCreateStableswapPoolResponseSDKType { + return o && (o.$typeUrl === MsgCreateStableswapPoolResponse.typeUrl || typeof o.pool_id === "bigint"); + }, + isAmino(o: any): o is MsgCreateStableswapPoolResponseAmino { + return o && (o.$typeUrl === MsgCreateStableswapPoolResponse.typeUrl || typeof o.pool_id === "bigint"); + }, encode(message: MsgCreateStableswapPoolResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.poolId !== BigInt(0)) { writer.uint32(8).uint64(message.poolId); @@ -266,15 +326,27 @@ export const MsgCreateStableswapPoolResponse = { } return message; }, + fromJSON(object: any): MsgCreateStableswapPoolResponse { + return { + poolId: isSet(object.poolId) ? BigInt(object.poolId.toString()) : BigInt(0) + }; + }, + toJSON(message: MsgCreateStableswapPoolResponse): unknown { + const obj: any = {}; + message.poolId !== undefined && (obj.poolId = (message.poolId || BigInt(0)).toString()); + return obj; + }, fromPartial(object: Partial): MsgCreateStableswapPoolResponse { const message = createBaseMsgCreateStableswapPoolResponse(); message.poolId = object.poolId !== undefined && object.poolId !== null ? BigInt(object.poolId.toString()) : BigInt(0); return message; }, fromAmino(object: MsgCreateStableswapPoolResponseAmino): MsgCreateStableswapPoolResponse { - return { - poolId: BigInt(object.pool_id) - }; + const message = createBaseMsgCreateStableswapPoolResponse(); + if (object.pool_id !== undefined && object.pool_id !== null) { + message.poolId = BigInt(object.pool_id); + } + return message; }, toAmino(message: MsgCreateStableswapPoolResponse): MsgCreateStableswapPoolResponseAmino { const obj: any = {}; @@ -303,6 +375,8 @@ export const MsgCreateStableswapPoolResponse = { }; } }; +GlobalDecoderRegistry.register(MsgCreateStableswapPoolResponse.typeUrl, MsgCreateStableswapPoolResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgCreateStableswapPoolResponse.aminoType, MsgCreateStableswapPoolResponse.typeUrl); function createBaseMsgStableSwapAdjustScalingFactors(): MsgStableSwapAdjustScalingFactors { return { sender: "", @@ -312,6 +386,16 @@ function createBaseMsgStableSwapAdjustScalingFactors(): MsgStableSwapAdjustScali } export const MsgStableSwapAdjustScalingFactors = { typeUrl: "/osmosis.gamm.poolmodels.stableswap.v1beta1.MsgStableSwapAdjustScalingFactors", + aminoType: "osmosis/gamm/stableswap-adjust-scaling-factors", + is(o: any): o is MsgStableSwapAdjustScalingFactors { + return o && (o.$typeUrl === MsgStableSwapAdjustScalingFactors.typeUrl || typeof o.sender === "string" && typeof o.poolId === "bigint" && Array.isArray(o.scalingFactors) && (!o.scalingFactors.length || typeof o.scalingFactors[0] === "bigint")); + }, + isSDK(o: any): o is MsgStableSwapAdjustScalingFactorsSDKType { + return o && (o.$typeUrl === MsgStableSwapAdjustScalingFactors.typeUrl || typeof o.sender === "string" && typeof o.pool_id === "bigint" && Array.isArray(o.scaling_factors) && (!o.scaling_factors.length || typeof o.scaling_factors[0] === "bigint")); + }, + isAmino(o: any): o is MsgStableSwapAdjustScalingFactorsAmino { + return o && (o.$typeUrl === MsgStableSwapAdjustScalingFactors.typeUrl || typeof o.sender === "string" && typeof o.pool_id === "bigint" && Array.isArray(o.scaling_factors) && (!o.scaling_factors.length || typeof o.scaling_factors[0] === "bigint")); + }, encode(message: MsgStableSwapAdjustScalingFactors, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.sender !== "") { writer.uint32(10).string(message.sender); @@ -356,6 +440,24 @@ export const MsgStableSwapAdjustScalingFactors = { } return message; }, + fromJSON(object: any): MsgStableSwapAdjustScalingFactors { + return { + sender: isSet(object.sender) ? String(object.sender) : "", + poolId: isSet(object.poolId) ? BigInt(object.poolId.toString()) : BigInt(0), + scalingFactors: Array.isArray(object?.scalingFactors) ? object.scalingFactors.map((e: any) => BigInt(e.toString())) : [] + }; + }, + toJSON(message: MsgStableSwapAdjustScalingFactors): unknown { + const obj: any = {}; + message.sender !== undefined && (obj.sender = message.sender); + message.poolId !== undefined && (obj.poolId = (message.poolId || BigInt(0)).toString()); + if (message.scalingFactors) { + obj.scalingFactors = message.scalingFactors.map(e => (e || BigInt(0)).toString()); + } else { + obj.scalingFactors = []; + } + return obj; + }, fromPartial(object: Partial): MsgStableSwapAdjustScalingFactors { const message = createBaseMsgStableSwapAdjustScalingFactors(); message.sender = object.sender ?? ""; @@ -364,11 +466,15 @@ export const MsgStableSwapAdjustScalingFactors = { return message; }, fromAmino(object: MsgStableSwapAdjustScalingFactorsAmino): MsgStableSwapAdjustScalingFactors { - return { - sender: object.sender, - poolId: BigInt(object.pool_id), - scalingFactors: Array.isArray(object?.scaling_factors) ? object.scaling_factors.map((e: any) => BigInt(e)) : [] - }; + const message = createBaseMsgStableSwapAdjustScalingFactors(); + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + if (object.pool_id !== undefined && object.pool_id !== null) { + message.poolId = BigInt(object.pool_id); + } + message.scalingFactors = object.scaling_factors?.map(e => BigInt(e)) || []; + return message; }, toAmino(message: MsgStableSwapAdjustScalingFactors): MsgStableSwapAdjustScalingFactorsAmino { const obj: any = {}; @@ -403,11 +509,23 @@ export const MsgStableSwapAdjustScalingFactors = { }; } }; +GlobalDecoderRegistry.register(MsgStableSwapAdjustScalingFactors.typeUrl, MsgStableSwapAdjustScalingFactors); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgStableSwapAdjustScalingFactors.aminoType, MsgStableSwapAdjustScalingFactors.typeUrl); function createBaseMsgStableSwapAdjustScalingFactorsResponse(): MsgStableSwapAdjustScalingFactorsResponse { return {}; } export const MsgStableSwapAdjustScalingFactorsResponse = { typeUrl: "/osmosis.gamm.poolmodels.stableswap.v1beta1.MsgStableSwapAdjustScalingFactorsResponse", + aminoType: "osmosis/gamm/stable-swap-adjust-scaling-factors-response", + is(o: any): o is MsgStableSwapAdjustScalingFactorsResponse { + return o && o.$typeUrl === MsgStableSwapAdjustScalingFactorsResponse.typeUrl; + }, + isSDK(o: any): o is MsgStableSwapAdjustScalingFactorsResponseSDKType { + return o && o.$typeUrl === MsgStableSwapAdjustScalingFactorsResponse.typeUrl; + }, + isAmino(o: any): o is MsgStableSwapAdjustScalingFactorsResponseAmino { + return o && o.$typeUrl === MsgStableSwapAdjustScalingFactorsResponse.typeUrl; + }, encode(_: MsgStableSwapAdjustScalingFactorsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, @@ -425,12 +543,20 @@ export const MsgStableSwapAdjustScalingFactorsResponse = { } return message; }, + fromJSON(_: any): MsgStableSwapAdjustScalingFactorsResponse { + return {}; + }, + toJSON(_: MsgStableSwapAdjustScalingFactorsResponse): unknown { + const obj: any = {}; + return obj; + }, fromPartial(_: Partial): MsgStableSwapAdjustScalingFactorsResponse { const message = createBaseMsgStableSwapAdjustScalingFactorsResponse(); return message; }, fromAmino(_: MsgStableSwapAdjustScalingFactorsResponseAmino): MsgStableSwapAdjustScalingFactorsResponse { - return {}; + const message = createBaseMsgStableSwapAdjustScalingFactorsResponse(); + return message; }, toAmino(_: MsgStableSwapAdjustScalingFactorsResponse): MsgStableSwapAdjustScalingFactorsResponseAmino { const obj: any = {}; @@ -457,4 +583,6 @@ export const MsgStableSwapAdjustScalingFactorsResponse = { value: MsgStableSwapAdjustScalingFactorsResponse.encode(message).finish() }; } -}; \ No newline at end of file +}; +GlobalDecoderRegistry.register(MsgStableSwapAdjustScalingFactorsResponse.typeUrl, MsgStableSwapAdjustScalingFactorsResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgStableSwapAdjustScalingFactorsResponse.aminoType, MsgStableSwapAdjustScalingFactorsResponse.typeUrl); \ No newline at end of file diff --git a/packages/osmojs/src/codegen/osmosis/gamm/pool-models/balancer/balancerPool.ts b/packages/osmojs/src/codegen/osmosis/gamm/v1beta1/balancerPool.ts similarity index 67% rename from packages/osmojs/src/codegen/osmosis/gamm/pool-models/balancer/balancerPool.ts rename to packages/osmojs/src/codegen/osmosis/gamm/v1beta1/balancerPool.ts index 68027c7f4..c220e85c3 100644 --- a/packages/osmojs/src/codegen/osmosis/gamm/pool-models/balancer/balancerPool.ts +++ b/packages/osmojs/src/codegen/osmosis/gamm/v1beta1/balancerPool.ts @@ -1,8 +1,9 @@ -import { Timestamp } from "../../../../google/protobuf/timestamp"; -import { Duration, DurationAmino, DurationSDKType } from "../../../../google/protobuf/duration"; -import { Coin, CoinAmino, CoinSDKType } from "../../../../cosmos/base/v1beta1/coin"; -import { BinaryReader, BinaryWriter } from "../../../../binary"; -import { toTimestamp, fromTimestamp } from "../../../../helpers"; +import { Timestamp } from "../../../google/protobuf/timestamp"; +import { Duration, DurationAmino, DurationSDKType } from "../../../google/protobuf/duration"; +import { Coin, CoinAmino, CoinSDKType } from "../../../cosmos/base/v1beta1/coin"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { toTimestamp, fromTimestamp, isSet } from "../../../helpers"; +import { GlobalDecoderRegistry } from "../../../registry"; import { Decimal } from "@cosmjs/math"; /** * Parameters for changing the weights in a balancer pool smoothly from @@ -65,7 +66,7 @@ export interface SmoothWeightChangeParamsAmino { * If a parameter change / pool instantiation leaves this blank, * it should be generated by the state_machine as the current time. */ - start_time?: Date; + start_time?: string; /** Duration for the weights to change over */ duration?: DurationAmino; /** @@ -75,14 +76,14 @@ export interface SmoothWeightChangeParamsAmino { * future type refactorings should just have a type with the denom & weight * here. */ - initial_pool_weights: PoolAssetAmino[]; + initial_pool_weights?: PoolAssetAmino[]; /** * The target pool weights. The pool weights will change linearly with respect * to time between start_time, and start_time + duration. The amount * PoolAsset.token.amount field is ignored if present, future type * refactorings should just have a type with the denom & weight here. */ - target_pool_weights: PoolAssetAmino[]; + target_pool_weights?: PoolAssetAmino[]; } export interface SmoothWeightChangeParamsAminoMsg { type: "osmosis/gamm/smooth-weight-change-params"; @@ -134,13 +135,13 @@ export interface PoolParamsProtoMsg { * The pool's token holders are specified in future_pool_governor. */ export interface PoolParamsAmino { - swap_fee: string; + swap_fee?: string; /** * N.B.: exit fee is disabled during pool creation in x/poolmanager. While old * pools can maintain a non-zero fee. No new pool can be created with non-zero * fee anymore */ - exit_fee: string; + exit_fee?: string; smooth_weight_change_params?: SmoothWeightChangeParamsAmino; } export interface PoolParamsAminoMsg { @@ -190,7 +191,7 @@ export interface PoolAssetAmino { */ token?: CoinAmino; /** Weight that is not normalized. This weight must be less than 2^50 */ - weight: string; + weight?: string; } export interface PoolAssetAminoMsg { type: "osmosis/gamm/pool-asset"; @@ -207,7 +208,7 @@ export interface PoolAssetSDKType { weight: string; } export interface Pool { - $typeUrl?: string; + $typeUrl?: "/osmosis.gamm.v1beta1.Pool"; address: string; id: bigint; poolParams: PoolParams; @@ -238,8 +239,8 @@ export interface PoolProtoMsg { value: Uint8Array; } export interface PoolAmino { - address: string; - id: string; + address?: string; + id?: string; pool_params?: PoolParamsAmino; /** * This string specifies who will govern the pool in the future. @@ -252,23 +253,23 @@ export interface PoolAmino { * would need to be locked up to count in governance. 0w means no lockup. * TODO: Further improve these docs */ - future_pool_governor: string; + future_pool_governor?: string; /** sum of all LP tokens sent out */ total_shares?: CoinAmino; /** * These are assumed to be sorted by denomiation. * They contain the pool asset and the information about the weight */ - pool_assets: PoolAssetAmino[]; + pool_assets?: PoolAssetAmino[]; /** sum of all non-normalized pool weights */ - total_weight: string; + total_weight?: string; } export interface PoolAminoMsg { type: "osmosis/gamm/BalancerPool"; value: PoolAmino; } export interface PoolSDKType { - $typeUrl?: string; + $typeUrl?: "/osmosis.gamm.v1beta1.Pool"; address: string; id: bigint; pool_params: PoolParamsSDKType; @@ -279,14 +280,24 @@ export interface PoolSDKType { } function createBaseSmoothWeightChangeParams(): SmoothWeightChangeParams { return { - startTime: undefined, - duration: undefined, + startTime: new Date(), + duration: Duration.fromPartial({}), initialPoolWeights: [], targetPoolWeights: [] }; } export const SmoothWeightChangeParams = { typeUrl: "/osmosis.gamm.v1beta1.SmoothWeightChangeParams", + aminoType: "osmosis/gamm/smooth-weight-change-params", + is(o: any): o is SmoothWeightChangeParams { + return o && (o.$typeUrl === SmoothWeightChangeParams.typeUrl || Timestamp.is(o.startTime) && Duration.is(o.duration) && Array.isArray(o.initialPoolWeights) && (!o.initialPoolWeights.length || PoolAsset.is(o.initialPoolWeights[0])) && Array.isArray(o.targetPoolWeights) && (!o.targetPoolWeights.length || PoolAsset.is(o.targetPoolWeights[0]))); + }, + isSDK(o: any): o is SmoothWeightChangeParamsSDKType { + return o && (o.$typeUrl === SmoothWeightChangeParams.typeUrl || Timestamp.isSDK(o.start_time) && Duration.isSDK(o.duration) && Array.isArray(o.initial_pool_weights) && (!o.initial_pool_weights.length || PoolAsset.isSDK(o.initial_pool_weights[0])) && Array.isArray(o.target_pool_weights) && (!o.target_pool_weights.length || PoolAsset.isSDK(o.target_pool_weights[0]))); + }, + isAmino(o: any): o is SmoothWeightChangeParamsAmino { + return o && (o.$typeUrl === SmoothWeightChangeParams.typeUrl || Timestamp.isAmino(o.start_time) && Duration.isAmino(o.duration) && Array.isArray(o.initial_pool_weights) && (!o.initial_pool_weights.length || PoolAsset.isAmino(o.initial_pool_weights[0])) && Array.isArray(o.target_pool_weights) && (!o.target_pool_weights.length || PoolAsset.isAmino(o.target_pool_weights[0]))); + }, encode(message: SmoothWeightChangeParams, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.startTime !== undefined) { Timestamp.encode(toTimestamp(message.startTime), writer.uint32(10).fork()).ldelim(); @@ -328,6 +339,30 @@ export const SmoothWeightChangeParams = { } return message; }, + fromJSON(object: any): SmoothWeightChangeParams { + return { + startTime: isSet(object.startTime) ? new Date(object.startTime) : undefined, + duration: isSet(object.duration) ? Duration.fromJSON(object.duration) : undefined, + initialPoolWeights: Array.isArray(object?.initialPoolWeights) ? object.initialPoolWeights.map((e: any) => PoolAsset.fromJSON(e)) : [], + targetPoolWeights: Array.isArray(object?.targetPoolWeights) ? object.targetPoolWeights.map((e: any) => PoolAsset.fromJSON(e)) : [] + }; + }, + toJSON(message: SmoothWeightChangeParams): unknown { + const obj: any = {}; + message.startTime !== undefined && (obj.startTime = message.startTime.toISOString()); + message.duration !== undefined && (obj.duration = message.duration ? Duration.toJSON(message.duration) : undefined); + if (message.initialPoolWeights) { + obj.initialPoolWeights = message.initialPoolWeights.map(e => e ? PoolAsset.toJSON(e) : undefined); + } else { + obj.initialPoolWeights = []; + } + if (message.targetPoolWeights) { + obj.targetPoolWeights = message.targetPoolWeights.map(e => e ? PoolAsset.toJSON(e) : undefined); + } else { + obj.targetPoolWeights = []; + } + return obj; + }, fromPartial(object: Partial): SmoothWeightChangeParams { const message = createBaseSmoothWeightChangeParams(); message.startTime = object.startTime ?? undefined; @@ -337,16 +372,20 @@ export const SmoothWeightChangeParams = { return message; }, fromAmino(object: SmoothWeightChangeParamsAmino): SmoothWeightChangeParams { - return { - startTime: object.start_time, - duration: object?.duration ? Duration.fromAmino(object.duration) : undefined, - initialPoolWeights: Array.isArray(object?.initial_pool_weights) ? object.initial_pool_weights.map((e: any) => PoolAsset.fromAmino(e)) : [], - targetPoolWeights: Array.isArray(object?.target_pool_weights) ? object.target_pool_weights.map((e: any) => PoolAsset.fromAmino(e)) : [] - }; + const message = createBaseSmoothWeightChangeParams(); + if (object.start_time !== undefined && object.start_time !== null) { + message.startTime = fromTimestamp(Timestamp.fromAmino(object.start_time)); + } + if (object.duration !== undefined && object.duration !== null) { + message.duration = Duration.fromAmino(object.duration); + } + message.initialPoolWeights = object.initial_pool_weights?.map(e => PoolAsset.fromAmino(e)) || []; + message.targetPoolWeights = object.target_pool_weights?.map(e => PoolAsset.fromAmino(e)) || []; + return message; }, toAmino(message: SmoothWeightChangeParams): SmoothWeightChangeParamsAmino { const obj: any = {}; - obj.start_time = message.startTime; + obj.start_time = message.startTime ? Timestamp.toAmino(toTimestamp(message.startTime)) : undefined; obj.duration = message.duration ? Duration.toAmino(message.duration) : undefined; if (message.initialPoolWeights) { obj.initial_pool_weights = message.initialPoolWeights.map(e => e ? PoolAsset.toAmino(e) : undefined); @@ -382,6 +421,8 @@ export const SmoothWeightChangeParams = { }; } }; +GlobalDecoderRegistry.register(SmoothWeightChangeParams.typeUrl, SmoothWeightChangeParams); +GlobalDecoderRegistry.registerAminoProtoMapping(SmoothWeightChangeParams.aminoType, SmoothWeightChangeParams.typeUrl); function createBasePoolParams(): PoolParams { return { swapFee: "", @@ -391,6 +432,16 @@ function createBasePoolParams(): PoolParams { } export const PoolParams = { typeUrl: "/osmosis.gamm.v1beta1.PoolParams", + aminoType: "osmosis/gamm/BalancerPoolParams", + is(o: any): o is PoolParams { + return o && (o.$typeUrl === PoolParams.typeUrl || typeof o.swapFee === "string" && typeof o.exitFee === "string"); + }, + isSDK(o: any): o is PoolParamsSDKType { + return o && (o.$typeUrl === PoolParams.typeUrl || typeof o.swap_fee === "string" && typeof o.exit_fee === "string"); + }, + isAmino(o: any): o is PoolParamsAmino { + return o && (o.$typeUrl === PoolParams.typeUrl || typeof o.swap_fee === "string" && typeof o.exit_fee === "string"); + }, encode(message: PoolParams, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.swapFee !== "") { writer.uint32(10).string(Decimal.fromUserInput(message.swapFee, 18).atomics); @@ -426,6 +477,20 @@ export const PoolParams = { } return message; }, + fromJSON(object: any): PoolParams { + return { + swapFee: isSet(object.swapFee) ? String(object.swapFee) : "", + exitFee: isSet(object.exitFee) ? String(object.exitFee) : "", + smoothWeightChangeParams: isSet(object.smoothWeightChangeParams) ? SmoothWeightChangeParams.fromJSON(object.smoothWeightChangeParams) : undefined + }; + }, + toJSON(message: PoolParams): unknown { + const obj: any = {}; + message.swapFee !== undefined && (obj.swapFee = message.swapFee); + message.exitFee !== undefined && (obj.exitFee = message.exitFee); + message.smoothWeightChangeParams !== undefined && (obj.smoothWeightChangeParams = message.smoothWeightChangeParams ? SmoothWeightChangeParams.toJSON(message.smoothWeightChangeParams) : undefined); + return obj; + }, fromPartial(object: Partial): PoolParams { const message = createBasePoolParams(); message.swapFee = object.swapFee ?? ""; @@ -434,11 +499,17 @@ export const PoolParams = { return message; }, fromAmino(object: PoolParamsAmino): PoolParams { - return { - swapFee: object.swap_fee, - exitFee: object.exit_fee, - smoothWeightChangeParams: object?.smooth_weight_change_params ? SmoothWeightChangeParams.fromAmino(object.smooth_weight_change_params) : undefined - }; + const message = createBasePoolParams(); + if (object.swap_fee !== undefined && object.swap_fee !== null) { + message.swapFee = object.swap_fee; + } + if (object.exit_fee !== undefined && object.exit_fee !== null) { + message.exitFee = object.exit_fee; + } + if (object.smooth_weight_change_params !== undefined && object.smooth_weight_change_params !== null) { + message.smoothWeightChangeParams = SmoothWeightChangeParams.fromAmino(object.smooth_weight_change_params); + } + return message; }, toAmino(message: PoolParams): PoolParamsAmino { const obj: any = {}; @@ -469,14 +540,26 @@ export const PoolParams = { }; } }; +GlobalDecoderRegistry.register(PoolParams.typeUrl, PoolParams); +GlobalDecoderRegistry.registerAminoProtoMapping(PoolParams.aminoType, PoolParams.typeUrl); function createBasePoolAsset(): PoolAsset { return { - token: undefined, + token: Coin.fromPartial({}), weight: "" }; } export const PoolAsset = { typeUrl: "/osmosis.gamm.v1beta1.PoolAsset", + aminoType: "osmosis/gamm/pool-asset", + is(o: any): o is PoolAsset { + return o && (o.$typeUrl === PoolAsset.typeUrl || Coin.is(o.token) && typeof o.weight === "string"); + }, + isSDK(o: any): o is PoolAssetSDKType { + return o && (o.$typeUrl === PoolAsset.typeUrl || Coin.isSDK(o.token) && typeof o.weight === "string"); + }, + isAmino(o: any): o is PoolAssetAmino { + return o && (o.$typeUrl === PoolAsset.typeUrl || Coin.isAmino(o.token) && typeof o.weight === "string"); + }, encode(message: PoolAsset, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.token !== undefined) { Coin.encode(message.token, writer.uint32(10).fork()).ldelim(); @@ -506,6 +589,18 @@ export const PoolAsset = { } 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; + }, fromPartial(object: Partial): PoolAsset { const message = createBasePoolAsset(); message.token = object.token !== undefined && object.token !== null ? Coin.fromPartial(object.token) : undefined; @@ -513,10 +608,14 @@ export const PoolAsset = { return message; }, fromAmino(object: PoolAssetAmino): PoolAsset { - return { - token: object?.token ? Coin.fromAmino(object.token) : undefined, - weight: object.weight - }; + const message = createBasePoolAsset(); + if (object.token !== undefined && object.token !== null) { + message.token = Coin.fromAmino(object.token); + } + if (object.weight !== undefined && object.weight !== null) { + message.weight = object.weight; + } + return message; }, toAmino(message: PoolAsset): PoolAssetAmino { const obj: any = {}; @@ -546,6 +645,8 @@ export const PoolAsset = { }; } }; +GlobalDecoderRegistry.register(PoolAsset.typeUrl, PoolAsset); +GlobalDecoderRegistry.registerAminoProtoMapping(PoolAsset.aminoType, PoolAsset.typeUrl); function createBasePool(): Pool { return { $typeUrl: "/osmosis.gamm.v1beta1.Pool", @@ -553,13 +654,23 @@ function createBasePool(): Pool { id: BigInt(0), poolParams: PoolParams.fromPartial({}), futurePoolGovernor: "", - totalShares: undefined, + totalShares: Coin.fromPartial({}), poolAssets: [], totalWeight: "" }; } export const Pool = { typeUrl: "/osmosis.gamm.v1beta1.Pool", + aminoType: "osmosis/gamm/BalancerPool", + is(o: any): o is Pool { + return o && (o.$typeUrl === Pool.typeUrl || typeof o.address === "string" && typeof o.id === "bigint" && PoolParams.is(o.poolParams) && typeof o.futurePoolGovernor === "string" && Coin.is(o.totalShares) && Array.isArray(o.poolAssets) && (!o.poolAssets.length || PoolAsset.is(o.poolAssets[0])) && typeof o.totalWeight === "string"); + }, + isSDK(o: any): o is PoolSDKType { + return o && (o.$typeUrl === Pool.typeUrl || typeof o.address === "string" && typeof o.id === "bigint" && PoolParams.isSDK(o.pool_params) && typeof o.future_pool_governor === "string" && Coin.isSDK(o.total_shares) && Array.isArray(o.pool_assets) && (!o.pool_assets.length || PoolAsset.isSDK(o.pool_assets[0])) && typeof o.total_weight === "string"); + }, + isAmino(o: any): o is PoolAmino { + return o && (o.$typeUrl === Pool.typeUrl || typeof o.address === "string" && typeof o.id === "bigint" && PoolParams.isAmino(o.pool_params) && typeof o.future_pool_governor === "string" && Coin.isAmino(o.total_shares) && Array.isArray(o.pool_assets) && (!o.pool_assets.length || PoolAsset.isAmino(o.pool_assets[0])) && typeof o.total_weight === "string"); + }, encode(message: Pool, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.address !== "") { writer.uint32(10).string(message.address); @@ -619,6 +730,32 @@ export const Pool = { } return message; }, + fromJSON(object: any): Pool { + return { + address: isSet(object.address) ? String(object.address) : "", + id: isSet(object.id) ? BigInt(object.id.toString()) : BigInt(0), + poolParams: isSet(object.poolParams) ? PoolParams.fromJSON(object.poolParams) : undefined, + futurePoolGovernor: isSet(object.futurePoolGovernor) ? String(object.futurePoolGovernor) : "", + totalShares: isSet(object.totalShares) ? Coin.fromJSON(object.totalShares) : undefined, + poolAssets: Array.isArray(object?.poolAssets) ? object.poolAssets.map((e: any) => PoolAsset.fromJSON(e)) : [], + totalWeight: isSet(object.totalWeight) ? String(object.totalWeight) : "" + }; + }, + toJSON(message: Pool): unknown { + const obj: any = {}; + message.address !== undefined && (obj.address = message.address); + message.id !== undefined && (obj.id = (message.id || BigInt(0)).toString()); + message.poolParams !== undefined && (obj.poolParams = message.poolParams ? PoolParams.toJSON(message.poolParams) : undefined); + message.futurePoolGovernor !== undefined && (obj.futurePoolGovernor = message.futurePoolGovernor); + message.totalShares !== undefined && (obj.totalShares = message.totalShares ? Coin.toJSON(message.totalShares) : undefined); + if (message.poolAssets) { + obj.poolAssets = message.poolAssets.map(e => e ? PoolAsset.toJSON(e) : undefined); + } else { + obj.poolAssets = []; + } + message.totalWeight !== undefined && (obj.totalWeight = message.totalWeight); + return obj; + }, fromPartial(object: Partial): Pool { const message = createBasePool(); message.address = object.address ?? ""; @@ -631,15 +768,27 @@ export const Pool = { return message; }, fromAmino(object: PoolAmino): Pool { - return { - address: object.address, - id: BigInt(object.id), - poolParams: object?.pool_params ? PoolParams.fromAmino(object.pool_params) : undefined, - futurePoolGovernor: object.future_pool_governor, - totalShares: object?.total_shares ? Coin.fromAmino(object.total_shares) : undefined, - poolAssets: Array.isArray(object?.pool_assets) ? object.pool_assets.map((e: any) => PoolAsset.fromAmino(e)) : [], - totalWeight: object.total_weight - }; + const message = createBasePool(); + if (object.address !== undefined && object.address !== null) { + message.address = object.address; + } + if (object.id !== undefined && object.id !== null) { + message.id = BigInt(object.id); + } + if (object.pool_params !== undefined && object.pool_params !== null) { + message.poolParams = PoolParams.fromAmino(object.pool_params); + } + if (object.future_pool_governor !== undefined && object.future_pool_governor !== null) { + message.futurePoolGovernor = object.future_pool_governor; + } + if (object.total_shares !== undefined && object.total_shares !== null) { + message.totalShares = Coin.fromAmino(object.total_shares); + } + message.poolAssets = object.pool_assets?.map(e => PoolAsset.fromAmino(e)) || []; + if (object.total_weight !== undefined && object.total_weight !== null) { + message.totalWeight = object.total_weight; + } + return message; }, toAmino(message: Pool): PoolAmino { const obj: any = {}; @@ -677,4 +826,6 @@ export const Pool = { value: Pool.encode(message).finish() }; } -}; \ No newline at end of file +}; +GlobalDecoderRegistry.register(Pool.typeUrl, Pool); +GlobalDecoderRegistry.registerAminoProtoMapping(Pool.aminoType, Pool.typeUrl); \ No newline at end of file diff --git a/packages/osmojs/src/codegen/osmosis/gamm/v1beta1/genesis.ts b/packages/osmojs/src/codegen/osmosis/gamm/v1beta1/genesis.ts index 0c6a0da1b..385f48cd8 100644 --- a/packages/osmojs/src/codegen/osmosis/gamm/v1beta1/genesis.ts +++ b/packages/osmojs/src/codegen/osmosis/gamm/v1beta1/genesis.ts @@ -1,17 +1,19 @@ import { Coin, CoinAmino, CoinSDKType } from "../../../cosmos/base/v1beta1/coin"; import { Any, AnyProtoMsg, AnyAmino, AnySDKType } from "../../../google/protobuf/any"; import { MigrationRecords, MigrationRecordsAmino, MigrationRecordsSDKType } from "./shared"; -import { Pool as Pool1 } from "../../concentrated-liquidity/pool"; -import { PoolProtoMsg as Pool1ProtoMsg } from "../../concentrated-liquidity/pool"; -import { PoolSDKType as Pool1SDKType } from "../../concentrated-liquidity/pool"; +import { Pool as Pool1 } from "../../concentratedliquidity/v1beta1/pool"; +import { PoolProtoMsg as Pool1ProtoMsg } from "../../concentratedliquidity/v1beta1/pool"; +import { PoolSDKType as Pool1SDKType } from "../../concentratedliquidity/v1beta1/pool"; import { CosmWasmPool, CosmWasmPoolProtoMsg, CosmWasmPoolSDKType } from "../../cosmwasmpool/v1beta1/model/pool"; -import { Pool as Pool2 } from "../pool-models/balancer/balancerPool"; -import { PoolProtoMsg as Pool2ProtoMsg } from "../pool-models/balancer/balancerPool"; -import { PoolSDKType as Pool2SDKType } from "../pool-models/balancer/balancerPool"; -import { Pool as Pool3 } from "../pool-models/stableswap/stableswap_pool"; -import { PoolProtoMsg as Pool3ProtoMsg } from "../pool-models/stableswap/stableswap_pool"; -import { PoolSDKType as Pool3SDKType } from "../pool-models/stableswap/stableswap_pool"; +import { Pool as Pool2 } from "../poolmodels/stableswap/v1beta1/stableswap_pool"; +import { PoolProtoMsg as Pool2ProtoMsg } from "../poolmodels/stableswap/v1beta1/stableswap_pool"; +import { PoolSDKType as Pool2SDKType } from "../poolmodels/stableswap/v1beta1/stableswap_pool"; +import { Pool as Pool3 } from "./balancerPool"; +import { PoolProtoMsg as Pool3ProtoMsg } from "./balancerPool"; +import { PoolSDKType as Pool3SDKType } from "./balancerPool"; import { BinaryReader, BinaryWriter } from "../../../binary"; +import { GlobalDecoderRegistry } from "../../../registry"; +import { isSet } from "../../../helpers"; /** Params holds parameters for the incentives module */ export interface Params { poolCreationFee: Coin[]; @@ -22,7 +24,7 @@ export interface ParamsProtoMsg { } /** Params holds parameters for the incentives module */ export interface ParamsAmino { - pool_creation_fee: CoinAmino[]; + pool_creation_fee?: CoinAmino[]; } export interface ParamsAminoMsg { type: "osmosis/gamm/params"; @@ -34,11 +36,11 @@ export interface ParamsSDKType { } /** GenesisState defines the gamm module's genesis state. */ export interface GenesisState { - pools: (Pool1 & CosmWasmPool & Pool2 & Pool3 & Any)[] | Any[]; + pools: (Pool1 | CosmWasmPool | Pool2 | Pool3 | Any)[] | Any[]; /** will be renamed to next_pool_id in an upcoming version */ nextPoolNumber: bigint; params: Params; - migrationRecords: MigrationRecords; + migrationRecords?: MigrationRecords; } export interface GenesisStateProtoMsg { typeUrl: "/osmosis.gamm.v1beta1.GenesisState"; @@ -49,9 +51,9 @@ export type GenesisStateEncoded = Omit & { }; /** GenesisState defines the gamm module's genesis state. */ export interface GenesisStateAmino { - pools: AnyAmino[]; + pools?: AnyAmino[]; /** will be renamed to next_pool_id in an upcoming version */ - next_pool_number: string; + next_pool_number?: string; params?: ParamsAmino; migration_records?: MigrationRecordsAmino; } @@ -64,7 +66,7 @@ export interface GenesisStateSDKType { pools: (Pool1SDKType | CosmWasmPoolSDKType | Pool2SDKType | Pool3SDKType | AnySDKType)[]; next_pool_number: bigint; params: ParamsSDKType; - migration_records: MigrationRecordsSDKType; + migration_records?: MigrationRecordsSDKType; } function createBaseParams(): Params { return { @@ -73,6 +75,16 @@ function createBaseParams(): Params { } export const Params = { typeUrl: "/osmosis.gamm.v1beta1.Params", + aminoType: "osmosis/gamm/params", + is(o: any): o is Params { + return o && (o.$typeUrl === Params.typeUrl || Array.isArray(o.poolCreationFee) && (!o.poolCreationFee.length || Coin.is(o.poolCreationFee[0]))); + }, + isSDK(o: any): o is ParamsSDKType { + return o && (o.$typeUrl === Params.typeUrl || Array.isArray(o.pool_creation_fee) && (!o.pool_creation_fee.length || Coin.isSDK(o.pool_creation_fee[0]))); + }, + isAmino(o: any): o is ParamsAmino { + return o && (o.$typeUrl === Params.typeUrl || Array.isArray(o.pool_creation_fee) && (!o.pool_creation_fee.length || Coin.isAmino(o.pool_creation_fee[0]))); + }, encode(message: Params, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.poolCreationFee) { Coin.encode(v!, writer.uint32(10).fork()).ldelim(); @@ -96,15 +108,29 @@ export const Params = { } return message; }, + fromJSON(object: any): Params { + return { + poolCreationFee: Array.isArray(object?.poolCreationFee) ? object.poolCreationFee.map((e: any) => Coin.fromJSON(e)) : [] + }; + }, + toJSON(message: Params): unknown { + const obj: any = {}; + if (message.poolCreationFee) { + obj.poolCreationFee = message.poolCreationFee.map(e => e ? Coin.toJSON(e) : undefined); + } else { + obj.poolCreationFee = []; + } + return obj; + }, fromPartial(object: Partial): Params { const message = createBaseParams(); message.poolCreationFee = object.poolCreationFee?.map(e => Coin.fromPartial(e)) || []; return message; }, fromAmino(object: ParamsAmino): Params { - return { - poolCreationFee: Array.isArray(object?.pool_creation_fee) ? object.pool_creation_fee.map((e: any) => Coin.fromAmino(e)) : [] - }; + const message = createBaseParams(); + message.poolCreationFee = object.pool_creation_fee?.map(e => Coin.fromAmino(e)) || []; + return message; }, toAmino(message: Params): ParamsAmino { const obj: any = {}; @@ -137,19 +163,31 @@ export const Params = { }; } }; +GlobalDecoderRegistry.register(Params.typeUrl, Params); +GlobalDecoderRegistry.registerAminoProtoMapping(Params.aminoType, Params.typeUrl); function createBaseGenesisState(): GenesisState { return { pools: [], nextPoolNumber: BigInt(0), params: Params.fromPartial({}), - migrationRecords: MigrationRecords.fromPartial({}) + migrationRecords: undefined }; } export const GenesisState = { typeUrl: "/osmosis.gamm.v1beta1.GenesisState", + aminoType: "osmosis/gamm/genesis-state", + is(o: any): o is GenesisState { + return o && (o.$typeUrl === GenesisState.typeUrl || Array.isArray(o.pools) && (!o.pools.length || Pool1.is(o.pools[0]) || CosmWasmPool.is(o.pools[0]) || Pool2.is(o.pools[0]) || Pool3.is(o.pools[0]) || Any.is(o.pools[0])) && typeof o.nextPoolNumber === "bigint" && Params.is(o.params)); + }, + isSDK(o: any): o is GenesisStateSDKType { + return o && (o.$typeUrl === GenesisState.typeUrl || Array.isArray(o.pools) && (!o.pools.length || Pool1.isSDK(o.pools[0]) || CosmWasmPool.isSDK(o.pools[0]) || Pool2.isSDK(o.pools[0]) || Pool3.isSDK(o.pools[0]) || Any.isSDK(o.pools[0])) && typeof o.next_pool_number === "bigint" && Params.isSDK(o.params)); + }, + isAmino(o: any): o is GenesisStateAmino { + return o && (o.$typeUrl === GenesisState.typeUrl || Array.isArray(o.pools) && (!o.pools.length || Pool1.isAmino(o.pools[0]) || CosmWasmPool.isAmino(o.pools[0]) || Pool2.isAmino(o.pools[0]) || Pool3.isAmino(o.pools[0]) || Any.isAmino(o.pools[0])) && typeof o.next_pool_number === "bigint" && Params.isAmino(o.params)); + }, encode(message: GenesisState, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.pools) { - Any.encode((v! as Any), writer.uint32(10).fork()).ldelim(); + Any.encode(GlobalDecoderRegistry.wrapAny(v!), writer.uint32(10).fork()).ldelim(); } if (message.nextPoolNumber !== BigInt(0)) { writer.uint32(16).uint64(message.nextPoolNumber); @@ -170,7 +208,7 @@ export const GenesisState = { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.pools.push((PoolI_InterfaceDecoder(reader) as Any)); + message.pools.push(GlobalDecoderRegistry.unwrapAny(reader)); break; case 2: message.nextPoolNumber = reader.uint64(); @@ -188,26 +226,52 @@ export const GenesisState = { } return message; }, + fromJSON(object: any): GenesisState { + return { + pools: Array.isArray(object?.pools) ? object.pools.map((e: any) => GlobalDecoderRegistry.fromJSON(e)) : [], + nextPoolNumber: isSet(object.nextPoolNumber) ? BigInt(object.nextPoolNumber.toString()) : BigInt(0), + params: isSet(object.params) ? Params.fromJSON(object.params) : undefined, + migrationRecords: isSet(object.migrationRecords) ? MigrationRecords.fromJSON(object.migrationRecords) : undefined + }; + }, + toJSON(message: GenesisState): unknown { + const obj: any = {}; + if (message.pools) { + obj.pools = message.pools.map(e => e ? GlobalDecoderRegistry.toJSON(e) : undefined); + } else { + obj.pools = []; + } + message.nextPoolNumber !== undefined && (obj.nextPoolNumber = (message.nextPoolNumber || BigInt(0)).toString()); + message.params !== undefined && (obj.params = message.params ? Params.toJSON(message.params) : undefined); + message.migrationRecords !== undefined && (obj.migrationRecords = message.migrationRecords ? MigrationRecords.toJSON(message.migrationRecords) : undefined); + return obj; + }, fromPartial(object: Partial): GenesisState { const message = createBaseGenesisState(); - message.pools = object.pools?.map(e => Any.fromPartial(e)) || []; + message.pools = object.pools?.map(e => (Any.fromPartial(e) as any)) || []; message.nextPoolNumber = object.nextPoolNumber !== undefined && object.nextPoolNumber !== null ? BigInt(object.nextPoolNumber.toString()) : BigInt(0); message.params = object.params !== undefined && object.params !== null ? Params.fromPartial(object.params) : undefined; message.migrationRecords = object.migrationRecords !== undefined && object.migrationRecords !== null ? MigrationRecords.fromPartial(object.migrationRecords) : undefined; return message; }, fromAmino(object: GenesisStateAmino): GenesisState { - return { - pools: Array.isArray(object?.pools) ? object.pools.map((e: any) => PoolI_FromAmino(e)) : [], - nextPoolNumber: BigInt(object.next_pool_number), - params: object?.params ? Params.fromAmino(object.params) : undefined, - migrationRecords: object?.migration_records ? MigrationRecords.fromAmino(object.migration_records) : undefined - }; + const message = createBaseGenesisState(); + message.pools = object.pools?.map(e => GlobalDecoderRegistry.fromAminoMsg(e)) || []; + if (object.next_pool_number !== undefined && object.next_pool_number !== null) { + message.nextPoolNumber = BigInt(object.next_pool_number); + } + if (object.params !== undefined && object.params !== null) { + message.params = Params.fromAmino(object.params); + } + if (object.migration_records !== undefined && object.migration_records !== null) { + message.migrationRecords = MigrationRecords.fromAmino(object.migration_records); + } + return message; }, toAmino(message: GenesisState): GenesisStateAmino { const obj: any = {}; if (message.pools) { - obj.pools = message.pools.map(e => e ? PoolI_ToAmino((e as Any)) : undefined); + obj.pools = message.pools.map(e => e ? GlobalDecoderRegistry.toAminoMsg(e) : undefined); } else { obj.pools = []; } @@ -238,71 +302,5 @@ export const GenesisState = { }; } }; -export const PoolI_InterfaceDecoder = (input: BinaryReader | Uint8Array): Pool1 | CosmWasmPool | Pool2 | Pool3 | Any => { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - const data = Any.decode(reader, reader.uint32()); - switch (data.typeUrl) { - case "/osmosis.concentratedliquidity.v1beta1.Pool": - return Pool1.decode(data.value); - case "/osmosis.cosmwasmpool.v1beta1.CosmWasmPool": - return CosmWasmPool.decode(data.value); - case "/osmosis.gamm.v1beta1.Pool": - return Pool2.decode(data.value); - case "/osmosis.gamm.poolmodels.stableswap.v1beta1.Pool": - return Pool3.decode(data.value); - default: - return data; - } -}; -export const PoolI_FromAmino = (content: AnyAmino) => { - switch (content.type) { - case "osmosis/concentratedliquidity/pool": - return Any.fromPartial({ - typeUrl: "/osmosis.concentratedliquidity.v1beta1.Pool", - value: Pool1.encode(Pool1.fromPartial(Pool1.fromAmino(content.value))).finish() - }); - case "osmosis/cosmwasmpool/cosm-wasm-pool": - return Any.fromPartial({ - typeUrl: "/osmosis.cosmwasmpool.v1beta1.CosmWasmPool", - value: CosmWasmPool.encode(CosmWasmPool.fromPartial(CosmWasmPool.fromAmino(content.value))).finish() - }); - case "osmosis/gamm/BalancerPool": - return Any.fromPartial({ - typeUrl: "/osmosis.gamm.v1beta1.Pool", - value: Pool2.encode(Pool2.fromPartial(Pool2.fromAmino(content.value))).finish() - }); - case "osmosis/gamm/StableswapPool": - return Any.fromPartial({ - typeUrl: "/osmosis.gamm.poolmodels.stableswap.v1beta1.Pool", - value: Pool3.encode(Pool3.fromPartial(Pool3.fromAmino(content.value))).finish() - }); - default: - return Any.fromAmino(content); - } -}; -export const PoolI_ToAmino = (content: Any) => { - switch (content.typeUrl) { - case "/osmosis.concentratedliquidity.v1beta1.Pool": - return { - type: "osmosis/concentratedliquidity/pool", - value: Pool1.toAmino(Pool1.decode(content.value)) - }; - case "/osmosis.cosmwasmpool.v1beta1.CosmWasmPool": - return { - type: "osmosis/cosmwasmpool/cosm-wasm-pool", - value: CosmWasmPool.toAmino(CosmWasmPool.decode(content.value)) - }; - case "/osmosis.gamm.v1beta1.Pool": - return { - type: "osmosis/gamm/BalancerPool", - value: Pool2.toAmino(Pool2.decode(content.value)) - }; - case "/osmosis.gamm.poolmodels.stableswap.v1beta1.Pool": - return { - type: "osmosis/gamm/StableswapPool", - value: Pool3.toAmino(Pool3.decode(content.value)) - }; - default: - return Any.toAmino(content); - } -}; \ No newline at end of file +GlobalDecoderRegistry.register(GenesisState.typeUrl, GenesisState); +GlobalDecoderRegistry.registerAminoProtoMapping(GenesisState.aminoType, GenesisState.typeUrl); \ No newline at end of file diff --git a/packages/osmojs/src/codegen/osmosis/gamm/v1beta1/gov.ts b/packages/osmojs/src/codegen/osmosis/gamm/v1beta1/gov.ts index ea11c5f81..49c3cad15 100644 --- a/packages/osmojs/src/codegen/osmosis/gamm/v1beta1/gov.ts +++ b/packages/osmojs/src/codegen/osmosis/gamm/v1beta1/gov.ts @@ -1,5 +1,8 @@ import { BalancerToConcentratedPoolLink, BalancerToConcentratedPoolLinkAmino, BalancerToConcentratedPoolLinkSDKType } from "./shared"; import { BinaryReader, BinaryWriter } from "../../../binary"; +import { isSet } from "../../../helpers"; +import { GlobalDecoderRegistry } from "../../../registry"; +import { Decimal } from "@cosmjs/math"; /** * ReplaceMigrationRecordsProposal is a gov Content type for updating the * migration records. If a ReplaceMigrationRecordsProposal passes, the @@ -8,7 +11,7 @@ import { BinaryReader, BinaryWriter } from "../../../binary"; * a single concentrated pool. */ export interface ReplaceMigrationRecordsProposal { - $typeUrl?: string; + $typeUrl?: "/osmosis.gamm.v1beta1.ReplaceMigrationRecordsProposal"; title: string; description: string; records: BalancerToConcentratedPoolLink[]; @@ -25,9 +28,9 @@ export interface ReplaceMigrationRecordsProposalProtoMsg { * a single concentrated pool. */ export interface ReplaceMigrationRecordsProposalAmino { - title: string; - description: string; - records: BalancerToConcentratedPoolLinkAmino[]; + title?: string; + description?: string; + records?: BalancerToConcentratedPoolLinkAmino[]; } export interface ReplaceMigrationRecordsProposalAminoMsg { type: "osmosis/ReplaceMigrationRecordsProposal"; @@ -41,7 +44,7 @@ export interface ReplaceMigrationRecordsProposalAminoMsg { * a single concentrated pool. */ export interface ReplaceMigrationRecordsProposalSDKType { - $typeUrl?: string; + $typeUrl?: "/osmosis.gamm.v1beta1.ReplaceMigrationRecordsProposal"; title: string; description: string; records: BalancerToConcentratedPoolLinkSDKType[]; @@ -57,7 +60,7 @@ export interface ReplaceMigrationRecordsProposalSDKType { * [(Balancer 1, CL 5), (Balancer 3, CL 4), (Balancer 4, CL 10)] */ export interface UpdateMigrationRecordsProposal { - $typeUrl?: string; + $typeUrl?: "/osmosis.gamm.v1beta1.UpdateMigrationRecordsProposal"; title: string; description: string; records: BalancerToConcentratedPoolLink[]; @@ -77,9 +80,9 @@ export interface UpdateMigrationRecordsProposalProtoMsg { * [(Balancer 1, CL 5), (Balancer 3, CL 4), (Balancer 4, CL 10)] */ export interface UpdateMigrationRecordsProposalAmino { - title: string; - description: string; - records: BalancerToConcentratedPoolLinkAmino[]; + title?: string; + description?: string; + records?: BalancerToConcentratedPoolLinkAmino[]; } export interface UpdateMigrationRecordsProposalAminoMsg { type: "osmosis/UpdateMigrationRecordsProposal"; @@ -96,11 +99,120 @@ export interface UpdateMigrationRecordsProposalAminoMsg { * [(Balancer 1, CL 5), (Balancer 3, CL 4), (Balancer 4, CL 10)] */ export interface UpdateMigrationRecordsProposalSDKType { - $typeUrl?: string; + $typeUrl?: "/osmosis.gamm.v1beta1.UpdateMigrationRecordsProposal"; title: string; description: string; records: BalancerToConcentratedPoolLinkSDKType[]; } +export interface PoolRecordWithCFMMLink { + denom0: string; + denom1: string; + tickSpacing: bigint; + exponentAtPriceOne: string; + spreadFactor: string; + balancerPoolId: bigint; +} +export interface PoolRecordWithCFMMLinkProtoMsg { + typeUrl: "/osmosis.gamm.v1beta1.PoolRecordWithCFMMLink"; + value: Uint8Array; +} +export interface PoolRecordWithCFMMLinkAmino { + denom0?: string; + denom1?: string; + tick_spacing?: string; + exponent_at_price_one?: string; + spread_factor?: string; + balancer_pool_id?: string; +} +export interface PoolRecordWithCFMMLinkAminoMsg { + type: "osmosis/gamm/pool-record-with-cfmm-link"; + value: PoolRecordWithCFMMLinkAmino; +} +export interface PoolRecordWithCFMMLinkSDKType { + denom0: string; + denom1: string; + tick_spacing: bigint; + exponent_at_price_one: string; + spread_factor: string; + balancer_pool_id: bigint; +} +/** + * CreateConcentratedLiquidityPoolsAndLinktoCFMMProposal is a gov Content type + * for creating concentrated liquidity pools and linking it to a CFMM pool. + */ +export interface CreateConcentratedLiquidityPoolsAndLinktoCFMMProposal { + $typeUrl?: "/osmosis.gamm.v1beta1.CreateConcentratedLiquidityPoolsAndLinktoCFMMProposal"; + title: string; + description: string; + poolRecordsWithCfmmLink: PoolRecordWithCFMMLink[]; +} +export interface CreateConcentratedLiquidityPoolsAndLinktoCFMMProposalProtoMsg { + typeUrl: "/osmosis.gamm.v1beta1.CreateConcentratedLiquidityPoolsAndLinktoCFMMProposal"; + value: Uint8Array; +} +/** + * CreateConcentratedLiquidityPoolsAndLinktoCFMMProposal is a gov Content type + * for creating concentrated liquidity pools and linking it to a CFMM pool. + */ +export interface CreateConcentratedLiquidityPoolsAndLinktoCFMMProposalAmino { + title?: string; + description?: string; + pool_records_with_cfmm_link?: PoolRecordWithCFMMLinkAmino[]; +} +export interface CreateConcentratedLiquidityPoolsAndLinktoCFMMProposalAminoMsg { + type: "osmosis/CreateConcentratedLiquidityPoolsAndLinktoCFMMProposal"; + value: CreateConcentratedLiquidityPoolsAndLinktoCFMMProposalAmino; +} +/** + * CreateConcentratedLiquidityPoolsAndLinktoCFMMProposal is a gov Content type + * for creating concentrated liquidity pools and linking it to a CFMM pool. + */ +export interface CreateConcentratedLiquidityPoolsAndLinktoCFMMProposalSDKType { + $typeUrl?: "/osmosis.gamm.v1beta1.CreateConcentratedLiquidityPoolsAndLinktoCFMMProposal"; + title: string; + description: string; + pool_records_with_cfmm_link: PoolRecordWithCFMMLinkSDKType[]; +} +/** + * SetScalingFactorControllerProposal is a gov Content type for updating the + * scaling factor controller address of a stableswap pool + */ +export interface SetScalingFactorControllerProposal { + $typeUrl?: "/osmosis.gamm.v1beta1.SetScalingFactorControllerProposal"; + title: string; + description: string; + poolId: bigint; + controllerAddress: string; +} +export interface SetScalingFactorControllerProposalProtoMsg { + typeUrl: "/osmosis.gamm.v1beta1.SetScalingFactorControllerProposal"; + value: Uint8Array; +} +/** + * SetScalingFactorControllerProposal is a gov Content type for updating the + * scaling factor controller address of a stableswap pool + */ +export interface SetScalingFactorControllerProposalAmino { + title?: string; + description?: string; + pool_id?: string; + controller_address?: string; +} +export interface SetScalingFactorControllerProposalAminoMsg { + type: "osmosis/SetScalingFactorControllerProposal"; + value: SetScalingFactorControllerProposalAmino; +} +/** + * SetScalingFactorControllerProposal is a gov Content type for updating the + * scaling factor controller address of a stableswap pool + */ +export interface SetScalingFactorControllerProposalSDKType { + $typeUrl?: "/osmosis.gamm.v1beta1.SetScalingFactorControllerProposal"; + title: string; + description: string; + pool_id: bigint; + controller_address: string; +} function createBaseReplaceMigrationRecordsProposal(): ReplaceMigrationRecordsProposal { return { $typeUrl: "/osmosis.gamm.v1beta1.ReplaceMigrationRecordsProposal", @@ -111,6 +223,16 @@ function createBaseReplaceMigrationRecordsProposal(): ReplaceMigrationRecordsPro } export const ReplaceMigrationRecordsProposal = { typeUrl: "/osmosis.gamm.v1beta1.ReplaceMigrationRecordsProposal", + aminoType: "osmosis/ReplaceMigrationRecordsProposal", + is(o: any): o is ReplaceMigrationRecordsProposal { + return o && (o.$typeUrl === ReplaceMigrationRecordsProposal.typeUrl || typeof o.title === "string" && typeof o.description === "string" && Array.isArray(o.records) && (!o.records.length || BalancerToConcentratedPoolLink.is(o.records[0]))); + }, + isSDK(o: any): o is ReplaceMigrationRecordsProposalSDKType { + return o && (o.$typeUrl === ReplaceMigrationRecordsProposal.typeUrl || typeof o.title === "string" && typeof o.description === "string" && Array.isArray(o.records) && (!o.records.length || BalancerToConcentratedPoolLink.isSDK(o.records[0]))); + }, + isAmino(o: any): o is ReplaceMigrationRecordsProposalAmino { + return o && (o.$typeUrl === ReplaceMigrationRecordsProposal.typeUrl || typeof o.title === "string" && typeof o.description === "string" && Array.isArray(o.records) && (!o.records.length || BalancerToConcentratedPoolLink.isAmino(o.records[0]))); + }, encode(message: ReplaceMigrationRecordsProposal, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.title !== "") { writer.uint32(10).string(message.title); @@ -146,6 +268,24 @@ export const ReplaceMigrationRecordsProposal = { } return message; }, + fromJSON(object: any): ReplaceMigrationRecordsProposal { + return { + title: isSet(object.title) ? String(object.title) : "", + description: isSet(object.description) ? String(object.description) : "", + records: Array.isArray(object?.records) ? object.records.map((e: any) => BalancerToConcentratedPoolLink.fromJSON(e)) : [] + }; + }, + toJSON(message: ReplaceMigrationRecordsProposal): unknown { + const obj: any = {}; + message.title !== undefined && (obj.title = message.title); + message.description !== undefined && (obj.description = message.description); + if (message.records) { + obj.records = message.records.map(e => e ? BalancerToConcentratedPoolLink.toJSON(e) : undefined); + } else { + obj.records = []; + } + return obj; + }, fromPartial(object: Partial): ReplaceMigrationRecordsProposal { const message = createBaseReplaceMigrationRecordsProposal(); message.title = object.title ?? ""; @@ -154,11 +294,15 @@ export const ReplaceMigrationRecordsProposal = { return message; }, fromAmino(object: ReplaceMigrationRecordsProposalAmino): ReplaceMigrationRecordsProposal { - return { - title: object.title, - description: object.description, - records: Array.isArray(object?.records) ? object.records.map((e: any) => BalancerToConcentratedPoolLink.fromAmino(e)) : [] - }; + const message = createBaseReplaceMigrationRecordsProposal(); + if (object.title !== undefined && object.title !== null) { + message.title = object.title; + } + if (object.description !== undefined && object.description !== null) { + message.description = object.description; + } + message.records = object.records?.map(e => BalancerToConcentratedPoolLink.fromAmino(e)) || []; + return message; }, toAmino(message: ReplaceMigrationRecordsProposal): ReplaceMigrationRecordsProposalAmino { const obj: any = {}; @@ -193,6 +337,8 @@ export const ReplaceMigrationRecordsProposal = { }; } }; +GlobalDecoderRegistry.register(ReplaceMigrationRecordsProposal.typeUrl, ReplaceMigrationRecordsProposal); +GlobalDecoderRegistry.registerAminoProtoMapping(ReplaceMigrationRecordsProposal.aminoType, ReplaceMigrationRecordsProposal.typeUrl); function createBaseUpdateMigrationRecordsProposal(): UpdateMigrationRecordsProposal { return { $typeUrl: "/osmosis.gamm.v1beta1.UpdateMigrationRecordsProposal", @@ -203,6 +349,16 @@ function createBaseUpdateMigrationRecordsProposal(): UpdateMigrationRecordsPropo } export const UpdateMigrationRecordsProposal = { typeUrl: "/osmosis.gamm.v1beta1.UpdateMigrationRecordsProposal", + aminoType: "osmosis/UpdateMigrationRecordsProposal", + is(o: any): o is UpdateMigrationRecordsProposal { + return o && (o.$typeUrl === UpdateMigrationRecordsProposal.typeUrl || typeof o.title === "string" && typeof o.description === "string" && Array.isArray(o.records) && (!o.records.length || BalancerToConcentratedPoolLink.is(o.records[0]))); + }, + isSDK(o: any): o is UpdateMigrationRecordsProposalSDKType { + return o && (o.$typeUrl === UpdateMigrationRecordsProposal.typeUrl || typeof o.title === "string" && typeof o.description === "string" && Array.isArray(o.records) && (!o.records.length || BalancerToConcentratedPoolLink.isSDK(o.records[0]))); + }, + isAmino(o: any): o is UpdateMigrationRecordsProposalAmino { + return o && (o.$typeUrl === UpdateMigrationRecordsProposal.typeUrl || typeof o.title === "string" && typeof o.description === "string" && Array.isArray(o.records) && (!o.records.length || BalancerToConcentratedPoolLink.isAmino(o.records[0]))); + }, encode(message: UpdateMigrationRecordsProposal, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.title !== "") { writer.uint32(10).string(message.title); @@ -238,6 +394,24 @@ export const UpdateMigrationRecordsProposal = { } return message; }, + fromJSON(object: any): UpdateMigrationRecordsProposal { + return { + title: isSet(object.title) ? String(object.title) : "", + description: isSet(object.description) ? String(object.description) : "", + records: Array.isArray(object?.records) ? object.records.map((e: any) => BalancerToConcentratedPoolLink.fromJSON(e)) : [] + }; + }, + toJSON(message: UpdateMigrationRecordsProposal): unknown { + const obj: any = {}; + message.title !== undefined && (obj.title = message.title); + message.description !== undefined && (obj.description = message.description); + if (message.records) { + obj.records = message.records.map(e => e ? BalancerToConcentratedPoolLink.toJSON(e) : undefined); + } else { + obj.records = []; + } + return obj; + }, fromPartial(object: Partial): UpdateMigrationRecordsProposal { const message = createBaseUpdateMigrationRecordsProposal(); message.title = object.title ?? ""; @@ -246,11 +420,15 @@ export const UpdateMigrationRecordsProposal = { return message; }, fromAmino(object: UpdateMigrationRecordsProposalAmino): UpdateMigrationRecordsProposal { - return { - title: object.title, - description: object.description, - records: Array.isArray(object?.records) ? object.records.map((e: any) => BalancerToConcentratedPoolLink.fromAmino(e)) : [] - }; + const message = createBaseUpdateMigrationRecordsProposal(); + if (object.title !== undefined && object.title !== null) { + message.title = object.title; + } + if (object.description !== undefined && object.description !== null) { + message.description = object.description; + } + message.records = object.records?.map(e => BalancerToConcentratedPoolLink.fromAmino(e)) || []; + return message; }, toAmino(message: UpdateMigrationRecordsProposal): UpdateMigrationRecordsProposalAmino { const obj: any = {}; @@ -284,4 +462,427 @@ export const UpdateMigrationRecordsProposal = { value: UpdateMigrationRecordsProposal.encode(message).finish() }; } -}; \ No newline at end of file +}; +GlobalDecoderRegistry.register(UpdateMigrationRecordsProposal.typeUrl, UpdateMigrationRecordsProposal); +GlobalDecoderRegistry.registerAminoProtoMapping(UpdateMigrationRecordsProposal.aminoType, UpdateMigrationRecordsProposal.typeUrl); +function createBasePoolRecordWithCFMMLink(): PoolRecordWithCFMMLink { + return { + denom0: "", + denom1: "", + tickSpacing: BigInt(0), + exponentAtPriceOne: "", + spreadFactor: "", + balancerPoolId: BigInt(0) + }; +} +export const PoolRecordWithCFMMLink = { + typeUrl: "/osmosis.gamm.v1beta1.PoolRecordWithCFMMLink", + aminoType: "osmosis/gamm/pool-record-with-cfmm-link", + is(o: any): o is PoolRecordWithCFMMLink { + return o && (o.$typeUrl === PoolRecordWithCFMMLink.typeUrl || typeof o.denom0 === "string" && typeof o.denom1 === "string" && typeof o.tickSpacing === "bigint" && typeof o.exponentAtPriceOne === "string" && typeof o.spreadFactor === "string" && typeof o.balancerPoolId === "bigint"); + }, + isSDK(o: any): o is PoolRecordWithCFMMLinkSDKType { + return o && (o.$typeUrl === PoolRecordWithCFMMLink.typeUrl || typeof o.denom0 === "string" && typeof o.denom1 === "string" && typeof o.tick_spacing === "bigint" && typeof o.exponent_at_price_one === "string" && typeof o.spread_factor === "string" && typeof o.balancer_pool_id === "bigint"); + }, + isAmino(o: any): o is PoolRecordWithCFMMLinkAmino { + return o && (o.$typeUrl === PoolRecordWithCFMMLink.typeUrl || typeof o.denom0 === "string" && typeof o.denom1 === "string" && typeof o.tick_spacing === "bigint" && typeof o.exponent_at_price_one === "string" && typeof o.spread_factor === "string" && typeof o.balancer_pool_id === "bigint"); + }, + encode(message: PoolRecordWithCFMMLink, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.denom0 !== "") { + writer.uint32(10).string(message.denom0); + } + if (message.denom1 !== "") { + writer.uint32(18).string(message.denom1); + } + if (message.tickSpacing !== BigInt(0)) { + writer.uint32(24).uint64(message.tickSpacing); + } + if (message.exponentAtPriceOne !== "") { + writer.uint32(34).string(message.exponentAtPriceOne); + } + if (message.spreadFactor !== "") { + writer.uint32(42).string(Decimal.fromUserInput(message.spreadFactor, 18).atomics); + } + if (message.balancerPoolId !== BigInt(0)) { + writer.uint32(48).uint64(message.balancerPoolId); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): PoolRecordWithCFMMLink { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBasePoolRecordWithCFMMLink(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.denom0 = reader.string(); + break; + case 2: + message.denom1 = reader.string(); + break; + case 3: + message.tickSpacing = reader.uint64(); + break; + case 4: + message.exponentAtPriceOne = reader.string(); + break; + case 5: + message.spreadFactor = Decimal.fromAtomics(reader.string(), 18).toString(); + break; + case 6: + message.balancerPoolId = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): PoolRecordWithCFMMLink { + return { + denom0: isSet(object.denom0) ? String(object.denom0) : "", + denom1: isSet(object.denom1) ? String(object.denom1) : "", + tickSpacing: isSet(object.tickSpacing) ? BigInt(object.tickSpacing.toString()) : BigInt(0), + exponentAtPriceOne: isSet(object.exponentAtPriceOne) ? String(object.exponentAtPriceOne) : "", + spreadFactor: isSet(object.spreadFactor) ? String(object.spreadFactor) : "", + balancerPoolId: isSet(object.balancerPoolId) ? BigInt(object.balancerPoolId.toString()) : BigInt(0) + }; + }, + toJSON(message: PoolRecordWithCFMMLink): unknown { + const obj: any = {}; + message.denom0 !== undefined && (obj.denom0 = message.denom0); + message.denom1 !== undefined && (obj.denom1 = message.denom1); + message.tickSpacing !== undefined && (obj.tickSpacing = (message.tickSpacing || BigInt(0)).toString()); + message.exponentAtPriceOne !== undefined && (obj.exponentAtPriceOne = message.exponentAtPriceOne); + message.spreadFactor !== undefined && (obj.spreadFactor = message.spreadFactor); + message.balancerPoolId !== undefined && (obj.balancerPoolId = (message.balancerPoolId || BigInt(0)).toString()); + return obj; + }, + fromPartial(object: Partial): PoolRecordWithCFMMLink { + const message = createBasePoolRecordWithCFMMLink(); + message.denom0 = object.denom0 ?? ""; + message.denom1 = object.denom1 ?? ""; + message.tickSpacing = object.tickSpacing !== undefined && object.tickSpacing !== null ? BigInt(object.tickSpacing.toString()) : BigInt(0); + message.exponentAtPriceOne = object.exponentAtPriceOne ?? ""; + message.spreadFactor = object.spreadFactor ?? ""; + message.balancerPoolId = object.balancerPoolId !== undefined && object.balancerPoolId !== null ? BigInt(object.balancerPoolId.toString()) : BigInt(0); + return message; + }, + fromAmino(object: PoolRecordWithCFMMLinkAmino): PoolRecordWithCFMMLink { + const message = createBasePoolRecordWithCFMMLink(); + if (object.denom0 !== undefined && object.denom0 !== null) { + message.denom0 = object.denom0; + } + if (object.denom1 !== undefined && object.denom1 !== null) { + message.denom1 = object.denom1; + } + if (object.tick_spacing !== undefined && object.tick_spacing !== null) { + message.tickSpacing = BigInt(object.tick_spacing); + } + if (object.exponent_at_price_one !== undefined && object.exponent_at_price_one !== null) { + message.exponentAtPriceOne = object.exponent_at_price_one; + } + if (object.spread_factor !== undefined && object.spread_factor !== null) { + message.spreadFactor = object.spread_factor; + } + if (object.balancer_pool_id !== undefined && object.balancer_pool_id !== null) { + message.balancerPoolId = BigInt(object.balancer_pool_id); + } + return message; + }, + toAmino(message: PoolRecordWithCFMMLink): PoolRecordWithCFMMLinkAmino { + const obj: any = {}; + obj.denom0 = message.denom0; + obj.denom1 = message.denom1; + obj.tick_spacing = message.tickSpacing ? message.tickSpacing.toString() : undefined; + obj.exponent_at_price_one = message.exponentAtPriceOne; + obj.spread_factor = message.spreadFactor; + obj.balancer_pool_id = message.balancerPoolId ? message.balancerPoolId.toString() : undefined; + return obj; + }, + fromAminoMsg(object: PoolRecordWithCFMMLinkAminoMsg): PoolRecordWithCFMMLink { + return PoolRecordWithCFMMLink.fromAmino(object.value); + }, + toAminoMsg(message: PoolRecordWithCFMMLink): PoolRecordWithCFMMLinkAminoMsg { + return { + type: "osmosis/gamm/pool-record-with-cfmm-link", + value: PoolRecordWithCFMMLink.toAmino(message) + }; + }, + fromProtoMsg(message: PoolRecordWithCFMMLinkProtoMsg): PoolRecordWithCFMMLink { + return PoolRecordWithCFMMLink.decode(message.value); + }, + toProto(message: PoolRecordWithCFMMLink): Uint8Array { + return PoolRecordWithCFMMLink.encode(message).finish(); + }, + toProtoMsg(message: PoolRecordWithCFMMLink): PoolRecordWithCFMMLinkProtoMsg { + return { + typeUrl: "/osmosis.gamm.v1beta1.PoolRecordWithCFMMLink", + value: PoolRecordWithCFMMLink.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(PoolRecordWithCFMMLink.typeUrl, PoolRecordWithCFMMLink); +GlobalDecoderRegistry.registerAminoProtoMapping(PoolRecordWithCFMMLink.aminoType, PoolRecordWithCFMMLink.typeUrl); +function createBaseCreateConcentratedLiquidityPoolsAndLinktoCFMMProposal(): CreateConcentratedLiquidityPoolsAndLinktoCFMMProposal { + return { + $typeUrl: "/osmosis.gamm.v1beta1.CreateConcentratedLiquidityPoolsAndLinktoCFMMProposal", + title: "", + description: "", + poolRecordsWithCfmmLink: [] + }; +} +export const CreateConcentratedLiquidityPoolsAndLinktoCFMMProposal = { + typeUrl: "/osmosis.gamm.v1beta1.CreateConcentratedLiquidityPoolsAndLinktoCFMMProposal", + aminoType: "osmosis/CreateConcentratedLiquidityPoolsAndLinktoCFMMProposal", + is(o: any): o is CreateConcentratedLiquidityPoolsAndLinktoCFMMProposal { + return o && (o.$typeUrl === CreateConcentratedLiquidityPoolsAndLinktoCFMMProposal.typeUrl || typeof o.title === "string" && typeof o.description === "string" && Array.isArray(o.poolRecordsWithCfmmLink) && (!o.poolRecordsWithCfmmLink.length || PoolRecordWithCFMMLink.is(o.poolRecordsWithCfmmLink[0]))); + }, + isSDK(o: any): o is CreateConcentratedLiquidityPoolsAndLinktoCFMMProposalSDKType { + return o && (o.$typeUrl === CreateConcentratedLiquidityPoolsAndLinktoCFMMProposal.typeUrl || typeof o.title === "string" && typeof o.description === "string" && Array.isArray(o.pool_records_with_cfmm_link) && (!o.pool_records_with_cfmm_link.length || PoolRecordWithCFMMLink.isSDK(o.pool_records_with_cfmm_link[0]))); + }, + isAmino(o: any): o is CreateConcentratedLiquidityPoolsAndLinktoCFMMProposalAmino { + return o && (o.$typeUrl === CreateConcentratedLiquidityPoolsAndLinktoCFMMProposal.typeUrl || typeof o.title === "string" && typeof o.description === "string" && Array.isArray(o.pool_records_with_cfmm_link) && (!o.pool_records_with_cfmm_link.length || PoolRecordWithCFMMLink.isAmino(o.pool_records_with_cfmm_link[0]))); + }, + encode(message: CreateConcentratedLiquidityPoolsAndLinktoCFMMProposal, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.title !== "") { + writer.uint32(10).string(message.title); + } + if (message.description !== "") { + writer.uint32(18).string(message.description); + } + for (const v of message.poolRecordsWithCfmmLink) { + PoolRecordWithCFMMLink.encode(v!, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): CreateConcentratedLiquidityPoolsAndLinktoCFMMProposal { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseCreateConcentratedLiquidityPoolsAndLinktoCFMMProposal(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.title = reader.string(); + break; + case 2: + message.description = reader.string(); + break; + case 3: + message.poolRecordsWithCfmmLink.push(PoolRecordWithCFMMLink.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): CreateConcentratedLiquidityPoolsAndLinktoCFMMProposal { + return { + title: isSet(object.title) ? String(object.title) : "", + description: isSet(object.description) ? String(object.description) : "", + poolRecordsWithCfmmLink: Array.isArray(object?.poolRecordsWithCfmmLink) ? object.poolRecordsWithCfmmLink.map((e: any) => PoolRecordWithCFMMLink.fromJSON(e)) : [] + }; + }, + toJSON(message: CreateConcentratedLiquidityPoolsAndLinktoCFMMProposal): unknown { + const obj: any = {}; + message.title !== undefined && (obj.title = message.title); + message.description !== undefined && (obj.description = message.description); + if (message.poolRecordsWithCfmmLink) { + obj.poolRecordsWithCfmmLink = message.poolRecordsWithCfmmLink.map(e => e ? PoolRecordWithCFMMLink.toJSON(e) : undefined); + } else { + obj.poolRecordsWithCfmmLink = []; + } + return obj; + }, + fromPartial(object: Partial): CreateConcentratedLiquidityPoolsAndLinktoCFMMProposal { + const message = createBaseCreateConcentratedLiquidityPoolsAndLinktoCFMMProposal(); + message.title = object.title ?? ""; + message.description = object.description ?? ""; + message.poolRecordsWithCfmmLink = object.poolRecordsWithCfmmLink?.map(e => PoolRecordWithCFMMLink.fromPartial(e)) || []; + return message; + }, + fromAmino(object: CreateConcentratedLiquidityPoolsAndLinktoCFMMProposalAmino): CreateConcentratedLiquidityPoolsAndLinktoCFMMProposal { + const message = createBaseCreateConcentratedLiquidityPoolsAndLinktoCFMMProposal(); + if (object.title !== undefined && object.title !== null) { + message.title = object.title; + } + if (object.description !== undefined && object.description !== null) { + message.description = object.description; + } + message.poolRecordsWithCfmmLink = object.pool_records_with_cfmm_link?.map(e => PoolRecordWithCFMMLink.fromAmino(e)) || []; + return message; + }, + toAmino(message: CreateConcentratedLiquidityPoolsAndLinktoCFMMProposal): CreateConcentratedLiquidityPoolsAndLinktoCFMMProposalAmino { + const obj: any = {}; + obj.title = message.title; + obj.description = message.description; + if (message.poolRecordsWithCfmmLink) { + obj.pool_records_with_cfmm_link = message.poolRecordsWithCfmmLink.map(e => e ? PoolRecordWithCFMMLink.toAmino(e) : undefined); + } else { + obj.pool_records_with_cfmm_link = []; + } + return obj; + }, + fromAminoMsg(object: CreateConcentratedLiquidityPoolsAndLinktoCFMMProposalAminoMsg): CreateConcentratedLiquidityPoolsAndLinktoCFMMProposal { + return CreateConcentratedLiquidityPoolsAndLinktoCFMMProposal.fromAmino(object.value); + }, + toAminoMsg(message: CreateConcentratedLiquidityPoolsAndLinktoCFMMProposal): CreateConcentratedLiquidityPoolsAndLinktoCFMMProposalAminoMsg { + return { + type: "osmosis/CreateConcentratedLiquidityPoolsAndLinktoCFMMProposal", + value: CreateConcentratedLiquidityPoolsAndLinktoCFMMProposal.toAmino(message) + }; + }, + fromProtoMsg(message: CreateConcentratedLiquidityPoolsAndLinktoCFMMProposalProtoMsg): CreateConcentratedLiquidityPoolsAndLinktoCFMMProposal { + return CreateConcentratedLiquidityPoolsAndLinktoCFMMProposal.decode(message.value); + }, + toProto(message: CreateConcentratedLiquidityPoolsAndLinktoCFMMProposal): Uint8Array { + return CreateConcentratedLiquidityPoolsAndLinktoCFMMProposal.encode(message).finish(); + }, + toProtoMsg(message: CreateConcentratedLiquidityPoolsAndLinktoCFMMProposal): CreateConcentratedLiquidityPoolsAndLinktoCFMMProposalProtoMsg { + return { + typeUrl: "/osmosis.gamm.v1beta1.CreateConcentratedLiquidityPoolsAndLinktoCFMMProposal", + value: CreateConcentratedLiquidityPoolsAndLinktoCFMMProposal.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(CreateConcentratedLiquidityPoolsAndLinktoCFMMProposal.typeUrl, CreateConcentratedLiquidityPoolsAndLinktoCFMMProposal); +GlobalDecoderRegistry.registerAminoProtoMapping(CreateConcentratedLiquidityPoolsAndLinktoCFMMProposal.aminoType, CreateConcentratedLiquidityPoolsAndLinktoCFMMProposal.typeUrl); +function createBaseSetScalingFactorControllerProposal(): SetScalingFactorControllerProposal { + return { + $typeUrl: "/osmosis.gamm.v1beta1.SetScalingFactorControllerProposal", + title: "", + description: "", + poolId: BigInt(0), + controllerAddress: "" + }; +} +export const SetScalingFactorControllerProposal = { + typeUrl: "/osmosis.gamm.v1beta1.SetScalingFactorControllerProposal", + aminoType: "osmosis/SetScalingFactorControllerProposal", + is(o: any): o is SetScalingFactorControllerProposal { + return o && (o.$typeUrl === SetScalingFactorControllerProposal.typeUrl || typeof o.title === "string" && typeof o.description === "string" && typeof o.poolId === "bigint" && typeof o.controllerAddress === "string"); + }, + isSDK(o: any): o is SetScalingFactorControllerProposalSDKType { + return o && (o.$typeUrl === SetScalingFactorControllerProposal.typeUrl || typeof o.title === "string" && typeof o.description === "string" && typeof o.pool_id === "bigint" && typeof o.controller_address === "string"); + }, + isAmino(o: any): o is SetScalingFactorControllerProposalAmino { + return o && (o.$typeUrl === SetScalingFactorControllerProposal.typeUrl || typeof o.title === "string" && typeof o.description === "string" && typeof o.pool_id === "bigint" && typeof o.controller_address === "string"); + }, + encode(message: SetScalingFactorControllerProposal, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.title !== "") { + writer.uint32(10).string(message.title); + } + if (message.description !== "") { + writer.uint32(18).string(message.description); + } + if (message.poolId !== BigInt(0)) { + writer.uint32(24).uint64(message.poolId); + } + if (message.controllerAddress !== "") { + writer.uint32(34).string(message.controllerAddress); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): SetScalingFactorControllerProposal { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSetScalingFactorControllerProposal(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.title = reader.string(); + break; + case 2: + message.description = reader.string(); + break; + case 3: + message.poolId = reader.uint64(); + break; + case 4: + message.controllerAddress = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): SetScalingFactorControllerProposal { + return { + title: isSet(object.title) ? String(object.title) : "", + description: isSet(object.description) ? String(object.description) : "", + poolId: isSet(object.poolId) ? BigInt(object.poolId.toString()) : BigInt(0), + controllerAddress: isSet(object.controllerAddress) ? String(object.controllerAddress) : "" + }; + }, + toJSON(message: SetScalingFactorControllerProposal): unknown { + const obj: any = {}; + message.title !== undefined && (obj.title = message.title); + message.description !== undefined && (obj.description = message.description); + message.poolId !== undefined && (obj.poolId = (message.poolId || BigInt(0)).toString()); + message.controllerAddress !== undefined && (obj.controllerAddress = message.controllerAddress); + return obj; + }, + fromPartial(object: Partial): SetScalingFactorControllerProposal { + const message = createBaseSetScalingFactorControllerProposal(); + message.title = object.title ?? ""; + message.description = object.description ?? ""; + message.poolId = object.poolId !== undefined && object.poolId !== null ? BigInt(object.poolId.toString()) : BigInt(0); + message.controllerAddress = object.controllerAddress ?? ""; + return message; + }, + fromAmino(object: SetScalingFactorControllerProposalAmino): SetScalingFactorControllerProposal { + const message = createBaseSetScalingFactorControllerProposal(); + if (object.title !== undefined && object.title !== null) { + message.title = object.title; + } + if (object.description !== undefined && object.description !== null) { + message.description = object.description; + } + if (object.pool_id !== undefined && object.pool_id !== null) { + message.poolId = BigInt(object.pool_id); + } + if (object.controller_address !== undefined && object.controller_address !== null) { + message.controllerAddress = object.controller_address; + } + return message; + }, + toAmino(message: SetScalingFactorControllerProposal): SetScalingFactorControllerProposalAmino { + const obj: any = {}; + obj.title = message.title; + obj.description = message.description; + obj.pool_id = message.poolId ? message.poolId.toString() : undefined; + obj.controller_address = message.controllerAddress; + return obj; + }, + fromAminoMsg(object: SetScalingFactorControllerProposalAminoMsg): SetScalingFactorControllerProposal { + return SetScalingFactorControllerProposal.fromAmino(object.value); + }, + toAminoMsg(message: SetScalingFactorControllerProposal): SetScalingFactorControllerProposalAminoMsg { + return { + type: "osmosis/SetScalingFactorControllerProposal", + value: SetScalingFactorControllerProposal.toAmino(message) + }; + }, + fromProtoMsg(message: SetScalingFactorControllerProposalProtoMsg): SetScalingFactorControllerProposal { + return SetScalingFactorControllerProposal.decode(message.value); + }, + toProto(message: SetScalingFactorControllerProposal): Uint8Array { + return SetScalingFactorControllerProposal.encode(message).finish(); + }, + toProtoMsg(message: SetScalingFactorControllerProposal): SetScalingFactorControllerProposalProtoMsg { + return { + typeUrl: "/osmosis.gamm.v1beta1.SetScalingFactorControllerProposal", + value: SetScalingFactorControllerProposal.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(SetScalingFactorControllerProposal.typeUrl, SetScalingFactorControllerProposal); +GlobalDecoderRegistry.registerAminoProtoMapping(SetScalingFactorControllerProposal.aminoType, SetScalingFactorControllerProposal.typeUrl); \ No newline at end of file diff --git a/packages/osmojs/src/codegen/osmosis/gamm/v1beta1/query.lcd.ts b/packages/osmojs/src/codegen/osmosis/gamm/v1beta1/query.lcd.ts index fe3524817..ce7d3325e 100644 --- a/packages/osmojs/src/codegen/osmosis/gamm/v1beta1/query.lcd.ts +++ b/packages/osmojs/src/codegen/osmosis/gamm/v1beta1/query.lcd.ts @@ -1,6 +1,6 @@ import { setPaginationParams } from "../../../helpers"; import { LCDClient } from "@cosmology/lcd"; -import { QueryPoolsRequest, QueryPoolsResponseSDKType, QueryNumPoolsRequest, QueryNumPoolsResponseSDKType, QueryTotalLiquidityRequest, QueryTotalLiquidityResponseSDKType, QueryPoolsWithFilterRequest, QueryPoolsWithFilterResponseSDKType, QueryPoolRequest, QueryPoolResponseSDKType, QueryPoolTypeRequest, QueryPoolTypeResponseSDKType, QueryCalcJoinPoolSharesRequest, QueryCalcJoinPoolSharesResponseSDKType, QueryCalcExitPoolCoinsFromSharesRequest, QueryCalcExitPoolCoinsFromSharesResponseSDKType, QueryPoolParamsRequest, QueryPoolParamsResponseSDKType, QueryTotalPoolLiquidityRequest, QueryTotalPoolLiquidityResponseSDKType, QueryTotalSharesRequest, QueryTotalSharesResponseSDKType, QuerySpotPriceRequest, QuerySpotPriceResponseSDKType, QuerySwapExactAmountInRequest, QuerySwapExactAmountInResponseSDKType, QuerySwapExactAmountOutRequest, QuerySwapExactAmountOutResponseSDKType, QueryConcentratedPoolIdLinkFromCFMMRequest, QueryConcentratedPoolIdLinkFromCFMMResponseSDKType } from "./query"; +import { QueryPoolsRequest, QueryPoolsResponseSDKType, QueryNumPoolsRequest, QueryNumPoolsResponseSDKType, QueryTotalLiquidityRequest, QueryTotalLiquidityResponseSDKType, QueryPoolsWithFilterRequest, QueryPoolsWithFilterResponseSDKType, QueryPoolRequest, QueryPoolResponseSDKType, QueryPoolTypeRequest, QueryPoolTypeResponseSDKType, QueryCalcJoinPoolSharesRequest, QueryCalcJoinPoolSharesResponseSDKType, QueryCalcExitPoolCoinsFromSharesRequest, QueryCalcExitPoolCoinsFromSharesResponseSDKType, QueryPoolParamsRequest, QueryPoolParamsResponseSDKType, QueryTotalPoolLiquidityRequest, QueryTotalPoolLiquidityResponseSDKType, QueryTotalSharesRequest, QueryTotalSharesResponseSDKType, QuerySpotPriceRequest, QuerySpotPriceResponseSDKType, QuerySwapExactAmountInRequest, QuerySwapExactAmountInResponseSDKType, QuerySwapExactAmountOutRequest, QuerySwapExactAmountOutResponseSDKType, QueryConcentratedPoolIdLinkFromCFMMRequest, QueryConcentratedPoolIdLinkFromCFMMResponseSDKType, QueryCFMMConcentratedPoolLinksRequest, QueryCFMMConcentratedPoolLinksResponseSDKType } from "./query"; export class LCDQueryClient { req: LCDClient; constructor({ @@ -24,6 +24,7 @@ export class LCDQueryClient { this.estimateSwapExactAmountIn = this.estimateSwapExactAmountIn.bind(this); this.estimateSwapExactAmountOut = this.estimateSwapExactAmountOut.bind(this); this.concentratedPoolIdLinkFromCFMM = this.concentratedPoolIdLinkFromCFMM.bind(this); + this.cFMMConcentratedPoolLinks = this.cFMMConcentratedPoolLinks.bind(this); } /* Pools */ async pools(params: QueryPoolsRequest = { @@ -170,4 +171,10 @@ export class LCDQueryClient { const endpoint = `osmosis/gamm/v1beta1/concentrated_pool_id_link_from_cfmm/${params.cfmmPoolId}`; return await this.req.get(endpoint); } + /* CFMMConcentratedPoolLinks returns migration links between CFMM and + Concentrated pools. */ + async cFMMConcentratedPoolLinks(_params: QueryCFMMConcentratedPoolLinksRequest = {}): Promise { + const endpoint = `osmosis/gamm/v1beta1/cfmm_concentrated_pool_links`; + return await this.req.get(endpoint); + } } \ No newline at end of file diff --git a/packages/osmojs/src/codegen/osmosis/gamm/v1beta1/query.rpc.Query.ts b/packages/osmojs/src/codegen/osmosis/gamm/v1beta1/query.rpc.Query.ts index dcf490d8b..3c061928b 100644 --- a/packages/osmojs/src/codegen/osmosis/gamm/v1beta1/query.rpc.Query.ts +++ b/packages/osmojs/src/codegen/osmosis/gamm/v1beta1/query.rpc.Query.ts @@ -1,7 +1,7 @@ import { Rpc } from "../../../helpers"; import { BinaryReader } from "../../../binary"; import { QueryClient, createProtobufRpcClient } from "@cosmjs/stargate"; -import { QueryPoolsRequest, QueryPoolsResponse, QueryNumPoolsRequest, QueryNumPoolsResponse, QueryTotalLiquidityRequest, QueryTotalLiquidityResponse, QueryPoolsWithFilterRequest, QueryPoolsWithFilterResponse, QueryPoolRequest, QueryPoolResponse, QueryPoolTypeRequest, QueryPoolTypeResponse, QueryCalcJoinPoolNoSwapSharesRequest, QueryCalcJoinPoolNoSwapSharesResponse, QueryCalcJoinPoolSharesRequest, QueryCalcJoinPoolSharesResponse, QueryCalcExitPoolCoinsFromSharesRequest, QueryCalcExitPoolCoinsFromSharesResponse, QueryPoolParamsRequest, QueryPoolParamsResponse, QueryTotalPoolLiquidityRequest, QueryTotalPoolLiquidityResponse, QueryTotalSharesRequest, QueryTotalSharesResponse, QuerySpotPriceRequest, QuerySpotPriceResponse, QuerySwapExactAmountInRequest, QuerySwapExactAmountInResponse, QuerySwapExactAmountOutRequest, QuerySwapExactAmountOutResponse, QueryConcentratedPoolIdLinkFromCFMMRequest, QueryConcentratedPoolIdLinkFromCFMMResponse } from "./query"; +import { QueryPoolsRequest, QueryPoolsResponse, QueryNumPoolsRequest, QueryNumPoolsResponse, QueryTotalLiquidityRequest, QueryTotalLiquidityResponse, QueryPoolsWithFilterRequest, QueryPoolsWithFilterResponse, QueryPoolRequest, QueryPoolResponse, QueryPoolTypeRequest, QueryPoolTypeResponse, QueryCalcJoinPoolNoSwapSharesRequest, QueryCalcJoinPoolNoSwapSharesResponse, QueryCalcJoinPoolSharesRequest, QueryCalcJoinPoolSharesResponse, QueryCalcExitPoolCoinsFromSharesRequest, QueryCalcExitPoolCoinsFromSharesResponse, QueryPoolParamsRequest, QueryPoolParamsResponse, QueryTotalPoolLiquidityRequest, QueryTotalPoolLiquidityResponse, QueryTotalSharesRequest, QueryTotalSharesResponse, QuerySpotPriceRequest, QuerySpotPriceResponse, QuerySwapExactAmountInRequest, QuerySwapExactAmountInResponse, QuerySwapExactAmountOutRequest, QuerySwapExactAmountOutResponse, QueryConcentratedPoolIdLinkFromCFMMRequest, QueryConcentratedPoolIdLinkFromCFMMResponse, QueryCFMMConcentratedPoolLinksRequest, QueryCFMMConcentratedPoolLinksResponse } from "./query"; export interface Query { pools(request?: QueryPoolsRequest): Promise; /** Deprecated: please use the alternative in x/poolmanager */ @@ -45,6 +45,11 @@ export interface Query { * pool that is linked with the given CFMM pool. */ concentratedPoolIdLinkFromCFMM(request: QueryConcentratedPoolIdLinkFromCFMMRequest): Promise; + /** + * CFMMConcentratedPoolLinks returns migration links between CFMM and + * Concentrated pools. + */ + cFMMConcentratedPoolLinks(request?: QueryCFMMConcentratedPoolLinksRequest): Promise; } export class QueryClientImpl implements Query { private readonly rpc: Rpc; @@ -66,6 +71,7 @@ export class QueryClientImpl implements Query { this.estimateSwapExactAmountIn = this.estimateSwapExactAmountIn.bind(this); this.estimateSwapExactAmountOut = this.estimateSwapExactAmountOut.bind(this); this.concentratedPoolIdLinkFromCFMM = this.concentratedPoolIdLinkFromCFMM.bind(this); + this.cFMMConcentratedPoolLinks = this.cFMMConcentratedPoolLinks.bind(this); } pools(request: QueryPoolsRequest = { pagination: undefined @@ -149,6 +155,11 @@ export class QueryClientImpl implements Query { const promise = this.rpc.request("osmosis.gamm.v1beta1.Query", "ConcentratedPoolIdLinkFromCFMM", data); return promise.then(data => QueryConcentratedPoolIdLinkFromCFMMResponse.decode(new BinaryReader(data))); } + cFMMConcentratedPoolLinks(request: QueryCFMMConcentratedPoolLinksRequest = {}): Promise { + const data = QueryCFMMConcentratedPoolLinksRequest.encode(request).finish(); + const promise = this.rpc.request("osmosis.gamm.v1beta1.Query", "CFMMConcentratedPoolLinks", data); + return promise.then(data => QueryCFMMConcentratedPoolLinksResponse.decode(new BinaryReader(data))); + } } export const createRpcQueryExtension = (base: QueryClient) => { const rpc = createProtobufRpcClient(base); @@ -201,6 +212,9 @@ export const createRpcQueryExtension = (base: QueryClient) => { }, concentratedPoolIdLinkFromCFMM(request: QueryConcentratedPoolIdLinkFromCFMMRequest): Promise { return queryService.concentratedPoolIdLinkFromCFMM(request); + }, + cFMMConcentratedPoolLinks(request?: QueryCFMMConcentratedPoolLinksRequest): Promise { + return queryService.cFMMConcentratedPoolLinks(request); } }; }; \ No newline at end of file diff --git a/packages/osmojs/src/codegen/osmosis/gamm/v1beta1/query.ts b/packages/osmojs/src/codegen/osmosis/gamm/v1beta1/query.ts index 7fa779ad9..af5f4a1f7 100644 --- a/packages/osmojs/src/codegen/osmosis/gamm/v1beta1/query.ts +++ b/packages/osmojs/src/codegen/osmosis/gamm/v1beta1/query.ts @@ -2,17 +2,20 @@ import { PageRequest, PageRequestAmino, PageRequestSDKType, PageResponse, PageRe import { Coin, CoinAmino, CoinSDKType } from "../../../cosmos/base/v1beta1/coin"; import { SwapAmountInRoute, SwapAmountInRouteAmino, SwapAmountInRouteSDKType, SwapAmountOutRoute, SwapAmountOutRouteAmino, SwapAmountOutRouteSDKType } from "../../poolmanager/v1beta1/swap_route"; import { Any, AnyProtoMsg, AnyAmino, AnySDKType } from "../../../google/protobuf/any"; -import { Pool as Pool1 } from "../../concentrated-liquidity/pool"; -import { PoolProtoMsg as Pool1ProtoMsg } from "../../concentrated-liquidity/pool"; -import { PoolSDKType as Pool1SDKType } from "../../concentrated-liquidity/pool"; +import { MigrationRecords, MigrationRecordsAmino, MigrationRecordsSDKType } from "./shared"; +import { Pool as Pool1 } from "../../concentratedliquidity/v1beta1/pool"; +import { PoolProtoMsg as Pool1ProtoMsg } from "../../concentratedliquidity/v1beta1/pool"; +import { PoolSDKType as Pool1SDKType } from "../../concentratedliquidity/v1beta1/pool"; import { CosmWasmPool, CosmWasmPoolProtoMsg, CosmWasmPoolSDKType } from "../../cosmwasmpool/v1beta1/model/pool"; -import { Pool as Pool2 } from "../pool-models/balancer/balancerPool"; -import { PoolProtoMsg as Pool2ProtoMsg } from "../pool-models/balancer/balancerPool"; -import { PoolSDKType as Pool2SDKType } from "../pool-models/balancer/balancerPool"; -import { Pool as Pool3 } from "../pool-models/stableswap/stableswap_pool"; -import { PoolProtoMsg as Pool3ProtoMsg } from "../pool-models/stableswap/stableswap_pool"; -import { PoolSDKType as Pool3SDKType } from "../pool-models/stableswap/stableswap_pool"; +import { Pool as Pool2 } from "../poolmodels/stableswap/v1beta1/stableswap_pool"; +import { PoolProtoMsg as Pool2ProtoMsg } from "../poolmodels/stableswap/v1beta1/stableswap_pool"; +import { PoolSDKType as Pool2SDKType } from "../poolmodels/stableswap/v1beta1/stableswap_pool"; +import { Pool as Pool3 } from "./balancerPool"; +import { PoolProtoMsg as Pool3ProtoMsg } from "./balancerPool"; +import { PoolSDKType as Pool3SDKType } from "./balancerPool"; import { BinaryReader, BinaryWriter } from "../../../binary"; +import { isSet } from "../../../helpers"; +import { GlobalDecoderRegistry } from "../../../registry"; /** * =============================== Pool * Deprecated: please use the alternative in x/poolmanager @@ -31,7 +34,7 @@ export interface QueryPoolRequestProtoMsg { */ /** @deprecated */ export interface QueryPoolRequestAmino { - pool_id: string; + pool_id?: string; } export interface QueryPoolRequestAminoMsg { type: "osmosis/gamm/query-pool-request"; @@ -48,7 +51,7 @@ export interface QueryPoolRequestSDKType { /** Deprecated: please use the alternative in x/poolmanager */ /** @deprecated */ export interface QueryPoolResponse { - pool: (Pool1 & CosmWasmPool & Pool2 & Pool3 & Any) | undefined; + pool?: Pool1 | CosmWasmPool | Pool2 | Pool3 | Any | undefined; } export interface QueryPoolResponseProtoMsg { typeUrl: "/osmosis.gamm.v1beta1.QueryPoolResponse"; @@ -69,12 +72,12 @@ export interface QueryPoolResponseAminoMsg { /** Deprecated: please use the alternative in x/poolmanager */ /** @deprecated */ export interface QueryPoolResponseSDKType { - pool: Pool1SDKType | CosmWasmPoolSDKType | Pool2SDKType | Pool3SDKType | AnySDKType | undefined; + pool?: Pool1SDKType | CosmWasmPoolSDKType | Pool2SDKType | Pool3SDKType | AnySDKType | undefined; } /** =============================== Pools */ export interface QueryPoolsRequest { /** pagination defines an optional pagination for the request. */ - pagination: PageRequest; + pagination?: PageRequest; } export interface QueryPoolsRequestProtoMsg { typeUrl: "/osmosis.gamm.v1beta1.QueryPoolsRequest"; @@ -91,12 +94,12 @@ export interface QueryPoolsRequestAminoMsg { } /** =============================== Pools */ export interface QueryPoolsRequestSDKType { - pagination: PageRequestSDKType; + pagination?: PageRequestSDKType; } export interface QueryPoolsResponse { - pools: (Pool1 & CosmWasmPool & Pool2 & Pool3 & Any)[] | Any[]; + pools: (Pool1 | CosmWasmPool | Pool2 | Pool3 | Any)[] | Any[]; /** pagination defines the pagination in the response. */ - pagination: PageResponse; + pagination?: PageResponse; } export interface QueryPoolsResponseProtoMsg { typeUrl: "/osmosis.gamm.v1beta1.QueryPoolsResponse"; @@ -106,7 +109,7 @@ export type QueryPoolsResponseEncoded = Omit & { pools: (Pool1ProtoMsg | CosmWasmPoolProtoMsg | Pool2ProtoMsg | Pool3ProtoMsg | AnyProtoMsg)[]; }; export interface QueryPoolsResponseAmino { - pools: AnyAmino[]; + pools?: AnyAmino[]; /** pagination defines the pagination in the response. */ pagination?: PageResponseAmino; } @@ -116,7 +119,7 @@ export interface QueryPoolsResponseAminoMsg { } export interface QueryPoolsResponseSDKType { pools: (Pool1SDKType | CosmWasmPoolSDKType | Pool2SDKType | Pool3SDKType | AnySDKType)[]; - pagination: PageResponseSDKType; + pagination?: PageResponseSDKType; } /** =============================== NumPools */ /** @deprecated */ @@ -145,7 +148,7 @@ export interface QueryNumPoolsResponseProtoMsg { } /** @deprecated */ export interface QueryNumPoolsResponseAmino { - num_pools: string; + num_pools?: string; } export interface QueryNumPoolsResponseAminoMsg { type: "osmosis/gamm/query-num-pools-response"; @@ -165,7 +168,7 @@ export interface QueryPoolTypeRequestProtoMsg { } /** =============================== PoolType */ export interface QueryPoolTypeRequestAmino { - pool_id: string; + pool_id?: string; } export interface QueryPoolTypeRequestAminoMsg { type: "osmosis/gamm/query-pool-type-request"; @@ -183,7 +186,7 @@ export interface QueryPoolTypeResponseProtoMsg { value: Uint8Array; } export interface QueryPoolTypeResponseAmino { - pool_type: string; + pool_type?: string; } export interface QueryPoolTypeResponseAminoMsg { type: "osmosis/gamm/query-pool-type-response"; @@ -203,8 +206,8 @@ export interface QueryCalcJoinPoolSharesRequestProtoMsg { } /** =============================== CalcJoinPoolShares */ export interface QueryCalcJoinPoolSharesRequestAmino { - pool_id: string; - tokens_in: CoinAmino[]; + pool_id?: string; + tokens_in?: CoinAmino[]; } export interface QueryCalcJoinPoolSharesRequestAminoMsg { type: "osmosis/gamm/query-calc-join-pool-shares-request"; @@ -224,8 +227,8 @@ export interface QueryCalcJoinPoolSharesResponseProtoMsg { value: Uint8Array; } export interface QueryCalcJoinPoolSharesResponseAmino { - share_out_amount: string; - tokens_out: CoinAmino[]; + share_out_amount?: string; + tokens_out?: CoinAmino[]; } export interface QueryCalcJoinPoolSharesResponseAminoMsg { type: "osmosis/gamm/query-calc-join-pool-shares-response"; @@ -246,8 +249,8 @@ export interface QueryCalcExitPoolCoinsFromSharesRequestProtoMsg { } /** =============================== CalcExitPoolCoinsFromShares */ export interface QueryCalcExitPoolCoinsFromSharesRequestAmino { - pool_id: string; - share_in_amount: string; + pool_id?: string; + share_in_amount?: string; } export interface QueryCalcExitPoolCoinsFromSharesRequestAminoMsg { type: "osmosis/gamm/query-calc-exit-pool-coins-from-shares-request"; @@ -266,7 +269,7 @@ export interface QueryCalcExitPoolCoinsFromSharesResponseProtoMsg { value: Uint8Array; } export interface QueryCalcExitPoolCoinsFromSharesResponseAmino { - tokens_out: CoinAmino[]; + tokens_out?: CoinAmino[]; } export interface QueryCalcExitPoolCoinsFromSharesResponseAminoMsg { type: "osmosis/gamm/query-calc-exit-pool-coins-from-shares-response"; @@ -285,7 +288,7 @@ export interface QueryPoolParamsRequestProtoMsg { } /** =============================== PoolParams */ export interface QueryPoolParamsRequestAmino { - pool_id: string; + pool_id?: string; } export interface QueryPoolParamsRequestAminoMsg { type: "osmosis/gamm/query-pool-params-request"; @@ -296,7 +299,7 @@ export interface QueryPoolParamsRequestSDKType { pool_id: bigint; } export interface QueryPoolParamsResponse { - params: Any; + params?: Any; } export interface QueryPoolParamsResponseProtoMsg { typeUrl: "/osmosis.gamm.v1beta1.QueryPoolParamsResponse"; @@ -310,7 +313,7 @@ export interface QueryPoolParamsResponseAminoMsg { value: QueryPoolParamsResponseAmino; } export interface QueryPoolParamsResponseSDKType { - params: AnySDKType; + params?: AnySDKType; } /** * =============================== PoolLiquidity @@ -330,7 +333,7 @@ export interface QueryTotalPoolLiquidityRequestProtoMsg { */ /** @deprecated */ export interface QueryTotalPoolLiquidityRequestAmino { - pool_id: string; + pool_id?: string; } export interface QueryTotalPoolLiquidityRequestAminoMsg { type: "osmosis/gamm/query-total-pool-liquidity-request"; @@ -356,7 +359,7 @@ export interface QueryTotalPoolLiquidityResponseProtoMsg { /** Deprecated: please use the alternative in x/poolmanager */ /** @deprecated */ export interface QueryTotalPoolLiquidityResponseAmino { - liquidity: CoinAmino[]; + liquidity?: CoinAmino[]; } export interface QueryTotalPoolLiquidityResponseAminoMsg { type: "osmosis/gamm/query-total-pool-liquidity-response"; @@ -377,7 +380,7 @@ export interface QueryTotalSharesRequestProtoMsg { } /** =============================== TotalShares */ export interface QueryTotalSharesRequestAmino { - pool_id: string; + pool_id?: string; } export interface QueryTotalSharesRequestAminoMsg { type: "osmosis/gamm/query-total-shares-request"; @@ -415,8 +418,8 @@ export interface QueryCalcJoinPoolNoSwapSharesRequestProtoMsg { } /** =============================== CalcJoinPoolNoSwapShares */ export interface QueryCalcJoinPoolNoSwapSharesRequestAmino { - pool_id: string; - tokens_in: CoinAmino[]; + pool_id?: string; + tokens_in?: CoinAmino[]; } export interface QueryCalcJoinPoolNoSwapSharesRequestAminoMsg { type: "osmosis/gamm/query-calc-join-pool-no-swap-shares-request"; @@ -436,8 +439,8 @@ export interface QueryCalcJoinPoolNoSwapSharesResponseProtoMsg { value: Uint8Array; } export interface QueryCalcJoinPoolNoSwapSharesResponseAmino { - tokens_out: CoinAmino[]; - shares_out: string; + tokens_out?: CoinAmino[]; + shares_out?: string; } export interface QueryCalcJoinPoolNoSwapSharesResponseAminoMsg { type: "osmosis/gamm/query-calc-join-pool-no-swap-shares-response"; @@ -467,9 +470,9 @@ export interface QuerySpotPriceRequestProtoMsg { */ /** @deprecated */ export interface QuerySpotPriceRequestAmino { - pool_id: string; - base_asset_denom: string; - quote_asset_denom: string; + pool_id?: string; + base_asset_denom?: string; + quote_asset_denom?: string; } export interface QuerySpotPriceRequestAminoMsg { type: "osmosis/gamm/query-spot-price-request"; @@ -487,12 +490,12 @@ export interface QuerySpotPriceRequestSDKType { } export interface QueryPoolsWithFilterRequest { /** - * String of the coins in single string seperated by comma. Ex) + * String of the coins in single string separated by comma. Ex) * 10uatom,100uosmo */ minLiquidity: string; poolType: string; - pagination: PageRequest; + pagination?: PageRequest; } export interface QueryPoolsWithFilterRequestProtoMsg { typeUrl: "/osmosis.gamm.v1beta1.QueryPoolsWithFilterRequest"; @@ -500,11 +503,11 @@ export interface QueryPoolsWithFilterRequestProtoMsg { } export interface QueryPoolsWithFilterRequestAmino { /** - * String of the coins in single string seperated by comma. Ex) + * String of the coins in single string separated by comma. Ex) * 10uatom,100uosmo */ - min_liquidity: string; - pool_type: string; + min_liquidity?: string; + pool_type?: string; pagination?: PageRequestAmino; } export interface QueryPoolsWithFilterRequestAminoMsg { @@ -514,12 +517,12 @@ export interface QueryPoolsWithFilterRequestAminoMsg { export interface QueryPoolsWithFilterRequestSDKType { min_liquidity: string; pool_type: string; - pagination: PageRequestSDKType; + pagination?: PageRequestSDKType; } export interface QueryPoolsWithFilterResponse { - pools: (Pool1 & CosmWasmPool & Pool2 & Pool3 & Any)[] | Any[]; + pools: (Pool1 | CosmWasmPool | Pool2 | Pool3 | Any)[] | Any[]; /** pagination defines the pagination in the response. */ - pagination: PageResponse; + pagination?: PageResponse; } export interface QueryPoolsWithFilterResponseProtoMsg { typeUrl: "/osmosis.gamm.v1beta1.QueryPoolsWithFilterResponse"; @@ -529,7 +532,7 @@ export type QueryPoolsWithFilterResponseEncoded = Omit): QueryPoolRequest { const message = createBaseQueryPoolRequest(); message.poolId = object.poolId !== undefined && object.poolId !== null ? BigInt(object.poolId.toString()) : BigInt(0); return message; }, fromAmino(object: QueryPoolRequestAmino): QueryPoolRequest { - return { - poolId: BigInt(object.pool_id) - }; + const message = createBaseQueryPoolRequest(); + if (object.pool_id !== undefined && object.pool_id !== null) { + message.poolId = BigInt(object.pool_id); + } + return message; }, toAmino(message: QueryPoolRequest): QueryPoolRequestAmino { const obj: any = {}; @@ -811,6 +867,8 @@ export const QueryPoolRequest = { }; } }; +GlobalDecoderRegistry.register(QueryPoolRequest.typeUrl, QueryPoolRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryPoolRequest.aminoType, QueryPoolRequest.typeUrl); function createBaseQueryPoolResponse(): QueryPoolResponse { return { pool: undefined @@ -818,9 +876,19 @@ function createBaseQueryPoolResponse(): QueryPoolResponse { } export const QueryPoolResponse = { typeUrl: "/osmosis.gamm.v1beta1.QueryPoolResponse", + aminoType: "osmosis/gamm/query-pool-response", + is(o: any): o is QueryPoolResponse { + return o && o.$typeUrl === QueryPoolResponse.typeUrl; + }, + isSDK(o: any): o is QueryPoolResponseSDKType { + return o && o.$typeUrl === QueryPoolResponse.typeUrl; + }, + isAmino(o: any): o is QueryPoolResponseAmino { + return o && o.$typeUrl === QueryPoolResponse.typeUrl; + }, encode(message: QueryPoolResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.pool !== undefined) { - Any.encode((message.pool as Any), writer.uint32(10).fork()).ldelim(); + Any.encode(GlobalDecoderRegistry.wrapAny(message.pool), writer.uint32(10).fork()).ldelim(); } return writer; }, @@ -832,7 +900,7 @@ export const QueryPoolResponse = { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.pool = (PoolI_InterfaceDecoder(reader) as Any); + message.pool = GlobalDecoderRegistry.unwrapAny(reader); break; default: reader.skipType(tag & 7); @@ -841,19 +909,31 @@ export const QueryPoolResponse = { } return message; }, + fromJSON(object: any): QueryPoolResponse { + return { + pool: isSet(object.pool) ? GlobalDecoderRegistry.fromJSON(object.pool) : undefined + }; + }, + toJSON(message: QueryPoolResponse): unknown { + const obj: any = {}; + message.pool !== undefined && (obj.pool = message.pool ? GlobalDecoderRegistry.toJSON(message.pool) : undefined); + return obj; + }, fromPartial(object: Partial): QueryPoolResponse { const message = createBaseQueryPoolResponse(); - message.pool = object.pool !== undefined && object.pool !== null ? Any.fromPartial(object.pool) : undefined; + message.pool = object.pool !== undefined && object.pool !== null ? GlobalDecoderRegistry.fromPartial(object.pool) : undefined; return message; }, fromAmino(object: QueryPoolResponseAmino): QueryPoolResponse { - return { - pool: object?.pool ? PoolI_FromAmino(object.pool) : undefined - }; + const message = createBaseQueryPoolResponse(); + if (object.pool !== undefined && object.pool !== null) { + message.pool = GlobalDecoderRegistry.fromAminoMsg(object.pool); + } + return message; }, toAmino(message: QueryPoolResponse): QueryPoolResponseAmino { const obj: any = {}; - obj.pool = message.pool ? PoolI_ToAmino((message.pool as Any)) : undefined; + obj.pool = message.pool ? GlobalDecoderRegistry.toAminoMsg(message.pool) : undefined; return obj; }, fromAminoMsg(object: QueryPoolResponseAminoMsg): QueryPoolResponse { @@ -878,13 +958,25 @@ export const QueryPoolResponse = { }; } }; +GlobalDecoderRegistry.register(QueryPoolResponse.typeUrl, QueryPoolResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryPoolResponse.aminoType, QueryPoolResponse.typeUrl); function createBaseQueryPoolsRequest(): QueryPoolsRequest { return { - pagination: PageRequest.fromPartial({}) + pagination: undefined }; } export const QueryPoolsRequest = { typeUrl: "/osmosis.gamm.v1beta1.QueryPoolsRequest", + aminoType: "osmosis/gamm/query-pools-request", + is(o: any): o is QueryPoolsRequest { + return o && o.$typeUrl === QueryPoolsRequest.typeUrl; + }, + isSDK(o: any): o is QueryPoolsRequestSDKType { + return o && o.$typeUrl === QueryPoolsRequest.typeUrl; + }, + isAmino(o: any): o is QueryPoolsRequestAmino { + return o && o.$typeUrl === QueryPoolsRequest.typeUrl; + }, encode(message: QueryPoolsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.pagination !== undefined) { PageRequest.encode(message.pagination, writer.uint32(18).fork()).ldelim(); @@ -908,15 +1000,27 @@ export const QueryPoolsRequest = { } return message; }, + fromJSON(object: any): QueryPoolsRequest { + return { + pagination: isSet(object.pagination) ? PageRequest.fromJSON(object.pagination) : undefined + }; + }, + toJSON(message: QueryPoolsRequest): unknown { + const obj: any = {}; + message.pagination !== undefined && (obj.pagination = message.pagination ? PageRequest.toJSON(message.pagination) : undefined); + return obj; + }, fromPartial(object: Partial): QueryPoolsRequest { const message = createBaseQueryPoolsRequest(); message.pagination = object.pagination !== undefined && object.pagination !== null ? PageRequest.fromPartial(object.pagination) : undefined; return message; }, fromAmino(object: QueryPoolsRequestAmino): QueryPoolsRequest { - return { - pagination: object?.pagination ? PageRequest.fromAmino(object.pagination) : undefined - }; + const message = createBaseQueryPoolsRequest(); + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromAmino(object.pagination); + } + return message; }, toAmino(message: QueryPoolsRequest): QueryPoolsRequestAmino { const obj: any = {}; @@ -945,17 +1049,29 @@ export const QueryPoolsRequest = { }; } }; +GlobalDecoderRegistry.register(QueryPoolsRequest.typeUrl, QueryPoolsRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryPoolsRequest.aminoType, QueryPoolsRequest.typeUrl); function createBaseQueryPoolsResponse(): QueryPoolsResponse { return { pools: [], - pagination: PageResponse.fromPartial({}) + pagination: undefined }; } export const QueryPoolsResponse = { typeUrl: "/osmosis.gamm.v1beta1.QueryPoolsResponse", + aminoType: "osmosis/gamm/query-pools-response", + is(o: any): o is QueryPoolsResponse { + return o && (o.$typeUrl === QueryPoolsResponse.typeUrl || Array.isArray(o.pools) && (!o.pools.length || Pool1.is(o.pools[0]) || CosmWasmPool.is(o.pools[0]) || Pool2.is(o.pools[0]) || Pool3.is(o.pools[0]) || Any.is(o.pools[0]))); + }, + isSDK(o: any): o is QueryPoolsResponseSDKType { + return o && (o.$typeUrl === QueryPoolsResponse.typeUrl || Array.isArray(o.pools) && (!o.pools.length || Pool1.isSDK(o.pools[0]) || CosmWasmPool.isSDK(o.pools[0]) || Pool2.isSDK(o.pools[0]) || Pool3.isSDK(o.pools[0]) || Any.isSDK(o.pools[0]))); + }, + isAmino(o: any): o is QueryPoolsResponseAmino { + return o && (o.$typeUrl === QueryPoolsResponse.typeUrl || Array.isArray(o.pools) && (!o.pools.length || Pool1.isAmino(o.pools[0]) || CosmWasmPool.isAmino(o.pools[0]) || Pool2.isAmino(o.pools[0]) || Pool3.isAmino(o.pools[0]) || Any.isAmino(o.pools[0]))); + }, encode(message: QueryPoolsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.pools) { - Any.encode((v! as Any), writer.uint32(10).fork()).ldelim(); + Any.encode(GlobalDecoderRegistry.wrapAny(v!), writer.uint32(10).fork()).ldelim(); } if (message.pagination !== undefined) { PageResponse.encode(message.pagination, writer.uint32(18).fork()).ldelim(); @@ -970,7 +1086,7 @@ export const QueryPoolsResponse = { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.pools.push((PoolI_InterfaceDecoder(reader) as Any)); + message.pools.push(GlobalDecoderRegistry.unwrapAny(reader)); break; case 2: message.pagination = PageResponse.decode(reader, reader.uint32()); @@ -982,22 +1098,40 @@ export const QueryPoolsResponse = { } return message; }, + fromJSON(object: any): QueryPoolsResponse { + return { + pools: Array.isArray(object?.pools) ? object.pools.map((e: any) => GlobalDecoderRegistry.fromJSON(e)) : [], + pagination: isSet(object.pagination) ? PageResponse.fromJSON(object.pagination) : undefined + }; + }, + toJSON(message: QueryPoolsResponse): unknown { + const obj: any = {}; + if (message.pools) { + obj.pools = message.pools.map(e => e ? GlobalDecoderRegistry.toJSON(e) : undefined); + } else { + obj.pools = []; + } + message.pagination !== undefined && (obj.pagination = message.pagination ? PageResponse.toJSON(message.pagination) : undefined); + return obj; + }, fromPartial(object: Partial): QueryPoolsResponse { const message = createBaseQueryPoolsResponse(); - message.pools = object.pools?.map(e => Any.fromPartial(e)) || []; + message.pools = object.pools?.map(e => (Any.fromPartial(e) as any)) || []; message.pagination = object.pagination !== undefined && object.pagination !== null ? PageResponse.fromPartial(object.pagination) : undefined; return message; }, fromAmino(object: QueryPoolsResponseAmino): QueryPoolsResponse { - return { - pools: Array.isArray(object?.pools) ? object.pools.map((e: any) => PoolI_FromAmino(e)) : [], - pagination: object?.pagination ? PageResponse.fromAmino(object.pagination) : undefined - }; + const message = createBaseQueryPoolsResponse(); + message.pools = object.pools?.map(e => GlobalDecoderRegistry.fromAminoMsg(e)) || []; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromAmino(object.pagination); + } + return message; }, toAmino(message: QueryPoolsResponse): QueryPoolsResponseAmino { const obj: any = {}; if (message.pools) { - obj.pools = message.pools.map(e => e ? PoolI_ToAmino((e as Any)) : undefined); + obj.pools = message.pools.map(e => e ? GlobalDecoderRegistry.toAminoMsg(e) : undefined); } else { obj.pools = []; } @@ -1026,11 +1160,23 @@ export const QueryPoolsResponse = { }; } }; +GlobalDecoderRegistry.register(QueryPoolsResponse.typeUrl, QueryPoolsResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryPoolsResponse.aminoType, QueryPoolsResponse.typeUrl); function createBaseQueryNumPoolsRequest(): QueryNumPoolsRequest { return {}; } export const QueryNumPoolsRequest = { typeUrl: "/osmosis.gamm.v1beta1.QueryNumPoolsRequest", + aminoType: "osmosis/gamm/query-num-pools-request", + is(o: any): o is QueryNumPoolsRequest { + return o && o.$typeUrl === QueryNumPoolsRequest.typeUrl; + }, + isSDK(o: any): o is QueryNumPoolsRequestSDKType { + return o && o.$typeUrl === QueryNumPoolsRequest.typeUrl; + }, + isAmino(o: any): o is QueryNumPoolsRequestAmino { + return o && o.$typeUrl === QueryNumPoolsRequest.typeUrl; + }, encode(_: QueryNumPoolsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, @@ -1048,12 +1194,20 @@ export const QueryNumPoolsRequest = { } return message; }, + fromJSON(_: any): QueryNumPoolsRequest { + return {}; + }, + toJSON(_: QueryNumPoolsRequest): unknown { + const obj: any = {}; + return obj; + }, fromPartial(_: Partial): QueryNumPoolsRequest { const message = createBaseQueryNumPoolsRequest(); return message; }, fromAmino(_: QueryNumPoolsRequestAmino): QueryNumPoolsRequest { - return {}; + const message = createBaseQueryNumPoolsRequest(); + return message; }, toAmino(_: QueryNumPoolsRequest): QueryNumPoolsRequestAmino { const obj: any = {}; @@ -1081,6 +1235,8 @@ export const QueryNumPoolsRequest = { }; } }; +GlobalDecoderRegistry.register(QueryNumPoolsRequest.typeUrl, QueryNumPoolsRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryNumPoolsRequest.aminoType, QueryNumPoolsRequest.typeUrl); function createBaseQueryNumPoolsResponse(): QueryNumPoolsResponse { return { numPools: BigInt(0) @@ -1088,6 +1244,16 @@ function createBaseQueryNumPoolsResponse(): QueryNumPoolsResponse { } export const QueryNumPoolsResponse = { typeUrl: "/osmosis.gamm.v1beta1.QueryNumPoolsResponse", + aminoType: "osmosis/gamm/query-num-pools-response", + is(o: any): o is QueryNumPoolsResponse { + return o && (o.$typeUrl === QueryNumPoolsResponse.typeUrl || typeof o.numPools === "bigint"); + }, + isSDK(o: any): o is QueryNumPoolsResponseSDKType { + return o && (o.$typeUrl === QueryNumPoolsResponse.typeUrl || typeof o.num_pools === "bigint"); + }, + isAmino(o: any): o is QueryNumPoolsResponseAmino { + return o && (o.$typeUrl === QueryNumPoolsResponse.typeUrl || typeof o.num_pools === "bigint"); + }, encode(message: QueryNumPoolsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.numPools !== BigInt(0)) { writer.uint32(8).uint64(message.numPools); @@ -1111,15 +1277,27 @@ export const QueryNumPoolsResponse = { } return message; }, + fromJSON(object: any): QueryNumPoolsResponse { + return { + numPools: isSet(object.numPools) ? BigInt(object.numPools.toString()) : BigInt(0) + }; + }, + toJSON(message: QueryNumPoolsResponse): unknown { + const obj: any = {}; + message.numPools !== undefined && (obj.numPools = (message.numPools || BigInt(0)).toString()); + return obj; + }, fromPartial(object: Partial): QueryNumPoolsResponse { const message = createBaseQueryNumPoolsResponse(); message.numPools = object.numPools !== undefined && object.numPools !== null ? BigInt(object.numPools.toString()) : BigInt(0); return message; }, fromAmino(object: QueryNumPoolsResponseAmino): QueryNumPoolsResponse { - return { - numPools: BigInt(object.num_pools) - }; + const message = createBaseQueryNumPoolsResponse(); + if (object.num_pools !== undefined && object.num_pools !== null) { + message.numPools = BigInt(object.num_pools); + } + return message; }, toAmino(message: QueryNumPoolsResponse): QueryNumPoolsResponseAmino { const obj: any = {}; @@ -1148,6 +1326,8 @@ export const QueryNumPoolsResponse = { }; } }; +GlobalDecoderRegistry.register(QueryNumPoolsResponse.typeUrl, QueryNumPoolsResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryNumPoolsResponse.aminoType, QueryNumPoolsResponse.typeUrl); function createBaseQueryPoolTypeRequest(): QueryPoolTypeRequest { return { poolId: BigInt(0) @@ -1155,6 +1335,16 @@ function createBaseQueryPoolTypeRequest(): QueryPoolTypeRequest { } export const QueryPoolTypeRequest = { typeUrl: "/osmosis.gamm.v1beta1.QueryPoolTypeRequest", + aminoType: "osmosis/gamm/query-pool-type-request", + is(o: any): o is QueryPoolTypeRequest { + return o && (o.$typeUrl === QueryPoolTypeRequest.typeUrl || typeof o.poolId === "bigint"); + }, + isSDK(o: any): o is QueryPoolTypeRequestSDKType { + return o && (o.$typeUrl === QueryPoolTypeRequest.typeUrl || typeof o.pool_id === "bigint"); + }, + isAmino(o: any): o is QueryPoolTypeRequestAmino { + return o && (o.$typeUrl === QueryPoolTypeRequest.typeUrl || typeof o.pool_id === "bigint"); + }, encode(message: QueryPoolTypeRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.poolId !== BigInt(0)) { writer.uint32(8).uint64(message.poolId); @@ -1178,15 +1368,27 @@ export const QueryPoolTypeRequest = { } return message; }, + fromJSON(object: any): QueryPoolTypeRequest { + return { + poolId: isSet(object.poolId) ? BigInt(object.poolId.toString()) : BigInt(0) + }; + }, + toJSON(message: QueryPoolTypeRequest): unknown { + const obj: any = {}; + message.poolId !== undefined && (obj.poolId = (message.poolId || BigInt(0)).toString()); + return obj; + }, fromPartial(object: Partial): QueryPoolTypeRequest { const message = createBaseQueryPoolTypeRequest(); message.poolId = object.poolId !== undefined && object.poolId !== null ? BigInt(object.poolId.toString()) : BigInt(0); return message; }, fromAmino(object: QueryPoolTypeRequestAmino): QueryPoolTypeRequest { - return { - poolId: BigInt(object.pool_id) - }; + const message = createBaseQueryPoolTypeRequest(); + if (object.pool_id !== undefined && object.pool_id !== null) { + message.poolId = BigInt(object.pool_id); + } + return message; }, toAmino(message: QueryPoolTypeRequest): QueryPoolTypeRequestAmino { const obj: any = {}; @@ -1215,6 +1417,8 @@ export const QueryPoolTypeRequest = { }; } }; +GlobalDecoderRegistry.register(QueryPoolTypeRequest.typeUrl, QueryPoolTypeRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryPoolTypeRequest.aminoType, QueryPoolTypeRequest.typeUrl); function createBaseQueryPoolTypeResponse(): QueryPoolTypeResponse { return { poolType: "" @@ -1222,6 +1426,16 @@ function createBaseQueryPoolTypeResponse(): QueryPoolTypeResponse { } export const QueryPoolTypeResponse = { typeUrl: "/osmosis.gamm.v1beta1.QueryPoolTypeResponse", + aminoType: "osmosis/gamm/query-pool-type-response", + is(o: any): o is QueryPoolTypeResponse { + return o && (o.$typeUrl === QueryPoolTypeResponse.typeUrl || typeof o.poolType === "string"); + }, + isSDK(o: any): o is QueryPoolTypeResponseSDKType { + return o && (o.$typeUrl === QueryPoolTypeResponse.typeUrl || typeof o.pool_type === "string"); + }, + isAmino(o: any): o is QueryPoolTypeResponseAmino { + return o && (o.$typeUrl === QueryPoolTypeResponse.typeUrl || typeof o.pool_type === "string"); + }, encode(message: QueryPoolTypeResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.poolType !== "") { writer.uint32(10).string(message.poolType); @@ -1245,15 +1459,27 @@ export const QueryPoolTypeResponse = { } return message; }, + fromJSON(object: any): QueryPoolTypeResponse { + return { + poolType: isSet(object.poolType) ? String(object.poolType) : "" + }; + }, + toJSON(message: QueryPoolTypeResponse): unknown { + const obj: any = {}; + message.poolType !== undefined && (obj.poolType = message.poolType); + return obj; + }, fromPartial(object: Partial): QueryPoolTypeResponse { const message = createBaseQueryPoolTypeResponse(); message.poolType = object.poolType ?? ""; return message; }, fromAmino(object: QueryPoolTypeResponseAmino): QueryPoolTypeResponse { - return { - poolType: object.pool_type - }; + const message = createBaseQueryPoolTypeResponse(); + if (object.pool_type !== undefined && object.pool_type !== null) { + message.poolType = object.pool_type; + } + return message; }, toAmino(message: QueryPoolTypeResponse): QueryPoolTypeResponseAmino { const obj: any = {}; @@ -1282,6 +1508,8 @@ export const QueryPoolTypeResponse = { }; } }; +GlobalDecoderRegistry.register(QueryPoolTypeResponse.typeUrl, QueryPoolTypeResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryPoolTypeResponse.aminoType, QueryPoolTypeResponse.typeUrl); function createBaseQueryCalcJoinPoolSharesRequest(): QueryCalcJoinPoolSharesRequest { return { poolId: BigInt(0), @@ -1290,6 +1518,16 @@ function createBaseQueryCalcJoinPoolSharesRequest(): QueryCalcJoinPoolSharesRequ } export const QueryCalcJoinPoolSharesRequest = { typeUrl: "/osmosis.gamm.v1beta1.QueryCalcJoinPoolSharesRequest", + aminoType: "osmosis/gamm/query-calc-join-pool-shares-request", + is(o: any): o is QueryCalcJoinPoolSharesRequest { + return o && (o.$typeUrl === QueryCalcJoinPoolSharesRequest.typeUrl || typeof o.poolId === "bigint" && Array.isArray(o.tokensIn) && (!o.tokensIn.length || Coin.is(o.tokensIn[0]))); + }, + isSDK(o: any): o is QueryCalcJoinPoolSharesRequestSDKType { + return o && (o.$typeUrl === QueryCalcJoinPoolSharesRequest.typeUrl || typeof o.pool_id === "bigint" && Array.isArray(o.tokens_in) && (!o.tokens_in.length || Coin.isSDK(o.tokens_in[0]))); + }, + isAmino(o: any): o is QueryCalcJoinPoolSharesRequestAmino { + return o && (o.$typeUrl === QueryCalcJoinPoolSharesRequest.typeUrl || typeof o.pool_id === "bigint" && Array.isArray(o.tokens_in) && (!o.tokens_in.length || Coin.isAmino(o.tokens_in[0]))); + }, encode(message: QueryCalcJoinPoolSharesRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.poolId !== BigInt(0)) { writer.uint32(8).uint64(message.poolId); @@ -1319,6 +1557,22 @@ export const QueryCalcJoinPoolSharesRequest = { } return message; }, + fromJSON(object: any): QueryCalcJoinPoolSharesRequest { + return { + poolId: isSet(object.poolId) ? BigInt(object.poolId.toString()) : BigInt(0), + tokensIn: Array.isArray(object?.tokensIn) ? object.tokensIn.map((e: any) => Coin.fromJSON(e)) : [] + }; + }, + toJSON(message: QueryCalcJoinPoolSharesRequest): unknown { + const obj: any = {}; + message.poolId !== undefined && (obj.poolId = (message.poolId || BigInt(0)).toString()); + if (message.tokensIn) { + obj.tokensIn = message.tokensIn.map(e => e ? Coin.toJSON(e) : undefined); + } else { + obj.tokensIn = []; + } + return obj; + }, fromPartial(object: Partial): QueryCalcJoinPoolSharesRequest { const message = createBaseQueryCalcJoinPoolSharesRequest(); message.poolId = object.poolId !== undefined && object.poolId !== null ? BigInt(object.poolId.toString()) : BigInt(0); @@ -1326,10 +1580,12 @@ export const QueryCalcJoinPoolSharesRequest = { return message; }, fromAmino(object: QueryCalcJoinPoolSharesRequestAmino): QueryCalcJoinPoolSharesRequest { - return { - poolId: BigInt(object.pool_id), - tokensIn: Array.isArray(object?.tokens_in) ? object.tokens_in.map((e: any) => Coin.fromAmino(e)) : [] - }; + const message = createBaseQueryCalcJoinPoolSharesRequest(); + if (object.pool_id !== undefined && object.pool_id !== null) { + message.poolId = BigInt(object.pool_id); + } + message.tokensIn = object.tokens_in?.map(e => Coin.fromAmino(e)) || []; + return message; }, toAmino(message: QueryCalcJoinPoolSharesRequest): QueryCalcJoinPoolSharesRequestAmino { const obj: any = {}; @@ -1363,6 +1619,8 @@ export const QueryCalcJoinPoolSharesRequest = { }; } }; +GlobalDecoderRegistry.register(QueryCalcJoinPoolSharesRequest.typeUrl, QueryCalcJoinPoolSharesRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryCalcJoinPoolSharesRequest.aminoType, QueryCalcJoinPoolSharesRequest.typeUrl); function createBaseQueryCalcJoinPoolSharesResponse(): QueryCalcJoinPoolSharesResponse { return { shareOutAmount: "", @@ -1371,6 +1629,16 @@ function createBaseQueryCalcJoinPoolSharesResponse(): QueryCalcJoinPoolSharesRes } export const QueryCalcJoinPoolSharesResponse = { typeUrl: "/osmosis.gamm.v1beta1.QueryCalcJoinPoolSharesResponse", + aminoType: "osmosis/gamm/query-calc-join-pool-shares-response", + is(o: any): o is QueryCalcJoinPoolSharesResponse { + return o && (o.$typeUrl === QueryCalcJoinPoolSharesResponse.typeUrl || typeof o.shareOutAmount === "string" && Array.isArray(o.tokensOut) && (!o.tokensOut.length || Coin.is(o.tokensOut[0]))); + }, + isSDK(o: any): o is QueryCalcJoinPoolSharesResponseSDKType { + return o && (o.$typeUrl === QueryCalcJoinPoolSharesResponse.typeUrl || typeof o.share_out_amount === "string" && Array.isArray(o.tokens_out) && (!o.tokens_out.length || Coin.isSDK(o.tokens_out[0]))); + }, + isAmino(o: any): o is QueryCalcJoinPoolSharesResponseAmino { + return o && (o.$typeUrl === QueryCalcJoinPoolSharesResponse.typeUrl || typeof o.share_out_amount === "string" && Array.isArray(o.tokens_out) && (!o.tokens_out.length || Coin.isAmino(o.tokens_out[0]))); + }, encode(message: QueryCalcJoinPoolSharesResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.shareOutAmount !== "") { writer.uint32(10).string(message.shareOutAmount); @@ -1400,6 +1668,22 @@ export const QueryCalcJoinPoolSharesResponse = { } return message; }, + fromJSON(object: any): QueryCalcJoinPoolSharesResponse { + return { + shareOutAmount: isSet(object.shareOutAmount) ? String(object.shareOutAmount) : "", + tokensOut: Array.isArray(object?.tokensOut) ? object.tokensOut.map((e: any) => Coin.fromJSON(e)) : [] + }; + }, + toJSON(message: QueryCalcJoinPoolSharesResponse): unknown { + const obj: any = {}; + message.shareOutAmount !== undefined && (obj.shareOutAmount = message.shareOutAmount); + if (message.tokensOut) { + obj.tokensOut = message.tokensOut.map(e => e ? Coin.toJSON(e) : undefined); + } else { + obj.tokensOut = []; + } + return obj; + }, fromPartial(object: Partial): QueryCalcJoinPoolSharesResponse { const message = createBaseQueryCalcJoinPoolSharesResponse(); message.shareOutAmount = object.shareOutAmount ?? ""; @@ -1407,10 +1691,12 @@ export const QueryCalcJoinPoolSharesResponse = { return message; }, fromAmino(object: QueryCalcJoinPoolSharesResponseAmino): QueryCalcJoinPoolSharesResponse { - return { - shareOutAmount: object.share_out_amount, - tokensOut: Array.isArray(object?.tokens_out) ? object.tokens_out.map((e: any) => Coin.fromAmino(e)) : [] - }; + const message = createBaseQueryCalcJoinPoolSharesResponse(); + if (object.share_out_amount !== undefined && object.share_out_amount !== null) { + message.shareOutAmount = object.share_out_amount; + } + message.tokensOut = object.tokens_out?.map(e => Coin.fromAmino(e)) || []; + return message; }, toAmino(message: QueryCalcJoinPoolSharesResponse): QueryCalcJoinPoolSharesResponseAmino { const obj: any = {}; @@ -1444,6 +1730,8 @@ export const QueryCalcJoinPoolSharesResponse = { }; } }; +GlobalDecoderRegistry.register(QueryCalcJoinPoolSharesResponse.typeUrl, QueryCalcJoinPoolSharesResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryCalcJoinPoolSharesResponse.aminoType, QueryCalcJoinPoolSharesResponse.typeUrl); function createBaseQueryCalcExitPoolCoinsFromSharesRequest(): QueryCalcExitPoolCoinsFromSharesRequest { return { poolId: BigInt(0), @@ -1452,6 +1740,16 @@ function createBaseQueryCalcExitPoolCoinsFromSharesRequest(): QueryCalcExitPoolC } export const QueryCalcExitPoolCoinsFromSharesRequest = { typeUrl: "/osmosis.gamm.v1beta1.QueryCalcExitPoolCoinsFromSharesRequest", + aminoType: "osmosis/gamm/query-calc-exit-pool-coins-from-shares-request", + is(o: any): o is QueryCalcExitPoolCoinsFromSharesRequest { + return o && (o.$typeUrl === QueryCalcExitPoolCoinsFromSharesRequest.typeUrl || typeof o.poolId === "bigint" && typeof o.shareInAmount === "string"); + }, + isSDK(o: any): o is QueryCalcExitPoolCoinsFromSharesRequestSDKType { + return o && (o.$typeUrl === QueryCalcExitPoolCoinsFromSharesRequest.typeUrl || typeof o.pool_id === "bigint" && typeof o.share_in_amount === "string"); + }, + isAmino(o: any): o is QueryCalcExitPoolCoinsFromSharesRequestAmino { + return o && (o.$typeUrl === QueryCalcExitPoolCoinsFromSharesRequest.typeUrl || typeof o.pool_id === "bigint" && typeof o.share_in_amount === "string"); + }, encode(message: QueryCalcExitPoolCoinsFromSharesRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.poolId !== BigInt(0)) { writer.uint32(8).uint64(message.poolId); @@ -1481,6 +1779,18 @@ export const QueryCalcExitPoolCoinsFromSharesRequest = { } return message; }, + fromJSON(object: any): QueryCalcExitPoolCoinsFromSharesRequest { + return { + poolId: isSet(object.poolId) ? BigInt(object.poolId.toString()) : BigInt(0), + shareInAmount: isSet(object.shareInAmount) ? String(object.shareInAmount) : "" + }; + }, + toJSON(message: QueryCalcExitPoolCoinsFromSharesRequest): unknown { + const obj: any = {}; + message.poolId !== undefined && (obj.poolId = (message.poolId || BigInt(0)).toString()); + message.shareInAmount !== undefined && (obj.shareInAmount = message.shareInAmount); + return obj; + }, fromPartial(object: Partial): QueryCalcExitPoolCoinsFromSharesRequest { const message = createBaseQueryCalcExitPoolCoinsFromSharesRequest(); message.poolId = object.poolId !== undefined && object.poolId !== null ? BigInt(object.poolId.toString()) : BigInt(0); @@ -1488,10 +1798,14 @@ export const QueryCalcExitPoolCoinsFromSharesRequest = { return message; }, fromAmino(object: QueryCalcExitPoolCoinsFromSharesRequestAmino): QueryCalcExitPoolCoinsFromSharesRequest { - return { - poolId: BigInt(object.pool_id), - shareInAmount: object.share_in_amount - }; + const message = createBaseQueryCalcExitPoolCoinsFromSharesRequest(); + if (object.pool_id !== undefined && object.pool_id !== null) { + message.poolId = BigInt(object.pool_id); + } + if (object.share_in_amount !== undefined && object.share_in_amount !== null) { + message.shareInAmount = object.share_in_amount; + } + return message; }, toAmino(message: QueryCalcExitPoolCoinsFromSharesRequest): QueryCalcExitPoolCoinsFromSharesRequestAmino { const obj: any = {}; @@ -1521,6 +1835,8 @@ export const QueryCalcExitPoolCoinsFromSharesRequest = { }; } }; +GlobalDecoderRegistry.register(QueryCalcExitPoolCoinsFromSharesRequest.typeUrl, QueryCalcExitPoolCoinsFromSharesRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryCalcExitPoolCoinsFromSharesRequest.aminoType, QueryCalcExitPoolCoinsFromSharesRequest.typeUrl); function createBaseQueryCalcExitPoolCoinsFromSharesResponse(): QueryCalcExitPoolCoinsFromSharesResponse { return { tokensOut: [] @@ -1528,6 +1844,16 @@ function createBaseQueryCalcExitPoolCoinsFromSharesResponse(): QueryCalcExitPool } export const QueryCalcExitPoolCoinsFromSharesResponse = { typeUrl: "/osmosis.gamm.v1beta1.QueryCalcExitPoolCoinsFromSharesResponse", + aminoType: "osmosis/gamm/query-calc-exit-pool-coins-from-shares-response", + is(o: any): o is QueryCalcExitPoolCoinsFromSharesResponse { + return o && (o.$typeUrl === QueryCalcExitPoolCoinsFromSharesResponse.typeUrl || Array.isArray(o.tokensOut) && (!o.tokensOut.length || Coin.is(o.tokensOut[0]))); + }, + isSDK(o: any): o is QueryCalcExitPoolCoinsFromSharesResponseSDKType { + return o && (o.$typeUrl === QueryCalcExitPoolCoinsFromSharesResponse.typeUrl || Array.isArray(o.tokens_out) && (!o.tokens_out.length || Coin.isSDK(o.tokens_out[0]))); + }, + isAmino(o: any): o is QueryCalcExitPoolCoinsFromSharesResponseAmino { + return o && (o.$typeUrl === QueryCalcExitPoolCoinsFromSharesResponse.typeUrl || Array.isArray(o.tokens_out) && (!o.tokens_out.length || Coin.isAmino(o.tokens_out[0]))); + }, encode(message: QueryCalcExitPoolCoinsFromSharesResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.tokensOut) { Coin.encode(v!, writer.uint32(10).fork()).ldelim(); @@ -1551,15 +1877,29 @@ export const QueryCalcExitPoolCoinsFromSharesResponse = { } return message; }, + fromJSON(object: any): QueryCalcExitPoolCoinsFromSharesResponse { + return { + tokensOut: Array.isArray(object?.tokensOut) ? object.tokensOut.map((e: any) => Coin.fromJSON(e)) : [] + }; + }, + toJSON(message: QueryCalcExitPoolCoinsFromSharesResponse): unknown { + const obj: any = {}; + if (message.tokensOut) { + obj.tokensOut = message.tokensOut.map(e => e ? Coin.toJSON(e) : undefined); + } else { + obj.tokensOut = []; + } + return obj; + }, fromPartial(object: Partial): QueryCalcExitPoolCoinsFromSharesResponse { const message = createBaseQueryCalcExitPoolCoinsFromSharesResponse(); message.tokensOut = object.tokensOut?.map(e => Coin.fromPartial(e)) || []; return message; }, fromAmino(object: QueryCalcExitPoolCoinsFromSharesResponseAmino): QueryCalcExitPoolCoinsFromSharesResponse { - return { - tokensOut: Array.isArray(object?.tokens_out) ? object.tokens_out.map((e: any) => Coin.fromAmino(e)) : [] - }; + const message = createBaseQueryCalcExitPoolCoinsFromSharesResponse(); + message.tokensOut = object.tokens_out?.map(e => Coin.fromAmino(e)) || []; + return message; }, toAmino(message: QueryCalcExitPoolCoinsFromSharesResponse): QueryCalcExitPoolCoinsFromSharesResponseAmino { const obj: any = {}; @@ -1592,6 +1932,8 @@ export const QueryCalcExitPoolCoinsFromSharesResponse = { }; } }; +GlobalDecoderRegistry.register(QueryCalcExitPoolCoinsFromSharesResponse.typeUrl, QueryCalcExitPoolCoinsFromSharesResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryCalcExitPoolCoinsFromSharesResponse.aminoType, QueryCalcExitPoolCoinsFromSharesResponse.typeUrl); function createBaseQueryPoolParamsRequest(): QueryPoolParamsRequest { return { poolId: BigInt(0) @@ -1599,6 +1941,16 @@ function createBaseQueryPoolParamsRequest(): QueryPoolParamsRequest { } export const QueryPoolParamsRequest = { typeUrl: "/osmosis.gamm.v1beta1.QueryPoolParamsRequest", + aminoType: "osmosis/gamm/query-pool-params-request", + is(o: any): o is QueryPoolParamsRequest { + return o && (o.$typeUrl === QueryPoolParamsRequest.typeUrl || typeof o.poolId === "bigint"); + }, + isSDK(o: any): o is QueryPoolParamsRequestSDKType { + return o && (o.$typeUrl === QueryPoolParamsRequest.typeUrl || typeof o.pool_id === "bigint"); + }, + isAmino(o: any): o is QueryPoolParamsRequestAmino { + return o && (o.$typeUrl === QueryPoolParamsRequest.typeUrl || typeof o.pool_id === "bigint"); + }, encode(message: QueryPoolParamsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.poolId !== BigInt(0)) { writer.uint32(8).uint64(message.poolId); @@ -1622,15 +1974,27 @@ export const QueryPoolParamsRequest = { } return message; }, + fromJSON(object: any): QueryPoolParamsRequest { + return { + poolId: isSet(object.poolId) ? BigInt(object.poolId.toString()) : BigInt(0) + }; + }, + toJSON(message: QueryPoolParamsRequest): unknown { + const obj: any = {}; + message.poolId !== undefined && (obj.poolId = (message.poolId || BigInt(0)).toString()); + return obj; + }, fromPartial(object: Partial): QueryPoolParamsRequest { const message = createBaseQueryPoolParamsRequest(); message.poolId = object.poolId !== undefined && object.poolId !== null ? BigInt(object.poolId.toString()) : BigInt(0); return message; }, fromAmino(object: QueryPoolParamsRequestAmino): QueryPoolParamsRequest { - return { - poolId: BigInt(object.pool_id) - }; + const message = createBaseQueryPoolParamsRequest(); + if (object.pool_id !== undefined && object.pool_id !== null) { + message.poolId = BigInt(object.pool_id); + } + return message; }, toAmino(message: QueryPoolParamsRequest): QueryPoolParamsRequestAmino { const obj: any = {}; @@ -1659,6 +2023,8 @@ export const QueryPoolParamsRequest = { }; } }; +GlobalDecoderRegistry.register(QueryPoolParamsRequest.typeUrl, QueryPoolParamsRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryPoolParamsRequest.aminoType, QueryPoolParamsRequest.typeUrl); function createBaseQueryPoolParamsResponse(): QueryPoolParamsResponse { return { params: undefined @@ -1666,6 +2032,16 @@ function createBaseQueryPoolParamsResponse(): QueryPoolParamsResponse { } export const QueryPoolParamsResponse = { typeUrl: "/osmosis.gamm.v1beta1.QueryPoolParamsResponse", + aminoType: "osmosis/gamm/query-pool-params-response", + is(o: any): o is QueryPoolParamsResponse { + return o && o.$typeUrl === QueryPoolParamsResponse.typeUrl; + }, + isSDK(o: any): o is QueryPoolParamsResponseSDKType { + return o && o.$typeUrl === QueryPoolParamsResponse.typeUrl; + }, + isAmino(o: any): o is QueryPoolParamsResponseAmino { + return o && o.$typeUrl === QueryPoolParamsResponse.typeUrl; + }, encode(message: QueryPoolParamsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.params !== undefined) { Any.encode(message.params, writer.uint32(10).fork()).ldelim(); @@ -1689,15 +2065,27 @@ export const QueryPoolParamsResponse = { } return message; }, + fromJSON(object: any): QueryPoolParamsResponse { + return { + params: isSet(object.params) ? Any.fromJSON(object.params) : undefined + }; + }, + toJSON(message: QueryPoolParamsResponse): unknown { + const obj: any = {}; + message.params !== undefined && (obj.params = message.params ? Any.toJSON(message.params) : undefined); + return obj; + }, fromPartial(object: Partial): QueryPoolParamsResponse { const message = createBaseQueryPoolParamsResponse(); message.params = object.params !== undefined && object.params !== null ? Any.fromPartial(object.params) : undefined; return message; }, fromAmino(object: QueryPoolParamsResponseAmino): QueryPoolParamsResponse { - return { - params: object?.params ? Any.fromAmino(object.params) : undefined - }; + const message = createBaseQueryPoolParamsResponse(); + if (object.params !== undefined && object.params !== null) { + message.params = Any.fromAmino(object.params); + } + return message; }, toAmino(message: QueryPoolParamsResponse): QueryPoolParamsResponseAmino { const obj: any = {}; @@ -1726,6 +2114,8 @@ export const QueryPoolParamsResponse = { }; } }; +GlobalDecoderRegistry.register(QueryPoolParamsResponse.typeUrl, QueryPoolParamsResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryPoolParamsResponse.aminoType, QueryPoolParamsResponse.typeUrl); function createBaseQueryTotalPoolLiquidityRequest(): QueryTotalPoolLiquidityRequest { return { poolId: BigInt(0) @@ -1733,6 +2123,16 @@ function createBaseQueryTotalPoolLiquidityRequest(): QueryTotalPoolLiquidityRequ } export const QueryTotalPoolLiquidityRequest = { typeUrl: "/osmosis.gamm.v1beta1.QueryTotalPoolLiquidityRequest", + aminoType: "osmosis/gamm/query-total-pool-liquidity-request", + is(o: any): o is QueryTotalPoolLiquidityRequest { + return o && (o.$typeUrl === QueryTotalPoolLiquidityRequest.typeUrl || typeof o.poolId === "bigint"); + }, + isSDK(o: any): o is QueryTotalPoolLiquidityRequestSDKType { + return o && (o.$typeUrl === QueryTotalPoolLiquidityRequest.typeUrl || typeof o.pool_id === "bigint"); + }, + isAmino(o: any): o is QueryTotalPoolLiquidityRequestAmino { + return o && (o.$typeUrl === QueryTotalPoolLiquidityRequest.typeUrl || typeof o.pool_id === "bigint"); + }, encode(message: QueryTotalPoolLiquidityRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.poolId !== BigInt(0)) { writer.uint32(8).uint64(message.poolId); @@ -1756,15 +2156,27 @@ export const QueryTotalPoolLiquidityRequest = { } return message; }, + fromJSON(object: any): QueryTotalPoolLiquidityRequest { + return { + poolId: isSet(object.poolId) ? BigInt(object.poolId.toString()) : BigInt(0) + }; + }, + toJSON(message: QueryTotalPoolLiquidityRequest): unknown { + const obj: any = {}; + message.poolId !== undefined && (obj.poolId = (message.poolId || BigInt(0)).toString()); + return obj; + }, fromPartial(object: Partial): QueryTotalPoolLiquidityRequest { const message = createBaseQueryTotalPoolLiquidityRequest(); message.poolId = object.poolId !== undefined && object.poolId !== null ? BigInt(object.poolId.toString()) : BigInt(0); return message; }, fromAmino(object: QueryTotalPoolLiquidityRequestAmino): QueryTotalPoolLiquidityRequest { - return { - poolId: BigInt(object.pool_id) - }; + const message = createBaseQueryTotalPoolLiquidityRequest(); + if (object.pool_id !== undefined && object.pool_id !== null) { + message.poolId = BigInt(object.pool_id); + } + return message; }, toAmino(message: QueryTotalPoolLiquidityRequest): QueryTotalPoolLiquidityRequestAmino { const obj: any = {}; @@ -1793,6 +2205,8 @@ export const QueryTotalPoolLiquidityRequest = { }; } }; +GlobalDecoderRegistry.register(QueryTotalPoolLiquidityRequest.typeUrl, QueryTotalPoolLiquidityRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryTotalPoolLiquidityRequest.aminoType, QueryTotalPoolLiquidityRequest.typeUrl); function createBaseQueryTotalPoolLiquidityResponse(): QueryTotalPoolLiquidityResponse { return { liquidity: [] @@ -1800,6 +2214,16 @@ function createBaseQueryTotalPoolLiquidityResponse(): QueryTotalPoolLiquidityRes } export const QueryTotalPoolLiquidityResponse = { typeUrl: "/osmosis.gamm.v1beta1.QueryTotalPoolLiquidityResponse", + aminoType: "osmosis/gamm/query-total-pool-liquidity-response", + is(o: any): o is QueryTotalPoolLiquidityResponse { + return o && (o.$typeUrl === QueryTotalPoolLiquidityResponse.typeUrl || Array.isArray(o.liquidity) && (!o.liquidity.length || Coin.is(o.liquidity[0]))); + }, + isSDK(o: any): o is QueryTotalPoolLiquidityResponseSDKType { + return o && (o.$typeUrl === QueryTotalPoolLiquidityResponse.typeUrl || Array.isArray(o.liquidity) && (!o.liquidity.length || Coin.isSDK(o.liquidity[0]))); + }, + isAmino(o: any): o is QueryTotalPoolLiquidityResponseAmino { + return o && (o.$typeUrl === QueryTotalPoolLiquidityResponse.typeUrl || Array.isArray(o.liquidity) && (!o.liquidity.length || Coin.isAmino(o.liquidity[0]))); + }, encode(message: QueryTotalPoolLiquidityResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.liquidity) { Coin.encode(v!, writer.uint32(10).fork()).ldelim(); @@ -1823,26 +2247,40 @@ export const QueryTotalPoolLiquidityResponse = { } return message; }, - fromPartial(object: Partial): QueryTotalPoolLiquidityResponse { - const message = createBaseQueryTotalPoolLiquidityResponse(); - message.liquidity = object.liquidity?.map(e => Coin.fromPartial(e)) || []; - return message; - }, - fromAmino(object: QueryTotalPoolLiquidityResponseAmino): QueryTotalPoolLiquidityResponse { + fromJSON(object: any): QueryTotalPoolLiquidityResponse { return { - liquidity: Array.isArray(object?.liquidity) ? object.liquidity.map((e: any) => Coin.fromAmino(e)) : [] + liquidity: Array.isArray(object?.liquidity) ? object.liquidity.map((e: any) => Coin.fromJSON(e)) : [] }; }, - toAmino(message: QueryTotalPoolLiquidityResponse): QueryTotalPoolLiquidityResponseAmino { + toJSON(message: QueryTotalPoolLiquidityResponse): unknown { const obj: any = {}; if (message.liquidity) { - obj.liquidity = message.liquidity.map(e => e ? Coin.toAmino(e) : undefined); + obj.liquidity = message.liquidity.map(e => e ? Coin.toJSON(e) : undefined); } else { obj.liquidity = []; } return obj; }, - fromAminoMsg(object: QueryTotalPoolLiquidityResponseAminoMsg): QueryTotalPoolLiquidityResponse { + fromPartial(object: Partial): QueryTotalPoolLiquidityResponse { + const message = createBaseQueryTotalPoolLiquidityResponse(); + message.liquidity = object.liquidity?.map(e => Coin.fromPartial(e)) || []; + return message; + }, + fromAmino(object: QueryTotalPoolLiquidityResponseAmino): QueryTotalPoolLiquidityResponse { + const message = createBaseQueryTotalPoolLiquidityResponse(); + message.liquidity = object.liquidity?.map(e => Coin.fromAmino(e)) || []; + return message; + }, + toAmino(message: QueryTotalPoolLiquidityResponse): QueryTotalPoolLiquidityResponseAmino { + const obj: any = {}; + if (message.liquidity) { + obj.liquidity = message.liquidity.map(e => e ? Coin.toAmino(e) : undefined); + } else { + obj.liquidity = []; + } + return obj; + }, + fromAminoMsg(object: QueryTotalPoolLiquidityResponseAminoMsg): QueryTotalPoolLiquidityResponse { return QueryTotalPoolLiquidityResponse.fromAmino(object.value); }, toAminoMsg(message: QueryTotalPoolLiquidityResponse): QueryTotalPoolLiquidityResponseAminoMsg { @@ -1864,6 +2302,8 @@ export const QueryTotalPoolLiquidityResponse = { }; } }; +GlobalDecoderRegistry.register(QueryTotalPoolLiquidityResponse.typeUrl, QueryTotalPoolLiquidityResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryTotalPoolLiquidityResponse.aminoType, QueryTotalPoolLiquidityResponse.typeUrl); function createBaseQueryTotalSharesRequest(): QueryTotalSharesRequest { return { poolId: BigInt(0) @@ -1871,6 +2311,16 @@ function createBaseQueryTotalSharesRequest(): QueryTotalSharesRequest { } export const QueryTotalSharesRequest = { typeUrl: "/osmosis.gamm.v1beta1.QueryTotalSharesRequest", + aminoType: "osmosis/gamm/query-total-shares-request", + is(o: any): o is QueryTotalSharesRequest { + return o && (o.$typeUrl === QueryTotalSharesRequest.typeUrl || typeof o.poolId === "bigint"); + }, + isSDK(o: any): o is QueryTotalSharesRequestSDKType { + return o && (o.$typeUrl === QueryTotalSharesRequest.typeUrl || typeof o.pool_id === "bigint"); + }, + isAmino(o: any): o is QueryTotalSharesRequestAmino { + return o && (o.$typeUrl === QueryTotalSharesRequest.typeUrl || typeof o.pool_id === "bigint"); + }, encode(message: QueryTotalSharesRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.poolId !== BigInt(0)) { writer.uint32(8).uint64(message.poolId); @@ -1894,15 +2344,27 @@ export const QueryTotalSharesRequest = { } return message; }, + fromJSON(object: any): QueryTotalSharesRequest { + return { + poolId: isSet(object.poolId) ? BigInt(object.poolId.toString()) : BigInt(0) + }; + }, + toJSON(message: QueryTotalSharesRequest): unknown { + const obj: any = {}; + message.poolId !== undefined && (obj.poolId = (message.poolId || BigInt(0)).toString()); + return obj; + }, fromPartial(object: Partial): QueryTotalSharesRequest { const message = createBaseQueryTotalSharesRequest(); message.poolId = object.poolId !== undefined && object.poolId !== null ? BigInt(object.poolId.toString()) : BigInt(0); return message; }, fromAmino(object: QueryTotalSharesRequestAmino): QueryTotalSharesRequest { - return { - poolId: BigInt(object.pool_id) - }; + const message = createBaseQueryTotalSharesRequest(); + if (object.pool_id !== undefined && object.pool_id !== null) { + message.poolId = BigInt(object.pool_id); + } + return message; }, toAmino(message: QueryTotalSharesRequest): QueryTotalSharesRequestAmino { const obj: any = {}; @@ -1931,13 +2393,25 @@ export const QueryTotalSharesRequest = { }; } }; +GlobalDecoderRegistry.register(QueryTotalSharesRequest.typeUrl, QueryTotalSharesRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryTotalSharesRequest.aminoType, QueryTotalSharesRequest.typeUrl); function createBaseQueryTotalSharesResponse(): QueryTotalSharesResponse { return { - totalShares: undefined + totalShares: Coin.fromPartial({}) }; } export const QueryTotalSharesResponse = { typeUrl: "/osmosis.gamm.v1beta1.QueryTotalSharesResponse", + aminoType: "osmosis/gamm/query-total-shares-response", + is(o: any): o is QueryTotalSharesResponse { + return o && (o.$typeUrl === QueryTotalSharesResponse.typeUrl || Coin.is(o.totalShares)); + }, + isSDK(o: any): o is QueryTotalSharesResponseSDKType { + return o && (o.$typeUrl === QueryTotalSharesResponse.typeUrl || Coin.isSDK(o.total_shares)); + }, + isAmino(o: any): o is QueryTotalSharesResponseAmino { + return o && (o.$typeUrl === QueryTotalSharesResponse.typeUrl || Coin.isAmino(o.total_shares)); + }, encode(message: QueryTotalSharesResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.totalShares !== undefined) { Coin.encode(message.totalShares, writer.uint32(10).fork()).ldelim(); @@ -1961,15 +2435,27 @@ export const QueryTotalSharesResponse = { } return message; }, + fromJSON(object: any): QueryTotalSharesResponse { + return { + totalShares: isSet(object.totalShares) ? Coin.fromJSON(object.totalShares) : undefined + }; + }, + toJSON(message: QueryTotalSharesResponse): unknown { + const obj: any = {}; + message.totalShares !== undefined && (obj.totalShares = message.totalShares ? Coin.toJSON(message.totalShares) : undefined); + return obj; + }, fromPartial(object: Partial): QueryTotalSharesResponse { const message = createBaseQueryTotalSharesResponse(); message.totalShares = object.totalShares !== undefined && object.totalShares !== null ? Coin.fromPartial(object.totalShares) : undefined; return message; }, fromAmino(object: QueryTotalSharesResponseAmino): QueryTotalSharesResponse { - return { - totalShares: object?.total_shares ? Coin.fromAmino(object.total_shares) : undefined - }; + const message = createBaseQueryTotalSharesResponse(); + if (object.total_shares !== undefined && object.total_shares !== null) { + message.totalShares = Coin.fromAmino(object.total_shares); + } + return message; }, toAmino(message: QueryTotalSharesResponse): QueryTotalSharesResponseAmino { const obj: any = {}; @@ -1998,6 +2484,8 @@ export const QueryTotalSharesResponse = { }; } }; +GlobalDecoderRegistry.register(QueryTotalSharesResponse.typeUrl, QueryTotalSharesResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryTotalSharesResponse.aminoType, QueryTotalSharesResponse.typeUrl); function createBaseQueryCalcJoinPoolNoSwapSharesRequest(): QueryCalcJoinPoolNoSwapSharesRequest { return { poolId: BigInt(0), @@ -2006,6 +2494,16 @@ function createBaseQueryCalcJoinPoolNoSwapSharesRequest(): QueryCalcJoinPoolNoSw } export const QueryCalcJoinPoolNoSwapSharesRequest = { typeUrl: "/osmosis.gamm.v1beta1.QueryCalcJoinPoolNoSwapSharesRequest", + aminoType: "osmosis/gamm/query-calc-join-pool-no-swap-shares-request", + is(o: any): o is QueryCalcJoinPoolNoSwapSharesRequest { + return o && (o.$typeUrl === QueryCalcJoinPoolNoSwapSharesRequest.typeUrl || typeof o.poolId === "bigint" && Array.isArray(o.tokensIn) && (!o.tokensIn.length || Coin.is(o.tokensIn[0]))); + }, + isSDK(o: any): o is QueryCalcJoinPoolNoSwapSharesRequestSDKType { + return o && (o.$typeUrl === QueryCalcJoinPoolNoSwapSharesRequest.typeUrl || typeof o.pool_id === "bigint" && Array.isArray(o.tokens_in) && (!o.tokens_in.length || Coin.isSDK(o.tokens_in[0]))); + }, + isAmino(o: any): o is QueryCalcJoinPoolNoSwapSharesRequestAmino { + return o && (o.$typeUrl === QueryCalcJoinPoolNoSwapSharesRequest.typeUrl || typeof o.pool_id === "bigint" && Array.isArray(o.tokens_in) && (!o.tokens_in.length || Coin.isAmino(o.tokens_in[0]))); + }, encode(message: QueryCalcJoinPoolNoSwapSharesRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.poolId !== BigInt(0)) { writer.uint32(8).uint64(message.poolId); @@ -2035,6 +2533,22 @@ export const QueryCalcJoinPoolNoSwapSharesRequest = { } return message; }, + fromJSON(object: any): QueryCalcJoinPoolNoSwapSharesRequest { + return { + poolId: isSet(object.poolId) ? BigInt(object.poolId.toString()) : BigInt(0), + tokensIn: Array.isArray(object?.tokensIn) ? object.tokensIn.map((e: any) => Coin.fromJSON(e)) : [] + }; + }, + toJSON(message: QueryCalcJoinPoolNoSwapSharesRequest): unknown { + const obj: any = {}; + message.poolId !== undefined && (obj.poolId = (message.poolId || BigInt(0)).toString()); + if (message.tokensIn) { + obj.tokensIn = message.tokensIn.map(e => e ? Coin.toJSON(e) : undefined); + } else { + obj.tokensIn = []; + } + return obj; + }, fromPartial(object: Partial): QueryCalcJoinPoolNoSwapSharesRequest { const message = createBaseQueryCalcJoinPoolNoSwapSharesRequest(); message.poolId = object.poolId !== undefined && object.poolId !== null ? BigInt(object.poolId.toString()) : BigInt(0); @@ -2042,10 +2556,12 @@ export const QueryCalcJoinPoolNoSwapSharesRequest = { return message; }, fromAmino(object: QueryCalcJoinPoolNoSwapSharesRequestAmino): QueryCalcJoinPoolNoSwapSharesRequest { - return { - poolId: BigInt(object.pool_id), - tokensIn: Array.isArray(object?.tokens_in) ? object.tokens_in.map((e: any) => Coin.fromAmino(e)) : [] - }; + const message = createBaseQueryCalcJoinPoolNoSwapSharesRequest(); + if (object.pool_id !== undefined && object.pool_id !== null) { + message.poolId = BigInt(object.pool_id); + } + message.tokensIn = object.tokens_in?.map(e => Coin.fromAmino(e)) || []; + return message; }, toAmino(message: QueryCalcJoinPoolNoSwapSharesRequest): QueryCalcJoinPoolNoSwapSharesRequestAmino { const obj: any = {}; @@ -2079,6 +2595,8 @@ export const QueryCalcJoinPoolNoSwapSharesRequest = { }; } }; +GlobalDecoderRegistry.register(QueryCalcJoinPoolNoSwapSharesRequest.typeUrl, QueryCalcJoinPoolNoSwapSharesRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryCalcJoinPoolNoSwapSharesRequest.aminoType, QueryCalcJoinPoolNoSwapSharesRequest.typeUrl); function createBaseQueryCalcJoinPoolNoSwapSharesResponse(): QueryCalcJoinPoolNoSwapSharesResponse { return { tokensOut: [], @@ -2087,6 +2605,16 @@ function createBaseQueryCalcJoinPoolNoSwapSharesResponse(): QueryCalcJoinPoolNoS } export const QueryCalcJoinPoolNoSwapSharesResponse = { typeUrl: "/osmosis.gamm.v1beta1.QueryCalcJoinPoolNoSwapSharesResponse", + aminoType: "osmosis/gamm/query-calc-join-pool-no-swap-shares-response", + is(o: any): o is QueryCalcJoinPoolNoSwapSharesResponse { + return o && (o.$typeUrl === QueryCalcJoinPoolNoSwapSharesResponse.typeUrl || Array.isArray(o.tokensOut) && (!o.tokensOut.length || Coin.is(o.tokensOut[0])) && typeof o.sharesOut === "string"); + }, + isSDK(o: any): o is QueryCalcJoinPoolNoSwapSharesResponseSDKType { + return o && (o.$typeUrl === QueryCalcJoinPoolNoSwapSharesResponse.typeUrl || Array.isArray(o.tokens_out) && (!o.tokens_out.length || Coin.isSDK(o.tokens_out[0])) && typeof o.shares_out === "string"); + }, + isAmino(o: any): o is QueryCalcJoinPoolNoSwapSharesResponseAmino { + return o && (o.$typeUrl === QueryCalcJoinPoolNoSwapSharesResponse.typeUrl || Array.isArray(o.tokens_out) && (!o.tokens_out.length || Coin.isAmino(o.tokens_out[0])) && typeof o.shares_out === "string"); + }, encode(message: QueryCalcJoinPoolNoSwapSharesResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.tokensOut) { Coin.encode(v!, writer.uint32(10).fork()).ldelim(); @@ -2116,6 +2644,22 @@ export const QueryCalcJoinPoolNoSwapSharesResponse = { } return message; }, + fromJSON(object: any): QueryCalcJoinPoolNoSwapSharesResponse { + return { + tokensOut: Array.isArray(object?.tokensOut) ? object.tokensOut.map((e: any) => Coin.fromJSON(e)) : [], + sharesOut: isSet(object.sharesOut) ? String(object.sharesOut) : "" + }; + }, + toJSON(message: QueryCalcJoinPoolNoSwapSharesResponse): unknown { + const obj: any = {}; + if (message.tokensOut) { + obj.tokensOut = message.tokensOut.map(e => e ? Coin.toJSON(e) : undefined); + } else { + obj.tokensOut = []; + } + message.sharesOut !== undefined && (obj.sharesOut = message.sharesOut); + return obj; + }, fromPartial(object: Partial): QueryCalcJoinPoolNoSwapSharesResponse { const message = createBaseQueryCalcJoinPoolNoSwapSharesResponse(); message.tokensOut = object.tokensOut?.map(e => Coin.fromPartial(e)) || []; @@ -2123,10 +2667,12 @@ export const QueryCalcJoinPoolNoSwapSharesResponse = { return message; }, fromAmino(object: QueryCalcJoinPoolNoSwapSharesResponseAmino): QueryCalcJoinPoolNoSwapSharesResponse { - return { - tokensOut: Array.isArray(object?.tokens_out) ? object.tokens_out.map((e: any) => Coin.fromAmino(e)) : [], - sharesOut: object.shares_out - }; + const message = createBaseQueryCalcJoinPoolNoSwapSharesResponse(); + message.tokensOut = object.tokens_out?.map(e => Coin.fromAmino(e)) || []; + if (object.shares_out !== undefined && object.shares_out !== null) { + message.sharesOut = object.shares_out; + } + return message; }, toAmino(message: QueryCalcJoinPoolNoSwapSharesResponse): QueryCalcJoinPoolNoSwapSharesResponseAmino { const obj: any = {}; @@ -2160,6 +2706,8 @@ export const QueryCalcJoinPoolNoSwapSharesResponse = { }; } }; +GlobalDecoderRegistry.register(QueryCalcJoinPoolNoSwapSharesResponse.typeUrl, QueryCalcJoinPoolNoSwapSharesResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryCalcJoinPoolNoSwapSharesResponse.aminoType, QueryCalcJoinPoolNoSwapSharesResponse.typeUrl); function createBaseQuerySpotPriceRequest(): QuerySpotPriceRequest { return { poolId: BigInt(0), @@ -2169,6 +2717,16 @@ function createBaseQuerySpotPriceRequest(): QuerySpotPriceRequest { } export const QuerySpotPriceRequest = { typeUrl: "/osmosis.gamm.v1beta1.QuerySpotPriceRequest", + aminoType: "osmosis/gamm/query-spot-price-request", + is(o: any): o is QuerySpotPriceRequest { + return o && (o.$typeUrl === QuerySpotPriceRequest.typeUrl || typeof o.poolId === "bigint" && typeof o.baseAssetDenom === "string" && typeof o.quoteAssetDenom === "string"); + }, + isSDK(o: any): o is QuerySpotPriceRequestSDKType { + return o && (o.$typeUrl === QuerySpotPriceRequest.typeUrl || typeof o.pool_id === "bigint" && typeof o.base_asset_denom === "string" && typeof o.quote_asset_denom === "string"); + }, + isAmino(o: any): o is QuerySpotPriceRequestAmino { + return o && (o.$typeUrl === QuerySpotPriceRequest.typeUrl || typeof o.pool_id === "bigint" && typeof o.base_asset_denom === "string" && typeof o.quote_asset_denom === "string"); + }, encode(message: QuerySpotPriceRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.poolId !== BigInt(0)) { writer.uint32(8).uint64(message.poolId); @@ -2204,6 +2762,20 @@ export const QuerySpotPriceRequest = { } return message; }, + fromJSON(object: any): QuerySpotPriceRequest { + return { + poolId: isSet(object.poolId) ? BigInt(object.poolId.toString()) : BigInt(0), + baseAssetDenom: isSet(object.baseAssetDenom) ? String(object.baseAssetDenom) : "", + quoteAssetDenom: isSet(object.quoteAssetDenom) ? String(object.quoteAssetDenom) : "" + }; + }, + toJSON(message: QuerySpotPriceRequest): unknown { + const obj: any = {}; + message.poolId !== undefined && (obj.poolId = (message.poolId || BigInt(0)).toString()); + message.baseAssetDenom !== undefined && (obj.baseAssetDenom = message.baseAssetDenom); + message.quoteAssetDenom !== undefined && (obj.quoteAssetDenom = message.quoteAssetDenom); + return obj; + }, fromPartial(object: Partial): QuerySpotPriceRequest { const message = createBaseQuerySpotPriceRequest(); message.poolId = object.poolId !== undefined && object.poolId !== null ? BigInt(object.poolId.toString()) : BigInt(0); @@ -2212,11 +2784,17 @@ export const QuerySpotPriceRequest = { return message; }, fromAmino(object: QuerySpotPriceRequestAmino): QuerySpotPriceRequest { - return { - poolId: BigInt(object.pool_id), - baseAssetDenom: object.base_asset_denom, - quoteAssetDenom: object.quote_asset_denom - }; + const message = createBaseQuerySpotPriceRequest(); + if (object.pool_id !== undefined && object.pool_id !== null) { + message.poolId = BigInt(object.pool_id); + } + if (object.base_asset_denom !== undefined && object.base_asset_denom !== null) { + message.baseAssetDenom = object.base_asset_denom; + } + if (object.quote_asset_denom !== undefined && object.quote_asset_denom !== null) { + message.quoteAssetDenom = object.quote_asset_denom; + } + return message; }, toAmino(message: QuerySpotPriceRequest): QuerySpotPriceRequestAmino { const obj: any = {}; @@ -2247,15 +2825,27 @@ export const QuerySpotPriceRequest = { }; } }; +GlobalDecoderRegistry.register(QuerySpotPriceRequest.typeUrl, QuerySpotPriceRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(QuerySpotPriceRequest.aminoType, QuerySpotPriceRequest.typeUrl); function createBaseQueryPoolsWithFilterRequest(): QueryPoolsWithFilterRequest { return { minLiquidity: "", poolType: "", - pagination: PageRequest.fromPartial({}) + pagination: undefined }; } export const QueryPoolsWithFilterRequest = { typeUrl: "/osmosis.gamm.v1beta1.QueryPoolsWithFilterRequest", + aminoType: "osmosis/gamm/query-pools-with-filter-request", + is(o: any): o is QueryPoolsWithFilterRequest { + return o && (o.$typeUrl === QueryPoolsWithFilterRequest.typeUrl || typeof o.minLiquidity === "string" && typeof o.poolType === "string"); + }, + isSDK(o: any): o is QueryPoolsWithFilterRequestSDKType { + return o && (o.$typeUrl === QueryPoolsWithFilterRequest.typeUrl || typeof o.min_liquidity === "string" && typeof o.pool_type === "string"); + }, + isAmino(o: any): o is QueryPoolsWithFilterRequestAmino { + return o && (o.$typeUrl === QueryPoolsWithFilterRequest.typeUrl || typeof o.min_liquidity === "string" && typeof o.pool_type === "string"); + }, encode(message: QueryPoolsWithFilterRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.minLiquidity !== "") { writer.uint32(10).string(message.minLiquidity); @@ -2291,6 +2881,20 @@ export const QueryPoolsWithFilterRequest = { } return message; }, + fromJSON(object: any): QueryPoolsWithFilterRequest { + return { + minLiquidity: isSet(object.minLiquidity) ? String(object.minLiquidity) : "", + poolType: isSet(object.poolType) ? String(object.poolType) : "", + pagination: isSet(object.pagination) ? PageRequest.fromJSON(object.pagination) : undefined + }; + }, + toJSON(message: QueryPoolsWithFilterRequest): unknown { + const obj: any = {}; + message.minLiquidity !== undefined && (obj.minLiquidity = message.minLiquidity); + message.poolType !== undefined && (obj.poolType = message.poolType); + message.pagination !== undefined && (obj.pagination = message.pagination ? PageRequest.toJSON(message.pagination) : undefined); + return obj; + }, fromPartial(object: Partial): QueryPoolsWithFilterRequest { const message = createBaseQueryPoolsWithFilterRequest(); message.minLiquidity = object.minLiquidity ?? ""; @@ -2299,11 +2903,17 @@ export const QueryPoolsWithFilterRequest = { return message; }, fromAmino(object: QueryPoolsWithFilterRequestAmino): QueryPoolsWithFilterRequest { - return { - minLiquidity: object.min_liquidity, - poolType: object.pool_type, - pagination: object?.pagination ? PageRequest.fromAmino(object.pagination) : undefined - }; + const message = createBaseQueryPoolsWithFilterRequest(); + if (object.min_liquidity !== undefined && object.min_liquidity !== null) { + message.minLiquidity = object.min_liquidity; + } + if (object.pool_type !== undefined && object.pool_type !== null) { + message.poolType = object.pool_type; + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromAmino(object.pagination); + } + return message; }, toAmino(message: QueryPoolsWithFilterRequest): QueryPoolsWithFilterRequestAmino { const obj: any = {}; @@ -2334,17 +2944,29 @@ export const QueryPoolsWithFilterRequest = { }; } }; +GlobalDecoderRegistry.register(QueryPoolsWithFilterRequest.typeUrl, QueryPoolsWithFilterRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryPoolsWithFilterRequest.aminoType, QueryPoolsWithFilterRequest.typeUrl); function createBaseQueryPoolsWithFilterResponse(): QueryPoolsWithFilterResponse { return { pools: [], - pagination: PageResponse.fromPartial({}) + pagination: undefined }; } export const QueryPoolsWithFilterResponse = { typeUrl: "/osmosis.gamm.v1beta1.QueryPoolsWithFilterResponse", + aminoType: "osmosis/gamm/query-pools-with-filter-response", + is(o: any): o is QueryPoolsWithFilterResponse { + return o && (o.$typeUrl === QueryPoolsWithFilterResponse.typeUrl || Array.isArray(o.pools) && (!o.pools.length || Pool1.is(o.pools[0]) || CosmWasmPool.is(o.pools[0]) || Pool2.is(o.pools[0]) || Pool3.is(o.pools[0]) || Any.is(o.pools[0]))); + }, + isSDK(o: any): o is QueryPoolsWithFilterResponseSDKType { + return o && (o.$typeUrl === QueryPoolsWithFilterResponse.typeUrl || Array.isArray(o.pools) && (!o.pools.length || Pool1.isSDK(o.pools[0]) || CosmWasmPool.isSDK(o.pools[0]) || Pool2.isSDK(o.pools[0]) || Pool3.isSDK(o.pools[0]) || Any.isSDK(o.pools[0]))); + }, + isAmino(o: any): o is QueryPoolsWithFilterResponseAmino { + return o && (o.$typeUrl === QueryPoolsWithFilterResponse.typeUrl || Array.isArray(o.pools) && (!o.pools.length || Pool1.isAmino(o.pools[0]) || CosmWasmPool.isAmino(o.pools[0]) || Pool2.isAmino(o.pools[0]) || Pool3.isAmino(o.pools[0]) || Any.isAmino(o.pools[0]))); + }, encode(message: QueryPoolsWithFilterResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.pools) { - Any.encode((v! as Any), writer.uint32(10).fork()).ldelim(); + Any.encode(GlobalDecoderRegistry.wrapAny(v!), writer.uint32(10).fork()).ldelim(); } if (message.pagination !== undefined) { PageResponse.encode(message.pagination, writer.uint32(18).fork()).ldelim(); @@ -2359,7 +2981,7 @@ export const QueryPoolsWithFilterResponse = { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.pools.push((PoolI_InterfaceDecoder(reader) as Any)); + message.pools.push(GlobalDecoderRegistry.unwrapAny(reader)); break; case 2: message.pagination = PageResponse.decode(reader, reader.uint32()); @@ -2371,22 +2993,40 @@ export const QueryPoolsWithFilterResponse = { } return message; }, + fromJSON(object: any): QueryPoolsWithFilterResponse { + return { + pools: Array.isArray(object?.pools) ? object.pools.map((e: any) => GlobalDecoderRegistry.fromJSON(e)) : [], + pagination: isSet(object.pagination) ? PageResponse.fromJSON(object.pagination) : undefined + }; + }, + toJSON(message: QueryPoolsWithFilterResponse): unknown { + const obj: any = {}; + if (message.pools) { + obj.pools = message.pools.map(e => e ? GlobalDecoderRegistry.toJSON(e) : undefined); + } else { + obj.pools = []; + } + message.pagination !== undefined && (obj.pagination = message.pagination ? PageResponse.toJSON(message.pagination) : undefined); + return obj; + }, fromPartial(object: Partial): QueryPoolsWithFilterResponse { const message = createBaseQueryPoolsWithFilterResponse(); - message.pools = object.pools?.map(e => Any.fromPartial(e)) || []; + message.pools = object.pools?.map(e => (Any.fromPartial(e) as any)) || []; message.pagination = object.pagination !== undefined && object.pagination !== null ? PageResponse.fromPartial(object.pagination) : undefined; return message; }, fromAmino(object: QueryPoolsWithFilterResponseAmino): QueryPoolsWithFilterResponse { - return { - pools: Array.isArray(object?.pools) ? object.pools.map((e: any) => PoolI_FromAmino(e)) : [], - pagination: object?.pagination ? PageResponse.fromAmino(object.pagination) : undefined - }; + const message = createBaseQueryPoolsWithFilterResponse(); + message.pools = object.pools?.map(e => GlobalDecoderRegistry.fromAminoMsg(e)) || []; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromAmino(object.pagination); + } + return message; }, toAmino(message: QueryPoolsWithFilterResponse): QueryPoolsWithFilterResponseAmino { const obj: any = {}; if (message.pools) { - obj.pools = message.pools.map(e => e ? PoolI_ToAmino((e as Any)) : undefined); + obj.pools = message.pools.map(e => e ? GlobalDecoderRegistry.toAminoMsg(e) : undefined); } else { obj.pools = []; } @@ -2415,6 +3055,8 @@ export const QueryPoolsWithFilterResponse = { }; } }; +GlobalDecoderRegistry.register(QueryPoolsWithFilterResponse.typeUrl, QueryPoolsWithFilterResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryPoolsWithFilterResponse.aminoType, QueryPoolsWithFilterResponse.typeUrl); function createBaseQuerySpotPriceResponse(): QuerySpotPriceResponse { return { spotPrice: "" @@ -2422,6 +3064,16 @@ function createBaseQuerySpotPriceResponse(): QuerySpotPriceResponse { } export const QuerySpotPriceResponse = { typeUrl: "/osmosis.gamm.v1beta1.QuerySpotPriceResponse", + aminoType: "osmosis/gamm/query-spot-price-response", + is(o: any): o is QuerySpotPriceResponse { + return o && (o.$typeUrl === QuerySpotPriceResponse.typeUrl || typeof o.spotPrice === "string"); + }, + isSDK(o: any): o is QuerySpotPriceResponseSDKType { + return o && (o.$typeUrl === QuerySpotPriceResponse.typeUrl || typeof o.spot_price === "string"); + }, + isAmino(o: any): o is QuerySpotPriceResponseAmino { + return o && (o.$typeUrl === QuerySpotPriceResponse.typeUrl || typeof o.spot_price === "string"); + }, encode(message: QuerySpotPriceResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.spotPrice !== "") { writer.uint32(10).string(message.spotPrice); @@ -2445,15 +3097,27 @@ export const QuerySpotPriceResponse = { } return message; }, + fromJSON(object: any): QuerySpotPriceResponse { + return { + spotPrice: isSet(object.spotPrice) ? String(object.spotPrice) : "" + }; + }, + toJSON(message: QuerySpotPriceResponse): unknown { + const obj: any = {}; + message.spotPrice !== undefined && (obj.spotPrice = message.spotPrice); + return obj; + }, fromPartial(object: Partial): QuerySpotPriceResponse { const message = createBaseQuerySpotPriceResponse(); message.spotPrice = object.spotPrice ?? ""; return message; }, fromAmino(object: QuerySpotPriceResponseAmino): QuerySpotPriceResponse { - return { - spotPrice: object.spot_price - }; + const message = createBaseQuerySpotPriceResponse(); + if (object.spot_price !== undefined && object.spot_price !== null) { + message.spotPrice = object.spot_price; + } + return message; }, toAmino(message: QuerySpotPriceResponse): QuerySpotPriceResponseAmino { const obj: any = {}; @@ -2482,6 +3146,8 @@ export const QuerySpotPriceResponse = { }; } }; +GlobalDecoderRegistry.register(QuerySpotPriceResponse.typeUrl, QuerySpotPriceResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(QuerySpotPriceResponse.aminoType, QuerySpotPriceResponse.typeUrl); function createBaseQuerySwapExactAmountInRequest(): QuerySwapExactAmountInRequest { return { sender: "", @@ -2492,6 +3158,16 @@ function createBaseQuerySwapExactAmountInRequest(): QuerySwapExactAmountInReques } export const QuerySwapExactAmountInRequest = { typeUrl: "/osmosis.gamm.v1beta1.QuerySwapExactAmountInRequest", + aminoType: "osmosis/gamm/query-swap-exact-amount-in-request", + is(o: any): o is QuerySwapExactAmountInRequest { + return o && (o.$typeUrl === QuerySwapExactAmountInRequest.typeUrl || typeof o.sender === "string" && typeof o.poolId === "bigint" && typeof o.tokenIn === "string" && Array.isArray(o.routes) && (!o.routes.length || SwapAmountInRoute.is(o.routes[0]))); + }, + isSDK(o: any): o is QuerySwapExactAmountInRequestSDKType { + return o && (o.$typeUrl === QuerySwapExactAmountInRequest.typeUrl || typeof o.sender === "string" && typeof o.pool_id === "bigint" && typeof o.token_in === "string" && Array.isArray(o.routes) && (!o.routes.length || SwapAmountInRoute.isSDK(o.routes[0]))); + }, + isAmino(o: any): o is QuerySwapExactAmountInRequestAmino { + return o && (o.$typeUrl === QuerySwapExactAmountInRequest.typeUrl || typeof o.sender === "string" && typeof o.pool_id === "bigint" && typeof o.token_in === "string" && Array.isArray(o.routes) && (!o.routes.length || SwapAmountInRoute.isAmino(o.routes[0]))); + }, encode(message: QuerySwapExactAmountInRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.sender !== "") { writer.uint32(10).string(message.sender); @@ -2533,6 +3209,26 @@ export const QuerySwapExactAmountInRequest = { } return message; }, + fromJSON(object: any): QuerySwapExactAmountInRequest { + return { + sender: isSet(object.sender) ? String(object.sender) : "", + poolId: isSet(object.poolId) ? BigInt(object.poolId.toString()) : BigInt(0), + tokenIn: isSet(object.tokenIn) ? String(object.tokenIn) : "", + routes: Array.isArray(object?.routes) ? object.routes.map((e: any) => SwapAmountInRoute.fromJSON(e)) : [] + }; + }, + toJSON(message: QuerySwapExactAmountInRequest): unknown { + const obj: any = {}; + message.sender !== undefined && (obj.sender = message.sender); + message.poolId !== undefined && (obj.poolId = (message.poolId || BigInt(0)).toString()); + message.tokenIn !== undefined && (obj.tokenIn = message.tokenIn); + if (message.routes) { + obj.routes = message.routes.map(e => e ? SwapAmountInRoute.toJSON(e) : undefined); + } else { + obj.routes = []; + } + return obj; + }, fromPartial(object: Partial): QuerySwapExactAmountInRequest { const message = createBaseQuerySwapExactAmountInRequest(); message.sender = object.sender ?? ""; @@ -2542,12 +3238,18 @@ export const QuerySwapExactAmountInRequest = { return message; }, fromAmino(object: QuerySwapExactAmountInRequestAmino): QuerySwapExactAmountInRequest { - return { - sender: object.sender, - poolId: BigInt(object.pool_id), - tokenIn: object.token_in, - routes: Array.isArray(object?.routes) ? object.routes.map((e: any) => SwapAmountInRoute.fromAmino(e)) : [] - }; + const message = createBaseQuerySwapExactAmountInRequest(); + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + if (object.pool_id !== undefined && object.pool_id !== null) { + message.poolId = BigInt(object.pool_id); + } + if (object.token_in !== undefined && object.token_in !== null) { + message.tokenIn = object.token_in; + } + message.routes = object.routes?.map(e => SwapAmountInRoute.fromAmino(e)) || []; + return message; }, toAmino(message: QuerySwapExactAmountInRequest): QuerySwapExactAmountInRequestAmino { const obj: any = {}; @@ -2583,6 +3285,8 @@ export const QuerySwapExactAmountInRequest = { }; } }; +GlobalDecoderRegistry.register(QuerySwapExactAmountInRequest.typeUrl, QuerySwapExactAmountInRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(QuerySwapExactAmountInRequest.aminoType, QuerySwapExactAmountInRequest.typeUrl); function createBaseQuerySwapExactAmountInResponse(): QuerySwapExactAmountInResponse { return { tokenOutAmount: "" @@ -2590,6 +3294,16 @@ function createBaseQuerySwapExactAmountInResponse(): QuerySwapExactAmountInRespo } export const QuerySwapExactAmountInResponse = { typeUrl: "/osmosis.gamm.v1beta1.QuerySwapExactAmountInResponse", + aminoType: "osmosis/gamm/query-swap-exact-amount-in-response", + is(o: any): o is QuerySwapExactAmountInResponse { + return o && (o.$typeUrl === QuerySwapExactAmountInResponse.typeUrl || typeof o.tokenOutAmount === "string"); + }, + isSDK(o: any): o is QuerySwapExactAmountInResponseSDKType { + return o && (o.$typeUrl === QuerySwapExactAmountInResponse.typeUrl || typeof o.token_out_amount === "string"); + }, + isAmino(o: any): o is QuerySwapExactAmountInResponseAmino { + return o && (o.$typeUrl === QuerySwapExactAmountInResponse.typeUrl || typeof o.token_out_amount === "string"); + }, encode(message: QuerySwapExactAmountInResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.tokenOutAmount !== "") { writer.uint32(10).string(message.tokenOutAmount); @@ -2613,15 +3327,27 @@ export const QuerySwapExactAmountInResponse = { } return message; }, + fromJSON(object: any): QuerySwapExactAmountInResponse { + return { + tokenOutAmount: isSet(object.tokenOutAmount) ? String(object.tokenOutAmount) : "" + }; + }, + toJSON(message: QuerySwapExactAmountInResponse): unknown { + const obj: any = {}; + message.tokenOutAmount !== undefined && (obj.tokenOutAmount = message.tokenOutAmount); + return obj; + }, fromPartial(object: Partial): QuerySwapExactAmountInResponse { const message = createBaseQuerySwapExactAmountInResponse(); message.tokenOutAmount = object.tokenOutAmount ?? ""; return message; }, fromAmino(object: QuerySwapExactAmountInResponseAmino): QuerySwapExactAmountInResponse { - return { - tokenOutAmount: object.token_out_amount - }; + const message = createBaseQuerySwapExactAmountInResponse(); + if (object.token_out_amount !== undefined && object.token_out_amount !== null) { + message.tokenOutAmount = object.token_out_amount; + } + return message; }, toAmino(message: QuerySwapExactAmountInResponse): QuerySwapExactAmountInResponseAmino { const obj: any = {}; @@ -2650,6 +3376,8 @@ export const QuerySwapExactAmountInResponse = { }; } }; +GlobalDecoderRegistry.register(QuerySwapExactAmountInResponse.typeUrl, QuerySwapExactAmountInResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(QuerySwapExactAmountInResponse.aminoType, QuerySwapExactAmountInResponse.typeUrl); function createBaseQuerySwapExactAmountOutRequest(): QuerySwapExactAmountOutRequest { return { sender: "", @@ -2660,6 +3388,16 @@ function createBaseQuerySwapExactAmountOutRequest(): QuerySwapExactAmountOutRequ } export const QuerySwapExactAmountOutRequest = { typeUrl: "/osmosis.gamm.v1beta1.QuerySwapExactAmountOutRequest", + aminoType: "osmosis/gamm/query-swap-exact-amount-out-request", + is(o: any): o is QuerySwapExactAmountOutRequest { + return o && (o.$typeUrl === QuerySwapExactAmountOutRequest.typeUrl || typeof o.sender === "string" && typeof o.poolId === "bigint" && Array.isArray(o.routes) && (!o.routes.length || SwapAmountOutRoute.is(o.routes[0])) && typeof o.tokenOut === "string"); + }, + isSDK(o: any): o is QuerySwapExactAmountOutRequestSDKType { + return o && (o.$typeUrl === QuerySwapExactAmountOutRequest.typeUrl || typeof o.sender === "string" && typeof o.pool_id === "bigint" && Array.isArray(o.routes) && (!o.routes.length || SwapAmountOutRoute.isSDK(o.routes[0])) && typeof o.token_out === "string"); + }, + isAmino(o: any): o is QuerySwapExactAmountOutRequestAmino { + return o && (o.$typeUrl === QuerySwapExactAmountOutRequest.typeUrl || typeof o.sender === "string" && typeof o.pool_id === "bigint" && Array.isArray(o.routes) && (!o.routes.length || SwapAmountOutRoute.isAmino(o.routes[0])) && typeof o.token_out === "string"); + }, encode(message: QuerySwapExactAmountOutRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.sender !== "") { writer.uint32(10).string(message.sender); @@ -2701,6 +3439,26 @@ export const QuerySwapExactAmountOutRequest = { } return message; }, + fromJSON(object: any): QuerySwapExactAmountOutRequest { + return { + sender: isSet(object.sender) ? String(object.sender) : "", + poolId: isSet(object.poolId) ? BigInt(object.poolId.toString()) : BigInt(0), + routes: Array.isArray(object?.routes) ? object.routes.map((e: any) => SwapAmountOutRoute.fromJSON(e)) : [], + tokenOut: isSet(object.tokenOut) ? String(object.tokenOut) : "" + }; + }, + toJSON(message: QuerySwapExactAmountOutRequest): unknown { + const obj: any = {}; + message.sender !== undefined && (obj.sender = message.sender); + message.poolId !== undefined && (obj.poolId = (message.poolId || BigInt(0)).toString()); + if (message.routes) { + obj.routes = message.routes.map(e => e ? SwapAmountOutRoute.toJSON(e) : undefined); + } else { + obj.routes = []; + } + message.tokenOut !== undefined && (obj.tokenOut = message.tokenOut); + return obj; + }, fromPartial(object: Partial): QuerySwapExactAmountOutRequest { const message = createBaseQuerySwapExactAmountOutRequest(); message.sender = object.sender ?? ""; @@ -2710,12 +3468,18 @@ export const QuerySwapExactAmountOutRequest = { return message; }, fromAmino(object: QuerySwapExactAmountOutRequestAmino): QuerySwapExactAmountOutRequest { - return { - sender: object.sender, - poolId: BigInt(object.pool_id), - routes: Array.isArray(object?.routes) ? object.routes.map((e: any) => SwapAmountOutRoute.fromAmino(e)) : [], - tokenOut: object.token_out - }; + const message = createBaseQuerySwapExactAmountOutRequest(); + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + if (object.pool_id !== undefined && object.pool_id !== null) { + message.poolId = BigInt(object.pool_id); + } + message.routes = object.routes?.map(e => SwapAmountOutRoute.fromAmino(e)) || []; + if (object.token_out !== undefined && object.token_out !== null) { + message.tokenOut = object.token_out; + } + return message; }, toAmino(message: QuerySwapExactAmountOutRequest): QuerySwapExactAmountOutRequestAmino { const obj: any = {}; @@ -2751,6 +3515,8 @@ export const QuerySwapExactAmountOutRequest = { }; } }; +GlobalDecoderRegistry.register(QuerySwapExactAmountOutRequest.typeUrl, QuerySwapExactAmountOutRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(QuerySwapExactAmountOutRequest.aminoType, QuerySwapExactAmountOutRequest.typeUrl); function createBaseQuerySwapExactAmountOutResponse(): QuerySwapExactAmountOutResponse { return { tokenInAmount: "" @@ -2758,6 +3524,16 @@ function createBaseQuerySwapExactAmountOutResponse(): QuerySwapExactAmountOutRes } export const QuerySwapExactAmountOutResponse = { typeUrl: "/osmosis.gamm.v1beta1.QuerySwapExactAmountOutResponse", + aminoType: "osmosis/gamm/query-swap-exact-amount-out-response", + is(o: any): o is QuerySwapExactAmountOutResponse { + return o && (o.$typeUrl === QuerySwapExactAmountOutResponse.typeUrl || typeof o.tokenInAmount === "string"); + }, + isSDK(o: any): o is QuerySwapExactAmountOutResponseSDKType { + return o && (o.$typeUrl === QuerySwapExactAmountOutResponse.typeUrl || typeof o.token_in_amount === "string"); + }, + isAmino(o: any): o is QuerySwapExactAmountOutResponseAmino { + return o && (o.$typeUrl === QuerySwapExactAmountOutResponse.typeUrl || typeof o.token_in_amount === "string"); + }, encode(message: QuerySwapExactAmountOutResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.tokenInAmount !== "") { writer.uint32(10).string(message.tokenInAmount); @@ -2781,15 +3557,27 @@ export const QuerySwapExactAmountOutResponse = { } return message; }, + fromJSON(object: any): QuerySwapExactAmountOutResponse { + return { + tokenInAmount: isSet(object.tokenInAmount) ? String(object.tokenInAmount) : "" + }; + }, + toJSON(message: QuerySwapExactAmountOutResponse): unknown { + const obj: any = {}; + message.tokenInAmount !== undefined && (obj.tokenInAmount = message.tokenInAmount); + return obj; + }, fromPartial(object: Partial): QuerySwapExactAmountOutResponse { const message = createBaseQuerySwapExactAmountOutResponse(); message.tokenInAmount = object.tokenInAmount ?? ""; return message; }, fromAmino(object: QuerySwapExactAmountOutResponseAmino): QuerySwapExactAmountOutResponse { - return { - tokenInAmount: object.token_in_amount - }; + const message = createBaseQuerySwapExactAmountOutResponse(); + if (object.token_in_amount !== undefined && object.token_in_amount !== null) { + message.tokenInAmount = object.token_in_amount; + } + return message; }, toAmino(message: QuerySwapExactAmountOutResponse): QuerySwapExactAmountOutResponseAmino { const obj: any = {}; @@ -2818,11 +3606,23 @@ export const QuerySwapExactAmountOutResponse = { }; } }; +GlobalDecoderRegistry.register(QuerySwapExactAmountOutResponse.typeUrl, QuerySwapExactAmountOutResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(QuerySwapExactAmountOutResponse.aminoType, QuerySwapExactAmountOutResponse.typeUrl); function createBaseQueryTotalLiquidityRequest(): QueryTotalLiquidityRequest { return {}; } export const QueryTotalLiquidityRequest = { typeUrl: "/osmosis.gamm.v1beta1.QueryTotalLiquidityRequest", + aminoType: "osmosis/gamm/query-total-liquidity-request", + is(o: any): o is QueryTotalLiquidityRequest { + return o && o.$typeUrl === QueryTotalLiquidityRequest.typeUrl; + }, + isSDK(o: any): o is QueryTotalLiquidityRequestSDKType { + return o && o.$typeUrl === QueryTotalLiquidityRequest.typeUrl; + }, + isAmino(o: any): o is QueryTotalLiquidityRequestAmino { + return o && o.$typeUrl === QueryTotalLiquidityRequest.typeUrl; + }, encode(_: QueryTotalLiquidityRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, @@ -2840,12 +3640,20 @@ export const QueryTotalLiquidityRequest = { } return message; }, + fromJSON(_: any): QueryTotalLiquidityRequest { + return {}; + }, + toJSON(_: QueryTotalLiquidityRequest): unknown { + const obj: any = {}; + return obj; + }, fromPartial(_: Partial): QueryTotalLiquidityRequest { const message = createBaseQueryTotalLiquidityRequest(); return message; }, fromAmino(_: QueryTotalLiquidityRequestAmino): QueryTotalLiquidityRequest { - return {}; + const message = createBaseQueryTotalLiquidityRequest(); + return message; }, toAmino(_: QueryTotalLiquidityRequest): QueryTotalLiquidityRequestAmino { const obj: any = {}; @@ -2873,6 +3681,8 @@ export const QueryTotalLiquidityRequest = { }; } }; +GlobalDecoderRegistry.register(QueryTotalLiquidityRequest.typeUrl, QueryTotalLiquidityRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryTotalLiquidityRequest.aminoType, QueryTotalLiquidityRequest.typeUrl); function createBaseQueryTotalLiquidityResponse(): QueryTotalLiquidityResponse { return { liquidity: [] @@ -2880,6 +3690,16 @@ function createBaseQueryTotalLiquidityResponse(): QueryTotalLiquidityResponse { } export const QueryTotalLiquidityResponse = { typeUrl: "/osmosis.gamm.v1beta1.QueryTotalLiquidityResponse", + aminoType: "osmosis/gamm/query-total-liquidity-response", + is(o: any): o is QueryTotalLiquidityResponse { + return o && (o.$typeUrl === QueryTotalLiquidityResponse.typeUrl || Array.isArray(o.liquidity) && (!o.liquidity.length || Coin.is(o.liquidity[0]))); + }, + isSDK(o: any): o is QueryTotalLiquidityResponseSDKType { + return o && (o.$typeUrl === QueryTotalLiquidityResponse.typeUrl || Array.isArray(o.liquidity) && (!o.liquidity.length || Coin.isSDK(o.liquidity[0]))); + }, + isAmino(o: any): o is QueryTotalLiquidityResponseAmino { + return o && (o.$typeUrl === QueryTotalLiquidityResponse.typeUrl || Array.isArray(o.liquidity) && (!o.liquidity.length || Coin.isAmino(o.liquidity[0]))); + }, encode(message: QueryTotalLiquidityResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.liquidity) { Coin.encode(v!, writer.uint32(10).fork()).ldelim(); @@ -2903,15 +3723,29 @@ export const QueryTotalLiquidityResponse = { } return message; }, + fromJSON(object: any): QueryTotalLiquidityResponse { + return { + liquidity: Array.isArray(object?.liquidity) ? object.liquidity.map((e: any) => Coin.fromJSON(e)) : [] + }; + }, + toJSON(message: QueryTotalLiquidityResponse): unknown { + const obj: any = {}; + if (message.liquidity) { + obj.liquidity = message.liquidity.map(e => e ? Coin.toJSON(e) : undefined); + } else { + obj.liquidity = []; + } + return obj; + }, fromPartial(object: Partial): QueryTotalLiquidityResponse { const message = createBaseQueryTotalLiquidityResponse(); message.liquidity = object.liquidity?.map(e => Coin.fromPartial(e)) || []; return message; }, fromAmino(object: QueryTotalLiquidityResponseAmino): QueryTotalLiquidityResponse { - return { - liquidity: Array.isArray(object?.liquidity) ? object.liquidity.map((e: any) => Coin.fromAmino(e)) : [] - }; + const message = createBaseQueryTotalLiquidityResponse(); + message.liquidity = object.liquidity?.map(e => Coin.fromAmino(e)) || []; + return message; }, toAmino(message: QueryTotalLiquidityResponse): QueryTotalLiquidityResponseAmino { const obj: any = {}; @@ -2944,6 +3778,8 @@ export const QueryTotalLiquidityResponse = { }; } }; +GlobalDecoderRegistry.register(QueryTotalLiquidityResponse.typeUrl, QueryTotalLiquidityResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryTotalLiquidityResponse.aminoType, QueryTotalLiquidityResponse.typeUrl); function createBaseQueryConcentratedPoolIdLinkFromCFMMRequest(): QueryConcentratedPoolIdLinkFromCFMMRequest { return { cfmmPoolId: BigInt(0) @@ -2951,6 +3787,16 @@ function createBaseQueryConcentratedPoolIdLinkFromCFMMRequest(): QueryConcentrat } export const QueryConcentratedPoolIdLinkFromCFMMRequest = { typeUrl: "/osmosis.gamm.v1beta1.QueryConcentratedPoolIdLinkFromCFMMRequest", + aminoType: "osmosis/gamm/query-concentrated-pool-id-link-from-cfmm-request", + is(o: any): o is QueryConcentratedPoolIdLinkFromCFMMRequest { + return o && (o.$typeUrl === QueryConcentratedPoolIdLinkFromCFMMRequest.typeUrl || typeof o.cfmmPoolId === "bigint"); + }, + isSDK(o: any): o is QueryConcentratedPoolIdLinkFromCFMMRequestSDKType { + return o && (o.$typeUrl === QueryConcentratedPoolIdLinkFromCFMMRequest.typeUrl || typeof o.cfmm_pool_id === "bigint"); + }, + isAmino(o: any): o is QueryConcentratedPoolIdLinkFromCFMMRequestAmino { + return o && (o.$typeUrl === QueryConcentratedPoolIdLinkFromCFMMRequest.typeUrl || typeof o.cfmm_pool_id === "bigint"); + }, encode(message: QueryConcentratedPoolIdLinkFromCFMMRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.cfmmPoolId !== BigInt(0)) { writer.uint32(8).uint64(message.cfmmPoolId); @@ -2974,15 +3820,27 @@ export const QueryConcentratedPoolIdLinkFromCFMMRequest = { } return message; }, + fromJSON(object: any): QueryConcentratedPoolIdLinkFromCFMMRequest { + return { + cfmmPoolId: isSet(object.cfmmPoolId) ? BigInt(object.cfmmPoolId.toString()) : BigInt(0) + }; + }, + toJSON(message: QueryConcentratedPoolIdLinkFromCFMMRequest): unknown { + const obj: any = {}; + message.cfmmPoolId !== undefined && (obj.cfmmPoolId = (message.cfmmPoolId || BigInt(0)).toString()); + return obj; + }, fromPartial(object: Partial): QueryConcentratedPoolIdLinkFromCFMMRequest { const message = createBaseQueryConcentratedPoolIdLinkFromCFMMRequest(); message.cfmmPoolId = object.cfmmPoolId !== undefined && object.cfmmPoolId !== null ? BigInt(object.cfmmPoolId.toString()) : BigInt(0); return message; }, fromAmino(object: QueryConcentratedPoolIdLinkFromCFMMRequestAmino): QueryConcentratedPoolIdLinkFromCFMMRequest { - return { - cfmmPoolId: BigInt(object.cfmm_pool_id) - }; + const message = createBaseQueryConcentratedPoolIdLinkFromCFMMRequest(); + if (object.cfmm_pool_id !== undefined && object.cfmm_pool_id !== null) { + message.cfmmPoolId = BigInt(object.cfmm_pool_id); + } + return message; }, toAmino(message: QueryConcentratedPoolIdLinkFromCFMMRequest): QueryConcentratedPoolIdLinkFromCFMMRequestAmino { const obj: any = {}; @@ -3011,6 +3869,8 @@ export const QueryConcentratedPoolIdLinkFromCFMMRequest = { }; } }; +GlobalDecoderRegistry.register(QueryConcentratedPoolIdLinkFromCFMMRequest.typeUrl, QueryConcentratedPoolIdLinkFromCFMMRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryConcentratedPoolIdLinkFromCFMMRequest.aminoType, QueryConcentratedPoolIdLinkFromCFMMRequest.typeUrl); function createBaseQueryConcentratedPoolIdLinkFromCFMMResponse(): QueryConcentratedPoolIdLinkFromCFMMResponse { return { concentratedPoolId: BigInt(0) @@ -3018,6 +3878,16 @@ function createBaseQueryConcentratedPoolIdLinkFromCFMMResponse(): QueryConcentra } export const QueryConcentratedPoolIdLinkFromCFMMResponse = { typeUrl: "/osmosis.gamm.v1beta1.QueryConcentratedPoolIdLinkFromCFMMResponse", + aminoType: "osmosis/gamm/query-concentrated-pool-id-link-from-cfmm-response", + is(o: any): o is QueryConcentratedPoolIdLinkFromCFMMResponse { + return o && (o.$typeUrl === QueryConcentratedPoolIdLinkFromCFMMResponse.typeUrl || typeof o.concentratedPoolId === "bigint"); + }, + isSDK(o: any): o is QueryConcentratedPoolIdLinkFromCFMMResponseSDKType { + return o && (o.$typeUrl === QueryConcentratedPoolIdLinkFromCFMMResponse.typeUrl || typeof o.concentrated_pool_id === "bigint"); + }, + isAmino(o: any): o is QueryConcentratedPoolIdLinkFromCFMMResponseAmino { + return o && (o.$typeUrl === QueryConcentratedPoolIdLinkFromCFMMResponse.typeUrl || typeof o.concentrated_pool_id === "bigint"); + }, encode(message: QueryConcentratedPoolIdLinkFromCFMMResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.concentratedPoolId !== BigInt(0)) { writer.uint32(8).uint64(message.concentratedPoolId); @@ -3041,15 +3911,27 @@ export const QueryConcentratedPoolIdLinkFromCFMMResponse = { } return message; }, + fromJSON(object: any): QueryConcentratedPoolIdLinkFromCFMMResponse { + return { + concentratedPoolId: isSet(object.concentratedPoolId) ? BigInt(object.concentratedPoolId.toString()) : BigInt(0) + }; + }, + toJSON(message: QueryConcentratedPoolIdLinkFromCFMMResponse): unknown { + const obj: any = {}; + message.concentratedPoolId !== undefined && (obj.concentratedPoolId = (message.concentratedPoolId || BigInt(0)).toString()); + return obj; + }, fromPartial(object: Partial): QueryConcentratedPoolIdLinkFromCFMMResponse { const message = createBaseQueryConcentratedPoolIdLinkFromCFMMResponse(); message.concentratedPoolId = object.concentratedPoolId !== undefined && object.concentratedPoolId !== null ? BigInt(object.concentratedPoolId.toString()) : BigInt(0); return message; }, fromAmino(object: QueryConcentratedPoolIdLinkFromCFMMResponseAmino): QueryConcentratedPoolIdLinkFromCFMMResponse { - return { - concentratedPoolId: BigInt(object.concentrated_pool_id) - }; + const message = createBaseQueryConcentratedPoolIdLinkFromCFMMResponse(); + if (object.concentrated_pool_id !== undefined && object.concentrated_pool_id !== null) { + message.concentratedPoolId = BigInt(object.concentrated_pool_id); + } + return message; }, toAmino(message: QueryConcentratedPoolIdLinkFromCFMMResponse): QueryConcentratedPoolIdLinkFromCFMMResponseAmino { const obj: any = {}; @@ -3078,71 +3960,171 @@ export const QueryConcentratedPoolIdLinkFromCFMMResponse = { }; } }; -export const PoolI_InterfaceDecoder = (input: BinaryReader | Uint8Array): Pool1 | CosmWasmPool | Pool2 | Pool3 | Any => { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - const data = Any.decode(reader, reader.uint32()); - switch (data.typeUrl) { - case "/osmosis.concentratedliquidity.v1beta1.Pool": - return Pool1.decode(data.value); - case "/osmosis.cosmwasmpool.v1beta1.CosmWasmPool": - return CosmWasmPool.decode(data.value); - case "/osmosis.gamm.v1beta1.Pool": - return Pool2.decode(data.value); - case "/osmosis.gamm.poolmodels.stableswap.v1beta1.Pool": - return Pool3.decode(data.value); - default: - return data; +GlobalDecoderRegistry.register(QueryConcentratedPoolIdLinkFromCFMMResponse.typeUrl, QueryConcentratedPoolIdLinkFromCFMMResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryConcentratedPoolIdLinkFromCFMMResponse.aminoType, QueryConcentratedPoolIdLinkFromCFMMResponse.typeUrl); +function createBaseQueryCFMMConcentratedPoolLinksRequest(): QueryCFMMConcentratedPoolLinksRequest { + return {}; +} +export const QueryCFMMConcentratedPoolLinksRequest = { + typeUrl: "/osmosis.gamm.v1beta1.QueryCFMMConcentratedPoolLinksRequest", + aminoType: "osmosis/gamm/query-cfmm-concentrated-pool-links-request", + is(o: any): o is QueryCFMMConcentratedPoolLinksRequest { + return o && o.$typeUrl === QueryCFMMConcentratedPoolLinksRequest.typeUrl; + }, + isSDK(o: any): o is QueryCFMMConcentratedPoolLinksRequestSDKType { + return o && o.$typeUrl === QueryCFMMConcentratedPoolLinksRequest.typeUrl; + }, + isAmino(o: any): o is QueryCFMMConcentratedPoolLinksRequestAmino { + return o && o.$typeUrl === QueryCFMMConcentratedPoolLinksRequest.typeUrl; + }, + encode(_: QueryCFMMConcentratedPoolLinksRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryCFMMConcentratedPoolLinksRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryCFMMConcentratedPoolLinksRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(_: any): QueryCFMMConcentratedPoolLinksRequest { + return {}; + }, + toJSON(_: QueryCFMMConcentratedPoolLinksRequest): unknown { + const obj: any = {}; + return obj; + }, + fromPartial(_: Partial): QueryCFMMConcentratedPoolLinksRequest { + const message = createBaseQueryCFMMConcentratedPoolLinksRequest(); + return message; + }, + fromAmino(_: QueryCFMMConcentratedPoolLinksRequestAmino): QueryCFMMConcentratedPoolLinksRequest { + const message = createBaseQueryCFMMConcentratedPoolLinksRequest(); + return message; + }, + toAmino(_: QueryCFMMConcentratedPoolLinksRequest): QueryCFMMConcentratedPoolLinksRequestAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: QueryCFMMConcentratedPoolLinksRequestAminoMsg): QueryCFMMConcentratedPoolLinksRequest { + return QueryCFMMConcentratedPoolLinksRequest.fromAmino(object.value); + }, + toAminoMsg(message: QueryCFMMConcentratedPoolLinksRequest): QueryCFMMConcentratedPoolLinksRequestAminoMsg { + return { + type: "osmosis/gamm/query-cfmm-concentrated-pool-links-request", + value: QueryCFMMConcentratedPoolLinksRequest.toAmino(message) + }; + }, + fromProtoMsg(message: QueryCFMMConcentratedPoolLinksRequestProtoMsg): QueryCFMMConcentratedPoolLinksRequest { + return QueryCFMMConcentratedPoolLinksRequest.decode(message.value); + }, + toProto(message: QueryCFMMConcentratedPoolLinksRequest): Uint8Array { + return QueryCFMMConcentratedPoolLinksRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryCFMMConcentratedPoolLinksRequest): QueryCFMMConcentratedPoolLinksRequestProtoMsg { + return { + typeUrl: "/osmosis.gamm.v1beta1.QueryCFMMConcentratedPoolLinksRequest", + value: QueryCFMMConcentratedPoolLinksRequest.encode(message).finish() + }; } }; -export const PoolI_FromAmino = (content: AnyAmino) => { - switch (content.type) { - case "osmosis/concentratedliquidity/pool": - return Any.fromPartial({ - typeUrl: "/osmosis.concentratedliquidity.v1beta1.Pool", - value: Pool1.encode(Pool1.fromPartial(Pool1.fromAmino(content.value))).finish() - }); - case "osmosis/cosmwasmpool/cosm-wasm-pool": - return Any.fromPartial({ - typeUrl: "/osmosis.cosmwasmpool.v1beta1.CosmWasmPool", - value: CosmWasmPool.encode(CosmWasmPool.fromPartial(CosmWasmPool.fromAmino(content.value))).finish() - }); - case "osmosis/gamm/BalancerPool": - return Any.fromPartial({ - typeUrl: "/osmosis.gamm.v1beta1.Pool", - value: Pool2.encode(Pool2.fromPartial(Pool2.fromAmino(content.value))).finish() - }); - case "osmosis/gamm/StableswapPool": - return Any.fromPartial({ - typeUrl: "/osmosis.gamm.poolmodels.stableswap.v1beta1.Pool", - value: Pool3.encode(Pool3.fromPartial(Pool3.fromAmino(content.value))).finish() - }); - default: - return Any.fromAmino(content); +GlobalDecoderRegistry.register(QueryCFMMConcentratedPoolLinksRequest.typeUrl, QueryCFMMConcentratedPoolLinksRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryCFMMConcentratedPoolLinksRequest.aminoType, QueryCFMMConcentratedPoolLinksRequest.typeUrl); +function createBaseQueryCFMMConcentratedPoolLinksResponse(): QueryCFMMConcentratedPoolLinksResponse { + return { + migrationRecords: undefined + }; +} +export const QueryCFMMConcentratedPoolLinksResponse = { + typeUrl: "/osmosis.gamm.v1beta1.QueryCFMMConcentratedPoolLinksResponse", + aminoType: "osmosis/gamm/query-cfmm-concentrated-pool-links-response", + is(o: any): o is QueryCFMMConcentratedPoolLinksResponse { + return o && o.$typeUrl === QueryCFMMConcentratedPoolLinksResponse.typeUrl; + }, + isSDK(o: any): o is QueryCFMMConcentratedPoolLinksResponseSDKType { + return o && o.$typeUrl === QueryCFMMConcentratedPoolLinksResponse.typeUrl; + }, + isAmino(o: any): o is QueryCFMMConcentratedPoolLinksResponseAmino { + return o && o.$typeUrl === QueryCFMMConcentratedPoolLinksResponse.typeUrl; + }, + encode(message: QueryCFMMConcentratedPoolLinksResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.migrationRecords !== undefined) { + MigrationRecords.encode(message.migrationRecords, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryCFMMConcentratedPoolLinksResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryCFMMConcentratedPoolLinksResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.migrationRecords = MigrationRecords.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): QueryCFMMConcentratedPoolLinksResponse { + return { + migrationRecords: isSet(object.migrationRecords) ? MigrationRecords.fromJSON(object.migrationRecords) : undefined + }; + }, + toJSON(message: QueryCFMMConcentratedPoolLinksResponse): unknown { + const obj: any = {}; + message.migrationRecords !== undefined && (obj.migrationRecords = message.migrationRecords ? MigrationRecords.toJSON(message.migrationRecords) : undefined); + return obj; + }, + fromPartial(object: Partial): QueryCFMMConcentratedPoolLinksResponse { + const message = createBaseQueryCFMMConcentratedPoolLinksResponse(); + message.migrationRecords = object.migrationRecords !== undefined && object.migrationRecords !== null ? MigrationRecords.fromPartial(object.migrationRecords) : undefined; + return message; + }, + fromAmino(object: QueryCFMMConcentratedPoolLinksResponseAmino): QueryCFMMConcentratedPoolLinksResponse { + const message = createBaseQueryCFMMConcentratedPoolLinksResponse(); + if (object.migration_records !== undefined && object.migration_records !== null) { + message.migrationRecords = MigrationRecords.fromAmino(object.migration_records); + } + return message; + }, + toAmino(message: QueryCFMMConcentratedPoolLinksResponse): QueryCFMMConcentratedPoolLinksResponseAmino { + const obj: any = {}; + obj.migration_records = message.migrationRecords ? MigrationRecords.toAmino(message.migrationRecords) : undefined; + return obj; + }, + fromAminoMsg(object: QueryCFMMConcentratedPoolLinksResponseAminoMsg): QueryCFMMConcentratedPoolLinksResponse { + return QueryCFMMConcentratedPoolLinksResponse.fromAmino(object.value); + }, + toAminoMsg(message: QueryCFMMConcentratedPoolLinksResponse): QueryCFMMConcentratedPoolLinksResponseAminoMsg { + return { + type: "osmosis/gamm/query-cfmm-concentrated-pool-links-response", + value: QueryCFMMConcentratedPoolLinksResponse.toAmino(message) + }; + }, + fromProtoMsg(message: QueryCFMMConcentratedPoolLinksResponseProtoMsg): QueryCFMMConcentratedPoolLinksResponse { + return QueryCFMMConcentratedPoolLinksResponse.decode(message.value); + }, + toProto(message: QueryCFMMConcentratedPoolLinksResponse): Uint8Array { + return QueryCFMMConcentratedPoolLinksResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryCFMMConcentratedPoolLinksResponse): QueryCFMMConcentratedPoolLinksResponseProtoMsg { + return { + typeUrl: "/osmosis.gamm.v1beta1.QueryCFMMConcentratedPoolLinksResponse", + value: QueryCFMMConcentratedPoolLinksResponse.encode(message).finish() + }; } }; -export const PoolI_ToAmino = (content: Any) => { - switch (content.typeUrl) { - case "/osmosis.concentratedliquidity.v1beta1.Pool": - return { - type: "osmosis/concentratedliquidity/pool", - value: Pool1.toAmino(Pool1.decode(content.value)) - }; - case "/osmosis.cosmwasmpool.v1beta1.CosmWasmPool": - return { - type: "osmosis/cosmwasmpool/cosm-wasm-pool", - value: CosmWasmPool.toAmino(CosmWasmPool.decode(content.value)) - }; - case "/osmosis.gamm.v1beta1.Pool": - return { - type: "osmosis/gamm/BalancerPool", - value: Pool2.toAmino(Pool2.decode(content.value)) - }; - case "/osmosis.gamm.poolmodels.stableswap.v1beta1.Pool": - return { - type: "osmosis/gamm/StableswapPool", - value: Pool3.toAmino(Pool3.decode(content.value)) - }; - default: - return Any.toAmino(content); - } -}; \ No newline at end of file +GlobalDecoderRegistry.register(QueryCFMMConcentratedPoolLinksResponse.typeUrl, QueryCFMMConcentratedPoolLinksResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryCFMMConcentratedPoolLinksResponse.aminoType, QueryCFMMConcentratedPoolLinksResponse.typeUrl); \ No newline at end of file diff --git a/packages/osmojs/src/codegen/osmosis/gamm/v1beta1/shared.ts b/packages/osmojs/src/codegen/osmosis/gamm/v1beta1/shared.ts index 006b80678..6d06444b2 100644 --- a/packages/osmojs/src/codegen/osmosis/gamm/v1beta1/shared.ts +++ b/packages/osmojs/src/codegen/osmosis/gamm/v1beta1/shared.ts @@ -1,4 +1,6 @@ import { BinaryReader, BinaryWriter } from "../../../binary"; +import { GlobalDecoderRegistry } from "../../../registry"; +import { isSet } from "../../../helpers"; /** * MigrationRecords contains all the links between balancer and concentrated * pools @@ -15,7 +17,7 @@ export interface MigrationRecordsProtoMsg { * pools */ export interface MigrationRecordsAmino { - balancer_to_concentrated_pool_links: BalancerToConcentratedPoolLinkAmino[]; + balancer_to_concentrated_pool_links?: BalancerToConcentratedPoolLinkAmino[]; } export interface MigrationRecordsAminoMsg { type: "osmosis/gamm/migration-records"; @@ -53,8 +55,8 @@ export interface BalancerToConcentratedPoolLinkProtoMsg { * be linked to a maximum of one balancer pool. */ export interface BalancerToConcentratedPoolLinkAmino { - balancer_pool_id: string; - cl_pool_id: string; + balancer_pool_id?: string; + cl_pool_id?: string; } export interface BalancerToConcentratedPoolLinkAminoMsg { type: "osmosis/gamm/balancer-to-concentrated-pool-link"; @@ -79,6 +81,16 @@ function createBaseMigrationRecords(): MigrationRecords { } export const MigrationRecords = { typeUrl: "/osmosis.gamm.v1beta1.MigrationRecords", + aminoType: "osmosis/gamm/migration-records", + is(o: any): o is MigrationRecords { + return o && (o.$typeUrl === MigrationRecords.typeUrl || Array.isArray(o.balancerToConcentratedPoolLinks) && (!o.balancerToConcentratedPoolLinks.length || BalancerToConcentratedPoolLink.is(o.balancerToConcentratedPoolLinks[0]))); + }, + isSDK(o: any): o is MigrationRecordsSDKType { + return o && (o.$typeUrl === MigrationRecords.typeUrl || Array.isArray(o.balancer_to_concentrated_pool_links) && (!o.balancer_to_concentrated_pool_links.length || BalancerToConcentratedPoolLink.isSDK(o.balancer_to_concentrated_pool_links[0]))); + }, + isAmino(o: any): o is MigrationRecordsAmino { + return o && (o.$typeUrl === MigrationRecords.typeUrl || Array.isArray(o.balancer_to_concentrated_pool_links) && (!o.balancer_to_concentrated_pool_links.length || BalancerToConcentratedPoolLink.isAmino(o.balancer_to_concentrated_pool_links[0]))); + }, encode(message: MigrationRecords, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.balancerToConcentratedPoolLinks) { BalancerToConcentratedPoolLink.encode(v!, writer.uint32(10).fork()).ldelim(); @@ -102,15 +114,29 @@ export const MigrationRecords = { } return message; }, + fromJSON(object: any): MigrationRecords { + return { + balancerToConcentratedPoolLinks: Array.isArray(object?.balancerToConcentratedPoolLinks) ? object.balancerToConcentratedPoolLinks.map((e: any) => BalancerToConcentratedPoolLink.fromJSON(e)) : [] + }; + }, + toJSON(message: MigrationRecords): unknown { + const obj: any = {}; + if (message.balancerToConcentratedPoolLinks) { + obj.balancerToConcentratedPoolLinks = message.balancerToConcentratedPoolLinks.map(e => e ? BalancerToConcentratedPoolLink.toJSON(e) : undefined); + } else { + obj.balancerToConcentratedPoolLinks = []; + } + return obj; + }, fromPartial(object: Partial): MigrationRecords { const message = createBaseMigrationRecords(); message.balancerToConcentratedPoolLinks = object.balancerToConcentratedPoolLinks?.map(e => BalancerToConcentratedPoolLink.fromPartial(e)) || []; return message; }, fromAmino(object: MigrationRecordsAmino): MigrationRecords { - return { - balancerToConcentratedPoolLinks: Array.isArray(object?.balancer_to_concentrated_pool_links) ? object.balancer_to_concentrated_pool_links.map((e: any) => BalancerToConcentratedPoolLink.fromAmino(e)) : [] - }; + const message = createBaseMigrationRecords(); + message.balancerToConcentratedPoolLinks = object.balancer_to_concentrated_pool_links?.map(e => BalancerToConcentratedPoolLink.fromAmino(e)) || []; + return message; }, toAmino(message: MigrationRecords): MigrationRecordsAmino { const obj: any = {}; @@ -143,6 +169,8 @@ export const MigrationRecords = { }; } }; +GlobalDecoderRegistry.register(MigrationRecords.typeUrl, MigrationRecords); +GlobalDecoderRegistry.registerAminoProtoMapping(MigrationRecords.aminoType, MigrationRecords.typeUrl); function createBaseBalancerToConcentratedPoolLink(): BalancerToConcentratedPoolLink { return { balancerPoolId: BigInt(0), @@ -151,6 +179,16 @@ function createBaseBalancerToConcentratedPoolLink(): BalancerToConcentratedPoolL } export const BalancerToConcentratedPoolLink = { typeUrl: "/osmosis.gamm.v1beta1.BalancerToConcentratedPoolLink", + aminoType: "osmosis/gamm/balancer-to-concentrated-pool-link", + is(o: any): o is BalancerToConcentratedPoolLink { + return o && (o.$typeUrl === BalancerToConcentratedPoolLink.typeUrl || typeof o.balancerPoolId === "bigint" && typeof o.clPoolId === "bigint"); + }, + isSDK(o: any): o is BalancerToConcentratedPoolLinkSDKType { + return o && (o.$typeUrl === BalancerToConcentratedPoolLink.typeUrl || typeof o.balancer_pool_id === "bigint" && typeof o.cl_pool_id === "bigint"); + }, + isAmino(o: any): o is BalancerToConcentratedPoolLinkAmino { + return o && (o.$typeUrl === BalancerToConcentratedPoolLink.typeUrl || typeof o.balancer_pool_id === "bigint" && typeof o.cl_pool_id === "bigint"); + }, encode(message: BalancerToConcentratedPoolLink, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.balancerPoolId !== BigInt(0)) { writer.uint32(8).uint64(message.balancerPoolId); @@ -180,6 +218,18 @@ export const BalancerToConcentratedPoolLink = { } return message; }, + fromJSON(object: any): BalancerToConcentratedPoolLink { + return { + balancerPoolId: isSet(object.balancerPoolId) ? BigInt(object.balancerPoolId.toString()) : BigInt(0), + clPoolId: isSet(object.clPoolId) ? BigInt(object.clPoolId.toString()) : BigInt(0) + }; + }, + toJSON(message: BalancerToConcentratedPoolLink): unknown { + const obj: any = {}; + message.balancerPoolId !== undefined && (obj.balancerPoolId = (message.balancerPoolId || BigInt(0)).toString()); + message.clPoolId !== undefined && (obj.clPoolId = (message.clPoolId || BigInt(0)).toString()); + return obj; + }, fromPartial(object: Partial): BalancerToConcentratedPoolLink { const message = createBaseBalancerToConcentratedPoolLink(); message.balancerPoolId = object.balancerPoolId !== undefined && object.balancerPoolId !== null ? BigInt(object.balancerPoolId.toString()) : BigInt(0); @@ -187,10 +237,14 @@ export const BalancerToConcentratedPoolLink = { return message; }, fromAmino(object: BalancerToConcentratedPoolLinkAmino): BalancerToConcentratedPoolLink { - return { - balancerPoolId: BigInt(object.balancer_pool_id), - clPoolId: BigInt(object.cl_pool_id) - }; + const message = createBaseBalancerToConcentratedPoolLink(); + if (object.balancer_pool_id !== undefined && object.balancer_pool_id !== null) { + message.balancerPoolId = BigInt(object.balancer_pool_id); + } + if (object.cl_pool_id !== undefined && object.cl_pool_id !== null) { + message.clPoolId = BigInt(object.cl_pool_id); + } + return message; }, toAmino(message: BalancerToConcentratedPoolLink): BalancerToConcentratedPoolLinkAmino { const obj: any = {}; @@ -219,4 +273,6 @@ export const BalancerToConcentratedPoolLink = { value: BalancerToConcentratedPoolLink.encode(message).finish() }; } -}; \ No newline at end of file +}; +GlobalDecoderRegistry.register(BalancerToConcentratedPoolLink.typeUrl, BalancerToConcentratedPoolLink); +GlobalDecoderRegistry.registerAminoProtoMapping(BalancerToConcentratedPoolLink.aminoType, BalancerToConcentratedPoolLink.typeUrl); \ No newline at end of file diff --git a/packages/osmojs/src/codegen/osmosis/gamm/v1beta1/tx.registry.ts b/packages/osmojs/src/codegen/osmosis/gamm/v1beta1/tx.registry.ts index 0eb3af476..e5919b855 100644 --- a/packages/osmojs/src/codegen/osmosis/gamm/v1beta1/tx.registry.ts +++ b/packages/osmojs/src/codegen/osmosis/gamm/v1beta1/tx.registry.ts @@ -108,6 +108,106 @@ export const MessageComposer = { }; } }, + toJSON: { + joinPool(value: MsgJoinPool) { + return { + typeUrl: "/osmosis.gamm.v1beta1.MsgJoinPool", + value: MsgJoinPool.toJSON(value) + }; + }, + exitPool(value: MsgExitPool) { + return { + typeUrl: "/osmosis.gamm.v1beta1.MsgExitPool", + value: MsgExitPool.toJSON(value) + }; + }, + swapExactAmountIn(value: MsgSwapExactAmountIn) { + return { + typeUrl: "/osmosis.gamm.v1beta1.MsgSwapExactAmountIn", + value: MsgSwapExactAmountIn.toJSON(value) + }; + }, + swapExactAmountOut(value: MsgSwapExactAmountOut) { + return { + typeUrl: "/osmosis.gamm.v1beta1.MsgSwapExactAmountOut", + value: MsgSwapExactAmountOut.toJSON(value) + }; + }, + joinSwapExternAmountIn(value: MsgJoinSwapExternAmountIn) { + return { + typeUrl: "/osmosis.gamm.v1beta1.MsgJoinSwapExternAmountIn", + value: MsgJoinSwapExternAmountIn.toJSON(value) + }; + }, + joinSwapShareAmountOut(value: MsgJoinSwapShareAmountOut) { + return { + typeUrl: "/osmosis.gamm.v1beta1.MsgJoinSwapShareAmountOut", + value: MsgJoinSwapShareAmountOut.toJSON(value) + }; + }, + exitSwapExternAmountOut(value: MsgExitSwapExternAmountOut) { + return { + typeUrl: "/osmosis.gamm.v1beta1.MsgExitSwapExternAmountOut", + value: MsgExitSwapExternAmountOut.toJSON(value) + }; + }, + exitSwapShareAmountIn(value: MsgExitSwapShareAmountIn) { + return { + typeUrl: "/osmosis.gamm.v1beta1.MsgExitSwapShareAmountIn", + value: MsgExitSwapShareAmountIn.toJSON(value) + }; + } + }, + fromJSON: { + joinPool(value: any) { + return { + typeUrl: "/osmosis.gamm.v1beta1.MsgJoinPool", + value: MsgJoinPool.fromJSON(value) + }; + }, + exitPool(value: any) { + return { + typeUrl: "/osmosis.gamm.v1beta1.MsgExitPool", + value: MsgExitPool.fromJSON(value) + }; + }, + swapExactAmountIn(value: any) { + return { + typeUrl: "/osmosis.gamm.v1beta1.MsgSwapExactAmountIn", + value: MsgSwapExactAmountIn.fromJSON(value) + }; + }, + swapExactAmountOut(value: any) { + return { + typeUrl: "/osmosis.gamm.v1beta1.MsgSwapExactAmountOut", + value: MsgSwapExactAmountOut.fromJSON(value) + }; + }, + joinSwapExternAmountIn(value: any) { + return { + typeUrl: "/osmosis.gamm.v1beta1.MsgJoinSwapExternAmountIn", + value: MsgJoinSwapExternAmountIn.fromJSON(value) + }; + }, + joinSwapShareAmountOut(value: any) { + return { + typeUrl: "/osmosis.gamm.v1beta1.MsgJoinSwapShareAmountOut", + value: MsgJoinSwapShareAmountOut.fromJSON(value) + }; + }, + exitSwapExternAmountOut(value: any) { + return { + typeUrl: "/osmosis.gamm.v1beta1.MsgExitSwapExternAmountOut", + value: MsgExitSwapExternAmountOut.fromJSON(value) + }; + }, + exitSwapShareAmountIn(value: any) { + return { + typeUrl: "/osmosis.gamm.v1beta1.MsgExitSwapShareAmountIn", + value: MsgExitSwapShareAmountIn.fromJSON(value) + }; + } + }, fromPartial: { joinPool(value: MsgJoinPool) { return { diff --git a/packages/osmojs/src/codegen/osmosis/gamm/v1beta1/tx.rpc.msg.ts b/packages/osmojs/src/codegen/osmosis/gamm/v1beta1/tx.rpc.msg.ts index f4dc977b5..c2a0b812b 100644 --- a/packages/osmojs/src/codegen/osmosis/gamm/v1beta1/tx.rpc.msg.ts +++ b/packages/osmojs/src/codegen/osmosis/gamm/v1beta1/tx.rpc.msg.ts @@ -64,4 +64,7 @@ export class MsgClientImpl implements Msg { const promise = this.rpc.request("osmosis.gamm.v1beta1.Msg", "ExitSwapShareAmountIn", data); return promise.then(data => MsgExitSwapShareAmountInResponse.decode(new BinaryReader(data))); } -} \ No newline at end of file +} +export const createClientImpl = (rpc: Rpc) => { + return new MsgClientImpl(rpc); +}; \ No newline at end of file diff --git a/packages/osmojs/src/codegen/osmosis/gamm/v1beta1/tx.ts b/packages/osmojs/src/codegen/osmosis/gamm/v1beta1/tx.ts index d0a7d7f90..cb88b85f2 100644 --- a/packages/osmojs/src/codegen/osmosis/gamm/v1beta1/tx.ts +++ b/packages/osmojs/src/codegen/osmosis/gamm/v1beta1/tx.ts @@ -1,6 +1,8 @@ import { Coin, CoinAmino, CoinSDKType } from "../../../cosmos/base/v1beta1/coin"; import { SwapAmountInRoute, SwapAmountInRouteAmino, SwapAmountInRouteSDKType, SwapAmountOutRoute, SwapAmountOutRouteAmino, SwapAmountOutRouteSDKType } from "../../poolmanager/v1beta1/swap_route"; import { BinaryReader, BinaryWriter } from "../../../binary"; +import { isSet } from "../../../helpers"; +import { GlobalDecoderRegistry } from "../../../registry"; /** * ===================== MsgJoinPool * This is really MsgJoinPoolNoSwap @@ -20,10 +22,10 @@ export interface MsgJoinPoolProtoMsg { * This is really MsgJoinPoolNoSwap */ export interface MsgJoinPoolAmino { - sender: string; - pool_id: string; - share_out_amount: string; - token_in_maxs: CoinAmino[]; + sender?: string; + pool_id?: string; + share_out_amount?: string; + token_in_maxs?: CoinAmino[]; } export interface MsgJoinPoolAminoMsg { type: "osmosis/gamm/join-pool"; @@ -48,8 +50,8 @@ export interface MsgJoinPoolResponseProtoMsg { value: Uint8Array; } export interface MsgJoinPoolResponseAmino { - share_out_amount: string; - token_in: CoinAmino[]; + share_out_amount?: string; + token_in?: CoinAmino[]; } export interface MsgJoinPoolResponseAminoMsg { type: "osmosis/gamm/join-pool-response"; @@ -72,10 +74,10 @@ export interface MsgExitPoolProtoMsg { } /** ===================== MsgExitPool */ export interface MsgExitPoolAmino { - sender: string; - pool_id: string; - share_in_amount: string; - token_out_mins: CoinAmino[]; + sender?: string; + pool_id?: string; + share_in_amount?: string; + token_out_mins?: CoinAmino[]; } export interface MsgExitPoolAminoMsg { type: "osmosis/gamm/exit-pool"; @@ -96,7 +98,7 @@ export interface MsgExitPoolResponseProtoMsg { value: Uint8Array; } export interface MsgExitPoolResponseAmino { - token_out: CoinAmino[]; + token_out?: CoinAmino[]; } export interface MsgExitPoolResponseAminoMsg { type: "osmosis/gamm/exit-pool-response"; @@ -118,10 +120,10 @@ export interface MsgSwapExactAmountInProtoMsg { } /** ===================== MsgSwapExactAmountIn */ export interface MsgSwapExactAmountInAmino { - sender: string; - routes: SwapAmountInRouteAmino[]; + sender?: string; + routes?: SwapAmountInRouteAmino[]; token_in?: CoinAmino; - token_out_min_amount: string; + token_out_min_amount?: string; } export interface MsgSwapExactAmountInAminoMsg { type: "osmosis/gamm/swap-exact-amount-in"; @@ -142,7 +144,7 @@ export interface MsgSwapExactAmountInResponseProtoMsg { value: Uint8Array; } export interface MsgSwapExactAmountInResponseAmino { - token_out_amount: string; + token_out_amount?: string; } export interface MsgSwapExactAmountInResponseAminoMsg { type: "osmosis/gamm/swap-exact-amount-in-response"; @@ -162,9 +164,9 @@ export interface MsgSwapExactAmountOutProtoMsg { value: Uint8Array; } export interface MsgSwapExactAmountOutAmino { - sender: string; - routes: SwapAmountOutRouteAmino[]; - token_in_max_amount: string; + sender?: string; + routes?: SwapAmountOutRouteAmino[]; + token_in_max_amount?: string; token_out?: CoinAmino; } export interface MsgSwapExactAmountOutAminoMsg { @@ -185,7 +187,7 @@ export interface MsgSwapExactAmountOutResponseProtoMsg { value: Uint8Array; } export interface MsgSwapExactAmountOutResponseAmino { - token_in_amount: string; + token_in_amount?: string; } export interface MsgSwapExactAmountOutResponseAminoMsg { type: "osmosis/gamm/swap-exact-amount-out-response"; @@ -213,10 +215,10 @@ export interface MsgJoinSwapExternAmountInProtoMsg { * TODO: Rename to MsgJoinSwapExactAmountIn */ export interface MsgJoinSwapExternAmountInAmino { - sender: string; - pool_id: string; + sender?: string; + pool_id?: string; token_in?: CoinAmino; - share_out_min_amount: string; + share_out_min_amount?: string; } export interface MsgJoinSwapExternAmountInAminoMsg { type: "osmosis/gamm/join-swap-extern-amount-in"; @@ -240,7 +242,7 @@ export interface MsgJoinSwapExternAmountInResponseProtoMsg { value: Uint8Array; } export interface MsgJoinSwapExternAmountInResponseAmino { - share_out_amount: string; + share_out_amount?: string; } export interface MsgJoinSwapExternAmountInResponseAminoMsg { type: "osmosis/gamm/join-swap-extern-amount-in-response"; @@ -263,11 +265,11 @@ export interface MsgJoinSwapShareAmountOutProtoMsg { } /** ===================== MsgJoinSwapShareAmountOut */ export interface MsgJoinSwapShareAmountOutAmino { - sender: string; - pool_id: string; - token_in_denom: string; - share_out_amount: string; - token_in_max_amount: string; + sender?: string; + pool_id?: string; + token_in_denom?: string; + share_out_amount?: string; + token_in_max_amount?: string; } export interface MsgJoinSwapShareAmountOutAminoMsg { type: "osmosis/gamm/join-swap-share-amount-out"; @@ -289,7 +291,7 @@ export interface MsgJoinSwapShareAmountOutResponseProtoMsg { value: Uint8Array; } export interface MsgJoinSwapShareAmountOutResponseAmino { - token_in_amount: string; + token_in_amount?: string; } export interface MsgJoinSwapShareAmountOutResponseAminoMsg { type: "osmosis/gamm/join-swap-share-amount-out-response"; @@ -312,11 +314,11 @@ export interface MsgExitSwapShareAmountInProtoMsg { } /** ===================== MsgExitSwapShareAmountIn */ export interface MsgExitSwapShareAmountInAmino { - sender: string; - pool_id: string; - token_out_denom: string; - share_in_amount: string; - token_out_min_amount: string; + sender?: string; + pool_id?: string; + token_out_denom?: string; + share_in_amount?: string; + token_out_min_amount?: string; } export interface MsgExitSwapShareAmountInAminoMsg { type: "osmosis/gamm/exit-swap-share-amount-in"; @@ -338,7 +340,7 @@ export interface MsgExitSwapShareAmountInResponseProtoMsg { value: Uint8Array; } export interface MsgExitSwapShareAmountInResponseAmino { - token_out_amount: string; + token_out_amount?: string; } export interface MsgExitSwapShareAmountInResponseAminoMsg { type: "osmosis/gamm/exit-swap-share-amount-in-response"; @@ -360,10 +362,10 @@ export interface MsgExitSwapExternAmountOutProtoMsg { } /** ===================== MsgExitSwapExternAmountOut */ export interface MsgExitSwapExternAmountOutAmino { - sender: string; - pool_id: string; + sender?: string; + pool_id?: string; token_out?: CoinAmino; - share_in_max_amount: string; + share_in_max_amount?: string; } export interface MsgExitSwapExternAmountOutAminoMsg { type: "osmosis/gamm/exit-swap-extern-amount-out"; @@ -384,7 +386,7 @@ export interface MsgExitSwapExternAmountOutResponseProtoMsg { value: Uint8Array; } export interface MsgExitSwapExternAmountOutResponseAmino { - share_in_amount: string; + share_in_amount?: string; } export interface MsgExitSwapExternAmountOutResponseAminoMsg { type: "osmosis/gamm/exit-swap-extern-amount-out-response"; @@ -403,6 +405,16 @@ function createBaseMsgJoinPool(): MsgJoinPool { } export const MsgJoinPool = { typeUrl: "/osmosis.gamm.v1beta1.MsgJoinPool", + aminoType: "osmosis/gamm/join-pool", + is(o: any): o is MsgJoinPool { + return o && (o.$typeUrl === MsgJoinPool.typeUrl || typeof o.sender === "string" && typeof o.poolId === "bigint" && typeof o.shareOutAmount === "string" && Array.isArray(o.tokenInMaxs) && (!o.tokenInMaxs.length || Coin.is(o.tokenInMaxs[0]))); + }, + isSDK(o: any): o is MsgJoinPoolSDKType { + return o && (o.$typeUrl === MsgJoinPool.typeUrl || typeof o.sender === "string" && typeof o.pool_id === "bigint" && typeof o.share_out_amount === "string" && Array.isArray(o.token_in_maxs) && (!o.token_in_maxs.length || Coin.isSDK(o.token_in_maxs[0]))); + }, + isAmino(o: any): o is MsgJoinPoolAmino { + return o && (o.$typeUrl === MsgJoinPool.typeUrl || typeof o.sender === "string" && typeof o.pool_id === "bigint" && typeof o.share_out_amount === "string" && Array.isArray(o.token_in_maxs) && (!o.token_in_maxs.length || Coin.isAmino(o.token_in_maxs[0]))); + }, encode(message: MsgJoinPool, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.sender !== "") { writer.uint32(10).string(message.sender); @@ -444,6 +456,26 @@ export const MsgJoinPool = { } return message; }, + fromJSON(object: any): MsgJoinPool { + return { + sender: isSet(object.sender) ? String(object.sender) : "", + poolId: isSet(object.poolId) ? BigInt(object.poolId.toString()) : BigInt(0), + shareOutAmount: isSet(object.shareOutAmount) ? String(object.shareOutAmount) : "", + tokenInMaxs: Array.isArray(object?.tokenInMaxs) ? object.tokenInMaxs.map((e: any) => Coin.fromJSON(e)) : [] + }; + }, + toJSON(message: MsgJoinPool): unknown { + const obj: any = {}; + message.sender !== undefined && (obj.sender = message.sender); + message.poolId !== undefined && (obj.poolId = (message.poolId || BigInt(0)).toString()); + message.shareOutAmount !== undefined && (obj.shareOutAmount = message.shareOutAmount); + if (message.tokenInMaxs) { + obj.tokenInMaxs = message.tokenInMaxs.map(e => e ? Coin.toJSON(e) : undefined); + } else { + obj.tokenInMaxs = []; + } + return obj; + }, fromPartial(object: Partial): MsgJoinPool { const message = createBaseMsgJoinPool(); message.sender = object.sender ?? ""; @@ -453,12 +485,18 @@ export const MsgJoinPool = { return message; }, fromAmino(object: MsgJoinPoolAmino): MsgJoinPool { - return { - sender: object.sender, - poolId: BigInt(object.pool_id), - shareOutAmount: object.share_out_amount, - tokenInMaxs: Array.isArray(object?.token_in_maxs) ? object.token_in_maxs.map((e: any) => Coin.fromAmino(e)) : [] - }; + const message = createBaseMsgJoinPool(); + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + if (object.pool_id !== undefined && object.pool_id !== null) { + message.poolId = BigInt(object.pool_id); + } + if (object.share_out_amount !== undefined && object.share_out_amount !== null) { + message.shareOutAmount = object.share_out_amount; + } + message.tokenInMaxs = object.token_in_maxs?.map(e => Coin.fromAmino(e)) || []; + return message; }, toAmino(message: MsgJoinPool): MsgJoinPoolAmino { const obj: any = {}; @@ -494,6 +532,8 @@ export const MsgJoinPool = { }; } }; +GlobalDecoderRegistry.register(MsgJoinPool.typeUrl, MsgJoinPool); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgJoinPool.aminoType, MsgJoinPool.typeUrl); function createBaseMsgJoinPoolResponse(): MsgJoinPoolResponse { return { shareOutAmount: "", @@ -502,6 +542,16 @@ function createBaseMsgJoinPoolResponse(): MsgJoinPoolResponse { } export const MsgJoinPoolResponse = { typeUrl: "/osmosis.gamm.v1beta1.MsgJoinPoolResponse", + aminoType: "osmosis/gamm/join-pool-response", + is(o: any): o is MsgJoinPoolResponse { + return o && (o.$typeUrl === MsgJoinPoolResponse.typeUrl || typeof o.shareOutAmount === "string" && Array.isArray(o.tokenIn) && (!o.tokenIn.length || Coin.is(o.tokenIn[0]))); + }, + isSDK(o: any): o is MsgJoinPoolResponseSDKType { + return o && (o.$typeUrl === MsgJoinPoolResponse.typeUrl || typeof o.share_out_amount === "string" && Array.isArray(o.token_in) && (!o.token_in.length || Coin.isSDK(o.token_in[0]))); + }, + isAmino(o: any): o is MsgJoinPoolResponseAmino { + return o && (o.$typeUrl === MsgJoinPoolResponse.typeUrl || typeof o.share_out_amount === "string" && Array.isArray(o.token_in) && (!o.token_in.length || Coin.isAmino(o.token_in[0]))); + }, encode(message: MsgJoinPoolResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.shareOutAmount !== "") { writer.uint32(10).string(message.shareOutAmount); @@ -531,6 +581,22 @@ export const MsgJoinPoolResponse = { } return message; }, + fromJSON(object: any): MsgJoinPoolResponse { + return { + shareOutAmount: isSet(object.shareOutAmount) ? String(object.shareOutAmount) : "", + tokenIn: Array.isArray(object?.tokenIn) ? object.tokenIn.map((e: any) => Coin.fromJSON(e)) : [] + }; + }, + toJSON(message: MsgJoinPoolResponse): unknown { + const obj: any = {}; + message.shareOutAmount !== undefined && (obj.shareOutAmount = message.shareOutAmount); + if (message.tokenIn) { + obj.tokenIn = message.tokenIn.map(e => e ? Coin.toJSON(e) : undefined); + } else { + obj.tokenIn = []; + } + return obj; + }, fromPartial(object: Partial): MsgJoinPoolResponse { const message = createBaseMsgJoinPoolResponse(); message.shareOutAmount = object.shareOutAmount ?? ""; @@ -538,10 +604,12 @@ export const MsgJoinPoolResponse = { return message; }, fromAmino(object: MsgJoinPoolResponseAmino): MsgJoinPoolResponse { - return { - shareOutAmount: object.share_out_amount, - tokenIn: Array.isArray(object?.token_in) ? object.token_in.map((e: any) => Coin.fromAmino(e)) : [] - }; + const message = createBaseMsgJoinPoolResponse(); + if (object.share_out_amount !== undefined && object.share_out_amount !== null) { + message.shareOutAmount = object.share_out_amount; + } + message.tokenIn = object.token_in?.map(e => Coin.fromAmino(e)) || []; + return message; }, toAmino(message: MsgJoinPoolResponse): MsgJoinPoolResponseAmino { const obj: any = {}; @@ -575,6 +643,8 @@ export const MsgJoinPoolResponse = { }; } }; +GlobalDecoderRegistry.register(MsgJoinPoolResponse.typeUrl, MsgJoinPoolResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgJoinPoolResponse.aminoType, MsgJoinPoolResponse.typeUrl); function createBaseMsgExitPool(): MsgExitPool { return { sender: "", @@ -585,6 +655,16 @@ function createBaseMsgExitPool(): MsgExitPool { } export const MsgExitPool = { typeUrl: "/osmosis.gamm.v1beta1.MsgExitPool", + aminoType: "osmosis/gamm/exit-pool", + is(o: any): o is MsgExitPool { + return o && (o.$typeUrl === MsgExitPool.typeUrl || typeof o.sender === "string" && typeof o.poolId === "bigint" && typeof o.shareInAmount === "string" && Array.isArray(o.tokenOutMins) && (!o.tokenOutMins.length || Coin.is(o.tokenOutMins[0]))); + }, + isSDK(o: any): o is MsgExitPoolSDKType { + return o && (o.$typeUrl === MsgExitPool.typeUrl || typeof o.sender === "string" && typeof o.pool_id === "bigint" && typeof o.share_in_amount === "string" && Array.isArray(o.token_out_mins) && (!o.token_out_mins.length || Coin.isSDK(o.token_out_mins[0]))); + }, + isAmino(o: any): o is MsgExitPoolAmino { + return o && (o.$typeUrl === MsgExitPool.typeUrl || typeof o.sender === "string" && typeof o.pool_id === "bigint" && typeof o.share_in_amount === "string" && Array.isArray(o.token_out_mins) && (!o.token_out_mins.length || Coin.isAmino(o.token_out_mins[0]))); + }, encode(message: MsgExitPool, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.sender !== "") { writer.uint32(10).string(message.sender); @@ -626,6 +706,26 @@ export const MsgExitPool = { } return message; }, + fromJSON(object: any): MsgExitPool { + return { + sender: isSet(object.sender) ? String(object.sender) : "", + poolId: isSet(object.poolId) ? BigInt(object.poolId.toString()) : BigInt(0), + shareInAmount: isSet(object.shareInAmount) ? String(object.shareInAmount) : "", + tokenOutMins: Array.isArray(object?.tokenOutMins) ? object.tokenOutMins.map((e: any) => Coin.fromJSON(e)) : [] + }; + }, + toJSON(message: MsgExitPool): unknown { + const obj: any = {}; + message.sender !== undefined && (obj.sender = message.sender); + message.poolId !== undefined && (obj.poolId = (message.poolId || BigInt(0)).toString()); + message.shareInAmount !== undefined && (obj.shareInAmount = message.shareInAmount); + if (message.tokenOutMins) { + obj.tokenOutMins = message.tokenOutMins.map(e => e ? Coin.toJSON(e) : undefined); + } else { + obj.tokenOutMins = []; + } + return obj; + }, fromPartial(object: Partial): MsgExitPool { const message = createBaseMsgExitPool(); message.sender = object.sender ?? ""; @@ -635,12 +735,18 @@ export const MsgExitPool = { return message; }, fromAmino(object: MsgExitPoolAmino): MsgExitPool { - return { - sender: object.sender, - poolId: BigInt(object.pool_id), - shareInAmount: object.share_in_amount, - tokenOutMins: Array.isArray(object?.token_out_mins) ? object.token_out_mins.map((e: any) => Coin.fromAmino(e)) : [] - }; + const message = createBaseMsgExitPool(); + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + if (object.pool_id !== undefined && object.pool_id !== null) { + message.poolId = BigInt(object.pool_id); + } + if (object.share_in_amount !== undefined && object.share_in_amount !== null) { + message.shareInAmount = object.share_in_amount; + } + message.tokenOutMins = object.token_out_mins?.map(e => Coin.fromAmino(e)) || []; + return message; }, toAmino(message: MsgExitPool): MsgExitPoolAmino { const obj: any = {}; @@ -676,6 +782,8 @@ export const MsgExitPool = { }; } }; +GlobalDecoderRegistry.register(MsgExitPool.typeUrl, MsgExitPool); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgExitPool.aminoType, MsgExitPool.typeUrl); function createBaseMsgExitPoolResponse(): MsgExitPoolResponse { return { tokenOut: [] @@ -683,6 +791,16 @@ function createBaseMsgExitPoolResponse(): MsgExitPoolResponse { } export const MsgExitPoolResponse = { typeUrl: "/osmosis.gamm.v1beta1.MsgExitPoolResponse", + aminoType: "osmosis/gamm/exit-pool-response", + is(o: any): o is MsgExitPoolResponse { + return o && (o.$typeUrl === MsgExitPoolResponse.typeUrl || Array.isArray(o.tokenOut) && (!o.tokenOut.length || Coin.is(o.tokenOut[0]))); + }, + isSDK(o: any): o is MsgExitPoolResponseSDKType { + return o && (o.$typeUrl === MsgExitPoolResponse.typeUrl || Array.isArray(o.token_out) && (!o.token_out.length || Coin.isSDK(o.token_out[0]))); + }, + isAmino(o: any): o is MsgExitPoolResponseAmino { + return o && (o.$typeUrl === MsgExitPoolResponse.typeUrl || Array.isArray(o.token_out) && (!o.token_out.length || Coin.isAmino(o.token_out[0]))); + }, encode(message: MsgExitPoolResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.tokenOut) { Coin.encode(v!, writer.uint32(10).fork()).ldelim(); @@ -706,15 +824,29 @@ export const MsgExitPoolResponse = { } return message; }, + fromJSON(object: any): MsgExitPoolResponse { + return { + tokenOut: Array.isArray(object?.tokenOut) ? object.tokenOut.map((e: any) => Coin.fromJSON(e)) : [] + }; + }, + toJSON(message: MsgExitPoolResponse): unknown { + const obj: any = {}; + if (message.tokenOut) { + obj.tokenOut = message.tokenOut.map(e => e ? Coin.toJSON(e) : undefined); + } else { + obj.tokenOut = []; + } + return obj; + }, fromPartial(object: Partial): MsgExitPoolResponse { const message = createBaseMsgExitPoolResponse(); message.tokenOut = object.tokenOut?.map(e => Coin.fromPartial(e)) || []; return message; }, fromAmino(object: MsgExitPoolResponseAmino): MsgExitPoolResponse { - return { - tokenOut: Array.isArray(object?.token_out) ? object.token_out.map((e: any) => Coin.fromAmino(e)) : [] - }; + const message = createBaseMsgExitPoolResponse(); + message.tokenOut = object.token_out?.map(e => Coin.fromAmino(e)) || []; + return message; }, toAmino(message: MsgExitPoolResponse): MsgExitPoolResponseAmino { const obj: any = {}; @@ -747,16 +879,28 @@ export const MsgExitPoolResponse = { }; } }; +GlobalDecoderRegistry.register(MsgExitPoolResponse.typeUrl, MsgExitPoolResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgExitPoolResponse.aminoType, MsgExitPoolResponse.typeUrl); function createBaseMsgSwapExactAmountIn(): MsgSwapExactAmountIn { return { sender: "", routes: [], - tokenIn: undefined, + tokenIn: Coin.fromPartial({}), tokenOutMinAmount: "" }; } export const MsgSwapExactAmountIn = { typeUrl: "/osmosis.gamm.v1beta1.MsgSwapExactAmountIn", + aminoType: "osmosis/gamm/swap-exact-amount-in", + is(o: any): o is MsgSwapExactAmountIn { + return o && (o.$typeUrl === MsgSwapExactAmountIn.typeUrl || typeof o.sender === "string" && Array.isArray(o.routes) && (!o.routes.length || SwapAmountInRoute.is(o.routes[0])) && Coin.is(o.tokenIn) && typeof o.tokenOutMinAmount === "string"); + }, + isSDK(o: any): o is MsgSwapExactAmountInSDKType { + return o && (o.$typeUrl === MsgSwapExactAmountIn.typeUrl || typeof o.sender === "string" && Array.isArray(o.routes) && (!o.routes.length || SwapAmountInRoute.isSDK(o.routes[0])) && Coin.isSDK(o.token_in) && typeof o.token_out_min_amount === "string"); + }, + isAmino(o: any): o is MsgSwapExactAmountInAmino { + return o && (o.$typeUrl === MsgSwapExactAmountIn.typeUrl || typeof o.sender === "string" && Array.isArray(o.routes) && (!o.routes.length || SwapAmountInRoute.isAmino(o.routes[0])) && Coin.isAmino(o.token_in) && typeof o.token_out_min_amount === "string"); + }, encode(message: MsgSwapExactAmountIn, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.sender !== "") { writer.uint32(10).string(message.sender); @@ -798,6 +942,26 @@ export const MsgSwapExactAmountIn = { } return message; }, + fromJSON(object: any): MsgSwapExactAmountIn { + return { + sender: isSet(object.sender) ? String(object.sender) : "", + routes: Array.isArray(object?.routes) ? object.routes.map((e: any) => SwapAmountInRoute.fromJSON(e)) : [], + tokenIn: isSet(object.tokenIn) ? Coin.fromJSON(object.tokenIn) : undefined, + tokenOutMinAmount: isSet(object.tokenOutMinAmount) ? String(object.tokenOutMinAmount) : "" + }; + }, + toJSON(message: MsgSwapExactAmountIn): unknown { + const obj: any = {}; + message.sender !== undefined && (obj.sender = message.sender); + if (message.routes) { + obj.routes = message.routes.map(e => e ? SwapAmountInRoute.toJSON(e) : undefined); + } else { + obj.routes = []; + } + message.tokenIn !== undefined && (obj.tokenIn = message.tokenIn ? Coin.toJSON(message.tokenIn) : undefined); + message.tokenOutMinAmount !== undefined && (obj.tokenOutMinAmount = message.tokenOutMinAmount); + return obj; + }, fromPartial(object: Partial): MsgSwapExactAmountIn { const message = createBaseMsgSwapExactAmountIn(); message.sender = object.sender ?? ""; @@ -807,12 +971,18 @@ export const MsgSwapExactAmountIn = { return message; }, fromAmino(object: MsgSwapExactAmountInAmino): MsgSwapExactAmountIn { - return { - sender: object.sender, - routes: Array.isArray(object?.routes) ? object.routes.map((e: any) => SwapAmountInRoute.fromAmino(e)) : [], - tokenIn: object?.token_in ? Coin.fromAmino(object.token_in) : undefined, - tokenOutMinAmount: object.token_out_min_amount - }; + const message = createBaseMsgSwapExactAmountIn(); + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + message.routes = object.routes?.map(e => SwapAmountInRoute.fromAmino(e)) || []; + if (object.token_in !== undefined && object.token_in !== null) { + message.tokenIn = Coin.fromAmino(object.token_in); + } + if (object.token_out_min_amount !== undefined && object.token_out_min_amount !== null) { + message.tokenOutMinAmount = object.token_out_min_amount; + } + return message; }, toAmino(message: MsgSwapExactAmountIn): MsgSwapExactAmountInAmino { const obj: any = {}; @@ -848,6 +1018,8 @@ export const MsgSwapExactAmountIn = { }; } }; +GlobalDecoderRegistry.register(MsgSwapExactAmountIn.typeUrl, MsgSwapExactAmountIn); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgSwapExactAmountIn.aminoType, MsgSwapExactAmountIn.typeUrl); function createBaseMsgSwapExactAmountInResponse(): MsgSwapExactAmountInResponse { return { tokenOutAmount: "" @@ -855,6 +1027,16 @@ function createBaseMsgSwapExactAmountInResponse(): MsgSwapExactAmountInResponse } export const MsgSwapExactAmountInResponse = { typeUrl: "/osmosis.gamm.v1beta1.MsgSwapExactAmountInResponse", + aminoType: "osmosis/gamm/swap-exact-amount-in-response", + is(o: any): o is MsgSwapExactAmountInResponse { + return o && (o.$typeUrl === MsgSwapExactAmountInResponse.typeUrl || typeof o.tokenOutAmount === "string"); + }, + isSDK(o: any): o is MsgSwapExactAmountInResponseSDKType { + return o && (o.$typeUrl === MsgSwapExactAmountInResponse.typeUrl || typeof o.token_out_amount === "string"); + }, + isAmino(o: any): o is MsgSwapExactAmountInResponseAmino { + return o && (o.$typeUrl === MsgSwapExactAmountInResponse.typeUrl || typeof o.token_out_amount === "string"); + }, encode(message: MsgSwapExactAmountInResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.tokenOutAmount !== "") { writer.uint32(10).string(message.tokenOutAmount); @@ -878,15 +1060,27 @@ export const MsgSwapExactAmountInResponse = { } return message; }, + fromJSON(object: any): MsgSwapExactAmountInResponse { + return { + tokenOutAmount: isSet(object.tokenOutAmount) ? String(object.tokenOutAmount) : "" + }; + }, + toJSON(message: MsgSwapExactAmountInResponse): unknown { + const obj: any = {}; + message.tokenOutAmount !== undefined && (obj.tokenOutAmount = message.tokenOutAmount); + return obj; + }, fromPartial(object: Partial): MsgSwapExactAmountInResponse { const message = createBaseMsgSwapExactAmountInResponse(); message.tokenOutAmount = object.tokenOutAmount ?? ""; return message; }, fromAmino(object: MsgSwapExactAmountInResponseAmino): MsgSwapExactAmountInResponse { - return { - tokenOutAmount: object.token_out_amount - }; + const message = createBaseMsgSwapExactAmountInResponse(); + if (object.token_out_amount !== undefined && object.token_out_amount !== null) { + message.tokenOutAmount = object.token_out_amount; + } + return message; }, toAmino(message: MsgSwapExactAmountInResponse): MsgSwapExactAmountInResponseAmino { const obj: any = {}; @@ -915,16 +1109,28 @@ export const MsgSwapExactAmountInResponse = { }; } }; +GlobalDecoderRegistry.register(MsgSwapExactAmountInResponse.typeUrl, MsgSwapExactAmountInResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgSwapExactAmountInResponse.aminoType, MsgSwapExactAmountInResponse.typeUrl); function createBaseMsgSwapExactAmountOut(): MsgSwapExactAmountOut { return { sender: "", routes: [], tokenInMaxAmount: "", - tokenOut: undefined + tokenOut: Coin.fromPartial({}) }; } export const MsgSwapExactAmountOut = { typeUrl: "/osmosis.gamm.v1beta1.MsgSwapExactAmountOut", + aminoType: "osmosis/gamm/swap-exact-amount-out", + is(o: any): o is MsgSwapExactAmountOut { + return o && (o.$typeUrl === MsgSwapExactAmountOut.typeUrl || typeof o.sender === "string" && Array.isArray(o.routes) && (!o.routes.length || SwapAmountOutRoute.is(o.routes[0])) && typeof o.tokenInMaxAmount === "string" && Coin.is(o.tokenOut)); + }, + isSDK(o: any): o is MsgSwapExactAmountOutSDKType { + return o && (o.$typeUrl === MsgSwapExactAmountOut.typeUrl || typeof o.sender === "string" && Array.isArray(o.routes) && (!o.routes.length || SwapAmountOutRoute.isSDK(o.routes[0])) && typeof o.token_in_max_amount === "string" && Coin.isSDK(o.token_out)); + }, + isAmino(o: any): o is MsgSwapExactAmountOutAmino { + return o && (o.$typeUrl === MsgSwapExactAmountOut.typeUrl || typeof o.sender === "string" && Array.isArray(o.routes) && (!o.routes.length || SwapAmountOutRoute.isAmino(o.routes[0])) && typeof o.token_in_max_amount === "string" && Coin.isAmino(o.token_out)); + }, encode(message: MsgSwapExactAmountOut, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.sender !== "") { writer.uint32(10).string(message.sender); @@ -966,6 +1172,26 @@ export const MsgSwapExactAmountOut = { } return message; }, + fromJSON(object: any): MsgSwapExactAmountOut { + return { + sender: isSet(object.sender) ? String(object.sender) : "", + routes: Array.isArray(object?.routes) ? object.routes.map((e: any) => SwapAmountOutRoute.fromJSON(e)) : [], + tokenInMaxAmount: isSet(object.tokenInMaxAmount) ? String(object.tokenInMaxAmount) : "", + tokenOut: isSet(object.tokenOut) ? Coin.fromJSON(object.tokenOut) : undefined + }; + }, + toJSON(message: MsgSwapExactAmountOut): unknown { + const obj: any = {}; + message.sender !== undefined && (obj.sender = message.sender); + if (message.routes) { + obj.routes = message.routes.map(e => e ? SwapAmountOutRoute.toJSON(e) : undefined); + } else { + obj.routes = []; + } + message.tokenInMaxAmount !== undefined && (obj.tokenInMaxAmount = message.tokenInMaxAmount); + message.tokenOut !== undefined && (obj.tokenOut = message.tokenOut ? Coin.toJSON(message.tokenOut) : undefined); + return obj; + }, fromPartial(object: Partial): MsgSwapExactAmountOut { const message = createBaseMsgSwapExactAmountOut(); message.sender = object.sender ?? ""; @@ -975,12 +1201,18 @@ export const MsgSwapExactAmountOut = { return message; }, fromAmino(object: MsgSwapExactAmountOutAmino): MsgSwapExactAmountOut { - return { - sender: object.sender, - routes: Array.isArray(object?.routes) ? object.routes.map((e: any) => SwapAmountOutRoute.fromAmino(e)) : [], - tokenInMaxAmount: object.token_in_max_amount, - tokenOut: object?.token_out ? Coin.fromAmino(object.token_out) : undefined - }; + const message = createBaseMsgSwapExactAmountOut(); + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + message.routes = object.routes?.map(e => SwapAmountOutRoute.fromAmino(e)) || []; + if (object.token_in_max_amount !== undefined && object.token_in_max_amount !== null) { + message.tokenInMaxAmount = object.token_in_max_amount; + } + if (object.token_out !== undefined && object.token_out !== null) { + message.tokenOut = Coin.fromAmino(object.token_out); + } + return message; }, toAmino(message: MsgSwapExactAmountOut): MsgSwapExactAmountOutAmino { const obj: any = {}; @@ -1016,6 +1248,8 @@ export const MsgSwapExactAmountOut = { }; } }; +GlobalDecoderRegistry.register(MsgSwapExactAmountOut.typeUrl, MsgSwapExactAmountOut); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgSwapExactAmountOut.aminoType, MsgSwapExactAmountOut.typeUrl); function createBaseMsgSwapExactAmountOutResponse(): MsgSwapExactAmountOutResponse { return { tokenInAmount: "" @@ -1023,6 +1257,16 @@ function createBaseMsgSwapExactAmountOutResponse(): MsgSwapExactAmountOutRespons } export const MsgSwapExactAmountOutResponse = { typeUrl: "/osmosis.gamm.v1beta1.MsgSwapExactAmountOutResponse", + aminoType: "osmosis/gamm/swap-exact-amount-out-response", + is(o: any): o is MsgSwapExactAmountOutResponse { + return o && (o.$typeUrl === MsgSwapExactAmountOutResponse.typeUrl || typeof o.tokenInAmount === "string"); + }, + isSDK(o: any): o is MsgSwapExactAmountOutResponseSDKType { + return o && (o.$typeUrl === MsgSwapExactAmountOutResponse.typeUrl || typeof o.token_in_amount === "string"); + }, + isAmino(o: any): o is MsgSwapExactAmountOutResponseAmino { + return o && (o.$typeUrl === MsgSwapExactAmountOutResponse.typeUrl || typeof o.token_in_amount === "string"); + }, encode(message: MsgSwapExactAmountOutResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.tokenInAmount !== "") { writer.uint32(10).string(message.tokenInAmount); @@ -1046,15 +1290,27 @@ export const MsgSwapExactAmountOutResponse = { } return message; }, + fromJSON(object: any): MsgSwapExactAmountOutResponse { + return { + tokenInAmount: isSet(object.tokenInAmount) ? String(object.tokenInAmount) : "" + }; + }, + toJSON(message: MsgSwapExactAmountOutResponse): unknown { + const obj: any = {}; + message.tokenInAmount !== undefined && (obj.tokenInAmount = message.tokenInAmount); + return obj; + }, fromPartial(object: Partial): MsgSwapExactAmountOutResponse { const message = createBaseMsgSwapExactAmountOutResponse(); message.tokenInAmount = object.tokenInAmount ?? ""; return message; }, fromAmino(object: MsgSwapExactAmountOutResponseAmino): MsgSwapExactAmountOutResponse { - return { - tokenInAmount: object.token_in_amount - }; + const message = createBaseMsgSwapExactAmountOutResponse(); + if (object.token_in_amount !== undefined && object.token_in_amount !== null) { + message.tokenInAmount = object.token_in_amount; + } + return message; }, toAmino(message: MsgSwapExactAmountOutResponse): MsgSwapExactAmountOutResponseAmino { const obj: any = {}; @@ -1083,16 +1339,28 @@ export const MsgSwapExactAmountOutResponse = { }; } }; +GlobalDecoderRegistry.register(MsgSwapExactAmountOutResponse.typeUrl, MsgSwapExactAmountOutResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgSwapExactAmountOutResponse.aminoType, MsgSwapExactAmountOutResponse.typeUrl); function createBaseMsgJoinSwapExternAmountIn(): MsgJoinSwapExternAmountIn { return { sender: "", poolId: BigInt(0), - tokenIn: undefined, + tokenIn: Coin.fromPartial({}), shareOutMinAmount: "" }; } export const MsgJoinSwapExternAmountIn = { typeUrl: "/osmosis.gamm.v1beta1.MsgJoinSwapExternAmountIn", + aminoType: "osmosis/gamm/join-swap-extern-amount-in", + is(o: any): o is MsgJoinSwapExternAmountIn { + return o && (o.$typeUrl === MsgJoinSwapExternAmountIn.typeUrl || typeof o.sender === "string" && typeof o.poolId === "bigint" && Coin.is(o.tokenIn) && typeof o.shareOutMinAmount === "string"); + }, + isSDK(o: any): o is MsgJoinSwapExternAmountInSDKType { + return o && (o.$typeUrl === MsgJoinSwapExternAmountIn.typeUrl || typeof o.sender === "string" && typeof o.pool_id === "bigint" && Coin.isSDK(o.token_in) && typeof o.share_out_min_amount === "string"); + }, + isAmino(o: any): o is MsgJoinSwapExternAmountInAmino { + return o && (o.$typeUrl === MsgJoinSwapExternAmountIn.typeUrl || typeof o.sender === "string" && typeof o.pool_id === "bigint" && Coin.isAmino(o.token_in) && typeof o.share_out_min_amount === "string"); + }, encode(message: MsgJoinSwapExternAmountIn, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.sender !== "") { writer.uint32(10).string(message.sender); @@ -1134,6 +1402,22 @@ export const MsgJoinSwapExternAmountIn = { } return message; }, + fromJSON(object: any): MsgJoinSwapExternAmountIn { + return { + sender: isSet(object.sender) ? String(object.sender) : "", + poolId: isSet(object.poolId) ? BigInt(object.poolId.toString()) : BigInt(0), + tokenIn: isSet(object.tokenIn) ? Coin.fromJSON(object.tokenIn) : undefined, + shareOutMinAmount: isSet(object.shareOutMinAmount) ? String(object.shareOutMinAmount) : "" + }; + }, + toJSON(message: MsgJoinSwapExternAmountIn): unknown { + const obj: any = {}; + message.sender !== undefined && (obj.sender = message.sender); + message.poolId !== undefined && (obj.poolId = (message.poolId || BigInt(0)).toString()); + message.tokenIn !== undefined && (obj.tokenIn = message.tokenIn ? Coin.toJSON(message.tokenIn) : undefined); + message.shareOutMinAmount !== undefined && (obj.shareOutMinAmount = message.shareOutMinAmount); + return obj; + }, fromPartial(object: Partial): MsgJoinSwapExternAmountIn { const message = createBaseMsgJoinSwapExternAmountIn(); message.sender = object.sender ?? ""; @@ -1143,12 +1427,20 @@ export const MsgJoinSwapExternAmountIn = { return message; }, fromAmino(object: MsgJoinSwapExternAmountInAmino): MsgJoinSwapExternAmountIn { - return { - sender: object.sender, - poolId: BigInt(object.pool_id), - tokenIn: object?.token_in ? Coin.fromAmino(object.token_in) : undefined, - shareOutMinAmount: object.share_out_min_amount - }; + const message = createBaseMsgJoinSwapExternAmountIn(); + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + if (object.pool_id !== undefined && object.pool_id !== null) { + message.poolId = BigInt(object.pool_id); + } + if (object.token_in !== undefined && object.token_in !== null) { + message.tokenIn = Coin.fromAmino(object.token_in); + } + if (object.share_out_min_amount !== undefined && object.share_out_min_amount !== null) { + message.shareOutMinAmount = object.share_out_min_amount; + } + return message; }, toAmino(message: MsgJoinSwapExternAmountIn): MsgJoinSwapExternAmountInAmino { const obj: any = {}; @@ -1180,6 +1472,8 @@ export const MsgJoinSwapExternAmountIn = { }; } }; +GlobalDecoderRegistry.register(MsgJoinSwapExternAmountIn.typeUrl, MsgJoinSwapExternAmountIn); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgJoinSwapExternAmountIn.aminoType, MsgJoinSwapExternAmountIn.typeUrl); function createBaseMsgJoinSwapExternAmountInResponse(): MsgJoinSwapExternAmountInResponse { return { shareOutAmount: "" @@ -1187,6 +1481,16 @@ function createBaseMsgJoinSwapExternAmountInResponse(): MsgJoinSwapExternAmountI } export const MsgJoinSwapExternAmountInResponse = { typeUrl: "/osmosis.gamm.v1beta1.MsgJoinSwapExternAmountInResponse", + aminoType: "osmosis/gamm/join-swap-extern-amount-in-response", + is(o: any): o is MsgJoinSwapExternAmountInResponse { + return o && (o.$typeUrl === MsgJoinSwapExternAmountInResponse.typeUrl || typeof o.shareOutAmount === "string"); + }, + isSDK(o: any): o is MsgJoinSwapExternAmountInResponseSDKType { + return o && (o.$typeUrl === MsgJoinSwapExternAmountInResponse.typeUrl || typeof o.share_out_amount === "string"); + }, + isAmino(o: any): o is MsgJoinSwapExternAmountInResponseAmino { + return o && (o.$typeUrl === MsgJoinSwapExternAmountInResponse.typeUrl || typeof o.share_out_amount === "string"); + }, encode(message: MsgJoinSwapExternAmountInResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.shareOutAmount !== "") { writer.uint32(10).string(message.shareOutAmount); @@ -1210,15 +1514,27 @@ export const MsgJoinSwapExternAmountInResponse = { } return message; }, + fromJSON(object: any): MsgJoinSwapExternAmountInResponse { + return { + shareOutAmount: isSet(object.shareOutAmount) ? String(object.shareOutAmount) : "" + }; + }, + toJSON(message: MsgJoinSwapExternAmountInResponse): unknown { + const obj: any = {}; + message.shareOutAmount !== undefined && (obj.shareOutAmount = message.shareOutAmount); + return obj; + }, fromPartial(object: Partial): MsgJoinSwapExternAmountInResponse { const message = createBaseMsgJoinSwapExternAmountInResponse(); message.shareOutAmount = object.shareOutAmount ?? ""; return message; }, fromAmino(object: MsgJoinSwapExternAmountInResponseAmino): MsgJoinSwapExternAmountInResponse { - return { - shareOutAmount: object.share_out_amount - }; + const message = createBaseMsgJoinSwapExternAmountInResponse(); + if (object.share_out_amount !== undefined && object.share_out_amount !== null) { + message.shareOutAmount = object.share_out_amount; + } + return message; }, toAmino(message: MsgJoinSwapExternAmountInResponse): MsgJoinSwapExternAmountInResponseAmino { const obj: any = {}; @@ -1247,6 +1563,8 @@ export const MsgJoinSwapExternAmountInResponse = { }; } }; +GlobalDecoderRegistry.register(MsgJoinSwapExternAmountInResponse.typeUrl, MsgJoinSwapExternAmountInResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgJoinSwapExternAmountInResponse.aminoType, MsgJoinSwapExternAmountInResponse.typeUrl); function createBaseMsgJoinSwapShareAmountOut(): MsgJoinSwapShareAmountOut { return { sender: "", @@ -1258,6 +1576,16 @@ function createBaseMsgJoinSwapShareAmountOut(): MsgJoinSwapShareAmountOut { } export const MsgJoinSwapShareAmountOut = { typeUrl: "/osmosis.gamm.v1beta1.MsgJoinSwapShareAmountOut", + aminoType: "osmosis/gamm/join-swap-share-amount-out", + is(o: any): o is MsgJoinSwapShareAmountOut { + return o && (o.$typeUrl === MsgJoinSwapShareAmountOut.typeUrl || typeof o.sender === "string" && typeof o.poolId === "bigint" && typeof o.tokenInDenom === "string" && typeof o.shareOutAmount === "string" && typeof o.tokenInMaxAmount === "string"); + }, + isSDK(o: any): o is MsgJoinSwapShareAmountOutSDKType { + return o && (o.$typeUrl === MsgJoinSwapShareAmountOut.typeUrl || typeof o.sender === "string" && typeof o.pool_id === "bigint" && typeof o.token_in_denom === "string" && typeof o.share_out_amount === "string" && typeof o.token_in_max_amount === "string"); + }, + isAmino(o: any): o is MsgJoinSwapShareAmountOutAmino { + return o && (o.$typeUrl === MsgJoinSwapShareAmountOut.typeUrl || typeof o.sender === "string" && typeof o.pool_id === "bigint" && typeof o.token_in_denom === "string" && typeof o.share_out_amount === "string" && typeof o.token_in_max_amount === "string"); + }, encode(message: MsgJoinSwapShareAmountOut, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.sender !== "") { writer.uint32(10).string(message.sender); @@ -1305,6 +1633,24 @@ export const MsgJoinSwapShareAmountOut = { } return message; }, + fromJSON(object: any): MsgJoinSwapShareAmountOut { + return { + sender: isSet(object.sender) ? String(object.sender) : "", + poolId: isSet(object.poolId) ? BigInt(object.poolId.toString()) : BigInt(0), + tokenInDenom: isSet(object.tokenInDenom) ? String(object.tokenInDenom) : "", + shareOutAmount: isSet(object.shareOutAmount) ? String(object.shareOutAmount) : "", + tokenInMaxAmount: isSet(object.tokenInMaxAmount) ? String(object.tokenInMaxAmount) : "" + }; + }, + toJSON(message: MsgJoinSwapShareAmountOut): unknown { + const obj: any = {}; + message.sender !== undefined && (obj.sender = message.sender); + message.poolId !== undefined && (obj.poolId = (message.poolId || BigInt(0)).toString()); + message.tokenInDenom !== undefined && (obj.tokenInDenom = message.tokenInDenom); + message.shareOutAmount !== undefined && (obj.shareOutAmount = message.shareOutAmount); + message.tokenInMaxAmount !== undefined && (obj.tokenInMaxAmount = message.tokenInMaxAmount); + return obj; + }, fromPartial(object: Partial): MsgJoinSwapShareAmountOut { const message = createBaseMsgJoinSwapShareAmountOut(); message.sender = object.sender ?? ""; @@ -1315,13 +1661,23 @@ export const MsgJoinSwapShareAmountOut = { return message; }, fromAmino(object: MsgJoinSwapShareAmountOutAmino): MsgJoinSwapShareAmountOut { - return { - sender: object.sender, - poolId: BigInt(object.pool_id), - tokenInDenom: object.token_in_denom, - shareOutAmount: object.share_out_amount, - tokenInMaxAmount: object.token_in_max_amount - }; + const message = createBaseMsgJoinSwapShareAmountOut(); + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + if (object.pool_id !== undefined && object.pool_id !== null) { + message.poolId = BigInt(object.pool_id); + } + if (object.token_in_denom !== undefined && object.token_in_denom !== null) { + message.tokenInDenom = object.token_in_denom; + } + if (object.share_out_amount !== undefined && object.share_out_amount !== null) { + message.shareOutAmount = object.share_out_amount; + } + if (object.token_in_max_amount !== undefined && object.token_in_max_amount !== null) { + message.tokenInMaxAmount = object.token_in_max_amount; + } + return message; }, toAmino(message: MsgJoinSwapShareAmountOut): MsgJoinSwapShareAmountOutAmino { const obj: any = {}; @@ -1354,6 +1710,8 @@ export const MsgJoinSwapShareAmountOut = { }; } }; +GlobalDecoderRegistry.register(MsgJoinSwapShareAmountOut.typeUrl, MsgJoinSwapShareAmountOut); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgJoinSwapShareAmountOut.aminoType, MsgJoinSwapShareAmountOut.typeUrl); function createBaseMsgJoinSwapShareAmountOutResponse(): MsgJoinSwapShareAmountOutResponse { return { tokenInAmount: "" @@ -1361,6 +1719,16 @@ function createBaseMsgJoinSwapShareAmountOutResponse(): MsgJoinSwapShareAmountOu } export const MsgJoinSwapShareAmountOutResponse = { typeUrl: "/osmosis.gamm.v1beta1.MsgJoinSwapShareAmountOutResponse", + aminoType: "osmosis/gamm/join-swap-share-amount-out-response", + is(o: any): o is MsgJoinSwapShareAmountOutResponse { + return o && (o.$typeUrl === MsgJoinSwapShareAmountOutResponse.typeUrl || typeof o.tokenInAmount === "string"); + }, + isSDK(o: any): o is MsgJoinSwapShareAmountOutResponseSDKType { + return o && (o.$typeUrl === MsgJoinSwapShareAmountOutResponse.typeUrl || typeof o.token_in_amount === "string"); + }, + isAmino(o: any): o is MsgJoinSwapShareAmountOutResponseAmino { + return o && (o.$typeUrl === MsgJoinSwapShareAmountOutResponse.typeUrl || typeof o.token_in_amount === "string"); + }, encode(message: MsgJoinSwapShareAmountOutResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.tokenInAmount !== "") { writer.uint32(10).string(message.tokenInAmount); @@ -1384,15 +1752,27 @@ export const MsgJoinSwapShareAmountOutResponse = { } return message; }, + fromJSON(object: any): MsgJoinSwapShareAmountOutResponse { + return { + tokenInAmount: isSet(object.tokenInAmount) ? String(object.tokenInAmount) : "" + }; + }, + toJSON(message: MsgJoinSwapShareAmountOutResponse): unknown { + const obj: any = {}; + message.tokenInAmount !== undefined && (obj.tokenInAmount = message.tokenInAmount); + return obj; + }, fromPartial(object: Partial): MsgJoinSwapShareAmountOutResponse { const message = createBaseMsgJoinSwapShareAmountOutResponse(); message.tokenInAmount = object.tokenInAmount ?? ""; return message; }, fromAmino(object: MsgJoinSwapShareAmountOutResponseAmino): MsgJoinSwapShareAmountOutResponse { - return { - tokenInAmount: object.token_in_amount - }; + const message = createBaseMsgJoinSwapShareAmountOutResponse(); + if (object.token_in_amount !== undefined && object.token_in_amount !== null) { + message.tokenInAmount = object.token_in_amount; + } + return message; }, toAmino(message: MsgJoinSwapShareAmountOutResponse): MsgJoinSwapShareAmountOutResponseAmino { const obj: any = {}; @@ -1421,6 +1801,8 @@ export const MsgJoinSwapShareAmountOutResponse = { }; } }; +GlobalDecoderRegistry.register(MsgJoinSwapShareAmountOutResponse.typeUrl, MsgJoinSwapShareAmountOutResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgJoinSwapShareAmountOutResponse.aminoType, MsgJoinSwapShareAmountOutResponse.typeUrl); function createBaseMsgExitSwapShareAmountIn(): MsgExitSwapShareAmountIn { return { sender: "", @@ -1432,6 +1814,16 @@ function createBaseMsgExitSwapShareAmountIn(): MsgExitSwapShareAmountIn { } export const MsgExitSwapShareAmountIn = { typeUrl: "/osmosis.gamm.v1beta1.MsgExitSwapShareAmountIn", + aminoType: "osmosis/gamm/exit-swap-share-amount-in", + is(o: any): o is MsgExitSwapShareAmountIn { + return o && (o.$typeUrl === MsgExitSwapShareAmountIn.typeUrl || typeof o.sender === "string" && typeof o.poolId === "bigint" && typeof o.tokenOutDenom === "string" && typeof o.shareInAmount === "string" && typeof o.tokenOutMinAmount === "string"); + }, + isSDK(o: any): o is MsgExitSwapShareAmountInSDKType { + return o && (o.$typeUrl === MsgExitSwapShareAmountIn.typeUrl || typeof o.sender === "string" && typeof o.pool_id === "bigint" && typeof o.token_out_denom === "string" && typeof o.share_in_amount === "string" && typeof o.token_out_min_amount === "string"); + }, + isAmino(o: any): o is MsgExitSwapShareAmountInAmino { + return o && (o.$typeUrl === MsgExitSwapShareAmountIn.typeUrl || typeof o.sender === "string" && typeof o.pool_id === "bigint" && typeof o.token_out_denom === "string" && typeof o.share_in_amount === "string" && typeof o.token_out_min_amount === "string"); + }, encode(message: MsgExitSwapShareAmountIn, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.sender !== "") { writer.uint32(10).string(message.sender); @@ -1479,6 +1871,24 @@ export const MsgExitSwapShareAmountIn = { } return message; }, + fromJSON(object: any): MsgExitSwapShareAmountIn { + return { + sender: isSet(object.sender) ? String(object.sender) : "", + poolId: isSet(object.poolId) ? BigInt(object.poolId.toString()) : BigInt(0), + tokenOutDenom: isSet(object.tokenOutDenom) ? String(object.tokenOutDenom) : "", + shareInAmount: isSet(object.shareInAmount) ? String(object.shareInAmount) : "", + tokenOutMinAmount: isSet(object.tokenOutMinAmount) ? String(object.tokenOutMinAmount) : "" + }; + }, + toJSON(message: MsgExitSwapShareAmountIn): unknown { + const obj: any = {}; + message.sender !== undefined && (obj.sender = message.sender); + message.poolId !== undefined && (obj.poolId = (message.poolId || BigInt(0)).toString()); + message.tokenOutDenom !== undefined && (obj.tokenOutDenom = message.tokenOutDenom); + message.shareInAmount !== undefined && (obj.shareInAmount = message.shareInAmount); + message.tokenOutMinAmount !== undefined && (obj.tokenOutMinAmount = message.tokenOutMinAmount); + return obj; + }, fromPartial(object: Partial): MsgExitSwapShareAmountIn { const message = createBaseMsgExitSwapShareAmountIn(); message.sender = object.sender ?? ""; @@ -1489,13 +1899,23 @@ export const MsgExitSwapShareAmountIn = { return message; }, fromAmino(object: MsgExitSwapShareAmountInAmino): MsgExitSwapShareAmountIn { - return { - sender: object.sender, - poolId: BigInt(object.pool_id), - tokenOutDenom: object.token_out_denom, - shareInAmount: object.share_in_amount, - tokenOutMinAmount: object.token_out_min_amount - }; + const message = createBaseMsgExitSwapShareAmountIn(); + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + if (object.pool_id !== undefined && object.pool_id !== null) { + message.poolId = BigInt(object.pool_id); + } + if (object.token_out_denom !== undefined && object.token_out_denom !== null) { + message.tokenOutDenom = object.token_out_denom; + } + if (object.share_in_amount !== undefined && object.share_in_amount !== null) { + message.shareInAmount = object.share_in_amount; + } + if (object.token_out_min_amount !== undefined && object.token_out_min_amount !== null) { + message.tokenOutMinAmount = object.token_out_min_amount; + } + return message; }, toAmino(message: MsgExitSwapShareAmountIn): MsgExitSwapShareAmountInAmino { const obj: any = {}; @@ -1528,6 +1948,8 @@ export const MsgExitSwapShareAmountIn = { }; } }; +GlobalDecoderRegistry.register(MsgExitSwapShareAmountIn.typeUrl, MsgExitSwapShareAmountIn); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgExitSwapShareAmountIn.aminoType, MsgExitSwapShareAmountIn.typeUrl); function createBaseMsgExitSwapShareAmountInResponse(): MsgExitSwapShareAmountInResponse { return { tokenOutAmount: "" @@ -1535,6 +1957,16 @@ function createBaseMsgExitSwapShareAmountInResponse(): MsgExitSwapShareAmountInR } export const MsgExitSwapShareAmountInResponse = { typeUrl: "/osmosis.gamm.v1beta1.MsgExitSwapShareAmountInResponse", + aminoType: "osmosis/gamm/exit-swap-share-amount-in-response", + is(o: any): o is MsgExitSwapShareAmountInResponse { + return o && (o.$typeUrl === MsgExitSwapShareAmountInResponse.typeUrl || typeof o.tokenOutAmount === "string"); + }, + isSDK(o: any): o is MsgExitSwapShareAmountInResponseSDKType { + return o && (o.$typeUrl === MsgExitSwapShareAmountInResponse.typeUrl || typeof o.token_out_amount === "string"); + }, + isAmino(o: any): o is MsgExitSwapShareAmountInResponseAmino { + return o && (o.$typeUrl === MsgExitSwapShareAmountInResponse.typeUrl || typeof o.token_out_amount === "string"); + }, encode(message: MsgExitSwapShareAmountInResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.tokenOutAmount !== "") { writer.uint32(10).string(message.tokenOutAmount); @@ -1558,15 +1990,27 @@ export const MsgExitSwapShareAmountInResponse = { } return message; }, + fromJSON(object: any): MsgExitSwapShareAmountInResponse { + return { + tokenOutAmount: isSet(object.tokenOutAmount) ? String(object.tokenOutAmount) : "" + }; + }, + toJSON(message: MsgExitSwapShareAmountInResponse): unknown { + const obj: any = {}; + message.tokenOutAmount !== undefined && (obj.tokenOutAmount = message.tokenOutAmount); + return obj; + }, fromPartial(object: Partial): MsgExitSwapShareAmountInResponse { const message = createBaseMsgExitSwapShareAmountInResponse(); message.tokenOutAmount = object.tokenOutAmount ?? ""; return message; }, fromAmino(object: MsgExitSwapShareAmountInResponseAmino): MsgExitSwapShareAmountInResponse { - return { - tokenOutAmount: object.token_out_amount - }; + const message = createBaseMsgExitSwapShareAmountInResponse(); + if (object.token_out_amount !== undefined && object.token_out_amount !== null) { + message.tokenOutAmount = object.token_out_amount; + } + return message; }, toAmino(message: MsgExitSwapShareAmountInResponse): MsgExitSwapShareAmountInResponseAmino { const obj: any = {}; @@ -1595,16 +2039,28 @@ export const MsgExitSwapShareAmountInResponse = { }; } }; +GlobalDecoderRegistry.register(MsgExitSwapShareAmountInResponse.typeUrl, MsgExitSwapShareAmountInResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgExitSwapShareAmountInResponse.aminoType, MsgExitSwapShareAmountInResponse.typeUrl); function createBaseMsgExitSwapExternAmountOut(): MsgExitSwapExternAmountOut { return { sender: "", poolId: BigInt(0), - tokenOut: undefined, + tokenOut: Coin.fromPartial({}), shareInMaxAmount: "" }; } export const MsgExitSwapExternAmountOut = { typeUrl: "/osmosis.gamm.v1beta1.MsgExitSwapExternAmountOut", + aminoType: "osmosis/gamm/exit-swap-extern-amount-out", + is(o: any): o is MsgExitSwapExternAmountOut { + return o && (o.$typeUrl === MsgExitSwapExternAmountOut.typeUrl || typeof o.sender === "string" && typeof o.poolId === "bigint" && Coin.is(o.tokenOut) && typeof o.shareInMaxAmount === "string"); + }, + isSDK(o: any): o is MsgExitSwapExternAmountOutSDKType { + return o && (o.$typeUrl === MsgExitSwapExternAmountOut.typeUrl || typeof o.sender === "string" && typeof o.pool_id === "bigint" && Coin.isSDK(o.token_out) && typeof o.share_in_max_amount === "string"); + }, + isAmino(o: any): o is MsgExitSwapExternAmountOutAmino { + return o && (o.$typeUrl === MsgExitSwapExternAmountOut.typeUrl || typeof o.sender === "string" && typeof o.pool_id === "bigint" && Coin.isAmino(o.token_out) && typeof o.share_in_max_amount === "string"); + }, encode(message: MsgExitSwapExternAmountOut, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.sender !== "") { writer.uint32(10).string(message.sender); @@ -1646,6 +2102,22 @@ export const MsgExitSwapExternAmountOut = { } return message; }, + fromJSON(object: any): MsgExitSwapExternAmountOut { + return { + sender: isSet(object.sender) ? String(object.sender) : "", + poolId: isSet(object.poolId) ? BigInt(object.poolId.toString()) : BigInt(0), + tokenOut: isSet(object.tokenOut) ? Coin.fromJSON(object.tokenOut) : undefined, + shareInMaxAmount: isSet(object.shareInMaxAmount) ? String(object.shareInMaxAmount) : "" + }; + }, + toJSON(message: MsgExitSwapExternAmountOut): unknown { + const obj: any = {}; + message.sender !== undefined && (obj.sender = message.sender); + message.poolId !== undefined && (obj.poolId = (message.poolId || BigInt(0)).toString()); + message.tokenOut !== undefined && (obj.tokenOut = message.tokenOut ? Coin.toJSON(message.tokenOut) : undefined); + message.shareInMaxAmount !== undefined && (obj.shareInMaxAmount = message.shareInMaxAmount); + return obj; + }, fromPartial(object: Partial): MsgExitSwapExternAmountOut { const message = createBaseMsgExitSwapExternAmountOut(); message.sender = object.sender ?? ""; @@ -1655,12 +2127,20 @@ export const MsgExitSwapExternAmountOut = { return message; }, fromAmino(object: MsgExitSwapExternAmountOutAmino): MsgExitSwapExternAmountOut { - return { - sender: object.sender, - poolId: BigInt(object.pool_id), - tokenOut: object?.token_out ? Coin.fromAmino(object.token_out) : undefined, - shareInMaxAmount: object.share_in_max_amount - }; + const message = createBaseMsgExitSwapExternAmountOut(); + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + if (object.pool_id !== undefined && object.pool_id !== null) { + message.poolId = BigInt(object.pool_id); + } + if (object.token_out !== undefined && object.token_out !== null) { + message.tokenOut = Coin.fromAmino(object.token_out); + } + if (object.share_in_max_amount !== undefined && object.share_in_max_amount !== null) { + message.shareInMaxAmount = object.share_in_max_amount; + } + return message; }, toAmino(message: MsgExitSwapExternAmountOut): MsgExitSwapExternAmountOutAmino { const obj: any = {}; @@ -1692,6 +2172,8 @@ export const MsgExitSwapExternAmountOut = { }; } }; +GlobalDecoderRegistry.register(MsgExitSwapExternAmountOut.typeUrl, MsgExitSwapExternAmountOut); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgExitSwapExternAmountOut.aminoType, MsgExitSwapExternAmountOut.typeUrl); function createBaseMsgExitSwapExternAmountOutResponse(): MsgExitSwapExternAmountOutResponse { return { shareInAmount: "" @@ -1699,6 +2181,16 @@ function createBaseMsgExitSwapExternAmountOutResponse(): MsgExitSwapExternAmount } export const MsgExitSwapExternAmountOutResponse = { typeUrl: "/osmosis.gamm.v1beta1.MsgExitSwapExternAmountOutResponse", + aminoType: "osmosis/gamm/exit-swap-extern-amount-out-response", + is(o: any): o is MsgExitSwapExternAmountOutResponse { + return o && (o.$typeUrl === MsgExitSwapExternAmountOutResponse.typeUrl || typeof o.shareInAmount === "string"); + }, + isSDK(o: any): o is MsgExitSwapExternAmountOutResponseSDKType { + return o && (o.$typeUrl === MsgExitSwapExternAmountOutResponse.typeUrl || typeof o.share_in_amount === "string"); + }, + isAmino(o: any): o is MsgExitSwapExternAmountOutResponseAmino { + return o && (o.$typeUrl === MsgExitSwapExternAmountOutResponse.typeUrl || typeof o.share_in_amount === "string"); + }, encode(message: MsgExitSwapExternAmountOutResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.shareInAmount !== "") { writer.uint32(10).string(message.shareInAmount); @@ -1722,15 +2214,27 @@ export const MsgExitSwapExternAmountOutResponse = { } return message; }, + fromJSON(object: any): MsgExitSwapExternAmountOutResponse { + return { + shareInAmount: isSet(object.shareInAmount) ? String(object.shareInAmount) : "" + }; + }, + toJSON(message: MsgExitSwapExternAmountOutResponse): unknown { + const obj: any = {}; + message.shareInAmount !== undefined && (obj.shareInAmount = message.shareInAmount); + return obj; + }, fromPartial(object: Partial): MsgExitSwapExternAmountOutResponse { const message = createBaseMsgExitSwapExternAmountOutResponse(); message.shareInAmount = object.shareInAmount ?? ""; return message; }, fromAmino(object: MsgExitSwapExternAmountOutResponseAmino): MsgExitSwapExternAmountOutResponse { - return { - shareInAmount: object.share_in_amount - }; + const message = createBaseMsgExitSwapExternAmountOutResponse(); + if (object.share_in_amount !== undefined && object.share_in_amount !== null) { + message.shareInAmount = object.share_in_amount; + } + return message; }, toAmino(message: MsgExitSwapExternAmountOutResponse): MsgExitSwapExternAmountOutResponseAmino { const obj: any = {}; @@ -1758,4 +2262,6 @@ export const MsgExitSwapExternAmountOutResponse = { value: MsgExitSwapExternAmountOutResponse.encode(message).finish() }; } -}; \ No newline at end of file +}; +GlobalDecoderRegistry.register(MsgExitSwapExternAmountOutResponse.typeUrl, MsgExitSwapExternAmountOutResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgExitSwapExternAmountOutResponse.aminoType, MsgExitSwapExternAmountOutResponse.typeUrl); \ No newline at end of file diff --git a/packages/osmojs/src/codegen/osmosis/gamm/v2/query.ts b/packages/osmojs/src/codegen/osmosis/gamm/v2/query.ts index 90c0ddf8b..a29d412f3 100644 --- a/packages/osmojs/src/codegen/osmosis/gamm/v2/query.ts +++ b/packages/osmojs/src/codegen/osmosis/gamm/v2/query.ts @@ -1,4 +1,6 @@ import { BinaryReader, BinaryWriter } from "../../../binary"; +import { isSet } from "../../../helpers"; +import { GlobalDecoderRegistry } from "../../../registry"; /** Deprecated: please use alternate in x/poolmanager */ /** @deprecated */ export interface QuerySpotPriceRequest { @@ -13,9 +15,9 @@ export interface QuerySpotPriceRequestProtoMsg { /** Deprecated: please use alternate in x/poolmanager */ /** @deprecated */ export interface QuerySpotPriceRequestAmino { - pool_id: string; - base_asset_denom: string; - quote_asset_denom: string; + pool_id?: string; + base_asset_denom?: string; + quote_asset_denom?: string; } export interface QuerySpotPriceRequestAminoMsg { type: "osmosis/gamm/v2/query-spot-price-request"; @@ -28,7 +30,7 @@ export interface QuerySpotPriceRequestSDKType { base_asset_denom: string; quote_asset_denom: string; } -/** Depreacted: please use alternate in x/poolmanager */ +/** Deprecated: please use alternate in x/poolmanager */ /** @deprecated */ export interface QuerySpotPriceResponse { /** String of the Dec. Ex) 10.203uatom */ @@ -38,17 +40,17 @@ export interface QuerySpotPriceResponseProtoMsg { typeUrl: "/osmosis.gamm.v2.QuerySpotPriceResponse"; value: Uint8Array; } -/** Depreacted: please use alternate in x/poolmanager */ +/** Deprecated: please use alternate in x/poolmanager */ /** @deprecated */ export interface QuerySpotPriceResponseAmino { /** String of the Dec. Ex) 10.203uatom */ - spot_price: string; + spot_price?: string; } export interface QuerySpotPriceResponseAminoMsg { type: "osmosis/gamm/v2/query-spot-price-response"; value: QuerySpotPriceResponseAmino; } -/** Depreacted: please use alternate in x/poolmanager */ +/** Deprecated: please use alternate in x/poolmanager */ /** @deprecated */ export interface QuerySpotPriceResponseSDKType { spot_price: string; @@ -62,6 +64,16 @@ function createBaseQuerySpotPriceRequest(): QuerySpotPriceRequest { } export const QuerySpotPriceRequest = { typeUrl: "/osmosis.gamm.v2.QuerySpotPriceRequest", + aminoType: "osmosis/gamm/v2/query-spot-price-request", + is(o: any): o is QuerySpotPriceRequest { + return o && (o.$typeUrl === QuerySpotPriceRequest.typeUrl || typeof o.poolId === "bigint" && typeof o.baseAssetDenom === "string" && typeof o.quoteAssetDenom === "string"); + }, + isSDK(o: any): o is QuerySpotPriceRequestSDKType { + return o && (o.$typeUrl === QuerySpotPriceRequest.typeUrl || typeof o.pool_id === "bigint" && typeof o.base_asset_denom === "string" && typeof o.quote_asset_denom === "string"); + }, + isAmino(o: any): o is QuerySpotPriceRequestAmino { + return o && (o.$typeUrl === QuerySpotPriceRequest.typeUrl || typeof o.pool_id === "bigint" && typeof o.base_asset_denom === "string" && typeof o.quote_asset_denom === "string"); + }, encode(message: QuerySpotPriceRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.poolId !== BigInt(0)) { writer.uint32(8).uint64(message.poolId); @@ -97,6 +109,20 @@ export const QuerySpotPriceRequest = { } return message; }, + fromJSON(object: any): QuerySpotPriceRequest { + return { + poolId: isSet(object.poolId) ? BigInt(object.poolId.toString()) : BigInt(0), + baseAssetDenom: isSet(object.baseAssetDenom) ? String(object.baseAssetDenom) : "", + quoteAssetDenom: isSet(object.quoteAssetDenom) ? String(object.quoteAssetDenom) : "" + }; + }, + toJSON(message: QuerySpotPriceRequest): unknown { + const obj: any = {}; + message.poolId !== undefined && (obj.poolId = (message.poolId || BigInt(0)).toString()); + message.baseAssetDenom !== undefined && (obj.baseAssetDenom = message.baseAssetDenom); + message.quoteAssetDenom !== undefined && (obj.quoteAssetDenom = message.quoteAssetDenom); + return obj; + }, fromPartial(object: Partial): QuerySpotPriceRequest { const message = createBaseQuerySpotPriceRequest(); message.poolId = object.poolId !== undefined && object.poolId !== null ? BigInt(object.poolId.toString()) : BigInt(0); @@ -105,11 +131,17 @@ export const QuerySpotPriceRequest = { return message; }, fromAmino(object: QuerySpotPriceRequestAmino): QuerySpotPriceRequest { - return { - poolId: BigInt(object.pool_id), - baseAssetDenom: object.base_asset_denom, - quoteAssetDenom: object.quote_asset_denom - }; + const message = createBaseQuerySpotPriceRequest(); + if (object.pool_id !== undefined && object.pool_id !== null) { + message.poolId = BigInt(object.pool_id); + } + if (object.base_asset_denom !== undefined && object.base_asset_denom !== null) { + message.baseAssetDenom = object.base_asset_denom; + } + if (object.quote_asset_denom !== undefined && object.quote_asset_denom !== null) { + message.quoteAssetDenom = object.quote_asset_denom; + } + return message; }, toAmino(message: QuerySpotPriceRequest): QuerySpotPriceRequestAmino { const obj: any = {}; @@ -140,6 +172,8 @@ export const QuerySpotPriceRequest = { }; } }; +GlobalDecoderRegistry.register(QuerySpotPriceRequest.typeUrl, QuerySpotPriceRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(QuerySpotPriceRequest.aminoType, QuerySpotPriceRequest.typeUrl); function createBaseQuerySpotPriceResponse(): QuerySpotPriceResponse { return { spotPrice: "" @@ -147,6 +181,16 @@ function createBaseQuerySpotPriceResponse(): QuerySpotPriceResponse { } export const QuerySpotPriceResponse = { typeUrl: "/osmosis.gamm.v2.QuerySpotPriceResponse", + aminoType: "osmosis/gamm/v2/query-spot-price-response", + is(o: any): o is QuerySpotPriceResponse { + return o && (o.$typeUrl === QuerySpotPriceResponse.typeUrl || typeof o.spotPrice === "string"); + }, + isSDK(o: any): o is QuerySpotPriceResponseSDKType { + return o && (o.$typeUrl === QuerySpotPriceResponse.typeUrl || typeof o.spot_price === "string"); + }, + isAmino(o: any): o is QuerySpotPriceResponseAmino { + return o && (o.$typeUrl === QuerySpotPriceResponse.typeUrl || typeof o.spot_price === "string"); + }, encode(message: QuerySpotPriceResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.spotPrice !== "") { writer.uint32(10).string(message.spotPrice); @@ -170,15 +214,27 @@ export const QuerySpotPriceResponse = { } return message; }, + fromJSON(object: any): QuerySpotPriceResponse { + return { + spotPrice: isSet(object.spotPrice) ? String(object.spotPrice) : "" + }; + }, + toJSON(message: QuerySpotPriceResponse): unknown { + const obj: any = {}; + message.spotPrice !== undefined && (obj.spotPrice = message.spotPrice); + return obj; + }, fromPartial(object: Partial): QuerySpotPriceResponse { const message = createBaseQuerySpotPriceResponse(); message.spotPrice = object.spotPrice ?? ""; return message; }, fromAmino(object: QuerySpotPriceResponseAmino): QuerySpotPriceResponse { - return { - spotPrice: object.spot_price - }; + const message = createBaseQuerySpotPriceResponse(); + if (object.spot_price !== undefined && object.spot_price !== null) { + message.spotPrice = object.spot_price; + } + return message; }, toAmino(message: QuerySpotPriceResponse): QuerySpotPriceResponseAmino { const obj: any = {}; @@ -206,4 +262,6 @@ export const QuerySpotPriceResponse = { value: QuerySpotPriceResponse.encode(message).finish() }; } -}; \ No newline at end of file +}; +GlobalDecoderRegistry.register(QuerySpotPriceResponse.typeUrl, QuerySpotPriceResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(QuerySpotPriceResponse.aminoType, QuerySpotPriceResponse.typeUrl); \ No newline at end of file diff --git a/packages/osmojs/src/codegen/osmosis/ibchooks/genesis.ts b/packages/osmojs/src/codegen/osmosis/ibchooks/genesis.ts new file mode 100644 index 000000000..a010187c3 --- /dev/null +++ b/packages/osmojs/src/codegen/osmosis/ibchooks/genesis.ts @@ -0,0 +1,112 @@ +import { Params, ParamsAmino, ParamsSDKType } from "./params"; +import { BinaryReader, BinaryWriter } from "../../binary"; +import { isSet } from "../../helpers"; +import { GlobalDecoderRegistry } from "../../registry"; +export interface GenesisState { + params: Params; +} +export interface GenesisStateProtoMsg { + typeUrl: "/osmosis.ibchooks.GenesisState"; + value: Uint8Array; +} +export interface GenesisStateAmino { + params?: ParamsAmino; +} +export interface GenesisStateAminoMsg { + type: "osmosis/ibchooks/genesis-state"; + value: GenesisStateAmino; +} +export interface GenesisStateSDKType { + params: ParamsSDKType; +} +function createBaseGenesisState(): GenesisState { + return { + params: Params.fromPartial({}) + }; +} +export const GenesisState = { + typeUrl: "/osmosis.ibchooks.GenesisState", + aminoType: "osmosis/ibchooks/genesis-state", + is(o: any): o is GenesisState { + return o && (o.$typeUrl === GenesisState.typeUrl || Params.is(o.params)); + }, + isSDK(o: any): o is GenesisStateSDKType { + return o && (o.$typeUrl === GenesisState.typeUrl || Params.isSDK(o.params)); + }, + isAmino(o: any): o is GenesisStateAmino { + return o && (o.$typeUrl === GenesisState.typeUrl || Params.isAmino(o.params)); + }, + encode(message: GenesisState, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.params !== undefined) { + Params.encode(message.params, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): GenesisState { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGenesisState(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.params = Params.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): GenesisState { + 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; + }, + fromPartial(object: Partial): GenesisState { + const message = createBaseGenesisState(); + message.params = object.params !== undefined && object.params !== null ? Params.fromPartial(object.params) : undefined; + return message; + }, + fromAmino(object: GenesisStateAmino): GenesisState { + const message = createBaseGenesisState(); + if (object.params !== undefined && object.params !== null) { + message.params = Params.fromAmino(object.params); + } + return message; + }, + toAmino(message: GenesisState): GenesisStateAmino { + const obj: any = {}; + obj.params = message.params ? Params.toAmino(message.params) : undefined; + return obj; + }, + fromAminoMsg(object: GenesisStateAminoMsg): GenesisState { + return GenesisState.fromAmino(object.value); + }, + toAminoMsg(message: GenesisState): GenesisStateAminoMsg { + return { + type: "osmosis/ibchooks/genesis-state", + value: GenesisState.toAmino(message) + }; + }, + fromProtoMsg(message: GenesisStateProtoMsg): GenesisState { + return GenesisState.decode(message.value); + }, + toProto(message: GenesisState): Uint8Array { + return GenesisState.encode(message).finish(); + }, + toProtoMsg(message: GenesisState): GenesisStateProtoMsg { + return { + typeUrl: "/osmosis.ibchooks.GenesisState", + value: GenesisState.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(GenesisState.typeUrl, GenesisState); +GlobalDecoderRegistry.registerAminoProtoMapping(GenesisState.aminoType, GenesisState.typeUrl); \ No newline at end of file diff --git a/packages/osmojs/src/codegen/osmosis/ibchooks/params.ts b/packages/osmojs/src/codegen/osmosis/ibchooks/params.ts new file mode 100644 index 000000000..9bd70f1b0 --- /dev/null +++ b/packages/osmojs/src/codegen/osmosis/ibchooks/params.ts @@ -0,0 +1,116 @@ +import { BinaryReader, BinaryWriter } from "../../binary"; +import { GlobalDecoderRegistry } from "../../registry"; +export interface Params { + allowedAsyncAckContracts: string[]; +} +export interface ParamsProtoMsg { + typeUrl: "/osmosis.ibchooks.Params"; + value: Uint8Array; +} +export interface ParamsAmino { + allowed_async_ack_contracts?: string[]; +} +export interface ParamsAminoMsg { + type: "osmosis/ibchooks/params"; + value: ParamsAmino; +} +export interface ParamsSDKType { + allowed_async_ack_contracts: string[]; +} +function createBaseParams(): Params { + return { + allowedAsyncAckContracts: [] + }; +} +export const Params = { + typeUrl: "/osmosis.ibchooks.Params", + aminoType: "osmosis/ibchooks/params", + is(o: any): o is Params { + return o && (o.$typeUrl === Params.typeUrl || Array.isArray(o.allowedAsyncAckContracts) && (!o.allowedAsyncAckContracts.length || typeof o.allowedAsyncAckContracts[0] === "string")); + }, + isSDK(o: any): o is ParamsSDKType { + return o && (o.$typeUrl === Params.typeUrl || Array.isArray(o.allowed_async_ack_contracts) && (!o.allowed_async_ack_contracts.length || typeof o.allowed_async_ack_contracts[0] === "string")); + }, + isAmino(o: any): o is ParamsAmino { + return o && (o.$typeUrl === Params.typeUrl || Array.isArray(o.allowed_async_ack_contracts) && (!o.allowed_async_ack_contracts.length || typeof o.allowed_async_ack_contracts[0] === "string")); + }, + encode(message: Params, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.allowedAsyncAckContracts) { + writer.uint32(10).string(v!); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): Params { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseParams(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.allowedAsyncAckContracts.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): Params { + return { + allowedAsyncAckContracts: Array.isArray(object?.allowedAsyncAckContracts) ? object.allowedAsyncAckContracts.map((e: any) => String(e)) : [] + }; + }, + toJSON(message: Params): unknown { + const obj: any = {}; + if (message.allowedAsyncAckContracts) { + obj.allowedAsyncAckContracts = message.allowedAsyncAckContracts.map(e => e); + } else { + obj.allowedAsyncAckContracts = []; + } + return obj; + }, + fromPartial(object: Partial): Params { + const message = createBaseParams(); + message.allowedAsyncAckContracts = object.allowedAsyncAckContracts?.map(e => e) || []; + return message; + }, + fromAmino(object: ParamsAmino): Params { + const message = createBaseParams(); + message.allowedAsyncAckContracts = object.allowed_async_ack_contracts?.map(e => e) || []; + return message; + }, + toAmino(message: Params): ParamsAmino { + const obj: any = {}; + if (message.allowedAsyncAckContracts) { + obj.allowed_async_ack_contracts = message.allowedAsyncAckContracts.map(e => e); + } else { + obj.allowed_async_ack_contracts = []; + } + return obj; + }, + fromAminoMsg(object: ParamsAminoMsg): Params { + return Params.fromAmino(object.value); + }, + toAminoMsg(message: Params): ParamsAminoMsg { + return { + type: "osmosis/ibchooks/params", + value: Params.toAmino(message) + }; + }, + fromProtoMsg(message: ParamsProtoMsg): Params { + return Params.decode(message.value); + }, + toProto(message: Params): Uint8Array { + return Params.encode(message).finish(); + }, + toProtoMsg(message: Params): ParamsProtoMsg { + return { + typeUrl: "/osmosis.ibchooks.Params", + value: Params.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(Params.typeUrl, Params); +GlobalDecoderRegistry.registerAminoProtoMapping(Params.aminoType, Params.typeUrl); \ No newline at end of file diff --git a/packages/osmojs/src/codegen/osmosis/ibchooks/tx.amino.ts b/packages/osmojs/src/codegen/osmosis/ibchooks/tx.amino.ts new file mode 100644 index 000000000..b379c5879 --- /dev/null +++ b/packages/osmojs/src/codegen/osmosis/ibchooks/tx.amino.ts @@ -0,0 +1,9 @@ +//@ts-nocheck +import { MsgEmitIBCAck } from "./tx"; +export const AminoConverter = { + "/osmosis.ibchooks.MsgEmitIBCAck": { + aminoType: "osmosis/ibchooks/emit-ibc-ack", + toAmino: MsgEmitIBCAck.toAmino, + fromAmino: MsgEmitIBCAck.fromAmino + } +}; \ No newline at end of file diff --git a/packages/osmojs/src/codegen/osmosis/ibchooks/tx.registry.ts b/packages/osmojs/src/codegen/osmosis/ibchooks/tx.registry.ts new file mode 100644 index 000000000..af4aaf1a7 --- /dev/null +++ b/packages/osmojs/src/codegen/osmosis/ibchooks/tx.registry.ts @@ -0,0 +1,51 @@ +//@ts-nocheck +import { GeneratedType, Registry } from "@cosmjs/proto-signing"; +import { MsgEmitIBCAck } from "./tx"; +export const registry: ReadonlyArray<[string, GeneratedType]> = [["/osmosis.ibchooks.MsgEmitIBCAck", MsgEmitIBCAck]]; +export const load = (protoRegistry: Registry) => { + registry.forEach(([typeUrl, mod]) => { + protoRegistry.register(typeUrl, mod); + }); +}; +export const MessageComposer = { + encoded: { + emitIBCAck(value: MsgEmitIBCAck) { + return { + typeUrl: "/osmosis.ibchooks.MsgEmitIBCAck", + value: MsgEmitIBCAck.encode(value).finish() + }; + } + }, + withTypeUrl: { + emitIBCAck(value: MsgEmitIBCAck) { + return { + typeUrl: "/osmosis.ibchooks.MsgEmitIBCAck", + value + }; + } + }, + toJSON: { + emitIBCAck(value: MsgEmitIBCAck) { + return { + typeUrl: "/osmosis.ibchooks.MsgEmitIBCAck", + value: MsgEmitIBCAck.toJSON(value) + }; + } + }, + fromJSON: { + emitIBCAck(value: any) { + return { + typeUrl: "/osmosis.ibchooks.MsgEmitIBCAck", + value: MsgEmitIBCAck.fromJSON(value) + }; + } + }, + fromPartial: { + emitIBCAck(value: MsgEmitIBCAck) { + return { + typeUrl: "/osmosis.ibchooks.MsgEmitIBCAck", + value: MsgEmitIBCAck.fromPartial(value) + }; + } + } +}; \ No newline at end of file diff --git a/packages/osmojs/src/codegen/osmosis/ibchooks/tx.rpc.msg.ts b/packages/osmojs/src/codegen/osmosis/ibchooks/tx.rpc.msg.ts new file mode 100644 index 000000000..2e41d454a --- /dev/null +++ b/packages/osmojs/src/codegen/osmosis/ibchooks/tx.rpc.msg.ts @@ -0,0 +1,26 @@ +import { Rpc } from "../../helpers"; +import { BinaryReader } from "../../binary"; +import { MsgEmitIBCAck, MsgEmitIBCAckResponse } from "./tx"; +/** Msg defines the Msg service. */ +export interface Msg { + /** + * EmitIBCAck checks the sender can emit the ack and writes the IBC + * acknowledgement + */ + emitIBCAck(request: MsgEmitIBCAck): Promise; +} +export class MsgClientImpl implements Msg { + private readonly rpc: Rpc; + constructor(rpc: Rpc) { + this.rpc = rpc; + this.emitIBCAck = this.emitIBCAck.bind(this); + } + emitIBCAck(request: MsgEmitIBCAck): Promise { + const data = MsgEmitIBCAck.encode(request).finish(); + const promise = this.rpc.request("osmosis.ibchooks.Msg", "EmitIBCAck", data); + return promise.then(data => MsgEmitIBCAckResponse.decode(new BinaryReader(data))); + } +} +export const createClientImpl = (rpc: Rpc) => { + return new MsgClientImpl(rpc); +}; \ No newline at end of file diff --git a/packages/osmojs/src/codegen/osmosis/ibchooks/tx.ts b/packages/osmojs/src/codegen/osmosis/ibchooks/tx.ts new file mode 100644 index 000000000..7307aa54d --- /dev/null +++ b/packages/osmojs/src/codegen/osmosis/ibchooks/tx.ts @@ -0,0 +1,270 @@ +import { BinaryReader, BinaryWriter } from "../../binary"; +import { isSet } from "../../helpers"; +import { GlobalDecoderRegistry } from "../../registry"; +export interface MsgEmitIBCAck { + sender: string; + packetSequence: bigint; + channel: string; +} +export interface MsgEmitIBCAckProtoMsg { + typeUrl: "/osmosis.ibchooks.MsgEmitIBCAck"; + value: Uint8Array; +} +export interface MsgEmitIBCAckAmino { + sender?: string; + packet_sequence?: string; + channel?: string; +} +export interface MsgEmitIBCAckAminoMsg { + type: "osmosis/ibchooks/emit-ibc-ack"; + value: MsgEmitIBCAckAmino; +} +export interface MsgEmitIBCAckSDKType { + sender: string; + packet_sequence: bigint; + channel: string; +} +export interface MsgEmitIBCAckResponse { + contractResult: string; + ibcAck: string; +} +export interface MsgEmitIBCAckResponseProtoMsg { + typeUrl: "/osmosis.ibchooks.MsgEmitIBCAckResponse"; + value: Uint8Array; +} +export interface MsgEmitIBCAckResponseAmino { + contract_result?: string; + ibc_ack?: string; +} +export interface MsgEmitIBCAckResponseAminoMsg { + type: "osmosis/ibchooks/emit-ibc-ack-response"; + value: MsgEmitIBCAckResponseAmino; +} +export interface MsgEmitIBCAckResponseSDKType { + contract_result: string; + ibc_ack: string; +} +function createBaseMsgEmitIBCAck(): MsgEmitIBCAck { + return { + sender: "", + packetSequence: BigInt(0), + channel: "" + }; +} +export const MsgEmitIBCAck = { + typeUrl: "/osmosis.ibchooks.MsgEmitIBCAck", + aminoType: "osmosis/ibchooks/emit-ibc-ack", + is(o: any): o is MsgEmitIBCAck { + return o && (o.$typeUrl === MsgEmitIBCAck.typeUrl || typeof o.sender === "string" && typeof o.packetSequence === "bigint" && typeof o.channel === "string"); + }, + isSDK(o: any): o is MsgEmitIBCAckSDKType { + return o && (o.$typeUrl === MsgEmitIBCAck.typeUrl || typeof o.sender === "string" && typeof o.packet_sequence === "bigint" && typeof o.channel === "string"); + }, + isAmino(o: any): o is MsgEmitIBCAckAmino { + return o && (o.$typeUrl === MsgEmitIBCAck.typeUrl || typeof o.sender === "string" && typeof o.packet_sequence === "bigint" && typeof o.channel === "string"); + }, + encode(message: MsgEmitIBCAck, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.sender !== "") { + writer.uint32(10).string(message.sender); + } + if (message.packetSequence !== BigInt(0)) { + writer.uint32(16).uint64(message.packetSequence); + } + if (message.channel !== "") { + writer.uint32(26).string(message.channel); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgEmitIBCAck { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgEmitIBCAck(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.sender = reader.string(); + break; + case 2: + message.packetSequence = reader.uint64(); + break; + case 3: + message.channel = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): MsgEmitIBCAck { + return { + sender: isSet(object.sender) ? String(object.sender) : "", + packetSequence: isSet(object.packetSequence) ? BigInt(object.packetSequence.toString()) : BigInt(0), + channel: isSet(object.channel) ? String(object.channel) : "" + }; + }, + toJSON(message: MsgEmitIBCAck): unknown { + const obj: any = {}; + message.sender !== undefined && (obj.sender = message.sender); + message.packetSequence !== undefined && (obj.packetSequence = (message.packetSequence || BigInt(0)).toString()); + message.channel !== undefined && (obj.channel = message.channel); + return obj; + }, + fromPartial(object: Partial): MsgEmitIBCAck { + const message = createBaseMsgEmitIBCAck(); + message.sender = object.sender ?? ""; + message.packetSequence = object.packetSequence !== undefined && object.packetSequence !== null ? BigInt(object.packetSequence.toString()) : BigInt(0); + message.channel = object.channel ?? ""; + return message; + }, + fromAmino(object: MsgEmitIBCAckAmino): MsgEmitIBCAck { + const message = createBaseMsgEmitIBCAck(); + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + if (object.packet_sequence !== undefined && object.packet_sequence !== null) { + message.packetSequence = BigInt(object.packet_sequence); + } + if (object.channel !== undefined && object.channel !== null) { + message.channel = object.channel; + } + return message; + }, + toAmino(message: MsgEmitIBCAck): MsgEmitIBCAckAmino { + const obj: any = {}; + obj.sender = message.sender; + obj.packet_sequence = message.packetSequence ? message.packetSequence.toString() : undefined; + obj.channel = message.channel; + return obj; + }, + fromAminoMsg(object: MsgEmitIBCAckAminoMsg): MsgEmitIBCAck { + return MsgEmitIBCAck.fromAmino(object.value); + }, + toAminoMsg(message: MsgEmitIBCAck): MsgEmitIBCAckAminoMsg { + return { + type: "osmosis/ibchooks/emit-ibc-ack", + value: MsgEmitIBCAck.toAmino(message) + }; + }, + fromProtoMsg(message: MsgEmitIBCAckProtoMsg): MsgEmitIBCAck { + return MsgEmitIBCAck.decode(message.value); + }, + toProto(message: MsgEmitIBCAck): Uint8Array { + return MsgEmitIBCAck.encode(message).finish(); + }, + toProtoMsg(message: MsgEmitIBCAck): MsgEmitIBCAckProtoMsg { + return { + typeUrl: "/osmosis.ibchooks.MsgEmitIBCAck", + value: MsgEmitIBCAck.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgEmitIBCAck.typeUrl, MsgEmitIBCAck); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgEmitIBCAck.aminoType, MsgEmitIBCAck.typeUrl); +function createBaseMsgEmitIBCAckResponse(): MsgEmitIBCAckResponse { + return { + contractResult: "", + ibcAck: "" + }; +} +export const MsgEmitIBCAckResponse = { + typeUrl: "/osmosis.ibchooks.MsgEmitIBCAckResponse", + aminoType: "osmosis/ibchooks/emit-ibc-ack-response", + is(o: any): o is MsgEmitIBCAckResponse { + return o && (o.$typeUrl === MsgEmitIBCAckResponse.typeUrl || typeof o.contractResult === "string" && typeof o.ibcAck === "string"); + }, + isSDK(o: any): o is MsgEmitIBCAckResponseSDKType { + return o && (o.$typeUrl === MsgEmitIBCAckResponse.typeUrl || typeof o.contract_result === "string" && typeof o.ibc_ack === "string"); + }, + isAmino(o: any): o is MsgEmitIBCAckResponseAmino { + return o && (o.$typeUrl === MsgEmitIBCAckResponse.typeUrl || typeof o.contract_result === "string" && typeof o.ibc_ack === "string"); + }, + encode(message: MsgEmitIBCAckResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.contractResult !== "") { + writer.uint32(10).string(message.contractResult); + } + if (message.ibcAck !== "") { + writer.uint32(18).string(message.ibcAck); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgEmitIBCAckResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgEmitIBCAckResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.contractResult = reader.string(); + break; + case 2: + message.ibcAck = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): MsgEmitIBCAckResponse { + return { + contractResult: isSet(object.contractResult) ? String(object.contractResult) : "", + ibcAck: isSet(object.ibcAck) ? String(object.ibcAck) : "" + }; + }, + toJSON(message: MsgEmitIBCAckResponse): unknown { + const obj: any = {}; + message.contractResult !== undefined && (obj.contractResult = message.contractResult); + message.ibcAck !== undefined && (obj.ibcAck = message.ibcAck); + return obj; + }, + fromPartial(object: Partial): MsgEmitIBCAckResponse { + const message = createBaseMsgEmitIBCAckResponse(); + message.contractResult = object.contractResult ?? ""; + message.ibcAck = object.ibcAck ?? ""; + return message; + }, + fromAmino(object: MsgEmitIBCAckResponseAmino): MsgEmitIBCAckResponse { + const message = createBaseMsgEmitIBCAckResponse(); + if (object.contract_result !== undefined && object.contract_result !== null) { + message.contractResult = object.contract_result; + } + if (object.ibc_ack !== undefined && object.ibc_ack !== null) { + message.ibcAck = object.ibc_ack; + } + return message; + }, + toAmino(message: MsgEmitIBCAckResponse): MsgEmitIBCAckResponseAmino { + const obj: any = {}; + obj.contract_result = message.contractResult; + obj.ibc_ack = message.ibcAck; + return obj; + }, + fromAminoMsg(object: MsgEmitIBCAckResponseAminoMsg): MsgEmitIBCAckResponse { + return MsgEmitIBCAckResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgEmitIBCAckResponse): MsgEmitIBCAckResponseAminoMsg { + return { + type: "osmosis/ibchooks/emit-ibc-ack-response", + value: MsgEmitIBCAckResponse.toAmino(message) + }; + }, + fromProtoMsg(message: MsgEmitIBCAckResponseProtoMsg): MsgEmitIBCAckResponse { + return MsgEmitIBCAckResponse.decode(message.value); + }, + toProto(message: MsgEmitIBCAckResponse): Uint8Array { + return MsgEmitIBCAckResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgEmitIBCAckResponse): MsgEmitIBCAckResponseProtoMsg { + return { + typeUrl: "/osmosis.ibchooks.MsgEmitIBCAckResponse", + value: MsgEmitIBCAckResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgEmitIBCAckResponse.typeUrl, MsgEmitIBCAckResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgEmitIBCAckResponse.aminoType, MsgEmitIBCAckResponse.typeUrl); \ No newline at end of file diff --git a/packages/osmojs/src/codegen/osmosis/ibcratelimit/v1beta1/genesis.ts b/packages/osmojs/src/codegen/osmosis/ibcratelimit/v1beta1/genesis.ts new file mode 100644 index 000000000..86ab81b21 --- /dev/null +++ b/packages/osmojs/src/codegen/osmosis/ibcratelimit/v1beta1/genesis.ts @@ -0,0 +1,117 @@ +import { Params, ParamsAmino, ParamsSDKType } from "./params"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { isSet } from "../../../helpers"; +import { GlobalDecoderRegistry } from "../../../registry"; +/** GenesisState defines the ibc-rate-limit module's genesis state. */ +export interface GenesisState { + /** params are all the parameters of the module */ + params: Params; +} +export interface GenesisStateProtoMsg { + typeUrl: "/osmosis.ibcratelimit.v1beta1.GenesisState"; + value: Uint8Array; +} +/** GenesisState defines the ibc-rate-limit module's genesis state. */ +export interface GenesisStateAmino { + /** params are all the parameters of the module */ + params?: ParamsAmino; +} +export interface GenesisStateAminoMsg { + type: "osmosis/ibcratelimit/genesis-state"; + value: GenesisStateAmino; +} +/** GenesisState defines the ibc-rate-limit module's genesis state. */ +export interface GenesisStateSDKType { + params: ParamsSDKType; +} +function createBaseGenesisState(): GenesisState { + return { + params: Params.fromPartial({}) + }; +} +export const GenesisState = { + typeUrl: "/osmosis.ibcratelimit.v1beta1.GenesisState", + aminoType: "osmosis/ibcratelimit/genesis-state", + is(o: any): o is GenesisState { + return o && (o.$typeUrl === GenesisState.typeUrl || Params.is(o.params)); + }, + isSDK(o: any): o is GenesisStateSDKType { + return o && (o.$typeUrl === GenesisState.typeUrl || Params.isSDK(o.params)); + }, + isAmino(o: any): o is GenesisStateAmino { + return o && (o.$typeUrl === GenesisState.typeUrl || Params.isAmino(o.params)); + }, + encode(message: GenesisState, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.params !== undefined) { + Params.encode(message.params, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): GenesisState { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGenesisState(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.params = Params.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): GenesisState { + 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; + }, + fromPartial(object: Partial): GenesisState { + const message = createBaseGenesisState(); + message.params = object.params !== undefined && object.params !== null ? Params.fromPartial(object.params) : undefined; + return message; + }, + fromAmino(object: GenesisStateAmino): GenesisState { + const message = createBaseGenesisState(); + if (object.params !== undefined && object.params !== null) { + message.params = Params.fromAmino(object.params); + } + return message; + }, + toAmino(message: GenesisState): GenesisStateAmino { + const obj: any = {}; + obj.params = message.params ? Params.toAmino(message.params) : undefined; + return obj; + }, + fromAminoMsg(object: GenesisStateAminoMsg): GenesisState { + return GenesisState.fromAmino(object.value); + }, + toAminoMsg(message: GenesisState): GenesisStateAminoMsg { + return { + type: "osmosis/ibcratelimit/genesis-state", + value: GenesisState.toAmino(message) + }; + }, + fromProtoMsg(message: GenesisStateProtoMsg): GenesisState { + return GenesisState.decode(message.value); + }, + toProto(message: GenesisState): Uint8Array { + return GenesisState.encode(message).finish(); + }, + toProtoMsg(message: GenesisState): GenesisStateProtoMsg { + return { + typeUrl: "/osmosis.ibcratelimit.v1beta1.GenesisState", + value: GenesisState.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(GenesisState.typeUrl, GenesisState); +GlobalDecoderRegistry.registerAminoProtoMapping(GenesisState.aminoType, GenesisState.typeUrl); \ No newline at end of file diff --git a/packages/osmojs/src/codegen/osmosis/ibc-rate-limit/v1beta1/params.ts b/packages/osmojs/src/codegen/osmosis/ibcratelimit/v1beta1/params.ts similarity index 67% rename from packages/osmojs/src/codegen/osmosis/ibc-rate-limit/v1beta1/params.ts rename to packages/osmojs/src/codegen/osmosis/ibcratelimit/v1beta1/params.ts index 632f5d45b..47c118984 100644 --- a/packages/osmojs/src/codegen/osmosis/ibc-rate-limit/v1beta1/params.ts +++ b/packages/osmojs/src/codegen/osmosis/ibcratelimit/v1beta1/params.ts @@ -1,4 +1,6 @@ import { BinaryReader, BinaryWriter } from "../../../binary"; +import { isSet } from "../../../helpers"; +import { GlobalDecoderRegistry } from "../../../registry"; /** Params defines the parameters for the ibc-rate-limit module. */ export interface Params { contractAddress: string; @@ -9,7 +11,7 @@ export interface ParamsProtoMsg { } /** Params defines the parameters for the ibc-rate-limit module. */ export interface ParamsAmino { - contract_address: string; + contract_address?: string; } export interface ParamsAminoMsg { type: "osmosis/ibcratelimit/params"; @@ -26,6 +28,16 @@ function createBaseParams(): Params { } export const Params = { typeUrl: "/osmosis.ibcratelimit.v1beta1.Params", + aminoType: "osmosis/ibcratelimit/params", + is(o: any): o is Params { + return o && (o.$typeUrl === Params.typeUrl || typeof o.contractAddress === "string"); + }, + isSDK(o: any): o is ParamsSDKType { + return o && (o.$typeUrl === Params.typeUrl || typeof o.contract_address === "string"); + }, + isAmino(o: any): o is ParamsAmino { + return o && (o.$typeUrl === Params.typeUrl || typeof o.contract_address === "string"); + }, encode(message: Params, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.contractAddress !== "") { writer.uint32(10).string(message.contractAddress); @@ -49,15 +61,27 @@ export const Params = { } return message; }, + fromJSON(object: any): Params { + return { + contractAddress: isSet(object.contractAddress) ? String(object.contractAddress) : "" + }; + }, + toJSON(message: Params): unknown { + const obj: any = {}; + message.contractAddress !== undefined && (obj.contractAddress = message.contractAddress); + return obj; + }, fromPartial(object: Partial): Params { const message = createBaseParams(); message.contractAddress = object.contractAddress ?? ""; return message; }, fromAmino(object: ParamsAmino): Params { - return { - contractAddress: object.contract_address - }; + const message = createBaseParams(); + if (object.contract_address !== undefined && object.contract_address !== null) { + message.contractAddress = object.contract_address; + } + return message; }, toAmino(message: Params): ParamsAmino { const obj: any = {}; @@ -85,4 +109,6 @@ export const Params = { value: Params.encode(message).finish() }; } -}; \ No newline at end of file +}; +GlobalDecoderRegistry.register(Params.typeUrl, Params); +GlobalDecoderRegistry.registerAminoProtoMapping(Params.aminoType, Params.typeUrl); \ No newline at end of file diff --git a/packages/osmojs/src/codegen/osmosis/ibc-rate-limit/v1beta1/query.lcd.ts b/packages/osmojs/src/codegen/osmosis/ibcratelimit/v1beta1/query.lcd.ts similarity index 100% rename from packages/osmojs/src/codegen/osmosis/ibc-rate-limit/v1beta1/query.lcd.ts rename to packages/osmojs/src/codegen/osmosis/ibcratelimit/v1beta1/query.lcd.ts diff --git a/packages/osmojs/src/codegen/osmosis/ibc-rate-limit/v1beta1/query.rpc.Query.ts b/packages/osmojs/src/codegen/osmosis/ibcratelimit/v1beta1/query.rpc.Query.ts similarity index 100% rename from packages/osmojs/src/codegen/osmosis/ibc-rate-limit/v1beta1/query.rpc.Query.ts rename to packages/osmojs/src/codegen/osmosis/ibcratelimit/v1beta1/query.rpc.Query.ts diff --git a/packages/osmojs/src/codegen/osmosis/ibc-rate-limit/v1beta1/query.ts b/packages/osmojs/src/codegen/osmosis/ibcratelimit/v1beta1/query.ts similarity index 73% rename from packages/osmojs/src/codegen/osmosis/ibc-rate-limit/v1beta1/query.ts rename to packages/osmojs/src/codegen/osmosis/ibcratelimit/v1beta1/query.ts index 8431917cf..ab3e6b131 100644 --- a/packages/osmojs/src/codegen/osmosis/ibc-rate-limit/v1beta1/query.ts +++ b/packages/osmojs/src/codegen/osmosis/ibcratelimit/v1beta1/query.ts @@ -1,5 +1,7 @@ import { Params, ParamsAmino, ParamsSDKType } from "./params"; import { BinaryReader, BinaryWriter } from "../../../binary"; +import { GlobalDecoderRegistry } from "../../../registry"; +import { isSet } from "../../../helpers"; /** ParamsRequest is the request type for the Query/Params RPC method. */ export interface ParamsRequest {} export interface ParamsRequestProtoMsg { @@ -41,6 +43,16 @@ function createBaseParamsRequest(): ParamsRequest { } export const ParamsRequest = { typeUrl: "/osmosis.ibcratelimit.v1beta1.ParamsRequest", + aminoType: "osmosis/ibcratelimit/params-request", + is(o: any): o is ParamsRequest { + return o && o.$typeUrl === ParamsRequest.typeUrl; + }, + isSDK(o: any): o is ParamsRequestSDKType { + return o && o.$typeUrl === ParamsRequest.typeUrl; + }, + isAmino(o: any): o is ParamsRequestAmino { + return o && o.$typeUrl === ParamsRequest.typeUrl; + }, encode(_: ParamsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, @@ -58,12 +70,20 @@ export const ParamsRequest = { } return message; }, + fromJSON(_: any): ParamsRequest { + return {}; + }, + toJSON(_: ParamsRequest): unknown { + const obj: any = {}; + return obj; + }, fromPartial(_: Partial): ParamsRequest { const message = createBaseParamsRequest(); return message; }, fromAmino(_: ParamsRequestAmino): ParamsRequest { - return {}; + const message = createBaseParamsRequest(); + return message; }, toAmino(_: ParamsRequest): ParamsRequestAmino { const obj: any = {}; @@ -91,6 +111,8 @@ export const ParamsRequest = { }; } }; +GlobalDecoderRegistry.register(ParamsRequest.typeUrl, ParamsRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(ParamsRequest.aminoType, ParamsRequest.typeUrl); function createBaseParamsResponse(): ParamsResponse { return { params: Params.fromPartial({}) @@ -98,6 +120,16 @@ function createBaseParamsResponse(): ParamsResponse { } export const ParamsResponse = { typeUrl: "/osmosis.ibcratelimit.v1beta1.ParamsResponse", + aminoType: "osmosis/ibcratelimit/params-response", + is(o: any): o is ParamsResponse { + return o && (o.$typeUrl === ParamsResponse.typeUrl || Params.is(o.params)); + }, + isSDK(o: any): o is ParamsResponseSDKType { + return o && (o.$typeUrl === ParamsResponse.typeUrl || Params.isSDK(o.params)); + }, + isAmino(o: any): o is ParamsResponseAmino { + return o && (o.$typeUrl === ParamsResponse.typeUrl || Params.isAmino(o.params)); + }, encode(message: ParamsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.params !== undefined) { Params.encode(message.params, writer.uint32(10).fork()).ldelim(); @@ -121,15 +153,27 @@ export const ParamsResponse = { } return message; }, + fromJSON(object: any): ParamsResponse { + return { + params: isSet(object.params) ? Params.fromJSON(object.params) : undefined + }; + }, + toJSON(message: ParamsResponse): unknown { + const obj: any = {}; + message.params !== undefined && (obj.params = message.params ? Params.toJSON(message.params) : undefined); + return obj; + }, fromPartial(object: Partial): ParamsResponse { const message = createBaseParamsResponse(); message.params = object.params !== undefined && object.params !== null ? Params.fromPartial(object.params) : undefined; return message; }, fromAmino(object: ParamsResponseAmino): ParamsResponse { - return { - params: object?.params ? Params.fromAmino(object.params) : undefined - }; + const message = createBaseParamsResponse(); + if (object.params !== undefined && object.params !== null) { + message.params = Params.fromAmino(object.params); + } + return message; }, toAmino(message: ParamsResponse): ParamsResponseAmino { const obj: any = {}; @@ -157,4 +201,6 @@ export const ParamsResponse = { value: ParamsResponse.encode(message).finish() }; } -}; \ No newline at end of file +}; +GlobalDecoderRegistry.register(ParamsResponse.typeUrl, ParamsResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(ParamsResponse.aminoType, ParamsResponse.typeUrl); \ No newline at end of file diff --git a/packages/osmojs/src/codegen/osmosis/incentives/gauge.ts b/packages/osmojs/src/codegen/osmosis/incentives/gauge.ts index e1251c1ab..dd8e053ac 100644 --- a/packages/osmojs/src/codegen/osmosis/incentives/gauge.ts +++ b/packages/osmojs/src/codegen/osmosis/incentives/gauge.ts @@ -3,7 +3,8 @@ import { Coin, CoinAmino, CoinSDKType } from "../../cosmos/base/v1beta1/coin"; import { Timestamp } from "../../google/protobuf/timestamp"; import { Duration, DurationAmino, DurationSDKType } from "../../google/protobuf/duration"; import { BinaryReader, BinaryWriter } from "../../binary"; -import { toTimestamp, fromTimestamp } from "../../helpers"; +import { toTimestamp, fromTimestamp, isSet } from "../../helpers"; +import { GlobalDecoderRegistry } from "../../registry"; /** * Gauge is an object that stores and distributes yields to recipients who * satisfy certain conditions. Currently gauges support conditions around the @@ -56,7 +57,7 @@ export interface GaugeProtoMsg { */ export interface GaugeAmino { /** id is the unique ID of a Gauge */ - id: string; + id?: string; /** * is_perpetual is a flag to show if it's a perpetual or non-perpetual gauge * Non-perpetual gauges distribute their tokens equally per epoch while the @@ -64,7 +65,7 @@ export interface GaugeAmino { * at a single time and only distribute their tokens again once the gauge is * refilled, Intended for use with incentives that get refilled daily. */ - is_perpetual: boolean; + is_perpetual?: boolean; /** * distribute_to is where the gauge rewards are distributed to. * This is queried via lock duration or by timestamp @@ -74,21 +75,21 @@ export interface GaugeAmino { * coins is the total amount of coins that have been in the gauge * Can distribute multiple coin denoms */ - coins: CoinAmino[]; + coins?: CoinAmino[]; /** start_time is the distribution start time */ - start_time?: Date; + start_time?: string; /** * num_epochs_paid_over is the number of total epochs distribution will be * completed over */ - num_epochs_paid_over: string; + num_epochs_paid_over?: string; /** * filled_epochs is the number of epochs distribution has been completed on * already */ - filled_epochs: string; + filled_epochs?: string; /** distributed_coins are coins that have been distributed already */ - distributed_coins: CoinAmino[]; + distributed_coins?: CoinAmino[]; } export interface GaugeAminoMsg { type: "osmosis/incentives/gauge"; @@ -119,7 +120,7 @@ export interface LockableDurationsInfoProtoMsg { } export interface LockableDurationsInfoAmino { /** List of incentivised durations that gauges will pay out to */ - lockable_durations: DurationAmino[]; + lockable_durations?: DurationAmino[]; } export interface LockableDurationsInfoAminoMsg { type: "osmosis/incentives/lockable-durations-info"; @@ -134,7 +135,7 @@ function createBaseGauge(): Gauge { isPerpetual: false, distributeTo: QueryCondition.fromPartial({}), coins: [], - startTime: undefined, + startTime: new Date(), numEpochsPaidOver: BigInt(0), filledEpochs: BigInt(0), distributedCoins: [] @@ -142,6 +143,16 @@ function createBaseGauge(): Gauge { } export const Gauge = { typeUrl: "/osmosis.incentives.Gauge", + aminoType: "osmosis/incentives/gauge", + is(o: any): o is Gauge { + return o && (o.$typeUrl === Gauge.typeUrl || typeof o.id === "bigint" && typeof o.isPerpetual === "boolean" && QueryCondition.is(o.distributeTo) && Array.isArray(o.coins) && (!o.coins.length || Coin.is(o.coins[0])) && Timestamp.is(o.startTime) && typeof o.numEpochsPaidOver === "bigint" && typeof o.filledEpochs === "bigint" && Array.isArray(o.distributedCoins) && (!o.distributedCoins.length || Coin.is(o.distributedCoins[0]))); + }, + isSDK(o: any): o is GaugeSDKType { + return o && (o.$typeUrl === Gauge.typeUrl || typeof o.id === "bigint" && typeof o.is_perpetual === "boolean" && QueryCondition.isSDK(o.distribute_to) && Array.isArray(o.coins) && (!o.coins.length || Coin.isSDK(o.coins[0])) && Timestamp.isSDK(o.start_time) && typeof o.num_epochs_paid_over === "bigint" && typeof o.filled_epochs === "bigint" && Array.isArray(o.distributed_coins) && (!o.distributed_coins.length || Coin.isSDK(o.distributed_coins[0]))); + }, + isAmino(o: any): o is GaugeAmino { + return o && (o.$typeUrl === Gauge.typeUrl || typeof o.id === "bigint" && typeof o.is_perpetual === "boolean" && QueryCondition.isAmino(o.distribute_to) && Array.isArray(o.coins) && (!o.coins.length || Coin.isAmino(o.coins[0])) && Timestamp.isAmino(o.start_time) && typeof o.num_epochs_paid_over === "bigint" && typeof o.filled_epochs === "bigint" && Array.isArray(o.distributed_coins) && (!o.distributed_coins.length || Coin.isAmino(o.distributed_coins[0]))); + }, encode(message: Gauge, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.id !== BigInt(0)) { writer.uint32(8).uint64(message.id); @@ -207,6 +218,38 @@ export const Gauge = { } return message; }, + fromJSON(object: any): Gauge { + return { + id: isSet(object.id) ? BigInt(object.id.toString()) : BigInt(0), + isPerpetual: isSet(object.isPerpetual) ? Boolean(object.isPerpetual) : false, + distributeTo: isSet(object.distributeTo) ? QueryCondition.fromJSON(object.distributeTo) : undefined, + coins: Array.isArray(object?.coins) ? object.coins.map((e: any) => Coin.fromJSON(e)) : [], + startTime: isSet(object.startTime) ? new Date(object.startTime) : undefined, + numEpochsPaidOver: isSet(object.numEpochsPaidOver) ? BigInt(object.numEpochsPaidOver.toString()) : BigInt(0), + filledEpochs: isSet(object.filledEpochs) ? BigInt(object.filledEpochs.toString()) : BigInt(0), + distributedCoins: Array.isArray(object?.distributedCoins) ? object.distributedCoins.map((e: any) => Coin.fromJSON(e)) : [] + }; + }, + toJSON(message: Gauge): unknown { + const obj: any = {}; + message.id !== undefined && (obj.id = (message.id || BigInt(0)).toString()); + message.isPerpetual !== undefined && (obj.isPerpetual = message.isPerpetual); + message.distributeTo !== undefined && (obj.distributeTo = message.distributeTo ? QueryCondition.toJSON(message.distributeTo) : undefined); + if (message.coins) { + obj.coins = message.coins.map(e => e ? Coin.toJSON(e) : undefined); + } else { + obj.coins = []; + } + message.startTime !== undefined && (obj.startTime = message.startTime.toISOString()); + message.numEpochsPaidOver !== undefined && (obj.numEpochsPaidOver = (message.numEpochsPaidOver || BigInt(0)).toString()); + message.filledEpochs !== undefined && (obj.filledEpochs = (message.filledEpochs || BigInt(0)).toString()); + if (message.distributedCoins) { + obj.distributedCoins = message.distributedCoins.map(e => e ? Coin.toJSON(e) : undefined); + } else { + obj.distributedCoins = []; + } + return obj; + }, fromPartial(object: Partial): Gauge { const message = createBaseGauge(); message.id = object.id !== undefined && object.id !== null ? BigInt(object.id.toString()) : BigInt(0); @@ -220,16 +263,28 @@ export const Gauge = { return message; }, fromAmino(object: GaugeAmino): Gauge { - return { - id: BigInt(object.id), - isPerpetual: object.is_perpetual, - distributeTo: object?.distribute_to ? QueryCondition.fromAmino(object.distribute_to) : undefined, - coins: Array.isArray(object?.coins) ? object.coins.map((e: any) => Coin.fromAmino(e)) : [], - startTime: object.start_time, - numEpochsPaidOver: BigInt(object.num_epochs_paid_over), - filledEpochs: BigInt(object.filled_epochs), - distributedCoins: Array.isArray(object?.distributed_coins) ? object.distributed_coins.map((e: any) => Coin.fromAmino(e)) : [] - }; + const message = createBaseGauge(); + if (object.id !== undefined && object.id !== null) { + message.id = BigInt(object.id); + } + if (object.is_perpetual !== undefined && object.is_perpetual !== null) { + message.isPerpetual = object.is_perpetual; + } + if (object.distribute_to !== undefined && object.distribute_to !== null) { + message.distributeTo = QueryCondition.fromAmino(object.distribute_to); + } + message.coins = object.coins?.map(e => Coin.fromAmino(e)) || []; + if (object.start_time !== undefined && object.start_time !== null) { + message.startTime = fromTimestamp(Timestamp.fromAmino(object.start_time)); + } + if (object.num_epochs_paid_over !== undefined && object.num_epochs_paid_over !== null) { + message.numEpochsPaidOver = BigInt(object.num_epochs_paid_over); + } + if (object.filled_epochs !== undefined && object.filled_epochs !== null) { + message.filledEpochs = BigInt(object.filled_epochs); + } + message.distributedCoins = object.distributed_coins?.map(e => Coin.fromAmino(e)) || []; + return message; }, toAmino(message: Gauge): GaugeAmino { const obj: any = {}; @@ -241,7 +296,7 @@ export const Gauge = { } else { obj.coins = []; } - obj.start_time = message.startTime; + obj.start_time = message.startTime ? Timestamp.toAmino(toTimestamp(message.startTime)) : undefined; obj.num_epochs_paid_over = message.numEpochsPaidOver ? message.numEpochsPaidOver.toString() : undefined; obj.filled_epochs = message.filledEpochs ? message.filledEpochs.toString() : undefined; if (message.distributedCoins) { @@ -273,6 +328,8 @@ export const Gauge = { }; } }; +GlobalDecoderRegistry.register(Gauge.typeUrl, Gauge); +GlobalDecoderRegistry.registerAminoProtoMapping(Gauge.aminoType, Gauge.typeUrl); function createBaseLockableDurationsInfo(): LockableDurationsInfo { return { lockableDurations: [] @@ -280,6 +337,16 @@ function createBaseLockableDurationsInfo(): LockableDurationsInfo { } export const LockableDurationsInfo = { typeUrl: "/osmosis.incentives.LockableDurationsInfo", + aminoType: "osmosis/incentives/lockable-durations-info", + is(o: any): o is LockableDurationsInfo { + return o && (o.$typeUrl === LockableDurationsInfo.typeUrl || Array.isArray(o.lockableDurations) && (!o.lockableDurations.length || Duration.is(o.lockableDurations[0]))); + }, + isSDK(o: any): o is LockableDurationsInfoSDKType { + return o && (o.$typeUrl === LockableDurationsInfo.typeUrl || Array.isArray(o.lockable_durations) && (!o.lockable_durations.length || Duration.isSDK(o.lockable_durations[0]))); + }, + isAmino(o: any): o is LockableDurationsInfoAmino { + return o && (o.$typeUrl === LockableDurationsInfo.typeUrl || Array.isArray(o.lockable_durations) && (!o.lockable_durations.length || Duration.isAmino(o.lockable_durations[0]))); + }, encode(message: LockableDurationsInfo, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.lockableDurations) { Duration.encode(v!, writer.uint32(10).fork()).ldelim(); @@ -303,15 +370,29 @@ export const LockableDurationsInfo = { } return message; }, + fromJSON(object: any): LockableDurationsInfo { + return { + lockableDurations: Array.isArray(object?.lockableDurations) ? object.lockableDurations.map((e: any) => Duration.fromJSON(e)) : [] + }; + }, + toJSON(message: LockableDurationsInfo): unknown { + const obj: any = {}; + if (message.lockableDurations) { + obj.lockableDurations = message.lockableDurations.map(e => e ? Duration.toJSON(e) : undefined); + } else { + obj.lockableDurations = []; + } + return obj; + }, fromPartial(object: Partial): LockableDurationsInfo { const message = createBaseLockableDurationsInfo(); message.lockableDurations = object.lockableDurations?.map(e => Duration.fromPartial(e)) || []; return message; }, fromAmino(object: LockableDurationsInfoAmino): LockableDurationsInfo { - return { - lockableDurations: Array.isArray(object?.lockable_durations) ? object.lockable_durations.map((e: any) => Duration.fromAmino(e)) : [] - }; + const message = createBaseLockableDurationsInfo(); + message.lockableDurations = object.lockable_durations?.map(e => Duration.fromAmino(e)) || []; + return message; }, toAmino(message: LockableDurationsInfo): LockableDurationsInfoAmino { const obj: any = {}; @@ -343,4 +424,6 @@ export const LockableDurationsInfo = { value: LockableDurationsInfo.encode(message).finish() }; } -}; \ No newline at end of file +}; +GlobalDecoderRegistry.register(LockableDurationsInfo.typeUrl, LockableDurationsInfo); +GlobalDecoderRegistry.registerAminoProtoMapping(LockableDurationsInfo.aminoType, LockableDurationsInfo.typeUrl); \ No newline at end of file diff --git a/packages/osmojs/src/codegen/osmosis/incentives/genesis.ts b/packages/osmojs/src/codegen/osmosis/incentives/genesis.ts index be9104bb9..5ba3d6a0b 100644 --- a/packages/osmojs/src/codegen/osmosis/incentives/genesis.ts +++ b/packages/osmojs/src/codegen/osmosis/incentives/genesis.ts @@ -1,7 +1,10 @@ import { Params, ParamsAmino, ParamsSDKType } from "./params"; import { Gauge, GaugeAmino, GaugeSDKType } from "./gauge"; import { Duration, DurationAmino, DurationSDKType } from "../../google/protobuf/duration"; +import { Group, GroupAmino, GroupSDKType } from "./group"; import { BinaryReader, BinaryWriter } from "../../binary"; +import { isSet } from "../../helpers"; +import { GlobalDecoderRegistry } from "../../registry"; /** * GenesisState defines the incentives module's various parameters when first * initialized @@ -9,11 +12,14 @@ import { BinaryReader, BinaryWriter } from "../../binary"; export interface GenesisState { /** params are all the parameters of the module */ params: Params; - /** gauges are all gauges that should exist at genesis */ + /** + * gauges are all gauges (not including group gauges) that should exist at + * genesis + */ gauges: Gauge[]; /** * lockable_durations are all lockup durations that gauges can be locked for - * in order to recieve incentives + * in order to receive incentives */ lockableDurations: Duration[]; /** @@ -21,6 +27,10 @@ export interface GenesisState { * the next gauge after genesis */ lastGaugeId: bigint; + /** gauges are all group gauges that should exist at genesis */ + groupGauges: Gauge[]; + /** groups are all the groups that should exist at genesis */ + groups: Group[]; } export interface GenesisStateProtoMsg { typeUrl: "/osmosis.incentives.GenesisState"; @@ -33,18 +43,25 @@ export interface GenesisStateProtoMsg { export interface GenesisStateAmino { /** params are all the parameters of the module */ params?: ParamsAmino; - /** gauges are all gauges that should exist at genesis */ - gauges: GaugeAmino[]; + /** + * gauges are all gauges (not including group gauges) that should exist at + * genesis + */ + gauges?: GaugeAmino[]; /** * lockable_durations are all lockup durations that gauges can be locked for - * in order to recieve incentives + * in order to receive incentives */ - lockable_durations: DurationAmino[]; + lockable_durations?: DurationAmino[]; /** * last_gauge_id is what the gauge number will increment from when creating * the next gauge after genesis */ - last_gauge_id: string; + last_gauge_id?: string; + /** gauges are all group gauges that should exist at genesis */ + group_gauges?: GaugeAmino[]; + /** groups are all the groups that should exist at genesis */ + groups?: GroupAmino[]; } export interface GenesisStateAminoMsg { type: "osmosis/incentives/genesis-state"; @@ -59,17 +76,31 @@ export interface GenesisStateSDKType { gauges: GaugeSDKType[]; lockable_durations: DurationSDKType[]; last_gauge_id: bigint; + group_gauges: GaugeSDKType[]; + groups: GroupSDKType[]; } function createBaseGenesisState(): GenesisState { return { params: Params.fromPartial({}), gauges: [], lockableDurations: [], - lastGaugeId: BigInt(0) + lastGaugeId: BigInt(0), + groupGauges: [], + groups: [] }; } export const GenesisState = { typeUrl: "/osmosis.incentives.GenesisState", + aminoType: "osmosis/incentives/genesis-state", + is(o: any): o is GenesisState { + return o && (o.$typeUrl === GenesisState.typeUrl || Params.is(o.params) && Array.isArray(o.gauges) && (!o.gauges.length || Gauge.is(o.gauges[0])) && Array.isArray(o.lockableDurations) && (!o.lockableDurations.length || Duration.is(o.lockableDurations[0])) && typeof o.lastGaugeId === "bigint" && Array.isArray(o.groupGauges) && (!o.groupGauges.length || Gauge.is(o.groupGauges[0])) && Array.isArray(o.groups) && (!o.groups.length || Group.is(o.groups[0]))); + }, + isSDK(o: any): o is GenesisStateSDKType { + return o && (o.$typeUrl === GenesisState.typeUrl || Params.isSDK(o.params) && Array.isArray(o.gauges) && (!o.gauges.length || Gauge.isSDK(o.gauges[0])) && Array.isArray(o.lockable_durations) && (!o.lockable_durations.length || Duration.isSDK(o.lockable_durations[0])) && typeof o.last_gauge_id === "bigint" && Array.isArray(o.group_gauges) && (!o.group_gauges.length || Gauge.isSDK(o.group_gauges[0])) && Array.isArray(o.groups) && (!o.groups.length || Group.isSDK(o.groups[0]))); + }, + isAmino(o: any): o is GenesisStateAmino { + return o && (o.$typeUrl === GenesisState.typeUrl || Params.isAmino(o.params) && Array.isArray(o.gauges) && (!o.gauges.length || Gauge.isAmino(o.gauges[0])) && Array.isArray(o.lockable_durations) && (!o.lockable_durations.length || Duration.isAmino(o.lockable_durations[0])) && typeof o.last_gauge_id === "bigint" && Array.isArray(o.group_gauges) && (!o.group_gauges.length || Gauge.isAmino(o.group_gauges[0])) && Array.isArray(o.groups) && (!o.groups.length || Group.isAmino(o.groups[0]))); + }, encode(message: GenesisState, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.params !== undefined) { Params.encode(message.params, writer.uint32(10).fork()).ldelim(); @@ -83,6 +114,12 @@ export const GenesisState = { if (message.lastGaugeId !== BigInt(0)) { writer.uint32(32).uint64(message.lastGaugeId); } + for (const v of message.groupGauges) { + Gauge.encode(v!, writer.uint32(42).fork()).ldelim(); + } + for (const v of message.groups) { + Group.encode(v!, writer.uint32(50).fork()).ldelim(); + } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): GenesisState { @@ -104,6 +141,12 @@ export const GenesisState = { case 4: message.lastGaugeId = reader.uint64(); break; + case 5: + message.groupGauges.push(Gauge.decode(reader, reader.uint32())); + break; + case 6: + message.groups.push(Group.decode(reader, reader.uint32())); + break; default: reader.skipType(tag & 7); break; @@ -111,21 +154,65 @@ export const GenesisState = { } return message; }, + fromJSON(object: any): GenesisState { + return { + params: isSet(object.params) ? Params.fromJSON(object.params) : undefined, + gauges: Array.isArray(object?.gauges) ? object.gauges.map((e: any) => Gauge.fromJSON(e)) : [], + lockableDurations: Array.isArray(object?.lockableDurations) ? object.lockableDurations.map((e: any) => Duration.fromJSON(e)) : [], + lastGaugeId: isSet(object.lastGaugeId) ? BigInt(object.lastGaugeId.toString()) : BigInt(0), + groupGauges: Array.isArray(object?.groupGauges) ? object.groupGauges.map((e: any) => Gauge.fromJSON(e)) : [], + groups: Array.isArray(object?.groups) ? object.groups.map((e: any) => Group.fromJSON(e)) : [] + }; + }, + toJSON(message: GenesisState): unknown { + const obj: any = {}; + message.params !== undefined && (obj.params = message.params ? Params.toJSON(message.params) : undefined); + if (message.gauges) { + obj.gauges = message.gauges.map(e => e ? Gauge.toJSON(e) : undefined); + } else { + obj.gauges = []; + } + if (message.lockableDurations) { + obj.lockableDurations = message.lockableDurations.map(e => e ? Duration.toJSON(e) : undefined); + } else { + obj.lockableDurations = []; + } + message.lastGaugeId !== undefined && (obj.lastGaugeId = (message.lastGaugeId || BigInt(0)).toString()); + if (message.groupGauges) { + obj.groupGauges = message.groupGauges.map(e => e ? Gauge.toJSON(e) : undefined); + } else { + obj.groupGauges = []; + } + if (message.groups) { + obj.groups = message.groups.map(e => e ? Group.toJSON(e) : undefined); + } else { + obj.groups = []; + } + return obj; + }, fromPartial(object: Partial): GenesisState { const message = createBaseGenesisState(); message.params = object.params !== undefined && object.params !== null ? Params.fromPartial(object.params) : undefined; message.gauges = object.gauges?.map(e => Gauge.fromPartial(e)) || []; message.lockableDurations = object.lockableDurations?.map(e => Duration.fromPartial(e)) || []; message.lastGaugeId = object.lastGaugeId !== undefined && object.lastGaugeId !== null ? BigInt(object.lastGaugeId.toString()) : BigInt(0); + message.groupGauges = object.groupGauges?.map(e => Gauge.fromPartial(e)) || []; + message.groups = object.groups?.map(e => Group.fromPartial(e)) || []; return message; }, fromAmino(object: GenesisStateAmino): GenesisState { - return { - params: object?.params ? Params.fromAmino(object.params) : undefined, - gauges: Array.isArray(object?.gauges) ? object.gauges.map((e: any) => Gauge.fromAmino(e)) : [], - lockableDurations: Array.isArray(object?.lockable_durations) ? object.lockable_durations.map((e: any) => Duration.fromAmino(e)) : [], - lastGaugeId: BigInt(object.last_gauge_id) - }; + const message = createBaseGenesisState(); + if (object.params !== undefined && object.params !== null) { + message.params = Params.fromAmino(object.params); + } + message.gauges = object.gauges?.map(e => Gauge.fromAmino(e)) || []; + message.lockableDurations = object.lockable_durations?.map(e => Duration.fromAmino(e)) || []; + if (object.last_gauge_id !== undefined && object.last_gauge_id !== null) { + message.lastGaugeId = BigInt(object.last_gauge_id); + } + message.groupGauges = object.group_gauges?.map(e => Gauge.fromAmino(e)) || []; + message.groups = object.groups?.map(e => Group.fromAmino(e)) || []; + return message; }, toAmino(message: GenesisState): GenesisStateAmino { const obj: any = {}; @@ -141,6 +228,16 @@ export const GenesisState = { obj.lockable_durations = []; } obj.last_gauge_id = message.lastGaugeId ? message.lastGaugeId.toString() : undefined; + if (message.groupGauges) { + obj.group_gauges = message.groupGauges.map(e => e ? Gauge.toAmino(e) : undefined); + } else { + obj.group_gauges = []; + } + if (message.groups) { + obj.groups = message.groups.map(e => e ? Group.toAmino(e) : undefined); + } else { + obj.groups = []; + } return obj; }, fromAminoMsg(object: GenesisStateAminoMsg): GenesisState { @@ -164,4 +261,6 @@ export const GenesisState = { value: GenesisState.encode(message).finish() }; } -}; \ No newline at end of file +}; +GlobalDecoderRegistry.register(GenesisState.typeUrl, GenesisState); +GlobalDecoderRegistry.registerAminoProtoMapping(GenesisState.aminoType, GenesisState.typeUrl); \ No newline at end of file diff --git a/packages/osmojs/src/codegen/osmosis/incentives/gov.ts b/packages/osmojs/src/codegen/osmosis/incentives/gov.ts new file mode 100644 index 000000000..b5cb59592 --- /dev/null +++ b/packages/osmojs/src/codegen/osmosis/incentives/gov.ts @@ -0,0 +1,167 @@ +import { CreateGroup, CreateGroupAmino, CreateGroupSDKType } from "./group"; +import { BinaryReader, BinaryWriter } from "../../binary"; +import { isSet } from "../../helpers"; +import { GlobalDecoderRegistry } from "../../registry"; +/** + * CreateGroupsProposal is a type for creating one or more groups via + * governance. This is useful for creating groups without having to pay + * creation fees. + */ +export interface CreateGroupsProposal { + title: string; + description: string; + createGroups: CreateGroup[]; +} +export interface CreateGroupsProposalProtoMsg { + typeUrl: "/osmosis.incentives.CreateGroupsProposal"; + value: Uint8Array; +} +/** + * CreateGroupsProposal is a type for creating one or more groups via + * governance. This is useful for creating groups without having to pay + * creation fees. + */ +export interface CreateGroupsProposalAmino { + title?: string; + description?: string; + create_groups?: CreateGroupAmino[]; +} +export interface CreateGroupsProposalAminoMsg { + type: "osmosis/incentives/create-groups-proposal"; + value: CreateGroupsProposalAmino; +} +/** + * CreateGroupsProposal is a type for creating one or more groups via + * governance. This is useful for creating groups without having to pay + * creation fees. + */ +export interface CreateGroupsProposalSDKType { + title: string; + description: string; + create_groups: CreateGroupSDKType[]; +} +function createBaseCreateGroupsProposal(): CreateGroupsProposal { + return { + title: "", + description: "", + createGroups: [] + }; +} +export const CreateGroupsProposal = { + typeUrl: "/osmosis.incentives.CreateGroupsProposal", + aminoType: "osmosis/incentives/create-groups-proposal", + is(o: any): o is CreateGroupsProposal { + return o && (o.$typeUrl === CreateGroupsProposal.typeUrl || typeof o.title === "string" && typeof o.description === "string" && Array.isArray(o.createGroups) && (!o.createGroups.length || CreateGroup.is(o.createGroups[0]))); + }, + isSDK(o: any): o is CreateGroupsProposalSDKType { + return o && (o.$typeUrl === CreateGroupsProposal.typeUrl || typeof o.title === "string" && typeof o.description === "string" && Array.isArray(o.create_groups) && (!o.create_groups.length || CreateGroup.isSDK(o.create_groups[0]))); + }, + isAmino(o: any): o is CreateGroupsProposalAmino { + return o && (o.$typeUrl === CreateGroupsProposal.typeUrl || typeof o.title === "string" && typeof o.description === "string" && Array.isArray(o.create_groups) && (!o.create_groups.length || CreateGroup.isAmino(o.create_groups[0]))); + }, + encode(message: CreateGroupsProposal, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.title !== "") { + writer.uint32(10).string(message.title); + } + if (message.description !== "") { + writer.uint32(18).string(message.description); + } + for (const v of message.createGroups) { + CreateGroup.encode(v!, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): CreateGroupsProposal { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseCreateGroupsProposal(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.title = reader.string(); + break; + case 2: + message.description = reader.string(); + break; + case 3: + message.createGroups.push(CreateGroup.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): CreateGroupsProposal { + return { + title: isSet(object.title) ? String(object.title) : "", + description: isSet(object.description) ? String(object.description) : "", + createGroups: Array.isArray(object?.createGroups) ? object.createGroups.map((e: any) => CreateGroup.fromJSON(e)) : [] + }; + }, + toJSON(message: CreateGroupsProposal): unknown { + const obj: any = {}; + message.title !== undefined && (obj.title = message.title); + message.description !== undefined && (obj.description = message.description); + if (message.createGroups) { + obj.createGroups = message.createGroups.map(e => e ? CreateGroup.toJSON(e) : undefined); + } else { + obj.createGroups = []; + } + return obj; + }, + fromPartial(object: Partial): CreateGroupsProposal { + const message = createBaseCreateGroupsProposal(); + message.title = object.title ?? ""; + message.description = object.description ?? ""; + message.createGroups = object.createGroups?.map(e => CreateGroup.fromPartial(e)) || []; + return message; + }, + fromAmino(object: CreateGroupsProposalAmino): CreateGroupsProposal { + const message = createBaseCreateGroupsProposal(); + if (object.title !== undefined && object.title !== null) { + message.title = object.title; + } + if (object.description !== undefined && object.description !== null) { + message.description = object.description; + } + message.createGroups = object.create_groups?.map(e => CreateGroup.fromAmino(e)) || []; + return message; + }, + toAmino(message: CreateGroupsProposal): CreateGroupsProposalAmino { + const obj: any = {}; + obj.title = message.title; + obj.description = message.description; + if (message.createGroups) { + obj.create_groups = message.createGroups.map(e => e ? CreateGroup.toAmino(e) : undefined); + } else { + obj.create_groups = []; + } + return obj; + }, + fromAminoMsg(object: CreateGroupsProposalAminoMsg): CreateGroupsProposal { + return CreateGroupsProposal.fromAmino(object.value); + }, + toAminoMsg(message: CreateGroupsProposal): CreateGroupsProposalAminoMsg { + return { + type: "osmosis/incentives/create-groups-proposal", + value: CreateGroupsProposal.toAmino(message) + }; + }, + fromProtoMsg(message: CreateGroupsProposalProtoMsg): CreateGroupsProposal { + return CreateGroupsProposal.decode(message.value); + }, + toProto(message: CreateGroupsProposal): Uint8Array { + return CreateGroupsProposal.encode(message).finish(); + }, + toProtoMsg(message: CreateGroupsProposal): CreateGroupsProposalProtoMsg { + return { + typeUrl: "/osmosis.incentives.CreateGroupsProposal", + value: CreateGroupsProposal.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(CreateGroupsProposal.typeUrl, CreateGroupsProposal); +GlobalDecoderRegistry.registerAminoProtoMapping(CreateGroupsProposal.aminoType, CreateGroupsProposal.typeUrl); \ No newline at end of file diff --git a/packages/osmojs/src/codegen/osmosis/incentives/group.ts b/packages/osmojs/src/codegen/osmosis/incentives/group.ts new file mode 100644 index 000000000..98db17d26 --- /dev/null +++ b/packages/osmojs/src/codegen/osmosis/incentives/group.ts @@ -0,0 +1,788 @@ +import { Gauge, GaugeAmino, GaugeSDKType } from "./gauge"; +import { BinaryReader, BinaryWriter } from "../../binary"; +import { isSet } from "../../helpers"; +import { GlobalDecoderRegistry } from "../../registry"; +/** SplittingPolicy determines the way we want to split incentives in groupGauges */ +export enum SplittingPolicy { + ByVolume = 0, + UNRECOGNIZED = -1, +} +export const SplittingPolicySDKType = SplittingPolicy; +export const SplittingPolicyAmino = SplittingPolicy; +export function splittingPolicyFromJSON(object: any): SplittingPolicy { + switch (object) { + case 0: + case "ByVolume": + return SplittingPolicy.ByVolume; + case -1: + case "UNRECOGNIZED": + default: + return SplittingPolicy.UNRECOGNIZED; + } +} +export function splittingPolicyToJSON(object: SplittingPolicy): string { + switch (object) { + case SplittingPolicy.ByVolume: + return "ByVolume"; + case SplittingPolicy.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} +/** + * Note that while both InternalGaugeInfo and InternalGaugeRecord could + * technically be replaced by DistrInfo and DistrRecord from the pool-incentives + * module, we create separate types here to keep our abstractions clean and + * readable (pool-incentives distribution abstractions are used in a very + * specific way that does not directly relate to gauge logic). This also helps + * us sidestep a refactor to avoid an import cycle. + */ +export interface InternalGaugeInfo { + totalWeight: string; + gaugeRecords: InternalGaugeRecord[]; +} +export interface InternalGaugeInfoProtoMsg { + typeUrl: "/osmosis.incentives.InternalGaugeInfo"; + value: Uint8Array; +} +/** + * Note that while both InternalGaugeInfo and InternalGaugeRecord could + * technically be replaced by DistrInfo and DistrRecord from the pool-incentives + * module, we create separate types here to keep our abstractions clean and + * readable (pool-incentives distribution abstractions are used in a very + * specific way that does not directly relate to gauge logic). This also helps + * us sidestep a refactor to avoid an import cycle. + */ +export interface InternalGaugeInfoAmino { + total_weight?: string; + gauge_records?: InternalGaugeRecordAmino[]; +} +export interface InternalGaugeInfoAminoMsg { + type: "osmosis/incentives/internal-gauge-info"; + value: InternalGaugeInfoAmino; +} +/** + * Note that while both InternalGaugeInfo and InternalGaugeRecord could + * technically be replaced by DistrInfo and DistrRecord from the pool-incentives + * module, we create separate types here to keep our abstractions clean and + * readable (pool-incentives distribution abstractions are used in a very + * specific way that does not directly relate to gauge logic). This also helps + * us sidestep a refactor to avoid an import cycle. + */ +export interface InternalGaugeInfoSDKType { + total_weight: string; + gauge_records: InternalGaugeRecordSDKType[]; +} +export interface InternalGaugeRecord { + gaugeId: bigint; + /** + * CurrentWeight is the current weight of this gauge being distributed to for + * this epoch. For instance, for volume splitting policy, this stores the + * volume generated in the last epoch of the linked pool. + */ + currentWeight: string; + /** + * CumulativeWeight serves as a snapshot of the accumulator being tracked + * based on splitting policy. For instance, for volume splitting policy, this + * stores the cumulative volume for the linked pool at time of last update. + */ + cumulativeWeight: string; +} +export interface InternalGaugeRecordProtoMsg { + typeUrl: "/osmosis.incentives.InternalGaugeRecord"; + value: Uint8Array; +} +export interface InternalGaugeRecordAmino { + gauge_id?: string; + /** + * CurrentWeight is the current weight of this gauge being distributed to for + * this epoch. For instance, for volume splitting policy, this stores the + * volume generated in the last epoch of the linked pool. + */ + current_weight?: string; + /** + * CumulativeWeight serves as a snapshot of the accumulator being tracked + * based on splitting policy. For instance, for volume splitting policy, this + * stores the cumulative volume for the linked pool at time of last update. + */ + cumulative_weight?: string; +} +export interface InternalGaugeRecordAminoMsg { + type: "osmosis/incentives/internal-gauge-record"; + value: InternalGaugeRecordAmino; +} +export interface InternalGaugeRecordSDKType { + gauge_id: bigint; + current_weight: string; + cumulative_weight: string; +} +/** + * Group is an object that stores a 1:1 mapped gauge ID, a list of pool gauge + * info, and a splitting policy. These are grouped into a single abstraction to + * allow for distribution of group incentives to internal gauges according to + * the specified splitting policy. + */ +export interface Group { + groupGaugeId: bigint; + internalGaugeInfo: InternalGaugeInfo; + splittingPolicy: SplittingPolicy; +} +export interface GroupProtoMsg { + typeUrl: "/osmosis.incentives.Group"; + value: Uint8Array; +} +/** + * Group is an object that stores a 1:1 mapped gauge ID, a list of pool gauge + * info, and a splitting policy. These are grouped into a single abstraction to + * allow for distribution of group incentives to internal gauges according to + * the specified splitting policy. + */ +export interface GroupAmino { + group_gauge_id?: string; + internal_gauge_info?: InternalGaugeInfoAmino; + splitting_policy?: SplittingPolicy; +} +export interface GroupAminoMsg { + type: "osmosis/incentives/group"; + value: GroupAmino; +} +/** + * Group is an object that stores a 1:1 mapped gauge ID, a list of pool gauge + * info, and a splitting policy. These are grouped into a single abstraction to + * allow for distribution of group incentives to internal gauges according to + * the specified splitting policy. + */ +export interface GroupSDKType { + group_gauge_id: bigint; + internal_gauge_info: InternalGaugeInfoSDKType; + splitting_policy: SplittingPolicy; +} +/** + * CreateGroup is called via governance to create a new group. + * It takes an array of pool IDs to split the incentives across. + */ +export interface CreateGroup { + /** + * CreateGroup is called via governance to create a new group. + * It takes an array of pool IDs to split the incentives across. + */ + poolIds: bigint[]; +} +export interface CreateGroupProtoMsg { + typeUrl: "/osmosis.incentives.CreateGroup"; + value: Uint8Array; +} +/** + * CreateGroup is called via governance to create a new group. + * It takes an array of pool IDs to split the incentives across. + */ +export interface CreateGroupAmino { + /** + * CreateGroup is called via governance to create a new group. + * It takes an array of pool IDs to split the incentives across. + */ + pool_ids?: string[]; +} +export interface CreateGroupAminoMsg { + type: "osmosis/incentives/create-group"; + value: CreateGroupAmino; +} +/** + * CreateGroup is called via governance to create a new group. + * It takes an array of pool IDs to split the incentives across. + */ +export interface CreateGroupSDKType { + pool_ids: bigint[]; +} +/** + * GroupsWithGauge is a helper struct that stores a group and its + * associated gauge. + */ +export interface GroupsWithGauge { + group: Group; + gauge: Gauge; +} +export interface GroupsWithGaugeProtoMsg { + typeUrl: "/osmosis.incentives.GroupsWithGauge"; + value: Uint8Array; +} +/** + * GroupsWithGauge is a helper struct that stores a group and its + * associated gauge. + */ +export interface GroupsWithGaugeAmino { + group?: GroupAmino; + gauge?: GaugeAmino; +} +export interface GroupsWithGaugeAminoMsg { + type: "osmosis/incentives/groups-with-gauge"; + value: GroupsWithGaugeAmino; +} +/** + * GroupsWithGauge is a helper struct that stores a group and its + * associated gauge. + */ +export interface GroupsWithGaugeSDKType { + group: GroupSDKType; + gauge: GaugeSDKType; +} +function createBaseInternalGaugeInfo(): InternalGaugeInfo { + return { + totalWeight: "", + gaugeRecords: [] + }; +} +export const InternalGaugeInfo = { + typeUrl: "/osmosis.incentives.InternalGaugeInfo", + aminoType: "osmosis/incentives/internal-gauge-info", + is(o: any): o is InternalGaugeInfo { + return o && (o.$typeUrl === InternalGaugeInfo.typeUrl || typeof o.totalWeight === "string" && Array.isArray(o.gaugeRecords) && (!o.gaugeRecords.length || InternalGaugeRecord.is(o.gaugeRecords[0]))); + }, + isSDK(o: any): o is InternalGaugeInfoSDKType { + return o && (o.$typeUrl === InternalGaugeInfo.typeUrl || typeof o.total_weight === "string" && Array.isArray(o.gauge_records) && (!o.gauge_records.length || InternalGaugeRecord.isSDK(o.gauge_records[0]))); + }, + isAmino(o: any): o is InternalGaugeInfoAmino { + return o && (o.$typeUrl === InternalGaugeInfo.typeUrl || typeof o.total_weight === "string" && Array.isArray(o.gauge_records) && (!o.gauge_records.length || InternalGaugeRecord.isAmino(o.gauge_records[0]))); + }, + encode(message: InternalGaugeInfo, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.totalWeight !== "") { + writer.uint32(10).string(message.totalWeight); + } + for (const v of message.gaugeRecords) { + InternalGaugeRecord.encode(v!, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): InternalGaugeInfo { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseInternalGaugeInfo(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.totalWeight = reader.string(); + break; + case 2: + message.gaugeRecords.push(InternalGaugeRecord.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): InternalGaugeInfo { + return { + totalWeight: isSet(object.totalWeight) ? String(object.totalWeight) : "", + gaugeRecords: Array.isArray(object?.gaugeRecords) ? object.gaugeRecords.map((e: any) => InternalGaugeRecord.fromJSON(e)) : [] + }; + }, + toJSON(message: InternalGaugeInfo): unknown { + const obj: any = {}; + message.totalWeight !== undefined && (obj.totalWeight = message.totalWeight); + if (message.gaugeRecords) { + obj.gaugeRecords = message.gaugeRecords.map(e => e ? InternalGaugeRecord.toJSON(e) : undefined); + } else { + obj.gaugeRecords = []; + } + return obj; + }, + fromPartial(object: Partial): InternalGaugeInfo { + const message = createBaseInternalGaugeInfo(); + message.totalWeight = object.totalWeight ?? ""; + message.gaugeRecords = object.gaugeRecords?.map(e => InternalGaugeRecord.fromPartial(e)) || []; + return message; + }, + fromAmino(object: InternalGaugeInfoAmino): InternalGaugeInfo { + const message = createBaseInternalGaugeInfo(); + if (object.total_weight !== undefined && object.total_weight !== null) { + message.totalWeight = object.total_weight; + } + message.gaugeRecords = object.gauge_records?.map(e => InternalGaugeRecord.fromAmino(e)) || []; + return message; + }, + toAmino(message: InternalGaugeInfo): InternalGaugeInfoAmino { + const obj: any = {}; + obj.total_weight = message.totalWeight; + if (message.gaugeRecords) { + obj.gauge_records = message.gaugeRecords.map(e => e ? InternalGaugeRecord.toAmino(e) : undefined); + } else { + obj.gauge_records = []; + } + return obj; + }, + fromAminoMsg(object: InternalGaugeInfoAminoMsg): InternalGaugeInfo { + return InternalGaugeInfo.fromAmino(object.value); + }, + toAminoMsg(message: InternalGaugeInfo): InternalGaugeInfoAminoMsg { + return { + type: "osmosis/incentives/internal-gauge-info", + value: InternalGaugeInfo.toAmino(message) + }; + }, + fromProtoMsg(message: InternalGaugeInfoProtoMsg): InternalGaugeInfo { + return InternalGaugeInfo.decode(message.value); + }, + toProto(message: InternalGaugeInfo): Uint8Array { + return InternalGaugeInfo.encode(message).finish(); + }, + toProtoMsg(message: InternalGaugeInfo): InternalGaugeInfoProtoMsg { + return { + typeUrl: "/osmosis.incentives.InternalGaugeInfo", + value: InternalGaugeInfo.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(InternalGaugeInfo.typeUrl, InternalGaugeInfo); +GlobalDecoderRegistry.registerAminoProtoMapping(InternalGaugeInfo.aminoType, InternalGaugeInfo.typeUrl); +function createBaseInternalGaugeRecord(): InternalGaugeRecord { + return { + gaugeId: BigInt(0), + currentWeight: "", + cumulativeWeight: "" + }; +} +export const InternalGaugeRecord = { + typeUrl: "/osmosis.incentives.InternalGaugeRecord", + aminoType: "osmosis/incentives/internal-gauge-record", + is(o: any): o is InternalGaugeRecord { + return o && (o.$typeUrl === InternalGaugeRecord.typeUrl || typeof o.gaugeId === "bigint" && typeof o.currentWeight === "string" && typeof o.cumulativeWeight === "string"); + }, + isSDK(o: any): o is InternalGaugeRecordSDKType { + return o && (o.$typeUrl === InternalGaugeRecord.typeUrl || typeof o.gauge_id === "bigint" && typeof o.current_weight === "string" && typeof o.cumulative_weight === "string"); + }, + isAmino(o: any): o is InternalGaugeRecordAmino { + return o && (o.$typeUrl === InternalGaugeRecord.typeUrl || typeof o.gauge_id === "bigint" && typeof o.current_weight === "string" && typeof o.cumulative_weight === "string"); + }, + encode(message: InternalGaugeRecord, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.gaugeId !== BigInt(0)) { + writer.uint32(8).uint64(message.gaugeId); + } + if (message.currentWeight !== "") { + writer.uint32(18).string(message.currentWeight); + } + if (message.cumulativeWeight !== "") { + writer.uint32(26).string(message.cumulativeWeight); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): InternalGaugeRecord { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseInternalGaugeRecord(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.gaugeId = reader.uint64(); + break; + case 2: + message.currentWeight = reader.string(); + break; + case 3: + message.cumulativeWeight = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): InternalGaugeRecord { + return { + gaugeId: isSet(object.gaugeId) ? BigInt(object.gaugeId.toString()) : BigInt(0), + currentWeight: isSet(object.currentWeight) ? String(object.currentWeight) : "", + cumulativeWeight: isSet(object.cumulativeWeight) ? String(object.cumulativeWeight) : "" + }; + }, + toJSON(message: InternalGaugeRecord): unknown { + const obj: any = {}; + message.gaugeId !== undefined && (obj.gaugeId = (message.gaugeId || BigInt(0)).toString()); + message.currentWeight !== undefined && (obj.currentWeight = message.currentWeight); + message.cumulativeWeight !== undefined && (obj.cumulativeWeight = message.cumulativeWeight); + return obj; + }, + fromPartial(object: Partial): InternalGaugeRecord { + const message = createBaseInternalGaugeRecord(); + message.gaugeId = object.gaugeId !== undefined && object.gaugeId !== null ? BigInt(object.gaugeId.toString()) : BigInt(0); + message.currentWeight = object.currentWeight ?? ""; + message.cumulativeWeight = object.cumulativeWeight ?? ""; + return message; + }, + fromAmino(object: InternalGaugeRecordAmino): InternalGaugeRecord { + const message = createBaseInternalGaugeRecord(); + if (object.gauge_id !== undefined && object.gauge_id !== null) { + message.gaugeId = BigInt(object.gauge_id); + } + if (object.current_weight !== undefined && object.current_weight !== null) { + message.currentWeight = object.current_weight; + } + if (object.cumulative_weight !== undefined && object.cumulative_weight !== null) { + message.cumulativeWeight = object.cumulative_weight; + } + return message; + }, + toAmino(message: InternalGaugeRecord): InternalGaugeRecordAmino { + const obj: any = {}; + obj.gauge_id = message.gaugeId ? message.gaugeId.toString() : undefined; + obj.current_weight = message.currentWeight; + obj.cumulative_weight = message.cumulativeWeight; + return obj; + }, + fromAminoMsg(object: InternalGaugeRecordAminoMsg): InternalGaugeRecord { + return InternalGaugeRecord.fromAmino(object.value); + }, + toAminoMsg(message: InternalGaugeRecord): InternalGaugeRecordAminoMsg { + return { + type: "osmosis/incentives/internal-gauge-record", + value: InternalGaugeRecord.toAmino(message) + }; + }, + fromProtoMsg(message: InternalGaugeRecordProtoMsg): InternalGaugeRecord { + return InternalGaugeRecord.decode(message.value); + }, + toProto(message: InternalGaugeRecord): Uint8Array { + return InternalGaugeRecord.encode(message).finish(); + }, + toProtoMsg(message: InternalGaugeRecord): InternalGaugeRecordProtoMsg { + return { + typeUrl: "/osmosis.incentives.InternalGaugeRecord", + value: InternalGaugeRecord.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(InternalGaugeRecord.typeUrl, InternalGaugeRecord); +GlobalDecoderRegistry.registerAminoProtoMapping(InternalGaugeRecord.aminoType, InternalGaugeRecord.typeUrl); +function createBaseGroup(): Group { + return { + groupGaugeId: BigInt(0), + internalGaugeInfo: InternalGaugeInfo.fromPartial({}), + splittingPolicy: 0 + }; +} +export const Group = { + typeUrl: "/osmosis.incentives.Group", + aminoType: "osmosis/incentives/group", + is(o: any): o is Group { + return o && (o.$typeUrl === Group.typeUrl || typeof o.groupGaugeId === "bigint" && InternalGaugeInfo.is(o.internalGaugeInfo) && isSet(o.splittingPolicy)); + }, + isSDK(o: any): o is GroupSDKType { + return o && (o.$typeUrl === Group.typeUrl || typeof o.group_gauge_id === "bigint" && InternalGaugeInfo.isSDK(o.internal_gauge_info) && isSet(o.splitting_policy)); + }, + isAmino(o: any): o is GroupAmino { + return o && (o.$typeUrl === Group.typeUrl || typeof o.group_gauge_id === "bigint" && InternalGaugeInfo.isAmino(o.internal_gauge_info) && isSet(o.splitting_policy)); + }, + encode(message: Group, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.groupGaugeId !== BigInt(0)) { + writer.uint32(8).uint64(message.groupGaugeId); + } + if (message.internalGaugeInfo !== undefined) { + InternalGaugeInfo.encode(message.internalGaugeInfo, writer.uint32(18).fork()).ldelim(); + } + if (message.splittingPolicy !== 0) { + writer.uint32(24).int32(message.splittingPolicy); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): Group { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGroup(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.groupGaugeId = reader.uint64(); + break; + case 2: + message.internalGaugeInfo = InternalGaugeInfo.decode(reader, reader.uint32()); + break; + case 3: + message.splittingPolicy = (reader.int32() as any); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): Group { + return { + groupGaugeId: isSet(object.groupGaugeId) ? BigInt(object.groupGaugeId.toString()) : BigInt(0), + internalGaugeInfo: isSet(object.internalGaugeInfo) ? InternalGaugeInfo.fromJSON(object.internalGaugeInfo) : undefined, + splittingPolicy: isSet(object.splittingPolicy) ? splittingPolicyFromJSON(object.splittingPolicy) : -1 + }; + }, + toJSON(message: Group): unknown { + const obj: any = {}; + message.groupGaugeId !== undefined && (obj.groupGaugeId = (message.groupGaugeId || BigInt(0)).toString()); + message.internalGaugeInfo !== undefined && (obj.internalGaugeInfo = message.internalGaugeInfo ? InternalGaugeInfo.toJSON(message.internalGaugeInfo) : undefined); + message.splittingPolicy !== undefined && (obj.splittingPolicy = splittingPolicyToJSON(message.splittingPolicy)); + return obj; + }, + fromPartial(object: Partial): Group { + const message = createBaseGroup(); + message.groupGaugeId = object.groupGaugeId !== undefined && object.groupGaugeId !== null ? BigInt(object.groupGaugeId.toString()) : BigInt(0); + message.internalGaugeInfo = object.internalGaugeInfo !== undefined && object.internalGaugeInfo !== null ? InternalGaugeInfo.fromPartial(object.internalGaugeInfo) : undefined; + message.splittingPolicy = object.splittingPolicy ?? 0; + return message; + }, + fromAmino(object: GroupAmino): Group { + const message = createBaseGroup(); + if (object.group_gauge_id !== undefined && object.group_gauge_id !== null) { + message.groupGaugeId = BigInt(object.group_gauge_id); + } + if (object.internal_gauge_info !== undefined && object.internal_gauge_info !== null) { + message.internalGaugeInfo = InternalGaugeInfo.fromAmino(object.internal_gauge_info); + } + if (object.splitting_policy !== undefined && object.splitting_policy !== null) { + message.splittingPolicy = splittingPolicyFromJSON(object.splitting_policy); + } + return message; + }, + toAmino(message: Group): GroupAmino { + const obj: any = {}; + obj.group_gauge_id = message.groupGaugeId ? message.groupGaugeId.toString() : undefined; + obj.internal_gauge_info = message.internalGaugeInfo ? InternalGaugeInfo.toAmino(message.internalGaugeInfo) : undefined; + obj.splitting_policy = splittingPolicyToJSON(message.splittingPolicy); + return obj; + }, + fromAminoMsg(object: GroupAminoMsg): Group { + return Group.fromAmino(object.value); + }, + toAminoMsg(message: Group): GroupAminoMsg { + return { + type: "osmosis/incentives/group", + value: Group.toAmino(message) + }; + }, + fromProtoMsg(message: GroupProtoMsg): Group { + return Group.decode(message.value); + }, + toProto(message: Group): Uint8Array { + return Group.encode(message).finish(); + }, + toProtoMsg(message: Group): GroupProtoMsg { + return { + typeUrl: "/osmosis.incentives.Group", + value: Group.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(Group.typeUrl, Group); +GlobalDecoderRegistry.registerAminoProtoMapping(Group.aminoType, Group.typeUrl); +function createBaseCreateGroup(): CreateGroup { + return { + poolIds: [] + }; +} +export const CreateGroup = { + typeUrl: "/osmosis.incentives.CreateGroup", + aminoType: "osmosis/incentives/create-group", + is(o: any): o is CreateGroup { + return o && (o.$typeUrl === CreateGroup.typeUrl || Array.isArray(o.poolIds) && (!o.poolIds.length || typeof o.poolIds[0] === "bigint")); + }, + isSDK(o: any): o is CreateGroupSDKType { + return o && (o.$typeUrl === CreateGroup.typeUrl || Array.isArray(o.pool_ids) && (!o.pool_ids.length || typeof o.pool_ids[0] === "bigint")); + }, + isAmino(o: any): o is CreateGroupAmino { + return o && (o.$typeUrl === CreateGroup.typeUrl || Array.isArray(o.pool_ids) && (!o.pool_ids.length || typeof o.pool_ids[0] === "bigint")); + }, + encode(message: CreateGroup, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + writer.uint32(10).fork(); + for (const v of message.poolIds) { + writer.uint64(v); + } + writer.ldelim(); + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): CreateGroup { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseCreateGroup(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if ((tag & 7) === 2) { + const end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) { + message.poolIds.push(reader.uint64()); + } + } else { + message.poolIds.push(reader.uint64()); + } + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): CreateGroup { + return { + poolIds: Array.isArray(object?.poolIds) ? object.poolIds.map((e: any) => BigInt(e.toString())) : [] + }; + }, + toJSON(message: CreateGroup): unknown { + const obj: any = {}; + if (message.poolIds) { + obj.poolIds = message.poolIds.map(e => (e || BigInt(0)).toString()); + } else { + obj.poolIds = []; + } + return obj; + }, + fromPartial(object: Partial): CreateGroup { + const message = createBaseCreateGroup(); + message.poolIds = object.poolIds?.map(e => BigInt(e.toString())) || []; + return message; + }, + fromAmino(object: CreateGroupAmino): CreateGroup { + const message = createBaseCreateGroup(); + message.poolIds = object.pool_ids?.map(e => BigInt(e)) || []; + return message; + }, + toAmino(message: CreateGroup): CreateGroupAmino { + const obj: any = {}; + if (message.poolIds) { + obj.pool_ids = message.poolIds.map(e => e.toString()); + } else { + obj.pool_ids = []; + } + return obj; + }, + fromAminoMsg(object: CreateGroupAminoMsg): CreateGroup { + return CreateGroup.fromAmino(object.value); + }, + toAminoMsg(message: CreateGroup): CreateGroupAminoMsg { + return { + type: "osmosis/incentives/create-group", + value: CreateGroup.toAmino(message) + }; + }, + fromProtoMsg(message: CreateGroupProtoMsg): CreateGroup { + return CreateGroup.decode(message.value); + }, + toProto(message: CreateGroup): Uint8Array { + return CreateGroup.encode(message).finish(); + }, + toProtoMsg(message: CreateGroup): CreateGroupProtoMsg { + return { + typeUrl: "/osmosis.incentives.CreateGroup", + value: CreateGroup.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(CreateGroup.typeUrl, CreateGroup); +GlobalDecoderRegistry.registerAminoProtoMapping(CreateGroup.aminoType, CreateGroup.typeUrl); +function createBaseGroupsWithGauge(): GroupsWithGauge { + return { + group: Group.fromPartial({}), + gauge: Gauge.fromPartial({}) + }; +} +export const GroupsWithGauge = { + typeUrl: "/osmosis.incentives.GroupsWithGauge", + aminoType: "osmosis/incentives/groups-with-gauge", + is(o: any): o is GroupsWithGauge { + return o && (o.$typeUrl === GroupsWithGauge.typeUrl || Group.is(o.group) && Gauge.is(o.gauge)); + }, + isSDK(o: any): o is GroupsWithGaugeSDKType { + return o && (o.$typeUrl === GroupsWithGauge.typeUrl || Group.isSDK(o.group) && Gauge.isSDK(o.gauge)); + }, + isAmino(o: any): o is GroupsWithGaugeAmino { + return o && (o.$typeUrl === GroupsWithGauge.typeUrl || Group.isAmino(o.group) && Gauge.isAmino(o.gauge)); + }, + encode(message: GroupsWithGauge, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.group !== undefined) { + Group.encode(message.group, writer.uint32(10).fork()).ldelim(); + } + if (message.gauge !== undefined) { + Gauge.encode(message.gauge, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): GroupsWithGauge { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGroupsWithGauge(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.group = Group.decode(reader, reader.uint32()); + break; + case 2: + message.gauge = Gauge.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): GroupsWithGauge { + return { + group: isSet(object.group) ? Group.fromJSON(object.group) : undefined, + gauge: isSet(object.gauge) ? Gauge.fromJSON(object.gauge) : undefined + }; + }, + toJSON(message: GroupsWithGauge): unknown { + const obj: any = {}; + message.group !== undefined && (obj.group = message.group ? Group.toJSON(message.group) : undefined); + message.gauge !== undefined && (obj.gauge = message.gauge ? Gauge.toJSON(message.gauge) : undefined); + return obj; + }, + fromPartial(object: Partial): GroupsWithGauge { + const message = createBaseGroupsWithGauge(); + message.group = object.group !== undefined && object.group !== null ? Group.fromPartial(object.group) : undefined; + message.gauge = object.gauge !== undefined && object.gauge !== null ? Gauge.fromPartial(object.gauge) : undefined; + return message; + }, + fromAmino(object: GroupsWithGaugeAmino): GroupsWithGauge { + const message = createBaseGroupsWithGauge(); + if (object.group !== undefined && object.group !== null) { + message.group = Group.fromAmino(object.group); + } + if (object.gauge !== undefined && object.gauge !== null) { + message.gauge = Gauge.fromAmino(object.gauge); + } + return message; + }, + toAmino(message: GroupsWithGauge): GroupsWithGaugeAmino { + const obj: any = {}; + obj.group = message.group ? Group.toAmino(message.group) : undefined; + obj.gauge = message.gauge ? Gauge.toAmino(message.gauge) : undefined; + return obj; + }, + fromAminoMsg(object: GroupsWithGaugeAminoMsg): GroupsWithGauge { + return GroupsWithGauge.fromAmino(object.value); + }, + toAminoMsg(message: GroupsWithGauge): GroupsWithGaugeAminoMsg { + return { + type: "osmosis/incentives/groups-with-gauge", + value: GroupsWithGauge.toAmino(message) + }; + }, + fromProtoMsg(message: GroupsWithGaugeProtoMsg): GroupsWithGauge { + return GroupsWithGauge.decode(message.value); + }, + toProto(message: GroupsWithGauge): Uint8Array { + return GroupsWithGauge.encode(message).finish(); + }, + toProtoMsg(message: GroupsWithGauge): GroupsWithGaugeProtoMsg { + return { + typeUrl: "/osmosis.incentives.GroupsWithGauge", + value: GroupsWithGauge.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(GroupsWithGauge.typeUrl, GroupsWithGauge); +GlobalDecoderRegistry.registerAminoProtoMapping(GroupsWithGauge.aminoType, GroupsWithGauge.typeUrl); \ No newline at end of file diff --git a/packages/osmojs/src/codegen/osmosis/incentives/params.ts b/packages/osmojs/src/codegen/osmosis/incentives/params.ts index f029e23c5..d87f1aad7 100644 --- a/packages/osmojs/src/codegen/osmosis/incentives/params.ts +++ b/packages/osmojs/src/codegen/osmosis/incentives/params.ts @@ -1,4 +1,7 @@ +import { Coin, CoinAmino, CoinSDKType } from "../../cosmos/base/v1beta1/coin"; import { BinaryReader, BinaryWriter } from "../../binary"; +import { isSet } from "../../helpers"; +import { GlobalDecoderRegistry } from "../../registry"; /** Params holds parameters for the incentives module */ export interface Params { /** @@ -6,6 +9,23 @@ export interface Params { * (day, week, etc.) */ distrEpochIdentifier: string; + /** + * group_creation_fee is the fee required to create a new group + * It is only charged to all addresses other than incentive module account + * or addresses in the unrestricted_creator_whitelist + */ + groupCreationFee: Coin[]; + /** + * unrestricted_creator_whitelist is a list of addresses that are + * allowed to bypass restrictions on permissionless Group + * creation. In the future, we might expand these to creating gauges + * as well. + * The goal of this is to allow a subdao to manage incentives efficiently + * without being stopped by 5 day governance process or a high fee. + * At the same time, it prevents spam by having a fee for all + * other users. + */ + unrestrictedCreatorWhitelist: string[]; } export interface ParamsProtoMsg { typeUrl: "/osmosis.incentives.Params"; @@ -17,7 +37,24 @@ export interface ParamsAmino { * distr_epoch_identifier is what epoch type distribution will be triggered by * (day, week, etc.) */ - distr_epoch_identifier: string; + distr_epoch_identifier?: string; + /** + * group_creation_fee is the fee required to create a new group + * It is only charged to all addresses other than incentive module account + * or addresses in the unrestricted_creator_whitelist + */ + group_creation_fee?: CoinAmino[]; + /** + * unrestricted_creator_whitelist is a list of addresses that are + * allowed to bypass restrictions on permissionless Group + * creation. In the future, we might expand these to creating gauges + * as well. + * The goal of this is to allow a subdao to manage incentives efficiently + * without being stopped by 5 day governance process or a high fee. + * At the same time, it prevents spam by having a fee for all + * other users. + */ + unrestricted_creator_whitelist?: string[]; } export interface ParamsAminoMsg { type: "osmosis/incentives/params"; @@ -26,18 +63,38 @@ export interface ParamsAminoMsg { /** Params holds parameters for the incentives module */ export interface ParamsSDKType { distr_epoch_identifier: string; + group_creation_fee: CoinSDKType[]; + unrestricted_creator_whitelist: string[]; } function createBaseParams(): Params { return { - distrEpochIdentifier: "" + distrEpochIdentifier: "", + groupCreationFee: [], + unrestrictedCreatorWhitelist: [] }; } export const Params = { typeUrl: "/osmosis.incentives.Params", + aminoType: "osmosis/incentives/params", + is(o: any): o is Params { + return o && (o.$typeUrl === Params.typeUrl || typeof o.distrEpochIdentifier === "string" && Array.isArray(o.groupCreationFee) && (!o.groupCreationFee.length || Coin.is(o.groupCreationFee[0])) && Array.isArray(o.unrestrictedCreatorWhitelist) && (!o.unrestrictedCreatorWhitelist.length || typeof o.unrestrictedCreatorWhitelist[0] === "string")); + }, + isSDK(o: any): o is ParamsSDKType { + return o && (o.$typeUrl === Params.typeUrl || typeof o.distr_epoch_identifier === "string" && Array.isArray(o.group_creation_fee) && (!o.group_creation_fee.length || Coin.isSDK(o.group_creation_fee[0])) && Array.isArray(o.unrestricted_creator_whitelist) && (!o.unrestricted_creator_whitelist.length || typeof o.unrestricted_creator_whitelist[0] === "string")); + }, + isAmino(o: any): o is ParamsAmino { + return o && (o.$typeUrl === Params.typeUrl || typeof o.distr_epoch_identifier === "string" && Array.isArray(o.group_creation_fee) && (!o.group_creation_fee.length || Coin.isAmino(o.group_creation_fee[0])) && Array.isArray(o.unrestricted_creator_whitelist) && (!o.unrestricted_creator_whitelist.length || typeof o.unrestricted_creator_whitelist[0] === "string")); + }, encode(message: Params, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.distrEpochIdentifier !== "") { writer.uint32(10).string(message.distrEpochIdentifier); } + for (const v of message.groupCreationFee) { + Coin.encode(v!, writer.uint32(18).fork()).ldelim(); + } + for (const v of message.unrestrictedCreatorWhitelist) { + writer.uint32(26).string(v!); + } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): Params { @@ -50,6 +107,12 @@ export const Params = { case 1: message.distrEpochIdentifier = reader.string(); break; + case 2: + message.groupCreationFee.push(Coin.decode(reader, reader.uint32())); + break; + case 3: + message.unrestrictedCreatorWhitelist.push(reader.string()); + break; default: reader.skipType(tag & 7); break; @@ -57,19 +120,57 @@ export const Params = { } return message; }, + fromJSON(object: any): Params { + return { + distrEpochIdentifier: isSet(object.distrEpochIdentifier) ? String(object.distrEpochIdentifier) : "", + groupCreationFee: Array.isArray(object?.groupCreationFee) ? object.groupCreationFee.map((e: any) => Coin.fromJSON(e)) : [], + unrestrictedCreatorWhitelist: Array.isArray(object?.unrestrictedCreatorWhitelist) ? object.unrestrictedCreatorWhitelist.map((e: any) => String(e)) : [] + }; + }, + toJSON(message: Params): unknown { + const obj: any = {}; + message.distrEpochIdentifier !== undefined && (obj.distrEpochIdentifier = message.distrEpochIdentifier); + if (message.groupCreationFee) { + obj.groupCreationFee = message.groupCreationFee.map(e => e ? Coin.toJSON(e) : undefined); + } else { + obj.groupCreationFee = []; + } + if (message.unrestrictedCreatorWhitelist) { + obj.unrestrictedCreatorWhitelist = message.unrestrictedCreatorWhitelist.map(e => e); + } else { + obj.unrestrictedCreatorWhitelist = []; + } + return obj; + }, fromPartial(object: Partial): Params { const message = createBaseParams(); message.distrEpochIdentifier = object.distrEpochIdentifier ?? ""; + message.groupCreationFee = object.groupCreationFee?.map(e => Coin.fromPartial(e)) || []; + message.unrestrictedCreatorWhitelist = object.unrestrictedCreatorWhitelist?.map(e => e) || []; return message; }, fromAmino(object: ParamsAmino): Params { - return { - distrEpochIdentifier: object.distr_epoch_identifier - }; + const message = createBaseParams(); + if (object.distr_epoch_identifier !== undefined && object.distr_epoch_identifier !== null) { + message.distrEpochIdentifier = object.distr_epoch_identifier; + } + message.groupCreationFee = object.group_creation_fee?.map(e => Coin.fromAmino(e)) || []; + message.unrestrictedCreatorWhitelist = object.unrestricted_creator_whitelist?.map(e => e) || []; + return message; }, toAmino(message: Params): ParamsAmino { const obj: any = {}; obj.distr_epoch_identifier = message.distrEpochIdentifier; + if (message.groupCreationFee) { + obj.group_creation_fee = message.groupCreationFee.map(e => e ? Coin.toAmino(e) : undefined); + } else { + obj.group_creation_fee = []; + } + if (message.unrestrictedCreatorWhitelist) { + obj.unrestricted_creator_whitelist = message.unrestrictedCreatorWhitelist.map(e => e); + } else { + obj.unrestricted_creator_whitelist = []; + } return obj; }, fromAminoMsg(object: ParamsAminoMsg): Params { @@ -93,4 +194,6 @@ export const Params = { value: Params.encode(message).finish() }; } -}; \ No newline at end of file +}; +GlobalDecoderRegistry.register(Params.typeUrl, Params); +GlobalDecoderRegistry.registerAminoProtoMapping(Params.aminoType, Params.typeUrl); \ No newline at end of file diff --git a/packages/osmojs/src/codegen/osmosis/incentives/query.lcd.ts b/packages/osmojs/src/codegen/osmosis/incentives/query.lcd.ts index 66f8ed4a7..36333577c 100644 --- a/packages/osmojs/src/codegen/osmosis/incentives/query.lcd.ts +++ b/packages/osmojs/src/codegen/osmosis/incentives/query.lcd.ts @@ -1,6 +1,6 @@ import { setPaginationParams } from "../../helpers"; import { LCDClient } from "@cosmology/lcd"; -import { ModuleToDistributeCoinsRequest, ModuleToDistributeCoinsResponseSDKType, GaugeByIDRequest, GaugeByIDResponseSDKType, GaugesRequest, GaugesResponseSDKType, ActiveGaugesRequest, ActiveGaugesResponseSDKType, ActiveGaugesPerDenomRequest, ActiveGaugesPerDenomResponseSDKType, UpcomingGaugesRequest, UpcomingGaugesResponseSDKType, UpcomingGaugesPerDenomRequest, UpcomingGaugesPerDenomResponseSDKType, RewardsEstRequest, RewardsEstResponseSDKType, QueryLockableDurationsRequest, QueryLockableDurationsResponseSDKType } from "./query"; +import { ModuleToDistributeCoinsRequest, ModuleToDistributeCoinsResponseSDKType, GaugeByIDRequest, GaugeByIDResponseSDKType, GaugesRequest, GaugesResponseSDKType, ActiveGaugesRequest, ActiveGaugesResponseSDKType, ActiveGaugesPerDenomRequest, ActiveGaugesPerDenomResponseSDKType, UpcomingGaugesRequest, UpcomingGaugesResponseSDKType, UpcomingGaugesPerDenomRequest, UpcomingGaugesPerDenomResponseSDKType, RewardsEstRequest, RewardsEstResponseSDKType, QueryLockableDurationsRequest, QueryLockableDurationsResponseSDKType, QueryAllGroupsRequest, QueryAllGroupsResponseSDKType, QueryAllGroupsGaugesRequest, QueryAllGroupsGaugesResponseSDKType, QueryAllGroupsWithGaugeRequest, QueryAllGroupsWithGaugeResponseSDKType, QueryGroupByGroupGaugeIDRequest, QueryGroupByGroupGaugeIDResponseSDKType, QueryCurrentWeightByGroupGaugeIDRequest, QueryCurrentWeightByGroupGaugeIDResponseSDKType } from "./query"; export class LCDQueryClient { req: LCDClient; constructor({ @@ -18,6 +18,11 @@ export class LCDQueryClient { this.upcomingGaugesPerDenom = this.upcomingGaugesPerDenom.bind(this); this.rewardsEst = this.rewardsEst.bind(this); this.lockableDurations = this.lockableDurations.bind(this); + this.allGroups = this.allGroups.bind(this); + this.allGroupsGauges = this.allGroupsGauges.bind(this); + this.allGroupsWithGauge = this.allGroupsWithGauge.bind(this); + this.groupByGroupGaugeID = this.groupByGroupGaugeID.bind(this); + this.currentWeightByGroupGaugeID = this.currentWeightByGroupGaugeID.bind(this); } /* ModuleToDistributeCoins returns coins that are going to be distributed */ async moduleToDistributeCoins(_params: ModuleToDistributeCoinsRequest = {}): Promise { @@ -69,7 +74,7 @@ export class LCDQueryClient { const endpoint = `osmosis/incentives/v1beta1/active_gauges_per_denom`; return await this.req.get(endpoint, options); } - /* Returns scheduled gauges that have not yet occured */ + /* Returns scheduled gauges that have not yet occurred */ async upcomingGauges(params: UpcomingGaugesRequest = { pagination: undefined }): Promise { @@ -82,7 +87,7 @@ export class LCDQueryClient { const endpoint = `osmosis/incentives/v1beta1/upcoming_gauges`; return await this.req.get(endpoint, options); } - /* UpcomingGaugesPerDenom returns scheduled gauges that have not yet occured + /* UpcomingGaugesPerDenom returns scheduled gauges that have not yet occurred by denom */ async upcomingGaugesPerDenom(params: UpcomingGaugesPerDenomRequest): Promise { const options: any = { @@ -119,4 +124,30 @@ export class LCDQueryClient { const endpoint = `osmosis/incentives/v1beta1/lockable_durations`; return await this.req.get(endpoint); } + /* AllGroups returns all groups */ + async allGroups(_params: QueryAllGroupsRequest = {}): Promise { + const endpoint = `osmosis/incentives/v1beta1/all_groups`; + return await this.req.get(endpoint); + } + /* AllGroupsGauges returns all group gauges */ + async allGroupsGauges(_params: QueryAllGroupsGaugesRequest = {}): Promise { + const endpoint = `osmosis/incentives/v1beta1/all_groups_gauges`; + return await this.req.get(endpoint); + } + /* AllGroupsWithGauge returns all groups with their group gauge */ + async allGroupsWithGauge(_params: QueryAllGroupsWithGaugeRequest = {}): Promise { + const endpoint = `osmosis/incentives/v1beta1/all_groups_with_gauge`; + return await this.req.get(endpoint); + } + /* GroupByGroupGaugeID returns a group given its group gauge ID */ + async groupByGroupGaugeID(params: QueryGroupByGroupGaugeIDRequest): Promise { + const endpoint = `osmosis/incentives/v1beta1/group_by_group_gauge_id/${params.id}`; + return await this.req.get(endpoint); + } + /* CurrentWeightByGroupGaugeID returns the current weight since the + the last epoch given a group gauge ID */ + async currentWeightByGroupGaugeID(params: QueryCurrentWeightByGroupGaugeIDRequest): Promise { + const endpoint = `osmosis/incentives/v1beta1/current_weight_by_group_gauge_id/${params.groupGaugeId}`; + return await this.req.get(endpoint); + } } \ No newline at end of file diff --git a/packages/osmojs/src/codegen/osmosis/incentives/query.rpc.Query.ts b/packages/osmojs/src/codegen/osmosis/incentives/query.rpc.Query.ts index 01c36738b..f53d75c46 100644 --- a/packages/osmojs/src/codegen/osmosis/incentives/query.rpc.Query.ts +++ b/packages/osmojs/src/codegen/osmosis/incentives/query.rpc.Query.ts @@ -1,7 +1,7 @@ import { Rpc } from "../../helpers"; import { BinaryReader } from "../../binary"; import { QueryClient, createProtobufRpcClient } from "@cosmjs/stargate"; -import { ModuleToDistributeCoinsRequest, ModuleToDistributeCoinsResponse, GaugeByIDRequest, GaugeByIDResponse, GaugesRequest, GaugesResponse, ActiveGaugesRequest, ActiveGaugesResponse, ActiveGaugesPerDenomRequest, ActiveGaugesPerDenomResponse, UpcomingGaugesRequest, UpcomingGaugesResponse, UpcomingGaugesPerDenomRequest, UpcomingGaugesPerDenomResponse, RewardsEstRequest, RewardsEstResponse, QueryLockableDurationsRequest, QueryLockableDurationsResponse } from "./query"; +import { ModuleToDistributeCoinsRequest, ModuleToDistributeCoinsResponse, GaugeByIDRequest, GaugeByIDResponse, GaugesRequest, GaugesResponse, ActiveGaugesRequest, ActiveGaugesResponse, ActiveGaugesPerDenomRequest, ActiveGaugesPerDenomResponse, UpcomingGaugesRequest, UpcomingGaugesResponse, UpcomingGaugesPerDenomRequest, UpcomingGaugesPerDenomResponse, RewardsEstRequest, RewardsEstResponse, QueryLockableDurationsRequest, QueryLockableDurationsResponse, QueryAllGroupsRequest, QueryAllGroupsResponse, QueryAllGroupsGaugesRequest, QueryAllGroupsGaugesResponse, QueryAllGroupsWithGaugeRequest, QueryAllGroupsWithGaugeResponse, QueryGroupByGroupGaugeIDRequest, QueryGroupByGroupGaugeIDResponse, QueryCurrentWeightByGroupGaugeIDRequest, QueryCurrentWeightByGroupGaugeIDResponse } from "./query"; /** Query defines the gRPC querier service */ export interface Query { /** ModuleToDistributeCoins returns coins that are going to be distributed */ @@ -14,10 +14,10 @@ export interface Query { activeGauges(request?: ActiveGaugesRequest): Promise; /** ActiveGaugesPerDenom returns active gauges by denom */ activeGaugesPerDenom(request: ActiveGaugesPerDenomRequest): Promise; - /** Returns scheduled gauges that have not yet occured */ + /** Returns scheduled gauges that have not yet occurred */ upcomingGauges(request?: UpcomingGaugesRequest): Promise; /** - * UpcomingGaugesPerDenom returns scheduled gauges that have not yet occured + * UpcomingGaugesPerDenom returns scheduled gauges that have not yet occurred * by denom */ upcomingGaugesPerDenom(request: UpcomingGaugesPerDenomRequest): Promise; @@ -32,6 +32,19 @@ export interface Query { * incentives for */ lockableDurations(request?: QueryLockableDurationsRequest): Promise; + /** AllGroups returns all groups */ + allGroups(request?: QueryAllGroupsRequest): Promise; + /** AllGroupsGauges returns all group gauges */ + allGroupsGauges(request?: QueryAllGroupsGaugesRequest): Promise; + /** AllGroupsWithGauge returns all groups with their group gauge */ + allGroupsWithGauge(request?: QueryAllGroupsWithGaugeRequest): Promise; + /** GroupByGroupGaugeID returns a group given its group gauge ID */ + groupByGroupGaugeID(request: QueryGroupByGroupGaugeIDRequest): Promise; + /** + * CurrentWeightByGroupGaugeID returns the current weight since the + * the last epoch given a group gauge ID + */ + currentWeightByGroupGaugeID(request: QueryCurrentWeightByGroupGaugeIDRequest): Promise; } export class QueryClientImpl implements Query { private readonly rpc: Rpc; @@ -46,6 +59,11 @@ export class QueryClientImpl implements Query { this.upcomingGaugesPerDenom = this.upcomingGaugesPerDenom.bind(this); this.rewardsEst = this.rewardsEst.bind(this); this.lockableDurations = this.lockableDurations.bind(this); + this.allGroups = this.allGroups.bind(this); + this.allGroupsGauges = this.allGroupsGauges.bind(this); + this.allGroupsWithGauge = this.allGroupsWithGauge.bind(this); + this.groupByGroupGaugeID = this.groupByGroupGaugeID.bind(this); + this.currentWeightByGroupGaugeID = this.currentWeightByGroupGaugeID.bind(this); } moduleToDistributeCoins(request: ModuleToDistributeCoinsRequest = {}): Promise { const data = ModuleToDistributeCoinsRequest.encode(request).finish(); @@ -98,6 +116,31 @@ export class QueryClientImpl implements Query { const promise = this.rpc.request("osmosis.incentives.Query", "LockableDurations", data); return promise.then(data => QueryLockableDurationsResponse.decode(new BinaryReader(data))); } + allGroups(request: QueryAllGroupsRequest = {}): Promise { + const data = QueryAllGroupsRequest.encode(request).finish(); + const promise = this.rpc.request("osmosis.incentives.Query", "AllGroups", data); + return promise.then(data => QueryAllGroupsResponse.decode(new BinaryReader(data))); + } + allGroupsGauges(request: QueryAllGroupsGaugesRequest = {}): Promise { + const data = QueryAllGroupsGaugesRequest.encode(request).finish(); + const promise = this.rpc.request("osmosis.incentives.Query", "AllGroupsGauges", data); + return promise.then(data => QueryAllGroupsGaugesResponse.decode(new BinaryReader(data))); + } + allGroupsWithGauge(request: QueryAllGroupsWithGaugeRequest = {}): Promise { + const data = QueryAllGroupsWithGaugeRequest.encode(request).finish(); + const promise = this.rpc.request("osmosis.incentives.Query", "AllGroupsWithGauge", data); + return promise.then(data => QueryAllGroupsWithGaugeResponse.decode(new BinaryReader(data))); + } + groupByGroupGaugeID(request: QueryGroupByGroupGaugeIDRequest): Promise { + const data = QueryGroupByGroupGaugeIDRequest.encode(request).finish(); + const promise = this.rpc.request("osmosis.incentives.Query", "GroupByGroupGaugeID", data); + return promise.then(data => QueryGroupByGroupGaugeIDResponse.decode(new BinaryReader(data))); + } + currentWeightByGroupGaugeID(request: QueryCurrentWeightByGroupGaugeIDRequest): Promise { + const data = QueryCurrentWeightByGroupGaugeIDRequest.encode(request).finish(); + const promise = this.rpc.request("osmosis.incentives.Query", "CurrentWeightByGroupGaugeID", data); + return promise.then(data => QueryCurrentWeightByGroupGaugeIDResponse.decode(new BinaryReader(data))); + } } export const createRpcQueryExtension = (base: QueryClient) => { const rpc = createProtobufRpcClient(base); @@ -129,6 +172,21 @@ export const createRpcQueryExtension = (base: QueryClient) => { }, lockableDurations(request?: QueryLockableDurationsRequest): Promise { return queryService.lockableDurations(request); + }, + allGroups(request?: QueryAllGroupsRequest): Promise { + return queryService.allGroups(request); + }, + allGroupsGauges(request?: QueryAllGroupsGaugesRequest): Promise { + return queryService.allGroupsGauges(request); + }, + allGroupsWithGauge(request?: QueryAllGroupsWithGaugeRequest): Promise { + return queryService.allGroupsWithGauge(request); + }, + groupByGroupGaugeID(request: QueryGroupByGroupGaugeIDRequest): Promise { + return queryService.groupByGroupGaugeID(request); + }, + currentWeightByGroupGaugeID(request: QueryCurrentWeightByGroupGaugeIDRequest): Promise { + return queryService.currentWeightByGroupGaugeID(request); } }; }; \ No newline at end of file diff --git a/packages/osmojs/src/codegen/osmosis/incentives/query.ts b/packages/osmojs/src/codegen/osmosis/incentives/query.ts index 88610a09c..9c3ce2fb5 100644 --- a/packages/osmojs/src/codegen/osmosis/incentives/query.ts +++ b/packages/osmojs/src/codegen/osmosis/incentives/query.ts @@ -2,7 +2,11 @@ import { PageRequest, PageRequestAmino, PageRequestSDKType, PageResponse, PageRe import { Coin, CoinAmino, CoinSDKType } from "../../cosmos/base/v1beta1/coin"; import { Gauge, GaugeAmino, GaugeSDKType } from "./gauge"; import { Duration, DurationAmino, DurationSDKType } from "../../google/protobuf/duration"; +import { Group, GroupAmino, GroupSDKType, GroupsWithGauge, GroupsWithGaugeAmino, GroupsWithGaugeSDKType } from "./group"; import { BinaryReader, BinaryWriter } from "../../binary"; +import { GlobalDecoderRegistry } from "../../registry"; +import { isSet } from "../../helpers"; +import { Decimal } from "@cosmjs/math"; export interface ModuleToDistributeCoinsRequest {} export interface ModuleToDistributeCoinsRequestProtoMsg { typeUrl: "/osmosis.incentives.ModuleToDistributeCoinsRequest"; @@ -24,7 +28,7 @@ export interface ModuleToDistributeCoinsResponseProtoMsg { } export interface ModuleToDistributeCoinsResponseAmino { /** Coins that have yet to be distributed */ - coins: CoinAmino[]; + coins?: CoinAmino[]; } export interface ModuleToDistributeCoinsResponseAminoMsg { type: "osmosis/incentives/module-to-distribute-coins-response"; @@ -43,7 +47,7 @@ export interface GaugeByIDRequestProtoMsg { } export interface GaugeByIDRequestAmino { /** Gague ID being queried */ - id: string; + id?: string; } export interface GaugeByIDRequestAminoMsg { type: "osmosis/incentives/gauge-by-id-request"; @@ -54,7 +58,7 @@ export interface GaugeByIDRequestSDKType { } export interface GaugeByIDResponse { /** Gauge that corresponds to provided gague ID */ - gauge: Gauge; + gauge?: Gauge; } export interface GaugeByIDResponseProtoMsg { typeUrl: "/osmosis.incentives.GaugeByIDResponse"; @@ -69,11 +73,11 @@ export interface GaugeByIDResponseAminoMsg { value: GaugeByIDResponseAmino; } export interface GaugeByIDResponseSDKType { - gauge: GaugeSDKType; + gauge?: GaugeSDKType; } export interface GaugesRequest { /** Pagination defines pagination for the request */ - pagination: PageRequest; + pagination?: PageRequest; } export interface GaugesRequestProtoMsg { typeUrl: "/osmosis.incentives.GaugesRequest"; @@ -88,13 +92,13 @@ export interface GaugesRequestAminoMsg { value: GaugesRequestAmino; } export interface GaugesRequestSDKType { - pagination: PageRequestSDKType; + pagination?: PageRequestSDKType; } export interface GaugesResponse { /** Upcoming and active gauges */ data: Gauge[]; /** Pagination defines pagination for the response */ - pagination: PageResponse; + pagination?: PageResponse; } export interface GaugesResponseProtoMsg { typeUrl: "/osmosis.incentives.GaugesResponse"; @@ -102,7 +106,7 @@ export interface GaugesResponseProtoMsg { } export interface GaugesResponseAmino { /** Upcoming and active gauges */ - data: GaugeAmino[]; + data?: GaugeAmino[]; /** Pagination defines pagination for the response */ pagination?: PageResponseAmino; } @@ -112,11 +116,11 @@ export interface GaugesResponseAminoMsg { } export interface GaugesResponseSDKType { data: GaugeSDKType[]; - pagination: PageResponseSDKType; + pagination?: PageResponseSDKType; } export interface ActiveGaugesRequest { /** Pagination defines pagination for the request */ - pagination: PageRequest; + pagination?: PageRequest; } export interface ActiveGaugesRequestProtoMsg { typeUrl: "/osmosis.incentives.ActiveGaugesRequest"; @@ -131,13 +135,13 @@ export interface ActiveGaugesRequestAminoMsg { value: ActiveGaugesRequestAmino; } export interface ActiveGaugesRequestSDKType { - pagination: PageRequestSDKType; + pagination?: PageRequestSDKType; } export interface ActiveGaugesResponse { /** Active gagues only */ data: Gauge[]; /** Pagination defines pagination for the response */ - pagination: PageResponse; + pagination?: PageResponse; } export interface ActiveGaugesResponseProtoMsg { typeUrl: "/osmosis.incentives.ActiveGaugesResponse"; @@ -145,7 +149,7 @@ export interface ActiveGaugesResponseProtoMsg { } export interface ActiveGaugesResponseAmino { /** Active gagues only */ - data: GaugeAmino[]; + data?: GaugeAmino[]; /** Pagination defines pagination for the response */ pagination?: PageResponseAmino; } @@ -155,13 +159,13 @@ export interface ActiveGaugesResponseAminoMsg { } export interface ActiveGaugesResponseSDKType { data: GaugeSDKType[]; - pagination: PageResponseSDKType; + pagination?: PageResponseSDKType; } export interface ActiveGaugesPerDenomRequest { /** Desired denom when querying active gagues */ denom: string; /** Pagination defines pagination for the request */ - pagination: PageRequest; + pagination?: PageRequest; } export interface ActiveGaugesPerDenomRequestProtoMsg { typeUrl: "/osmosis.incentives.ActiveGaugesPerDenomRequest"; @@ -169,7 +173,7 @@ export interface ActiveGaugesPerDenomRequestProtoMsg { } export interface ActiveGaugesPerDenomRequestAmino { /** Desired denom when querying active gagues */ - denom: string; + denom?: string; /** Pagination defines pagination for the request */ pagination?: PageRequestAmino; } @@ -179,13 +183,13 @@ export interface ActiveGaugesPerDenomRequestAminoMsg { } export interface ActiveGaugesPerDenomRequestSDKType { denom: string; - pagination: PageRequestSDKType; + pagination?: PageRequestSDKType; } export interface ActiveGaugesPerDenomResponse { /** Active gagues that match denom in query */ data: Gauge[]; /** Pagination defines pagination for the response */ - pagination: PageResponse; + pagination?: PageResponse; } export interface ActiveGaugesPerDenomResponseProtoMsg { typeUrl: "/osmosis.incentives.ActiveGaugesPerDenomResponse"; @@ -193,7 +197,7 @@ export interface ActiveGaugesPerDenomResponseProtoMsg { } export interface ActiveGaugesPerDenomResponseAmino { /** Active gagues that match denom in query */ - data: GaugeAmino[]; + data?: GaugeAmino[]; /** Pagination defines pagination for the response */ pagination?: PageResponseAmino; } @@ -203,11 +207,11 @@ export interface ActiveGaugesPerDenomResponseAminoMsg { } export interface ActiveGaugesPerDenomResponseSDKType { data: GaugeSDKType[]; - pagination: PageResponseSDKType; + pagination?: PageResponseSDKType; } export interface UpcomingGaugesRequest { /** Pagination defines pagination for the request */ - pagination: PageRequest; + pagination?: PageRequest; } export interface UpcomingGaugesRequestProtoMsg { typeUrl: "/osmosis.incentives.UpcomingGaugesRequest"; @@ -222,13 +226,13 @@ export interface UpcomingGaugesRequestAminoMsg { value: UpcomingGaugesRequestAmino; } export interface UpcomingGaugesRequestSDKType { - pagination: PageRequestSDKType; + pagination?: PageRequestSDKType; } export interface UpcomingGaugesResponse { /** Gauges whose distribution is upcoming */ data: Gauge[]; /** Pagination defines pagination for the response */ - pagination: PageResponse; + pagination?: PageResponse; } export interface UpcomingGaugesResponseProtoMsg { typeUrl: "/osmosis.incentives.UpcomingGaugesResponse"; @@ -236,7 +240,7 @@ export interface UpcomingGaugesResponseProtoMsg { } export interface UpcomingGaugesResponseAmino { /** Gauges whose distribution is upcoming */ - data: GaugeAmino[]; + data?: GaugeAmino[]; /** Pagination defines pagination for the response */ pagination?: PageResponseAmino; } @@ -246,13 +250,13 @@ export interface UpcomingGaugesResponseAminoMsg { } export interface UpcomingGaugesResponseSDKType { data: GaugeSDKType[]; - pagination: PageResponseSDKType; + pagination?: PageResponseSDKType; } export interface UpcomingGaugesPerDenomRequest { /** Filter for upcoming gagues that match specific denom */ denom: string; /** Pagination defines pagination for the request */ - pagination: PageRequest; + pagination?: PageRequest; } export interface UpcomingGaugesPerDenomRequestProtoMsg { typeUrl: "/osmosis.incentives.UpcomingGaugesPerDenomRequest"; @@ -260,7 +264,7 @@ export interface UpcomingGaugesPerDenomRequestProtoMsg { } export interface UpcomingGaugesPerDenomRequestAmino { /** Filter for upcoming gagues that match specific denom */ - denom: string; + denom?: string; /** Pagination defines pagination for the request */ pagination?: PageRequestAmino; } @@ -270,13 +274,13 @@ export interface UpcomingGaugesPerDenomRequestAminoMsg { } export interface UpcomingGaugesPerDenomRequestSDKType { denom: string; - pagination: PageRequestSDKType; + pagination?: PageRequestSDKType; } export interface UpcomingGaugesPerDenomResponse { /** Upcoming gagues that match denom in query */ upcomingGauges: Gauge[]; /** Pagination defines pagination for the response */ - pagination: PageResponse; + pagination?: PageResponse; } export interface UpcomingGaugesPerDenomResponseProtoMsg { typeUrl: "/osmosis.incentives.UpcomingGaugesPerDenomResponse"; @@ -284,7 +288,7 @@ export interface UpcomingGaugesPerDenomResponseProtoMsg { } export interface UpcomingGaugesPerDenomResponseAmino { /** Upcoming gagues that match denom in query */ - upcoming_gauges: GaugeAmino[]; + upcoming_gauges?: GaugeAmino[]; /** Pagination defines pagination for the response */ pagination?: PageResponseAmino; } @@ -294,7 +298,7 @@ export interface UpcomingGaugesPerDenomResponseAminoMsg { } export interface UpcomingGaugesPerDenomResponseSDKType { upcoming_gauges: GaugeSDKType[]; - pagination: PageResponseSDKType; + pagination?: PageResponseSDKType; } export interface RewardsEstRequest { /** Address that is being queried for future estimated rewards */ @@ -313,14 +317,14 @@ export interface RewardsEstRequestProtoMsg { } export interface RewardsEstRequestAmino { /** Address that is being queried for future estimated rewards */ - owner: string; + owner?: string; /** Lock IDs included in future reward estimation */ - lock_ids: string[]; + lock_ids?: string[]; /** * Upper time limit of reward estimation * Lower limit is current epoch */ - end_epoch: string; + end_epoch?: string; } export interface RewardsEstRequestAminoMsg { type: "osmosis/incentives/rewards-est-request"; @@ -333,7 +337,7 @@ export interface RewardsEstRequestSDKType { } export interface RewardsEstResponse { /** - * Estimated coin rewards that will be recieved at provided address + * Estimated coin rewards that will be received at provided address * from specified locks between current time and end epoch */ coins: Coin[]; @@ -344,10 +348,10 @@ export interface RewardsEstResponseProtoMsg { } export interface RewardsEstResponseAmino { /** - * Estimated coin rewards that will be recieved at provided address + * Estimated coin rewards that will be received at provided address * from specified locks between current time and end epoch */ - coins: CoinAmino[]; + coins?: CoinAmino[]; } export interface RewardsEstResponseAminoMsg { type: "osmosis/incentives/rewards-est-response"; @@ -368,7 +372,7 @@ export interface QueryLockableDurationsRequestAminoMsg { } export interface QueryLockableDurationsRequestSDKType {} export interface QueryLockableDurationsResponse { - /** Time durations that users can lock coins for in order to recieve rewards */ + /** Time durations that users can lock coins for in order to receive rewards */ lockableDurations: Duration[]; } export interface QueryLockableDurationsResponseProtoMsg { @@ -376,8 +380,8 @@ export interface QueryLockableDurationsResponseProtoMsg { value: Uint8Array; } export interface QueryLockableDurationsResponseAmino { - /** Time durations that users can lock coins for in order to recieve rewards */ - lockable_durations: DurationAmino[]; + /** Time durations that users can lock coins for in order to receive rewards */ + lockable_durations?: DurationAmino[]; } export interface QueryLockableDurationsResponseAminoMsg { type: "osmosis/incentives/query-lockable-durations-response"; @@ -386,11 +390,193 @@ export interface QueryLockableDurationsResponseAminoMsg { export interface QueryLockableDurationsResponseSDKType { lockable_durations: DurationSDKType[]; } +export interface QueryAllGroupsRequest {} +export interface QueryAllGroupsRequestProtoMsg { + typeUrl: "/osmosis.incentives.QueryAllGroupsRequest"; + value: Uint8Array; +} +export interface QueryAllGroupsRequestAmino {} +export interface QueryAllGroupsRequestAminoMsg { + type: "osmosis/incentives/query-all-groups-request"; + value: QueryAllGroupsRequestAmino; +} +export interface QueryAllGroupsRequestSDKType {} +export interface QueryAllGroupsResponse { + groups: Group[]; +} +export interface QueryAllGroupsResponseProtoMsg { + typeUrl: "/osmosis.incentives.QueryAllGroupsResponse"; + value: Uint8Array; +} +export interface QueryAllGroupsResponseAmino { + groups?: GroupAmino[]; +} +export interface QueryAllGroupsResponseAminoMsg { + type: "osmosis/incentives/query-all-groups-response"; + value: QueryAllGroupsResponseAmino; +} +export interface QueryAllGroupsResponseSDKType { + groups: GroupSDKType[]; +} +export interface QueryAllGroupsGaugesRequest {} +export interface QueryAllGroupsGaugesRequestProtoMsg { + typeUrl: "/osmosis.incentives.QueryAllGroupsGaugesRequest"; + value: Uint8Array; +} +export interface QueryAllGroupsGaugesRequestAmino {} +export interface QueryAllGroupsGaugesRequestAminoMsg { + type: "osmosis/incentives/query-all-groups-gauges-request"; + value: QueryAllGroupsGaugesRequestAmino; +} +export interface QueryAllGroupsGaugesRequestSDKType {} +export interface QueryAllGroupsGaugesResponse { + gauges: Gauge[]; +} +export interface QueryAllGroupsGaugesResponseProtoMsg { + typeUrl: "/osmosis.incentives.QueryAllGroupsGaugesResponse"; + value: Uint8Array; +} +export interface QueryAllGroupsGaugesResponseAmino { + gauges?: GaugeAmino[]; +} +export interface QueryAllGroupsGaugesResponseAminoMsg { + type: "osmosis/incentives/query-all-groups-gauges-response"; + value: QueryAllGroupsGaugesResponseAmino; +} +export interface QueryAllGroupsGaugesResponseSDKType { + gauges: GaugeSDKType[]; +} +export interface QueryAllGroupsWithGaugeRequest {} +export interface QueryAllGroupsWithGaugeRequestProtoMsg { + typeUrl: "/osmosis.incentives.QueryAllGroupsWithGaugeRequest"; + value: Uint8Array; +} +export interface QueryAllGroupsWithGaugeRequestAmino {} +export interface QueryAllGroupsWithGaugeRequestAminoMsg { + type: "osmosis/incentives/query-all-groups-with-gauge-request"; + value: QueryAllGroupsWithGaugeRequestAmino; +} +export interface QueryAllGroupsWithGaugeRequestSDKType {} +export interface QueryAllGroupsWithGaugeResponse { + groupsWithGauge: GroupsWithGauge[]; +} +export interface QueryAllGroupsWithGaugeResponseProtoMsg { + typeUrl: "/osmosis.incentives.QueryAllGroupsWithGaugeResponse"; + value: Uint8Array; +} +export interface QueryAllGroupsWithGaugeResponseAmino { + groups_with_gauge?: GroupsWithGaugeAmino[]; +} +export interface QueryAllGroupsWithGaugeResponseAminoMsg { + type: "osmosis/incentives/query-all-groups-with-gauge-response"; + value: QueryAllGroupsWithGaugeResponseAmino; +} +export interface QueryAllGroupsWithGaugeResponseSDKType { + groups_with_gauge: GroupsWithGaugeSDKType[]; +} +export interface QueryGroupByGroupGaugeIDRequest { + id: bigint; +} +export interface QueryGroupByGroupGaugeIDRequestProtoMsg { + typeUrl: "/osmosis.incentives.QueryGroupByGroupGaugeIDRequest"; + value: Uint8Array; +} +export interface QueryGroupByGroupGaugeIDRequestAmino { + id?: string; +} +export interface QueryGroupByGroupGaugeIDRequestAminoMsg { + type: "osmosis/incentives/query-group-by-group-gauge-id-request"; + value: QueryGroupByGroupGaugeIDRequestAmino; +} +export interface QueryGroupByGroupGaugeIDRequestSDKType { + id: bigint; +} +export interface QueryGroupByGroupGaugeIDResponse { + group: Group; +} +export interface QueryGroupByGroupGaugeIDResponseProtoMsg { + typeUrl: "/osmosis.incentives.QueryGroupByGroupGaugeIDResponse"; + value: Uint8Array; +} +export interface QueryGroupByGroupGaugeIDResponseAmino { + group?: GroupAmino; +} +export interface QueryGroupByGroupGaugeIDResponseAminoMsg { + type: "osmosis/incentives/query-group-by-group-gauge-id-response"; + value: QueryGroupByGroupGaugeIDResponseAmino; +} +export interface QueryGroupByGroupGaugeIDResponseSDKType { + group: GroupSDKType; +} +export interface QueryCurrentWeightByGroupGaugeIDRequest { + groupGaugeId: bigint; +} +export interface QueryCurrentWeightByGroupGaugeIDRequestProtoMsg { + typeUrl: "/osmosis.incentives.QueryCurrentWeightByGroupGaugeIDRequest"; + value: Uint8Array; +} +export interface QueryCurrentWeightByGroupGaugeIDRequestAmino { + group_gauge_id?: string; +} +export interface QueryCurrentWeightByGroupGaugeIDRequestAminoMsg { + type: "osmosis/incentives/query-current-weight-by-group-gauge-id-request"; + value: QueryCurrentWeightByGroupGaugeIDRequestAmino; +} +export interface QueryCurrentWeightByGroupGaugeIDRequestSDKType { + group_gauge_id: bigint; +} +export interface QueryCurrentWeightByGroupGaugeIDResponse { + gaugeWeight: GaugeWeight[]; +} +export interface QueryCurrentWeightByGroupGaugeIDResponseProtoMsg { + typeUrl: "/osmosis.incentives.QueryCurrentWeightByGroupGaugeIDResponse"; + value: Uint8Array; +} +export interface QueryCurrentWeightByGroupGaugeIDResponseAmino { + gauge_weight?: GaugeWeightAmino[]; +} +export interface QueryCurrentWeightByGroupGaugeIDResponseAminoMsg { + type: "osmosis/incentives/query-current-weight-by-group-gauge-id-response"; + value: QueryCurrentWeightByGroupGaugeIDResponseAmino; +} +export interface QueryCurrentWeightByGroupGaugeIDResponseSDKType { + gauge_weight: GaugeWeightSDKType[]; +} +export interface GaugeWeight { + gaugeId: bigint; + weightRatio: string; +} +export interface GaugeWeightProtoMsg { + typeUrl: "/osmosis.incentives.GaugeWeight"; + value: Uint8Array; +} +export interface GaugeWeightAmino { + gauge_id?: string; + weight_ratio?: string; +} +export interface GaugeWeightAminoMsg { + type: "osmosis/incentives/gauge-weight"; + value: GaugeWeightAmino; +} +export interface GaugeWeightSDKType { + gauge_id: bigint; + weight_ratio: string; +} function createBaseModuleToDistributeCoinsRequest(): ModuleToDistributeCoinsRequest { return {}; } export const ModuleToDistributeCoinsRequest = { typeUrl: "/osmosis.incentives.ModuleToDistributeCoinsRequest", + aminoType: "osmosis/incentives/module-to-distribute-coins-request", + is(o: any): o is ModuleToDistributeCoinsRequest { + return o && o.$typeUrl === ModuleToDistributeCoinsRequest.typeUrl; + }, + isSDK(o: any): o is ModuleToDistributeCoinsRequestSDKType { + return o && o.$typeUrl === ModuleToDistributeCoinsRequest.typeUrl; + }, + isAmino(o: any): o is ModuleToDistributeCoinsRequestAmino { + return o && o.$typeUrl === ModuleToDistributeCoinsRequest.typeUrl; + }, encode(_: ModuleToDistributeCoinsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, @@ -408,12 +594,20 @@ export const ModuleToDistributeCoinsRequest = { } return message; }, + fromJSON(_: any): ModuleToDistributeCoinsRequest { + return {}; + }, + toJSON(_: ModuleToDistributeCoinsRequest): unknown { + const obj: any = {}; + return obj; + }, fromPartial(_: Partial): ModuleToDistributeCoinsRequest { const message = createBaseModuleToDistributeCoinsRequest(); return message; }, fromAmino(_: ModuleToDistributeCoinsRequestAmino): ModuleToDistributeCoinsRequest { - return {}; + const message = createBaseModuleToDistributeCoinsRequest(); + return message; }, toAmino(_: ModuleToDistributeCoinsRequest): ModuleToDistributeCoinsRequestAmino { const obj: any = {}; @@ -441,6 +635,8 @@ export const ModuleToDistributeCoinsRequest = { }; } }; +GlobalDecoderRegistry.register(ModuleToDistributeCoinsRequest.typeUrl, ModuleToDistributeCoinsRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(ModuleToDistributeCoinsRequest.aminoType, ModuleToDistributeCoinsRequest.typeUrl); function createBaseModuleToDistributeCoinsResponse(): ModuleToDistributeCoinsResponse { return { coins: [] @@ -448,6 +644,16 @@ function createBaseModuleToDistributeCoinsResponse(): ModuleToDistributeCoinsRes } export const ModuleToDistributeCoinsResponse = { typeUrl: "/osmosis.incentives.ModuleToDistributeCoinsResponse", + aminoType: "osmosis/incentives/module-to-distribute-coins-response", + is(o: any): o is ModuleToDistributeCoinsResponse { + return o && (o.$typeUrl === ModuleToDistributeCoinsResponse.typeUrl || Array.isArray(o.coins) && (!o.coins.length || Coin.is(o.coins[0]))); + }, + isSDK(o: any): o is ModuleToDistributeCoinsResponseSDKType { + return o && (o.$typeUrl === ModuleToDistributeCoinsResponse.typeUrl || Array.isArray(o.coins) && (!o.coins.length || Coin.isSDK(o.coins[0]))); + }, + isAmino(o: any): o is ModuleToDistributeCoinsResponseAmino { + return o && (o.$typeUrl === ModuleToDistributeCoinsResponse.typeUrl || Array.isArray(o.coins) && (!o.coins.length || Coin.isAmino(o.coins[0]))); + }, encode(message: ModuleToDistributeCoinsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.coins) { Coin.encode(v!, writer.uint32(10).fork()).ldelim(); @@ -471,15 +677,29 @@ export const ModuleToDistributeCoinsResponse = { } return message; }, + fromJSON(object: any): ModuleToDistributeCoinsResponse { + return { + coins: Array.isArray(object?.coins) ? object.coins.map((e: any) => Coin.fromJSON(e)) : [] + }; + }, + toJSON(message: ModuleToDistributeCoinsResponse): unknown { + const obj: any = {}; + if (message.coins) { + obj.coins = message.coins.map(e => e ? Coin.toJSON(e) : undefined); + } else { + obj.coins = []; + } + return obj; + }, fromPartial(object: Partial): ModuleToDistributeCoinsResponse { const message = createBaseModuleToDistributeCoinsResponse(); message.coins = object.coins?.map(e => Coin.fromPartial(e)) || []; return message; }, fromAmino(object: ModuleToDistributeCoinsResponseAmino): ModuleToDistributeCoinsResponse { - return { - coins: Array.isArray(object?.coins) ? object.coins.map((e: any) => Coin.fromAmino(e)) : [] - }; + const message = createBaseModuleToDistributeCoinsResponse(); + message.coins = object.coins?.map(e => Coin.fromAmino(e)) || []; + return message; }, toAmino(message: ModuleToDistributeCoinsResponse): ModuleToDistributeCoinsResponseAmino { const obj: any = {}; @@ -512,6 +732,8 @@ export const ModuleToDistributeCoinsResponse = { }; } }; +GlobalDecoderRegistry.register(ModuleToDistributeCoinsResponse.typeUrl, ModuleToDistributeCoinsResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(ModuleToDistributeCoinsResponse.aminoType, ModuleToDistributeCoinsResponse.typeUrl); function createBaseGaugeByIDRequest(): GaugeByIDRequest { return { id: BigInt(0) @@ -519,6 +741,16 @@ function createBaseGaugeByIDRequest(): GaugeByIDRequest { } export const GaugeByIDRequest = { typeUrl: "/osmosis.incentives.GaugeByIDRequest", + aminoType: "osmosis/incentives/gauge-by-id-request", + is(o: any): o is GaugeByIDRequest { + return o && (o.$typeUrl === GaugeByIDRequest.typeUrl || typeof o.id === "bigint"); + }, + isSDK(o: any): o is GaugeByIDRequestSDKType { + return o && (o.$typeUrl === GaugeByIDRequest.typeUrl || typeof o.id === "bigint"); + }, + isAmino(o: any): o is GaugeByIDRequestAmino { + return o && (o.$typeUrl === GaugeByIDRequest.typeUrl || typeof o.id === "bigint"); + }, encode(message: GaugeByIDRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.id !== BigInt(0)) { writer.uint32(8).uint64(message.id); @@ -542,15 +774,27 @@ export const GaugeByIDRequest = { } return message; }, + fromJSON(object: any): GaugeByIDRequest { + return { + id: isSet(object.id) ? BigInt(object.id.toString()) : BigInt(0) + }; + }, + toJSON(message: GaugeByIDRequest): unknown { + const obj: any = {}; + message.id !== undefined && (obj.id = (message.id || BigInt(0)).toString()); + return obj; + }, fromPartial(object: Partial): GaugeByIDRequest { const message = createBaseGaugeByIDRequest(); message.id = object.id !== undefined && object.id !== null ? BigInt(object.id.toString()) : BigInt(0); return message; }, fromAmino(object: GaugeByIDRequestAmino): GaugeByIDRequest { - return { - id: BigInt(object.id) - }; + const message = createBaseGaugeByIDRequest(); + if (object.id !== undefined && object.id !== null) { + message.id = BigInt(object.id); + } + return message; }, toAmino(message: GaugeByIDRequest): GaugeByIDRequestAmino { const obj: any = {}; @@ -579,13 +823,25 @@ export const GaugeByIDRequest = { }; } }; +GlobalDecoderRegistry.register(GaugeByIDRequest.typeUrl, GaugeByIDRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(GaugeByIDRequest.aminoType, GaugeByIDRequest.typeUrl); function createBaseGaugeByIDResponse(): GaugeByIDResponse { return { - gauge: Gauge.fromPartial({}) + gauge: undefined }; } export const GaugeByIDResponse = { typeUrl: "/osmosis.incentives.GaugeByIDResponse", + aminoType: "osmosis/incentives/gauge-by-id-response", + is(o: any): o is GaugeByIDResponse { + return o && o.$typeUrl === GaugeByIDResponse.typeUrl; + }, + isSDK(o: any): o is GaugeByIDResponseSDKType { + return o && o.$typeUrl === GaugeByIDResponse.typeUrl; + }, + isAmino(o: any): o is GaugeByIDResponseAmino { + return o && o.$typeUrl === GaugeByIDResponse.typeUrl; + }, encode(message: GaugeByIDResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.gauge !== undefined) { Gauge.encode(message.gauge, writer.uint32(10).fork()).ldelim(); @@ -609,15 +865,27 @@ export const GaugeByIDResponse = { } return message; }, + fromJSON(object: any): GaugeByIDResponse { + return { + gauge: isSet(object.gauge) ? Gauge.fromJSON(object.gauge) : undefined + }; + }, + toJSON(message: GaugeByIDResponse): unknown { + const obj: any = {}; + message.gauge !== undefined && (obj.gauge = message.gauge ? Gauge.toJSON(message.gauge) : undefined); + return obj; + }, fromPartial(object: Partial): GaugeByIDResponse { const message = createBaseGaugeByIDResponse(); message.gauge = object.gauge !== undefined && object.gauge !== null ? Gauge.fromPartial(object.gauge) : undefined; return message; }, fromAmino(object: GaugeByIDResponseAmino): GaugeByIDResponse { - return { - gauge: object?.gauge ? Gauge.fromAmino(object.gauge) : undefined - }; + const message = createBaseGaugeByIDResponse(); + if (object.gauge !== undefined && object.gauge !== null) { + message.gauge = Gauge.fromAmino(object.gauge); + } + return message; }, toAmino(message: GaugeByIDResponse): GaugeByIDResponseAmino { const obj: any = {}; @@ -646,13 +914,25 @@ export const GaugeByIDResponse = { }; } }; +GlobalDecoderRegistry.register(GaugeByIDResponse.typeUrl, GaugeByIDResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(GaugeByIDResponse.aminoType, GaugeByIDResponse.typeUrl); function createBaseGaugesRequest(): GaugesRequest { return { - pagination: PageRequest.fromPartial({}) + pagination: undefined }; } export const GaugesRequest = { typeUrl: "/osmosis.incentives.GaugesRequest", + aminoType: "osmosis/incentives/gauges-request", + is(o: any): o is GaugesRequest { + return o && o.$typeUrl === GaugesRequest.typeUrl; + }, + isSDK(o: any): o is GaugesRequestSDKType { + return o && o.$typeUrl === GaugesRequest.typeUrl; + }, + isAmino(o: any): o is GaugesRequestAmino { + return o && o.$typeUrl === GaugesRequest.typeUrl; + }, encode(message: GaugesRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.pagination !== undefined) { PageRequest.encode(message.pagination, writer.uint32(10).fork()).ldelim(); @@ -676,15 +956,27 @@ export const GaugesRequest = { } return message; }, + fromJSON(object: any): GaugesRequest { + return { + pagination: isSet(object.pagination) ? PageRequest.fromJSON(object.pagination) : undefined + }; + }, + toJSON(message: GaugesRequest): unknown { + const obj: any = {}; + message.pagination !== undefined && (obj.pagination = message.pagination ? PageRequest.toJSON(message.pagination) : undefined); + return obj; + }, fromPartial(object: Partial): GaugesRequest { const message = createBaseGaugesRequest(); message.pagination = object.pagination !== undefined && object.pagination !== null ? PageRequest.fromPartial(object.pagination) : undefined; return message; }, fromAmino(object: GaugesRequestAmino): GaugesRequest { - return { - pagination: object?.pagination ? PageRequest.fromAmino(object.pagination) : undefined - }; + const message = createBaseGaugesRequest(); + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromAmino(object.pagination); + } + return message; }, toAmino(message: GaugesRequest): GaugesRequestAmino { const obj: any = {}; @@ -713,14 +1005,26 @@ export const GaugesRequest = { }; } }; +GlobalDecoderRegistry.register(GaugesRequest.typeUrl, GaugesRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(GaugesRequest.aminoType, GaugesRequest.typeUrl); function createBaseGaugesResponse(): GaugesResponse { return { data: [], - pagination: PageResponse.fromPartial({}) + pagination: undefined }; } export const GaugesResponse = { typeUrl: "/osmosis.incentives.GaugesResponse", + aminoType: "osmosis/incentives/gauges-response", + is(o: any): o is GaugesResponse { + return o && (o.$typeUrl === GaugesResponse.typeUrl || Array.isArray(o.data) && (!o.data.length || Gauge.is(o.data[0]))); + }, + isSDK(o: any): o is GaugesResponseSDKType { + return o && (o.$typeUrl === GaugesResponse.typeUrl || Array.isArray(o.data) && (!o.data.length || Gauge.isSDK(o.data[0]))); + }, + isAmino(o: any): o is GaugesResponseAmino { + return o && (o.$typeUrl === GaugesResponse.typeUrl || Array.isArray(o.data) && (!o.data.length || Gauge.isAmino(o.data[0]))); + }, encode(message: GaugesResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.data) { Gauge.encode(v!, writer.uint32(10).fork()).ldelim(); @@ -750,6 +1054,22 @@ export const GaugesResponse = { } return message; }, + fromJSON(object: any): GaugesResponse { + return { + data: Array.isArray(object?.data) ? object.data.map((e: any) => Gauge.fromJSON(e)) : [], + pagination: isSet(object.pagination) ? PageResponse.fromJSON(object.pagination) : undefined + }; + }, + toJSON(message: GaugesResponse): unknown { + const obj: any = {}; + if (message.data) { + obj.data = message.data.map(e => e ? Gauge.toJSON(e) : undefined); + } else { + obj.data = []; + } + message.pagination !== undefined && (obj.pagination = message.pagination ? PageResponse.toJSON(message.pagination) : undefined); + return obj; + }, fromPartial(object: Partial): GaugesResponse { const message = createBaseGaugesResponse(); message.data = object.data?.map(e => Gauge.fromPartial(e)) || []; @@ -757,10 +1077,12 @@ export const GaugesResponse = { return message; }, fromAmino(object: GaugesResponseAmino): GaugesResponse { - return { - data: Array.isArray(object?.data) ? object.data.map((e: any) => Gauge.fromAmino(e)) : [], - pagination: object?.pagination ? PageResponse.fromAmino(object.pagination) : undefined - }; + const message = createBaseGaugesResponse(); + message.data = object.data?.map(e => Gauge.fromAmino(e)) || []; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromAmino(object.pagination); + } + return message; }, toAmino(message: GaugesResponse): GaugesResponseAmino { const obj: any = {}; @@ -794,13 +1116,25 @@ export const GaugesResponse = { }; } }; +GlobalDecoderRegistry.register(GaugesResponse.typeUrl, GaugesResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(GaugesResponse.aminoType, GaugesResponse.typeUrl); function createBaseActiveGaugesRequest(): ActiveGaugesRequest { return { - pagination: PageRequest.fromPartial({}) + pagination: undefined }; } export const ActiveGaugesRequest = { typeUrl: "/osmosis.incentives.ActiveGaugesRequest", + aminoType: "osmosis/incentives/active-gauges-request", + is(o: any): o is ActiveGaugesRequest { + return o && o.$typeUrl === ActiveGaugesRequest.typeUrl; + }, + isSDK(o: any): o is ActiveGaugesRequestSDKType { + return o && o.$typeUrl === ActiveGaugesRequest.typeUrl; + }, + isAmino(o: any): o is ActiveGaugesRequestAmino { + return o && o.$typeUrl === ActiveGaugesRequest.typeUrl; + }, encode(message: ActiveGaugesRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.pagination !== undefined) { PageRequest.encode(message.pagination, writer.uint32(10).fork()).ldelim(); @@ -824,15 +1158,27 @@ export const ActiveGaugesRequest = { } return message; }, + fromJSON(object: any): ActiveGaugesRequest { + return { + pagination: isSet(object.pagination) ? PageRequest.fromJSON(object.pagination) : undefined + }; + }, + toJSON(message: ActiveGaugesRequest): unknown { + const obj: any = {}; + message.pagination !== undefined && (obj.pagination = message.pagination ? PageRequest.toJSON(message.pagination) : undefined); + return obj; + }, fromPartial(object: Partial): ActiveGaugesRequest { const message = createBaseActiveGaugesRequest(); message.pagination = object.pagination !== undefined && object.pagination !== null ? PageRequest.fromPartial(object.pagination) : undefined; return message; }, fromAmino(object: ActiveGaugesRequestAmino): ActiveGaugesRequest { - return { - pagination: object?.pagination ? PageRequest.fromAmino(object.pagination) : undefined - }; + const message = createBaseActiveGaugesRequest(); + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromAmino(object.pagination); + } + return message; }, toAmino(message: ActiveGaugesRequest): ActiveGaugesRequestAmino { const obj: any = {}; @@ -861,14 +1207,26 @@ export const ActiveGaugesRequest = { }; } }; +GlobalDecoderRegistry.register(ActiveGaugesRequest.typeUrl, ActiveGaugesRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(ActiveGaugesRequest.aminoType, ActiveGaugesRequest.typeUrl); function createBaseActiveGaugesResponse(): ActiveGaugesResponse { return { data: [], - pagination: PageResponse.fromPartial({}) + pagination: undefined }; } export const ActiveGaugesResponse = { typeUrl: "/osmosis.incentives.ActiveGaugesResponse", + aminoType: "osmosis/incentives/active-gauges-response", + is(o: any): o is ActiveGaugesResponse { + return o && (o.$typeUrl === ActiveGaugesResponse.typeUrl || Array.isArray(o.data) && (!o.data.length || Gauge.is(o.data[0]))); + }, + isSDK(o: any): o is ActiveGaugesResponseSDKType { + return o && (o.$typeUrl === ActiveGaugesResponse.typeUrl || Array.isArray(o.data) && (!o.data.length || Gauge.isSDK(o.data[0]))); + }, + isAmino(o: any): o is ActiveGaugesResponseAmino { + return o && (o.$typeUrl === ActiveGaugesResponse.typeUrl || Array.isArray(o.data) && (!o.data.length || Gauge.isAmino(o.data[0]))); + }, encode(message: ActiveGaugesResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.data) { Gauge.encode(v!, writer.uint32(10).fork()).ldelim(); @@ -898,6 +1256,22 @@ export const ActiveGaugesResponse = { } return message; }, + fromJSON(object: any): ActiveGaugesResponse { + return { + data: Array.isArray(object?.data) ? object.data.map((e: any) => Gauge.fromJSON(e)) : [], + pagination: isSet(object.pagination) ? PageResponse.fromJSON(object.pagination) : undefined + }; + }, + toJSON(message: ActiveGaugesResponse): unknown { + const obj: any = {}; + if (message.data) { + obj.data = message.data.map(e => e ? Gauge.toJSON(e) : undefined); + } else { + obj.data = []; + } + message.pagination !== undefined && (obj.pagination = message.pagination ? PageResponse.toJSON(message.pagination) : undefined); + return obj; + }, fromPartial(object: Partial): ActiveGaugesResponse { const message = createBaseActiveGaugesResponse(); message.data = object.data?.map(e => Gauge.fromPartial(e)) || []; @@ -905,10 +1279,12 @@ export const ActiveGaugesResponse = { return message; }, fromAmino(object: ActiveGaugesResponseAmino): ActiveGaugesResponse { - return { - data: Array.isArray(object?.data) ? object.data.map((e: any) => Gauge.fromAmino(e)) : [], - pagination: object?.pagination ? PageResponse.fromAmino(object.pagination) : undefined - }; + const message = createBaseActiveGaugesResponse(); + message.data = object.data?.map(e => Gauge.fromAmino(e)) || []; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromAmino(object.pagination); + } + return message; }, toAmino(message: ActiveGaugesResponse): ActiveGaugesResponseAmino { const obj: any = {}; @@ -942,14 +1318,26 @@ export const ActiveGaugesResponse = { }; } }; +GlobalDecoderRegistry.register(ActiveGaugesResponse.typeUrl, ActiveGaugesResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(ActiveGaugesResponse.aminoType, ActiveGaugesResponse.typeUrl); function createBaseActiveGaugesPerDenomRequest(): ActiveGaugesPerDenomRequest { return { denom: "", - pagination: PageRequest.fromPartial({}) + pagination: undefined }; } export const ActiveGaugesPerDenomRequest = { typeUrl: "/osmosis.incentives.ActiveGaugesPerDenomRequest", + aminoType: "osmosis/incentives/active-gauges-per-denom-request", + is(o: any): o is ActiveGaugesPerDenomRequest { + return o && (o.$typeUrl === ActiveGaugesPerDenomRequest.typeUrl || typeof o.denom === "string"); + }, + isSDK(o: any): o is ActiveGaugesPerDenomRequestSDKType { + return o && (o.$typeUrl === ActiveGaugesPerDenomRequest.typeUrl || typeof o.denom === "string"); + }, + isAmino(o: any): o is ActiveGaugesPerDenomRequestAmino { + return o && (o.$typeUrl === ActiveGaugesPerDenomRequest.typeUrl || typeof o.denom === "string"); + }, encode(message: ActiveGaugesPerDenomRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.denom !== "") { writer.uint32(10).string(message.denom); @@ -979,6 +1367,18 @@ export const ActiveGaugesPerDenomRequest = { } return message; }, + fromJSON(object: any): ActiveGaugesPerDenomRequest { + return { + denom: isSet(object.denom) ? String(object.denom) : "", + pagination: isSet(object.pagination) ? PageRequest.fromJSON(object.pagination) : undefined + }; + }, + toJSON(message: ActiveGaugesPerDenomRequest): unknown { + const obj: any = {}; + message.denom !== undefined && (obj.denom = message.denom); + message.pagination !== undefined && (obj.pagination = message.pagination ? PageRequest.toJSON(message.pagination) : undefined); + return obj; + }, fromPartial(object: Partial): ActiveGaugesPerDenomRequest { const message = createBaseActiveGaugesPerDenomRequest(); message.denom = object.denom ?? ""; @@ -986,10 +1386,14 @@ export const ActiveGaugesPerDenomRequest = { return message; }, fromAmino(object: ActiveGaugesPerDenomRequestAmino): ActiveGaugesPerDenomRequest { - return { - denom: object.denom, - pagination: object?.pagination ? PageRequest.fromAmino(object.pagination) : undefined - }; + const message = createBaseActiveGaugesPerDenomRequest(); + if (object.denom !== undefined && object.denom !== null) { + message.denom = object.denom; + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromAmino(object.pagination); + } + return message; }, toAmino(message: ActiveGaugesPerDenomRequest): ActiveGaugesPerDenomRequestAmino { const obj: any = {}; @@ -1019,14 +1423,26 @@ export const ActiveGaugesPerDenomRequest = { }; } }; +GlobalDecoderRegistry.register(ActiveGaugesPerDenomRequest.typeUrl, ActiveGaugesPerDenomRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(ActiveGaugesPerDenomRequest.aminoType, ActiveGaugesPerDenomRequest.typeUrl); function createBaseActiveGaugesPerDenomResponse(): ActiveGaugesPerDenomResponse { return { data: [], - pagination: PageResponse.fromPartial({}) + pagination: undefined }; } export const ActiveGaugesPerDenomResponse = { typeUrl: "/osmosis.incentives.ActiveGaugesPerDenomResponse", + aminoType: "osmosis/incentives/active-gauges-per-denom-response", + is(o: any): o is ActiveGaugesPerDenomResponse { + return o && (o.$typeUrl === ActiveGaugesPerDenomResponse.typeUrl || Array.isArray(o.data) && (!o.data.length || Gauge.is(o.data[0]))); + }, + isSDK(o: any): o is ActiveGaugesPerDenomResponseSDKType { + return o && (o.$typeUrl === ActiveGaugesPerDenomResponse.typeUrl || Array.isArray(o.data) && (!o.data.length || Gauge.isSDK(o.data[0]))); + }, + isAmino(o: any): o is ActiveGaugesPerDenomResponseAmino { + return o && (o.$typeUrl === ActiveGaugesPerDenomResponse.typeUrl || Array.isArray(o.data) && (!o.data.length || Gauge.isAmino(o.data[0]))); + }, encode(message: ActiveGaugesPerDenomResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.data) { Gauge.encode(v!, writer.uint32(10).fork()).ldelim(); @@ -1056,6 +1472,22 @@ export const ActiveGaugesPerDenomResponse = { } return message; }, + fromJSON(object: any): ActiveGaugesPerDenomResponse { + return { + data: Array.isArray(object?.data) ? object.data.map((e: any) => Gauge.fromJSON(e)) : [], + pagination: isSet(object.pagination) ? PageResponse.fromJSON(object.pagination) : undefined + }; + }, + toJSON(message: ActiveGaugesPerDenomResponse): unknown { + const obj: any = {}; + if (message.data) { + obj.data = message.data.map(e => e ? Gauge.toJSON(e) : undefined); + } else { + obj.data = []; + } + message.pagination !== undefined && (obj.pagination = message.pagination ? PageResponse.toJSON(message.pagination) : undefined); + return obj; + }, fromPartial(object: Partial): ActiveGaugesPerDenomResponse { const message = createBaseActiveGaugesPerDenomResponse(); message.data = object.data?.map(e => Gauge.fromPartial(e)) || []; @@ -1063,10 +1495,12 @@ export const ActiveGaugesPerDenomResponse = { return message; }, fromAmino(object: ActiveGaugesPerDenomResponseAmino): ActiveGaugesPerDenomResponse { - return { - data: Array.isArray(object?.data) ? object.data.map((e: any) => Gauge.fromAmino(e)) : [], - pagination: object?.pagination ? PageResponse.fromAmino(object.pagination) : undefined - }; + const message = createBaseActiveGaugesPerDenomResponse(); + message.data = object.data?.map(e => Gauge.fromAmino(e)) || []; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromAmino(object.pagination); + } + return message; }, toAmino(message: ActiveGaugesPerDenomResponse): ActiveGaugesPerDenomResponseAmino { const obj: any = {}; @@ -1100,13 +1534,25 @@ export const ActiveGaugesPerDenomResponse = { }; } }; +GlobalDecoderRegistry.register(ActiveGaugesPerDenomResponse.typeUrl, ActiveGaugesPerDenomResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(ActiveGaugesPerDenomResponse.aminoType, ActiveGaugesPerDenomResponse.typeUrl); function createBaseUpcomingGaugesRequest(): UpcomingGaugesRequest { return { - pagination: PageRequest.fromPartial({}) + pagination: undefined }; } export const UpcomingGaugesRequest = { typeUrl: "/osmosis.incentives.UpcomingGaugesRequest", + aminoType: "osmosis/incentives/upcoming-gauges-request", + is(o: any): o is UpcomingGaugesRequest { + return o && o.$typeUrl === UpcomingGaugesRequest.typeUrl; + }, + isSDK(o: any): o is UpcomingGaugesRequestSDKType { + return o && o.$typeUrl === UpcomingGaugesRequest.typeUrl; + }, + isAmino(o: any): o is UpcomingGaugesRequestAmino { + return o && o.$typeUrl === UpcomingGaugesRequest.typeUrl; + }, encode(message: UpcomingGaugesRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.pagination !== undefined) { PageRequest.encode(message.pagination, writer.uint32(10).fork()).ldelim(); @@ -1130,15 +1576,27 @@ export const UpcomingGaugesRequest = { } return message; }, + fromJSON(object: any): UpcomingGaugesRequest { + return { + pagination: isSet(object.pagination) ? PageRequest.fromJSON(object.pagination) : undefined + }; + }, + toJSON(message: UpcomingGaugesRequest): unknown { + const obj: any = {}; + message.pagination !== undefined && (obj.pagination = message.pagination ? PageRequest.toJSON(message.pagination) : undefined); + return obj; + }, fromPartial(object: Partial): UpcomingGaugesRequest { const message = createBaseUpcomingGaugesRequest(); message.pagination = object.pagination !== undefined && object.pagination !== null ? PageRequest.fromPartial(object.pagination) : undefined; return message; }, fromAmino(object: UpcomingGaugesRequestAmino): UpcomingGaugesRequest { - return { - pagination: object?.pagination ? PageRequest.fromAmino(object.pagination) : undefined - }; + const message = createBaseUpcomingGaugesRequest(); + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromAmino(object.pagination); + } + return message; }, toAmino(message: UpcomingGaugesRequest): UpcomingGaugesRequestAmino { const obj: any = {}; @@ -1167,14 +1625,26 @@ export const UpcomingGaugesRequest = { }; } }; +GlobalDecoderRegistry.register(UpcomingGaugesRequest.typeUrl, UpcomingGaugesRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(UpcomingGaugesRequest.aminoType, UpcomingGaugesRequest.typeUrl); function createBaseUpcomingGaugesResponse(): UpcomingGaugesResponse { return { data: [], - pagination: PageResponse.fromPartial({}) + pagination: undefined }; } export const UpcomingGaugesResponse = { typeUrl: "/osmosis.incentives.UpcomingGaugesResponse", + aminoType: "osmosis/incentives/upcoming-gauges-response", + is(o: any): o is UpcomingGaugesResponse { + return o && (o.$typeUrl === UpcomingGaugesResponse.typeUrl || Array.isArray(o.data) && (!o.data.length || Gauge.is(o.data[0]))); + }, + isSDK(o: any): o is UpcomingGaugesResponseSDKType { + return o && (o.$typeUrl === UpcomingGaugesResponse.typeUrl || Array.isArray(o.data) && (!o.data.length || Gauge.isSDK(o.data[0]))); + }, + isAmino(o: any): o is UpcomingGaugesResponseAmino { + return o && (o.$typeUrl === UpcomingGaugesResponse.typeUrl || Array.isArray(o.data) && (!o.data.length || Gauge.isAmino(o.data[0]))); + }, encode(message: UpcomingGaugesResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.data) { Gauge.encode(v!, writer.uint32(10).fork()).ldelim(); @@ -1204,6 +1674,22 @@ export const UpcomingGaugesResponse = { } return message; }, + fromJSON(object: any): UpcomingGaugesResponse { + return { + data: Array.isArray(object?.data) ? object.data.map((e: any) => Gauge.fromJSON(e)) : [], + pagination: isSet(object.pagination) ? PageResponse.fromJSON(object.pagination) : undefined + }; + }, + toJSON(message: UpcomingGaugesResponse): unknown { + const obj: any = {}; + if (message.data) { + obj.data = message.data.map(e => e ? Gauge.toJSON(e) : undefined); + } else { + obj.data = []; + } + message.pagination !== undefined && (obj.pagination = message.pagination ? PageResponse.toJSON(message.pagination) : undefined); + return obj; + }, fromPartial(object: Partial): UpcomingGaugesResponse { const message = createBaseUpcomingGaugesResponse(); message.data = object.data?.map(e => Gauge.fromPartial(e)) || []; @@ -1211,10 +1697,12 @@ export const UpcomingGaugesResponse = { return message; }, fromAmino(object: UpcomingGaugesResponseAmino): UpcomingGaugesResponse { - return { - data: Array.isArray(object?.data) ? object.data.map((e: any) => Gauge.fromAmino(e)) : [], - pagination: object?.pagination ? PageResponse.fromAmino(object.pagination) : undefined - }; + const message = createBaseUpcomingGaugesResponse(); + message.data = object.data?.map(e => Gauge.fromAmino(e)) || []; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromAmino(object.pagination); + } + return message; }, toAmino(message: UpcomingGaugesResponse): UpcomingGaugesResponseAmino { const obj: any = {}; @@ -1248,14 +1736,26 @@ export const UpcomingGaugesResponse = { }; } }; +GlobalDecoderRegistry.register(UpcomingGaugesResponse.typeUrl, UpcomingGaugesResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(UpcomingGaugesResponse.aminoType, UpcomingGaugesResponse.typeUrl); function createBaseUpcomingGaugesPerDenomRequest(): UpcomingGaugesPerDenomRequest { return { denom: "", - pagination: PageRequest.fromPartial({}) + pagination: undefined }; } export const UpcomingGaugesPerDenomRequest = { typeUrl: "/osmosis.incentives.UpcomingGaugesPerDenomRequest", + aminoType: "osmosis/incentives/upcoming-gauges-per-denom-request", + is(o: any): o is UpcomingGaugesPerDenomRequest { + return o && (o.$typeUrl === UpcomingGaugesPerDenomRequest.typeUrl || typeof o.denom === "string"); + }, + isSDK(o: any): o is UpcomingGaugesPerDenomRequestSDKType { + return o && (o.$typeUrl === UpcomingGaugesPerDenomRequest.typeUrl || typeof o.denom === "string"); + }, + isAmino(o: any): o is UpcomingGaugesPerDenomRequestAmino { + return o && (o.$typeUrl === UpcomingGaugesPerDenomRequest.typeUrl || typeof o.denom === "string"); + }, encode(message: UpcomingGaugesPerDenomRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.denom !== "") { writer.uint32(10).string(message.denom); @@ -1285,6 +1785,18 @@ export const UpcomingGaugesPerDenomRequest = { } return message; }, + fromJSON(object: any): UpcomingGaugesPerDenomRequest { + return { + denom: isSet(object.denom) ? String(object.denom) : "", + pagination: isSet(object.pagination) ? PageRequest.fromJSON(object.pagination) : undefined + }; + }, + toJSON(message: UpcomingGaugesPerDenomRequest): unknown { + const obj: any = {}; + message.denom !== undefined && (obj.denom = message.denom); + message.pagination !== undefined && (obj.pagination = message.pagination ? PageRequest.toJSON(message.pagination) : undefined); + return obj; + }, fromPartial(object: Partial): UpcomingGaugesPerDenomRequest { const message = createBaseUpcomingGaugesPerDenomRequest(); message.denom = object.denom ?? ""; @@ -1292,10 +1804,14 @@ export const UpcomingGaugesPerDenomRequest = { return message; }, fromAmino(object: UpcomingGaugesPerDenomRequestAmino): UpcomingGaugesPerDenomRequest { - return { - denom: object.denom, - pagination: object?.pagination ? PageRequest.fromAmino(object.pagination) : undefined - }; + const message = createBaseUpcomingGaugesPerDenomRequest(); + if (object.denom !== undefined && object.denom !== null) { + message.denom = object.denom; + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromAmino(object.pagination); + } + return message; }, toAmino(message: UpcomingGaugesPerDenomRequest): UpcomingGaugesPerDenomRequestAmino { const obj: any = {}; @@ -1325,14 +1841,26 @@ export const UpcomingGaugesPerDenomRequest = { }; } }; +GlobalDecoderRegistry.register(UpcomingGaugesPerDenomRequest.typeUrl, UpcomingGaugesPerDenomRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(UpcomingGaugesPerDenomRequest.aminoType, UpcomingGaugesPerDenomRequest.typeUrl); function createBaseUpcomingGaugesPerDenomResponse(): UpcomingGaugesPerDenomResponse { return { upcomingGauges: [], - pagination: PageResponse.fromPartial({}) + pagination: undefined }; } export const UpcomingGaugesPerDenomResponse = { typeUrl: "/osmosis.incentives.UpcomingGaugesPerDenomResponse", + aminoType: "osmosis/incentives/upcoming-gauges-per-denom-response", + is(o: any): o is UpcomingGaugesPerDenomResponse { + return o && (o.$typeUrl === UpcomingGaugesPerDenomResponse.typeUrl || Array.isArray(o.upcomingGauges) && (!o.upcomingGauges.length || Gauge.is(o.upcomingGauges[0]))); + }, + isSDK(o: any): o is UpcomingGaugesPerDenomResponseSDKType { + return o && (o.$typeUrl === UpcomingGaugesPerDenomResponse.typeUrl || Array.isArray(o.upcoming_gauges) && (!o.upcoming_gauges.length || Gauge.isSDK(o.upcoming_gauges[0]))); + }, + isAmino(o: any): o is UpcomingGaugesPerDenomResponseAmino { + return o && (o.$typeUrl === UpcomingGaugesPerDenomResponse.typeUrl || Array.isArray(o.upcoming_gauges) && (!o.upcoming_gauges.length || Gauge.isAmino(o.upcoming_gauges[0]))); + }, encode(message: UpcomingGaugesPerDenomResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.upcomingGauges) { Gauge.encode(v!, writer.uint32(10).fork()).ldelim(); @@ -1362,6 +1890,22 @@ export const UpcomingGaugesPerDenomResponse = { } return message; }, + fromJSON(object: any): UpcomingGaugesPerDenomResponse { + return { + upcomingGauges: Array.isArray(object?.upcomingGauges) ? object.upcomingGauges.map((e: any) => Gauge.fromJSON(e)) : [], + pagination: isSet(object.pagination) ? PageResponse.fromJSON(object.pagination) : undefined + }; + }, + toJSON(message: UpcomingGaugesPerDenomResponse): unknown { + const obj: any = {}; + if (message.upcomingGauges) { + obj.upcomingGauges = message.upcomingGauges.map(e => e ? Gauge.toJSON(e) : undefined); + } else { + obj.upcomingGauges = []; + } + message.pagination !== undefined && (obj.pagination = message.pagination ? PageResponse.toJSON(message.pagination) : undefined); + return obj; + }, fromPartial(object: Partial): UpcomingGaugesPerDenomResponse { const message = createBaseUpcomingGaugesPerDenomResponse(); message.upcomingGauges = object.upcomingGauges?.map(e => Gauge.fromPartial(e)) || []; @@ -1369,10 +1913,12 @@ export const UpcomingGaugesPerDenomResponse = { return message; }, fromAmino(object: UpcomingGaugesPerDenomResponseAmino): UpcomingGaugesPerDenomResponse { - return { - upcomingGauges: Array.isArray(object?.upcoming_gauges) ? object.upcoming_gauges.map((e: any) => Gauge.fromAmino(e)) : [], - pagination: object?.pagination ? PageResponse.fromAmino(object.pagination) : undefined - }; + const message = createBaseUpcomingGaugesPerDenomResponse(); + message.upcomingGauges = object.upcoming_gauges?.map(e => Gauge.fromAmino(e)) || []; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromAmino(object.pagination); + } + return message; }, toAmino(message: UpcomingGaugesPerDenomResponse): UpcomingGaugesPerDenomResponseAmino { const obj: any = {}; @@ -1406,6 +1952,8 @@ export const UpcomingGaugesPerDenomResponse = { }; } }; +GlobalDecoderRegistry.register(UpcomingGaugesPerDenomResponse.typeUrl, UpcomingGaugesPerDenomResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(UpcomingGaugesPerDenomResponse.aminoType, UpcomingGaugesPerDenomResponse.typeUrl); function createBaseRewardsEstRequest(): RewardsEstRequest { return { owner: "", @@ -1415,6 +1963,16 @@ function createBaseRewardsEstRequest(): RewardsEstRequest { } export const RewardsEstRequest = { typeUrl: "/osmosis.incentives.RewardsEstRequest", + aminoType: "osmosis/incentives/rewards-est-request", + is(o: any): o is RewardsEstRequest { + return o && (o.$typeUrl === RewardsEstRequest.typeUrl || typeof o.owner === "string" && Array.isArray(o.lockIds) && (!o.lockIds.length || typeof o.lockIds[0] === "bigint") && typeof o.endEpoch === "bigint"); + }, + isSDK(o: any): o is RewardsEstRequestSDKType { + return o && (o.$typeUrl === RewardsEstRequest.typeUrl || typeof o.owner === "string" && Array.isArray(o.lock_ids) && (!o.lock_ids.length || typeof o.lock_ids[0] === "bigint") && typeof o.end_epoch === "bigint"); + }, + isAmino(o: any): o is RewardsEstRequestAmino { + return o && (o.$typeUrl === RewardsEstRequest.typeUrl || typeof o.owner === "string" && Array.isArray(o.lock_ids) && (!o.lock_ids.length || typeof o.lock_ids[0] === "bigint") && typeof o.end_epoch === "bigint"); + }, encode(message: RewardsEstRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.owner !== "") { writer.uint32(10).string(message.owner); @@ -1459,6 +2017,24 @@ export const RewardsEstRequest = { } return message; }, + fromJSON(object: any): RewardsEstRequest { + return { + owner: isSet(object.owner) ? String(object.owner) : "", + lockIds: Array.isArray(object?.lockIds) ? object.lockIds.map((e: any) => BigInt(e.toString())) : [], + endEpoch: isSet(object.endEpoch) ? BigInt(object.endEpoch.toString()) : BigInt(0) + }; + }, + toJSON(message: RewardsEstRequest): unknown { + const obj: any = {}; + message.owner !== undefined && (obj.owner = message.owner); + if (message.lockIds) { + obj.lockIds = message.lockIds.map(e => (e || BigInt(0)).toString()); + } else { + obj.lockIds = []; + } + message.endEpoch !== undefined && (obj.endEpoch = (message.endEpoch || BigInt(0)).toString()); + return obj; + }, fromPartial(object: Partial): RewardsEstRequest { const message = createBaseRewardsEstRequest(); message.owner = object.owner ?? ""; @@ -1467,11 +2043,15 @@ export const RewardsEstRequest = { return message; }, fromAmino(object: RewardsEstRequestAmino): RewardsEstRequest { - return { - owner: object.owner, - lockIds: Array.isArray(object?.lock_ids) ? object.lock_ids.map((e: any) => BigInt(e)) : [], - endEpoch: BigInt(object.end_epoch) - }; + const message = createBaseRewardsEstRequest(); + if (object.owner !== undefined && object.owner !== null) { + message.owner = object.owner; + } + message.lockIds = object.lock_ids?.map(e => BigInt(e)) || []; + if (object.end_epoch !== undefined && object.end_epoch !== null) { + message.endEpoch = BigInt(object.end_epoch); + } + return message; }, toAmino(message: RewardsEstRequest): RewardsEstRequestAmino { const obj: any = {}; @@ -1506,6 +2086,8 @@ export const RewardsEstRequest = { }; } }; +GlobalDecoderRegistry.register(RewardsEstRequest.typeUrl, RewardsEstRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(RewardsEstRequest.aminoType, RewardsEstRequest.typeUrl); function createBaseRewardsEstResponse(): RewardsEstResponse { return { coins: [] @@ -1513,6 +2095,16 @@ function createBaseRewardsEstResponse(): RewardsEstResponse { } export const RewardsEstResponse = { typeUrl: "/osmosis.incentives.RewardsEstResponse", + aminoType: "osmosis/incentives/rewards-est-response", + is(o: any): o is RewardsEstResponse { + return o && (o.$typeUrl === RewardsEstResponse.typeUrl || Array.isArray(o.coins) && (!o.coins.length || Coin.is(o.coins[0]))); + }, + isSDK(o: any): o is RewardsEstResponseSDKType { + return o && (o.$typeUrl === RewardsEstResponse.typeUrl || Array.isArray(o.coins) && (!o.coins.length || Coin.isSDK(o.coins[0]))); + }, + isAmino(o: any): o is RewardsEstResponseAmino { + return o && (o.$typeUrl === RewardsEstResponse.typeUrl || Array.isArray(o.coins) && (!o.coins.length || Coin.isAmino(o.coins[0]))); + }, encode(message: RewardsEstResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.coins) { Coin.encode(v!, writer.uint32(10).fork()).ldelim(); @@ -1536,15 +2128,29 @@ export const RewardsEstResponse = { } return message; }, + fromJSON(object: any): RewardsEstResponse { + return { + coins: Array.isArray(object?.coins) ? object.coins.map((e: any) => Coin.fromJSON(e)) : [] + }; + }, + toJSON(message: RewardsEstResponse): unknown { + const obj: any = {}; + if (message.coins) { + obj.coins = message.coins.map(e => e ? Coin.toJSON(e) : undefined); + } else { + obj.coins = []; + } + return obj; + }, fromPartial(object: Partial): RewardsEstResponse { const message = createBaseRewardsEstResponse(); message.coins = object.coins?.map(e => Coin.fromPartial(e)) || []; return message; }, fromAmino(object: RewardsEstResponseAmino): RewardsEstResponse { - return { - coins: Array.isArray(object?.coins) ? object.coins.map((e: any) => Coin.fromAmino(e)) : [] - }; + const message = createBaseRewardsEstResponse(); + message.coins = object.coins?.map(e => Coin.fromAmino(e)) || []; + return message; }, toAmino(message: RewardsEstResponse): RewardsEstResponseAmino { const obj: any = {}; @@ -1577,11 +2183,23 @@ export const RewardsEstResponse = { }; } }; +GlobalDecoderRegistry.register(RewardsEstResponse.typeUrl, RewardsEstResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(RewardsEstResponse.aminoType, RewardsEstResponse.typeUrl); function createBaseQueryLockableDurationsRequest(): QueryLockableDurationsRequest { return {}; } export const QueryLockableDurationsRequest = { typeUrl: "/osmosis.incentives.QueryLockableDurationsRequest", + aminoType: "osmosis/incentives/query-lockable-durations-request", + is(o: any): o is QueryLockableDurationsRequest { + return o && o.$typeUrl === QueryLockableDurationsRequest.typeUrl; + }, + isSDK(o: any): o is QueryLockableDurationsRequestSDKType { + return o && o.$typeUrl === QueryLockableDurationsRequest.typeUrl; + }, + isAmino(o: any): o is QueryLockableDurationsRequestAmino { + return o && o.$typeUrl === QueryLockableDurationsRequest.typeUrl; + }, encode(_: QueryLockableDurationsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, @@ -1599,12 +2217,20 @@ export const QueryLockableDurationsRequest = { } return message; }, + fromJSON(_: any): QueryLockableDurationsRequest { + return {}; + }, + toJSON(_: QueryLockableDurationsRequest): unknown { + const obj: any = {}; + return obj; + }, fromPartial(_: Partial): QueryLockableDurationsRequest { const message = createBaseQueryLockableDurationsRequest(); return message; }, fromAmino(_: QueryLockableDurationsRequestAmino): QueryLockableDurationsRequest { - return {}; + const message = createBaseQueryLockableDurationsRequest(); + return message; }, toAmino(_: QueryLockableDurationsRequest): QueryLockableDurationsRequestAmino { const obj: any = {}; @@ -1632,6 +2258,8 @@ export const QueryLockableDurationsRequest = { }; } }; +GlobalDecoderRegistry.register(QueryLockableDurationsRequest.typeUrl, QueryLockableDurationsRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryLockableDurationsRequest.aminoType, QueryLockableDurationsRequest.typeUrl); function createBaseQueryLockableDurationsResponse(): QueryLockableDurationsResponse { return { lockableDurations: [] @@ -1639,6 +2267,16 @@ function createBaseQueryLockableDurationsResponse(): QueryLockableDurationsRespo } export const QueryLockableDurationsResponse = { typeUrl: "/osmosis.incentives.QueryLockableDurationsResponse", + aminoType: "osmosis/incentives/query-lockable-durations-response", + is(o: any): o is QueryLockableDurationsResponse { + return o && (o.$typeUrl === QueryLockableDurationsResponse.typeUrl || Array.isArray(o.lockableDurations) && (!o.lockableDurations.length || Duration.is(o.lockableDurations[0]))); + }, + isSDK(o: any): o is QueryLockableDurationsResponseSDKType { + return o && (o.$typeUrl === QueryLockableDurationsResponse.typeUrl || Array.isArray(o.lockable_durations) && (!o.lockable_durations.length || Duration.isSDK(o.lockable_durations[0]))); + }, + isAmino(o: any): o is QueryLockableDurationsResponseAmino { + return o && (o.$typeUrl === QueryLockableDurationsResponse.typeUrl || Array.isArray(o.lockable_durations) && (!o.lockable_durations.length || Duration.isAmino(o.lockable_durations[0]))); + }, encode(message: QueryLockableDurationsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.lockableDurations) { Duration.encode(v!, writer.uint32(10).fork()).ldelim(); @@ -1662,15 +2300,29 @@ export const QueryLockableDurationsResponse = { } return message; }, + fromJSON(object: any): QueryLockableDurationsResponse { + return { + lockableDurations: Array.isArray(object?.lockableDurations) ? object.lockableDurations.map((e: any) => Duration.fromJSON(e)) : [] + }; + }, + toJSON(message: QueryLockableDurationsResponse): unknown { + const obj: any = {}; + if (message.lockableDurations) { + obj.lockableDurations = message.lockableDurations.map(e => e ? Duration.toJSON(e) : undefined); + } else { + obj.lockableDurations = []; + } + return obj; + }, fromPartial(object: Partial): QueryLockableDurationsResponse { const message = createBaseQueryLockableDurationsResponse(); message.lockableDurations = object.lockableDurations?.map(e => Duration.fromPartial(e)) || []; return message; }, fromAmino(object: QueryLockableDurationsResponseAmino): QueryLockableDurationsResponse { - return { - lockableDurations: Array.isArray(object?.lockable_durations) ? object.lockable_durations.map((e: any) => Duration.fromAmino(e)) : [] - }; + const message = createBaseQueryLockableDurationsResponse(); + message.lockableDurations = object.lockable_durations?.map(e => Duration.fromAmino(e)) || []; + return message; }, toAmino(message: QueryLockableDurationsResponse): QueryLockableDurationsResponseAmino { const obj: any = {}; @@ -1702,4 +2354,997 @@ export const QueryLockableDurationsResponse = { value: QueryLockableDurationsResponse.encode(message).finish() }; } -}; \ No newline at end of file +}; +GlobalDecoderRegistry.register(QueryLockableDurationsResponse.typeUrl, QueryLockableDurationsResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryLockableDurationsResponse.aminoType, QueryLockableDurationsResponse.typeUrl); +function createBaseQueryAllGroupsRequest(): QueryAllGroupsRequest { + return {}; +} +export const QueryAllGroupsRequest = { + typeUrl: "/osmosis.incentives.QueryAllGroupsRequest", + aminoType: "osmosis/incentives/query-all-groups-request", + is(o: any): o is QueryAllGroupsRequest { + return o && o.$typeUrl === QueryAllGroupsRequest.typeUrl; + }, + isSDK(o: any): o is QueryAllGroupsRequestSDKType { + return o && o.$typeUrl === QueryAllGroupsRequest.typeUrl; + }, + isAmino(o: any): o is QueryAllGroupsRequestAmino { + return o && o.$typeUrl === QueryAllGroupsRequest.typeUrl; + }, + encode(_: QueryAllGroupsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryAllGroupsRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryAllGroupsRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(_: any): QueryAllGroupsRequest { + return {}; + }, + toJSON(_: QueryAllGroupsRequest): unknown { + const obj: any = {}; + return obj; + }, + fromPartial(_: Partial): QueryAllGroupsRequest { + const message = createBaseQueryAllGroupsRequest(); + return message; + }, + fromAmino(_: QueryAllGroupsRequestAmino): QueryAllGroupsRequest { + const message = createBaseQueryAllGroupsRequest(); + return message; + }, + toAmino(_: QueryAllGroupsRequest): QueryAllGroupsRequestAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: QueryAllGroupsRequestAminoMsg): QueryAllGroupsRequest { + return QueryAllGroupsRequest.fromAmino(object.value); + }, + toAminoMsg(message: QueryAllGroupsRequest): QueryAllGroupsRequestAminoMsg { + return { + type: "osmosis/incentives/query-all-groups-request", + value: QueryAllGroupsRequest.toAmino(message) + }; + }, + fromProtoMsg(message: QueryAllGroupsRequestProtoMsg): QueryAllGroupsRequest { + return QueryAllGroupsRequest.decode(message.value); + }, + toProto(message: QueryAllGroupsRequest): Uint8Array { + return QueryAllGroupsRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryAllGroupsRequest): QueryAllGroupsRequestProtoMsg { + return { + typeUrl: "/osmosis.incentives.QueryAllGroupsRequest", + value: QueryAllGroupsRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryAllGroupsRequest.typeUrl, QueryAllGroupsRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryAllGroupsRequest.aminoType, QueryAllGroupsRequest.typeUrl); +function createBaseQueryAllGroupsResponse(): QueryAllGroupsResponse { + return { + groups: [] + }; +} +export const QueryAllGroupsResponse = { + typeUrl: "/osmosis.incentives.QueryAllGroupsResponse", + aminoType: "osmosis/incentives/query-all-groups-response", + is(o: any): o is QueryAllGroupsResponse { + return o && (o.$typeUrl === QueryAllGroupsResponse.typeUrl || Array.isArray(o.groups) && (!o.groups.length || Group.is(o.groups[0]))); + }, + isSDK(o: any): o is QueryAllGroupsResponseSDKType { + return o && (o.$typeUrl === QueryAllGroupsResponse.typeUrl || Array.isArray(o.groups) && (!o.groups.length || Group.isSDK(o.groups[0]))); + }, + isAmino(o: any): o is QueryAllGroupsResponseAmino { + return o && (o.$typeUrl === QueryAllGroupsResponse.typeUrl || Array.isArray(o.groups) && (!o.groups.length || Group.isAmino(o.groups[0]))); + }, + encode(message: QueryAllGroupsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.groups) { + Group.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryAllGroupsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryAllGroupsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.groups.push(Group.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): QueryAllGroupsResponse { + return { + groups: Array.isArray(object?.groups) ? object.groups.map((e: any) => Group.fromJSON(e)) : [] + }; + }, + toJSON(message: QueryAllGroupsResponse): unknown { + const obj: any = {}; + if (message.groups) { + obj.groups = message.groups.map(e => e ? Group.toJSON(e) : undefined); + } else { + obj.groups = []; + } + return obj; + }, + fromPartial(object: Partial): QueryAllGroupsResponse { + const message = createBaseQueryAllGroupsResponse(); + message.groups = object.groups?.map(e => Group.fromPartial(e)) || []; + return message; + }, + fromAmino(object: QueryAllGroupsResponseAmino): QueryAllGroupsResponse { + const message = createBaseQueryAllGroupsResponse(); + message.groups = object.groups?.map(e => Group.fromAmino(e)) || []; + return message; + }, + toAmino(message: QueryAllGroupsResponse): QueryAllGroupsResponseAmino { + const obj: any = {}; + if (message.groups) { + obj.groups = message.groups.map(e => e ? Group.toAmino(e) : undefined); + } else { + obj.groups = []; + } + return obj; + }, + fromAminoMsg(object: QueryAllGroupsResponseAminoMsg): QueryAllGroupsResponse { + return QueryAllGroupsResponse.fromAmino(object.value); + }, + toAminoMsg(message: QueryAllGroupsResponse): QueryAllGroupsResponseAminoMsg { + return { + type: "osmosis/incentives/query-all-groups-response", + value: QueryAllGroupsResponse.toAmino(message) + }; + }, + fromProtoMsg(message: QueryAllGroupsResponseProtoMsg): QueryAllGroupsResponse { + return QueryAllGroupsResponse.decode(message.value); + }, + toProto(message: QueryAllGroupsResponse): Uint8Array { + return QueryAllGroupsResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryAllGroupsResponse): QueryAllGroupsResponseProtoMsg { + return { + typeUrl: "/osmosis.incentives.QueryAllGroupsResponse", + value: QueryAllGroupsResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryAllGroupsResponse.typeUrl, QueryAllGroupsResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryAllGroupsResponse.aminoType, QueryAllGroupsResponse.typeUrl); +function createBaseQueryAllGroupsGaugesRequest(): QueryAllGroupsGaugesRequest { + return {}; +} +export const QueryAllGroupsGaugesRequest = { + typeUrl: "/osmosis.incentives.QueryAllGroupsGaugesRequest", + aminoType: "osmosis/incentives/query-all-groups-gauges-request", + is(o: any): o is QueryAllGroupsGaugesRequest { + return o && o.$typeUrl === QueryAllGroupsGaugesRequest.typeUrl; + }, + isSDK(o: any): o is QueryAllGroupsGaugesRequestSDKType { + return o && o.$typeUrl === QueryAllGroupsGaugesRequest.typeUrl; + }, + isAmino(o: any): o is QueryAllGroupsGaugesRequestAmino { + return o && o.$typeUrl === QueryAllGroupsGaugesRequest.typeUrl; + }, + encode(_: QueryAllGroupsGaugesRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryAllGroupsGaugesRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryAllGroupsGaugesRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(_: any): QueryAllGroupsGaugesRequest { + return {}; + }, + toJSON(_: QueryAllGroupsGaugesRequest): unknown { + const obj: any = {}; + return obj; + }, + fromPartial(_: Partial): QueryAllGroupsGaugesRequest { + const message = createBaseQueryAllGroupsGaugesRequest(); + return message; + }, + fromAmino(_: QueryAllGroupsGaugesRequestAmino): QueryAllGroupsGaugesRequest { + const message = createBaseQueryAllGroupsGaugesRequest(); + return message; + }, + toAmino(_: QueryAllGroupsGaugesRequest): QueryAllGroupsGaugesRequestAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: QueryAllGroupsGaugesRequestAminoMsg): QueryAllGroupsGaugesRequest { + return QueryAllGroupsGaugesRequest.fromAmino(object.value); + }, + toAminoMsg(message: QueryAllGroupsGaugesRequest): QueryAllGroupsGaugesRequestAminoMsg { + return { + type: "osmosis/incentives/query-all-groups-gauges-request", + value: QueryAllGroupsGaugesRequest.toAmino(message) + }; + }, + fromProtoMsg(message: QueryAllGroupsGaugesRequestProtoMsg): QueryAllGroupsGaugesRequest { + return QueryAllGroupsGaugesRequest.decode(message.value); + }, + toProto(message: QueryAllGroupsGaugesRequest): Uint8Array { + return QueryAllGroupsGaugesRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryAllGroupsGaugesRequest): QueryAllGroupsGaugesRequestProtoMsg { + return { + typeUrl: "/osmosis.incentives.QueryAllGroupsGaugesRequest", + value: QueryAllGroupsGaugesRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryAllGroupsGaugesRequest.typeUrl, QueryAllGroupsGaugesRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryAllGroupsGaugesRequest.aminoType, QueryAllGroupsGaugesRequest.typeUrl); +function createBaseQueryAllGroupsGaugesResponse(): QueryAllGroupsGaugesResponse { + return { + gauges: [] + }; +} +export const QueryAllGroupsGaugesResponse = { + typeUrl: "/osmosis.incentives.QueryAllGroupsGaugesResponse", + aminoType: "osmosis/incentives/query-all-groups-gauges-response", + is(o: any): o is QueryAllGroupsGaugesResponse { + return o && (o.$typeUrl === QueryAllGroupsGaugesResponse.typeUrl || Array.isArray(o.gauges) && (!o.gauges.length || Gauge.is(o.gauges[0]))); + }, + isSDK(o: any): o is QueryAllGroupsGaugesResponseSDKType { + return o && (o.$typeUrl === QueryAllGroupsGaugesResponse.typeUrl || Array.isArray(o.gauges) && (!o.gauges.length || Gauge.isSDK(o.gauges[0]))); + }, + isAmino(o: any): o is QueryAllGroupsGaugesResponseAmino { + return o && (o.$typeUrl === QueryAllGroupsGaugesResponse.typeUrl || Array.isArray(o.gauges) && (!o.gauges.length || Gauge.isAmino(o.gauges[0]))); + }, + encode(message: QueryAllGroupsGaugesResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.gauges) { + Gauge.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryAllGroupsGaugesResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryAllGroupsGaugesResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.gauges.push(Gauge.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): QueryAllGroupsGaugesResponse { + return { + gauges: Array.isArray(object?.gauges) ? object.gauges.map((e: any) => Gauge.fromJSON(e)) : [] + }; + }, + toJSON(message: QueryAllGroupsGaugesResponse): unknown { + const obj: any = {}; + if (message.gauges) { + obj.gauges = message.gauges.map(e => e ? Gauge.toJSON(e) : undefined); + } else { + obj.gauges = []; + } + return obj; + }, + fromPartial(object: Partial): QueryAllGroupsGaugesResponse { + const message = createBaseQueryAllGroupsGaugesResponse(); + message.gauges = object.gauges?.map(e => Gauge.fromPartial(e)) || []; + return message; + }, + fromAmino(object: QueryAllGroupsGaugesResponseAmino): QueryAllGroupsGaugesResponse { + const message = createBaseQueryAllGroupsGaugesResponse(); + message.gauges = object.gauges?.map(e => Gauge.fromAmino(e)) || []; + return message; + }, + toAmino(message: QueryAllGroupsGaugesResponse): QueryAllGroupsGaugesResponseAmino { + const obj: any = {}; + if (message.gauges) { + obj.gauges = message.gauges.map(e => e ? Gauge.toAmino(e) : undefined); + } else { + obj.gauges = []; + } + return obj; + }, + fromAminoMsg(object: QueryAllGroupsGaugesResponseAminoMsg): QueryAllGroupsGaugesResponse { + return QueryAllGroupsGaugesResponse.fromAmino(object.value); + }, + toAminoMsg(message: QueryAllGroupsGaugesResponse): QueryAllGroupsGaugesResponseAminoMsg { + return { + type: "osmosis/incentives/query-all-groups-gauges-response", + value: QueryAllGroupsGaugesResponse.toAmino(message) + }; + }, + fromProtoMsg(message: QueryAllGroupsGaugesResponseProtoMsg): QueryAllGroupsGaugesResponse { + return QueryAllGroupsGaugesResponse.decode(message.value); + }, + toProto(message: QueryAllGroupsGaugesResponse): Uint8Array { + return QueryAllGroupsGaugesResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryAllGroupsGaugesResponse): QueryAllGroupsGaugesResponseProtoMsg { + return { + typeUrl: "/osmosis.incentives.QueryAllGroupsGaugesResponse", + value: QueryAllGroupsGaugesResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryAllGroupsGaugesResponse.typeUrl, QueryAllGroupsGaugesResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryAllGroupsGaugesResponse.aminoType, QueryAllGroupsGaugesResponse.typeUrl); +function createBaseQueryAllGroupsWithGaugeRequest(): QueryAllGroupsWithGaugeRequest { + return {}; +} +export const QueryAllGroupsWithGaugeRequest = { + typeUrl: "/osmosis.incentives.QueryAllGroupsWithGaugeRequest", + aminoType: "osmosis/incentives/query-all-groups-with-gauge-request", + is(o: any): o is QueryAllGroupsWithGaugeRequest { + return o && o.$typeUrl === QueryAllGroupsWithGaugeRequest.typeUrl; + }, + isSDK(o: any): o is QueryAllGroupsWithGaugeRequestSDKType { + return o && o.$typeUrl === QueryAllGroupsWithGaugeRequest.typeUrl; + }, + isAmino(o: any): o is QueryAllGroupsWithGaugeRequestAmino { + return o && o.$typeUrl === QueryAllGroupsWithGaugeRequest.typeUrl; + }, + encode(_: QueryAllGroupsWithGaugeRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryAllGroupsWithGaugeRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryAllGroupsWithGaugeRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(_: any): QueryAllGroupsWithGaugeRequest { + return {}; + }, + toJSON(_: QueryAllGroupsWithGaugeRequest): unknown { + const obj: any = {}; + return obj; + }, + fromPartial(_: Partial): QueryAllGroupsWithGaugeRequest { + const message = createBaseQueryAllGroupsWithGaugeRequest(); + return message; + }, + fromAmino(_: QueryAllGroupsWithGaugeRequestAmino): QueryAllGroupsWithGaugeRequest { + const message = createBaseQueryAllGroupsWithGaugeRequest(); + return message; + }, + toAmino(_: QueryAllGroupsWithGaugeRequest): QueryAllGroupsWithGaugeRequestAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: QueryAllGroupsWithGaugeRequestAminoMsg): QueryAllGroupsWithGaugeRequest { + return QueryAllGroupsWithGaugeRequest.fromAmino(object.value); + }, + toAminoMsg(message: QueryAllGroupsWithGaugeRequest): QueryAllGroupsWithGaugeRequestAminoMsg { + return { + type: "osmosis/incentives/query-all-groups-with-gauge-request", + value: QueryAllGroupsWithGaugeRequest.toAmino(message) + }; + }, + fromProtoMsg(message: QueryAllGroupsWithGaugeRequestProtoMsg): QueryAllGroupsWithGaugeRequest { + return QueryAllGroupsWithGaugeRequest.decode(message.value); + }, + toProto(message: QueryAllGroupsWithGaugeRequest): Uint8Array { + return QueryAllGroupsWithGaugeRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryAllGroupsWithGaugeRequest): QueryAllGroupsWithGaugeRequestProtoMsg { + return { + typeUrl: "/osmosis.incentives.QueryAllGroupsWithGaugeRequest", + value: QueryAllGroupsWithGaugeRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryAllGroupsWithGaugeRequest.typeUrl, QueryAllGroupsWithGaugeRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryAllGroupsWithGaugeRequest.aminoType, QueryAllGroupsWithGaugeRequest.typeUrl); +function createBaseQueryAllGroupsWithGaugeResponse(): QueryAllGroupsWithGaugeResponse { + return { + groupsWithGauge: [] + }; +} +export const QueryAllGroupsWithGaugeResponse = { + typeUrl: "/osmosis.incentives.QueryAllGroupsWithGaugeResponse", + aminoType: "osmosis/incentives/query-all-groups-with-gauge-response", + is(o: any): o is QueryAllGroupsWithGaugeResponse { + return o && (o.$typeUrl === QueryAllGroupsWithGaugeResponse.typeUrl || Array.isArray(o.groupsWithGauge) && (!o.groupsWithGauge.length || GroupsWithGauge.is(o.groupsWithGauge[0]))); + }, + isSDK(o: any): o is QueryAllGroupsWithGaugeResponseSDKType { + return o && (o.$typeUrl === QueryAllGroupsWithGaugeResponse.typeUrl || Array.isArray(o.groups_with_gauge) && (!o.groups_with_gauge.length || GroupsWithGauge.isSDK(o.groups_with_gauge[0]))); + }, + isAmino(o: any): o is QueryAllGroupsWithGaugeResponseAmino { + return o && (o.$typeUrl === QueryAllGroupsWithGaugeResponse.typeUrl || Array.isArray(o.groups_with_gauge) && (!o.groups_with_gauge.length || GroupsWithGauge.isAmino(o.groups_with_gauge[0]))); + }, + encode(message: QueryAllGroupsWithGaugeResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.groupsWithGauge) { + GroupsWithGauge.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryAllGroupsWithGaugeResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryAllGroupsWithGaugeResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.groupsWithGauge.push(GroupsWithGauge.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): QueryAllGroupsWithGaugeResponse { + return { + groupsWithGauge: Array.isArray(object?.groupsWithGauge) ? object.groupsWithGauge.map((e: any) => GroupsWithGauge.fromJSON(e)) : [] + }; + }, + toJSON(message: QueryAllGroupsWithGaugeResponse): unknown { + const obj: any = {}; + if (message.groupsWithGauge) { + obj.groupsWithGauge = message.groupsWithGauge.map(e => e ? GroupsWithGauge.toJSON(e) : undefined); + } else { + obj.groupsWithGauge = []; + } + return obj; + }, + fromPartial(object: Partial): QueryAllGroupsWithGaugeResponse { + const message = createBaseQueryAllGroupsWithGaugeResponse(); + message.groupsWithGauge = object.groupsWithGauge?.map(e => GroupsWithGauge.fromPartial(e)) || []; + return message; + }, + fromAmino(object: QueryAllGroupsWithGaugeResponseAmino): QueryAllGroupsWithGaugeResponse { + const message = createBaseQueryAllGroupsWithGaugeResponse(); + message.groupsWithGauge = object.groups_with_gauge?.map(e => GroupsWithGauge.fromAmino(e)) || []; + return message; + }, + toAmino(message: QueryAllGroupsWithGaugeResponse): QueryAllGroupsWithGaugeResponseAmino { + const obj: any = {}; + if (message.groupsWithGauge) { + obj.groups_with_gauge = message.groupsWithGauge.map(e => e ? GroupsWithGauge.toAmino(e) : undefined); + } else { + obj.groups_with_gauge = []; + } + return obj; + }, + fromAminoMsg(object: QueryAllGroupsWithGaugeResponseAminoMsg): QueryAllGroupsWithGaugeResponse { + return QueryAllGroupsWithGaugeResponse.fromAmino(object.value); + }, + toAminoMsg(message: QueryAllGroupsWithGaugeResponse): QueryAllGroupsWithGaugeResponseAminoMsg { + return { + type: "osmosis/incentives/query-all-groups-with-gauge-response", + value: QueryAllGroupsWithGaugeResponse.toAmino(message) + }; + }, + fromProtoMsg(message: QueryAllGroupsWithGaugeResponseProtoMsg): QueryAllGroupsWithGaugeResponse { + return QueryAllGroupsWithGaugeResponse.decode(message.value); + }, + toProto(message: QueryAllGroupsWithGaugeResponse): Uint8Array { + return QueryAllGroupsWithGaugeResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryAllGroupsWithGaugeResponse): QueryAllGroupsWithGaugeResponseProtoMsg { + return { + typeUrl: "/osmosis.incentives.QueryAllGroupsWithGaugeResponse", + value: QueryAllGroupsWithGaugeResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryAllGroupsWithGaugeResponse.typeUrl, QueryAllGroupsWithGaugeResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryAllGroupsWithGaugeResponse.aminoType, QueryAllGroupsWithGaugeResponse.typeUrl); +function createBaseQueryGroupByGroupGaugeIDRequest(): QueryGroupByGroupGaugeIDRequest { + return { + id: BigInt(0) + }; +} +export const QueryGroupByGroupGaugeIDRequest = { + typeUrl: "/osmosis.incentives.QueryGroupByGroupGaugeIDRequest", + aminoType: "osmosis/incentives/query-group-by-group-gauge-id-request", + is(o: any): o is QueryGroupByGroupGaugeIDRequest { + return o && (o.$typeUrl === QueryGroupByGroupGaugeIDRequest.typeUrl || typeof o.id === "bigint"); + }, + isSDK(o: any): o is QueryGroupByGroupGaugeIDRequestSDKType { + return o && (o.$typeUrl === QueryGroupByGroupGaugeIDRequest.typeUrl || typeof o.id === "bigint"); + }, + isAmino(o: any): o is QueryGroupByGroupGaugeIDRequestAmino { + return o && (o.$typeUrl === QueryGroupByGroupGaugeIDRequest.typeUrl || typeof o.id === "bigint"); + }, + encode(message: QueryGroupByGroupGaugeIDRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.id !== BigInt(0)) { + writer.uint32(8).uint64(message.id); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryGroupByGroupGaugeIDRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryGroupByGroupGaugeIDRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.id = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): QueryGroupByGroupGaugeIDRequest { + return { + id: isSet(object.id) ? BigInt(object.id.toString()) : BigInt(0) + }; + }, + toJSON(message: QueryGroupByGroupGaugeIDRequest): unknown { + const obj: any = {}; + message.id !== undefined && (obj.id = (message.id || BigInt(0)).toString()); + return obj; + }, + fromPartial(object: Partial): QueryGroupByGroupGaugeIDRequest { + const message = createBaseQueryGroupByGroupGaugeIDRequest(); + message.id = object.id !== undefined && object.id !== null ? BigInt(object.id.toString()) : BigInt(0); + return message; + }, + fromAmino(object: QueryGroupByGroupGaugeIDRequestAmino): QueryGroupByGroupGaugeIDRequest { + const message = createBaseQueryGroupByGroupGaugeIDRequest(); + if (object.id !== undefined && object.id !== null) { + message.id = BigInt(object.id); + } + return message; + }, + toAmino(message: QueryGroupByGroupGaugeIDRequest): QueryGroupByGroupGaugeIDRequestAmino { + const obj: any = {}; + obj.id = message.id ? message.id.toString() : undefined; + return obj; + }, + fromAminoMsg(object: QueryGroupByGroupGaugeIDRequestAminoMsg): QueryGroupByGroupGaugeIDRequest { + return QueryGroupByGroupGaugeIDRequest.fromAmino(object.value); + }, + toAminoMsg(message: QueryGroupByGroupGaugeIDRequest): QueryGroupByGroupGaugeIDRequestAminoMsg { + return { + type: "osmosis/incentives/query-group-by-group-gauge-id-request", + value: QueryGroupByGroupGaugeIDRequest.toAmino(message) + }; + }, + fromProtoMsg(message: QueryGroupByGroupGaugeIDRequestProtoMsg): QueryGroupByGroupGaugeIDRequest { + return QueryGroupByGroupGaugeIDRequest.decode(message.value); + }, + toProto(message: QueryGroupByGroupGaugeIDRequest): Uint8Array { + return QueryGroupByGroupGaugeIDRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryGroupByGroupGaugeIDRequest): QueryGroupByGroupGaugeIDRequestProtoMsg { + return { + typeUrl: "/osmosis.incentives.QueryGroupByGroupGaugeIDRequest", + value: QueryGroupByGroupGaugeIDRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryGroupByGroupGaugeIDRequest.typeUrl, QueryGroupByGroupGaugeIDRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryGroupByGroupGaugeIDRequest.aminoType, QueryGroupByGroupGaugeIDRequest.typeUrl); +function createBaseQueryGroupByGroupGaugeIDResponse(): QueryGroupByGroupGaugeIDResponse { + return { + group: Group.fromPartial({}) + }; +} +export const QueryGroupByGroupGaugeIDResponse = { + typeUrl: "/osmosis.incentives.QueryGroupByGroupGaugeIDResponse", + aminoType: "osmosis/incentives/query-group-by-group-gauge-id-response", + is(o: any): o is QueryGroupByGroupGaugeIDResponse { + return o && (o.$typeUrl === QueryGroupByGroupGaugeIDResponse.typeUrl || Group.is(o.group)); + }, + isSDK(o: any): o is QueryGroupByGroupGaugeIDResponseSDKType { + return o && (o.$typeUrl === QueryGroupByGroupGaugeIDResponse.typeUrl || Group.isSDK(o.group)); + }, + isAmino(o: any): o is QueryGroupByGroupGaugeIDResponseAmino { + return o && (o.$typeUrl === QueryGroupByGroupGaugeIDResponse.typeUrl || Group.isAmino(o.group)); + }, + encode(message: QueryGroupByGroupGaugeIDResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.group !== undefined) { + Group.encode(message.group, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryGroupByGroupGaugeIDResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryGroupByGroupGaugeIDResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.group = Group.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): QueryGroupByGroupGaugeIDResponse { + return { + group: isSet(object.group) ? Group.fromJSON(object.group) : undefined + }; + }, + toJSON(message: QueryGroupByGroupGaugeIDResponse): unknown { + const obj: any = {}; + message.group !== undefined && (obj.group = message.group ? Group.toJSON(message.group) : undefined); + return obj; + }, + fromPartial(object: Partial): QueryGroupByGroupGaugeIDResponse { + const message = createBaseQueryGroupByGroupGaugeIDResponse(); + message.group = object.group !== undefined && object.group !== null ? Group.fromPartial(object.group) : undefined; + return message; + }, + fromAmino(object: QueryGroupByGroupGaugeIDResponseAmino): QueryGroupByGroupGaugeIDResponse { + const message = createBaseQueryGroupByGroupGaugeIDResponse(); + if (object.group !== undefined && object.group !== null) { + message.group = Group.fromAmino(object.group); + } + return message; + }, + toAmino(message: QueryGroupByGroupGaugeIDResponse): QueryGroupByGroupGaugeIDResponseAmino { + const obj: any = {}; + obj.group = message.group ? Group.toAmino(message.group) : undefined; + return obj; + }, + fromAminoMsg(object: QueryGroupByGroupGaugeIDResponseAminoMsg): QueryGroupByGroupGaugeIDResponse { + return QueryGroupByGroupGaugeIDResponse.fromAmino(object.value); + }, + toAminoMsg(message: QueryGroupByGroupGaugeIDResponse): QueryGroupByGroupGaugeIDResponseAminoMsg { + return { + type: "osmosis/incentives/query-group-by-group-gauge-id-response", + value: QueryGroupByGroupGaugeIDResponse.toAmino(message) + }; + }, + fromProtoMsg(message: QueryGroupByGroupGaugeIDResponseProtoMsg): QueryGroupByGroupGaugeIDResponse { + return QueryGroupByGroupGaugeIDResponse.decode(message.value); + }, + toProto(message: QueryGroupByGroupGaugeIDResponse): Uint8Array { + return QueryGroupByGroupGaugeIDResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryGroupByGroupGaugeIDResponse): QueryGroupByGroupGaugeIDResponseProtoMsg { + return { + typeUrl: "/osmosis.incentives.QueryGroupByGroupGaugeIDResponse", + value: QueryGroupByGroupGaugeIDResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryGroupByGroupGaugeIDResponse.typeUrl, QueryGroupByGroupGaugeIDResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryGroupByGroupGaugeIDResponse.aminoType, QueryGroupByGroupGaugeIDResponse.typeUrl); +function createBaseQueryCurrentWeightByGroupGaugeIDRequest(): QueryCurrentWeightByGroupGaugeIDRequest { + return { + groupGaugeId: BigInt(0) + }; +} +export const QueryCurrentWeightByGroupGaugeIDRequest = { + typeUrl: "/osmosis.incentives.QueryCurrentWeightByGroupGaugeIDRequest", + aminoType: "osmosis/incentives/query-current-weight-by-group-gauge-id-request", + is(o: any): o is QueryCurrentWeightByGroupGaugeIDRequest { + return o && (o.$typeUrl === QueryCurrentWeightByGroupGaugeIDRequest.typeUrl || typeof o.groupGaugeId === "bigint"); + }, + isSDK(o: any): o is QueryCurrentWeightByGroupGaugeIDRequestSDKType { + return o && (o.$typeUrl === QueryCurrentWeightByGroupGaugeIDRequest.typeUrl || typeof o.group_gauge_id === "bigint"); + }, + isAmino(o: any): o is QueryCurrentWeightByGroupGaugeIDRequestAmino { + return o && (o.$typeUrl === QueryCurrentWeightByGroupGaugeIDRequest.typeUrl || typeof o.group_gauge_id === "bigint"); + }, + encode(message: QueryCurrentWeightByGroupGaugeIDRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.groupGaugeId !== BigInt(0)) { + writer.uint32(8).uint64(message.groupGaugeId); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryCurrentWeightByGroupGaugeIDRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryCurrentWeightByGroupGaugeIDRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.groupGaugeId = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): QueryCurrentWeightByGroupGaugeIDRequest { + return { + groupGaugeId: isSet(object.groupGaugeId) ? BigInt(object.groupGaugeId.toString()) : BigInt(0) + }; + }, + toJSON(message: QueryCurrentWeightByGroupGaugeIDRequest): unknown { + const obj: any = {}; + message.groupGaugeId !== undefined && (obj.groupGaugeId = (message.groupGaugeId || BigInt(0)).toString()); + return obj; + }, + fromPartial(object: Partial): QueryCurrentWeightByGroupGaugeIDRequest { + const message = createBaseQueryCurrentWeightByGroupGaugeIDRequest(); + message.groupGaugeId = object.groupGaugeId !== undefined && object.groupGaugeId !== null ? BigInt(object.groupGaugeId.toString()) : BigInt(0); + return message; + }, + fromAmino(object: QueryCurrentWeightByGroupGaugeIDRequestAmino): QueryCurrentWeightByGroupGaugeIDRequest { + const message = createBaseQueryCurrentWeightByGroupGaugeIDRequest(); + if (object.group_gauge_id !== undefined && object.group_gauge_id !== null) { + message.groupGaugeId = BigInt(object.group_gauge_id); + } + return message; + }, + toAmino(message: QueryCurrentWeightByGroupGaugeIDRequest): QueryCurrentWeightByGroupGaugeIDRequestAmino { + const obj: any = {}; + obj.group_gauge_id = message.groupGaugeId ? message.groupGaugeId.toString() : undefined; + return obj; + }, + fromAminoMsg(object: QueryCurrentWeightByGroupGaugeIDRequestAminoMsg): QueryCurrentWeightByGroupGaugeIDRequest { + return QueryCurrentWeightByGroupGaugeIDRequest.fromAmino(object.value); + }, + toAminoMsg(message: QueryCurrentWeightByGroupGaugeIDRequest): QueryCurrentWeightByGroupGaugeIDRequestAminoMsg { + return { + type: "osmosis/incentives/query-current-weight-by-group-gauge-id-request", + value: QueryCurrentWeightByGroupGaugeIDRequest.toAmino(message) + }; + }, + fromProtoMsg(message: QueryCurrentWeightByGroupGaugeIDRequestProtoMsg): QueryCurrentWeightByGroupGaugeIDRequest { + return QueryCurrentWeightByGroupGaugeIDRequest.decode(message.value); + }, + toProto(message: QueryCurrentWeightByGroupGaugeIDRequest): Uint8Array { + return QueryCurrentWeightByGroupGaugeIDRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryCurrentWeightByGroupGaugeIDRequest): QueryCurrentWeightByGroupGaugeIDRequestProtoMsg { + return { + typeUrl: "/osmosis.incentives.QueryCurrentWeightByGroupGaugeIDRequest", + value: QueryCurrentWeightByGroupGaugeIDRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryCurrentWeightByGroupGaugeIDRequest.typeUrl, QueryCurrentWeightByGroupGaugeIDRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryCurrentWeightByGroupGaugeIDRequest.aminoType, QueryCurrentWeightByGroupGaugeIDRequest.typeUrl); +function createBaseQueryCurrentWeightByGroupGaugeIDResponse(): QueryCurrentWeightByGroupGaugeIDResponse { + return { + gaugeWeight: [] + }; +} +export const QueryCurrentWeightByGroupGaugeIDResponse = { + typeUrl: "/osmosis.incentives.QueryCurrentWeightByGroupGaugeIDResponse", + aminoType: "osmosis/incentives/query-current-weight-by-group-gauge-id-response", + is(o: any): o is QueryCurrentWeightByGroupGaugeIDResponse { + return o && (o.$typeUrl === QueryCurrentWeightByGroupGaugeIDResponse.typeUrl || Array.isArray(o.gaugeWeight) && (!o.gaugeWeight.length || GaugeWeight.is(o.gaugeWeight[0]))); + }, + isSDK(o: any): o is QueryCurrentWeightByGroupGaugeIDResponseSDKType { + return o && (o.$typeUrl === QueryCurrentWeightByGroupGaugeIDResponse.typeUrl || Array.isArray(o.gauge_weight) && (!o.gauge_weight.length || GaugeWeight.isSDK(o.gauge_weight[0]))); + }, + isAmino(o: any): o is QueryCurrentWeightByGroupGaugeIDResponseAmino { + return o && (o.$typeUrl === QueryCurrentWeightByGroupGaugeIDResponse.typeUrl || Array.isArray(o.gauge_weight) && (!o.gauge_weight.length || GaugeWeight.isAmino(o.gauge_weight[0]))); + }, + encode(message: QueryCurrentWeightByGroupGaugeIDResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.gaugeWeight) { + GaugeWeight.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryCurrentWeightByGroupGaugeIDResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryCurrentWeightByGroupGaugeIDResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.gaugeWeight.push(GaugeWeight.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): QueryCurrentWeightByGroupGaugeIDResponse { + return { + gaugeWeight: Array.isArray(object?.gaugeWeight) ? object.gaugeWeight.map((e: any) => GaugeWeight.fromJSON(e)) : [] + }; + }, + toJSON(message: QueryCurrentWeightByGroupGaugeIDResponse): unknown { + const obj: any = {}; + if (message.gaugeWeight) { + obj.gaugeWeight = message.gaugeWeight.map(e => e ? GaugeWeight.toJSON(e) : undefined); + } else { + obj.gaugeWeight = []; + } + return obj; + }, + fromPartial(object: Partial): QueryCurrentWeightByGroupGaugeIDResponse { + const message = createBaseQueryCurrentWeightByGroupGaugeIDResponse(); + message.gaugeWeight = object.gaugeWeight?.map(e => GaugeWeight.fromPartial(e)) || []; + return message; + }, + fromAmino(object: QueryCurrentWeightByGroupGaugeIDResponseAmino): QueryCurrentWeightByGroupGaugeIDResponse { + const message = createBaseQueryCurrentWeightByGroupGaugeIDResponse(); + message.gaugeWeight = object.gauge_weight?.map(e => GaugeWeight.fromAmino(e)) || []; + return message; + }, + toAmino(message: QueryCurrentWeightByGroupGaugeIDResponse): QueryCurrentWeightByGroupGaugeIDResponseAmino { + const obj: any = {}; + if (message.gaugeWeight) { + obj.gauge_weight = message.gaugeWeight.map(e => e ? GaugeWeight.toAmino(e) : undefined); + } else { + obj.gauge_weight = []; + } + return obj; + }, + fromAminoMsg(object: QueryCurrentWeightByGroupGaugeIDResponseAminoMsg): QueryCurrentWeightByGroupGaugeIDResponse { + return QueryCurrentWeightByGroupGaugeIDResponse.fromAmino(object.value); + }, + toAminoMsg(message: QueryCurrentWeightByGroupGaugeIDResponse): QueryCurrentWeightByGroupGaugeIDResponseAminoMsg { + return { + type: "osmosis/incentives/query-current-weight-by-group-gauge-id-response", + value: QueryCurrentWeightByGroupGaugeIDResponse.toAmino(message) + }; + }, + fromProtoMsg(message: QueryCurrentWeightByGroupGaugeIDResponseProtoMsg): QueryCurrentWeightByGroupGaugeIDResponse { + return QueryCurrentWeightByGroupGaugeIDResponse.decode(message.value); + }, + toProto(message: QueryCurrentWeightByGroupGaugeIDResponse): Uint8Array { + return QueryCurrentWeightByGroupGaugeIDResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryCurrentWeightByGroupGaugeIDResponse): QueryCurrentWeightByGroupGaugeIDResponseProtoMsg { + return { + typeUrl: "/osmosis.incentives.QueryCurrentWeightByGroupGaugeIDResponse", + value: QueryCurrentWeightByGroupGaugeIDResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryCurrentWeightByGroupGaugeIDResponse.typeUrl, QueryCurrentWeightByGroupGaugeIDResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryCurrentWeightByGroupGaugeIDResponse.aminoType, QueryCurrentWeightByGroupGaugeIDResponse.typeUrl); +function createBaseGaugeWeight(): GaugeWeight { + return { + gaugeId: BigInt(0), + weightRatio: "" + }; +} +export const GaugeWeight = { + typeUrl: "/osmosis.incentives.GaugeWeight", + aminoType: "osmosis/incentives/gauge-weight", + is(o: any): o is GaugeWeight { + return o && (o.$typeUrl === GaugeWeight.typeUrl || typeof o.gaugeId === "bigint" && typeof o.weightRatio === "string"); + }, + isSDK(o: any): o is GaugeWeightSDKType { + return o && (o.$typeUrl === GaugeWeight.typeUrl || typeof o.gauge_id === "bigint" && typeof o.weight_ratio === "string"); + }, + isAmino(o: any): o is GaugeWeightAmino { + return o && (o.$typeUrl === GaugeWeight.typeUrl || typeof o.gauge_id === "bigint" && typeof o.weight_ratio === "string"); + }, + encode(message: GaugeWeight, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.gaugeId !== BigInt(0)) { + writer.uint32(8).uint64(message.gaugeId); + } + if (message.weightRatio !== "") { + writer.uint32(18).string(Decimal.fromUserInput(message.weightRatio, 18).atomics); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): GaugeWeight { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGaugeWeight(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.gaugeId = reader.uint64(); + break; + case 2: + message.weightRatio = Decimal.fromAtomics(reader.string(), 18).toString(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): GaugeWeight { + return { + gaugeId: isSet(object.gaugeId) ? BigInt(object.gaugeId.toString()) : BigInt(0), + weightRatio: isSet(object.weightRatio) ? String(object.weightRatio) : "" + }; + }, + toJSON(message: GaugeWeight): unknown { + const obj: any = {}; + message.gaugeId !== undefined && (obj.gaugeId = (message.gaugeId || BigInt(0)).toString()); + message.weightRatio !== undefined && (obj.weightRatio = message.weightRatio); + return obj; + }, + fromPartial(object: Partial): GaugeWeight { + const message = createBaseGaugeWeight(); + message.gaugeId = object.gaugeId !== undefined && object.gaugeId !== null ? BigInt(object.gaugeId.toString()) : BigInt(0); + message.weightRatio = object.weightRatio ?? ""; + return message; + }, + fromAmino(object: GaugeWeightAmino): GaugeWeight { + const message = createBaseGaugeWeight(); + if (object.gauge_id !== undefined && object.gauge_id !== null) { + message.gaugeId = BigInt(object.gauge_id); + } + if (object.weight_ratio !== undefined && object.weight_ratio !== null) { + message.weightRatio = object.weight_ratio; + } + return message; + }, + toAmino(message: GaugeWeight): GaugeWeightAmino { + const obj: any = {}; + obj.gauge_id = message.gaugeId ? message.gaugeId.toString() : undefined; + obj.weight_ratio = message.weightRatio; + return obj; + }, + fromAminoMsg(object: GaugeWeightAminoMsg): GaugeWeight { + return GaugeWeight.fromAmino(object.value); + }, + toAminoMsg(message: GaugeWeight): GaugeWeightAminoMsg { + return { + type: "osmosis/incentives/gauge-weight", + value: GaugeWeight.toAmino(message) + }; + }, + fromProtoMsg(message: GaugeWeightProtoMsg): GaugeWeight { + return GaugeWeight.decode(message.value); + }, + toProto(message: GaugeWeight): Uint8Array { + return GaugeWeight.encode(message).finish(); + }, + toProtoMsg(message: GaugeWeight): GaugeWeightProtoMsg { + return { + typeUrl: "/osmosis.incentives.GaugeWeight", + value: GaugeWeight.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(GaugeWeight.typeUrl, GaugeWeight); +GlobalDecoderRegistry.registerAminoProtoMapping(GaugeWeight.aminoType, GaugeWeight.typeUrl); \ No newline at end of file diff --git a/packages/osmojs/src/codegen/osmosis/incentives/tx.amino.ts b/packages/osmojs/src/codegen/osmosis/incentives/tx.amino.ts index 31f1d9251..acf62c240 100644 --- a/packages/osmojs/src/codegen/osmosis/incentives/tx.amino.ts +++ b/packages/osmojs/src/codegen/osmosis/incentives/tx.amino.ts @@ -1,5 +1,5 @@ //@ts-nocheck -import { MsgCreateGauge, MsgAddToGauge } from "./tx"; +import { MsgCreateGauge, MsgAddToGauge, MsgCreateGroup } from "./tx"; export const AminoConverter = { "/osmosis.incentives.MsgCreateGauge": { aminoType: "osmosis/incentives/create-gauge", @@ -10,5 +10,10 @@ export const AminoConverter = { aminoType: "osmosis/incentives/add-to-gauge", toAmino: MsgAddToGauge.toAmino, fromAmino: MsgAddToGauge.fromAmino + }, + "/osmosis.incentives.MsgCreateGroup": { + aminoType: "osmosis/incentives/create-group", + toAmino: MsgCreateGroup.toAmino, + fromAmino: MsgCreateGroup.fromAmino } }; \ No newline at end of file diff --git a/packages/osmojs/src/codegen/osmosis/incentives/tx.registry.ts b/packages/osmojs/src/codegen/osmosis/incentives/tx.registry.ts index af48a3f01..54a30766a 100644 --- a/packages/osmojs/src/codegen/osmosis/incentives/tx.registry.ts +++ b/packages/osmojs/src/codegen/osmosis/incentives/tx.registry.ts @@ -1,7 +1,7 @@ //@ts-nocheck import { GeneratedType, Registry } from "@cosmjs/proto-signing"; -import { MsgCreateGauge, MsgAddToGauge } from "./tx"; -export const registry: ReadonlyArray<[string, GeneratedType]> = [["/osmosis.incentives.MsgCreateGauge", MsgCreateGauge], ["/osmosis.incentives.MsgAddToGauge", MsgAddToGauge]]; +import { MsgCreateGauge, MsgAddToGauge, MsgCreateGroup } from "./tx"; +export const registry: ReadonlyArray<[string, GeneratedType]> = [["/osmosis.incentives.MsgCreateGauge", MsgCreateGauge], ["/osmosis.incentives.MsgAddToGauge", MsgAddToGauge], ["/osmosis.incentives.MsgCreateGroup", MsgCreateGroup]]; export const load = (protoRegistry: Registry) => { registry.forEach(([typeUrl, mod]) => { protoRegistry.register(typeUrl, mod); @@ -20,6 +20,12 @@ export const MessageComposer = { typeUrl: "/osmosis.incentives.MsgAddToGauge", value: MsgAddToGauge.encode(value).finish() }; + }, + createGroup(value: MsgCreateGroup) { + return { + typeUrl: "/osmosis.incentives.MsgCreateGroup", + value: MsgCreateGroup.encode(value).finish() + }; } }, withTypeUrl: { @@ -34,6 +40,52 @@ export const MessageComposer = { typeUrl: "/osmosis.incentives.MsgAddToGauge", value }; + }, + createGroup(value: MsgCreateGroup) { + return { + typeUrl: "/osmosis.incentives.MsgCreateGroup", + value + }; + } + }, + toJSON: { + createGauge(value: MsgCreateGauge) { + return { + typeUrl: "/osmosis.incentives.MsgCreateGauge", + value: MsgCreateGauge.toJSON(value) + }; + }, + addToGauge(value: MsgAddToGauge) { + return { + typeUrl: "/osmosis.incentives.MsgAddToGauge", + value: MsgAddToGauge.toJSON(value) + }; + }, + createGroup(value: MsgCreateGroup) { + return { + typeUrl: "/osmosis.incentives.MsgCreateGroup", + value: MsgCreateGroup.toJSON(value) + }; + } + }, + fromJSON: { + createGauge(value: any) { + return { + typeUrl: "/osmosis.incentives.MsgCreateGauge", + value: MsgCreateGauge.fromJSON(value) + }; + }, + addToGauge(value: any) { + return { + typeUrl: "/osmosis.incentives.MsgAddToGauge", + value: MsgAddToGauge.fromJSON(value) + }; + }, + createGroup(value: any) { + return { + typeUrl: "/osmosis.incentives.MsgCreateGroup", + value: MsgCreateGroup.fromJSON(value) + }; } }, fromPartial: { @@ -48,6 +100,12 @@ export const MessageComposer = { typeUrl: "/osmosis.incentives.MsgAddToGauge", value: MsgAddToGauge.fromPartial(value) }; + }, + createGroup(value: MsgCreateGroup) { + return { + typeUrl: "/osmosis.incentives.MsgCreateGroup", + value: MsgCreateGroup.fromPartial(value) + }; } } }; \ No newline at end of file diff --git a/packages/osmojs/src/codegen/osmosis/incentives/tx.rpc.msg.ts b/packages/osmojs/src/codegen/osmosis/incentives/tx.rpc.msg.ts index ccc8532f0..c9534decf 100644 --- a/packages/osmojs/src/codegen/osmosis/incentives/tx.rpc.msg.ts +++ b/packages/osmojs/src/codegen/osmosis/incentives/tx.rpc.msg.ts @@ -1,9 +1,10 @@ import { Rpc } from "../../helpers"; import { BinaryReader } from "../../binary"; -import { MsgCreateGauge, MsgCreateGaugeResponse, MsgAddToGauge, MsgAddToGaugeResponse } from "./tx"; +import { MsgCreateGauge, MsgCreateGaugeResponse, MsgAddToGauge, MsgAddToGaugeResponse, MsgCreateGroup, MsgCreateGroupResponse } from "./tx"; export interface Msg { createGauge(request: MsgCreateGauge): Promise; addToGauge(request: MsgAddToGauge): Promise; + createGroup(request: MsgCreateGroup): Promise; } export class MsgClientImpl implements Msg { private readonly rpc: Rpc; @@ -11,6 +12,7 @@ export class MsgClientImpl implements Msg { this.rpc = rpc; this.createGauge = this.createGauge.bind(this); this.addToGauge = this.addToGauge.bind(this); + this.createGroup = this.createGroup.bind(this); } createGauge(request: MsgCreateGauge): Promise { const data = MsgCreateGauge.encode(request).finish(); @@ -22,4 +24,12 @@ export class MsgClientImpl implements Msg { const promise = this.rpc.request("osmosis.incentives.Msg", "AddToGauge", data); return promise.then(data => MsgAddToGaugeResponse.decode(new BinaryReader(data))); } -} \ No newline at end of file + createGroup(request: MsgCreateGroup): Promise { + const data = MsgCreateGroup.encode(request).finish(); + const promise = this.rpc.request("osmosis.incentives.Msg", "CreateGroup", data); + return promise.then(data => MsgCreateGroupResponse.decode(new BinaryReader(data))); + } +} +export const createClientImpl = (rpc: Rpc) => { + return new MsgClientImpl(rpc); +}; \ No newline at end of file diff --git a/packages/osmojs/src/codegen/osmosis/incentives/tx.ts b/packages/osmojs/src/codegen/osmosis/incentives/tx.ts index 085e88298..f97e091be 100644 --- a/packages/osmojs/src/codegen/osmosis/incentives/tx.ts +++ b/packages/osmojs/src/codegen/osmosis/incentives/tx.ts @@ -2,7 +2,8 @@ import { QueryCondition, QueryConditionAmino, QueryConditionSDKType } from "../l import { Coin, CoinAmino, CoinSDKType } from "../../cosmos/base/v1beta1/coin"; import { Timestamp } from "../../google/protobuf/timestamp"; import { BinaryReader, BinaryWriter } from "../../binary"; -import { toTimestamp, fromTimestamp } from "../../helpers"; +import { toTimestamp, fromTimestamp, isSet } from "../../helpers"; +import { GlobalDecoderRegistry } from "../../registry"; /** MsgCreateGauge creates a gague to distribute rewards to users */ export interface MsgCreateGauge { /** @@ -53,23 +54,23 @@ export interface MsgCreateGaugeAmino { * at a single time and only distribute their tokens again once the gauge is * refilled */ - is_perpetual: boolean; + is_perpetual?: boolean; /** owner is the address of gauge creator */ - owner: string; + owner?: string; /** * distribute_to show which lock the gauge should distribute to by time * duration or by timestamp */ distribute_to?: QueryConditionAmino; /** coins are coin(s) to be distributed by the gauge */ - coins: CoinAmino[]; + coins?: CoinAmino[]; /** start_time is the distribution start time */ - start_time?: Date; + start_time?: string; /** * num_epochs_paid_over is the number of epochs distribution will be completed * over */ - num_epochs_paid_over: string; + num_epochs_paid_over?: string; /** * pool_id is the ID of the pool that the gauge is meant to be associated * with. if pool_id is set, then the "QueryCondition.LockQueryType" must be @@ -79,7 +80,7 @@ export interface MsgCreateGaugeAmino { * incentivestypes.NoLockExternalGaugeDenom() so that the gauges * associated with a pool can be queried by this prefix if needed. */ - pool_id: string; + pool_id?: string; } export interface MsgCreateGaugeAminoMsg { type: "osmosis/incentives/create-gauge"; @@ -122,11 +123,11 @@ export interface MsgAddToGaugeProtoMsg { /** MsgAddToGauge adds coins to a previously created gauge */ export interface MsgAddToGaugeAmino { /** owner is the gauge owner's address */ - owner: string; + owner?: string; /** gauge_id is the ID of gauge that rewards are getting added to */ - gauge_id: string; + gauge_id?: string; /** rewards are the coin(s) to add to gauge */ - rewards: CoinAmino[]; + rewards?: CoinAmino[]; } export interface MsgAddToGaugeAminoMsg { type: "osmosis/incentives/add-to-gauge"; @@ -149,19 +150,91 @@ export interface MsgAddToGaugeResponseAminoMsg { value: MsgAddToGaugeResponseAmino; } export interface MsgAddToGaugeResponseSDKType {} +/** MsgCreateGroup creates a group to distribute rewards to a group of pools */ +export interface MsgCreateGroup { + /** coins are the provided coins that the group will distribute */ + coins: Coin[]; + /** + * num_epochs_paid_over is the number of epochs distribution will be completed + * in. 0 means it's perpetual + */ + numEpochsPaidOver: bigint; + /** owner is the group owner's address */ + owner: string; + /** pool_ids are the IDs of pools that the group is comprised of */ + poolIds: bigint[]; +} +export interface MsgCreateGroupProtoMsg { + typeUrl: "/osmosis.incentives.MsgCreateGroup"; + value: Uint8Array; +} +/** MsgCreateGroup creates a group to distribute rewards to a group of pools */ +export interface MsgCreateGroupAmino { + /** coins are the provided coins that the group will distribute */ + coins?: CoinAmino[]; + /** + * num_epochs_paid_over is the number of epochs distribution will be completed + * in. 0 means it's perpetual + */ + num_epochs_paid_over?: string; + /** owner is the group owner's address */ + owner?: string; + /** pool_ids are the IDs of pools that the group is comprised of */ + pool_ids?: string[]; +} +export interface MsgCreateGroupAminoMsg { + type: "osmosis/incentives/create-group"; + value: MsgCreateGroupAmino; +} +/** MsgCreateGroup creates a group to distribute rewards to a group of pools */ +export interface MsgCreateGroupSDKType { + coins: CoinSDKType[]; + num_epochs_paid_over: bigint; + owner: string; + pool_ids: bigint[]; +} +export interface MsgCreateGroupResponse { + /** group_id is the ID of the group that is created from this msg */ + groupId: bigint; +} +export interface MsgCreateGroupResponseProtoMsg { + typeUrl: "/osmosis.incentives.MsgCreateGroupResponse"; + value: Uint8Array; +} +export interface MsgCreateGroupResponseAmino { + /** group_id is the ID of the group that is created from this msg */ + group_id?: string; +} +export interface MsgCreateGroupResponseAminoMsg { + type: "osmosis/incentives/create-group-response"; + value: MsgCreateGroupResponseAmino; +} +export interface MsgCreateGroupResponseSDKType { + group_id: bigint; +} function createBaseMsgCreateGauge(): MsgCreateGauge { return { isPerpetual: false, owner: "", distributeTo: QueryCondition.fromPartial({}), coins: [], - startTime: undefined, + startTime: new Date(), numEpochsPaidOver: BigInt(0), poolId: BigInt(0) }; } export const MsgCreateGauge = { typeUrl: "/osmosis.incentives.MsgCreateGauge", + aminoType: "osmosis/incentives/create-gauge", + is(o: any): o is MsgCreateGauge { + return o && (o.$typeUrl === MsgCreateGauge.typeUrl || typeof o.isPerpetual === "boolean" && typeof o.owner === "string" && QueryCondition.is(o.distributeTo) && Array.isArray(o.coins) && (!o.coins.length || Coin.is(o.coins[0])) && Timestamp.is(o.startTime) && typeof o.numEpochsPaidOver === "bigint" && typeof o.poolId === "bigint"); + }, + isSDK(o: any): o is MsgCreateGaugeSDKType { + return o && (o.$typeUrl === MsgCreateGauge.typeUrl || typeof o.is_perpetual === "boolean" && typeof o.owner === "string" && QueryCondition.isSDK(o.distribute_to) && Array.isArray(o.coins) && (!o.coins.length || Coin.isSDK(o.coins[0])) && Timestamp.isSDK(o.start_time) && typeof o.num_epochs_paid_over === "bigint" && typeof o.pool_id === "bigint"); + }, + isAmino(o: any): o is MsgCreateGaugeAmino { + return o && (o.$typeUrl === MsgCreateGauge.typeUrl || typeof o.is_perpetual === "boolean" && typeof o.owner === "string" && QueryCondition.isAmino(o.distribute_to) && Array.isArray(o.coins) && (!o.coins.length || Coin.isAmino(o.coins[0])) && Timestamp.isAmino(o.start_time) && typeof o.num_epochs_paid_over === "bigint" && typeof o.pool_id === "bigint"); + }, encode(message: MsgCreateGauge, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.isPerpetual === true) { writer.uint32(8).bool(message.isPerpetual); @@ -221,6 +294,32 @@ export const MsgCreateGauge = { } return message; }, + fromJSON(object: any): MsgCreateGauge { + return { + isPerpetual: isSet(object.isPerpetual) ? Boolean(object.isPerpetual) : false, + owner: isSet(object.owner) ? String(object.owner) : "", + distributeTo: isSet(object.distributeTo) ? QueryCondition.fromJSON(object.distributeTo) : undefined, + coins: Array.isArray(object?.coins) ? object.coins.map((e: any) => Coin.fromJSON(e)) : [], + startTime: isSet(object.startTime) ? new Date(object.startTime) : undefined, + numEpochsPaidOver: isSet(object.numEpochsPaidOver) ? BigInt(object.numEpochsPaidOver.toString()) : BigInt(0), + poolId: isSet(object.poolId) ? BigInt(object.poolId.toString()) : BigInt(0) + }; + }, + toJSON(message: MsgCreateGauge): unknown { + const obj: any = {}; + message.isPerpetual !== undefined && (obj.isPerpetual = message.isPerpetual); + message.owner !== undefined && (obj.owner = message.owner); + message.distributeTo !== undefined && (obj.distributeTo = message.distributeTo ? QueryCondition.toJSON(message.distributeTo) : undefined); + if (message.coins) { + obj.coins = message.coins.map(e => e ? Coin.toJSON(e) : undefined); + } else { + obj.coins = []; + } + message.startTime !== undefined && (obj.startTime = message.startTime.toISOString()); + message.numEpochsPaidOver !== undefined && (obj.numEpochsPaidOver = (message.numEpochsPaidOver || BigInt(0)).toString()); + message.poolId !== undefined && (obj.poolId = (message.poolId || BigInt(0)).toString()); + return obj; + }, fromPartial(object: Partial): MsgCreateGauge { const message = createBaseMsgCreateGauge(); message.isPerpetual = object.isPerpetual ?? false; @@ -233,15 +332,27 @@ export const MsgCreateGauge = { return message; }, fromAmino(object: MsgCreateGaugeAmino): MsgCreateGauge { - return { - isPerpetual: object.is_perpetual, - owner: object.owner, - distributeTo: object?.distribute_to ? QueryCondition.fromAmino(object.distribute_to) : undefined, - coins: Array.isArray(object?.coins) ? object.coins.map((e: any) => Coin.fromAmino(e)) : [], - startTime: object.start_time, - numEpochsPaidOver: BigInt(object.num_epochs_paid_over), - poolId: BigInt(object.pool_id) - }; + const message = createBaseMsgCreateGauge(); + if (object.is_perpetual !== undefined && object.is_perpetual !== null) { + message.isPerpetual = object.is_perpetual; + } + if (object.owner !== undefined && object.owner !== null) { + message.owner = object.owner; + } + if (object.distribute_to !== undefined && object.distribute_to !== null) { + message.distributeTo = QueryCondition.fromAmino(object.distribute_to); + } + message.coins = object.coins?.map(e => Coin.fromAmino(e)) || []; + if (object.start_time !== undefined && object.start_time !== null) { + message.startTime = fromTimestamp(Timestamp.fromAmino(object.start_time)); + } + if (object.num_epochs_paid_over !== undefined && object.num_epochs_paid_over !== null) { + message.numEpochsPaidOver = BigInt(object.num_epochs_paid_over); + } + if (object.pool_id !== undefined && object.pool_id !== null) { + message.poolId = BigInt(object.pool_id); + } + return message; }, toAmino(message: MsgCreateGauge): MsgCreateGaugeAmino { const obj: any = {}; @@ -253,7 +364,7 @@ export const MsgCreateGauge = { } else { obj.coins = []; } - obj.start_time = message.startTime; + obj.start_time = message.startTime ? Timestamp.toAmino(toTimestamp(message.startTime)) : undefined; obj.num_epochs_paid_over = message.numEpochsPaidOver ? message.numEpochsPaidOver.toString() : undefined; obj.pool_id = message.poolId ? message.poolId.toString() : undefined; return obj; @@ -280,11 +391,23 @@ export const MsgCreateGauge = { }; } }; +GlobalDecoderRegistry.register(MsgCreateGauge.typeUrl, MsgCreateGauge); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgCreateGauge.aminoType, MsgCreateGauge.typeUrl); function createBaseMsgCreateGaugeResponse(): MsgCreateGaugeResponse { return {}; } export const MsgCreateGaugeResponse = { typeUrl: "/osmosis.incentives.MsgCreateGaugeResponse", + aminoType: "osmosis/incentives/create-gauge-response", + is(o: any): o is MsgCreateGaugeResponse { + return o && o.$typeUrl === MsgCreateGaugeResponse.typeUrl; + }, + isSDK(o: any): o is MsgCreateGaugeResponseSDKType { + return o && o.$typeUrl === MsgCreateGaugeResponse.typeUrl; + }, + isAmino(o: any): o is MsgCreateGaugeResponseAmino { + return o && o.$typeUrl === MsgCreateGaugeResponse.typeUrl; + }, encode(_: MsgCreateGaugeResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, @@ -302,12 +425,20 @@ export const MsgCreateGaugeResponse = { } return message; }, + fromJSON(_: any): MsgCreateGaugeResponse { + return {}; + }, + toJSON(_: MsgCreateGaugeResponse): unknown { + const obj: any = {}; + return obj; + }, fromPartial(_: Partial): MsgCreateGaugeResponse { const message = createBaseMsgCreateGaugeResponse(); return message; }, fromAmino(_: MsgCreateGaugeResponseAmino): MsgCreateGaugeResponse { - return {}; + const message = createBaseMsgCreateGaugeResponse(); + return message; }, toAmino(_: MsgCreateGaugeResponse): MsgCreateGaugeResponseAmino { const obj: any = {}; @@ -335,6 +466,8 @@ export const MsgCreateGaugeResponse = { }; } }; +GlobalDecoderRegistry.register(MsgCreateGaugeResponse.typeUrl, MsgCreateGaugeResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgCreateGaugeResponse.aminoType, MsgCreateGaugeResponse.typeUrl); function createBaseMsgAddToGauge(): MsgAddToGauge { return { owner: "", @@ -344,6 +477,16 @@ function createBaseMsgAddToGauge(): MsgAddToGauge { } export const MsgAddToGauge = { typeUrl: "/osmosis.incentives.MsgAddToGauge", + aminoType: "osmosis/incentives/add-to-gauge", + is(o: any): o is MsgAddToGauge { + return o && (o.$typeUrl === MsgAddToGauge.typeUrl || typeof o.owner === "string" && typeof o.gaugeId === "bigint" && Array.isArray(o.rewards) && (!o.rewards.length || Coin.is(o.rewards[0]))); + }, + isSDK(o: any): o is MsgAddToGaugeSDKType { + return o && (o.$typeUrl === MsgAddToGauge.typeUrl || typeof o.owner === "string" && typeof o.gauge_id === "bigint" && Array.isArray(o.rewards) && (!o.rewards.length || Coin.isSDK(o.rewards[0]))); + }, + isAmino(o: any): o is MsgAddToGaugeAmino { + return o && (o.$typeUrl === MsgAddToGauge.typeUrl || typeof o.owner === "string" && typeof o.gauge_id === "bigint" && Array.isArray(o.rewards) && (!o.rewards.length || Coin.isAmino(o.rewards[0]))); + }, encode(message: MsgAddToGauge, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.owner !== "") { writer.uint32(10).string(message.owner); @@ -379,6 +522,24 @@ export const MsgAddToGauge = { } return message; }, + fromJSON(object: any): MsgAddToGauge { + return { + owner: isSet(object.owner) ? String(object.owner) : "", + gaugeId: isSet(object.gaugeId) ? BigInt(object.gaugeId.toString()) : BigInt(0), + rewards: Array.isArray(object?.rewards) ? object.rewards.map((e: any) => Coin.fromJSON(e)) : [] + }; + }, + toJSON(message: MsgAddToGauge): unknown { + const obj: any = {}; + message.owner !== undefined && (obj.owner = message.owner); + message.gaugeId !== undefined && (obj.gaugeId = (message.gaugeId || BigInt(0)).toString()); + if (message.rewards) { + obj.rewards = message.rewards.map(e => e ? Coin.toJSON(e) : undefined); + } else { + obj.rewards = []; + } + return obj; + }, fromPartial(object: Partial): MsgAddToGauge { const message = createBaseMsgAddToGauge(); message.owner = object.owner ?? ""; @@ -387,11 +548,15 @@ export const MsgAddToGauge = { return message; }, fromAmino(object: MsgAddToGaugeAmino): MsgAddToGauge { - return { - owner: object.owner, - gaugeId: BigInt(object.gauge_id), - rewards: Array.isArray(object?.rewards) ? object.rewards.map((e: any) => Coin.fromAmino(e)) : [] - }; + const message = createBaseMsgAddToGauge(); + if (object.owner !== undefined && object.owner !== null) { + message.owner = object.owner; + } + if (object.gauge_id !== undefined && object.gauge_id !== null) { + message.gaugeId = BigInt(object.gauge_id); + } + message.rewards = object.rewards?.map(e => Coin.fromAmino(e)) || []; + return message; }, toAmino(message: MsgAddToGauge): MsgAddToGaugeAmino { const obj: any = {}; @@ -426,11 +591,23 @@ export const MsgAddToGauge = { }; } }; +GlobalDecoderRegistry.register(MsgAddToGauge.typeUrl, MsgAddToGauge); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgAddToGauge.aminoType, MsgAddToGauge.typeUrl); function createBaseMsgAddToGaugeResponse(): MsgAddToGaugeResponse { return {}; } export const MsgAddToGaugeResponse = { typeUrl: "/osmosis.incentives.MsgAddToGaugeResponse", + aminoType: "osmosis/incentives/add-to-gauge-response", + is(o: any): o is MsgAddToGaugeResponse { + return o && o.$typeUrl === MsgAddToGaugeResponse.typeUrl; + }, + isSDK(o: any): o is MsgAddToGaugeResponseSDKType { + return o && o.$typeUrl === MsgAddToGaugeResponse.typeUrl; + }, + isAmino(o: any): o is MsgAddToGaugeResponseAmino { + return o && o.$typeUrl === MsgAddToGaugeResponse.typeUrl; + }, encode(_: MsgAddToGaugeResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, @@ -448,12 +625,20 @@ export const MsgAddToGaugeResponse = { } return message; }, + fromJSON(_: any): MsgAddToGaugeResponse { + return {}; + }, + toJSON(_: MsgAddToGaugeResponse): unknown { + const obj: any = {}; + return obj; + }, fromPartial(_: Partial): MsgAddToGaugeResponse { const message = createBaseMsgAddToGaugeResponse(); return message; }, fromAmino(_: MsgAddToGaugeResponseAmino): MsgAddToGaugeResponse { - return {}; + const message = createBaseMsgAddToGaugeResponse(); + return message; }, toAmino(_: MsgAddToGaugeResponse): MsgAddToGaugeResponseAmino { const obj: any = {}; @@ -480,4 +665,251 @@ export const MsgAddToGaugeResponse = { value: MsgAddToGaugeResponse.encode(message).finish() }; } -}; \ No newline at end of file +}; +GlobalDecoderRegistry.register(MsgAddToGaugeResponse.typeUrl, MsgAddToGaugeResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgAddToGaugeResponse.aminoType, MsgAddToGaugeResponse.typeUrl); +function createBaseMsgCreateGroup(): MsgCreateGroup { + return { + coins: [], + numEpochsPaidOver: BigInt(0), + owner: "", + poolIds: [] + }; +} +export const MsgCreateGroup = { + typeUrl: "/osmosis.incentives.MsgCreateGroup", + aminoType: "osmosis/incentives/create-group", + is(o: any): o is MsgCreateGroup { + return o && (o.$typeUrl === MsgCreateGroup.typeUrl || Array.isArray(o.coins) && (!o.coins.length || Coin.is(o.coins[0])) && typeof o.numEpochsPaidOver === "bigint" && typeof o.owner === "string" && Array.isArray(o.poolIds) && (!o.poolIds.length || typeof o.poolIds[0] === "bigint")); + }, + isSDK(o: any): o is MsgCreateGroupSDKType { + return o && (o.$typeUrl === MsgCreateGroup.typeUrl || Array.isArray(o.coins) && (!o.coins.length || Coin.isSDK(o.coins[0])) && typeof o.num_epochs_paid_over === "bigint" && typeof o.owner === "string" && Array.isArray(o.pool_ids) && (!o.pool_ids.length || typeof o.pool_ids[0] === "bigint")); + }, + isAmino(o: any): o is MsgCreateGroupAmino { + return o && (o.$typeUrl === MsgCreateGroup.typeUrl || Array.isArray(o.coins) && (!o.coins.length || Coin.isAmino(o.coins[0])) && typeof o.num_epochs_paid_over === "bigint" && typeof o.owner === "string" && Array.isArray(o.pool_ids) && (!o.pool_ids.length || typeof o.pool_ids[0] === "bigint")); + }, + encode(message: MsgCreateGroup, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.coins) { + Coin.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.numEpochsPaidOver !== BigInt(0)) { + writer.uint32(16).uint64(message.numEpochsPaidOver); + } + if (message.owner !== "") { + writer.uint32(26).string(message.owner); + } + writer.uint32(34).fork(); + for (const v of message.poolIds) { + writer.uint64(v); + } + writer.ldelim(); + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgCreateGroup { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgCreateGroup(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.coins.push(Coin.decode(reader, reader.uint32())); + break; + case 2: + message.numEpochsPaidOver = reader.uint64(); + break; + case 3: + message.owner = reader.string(); + break; + case 4: + if ((tag & 7) === 2) { + const end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) { + message.poolIds.push(reader.uint64()); + } + } else { + message.poolIds.push(reader.uint64()); + } + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): MsgCreateGroup { + return { + coins: Array.isArray(object?.coins) ? object.coins.map((e: any) => Coin.fromJSON(e)) : [], + numEpochsPaidOver: isSet(object.numEpochsPaidOver) ? BigInt(object.numEpochsPaidOver.toString()) : BigInt(0), + owner: isSet(object.owner) ? String(object.owner) : "", + poolIds: Array.isArray(object?.poolIds) ? object.poolIds.map((e: any) => BigInt(e.toString())) : [] + }; + }, + toJSON(message: MsgCreateGroup): unknown { + const obj: any = {}; + if (message.coins) { + obj.coins = message.coins.map(e => e ? Coin.toJSON(e) : undefined); + } else { + obj.coins = []; + } + message.numEpochsPaidOver !== undefined && (obj.numEpochsPaidOver = (message.numEpochsPaidOver || BigInt(0)).toString()); + message.owner !== undefined && (obj.owner = message.owner); + if (message.poolIds) { + obj.poolIds = message.poolIds.map(e => (e || BigInt(0)).toString()); + } else { + obj.poolIds = []; + } + return obj; + }, + fromPartial(object: Partial): MsgCreateGroup { + const message = createBaseMsgCreateGroup(); + message.coins = object.coins?.map(e => Coin.fromPartial(e)) || []; + message.numEpochsPaidOver = object.numEpochsPaidOver !== undefined && object.numEpochsPaidOver !== null ? BigInt(object.numEpochsPaidOver.toString()) : BigInt(0); + message.owner = object.owner ?? ""; + message.poolIds = object.poolIds?.map(e => BigInt(e.toString())) || []; + return message; + }, + fromAmino(object: MsgCreateGroupAmino): MsgCreateGroup { + const message = createBaseMsgCreateGroup(); + message.coins = object.coins?.map(e => Coin.fromAmino(e)) || []; + if (object.num_epochs_paid_over !== undefined && object.num_epochs_paid_over !== null) { + message.numEpochsPaidOver = BigInt(object.num_epochs_paid_over); + } + if (object.owner !== undefined && object.owner !== null) { + message.owner = object.owner; + } + message.poolIds = object.pool_ids?.map(e => BigInt(e)) || []; + return message; + }, + toAmino(message: MsgCreateGroup): MsgCreateGroupAmino { + const obj: any = {}; + if (message.coins) { + obj.coins = message.coins.map(e => e ? Coin.toAmino(e) : undefined); + } else { + obj.coins = []; + } + obj.num_epochs_paid_over = message.numEpochsPaidOver ? message.numEpochsPaidOver.toString() : undefined; + obj.owner = message.owner; + if (message.poolIds) { + obj.pool_ids = message.poolIds.map(e => e.toString()); + } else { + obj.pool_ids = []; + } + return obj; + }, + fromAminoMsg(object: MsgCreateGroupAminoMsg): MsgCreateGroup { + return MsgCreateGroup.fromAmino(object.value); + }, + toAminoMsg(message: MsgCreateGroup): MsgCreateGroupAminoMsg { + return { + type: "osmosis/incentives/create-group", + value: MsgCreateGroup.toAmino(message) + }; + }, + fromProtoMsg(message: MsgCreateGroupProtoMsg): MsgCreateGroup { + return MsgCreateGroup.decode(message.value); + }, + toProto(message: MsgCreateGroup): Uint8Array { + return MsgCreateGroup.encode(message).finish(); + }, + toProtoMsg(message: MsgCreateGroup): MsgCreateGroupProtoMsg { + return { + typeUrl: "/osmosis.incentives.MsgCreateGroup", + value: MsgCreateGroup.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgCreateGroup.typeUrl, MsgCreateGroup); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgCreateGroup.aminoType, MsgCreateGroup.typeUrl); +function createBaseMsgCreateGroupResponse(): MsgCreateGroupResponse { + return { + groupId: BigInt(0) + }; +} +export const MsgCreateGroupResponse = { + typeUrl: "/osmosis.incentives.MsgCreateGroupResponse", + aminoType: "osmosis/incentives/create-group-response", + is(o: any): o is MsgCreateGroupResponse { + return o && (o.$typeUrl === MsgCreateGroupResponse.typeUrl || typeof o.groupId === "bigint"); + }, + isSDK(o: any): o is MsgCreateGroupResponseSDKType { + return o && (o.$typeUrl === MsgCreateGroupResponse.typeUrl || typeof o.group_id === "bigint"); + }, + isAmino(o: any): o is MsgCreateGroupResponseAmino { + return o && (o.$typeUrl === MsgCreateGroupResponse.typeUrl || typeof o.group_id === "bigint"); + }, + encode(message: MsgCreateGroupResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.groupId !== BigInt(0)) { + writer.uint32(8).uint64(message.groupId); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgCreateGroupResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgCreateGroupResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.groupId = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): MsgCreateGroupResponse { + return { + groupId: isSet(object.groupId) ? BigInt(object.groupId.toString()) : BigInt(0) + }; + }, + toJSON(message: MsgCreateGroupResponse): unknown { + const obj: any = {}; + message.groupId !== undefined && (obj.groupId = (message.groupId || BigInt(0)).toString()); + return obj; + }, + fromPartial(object: Partial): MsgCreateGroupResponse { + const message = createBaseMsgCreateGroupResponse(); + message.groupId = object.groupId !== undefined && object.groupId !== null ? BigInt(object.groupId.toString()) : BigInt(0); + return message; + }, + fromAmino(object: MsgCreateGroupResponseAmino): MsgCreateGroupResponse { + const message = createBaseMsgCreateGroupResponse(); + if (object.group_id !== undefined && object.group_id !== null) { + message.groupId = BigInt(object.group_id); + } + return message; + }, + toAmino(message: MsgCreateGroupResponse): MsgCreateGroupResponseAmino { + const obj: any = {}; + obj.group_id = message.groupId ? message.groupId.toString() : undefined; + return obj; + }, + fromAminoMsg(object: MsgCreateGroupResponseAminoMsg): MsgCreateGroupResponse { + return MsgCreateGroupResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgCreateGroupResponse): MsgCreateGroupResponseAminoMsg { + return { + type: "osmosis/incentives/create-group-response", + value: MsgCreateGroupResponse.toAmino(message) + }; + }, + fromProtoMsg(message: MsgCreateGroupResponseProtoMsg): MsgCreateGroupResponse { + return MsgCreateGroupResponse.decode(message.value); + }, + toProto(message: MsgCreateGroupResponse): Uint8Array { + return MsgCreateGroupResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgCreateGroupResponse): MsgCreateGroupResponseProtoMsg { + return { + typeUrl: "/osmosis.incentives.MsgCreateGroupResponse", + value: MsgCreateGroupResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgCreateGroupResponse.typeUrl, MsgCreateGroupResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgCreateGroupResponse.aminoType, MsgCreateGroupResponse.typeUrl); \ No newline at end of file diff --git a/packages/osmojs/src/codegen/osmosis/lcd.ts b/packages/osmojs/src/codegen/osmosis/lcd.ts index cb05bd9da..3d5fc88f6 100644 --- a/packages/osmojs/src/codegen/osmosis/lcd.ts +++ b/packages/osmojs/src/codegen/osmosis/lcd.ts @@ -31,6 +31,11 @@ export const createLCDClient = async ({ }) } }, + consensus: { + v1: new (await import("../cosmos/consensus/v1/query.lcd")).LCDQueryClient({ + requestClient + }) + }, distribution: { v1beta1: new (await import("../cosmos/distribution/v1beta1/query.lcd")).LCDQueryClient({ requestClient @@ -41,6 +46,11 @@ export const createLCDClient = async ({ requestClient }) }, + params: { + v1beta1: new (await import("../cosmos/params/v1beta1/query.lcd")).LCDQueryClient({ + requestClient + }) + }, staking: { v1beta1: new (await import("../cosmos/staking/v1beta1/query.lcd")).LCDQueryClient({ requestClient @@ -59,7 +69,7 @@ export const createLCDClient = async ({ }, osmosis: { concentratedliquidity: { - v1beta1: new (await import("./concentrated-liquidity/query.lcd")).LCDQueryClient({ + v1beta1: new (await import("./concentratedliquidity/v1beta1/query.lcd")).LCDQueryClient({ requestClient }) }, @@ -69,12 +79,12 @@ export const createLCDClient = async ({ }) }, downtimedetector: { - v1beta1: new (await import("./downtime-detector/v1beta1/query.lcd")).LCDQueryClient({ + v1beta1: new (await import("./downtimedetector/v1beta1/query.lcd")).LCDQueryClient({ requestClient }) }, epochs: { - v1beta1: new (await import("./epochs/query.lcd")).LCDQueryClient({ + v1beta1: new (await import("./epochs/v1beta1/query.lcd")).LCDQueryClient({ requestClient }) }, @@ -87,7 +97,7 @@ export const createLCDClient = async ({ }) }, ibcratelimit: { - v1beta1: new (await import("./ibc-rate-limit/v1beta1/query.lcd")).LCDQueryClient({ + v1beta1: new (await import("./ibcratelimit/v1beta1/query.lcd")).LCDQueryClient({ requestClient }) }, @@ -103,13 +113,16 @@ export const createLCDClient = async ({ }) }, poolincentives: { - v1beta1: new (await import("./pool-incentives/v1beta1/query.lcd")).LCDQueryClient({ + v1beta1: new (await import("./poolincentives/v1beta1/query.lcd")).LCDQueryClient({ requestClient }) }, poolmanager: { v1beta1: new (await import("./poolmanager/v1beta1/query.lcd")).LCDQueryClient({ requestClient + }), + v2: new (await import("./poolmanager/v2/query.lcd")).LCDQueryClient({ + requestClient }) }, protorev: { @@ -136,7 +149,7 @@ export const createLCDClient = async ({ }) }, valsetpref: { - v1beta1: new (await import("./valset-pref/v1beta1/query.lcd")).LCDQueryClient({ + v1beta1: new (await import("./valsetpref/v1beta1/query.lcd")).LCDQueryClient({ requestClient }) } diff --git a/packages/osmojs/src/codegen/osmosis/lockup/genesis.ts b/packages/osmojs/src/codegen/osmosis/lockup/genesis.ts index 408dbdff5..e2e46ee4a 100644 --- a/packages/osmojs/src/codegen/osmosis/lockup/genesis.ts +++ b/packages/osmojs/src/codegen/osmosis/lockup/genesis.ts @@ -1,10 +1,14 @@ import { PeriodLock, PeriodLockAmino, PeriodLockSDKType, SyntheticLock, SyntheticLockAmino, SyntheticLockSDKType } from "./lock"; +import { Params, ParamsAmino, ParamsSDKType } from "./params"; import { BinaryReader, BinaryWriter } from "../../binary"; +import { isSet } from "../../helpers"; +import { GlobalDecoderRegistry } from "../../registry"; /** GenesisState defines the lockup module's genesis state. */ export interface GenesisState { lastLockId: bigint; locks: PeriodLock[]; syntheticLocks: SyntheticLock[]; + params?: Params; } export interface GenesisStateProtoMsg { typeUrl: "/osmosis.lockup.GenesisState"; @@ -12,9 +16,10 @@ export interface GenesisStateProtoMsg { } /** GenesisState defines the lockup module's genesis state. */ export interface GenesisStateAmino { - last_lock_id: string; - locks: PeriodLockAmino[]; - synthetic_locks: SyntheticLockAmino[]; + last_lock_id?: string; + locks?: PeriodLockAmino[]; + synthetic_locks?: SyntheticLockAmino[]; + params?: ParamsAmino; } export interface GenesisStateAminoMsg { type: "osmosis/lockup/genesis-state"; @@ -25,16 +30,28 @@ export interface GenesisStateSDKType { last_lock_id: bigint; locks: PeriodLockSDKType[]; synthetic_locks: SyntheticLockSDKType[]; + params?: ParamsSDKType; } function createBaseGenesisState(): GenesisState { return { lastLockId: BigInt(0), locks: [], - syntheticLocks: [] + syntheticLocks: [], + params: undefined }; } export const GenesisState = { typeUrl: "/osmosis.lockup.GenesisState", + aminoType: "osmosis/lockup/genesis-state", + is(o: any): o is GenesisState { + return o && (o.$typeUrl === GenesisState.typeUrl || typeof o.lastLockId === "bigint" && Array.isArray(o.locks) && (!o.locks.length || PeriodLock.is(o.locks[0])) && Array.isArray(o.syntheticLocks) && (!o.syntheticLocks.length || SyntheticLock.is(o.syntheticLocks[0]))); + }, + isSDK(o: any): o is GenesisStateSDKType { + return o && (o.$typeUrl === GenesisState.typeUrl || typeof o.last_lock_id === "bigint" && Array.isArray(o.locks) && (!o.locks.length || PeriodLock.isSDK(o.locks[0])) && Array.isArray(o.synthetic_locks) && (!o.synthetic_locks.length || SyntheticLock.isSDK(o.synthetic_locks[0]))); + }, + isAmino(o: any): o is GenesisStateAmino { + return o && (o.$typeUrl === GenesisState.typeUrl || typeof o.last_lock_id === "bigint" && Array.isArray(o.locks) && (!o.locks.length || PeriodLock.isAmino(o.locks[0])) && Array.isArray(o.synthetic_locks) && (!o.synthetic_locks.length || SyntheticLock.isAmino(o.synthetic_locks[0]))); + }, encode(message: GenesisState, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.lastLockId !== BigInt(0)) { writer.uint32(8).uint64(message.lastLockId); @@ -45,6 +62,9 @@ export const GenesisState = { for (const v of message.syntheticLocks) { SyntheticLock.encode(v!, writer.uint32(26).fork()).ldelim(); } + if (message.params !== undefined) { + Params.encode(message.params, writer.uint32(34).fork()).ldelim(); + } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): GenesisState { @@ -63,6 +83,9 @@ export const GenesisState = { case 3: message.syntheticLocks.push(SyntheticLock.decode(reader, reader.uint32())); break; + case 4: + message.params = Params.decode(reader, reader.uint32()); + break; default: reader.skipType(tag & 7); break; @@ -70,19 +93,49 @@ export const GenesisState = { } return message; }, + fromJSON(object: any): GenesisState { + return { + lastLockId: isSet(object.lastLockId) ? BigInt(object.lastLockId.toString()) : BigInt(0), + locks: Array.isArray(object?.locks) ? object.locks.map((e: any) => PeriodLock.fromJSON(e)) : [], + syntheticLocks: Array.isArray(object?.syntheticLocks) ? object.syntheticLocks.map((e: any) => SyntheticLock.fromJSON(e)) : [], + params: isSet(object.params) ? Params.fromJSON(object.params) : undefined + }; + }, + toJSON(message: GenesisState): unknown { + const obj: any = {}; + message.lastLockId !== undefined && (obj.lastLockId = (message.lastLockId || BigInt(0)).toString()); + if (message.locks) { + obj.locks = message.locks.map(e => e ? PeriodLock.toJSON(e) : undefined); + } else { + obj.locks = []; + } + if (message.syntheticLocks) { + obj.syntheticLocks = message.syntheticLocks.map(e => e ? SyntheticLock.toJSON(e) : undefined); + } else { + obj.syntheticLocks = []; + } + message.params !== undefined && (obj.params = message.params ? Params.toJSON(message.params) : undefined); + return obj; + }, fromPartial(object: Partial): GenesisState { const message = createBaseGenesisState(); message.lastLockId = object.lastLockId !== undefined && object.lastLockId !== null ? BigInt(object.lastLockId.toString()) : BigInt(0); message.locks = object.locks?.map(e => PeriodLock.fromPartial(e)) || []; message.syntheticLocks = object.syntheticLocks?.map(e => SyntheticLock.fromPartial(e)) || []; + message.params = object.params !== undefined && object.params !== null ? Params.fromPartial(object.params) : undefined; return message; }, fromAmino(object: GenesisStateAmino): GenesisState { - return { - lastLockId: BigInt(object.last_lock_id), - locks: Array.isArray(object?.locks) ? object.locks.map((e: any) => PeriodLock.fromAmino(e)) : [], - syntheticLocks: Array.isArray(object?.synthetic_locks) ? object.synthetic_locks.map((e: any) => SyntheticLock.fromAmino(e)) : [] - }; + const message = createBaseGenesisState(); + if (object.last_lock_id !== undefined && object.last_lock_id !== null) { + message.lastLockId = BigInt(object.last_lock_id); + } + message.locks = object.locks?.map(e => PeriodLock.fromAmino(e)) || []; + message.syntheticLocks = object.synthetic_locks?.map(e => SyntheticLock.fromAmino(e)) || []; + if (object.params !== undefined && object.params !== null) { + message.params = Params.fromAmino(object.params); + } + return message; }, toAmino(message: GenesisState): GenesisStateAmino { const obj: any = {}; @@ -97,6 +150,7 @@ export const GenesisState = { } else { obj.synthetic_locks = []; } + obj.params = message.params ? Params.toAmino(message.params) : undefined; return obj; }, fromAminoMsg(object: GenesisStateAminoMsg): GenesisState { @@ -120,4 +174,6 @@ export const GenesisState = { value: GenesisState.encode(message).finish() }; } -}; \ No newline at end of file +}; +GlobalDecoderRegistry.register(GenesisState.typeUrl, GenesisState); +GlobalDecoderRegistry.registerAminoProtoMapping(GenesisState.aminoType, GenesisState.typeUrl); \ No newline at end of file diff --git a/packages/osmojs/src/codegen/osmosis/lockup/lock.ts b/packages/osmojs/src/codegen/osmosis/lockup/lock.ts index a4c37ad86..aa95f3c69 100644 --- a/packages/osmojs/src/codegen/osmosis/lockup/lock.ts +++ b/packages/osmojs/src/codegen/osmosis/lockup/lock.ts @@ -3,6 +3,7 @@ import { Timestamp } from "../../google/protobuf/timestamp"; import { Coin, CoinAmino, CoinSDKType } from "../../cosmos/base/v1beta1/coin"; import { BinaryReader, BinaryWriter } from "../../binary"; import { toTimestamp, fromTimestamp, isSet } from "../../helpers"; +import { GlobalDecoderRegistry } from "../../registry"; /** * LockQueryType defines the type of the lock query that can * either be by duration or start time of the lock. @@ -11,6 +12,7 @@ export enum LockQueryType { ByDuration = 0, ByTime = 1, NoLock = 2, + ByGroup = 3, UNRECOGNIZED = -1, } export const LockQueryTypeSDKType = LockQueryType; @@ -26,6 +28,9 @@ export function lockQueryTypeFromJSON(object: any): LockQueryType { case 2: case "NoLock": return LockQueryType.NoLock; + case 3: + case "ByGroup": + return LockQueryType.ByGroup; case -1: case "UNRECOGNIZED": default: @@ -40,6 +45,8 @@ export function lockQueryTypeToJSON(object: LockQueryType): string { return "ByTime"; case LockQueryType.NoLock: return "NoLock"; + case LockQueryType.ByGroup: + return "ByGroup"; case LockQueryType.UNRECOGNIZED: default: return "UNRECOGNIZED"; @@ -101,12 +108,12 @@ export interface PeriodLockAmino { * The ID of the lock is decided upon lock creation, incrementing by 1 for * every lock. */ - ID: string; + ID?: string; /** * Owner is the account address of the lock owner. * Only the owner can modify the state of the lock. */ - owner: string; + owner?: string; /** * Duration is the time needed for a lock to mature after unlocking has * started. @@ -117,15 +124,15 @@ export interface PeriodLockAmino { * This value is first initialized when an unlock has started for the lock, * end time being block time + duration. */ - end_time?: Date; + end_time?: string; /** Coins are the tokens locked within the lock, kept in the module account. */ - coins: CoinAmino[]; + coins?: CoinAmino[]; /** * Reward Receiver Address is the address that would be receiving rewards for * the incentives for the lock. This is set to owner by default and can be * changed via separate msg. */ - reward_receiver_address: string; + reward_receiver_address?: string; } export interface PeriodLockAminoMsg { type: "osmosis/lockup/period-lock"; @@ -180,9 +187,9 @@ export interface QueryConditionProtoMsg { */ export interface QueryConditionAmino { /** LockQueryType is a type of lock query, ByLockDuration | ByLockTime */ - lock_query_type: LockQueryType; + lock_query_type?: LockQueryType; /** Denom represents the token denomination we are looking to lock up */ - denom: string; + denom?: string; /** * Duration is used to query locks with longer duration than the specified * duration. Duration field must not be nil when the lock query type is @@ -194,7 +201,7 @@ export interface QueryConditionAmino { * Timestamp field must not be nil when the lock query type is `ByLockTime`. * Querying locks with timestamp is currently not implemented. */ - timestamp?: Date; + timestamp?: string; } export interface QueryConditionAminoMsg { type: "osmosis/lockup/query-condition"; @@ -254,17 +261,17 @@ export interface SyntheticLockAmino { * Underlying Lock ID is the underlying native lock's id for this synthetic * lockup. A synthetic lock MUST have an underlying lock. */ - underlying_lock_id: string; + underlying_lock_id?: string; /** * SynthDenom is the synthetic denom that is a combination of * gamm share + bonding status + validator address. */ - synth_denom: string; + synth_denom?: string; /** * used for unbonding synthetic lockups, for active synthetic lockups, this * value is set to uninitialized value */ - end_time?: Date; + end_time?: string; /** * Duration is the duration for a synthetic lock to mature * at the point of unbonding has started. @@ -291,14 +298,24 @@ function createBasePeriodLock(): PeriodLock { return { ID: BigInt(0), owner: "", - duration: undefined, - endTime: undefined, + duration: Duration.fromPartial({}), + endTime: new Date(), coins: [], rewardReceiverAddress: "" }; } export const PeriodLock = { typeUrl: "/osmosis.lockup.PeriodLock", + aminoType: "osmosis/lockup/period-lock", + is(o: any): o is PeriodLock { + return o && (o.$typeUrl === PeriodLock.typeUrl || typeof o.ID === "bigint" && typeof o.owner === "string" && Duration.is(o.duration) && Timestamp.is(o.endTime) && Array.isArray(o.coins) && (!o.coins.length || Coin.is(o.coins[0])) && typeof o.rewardReceiverAddress === "string"); + }, + isSDK(o: any): o is PeriodLockSDKType { + return o && (o.$typeUrl === PeriodLock.typeUrl || typeof o.ID === "bigint" && typeof o.owner === "string" && Duration.isSDK(o.duration) && Timestamp.isSDK(o.end_time) && Array.isArray(o.coins) && (!o.coins.length || Coin.isSDK(o.coins[0])) && typeof o.reward_receiver_address === "string"); + }, + isAmino(o: any): o is PeriodLockAmino { + return o && (o.$typeUrl === PeriodLock.typeUrl || typeof o.ID === "bigint" && typeof o.owner === "string" && Duration.isAmino(o.duration) && Timestamp.isAmino(o.end_time) && Array.isArray(o.coins) && (!o.coins.length || Coin.isAmino(o.coins[0])) && typeof o.reward_receiver_address === "string"); + }, encode(message: PeriodLock, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.ID !== BigInt(0)) { writer.uint32(8).uint64(message.ID); @@ -352,6 +369,30 @@ export const PeriodLock = { } return message; }, + fromJSON(object: any): PeriodLock { + return { + ID: isSet(object.ID) ? BigInt(object.ID.toString()) : BigInt(0), + owner: isSet(object.owner) ? String(object.owner) : "", + duration: isSet(object.duration) ? Duration.fromJSON(object.duration) : undefined, + endTime: isSet(object.endTime) ? new Date(object.endTime) : undefined, + coins: Array.isArray(object?.coins) ? object.coins.map((e: any) => Coin.fromJSON(e)) : [], + rewardReceiverAddress: isSet(object.rewardReceiverAddress) ? String(object.rewardReceiverAddress) : "" + }; + }, + toJSON(message: PeriodLock): unknown { + const obj: any = {}; + message.ID !== undefined && (obj.ID = (message.ID || BigInt(0)).toString()); + message.owner !== undefined && (obj.owner = message.owner); + message.duration !== undefined && (obj.duration = message.duration ? Duration.toJSON(message.duration) : undefined); + message.endTime !== undefined && (obj.endTime = message.endTime.toISOString()); + if (message.coins) { + obj.coins = message.coins.map(e => e ? Coin.toJSON(e) : undefined); + } else { + obj.coins = []; + } + message.rewardReceiverAddress !== undefined && (obj.rewardReceiverAddress = message.rewardReceiverAddress); + return obj; + }, fromPartial(object: Partial): PeriodLock { const message = createBasePeriodLock(); message.ID = object.ID !== undefined && object.ID !== null ? BigInt(object.ID.toString()) : BigInt(0); @@ -363,21 +404,31 @@ export const PeriodLock = { return message; }, fromAmino(object: PeriodLockAmino): PeriodLock { - return { - ID: BigInt(object.ID), - owner: object.owner, - duration: object?.duration ? Duration.fromAmino(object.duration) : undefined, - endTime: object.end_time, - coins: Array.isArray(object?.coins) ? object.coins.map((e: any) => Coin.fromAmino(e)) : [], - rewardReceiverAddress: object.reward_receiver_address - }; + const message = createBasePeriodLock(); + if (object.ID !== undefined && object.ID !== null) { + message.ID = BigInt(object.ID); + } + if (object.owner !== undefined && object.owner !== null) { + message.owner = object.owner; + } + if (object.duration !== undefined && object.duration !== null) { + message.duration = Duration.fromAmino(object.duration); + } + if (object.end_time !== undefined && object.end_time !== null) { + message.endTime = fromTimestamp(Timestamp.fromAmino(object.end_time)); + } + message.coins = object.coins?.map(e => Coin.fromAmino(e)) || []; + if (object.reward_receiver_address !== undefined && object.reward_receiver_address !== null) { + message.rewardReceiverAddress = object.reward_receiver_address; + } + return message; }, toAmino(message: PeriodLock): PeriodLockAmino { const obj: any = {}; obj.ID = message.ID ? message.ID.toString() : undefined; obj.owner = message.owner; obj.duration = message.duration ? Duration.toAmino(message.duration) : undefined; - obj.end_time = message.endTime; + obj.end_time = message.endTime ? Timestamp.toAmino(toTimestamp(message.endTime)) : undefined; if (message.coins) { obj.coins = message.coins.map(e => e ? Coin.toAmino(e) : undefined); } else { @@ -408,16 +459,28 @@ export const PeriodLock = { }; } }; +GlobalDecoderRegistry.register(PeriodLock.typeUrl, PeriodLock); +GlobalDecoderRegistry.registerAminoProtoMapping(PeriodLock.aminoType, PeriodLock.typeUrl); function createBaseQueryCondition(): QueryCondition { return { lockQueryType: 0, denom: "", - duration: undefined, - timestamp: undefined + duration: Duration.fromPartial({}), + timestamp: new Date() }; } export const QueryCondition = { typeUrl: "/osmosis.lockup.QueryCondition", + aminoType: "osmosis/lockup/query-condition", + is(o: any): o is QueryCondition { + return o && (o.$typeUrl === QueryCondition.typeUrl || isSet(o.lockQueryType) && typeof o.denom === "string" && Duration.is(o.duration) && Timestamp.is(o.timestamp)); + }, + isSDK(o: any): o is QueryConditionSDKType { + return o && (o.$typeUrl === QueryCondition.typeUrl || isSet(o.lock_query_type) && typeof o.denom === "string" && Duration.isSDK(o.duration) && Timestamp.isSDK(o.timestamp)); + }, + isAmino(o: any): o is QueryConditionAmino { + return o && (o.$typeUrl === QueryCondition.typeUrl || isSet(o.lock_query_type) && typeof o.denom === "string" && Duration.isAmino(o.duration) && Timestamp.isAmino(o.timestamp)); + }, encode(message: QueryCondition, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.lockQueryType !== 0) { writer.uint32(8).int32(message.lockQueryType); @@ -459,6 +522,22 @@ export const QueryCondition = { } return message; }, + fromJSON(object: any): QueryCondition { + return { + lockQueryType: isSet(object.lockQueryType) ? lockQueryTypeFromJSON(object.lockQueryType) : -1, + denom: isSet(object.denom) ? String(object.denom) : "", + duration: isSet(object.duration) ? Duration.fromJSON(object.duration) : undefined, + timestamp: isSet(object.timestamp) ? new Date(object.timestamp) : undefined + }; + }, + toJSON(message: QueryCondition): unknown { + const obj: any = {}; + message.lockQueryType !== undefined && (obj.lockQueryType = lockQueryTypeToJSON(message.lockQueryType)); + message.denom !== undefined && (obj.denom = message.denom); + message.duration !== undefined && (obj.duration = message.duration ? Duration.toJSON(message.duration) : undefined); + message.timestamp !== undefined && (obj.timestamp = message.timestamp.toISOString()); + return obj; + }, fromPartial(object: Partial): QueryCondition { const message = createBaseQueryCondition(); message.lockQueryType = object.lockQueryType ?? 0; @@ -468,19 +547,27 @@ export const QueryCondition = { return message; }, fromAmino(object: QueryConditionAmino): QueryCondition { - return { - lockQueryType: isSet(object.lock_query_type) ? lockQueryTypeFromJSON(object.lock_query_type) : -1, - denom: object.denom, - duration: object?.duration ? Duration.fromAmino(object.duration) : undefined, - timestamp: object.timestamp - }; + const message = createBaseQueryCondition(); + if (object.lock_query_type !== undefined && object.lock_query_type !== null) { + message.lockQueryType = lockQueryTypeFromJSON(object.lock_query_type); + } + if (object.denom !== undefined && object.denom !== null) { + message.denom = object.denom; + } + if (object.duration !== undefined && object.duration !== null) { + message.duration = Duration.fromAmino(object.duration); + } + if (object.timestamp !== undefined && object.timestamp !== null) { + message.timestamp = fromTimestamp(Timestamp.fromAmino(object.timestamp)); + } + return message; }, toAmino(message: QueryCondition): QueryConditionAmino { const obj: any = {}; - obj.lock_query_type = message.lockQueryType; + obj.lock_query_type = lockQueryTypeToJSON(message.lockQueryType); obj.denom = message.denom; obj.duration = message.duration ? Duration.toAmino(message.duration) : undefined; - obj.timestamp = message.timestamp; + obj.timestamp = message.timestamp ? Timestamp.toAmino(toTimestamp(message.timestamp)) : undefined; return obj; }, fromAminoMsg(object: QueryConditionAminoMsg): QueryCondition { @@ -505,16 +592,28 @@ export const QueryCondition = { }; } }; +GlobalDecoderRegistry.register(QueryCondition.typeUrl, QueryCondition); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryCondition.aminoType, QueryCondition.typeUrl); function createBaseSyntheticLock(): SyntheticLock { return { underlyingLockId: BigInt(0), synthDenom: "", - endTime: undefined, - duration: undefined + endTime: new Date(), + duration: Duration.fromPartial({}) }; } export const SyntheticLock = { typeUrl: "/osmosis.lockup.SyntheticLock", + aminoType: "osmosis/lockup/synthetic-lock", + is(o: any): o is SyntheticLock { + return o && (o.$typeUrl === SyntheticLock.typeUrl || typeof o.underlyingLockId === "bigint" && typeof o.synthDenom === "string" && Timestamp.is(o.endTime) && Duration.is(o.duration)); + }, + isSDK(o: any): o is SyntheticLockSDKType { + return o && (o.$typeUrl === SyntheticLock.typeUrl || typeof o.underlying_lock_id === "bigint" && typeof o.synth_denom === "string" && Timestamp.isSDK(o.end_time) && Duration.isSDK(o.duration)); + }, + isAmino(o: any): o is SyntheticLockAmino { + return o && (o.$typeUrl === SyntheticLock.typeUrl || typeof o.underlying_lock_id === "bigint" && typeof o.synth_denom === "string" && Timestamp.isAmino(o.end_time) && Duration.isAmino(o.duration)); + }, encode(message: SyntheticLock, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.underlyingLockId !== BigInt(0)) { writer.uint32(8).uint64(message.underlyingLockId); @@ -556,6 +655,22 @@ export const SyntheticLock = { } return message; }, + fromJSON(object: any): SyntheticLock { + return { + underlyingLockId: isSet(object.underlyingLockId) ? BigInt(object.underlyingLockId.toString()) : BigInt(0), + synthDenom: isSet(object.synthDenom) ? String(object.synthDenom) : "", + endTime: isSet(object.endTime) ? new Date(object.endTime) : undefined, + duration: isSet(object.duration) ? Duration.fromJSON(object.duration) : undefined + }; + }, + toJSON(message: SyntheticLock): unknown { + const obj: any = {}; + message.underlyingLockId !== undefined && (obj.underlyingLockId = (message.underlyingLockId || BigInt(0)).toString()); + message.synthDenom !== undefined && (obj.synthDenom = message.synthDenom); + message.endTime !== undefined && (obj.endTime = message.endTime.toISOString()); + message.duration !== undefined && (obj.duration = message.duration ? Duration.toJSON(message.duration) : undefined); + return obj; + }, fromPartial(object: Partial): SyntheticLock { const message = createBaseSyntheticLock(); message.underlyingLockId = object.underlyingLockId !== undefined && object.underlyingLockId !== null ? BigInt(object.underlyingLockId.toString()) : BigInt(0); @@ -565,18 +680,26 @@ export const SyntheticLock = { return message; }, fromAmino(object: SyntheticLockAmino): SyntheticLock { - return { - underlyingLockId: BigInt(object.underlying_lock_id), - synthDenom: object.synth_denom, - endTime: object.end_time, - duration: object?.duration ? Duration.fromAmino(object.duration) : undefined - }; + const message = createBaseSyntheticLock(); + if (object.underlying_lock_id !== undefined && object.underlying_lock_id !== null) { + message.underlyingLockId = BigInt(object.underlying_lock_id); + } + if (object.synth_denom !== undefined && object.synth_denom !== null) { + message.synthDenom = object.synth_denom; + } + if (object.end_time !== undefined && object.end_time !== null) { + message.endTime = fromTimestamp(Timestamp.fromAmino(object.end_time)); + } + if (object.duration !== undefined && object.duration !== null) { + message.duration = Duration.fromAmino(object.duration); + } + return message; }, toAmino(message: SyntheticLock): SyntheticLockAmino { const obj: any = {}; obj.underlying_lock_id = message.underlyingLockId ? message.underlyingLockId.toString() : undefined; obj.synth_denom = message.synthDenom; - obj.end_time = message.endTime; + obj.end_time = message.endTime ? Timestamp.toAmino(toTimestamp(message.endTime)) : undefined; obj.duration = message.duration ? Duration.toAmino(message.duration) : undefined; return obj; }, @@ -601,4 +724,6 @@ export const SyntheticLock = { value: SyntheticLock.encode(message).finish() }; } -}; \ No newline at end of file +}; +GlobalDecoderRegistry.register(SyntheticLock.typeUrl, SyntheticLock); +GlobalDecoderRegistry.registerAminoProtoMapping(SyntheticLock.aminoType, SyntheticLock.typeUrl); \ No newline at end of file diff --git a/packages/osmojs/src/codegen/osmosis/lockup/params.ts b/packages/osmojs/src/codegen/osmosis/lockup/params.ts index 7348e3e07..80b68fdc6 100644 --- a/packages/osmojs/src/codegen/osmosis/lockup/params.ts +++ b/packages/osmojs/src/codegen/osmosis/lockup/params.ts @@ -1,4 +1,5 @@ import { BinaryReader, BinaryWriter } from "../../binary"; +import { GlobalDecoderRegistry } from "../../registry"; export interface Params { forceUnlockAllowedAddresses: string[]; } @@ -7,7 +8,7 @@ export interface ParamsProtoMsg { value: Uint8Array; } export interface ParamsAmino { - force_unlock_allowed_addresses: string[]; + force_unlock_allowed_addresses?: string[]; } export interface ParamsAminoMsg { type: "osmosis/lockup/params"; @@ -23,6 +24,16 @@ function createBaseParams(): Params { } export const Params = { typeUrl: "/osmosis.lockup.Params", + aminoType: "osmosis/lockup/params", + is(o: any): o is Params { + return o && (o.$typeUrl === Params.typeUrl || Array.isArray(o.forceUnlockAllowedAddresses) && (!o.forceUnlockAllowedAddresses.length || typeof o.forceUnlockAllowedAddresses[0] === "string")); + }, + isSDK(o: any): o is ParamsSDKType { + return o && (o.$typeUrl === Params.typeUrl || Array.isArray(o.force_unlock_allowed_addresses) && (!o.force_unlock_allowed_addresses.length || typeof o.force_unlock_allowed_addresses[0] === "string")); + }, + isAmino(o: any): o is ParamsAmino { + return o && (o.$typeUrl === Params.typeUrl || Array.isArray(o.force_unlock_allowed_addresses) && (!o.force_unlock_allowed_addresses.length || typeof o.force_unlock_allowed_addresses[0] === "string")); + }, encode(message: Params, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.forceUnlockAllowedAddresses) { writer.uint32(10).string(v!); @@ -46,15 +57,29 @@ export const Params = { } return message; }, + fromJSON(object: any): Params { + return { + forceUnlockAllowedAddresses: Array.isArray(object?.forceUnlockAllowedAddresses) ? object.forceUnlockAllowedAddresses.map((e: any) => String(e)) : [] + }; + }, + toJSON(message: Params): unknown { + const obj: any = {}; + if (message.forceUnlockAllowedAddresses) { + obj.forceUnlockAllowedAddresses = message.forceUnlockAllowedAddresses.map(e => e); + } else { + obj.forceUnlockAllowedAddresses = []; + } + return obj; + }, fromPartial(object: Partial): Params { const message = createBaseParams(); message.forceUnlockAllowedAddresses = object.forceUnlockAllowedAddresses?.map(e => e) || []; return message; }, fromAmino(object: ParamsAmino): Params { - return { - forceUnlockAllowedAddresses: Array.isArray(object?.force_unlock_allowed_addresses) ? object.force_unlock_allowed_addresses.map((e: any) => e) : [] - }; + const message = createBaseParams(); + message.forceUnlockAllowedAddresses = object.force_unlock_allowed_addresses?.map(e => e) || []; + return message; }, toAmino(message: Params): ParamsAmino { const obj: any = {}; @@ -86,4 +111,6 @@ export const Params = { value: Params.encode(message).finish() }; } -}; \ No newline at end of file +}; +GlobalDecoderRegistry.register(Params.typeUrl, Params); +GlobalDecoderRegistry.registerAminoProtoMapping(Params.aminoType, Params.typeUrl); \ No newline at end of file diff --git a/packages/osmojs/src/codegen/osmosis/lockup/query.ts b/packages/osmojs/src/codegen/osmosis/lockup/query.ts index 2af815373..3bbef38fa 100644 --- a/packages/osmojs/src/codegen/osmosis/lockup/query.ts +++ b/packages/osmojs/src/codegen/osmosis/lockup/query.ts @@ -4,7 +4,8 @@ import { Coin, CoinAmino, CoinSDKType } from "../../cosmos/base/v1beta1/coin"; import { PeriodLock, PeriodLockAmino, PeriodLockSDKType, SyntheticLock, SyntheticLockAmino, SyntheticLockSDKType } from "./lock"; import { Params, ParamsAmino, ParamsSDKType } from "./params"; import { BinaryReader, BinaryWriter } from "../../binary"; -import { toTimestamp, fromTimestamp } from "../../helpers"; +import { GlobalDecoderRegistry } from "../../registry"; +import { isSet, toTimestamp, fromTimestamp } from "../../helpers"; export interface ModuleBalanceRequest {} export interface ModuleBalanceRequestProtoMsg { typeUrl: "/osmosis.lockup.ModuleBalanceRequest"; @@ -24,7 +25,7 @@ export interface ModuleBalanceResponseProtoMsg { value: Uint8Array; } export interface ModuleBalanceResponseAmino { - coins: CoinAmino[]; + coins?: CoinAmino[]; } export interface ModuleBalanceResponseAminoMsg { type: "osmosis/lockup/module-balance-response"; @@ -52,7 +53,7 @@ export interface ModuleLockedAmountResponseProtoMsg { value: Uint8Array; } export interface ModuleLockedAmountResponseAmino { - coins: CoinAmino[]; + coins?: CoinAmino[]; } export interface ModuleLockedAmountResponseAminoMsg { type: "osmosis/lockup/module-locked-amount-response"; @@ -69,7 +70,7 @@ export interface AccountUnlockableCoinsRequestProtoMsg { value: Uint8Array; } export interface AccountUnlockableCoinsRequestAmino { - owner: string; + owner?: string; } export interface AccountUnlockableCoinsRequestAminoMsg { type: "osmosis/lockup/account-unlockable-coins-request"; @@ -86,7 +87,7 @@ export interface AccountUnlockableCoinsResponseProtoMsg { value: Uint8Array; } export interface AccountUnlockableCoinsResponseAmino { - coins: CoinAmino[]; + coins?: CoinAmino[]; } export interface AccountUnlockableCoinsResponseAminoMsg { type: "osmosis/lockup/account-unlockable-coins-response"; @@ -103,7 +104,7 @@ export interface AccountUnlockingCoinsRequestProtoMsg { value: Uint8Array; } export interface AccountUnlockingCoinsRequestAmino { - owner: string; + owner?: string; } export interface AccountUnlockingCoinsRequestAminoMsg { type: "osmosis/lockup/account-unlocking-coins-request"; @@ -120,7 +121,7 @@ export interface AccountUnlockingCoinsResponseProtoMsg { value: Uint8Array; } export interface AccountUnlockingCoinsResponseAmino { - coins: CoinAmino[]; + coins?: CoinAmino[]; } export interface AccountUnlockingCoinsResponseAminoMsg { type: "osmosis/lockup/account-unlocking-coins-response"; @@ -137,7 +138,7 @@ export interface AccountLockedCoinsRequestProtoMsg { value: Uint8Array; } export interface AccountLockedCoinsRequestAmino { - owner: string; + owner?: string; } export interface AccountLockedCoinsRequestAminoMsg { type: "osmosis/lockup/account-locked-coins-request"; @@ -154,7 +155,7 @@ export interface AccountLockedCoinsResponseProtoMsg { value: Uint8Array; } export interface AccountLockedCoinsResponseAmino { - coins: CoinAmino[]; + coins?: CoinAmino[]; } export interface AccountLockedCoinsResponseAminoMsg { type: "osmosis/lockup/account-locked-coins-response"; @@ -172,8 +173,8 @@ export interface AccountLockedPastTimeRequestProtoMsg { value: Uint8Array; } export interface AccountLockedPastTimeRequestAmino { - owner: string; - timestamp?: Date; + owner?: string; + timestamp?: string; } export interface AccountLockedPastTimeRequestAminoMsg { type: "osmosis/lockup/account-locked-past-time-request"; @@ -191,7 +192,7 @@ export interface AccountLockedPastTimeResponseProtoMsg { value: Uint8Array; } export interface AccountLockedPastTimeResponseAmino { - locks: PeriodLockAmino[]; + locks?: PeriodLockAmino[]; } export interface AccountLockedPastTimeResponseAminoMsg { type: "osmosis/lockup/account-locked-past-time-response"; @@ -209,8 +210,8 @@ export interface AccountLockedPastTimeNotUnlockingOnlyRequestProtoMsg { value: Uint8Array; } export interface AccountLockedPastTimeNotUnlockingOnlyRequestAmino { - owner: string; - timestamp?: Date; + owner?: string; + timestamp?: string; } export interface AccountLockedPastTimeNotUnlockingOnlyRequestAminoMsg { type: "osmosis/lockup/account-locked-past-time-not-unlocking-only-request"; @@ -228,7 +229,7 @@ export interface AccountLockedPastTimeNotUnlockingOnlyResponseProtoMsg { value: Uint8Array; } export interface AccountLockedPastTimeNotUnlockingOnlyResponseAmino { - locks: PeriodLockAmino[]; + locks?: PeriodLockAmino[]; } export interface AccountLockedPastTimeNotUnlockingOnlyResponseAminoMsg { type: "osmosis/lockup/account-locked-past-time-not-unlocking-only-response"; @@ -246,8 +247,8 @@ export interface AccountUnlockedBeforeTimeRequestProtoMsg { value: Uint8Array; } export interface AccountUnlockedBeforeTimeRequestAmino { - owner: string; - timestamp?: Date; + owner?: string; + timestamp?: string; } export interface AccountUnlockedBeforeTimeRequestAminoMsg { type: "osmosis/lockup/account-unlocked-before-time-request"; @@ -265,7 +266,7 @@ export interface AccountUnlockedBeforeTimeResponseProtoMsg { value: Uint8Array; } export interface AccountUnlockedBeforeTimeResponseAmino { - locks: PeriodLockAmino[]; + locks?: PeriodLockAmino[]; } export interface AccountUnlockedBeforeTimeResponseAminoMsg { type: "osmosis/lockup/account-unlocked-before-time-response"; @@ -284,9 +285,9 @@ export interface AccountLockedPastTimeDenomRequestProtoMsg { value: Uint8Array; } export interface AccountLockedPastTimeDenomRequestAmino { - owner: string; - timestamp?: Date; - denom: string; + owner?: string; + timestamp?: string; + denom?: string; } export interface AccountLockedPastTimeDenomRequestAminoMsg { type: "osmosis/lockup/account-locked-past-time-denom-request"; @@ -305,7 +306,7 @@ export interface AccountLockedPastTimeDenomResponseProtoMsg { value: Uint8Array; } export interface AccountLockedPastTimeDenomResponseAmino { - locks: PeriodLockAmino[]; + locks?: PeriodLockAmino[]; } export interface AccountLockedPastTimeDenomResponseAminoMsg { type: "osmosis/lockup/account-locked-past-time-denom-response"; @@ -323,7 +324,7 @@ export interface LockedDenomRequestProtoMsg { value: Uint8Array; } export interface LockedDenomRequestAmino { - denom: string; + denom?: string; duration?: DurationAmino; } export interface LockedDenomRequestAminoMsg { @@ -342,7 +343,7 @@ export interface LockedDenomResponseProtoMsg { value: Uint8Array; } export interface LockedDenomResponseAmino { - amount: string; + amount?: string; } export interface LockedDenomResponseAminoMsg { type: "osmosis/lockup/locked-denom-response"; @@ -359,7 +360,7 @@ export interface LockedRequestProtoMsg { value: Uint8Array; } export interface LockedRequestAmino { - lock_id: string; + lock_id?: string; } export interface LockedRequestAminoMsg { type: "osmosis/lockup/locked-request"; @@ -369,7 +370,7 @@ export interface LockedRequestSDKType { lock_id: bigint; } export interface LockedResponse { - lock: PeriodLock; + lock?: PeriodLock; } export interface LockedResponseProtoMsg { typeUrl: "/osmosis.lockup.LockedResponse"; @@ -383,7 +384,7 @@ export interface LockedResponseAminoMsg { value: LockedResponseAmino; } export interface LockedResponseSDKType { - lock: PeriodLockSDKType; + lock?: PeriodLockSDKType; } export interface LockRewardReceiverRequest { lockId: bigint; @@ -393,7 +394,7 @@ export interface LockRewardReceiverRequestProtoMsg { value: Uint8Array; } export interface LockRewardReceiverRequestAmino { - lock_id: string; + lock_id?: string; } export interface LockRewardReceiverRequestAminoMsg { type: "osmosis/lockup/lock-reward-receiver-request"; @@ -410,7 +411,7 @@ export interface LockRewardReceiverResponseProtoMsg { value: Uint8Array; } export interface LockRewardReceiverResponseAmino { - reward_receiver: string; + reward_receiver?: string; } export interface LockRewardReceiverResponseAminoMsg { type: "osmosis/lockup/lock-reward-receiver-response"; @@ -438,7 +439,7 @@ export interface NextLockIDResponseProtoMsg { value: Uint8Array; } export interface NextLockIDResponseAmino { - lock_id: string; + lock_id?: string; } export interface NextLockIDResponseAminoMsg { type: "osmosis/lockup/next-lock-id-response"; @@ -457,7 +458,7 @@ export interface SyntheticLockupsByLockupIDRequestProtoMsg { } /** @deprecated */ export interface SyntheticLockupsByLockupIDRequestAmino { - lock_id: string; + lock_id?: string; } export interface SyntheticLockupsByLockupIDRequestAminoMsg { type: "osmosis/lockup/synthetic-lockups-by-lockup-id-request"; @@ -477,7 +478,7 @@ export interface SyntheticLockupsByLockupIDResponseProtoMsg { } /** @deprecated */ export interface SyntheticLockupsByLockupIDResponseAmino { - synthetic_locks: SyntheticLockAmino[]; + synthetic_locks?: SyntheticLockAmino[]; } export interface SyntheticLockupsByLockupIDResponseAminoMsg { type: "osmosis/lockup/synthetic-lockups-by-lockup-id-response"; @@ -495,7 +496,7 @@ export interface SyntheticLockupByLockupIDRequestProtoMsg { value: Uint8Array; } export interface SyntheticLockupByLockupIDRequestAmino { - lock_id: string; + lock_id?: string; } export interface SyntheticLockupByLockupIDRequestAminoMsg { type: "osmosis/lockup/synthetic-lockup-by-lockup-id-request"; @@ -530,7 +531,7 @@ export interface AccountLockedLongerDurationRequestProtoMsg { value: Uint8Array; } export interface AccountLockedLongerDurationRequestAmino { - owner: string; + owner?: string; duration?: DurationAmino; } export interface AccountLockedLongerDurationRequestAminoMsg { @@ -549,7 +550,7 @@ export interface AccountLockedLongerDurationResponseProtoMsg { value: Uint8Array; } export interface AccountLockedLongerDurationResponseAmino { - locks: PeriodLockAmino[]; + locks?: PeriodLockAmino[]; } export interface AccountLockedLongerDurationResponseAminoMsg { type: "osmosis/lockup/account-locked-longer-duration-response"; @@ -567,7 +568,7 @@ export interface AccountLockedDurationRequestProtoMsg { value: Uint8Array; } export interface AccountLockedDurationRequestAmino { - owner: string; + owner?: string; duration?: DurationAmino; } export interface AccountLockedDurationRequestAminoMsg { @@ -586,7 +587,7 @@ export interface AccountLockedDurationResponseProtoMsg { value: Uint8Array; } export interface AccountLockedDurationResponseAmino { - locks: PeriodLockAmino[]; + locks?: PeriodLockAmino[]; } export interface AccountLockedDurationResponseAminoMsg { type: "osmosis/lockup/account-locked-duration-response"; @@ -604,7 +605,7 @@ export interface AccountLockedLongerDurationNotUnlockingOnlyRequestProtoMsg { value: Uint8Array; } export interface AccountLockedLongerDurationNotUnlockingOnlyRequestAmino { - owner: string; + owner?: string; duration?: DurationAmino; } export interface AccountLockedLongerDurationNotUnlockingOnlyRequestAminoMsg { @@ -623,7 +624,7 @@ export interface AccountLockedLongerDurationNotUnlockingOnlyResponseProtoMsg { value: Uint8Array; } export interface AccountLockedLongerDurationNotUnlockingOnlyResponseAmino { - locks: PeriodLockAmino[]; + locks?: PeriodLockAmino[]; } export interface AccountLockedLongerDurationNotUnlockingOnlyResponseAminoMsg { type: "osmosis/lockup/account-locked-longer-duration-not-unlocking-only-response"; @@ -642,9 +643,9 @@ export interface AccountLockedLongerDurationDenomRequestProtoMsg { value: Uint8Array; } export interface AccountLockedLongerDurationDenomRequestAmino { - owner: string; + owner?: string; duration?: DurationAmino; - denom: string; + denom?: string; } export interface AccountLockedLongerDurationDenomRequestAminoMsg { type: "osmosis/lockup/account-locked-longer-duration-denom-request"; @@ -663,7 +664,7 @@ export interface AccountLockedLongerDurationDenomResponseProtoMsg { value: Uint8Array; } export interface AccountLockedLongerDurationDenomResponseAmino { - locks: PeriodLockAmino[]; + locks?: PeriodLockAmino[]; } export interface AccountLockedLongerDurationDenomResponseAminoMsg { type: "osmosis/lockup/account-locked-longer-duration-denom-response"; @@ -705,6 +706,16 @@ function createBaseModuleBalanceRequest(): ModuleBalanceRequest { } export const ModuleBalanceRequest = { typeUrl: "/osmosis.lockup.ModuleBalanceRequest", + aminoType: "osmosis/lockup/module-balance-request", + is(o: any): o is ModuleBalanceRequest { + return o && o.$typeUrl === ModuleBalanceRequest.typeUrl; + }, + isSDK(o: any): o is ModuleBalanceRequestSDKType { + return o && o.$typeUrl === ModuleBalanceRequest.typeUrl; + }, + isAmino(o: any): o is ModuleBalanceRequestAmino { + return o && o.$typeUrl === ModuleBalanceRequest.typeUrl; + }, encode(_: ModuleBalanceRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, @@ -722,12 +733,20 @@ export const ModuleBalanceRequest = { } return message; }, + fromJSON(_: any): ModuleBalanceRequest { + return {}; + }, + toJSON(_: ModuleBalanceRequest): unknown { + const obj: any = {}; + return obj; + }, fromPartial(_: Partial): ModuleBalanceRequest { const message = createBaseModuleBalanceRequest(); return message; }, fromAmino(_: ModuleBalanceRequestAmino): ModuleBalanceRequest { - return {}; + const message = createBaseModuleBalanceRequest(); + return message; }, toAmino(_: ModuleBalanceRequest): ModuleBalanceRequestAmino { const obj: any = {}; @@ -755,6 +774,8 @@ export const ModuleBalanceRequest = { }; } }; +GlobalDecoderRegistry.register(ModuleBalanceRequest.typeUrl, ModuleBalanceRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(ModuleBalanceRequest.aminoType, ModuleBalanceRequest.typeUrl); function createBaseModuleBalanceResponse(): ModuleBalanceResponse { return { coins: [] @@ -762,6 +783,16 @@ function createBaseModuleBalanceResponse(): ModuleBalanceResponse { } export const ModuleBalanceResponse = { typeUrl: "/osmosis.lockup.ModuleBalanceResponse", + aminoType: "osmosis/lockup/module-balance-response", + is(o: any): o is ModuleBalanceResponse { + return o && (o.$typeUrl === ModuleBalanceResponse.typeUrl || Array.isArray(o.coins) && (!o.coins.length || Coin.is(o.coins[0]))); + }, + isSDK(o: any): o is ModuleBalanceResponseSDKType { + return o && (o.$typeUrl === ModuleBalanceResponse.typeUrl || Array.isArray(o.coins) && (!o.coins.length || Coin.isSDK(o.coins[0]))); + }, + isAmino(o: any): o is ModuleBalanceResponseAmino { + return o && (o.$typeUrl === ModuleBalanceResponse.typeUrl || Array.isArray(o.coins) && (!o.coins.length || Coin.isAmino(o.coins[0]))); + }, encode(message: ModuleBalanceResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.coins) { Coin.encode(v!, writer.uint32(10).fork()).ldelim(); @@ -785,15 +816,29 @@ export const ModuleBalanceResponse = { } return message; }, + fromJSON(object: any): ModuleBalanceResponse { + return { + coins: Array.isArray(object?.coins) ? object.coins.map((e: any) => Coin.fromJSON(e)) : [] + }; + }, + toJSON(message: ModuleBalanceResponse): unknown { + const obj: any = {}; + if (message.coins) { + obj.coins = message.coins.map(e => e ? Coin.toJSON(e) : undefined); + } else { + obj.coins = []; + } + return obj; + }, fromPartial(object: Partial): ModuleBalanceResponse { const message = createBaseModuleBalanceResponse(); message.coins = object.coins?.map(e => Coin.fromPartial(e)) || []; return message; }, fromAmino(object: ModuleBalanceResponseAmino): ModuleBalanceResponse { - return { - coins: Array.isArray(object?.coins) ? object.coins.map((e: any) => Coin.fromAmino(e)) : [] - }; + const message = createBaseModuleBalanceResponse(); + message.coins = object.coins?.map(e => Coin.fromAmino(e)) || []; + return message; }, toAmino(message: ModuleBalanceResponse): ModuleBalanceResponseAmino { const obj: any = {}; @@ -826,11 +871,23 @@ export const ModuleBalanceResponse = { }; } }; +GlobalDecoderRegistry.register(ModuleBalanceResponse.typeUrl, ModuleBalanceResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(ModuleBalanceResponse.aminoType, ModuleBalanceResponse.typeUrl); function createBaseModuleLockedAmountRequest(): ModuleLockedAmountRequest { return {}; } export const ModuleLockedAmountRequest = { typeUrl: "/osmosis.lockup.ModuleLockedAmountRequest", + aminoType: "osmosis/lockup/module-locked-amount-request", + is(o: any): o is ModuleLockedAmountRequest { + return o && o.$typeUrl === ModuleLockedAmountRequest.typeUrl; + }, + isSDK(o: any): o is ModuleLockedAmountRequestSDKType { + return o && o.$typeUrl === ModuleLockedAmountRequest.typeUrl; + }, + isAmino(o: any): o is ModuleLockedAmountRequestAmino { + return o && o.$typeUrl === ModuleLockedAmountRequest.typeUrl; + }, encode(_: ModuleLockedAmountRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, @@ -848,12 +905,20 @@ export const ModuleLockedAmountRequest = { } return message; }, + fromJSON(_: any): ModuleLockedAmountRequest { + return {}; + }, + toJSON(_: ModuleLockedAmountRequest): unknown { + const obj: any = {}; + return obj; + }, fromPartial(_: Partial): ModuleLockedAmountRequest { const message = createBaseModuleLockedAmountRequest(); return message; }, fromAmino(_: ModuleLockedAmountRequestAmino): ModuleLockedAmountRequest { - return {}; + const message = createBaseModuleLockedAmountRequest(); + return message; }, toAmino(_: ModuleLockedAmountRequest): ModuleLockedAmountRequestAmino { const obj: any = {}; @@ -881,6 +946,8 @@ export const ModuleLockedAmountRequest = { }; } }; +GlobalDecoderRegistry.register(ModuleLockedAmountRequest.typeUrl, ModuleLockedAmountRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(ModuleLockedAmountRequest.aminoType, ModuleLockedAmountRequest.typeUrl); function createBaseModuleLockedAmountResponse(): ModuleLockedAmountResponse { return { coins: [] @@ -888,6 +955,16 @@ function createBaseModuleLockedAmountResponse(): ModuleLockedAmountResponse { } export const ModuleLockedAmountResponse = { typeUrl: "/osmosis.lockup.ModuleLockedAmountResponse", + aminoType: "osmosis/lockup/module-locked-amount-response", + is(o: any): o is ModuleLockedAmountResponse { + return o && (o.$typeUrl === ModuleLockedAmountResponse.typeUrl || Array.isArray(o.coins) && (!o.coins.length || Coin.is(o.coins[0]))); + }, + isSDK(o: any): o is ModuleLockedAmountResponseSDKType { + return o && (o.$typeUrl === ModuleLockedAmountResponse.typeUrl || Array.isArray(o.coins) && (!o.coins.length || Coin.isSDK(o.coins[0]))); + }, + isAmino(o: any): o is ModuleLockedAmountResponseAmino { + return o && (o.$typeUrl === ModuleLockedAmountResponse.typeUrl || Array.isArray(o.coins) && (!o.coins.length || Coin.isAmino(o.coins[0]))); + }, encode(message: ModuleLockedAmountResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.coins) { Coin.encode(v!, writer.uint32(10).fork()).ldelim(); @@ -911,15 +988,29 @@ export const ModuleLockedAmountResponse = { } return message; }, + fromJSON(object: any): ModuleLockedAmountResponse { + return { + coins: Array.isArray(object?.coins) ? object.coins.map((e: any) => Coin.fromJSON(e)) : [] + }; + }, + toJSON(message: ModuleLockedAmountResponse): unknown { + const obj: any = {}; + if (message.coins) { + obj.coins = message.coins.map(e => e ? Coin.toJSON(e) : undefined); + } else { + obj.coins = []; + } + return obj; + }, fromPartial(object: Partial): ModuleLockedAmountResponse { const message = createBaseModuleLockedAmountResponse(); message.coins = object.coins?.map(e => Coin.fromPartial(e)) || []; return message; }, fromAmino(object: ModuleLockedAmountResponseAmino): ModuleLockedAmountResponse { - return { - coins: Array.isArray(object?.coins) ? object.coins.map((e: any) => Coin.fromAmino(e)) : [] - }; + const message = createBaseModuleLockedAmountResponse(); + message.coins = object.coins?.map(e => Coin.fromAmino(e)) || []; + return message; }, toAmino(message: ModuleLockedAmountResponse): ModuleLockedAmountResponseAmino { const obj: any = {}; @@ -952,6 +1043,8 @@ export const ModuleLockedAmountResponse = { }; } }; +GlobalDecoderRegistry.register(ModuleLockedAmountResponse.typeUrl, ModuleLockedAmountResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(ModuleLockedAmountResponse.aminoType, ModuleLockedAmountResponse.typeUrl); function createBaseAccountUnlockableCoinsRequest(): AccountUnlockableCoinsRequest { return { owner: "" @@ -959,6 +1052,16 @@ function createBaseAccountUnlockableCoinsRequest(): AccountUnlockableCoinsReques } export const AccountUnlockableCoinsRequest = { typeUrl: "/osmosis.lockup.AccountUnlockableCoinsRequest", + aminoType: "osmosis/lockup/account-unlockable-coins-request", + is(o: any): o is AccountUnlockableCoinsRequest { + return o && (o.$typeUrl === AccountUnlockableCoinsRequest.typeUrl || typeof o.owner === "string"); + }, + isSDK(o: any): o is AccountUnlockableCoinsRequestSDKType { + return o && (o.$typeUrl === AccountUnlockableCoinsRequest.typeUrl || typeof o.owner === "string"); + }, + isAmino(o: any): o is AccountUnlockableCoinsRequestAmino { + return o && (o.$typeUrl === AccountUnlockableCoinsRequest.typeUrl || typeof o.owner === "string"); + }, encode(message: AccountUnlockableCoinsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.owner !== "") { writer.uint32(10).string(message.owner); @@ -982,15 +1085,27 @@ export const AccountUnlockableCoinsRequest = { } return message; }, + fromJSON(object: any): AccountUnlockableCoinsRequest { + return { + owner: isSet(object.owner) ? String(object.owner) : "" + }; + }, + toJSON(message: AccountUnlockableCoinsRequest): unknown { + const obj: any = {}; + message.owner !== undefined && (obj.owner = message.owner); + return obj; + }, fromPartial(object: Partial): AccountUnlockableCoinsRequest { const message = createBaseAccountUnlockableCoinsRequest(); message.owner = object.owner ?? ""; return message; }, fromAmino(object: AccountUnlockableCoinsRequestAmino): AccountUnlockableCoinsRequest { - return { - owner: object.owner - }; + const message = createBaseAccountUnlockableCoinsRequest(); + if (object.owner !== undefined && object.owner !== null) { + message.owner = object.owner; + } + return message; }, toAmino(message: AccountUnlockableCoinsRequest): AccountUnlockableCoinsRequestAmino { const obj: any = {}; @@ -1019,6 +1134,8 @@ export const AccountUnlockableCoinsRequest = { }; } }; +GlobalDecoderRegistry.register(AccountUnlockableCoinsRequest.typeUrl, AccountUnlockableCoinsRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(AccountUnlockableCoinsRequest.aminoType, AccountUnlockableCoinsRequest.typeUrl); function createBaseAccountUnlockableCoinsResponse(): AccountUnlockableCoinsResponse { return { coins: [] @@ -1026,6 +1143,16 @@ function createBaseAccountUnlockableCoinsResponse(): AccountUnlockableCoinsRespo } export const AccountUnlockableCoinsResponse = { typeUrl: "/osmosis.lockup.AccountUnlockableCoinsResponse", + aminoType: "osmosis/lockup/account-unlockable-coins-response", + is(o: any): o is AccountUnlockableCoinsResponse { + return o && (o.$typeUrl === AccountUnlockableCoinsResponse.typeUrl || Array.isArray(o.coins) && (!o.coins.length || Coin.is(o.coins[0]))); + }, + isSDK(o: any): o is AccountUnlockableCoinsResponseSDKType { + return o && (o.$typeUrl === AccountUnlockableCoinsResponse.typeUrl || Array.isArray(o.coins) && (!o.coins.length || Coin.isSDK(o.coins[0]))); + }, + isAmino(o: any): o is AccountUnlockableCoinsResponseAmino { + return o && (o.$typeUrl === AccountUnlockableCoinsResponse.typeUrl || Array.isArray(o.coins) && (!o.coins.length || Coin.isAmino(o.coins[0]))); + }, encode(message: AccountUnlockableCoinsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.coins) { Coin.encode(v!, writer.uint32(10).fork()).ldelim(); @@ -1049,15 +1176,29 @@ export const AccountUnlockableCoinsResponse = { } return message; }, + fromJSON(object: any): AccountUnlockableCoinsResponse { + return { + coins: Array.isArray(object?.coins) ? object.coins.map((e: any) => Coin.fromJSON(e)) : [] + }; + }, + toJSON(message: AccountUnlockableCoinsResponse): unknown { + const obj: any = {}; + if (message.coins) { + obj.coins = message.coins.map(e => e ? Coin.toJSON(e) : undefined); + } else { + obj.coins = []; + } + return obj; + }, fromPartial(object: Partial): AccountUnlockableCoinsResponse { const message = createBaseAccountUnlockableCoinsResponse(); message.coins = object.coins?.map(e => Coin.fromPartial(e)) || []; return message; }, fromAmino(object: AccountUnlockableCoinsResponseAmino): AccountUnlockableCoinsResponse { - return { - coins: Array.isArray(object?.coins) ? object.coins.map((e: any) => Coin.fromAmino(e)) : [] - }; + const message = createBaseAccountUnlockableCoinsResponse(); + message.coins = object.coins?.map(e => Coin.fromAmino(e)) || []; + return message; }, toAmino(message: AccountUnlockableCoinsResponse): AccountUnlockableCoinsResponseAmino { const obj: any = {}; @@ -1090,6 +1231,8 @@ export const AccountUnlockableCoinsResponse = { }; } }; +GlobalDecoderRegistry.register(AccountUnlockableCoinsResponse.typeUrl, AccountUnlockableCoinsResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(AccountUnlockableCoinsResponse.aminoType, AccountUnlockableCoinsResponse.typeUrl); function createBaseAccountUnlockingCoinsRequest(): AccountUnlockingCoinsRequest { return { owner: "" @@ -1097,6 +1240,16 @@ function createBaseAccountUnlockingCoinsRequest(): AccountUnlockingCoinsRequest } export const AccountUnlockingCoinsRequest = { typeUrl: "/osmosis.lockup.AccountUnlockingCoinsRequest", + aminoType: "osmosis/lockup/account-unlocking-coins-request", + is(o: any): o is AccountUnlockingCoinsRequest { + return o && (o.$typeUrl === AccountUnlockingCoinsRequest.typeUrl || typeof o.owner === "string"); + }, + isSDK(o: any): o is AccountUnlockingCoinsRequestSDKType { + return o && (o.$typeUrl === AccountUnlockingCoinsRequest.typeUrl || typeof o.owner === "string"); + }, + isAmino(o: any): o is AccountUnlockingCoinsRequestAmino { + return o && (o.$typeUrl === AccountUnlockingCoinsRequest.typeUrl || typeof o.owner === "string"); + }, encode(message: AccountUnlockingCoinsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.owner !== "") { writer.uint32(10).string(message.owner); @@ -1120,15 +1273,27 @@ export const AccountUnlockingCoinsRequest = { } return message; }, + fromJSON(object: any): AccountUnlockingCoinsRequest { + return { + owner: isSet(object.owner) ? String(object.owner) : "" + }; + }, + toJSON(message: AccountUnlockingCoinsRequest): unknown { + const obj: any = {}; + message.owner !== undefined && (obj.owner = message.owner); + return obj; + }, fromPartial(object: Partial): AccountUnlockingCoinsRequest { const message = createBaseAccountUnlockingCoinsRequest(); message.owner = object.owner ?? ""; return message; }, fromAmino(object: AccountUnlockingCoinsRequestAmino): AccountUnlockingCoinsRequest { - return { - owner: object.owner - }; + const message = createBaseAccountUnlockingCoinsRequest(); + if (object.owner !== undefined && object.owner !== null) { + message.owner = object.owner; + } + return message; }, toAmino(message: AccountUnlockingCoinsRequest): AccountUnlockingCoinsRequestAmino { const obj: any = {}; @@ -1157,6 +1322,8 @@ export const AccountUnlockingCoinsRequest = { }; } }; +GlobalDecoderRegistry.register(AccountUnlockingCoinsRequest.typeUrl, AccountUnlockingCoinsRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(AccountUnlockingCoinsRequest.aminoType, AccountUnlockingCoinsRequest.typeUrl); function createBaseAccountUnlockingCoinsResponse(): AccountUnlockingCoinsResponse { return { coins: [] @@ -1164,6 +1331,16 @@ function createBaseAccountUnlockingCoinsResponse(): AccountUnlockingCoinsRespons } export const AccountUnlockingCoinsResponse = { typeUrl: "/osmosis.lockup.AccountUnlockingCoinsResponse", + aminoType: "osmosis/lockup/account-unlocking-coins-response", + is(o: any): o is AccountUnlockingCoinsResponse { + return o && (o.$typeUrl === AccountUnlockingCoinsResponse.typeUrl || Array.isArray(o.coins) && (!o.coins.length || Coin.is(o.coins[0]))); + }, + isSDK(o: any): o is AccountUnlockingCoinsResponseSDKType { + return o && (o.$typeUrl === AccountUnlockingCoinsResponse.typeUrl || Array.isArray(o.coins) && (!o.coins.length || Coin.isSDK(o.coins[0]))); + }, + isAmino(o: any): o is AccountUnlockingCoinsResponseAmino { + return o && (o.$typeUrl === AccountUnlockingCoinsResponse.typeUrl || Array.isArray(o.coins) && (!o.coins.length || Coin.isAmino(o.coins[0]))); + }, encode(message: AccountUnlockingCoinsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.coins) { Coin.encode(v!, writer.uint32(10).fork()).ldelim(); @@ -1187,15 +1364,29 @@ export const AccountUnlockingCoinsResponse = { } return message; }, + fromJSON(object: any): AccountUnlockingCoinsResponse { + return { + coins: Array.isArray(object?.coins) ? object.coins.map((e: any) => Coin.fromJSON(e)) : [] + }; + }, + toJSON(message: AccountUnlockingCoinsResponse): unknown { + const obj: any = {}; + if (message.coins) { + obj.coins = message.coins.map(e => e ? Coin.toJSON(e) : undefined); + } else { + obj.coins = []; + } + return obj; + }, fromPartial(object: Partial): AccountUnlockingCoinsResponse { const message = createBaseAccountUnlockingCoinsResponse(); message.coins = object.coins?.map(e => Coin.fromPartial(e)) || []; return message; }, fromAmino(object: AccountUnlockingCoinsResponseAmino): AccountUnlockingCoinsResponse { - return { - coins: Array.isArray(object?.coins) ? object.coins.map((e: any) => Coin.fromAmino(e)) : [] - }; + const message = createBaseAccountUnlockingCoinsResponse(); + message.coins = object.coins?.map(e => Coin.fromAmino(e)) || []; + return message; }, toAmino(message: AccountUnlockingCoinsResponse): AccountUnlockingCoinsResponseAmino { const obj: any = {}; @@ -1228,6 +1419,8 @@ export const AccountUnlockingCoinsResponse = { }; } }; +GlobalDecoderRegistry.register(AccountUnlockingCoinsResponse.typeUrl, AccountUnlockingCoinsResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(AccountUnlockingCoinsResponse.aminoType, AccountUnlockingCoinsResponse.typeUrl); function createBaseAccountLockedCoinsRequest(): AccountLockedCoinsRequest { return { owner: "" @@ -1235,6 +1428,16 @@ function createBaseAccountLockedCoinsRequest(): AccountLockedCoinsRequest { } export const AccountLockedCoinsRequest = { typeUrl: "/osmosis.lockup.AccountLockedCoinsRequest", + aminoType: "osmosis/lockup/account-locked-coins-request", + is(o: any): o is AccountLockedCoinsRequest { + return o && (o.$typeUrl === AccountLockedCoinsRequest.typeUrl || typeof o.owner === "string"); + }, + isSDK(o: any): o is AccountLockedCoinsRequestSDKType { + return o && (o.$typeUrl === AccountLockedCoinsRequest.typeUrl || typeof o.owner === "string"); + }, + isAmino(o: any): o is AccountLockedCoinsRequestAmino { + return o && (o.$typeUrl === AccountLockedCoinsRequest.typeUrl || typeof o.owner === "string"); + }, encode(message: AccountLockedCoinsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.owner !== "") { writer.uint32(10).string(message.owner); @@ -1258,15 +1461,27 @@ export const AccountLockedCoinsRequest = { } return message; }, + fromJSON(object: any): AccountLockedCoinsRequest { + return { + owner: isSet(object.owner) ? String(object.owner) : "" + }; + }, + toJSON(message: AccountLockedCoinsRequest): unknown { + const obj: any = {}; + message.owner !== undefined && (obj.owner = message.owner); + return obj; + }, fromPartial(object: Partial): AccountLockedCoinsRequest { const message = createBaseAccountLockedCoinsRequest(); message.owner = object.owner ?? ""; return message; }, fromAmino(object: AccountLockedCoinsRequestAmino): AccountLockedCoinsRequest { - return { - owner: object.owner - }; + const message = createBaseAccountLockedCoinsRequest(); + if (object.owner !== undefined && object.owner !== null) { + message.owner = object.owner; + } + return message; }, toAmino(message: AccountLockedCoinsRequest): AccountLockedCoinsRequestAmino { const obj: any = {}; @@ -1295,6 +1510,8 @@ export const AccountLockedCoinsRequest = { }; } }; +GlobalDecoderRegistry.register(AccountLockedCoinsRequest.typeUrl, AccountLockedCoinsRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(AccountLockedCoinsRequest.aminoType, AccountLockedCoinsRequest.typeUrl); function createBaseAccountLockedCoinsResponse(): AccountLockedCoinsResponse { return { coins: [] @@ -1302,6 +1519,16 @@ function createBaseAccountLockedCoinsResponse(): AccountLockedCoinsResponse { } export const AccountLockedCoinsResponse = { typeUrl: "/osmosis.lockup.AccountLockedCoinsResponse", + aminoType: "osmosis/lockup/account-locked-coins-response", + is(o: any): o is AccountLockedCoinsResponse { + return o && (o.$typeUrl === AccountLockedCoinsResponse.typeUrl || Array.isArray(o.coins) && (!o.coins.length || Coin.is(o.coins[0]))); + }, + isSDK(o: any): o is AccountLockedCoinsResponseSDKType { + return o && (o.$typeUrl === AccountLockedCoinsResponse.typeUrl || Array.isArray(o.coins) && (!o.coins.length || Coin.isSDK(o.coins[0]))); + }, + isAmino(o: any): o is AccountLockedCoinsResponseAmino { + return o && (o.$typeUrl === AccountLockedCoinsResponse.typeUrl || Array.isArray(o.coins) && (!o.coins.length || Coin.isAmino(o.coins[0]))); + }, encode(message: AccountLockedCoinsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.coins) { Coin.encode(v!, writer.uint32(10).fork()).ldelim(); @@ -1325,15 +1552,29 @@ export const AccountLockedCoinsResponse = { } return message; }, + fromJSON(object: any): AccountLockedCoinsResponse { + return { + coins: Array.isArray(object?.coins) ? object.coins.map((e: any) => Coin.fromJSON(e)) : [] + }; + }, + toJSON(message: AccountLockedCoinsResponse): unknown { + const obj: any = {}; + if (message.coins) { + obj.coins = message.coins.map(e => e ? Coin.toJSON(e) : undefined); + } else { + obj.coins = []; + } + return obj; + }, fromPartial(object: Partial): AccountLockedCoinsResponse { const message = createBaseAccountLockedCoinsResponse(); message.coins = object.coins?.map(e => Coin.fromPartial(e)) || []; return message; }, fromAmino(object: AccountLockedCoinsResponseAmino): AccountLockedCoinsResponse { - return { - coins: Array.isArray(object?.coins) ? object.coins.map((e: any) => Coin.fromAmino(e)) : [] - }; + const message = createBaseAccountLockedCoinsResponse(); + message.coins = object.coins?.map(e => Coin.fromAmino(e)) || []; + return message; }, toAmino(message: AccountLockedCoinsResponse): AccountLockedCoinsResponseAmino { const obj: any = {}; @@ -1366,14 +1607,26 @@ export const AccountLockedCoinsResponse = { }; } }; +GlobalDecoderRegistry.register(AccountLockedCoinsResponse.typeUrl, AccountLockedCoinsResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(AccountLockedCoinsResponse.aminoType, AccountLockedCoinsResponse.typeUrl); function createBaseAccountLockedPastTimeRequest(): AccountLockedPastTimeRequest { return { owner: "", - timestamp: undefined + timestamp: new Date() }; } export const AccountLockedPastTimeRequest = { typeUrl: "/osmosis.lockup.AccountLockedPastTimeRequest", + aminoType: "osmosis/lockup/account-locked-past-time-request", + is(o: any): o is AccountLockedPastTimeRequest { + return o && (o.$typeUrl === AccountLockedPastTimeRequest.typeUrl || typeof o.owner === "string" && Timestamp.is(o.timestamp)); + }, + isSDK(o: any): o is AccountLockedPastTimeRequestSDKType { + return o && (o.$typeUrl === AccountLockedPastTimeRequest.typeUrl || typeof o.owner === "string" && Timestamp.isSDK(o.timestamp)); + }, + isAmino(o: any): o is AccountLockedPastTimeRequestAmino { + return o && (o.$typeUrl === AccountLockedPastTimeRequest.typeUrl || typeof o.owner === "string" && Timestamp.isAmino(o.timestamp)); + }, encode(message: AccountLockedPastTimeRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.owner !== "") { writer.uint32(10).string(message.owner); @@ -1403,6 +1656,18 @@ export const AccountLockedPastTimeRequest = { } return message; }, + fromJSON(object: any): AccountLockedPastTimeRequest { + return { + owner: isSet(object.owner) ? String(object.owner) : "", + timestamp: isSet(object.timestamp) ? new Date(object.timestamp) : undefined + }; + }, + toJSON(message: AccountLockedPastTimeRequest): unknown { + const obj: any = {}; + message.owner !== undefined && (obj.owner = message.owner); + message.timestamp !== undefined && (obj.timestamp = message.timestamp.toISOString()); + return obj; + }, fromPartial(object: Partial): AccountLockedPastTimeRequest { const message = createBaseAccountLockedPastTimeRequest(); message.owner = object.owner ?? ""; @@ -1410,15 +1675,19 @@ export const AccountLockedPastTimeRequest = { return message; }, fromAmino(object: AccountLockedPastTimeRequestAmino): AccountLockedPastTimeRequest { - return { - owner: object.owner, - timestamp: object.timestamp - }; + const message = createBaseAccountLockedPastTimeRequest(); + if (object.owner !== undefined && object.owner !== null) { + message.owner = object.owner; + } + if (object.timestamp !== undefined && object.timestamp !== null) { + message.timestamp = fromTimestamp(Timestamp.fromAmino(object.timestamp)); + } + return message; }, toAmino(message: AccountLockedPastTimeRequest): AccountLockedPastTimeRequestAmino { const obj: any = {}; obj.owner = message.owner; - obj.timestamp = message.timestamp; + obj.timestamp = message.timestamp ? Timestamp.toAmino(toTimestamp(message.timestamp)) : undefined; return obj; }, fromAminoMsg(object: AccountLockedPastTimeRequestAminoMsg): AccountLockedPastTimeRequest { @@ -1443,6 +1712,8 @@ export const AccountLockedPastTimeRequest = { }; } }; +GlobalDecoderRegistry.register(AccountLockedPastTimeRequest.typeUrl, AccountLockedPastTimeRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(AccountLockedPastTimeRequest.aminoType, AccountLockedPastTimeRequest.typeUrl); function createBaseAccountLockedPastTimeResponse(): AccountLockedPastTimeResponse { return { locks: [] @@ -1450,6 +1721,16 @@ function createBaseAccountLockedPastTimeResponse(): AccountLockedPastTimeRespons } export const AccountLockedPastTimeResponse = { typeUrl: "/osmosis.lockup.AccountLockedPastTimeResponse", + aminoType: "osmosis/lockup/account-locked-past-time-response", + is(o: any): o is AccountLockedPastTimeResponse { + return o && (o.$typeUrl === AccountLockedPastTimeResponse.typeUrl || Array.isArray(o.locks) && (!o.locks.length || PeriodLock.is(o.locks[0]))); + }, + isSDK(o: any): o is AccountLockedPastTimeResponseSDKType { + return o && (o.$typeUrl === AccountLockedPastTimeResponse.typeUrl || Array.isArray(o.locks) && (!o.locks.length || PeriodLock.isSDK(o.locks[0]))); + }, + isAmino(o: any): o is AccountLockedPastTimeResponseAmino { + return o && (o.$typeUrl === AccountLockedPastTimeResponse.typeUrl || Array.isArray(o.locks) && (!o.locks.length || PeriodLock.isAmino(o.locks[0]))); + }, encode(message: AccountLockedPastTimeResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.locks) { PeriodLock.encode(v!, writer.uint32(10).fork()).ldelim(); @@ -1473,15 +1754,29 @@ export const AccountLockedPastTimeResponse = { } return message; }, + fromJSON(object: any): AccountLockedPastTimeResponse { + return { + locks: Array.isArray(object?.locks) ? object.locks.map((e: any) => PeriodLock.fromJSON(e)) : [] + }; + }, + toJSON(message: AccountLockedPastTimeResponse): unknown { + const obj: any = {}; + if (message.locks) { + obj.locks = message.locks.map(e => e ? PeriodLock.toJSON(e) : undefined); + } else { + obj.locks = []; + } + return obj; + }, fromPartial(object: Partial): AccountLockedPastTimeResponse { const message = createBaseAccountLockedPastTimeResponse(); message.locks = object.locks?.map(e => PeriodLock.fromPartial(e)) || []; return message; }, fromAmino(object: AccountLockedPastTimeResponseAmino): AccountLockedPastTimeResponse { - return { - locks: Array.isArray(object?.locks) ? object.locks.map((e: any) => PeriodLock.fromAmino(e)) : [] - }; + const message = createBaseAccountLockedPastTimeResponse(); + message.locks = object.locks?.map(e => PeriodLock.fromAmino(e)) || []; + return message; }, toAmino(message: AccountLockedPastTimeResponse): AccountLockedPastTimeResponseAmino { const obj: any = {}; @@ -1514,14 +1809,26 @@ export const AccountLockedPastTimeResponse = { }; } }; +GlobalDecoderRegistry.register(AccountLockedPastTimeResponse.typeUrl, AccountLockedPastTimeResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(AccountLockedPastTimeResponse.aminoType, AccountLockedPastTimeResponse.typeUrl); function createBaseAccountLockedPastTimeNotUnlockingOnlyRequest(): AccountLockedPastTimeNotUnlockingOnlyRequest { return { owner: "", - timestamp: undefined + timestamp: new Date() }; } export const AccountLockedPastTimeNotUnlockingOnlyRequest = { typeUrl: "/osmosis.lockup.AccountLockedPastTimeNotUnlockingOnlyRequest", + aminoType: "osmosis/lockup/account-locked-past-time-not-unlocking-only-request", + is(o: any): o is AccountLockedPastTimeNotUnlockingOnlyRequest { + return o && (o.$typeUrl === AccountLockedPastTimeNotUnlockingOnlyRequest.typeUrl || typeof o.owner === "string" && Timestamp.is(o.timestamp)); + }, + isSDK(o: any): o is AccountLockedPastTimeNotUnlockingOnlyRequestSDKType { + return o && (o.$typeUrl === AccountLockedPastTimeNotUnlockingOnlyRequest.typeUrl || typeof o.owner === "string" && Timestamp.isSDK(o.timestamp)); + }, + isAmino(o: any): o is AccountLockedPastTimeNotUnlockingOnlyRequestAmino { + return o && (o.$typeUrl === AccountLockedPastTimeNotUnlockingOnlyRequest.typeUrl || typeof o.owner === "string" && Timestamp.isAmino(o.timestamp)); + }, encode(message: AccountLockedPastTimeNotUnlockingOnlyRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.owner !== "") { writer.uint32(10).string(message.owner); @@ -1551,6 +1858,18 @@ export const AccountLockedPastTimeNotUnlockingOnlyRequest = { } return message; }, + fromJSON(object: any): AccountLockedPastTimeNotUnlockingOnlyRequest { + return { + owner: isSet(object.owner) ? String(object.owner) : "", + timestamp: isSet(object.timestamp) ? new Date(object.timestamp) : undefined + }; + }, + toJSON(message: AccountLockedPastTimeNotUnlockingOnlyRequest): unknown { + const obj: any = {}; + message.owner !== undefined && (obj.owner = message.owner); + message.timestamp !== undefined && (obj.timestamp = message.timestamp.toISOString()); + return obj; + }, fromPartial(object: Partial): AccountLockedPastTimeNotUnlockingOnlyRequest { const message = createBaseAccountLockedPastTimeNotUnlockingOnlyRequest(); message.owner = object.owner ?? ""; @@ -1558,15 +1877,19 @@ export const AccountLockedPastTimeNotUnlockingOnlyRequest = { return message; }, fromAmino(object: AccountLockedPastTimeNotUnlockingOnlyRequestAmino): AccountLockedPastTimeNotUnlockingOnlyRequest { - return { - owner: object.owner, - timestamp: object.timestamp - }; + const message = createBaseAccountLockedPastTimeNotUnlockingOnlyRequest(); + if (object.owner !== undefined && object.owner !== null) { + message.owner = object.owner; + } + if (object.timestamp !== undefined && object.timestamp !== null) { + message.timestamp = fromTimestamp(Timestamp.fromAmino(object.timestamp)); + } + return message; }, toAmino(message: AccountLockedPastTimeNotUnlockingOnlyRequest): AccountLockedPastTimeNotUnlockingOnlyRequestAmino { const obj: any = {}; obj.owner = message.owner; - obj.timestamp = message.timestamp; + obj.timestamp = message.timestamp ? Timestamp.toAmino(toTimestamp(message.timestamp)) : undefined; return obj; }, fromAminoMsg(object: AccountLockedPastTimeNotUnlockingOnlyRequestAminoMsg): AccountLockedPastTimeNotUnlockingOnlyRequest { @@ -1591,6 +1914,8 @@ export const AccountLockedPastTimeNotUnlockingOnlyRequest = { }; } }; +GlobalDecoderRegistry.register(AccountLockedPastTimeNotUnlockingOnlyRequest.typeUrl, AccountLockedPastTimeNotUnlockingOnlyRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(AccountLockedPastTimeNotUnlockingOnlyRequest.aminoType, AccountLockedPastTimeNotUnlockingOnlyRequest.typeUrl); function createBaseAccountLockedPastTimeNotUnlockingOnlyResponse(): AccountLockedPastTimeNotUnlockingOnlyResponse { return { locks: [] @@ -1598,6 +1923,16 @@ function createBaseAccountLockedPastTimeNotUnlockingOnlyResponse(): AccountLocke } export const AccountLockedPastTimeNotUnlockingOnlyResponse = { typeUrl: "/osmosis.lockup.AccountLockedPastTimeNotUnlockingOnlyResponse", + aminoType: "osmosis/lockup/account-locked-past-time-not-unlocking-only-response", + is(o: any): o is AccountLockedPastTimeNotUnlockingOnlyResponse { + return o && (o.$typeUrl === AccountLockedPastTimeNotUnlockingOnlyResponse.typeUrl || Array.isArray(o.locks) && (!o.locks.length || PeriodLock.is(o.locks[0]))); + }, + isSDK(o: any): o is AccountLockedPastTimeNotUnlockingOnlyResponseSDKType { + return o && (o.$typeUrl === AccountLockedPastTimeNotUnlockingOnlyResponse.typeUrl || Array.isArray(o.locks) && (!o.locks.length || PeriodLock.isSDK(o.locks[0]))); + }, + isAmino(o: any): o is AccountLockedPastTimeNotUnlockingOnlyResponseAmino { + return o && (o.$typeUrl === AccountLockedPastTimeNotUnlockingOnlyResponse.typeUrl || Array.isArray(o.locks) && (!o.locks.length || PeriodLock.isAmino(o.locks[0]))); + }, encode(message: AccountLockedPastTimeNotUnlockingOnlyResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.locks) { PeriodLock.encode(v!, writer.uint32(10).fork()).ldelim(); @@ -1621,15 +1956,29 @@ export const AccountLockedPastTimeNotUnlockingOnlyResponse = { } return message; }, + fromJSON(object: any): AccountLockedPastTimeNotUnlockingOnlyResponse { + return { + locks: Array.isArray(object?.locks) ? object.locks.map((e: any) => PeriodLock.fromJSON(e)) : [] + }; + }, + toJSON(message: AccountLockedPastTimeNotUnlockingOnlyResponse): unknown { + const obj: any = {}; + if (message.locks) { + obj.locks = message.locks.map(e => e ? PeriodLock.toJSON(e) : undefined); + } else { + obj.locks = []; + } + return obj; + }, fromPartial(object: Partial): AccountLockedPastTimeNotUnlockingOnlyResponse { const message = createBaseAccountLockedPastTimeNotUnlockingOnlyResponse(); message.locks = object.locks?.map(e => PeriodLock.fromPartial(e)) || []; return message; }, fromAmino(object: AccountLockedPastTimeNotUnlockingOnlyResponseAmino): AccountLockedPastTimeNotUnlockingOnlyResponse { - return { - locks: Array.isArray(object?.locks) ? object.locks.map((e: any) => PeriodLock.fromAmino(e)) : [] - }; + const message = createBaseAccountLockedPastTimeNotUnlockingOnlyResponse(); + message.locks = object.locks?.map(e => PeriodLock.fromAmino(e)) || []; + return message; }, toAmino(message: AccountLockedPastTimeNotUnlockingOnlyResponse): AccountLockedPastTimeNotUnlockingOnlyResponseAmino { const obj: any = {}; @@ -1662,14 +2011,26 @@ export const AccountLockedPastTimeNotUnlockingOnlyResponse = { }; } }; +GlobalDecoderRegistry.register(AccountLockedPastTimeNotUnlockingOnlyResponse.typeUrl, AccountLockedPastTimeNotUnlockingOnlyResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(AccountLockedPastTimeNotUnlockingOnlyResponse.aminoType, AccountLockedPastTimeNotUnlockingOnlyResponse.typeUrl); function createBaseAccountUnlockedBeforeTimeRequest(): AccountUnlockedBeforeTimeRequest { return { owner: "", - timestamp: undefined + timestamp: new Date() }; } export const AccountUnlockedBeforeTimeRequest = { typeUrl: "/osmosis.lockup.AccountUnlockedBeforeTimeRequest", + aminoType: "osmosis/lockup/account-unlocked-before-time-request", + is(o: any): o is AccountUnlockedBeforeTimeRequest { + return o && (o.$typeUrl === AccountUnlockedBeforeTimeRequest.typeUrl || typeof o.owner === "string" && Timestamp.is(o.timestamp)); + }, + isSDK(o: any): o is AccountUnlockedBeforeTimeRequestSDKType { + return o && (o.$typeUrl === AccountUnlockedBeforeTimeRequest.typeUrl || typeof o.owner === "string" && Timestamp.isSDK(o.timestamp)); + }, + isAmino(o: any): o is AccountUnlockedBeforeTimeRequestAmino { + return o && (o.$typeUrl === AccountUnlockedBeforeTimeRequest.typeUrl || typeof o.owner === "string" && Timestamp.isAmino(o.timestamp)); + }, encode(message: AccountUnlockedBeforeTimeRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.owner !== "") { writer.uint32(10).string(message.owner); @@ -1699,6 +2060,18 @@ export const AccountUnlockedBeforeTimeRequest = { } return message; }, + fromJSON(object: any): AccountUnlockedBeforeTimeRequest { + return { + owner: isSet(object.owner) ? String(object.owner) : "", + timestamp: isSet(object.timestamp) ? new Date(object.timestamp) : undefined + }; + }, + toJSON(message: AccountUnlockedBeforeTimeRequest): unknown { + const obj: any = {}; + message.owner !== undefined && (obj.owner = message.owner); + message.timestamp !== undefined && (obj.timestamp = message.timestamp.toISOString()); + return obj; + }, fromPartial(object: Partial): AccountUnlockedBeforeTimeRequest { const message = createBaseAccountUnlockedBeforeTimeRequest(); message.owner = object.owner ?? ""; @@ -1706,15 +2079,19 @@ export const AccountUnlockedBeforeTimeRequest = { return message; }, fromAmino(object: AccountUnlockedBeforeTimeRequestAmino): AccountUnlockedBeforeTimeRequest { - return { - owner: object.owner, - timestamp: object.timestamp - }; + const message = createBaseAccountUnlockedBeforeTimeRequest(); + if (object.owner !== undefined && object.owner !== null) { + message.owner = object.owner; + } + if (object.timestamp !== undefined && object.timestamp !== null) { + message.timestamp = fromTimestamp(Timestamp.fromAmino(object.timestamp)); + } + return message; }, toAmino(message: AccountUnlockedBeforeTimeRequest): AccountUnlockedBeforeTimeRequestAmino { const obj: any = {}; obj.owner = message.owner; - obj.timestamp = message.timestamp; + obj.timestamp = message.timestamp ? Timestamp.toAmino(toTimestamp(message.timestamp)) : undefined; return obj; }, fromAminoMsg(object: AccountUnlockedBeforeTimeRequestAminoMsg): AccountUnlockedBeforeTimeRequest { @@ -1739,6 +2116,8 @@ export const AccountUnlockedBeforeTimeRequest = { }; } }; +GlobalDecoderRegistry.register(AccountUnlockedBeforeTimeRequest.typeUrl, AccountUnlockedBeforeTimeRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(AccountUnlockedBeforeTimeRequest.aminoType, AccountUnlockedBeforeTimeRequest.typeUrl); function createBaseAccountUnlockedBeforeTimeResponse(): AccountUnlockedBeforeTimeResponse { return { locks: [] @@ -1746,6 +2125,16 @@ function createBaseAccountUnlockedBeforeTimeResponse(): AccountUnlockedBeforeTim } export const AccountUnlockedBeforeTimeResponse = { typeUrl: "/osmosis.lockup.AccountUnlockedBeforeTimeResponse", + aminoType: "osmosis/lockup/account-unlocked-before-time-response", + is(o: any): o is AccountUnlockedBeforeTimeResponse { + return o && (o.$typeUrl === AccountUnlockedBeforeTimeResponse.typeUrl || Array.isArray(o.locks) && (!o.locks.length || PeriodLock.is(o.locks[0]))); + }, + isSDK(o: any): o is AccountUnlockedBeforeTimeResponseSDKType { + return o && (o.$typeUrl === AccountUnlockedBeforeTimeResponse.typeUrl || Array.isArray(o.locks) && (!o.locks.length || PeriodLock.isSDK(o.locks[0]))); + }, + isAmino(o: any): o is AccountUnlockedBeforeTimeResponseAmino { + return o && (o.$typeUrl === AccountUnlockedBeforeTimeResponse.typeUrl || Array.isArray(o.locks) && (!o.locks.length || PeriodLock.isAmino(o.locks[0]))); + }, encode(message: AccountUnlockedBeforeTimeResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.locks) { PeriodLock.encode(v!, writer.uint32(10).fork()).ldelim(); @@ -1769,26 +2158,40 @@ export const AccountUnlockedBeforeTimeResponse = { } return message; }, - fromPartial(object: Partial): AccountUnlockedBeforeTimeResponse { - const message = createBaseAccountUnlockedBeforeTimeResponse(); - message.locks = object.locks?.map(e => PeriodLock.fromPartial(e)) || []; - return message; - }, - fromAmino(object: AccountUnlockedBeforeTimeResponseAmino): AccountUnlockedBeforeTimeResponse { + fromJSON(object: any): AccountUnlockedBeforeTimeResponse { return { - locks: Array.isArray(object?.locks) ? object.locks.map((e: any) => PeriodLock.fromAmino(e)) : [] + locks: Array.isArray(object?.locks) ? object.locks.map((e: any) => PeriodLock.fromJSON(e)) : [] }; }, - toAmino(message: AccountUnlockedBeforeTimeResponse): AccountUnlockedBeforeTimeResponseAmino { + toJSON(message: AccountUnlockedBeforeTimeResponse): unknown { const obj: any = {}; if (message.locks) { - obj.locks = message.locks.map(e => e ? PeriodLock.toAmino(e) : undefined); + obj.locks = message.locks.map(e => e ? PeriodLock.toJSON(e) : undefined); } else { obj.locks = []; } return obj; }, - fromAminoMsg(object: AccountUnlockedBeforeTimeResponseAminoMsg): AccountUnlockedBeforeTimeResponse { + fromPartial(object: Partial): AccountUnlockedBeforeTimeResponse { + const message = createBaseAccountUnlockedBeforeTimeResponse(); + message.locks = object.locks?.map(e => PeriodLock.fromPartial(e)) || []; + return message; + }, + fromAmino(object: AccountUnlockedBeforeTimeResponseAmino): AccountUnlockedBeforeTimeResponse { + const message = createBaseAccountUnlockedBeforeTimeResponse(); + message.locks = object.locks?.map(e => PeriodLock.fromAmino(e)) || []; + return message; + }, + toAmino(message: AccountUnlockedBeforeTimeResponse): AccountUnlockedBeforeTimeResponseAmino { + const obj: any = {}; + if (message.locks) { + obj.locks = message.locks.map(e => e ? PeriodLock.toAmino(e) : undefined); + } else { + obj.locks = []; + } + return obj; + }, + fromAminoMsg(object: AccountUnlockedBeforeTimeResponseAminoMsg): AccountUnlockedBeforeTimeResponse { return AccountUnlockedBeforeTimeResponse.fromAmino(object.value); }, toAminoMsg(message: AccountUnlockedBeforeTimeResponse): AccountUnlockedBeforeTimeResponseAminoMsg { @@ -1810,15 +2213,27 @@ export const AccountUnlockedBeforeTimeResponse = { }; } }; +GlobalDecoderRegistry.register(AccountUnlockedBeforeTimeResponse.typeUrl, AccountUnlockedBeforeTimeResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(AccountUnlockedBeforeTimeResponse.aminoType, AccountUnlockedBeforeTimeResponse.typeUrl); function createBaseAccountLockedPastTimeDenomRequest(): AccountLockedPastTimeDenomRequest { return { owner: "", - timestamp: undefined, + timestamp: new Date(), denom: "" }; } export const AccountLockedPastTimeDenomRequest = { typeUrl: "/osmosis.lockup.AccountLockedPastTimeDenomRequest", + aminoType: "osmosis/lockup/account-locked-past-time-denom-request", + is(o: any): o is AccountLockedPastTimeDenomRequest { + return o && (o.$typeUrl === AccountLockedPastTimeDenomRequest.typeUrl || typeof o.owner === "string" && Timestamp.is(o.timestamp) && typeof o.denom === "string"); + }, + isSDK(o: any): o is AccountLockedPastTimeDenomRequestSDKType { + return o && (o.$typeUrl === AccountLockedPastTimeDenomRequest.typeUrl || typeof o.owner === "string" && Timestamp.isSDK(o.timestamp) && typeof o.denom === "string"); + }, + isAmino(o: any): o is AccountLockedPastTimeDenomRequestAmino { + return o && (o.$typeUrl === AccountLockedPastTimeDenomRequest.typeUrl || typeof o.owner === "string" && Timestamp.isAmino(o.timestamp) && typeof o.denom === "string"); + }, encode(message: AccountLockedPastTimeDenomRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.owner !== "") { writer.uint32(10).string(message.owner); @@ -1854,6 +2269,20 @@ export const AccountLockedPastTimeDenomRequest = { } return message; }, + fromJSON(object: any): AccountLockedPastTimeDenomRequest { + return { + owner: isSet(object.owner) ? String(object.owner) : "", + timestamp: isSet(object.timestamp) ? new Date(object.timestamp) : undefined, + denom: isSet(object.denom) ? String(object.denom) : "" + }; + }, + toJSON(message: AccountLockedPastTimeDenomRequest): unknown { + const obj: any = {}; + message.owner !== undefined && (obj.owner = message.owner); + message.timestamp !== undefined && (obj.timestamp = message.timestamp.toISOString()); + message.denom !== undefined && (obj.denom = message.denom); + return obj; + }, fromPartial(object: Partial): AccountLockedPastTimeDenomRequest { const message = createBaseAccountLockedPastTimeDenomRequest(); message.owner = object.owner ?? ""; @@ -1862,16 +2291,22 @@ export const AccountLockedPastTimeDenomRequest = { return message; }, fromAmino(object: AccountLockedPastTimeDenomRequestAmino): AccountLockedPastTimeDenomRequest { - return { - owner: object.owner, - timestamp: object.timestamp, - denom: object.denom - }; + const message = createBaseAccountLockedPastTimeDenomRequest(); + if (object.owner !== undefined && object.owner !== null) { + message.owner = object.owner; + } + if (object.timestamp !== undefined && object.timestamp !== null) { + message.timestamp = fromTimestamp(Timestamp.fromAmino(object.timestamp)); + } + if (object.denom !== undefined && object.denom !== null) { + message.denom = object.denom; + } + return message; }, toAmino(message: AccountLockedPastTimeDenomRequest): AccountLockedPastTimeDenomRequestAmino { const obj: any = {}; obj.owner = message.owner; - obj.timestamp = message.timestamp; + obj.timestamp = message.timestamp ? Timestamp.toAmino(toTimestamp(message.timestamp)) : undefined; obj.denom = message.denom; return obj; }, @@ -1897,6 +2332,8 @@ export const AccountLockedPastTimeDenomRequest = { }; } }; +GlobalDecoderRegistry.register(AccountLockedPastTimeDenomRequest.typeUrl, AccountLockedPastTimeDenomRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(AccountLockedPastTimeDenomRequest.aminoType, AccountLockedPastTimeDenomRequest.typeUrl); function createBaseAccountLockedPastTimeDenomResponse(): AccountLockedPastTimeDenomResponse { return { locks: [] @@ -1904,6 +2341,16 @@ function createBaseAccountLockedPastTimeDenomResponse(): AccountLockedPastTimeDe } export const AccountLockedPastTimeDenomResponse = { typeUrl: "/osmosis.lockup.AccountLockedPastTimeDenomResponse", + aminoType: "osmosis/lockup/account-locked-past-time-denom-response", + is(o: any): o is AccountLockedPastTimeDenomResponse { + return o && (o.$typeUrl === AccountLockedPastTimeDenomResponse.typeUrl || Array.isArray(o.locks) && (!o.locks.length || PeriodLock.is(o.locks[0]))); + }, + isSDK(o: any): o is AccountLockedPastTimeDenomResponseSDKType { + return o && (o.$typeUrl === AccountLockedPastTimeDenomResponse.typeUrl || Array.isArray(o.locks) && (!o.locks.length || PeriodLock.isSDK(o.locks[0]))); + }, + isAmino(o: any): o is AccountLockedPastTimeDenomResponseAmino { + return o && (o.$typeUrl === AccountLockedPastTimeDenomResponse.typeUrl || Array.isArray(o.locks) && (!o.locks.length || PeriodLock.isAmino(o.locks[0]))); + }, encode(message: AccountLockedPastTimeDenomResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.locks) { PeriodLock.encode(v!, writer.uint32(10).fork()).ldelim(); @@ -1927,15 +2374,29 @@ export const AccountLockedPastTimeDenomResponse = { } return message; }, + fromJSON(object: any): AccountLockedPastTimeDenomResponse { + return { + locks: Array.isArray(object?.locks) ? object.locks.map((e: any) => PeriodLock.fromJSON(e)) : [] + }; + }, + toJSON(message: AccountLockedPastTimeDenomResponse): unknown { + const obj: any = {}; + if (message.locks) { + obj.locks = message.locks.map(e => e ? PeriodLock.toJSON(e) : undefined); + } else { + obj.locks = []; + } + return obj; + }, fromPartial(object: Partial): AccountLockedPastTimeDenomResponse { const message = createBaseAccountLockedPastTimeDenomResponse(); message.locks = object.locks?.map(e => PeriodLock.fromPartial(e)) || []; return message; }, fromAmino(object: AccountLockedPastTimeDenomResponseAmino): AccountLockedPastTimeDenomResponse { - return { - locks: Array.isArray(object?.locks) ? object.locks.map((e: any) => PeriodLock.fromAmino(e)) : [] - }; + const message = createBaseAccountLockedPastTimeDenomResponse(); + message.locks = object.locks?.map(e => PeriodLock.fromAmino(e)) || []; + return message; }, toAmino(message: AccountLockedPastTimeDenomResponse): AccountLockedPastTimeDenomResponseAmino { const obj: any = {}; @@ -1968,14 +2429,26 @@ export const AccountLockedPastTimeDenomResponse = { }; } }; +GlobalDecoderRegistry.register(AccountLockedPastTimeDenomResponse.typeUrl, AccountLockedPastTimeDenomResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(AccountLockedPastTimeDenomResponse.aminoType, AccountLockedPastTimeDenomResponse.typeUrl); function createBaseLockedDenomRequest(): LockedDenomRequest { return { denom: "", - duration: undefined + duration: Duration.fromPartial({}) }; } export const LockedDenomRequest = { typeUrl: "/osmosis.lockup.LockedDenomRequest", + aminoType: "osmosis/lockup/locked-denom-request", + is(o: any): o is LockedDenomRequest { + return o && (o.$typeUrl === LockedDenomRequest.typeUrl || typeof o.denom === "string" && Duration.is(o.duration)); + }, + isSDK(o: any): o is LockedDenomRequestSDKType { + return o && (o.$typeUrl === LockedDenomRequest.typeUrl || typeof o.denom === "string" && Duration.isSDK(o.duration)); + }, + isAmino(o: any): o is LockedDenomRequestAmino { + return o && (o.$typeUrl === LockedDenomRequest.typeUrl || typeof o.denom === "string" && Duration.isAmino(o.duration)); + }, encode(message: LockedDenomRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.denom !== "") { writer.uint32(10).string(message.denom); @@ -2005,6 +2478,18 @@ export const LockedDenomRequest = { } return message; }, + fromJSON(object: any): LockedDenomRequest { + return { + denom: isSet(object.denom) ? String(object.denom) : "", + duration: isSet(object.duration) ? Duration.fromJSON(object.duration) : undefined + }; + }, + toJSON(message: LockedDenomRequest): unknown { + const obj: any = {}; + message.denom !== undefined && (obj.denom = message.denom); + message.duration !== undefined && (obj.duration = message.duration ? Duration.toJSON(message.duration) : undefined); + return obj; + }, fromPartial(object: Partial): LockedDenomRequest { const message = createBaseLockedDenomRequest(); message.denom = object.denom ?? ""; @@ -2012,10 +2497,14 @@ export const LockedDenomRequest = { return message; }, fromAmino(object: LockedDenomRequestAmino): LockedDenomRequest { - return { - denom: object.denom, - duration: object?.duration ? Duration.fromAmino(object.duration) : undefined - }; + const message = createBaseLockedDenomRequest(); + if (object.denom !== undefined && object.denom !== null) { + message.denom = object.denom; + } + if (object.duration !== undefined && object.duration !== null) { + message.duration = Duration.fromAmino(object.duration); + } + return message; }, toAmino(message: LockedDenomRequest): LockedDenomRequestAmino { const obj: any = {}; @@ -2045,6 +2534,8 @@ export const LockedDenomRequest = { }; } }; +GlobalDecoderRegistry.register(LockedDenomRequest.typeUrl, LockedDenomRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(LockedDenomRequest.aminoType, LockedDenomRequest.typeUrl); function createBaseLockedDenomResponse(): LockedDenomResponse { return { amount: "" @@ -2052,6 +2543,16 @@ function createBaseLockedDenomResponse(): LockedDenomResponse { } export const LockedDenomResponse = { typeUrl: "/osmosis.lockup.LockedDenomResponse", + aminoType: "osmosis/lockup/locked-denom-response", + is(o: any): o is LockedDenomResponse { + return o && (o.$typeUrl === LockedDenomResponse.typeUrl || typeof o.amount === "string"); + }, + isSDK(o: any): o is LockedDenomResponseSDKType { + return o && (o.$typeUrl === LockedDenomResponse.typeUrl || typeof o.amount === "string"); + }, + isAmino(o: any): o is LockedDenomResponseAmino { + return o && (o.$typeUrl === LockedDenomResponse.typeUrl || typeof o.amount === "string"); + }, encode(message: LockedDenomResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.amount !== "") { writer.uint32(10).string(message.amount); @@ -2075,15 +2576,27 @@ export const LockedDenomResponse = { } return message; }, + fromJSON(object: any): LockedDenomResponse { + return { + amount: isSet(object.amount) ? String(object.amount) : "" + }; + }, + toJSON(message: LockedDenomResponse): unknown { + const obj: any = {}; + message.amount !== undefined && (obj.amount = message.amount); + return obj; + }, fromPartial(object: Partial): LockedDenomResponse { const message = createBaseLockedDenomResponse(); message.amount = object.amount ?? ""; return message; }, fromAmino(object: LockedDenomResponseAmino): LockedDenomResponse { - return { - amount: object.amount - }; + const message = createBaseLockedDenomResponse(); + if (object.amount !== undefined && object.amount !== null) { + message.amount = object.amount; + } + return message; }, toAmino(message: LockedDenomResponse): LockedDenomResponseAmino { const obj: any = {}; @@ -2112,6 +2625,8 @@ export const LockedDenomResponse = { }; } }; +GlobalDecoderRegistry.register(LockedDenomResponse.typeUrl, LockedDenomResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(LockedDenomResponse.aminoType, LockedDenomResponse.typeUrl); function createBaseLockedRequest(): LockedRequest { return { lockId: BigInt(0) @@ -2119,6 +2634,16 @@ function createBaseLockedRequest(): LockedRequest { } export const LockedRequest = { typeUrl: "/osmosis.lockup.LockedRequest", + aminoType: "osmosis/lockup/locked-request", + is(o: any): o is LockedRequest { + return o && (o.$typeUrl === LockedRequest.typeUrl || typeof o.lockId === "bigint"); + }, + isSDK(o: any): o is LockedRequestSDKType { + return o && (o.$typeUrl === LockedRequest.typeUrl || typeof o.lock_id === "bigint"); + }, + isAmino(o: any): o is LockedRequestAmino { + return o && (o.$typeUrl === LockedRequest.typeUrl || typeof o.lock_id === "bigint"); + }, encode(message: LockedRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.lockId !== BigInt(0)) { writer.uint32(8).uint64(message.lockId); @@ -2142,15 +2667,27 @@ export const LockedRequest = { } return message; }, + fromJSON(object: any): LockedRequest { + return { + lockId: isSet(object.lockId) ? BigInt(object.lockId.toString()) : BigInt(0) + }; + }, + toJSON(message: LockedRequest): unknown { + const obj: any = {}; + message.lockId !== undefined && (obj.lockId = (message.lockId || BigInt(0)).toString()); + return obj; + }, fromPartial(object: Partial): LockedRequest { const message = createBaseLockedRequest(); message.lockId = object.lockId !== undefined && object.lockId !== null ? BigInt(object.lockId.toString()) : BigInt(0); return message; }, fromAmino(object: LockedRequestAmino): LockedRequest { - return { - lockId: BigInt(object.lock_id) - }; + const message = createBaseLockedRequest(); + if (object.lock_id !== undefined && object.lock_id !== null) { + message.lockId = BigInt(object.lock_id); + } + return message; }, toAmino(message: LockedRequest): LockedRequestAmino { const obj: any = {}; @@ -2179,13 +2716,25 @@ export const LockedRequest = { }; } }; +GlobalDecoderRegistry.register(LockedRequest.typeUrl, LockedRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(LockedRequest.aminoType, LockedRequest.typeUrl); function createBaseLockedResponse(): LockedResponse { return { - lock: PeriodLock.fromPartial({}) + lock: undefined }; } export const LockedResponse = { typeUrl: "/osmosis.lockup.LockedResponse", + aminoType: "osmosis/lockup/locked-response", + is(o: any): o is LockedResponse { + return o && o.$typeUrl === LockedResponse.typeUrl; + }, + isSDK(o: any): o is LockedResponseSDKType { + return o && o.$typeUrl === LockedResponse.typeUrl; + }, + isAmino(o: any): o is LockedResponseAmino { + return o && o.$typeUrl === LockedResponse.typeUrl; + }, encode(message: LockedResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.lock !== undefined) { PeriodLock.encode(message.lock, writer.uint32(10).fork()).ldelim(); @@ -2209,15 +2758,27 @@ export const LockedResponse = { } return message; }, + fromJSON(object: any): LockedResponse { + return { + lock: isSet(object.lock) ? PeriodLock.fromJSON(object.lock) : undefined + }; + }, + toJSON(message: LockedResponse): unknown { + const obj: any = {}; + message.lock !== undefined && (obj.lock = message.lock ? PeriodLock.toJSON(message.lock) : undefined); + return obj; + }, fromPartial(object: Partial): LockedResponse { const message = createBaseLockedResponse(); message.lock = object.lock !== undefined && object.lock !== null ? PeriodLock.fromPartial(object.lock) : undefined; return message; }, fromAmino(object: LockedResponseAmino): LockedResponse { - return { - lock: object?.lock ? PeriodLock.fromAmino(object.lock) : undefined - }; + const message = createBaseLockedResponse(); + if (object.lock !== undefined && object.lock !== null) { + message.lock = PeriodLock.fromAmino(object.lock); + } + return message; }, toAmino(message: LockedResponse): LockedResponseAmino { const obj: any = {}; @@ -2246,6 +2807,8 @@ export const LockedResponse = { }; } }; +GlobalDecoderRegistry.register(LockedResponse.typeUrl, LockedResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(LockedResponse.aminoType, LockedResponse.typeUrl); function createBaseLockRewardReceiverRequest(): LockRewardReceiverRequest { return { lockId: BigInt(0) @@ -2253,6 +2816,16 @@ function createBaseLockRewardReceiverRequest(): LockRewardReceiverRequest { } export const LockRewardReceiverRequest = { typeUrl: "/osmosis.lockup.LockRewardReceiverRequest", + aminoType: "osmosis/lockup/lock-reward-receiver-request", + is(o: any): o is LockRewardReceiverRequest { + return o && (o.$typeUrl === LockRewardReceiverRequest.typeUrl || typeof o.lockId === "bigint"); + }, + isSDK(o: any): o is LockRewardReceiverRequestSDKType { + return o && (o.$typeUrl === LockRewardReceiverRequest.typeUrl || typeof o.lock_id === "bigint"); + }, + isAmino(o: any): o is LockRewardReceiverRequestAmino { + return o && (o.$typeUrl === LockRewardReceiverRequest.typeUrl || typeof o.lock_id === "bigint"); + }, encode(message: LockRewardReceiverRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.lockId !== BigInt(0)) { writer.uint32(8).uint64(message.lockId); @@ -2276,15 +2849,27 @@ export const LockRewardReceiverRequest = { } return message; }, + fromJSON(object: any): LockRewardReceiverRequest { + return { + lockId: isSet(object.lockId) ? BigInt(object.lockId.toString()) : BigInt(0) + }; + }, + toJSON(message: LockRewardReceiverRequest): unknown { + const obj: any = {}; + message.lockId !== undefined && (obj.lockId = (message.lockId || BigInt(0)).toString()); + return obj; + }, fromPartial(object: Partial): LockRewardReceiverRequest { const message = createBaseLockRewardReceiverRequest(); message.lockId = object.lockId !== undefined && object.lockId !== null ? BigInt(object.lockId.toString()) : BigInt(0); return message; }, fromAmino(object: LockRewardReceiverRequestAmino): LockRewardReceiverRequest { - return { - lockId: BigInt(object.lock_id) - }; + const message = createBaseLockRewardReceiverRequest(); + if (object.lock_id !== undefined && object.lock_id !== null) { + message.lockId = BigInt(object.lock_id); + } + return message; }, toAmino(message: LockRewardReceiverRequest): LockRewardReceiverRequestAmino { const obj: any = {}; @@ -2313,6 +2898,8 @@ export const LockRewardReceiverRequest = { }; } }; +GlobalDecoderRegistry.register(LockRewardReceiverRequest.typeUrl, LockRewardReceiverRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(LockRewardReceiverRequest.aminoType, LockRewardReceiverRequest.typeUrl); function createBaseLockRewardReceiverResponse(): LockRewardReceiverResponse { return { rewardReceiver: "" @@ -2320,6 +2907,16 @@ function createBaseLockRewardReceiverResponse(): LockRewardReceiverResponse { } export const LockRewardReceiverResponse = { typeUrl: "/osmosis.lockup.LockRewardReceiverResponse", + aminoType: "osmosis/lockup/lock-reward-receiver-response", + is(o: any): o is LockRewardReceiverResponse { + return o && (o.$typeUrl === LockRewardReceiverResponse.typeUrl || typeof o.rewardReceiver === "string"); + }, + isSDK(o: any): o is LockRewardReceiverResponseSDKType { + return o && (o.$typeUrl === LockRewardReceiverResponse.typeUrl || typeof o.reward_receiver === "string"); + }, + isAmino(o: any): o is LockRewardReceiverResponseAmino { + return o && (o.$typeUrl === LockRewardReceiverResponse.typeUrl || typeof o.reward_receiver === "string"); + }, encode(message: LockRewardReceiverResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.rewardReceiver !== "") { writer.uint32(10).string(message.rewardReceiver); @@ -2343,15 +2940,27 @@ export const LockRewardReceiverResponse = { } return message; }, + fromJSON(object: any): LockRewardReceiverResponse { + return { + rewardReceiver: isSet(object.rewardReceiver) ? String(object.rewardReceiver) : "" + }; + }, + toJSON(message: LockRewardReceiverResponse): unknown { + const obj: any = {}; + message.rewardReceiver !== undefined && (obj.rewardReceiver = message.rewardReceiver); + return obj; + }, fromPartial(object: Partial): LockRewardReceiverResponse { const message = createBaseLockRewardReceiverResponse(); message.rewardReceiver = object.rewardReceiver ?? ""; return message; }, fromAmino(object: LockRewardReceiverResponseAmino): LockRewardReceiverResponse { - return { - rewardReceiver: object.reward_receiver - }; + const message = createBaseLockRewardReceiverResponse(); + if (object.reward_receiver !== undefined && object.reward_receiver !== null) { + message.rewardReceiver = object.reward_receiver; + } + return message; }, toAmino(message: LockRewardReceiverResponse): LockRewardReceiverResponseAmino { const obj: any = {}; @@ -2380,11 +2989,23 @@ export const LockRewardReceiverResponse = { }; } }; +GlobalDecoderRegistry.register(LockRewardReceiverResponse.typeUrl, LockRewardReceiverResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(LockRewardReceiverResponse.aminoType, LockRewardReceiverResponse.typeUrl); function createBaseNextLockIDRequest(): NextLockIDRequest { return {}; } export const NextLockIDRequest = { typeUrl: "/osmosis.lockup.NextLockIDRequest", + aminoType: "osmosis/lockup/next-lock-id-request", + is(o: any): o is NextLockIDRequest { + return o && o.$typeUrl === NextLockIDRequest.typeUrl; + }, + isSDK(o: any): o is NextLockIDRequestSDKType { + return o && o.$typeUrl === NextLockIDRequest.typeUrl; + }, + isAmino(o: any): o is NextLockIDRequestAmino { + return o && o.$typeUrl === NextLockIDRequest.typeUrl; + }, encode(_: NextLockIDRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, @@ -2402,12 +3023,20 @@ export const NextLockIDRequest = { } return message; }, + fromJSON(_: any): NextLockIDRequest { + return {}; + }, + toJSON(_: NextLockIDRequest): unknown { + const obj: any = {}; + return obj; + }, fromPartial(_: Partial): NextLockIDRequest { const message = createBaseNextLockIDRequest(); return message; }, fromAmino(_: NextLockIDRequestAmino): NextLockIDRequest { - return {}; + const message = createBaseNextLockIDRequest(); + return message; }, toAmino(_: NextLockIDRequest): NextLockIDRequestAmino { const obj: any = {}; @@ -2435,6 +3064,8 @@ export const NextLockIDRequest = { }; } }; +GlobalDecoderRegistry.register(NextLockIDRequest.typeUrl, NextLockIDRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(NextLockIDRequest.aminoType, NextLockIDRequest.typeUrl); function createBaseNextLockIDResponse(): NextLockIDResponse { return { lockId: BigInt(0) @@ -2442,6 +3073,16 @@ function createBaseNextLockIDResponse(): NextLockIDResponse { } export const NextLockIDResponse = { typeUrl: "/osmosis.lockup.NextLockIDResponse", + aminoType: "osmosis/lockup/next-lock-id-response", + is(o: any): o is NextLockIDResponse { + return o && (o.$typeUrl === NextLockIDResponse.typeUrl || typeof o.lockId === "bigint"); + }, + isSDK(o: any): o is NextLockIDResponseSDKType { + return o && (o.$typeUrl === NextLockIDResponse.typeUrl || typeof o.lock_id === "bigint"); + }, + isAmino(o: any): o is NextLockIDResponseAmino { + return o && (o.$typeUrl === NextLockIDResponse.typeUrl || typeof o.lock_id === "bigint"); + }, encode(message: NextLockIDResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.lockId !== BigInt(0)) { writer.uint32(8).uint64(message.lockId); @@ -2465,15 +3106,27 @@ export const NextLockIDResponse = { } return message; }, + fromJSON(object: any): NextLockIDResponse { + return { + lockId: isSet(object.lockId) ? BigInt(object.lockId.toString()) : BigInt(0) + }; + }, + toJSON(message: NextLockIDResponse): unknown { + const obj: any = {}; + message.lockId !== undefined && (obj.lockId = (message.lockId || BigInt(0)).toString()); + return obj; + }, fromPartial(object: Partial): NextLockIDResponse { const message = createBaseNextLockIDResponse(); message.lockId = object.lockId !== undefined && object.lockId !== null ? BigInt(object.lockId.toString()) : BigInt(0); return message; }, fromAmino(object: NextLockIDResponseAmino): NextLockIDResponse { - return { - lockId: BigInt(object.lock_id) - }; + const message = createBaseNextLockIDResponse(); + if (object.lock_id !== undefined && object.lock_id !== null) { + message.lockId = BigInt(object.lock_id); + } + return message; }, toAmino(message: NextLockIDResponse): NextLockIDResponseAmino { const obj: any = {}; @@ -2502,6 +3155,8 @@ export const NextLockIDResponse = { }; } }; +GlobalDecoderRegistry.register(NextLockIDResponse.typeUrl, NextLockIDResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(NextLockIDResponse.aminoType, NextLockIDResponse.typeUrl); function createBaseSyntheticLockupsByLockupIDRequest(): SyntheticLockupsByLockupIDRequest { return { lockId: BigInt(0) @@ -2509,6 +3164,16 @@ function createBaseSyntheticLockupsByLockupIDRequest(): SyntheticLockupsByLockup } export const SyntheticLockupsByLockupIDRequest = { typeUrl: "/osmosis.lockup.SyntheticLockupsByLockupIDRequest", + aminoType: "osmosis/lockup/synthetic-lockups-by-lockup-id-request", + is(o: any): o is SyntheticLockupsByLockupIDRequest { + return o && (o.$typeUrl === SyntheticLockupsByLockupIDRequest.typeUrl || typeof o.lockId === "bigint"); + }, + isSDK(o: any): o is SyntheticLockupsByLockupIDRequestSDKType { + return o && (o.$typeUrl === SyntheticLockupsByLockupIDRequest.typeUrl || typeof o.lock_id === "bigint"); + }, + isAmino(o: any): o is SyntheticLockupsByLockupIDRequestAmino { + return o && (o.$typeUrl === SyntheticLockupsByLockupIDRequest.typeUrl || typeof o.lock_id === "bigint"); + }, encode(message: SyntheticLockupsByLockupIDRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.lockId !== BigInt(0)) { writer.uint32(8).uint64(message.lockId); @@ -2532,15 +3197,27 @@ export const SyntheticLockupsByLockupIDRequest = { } return message; }, + fromJSON(object: any): SyntheticLockupsByLockupIDRequest { + return { + lockId: isSet(object.lockId) ? BigInt(object.lockId.toString()) : BigInt(0) + }; + }, + toJSON(message: SyntheticLockupsByLockupIDRequest): unknown { + const obj: any = {}; + message.lockId !== undefined && (obj.lockId = (message.lockId || BigInt(0)).toString()); + return obj; + }, fromPartial(object: Partial): SyntheticLockupsByLockupIDRequest { const message = createBaseSyntheticLockupsByLockupIDRequest(); message.lockId = object.lockId !== undefined && object.lockId !== null ? BigInt(object.lockId.toString()) : BigInt(0); return message; }, fromAmino(object: SyntheticLockupsByLockupIDRequestAmino): SyntheticLockupsByLockupIDRequest { - return { - lockId: BigInt(object.lock_id) - }; + const message = createBaseSyntheticLockupsByLockupIDRequest(); + if (object.lock_id !== undefined && object.lock_id !== null) { + message.lockId = BigInt(object.lock_id); + } + return message; }, toAmino(message: SyntheticLockupsByLockupIDRequest): SyntheticLockupsByLockupIDRequestAmino { const obj: any = {}; @@ -2569,6 +3246,8 @@ export const SyntheticLockupsByLockupIDRequest = { }; } }; +GlobalDecoderRegistry.register(SyntheticLockupsByLockupIDRequest.typeUrl, SyntheticLockupsByLockupIDRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(SyntheticLockupsByLockupIDRequest.aminoType, SyntheticLockupsByLockupIDRequest.typeUrl); function createBaseSyntheticLockupsByLockupIDResponse(): SyntheticLockupsByLockupIDResponse { return { syntheticLocks: [] @@ -2576,6 +3255,16 @@ function createBaseSyntheticLockupsByLockupIDResponse(): SyntheticLockupsByLocku } export const SyntheticLockupsByLockupIDResponse = { typeUrl: "/osmosis.lockup.SyntheticLockupsByLockupIDResponse", + aminoType: "osmosis/lockup/synthetic-lockups-by-lockup-id-response", + is(o: any): o is SyntheticLockupsByLockupIDResponse { + return o && (o.$typeUrl === SyntheticLockupsByLockupIDResponse.typeUrl || Array.isArray(o.syntheticLocks) && (!o.syntheticLocks.length || SyntheticLock.is(o.syntheticLocks[0]))); + }, + isSDK(o: any): o is SyntheticLockupsByLockupIDResponseSDKType { + return o && (o.$typeUrl === SyntheticLockupsByLockupIDResponse.typeUrl || Array.isArray(o.synthetic_locks) && (!o.synthetic_locks.length || SyntheticLock.isSDK(o.synthetic_locks[0]))); + }, + isAmino(o: any): o is SyntheticLockupsByLockupIDResponseAmino { + return o && (o.$typeUrl === SyntheticLockupsByLockupIDResponse.typeUrl || Array.isArray(o.synthetic_locks) && (!o.synthetic_locks.length || SyntheticLock.isAmino(o.synthetic_locks[0]))); + }, encode(message: SyntheticLockupsByLockupIDResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.syntheticLocks) { SyntheticLock.encode(v!, writer.uint32(10).fork()).ldelim(); @@ -2599,15 +3288,29 @@ export const SyntheticLockupsByLockupIDResponse = { } return message; }, + fromJSON(object: any): SyntheticLockupsByLockupIDResponse { + return { + syntheticLocks: Array.isArray(object?.syntheticLocks) ? object.syntheticLocks.map((e: any) => SyntheticLock.fromJSON(e)) : [] + }; + }, + toJSON(message: SyntheticLockupsByLockupIDResponse): unknown { + const obj: any = {}; + if (message.syntheticLocks) { + obj.syntheticLocks = message.syntheticLocks.map(e => e ? SyntheticLock.toJSON(e) : undefined); + } else { + obj.syntheticLocks = []; + } + return obj; + }, fromPartial(object: Partial): SyntheticLockupsByLockupIDResponse { const message = createBaseSyntheticLockupsByLockupIDResponse(); message.syntheticLocks = object.syntheticLocks?.map(e => SyntheticLock.fromPartial(e)) || []; return message; }, fromAmino(object: SyntheticLockupsByLockupIDResponseAmino): SyntheticLockupsByLockupIDResponse { - return { - syntheticLocks: Array.isArray(object?.synthetic_locks) ? object.synthetic_locks.map((e: any) => SyntheticLock.fromAmino(e)) : [] - }; + const message = createBaseSyntheticLockupsByLockupIDResponse(); + message.syntheticLocks = object.synthetic_locks?.map(e => SyntheticLock.fromAmino(e)) || []; + return message; }, toAmino(message: SyntheticLockupsByLockupIDResponse): SyntheticLockupsByLockupIDResponseAmino { const obj: any = {}; @@ -2640,6 +3343,8 @@ export const SyntheticLockupsByLockupIDResponse = { }; } }; +GlobalDecoderRegistry.register(SyntheticLockupsByLockupIDResponse.typeUrl, SyntheticLockupsByLockupIDResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(SyntheticLockupsByLockupIDResponse.aminoType, SyntheticLockupsByLockupIDResponse.typeUrl); function createBaseSyntheticLockupByLockupIDRequest(): SyntheticLockupByLockupIDRequest { return { lockId: BigInt(0) @@ -2647,6 +3352,16 @@ function createBaseSyntheticLockupByLockupIDRequest(): SyntheticLockupByLockupID } export const SyntheticLockupByLockupIDRequest = { typeUrl: "/osmosis.lockup.SyntheticLockupByLockupIDRequest", + aminoType: "osmosis/lockup/synthetic-lockup-by-lockup-id-request", + is(o: any): o is SyntheticLockupByLockupIDRequest { + return o && (o.$typeUrl === SyntheticLockupByLockupIDRequest.typeUrl || typeof o.lockId === "bigint"); + }, + isSDK(o: any): o is SyntheticLockupByLockupIDRequestSDKType { + return o && (o.$typeUrl === SyntheticLockupByLockupIDRequest.typeUrl || typeof o.lock_id === "bigint"); + }, + isAmino(o: any): o is SyntheticLockupByLockupIDRequestAmino { + return o && (o.$typeUrl === SyntheticLockupByLockupIDRequest.typeUrl || typeof o.lock_id === "bigint"); + }, encode(message: SyntheticLockupByLockupIDRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.lockId !== BigInt(0)) { writer.uint32(8).uint64(message.lockId); @@ -2670,15 +3385,27 @@ export const SyntheticLockupByLockupIDRequest = { } return message; }, + fromJSON(object: any): SyntheticLockupByLockupIDRequest { + return { + lockId: isSet(object.lockId) ? BigInt(object.lockId.toString()) : BigInt(0) + }; + }, + toJSON(message: SyntheticLockupByLockupIDRequest): unknown { + const obj: any = {}; + message.lockId !== undefined && (obj.lockId = (message.lockId || BigInt(0)).toString()); + return obj; + }, fromPartial(object: Partial): SyntheticLockupByLockupIDRequest { const message = createBaseSyntheticLockupByLockupIDRequest(); message.lockId = object.lockId !== undefined && object.lockId !== null ? BigInt(object.lockId.toString()) : BigInt(0); return message; }, fromAmino(object: SyntheticLockupByLockupIDRequestAmino): SyntheticLockupByLockupIDRequest { - return { - lockId: BigInt(object.lock_id) - }; + const message = createBaseSyntheticLockupByLockupIDRequest(); + if (object.lock_id !== undefined && object.lock_id !== null) { + message.lockId = BigInt(object.lock_id); + } + return message; }, toAmino(message: SyntheticLockupByLockupIDRequest): SyntheticLockupByLockupIDRequestAmino { const obj: any = {}; @@ -2707,6 +3434,8 @@ export const SyntheticLockupByLockupIDRequest = { }; } }; +GlobalDecoderRegistry.register(SyntheticLockupByLockupIDRequest.typeUrl, SyntheticLockupByLockupIDRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(SyntheticLockupByLockupIDRequest.aminoType, SyntheticLockupByLockupIDRequest.typeUrl); function createBaseSyntheticLockupByLockupIDResponse(): SyntheticLockupByLockupIDResponse { return { syntheticLock: SyntheticLock.fromPartial({}) @@ -2714,6 +3443,16 @@ function createBaseSyntheticLockupByLockupIDResponse(): SyntheticLockupByLockupI } export const SyntheticLockupByLockupIDResponse = { typeUrl: "/osmosis.lockup.SyntheticLockupByLockupIDResponse", + aminoType: "osmosis/lockup/synthetic-lockup-by-lockup-id-response", + is(o: any): o is SyntheticLockupByLockupIDResponse { + return o && (o.$typeUrl === SyntheticLockupByLockupIDResponse.typeUrl || SyntheticLock.is(o.syntheticLock)); + }, + isSDK(o: any): o is SyntheticLockupByLockupIDResponseSDKType { + return o && (o.$typeUrl === SyntheticLockupByLockupIDResponse.typeUrl || SyntheticLock.isSDK(o.synthetic_lock)); + }, + isAmino(o: any): o is SyntheticLockupByLockupIDResponseAmino { + return o && (o.$typeUrl === SyntheticLockupByLockupIDResponse.typeUrl || SyntheticLock.isAmino(o.synthetic_lock)); + }, encode(message: SyntheticLockupByLockupIDResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.syntheticLock !== undefined) { SyntheticLock.encode(message.syntheticLock, writer.uint32(10).fork()).ldelim(); @@ -2737,15 +3476,27 @@ export const SyntheticLockupByLockupIDResponse = { } return message; }, + fromJSON(object: any): SyntheticLockupByLockupIDResponse { + return { + syntheticLock: isSet(object.syntheticLock) ? SyntheticLock.fromJSON(object.syntheticLock) : undefined + }; + }, + toJSON(message: SyntheticLockupByLockupIDResponse): unknown { + const obj: any = {}; + message.syntheticLock !== undefined && (obj.syntheticLock = message.syntheticLock ? SyntheticLock.toJSON(message.syntheticLock) : undefined); + return obj; + }, fromPartial(object: Partial): SyntheticLockupByLockupIDResponse { const message = createBaseSyntheticLockupByLockupIDResponse(); message.syntheticLock = object.syntheticLock !== undefined && object.syntheticLock !== null ? SyntheticLock.fromPartial(object.syntheticLock) : undefined; return message; }, fromAmino(object: SyntheticLockupByLockupIDResponseAmino): SyntheticLockupByLockupIDResponse { - return { - syntheticLock: object?.synthetic_lock ? SyntheticLock.fromAmino(object.synthetic_lock) : undefined - }; + const message = createBaseSyntheticLockupByLockupIDResponse(); + if (object.synthetic_lock !== undefined && object.synthetic_lock !== null) { + message.syntheticLock = SyntheticLock.fromAmino(object.synthetic_lock); + } + return message; }, toAmino(message: SyntheticLockupByLockupIDResponse): SyntheticLockupByLockupIDResponseAmino { const obj: any = {}; @@ -2774,14 +3525,26 @@ export const SyntheticLockupByLockupIDResponse = { }; } }; +GlobalDecoderRegistry.register(SyntheticLockupByLockupIDResponse.typeUrl, SyntheticLockupByLockupIDResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(SyntheticLockupByLockupIDResponse.aminoType, SyntheticLockupByLockupIDResponse.typeUrl); function createBaseAccountLockedLongerDurationRequest(): AccountLockedLongerDurationRequest { return { owner: "", - duration: undefined + duration: Duration.fromPartial({}) }; } export const AccountLockedLongerDurationRequest = { typeUrl: "/osmosis.lockup.AccountLockedLongerDurationRequest", + aminoType: "osmosis/lockup/account-locked-longer-duration-request", + is(o: any): o is AccountLockedLongerDurationRequest { + return o && (o.$typeUrl === AccountLockedLongerDurationRequest.typeUrl || typeof o.owner === "string" && Duration.is(o.duration)); + }, + isSDK(o: any): o is AccountLockedLongerDurationRequestSDKType { + return o && (o.$typeUrl === AccountLockedLongerDurationRequest.typeUrl || typeof o.owner === "string" && Duration.isSDK(o.duration)); + }, + isAmino(o: any): o is AccountLockedLongerDurationRequestAmino { + return o && (o.$typeUrl === AccountLockedLongerDurationRequest.typeUrl || typeof o.owner === "string" && Duration.isAmino(o.duration)); + }, encode(message: AccountLockedLongerDurationRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.owner !== "") { writer.uint32(10).string(message.owner); @@ -2811,6 +3574,18 @@ export const AccountLockedLongerDurationRequest = { } return message; }, + fromJSON(object: any): AccountLockedLongerDurationRequest { + return { + owner: isSet(object.owner) ? String(object.owner) : "", + duration: isSet(object.duration) ? Duration.fromJSON(object.duration) : undefined + }; + }, + toJSON(message: AccountLockedLongerDurationRequest): unknown { + const obj: any = {}; + message.owner !== undefined && (obj.owner = message.owner); + message.duration !== undefined && (obj.duration = message.duration ? Duration.toJSON(message.duration) : undefined); + return obj; + }, fromPartial(object: Partial): AccountLockedLongerDurationRequest { const message = createBaseAccountLockedLongerDurationRequest(); message.owner = object.owner ?? ""; @@ -2818,10 +3593,14 @@ export const AccountLockedLongerDurationRequest = { return message; }, fromAmino(object: AccountLockedLongerDurationRequestAmino): AccountLockedLongerDurationRequest { - return { - owner: object.owner, - duration: object?.duration ? Duration.fromAmino(object.duration) : undefined - }; + const message = createBaseAccountLockedLongerDurationRequest(); + if (object.owner !== undefined && object.owner !== null) { + message.owner = object.owner; + } + if (object.duration !== undefined && object.duration !== null) { + message.duration = Duration.fromAmino(object.duration); + } + return message; }, toAmino(message: AccountLockedLongerDurationRequest): AccountLockedLongerDurationRequestAmino { const obj: any = {}; @@ -2851,6 +3630,8 @@ export const AccountLockedLongerDurationRequest = { }; } }; +GlobalDecoderRegistry.register(AccountLockedLongerDurationRequest.typeUrl, AccountLockedLongerDurationRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(AccountLockedLongerDurationRequest.aminoType, AccountLockedLongerDurationRequest.typeUrl); function createBaseAccountLockedLongerDurationResponse(): AccountLockedLongerDurationResponse { return { locks: [] @@ -2858,6 +3639,16 @@ function createBaseAccountLockedLongerDurationResponse(): AccountLockedLongerDur } export const AccountLockedLongerDurationResponse = { typeUrl: "/osmosis.lockup.AccountLockedLongerDurationResponse", + aminoType: "osmosis/lockup/account-locked-longer-duration-response", + is(o: any): o is AccountLockedLongerDurationResponse { + return o && (o.$typeUrl === AccountLockedLongerDurationResponse.typeUrl || Array.isArray(o.locks) && (!o.locks.length || PeriodLock.is(o.locks[0]))); + }, + isSDK(o: any): o is AccountLockedLongerDurationResponseSDKType { + return o && (o.$typeUrl === AccountLockedLongerDurationResponse.typeUrl || Array.isArray(o.locks) && (!o.locks.length || PeriodLock.isSDK(o.locks[0]))); + }, + isAmino(o: any): o is AccountLockedLongerDurationResponseAmino { + return o && (o.$typeUrl === AccountLockedLongerDurationResponse.typeUrl || Array.isArray(o.locks) && (!o.locks.length || PeriodLock.isAmino(o.locks[0]))); + }, encode(message: AccountLockedLongerDurationResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.locks) { PeriodLock.encode(v!, writer.uint32(10).fork()).ldelim(); @@ -2881,15 +3672,29 @@ export const AccountLockedLongerDurationResponse = { } return message; }, + fromJSON(object: any): AccountLockedLongerDurationResponse { + return { + locks: Array.isArray(object?.locks) ? object.locks.map((e: any) => PeriodLock.fromJSON(e)) : [] + }; + }, + toJSON(message: AccountLockedLongerDurationResponse): unknown { + const obj: any = {}; + if (message.locks) { + obj.locks = message.locks.map(e => e ? PeriodLock.toJSON(e) : undefined); + } else { + obj.locks = []; + } + return obj; + }, fromPartial(object: Partial): AccountLockedLongerDurationResponse { const message = createBaseAccountLockedLongerDurationResponse(); message.locks = object.locks?.map(e => PeriodLock.fromPartial(e)) || []; return message; }, fromAmino(object: AccountLockedLongerDurationResponseAmino): AccountLockedLongerDurationResponse { - return { - locks: Array.isArray(object?.locks) ? object.locks.map((e: any) => PeriodLock.fromAmino(e)) : [] - }; + const message = createBaseAccountLockedLongerDurationResponse(); + message.locks = object.locks?.map(e => PeriodLock.fromAmino(e)) || []; + return message; }, toAmino(message: AccountLockedLongerDurationResponse): AccountLockedLongerDurationResponseAmino { const obj: any = {}; @@ -2922,14 +3727,26 @@ export const AccountLockedLongerDurationResponse = { }; } }; +GlobalDecoderRegistry.register(AccountLockedLongerDurationResponse.typeUrl, AccountLockedLongerDurationResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(AccountLockedLongerDurationResponse.aminoType, AccountLockedLongerDurationResponse.typeUrl); function createBaseAccountLockedDurationRequest(): AccountLockedDurationRequest { return { owner: "", - duration: undefined + duration: Duration.fromPartial({}) }; } export const AccountLockedDurationRequest = { typeUrl: "/osmosis.lockup.AccountLockedDurationRequest", + aminoType: "osmosis/lockup/account-locked-duration-request", + is(o: any): o is AccountLockedDurationRequest { + return o && (o.$typeUrl === AccountLockedDurationRequest.typeUrl || typeof o.owner === "string" && Duration.is(o.duration)); + }, + isSDK(o: any): o is AccountLockedDurationRequestSDKType { + return o && (o.$typeUrl === AccountLockedDurationRequest.typeUrl || typeof o.owner === "string" && Duration.isSDK(o.duration)); + }, + isAmino(o: any): o is AccountLockedDurationRequestAmino { + return o && (o.$typeUrl === AccountLockedDurationRequest.typeUrl || typeof o.owner === "string" && Duration.isAmino(o.duration)); + }, encode(message: AccountLockedDurationRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.owner !== "") { writer.uint32(10).string(message.owner); @@ -2959,6 +3776,18 @@ export const AccountLockedDurationRequest = { } return message; }, + fromJSON(object: any): AccountLockedDurationRequest { + return { + owner: isSet(object.owner) ? String(object.owner) : "", + duration: isSet(object.duration) ? Duration.fromJSON(object.duration) : undefined + }; + }, + toJSON(message: AccountLockedDurationRequest): unknown { + const obj: any = {}; + message.owner !== undefined && (obj.owner = message.owner); + message.duration !== undefined && (obj.duration = message.duration ? Duration.toJSON(message.duration) : undefined); + return obj; + }, fromPartial(object: Partial): AccountLockedDurationRequest { const message = createBaseAccountLockedDurationRequest(); message.owner = object.owner ?? ""; @@ -2966,10 +3795,14 @@ export const AccountLockedDurationRequest = { return message; }, fromAmino(object: AccountLockedDurationRequestAmino): AccountLockedDurationRequest { - return { - owner: object.owner, - duration: object?.duration ? Duration.fromAmino(object.duration) : undefined - }; + const message = createBaseAccountLockedDurationRequest(); + if (object.owner !== undefined && object.owner !== null) { + message.owner = object.owner; + } + if (object.duration !== undefined && object.duration !== null) { + message.duration = Duration.fromAmino(object.duration); + } + return message; }, toAmino(message: AccountLockedDurationRequest): AccountLockedDurationRequestAmino { const obj: any = {}; @@ -2999,6 +3832,8 @@ export const AccountLockedDurationRequest = { }; } }; +GlobalDecoderRegistry.register(AccountLockedDurationRequest.typeUrl, AccountLockedDurationRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(AccountLockedDurationRequest.aminoType, AccountLockedDurationRequest.typeUrl); function createBaseAccountLockedDurationResponse(): AccountLockedDurationResponse { return { locks: [] @@ -3006,6 +3841,16 @@ function createBaseAccountLockedDurationResponse(): AccountLockedDurationRespons } export const AccountLockedDurationResponse = { typeUrl: "/osmosis.lockup.AccountLockedDurationResponse", + aminoType: "osmosis/lockup/account-locked-duration-response", + is(o: any): o is AccountLockedDurationResponse { + return o && (o.$typeUrl === AccountLockedDurationResponse.typeUrl || Array.isArray(o.locks) && (!o.locks.length || PeriodLock.is(o.locks[0]))); + }, + isSDK(o: any): o is AccountLockedDurationResponseSDKType { + return o && (o.$typeUrl === AccountLockedDurationResponse.typeUrl || Array.isArray(o.locks) && (!o.locks.length || PeriodLock.isSDK(o.locks[0]))); + }, + isAmino(o: any): o is AccountLockedDurationResponseAmino { + return o && (o.$typeUrl === AccountLockedDurationResponse.typeUrl || Array.isArray(o.locks) && (!o.locks.length || PeriodLock.isAmino(o.locks[0]))); + }, encode(message: AccountLockedDurationResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.locks) { PeriodLock.encode(v!, writer.uint32(10).fork()).ldelim(); @@ -3029,15 +3874,29 @@ export const AccountLockedDurationResponse = { } return message; }, + fromJSON(object: any): AccountLockedDurationResponse { + return { + locks: Array.isArray(object?.locks) ? object.locks.map((e: any) => PeriodLock.fromJSON(e)) : [] + }; + }, + toJSON(message: AccountLockedDurationResponse): unknown { + const obj: any = {}; + if (message.locks) { + obj.locks = message.locks.map(e => e ? PeriodLock.toJSON(e) : undefined); + } else { + obj.locks = []; + } + return obj; + }, fromPartial(object: Partial): AccountLockedDurationResponse { const message = createBaseAccountLockedDurationResponse(); message.locks = object.locks?.map(e => PeriodLock.fromPartial(e)) || []; return message; }, fromAmino(object: AccountLockedDurationResponseAmino): AccountLockedDurationResponse { - return { - locks: Array.isArray(object?.locks) ? object.locks.map((e: any) => PeriodLock.fromAmino(e)) : [] - }; + const message = createBaseAccountLockedDurationResponse(); + message.locks = object.locks?.map(e => PeriodLock.fromAmino(e)) || []; + return message; }, toAmino(message: AccountLockedDurationResponse): AccountLockedDurationResponseAmino { const obj: any = {}; @@ -3070,14 +3929,26 @@ export const AccountLockedDurationResponse = { }; } }; +GlobalDecoderRegistry.register(AccountLockedDurationResponse.typeUrl, AccountLockedDurationResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(AccountLockedDurationResponse.aminoType, AccountLockedDurationResponse.typeUrl); function createBaseAccountLockedLongerDurationNotUnlockingOnlyRequest(): AccountLockedLongerDurationNotUnlockingOnlyRequest { return { owner: "", - duration: undefined + duration: Duration.fromPartial({}) }; } export const AccountLockedLongerDurationNotUnlockingOnlyRequest = { typeUrl: "/osmosis.lockup.AccountLockedLongerDurationNotUnlockingOnlyRequest", + aminoType: "osmosis/lockup/account-locked-longer-duration-not-unlocking-only-request", + is(o: any): o is AccountLockedLongerDurationNotUnlockingOnlyRequest { + return o && (o.$typeUrl === AccountLockedLongerDurationNotUnlockingOnlyRequest.typeUrl || typeof o.owner === "string" && Duration.is(o.duration)); + }, + isSDK(o: any): o is AccountLockedLongerDurationNotUnlockingOnlyRequestSDKType { + return o && (o.$typeUrl === AccountLockedLongerDurationNotUnlockingOnlyRequest.typeUrl || typeof o.owner === "string" && Duration.isSDK(o.duration)); + }, + isAmino(o: any): o is AccountLockedLongerDurationNotUnlockingOnlyRequestAmino { + return o && (o.$typeUrl === AccountLockedLongerDurationNotUnlockingOnlyRequest.typeUrl || typeof o.owner === "string" && Duration.isAmino(o.duration)); + }, encode(message: AccountLockedLongerDurationNotUnlockingOnlyRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.owner !== "") { writer.uint32(10).string(message.owner); @@ -3107,6 +3978,18 @@ export const AccountLockedLongerDurationNotUnlockingOnlyRequest = { } return message; }, + fromJSON(object: any): AccountLockedLongerDurationNotUnlockingOnlyRequest { + return { + owner: isSet(object.owner) ? String(object.owner) : "", + duration: isSet(object.duration) ? Duration.fromJSON(object.duration) : undefined + }; + }, + toJSON(message: AccountLockedLongerDurationNotUnlockingOnlyRequest): unknown { + const obj: any = {}; + message.owner !== undefined && (obj.owner = message.owner); + message.duration !== undefined && (obj.duration = message.duration ? Duration.toJSON(message.duration) : undefined); + return obj; + }, fromPartial(object: Partial): AccountLockedLongerDurationNotUnlockingOnlyRequest { const message = createBaseAccountLockedLongerDurationNotUnlockingOnlyRequest(); message.owner = object.owner ?? ""; @@ -3114,10 +3997,14 @@ export const AccountLockedLongerDurationNotUnlockingOnlyRequest = { return message; }, fromAmino(object: AccountLockedLongerDurationNotUnlockingOnlyRequestAmino): AccountLockedLongerDurationNotUnlockingOnlyRequest { - return { - owner: object.owner, - duration: object?.duration ? Duration.fromAmino(object.duration) : undefined - }; + const message = createBaseAccountLockedLongerDurationNotUnlockingOnlyRequest(); + if (object.owner !== undefined && object.owner !== null) { + message.owner = object.owner; + } + if (object.duration !== undefined && object.duration !== null) { + message.duration = Duration.fromAmino(object.duration); + } + return message; }, toAmino(message: AccountLockedLongerDurationNotUnlockingOnlyRequest): AccountLockedLongerDurationNotUnlockingOnlyRequestAmino { const obj: any = {}; @@ -3147,6 +4034,8 @@ export const AccountLockedLongerDurationNotUnlockingOnlyRequest = { }; } }; +GlobalDecoderRegistry.register(AccountLockedLongerDurationNotUnlockingOnlyRequest.typeUrl, AccountLockedLongerDurationNotUnlockingOnlyRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(AccountLockedLongerDurationNotUnlockingOnlyRequest.aminoType, AccountLockedLongerDurationNotUnlockingOnlyRequest.typeUrl); function createBaseAccountLockedLongerDurationNotUnlockingOnlyResponse(): AccountLockedLongerDurationNotUnlockingOnlyResponse { return { locks: [] @@ -3154,6 +4043,16 @@ function createBaseAccountLockedLongerDurationNotUnlockingOnlyResponse(): Accoun } export const AccountLockedLongerDurationNotUnlockingOnlyResponse = { typeUrl: "/osmosis.lockup.AccountLockedLongerDurationNotUnlockingOnlyResponse", + aminoType: "osmosis/lockup/account-locked-longer-duration-not-unlocking-only-response", + is(o: any): o is AccountLockedLongerDurationNotUnlockingOnlyResponse { + return o && (o.$typeUrl === AccountLockedLongerDurationNotUnlockingOnlyResponse.typeUrl || Array.isArray(o.locks) && (!o.locks.length || PeriodLock.is(o.locks[0]))); + }, + isSDK(o: any): o is AccountLockedLongerDurationNotUnlockingOnlyResponseSDKType { + return o && (o.$typeUrl === AccountLockedLongerDurationNotUnlockingOnlyResponse.typeUrl || Array.isArray(o.locks) && (!o.locks.length || PeriodLock.isSDK(o.locks[0]))); + }, + isAmino(o: any): o is AccountLockedLongerDurationNotUnlockingOnlyResponseAmino { + return o && (o.$typeUrl === AccountLockedLongerDurationNotUnlockingOnlyResponse.typeUrl || Array.isArray(o.locks) && (!o.locks.length || PeriodLock.isAmino(o.locks[0]))); + }, encode(message: AccountLockedLongerDurationNotUnlockingOnlyResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.locks) { PeriodLock.encode(v!, writer.uint32(10).fork()).ldelim(); @@ -3177,15 +4076,29 @@ export const AccountLockedLongerDurationNotUnlockingOnlyResponse = { } return message; }, + fromJSON(object: any): AccountLockedLongerDurationNotUnlockingOnlyResponse { + return { + locks: Array.isArray(object?.locks) ? object.locks.map((e: any) => PeriodLock.fromJSON(e)) : [] + }; + }, + toJSON(message: AccountLockedLongerDurationNotUnlockingOnlyResponse): unknown { + const obj: any = {}; + if (message.locks) { + obj.locks = message.locks.map(e => e ? PeriodLock.toJSON(e) : undefined); + } else { + obj.locks = []; + } + return obj; + }, fromPartial(object: Partial): AccountLockedLongerDurationNotUnlockingOnlyResponse { const message = createBaseAccountLockedLongerDurationNotUnlockingOnlyResponse(); message.locks = object.locks?.map(e => PeriodLock.fromPartial(e)) || []; return message; }, fromAmino(object: AccountLockedLongerDurationNotUnlockingOnlyResponseAmino): AccountLockedLongerDurationNotUnlockingOnlyResponse { - return { - locks: Array.isArray(object?.locks) ? object.locks.map((e: any) => PeriodLock.fromAmino(e)) : [] - }; + const message = createBaseAccountLockedLongerDurationNotUnlockingOnlyResponse(); + message.locks = object.locks?.map(e => PeriodLock.fromAmino(e)) || []; + return message; }, toAmino(message: AccountLockedLongerDurationNotUnlockingOnlyResponse): AccountLockedLongerDurationNotUnlockingOnlyResponseAmino { const obj: any = {}; @@ -3218,15 +4131,27 @@ export const AccountLockedLongerDurationNotUnlockingOnlyResponse = { }; } }; +GlobalDecoderRegistry.register(AccountLockedLongerDurationNotUnlockingOnlyResponse.typeUrl, AccountLockedLongerDurationNotUnlockingOnlyResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(AccountLockedLongerDurationNotUnlockingOnlyResponse.aminoType, AccountLockedLongerDurationNotUnlockingOnlyResponse.typeUrl); function createBaseAccountLockedLongerDurationDenomRequest(): AccountLockedLongerDurationDenomRequest { return { owner: "", - duration: undefined, + duration: Duration.fromPartial({}), denom: "" }; } export const AccountLockedLongerDurationDenomRequest = { typeUrl: "/osmosis.lockup.AccountLockedLongerDurationDenomRequest", + aminoType: "osmosis/lockup/account-locked-longer-duration-denom-request", + is(o: any): o is AccountLockedLongerDurationDenomRequest { + return o && (o.$typeUrl === AccountLockedLongerDurationDenomRequest.typeUrl || typeof o.owner === "string" && Duration.is(o.duration) && typeof o.denom === "string"); + }, + isSDK(o: any): o is AccountLockedLongerDurationDenomRequestSDKType { + return o && (o.$typeUrl === AccountLockedLongerDurationDenomRequest.typeUrl || typeof o.owner === "string" && Duration.isSDK(o.duration) && typeof o.denom === "string"); + }, + isAmino(o: any): o is AccountLockedLongerDurationDenomRequestAmino { + return o && (o.$typeUrl === AccountLockedLongerDurationDenomRequest.typeUrl || typeof o.owner === "string" && Duration.isAmino(o.duration) && typeof o.denom === "string"); + }, encode(message: AccountLockedLongerDurationDenomRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.owner !== "") { writer.uint32(10).string(message.owner); @@ -3262,6 +4187,20 @@ export const AccountLockedLongerDurationDenomRequest = { } return message; }, + fromJSON(object: any): AccountLockedLongerDurationDenomRequest { + return { + owner: isSet(object.owner) ? String(object.owner) : "", + duration: isSet(object.duration) ? Duration.fromJSON(object.duration) : undefined, + denom: isSet(object.denom) ? String(object.denom) : "" + }; + }, + toJSON(message: AccountLockedLongerDurationDenomRequest): unknown { + const obj: any = {}; + message.owner !== undefined && (obj.owner = message.owner); + message.duration !== undefined && (obj.duration = message.duration ? Duration.toJSON(message.duration) : undefined); + message.denom !== undefined && (obj.denom = message.denom); + return obj; + }, fromPartial(object: Partial): AccountLockedLongerDurationDenomRequest { const message = createBaseAccountLockedLongerDurationDenomRequest(); message.owner = object.owner ?? ""; @@ -3270,11 +4209,17 @@ export const AccountLockedLongerDurationDenomRequest = { return message; }, fromAmino(object: AccountLockedLongerDurationDenomRequestAmino): AccountLockedLongerDurationDenomRequest { - return { - owner: object.owner, - duration: object?.duration ? Duration.fromAmino(object.duration) : undefined, - denom: object.denom - }; + const message = createBaseAccountLockedLongerDurationDenomRequest(); + if (object.owner !== undefined && object.owner !== null) { + message.owner = object.owner; + } + if (object.duration !== undefined && object.duration !== null) { + message.duration = Duration.fromAmino(object.duration); + } + if (object.denom !== undefined && object.denom !== null) { + message.denom = object.denom; + } + return message; }, toAmino(message: AccountLockedLongerDurationDenomRequest): AccountLockedLongerDurationDenomRequestAmino { const obj: any = {}; @@ -3305,6 +4250,8 @@ export const AccountLockedLongerDurationDenomRequest = { }; } }; +GlobalDecoderRegistry.register(AccountLockedLongerDurationDenomRequest.typeUrl, AccountLockedLongerDurationDenomRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(AccountLockedLongerDurationDenomRequest.aminoType, AccountLockedLongerDurationDenomRequest.typeUrl); function createBaseAccountLockedLongerDurationDenomResponse(): AccountLockedLongerDurationDenomResponse { return { locks: [] @@ -3312,6 +4259,16 @@ function createBaseAccountLockedLongerDurationDenomResponse(): AccountLockedLong } export const AccountLockedLongerDurationDenomResponse = { typeUrl: "/osmosis.lockup.AccountLockedLongerDurationDenomResponse", + aminoType: "osmosis/lockup/account-locked-longer-duration-denom-response", + is(o: any): o is AccountLockedLongerDurationDenomResponse { + return o && (o.$typeUrl === AccountLockedLongerDurationDenomResponse.typeUrl || Array.isArray(o.locks) && (!o.locks.length || PeriodLock.is(o.locks[0]))); + }, + isSDK(o: any): o is AccountLockedLongerDurationDenomResponseSDKType { + return o && (o.$typeUrl === AccountLockedLongerDurationDenomResponse.typeUrl || Array.isArray(o.locks) && (!o.locks.length || PeriodLock.isSDK(o.locks[0]))); + }, + isAmino(o: any): o is AccountLockedLongerDurationDenomResponseAmino { + return o && (o.$typeUrl === AccountLockedLongerDurationDenomResponse.typeUrl || Array.isArray(o.locks) && (!o.locks.length || PeriodLock.isAmino(o.locks[0]))); + }, encode(message: AccountLockedLongerDurationDenomResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.locks) { PeriodLock.encode(v!, writer.uint32(10).fork()).ldelim(); @@ -3335,15 +4292,29 @@ export const AccountLockedLongerDurationDenomResponse = { } return message; }, + fromJSON(object: any): AccountLockedLongerDurationDenomResponse { + return { + locks: Array.isArray(object?.locks) ? object.locks.map((e: any) => PeriodLock.fromJSON(e)) : [] + }; + }, + toJSON(message: AccountLockedLongerDurationDenomResponse): unknown { + const obj: any = {}; + if (message.locks) { + obj.locks = message.locks.map(e => e ? PeriodLock.toJSON(e) : undefined); + } else { + obj.locks = []; + } + return obj; + }, fromPartial(object: Partial): AccountLockedLongerDurationDenomResponse { const message = createBaseAccountLockedLongerDurationDenomResponse(); message.locks = object.locks?.map(e => PeriodLock.fromPartial(e)) || []; return message; }, fromAmino(object: AccountLockedLongerDurationDenomResponseAmino): AccountLockedLongerDurationDenomResponse { - return { - locks: Array.isArray(object?.locks) ? object.locks.map((e: any) => PeriodLock.fromAmino(e)) : [] - }; + const message = createBaseAccountLockedLongerDurationDenomResponse(); + message.locks = object.locks?.map(e => PeriodLock.fromAmino(e)) || []; + return message; }, toAmino(message: AccountLockedLongerDurationDenomResponse): AccountLockedLongerDurationDenomResponseAmino { const obj: any = {}; @@ -3376,11 +4347,23 @@ export const AccountLockedLongerDurationDenomResponse = { }; } }; +GlobalDecoderRegistry.register(AccountLockedLongerDurationDenomResponse.typeUrl, AccountLockedLongerDurationDenomResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(AccountLockedLongerDurationDenomResponse.aminoType, AccountLockedLongerDurationDenomResponse.typeUrl); function createBaseQueryParamsRequest(): QueryParamsRequest { return {}; } export const QueryParamsRequest = { typeUrl: "/osmosis.lockup.QueryParamsRequest", + aminoType: "osmosis/lockup/query-params-request", + is(o: any): o is QueryParamsRequest { + return o && o.$typeUrl === QueryParamsRequest.typeUrl; + }, + isSDK(o: any): o is QueryParamsRequestSDKType { + return o && o.$typeUrl === QueryParamsRequest.typeUrl; + }, + isAmino(o: any): o is QueryParamsRequestAmino { + return o && o.$typeUrl === QueryParamsRequest.typeUrl; + }, encode(_: QueryParamsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, @@ -3398,12 +4381,20 @@ export const QueryParamsRequest = { } return message; }, + fromJSON(_: any): QueryParamsRequest { + return {}; + }, + toJSON(_: QueryParamsRequest): unknown { + const obj: any = {}; + return obj; + }, fromPartial(_: Partial): QueryParamsRequest { const message = createBaseQueryParamsRequest(); return message; }, fromAmino(_: QueryParamsRequestAmino): QueryParamsRequest { - return {}; + const message = createBaseQueryParamsRequest(); + return message; }, toAmino(_: QueryParamsRequest): QueryParamsRequestAmino { const obj: any = {}; @@ -3431,6 +4422,8 @@ export const QueryParamsRequest = { }; } }; +GlobalDecoderRegistry.register(QueryParamsRequest.typeUrl, QueryParamsRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryParamsRequest.aminoType, QueryParamsRequest.typeUrl); function createBaseQueryParamsResponse(): QueryParamsResponse { return { params: Params.fromPartial({}) @@ -3438,6 +4431,16 @@ function createBaseQueryParamsResponse(): QueryParamsResponse { } export const QueryParamsResponse = { typeUrl: "/osmosis.lockup.QueryParamsResponse", + aminoType: "osmosis/lockup/query-params-response", + is(o: any): o is QueryParamsResponse { + return o && (o.$typeUrl === QueryParamsResponse.typeUrl || Params.is(o.params)); + }, + isSDK(o: any): o is QueryParamsResponseSDKType { + return o && (o.$typeUrl === QueryParamsResponse.typeUrl || Params.isSDK(o.params)); + }, + isAmino(o: any): o is QueryParamsResponseAmino { + return o && (o.$typeUrl === QueryParamsResponse.typeUrl || Params.isAmino(o.params)); + }, encode(message: QueryParamsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.params !== undefined) { Params.encode(message.params, writer.uint32(10).fork()).ldelim(); @@ -3461,15 +4464,27 @@ export const QueryParamsResponse = { } return message; }, + fromJSON(object: any): QueryParamsResponse { + 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; + }, fromPartial(object: Partial): QueryParamsResponse { const message = createBaseQueryParamsResponse(); message.params = object.params !== undefined && object.params !== null ? Params.fromPartial(object.params) : undefined; return message; }, fromAmino(object: QueryParamsResponseAmino): QueryParamsResponse { - return { - params: object?.params ? Params.fromAmino(object.params) : undefined - }; + const message = createBaseQueryParamsResponse(); + if (object.params !== undefined && object.params !== null) { + message.params = Params.fromAmino(object.params); + } + return message; }, toAmino(message: QueryParamsResponse): QueryParamsResponseAmino { const obj: any = {}; @@ -3497,4 +4512,6 @@ export const QueryParamsResponse = { value: QueryParamsResponse.encode(message).finish() }; } -}; \ No newline at end of file +}; +GlobalDecoderRegistry.register(QueryParamsResponse.typeUrl, QueryParamsResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryParamsResponse.aminoType, QueryParamsResponse.typeUrl); \ No newline at end of file diff --git a/packages/osmojs/src/codegen/osmosis/lockup/tx.amino.ts b/packages/osmojs/src/codegen/osmosis/lockup/tx.amino.ts index 0fa595081..9f98bdf0b 100644 --- a/packages/osmojs/src/codegen/osmosis/lockup/tx.amino.ts +++ b/packages/osmojs/src/codegen/osmosis/lockup/tx.amino.ts @@ -22,7 +22,7 @@ export const AminoConverter = { fromAmino: MsgExtendLockup.fromAmino }, "/osmosis.lockup.MsgForceUnlock": { - aminoType: "osmosis/lockup/force-unlock", + aminoType: "osmosis/lockup/force-unlock-tokens", toAmino: MsgForceUnlock.toAmino, fromAmino: MsgForceUnlock.fromAmino }, diff --git a/packages/osmojs/src/codegen/osmosis/lockup/tx.registry.ts b/packages/osmojs/src/codegen/osmosis/lockup/tx.registry.ts index a21a02abf..095e71804 100644 --- a/packages/osmojs/src/codegen/osmosis/lockup/tx.registry.ts +++ b/packages/osmojs/src/codegen/osmosis/lockup/tx.registry.ts @@ -84,6 +84,82 @@ export const MessageComposer = { }; } }, + toJSON: { + lockTokens(value: MsgLockTokens) { + return { + typeUrl: "/osmosis.lockup.MsgLockTokens", + value: MsgLockTokens.toJSON(value) + }; + }, + beginUnlockingAll(value: MsgBeginUnlockingAll) { + return { + typeUrl: "/osmosis.lockup.MsgBeginUnlockingAll", + value: MsgBeginUnlockingAll.toJSON(value) + }; + }, + beginUnlocking(value: MsgBeginUnlocking) { + return { + typeUrl: "/osmosis.lockup.MsgBeginUnlocking", + value: MsgBeginUnlocking.toJSON(value) + }; + }, + extendLockup(value: MsgExtendLockup) { + return { + typeUrl: "/osmosis.lockup.MsgExtendLockup", + value: MsgExtendLockup.toJSON(value) + }; + }, + forceUnlock(value: MsgForceUnlock) { + return { + typeUrl: "/osmosis.lockup.MsgForceUnlock", + value: MsgForceUnlock.toJSON(value) + }; + }, + setRewardReceiverAddress(value: MsgSetRewardReceiverAddress) { + return { + typeUrl: "/osmosis.lockup.MsgSetRewardReceiverAddress", + value: MsgSetRewardReceiverAddress.toJSON(value) + }; + } + }, + fromJSON: { + lockTokens(value: any) { + return { + typeUrl: "/osmosis.lockup.MsgLockTokens", + value: MsgLockTokens.fromJSON(value) + }; + }, + beginUnlockingAll(value: any) { + return { + typeUrl: "/osmosis.lockup.MsgBeginUnlockingAll", + value: MsgBeginUnlockingAll.fromJSON(value) + }; + }, + beginUnlocking(value: any) { + return { + typeUrl: "/osmosis.lockup.MsgBeginUnlocking", + value: MsgBeginUnlocking.fromJSON(value) + }; + }, + extendLockup(value: any) { + return { + typeUrl: "/osmosis.lockup.MsgExtendLockup", + value: MsgExtendLockup.fromJSON(value) + }; + }, + forceUnlock(value: any) { + return { + typeUrl: "/osmosis.lockup.MsgForceUnlock", + value: MsgForceUnlock.fromJSON(value) + }; + }, + setRewardReceiverAddress(value: any) { + return { + typeUrl: "/osmosis.lockup.MsgSetRewardReceiverAddress", + value: MsgSetRewardReceiverAddress.fromJSON(value) + }; + } + }, fromPartial: { lockTokens(value: MsgLockTokens) { return { diff --git a/packages/osmojs/src/codegen/osmosis/lockup/tx.rpc.msg.ts b/packages/osmojs/src/codegen/osmosis/lockup/tx.rpc.msg.ts index 1fbf59347..426a7226c 100644 --- a/packages/osmojs/src/codegen/osmosis/lockup/tx.rpc.msg.ts +++ b/packages/osmojs/src/codegen/osmosis/lockup/tx.rpc.msg.ts @@ -56,4 +56,7 @@ export class MsgClientImpl implements Msg { const promise = this.rpc.request("osmosis.lockup.Msg", "SetRewardReceiverAddress", data); return promise.then(data => MsgSetRewardReceiverAddressResponse.decode(new BinaryReader(data))); } -} \ No newline at end of file +} +export const createClientImpl = (rpc: Rpc) => { + return new MsgClientImpl(rpc); +}; \ No newline at end of file diff --git a/packages/osmojs/src/codegen/osmosis/lockup/tx.ts b/packages/osmojs/src/codegen/osmosis/lockup/tx.ts index 8e7742995..5cce6772b 100644 --- a/packages/osmojs/src/codegen/osmosis/lockup/tx.ts +++ b/packages/osmojs/src/codegen/osmosis/lockup/tx.ts @@ -2,6 +2,8 @@ import { Duration, DurationAmino, DurationSDKType } from "../../google/protobuf/ import { Coin, CoinAmino, CoinSDKType } from "../../cosmos/base/v1beta1/coin"; import { PeriodLock, PeriodLockAmino, PeriodLockSDKType } from "./lock"; import { BinaryReader, BinaryWriter } from "../../binary"; +import { isSet } from "../../helpers"; +import { GlobalDecoderRegistry } from "../../registry"; export interface MsgLockTokens { owner: string; duration: Duration; @@ -12,9 +14,9 @@ export interface MsgLockTokensProtoMsg { value: Uint8Array; } export interface MsgLockTokensAmino { - owner: string; + owner?: string; duration?: DurationAmino; - coins: CoinAmino[]; + coins?: CoinAmino[]; } export interface MsgLockTokensAminoMsg { type: "osmosis/lockup/lock-tokens"; @@ -33,7 +35,7 @@ export interface MsgLockTokensResponseProtoMsg { value: Uint8Array; } export interface MsgLockTokensResponseAmino { - ID: string; + ID?: string; } export interface MsgLockTokensResponseAminoMsg { type: "osmosis/lockup/lock-tokens-response"; @@ -50,7 +52,7 @@ export interface MsgBeginUnlockingAllProtoMsg { value: Uint8Array; } export interface MsgBeginUnlockingAllAmino { - owner: string; + owner?: string; } export interface MsgBeginUnlockingAllAminoMsg { type: "osmosis/lockup/begin-unlock-tokens"; @@ -67,7 +69,7 @@ export interface MsgBeginUnlockingAllResponseProtoMsg { value: Uint8Array; } export interface MsgBeginUnlockingAllResponseAmino { - unlocks: PeriodLockAmino[]; + unlocks?: PeriodLockAmino[]; } export interface MsgBeginUnlockingAllResponseAminoMsg { type: "osmosis/lockup/begin-unlocking-all-response"; @@ -87,10 +89,10 @@ export interface MsgBeginUnlockingProtoMsg { value: Uint8Array; } export interface MsgBeginUnlockingAmino { - owner: string; - ID: string; + owner?: string; + ID?: string; /** Amount of unlocking coins. Unlock all if not set. */ - coins: CoinAmino[]; + coins?: CoinAmino[]; } export interface MsgBeginUnlockingAminoMsg { type: "osmosis/lockup/begin-unlock-period-lock"; @@ -110,8 +112,8 @@ export interface MsgBeginUnlockingResponseProtoMsg { value: Uint8Array; } export interface MsgBeginUnlockingResponseAmino { - success: boolean; - unlockingLockID: string; + success?: boolean; + unlockingLockID?: string; } export interface MsgBeginUnlockingResponseAminoMsg { type: "osmosis/lockup/begin-unlocking-response"; @@ -143,8 +145,8 @@ export interface MsgExtendLockupProtoMsg { * The new duration is longer than the original. */ export interface MsgExtendLockupAmino { - owner: string; - ID: string; + owner?: string; + ID?: string; /** * duration to be set. fails if lower than the current duration, or is * unlocking @@ -172,7 +174,7 @@ export interface MsgExtendLockupResponseProtoMsg { value: Uint8Array; } export interface MsgExtendLockupResponseAmino { - success: boolean; + success?: boolean; } export interface MsgExtendLockupResponseAminoMsg { type: "osmosis/lockup/extend-lockup-response"; @@ -200,13 +202,13 @@ export interface MsgForceUnlockProtoMsg { * addresses registered via governance. */ export interface MsgForceUnlockAmino { - owner: string; - ID: string; + owner?: string; + ID?: string; /** Amount of unlocking coins. Unlock all if not set. */ - coins: CoinAmino[]; + coins?: CoinAmino[]; } export interface MsgForceUnlockAminoMsg { - type: "osmosis/lockup/force-unlock"; + type: "osmosis/lockup/force-unlock-tokens"; value: MsgForceUnlockAmino; } /** @@ -226,7 +228,7 @@ export interface MsgForceUnlockResponseProtoMsg { value: Uint8Array; } export interface MsgForceUnlockResponseAmino { - success: boolean; + success?: boolean; } export interface MsgForceUnlockResponseAminoMsg { type: "osmosis/lockup/force-unlock-response"; @@ -245,9 +247,9 @@ export interface MsgSetRewardReceiverAddressProtoMsg { value: Uint8Array; } export interface MsgSetRewardReceiverAddressAmino { - owner: string; - lockID: string; - reward_receiver: string; + owner?: string; + lockID?: string; + reward_receiver?: string; } export interface MsgSetRewardReceiverAddressAminoMsg { type: "osmosis/lockup/set-reward-receiver-address"; @@ -266,7 +268,7 @@ export interface MsgSetRewardReceiverAddressResponseProtoMsg { value: Uint8Array; } export interface MsgSetRewardReceiverAddressResponseAmino { - success: boolean; + success?: boolean; } export interface MsgSetRewardReceiverAddressResponseAminoMsg { type: "osmosis/lockup/set-reward-receiver-address-response"; @@ -278,12 +280,22 @@ export interface MsgSetRewardReceiverAddressResponseSDKType { function createBaseMsgLockTokens(): MsgLockTokens { return { owner: "", - duration: undefined, + duration: Duration.fromPartial({}), coins: [] }; } export const MsgLockTokens = { typeUrl: "/osmosis.lockup.MsgLockTokens", + aminoType: "osmosis/lockup/lock-tokens", + is(o: any): o is MsgLockTokens { + return o && (o.$typeUrl === MsgLockTokens.typeUrl || typeof o.owner === "string" && Duration.is(o.duration) && Array.isArray(o.coins) && (!o.coins.length || Coin.is(o.coins[0]))); + }, + isSDK(o: any): o is MsgLockTokensSDKType { + return o && (o.$typeUrl === MsgLockTokens.typeUrl || typeof o.owner === "string" && Duration.isSDK(o.duration) && Array.isArray(o.coins) && (!o.coins.length || Coin.isSDK(o.coins[0]))); + }, + isAmino(o: any): o is MsgLockTokensAmino { + return o && (o.$typeUrl === MsgLockTokens.typeUrl || typeof o.owner === "string" && Duration.isAmino(o.duration) && Array.isArray(o.coins) && (!o.coins.length || Coin.isAmino(o.coins[0]))); + }, encode(message: MsgLockTokens, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.owner !== "") { writer.uint32(10).string(message.owner); @@ -319,6 +331,24 @@ export const MsgLockTokens = { } return message; }, + fromJSON(object: any): MsgLockTokens { + return { + owner: isSet(object.owner) ? String(object.owner) : "", + duration: isSet(object.duration) ? Duration.fromJSON(object.duration) : undefined, + coins: Array.isArray(object?.coins) ? object.coins.map((e: any) => Coin.fromJSON(e)) : [] + }; + }, + toJSON(message: MsgLockTokens): unknown { + const obj: any = {}; + message.owner !== undefined && (obj.owner = message.owner); + message.duration !== undefined && (obj.duration = message.duration ? Duration.toJSON(message.duration) : undefined); + if (message.coins) { + obj.coins = message.coins.map(e => e ? Coin.toJSON(e) : undefined); + } else { + obj.coins = []; + } + return obj; + }, fromPartial(object: Partial): MsgLockTokens { const message = createBaseMsgLockTokens(); message.owner = object.owner ?? ""; @@ -327,11 +357,15 @@ export const MsgLockTokens = { return message; }, fromAmino(object: MsgLockTokensAmino): MsgLockTokens { - return { - owner: object.owner, - duration: object?.duration ? Duration.fromAmino(object.duration) : undefined, - coins: Array.isArray(object?.coins) ? object.coins.map((e: any) => Coin.fromAmino(e)) : [] - }; + const message = createBaseMsgLockTokens(); + if (object.owner !== undefined && object.owner !== null) { + message.owner = object.owner; + } + if (object.duration !== undefined && object.duration !== null) { + message.duration = Duration.fromAmino(object.duration); + } + message.coins = object.coins?.map(e => Coin.fromAmino(e)) || []; + return message; }, toAmino(message: MsgLockTokens): MsgLockTokensAmino { const obj: any = {}; @@ -366,6 +400,8 @@ export const MsgLockTokens = { }; } }; +GlobalDecoderRegistry.register(MsgLockTokens.typeUrl, MsgLockTokens); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgLockTokens.aminoType, MsgLockTokens.typeUrl); function createBaseMsgLockTokensResponse(): MsgLockTokensResponse { return { ID: BigInt(0) @@ -373,6 +409,16 @@ function createBaseMsgLockTokensResponse(): MsgLockTokensResponse { } export const MsgLockTokensResponse = { typeUrl: "/osmosis.lockup.MsgLockTokensResponse", + aminoType: "osmosis/lockup/lock-tokens-response", + is(o: any): o is MsgLockTokensResponse { + return o && (o.$typeUrl === MsgLockTokensResponse.typeUrl || typeof o.ID === "bigint"); + }, + isSDK(o: any): o is MsgLockTokensResponseSDKType { + return o && (o.$typeUrl === MsgLockTokensResponse.typeUrl || typeof o.ID === "bigint"); + }, + isAmino(o: any): o is MsgLockTokensResponseAmino { + return o && (o.$typeUrl === MsgLockTokensResponse.typeUrl || typeof o.ID === "bigint"); + }, encode(message: MsgLockTokensResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.ID !== BigInt(0)) { writer.uint32(8).uint64(message.ID); @@ -396,15 +442,27 @@ export const MsgLockTokensResponse = { } return message; }, + fromJSON(object: any): MsgLockTokensResponse { + return { + ID: isSet(object.ID) ? BigInt(object.ID.toString()) : BigInt(0) + }; + }, + toJSON(message: MsgLockTokensResponse): unknown { + const obj: any = {}; + message.ID !== undefined && (obj.ID = (message.ID || BigInt(0)).toString()); + return obj; + }, fromPartial(object: Partial): MsgLockTokensResponse { const message = createBaseMsgLockTokensResponse(); message.ID = object.ID !== undefined && object.ID !== null ? BigInt(object.ID.toString()) : BigInt(0); return message; }, fromAmino(object: MsgLockTokensResponseAmino): MsgLockTokensResponse { - return { - ID: BigInt(object.ID) - }; + const message = createBaseMsgLockTokensResponse(); + if (object.ID !== undefined && object.ID !== null) { + message.ID = BigInt(object.ID); + } + return message; }, toAmino(message: MsgLockTokensResponse): MsgLockTokensResponseAmino { const obj: any = {}; @@ -433,6 +491,8 @@ export const MsgLockTokensResponse = { }; } }; +GlobalDecoderRegistry.register(MsgLockTokensResponse.typeUrl, MsgLockTokensResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgLockTokensResponse.aminoType, MsgLockTokensResponse.typeUrl); function createBaseMsgBeginUnlockingAll(): MsgBeginUnlockingAll { return { owner: "" @@ -440,6 +500,16 @@ function createBaseMsgBeginUnlockingAll(): MsgBeginUnlockingAll { } export const MsgBeginUnlockingAll = { typeUrl: "/osmosis.lockup.MsgBeginUnlockingAll", + aminoType: "osmosis/lockup/begin-unlock-tokens", + is(o: any): o is MsgBeginUnlockingAll { + return o && (o.$typeUrl === MsgBeginUnlockingAll.typeUrl || typeof o.owner === "string"); + }, + isSDK(o: any): o is MsgBeginUnlockingAllSDKType { + return o && (o.$typeUrl === MsgBeginUnlockingAll.typeUrl || typeof o.owner === "string"); + }, + isAmino(o: any): o is MsgBeginUnlockingAllAmino { + return o && (o.$typeUrl === MsgBeginUnlockingAll.typeUrl || typeof o.owner === "string"); + }, encode(message: MsgBeginUnlockingAll, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.owner !== "") { writer.uint32(10).string(message.owner); @@ -463,15 +533,27 @@ export const MsgBeginUnlockingAll = { } return message; }, + fromJSON(object: any): MsgBeginUnlockingAll { + return { + owner: isSet(object.owner) ? String(object.owner) : "" + }; + }, + toJSON(message: MsgBeginUnlockingAll): unknown { + const obj: any = {}; + message.owner !== undefined && (obj.owner = message.owner); + return obj; + }, fromPartial(object: Partial): MsgBeginUnlockingAll { const message = createBaseMsgBeginUnlockingAll(); message.owner = object.owner ?? ""; return message; }, fromAmino(object: MsgBeginUnlockingAllAmino): MsgBeginUnlockingAll { - return { - owner: object.owner - }; + const message = createBaseMsgBeginUnlockingAll(); + if (object.owner !== undefined && object.owner !== null) { + message.owner = object.owner; + } + return message; }, toAmino(message: MsgBeginUnlockingAll): MsgBeginUnlockingAllAmino { const obj: any = {}; @@ -500,6 +582,8 @@ export const MsgBeginUnlockingAll = { }; } }; +GlobalDecoderRegistry.register(MsgBeginUnlockingAll.typeUrl, MsgBeginUnlockingAll); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgBeginUnlockingAll.aminoType, MsgBeginUnlockingAll.typeUrl); function createBaseMsgBeginUnlockingAllResponse(): MsgBeginUnlockingAllResponse { return { unlocks: [] @@ -507,6 +591,16 @@ function createBaseMsgBeginUnlockingAllResponse(): MsgBeginUnlockingAllResponse } export const MsgBeginUnlockingAllResponse = { typeUrl: "/osmosis.lockup.MsgBeginUnlockingAllResponse", + aminoType: "osmosis/lockup/begin-unlocking-all-response", + is(o: any): o is MsgBeginUnlockingAllResponse { + return o && (o.$typeUrl === MsgBeginUnlockingAllResponse.typeUrl || Array.isArray(o.unlocks) && (!o.unlocks.length || PeriodLock.is(o.unlocks[0]))); + }, + isSDK(o: any): o is MsgBeginUnlockingAllResponseSDKType { + return o && (o.$typeUrl === MsgBeginUnlockingAllResponse.typeUrl || Array.isArray(o.unlocks) && (!o.unlocks.length || PeriodLock.isSDK(o.unlocks[0]))); + }, + isAmino(o: any): o is MsgBeginUnlockingAllResponseAmino { + return o && (o.$typeUrl === MsgBeginUnlockingAllResponse.typeUrl || Array.isArray(o.unlocks) && (!o.unlocks.length || PeriodLock.isAmino(o.unlocks[0]))); + }, encode(message: MsgBeginUnlockingAllResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.unlocks) { PeriodLock.encode(v!, writer.uint32(10).fork()).ldelim(); @@ -530,15 +624,29 @@ export const MsgBeginUnlockingAllResponse = { } return message; }, + fromJSON(object: any): MsgBeginUnlockingAllResponse { + return { + unlocks: Array.isArray(object?.unlocks) ? object.unlocks.map((e: any) => PeriodLock.fromJSON(e)) : [] + }; + }, + toJSON(message: MsgBeginUnlockingAllResponse): unknown { + const obj: any = {}; + if (message.unlocks) { + obj.unlocks = message.unlocks.map(e => e ? PeriodLock.toJSON(e) : undefined); + } else { + obj.unlocks = []; + } + return obj; + }, fromPartial(object: Partial): MsgBeginUnlockingAllResponse { const message = createBaseMsgBeginUnlockingAllResponse(); message.unlocks = object.unlocks?.map(e => PeriodLock.fromPartial(e)) || []; return message; }, fromAmino(object: MsgBeginUnlockingAllResponseAmino): MsgBeginUnlockingAllResponse { - return { - unlocks: Array.isArray(object?.unlocks) ? object.unlocks.map((e: any) => PeriodLock.fromAmino(e)) : [] - }; + const message = createBaseMsgBeginUnlockingAllResponse(); + message.unlocks = object.unlocks?.map(e => PeriodLock.fromAmino(e)) || []; + return message; }, toAmino(message: MsgBeginUnlockingAllResponse): MsgBeginUnlockingAllResponseAmino { const obj: any = {}; @@ -571,6 +679,8 @@ export const MsgBeginUnlockingAllResponse = { }; } }; +GlobalDecoderRegistry.register(MsgBeginUnlockingAllResponse.typeUrl, MsgBeginUnlockingAllResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgBeginUnlockingAllResponse.aminoType, MsgBeginUnlockingAllResponse.typeUrl); function createBaseMsgBeginUnlocking(): MsgBeginUnlocking { return { owner: "", @@ -580,6 +690,16 @@ function createBaseMsgBeginUnlocking(): MsgBeginUnlocking { } export const MsgBeginUnlocking = { typeUrl: "/osmosis.lockup.MsgBeginUnlocking", + aminoType: "osmosis/lockup/begin-unlock-period-lock", + is(o: any): o is MsgBeginUnlocking { + return o && (o.$typeUrl === MsgBeginUnlocking.typeUrl || typeof o.owner === "string" && typeof o.ID === "bigint" && Array.isArray(o.coins) && (!o.coins.length || Coin.is(o.coins[0]))); + }, + isSDK(o: any): o is MsgBeginUnlockingSDKType { + return o && (o.$typeUrl === MsgBeginUnlocking.typeUrl || typeof o.owner === "string" && typeof o.ID === "bigint" && Array.isArray(o.coins) && (!o.coins.length || Coin.isSDK(o.coins[0]))); + }, + isAmino(o: any): o is MsgBeginUnlockingAmino { + return o && (o.$typeUrl === MsgBeginUnlocking.typeUrl || typeof o.owner === "string" && typeof o.ID === "bigint" && Array.isArray(o.coins) && (!o.coins.length || Coin.isAmino(o.coins[0]))); + }, encode(message: MsgBeginUnlocking, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.owner !== "") { writer.uint32(10).string(message.owner); @@ -615,6 +735,24 @@ export const MsgBeginUnlocking = { } return message; }, + fromJSON(object: any): MsgBeginUnlocking { + return { + owner: isSet(object.owner) ? String(object.owner) : "", + ID: isSet(object.ID) ? BigInt(object.ID.toString()) : BigInt(0), + coins: Array.isArray(object?.coins) ? object.coins.map((e: any) => Coin.fromJSON(e)) : [] + }; + }, + toJSON(message: MsgBeginUnlocking): unknown { + const obj: any = {}; + message.owner !== undefined && (obj.owner = message.owner); + message.ID !== undefined && (obj.ID = (message.ID || BigInt(0)).toString()); + if (message.coins) { + obj.coins = message.coins.map(e => e ? Coin.toJSON(e) : undefined); + } else { + obj.coins = []; + } + return obj; + }, fromPartial(object: Partial): MsgBeginUnlocking { const message = createBaseMsgBeginUnlocking(); message.owner = object.owner ?? ""; @@ -623,11 +761,15 @@ export const MsgBeginUnlocking = { return message; }, fromAmino(object: MsgBeginUnlockingAmino): MsgBeginUnlocking { - return { - owner: object.owner, - ID: BigInt(object.ID), - coins: Array.isArray(object?.coins) ? object.coins.map((e: any) => Coin.fromAmino(e)) : [] - }; + const message = createBaseMsgBeginUnlocking(); + if (object.owner !== undefined && object.owner !== null) { + message.owner = object.owner; + } + if (object.ID !== undefined && object.ID !== null) { + message.ID = BigInt(object.ID); + } + message.coins = object.coins?.map(e => Coin.fromAmino(e)) || []; + return message; }, toAmino(message: MsgBeginUnlocking): MsgBeginUnlockingAmino { const obj: any = {}; @@ -662,6 +804,8 @@ export const MsgBeginUnlocking = { }; } }; +GlobalDecoderRegistry.register(MsgBeginUnlocking.typeUrl, MsgBeginUnlocking); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgBeginUnlocking.aminoType, MsgBeginUnlocking.typeUrl); function createBaseMsgBeginUnlockingResponse(): MsgBeginUnlockingResponse { return { success: false, @@ -670,6 +814,16 @@ function createBaseMsgBeginUnlockingResponse(): MsgBeginUnlockingResponse { } export const MsgBeginUnlockingResponse = { typeUrl: "/osmosis.lockup.MsgBeginUnlockingResponse", + aminoType: "osmosis/lockup/begin-unlocking-response", + is(o: any): o is MsgBeginUnlockingResponse { + return o && (o.$typeUrl === MsgBeginUnlockingResponse.typeUrl || typeof o.success === "boolean" && typeof o.unlockingLockID === "bigint"); + }, + isSDK(o: any): o is MsgBeginUnlockingResponseSDKType { + return o && (o.$typeUrl === MsgBeginUnlockingResponse.typeUrl || typeof o.success === "boolean" && typeof o.unlockingLockID === "bigint"); + }, + isAmino(o: any): o is MsgBeginUnlockingResponseAmino { + return o && (o.$typeUrl === MsgBeginUnlockingResponse.typeUrl || typeof o.success === "boolean" && typeof o.unlockingLockID === "bigint"); + }, encode(message: MsgBeginUnlockingResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.success === true) { writer.uint32(8).bool(message.success); @@ -699,6 +853,18 @@ export const MsgBeginUnlockingResponse = { } return message; }, + fromJSON(object: any): MsgBeginUnlockingResponse { + return { + success: isSet(object.success) ? Boolean(object.success) : false, + unlockingLockID: isSet(object.unlockingLockID) ? BigInt(object.unlockingLockID.toString()) : BigInt(0) + }; + }, + toJSON(message: MsgBeginUnlockingResponse): unknown { + const obj: any = {}; + message.success !== undefined && (obj.success = message.success); + message.unlockingLockID !== undefined && (obj.unlockingLockID = (message.unlockingLockID || BigInt(0)).toString()); + return obj; + }, fromPartial(object: Partial): MsgBeginUnlockingResponse { const message = createBaseMsgBeginUnlockingResponse(); message.success = object.success ?? false; @@ -706,10 +872,14 @@ export const MsgBeginUnlockingResponse = { return message; }, fromAmino(object: MsgBeginUnlockingResponseAmino): MsgBeginUnlockingResponse { - return { - success: object.success, - unlockingLockID: BigInt(object.unlockingLockID) - }; + const message = createBaseMsgBeginUnlockingResponse(); + if (object.success !== undefined && object.success !== null) { + message.success = object.success; + } + if (object.unlockingLockID !== undefined && object.unlockingLockID !== null) { + message.unlockingLockID = BigInt(object.unlockingLockID); + } + return message; }, toAmino(message: MsgBeginUnlockingResponse): MsgBeginUnlockingResponseAmino { const obj: any = {}; @@ -739,15 +909,27 @@ export const MsgBeginUnlockingResponse = { }; } }; +GlobalDecoderRegistry.register(MsgBeginUnlockingResponse.typeUrl, MsgBeginUnlockingResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgBeginUnlockingResponse.aminoType, MsgBeginUnlockingResponse.typeUrl); function createBaseMsgExtendLockup(): MsgExtendLockup { return { owner: "", ID: BigInt(0), - duration: undefined + duration: Duration.fromPartial({}) }; } export const MsgExtendLockup = { typeUrl: "/osmosis.lockup.MsgExtendLockup", + aminoType: "osmosis/lockup/extend-lockup", + is(o: any): o is MsgExtendLockup { + return o && (o.$typeUrl === MsgExtendLockup.typeUrl || typeof o.owner === "string" && typeof o.ID === "bigint" && Duration.is(o.duration)); + }, + isSDK(o: any): o is MsgExtendLockupSDKType { + return o && (o.$typeUrl === MsgExtendLockup.typeUrl || typeof o.owner === "string" && typeof o.ID === "bigint" && Duration.isSDK(o.duration)); + }, + isAmino(o: any): o is MsgExtendLockupAmino { + return o && (o.$typeUrl === MsgExtendLockup.typeUrl || typeof o.owner === "string" && typeof o.ID === "bigint" && Duration.isAmino(o.duration)); + }, encode(message: MsgExtendLockup, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.owner !== "") { writer.uint32(10).string(message.owner); @@ -783,6 +965,20 @@ export const MsgExtendLockup = { } return message; }, + fromJSON(object: any): MsgExtendLockup { + return { + owner: isSet(object.owner) ? String(object.owner) : "", + ID: isSet(object.ID) ? BigInt(object.ID.toString()) : BigInt(0), + duration: isSet(object.duration) ? Duration.fromJSON(object.duration) : undefined + }; + }, + toJSON(message: MsgExtendLockup): unknown { + const obj: any = {}; + message.owner !== undefined && (obj.owner = message.owner); + message.ID !== undefined && (obj.ID = (message.ID || BigInt(0)).toString()); + message.duration !== undefined && (obj.duration = message.duration ? Duration.toJSON(message.duration) : undefined); + return obj; + }, fromPartial(object: Partial): MsgExtendLockup { const message = createBaseMsgExtendLockup(); message.owner = object.owner ?? ""; @@ -791,11 +987,17 @@ export const MsgExtendLockup = { return message; }, fromAmino(object: MsgExtendLockupAmino): MsgExtendLockup { - return { - owner: object.owner, - ID: BigInt(object.ID), - duration: object?.duration ? Duration.fromAmino(object.duration) : undefined - }; + const message = createBaseMsgExtendLockup(); + if (object.owner !== undefined && object.owner !== null) { + message.owner = object.owner; + } + if (object.ID !== undefined && object.ID !== null) { + message.ID = BigInt(object.ID); + } + if (object.duration !== undefined && object.duration !== null) { + message.duration = Duration.fromAmino(object.duration); + } + return message; }, toAmino(message: MsgExtendLockup): MsgExtendLockupAmino { const obj: any = {}; @@ -826,6 +1028,8 @@ export const MsgExtendLockup = { }; } }; +GlobalDecoderRegistry.register(MsgExtendLockup.typeUrl, MsgExtendLockup); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgExtendLockup.aminoType, MsgExtendLockup.typeUrl); function createBaseMsgExtendLockupResponse(): MsgExtendLockupResponse { return { success: false @@ -833,6 +1037,16 @@ function createBaseMsgExtendLockupResponse(): MsgExtendLockupResponse { } export const MsgExtendLockupResponse = { typeUrl: "/osmosis.lockup.MsgExtendLockupResponse", + aminoType: "osmosis/lockup/extend-lockup-response", + is(o: any): o is MsgExtendLockupResponse { + return o && (o.$typeUrl === MsgExtendLockupResponse.typeUrl || typeof o.success === "boolean"); + }, + isSDK(o: any): o is MsgExtendLockupResponseSDKType { + return o && (o.$typeUrl === MsgExtendLockupResponse.typeUrl || typeof o.success === "boolean"); + }, + isAmino(o: any): o is MsgExtendLockupResponseAmino { + return o && (o.$typeUrl === MsgExtendLockupResponse.typeUrl || typeof o.success === "boolean"); + }, encode(message: MsgExtendLockupResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.success === true) { writer.uint32(8).bool(message.success); @@ -856,15 +1070,27 @@ export const MsgExtendLockupResponse = { } return message; }, + fromJSON(object: any): MsgExtendLockupResponse { + return { + success: isSet(object.success) ? Boolean(object.success) : false + }; + }, + toJSON(message: MsgExtendLockupResponse): unknown { + const obj: any = {}; + message.success !== undefined && (obj.success = message.success); + return obj; + }, fromPartial(object: Partial): MsgExtendLockupResponse { const message = createBaseMsgExtendLockupResponse(); message.success = object.success ?? false; return message; }, fromAmino(object: MsgExtendLockupResponseAmino): MsgExtendLockupResponse { - return { - success: object.success - }; + const message = createBaseMsgExtendLockupResponse(); + if (object.success !== undefined && object.success !== null) { + message.success = object.success; + } + return message; }, toAmino(message: MsgExtendLockupResponse): MsgExtendLockupResponseAmino { const obj: any = {}; @@ -893,6 +1119,8 @@ export const MsgExtendLockupResponse = { }; } }; +GlobalDecoderRegistry.register(MsgExtendLockupResponse.typeUrl, MsgExtendLockupResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgExtendLockupResponse.aminoType, MsgExtendLockupResponse.typeUrl); function createBaseMsgForceUnlock(): MsgForceUnlock { return { owner: "", @@ -902,6 +1130,16 @@ function createBaseMsgForceUnlock(): MsgForceUnlock { } export const MsgForceUnlock = { typeUrl: "/osmosis.lockup.MsgForceUnlock", + aminoType: "osmosis/lockup/force-unlock-tokens", + is(o: any): o is MsgForceUnlock { + return o && (o.$typeUrl === MsgForceUnlock.typeUrl || typeof o.owner === "string" && typeof o.ID === "bigint" && Array.isArray(o.coins) && (!o.coins.length || Coin.is(o.coins[0]))); + }, + isSDK(o: any): o is MsgForceUnlockSDKType { + return o && (o.$typeUrl === MsgForceUnlock.typeUrl || typeof o.owner === "string" && typeof o.ID === "bigint" && Array.isArray(o.coins) && (!o.coins.length || Coin.isSDK(o.coins[0]))); + }, + isAmino(o: any): o is MsgForceUnlockAmino { + return o && (o.$typeUrl === MsgForceUnlock.typeUrl || typeof o.owner === "string" && typeof o.ID === "bigint" && Array.isArray(o.coins) && (!o.coins.length || Coin.isAmino(o.coins[0]))); + }, encode(message: MsgForceUnlock, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.owner !== "") { writer.uint32(10).string(message.owner); @@ -937,6 +1175,24 @@ export const MsgForceUnlock = { } return message; }, + fromJSON(object: any): MsgForceUnlock { + return { + owner: isSet(object.owner) ? String(object.owner) : "", + ID: isSet(object.ID) ? BigInt(object.ID.toString()) : BigInt(0), + coins: Array.isArray(object?.coins) ? object.coins.map((e: any) => Coin.fromJSON(e)) : [] + }; + }, + toJSON(message: MsgForceUnlock): unknown { + const obj: any = {}; + message.owner !== undefined && (obj.owner = message.owner); + message.ID !== undefined && (obj.ID = (message.ID || BigInt(0)).toString()); + if (message.coins) { + obj.coins = message.coins.map(e => e ? Coin.toJSON(e) : undefined); + } else { + obj.coins = []; + } + return obj; + }, fromPartial(object: Partial): MsgForceUnlock { const message = createBaseMsgForceUnlock(); message.owner = object.owner ?? ""; @@ -945,11 +1201,15 @@ export const MsgForceUnlock = { return message; }, fromAmino(object: MsgForceUnlockAmino): MsgForceUnlock { - return { - owner: object.owner, - ID: BigInt(object.ID), - coins: Array.isArray(object?.coins) ? object.coins.map((e: any) => Coin.fromAmino(e)) : [] - }; + const message = createBaseMsgForceUnlock(); + if (object.owner !== undefined && object.owner !== null) { + message.owner = object.owner; + } + if (object.ID !== undefined && object.ID !== null) { + message.ID = BigInt(object.ID); + } + message.coins = object.coins?.map(e => Coin.fromAmino(e)) || []; + return message; }, toAmino(message: MsgForceUnlock): MsgForceUnlockAmino { const obj: any = {}; @@ -967,7 +1227,7 @@ export const MsgForceUnlock = { }, toAminoMsg(message: MsgForceUnlock): MsgForceUnlockAminoMsg { return { - type: "osmosis/lockup/force-unlock", + type: "osmosis/lockup/force-unlock-tokens", value: MsgForceUnlock.toAmino(message) }; }, @@ -984,6 +1244,8 @@ export const MsgForceUnlock = { }; } }; +GlobalDecoderRegistry.register(MsgForceUnlock.typeUrl, MsgForceUnlock); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgForceUnlock.aminoType, MsgForceUnlock.typeUrl); function createBaseMsgForceUnlockResponse(): MsgForceUnlockResponse { return { success: false @@ -991,6 +1253,16 @@ function createBaseMsgForceUnlockResponse(): MsgForceUnlockResponse { } export const MsgForceUnlockResponse = { typeUrl: "/osmosis.lockup.MsgForceUnlockResponse", + aminoType: "osmosis/lockup/force-unlock-response", + is(o: any): o is MsgForceUnlockResponse { + return o && (o.$typeUrl === MsgForceUnlockResponse.typeUrl || typeof o.success === "boolean"); + }, + isSDK(o: any): o is MsgForceUnlockResponseSDKType { + return o && (o.$typeUrl === MsgForceUnlockResponse.typeUrl || typeof o.success === "boolean"); + }, + isAmino(o: any): o is MsgForceUnlockResponseAmino { + return o && (o.$typeUrl === MsgForceUnlockResponse.typeUrl || typeof o.success === "boolean"); + }, encode(message: MsgForceUnlockResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.success === true) { writer.uint32(8).bool(message.success); @@ -1014,15 +1286,27 @@ export const MsgForceUnlockResponse = { } return message; }, + fromJSON(object: any): MsgForceUnlockResponse { + return { + success: isSet(object.success) ? Boolean(object.success) : false + }; + }, + toJSON(message: MsgForceUnlockResponse): unknown { + const obj: any = {}; + message.success !== undefined && (obj.success = message.success); + return obj; + }, fromPartial(object: Partial): MsgForceUnlockResponse { const message = createBaseMsgForceUnlockResponse(); message.success = object.success ?? false; return message; }, fromAmino(object: MsgForceUnlockResponseAmino): MsgForceUnlockResponse { - return { - success: object.success - }; + const message = createBaseMsgForceUnlockResponse(); + if (object.success !== undefined && object.success !== null) { + message.success = object.success; + } + return message; }, toAmino(message: MsgForceUnlockResponse): MsgForceUnlockResponseAmino { const obj: any = {}; @@ -1051,6 +1335,8 @@ export const MsgForceUnlockResponse = { }; } }; +GlobalDecoderRegistry.register(MsgForceUnlockResponse.typeUrl, MsgForceUnlockResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgForceUnlockResponse.aminoType, MsgForceUnlockResponse.typeUrl); function createBaseMsgSetRewardReceiverAddress(): MsgSetRewardReceiverAddress { return { owner: "", @@ -1060,6 +1346,16 @@ function createBaseMsgSetRewardReceiverAddress(): MsgSetRewardReceiverAddress { } export const MsgSetRewardReceiverAddress = { typeUrl: "/osmosis.lockup.MsgSetRewardReceiverAddress", + aminoType: "osmosis/lockup/set-reward-receiver-address", + is(o: any): o is MsgSetRewardReceiverAddress { + return o && (o.$typeUrl === MsgSetRewardReceiverAddress.typeUrl || typeof o.owner === "string" && typeof o.lockID === "bigint" && typeof o.rewardReceiver === "string"); + }, + isSDK(o: any): o is MsgSetRewardReceiverAddressSDKType { + return o && (o.$typeUrl === MsgSetRewardReceiverAddress.typeUrl || typeof o.owner === "string" && typeof o.lockID === "bigint" && typeof o.reward_receiver === "string"); + }, + isAmino(o: any): o is MsgSetRewardReceiverAddressAmino { + return o && (o.$typeUrl === MsgSetRewardReceiverAddress.typeUrl || typeof o.owner === "string" && typeof o.lockID === "bigint" && typeof o.reward_receiver === "string"); + }, encode(message: MsgSetRewardReceiverAddress, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.owner !== "") { writer.uint32(10).string(message.owner); @@ -1095,6 +1391,20 @@ export const MsgSetRewardReceiverAddress = { } return message; }, + fromJSON(object: any): MsgSetRewardReceiverAddress { + return { + owner: isSet(object.owner) ? String(object.owner) : "", + lockID: isSet(object.lockID) ? BigInt(object.lockID.toString()) : BigInt(0), + rewardReceiver: isSet(object.rewardReceiver) ? String(object.rewardReceiver) : "" + }; + }, + toJSON(message: MsgSetRewardReceiverAddress): unknown { + const obj: any = {}; + message.owner !== undefined && (obj.owner = message.owner); + message.lockID !== undefined && (obj.lockID = (message.lockID || BigInt(0)).toString()); + message.rewardReceiver !== undefined && (obj.rewardReceiver = message.rewardReceiver); + return obj; + }, fromPartial(object: Partial): MsgSetRewardReceiverAddress { const message = createBaseMsgSetRewardReceiverAddress(); message.owner = object.owner ?? ""; @@ -1103,11 +1413,17 @@ export const MsgSetRewardReceiverAddress = { return message; }, fromAmino(object: MsgSetRewardReceiverAddressAmino): MsgSetRewardReceiverAddress { - return { - owner: object.owner, - lockID: BigInt(object.lockID), - rewardReceiver: object.reward_receiver - }; + const message = createBaseMsgSetRewardReceiverAddress(); + if (object.owner !== undefined && object.owner !== null) { + message.owner = object.owner; + } + if (object.lockID !== undefined && object.lockID !== null) { + message.lockID = BigInt(object.lockID); + } + if (object.reward_receiver !== undefined && object.reward_receiver !== null) { + message.rewardReceiver = object.reward_receiver; + } + return message; }, toAmino(message: MsgSetRewardReceiverAddress): MsgSetRewardReceiverAddressAmino { const obj: any = {}; @@ -1138,6 +1454,8 @@ export const MsgSetRewardReceiverAddress = { }; } }; +GlobalDecoderRegistry.register(MsgSetRewardReceiverAddress.typeUrl, MsgSetRewardReceiverAddress); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgSetRewardReceiverAddress.aminoType, MsgSetRewardReceiverAddress.typeUrl); function createBaseMsgSetRewardReceiverAddressResponse(): MsgSetRewardReceiverAddressResponse { return { success: false @@ -1145,6 +1463,16 @@ function createBaseMsgSetRewardReceiverAddressResponse(): MsgSetRewardReceiverAd } export const MsgSetRewardReceiverAddressResponse = { typeUrl: "/osmosis.lockup.MsgSetRewardReceiverAddressResponse", + aminoType: "osmosis/lockup/set-reward-receiver-address-response", + is(o: any): o is MsgSetRewardReceiverAddressResponse { + return o && (o.$typeUrl === MsgSetRewardReceiverAddressResponse.typeUrl || typeof o.success === "boolean"); + }, + isSDK(o: any): o is MsgSetRewardReceiverAddressResponseSDKType { + return o && (o.$typeUrl === MsgSetRewardReceiverAddressResponse.typeUrl || typeof o.success === "boolean"); + }, + isAmino(o: any): o is MsgSetRewardReceiverAddressResponseAmino { + return o && (o.$typeUrl === MsgSetRewardReceiverAddressResponse.typeUrl || typeof o.success === "boolean"); + }, encode(message: MsgSetRewardReceiverAddressResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.success === true) { writer.uint32(8).bool(message.success); @@ -1168,15 +1496,27 @@ export const MsgSetRewardReceiverAddressResponse = { } return message; }, + fromJSON(object: any): MsgSetRewardReceiverAddressResponse { + return { + success: isSet(object.success) ? Boolean(object.success) : false + }; + }, + toJSON(message: MsgSetRewardReceiverAddressResponse): unknown { + const obj: any = {}; + message.success !== undefined && (obj.success = message.success); + return obj; + }, fromPartial(object: Partial): MsgSetRewardReceiverAddressResponse { const message = createBaseMsgSetRewardReceiverAddressResponse(); message.success = object.success ?? false; return message; }, fromAmino(object: MsgSetRewardReceiverAddressResponseAmino): MsgSetRewardReceiverAddressResponse { - return { - success: object.success - }; + const message = createBaseMsgSetRewardReceiverAddressResponse(); + if (object.success !== undefined && object.success !== null) { + message.success = object.success; + } + return message; }, toAmino(message: MsgSetRewardReceiverAddressResponse): MsgSetRewardReceiverAddressResponseAmino { const obj: any = {}; @@ -1204,4 +1544,6 @@ export const MsgSetRewardReceiverAddressResponse = { value: MsgSetRewardReceiverAddressResponse.encode(message).finish() }; } -}; \ No newline at end of file +}; +GlobalDecoderRegistry.register(MsgSetRewardReceiverAddressResponse.typeUrl, MsgSetRewardReceiverAddressResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgSetRewardReceiverAddressResponse.aminoType, MsgSetRewardReceiverAddressResponse.typeUrl); \ No newline at end of file diff --git a/packages/osmojs/src/codegen/osmosis/mint/v1beta1/genesis.ts b/packages/osmojs/src/codegen/osmosis/mint/v1beta1/genesis.ts index d3656b313..697b6509b 100644 --- a/packages/osmojs/src/codegen/osmosis/mint/v1beta1/genesis.ts +++ b/packages/osmojs/src/codegen/osmosis/mint/v1beta1/genesis.ts @@ -1,10 +1,12 @@ import { Minter, MinterAmino, MinterSDKType, Params, ParamsAmino, ParamsSDKType } from "./mint"; import { BinaryReader, BinaryWriter } from "../../../binary"; +import { isSet } from "../../../helpers"; +import { GlobalDecoderRegistry } from "../../../registry"; /** GenesisState defines the mint module's genesis state. */ export interface GenesisState { /** minter is an abstraction for holding current rewards information. */ minter: Minter; - /** params defines all the paramaters of the mint module. */ + /** params defines all the parameters of the mint module. */ params: Params; /** * reduction_started_epoch is the first epoch in which the reduction of mint @@ -20,13 +22,13 @@ export interface GenesisStateProtoMsg { export interface GenesisStateAmino { /** minter is an abstraction for holding current rewards information. */ minter?: MinterAmino; - /** params defines all the paramaters of the mint module. */ + /** params defines all the parameters of the mint module. */ params?: ParamsAmino; /** * reduction_started_epoch is the first epoch in which the reduction of mint * begins. */ - reduction_started_epoch: string; + reduction_started_epoch?: string; } export interface GenesisStateAminoMsg { type: "osmosis/mint/genesis-state"; @@ -47,6 +49,16 @@ function createBaseGenesisState(): GenesisState { } export const GenesisState = { typeUrl: "/osmosis.mint.v1beta1.GenesisState", + aminoType: "osmosis/mint/genesis-state", + is(o: any): o is GenesisState { + return o && (o.$typeUrl === GenesisState.typeUrl || Minter.is(o.minter) && Params.is(o.params) && typeof o.reductionStartedEpoch === "bigint"); + }, + isSDK(o: any): o is GenesisStateSDKType { + return o && (o.$typeUrl === GenesisState.typeUrl || Minter.isSDK(o.minter) && Params.isSDK(o.params) && typeof o.reduction_started_epoch === "bigint"); + }, + isAmino(o: any): o is GenesisStateAmino { + return o && (o.$typeUrl === GenesisState.typeUrl || Minter.isAmino(o.minter) && Params.isAmino(o.params) && typeof o.reduction_started_epoch === "bigint"); + }, encode(message: GenesisState, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.minter !== undefined) { Minter.encode(message.minter, writer.uint32(10).fork()).ldelim(); @@ -82,6 +94,20 @@ export const GenesisState = { } 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, + reductionStartedEpoch: isSet(object.reductionStartedEpoch) ? BigInt(object.reductionStartedEpoch.toString()) : BigInt(0) + }; + }, + 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); + message.reductionStartedEpoch !== undefined && (obj.reductionStartedEpoch = (message.reductionStartedEpoch || BigInt(0)).toString()); + return obj; + }, fromPartial(object: Partial): GenesisState { const message = createBaseGenesisState(); message.minter = object.minter !== undefined && object.minter !== null ? Minter.fromPartial(object.minter) : undefined; @@ -90,11 +116,17 @@ export const GenesisState = { return message; }, fromAmino(object: GenesisStateAmino): GenesisState { - return { - minter: object?.minter ? Minter.fromAmino(object.minter) : undefined, - params: object?.params ? Params.fromAmino(object.params) : undefined, - reductionStartedEpoch: BigInt(object.reduction_started_epoch) - }; + const message = createBaseGenesisState(); + if (object.minter !== undefined && object.minter !== null) { + message.minter = Minter.fromAmino(object.minter); + } + if (object.params !== undefined && object.params !== null) { + message.params = Params.fromAmino(object.params); + } + if (object.reduction_started_epoch !== undefined && object.reduction_started_epoch !== null) { + message.reductionStartedEpoch = BigInt(object.reduction_started_epoch); + } + return message; }, toAmino(message: GenesisState): GenesisStateAmino { const obj: any = {}; @@ -124,4 +156,6 @@ export const GenesisState = { value: GenesisState.encode(message).finish() }; } -}; \ No newline at end of file +}; +GlobalDecoderRegistry.register(GenesisState.typeUrl, GenesisState); +GlobalDecoderRegistry.registerAminoProtoMapping(GenesisState.aminoType, GenesisState.typeUrl); \ No newline at end of file diff --git a/packages/osmojs/src/codegen/osmosis/mint/v1beta1/mint.ts b/packages/osmojs/src/codegen/osmosis/mint/v1beta1/mint.ts index 650bf2cce..7cceebf50 100644 --- a/packages/osmojs/src/codegen/osmosis/mint/v1beta1/mint.ts +++ b/packages/osmojs/src/codegen/osmosis/mint/v1beta1/mint.ts @@ -1,5 +1,7 @@ import { BinaryReader, BinaryWriter } from "../../../binary"; import { Decimal } from "@cosmjs/math"; +import { isSet } from "../../../helpers"; +import { GlobalDecoderRegistry } from "../../../registry"; /** Minter represents the minting state. */ export interface Minter { /** epoch_provisions represent rewards for the current epoch. */ @@ -12,7 +14,7 @@ export interface MinterProtoMsg { /** Minter represents the minting state. */ export interface MinterAmino { /** epoch_provisions represent rewards for the current epoch. */ - epoch_provisions: string; + epoch_provisions?: string; } export interface MinterAminoMsg { type: "osmosis/mint/minter"; @@ -41,8 +43,8 @@ export interface WeightedAddressProtoMsg { * tokens to be minted to the address. */ export interface WeightedAddressAmino { - address: string; - weight: string; + address?: string; + weight?: string; } export interface WeightedAddressAminoMsg { type: "osmosis/mint/weighted-address"; @@ -98,22 +100,22 @@ export interface DistributionProportionsAmino { * staking defines the proportion of the minted mint_denom that is to be * allocated as staking rewards. */ - staking: string; + staking?: string; /** * pool_incentives defines the proportion of the minted mint_denom that is * to be allocated as pool incentives. */ - pool_incentives: string; + pool_incentives?: string; /** * developer_rewards defines the proportion of the minted mint_denom that is * to be allocated to developer rewards address. */ - developer_rewards: string; + developer_rewards?: string; /** * community_pool defines the proportion of the minted mint_denom that is * to be allocated to the community pool. */ - community_pool: string; + community_pool?: string; } export interface DistributionProportionsAminoMsg { type: "osmosis/mint/distribution-proportions"; @@ -174,21 +176,21 @@ export interface ParamsProtoMsg { /** Params holds parameters for the x/mint module. */ export interface ParamsAmino { /** mint_denom is the denom of the coin to mint. */ - mint_denom: string; + mint_denom?: string; /** genesis_epoch_provisions epoch provisions from the first epoch. */ - genesis_epoch_provisions: string; + genesis_epoch_provisions?: string; /** epoch_identifier mint epoch identifier e.g. (day, week). */ - epoch_identifier: string; + epoch_identifier?: string; /** * reduction_period_in_epochs the number of epochs it takes * to reduce the rewards. */ - reduction_period_in_epochs: string; + reduction_period_in_epochs?: string; /** * reduction_factor is the reduction multiplier to execute * at the end of each period set by reduction_period_in_epochs. */ - reduction_factor: string; + reduction_factor?: string; /** * distribution_proportions defines the distribution proportions of the minted * denom. In other words, defines which stakeholders will receive the minted @@ -201,12 +203,12 @@ export interface ParamsAmino { * address receives is: epoch_provisions * * distribution_proportions.developer_rewards * Address's Weight. */ - weighted_developer_rewards_receivers: WeightedAddressAmino[]; + weighted_developer_rewards_receivers?: WeightedAddressAmino[]; /** * minting_rewards_distribution_start_epoch start epoch to distribute minting * rewards */ - minting_rewards_distribution_start_epoch: string; + minting_rewards_distribution_start_epoch?: string; } export interface ParamsAminoMsg { type: "osmosis/mint/params"; @@ -230,6 +232,16 @@ function createBaseMinter(): Minter { } export const Minter = { typeUrl: "/osmosis.mint.v1beta1.Minter", + aminoType: "osmosis/mint/minter", + is(o: any): o is Minter { + return o && (o.$typeUrl === Minter.typeUrl || typeof o.epochProvisions === "string"); + }, + isSDK(o: any): o is MinterSDKType { + return o && (o.$typeUrl === Minter.typeUrl || typeof o.epoch_provisions === "string"); + }, + isAmino(o: any): o is MinterAmino { + return o && (o.$typeUrl === Minter.typeUrl || typeof o.epoch_provisions === "string"); + }, encode(message: Minter, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.epochProvisions !== "") { writer.uint32(10).string(Decimal.fromUserInput(message.epochProvisions, 18).atomics); @@ -253,15 +265,27 @@ export const Minter = { } return message; }, + fromJSON(object: any): Minter { + return { + epochProvisions: isSet(object.epochProvisions) ? String(object.epochProvisions) : "" + }; + }, + toJSON(message: Minter): unknown { + const obj: any = {}; + message.epochProvisions !== undefined && (obj.epochProvisions = message.epochProvisions); + return obj; + }, fromPartial(object: Partial): Minter { const message = createBaseMinter(); message.epochProvisions = object.epochProvisions ?? ""; return message; }, fromAmino(object: MinterAmino): Minter { - return { - epochProvisions: object.epoch_provisions - }; + const message = createBaseMinter(); + if (object.epoch_provisions !== undefined && object.epoch_provisions !== null) { + message.epochProvisions = object.epoch_provisions; + } + return message; }, toAmino(message: Minter): MinterAmino { const obj: any = {}; @@ -290,6 +314,8 @@ export const Minter = { }; } }; +GlobalDecoderRegistry.register(Minter.typeUrl, Minter); +GlobalDecoderRegistry.registerAminoProtoMapping(Minter.aminoType, Minter.typeUrl); function createBaseWeightedAddress(): WeightedAddress { return { address: "", @@ -298,6 +324,16 @@ function createBaseWeightedAddress(): WeightedAddress { } export const WeightedAddress = { typeUrl: "/osmosis.mint.v1beta1.WeightedAddress", + aminoType: "osmosis/mint/weighted-address", + is(o: any): o is WeightedAddress { + return o && (o.$typeUrl === WeightedAddress.typeUrl || typeof o.address === "string" && typeof o.weight === "string"); + }, + isSDK(o: any): o is WeightedAddressSDKType { + return o && (o.$typeUrl === WeightedAddress.typeUrl || typeof o.address === "string" && typeof o.weight === "string"); + }, + isAmino(o: any): o is WeightedAddressAmino { + return o && (o.$typeUrl === WeightedAddress.typeUrl || typeof o.address === "string" && typeof o.weight === "string"); + }, encode(message: WeightedAddress, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.address !== "") { writer.uint32(10).string(message.address); @@ -327,6 +363,18 @@ export const WeightedAddress = { } return message; }, + fromJSON(object: any): WeightedAddress { + return { + address: isSet(object.address) ? String(object.address) : "", + weight: isSet(object.weight) ? String(object.weight) : "" + }; + }, + toJSON(message: WeightedAddress): unknown { + const obj: any = {}; + message.address !== undefined && (obj.address = message.address); + message.weight !== undefined && (obj.weight = message.weight); + return obj; + }, fromPartial(object: Partial): WeightedAddress { const message = createBaseWeightedAddress(); message.address = object.address ?? ""; @@ -334,10 +382,14 @@ export const WeightedAddress = { return message; }, fromAmino(object: WeightedAddressAmino): WeightedAddress { - return { - address: object.address, - weight: object.weight - }; + const message = createBaseWeightedAddress(); + if (object.address !== undefined && object.address !== null) { + message.address = object.address; + } + if (object.weight !== undefined && object.weight !== null) { + message.weight = object.weight; + } + return message; }, toAmino(message: WeightedAddress): WeightedAddressAmino { const obj: any = {}; @@ -367,6 +419,8 @@ export const WeightedAddress = { }; } }; +GlobalDecoderRegistry.register(WeightedAddress.typeUrl, WeightedAddress); +GlobalDecoderRegistry.registerAminoProtoMapping(WeightedAddress.aminoType, WeightedAddress.typeUrl); function createBaseDistributionProportions(): DistributionProportions { return { staking: "", @@ -377,6 +431,16 @@ function createBaseDistributionProportions(): DistributionProportions { } export const DistributionProportions = { typeUrl: "/osmosis.mint.v1beta1.DistributionProportions", + aminoType: "osmosis/mint/distribution-proportions", + is(o: any): o is DistributionProportions { + return o && (o.$typeUrl === DistributionProportions.typeUrl || typeof o.staking === "string" && typeof o.poolIncentives === "string" && typeof o.developerRewards === "string" && typeof o.communityPool === "string"); + }, + isSDK(o: any): o is DistributionProportionsSDKType { + return o && (o.$typeUrl === DistributionProportions.typeUrl || typeof o.staking === "string" && typeof o.pool_incentives === "string" && typeof o.developer_rewards === "string" && typeof o.community_pool === "string"); + }, + isAmino(o: any): o is DistributionProportionsAmino { + return o && (o.$typeUrl === DistributionProportions.typeUrl || typeof o.staking === "string" && typeof o.pool_incentives === "string" && typeof o.developer_rewards === "string" && typeof o.community_pool === "string"); + }, encode(message: DistributionProportions, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.staking !== "") { writer.uint32(10).string(Decimal.fromUserInput(message.staking, 18).atomics); @@ -418,6 +482,22 @@ export const DistributionProportions = { } return message; }, + fromJSON(object: any): DistributionProportions { + return { + staking: isSet(object.staking) ? String(object.staking) : "", + poolIncentives: isSet(object.poolIncentives) ? String(object.poolIncentives) : "", + developerRewards: isSet(object.developerRewards) ? String(object.developerRewards) : "", + communityPool: isSet(object.communityPool) ? String(object.communityPool) : "" + }; + }, + toJSON(message: DistributionProportions): unknown { + const obj: any = {}; + message.staking !== undefined && (obj.staking = message.staking); + message.poolIncentives !== undefined && (obj.poolIncentives = message.poolIncentives); + message.developerRewards !== undefined && (obj.developerRewards = message.developerRewards); + message.communityPool !== undefined && (obj.communityPool = message.communityPool); + return obj; + }, fromPartial(object: Partial): DistributionProportions { const message = createBaseDistributionProportions(); message.staking = object.staking ?? ""; @@ -427,12 +507,20 @@ export const DistributionProportions = { return message; }, fromAmino(object: DistributionProportionsAmino): DistributionProportions { - return { - staking: object.staking, - poolIncentives: object.pool_incentives, - developerRewards: object.developer_rewards, - communityPool: object.community_pool - }; + const message = createBaseDistributionProportions(); + if (object.staking !== undefined && object.staking !== null) { + message.staking = object.staking; + } + if (object.pool_incentives !== undefined && object.pool_incentives !== null) { + message.poolIncentives = object.pool_incentives; + } + if (object.developer_rewards !== undefined && object.developer_rewards !== null) { + message.developerRewards = object.developer_rewards; + } + if (object.community_pool !== undefined && object.community_pool !== null) { + message.communityPool = object.community_pool; + } + return message; }, toAmino(message: DistributionProportions): DistributionProportionsAmino { const obj: any = {}; @@ -464,6 +552,8 @@ export const DistributionProportions = { }; } }; +GlobalDecoderRegistry.register(DistributionProportions.typeUrl, DistributionProportions); +GlobalDecoderRegistry.registerAminoProtoMapping(DistributionProportions.aminoType, DistributionProportions.typeUrl); function createBaseParams(): Params { return { mintDenom: "", @@ -478,6 +568,16 @@ function createBaseParams(): Params { } export const Params = { typeUrl: "/osmosis.mint.v1beta1.Params", + aminoType: "osmosis/mint/params", + is(o: any): o is Params { + return o && (o.$typeUrl === Params.typeUrl || typeof o.mintDenom === "string" && typeof o.genesisEpochProvisions === "string" && typeof o.epochIdentifier === "string" && typeof o.reductionPeriodInEpochs === "bigint" && typeof o.reductionFactor === "string" && DistributionProportions.is(o.distributionProportions) && Array.isArray(o.weightedDeveloperRewardsReceivers) && (!o.weightedDeveloperRewardsReceivers.length || WeightedAddress.is(o.weightedDeveloperRewardsReceivers[0])) && typeof o.mintingRewardsDistributionStartEpoch === "bigint"); + }, + isSDK(o: any): o is ParamsSDKType { + return o && (o.$typeUrl === Params.typeUrl || typeof o.mint_denom === "string" && typeof o.genesis_epoch_provisions === "string" && typeof o.epoch_identifier === "string" && typeof o.reduction_period_in_epochs === "bigint" && typeof o.reduction_factor === "string" && DistributionProportions.isSDK(o.distribution_proportions) && Array.isArray(o.weighted_developer_rewards_receivers) && (!o.weighted_developer_rewards_receivers.length || WeightedAddress.isSDK(o.weighted_developer_rewards_receivers[0])) && typeof o.minting_rewards_distribution_start_epoch === "bigint"); + }, + isAmino(o: any): o is ParamsAmino { + return o && (o.$typeUrl === Params.typeUrl || typeof o.mint_denom === "string" && typeof o.genesis_epoch_provisions === "string" && typeof o.epoch_identifier === "string" && typeof o.reduction_period_in_epochs === "bigint" && typeof o.reduction_factor === "string" && DistributionProportions.isAmino(o.distribution_proportions) && Array.isArray(o.weighted_developer_rewards_receivers) && (!o.weighted_developer_rewards_receivers.length || WeightedAddress.isAmino(o.weighted_developer_rewards_receivers[0])) && typeof o.minting_rewards_distribution_start_epoch === "bigint"); + }, encode(message: Params, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.mintDenom !== "") { writer.uint32(10).string(message.mintDenom); @@ -543,6 +643,34 @@ export const Params = { } return message; }, + fromJSON(object: any): Params { + return { + mintDenom: isSet(object.mintDenom) ? String(object.mintDenom) : "", + genesisEpochProvisions: isSet(object.genesisEpochProvisions) ? String(object.genesisEpochProvisions) : "", + epochIdentifier: isSet(object.epochIdentifier) ? String(object.epochIdentifier) : "", + reductionPeriodInEpochs: isSet(object.reductionPeriodInEpochs) ? BigInt(object.reductionPeriodInEpochs.toString()) : BigInt(0), + reductionFactor: isSet(object.reductionFactor) ? String(object.reductionFactor) : "", + distributionProportions: isSet(object.distributionProportions) ? DistributionProportions.fromJSON(object.distributionProportions) : undefined, + weightedDeveloperRewardsReceivers: Array.isArray(object?.weightedDeveloperRewardsReceivers) ? object.weightedDeveloperRewardsReceivers.map((e: any) => WeightedAddress.fromJSON(e)) : [], + mintingRewardsDistributionStartEpoch: isSet(object.mintingRewardsDistributionStartEpoch) ? BigInt(object.mintingRewardsDistributionStartEpoch.toString()) : BigInt(0) + }; + }, + toJSON(message: Params): unknown { + const obj: any = {}; + message.mintDenom !== undefined && (obj.mintDenom = message.mintDenom); + message.genesisEpochProvisions !== undefined && (obj.genesisEpochProvisions = message.genesisEpochProvisions); + message.epochIdentifier !== undefined && (obj.epochIdentifier = message.epochIdentifier); + message.reductionPeriodInEpochs !== undefined && (obj.reductionPeriodInEpochs = (message.reductionPeriodInEpochs || BigInt(0)).toString()); + message.reductionFactor !== undefined && (obj.reductionFactor = message.reductionFactor); + message.distributionProportions !== undefined && (obj.distributionProportions = message.distributionProportions ? DistributionProportions.toJSON(message.distributionProportions) : undefined); + if (message.weightedDeveloperRewardsReceivers) { + obj.weightedDeveloperRewardsReceivers = message.weightedDeveloperRewardsReceivers.map(e => e ? WeightedAddress.toJSON(e) : undefined); + } else { + obj.weightedDeveloperRewardsReceivers = []; + } + message.mintingRewardsDistributionStartEpoch !== undefined && (obj.mintingRewardsDistributionStartEpoch = (message.mintingRewardsDistributionStartEpoch || BigInt(0)).toString()); + return obj; + }, fromPartial(object: Partial): Params { const message = createBaseParams(); message.mintDenom = object.mintDenom ?? ""; @@ -556,16 +684,30 @@ export const Params = { return message; }, fromAmino(object: ParamsAmino): Params { - return { - mintDenom: object.mint_denom, - genesisEpochProvisions: object.genesis_epoch_provisions, - epochIdentifier: object.epoch_identifier, - reductionPeriodInEpochs: BigInt(object.reduction_period_in_epochs), - reductionFactor: object.reduction_factor, - distributionProportions: object?.distribution_proportions ? DistributionProportions.fromAmino(object.distribution_proportions) : undefined, - weightedDeveloperRewardsReceivers: Array.isArray(object?.weighted_developer_rewards_receivers) ? object.weighted_developer_rewards_receivers.map((e: any) => WeightedAddress.fromAmino(e)) : [], - mintingRewardsDistributionStartEpoch: BigInt(object.minting_rewards_distribution_start_epoch) - }; + const message = createBaseParams(); + if (object.mint_denom !== undefined && object.mint_denom !== null) { + message.mintDenom = object.mint_denom; + } + if (object.genesis_epoch_provisions !== undefined && object.genesis_epoch_provisions !== null) { + message.genesisEpochProvisions = object.genesis_epoch_provisions; + } + if (object.epoch_identifier !== undefined && object.epoch_identifier !== null) { + message.epochIdentifier = object.epoch_identifier; + } + if (object.reduction_period_in_epochs !== undefined && object.reduction_period_in_epochs !== null) { + message.reductionPeriodInEpochs = BigInt(object.reduction_period_in_epochs); + } + if (object.reduction_factor !== undefined && object.reduction_factor !== null) { + message.reductionFactor = object.reduction_factor; + } + if (object.distribution_proportions !== undefined && object.distribution_proportions !== null) { + message.distributionProportions = DistributionProportions.fromAmino(object.distribution_proportions); + } + message.weightedDeveloperRewardsReceivers = object.weighted_developer_rewards_receivers?.map(e => WeightedAddress.fromAmino(e)) || []; + if (object.minting_rewards_distribution_start_epoch !== undefined && object.minting_rewards_distribution_start_epoch !== null) { + message.mintingRewardsDistributionStartEpoch = BigInt(object.minting_rewards_distribution_start_epoch); + } + return message; }, toAmino(message: Params): ParamsAmino { const obj: any = {}; @@ -604,4 +746,6 @@ export const Params = { value: Params.encode(message).finish() }; } -}; \ No newline at end of file +}; +GlobalDecoderRegistry.register(Params.typeUrl, Params); +GlobalDecoderRegistry.registerAminoProtoMapping(Params.aminoType, Params.typeUrl); \ No newline at end of file diff --git a/packages/osmojs/src/codegen/osmosis/mint/v1beta1/query.ts b/packages/osmojs/src/codegen/osmosis/mint/v1beta1/query.ts index b691c294a..7a63aa3cb 100644 --- a/packages/osmojs/src/codegen/osmosis/mint/v1beta1/query.ts +++ b/packages/osmojs/src/codegen/osmosis/mint/v1beta1/query.ts @@ -1,5 +1,7 @@ import { Params, ParamsAmino, ParamsSDKType } from "./mint"; import { BinaryReader, BinaryWriter } from "../../../binary"; +import { GlobalDecoderRegistry } from "../../../registry"; +import { isSet, bytesFromBase64, base64FromBytes } from "../../../helpers"; /** QueryParamsRequest is the request type for the Query/Params RPC method. */ export interface QueryParamsRequest {} export interface QueryParamsRequestProtoMsg { @@ -77,7 +79,7 @@ export interface QueryEpochProvisionsResponseProtoMsg { */ export interface QueryEpochProvisionsResponseAmino { /** epoch_provisions is the current minting per epoch provisions value. */ - epoch_provisions: Uint8Array; + epoch_provisions?: string; } export interface QueryEpochProvisionsResponseAminoMsg { type: "osmosis/mint/query-epoch-provisions-response"; @@ -95,6 +97,16 @@ function createBaseQueryParamsRequest(): QueryParamsRequest { } export const QueryParamsRequest = { typeUrl: "/osmosis.mint.v1beta1.QueryParamsRequest", + aminoType: "osmosis/mint/query-params-request", + is(o: any): o is QueryParamsRequest { + return o && o.$typeUrl === QueryParamsRequest.typeUrl; + }, + isSDK(o: any): o is QueryParamsRequestSDKType { + return o && o.$typeUrl === QueryParamsRequest.typeUrl; + }, + isAmino(o: any): o is QueryParamsRequestAmino { + return o && o.$typeUrl === QueryParamsRequest.typeUrl; + }, encode(_: QueryParamsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, @@ -112,12 +124,20 @@ export const QueryParamsRequest = { } return message; }, + fromJSON(_: any): QueryParamsRequest { + return {}; + }, + toJSON(_: QueryParamsRequest): unknown { + const obj: any = {}; + return obj; + }, fromPartial(_: Partial): QueryParamsRequest { const message = createBaseQueryParamsRequest(); return message; }, fromAmino(_: QueryParamsRequestAmino): QueryParamsRequest { - return {}; + const message = createBaseQueryParamsRequest(); + return message; }, toAmino(_: QueryParamsRequest): QueryParamsRequestAmino { const obj: any = {}; @@ -145,6 +165,8 @@ export const QueryParamsRequest = { }; } }; +GlobalDecoderRegistry.register(QueryParamsRequest.typeUrl, QueryParamsRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryParamsRequest.aminoType, QueryParamsRequest.typeUrl); function createBaseQueryParamsResponse(): QueryParamsResponse { return { params: Params.fromPartial({}) @@ -152,6 +174,16 @@ function createBaseQueryParamsResponse(): QueryParamsResponse { } export const QueryParamsResponse = { typeUrl: "/osmosis.mint.v1beta1.QueryParamsResponse", + aminoType: "osmosis/mint/query-params-response", + is(o: any): o is QueryParamsResponse { + return o && (o.$typeUrl === QueryParamsResponse.typeUrl || Params.is(o.params)); + }, + isSDK(o: any): o is QueryParamsResponseSDKType { + return o && (o.$typeUrl === QueryParamsResponse.typeUrl || Params.isSDK(o.params)); + }, + isAmino(o: any): o is QueryParamsResponseAmino { + return o && (o.$typeUrl === QueryParamsResponse.typeUrl || Params.isAmino(o.params)); + }, encode(message: QueryParamsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.params !== undefined) { Params.encode(message.params, writer.uint32(10).fork()).ldelim(); @@ -175,15 +207,27 @@ export const QueryParamsResponse = { } return message; }, + fromJSON(object: any): QueryParamsResponse { + 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; + }, fromPartial(object: Partial): QueryParamsResponse { const message = createBaseQueryParamsResponse(); message.params = object.params !== undefined && object.params !== null ? Params.fromPartial(object.params) : undefined; return message; }, fromAmino(object: QueryParamsResponseAmino): QueryParamsResponse { - return { - params: object?.params ? Params.fromAmino(object.params) : undefined - }; + const message = createBaseQueryParamsResponse(); + if (object.params !== undefined && object.params !== null) { + message.params = Params.fromAmino(object.params); + } + return message; }, toAmino(message: QueryParamsResponse): QueryParamsResponseAmino { const obj: any = {}; @@ -212,11 +256,23 @@ export const QueryParamsResponse = { }; } }; +GlobalDecoderRegistry.register(QueryParamsResponse.typeUrl, QueryParamsResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryParamsResponse.aminoType, QueryParamsResponse.typeUrl); function createBaseQueryEpochProvisionsRequest(): QueryEpochProvisionsRequest { return {}; } export const QueryEpochProvisionsRequest = { typeUrl: "/osmosis.mint.v1beta1.QueryEpochProvisionsRequest", + aminoType: "osmosis/mint/query-epoch-provisions-request", + is(o: any): o is QueryEpochProvisionsRequest { + return o && o.$typeUrl === QueryEpochProvisionsRequest.typeUrl; + }, + isSDK(o: any): o is QueryEpochProvisionsRequestSDKType { + return o && o.$typeUrl === QueryEpochProvisionsRequest.typeUrl; + }, + isAmino(o: any): o is QueryEpochProvisionsRequestAmino { + return o && o.$typeUrl === QueryEpochProvisionsRequest.typeUrl; + }, encode(_: QueryEpochProvisionsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, @@ -234,12 +290,20 @@ export const QueryEpochProvisionsRequest = { } return message; }, + fromJSON(_: any): QueryEpochProvisionsRequest { + return {}; + }, + toJSON(_: QueryEpochProvisionsRequest): unknown { + const obj: any = {}; + return obj; + }, fromPartial(_: Partial): QueryEpochProvisionsRequest { const message = createBaseQueryEpochProvisionsRequest(); return message; }, fromAmino(_: QueryEpochProvisionsRequestAmino): QueryEpochProvisionsRequest { - return {}; + const message = createBaseQueryEpochProvisionsRequest(); + return message; }, toAmino(_: QueryEpochProvisionsRequest): QueryEpochProvisionsRequestAmino { const obj: any = {}; @@ -267,6 +331,8 @@ export const QueryEpochProvisionsRequest = { }; } }; +GlobalDecoderRegistry.register(QueryEpochProvisionsRequest.typeUrl, QueryEpochProvisionsRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryEpochProvisionsRequest.aminoType, QueryEpochProvisionsRequest.typeUrl); function createBaseQueryEpochProvisionsResponse(): QueryEpochProvisionsResponse { return { epochProvisions: new Uint8Array() @@ -274,6 +340,16 @@ function createBaseQueryEpochProvisionsResponse(): QueryEpochProvisionsResponse } export const QueryEpochProvisionsResponse = { typeUrl: "/osmosis.mint.v1beta1.QueryEpochProvisionsResponse", + aminoType: "osmosis/mint/query-epoch-provisions-response", + is(o: any): o is QueryEpochProvisionsResponse { + return o && (o.$typeUrl === QueryEpochProvisionsResponse.typeUrl || o.epochProvisions instanceof Uint8Array || typeof o.epochProvisions === "string"); + }, + isSDK(o: any): o is QueryEpochProvisionsResponseSDKType { + return o && (o.$typeUrl === QueryEpochProvisionsResponse.typeUrl || o.epoch_provisions instanceof Uint8Array || typeof o.epoch_provisions === "string"); + }, + isAmino(o: any): o is QueryEpochProvisionsResponseAmino { + return o && (o.$typeUrl === QueryEpochProvisionsResponse.typeUrl || o.epoch_provisions instanceof Uint8Array || typeof o.epoch_provisions === "string"); + }, encode(message: QueryEpochProvisionsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.epochProvisions.length !== 0) { writer.uint32(10).bytes(message.epochProvisions); @@ -297,19 +373,31 @@ export const QueryEpochProvisionsResponse = { } return message; }, + fromJSON(object: any): QueryEpochProvisionsResponse { + return { + epochProvisions: isSet(object.epochProvisions) ? bytesFromBase64(object.epochProvisions) : new Uint8Array() + }; + }, + toJSON(message: QueryEpochProvisionsResponse): unknown { + const obj: any = {}; + message.epochProvisions !== undefined && (obj.epochProvisions = base64FromBytes(message.epochProvisions !== undefined ? message.epochProvisions : new Uint8Array())); + return obj; + }, fromPartial(object: Partial): QueryEpochProvisionsResponse { const message = createBaseQueryEpochProvisionsResponse(); message.epochProvisions = object.epochProvisions ?? new Uint8Array(); return message; }, fromAmino(object: QueryEpochProvisionsResponseAmino): QueryEpochProvisionsResponse { - return { - epochProvisions: object.epoch_provisions - }; + const message = createBaseQueryEpochProvisionsResponse(); + if (object.epoch_provisions !== undefined && object.epoch_provisions !== null) { + message.epochProvisions = bytesFromBase64(object.epoch_provisions); + } + return message; }, toAmino(message: QueryEpochProvisionsResponse): QueryEpochProvisionsResponseAmino { const obj: any = {}; - obj.epoch_provisions = message.epochProvisions; + obj.epoch_provisions = message.epochProvisions ? base64FromBytes(message.epochProvisions) : undefined; return obj; }, fromAminoMsg(object: QueryEpochProvisionsResponseAminoMsg): QueryEpochProvisionsResponse { @@ -333,4 +421,6 @@ export const QueryEpochProvisionsResponse = { value: QueryEpochProvisionsResponse.encode(message).finish() }; } -}; \ No newline at end of file +}; +GlobalDecoderRegistry.register(QueryEpochProvisionsResponse.typeUrl, QueryEpochProvisionsResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryEpochProvisionsResponse.aminoType, QueryEpochProvisionsResponse.typeUrl); \ No newline at end of file diff --git a/packages/osmojs/src/codegen/osmosis/pool-incentives/v1beta1/incentives.ts b/packages/osmojs/src/codegen/osmosis/pool-incentives/v1beta1/incentives.ts deleted file mode 100644 index 8dac18276..000000000 --- a/packages/osmojs/src/codegen/osmosis/pool-incentives/v1beta1/incentives.ts +++ /dev/null @@ -1,582 +0,0 @@ -import { Duration, DurationAmino, DurationSDKType } from "../../../google/protobuf/duration"; -import { BinaryReader, BinaryWriter } from "../../../binary"; -export interface Params { - /** - * minted_denom is the denomination of the coin expected to be minted by the - * minting module. Pool-incentives module doesn’t actually mint the coin - * itself, but rather manages the distribution of coins that matches the - * defined minted_denom. - */ - mintedDenom: string; -} -export interface ParamsProtoMsg { - typeUrl: "/osmosis.poolincentives.v1beta1.Params"; - value: Uint8Array; -} -export interface ParamsAmino { - /** - * minted_denom is the denomination of the coin expected to be minted by the - * minting module. Pool-incentives module doesn’t actually mint the coin - * itself, but rather manages the distribution of coins that matches the - * defined minted_denom. - */ - minted_denom: string; -} -export interface ParamsAminoMsg { - type: "osmosis/poolincentives/params"; - value: ParamsAmino; -} -export interface ParamsSDKType { - minted_denom: string; -} -export interface LockableDurationsInfo { - lockableDurations: Duration[]; -} -export interface LockableDurationsInfoProtoMsg { - typeUrl: "/osmosis.poolincentives.v1beta1.LockableDurationsInfo"; - value: Uint8Array; -} -export interface LockableDurationsInfoAmino { - lockable_durations: DurationAmino[]; -} -export interface LockableDurationsInfoAminoMsg { - type: "osmosis/poolincentives/lockable-durations-info"; - value: LockableDurationsInfoAmino; -} -export interface LockableDurationsInfoSDKType { - lockable_durations: DurationSDKType[]; -} -export interface DistrInfo { - totalWeight: string; - records: DistrRecord[]; -} -export interface DistrInfoProtoMsg { - typeUrl: "/osmosis.poolincentives.v1beta1.DistrInfo"; - value: Uint8Array; -} -export interface DistrInfoAmino { - total_weight: string; - records: DistrRecordAmino[]; -} -export interface DistrInfoAminoMsg { - type: "osmosis/poolincentives/distr-info"; - value: DistrInfoAmino; -} -export interface DistrInfoSDKType { - total_weight: string; - records: DistrRecordSDKType[]; -} -export interface DistrRecord { - gaugeId: bigint; - weight: string; -} -export interface DistrRecordProtoMsg { - typeUrl: "/osmosis.poolincentives.v1beta1.DistrRecord"; - value: Uint8Array; -} -export interface DistrRecordAmino { - gauge_id: string; - weight: string; -} -export interface DistrRecordAminoMsg { - type: "osmosis/poolincentives/distr-record"; - value: DistrRecordAmino; -} -export interface DistrRecordSDKType { - gauge_id: bigint; - weight: string; -} -export interface PoolToGauge { - poolId: bigint; - gaugeId: bigint; - duration: Duration; -} -export interface PoolToGaugeProtoMsg { - typeUrl: "/osmosis.poolincentives.v1beta1.PoolToGauge"; - value: Uint8Array; -} -export interface PoolToGaugeAmino { - pool_id: string; - gauge_id: string; - duration?: DurationAmino; -} -export interface PoolToGaugeAminoMsg { - type: "osmosis/poolincentives/pool-to-gauge"; - value: PoolToGaugeAmino; -} -export interface PoolToGaugeSDKType { - pool_id: bigint; - gauge_id: bigint; - duration: DurationSDKType; -} -export interface PoolToGauges { - poolToGauge: PoolToGauge[]; -} -export interface PoolToGaugesProtoMsg { - typeUrl: "/osmosis.poolincentives.v1beta1.PoolToGauges"; - value: Uint8Array; -} -export interface PoolToGaugesAmino { - pool_to_gauge: PoolToGaugeAmino[]; -} -export interface PoolToGaugesAminoMsg { - type: "osmosis/poolincentives/pool-to-gauges"; - value: PoolToGaugesAmino; -} -export interface PoolToGaugesSDKType { - pool_to_gauge: PoolToGaugeSDKType[]; -} -function createBaseParams(): Params { - return { - mintedDenom: "" - }; -} -export const Params = { - typeUrl: "/osmosis.poolincentives.v1beta1.Params", - encode(message: Params, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { - if (message.mintedDenom !== "") { - writer.uint32(10).string(message.mintedDenom); - } - return writer; - }, - decode(input: BinaryReader | Uint8Array, length?: number): Params { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseParams(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.mintedDenom = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - fromPartial(object: Partial): Params { - const message = createBaseParams(); - message.mintedDenom = object.mintedDenom ?? ""; - return message; - }, - fromAmino(object: ParamsAmino): Params { - return { - mintedDenom: object.minted_denom - }; - }, - toAmino(message: Params): ParamsAmino { - const obj: any = {}; - obj.minted_denom = message.mintedDenom; - return obj; - }, - fromAminoMsg(object: ParamsAminoMsg): Params { - return Params.fromAmino(object.value); - }, - toAminoMsg(message: Params): ParamsAminoMsg { - return { - type: "osmosis/poolincentives/params", - value: Params.toAmino(message) - }; - }, - fromProtoMsg(message: ParamsProtoMsg): Params { - return Params.decode(message.value); - }, - toProto(message: Params): Uint8Array { - return Params.encode(message).finish(); - }, - toProtoMsg(message: Params): ParamsProtoMsg { - return { - typeUrl: "/osmosis.poolincentives.v1beta1.Params", - value: Params.encode(message).finish() - }; - } -}; -function createBaseLockableDurationsInfo(): LockableDurationsInfo { - return { - lockableDurations: [] - }; -} -export const LockableDurationsInfo = { - typeUrl: "/osmosis.poolincentives.v1beta1.LockableDurationsInfo", - encode(message: LockableDurationsInfo, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { - for (const v of message.lockableDurations) { - Duration.encode(v!, writer.uint32(10).fork()).ldelim(); - } - return writer; - }, - decode(input: BinaryReader | Uint8Array, length?: number): LockableDurationsInfo { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseLockableDurationsInfo(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.lockableDurations.push(Duration.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - fromPartial(object: Partial): LockableDurationsInfo { - const message = createBaseLockableDurationsInfo(); - message.lockableDurations = object.lockableDurations?.map(e => Duration.fromPartial(e)) || []; - return message; - }, - fromAmino(object: LockableDurationsInfoAmino): LockableDurationsInfo { - return { - lockableDurations: Array.isArray(object?.lockable_durations) ? object.lockable_durations.map((e: any) => Duration.fromAmino(e)) : [] - }; - }, - toAmino(message: LockableDurationsInfo): LockableDurationsInfoAmino { - const obj: any = {}; - if (message.lockableDurations) { - obj.lockable_durations = message.lockableDurations.map(e => e ? Duration.toAmino(e) : undefined); - } else { - obj.lockable_durations = []; - } - return obj; - }, - fromAminoMsg(object: LockableDurationsInfoAminoMsg): LockableDurationsInfo { - return LockableDurationsInfo.fromAmino(object.value); - }, - toAminoMsg(message: LockableDurationsInfo): LockableDurationsInfoAminoMsg { - return { - type: "osmosis/poolincentives/lockable-durations-info", - value: LockableDurationsInfo.toAmino(message) - }; - }, - fromProtoMsg(message: LockableDurationsInfoProtoMsg): LockableDurationsInfo { - return LockableDurationsInfo.decode(message.value); - }, - toProto(message: LockableDurationsInfo): Uint8Array { - return LockableDurationsInfo.encode(message).finish(); - }, - toProtoMsg(message: LockableDurationsInfo): LockableDurationsInfoProtoMsg { - return { - typeUrl: "/osmosis.poolincentives.v1beta1.LockableDurationsInfo", - value: LockableDurationsInfo.encode(message).finish() - }; - } -}; -function createBaseDistrInfo(): DistrInfo { - return { - totalWeight: "", - records: [] - }; -} -export const DistrInfo = { - typeUrl: "/osmosis.poolincentives.v1beta1.DistrInfo", - encode(message: DistrInfo, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { - if (message.totalWeight !== "") { - writer.uint32(10).string(message.totalWeight); - } - for (const v of message.records) { - DistrRecord.encode(v!, writer.uint32(18).fork()).ldelim(); - } - return writer; - }, - decode(input: BinaryReader | Uint8Array, length?: number): DistrInfo { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseDistrInfo(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.totalWeight = reader.string(); - break; - case 2: - message.records.push(DistrRecord.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - fromPartial(object: Partial): DistrInfo { - const message = createBaseDistrInfo(); - message.totalWeight = object.totalWeight ?? ""; - message.records = object.records?.map(e => DistrRecord.fromPartial(e)) || []; - return message; - }, - fromAmino(object: DistrInfoAmino): DistrInfo { - return { - totalWeight: object.total_weight, - records: Array.isArray(object?.records) ? object.records.map((e: any) => DistrRecord.fromAmino(e)) : [] - }; - }, - toAmino(message: DistrInfo): DistrInfoAmino { - const obj: any = {}; - obj.total_weight = message.totalWeight; - if (message.records) { - obj.records = message.records.map(e => e ? DistrRecord.toAmino(e) : undefined); - } else { - obj.records = []; - } - return obj; - }, - fromAminoMsg(object: DistrInfoAminoMsg): DistrInfo { - return DistrInfo.fromAmino(object.value); - }, - toAminoMsg(message: DistrInfo): DistrInfoAminoMsg { - return { - type: "osmosis/poolincentives/distr-info", - value: DistrInfo.toAmino(message) - }; - }, - fromProtoMsg(message: DistrInfoProtoMsg): DistrInfo { - return DistrInfo.decode(message.value); - }, - toProto(message: DistrInfo): Uint8Array { - return DistrInfo.encode(message).finish(); - }, - toProtoMsg(message: DistrInfo): DistrInfoProtoMsg { - return { - typeUrl: "/osmosis.poolincentives.v1beta1.DistrInfo", - value: DistrInfo.encode(message).finish() - }; - } -}; -function createBaseDistrRecord(): DistrRecord { - return { - gaugeId: BigInt(0), - weight: "" - }; -} -export const DistrRecord = { - typeUrl: "/osmosis.poolincentives.v1beta1.DistrRecord", - encode(message: DistrRecord, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { - if (message.gaugeId !== BigInt(0)) { - writer.uint32(8).uint64(message.gaugeId); - } - if (message.weight !== "") { - writer.uint32(18).string(message.weight); - } - return writer; - }, - decode(input: BinaryReader | Uint8Array, length?: number): DistrRecord { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseDistrRecord(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.gaugeId = reader.uint64(); - break; - case 2: - message.weight = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - fromPartial(object: Partial): DistrRecord { - const message = createBaseDistrRecord(); - message.gaugeId = object.gaugeId !== undefined && object.gaugeId !== null ? BigInt(object.gaugeId.toString()) : BigInt(0); - message.weight = object.weight ?? ""; - return message; - }, - fromAmino(object: DistrRecordAmino): DistrRecord { - return { - gaugeId: BigInt(object.gauge_id), - weight: object.weight - }; - }, - toAmino(message: DistrRecord): DistrRecordAmino { - const obj: any = {}; - obj.gauge_id = message.gaugeId ? message.gaugeId.toString() : undefined; - obj.weight = message.weight; - return obj; - }, - fromAminoMsg(object: DistrRecordAminoMsg): DistrRecord { - return DistrRecord.fromAmino(object.value); - }, - toAminoMsg(message: DistrRecord): DistrRecordAminoMsg { - return { - type: "osmosis/poolincentives/distr-record", - value: DistrRecord.toAmino(message) - }; - }, - fromProtoMsg(message: DistrRecordProtoMsg): DistrRecord { - return DistrRecord.decode(message.value); - }, - toProto(message: DistrRecord): Uint8Array { - return DistrRecord.encode(message).finish(); - }, - toProtoMsg(message: DistrRecord): DistrRecordProtoMsg { - return { - typeUrl: "/osmosis.poolincentives.v1beta1.DistrRecord", - value: DistrRecord.encode(message).finish() - }; - } -}; -function createBasePoolToGauge(): PoolToGauge { - return { - poolId: BigInt(0), - gaugeId: BigInt(0), - duration: undefined - }; -} -export const PoolToGauge = { - typeUrl: "/osmosis.poolincentives.v1beta1.PoolToGauge", - encode(message: PoolToGauge, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { - if (message.poolId !== BigInt(0)) { - writer.uint32(8).uint64(message.poolId); - } - if (message.gaugeId !== BigInt(0)) { - writer.uint32(16).uint64(message.gaugeId); - } - if (message.duration !== undefined) { - Duration.encode(message.duration, writer.uint32(26).fork()).ldelim(); - } - return writer; - }, - decode(input: BinaryReader | Uint8Array, length?: number): PoolToGauge { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBasePoolToGauge(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.poolId = reader.uint64(); - break; - case 2: - message.gaugeId = reader.uint64(); - break; - case 3: - message.duration = Duration.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - fromPartial(object: Partial): PoolToGauge { - const message = createBasePoolToGauge(); - message.poolId = object.poolId !== undefined && object.poolId !== null ? BigInt(object.poolId.toString()) : BigInt(0); - message.gaugeId = object.gaugeId !== undefined && object.gaugeId !== null ? BigInt(object.gaugeId.toString()) : BigInt(0); - message.duration = object.duration !== undefined && object.duration !== null ? Duration.fromPartial(object.duration) : undefined; - return message; - }, - fromAmino(object: PoolToGaugeAmino): PoolToGauge { - return { - poolId: BigInt(object.pool_id), - gaugeId: BigInt(object.gauge_id), - duration: object?.duration ? Duration.fromAmino(object.duration) : undefined - }; - }, - toAmino(message: PoolToGauge): PoolToGaugeAmino { - const obj: any = {}; - obj.pool_id = message.poolId ? message.poolId.toString() : undefined; - obj.gauge_id = message.gaugeId ? message.gaugeId.toString() : undefined; - obj.duration = message.duration ? Duration.toAmino(message.duration) : undefined; - return obj; - }, - fromAminoMsg(object: PoolToGaugeAminoMsg): PoolToGauge { - return PoolToGauge.fromAmino(object.value); - }, - toAminoMsg(message: PoolToGauge): PoolToGaugeAminoMsg { - return { - type: "osmosis/poolincentives/pool-to-gauge", - value: PoolToGauge.toAmino(message) - }; - }, - fromProtoMsg(message: PoolToGaugeProtoMsg): PoolToGauge { - return PoolToGauge.decode(message.value); - }, - toProto(message: PoolToGauge): Uint8Array { - return PoolToGauge.encode(message).finish(); - }, - toProtoMsg(message: PoolToGauge): PoolToGaugeProtoMsg { - return { - typeUrl: "/osmosis.poolincentives.v1beta1.PoolToGauge", - value: PoolToGauge.encode(message).finish() - }; - } -}; -function createBasePoolToGauges(): PoolToGauges { - return { - poolToGauge: [] - }; -} -export const PoolToGauges = { - typeUrl: "/osmosis.poolincentives.v1beta1.PoolToGauges", - encode(message: PoolToGauges, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { - for (const v of message.poolToGauge) { - PoolToGauge.encode(v!, writer.uint32(18).fork()).ldelim(); - } - return writer; - }, - decode(input: BinaryReader | Uint8Array, length?: number): PoolToGauges { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBasePoolToGauges(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 2: - message.poolToGauge.push(PoolToGauge.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - fromPartial(object: Partial): PoolToGauges { - const message = createBasePoolToGauges(); - message.poolToGauge = object.poolToGauge?.map(e => PoolToGauge.fromPartial(e)) || []; - return message; - }, - fromAmino(object: PoolToGaugesAmino): PoolToGauges { - return { - poolToGauge: Array.isArray(object?.pool_to_gauge) ? object.pool_to_gauge.map((e: any) => PoolToGauge.fromAmino(e)) : [] - }; - }, - toAmino(message: PoolToGauges): PoolToGaugesAmino { - const obj: any = {}; - if (message.poolToGauge) { - obj.pool_to_gauge = message.poolToGauge.map(e => e ? PoolToGauge.toAmino(e) : undefined); - } else { - obj.pool_to_gauge = []; - } - return obj; - }, - fromAminoMsg(object: PoolToGaugesAminoMsg): PoolToGauges { - return PoolToGauges.fromAmino(object.value); - }, - toAminoMsg(message: PoolToGauges): PoolToGaugesAminoMsg { - return { - type: "osmosis/poolincentives/pool-to-gauges", - value: PoolToGauges.toAmino(message) - }; - }, - fromProtoMsg(message: PoolToGaugesProtoMsg): PoolToGauges { - return PoolToGauges.decode(message.value); - }, - toProto(message: PoolToGauges): Uint8Array { - return PoolToGauges.encode(message).finish(); - }, - toProtoMsg(message: PoolToGauges): PoolToGaugesProtoMsg { - return { - typeUrl: "/osmosis.poolincentives.v1beta1.PoolToGauges", - value: PoolToGauges.encode(message).finish() - }; - } -}; \ No newline at end of file diff --git a/packages/osmojs/src/codegen/osmosis/poolincentives/v1beta1/genesis.ts b/packages/osmojs/src/codegen/osmosis/poolincentives/v1beta1/genesis.ts new file mode 100644 index 000000000..5980a0383 --- /dev/null +++ b/packages/osmojs/src/codegen/osmosis/poolincentives/v1beta1/genesis.ts @@ -0,0 +1,212 @@ +import { Params, ParamsAmino, ParamsSDKType, DistrInfo, DistrInfoAmino, DistrInfoSDKType, AnyPoolToInternalGauges, AnyPoolToInternalGaugesAmino, AnyPoolToInternalGaugesSDKType, ConcentratedPoolToNoLockGauges, ConcentratedPoolToNoLockGaugesAmino, ConcentratedPoolToNoLockGaugesSDKType } from "./incentives"; +import { Duration, DurationAmino, DurationSDKType } from "../../../google/protobuf/duration"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { isSet } from "../../../helpers"; +import { GlobalDecoderRegistry } from "../../../registry"; +/** GenesisState defines the pool incentives module's genesis state. */ +export interface GenesisState { + /** params defines all the parameters of the module. */ + params: Params; + lockableDurations: Duration[]; + distrInfo?: DistrInfo; + /** + * any_pool_to_internal_gauges defines the gauges for any pool to internal + * pool. For every pool type (e.g. LP, Concentrated, etc), there is one such + * link + */ + anyPoolToInternalGauges?: AnyPoolToInternalGauges; + /** + * concentrated_pool_to_no_lock_gauges defines the no lock gauges for + * concentrated pool. This only exists between concentrated pool and no lock + * gauges. Both external and internal gauges are included. + */ + concentratedPoolToNoLockGauges?: ConcentratedPoolToNoLockGauges; +} +export interface GenesisStateProtoMsg { + typeUrl: "/osmosis.poolincentives.v1beta1.GenesisState"; + value: Uint8Array; +} +/** GenesisState defines the pool incentives module's genesis state. */ +export interface GenesisStateAmino { + /** params defines all the parameters of the module. */ + params?: ParamsAmino; + lockable_durations?: DurationAmino[]; + distr_info?: DistrInfoAmino; + /** + * any_pool_to_internal_gauges defines the gauges for any pool to internal + * pool. For every pool type (e.g. LP, Concentrated, etc), there is one such + * link + */ + any_pool_to_internal_gauges?: AnyPoolToInternalGaugesAmino; + /** + * concentrated_pool_to_no_lock_gauges defines the no lock gauges for + * concentrated pool. This only exists between concentrated pool and no lock + * gauges. Both external and internal gauges are included. + */ + concentrated_pool_to_no_lock_gauges?: ConcentratedPoolToNoLockGaugesAmino; +} +export interface GenesisStateAminoMsg { + type: "osmosis/poolincentives/genesis-state"; + value: GenesisStateAmino; +} +/** GenesisState defines the pool incentives module's genesis state. */ +export interface GenesisStateSDKType { + params: ParamsSDKType; + lockable_durations: DurationSDKType[]; + distr_info?: DistrInfoSDKType; + any_pool_to_internal_gauges?: AnyPoolToInternalGaugesSDKType; + concentrated_pool_to_no_lock_gauges?: ConcentratedPoolToNoLockGaugesSDKType; +} +function createBaseGenesisState(): GenesisState { + return { + params: Params.fromPartial({}), + lockableDurations: [], + distrInfo: undefined, + anyPoolToInternalGauges: undefined, + concentratedPoolToNoLockGauges: undefined + }; +} +export const GenesisState = { + typeUrl: "/osmosis.poolincentives.v1beta1.GenesisState", + aminoType: "osmosis/poolincentives/genesis-state", + is(o: any): o is GenesisState { + return o && (o.$typeUrl === GenesisState.typeUrl || Params.is(o.params) && Array.isArray(o.lockableDurations) && (!o.lockableDurations.length || Duration.is(o.lockableDurations[0]))); + }, + isSDK(o: any): o is GenesisStateSDKType { + return o && (o.$typeUrl === GenesisState.typeUrl || Params.isSDK(o.params) && Array.isArray(o.lockable_durations) && (!o.lockable_durations.length || Duration.isSDK(o.lockable_durations[0]))); + }, + isAmino(o: any): o is GenesisStateAmino { + return o && (o.$typeUrl === GenesisState.typeUrl || Params.isAmino(o.params) && Array.isArray(o.lockable_durations) && (!o.lockable_durations.length || Duration.isAmino(o.lockable_durations[0]))); + }, + encode(message: GenesisState, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.params !== undefined) { + Params.encode(message.params, writer.uint32(10).fork()).ldelim(); + } + for (const v of message.lockableDurations) { + Duration.encode(v!, writer.uint32(18).fork()).ldelim(); + } + if (message.distrInfo !== undefined) { + DistrInfo.encode(message.distrInfo, writer.uint32(26).fork()).ldelim(); + } + if (message.anyPoolToInternalGauges !== undefined) { + AnyPoolToInternalGauges.encode(message.anyPoolToInternalGauges, writer.uint32(34).fork()).ldelim(); + } + if (message.concentratedPoolToNoLockGauges !== undefined) { + ConcentratedPoolToNoLockGauges.encode(message.concentratedPoolToNoLockGauges, writer.uint32(42).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): GenesisState { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGenesisState(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.params = Params.decode(reader, reader.uint32()); + break; + case 2: + message.lockableDurations.push(Duration.decode(reader, reader.uint32())); + break; + case 3: + message.distrInfo = DistrInfo.decode(reader, reader.uint32()); + break; + case 4: + message.anyPoolToInternalGauges = AnyPoolToInternalGauges.decode(reader, reader.uint32()); + break; + case 5: + message.concentratedPoolToNoLockGauges = ConcentratedPoolToNoLockGauges.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): GenesisState { + return { + params: isSet(object.params) ? Params.fromJSON(object.params) : undefined, + lockableDurations: Array.isArray(object?.lockableDurations) ? object.lockableDurations.map((e: any) => Duration.fromJSON(e)) : [], + distrInfo: isSet(object.distrInfo) ? DistrInfo.fromJSON(object.distrInfo) : undefined, + anyPoolToInternalGauges: isSet(object.anyPoolToInternalGauges) ? AnyPoolToInternalGauges.fromJSON(object.anyPoolToInternalGauges) : undefined, + concentratedPoolToNoLockGauges: isSet(object.concentratedPoolToNoLockGauges) ? ConcentratedPoolToNoLockGauges.fromJSON(object.concentratedPoolToNoLockGauges) : undefined + }; + }, + toJSON(message: GenesisState): unknown { + const obj: any = {}; + message.params !== undefined && (obj.params = message.params ? Params.toJSON(message.params) : undefined); + if (message.lockableDurations) { + obj.lockableDurations = message.lockableDurations.map(e => e ? Duration.toJSON(e) : undefined); + } else { + obj.lockableDurations = []; + } + message.distrInfo !== undefined && (obj.distrInfo = message.distrInfo ? DistrInfo.toJSON(message.distrInfo) : undefined); + message.anyPoolToInternalGauges !== undefined && (obj.anyPoolToInternalGauges = message.anyPoolToInternalGauges ? AnyPoolToInternalGauges.toJSON(message.anyPoolToInternalGauges) : undefined); + message.concentratedPoolToNoLockGauges !== undefined && (obj.concentratedPoolToNoLockGauges = message.concentratedPoolToNoLockGauges ? ConcentratedPoolToNoLockGauges.toJSON(message.concentratedPoolToNoLockGauges) : undefined); + return obj; + }, + fromPartial(object: Partial): GenesisState { + const message = createBaseGenesisState(); + message.params = object.params !== undefined && object.params !== null ? Params.fromPartial(object.params) : undefined; + message.lockableDurations = object.lockableDurations?.map(e => Duration.fromPartial(e)) || []; + message.distrInfo = object.distrInfo !== undefined && object.distrInfo !== null ? DistrInfo.fromPartial(object.distrInfo) : undefined; + message.anyPoolToInternalGauges = object.anyPoolToInternalGauges !== undefined && object.anyPoolToInternalGauges !== null ? AnyPoolToInternalGauges.fromPartial(object.anyPoolToInternalGauges) : undefined; + message.concentratedPoolToNoLockGauges = object.concentratedPoolToNoLockGauges !== undefined && object.concentratedPoolToNoLockGauges !== null ? ConcentratedPoolToNoLockGauges.fromPartial(object.concentratedPoolToNoLockGauges) : undefined; + return message; + }, + fromAmino(object: GenesisStateAmino): GenesisState { + const message = createBaseGenesisState(); + if (object.params !== undefined && object.params !== null) { + message.params = Params.fromAmino(object.params); + } + message.lockableDurations = object.lockable_durations?.map(e => Duration.fromAmino(e)) || []; + if (object.distr_info !== undefined && object.distr_info !== null) { + message.distrInfo = DistrInfo.fromAmino(object.distr_info); + } + if (object.any_pool_to_internal_gauges !== undefined && object.any_pool_to_internal_gauges !== null) { + message.anyPoolToInternalGauges = AnyPoolToInternalGauges.fromAmino(object.any_pool_to_internal_gauges); + } + if (object.concentrated_pool_to_no_lock_gauges !== undefined && object.concentrated_pool_to_no_lock_gauges !== null) { + message.concentratedPoolToNoLockGauges = ConcentratedPoolToNoLockGauges.fromAmino(object.concentrated_pool_to_no_lock_gauges); + } + return message; + }, + toAmino(message: GenesisState): GenesisStateAmino { + const obj: any = {}; + obj.params = message.params ? Params.toAmino(message.params) : undefined; + if (message.lockableDurations) { + obj.lockable_durations = message.lockableDurations.map(e => e ? Duration.toAmino(e) : undefined); + } else { + obj.lockable_durations = []; + } + obj.distr_info = message.distrInfo ? DistrInfo.toAmino(message.distrInfo) : undefined; + obj.any_pool_to_internal_gauges = message.anyPoolToInternalGauges ? AnyPoolToInternalGauges.toAmino(message.anyPoolToInternalGauges) : undefined; + obj.concentrated_pool_to_no_lock_gauges = message.concentratedPoolToNoLockGauges ? ConcentratedPoolToNoLockGauges.toAmino(message.concentratedPoolToNoLockGauges) : undefined; + return obj; + }, + fromAminoMsg(object: GenesisStateAminoMsg): GenesisState { + return GenesisState.fromAmino(object.value); + }, + toAminoMsg(message: GenesisState): GenesisStateAminoMsg { + return { + type: "osmosis/poolincentives/genesis-state", + value: GenesisState.toAmino(message) + }; + }, + fromProtoMsg(message: GenesisStateProtoMsg): GenesisState { + return GenesisState.decode(message.value); + }, + toProto(message: GenesisState): Uint8Array { + return GenesisState.encode(message).finish(); + }, + toProtoMsg(message: GenesisState): GenesisStateProtoMsg { + return { + typeUrl: "/osmosis.poolincentives.v1beta1.GenesisState", + value: GenesisState.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(GenesisState.typeUrl, GenesisState); +GlobalDecoderRegistry.registerAminoProtoMapping(GenesisState.aminoType, GenesisState.typeUrl); \ No newline at end of file diff --git a/packages/osmo-query/src/codegen/osmosis/pool-incentives/v1beta1/gov.ts b/packages/osmojs/src/codegen/osmosis/poolincentives/v1beta1/gov.ts similarity index 68% rename from packages/osmo-query/src/codegen/osmosis/pool-incentives/v1beta1/gov.ts rename to packages/osmojs/src/codegen/osmosis/poolincentives/v1beta1/gov.ts index 14194d17d..9b031b86f 100644 --- a/packages/osmo-query/src/codegen/osmosis/pool-incentives/v1beta1/gov.ts +++ b/packages/osmojs/src/codegen/osmosis/poolincentives/v1beta1/gov.ts @@ -1,5 +1,7 @@ import { DistrRecord, DistrRecordAmino, DistrRecordSDKType } from "./incentives"; import { BinaryReader, BinaryWriter } from "../../../binary"; +import { isSet } from "../../../helpers"; +import { GlobalDecoderRegistry } from "../../../registry"; /** * ReplacePoolIncentivesProposal is a gov Content type for updating the pool * incentives. If a ReplacePoolIncentivesProposal passes, the proposal’s records @@ -10,7 +12,7 @@ import { BinaryReader, BinaryWriter } from "../../../binary"; * configuration. Note that gaugeId=0 represents the community pool. */ export interface ReplacePoolIncentivesProposal { - $typeUrl?: string; + $typeUrl?: "/osmosis.poolincentives.v1beta1.ReplacePoolIncentivesProposal"; title: string; description: string; records: DistrRecord[]; @@ -29,9 +31,9 @@ export interface ReplacePoolIncentivesProposalProtoMsg { * configuration. Note that gaugeId=0 represents the community pool. */ export interface ReplacePoolIncentivesProposalAmino { - title: string; - description: string; - records: DistrRecordAmino[]; + title?: string; + description?: string; + records?: DistrRecordAmino[]; } export interface ReplacePoolIncentivesProposalAminoMsg { type: "osmosis/ReplacePoolIncentivesProposal"; @@ -47,7 +49,7 @@ export interface ReplacePoolIncentivesProposalAminoMsg { * configuration. Note that gaugeId=0 represents the community pool. */ export interface ReplacePoolIncentivesProposalSDKType { - $typeUrl?: string; + $typeUrl?: "/osmosis.poolincentives.v1beta1.ReplacePoolIncentivesProposal"; title: string; description: string; records: DistrRecordSDKType[]; @@ -62,7 +64,7 @@ export interface ReplacePoolIncentivesProposalSDKType { * [(Gauge 0, 5), (Gauge 2, 4), (Gauge 3, 10)] */ export interface UpdatePoolIncentivesProposal { - $typeUrl?: string; + $typeUrl?: "/osmosis.poolincentives.v1beta1.UpdatePoolIncentivesProposal"; title: string; description: string; records: DistrRecord[]; @@ -81,9 +83,9 @@ export interface UpdatePoolIncentivesProposalProtoMsg { * [(Gauge 0, 5), (Gauge 2, 4), (Gauge 3, 10)] */ export interface UpdatePoolIncentivesProposalAmino { - title: string; - description: string; - records: DistrRecordAmino[]; + title?: string; + description?: string; + records?: DistrRecordAmino[]; } export interface UpdatePoolIncentivesProposalAminoMsg { type: "osmosis/UpdatePoolIncentivesProposal"; @@ -99,7 +101,7 @@ export interface UpdatePoolIncentivesProposalAminoMsg { * [(Gauge 0, 5), (Gauge 2, 4), (Gauge 3, 10)] */ export interface UpdatePoolIncentivesProposalSDKType { - $typeUrl?: string; + $typeUrl?: "/osmosis.poolincentives.v1beta1.UpdatePoolIncentivesProposal"; title: string; description: string; records: DistrRecordSDKType[]; @@ -114,6 +116,16 @@ function createBaseReplacePoolIncentivesProposal(): ReplacePoolIncentivesProposa } export const ReplacePoolIncentivesProposal = { typeUrl: "/osmosis.poolincentives.v1beta1.ReplacePoolIncentivesProposal", + aminoType: "osmosis/ReplacePoolIncentivesProposal", + is(o: any): o is ReplacePoolIncentivesProposal { + return o && (o.$typeUrl === ReplacePoolIncentivesProposal.typeUrl || typeof o.title === "string" && typeof o.description === "string" && Array.isArray(o.records) && (!o.records.length || DistrRecord.is(o.records[0]))); + }, + isSDK(o: any): o is ReplacePoolIncentivesProposalSDKType { + return o && (o.$typeUrl === ReplacePoolIncentivesProposal.typeUrl || typeof o.title === "string" && typeof o.description === "string" && Array.isArray(o.records) && (!o.records.length || DistrRecord.isSDK(o.records[0]))); + }, + isAmino(o: any): o is ReplacePoolIncentivesProposalAmino { + return o && (o.$typeUrl === ReplacePoolIncentivesProposal.typeUrl || typeof o.title === "string" && typeof o.description === "string" && Array.isArray(o.records) && (!o.records.length || DistrRecord.isAmino(o.records[0]))); + }, encode(message: ReplacePoolIncentivesProposal, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.title !== "") { writer.uint32(10).string(message.title); @@ -149,6 +161,24 @@ export const ReplacePoolIncentivesProposal = { } return message; }, + fromJSON(object: any): ReplacePoolIncentivesProposal { + return { + title: isSet(object.title) ? String(object.title) : "", + description: isSet(object.description) ? String(object.description) : "", + records: Array.isArray(object?.records) ? object.records.map((e: any) => DistrRecord.fromJSON(e)) : [] + }; + }, + toJSON(message: ReplacePoolIncentivesProposal): unknown { + const obj: any = {}; + message.title !== undefined && (obj.title = message.title); + message.description !== undefined && (obj.description = message.description); + if (message.records) { + obj.records = message.records.map(e => e ? DistrRecord.toJSON(e) : undefined); + } else { + obj.records = []; + } + return obj; + }, fromPartial(object: Partial): ReplacePoolIncentivesProposal { const message = createBaseReplacePoolIncentivesProposal(); message.title = object.title ?? ""; @@ -157,11 +187,15 @@ export const ReplacePoolIncentivesProposal = { return message; }, fromAmino(object: ReplacePoolIncentivesProposalAmino): ReplacePoolIncentivesProposal { - return { - title: object.title, - description: object.description, - records: Array.isArray(object?.records) ? object.records.map((e: any) => DistrRecord.fromAmino(e)) : [] - }; + const message = createBaseReplacePoolIncentivesProposal(); + if (object.title !== undefined && object.title !== null) { + message.title = object.title; + } + if (object.description !== undefined && object.description !== null) { + message.description = object.description; + } + message.records = object.records?.map(e => DistrRecord.fromAmino(e)) || []; + return message; }, toAmino(message: ReplacePoolIncentivesProposal): ReplacePoolIncentivesProposalAmino { const obj: any = {}; @@ -196,6 +230,8 @@ export const ReplacePoolIncentivesProposal = { }; } }; +GlobalDecoderRegistry.register(ReplacePoolIncentivesProposal.typeUrl, ReplacePoolIncentivesProposal); +GlobalDecoderRegistry.registerAminoProtoMapping(ReplacePoolIncentivesProposal.aminoType, ReplacePoolIncentivesProposal.typeUrl); function createBaseUpdatePoolIncentivesProposal(): UpdatePoolIncentivesProposal { return { $typeUrl: "/osmosis.poolincentives.v1beta1.UpdatePoolIncentivesProposal", @@ -206,6 +242,16 @@ function createBaseUpdatePoolIncentivesProposal(): UpdatePoolIncentivesProposal } export const UpdatePoolIncentivesProposal = { typeUrl: "/osmosis.poolincentives.v1beta1.UpdatePoolIncentivesProposal", + aminoType: "osmosis/UpdatePoolIncentivesProposal", + is(o: any): o is UpdatePoolIncentivesProposal { + return o && (o.$typeUrl === UpdatePoolIncentivesProposal.typeUrl || typeof o.title === "string" && typeof o.description === "string" && Array.isArray(o.records) && (!o.records.length || DistrRecord.is(o.records[0]))); + }, + isSDK(o: any): o is UpdatePoolIncentivesProposalSDKType { + return o && (o.$typeUrl === UpdatePoolIncentivesProposal.typeUrl || typeof o.title === "string" && typeof o.description === "string" && Array.isArray(o.records) && (!o.records.length || DistrRecord.isSDK(o.records[0]))); + }, + isAmino(o: any): o is UpdatePoolIncentivesProposalAmino { + return o && (o.$typeUrl === UpdatePoolIncentivesProposal.typeUrl || typeof o.title === "string" && typeof o.description === "string" && Array.isArray(o.records) && (!o.records.length || DistrRecord.isAmino(o.records[0]))); + }, encode(message: UpdatePoolIncentivesProposal, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.title !== "") { writer.uint32(10).string(message.title); @@ -241,6 +287,24 @@ export const UpdatePoolIncentivesProposal = { } return message; }, + fromJSON(object: any): UpdatePoolIncentivesProposal { + return { + title: isSet(object.title) ? String(object.title) : "", + description: isSet(object.description) ? String(object.description) : "", + records: Array.isArray(object?.records) ? object.records.map((e: any) => DistrRecord.fromJSON(e)) : [] + }; + }, + toJSON(message: UpdatePoolIncentivesProposal): unknown { + const obj: any = {}; + message.title !== undefined && (obj.title = message.title); + message.description !== undefined && (obj.description = message.description); + if (message.records) { + obj.records = message.records.map(e => e ? DistrRecord.toJSON(e) : undefined); + } else { + obj.records = []; + } + return obj; + }, fromPartial(object: Partial): UpdatePoolIncentivesProposal { const message = createBaseUpdatePoolIncentivesProposal(); message.title = object.title ?? ""; @@ -249,11 +313,15 @@ export const UpdatePoolIncentivesProposal = { return message; }, fromAmino(object: UpdatePoolIncentivesProposalAmino): UpdatePoolIncentivesProposal { - return { - title: object.title, - description: object.description, - records: Array.isArray(object?.records) ? object.records.map((e: any) => DistrRecord.fromAmino(e)) : [] - }; + const message = createBaseUpdatePoolIncentivesProposal(); + if (object.title !== undefined && object.title !== null) { + message.title = object.title; + } + if (object.description !== undefined && object.description !== null) { + message.description = object.description; + } + message.records = object.records?.map(e => DistrRecord.fromAmino(e)) || []; + return message; }, toAmino(message: UpdatePoolIncentivesProposal): UpdatePoolIncentivesProposalAmino { const obj: any = {}; @@ -287,4 +355,6 @@ export const UpdatePoolIncentivesProposal = { value: UpdatePoolIncentivesProposal.encode(message).finish() }; } -}; \ No newline at end of file +}; +GlobalDecoderRegistry.register(UpdatePoolIncentivesProposal.typeUrl, UpdatePoolIncentivesProposal); +GlobalDecoderRegistry.registerAminoProtoMapping(UpdatePoolIncentivesProposal.aminoType, UpdatePoolIncentivesProposal.typeUrl); \ No newline at end of file diff --git a/packages/osmojs/src/codegen/osmosis/poolincentives/v1beta1/incentives.ts b/packages/osmojs/src/codegen/osmosis/poolincentives/v1beta1/incentives.ts new file mode 100644 index 000000000..7e13eef42 --- /dev/null +++ b/packages/osmojs/src/codegen/osmosis/poolincentives/v1beta1/incentives.ts @@ -0,0 +1,864 @@ +import { Duration, DurationAmino, DurationSDKType } from "../../../google/protobuf/duration"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { isSet } from "../../../helpers"; +import { GlobalDecoderRegistry } from "../../../registry"; +export interface Params { + /** + * minted_denom is the denomination of the coin expected to be minted by the + * minting module. Pool-incentives module doesn’t actually mint the coin + * itself, but rather manages the distribution of coins that matches the + * defined minted_denom. + */ + mintedDenom: string; +} +export interface ParamsProtoMsg { + typeUrl: "/osmosis.poolincentives.v1beta1.Params"; + value: Uint8Array; +} +export interface ParamsAmino { + /** + * minted_denom is the denomination of the coin expected to be minted by the + * minting module. Pool-incentives module doesn’t actually mint the coin + * itself, but rather manages the distribution of coins that matches the + * defined minted_denom. + */ + minted_denom?: string; +} +export interface ParamsAminoMsg { + type: "osmosis/poolincentives/params"; + value: ParamsAmino; +} +export interface ParamsSDKType { + minted_denom: string; +} +export interface LockableDurationsInfo { + lockableDurations: Duration[]; +} +export interface LockableDurationsInfoProtoMsg { + typeUrl: "/osmosis.poolincentives.v1beta1.LockableDurationsInfo"; + value: Uint8Array; +} +export interface LockableDurationsInfoAmino { + lockable_durations?: DurationAmino[]; +} +export interface LockableDurationsInfoAminoMsg { + type: "osmosis/poolincentives/lockable-durations-info"; + value: LockableDurationsInfoAmino; +} +export interface LockableDurationsInfoSDKType { + lockable_durations: DurationSDKType[]; +} +export interface DistrInfo { + totalWeight: string; + records: DistrRecord[]; +} +export interface DistrInfoProtoMsg { + typeUrl: "/osmosis.poolincentives.v1beta1.DistrInfo"; + value: Uint8Array; +} +export interface DistrInfoAmino { + total_weight?: string; + records?: DistrRecordAmino[]; +} +export interface DistrInfoAminoMsg { + type: "osmosis/poolincentives/distr-info"; + value: DistrInfoAmino; +} +export interface DistrInfoSDKType { + total_weight: string; + records: DistrRecordSDKType[]; +} +export interface DistrRecord { + gaugeId: bigint; + weight: string; +} +export interface DistrRecordProtoMsg { + typeUrl: "/osmosis.poolincentives.v1beta1.DistrRecord"; + value: Uint8Array; +} +export interface DistrRecordAmino { + gauge_id?: string; + weight?: string; +} +export interface DistrRecordAminoMsg { + type: "osmosis/poolincentives/distr-record"; + value: DistrRecordAmino; +} +export interface DistrRecordSDKType { + gauge_id: bigint; + weight: string; +} +export interface PoolToGauge { + poolId: bigint; + gaugeId: bigint; + duration: Duration; +} +export interface PoolToGaugeProtoMsg { + typeUrl: "/osmosis.poolincentives.v1beta1.PoolToGauge"; + value: Uint8Array; +} +export interface PoolToGaugeAmino { + pool_id?: string; + gauge_id?: string; + duration?: DurationAmino; +} +export interface PoolToGaugeAminoMsg { + type: "osmosis/poolincentives/pool-to-gauge"; + value: PoolToGaugeAmino; +} +export interface PoolToGaugeSDKType { + pool_id: bigint; + gauge_id: bigint; + duration: DurationSDKType; +} +export interface AnyPoolToInternalGauges { + poolToGauge: PoolToGauge[]; +} +export interface AnyPoolToInternalGaugesProtoMsg { + typeUrl: "/osmosis.poolincentives.v1beta1.AnyPoolToInternalGauges"; + value: Uint8Array; +} +export interface AnyPoolToInternalGaugesAmino { + pool_to_gauge?: PoolToGaugeAmino[]; +} +export interface AnyPoolToInternalGaugesAminoMsg { + type: "osmosis/poolincentives/any-pool-to-internal-gauges"; + value: AnyPoolToInternalGaugesAmino; +} +export interface AnyPoolToInternalGaugesSDKType { + pool_to_gauge: PoolToGaugeSDKType[]; +} +export interface ConcentratedPoolToNoLockGauges { + poolToGauge: PoolToGauge[]; +} +export interface ConcentratedPoolToNoLockGaugesProtoMsg { + typeUrl: "/osmosis.poolincentives.v1beta1.ConcentratedPoolToNoLockGauges"; + value: Uint8Array; +} +export interface ConcentratedPoolToNoLockGaugesAmino { + pool_to_gauge?: PoolToGaugeAmino[]; +} +export interface ConcentratedPoolToNoLockGaugesAminoMsg { + type: "osmosis/poolincentives/concentrated-pool-to-no-lock-gauges"; + value: ConcentratedPoolToNoLockGaugesAmino; +} +export interface ConcentratedPoolToNoLockGaugesSDKType { + pool_to_gauge: PoolToGaugeSDKType[]; +} +function createBaseParams(): Params { + return { + mintedDenom: "" + }; +} +export const Params = { + typeUrl: "/osmosis.poolincentives.v1beta1.Params", + aminoType: "osmosis/poolincentives/params", + is(o: any): o is Params { + return o && (o.$typeUrl === Params.typeUrl || typeof o.mintedDenom === "string"); + }, + isSDK(o: any): o is ParamsSDKType { + return o && (o.$typeUrl === Params.typeUrl || typeof o.minted_denom === "string"); + }, + isAmino(o: any): o is ParamsAmino { + return o && (o.$typeUrl === Params.typeUrl || typeof o.minted_denom === "string"); + }, + encode(message: Params, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.mintedDenom !== "") { + writer.uint32(10).string(message.mintedDenom); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): Params { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseParams(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.mintedDenom = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): Params { + return { + mintedDenom: isSet(object.mintedDenom) ? String(object.mintedDenom) : "" + }; + }, + toJSON(message: Params): unknown { + const obj: any = {}; + message.mintedDenom !== undefined && (obj.mintedDenom = message.mintedDenom); + return obj; + }, + fromPartial(object: Partial): Params { + const message = createBaseParams(); + message.mintedDenom = object.mintedDenom ?? ""; + return message; + }, + fromAmino(object: ParamsAmino): Params { + const message = createBaseParams(); + if (object.minted_denom !== undefined && object.minted_denom !== null) { + message.mintedDenom = object.minted_denom; + } + return message; + }, + toAmino(message: Params): ParamsAmino { + const obj: any = {}; + obj.minted_denom = message.mintedDenom; + return obj; + }, + fromAminoMsg(object: ParamsAminoMsg): Params { + return Params.fromAmino(object.value); + }, + toAminoMsg(message: Params): ParamsAminoMsg { + return { + type: "osmosis/poolincentives/params", + value: Params.toAmino(message) + }; + }, + fromProtoMsg(message: ParamsProtoMsg): Params { + return Params.decode(message.value); + }, + toProto(message: Params): Uint8Array { + return Params.encode(message).finish(); + }, + toProtoMsg(message: Params): ParamsProtoMsg { + return { + typeUrl: "/osmosis.poolincentives.v1beta1.Params", + value: Params.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(Params.typeUrl, Params); +GlobalDecoderRegistry.registerAminoProtoMapping(Params.aminoType, Params.typeUrl); +function createBaseLockableDurationsInfo(): LockableDurationsInfo { + return { + lockableDurations: [] + }; +} +export const LockableDurationsInfo = { + typeUrl: "/osmosis.poolincentives.v1beta1.LockableDurationsInfo", + aminoType: "osmosis/poolincentives/lockable-durations-info", + is(o: any): o is LockableDurationsInfo { + return o && (o.$typeUrl === LockableDurationsInfo.typeUrl || Array.isArray(o.lockableDurations) && (!o.lockableDurations.length || Duration.is(o.lockableDurations[0]))); + }, + isSDK(o: any): o is LockableDurationsInfoSDKType { + return o && (o.$typeUrl === LockableDurationsInfo.typeUrl || Array.isArray(o.lockable_durations) && (!o.lockable_durations.length || Duration.isSDK(o.lockable_durations[0]))); + }, + isAmino(o: any): o is LockableDurationsInfoAmino { + return o && (o.$typeUrl === LockableDurationsInfo.typeUrl || Array.isArray(o.lockable_durations) && (!o.lockable_durations.length || Duration.isAmino(o.lockable_durations[0]))); + }, + encode(message: LockableDurationsInfo, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.lockableDurations) { + Duration.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): LockableDurationsInfo { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseLockableDurationsInfo(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.lockableDurations.push(Duration.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): LockableDurationsInfo { + return { + lockableDurations: Array.isArray(object?.lockableDurations) ? object.lockableDurations.map((e: any) => Duration.fromJSON(e)) : [] + }; + }, + toJSON(message: LockableDurationsInfo): unknown { + const obj: any = {}; + if (message.lockableDurations) { + obj.lockableDurations = message.lockableDurations.map(e => e ? Duration.toJSON(e) : undefined); + } else { + obj.lockableDurations = []; + } + return obj; + }, + fromPartial(object: Partial): LockableDurationsInfo { + const message = createBaseLockableDurationsInfo(); + message.lockableDurations = object.lockableDurations?.map(e => Duration.fromPartial(e)) || []; + return message; + }, + fromAmino(object: LockableDurationsInfoAmino): LockableDurationsInfo { + const message = createBaseLockableDurationsInfo(); + message.lockableDurations = object.lockable_durations?.map(e => Duration.fromAmino(e)) || []; + return message; + }, + toAmino(message: LockableDurationsInfo): LockableDurationsInfoAmino { + const obj: any = {}; + if (message.lockableDurations) { + obj.lockable_durations = message.lockableDurations.map(e => e ? Duration.toAmino(e) : undefined); + } else { + obj.lockable_durations = []; + } + return obj; + }, + fromAminoMsg(object: LockableDurationsInfoAminoMsg): LockableDurationsInfo { + return LockableDurationsInfo.fromAmino(object.value); + }, + toAminoMsg(message: LockableDurationsInfo): LockableDurationsInfoAminoMsg { + return { + type: "osmosis/poolincentives/lockable-durations-info", + value: LockableDurationsInfo.toAmino(message) + }; + }, + fromProtoMsg(message: LockableDurationsInfoProtoMsg): LockableDurationsInfo { + return LockableDurationsInfo.decode(message.value); + }, + toProto(message: LockableDurationsInfo): Uint8Array { + return LockableDurationsInfo.encode(message).finish(); + }, + toProtoMsg(message: LockableDurationsInfo): LockableDurationsInfoProtoMsg { + return { + typeUrl: "/osmosis.poolincentives.v1beta1.LockableDurationsInfo", + value: LockableDurationsInfo.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(LockableDurationsInfo.typeUrl, LockableDurationsInfo); +GlobalDecoderRegistry.registerAminoProtoMapping(LockableDurationsInfo.aminoType, LockableDurationsInfo.typeUrl); +function createBaseDistrInfo(): DistrInfo { + return { + totalWeight: "", + records: [] + }; +} +export const DistrInfo = { + typeUrl: "/osmosis.poolincentives.v1beta1.DistrInfo", + aminoType: "osmosis/poolincentives/distr-info", + is(o: any): o is DistrInfo { + return o && (o.$typeUrl === DistrInfo.typeUrl || typeof o.totalWeight === "string" && Array.isArray(o.records) && (!o.records.length || DistrRecord.is(o.records[0]))); + }, + isSDK(o: any): o is DistrInfoSDKType { + return o && (o.$typeUrl === DistrInfo.typeUrl || typeof o.total_weight === "string" && Array.isArray(o.records) && (!o.records.length || DistrRecord.isSDK(o.records[0]))); + }, + isAmino(o: any): o is DistrInfoAmino { + return o && (o.$typeUrl === DistrInfo.typeUrl || typeof o.total_weight === "string" && Array.isArray(o.records) && (!o.records.length || DistrRecord.isAmino(o.records[0]))); + }, + encode(message: DistrInfo, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.totalWeight !== "") { + writer.uint32(10).string(message.totalWeight); + } + for (const v of message.records) { + DistrRecord.encode(v!, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): DistrInfo { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseDistrInfo(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.totalWeight = reader.string(); + break; + case 2: + message.records.push(DistrRecord.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): DistrInfo { + return { + totalWeight: isSet(object.totalWeight) ? String(object.totalWeight) : "", + records: Array.isArray(object?.records) ? object.records.map((e: any) => DistrRecord.fromJSON(e)) : [] + }; + }, + toJSON(message: DistrInfo): unknown { + const obj: any = {}; + message.totalWeight !== undefined && (obj.totalWeight = message.totalWeight); + if (message.records) { + obj.records = message.records.map(e => e ? DistrRecord.toJSON(e) : undefined); + } else { + obj.records = []; + } + return obj; + }, + fromPartial(object: Partial): DistrInfo { + const message = createBaseDistrInfo(); + message.totalWeight = object.totalWeight ?? ""; + message.records = object.records?.map(e => DistrRecord.fromPartial(e)) || []; + return message; + }, + fromAmino(object: DistrInfoAmino): DistrInfo { + const message = createBaseDistrInfo(); + if (object.total_weight !== undefined && object.total_weight !== null) { + message.totalWeight = object.total_weight; + } + message.records = object.records?.map(e => DistrRecord.fromAmino(e)) || []; + return message; + }, + toAmino(message: DistrInfo): DistrInfoAmino { + const obj: any = {}; + obj.total_weight = message.totalWeight; + if (message.records) { + obj.records = message.records.map(e => e ? DistrRecord.toAmino(e) : undefined); + } else { + obj.records = []; + } + return obj; + }, + fromAminoMsg(object: DistrInfoAminoMsg): DistrInfo { + return DistrInfo.fromAmino(object.value); + }, + toAminoMsg(message: DistrInfo): DistrInfoAminoMsg { + return { + type: "osmosis/poolincentives/distr-info", + value: DistrInfo.toAmino(message) + }; + }, + fromProtoMsg(message: DistrInfoProtoMsg): DistrInfo { + return DistrInfo.decode(message.value); + }, + toProto(message: DistrInfo): Uint8Array { + return DistrInfo.encode(message).finish(); + }, + toProtoMsg(message: DistrInfo): DistrInfoProtoMsg { + return { + typeUrl: "/osmosis.poolincentives.v1beta1.DistrInfo", + value: DistrInfo.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(DistrInfo.typeUrl, DistrInfo); +GlobalDecoderRegistry.registerAminoProtoMapping(DistrInfo.aminoType, DistrInfo.typeUrl); +function createBaseDistrRecord(): DistrRecord { + return { + gaugeId: BigInt(0), + weight: "" + }; +} +export const DistrRecord = { + typeUrl: "/osmosis.poolincentives.v1beta1.DistrRecord", + aminoType: "osmosis/poolincentives/distr-record", + is(o: any): o is DistrRecord { + return o && (o.$typeUrl === DistrRecord.typeUrl || typeof o.gaugeId === "bigint" && typeof o.weight === "string"); + }, + isSDK(o: any): o is DistrRecordSDKType { + return o && (o.$typeUrl === DistrRecord.typeUrl || typeof o.gauge_id === "bigint" && typeof o.weight === "string"); + }, + isAmino(o: any): o is DistrRecordAmino { + return o && (o.$typeUrl === DistrRecord.typeUrl || typeof o.gauge_id === "bigint" && typeof o.weight === "string"); + }, + encode(message: DistrRecord, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.gaugeId !== BigInt(0)) { + writer.uint32(8).uint64(message.gaugeId); + } + if (message.weight !== "") { + writer.uint32(18).string(message.weight); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): DistrRecord { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseDistrRecord(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.gaugeId = reader.uint64(); + break; + case 2: + message.weight = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): DistrRecord { + return { + gaugeId: isSet(object.gaugeId) ? BigInt(object.gaugeId.toString()) : BigInt(0), + weight: isSet(object.weight) ? String(object.weight) : "" + }; + }, + toJSON(message: DistrRecord): unknown { + const obj: any = {}; + message.gaugeId !== undefined && (obj.gaugeId = (message.gaugeId || BigInt(0)).toString()); + message.weight !== undefined && (obj.weight = message.weight); + return obj; + }, + fromPartial(object: Partial): DistrRecord { + const message = createBaseDistrRecord(); + message.gaugeId = object.gaugeId !== undefined && object.gaugeId !== null ? BigInt(object.gaugeId.toString()) : BigInt(0); + message.weight = object.weight ?? ""; + return message; + }, + fromAmino(object: DistrRecordAmino): DistrRecord { + const message = createBaseDistrRecord(); + if (object.gauge_id !== undefined && object.gauge_id !== null) { + message.gaugeId = BigInt(object.gauge_id); + } + if (object.weight !== undefined && object.weight !== null) { + message.weight = object.weight; + } + return message; + }, + toAmino(message: DistrRecord): DistrRecordAmino { + const obj: any = {}; + obj.gauge_id = message.gaugeId ? message.gaugeId.toString() : undefined; + obj.weight = message.weight; + return obj; + }, + fromAminoMsg(object: DistrRecordAminoMsg): DistrRecord { + return DistrRecord.fromAmino(object.value); + }, + toAminoMsg(message: DistrRecord): DistrRecordAminoMsg { + return { + type: "osmosis/poolincentives/distr-record", + value: DistrRecord.toAmino(message) + }; + }, + fromProtoMsg(message: DistrRecordProtoMsg): DistrRecord { + return DistrRecord.decode(message.value); + }, + toProto(message: DistrRecord): Uint8Array { + return DistrRecord.encode(message).finish(); + }, + toProtoMsg(message: DistrRecord): DistrRecordProtoMsg { + return { + typeUrl: "/osmosis.poolincentives.v1beta1.DistrRecord", + value: DistrRecord.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(DistrRecord.typeUrl, DistrRecord); +GlobalDecoderRegistry.registerAminoProtoMapping(DistrRecord.aminoType, DistrRecord.typeUrl); +function createBasePoolToGauge(): PoolToGauge { + return { + poolId: BigInt(0), + gaugeId: BigInt(0), + duration: Duration.fromPartial({}) + }; +} +export const PoolToGauge = { + typeUrl: "/osmosis.poolincentives.v1beta1.PoolToGauge", + aminoType: "osmosis/poolincentives/pool-to-gauge", + is(o: any): o is PoolToGauge { + return o && (o.$typeUrl === PoolToGauge.typeUrl || typeof o.poolId === "bigint" && typeof o.gaugeId === "bigint" && Duration.is(o.duration)); + }, + isSDK(o: any): o is PoolToGaugeSDKType { + return o && (o.$typeUrl === PoolToGauge.typeUrl || typeof o.pool_id === "bigint" && typeof o.gauge_id === "bigint" && Duration.isSDK(o.duration)); + }, + isAmino(o: any): o is PoolToGaugeAmino { + return o && (o.$typeUrl === PoolToGauge.typeUrl || typeof o.pool_id === "bigint" && typeof o.gauge_id === "bigint" && Duration.isAmino(o.duration)); + }, + encode(message: PoolToGauge, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.poolId !== BigInt(0)) { + writer.uint32(8).uint64(message.poolId); + } + if (message.gaugeId !== BigInt(0)) { + writer.uint32(16).uint64(message.gaugeId); + } + if (message.duration !== undefined) { + Duration.encode(message.duration, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): PoolToGauge { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBasePoolToGauge(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.poolId = reader.uint64(); + break; + case 2: + message.gaugeId = reader.uint64(); + break; + case 3: + message.duration = Duration.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): PoolToGauge { + return { + poolId: isSet(object.poolId) ? BigInt(object.poolId.toString()) : BigInt(0), + gaugeId: isSet(object.gaugeId) ? BigInt(object.gaugeId.toString()) : BigInt(0), + duration: isSet(object.duration) ? Duration.fromJSON(object.duration) : undefined + }; + }, + toJSON(message: PoolToGauge): unknown { + const obj: any = {}; + message.poolId !== undefined && (obj.poolId = (message.poolId || BigInt(0)).toString()); + message.gaugeId !== undefined && (obj.gaugeId = (message.gaugeId || BigInt(0)).toString()); + message.duration !== undefined && (obj.duration = message.duration ? Duration.toJSON(message.duration) : undefined); + return obj; + }, + fromPartial(object: Partial): PoolToGauge { + const message = createBasePoolToGauge(); + message.poolId = object.poolId !== undefined && object.poolId !== null ? BigInt(object.poolId.toString()) : BigInt(0); + message.gaugeId = object.gaugeId !== undefined && object.gaugeId !== null ? BigInt(object.gaugeId.toString()) : BigInt(0); + message.duration = object.duration !== undefined && object.duration !== null ? Duration.fromPartial(object.duration) : undefined; + return message; + }, + fromAmino(object: PoolToGaugeAmino): PoolToGauge { + const message = createBasePoolToGauge(); + if (object.pool_id !== undefined && object.pool_id !== null) { + message.poolId = BigInt(object.pool_id); + } + if (object.gauge_id !== undefined && object.gauge_id !== null) { + message.gaugeId = BigInt(object.gauge_id); + } + if (object.duration !== undefined && object.duration !== null) { + message.duration = Duration.fromAmino(object.duration); + } + return message; + }, + toAmino(message: PoolToGauge): PoolToGaugeAmino { + const obj: any = {}; + obj.pool_id = message.poolId ? message.poolId.toString() : undefined; + obj.gauge_id = message.gaugeId ? message.gaugeId.toString() : undefined; + obj.duration = message.duration ? Duration.toAmino(message.duration) : undefined; + return obj; + }, + fromAminoMsg(object: PoolToGaugeAminoMsg): PoolToGauge { + return PoolToGauge.fromAmino(object.value); + }, + toAminoMsg(message: PoolToGauge): PoolToGaugeAminoMsg { + return { + type: "osmosis/poolincentives/pool-to-gauge", + value: PoolToGauge.toAmino(message) + }; + }, + fromProtoMsg(message: PoolToGaugeProtoMsg): PoolToGauge { + return PoolToGauge.decode(message.value); + }, + toProto(message: PoolToGauge): Uint8Array { + return PoolToGauge.encode(message).finish(); + }, + toProtoMsg(message: PoolToGauge): PoolToGaugeProtoMsg { + return { + typeUrl: "/osmosis.poolincentives.v1beta1.PoolToGauge", + value: PoolToGauge.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(PoolToGauge.typeUrl, PoolToGauge); +GlobalDecoderRegistry.registerAminoProtoMapping(PoolToGauge.aminoType, PoolToGauge.typeUrl); +function createBaseAnyPoolToInternalGauges(): AnyPoolToInternalGauges { + return { + poolToGauge: [] + }; +} +export const AnyPoolToInternalGauges = { + typeUrl: "/osmosis.poolincentives.v1beta1.AnyPoolToInternalGauges", + aminoType: "osmosis/poolincentives/any-pool-to-internal-gauges", + is(o: any): o is AnyPoolToInternalGauges { + return o && (o.$typeUrl === AnyPoolToInternalGauges.typeUrl || Array.isArray(o.poolToGauge) && (!o.poolToGauge.length || PoolToGauge.is(o.poolToGauge[0]))); + }, + isSDK(o: any): o is AnyPoolToInternalGaugesSDKType { + return o && (o.$typeUrl === AnyPoolToInternalGauges.typeUrl || Array.isArray(o.pool_to_gauge) && (!o.pool_to_gauge.length || PoolToGauge.isSDK(o.pool_to_gauge[0]))); + }, + isAmino(o: any): o is AnyPoolToInternalGaugesAmino { + return o && (o.$typeUrl === AnyPoolToInternalGauges.typeUrl || Array.isArray(o.pool_to_gauge) && (!o.pool_to_gauge.length || PoolToGauge.isAmino(o.pool_to_gauge[0]))); + }, + encode(message: AnyPoolToInternalGauges, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.poolToGauge) { + PoolToGauge.encode(v!, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): AnyPoolToInternalGauges { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseAnyPoolToInternalGauges(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 2: + message.poolToGauge.push(PoolToGauge.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): AnyPoolToInternalGauges { + return { + poolToGauge: Array.isArray(object?.poolToGauge) ? object.poolToGauge.map((e: any) => PoolToGauge.fromJSON(e)) : [] + }; + }, + toJSON(message: AnyPoolToInternalGauges): unknown { + const obj: any = {}; + if (message.poolToGauge) { + obj.poolToGauge = message.poolToGauge.map(e => e ? PoolToGauge.toJSON(e) : undefined); + } else { + obj.poolToGauge = []; + } + return obj; + }, + fromPartial(object: Partial): AnyPoolToInternalGauges { + const message = createBaseAnyPoolToInternalGauges(); + message.poolToGauge = object.poolToGauge?.map(e => PoolToGauge.fromPartial(e)) || []; + return message; + }, + fromAmino(object: AnyPoolToInternalGaugesAmino): AnyPoolToInternalGauges { + const message = createBaseAnyPoolToInternalGauges(); + message.poolToGauge = object.pool_to_gauge?.map(e => PoolToGauge.fromAmino(e)) || []; + return message; + }, + toAmino(message: AnyPoolToInternalGauges): AnyPoolToInternalGaugesAmino { + const obj: any = {}; + if (message.poolToGauge) { + obj.pool_to_gauge = message.poolToGauge.map(e => e ? PoolToGauge.toAmino(e) : undefined); + } else { + obj.pool_to_gauge = []; + } + return obj; + }, + fromAminoMsg(object: AnyPoolToInternalGaugesAminoMsg): AnyPoolToInternalGauges { + return AnyPoolToInternalGauges.fromAmino(object.value); + }, + toAminoMsg(message: AnyPoolToInternalGauges): AnyPoolToInternalGaugesAminoMsg { + return { + type: "osmosis/poolincentives/any-pool-to-internal-gauges", + value: AnyPoolToInternalGauges.toAmino(message) + }; + }, + fromProtoMsg(message: AnyPoolToInternalGaugesProtoMsg): AnyPoolToInternalGauges { + return AnyPoolToInternalGauges.decode(message.value); + }, + toProto(message: AnyPoolToInternalGauges): Uint8Array { + return AnyPoolToInternalGauges.encode(message).finish(); + }, + toProtoMsg(message: AnyPoolToInternalGauges): AnyPoolToInternalGaugesProtoMsg { + return { + typeUrl: "/osmosis.poolincentives.v1beta1.AnyPoolToInternalGauges", + value: AnyPoolToInternalGauges.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(AnyPoolToInternalGauges.typeUrl, AnyPoolToInternalGauges); +GlobalDecoderRegistry.registerAminoProtoMapping(AnyPoolToInternalGauges.aminoType, AnyPoolToInternalGauges.typeUrl); +function createBaseConcentratedPoolToNoLockGauges(): ConcentratedPoolToNoLockGauges { + return { + poolToGauge: [] + }; +} +export const ConcentratedPoolToNoLockGauges = { + typeUrl: "/osmosis.poolincentives.v1beta1.ConcentratedPoolToNoLockGauges", + aminoType: "osmosis/poolincentives/concentrated-pool-to-no-lock-gauges", + is(o: any): o is ConcentratedPoolToNoLockGauges { + return o && (o.$typeUrl === ConcentratedPoolToNoLockGauges.typeUrl || Array.isArray(o.poolToGauge) && (!o.poolToGauge.length || PoolToGauge.is(o.poolToGauge[0]))); + }, + isSDK(o: any): o is ConcentratedPoolToNoLockGaugesSDKType { + return o && (o.$typeUrl === ConcentratedPoolToNoLockGauges.typeUrl || Array.isArray(o.pool_to_gauge) && (!o.pool_to_gauge.length || PoolToGauge.isSDK(o.pool_to_gauge[0]))); + }, + isAmino(o: any): o is ConcentratedPoolToNoLockGaugesAmino { + return o && (o.$typeUrl === ConcentratedPoolToNoLockGauges.typeUrl || Array.isArray(o.pool_to_gauge) && (!o.pool_to_gauge.length || PoolToGauge.isAmino(o.pool_to_gauge[0]))); + }, + encode(message: ConcentratedPoolToNoLockGauges, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.poolToGauge) { + PoolToGauge.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): ConcentratedPoolToNoLockGauges { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseConcentratedPoolToNoLockGauges(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.poolToGauge.push(PoolToGauge.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): ConcentratedPoolToNoLockGauges { + return { + poolToGauge: Array.isArray(object?.poolToGauge) ? object.poolToGauge.map((e: any) => PoolToGauge.fromJSON(e)) : [] + }; + }, + toJSON(message: ConcentratedPoolToNoLockGauges): unknown { + const obj: any = {}; + if (message.poolToGauge) { + obj.poolToGauge = message.poolToGauge.map(e => e ? PoolToGauge.toJSON(e) : undefined); + } else { + obj.poolToGauge = []; + } + return obj; + }, + fromPartial(object: Partial): ConcentratedPoolToNoLockGauges { + const message = createBaseConcentratedPoolToNoLockGauges(); + message.poolToGauge = object.poolToGauge?.map(e => PoolToGauge.fromPartial(e)) || []; + return message; + }, + fromAmino(object: ConcentratedPoolToNoLockGaugesAmino): ConcentratedPoolToNoLockGauges { + const message = createBaseConcentratedPoolToNoLockGauges(); + message.poolToGauge = object.pool_to_gauge?.map(e => PoolToGauge.fromAmino(e)) || []; + return message; + }, + toAmino(message: ConcentratedPoolToNoLockGauges): ConcentratedPoolToNoLockGaugesAmino { + const obj: any = {}; + if (message.poolToGauge) { + obj.pool_to_gauge = message.poolToGauge.map(e => e ? PoolToGauge.toAmino(e) : undefined); + } else { + obj.pool_to_gauge = []; + } + return obj; + }, + fromAminoMsg(object: ConcentratedPoolToNoLockGaugesAminoMsg): ConcentratedPoolToNoLockGauges { + return ConcentratedPoolToNoLockGauges.fromAmino(object.value); + }, + toAminoMsg(message: ConcentratedPoolToNoLockGauges): ConcentratedPoolToNoLockGaugesAminoMsg { + return { + type: "osmosis/poolincentives/concentrated-pool-to-no-lock-gauges", + value: ConcentratedPoolToNoLockGauges.toAmino(message) + }; + }, + fromProtoMsg(message: ConcentratedPoolToNoLockGaugesProtoMsg): ConcentratedPoolToNoLockGauges { + return ConcentratedPoolToNoLockGauges.decode(message.value); + }, + toProto(message: ConcentratedPoolToNoLockGauges): Uint8Array { + return ConcentratedPoolToNoLockGauges.encode(message).finish(); + }, + toProtoMsg(message: ConcentratedPoolToNoLockGauges): ConcentratedPoolToNoLockGaugesProtoMsg { + return { + typeUrl: "/osmosis.poolincentives.v1beta1.ConcentratedPoolToNoLockGauges", + value: ConcentratedPoolToNoLockGauges.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(ConcentratedPoolToNoLockGauges.typeUrl, ConcentratedPoolToNoLockGauges); +GlobalDecoderRegistry.registerAminoProtoMapping(ConcentratedPoolToNoLockGauges.aminoType, ConcentratedPoolToNoLockGauges.typeUrl); \ No newline at end of file diff --git a/packages/osmojs/src/codegen/osmosis/pool-incentives/v1beta1/query.lcd.ts b/packages/osmojs/src/codegen/osmosis/poolincentives/v1beta1/query.lcd.ts similarity index 100% rename from packages/osmojs/src/codegen/osmosis/pool-incentives/v1beta1/query.lcd.ts rename to packages/osmojs/src/codegen/osmosis/poolincentives/v1beta1/query.lcd.ts diff --git a/packages/osmojs/src/codegen/osmosis/pool-incentives/v1beta1/query.rpc.Query.ts b/packages/osmojs/src/codegen/osmosis/poolincentives/v1beta1/query.rpc.Query.ts similarity index 100% rename from packages/osmojs/src/codegen/osmosis/pool-incentives/v1beta1/query.rpc.Query.ts rename to packages/osmojs/src/codegen/osmosis/poolincentives/v1beta1/query.rpc.Query.ts diff --git a/packages/osmojs/src/codegen/osmosis/pool-incentives/v1beta1/query.ts b/packages/osmojs/src/codegen/osmosis/poolincentives/v1beta1/query.ts similarity index 68% rename from packages/osmojs/src/codegen/osmosis/pool-incentives/v1beta1/query.ts rename to packages/osmojs/src/codegen/osmosis/poolincentives/v1beta1/query.ts index de37cc2d4..149af49a5 100644 --- a/packages/osmojs/src/codegen/osmosis/pool-incentives/v1beta1/query.ts +++ b/packages/osmojs/src/codegen/osmosis/poolincentives/v1beta1/query.ts @@ -2,6 +2,8 @@ import { Duration, DurationAmino, DurationSDKType } from "../../../google/protob import { DistrInfo, DistrInfoAmino, DistrInfoSDKType, Params, ParamsAmino, ParamsSDKType } from "./incentives"; import { Gauge, GaugeAmino, GaugeSDKType } from "../../incentives/gauge"; import { BinaryReader, BinaryWriter } from "../../../binary"; +import { isSet } from "../../../helpers"; +import { GlobalDecoderRegistry } from "../../../registry"; export interface QueryGaugeIdsRequest { poolId: bigint; } @@ -10,7 +12,7 @@ export interface QueryGaugeIdsRequestProtoMsg { value: Uint8Array; } export interface QueryGaugeIdsRequestAmino { - pool_id: string; + pool_id?: string; } export interface QueryGaugeIdsRequestAminoMsg { type: "osmosis/poolincentives/query-gauge-ids-request"; @@ -27,7 +29,7 @@ export interface QueryGaugeIdsResponseProtoMsg { value: Uint8Array; } export interface QueryGaugeIdsResponseAmino { - gauge_ids_with_duration: QueryGaugeIdsResponse_GaugeIdWithDurationAmino[]; + gauge_ids_with_duration?: QueryGaugeIdsResponse_GaugeIdWithDurationAmino[]; } export interface QueryGaugeIdsResponseAminoMsg { type: "osmosis/poolincentives/query-gauge-ids-response"; @@ -46,9 +48,9 @@ export interface QueryGaugeIdsResponse_GaugeIdWithDurationProtoMsg { value: Uint8Array; } export interface QueryGaugeIdsResponse_GaugeIdWithDurationAmino { - gauge_id: string; + gauge_id?: string; duration?: DurationAmino; - gauge_incentive_percentage: string; + gauge_incentive_percentage?: string; } export interface QueryGaugeIdsResponse_GaugeIdWithDurationAminoMsg { type: "osmosis/poolincentives/gauge-id-with-duration"; @@ -134,7 +136,7 @@ export interface QueryLockableDurationsResponseProtoMsg { value: Uint8Array; } export interface QueryLockableDurationsResponseAmino { - lockable_durations: DurationAmino[]; + lockable_durations?: DurationAmino[]; } export interface QueryLockableDurationsResponseAminoMsg { type: "osmosis/poolincentives/query-lockable-durations-response"; @@ -164,9 +166,9 @@ export interface IncentivizedPoolProtoMsg { value: Uint8Array; } export interface IncentivizedPoolAmino { - pool_id: string; + pool_id?: string; lockable_duration?: DurationAmino; - gauge_id: string; + gauge_id?: string; } export interface IncentivizedPoolAminoMsg { type: "osmosis/poolincentives/incentivized-pool"; @@ -185,7 +187,7 @@ export interface QueryIncentivizedPoolsResponseProtoMsg { value: Uint8Array; } export interface QueryIncentivizedPoolsResponseAmino { - incentivized_pools: IncentivizedPoolAmino[]; + incentivized_pools?: IncentivizedPoolAmino[]; } export interface QueryIncentivizedPoolsResponseAminoMsg { type: "osmosis/poolincentives/query-incentivized-pools-response"; @@ -213,7 +215,7 @@ export interface QueryExternalIncentiveGaugesResponseProtoMsg { value: Uint8Array; } export interface QueryExternalIncentiveGaugesResponseAmino { - data: GaugeAmino[]; + data?: GaugeAmino[]; } export interface QueryExternalIncentiveGaugesResponseAminoMsg { type: "osmosis/poolincentives/query-external-incentive-gauges-response"; @@ -229,6 +231,16 @@ function createBaseQueryGaugeIdsRequest(): QueryGaugeIdsRequest { } export const QueryGaugeIdsRequest = { typeUrl: "/osmosis.poolincentives.v1beta1.QueryGaugeIdsRequest", + aminoType: "osmosis/poolincentives/query-gauge-ids-request", + is(o: any): o is QueryGaugeIdsRequest { + return o && (o.$typeUrl === QueryGaugeIdsRequest.typeUrl || typeof o.poolId === "bigint"); + }, + isSDK(o: any): o is QueryGaugeIdsRequestSDKType { + return o && (o.$typeUrl === QueryGaugeIdsRequest.typeUrl || typeof o.pool_id === "bigint"); + }, + isAmino(o: any): o is QueryGaugeIdsRequestAmino { + return o && (o.$typeUrl === QueryGaugeIdsRequest.typeUrl || typeof o.pool_id === "bigint"); + }, encode(message: QueryGaugeIdsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.poolId !== BigInt(0)) { writer.uint32(8).uint64(message.poolId); @@ -252,15 +264,27 @@ export const QueryGaugeIdsRequest = { } return message; }, + fromJSON(object: any): QueryGaugeIdsRequest { + return { + poolId: isSet(object.poolId) ? BigInt(object.poolId.toString()) : BigInt(0) + }; + }, + toJSON(message: QueryGaugeIdsRequest): unknown { + const obj: any = {}; + message.poolId !== undefined && (obj.poolId = (message.poolId || BigInt(0)).toString()); + return obj; + }, fromPartial(object: Partial): QueryGaugeIdsRequest { const message = createBaseQueryGaugeIdsRequest(); message.poolId = object.poolId !== undefined && object.poolId !== null ? BigInt(object.poolId.toString()) : BigInt(0); return message; }, fromAmino(object: QueryGaugeIdsRequestAmino): QueryGaugeIdsRequest { - return { - poolId: BigInt(object.pool_id) - }; + const message = createBaseQueryGaugeIdsRequest(); + if (object.pool_id !== undefined && object.pool_id !== null) { + message.poolId = BigInt(object.pool_id); + } + return message; }, toAmino(message: QueryGaugeIdsRequest): QueryGaugeIdsRequestAmino { const obj: any = {}; @@ -289,6 +313,8 @@ export const QueryGaugeIdsRequest = { }; } }; +GlobalDecoderRegistry.register(QueryGaugeIdsRequest.typeUrl, QueryGaugeIdsRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryGaugeIdsRequest.aminoType, QueryGaugeIdsRequest.typeUrl); function createBaseQueryGaugeIdsResponse(): QueryGaugeIdsResponse { return { gaugeIdsWithDuration: [] @@ -296,6 +322,16 @@ function createBaseQueryGaugeIdsResponse(): QueryGaugeIdsResponse { } export const QueryGaugeIdsResponse = { typeUrl: "/osmosis.poolincentives.v1beta1.QueryGaugeIdsResponse", + aminoType: "osmosis/poolincentives/query-gauge-ids-response", + is(o: any): o is QueryGaugeIdsResponse { + return o && (o.$typeUrl === QueryGaugeIdsResponse.typeUrl || Array.isArray(o.gaugeIdsWithDuration) && (!o.gaugeIdsWithDuration.length || QueryGaugeIdsResponse_GaugeIdWithDuration.is(o.gaugeIdsWithDuration[0]))); + }, + isSDK(o: any): o is QueryGaugeIdsResponseSDKType { + return o && (o.$typeUrl === QueryGaugeIdsResponse.typeUrl || Array.isArray(o.gauge_ids_with_duration) && (!o.gauge_ids_with_duration.length || QueryGaugeIdsResponse_GaugeIdWithDuration.isSDK(o.gauge_ids_with_duration[0]))); + }, + isAmino(o: any): o is QueryGaugeIdsResponseAmino { + return o && (o.$typeUrl === QueryGaugeIdsResponse.typeUrl || Array.isArray(o.gauge_ids_with_duration) && (!o.gauge_ids_with_duration.length || QueryGaugeIdsResponse_GaugeIdWithDuration.isAmino(o.gauge_ids_with_duration[0]))); + }, encode(message: QueryGaugeIdsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.gaugeIdsWithDuration) { QueryGaugeIdsResponse_GaugeIdWithDuration.encode(v!, writer.uint32(10).fork()).ldelim(); @@ -319,15 +355,29 @@ export const QueryGaugeIdsResponse = { } return message; }, + fromJSON(object: any): QueryGaugeIdsResponse { + return { + gaugeIdsWithDuration: Array.isArray(object?.gaugeIdsWithDuration) ? object.gaugeIdsWithDuration.map((e: any) => QueryGaugeIdsResponse_GaugeIdWithDuration.fromJSON(e)) : [] + }; + }, + toJSON(message: QueryGaugeIdsResponse): unknown { + const obj: any = {}; + if (message.gaugeIdsWithDuration) { + obj.gaugeIdsWithDuration = message.gaugeIdsWithDuration.map(e => e ? QueryGaugeIdsResponse_GaugeIdWithDuration.toJSON(e) : undefined); + } else { + obj.gaugeIdsWithDuration = []; + } + return obj; + }, fromPartial(object: Partial): QueryGaugeIdsResponse { const message = createBaseQueryGaugeIdsResponse(); message.gaugeIdsWithDuration = object.gaugeIdsWithDuration?.map(e => QueryGaugeIdsResponse_GaugeIdWithDuration.fromPartial(e)) || []; return message; }, fromAmino(object: QueryGaugeIdsResponseAmino): QueryGaugeIdsResponse { - return { - gaugeIdsWithDuration: Array.isArray(object?.gauge_ids_with_duration) ? object.gauge_ids_with_duration.map((e: any) => QueryGaugeIdsResponse_GaugeIdWithDuration.fromAmino(e)) : [] - }; + const message = createBaseQueryGaugeIdsResponse(); + message.gaugeIdsWithDuration = object.gauge_ids_with_duration?.map(e => QueryGaugeIdsResponse_GaugeIdWithDuration.fromAmino(e)) || []; + return message; }, toAmino(message: QueryGaugeIdsResponse): QueryGaugeIdsResponseAmino { const obj: any = {}; @@ -360,15 +410,27 @@ export const QueryGaugeIdsResponse = { }; } }; +GlobalDecoderRegistry.register(QueryGaugeIdsResponse.typeUrl, QueryGaugeIdsResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryGaugeIdsResponse.aminoType, QueryGaugeIdsResponse.typeUrl); function createBaseQueryGaugeIdsResponse_GaugeIdWithDuration(): QueryGaugeIdsResponse_GaugeIdWithDuration { return { gaugeId: BigInt(0), - duration: undefined, + duration: Duration.fromPartial({}), gaugeIncentivePercentage: "" }; } export const QueryGaugeIdsResponse_GaugeIdWithDuration = { typeUrl: "/osmosis.poolincentives.v1beta1.GaugeIdWithDuration", + aminoType: "osmosis/poolincentives/gauge-id-with-duration", + is(o: any): o is QueryGaugeIdsResponse_GaugeIdWithDuration { + return o && (o.$typeUrl === QueryGaugeIdsResponse_GaugeIdWithDuration.typeUrl || typeof o.gaugeId === "bigint" && Duration.is(o.duration) && typeof o.gaugeIncentivePercentage === "string"); + }, + isSDK(o: any): o is QueryGaugeIdsResponse_GaugeIdWithDurationSDKType { + return o && (o.$typeUrl === QueryGaugeIdsResponse_GaugeIdWithDuration.typeUrl || typeof o.gauge_id === "bigint" && Duration.isSDK(o.duration) && typeof o.gauge_incentive_percentage === "string"); + }, + isAmino(o: any): o is QueryGaugeIdsResponse_GaugeIdWithDurationAmino { + return o && (o.$typeUrl === QueryGaugeIdsResponse_GaugeIdWithDuration.typeUrl || typeof o.gauge_id === "bigint" && Duration.isAmino(o.duration) && typeof o.gauge_incentive_percentage === "string"); + }, encode(message: QueryGaugeIdsResponse_GaugeIdWithDuration, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.gaugeId !== BigInt(0)) { writer.uint32(8).uint64(message.gaugeId); @@ -404,6 +466,20 @@ export const QueryGaugeIdsResponse_GaugeIdWithDuration = { } return message; }, + fromJSON(object: any): QueryGaugeIdsResponse_GaugeIdWithDuration { + return { + gaugeId: isSet(object.gaugeId) ? BigInt(object.gaugeId.toString()) : BigInt(0), + duration: isSet(object.duration) ? Duration.fromJSON(object.duration) : undefined, + gaugeIncentivePercentage: isSet(object.gaugeIncentivePercentage) ? String(object.gaugeIncentivePercentage) : "" + }; + }, + toJSON(message: QueryGaugeIdsResponse_GaugeIdWithDuration): unknown { + const obj: any = {}; + message.gaugeId !== undefined && (obj.gaugeId = (message.gaugeId || BigInt(0)).toString()); + message.duration !== undefined && (obj.duration = message.duration ? Duration.toJSON(message.duration) : undefined); + message.gaugeIncentivePercentage !== undefined && (obj.gaugeIncentivePercentage = message.gaugeIncentivePercentage); + return obj; + }, fromPartial(object: Partial): QueryGaugeIdsResponse_GaugeIdWithDuration { const message = createBaseQueryGaugeIdsResponse_GaugeIdWithDuration(); message.gaugeId = object.gaugeId !== undefined && object.gaugeId !== null ? BigInt(object.gaugeId.toString()) : BigInt(0); @@ -412,11 +488,17 @@ export const QueryGaugeIdsResponse_GaugeIdWithDuration = { return message; }, fromAmino(object: QueryGaugeIdsResponse_GaugeIdWithDurationAmino): QueryGaugeIdsResponse_GaugeIdWithDuration { - return { - gaugeId: BigInt(object.gauge_id), - duration: object?.duration ? Duration.fromAmino(object.duration) : undefined, - gaugeIncentivePercentage: object.gauge_incentive_percentage - }; + const message = createBaseQueryGaugeIdsResponse_GaugeIdWithDuration(); + if (object.gauge_id !== undefined && object.gauge_id !== null) { + message.gaugeId = BigInt(object.gauge_id); + } + if (object.duration !== undefined && object.duration !== null) { + message.duration = Duration.fromAmino(object.duration); + } + if (object.gauge_incentive_percentage !== undefined && object.gauge_incentive_percentage !== null) { + message.gaugeIncentivePercentage = object.gauge_incentive_percentage; + } + return message; }, toAmino(message: QueryGaugeIdsResponse_GaugeIdWithDuration): QueryGaugeIdsResponse_GaugeIdWithDurationAmino { const obj: any = {}; @@ -447,11 +529,23 @@ export const QueryGaugeIdsResponse_GaugeIdWithDuration = { }; } }; +GlobalDecoderRegistry.register(QueryGaugeIdsResponse_GaugeIdWithDuration.typeUrl, QueryGaugeIdsResponse_GaugeIdWithDuration); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryGaugeIdsResponse_GaugeIdWithDuration.aminoType, QueryGaugeIdsResponse_GaugeIdWithDuration.typeUrl); function createBaseQueryDistrInfoRequest(): QueryDistrInfoRequest { return {}; } export const QueryDistrInfoRequest = { typeUrl: "/osmosis.poolincentives.v1beta1.QueryDistrInfoRequest", + aminoType: "osmosis/poolincentives/query-distr-info-request", + is(o: any): o is QueryDistrInfoRequest { + return o && o.$typeUrl === QueryDistrInfoRequest.typeUrl; + }, + isSDK(o: any): o is QueryDistrInfoRequestSDKType { + return o && o.$typeUrl === QueryDistrInfoRequest.typeUrl; + }, + isAmino(o: any): o is QueryDistrInfoRequestAmino { + return o && o.$typeUrl === QueryDistrInfoRequest.typeUrl; + }, encode(_: QueryDistrInfoRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, @@ -469,12 +563,20 @@ export const QueryDistrInfoRequest = { } return message; }, + fromJSON(_: any): QueryDistrInfoRequest { + return {}; + }, + toJSON(_: QueryDistrInfoRequest): unknown { + const obj: any = {}; + return obj; + }, fromPartial(_: Partial): QueryDistrInfoRequest { const message = createBaseQueryDistrInfoRequest(); return message; }, fromAmino(_: QueryDistrInfoRequestAmino): QueryDistrInfoRequest { - return {}; + const message = createBaseQueryDistrInfoRequest(); + return message; }, toAmino(_: QueryDistrInfoRequest): QueryDistrInfoRequestAmino { const obj: any = {}; @@ -502,6 +604,8 @@ export const QueryDistrInfoRequest = { }; } }; +GlobalDecoderRegistry.register(QueryDistrInfoRequest.typeUrl, QueryDistrInfoRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryDistrInfoRequest.aminoType, QueryDistrInfoRequest.typeUrl); function createBaseQueryDistrInfoResponse(): QueryDistrInfoResponse { return { distrInfo: DistrInfo.fromPartial({}) @@ -509,6 +613,16 @@ function createBaseQueryDistrInfoResponse(): QueryDistrInfoResponse { } export const QueryDistrInfoResponse = { typeUrl: "/osmosis.poolincentives.v1beta1.QueryDistrInfoResponse", + aminoType: "osmosis/poolincentives/query-distr-info-response", + is(o: any): o is QueryDistrInfoResponse { + return o && (o.$typeUrl === QueryDistrInfoResponse.typeUrl || DistrInfo.is(o.distrInfo)); + }, + isSDK(o: any): o is QueryDistrInfoResponseSDKType { + return o && (o.$typeUrl === QueryDistrInfoResponse.typeUrl || DistrInfo.isSDK(o.distr_info)); + }, + isAmino(o: any): o is QueryDistrInfoResponseAmino { + return o && (o.$typeUrl === QueryDistrInfoResponse.typeUrl || DistrInfo.isAmino(o.distr_info)); + }, encode(message: QueryDistrInfoResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.distrInfo !== undefined) { DistrInfo.encode(message.distrInfo, writer.uint32(10).fork()).ldelim(); @@ -532,15 +646,27 @@ export const QueryDistrInfoResponse = { } return message; }, + fromJSON(object: any): QueryDistrInfoResponse { + return { + distrInfo: isSet(object.distrInfo) ? DistrInfo.fromJSON(object.distrInfo) : undefined + }; + }, + toJSON(message: QueryDistrInfoResponse): unknown { + const obj: any = {}; + message.distrInfo !== undefined && (obj.distrInfo = message.distrInfo ? DistrInfo.toJSON(message.distrInfo) : undefined); + return obj; + }, fromPartial(object: Partial): QueryDistrInfoResponse { const message = createBaseQueryDistrInfoResponse(); message.distrInfo = object.distrInfo !== undefined && object.distrInfo !== null ? DistrInfo.fromPartial(object.distrInfo) : undefined; return message; }, fromAmino(object: QueryDistrInfoResponseAmino): QueryDistrInfoResponse { - return { - distrInfo: object?.distr_info ? DistrInfo.fromAmino(object.distr_info) : undefined - }; + const message = createBaseQueryDistrInfoResponse(); + if (object.distr_info !== undefined && object.distr_info !== null) { + message.distrInfo = DistrInfo.fromAmino(object.distr_info); + } + return message; }, toAmino(message: QueryDistrInfoResponse): QueryDistrInfoResponseAmino { const obj: any = {}; @@ -569,11 +695,23 @@ export const QueryDistrInfoResponse = { }; } }; +GlobalDecoderRegistry.register(QueryDistrInfoResponse.typeUrl, QueryDistrInfoResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryDistrInfoResponse.aminoType, QueryDistrInfoResponse.typeUrl); function createBaseQueryParamsRequest(): QueryParamsRequest { return {}; } export const QueryParamsRequest = { typeUrl: "/osmosis.poolincentives.v1beta1.QueryParamsRequest", + aminoType: "osmosis/poolincentives/query-params-request", + is(o: any): o is QueryParamsRequest { + return o && o.$typeUrl === QueryParamsRequest.typeUrl; + }, + isSDK(o: any): o is QueryParamsRequestSDKType { + return o && o.$typeUrl === QueryParamsRequest.typeUrl; + }, + isAmino(o: any): o is QueryParamsRequestAmino { + return o && o.$typeUrl === QueryParamsRequest.typeUrl; + }, encode(_: QueryParamsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, @@ -591,12 +729,20 @@ export const QueryParamsRequest = { } return message; }, + fromJSON(_: any): QueryParamsRequest { + return {}; + }, + toJSON(_: QueryParamsRequest): unknown { + const obj: any = {}; + return obj; + }, fromPartial(_: Partial): QueryParamsRequest { const message = createBaseQueryParamsRequest(); return message; }, fromAmino(_: QueryParamsRequestAmino): QueryParamsRequest { - return {}; + const message = createBaseQueryParamsRequest(); + return message; }, toAmino(_: QueryParamsRequest): QueryParamsRequestAmino { const obj: any = {}; @@ -624,6 +770,8 @@ export const QueryParamsRequest = { }; } }; +GlobalDecoderRegistry.register(QueryParamsRequest.typeUrl, QueryParamsRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryParamsRequest.aminoType, QueryParamsRequest.typeUrl); function createBaseQueryParamsResponse(): QueryParamsResponse { return { params: Params.fromPartial({}) @@ -631,6 +779,16 @@ function createBaseQueryParamsResponse(): QueryParamsResponse { } export const QueryParamsResponse = { typeUrl: "/osmosis.poolincentives.v1beta1.QueryParamsResponse", + aminoType: "osmosis/poolincentives/query-params-response", + is(o: any): o is QueryParamsResponse { + return o && (o.$typeUrl === QueryParamsResponse.typeUrl || Params.is(o.params)); + }, + isSDK(o: any): o is QueryParamsResponseSDKType { + return o && (o.$typeUrl === QueryParamsResponse.typeUrl || Params.isSDK(o.params)); + }, + isAmino(o: any): o is QueryParamsResponseAmino { + return o && (o.$typeUrl === QueryParamsResponse.typeUrl || Params.isAmino(o.params)); + }, encode(message: QueryParamsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.params !== undefined) { Params.encode(message.params, writer.uint32(10).fork()).ldelim(); @@ -654,15 +812,27 @@ export const QueryParamsResponse = { } return message; }, + fromJSON(object: any): QueryParamsResponse { + 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; + }, fromPartial(object: Partial): QueryParamsResponse { const message = createBaseQueryParamsResponse(); message.params = object.params !== undefined && object.params !== null ? Params.fromPartial(object.params) : undefined; return message; }, fromAmino(object: QueryParamsResponseAmino): QueryParamsResponse { - return { - params: object?.params ? Params.fromAmino(object.params) : undefined - }; + const message = createBaseQueryParamsResponse(); + if (object.params !== undefined && object.params !== null) { + message.params = Params.fromAmino(object.params); + } + return message; }, toAmino(message: QueryParamsResponse): QueryParamsResponseAmino { const obj: any = {}; @@ -691,11 +861,23 @@ export const QueryParamsResponse = { }; } }; +GlobalDecoderRegistry.register(QueryParamsResponse.typeUrl, QueryParamsResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryParamsResponse.aminoType, QueryParamsResponse.typeUrl); function createBaseQueryLockableDurationsRequest(): QueryLockableDurationsRequest { return {}; } export const QueryLockableDurationsRequest = { typeUrl: "/osmosis.poolincentives.v1beta1.QueryLockableDurationsRequest", + aminoType: "osmosis/poolincentives/query-lockable-durations-request", + is(o: any): o is QueryLockableDurationsRequest { + return o && o.$typeUrl === QueryLockableDurationsRequest.typeUrl; + }, + isSDK(o: any): o is QueryLockableDurationsRequestSDKType { + return o && o.$typeUrl === QueryLockableDurationsRequest.typeUrl; + }, + isAmino(o: any): o is QueryLockableDurationsRequestAmino { + return o && o.$typeUrl === QueryLockableDurationsRequest.typeUrl; + }, encode(_: QueryLockableDurationsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, @@ -713,12 +895,20 @@ export const QueryLockableDurationsRequest = { } return message; }, + fromJSON(_: any): QueryLockableDurationsRequest { + return {}; + }, + toJSON(_: QueryLockableDurationsRequest): unknown { + const obj: any = {}; + return obj; + }, fromPartial(_: Partial): QueryLockableDurationsRequest { const message = createBaseQueryLockableDurationsRequest(); return message; }, fromAmino(_: QueryLockableDurationsRequestAmino): QueryLockableDurationsRequest { - return {}; + const message = createBaseQueryLockableDurationsRequest(); + return message; }, toAmino(_: QueryLockableDurationsRequest): QueryLockableDurationsRequestAmino { const obj: any = {}; @@ -746,6 +936,8 @@ export const QueryLockableDurationsRequest = { }; } }; +GlobalDecoderRegistry.register(QueryLockableDurationsRequest.typeUrl, QueryLockableDurationsRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryLockableDurationsRequest.aminoType, QueryLockableDurationsRequest.typeUrl); function createBaseQueryLockableDurationsResponse(): QueryLockableDurationsResponse { return { lockableDurations: [] @@ -753,6 +945,16 @@ function createBaseQueryLockableDurationsResponse(): QueryLockableDurationsRespo } export const QueryLockableDurationsResponse = { typeUrl: "/osmosis.poolincentives.v1beta1.QueryLockableDurationsResponse", + aminoType: "osmosis/poolincentives/query-lockable-durations-response", + is(o: any): o is QueryLockableDurationsResponse { + return o && (o.$typeUrl === QueryLockableDurationsResponse.typeUrl || Array.isArray(o.lockableDurations) && (!o.lockableDurations.length || Duration.is(o.lockableDurations[0]))); + }, + isSDK(o: any): o is QueryLockableDurationsResponseSDKType { + return o && (o.$typeUrl === QueryLockableDurationsResponse.typeUrl || Array.isArray(o.lockable_durations) && (!o.lockable_durations.length || Duration.isSDK(o.lockable_durations[0]))); + }, + isAmino(o: any): o is QueryLockableDurationsResponseAmino { + return o && (o.$typeUrl === QueryLockableDurationsResponse.typeUrl || Array.isArray(o.lockable_durations) && (!o.lockable_durations.length || Duration.isAmino(o.lockable_durations[0]))); + }, encode(message: QueryLockableDurationsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.lockableDurations) { Duration.encode(v!, writer.uint32(10).fork()).ldelim(); @@ -776,15 +978,29 @@ export const QueryLockableDurationsResponse = { } return message; }, + fromJSON(object: any): QueryLockableDurationsResponse { + return { + lockableDurations: Array.isArray(object?.lockableDurations) ? object.lockableDurations.map((e: any) => Duration.fromJSON(e)) : [] + }; + }, + toJSON(message: QueryLockableDurationsResponse): unknown { + const obj: any = {}; + if (message.lockableDurations) { + obj.lockableDurations = message.lockableDurations.map(e => e ? Duration.toJSON(e) : undefined); + } else { + obj.lockableDurations = []; + } + return obj; + }, fromPartial(object: Partial): QueryLockableDurationsResponse { const message = createBaseQueryLockableDurationsResponse(); message.lockableDurations = object.lockableDurations?.map(e => Duration.fromPartial(e)) || []; return message; }, fromAmino(object: QueryLockableDurationsResponseAmino): QueryLockableDurationsResponse { - return { - lockableDurations: Array.isArray(object?.lockable_durations) ? object.lockable_durations.map((e: any) => Duration.fromAmino(e)) : [] - }; + const message = createBaseQueryLockableDurationsResponse(); + message.lockableDurations = object.lockable_durations?.map(e => Duration.fromAmino(e)) || []; + return message; }, toAmino(message: QueryLockableDurationsResponse): QueryLockableDurationsResponseAmino { const obj: any = {}; @@ -817,11 +1033,23 @@ export const QueryLockableDurationsResponse = { }; } }; +GlobalDecoderRegistry.register(QueryLockableDurationsResponse.typeUrl, QueryLockableDurationsResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryLockableDurationsResponse.aminoType, QueryLockableDurationsResponse.typeUrl); function createBaseQueryIncentivizedPoolsRequest(): QueryIncentivizedPoolsRequest { return {}; } export const QueryIncentivizedPoolsRequest = { typeUrl: "/osmosis.poolincentives.v1beta1.QueryIncentivizedPoolsRequest", + aminoType: "osmosis/poolincentives/query-incentivized-pools-request", + is(o: any): o is QueryIncentivizedPoolsRequest { + return o && o.$typeUrl === QueryIncentivizedPoolsRequest.typeUrl; + }, + isSDK(o: any): o is QueryIncentivizedPoolsRequestSDKType { + return o && o.$typeUrl === QueryIncentivizedPoolsRequest.typeUrl; + }, + isAmino(o: any): o is QueryIncentivizedPoolsRequestAmino { + return o && o.$typeUrl === QueryIncentivizedPoolsRequest.typeUrl; + }, encode(_: QueryIncentivizedPoolsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, @@ -839,12 +1067,20 @@ export const QueryIncentivizedPoolsRequest = { } return message; }, + fromJSON(_: any): QueryIncentivizedPoolsRequest { + return {}; + }, + toJSON(_: QueryIncentivizedPoolsRequest): unknown { + const obj: any = {}; + return obj; + }, fromPartial(_: Partial): QueryIncentivizedPoolsRequest { const message = createBaseQueryIncentivizedPoolsRequest(); return message; }, fromAmino(_: QueryIncentivizedPoolsRequestAmino): QueryIncentivizedPoolsRequest { - return {}; + const message = createBaseQueryIncentivizedPoolsRequest(); + return message; }, toAmino(_: QueryIncentivizedPoolsRequest): QueryIncentivizedPoolsRequestAmino { const obj: any = {}; @@ -872,15 +1108,27 @@ export const QueryIncentivizedPoolsRequest = { }; } }; +GlobalDecoderRegistry.register(QueryIncentivizedPoolsRequest.typeUrl, QueryIncentivizedPoolsRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryIncentivizedPoolsRequest.aminoType, QueryIncentivizedPoolsRequest.typeUrl); function createBaseIncentivizedPool(): IncentivizedPool { return { poolId: BigInt(0), - lockableDuration: undefined, + lockableDuration: Duration.fromPartial({}), gaugeId: BigInt(0) }; } export const IncentivizedPool = { typeUrl: "/osmosis.poolincentives.v1beta1.IncentivizedPool", + aminoType: "osmosis/poolincentives/incentivized-pool", + is(o: any): o is IncentivizedPool { + return o && (o.$typeUrl === IncentivizedPool.typeUrl || typeof o.poolId === "bigint" && Duration.is(o.lockableDuration) && typeof o.gaugeId === "bigint"); + }, + isSDK(o: any): o is IncentivizedPoolSDKType { + return o && (o.$typeUrl === IncentivizedPool.typeUrl || typeof o.pool_id === "bigint" && Duration.isSDK(o.lockable_duration) && typeof o.gauge_id === "bigint"); + }, + isAmino(o: any): o is IncentivizedPoolAmino { + return o && (o.$typeUrl === IncentivizedPool.typeUrl || typeof o.pool_id === "bigint" && Duration.isAmino(o.lockable_duration) && typeof o.gauge_id === "bigint"); + }, encode(message: IncentivizedPool, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.poolId !== BigInt(0)) { writer.uint32(8).uint64(message.poolId); @@ -916,6 +1164,20 @@ export const IncentivizedPool = { } return message; }, + fromJSON(object: any): IncentivizedPool { + return { + poolId: isSet(object.poolId) ? BigInt(object.poolId.toString()) : BigInt(0), + lockableDuration: isSet(object.lockableDuration) ? Duration.fromJSON(object.lockableDuration) : undefined, + gaugeId: isSet(object.gaugeId) ? BigInt(object.gaugeId.toString()) : BigInt(0) + }; + }, + toJSON(message: IncentivizedPool): unknown { + const obj: any = {}; + message.poolId !== undefined && (obj.poolId = (message.poolId || BigInt(0)).toString()); + message.lockableDuration !== undefined && (obj.lockableDuration = message.lockableDuration ? Duration.toJSON(message.lockableDuration) : undefined); + message.gaugeId !== undefined && (obj.gaugeId = (message.gaugeId || BigInt(0)).toString()); + return obj; + }, fromPartial(object: Partial): IncentivizedPool { const message = createBaseIncentivizedPool(); message.poolId = object.poolId !== undefined && object.poolId !== null ? BigInt(object.poolId.toString()) : BigInt(0); @@ -924,11 +1186,17 @@ export const IncentivizedPool = { return message; }, fromAmino(object: IncentivizedPoolAmino): IncentivizedPool { - return { - poolId: BigInt(object.pool_id), - lockableDuration: object?.lockable_duration ? Duration.fromAmino(object.lockable_duration) : undefined, - gaugeId: BigInt(object.gauge_id) - }; + const message = createBaseIncentivizedPool(); + if (object.pool_id !== undefined && object.pool_id !== null) { + message.poolId = BigInt(object.pool_id); + } + if (object.lockable_duration !== undefined && object.lockable_duration !== null) { + message.lockableDuration = Duration.fromAmino(object.lockable_duration); + } + if (object.gauge_id !== undefined && object.gauge_id !== null) { + message.gaugeId = BigInt(object.gauge_id); + } + return message; }, toAmino(message: IncentivizedPool): IncentivizedPoolAmino { const obj: any = {}; @@ -959,6 +1227,8 @@ export const IncentivizedPool = { }; } }; +GlobalDecoderRegistry.register(IncentivizedPool.typeUrl, IncentivizedPool); +GlobalDecoderRegistry.registerAminoProtoMapping(IncentivizedPool.aminoType, IncentivizedPool.typeUrl); function createBaseQueryIncentivizedPoolsResponse(): QueryIncentivizedPoolsResponse { return { incentivizedPools: [] @@ -966,6 +1236,16 @@ function createBaseQueryIncentivizedPoolsResponse(): QueryIncentivizedPoolsRespo } export const QueryIncentivizedPoolsResponse = { typeUrl: "/osmosis.poolincentives.v1beta1.QueryIncentivizedPoolsResponse", + aminoType: "osmosis/poolincentives/query-incentivized-pools-response", + is(o: any): o is QueryIncentivizedPoolsResponse { + return o && (o.$typeUrl === QueryIncentivizedPoolsResponse.typeUrl || Array.isArray(o.incentivizedPools) && (!o.incentivizedPools.length || IncentivizedPool.is(o.incentivizedPools[0]))); + }, + isSDK(o: any): o is QueryIncentivizedPoolsResponseSDKType { + return o && (o.$typeUrl === QueryIncentivizedPoolsResponse.typeUrl || Array.isArray(o.incentivized_pools) && (!o.incentivized_pools.length || IncentivizedPool.isSDK(o.incentivized_pools[0]))); + }, + isAmino(o: any): o is QueryIncentivizedPoolsResponseAmino { + return o && (o.$typeUrl === QueryIncentivizedPoolsResponse.typeUrl || Array.isArray(o.incentivized_pools) && (!o.incentivized_pools.length || IncentivizedPool.isAmino(o.incentivized_pools[0]))); + }, encode(message: QueryIncentivizedPoolsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.incentivizedPools) { IncentivizedPool.encode(v!, writer.uint32(10).fork()).ldelim(); @@ -989,15 +1269,29 @@ export const QueryIncentivizedPoolsResponse = { } return message; }, + fromJSON(object: any): QueryIncentivizedPoolsResponse { + return { + incentivizedPools: Array.isArray(object?.incentivizedPools) ? object.incentivizedPools.map((e: any) => IncentivizedPool.fromJSON(e)) : [] + }; + }, + toJSON(message: QueryIncentivizedPoolsResponse): unknown { + const obj: any = {}; + if (message.incentivizedPools) { + obj.incentivizedPools = message.incentivizedPools.map(e => e ? IncentivizedPool.toJSON(e) : undefined); + } else { + obj.incentivizedPools = []; + } + return obj; + }, fromPartial(object: Partial): QueryIncentivizedPoolsResponse { const message = createBaseQueryIncentivizedPoolsResponse(); message.incentivizedPools = object.incentivizedPools?.map(e => IncentivizedPool.fromPartial(e)) || []; return message; }, fromAmino(object: QueryIncentivizedPoolsResponseAmino): QueryIncentivizedPoolsResponse { - return { - incentivizedPools: Array.isArray(object?.incentivized_pools) ? object.incentivized_pools.map((e: any) => IncentivizedPool.fromAmino(e)) : [] - }; + const message = createBaseQueryIncentivizedPoolsResponse(); + message.incentivizedPools = object.incentivized_pools?.map(e => IncentivizedPool.fromAmino(e)) || []; + return message; }, toAmino(message: QueryIncentivizedPoolsResponse): QueryIncentivizedPoolsResponseAmino { const obj: any = {}; @@ -1030,11 +1324,23 @@ export const QueryIncentivizedPoolsResponse = { }; } }; +GlobalDecoderRegistry.register(QueryIncentivizedPoolsResponse.typeUrl, QueryIncentivizedPoolsResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryIncentivizedPoolsResponse.aminoType, QueryIncentivizedPoolsResponse.typeUrl); function createBaseQueryExternalIncentiveGaugesRequest(): QueryExternalIncentiveGaugesRequest { return {}; } export const QueryExternalIncentiveGaugesRequest = { typeUrl: "/osmosis.poolincentives.v1beta1.QueryExternalIncentiveGaugesRequest", + aminoType: "osmosis/poolincentives/query-external-incentive-gauges-request", + is(o: any): o is QueryExternalIncentiveGaugesRequest { + return o && o.$typeUrl === QueryExternalIncentiveGaugesRequest.typeUrl; + }, + isSDK(o: any): o is QueryExternalIncentiveGaugesRequestSDKType { + return o && o.$typeUrl === QueryExternalIncentiveGaugesRequest.typeUrl; + }, + isAmino(o: any): o is QueryExternalIncentiveGaugesRequestAmino { + return o && o.$typeUrl === QueryExternalIncentiveGaugesRequest.typeUrl; + }, encode(_: QueryExternalIncentiveGaugesRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, @@ -1052,12 +1358,20 @@ export const QueryExternalIncentiveGaugesRequest = { } return message; }, + fromJSON(_: any): QueryExternalIncentiveGaugesRequest { + return {}; + }, + toJSON(_: QueryExternalIncentiveGaugesRequest): unknown { + const obj: any = {}; + return obj; + }, fromPartial(_: Partial): QueryExternalIncentiveGaugesRequest { const message = createBaseQueryExternalIncentiveGaugesRequest(); return message; }, fromAmino(_: QueryExternalIncentiveGaugesRequestAmino): QueryExternalIncentiveGaugesRequest { - return {}; + const message = createBaseQueryExternalIncentiveGaugesRequest(); + return message; }, toAmino(_: QueryExternalIncentiveGaugesRequest): QueryExternalIncentiveGaugesRequestAmino { const obj: any = {}; @@ -1085,6 +1399,8 @@ export const QueryExternalIncentiveGaugesRequest = { }; } }; +GlobalDecoderRegistry.register(QueryExternalIncentiveGaugesRequest.typeUrl, QueryExternalIncentiveGaugesRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryExternalIncentiveGaugesRequest.aminoType, QueryExternalIncentiveGaugesRequest.typeUrl); function createBaseQueryExternalIncentiveGaugesResponse(): QueryExternalIncentiveGaugesResponse { return { data: [] @@ -1092,6 +1408,16 @@ function createBaseQueryExternalIncentiveGaugesResponse(): QueryExternalIncentiv } export const QueryExternalIncentiveGaugesResponse = { typeUrl: "/osmosis.poolincentives.v1beta1.QueryExternalIncentiveGaugesResponse", + aminoType: "osmosis/poolincentives/query-external-incentive-gauges-response", + is(o: any): o is QueryExternalIncentiveGaugesResponse { + return o && (o.$typeUrl === QueryExternalIncentiveGaugesResponse.typeUrl || Array.isArray(o.data) && (!o.data.length || Gauge.is(o.data[0]))); + }, + isSDK(o: any): o is QueryExternalIncentiveGaugesResponseSDKType { + return o && (o.$typeUrl === QueryExternalIncentiveGaugesResponse.typeUrl || Array.isArray(o.data) && (!o.data.length || Gauge.isSDK(o.data[0]))); + }, + isAmino(o: any): o is QueryExternalIncentiveGaugesResponseAmino { + return o && (o.$typeUrl === QueryExternalIncentiveGaugesResponse.typeUrl || Array.isArray(o.data) && (!o.data.length || Gauge.isAmino(o.data[0]))); + }, encode(message: QueryExternalIncentiveGaugesResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.data) { Gauge.encode(v!, writer.uint32(10).fork()).ldelim(); @@ -1115,15 +1441,29 @@ export const QueryExternalIncentiveGaugesResponse = { } return message; }, + fromJSON(object: any): QueryExternalIncentiveGaugesResponse { + return { + data: Array.isArray(object?.data) ? object.data.map((e: any) => Gauge.fromJSON(e)) : [] + }; + }, + toJSON(message: QueryExternalIncentiveGaugesResponse): unknown { + const obj: any = {}; + if (message.data) { + obj.data = message.data.map(e => e ? Gauge.toJSON(e) : undefined); + } else { + obj.data = []; + } + return obj; + }, fromPartial(object: Partial): QueryExternalIncentiveGaugesResponse { const message = createBaseQueryExternalIncentiveGaugesResponse(); message.data = object.data?.map(e => Gauge.fromPartial(e)) || []; return message; }, fromAmino(object: QueryExternalIncentiveGaugesResponseAmino): QueryExternalIncentiveGaugesResponse { - return { - data: Array.isArray(object?.data) ? object.data.map((e: any) => Gauge.fromAmino(e)) : [] - }; + const message = createBaseQueryExternalIncentiveGaugesResponse(); + message.data = object.data?.map(e => Gauge.fromAmino(e)) || []; + return message; }, toAmino(message: QueryExternalIncentiveGaugesResponse): QueryExternalIncentiveGaugesResponseAmino { const obj: any = {}; @@ -1155,4 +1495,6 @@ export const QueryExternalIncentiveGaugesResponse = { value: QueryExternalIncentiveGaugesResponse.encode(message).finish() }; } -}; \ No newline at end of file +}; +GlobalDecoderRegistry.register(QueryExternalIncentiveGaugesResponse.typeUrl, QueryExternalIncentiveGaugesResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryExternalIncentiveGaugesResponse.aminoType, QueryExternalIncentiveGaugesResponse.typeUrl); \ No newline at end of file diff --git a/packages/osmo-query/src/codegen/osmosis/pool-incentives/v1beta1/shared.ts b/packages/osmojs/src/codegen/osmosis/poolincentives/v1beta1/shared.ts similarity index 70% rename from packages/osmo-query/src/codegen/osmosis/pool-incentives/v1beta1/shared.ts rename to packages/osmojs/src/codegen/osmosis/poolincentives/v1beta1/shared.ts index b6274a302..bf631564e 100644 --- a/packages/osmo-query/src/codegen/osmosis/pool-incentives/v1beta1/shared.ts +++ b/packages/osmojs/src/codegen/osmosis/poolincentives/v1beta1/shared.ts @@ -1,4 +1,6 @@ import { BinaryReader, BinaryWriter } from "../../../binary"; +import { GlobalDecoderRegistry } from "../../../registry"; +import { isSet } from "../../../helpers"; /** * MigrationRecords contains all the links between balancer and concentrated * pools. @@ -21,7 +23,7 @@ export interface MigrationRecordsProtoMsg { * the circular dependency between the two modules. */ export interface MigrationRecordsAmino { - balancer_to_concentrated_pool_links: BalancerToConcentratedPoolLinkAmino[]; + balancer_to_concentrated_pool_links?: BalancerToConcentratedPoolLinkAmino[]; } export interface MigrationRecordsAminoMsg { type: "osmosis/poolincentives/migration-records"; @@ -68,8 +70,8 @@ export interface BalancerToConcentratedPoolLinkProtoMsg { * the circular dependency between the two modules. */ export interface BalancerToConcentratedPoolLinkAmino { - balancer_pool_id: string; - cl_pool_id: string; + balancer_pool_id?: string; + cl_pool_id?: string; } export interface BalancerToConcentratedPoolLinkAminoMsg { type: "osmosis/poolincentives/balancer-to-concentrated-pool-link"; @@ -97,6 +99,16 @@ function createBaseMigrationRecords(): MigrationRecords { } export const MigrationRecords = { typeUrl: "/osmosis.poolincentives.v1beta1.MigrationRecords", + aminoType: "osmosis/poolincentives/migration-records", + is(o: any): o is MigrationRecords { + return o && (o.$typeUrl === MigrationRecords.typeUrl || Array.isArray(o.balancerToConcentratedPoolLinks) && (!o.balancerToConcentratedPoolLinks.length || BalancerToConcentratedPoolLink.is(o.balancerToConcentratedPoolLinks[0]))); + }, + isSDK(o: any): o is MigrationRecordsSDKType { + return o && (o.$typeUrl === MigrationRecords.typeUrl || Array.isArray(o.balancer_to_concentrated_pool_links) && (!o.balancer_to_concentrated_pool_links.length || BalancerToConcentratedPoolLink.isSDK(o.balancer_to_concentrated_pool_links[0]))); + }, + isAmino(o: any): o is MigrationRecordsAmino { + return o && (o.$typeUrl === MigrationRecords.typeUrl || Array.isArray(o.balancer_to_concentrated_pool_links) && (!o.balancer_to_concentrated_pool_links.length || BalancerToConcentratedPoolLink.isAmino(o.balancer_to_concentrated_pool_links[0]))); + }, encode(message: MigrationRecords, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.balancerToConcentratedPoolLinks) { BalancerToConcentratedPoolLink.encode(v!, writer.uint32(10).fork()).ldelim(); @@ -120,15 +132,29 @@ export const MigrationRecords = { } return message; }, + fromJSON(object: any): MigrationRecords { + return { + balancerToConcentratedPoolLinks: Array.isArray(object?.balancerToConcentratedPoolLinks) ? object.balancerToConcentratedPoolLinks.map((e: any) => BalancerToConcentratedPoolLink.fromJSON(e)) : [] + }; + }, + toJSON(message: MigrationRecords): unknown { + const obj: any = {}; + if (message.balancerToConcentratedPoolLinks) { + obj.balancerToConcentratedPoolLinks = message.balancerToConcentratedPoolLinks.map(e => e ? BalancerToConcentratedPoolLink.toJSON(e) : undefined); + } else { + obj.balancerToConcentratedPoolLinks = []; + } + return obj; + }, fromPartial(object: Partial): MigrationRecords { const message = createBaseMigrationRecords(); message.balancerToConcentratedPoolLinks = object.balancerToConcentratedPoolLinks?.map(e => BalancerToConcentratedPoolLink.fromPartial(e)) || []; return message; }, fromAmino(object: MigrationRecordsAmino): MigrationRecords { - return { - balancerToConcentratedPoolLinks: Array.isArray(object?.balancer_to_concentrated_pool_links) ? object.balancer_to_concentrated_pool_links.map((e: any) => BalancerToConcentratedPoolLink.fromAmino(e)) : [] - }; + const message = createBaseMigrationRecords(); + message.balancerToConcentratedPoolLinks = object.balancer_to_concentrated_pool_links?.map(e => BalancerToConcentratedPoolLink.fromAmino(e)) || []; + return message; }, toAmino(message: MigrationRecords): MigrationRecordsAmino { const obj: any = {}; @@ -161,6 +187,8 @@ export const MigrationRecords = { }; } }; +GlobalDecoderRegistry.register(MigrationRecords.typeUrl, MigrationRecords); +GlobalDecoderRegistry.registerAminoProtoMapping(MigrationRecords.aminoType, MigrationRecords.typeUrl); function createBaseBalancerToConcentratedPoolLink(): BalancerToConcentratedPoolLink { return { balancerPoolId: BigInt(0), @@ -169,6 +197,16 @@ function createBaseBalancerToConcentratedPoolLink(): BalancerToConcentratedPoolL } export const BalancerToConcentratedPoolLink = { typeUrl: "/osmosis.poolincentives.v1beta1.BalancerToConcentratedPoolLink", + aminoType: "osmosis/poolincentives/balancer-to-concentrated-pool-link", + is(o: any): o is BalancerToConcentratedPoolLink { + return o && (o.$typeUrl === BalancerToConcentratedPoolLink.typeUrl || typeof o.balancerPoolId === "bigint" && typeof o.clPoolId === "bigint"); + }, + isSDK(o: any): o is BalancerToConcentratedPoolLinkSDKType { + return o && (o.$typeUrl === BalancerToConcentratedPoolLink.typeUrl || typeof o.balancer_pool_id === "bigint" && typeof o.cl_pool_id === "bigint"); + }, + isAmino(o: any): o is BalancerToConcentratedPoolLinkAmino { + return o && (o.$typeUrl === BalancerToConcentratedPoolLink.typeUrl || typeof o.balancer_pool_id === "bigint" && typeof o.cl_pool_id === "bigint"); + }, encode(message: BalancerToConcentratedPoolLink, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.balancerPoolId !== BigInt(0)) { writer.uint32(8).uint64(message.balancerPoolId); @@ -198,6 +236,18 @@ export const BalancerToConcentratedPoolLink = { } return message; }, + fromJSON(object: any): BalancerToConcentratedPoolLink { + return { + balancerPoolId: isSet(object.balancerPoolId) ? BigInt(object.balancerPoolId.toString()) : BigInt(0), + clPoolId: isSet(object.clPoolId) ? BigInt(object.clPoolId.toString()) : BigInt(0) + }; + }, + toJSON(message: BalancerToConcentratedPoolLink): unknown { + const obj: any = {}; + message.balancerPoolId !== undefined && (obj.balancerPoolId = (message.balancerPoolId || BigInt(0)).toString()); + message.clPoolId !== undefined && (obj.clPoolId = (message.clPoolId || BigInt(0)).toString()); + return obj; + }, fromPartial(object: Partial): BalancerToConcentratedPoolLink { const message = createBaseBalancerToConcentratedPoolLink(); message.balancerPoolId = object.balancerPoolId !== undefined && object.balancerPoolId !== null ? BigInt(object.balancerPoolId.toString()) : BigInt(0); @@ -205,10 +255,14 @@ export const BalancerToConcentratedPoolLink = { return message; }, fromAmino(object: BalancerToConcentratedPoolLinkAmino): BalancerToConcentratedPoolLink { - return { - balancerPoolId: BigInt(object.balancer_pool_id), - clPoolId: BigInt(object.cl_pool_id) - }; + const message = createBaseBalancerToConcentratedPoolLink(); + if (object.balancer_pool_id !== undefined && object.balancer_pool_id !== null) { + message.balancerPoolId = BigInt(object.balancer_pool_id); + } + if (object.cl_pool_id !== undefined && object.cl_pool_id !== null) { + message.clPoolId = BigInt(object.cl_pool_id); + } + return message; }, toAmino(message: BalancerToConcentratedPoolLink): BalancerToConcentratedPoolLinkAmino { const obj: any = {}; @@ -237,4 +291,6 @@ export const BalancerToConcentratedPoolLink = { value: BalancerToConcentratedPoolLink.encode(message).finish() }; } -}; \ No newline at end of file +}; +GlobalDecoderRegistry.register(BalancerToConcentratedPoolLink.typeUrl, BalancerToConcentratedPoolLink); +GlobalDecoderRegistry.registerAminoProtoMapping(BalancerToConcentratedPoolLink.aminoType, BalancerToConcentratedPoolLink.typeUrl); \ No newline at end of file diff --git a/packages/osmojs/src/codegen/osmosis/poolmanager/v1beta1/genesis.ts b/packages/osmojs/src/codegen/osmosis/poolmanager/v1beta1/genesis.ts index cbac17cc6..bf2320584 100644 --- a/packages/osmojs/src/codegen/osmosis/poolmanager/v1beta1/genesis.ts +++ b/packages/osmojs/src/codegen/osmosis/poolmanager/v1beta1/genesis.ts @@ -1,9 +1,26 @@ import { Coin, CoinAmino, CoinSDKType } from "../../../cosmos/base/v1beta1/coin"; import { ModuleRoute, ModuleRouteAmino, ModuleRouteSDKType } from "./module_route"; +import { DenomPairTakerFee, DenomPairTakerFeeAmino, DenomPairTakerFeeSDKType } from "./tx"; import { BinaryReader, BinaryWriter } from "../../../binary"; +import { isSet } from "../../../helpers"; +import { GlobalDecoderRegistry } from "../../../registry"; +import { Decimal } from "@cosmjs/math"; /** Params holds parameters for the poolmanager module */ export interface Params { poolCreationFee: Coin[]; + /** taker_fee_params is the container of taker fee parameters. */ + takerFeeParams: TakerFeeParams; + /** + * authorized_quote_denoms is a list of quote denoms that can be used as + * token1 when creating a concentrated pool. We limit the quote assets to a + * small set for the purposes of having convenient price increments stemming + * from tick to price conversion. These increments are in a human readable + * magnitude only for token1 as a quote. For limit orders in the future, this + * will be a desirable property in terms of UX as to allow users to set limit + * orders at prices in terms of token1 (quote asset) that are easy to reason + * about. + */ + authorizedQuoteDenoms: string[]; } export interface ParamsProtoMsg { typeUrl: "/osmosis.poolmanager.v1beta1.Params"; @@ -11,7 +28,20 @@ export interface ParamsProtoMsg { } /** Params holds parameters for the poolmanager module */ export interface ParamsAmino { - pool_creation_fee: CoinAmino[]; + pool_creation_fee?: CoinAmino[]; + /** taker_fee_params is the container of taker fee parameters. */ + taker_fee_params?: TakerFeeParamsAmino; + /** + * authorized_quote_denoms is a list of quote denoms that can be used as + * token1 when creating a concentrated pool. We limit the quote assets to a + * small set for the purposes of having convenient price increments stemming + * from tick to price conversion. These increments are in a human readable + * magnitude only for token1 as a quote. For limit orders in the future, this + * will be a desirable property in terms of UX as to allow users to set limit + * orders at prices in terms of token1 (quote asset) that are easy to reason + * about. + */ + authorized_quote_denoms?: string[]; } export interface ParamsAminoMsg { type: "osmosis/poolmanager/params"; @@ -20,6 +50,8 @@ export interface ParamsAminoMsg { /** Params holds parameters for the poolmanager module */ export interface ParamsSDKType { pool_creation_fee: CoinSDKType[]; + taker_fee_params: TakerFeeParamsSDKType; + authorized_quote_denoms: string[]; } /** GenesisState defines the poolmanager module's genesis state. */ export interface GenesisState { @@ -29,6 +61,10 @@ export interface GenesisState { params: Params; /** pool_routes is the container of the mappings from pool id to pool type. */ poolRoutes: ModuleRoute[]; + /** KVStore state */ + takerFeesTracker?: TakerFeesTracker; + poolVolumes: PoolVolume[]; + denomPairTakerFeeStore: DenomPairTakerFee[]; } export interface GenesisStateProtoMsg { typeUrl: "/osmosis.poolmanager.v1beta1.GenesisState"; @@ -37,11 +73,15 @@ export interface GenesisStateProtoMsg { /** GenesisState defines the poolmanager module's genesis state. */ export interface GenesisStateAmino { /** the next_pool_id */ - next_pool_id: string; + next_pool_id?: string; /** params is the container of poolmanager parameters. */ params?: ParamsAmino; /** pool_routes is the container of the mappings from pool id to pool type. */ - pool_routes: ModuleRouteAmino[]; + pool_routes?: ModuleRouteAmino[]; + /** KVStore state */ + taker_fees_tracker?: TakerFeesTrackerAmino; + pool_volumes?: PoolVolumeAmino[]; + denom_pair_taker_fee_store?: DenomPairTakerFeeAmino[]; } export interface GenesisStateAminoMsg { type: "osmosis/poolmanager/genesis-state"; @@ -52,18 +92,251 @@ export interface GenesisStateSDKType { next_pool_id: bigint; params: ParamsSDKType; pool_routes: ModuleRouteSDKType[]; + taker_fees_tracker?: TakerFeesTrackerSDKType; + pool_volumes: PoolVolumeSDKType[]; + denom_pair_taker_fee_store: DenomPairTakerFeeSDKType[]; +} +/** TakerFeeParams consolidates the taker fee parameters for the poolmanager. */ +export interface TakerFeeParams { + /** + * default_taker_fee is the fee used when creating a new pool that doesn't + * fall under a custom pool taker fee or stableswap taker fee category. + */ + defaultTakerFee: string; + /** + * osmo_taker_fee_distribution defines the distribution of taker fees + * generated in OSMO. As of this writing, it has two categories: + * - staking_rewards: the percent of the taker fee that gets distributed to + * stakers. + * - community_pool: the percent of the taker fee that gets sent to the + * community pool. + */ + osmoTakerFeeDistribution: TakerFeeDistributionPercentage; + /** + * non_osmo_taker_fee_distribution defines the distribution of taker fees + * generated in non-OSMO. As of this writing, it has two categories: + * - staking_rewards: the percent of the taker fee that gets swapped to OSMO + * and then distributed to stakers. + * - community_pool: the percent of the taker fee that gets sent to the + * community pool. Note: If the non-OSMO asset is an authorized_quote_denom, + * that denom is sent directly to the community pool. Otherwise, it is + * swapped to the community_pool_denom_to_swap_non_whitelisted_assets_to and + * then sent to the community pool as that denom. + */ + nonOsmoTakerFeeDistribution: TakerFeeDistributionPercentage; + /** + * admin_addresses is a list of addresses that are allowed to set and remove + * custom taker fees for denom pairs. Governance also has the ability to set + * and remove custom taker fees for denom pairs, but with the normal + * governance delay. + */ + adminAddresses: string[]; + /** + * community_pool_denom_to_swap_non_whitelisted_assets_to is the denom that + * non-whitelisted taker fees will be swapped to before being sent to + * the community pool. + */ + communityPoolDenomToSwapNonWhitelistedAssetsTo: string; + /** + * reduced_fee_whitelist is a list of addresses that are + * allowed to pay a reduce taker fee when performing a swap + * (i.e. swap without paying the taker fee). + * It is intended to be used for integrators who meet qualifying factors + * that are approved by governance. + * Initially, the taker fee is allowed to be bypassed completely. However + * In the future, we will charge a reduced taker fee instead of no fee at all. + */ + reducedFeeWhitelist: string[]; +} +export interface TakerFeeParamsProtoMsg { + typeUrl: "/osmosis.poolmanager.v1beta1.TakerFeeParams"; + value: Uint8Array; +} +/** TakerFeeParams consolidates the taker fee parameters for the poolmanager. */ +export interface TakerFeeParamsAmino { + /** + * default_taker_fee is the fee used when creating a new pool that doesn't + * fall under a custom pool taker fee or stableswap taker fee category. + */ + default_taker_fee?: string; + /** + * osmo_taker_fee_distribution defines the distribution of taker fees + * generated in OSMO. As of this writing, it has two categories: + * - staking_rewards: the percent of the taker fee that gets distributed to + * stakers. + * - community_pool: the percent of the taker fee that gets sent to the + * community pool. + */ + osmo_taker_fee_distribution?: TakerFeeDistributionPercentageAmino; + /** + * non_osmo_taker_fee_distribution defines the distribution of taker fees + * generated in non-OSMO. As of this writing, it has two categories: + * - staking_rewards: the percent of the taker fee that gets swapped to OSMO + * and then distributed to stakers. + * - community_pool: the percent of the taker fee that gets sent to the + * community pool. Note: If the non-OSMO asset is an authorized_quote_denom, + * that denom is sent directly to the community pool. Otherwise, it is + * swapped to the community_pool_denom_to_swap_non_whitelisted_assets_to and + * then sent to the community pool as that denom. + */ + non_osmo_taker_fee_distribution?: TakerFeeDistributionPercentageAmino; + /** + * admin_addresses is a list of addresses that are allowed to set and remove + * custom taker fees for denom pairs. Governance also has the ability to set + * and remove custom taker fees for denom pairs, but with the normal + * governance delay. + */ + admin_addresses?: string[]; + /** + * community_pool_denom_to_swap_non_whitelisted_assets_to is the denom that + * non-whitelisted taker fees will be swapped to before being sent to + * the community pool. + */ + community_pool_denom_to_swap_non_whitelisted_assets_to?: string; + /** + * reduced_fee_whitelist is a list of addresses that are + * allowed to pay a reduce taker fee when performing a swap + * (i.e. swap without paying the taker fee). + * It is intended to be used for integrators who meet qualifying factors + * that are approved by governance. + * Initially, the taker fee is allowed to be bypassed completely. However + * In the future, we will charge a reduced taker fee instead of no fee at all. + */ + reduced_fee_whitelist?: string[]; +} +export interface TakerFeeParamsAminoMsg { + type: "osmosis/poolmanager/taker-fee-params"; + value: TakerFeeParamsAmino; +} +/** TakerFeeParams consolidates the taker fee parameters for the poolmanager. */ +export interface TakerFeeParamsSDKType { + default_taker_fee: string; + osmo_taker_fee_distribution: TakerFeeDistributionPercentageSDKType; + non_osmo_taker_fee_distribution: TakerFeeDistributionPercentageSDKType; + admin_addresses: string[]; + community_pool_denom_to_swap_non_whitelisted_assets_to: string; + reduced_fee_whitelist: string[]; +} +/** + * TakerFeeDistributionPercentage defines what percent of the taker fee category + * gets distributed to the available categories. + */ +export interface TakerFeeDistributionPercentage { + stakingRewards: string; + communityPool: string; +} +export interface TakerFeeDistributionPercentageProtoMsg { + typeUrl: "/osmosis.poolmanager.v1beta1.TakerFeeDistributionPercentage"; + value: Uint8Array; +} +/** + * TakerFeeDistributionPercentage defines what percent of the taker fee category + * gets distributed to the available categories. + */ +export interface TakerFeeDistributionPercentageAmino { + staking_rewards?: string; + community_pool?: string; +} +export interface TakerFeeDistributionPercentageAminoMsg { + type: "osmosis/poolmanager/taker-fee-distribution-percentage"; + value: TakerFeeDistributionPercentageAmino; +} +/** + * TakerFeeDistributionPercentage defines what percent of the taker fee category + * gets distributed to the available categories. + */ +export interface TakerFeeDistributionPercentageSDKType { + staking_rewards: string; + community_pool: string; +} +export interface TakerFeesTracker { + takerFeesToStakers: Coin[]; + takerFeesToCommunityPool: Coin[]; + heightAccountingStartsFrom: bigint; +} +export interface TakerFeesTrackerProtoMsg { + typeUrl: "/osmosis.poolmanager.v1beta1.TakerFeesTracker"; + value: Uint8Array; +} +export interface TakerFeesTrackerAmino { + taker_fees_to_stakers?: CoinAmino[]; + taker_fees_to_community_pool?: CoinAmino[]; + height_accounting_starts_from?: string; +} +export interface TakerFeesTrackerAminoMsg { + type: "osmosis/poolmanager/taker-fees-tracker"; + value: TakerFeesTrackerAmino; +} +export interface TakerFeesTrackerSDKType { + taker_fees_to_stakers: CoinSDKType[]; + taker_fees_to_community_pool: CoinSDKType[]; + height_accounting_starts_from: bigint; +} +/** + * PoolVolume stores the KVStore entries for each pool's volume, which + * is used in export/import genesis. + */ +export interface PoolVolume { + /** pool_id is the id of the pool. */ + poolId: bigint; + /** pool_volume is the cumulative volume of the pool. */ + poolVolume: Coin[]; +} +export interface PoolVolumeProtoMsg { + typeUrl: "/osmosis.poolmanager.v1beta1.PoolVolume"; + value: Uint8Array; +} +/** + * PoolVolume stores the KVStore entries for each pool's volume, which + * is used in export/import genesis. + */ +export interface PoolVolumeAmino { + /** pool_id is the id of the pool. */ + pool_id?: string; + /** pool_volume is the cumulative volume of the pool. */ + pool_volume?: CoinAmino[]; +} +export interface PoolVolumeAminoMsg { + type: "osmosis/poolmanager/pool-volume"; + value: PoolVolumeAmino; +} +/** + * PoolVolume stores the KVStore entries for each pool's volume, which + * is used in export/import genesis. + */ +export interface PoolVolumeSDKType { + pool_id: bigint; + pool_volume: CoinSDKType[]; } function createBaseParams(): Params { return { - poolCreationFee: [] + poolCreationFee: [], + takerFeeParams: TakerFeeParams.fromPartial({}), + authorizedQuoteDenoms: [] }; } export const Params = { typeUrl: "/osmosis.poolmanager.v1beta1.Params", + aminoType: "osmosis/poolmanager/params", + is(o: any): o is Params { + return o && (o.$typeUrl === Params.typeUrl || Array.isArray(o.poolCreationFee) && (!o.poolCreationFee.length || Coin.is(o.poolCreationFee[0])) && TakerFeeParams.is(o.takerFeeParams) && Array.isArray(o.authorizedQuoteDenoms) && (!o.authorizedQuoteDenoms.length || typeof o.authorizedQuoteDenoms[0] === "string")); + }, + isSDK(o: any): o is ParamsSDKType { + return o && (o.$typeUrl === Params.typeUrl || Array.isArray(o.pool_creation_fee) && (!o.pool_creation_fee.length || Coin.isSDK(o.pool_creation_fee[0])) && TakerFeeParams.isSDK(o.taker_fee_params) && Array.isArray(o.authorized_quote_denoms) && (!o.authorized_quote_denoms.length || typeof o.authorized_quote_denoms[0] === "string")); + }, + isAmino(o: any): o is ParamsAmino { + return o && (o.$typeUrl === Params.typeUrl || Array.isArray(o.pool_creation_fee) && (!o.pool_creation_fee.length || Coin.isAmino(o.pool_creation_fee[0])) && TakerFeeParams.isAmino(o.taker_fee_params) && Array.isArray(o.authorized_quote_denoms) && (!o.authorized_quote_denoms.length || typeof o.authorized_quote_denoms[0] === "string")); + }, encode(message: Params, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.poolCreationFee) { Coin.encode(v!, writer.uint32(10).fork()).ldelim(); } + if (message.takerFeeParams !== undefined) { + TakerFeeParams.encode(message.takerFeeParams, writer.uint32(18).fork()).ldelim(); + } + for (const v of message.authorizedQuoteDenoms) { + writer.uint32(26).string(v!); + } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): Params { @@ -76,6 +349,12 @@ export const Params = { case 1: message.poolCreationFee.push(Coin.decode(reader, reader.uint32())); break; + case 2: + message.takerFeeParams = TakerFeeParams.decode(reader, reader.uint32()); + break; + case 3: + message.authorizedQuoteDenoms.push(reader.string()); + break; default: reader.skipType(tag & 7); break; @@ -83,15 +362,43 @@ export const Params = { } return message; }, + fromJSON(object: any): Params { + return { + poolCreationFee: Array.isArray(object?.poolCreationFee) ? object.poolCreationFee.map((e: any) => Coin.fromJSON(e)) : [], + takerFeeParams: isSet(object.takerFeeParams) ? TakerFeeParams.fromJSON(object.takerFeeParams) : undefined, + authorizedQuoteDenoms: Array.isArray(object?.authorizedQuoteDenoms) ? object.authorizedQuoteDenoms.map((e: any) => String(e)) : [] + }; + }, + toJSON(message: Params): unknown { + const obj: any = {}; + if (message.poolCreationFee) { + obj.poolCreationFee = message.poolCreationFee.map(e => e ? Coin.toJSON(e) : undefined); + } else { + obj.poolCreationFee = []; + } + message.takerFeeParams !== undefined && (obj.takerFeeParams = message.takerFeeParams ? TakerFeeParams.toJSON(message.takerFeeParams) : undefined); + if (message.authorizedQuoteDenoms) { + obj.authorizedQuoteDenoms = message.authorizedQuoteDenoms.map(e => e); + } else { + obj.authorizedQuoteDenoms = []; + } + return obj; + }, fromPartial(object: Partial): Params { const message = createBaseParams(); message.poolCreationFee = object.poolCreationFee?.map(e => Coin.fromPartial(e)) || []; + message.takerFeeParams = object.takerFeeParams !== undefined && object.takerFeeParams !== null ? TakerFeeParams.fromPartial(object.takerFeeParams) : undefined; + message.authorizedQuoteDenoms = object.authorizedQuoteDenoms?.map(e => e) || []; return message; }, fromAmino(object: ParamsAmino): Params { - return { - poolCreationFee: Array.isArray(object?.pool_creation_fee) ? object.pool_creation_fee.map((e: any) => Coin.fromAmino(e)) : [] - }; + const message = createBaseParams(); + message.poolCreationFee = object.pool_creation_fee?.map(e => Coin.fromAmino(e)) || []; + if (object.taker_fee_params !== undefined && object.taker_fee_params !== null) { + message.takerFeeParams = TakerFeeParams.fromAmino(object.taker_fee_params); + } + message.authorizedQuoteDenoms = object.authorized_quote_denoms?.map(e => e) || []; + return message; }, toAmino(message: Params): ParamsAmino { const obj: any = {}; @@ -100,6 +407,12 @@ export const Params = { } else { obj.pool_creation_fee = []; } + obj.taker_fee_params = message.takerFeeParams ? TakerFeeParams.toAmino(message.takerFeeParams) : undefined; + if (message.authorizedQuoteDenoms) { + obj.authorized_quote_denoms = message.authorizedQuoteDenoms.map(e => e); + } else { + obj.authorized_quote_denoms = []; + } return obj; }, fromAminoMsg(object: ParamsAminoMsg): Params { @@ -124,15 +437,30 @@ export const Params = { }; } }; +GlobalDecoderRegistry.register(Params.typeUrl, Params); +GlobalDecoderRegistry.registerAminoProtoMapping(Params.aminoType, Params.typeUrl); function createBaseGenesisState(): GenesisState { return { nextPoolId: BigInt(0), params: Params.fromPartial({}), - poolRoutes: [] + poolRoutes: [], + takerFeesTracker: undefined, + poolVolumes: [], + denomPairTakerFeeStore: [] }; } export const GenesisState = { typeUrl: "/osmosis.poolmanager.v1beta1.GenesisState", + aminoType: "osmosis/poolmanager/genesis-state", + is(o: any): o is GenesisState { + return o && (o.$typeUrl === GenesisState.typeUrl || typeof o.nextPoolId === "bigint" && Params.is(o.params) && Array.isArray(o.poolRoutes) && (!o.poolRoutes.length || ModuleRoute.is(o.poolRoutes[0])) && Array.isArray(o.poolVolumes) && (!o.poolVolumes.length || PoolVolume.is(o.poolVolumes[0])) && Array.isArray(o.denomPairTakerFeeStore) && (!o.denomPairTakerFeeStore.length || DenomPairTakerFee.is(o.denomPairTakerFeeStore[0]))); + }, + isSDK(o: any): o is GenesisStateSDKType { + return o && (o.$typeUrl === GenesisState.typeUrl || typeof o.next_pool_id === "bigint" && Params.isSDK(o.params) && Array.isArray(o.pool_routes) && (!o.pool_routes.length || ModuleRoute.isSDK(o.pool_routes[0])) && Array.isArray(o.pool_volumes) && (!o.pool_volumes.length || PoolVolume.isSDK(o.pool_volumes[0])) && Array.isArray(o.denom_pair_taker_fee_store) && (!o.denom_pair_taker_fee_store.length || DenomPairTakerFee.isSDK(o.denom_pair_taker_fee_store[0]))); + }, + isAmino(o: any): o is GenesisStateAmino { + return o && (o.$typeUrl === GenesisState.typeUrl || typeof o.next_pool_id === "bigint" && Params.isAmino(o.params) && Array.isArray(o.pool_routes) && (!o.pool_routes.length || ModuleRoute.isAmino(o.pool_routes[0])) && Array.isArray(o.pool_volumes) && (!o.pool_volumes.length || PoolVolume.isAmino(o.pool_volumes[0])) && Array.isArray(o.denom_pair_taker_fee_store) && (!o.denom_pair_taker_fee_store.length || DenomPairTakerFee.isAmino(o.denom_pair_taker_fee_store[0]))); + }, encode(message: GenesisState, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.nextPoolId !== BigInt(0)) { writer.uint32(8).uint64(message.nextPoolId); @@ -143,6 +471,15 @@ export const GenesisState = { for (const v of message.poolRoutes) { ModuleRoute.encode(v!, writer.uint32(26).fork()).ldelim(); } + if (message.takerFeesTracker !== undefined) { + TakerFeesTracker.encode(message.takerFeesTracker, writer.uint32(34).fork()).ldelim(); + } + for (const v of message.poolVolumes) { + PoolVolume.encode(v!, writer.uint32(42).fork()).ldelim(); + } + for (const v of message.denomPairTakerFeeStore) { + DenomPairTakerFee.encode(v!, writer.uint32(50).fork()).ldelim(); + } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): GenesisState { @@ -161,6 +498,15 @@ export const GenesisState = { case 3: message.poolRoutes.push(ModuleRoute.decode(reader, reader.uint32())); break; + case 4: + message.takerFeesTracker = TakerFeesTracker.decode(reader, reader.uint32()); + break; + case 5: + message.poolVolumes.push(PoolVolume.decode(reader, reader.uint32())); + break; + case 6: + message.denomPairTakerFeeStore.push(DenomPairTakerFee.decode(reader, reader.uint32())); + break; default: reader.skipType(tag & 7); break; @@ -168,19 +514,63 @@ export const GenesisState = { } return message; }, + fromJSON(object: any): GenesisState { + return { + nextPoolId: isSet(object.nextPoolId) ? BigInt(object.nextPoolId.toString()) : BigInt(0), + params: isSet(object.params) ? Params.fromJSON(object.params) : undefined, + poolRoutes: Array.isArray(object?.poolRoutes) ? object.poolRoutes.map((e: any) => ModuleRoute.fromJSON(e)) : [], + takerFeesTracker: isSet(object.takerFeesTracker) ? TakerFeesTracker.fromJSON(object.takerFeesTracker) : undefined, + poolVolumes: Array.isArray(object?.poolVolumes) ? object.poolVolumes.map((e: any) => PoolVolume.fromJSON(e)) : [], + denomPairTakerFeeStore: Array.isArray(object?.denomPairTakerFeeStore) ? object.denomPairTakerFeeStore.map((e: any) => DenomPairTakerFee.fromJSON(e)) : [] + }; + }, + toJSON(message: GenesisState): unknown { + const obj: any = {}; + message.nextPoolId !== undefined && (obj.nextPoolId = (message.nextPoolId || BigInt(0)).toString()); + message.params !== undefined && (obj.params = message.params ? Params.toJSON(message.params) : undefined); + if (message.poolRoutes) { + obj.poolRoutes = message.poolRoutes.map(e => e ? ModuleRoute.toJSON(e) : undefined); + } else { + obj.poolRoutes = []; + } + message.takerFeesTracker !== undefined && (obj.takerFeesTracker = message.takerFeesTracker ? TakerFeesTracker.toJSON(message.takerFeesTracker) : undefined); + if (message.poolVolumes) { + obj.poolVolumes = message.poolVolumes.map(e => e ? PoolVolume.toJSON(e) : undefined); + } else { + obj.poolVolumes = []; + } + if (message.denomPairTakerFeeStore) { + obj.denomPairTakerFeeStore = message.denomPairTakerFeeStore.map(e => e ? DenomPairTakerFee.toJSON(e) : undefined); + } else { + obj.denomPairTakerFeeStore = []; + } + return obj; + }, fromPartial(object: Partial): GenesisState { const message = createBaseGenesisState(); message.nextPoolId = object.nextPoolId !== undefined && object.nextPoolId !== null ? BigInt(object.nextPoolId.toString()) : BigInt(0); message.params = object.params !== undefined && object.params !== null ? Params.fromPartial(object.params) : undefined; message.poolRoutes = object.poolRoutes?.map(e => ModuleRoute.fromPartial(e)) || []; + message.takerFeesTracker = object.takerFeesTracker !== undefined && object.takerFeesTracker !== null ? TakerFeesTracker.fromPartial(object.takerFeesTracker) : undefined; + message.poolVolumes = object.poolVolumes?.map(e => PoolVolume.fromPartial(e)) || []; + message.denomPairTakerFeeStore = object.denomPairTakerFeeStore?.map(e => DenomPairTakerFee.fromPartial(e)) || []; return message; }, fromAmino(object: GenesisStateAmino): GenesisState { - return { - nextPoolId: BigInt(object.next_pool_id), - params: object?.params ? Params.fromAmino(object.params) : undefined, - poolRoutes: Array.isArray(object?.pool_routes) ? object.pool_routes.map((e: any) => ModuleRoute.fromAmino(e)) : [] - }; + const message = createBaseGenesisState(); + if (object.next_pool_id !== undefined && object.next_pool_id !== null) { + message.nextPoolId = BigInt(object.next_pool_id); + } + if (object.params !== undefined && object.params !== null) { + message.params = Params.fromAmino(object.params); + } + message.poolRoutes = object.pool_routes?.map(e => ModuleRoute.fromAmino(e)) || []; + if (object.taker_fees_tracker !== undefined && object.taker_fees_tracker !== null) { + message.takerFeesTracker = TakerFeesTracker.fromAmino(object.taker_fees_tracker); + } + message.poolVolumes = object.pool_volumes?.map(e => PoolVolume.fromAmino(e)) || []; + message.denomPairTakerFeeStore = object.denom_pair_taker_fee_store?.map(e => DenomPairTakerFee.fromAmino(e)) || []; + return message; }, toAmino(message: GenesisState): GenesisStateAmino { const obj: any = {}; @@ -191,6 +581,17 @@ export const GenesisState = { } else { obj.pool_routes = []; } + obj.taker_fees_tracker = message.takerFeesTracker ? TakerFeesTracker.toAmino(message.takerFeesTracker) : undefined; + if (message.poolVolumes) { + obj.pool_volumes = message.poolVolumes.map(e => e ? PoolVolume.toAmino(e) : undefined); + } else { + obj.pool_volumes = []; + } + if (message.denomPairTakerFeeStore) { + obj.denom_pair_taker_fee_store = message.denomPairTakerFeeStore.map(e => e ? DenomPairTakerFee.toAmino(e) : undefined); + } else { + obj.denom_pair_taker_fee_store = []; + } return obj; }, fromAminoMsg(object: GenesisStateAminoMsg): GenesisState { @@ -214,4 +615,526 @@ export const GenesisState = { value: GenesisState.encode(message).finish() }; } -}; \ No newline at end of file +}; +GlobalDecoderRegistry.register(GenesisState.typeUrl, GenesisState); +GlobalDecoderRegistry.registerAminoProtoMapping(GenesisState.aminoType, GenesisState.typeUrl); +function createBaseTakerFeeParams(): TakerFeeParams { + return { + defaultTakerFee: "", + osmoTakerFeeDistribution: TakerFeeDistributionPercentage.fromPartial({}), + nonOsmoTakerFeeDistribution: TakerFeeDistributionPercentage.fromPartial({}), + adminAddresses: [], + communityPoolDenomToSwapNonWhitelistedAssetsTo: "", + reducedFeeWhitelist: [] + }; +} +export const TakerFeeParams = { + typeUrl: "/osmosis.poolmanager.v1beta1.TakerFeeParams", + aminoType: "osmosis/poolmanager/taker-fee-params", + is(o: any): o is TakerFeeParams { + return o && (o.$typeUrl === TakerFeeParams.typeUrl || typeof o.defaultTakerFee === "string" && TakerFeeDistributionPercentage.is(o.osmoTakerFeeDistribution) && TakerFeeDistributionPercentage.is(o.nonOsmoTakerFeeDistribution) && Array.isArray(o.adminAddresses) && (!o.adminAddresses.length || typeof o.adminAddresses[0] === "string") && typeof o.communityPoolDenomToSwapNonWhitelistedAssetsTo === "string" && Array.isArray(o.reducedFeeWhitelist) && (!o.reducedFeeWhitelist.length || typeof o.reducedFeeWhitelist[0] === "string")); + }, + isSDK(o: any): o is TakerFeeParamsSDKType { + return o && (o.$typeUrl === TakerFeeParams.typeUrl || typeof o.default_taker_fee === "string" && TakerFeeDistributionPercentage.isSDK(o.osmo_taker_fee_distribution) && TakerFeeDistributionPercentage.isSDK(o.non_osmo_taker_fee_distribution) && Array.isArray(o.admin_addresses) && (!o.admin_addresses.length || typeof o.admin_addresses[0] === "string") && typeof o.community_pool_denom_to_swap_non_whitelisted_assets_to === "string" && Array.isArray(o.reduced_fee_whitelist) && (!o.reduced_fee_whitelist.length || typeof o.reduced_fee_whitelist[0] === "string")); + }, + isAmino(o: any): o is TakerFeeParamsAmino { + return o && (o.$typeUrl === TakerFeeParams.typeUrl || typeof o.default_taker_fee === "string" && TakerFeeDistributionPercentage.isAmino(o.osmo_taker_fee_distribution) && TakerFeeDistributionPercentage.isAmino(o.non_osmo_taker_fee_distribution) && Array.isArray(o.admin_addresses) && (!o.admin_addresses.length || typeof o.admin_addresses[0] === "string") && typeof o.community_pool_denom_to_swap_non_whitelisted_assets_to === "string" && Array.isArray(o.reduced_fee_whitelist) && (!o.reduced_fee_whitelist.length || typeof o.reduced_fee_whitelist[0] === "string")); + }, + encode(message: TakerFeeParams, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.defaultTakerFee !== "") { + writer.uint32(10).string(Decimal.fromUserInput(message.defaultTakerFee, 18).atomics); + } + if (message.osmoTakerFeeDistribution !== undefined) { + TakerFeeDistributionPercentage.encode(message.osmoTakerFeeDistribution, writer.uint32(18).fork()).ldelim(); + } + if (message.nonOsmoTakerFeeDistribution !== undefined) { + TakerFeeDistributionPercentage.encode(message.nonOsmoTakerFeeDistribution, writer.uint32(26).fork()).ldelim(); + } + for (const v of message.adminAddresses) { + writer.uint32(34).string(v!); + } + if (message.communityPoolDenomToSwapNonWhitelistedAssetsTo !== "") { + writer.uint32(42).string(message.communityPoolDenomToSwapNonWhitelistedAssetsTo); + } + for (const v of message.reducedFeeWhitelist) { + writer.uint32(50).string(v!); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): TakerFeeParams { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseTakerFeeParams(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.defaultTakerFee = Decimal.fromAtomics(reader.string(), 18).toString(); + break; + case 2: + message.osmoTakerFeeDistribution = TakerFeeDistributionPercentage.decode(reader, reader.uint32()); + break; + case 3: + message.nonOsmoTakerFeeDistribution = TakerFeeDistributionPercentage.decode(reader, reader.uint32()); + break; + case 4: + message.adminAddresses.push(reader.string()); + break; + case 5: + message.communityPoolDenomToSwapNonWhitelistedAssetsTo = reader.string(); + break; + case 6: + message.reducedFeeWhitelist.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): TakerFeeParams { + return { + defaultTakerFee: isSet(object.defaultTakerFee) ? String(object.defaultTakerFee) : "", + osmoTakerFeeDistribution: isSet(object.osmoTakerFeeDistribution) ? TakerFeeDistributionPercentage.fromJSON(object.osmoTakerFeeDistribution) : undefined, + nonOsmoTakerFeeDistribution: isSet(object.nonOsmoTakerFeeDistribution) ? TakerFeeDistributionPercentage.fromJSON(object.nonOsmoTakerFeeDistribution) : undefined, + adminAddresses: Array.isArray(object?.adminAddresses) ? object.adminAddresses.map((e: any) => String(e)) : [], + communityPoolDenomToSwapNonWhitelistedAssetsTo: isSet(object.communityPoolDenomToSwapNonWhitelistedAssetsTo) ? String(object.communityPoolDenomToSwapNonWhitelistedAssetsTo) : "", + reducedFeeWhitelist: Array.isArray(object?.reducedFeeWhitelist) ? object.reducedFeeWhitelist.map((e: any) => String(e)) : [] + }; + }, + toJSON(message: TakerFeeParams): unknown { + const obj: any = {}; + message.defaultTakerFee !== undefined && (obj.defaultTakerFee = message.defaultTakerFee); + message.osmoTakerFeeDistribution !== undefined && (obj.osmoTakerFeeDistribution = message.osmoTakerFeeDistribution ? TakerFeeDistributionPercentage.toJSON(message.osmoTakerFeeDistribution) : undefined); + message.nonOsmoTakerFeeDistribution !== undefined && (obj.nonOsmoTakerFeeDistribution = message.nonOsmoTakerFeeDistribution ? TakerFeeDistributionPercentage.toJSON(message.nonOsmoTakerFeeDistribution) : undefined); + if (message.adminAddresses) { + obj.adminAddresses = message.adminAddresses.map(e => e); + } else { + obj.adminAddresses = []; + } + message.communityPoolDenomToSwapNonWhitelistedAssetsTo !== undefined && (obj.communityPoolDenomToSwapNonWhitelistedAssetsTo = message.communityPoolDenomToSwapNonWhitelistedAssetsTo); + if (message.reducedFeeWhitelist) { + obj.reducedFeeWhitelist = message.reducedFeeWhitelist.map(e => e); + } else { + obj.reducedFeeWhitelist = []; + } + return obj; + }, + fromPartial(object: Partial): TakerFeeParams { + const message = createBaseTakerFeeParams(); + message.defaultTakerFee = object.defaultTakerFee ?? ""; + message.osmoTakerFeeDistribution = object.osmoTakerFeeDistribution !== undefined && object.osmoTakerFeeDistribution !== null ? TakerFeeDistributionPercentage.fromPartial(object.osmoTakerFeeDistribution) : undefined; + message.nonOsmoTakerFeeDistribution = object.nonOsmoTakerFeeDistribution !== undefined && object.nonOsmoTakerFeeDistribution !== null ? TakerFeeDistributionPercentage.fromPartial(object.nonOsmoTakerFeeDistribution) : undefined; + message.adminAddresses = object.adminAddresses?.map(e => e) || []; + message.communityPoolDenomToSwapNonWhitelistedAssetsTo = object.communityPoolDenomToSwapNonWhitelistedAssetsTo ?? ""; + message.reducedFeeWhitelist = object.reducedFeeWhitelist?.map(e => e) || []; + return message; + }, + fromAmino(object: TakerFeeParamsAmino): TakerFeeParams { + const message = createBaseTakerFeeParams(); + if (object.default_taker_fee !== undefined && object.default_taker_fee !== null) { + message.defaultTakerFee = object.default_taker_fee; + } + if (object.osmo_taker_fee_distribution !== undefined && object.osmo_taker_fee_distribution !== null) { + message.osmoTakerFeeDistribution = TakerFeeDistributionPercentage.fromAmino(object.osmo_taker_fee_distribution); + } + if (object.non_osmo_taker_fee_distribution !== undefined && object.non_osmo_taker_fee_distribution !== null) { + message.nonOsmoTakerFeeDistribution = TakerFeeDistributionPercentage.fromAmino(object.non_osmo_taker_fee_distribution); + } + message.adminAddresses = object.admin_addresses?.map(e => e) || []; + if (object.community_pool_denom_to_swap_non_whitelisted_assets_to !== undefined && object.community_pool_denom_to_swap_non_whitelisted_assets_to !== null) { + message.communityPoolDenomToSwapNonWhitelistedAssetsTo = object.community_pool_denom_to_swap_non_whitelisted_assets_to; + } + message.reducedFeeWhitelist = object.reduced_fee_whitelist?.map(e => e) || []; + return message; + }, + toAmino(message: TakerFeeParams): TakerFeeParamsAmino { + const obj: any = {}; + obj.default_taker_fee = message.defaultTakerFee; + obj.osmo_taker_fee_distribution = message.osmoTakerFeeDistribution ? TakerFeeDistributionPercentage.toAmino(message.osmoTakerFeeDistribution) : undefined; + obj.non_osmo_taker_fee_distribution = message.nonOsmoTakerFeeDistribution ? TakerFeeDistributionPercentage.toAmino(message.nonOsmoTakerFeeDistribution) : undefined; + if (message.adminAddresses) { + obj.admin_addresses = message.adminAddresses.map(e => e); + } else { + obj.admin_addresses = []; + } + obj.community_pool_denom_to_swap_non_whitelisted_assets_to = message.communityPoolDenomToSwapNonWhitelistedAssetsTo; + if (message.reducedFeeWhitelist) { + obj.reduced_fee_whitelist = message.reducedFeeWhitelist.map(e => e); + } else { + obj.reduced_fee_whitelist = []; + } + return obj; + }, + fromAminoMsg(object: TakerFeeParamsAminoMsg): TakerFeeParams { + return TakerFeeParams.fromAmino(object.value); + }, + toAminoMsg(message: TakerFeeParams): TakerFeeParamsAminoMsg { + return { + type: "osmosis/poolmanager/taker-fee-params", + value: TakerFeeParams.toAmino(message) + }; + }, + fromProtoMsg(message: TakerFeeParamsProtoMsg): TakerFeeParams { + return TakerFeeParams.decode(message.value); + }, + toProto(message: TakerFeeParams): Uint8Array { + return TakerFeeParams.encode(message).finish(); + }, + toProtoMsg(message: TakerFeeParams): TakerFeeParamsProtoMsg { + return { + typeUrl: "/osmosis.poolmanager.v1beta1.TakerFeeParams", + value: TakerFeeParams.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(TakerFeeParams.typeUrl, TakerFeeParams); +GlobalDecoderRegistry.registerAminoProtoMapping(TakerFeeParams.aminoType, TakerFeeParams.typeUrl); +function createBaseTakerFeeDistributionPercentage(): TakerFeeDistributionPercentage { + return { + stakingRewards: "", + communityPool: "" + }; +} +export const TakerFeeDistributionPercentage = { + typeUrl: "/osmosis.poolmanager.v1beta1.TakerFeeDistributionPercentage", + aminoType: "osmosis/poolmanager/taker-fee-distribution-percentage", + is(o: any): o is TakerFeeDistributionPercentage { + return o && (o.$typeUrl === TakerFeeDistributionPercentage.typeUrl || typeof o.stakingRewards === "string" && typeof o.communityPool === "string"); + }, + isSDK(o: any): o is TakerFeeDistributionPercentageSDKType { + return o && (o.$typeUrl === TakerFeeDistributionPercentage.typeUrl || typeof o.staking_rewards === "string" && typeof o.community_pool === "string"); + }, + isAmino(o: any): o is TakerFeeDistributionPercentageAmino { + return o && (o.$typeUrl === TakerFeeDistributionPercentage.typeUrl || typeof o.staking_rewards === "string" && typeof o.community_pool === "string"); + }, + encode(message: TakerFeeDistributionPercentage, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.stakingRewards !== "") { + writer.uint32(10).string(Decimal.fromUserInput(message.stakingRewards, 18).atomics); + } + if (message.communityPool !== "") { + writer.uint32(18).string(Decimal.fromUserInput(message.communityPool, 18).atomics); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): TakerFeeDistributionPercentage { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseTakerFeeDistributionPercentage(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.stakingRewards = Decimal.fromAtomics(reader.string(), 18).toString(); + break; + case 2: + message.communityPool = Decimal.fromAtomics(reader.string(), 18).toString(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): TakerFeeDistributionPercentage { + return { + stakingRewards: isSet(object.stakingRewards) ? String(object.stakingRewards) : "", + communityPool: isSet(object.communityPool) ? String(object.communityPool) : "" + }; + }, + toJSON(message: TakerFeeDistributionPercentage): unknown { + const obj: any = {}; + message.stakingRewards !== undefined && (obj.stakingRewards = message.stakingRewards); + message.communityPool !== undefined && (obj.communityPool = message.communityPool); + return obj; + }, + fromPartial(object: Partial): TakerFeeDistributionPercentage { + const message = createBaseTakerFeeDistributionPercentage(); + message.stakingRewards = object.stakingRewards ?? ""; + message.communityPool = object.communityPool ?? ""; + return message; + }, + fromAmino(object: TakerFeeDistributionPercentageAmino): TakerFeeDistributionPercentage { + const message = createBaseTakerFeeDistributionPercentage(); + if (object.staking_rewards !== undefined && object.staking_rewards !== null) { + message.stakingRewards = object.staking_rewards; + } + if (object.community_pool !== undefined && object.community_pool !== null) { + message.communityPool = object.community_pool; + } + return message; + }, + toAmino(message: TakerFeeDistributionPercentage): TakerFeeDistributionPercentageAmino { + const obj: any = {}; + obj.staking_rewards = message.stakingRewards; + obj.community_pool = message.communityPool; + return obj; + }, + fromAminoMsg(object: TakerFeeDistributionPercentageAminoMsg): TakerFeeDistributionPercentage { + return TakerFeeDistributionPercentage.fromAmino(object.value); + }, + toAminoMsg(message: TakerFeeDistributionPercentage): TakerFeeDistributionPercentageAminoMsg { + return { + type: "osmosis/poolmanager/taker-fee-distribution-percentage", + value: TakerFeeDistributionPercentage.toAmino(message) + }; + }, + fromProtoMsg(message: TakerFeeDistributionPercentageProtoMsg): TakerFeeDistributionPercentage { + return TakerFeeDistributionPercentage.decode(message.value); + }, + toProto(message: TakerFeeDistributionPercentage): Uint8Array { + return TakerFeeDistributionPercentage.encode(message).finish(); + }, + toProtoMsg(message: TakerFeeDistributionPercentage): TakerFeeDistributionPercentageProtoMsg { + return { + typeUrl: "/osmosis.poolmanager.v1beta1.TakerFeeDistributionPercentage", + value: TakerFeeDistributionPercentage.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(TakerFeeDistributionPercentage.typeUrl, TakerFeeDistributionPercentage); +GlobalDecoderRegistry.registerAminoProtoMapping(TakerFeeDistributionPercentage.aminoType, TakerFeeDistributionPercentage.typeUrl); +function createBaseTakerFeesTracker(): TakerFeesTracker { + return { + takerFeesToStakers: [], + takerFeesToCommunityPool: [], + heightAccountingStartsFrom: BigInt(0) + }; +} +export const TakerFeesTracker = { + typeUrl: "/osmosis.poolmanager.v1beta1.TakerFeesTracker", + aminoType: "osmosis/poolmanager/taker-fees-tracker", + is(o: any): o is TakerFeesTracker { + return o && (o.$typeUrl === TakerFeesTracker.typeUrl || Array.isArray(o.takerFeesToStakers) && (!o.takerFeesToStakers.length || Coin.is(o.takerFeesToStakers[0])) && Array.isArray(o.takerFeesToCommunityPool) && (!o.takerFeesToCommunityPool.length || Coin.is(o.takerFeesToCommunityPool[0])) && typeof o.heightAccountingStartsFrom === "bigint"); + }, + isSDK(o: any): o is TakerFeesTrackerSDKType { + return o && (o.$typeUrl === TakerFeesTracker.typeUrl || Array.isArray(o.taker_fees_to_stakers) && (!o.taker_fees_to_stakers.length || Coin.isSDK(o.taker_fees_to_stakers[0])) && Array.isArray(o.taker_fees_to_community_pool) && (!o.taker_fees_to_community_pool.length || Coin.isSDK(o.taker_fees_to_community_pool[0])) && typeof o.height_accounting_starts_from === "bigint"); + }, + isAmino(o: any): o is TakerFeesTrackerAmino { + return o && (o.$typeUrl === TakerFeesTracker.typeUrl || Array.isArray(o.taker_fees_to_stakers) && (!o.taker_fees_to_stakers.length || Coin.isAmino(o.taker_fees_to_stakers[0])) && Array.isArray(o.taker_fees_to_community_pool) && (!o.taker_fees_to_community_pool.length || Coin.isAmino(o.taker_fees_to_community_pool[0])) && typeof o.height_accounting_starts_from === "bigint"); + }, + encode(message: TakerFeesTracker, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.takerFeesToStakers) { + Coin.encode(v!, writer.uint32(10).fork()).ldelim(); + } + for (const v of message.takerFeesToCommunityPool) { + Coin.encode(v!, writer.uint32(18).fork()).ldelim(); + } + if (message.heightAccountingStartsFrom !== BigInt(0)) { + writer.uint32(24).int64(message.heightAccountingStartsFrom); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): TakerFeesTracker { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseTakerFeesTracker(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.takerFeesToStakers.push(Coin.decode(reader, reader.uint32())); + break; + case 2: + message.takerFeesToCommunityPool.push(Coin.decode(reader, reader.uint32())); + break; + case 3: + message.heightAccountingStartsFrom = reader.int64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): TakerFeesTracker { + return { + takerFeesToStakers: Array.isArray(object?.takerFeesToStakers) ? object.takerFeesToStakers.map((e: any) => Coin.fromJSON(e)) : [], + takerFeesToCommunityPool: Array.isArray(object?.takerFeesToCommunityPool) ? object.takerFeesToCommunityPool.map((e: any) => Coin.fromJSON(e)) : [], + heightAccountingStartsFrom: isSet(object.heightAccountingStartsFrom) ? BigInt(object.heightAccountingStartsFrom.toString()) : BigInt(0) + }; + }, + toJSON(message: TakerFeesTracker): unknown { + const obj: any = {}; + if (message.takerFeesToStakers) { + obj.takerFeesToStakers = message.takerFeesToStakers.map(e => e ? Coin.toJSON(e) : undefined); + } else { + obj.takerFeesToStakers = []; + } + if (message.takerFeesToCommunityPool) { + obj.takerFeesToCommunityPool = message.takerFeesToCommunityPool.map(e => e ? Coin.toJSON(e) : undefined); + } else { + obj.takerFeesToCommunityPool = []; + } + message.heightAccountingStartsFrom !== undefined && (obj.heightAccountingStartsFrom = (message.heightAccountingStartsFrom || BigInt(0)).toString()); + return obj; + }, + fromPartial(object: Partial): TakerFeesTracker { + const message = createBaseTakerFeesTracker(); + message.takerFeesToStakers = object.takerFeesToStakers?.map(e => Coin.fromPartial(e)) || []; + message.takerFeesToCommunityPool = object.takerFeesToCommunityPool?.map(e => Coin.fromPartial(e)) || []; + message.heightAccountingStartsFrom = object.heightAccountingStartsFrom !== undefined && object.heightAccountingStartsFrom !== null ? BigInt(object.heightAccountingStartsFrom.toString()) : BigInt(0); + return message; + }, + fromAmino(object: TakerFeesTrackerAmino): TakerFeesTracker { + const message = createBaseTakerFeesTracker(); + message.takerFeesToStakers = object.taker_fees_to_stakers?.map(e => Coin.fromAmino(e)) || []; + message.takerFeesToCommunityPool = object.taker_fees_to_community_pool?.map(e => Coin.fromAmino(e)) || []; + if (object.height_accounting_starts_from !== undefined && object.height_accounting_starts_from !== null) { + message.heightAccountingStartsFrom = BigInt(object.height_accounting_starts_from); + } + return message; + }, + toAmino(message: TakerFeesTracker): TakerFeesTrackerAmino { + const obj: any = {}; + if (message.takerFeesToStakers) { + obj.taker_fees_to_stakers = message.takerFeesToStakers.map(e => e ? Coin.toAmino(e) : undefined); + } else { + obj.taker_fees_to_stakers = []; + } + if (message.takerFeesToCommunityPool) { + obj.taker_fees_to_community_pool = message.takerFeesToCommunityPool.map(e => e ? Coin.toAmino(e) : undefined); + } else { + obj.taker_fees_to_community_pool = []; + } + obj.height_accounting_starts_from = message.heightAccountingStartsFrom ? message.heightAccountingStartsFrom.toString() : undefined; + return obj; + }, + fromAminoMsg(object: TakerFeesTrackerAminoMsg): TakerFeesTracker { + return TakerFeesTracker.fromAmino(object.value); + }, + toAminoMsg(message: TakerFeesTracker): TakerFeesTrackerAminoMsg { + return { + type: "osmosis/poolmanager/taker-fees-tracker", + value: TakerFeesTracker.toAmino(message) + }; + }, + fromProtoMsg(message: TakerFeesTrackerProtoMsg): TakerFeesTracker { + return TakerFeesTracker.decode(message.value); + }, + toProto(message: TakerFeesTracker): Uint8Array { + return TakerFeesTracker.encode(message).finish(); + }, + toProtoMsg(message: TakerFeesTracker): TakerFeesTrackerProtoMsg { + return { + typeUrl: "/osmosis.poolmanager.v1beta1.TakerFeesTracker", + value: TakerFeesTracker.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(TakerFeesTracker.typeUrl, TakerFeesTracker); +GlobalDecoderRegistry.registerAminoProtoMapping(TakerFeesTracker.aminoType, TakerFeesTracker.typeUrl); +function createBasePoolVolume(): PoolVolume { + return { + poolId: BigInt(0), + poolVolume: [] + }; +} +export const PoolVolume = { + typeUrl: "/osmosis.poolmanager.v1beta1.PoolVolume", + aminoType: "osmosis/poolmanager/pool-volume", + is(o: any): o is PoolVolume { + return o && (o.$typeUrl === PoolVolume.typeUrl || typeof o.poolId === "bigint" && Array.isArray(o.poolVolume) && (!o.poolVolume.length || Coin.is(o.poolVolume[0]))); + }, + isSDK(o: any): o is PoolVolumeSDKType { + return o && (o.$typeUrl === PoolVolume.typeUrl || typeof o.pool_id === "bigint" && Array.isArray(o.pool_volume) && (!o.pool_volume.length || Coin.isSDK(o.pool_volume[0]))); + }, + isAmino(o: any): o is PoolVolumeAmino { + return o && (o.$typeUrl === PoolVolume.typeUrl || typeof o.pool_id === "bigint" && Array.isArray(o.pool_volume) && (!o.pool_volume.length || Coin.isAmino(o.pool_volume[0]))); + }, + encode(message: PoolVolume, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.poolId !== BigInt(0)) { + writer.uint32(8).uint64(message.poolId); + } + for (const v of message.poolVolume) { + Coin.encode(v!, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): PoolVolume { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBasePoolVolume(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.poolId = reader.uint64(); + break; + case 2: + message.poolVolume.push(Coin.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): PoolVolume { + return { + poolId: isSet(object.poolId) ? BigInt(object.poolId.toString()) : BigInt(0), + poolVolume: Array.isArray(object?.poolVolume) ? object.poolVolume.map((e: any) => Coin.fromJSON(e)) : [] + }; + }, + toJSON(message: PoolVolume): unknown { + const obj: any = {}; + message.poolId !== undefined && (obj.poolId = (message.poolId || BigInt(0)).toString()); + if (message.poolVolume) { + obj.poolVolume = message.poolVolume.map(e => e ? Coin.toJSON(e) : undefined); + } else { + obj.poolVolume = []; + } + return obj; + }, + fromPartial(object: Partial): PoolVolume { + const message = createBasePoolVolume(); + message.poolId = object.poolId !== undefined && object.poolId !== null ? BigInt(object.poolId.toString()) : BigInt(0); + message.poolVolume = object.poolVolume?.map(e => Coin.fromPartial(e)) || []; + return message; + }, + fromAmino(object: PoolVolumeAmino): PoolVolume { + const message = createBasePoolVolume(); + if (object.pool_id !== undefined && object.pool_id !== null) { + message.poolId = BigInt(object.pool_id); + } + message.poolVolume = object.pool_volume?.map(e => Coin.fromAmino(e)) || []; + return message; + }, + toAmino(message: PoolVolume): PoolVolumeAmino { + const obj: any = {}; + obj.pool_id = message.poolId ? message.poolId.toString() : undefined; + if (message.poolVolume) { + obj.pool_volume = message.poolVolume.map(e => e ? Coin.toAmino(e) : undefined); + } else { + obj.pool_volume = []; + } + return obj; + }, + fromAminoMsg(object: PoolVolumeAminoMsg): PoolVolume { + return PoolVolume.fromAmino(object.value); + }, + toAminoMsg(message: PoolVolume): PoolVolumeAminoMsg { + return { + type: "osmosis/poolmanager/pool-volume", + value: PoolVolume.toAmino(message) + }; + }, + fromProtoMsg(message: PoolVolumeProtoMsg): PoolVolume { + return PoolVolume.decode(message.value); + }, + toProto(message: PoolVolume): Uint8Array { + return PoolVolume.encode(message).finish(); + }, + toProtoMsg(message: PoolVolume): PoolVolumeProtoMsg { + return { + typeUrl: "/osmosis.poolmanager.v1beta1.PoolVolume", + value: PoolVolume.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(PoolVolume.typeUrl, PoolVolume); +GlobalDecoderRegistry.registerAminoProtoMapping(PoolVolume.aminoType, PoolVolume.typeUrl); \ No newline at end of file diff --git a/packages/osmojs/src/codegen/osmosis/poolmanager/v1beta1/gov.ts b/packages/osmojs/src/codegen/osmosis/poolmanager/v1beta1/gov.ts new file mode 100644 index 000000000..7fe8c0dee --- /dev/null +++ b/packages/osmojs/src/codegen/osmosis/poolmanager/v1beta1/gov.ts @@ -0,0 +1,164 @@ +import { DenomPairTakerFee, DenomPairTakerFeeAmino, DenomPairTakerFeeSDKType } from "./tx"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { isSet } from "../../../helpers"; +import { GlobalDecoderRegistry } from "../../../registry"; +/** + * DenomPairTakerFeeProposal is a type for adding/removing a custom taker fee(s) + * for one or more denom pairs. + */ +export interface DenomPairTakerFeeProposal { + title: string; + description: string; + denomPairTakerFee: DenomPairTakerFee[]; +} +export interface DenomPairTakerFeeProposalProtoMsg { + typeUrl: "/osmosis.poolmanager.v1beta1.DenomPairTakerFeeProposal"; + value: Uint8Array; +} +/** + * DenomPairTakerFeeProposal is a type for adding/removing a custom taker fee(s) + * for one or more denom pairs. + */ +export interface DenomPairTakerFeeProposalAmino { + title?: string; + description?: string; + denom_pair_taker_fee?: DenomPairTakerFeeAmino[]; +} +export interface DenomPairTakerFeeProposalAminoMsg { + type: "osmosis/poolmanager/denom-pair-taker-fee-proposal"; + value: DenomPairTakerFeeProposalAmino; +} +/** + * DenomPairTakerFeeProposal is a type for adding/removing a custom taker fee(s) + * for one or more denom pairs. + */ +export interface DenomPairTakerFeeProposalSDKType { + title: string; + description: string; + denom_pair_taker_fee: DenomPairTakerFeeSDKType[]; +} +function createBaseDenomPairTakerFeeProposal(): DenomPairTakerFeeProposal { + return { + title: "", + description: "", + denomPairTakerFee: [] + }; +} +export const DenomPairTakerFeeProposal = { + typeUrl: "/osmosis.poolmanager.v1beta1.DenomPairTakerFeeProposal", + aminoType: "osmosis/poolmanager/denom-pair-taker-fee-proposal", + is(o: any): o is DenomPairTakerFeeProposal { + return o && (o.$typeUrl === DenomPairTakerFeeProposal.typeUrl || typeof o.title === "string" && typeof o.description === "string" && Array.isArray(o.denomPairTakerFee) && (!o.denomPairTakerFee.length || DenomPairTakerFee.is(o.denomPairTakerFee[0]))); + }, + isSDK(o: any): o is DenomPairTakerFeeProposalSDKType { + return o && (o.$typeUrl === DenomPairTakerFeeProposal.typeUrl || typeof o.title === "string" && typeof o.description === "string" && Array.isArray(o.denom_pair_taker_fee) && (!o.denom_pair_taker_fee.length || DenomPairTakerFee.isSDK(o.denom_pair_taker_fee[0]))); + }, + isAmino(o: any): o is DenomPairTakerFeeProposalAmino { + return o && (o.$typeUrl === DenomPairTakerFeeProposal.typeUrl || typeof o.title === "string" && typeof o.description === "string" && Array.isArray(o.denom_pair_taker_fee) && (!o.denom_pair_taker_fee.length || DenomPairTakerFee.isAmino(o.denom_pair_taker_fee[0]))); + }, + encode(message: DenomPairTakerFeeProposal, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.title !== "") { + writer.uint32(10).string(message.title); + } + if (message.description !== "") { + writer.uint32(18).string(message.description); + } + for (const v of message.denomPairTakerFee) { + DenomPairTakerFee.encode(v!, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): DenomPairTakerFeeProposal { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseDenomPairTakerFeeProposal(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.title = reader.string(); + break; + case 2: + message.description = reader.string(); + break; + case 3: + message.denomPairTakerFee.push(DenomPairTakerFee.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): DenomPairTakerFeeProposal { + return { + title: isSet(object.title) ? String(object.title) : "", + description: isSet(object.description) ? String(object.description) : "", + denomPairTakerFee: Array.isArray(object?.denomPairTakerFee) ? object.denomPairTakerFee.map((e: any) => DenomPairTakerFee.fromJSON(e)) : [] + }; + }, + toJSON(message: DenomPairTakerFeeProposal): unknown { + const obj: any = {}; + message.title !== undefined && (obj.title = message.title); + message.description !== undefined && (obj.description = message.description); + if (message.denomPairTakerFee) { + obj.denomPairTakerFee = message.denomPairTakerFee.map(e => e ? DenomPairTakerFee.toJSON(e) : undefined); + } else { + obj.denomPairTakerFee = []; + } + return obj; + }, + fromPartial(object: Partial): DenomPairTakerFeeProposal { + const message = createBaseDenomPairTakerFeeProposal(); + message.title = object.title ?? ""; + message.description = object.description ?? ""; + message.denomPairTakerFee = object.denomPairTakerFee?.map(e => DenomPairTakerFee.fromPartial(e)) || []; + return message; + }, + fromAmino(object: DenomPairTakerFeeProposalAmino): DenomPairTakerFeeProposal { + const message = createBaseDenomPairTakerFeeProposal(); + if (object.title !== undefined && object.title !== null) { + message.title = object.title; + } + if (object.description !== undefined && object.description !== null) { + message.description = object.description; + } + message.denomPairTakerFee = object.denom_pair_taker_fee?.map(e => DenomPairTakerFee.fromAmino(e)) || []; + return message; + }, + toAmino(message: DenomPairTakerFeeProposal): DenomPairTakerFeeProposalAmino { + const obj: any = {}; + obj.title = message.title; + obj.description = message.description; + if (message.denomPairTakerFee) { + obj.denom_pair_taker_fee = message.denomPairTakerFee.map(e => e ? DenomPairTakerFee.toAmino(e) : undefined); + } else { + obj.denom_pair_taker_fee = []; + } + return obj; + }, + fromAminoMsg(object: DenomPairTakerFeeProposalAminoMsg): DenomPairTakerFeeProposal { + return DenomPairTakerFeeProposal.fromAmino(object.value); + }, + toAminoMsg(message: DenomPairTakerFeeProposal): DenomPairTakerFeeProposalAminoMsg { + return { + type: "osmosis/poolmanager/denom-pair-taker-fee-proposal", + value: DenomPairTakerFeeProposal.toAmino(message) + }; + }, + fromProtoMsg(message: DenomPairTakerFeeProposalProtoMsg): DenomPairTakerFeeProposal { + return DenomPairTakerFeeProposal.decode(message.value); + }, + toProto(message: DenomPairTakerFeeProposal): Uint8Array { + return DenomPairTakerFeeProposal.encode(message).finish(); + }, + toProtoMsg(message: DenomPairTakerFeeProposal): DenomPairTakerFeeProposalProtoMsg { + return { + typeUrl: "/osmosis.poolmanager.v1beta1.DenomPairTakerFeeProposal", + value: DenomPairTakerFeeProposal.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(DenomPairTakerFeeProposal.typeUrl, DenomPairTakerFeeProposal); +GlobalDecoderRegistry.registerAminoProtoMapping(DenomPairTakerFeeProposal.aminoType, DenomPairTakerFeeProposal.typeUrl); \ No newline at end of file diff --git a/packages/osmojs/src/codegen/osmosis/poolmanager/v1beta1/module_route.ts b/packages/osmojs/src/codegen/osmosis/poolmanager/v1beta1/module_route.ts index f8366c174..e8c5fd45d 100644 --- a/packages/osmojs/src/codegen/osmosis/poolmanager/v1beta1/module_route.ts +++ b/packages/osmojs/src/codegen/osmosis/poolmanager/v1beta1/module_route.ts @@ -1,5 +1,6 @@ -import { BinaryReader, BinaryWriter } from "../../../binary"; import { isSet } from "../../../helpers"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { GlobalDecoderRegistry } from "../../../registry"; /** PoolType is an enumeration of all supported pool types. */ export enum PoolType { /** Balancer - Balancer is the standard xy=k curve. Its pool model is defined in x/gamm. */ @@ -81,8 +82,8 @@ export interface ModuleRouteProtoMsg { */ export interface ModuleRouteAmino { /** pool_type specifies the type of the pool */ - pool_type: PoolType; - pool_id: string; + pool_type?: PoolType; + pool_id?: string; } export interface ModuleRouteAminoMsg { type: "osmosis/poolmanager/module-route"; @@ -106,6 +107,16 @@ function createBaseModuleRoute(): ModuleRoute { } export const ModuleRoute = { typeUrl: "/osmosis.poolmanager.v1beta1.ModuleRoute", + aminoType: "osmosis/poolmanager/module-route", + is(o: any): o is ModuleRoute { + return o && (o.$typeUrl === ModuleRoute.typeUrl || isSet(o.poolType)); + }, + isSDK(o: any): o is ModuleRouteSDKType { + return o && (o.$typeUrl === ModuleRoute.typeUrl || isSet(o.pool_type)); + }, + isAmino(o: any): o is ModuleRouteAmino { + return o && (o.$typeUrl === ModuleRoute.typeUrl || isSet(o.pool_type)); + }, encode(message: ModuleRoute, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.poolType !== 0) { writer.uint32(8).int32(message.poolType); @@ -135,6 +146,20 @@ export const ModuleRoute = { } return message; }, + fromJSON(object: any): ModuleRoute { + return { + poolType: isSet(object.poolType) ? poolTypeFromJSON(object.poolType) : -1, + poolId: isSet(object.poolId) ? BigInt(object.poolId.toString()) : undefined + }; + }, + toJSON(message: ModuleRoute): unknown { + const obj: any = {}; + message.poolType !== undefined && (obj.poolType = poolTypeToJSON(message.poolType)); + if (message.poolId !== undefined) { + obj.poolId = message.poolId.toString(); + } + return obj; + }, fromPartial(object: Partial): ModuleRoute { const message = createBaseModuleRoute(); message.poolType = object.poolType ?? 0; @@ -142,14 +167,18 @@ export const ModuleRoute = { return message; }, fromAmino(object: ModuleRouteAmino): ModuleRoute { - return { - poolType: isSet(object.pool_type) ? poolTypeFromJSON(object.pool_type) : -1, - poolId: object?.pool_id ? BigInt(object.pool_id) : undefined - }; + const message = createBaseModuleRoute(); + if (object.pool_type !== undefined && object.pool_type !== null) { + message.poolType = poolTypeFromJSON(object.pool_type); + } + if (object.pool_id !== undefined && object.pool_id !== null) { + message.poolId = BigInt(object.pool_id); + } + return message; }, toAmino(message: ModuleRoute): ModuleRouteAmino { const obj: any = {}; - obj.pool_type = message.poolType; + obj.pool_type = poolTypeToJSON(message.poolType); obj.pool_id = message.poolId ? message.poolId.toString() : undefined; return obj; }, @@ -174,4 +203,6 @@ export const ModuleRoute = { value: ModuleRoute.encode(message).finish() }; } -}; \ No newline at end of file +}; +GlobalDecoderRegistry.register(ModuleRoute.typeUrl, ModuleRoute); +GlobalDecoderRegistry.registerAminoProtoMapping(ModuleRoute.aminoType, ModuleRoute.typeUrl); \ No newline at end of file diff --git a/packages/osmojs/src/codegen/osmosis/poolmanager/v1beta1/query.lcd.ts b/packages/osmojs/src/codegen/osmosis/poolmanager/v1beta1/query.lcd.ts index 1fe285062..47d979805 100644 --- a/packages/osmojs/src/codegen/osmosis/poolmanager/v1beta1/query.lcd.ts +++ b/packages/osmojs/src/codegen/osmosis/poolmanager/v1beta1/query.lcd.ts @@ -1,5 +1,5 @@ import { LCDClient } from "@cosmology/lcd"; -import { ParamsRequest, ParamsResponseSDKType, EstimateSwapExactAmountInRequest, EstimateSwapExactAmountInResponseSDKType, EstimateSinglePoolSwapExactAmountInRequest, EstimateSwapExactAmountOutRequest, EstimateSwapExactAmountOutResponseSDKType, EstimateSinglePoolSwapExactAmountOutRequest, NumPoolsRequest, NumPoolsResponseSDKType, PoolRequest, PoolResponseSDKType, AllPoolsRequest, AllPoolsResponseSDKType, SpotPriceRequest, SpotPriceResponseSDKType, TotalPoolLiquidityRequest, TotalPoolLiquidityResponseSDKType, TotalLiquidityRequest, TotalLiquidityResponseSDKType } from "./query"; +import { ParamsRequest, ParamsResponseSDKType, EstimateSwapExactAmountInRequest, EstimateSwapExactAmountInResponseSDKType, EstimateSwapExactAmountInWithPrimitiveTypesRequest, EstimateSinglePoolSwapExactAmountInRequest, EstimateSwapExactAmountOutRequest, EstimateSwapExactAmountOutResponseSDKType, EstimateSwapExactAmountOutWithPrimitiveTypesRequest, EstimateSinglePoolSwapExactAmountOutRequest, NumPoolsRequest, NumPoolsResponseSDKType, PoolRequest, PoolResponseSDKType, AllPoolsRequest, AllPoolsResponseSDKType, ListPoolsByDenomRequest, ListPoolsByDenomResponseSDKType, SpotPriceRequest, SpotPriceResponseSDKType, TotalPoolLiquidityRequest, TotalPoolLiquidityResponseSDKType, TotalLiquidityRequest, TotalLiquidityResponseSDKType, TotalVolumeForPoolRequest, TotalVolumeForPoolResponseSDKType, TradingPairTakerFeeRequest, TradingPairTakerFeeResponseSDKType, EstimateTradeBasedOnPriceImpactRequest, EstimateTradeBasedOnPriceImpactResponseSDKType } from "./query"; export class LCDQueryClient { req: LCDClient; constructor({ @@ -10,15 +10,21 @@ export class LCDQueryClient { this.req = requestClient; this.params = this.params.bind(this); this.estimateSwapExactAmountIn = this.estimateSwapExactAmountIn.bind(this); + this.estimateSwapExactAmountInWithPrimitiveTypes = this.estimateSwapExactAmountInWithPrimitiveTypes.bind(this); this.estimateSinglePoolSwapExactAmountIn = this.estimateSinglePoolSwapExactAmountIn.bind(this); this.estimateSwapExactAmountOut = this.estimateSwapExactAmountOut.bind(this); + this.estimateSwapExactAmountOutWithPrimitiveTypes = this.estimateSwapExactAmountOutWithPrimitiveTypes.bind(this); this.estimateSinglePoolSwapExactAmountOut = this.estimateSinglePoolSwapExactAmountOut.bind(this); this.numPools = this.numPools.bind(this); this.pool = this.pool.bind(this); this.allPools = this.allPools.bind(this); + this.listPoolsByDenom = this.listPoolsByDenom.bind(this); this.spotPrice = this.spotPrice.bind(this); this.totalPoolLiquidity = this.totalPoolLiquidity.bind(this); this.totalLiquidity = this.totalLiquidity.bind(this); + this.totalVolumeForPool = this.totalVolumeForPool.bind(this); + this.tradingPairTakerFee = this.tradingPairTakerFee.bind(this); + this.estimateTradeBasedOnPriceImpact = this.estimateTradeBasedOnPriceImpact.bind(this); } /* Params */ async params(_params: ParamsRequest = {}): Promise { @@ -39,6 +45,32 @@ export class LCDQueryClient { const endpoint = `osmosis/poolmanager/v1beta1/${params.poolId}/estimate/swap_exact_amount_in`; return await this.req.get(endpoint, options); } + /* EstimateSwapExactAmountInWithPrimitiveTypes is an alternative query for + EstimateSwapExactAmountIn. Supports query via GRPC-Gateway by using + primitive types instead of repeated structs. Each index in the + routes_pool_id field corresponds to the respective routes_token_out_denom + value, thus they are required to have the same length and are grouped + together as pairs. + example usage: + http://0.0.0.0:1317/osmosis/poolmanager/v1beta1/1/estimate/ + swap_exact_amount_in_with_primitive_types?token_in=100000stake&routes_token_out_denom=uatom + &routes_token_out_denom=uion&routes_pool_id=1&routes_pool_id=2 */ + async estimateSwapExactAmountInWithPrimitiveTypes(params: EstimateSwapExactAmountInWithPrimitiveTypesRequest): Promise { + const options: any = { + params: {} + }; + if (typeof params?.tokenIn !== "undefined") { + options.params.token_in = params.tokenIn; + } + if (typeof params?.routesPoolId !== "undefined") { + options.params.routes_pool_id = params.routesPoolId; + } + if (typeof params?.routesTokenOutDenom !== "undefined") { + options.params.routes_token_out_denom = params.routesTokenOutDenom; + } + const endpoint = `osmosis/poolmanager/v1beta1/${params.poolId}/estimate/swap_exact_amount_in_with_primitive_types`; + return await this.req.get(endpoint, options); + } /* EstimateSinglePoolSwapExactAmountIn */ async estimateSinglePoolSwapExactAmountIn(params: EstimateSinglePoolSwapExactAmountInRequest): Promise { const options: any = { @@ -67,6 +99,23 @@ export class LCDQueryClient { const endpoint = `osmosis/poolmanager/v1beta1/${params.poolId}/estimate/swap_exact_amount_out`; return await this.req.get(endpoint, options); } + /* Estimates swap amount in given out. */ + async estimateSwapExactAmountOutWithPrimitiveTypes(params: EstimateSwapExactAmountOutWithPrimitiveTypesRequest): Promise { + const options: any = { + params: {} + }; + if (typeof params?.routesPoolId !== "undefined") { + options.params.routes_pool_id = params.routesPoolId; + } + if (typeof params?.routesTokenInDenom !== "undefined") { + options.params.routes_token_in_denom = params.routesTokenInDenom; + } + if (typeof params?.tokenOut !== "undefined") { + options.params.token_out = params.tokenOut; + } + const endpoint = `osmosis/poolmanager/v1beta1/${params.poolId}/estimate/swap_exact_amount_out_with_primitive_types`; + return await this.req.get(endpoint, options); + } /* EstimateSinglePoolSwapExactAmountOut */ async estimateSinglePoolSwapExactAmountOut(params: EstimateSinglePoolSwapExactAmountOutRequest): Promise { const options: any = { @@ -96,6 +145,17 @@ export class LCDQueryClient { const endpoint = `osmosis/poolmanager/v1beta1/all-pools`; return await this.req.get(endpoint); } + /* ListPoolsByDenom return all pools by denom */ + async listPoolsByDenom(params: ListPoolsByDenomRequest): Promise { + const options: any = { + params: {} + }; + if (typeof params?.denom !== "undefined") { + options.params.denom = params.denom; + } + const endpoint = `osmosis/poolmanager/v1beta1/list-pools-by-denom`; + return await this.req.get(endpoint, options); + } /* SpotPrice defines a gRPC query handler that returns the spot price given a base denomination and a quote denomination. */ async spotPrice(params: SpotPriceRequest): Promise { @@ -118,7 +178,48 @@ export class LCDQueryClient { } /* TotalLiquidity returns the total liquidity across all pools. */ async totalLiquidity(_params: TotalLiquidityRequest = {}): Promise { - const endpoint = `osmosis/poolmanager/v1beta1/pools/total_liquidity`; + const endpoint = `osmosis/poolmanager/v1beta1/total_liquidity`; return await this.req.get(endpoint); } + /* TotalVolumeForPool returns the total volume of the specified pool. */ + async totalVolumeForPool(params: TotalVolumeForPoolRequest): Promise { + const endpoint = `osmosis/poolmanager/v1beta1/pools/${params.poolId}/total_volume`; + return await this.req.get(endpoint); + } + /* TradingPairTakerFee returns the taker fee for a given set of denoms */ + async tradingPairTakerFee(params: TradingPairTakerFeeRequest): Promise { + const options: any = { + params: {} + }; + if (typeof params?.denom0 !== "undefined") { + options.params.denom_0 = params.denom0; + } + if (typeof params?.denom1 !== "undefined") { + options.params.denom_1 = params.denom1; + } + const endpoint = `osmosis/poolmanager/v1beta1/trading_pair_takerfee`; + return await this.req.get(endpoint, options); + } + /* EstimateTradeBasedOnPriceImpact returns an estimated trade based on price + impact, if a trade cannot be estimated a 0 input and 0 output would be + returned. */ + async estimateTradeBasedOnPriceImpact(params: EstimateTradeBasedOnPriceImpactRequest): Promise { + const options: any = { + params: {} + }; + if (typeof params?.fromCoin !== "undefined") { + options.params.from_coin = params.fromCoin; + } + if (typeof params?.toCoinDenom !== "undefined") { + options.params.to_coin_denom = params.toCoinDenom; + } + if (typeof params?.maxPriceImpact !== "undefined") { + options.params.max_price_impact = params.maxPriceImpact; + } + if (typeof params?.externalPrice !== "undefined") { + options.params.external_price = params.externalPrice; + } + const endpoint = `osmosis/poolmanager/v1beta1/${params.poolId}/estimate_trade`; + return await this.req.get(endpoint, options); + } } \ No newline at end of file diff --git a/packages/osmojs/src/codegen/osmosis/poolmanager/v1beta1/query.rpc.Query.ts b/packages/osmojs/src/codegen/osmosis/poolmanager/v1beta1/query.rpc.Query.ts index d310f1aba..29a7dfb66 100644 --- a/packages/osmojs/src/codegen/osmosis/poolmanager/v1beta1/query.rpc.Query.ts +++ b/packages/osmojs/src/codegen/osmosis/poolmanager/v1beta1/query.rpc.Query.ts @@ -1,14 +1,29 @@ import { Rpc } from "../../../helpers"; import { BinaryReader } from "../../../binary"; import { QueryClient, createProtobufRpcClient } from "@cosmjs/stargate"; -import { ParamsRequest, ParamsResponse, EstimateSwapExactAmountInRequest, EstimateSwapExactAmountInResponse, EstimateSinglePoolSwapExactAmountInRequest, EstimateSwapExactAmountOutRequest, EstimateSwapExactAmountOutResponse, EstimateSinglePoolSwapExactAmountOutRequest, NumPoolsRequest, NumPoolsResponse, PoolRequest, PoolResponse, AllPoolsRequest, AllPoolsResponse, SpotPriceRequest, SpotPriceResponse, TotalPoolLiquidityRequest, TotalPoolLiquidityResponse, TotalLiquidityRequest, TotalLiquidityResponse } from "./query"; +import { ParamsRequest, ParamsResponse, EstimateSwapExactAmountInRequest, EstimateSwapExactAmountInResponse, EstimateSwapExactAmountInWithPrimitiveTypesRequest, EstimateSinglePoolSwapExactAmountInRequest, EstimateSwapExactAmountOutRequest, EstimateSwapExactAmountOutResponse, EstimateSwapExactAmountOutWithPrimitiveTypesRequest, EstimateSinglePoolSwapExactAmountOutRequest, NumPoolsRequest, NumPoolsResponse, PoolRequest, PoolResponse, AllPoolsRequest, AllPoolsResponse, ListPoolsByDenomRequest, ListPoolsByDenomResponse, SpotPriceRequest, SpotPriceResponse, TotalPoolLiquidityRequest, TotalPoolLiquidityResponse, TotalLiquidityRequest, TotalLiquidityResponse, TotalVolumeForPoolRequest, TotalVolumeForPoolResponse, TradingPairTakerFeeRequest, TradingPairTakerFeeResponse, EstimateTradeBasedOnPriceImpactRequest, EstimateTradeBasedOnPriceImpactResponse } from "./query"; export interface Query { params(request?: ParamsRequest): Promise; /** Estimates swap amount out given in. */ estimateSwapExactAmountIn(request: EstimateSwapExactAmountInRequest): Promise; + /** + * EstimateSwapExactAmountInWithPrimitiveTypes is an alternative query for + * EstimateSwapExactAmountIn. Supports query via GRPC-Gateway by using + * primitive types instead of repeated structs. Each index in the + * routes_pool_id field corresponds to the respective routes_token_out_denom + * value, thus they are required to have the same length and are grouped + * together as pairs. + * example usage: + * http://0.0.0.0:1317/osmosis/poolmanager/v1beta1/1/estimate/ + * swap_exact_amount_in_with_primitive_types?token_in=100000stake&routes_token_out_denom=uatom + * &routes_token_out_denom=uion&routes_pool_id=1&routes_pool_id=2 + */ + estimateSwapExactAmountInWithPrimitiveTypes(request: EstimateSwapExactAmountInWithPrimitiveTypesRequest): Promise; estimateSinglePoolSwapExactAmountIn(request: EstimateSinglePoolSwapExactAmountInRequest): Promise; /** Estimates swap amount in given out. */ estimateSwapExactAmountOut(request: EstimateSwapExactAmountOutRequest): Promise; + /** Estimates swap amount in given out. */ + estimateSwapExactAmountOutWithPrimitiveTypes(request: EstimateSwapExactAmountOutWithPrimitiveTypesRequest): Promise; estimateSinglePoolSwapExactAmountOut(request: EstimateSinglePoolSwapExactAmountOutRequest): Promise; /** Returns the total number of pools existing in Osmosis. */ numPools(request?: NumPoolsRequest): Promise; @@ -16,6 +31,8 @@ export interface Query { pool(request: PoolRequest): Promise; /** AllPools returns all pools on the Osmosis chain sorted by IDs. */ allPools(request?: AllPoolsRequest): Promise; + /** ListPoolsByDenom return all pools by denom */ + listPoolsByDenom(request: ListPoolsByDenomRequest): Promise; /** * SpotPrice defines a gRPC query handler that returns the spot price given * a base denomination and a quote denomination. @@ -25,6 +42,16 @@ export interface Query { totalPoolLiquidity(request: TotalPoolLiquidityRequest): Promise; /** TotalLiquidity returns the total liquidity across all pools. */ totalLiquidity(request?: TotalLiquidityRequest): Promise; + /** TotalVolumeForPool returns the total volume of the specified pool. */ + totalVolumeForPool(request: TotalVolumeForPoolRequest): Promise; + /** TradingPairTakerFee returns the taker fee for a given set of denoms */ + tradingPairTakerFee(request: TradingPairTakerFeeRequest): Promise; + /** + * EstimateTradeBasedOnPriceImpact returns an estimated trade based on price + * impact, if a trade cannot be estimated a 0 input and 0 output would be + * returned. + */ + estimateTradeBasedOnPriceImpact(request: EstimateTradeBasedOnPriceImpactRequest): Promise; } export class QueryClientImpl implements Query { private readonly rpc: Rpc; @@ -32,15 +59,21 @@ export class QueryClientImpl implements Query { this.rpc = rpc; this.params = this.params.bind(this); this.estimateSwapExactAmountIn = this.estimateSwapExactAmountIn.bind(this); + this.estimateSwapExactAmountInWithPrimitiveTypes = this.estimateSwapExactAmountInWithPrimitiveTypes.bind(this); this.estimateSinglePoolSwapExactAmountIn = this.estimateSinglePoolSwapExactAmountIn.bind(this); this.estimateSwapExactAmountOut = this.estimateSwapExactAmountOut.bind(this); + this.estimateSwapExactAmountOutWithPrimitiveTypes = this.estimateSwapExactAmountOutWithPrimitiveTypes.bind(this); this.estimateSinglePoolSwapExactAmountOut = this.estimateSinglePoolSwapExactAmountOut.bind(this); this.numPools = this.numPools.bind(this); this.pool = this.pool.bind(this); this.allPools = this.allPools.bind(this); + this.listPoolsByDenom = this.listPoolsByDenom.bind(this); this.spotPrice = this.spotPrice.bind(this); this.totalPoolLiquidity = this.totalPoolLiquidity.bind(this); this.totalLiquidity = this.totalLiquidity.bind(this); + this.totalVolumeForPool = this.totalVolumeForPool.bind(this); + this.tradingPairTakerFee = this.tradingPairTakerFee.bind(this); + this.estimateTradeBasedOnPriceImpact = this.estimateTradeBasedOnPriceImpact.bind(this); } params(request: ParamsRequest = {}): Promise { const data = ParamsRequest.encode(request).finish(); @@ -52,6 +85,11 @@ export class QueryClientImpl implements Query { const promise = this.rpc.request("osmosis.poolmanager.v1beta1.Query", "EstimateSwapExactAmountIn", data); return promise.then(data => EstimateSwapExactAmountInResponse.decode(new BinaryReader(data))); } + estimateSwapExactAmountInWithPrimitiveTypes(request: EstimateSwapExactAmountInWithPrimitiveTypesRequest): Promise { + const data = EstimateSwapExactAmountInWithPrimitiveTypesRequest.encode(request).finish(); + const promise = this.rpc.request("osmosis.poolmanager.v1beta1.Query", "EstimateSwapExactAmountInWithPrimitiveTypes", data); + return promise.then(data => EstimateSwapExactAmountInResponse.decode(new BinaryReader(data))); + } estimateSinglePoolSwapExactAmountIn(request: EstimateSinglePoolSwapExactAmountInRequest): Promise { const data = EstimateSinglePoolSwapExactAmountInRequest.encode(request).finish(); const promise = this.rpc.request("osmosis.poolmanager.v1beta1.Query", "EstimateSinglePoolSwapExactAmountIn", data); @@ -62,6 +100,11 @@ export class QueryClientImpl implements Query { const promise = this.rpc.request("osmosis.poolmanager.v1beta1.Query", "EstimateSwapExactAmountOut", data); return promise.then(data => EstimateSwapExactAmountOutResponse.decode(new BinaryReader(data))); } + estimateSwapExactAmountOutWithPrimitiveTypes(request: EstimateSwapExactAmountOutWithPrimitiveTypesRequest): Promise { + const data = EstimateSwapExactAmountOutWithPrimitiveTypesRequest.encode(request).finish(); + const promise = this.rpc.request("osmosis.poolmanager.v1beta1.Query", "EstimateSwapExactAmountOutWithPrimitiveTypes", data); + return promise.then(data => EstimateSwapExactAmountOutResponse.decode(new BinaryReader(data))); + } estimateSinglePoolSwapExactAmountOut(request: EstimateSinglePoolSwapExactAmountOutRequest): Promise { const data = EstimateSinglePoolSwapExactAmountOutRequest.encode(request).finish(); const promise = this.rpc.request("osmosis.poolmanager.v1beta1.Query", "EstimateSinglePoolSwapExactAmountOut", data); @@ -82,6 +125,11 @@ export class QueryClientImpl implements Query { const promise = this.rpc.request("osmosis.poolmanager.v1beta1.Query", "AllPools", data); return promise.then(data => AllPoolsResponse.decode(new BinaryReader(data))); } + listPoolsByDenom(request: ListPoolsByDenomRequest): Promise { + const data = ListPoolsByDenomRequest.encode(request).finish(); + const promise = this.rpc.request("osmosis.poolmanager.v1beta1.Query", "ListPoolsByDenom", data); + return promise.then(data => ListPoolsByDenomResponse.decode(new BinaryReader(data))); + } spotPrice(request: SpotPriceRequest): Promise { const data = SpotPriceRequest.encode(request).finish(); const promise = this.rpc.request("osmosis.poolmanager.v1beta1.Query", "SpotPrice", data); @@ -97,6 +145,21 @@ export class QueryClientImpl implements Query { const promise = this.rpc.request("osmosis.poolmanager.v1beta1.Query", "TotalLiquidity", data); return promise.then(data => TotalLiquidityResponse.decode(new BinaryReader(data))); } + totalVolumeForPool(request: TotalVolumeForPoolRequest): Promise { + const data = TotalVolumeForPoolRequest.encode(request).finish(); + const promise = this.rpc.request("osmosis.poolmanager.v1beta1.Query", "TotalVolumeForPool", data); + return promise.then(data => TotalVolumeForPoolResponse.decode(new BinaryReader(data))); + } + tradingPairTakerFee(request: TradingPairTakerFeeRequest): Promise { + const data = TradingPairTakerFeeRequest.encode(request).finish(); + const promise = this.rpc.request("osmosis.poolmanager.v1beta1.Query", "TradingPairTakerFee", data); + return promise.then(data => TradingPairTakerFeeResponse.decode(new BinaryReader(data))); + } + estimateTradeBasedOnPriceImpact(request: EstimateTradeBasedOnPriceImpactRequest): Promise { + const data = EstimateTradeBasedOnPriceImpactRequest.encode(request).finish(); + const promise = this.rpc.request("osmosis.poolmanager.v1beta1.Query", "EstimateTradeBasedOnPriceImpact", data); + return promise.then(data => EstimateTradeBasedOnPriceImpactResponse.decode(new BinaryReader(data))); + } } export const createRpcQueryExtension = (base: QueryClient) => { const rpc = createProtobufRpcClient(base); @@ -108,12 +171,18 @@ export const createRpcQueryExtension = (base: QueryClient) => { estimateSwapExactAmountIn(request: EstimateSwapExactAmountInRequest): Promise { return queryService.estimateSwapExactAmountIn(request); }, + estimateSwapExactAmountInWithPrimitiveTypes(request: EstimateSwapExactAmountInWithPrimitiveTypesRequest): Promise { + return queryService.estimateSwapExactAmountInWithPrimitiveTypes(request); + }, estimateSinglePoolSwapExactAmountIn(request: EstimateSinglePoolSwapExactAmountInRequest): Promise { return queryService.estimateSinglePoolSwapExactAmountIn(request); }, estimateSwapExactAmountOut(request: EstimateSwapExactAmountOutRequest): Promise { return queryService.estimateSwapExactAmountOut(request); }, + estimateSwapExactAmountOutWithPrimitiveTypes(request: EstimateSwapExactAmountOutWithPrimitiveTypesRequest): Promise { + return queryService.estimateSwapExactAmountOutWithPrimitiveTypes(request); + }, estimateSinglePoolSwapExactAmountOut(request: EstimateSinglePoolSwapExactAmountOutRequest): Promise { return queryService.estimateSinglePoolSwapExactAmountOut(request); }, @@ -126,6 +195,9 @@ export const createRpcQueryExtension = (base: QueryClient) => { allPools(request?: AllPoolsRequest): Promise { return queryService.allPools(request); }, + listPoolsByDenom(request: ListPoolsByDenomRequest): Promise { + return queryService.listPoolsByDenom(request); + }, spotPrice(request: SpotPriceRequest): Promise { return queryService.spotPrice(request); }, @@ -134,6 +206,15 @@ export const createRpcQueryExtension = (base: QueryClient) => { }, totalLiquidity(request?: TotalLiquidityRequest): Promise { return queryService.totalLiquidity(request); + }, + totalVolumeForPool(request: TotalVolumeForPoolRequest): Promise { + return queryService.totalVolumeForPool(request); + }, + tradingPairTakerFee(request: TradingPairTakerFeeRequest): Promise { + return queryService.tradingPairTakerFee(request); + }, + estimateTradeBasedOnPriceImpact(request: EstimateTradeBasedOnPriceImpactRequest): Promise { + return queryService.estimateTradeBasedOnPriceImpact(request); } }; }; \ No newline at end of file diff --git a/packages/osmojs/src/codegen/osmosis/poolmanager/v1beta1/query.ts b/packages/osmojs/src/codegen/osmosis/poolmanager/v1beta1/query.ts index c19731c56..a41111bc3 100644 --- a/packages/osmojs/src/codegen/osmosis/poolmanager/v1beta1/query.ts +++ b/packages/osmojs/src/codegen/osmosis/poolmanager/v1beta1/query.ts @@ -1,18 +1,21 @@ import { SwapAmountInRoute, SwapAmountInRouteAmino, SwapAmountInRouteSDKType, SwapAmountOutRoute, SwapAmountOutRouteAmino, SwapAmountOutRouteSDKType } from "./swap_route"; +import { Coin, CoinAmino, CoinSDKType } from "../../../cosmos/base/v1beta1/coin"; import { Params, ParamsAmino, ParamsSDKType } from "./genesis"; import { Any, AnyProtoMsg, AnyAmino, AnySDKType } from "../../../google/protobuf/any"; -import { Coin, CoinAmino, CoinSDKType } from "../../../cosmos/base/v1beta1/coin"; -import { Pool as Pool1 } from "../../concentrated-liquidity/pool"; -import { PoolProtoMsg as Pool1ProtoMsg } from "../../concentrated-liquidity/pool"; -import { PoolSDKType as Pool1SDKType } from "../../concentrated-liquidity/pool"; +import { Pool as Pool1 } from "../../concentratedliquidity/v1beta1/pool"; +import { PoolProtoMsg as Pool1ProtoMsg } from "../../concentratedliquidity/v1beta1/pool"; +import { PoolSDKType as Pool1SDKType } from "../../concentratedliquidity/v1beta1/pool"; import { CosmWasmPool, CosmWasmPoolProtoMsg, CosmWasmPoolSDKType } from "../../cosmwasmpool/v1beta1/model/pool"; -import { Pool as Pool2 } from "../../gamm/pool-models/balancer/balancerPool"; -import { PoolProtoMsg as Pool2ProtoMsg } from "../../gamm/pool-models/balancer/balancerPool"; -import { PoolSDKType as Pool2SDKType } from "../../gamm/pool-models/balancer/balancerPool"; -import { Pool as Pool3 } from "../../gamm/pool-models/stableswap/stableswap_pool"; -import { PoolProtoMsg as Pool3ProtoMsg } from "../../gamm/pool-models/stableswap/stableswap_pool"; -import { PoolSDKType as Pool3SDKType } from "../../gamm/pool-models/stableswap/stableswap_pool"; +import { Pool as Pool2 } from "../../gamm/poolmodels/stableswap/v1beta1/stableswap_pool"; +import { PoolProtoMsg as Pool2ProtoMsg } from "../../gamm/poolmodels/stableswap/v1beta1/stableswap_pool"; +import { PoolSDKType as Pool2SDKType } from "../../gamm/poolmodels/stableswap/v1beta1/stableswap_pool"; +import { Pool as Pool3 } from "../../gamm/v1beta1/balancerPool"; +import { PoolProtoMsg as Pool3ProtoMsg } from "../../gamm/v1beta1/balancerPool"; +import { PoolSDKType as Pool3SDKType } from "../../gamm/v1beta1/balancerPool"; import { BinaryReader, BinaryWriter } from "../../../binary"; +import { GlobalDecoderRegistry } from "../../../registry"; +import { isSet } from "../../../helpers"; +import { Decimal } from "@cosmjs/math"; /** =============================== Params */ export interface ParamsRequest {} export interface ParamsRequestProtoMsg { @@ -46,6 +49,7 @@ export interface ParamsResponseSDKType { } /** =============================== EstimateSwapExactAmountIn */ export interface EstimateSwapExactAmountInRequest { + /** @deprecated */ poolId: bigint; tokenIn: string; routes: SwapAmountInRoute[]; @@ -56,9 +60,10 @@ export interface EstimateSwapExactAmountInRequestProtoMsg { } /** =============================== EstimateSwapExactAmountIn */ export interface EstimateSwapExactAmountInRequestAmino { - pool_id: string; - token_in: string; - routes: SwapAmountInRouteAmino[]; + /** @deprecated */ + pool_id?: string; + token_in?: string; + routes?: SwapAmountInRouteAmino[]; } export interface EstimateSwapExactAmountInRequestAminoMsg { type: "osmosis/poolmanager/estimate-swap-exact-amount-in-request"; @@ -66,10 +71,40 @@ export interface EstimateSwapExactAmountInRequestAminoMsg { } /** =============================== EstimateSwapExactAmountIn */ export interface EstimateSwapExactAmountInRequestSDKType { + /** @deprecated */ pool_id: bigint; token_in: string; routes: SwapAmountInRouteSDKType[]; } +export interface EstimateSwapExactAmountInWithPrimitiveTypesRequest { + /** @deprecated */ + poolId: bigint; + tokenIn: string; + routesPoolId: bigint[]; + routesTokenOutDenom: string[]; +} +export interface EstimateSwapExactAmountInWithPrimitiveTypesRequestProtoMsg { + typeUrl: "/osmosis.poolmanager.v1beta1.EstimateSwapExactAmountInWithPrimitiveTypesRequest"; + value: Uint8Array; +} +export interface EstimateSwapExactAmountInWithPrimitiveTypesRequestAmino { + /** @deprecated */ + pool_id?: string; + token_in?: string; + routes_pool_id?: string[]; + routes_token_out_denom?: string[]; +} +export interface EstimateSwapExactAmountInWithPrimitiveTypesRequestAminoMsg { + type: "osmosis/poolmanager/estimate-swap-exact-amount-in-with-primitive-types-request"; + value: EstimateSwapExactAmountInWithPrimitiveTypesRequestAmino; +} +export interface EstimateSwapExactAmountInWithPrimitiveTypesRequestSDKType { + /** @deprecated */ + pool_id: bigint; + token_in: string; + routes_pool_id: bigint[]; + routes_token_out_denom: string[]; +} export interface EstimateSinglePoolSwapExactAmountInRequest { poolId: bigint; tokenIn: string; @@ -80,9 +115,9 @@ export interface EstimateSinglePoolSwapExactAmountInRequestProtoMsg { value: Uint8Array; } export interface EstimateSinglePoolSwapExactAmountInRequestAmino { - pool_id: string; - token_in: string; - token_out_denom: string; + pool_id?: string; + token_in?: string; + token_out_denom?: string; } export interface EstimateSinglePoolSwapExactAmountInRequestAminoMsg { type: "osmosis/poolmanager/estimate-single-pool-swap-exact-amount-in-request"; @@ -101,7 +136,7 @@ export interface EstimateSwapExactAmountInResponseProtoMsg { value: Uint8Array; } export interface EstimateSwapExactAmountInResponseAmino { - token_out_amount: string; + token_out_amount?: string; } export interface EstimateSwapExactAmountInResponseAminoMsg { type: "osmosis/poolmanager/estimate-swap-exact-amount-in-response"; @@ -112,6 +147,7 @@ export interface EstimateSwapExactAmountInResponseSDKType { } /** =============================== EstimateSwapExactAmountOut */ export interface EstimateSwapExactAmountOutRequest { + /** @deprecated */ poolId: bigint; routes: SwapAmountOutRoute[]; tokenOut: string; @@ -122,9 +158,10 @@ export interface EstimateSwapExactAmountOutRequestProtoMsg { } /** =============================== EstimateSwapExactAmountOut */ export interface EstimateSwapExactAmountOutRequestAmino { - pool_id: string; - routes: SwapAmountOutRouteAmino[]; - token_out: string; + /** @deprecated */ + pool_id?: string; + routes?: SwapAmountOutRouteAmino[]; + token_out?: string; } export interface EstimateSwapExactAmountOutRequestAminoMsg { type: "osmosis/poolmanager/estimate-swap-exact-amount-out-request"; @@ -132,10 +169,40 @@ export interface EstimateSwapExactAmountOutRequestAminoMsg { } /** =============================== EstimateSwapExactAmountOut */ export interface EstimateSwapExactAmountOutRequestSDKType { + /** @deprecated */ pool_id: bigint; routes: SwapAmountOutRouteSDKType[]; token_out: string; } +export interface EstimateSwapExactAmountOutWithPrimitiveTypesRequest { + /** @deprecated */ + poolId: bigint; + routesPoolId: bigint[]; + routesTokenInDenom: string[]; + tokenOut: string; +} +export interface EstimateSwapExactAmountOutWithPrimitiveTypesRequestProtoMsg { + typeUrl: "/osmosis.poolmanager.v1beta1.EstimateSwapExactAmountOutWithPrimitiveTypesRequest"; + value: Uint8Array; +} +export interface EstimateSwapExactAmountOutWithPrimitiveTypesRequestAmino { + /** @deprecated */ + pool_id?: string; + routes_pool_id?: string[]; + routes_token_in_denom?: string[]; + token_out?: string; +} +export interface EstimateSwapExactAmountOutWithPrimitiveTypesRequestAminoMsg { + type: "osmosis/poolmanager/estimate-swap-exact-amount-out-with-primitive-types-request"; + value: EstimateSwapExactAmountOutWithPrimitiveTypesRequestAmino; +} +export interface EstimateSwapExactAmountOutWithPrimitiveTypesRequestSDKType { + /** @deprecated */ + pool_id: bigint; + routes_pool_id: bigint[]; + routes_token_in_denom: string[]; + token_out: string; +} export interface EstimateSinglePoolSwapExactAmountOutRequest { poolId: bigint; tokenInDenom: string; @@ -146,9 +213,9 @@ export interface EstimateSinglePoolSwapExactAmountOutRequestProtoMsg { value: Uint8Array; } export interface EstimateSinglePoolSwapExactAmountOutRequestAmino { - pool_id: string; - token_in_denom: string; - token_out: string; + pool_id?: string; + token_in_denom?: string; + token_out?: string; } export interface EstimateSinglePoolSwapExactAmountOutRequestAminoMsg { type: "osmosis/poolmanager/estimate-single-pool-swap-exact-amount-out-request"; @@ -167,7 +234,7 @@ export interface EstimateSwapExactAmountOutResponseProtoMsg { value: Uint8Array; } export interface EstimateSwapExactAmountOutResponseAmino { - token_in_amount: string; + token_in_amount?: string; } export interface EstimateSwapExactAmountOutResponseAminoMsg { type: "osmosis/poolmanager/estimate-swap-exact-amount-out-response"; @@ -198,7 +265,7 @@ export interface NumPoolsResponseProtoMsg { value: Uint8Array; } export interface NumPoolsResponseAmino { - num_pools: string; + num_pools?: string; } export interface NumPoolsResponseAminoMsg { type: "osmosis/poolmanager/num-pools-response"; @@ -217,7 +284,7 @@ export interface PoolRequestProtoMsg { } /** =============================== Pool */ export interface PoolRequestAmino { - pool_id: string; + pool_id?: string; } export interface PoolRequestAminoMsg { type: "osmosis/poolmanager/pool-request"; @@ -228,7 +295,7 @@ export interface PoolRequestSDKType { pool_id: bigint; } export interface PoolResponse { - pool: (Pool1 & CosmWasmPool & Pool2 & Pool3 & Any) | undefined; + pool?: Pool1 | CosmWasmPool | Pool2 | Pool3 | Any | undefined; } export interface PoolResponseProtoMsg { typeUrl: "/osmosis.poolmanager.v1beta1.PoolResponse"; @@ -245,7 +312,7 @@ export interface PoolResponseAminoMsg { value: PoolResponseAmino; } export interface PoolResponseSDKType { - pool: Pool1SDKType | CosmWasmPoolSDKType | Pool2SDKType | Pool3SDKType | AnySDKType | undefined; + pool?: Pool1SDKType | CosmWasmPoolSDKType | Pool2SDKType | Pool3SDKType | AnySDKType | undefined; } /** =============================== AllPools */ export interface AllPoolsRequest {} @@ -262,7 +329,7 @@ export interface AllPoolsRequestAminoMsg { /** =============================== AllPools */ export interface AllPoolsRequestSDKType {} export interface AllPoolsResponse { - pools: (Pool1 & CosmWasmPool & Pool2 & Pool3 & Any)[] | Any[]; + pools: (Pool1 | CosmWasmPool | Pool2 | Pool3 | Any)[] | Any[]; } export interface AllPoolsResponseProtoMsg { typeUrl: "/osmosis.poolmanager.v1beta1.AllPoolsResponse"; @@ -272,7 +339,7 @@ export type AllPoolsResponseEncoded = Omit & { pools: (Pool1ProtoMsg | CosmWasmPoolProtoMsg | Pool2ProtoMsg | Pool3ProtoMsg | AnyProtoMsg)[]; }; export interface AllPoolsResponseAmino { - pools: AnyAmino[]; + pools?: AnyAmino[]; } export interface AllPoolsResponseAminoMsg { type: "osmosis/poolmanager/all-pools-response"; @@ -282,6 +349,56 @@ export interface AllPoolsResponseSDKType { pools: (Pool1SDKType | CosmWasmPoolSDKType | Pool2SDKType | Pool3SDKType | AnySDKType)[]; } /** + * ======================================================= + * ListPoolsByDenomRequest + */ +export interface ListPoolsByDenomRequest { + denom: string; +} +export interface ListPoolsByDenomRequestProtoMsg { + typeUrl: "/osmosis.poolmanager.v1beta1.ListPoolsByDenomRequest"; + value: Uint8Array; +} +/** + * ======================================================= + * ListPoolsByDenomRequest + */ +export interface ListPoolsByDenomRequestAmino { + denom?: string; +} +export interface ListPoolsByDenomRequestAminoMsg { + type: "osmosis/poolmanager/list-pools-by-denom-request"; + value: ListPoolsByDenomRequestAmino; +} +/** + * ======================================================= + * ListPoolsByDenomRequest + */ +export interface ListPoolsByDenomRequestSDKType { + denom: string; +} +export interface ListPoolsByDenomResponse { + pools: (Pool1 | CosmWasmPool | Pool2 | Pool3 | Any)[] | Any[]; +} +export interface ListPoolsByDenomResponseProtoMsg { + typeUrl: "/osmosis.poolmanager.v1beta1.ListPoolsByDenomResponse"; + value: Uint8Array; +} +export type ListPoolsByDenomResponseEncoded = Omit & { + pools: (Pool1ProtoMsg | CosmWasmPoolProtoMsg | Pool2ProtoMsg | Pool3ProtoMsg | AnyProtoMsg)[]; +}; +export interface ListPoolsByDenomResponseAmino { + pools?: AnyAmino[]; +} +export interface ListPoolsByDenomResponseAminoMsg { + type: "osmosis/poolmanager/list-pools-by-denom-response"; + value: ListPoolsByDenomResponseAmino; +} +export interface ListPoolsByDenomResponseSDKType { + pools: (Pool1SDKType | CosmWasmPoolSDKType | Pool2SDKType | Pool3SDKType | AnySDKType)[]; +} +/** + * ========================================================== * SpotPriceRequest defines the gRPC request structure for a SpotPrice * query. */ @@ -295,19 +412,21 @@ export interface SpotPriceRequestProtoMsg { value: Uint8Array; } /** + * ========================================================== * SpotPriceRequest defines the gRPC request structure for a SpotPrice * query. */ export interface SpotPriceRequestAmino { - pool_id: string; - base_asset_denom: string; - quote_asset_denom: string; + pool_id?: string; + base_asset_denom?: string; + quote_asset_denom?: string; } export interface SpotPriceRequestAminoMsg { type: "osmosis/poolmanager/spot-price-request"; value: SpotPriceRequestAmino; } /** + * ========================================================== * SpotPriceRequest defines the gRPC request structure for a SpotPrice * query. */ @@ -334,7 +453,7 @@ export interface SpotPriceResponseProtoMsg { */ export interface SpotPriceResponseAmino { /** String of the Dec. Ex) 10.203uatom */ - spot_price: string; + spot_price?: string; } export interface SpotPriceResponseAminoMsg { type: "osmosis/poolmanager/spot-price-response"; @@ -357,7 +476,7 @@ export interface TotalPoolLiquidityRequestProtoMsg { } /** =============================== TotalPoolLiquidity */ export interface TotalPoolLiquidityRequestAmino { - pool_id: string; + pool_id?: string; } export interface TotalPoolLiquidityRequestAminoMsg { type: "osmosis/poolmanager/total-pool-liquidity-request"; @@ -375,7 +494,7 @@ export interface TotalPoolLiquidityResponseProtoMsg { value: Uint8Array; } export interface TotalPoolLiquidityResponseAmino { - liquidity: CoinAmino[]; + liquidity?: CoinAmino[]; } export interface TotalPoolLiquidityResponseAminoMsg { type: "osmosis/poolmanager/total-pool-liquidity-response"; @@ -406,7 +525,7 @@ export interface TotalLiquidityResponseProtoMsg { value: Uint8Array; } export interface TotalLiquidityResponseAmino { - liquidity: CoinAmino[]; + liquidity?: CoinAmino[]; } export interface TotalLiquidityResponseAminoMsg { type: "osmosis/poolmanager/total-liquidity-response"; @@ -415,11 +534,232 @@ export interface TotalLiquidityResponseAminoMsg { export interface TotalLiquidityResponseSDKType { liquidity: CoinSDKType[]; } +/** =============================== TotalVolumeForPool */ +export interface TotalVolumeForPoolRequest { + poolId: bigint; +} +export interface TotalVolumeForPoolRequestProtoMsg { + typeUrl: "/osmosis.poolmanager.v1beta1.TotalVolumeForPoolRequest"; + value: Uint8Array; +} +/** =============================== TotalVolumeForPool */ +export interface TotalVolumeForPoolRequestAmino { + pool_id?: string; +} +export interface TotalVolumeForPoolRequestAminoMsg { + type: "osmosis/poolmanager/total-volume-for-pool-request"; + value: TotalVolumeForPoolRequestAmino; +} +/** =============================== TotalVolumeForPool */ +export interface TotalVolumeForPoolRequestSDKType { + pool_id: bigint; +} +export interface TotalVolumeForPoolResponse { + volume: Coin[]; +} +export interface TotalVolumeForPoolResponseProtoMsg { + typeUrl: "/osmosis.poolmanager.v1beta1.TotalVolumeForPoolResponse"; + value: Uint8Array; +} +export interface TotalVolumeForPoolResponseAmino { + volume?: CoinAmino[]; +} +export interface TotalVolumeForPoolResponseAminoMsg { + type: "osmosis/poolmanager/total-volume-for-pool-response"; + value: TotalVolumeForPoolResponseAmino; +} +export interface TotalVolumeForPoolResponseSDKType { + volume: CoinSDKType[]; +} +/** =============================== TradingPairTakerFee */ +export interface TradingPairTakerFeeRequest { + denom0: string; + denom1: string; +} +export interface TradingPairTakerFeeRequestProtoMsg { + typeUrl: "/osmosis.poolmanager.v1beta1.TradingPairTakerFeeRequest"; + value: Uint8Array; +} +/** =============================== TradingPairTakerFee */ +export interface TradingPairTakerFeeRequestAmino { + denom_0?: string; + denom_1?: string; +} +export interface TradingPairTakerFeeRequestAminoMsg { + type: "osmosis/poolmanager/trading-pair-taker-fee-request"; + value: TradingPairTakerFeeRequestAmino; +} +/** =============================== TradingPairTakerFee */ +export interface TradingPairTakerFeeRequestSDKType { + denom_0: string; + denom_1: string; +} +export interface TradingPairTakerFeeResponse { + takerFee: string; +} +export interface TradingPairTakerFeeResponseProtoMsg { + typeUrl: "/osmosis.poolmanager.v1beta1.TradingPairTakerFeeResponse"; + value: Uint8Array; +} +export interface TradingPairTakerFeeResponseAmino { + taker_fee?: string; +} +export interface TradingPairTakerFeeResponseAminoMsg { + type: "osmosis/poolmanager/trading-pair-taker-fee-response"; + value: TradingPairTakerFeeResponseAmino; +} +export interface TradingPairTakerFeeResponseSDKType { + taker_fee: string; +} +/** + * EstimateTradeBasedOnPriceImpactRequest represents a request to estimate a + * trade for Balancer/StableSwap/Concentrated liquidity pool types based on the + * given parameters. + */ +export interface EstimateTradeBasedOnPriceImpactRequest { + /** from_coin is the total amount of tokens that the user wants to sell. */ + fromCoin: Coin; + /** + * to_coin_denom is the denom identifier of the token that the user wants to + * buy. + */ + toCoinDenom: string; + /** + * pool_id is the identifier of the liquidity pool that the trade will occur + * on. + */ + poolId: bigint; + /** + * max_price_impact is the maximum percentage that the user is willing + * to affect the price of the liquidity pool. + */ + maxPriceImpact: string; + /** + * external_price is an optional external price that the user can enter. + * It adjusts the MaxPriceImpact as the SpotPrice of a pool can be changed at + * any time. + */ + externalPrice: string; +} +export interface EstimateTradeBasedOnPriceImpactRequestProtoMsg { + typeUrl: "/osmosis.poolmanager.v1beta1.EstimateTradeBasedOnPriceImpactRequest"; + value: Uint8Array; +} +/** + * EstimateTradeBasedOnPriceImpactRequest represents a request to estimate a + * trade for Balancer/StableSwap/Concentrated liquidity pool types based on the + * given parameters. + */ +export interface EstimateTradeBasedOnPriceImpactRequestAmino { + /** from_coin is the total amount of tokens that the user wants to sell. */ + from_coin?: CoinAmino; + /** + * to_coin_denom is the denom identifier of the token that the user wants to + * buy. + */ + to_coin_denom?: string; + /** + * pool_id is the identifier of the liquidity pool that the trade will occur + * on. + */ + pool_id?: string; + /** + * max_price_impact is the maximum percentage that the user is willing + * to affect the price of the liquidity pool. + */ + max_price_impact?: string; + /** + * external_price is an optional external price that the user can enter. + * It adjusts the MaxPriceImpact as the SpotPrice of a pool can be changed at + * any time. + */ + external_price?: string; +} +export interface EstimateTradeBasedOnPriceImpactRequestAminoMsg { + type: "osmosis/poolmanager/estimate-trade-based-on-price-impact-request"; + value: EstimateTradeBasedOnPriceImpactRequestAmino; +} +/** + * EstimateTradeBasedOnPriceImpactRequest represents a request to estimate a + * trade for Balancer/StableSwap/Concentrated liquidity pool types based on the + * given parameters. + */ +export interface EstimateTradeBasedOnPriceImpactRequestSDKType { + from_coin: CoinSDKType; + to_coin_denom: string; + pool_id: bigint; + max_price_impact: string; + external_price: string; +} +/** + * EstimateTradeBasedOnPriceImpactResponse represents the response data + * for an estimated trade based on price impact. If a trade fails to be + * estimated the response would be 0,0 for input_coin and output_coin and will + * not error. + */ +export interface EstimateTradeBasedOnPriceImpactResponse { + /** + * input_coin is the actual input amount that would be tradeable + * under the specified price impact. + */ + inputCoin: Coin; + /** + * output_coin is the amount of tokens of the ToCoinDenom type + * that will be received for the actual InputCoin trade. + */ + outputCoin: Coin; +} +export interface EstimateTradeBasedOnPriceImpactResponseProtoMsg { + typeUrl: "/osmosis.poolmanager.v1beta1.EstimateTradeBasedOnPriceImpactResponse"; + value: Uint8Array; +} +/** + * EstimateTradeBasedOnPriceImpactResponse represents the response data + * for an estimated trade based on price impact. If a trade fails to be + * estimated the response would be 0,0 for input_coin and output_coin and will + * not error. + */ +export interface EstimateTradeBasedOnPriceImpactResponseAmino { + /** + * input_coin is the actual input amount that would be tradeable + * under the specified price impact. + */ + input_coin?: CoinAmino; + /** + * output_coin is the amount of tokens of the ToCoinDenom type + * that will be received for the actual InputCoin trade. + */ + output_coin?: CoinAmino; +} +export interface EstimateTradeBasedOnPriceImpactResponseAminoMsg { + type: "osmosis/poolmanager/estimate-trade-based-on-price-impact-response"; + value: EstimateTradeBasedOnPriceImpactResponseAmino; +} +/** + * EstimateTradeBasedOnPriceImpactResponse represents the response data + * for an estimated trade based on price impact. If a trade fails to be + * estimated the response would be 0,0 for input_coin and output_coin and will + * not error. + */ +export interface EstimateTradeBasedOnPriceImpactResponseSDKType { + input_coin: CoinSDKType; + output_coin: CoinSDKType; +} function createBaseParamsRequest(): ParamsRequest { return {}; } export const ParamsRequest = { typeUrl: "/osmosis.poolmanager.v1beta1.ParamsRequest", + aminoType: "osmosis/poolmanager/params-request", + is(o: any): o is ParamsRequest { + return o && o.$typeUrl === ParamsRequest.typeUrl; + }, + isSDK(o: any): o is ParamsRequestSDKType { + return o && o.$typeUrl === ParamsRequest.typeUrl; + }, + isAmino(o: any): o is ParamsRequestAmino { + return o && o.$typeUrl === ParamsRequest.typeUrl; + }, encode(_: ParamsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, @@ -437,12 +777,20 @@ export const ParamsRequest = { } return message; }, + fromJSON(_: any): ParamsRequest { + return {}; + }, + toJSON(_: ParamsRequest): unknown { + const obj: any = {}; + return obj; + }, fromPartial(_: Partial): ParamsRequest { const message = createBaseParamsRequest(); return message; }, fromAmino(_: ParamsRequestAmino): ParamsRequest { - return {}; + const message = createBaseParamsRequest(); + return message; }, toAmino(_: ParamsRequest): ParamsRequestAmino { const obj: any = {}; @@ -470,6 +818,8 @@ export const ParamsRequest = { }; } }; +GlobalDecoderRegistry.register(ParamsRequest.typeUrl, ParamsRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(ParamsRequest.aminoType, ParamsRequest.typeUrl); function createBaseParamsResponse(): ParamsResponse { return { params: Params.fromPartial({}) @@ -477,6 +827,16 @@ function createBaseParamsResponse(): ParamsResponse { } export const ParamsResponse = { typeUrl: "/osmosis.poolmanager.v1beta1.ParamsResponse", + aminoType: "osmosis/poolmanager/params-response", + is(o: any): o is ParamsResponse { + return o && (o.$typeUrl === ParamsResponse.typeUrl || Params.is(o.params)); + }, + isSDK(o: any): o is ParamsResponseSDKType { + return o && (o.$typeUrl === ParamsResponse.typeUrl || Params.isSDK(o.params)); + }, + isAmino(o: any): o is ParamsResponseAmino { + return o && (o.$typeUrl === ParamsResponse.typeUrl || Params.isAmino(o.params)); + }, encode(message: ParamsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.params !== undefined) { Params.encode(message.params, writer.uint32(10).fork()).ldelim(); @@ -500,15 +860,27 @@ export const ParamsResponse = { } return message; }, + fromJSON(object: any): ParamsResponse { + return { + params: isSet(object.params) ? Params.fromJSON(object.params) : undefined + }; + }, + toJSON(message: ParamsResponse): unknown { + const obj: any = {}; + message.params !== undefined && (obj.params = message.params ? Params.toJSON(message.params) : undefined); + return obj; + }, fromPartial(object: Partial): ParamsResponse { const message = createBaseParamsResponse(); message.params = object.params !== undefined && object.params !== null ? Params.fromPartial(object.params) : undefined; return message; }, fromAmino(object: ParamsResponseAmino): ParamsResponse { - return { - params: object?.params ? Params.fromAmino(object.params) : undefined - }; + const message = createBaseParamsResponse(); + if (object.params !== undefined && object.params !== null) { + message.params = Params.fromAmino(object.params); + } + return message; }, toAmino(message: ParamsResponse): ParamsResponseAmino { const obj: any = {}; @@ -537,6 +909,8 @@ export const ParamsResponse = { }; } }; +GlobalDecoderRegistry.register(ParamsResponse.typeUrl, ParamsResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(ParamsResponse.aminoType, ParamsResponse.typeUrl); function createBaseEstimateSwapExactAmountInRequest(): EstimateSwapExactAmountInRequest { return { poolId: BigInt(0), @@ -546,6 +920,16 @@ function createBaseEstimateSwapExactAmountInRequest(): EstimateSwapExactAmountIn } export const EstimateSwapExactAmountInRequest = { typeUrl: "/osmosis.poolmanager.v1beta1.EstimateSwapExactAmountInRequest", + aminoType: "osmosis/poolmanager/estimate-swap-exact-amount-in-request", + is(o: any): o is EstimateSwapExactAmountInRequest { + return o && (o.$typeUrl === EstimateSwapExactAmountInRequest.typeUrl || typeof o.poolId === "bigint" && typeof o.tokenIn === "string" && Array.isArray(o.routes) && (!o.routes.length || SwapAmountInRoute.is(o.routes[0]))); + }, + isSDK(o: any): o is EstimateSwapExactAmountInRequestSDKType { + return o && (o.$typeUrl === EstimateSwapExactAmountInRequest.typeUrl || typeof o.pool_id === "bigint" && typeof o.token_in === "string" && Array.isArray(o.routes) && (!o.routes.length || SwapAmountInRoute.isSDK(o.routes[0]))); + }, + isAmino(o: any): o is EstimateSwapExactAmountInRequestAmino { + return o && (o.$typeUrl === EstimateSwapExactAmountInRequest.typeUrl || typeof o.pool_id === "bigint" && typeof o.token_in === "string" && Array.isArray(o.routes) && (!o.routes.length || SwapAmountInRoute.isAmino(o.routes[0]))); + }, encode(message: EstimateSwapExactAmountInRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.poolId !== BigInt(0)) { writer.uint32(16).uint64(message.poolId); @@ -581,6 +965,24 @@ export const EstimateSwapExactAmountInRequest = { } return message; }, + fromJSON(object: any): EstimateSwapExactAmountInRequest { + return { + poolId: isSet(object.poolId) ? BigInt(object.poolId.toString()) : BigInt(0), + tokenIn: isSet(object.tokenIn) ? String(object.tokenIn) : "", + routes: Array.isArray(object?.routes) ? object.routes.map((e: any) => SwapAmountInRoute.fromJSON(e)) : [] + }; + }, + toJSON(message: EstimateSwapExactAmountInRequest): unknown { + const obj: any = {}; + message.poolId !== undefined && (obj.poolId = (message.poolId || BigInt(0)).toString()); + message.tokenIn !== undefined && (obj.tokenIn = message.tokenIn); + if (message.routes) { + obj.routes = message.routes.map(e => e ? SwapAmountInRoute.toJSON(e) : undefined); + } else { + obj.routes = []; + } + return obj; + }, fromPartial(object: Partial): EstimateSwapExactAmountInRequest { const message = createBaseEstimateSwapExactAmountInRequest(); message.poolId = object.poolId !== undefined && object.poolId !== null ? BigInt(object.poolId.toString()) : BigInt(0); @@ -589,11 +991,15 @@ export const EstimateSwapExactAmountInRequest = { return message; }, fromAmino(object: EstimateSwapExactAmountInRequestAmino): EstimateSwapExactAmountInRequest { - return { - poolId: BigInt(object.pool_id), - tokenIn: object.token_in, - routes: Array.isArray(object?.routes) ? object.routes.map((e: any) => SwapAmountInRoute.fromAmino(e)) : [] - }; + const message = createBaseEstimateSwapExactAmountInRequest(); + if (object.pool_id !== undefined && object.pool_id !== null) { + message.poolId = BigInt(object.pool_id); + } + if (object.token_in !== undefined && object.token_in !== null) { + message.tokenIn = object.token_in; + } + message.routes = object.routes?.map(e => SwapAmountInRoute.fromAmino(e)) || []; + return message; }, toAmino(message: EstimateSwapExactAmountInRequest): EstimateSwapExactAmountInRequestAmino { const obj: any = {}; @@ -628,6 +1034,162 @@ export const EstimateSwapExactAmountInRequest = { }; } }; +GlobalDecoderRegistry.register(EstimateSwapExactAmountInRequest.typeUrl, EstimateSwapExactAmountInRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(EstimateSwapExactAmountInRequest.aminoType, EstimateSwapExactAmountInRequest.typeUrl); +function createBaseEstimateSwapExactAmountInWithPrimitiveTypesRequest(): EstimateSwapExactAmountInWithPrimitiveTypesRequest { + return { + poolId: BigInt(0), + tokenIn: "", + routesPoolId: [], + routesTokenOutDenom: [] + }; +} +export const EstimateSwapExactAmountInWithPrimitiveTypesRequest = { + typeUrl: "/osmosis.poolmanager.v1beta1.EstimateSwapExactAmountInWithPrimitiveTypesRequest", + aminoType: "osmosis/poolmanager/estimate-swap-exact-amount-in-with-primitive-types-request", + is(o: any): o is EstimateSwapExactAmountInWithPrimitiveTypesRequest { + return o && (o.$typeUrl === EstimateSwapExactAmountInWithPrimitiveTypesRequest.typeUrl || typeof o.poolId === "bigint" && typeof o.tokenIn === "string" && Array.isArray(o.routesPoolId) && (!o.routesPoolId.length || typeof o.routesPoolId[0] === "bigint") && Array.isArray(o.routesTokenOutDenom) && (!o.routesTokenOutDenom.length || typeof o.routesTokenOutDenom[0] === "string")); + }, + isSDK(o: any): o is EstimateSwapExactAmountInWithPrimitiveTypesRequestSDKType { + return o && (o.$typeUrl === EstimateSwapExactAmountInWithPrimitiveTypesRequest.typeUrl || typeof o.pool_id === "bigint" && typeof o.token_in === "string" && Array.isArray(o.routes_pool_id) && (!o.routes_pool_id.length || typeof o.routes_pool_id[0] === "bigint") && Array.isArray(o.routes_token_out_denom) && (!o.routes_token_out_denom.length || typeof o.routes_token_out_denom[0] === "string")); + }, + isAmino(o: any): o is EstimateSwapExactAmountInWithPrimitiveTypesRequestAmino { + return o && (o.$typeUrl === EstimateSwapExactAmountInWithPrimitiveTypesRequest.typeUrl || typeof o.pool_id === "bigint" && typeof o.token_in === "string" && Array.isArray(o.routes_pool_id) && (!o.routes_pool_id.length || typeof o.routes_pool_id[0] === "bigint") && Array.isArray(o.routes_token_out_denom) && (!o.routes_token_out_denom.length || typeof o.routes_token_out_denom[0] === "string")); + }, + encode(message: EstimateSwapExactAmountInWithPrimitiveTypesRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.poolId !== BigInt(0)) { + writer.uint32(8).uint64(message.poolId); + } + if (message.tokenIn !== "") { + writer.uint32(18).string(message.tokenIn); + } + writer.uint32(26).fork(); + for (const v of message.routesPoolId) { + writer.uint64(v); + } + writer.ldelim(); + for (const v of message.routesTokenOutDenom) { + writer.uint32(34).string(v!); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): EstimateSwapExactAmountInWithPrimitiveTypesRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseEstimateSwapExactAmountInWithPrimitiveTypesRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.poolId = reader.uint64(); + break; + case 2: + message.tokenIn = reader.string(); + break; + case 3: + if ((tag & 7) === 2) { + const end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) { + message.routesPoolId.push(reader.uint64()); + } + } else { + message.routesPoolId.push(reader.uint64()); + } + break; + case 4: + message.routesTokenOutDenom.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): EstimateSwapExactAmountInWithPrimitiveTypesRequest { + return { + poolId: isSet(object.poolId) ? BigInt(object.poolId.toString()) : BigInt(0), + tokenIn: isSet(object.tokenIn) ? String(object.tokenIn) : "", + routesPoolId: Array.isArray(object?.routesPoolId) ? object.routesPoolId.map((e: any) => BigInt(e.toString())) : [], + routesTokenOutDenom: Array.isArray(object?.routesTokenOutDenom) ? object.routesTokenOutDenom.map((e: any) => String(e)) : [] + }; + }, + toJSON(message: EstimateSwapExactAmountInWithPrimitiveTypesRequest): unknown { + const obj: any = {}; + message.poolId !== undefined && (obj.poolId = (message.poolId || BigInt(0)).toString()); + message.tokenIn !== undefined && (obj.tokenIn = message.tokenIn); + if (message.routesPoolId) { + obj.routesPoolId = message.routesPoolId.map(e => (e || BigInt(0)).toString()); + } else { + obj.routesPoolId = []; + } + if (message.routesTokenOutDenom) { + obj.routesTokenOutDenom = message.routesTokenOutDenom.map(e => e); + } else { + obj.routesTokenOutDenom = []; + } + return obj; + }, + fromPartial(object: Partial): EstimateSwapExactAmountInWithPrimitiveTypesRequest { + const message = createBaseEstimateSwapExactAmountInWithPrimitiveTypesRequest(); + message.poolId = object.poolId !== undefined && object.poolId !== null ? BigInt(object.poolId.toString()) : BigInt(0); + message.tokenIn = object.tokenIn ?? ""; + message.routesPoolId = object.routesPoolId?.map(e => BigInt(e.toString())) || []; + message.routesTokenOutDenom = object.routesTokenOutDenom?.map(e => e) || []; + return message; + }, + fromAmino(object: EstimateSwapExactAmountInWithPrimitiveTypesRequestAmino): EstimateSwapExactAmountInWithPrimitiveTypesRequest { + const message = createBaseEstimateSwapExactAmountInWithPrimitiveTypesRequest(); + if (object.pool_id !== undefined && object.pool_id !== null) { + message.poolId = BigInt(object.pool_id); + } + if (object.token_in !== undefined && object.token_in !== null) { + message.tokenIn = object.token_in; + } + message.routesPoolId = object.routes_pool_id?.map(e => BigInt(e)) || []; + message.routesTokenOutDenom = object.routes_token_out_denom?.map(e => e) || []; + return message; + }, + toAmino(message: EstimateSwapExactAmountInWithPrimitiveTypesRequest): EstimateSwapExactAmountInWithPrimitiveTypesRequestAmino { + const obj: any = {}; + obj.pool_id = message.poolId ? message.poolId.toString() : undefined; + obj.token_in = message.tokenIn; + if (message.routesPoolId) { + obj.routes_pool_id = message.routesPoolId.map(e => e.toString()); + } else { + obj.routes_pool_id = []; + } + if (message.routesTokenOutDenom) { + obj.routes_token_out_denom = message.routesTokenOutDenom.map(e => e); + } else { + obj.routes_token_out_denom = []; + } + return obj; + }, + fromAminoMsg(object: EstimateSwapExactAmountInWithPrimitiveTypesRequestAminoMsg): EstimateSwapExactAmountInWithPrimitiveTypesRequest { + return EstimateSwapExactAmountInWithPrimitiveTypesRequest.fromAmino(object.value); + }, + toAminoMsg(message: EstimateSwapExactAmountInWithPrimitiveTypesRequest): EstimateSwapExactAmountInWithPrimitiveTypesRequestAminoMsg { + return { + type: "osmosis/poolmanager/estimate-swap-exact-amount-in-with-primitive-types-request", + value: EstimateSwapExactAmountInWithPrimitiveTypesRequest.toAmino(message) + }; + }, + fromProtoMsg(message: EstimateSwapExactAmountInWithPrimitiveTypesRequestProtoMsg): EstimateSwapExactAmountInWithPrimitiveTypesRequest { + return EstimateSwapExactAmountInWithPrimitiveTypesRequest.decode(message.value); + }, + toProto(message: EstimateSwapExactAmountInWithPrimitiveTypesRequest): Uint8Array { + return EstimateSwapExactAmountInWithPrimitiveTypesRequest.encode(message).finish(); + }, + toProtoMsg(message: EstimateSwapExactAmountInWithPrimitiveTypesRequest): EstimateSwapExactAmountInWithPrimitiveTypesRequestProtoMsg { + return { + typeUrl: "/osmosis.poolmanager.v1beta1.EstimateSwapExactAmountInWithPrimitiveTypesRequest", + value: EstimateSwapExactAmountInWithPrimitiveTypesRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(EstimateSwapExactAmountInWithPrimitiveTypesRequest.typeUrl, EstimateSwapExactAmountInWithPrimitiveTypesRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(EstimateSwapExactAmountInWithPrimitiveTypesRequest.aminoType, EstimateSwapExactAmountInWithPrimitiveTypesRequest.typeUrl); function createBaseEstimateSinglePoolSwapExactAmountInRequest(): EstimateSinglePoolSwapExactAmountInRequest { return { poolId: BigInt(0), @@ -637,6 +1199,16 @@ function createBaseEstimateSinglePoolSwapExactAmountInRequest(): EstimateSingleP } export const EstimateSinglePoolSwapExactAmountInRequest = { typeUrl: "/osmosis.poolmanager.v1beta1.EstimateSinglePoolSwapExactAmountInRequest", + aminoType: "osmosis/poolmanager/estimate-single-pool-swap-exact-amount-in-request", + is(o: any): o is EstimateSinglePoolSwapExactAmountInRequest { + return o && (o.$typeUrl === EstimateSinglePoolSwapExactAmountInRequest.typeUrl || typeof o.poolId === "bigint" && typeof o.tokenIn === "string" && typeof o.tokenOutDenom === "string"); + }, + isSDK(o: any): o is EstimateSinglePoolSwapExactAmountInRequestSDKType { + return o && (o.$typeUrl === EstimateSinglePoolSwapExactAmountInRequest.typeUrl || typeof o.pool_id === "bigint" && typeof o.token_in === "string" && typeof o.token_out_denom === "string"); + }, + isAmino(o: any): o is EstimateSinglePoolSwapExactAmountInRequestAmino { + return o && (o.$typeUrl === EstimateSinglePoolSwapExactAmountInRequest.typeUrl || typeof o.pool_id === "bigint" && typeof o.token_in === "string" && typeof o.token_out_denom === "string"); + }, encode(message: EstimateSinglePoolSwapExactAmountInRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.poolId !== BigInt(0)) { writer.uint32(8).uint64(message.poolId); @@ -672,6 +1244,20 @@ export const EstimateSinglePoolSwapExactAmountInRequest = { } return message; }, + fromJSON(object: any): EstimateSinglePoolSwapExactAmountInRequest { + return { + poolId: isSet(object.poolId) ? BigInt(object.poolId.toString()) : BigInt(0), + tokenIn: isSet(object.tokenIn) ? String(object.tokenIn) : "", + tokenOutDenom: isSet(object.tokenOutDenom) ? String(object.tokenOutDenom) : "" + }; + }, + toJSON(message: EstimateSinglePoolSwapExactAmountInRequest): unknown { + const obj: any = {}; + message.poolId !== undefined && (obj.poolId = (message.poolId || BigInt(0)).toString()); + message.tokenIn !== undefined && (obj.tokenIn = message.tokenIn); + message.tokenOutDenom !== undefined && (obj.tokenOutDenom = message.tokenOutDenom); + return obj; + }, fromPartial(object: Partial): EstimateSinglePoolSwapExactAmountInRequest { const message = createBaseEstimateSinglePoolSwapExactAmountInRequest(); message.poolId = object.poolId !== undefined && object.poolId !== null ? BigInt(object.poolId.toString()) : BigInt(0); @@ -680,11 +1266,17 @@ export const EstimateSinglePoolSwapExactAmountInRequest = { return message; }, fromAmino(object: EstimateSinglePoolSwapExactAmountInRequestAmino): EstimateSinglePoolSwapExactAmountInRequest { - return { - poolId: BigInt(object.pool_id), - tokenIn: object.token_in, - tokenOutDenom: object.token_out_denom - }; + const message = createBaseEstimateSinglePoolSwapExactAmountInRequest(); + if (object.pool_id !== undefined && object.pool_id !== null) { + message.poolId = BigInt(object.pool_id); + } + if (object.token_in !== undefined && object.token_in !== null) { + message.tokenIn = object.token_in; + } + if (object.token_out_denom !== undefined && object.token_out_denom !== null) { + message.tokenOutDenom = object.token_out_denom; + } + return message; }, toAmino(message: EstimateSinglePoolSwapExactAmountInRequest): EstimateSinglePoolSwapExactAmountInRequestAmino { const obj: any = {}; @@ -715,6 +1307,8 @@ export const EstimateSinglePoolSwapExactAmountInRequest = { }; } }; +GlobalDecoderRegistry.register(EstimateSinglePoolSwapExactAmountInRequest.typeUrl, EstimateSinglePoolSwapExactAmountInRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(EstimateSinglePoolSwapExactAmountInRequest.aminoType, EstimateSinglePoolSwapExactAmountInRequest.typeUrl); function createBaseEstimateSwapExactAmountInResponse(): EstimateSwapExactAmountInResponse { return { tokenOutAmount: "" @@ -722,6 +1316,16 @@ function createBaseEstimateSwapExactAmountInResponse(): EstimateSwapExactAmountI } export const EstimateSwapExactAmountInResponse = { typeUrl: "/osmosis.poolmanager.v1beta1.EstimateSwapExactAmountInResponse", + aminoType: "osmosis/poolmanager/estimate-swap-exact-amount-in-response", + is(o: any): o is EstimateSwapExactAmountInResponse { + return o && (o.$typeUrl === EstimateSwapExactAmountInResponse.typeUrl || typeof o.tokenOutAmount === "string"); + }, + isSDK(o: any): o is EstimateSwapExactAmountInResponseSDKType { + return o && (o.$typeUrl === EstimateSwapExactAmountInResponse.typeUrl || typeof o.token_out_amount === "string"); + }, + isAmino(o: any): o is EstimateSwapExactAmountInResponseAmino { + return o && (o.$typeUrl === EstimateSwapExactAmountInResponse.typeUrl || typeof o.token_out_amount === "string"); + }, encode(message: EstimateSwapExactAmountInResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.tokenOutAmount !== "") { writer.uint32(10).string(message.tokenOutAmount); @@ -745,15 +1349,27 @@ export const EstimateSwapExactAmountInResponse = { } return message; }, + fromJSON(object: any): EstimateSwapExactAmountInResponse { + return { + tokenOutAmount: isSet(object.tokenOutAmount) ? String(object.tokenOutAmount) : "" + }; + }, + toJSON(message: EstimateSwapExactAmountInResponse): unknown { + const obj: any = {}; + message.tokenOutAmount !== undefined && (obj.tokenOutAmount = message.tokenOutAmount); + return obj; + }, fromPartial(object: Partial): EstimateSwapExactAmountInResponse { const message = createBaseEstimateSwapExactAmountInResponse(); message.tokenOutAmount = object.tokenOutAmount ?? ""; return message; }, fromAmino(object: EstimateSwapExactAmountInResponseAmino): EstimateSwapExactAmountInResponse { - return { - tokenOutAmount: object.token_out_amount - }; + const message = createBaseEstimateSwapExactAmountInResponse(); + if (object.token_out_amount !== undefined && object.token_out_amount !== null) { + message.tokenOutAmount = object.token_out_amount; + } + return message; }, toAmino(message: EstimateSwapExactAmountInResponse): EstimateSwapExactAmountInResponseAmino { const obj: any = {}; @@ -782,6 +1398,8 @@ export const EstimateSwapExactAmountInResponse = { }; } }; +GlobalDecoderRegistry.register(EstimateSwapExactAmountInResponse.typeUrl, EstimateSwapExactAmountInResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(EstimateSwapExactAmountInResponse.aminoType, EstimateSwapExactAmountInResponse.typeUrl); function createBaseEstimateSwapExactAmountOutRequest(): EstimateSwapExactAmountOutRequest { return { poolId: BigInt(0), @@ -791,6 +1409,16 @@ function createBaseEstimateSwapExactAmountOutRequest(): EstimateSwapExactAmountO } export const EstimateSwapExactAmountOutRequest = { typeUrl: "/osmosis.poolmanager.v1beta1.EstimateSwapExactAmountOutRequest", + aminoType: "osmosis/poolmanager/estimate-swap-exact-amount-out-request", + is(o: any): o is EstimateSwapExactAmountOutRequest { + return o && (o.$typeUrl === EstimateSwapExactAmountOutRequest.typeUrl || typeof o.poolId === "bigint" && Array.isArray(o.routes) && (!o.routes.length || SwapAmountOutRoute.is(o.routes[0])) && typeof o.tokenOut === "string"); + }, + isSDK(o: any): o is EstimateSwapExactAmountOutRequestSDKType { + return o && (o.$typeUrl === EstimateSwapExactAmountOutRequest.typeUrl || typeof o.pool_id === "bigint" && Array.isArray(o.routes) && (!o.routes.length || SwapAmountOutRoute.isSDK(o.routes[0])) && typeof o.token_out === "string"); + }, + isAmino(o: any): o is EstimateSwapExactAmountOutRequestAmino { + return o && (o.$typeUrl === EstimateSwapExactAmountOutRequest.typeUrl || typeof o.pool_id === "bigint" && Array.isArray(o.routes) && (!o.routes.length || SwapAmountOutRoute.isAmino(o.routes[0])) && typeof o.token_out === "string"); + }, encode(message: EstimateSwapExactAmountOutRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.poolId !== BigInt(0)) { writer.uint32(16).uint64(message.poolId); @@ -826,6 +1454,24 @@ export const EstimateSwapExactAmountOutRequest = { } return message; }, + fromJSON(object: any): EstimateSwapExactAmountOutRequest { + return { + poolId: isSet(object.poolId) ? BigInt(object.poolId.toString()) : BigInt(0), + routes: Array.isArray(object?.routes) ? object.routes.map((e: any) => SwapAmountOutRoute.fromJSON(e)) : [], + tokenOut: isSet(object.tokenOut) ? String(object.tokenOut) : "" + }; + }, + toJSON(message: EstimateSwapExactAmountOutRequest): unknown { + const obj: any = {}; + message.poolId !== undefined && (obj.poolId = (message.poolId || BigInt(0)).toString()); + if (message.routes) { + obj.routes = message.routes.map(e => e ? SwapAmountOutRoute.toJSON(e) : undefined); + } else { + obj.routes = []; + } + message.tokenOut !== undefined && (obj.tokenOut = message.tokenOut); + return obj; + }, fromPartial(object: Partial): EstimateSwapExactAmountOutRequest { const message = createBaseEstimateSwapExactAmountOutRequest(); message.poolId = object.poolId !== undefined && object.poolId !== null ? BigInt(object.poolId.toString()) : BigInt(0); @@ -834,11 +1480,15 @@ export const EstimateSwapExactAmountOutRequest = { return message; }, fromAmino(object: EstimateSwapExactAmountOutRequestAmino): EstimateSwapExactAmountOutRequest { - return { - poolId: BigInt(object.pool_id), - routes: Array.isArray(object?.routes) ? object.routes.map((e: any) => SwapAmountOutRoute.fromAmino(e)) : [], - tokenOut: object.token_out - }; + const message = createBaseEstimateSwapExactAmountOutRequest(); + if (object.pool_id !== undefined && object.pool_id !== null) { + message.poolId = BigInt(object.pool_id); + } + message.routes = object.routes?.map(e => SwapAmountOutRoute.fromAmino(e)) || []; + if (object.token_out !== undefined && object.token_out !== null) { + message.tokenOut = object.token_out; + } + return message; }, toAmino(message: EstimateSwapExactAmountOutRequest): EstimateSwapExactAmountOutRequestAmino { const obj: any = {}; @@ -873,6 +1523,162 @@ export const EstimateSwapExactAmountOutRequest = { }; } }; +GlobalDecoderRegistry.register(EstimateSwapExactAmountOutRequest.typeUrl, EstimateSwapExactAmountOutRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(EstimateSwapExactAmountOutRequest.aminoType, EstimateSwapExactAmountOutRequest.typeUrl); +function createBaseEstimateSwapExactAmountOutWithPrimitiveTypesRequest(): EstimateSwapExactAmountOutWithPrimitiveTypesRequest { + return { + poolId: BigInt(0), + routesPoolId: [], + routesTokenInDenom: [], + tokenOut: "" + }; +} +export const EstimateSwapExactAmountOutWithPrimitiveTypesRequest = { + typeUrl: "/osmosis.poolmanager.v1beta1.EstimateSwapExactAmountOutWithPrimitiveTypesRequest", + aminoType: "osmosis/poolmanager/estimate-swap-exact-amount-out-with-primitive-types-request", + is(o: any): o is EstimateSwapExactAmountOutWithPrimitiveTypesRequest { + return o && (o.$typeUrl === EstimateSwapExactAmountOutWithPrimitiveTypesRequest.typeUrl || typeof o.poolId === "bigint" && Array.isArray(o.routesPoolId) && (!o.routesPoolId.length || typeof o.routesPoolId[0] === "bigint") && Array.isArray(o.routesTokenInDenom) && (!o.routesTokenInDenom.length || typeof o.routesTokenInDenom[0] === "string") && typeof o.tokenOut === "string"); + }, + isSDK(o: any): o is EstimateSwapExactAmountOutWithPrimitiveTypesRequestSDKType { + return o && (o.$typeUrl === EstimateSwapExactAmountOutWithPrimitiveTypesRequest.typeUrl || typeof o.pool_id === "bigint" && Array.isArray(o.routes_pool_id) && (!o.routes_pool_id.length || typeof o.routes_pool_id[0] === "bigint") && Array.isArray(o.routes_token_in_denom) && (!o.routes_token_in_denom.length || typeof o.routes_token_in_denom[0] === "string") && typeof o.token_out === "string"); + }, + isAmino(o: any): o is EstimateSwapExactAmountOutWithPrimitiveTypesRequestAmino { + return o && (o.$typeUrl === EstimateSwapExactAmountOutWithPrimitiveTypesRequest.typeUrl || typeof o.pool_id === "bigint" && Array.isArray(o.routes_pool_id) && (!o.routes_pool_id.length || typeof o.routes_pool_id[0] === "bigint") && Array.isArray(o.routes_token_in_denom) && (!o.routes_token_in_denom.length || typeof o.routes_token_in_denom[0] === "string") && typeof o.token_out === "string"); + }, + encode(message: EstimateSwapExactAmountOutWithPrimitiveTypesRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.poolId !== BigInt(0)) { + writer.uint32(8).uint64(message.poolId); + } + writer.uint32(18).fork(); + for (const v of message.routesPoolId) { + writer.uint64(v); + } + writer.ldelim(); + for (const v of message.routesTokenInDenom) { + writer.uint32(26).string(v!); + } + if (message.tokenOut !== "") { + writer.uint32(34).string(message.tokenOut); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): EstimateSwapExactAmountOutWithPrimitiveTypesRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseEstimateSwapExactAmountOutWithPrimitiveTypesRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.poolId = reader.uint64(); + break; + case 2: + if ((tag & 7) === 2) { + const end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) { + message.routesPoolId.push(reader.uint64()); + } + } else { + message.routesPoolId.push(reader.uint64()); + } + break; + case 3: + message.routesTokenInDenom.push(reader.string()); + break; + case 4: + message.tokenOut = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): EstimateSwapExactAmountOutWithPrimitiveTypesRequest { + return { + poolId: isSet(object.poolId) ? BigInt(object.poolId.toString()) : BigInt(0), + routesPoolId: Array.isArray(object?.routesPoolId) ? object.routesPoolId.map((e: any) => BigInt(e.toString())) : [], + routesTokenInDenom: Array.isArray(object?.routesTokenInDenom) ? object.routesTokenInDenom.map((e: any) => String(e)) : [], + tokenOut: isSet(object.tokenOut) ? String(object.tokenOut) : "" + }; + }, + toJSON(message: EstimateSwapExactAmountOutWithPrimitiveTypesRequest): unknown { + const obj: any = {}; + message.poolId !== undefined && (obj.poolId = (message.poolId || BigInt(0)).toString()); + if (message.routesPoolId) { + obj.routesPoolId = message.routesPoolId.map(e => (e || BigInt(0)).toString()); + } else { + obj.routesPoolId = []; + } + if (message.routesTokenInDenom) { + obj.routesTokenInDenom = message.routesTokenInDenom.map(e => e); + } else { + obj.routesTokenInDenom = []; + } + message.tokenOut !== undefined && (obj.tokenOut = message.tokenOut); + return obj; + }, + fromPartial(object: Partial): EstimateSwapExactAmountOutWithPrimitiveTypesRequest { + const message = createBaseEstimateSwapExactAmountOutWithPrimitiveTypesRequest(); + message.poolId = object.poolId !== undefined && object.poolId !== null ? BigInt(object.poolId.toString()) : BigInt(0); + message.routesPoolId = object.routesPoolId?.map(e => BigInt(e.toString())) || []; + message.routesTokenInDenom = object.routesTokenInDenom?.map(e => e) || []; + message.tokenOut = object.tokenOut ?? ""; + return message; + }, + fromAmino(object: EstimateSwapExactAmountOutWithPrimitiveTypesRequestAmino): EstimateSwapExactAmountOutWithPrimitiveTypesRequest { + const message = createBaseEstimateSwapExactAmountOutWithPrimitiveTypesRequest(); + if (object.pool_id !== undefined && object.pool_id !== null) { + message.poolId = BigInt(object.pool_id); + } + message.routesPoolId = object.routes_pool_id?.map(e => BigInt(e)) || []; + message.routesTokenInDenom = object.routes_token_in_denom?.map(e => e) || []; + if (object.token_out !== undefined && object.token_out !== null) { + message.tokenOut = object.token_out; + } + return message; + }, + toAmino(message: EstimateSwapExactAmountOutWithPrimitiveTypesRequest): EstimateSwapExactAmountOutWithPrimitiveTypesRequestAmino { + const obj: any = {}; + obj.pool_id = message.poolId ? message.poolId.toString() : undefined; + if (message.routesPoolId) { + obj.routes_pool_id = message.routesPoolId.map(e => e.toString()); + } else { + obj.routes_pool_id = []; + } + if (message.routesTokenInDenom) { + obj.routes_token_in_denom = message.routesTokenInDenom.map(e => e); + } else { + obj.routes_token_in_denom = []; + } + obj.token_out = message.tokenOut; + return obj; + }, + fromAminoMsg(object: EstimateSwapExactAmountOutWithPrimitiveTypesRequestAminoMsg): EstimateSwapExactAmountOutWithPrimitiveTypesRequest { + return EstimateSwapExactAmountOutWithPrimitiveTypesRequest.fromAmino(object.value); + }, + toAminoMsg(message: EstimateSwapExactAmountOutWithPrimitiveTypesRequest): EstimateSwapExactAmountOutWithPrimitiveTypesRequestAminoMsg { + return { + type: "osmosis/poolmanager/estimate-swap-exact-amount-out-with-primitive-types-request", + value: EstimateSwapExactAmountOutWithPrimitiveTypesRequest.toAmino(message) + }; + }, + fromProtoMsg(message: EstimateSwapExactAmountOutWithPrimitiveTypesRequestProtoMsg): EstimateSwapExactAmountOutWithPrimitiveTypesRequest { + return EstimateSwapExactAmountOutWithPrimitiveTypesRequest.decode(message.value); + }, + toProto(message: EstimateSwapExactAmountOutWithPrimitiveTypesRequest): Uint8Array { + return EstimateSwapExactAmountOutWithPrimitiveTypesRequest.encode(message).finish(); + }, + toProtoMsg(message: EstimateSwapExactAmountOutWithPrimitiveTypesRequest): EstimateSwapExactAmountOutWithPrimitiveTypesRequestProtoMsg { + return { + typeUrl: "/osmosis.poolmanager.v1beta1.EstimateSwapExactAmountOutWithPrimitiveTypesRequest", + value: EstimateSwapExactAmountOutWithPrimitiveTypesRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(EstimateSwapExactAmountOutWithPrimitiveTypesRequest.typeUrl, EstimateSwapExactAmountOutWithPrimitiveTypesRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(EstimateSwapExactAmountOutWithPrimitiveTypesRequest.aminoType, EstimateSwapExactAmountOutWithPrimitiveTypesRequest.typeUrl); function createBaseEstimateSinglePoolSwapExactAmountOutRequest(): EstimateSinglePoolSwapExactAmountOutRequest { return { poolId: BigInt(0), @@ -882,6 +1688,16 @@ function createBaseEstimateSinglePoolSwapExactAmountOutRequest(): EstimateSingle } export const EstimateSinglePoolSwapExactAmountOutRequest = { typeUrl: "/osmosis.poolmanager.v1beta1.EstimateSinglePoolSwapExactAmountOutRequest", + aminoType: "osmosis/poolmanager/estimate-single-pool-swap-exact-amount-out-request", + is(o: any): o is EstimateSinglePoolSwapExactAmountOutRequest { + return o && (o.$typeUrl === EstimateSinglePoolSwapExactAmountOutRequest.typeUrl || typeof o.poolId === "bigint" && typeof o.tokenInDenom === "string" && typeof o.tokenOut === "string"); + }, + isSDK(o: any): o is EstimateSinglePoolSwapExactAmountOutRequestSDKType { + return o && (o.$typeUrl === EstimateSinglePoolSwapExactAmountOutRequest.typeUrl || typeof o.pool_id === "bigint" && typeof o.token_in_denom === "string" && typeof o.token_out === "string"); + }, + isAmino(o: any): o is EstimateSinglePoolSwapExactAmountOutRequestAmino { + return o && (o.$typeUrl === EstimateSinglePoolSwapExactAmountOutRequest.typeUrl || typeof o.pool_id === "bigint" && typeof o.token_in_denom === "string" && typeof o.token_out === "string"); + }, encode(message: EstimateSinglePoolSwapExactAmountOutRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.poolId !== BigInt(0)) { writer.uint32(8).uint64(message.poolId); @@ -917,6 +1733,20 @@ export const EstimateSinglePoolSwapExactAmountOutRequest = { } return message; }, + fromJSON(object: any): EstimateSinglePoolSwapExactAmountOutRequest { + return { + poolId: isSet(object.poolId) ? BigInt(object.poolId.toString()) : BigInt(0), + tokenInDenom: isSet(object.tokenInDenom) ? String(object.tokenInDenom) : "", + tokenOut: isSet(object.tokenOut) ? String(object.tokenOut) : "" + }; + }, + toJSON(message: EstimateSinglePoolSwapExactAmountOutRequest): unknown { + const obj: any = {}; + message.poolId !== undefined && (obj.poolId = (message.poolId || BigInt(0)).toString()); + message.tokenInDenom !== undefined && (obj.tokenInDenom = message.tokenInDenom); + message.tokenOut !== undefined && (obj.tokenOut = message.tokenOut); + return obj; + }, fromPartial(object: Partial): EstimateSinglePoolSwapExactAmountOutRequest { const message = createBaseEstimateSinglePoolSwapExactAmountOutRequest(); message.poolId = object.poolId !== undefined && object.poolId !== null ? BigInt(object.poolId.toString()) : BigInt(0); @@ -925,11 +1755,17 @@ export const EstimateSinglePoolSwapExactAmountOutRequest = { return message; }, fromAmino(object: EstimateSinglePoolSwapExactAmountOutRequestAmino): EstimateSinglePoolSwapExactAmountOutRequest { - return { - poolId: BigInt(object.pool_id), - tokenInDenom: object.token_in_denom, - tokenOut: object.token_out - }; + const message = createBaseEstimateSinglePoolSwapExactAmountOutRequest(); + if (object.pool_id !== undefined && object.pool_id !== null) { + message.poolId = BigInt(object.pool_id); + } + if (object.token_in_denom !== undefined && object.token_in_denom !== null) { + message.tokenInDenom = object.token_in_denom; + } + if (object.token_out !== undefined && object.token_out !== null) { + message.tokenOut = object.token_out; + } + return message; }, toAmino(message: EstimateSinglePoolSwapExactAmountOutRequest): EstimateSinglePoolSwapExactAmountOutRequestAmino { const obj: any = {}; @@ -960,6 +1796,8 @@ export const EstimateSinglePoolSwapExactAmountOutRequest = { }; } }; +GlobalDecoderRegistry.register(EstimateSinglePoolSwapExactAmountOutRequest.typeUrl, EstimateSinglePoolSwapExactAmountOutRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(EstimateSinglePoolSwapExactAmountOutRequest.aminoType, EstimateSinglePoolSwapExactAmountOutRequest.typeUrl); function createBaseEstimateSwapExactAmountOutResponse(): EstimateSwapExactAmountOutResponse { return { tokenInAmount: "" @@ -967,6 +1805,16 @@ function createBaseEstimateSwapExactAmountOutResponse(): EstimateSwapExactAmount } export const EstimateSwapExactAmountOutResponse = { typeUrl: "/osmosis.poolmanager.v1beta1.EstimateSwapExactAmountOutResponse", + aminoType: "osmosis/poolmanager/estimate-swap-exact-amount-out-response", + is(o: any): o is EstimateSwapExactAmountOutResponse { + return o && (o.$typeUrl === EstimateSwapExactAmountOutResponse.typeUrl || typeof o.tokenInAmount === "string"); + }, + isSDK(o: any): o is EstimateSwapExactAmountOutResponseSDKType { + return o && (o.$typeUrl === EstimateSwapExactAmountOutResponse.typeUrl || typeof o.token_in_amount === "string"); + }, + isAmino(o: any): o is EstimateSwapExactAmountOutResponseAmino { + return o && (o.$typeUrl === EstimateSwapExactAmountOutResponse.typeUrl || typeof o.token_in_amount === "string"); + }, encode(message: EstimateSwapExactAmountOutResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.tokenInAmount !== "") { writer.uint32(10).string(message.tokenInAmount); @@ -990,15 +1838,27 @@ export const EstimateSwapExactAmountOutResponse = { } return message; }, + fromJSON(object: any): EstimateSwapExactAmountOutResponse { + return { + tokenInAmount: isSet(object.tokenInAmount) ? String(object.tokenInAmount) : "" + }; + }, + toJSON(message: EstimateSwapExactAmountOutResponse): unknown { + const obj: any = {}; + message.tokenInAmount !== undefined && (obj.tokenInAmount = message.tokenInAmount); + return obj; + }, fromPartial(object: Partial): EstimateSwapExactAmountOutResponse { const message = createBaseEstimateSwapExactAmountOutResponse(); message.tokenInAmount = object.tokenInAmount ?? ""; return message; }, fromAmino(object: EstimateSwapExactAmountOutResponseAmino): EstimateSwapExactAmountOutResponse { - return { - tokenInAmount: object.token_in_amount - }; + const message = createBaseEstimateSwapExactAmountOutResponse(); + if (object.token_in_amount !== undefined && object.token_in_amount !== null) { + message.tokenInAmount = object.token_in_amount; + } + return message; }, toAmino(message: EstimateSwapExactAmountOutResponse): EstimateSwapExactAmountOutResponseAmino { const obj: any = {}; @@ -1027,11 +1887,23 @@ export const EstimateSwapExactAmountOutResponse = { }; } }; +GlobalDecoderRegistry.register(EstimateSwapExactAmountOutResponse.typeUrl, EstimateSwapExactAmountOutResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(EstimateSwapExactAmountOutResponse.aminoType, EstimateSwapExactAmountOutResponse.typeUrl); function createBaseNumPoolsRequest(): NumPoolsRequest { return {}; } export const NumPoolsRequest = { typeUrl: "/osmosis.poolmanager.v1beta1.NumPoolsRequest", + aminoType: "osmosis/poolmanager/num-pools-request", + is(o: any): o is NumPoolsRequest { + return o && o.$typeUrl === NumPoolsRequest.typeUrl; + }, + isSDK(o: any): o is NumPoolsRequestSDKType { + return o && o.$typeUrl === NumPoolsRequest.typeUrl; + }, + isAmino(o: any): o is NumPoolsRequestAmino { + return o && o.$typeUrl === NumPoolsRequest.typeUrl; + }, encode(_: NumPoolsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, @@ -1049,12 +1921,20 @@ export const NumPoolsRequest = { } return message; }, + fromJSON(_: any): NumPoolsRequest { + return {}; + }, + toJSON(_: NumPoolsRequest): unknown { + const obj: any = {}; + return obj; + }, fromPartial(_: Partial): NumPoolsRequest { const message = createBaseNumPoolsRequest(); return message; }, fromAmino(_: NumPoolsRequestAmino): NumPoolsRequest { - return {}; + const message = createBaseNumPoolsRequest(); + return message; }, toAmino(_: NumPoolsRequest): NumPoolsRequestAmino { const obj: any = {}; @@ -1082,6 +1962,8 @@ export const NumPoolsRequest = { }; } }; +GlobalDecoderRegistry.register(NumPoolsRequest.typeUrl, NumPoolsRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(NumPoolsRequest.aminoType, NumPoolsRequest.typeUrl); function createBaseNumPoolsResponse(): NumPoolsResponse { return { numPools: BigInt(0) @@ -1089,6 +1971,16 @@ function createBaseNumPoolsResponse(): NumPoolsResponse { } export const NumPoolsResponse = { typeUrl: "/osmosis.poolmanager.v1beta1.NumPoolsResponse", + aminoType: "osmosis/poolmanager/num-pools-response", + is(o: any): o is NumPoolsResponse { + return o && (o.$typeUrl === NumPoolsResponse.typeUrl || typeof o.numPools === "bigint"); + }, + isSDK(o: any): o is NumPoolsResponseSDKType { + return o && (o.$typeUrl === NumPoolsResponse.typeUrl || typeof o.num_pools === "bigint"); + }, + isAmino(o: any): o is NumPoolsResponseAmino { + return o && (o.$typeUrl === NumPoolsResponse.typeUrl || typeof o.num_pools === "bigint"); + }, encode(message: NumPoolsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.numPools !== BigInt(0)) { writer.uint32(8).uint64(message.numPools); @@ -1112,15 +2004,27 @@ export const NumPoolsResponse = { } return message; }, + fromJSON(object: any): NumPoolsResponse { + return { + numPools: isSet(object.numPools) ? BigInt(object.numPools.toString()) : BigInt(0) + }; + }, + toJSON(message: NumPoolsResponse): unknown { + const obj: any = {}; + message.numPools !== undefined && (obj.numPools = (message.numPools || BigInt(0)).toString()); + return obj; + }, fromPartial(object: Partial): NumPoolsResponse { const message = createBaseNumPoolsResponse(); message.numPools = object.numPools !== undefined && object.numPools !== null ? BigInt(object.numPools.toString()) : BigInt(0); return message; }, fromAmino(object: NumPoolsResponseAmino): NumPoolsResponse { - return { - numPools: BigInt(object.num_pools) - }; + const message = createBaseNumPoolsResponse(); + if (object.num_pools !== undefined && object.num_pools !== null) { + message.numPools = BigInt(object.num_pools); + } + return message; }, toAmino(message: NumPoolsResponse): NumPoolsResponseAmino { const obj: any = {}; @@ -1149,6 +2053,8 @@ export const NumPoolsResponse = { }; } }; +GlobalDecoderRegistry.register(NumPoolsResponse.typeUrl, NumPoolsResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(NumPoolsResponse.aminoType, NumPoolsResponse.typeUrl); function createBasePoolRequest(): PoolRequest { return { poolId: BigInt(0) @@ -1156,6 +2062,16 @@ function createBasePoolRequest(): PoolRequest { } export const PoolRequest = { typeUrl: "/osmosis.poolmanager.v1beta1.PoolRequest", + aminoType: "osmosis/poolmanager/pool-request", + is(o: any): o is PoolRequest { + return o && (o.$typeUrl === PoolRequest.typeUrl || typeof o.poolId === "bigint"); + }, + isSDK(o: any): o is PoolRequestSDKType { + return o && (o.$typeUrl === PoolRequest.typeUrl || typeof o.pool_id === "bigint"); + }, + isAmino(o: any): o is PoolRequestAmino { + return o && (o.$typeUrl === PoolRequest.typeUrl || typeof o.pool_id === "bigint"); + }, encode(message: PoolRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.poolId !== BigInt(0)) { writer.uint32(8).uint64(message.poolId); @@ -1179,15 +2095,27 @@ export const PoolRequest = { } return message; }, + fromJSON(object: any): PoolRequest { + return { + poolId: isSet(object.poolId) ? BigInt(object.poolId.toString()) : BigInt(0) + }; + }, + toJSON(message: PoolRequest): unknown { + const obj: any = {}; + message.poolId !== undefined && (obj.poolId = (message.poolId || BigInt(0)).toString()); + return obj; + }, fromPartial(object: Partial): PoolRequest { const message = createBasePoolRequest(); message.poolId = object.poolId !== undefined && object.poolId !== null ? BigInt(object.poolId.toString()) : BigInt(0); return message; }, fromAmino(object: PoolRequestAmino): PoolRequest { - return { - poolId: BigInt(object.pool_id) - }; + const message = createBasePoolRequest(); + if (object.pool_id !== undefined && object.pool_id !== null) { + message.poolId = BigInt(object.pool_id); + } + return message; }, toAmino(message: PoolRequest): PoolRequestAmino { const obj: any = {}; @@ -1216,6 +2144,8 @@ export const PoolRequest = { }; } }; +GlobalDecoderRegistry.register(PoolRequest.typeUrl, PoolRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(PoolRequest.aminoType, PoolRequest.typeUrl); function createBasePoolResponse(): PoolResponse { return { pool: undefined @@ -1223,9 +2153,19 @@ function createBasePoolResponse(): PoolResponse { } export const PoolResponse = { typeUrl: "/osmosis.poolmanager.v1beta1.PoolResponse", + aminoType: "osmosis/poolmanager/pool-response", + is(o: any): o is PoolResponse { + return o && o.$typeUrl === PoolResponse.typeUrl; + }, + isSDK(o: any): o is PoolResponseSDKType { + return o && o.$typeUrl === PoolResponse.typeUrl; + }, + isAmino(o: any): o is PoolResponseAmino { + return o && o.$typeUrl === PoolResponse.typeUrl; + }, encode(message: PoolResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.pool !== undefined) { - Any.encode((message.pool as Any), writer.uint32(10).fork()).ldelim(); + Any.encode(GlobalDecoderRegistry.wrapAny(message.pool), writer.uint32(10).fork()).ldelim(); } return writer; }, @@ -1237,7 +2177,7 @@ export const PoolResponse = { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.pool = (PoolI_InterfaceDecoder(reader) as Any); + message.pool = GlobalDecoderRegistry.unwrapAny(reader); break; default: reader.skipType(tag & 7); @@ -1246,19 +2186,31 @@ export const PoolResponse = { } return message; }, + fromJSON(object: any): PoolResponse { + return { + pool: isSet(object.pool) ? GlobalDecoderRegistry.fromJSON(object.pool) : undefined + }; + }, + toJSON(message: PoolResponse): unknown { + const obj: any = {}; + message.pool !== undefined && (obj.pool = message.pool ? GlobalDecoderRegistry.toJSON(message.pool) : undefined); + return obj; + }, fromPartial(object: Partial): PoolResponse { const message = createBasePoolResponse(); - message.pool = object.pool !== undefined && object.pool !== null ? Any.fromPartial(object.pool) : undefined; + message.pool = object.pool !== undefined && object.pool !== null ? GlobalDecoderRegistry.fromPartial(object.pool) : undefined; return message; }, fromAmino(object: PoolResponseAmino): PoolResponse { - return { - pool: object?.pool ? PoolI_FromAmino(object.pool) : undefined - }; + const message = createBasePoolResponse(); + if (object.pool !== undefined && object.pool !== null) { + message.pool = GlobalDecoderRegistry.fromAminoMsg(object.pool); + } + return message; }, toAmino(message: PoolResponse): PoolResponseAmino { const obj: any = {}; - obj.pool = message.pool ? PoolI_ToAmino((message.pool as Any)) : undefined; + obj.pool = message.pool ? GlobalDecoderRegistry.toAminoMsg(message.pool) : undefined; return obj; }, fromAminoMsg(object: PoolResponseAminoMsg): PoolResponse { @@ -1283,11 +2235,23 @@ export const PoolResponse = { }; } }; +GlobalDecoderRegistry.register(PoolResponse.typeUrl, PoolResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(PoolResponse.aminoType, PoolResponse.typeUrl); function createBaseAllPoolsRequest(): AllPoolsRequest { return {}; } export const AllPoolsRequest = { typeUrl: "/osmosis.poolmanager.v1beta1.AllPoolsRequest", + aminoType: "osmosis/poolmanager/all-pools-request", + is(o: any): o is AllPoolsRequest { + return o && o.$typeUrl === AllPoolsRequest.typeUrl; + }, + isSDK(o: any): o is AllPoolsRequestSDKType { + return o && o.$typeUrl === AllPoolsRequest.typeUrl; + }, + isAmino(o: any): o is AllPoolsRequestAmino { + return o && o.$typeUrl === AllPoolsRequest.typeUrl; + }, encode(_: AllPoolsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, @@ -1305,12 +2269,20 @@ export const AllPoolsRequest = { } return message; }, + fromJSON(_: any): AllPoolsRequest { + return {}; + }, + toJSON(_: AllPoolsRequest): unknown { + const obj: any = {}; + return obj; + }, fromPartial(_: Partial): AllPoolsRequest { const message = createBaseAllPoolsRequest(); return message; }, fromAmino(_: AllPoolsRequestAmino): AllPoolsRequest { - return {}; + const message = createBaseAllPoolsRequest(); + return message; }, toAmino(_: AllPoolsRequest): AllPoolsRequestAmino { const obj: any = {}; @@ -1338,6 +2310,8 @@ export const AllPoolsRequest = { }; } }; +GlobalDecoderRegistry.register(AllPoolsRequest.typeUrl, AllPoolsRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(AllPoolsRequest.aminoType, AllPoolsRequest.typeUrl); function createBaseAllPoolsResponse(): AllPoolsResponse { return { pools: [] @@ -1345,9 +2319,19 @@ function createBaseAllPoolsResponse(): AllPoolsResponse { } export const AllPoolsResponse = { typeUrl: "/osmosis.poolmanager.v1beta1.AllPoolsResponse", + aminoType: "osmosis/poolmanager/all-pools-response", + is(o: any): o is AllPoolsResponse { + return o && (o.$typeUrl === AllPoolsResponse.typeUrl || Array.isArray(o.pools) && (!o.pools.length || Pool1.is(o.pools[0]) || CosmWasmPool.is(o.pools[0]) || Pool2.is(o.pools[0]) || Pool3.is(o.pools[0]) || Any.is(o.pools[0]))); + }, + isSDK(o: any): o is AllPoolsResponseSDKType { + return o && (o.$typeUrl === AllPoolsResponse.typeUrl || Array.isArray(o.pools) && (!o.pools.length || Pool1.isSDK(o.pools[0]) || CosmWasmPool.isSDK(o.pools[0]) || Pool2.isSDK(o.pools[0]) || Pool3.isSDK(o.pools[0]) || Any.isSDK(o.pools[0]))); + }, + isAmino(o: any): o is AllPoolsResponseAmino { + return o && (o.$typeUrl === AllPoolsResponse.typeUrl || Array.isArray(o.pools) && (!o.pools.length || Pool1.isAmino(o.pools[0]) || CosmWasmPool.isAmino(o.pools[0]) || Pool2.isAmino(o.pools[0]) || Pool3.isAmino(o.pools[0]) || Any.isAmino(o.pools[0]))); + }, encode(message: AllPoolsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.pools) { - Any.encode((v! as Any), writer.uint32(10).fork()).ldelim(); + Any.encode(GlobalDecoderRegistry.wrapAny(v!), writer.uint32(10).fork()).ldelim(); } return writer; }, @@ -1359,7 +2343,7 @@ export const AllPoolsResponse = { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.pools.push((PoolI_InterfaceDecoder(reader) as Any)); + message.pools.push(GlobalDecoderRegistry.unwrapAny(reader)); break; default: reader.skipType(tag & 7); @@ -1368,20 +2352,34 @@ export const AllPoolsResponse = { } return message; }, + fromJSON(object: any): AllPoolsResponse { + return { + pools: Array.isArray(object?.pools) ? object.pools.map((e: any) => GlobalDecoderRegistry.fromJSON(e)) : [] + }; + }, + toJSON(message: AllPoolsResponse): unknown { + const obj: any = {}; + if (message.pools) { + obj.pools = message.pools.map(e => e ? GlobalDecoderRegistry.toJSON(e) : undefined); + } else { + obj.pools = []; + } + return obj; + }, fromPartial(object: Partial): AllPoolsResponse { const message = createBaseAllPoolsResponse(); - message.pools = object.pools?.map(e => Any.fromPartial(e)) || []; + message.pools = object.pools?.map(e => (Any.fromPartial(e) as any)) || []; return message; }, fromAmino(object: AllPoolsResponseAmino): AllPoolsResponse { - return { - pools: Array.isArray(object?.pools) ? object.pools.map((e: any) => PoolI_FromAmino(e)) : [] - }; + const message = createBaseAllPoolsResponse(); + message.pools = object.pools?.map(e => GlobalDecoderRegistry.fromAminoMsg(e)) || []; + return message; }, toAmino(message: AllPoolsResponse): AllPoolsResponseAmino { const obj: any = {}; if (message.pools) { - obj.pools = message.pools.map(e => e ? PoolI_ToAmino((e as Any)) : undefined); + obj.pools = message.pools.map(e => e ? GlobalDecoderRegistry.toAminoMsg(e) : undefined); } else { obj.pools = []; } @@ -1409,42 +2407,40 @@ export const AllPoolsResponse = { }; } }; -function createBaseSpotPriceRequest(): SpotPriceRequest { +GlobalDecoderRegistry.register(AllPoolsResponse.typeUrl, AllPoolsResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(AllPoolsResponse.aminoType, AllPoolsResponse.typeUrl); +function createBaseListPoolsByDenomRequest(): ListPoolsByDenomRequest { return { - poolId: BigInt(0), - baseAssetDenom: "", - quoteAssetDenom: "" + denom: "" }; } -export const SpotPriceRequest = { - typeUrl: "/osmosis.poolmanager.v1beta1.SpotPriceRequest", - encode(message: SpotPriceRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { - if (message.poolId !== BigInt(0)) { - writer.uint32(8).uint64(message.poolId); - } - if (message.baseAssetDenom !== "") { - writer.uint32(18).string(message.baseAssetDenom); - } - if (message.quoteAssetDenom !== "") { - writer.uint32(26).string(message.quoteAssetDenom); +export const ListPoolsByDenomRequest = { + typeUrl: "/osmosis.poolmanager.v1beta1.ListPoolsByDenomRequest", + aminoType: "osmosis/poolmanager/list-pools-by-denom-request", + is(o: any): o is ListPoolsByDenomRequest { + return o && (o.$typeUrl === ListPoolsByDenomRequest.typeUrl || typeof o.denom === "string"); + }, + isSDK(o: any): o is ListPoolsByDenomRequestSDKType { + return o && (o.$typeUrl === ListPoolsByDenomRequest.typeUrl || typeof o.denom === "string"); + }, + isAmino(o: any): o is ListPoolsByDenomRequestAmino { + return o && (o.$typeUrl === ListPoolsByDenomRequest.typeUrl || typeof o.denom === "string"); + }, + encode(message: ListPoolsByDenomRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.denom !== "") { + writer.uint32(10).string(message.denom); } return writer; }, - decode(input: BinaryReader | Uint8Array, length?: number): SpotPriceRequest { + decode(input: BinaryReader | Uint8Array, length?: number): ListPoolsByDenomRequest { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseSpotPriceRequest(); + const message = createBaseListPoolsByDenomRequest(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.poolId = reader.uint64(); - break; - case 2: - message.baseAssetDenom = reader.string(); - break; - case 3: - message.quoteAssetDenom = reader.string(); + message.denom = reader.string(); break; default: reader.skipType(tag & 7); @@ -1453,34 +2449,256 @@ export const SpotPriceRequest = { } return message; }, - fromPartial(object: Partial): SpotPriceRequest { - const message = createBaseSpotPriceRequest(); - message.poolId = object.poolId !== undefined && object.poolId !== null ? BigInt(object.poolId.toString()) : BigInt(0); - message.baseAssetDenom = object.baseAssetDenom ?? ""; - message.quoteAssetDenom = object.quoteAssetDenom ?? ""; - return message; - }, - fromAmino(object: SpotPriceRequestAmino): SpotPriceRequest { + fromJSON(object: any): ListPoolsByDenomRequest { return { - poolId: BigInt(object.pool_id), - baseAssetDenom: object.base_asset_denom, - quoteAssetDenom: object.quote_asset_denom + denom: isSet(object.denom) ? String(object.denom) : "" }; }, - toAmino(message: SpotPriceRequest): SpotPriceRequestAmino { + toJSON(message: ListPoolsByDenomRequest): unknown { const obj: any = {}; - obj.pool_id = message.poolId ? message.poolId.toString() : undefined; - obj.base_asset_denom = message.baseAssetDenom; - obj.quote_asset_denom = message.quoteAssetDenom; + message.denom !== undefined && (obj.denom = message.denom); return obj; }, - fromAminoMsg(object: SpotPriceRequestAminoMsg): SpotPriceRequest { - return SpotPriceRequest.fromAmino(object.value); + fromPartial(object: Partial): ListPoolsByDenomRequest { + const message = createBaseListPoolsByDenomRequest(); + message.denom = object.denom ?? ""; + return message; }, - toAminoMsg(message: SpotPriceRequest): SpotPriceRequestAminoMsg { + fromAmino(object: ListPoolsByDenomRequestAmino): ListPoolsByDenomRequest { + const message = createBaseListPoolsByDenomRequest(); + if (object.denom !== undefined && object.denom !== null) { + message.denom = object.denom; + } + return message; + }, + toAmino(message: ListPoolsByDenomRequest): ListPoolsByDenomRequestAmino { + const obj: any = {}; + obj.denom = message.denom; + return obj; + }, + fromAminoMsg(object: ListPoolsByDenomRequestAminoMsg): ListPoolsByDenomRequest { + return ListPoolsByDenomRequest.fromAmino(object.value); + }, + toAminoMsg(message: ListPoolsByDenomRequest): ListPoolsByDenomRequestAminoMsg { return { - type: "osmosis/poolmanager/spot-price-request", - value: SpotPriceRequest.toAmino(message) + type: "osmosis/poolmanager/list-pools-by-denom-request", + value: ListPoolsByDenomRequest.toAmino(message) + }; + }, + fromProtoMsg(message: ListPoolsByDenomRequestProtoMsg): ListPoolsByDenomRequest { + return ListPoolsByDenomRequest.decode(message.value); + }, + toProto(message: ListPoolsByDenomRequest): Uint8Array { + return ListPoolsByDenomRequest.encode(message).finish(); + }, + toProtoMsg(message: ListPoolsByDenomRequest): ListPoolsByDenomRequestProtoMsg { + return { + typeUrl: "/osmosis.poolmanager.v1beta1.ListPoolsByDenomRequest", + value: ListPoolsByDenomRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(ListPoolsByDenomRequest.typeUrl, ListPoolsByDenomRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(ListPoolsByDenomRequest.aminoType, ListPoolsByDenomRequest.typeUrl); +function createBaseListPoolsByDenomResponse(): ListPoolsByDenomResponse { + return { + pools: [] + }; +} +export const ListPoolsByDenomResponse = { + typeUrl: "/osmosis.poolmanager.v1beta1.ListPoolsByDenomResponse", + aminoType: "osmosis/poolmanager/list-pools-by-denom-response", + is(o: any): o is ListPoolsByDenomResponse { + return o && (o.$typeUrl === ListPoolsByDenomResponse.typeUrl || Array.isArray(o.pools) && (!o.pools.length || Pool1.is(o.pools[0]) || CosmWasmPool.is(o.pools[0]) || Pool2.is(o.pools[0]) || Pool3.is(o.pools[0]) || Any.is(o.pools[0]))); + }, + isSDK(o: any): o is ListPoolsByDenomResponseSDKType { + return o && (o.$typeUrl === ListPoolsByDenomResponse.typeUrl || Array.isArray(o.pools) && (!o.pools.length || Pool1.isSDK(o.pools[0]) || CosmWasmPool.isSDK(o.pools[0]) || Pool2.isSDK(o.pools[0]) || Pool3.isSDK(o.pools[0]) || Any.isSDK(o.pools[0]))); + }, + isAmino(o: any): o is ListPoolsByDenomResponseAmino { + return o && (o.$typeUrl === ListPoolsByDenomResponse.typeUrl || Array.isArray(o.pools) && (!o.pools.length || Pool1.isAmino(o.pools[0]) || CosmWasmPool.isAmino(o.pools[0]) || Pool2.isAmino(o.pools[0]) || Pool3.isAmino(o.pools[0]) || Any.isAmino(o.pools[0]))); + }, + encode(message: ListPoolsByDenomResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.pools) { + Any.encode(GlobalDecoderRegistry.wrapAny(v!), writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): ListPoolsByDenomResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseListPoolsByDenomResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.pools.push(GlobalDecoderRegistry.unwrapAny(reader)); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): ListPoolsByDenomResponse { + return { + pools: Array.isArray(object?.pools) ? object.pools.map((e: any) => GlobalDecoderRegistry.fromJSON(e)) : [] + }; + }, + toJSON(message: ListPoolsByDenomResponse): unknown { + const obj: any = {}; + if (message.pools) { + obj.pools = message.pools.map(e => e ? GlobalDecoderRegistry.toJSON(e) : undefined); + } else { + obj.pools = []; + } + return obj; + }, + fromPartial(object: Partial): ListPoolsByDenomResponse { + const message = createBaseListPoolsByDenomResponse(); + message.pools = object.pools?.map(e => (Any.fromPartial(e) as any)) || []; + return message; + }, + fromAmino(object: ListPoolsByDenomResponseAmino): ListPoolsByDenomResponse { + const message = createBaseListPoolsByDenomResponse(); + message.pools = object.pools?.map(e => GlobalDecoderRegistry.fromAminoMsg(e)) || []; + return message; + }, + toAmino(message: ListPoolsByDenomResponse): ListPoolsByDenomResponseAmino { + const obj: any = {}; + if (message.pools) { + obj.pools = message.pools.map(e => e ? GlobalDecoderRegistry.toAminoMsg(e) : undefined); + } else { + obj.pools = []; + } + return obj; + }, + fromAminoMsg(object: ListPoolsByDenomResponseAminoMsg): ListPoolsByDenomResponse { + return ListPoolsByDenomResponse.fromAmino(object.value); + }, + toAminoMsg(message: ListPoolsByDenomResponse): ListPoolsByDenomResponseAminoMsg { + return { + type: "osmosis/poolmanager/list-pools-by-denom-response", + value: ListPoolsByDenomResponse.toAmino(message) + }; + }, + fromProtoMsg(message: ListPoolsByDenomResponseProtoMsg): ListPoolsByDenomResponse { + return ListPoolsByDenomResponse.decode(message.value); + }, + toProto(message: ListPoolsByDenomResponse): Uint8Array { + return ListPoolsByDenomResponse.encode(message).finish(); + }, + toProtoMsg(message: ListPoolsByDenomResponse): ListPoolsByDenomResponseProtoMsg { + return { + typeUrl: "/osmosis.poolmanager.v1beta1.ListPoolsByDenomResponse", + value: ListPoolsByDenomResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(ListPoolsByDenomResponse.typeUrl, ListPoolsByDenomResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(ListPoolsByDenomResponse.aminoType, ListPoolsByDenomResponse.typeUrl); +function createBaseSpotPriceRequest(): SpotPriceRequest { + return { + poolId: BigInt(0), + baseAssetDenom: "", + quoteAssetDenom: "" + }; +} +export const SpotPriceRequest = { + typeUrl: "/osmosis.poolmanager.v1beta1.SpotPriceRequest", + aminoType: "osmosis/poolmanager/spot-price-request", + is(o: any): o is SpotPriceRequest { + return o && (o.$typeUrl === SpotPriceRequest.typeUrl || typeof o.poolId === "bigint" && typeof o.baseAssetDenom === "string" && typeof o.quoteAssetDenom === "string"); + }, + isSDK(o: any): o is SpotPriceRequestSDKType { + return o && (o.$typeUrl === SpotPriceRequest.typeUrl || typeof o.pool_id === "bigint" && typeof o.base_asset_denom === "string" && typeof o.quote_asset_denom === "string"); + }, + isAmino(o: any): o is SpotPriceRequestAmino { + return o && (o.$typeUrl === SpotPriceRequest.typeUrl || typeof o.pool_id === "bigint" && typeof o.base_asset_denom === "string" && typeof o.quote_asset_denom === "string"); + }, + encode(message: SpotPriceRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.poolId !== BigInt(0)) { + writer.uint32(8).uint64(message.poolId); + } + if (message.baseAssetDenom !== "") { + writer.uint32(18).string(message.baseAssetDenom); + } + if (message.quoteAssetDenom !== "") { + writer.uint32(26).string(message.quoteAssetDenom); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): SpotPriceRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSpotPriceRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.poolId = reader.uint64(); + break; + case 2: + message.baseAssetDenom = reader.string(); + break; + case 3: + message.quoteAssetDenom = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): SpotPriceRequest { + return { + poolId: isSet(object.poolId) ? BigInt(object.poolId.toString()) : BigInt(0), + baseAssetDenom: isSet(object.baseAssetDenom) ? String(object.baseAssetDenom) : "", + quoteAssetDenom: isSet(object.quoteAssetDenom) ? String(object.quoteAssetDenom) : "" + }; + }, + toJSON(message: SpotPriceRequest): unknown { + const obj: any = {}; + message.poolId !== undefined && (obj.poolId = (message.poolId || BigInt(0)).toString()); + message.baseAssetDenom !== undefined && (obj.baseAssetDenom = message.baseAssetDenom); + message.quoteAssetDenom !== undefined && (obj.quoteAssetDenom = message.quoteAssetDenom); + return obj; + }, + fromPartial(object: Partial): SpotPriceRequest { + const message = createBaseSpotPriceRequest(); + message.poolId = object.poolId !== undefined && object.poolId !== null ? BigInt(object.poolId.toString()) : BigInt(0); + message.baseAssetDenom = object.baseAssetDenom ?? ""; + message.quoteAssetDenom = object.quoteAssetDenom ?? ""; + return message; + }, + fromAmino(object: SpotPriceRequestAmino): SpotPriceRequest { + const message = createBaseSpotPriceRequest(); + if (object.pool_id !== undefined && object.pool_id !== null) { + message.poolId = BigInt(object.pool_id); + } + if (object.base_asset_denom !== undefined && object.base_asset_denom !== null) { + message.baseAssetDenom = object.base_asset_denom; + } + if (object.quote_asset_denom !== undefined && object.quote_asset_denom !== null) { + message.quoteAssetDenom = object.quote_asset_denom; + } + return message; + }, + toAmino(message: SpotPriceRequest): SpotPriceRequestAmino { + const obj: any = {}; + obj.pool_id = message.poolId ? message.poolId.toString() : undefined; + obj.base_asset_denom = message.baseAssetDenom; + obj.quote_asset_denom = message.quoteAssetDenom; + return obj; + }, + fromAminoMsg(object: SpotPriceRequestAminoMsg): SpotPriceRequest { + return SpotPriceRequest.fromAmino(object.value); + }, + toAminoMsg(message: SpotPriceRequest): SpotPriceRequestAminoMsg { + return { + type: "osmosis/poolmanager/spot-price-request", + value: SpotPriceRequest.toAmino(message) }; }, fromProtoMsg(message: SpotPriceRequestProtoMsg): SpotPriceRequest { @@ -1496,6 +2714,8 @@ export const SpotPriceRequest = { }; } }; +GlobalDecoderRegistry.register(SpotPriceRequest.typeUrl, SpotPriceRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(SpotPriceRequest.aminoType, SpotPriceRequest.typeUrl); function createBaseSpotPriceResponse(): SpotPriceResponse { return { spotPrice: "" @@ -1503,6 +2723,16 @@ function createBaseSpotPriceResponse(): SpotPriceResponse { } export const SpotPriceResponse = { typeUrl: "/osmosis.poolmanager.v1beta1.SpotPriceResponse", + aminoType: "osmosis/poolmanager/spot-price-response", + is(o: any): o is SpotPriceResponse { + return o && (o.$typeUrl === SpotPriceResponse.typeUrl || typeof o.spotPrice === "string"); + }, + isSDK(o: any): o is SpotPriceResponseSDKType { + return o && (o.$typeUrl === SpotPriceResponse.typeUrl || typeof o.spot_price === "string"); + }, + isAmino(o: any): o is SpotPriceResponseAmino { + return o && (o.$typeUrl === SpotPriceResponse.typeUrl || typeof o.spot_price === "string"); + }, encode(message: SpotPriceResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.spotPrice !== "") { writer.uint32(10).string(message.spotPrice); @@ -1526,15 +2756,27 @@ export const SpotPriceResponse = { } return message; }, + fromJSON(object: any): SpotPriceResponse { + return { + spotPrice: isSet(object.spotPrice) ? String(object.spotPrice) : "" + }; + }, + toJSON(message: SpotPriceResponse): unknown { + const obj: any = {}; + message.spotPrice !== undefined && (obj.spotPrice = message.spotPrice); + return obj; + }, fromPartial(object: Partial): SpotPriceResponse { const message = createBaseSpotPriceResponse(); message.spotPrice = object.spotPrice ?? ""; return message; }, fromAmino(object: SpotPriceResponseAmino): SpotPriceResponse { - return { - spotPrice: object.spot_price - }; + const message = createBaseSpotPriceResponse(); + if (object.spot_price !== undefined && object.spot_price !== null) { + message.spotPrice = object.spot_price; + } + return message; }, toAmino(message: SpotPriceResponse): SpotPriceResponseAmino { const obj: any = {}; @@ -1563,6 +2805,8 @@ export const SpotPriceResponse = { }; } }; +GlobalDecoderRegistry.register(SpotPriceResponse.typeUrl, SpotPriceResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(SpotPriceResponse.aminoType, SpotPriceResponse.typeUrl); function createBaseTotalPoolLiquidityRequest(): TotalPoolLiquidityRequest { return { poolId: BigInt(0) @@ -1570,6 +2814,16 @@ function createBaseTotalPoolLiquidityRequest(): TotalPoolLiquidityRequest { } export const TotalPoolLiquidityRequest = { typeUrl: "/osmosis.poolmanager.v1beta1.TotalPoolLiquidityRequest", + aminoType: "osmosis/poolmanager/total-pool-liquidity-request", + is(o: any): o is TotalPoolLiquidityRequest { + return o && (o.$typeUrl === TotalPoolLiquidityRequest.typeUrl || typeof o.poolId === "bigint"); + }, + isSDK(o: any): o is TotalPoolLiquidityRequestSDKType { + return o && (o.$typeUrl === TotalPoolLiquidityRequest.typeUrl || typeof o.pool_id === "bigint"); + }, + isAmino(o: any): o is TotalPoolLiquidityRequestAmino { + return o && (o.$typeUrl === TotalPoolLiquidityRequest.typeUrl || typeof o.pool_id === "bigint"); + }, encode(message: TotalPoolLiquidityRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.poolId !== BigInt(0)) { writer.uint32(8).uint64(message.poolId); @@ -1593,15 +2847,27 @@ export const TotalPoolLiquidityRequest = { } return message; }, + fromJSON(object: any): TotalPoolLiquidityRequest { + return { + poolId: isSet(object.poolId) ? BigInt(object.poolId.toString()) : BigInt(0) + }; + }, + toJSON(message: TotalPoolLiquidityRequest): unknown { + const obj: any = {}; + message.poolId !== undefined && (obj.poolId = (message.poolId || BigInt(0)).toString()); + return obj; + }, fromPartial(object: Partial): TotalPoolLiquidityRequest { const message = createBaseTotalPoolLiquidityRequest(); message.poolId = object.poolId !== undefined && object.poolId !== null ? BigInt(object.poolId.toString()) : BigInt(0); return message; }, fromAmino(object: TotalPoolLiquidityRequestAmino): TotalPoolLiquidityRequest { - return { - poolId: BigInt(object.pool_id) - }; + const message = createBaseTotalPoolLiquidityRequest(); + if (object.pool_id !== undefined && object.pool_id !== null) { + message.poolId = BigInt(object.pool_id); + } + return message; }, toAmino(message: TotalPoolLiquidityRequest): TotalPoolLiquidityRequestAmino { const obj: any = {}; @@ -1630,6 +2896,8 @@ export const TotalPoolLiquidityRequest = { }; } }; +GlobalDecoderRegistry.register(TotalPoolLiquidityRequest.typeUrl, TotalPoolLiquidityRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(TotalPoolLiquidityRequest.aminoType, TotalPoolLiquidityRequest.typeUrl); function createBaseTotalPoolLiquidityResponse(): TotalPoolLiquidityResponse { return { liquidity: [] @@ -1637,6 +2905,16 @@ function createBaseTotalPoolLiquidityResponse(): TotalPoolLiquidityResponse { } export const TotalPoolLiquidityResponse = { typeUrl: "/osmosis.poolmanager.v1beta1.TotalPoolLiquidityResponse", + aminoType: "osmosis/poolmanager/total-pool-liquidity-response", + is(o: any): o is TotalPoolLiquidityResponse { + return o && (o.$typeUrl === TotalPoolLiquidityResponse.typeUrl || Array.isArray(o.liquidity) && (!o.liquidity.length || Coin.is(o.liquidity[0]))); + }, + isSDK(o: any): o is TotalPoolLiquidityResponseSDKType { + return o && (o.$typeUrl === TotalPoolLiquidityResponse.typeUrl || Array.isArray(o.liquidity) && (!o.liquidity.length || Coin.isSDK(o.liquidity[0]))); + }, + isAmino(o: any): o is TotalPoolLiquidityResponseAmino { + return o && (o.$typeUrl === TotalPoolLiquidityResponse.typeUrl || Array.isArray(o.liquidity) && (!o.liquidity.length || Coin.isAmino(o.liquidity[0]))); + }, encode(message: TotalPoolLiquidityResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.liquidity) { Coin.encode(v!, writer.uint32(10).fork()).ldelim(); @@ -1660,15 +2938,29 @@ export const TotalPoolLiquidityResponse = { } return message; }, + fromJSON(object: any): TotalPoolLiquidityResponse { + return { + liquidity: Array.isArray(object?.liquidity) ? object.liquidity.map((e: any) => Coin.fromJSON(e)) : [] + }; + }, + toJSON(message: TotalPoolLiquidityResponse): unknown { + const obj: any = {}; + if (message.liquidity) { + obj.liquidity = message.liquidity.map(e => e ? Coin.toJSON(e) : undefined); + } else { + obj.liquidity = []; + } + return obj; + }, fromPartial(object: Partial): TotalPoolLiquidityResponse { const message = createBaseTotalPoolLiquidityResponse(); message.liquidity = object.liquidity?.map(e => Coin.fromPartial(e)) || []; return message; }, fromAmino(object: TotalPoolLiquidityResponseAmino): TotalPoolLiquidityResponse { - return { - liquidity: Array.isArray(object?.liquidity) ? object.liquidity.map((e: any) => Coin.fromAmino(e)) : [] - }; + const message = createBaseTotalPoolLiquidityResponse(); + message.liquidity = object.liquidity?.map(e => Coin.fromAmino(e)) || []; + return message; }, toAmino(message: TotalPoolLiquidityResponse): TotalPoolLiquidityResponseAmino { const obj: any = {}; @@ -1701,11 +2993,23 @@ export const TotalPoolLiquidityResponse = { }; } }; +GlobalDecoderRegistry.register(TotalPoolLiquidityResponse.typeUrl, TotalPoolLiquidityResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(TotalPoolLiquidityResponse.aminoType, TotalPoolLiquidityResponse.typeUrl); function createBaseTotalLiquidityRequest(): TotalLiquidityRequest { return {}; } export const TotalLiquidityRequest = { typeUrl: "/osmosis.poolmanager.v1beta1.TotalLiquidityRequest", + aminoType: "osmosis/poolmanager/total-liquidity-request", + is(o: any): o is TotalLiquidityRequest { + return o && o.$typeUrl === TotalLiquidityRequest.typeUrl; + }, + isSDK(o: any): o is TotalLiquidityRequestSDKType { + return o && o.$typeUrl === TotalLiquidityRequest.typeUrl; + }, + isAmino(o: any): o is TotalLiquidityRequestAmino { + return o && o.$typeUrl === TotalLiquidityRequest.typeUrl; + }, encode(_: TotalLiquidityRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, @@ -1723,12 +3027,20 @@ export const TotalLiquidityRequest = { } return message; }, + fromJSON(_: any): TotalLiquidityRequest { + return {}; + }, + toJSON(_: TotalLiquidityRequest): unknown { + const obj: any = {}; + return obj; + }, fromPartial(_: Partial): TotalLiquidityRequest { const message = createBaseTotalLiquidityRequest(); return message; }, fromAmino(_: TotalLiquidityRequestAmino): TotalLiquidityRequest { - return {}; + const message = createBaseTotalLiquidityRequest(); + return message; }, toAmino(_: TotalLiquidityRequest): TotalLiquidityRequestAmino { const obj: any = {}; @@ -1756,6 +3068,8 @@ export const TotalLiquidityRequest = { }; } }; +GlobalDecoderRegistry.register(TotalLiquidityRequest.typeUrl, TotalLiquidityRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(TotalLiquidityRequest.aminoType, TotalLiquidityRequest.typeUrl); function createBaseTotalLiquidityResponse(): TotalLiquidityResponse { return { liquidity: [] @@ -1763,6 +3077,16 @@ function createBaseTotalLiquidityResponse(): TotalLiquidityResponse { } export const TotalLiquidityResponse = { typeUrl: "/osmosis.poolmanager.v1beta1.TotalLiquidityResponse", + aminoType: "osmosis/poolmanager/total-liquidity-response", + is(o: any): o is TotalLiquidityResponse { + return o && (o.$typeUrl === TotalLiquidityResponse.typeUrl || Array.isArray(o.liquidity) && (!o.liquidity.length || Coin.is(o.liquidity[0]))); + }, + isSDK(o: any): o is TotalLiquidityResponseSDKType { + return o && (o.$typeUrl === TotalLiquidityResponse.typeUrl || Array.isArray(o.liquidity) && (!o.liquidity.length || Coin.isSDK(o.liquidity[0]))); + }, + isAmino(o: any): o is TotalLiquidityResponseAmino { + return o && (o.$typeUrl === TotalLiquidityResponse.typeUrl || Array.isArray(o.liquidity) && (!o.liquidity.length || Coin.isAmino(o.liquidity[0]))); + }, encode(message: TotalLiquidityResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.liquidity) { Coin.encode(v!, writer.uint32(10).fork()).ldelim(); @@ -1786,15 +3110,29 @@ export const TotalLiquidityResponse = { } return message; }, + fromJSON(object: any): TotalLiquidityResponse { + return { + liquidity: Array.isArray(object?.liquidity) ? object.liquidity.map((e: any) => Coin.fromJSON(e)) : [] + }; + }, + toJSON(message: TotalLiquidityResponse): unknown { + const obj: any = {}; + if (message.liquidity) { + obj.liquidity = message.liquidity.map(e => e ? Coin.toJSON(e) : undefined); + } else { + obj.liquidity = []; + } + return obj; + }, fromPartial(object: Partial): TotalLiquidityResponse { const message = createBaseTotalLiquidityResponse(); message.liquidity = object.liquidity?.map(e => Coin.fromPartial(e)) || []; return message; }, fromAmino(object: TotalLiquidityResponseAmino): TotalLiquidityResponse { - return { - liquidity: Array.isArray(object?.liquidity) ? object.liquidity.map((e: any) => Coin.fromAmino(e)) : [] - }; + const message = createBaseTotalLiquidityResponse(); + message.liquidity = object.liquidity?.map(e => Coin.fromAmino(e)) || []; + return message; }, toAmino(message: TotalLiquidityResponse): TotalLiquidityResponseAmino { const obj: any = {}; @@ -1827,71 +3165,641 @@ export const TotalLiquidityResponse = { }; } }; -export const PoolI_InterfaceDecoder = (input: BinaryReader | Uint8Array): Pool1 | CosmWasmPool | Pool2 | Pool3 | Any => { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - const data = Any.decode(reader, reader.uint32()); - switch (data.typeUrl) { - case "/osmosis.concentratedliquidity.v1beta1.Pool": - return Pool1.decode(data.value); - case "/osmosis.cosmwasmpool.v1beta1.CosmWasmPool": - return CosmWasmPool.decode(data.value); - case "/osmosis.gamm.v1beta1.Pool": - return Pool2.decode(data.value); - case "/osmosis.gamm.poolmodels.stableswap.v1beta1.Pool": - return Pool3.decode(data.value); - default: - return data; - } -}; -export const PoolI_FromAmino = (content: AnyAmino) => { - switch (content.type) { - case "osmosis/concentratedliquidity/pool": - return Any.fromPartial({ - typeUrl: "/osmosis.concentratedliquidity.v1beta1.Pool", - value: Pool1.encode(Pool1.fromPartial(Pool1.fromAmino(content.value))).finish() - }); - case "osmosis/cosmwasmpool/cosm-wasm-pool": - return Any.fromPartial({ - typeUrl: "/osmosis.cosmwasmpool.v1beta1.CosmWasmPool", - value: CosmWasmPool.encode(CosmWasmPool.fromPartial(CosmWasmPool.fromAmino(content.value))).finish() - }); - case "osmosis/gamm/BalancerPool": - return Any.fromPartial({ - typeUrl: "/osmosis.gamm.v1beta1.Pool", - value: Pool2.encode(Pool2.fromPartial(Pool2.fromAmino(content.value))).finish() - }); - case "osmosis/gamm/StableswapPool": - return Any.fromPartial({ - typeUrl: "/osmosis.gamm.poolmodels.stableswap.v1beta1.Pool", - value: Pool3.encode(Pool3.fromPartial(Pool3.fromAmino(content.value))).finish() - }); - default: - return Any.fromAmino(content); - } -}; -export const PoolI_ToAmino = (content: Any) => { - switch (content.typeUrl) { - case "/osmosis.concentratedliquidity.v1beta1.Pool": - return { - type: "osmosis/concentratedliquidity/pool", - value: Pool1.toAmino(Pool1.decode(content.value)) - }; - case "/osmosis.cosmwasmpool.v1beta1.CosmWasmPool": - return { - type: "osmosis/cosmwasmpool/cosm-wasm-pool", - value: CosmWasmPool.toAmino(CosmWasmPool.decode(content.value)) - }; - case "/osmosis.gamm.v1beta1.Pool": - return { - type: "osmosis/gamm/BalancerPool", - value: Pool2.toAmino(Pool2.decode(content.value)) - }; - case "/osmosis.gamm.poolmodels.stableswap.v1beta1.Pool": - return { - type: "osmosis/gamm/StableswapPool", - value: Pool3.toAmino(Pool3.decode(content.value)) - }; - default: - return Any.toAmino(content); - } -}; \ No newline at end of file +GlobalDecoderRegistry.register(TotalLiquidityResponse.typeUrl, TotalLiquidityResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(TotalLiquidityResponse.aminoType, TotalLiquidityResponse.typeUrl); +function createBaseTotalVolumeForPoolRequest(): TotalVolumeForPoolRequest { + return { + poolId: BigInt(0) + }; +} +export const TotalVolumeForPoolRequest = { + typeUrl: "/osmosis.poolmanager.v1beta1.TotalVolumeForPoolRequest", + aminoType: "osmosis/poolmanager/total-volume-for-pool-request", + is(o: any): o is TotalVolumeForPoolRequest { + return o && (o.$typeUrl === TotalVolumeForPoolRequest.typeUrl || typeof o.poolId === "bigint"); + }, + isSDK(o: any): o is TotalVolumeForPoolRequestSDKType { + return o && (o.$typeUrl === TotalVolumeForPoolRequest.typeUrl || typeof o.pool_id === "bigint"); + }, + isAmino(o: any): o is TotalVolumeForPoolRequestAmino { + return o && (o.$typeUrl === TotalVolumeForPoolRequest.typeUrl || typeof o.pool_id === "bigint"); + }, + encode(message: TotalVolumeForPoolRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.poolId !== BigInt(0)) { + writer.uint32(8).uint64(message.poolId); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): TotalVolumeForPoolRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseTotalVolumeForPoolRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.poolId = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): TotalVolumeForPoolRequest { + return { + poolId: isSet(object.poolId) ? BigInt(object.poolId.toString()) : BigInt(0) + }; + }, + toJSON(message: TotalVolumeForPoolRequest): unknown { + const obj: any = {}; + message.poolId !== undefined && (obj.poolId = (message.poolId || BigInt(0)).toString()); + return obj; + }, + fromPartial(object: Partial): TotalVolumeForPoolRequest { + const message = createBaseTotalVolumeForPoolRequest(); + message.poolId = object.poolId !== undefined && object.poolId !== null ? BigInt(object.poolId.toString()) : BigInt(0); + return message; + }, + fromAmino(object: TotalVolumeForPoolRequestAmino): TotalVolumeForPoolRequest { + const message = createBaseTotalVolumeForPoolRequest(); + if (object.pool_id !== undefined && object.pool_id !== null) { + message.poolId = BigInt(object.pool_id); + } + return message; + }, + toAmino(message: TotalVolumeForPoolRequest): TotalVolumeForPoolRequestAmino { + const obj: any = {}; + obj.pool_id = message.poolId ? message.poolId.toString() : undefined; + return obj; + }, + fromAminoMsg(object: TotalVolumeForPoolRequestAminoMsg): TotalVolumeForPoolRequest { + return TotalVolumeForPoolRequest.fromAmino(object.value); + }, + toAminoMsg(message: TotalVolumeForPoolRequest): TotalVolumeForPoolRequestAminoMsg { + return { + type: "osmosis/poolmanager/total-volume-for-pool-request", + value: TotalVolumeForPoolRequest.toAmino(message) + }; + }, + fromProtoMsg(message: TotalVolumeForPoolRequestProtoMsg): TotalVolumeForPoolRequest { + return TotalVolumeForPoolRequest.decode(message.value); + }, + toProto(message: TotalVolumeForPoolRequest): Uint8Array { + return TotalVolumeForPoolRequest.encode(message).finish(); + }, + toProtoMsg(message: TotalVolumeForPoolRequest): TotalVolumeForPoolRequestProtoMsg { + return { + typeUrl: "/osmosis.poolmanager.v1beta1.TotalVolumeForPoolRequest", + value: TotalVolumeForPoolRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(TotalVolumeForPoolRequest.typeUrl, TotalVolumeForPoolRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(TotalVolumeForPoolRequest.aminoType, TotalVolumeForPoolRequest.typeUrl); +function createBaseTotalVolumeForPoolResponse(): TotalVolumeForPoolResponse { + return { + volume: [] + }; +} +export const TotalVolumeForPoolResponse = { + typeUrl: "/osmosis.poolmanager.v1beta1.TotalVolumeForPoolResponse", + aminoType: "osmosis/poolmanager/total-volume-for-pool-response", + is(o: any): o is TotalVolumeForPoolResponse { + return o && (o.$typeUrl === TotalVolumeForPoolResponse.typeUrl || Array.isArray(o.volume) && (!o.volume.length || Coin.is(o.volume[0]))); + }, + isSDK(o: any): o is TotalVolumeForPoolResponseSDKType { + return o && (o.$typeUrl === TotalVolumeForPoolResponse.typeUrl || Array.isArray(o.volume) && (!o.volume.length || Coin.isSDK(o.volume[0]))); + }, + isAmino(o: any): o is TotalVolumeForPoolResponseAmino { + return o && (o.$typeUrl === TotalVolumeForPoolResponse.typeUrl || Array.isArray(o.volume) && (!o.volume.length || Coin.isAmino(o.volume[0]))); + }, + encode(message: TotalVolumeForPoolResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.volume) { + Coin.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): TotalVolumeForPoolResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseTotalVolumeForPoolResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.volume.push(Coin.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): TotalVolumeForPoolResponse { + return { + volume: Array.isArray(object?.volume) ? object.volume.map((e: any) => Coin.fromJSON(e)) : [] + }; + }, + toJSON(message: TotalVolumeForPoolResponse): unknown { + const obj: any = {}; + if (message.volume) { + obj.volume = message.volume.map(e => e ? Coin.toJSON(e) : undefined); + } else { + obj.volume = []; + } + return obj; + }, + fromPartial(object: Partial): TotalVolumeForPoolResponse { + const message = createBaseTotalVolumeForPoolResponse(); + message.volume = object.volume?.map(e => Coin.fromPartial(e)) || []; + return message; + }, + fromAmino(object: TotalVolumeForPoolResponseAmino): TotalVolumeForPoolResponse { + const message = createBaseTotalVolumeForPoolResponse(); + message.volume = object.volume?.map(e => Coin.fromAmino(e)) || []; + return message; + }, + toAmino(message: TotalVolumeForPoolResponse): TotalVolumeForPoolResponseAmino { + const obj: any = {}; + if (message.volume) { + obj.volume = message.volume.map(e => e ? Coin.toAmino(e) : undefined); + } else { + obj.volume = []; + } + return obj; + }, + fromAminoMsg(object: TotalVolumeForPoolResponseAminoMsg): TotalVolumeForPoolResponse { + return TotalVolumeForPoolResponse.fromAmino(object.value); + }, + toAminoMsg(message: TotalVolumeForPoolResponse): TotalVolumeForPoolResponseAminoMsg { + return { + type: "osmosis/poolmanager/total-volume-for-pool-response", + value: TotalVolumeForPoolResponse.toAmino(message) + }; + }, + fromProtoMsg(message: TotalVolumeForPoolResponseProtoMsg): TotalVolumeForPoolResponse { + return TotalVolumeForPoolResponse.decode(message.value); + }, + toProto(message: TotalVolumeForPoolResponse): Uint8Array { + return TotalVolumeForPoolResponse.encode(message).finish(); + }, + toProtoMsg(message: TotalVolumeForPoolResponse): TotalVolumeForPoolResponseProtoMsg { + return { + typeUrl: "/osmosis.poolmanager.v1beta1.TotalVolumeForPoolResponse", + value: TotalVolumeForPoolResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(TotalVolumeForPoolResponse.typeUrl, TotalVolumeForPoolResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(TotalVolumeForPoolResponse.aminoType, TotalVolumeForPoolResponse.typeUrl); +function createBaseTradingPairTakerFeeRequest(): TradingPairTakerFeeRequest { + return { + denom0: "", + denom1: "" + }; +} +export const TradingPairTakerFeeRequest = { + typeUrl: "/osmosis.poolmanager.v1beta1.TradingPairTakerFeeRequest", + aminoType: "osmosis/poolmanager/trading-pair-taker-fee-request", + is(o: any): o is TradingPairTakerFeeRequest { + return o && (o.$typeUrl === TradingPairTakerFeeRequest.typeUrl || typeof o.denom0 === "string" && typeof o.denom1 === "string"); + }, + isSDK(o: any): o is TradingPairTakerFeeRequestSDKType { + return o && (o.$typeUrl === TradingPairTakerFeeRequest.typeUrl || typeof o.denom_0 === "string" && typeof o.denom_1 === "string"); + }, + isAmino(o: any): o is TradingPairTakerFeeRequestAmino { + return o && (o.$typeUrl === TradingPairTakerFeeRequest.typeUrl || typeof o.denom_0 === "string" && typeof o.denom_1 === "string"); + }, + encode(message: TradingPairTakerFeeRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.denom0 !== "") { + writer.uint32(10).string(message.denom0); + } + if (message.denom1 !== "") { + writer.uint32(18).string(message.denom1); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): TradingPairTakerFeeRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseTradingPairTakerFeeRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.denom0 = reader.string(); + break; + case 2: + message.denom1 = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): TradingPairTakerFeeRequest { + return { + denom0: isSet(object.denom0) ? String(object.denom0) : "", + denom1: isSet(object.denom1) ? String(object.denom1) : "" + }; + }, + toJSON(message: TradingPairTakerFeeRequest): unknown { + const obj: any = {}; + message.denom0 !== undefined && (obj.denom0 = message.denom0); + message.denom1 !== undefined && (obj.denom1 = message.denom1); + return obj; + }, + fromPartial(object: Partial): TradingPairTakerFeeRequest { + const message = createBaseTradingPairTakerFeeRequest(); + message.denom0 = object.denom0 ?? ""; + message.denom1 = object.denom1 ?? ""; + return message; + }, + fromAmino(object: TradingPairTakerFeeRequestAmino): TradingPairTakerFeeRequest { + const message = createBaseTradingPairTakerFeeRequest(); + if (object.denom_0 !== undefined && object.denom_0 !== null) { + message.denom0 = object.denom_0; + } + if (object.denom_1 !== undefined && object.denom_1 !== null) { + message.denom1 = object.denom_1; + } + return message; + }, + toAmino(message: TradingPairTakerFeeRequest): TradingPairTakerFeeRequestAmino { + const obj: any = {}; + obj.denom_0 = message.denom0; + obj.denom_1 = message.denom1; + return obj; + }, + fromAminoMsg(object: TradingPairTakerFeeRequestAminoMsg): TradingPairTakerFeeRequest { + return TradingPairTakerFeeRequest.fromAmino(object.value); + }, + toAminoMsg(message: TradingPairTakerFeeRequest): TradingPairTakerFeeRequestAminoMsg { + return { + type: "osmosis/poolmanager/trading-pair-taker-fee-request", + value: TradingPairTakerFeeRequest.toAmino(message) + }; + }, + fromProtoMsg(message: TradingPairTakerFeeRequestProtoMsg): TradingPairTakerFeeRequest { + return TradingPairTakerFeeRequest.decode(message.value); + }, + toProto(message: TradingPairTakerFeeRequest): Uint8Array { + return TradingPairTakerFeeRequest.encode(message).finish(); + }, + toProtoMsg(message: TradingPairTakerFeeRequest): TradingPairTakerFeeRequestProtoMsg { + return { + typeUrl: "/osmosis.poolmanager.v1beta1.TradingPairTakerFeeRequest", + value: TradingPairTakerFeeRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(TradingPairTakerFeeRequest.typeUrl, TradingPairTakerFeeRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(TradingPairTakerFeeRequest.aminoType, TradingPairTakerFeeRequest.typeUrl); +function createBaseTradingPairTakerFeeResponse(): TradingPairTakerFeeResponse { + return { + takerFee: "" + }; +} +export const TradingPairTakerFeeResponse = { + typeUrl: "/osmosis.poolmanager.v1beta1.TradingPairTakerFeeResponse", + aminoType: "osmosis/poolmanager/trading-pair-taker-fee-response", + is(o: any): o is TradingPairTakerFeeResponse { + return o && (o.$typeUrl === TradingPairTakerFeeResponse.typeUrl || typeof o.takerFee === "string"); + }, + isSDK(o: any): o is TradingPairTakerFeeResponseSDKType { + return o && (o.$typeUrl === TradingPairTakerFeeResponse.typeUrl || typeof o.taker_fee === "string"); + }, + isAmino(o: any): o is TradingPairTakerFeeResponseAmino { + return o && (o.$typeUrl === TradingPairTakerFeeResponse.typeUrl || typeof o.taker_fee === "string"); + }, + encode(message: TradingPairTakerFeeResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.takerFee !== "") { + writer.uint32(10).string(Decimal.fromUserInput(message.takerFee, 18).atomics); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): TradingPairTakerFeeResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseTradingPairTakerFeeResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.takerFee = Decimal.fromAtomics(reader.string(), 18).toString(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): TradingPairTakerFeeResponse { + return { + takerFee: isSet(object.takerFee) ? String(object.takerFee) : "" + }; + }, + toJSON(message: TradingPairTakerFeeResponse): unknown { + const obj: any = {}; + message.takerFee !== undefined && (obj.takerFee = message.takerFee); + return obj; + }, + fromPartial(object: Partial): TradingPairTakerFeeResponse { + const message = createBaseTradingPairTakerFeeResponse(); + message.takerFee = object.takerFee ?? ""; + return message; + }, + fromAmino(object: TradingPairTakerFeeResponseAmino): TradingPairTakerFeeResponse { + const message = createBaseTradingPairTakerFeeResponse(); + if (object.taker_fee !== undefined && object.taker_fee !== null) { + message.takerFee = object.taker_fee; + } + return message; + }, + toAmino(message: TradingPairTakerFeeResponse): TradingPairTakerFeeResponseAmino { + const obj: any = {}; + obj.taker_fee = message.takerFee; + return obj; + }, + fromAminoMsg(object: TradingPairTakerFeeResponseAminoMsg): TradingPairTakerFeeResponse { + return TradingPairTakerFeeResponse.fromAmino(object.value); + }, + toAminoMsg(message: TradingPairTakerFeeResponse): TradingPairTakerFeeResponseAminoMsg { + return { + type: "osmosis/poolmanager/trading-pair-taker-fee-response", + value: TradingPairTakerFeeResponse.toAmino(message) + }; + }, + fromProtoMsg(message: TradingPairTakerFeeResponseProtoMsg): TradingPairTakerFeeResponse { + return TradingPairTakerFeeResponse.decode(message.value); + }, + toProto(message: TradingPairTakerFeeResponse): Uint8Array { + return TradingPairTakerFeeResponse.encode(message).finish(); + }, + toProtoMsg(message: TradingPairTakerFeeResponse): TradingPairTakerFeeResponseProtoMsg { + return { + typeUrl: "/osmosis.poolmanager.v1beta1.TradingPairTakerFeeResponse", + value: TradingPairTakerFeeResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(TradingPairTakerFeeResponse.typeUrl, TradingPairTakerFeeResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(TradingPairTakerFeeResponse.aminoType, TradingPairTakerFeeResponse.typeUrl); +function createBaseEstimateTradeBasedOnPriceImpactRequest(): EstimateTradeBasedOnPriceImpactRequest { + return { + fromCoin: Coin.fromPartial({}), + toCoinDenom: "", + poolId: BigInt(0), + maxPriceImpact: "", + externalPrice: "" + }; +} +export const EstimateTradeBasedOnPriceImpactRequest = { + typeUrl: "/osmosis.poolmanager.v1beta1.EstimateTradeBasedOnPriceImpactRequest", + aminoType: "osmosis/poolmanager/estimate-trade-based-on-price-impact-request", + is(o: any): o is EstimateTradeBasedOnPriceImpactRequest { + return o && (o.$typeUrl === EstimateTradeBasedOnPriceImpactRequest.typeUrl || Coin.is(o.fromCoin) && typeof o.toCoinDenom === "string" && typeof o.poolId === "bigint" && typeof o.maxPriceImpact === "string" && typeof o.externalPrice === "string"); + }, + isSDK(o: any): o is EstimateTradeBasedOnPriceImpactRequestSDKType { + return o && (o.$typeUrl === EstimateTradeBasedOnPriceImpactRequest.typeUrl || Coin.isSDK(o.from_coin) && typeof o.to_coin_denom === "string" && typeof o.pool_id === "bigint" && typeof o.max_price_impact === "string" && typeof o.external_price === "string"); + }, + isAmino(o: any): o is EstimateTradeBasedOnPriceImpactRequestAmino { + return o && (o.$typeUrl === EstimateTradeBasedOnPriceImpactRequest.typeUrl || Coin.isAmino(o.from_coin) && typeof o.to_coin_denom === "string" && typeof o.pool_id === "bigint" && typeof o.max_price_impact === "string" && typeof o.external_price === "string"); + }, + encode(message: EstimateTradeBasedOnPriceImpactRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.fromCoin !== undefined) { + Coin.encode(message.fromCoin, writer.uint32(10).fork()).ldelim(); + } + if (message.toCoinDenom !== "") { + writer.uint32(18).string(message.toCoinDenom); + } + if (message.poolId !== BigInt(0)) { + writer.uint32(24).uint64(message.poolId); + } + if (message.maxPriceImpact !== "") { + writer.uint32(34).string(Decimal.fromUserInput(message.maxPriceImpact, 18).atomics); + } + if (message.externalPrice !== "") { + writer.uint32(42).string(Decimal.fromUserInput(message.externalPrice, 18).atomics); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): EstimateTradeBasedOnPriceImpactRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseEstimateTradeBasedOnPriceImpactRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.fromCoin = Coin.decode(reader, reader.uint32()); + break; + case 2: + message.toCoinDenom = reader.string(); + break; + case 3: + message.poolId = reader.uint64(); + break; + case 4: + message.maxPriceImpact = Decimal.fromAtomics(reader.string(), 18).toString(); + break; + case 5: + message.externalPrice = Decimal.fromAtomics(reader.string(), 18).toString(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): EstimateTradeBasedOnPriceImpactRequest { + return { + fromCoin: isSet(object.fromCoin) ? Coin.fromJSON(object.fromCoin) : undefined, + toCoinDenom: isSet(object.toCoinDenom) ? String(object.toCoinDenom) : "", + poolId: isSet(object.poolId) ? BigInt(object.poolId.toString()) : BigInt(0), + maxPriceImpact: isSet(object.maxPriceImpact) ? String(object.maxPriceImpact) : "", + externalPrice: isSet(object.externalPrice) ? String(object.externalPrice) : "" + }; + }, + toJSON(message: EstimateTradeBasedOnPriceImpactRequest): unknown { + const obj: any = {}; + message.fromCoin !== undefined && (obj.fromCoin = message.fromCoin ? Coin.toJSON(message.fromCoin) : undefined); + message.toCoinDenom !== undefined && (obj.toCoinDenom = message.toCoinDenom); + message.poolId !== undefined && (obj.poolId = (message.poolId || BigInt(0)).toString()); + message.maxPriceImpact !== undefined && (obj.maxPriceImpact = message.maxPriceImpact); + message.externalPrice !== undefined && (obj.externalPrice = message.externalPrice); + return obj; + }, + fromPartial(object: Partial): EstimateTradeBasedOnPriceImpactRequest { + const message = createBaseEstimateTradeBasedOnPriceImpactRequest(); + message.fromCoin = object.fromCoin !== undefined && object.fromCoin !== null ? Coin.fromPartial(object.fromCoin) : undefined; + message.toCoinDenom = object.toCoinDenom ?? ""; + message.poolId = object.poolId !== undefined && object.poolId !== null ? BigInt(object.poolId.toString()) : BigInt(0); + message.maxPriceImpact = object.maxPriceImpact ?? ""; + message.externalPrice = object.externalPrice ?? ""; + return message; + }, + fromAmino(object: EstimateTradeBasedOnPriceImpactRequestAmino): EstimateTradeBasedOnPriceImpactRequest { + const message = createBaseEstimateTradeBasedOnPriceImpactRequest(); + if (object.from_coin !== undefined && object.from_coin !== null) { + message.fromCoin = Coin.fromAmino(object.from_coin); + } + if (object.to_coin_denom !== undefined && object.to_coin_denom !== null) { + message.toCoinDenom = object.to_coin_denom; + } + if (object.pool_id !== undefined && object.pool_id !== null) { + message.poolId = BigInt(object.pool_id); + } + if (object.max_price_impact !== undefined && object.max_price_impact !== null) { + message.maxPriceImpact = object.max_price_impact; + } + if (object.external_price !== undefined && object.external_price !== null) { + message.externalPrice = object.external_price; + } + return message; + }, + toAmino(message: EstimateTradeBasedOnPriceImpactRequest): EstimateTradeBasedOnPriceImpactRequestAmino { + const obj: any = {}; + obj.from_coin = message.fromCoin ? Coin.toAmino(message.fromCoin) : undefined; + obj.to_coin_denom = message.toCoinDenom; + obj.pool_id = message.poolId ? message.poolId.toString() : undefined; + obj.max_price_impact = message.maxPriceImpact; + obj.external_price = message.externalPrice; + return obj; + }, + fromAminoMsg(object: EstimateTradeBasedOnPriceImpactRequestAminoMsg): EstimateTradeBasedOnPriceImpactRequest { + return EstimateTradeBasedOnPriceImpactRequest.fromAmino(object.value); + }, + toAminoMsg(message: EstimateTradeBasedOnPriceImpactRequest): EstimateTradeBasedOnPriceImpactRequestAminoMsg { + return { + type: "osmosis/poolmanager/estimate-trade-based-on-price-impact-request", + value: EstimateTradeBasedOnPriceImpactRequest.toAmino(message) + }; + }, + fromProtoMsg(message: EstimateTradeBasedOnPriceImpactRequestProtoMsg): EstimateTradeBasedOnPriceImpactRequest { + return EstimateTradeBasedOnPriceImpactRequest.decode(message.value); + }, + toProto(message: EstimateTradeBasedOnPriceImpactRequest): Uint8Array { + return EstimateTradeBasedOnPriceImpactRequest.encode(message).finish(); + }, + toProtoMsg(message: EstimateTradeBasedOnPriceImpactRequest): EstimateTradeBasedOnPriceImpactRequestProtoMsg { + return { + typeUrl: "/osmosis.poolmanager.v1beta1.EstimateTradeBasedOnPriceImpactRequest", + value: EstimateTradeBasedOnPriceImpactRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(EstimateTradeBasedOnPriceImpactRequest.typeUrl, EstimateTradeBasedOnPriceImpactRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(EstimateTradeBasedOnPriceImpactRequest.aminoType, EstimateTradeBasedOnPriceImpactRequest.typeUrl); +function createBaseEstimateTradeBasedOnPriceImpactResponse(): EstimateTradeBasedOnPriceImpactResponse { + return { + inputCoin: Coin.fromPartial({}), + outputCoin: Coin.fromPartial({}) + }; +} +export const EstimateTradeBasedOnPriceImpactResponse = { + typeUrl: "/osmosis.poolmanager.v1beta1.EstimateTradeBasedOnPriceImpactResponse", + aminoType: "osmosis/poolmanager/estimate-trade-based-on-price-impact-response", + is(o: any): o is EstimateTradeBasedOnPriceImpactResponse { + return o && (o.$typeUrl === EstimateTradeBasedOnPriceImpactResponse.typeUrl || Coin.is(o.inputCoin) && Coin.is(o.outputCoin)); + }, + isSDK(o: any): o is EstimateTradeBasedOnPriceImpactResponseSDKType { + return o && (o.$typeUrl === EstimateTradeBasedOnPriceImpactResponse.typeUrl || Coin.isSDK(o.input_coin) && Coin.isSDK(o.output_coin)); + }, + isAmino(o: any): o is EstimateTradeBasedOnPriceImpactResponseAmino { + return o && (o.$typeUrl === EstimateTradeBasedOnPriceImpactResponse.typeUrl || Coin.isAmino(o.input_coin) && Coin.isAmino(o.output_coin)); + }, + encode(message: EstimateTradeBasedOnPriceImpactResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.inputCoin !== undefined) { + Coin.encode(message.inputCoin, writer.uint32(10).fork()).ldelim(); + } + if (message.outputCoin !== undefined) { + Coin.encode(message.outputCoin, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): EstimateTradeBasedOnPriceImpactResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseEstimateTradeBasedOnPriceImpactResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.inputCoin = Coin.decode(reader, reader.uint32()); + break; + case 2: + message.outputCoin = Coin.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): EstimateTradeBasedOnPriceImpactResponse { + return { + inputCoin: isSet(object.inputCoin) ? Coin.fromJSON(object.inputCoin) : undefined, + outputCoin: isSet(object.outputCoin) ? Coin.fromJSON(object.outputCoin) : undefined + }; + }, + toJSON(message: EstimateTradeBasedOnPriceImpactResponse): unknown { + const obj: any = {}; + message.inputCoin !== undefined && (obj.inputCoin = message.inputCoin ? Coin.toJSON(message.inputCoin) : undefined); + message.outputCoin !== undefined && (obj.outputCoin = message.outputCoin ? Coin.toJSON(message.outputCoin) : undefined); + return obj; + }, + fromPartial(object: Partial): EstimateTradeBasedOnPriceImpactResponse { + const message = createBaseEstimateTradeBasedOnPriceImpactResponse(); + message.inputCoin = object.inputCoin !== undefined && object.inputCoin !== null ? Coin.fromPartial(object.inputCoin) : undefined; + message.outputCoin = object.outputCoin !== undefined && object.outputCoin !== null ? Coin.fromPartial(object.outputCoin) : undefined; + return message; + }, + fromAmino(object: EstimateTradeBasedOnPriceImpactResponseAmino): EstimateTradeBasedOnPriceImpactResponse { + const message = createBaseEstimateTradeBasedOnPriceImpactResponse(); + if (object.input_coin !== undefined && object.input_coin !== null) { + message.inputCoin = Coin.fromAmino(object.input_coin); + } + if (object.output_coin !== undefined && object.output_coin !== null) { + message.outputCoin = Coin.fromAmino(object.output_coin); + } + return message; + }, + toAmino(message: EstimateTradeBasedOnPriceImpactResponse): EstimateTradeBasedOnPriceImpactResponseAmino { + const obj: any = {}; + obj.input_coin = message.inputCoin ? Coin.toAmino(message.inputCoin) : undefined; + obj.output_coin = message.outputCoin ? Coin.toAmino(message.outputCoin) : undefined; + return obj; + }, + fromAminoMsg(object: EstimateTradeBasedOnPriceImpactResponseAminoMsg): EstimateTradeBasedOnPriceImpactResponse { + return EstimateTradeBasedOnPriceImpactResponse.fromAmino(object.value); + }, + toAminoMsg(message: EstimateTradeBasedOnPriceImpactResponse): EstimateTradeBasedOnPriceImpactResponseAminoMsg { + return { + type: "osmosis/poolmanager/estimate-trade-based-on-price-impact-response", + value: EstimateTradeBasedOnPriceImpactResponse.toAmino(message) + }; + }, + fromProtoMsg(message: EstimateTradeBasedOnPriceImpactResponseProtoMsg): EstimateTradeBasedOnPriceImpactResponse { + return EstimateTradeBasedOnPriceImpactResponse.decode(message.value); + }, + toProto(message: EstimateTradeBasedOnPriceImpactResponse): Uint8Array { + return EstimateTradeBasedOnPriceImpactResponse.encode(message).finish(); + }, + toProtoMsg(message: EstimateTradeBasedOnPriceImpactResponse): EstimateTradeBasedOnPriceImpactResponseProtoMsg { + return { + typeUrl: "/osmosis.poolmanager.v1beta1.EstimateTradeBasedOnPriceImpactResponse", + value: EstimateTradeBasedOnPriceImpactResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(EstimateTradeBasedOnPriceImpactResponse.typeUrl, EstimateTradeBasedOnPriceImpactResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(EstimateTradeBasedOnPriceImpactResponse.aminoType, EstimateTradeBasedOnPriceImpactResponse.typeUrl); \ No newline at end of file diff --git a/packages/osmojs/src/codegen/osmosis/poolmanager/v1beta1/swap_route.ts b/packages/osmojs/src/codegen/osmosis/poolmanager/v1beta1/swap_route.ts index c5f2a9082..34c604a38 100644 --- a/packages/osmojs/src/codegen/osmosis/poolmanager/v1beta1/swap_route.ts +++ b/packages/osmojs/src/codegen/osmosis/poolmanager/v1beta1/swap_route.ts @@ -1,4 +1,6 @@ import { BinaryReader, BinaryWriter } from "../../../binary"; +import { isSet } from "../../../helpers"; +import { GlobalDecoderRegistry } from "../../../registry"; export interface SwapAmountInRoute { poolId: bigint; tokenOutDenom: string; @@ -8,8 +10,8 @@ export interface SwapAmountInRouteProtoMsg { value: Uint8Array; } export interface SwapAmountInRouteAmino { - pool_id: string; - token_out_denom: string; + pool_id?: string; + token_out_denom?: string; } export interface SwapAmountInRouteAminoMsg { type: "osmosis/poolmanager/swap-amount-in-route"; @@ -28,8 +30,8 @@ export interface SwapAmountOutRouteProtoMsg { value: Uint8Array; } export interface SwapAmountOutRouteAmino { - pool_id: string; - token_in_denom: string; + pool_id?: string; + token_in_denom?: string; } export interface SwapAmountOutRouteAminoMsg { type: "osmosis/poolmanager/swap-amount-out-route"; @@ -48,8 +50,8 @@ export interface SwapAmountInSplitRouteProtoMsg { value: Uint8Array; } export interface SwapAmountInSplitRouteAmino { - pools: SwapAmountInRouteAmino[]; - token_in_amount: string; + pools?: SwapAmountInRouteAmino[]; + token_in_amount?: string; } export interface SwapAmountInSplitRouteAminoMsg { type: "osmosis/poolmanager/swap-amount-in-split-route"; @@ -68,8 +70,8 @@ export interface SwapAmountOutSplitRouteProtoMsg { value: Uint8Array; } export interface SwapAmountOutSplitRouteAmino { - pools: SwapAmountOutRouteAmino[]; - token_out_amount: string; + pools?: SwapAmountOutRouteAmino[]; + token_out_amount?: string; } export interface SwapAmountOutSplitRouteAminoMsg { type: "osmosis/poolmanager/swap-amount-out-split-route"; @@ -87,6 +89,16 @@ function createBaseSwapAmountInRoute(): SwapAmountInRoute { } export const SwapAmountInRoute = { typeUrl: "/osmosis.poolmanager.v1beta1.SwapAmountInRoute", + aminoType: "osmosis/poolmanager/swap-amount-in-route", + is(o: any): o is SwapAmountInRoute { + return o && (o.$typeUrl === SwapAmountInRoute.typeUrl || typeof o.poolId === "bigint" && typeof o.tokenOutDenom === "string"); + }, + isSDK(o: any): o is SwapAmountInRouteSDKType { + return o && (o.$typeUrl === SwapAmountInRoute.typeUrl || typeof o.pool_id === "bigint" && typeof o.token_out_denom === "string"); + }, + isAmino(o: any): o is SwapAmountInRouteAmino { + return o && (o.$typeUrl === SwapAmountInRoute.typeUrl || typeof o.pool_id === "bigint" && typeof o.token_out_denom === "string"); + }, encode(message: SwapAmountInRoute, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.poolId !== BigInt(0)) { writer.uint32(8).uint64(message.poolId); @@ -116,6 +128,18 @@ export const SwapAmountInRoute = { } return message; }, + fromJSON(object: any): SwapAmountInRoute { + return { + poolId: isSet(object.poolId) ? BigInt(object.poolId.toString()) : BigInt(0), + tokenOutDenom: isSet(object.tokenOutDenom) ? String(object.tokenOutDenom) : "" + }; + }, + toJSON(message: SwapAmountInRoute): unknown { + const obj: any = {}; + message.poolId !== undefined && (obj.poolId = (message.poolId || BigInt(0)).toString()); + message.tokenOutDenom !== undefined && (obj.tokenOutDenom = message.tokenOutDenom); + return obj; + }, fromPartial(object: Partial): SwapAmountInRoute { const message = createBaseSwapAmountInRoute(); message.poolId = object.poolId !== undefined && object.poolId !== null ? BigInt(object.poolId.toString()) : BigInt(0); @@ -123,10 +147,14 @@ export const SwapAmountInRoute = { return message; }, fromAmino(object: SwapAmountInRouteAmino): SwapAmountInRoute { - return { - poolId: BigInt(object.pool_id), - tokenOutDenom: object.token_out_denom - }; + const message = createBaseSwapAmountInRoute(); + if (object.pool_id !== undefined && object.pool_id !== null) { + message.poolId = BigInt(object.pool_id); + } + if (object.token_out_denom !== undefined && object.token_out_denom !== null) { + message.tokenOutDenom = object.token_out_denom; + } + return message; }, toAmino(message: SwapAmountInRoute): SwapAmountInRouteAmino { const obj: any = {}; @@ -156,6 +184,8 @@ export const SwapAmountInRoute = { }; } }; +GlobalDecoderRegistry.register(SwapAmountInRoute.typeUrl, SwapAmountInRoute); +GlobalDecoderRegistry.registerAminoProtoMapping(SwapAmountInRoute.aminoType, SwapAmountInRoute.typeUrl); function createBaseSwapAmountOutRoute(): SwapAmountOutRoute { return { poolId: BigInt(0), @@ -164,6 +194,16 @@ function createBaseSwapAmountOutRoute(): SwapAmountOutRoute { } export const SwapAmountOutRoute = { typeUrl: "/osmosis.poolmanager.v1beta1.SwapAmountOutRoute", + aminoType: "osmosis/poolmanager/swap-amount-out-route", + is(o: any): o is SwapAmountOutRoute { + return o && (o.$typeUrl === SwapAmountOutRoute.typeUrl || typeof o.poolId === "bigint" && typeof o.tokenInDenom === "string"); + }, + isSDK(o: any): o is SwapAmountOutRouteSDKType { + return o && (o.$typeUrl === SwapAmountOutRoute.typeUrl || typeof o.pool_id === "bigint" && typeof o.token_in_denom === "string"); + }, + isAmino(o: any): o is SwapAmountOutRouteAmino { + return o && (o.$typeUrl === SwapAmountOutRoute.typeUrl || typeof o.pool_id === "bigint" && typeof o.token_in_denom === "string"); + }, encode(message: SwapAmountOutRoute, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.poolId !== BigInt(0)) { writer.uint32(8).uint64(message.poolId); @@ -193,6 +233,18 @@ export const SwapAmountOutRoute = { } return message; }, + fromJSON(object: any): SwapAmountOutRoute { + return { + poolId: isSet(object.poolId) ? BigInt(object.poolId.toString()) : BigInt(0), + tokenInDenom: isSet(object.tokenInDenom) ? String(object.tokenInDenom) : "" + }; + }, + toJSON(message: SwapAmountOutRoute): unknown { + const obj: any = {}; + message.poolId !== undefined && (obj.poolId = (message.poolId || BigInt(0)).toString()); + message.tokenInDenom !== undefined && (obj.tokenInDenom = message.tokenInDenom); + return obj; + }, fromPartial(object: Partial): SwapAmountOutRoute { const message = createBaseSwapAmountOutRoute(); message.poolId = object.poolId !== undefined && object.poolId !== null ? BigInt(object.poolId.toString()) : BigInt(0); @@ -200,10 +252,14 @@ export const SwapAmountOutRoute = { return message; }, fromAmino(object: SwapAmountOutRouteAmino): SwapAmountOutRoute { - return { - poolId: BigInt(object.pool_id), - tokenInDenom: object.token_in_denom - }; + const message = createBaseSwapAmountOutRoute(); + if (object.pool_id !== undefined && object.pool_id !== null) { + message.poolId = BigInt(object.pool_id); + } + if (object.token_in_denom !== undefined && object.token_in_denom !== null) { + message.tokenInDenom = object.token_in_denom; + } + return message; }, toAmino(message: SwapAmountOutRoute): SwapAmountOutRouteAmino { const obj: any = {}; @@ -233,6 +289,8 @@ export const SwapAmountOutRoute = { }; } }; +GlobalDecoderRegistry.register(SwapAmountOutRoute.typeUrl, SwapAmountOutRoute); +GlobalDecoderRegistry.registerAminoProtoMapping(SwapAmountOutRoute.aminoType, SwapAmountOutRoute.typeUrl); function createBaseSwapAmountInSplitRoute(): SwapAmountInSplitRoute { return { pools: [], @@ -241,6 +299,16 @@ function createBaseSwapAmountInSplitRoute(): SwapAmountInSplitRoute { } export const SwapAmountInSplitRoute = { typeUrl: "/osmosis.poolmanager.v1beta1.SwapAmountInSplitRoute", + aminoType: "osmosis/poolmanager/swap-amount-in-split-route", + is(o: any): o is SwapAmountInSplitRoute { + return o && (o.$typeUrl === SwapAmountInSplitRoute.typeUrl || Array.isArray(o.pools) && (!o.pools.length || SwapAmountInRoute.is(o.pools[0])) && typeof o.tokenInAmount === "string"); + }, + isSDK(o: any): o is SwapAmountInSplitRouteSDKType { + return o && (o.$typeUrl === SwapAmountInSplitRoute.typeUrl || Array.isArray(o.pools) && (!o.pools.length || SwapAmountInRoute.isSDK(o.pools[0])) && typeof o.token_in_amount === "string"); + }, + isAmino(o: any): o is SwapAmountInSplitRouteAmino { + return o && (o.$typeUrl === SwapAmountInSplitRoute.typeUrl || Array.isArray(o.pools) && (!o.pools.length || SwapAmountInRoute.isAmino(o.pools[0])) && typeof o.token_in_amount === "string"); + }, encode(message: SwapAmountInSplitRoute, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.pools) { SwapAmountInRoute.encode(v!, writer.uint32(10).fork()).ldelim(); @@ -270,6 +338,22 @@ export const SwapAmountInSplitRoute = { } return message; }, + fromJSON(object: any): SwapAmountInSplitRoute { + return { + pools: Array.isArray(object?.pools) ? object.pools.map((e: any) => SwapAmountInRoute.fromJSON(e)) : [], + tokenInAmount: isSet(object.tokenInAmount) ? String(object.tokenInAmount) : "" + }; + }, + toJSON(message: SwapAmountInSplitRoute): unknown { + const obj: any = {}; + if (message.pools) { + obj.pools = message.pools.map(e => e ? SwapAmountInRoute.toJSON(e) : undefined); + } else { + obj.pools = []; + } + message.tokenInAmount !== undefined && (obj.tokenInAmount = message.tokenInAmount); + return obj; + }, fromPartial(object: Partial): SwapAmountInSplitRoute { const message = createBaseSwapAmountInSplitRoute(); message.pools = object.pools?.map(e => SwapAmountInRoute.fromPartial(e)) || []; @@ -277,10 +361,12 @@ export const SwapAmountInSplitRoute = { return message; }, fromAmino(object: SwapAmountInSplitRouteAmino): SwapAmountInSplitRoute { - return { - pools: Array.isArray(object?.pools) ? object.pools.map((e: any) => SwapAmountInRoute.fromAmino(e)) : [], - tokenInAmount: object.token_in_amount - }; + const message = createBaseSwapAmountInSplitRoute(); + message.pools = object.pools?.map(e => SwapAmountInRoute.fromAmino(e)) || []; + if (object.token_in_amount !== undefined && object.token_in_amount !== null) { + message.tokenInAmount = object.token_in_amount; + } + return message; }, toAmino(message: SwapAmountInSplitRoute): SwapAmountInSplitRouteAmino { const obj: any = {}; @@ -314,6 +400,8 @@ export const SwapAmountInSplitRoute = { }; } }; +GlobalDecoderRegistry.register(SwapAmountInSplitRoute.typeUrl, SwapAmountInSplitRoute); +GlobalDecoderRegistry.registerAminoProtoMapping(SwapAmountInSplitRoute.aminoType, SwapAmountInSplitRoute.typeUrl); function createBaseSwapAmountOutSplitRoute(): SwapAmountOutSplitRoute { return { pools: [], @@ -322,6 +410,16 @@ function createBaseSwapAmountOutSplitRoute(): SwapAmountOutSplitRoute { } export const SwapAmountOutSplitRoute = { typeUrl: "/osmosis.poolmanager.v1beta1.SwapAmountOutSplitRoute", + aminoType: "osmosis/poolmanager/swap-amount-out-split-route", + is(o: any): o is SwapAmountOutSplitRoute { + return o && (o.$typeUrl === SwapAmountOutSplitRoute.typeUrl || Array.isArray(o.pools) && (!o.pools.length || SwapAmountOutRoute.is(o.pools[0])) && typeof o.tokenOutAmount === "string"); + }, + isSDK(o: any): o is SwapAmountOutSplitRouteSDKType { + return o && (o.$typeUrl === SwapAmountOutSplitRoute.typeUrl || Array.isArray(o.pools) && (!o.pools.length || SwapAmountOutRoute.isSDK(o.pools[0])) && typeof o.token_out_amount === "string"); + }, + isAmino(o: any): o is SwapAmountOutSplitRouteAmino { + return o && (o.$typeUrl === SwapAmountOutSplitRoute.typeUrl || Array.isArray(o.pools) && (!o.pools.length || SwapAmountOutRoute.isAmino(o.pools[0])) && typeof o.token_out_amount === "string"); + }, encode(message: SwapAmountOutSplitRoute, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.pools) { SwapAmountOutRoute.encode(v!, writer.uint32(10).fork()).ldelim(); @@ -351,6 +449,22 @@ export const SwapAmountOutSplitRoute = { } return message; }, + fromJSON(object: any): SwapAmountOutSplitRoute { + return { + pools: Array.isArray(object?.pools) ? object.pools.map((e: any) => SwapAmountOutRoute.fromJSON(e)) : [], + tokenOutAmount: isSet(object.tokenOutAmount) ? String(object.tokenOutAmount) : "" + }; + }, + toJSON(message: SwapAmountOutSplitRoute): unknown { + const obj: any = {}; + if (message.pools) { + obj.pools = message.pools.map(e => e ? SwapAmountOutRoute.toJSON(e) : undefined); + } else { + obj.pools = []; + } + message.tokenOutAmount !== undefined && (obj.tokenOutAmount = message.tokenOutAmount); + return obj; + }, fromPartial(object: Partial): SwapAmountOutSplitRoute { const message = createBaseSwapAmountOutSplitRoute(); message.pools = object.pools?.map(e => SwapAmountOutRoute.fromPartial(e)) || []; @@ -358,10 +472,12 @@ export const SwapAmountOutSplitRoute = { return message; }, fromAmino(object: SwapAmountOutSplitRouteAmino): SwapAmountOutSplitRoute { - return { - pools: Array.isArray(object?.pools) ? object.pools.map((e: any) => SwapAmountOutRoute.fromAmino(e)) : [], - tokenOutAmount: object.token_out_amount - }; + const message = createBaseSwapAmountOutSplitRoute(); + message.pools = object.pools?.map(e => SwapAmountOutRoute.fromAmino(e)) || []; + if (object.token_out_amount !== undefined && object.token_out_amount !== null) { + message.tokenOutAmount = object.token_out_amount; + } + return message; }, toAmino(message: SwapAmountOutSplitRoute): SwapAmountOutSplitRouteAmino { const obj: any = {}; @@ -394,4 +510,6 @@ export const SwapAmountOutSplitRoute = { value: SwapAmountOutSplitRoute.encode(message).finish() }; } -}; \ No newline at end of file +}; +GlobalDecoderRegistry.register(SwapAmountOutSplitRoute.typeUrl, SwapAmountOutSplitRoute); +GlobalDecoderRegistry.registerAminoProtoMapping(SwapAmountOutSplitRoute.aminoType, SwapAmountOutSplitRoute.typeUrl); \ No newline at end of file diff --git a/packages/osmojs/src/codegen/osmosis/poolmanager/v1beta1/tracked_volume.ts b/packages/osmojs/src/codegen/osmosis/poolmanager/v1beta1/tracked_volume.ts new file mode 100644 index 000000000..031c48da3 --- /dev/null +++ b/packages/osmojs/src/codegen/osmosis/poolmanager/v1beta1/tracked_volume.ts @@ -0,0 +1,117 @@ +import { Coin, CoinAmino, CoinSDKType } from "../../../cosmos/base/v1beta1/coin"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { GlobalDecoderRegistry } from "../../../registry"; +export interface TrackedVolume { + amount: Coin[]; +} +export interface TrackedVolumeProtoMsg { + typeUrl: "/osmosis.poolmanager.v1beta1.TrackedVolume"; + value: Uint8Array; +} +export interface TrackedVolumeAmino { + amount?: CoinAmino[]; +} +export interface TrackedVolumeAminoMsg { + type: "osmosis/poolmanager/tracked-volume"; + value: TrackedVolumeAmino; +} +export interface TrackedVolumeSDKType { + amount: CoinSDKType[]; +} +function createBaseTrackedVolume(): TrackedVolume { + return { + amount: [] + }; +} +export const TrackedVolume = { + typeUrl: "/osmosis.poolmanager.v1beta1.TrackedVolume", + aminoType: "osmosis/poolmanager/tracked-volume", + is(o: any): o is TrackedVolume { + return o && (o.$typeUrl === TrackedVolume.typeUrl || Array.isArray(o.amount) && (!o.amount.length || Coin.is(o.amount[0]))); + }, + isSDK(o: any): o is TrackedVolumeSDKType { + return o && (o.$typeUrl === TrackedVolume.typeUrl || Array.isArray(o.amount) && (!o.amount.length || Coin.isSDK(o.amount[0]))); + }, + isAmino(o: any): o is TrackedVolumeAmino { + return o && (o.$typeUrl === TrackedVolume.typeUrl || Array.isArray(o.amount) && (!o.amount.length || Coin.isAmino(o.amount[0]))); + }, + encode(message: TrackedVolume, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.amount) { + Coin.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): TrackedVolume { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseTrackedVolume(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.amount.push(Coin.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): TrackedVolume { + return { + amount: Array.isArray(object?.amount) ? object.amount.map((e: any) => Coin.fromJSON(e)) : [] + }; + }, + toJSON(message: TrackedVolume): unknown { + const obj: any = {}; + if (message.amount) { + obj.amount = message.amount.map(e => e ? Coin.toJSON(e) : undefined); + } else { + obj.amount = []; + } + return obj; + }, + fromPartial(object: Partial): TrackedVolume { + const message = createBaseTrackedVolume(); + message.amount = object.amount?.map(e => Coin.fromPartial(e)) || []; + return message; + }, + fromAmino(object: TrackedVolumeAmino): TrackedVolume { + const message = createBaseTrackedVolume(); + message.amount = object.amount?.map(e => Coin.fromAmino(e)) || []; + return message; + }, + toAmino(message: TrackedVolume): TrackedVolumeAmino { + const obj: any = {}; + if (message.amount) { + obj.amount = message.amount.map(e => e ? Coin.toAmino(e) : undefined); + } else { + obj.amount = []; + } + return obj; + }, + fromAminoMsg(object: TrackedVolumeAminoMsg): TrackedVolume { + return TrackedVolume.fromAmino(object.value); + }, + toAminoMsg(message: TrackedVolume): TrackedVolumeAminoMsg { + return { + type: "osmosis/poolmanager/tracked-volume", + value: TrackedVolume.toAmino(message) + }; + }, + fromProtoMsg(message: TrackedVolumeProtoMsg): TrackedVolume { + return TrackedVolume.decode(message.value); + }, + toProto(message: TrackedVolume): Uint8Array { + return TrackedVolume.encode(message).finish(); + }, + toProtoMsg(message: TrackedVolume): TrackedVolumeProtoMsg { + return { + typeUrl: "/osmosis.poolmanager.v1beta1.TrackedVolume", + value: TrackedVolume.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(TrackedVolume.typeUrl, TrackedVolume); +GlobalDecoderRegistry.registerAminoProtoMapping(TrackedVolume.aminoType, TrackedVolume.typeUrl); \ No newline at end of file diff --git a/packages/osmojs/src/codegen/osmosis/poolmanager/v1beta1/tx.amino.ts b/packages/osmojs/src/codegen/osmosis/poolmanager/v1beta1/tx.amino.ts index 4f2b575f0..0c1bd738a 100644 --- a/packages/osmojs/src/codegen/osmosis/poolmanager/v1beta1/tx.amino.ts +++ b/packages/osmojs/src/codegen/osmosis/poolmanager/v1beta1/tx.amino.ts @@ -1,5 +1,5 @@ //@ts-nocheck -import { MsgSwapExactAmountIn, MsgSwapExactAmountOut, MsgSplitRouteSwapExactAmountIn, MsgSplitRouteSwapExactAmountOut } from "./tx"; +import { MsgSwapExactAmountIn, MsgSwapExactAmountOut, MsgSplitRouteSwapExactAmountIn, MsgSplitRouteSwapExactAmountOut, MsgSetDenomPairTakerFee } from "./tx"; export const AminoConverter = { "/osmosis.poolmanager.v1beta1.MsgSwapExactAmountIn": { aminoType: "osmosis/poolmanager/swap-exact-amount-in", @@ -12,13 +12,18 @@ export const AminoConverter = { fromAmino: MsgSwapExactAmountOut.fromAmino }, "/osmosis.poolmanager.v1beta1.MsgSplitRouteSwapExactAmountIn": { - aminoType: "osmosis/poolmanager/split-route-swap-exact-amount-in", + aminoType: "osmosis/poolmanager/split-amount-in", toAmino: MsgSplitRouteSwapExactAmountIn.toAmino, fromAmino: MsgSplitRouteSwapExactAmountIn.fromAmino }, "/osmosis.poolmanager.v1beta1.MsgSplitRouteSwapExactAmountOut": { - aminoType: "osmosis/poolmanager/split-route-swap-exact-amount-out", + aminoType: "osmosis/poolmanager/split-amount-out", toAmino: MsgSplitRouteSwapExactAmountOut.toAmino, fromAmino: MsgSplitRouteSwapExactAmountOut.fromAmino + }, + "/osmosis.poolmanager.v1beta1.MsgSetDenomPairTakerFee": { + aminoType: "osmosis/poolmanager/set-denom-pair-taker-fee", + toAmino: MsgSetDenomPairTakerFee.toAmino, + fromAmino: MsgSetDenomPairTakerFee.fromAmino } }; \ No newline at end of file diff --git a/packages/osmojs/src/codegen/osmosis/poolmanager/v1beta1/tx.registry.ts b/packages/osmojs/src/codegen/osmosis/poolmanager/v1beta1/tx.registry.ts index 116db1f7f..53f510c95 100644 --- a/packages/osmojs/src/codegen/osmosis/poolmanager/v1beta1/tx.registry.ts +++ b/packages/osmojs/src/codegen/osmosis/poolmanager/v1beta1/tx.registry.ts @@ -1,7 +1,7 @@ //@ts-nocheck import { GeneratedType, Registry } from "@cosmjs/proto-signing"; -import { MsgSwapExactAmountIn, MsgSwapExactAmountOut, MsgSplitRouteSwapExactAmountIn, MsgSplitRouteSwapExactAmountOut } from "./tx"; -export const registry: ReadonlyArray<[string, GeneratedType]> = [["/osmosis.poolmanager.v1beta1.MsgSwapExactAmountIn", MsgSwapExactAmountIn], ["/osmosis.poolmanager.v1beta1.MsgSwapExactAmountOut", MsgSwapExactAmountOut], ["/osmosis.poolmanager.v1beta1.MsgSplitRouteSwapExactAmountIn", MsgSplitRouteSwapExactAmountIn], ["/osmosis.poolmanager.v1beta1.MsgSplitRouteSwapExactAmountOut", MsgSplitRouteSwapExactAmountOut]]; +import { MsgSwapExactAmountIn, MsgSwapExactAmountOut, MsgSplitRouteSwapExactAmountIn, MsgSplitRouteSwapExactAmountOut, MsgSetDenomPairTakerFee } from "./tx"; +export const registry: ReadonlyArray<[string, GeneratedType]> = [["/osmosis.poolmanager.v1beta1.MsgSwapExactAmountIn", MsgSwapExactAmountIn], ["/osmosis.poolmanager.v1beta1.MsgSwapExactAmountOut", MsgSwapExactAmountOut], ["/osmosis.poolmanager.v1beta1.MsgSplitRouteSwapExactAmountIn", MsgSplitRouteSwapExactAmountIn], ["/osmosis.poolmanager.v1beta1.MsgSplitRouteSwapExactAmountOut", MsgSplitRouteSwapExactAmountOut], ["/osmosis.poolmanager.v1beta1.MsgSetDenomPairTakerFee", MsgSetDenomPairTakerFee]]; export const load = (protoRegistry: Registry) => { registry.forEach(([typeUrl, mod]) => { protoRegistry.register(typeUrl, mod); @@ -32,6 +32,12 @@ export const MessageComposer = { typeUrl: "/osmosis.poolmanager.v1beta1.MsgSplitRouteSwapExactAmountOut", value: MsgSplitRouteSwapExactAmountOut.encode(value).finish() }; + }, + setDenomPairTakerFee(value: MsgSetDenomPairTakerFee) { + return { + typeUrl: "/osmosis.poolmanager.v1beta1.MsgSetDenomPairTakerFee", + value: MsgSetDenomPairTakerFee.encode(value).finish() + }; } }, withTypeUrl: { @@ -58,6 +64,76 @@ export const MessageComposer = { typeUrl: "/osmosis.poolmanager.v1beta1.MsgSplitRouteSwapExactAmountOut", value }; + }, + setDenomPairTakerFee(value: MsgSetDenomPairTakerFee) { + return { + typeUrl: "/osmosis.poolmanager.v1beta1.MsgSetDenomPairTakerFee", + value + }; + } + }, + toJSON: { + swapExactAmountIn(value: MsgSwapExactAmountIn) { + return { + typeUrl: "/osmosis.poolmanager.v1beta1.MsgSwapExactAmountIn", + value: MsgSwapExactAmountIn.toJSON(value) + }; + }, + swapExactAmountOut(value: MsgSwapExactAmountOut) { + return { + typeUrl: "/osmosis.poolmanager.v1beta1.MsgSwapExactAmountOut", + value: MsgSwapExactAmountOut.toJSON(value) + }; + }, + splitRouteSwapExactAmountIn(value: MsgSplitRouteSwapExactAmountIn) { + return { + typeUrl: "/osmosis.poolmanager.v1beta1.MsgSplitRouteSwapExactAmountIn", + value: MsgSplitRouteSwapExactAmountIn.toJSON(value) + }; + }, + splitRouteSwapExactAmountOut(value: MsgSplitRouteSwapExactAmountOut) { + return { + typeUrl: "/osmosis.poolmanager.v1beta1.MsgSplitRouteSwapExactAmountOut", + value: MsgSplitRouteSwapExactAmountOut.toJSON(value) + }; + }, + setDenomPairTakerFee(value: MsgSetDenomPairTakerFee) { + return { + typeUrl: "/osmosis.poolmanager.v1beta1.MsgSetDenomPairTakerFee", + value: MsgSetDenomPairTakerFee.toJSON(value) + }; + } + }, + fromJSON: { + swapExactAmountIn(value: any) { + return { + typeUrl: "/osmosis.poolmanager.v1beta1.MsgSwapExactAmountIn", + value: MsgSwapExactAmountIn.fromJSON(value) + }; + }, + swapExactAmountOut(value: any) { + return { + typeUrl: "/osmosis.poolmanager.v1beta1.MsgSwapExactAmountOut", + value: MsgSwapExactAmountOut.fromJSON(value) + }; + }, + splitRouteSwapExactAmountIn(value: any) { + return { + typeUrl: "/osmosis.poolmanager.v1beta1.MsgSplitRouteSwapExactAmountIn", + value: MsgSplitRouteSwapExactAmountIn.fromJSON(value) + }; + }, + splitRouteSwapExactAmountOut(value: any) { + return { + typeUrl: "/osmosis.poolmanager.v1beta1.MsgSplitRouteSwapExactAmountOut", + value: MsgSplitRouteSwapExactAmountOut.fromJSON(value) + }; + }, + setDenomPairTakerFee(value: any) { + return { + typeUrl: "/osmosis.poolmanager.v1beta1.MsgSetDenomPairTakerFee", + value: MsgSetDenomPairTakerFee.fromJSON(value) + }; } }, fromPartial: { @@ -84,6 +160,12 @@ export const MessageComposer = { typeUrl: "/osmosis.poolmanager.v1beta1.MsgSplitRouteSwapExactAmountOut", value: MsgSplitRouteSwapExactAmountOut.fromPartial(value) }; + }, + setDenomPairTakerFee(value: MsgSetDenomPairTakerFee) { + return { + typeUrl: "/osmosis.poolmanager.v1beta1.MsgSetDenomPairTakerFee", + value: MsgSetDenomPairTakerFee.fromPartial(value) + }; } } }; \ No newline at end of file diff --git a/packages/osmojs/src/codegen/osmosis/poolmanager/v1beta1/tx.rpc.msg.ts b/packages/osmojs/src/codegen/osmosis/poolmanager/v1beta1/tx.rpc.msg.ts index ba18a7f89..080cd25b8 100644 --- a/packages/osmojs/src/codegen/osmosis/poolmanager/v1beta1/tx.rpc.msg.ts +++ b/packages/osmojs/src/codegen/osmosis/poolmanager/v1beta1/tx.rpc.msg.ts @@ -1,11 +1,12 @@ import { Rpc } from "../../../helpers"; import { BinaryReader } from "../../../binary"; -import { MsgSwapExactAmountIn, MsgSwapExactAmountInResponse, MsgSwapExactAmountOut, MsgSwapExactAmountOutResponse, MsgSplitRouteSwapExactAmountIn, MsgSplitRouteSwapExactAmountInResponse, MsgSplitRouteSwapExactAmountOut, MsgSplitRouteSwapExactAmountOutResponse } from "./tx"; +import { MsgSwapExactAmountIn, MsgSwapExactAmountInResponse, MsgSwapExactAmountOut, MsgSwapExactAmountOutResponse, MsgSplitRouteSwapExactAmountIn, MsgSplitRouteSwapExactAmountInResponse, MsgSplitRouteSwapExactAmountOut, MsgSplitRouteSwapExactAmountOutResponse, MsgSetDenomPairTakerFee, MsgSetDenomPairTakerFeeResponse } from "./tx"; export interface Msg { swapExactAmountIn(request: MsgSwapExactAmountIn): Promise; swapExactAmountOut(request: MsgSwapExactAmountOut): Promise; splitRouteSwapExactAmountIn(request: MsgSplitRouteSwapExactAmountIn): Promise; splitRouteSwapExactAmountOut(request: MsgSplitRouteSwapExactAmountOut): Promise; + setDenomPairTakerFee(request: MsgSetDenomPairTakerFee): Promise; } export class MsgClientImpl implements Msg { private readonly rpc: Rpc; @@ -15,6 +16,7 @@ export class MsgClientImpl implements Msg { this.swapExactAmountOut = this.swapExactAmountOut.bind(this); this.splitRouteSwapExactAmountIn = this.splitRouteSwapExactAmountIn.bind(this); this.splitRouteSwapExactAmountOut = this.splitRouteSwapExactAmountOut.bind(this); + this.setDenomPairTakerFee = this.setDenomPairTakerFee.bind(this); } swapExactAmountIn(request: MsgSwapExactAmountIn): Promise { const data = MsgSwapExactAmountIn.encode(request).finish(); @@ -36,4 +38,12 @@ export class MsgClientImpl implements Msg { const promise = this.rpc.request("osmosis.poolmanager.v1beta1.Msg", "SplitRouteSwapExactAmountOut", data); return promise.then(data => MsgSplitRouteSwapExactAmountOutResponse.decode(new BinaryReader(data))); } -} \ No newline at end of file + setDenomPairTakerFee(request: MsgSetDenomPairTakerFee): Promise { + const data = MsgSetDenomPairTakerFee.encode(request).finish(); + const promise = this.rpc.request("osmosis.poolmanager.v1beta1.Msg", "SetDenomPairTakerFee", data); + return promise.then(data => MsgSetDenomPairTakerFeeResponse.decode(new BinaryReader(data))); + } +} +export const createClientImpl = (rpc: Rpc) => { + return new MsgClientImpl(rpc); +}; \ No newline at end of file diff --git a/packages/osmojs/src/codegen/osmosis/poolmanager/v1beta1/tx.ts b/packages/osmojs/src/codegen/osmosis/poolmanager/v1beta1/tx.ts index ff57fe6e9..2e1d1bd46 100644 --- a/packages/osmojs/src/codegen/osmosis/poolmanager/v1beta1/tx.ts +++ b/packages/osmojs/src/codegen/osmosis/poolmanager/v1beta1/tx.ts @@ -1,6 +1,9 @@ import { SwapAmountInRoute, SwapAmountInRouteAmino, SwapAmountInRouteSDKType, SwapAmountOutRoute, SwapAmountOutRouteAmino, SwapAmountOutRouteSDKType, SwapAmountInSplitRoute, SwapAmountInSplitRouteAmino, SwapAmountInSplitRouteSDKType, SwapAmountOutSplitRoute, SwapAmountOutSplitRouteAmino, SwapAmountOutSplitRouteSDKType } from "./swap_route"; import { Coin, CoinAmino, CoinSDKType } from "../../../cosmos/base/v1beta1/coin"; import { BinaryReader, BinaryWriter } from "../../../binary"; +import { isSet } from "../../../helpers"; +import { GlobalDecoderRegistry } from "../../../registry"; +import { Decimal } from "@cosmjs/math"; /** ===================== MsgSwapExactAmountIn */ export interface MsgSwapExactAmountIn { sender: string; @@ -14,10 +17,10 @@ export interface MsgSwapExactAmountInProtoMsg { } /** ===================== MsgSwapExactAmountIn */ export interface MsgSwapExactAmountInAmino { - sender: string; - routes: SwapAmountInRouteAmino[]; + sender?: string; + routes?: SwapAmountInRouteAmino[]; token_in?: CoinAmino; - token_out_min_amount: string; + token_out_min_amount?: string; } export interface MsgSwapExactAmountInAminoMsg { type: "osmosis/poolmanager/swap-exact-amount-in"; @@ -38,7 +41,7 @@ export interface MsgSwapExactAmountInResponseProtoMsg { value: Uint8Array; } export interface MsgSwapExactAmountInResponseAmino { - token_out_amount: string; + token_out_amount?: string; } export interface MsgSwapExactAmountInResponseAminoMsg { type: "osmosis/poolmanager/swap-exact-amount-in-response"; @@ -60,13 +63,13 @@ export interface MsgSplitRouteSwapExactAmountInProtoMsg { } /** ===================== MsgSplitRouteSwapExactAmountIn */ export interface MsgSplitRouteSwapExactAmountInAmino { - sender: string; - routes: SwapAmountInSplitRouteAmino[]; - token_in_denom: string; - token_out_min_amount: string; + sender?: string; + routes?: SwapAmountInSplitRouteAmino[]; + token_in_denom?: string; + token_out_min_amount?: string; } export interface MsgSplitRouteSwapExactAmountInAminoMsg { - type: "osmosis/poolmanager/split-route-swap-exact-amount-in"; + type: "osmosis/poolmanager/split-amount-in"; value: MsgSplitRouteSwapExactAmountInAmino; } /** ===================== MsgSplitRouteSwapExactAmountIn */ @@ -84,7 +87,7 @@ export interface MsgSplitRouteSwapExactAmountInResponseProtoMsg { value: Uint8Array; } export interface MsgSplitRouteSwapExactAmountInResponseAmino { - token_out_amount: string; + token_out_amount?: string; } export interface MsgSplitRouteSwapExactAmountInResponseAminoMsg { type: "osmosis/poolmanager/split-route-swap-exact-amount-in-response"; @@ -106,9 +109,9 @@ export interface MsgSwapExactAmountOutProtoMsg { } /** ===================== MsgSwapExactAmountOut */ export interface MsgSwapExactAmountOutAmino { - sender: string; - routes: SwapAmountOutRouteAmino[]; - token_in_max_amount: string; + sender?: string; + routes?: SwapAmountOutRouteAmino[]; + token_in_max_amount?: string; token_out?: CoinAmino; } export interface MsgSwapExactAmountOutAminoMsg { @@ -130,7 +133,7 @@ export interface MsgSwapExactAmountOutResponseProtoMsg { value: Uint8Array; } export interface MsgSwapExactAmountOutResponseAmino { - token_in_amount: string; + token_in_amount?: string; } export interface MsgSwapExactAmountOutResponseAminoMsg { type: "osmosis/poolmanager/swap-exact-amount-out-response"; @@ -152,13 +155,13 @@ export interface MsgSplitRouteSwapExactAmountOutProtoMsg { } /** ===================== MsgSplitRouteSwapExactAmountOut */ export interface MsgSplitRouteSwapExactAmountOutAmino { - sender: string; - routes: SwapAmountOutSplitRouteAmino[]; - token_out_denom: string; - token_in_max_amount: string; + sender?: string; + routes?: SwapAmountOutSplitRouteAmino[]; + token_out_denom?: string; + token_in_max_amount?: string; } export interface MsgSplitRouteSwapExactAmountOutAminoMsg { - type: "osmosis/poolmanager/split-route-swap-exact-amount-out"; + type: "osmosis/poolmanager/split-amount-out"; value: MsgSplitRouteSwapExactAmountOutAmino; } /** ===================== MsgSplitRouteSwapExactAmountOut */ @@ -176,7 +179,7 @@ export interface MsgSplitRouteSwapExactAmountOutResponseProtoMsg { value: Uint8Array; } export interface MsgSplitRouteSwapExactAmountOutResponseAmino { - token_in_amount: string; + token_in_amount?: string; } export interface MsgSplitRouteSwapExactAmountOutResponseAminoMsg { type: "osmosis/poolmanager/split-route-swap-exact-amount-out-response"; @@ -185,16 +188,97 @@ export interface MsgSplitRouteSwapExactAmountOutResponseAminoMsg { export interface MsgSplitRouteSwapExactAmountOutResponseSDKType { token_in_amount: string; } +/** ===================== MsgSetDenomPairTakerFee */ +export interface MsgSetDenomPairTakerFee { + sender: string; + denomPairTakerFee: DenomPairTakerFee[]; +} +export interface MsgSetDenomPairTakerFeeProtoMsg { + typeUrl: "/osmosis.poolmanager.v1beta1.MsgSetDenomPairTakerFee"; + value: Uint8Array; +} +/** ===================== MsgSetDenomPairTakerFee */ +export interface MsgSetDenomPairTakerFeeAmino { + sender?: string; + denom_pair_taker_fee?: DenomPairTakerFeeAmino[]; +} +export interface MsgSetDenomPairTakerFeeAminoMsg { + type: "osmosis/poolmanager/set-denom-pair-taker-fee"; + value: MsgSetDenomPairTakerFeeAmino; +} +/** ===================== MsgSetDenomPairTakerFee */ +export interface MsgSetDenomPairTakerFeeSDKType { + sender: string; + denom_pair_taker_fee: DenomPairTakerFeeSDKType[]; +} +export interface MsgSetDenomPairTakerFeeResponse { + success: boolean; +} +export interface MsgSetDenomPairTakerFeeResponseProtoMsg { + typeUrl: "/osmosis.poolmanager.v1beta1.MsgSetDenomPairTakerFeeResponse"; + value: Uint8Array; +} +export interface MsgSetDenomPairTakerFeeResponseAmino { + success?: boolean; +} +export interface MsgSetDenomPairTakerFeeResponseAminoMsg { + type: "osmosis/poolmanager/set-denom-pair-taker-fee-response"; + value: MsgSetDenomPairTakerFeeResponseAmino; +} +export interface MsgSetDenomPairTakerFeeResponseSDKType { + success: boolean; +} +export interface DenomPairTakerFee { + /** + * denom0 and denom1 get automatically lexigographically sorted + * when being stored, so the order of input here does not matter. + */ + denom0: string; + denom1: string; + takerFee: string; +} +export interface DenomPairTakerFeeProtoMsg { + typeUrl: "/osmosis.poolmanager.v1beta1.DenomPairTakerFee"; + value: Uint8Array; +} +export interface DenomPairTakerFeeAmino { + /** + * denom0 and denom1 get automatically lexigographically sorted + * when being stored, so the order of input here does not matter. + */ + denom0?: string; + denom1?: string; + taker_fee?: string; +} +export interface DenomPairTakerFeeAminoMsg { + type: "osmosis/poolmanager/denom-pair-taker-fee"; + value: DenomPairTakerFeeAmino; +} +export interface DenomPairTakerFeeSDKType { + denom0: string; + denom1: string; + taker_fee: string; +} function createBaseMsgSwapExactAmountIn(): MsgSwapExactAmountIn { return { sender: "", routes: [], - tokenIn: undefined, + tokenIn: Coin.fromPartial({}), tokenOutMinAmount: "" }; } export const MsgSwapExactAmountIn = { typeUrl: "/osmosis.poolmanager.v1beta1.MsgSwapExactAmountIn", + aminoType: "osmosis/poolmanager/swap-exact-amount-in", + is(o: any): o is MsgSwapExactAmountIn { + return o && (o.$typeUrl === MsgSwapExactAmountIn.typeUrl || typeof o.sender === "string" && Array.isArray(o.routes) && (!o.routes.length || SwapAmountInRoute.is(o.routes[0])) && Coin.is(o.tokenIn) && typeof o.tokenOutMinAmount === "string"); + }, + isSDK(o: any): o is MsgSwapExactAmountInSDKType { + return o && (o.$typeUrl === MsgSwapExactAmountIn.typeUrl || typeof o.sender === "string" && Array.isArray(o.routes) && (!o.routes.length || SwapAmountInRoute.isSDK(o.routes[0])) && Coin.isSDK(o.token_in) && typeof o.token_out_min_amount === "string"); + }, + isAmino(o: any): o is MsgSwapExactAmountInAmino { + return o && (o.$typeUrl === MsgSwapExactAmountIn.typeUrl || typeof o.sender === "string" && Array.isArray(o.routes) && (!o.routes.length || SwapAmountInRoute.isAmino(o.routes[0])) && Coin.isAmino(o.token_in) && typeof o.token_out_min_amount === "string"); + }, encode(message: MsgSwapExactAmountIn, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.sender !== "") { writer.uint32(10).string(message.sender); @@ -236,6 +320,26 @@ export const MsgSwapExactAmountIn = { } return message; }, + fromJSON(object: any): MsgSwapExactAmountIn { + return { + sender: isSet(object.sender) ? String(object.sender) : "", + routes: Array.isArray(object?.routes) ? object.routes.map((e: any) => SwapAmountInRoute.fromJSON(e)) : [], + tokenIn: isSet(object.tokenIn) ? Coin.fromJSON(object.tokenIn) : undefined, + tokenOutMinAmount: isSet(object.tokenOutMinAmount) ? String(object.tokenOutMinAmount) : "" + }; + }, + toJSON(message: MsgSwapExactAmountIn): unknown { + const obj: any = {}; + message.sender !== undefined && (obj.sender = message.sender); + if (message.routes) { + obj.routes = message.routes.map(e => e ? SwapAmountInRoute.toJSON(e) : undefined); + } else { + obj.routes = []; + } + message.tokenIn !== undefined && (obj.tokenIn = message.tokenIn ? Coin.toJSON(message.tokenIn) : undefined); + message.tokenOutMinAmount !== undefined && (obj.tokenOutMinAmount = message.tokenOutMinAmount); + return obj; + }, fromPartial(object: Partial): MsgSwapExactAmountIn { const message = createBaseMsgSwapExactAmountIn(); message.sender = object.sender ?? ""; @@ -245,12 +349,18 @@ export const MsgSwapExactAmountIn = { return message; }, fromAmino(object: MsgSwapExactAmountInAmino): MsgSwapExactAmountIn { - return { - sender: object.sender, - routes: Array.isArray(object?.routes) ? object.routes.map((e: any) => SwapAmountInRoute.fromAmino(e)) : [], - tokenIn: object?.token_in ? Coin.fromAmino(object.token_in) : undefined, - tokenOutMinAmount: object.token_out_min_amount - }; + const message = createBaseMsgSwapExactAmountIn(); + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + message.routes = object.routes?.map(e => SwapAmountInRoute.fromAmino(e)) || []; + if (object.token_in !== undefined && object.token_in !== null) { + message.tokenIn = Coin.fromAmino(object.token_in); + } + if (object.token_out_min_amount !== undefined && object.token_out_min_amount !== null) { + message.tokenOutMinAmount = object.token_out_min_amount; + } + return message; }, toAmino(message: MsgSwapExactAmountIn): MsgSwapExactAmountInAmino { const obj: any = {}; @@ -286,6 +396,8 @@ export const MsgSwapExactAmountIn = { }; } }; +GlobalDecoderRegistry.register(MsgSwapExactAmountIn.typeUrl, MsgSwapExactAmountIn); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgSwapExactAmountIn.aminoType, MsgSwapExactAmountIn.typeUrl); function createBaseMsgSwapExactAmountInResponse(): MsgSwapExactAmountInResponse { return { tokenOutAmount: "" @@ -293,6 +405,16 @@ function createBaseMsgSwapExactAmountInResponse(): MsgSwapExactAmountInResponse } export const MsgSwapExactAmountInResponse = { typeUrl: "/osmosis.poolmanager.v1beta1.MsgSwapExactAmountInResponse", + aminoType: "osmosis/poolmanager/swap-exact-amount-in-response", + is(o: any): o is MsgSwapExactAmountInResponse { + return o && (o.$typeUrl === MsgSwapExactAmountInResponse.typeUrl || typeof o.tokenOutAmount === "string"); + }, + isSDK(o: any): o is MsgSwapExactAmountInResponseSDKType { + return o && (o.$typeUrl === MsgSwapExactAmountInResponse.typeUrl || typeof o.token_out_amount === "string"); + }, + isAmino(o: any): o is MsgSwapExactAmountInResponseAmino { + return o && (o.$typeUrl === MsgSwapExactAmountInResponse.typeUrl || typeof o.token_out_amount === "string"); + }, encode(message: MsgSwapExactAmountInResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.tokenOutAmount !== "") { writer.uint32(10).string(message.tokenOutAmount); @@ -316,15 +438,27 @@ export const MsgSwapExactAmountInResponse = { } return message; }, + fromJSON(object: any): MsgSwapExactAmountInResponse { + return { + tokenOutAmount: isSet(object.tokenOutAmount) ? String(object.tokenOutAmount) : "" + }; + }, + toJSON(message: MsgSwapExactAmountInResponse): unknown { + const obj: any = {}; + message.tokenOutAmount !== undefined && (obj.tokenOutAmount = message.tokenOutAmount); + return obj; + }, fromPartial(object: Partial): MsgSwapExactAmountInResponse { const message = createBaseMsgSwapExactAmountInResponse(); message.tokenOutAmount = object.tokenOutAmount ?? ""; return message; }, fromAmino(object: MsgSwapExactAmountInResponseAmino): MsgSwapExactAmountInResponse { - return { - tokenOutAmount: object.token_out_amount - }; + const message = createBaseMsgSwapExactAmountInResponse(); + if (object.token_out_amount !== undefined && object.token_out_amount !== null) { + message.tokenOutAmount = object.token_out_amount; + } + return message; }, toAmino(message: MsgSwapExactAmountInResponse): MsgSwapExactAmountInResponseAmino { const obj: any = {}; @@ -353,6 +487,8 @@ export const MsgSwapExactAmountInResponse = { }; } }; +GlobalDecoderRegistry.register(MsgSwapExactAmountInResponse.typeUrl, MsgSwapExactAmountInResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgSwapExactAmountInResponse.aminoType, MsgSwapExactAmountInResponse.typeUrl); function createBaseMsgSplitRouteSwapExactAmountIn(): MsgSplitRouteSwapExactAmountIn { return { sender: "", @@ -363,6 +499,16 @@ function createBaseMsgSplitRouteSwapExactAmountIn(): MsgSplitRouteSwapExactAmoun } export const MsgSplitRouteSwapExactAmountIn = { typeUrl: "/osmosis.poolmanager.v1beta1.MsgSplitRouteSwapExactAmountIn", + aminoType: "osmosis/poolmanager/split-amount-in", + is(o: any): o is MsgSplitRouteSwapExactAmountIn { + return o && (o.$typeUrl === MsgSplitRouteSwapExactAmountIn.typeUrl || typeof o.sender === "string" && Array.isArray(o.routes) && (!o.routes.length || SwapAmountInSplitRoute.is(o.routes[0])) && typeof o.tokenInDenom === "string" && typeof o.tokenOutMinAmount === "string"); + }, + isSDK(o: any): o is MsgSplitRouteSwapExactAmountInSDKType { + return o && (o.$typeUrl === MsgSplitRouteSwapExactAmountIn.typeUrl || typeof o.sender === "string" && Array.isArray(o.routes) && (!o.routes.length || SwapAmountInSplitRoute.isSDK(o.routes[0])) && typeof o.token_in_denom === "string" && typeof o.token_out_min_amount === "string"); + }, + isAmino(o: any): o is MsgSplitRouteSwapExactAmountInAmino { + return o && (o.$typeUrl === MsgSplitRouteSwapExactAmountIn.typeUrl || typeof o.sender === "string" && Array.isArray(o.routes) && (!o.routes.length || SwapAmountInSplitRoute.isAmino(o.routes[0])) && typeof o.token_in_denom === "string" && typeof o.token_out_min_amount === "string"); + }, encode(message: MsgSplitRouteSwapExactAmountIn, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.sender !== "") { writer.uint32(10).string(message.sender); @@ -404,6 +550,26 @@ export const MsgSplitRouteSwapExactAmountIn = { } return message; }, + fromJSON(object: any): MsgSplitRouteSwapExactAmountIn { + return { + sender: isSet(object.sender) ? String(object.sender) : "", + routes: Array.isArray(object?.routes) ? object.routes.map((e: any) => SwapAmountInSplitRoute.fromJSON(e)) : [], + tokenInDenom: isSet(object.tokenInDenom) ? String(object.tokenInDenom) : "", + tokenOutMinAmount: isSet(object.tokenOutMinAmount) ? String(object.tokenOutMinAmount) : "" + }; + }, + toJSON(message: MsgSplitRouteSwapExactAmountIn): unknown { + const obj: any = {}; + message.sender !== undefined && (obj.sender = message.sender); + if (message.routes) { + obj.routes = message.routes.map(e => e ? SwapAmountInSplitRoute.toJSON(e) : undefined); + } else { + obj.routes = []; + } + message.tokenInDenom !== undefined && (obj.tokenInDenom = message.tokenInDenom); + message.tokenOutMinAmount !== undefined && (obj.tokenOutMinAmount = message.tokenOutMinAmount); + return obj; + }, fromPartial(object: Partial): MsgSplitRouteSwapExactAmountIn { const message = createBaseMsgSplitRouteSwapExactAmountIn(); message.sender = object.sender ?? ""; @@ -413,12 +579,18 @@ export const MsgSplitRouteSwapExactAmountIn = { return message; }, fromAmino(object: MsgSplitRouteSwapExactAmountInAmino): MsgSplitRouteSwapExactAmountIn { - return { - sender: object.sender, - routes: Array.isArray(object?.routes) ? object.routes.map((e: any) => SwapAmountInSplitRoute.fromAmino(e)) : [], - tokenInDenom: object.token_in_denom, - tokenOutMinAmount: object.token_out_min_amount - }; + const message = createBaseMsgSplitRouteSwapExactAmountIn(); + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + message.routes = object.routes?.map(e => SwapAmountInSplitRoute.fromAmino(e)) || []; + if (object.token_in_denom !== undefined && object.token_in_denom !== null) { + message.tokenInDenom = object.token_in_denom; + } + if (object.token_out_min_amount !== undefined && object.token_out_min_amount !== null) { + message.tokenOutMinAmount = object.token_out_min_amount; + } + return message; }, toAmino(message: MsgSplitRouteSwapExactAmountIn): MsgSplitRouteSwapExactAmountInAmino { const obj: any = {}; @@ -437,7 +609,7 @@ export const MsgSplitRouteSwapExactAmountIn = { }, toAminoMsg(message: MsgSplitRouteSwapExactAmountIn): MsgSplitRouteSwapExactAmountInAminoMsg { return { - type: "osmosis/poolmanager/split-route-swap-exact-amount-in", + type: "osmosis/poolmanager/split-amount-in", value: MsgSplitRouteSwapExactAmountIn.toAmino(message) }; }, @@ -454,6 +626,8 @@ export const MsgSplitRouteSwapExactAmountIn = { }; } }; +GlobalDecoderRegistry.register(MsgSplitRouteSwapExactAmountIn.typeUrl, MsgSplitRouteSwapExactAmountIn); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgSplitRouteSwapExactAmountIn.aminoType, MsgSplitRouteSwapExactAmountIn.typeUrl); function createBaseMsgSplitRouteSwapExactAmountInResponse(): MsgSplitRouteSwapExactAmountInResponse { return { tokenOutAmount: "" @@ -461,6 +635,16 @@ function createBaseMsgSplitRouteSwapExactAmountInResponse(): MsgSplitRouteSwapEx } export const MsgSplitRouteSwapExactAmountInResponse = { typeUrl: "/osmosis.poolmanager.v1beta1.MsgSplitRouteSwapExactAmountInResponse", + aminoType: "osmosis/poolmanager/split-route-swap-exact-amount-in-response", + is(o: any): o is MsgSplitRouteSwapExactAmountInResponse { + return o && (o.$typeUrl === MsgSplitRouteSwapExactAmountInResponse.typeUrl || typeof o.tokenOutAmount === "string"); + }, + isSDK(o: any): o is MsgSplitRouteSwapExactAmountInResponseSDKType { + return o && (o.$typeUrl === MsgSplitRouteSwapExactAmountInResponse.typeUrl || typeof o.token_out_amount === "string"); + }, + isAmino(o: any): o is MsgSplitRouteSwapExactAmountInResponseAmino { + return o && (o.$typeUrl === MsgSplitRouteSwapExactAmountInResponse.typeUrl || typeof o.token_out_amount === "string"); + }, encode(message: MsgSplitRouteSwapExactAmountInResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.tokenOutAmount !== "") { writer.uint32(10).string(message.tokenOutAmount); @@ -484,15 +668,27 @@ export const MsgSplitRouteSwapExactAmountInResponse = { } return message; }, + fromJSON(object: any): MsgSplitRouteSwapExactAmountInResponse { + return { + tokenOutAmount: isSet(object.tokenOutAmount) ? String(object.tokenOutAmount) : "" + }; + }, + toJSON(message: MsgSplitRouteSwapExactAmountInResponse): unknown { + const obj: any = {}; + message.tokenOutAmount !== undefined && (obj.tokenOutAmount = message.tokenOutAmount); + return obj; + }, fromPartial(object: Partial): MsgSplitRouteSwapExactAmountInResponse { const message = createBaseMsgSplitRouteSwapExactAmountInResponse(); message.tokenOutAmount = object.tokenOutAmount ?? ""; return message; }, fromAmino(object: MsgSplitRouteSwapExactAmountInResponseAmino): MsgSplitRouteSwapExactAmountInResponse { - return { - tokenOutAmount: object.token_out_amount - }; + const message = createBaseMsgSplitRouteSwapExactAmountInResponse(); + if (object.token_out_amount !== undefined && object.token_out_amount !== null) { + message.tokenOutAmount = object.token_out_amount; + } + return message; }, toAmino(message: MsgSplitRouteSwapExactAmountInResponse): MsgSplitRouteSwapExactAmountInResponseAmino { const obj: any = {}; @@ -521,16 +717,28 @@ export const MsgSplitRouteSwapExactAmountInResponse = { }; } }; +GlobalDecoderRegistry.register(MsgSplitRouteSwapExactAmountInResponse.typeUrl, MsgSplitRouteSwapExactAmountInResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgSplitRouteSwapExactAmountInResponse.aminoType, MsgSplitRouteSwapExactAmountInResponse.typeUrl); function createBaseMsgSwapExactAmountOut(): MsgSwapExactAmountOut { return { sender: "", routes: [], tokenInMaxAmount: "", - tokenOut: undefined + tokenOut: Coin.fromPartial({}) }; } export const MsgSwapExactAmountOut = { typeUrl: "/osmosis.poolmanager.v1beta1.MsgSwapExactAmountOut", + aminoType: "osmosis/poolmanager/swap-exact-amount-out", + is(o: any): o is MsgSwapExactAmountOut { + return o && (o.$typeUrl === MsgSwapExactAmountOut.typeUrl || typeof o.sender === "string" && Array.isArray(o.routes) && (!o.routes.length || SwapAmountOutRoute.is(o.routes[0])) && typeof o.tokenInMaxAmount === "string" && Coin.is(o.tokenOut)); + }, + isSDK(o: any): o is MsgSwapExactAmountOutSDKType { + return o && (o.$typeUrl === MsgSwapExactAmountOut.typeUrl || typeof o.sender === "string" && Array.isArray(o.routes) && (!o.routes.length || SwapAmountOutRoute.isSDK(o.routes[0])) && typeof o.token_in_max_amount === "string" && Coin.isSDK(o.token_out)); + }, + isAmino(o: any): o is MsgSwapExactAmountOutAmino { + return o && (o.$typeUrl === MsgSwapExactAmountOut.typeUrl || typeof o.sender === "string" && Array.isArray(o.routes) && (!o.routes.length || SwapAmountOutRoute.isAmino(o.routes[0])) && typeof o.token_in_max_amount === "string" && Coin.isAmino(o.token_out)); + }, encode(message: MsgSwapExactAmountOut, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.sender !== "") { writer.uint32(10).string(message.sender); @@ -572,6 +780,26 @@ export const MsgSwapExactAmountOut = { } return message; }, + fromJSON(object: any): MsgSwapExactAmountOut { + return { + sender: isSet(object.sender) ? String(object.sender) : "", + routes: Array.isArray(object?.routes) ? object.routes.map((e: any) => SwapAmountOutRoute.fromJSON(e)) : [], + tokenInMaxAmount: isSet(object.tokenInMaxAmount) ? String(object.tokenInMaxAmount) : "", + tokenOut: isSet(object.tokenOut) ? Coin.fromJSON(object.tokenOut) : undefined + }; + }, + toJSON(message: MsgSwapExactAmountOut): unknown { + const obj: any = {}; + message.sender !== undefined && (obj.sender = message.sender); + if (message.routes) { + obj.routes = message.routes.map(e => e ? SwapAmountOutRoute.toJSON(e) : undefined); + } else { + obj.routes = []; + } + message.tokenInMaxAmount !== undefined && (obj.tokenInMaxAmount = message.tokenInMaxAmount); + message.tokenOut !== undefined && (obj.tokenOut = message.tokenOut ? Coin.toJSON(message.tokenOut) : undefined); + return obj; + }, fromPartial(object: Partial): MsgSwapExactAmountOut { const message = createBaseMsgSwapExactAmountOut(); message.sender = object.sender ?? ""; @@ -581,12 +809,18 @@ export const MsgSwapExactAmountOut = { return message; }, fromAmino(object: MsgSwapExactAmountOutAmino): MsgSwapExactAmountOut { - return { - sender: object.sender, - routes: Array.isArray(object?.routes) ? object.routes.map((e: any) => SwapAmountOutRoute.fromAmino(e)) : [], - tokenInMaxAmount: object.token_in_max_amount, - tokenOut: object?.token_out ? Coin.fromAmino(object.token_out) : undefined - }; + const message = createBaseMsgSwapExactAmountOut(); + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + message.routes = object.routes?.map(e => SwapAmountOutRoute.fromAmino(e)) || []; + if (object.token_in_max_amount !== undefined && object.token_in_max_amount !== null) { + message.tokenInMaxAmount = object.token_in_max_amount; + } + if (object.token_out !== undefined && object.token_out !== null) { + message.tokenOut = Coin.fromAmino(object.token_out); + } + return message; }, toAmino(message: MsgSwapExactAmountOut): MsgSwapExactAmountOutAmino { const obj: any = {}; @@ -622,6 +856,8 @@ export const MsgSwapExactAmountOut = { }; } }; +GlobalDecoderRegistry.register(MsgSwapExactAmountOut.typeUrl, MsgSwapExactAmountOut); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgSwapExactAmountOut.aminoType, MsgSwapExactAmountOut.typeUrl); function createBaseMsgSwapExactAmountOutResponse(): MsgSwapExactAmountOutResponse { return { tokenInAmount: "" @@ -629,6 +865,16 @@ function createBaseMsgSwapExactAmountOutResponse(): MsgSwapExactAmountOutRespons } export const MsgSwapExactAmountOutResponse = { typeUrl: "/osmosis.poolmanager.v1beta1.MsgSwapExactAmountOutResponse", + aminoType: "osmosis/poolmanager/swap-exact-amount-out-response", + is(o: any): o is MsgSwapExactAmountOutResponse { + return o && (o.$typeUrl === MsgSwapExactAmountOutResponse.typeUrl || typeof o.tokenInAmount === "string"); + }, + isSDK(o: any): o is MsgSwapExactAmountOutResponseSDKType { + return o && (o.$typeUrl === MsgSwapExactAmountOutResponse.typeUrl || typeof o.token_in_amount === "string"); + }, + isAmino(o: any): o is MsgSwapExactAmountOutResponseAmino { + return o && (o.$typeUrl === MsgSwapExactAmountOutResponse.typeUrl || typeof o.token_in_amount === "string"); + }, encode(message: MsgSwapExactAmountOutResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.tokenInAmount !== "") { writer.uint32(10).string(message.tokenInAmount); @@ -652,15 +898,27 @@ export const MsgSwapExactAmountOutResponse = { } return message; }, + fromJSON(object: any): MsgSwapExactAmountOutResponse { + return { + tokenInAmount: isSet(object.tokenInAmount) ? String(object.tokenInAmount) : "" + }; + }, + toJSON(message: MsgSwapExactAmountOutResponse): unknown { + const obj: any = {}; + message.tokenInAmount !== undefined && (obj.tokenInAmount = message.tokenInAmount); + return obj; + }, fromPartial(object: Partial): MsgSwapExactAmountOutResponse { const message = createBaseMsgSwapExactAmountOutResponse(); message.tokenInAmount = object.tokenInAmount ?? ""; return message; }, fromAmino(object: MsgSwapExactAmountOutResponseAmino): MsgSwapExactAmountOutResponse { - return { - tokenInAmount: object.token_in_amount - }; + const message = createBaseMsgSwapExactAmountOutResponse(); + if (object.token_in_amount !== undefined && object.token_in_amount !== null) { + message.tokenInAmount = object.token_in_amount; + } + return message; }, toAmino(message: MsgSwapExactAmountOutResponse): MsgSwapExactAmountOutResponseAmino { const obj: any = {}; @@ -689,6 +947,8 @@ export const MsgSwapExactAmountOutResponse = { }; } }; +GlobalDecoderRegistry.register(MsgSwapExactAmountOutResponse.typeUrl, MsgSwapExactAmountOutResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgSwapExactAmountOutResponse.aminoType, MsgSwapExactAmountOutResponse.typeUrl); function createBaseMsgSplitRouteSwapExactAmountOut(): MsgSplitRouteSwapExactAmountOut { return { sender: "", @@ -699,6 +959,16 @@ function createBaseMsgSplitRouteSwapExactAmountOut(): MsgSplitRouteSwapExactAmou } export const MsgSplitRouteSwapExactAmountOut = { typeUrl: "/osmosis.poolmanager.v1beta1.MsgSplitRouteSwapExactAmountOut", + aminoType: "osmosis/poolmanager/split-amount-out", + is(o: any): o is MsgSplitRouteSwapExactAmountOut { + return o && (o.$typeUrl === MsgSplitRouteSwapExactAmountOut.typeUrl || typeof o.sender === "string" && Array.isArray(o.routes) && (!o.routes.length || SwapAmountOutSplitRoute.is(o.routes[0])) && typeof o.tokenOutDenom === "string" && typeof o.tokenInMaxAmount === "string"); + }, + isSDK(o: any): o is MsgSplitRouteSwapExactAmountOutSDKType { + return o && (o.$typeUrl === MsgSplitRouteSwapExactAmountOut.typeUrl || typeof o.sender === "string" && Array.isArray(o.routes) && (!o.routes.length || SwapAmountOutSplitRoute.isSDK(o.routes[0])) && typeof o.token_out_denom === "string" && typeof o.token_in_max_amount === "string"); + }, + isAmino(o: any): o is MsgSplitRouteSwapExactAmountOutAmino { + return o && (o.$typeUrl === MsgSplitRouteSwapExactAmountOut.typeUrl || typeof o.sender === "string" && Array.isArray(o.routes) && (!o.routes.length || SwapAmountOutSplitRoute.isAmino(o.routes[0])) && typeof o.token_out_denom === "string" && typeof o.token_in_max_amount === "string"); + }, encode(message: MsgSplitRouteSwapExactAmountOut, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.sender !== "") { writer.uint32(10).string(message.sender); @@ -740,6 +1010,26 @@ export const MsgSplitRouteSwapExactAmountOut = { } return message; }, + fromJSON(object: any): MsgSplitRouteSwapExactAmountOut { + return { + sender: isSet(object.sender) ? String(object.sender) : "", + routes: Array.isArray(object?.routes) ? object.routes.map((e: any) => SwapAmountOutSplitRoute.fromJSON(e)) : [], + tokenOutDenom: isSet(object.tokenOutDenom) ? String(object.tokenOutDenom) : "", + tokenInMaxAmount: isSet(object.tokenInMaxAmount) ? String(object.tokenInMaxAmount) : "" + }; + }, + toJSON(message: MsgSplitRouteSwapExactAmountOut): unknown { + const obj: any = {}; + message.sender !== undefined && (obj.sender = message.sender); + if (message.routes) { + obj.routes = message.routes.map(e => e ? SwapAmountOutSplitRoute.toJSON(e) : undefined); + } else { + obj.routes = []; + } + message.tokenOutDenom !== undefined && (obj.tokenOutDenom = message.tokenOutDenom); + message.tokenInMaxAmount !== undefined && (obj.tokenInMaxAmount = message.tokenInMaxAmount); + return obj; + }, fromPartial(object: Partial): MsgSplitRouteSwapExactAmountOut { const message = createBaseMsgSplitRouteSwapExactAmountOut(); message.sender = object.sender ?? ""; @@ -749,12 +1039,18 @@ export const MsgSplitRouteSwapExactAmountOut = { return message; }, fromAmino(object: MsgSplitRouteSwapExactAmountOutAmino): MsgSplitRouteSwapExactAmountOut { - return { - sender: object.sender, - routes: Array.isArray(object?.routes) ? object.routes.map((e: any) => SwapAmountOutSplitRoute.fromAmino(e)) : [], - tokenOutDenom: object.token_out_denom, - tokenInMaxAmount: object.token_in_max_amount - }; + const message = createBaseMsgSplitRouteSwapExactAmountOut(); + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + message.routes = object.routes?.map(e => SwapAmountOutSplitRoute.fromAmino(e)) || []; + if (object.token_out_denom !== undefined && object.token_out_denom !== null) { + message.tokenOutDenom = object.token_out_denom; + } + if (object.token_in_max_amount !== undefined && object.token_in_max_amount !== null) { + message.tokenInMaxAmount = object.token_in_max_amount; + } + return message; }, toAmino(message: MsgSplitRouteSwapExactAmountOut): MsgSplitRouteSwapExactAmountOutAmino { const obj: any = {}; @@ -773,7 +1069,7 @@ export const MsgSplitRouteSwapExactAmountOut = { }, toAminoMsg(message: MsgSplitRouteSwapExactAmountOut): MsgSplitRouteSwapExactAmountOutAminoMsg { return { - type: "osmosis/poolmanager/split-route-swap-exact-amount-out", + type: "osmosis/poolmanager/split-amount-out", value: MsgSplitRouteSwapExactAmountOut.toAmino(message) }; }, @@ -790,6 +1086,8 @@ export const MsgSplitRouteSwapExactAmountOut = { }; } }; +GlobalDecoderRegistry.register(MsgSplitRouteSwapExactAmountOut.typeUrl, MsgSplitRouteSwapExactAmountOut); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgSplitRouteSwapExactAmountOut.aminoType, MsgSplitRouteSwapExactAmountOut.typeUrl); function createBaseMsgSplitRouteSwapExactAmountOutResponse(): MsgSplitRouteSwapExactAmountOutResponse { return { tokenInAmount: "" @@ -797,6 +1095,16 @@ function createBaseMsgSplitRouteSwapExactAmountOutResponse(): MsgSplitRouteSwapE } export const MsgSplitRouteSwapExactAmountOutResponse = { typeUrl: "/osmosis.poolmanager.v1beta1.MsgSplitRouteSwapExactAmountOutResponse", + aminoType: "osmosis/poolmanager/split-route-swap-exact-amount-out-response", + is(o: any): o is MsgSplitRouteSwapExactAmountOutResponse { + return o && (o.$typeUrl === MsgSplitRouteSwapExactAmountOutResponse.typeUrl || typeof o.tokenInAmount === "string"); + }, + isSDK(o: any): o is MsgSplitRouteSwapExactAmountOutResponseSDKType { + return o && (o.$typeUrl === MsgSplitRouteSwapExactAmountOutResponse.typeUrl || typeof o.token_in_amount === "string"); + }, + isAmino(o: any): o is MsgSplitRouteSwapExactAmountOutResponseAmino { + return o && (o.$typeUrl === MsgSplitRouteSwapExactAmountOutResponse.typeUrl || typeof o.token_in_amount === "string"); + }, encode(message: MsgSplitRouteSwapExactAmountOutResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.tokenInAmount !== "") { writer.uint32(10).string(message.tokenInAmount); @@ -820,15 +1128,27 @@ export const MsgSplitRouteSwapExactAmountOutResponse = { } return message; }, + fromJSON(object: any): MsgSplitRouteSwapExactAmountOutResponse { + return { + tokenInAmount: isSet(object.tokenInAmount) ? String(object.tokenInAmount) : "" + }; + }, + toJSON(message: MsgSplitRouteSwapExactAmountOutResponse): unknown { + const obj: any = {}; + message.tokenInAmount !== undefined && (obj.tokenInAmount = message.tokenInAmount); + return obj; + }, fromPartial(object: Partial): MsgSplitRouteSwapExactAmountOutResponse { const message = createBaseMsgSplitRouteSwapExactAmountOutResponse(); message.tokenInAmount = object.tokenInAmount ?? ""; return message; }, fromAmino(object: MsgSplitRouteSwapExactAmountOutResponseAmino): MsgSplitRouteSwapExactAmountOutResponse { - return { - tokenInAmount: object.token_in_amount - }; + const message = createBaseMsgSplitRouteSwapExactAmountOutResponse(); + if (object.token_in_amount !== undefined && object.token_in_amount !== null) { + message.tokenInAmount = object.token_in_amount; + } + return message; }, toAmino(message: MsgSplitRouteSwapExactAmountOutResponse): MsgSplitRouteSwapExactAmountOutResponseAmino { const obj: any = {}; @@ -856,4 +1176,327 @@ export const MsgSplitRouteSwapExactAmountOutResponse = { value: MsgSplitRouteSwapExactAmountOutResponse.encode(message).finish() }; } -}; \ No newline at end of file +}; +GlobalDecoderRegistry.register(MsgSplitRouteSwapExactAmountOutResponse.typeUrl, MsgSplitRouteSwapExactAmountOutResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgSplitRouteSwapExactAmountOutResponse.aminoType, MsgSplitRouteSwapExactAmountOutResponse.typeUrl); +function createBaseMsgSetDenomPairTakerFee(): MsgSetDenomPairTakerFee { + return { + sender: "", + denomPairTakerFee: [] + }; +} +export const MsgSetDenomPairTakerFee = { + typeUrl: "/osmosis.poolmanager.v1beta1.MsgSetDenomPairTakerFee", + aminoType: "osmosis/poolmanager/set-denom-pair-taker-fee", + is(o: any): o is MsgSetDenomPairTakerFee { + return o && (o.$typeUrl === MsgSetDenomPairTakerFee.typeUrl || typeof o.sender === "string" && Array.isArray(o.denomPairTakerFee) && (!o.denomPairTakerFee.length || DenomPairTakerFee.is(o.denomPairTakerFee[0]))); + }, + isSDK(o: any): o is MsgSetDenomPairTakerFeeSDKType { + return o && (o.$typeUrl === MsgSetDenomPairTakerFee.typeUrl || typeof o.sender === "string" && Array.isArray(o.denom_pair_taker_fee) && (!o.denom_pair_taker_fee.length || DenomPairTakerFee.isSDK(o.denom_pair_taker_fee[0]))); + }, + isAmino(o: any): o is MsgSetDenomPairTakerFeeAmino { + return o && (o.$typeUrl === MsgSetDenomPairTakerFee.typeUrl || typeof o.sender === "string" && Array.isArray(o.denom_pair_taker_fee) && (!o.denom_pair_taker_fee.length || DenomPairTakerFee.isAmino(o.denom_pair_taker_fee[0]))); + }, + encode(message: MsgSetDenomPairTakerFee, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.sender !== "") { + writer.uint32(10).string(message.sender); + } + for (const v of message.denomPairTakerFee) { + DenomPairTakerFee.encode(v!, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgSetDenomPairTakerFee { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgSetDenomPairTakerFee(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.sender = reader.string(); + break; + case 2: + message.denomPairTakerFee.push(DenomPairTakerFee.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): MsgSetDenomPairTakerFee { + return { + sender: isSet(object.sender) ? String(object.sender) : "", + denomPairTakerFee: Array.isArray(object?.denomPairTakerFee) ? object.denomPairTakerFee.map((e: any) => DenomPairTakerFee.fromJSON(e)) : [] + }; + }, + toJSON(message: MsgSetDenomPairTakerFee): unknown { + const obj: any = {}; + message.sender !== undefined && (obj.sender = message.sender); + if (message.denomPairTakerFee) { + obj.denomPairTakerFee = message.denomPairTakerFee.map(e => e ? DenomPairTakerFee.toJSON(e) : undefined); + } else { + obj.denomPairTakerFee = []; + } + return obj; + }, + fromPartial(object: Partial): MsgSetDenomPairTakerFee { + const message = createBaseMsgSetDenomPairTakerFee(); + message.sender = object.sender ?? ""; + message.denomPairTakerFee = object.denomPairTakerFee?.map(e => DenomPairTakerFee.fromPartial(e)) || []; + return message; + }, + fromAmino(object: MsgSetDenomPairTakerFeeAmino): MsgSetDenomPairTakerFee { + const message = createBaseMsgSetDenomPairTakerFee(); + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + message.denomPairTakerFee = object.denom_pair_taker_fee?.map(e => DenomPairTakerFee.fromAmino(e)) || []; + return message; + }, + toAmino(message: MsgSetDenomPairTakerFee): MsgSetDenomPairTakerFeeAmino { + const obj: any = {}; + obj.sender = message.sender; + if (message.denomPairTakerFee) { + obj.denom_pair_taker_fee = message.denomPairTakerFee.map(e => e ? DenomPairTakerFee.toAmino(e) : undefined); + } else { + obj.denom_pair_taker_fee = []; + } + return obj; + }, + fromAminoMsg(object: MsgSetDenomPairTakerFeeAminoMsg): MsgSetDenomPairTakerFee { + return MsgSetDenomPairTakerFee.fromAmino(object.value); + }, + toAminoMsg(message: MsgSetDenomPairTakerFee): MsgSetDenomPairTakerFeeAminoMsg { + return { + type: "osmosis/poolmanager/set-denom-pair-taker-fee", + value: MsgSetDenomPairTakerFee.toAmino(message) + }; + }, + fromProtoMsg(message: MsgSetDenomPairTakerFeeProtoMsg): MsgSetDenomPairTakerFee { + return MsgSetDenomPairTakerFee.decode(message.value); + }, + toProto(message: MsgSetDenomPairTakerFee): Uint8Array { + return MsgSetDenomPairTakerFee.encode(message).finish(); + }, + toProtoMsg(message: MsgSetDenomPairTakerFee): MsgSetDenomPairTakerFeeProtoMsg { + return { + typeUrl: "/osmosis.poolmanager.v1beta1.MsgSetDenomPairTakerFee", + value: MsgSetDenomPairTakerFee.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgSetDenomPairTakerFee.typeUrl, MsgSetDenomPairTakerFee); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgSetDenomPairTakerFee.aminoType, MsgSetDenomPairTakerFee.typeUrl); +function createBaseMsgSetDenomPairTakerFeeResponse(): MsgSetDenomPairTakerFeeResponse { + return { + success: false + }; +} +export const MsgSetDenomPairTakerFeeResponse = { + typeUrl: "/osmosis.poolmanager.v1beta1.MsgSetDenomPairTakerFeeResponse", + aminoType: "osmosis/poolmanager/set-denom-pair-taker-fee-response", + is(o: any): o is MsgSetDenomPairTakerFeeResponse { + return o && (o.$typeUrl === MsgSetDenomPairTakerFeeResponse.typeUrl || typeof o.success === "boolean"); + }, + isSDK(o: any): o is MsgSetDenomPairTakerFeeResponseSDKType { + return o && (o.$typeUrl === MsgSetDenomPairTakerFeeResponse.typeUrl || typeof o.success === "boolean"); + }, + isAmino(o: any): o is MsgSetDenomPairTakerFeeResponseAmino { + return o && (o.$typeUrl === MsgSetDenomPairTakerFeeResponse.typeUrl || typeof o.success === "boolean"); + }, + encode(message: MsgSetDenomPairTakerFeeResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.success === true) { + writer.uint32(8).bool(message.success); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgSetDenomPairTakerFeeResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgSetDenomPairTakerFeeResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.success = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): MsgSetDenomPairTakerFeeResponse { + return { + success: isSet(object.success) ? Boolean(object.success) : false + }; + }, + toJSON(message: MsgSetDenomPairTakerFeeResponse): unknown { + const obj: any = {}; + message.success !== undefined && (obj.success = message.success); + return obj; + }, + fromPartial(object: Partial): MsgSetDenomPairTakerFeeResponse { + const message = createBaseMsgSetDenomPairTakerFeeResponse(); + message.success = object.success ?? false; + return message; + }, + fromAmino(object: MsgSetDenomPairTakerFeeResponseAmino): MsgSetDenomPairTakerFeeResponse { + const message = createBaseMsgSetDenomPairTakerFeeResponse(); + if (object.success !== undefined && object.success !== null) { + message.success = object.success; + } + return message; + }, + toAmino(message: MsgSetDenomPairTakerFeeResponse): MsgSetDenomPairTakerFeeResponseAmino { + const obj: any = {}; + obj.success = message.success; + return obj; + }, + fromAminoMsg(object: MsgSetDenomPairTakerFeeResponseAminoMsg): MsgSetDenomPairTakerFeeResponse { + return MsgSetDenomPairTakerFeeResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgSetDenomPairTakerFeeResponse): MsgSetDenomPairTakerFeeResponseAminoMsg { + return { + type: "osmosis/poolmanager/set-denom-pair-taker-fee-response", + value: MsgSetDenomPairTakerFeeResponse.toAmino(message) + }; + }, + fromProtoMsg(message: MsgSetDenomPairTakerFeeResponseProtoMsg): MsgSetDenomPairTakerFeeResponse { + return MsgSetDenomPairTakerFeeResponse.decode(message.value); + }, + toProto(message: MsgSetDenomPairTakerFeeResponse): Uint8Array { + return MsgSetDenomPairTakerFeeResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgSetDenomPairTakerFeeResponse): MsgSetDenomPairTakerFeeResponseProtoMsg { + return { + typeUrl: "/osmosis.poolmanager.v1beta1.MsgSetDenomPairTakerFeeResponse", + value: MsgSetDenomPairTakerFeeResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgSetDenomPairTakerFeeResponse.typeUrl, MsgSetDenomPairTakerFeeResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgSetDenomPairTakerFeeResponse.aminoType, MsgSetDenomPairTakerFeeResponse.typeUrl); +function createBaseDenomPairTakerFee(): DenomPairTakerFee { + return { + denom0: "", + denom1: "", + takerFee: "" + }; +} +export const DenomPairTakerFee = { + typeUrl: "/osmosis.poolmanager.v1beta1.DenomPairTakerFee", + aminoType: "osmosis/poolmanager/denom-pair-taker-fee", + is(o: any): o is DenomPairTakerFee { + return o && (o.$typeUrl === DenomPairTakerFee.typeUrl || typeof o.denom0 === "string" && typeof o.denom1 === "string" && typeof o.takerFee === "string"); + }, + isSDK(o: any): o is DenomPairTakerFeeSDKType { + return o && (o.$typeUrl === DenomPairTakerFee.typeUrl || typeof o.denom0 === "string" && typeof o.denom1 === "string" && typeof o.taker_fee === "string"); + }, + isAmino(o: any): o is DenomPairTakerFeeAmino { + return o && (o.$typeUrl === DenomPairTakerFee.typeUrl || typeof o.denom0 === "string" && typeof o.denom1 === "string" && typeof o.taker_fee === "string"); + }, + encode(message: DenomPairTakerFee, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.denom0 !== "") { + writer.uint32(10).string(message.denom0); + } + if (message.denom1 !== "") { + writer.uint32(18).string(message.denom1); + } + if (message.takerFee !== "") { + writer.uint32(26).string(Decimal.fromUserInput(message.takerFee, 18).atomics); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): DenomPairTakerFee { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseDenomPairTakerFee(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.denom0 = reader.string(); + break; + case 2: + message.denom1 = reader.string(); + break; + case 3: + message.takerFee = Decimal.fromAtomics(reader.string(), 18).toString(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): DenomPairTakerFee { + return { + denom0: isSet(object.denom0) ? String(object.denom0) : "", + denom1: isSet(object.denom1) ? String(object.denom1) : "", + takerFee: isSet(object.takerFee) ? String(object.takerFee) : "" + }; + }, + toJSON(message: DenomPairTakerFee): unknown { + const obj: any = {}; + message.denom0 !== undefined && (obj.denom0 = message.denom0); + message.denom1 !== undefined && (obj.denom1 = message.denom1); + message.takerFee !== undefined && (obj.takerFee = message.takerFee); + return obj; + }, + fromPartial(object: Partial): DenomPairTakerFee { + const message = createBaseDenomPairTakerFee(); + message.denom0 = object.denom0 ?? ""; + message.denom1 = object.denom1 ?? ""; + message.takerFee = object.takerFee ?? ""; + return message; + }, + fromAmino(object: DenomPairTakerFeeAmino): DenomPairTakerFee { + const message = createBaseDenomPairTakerFee(); + if (object.denom0 !== undefined && object.denom0 !== null) { + message.denom0 = object.denom0; + } + if (object.denom1 !== undefined && object.denom1 !== null) { + message.denom1 = object.denom1; + } + if (object.taker_fee !== undefined && object.taker_fee !== null) { + message.takerFee = object.taker_fee; + } + return message; + }, + toAmino(message: DenomPairTakerFee): DenomPairTakerFeeAmino { + const obj: any = {}; + obj.denom0 = message.denom0; + obj.denom1 = message.denom1; + obj.taker_fee = message.takerFee; + return obj; + }, + fromAminoMsg(object: DenomPairTakerFeeAminoMsg): DenomPairTakerFee { + return DenomPairTakerFee.fromAmino(object.value); + }, + toAminoMsg(message: DenomPairTakerFee): DenomPairTakerFeeAminoMsg { + return { + type: "osmosis/poolmanager/denom-pair-taker-fee", + value: DenomPairTakerFee.toAmino(message) + }; + }, + fromProtoMsg(message: DenomPairTakerFeeProtoMsg): DenomPairTakerFee { + return DenomPairTakerFee.decode(message.value); + }, + toProto(message: DenomPairTakerFee): Uint8Array { + return DenomPairTakerFee.encode(message).finish(); + }, + toProtoMsg(message: DenomPairTakerFee): DenomPairTakerFeeProtoMsg { + return { + typeUrl: "/osmosis.poolmanager.v1beta1.DenomPairTakerFee", + value: DenomPairTakerFee.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(DenomPairTakerFee.typeUrl, DenomPairTakerFee); +GlobalDecoderRegistry.registerAminoProtoMapping(DenomPairTakerFee.aminoType, DenomPairTakerFee.typeUrl); \ No newline at end of file diff --git a/packages/osmojs/src/codegen/osmosis/poolmanager/v2/query.lcd.ts b/packages/osmojs/src/codegen/osmosis/poolmanager/v2/query.lcd.ts new file mode 100644 index 000000000..df5a108c8 --- /dev/null +++ b/packages/osmojs/src/codegen/osmosis/poolmanager/v2/query.lcd.ts @@ -0,0 +1,31 @@ +import { LCDClient } from "@cosmology/lcd"; +import { SpotPriceRequest, SpotPriceResponseSDKType } from "./query"; +export class LCDQueryClient { + req: LCDClient; + constructor({ + requestClient + }: { + requestClient: LCDClient; + }) { + this.req = requestClient; + this.spotPriceV2 = this.spotPriceV2.bind(this); + } + /* SpotPriceV2 defines a gRPC query handler that returns the spot price given + a base denomination and a quote denomination. + The returned spot price has 36 decimal places. However, some of + modules perform sig fig rounding so most of the rightmost decimals can be + zeroes. */ + async spotPriceV2(params: SpotPriceRequest): Promise { + const options: any = { + params: {} + }; + if (typeof params?.baseAssetDenom !== "undefined") { + options.params.base_asset_denom = params.baseAssetDenom; + } + if (typeof params?.quoteAssetDenom !== "undefined") { + options.params.quote_asset_denom = params.quoteAssetDenom; + } + const endpoint = `osmosis/poolmanager/v2/pools/${params.poolId}/prices`; + return await this.req.get(endpoint, options); + } +} \ No newline at end of file diff --git a/packages/osmojs/src/codegen/osmosis/poolmanager/v2/query.rpc.Query.ts b/packages/osmojs/src/codegen/osmosis/poolmanager/v2/query.rpc.Query.ts new file mode 100644 index 000000000..249388424 --- /dev/null +++ b/packages/osmojs/src/codegen/osmosis/poolmanager/v2/query.rpc.Query.ts @@ -0,0 +1,35 @@ +import { Rpc } from "../../../helpers"; +import { BinaryReader } from "../../../binary"; +import { QueryClient, createProtobufRpcClient } from "@cosmjs/stargate"; +import { SpotPriceRequest, SpotPriceResponse } from "./query"; +export interface Query { + /** + * SpotPriceV2 defines a gRPC query handler that returns the spot price given + * a base denomination and a quote denomination. + * The returned spot price has 36 decimal places. However, some of + * modules perform sig fig rounding so most of the rightmost decimals can be + * zeroes. + */ + spotPriceV2(request: SpotPriceRequest): Promise; +} +export class QueryClientImpl implements Query { + private readonly rpc: Rpc; + constructor(rpc: Rpc) { + this.rpc = rpc; + this.spotPriceV2 = this.spotPriceV2.bind(this); + } + spotPriceV2(request: SpotPriceRequest): Promise { + const data = SpotPriceRequest.encode(request).finish(); + const promise = this.rpc.request("osmosis.poolmanager.v2.Query", "SpotPriceV2", data); + return promise.then(data => SpotPriceResponse.decode(new BinaryReader(data))); + } +} +export const createRpcQueryExtension = (base: QueryClient) => { + const rpc = createProtobufRpcClient(base); + const queryService = new QueryClientImpl(rpc); + return { + spotPriceV2(request: SpotPriceRequest): Promise { + return queryService.spotPriceV2(request); + } + }; +}; \ No newline at end of file diff --git a/packages/osmojs/src/codegen/osmosis/poolmanager/v2/query.ts b/packages/osmojs/src/codegen/osmosis/poolmanager/v2/query.ts new file mode 100644 index 000000000..40f725e0f --- /dev/null +++ b/packages/osmojs/src/codegen/osmosis/poolmanager/v2/query.ts @@ -0,0 +1,279 @@ +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { isSet } from "../../../helpers"; +import { GlobalDecoderRegistry } from "../../../registry"; +/** + * SpotPriceRequest defines the gRPC request structure for a SpotPrice + * query. + */ +export interface SpotPriceRequest { + poolId: bigint; + baseAssetDenom: string; + quoteAssetDenom: string; +} +export interface SpotPriceRequestProtoMsg { + typeUrl: "/osmosis.poolmanager.v2.SpotPriceRequest"; + value: Uint8Array; +} +/** + * SpotPriceRequest defines the gRPC request structure for a SpotPrice + * query. + */ +export interface SpotPriceRequestAmino { + pool_id?: string; + base_asset_denom?: string; + quote_asset_denom?: string; +} +export interface SpotPriceRequestAminoMsg { + type: "osmosis/poolmanager/v2/spot-price-request"; + value: SpotPriceRequestAmino; +} +/** + * SpotPriceRequest defines the gRPC request structure for a SpotPrice + * query. + */ +export interface SpotPriceRequestSDKType { + pool_id: bigint; + base_asset_denom: string; + quote_asset_denom: string; +} +/** + * SpotPriceResponse defines the gRPC response structure for a SpotPrice + * query. + */ +export interface SpotPriceResponse { + /** String of the BigDec. Ex) 10.203uatom */ + spotPrice: string; +} +export interface SpotPriceResponseProtoMsg { + typeUrl: "/osmosis.poolmanager.v2.SpotPriceResponse"; + value: Uint8Array; +} +/** + * SpotPriceResponse defines the gRPC response structure for a SpotPrice + * query. + */ +export interface SpotPriceResponseAmino { + /** String of the BigDec. Ex) 10.203uatom */ + spot_price?: string; +} +export interface SpotPriceResponseAminoMsg { + type: "osmosis/poolmanager/v2/spot-price-response"; + value: SpotPriceResponseAmino; +} +/** + * SpotPriceResponse defines the gRPC response structure for a SpotPrice + * query. + */ +export interface SpotPriceResponseSDKType { + spot_price: string; +} +function createBaseSpotPriceRequest(): SpotPriceRequest { + return { + poolId: BigInt(0), + baseAssetDenom: "", + quoteAssetDenom: "" + }; +} +export const SpotPriceRequest = { + typeUrl: "/osmosis.poolmanager.v2.SpotPriceRequest", + aminoType: "osmosis/poolmanager/v2/spot-price-request", + is(o: any): o is SpotPriceRequest { + return o && (o.$typeUrl === SpotPriceRequest.typeUrl || typeof o.poolId === "bigint" && typeof o.baseAssetDenom === "string" && typeof o.quoteAssetDenom === "string"); + }, + isSDK(o: any): o is SpotPriceRequestSDKType { + return o && (o.$typeUrl === SpotPriceRequest.typeUrl || typeof o.pool_id === "bigint" && typeof o.base_asset_denom === "string" && typeof o.quote_asset_denom === "string"); + }, + isAmino(o: any): o is SpotPriceRequestAmino { + return o && (o.$typeUrl === SpotPriceRequest.typeUrl || typeof o.pool_id === "bigint" && typeof o.base_asset_denom === "string" && typeof o.quote_asset_denom === "string"); + }, + encode(message: SpotPriceRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.poolId !== BigInt(0)) { + writer.uint32(8).uint64(message.poolId); + } + if (message.baseAssetDenom !== "") { + writer.uint32(18).string(message.baseAssetDenom); + } + if (message.quoteAssetDenom !== "") { + writer.uint32(26).string(message.quoteAssetDenom); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): SpotPriceRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSpotPriceRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.poolId = reader.uint64(); + break; + case 2: + message.baseAssetDenom = reader.string(); + break; + case 3: + message.quoteAssetDenom = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): SpotPriceRequest { + return { + poolId: isSet(object.poolId) ? BigInt(object.poolId.toString()) : BigInt(0), + baseAssetDenom: isSet(object.baseAssetDenom) ? String(object.baseAssetDenom) : "", + quoteAssetDenom: isSet(object.quoteAssetDenom) ? String(object.quoteAssetDenom) : "" + }; + }, + toJSON(message: SpotPriceRequest): unknown { + const obj: any = {}; + message.poolId !== undefined && (obj.poolId = (message.poolId || BigInt(0)).toString()); + message.baseAssetDenom !== undefined && (obj.baseAssetDenom = message.baseAssetDenom); + message.quoteAssetDenom !== undefined && (obj.quoteAssetDenom = message.quoteAssetDenom); + return obj; + }, + fromPartial(object: Partial): SpotPriceRequest { + const message = createBaseSpotPriceRequest(); + message.poolId = object.poolId !== undefined && object.poolId !== null ? BigInt(object.poolId.toString()) : BigInt(0); + message.baseAssetDenom = object.baseAssetDenom ?? ""; + message.quoteAssetDenom = object.quoteAssetDenom ?? ""; + return message; + }, + fromAmino(object: SpotPriceRequestAmino): SpotPriceRequest { + const message = createBaseSpotPriceRequest(); + if (object.pool_id !== undefined && object.pool_id !== null) { + message.poolId = BigInt(object.pool_id); + } + if (object.base_asset_denom !== undefined && object.base_asset_denom !== null) { + message.baseAssetDenom = object.base_asset_denom; + } + if (object.quote_asset_denom !== undefined && object.quote_asset_denom !== null) { + message.quoteAssetDenom = object.quote_asset_denom; + } + return message; + }, + toAmino(message: SpotPriceRequest): SpotPriceRequestAmino { + const obj: any = {}; + obj.pool_id = message.poolId ? message.poolId.toString() : undefined; + obj.base_asset_denom = message.baseAssetDenom; + obj.quote_asset_denom = message.quoteAssetDenom; + return obj; + }, + fromAminoMsg(object: SpotPriceRequestAminoMsg): SpotPriceRequest { + return SpotPriceRequest.fromAmino(object.value); + }, + toAminoMsg(message: SpotPriceRequest): SpotPriceRequestAminoMsg { + return { + type: "osmosis/poolmanager/v2/spot-price-request", + value: SpotPriceRequest.toAmino(message) + }; + }, + fromProtoMsg(message: SpotPriceRequestProtoMsg): SpotPriceRequest { + return SpotPriceRequest.decode(message.value); + }, + toProto(message: SpotPriceRequest): Uint8Array { + return SpotPriceRequest.encode(message).finish(); + }, + toProtoMsg(message: SpotPriceRequest): SpotPriceRequestProtoMsg { + return { + typeUrl: "/osmosis.poolmanager.v2.SpotPriceRequest", + value: SpotPriceRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(SpotPriceRequest.typeUrl, SpotPriceRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(SpotPriceRequest.aminoType, SpotPriceRequest.typeUrl); +function createBaseSpotPriceResponse(): SpotPriceResponse { + return { + spotPrice: "" + }; +} +export const SpotPriceResponse = { + typeUrl: "/osmosis.poolmanager.v2.SpotPriceResponse", + aminoType: "osmosis/poolmanager/v2/spot-price-response", + is(o: any): o is SpotPriceResponse { + return o && (o.$typeUrl === SpotPriceResponse.typeUrl || typeof o.spotPrice === "string"); + }, + isSDK(o: any): o is SpotPriceResponseSDKType { + return o && (o.$typeUrl === SpotPriceResponse.typeUrl || typeof o.spot_price === "string"); + }, + isAmino(o: any): o is SpotPriceResponseAmino { + return o && (o.$typeUrl === SpotPriceResponse.typeUrl || typeof o.spot_price === "string"); + }, + encode(message: SpotPriceResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.spotPrice !== "") { + writer.uint32(10).string(message.spotPrice); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): SpotPriceResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSpotPriceResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.spotPrice = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): SpotPriceResponse { + return { + spotPrice: isSet(object.spotPrice) ? String(object.spotPrice) : "" + }; + }, + toJSON(message: SpotPriceResponse): unknown { + const obj: any = {}; + message.spotPrice !== undefined && (obj.spotPrice = message.spotPrice); + return obj; + }, + fromPartial(object: Partial): SpotPriceResponse { + const message = createBaseSpotPriceResponse(); + message.spotPrice = object.spotPrice ?? ""; + return message; + }, + fromAmino(object: SpotPriceResponseAmino): SpotPriceResponse { + const message = createBaseSpotPriceResponse(); + if (object.spot_price !== undefined && object.spot_price !== null) { + message.spotPrice = object.spot_price; + } + return message; + }, + toAmino(message: SpotPriceResponse): SpotPriceResponseAmino { + const obj: any = {}; + obj.spot_price = message.spotPrice; + return obj; + }, + fromAminoMsg(object: SpotPriceResponseAminoMsg): SpotPriceResponse { + return SpotPriceResponse.fromAmino(object.value); + }, + toAminoMsg(message: SpotPriceResponse): SpotPriceResponseAminoMsg { + return { + type: "osmosis/poolmanager/v2/spot-price-response", + value: SpotPriceResponse.toAmino(message) + }; + }, + fromProtoMsg(message: SpotPriceResponseProtoMsg): SpotPriceResponse { + return SpotPriceResponse.decode(message.value); + }, + toProto(message: SpotPriceResponse): Uint8Array { + return SpotPriceResponse.encode(message).finish(); + }, + toProtoMsg(message: SpotPriceResponse): SpotPriceResponseProtoMsg { + return { + typeUrl: "/osmosis.poolmanager.v2.SpotPriceResponse", + value: SpotPriceResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(SpotPriceResponse.typeUrl, SpotPriceResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(SpotPriceResponse.aminoType, SpotPriceResponse.typeUrl); \ No newline at end of file diff --git a/packages/osmojs/src/codegen/osmosis/protorev/v1beta1/genesis.ts b/packages/osmojs/src/codegen/osmosis/protorev/v1beta1/genesis.ts index 4bff481b6..e31fc1d8f 100644 --- a/packages/osmojs/src/codegen/osmosis/protorev/v1beta1/genesis.ts +++ b/packages/osmojs/src/codegen/osmosis/protorev/v1beta1/genesis.ts @@ -1,7 +1,9 @@ import { Params, ParamsAmino, ParamsSDKType } from "./params"; -import { TokenPairArbRoutes, TokenPairArbRoutesAmino, TokenPairArbRoutesSDKType, BaseDenom, BaseDenomAmino, BaseDenomSDKType, PoolWeights, PoolWeightsAmino, PoolWeightsSDKType } from "./protorev"; +import { TokenPairArbRoutes, TokenPairArbRoutesAmino, TokenPairArbRoutesSDKType, BaseDenom, BaseDenomAmino, BaseDenomSDKType, PoolWeights, PoolWeightsAmino, PoolWeightsSDKType, InfoByPoolType, InfoByPoolTypeAmino, InfoByPoolTypeSDKType, CyclicArbTracker, CyclicArbTrackerAmino, CyclicArbTrackerSDKType } from "./protorev"; import { Coin, CoinAmino, CoinSDKType } from "../../../cosmos/base/v1beta1/coin"; import { BinaryReader, BinaryWriter } from "../../../binary"; +import { isSet } from "../../../helpers"; +import { GlobalDecoderRegistry } from "../../../registry"; /** GenesisState defines the protorev module's genesis state. */ export interface GenesisState { /** Parameters for the protorev module. */ @@ -16,6 +18,9 @@ export interface GenesisState { /** * The pool weights that are being used to calculate the weight (compute cost) * of each route. + * + * DEPRECATED: This field is deprecated and will be removed in the next + * release. It is replaced by the `info_by_pool_type` field. */ poolWeights: PoolWeights; /** The number of days since module genesis. */ @@ -40,6 +45,12 @@ export interface GenesisState { pointCountForBlock: bigint; /** All of the profits that have been accumulated by the module. */ profits: Coin[]; + /** + * Information that is used to estimate execution time / gas + * consumption of a swap on a given pool type. + */ + infoByPoolType: InfoByPoolType; + cyclicArbTracker?: CyclicArbTracker; } export interface GenesisStateProtoMsg { typeUrl: "/osmosis.protorev.v1beta1.GenesisState"; @@ -50,39 +61,48 @@ export interface GenesisStateAmino { /** Parameters for the protorev module. */ params?: ParamsAmino; /** Token pair arb routes for the protorev module (hot routes). */ - token_pair_arb_routes: TokenPairArbRoutesAmino[]; + token_pair_arb_routes?: TokenPairArbRoutesAmino[]; /** * The base denominations being used to create cyclic arbitrage routes via the * highest liquidity method. */ - base_denoms: BaseDenomAmino[]; + base_denoms?: BaseDenomAmino[]; /** * The pool weights that are being used to calculate the weight (compute cost) * of each route. + * + * DEPRECATED: This field is deprecated and will be removed in the next + * release. It is replaced by the `info_by_pool_type` field. */ pool_weights?: PoolWeightsAmino; /** The number of days since module genesis. */ - days_since_module_genesis: string; + days_since_module_genesis?: string; /** The fees the developer account has accumulated over time. */ - developer_fees: CoinAmino[]; + developer_fees?: CoinAmino[]; /** The latest block height that the module has processed. */ - latest_block_height: string; + latest_block_height?: string; /** The developer account address of the module. */ - developer_address: string; + developer_address?: string; /** * Max pool points per block i.e. the maximum compute time (in ms) * that protorev can use per block. */ - max_pool_points_per_block: string; + max_pool_points_per_block?: string; /** * Max pool points per tx i.e. the maximum compute time (in ms) that * protorev can use per tx. */ - max_pool_points_per_tx: string; + max_pool_points_per_tx?: string; /** The number of pool points that have been consumed in the current block. */ - point_count_for_block: string; + point_count_for_block?: string; /** All of the profits that have been accumulated by the module. */ - profits: CoinAmino[]; + profits?: CoinAmino[]; + /** + * Information that is used to estimate execution time / gas + * consumption of a swap on a given pool type. + */ + info_by_pool_type?: InfoByPoolTypeAmino; + cyclic_arb_tracker?: CyclicArbTrackerAmino; } export interface GenesisStateAminoMsg { type: "osmosis/protorev/genesis-state"; @@ -102,6 +122,8 @@ export interface GenesisStateSDKType { max_pool_points_per_tx: bigint; point_count_for_block: bigint; profits: CoinSDKType[]; + info_by_pool_type: InfoByPoolTypeSDKType; + cyclic_arb_tracker?: CyclicArbTrackerSDKType; } function createBaseGenesisState(): GenesisState { return { @@ -116,11 +138,23 @@ function createBaseGenesisState(): GenesisState { maxPoolPointsPerBlock: BigInt(0), maxPoolPointsPerTx: BigInt(0), pointCountForBlock: BigInt(0), - profits: [] + profits: [], + infoByPoolType: InfoByPoolType.fromPartial({}), + cyclicArbTracker: undefined }; } export const GenesisState = { typeUrl: "/osmosis.protorev.v1beta1.GenesisState", + aminoType: "osmosis/protorev/genesis-state", + is(o: any): o is GenesisState { + return o && (o.$typeUrl === GenesisState.typeUrl || Params.is(o.params) && Array.isArray(o.tokenPairArbRoutes) && (!o.tokenPairArbRoutes.length || TokenPairArbRoutes.is(o.tokenPairArbRoutes[0])) && Array.isArray(o.baseDenoms) && (!o.baseDenoms.length || BaseDenom.is(o.baseDenoms[0])) && PoolWeights.is(o.poolWeights) && typeof o.daysSinceModuleGenesis === "bigint" && Array.isArray(o.developerFees) && (!o.developerFees.length || Coin.is(o.developerFees[0])) && typeof o.latestBlockHeight === "bigint" && typeof o.developerAddress === "string" && typeof o.maxPoolPointsPerBlock === "bigint" && typeof o.maxPoolPointsPerTx === "bigint" && typeof o.pointCountForBlock === "bigint" && Array.isArray(o.profits) && (!o.profits.length || Coin.is(o.profits[0])) && InfoByPoolType.is(o.infoByPoolType)); + }, + isSDK(o: any): o is GenesisStateSDKType { + return o && (o.$typeUrl === GenesisState.typeUrl || Params.isSDK(o.params) && Array.isArray(o.token_pair_arb_routes) && (!o.token_pair_arb_routes.length || TokenPairArbRoutes.isSDK(o.token_pair_arb_routes[0])) && Array.isArray(o.base_denoms) && (!o.base_denoms.length || BaseDenom.isSDK(o.base_denoms[0])) && PoolWeights.isSDK(o.pool_weights) && typeof o.days_since_module_genesis === "bigint" && Array.isArray(o.developer_fees) && (!o.developer_fees.length || Coin.isSDK(o.developer_fees[0])) && typeof o.latest_block_height === "bigint" && typeof o.developer_address === "string" && typeof o.max_pool_points_per_block === "bigint" && typeof o.max_pool_points_per_tx === "bigint" && typeof o.point_count_for_block === "bigint" && Array.isArray(o.profits) && (!o.profits.length || Coin.isSDK(o.profits[0])) && InfoByPoolType.isSDK(o.info_by_pool_type)); + }, + isAmino(o: any): o is GenesisStateAmino { + return o && (o.$typeUrl === GenesisState.typeUrl || Params.isAmino(o.params) && Array.isArray(o.token_pair_arb_routes) && (!o.token_pair_arb_routes.length || TokenPairArbRoutes.isAmino(o.token_pair_arb_routes[0])) && Array.isArray(o.base_denoms) && (!o.base_denoms.length || BaseDenom.isAmino(o.base_denoms[0])) && PoolWeights.isAmino(o.pool_weights) && typeof o.days_since_module_genesis === "bigint" && Array.isArray(o.developer_fees) && (!o.developer_fees.length || Coin.isAmino(o.developer_fees[0])) && typeof o.latest_block_height === "bigint" && typeof o.developer_address === "string" && typeof o.max_pool_points_per_block === "bigint" && typeof o.max_pool_points_per_tx === "bigint" && typeof o.point_count_for_block === "bigint" && Array.isArray(o.profits) && (!o.profits.length || Coin.isAmino(o.profits[0])) && InfoByPoolType.isAmino(o.info_by_pool_type)); + }, encode(message: GenesisState, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.params !== undefined) { Params.encode(message.params, writer.uint32(10).fork()).ldelim(); @@ -158,6 +192,12 @@ export const GenesisState = { for (const v of message.profits) { Coin.encode(v!, writer.uint32(98).fork()).ldelim(); } + if (message.infoByPoolType !== undefined) { + InfoByPoolType.encode(message.infoByPoolType, writer.uint32(106).fork()).ldelim(); + } + if (message.cyclicArbTracker !== undefined) { + CyclicArbTracker.encode(message.cyclicArbTracker, writer.uint32(114).fork()).ldelim(); + } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): GenesisState { @@ -203,6 +243,12 @@ export const GenesisState = { case 12: message.profits.push(Coin.decode(reader, reader.uint32())); break; + case 13: + message.infoByPoolType = InfoByPoolType.decode(reader, reader.uint32()); + break; + case 14: + message.cyclicArbTracker = CyclicArbTracker.decode(reader, reader.uint32()); + break; default: reader.skipType(tag & 7); break; @@ -210,6 +256,58 @@ export const GenesisState = { } return message; }, + fromJSON(object: any): GenesisState { + return { + params: isSet(object.params) ? Params.fromJSON(object.params) : undefined, + tokenPairArbRoutes: Array.isArray(object?.tokenPairArbRoutes) ? object.tokenPairArbRoutes.map((e: any) => TokenPairArbRoutes.fromJSON(e)) : [], + baseDenoms: Array.isArray(object?.baseDenoms) ? object.baseDenoms.map((e: any) => BaseDenom.fromJSON(e)) : [], + poolWeights: isSet(object.poolWeights) ? PoolWeights.fromJSON(object.poolWeights) : undefined, + daysSinceModuleGenesis: isSet(object.daysSinceModuleGenesis) ? BigInt(object.daysSinceModuleGenesis.toString()) : BigInt(0), + developerFees: Array.isArray(object?.developerFees) ? object.developerFees.map((e: any) => Coin.fromJSON(e)) : [], + latestBlockHeight: isSet(object.latestBlockHeight) ? BigInt(object.latestBlockHeight.toString()) : BigInt(0), + developerAddress: isSet(object.developerAddress) ? String(object.developerAddress) : "", + maxPoolPointsPerBlock: isSet(object.maxPoolPointsPerBlock) ? BigInt(object.maxPoolPointsPerBlock.toString()) : BigInt(0), + maxPoolPointsPerTx: isSet(object.maxPoolPointsPerTx) ? BigInt(object.maxPoolPointsPerTx.toString()) : BigInt(0), + pointCountForBlock: isSet(object.pointCountForBlock) ? BigInt(object.pointCountForBlock.toString()) : BigInt(0), + profits: Array.isArray(object?.profits) ? object.profits.map((e: any) => Coin.fromJSON(e)) : [], + infoByPoolType: isSet(object.infoByPoolType) ? InfoByPoolType.fromJSON(object.infoByPoolType) : undefined, + cyclicArbTracker: isSet(object.cyclicArbTracker) ? CyclicArbTracker.fromJSON(object.cyclicArbTracker) : undefined + }; + }, + toJSON(message: GenesisState): unknown { + const obj: any = {}; + message.params !== undefined && (obj.params = message.params ? Params.toJSON(message.params) : undefined); + if (message.tokenPairArbRoutes) { + obj.tokenPairArbRoutes = message.tokenPairArbRoutes.map(e => e ? TokenPairArbRoutes.toJSON(e) : undefined); + } else { + obj.tokenPairArbRoutes = []; + } + if (message.baseDenoms) { + obj.baseDenoms = message.baseDenoms.map(e => e ? BaseDenom.toJSON(e) : undefined); + } else { + obj.baseDenoms = []; + } + message.poolWeights !== undefined && (obj.poolWeights = message.poolWeights ? PoolWeights.toJSON(message.poolWeights) : undefined); + message.daysSinceModuleGenesis !== undefined && (obj.daysSinceModuleGenesis = (message.daysSinceModuleGenesis || BigInt(0)).toString()); + if (message.developerFees) { + obj.developerFees = message.developerFees.map(e => e ? Coin.toJSON(e) : undefined); + } else { + obj.developerFees = []; + } + message.latestBlockHeight !== undefined && (obj.latestBlockHeight = (message.latestBlockHeight || BigInt(0)).toString()); + message.developerAddress !== undefined && (obj.developerAddress = message.developerAddress); + message.maxPoolPointsPerBlock !== undefined && (obj.maxPoolPointsPerBlock = (message.maxPoolPointsPerBlock || BigInt(0)).toString()); + message.maxPoolPointsPerTx !== undefined && (obj.maxPoolPointsPerTx = (message.maxPoolPointsPerTx || BigInt(0)).toString()); + message.pointCountForBlock !== undefined && (obj.pointCountForBlock = (message.pointCountForBlock || BigInt(0)).toString()); + if (message.profits) { + obj.profits = message.profits.map(e => e ? Coin.toJSON(e) : undefined); + } else { + obj.profits = []; + } + message.infoByPoolType !== undefined && (obj.infoByPoolType = message.infoByPoolType ? InfoByPoolType.toJSON(message.infoByPoolType) : undefined); + message.cyclicArbTracker !== undefined && (obj.cyclicArbTracker = message.cyclicArbTracker ? CyclicArbTracker.toJSON(message.cyclicArbTracker) : undefined); + return obj; + }, fromPartial(object: Partial): GenesisState { const message = createBaseGenesisState(); message.params = object.params !== undefined && object.params !== null ? Params.fromPartial(object.params) : undefined; @@ -224,23 +322,47 @@ export const GenesisState = { message.maxPoolPointsPerTx = object.maxPoolPointsPerTx !== undefined && object.maxPoolPointsPerTx !== null ? BigInt(object.maxPoolPointsPerTx.toString()) : BigInt(0); message.pointCountForBlock = object.pointCountForBlock !== undefined && object.pointCountForBlock !== null ? BigInt(object.pointCountForBlock.toString()) : BigInt(0); message.profits = object.profits?.map(e => Coin.fromPartial(e)) || []; + message.infoByPoolType = object.infoByPoolType !== undefined && object.infoByPoolType !== null ? InfoByPoolType.fromPartial(object.infoByPoolType) : undefined; + message.cyclicArbTracker = object.cyclicArbTracker !== undefined && object.cyclicArbTracker !== null ? CyclicArbTracker.fromPartial(object.cyclicArbTracker) : undefined; return message; }, fromAmino(object: GenesisStateAmino): GenesisState { - return { - params: object?.params ? Params.fromAmino(object.params) : undefined, - tokenPairArbRoutes: Array.isArray(object?.token_pair_arb_routes) ? object.token_pair_arb_routes.map((e: any) => TokenPairArbRoutes.fromAmino(e)) : [], - baseDenoms: Array.isArray(object?.base_denoms) ? object.base_denoms.map((e: any) => BaseDenom.fromAmino(e)) : [], - poolWeights: object?.pool_weights ? PoolWeights.fromAmino(object.pool_weights) : undefined, - daysSinceModuleGenesis: BigInt(object.days_since_module_genesis), - developerFees: Array.isArray(object?.developer_fees) ? object.developer_fees.map((e: any) => Coin.fromAmino(e)) : [], - latestBlockHeight: BigInt(object.latest_block_height), - developerAddress: object.developer_address, - maxPoolPointsPerBlock: BigInt(object.max_pool_points_per_block), - maxPoolPointsPerTx: BigInt(object.max_pool_points_per_tx), - pointCountForBlock: BigInt(object.point_count_for_block), - profits: Array.isArray(object?.profits) ? object.profits.map((e: any) => Coin.fromAmino(e)) : [] - }; + const message = createBaseGenesisState(); + if (object.params !== undefined && object.params !== null) { + message.params = Params.fromAmino(object.params); + } + message.tokenPairArbRoutes = object.token_pair_arb_routes?.map(e => TokenPairArbRoutes.fromAmino(e)) || []; + message.baseDenoms = object.base_denoms?.map(e => BaseDenom.fromAmino(e)) || []; + if (object.pool_weights !== undefined && object.pool_weights !== null) { + message.poolWeights = PoolWeights.fromAmino(object.pool_weights); + } + if (object.days_since_module_genesis !== undefined && object.days_since_module_genesis !== null) { + message.daysSinceModuleGenesis = BigInt(object.days_since_module_genesis); + } + message.developerFees = object.developer_fees?.map(e => Coin.fromAmino(e)) || []; + if (object.latest_block_height !== undefined && object.latest_block_height !== null) { + message.latestBlockHeight = BigInt(object.latest_block_height); + } + if (object.developer_address !== undefined && object.developer_address !== null) { + message.developerAddress = object.developer_address; + } + if (object.max_pool_points_per_block !== undefined && object.max_pool_points_per_block !== null) { + message.maxPoolPointsPerBlock = BigInt(object.max_pool_points_per_block); + } + if (object.max_pool_points_per_tx !== undefined && object.max_pool_points_per_tx !== null) { + message.maxPoolPointsPerTx = BigInt(object.max_pool_points_per_tx); + } + if (object.point_count_for_block !== undefined && object.point_count_for_block !== null) { + message.pointCountForBlock = BigInt(object.point_count_for_block); + } + message.profits = object.profits?.map(e => Coin.fromAmino(e)) || []; + if (object.info_by_pool_type !== undefined && object.info_by_pool_type !== null) { + message.infoByPoolType = InfoByPoolType.fromAmino(object.info_by_pool_type); + } + if (object.cyclic_arb_tracker !== undefined && object.cyclic_arb_tracker !== null) { + message.cyclicArbTracker = CyclicArbTracker.fromAmino(object.cyclic_arb_tracker); + } + return message; }, toAmino(message: GenesisState): GenesisStateAmino { const obj: any = {}; @@ -272,6 +394,8 @@ export const GenesisState = { } else { obj.profits = []; } + obj.info_by_pool_type = message.infoByPoolType ? InfoByPoolType.toAmino(message.infoByPoolType) : undefined; + obj.cyclic_arb_tracker = message.cyclicArbTracker ? CyclicArbTracker.toAmino(message.cyclicArbTracker) : undefined; return obj; }, fromAminoMsg(object: GenesisStateAminoMsg): GenesisState { @@ -295,4 +419,6 @@ export const GenesisState = { value: GenesisState.encode(message).finish() }; } -}; \ No newline at end of file +}; +GlobalDecoderRegistry.register(GenesisState.typeUrl, GenesisState); +GlobalDecoderRegistry.registerAminoProtoMapping(GenesisState.aminoType, GenesisState.typeUrl); \ No newline at end of file diff --git a/packages/osmojs/src/codegen/osmosis/protorev/v1beta1/gov.ts b/packages/osmojs/src/codegen/osmosis/protorev/v1beta1/gov.ts index f1f3b20f9..89d7fa333 100644 --- a/packages/osmojs/src/codegen/osmosis/protorev/v1beta1/gov.ts +++ b/packages/osmojs/src/codegen/osmosis/protorev/v1beta1/gov.ts @@ -1,10 +1,12 @@ import { BinaryReader, BinaryWriter } from "../../../binary"; +import { isSet } from "../../../helpers"; +import { GlobalDecoderRegistry } from "../../../registry"; /** * SetProtoRevEnabledProposal is a gov Content type to update whether the * protorev module is enabled */ export interface SetProtoRevEnabledProposal { - $typeUrl?: string; + $typeUrl?: "/osmosis.protorev.v1beta1.SetProtoRevEnabledProposal"; title: string; description: string; enabled: boolean; @@ -18,9 +20,9 @@ export interface SetProtoRevEnabledProposalProtoMsg { * protorev module is enabled */ export interface SetProtoRevEnabledProposalAmino { - title: string; - description: string; - enabled: boolean; + title?: string; + description?: string; + enabled?: boolean; } export interface SetProtoRevEnabledProposalAminoMsg { type: "osmosis/SetProtoRevEnabledProposal"; @@ -31,7 +33,7 @@ export interface SetProtoRevEnabledProposalAminoMsg { * protorev module is enabled */ export interface SetProtoRevEnabledProposalSDKType { - $typeUrl?: string; + $typeUrl?: "/osmosis.protorev.v1beta1.SetProtoRevEnabledProposal"; title: string; description: string; enabled: boolean; @@ -42,7 +44,7 @@ export interface SetProtoRevEnabledProposalSDKType { * developer address that will be receiving a share of profits from the module */ export interface SetProtoRevAdminAccountProposal { - $typeUrl?: string; + $typeUrl?: "/osmosis.protorev.v1beta1.SetProtoRevAdminAccountProposal"; title: string; description: string; account: string; @@ -57,9 +59,9 @@ export interface SetProtoRevAdminAccountProposalProtoMsg { * developer address that will be receiving a share of profits from the module */ export interface SetProtoRevAdminAccountProposalAmino { - title: string; - description: string; - account: string; + title?: string; + description?: string; + account?: string; } export interface SetProtoRevAdminAccountProposalAminoMsg { type: "osmosis/SetProtoRevAdminAccountProposal"; @@ -71,7 +73,7 @@ export interface SetProtoRevAdminAccountProposalAminoMsg { * developer address that will be receiving a share of profits from the module */ export interface SetProtoRevAdminAccountProposalSDKType { - $typeUrl?: string; + $typeUrl?: "/osmosis.protorev.v1beta1.SetProtoRevAdminAccountProposal"; title: string; description: string; account: string; @@ -86,6 +88,16 @@ function createBaseSetProtoRevEnabledProposal(): SetProtoRevEnabledProposal { } export const SetProtoRevEnabledProposal = { typeUrl: "/osmosis.protorev.v1beta1.SetProtoRevEnabledProposal", + aminoType: "osmosis/SetProtoRevEnabledProposal", + is(o: any): o is SetProtoRevEnabledProposal { + return o && (o.$typeUrl === SetProtoRevEnabledProposal.typeUrl || typeof o.title === "string" && typeof o.description === "string" && typeof o.enabled === "boolean"); + }, + isSDK(o: any): o is SetProtoRevEnabledProposalSDKType { + return o && (o.$typeUrl === SetProtoRevEnabledProposal.typeUrl || typeof o.title === "string" && typeof o.description === "string" && typeof o.enabled === "boolean"); + }, + isAmino(o: any): o is SetProtoRevEnabledProposalAmino { + return o && (o.$typeUrl === SetProtoRevEnabledProposal.typeUrl || typeof o.title === "string" && typeof o.description === "string" && typeof o.enabled === "boolean"); + }, encode(message: SetProtoRevEnabledProposal, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.title !== "") { writer.uint32(10).string(message.title); @@ -121,6 +133,20 @@ export const SetProtoRevEnabledProposal = { } return message; }, + fromJSON(object: any): SetProtoRevEnabledProposal { + return { + title: isSet(object.title) ? String(object.title) : "", + description: isSet(object.description) ? String(object.description) : "", + enabled: isSet(object.enabled) ? Boolean(object.enabled) : false + }; + }, + toJSON(message: SetProtoRevEnabledProposal): unknown { + const obj: any = {}; + message.title !== undefined && (obj.title = message.title); + message.description !== undefined && (obj.description = message.description); + message.enabled !== undefined && (obj.enabled = message.enabled); + return obj; + }, fromPartial(object: Partial): SetProtoRevEnabledProposal { const message = createBaseSetProtoRevEnabledProposal(); message.title = object.title ?? ""; @@ -129,11 +155,17 @@ export const SetProtoRevEnabledProposal = { return message; }, fromAmino(object: SetProtoRevEnabledProposalAmino): SetProtoRevEnabledProposal { - return { - title: object.title, - description: object.description, - enabled: object.enabled - }; + const message = createBaseSetProtoRevEnabledProposal(); + if (object.title !== undefined && object.title !== null) { + message.title = object.title; + } + if (object.description !== undefined && object.description !== null) { + message.description = object.description; + } + if (object.enabled !== undefined && object.enabled !== null) { + message.enabled = object.enabled; + } + return message; }, toAmino(message: SetProtoRevEnabledProposal): SetProtoRevEnabledProposalAmino { const obj: any = {}; @@ -164,6 +196,8 @@ export const SetProtoRevEnabledProposal = { }; } }; +GlobalDecoderRegistry.register(SetProtoRevEnabledProposal.typeUrl, SetProtoRevEnabledProposal); +GlobalDecoderRegistry.registerAminoProtoMapping(SetProtoRevEnabledProposal.aminoType, SetProtoRevEnabledProposal.typeUrl); function createBaseSetProtoRevAdminAccountProposal(): SetProtoRevAdminAccountProposal { return { $typeUrl: "/osmosis.protorev.v1beta1.SetProtoRevAdminAccountProposal", @@ -174,6 +208,16 @@ function createBaseSetProtoRevAdminAccountProposal(): SetProtoRevAdminAccountPro } export const SetProtoRevAdminAccountProposal = { typeUrl: "/osmosis.protorev.v1beta1.SetProtoRevAdminAccountProposal", + aminoType: "osmosis/SetProtoRevAdminAccountProposal", + is(o: any): o is SetProtoRevAdminAccountProposal { + return o && (o.$typeUrl === SetProtoRevAdminAccountProposal.typeUrl || typeof o.title === "string" && typeof o.description === "string" && typeof o.account === "string"); + }, + isSDK(o: any): o is SetProtoRevAdminAccountProposalSDKType { + return o && (o.$typeUrl === SetProtoRevAdminAccountProposal.typeUrl || typeof o.title === "string" && typeof o.description === "string" && typeof o.account === "string"); + }, + isAmino(o: any): o is SetProtoRevAdminAccountProposalAmino { + return o && (o.$typeUrl === SetProtoRevAdminAccountProposal.typeUrl || typeof o.title === "string" && typeof o.description === "string" && typeof o.account === "string"); + }, encode(message: SetProtoRevAdminAccountProposal, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.title !== "") { writer.uint32(10).string(message.title); @@ -209,6 +253,20 @@ export const SetProtoRevAdminAccountProposal = { } return message; }, + fromJSON(object: any): SetProtoRevAdminAccountProposal { + return { + title: isSet(object.title) ? String(object.title) : "", + description: isSet(object.description) ? String(object.description) : "", + account: isSet(object.account) ? String(object.account) : "" + }; + }, + toJSON(message: SetProtoRevAdminAccountProposal): unknown { + const obj: any = {}; + message.title !== undefined && (obj.title = message.title); + message.description !== undefined && (obj.description = message.description); + message.account !== undefined && (obj.account = message.account); + return obj; + }, fromPartial(object: Partial): SetProtoRevAdminAccountProposal { const message = createBaseSetProtoRevAdminAccountProposal(); message.title = object.title ?? ""; @@ -217,11 +275,17 @@ export const SetProtoRevAdminAccountProposal = { return message; }, fromAmino(object: SetProtoRevAdminAccountProposalAmino): SetProtoRevAdminAccountProposal { - return { - title: object.title, - description: object.description, - account: object.account - }; + const message = createBaseSetProtoRevAdminAccountProposal(); + if (object.title !== undefined && object.title !== null) { + message.title = object.title; + } + if (object.description !== undefined && object.description !== null) { + message.description = object.description; + } + if (object.account !== undefined && object.account !== null) { + message.account = object.account; + } + return message; }, toAmino(message: SetProtoRevAdminAccountProposal): SetProtoRevAdminAccountProposalAmino { const obj: any = {}; @@ -251,4 +315,6 @@ export const SetProtoRevAdminAccountProposal = { value: SetProtoRevAdminAccountProposal.encode(message).finish() }; } -}; \ No newline at end of file +}; +GlobalDecoderRegistry.register(SetProtoRevAdminAccountProposal.typeUrl, SetProtoRevAdminAccountProposal); +GlobalDecoderRegistry.registerAminoProtoMapping(SetProtoRevAdminAccountProposal.aminoType, SetProtoRevAdminAccountProposal.typeUrl); \ No newline at end of file diff --git a/packages/osmojs/src/codegen/osmosis/protorev/v1beta1/params.ts b/packages/osmojs/src/codegen/osmosis/protorev/v1beta1/params.ts index 8cff57d6a..1a08c2032 100644 --- a/packages/osmojs/src/codegen/osmosis/protorev/v1beta1/params.ts +++ b/packages/osmojs/src/codegen/osmosis/protorev/v1beta1/params.ts @@ -1,4 +1,6 @@ import { BinaryReader, BinaryWriter } from "../../../binary"; +import { isSet } from "../../../helpers"; +import { GlobalDecoderRegistry } from "../../../registry"; /** Params defines the parameters for the module. */ export interface Params { /** Boolean whether the protorev module is enabled. */ @@ -13,9 +15,9 @@ export interface ParamsProtoMsg { /** Params defines the parameters for the module. */ export interface ParamsAmino { /** Boolean whether the protorev module is enabled. */ - enabled: boolean; + enabled?: boolean; /** The admin account (settings manager) of the protorev module. */ - admin: string; + admin?: string; } export interface ParamsAminoMsg { type: "osmosis/protorev/params"; @@ -34,6 +36,16 @@ function createBaseParams(): Params { } export const Params = { typeUrl: "/osmosis.protorev.v1beta1.Params", + aminoType: "osmosis/protorev/params", + is(o: any): o is Params { + return o && (o.$typeUrl === Params.typeUrl || typeof o.enabled === "boolean" && typeof o.admin === "string"); + }, + isSDK(o: any): o is ParamsSDKType { + return o && (o.$typeUrl === Params.typeUrl || typeof o.enabled === "boolean" && typeof o.admin === "string"); + }, + isAmino(o: any): o is ParamsAmino { + return o && (o.$typeUrl === Params.typeUrl || typeof o.enabled === "boolean" && typeof o.admin === "string"); + }, encode(message: Params, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.enabled === true) { writer.uint32(8).bool(message.enabled); @@ -63,6 +75,18 @@ export const Params = { } return message; }, + fromJSON(object: any): Params { + return { + enabled: isSet(object.enabled) ? Boolean(object.enabled) : false, + admin: isSet(object.admin) ? String(object.admin) : "" + }; + }, + toJSON(message: Params): unknown { + const obj: any = {}; + message.enabled !== undefined && (obj.enabled = message.enabled); + message.admin !== undefined && (obj.admin = message.admin); + return obj; + }, fromPartial(object: Partial): Params { const message = createBaseParams(); message.enabled = object.enabled ?? false; @@ -70,10 +94,14 @@ export const Params = { return message; }, fromAmino(object: ParamsAmino): Params { - return { - enabled: object.enabled, - admin: object.admin - }; + const message = createBaseParams(); + if (object.enabled !== undefined && object.enabled !== null) { + message.enabled = object.enabled; + } + if (object.admin !== undefined && object.admin !== null) { + message.admin = object.admin; + } + return message; }, toAmino(message: Params): ParamsAmino { const obj: any = {}; @@ -102,4 +130,6 @@ export const Params = { value: Params.encode(message).finish() }; } -}; \ No newline at end of file +}; +GlobalDecoderRegistry.register(Params.typeUrl, Params); +GlobalDecoderRegistry.registerAminoProtoMapping(Params.aminoType, Params.typeUrl); \ No newline at end of file diff --git a/packages/osmojs/src/codegen/osmosis/protorev/v1beta1/protorev.ts b/packages/osmojs/src/codegen/osmosis/protorev/v1beta1/protorev.ts index 75e7f0454..28c1ead39 100644 --- a/packages/osmojs/src/codegen/osmosis/protorev/v1beta1/protorev.ts +++ b/packages/osmojs/src/codegen/osmosis/protorev/v1beta1/protorev.ts @@ -1,5 +1,8 @@ import { Coin, CoinAmino, CoinSDKType } from "../../../cosmos/base/v1beta1/coin"; +import { TakerFeesTracker, TakerFeesTrackerAmino, TakerFeesTrackerSDKType } from "../../poolmanager/v1beta1/genesis"; import { BinaryReader, BinaryWriter } from "../../../binary"; +import { isSet } from "../../../helpers"; +import { GlobalDecoderRegistry } from "../../../registry"; /** TokenPairArbRoutes tracks all of the hot routes for a given pair of tokens */ export interface TokenPairArbRoutes { /** Stores all of the possible hot paths for a given pair of tokens */ @@ -16,11 +19,11 @@ export interface TokenPairArbRoutesProtoMsg { /** TokenPairArbRoutes tracks all of the hot routes for a given pair of tokens */ export interface TokenPairArbRoutesAmino { /** Stores all of the possible hot paths for a given pair of tokens */ - arb_routes: RouteAmino[]; + arb_routes?: RouteAmino[]; /** Token denomination of the first asset */ - token_in: string; + token_in?: string; /** Token denomination of the second asset */ - token_out: string; + token_out?: string; } export interface TokenPairArbRoutesAminoMsg { type: "osmosis/protorev/token-pair-arb-routes"; @@ -35,7 +38,8 @@ export interface TokenPairArbRoutesSDKType { /** Route is a hot route for a given pair of tokens */ export interface Route { /** - * The pool IDs that are travered in the directed cyclic graph (traversed left + * The pool IDs that are traversed in the directed cyclic graph (traversed + * left * -> right) */ trades: Trade[]; @@ -52,15 +56,16 @@ export interface RouteProtoMsg { /** Route is a hot route for a given pair of tokens */ export interface RouteAmino { /** - * The pool IDs that are travered in the directed cyclic graph (traversed left + * The pool IDs that are traversed in the directed cyclic graph (traversed + * left * -> right) */ - trades: TradeAmino[]; + trades?: TradeAmino[]; /** * The step size that will be used to find the optimal swap amount in the * binary search */ - step_size: string; + step_size?: string; } export interface RouteAminoMsg { type: "osmosis/protorev/route"; @@ -87,11 +92,11 @@ export interface TradeProtoMsg { /** Trade is a single trade in a route */ export interface TradeAmino { /** The pool id of the pool that is traded on */ - pool: string; + pool?: string; /** The denom of the token that is traded */ - token_in: string; + token_in?: string; /** The denom of the token that is received */ - token_out: string; + token_out?: string; } export interface TradeAminoMsg { type: "osmosis/protorev/trade"; @@ -128,14 +133,14 @@ export interface RouteStatisticsProtoMsg { */ export interface RouteStatisticsAmino { /** profits is the total profit from all trades on this route */ - profits: CoinAmino[]; + profits?: CoinAmino[]; /** * number_of_trades is the number of trades the module has executed using this * route */ - number_of_trades: string; + number_of_trades?: string; /** route is the route that was used (pool ids along the arbitrage route) */ - route: string[]; + route?: string[]; } export interface RouteStatisticsAminoMsg { type: "osmosis/protorev/route-statistics"; @@ -156,6 +161,9 @@ export interface RouteStatisticsSDKType { * significantly between the different pool types. Each weight roughly * corresponds to the amount of time (in ms) it takes to execute a swap on that * pool type. + * + * DEPRECATED: This field is deprecated and will be removed in the next + * release. It is replaced by the `info_by_pool_type` field. */ export interface PoolWeights { /** The weight of a stableswap pool */ @@ -164,6 +172,8 @@ export interface PoolWeights { balancerWeight: bigint; /** The weight of a concentrated pool */ concentratedWeight: bigint; + /** The weight of a cosmwasm pool */ + cosmwasmWeight: bigint; } export interface PoolWeightsProtoMsg { typeUrl: "/osmosis.protorev.v1beta1.PoolWeights"; @@ -175,14 +185,19 @@ export interface PoolWeightsProtoMsg { * significantly between the different pool types. Each weight roughly * corresponds to the amount of time (in ms) it takes to execute a swap on that * pool type. + * + * DEPRECATED: This field is deprecated and will be removed in the next + * release. It is replaced by the `info_by_pool_type` field. */ export interface PoolWeightsAmino { /** The weight of a stableswap pool */ - stable_weight: string; + stable_weight?: string; /** The weight of a balancer pool */ - balancer_weight: string; + balancer_weight?: string; /** The weight of a concentrated pool */ - concentrated_weight: string; + concentrated_weight?: string; + /** The weight of a cosmwasm pool */ + cosmwasm_weight?: string; } export interface PoolWeightsAminoMsg { type: "osmosis/protorev/pool-weights"; @@ -194,11 +209,205 @@ export interface PoolWeightsAminoMsg { * significantly between the different pool types. Each weight roughly * corresponds to the amount of time (in ms) it takes to execute a swap on that * pool type. + * + * DEPRECATED: This field is deprecated and will be removed in the next + * release. It is replaced by the `info_by_pool_type` field. */ export interface PoolWeightsSDKType { stable_weight: bigint; balancer_weight: bigint; concentrated_weight: bigint; + cosmwasm_weight: bigint; +} +/** + * InfoByPoolType contains information pertaining to how expensive (in terms of + * gas and time) it is to execute a swap on a given pool type. This distinction + * is made and necessary because the execution time ranges significantly between + * the different pool types. + */ +export interface InfoByPoolType { + /** The stable pool info */ + stable: StablePoolInfo; + /** The balancer pool info */ + balancer: BalancerPoolInfo; + /** The concentrated pool info */ + concentrated: ConcentratedPoolInfo; + /** The cosmwasm pool info */ + cosmwasm: CosmwasmPoolInfo; +} +export interface InfoByPoolTypeProtoMsg { + typeUrl: "/osmosis.protorev.v1beta1.InfoByPoolType"; + value: Uint8Array; +} +/** + * InfoByPoolType contains information pertaining to how expensive (in terms of + * gas and time) it is to execute a swap on a given pool type. This distinction + * is made and necessary because the execution time ranges significantly between + * the different pool types. + */ +export interface InfoByPoolTypeAmino { + /** The stable pool info */ + stable?: StablePoolInfoAmino; + /** The balancer pool info */ + balancer?: BalancerPoolInfoAmino; + /** The concentrated pool info */ + concentrated?: ConcentratedPoolInfoAmino; + /** The cosmwasm pool info */ + cosmwasm?: CosmwasmPoolInfoAmino; +} +export interface InfoByPoolTypeAminoMsg { + type: "osmosis/protorev/info-by-pool-type"; + value: InfoByPoolTypeAmino; +} +/** + * InfoByPoolType contains information pertaining to how expensive (in terms of + * gas and time) it is to execute a swap on a given pool type. This distinction + * is made and necessary because the execution time ranges significantly between + * the different pool types. + */ +export interface InfoByPoolTypeSDKType { + stable: StablePoolInfoSDKType; + balancer: BalancerPoolInfoSDKType; + concentrated: ConcentratedPoolInfoSDKType; + cosmwasm: CosmwasmPoolInfoSDKType; +} +/** StablePoolInfo contains meta data pertaining to a stableswap pool type. */ +export interface StablePoolInfo { + /** The weight of a stableswap pool */ + weight: bigint; +} +export interface StablePoolInfoProtoMsg { + typeUrl: "/osmosis.protorev.v1beta1.StablePoolInfo"; + value: Uint8Array; +} +/** StablePoolInfo contains meta data pertaining to a stableswap pool type. */ +export interface StablePoolInfoAmino { + /** The weight of a stableswap pool */ + weight?: string; +} +export interface StablePoolInfoAminoMsg { + type: "osmosis/protorev/stable-pool-info"; + value: StablePoolInfoAmino; +} +/** StablePoolInfo contains meta data pertaining to a stableswap pool type. */ +export interface StablePoolInfoSDKType { + weight: bigint; +} +/** BalancerPoolInfo contains meta data pertaining to a balancer pool type. */ +export interface BalancerPoolInfo { + /** The weight of a balancer pool */ + weight: bigint; +} +export interface BalancerPoolInfoProtoMsg { + typeUrl: "/osmosis.protorev.v1beta1.BalancerPoolInfo"; + value: Uint8Array; +} +/** BalancerPoolInfo contains meta data pertaining to a balancer pool type. */ +export interface BalancerPoolInfoAmino { + /** The weight of a balancer pool */ + weight?: string; +} +export interface BalancerPoolInfoAminoMsg { + type: "osmosis/protorev/balancer-pool-info"; + value: BalancerPoolInfoAmino; +} +/** BalancerPoolInfo contains meta data pertaining to a balancer pool type. */ +export interface BalancerPoolInfoSDKType { + weight: bigint; +} +/** + * ConcentratedPoolInfo contains meta data pertaining to a concentrated pool + * type. + */ +export interface ConcentratedPoolInfo { + /** The weight of a concentrated pool */ + weight: bigint; + /** The maximum number of ticks we can move when rebalancing */ + maxTicksCrossed: bigint; +} +export interface ConcentratedPoolInfoProtoMsg { + typeUrl: "/osmosis.protorev.v1beta1.ConcentratedPoolInfo"; + value: Uint8Array; +} +/** + * ConcentratedPoolInfo contains meta data pertaining to a concentrated pool + * type. + */ +export interface ConcentratedPoolInfoAmino { + /** The weight of a concentrated pool */ + weight?: string; + /** The maximum number of ticks we can move when rebalancing */ + max_ticks_crossed?: string; +} +export interface ConcentratedPoolInfoAminoMsg { + type: "osmosis/protorev/concentrated-pool-info"; + value: ConcentratedPoolInfoAmino; +} +/** + * ConcentratedPoolInfo contains meta data pertaining to a concentrated pool + * type. + */ +export interface ConcentratedPoolInfoSDKType { + weight: bigint; + max_ticks_crossed: bigint; +} +/** CosmwasmPoolInfo contains meta data pertaining to a cosmwasm pool type. */ +export interface CosmwasmPoolInfo { + /** The weight of a cosmwasm pool (by contract address) */ + weightMaps: WeightMap[]; +} +export interface CosmwasmPoolInfoProtoMsg { + typeUrl: "/osmosis.protorev.v1beta1.CosmwasmPoolInfo"; + value: Uint8Array; +} +/** CosmwasmPoolInfo contains meta data pertaining to a cosmwasm pool type. */ +export interface CosmwasmPoolInfoAmino { + /** The weight of a cosmwasm pool (by contract address) */ + weight_maps?: WeightMapAmino[]; +} +export interface CosmwasmPoolInfoAminoMsg { + type: "osmosis/protorev/cosmwasm-pool-info"; + value: CosmwasmPoolInfoAmino; +} +/** CosmwasmPoolInfo contains meta data pertaining to a cosmwasm pool type. */ +export interface CosmwasmPoolInfoSDKType { + weight_maps: WeightMapSDKType[]; +} +/** + * WeightMap maps a contract address to a weight. The weight of an address + * corresponds to the amount of ms required to execute a swap on that contract. + */ +export interface WeightMap { + /** The weight of a cosmwasm pool (by contract address) */ + weight: bigint; + /** The contract address */ + contractAddress: string; +} +export interface WeightMapProtoMsg { + typeUrl: "/osmosis.protorev.v1beta1.WeightMap"; + value: Uint8Array; +} +/** + * WeightMap maps a contract address to a weight. The weight of an address + * corresponds to the amount of ms required to execute a swap on that contract. + */ +export interface WeightMapAmino { + /** The weight of a cosmwasm pool (by contract address) */ + weight?: string; + /** The contract address */ + contract_address?: string; +} +export interface WeightMapAminoMsg { + type: "osmosis/protorev/weight-map"; + value: WeightMapAmino; +} +/** + * WeightMap maps a contract address to a weight. The weight of an address + * corresponds to the amount of ms required to execute a swap on that contract. + */ +export interface WeightMapSDKType { + weight: bigint; + contract_address: string; } /** * BaseDenom represents a single base denom that the module uses for its @@ -225,12 +434,12 @@ export interface BaseDenomProtoMsg { */ export interface BaseDenomAmino { /** The denom i.e. name of the base denom (ex. uosmo) */ - denom: string; + denom?: string; /** * The step size of the binary search that is used to find the optimal swap * amount */ - step_size: string; + step_size?: string; } export interface BaseDenomAminoMsg { type: "osmosis/protorev/base-denom"; @@ -245,6 +454,46 @@ export interface BaseDenomSDKType { denom: string; step_size: string; } +export interface AllProtocolRevenue { + takerFeesTracker: TakerFeesTracker; + cyclicArbTracker: CyclicArbTracker; +} +export interface AllProtocolRevenueProtoMsg { + typeUrl: "/osmosis.protorev.v1beta1.AllProtocolRevenue"; + value: Uint8Array; +} +export interface AllProtocolRevenueAmino { + taker_fees_tracker?: TakerFeesTrackerAmino; + cyclic_arb_tracker?: CyclicArbTrackerAmino; +} +export interface AllProtocolRevenueAminoMsg { + type: "osmosis/protorev/all-protocol-revenue"; + value: AllProtocolRevenueAmino; +} +export interface AllProtocolRevenueSDKType { + taker_fees_tracker: TakerFeesTrackerSDKType; + cyclic_arb_tracker: CyclicArbTrackerSDKType; +} +export interface CyclicArbTracker { + cyclicArb: Coin[]; + heightAccountingStartsFrom: bigint; +} +export interface CyclicArbTrackerProtoMsg { + typeUrl: "/osmosis.protorev.v1beta1.CyclicArbTracker"; + value: Uint8Array; +} +export interface CyclicArbTrackerAmino { + cyclic_arb?: CoinAmino[]; + height_accounting_starts_from?: string; +} +export interface CyclicArbTrackerAminoMsg { + type: "osmosis/protorev/cyclic-arb-tracker"; + value: CyclicArbTrackerAmino; +} +export interface CyclicArbTrackerSDKType { + cyclic_arb: CoinSDKType[]; + height_accounting_starts_from: bigint; +} function createBaseTokenPairArbRoutes(): TokenPairArbRoutes { return { arbRoutes: [], @@ -254,6 +503,16 @@ function createBaseTokenPairArbRoutes(): TokenPairArbRoutes { } export const TokenPairArbRoutes = { typeUrl: "/osmosis.protorev.v1beta1.TokenPairArbRoutes", + aminoType: "osmosis/protorev/token-pair-arb-routes", + is(o: any): o is TokenPairArbRoutes { + return o && (o.$typeUrl === TokenPairArbRoutes.typeUrl || Array.isArray(o.arbRoutes) && (!o.arbRoutes.length || Route.is(o.arbRoutes[0])) && typeof o.tokenIn === "string" && typeof o.tokenOut === "string"); + }, + isSDK(o: any): o is TokenPairArbRoutesSDKType { + return o && (o.$typeUrl === TokenPairArbRoutes.typeUrl || Array.isArray(o.arb_routes) && (!o.arb_routes.length || Route.isSDK(o.arb_routes[0])) && typeof o.token_in === "string" && typeof o.token_out === "string"); + }, + isAmino(o: any): o is TokenPairArbRoutesAmino { + return o && (o.$typeUrl === TokenPairArbRoutes.typeUrl || Array.isArray(o.arb_routes) && (!o.arb_routes.length || Route.isAmino(o.arb_routes[0])) && typeof o.token_in === "string" && typeof o.token_out === "string"); + }, encode(message: TokenPairArbRoutes, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.arbRoutes) { Route.encode(v!, writer.uint32(10).fork()).ldelim(); @@ -289,6 +548,24 @@ export const TokenPairArbRoutes = { } return message; }, + fromJSON(object: any): TokenPairArbRoutes { + return { + arbRoutes: Array.isArray(object?.arbRoutes) ? object.arbRoutes.map((e: any) => Route.fromJSON(e)) : [], + tokenIn: isSet(object.tokenIn) ? String(object.tokenIn) : "", + tokenOut: isSet(object.tokenOut) ? String(object.tokenOut) : "" + }; + }, + toJSON(message: TokenPairArbRoutes): unknown { + const obj: any = {}; + if (message.arbRoutes) { + obj.arbRoutes = message.arbRoutes.map(e => e ? Route.toJSON(e) : undefined); + } else { + obj.arbRoutes = []; + } + message.tokenIn !== undefined && (obj.tokenIn = message.tokenIn); + message.tokenOut !== undefined && (obj.tokenOut = message.tokenOut); + return obj; + }, fromPartial(object: Partial): TokenPairArbRoutes { const message = createBaseTokenPairArbRoutes(); message.arbRoutes = object.arbRoutes?.map(e => Route.fromPartial(e)) || []; @@ -297,11 +574,15 @@ export const TokenPairArbRoutes = { return message; }, fromAmino(object: TokenPairArbRoutesAmino): TokenPairArbRoutes { - return { - arbRoutes: Array.isArray(object?.arb_routes) ? object.arb_routes.map((e: any) => Route.fromAmino(e)) : [], - tokenIn: object.token_in, - tokenOut: object.token_out - }; + const message = createBaseTokenPairArbRoutes(); + message.arbRoutes = object.arb_routes?.map(e => Route.fromAmino(e)) || []; + if (object.token_in !== undefined && object.token_in !== null) { + message.tokenIn = object.token_in; + } + if (object.token_out !== undefined && object.token_out !== null) { + message.tokenOut = object.token_out; + } + return message; }, toAmino(message: TokenPairArbRoutes): TokenPairArbRoutesAmino { const obj: any = {}; @@ -336,6 +617,8 @@ export const TokenPairArbRoutes = { }; } }; +GlobalDecoderRegistry.register(TokenPairArbRoutes.typeUrl, TokenPairArbRoutes); +GlobalDecoderRegistry.registerAminoProtoMapping(TokenPairArbRoutes.aminoType, TokenPairArbRoutes.typeUrl); function createBaseRoute(): Route { return { trades: [], @@ -344,6 +627,16 @@ function createBaseRoute(): Route { } export const Route = { typeUrl: "/osmosis.protorev.v1beta1.Route", + aminoType: "osmosis/protorev/route", + is(o: any): o is Route { + return o && (o.$typeUrl === Route.typeUrl || Array.isArray(o.trades) && (!o.trades.length || Trade.is(o.trades[0])) && typeof o.stepSize === "string"); + }, + isSDK(o: any): o is RouteSDKType { + return o && (o.$typeUrl === Route.typeUrl || Array.isArray(o.trades) && (!o.trades.length || Trade.isSDK(o.trades[0])) && typeof o.step_size === "string"); + }, + isAmino(o: any): o is RouteAmino { + return o && (o.$typeUrl === Route.typeUrl || Array.isArray(o.trades) && (!o.trades.length || Trade.isAmino(o.trades[0])) && typeof o.step_size === "string"); + }, encode(message: Route, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.trades) { Trade.encode(v!, writer.uint32(10).fork()).ldelim(); @@ -373,6 +666,22 @@ export const Route = { } return message; }, + fromJSON(object: any): Route { + return { + trades: Array.isArray(object?.trades) ? object.trades.map((e: any) => Trade.fromJSON(e)) : [], + stepSize: isSet(object.stepSize) ? String(object.stepSize) : "" + }; + }, + toJSON(message: Route): unknown { + const obj: any = {}; + if (message.trades) { + obj.trades = message.trades.map(e => e ? Trade.toJSON(e) : undefined); + } else { + obj.trades = []; + } + message.stepSize !== undefined && (obj.stepSize = message.stepSize); + return obj; + }, fromPartial(object: Partial): Route { const message = createBaseRoute(); message.trades = object.trades?.map(e => Trade.fromPartial(e)) || []; @@ -380,10 +689,12 @@ export const Route = { return message; }, fromAmino(object: RouteAmino): Route { - return { - trades: Array.isArray(object?.trades) ? object.trades.map((e: any) => Trade.fromAmino(e)) : [], - stepSize: object.step_size - }; + const message = createBaseRoute(); + message.trades = object.trades?.map(e => Trade.fromAmino(e)) || []; + if (object.step_size !== undefined && object.step_size !== null) { + message.stepSize = object.step_size; + } + return message; }, toAmino(message: Route): RouteAmino { const obj: any = {}; @@ -417,6 +728,8 @@ export const Route = { }; } }; +GlobalDecoderRegistry.register(Route.typeUrl, Route); +GlobalDecoderRegistry.registerAminoProtoMapping(Route.aminoType, Route.typeUrl); function createBaseTrade(): Trade { return { pool: BigInt(0), @@ -426,6 +739,16 @@ function createBaseTrade(): Trade { } export const Trade = { typeUrl: "/osmosis.protorev.v1beta1.Trade", + aminoType: "osmosis/protorev/trade", + is(o: any): o is Trade { + return o && (o.$typeUrl === Trade.typeUrl || typeof o.pool === "bigint" && typeof o.tokenIn === "string" && typeof o.tokenOut === "string"); + }, + isSDK(o: any): o is TradeSDKType { + return o && (o.$typeUrl === Trade.typeUrl || typeof o.pool === "bigint" && typeof o.token_in === "string" && typeof o.token_out === "string"); + }, + isAmino(o: any): o is TradeAmino { + return o && (o.$typeUrl === Trade.typeUrl || typeof o.pool === "bigint" && typeof o.token_in === "string" && typeof o.token_out === "string"); + }, encode(message: Trade, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.pool !== BigInt(0)) { writer.uint32(8).uint64(message.pool); @@ -461,6 +784,20 @@ export const Trade = { } return message; }, + fromJSON(object: any): Trade { + return { + pool: isSet(object.pool) ? BigInt(object.pool.toString()) : BigInt(0), + tokenIn: isSet(object.tokenIn) ? String(object.tokenIn) : "", + tokenOut: isSet(object.tokenOut) ? String(object.tokenOut) : "" + }; + }, + toJSON(message: Trade): unknown { + const obj: any = {}; + message.pool !== undefined && (obj.pool = (message.pool || BigInt(0)).toString()); + message.tokenIn !== undefined && (obj.tokenIn = message.tokenIn); + message.tokenOut !== undefined && (obj.tokenOut = message.tokenOut); + return obj; + }, fromPartial(object: Partial): Trade { const message = createBaseTrade(); message.pool = object.pool !== undefined && object.pool !== null ? BigInt(object.pool.toString()) : BigInt(0); @@ -469,11 +806,17 @@ export const Trade = { return message; }, fromAmino(object: TradeAmino): Trade { - return { - pool: BigInt(object.pool), - tokenIn: object.token_in, - tokenOut: object.token_out - }; + const message = createBaseTrade(); + if (object.pool !== undefined && object.pool !== null) { + message.pool = BigInt(object.pool); + } + if (object.token_in !== undefined && object.token_in !== null) { + message.tokenIn = object.token_in; + } + if (object.token_out !== undefined && object.token_out !== null) { + message.tokenOut = object.token_out; + } + return message; }, toAmino(message: Trade): TradeAmino { const obj: any = {}; @@ -504,6 +847,8 @@ export const Trade = { }; } }; +GlobalDecoderRegistry.register(Trade.typeUrl, Trade); +GlobalDecoderRegistry.registerAminoProtoMapping(Trade.aminoType, Trade.typeUrl); function createBaseRouteStatistics(): RouteStatistics { return { profits: [], @@ -513,6 +858,16 @@ function createBaseRouteStatistics(): RouteStatistics { } export const RouteStatistics = { typeUrl: "/osmosis.protorev.v1beta1.RouteStatistics", + aminoType: "osmosis/protorev/route-statistics", + is(o: any): o is RouteStatistics { + return o && (o.$typeUrl === RouteStatistics.typeUrl || Array.isArray(o.profits) && (!o.profits.length || Coin.is(o.profits[0])) && typeof o.numberOfTrades === "string" && Array.isArray(o.route) && (!o.route.length || typeof o.route[0] === "bigint")); + }, + isSDK(o: any): o is RouteStatisticsSDKType { + return o && (o.$typeUrl === RouteStatistics.typeUrl || Array.isArray(o.profits) && (!o.profits.length || Coin.isSDK(o.profits[0])) && typeof o.number_of_trades === "string" && Array.isArray(o.route) && (!o.route.length || typeof o.route[0] === "bigint")); + }, + isAmino(o: any): o is RouteStatisticsAmino { + return o && (o.$typeUrl === RouteStatistics.typeUrl || Array.isArray(o.profits) && (!o.profits.length || Coin.isAmino(o.profits[0])) && typeof o.number_of_trades === "string" && Array.isArray(o.route) && (!o.route.length || typeof o.route[0] === "bigint")); + }, encode(message: RouteStatistics, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.profits) { Coin.encode(v!, writer.uint32(10).fork()).ldelim(); @@ -557,6 +912,28 @@ export const RouteStatistics = { } return message; }, + fromJSON(object: any): RouteStatistics { + return { + profits: Array.isArray(object?.profits) ? object.profits.map((e: any) => Coin.fromJSON(e)) : [], + numberOfTrades: isSet(object.numberOfTrades) ? String(object.numberOfTrades) : "", + route: Array.isArray(object?.route) ? object.route.map((e: any) => BigInt(e.toString())) : [] + }; + }, + toJSON(message: RouteStatistics): unknown { + const obj: any = {}; + if (message.profits) { + obj.profits = message.profits.map(e => e ? Coin.toJSON(e) : undefined); + } else { + obj.profits = []; + } + message.numberOfTrades !== undefined && (obj.numberOfTrades = message.numberOfTrades); + if (message.route) { + obj.route = message.route.map(e => (e || BigInt(0)).toString()); + } else { + obj.route = []; + } + return obj; + }, fromPartial(object: Partial): RouteStatistics { const message = createBaseRouteStatistics(); message.profits = object.profits?.map(e => Coin.fromPartial(e)) || []; @@ -565,11 +942,13 @@ export const RouteStatistics = { return message; }, fromAmino(object: RouteStatisticsAmino): RouteStatistics { - return { - profits: Array.isArray(object?.profits) ? object.profits.map((e: any) => Coin.fromAmino(e)) : [], - numberOfTrades: object.number_of_trades, - route: Array.isArray(object?.route) ? object.route.map((e: any) => BigInt(e)) : [] - }; + const message = createBaseRouteStatistics(); + message.profits = object.profits?.map(e => Coin.fromAmino(e)) || []; + if (object.number_of_trades !== undefined && object.number_of_trades !== null) { + message.numberOfTrades = object.number_of_trades; + } + message.route = object.route?.map(e => BigInt(e)) || []; + return message; }, toAmino(message: RouteStatistics): RouteStatisticsAmino { const obj: any = {}; @@ -608,15 +987,28 @@ export const RouteStatistics = { }; } }; +GlobalDecoderRegistry.register(RouteStatistics.typeUrl, RouteStatistics); +GlobalDecoderRegistry.registerAminoProtoMapping(RouteStatistics.aminoType, RouteStatistics.typeUrl); function createBasePoolWeights(): PoolWeights { return { stableWeight: BigInt(0), balancerWeight: BigInt(0), - concentratedWeight: BigInt(0) + concentratedWeight: BigInt(0), + cosmwasmWeight: BigInt(0) }; } export const PoolWeights = { typeUrl: "/osmosis.protorev.v1beta1.PoolWeights", + aminoType: "osmosis/protorev/pool-weights", + is(o: any): o is PoolWeights { + return o && (o.$typeUrl === PoolWeights.typeUrl || typeof o.stableWeight === "bigint" && typeof o.balancerWeight === "bigint" && typeof o.concentratedWeight === "bigint" && typeof o.cosmwasmWeight === "bigint"); + }, + isSDK(o: any): o is PoolWeightsSDKType { + return o && (o.$typeUrl === PoolWeights.typeUrl || typeof o.stable_weight === "bigint" && typeof o.balancer_weight === "bigint" && typeof o.concentrated_weight === "bigint" && typeof o.cosmwasm_weight === "bigint"); + }, + isAmino(o: any): o is PoolWeightsAmino { + return o && (o.$typeUrl === PoolWeights.typeUrl || typeof o.stable_weight === "bigint" && typeof o.balancer_weight === "bigint" && typeof o.concentrated_weight === "bigint" && typeof o.cosmwasm_weight === "bigint"); + }, encode(message: PoolWeights, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.stableWeight !== BigInt(0)) { writer.uint32(8).uint64(message.stableWeight); @@ -627,6 +1019,9 @@ export const PoolWeights = { if (message.concentratedWeight !== BigInt(0)) { writer.uint32(24).uint64(message.concentratedWeight); } + if (message.cosmwasmWeight !== BigInt(0)) { + writer.uint32(32).uint64(message.cosmwasmWeight); + } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): PoolWeights { @@ -645,6 +1040,9 @@ export const PoolWeights = { case 3: message.concentratedWeight = reader.uint64(); break; + case 4: + message.cosmwasmWeight = reader.uint64(); + break; default: reader.skipType(tag & 7); break; @@ -652,25 +1050,52 @@ export const PoolWeights = { } return message; }, + fromJSON(object: any): PoolWeights { + return { + stableWeight: isSet(object.stableWeight) ? BigInt(object.stableWeight.toString()) : BigInt(0), + balancerWeight: isSet(object.balancerWeight) ? BigInt(object.balancerWeight.toString()) : BigInt(0), + concentratedWeight: isSet(object.concentratedWeight) ? BigInt(object.concentratedWeight.toString()) : BigInt(0), + cosmwasmWeight: isSet(object.cosmwasmWeight) ? BigInt(object.cosmwasmWeight.toString()) : BigInt(0) + }; + }, + toJSON(message: PoolWeights): unknown { + const obj: any = {}; + message.stableWeight !== undefined && (obj.stableWeight = (message.stableWeight || BigInt(0)).toString()); + message.balancerWeight !== undefined && (obj.balancerWeight = (message.balancerWeight || BigInt(0)).toString()); + message.concentratedWeight !== undefined && (obj.concentratedWeight = (message.concentratedWeight || BigInt(0)).toString()); + message.cosmwasmWeight !== undefined && (obj.cosmwasmWeight = (message.cosmwasmWeight || BigInt(0)).toString()); + return obj; + }, fromPartial(object: Partial): PoolWeights { const message = createBasePoolWeights(); message.stableWeight = object.stableWeight !== undefined && object.stableWeight !== null ? BigInt(object.stableWeight.toString()) : BigInt(0); message.balancerWeight = object.balancerWeight !== undefined && object.balancerWeight !== null ? BigInt(object.balancerWeight.toString()) : BigInt(0); message.concentratedWeight = object.concentratedWeight !== undefined && object.concentratedWeight !== null ? BigInt(object.concentratedWeight.toString()) : BigInt(0); + message.cosmwasmWeight = object.cosmwasmWeight !== undefined && object.cosmwasmWeight !== null ? BigInt(object.cosmwasmWeight.toString()) : BigInt(0); return message; }, fromAmino(object: PoolWeightsAmino): PoolWeights { - return { - stableWeight: BigInt(object.stable_weight), - balancerWeight: BigInt(object.balancer_weight), - concentratedWeight: BigInt(object.concentrated_weight) - }; + const message = createBasePoolWeights(); + if (object.stable_weight !== undefined && object.stable_weight !== null) { + message.stableWeight = BigInt(object.stable_weight); + } + if (object.balancer_weight !== undefined && object.balancer_weight !== null) { + message.balancerWeight = BigInt(object.balancer_weight); + } + if (object.concentrated_weight !== undefined && object.concentrated_weight !== null) { + message.concentratedWeight = BigInt(object.concentrated_weight); + } + if (object.cosmwasm_weight !== undefined && object.cosmwasm_weight !== null) { + message.cosmwasmWeight = BigInt(object.cosmwasm_weight); + } + return message; }, toAmino(message: PoolWeights): PoolWeightsAmino { const obj: any = {}; obj.stable_weight = message.stableWeight ? message.stableWeight.toString() : undefined; obj.balancer_weight = message.balancerWeight ? message.balancerWeight.toString() : undefined; obj.concentrated_weight = message.concentratedWeight ? message.concentratedWeight.toString() : undefined; + obj.cosmwasm_weight = message.cosmwasmWeight ? message.cosmwasmWeight.toString() : undefined; return obj; }, fromAminoMsg(object: PoolWeightsAminoMsg): PoolWeights { @@ -695,35 +1120,61 @@ export const PoolWeights = { }; } }; -function createBaseBaseDenom(): BaseDenom { +GlobalDecoderRegistry.register(PoolWeights.typeUrl, PoolWeights); +GlobalDecoderRegistry.registerAminoProtoMapping(PoolWeights.aminoType, PoolWeights.typeUrl); +function createBaseInfoByPoolType(): InfoByPoolType { return { - denom: "", - stepSize: "" + stable: StablePoolInfo.fromPartial({}), + balancer: BalancerPoolInfo.fromPartial({}), + concentrated: ConcentratedPoolInfo.fromPartial({}), + cosmwasm: CosmwasmPoolInfo.fromPartial({}) }; } -export const BaseDenom = { - typeUrl: "/osmosis.protorev.v1beta1.BaseDenom", - encode(message: BaseDenom, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { - if (message.denom !== "") { - writer.uint32(10).string(message.denom); +export const InfoByPoolType = { + typeUrl: "/osmosis.protorev.v1beta1.InfoByPoolType", + aminoType: "osmosis/protorev/info-by-pool-type", + is(o: any): o is InfoByPoolType { + return o && (o.$typeUrl === InfoByPoolType.typeUrl || StablePoolInfo.is(o.stable) && BalancerPoolInfo.is(o.balancer) && ConcentratedPoolInfo.is(o.concentrated) && CosmwasmPoolInfo.is(o.cosmwasm)); + }, + isSDK(o: any): o is InfoByPoolTypeSDKType { + return o && (o.$typeUrl === InfoByPoolType.typeUrl || StablePoolInfo.isSDK(o.stable) && BalancerPoolInfo.isSDK(o.balancer) && ConcentratedPoolInfo.isSDK(o.concentrated) && CosmwasmPoolInfo.isSDK(o.cosmwasm)); + }, + isAmino(o: any): o is InfoByPoolTypeAmino { + return o && (o.$typeUrl === InfoByPoolType.typeUrl || StablePoolInfo.isAmino(o.stable) && BalancerPoolInfo.isAmino(o.balancer) && ConcentratedPoolInfo.isAmino(o.concentrated) && CosmwasmPoolInfo.isAmino(o.cosmwasm)); + }, + encode(message: InfoByPoolType, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.stable !== undefined) { + StablePoolInfo.encode(message.stable, writer.uint32(10).fork()).ldelim(); } - if (message.stepSize !== "") { - writer.uint32(18).string(message.stepSize); + if (message.balancer !== undefined) { + BalancerPoolInfo.encode(message.balancer, writer.uint32(18).fork()).ldelim(); + } + if (message.concentrated !== undefined) { + ConcentratedPoolInfo.encode(message.concentrated, writer.uint32(26).fork()).ldelim(); + } + if (message.cosmwasm !== undefined) { + CosmwasmPoolInfo.encode(message.cosmwasm, writer.uint32(34).fork()).ldelim(); } return writer; }, - decode(input: BinaryReader | Uint8Array, length?: number): BaseDenom { + decode(input: BinaryReader | Uint8Array, length?: number): InfoByPoolType { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseBaseDenom(); + const message = createBaseInfoByPoolType(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.denom = reader.string(); + message.stable = StablePoolInfo.decode(reader, reader.uint32()); break; case 2: - message.stepSize = reader.string(); + message.balancer = BalancerPoolInfo.decode(reader, reader.uint32()); + break; + case 3: + message.concentrated = ConcentratedPoolInfo.decode(reader, reader.uint32()); + break; + case 4: + message.cosmwasm = CosmwasmPoolInfo.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -732,43 +1183,885 @@ export const BaseDenom = { } return message; }, - fromPartial(object: Partial): BaseDenom { - const message = createBaseBaseDenom(); - message.denom = object.denom ?? ""; - message.stepSize = object.stepSize ?? ""; - return message; - }, - fromAmino(object: BaseDenomAmino): BaseDenom { + fromJSON(object: any): InfoByPoolType { return { - denom: object.denom, - stepSize: object.step_size + stable: isSet(object.stable) ? StablePoolInfo.fromJSON(object.stable) : undefined, + balancer: isSet(object.balancer) ? BalancerPoolInfo.fromJSON(object.balancer) : undefined, + concentrated: isSet(object.concentrated) ? ConcentratedPoolInfo.fromJSON(object.concentrated) : undefined, + cosmwasm: isSet(object.cosmwasm) ? CosmwasmPoolInfo.fromJSON(object.cosmwasm) : undefined }; }, - toAmino(message: BaseDenom): BaseDenomAmino { + toJSON(message: InfoByPoolType): unknown { const obj: any = {}; - obj.denom = message.denom; - obj.step_size = message.stepSize; + message.stable !== undefined && (obj.stable = message.stable ? StablePoolInfo.toJSON(message.stable) : undefined); + message.balancer !== undefined && (obj.balancer = message.balancer ? BalancerPoolInfo.toJSON(message.balancer) : undefined); + message.concentrated !== undefined && (obj.concentrated = message.concentrated ? ConcentratedPoolInfo.toJSON(message.concentrated) : undefined); + message.cosmwasm !== undefined && (obj.cosmwasm = message.cosmwasm ? CosmwasmPoolInfo.toJSON(message.cosmwasm) : undefined); return obj; }, - fromAminoMsg(object: BaseDenomAminoMsg): BaseDenom { - return BaseDenom.fromAmino(object.value); + fromPartial(object: Partial): InfoByPoolType { + const message = createBaseInfoByPoolType(); + message.stable = object.stable !== undefined && object.stable !== null ? StablePoolInfo.fromPartial(object.stable) : undefined; + message.balancer = object.balancer !== undefined && object.balancer !== null ? BalancerPoolInfo.fromPartial(object.balancer) : undefined; + message.concentrated = object.concentrated !== undefined && object.concentrated !== null ? ConcentratedPoolInfo.fromPartial(object.concentrated) : undefined; + message.cosmwasm = object.cosmwasm !== undefined && object.cosmwasm !== null ? CosmwasmPoolInfo.fromPartial(object.cosmwasm) : undefined; + return message; }, - toAminoMsg(message: BaseDenom): BaseDenomAminoMsg { + fromAmino(object: InfoByPoolTypeAmino): InfoByPoolType { + const message = createBaseInfoByPoolType(); + if (object.stable !== undefined && object.stable !== null) { + message.stable = StablePoolInfo.fromAmino(object.stable); + } + if (object.balancer !== undefined && object.balancer !== null) { + message.balancer = BalancerPoolInfo.fromAmino(object.balancer); + } + if (object.concentrated !== undefined && object.concentrated !== null) { + message.concentrated = ConcentratedPoolInfo.fromAmino(object.concentrated); + } + if (object.cosmwasm !== undefined && object.cosmwasm !== null) { + message.cosmwasm = CosmwasmPoolInfo.fromAmino(object.cosmwasm); + } + return message; + }, + toAmino(message: InfoByPoolType): InfoByPoolTypeAmino { + const obj: any = {}; + obj.stable = message.stable ? StablePoolInfo.toAmino(message.stable) : undefined; + obj.balancer = message.balancer ? BalancerPoolInfo.toAmino(message.balancer) : undefined; + obj.concentrated = message.concentrated ? ConcentratedPoolInfo.toAmino(message.concentrated) : undefined; + obj.cosmwasm = message.cosmwasm ? CosmwasmPoolInfo.toAmino(message.cosmwasm) : undefined; + return obj; + }, + fromAminoMsg(object: InfoByPoolTypeAminoMsg): InfoByPoolType { + return InfoByPoolType.fromAmino(object.value); + }, + toAminoMsg(message: InfoByPoolType): InfoByPoolTypeAminoMsg { return { - type: "osmosis/protorev/base-denom", - value: BaseDenom.toAmino(message) + type: "osmosis/protorev/info-by-pool-type", + value: InfoByPoolType.toAmino(message) }; }, - fromProtoMsg(message: BaseDenomProtoMsg): BaseDenom { - return BaseDenom.decode(message.value); + fromProtoMsg(message: InfoByPoolTypeProtoMsg): InfoByPoolType { + return InfoByPoolType.decode(message.value); }, - toProto(message: BaseDenom): Uint8Array { - return BaseDenom.encode(message).finish(); + toProto(message: InfoByPoolType): Uint8Array { + return InfoByPoolType.encode(message).finish(); }, - toProtoMsg(message: BaseDenom): BaseDenomProtoMsg { + toProtoMsg(message: InfoByPoolType): InfoByPoolTypeProtoMsg { return { - typeUrl: "/osmosis.protorev.v1beta1.BaseDenom", - value: BaseDenom.encode(message).finish() + typeUrl: "/osmosis.protorev.v1beta1.InfoByPoolType", + value: InfoByPoolType.encode(message).finish() }; } -}; \ No newline at end of file +}; +GlobalDecoderRegistry.register(InfoByPoolType.typeUrl, InfoByPoolType); +GlobalDecoderRegistry.registerAminoProtoMapping(InfoByPoolType.aminoType, InfoByPoolType.typeUrl); +function createBaseStablePoolInfo(): StablePoolInfo { + return { + weight: BigInt(0) + }; +} +export const StablePoolInfo = { + typeUrl: "/osmosis.protorev.v1beta1.StablePoolInfo", + aminoType: "osmosis/protorev/stable-pool-info", + is(o: any): o is StablePoolInfo { + return o && (o.$typeUrl === StablePoolInfo.typeUrl || typeof o.weight === "bigint"); + }, + isSDK(o: any): o is StablePoolInfoSDKType { + return o && (o.$typeUrl === StablePoolInfo.typeUrl || typeof o.weight === "bigint"); + }, + isAmino(o: any): o is StablePoolInfoAmino { + return o && (o.$typeUrl === StablePoolInfo.typeUrl || typeof o.weight === "bigint"); + }, + encode(message: StablePoolInfo, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.weight !== BigInt(0)) { + writer.uint32(8).uint64(message.weight); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): StablePoolInfo { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseStablePoolInfo(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.weight = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): StablePoolInfo { + return { + weight: isSet(object.weight) ? BigInt(object.weight.toString()) : BigInt(0) + }; + }, + toJSON(message: StablePoolInfo): unknown { + const obj: any = {}; + message.weight !== undefined && (obj.weight = (message.weight || BigInt(0)).toString()); + return obj; + }, + fromPartial(object: Partial): StablePoolInfo { + const message = createBaseStablePoolInfo(); + message.weight = object.weight !== undefined && object.weight !== null ? BigInt(object.weight.toString()) : BigInt(0); + return message; + }, + fromAmino(object: StablePoolInfoAmino): StablePoolInfo { + const message = createBaseStablePoolInfo(); + if (object.weight !== undefined && object.weight !== null) { + message.weight = BigInt(object.weight); + } + return message; + }, + toAmino(message: StablePoolInfo): StablePoolInfoAmino { + const obj: any = {}; + obj.weight = message.weight ? message.weight.toString() : undefined; + return obj; + }, + fromAminoMsg(object: StablePoolInfoAminoMsg): StablePoolInfo { + return StablePoolInfo.fromAmino(object.value); + }, + toAminoMsg(message: StablePoolInfo): StablePoolInfoAminoMsg { + return { + type: "osmosis/protorev/stable-pool-info", + value: StablePoolInfo.toAmino(message) + }; + }, + fromProtoMsg(message: StablePoolInfoProtoMsg): StablePoolInfo { + return StablePoolInfo.decode(message.value); + }, + toProto(message: StablePoolInfo): Uint8Array { + return StablePoolInfo.encode(message).finish(); + }, + toProtoMsg(message: StablePoolInfo): StablePoolInfoProtoMsg { + return { + typeUrl: "/osmosis.protorev.v1beta1.StablePoolInfo", + value: StablePoolInfo.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(StablePoolInfo.typeUrl, StablePoolInfo); +GlobalDecoderRegistry.registerAminoProtoMapping(StablePoolInfo.aminoType, StablePoolInfo.typeUrl); +function createBaseBalancerPoolInfo(): BalancerPoolInfo { + return { + weight: BigInt(0) + }; +} +export const BalancerPoolInfo = { + typeUrl: "/osmosis.protorev.v1beta1.BalancerPoolInfo", + aminoType: "osmosis/protorev/balancer-pool-info", + is(o: any): o is BalancerPoolInfo { + return o && (o.$typeUrl === BalancerPoolInfo.typeUrl || typeof o.weight === "bigint"); + }, + isSDK(o: any): o is BalancerPoolInfoSDKType { + return o && (o.$typeUrl === BalancerPoolInfo.typeUrl || typeof o.weight === "bigint"); + }, + isAmino(o: any): o is BalancerPoolInfoAmino { + return o && (o.$typeUrl === BalancerPoolInfo.typeUrl || typeof o.weight === "bigint"); + }, + encode(message: BalancerPoolInfo, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.weight !== BigInt(0)) { + writer.uint32(8).uint64(message.weight); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): BalancerPoolInfo { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseBalancerPoolInfo(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.weight = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): BalancerPoolInfo { + return { + weight: isSet(object.weight) ? BigInt(object.weight.toString()) : BigInt(0) + }; + }, + toJSON(message: BalancerPoolInfo): unknown { + const obj: any = {}; + message.weight !== undefined && (obj.weight = (message.weight || BigInt(0)).toString()); + return obj; + }, + fromPartial(object: Partial): BalancerPoolInfo { + const message = createBaseBalancerPoolInfo(); + message.weight = object.weight !== undefined && object.weight !== null ? BigInt(object.weight.toString()) : BigInt(0); + return message; + }, + fromAmino(object: BalancerPoolInfoAmino): BalancerPoolInfo { + const message = createBaseBalancerPoolInfo(); + if (object.weight !== undefined && object.weight !== null) { + message.weight = BigInt(object.weight); + } + return message; + }, + toAmino(message: BalancerPoolInfo): BalancerPoolInfoAmino { + const obj: any = {}; + obj.weight = message.weight ? message.weight.toString() : undefined; + return obj; + }, + fromAminoMsg(object: BalancerPoolInfoAminoMsg): BalancerPoolInfo { + return BalancerPoolInfo.fromAmino(object.value); + }, + toAminoMsg(message: BalancerPoolInfo): BalancerPoolInfoAminoMsg { + return { + type: "osmosis/protorev/balancer-pool-info", + value: BalancerPoolInfo.toAmino(message) + }; + }, + fromProtoMsg(message: BalancerPoolInfoProtoMsg): BalancerPoolInfo { + return BalancerPoolInfo.decode(message.value); + }, + toProto(message: BalancerPoolInfo): Uint8Array { + return BalancerPoolInfo.encode(message).finish(); + }, + toProtoMsg(message: BalancerPoolInfo): BalancerPoolInfoProtoMsg { + return { + typeUrl: "/osmosis.protorev.v1beta1.BalancerPoolInfo", + value: BalancerPoolInfo.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(BalancerPoolInfo.typeUrl, BalancerPoolInfo); +GlobalDecoderRegistry.registerAminoProtoMapping(BalancerPoolInfo.aminoType, BalancerPoolInfo.typeUrl); +function createBaseConcentratedPoolInfo(): ConcentratedPoolInfo { + return { + weight: BigInt(0), + maxTicksCrossed: BigInt(0) + }; +} +export const ConcentratedPoolInfo = { + typeUrl: "/osmosis.protorev.v1beta1.ConcentratedPoolInfo", + aminoType: "osmosis/protorev/concentrated-pool-info", + is(o: any): o is ConcentratedPoolInfo { + return o && (o.$typeUrl === ConcentratedPoolInfo.typeUrl || typeof o.weight === "bigint" && typeof o.maxTicksCrossed === "bigint"); + }, + isSDK(o: any): o is ConcentratedPoolInfoSDKType { + return o && (o.$typeUrl === ConcentratedPoolInfo.typeUrl || typeof o.weight === "bigint" && typeof o.max_ticks_crossed === "bigint"); + }, + isAmino(o: any): o is ConcentratedPoolInfoAmino { + return o && (o.$typeUrl === ConcentratedPoolInfo.typeUrl || typeof o.weight === "bigint" && typeof o.max_ticks_crossed === "bigint"); + }, + encode(message: ConcentratedPoolInfo, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.weight !== BigInt(0)) { + writer.uint32(8).uint64(message.weight); + } + if (message.maxTicksCrossed !== BigInt(0)) { + writer.uint32(16).uint64(message.maxTicksCrossed); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): ConcentratedPoolInfo { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseConcentratedPoolInfo(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.weight = reader.uint64(); + break; + case 2: + message.maxTicksCrossed = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): ConcentratedPoolInfo { + return { + weight: isSet(object.weight) ? BigInt(object.weight.toString()) : BigInt(0), + maxTicksCrossed: isSet(object.maxTicksCrossed) ? BigInt(object.maxTicksCrossed.toString()) : BigInt(0) + }; + }, + toJSON(message: ConcentratedPoolInfo): unknown { + const obj: any = {}; + message.weight !== undefined && (obj.weight = (message.weight || BigInt(0)).toString()); + message.maxTicksCrossed !== undefined && (obj.maxTicksCrossed = (message.maxTicksCrossed || BigInt(0)).toString()); + return obj; + }, + fromPartial(object: Partial): ConcentratedPoolInfo { + const message = createBaseConcentratedPoolInfo(); + message.weight = object.weight !== undefined && object.weight !== null ? BigInt(object.weight.toString()) : BigInt(0); + message.maxTicksCrossed = object.maxTicksCrossed !== undefined && object.maxTicksCrossed !== null ? BigInt(object.maxTicksCrossed.toString()) : BigInt(0); + return message; + }, + fromAmino(object: ConcentratedPoolInfoAmino): ConcentratedPoolInfo { + const message = createBaseConcentratedPoolInfo(); + if (object.weight !== undefined && object.weight !== null) { + message.weight = BigInt(object.weight); + } + if (object.max_ticks_crossed !== undefined && object.max_ticks_crossed !== null) { + message.maxTicksCrossed = BigInt(object.max_ticks_crossed); + } + return message; + }, + toAmino(message: ConcentratedPoolInfo): ConcentratedPoolInfoAmino { + const obj: any = {}; + obj.weight = message.weight ? message.weight.toString() : undefined; + obj.max_ticks_crossed = message.maxTicksCrossed ? message.maxTicksCrossed.toString() : undefined; + return obj; + }, + fromAminoMsg(object: ConcentratedPoolInfoAminoMsg): ConcentratedPoolInfo { + return ConcentratedPoolInfo.fromAmino(object.value); + }, + toAminoMsg(message: ConcentratedPoolInfo): ConcentratedPoolInfoAminoMsg { + return { + type: "osmosis/protorev/concentrated-pool-info", + value: ConcentratedPoolInfo.toAmino(message) + }; + }, + fromProtoMsg(message: ConcentratedPoolInfoProtoMsg): ConcentratedPoolInfo { + return ConcentratedPoolInfo.decode(message.value); + }, + toProto(message: ConcentratedPoolInfo): Uint8Array { + return ConcentratedPoolInfo.encode(message).finish(); + }, + toProtoMsg(message: ConcentratedPoolInfo): ConcentratedPoolInfoProtoMsg { + return { + typeUrl: "/osmosis.protorev.v1beta1.ConcentratedPoolInfo", + value: ConcentratedPoolInfo.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(ConcentratedPoolInfo.typeUrl, ConcentratedPoolInfo); +GlobalDecoderRegistry.registerAminoProtoMapping(ConcentratedPoolInfo.aminoType, ConcentratedPoolInfo.typeUrl); +function createBaseCosmwasmPoolInfo(): CosmwasmPoolInfo { + return { + weightMaps: [] + }; +} +export const CosmwasmPoolInfo = { + typeUrl: "/osmosis.protorev.v1beta1.CosmwasmPoolInfo", + aminoType: "osmosis/protorev/cosmwasm-pool-info", + is(o: any): o is CosmwasmPoolInfo { + return o && (o.$typeUrl === CosmwasmPoolInfo.typeUrl || Array.isArray(o.weightMaps) && (!o.weightMaps.length || WeightMap.is(o.weightMaps[0]))); + }, + isSDK(o: any): o is CosmwasmPoolInfoSDKType { + return o && (o.$typeUrl === CosmwasmPoolInfo.typeUrl || Array.isArray(o.weight_maps) && (!o.weight_maps.length || WeightMap.isSDK(o.weight_maps[0]))); + }, + isAmino(o: any): o is CosmwasmPoolInfoAmino { + return o && (o.$typeUrl === CosmwasmPoolInfo.typeUrl || Array.isArray(o.weight_maps) && (!o.weight_maps.length || WeightMap.isAmino(o.weight_maps[0]))); + }, + encode(message: CosmwasmPoolInfo, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.weightMaps) { + WeightMap.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): CosmwasmPoolInfo { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseCosmwasmPoolInfo(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.weightMaps.push(WeightMap.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): CosmwasmPoolInfo { + return { + weightMaps: Array.isArray(object?.weightMaps) ? object.weightMaps.map((e: any) => WeightMap.fromJSON(e)) : [] + }; + }, + toJSON(message: CosmwasmPoolInfo): unknown { + const obj: any = {}; + if (message.weightMaps) { + obj.weightMaps = message.weightMaps.map(e => e ? WeightMap.toJSON(e) : undefined); + } else { + obj.weightMaps = []; + } + return obj; + }, + fromPartial(object: Partial): CosmwasmPoolInfo { + const message = createBaseCosmwasmPoolInfo(); + message.weightMaps = object.weightMaps?.map(e => WeightMap.fromPartial(e)) || []; + return message; + }, + fromAmino(object: CosmwasmPoolInfoAmino): CosmwasmPoolInfo { + const message = createBaseCosmwasmPoolInfo(); + message.weightMaps = object.weight_maps?.map(e => WeightMap.fromAmino(e)) || []; + return message; + }, + toAmino(message: CosmwasmPoolInfo): CosmwasmPoolInfoAmino { + const obj: any = {}; + if (message.weightMaps) { + obj.weight_maps = message.weightMaps.map(e => e ? WeightMap.toAmino(e) : undefined); + } else { + obj.weight_maps = []; + } + return obj; + }, + fromAminoMsg(object: CosmwasmPoolInfoAminoMsg): CosmwasmPoolInfo { + return CosmwasmPoolInfo.fromAmino(object.value); + }, + toAminoMsg(message: CosmwasmPoolInfo): CosmwasmPoolInfoAminoMsg { + return { + type: "osmosis/protorev/cosmwasm-pool-info", + value: CosmwasmPoolInfo.toAmino(message) + }; + }, + fromProtoMsg(message: CosmwasmPoolInfoProtoMsg): CosmwasmPoolInfo { + return CosmwasmPoolInfo.decode(message.value); + }, + toProto(message: CosmwasmPoolInfo): Uint8Array { + return CosmwasmPoolInfo.encode(message).finish(); + }, + toProtoMsg(message: CosmwasmPoolInfo): CosmwasmPoolInfoProtoMsg { + return { + typeUrl: "/osmosis.protorev.v1beta1.CosmwasmPoolInfo", + value: CosmwasmPoolInfo.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(CosmwasmPoolInfo.typeUrl, CosmwasmPoolInfo); +GlobalDecoderRegistry.registerAminoProtoMapping(CosmwasmPoolInfo.aminoType, CosmwasmPoolInfo.typeUrl); +function createBaseWeightMap(): WeightMap { + return { + weight: BigInt(0), + contractAddress: "" + }; +} +export const WeightMap = { + typeUrl: "/osmosis.protorev.v1beta1.WeightMap", + aminoType: "osmosis/protorev/weight-map", + is(o: any): o is WeightMap { + return o && (o.$typeUrl === WeightMap.typeUrl || typeof o.weight === "bigint" && typeof o.contractAddress === "string"); + }, + isSDK(o: any): o is WeightMapSDKType { + return o && (o.$typeUrl === WeightMap.typeUrl || typeof o.weight === "bigint" && typeof o.contract_address === "string"); + }, + isAmino(o: any): o is WeightMapAmino { + return o && (o.$typeUrl === WeightMap.typeUrl || typeof o.weight === "bigint" && typeof o.contract_address === "string"); + }, + encode(message: WeightMap, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.weight !== BigInt(0)) { + writer.uint32(8).uint64(message.weight); + } + if (message.contractAddress !== "") { + writer.uint32(18).string(message.contractAddress); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): WeightMap { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseWeightMap(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.weight = reader.uint64(); + break; + case 2: + message.contractAddress = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): WeightMap { + return { + weight: isSet(object.weight) ? BigInt(object.weight.toString()) : BigInt(0), + contractAddress: isSet(object.contractAddress) ? String(object.contractAddress) : "" + }; + }, + toJSON(message: WeightMap): unknown { + const obj: any = {}; + message.weight !== undefined && (obj.weight = (message.weight || BigInt(0)).toString()); + message.contractAddress !== undefined && (obj.contractAddress = message.contractAddress); + return obj; + }, + fromPartial(object: Partial): WeightMap { + const message = createBaseWeightMap(); + message.weight = object.weight !== undefined && object.weight !== null ? BigInt(object.weight.toString()) : BigInt(0); + message.contractAddress = object.contractAddress ?? ""; + return message; + }, + fromAmino(object: WeightMapAmino): WeightMap { + const message = createBaseWeightMap(); + if (object.weight !== undefined && object.weight !== null) { + message.weight = BigInt(object.weight); + } + if (object.contract_address !== undefined && object.contract_address !== null) { + message.contractAddress = object.contract_address; + } + return message; + }, + toAmino(message: WeightMap): WeightMapAmino { + const obj: any = {}; + obj.weight = message.weight ? message.weight.toString() : undefined; + obj.contract_address = message.contractAddress; + return obj; + }, + fromAminoMsg(object: WeightMapAminoMsg): WeightMap { + return WeightMap.fromAmino(object.value); + }, + toAminoMsg(message: WeightMap): WeightMapAminoMsg { + return { + type: "osmosis/protorev/weight-map", + value: WeightMap.toAmino(message) + }; + }, + fromProtoMsg(message: WeightMapProtoMsg): WeightMap { + return WeightMap.decode(message.value); + }, + toProto(message: WeightMap): Uint8Array { + return WeightMap.encode(message).finish(); + }, + toProtoMsg(message: WeightMap): WeightMapProtoMsg { + return { + typeUrl: "/osmosis.protorev.v1beta1.WeightMap", + value: WeightMap.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(WeightMap.typeUrl, WeightMap); +GlobalDecoderRegistry.registerAminoProtoMapping(WeightMap.aminoType, WeightMap.typeUrl); +function createBaseBaseDenom(): BaseDenom { + return { + denom: "", + stepSize: "" + }; +} +export const BaseDenom = { + typeUrl: "/osmosis.protorev.v1beta1.BaseDenom", + aminoType: "osmosis/protorev/base-denom", + is(o: any): o is BaseDenom { + return o && (o.$typeUrl === BaseDenom.typeUrl || typeof o.denom === "string" && typeof o.stepSize === "string"); + }, + isSDK(o: any): o is BaseDenomSDKType { + return o && (o.$typeUrl === BaseDenom.typeUrl || typeof o.denom === "string" && typeof o.step_size === "string"); + }, + isAmino(o: any): o is BaseDenomAmino { + return o && (o.$typeUrl === BaseDenom.typeUrl || typeof o.denom === "string" && typeof o.step_size === "string"); + }, + encode(message: BaseDenom, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.denom !== "") { + writer.uint32(10).string(message.denom); + } + if (message.stepSize !== "") { + writer.uint32(18).string(message.stepSize); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): BaseDenom { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseBaseDenom(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.denom = reader.string(); + break; + case 2: + message.stepSize = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): BaseDenom { + return { + denom: isSet(object.denom) ? String(object.denom) : "", + stepSize: isSet(object.stepSize) ? String(object.stepSize) : "" + }; + }, + toJSON(message: BaseDenom): unknown { + const obj: any = {}; + message.denom !== undefined && (obj.denom = message.denom); + message.stepSize !== undefined && (obj.stepSize = message.stepSize); + return obj; + }, + fromPartial(object: Partial): BaseDenom { + const message = createBaseBaseDenom(); + message.denom = object.denom ?? ""; + message.stepSize = object.stepSize ?? ""; + return message; + }, + fromAmino(object: BaseDenomAmino): BaseDenom { + const message = createBaseBaseDenom(); + if (object.denom !== undefined && object.denom !== null) { + message.denom = object.denom; + } + if (object.step_size !== undefined && object.step_size !== null) { + message.stepSize = object.step_size; + } + return message; + }, + toAmino(message: BaseDenom): BaseDenomAmino { + const obj: any = {}; + obj.denom = message.denom; + obj.step_size = message.stepSize; + return obj; + }, + fromAminoMsg(object: BaseDenomAminoMsg): BaseDenom { + return BaseDenom.fromAmino(object.value); + }, + toAminoMsg(message: BaseDenom): BaseDenomAminoMsg { + return { + type: "osmosis/protorev/base-denom", + value: BaseDenom.toAmino(message) + }; + }, + fromProtoMsg(message: BaseDenomProtoMsg): BaseDenom { + return BaseDenom.decode(message.value); + }, + toProto(message: BaseDenom): Uint8Array { + return BaseDenom.encode(message).finish(); + }, + toProtoMsg(message: BaseDenom): BaseDenomProtoMsg { + return { + typeUrl: "/osmosis.protorev.v1beta1.BaseDenom", + value: BaseDenom.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(BaseDenom.typeUrl, BaseDenom); +GlobalDecoderRegistry.registerAminoProtoMapping(BaseDenom.aminoType, BaseDenom.typeUrl); +function createBaseAllProtocolRevenue(): AllProtocolRevenue { + return { + takerFeesTracker: TakerFeesTracker.fromPartial({}), + cyclicArbTracker: CyclicArbTracker.fromPartial({}) + }; +} +export const AllProtocolRevenue = { + typeUrl: "/osmosis.protorev.v1beta1.AllProtocolRevenue", + aminoType: "osmosis/protorev/all-protocol-revenue", + is(o: any): o is AllProtocolRevenue { + return o && (o.$typeUrl === AllProtocolRevenue.typeUrl || TakerFeesTracker.is(o.takerFeesTracker) && CyclicArbTracker.is(o.cyclicArbTracker)); + }, + isSDK(o: any): o is AllProtocolRevenueSDKType { + return o && (o.$typeUrl === AllProtocolRevenue.typeUrl || TakerFeesTracker.isSDK(o.taker_fees_tracker) && CyclicArbTracker.isSDK(o.cyclic_arb_tracker)); + }, + isAmino(o: any): o is AllProtocolRevenueAmino { + return o && (o.$typeUrl === AllProtocolRevenue.typeUrl || TakerFeesTracker.isAmino(o.taker_fees_tracker) && CyclicArbTracker.isAmino(o.cyclic_arb_tracker)); + }, + encode(message: AllProtocolRevenue, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.takerFeesTracker !== undefined) { + TakerFeesTracker.encode(message.takerFeesTracker, writer.uint32(10).fork()).ldelim(); + } + if (message.cyclicArbTracker !== undefined) { + CyclicArbTracker.encode(message.cyclicArbTracker, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): AllProtocolRevenue { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseAllProtocolRevenue(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.takerFeesTracker = TakerFeesTracker.decode(reader, reader.uint32()); + break; + case 3: + message.cyclicArbTracker = CyclicArbTracker.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): AllProtocolRevenue { + return { + takerFeesTracker: isSet(object.takerFeesTracker) ? TakerFeesTracker.fromJSON(object.takerFeesTracker) : undefined, + cyclicArbTracker: isSet(object.cyclicArbTracker) ? CyclicArbTracker.fromJSON(object.cyclicArbTracker) : undefined + }; + }, + toJSON(message: AllProtocolRevenue): unknown { + const obj: any = {}; + message.takerFeesTracker !== undefined && (obj.takerFeesTracker = message.takerFeesTracker ? TakerFeesTracker.toJSON(message.takerFeesTracker) : undefined); + message.cyclicArbTracker !== undefined && (obj.cyclicArbTracker = message.cyclicArbTracker ? CyclicArbTracker.toJSON(message.cyclicArbTracker) : undefined); + return obj; + }, + fromPartial(object: Partial): AllProtocolRevenue { + const message = createBaseAllProtocolRevenue(); + message.takerFeesTracker = object.takerFeesTracker !== undefined && object.takerFeesTracker !== null ? TakerFeesTracker.fromPartial(object.takerFeesTracker) : undefined; + message.cyclicArbTracker = object.cyclicArbTracker !== undefined && object.cyclicArbTracker !== null ? CyclicArbTracker.fromPartial(object.cyclicArbTracker) : undefined; + return message; + }, + fromAmino(object: AllProtocolRevenueAmino): AllProtocolRevenue { + const message = createBaseAllProtocolRevenue(); + if (object.taker_fees_tracker !== undefined && object.taker_fees_tracker !== null) { + message.takerFeesTracker = TakerFeesTracker.fromAmino(object.taker_fees_tracker); + } + if (object.cyclic_arb_tracker !== undefined && object.cyclic_arb_tracker !== null) { + message.cyclicArbTracker = CyclicArbTracker.fromAmino(object.cyclic_arb_tracker); + } + return message; + }, + toAmino(message: AllProtocolRevenue): AllProtocolRevenueAmino { + const obj: any = {}; + obj.taker_fees_tracker = message.takerFeesTracker ? TakerFeesTracker.toAmino(message.takerFeesTracker) : undefined; + obj.cyclic_arb_tracker = message.cyclicArbTracker ? CyclicArbTracker.toAmino(message.cyclicArbTracker) : undefined; + return obj; + }, + fromAminoMsg(object: AllProtocolRevenueAminoMsg): AllProtocolRevenue { + return AllProtocolRevenue.fromAmino(object.value); + }, + toAminoMsg(message: AllProtocolRevenue): AllProtocolRevenueAminoMsg { + return { + type: "osmosis/protorev/all-protocol-revenue", + value: AllProtocolRevenue.toAmino(message) + }; + }, + fromProtoMsg(message: AllProtocolRevenueProtoMsg): AllProtocolRevenue { + return AllProtocolRevenue.decode(message.value); + }, + toProto(message: AllProtocolRevenue): Uint8Array { + return AllProtocolRevenue.encode(message).finish(); + }, + toProtoMsg(message: AllProtocolRevenue): AllProtocolRevenueProtoMsg { + return { + typeUrl: "/osmosis.protorev.v1beta1.AllProtocolRevenue", + value: AllProtocolRevenue.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(AllProtocolRevenue.typeUrl, AllProtocolRevenue); +GlobalDecoderRegistry.registerAminoProtoMapping(AllProtocolRevenue.aminoType, AllProtocolRevenue.typeUrl); +function createBaseCyclicArbTracker(): CyclicArbTracker { + return { + cyclicArb: [], + heightAccountingStartsFrom: BigInt(0) + }; +} +export const CyclicArbTracker = { + typeUrl: "/osmosis.protorev.v1beta1.CyclicArbTracker", + aminoType: "osmosis/protorev/cyclic-arb-tracker", + is(o: any): o is CyclicArbTracker { + return o && (o.$typeUrl === CyclicArbTracker.typeUrl || Array.isArray(o.cyclicArb) && (!o.cyclicArb.length || Coin.is(o.cyclicArb[0])) && typeof o.heightAccountingStartsFrom === "bigint"); + }, + isSDK(o: any): o is CyclicArbTrackerSDKType { + return o && (o.$typeUrl === CyclicArbTracker.typeUrl || Array.isArray(o.cyclic_arb) && (!o.cyclic_arb.length || Coin.isSDK(o.cyclic_arb[0])) && typeof o.height_accounting_starts_from === "bigint"); + }, + isAmino(o: any): o is CyclicArbTrackerAmino { + return o && (o.$typeUrl === CyclicArbTracker.typeUrl || Array.isArray(o.cyclic_arb) && (!o.cyclic_arb.length || Coin.isAmino(o.cyclic_arb[0])) && typeof o.height_accounting_starts_from === "bigint"); + }, + encode(message: CyclicArbTracker, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.cyclicArb) { + Coin.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.heightAccountingStartsFrom !== BigInt(0)) { + writer.uint32(16).int64(message.heightAccountingStartsFrom); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): CyclicArbTracker { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseCyclicArbTracker(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.cyclicArb.push(Coin.decode(reader, reader.uint32())); + break; + case 2: + message.heightAccountingStartsFrom = reader.int64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): CyclicArbTracker { + return { + cyclicArb: Array.isArray(object?.cyclicArb) ? object.cyclicArb.map((e: any) => Coin.fromJSON(e)) : [], + heightAccountingStartsFrom: isSet(object.heightAccountingStartsFrom) ? BigInt(object.heightAccountingStartsFrom.toString()) : BigInt(0) + }; + }, + toJSON(message: CyclicArbTracker): unknown { + const obj: any = {}; + if (message.cyclicArb) { + obj.cyclicArb = message.cyclicArb.map(e => e ? Coin.toJSON(e) : undefined); + } else { + obj.cyclicArb = []; + } + message.heightAccountingStartsFrom !== undefined && (obj.heightAccountingStartsFrom = (message.heightAccountingStartsFrom || BigInt(0)).toString()); + return obj; + }, + fromPartial(object: Partial): CyclicArbTracker { + const message = createBaseCyclicArbTracker(); + message.cyclicArb = object.cyclicArb?.map(e => Coin.fromPartial(e)) || []; + message.heightAccountingStartsFrom = object.heightAccountingStartsFrom !== undefined && object.heightAccountingStartsFrom !== null ? BigInt(object.heightAccountingStartsFrom.toString()) : BigInt(0); + return message; + }, + fromAmino(object: CyclicArbTrackerAmino): CyclicArbTracker { + const message = createBaseCyclicArbTracker(); + message.cyclicArb = object.cyclic_arb?.map(e => Coin.fromAmino(e)) || []; + if (object.height_accounting_starts_from !== undefined && object.height_accounting_starts_from !== null) { + message.heightAccountingStartsFrom = BigInt(object.height_accounting_starts_from); + } + return message; + }, + toAmino(message: CyclicArbTracker): CyclicArbTrackerAmino { + const obj: any = {}; + if (message.cyclicArb) { + obj.cyclic_arb = message.cyclicArb.map(e => e ? Coin.toAmino(e) : undefined); + } else { + obj.cyclic_arb = []; + } + obj.height_accounting_starts_from = message.heightAccountingStartsFrom ? message.heightAccountingStartsFrom.toString() : undefined; + return obj; + }, + fromAminoMsg(object: CyclicArbTrackerAminoMsg): CyclicArbTracker { + return CyclicArbTracker.fromAmino(object.value); + }, + toAminoMsg(message: CyclicArbTracker): CyclicArbTrackerAminoMsg { + return { + type: "osmosis/protorev/cyclic-arb-tracker", + value: CyclicArbTracker.toAmino(message) + }; + }, + fromProtoMsg(message: CyclicArbTrackerProtoMsg): CyclicArbTracker { + return CyclicArbTracker.decode(message.value); + }, + toProto(message: CyclicArbTracker): Uint8Array { + return CyclicArbTracker.encode(message).finish(); + }, + toProtoMsg(message: CyclicArbTracker): CyclicArbTrackerProtoMsg { + return { + typeUrl: "/osmosis.protorev.v1beta1.CyclicArbTracker", + value: CyclicArbTracker.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(CyclicArbTracker.typeUrl, CyclicArbTracker); +GlobalDecoderRegistry.registerAminoProtoMapping(CyclicArbTracker.aminoType, CyclicArbTracker.typeUrl); \ No newline at end of file diff --git a/packages/osmojs/src/codegen/osmosis/protorev/v1beta1/query.lcd.ts b/packages/osmojs/src/codegen/osmosis/protorev/v1beta1/query.lcd.ts index a24f9782f..625584dec 100644 --- a/packages/osmojs/src/codegen/osmosis/protorev/v1beta1/query.lcd.ts +++ b/packages/osmojs/src/codegen/osmosis/protorev/v1beta1/query.lcd.ts @@ -1,5 +1,5 @@ import { LCDClient } from "@cosmology/lcd"; -import { QueryParamsRequest, QueryParamsResponseSDKType, QueryGetProtoRevNumberOfTradesRequest, QueryGetProtoRevNumberOfTradesResponseSDKType, QueryGetProtoRevProfitsByDenomRequest, QueryGetProtoRevProfitsByDenomResponseSDKType, QueryGetProtoRevAllProfitsRequest, QueryGetProtoRevAllProfitsResponseSDKType, QueryGetProtoRevStatisticsByRouteRequest, QueryGetProtoRevStatisticsByRouteResponseSDKType, QueryGetProtoRevAllRouteStatisticsRequest, QueryGetProtoRevAllRouteStatisticsResponseSDKType, QueryGetProtoRevTokenPairArbRoutesRequest, QueryGetProtoRevTokenPairArbRoutesResponseSDKType, QueryGetProtoRevAdminAccountRequest, QueryGetProtoRevAdminAccountResponseSDKType, QueryGetProtoRevDeveloperAccountRequest, QueryGetProtoRevDeveloperAccountResponseSDKType, QueryGetProtoRevPoolWeightsRequest, QueryGetProtoRevPoolWeightsResponseSDKType, QueryGetProtoRevMaxPoolPointsPerTxRequest, QueryGetProtoRevMaxPoolPointsPerTxResponseSDKType, QueryGetProtoRevMaxPoolPointsPerBlockRequest, QueryGetProtoRevMaxPoolPointsPerBlockResponseSDKType, QueryGetProtoRevBaseDenomsRequest, QueryGetProtoRevBaseDenomsResponseSDKType, QueryGetProtoRevEnabledRequest, QueryGetProtoRevEnabledResponseSDKType, QueryGetProtoRevPoolRequest, QueryGetProtoRevPoolResponseSDKType } from "./query"; +import { QueryParamsRequest, QueryParamsResponseSDKType, QueryGetProtoRevNumberOfTradesRequest, QueryGetProtoRevNumberOfTradesResponseSDKType, QueryGetProtoRevProfitsByDenomRequest, QueryGetProtoRevProfitsByDenomResponseSDKType, QueryGetProtoRevAllProfitsRequest, QueryGetProtoRevAllProfitsResponseSDKType, QueryGetProtoRevStatisticsByRouteRequest, QueryGetProtoRevStatisticsByRouteResponseSDKType, QueryGetProtoRevAllRouteStatisticsRequest, QueryGetProtoRevAllRouteStatisticsResponseSDKType, QueryGetProtoRevTokenPairArbRoutesRequest, QueryGetProtoRevTokenPairArbRoutesResponseSDKType, QueryGetProtoRevAdminAccountRequest, QueryGetProtoRevAdminAccountResponseSDKType, QueryGetProtoRevDeveloperAccountRequest, QueryGetProtoRevDeveloperAccountResponseSDKType, QueryGetProtoRevInfoByPoolTypeRequest, QueryGetProtoRevInfoByPoolTypeResponseSDKType, QueryGetProtoRevMaxPoolPointsPerTxRequest, QueryGetProtoRevMaxPoolPointsPerTxResponseSDKType, QueryGetProtoRevMaxPoolPointsPerBlockRequest, QueryGetProtoRevMaxPoolPointsPerBlockResponseSDKType, QueryGetProtoRevBaseDenomsRequest, QueryGetProtoRevBaseDenomsResponseSDKType, QueryGetProtoRevEnabledRequest, QueryGetProtoRevEnabledResponseSDKType, QueryGetProtoRevPoolRequest, QueryGetProtoRevPoolResponseSDKType, QueryGetAllProtocolRevenueRequest, QueryGetAllProtocolRevenueResponseSDKType } from "./query"; export class LCDQueryClient { req: LCDClient; constructor({ @@ -17,22 +17,23 @@ export class LCDQueryClient { this.getProtoRevTokenPairArbRoutes = this.getProtoRevTokenPairArbRoutes.bind(this); this.getProtoRevAdminAccount = this.getProtoRevAdminAccount.bind(this); this.getProtoRevDeveloperAccount = this.getProtoRevDeveloperAccount.bind(this); - this.getProtoRevPoolWeights = this.getProtoRevPoolWeights.bind(this); + this.getProtoRevInfoByPoolType = this.getProtoRevInfoByPoolType.bind(this); this.getProtoRevMaxPoolPointsPerTx = this.getProtoRevMaxPoolPointsPerTx.bind(this); this.getProtoRevMaxPoolPointsPerBlock = this.getProtoRevMaxPoolPointsPerBlock.bind(this); this.getProtoRevBaseDenoms = this.getProtoRevBaseDenoms.bind(this); this.getProtoRevEnabled = this.getProtoRevEnabled.bind(this); this.getProtoRevPool = this.getProtoRevPool.bind(this); + this.getAllProtocolRevenue = this.getAllProtocolRevenue.bind(this); } /* Params queries the parameters of the module. */ async params(_params: QueryParamsRequest = {}): Promise { - const endpoint = `osmosis/v14/protorev/params`; + const endpoint = `osmosis/protorev/params`; return await this.req.get(endpoint); } /* GetProtoRevNumberOfTrades queries the number of arbitrage trades the module has executed */ async getProtoRevNumberOfTrades(_params: QueryGetProtoRevNumberOfTradesRequest = {}): Promise { - const endpoint = `osmosis/v14/protorev/number_of_trades`; + const endpoint = `osmosis/protorev/number_of_trades`; return await this.req.get(endpoint); } /* GetProtoRevProfitsByDenom queries the profits of the module by denom */ @@ -43,12 +44,12 @@ export class LCDQueryClient { if (typeof params?.denom !== "undefined") { options.params.denom = params.denom; } - const endpoint = `osmosis/v14/protorev/profits_by_denom`; + const endpoint = `osmosis/protorev/profits_by_denom`; return await this.req.get(endpoint, options); } /* GetProtoRevAllProfits queries all of the profits from the module */ async getProtoRevAllProfits(_params: QueryGetProtoRevAllProfitsRequest = {}): Promise { - const endpoint = `osmosis/v14/protorev/all_profits`; + const endpoint = `osmosis/protorev/all_profits`; return await this.req.get(endpoint); } /* GetProtoRevStatisticsByRoute queries the number of arbitrages and profits @@ -60,59 +61,59 @@ export class LCDQueryClient { if (typeof params?.route !== "undefined") { options.params.route = params.route; } - const endpoint = `osmosis/v14/protorev/statistics_by_route`; + const endpoint = `osmosis/protorev/statistics_by_route`; return await this.req.get(endpoint, options); } /* GetProtoRevAllRouteStatistics queries all of routes that the module has arbitraged against and the number of trades and profits that have been accumulated for each route */ async getProtoRevAllRouteStatistics(_params: QueryGetProtoRevAllRouteStatisticsRequest = {}): Promise { - const endpoint = `osmosis/v14/protorev/all_route_statistics`; + const endpoint = `osmosis/protorev/all_route_statistics`; return await this.req.get(endpoint); } /* GetProtoRevTokenPairArbRoutes queries all of the hot routes that the module is currently arbitraging */ async getProtoRevTokenPairArbRoutes(_params: QueryGetProtoRevTokenPairArbRoutesRequest = {}): Promise { - const endpoint = `osmosis/v14/protorev/token_pair_arb_routes`; + const endpoint = `osmosis/protorev/token_pair_arb_routes`; return await this.req.get(endpoint); } /* GetProtoRevAdminAccount queries the admin account of the module */ async getProtoRevAdminAccount(_params: QueryGetProtoRevAdminAccountRequest = {}): Promise { - const endpoint = `osmosis/v14/protorev/admin_account`; + const endpoint = `osmosis/protorev/admin_account`; return await this.req.get(endpoint); } /* GetProtoRevDeveloperAccount queries the developer account of the module */ async getProtoRevDeveloperAccount(_params: QueryGetProtoRevDeveloperAccountRequest = {}): Promise { - const endpoint = `osmosis/v14/protorev/developer_account`; + const endpoint = `osmosis/protorev/developer_account`; return await this.req.get(endpoint); } - /* GetProtoRevPoolWeights queries the weights of each pool type currently - being used by the module */ - async getProtoRevPoolWeights(_params: QueryGetProtoRevPoolWeightsRequest = {}): Promise { - const endpoint = `osmosis/v14/protorev/pool_weights`; - return await this.req.get(endpoint); + /* GetProtoRevInfoByPoolType queries pool type information that is currently + being utilized by the module */ + async getProtoRevInfoByPoolType(_params: QueryGetProtoRevInfoByPoolTypeRequest = {}): Promise { + const endpoint = `osmosis/protorev/info_by_pool_type`; + return await this.req.get(endpoint); } /* GetProtoRevMaxPoolPointsPerTx queries the maximum number of pool points that can be consumed per transaction */ async getProtoRevMaxPoolPointsPerTx(_params: QueryGetProtoRevMaxPoolPointsPerTxRequest = {}): Promise { - const endpoint = `osmosis/v14/protorev/max_pool_points_per_tx`; + const endpoint = `osmosis/protorev/max_pool_points_per_tx`; return await this.req.get(endpoint); } /* GetProtoRevMaxPoolPointsPerBlock queries the maximum number of pool points that can consumed per block */ async getProtoRevMaxPoolPointsPerBlock(_params: QueryGetProtoRevMaxPoolPointsPerBlockRequest = {}): Promise { - const endpoint = `osmosis/v14/protorev/max_pool_points_per_block`; + const endpoint = `osmosis/protorev/max_pool_points_per_block`; return await this.req.get(endpoint); } /* GetProtoRevBaseDenoms queries the base denoms that the module is currently utilizing for arbitrage */ async getProtoRevBaseDenoms(_params: QueryGetProtoRevBaseDenomsRequest = {}): Promise { - const endpoint = `osmosis/v14/protorev/base_denoms`; + const endpoint = `osmosis/protorev/base_denoms`; return await this.req.get(endpoint); } /* GetProtoRevEnabled queries whether the module is enabled or not */ async getProtoRevEnabled(_params: QueryGetProtoRevEnabledRequest = {}): Promise { - const endpoint = `osmosis/v14/protorev/enabled`; + const endpoint = `osmosis/protorev/enabled`; return await this.req.get(endpoint); } /* GetProtoRevPool queries the pool id used via the highest liquidity method @@ -127,7 +128,13 @@ export class LCDQueryClient { if (typeof params?.otherDenom !== "undefined") { options.params.other_denom = params.otherDenom; } - const endpoint = `osmosis/v14/protorev/pool`; + const endpoint = `osmosis/protorev/pool`; return await this.req.get(endpoint, options); } + /* GetAllProtocolRevenue queries all of the protocol revenue that has been + accumulated by any module */ + async getAllProtocolRevenue(_params: QueryGetAllProtocolRevenueRequest = {}): Promise { + const endpoint = `osmosis/protorev/all_protocol_revenue`; + return await this.req.get(endpoint); + } } \ No newline at end of file diff --git a/packages/osmojs/src/codegen/osmosis/protorev/v1beta1/query.rpc.Query.ts b/packages/osmojs/src/codegen/osmosis/protorev/v1beta1/query.rpc.Query.ts index af6c21fc5..3a6d2091f 100644 --- a/packages/osmojs/src/codegen/osmosis/protorev/v1beta1/query.rpc.Query.ts +++ b/packages/osmojs/src/codegen/osmosis/protorev/v1beta1/query.rpc.Query.ts @@ -1,7 +1,7 @@ import { Rpc } from "../../../helpers"; import { BinaryReader } from "../../../binary"; import { QueryClient, createProtobufRpcClient } from "@cosmjs/stargate"; -import { QueryParamsRequest, QueryParamsResponse, QueryGetProtoRevNumberOfTradesRequest, QueryGetProtoRevNumberOfTradesResponse, QueryGetProtoRevProfitsByDenomRequest, QueryGetProtoRevProfitsByDenomResponse, QueryGetProtoRevAllProfitsRequest, QueryGetProtoRevAllProfitsResponse, QueryGetProtoRevStatisticsByRouteRequest, QueryGetProtoRevStatisticsByRouteResponse, QueryGetProtoRevAllRouteStatisticsRequest, QueryGetProtoRevAllRouteStatisticsResponse, QueryGetProtoRevTokenPairArbRoutesRequest, QueryGetProtoRevTokenPairArbRoutesResponse, QueryGetProtoRevAdminAccountRequest, QueryGetProtoRevAdminAccountResponse, QueryGetProtoRevDeveloperAccountRequest, QueryGetProtoRevDeveloperAccountResponse, QueryGetProtoRevPoolWeightsRequest, QueryGetProtoRevPoolWeightsResponse, QueryGetProtoRevMaxPoolPointsPerTxRequest, QueryGetProtoRevMaxPoolPointsPerTxResponse, QueryGetProtoRevMaxPoolPointsPerBlockRequest, QueryGetProtoRevMaxPoolPointsPerBlockResponse, QueryGetProtoRevBaseDenomsRequest, QueryGetProtoRevBaseDenomsResponse, QueryGetProtoRevEnabledRequest, QueryGetProtoRevEnabledResponse, QueryGetProtoRevPoolRequest, QueryGetProtoRevPoolResponse } from "./query"; +import { QueryParamsRequest, QueryParamsResponse, QueryGetProtoRevNumberOfTradesRequest, QueryGetProtoRevNumberOfTradesResponse, QueryGetProtoRevProfitsByDenomRequest, QueryGetProtoRevProfitsByDenomResponse, QueryGetProtoRevAllProfitsRequest, QueryGetProtoRevAllProfitsResponse, QueryGetProtoRevStatisticsByRouteRequest, QueryGetProtoRevStatisticsByRouteResponse, QueryGetProtoRevAllRouteStatisticsRequest, QueryGetProtoRevAllRouteStatisticsResponse, QueryGetProtoRevTokenPairArbRoutesRequest, QueryGetProtoRevTokenPairArbRoutesResponse, QueryGetProtoRevAdminAccountRequest, QueryGetProtoRevAdminAccountResponse, QueryGetProtoRevDeveloperAccountRequest, QueryGetProtoRevDeveloperAccountResponse, QueryGetProtoRevInfoByPoolTypeRequest, QueryGetProtoRevInfoByPoolTypeResponse, QueryGetProtoRevMaxPoolPointsPerTxRequest, QueryGetProtoRevMaxPoolPointsPerTxResponse, QueryGetProtoRevMaxPoolPointsPerBlockRequest, QueryGetProtoRevMaxPoolPointsPerBlockResponse, QueryGetProtoRevBaseDenomsRequest, QueryGetProtoRevBaseDenomsResponse, QueryGetProtoRevEnabledRequest, QueryGetProtoRevEnabledResponse, QueryGetProtoRevPoolRequest, QueryGetProtoRevPoolResponse, QueryGetAllProtocolRevenueRequest, QueryGetAllProtocolRevenueResponse } from "./query"; /** Query defines the gRPC querier service. */ export interface Query { /** Params queries the parameters of the module. */ @@ -36,10 +36,10 @@ export interface Query { /** GetProtoRevDeveloperAccount queries the developer account of the module */ getProtoRevDeveloperAccount(request?: QueryGetProtoRevDeveloperAccountRequest): Promise; /** - * GetProtoRevPoolWeights queries the weights of each pool type currently - * being used by the module + * GetProtoRevInfoByPoolType queries pool type information that is currently + * being utilized by the module */ - getProtoRevPoolWeights(request?: QueryGetProtoRevPoolWeightsRequest): Promise; + getProtoRevInfoByPoolType(request?: QueryGetProtoRevInfoByPoolTypeRequest): Promise; /** * GetProtoRevMaxPoolPointsPerTx queries the maximum number of pool points * that can be consumed per transaction @@ -62,6 +62,11 @@ export interface Query { * for arbitrage route building given a pair of denominations */ getProtoRevPool(request: QueryGetProtoRevPoolRequest): Promise; + /** + * GetAllProtocolRevenue queries all of the protocol revenue that has been + * accumulated by any module + */ + getAllProtocolRevenue(request?: QueryGetAllProtocolRevenueRequest): Promise; } export class QueryClientImpl implements Query { private readonly rpc: Rpc; @@ -76,12 +81,13 @@ export class QueryClientImpl implements Query { this.getProtoRevTokenPairArbRoutes = this.getProtoRevTokenPairArbRoutes.bind(this); this.getProtoRevAdminAccount = this.getProtoRevAdminAccount.bind(this); this.getProtoRevDeveloperAccount = this.getProtoRevDeveloperAccount.bind(this); - this.getProtoRevPoolWeights = this.getProtoRevPoolWeights.bind(this); + this.getProtoRevInfoByPoolType = this.getProtoRevInfoByPoolType.bind(this); this.getProtoRevMaxPoolPointsPerTx = this.getProtoRevMaxPoolPointsPerTx.bind(this); this.getProtoRevMaxPoolPointsPerBlock = this.getProtoRevMaxPoolPointsPerBlock.bind(this); this.getProtoRevBaseDenoms = this.getProtoRevBaseDenoms.bind(this); this.getProtoRevEnabled = this.getProtoRevEnabled.bind(this); this.getProtoRevPool = this.getProtoRevPool.bind(this); + this.getAllProtocolRevenue = this.getAllProtocolRevenue.bind(this); } params(request: QueryParamsRequest = {}): Promise { const data = QueryParamsRequest.encode(request).finish(); @@ -128,10 +134,10 @@ export class QueryClientImpl implements Query { const promise = this.rpc.request("osmosis.protorev.v1beta1.Query", "GetProtoRevDeveloperAccount", data); return promise.then(data => QueryGetProtoRevDeveloperAccountResponse.decode(new BinaryReader(data))); } - getProtoRevPoolWeights(request: QueryGetProtoRevPoolWeightsRequest = {}): Promise { - const data = QueryGetProtoRevPoolWeightsRequest.encode(request).finish(); - const promise = this.rpc.request("osmosis.protorev.v1beta1.Query", "GetProtoRevPoolWeights", data); - return promise.then(data => QueryGetProtoRevPoolWeightsResponse.decode(new BinaryReader(data))); + getProtoRevInfoByPoolType(request: QueryGetProtoRevInfoByPoolTypeRequest = {}): Promise { + const data = QueryGetProtoRevInfoByPoolTypeRequest.encode(request).finish(); + const promise = this.rpc.request("osmosis.protorev.v1beta1.Query", "GetProtoRevInfoByPoolType", data); + return promise.then(data => QueryGetProtoRevInfoByPoolTypeResponse.decode(new BinaryReader(data))); } getProtoRevMaxPoolPointsPerTx(request: QueryGetProtoRevMaxPoolPointsPerTxRequest = {}): Promise { const data = QueryGetProtoRevMaxPoolPointsPerTxRequest.encode(request).finish(); @@ -158,6 +164,11 @@ export class QueryClientImpl implements Query { const promise = this.rpc.request("osmosis.protorev.v1beta1.Query", "GetProtoRevPool", data); return promise.then(data => QueryGetProtoRevPoolResponse.decode(new BinaryReader(data))); } + getAllProtocolRevenue(request: QueryGetAllProtocolRevenueRequest = {}): Promise { + const data = QueryGetAllProtocolRevenueRequest.encode(request).finish(); + const promise = this.rpc.request("osmosis.protorev.v1beta1.Query", "GetAllProtocolRevenue", data); + return promise.then(data => QueryGetAllProtocolRevenueResponse.decode(new BinaryReader(data))); + } } export const createRpcQueryExtension = (base: QueryClient) => { const rpc = createProtobufRpcClient(base); @@ -190,8 +201,8 @@ export const createRpcQueryExtension = (base: QueryClient) => { getProtoRevDeveloperAccount(request?: QueryGetProtoRevDeveloperAccountRequest): Promise { return queryService.getProtoRevDeveloperAccount(request); }, - getProtoRevPoolWeights(request?: QueryGetProtoRevPoolWeightsRequest): Promise { - return queryService.getProtoRevPoolWeights(request); + getProtoRevInfoByPoolType(request?: QueryGetProtoRevInfoByPoolTypeRequest): Promise { + return queryService.getProtoRevInfoByPoolType(request); }, getProtoRevMaxPoolPointsPerTx(request?: QueryGetProtoRevMaxPoolPointsPerTxRequest): Promise { return queryService.getProtoRevMaxPoolPointsPerTx(request); @@ -207,6 +218,9 @@ export const createRpcQueryExtension = (base: QueryClient) => { }, getProtoRevPool(request: QueryGetProtoRevPoolRequest): Promise { return queryService.getProtoRevPool(request); + }, + getAllProtocolRevenue(request?: QueryGetAllProtocolRevenueRequest): Promise { + return queryService.getAllProtocolRevenue(request); } }; }; \ No newline at end of file diff --git a/packages/osmojs/src/codegen/osmosis/protorev/v1beta1/query.ts b/packages/osmojs/src/codegen/osmosis/protorev/v1beta1/query.ts index 9c15dd252..e458e8b2f 100644 --- a/packages/osmojs/src/codegen/osmosis/protorev/v1beta1/query.ts +++ b/packages/osmojs/src/codegen/osmosis/protorev/v1beta1/query.ts @@ -1,7 +1,9 @@ import { Params, ParamsAmino, ParamsSDKType } from "./params"; import { Coin, CoinAmino, CoinSDKType } from "../../../cosmos/base/v1beta1/coin"; -import { RouteStatistics, RouteStatisticsAmino, RouteStatisticsSDKType, TokenPairArbRoutes, TokenPairArbRoutesAmino, TokenPairArbRoutesSDKType, PoolWeights, PoolWeightsAmino, PoolWeightsSDKType, BaseDenom, BaseDenomAmino, BaseDenomSDKType } from "./protorev"; +import { RouteStatistics, RouteStatisticsAmino, RouteStatisticsSDKType, TokenPairArbRoutes, TokenPairArbRoutesAmino, TokenPairArbRoutesSDKType, InfoByPoolType, InfoByPoolTypeAmino, InfoByPoolTypeSDKType, BaseDenom, BaseDenomAmino, BaseDenomSDKType, AllProtocolRevenue, AllProtocolRevenueAmino, AllProtocolRevenueSDKType } from "./protorev"; import { BinaryReader, BinaryWriter } from "../../../binary"; +import { GlobalDecoderRegistry } from "../../../registry"; +import { isSet } from "../../../helpers"; /** QueryParamsRequest is request type for the Query/Params RPC method. */ export interface QueryParamsRequest {} export interface QueryParamsRequestProtoMsg { @@ -79,7 +81,7 @@ export interface QueryGetProtoRevNumberOfTradesResponseProtoMsg { */ export interface QueryGetProtoRevNumberOfTradesResponseAmino { /** number_of_trades is the number of trades the module has executed */ - number_of_trades: string; + number_of_trades?: string; } export interface QueryGetProtoRevNumberOfTradesResponseAminoMsg { type: "osmosis/protorev/query-get-proto-rev-number-of-trades-response"; @@ -110,7 +112,7 @@ export interface QueryGetProtoRevProfitsByDenomRequestProtoMsg { */ export interface QueryGetProtoRevProfitsByDenomRequestAmino { /** denom is the denom to query profits by */ - denom: string; + denom?: string; } export interface QueryGetProtoRevProfitsByDenomRequestAminoMsg { type: "osmosis/protorev/query-get-proto-rev-profits-by-denom-request"; @@ -129,7 +131,7 @@ export interface QueryGetProtoRevProfitsByDenomRequestSDKType { */ export interface QueryGetProtoRevProfitsByDenomResponse { /** profit is the profits of the module by the selected denom */ - profit: Coin; + profit?: Coin; } export interface QueryGetProtoRevProfitsByDenomResponseProtoMsg { typeUrl: "/osmosis.protorev.v1beta1.QueryGetProtoRevProfitsByDenomResponse"; @@ -152,7 +154,7 @@ export interface QueryGetProtoRevProfitsByDenomResponseAminoMsg { * Query/GetProtoRevProfitsByDenom RPC method. */ export interface QueryGetProtoRevProfitsByDenomResponseSDKType { - profit: CoinSDKType; + profit?: CoinSDKType; } /** * QueryGetProtoRevAllProfitsRequest is request type for the @@ -195,7 +197,7 @@ export interface QueryGetProtoRevAllProfitsResponseProtoMsg { */ export interface QueryGetProtoRevAllProfitsResponseAmino { /** profits is a list of all of the profits from the module */ - profits: CoinAmino[]; + profits?: CoinAmino[]; } export interface QueryGetProtoRevAllProfitsResponseAminoMsg { type: "osmosis/protorev/query-get-proto-rev-all-profits-response"; @@ -226,7 +228,7 @@ export interface QueryGetProtoRevStatisticsByRouteRequestProtoMsg { */ export interface QueryGetProtoRevStatisticsByRouteRequestAmino { /** route is the set of pool ids to query statistics by i.e. 1,2,3 */ - route: string[]; + route?: string[]; } export interface QueryGetProtoRevStatisticsByRouteRequestAminoMsg { type: "osmosis/protorev/query-get-proto-rev-statistics-by-route-request"; @@ -323,7 +325,7 @@ export interface QueryGetProtoRevAllRouteStatisticsResponseAmino { * statistics contains the number of trades/profits the module has executed on * all routes it has successfully executed a trade on */ - statistics: RouteStatisticsAmino[]; + statistics?: RouteStatisticsAmino[]; } export interface QueryGetProtoRevAllRouteStatisticsResponseAminoMsg { type: "osmosis/protorev/query-get-proto-rev-all-route-statistics-response"; @@ -383,7 +385,7 @@ export interface QueryGetProtoRevTokenPairArbRoutesResponseAmino { * routes is a list of all of the hot routes that the module is currently * arbitraging */ - routes: TokenPairArbRoutesAmino[]; + routes?: TokenPairArbRoutesAmino[]; } export interface QueryGetProtoRevTokenPairArbRoutesResponseAminoMsg { type: "osmosis/protorev/query-get-proto-rev-token-pair-arb-routes-response"; @@ -437,7 +439,7 @@ export interface QueryGetProtoRevAdminAccountResponseProtoMsg { */ export interface QueryGetProtoRevAdminAccountResponseAmino { /** admin_account is the admin account of the module */ - admin_account: string; + admin_account?: string; } export interface QueryGetProtoRevAdminAccountResponseAminoMsg { type: "osmosis/protorev/query-get-proto-rev-admin-account-response"; @@ -491,7 +493,7 @@ export interface QueryGetProtoRevDeveloperAccountResponseProtoMsg { */ export interface QueryGetProtoRevDeveloperAccountResponseAmino { /** developer_account is the developer account of the module */ - developer_account: string; + developer_account?: string; } export interface QueryGetProtoRevDeveloperAccountResponseAminoMsg { type: "osmosis/protorev/query-get-proto-rev-developer-account-response"; @@ -505,58 +507,64 @@ export interface QueryGetProtoRevDeveloperAccountResponseSDKType { developer_account: string; } /** - * QueryGetProtoRevPoolWeightsRequest is request type for the - * Query/GetProtoRevPoolWeights RPC method. + * QueryGetProtoRevInfoByPoolTypeRequest is request type for the + * Query/GetProtoRevInfoByPoolType RPC method. */ -export interface QueryGetProtoRevPoolWeightsRequest {} -export interface QueryGetProtoRevPoolWeightsRequestProtoMsg { - typeUrl: "/osmosis.protorev.v1beta1.QueryGetProtoRevPoolWeightsRequest"; +export interface QueryGetProtoRevInfoByPoolTypeRequest {} +export interface QueryGetProtoRevInfoByPoolTypeRequestProtoMsg { + typeUrl: "/osmosis.protorev.v1beta1.QueryGetProtoRevInfoByPoolTypeRequest"; value: Uint8Array; } /** - * QueryGetProtoRevPoolWeightsRequest is request type for the - * Query/GetProtoRevPoolWeights RPC method. + * QueryGetProtoRevInfoByPoolTypeRequest is request type for the + * Query/GetProtoRevInfoByPoolType RPC method. */ -export interface QueryGetProtoRevPoolWeightsRequestAmino {} -export interface QueryGetProtoRevPoolWeightsRequestAminoMsg { - type: "osmosis/protorev/query-get-proto-rev-pool-weights-request"; - value: QueryGetProtoRevPoolWeightsRequestAmino; +export interface QueryGetProtoRevInfoByPoolTypeRequestAmino {} +export interface QueryGetProtoRevInfoByPoolTypeRequestAminoMsg { + type: "osmosis/protorev/query-get-proto-rev-info-by-pool-type-request"; + value: QueryGetProtoRevInfoByPoolTypeRequestAmino; } /** - * QueryGetProtoRevPoolWeightsRequest is request type for the - * Query/GetProtoRevPoolWeights RPC method. + * QueryGetProtoRevInfoByPoolTypeRequest is request type for the + * Query/GetProtoRevInfoByPoolType RPC method. */ -export interface QueryGetProtoRevPoolWeightsRequestSDKType {} +export interface QueryGetProtoRevInfoByPoolTypeRequestSDKType {} /** - * QueryGetProtoRevPoolWeightsResponse is response type for the - * Query/GetProtoRevPoolWeights RPC method. + * QueryGetProtoRevInfoByPoolTypeResponse is response type for the + * Query/GetProtoRevInfoByPoolType RPC method. */ -export interface QueryGetProtoRevPoolWeightsResponse { - /** pool_weights is a list of all of the pool weights */ - poolWeights: PoolWeights; +export interface QueryGetProtoRevInfoByPoolTypeResponse { + /** + * InfoByPoolType contains all information pertaining to how different + * pool types are handled by the module. + */ + infoByPoolType: InfoByPoolType; } -export interface QueryGetProtoRevPoolWeightsResponseProtoMsg { - typeUrl: "/osmosis.protorev.v1beta1.QueryGetProtoRevPoolWeightsResponse"; +export interface QueryGetProtoRevInfoByPoolTypeResponseProtoMsg { + typeUrl: "/osmosis.protorev.v1beta1.QueryGetProtoRevInfoByPoolTypeResponse"; value: Uint8Array; } /** - * QueryGetProtoRevPoolWeightsResponse is response type for the - * Query/GetProtoRevPoolWeights RPC method. + * QueryGetProtoRevInfoByPoolTypeResponse is response type for the + * Query/GetProtoRevInfoByPoolType RPC method. */ -export interface QueryGetProtoRevPoolWeightsResponseAmino { - /** pool_weights is a list of all of the pool weights */ - pool_weights?: PoolWeightsAmino; +export interface QueryGetProtoRevInfoByPoolTypeResponseAmino { + /** + * InfoByPoolType contains all information pertaining to how different + * pool types are handled by the module. + */ + info_by_pool_type?: InfoByPoolTypeAmino; } -export interface QueryGetProtoRevPoolWeightsResponseAminoMsg { - type: "osmosis/protorev/query-get-proto-rev-pool-weights-response"; - value: QueryGetProtoRevPoolWeightsResponseAmino; +export interface QueryGetProtoRevInfoByPoolTypeResponseAminoMsg { + type: "osmosis/protorev/query-get-proto-rev-info-by-pool-type-response"; + value: QueryGetProtoRevInfoByPoolTypeResponseAmino; } /** - * QueryGetProtoRevPoolWeightsResponse is response type for the - * Query/GetProtoRevPoolWeights RPC method. + * QueryGetProtoRevInfoByPoolTypeResponse is response type for the + * Query/GetProtoRevInfoByPoolType RPC method. */ -export interface QueryGetProtoRevPoolWeightsResponseSDKType { - pool_weights: PoolWeightsSDKType; +export interface QueryGetProtoRevInfoByPoolTypeResponseSDKType { + info_by_pool_type: InfoByPoolTypeSDKType; } /** * QueryGetProtoRevMaxPoolPointsPerBlockRequest is request type for the @@ -605,7 +613,7 @@ export interface QueryGetProtoRevMaxPoolPointsPerBlockResponseAmino { * max_pool_points_per_block is the maximum number of pool points that can be * consumed per block */ - max_pool_points_per_block: string; + max_pool_points_per_block?: string; } export interface QueryGetProtoRevMaxPoolPointsPerBlockResponseAminoMsg { type: "osmosis/protorev/query-get-proto-rev-max-pool-points-per-block-response"; @@ -665,7 +673,7 @@ export interface QueryGetProtoRevMaxPoolPointsPerTxResponseAmino { * max_pool_points_per_tx is the maximum number of pool points that can be * consumed per transaction */ - max_pool_points_per_tx: string; + max_pool_points_per_tx?: string; } export interface QueryGetProtoRevMaxPoolPointsPerTxResponseAminoMsg { type: "osmosis/protorev/query-get-proto-rev-max-pool-points-per-tx-response"; @@ -719,7 +727,7 @@ export interface QueryGetProtoRevBaseDenomsResponseProtoMsg { */ export interface QueryGetProtoRevBaseDenomsResponseAmino { /** base_denoms is a list of all of the base denoms and step sizes */ - base_denoms: BaseDenomAmino[]; + base_denoms?: BaseDenomAmino[]; } export interface QueryGetProtoRevBaseDenomsResponseAminoMsg { type: "osmosis/protorev/query-get-proto-rev-base-denoms-response"; @@ -773,7 +781,7 @@ export interface QueryGetProtoRevEnabledResponseProtoMsg { */ export interface QueryGetProtoRevEnabledResponseAmino { /** enabled is whether the module is enabled */ - enabled: boolean; + enabled?: boolean; } export interface QueryGetProtoRevEnabledResponseAminoMsg { type: "osmosis/protorev/query-get-proto-rev-enabled-response"; @@ -812,9 +820,9 @@ export interface QueryGetProtoRevPoolRequestAmino { * base_denom is the base denom set in protorev for the denom pair to pool * mapping */ - base_denom: string; + base_denom?: string; /** other_denom is the other denom for the denom pair to pool mapping */ - other_denom: string; + other_denom?: string; } export interface QueryGetProtoRevPoolRequestAminoMsg { type: "osmosis/protorev/query-get-proto-rev-pool-request"; @@ -846,7 +854,7 @@ export interface QueryGetProtoRevPoolResponseProtoMsg { */ export interface QueryGetProtoRevPoolResponseAmino { /** pool_id is the pool_id stored for the denom pair */ - pool_id: string; + pool_id?: string; } export interface QueryGetProtoRevPoolResponseAminoMsg { type: "osmosis/protorev/query-get-proto-rev-pool-response"; @@ -859,11 +867,49 @@ export interface QueryGetProtoRevPoolResponseAminoMsg { export interface QueryGetProtoRevPoolResponseSDKType { pool_id: bigint; } +export interface QueryGetAllProtocolRevenueRequest {} +export interface QueryGetAllProtocolRevenueRequestProtoMsg { + typeUrl: "/osmosis.protorev.v1beta1.QueryGetAllProtocolRevenueRequest"; + value: Uint8Array; +} +export interface QueryGetAllProtocolRevenueRequestAmino {} +export interface QueryGetAllProtocolRevenueRequestAminoMsg { + type: "osmosis/protorev/query-get-all-protocol-revenue-request"; + value: QueryGetAllProtocolRevenueRequestAmino; +} +export interface QueryGetAllProtocolRevenueRequestSDKType {} +export interface QueryGetAllProtocolRevenueResponse { + allProtocolRevenue: AllProtocolRevenue; +} +export interface QueryGetAllProtocolRevenueResponseProtoMsg { + typeUrl: "/osmosis.protorev.v1beta1.QueryGetAllProtocolRevenueResponse"; + value: Uint8Array; +} +export interface QueryGetAllProtocolRevenueResponseAmino { + all_protocol_revenue?: AllProtocolRevenueAmino; +} +export interface QueryGetAllProtocolRevenueResponseAminoMsg { + type: "osmosis/protorev/query-get-all-protocol-revenue-response"; + value: QueryGetAllProtocolRevenueResponseAmino; +} +export interface QueryGetAllProtocolRevenueResponseSDKType { + all_protocol_revenue: AllProtocolRevenueSDKType; +} function createBaseQueryParamsRequest(): QueryParamsRequest { return {}; } export const QueryParamsRequest = { typeUrl: "/osmosis.protorev.v1beta1.QueryParamsRequest", + aminoType: "osmosis/protorev/query-params-request", + is(o: any): o is QueryParamsRequest { + return o && o.$typeUrl === QueryParamsRequest.typeUrl; + }, + isSDK(o: any): o is QueryParamsRequestSDKType { + return o && o.$typeUrl === QueryParamsRequest.typeUrl; + }, + isAmino(o: any): o is QueryParamsRequestAmino { + return o && o.$typeUrl === QueryParamsRequest.typeUrl; + }, encode(_: QueryParamsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, @@ -881,12 +927,20 @@ export const QueryParamsRequest = { } return message; }, + fromJSON(_: any): QueryParamsRequest { + return {}; + }, + toJSON(_: QueryParamsRequest): unknown { + const obj: any = {}; + return obj; + }, fromPartial(_: Partial): QueryParamsRequest { const message = createBaseQueryParamsRequest(); return message; }, fromAmino(_: QueryParamsRequestAmino): QueryParamsRequest { - return {}; + const message = createBaseQueryParamsRequest(); + return message; }, toAmino(_: QueryParamsRequest): QueryParamsRequestAmino { const obj: any = {}; @@ -914,6 +968,8 @@ export const QueryParamsRequest = { }; } }; +GlobalDecoderRegistry.register(QueryParamsRequest.typeUrl, QueryParamsRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryParamsRequest.aminoType, QueryParamsRequest.typeUrl); function createBaseQueryParamsResponse(): QueryParamsResponse { return { params: Params.fromPartial({}) @@ -921,6 +977,16 @@ function createBaseQueryParamsResponse(): QueryParamsResponse { } export const QueryParamsResponse = { typeUrl: "/osmosis.protorev.v1beta1.QueryParamsResponse", + aminoType: "osmosis/protorev/query-params-response", + is(o: any): o is QueryParamsResponse { + return o && (o.$typeUrl === QueryParamsResponse.typeUrl || Params.is(o.params)); + }, + isSDK(o: any): o is QueryParamsResponseSDKType { + return o && (o.$typeUrl === QueryParamsResponse.typeUrl || Params.isSDK(o.params)); + }, + isAmino(o: any): o is QueryParamsResponseAmino { + return o && (o.$typeUrl === QueryParamsResponse.typeUrl || Params.isAmino(o.params)); + }, encode(message: QueryParamsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.params !== undefined) { Params.encode(message.params, writer.uint32(10).fork()).ldelim(); @@ -944,15 +1010,27 @@ export const QueryParamsResponse = { } return message; }, + fromJSON(object: any): QueryParamsResponse { + 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; + }, fromPartial(object: Partial): QueryParamsResponse { const message = createBaseQueryParamsResponse(); message.params = object.params !== undefined && object.params !== null ? Params.fromPartial(object.params) : undefined; return message; }, fromAmino(object: QueryParamsResponseAmino): QueryParamsResponse { - return { - params: object?.params ? Params.fromAmino(object.params) : undefined - }; + const message = createBaseQueryParamsResponse(); + if (object.params !== undefined && object.params !== null) { + message.params = Params.fromAmino(object.params); + } + return message; }, toAmino(message: QueryParamsResponse): QueryParamsResponseAmino { const obj: any = {}; @@ -981,11 +1059,23 @@ export const QueryParamsResponse = { }; } }; +GlobalDecoderRegistry.register(QueryParamsResponse.typeUrl, QueryParamsResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryParamsResponse.aminoType, QueryParamsResponse.typeUrl); function createBaseQueryGetProtoRevNumberOfTradesRequest(): QueryGetProtoRevNumberOfTradesRequest { return {}; } export const QueryGetProtoRevNumberOfTradesRequest = { typeUrl: "/osmosis.protorev.v1beta1.QueryGetProtoRevNumberOfTradesRequest", + aminoType: "osmosis/protorev/query-get-proto-rev-number-of-trades-request", + is(o: any): o is QueryGetProtoRevNumberOfTradesRequest { + return o && o.$typeUrl === QueryGetProtoRevNumberOfTradesRequest.typeUrl; + }, + isSDK(o: any): o is QueryGetProtoRevNumberOfTradesRequestSDKType { + return o && o.$typeUrl === QueryGetProtoRevNumberOfTradesRequest.typeUrl; + }, + isAmino(o: any): o is QueryGetProtoRevNumberOfTradesRequestAmino { + return o && o.$typeUrl === QueryGetProtoRevNumberOfTradesRequest.typeUrl; + }, encode(_: QueryGetProtoRevNumberOfTradesRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, @@ -1003,12 +1093,20 @@ export const QueryGetProtoRevNumberOfTradesRequest = { } return message; }, + fromJSON(_: any): QueryGetProtoRevNumberOfTradesRequest { + return {}; + }, + toJSON(_: QueryGetProtoRevNumberOfTradesRequest): unknown { + const obj: any = {}; + return obj; + }, fromPartial(_: Partial): QueryGetProtoRevNumberOfTradesRequest { const message = createBaseQueryGetProtoRevNumberOfTradesRequest(); return message; }, fromAmino(_: QueryGetProtoRevNumberOfTradesRequestAmino): QueryGetProtoRevNumberOfTradesRequest { - return {}; + const message = createBaseQueryGetProtoRevNumberOfTradesRequest(); + return message; }, toAmino(_: QueryGetProtoRevNumberOfTradesRequest): QueryGetProtoRevNumberOfTradesRequestAmino { const obj: any = {}; @@ -1036,6 +1134,8 @@ export const QueryGetProtoRevNumberOfTradesRequest = { }; } }; +GlobalDecoderRegistry.register(QueryGetProtoRevNumberOfTradesRequest.typeUrl, QueryGetProtoRevNumberOfTradesRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryGetProtoRevNumberOfTradesRequest.aminoType, QueryGetProtoRevNumberOfTradesRequest.typeUrl); function createBaseQueryGetProtoRevNumberOfTradesResponse(): QueryGetProtoRevNumberOfTradesResponse { return { numberOfTrades: "" @@ -1043,6 +1143,16 @@ function createBaseQueryGetProtoRevNumberOfTradesResponse(): QueryGetProtoRevNum } export const QueryGetProtoRevNumberOfTradesResponse = { typeUrl: "/osmosis.protorev.v1beta1.QueryGetProtoRevNumberOfTradesResponse", + aminoType: "osmosis/protorev/query-get-proto-rev-number-of-trades-response", + is(o: any): o is QueryGetProtoRevNumberOfTradesResponse { + return o && (o.$typeUrl === QueryGetProtoRevNumberOfTradesResponse.typeUrl || typeof o.numberOfTrades === "string"); + }, + isSDK(o: any): o is QueryGetProtoRevNumberOfTradesResponseSDKType { + return o && (o.$typeUrl === QueryGetProtoRevNumberOfTradesResponse.typeUrl || typeof o.number_of_trades === "string"); + }, + isAmino(o: any): o is QueryGetProtoRevNumberOfTradesResponseAmino { + return o && (o.$typeUrl === QueryGetProtoRevNumberOfTradesResponse.typeUrl || typeof o.number_of_trades === "string"); + }, encode(message: QueryGetProtoRevNumberOfTradesResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.numberOfTrades !== "") { writer.uint32(10).string(message.numberOfTrades); @@ -1066,15 +1176,27 @@ export const QueryGetProtoRevNumberOfTradesResponse = { } return message; }, + fromJSON(object: any): QueryGetProtoRevNumberOfTradesResponse { + return { + numberOfTrades: isSet(object.numberOfTrades) ? String(object.numberOfTrades) : "" + }; + }, + toJSON(message: QueryGetProtoRevNumberOfTradesResponse): unknown { + const obj: any = {}; + message.numberOfTrades !== undefined && (obj.numberOfTrades = message.numberOfTrades); + return obj; + }, fromPartial(object: Partial): QueryGetProtoRevNumberOfTradesResponse { const message = createBaseQueryGetProtoRevNumberOfTradesResponse(); message.numberOfTrades = object.numberOfTrades ?? ""; return message; }, fromAmino(object: QueryGetProtoRevNumberOfTradesResponseAmino): QueryGetProtoRevNumberOfTradesResponse { - return { - numberOfTrades: object.number_of_trades - }; + const message = createBaseQueryGetProtoRevNumberOfTradesResponse(); + if (object.number_of_trades !== undefined && object.number_of_trades !== null) { + message.numberOfTrades = object.number_of_trades; + } + return message; }, toAmino(message: QueryGetProtoRevNumberOfTradesResponse): QueryGetProtoRevNumberOfTradesResponseAmino { const obj: any = {}; @@ -1103,6 +1225,8 @@ export const QueryGetProtoRevNumberOfTradesResponse = { }; } }; +GlobalDecoderRegistry.register(QueryGetProtoRevNumberOfTradesResponse.typeUrl, QueryGetProtoRevNumberOfTradesResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryGetProtoRevNumberOfTradesResponse.aminoType, QueryGetProtoRevNumberOfTradesResponse.typeUrl); function createBaseQueryGetProtoRevProfitsByDenomRequest(): QueryGetProtoRevProfitsByDenomRequest { return { denom: "" @@ -1110,6 +1234,16 @@ function createBaseQueryGetProtoRevProfitsByDenomRequest(): QueryGetProtoRevProf } export const QueryGetProtoRevProfitsByDenomRequest = { typeUrl: "/osmosis.protorev.v1beta1.QueryGetProtoRevProfitsByDenomRequest", + aminoType: "osmosis/protorev/query-get-proto-rev-profits-by-denom-request", + is(o: any): o is QueryGetProtoRevProfitsByDenomRequest { + return o && (o.$typeUrl === QueryGetProtoRevProfitsByDenomRequest.typeUrl || typeof o.denom === "string"); + }, + isSDK(o: any): o is QueryGetProtoRevProfitsByDenomRequestSDKType { + return o && (o.$typeUrl === QueryGetProtoRevProfitsByDenomRequest.typeUrl || typeof o.denom === "string"); + }, + isAmino(o: any): o is QueryGetProtoRevProfitsByDenomRequestAmino { + return o && (o.$typeUrl === QueryGetProtoRevProfitsByDenomRequest.typeUrl || typeof o.denom === "string"); + }, encode(message: QueryGetProtoRevProfitsByDenomRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.denom !== "") { writer.uint32(10).string(message.denom); @@ -1133,15 +1267,27 @@ export const QueryGetProtoRevProfitsByDenomRequest = { } return message; }, + fromJSON(object: any): QueryGetProtoRevProfitsByDenomRequest { + return { + denom: isSet(object.denom) ? String(object.denom) : "" + }; + }, + toJSON(message: QueryGetProtoRevProfitsByDenomRequest): unknown { + const obj: any = {}; + message.denom !== undefined && (obj.denom = message.denom); + return obj; + }, fromPartial(object: Partial): QueryGetProtoRevProfitsByDenomRequest { const message = createBaseQueryGetProtoRevProfitsByDenomRequest(); message.denom = object.denom ?? ""; return message; }, fromAmino(object: QueryGetProtoRevProfitsByDenomRequestAmino): QueryGetProtoRevProfitsByDenomRequest { - return { - denom: object.denom - }; + const message = createBaseQueryGetProtoRevProfitsByDenomRequest(); + if (object.denom !== undefined && object.denom !== null) { + message.denom = object.denom; + } + return message; }, toAmino(message: QueryGetProtoRevProfitsByDenomRequest): QueryGetProtoRevProfitsByDenomRequestAmino { const obj: any = {}; @@ -1170,6 +1316,8 @@ export const QueryGetProtoRevProfitsByDenomRequest = { }; } }; +GlobalDecoderRegistry.register(QueryGetProtoRevProfitsByDenomRequest.typeUrl, QueryGetProtoRevProfitsByDenomRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryGetProtoRevProfitsByDenomRequest.aminoType, QueryGetProtoRevProfitsByDenomRequest.typeUrl); function createBaseQueryGetProtoRevProfitsByDenomResponse(): QueryGetProtoRevProfitsByDenomResponse { return { profit: undefined @@ -1177,6 +1325,16 @@ function createBaseQueryGetProtoRevProfitsByDenomResponse(): QueryGetProtoRevPro } export const QueryGetProtoRevProfitsByDenomResponse = { typeUrl: "/osmosis.protorev.v1beta1.QueryGetProtoRevProfitsByDenomResponse", + aminoType: "osmosis/protorev/query-get-proto-rev-profits-by-denom-response", + is(o: any): o is QueryGetProtoRevProfitsByDenomResponse { + return o && o.$typeUrl === QueryGetProtoRevProfitsByDenomResponse.typeUrl; + }, + isSDK(o: any): o is QueryGetProtoRevProfitsByDenomResponseSDKType { + return o && o.$typeUrl === QueryGetProtoRevProfitsByDenomResponse.typeUrl; + }, + isAmino(o: any): o is QueryGetProtoRevProfitsByDenomResponseAmino { + return o && o.$typeUrl === QueryGetProtoRevProfitsByDenomResponse.typeUrl; + }, encode(message: QueryGetProtoRevProfitsByDenomResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.profit !== undefined) { Coin.encode(message.profit, writer.uint32(10).fork()).ldelim(); @@ -1200,15 +1358,27 @@ export const QueryGetProtoRevProfitsByDenomResponse = { } return message; }, + fromJSON(object: any): QueryGetProtoRevProfitsByDenomResponse { + return { + profit: isSet(object.profit) ? Coin.fromJSON(object.profit) : undefined + }; + }, + toJSON(message: QueryGetProtoRevProfitsByDenomResponse): unknown { + const obj: any = {}; + message.profit !== undefined && (obj.profit = message.profit ? Coin.toJSON(message.profit) : undefined); + return obj; + }, fromPartial(object: Partial): QueryGetProtoRevProfitsByDenomResponse { const message = createBaseQueryGetProtoRevProfitsByDenomResponse(); message.profit = object.profit !== undefined && object.profit !== null ? Coin.fromPartial(object.profit) : undefined; return message; }, fromAmino(object: QueryGetProtoRevProfitsByDenomResponseAmino): QueryGetProtoRevProfitsByDenomResponse { - return { - profit: object?.profit ? Coin.fromAmino(object.profit) : undefined - }; + const message = createBaseQueryGetProtoRevProfitsByDenomResponse(); + if (object.profit !== undefined && object.profit !== null) { + message.profit = Coin.fromAmino(object.profit); + } + return message; }, toAmino(message: QueryGetProtoRevProfitsByDenomResponse): QueryGetProtoRevProfitsByDenomResponseAmino { const obj: any = {}; @@ -1237,11 +1407,23 @@ export const QueryGetProtoRevProfitsByDenomResponse = { }; } }; +GlobalDecoderRegistry.register(QueryGetProtoRevProfitsByDenomResponse.typeUrl, QueryGetProtoRevProfitsByDenomResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryGetProtoRevProfitsByDenomResponse.aminoType, QueryGetProtoRevProfitsByDenomResponse.typeUrl); function createBaseQueryGetProtoRevAllProfitsRequest(): QueryGetProtoRevAllProfitsRequest { return {}; } export const QueryGetProtoRevAllProfitsRequest = { typeUrl: "/osmosis.protorev.v1beta1.QueryGetProtoRevAllProfitsRequest", + aminoType: "osmosis/protorev/query-get-proto-rev-all-profits-request", + is(o: any): o is QueryGetProtoRevAllProfitsRequest { + return o && o.$typeUrl === QueryGetProtoRevAllProfitsRequest.typeUrl; + }, + isSDK(o: any): o is QueryGetProtoRevAllProfitsRequestSDKType { + return o && o.$typeUrl === QueryGetProtoRevAllProfitsRequest.typeUrl; + }, + isAmino(o: any): o is QueryGetProtoRevAllProfitsRequestAmino { + return o && o.$typeUrl === QueryGetProtoRevAllProfitsRequest.typeUrl; + }, encode(_: QueryGetProtoRevAllProfitsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, @@ -1259,12 +1441,20 @@ export const QueryGetProtoRevAllProfitsRequest = { } return message; }, + fromJSON(_: any): QueryGetProtoRevAllProfitsRequest { + return {}; + }, + toJSON(_: QueryGetProtoRevAllProfitsRequest): unknown { + const obj: any = {}; + return obj; + }, fromPartial(_: Partial): QueryGetProtoRevAllProfitsRequest { const message = createBaseQueryGetProtoRevAllProfitsRequest(); return message; }, fromAmino(_: QueryGetProtoRevAllProfitsRequestAmino): QueryGetProtoRevAllProfitsRequest { - return {}; + const message = createBaseQueryGetProtoRevAllProfitsRequest(); + return message; }, toAmino(_: QueryGetProtoRevAllProfitsRequest): QueryGetProtoRevAllProfitsRequestAmino { const obj: any = {}; @@ -1292,6 +1482,8 @@ export const QueryGetProtoRevAllProfitsRequest = { }; } }; +GlobalDecoderRegistry.register(QueryGetProtoRevAllProfitsRequest.typeUrl, QueryGetProtoRevAllProfitsRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryGetProtoRevAllProfitsRequest.aminoType, QueryGetProtoRevAllProfitsRequest.typeUrl); function createBaseQueryGetProtoRevAllProfitsResponse(): QueryGetProtoRevAllProfitsResponse { return { profits: [] @@ -1299,6 +1491,16 @@ function createBaseQueryGetProtoRevAllProfitsResponse(): QueryGetProtoRevAllProf } export const QueryGetProtoRevAllProfitsResponse = { typeUrl: "/osmosis.protorev.v1beta1.QueryGetProtoRevAllProfitsResponse", + aminoType: "osmosis/protorev/query-get-proto-rev-all-profits-response", + is(o: any): o is QueryGetProtoRevAllProfitsResponse { + return o && (o.$typeUrl === QueryGetProtoRevAllProfitsResponse.typeUrl || Array.isArray(o.profits) && (!o.profits.length || Coin.is(o.profits[0]))); + }, + isSDK(o: any): o is QueryGetProtoRevAllProfitsResponseSDKType { + return o && (o.$typeUrl === QueryGetProtoRevAllProfitsResponse.typeUrl || Array.isArray(o.profits) && (!o.profits.length || Coin.isSDK(o.profits[0]))); + }, + isAmino(o: any): o is QueryGetProtoRevAllProfitsResponseAmino { + return o && (o.$typeUrl === QueryGetProtoRevAllProfitsResponse.typeUrl || Array.isArray(o.profits) && (!o.profits.length || Coin.isAmino(o.profits[0]))); + }, encode(message: QueryGetProtoRevAllProfitsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.profits) { Coin.encode(v!, writer.uint32(10).fork()).ldelim(); @@ -1322,15 +1524,29 @@ export const QueryGetProtoRevAllProfitsResponse = { } return message; }, + fromJSON(object: any): QueryGetProtoRevAllProfitsResponse { + return { + profits: Array.isArray(object?.profits) ? object.profits.map((e: any) => Coin.fromJSON(e)) : [] + }; + }, + toJSON(message: QueryGetProtoRevAllProfitsResponse): unknown { + const obj: any = {}; + if (message.profits) { + obj.profits = message.profits.map(e => e ? Coin.toJSON(e) : undefined); + } else { + obj.profits = []; + } + return obj; + }, fromPartial(object: Partial): QueryGetProtoRevAllProfitsResponse { const message = createBaseQueryGetProtoRevAllProfitsResponse(); message.profits = object.profits?.map(e => Coin.fromPartial(e)) || []; return message; }, fromAmino(object: QueryGetProtoRevAllProfitsResponseAmino): QueryGetProtoRevAllProfitsResponse { - return { - profits: Array.isArray(object?.profits) ? object.profits.map((e: any) => Coin.fromAmino(e)) : [] - }; + const message = createBaseQueryGetProtoRevAllProfitsResponse(); + message.profits = object.profits?.map(e => Coin.fromAmino(e)) || []; + return message; }, toAmino(message: QueryGetProtoRevAllProfitsResponse): QueryGetProtoRevAllProfitsResponseAmino { const obj: any = {}; @@ -1363,6 +1579,8 @@ export const QueryGetProtoRevAllProfitsResponse = { }; } }; +GlobalDecoderRegistry.register(QueryGetProtoRevAllProfitsResponse.typeUrl, QueryGetProtoRevAllProfitsResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryGetProtoRevAllProfitsResponse.aminoType, QueryGetProtoRevAllProfitsResponse.typeUrl); function createBaseQueryGetProtoRevStatisticsByRouteRequest(): QueryGetProtoRevStatisticsByRouteRequest { return { route: [] @@ -1370,6 +1588,16 @@ function createBaseQueryGetProtoRevStatisticsByRouteRequest(): QueryGetProtoRevS } export const QueryGetProtoRevStatisticsByRouteRequest = { typeUrl: "/osmosis.protorev.v1beta1.QueryGetProtoRevStatisticsByRouteRequest", + aminoType: "osmosis/protorev/query-get-proto-rev-statistics-by-route-request", + is(o: any): o is QueryGetProtoRevStatisticsByRouteRequest { + return o && (o.$typeUrl === QueryGetProtoRevStatisticsByRouteRequest.typeUrl || Array.isArray(o.route) && (!o.route.length || typeof o.route[0] === "bigint")); + }, + isSDK(o: any): o is QueryGetProtoRevStatisticsByRouteRequestSDKType { + return o && (o.$typeUrl === QueryGetProtoRevStatisticsByRouteRequest.typeUrl || Array.isArray(o.route) && (!o.route.length || typeof o.route[0] === "bigint")); + }, + isAmino(o: any): o is QueryGetProtoRevStatisticsByRouteRequestAmino { + return o && (o.$typeUrl === QueryGetProtoRevStatisticsByRouteRequest.typeUrl || Array.isArray(o.route) && (!o.route.length || typeof o.route[0] === "bigint")); + }, encode(message: QueryGetProtoRevStatisticsByRouteRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { writer.uint32(10).fork(); for (const v of message.route) { @@ -1402,15 +1630,29 @@ export const QueryGetProtoRevStatisticsByRouteRequest = { } return message; }, + fromJSON(object: any): QueryGetProtoRevStatisticsByRouteRequest { + return { + route: Array.isArray(object?.route) ? object.route.map((e: any) => BigInt(e.toString())) : [] + }; + }, + toJSON(message: QueryGetProtoRevStatisticsByRouteRequest): unknown { + const obj: any = {}; + if (message.route) { + obj.route = message.route.map(e => (e || BigInt(0)).toString()); + } else { + obj.route = []; + } + return obj; + }, fromPartial(object: Partial): QueryGetProtoRevStatisticsByRouteRequest { const message = createBaseQueryGetProtoRevStatisticsByRouteRequest(); message.route = object.route?.map(e => BigInt(e.toString())) || []; return message; }, fromAmino(object: QueryGetProtoRevStatisticsByRouteRequestAmino): QueryGetProtoRevStatisticsByRouteRequest { - return { - route: Array.isArray(object?.route) ? object.route.map((e: any) => BigInt(e)) : [] - }; + const message = createBaseQueryGetProtoRevStatisticsByRouteRequest(); + message.route = object.route?.map(e => BigInt(e)) || []; + return message; }, toAmino(message: QueryGetProtoRevStatisticsByRouteRequest): QueryGetProtoRevStatisticsByRouteRequestAmino { const obj: any = {}; @@ -1443,6 +1685,8 @@ export const QueryGetProtoRevStatisticsByRouteRequest = { }; } }; +GlobalDecoderRegistry.register(QueryGetProtoRevStatisticsByRouteRequest.typeUrl, QueryGetProtoRevStatisticsByRouteRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryGetProtoRevStatisticsByRouteRequest.aminoType, QueryGetProtoRevStatisticsByRouteRequest.typeUrl); function createBaseQueryGetProtoRevStatisticsByRouteResponse(): QueryGetProtoRevStatisticsByRouteResponse { return { statistics: RouteStatistics.fromPartial({}) @@ -1450,6 +1694,16 @@ function createBaseQueryGetProtoRevStatisticsByRouteResponse(): QueryGetProtoRev } export const QueryGetProtoRevStatisticsByRouteResponse = { typeUrl: "/osmosis.protorev.v1beta1.QueryGetProtoRevStatisticsByRouteResponse", + aminoType: "osmosis/protorev/query-get-proto-rev-statistics-by-route-response", + is(o: any): o is QueryGetProtoRevStatisticsByRouteResponse { + return o && (o.$typeUrl === QueryGetProtoRevStatisticsByRouteResponse.typeUrl || RouteStatistics.is(o.statistics)); + }, + isSDK(o: any): o is QueryGetProtoRevStatisticsByRouteResponseSDKType { + return o && (o.$typeUrl === QueryGetProtoRevStatisticsByRouteResponse.typeUrl || RouteStatistics.isSDK(o.statistics)); + }, + isAmino(o: any): o is QueryGetProtoRevStatisticsByRouteResponseAmino { + return o && (o.$typeUrl === QueryGetProtoRevStatisticsByRouteResponse.typeUrl || RouteStatistics.isAmino(o.statistics)); + }, encode(message: QueryGetProtoRevStatisticsByRouteResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.statistics !== undefined) { RouteStatistics.encode(message.statistics, writer.uint32(10).fork()).ldelim(); @@ -1473,15 +1727,27 @@ export const QueryGetProtoRevStatisticsByRouteResponse = { } return message; }, + fromJSON(object: any): QueryGetProtoRevStatisticsByRouteResponse { + return { + statistics: isSet(object.statistics) ? RouteStatistics.fromJSON(object.statistics) : undefined + }; + }, + toJSON(message: QueryGetProtoRevStatisticsByRouteResponse): unknown { + const obj: any = {}; + message.statistics !== undefined && (obj.statistics = message.statistics ? RouteStatistics.toJSON(message.statistics) : undefined); + return obj; + }, fromPartial(object: Partial): QueryGetProtoRevStatisticsByRouteResponse { const message = createBaseQueryGetProtoRevStatisticsByRouteResponse(); message.statistics = object.statistics !== undefined && object.statistics !== null ? RouteStatistics.fromPartial(object.statistics) : undefined; return message; }, fromAmino(object: QueryGetProtoRevStatisticsByRouteResponseAmino): QueryGetProtoRevStatisticsByRouteResponse { - return { - statistics: object?.statistics ? RouteStatistics.fromAmino(object.statistics) : undefined - }; + const message = createBaseQueryGetProtoRevStatisticsByRouteResponse(); + if (object.statistics !== undefined && object.statistics !== null) { + message.statistics = RouteStatistics.fromAmino(object.statistics); + } + return message; }, toAmino(message: QueryGetProtoRevStatisticsByRouteResponse): QueryGetProtoRevStatisticsByRouteResponseAmino { const obj: any = {}; @@ -1510,11 +1776,23 @@ export const QueryGetProtoRevStatisticsByRouteResponse = { }; } }; +GlobalDecoderRegistry.register(QueryGetProtoRevStatisticsByRouteResponse.typeUrl, QueryGetProtoRevStatisticsByRouteResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryGetProtoRevStatisticsByRouteResponse.aminoType, QueryGetProtoRevStatisticsByRouteResponse.typeUrl); function createBaseQueryGetProtoRevAllRouteStatisticsRequest(): QueryGetProtoRevAllRouteStatisticsRequest { return {}; } export const QueryGetProtoRevAllRouteStatisticsRequest = { typeUrl: "/osmosis.protorev.v1beta1.QueryGetProtoRevAllRouteStatisticsRequest", + aminoType: "osmosis/protorev/query-get-proto-rev-all-route-statistics-request", + is(o: any): o is QueryGetProtoRevAllRouteStatisticsRequest { + return o && o.$typeUrl === QueryGetProtoRevAllRouteStatisticsRequest.typeUrl; + }, + isSDK(o: any): o is QueryGetProtoRevAllRouteStatisticsRequestSDKType { + return o && o.$typeUrl === QueryGetProtoRevAllRouteStatisticsRequest.typeUrl; + }, + isAmino(o: any): o is QueryGetProtoRevAllRouteStatisticsRequestAmino { + return o && o.$typeUrl === QueryGetProtoRevAllRouteStatisticsRequest.typeUrl; + }, encode(_: QueryGetProtoRevAllRouteStatisticsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, @@ -1532,12 +1810,20 @@ export const QueryGetProtoRevAllRouteStatisticsRequest = { } return message; }, + fromJSON(_: any): QueryGetProtoRevAllRouteStatisticsRequest { + return {}; + }, + toJSON(_: QueryGetProtoRevAllRouteStatisticsRequest): unknown { + const obj: any = {}; + return obj; + }, fromPartial(_: Partial): QueryGetProtoRevAllRouteStatisticsRequest { const message = createBaseQueryGetProtoRevAllRouteStatisticsRequest(); return message; }, fromAmino(_: QueryGetProtoRevAllRouteStatisticsRequestAmino): QueryGetProtoRevAllRouteStatisticsRequest { - return {}; + const message = createBaseQueryGetProtoRevAllRouteStatisticsRequest(); + return message; }, toAmino(_: QueryGetProtoRevAllRouteStatisticsRequest): QueryGetProtoRevAllRouteStatisticsRequestAmino { const obj: any = {}; @@ -1565,6 +1851,8 @@ export const QueryGetProtoRevAllRouteStatisticsRequest = { }; } }; +GlobalDecoderRegistry.register(QueryGetProtoRevAllRouteStatisticsRequest.typeUrl, QueryGetProtoRevAllRouteStatisticsRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryGetProtoRevAllRouteStatisticsRequest.aminoType, QueryGetProtoRevAllRouteStatisticsRequest.typeUrl); function createBaseQueryGetProtoRevAllRouteStatisticsResponse(): QueryGetProtoRevAllRouteStatisticsResponse { return { statistics: [] @@ -1572,6 +1860,16 @@ function createBaseQueryGetProtoRevAllRouteStatisticsResponse(): QueryGetProtoRe } export const QueryGetProtoRevAllRouteStatisticsResponse = { typeUrl: "/osmosis.protorev.v1beta1.QueryGetProtoRevAllRouteStatisticsResponse", + aminoType: "osmosis/protorev/query-get-proto-rev-all-route-statistics-response", + is(o: any): o is QueryGetProtoRevAllRouteStatisticsResponse { + return o && (o.$typeUrl === QueryGetProtoRevAllRouteStatisticsResponse.typeUrl || Array.isArray(o.statistics) && (!o.statistics.length || RouteStatistics.is(o.statistics[0]))); + }, + isSDK(o: any): o is QueryGetProtoRevAllRouteStatisticsResponseSDKType { + return o && (o.$typeUrl === QueryGetProtoRevAllRouteStatisticsResponse.typeUrl || Array.isArray(o.statistics) && (!o.statistics.length || RouteStatistics.isSDK(o.statistics[0]))); + }, + isAmino(o: any): o is QueryGetProtoRevAllRouteStatisticsResponseAmino { + return o && (o.$typeUrl === QueryGetProtoRevAllRouteStatisticsResponse.typeUrl || Array.isArray(o.statistics) && (!o.statistics.length || RouteStatistics.isAmino(o.statistics[0]))); + }, encode(message: QueryGetProtoRevAllRouteStatisticsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.statistics) { RouteStatistics.encode(v!, writer.uint32(10).fork()).ldelim(); @@ -1595,15 +1893,29 @@ export const QueryGetProtoRevAllRouteStatisticsResponse = { } return message; }, + fromJSON(object: any): QueryGetProtoRevAllRouteStatisticsResponse { + return { + statistics: Array.isArray(object?.statistics) ? object.statistics.map((e: any) => RouteStatistics.fromJSON(e)) : [] + }; + }, + toJSON(message: QueryGetProtoRevAllRouteStatisticsResponse): unknown { + const obj: any = {}; + if (message.statistics) { + obj.statistics = message.statistics.map(e => e ? RouteStatistics.toJSON(e) : undefined); + } else { + obj.statistics = []; + } + return obj; + }, fromPartial(object: Partial): QueryGetProtoRevAllRouteStatisticsResponse { const message = createBaseQueryGetProtoRevAllRouteStatisticsResponse(); message.statistics = object.statistics?.map(e => RouteStatistics.fromPartial(e)) || []; return message; }, fromAmino(object: QueryGetProtoRevAllRouteStatisticsResponseAmino): QueryGetProtoRevAllRouteStatisticsResponse { - return { - statistics: Array.isArray(object?.statistics) ? object.statistics.map((e: any) => RouteStatistics.fromAmino(e)) : [] - }; + const message = createBaseQueryGetProtoRevAllRouteStatisticsResponse(); + message.statistics = object.statistics?.map(e => RouteStatistics.fromAmino(e)) || []; + return message; }, toAmino(message: QueryGetProtoRevAllRouteStatisticsResponse): QueryGetProtoRevAllRouteStatisticsResponseAmino { const obj: any = {}; @@ -1636,11 +1948,23 @@ export const QueryGetProtoRevAllRouteStatisticsResponse = { }; } }; +GlobalDecoderRegistry.register(QueryGetProtoRevAllRouteStatisticsResponse.typeUrl, QueryGetProtoRevAllRouteStatisticsResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryGetProtoRevAllRouteStatisticsResponse.aminoType, QueryGetProtoRevAllRouteStatisticsResponse.typeUrl); function createBaseQueryGetProtoRevTokenPairArbRoutesRequest(): QueryGetProtoRevTokenPairArbRoutesRequest { return {}; } export const QueryGetProtoRevTokenPairArbRoutesRequest = { typeUrl: "/osmosis.protorev.v1beta1.QueryGetProtoRevTokenPairArbRoutesRequest", + aminoType: "osmosis/protorev/query-get-proto-rev-token-pair-arb-routes-request", + is(o: any): o is QueryGetProtoRevTokenPairArbRoutesRequest { + return o && o.$typeUrl === QueryGetProtoRevTokenPairArbRoutesRequest.typeUrl; + }, + isSDK(o: any): o is QueryGetProtoRevTokenPairArbRoutesRequestSDKType { + return o && o.$typeUrl === QueryGetProtoRevTokenPairArbRoutesRequest.typeUrl; + }, + isAmino(o: any): o is QueryGetProtoRevTokenPairArbRoutesRequestAmino { + return o && o.$typeUrl === QueryGetProtoRevTokenPairArbRoutesRequest.typeUrl; + }, encode(_: QueryGetProtoRevTokenPairArbRoutesRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, @@ -1658,12 +1982,20 @@ export const QueryGetProtoRevTokenPairArbRoutesRequest = { } return message; }, + fromJSON(_: any): QueryGetProtoRevTokenPairArbRoutesRequest { + return {}; + }, + toJSON(_: QueryGetProtoRevTokenPairArbRoutesRequest): unknown { + const obj: any = {}; + return obj; + }, fromPartial(_: Partial): QueryGetProtoRevTokenPairArbRoutesRequest { const message = createBaseQueryGetProtoRevTokenPairArbRoutesRequest(); return message; }, fromAmino(_: QueryGetProtoRevTokenPairArbRoutesRequestAmino): QueryGetProtoRevTokenPairArbRoutesRequest { - return {}; + const message = createBaseQueryGetProtoRevTokenPairArbRoutesRequest(); + return message; }, toAmino(_: QueryGetProtoRevTokenPairArbRoutesRequest): QueryGetProtoRevTokenPairArbRoutesRequestAmino { const obj: any = {}; @@ -1691,6 +2023,8 @@ export const QueryGetProtoRevTokenPairArbRoutesRequest = { }; } }; +GlobalDecoderRegistry.register(QueryGetProtoRevTokenPairArbRoutesRequest.typeUrl, QueryGetProtoRevTokenPairArbRoutesRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryGetProtoRevTokenPairArbRoutesRequest.aminoType, QueryGetProtoRevTokenPairArbRoutesRequest.typeUrl); function createBaseQueryGetProtoRevTokenPairArbRoutesResponse(): QueryGetProtoRevTokenPairArbRoutesResponse { return { routes: [] @@ -1698,6 +2032,16 @@ function createBaseQueryGetProtoRevTokenPairArbRoutesResponse(): QueryGetProtoRe } export const QueryGetProtoRevTokenPairArbRoutesResponse = { typeUrl: "/osmosis.protorev.v1beta1.QueryGetProtoRevTokenPairArbRoutesResponse", + aminoType: "osmosis/protorev/query-get-proto-rev-token-pair-arb-routes-response", + is(o: any): o is QueryGetProtoRevTokenPairArbRoutesResponse { + return o && (o.$typeUrl === QueryGetProtoRevTokenPairArbRoutesResponse.typeUrl || Array.isArray(o.routes) && (!o.routes.length || TokenPairArbRoutes.is(o.routes[0]))); + }, + isSDK(o: any): o is QueryGetProtoRevTokenPairArbRoutesResponseSDKType { + return o && (o.$typeUrl === QueryGetProtoRevTokenPairArbRoutesResponse.typeUrl || Array.isArray(o.routes) && (!o.routes.length || TokenPairArbRoutes.isSDK(o.routes[0]))); + }, + isAmino(o: any): o is QueryGetProtoRevTokenPairArbRoutesResponseAmino { + return o && (o.$typeUrl === QueryGetProtoRevTokenPairArbRoutesResponse.typeUrl || Array.isArray(o.routes) && (!o.routes.length || TokenPairArbRoutes.isAmino(o.routes[0]))); + }, encode(message: QueryGetProtoRevTokenPairArbRoutesResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.routes) { TokenPairArbRoutes.encode(v!, writer.uint32(10).fork()).ldelim(); @@ -1721,15 +2065,29 @@ export const QueryGetProtoRevTokenPairArbRoutesResponse = { } return message; }, + fromJSON(object: any): QueryGetProtoRevTokenPairArbRoutesResponse { + return { + routes: Array.isArray(object?.routes) ? object.routes.map((e: any) => TokenPairArbRoutes.fromJSON(e)) : [] + }; + }, + toJSON(message: QueryGetProtoRevTokenPairArbRoutesResponse): unknown { + const obj: any = {}; + if (message.routes) { + obj.routes = message.routes.map(e => e ? TokenPairArbRoutes.toJSON(e) : undefined); + } else { + obj.routes = []; + } + return obj; + }, fromPartial(object: Partial): QueryGetProtoRevTokenPairArbRoutesResponse { const message = createBaseQueryGetProtoRevTokenPairArbRoutesResponse(); message.routes = object.routes?.map(e => TokenPairArbRoutes.fromPartial(e)) || []; return message; }, fromAmino(object: QueryGetProtoRevTokenPairArbRoutesResponseAmino): QueryGetProtoRevTokenPairArbRoutesResponse { - return { - routes: Array.isArray(object?.routes) ? object.routes.map((e: any) => TokenPairArbRoutes.fromAmino(e)) : [] - }; + const message = createBaseQueryGetProtoRevTokenPairArbRoutesResponse(); + message.routes = object.routes?.map(e => TokenPairArbRoutes.fromAmino(e)) || []; + return message; }, toAmino(message: QueryGetProtoRevTokenPairArbRoutesResponse): QueryGetProtoRevTokenPairArbRoutesResponseAmino { const obj: any = {}; @@ -1762,11 +2120,23 @@ export const QueryGetProtoRevTokenPairArbRoutesResponse = { }; } }; +GlobalDecoderRegistry.register(QueryGetProtoRevTokenPairArbRoutesResponse.typeUrl, QueryGetProtoRevTokenPairArbRoutesResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryGetProtoRevTokenPairArbRoutesResponse.aminoType, QueryGetProtoRevTokenPairArbRoutesResponse.typeUrl); function createBaseQueryGetProtoRevAdminAccountRequest(): QueryGetProtoRevAdminAccountRequest { return {}; } export const QueryGetProtoRevAdminAccountRequest = { typeUrl: "/osmosis.protorev.v1beta1.QueryGetProtoRevAdminAccountRequest", + aminoType: "osmosis/protorev/query-get-proto-rev-admin-account-request", + is(o: any): o is QueryGetProtoRevAdminAccountRequest { + return o && o.$typeUrl === QueryGetProtoRevAdminAccountRequest.typeUrl; + }, + isSDK(o: any): o is QueryGetProtoRevAdminAccountRequestSDKType { + return o && o.$typeUrl === QueryGetProtoRevAdminAccountRequest.typeUrl; + }, + isAmino(o: any): o is QueryGetProtoRevAdminAccountRequestAmino { + return o && o.$typeUrl === QueryGetProtoRevAdminAccountRequest.typeUrl; + }, encode(_: QueryGetProtoRevAdminAccountRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, @@ -1784,12 +2154,20 @@ export const QueryGetProtoRevAdminAccountRequest = { } return message; }, + fromJSON(_: any): QueryGetProtoRevAdminAccountRequest { + return {}; + }, + toJSON(_: QueryGetProtoRevAdminAccountRequest): unknown { + const obj: any = {}; + return obj; + }, fromPartial(_: Partial): QueryGetProtoRevAdminAccountRequest { const message = createBaseQueryGetProtoRevAdminAccountRequest(); return message; }, fromAmino(_: QueryGetProtoRevAdminAccountRequestAmino): QueryGetProtoRevAdminAccountRequest { - return {}; + const message = createBaseQueryGetProtoRevAdminAccountRequest(); + return message; }, toAmino(_: QueryGetProtoRevAdminAccountRequest): QueryGetProtoRevAdminAccountRequestAmino { const obj: any = {}; @@ -1817,6 +2195,8 @@ export const QueryGetProtoRevAdminAccountRequest = { }; } }; +GlobalDecoderRegistry.register(QueryGetProtoRevAdminAccountRequest.typeUrl, QueryGetProtoRevAdminAccountRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryGetProtoRevAdminAccountRequest.aminoType, QueryGetProtoRevAdminAccountRequest.typeUrl); function createBaseQueryGetProtoRevAdminAccountResponse(): QueryGetProtoRevAdminAccountResponse { return { adminAccount: "" @@ -1824,6 +2204,16 @@ function createBaseQueryGetProtoRevAdminAccountResponse(): QueryGetProtoRevAdmin } export const QueryGetProtoRevAdminAccountResponse = { typeUrl: "/osmosis.protorev.v1beta1.QueryGetProtoRevAdminAccountResponse", + aminoType: "osmosis/protorev/query-get-proto-rev-admin-account-response", + is(o: any): o is QueryGetProtoRevAdminAccountResponse { + return o && (o.$typeUrl === QueryGetProtoRevAdminAccountResponse.typeUrl || typeof o.adminAccount === "string"); + }, + isSDK(o: any): o is QueryGetProtoRevAdminAccountResponseSDKType { + return o && (o.$typeUrl === QueryGetProtoRevAdminAccountResponse.typeUrl || typeof o.admin_account === "string"); + }, + isAmino(o: any): o is QueryGetProtoRevAdminAccountResponseAmino { + return o && (o.$typeUrl === QueryGetProtoRevAdminAccountResponse.typeUrl || typeof o.admin_account === "string"); + }, encode(message: QueryGetProtoRevAdminAccountResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.adminAccount !== "") { writer.uint32(10).string(message.adminAccount); @@ -1847,15 +2237,27 @@ export const QueryGetProtoRevAdminAccountResponse = { } return message; }, + fromJSON(object: any): QueryGetProtoRevAdminAccountResponse { + return { + adminAccount: isSet(object.adminAccount) ? String(object.adminAccount) : "" + }; + }, + toJSON(message: QueryGetProtoRevAdminAccountResponse): unknown { + const obj: any = {}; + message.adminAccount !== undefined && (obj.adminAccount = message.adminAccount); + return obj; + }, fromPartial(object: Partial): QueryGetProtoRevAdminAccountResponse { const message = createBaseQueryGetProtoRevAdminAccountResponse(); message.adminAccount = object.adminAccount ?? ""; return message; }, fromAmino(object: QueryGetProtoRevAdminAccountResponseAmino): QueryGetProtoRevAdminAccountResponse { - return { - adminAccount: object.admin_account - }; + const message = createBaseQueryGetProtoRevAdminAccountResponse(); + if (object.admin_account !== undefined && object.admin_account !== null) { + message.adminAccount = object.admin_account; + } + return message; }, toAmino(message: QueryGetProtoRevAdminAccountResponse): QueryGetProtoRevAdminAccountResponseAmino { const obj: any = {}; @@ -1884,11 +2286,23 @@ export const QueryGetProtoRevAdminAccountResponse = { }; } }; +GlobalDecoderRegistry.register(QueryGetProtoRevAdminAccountResponse.typeUrl, QueryGetProtoRevAdminAccountResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryGetProtoRevAdminAccountResponse.aminoType, QueryGetProtoRevAdminAccountResponse.typeUrl); function createBaseQueryGetProtoRevDeveloperAccountRequest(): QueryGetProtoRevDeveloperAccountRequest { return {}; } export const QueryGetProtoRevDeveloperAccountRequest = { typeUrl: "/osmosis.protorev.v1beta1.QueryGetProtoRevDeveloperAccountRequest", + aminoType: "osmosis/protorev/query-get-proto-rev-developer-account-request", + is(o: any): o is QueryGetProtoRevDeveloperAccountRequest { + return o && o.$typeUrl === QueryGetProtoRevDeveloperAccountRequest.typeUrl; + }, + isSDK(o: any): o is QueryGetProtoRevDeveloperAccountRequestSDKType { + return o && o.$typeUrl === QueryGetProtoRevDeveloperAccountRequest.typeUrl; + }, + isAmino(o: any): o is QueryGetProtoRevDeveloperAccountRequestAmino { + return o && o.$typeUrl === QueryGetProtoRevDeveloperAccountRequest.typeUrl; + }, encode(_: QueryGetProtoRevDeveloperAccountRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, @@ -1906,12 +2320,20 @@ export const QueryGetProtoRevDeveloperAccountRequest = { } return message; }, + fromJSON(_: any): QueryGetProtoRevDeveloperAccountRequest { + return {}; + }, + toJSON(_: QueryGetProtoRevDeveloperAccountRequest): unknown { + const obj: any = {}; + return obj; + }, fromPartial(_: Partial): QueryGetProtoRevDeveloperAccountRequest { const message = createBaseQueryGetProtoRevDeveloperAccountRequest(); return message; }, fromAmino(_: QueryGetProtoRevDeveloperAccountRequestAmino): QueryGetProtoRevDeveloperAccountRequest { - return {}; + const message = createBaseQueryGetProtoRevDeveloperAccountRequest(); + return message; }, toAmino(_: QueryGetProtoRevDeveloperAccountRequest): QueryGetProtoRevDeveloperAccountRequestAmino { const obj: any = {}; @@ -1939,6 +2361,8 @@ export const QueryGetProtoRevDeveloperAccountRequest = { }; } }; +GlobalDecoderRegistry.register(QueryGetProtoRevDeveloperAccountRequest.typeUrl, QueryGetProtoRevDeveloperAccountRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryGetProtoRevDeveloperAccountRequest.aminoType, QueryGetProtoRevDeveloperAccountRequest.typeUrl); function createBaseQueryGetProtoRevDeveloperAccountResponse(): QueryGetProtoRevDeveloperAccountResponse { return { developerAccount: "" @@ -1946,6 +2370,16 @@ function createBaseQueryGetProtoRevDeveloperAccountResponse(): QueryGetProtoRevD } export const QueryGetProtoRevDeveloperAccountResponse = { typeUrl: "/osmosis.protorev.v1beta1.QueryGetProtoRevDeveloperAccountResponse", + aminoType: "osmosis/protorev/query-get-proto-rev-developer-account-response", + is(o: any): o is QueryGetProtoRevDeveloperAccountResponse { + return o && (o.$typeUrl === QueryGetProtoRevDeveloperAccountResponse.typeUrl || typeof o.developerAccount === "string"); + }, + isSDK(o: any): o is QueryGetProtoRevDeveloperAccountResponseSDKType { + return o && (o.$typeUrl === QueryGetProtoRevDeveloperAccountResponse.typeUrl || typeof o.developer_account === "string"); + }, + isAmino(o: any): o is QueryGetProtoRevDeveloperAccountResponseAmino { + return o && (o.$typeUrl === QueryGetProtoRevDeveloperAccountResponse.typeUrl || typeof o.developer_account === "string"); + }, encode(message: QueryGetProtoRevDeveloperAccountResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.developerAccount !== "") { writer.uint32(10).string(message.developerAccount); @@ -1969,15 +2403,27 @@ export const QueryGetProtoRevDeveloperAccountResponse = { } return message; }, + fromJSON(object: any): QueryGetProtoRevDeveloperAccountResponse { + return { + developerAccount: isSet(object.developerAccount) ? String(object.developerAccount) : "" + }; + }, + toJSON(message: QueryGetProtoRevDeveloperAccountResponse): unknown { + const obj: any = {}; + message.developerAccount !== undefined && (obj.developerAccount = message.developerAccount); + return obj; + }, fromPartial(object: Partial): QueryGetProtoRevDeveloperAccountResponse { const message = createBaseQueryGetProtoRevDeveloperAccountResponse(); message.developerAccount = object.developerAccount ?? ""; return message; }, fromAmino(object: QueryGetProtoRevDeveloperAccountResponseAmino): QueryGetProtoRevDeveloperAccountResponse { - return { - developerAccount: object.developer_account - }; + const message = createBaseQueryGetProtoRevDeveloperAccountResponse(); + if (object.developer_account !== undefined && object.developer_account !== null) { + message.developerAccount = object.developer_account; + } + return message; }, toAmino(message: QueryGetProtoRevDeveloperAccountResponse): QueryGetProtoRevDeveloperAccountResponseAmino { const obj: any = {}; @@ -2006,18 +2452,30 @@ export const QueryGetProtoRevDeveloperAccountResponse = { }; } }; -function createBaseQueryGetProtoRevPoolWeightsRequest(): QueryGetProtoRevPoolWeightsRequest { +GlobalDecoderRegistry.register(QueryGetProtoRevDeveloperAccountResponse.typeUrl, QueryGetProtoRevDeveloperAccountResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryGetProtoRevDeveloperAccountResponse.aminoType, QueryGetProtoRevDeveloperAccountResponse.typeUrl); +function createBaseQueryGetProtoRevInfoByPoolTypeRequest(): QueryGetProtoRevInfoByPoolTypeRequest { return {}; } -export const QueryGetProtoRevPoolWeightsRequest = { - typeUrl: "/osmosis.protorev.v1beta1.QueryGetProtoRevPoolWeightsRequest", - encode(_: QueryGetProtoRevPoolWeightsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { +export const QueryGetProtoRevInfoByPoolTypeRequest = { + typeUrl: "/osmosis.protorev.v1beta1.QueryGetProtoRevInfoByPoolTypeRequest", + aminoType: "osmosis/protorev/query-get-proto-rev-info-by-pool-type-request", + is(o: any): o is QueryGetProtoRevInfoByPoolTypeRequest { + return o && o.$typeUrl === QueryGetProtoRevInfoByPoolTypeRequest.typeUrl; + }, + isSDK(o: any): o is QueryGetProtoRevInfoByPoolTypeRequestSDKType { + return o && o.$typeUrl === QueryGetProtoRevInfoByPoolTypeRequest.typeUrl; + }, + isAmino(o: any): o is QueryGetProtoRevInfoByPoolTypeRequestAmino { + return o && o.$typeUrl === QueryGetProtoRevInfoByPoolTypeRequest.typeUrl; + }, + encode(_: QueryGetProtoRevInfoByPoolTypeRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, - decode(input: BinaryReader | Uint8Array, length?: number): QueryGetProtoRevPoolWeightsRequest { + decode(input: BinaryReader | Uint8Array, length?: number): QueryGetProtoRevInfoByPoolTypeRequest { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQueryGetProtoRevPoolWeightsRequest(); + const message = createBaseQueryGetProtoRevInfoByPoolTypeRequest(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -2028,61 +2486,81 @@ export const QueryGetProtoRevPoolWeightsRequest = { } return message; }, - fromPartial(_: Partial): QueryGetProtoRevPoolWeightsRequest { - const message = createBaseQueryGetProtoRevPoolWeightsRequest(); + fromJSON(_: any): QueryGetProtoRevInfoByPoolTypeRequest { + return {}; + }, + toJSON(_: QueryGetProtoRevInfoByPoolTypeRequest): unknown { + const obj: any = {}; + return obj; + }, + fromPartial(_: Partial): QueryGetProtoRevInfoByPoolTypeRequest { + const message = createBaseQueryGetProtoRevInfoByPoolTypeRequest(); return message; }, - fromAmino(_: QueryGetProtoRevPoolWeightsRequestAmino): QueryGetProtoRevPoolWeightsRequest { - return {}; + fromAmino(_: QueryGetProtoRevInfoByPoolTypeRequestAmino): QueryGetProtoRevInfoByPoolTypeRequest { + const message = createBaseQueryGetProtoRevInfoByPoolTypeRequest(); + return message; }, - toAmino(_: QueryGetProtoRevPoolWeightsRequest): QueryGetProtoRevPoolWeightsRequestAmino { + toAmino(_: QueryGetProtoRevInfoByPoolTypeRequest): QueryGetProtoRevInfoByPoolTypeRequestAmino { const obj: any = {}; return obj; }, - fromAminoMsg(object: QueryGetProtoRevPoolWeightsRequestAminoMsg): QueryGetProtoRevPoolWeightsRequest { - return QueryGetProtoRevPoolWeightsRequest.fromAmino(object.value); + fromAminoMsg(object: QueryGetProtoRevInfoByPoolTypeRequestAminoMsg): QueryGetProtoRevInfoByPoolTypeRequest { + return QueryGetProtoRevInfoByPoolTypeRequest.fromAmino(object.value); }, - toAminoMsg(message: QueryGetProtoRevPoolWeightsRequest): QueryGetProtoRevPoolWeightsRequestAminoMsg { + toAminoMsg(message: QueryGetProtoRevInfoByPoolTypeRequest): QueryGetProtoRevInfoByPoolTypeRequestAminoMsg { return { - type: "osmosis/protorev/query-get-proto-rev-pool-weights-request", - value: QueryGetProtoRevPoolWeightsRequest.toAmino(message) + type: "osmosis/protorev/query-get-proto-rev-info-by-pool-type-request", + value: QueryGetProtoRevInfoByPoolTypeRequest.toAmino(message) }; }, - fromProtoMsg(message: QueryGetProtoRevPoolWeightsRequestProtoMsg): QueryGetProtoRevPoolWeightsRequest { - return QueryGetProtoRevPoolWeightsRequest.decode(message.value); + fromProtoMsg(message: QueryGetProtoRevInfoByPoolTypeRequestProtoMsg): QueryGetProtoRevInfoByPoolTypeRequest { + return QueryGetProtoRevInfoByPoolTypeRequest.decode(message.value); }, - toProto(message: QueryGetProtoRevPoolWeightsRequest): Uint8Array { - return QueryGetProtoRevPoolWeightsRequest.encode(message).finish(); + toProto(message: QueryGetProtoRevInfoByPoolTypeRequest): Uint8Array { + return QueryGetProtoRevInfoByPoolTypeRequest.encode(message).finish(); }, - toProtoMsg(message: QueryGetProtoRevPoolWeightsRequest): QueryGetProtoRevPoolWeightsRequestProtoMsg { + toProtoMsg(message: QueryGetProtoRevInfoByPoolTypeRequest): QueryGetProtoRevInfoByPoolTypeRequestProtoMsg { return { - typeUrl: "/osmosis.protorev.v1beta1.QueryGetProtoRevPoolWeightsRequest", - value: QueryGetProtoRevPoolWeightsRequest.encode(message).finish() + typeUrl: "/osmosis.protorev.v1beta1.QueryGetProtoRevInfoByPoolTypeRequest", + value: QueryGetProtoRevInfoByPoolTypeRequest.encode(message).finish() }; } }; -function createBaseQueryGetProtoRevPoolWeightsResponse(): QueryGetProtoRevPoolWeightsResponse { +GlobalDecoderRegistry.register(QueryGetProtoRevInfoByPoolTypeRequest.typeUrl, QueryGetProtoRevInfoByPoolTypeRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryGetProtoRevInfoByPoolTypeRequest.aminoType, QueryGetProtoRevInfoByPoolTypeRequest.typeUrl); +function createBaseQueryGetProtoRevInfoByPoolTypeResponse(): QueryGetProtoRevInfoByPoolTypeResponse { return { - poolWeights: PoolWeights.fromPartial({}) + infoByPoolType: InfoByPoolType.fromPartial({}) }; } -export const QueryGetProtoRevPoolWeightsResponse = { - typeUrl: "/osmosis.protorev.v1beta1.QueryGetProtoRevPoolWeightsResponse", - encode(message: QueryGetProtoRevPoolWeightsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { - if (message.poolWeights !== undefined) { - PoolWeights.encode(message.poolWeights, writer.uint32(10).fork()).ldelim(); +export const QueryGetProtoRevInfoByPoolTypeResponse = { + typeUrl: "/osmosis.protorev.v1beta1.QueryGetProtoRevInfoByPoolTypeResponse", + aminoType: "osmosis/protorev/query-get-proto-rev-info-by-pool-type-response", + is(o: any): o is QueryGetProtoRevInfoByPoolTypeResponse { + return o && (o.$typeUrl === QueryGetProtoRevInfoByPoolTypeResponse.typeUrl || InfoByPoolType.is(o.infoByPoolType)); + }, + isSDK(o: any): o is QueryGetProtoRevInfoByPoolTypeResponseSDKType { + return o && (o.$typeUrl === QueryGetProtoRevInfoByPoolTypeResponse.typeUrl || InfoByPoolType.isSDK(o.info_by_pool_type)); + }, + isAmino(o: any): o is QueryGetProtoRevInfoByPoolTypeResponseAmino { + return o && (o.$typeUrl === QueryGetProtoRevInfoByPoolTypeResponse.typeUrl || InfoByPoolType.isAmino(o.info_by_pool_type)); + }, + encode(message: QueryGetProtoRevInfoByPoolTypeResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.infoByPoolType !== undefined) { + InfoByPoolType.encode(message.infoByPoolType, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: BinaryReader | Uint8Array, length?: number): QueryGetProtoRevPoolWeightsResponse { + decode(input: BinaryReader | Uint8Array, length?: number): QueryGetProtoRevInfoByPoolTypeResponse { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQueryGetProtoRevPoolWeightsResponse(); + const message = createBaseQueryGetProtoRevInfoByPoolTypeResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.poolWeights = PoolWeights.decode(reader, reader.uint32()); + message.infoByPoolType = InfoByPoolType.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -2091,48 +2569,72 @@ export const QueryGetProtoRevPoolWeightsResponse = { } return message; }, - fromPartial(object: Partial): QueryGetProtoRevPoolWeightsResponse { - const message = createBaseQueryGetProtoRevPoolWeightsResponse(); - message.poolWeights = object.poolWeights !== undefined && object.poolWeights !== null ? PoolWeights.fromPartial(object.poolWeights) : undefined; - return message; - }, - fromAmino(object: QueryGetProtoRevPoolWeightsResponseAmino): QueryGetProtoRevPoolWeightsResponse { + fromJSON(object: any): QueryGetProtoRevInfoByPoolTypeResponse { return { - poolWeights: object?.pool_weights ? PoolWeights.fromAmino(object.pool_weights) : undefined + infoByPoolType: isSet(object.infoByPoolType) ? InfoByPoolType.fromJSON(object.infoByPoolType) : undefined }; }, - toAmino(message: QueryGetProtoRevPoolWeightsResponse): QueryGetProtoRevPoolWeightsResponseAmino { + toJSON(message: QueryGetProtoRevInfoByPoolTypeResponse): unknown { + const obj: any = {}; + message.infoByPoolType !== undefined && (obj.infoByPoolType = message.infoByPoolType ? InfoByPoolType.toJSON(message.infoByPoolType) : undefined); + return obj; + }, + fromPartial(object: Partial): QueryGetProtoRevInfoByPoolTypeResponse { + const message = createBaseQueryGetProtoRevInfoByPoolTypeResponse(); + message.infoByPoolType = object.infoByPoolType !== undefined && object.infoByPoolType !== null ? InfoByPoolType.fromPartial(object.infoByPoolType) : undefined; + return message; + }, + fromAmino(object: QueryGetProtoRevInfoByPoolTypeResponseAmino): QueryGetProtoRevInfoByPoolTypeResponse { + const message = createBaseQueryGetProtoRevInfoByPoolTypeResponse(); + if (object.info_by_pool_type !== undefined && object.info_by_pool_type !== null) { + message.infoByPoolType = InfoByPoolType.fromAmino(object.info_by_pool_type); + } + return message; + }, + toAmino(message: QueryGetProtoRevInfoByPoolTypeResponse): QueryGetProtoRevInfoByPoolTypeResponseAmino { const obj: any = {}; - obj.pool_weights = message.poolWeights ? PoolWeights.toAmino(message.poolWeights) : undefined; + obj.info_by_pool_type = message.infoByPoolType ? InfoByPoolType.toAmino(message.infoByPoolType) : undefined; return obj; }, - fromAminoMsg(object: QueryGetProtoRevPoolWeightsResponseAminoMsg): QueryGetProtoRevPoolWeightsResponse { - return QueryGetProtoRevPoolWeightsResponse.fromAmino(object.value); + fromAminoMsg(object: QueryGetProtoRevInfoByPoolTypeResponseAminoMsg): QueryGetProtoRevInfoByPoolTypeResponse { + return QueryGetProtoRevInfoByPoolTypeResponse.fromAmino(object.value); }, - toAminoMsg(message: QueryGetProtoRevPoolWeightsResponse): QueryGetProtoRevPoolWeightsResponseAminoMsg { + toAminoMsg(message: QueryGetProtoRevInfoByPoolTypeResponse): QueryGetProtoRevInfoByPoolTypeResponseAminoMsg { return { - type: "osmosis/protorev/query-get-proto-rev-pool-weights-response", - value: QueryGetProtoRevPoolWeightsResponse.toAmino(message) + type: "osmosis/protorev/query-get-proto-rev-info-by-pool-type-response", + value: QueryGetProtoRevInfoByPoolTypeResponse.toAmino(message) }; }, - fromProtoMsg(message: QueryGetProtoRevPoolWeightsResponseProtoMsg): QueryGetProtoRevPoolWeightsResponse { - return QueryGetProtoRevPoolWeightsResponse.decode(message.value); + fromProtoMsg(message: QueryGetProtoRevInfoByPoolTypeResponseProtoMsg): QueryGetProtoRevInfoByPoolTypeResponse { + return QueryGetProtoRevInfoByPoolTypeResponse.decode(message.value); }, - toProto(message: QueryGetProtoRevPoolWeightsResponse): Uint8Array { - return QueryGetProtoRevPoolWeightsResponse.encode(message).finish(); + toProto(message: QueryGetProtoRevInfoByPoolTypeResponse): Uint8Array { + return QueryGetProtoRevInfoByPoolTypeResponse.encode(message).finish(); }, - toProtoMsg(message: QueryGetProtoRevPoolWeightsResponse): QueryGetProtoRevPoolWeightsResponseProtoMsg { + toProtoMsg(message: QueryGetProtoRevInfoByPoolTypeResponse): QueryGetProtoRevInfoByPoolTypeResponseProtoMsg { return { - typeUrl: "/osmosis.protorev.v1beta1.QueryGetProtoRevPoolWeightsResponse", - value: QueryGetProtoRevPoolWeightsResponse.encode(message).finish() + typeUrl: "/osmosis.protorev.v1beta1.QueryGetProtoRevInfoByPoolTypeResponse", + value: QueryGetProtoRevInfoByPoolTypeResponse.encode(message).finish() }; } }; +GlobalDecoderRegistry.register(QueryGetProtoRevInfoByPoolTypeResponse.typeUrl, QueryGetProtoRevInfoByPoolTypeResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryGetProtoRevInfoByPoolTypeResponse.aminoType, QueryGetProtoRevInfoByPoolTypeResponse.typeUrl); function createBaseQueryGetProtoRevMaxPoolPointsPerBlockRequest(): QueryGetProtoRevMaxPoolPointsPerBlockRequest { return {}; } export const QueryGetProtoRevMaxPoolPointsPerBlockRequest = { typeUrl: "/osmosis.protorev.v1beta1.QueryGetProtoRevMaxPoolPointsPerBlockRequest", + aminoType: "osmosis/protorev/query-get-proto-rev-max-pool-points-per-block-request", + is(o: any): o is QueryGetProtoRevMaxPoolPointsPerBlockRequest { + return o && o.$typeUrl === QueryGetProtoRevMaxPoolPointsPerBlockRequest.typeUrl; + }, + isSDK(o: any): o is QueryGetProtoRevMaxPoolPointsPerBlockRequestSDKType { + return o && o.$typeUrl === QueryGetProtoRevMaxPoolPointsPerBlockRequest.typeUrl; + }, + isAmino(o: any): o is QueryGetProtoRevMaxPoolPointsPerBlockRequestAmino { + return o && o.$typeUrl === QueryGetProtoRevMaxPoolPointsPerBlockRequest.typeUrl; + }, encode(_: QueryGetProtoRevMaxPoolPointsPerBlockRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, @@ -2150,12 +2652,20 @@ export const QueryGetProtoRevMaxPoolPointsPerBlockRequest = { } return message; }, + fromJSON(_: any): QueryGetProtoRevMaxPoolPointsPerBlockRequest { + return {}; + }, + toJSON(_: QueryGetProtoRevMaxPoolPointsPerBlockRequest): unknown { + const obj: any = {}; + return obj; + }, fromPartial(_: Partial): QueryGetProtoRevMaxPoolPointsPerBlockRequest { const message = createBaseQueryGetProtoRevMaxPoolPointsPerBlockRequest(); return message; }, fromAmino(_: QueryGetProtoRevMaxPoolPointsPerBlockRequestAmino): QueryGetProtoRevMaxPoolPointsPerBlockRequest { - return {}; + const message = createBaseQueryGetProtoRevMaxPoolPointsPerBlockRequest(); + return message; }, toAmino(_: QueryGetProtoRevMaxPoolPointsPerBlockRequest): QueryGetProtoRevMaxPoolPointsPerBlockRequestAmino { const obj: any = {}; @@ -2183,6 +2693,8 @@ export const QueryGetProtoRevMaxPoolPointsPerBlockRequest = { }; } }; +GlobalDecoderRegistry.register(QueryGetProtoRevMaxPoolPointsPerBlockRequest.typeUrl, QueryGetProtoRevMaxPoolPointsPerBlockRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryGetProtoRevMaxPoolPointsPerBlockRequest.aminoType, QueryGetProtoRevMaxPoolPointsPerBlockRequest.typeUrl); function createBaseQueryGetProtoRevMaxPoolPointsPerBlockResponse(): QueryGetProtoRevMaxPoolPointsPerBlockResponse { return { maxPoolPointsPerBlock: BigInt(0) @@ -2190,6 +2702,16 @@ function createBaseQueryGetProtoRevMaxPoolPointsPerBlockResponse(): QueryGetProt } export const QueryGetProtoRevMaxPoolPointsPerBlockResponse = { typeUrl: "/osmosis.protorev.v1beta1.QueryGetProtoRevMaxPoolPointsPerBlockResponse", + aminoType: "osmosis/protorev/query-get-proto-rev-max-pool-points-per-block-response", + is(o: any): o is QueryGetProtoRevMaxPoolPointsPerBlockResponse { + return o && (o.$typeUrl === QueryGetProtoRevMaxPoolPointsPerBlockResponse.typeUrl || typeof o.maxPoolPointsPerBlock === "bigint"); + }, + isSDK(o: any): o is QueryGetProtoRevMaxPoolPointsPerBlockResponseSDKType { + return o && (o.$typeUrl === QueryGetProtoRevMaxPoolPointsPerBlockResponse.typeUrl || typeof o.max_pool_points_per_block === "bigint"); + }, + isAmino(o: any): o is QueryGetProtoRevMaxPoolPointsPerBlockResponseAmino { + return o && (o.$typeUrl === QueryGetProtoRevMaxPoolPointsPerBlockResponse.typeUrl || typeof o.max_pool_points_per_block === "bigint"); + }, encode(message: QueryGetProtoRevMaxPoolPointsPerBlockResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.maxPoolPointsPerBlock !== BigInt(0)) { writer.uint32(8).uint64(message.maxPoolPointsPerBlock); @@ -2213,15 +2735,27 @@ export const QueryGetProtoRevMaxPoolPointsPerBlockResponse = { } return message; }, + fromJSON(object: any): QueryGetProtoRevMaxPoolPointsPerBlockResponse { + return { + maxPoolPointsPerBlock: isSet(object.maxPoolPointsPerBlock) ? BigInt(object.maxPoolPointsPerBlock.toString()) : BigInt(0) + }; + }, + toJSON(message: QueryGetProtoRevMaxPoolPointsPerBlockResponse): unknown { + const obj: any = {}; + message.maxPoolPointsPerBlock !== undefined && (obj.maxPoolPointsPerBlock = (message.maxPoolPointsPerBlock || BigInt(0)).toString()); + return obj; + }, fromPartial(object: Partial): QueryGetProtoRevMaxPoolPointsPerBlockResponse { const message = createBaseQueryGetProtoRevMaxPoolPointsPerBlockResponse(); message.maxPoolPointsPerBlock = object.maxPoolPointsPerBlock !== undefined && object.maxPoolPointsPerBlock !== null ? BigInt(object.maxPoolPointsPerBlock.toString()) : BigInt(0); return message; }, fromAmino(object: QueryGetProtoRevMaxPoolPointsPerBlockResponseAmino): QueryGetProtoRevMaxPoolPointsPerBlockResponse { - return { - maxPoolPointsPerBlock: BigInt(object.max_pool_points_per_block) - }; + const message = createBaseQueryGetProtoRevMaxPoolPointsPerBlockResponse(); + if (object.max_pool_points_per_block !== undefined && object.max_pool_points_per_block !== null) { + message.maxPoolPointsPerBlock = BigInt(object.max_pool_points_per_block); + } + return message; }, toAmino(message: QueryGetProtoRevMaxPoolPointsPerBlockResponse): QueryGetProtoRevMaxPoolPointsPerBlockResponseAmino { const obj: any = {}; @@ -2250,11 +2784,23 @@ export const QueryGetProtoRevMaxPoolPointsPerBlockResponse = { }; } }; +GlobalDecoderRegistry.register(QueryGetProtoRevMaxPoolPointsPerBlockResponse.typeUrl, QueryGetProtoRevMaxPoolPointsPerBlockResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryGetProtoRevMaxPoolPointsPerBlockResponse.aminoType, QueryGetProtoRevMaxPoolPointsPerBlockResponse.typeUrl); function createBaseQueryGetProtoRevMaxPoolPointsPerTxRequest(): QueryGetProtoRevMaxPoolPointsPerTxRequest { return {}; } export const QueryGetProtoRevMaxPoolPointsPerTxRequest = { typeUrl: "/osmosis.protorev.v1beta1.QueryGetProtoRevMaxPoolPointsPerTxRequest", + aminoType: "osmosis/protorev/query-get-proto-rev-max-pool-points-per-tx-request", + is(o: any): o is QueryGetProtoRevMaxPoolPointsPerTxRequest { + return o && o.$typeUrl === QueryGetProtoRevMaxPoolPointsPerTxRequest.typeUrl; + }, + isSDK(o: any): o is QueryGetProtoRevMaxPoolPointsPerTxRequestSDKType { + return o && o.$typeUrl === QueryGetProtoRevMaxPoolPointsPerTxRequest.typeUrl; + }, + isAmino(o: any): o is QueryGetProtoRevMaxPoolPointsPerTxRequestAmino { + return o && o.$typeUrl === QueryGetProtoRevMaxPoolPointsPerTxRequest.typeUrl; + }, encode(_: QueryGetProtoRevMaxPoolPointsPerTxRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, @@ -2272,12 +2818,20 @@ export const QueryGetProtoRevMaxPoolPointsPerTxRequest = { } return message; }, + fromJSON(_: any): QueryGetProtoRevMaxPoolPointsPerTxRequest { + return {}; + }, + toJSON(_: QueryGetProtoRevMaxPoolPointsPerTxRequest): unknown { + const obj: any = {}; + return obj; + }, fromPartial(_: Partial): QueryGetProtoRevMaxPoolPointsPerTxRequest { const message = createBaseQueryGetProtoRevMaxPoolPointsPerTxRequest(); return message; }, fromAmino(_: QueryGetProtoRevMaxPoolPointsPerTxRequestAmino): QueryGetProtoRevMaxPoolPointsPerTxRequest { - return {}; + const message = createBaseQueryGetProtoRevMaxPoolPointsPerTxRequest(); + return message; }, toAmino(_: QueryGetProtoRevMaxPoolPointsPerTxRequest): QueryGetProtoRevMaxPoolPointsPerTxRequestAmino { const obj: any = {}; @@ -2305,6 +2859,8 @@ export const QueryGetProtoRevMaxPoolPointsPerTxRequest = { }; } }; +GlobalDecoderRegistry.register(QueryGetProtoRevMaxPoolPointsPerTxRequest.typeUrl, QueryGetProtoRevMaxPoolPointsPerTxRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryGetProtoRevMaxPoolPointsPerTxRequest.aminoType, QueryGetProtoRevMaxPoolPointsPerTxRequest.typeUrl); function createBaseQueryGetProtoRevMaxPoolPointsPerTxResponse(): QueryGetProtoRevMaxPoolPointsPerTxResponse { return { maxPoolPointsPerTx: BigInt(0) @@ -2312,6 +2868,16 @@ function createBaseQueryGetProtoRevMaxPoolPointsPerTxResponse(): QueryGetProtoRe } export const QueryGetProtoRevMaxPoolPointsPerTxResponse = { typeUrl: "/osmosis.protorev.v1beta1.QueryGetProtoRevMaxPoolPointsPerTxResponse", + aminoType: "osmosis/protorev/query-get-proto-rev-max-pool-points-per-tx-response", + is(o: any): o is QueryGetProtoRevMaxPoolPointsPerTxResponse { + return o && (o.$typeUrl === QueryGetProtoRevMaxPoolPointsPerTxResponse.typeUrl || typeof o.maxPoolPointsPerTx === "bigint"); + }, + isSDK(o: any): o is QueryGetProtoRevMaxPoolPointsPerTxResponseSDKType { + return o && (o.$typeUrl === QueryGetProtoRevMaxPoolPointsPerTxResponse.typeUrl || typeof o.max_pool_points_per_tx === "bigint"); + }, + isAmino(o: any): o is QueryGetProtoRevMaxPoolPointsPerTxResponseAmino { + return o && (o.$typeUrl === QueryGetProtoRevMaxPoolPointsPerTxResponse.typeUrl || typeof o.max_pool_points_per_tx === "bigint"); + }, encode(message: QueryGetProtoRevMaxPoolPointsPerTxResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.maxPoolPointsPerTx !== BigInt(0)) { writer.uint32(8).uint64(message.maxPoolPointsPerTx); @@ -2335,15 +2901,27 @@ export const QueryGetProtoRevMaxPoolPointsPerTxResponse = { } return message; }, + fromJSON(object: any): QueryGetProtoRevMaxPoolPointsPerTxResponse { + return { + maxPoolPointsPerTx: isSet(object.maxPoolPointsPerTx) ? BigInt(object.maxPoolPointsPerTx.toString()) : BigInt(0) + }; + }, + toJSON(message: QueryGetProtoRevMaxPoolPointsPerTxResponse): unknown { + const obj: any = {}; + message.maxPoolPointsPerTx !== undefined && (obj.maxPoolPointsPerTx = (message.maxPoolPointsPerTx || BigInt(0)).toString()); + return obj; + }, fromPartial(object: Partial): QueryGetProtoRevMaxPoolPointsPerTxResponse { const message = createBaseQueryGetProtoRevMaxPoolPointsPerTxResponse(); message.maxPoolPointsPerTx = object.maxPoolPointsPerTx !== undefined && object.maxPoolPointsPerTx !== null ? BigInt(object.maxPoolPointsPerTx.toString()) : BigInt(0); return message; }, fromAmino(object: QueryGetProtoRevMaxPoolPointsPerTxResponseAmino): QueryGetProtoRevMaxPoolPointsPerTxResponse { - return { - maxPoolPointsPerTx: BigInt(object.max_pool_points_per_tx) - }; + const message = createBaseQueryGetProtoRevMaxPoolPointsPerTxResponse(); + if (object.max_pool_points_per_tx !== undefined && object.max_pool_points_per_tx !== null) { + message.maxPoolPointsPerTx = BigInt(object.max_pool_points_per_tx); + } + return message; }, toAmino(message: QueryGetProtoRevMaxPoolPointsPerTxResponse): QueryGetProtoRevMaxPoolPointsPerTxResponseAmino { const obj: any = {}; @@ -2372,11 +2950,23 @@ export const QueryGetProtoRevMaxPoolPointsPerTxResponse = { }; } }; +GlobalDecoderRegistry.register(QueryGetProtoRevMaxPoolPointsPerTxResponse.typeUrl, QueryGetProtoRevMaxPoolPointsPerTxResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryGetProtoRevMaxPoolPointsPerTxResponse.aminoType, QueryGetProtoRevMaxPoolPointsPerTxResponse.typeUrl); function createBaseQueryGetProtoRevBaseDenomsRequest(): QueryGetProtoRevBaseDenomsRequest { return {}; } export const QueryGetProtoRevBaseDenomsRequest = { typeUrl: "/osmosis.protorev.v1beta1.QueryGetProtoRevBaseDenomsRequest", + aminoType: "osmosis/protorev/query-get-proto-rev-base-denoms-request", + is(o: any): o is QueryGetProtoRevBaseDenomsRequest { + return o && o.$typeUrl === QueryGetProtoRevBaseDenomsRequest.typeUrl; + }, + isSDK(o: any): o is QueryGetProtoRevBaseDenomsRequestSDKType { + return o && o.$typeUrl === QueryGetProtoRevBaseDenomsRequest.typeUrl; + }, + isAmino(o: any): o is QueryGetProtoRevBaseDenomsRequestAmino { + return o && o.$typeUrl === QueryGetProtoRevBaseDenomsRequest.typeUrl; + }, encode(_: QueryGetProtoRevBaseDenomsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, @@ -2394,12 +2984,20 @@ export const QueryGetProtoRevBaseDenomsRequest = { } return message; }, + fromJSON(_: any): QueryGetProtoRevBaseDenomsRequest { + return {}; + }, + toJSON(_: QueryGetProtoRevBaseDenomsRequest): unknown { + const obj: any = {}; + return obj; + }, fromPartial(_: Partial): QueryGetProtoRevBaseDenomsRequest { const message = createBaseQueryGetProtoRevBaseDenomsRequest(); return message; }, fromAmino(_: QueryGetProtoRevBaseDenomsRequestAmino): QueryGetProtoRevBaseDenomsRequest { - return {}; + const message = createBaseQueryGetProtoRevBaseDenomsRequest(); + return message; }, toAmino(_: QueryGetProtoRevBaseDenomsRequest): QueryGetProtoRevBaseDenomsRequestAmino { const obj: any = {}; @@ -2427,6 +3025,8 @@ export const QueryGetProtoRevBaseDenomsRequest = { }; } }; +GlobalDecoderRegistry.register(QueryGetProtoRevBaseDenomsRequest.typeUrl, QueryGetProtoRevBaseDenomsRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryGetProtoRevBaseDenomsRequest.aminoType, QueryGetProtoRevBaseDenomsRequest.typeUrl); function createBaseQueryGetProtoRevBaseDenomsResponse(): QueryGetProtoRevBaseDenomsResponse { return { baseDenoms: [] @@ -2434,6 +3034,16 @@ function createBaseQueryGetProtoRevBaseDenomsResponse(): QueryGetProtoRevBaseDen } export const QueryGetProtoRevBaseDenomsResponse = { typeUrl: "/osmosis.protorev.v1beta1.QueryGetProtoRevBaseDenomsResponse", + aminoType: "osmosis/protorev/query-get-proto-rev-base-denoms-response", + is(o: any): o is QueryGetProtoRevBaseDenomsResponse { + return o && (o.$typeUrl === QueryGetProtoRevBaseDenomsResponse.typeUrl || Array.isArray(o.baseDenoms) && (!o.baseDenoms.length || BaseDenom.is(o.baseDenoms[0]))); + }, + isSDK(o: any): o is QueryGetProtoRevBaseDenomsResponseSDKType { + return o && (o.$typeUrl === QueryGetProtoRevBaseDenomsResponse.typeUrl || Array.isArray(o.base_denoms) && (!o.base_denoms.length || BaseDenom.isSDK(o.base_denoms[0]))); + }, + isAmino(o: any): o is QueryGetProtoRevBaseDenomsResponseAmino { + return o && (o.$typeUrl === QueryGetProtoRevBaseDenomsResponse.typeUrl || Array.isArray(o.base_denoms) && (!o.base_denoms.length || BaseDenom.isAmino(o.base_denoms[0]))); + }, encode(message: QueryGetProtoRevBaseDenomsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.baseDenoms) { BaseDenom.encode(v!, writer.uint32(10).fork()).ldelim(); @@ -2457,15 +3067,29 @@ export const QueryGetProtoRevBaseDenomsResponse = { } return message; }, + fromJSON(object: any): QueryGetProtoRevBaseDenomsResponse { + return { + baseDenoms: Array.isArray(object?.baseDenoms) ? object.baseDenoms.map((e: any) => BaseDenom.fromJSON(e)) : [] + }; + }, + toJSON(message: QueryGetProtoRevBaseDenomsResponse): unknown { + const obj: any = {}; + if (message.baseDenoms) { + obj.baseDenoms = message.baseDenoms.map(e => e ? BaseDenom.toJSON(e) : undefined); + } else { + obj.baseDenoms = []; + } + return obj; + }, fromPartial(object: Partial): QueryGetProtoRevBaseDenomsResponse { const message = createBaseQueryGetProtoRevBaseDenomsResponse(); message.baseDenoms = object.baseDenoms?.map(e => BaseDenom.fromPartial(e)) || []; return message; }, fromAmino(object: QueryGetProtoRevBaseDenomsResponseAmino): QueryGetProtoRevBaseDenomsResponse { - return { - baseDenoms: Array.isArray(object?.base_denoms) ? object.base_denoms.map((e: any) => BaseDenom.fromAmino(e)) : [] - }; + const message = createBaseQueryGetProtoRevBaseDenomsResponse(); + message.baseDenoms = object.base_denoms?.map(e => BaseDenom.fromAmino(e)) || []; + return message; }, toAmino(message: QueryGetProtoRevBaseDenomsResponse): QueryGetProtoRevBaseDenomsResponseAmino { const obj: any = {}; @@ -2498,11 +3122,23 @@ export const QueryGetProtoRevBaseDenomsResponse = { }; } }; +GlobalDecoderRegistry.register(QueryGetProtoRevBaseDenomsResponse.typeUrl, QueryGetProtoRevBaseDenomsResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryGetProtoRevBaseDenomsResponse.aminoType, QueryGetProtoRevBaseDenomsResponse.typeUrl); function createBaseQueryGetProtoRevEnabledRequest(): QueryGetProtoRevEnabledRequest { return {}; } export const QueryGetProtoRevEnabledRequest = { typeUrl: "/osmosis.protorev.v1beta1.QueryGetProtoRevEnabledRequest", + aminoType: "osmosis/protorev/query-get-proto-rev-enabled-request", + is(o: any): o is QueryGetProtoRevEnabledRequest { + return o && o.$typeUrl === QueryGetProtoRevEnabledRequest.typeUrl; + }, + isSDK(o: any): o is QueryGetProtoRevEnabledRequestSDKType { + return o && o.$typeUrl === QueryGetProtoRevEnabledRequest.typeUrl; + }, + isAmino(o: any): o is QueryGetProtoRevEnabledRequestAmino { + return o && o.$typeUrl === QueryGetProtoRevEnabledRequest.typeUrl; + }, encode(_: QueryGetProtoRevEnabledRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, @@ -2520,12 +3156,20 @@ export const QueryGetProtoRevEnabledRequest = { } return message; }, + fromJSON(_: any): QueryGetProtoRevEnabledRequest { + return {}; + }, + toJSON(_: QueryGetProtoRevEnabledRequest): unknown { + const obj: any = {}; + return obj; + }, fromPartial(_: Partial): QueryGetProtoRevEnabledRequest { const message = createBaseQueryGetProtoRevEnabledRequest(); return message; }, fromAmino(_: QueryGetProtoRevEnabledRequestAmino): QueryGetProtoRevEnabledRequest { - return {}; + const message = createBaseQueryGetProtoRevEnabledRequest(); + return message; }, toAmino(_: QueryGetProtoRevEnabledRequest): QueryGetProtoRevEnabledRequestAmino { const obj: any = {}; @@ -2553,6 +3197,8 @@ export const QueryGetProtoRevEnabledRequest = { }; } }; +GlobalDecoderRegistry.register(QueryGetProtoRevEnabledRequest.typeUrl, QueryGetProtoRevEnabledRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryGetProtoRevEnabledRequest.aminoType, QueryGetProtoRevEnabledRequest.typeUrl); function createBaseQueryGetProtoRevEnabledResponse(): QueryGetProtoRevEnabledResponse { return { enabled: false @@ -2560,6 +3206,16 @@ function createBaseQueryGetProtoRevEnabledResponse(): QueryGetProtoRevEnabledRes } export const QueryGetProtoRevEnabledResponse = { typeUrl: "/osmosis.protorev.v1beta1.QueryGetProtoRevEnabledResponse", + aminoType: "osmosis/protorev/query-get-proto-rev-enabled-response", + is(o: any): o is QueryGetProtoRevEnabledResponse { + return o && (o.$typeUrl === QueryGetProtoRevEnabledResponse.typeUrl || typeof o.enabled === "boolean"); + }, + isSDK(o: any): o is QueryGetProtoRevEnabledResponseSDKType { + return o && (o.$typeUrl === QueryGetProtoRevEnabledResponse.typeUrl || typeof o.enabled === "boolean"); + }, + isAmino(o: any): o is QueryGetProtoRevEnabledResponseAmino { + return o && (o.$typeUrl === QueryGetProtoRevEnabledResponse.typeUrl || typeof o.enabled === "boolean"); + }, encode(message: QueryGetProtoRevEnabledResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.enabled === true) { writer.uint32(8).bool(message.enabled); @@ -2583,15 +3239,27 @@ export const QueryGetProtoRevEnabledResponse = { } return message; }, + fromJSON(object: any): QueryGetProtoRevEnabledResponse { + return { + enabled: isSet(object.enabled) ? Boolean(object.enabled) : false + }; + }, + toJSON(message: QueryGetProtoRevEnabledResponse): unknown { + const obj: any = {}; + message.enabled !== undefined && (obj.enabled = message.enabled); + return obj; + }, fromPartial(object: Partial): QueryGetProtoRevEnabledResponse { const message = createBaseQueryGetProtoRevEnabledResponse(); message.enabled = object.enabled ?? false; return message; }, fromAmino(object: QueryGetProtoRevEnabledResponseAmino): QueryGetProtoRevEnabledResponse { - return { - enabled: object.enabled - }; + const message = createBaseQueryGetProtoRevEnabledResponse(); + if (object.enabled !== undefined && object.enabled !== null) { + message.enabled = object.enabled; + } + return message; }, toAmino(message: QueryGetProtoRevEnabledResponse): QueryGetProtoRevEnabledResponseAmino { const obj: any = {}; @@ -2620,6 +3288,8 @@ export const QueryGetProtoRevEnabledResponse = { }; } }; +GlobalDecoderRegistry.register(QueryGetProtoRevEnabledResponse.typeUrl, QueryGetProtoRevEnabledResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryGetProtoRevEnabledResponse.aminoType, QueryGetProtoRevEnabledResponse.typeUrl); function createBaseQueryGetProtoRevPoolRequest(): QueryGetProtoRevPoolRequest { return { baseDenom: "", @@ -2628,6 +3298,16 @@ function createBaseQueryGetProtoRevPoolRequest(): QueryGetProtoRevPoolRequest { } export const QueryGetProtoRevPoolRequest = { typeUrl: "/osmosis.protorev.v1beta1.QueryGetProtoRevPoolRequest", + aminoType: "osmosis/protorev/query-get-proto-rev-pool-request", + is(o: any): o is QueryGetProtoRevPoolRequest { + return o && (o.$typeUrl === QueryGetProtoRevPoolRequest.typeUrl || typeof o.baseDenom === "string" && typeof o.otherDenom === "string"); + }, + isSDK(o: any): o is QueryGetProtoRevPoolRequestSDKType { + return o && (o.$typeUrl === QueryGetProtoRevPoolRequest.typeUrl || typeof o.base_denom === "string" && typeof o.other_denom === "string"); + }, + isAmino(o: any): o is QueryGetProtoRevPoolRequestAmino { + return o && (o.$typeUrl === QueryGetProtoRevPoolRequest.typeUrl || typeof o.base_denom === "string" && typeof o.other_denom === "string"); + }, encode(message: QueryGetProtoRevPoolRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.baseDenom !== "") { writer.uint32(10).string(message.baseDenom); @@ -2657,6 +3337,18 @@ export const QueryGetProtoRevPoolRequest = { } return message; }, + fromJSON(object: any): QueryGetProtoRevPoolRequest { + return { + baseDenom: isSet(object.baseDenom) ? String(object.baseDenom) : "", + otherDenom: isSet(object.otherDenom) ? String(object.otherDenom) : "" + }; + }, + toJSON(message: QueryGetProtoRevPoolRequest): unknown { + const obj: any = {}; + message.baseDenom !== undefined && (obj.baseDenom = message.baseDenom); + message.otherDenom !== undefined && (obj.otherDenom = message.otherDenom); + return obj; + }, fromPartial(object: Partial): QueryGetProtoRevPoolRequest { const message = createBaseQueryGetProtoRevPoolRequest(); message.baseDenom = object.baseDenom ?? ""; @@ -2664,10 +3356,14 @@ export const QueryGetProtoRevPoolRequest = { return message; }, fromAmino(object: QueryGetProtoRevPoolRequestAmino): QueryGetProtoRevPoolRequest { - return { - baseDenom: object.base_denom, - otherDenom: object.other_denom - }; + const message = createBaseQueryGetProtoRevPoolRequest(); + if (object.base_denom !== undefined && object.base_denom !== null) { + message.baseDenom = object.base_denom; + } + if (object.other_denom !== undefined && object.other_denom !== null) { + message.otherDenom = object.other_denom; + } + return message; }, toAmino(message: QueryGetProtoRevPoolRequest): QueryGetProtoRevPoolRequestAmino { const obj: any = {}; @@ -2697,6 +3393,8 @@ export const QueryGetProtoRevPoolRequest = { }; } }; +GlobalDecoderRegistry.register(QueryGetProtoRevPoolRequest.typeUrl, QueryGetProtoRevPoolRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryGetProtoRevPoolRequest.aminoType, QueryGetProtoRevPoolRequest.typeUrl); function createBaseQueryGetProtoRevPoolResponse(): QueryGetProtoRevPoolResponse { return { poolId: BigInt(0) @@ -2704,6 +3402,16 @@ function createBaseQueryGetProtoRevPoolResponse(): QueryGetProtoRevPoolResponse } export const QueryGetProtoRevPoolResponse = { typeUrl: "/osmosis.protorev.v1beta1.QueryGetProtoRevPoolResponse", + aminoType: "osmosis/protorev/query-get-proto-rev-pool-response", + is(o: any): o is QueryGetProtoRevPoolResponse { + return o && (o.$typeUrl === QueryGetProtoRevPoolResponse.typeUrl || typeof o.poolId === "bigint"); + }, + isSDK(o: any): o is QueryGetProtoRevPoolResponseSDKType { + return o && (o.$typeUrl === QueryGetProtoRevPoolResponse.typeUrl || typeof o.pool_id === "bigint"); + }, + isAmino(o: any): o is QueryGetProtoRevPoolResponseAmino { + return o && (o.$typeUrl === QueryGetProtoRevPoolResponse.typeUrl || typeof o.pool_id === "bigint"); + }, encode(message: QueryGetProtoRevPoolResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.poolId !== BigInt(0)) { writer.uint32(8).uint64(message.poolId); @@ -2727,15 +3435,27 @@ export const QueryGetProtoRevPoolResponse = { } return message; }, + fromJSON(object: any): QueryGetProtoRevPoolResponse { + return { + poolId: isSet(object.poolId) ? BigInt(object.poolId.toString()) : BigInt(0) + }; + }, + toJSON(message: QueryGetProtoRevPoolResponse): unknown { + const obj: any = {}; + message.poolId !== undefined && (obj.poolId = (message.poolId || BigInt(0)).toString()); + return obj; + }, fromPartial(object: Partial): QueryGetProtoRevPoolResponse { const message = createBaseQueryGetProtoRevPoolResponse(); message.poolId = object.poolId !== undefined && object.poolId !== null ? BigInt(object.poolId.toString()) : BigInt(0); return message; }, fromAmino(object: QueryGetProtoRevPoolResponseAmino): QueryGetProtoRevPoolResponse { - return { - poolId: BigInt(object.pool_id) - }; + const message = createBaseQueryGetProtoRevPoolResponse(); + if (object.pool_id !== undefined && object.pool_id !== null) { + message.poolId = BigInt(object.pool_id); + } + return message; }, toAmino(message: QueryGetProtoRevPoolResponse): QueryGetProtoRevPoolResponseAmino { const obj: any = {}; @@ -2763,4 +3483,172 @@ export const QueryGetProtoRevPoolResponse = { value: QueryGetProtoRevPoolResponse.encode(message).finish() }; } -}; \ No newline at end of file +}; +GlobalDecoderRegistry.register(QueryGetProtoRevPoolResponse.typeUrl, QueryGetProtoRevPoolResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryGetProtoRevPoolResponse.aminoType, QueryGetProtoRevPoolResponse.typeUrl); +function createBaseQueryGetAllProtocolRevenueRequest(): QueryGetAllProtocolRevenueRequest { + return {}; +} +export const QueryGetAllProtocolRevenueRequest = { + typeUrl: "/osmosis.protorev.v1beta1.QueryGetAllProtocolRevenueRequest", + aminoType: "osmosis/protorev/query-get-all-protocol-revenue-request", + is(o: any): o is QueryGetAllProtocolRevenueRequest { + return o && o.$typeUrl === QueryGetAllProtocolRevenueRequest.typeUrl; + }, + isSDK(o: any): o is QueryGetAllProtocolRevenueRequestSDKType { + return o && o.$typeUrl === QueryGetAllProtocolRevenueRequest.typeUrl; + }, + isAmino(o: any): o is QueryGetAllProtocolRevenueRequestAmino { + return o && o.$typeUrl === QueryGetAllProtocolRevenueRequest.typeUrl; + }, + encode(_: QueryGetAllProtocolRevenueRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryGetAllProtocolRevenueRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryGetAllProtocolRevenueRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(_: any): QueryGetAllProtocolRevenueRequest { + return {}; + }, + toJSON(_: QueryGetAllProtocolRevenueRequest): unknown { + const obj: any = {}; + return obj; + }, + fromPartial(_: Partial): QueryGetAllProtocolRevenueRequest { + const message = createBaseQueryGetAllProtocolRevenueRequest(); + return message; + }, + fromAmino(_: QueryGetAllProtocolRevenueRequestAmino): QueryGetAllProtocolRevenueRequest { + const message = createBaseQueryGetAllProtocolRevenueRequest(); + return message; + }, + toAmino(_: QueryGetAllProtocolRevenueRequest): QueryGetAllProtocolRevenueRequestAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: QueryGetAllProtocolRevenueRequestAminoMsg): QueryGetAllProtocolRevenueRequest { + return QueryGetAllProtocolRevenueRequest.fromAmino(object.value); + }, + toAminoMsg(message: QueryGetAllProtocolRevenueRequest): QueryGetAllProtocolRevenueRequestAminoMsg { + return { + type: "osmosis/protorev/query-get-all-protocol-revenue-request", + value: QueryGetAllProtocolRevenueRequest.toAmino(message) + }; + }, + fromProtoMsg(message: QueryGetAllProtocolRevenueRequestProtoMsg): QueryGetAllProtocolRevenueRequest { + return QueryGetAllProtocolRevenueRequest.decode(message.value); + }, + toProto(message: QueryGetAllProtocolRevenueRequest): Uint8Array { + return QueryGetAllProtocolRevenueRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryGetAllProtocolRevenueRequest): QueryGetAllProtocolRevenueRequestProtoMsg { + return { + typeUrl: "/osmosis.protorev.v1beta1.QueryGetAllProtocolRevenueRequest", + value: QueryGetAllProtocolRevenueRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryGetAllProtocolRevenueRequest.typeUrl, QueryGetAllProtocolRevenueRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryGetAllProtocolRevenueRequest.aminoType, QueryGetAllProtocolRevenueRequest.typeUrl); +function createBaseQueryGetAllProtocolRevenueResponse(): QueryGetAllProtocolRevenueResponse { + return { + allProtocolRevenue: AllProtocolRevenue.fromPartial({}) + }; +} +export const QueryGetAllProtocolRevenueResponse = { + typeUrl: "/osmosis.protorev.v1beta1.QueryGetAllProtocolRevenueResponse", + aminoType: "osmosis/protorev/query-get-all-protocol-revenue-response", + is(o: any): o is QueryGetAllProtocolRevenueResponse { + return o && (o.$typeUrl === QueryGetAllProtocolRevenueResponse.typeUrl || AllProtocolRevenue.is(o.allProtocolRevenue)); + }, + isSDK(o: any): o is QueryGetAllProtocolRevenueResponseSDKType { + return o && (o.$typeUrl === QueryGetAllProtocolRevenueResponse.typeUrl || AllProtocolRevenue.isSDK(o.all_protocol_revenue)); + }, + isAmino(o: any): o is QueryGetAllProtocolRevenueResponseAmino { + return o && (o.$typeUrl === QueryGetAllProtocolRevenueResponse.typeUrl || AllProtocolRevenue.isAmino(o.all_protocol_revenue)); + }, + encode(message: QueryGetAllProtocolRevenueResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.allProtocolRevenue !== undefined) { + AllProtocolRevenue.encode(message.allProtocolRevenue, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryGetAllProtocolRevenueResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryGetAllProtocolRevenueResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.allProtocolRevenue = AllProtocolRevenue.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): QueryGetAllProtocolRevenueResponse { + return { + allProtocolRevenue: isSet(object.allProtocolRevenue) ? AllProtocolRevenue.fromJSON(object.allProtocolRevenue) : undefined + }; + }, + toJSON(message: QueryGetAllProtocolRevenueResponse): unknown { + const obj: any = {}; + message.allProtocolRevenue !== undefined && (obj.allProtocolRevenue = message.allProtocolRevenue ? AllProtocolRevenue.toJSON(message.allProtocolRevenue) : undefined); + return obj; + }, + fromPartial(object: Partial): QueryGetAllProtocolRevenueResponse { + const message = createBaseQueryGetAllProtocolRevenueResponse(); + message.allProtocolRevenue = object.allProtocolRevenue !== undefined && object.allProtocolRevenue !== null ? AllProtocolRevenue.fromPartial(object.allProtocolRevenue) : undefined; + return message; + }, + fromAmino(object: QueryGetAllProtocolRevenueResponseAmino): QueryGetAllProtocolRevenueResponse { + const message = createBaseQueryGetAllProtocolRevenueResponse(); + if (object.all_protocol_revenue !== undefined && object.all_protocol_revenue !== null) { + message.allProtocolRevenue = AllProtocolRevenue.fromAmino(object.all_protocol_revenue); + } + return message; + }, + toAmino(message: QueryGetAllProtocolRevenueResponse): QueryGetAllProtocolRevenueResponseAmino { + const obj: any = {}; + obj.all_protocol_revenue = message.allProtocolRevenue ? AllProtocolRevenue.toAmino(message.allProtocolRevenue) : undefined; + return obj; + }, + fromAminoMsg(object: QueryGetAllProtocolRevenueResponseAminoMsg): QueryGetAllProtocolRevenueResponse { + return QueryGetAllProtocolRevenueResponse.fromAmino(object.value); + }, + toAminoMsg(message: QueryGetAllProtocolRevenueResponse): QueryGetAllProtocolRevenueResponseAminoMsg { + return { + type: "osmosis/protorev/query-get-all-protocol-revenue-response", + value: QueryGetAllProtocolRevenueResponse.toAmino(message) + }; + }, + fromProtoMsg(message: QueryGetAllProtocolRevenueResponseProtoMsg): QueryGetAllProtocolRevenueResponse { + return QueryGetAllProtocolRevenueResponse.decode(message.value); + }, + toProto(message: QueryGetAllProtocolRevenueResponse): Uint8Array { + return QueryGetAllProtocolRevenueResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryGetAllProtocolRevenueResponse): QueryGetAllProtocolRevenueResponseProtoMsg { + return { + typeUrl: "/osmosis.protorev.v1beta1.QueryGetAllProtocolRevenueResponse", + value: QueryGetAllProtocolRevenueResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryGetAllProtocolRevenueResponse.typeUrl, QueryGetAllProtocolRevenueResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryGetAllProtocolRevenueResponse.aminoType, QueryGetAllProtocolRevenueResponse.typeUrl); \ No newline at end of file diff --git a/packages/osmojs/src/codegen/osmosis/protorev/v1beta1/tx.amino.ts b/packages/osmojs/src/codegen/osmosis/protorev/v1beta1/tx.amino.ts index 663139a35..7630b1658 100644 --- a/packages/osmojs/src/codegen/osmosis/protorev/v1beta1/tx.amino.ts +++ b/packages/osmojs/src/codegen/osmosis/protorev/v1beta1/tx.amino.ts @@ -1,5 +1,5 @@ //@ts-nocheck -import { MsgSetHotRoutes, MsgSetDeveloperAccount, MsgSetMaxPoolPointsPerTx, MsgSetMaxPoolPointsPerBlock, MsgSetPoolWeights, MsgSetBaseDenoms } from "./tx"; +import { MsgSetHotRoutes, MsgSetDeveloperAccount, MsgSetMaxPoolPointsPerTx, MsgSetMaxPoolPointsPerBlock, MsgSetInfoByPoolType, MsgSetBaseDenoms } from "./tx"; export const AminoConverter = { "/osmosis.protorev.v1beta1.MsgSetHotRoutes": { aminoType: "osmosis/MsgSetHotRoutes", @@ -12,22 +12,22 @@ export const AminoConverter = { fromAmino: MsgSetDeveloperAccount.fromAmino }, "/osmosis.protorev.v1beta1.MsgSetMaxPoolPointsPerTx": { - aminoType: "osmosis/protorev/set-max-pool-points-per-tx", + aminoType: "osmosis/MsgSetMaxPoolPointsPerTx", toAmino: MsgSetMaxPoolPointsPerTx.toAmino, fromAmino: MsgSetMaxPoolPointsPerTx.fromAmino }, "/osmosis.protorev.v1beta1.MsgSetMaxPoolPointsPerBlock": { - aminoType: "osmosis/protorev/set-max-pool-points-per-block", + aminoType: "osmosis/MsgSetPoolWeights", toAmino: MsgSetMaxPoolPointsPerBlock.toAmino, fromAmino: MsgSetMaxPoolPointsPerBlock.fromAmino }, - "/osmosis.protorev.v1beta1.MsgSetPoolWeights": { - aminoType: "osmosis/protorev/set-pool-weights", - toAmino: MsgSetPoolWeights.toAmino, - fromAmino: MsgSetPoolWeights.fromAmino + "/osmosis.protorev.v1beta1.MsgSetInfoByPoolType": { + aminoType: "osmosis/MsgSetInfoByPoolType", + toAmino: MsgSetInfoByPoolType.toAmino, + fromAmino: MsgSetInfoByPoolType.fromAmino }, "/osmosis.protorev.v1beta1.MsgSetBaseDenoms": { - aminoType: "osmosis/protorev/set-base-denoms", + aminoType: "osmosis/MsgSetBaseDenoms", toAmino: MsgSetBaseDenoms.toAmino, fromAmino: MsgSetBaseDenoms.fromAmino } diff --git a/packages/osmojs/src/codegen/osmosis/protorev/v1beta1/tx.registry.ts b/packages/osmojs/src/codegen/osmosis/protorev/v1beta1/tx.registry.ts index 7d2966ea5..1182d0b10 100644 --- a/packages/osmojs/src/codegen/osmosis/protorev/v1beta1/tx.registry.ts +++ b/packages/osmojs/src/codegen/osmosis/protorev/v1beta1/tx.registry.ts @@ -1,7 +1,7 @@ //@ts-nocheck import { GeneratedType, Registry } from "@cosmjs/proto-signing"; -import { MsgSetHotRoutes, MsgSetDeveloperAccount, MsgSetMaxPoolPointsPerTx, MsgSetMaxPoolPointsPerBlock, MsgSetPoolWeights, MsgSetBaseDenoms } from "./tx"; -export const registry: ReadonlyArray<[string, GeneratedType]> = [["/osmosis.protorev.v1beta1.MsgSetHotRoutes", MsgSetHotRoutes], ["/osmosis.protorev.v1beta1.MsgSetDeveloperAccount", MsgSetDeveloperAccount], ["/osmosis.protorev.v1beta1.MsgSetMaxPoolPointsPerTx", MsgSetMaxPoolPointsPerTx], ["/osmosis.protorev.v1beta1.MsgSetMaxPoolPointsPerBlock", MsgSetMaxPoolPointsPerBlock], ["/osmosis.protorev.v1beta1.MsgSetPoolWeights", MsgSetPoolWeights], ["/osmosis.protorev.v1beta1.MsgSetBaseDenoms", MsgSetBaseDenoms]]; +import { MsgSetHotRoutes, MsgSetDeveloperAccount, MsgSetMaxPoolPointsPerTx, MsgSetMaxPoolPointsPerBlock, MsgSetInfoByPoolType, MsgSetBaseDenoms } from "./tx"; +export const registry: ReadonlyArray<[string, GeneratedType]> = [["/osmosis.protorev.v1beta1.MsgSetHotRoutes", MsgSetHotRoutes], ["/osmosis.protorev.v1beta1.MsgSetDeveloperAccount", MsgSetDeveloperAccount], ["/osmosis.protorev.v1beta1.MsgSetMaxPoolPointsPerTx", MsgSetMaxPoolPointsPerTx], ["/osmosis.protorev.v1beta1.MsgSetMaxPoolPointsPerBlock", MsgSetMaxPoolPointsPerBlock], ["/osmosis.protorev.v1beta1.MsgSetInfoByPoolType", MsgSetInfoByPoolType], ["/osmosis.protorev.v1beta1.MsgSetBaseDenoms", MsgSetBaseDenoms]]; export const load = (protoRegistry: Registry) => { registry.forEach(([typeUrl, mod]) => { protoRegistry.register(typeUrl, mod); @@ -33,10 +33,10 @@ export const MessageComposer = { value: MsgSetMaxPoolPointsPerBlock.encode(value).finish() }; }, - setPoolWeights(value: MsgSetPoolWeights) { + setInfoByPoolType(value: MsgSetInfoByPoolType) { return { - typeUrl: "/osmosis.protorev.v1beta1.MsgSetPoolWeights", - value: MsgSetPoolWeights.encode(value).finish() + typeUrl: "/osmosis.protorev.v1beta1.MsgSetInfoByPoolType", + value: MsgSetInfoByPoolType.encode(value).finish() }; }, setBaseDenoms(value: MsgSetBaseDenoms) { @@ -71,9 +71,9 @@ export const MessageComposer = { value }; }, - setPoolWeights(value: MsgSetPoolWeights) { + setInfoByPoolType(value: MsgSetInfoByPoolType) { return { - typeUrl: "/osmosis.protorev.v1beta1.MsgSetPoolWeights", + typeUrl: "/osmosis.protorev.v1beta1.MsgSetInfoByPoolType", value }; }, @@ -84,6 +84,82 @@ export const MessageComposer = { }; } }, + toJSON: { + setHotRoutes(value: MsgSetHotRoutes) { + return { + typeUrl: "/osmosis.protorev.v1beta1.MsgSetHotRoutes", + value: MsgSetHotRoutes.toJSON(value) + }; + }, + setDeveloperAccount(value: MsgSetDeveloperAccount) { + return { + typeUrl: "/osmosis.protorev.v1beta1.MsgSetDeveloperAccount", + value: MsgSetDeveloperAccount.toJSON(value) + }; + }, + setMaxPoolPointsPerTx(value: MsgSetMaxPoolPointsPerTx) { + return { + typeUrl: "/osmosis.protorev.v1beta1.MsgSetMaxPoolPointsPerTx", + value: MsgSetMaxPoolPointsPerTx.toJSON(value) + }; + }, + setMaxPoolPointsPerBlock(value: MsgSetMaxPoolPointsPerBlock) { + return { + typeUrl: "/osmosis.protorev.v1beta1.MsgSetMaxPoolPointsPerBlock", + value: MsgSetMaxPoolPointsPerBlock.toJSON(value) + }; + }, + setInfoByPoolType(value: MsgSetInfoByPoolType) { + return { + typeUrl: "/osmosis.protorev.v1beta1.MsgSetInfoByPoolType", + value: MsgSetInfoByPoolType.toJSON(value) + }; + }, + setBaseDenoms(value: MsgSetBaseDenoms) { + return { + typeUrl: "/osmosis.protorev.v1beta1.MsgSetBaseDenoms", + value: MsgSetBaseDenoms.toJSON(value) + }; + } + }, + fromJSON: { + setHotRoutes(value: any) { + return { + typeUrl: "/osmosis.protorev.v1beta1.MsgSetHotRoutes", + value: MsgSetHotRoutes.fromJSON(value) + }; + }, + setDeveloperAccount(value: any) { + return { + typeUrl: "/osmosis.protorev.v1beta1.MsgSetDeveloperAccount", + value: MsgSetDeveloperAccount.fromJSON(value) + }; + }, + setMaxPoolPointsPerTx(value: any) { + return { + typeUrl: "/osmosis.protorev.v1beta1.MsgSetMaxPoolPointsPerTx", + value: MsgSetMaxPoolPointsPerTx.fromJSON(value) + }; + }, + setMaxPoolPointsPerBlock(value: any) { + return { + typeUrl: "/osmosis.protorev.v1beta1.MsgSetMaxPoolPointsPerBlock", + value: MsgSetMaxPoolPointsPerBlock.fromJSON(value) + }; + }, + setInfoByPoolType(value: any) { + return { + typeUrl: "/osmosis.protorev.v1beta1.MsgSetInfoByPoolType", + value: MsgSetInfoByPoolType.fromJSON(value) + }; + }, + setBaseDenoms(value: any) { + return { + typeUrl: "/osmosis.protorev.v1beta1.MsgSetBaseDenoms", + value: MsgSetBaseDenoms.fromJSON(value) + }; + } + }, fromPartial: { setHotRoutes(value: MsgSetHotRoutes) { return { @@ -109,10 +185,10 @@ export const MessageComposer = { value: MsgSetMaxPoolPointsPerBlock.fromPartial(value) }; }, - setPoolWeights(value: MsgSetPoolWeights) { + setInfoByPoolType(value: MsgSetInfoByPoolType) { return { - typeUrl: "/osmosis.protorev.v1beta1.MsgSetPoolWeights", - value: MsgSetPoolWeights.fromPartial(value) + typeUrl: "/osmosis.protorev.v1beta1.MsgSetInfoByPoolType", + value: MsgSetInfoByPoolType.fromPartial(value) }; }, setBaseDenoms(value: MsgSetBaseDenoms) { diff --git a/packages/osmojs/src/codegen/osmosis/protorev/v1beta1/tx.rpc.msg.ts b/packages/osmojs/src/codegen/osmosis/protorev/v1beta1/tx.rpc.msg.ts index 2b1409f5e..8b8b8204d 100644 --- a/packages/osmojs/src/codegen/osmosis/protorev/v1beta1/tx.rpc.msg.ts +++ b/packages/osmojs/src/codegen/osmosis/protorev/v1beta1/tx.rpc.msg.ts @@ -1,6 +1,6 @@ import { Rpc } from "../../../helpers"; import { BinaryReader } from "../../../binary"; -import { MsgSetHotRoutes, MsgSetHotRoutesResponse, MsgSetDeveloperAccount, MsgSetDeveloperAccountResponse, MsgSetMaxPoolPointsPerTx, MsgSetMaxPoolPointsPerTxResponse, MsgSetMaxPoolPointsPerBlock, MsgSetMaxPoolPointsPerBlockResponse, MsgSetPoolWeights, MsgSetPoolWeightsResponse, MsgSetBaseDenoms, MsgSetBaseDenomsResponse } from "./tx"; +import { MsgSetHotRoutes, MsgSetHotRoutesResponse, MsgSetDeveloperAccount, MsgSetDeveloperAccountResponse, MsgSetMaxPoolPointsPerTx, MsgSetMaxPoolPointsPerTxResponse, MsgSetMaxPoolPointsPerBlock, MsgSetMaxPoolPointsPerBlockResponse, MsgSetInfoByPoolType, MsgSetInfoByPoolTypeResponse, MsgSetBaseDenoms, MsgSetBaseDenomsResponse } from "./tx"; export interface Msg { /** * SetHotRoutes sets the hot routes that will be explored when creating @@ -23,10 +23,10 @@ export interface Msg { */ setMaxPoolPointsPerBlock(request: MsgSetMaxPoolPointsPerBlock): Promise; /** - * SetPoolWeights sets the weights of each pool type in the store. Can only be - * called by the admin account. + * SetInfoByPoolType sets the pool type information needed to make smart + * assumptions about swapping on different pool types */ - setPoolWeights(request: MsgSetPoolWeights): Promise; + setInfoByPoolType(request: MsgSetInfoByPoolType): Promise; /** * SetBaseDenoms sets the base denoms that will be used to create cyclic * arbitrage routes. Can only be called by the admin account. @@ -41,7 +41,7 @@ export class MsgClientImpl implements Msg { this.setDeveloperAccount = this.setDeveloperAccount.bind(this); this.setMaxPoolPointsPerTx = this.setMaxPoolPointsPerTx.bind(this); this.setMaxPoolPointsPerBlock = this.setMaxPoolPointsPerBlock.bind(this); - this.setPoolWeights = this.setPoolWeights.bind(this); + this.setInfoByPoolType = this.setInfoByPoolType.bind(this); this.setBaseDenoms = this.setBaseDenoms.bind(this); } setHotRoutes(request: MsgSetHotRoutes): Promise { @@ -64,14 +64,17 @@ export class MsgClientImpl implements Msg { const promise = this.rpc.request("osmosis.protorev.v1beta1.Msg", "SetMaxPoolPointsPerBlock", data); return promise.then(data => MsgSetMaxPoolPointsPerBlockResponse.decode(new BinaryReader(data))); } - setPoolWeights(request: MsgSetPoolWeights): Promise { - const data = MsgSetPoolWeights.encode(request).finish(); - const promise = this.rpc.request("osmosis.protorev.v1beta1.Msg", "SetPoolWeights", data); - return promise.then(data => MsgSetPoolWeightsResponse.decode(new BinaryReader(data))); + setInfoByPoolType(request: MsgSetInfoByPoolType): Promise { + const data = MsgSetInfoByPoolType.encode(request).finish(); + const promise = this.rpc.request("osmosis.protorev.v1beta1.Msg", "SetInfoByPoolType", data); + return promise.then(data => MsgSetInfoByPoolTypeResponse.decode(new BinaryReader(data))); } setBaseDenoms(request: MsgSetBaseDenoms): Promise { const data = MsgSetBaseDenoms.encode(request).finish(); const promise = this.rpc.request("osmosis.protorev.v1beta1.Msg", "SetBaseDenoms", data); return promise.then(data => MsgSetBaseDenomsResponse.decode(new BinaryReader(data))); } -} \ No newline at end of file +} +export const createClientImpl = (rpc: Rpc) => { + return new MsgClientImpl(rpc); +}; \ No newline at end of file diff --git a/packages/osmojs/src/codegen/osmosis/protorev/v1beta1/tx.ts b/packages/osmojs/src/codegen/osmosis/protorev/v1beta1/tx.ts index 8765d09c6..df1528ad0 100644 --- a/packages/osmojs/src/codegen/osmosis/protorev/v1beta1/tx.ts +++ b/packages/osmojs/src/codegen/osmosis/protorev/v1beta1/tx.ts @@ -1,5 +1,7 @@ -import { TokenPairArbRoutes, TokenPairArbRoutesAmino, TokenPairArbRoutesSDKType, PoolWeights, PoolWeightsAmino, PoolWeightsSDKType, BaseDenom, BaseDenomAmino, BaseDenomSDKType } from "./protorev"; +import { TokenPairArbRoutes, TokenPairArbRoutesAmino, TokenPairArbRoutesSDKType, InfoByPoolType, InfoByPoolTypeAmino, InfoByPoolTypeSDKType, BaseDenom, BaseDenomAmino, BaseDenomSDKType } from "./protorev"; import { BinaryReader, BinaryWriter } from "../../../binary"; +import { isSet } from "../../../helpers"; +import { GlobalDecoderRegistry } from "../../../registry"; /** MsgSetHotRoutes defines the Msg/SetHotRoutes request type. */ export interface MsgSetHotRoutes { /** admin is the account that is authorized to set the hot routes. */ @@ -14,9 +16,9 @@ export interface MsgSetHotRoutesProtoMsg { /** MsgSetHotRoutes defines the Msg/SetHotRoutes request type. */ export interface MsgSetHotRoutesAmino { /** admin is the account that is authorized to set the hot routes. */ - admin: string; + admin?: string; /** hot_routes is the list of hot routes to set. */ - hot_routes: TokenPairArbRoutesAmino[]; + hot_routes?: TokenPairArbRoutesAmino[]; } export interface MsgSetHotRoutesAminoMsg { type: "osmosis/MsgSetHotRoutes"; @@ -58,12 +60,12 @@ export interface MsgSetDeveloperAccountProtoMsg { /** MsgSetDeveloperAccount defines the Msg/SetDeveloperAccount request type. */ export interface MsgSetDeveloperAccountAmino { /** admin is the account that is authorized to set the developer account. */ - admin: string; + admin?: string; /** * developer_account is the account that will receive a portion of the profits * from the protorev module. */ - developer_account: string; + developer_account?: string; } export interface MsgSetDeveloperAccountAminoMsg { type: "osmosis/MsgSetDeveloperAccount"; @@ -97,47 +99,47 @@ export interface MsgSetDeveloperAccountResponseAminoMsg { * type. */ export interface MsgSetDeveloperAccountResponseSDKType {} -/** MsgSetPoolWeights defines the Msg/SetPoolWeights request type. */ -export interface MsgSetPoolWeights { +/** MsgSetInfoByPoolType defines the Msg/SetInfoByPoolType request type. */ +export interface MsgSetInfoByPoolType { /** admin is the account that is authorized to set the pool weights. */ admin: string; - /** pool_weights is the list of pool weights to set. */ - poolWeights: PoolWeights; + /** info_by_pool_type contains information about the pool types. */ + infoByPoolType: InfoByPoolType; } -export interface MsgSetPoolWeightsProtoMsg { - typeUrl: "/osmosis.protorev.v1beta1.MsgSetPoolWeights"; +export interface MsgSetInfoByPoolTypeProtoMsg { + typeUrl: "/osmosis.protorev.v1beta1.MsgSetInfoByPoolType"; value: Uint8Array; } -/** MsgSetPoolWeights defines the Msg/SetPoolWeights request type. */ -export interface MsgSetPoolWeightsAmino { +/** MsgSetInfoByPoolType defines the Msg/SetInfoByPoolType request type. */ +export interface MsgSetInfoByPoolTypeAmino { /** admin is the account that is authorized to set the pool weights. */ - admin: string; - /** pool_weights is the list of pool weights to set. */ - pool_weights?: PoolWeightsAmino; + admin?: string; + /** info_by_pool_type contains information about the pool types. */ + info_by_pool_type?: InfoByPoolTypeAmino; } -export interface MsgSetPoolWeightsAminoMsg { - type: "osmosis/protorev/set-pool-weights"; - value: MsgSetPoolWeightsAmino; +export interface MsgSetInfoByPoolTypeAminoMsg { + type: "osmosis/MsgSetInfoByPoolType"; + value: MsgSetInfoByPoolTypeAmino; } -/** MsgSetPoolWeights defines the Msg/SetPoolWeights request type. */ -export interface MsgSetPoolWeightsSDKType { +/** MsgSetInfoByPoolType defines the Msg/SetInfoByPoolType request type. */ +export interface MsgSetInfoByPoolTypeSDKType { admin: string; - pool_weights: PoolWeightsSDKType; + info_by_pool_type: InfoByPoolTypeSDKType; } -/** MsgSetPoolWeightsResponse defines the Msg/SetPoolWeights response type. */ -export interface MsgSetPoolWeightsResponse {} -export interface MsgSetPoolWeightsResponseProtoMsg { - typeUrl: "/osmosis.protorev.v1beta1.MsgSetPoolWeightsResponse"; +/** MsgSetInfoByPoolTypeResponse defines the Msg/SetInfoByPoolType response type. */ +export interface MsgSetInfoByPoolTypeResponse {} +export interface MsgSetInfoByPoolTypeResponseProtoMsg { + typeUrl: "/osmosis.protorev.v1beta1.MsgSetInfoByPoolTypeResponse"; value: Uint8Array; } -/** MsgSetPoolWeightsResponse defines the Msg/SetPoolWeights response type. */ -export interface MsgSetPoolWeightsResponseAmino {} -export interface MsgSetPoolWeightsResponseAminoMsg { - type: "osmosis/protorev/set-pool-weights-response"; - value: MsgSetPoolWeightsResponseAmino; +/** MsgSetInfoByPoolTypeResponse defines the Msg/SetInfoByPoolType response type. */ +export interface MsgSetInfoByPoolTypeResponseAmino {} +export interface MsgSetInfoByPoolTypeResponseAminoMsg { + type: "osmosis/protorev/set-info-by-pool-type-response"; + value: MsgSetInfoByPoolTypeResponseAmino; } -/** MsgSetPoolWeightsResponse defines the Msg/SetPoolWeights response type. */ -export interface MsgSetPoolWeightsResponseSDKType {} +/** MsgSetInfoByPoolTypeResponse defines the Msg/SetInfoByPoolType response type. */ +export interface MsgSetInfoByPoolTypeResponseSDKType {} /** MsgSetMaxPoolPointsPerTx defines the Msg/SetMaxPoolPointsPerTx request type. */ export interface MsgSetMaxPoolPointsPerTx { /** admin is the account that is authorized to set the max pool points per tx. */ @@ -155,15 +157,15 @@ export interface MsgSetMaxPoolPointsPerTxProtoMsg { /** MsgSetMaxPoolPointsPerTx defines the Msg/SetMaxPoolPointsPerTx request type. */ export interface MsgSetMaxPoolPointsPerTxAmino { /** admin is the account that is authorized to set the max pool points per tx. */ - admin: string; + admin?: string; /** * max_pool_points_per_tx is the maximum number of pool points that can be * consumed per transaction. */ - max_pool_points_per_tx: string; + max_pool_points_per_tx?: string; } export interface MsgSetMaxPoolPointsPerTxAminoMsg { - type: "osmosis/protorev/set-max-pool-points-per-tx"; + type: "osmosis/MsgSetMaxPoolPointsPerTx"; value: MsgSetMaxPoolPointsPerTxAmino; } /** MsgSetMaxPoolPointsPerTx defines the Msg/SetMaxPoolPointsPerTx request type. */ @@ -223,15 +225,15 @@ export interface MsgSetMaxPoolPointsPerBlockAmino { * admin is the account that is authorized to set the max pool points per * block. */ - admin: string; + admin?: string; /** * max_pool_points_per_block is the maximum number of pool points that can be * consumed per block. */ - max_pool_points_per_block: string; + max_pool_points_per_block?: string; } export interface MsgSetMaxPoolPointsPerBlockAminoMsg { - type: "osmosis/protorev/set-max-pool-points-per-block"; + type: "osmosis/MsgSetPoolWeights"; value: MsgSetMaxPoolPointsPerBlockAmino; } /** @@ -279,12 +281,12 @@ export interface MsgSetBaseDenomsProtoMsg { /** MsgSetBaseDenoms defines the Msg/SetBaseDenoms request type. */ export interface MsgSetBaseDenomsAmino { /** admin is the account that is authorized to set the base denoms. */ - admin: string; + admin?: string; /** base_denoms is the list of base denoms to set. */ - base_denoms: BaseDenomAmino[]; + base_denoms?: BaseDenomAmino[]; } export interface MsgSetBaseDenomsAminoMsg { - type: "osmosis/protorev/set-base-denoms"; + type: "osmosis/MsgSetBaseDenoms"; value: MsgSetBaseDenomsAmino; } /** MsgSetBaseDenoms defines the Msg/SetBaseDenoms request type. */ @@ -314,6 +316,16 @@ function createBaseMsgSetHotRoutes(): MsgSetHotRoutes { } export const MsgSetHotRoutes = { typeUrl: "/osmosis.protorev.v1beta1.MsgSetHotRoutes", + aminoType: "osmosis/MsgSetHotRoutes", + is(o: any): o is MsgSetHotRoutes { + return o && (o.$typeUrl === MsgSetHotRoutes.typeUrl || typeof o.admin === "string" && Array.isArray(o.hotRoutes) && (!o.hotRoutes.length || TokenPairArbRoutes.is(o.hotRoutes[0]))); + }, + isSDK(o: any): o is MsgSetHotRoutesSDKType { + return o && (o.$typeUrl === MsgSetHotRoutes.typeUrl || typeof o.admin === "string" && Array.isArray(o.hot_routes) && (!o.hot_routes.length || TokenPairArbRoutes.isSDK(o.hot_routes[0]))); + }, + isAmino(o: any): o is MsgSetHotRoutesAmino { + return o && (o.$typeUrl === MsgSetHotRoutes.typeUrl || typeof o.admin === "string" && Array.isArray(o.hot_routes) && (!o.hot_routes.length || TokenPairArbRoutes.isAmino(o.hot_routes[0]))); + }, encode(message: MsgSetHotRoutes, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.admin !== "") { writer.uint32(10).string(message.admin); @@ -343,6 +355,22 @@ export const MsgSetHotRoutes = { } return message; }, + fromJSON(object: any): MsgSetHotRoutes { + return { + admin: isSet(object.admin) ? String(object.admin) : "", + hotRoutes: Array.isArray(object?.hotRoutes) ? object.hotRoutes.map((e: any) => TokenPairArbRoutes.fromJSON(e)) : [] + }; + }, + toJSON(message: MsgSetHotRoutes): unknown { + const obj: any = {}; + message.admin !== undefined && (obj.admin = message.admin); + if (message.hotRoutes) { + obj.hotRoutes = message.hotRoutes.map(e => e ? TokenPairArbRoutes.toJSON(e) : undefined); + } else { + obj.hotRoutes = []; + } + return obj; + }, fromPartial(object: Partial): MsgSetHotRoutes { const message = createBaseMsgSetHotRoutes(); message.admin = object.admin ?? ""; @@ -350,10 +378,12 @@ export const MsgSetHotRoutes = { return message; }, fromAmino(object: MsgSetHotRoutesAmino): MsgSetHotRoutes { - return { - admin: object.admin, - hotRoutes: Array.isArray(object?.hot_routes) ? object.hot_routes.map((e: any) => TokenPairArbRoutes.fromAmino(e)) : [] - }; + const message = createBaseMsgSetHotRoutes(); + if (object.admin !== undefined && object.admin !== null) { + message.admin = object.admin; + } + message.hotRoutes = object.hot_routes?.map(e => TokenPairArbRoutes.fromAmino(e)) || []; + return message; }, toAmino(message: MsgSetHotRoutes): MsgSetHotRoutesAmino { const obj: any = {}; @@ -387,11 +417,23 @@ export const MsgSetHotRoutes = { }; } }; +GlobalDecoderRegistry.register(MsgSetHotRoutes.typeUrl, MsgSetHotRoutes); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgSetHotRoutes.aminoType, MsgSetHotRoutes.typeUrl); function createBaseMsgSetHotRoutesResponse(): MsgSetHotRoutesResponse { return {}; } export const MsgSetHotRoutesResponse = { typeUrl: "/osmosis.protorev.v1beta1.MsgSetHotRoutesResponse", + aminoType: "osmosis/protorev/set-hot-routes-response", + is(o: any): o is MsgSetHotRoutesResponse { + return o && o.$typeUrl === MsgSetHotRoutesResponse.typeUrl; + }, + isSDK(o: any): o is MsgSetHotRoutesResponseSDKType { + return o && o.$typeUrl === MsgSetHotRoutesResponse.typeUrl; + }, + isAmino(o: any): o is MsgSetHotRoutesResponseAmino { + return o && o.$typeUrl === MsgSetHotRoutesResponse.typeUrl; + }, encode(_: MsgSetHotRoutesResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, @@ -409,12 +451,20 @@ export const MsgSetHotRoutesResponse = { } return message; }, + fromJSON(_: any): MsgSetHotRoutesResponse { + return {}; + }, + toJSON(_: MsgSetHotRoutesResponse): unknown { + const obj: any = {}; + return obj; + }, fromPartial(_: Partial): MsgSetHotRoutesResponse { const message = createBaseMsgSetHotRoutesResponse(); return message; }, fromAmino(_: MsgSetHotRoutesResponseAmino): MsgSetHotRoutesResponse { - return {}; + const message = createBaseMsgSetHotRoutesResponse(); + return message; }, toAmino(_: MsgSetHotRoutesResponse): MsgSetHotRoutesResponseAmino { const obj: any = {}; @@ -442,6 +492,8 @@ export const MsgSetHotRoutesResponse = { }; } }; +GlobalDecoderRegistry.register(MsgSetHotRoutesResponse.typeUrl, MsgSetHotRoutesResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgSetHotRoutesResponse.aminoType, MsgSetHotRoutesResponse.typeUrl); function createBaseMsgSetDeveloperAccount(): MsgSetDeveloperAccount { return { admin: "", @@ -450,6 +502,16 @@ function createBaseMsgSetDeveloperAccount(): MsgSetDeveloperAccount { } export const MsgSetDeveloperAccount = { typeUrl: "/osmosis.protorev.v1beta1.MsgSetDeveloperAccount", + aminoType: "osmosis/MsgSetDeveloperAccount", + is(o: any): o is MsgSetDeveloperAccount { + return o && (o.$typeUrl === MsgSetDeveloperAccount.typeUrl || typeof o.admin === "string" && typeof o.developerAccount === "string"); + }, + isSDK(o: any): o is MsgSetDeveloperAccountSDKType { + return o && (o.$typeUrl === MsgSetDeveloperAccount.typeUrl || typeof o.admin === "string" && typeof o.developer_account === "string"); + }, + isAmino(o: any): o is MsgSetDeveloperAccountAmino { + return o && (o.$typeUrl === MsgSetDeveloperAccount.typeUrl || typeof o.admin === "string" && typeof o.developer_account === "string"); + }, encode(message: MsgSetDeveloperAccount, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.admin !== "") { writer.uint32(10).string(message.admin); @@ -479,6 +541,18 @@ export const MsgSetDeveloperAccount = { } return message; }, + fromJSON(object: any): MsgSetDeveloperAccount { + return { + admin: isSet(object.admin) ? String(object.admin) : "", + developerAccount: isSet(object.developerAccount) ? String(object.developerAccount) : "" + }; + }, + toJSON(message: MsgSetDeveloperAccount): unknown { + const obj: any = {}; + message.admin !== undefined && (obj.admin = message.admin); + message.developerAccount !== undefined && (obj.developerAccount = message.developerAccount); + return obj; + }, fromPartial(object: Partial): MsgSetDeveloperAccount { const message = createBaseMsgSetDeveloperAccount(); message.admin = object.admin ?? ""; @@ -486,10 +560,14 @@ export const MsgSetDeveloperAccount = { return message; }, fromAmino(object: MsgSetDeveloperAccountAmino): MsgSetDeveloperAccount { - return { - admin: object.admin, - developerAccount: object.developer_account - }; + const message = createBaseMsgSetDeveloperAccount(); + if (object.admin !== undefined && object.admin !== null) { + message.admin = object.admin; + } + if (object.developer_account !== undefined && object.developer_account !== null) { + message.developerAccount = object.developer_account; + } + return message; }, toAmino(message: MsgSetDeveloperAccount): MsgSetDeveloperAccountAmino { const obj: any = {}; @@ -519,11 +597,23 @@ export const MsgSetDeveloperAccount = { }; } }; +GlobalDecoderRegistry.register(MsgSetDeveloperAccount.typeUrl, MsgSetDeveloperAccount); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgSetDeveloperAccount.aminoType, MsgSetDeveloperAccount.typeUrl); function createBaseMsgSetDeveloperAccountResponse(): MsgSetDeveloperAccountResponse { return {}; } export const MsgSetDeveloperAccountResponse = { typeUrl: "/osmosis.protorev.v1beta1.MsgSetDeveloperAccountResponse", + aminoType: "osmosis/protorev/set-developer-account-response", + is(o: any): o is MsgSetDeveloperAccountResponse { + return o && o.$typeUrl === MsgSetDeveloperAccountResponse.typeUrl; + }, + isSDK(o: any): o is MsgSetDeveloperAccountResponseSDKType { + return o && o.$typeUrl === MsgSetDeveloperAccountResponse.typeUrl; + }, + isAmino(o: any): o is MsgSetDeveloperAccountResponseAmino { + return o && o.$typeUrl === MsgSetDeveloperAccountResponse.typeUrl; + }, encode(_: MsgSetDeveloperAccountResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, @@ -541,12 +631,20 @@ export const MsgSetDeveloperAccountResponse = { } return message; }, + fromJSON(_: any): MsgSetDeveloperAccountResponse { + return {}; + }, + toJSON(_: MsgSetDeveloperAccountResponse): unknown { + const obj: any = {}; + return obj; + }, fromPartial(_: Partial): MsgSetDeveloperAccountResponse { const message = createBaseMsgSetDeveloperAccountResponse(); return message; }, fromAmino(_: MsgSetDeveloperAccountResponseAmino): MsgSetDeveloperAccountResponse { - return {}; + const message = createBaseMsgSetDeveloperAccountResponse(); + return message; }, toAmino(_: MsgSetDeveloperAccountResponse): MsgSetDeveloperAccountResponseAmino { const obj: any = {}; @@ -574,27 +672,39 @@ export const MsgSetDeveloperAccountResponse = { }; } }; -function createBaseMsgSetPoolWeights(): MsgSetPoolWeights { +GlobalDecoderRegistry.register(MsgSetDeveloperAccountResponse.typeUrl, MsgSetDeveloperAccountResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgSetDeveloperAccountResponse.aminoType, MsgSetDeveloperAccountResponse.typeUrl); +function createBaseMsgSetInfoByPoolType(): MsgSetInfoByPoolType { return { admin: "", - poolWeights: PoolWeights.fromPartial({}) + infoByPoolType: InfoByPoolType.fromPartial({}) }; } -export const MsgSetPoolWeights = { - typeUrl: "/osmosis.protorev.v1beta1.MsgSetPoolWeights", - encode(message: MsgSetPoolWeights, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { +export const MsgSetInfoByPoolType = { + typeUrl: "/osmosis.protorev.v1beta1.MsgSetInfoByPoolType", + aminoType: "osmosis/MsgSetInfoByPoolType", + is(o: any): o is MsgSetInfoByPoolType { + return o && (o.$typeUrl === MsgSetInfoByPoolType.typeUrl || typeof o.admin === "string" && InfoByPoolType.is(o.infoByPoolType)); + }, + isSDK(o: any): o is MsgSetInfoByPoolTypeSDKType { + return o && (o.$typeUrl === MsgSetInfoByPoolType.typeUrl || typeof o.admin === "string" && InfoByPoolType.isSDK(o.info_by_pool_type)); + }, + isAmino(o: any): o is MsgSetInfoByPoolTypeAmino { + return o && (o.$typeUrl === MsgSetInfoByPoolType.typeUrl || typeof o.admin === "string" && InfoByPoolType.isAmino(o.info_by_pool_type)); + }, + encode(message: MsgSetInfoByPoolType, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.admin !== "") { writer.uint32(10).string(message.admin); } - if (message.poolWeights !== undefined) { - PoolWeights.encode(message.poolWeights, writer.uint32(18).fork()).ldelim(); + if (message.infoByPoolType !== undefined) { + InfoByPoolType.encode(message.infoByPoolType, writer.uint32(18).fork()).ldelim(); } return writer; }, - decode(input: BinaryReader | Uint8Array, length?: number): MsgSetPoolWeights { + decode(input: BinaryReader | Uint8Array, length?: number): MsgSetInfoByPoolType { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseMsgSetPoolWeights(); + const message = createBaseMsgSetInfoByPoolType(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -602,7 +712,7 @@ export const MsgSetPoolWeights = { message.admin = reader.string(); break; case 2: - message.poolWeights = PoolWeights.decode(reader, reader.uint32()); + message.infoByPoolType = InfoByPoolType.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -611,58 +721,86 @@ export const MsgSetPoolWeights = { } return message; }, - fromPartial(object: Partial): MsgSetPoolWeights { - const message = createBaseMsgSetPoolWeights(); + fromJSON(object: any): MsgSetInfoByPoolType { + return { + admin: isSet(object.admin) ? String(object.admin) : "", + infoByPoolType: isSet(object.infoByPoolType) ? InfoByPoolType.fromJSON(object.infoByPoolType) : undefined + }; + }, + toJSON(message: MsgSetInfoByPoolType): unknown { + const obj: any = {}; + message.admin !== undefined && (obj.admin = message.admin); + message.infoByPoolType !== undefined && (obj.infoByPoolType = message.infoByPoolType ? InfoByPoolType.toJSON(message.infoByPoolType) : undefined); + return obj; + }, + fromPartial(object: Partial): MsgSetInfoByPoolType { + const message = createBaseMsgSetInfoByPoolType(); message.admin = object.admin ?? ""; - message.poolWeights = object.poolWeights !== undefined && object.poolWeights !== null ? PoolWeights.fromPartial(object.poolWeights) : undefined; + message.infoByPoolType = object.infoByPoolType !== undefined && object.infoByPoolType !== null ? InfoByPoolType.fromPartial(object.infoByPoolType) : undefined; return message; }, - fromAmino(object: MsgSetPoolWeightsAmino): MsgSetPoolWeights { - return { - admin: object.admin, - poolWeights: object?.pool_weights ? PoolWeights.fromAmino(object.pool_weights) : undefined - }; + fromAmino(object: MsgSetInfoByPoolTypeAmino): MsgSetInfoByPoolType { + const message = createBaseMsgSetInfoByPoolType(); + if (object.admin !== undefined && object.admin !== null) { + message.admin = object.admin; + } + if (object.info_by_pool_type !== undefined && object.info_by_pool_type !== null) { + message.infoByPoolType = InfoByPoolType.fromAmino(object.info_by_pool_type); + } + return message; }, - toAmino(message: MsgSetPoolWeights): MsgSetPoolWeightsAmino { + toAmino(message: MsgSetInfoByPoolType): MsgSetInfoByPoolTypeAmino { const obj: any = {}; obj.admin = message.admin; - obj.pool_weights = message.poolWeights ? PoolWeights.toAmino(message.poolWeights) : undefined; + obj.info_by_pool_type = message.infoByPoolType ? InfoByPoolType.toAmino(message.infoByPoolType) : undefined; return obj; }, - fromAminoMsg(object: MsgSetPoolWeightsAminoMsg): MsgSetPoolWeights { - return MsgSetPoolWeights.fromAmino(object.value); + fromAminoMsg(object: MsgSetInfoByPoolTypeAminoMsg): MsgSetInfoByPoolType { + return MsgSetInfoByPoolType.fromAmino(object.value); }, - toAminoMsg(message: MsgSetPoolWeights): MsgSetPoolWeightsAminoMsg { + toAminoMsg(message: MsgSetInfoByPoolType): MsgSetInfoByPoolTypeAminoMsg { return { - type: "osmosis/protorev/set-pool-weights", - value: MsgSetPoolWeights.toAmino(message) + type: "osmosis/MsgSetInfoByPoolType", + value: MsgSetInfoByPoolType.toAmino(message) }; }, - fromProtoMsg(message: MsgSetPoolWeightsProtoMsg): MsgSetPoolWeights { - return MsgSetPoolWeights.decode(message.value); + fromProtoMsg(message: MsgSetInfoByPoolTypeProtoMsg): MsgSetInfoByPoolType { + return MsgSetInfoByPoolType.decode(message.value); }, - toProto(message: MsgSetPoolWeights): Uint8Array { - return MsgSetPoolWeights.encode(message).finish(); + toProto(message: MsgSetInfoByPoolType): Uint8Array { + return MsgSetInfoByPoolType.encode(message).finish(); }, - toProtoMsg(message: MsgSetPoolWeights): MsgSetPoolWeightsProtoMsg { + toProtoMsg(message: MsgSetInfoByPoolType): MsgSetInfoByPoolTypeProtoMsg { return { - typeUrl: "/osmosis.protorev.v1beta1.MsgSetPoolWeights", - value: MsgSetPoolWeights.encode(message).finish() + typeUrl: "/osmosis.protorev.v1beta1.MsgSetInfoByPoolType", + value: MsgSetInfoByPoolType.encode(message).finish() }; } }; -function createBaseMsgSetPoolWeightsResponse(): MsgSetPoolWeightsResponse { +GlobalDecoderRegistry.register(MsgSetInfoByPoolType.typeUrl, MsgSetInfoByPoolType); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgSetInfoByPoolType.aminoType, MsgSetInfoByPoolType.typeUrl); +function createBaseMsgSetInfoByPoolTypeResponse(): MsgSetInfoByPoolTypeResponse { return {}; } -export const MsgSetPoolWeightsResponse = { - typeUrl: "/osmosis.protorev.v1beta1.MsgSetPoolWeightsResponse", - encode(_: MsgSetPoolWeightsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { +export const MsgSetInfoByPoolTypeResponse = { + typeUrl: "/osmosis.protorev.v1beta1.MsgSetInfoByPoolTypeResponse", + aminoType: "osmosis/protorev/set-info-by-pool-type-response", + is(o: any): o is MsgSetInfoByPoolTypeResponse { + return o && o.$typeUrl === MsgSetInfoByPoolTypeResponse.typeUrl; + }, + isSDK(o: any): o is MsgSetInfoByPoolTypeResponseSDKType { + return o && o.$typeUrl === MsgSetInfoByPoolTypeResponse.typeUrl; + }, + isAmino(o: any): o is MsgSetInfoByPoolTypeResponseAmino { + return o && o.$typeUrl === MsgSetInfoByPoolTypeResponse.typeUrl; + }, + encode(_: MsgSetInfoByPoolTypeResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, - decode(input: BinaryReader | Uint8Array, length?: number): MsgSetPoolWeightsResponse { + decode(input: BinaryReader | Uint8Array, length?: number): MsgSetInfoByPoolTypeResponse { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseMsgSetPoolWeightsResponse(); + const message = createBaseMsgSetInfoByPoolTypeResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -673,39 +811,49 @@ export const MsgSetPoolWeightsResponse = { } return message; }, - fromPartial(_: Partial): MsgSetPoolWeightsResponse { - const message = createBaseMsgSetPoolWeightsResponse(); + fromJSON(_: any): MsgSetInfoByPoolTypeResponse { + return {}; + }, + toJSON(_: MsgSetInfoByPoolTypeResponse): unknown { + const obj: any = {}; + return obj; + }, + fromPartial(_: Partial): MsgSetInfoByPoolTypeResponse { + const message = createBaseMsgSetInfoByPoolTypeResponse(); return message; }, - fromAmino(_: MsgSetPoolWeightsResponseAmino): MsgSetPoolWeightsResponse { - return {}; + fromAmino(_: MsgSetInfoByPoolTypeResponseAmino): MsgSetInfoByPoolTypeResponse { + const message = createBaseMsgSetInfoByPoolTypeResponse(); + return message; }, - toAmino(_: MsgSetPoolWeightsResponse): MsgSetPoolWeightsResponseAmino { + toAmino(_: MsgSetInfoByPoolTypeResponse): MsgSetInfoByPoolTypeResponseAmino { const obj: any = {}; return obj; }, - fromAminoMsg(object: MsgSetPoolWeightsResponseAminoMsg): MsgSetPoolWeightsResponse { - return MsgSetPoolWeightsResponse.fromAmino(object.value); + fromAminoMsg(object: MsgSetInfoByPoolTypeResponseAminoMsg): MsgSetInfoByPoolTypeResponse { + return MsgSetInfoByPoolTypeResponse.fromAmino(object.value); }, - toAminoMsg(message: MsgSetPoolWeightsResponse): MsgSetPoolWeightsResponseAminoMsg { + toAminoMsg(message: MsgSetInfoByPoolTypeResponse): MsgSetInfoByPoolTypeResponseAminoMsg { return { - type: "osmosis/protorev/set-pool-weights-response", - value: MsgSetPoolWeightsResponse.toAmino(message) + type: "osmosis/protorev/set-info-by-pool-type-response", + value: MsgSetInfoByPoolTypeResponse.toAmino(message) }; }, - fromProtoMsg(message: MsgSetPoolWeightsResponseProtoMsg): MsgSetPoolWeightsResponse { - return MsgSetPoolWeightsResponse.decode(message.value); + fromProtoMsg(message: MsgSetInfoByPoolTypeResponseProtoMsg): MsgSetInfoByPoolTypeResponse { + return MsgSetInfoByPoolTypeResponse.decode(message.value); }, - toProto(message: MsgSetPoolWeightsResponse): Uint8Array { - return MsgSetPoolWeightsResponse.encode(message).finish(); + toProto(message: MsgSetInfoByPoolTypeResponse): Uint8Array { + return MsgSetInfoByPoolTypeResponse.encode(message).finish(); }, - toProtoMsg(message: MsgSetPoolWeightsResponse): MsgSetPoolWeightsResponseProtoMsg { + toProtoMsg(message: MsgSetInfoByPoolTypeResponse): MsgSetInfoByPoolTypeResponseProtoMsg { return { - typeUrl: "/osmosis.protorev.v1beta1.MsgSetPoolWeightsResponse", - value: MsgSetPoolWeightsResponse.encode(message).finish() + typeUrl: "/osmosis.protorev.v1beta1.MsgSetInfoByPoolTypeResponse", + value: MsgSetInfoByPoolTypeResponse.encode(message).finish() }; } }; +GlobalDecoderRegistry.register(MsgSetInfoByPoolTypeResponse.typeUrl, MsgSetInfoByPoolTypeResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgSetInfoByPoolTypeResponse.aminoType, MsgSetInfoByPoolTypeResponse.typeUrl); function createBaseMsgSetMaxPoolPointsPerTx(): MsgSetMaxPoolPointsPerTx { return { admin: "", @@ -714,6 +862,16 @@ function createBaseMsgSetMaxPoolPointsPerTx(): MsgSetMaxPoolPointsPerTx { } export const MsgSetMaxPoolPointsPerTx = { typeUrl: "/osmosis.protorev.v1beta1.MsgSetMaxPoolPointsPerTx", + aminoType: "osmosis/MsgSetMaxPoolPointsPerTx", + is(o: any): o is MsgSetMaxPoolPointsPerTx { + return o && (o.$typeUrl === MsgSetMaxPoolPointsPerTx.typeUrl || typeof o.admin === "string" && typeof o.maxPoolPointsPerTx === "bigint"); + }, + isSDK(o: any): o is MsgSetMaxPoolPointsPerTxSDKType { + return o && (o.$typeUrl === MsgSetMaxPoolPointsPerTx.typeUrl || typeof o.admin === "string" && typeof o.max_pool_points_per_tx === "bigint"); + }, + isAmino(o: any): o is MsgSetMaxPoolPointsPerTxAmino { + return o && (o.$typeUrl === MsgSetMaxPoolPointsPerTx.typeUrl || typeof o.admin === "string" && typeof o.max_pool_points_per_tx === "bigint"); + }, encode(message: MsgSetMaxPoolPointsPerTx, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.admin !== "") { writer.uint32(10).string(message.admin); @@ -743,6 +901,18 @@ export const MsgSetMaxPoolPointsPerTx = { } return message; }, + fromJSON(object: any): MsgSetMaxPoolPointsPerTx { + return { + admin: isSet(object.admin) ? String(object.admin) : "", + maxPoolPointsPerTx: isSet(object.maxPoolPointsPerTx) ? BigInt(object.maxPoolPointsPerTx.toString()) : BigInt(0) + }; + }, + toJSON(message: MsgSetMaxPoolPointsPerTx): unknown { + const obj: any = {}; + message.admin !== undefined && (obj.admin = message.admin); + message.maxPoolPointsPerTx !== undefined && (obj.maxPoolPointsPerTx = (message.maxPoolPointsPerTx || BigInt(0)).toString()); + return obj; + }, fromPartial(object: Partial): MsgSetMaxPoolPointsPerTx { const message = createBaseMsgSetMaxPoolPointsPerTx(); message.admin = object.admin ?? ""; @@ -750,10 +920,14 @@ export const MsgSetMaxPoolPointsPerTx = { return message; }, fromAmino(object: MsgSetMaxPoolPointsPerTxAmino): MsgSetMaxPoolPointsPerTx { - return { - admin: object.admin, - maxPoolPointsPerTx: BigInt(object.max_pool_points_per_tx) - }; + const message = createBaseMsgSetMaxPoolPointsPerTx(); + if (object.admin !== undefined && object.admin !== null) { + message.admin = object.admin; + } + if (object.max_pool_points_per_tx !== undefined && object.max_pool_points_per_tx !== null) { + message.maxPoolPointsPerTx = BigInt(object.max_pool_points_per_tx); + } + return message; }, toAmino(message: MsgSetMaxPoolPointsPerTx): MsgSetMaxPoolPointsPerTxAmino { const obj: any = {}; @@ -766,7 +940,7 @@ export const MsgSetMaxPoolPointsPerTx = { }, toAminoMsg(message: MsgSetMaxPoolPointsPerTx): MsgSetMaxPoolPointsPerTxAminoMsg { return { - type: "osmosis/protorev/set-max-pool-points-per-tx", + type: "osmosis/MsgSetMaxPoolPointsPerTx", value: MsgSetMaxPoolPointsPerTx.toAmino(message) }; }, @@ -783,11 +957,23 @@ export const MsgSetMaxPoolPointsPerTx = { }; } }; +GlobalDecoderRegistry.register(MsgSetMaxPoolPointsPerTx.typeUrl, MsgSetMaxPoolPointsPerTx); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgSetMaxPoolPointsPerTx.aminoType, MsgSetMaxPoolPointsPerTx.typeUrl); function createBaseMsgSetMaxPoolPointsPerTxResponse(): MsgSetMaxPoolPointsPerTxResponse { return {}; } export const MsgSetMaxPoolPointsPerTxResponse = { typeUrl: "/osmosis.protorev.v1beta1.MsgSetMaxPoolPointsPerTxResponse", + aminoType: "osmosis/protorev/set-max-pool-points-per-tx-response", + is(o: any): o is MsgSetMaxPoolPointsPerTxResponse { + return o && o.$typeUrl === MsgSetMaxPoolPointsPerTxResponse.typeUrl; + }, + isSDK(o: any): o is MsgSetMaxPoolPointsPerTxResponseSDKType { + return o && o.$typeUrl === MsgSetMaxPoolPointsPerTxResponse.typeUrl; + }, + isAmino(o: any): o is MsgSetMaxPoolPointsPerTxResponseAmino { + return o && o.$typeUrl === MsgSetMaxPoolPointsPerTxResponse.typeUrl; + }, encode(_: MsgSetMaxPoolPointsPerTxResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, @@ -805,12 +991,20 @@ export const MsgSetMaxPoolPointsPerTxResponse = { } return message; }, + fromJSON(_: any): MsgSetMaxPoolPointsPerTxResponse { + return {}; + }, + toJSON(_: MsgSetMaxPoolPointsPerTxResponse): unknown { + const obj: any = {}; + return obj; + }, fromPartial(_: Partial): MsgSetMaxPoolPointsPerTxResponse { const message = createBaseMsgSetMaxPoolPointsPerTxResponse(); return message; }, fromAmino(_: MsgSetMaxPoolPointsPerTxResponseAmino): MsgSetMaxPoolPointsPerTxResponse { - return {}; + const message = createBaseMsgSetMaxPoolPointsPerTxResponse(); + return message; }, toAmino(_: MsgSetMaxPoolPointsPerTxResponse): MsgSetMaxPoolPointsPerTxResponseAmino { const obj: any = {}; @@ -838,6 +1032,8 @@ export const MsgSetMaxPoolPointsPerTxResponse = { }; } }; +GlobalDecoderRegistry.register(MsgSetMaxPoolPointsPerTxResponse.typeUrl, MsgSetMaxPoolPointsPerTxResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgSetMaxPoolPointsPerTxResponse.aminoType, MsgSetMaxPoolPointsPerTxResponse.typeUrl); function createBaseMsgSetMaxPoolPointsPerBlock(): MsgSetMaxPoolPointsPerBlock { return { admin: "", @@ -846,6 +1042,16 @@ function createBaseMsgSetMaxPoolPointsPerBlock(): MsgSetMaxPoolPointsPerBlock { } export const MsgSetMaxPoolPointsPerBlock = { typeUrl: "/osmosis.protorev.v1beta1.MsgSetMaxPoolPointsPerBlock", + aminoType: "osmosis/MsgSetPoolWeights", + is(o: any): o is MsgSetMaxPoolPointsPerBlock { + return o && (o.$typeUrl === MsgSetMaxPoolPointsPerBlock.typeUrl || typeof o.admin === "string" && typeof o.maxPoolPointsPerBlock === "bigint"); + }, + isSDK(o: any): o is MsgSetMaxPoolPointsPerBlockSDKType { + return o && (o.$typeUrl === MsgSetMaxPoolPointsPerBlock.typeUrl || typeof o.admin === "string" && typeof o.max_pool_points_per_block === "bigint"); + }, + isAmino(o: any): o is MsgSetMaxPoolPointsPerBlockAmino { + return o && (o.$typeUrl === MsgSetMaxPoolPointsPerBlock.typeUrl || typeof o.admin === "string" && typeof o.max_pool_points_per_block === "bigint"); + }, encode(message: MsgSetMaxPoolPointsPerBlock, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.admin !== "") { writer.uint32(10).string(message.admin); @@ -875,6 +1081,18 @@ export const MsgSetMaxPoolPointsPerBlock = { } return message; }, + fromJSON(object: any): MsgSetMaxPoolPointsPerBlock { + return { + admin: isSet(object.admin) ? String(object.admin) : "", + maxPoolPointsPerBlock: isSet(object.maxPoolPointsPerBlock) ? BigInt(object.maxPoolPointsPerBlock.toString()) : BigInt(0) + }; + }, + toJSON(message: MsgSetMaxPoolPointsPerBlock): unknown { + const obj: any = {}; + message.admin !== undefined && (obj.admin = message.admin); + message.maxPoolPointsPerBlock !== undefined && (obj.maxPoolPointsPerBlock = (message.maxPoolPointsPerBlock || BigInt(0)).toString()); + return obj; + }, fromPartial(object: Partial): MsgSetMaxPoolPointsPerBlock { const message = createBaseMsgSetMaxPoolPointsPerBlock(); message.admin = object.admin ?? ""; @@ -882,10 +1100,14 @@ export const MsgSetMaxPoolPointsPerBlock = { return message; }, fromAmino(object: MsgSetMaxPoolPointsPerBlockAmino): MsgSetMaxPoolPointsPerBlock { - return { - admin: object.admin, - maxPoolPointsPerBlock: BigInt(object.max_pool_points_per_block) - }; + const message = createBaseMsgSetMaxPoolPointsPerBlock(); + if (object.admin !== undefined && object.admin !== null) { + message.admin = object.admin; + } + if (object.max_pool_points_per_block !== undefined && object.max_pool_points_per_block !== null) { + message.maxPoolPointsPerBlock = BigInt(object.max_pool_points_per_block); + } + return message; }, toAmino(message: MsgSetMaxPoolPointsPerBlock): MsgSetMaxPoolPointsPerBlockAmino { const obj: any = {}; @@ -898,7 +1120,7 @@ export const MsgSetMaxPoolPointsPerBlock = { }, toAminoMsg(message: MsgSetMaxPoolPointsPerBlock): MsgSetMaxPoolPointsPerBlockAminoMsg { return { - type: "osmosis/protorev/set-max-pool-points-per-block", + type: "osmosis/MsgSetPoolWeights", value: MsgSetMaxPoolPointsPerBlock.toAmino(message) }; }, @@ -915,11 +1137,23 @@ export const MsgSetMaxPoolPointsPerBlock = { }; } }; +GlobalDecoderRegistry.register(MsgSetMaxPoolPointsPerBlock.typeUrl, MsgSetMaxPoolPointsPerBlock); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgSetMaxPoolPointsPerBlock.aminoType, MsgSetMaxPoolPointsPerBlock.typeUrl); function createBaseMsgSetMaxPoolPointsPerBlockResponse(): MsgSetMaxPoolPointsPerBlockResponse { return {}; } export const MsgSetMaxPoolPointsPerBlockResponse = { typeUrl: "/osmosis.protorev.v1beta1.MsgSetMaxPoolPointsPerBlockResponse", + aminoType: "osmosis/protorev/set-max-pool-points-per-block-response", + is(o: any): o is MsgSetMaxPoolPointsPerBlockResponse { + return o && o.$typeUrl === MsgSetMaxPoolPointsPerBlockResponse.typeUrl; + }, + isSDK(o: any): o is MsgSetMaxPoolPointsPerBlockResponseSDKType { + return o && o.$typeUrl === MsgSetMaxPoolPointsPerBlockResponse.typeUrl; + }, + isAmino(o: any): o is MsgSetMaxPoolPointsPerBlockResponseAmino { + return o && o.$typeUrl === MsgSetMaxPoolPointsPerBlockResponse.typeUrl; + }, encode(_: MsgSetMaxPoolPointsPerBlockResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, @@ -937,12 +1171,20 @@ export const MsgSetMaxPoolPointsPerBlockResponse = { } return message; }, + fromJSON(_: any): MsgSetMaxPoolPointsPerBlockResponse { + return {}; + }, + toJSON(_: MsgSetMaxPoolPointsPerBlockResponse): unknown { + const obj: any = {}; + return obj; + }, fromPartial(_: Partial): MsgSetMaxPoolPointsPerBlockResponse { const message = createBaseMsgSetMaxPoolPointsPerBlockResponse(); return message; }, fromAmino(_: MsgSetMaxPoolPointsPerBlockResponseAmino): MsgSetMaxPoolPointsPerBlockResponse { - return {}; + const message = createBaseMsgSetMaxPoolPointsPerBlockResponse(); + return message; }, toAmino(_: MsgSetMaxPoolPointsPerBlockResponse): MsgSetMaxPoolPointsPerBlockResponseAmino { const obj: any = {}; @@ -970,6 +1212,8 @@ export const MsgSetMaxPoolPointsPerBlockResponse = { }; } }; +GlobalDecoderRegistry.register(MsgSetMaxPoolPointsPerBlockResponse.typeUrl, MsgSetMaxPoolPointsPerBlockResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgSetMaxPoolPointsPerBlockResponse.aminoType, MsgSetMaxPoolPointsPerBlockResponse.typeUrl); function createBaseMsgSetBaseDenoms(): MsgSetBaseDenoms { return { admin: "", @@ -978,6 +1222,16 @@ function createBaseMsgSetBaseDenoms(): MsgSetBaseDenoms { } export const MsgSetBaseDenoms = { typeUrl: "/osmosis.protorev.v1beta1.MsgSetBaseDenoms", + aminoType: "osmosis/MsgSetBaseDenoms", + is(o: any): o is MsgSetBaseDenoms { + return o && (o.$typeUrl === MsgSetBaseDenoms.typeUrl || typeof o.admin === "string" && Array.isArray(o.baseDenoms) && (!o.baseDenoms.length || BaseDenom.is(o.baseDenoms[0]))); + }, + isSDK(o: any): o is MsgSetBaseDenomsSDKType { + return o && (o.$typeUrl === MsgSetBaseDenoms.typeUrl || typeof o.admin === "string" && Array.isArray(o.base_denoms) && (!o.base_denoms.length || BaseDenom.isSDK(o.base_denoms[0]))); + }, + isAmino(o: any): o is MsgSetBaseDenomsAmino { + return o && (o.$typeUrl === MsgSetBaseDenoms.typeUrl || typeof o.admin === "string" && Array.isArray(o.base_denoms) && (!o.base_denoms.length || BaseDenom.isAmino(o.base_denoms[0]))); + }, encode(message: MsgSetBaseDenoms, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.admin !== "") { writer.uint32(10).string(message.admin); @@ -1007,6 +1261,22 @@ export const MsgSetBaseDenoms = { } return message; }, + fromJSON(object: any): MsgSetBaseDenoms { + return { + admin: isSet(object.admin) ? String(object.admin) : "", + baseDenoms: Array.isArray(object?.baseDenoms) ? object.baseDenoms.map((e: any) => BaseDenom.fromJSON(e)) : [] + }; + }, + toJSON(message: MsgSetBaseDenoms): unknown { + const obj: any = {}; + message.admin !== undefined && (obj.admin = message.admin); + if (message.baseDenoms) { + obj.baseDenoms = message.baseDenoms.map(e => e ? BaseDenom.toJSON(e) : undefined); + } else { + obj.baseDenoms = []; + } + return obj; + }, fromPartial(object: Partial): MsgSetBaseDenoms { const message = createBaseMsgSetBaseDenoms(); message.admin = object.admin ?? ""; @@ -1014,10 +1284,12 @@ export const MsgSetBaseDenoms = { return message; }, fromAmino(object: MsgSetBaseDenomsAmino): MsgSetBaseDenoms { - return { - admin: object.admin, - baseDenoms: Array.isArray(object?.base_denoms) ? object.base_denoms.map((e: any) => BaseDenom.fromAmino(e)) : [] - }; + const message = createBaseMsgSetBaseDenoms(); + if (object.admin !== undefined && object.admin !== null) { + message.admin = object.admin; + } + message.baseDenoms = object.base_denoms?.map(e => BaseDenom.fromAmino(e)) || []; + return message; }, toAmino(message: MsgSetBaseDenoms): MsgSetBaseDenomsAmino { const obj: any = {}; @@ -1034,7 +1306,7 @@ export const MsgSetBaseDenoms = { }, toAminoMsg(message: MsgSetBaseDenoms): MsgSetBaseDenomsAminoMsg { return { - type: "osmosis/protorev/set-base-denoms", + type: "osmosis/MsgSetBaseDenoms", value: MsgSetBaseDenoms.toAmino(message) }; }, @@ -1051,11 +1323,23 @@ export const MsgSetBaseDenoms = { }; } }; +GlobalDecoderRegistry.register(MsgSetBaseDenoms.typeUrl, MsgSetBaseDenoms); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgSetBaseDenoms.aminoType, MsgSetBaseDenoms.typeUrl); function createBaseMsgSetBaseDenomsResponse(): MsgSetBaseDenomsResponse { return {}; } export const MsgSetBaseDenomsResponse = { typeUrl: "/osmosis.protorev.v1beta1.MsgSetBaseDenomsResponse", + aminoType: "osmosis/protorev/set-base-denoms-response", + is(o: any): o is MsgSetBaseDenomsResponse { + return o && o.$typeUrl === MsgSetBaseDenomsResponse.typeUrl; + }, + isSDK(o: any): o is MsgSetBaseDenomsResponseSDKType { + return o && o.$typeUrl === MsgSetBaseDenomsResponse.typeUrl; + }, + isAmino(o: any): o is MsgSetBaseDenomsResponseAmino { + return o && o.$typeUrl === MsgSetBaseDenomsResponse.typeUrl; + }, encode(_: MsgSetBaseDenomsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, @@ -1073,12 +1357,20 @@ export const MsgSetBaseDenomsResponse = { } return message; }, + fromJSON(_: any): MsgSetBaseDenomsResponse { + return {}; + }, + toJSON(_: MsgSetBaseDenomsResponse): unknown { + const obj: any = {}; + return obj; + }, fromPartial(_: Partial): MsgSetBaseDenomsResponse { const message = createBaseMsgSetBaseDenomsResponse(); return message; }, fromAmino(_: MsgSetBaseDenomsResponseAmino): MsgSetBaseDenomsResponse { - return {}; + const message = createBaseMsgSetBaseDenomsResponse(); + return message; }, toAmino(_: MsgSetBaseDenomsResponse): MsgSetBaseDenomsResponseAmino { const obj: any = {}; @@ -1105,4 +1397,6 @@ export const MsgSetBaseDenomsResponse = { value: MsgSetBaseDenomsResponse.encode(message).finish() }; } -}; \ No newline at end of file +}; +GlobalDecoderRegistry.register(MsgSetBaseDenomsResponse.typeUrl, MsgSetBaseDenomsResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgSetBaseDenomsResponse.aminoType, MsgSetBaseDenomsResponse.typeUrl); \ No newline at end of file diff --git a/packages/osmojs/src/codegen/osmosis/rpc.query.ts b/packages/osmojs/src/codegen/osmosis/rpc.query.ts index 846287fd0..c4a079901 100644 --- a/packages/osmojs/src/codegen/osmosis/rpc.query.ts +++ b/packages/osmojs/src/codegen/osmosis/rpc.query.ts @@ -1,4 +1,4 @@ -import { HttpEndpoint, connectComet } from "@cosmjs/tendermint-rpc"; +import { connectComet, HttpEndpoint } from "@cosmjs/tendermint-rpc"; import { QueryClient } from "@cosmjs/stargate"; export const createRPCQueryClient = async ({ rpcEndpoint @@ -23,12 +23,23 @@ export const createRPCQueryClient = async ({ v1beta1: (await import("../cosmos/base/node/v1beta1/query.rpc.Service")).createRpcQueryExtension(client) } }, + consensus: { + v1: (await import("../cosmos/consensus/v1/query.rpc.Query")).createRpcQueryExtension(client) + }, distribution: { v1beta1: (await import("../cosmos/distribution/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) }, gov: { v1beta1: (await import("../cosmos/gov/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) }, + orm: { + query: { + v1alpha1: (await import("../cosmos/orm/query/v1alpha1/query.rpc.Query")).createRpcQueryExtension(client) + } + }, + params: { + v1beta1: (await import("../cosmos/params/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) + }, staking: { v1beta1: (await import("../cosmos/staking/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) }, @@ -41,23 +52,23 @@ export const createRPCQueryClient = async ({ }, osmosis: { concentratedliquidity: { - v1beta1: (await import("./concentrated-liquidity/query.rpc.Query")).createRpcQueryExtension(client) + v1beta1: (await import("./concentratedliquidity/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) }, cosmwasmpool: { v1beta1: (await import("./cosmwasmpool/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) }, downtimedetector: { - v1beta1: (await import("./downtime-detector/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) + v1beta1: (await import("./downtimedetector/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) }, epochs: { - v1beta1: (await import("./epochs/query.rpc.Query")).createRpcQueryExtension(client) + v1beta1: (await import("./epochs/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) }, gamm: { v1beta1: (await import("./gamm/v1beta1/query.rpc.Query")).createRpcQueryExtension(client), v2: (await import("./gamm/v2/query.rpc.Query")).createRpcQueryExtension(client) }, ibcratelimit: { - v1beta1: (await import("./ibc-rate-limit/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) + v1beta1: (await import("./ibcratelimit/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) }, incentives: (await import("./incentives/query.rpc.Query")).createRpcQueryExtension(client), lockup: (await import("./lockup/query.rpc.Query")).createRpcQueryExtension(client), @@ -65,10 +76,11 @@ export const createRPCQueryClient = async ({ v1beta1: (await import("./mint/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) }, poolincentives: { - v1beta1: (await import("./pool-incentives/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) + v1beta1: (await import("./poolincentives/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) }, poolmanager: { - v1beta1: (await import("./poolmanager/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) + v1beta1: (await import("./poolmanager/v1beta1/query.rpc.Query")).createRpcQueryExtension(client), + v2: (await import("./poolmanager/v2/query.rpc.Query")).createRpcQueryExtension(client) }, protorev: { v1beta1: (await import("./protorev/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) @@ -84,7 +96,7 @@ export const createRPCQueryClient = async ({ v1beta1: (await import("./txfees/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) }, valsetpref: { - v1beta1: (await import("./valset-pref/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) + v1beta1: (await import("./valsetpref/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) } } }; diff --git a/packages/osmojs/src/codegen/osmosis/rpc.tx.ts b/packages/osmojs/src/codegen/osmosis/rpc.tx.ts index 7e4bb7a97..da635cb56 100644 --- a/packages/osmojs/src/codegen/osmosis/rpc.tx.ts +++ b/packages/osmojs/src/codegen/osmosis/rpc.tx.ts @@ -5,12 +5,18 @@ export const createRPCMsgClient = async ({ rpc: Rpc; }) => ({ cosmos: { + auth: { + v1beta1: new (await import("../cosmos/auth/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) + }, authz: { v1beta1: new (await import("../cosmos/authz/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) }, bank: { v1beta1: new (await import("../cosmos/bank/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) }, + consensus: { + v1: new (await import("../cosmos/consensus/v1/tx.rpc.msg")).MsgClientImpl(rpc) + }, distribution: { v1beta1: new (await import("../cosmos/distribution/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) }, @@ -19,28 +25,32 @@ export const createRPCMsgClient = async ({ }, staking: { v1beta1: new (await import("../cosmos/staking/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) + }, + upgrade: { + v1beta1: new (await import("../cosmos/upgrade/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) } }, osmosis: { concentratedliquidity: { poolmodel: { concentrated: { - v1beta1: new (await import("./concentrated-liquidity/pool-model/concentrated/tx.rpc.msg")).MsgClientImpl(rpc) + v1beta1: new (await import("./concentratedliquidity/poolmodel/concentrated/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) } }, - v1beta1: new (await import("./concentrated-liquidity/tx.rpc.msg")).MsgClientImpl(rpc) + v1beta1: new (await import("./concentratedliquidity/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) }, gamm: { poolmodels: { balancer: { - v1beta1: new (await import("./gamm/pool-models/balancer/tx/tx.rpc.msg")).MsgClientImpl(rpc) + v1beta1: new (await import("./gamm/poolmodels/balancer/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) }, stableswap: { - v1beta1: new (await import("./gamm/pool-models/stableswap/tx.rpc.msg")).MsgClientImpl(rpc) + v1beta1: new (await import("./gamm/poolmodels/stableswap/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) } }, v1beta1: new (await import("./gamm/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) }, + ibchooks: new (await import("./ibchooks/tx.rpc.msg")).MsgClientImpl(rpc), incentives: new (await import("./incentives/tx.rpc.msg")).MsgClientImpl(rpc), lockup: new (await import("./lockup/tx.rpc.msg")).MsgClientImpl(rpc), poolmanager: { @@ -54,7 +64,7 @@ export const createRPCMsgClient = async ({ v1beta1: new (await import("./tokenfactory/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) }, valsetpref: { - v1beta1: new (await import("./valset-pref/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) + v1beta1: new (await import("./valsetpref/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) } } }); \ No newline at end of file diff --git a/packages/osmo-query/src/codegen/osmosis/sumtree/v1beta1/tree.ts b/packages/osmojs/src/codegen/osmosis/store/v1beta1/tree.ts similarity index 64% rename from packages/osmo-query/src/codegen/osmosis/sumtree/v1beta1/tree.ts rename to packages/osmojs/src/codegen/osmosis/store/v1beta1/tree.ts index eff4ec7db..36e36a89b 100644 --- a/packages/osmo-query/src/codegen/osmosis/sumtree/v1beta1/tree.ts +++ b/packages/osmojs/src/codegen/osmosis/store/v1beta1/tree.ts @@ -1,4 +1,6 @@ import { BinaryReader, BinaryWriter } from "../../../binary"; +import { GlobalDecoderRegistry } from "../../../registry"; +import { isSet, bytesFromBase64, base64FromBytes } from "../../../helpers"; export interface Node { children: Child[]; } @@ -7,7 +9,7 @@ export interface NodeProtoMsg { value: Uint8Array; } export interface NodeAmino { - children: ChildAmino[]; + children?: ChildAmino[]; } export interface NodeAminoMsg { type: "osmosis/store/node"; @@ -25,8 +27,8 @@ export interface ChildProtoMsg { value: Uint8Array; } export interface ChildAmino { - index: Uint8Array; - accumulation: string; + index?: string; + accumulation?: string; } export interface ChildAminoMsg { type: "osmosis/store/child"; @@ -37,7 +39,7 @@ export interface ChildSDKType { accumulation: string; } export interface Leaf { - leaf: Child; + leaf?: Child; } export interface LeafProtoMsg { typeUrl: "/osmosis.store.v1beta1.Leaf"; @@ -51,7 +53,7 @@ export interface LeafAminoMsg { value: LeafAmino; } export interface LeafSDKType { - leaf: ChildSDKType; + leaf?: ChildSDKType; } function createBaseNode(): Node { return { @@ -60,6 +62,16 @@ function createBaseNode(): Node { } export const Node = { typeUrl: "/osmosis.store.v1beta1.Node", + aminoType: "osmosis/store/node", + is(o: any): o is Node { + return o && (o.$typeUrl === Node.typeUrl || Array.isArray(o.children) && (!o.children.length || Child.is(o.children[0]))); + }, + isSDK(o: any): o is NodeSDKType { + return o && (o.$typeUrl === Node.typeUrl || Array.isArray(o.children) && (!o.children.length || Child.isSDK(o.children[0]))); + }, + isAmino(o: any): o is NodeAmino { + return o && (o.$typeUrl === Node.typeUrl || Array.isArray(o.children) && (!o.children.length || Child.isAmino(o.children[0]))); + }, encode(message: Node, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.children) { Child.encode(v!, writer.uint32(10).fork()).ldelim(); @@ -83,15 +95,29 @@ export const Node = { } return message; }, + fromJSON(object: any): Node { + return { + children: Array.isArray(object?.children) ? object.children.map((e: any) => Child.fromJSON(e)) : [] + }; + }, + toJSON(message: Node): unknown { + const obj: any = {}; + if (message.children) { + obj.children = message.children.map(e => e ? Child.toJSON(e) : undefined); + } else { + obj.children = []; + } + return obj; + }, fromPartial(object: Partial): Node { const message = createBaseNode(); message.children = object.children?.map(e => Child.fromPartial(e)) || []; return message; }, fromAmino(object: NodeAmino): Node { - return { - children: Array.isArray(object?.children) ? object.children.map((e: any) => Child.fromAmino(e)) : [] - }; + const message = createBaseNode(); + message.children = object.children?.map(e => Child.fromAmino(e)) || []; + return message; }, toAmino(message: Node): NodeAmino { const obj: any = {}; @@ -124,6 +150,8 @@ export const Node = { }; } }; +GlobalDecoderRegistry.register(Node.typeUrl, Node); +GlobalDecoderRegistry.registerAminoProtoMapping(Node.aminoType, Node.typeUrl); function createBaseChild(): Child { return { index: new Uint8Array(), @@ -132,6 +160,16 @@ function createBaseChild(): Child { } export const Child = { typeUrl: "/osmosis.store.v1beta1.Child", + aminoType: "osmosis/store/child", + is(o: any): o is Child { + return o && (o.$typeUrl === Child.typeUrl || (o.index instanceof Uint8Array || typeof o.index === "string") && typeof o.accumulation === "string"); + }, + isSDK(o: any): o is ChildSDKType { + return o && (o.$typeUrl === Child.typeUrl || (o.index instanceof Uint8Array || typeof o.index === "string") && typeof o.accumulation === "string"); + }, + isAmino(o: any): o is ChildAmino { + return o && (o.$typeUrl === Child.typeUrl || (o.index instanceof Uint8Array || typeof o.index === "string") && typeof o.accumulation === "string"); + }, encode(message: Child, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.index.length !== 0) { writer.uint32(10).bytes(message.index); @@ -161,6 +199,18 @@ export const Child = { } return message; }, + fromJSON(object: any): Child { + return { + index: isSet(object.index) ? bytesFromBase64(object.index) : new Uint8Array(), + accumulation: isSet(object.accumulation) ? String(object.accumulation) : "" + }; + }, + toJSON(message: Child): unknown { + const obj: any = {}; + message.index !== undefined && (obj.index = base64FromBytes(message.index !== undefined ? message.index : new Uint8Array())); + message.accumulation !== undefined && (obj.accumulation = message.accumulation); + return obj; + }, fromPartial(object: Partial): Child { const message = createBaseChild(); message.index = object.index ?? new Uint8Array(); @@ -168,14 +218,18 @@ export const Child = { return message; }, fromAmino(object: ChildAmino): Child { - return { - index: object.index, - accumulation: object.accumulation - }; + const message = createBaseChild(); + if (object.index !== undefined && object.index !== null) { + message.index = bytesFromBase64(object.index); + } + if (object.accumulation !== undefined && object.accumulation !== null) { + message.accumulation = object.accumulation; + } + return message; }, toAmino(message: Child): ChildAmino { const obj: any = {}; - obj.index = message.index; + obj.index = message.index ? base64FromBytes(message.index) : undefined; obj.accumulation = message.accumulation; return obj; }, @@ -201,13 +255,25 @@ export const Child = { }; } }; +GlobalDecoderRegistry.register(Child.typeUrl, Child); +GlobalDecoderRegistry.registerAminoProtoMapping(Child.aminoType, Child.typeUrl); function createBaseLeaf(): Leaf { return { - leaf: Child.fromPartial({}) + leaf: undefined }; } export const Leaf = { typeUrl: "/osmosis.store.v1beta1.Leaf", + aminoType: "osmosis/store/leaf", + is(o: any): o is Leaf { + return o && o.$typeUrl === Leaf.typeUrl; + }, + isSDK(o: any): o is LeafSDKType { + return o && o.$typeUrl === Leaf.typeUrl; + }, + isAmino(o: any): o is LeafAmino { + return o && o.$typeUrl === Leaf.typeUrl; + }, encode(message: Leaf, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.leaf !== undefined) { Child.encode(message.leaf, writer.uint32(10).fork()).ldelim(); @@ -231,15 +297,27 @@ export const Leaf = { } return message; }, + fromJSON(object: any): Leaf { + return { + leaf: isSet(object.leaf) ? Child.fromJSON(object.leaf) : undefined + }; + }, + toJSON(message: Leaf): unknown { + const obj: any = {}; + message.leaf !== undefined && (obj.leaf = message.leaf ? Child.toJSON(message.leaf) : undefined); + return obj; + }, fromPartial(object: Partial): Leaf { const message = createBaseLeaf(); message.leaf = object.leaf !== undefined && object.leaf !== null ? Child.fromPartial(object.leaf) : undefined; return message; }, fromAmino(object: LeafAmino): Leaf { - return { - leaf: object?.leaf ? Child.fromAmino(object.leaf) : undefined - }; + const message = createBaseLeaf(); + if (object.leaf !== undefined && object.leaf !== null) { + message.leaf = Child.fromAmino(object.leaf); + } + return message; }, toAmino(message: Leaf): LeafAmino { const obj: any = {}; @@ -267,4 +345,6 @@ export const Leaf = { value: Leaf.encode(message).finish() }; } -}; \ No newline at end of file +}; +GlobalDecoderRegistry.register(Leaf.typeUrl, Leaf); +GlobalDecoderRegistry.registerAminoProtoMapping(Leaf.aminoType, Leaf.typeUrl); \ No newline at end of file diff --git a/packages/osmojs/src/codegen/osmosis/superfluid/genesis.ts b/packages/osmojs/src/codegen/osmosis/superfluid/genesis.ts index 3444f27a4..2bbfb50c4 100644 --- a/packages/osmojs/src/codegen/osmosis/superfluid/genesis.ts +++ b/packages/osmojs/src/codegen/osmosis/superfluid/genesis.ts @@ -1,6 +1,8 @@ import { Params, ParamsAmino, ParamsSDKType } from "./params"; import { SuperfluidAsset, SuperfluidAssetAmino, SuperfluidAssetSDKType, OsmoEquivalentMultiplierRecord, OsmoEquivalentMultiplierRecordAmino, OsmoEquivalentMultiplierRecordSDKType, SuperfluidIntermediaryAccount, SuperfluidIntermediaryAccountAmino, SuperfluidIntermediaryAccountSDKType, LockIdIntermediaryAccountConnection, LockIdIntermediaryAccountConnectionAmino, LockIdIntermediaryAccountConnectionSDKType } from "./superfluid"; import { BinaryReader, BinaryWriter } from "../../binary"; +import { isSet } from "../../helpers"; +import { GlobalDecoderRegistry } from "../../registry"; /** GenesisState defines the module's genesis state. */ export interface GenesisState { params: Params; @@ -32,18 +34,18 @@ export interface GenesisStateAmino { * superfluid_assets defines the registered superfluid assets that have been * registered via governance. */ - superfluid_assets: SuperfluidAssetAmino[]; + superfluid_assets?: SuperfluidAssetAmino[]; /** * osmo_equivalent_multipliers is the records of osmo equivalent amount of * each superfluid registered pool, updated every epoch. */ - osmo_equivalent_multipliers: OsmoEquivalentMultiplierRecordAmino[]; + osmo_equivalent_multipliers?: OsmoEquivalentMultiplierRecordAmino[]; /** * intermediary_accounts is a secondary account for superfluid staking that * plays an intermediary role between validators and the delegators. */ - intermediary_accounts: SuperfluidIntermediaryAccountAmino[]; - intemediary_account_connections: LockIdIntermediaryAccountConnectionAmino[]; + intermediary_accounts?: SuperfluidIntermediaryAccountAmino[]; + intemediary_account_connections?: LockIdIntermediaryAccountConnectionAmino[]; } export interface GenesisStateAminoMsg { type: "osmosis/genesis-state"; @@ -68,6 +70,16 @@ function createBaseGenesisState(): GenesisState { } export const GenesisState = { typeUrl: "/osmosis.superfluid.GenesisState", + aminoType: "osmosis/genesis-state", + is(o: any): o is GenesisState { + return o && (o.$typeUrl === GenesisState.typeUrl || Params.is(o.params) && Array.isArray(o.superfluidAssets) && (!o.superfluidAssets.length || SuperfluidAsset.is(o.superfluidAssets[0])) && Array.isArray(o.osmoEquivalentMultipliers) && (!o.osmoEquivalentMultipliers.length || OsmoEquivalentMultiplierRecord.is(o.osmoEquivalentMultipliers[0])) && Array.isArray(o.intermediaryAccounts) && (!o.intermediaryAccounts.length || SuperfluidIntermediaryAccount.is(o.intermediaryAccounts[0])) && Array.isArray(o.intemediaryAccountConnections) && (!o.intemediaryAccountConnections.length || LockIdIntermediaryAccountConnection.is(o.intemediaryAccountConnections[0]))); + }, + isSDK(o: any): o is GenesisStateSDKType { + return o && (o.$typeUrl === GenesisState.typeUrl || Params.isSDK(o.params) && Array.isArray(o.superfluid_assets) && (!o.superfluid_assets.length || SuperfluidAsset.isSDK(o.superfluid_assets[0])) && Array.isArray(o.osmo_equivalent_multipliers) && (!o.osmo_equivalent_multipliers.length || OsmoEquivalentMultiplierRecord.isSDK(o.osmo_equivalent_multipliers[0])) && Array.isArray(o.intermediary_accounts) && (!o.intermediary_accounts.length || SuperfluidIntermediaryAccount.isSDK(o.intermediary_accounts[0])) && Array.isArray(o.intemediary_account_connections) && (!o.intemediary_account_connections.length || LockIdIntermediaryAccountConnection.isSDK(o.intemediary_account_connections[0]))); + }, + isAmino(o: any): o is GenesisStateAmino { + return o && (o.$typeUrl === GenesisState.typeUrl || Params.isAmino(o.params) && Array.isArray(o.superfluid_assets) && (!o.superfluid_assets.length || SuperfluidAsset.isAmino(o.superfluid_assets[0])) && Array.isArray(o.osmo_equivalent_multipliers) && (!o.osmo_equivalent_multipliers.length || OsmoEquivalentMultiplierRecord.isAmino(o.osmo_equivalent_multipliers[0])) && Array.isArray(o.intermediary_accounts) && (!o.intermediary_accounts.length || SuperfluidIntermediaryAccount.isAmino(o.intermediary_accounts[0])) && Array.isArray(o.intemediary_account_connections) && (!o.intemediary_account_connections.length || LockIdIntermediaryAccountConnection.isAmino(o.intemediary_account_connections[0]))); + }, encode(message: GenesisState, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.params !== undefined) { Params.encode(message.params, writer.uint32(10).fork()).ldelim(); @@ -115,6 +127,40 @@ export const GenesisState = { } return message; }, + fromJSON(object: any): GenesisState { + return { + params: isSet(object.params) ? Params.fromJSON(object.params) : undefined, + superfluidAssets: Array.isArray(object?.superfluidAssets) ? object.superfluidAssets.map((e: any) => SuperfluidAsset.fromJSON(e)) : [], + osmoEquivalentMultipliers: Array.isArray(object?.osmoEquivalentMultipliers) ? object.osmoEquivalentMultipliers.map((e: any) => OsmoEquivalentMultiplierRecord.fromJSON(e)) : [], + intermediaryAccounts: Array.isArray(object?.intermediaryAccounts) ? object.intermediaryAccounts.map((e: any) => SuperfluidIntermediaryAccount.fromJSON(e)) : [], + intemediaryAccountConnections: Array.isArray(object?.intemediaryAccountConnections) ? object.intemediaryAccountConnections.map((e: any) => LockIdIntermediaryAccountConnection.fromJSON(e)) : [] + }; + }, + toJSON(message: GenesisState): unknown { + const obj: any = {}; + message.params !== undefined && (obj.params = message.params ? Params.toJSON(message.params) : undefined); + if (message.superfluidAssets) { + obj.superfluidAssets = message.superfluidAssets.map(e => e ? SuperfluidAsset.toJSON(e) : undefined); + } else { + obj.superfluidAssets = []; + } + if (message.osmoEquivalentMultipliers) { + obj.osmoEquivalentMultipliers = message.osmoEquivalentMultipliers.map(e => e ? OsmoEquivalentMultiplierRecord.toJSON(e) : undefined); + } else { + obj.osmoEquivalentMultipliers = []; + } + if (message.intermediaryAccounts) { + obj.intermediaryAccounts = message.intermediaryAccounts.map(e => e ? SuperfluidIntermediaryAccount.toJSON(e) : undefined); + } else { + obj.intermediaryAccounts = []; + } + if (message.intemediaryAccountConnections) { + obj.intemediaryAccountConnections = message.intemediaryAccountConnections.map(e => e ? LockIdIntermediaryAccountConnection.toJSON(e) : undefined); + } else { + obj.intemediaryAccountConnections = []; + } + return obj; + }, fromPartial(object: Partial): GenesisState { const message = createBaseGenesisState(); message.params = object.params !== undefined && object.params !== null ? Params.fromPartial(object.params) : undefined; @@ -125,13 +171,15 @@ export const GenesisState = { return message; }, fromAmino(object: GenesisStateAmino): GenesisState { - return { - params: object?.params ? Params.fromAmino(object.params) : undefined, - superfluidAssets: Array.isArray(object?.superfluid_assets) ? object.superfluid_assets.map((e: any) => SuperfluidAsset.fromAmino(e)) : [], - osmoEquivalentMultipliers: Array.isArray(object?.osmo_equivalent_multipliers) ? object.osmo_equivalent_multipliers.map((e: any) => OsmoEquivalentMultiplierRecord.fromAmino(e)) : [], - intermediaryAccounts: Array.isArray(object?.intermediary_accounts) ? object.intermediary_accounts.map((e: any) => SuperfluidIntermediaryAccount.fromAmino(e)) : [], - intemediaryAccountConnections: Array.isArray(object?.intemediary_account_connections) ? object.intemediary_account_connections.map((e: any) => LockIdIntermediaryAccountConnection.fromAmino(e)) : [] - }; + const message = createBaseGenesisState(); + if (object.params !== undefined && object.params !== null) { + message.params = Params.fromAmino(object.params); + } + message.superfluidAssets = object.superfluid_assets?.map(e => SuperfluidAsset.fromAmino(e)) || []; + message.osmoEquivalentMultipliers = object.osmo_equivalent_multipliers?.map(e => OsmoEquivalentMultiplierRecord.fromAmino(e)) || []; + message.intermediaryAccounts = object.intermediary_accounts?.map(e => SuperfluidIntermediaryAccount.fromAmino(e)) || []; + message.intemediaryAccountConnections = object.intemediary_account_connections?.map(e => LockIdIntermediaryAccountConnection.fromAmino(e)) || []; + return message; }, toAmino(message: GenesisState): GenesisStateAmino { const obj: any = {}; @@ -179,4 +227,6 @@ export const GenesisState = { value: GenesisState.encode(message).finish() }; } -}; \ No newline at end of file +}; +GlobalDecoderRegistry.register(GenesisState.typeUrl, GenesisState); +GlobalDecoderRegistry.registerAminoProtoMapping(GenesisState.aminoType, GenesisState.typeUrl); \ No newline at end of file diff --git a/packages/osmojs/src/codegen/osmosis/superfluid/params.ts b/packages/osmojs/src/codegen/osmosis/superfluid/params.ts index 19e861b27..a7282202d 100644 --- a/packages/osmojs/src/codegen/osmosis/superfluid/params.ts +++ b/packages/osmojs/src/codegen/osmosis/superfluid/params.ts @@ -1,5 +1,7 @@ import { BinaryReader, BinaryWriter } from "../../binary"; import { Decimal } from "@cosmjs/math"; +import { isSet } from "../../helpers"; +import { GlobalDecoderRegistry } from "../../registry"; /** Params holds parameters for the superfluid module */ export interface Params { /** @@ -22,7 +24,7 @@ export interface ParamsAmino { * to counter-balance the staked amount on chain's exposure to various asset * volatilities, and have base staking be 'resistant' to volatility. */ - minimum_risk_factor: string; + minimum_risk_factor?: string; } export interface ParamsAminoMsg { type: "osmosis/params"; @@ -39,6 +41,16 @@ function createBaseParams(): Params { } export const Params = { typeUrl: "/osmosis.superfluid.Params", + aminoType: "osmosis/params", + is(o: any): o is Params { + return o && (o.$typeUrl === Params.typeUrl || typeof o.minimumRiskFactor === "string"); + }, + isSDK(o: any): o is ParamsSDKType { + return o && (o.$typeUrl === Params.typeUrl || typeof o.minimum_risk_factor === "string"); + }, + isAmino(o: any): o is ParamsAmino { + return o && (o.$typeUrl === Params.typeUrl || typeof o.minimum_risk_factor === "string"); + }, encode(message: Params, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.minimumRiskFactor !== "") { writer.uint32(10).string(Decimal.fromUserInput(message.minimumRiskFactor, 18).atomics); @@ -62,15 +74,27 @@ export const Params = { } return message; }, + fromJSON(object: any): Params { + return { + minimumRiskFactor: isSet(object.minimumRiskFactor) ? String(object.minimumRiskFactor) : "" + }; + }, + toJSON(message: Params): unknown { + const obj: any = {}; + message.minimumRiskFactor !== undefined && (obj.minimumRiskFactor = message.minimumRiskFactor); + return obj; + }, fromPartial(object: Partial): Params { const message = createBaseParams(); message.minimumRiskFactor = object.minimumRiskFactor ?? ""; return message; }, fromAmino(object: ParamsAmino): Params { - return { - minimumRiskFactor: object.minimum_risk_factor - }; + const message = createBaseParams(); + if (object.minimum_risk_factor !== undefined && object.minimum_risk_factor !== null) { + message.minimumRiskFactor = object.minimum_risk_factor; + } + return message; }, toAmino(message: Params): ParamsAmino { const obj: any = {}; @@ -98,4 +122,6 @@ export const Params = { value: Params.encode(message).finish() }; } -}; \ No newline at end of file +}; +GlobalDecoderRegistry.register(Params.typeUrl, Params); +GlobalDecoderRegistry.registerAminoProtoMapping(Params.aminoType, Params.typeUrl); \ No newline at end of file diff --git a/packages/osmojs/src/codegen/osmosis/superfluid/query.lcd.ts b/packages/osmojs/src/codegen/osmosis/superfluid/query.lcd.ts index e29bf9d12..a91a7de2a 100644 --- a/packages/osmojs/src/codegen/osmosis/superfluid/query.lcd.ts +++ b/packages/osmojs/src/codegen/osmosis/superfluid/query.lcd.ts @@ -1,6 +1,6 @@ import { setPaginationParams } from "../../helpers"; import { LCDClient } from "@cosmology/lcd"; -import { QueryParamsRequest, QueryParamsResponseSDKType, AssetTypeRequest, AssetTypeResponseSDKType, AllAssetsRequest, AllAssetsResponseSDKType, AssetMultiplierRequest, AssetMultiplierResponseSDKType, AllIntermediaryAccountsRequest, AllIntermediaryAccountsResponseSDKType, ConnectedIntermediaryAccountRequest, ConnectedIntermediaryAccountResponseSDKType, TotalSuperfluidDelegationsRequest, TotalSuperfluidDelegationsResponseSDKType, SuperfluidDelegationAmountRequest, SuperfluidDelegationAmountResponseSDKType, SuperfluidDelegationsByDelegatorRequest, SuperfluidDelegationsByDelegatorResponseSDKType, SuperfluidUndelegationsByDelegatorRequest, SuperfluidUndelegationsByDelegatorResponseSDKType, SuperfluidDelegationsByValidatorDenomRequest, SuperfluidDelegationsByValidatorDenomResponseSDKType, EstimateSuperfluidDelegatedAmountByValidatorDenomRequest, EstimateSuperfluidDelegatedAmountByValidatorDenomResponseSDKType, QueryTotalDelegationByDelegatorRequest, QueryTotalDelegationByDelegatorResponseSDKType, QueryUnpoolWhitelistRequest, QueryUnpoolWhitelistResponseSDKType, UserConcentratedSuperfluidPositionsDelegatedRequest, UserConcentratedSuperfluidPositionsDelegatedResponseSDKType, UserConcentratedSuperfluidPositionsUndelegatingRequest, UserConcentratedSuperfluidPositionsUndelegatingResponseSDKType } from "./query"; +import { QueryParamsRequest, QueryParamsResponseSDKType, AssetTypeRequest, AssetTypeResponseSDKType, AllAssetsRequest, AllAssetsResponseSDKType, AssetMultiplierRequest, AssetMultiplierResponseSDKType, AllIntermediaryAccountsRequest, AllIntermediaryAccountsResponseSDKType, ConnectedIntermediaryAccountRequest, ConnectedIntermediaryAccountResponseSDKType, TotalSuperfluidDelegationsRequest, TotalSuperfluidDelegationsResponseSDKType, SuperfluidDelegationAmountRequest, SuperfluidDelegationAmountResponseSDKType, SuperfluidDelegationsByDelegatorRequest, SuperfluidDelegationsByDelegatorResponseSDKType, SuperfluidUndelegationsByDelegatorRequest, SuperfluidUndelegationsByDelegatorResponseSDKType, SuperfluidDelegationsByValidatorDenomRequest, SuperfluidDelegationsByValidatorDenomResponseSDKType, EstimateSuperfluidDelegatedAmountByValidatorDenomRequest, EstimateSuperfluidDelegatedAmountByValidatorDenomResponseSDKType, QueryTotalDelegationByDelegatorRequest, QueryTotalDelegationByDelegatorResponseSDKType, QueryUnpoolWhitelistRequest, QueryUnpoolWhitelistResponseSDKType, UserConcentratedSuperfluidPositionsDelegatedRequest, UserConcentratedSuperfluidPositionsDelegatedResponseSDKType, UserConcentratedSuperfluidPositionsUndelegatingRequest, UserConcentratedSuperfluidPositionsUndelegatingResponseSDKType, QueryRestSupplyRequest, QueryRestSupplyResponseSDKType } from "./query"; export class LCDQueryClient { req: LCDClient; constructor({ @@ -25,6 +25,7 @@ export class LCDQueryClient { this.unpoolWhitelist = this.unpoolWhitelist.bind(this); this.userConcentratedSuperfluidPositionsDelegated = this.userConcentratedSuperfluidPositionsDelegated.bind(this); this.userConcentratedSuperfluidPositionsUndelegating = this.userConcentratedSuperfluidPositionsUndelegating.bind(this); + this.restSupply = this.restSupply.bind(this); } /* Params returns the total set of superfluid parameters. */ async params(_params: QueryParamsRequest = {}): Promise { @@ -101,12 +102,12 @@ export class LCDQueryClient { const endpoint = `osmosis/superfluid/v1beta1/superfluid_delegation_amount`; return await this.req.get(endpoint, options); } - /* Returns all the delegated superfluid poistions for a specific delegator. */ + /* Returns all the delegated superfluid positions for a specific delegator. */ async superfluidDelegationsByDelegator(params: SuperfluidDelegationsByDelegatorRequest): Promise { const endpoint = `osmosis/superfluid/v1beta1/superfluid_delegations/${params.delegatorAddress}`; return await this.req.get(endpoint); } - /* Returns all the undelegating superfluid poistions for a specific delegator. */ + /* Returns all the undelegating superfluid positions for a specific delegator. */ async superfluidUndelegationsByDelegator(params: SuperfluidUndelegationsByDelegatorRequest): Promise { const options: any = { params: {} @@ -158,7 +159,7 @@ export class LCDQueryClient { const endpoint = `osmosis/superfluid/v1beta1/unpool_whitelist`; return await this.req.get(endpoint); } - /* UserConcentratedSuperfluidPositionsDelegated */ + /* Returns all of a user's full range CL positions that are superfluid staked. */ async userConcentratedSuperfluidPositionsDelegated(params: UserConcentratedSuperfluidPositionsDelegatedRequest): Promise { const endpoint = `osmosis/superfluid/v1beta1/account_delegated_cl_positions/${params.delegatorAddress}`; return await this.req.get(endpoint); @@ -168,4 +169,15 @@ export class LCDQueryClient { const endpoint = `osmosis/superfluid/v1beta1/account_undelegating_cl_positions/${params.delegatorAddress}`; return await this.req.get(endpoint); } + /* RestSupply */ + async restSupply(params: QueryRestSupplyRequest): Promise { + const options: any = { + params: {} + }; + if (typeof params?.denom !== "undefined") { + options.params.denom = params.denom; + } + const endpoint = `osmosis/superfluid/v1beta1/supply`; + return await this.req.get(endpoint, options); + } } \ No newline at end of file diff --git a/packages/osmojs/src/codegen/osmosis/superfluid/query.rpc.Query.ts b/packages/osmojs/src/codegen/osmosis/superfluid/query.rpc.Query.ts index 093294a6d..17bdee518 100644 --- a/packages/osmojs/src/codegen/osmosis/superfluid/query.rpc.Query.ts +++ b/packages/osmojs/src/codegen/osmosis/superfluid/query.rpc.Query.ts @@ -1,7 +1,7 @@ import { Rpc } from "../../helpers"; import { BinaryReader } from "../../binary"; import { QueryClient, createProtobufRpcClient } from "@cosmjs/stargate"; -import { QueryParamsRequest, QueryParamsResponse, AssetTypeRequest, AssetTypeResponse, AllAssetsRequest, AllAssetsResponse, AssetMultiplierRequest, AssetMultiplierResponse, AllIntermediaryAccountsRequest, AllIntermediaryAccountsResponse, ConnectedIntermediaryAccountRequest, ConnectedIntermediaryAccountResponse, QueryTotalDelegationByValidatorForDenomRequest, QueryTotalDelegationByValidatorForDenomResponse, TotalSuperfluidDelegationsRequest, TotalSuperfluidDelegationsResponse, SuperfluidDelegationAmountRequest, SuperfluidDelegationAmountResponse, SuperfluidDelegationsByDelegatorRequest, SuperfluidDelegationsByDelegatorResponse, SuperfluidUndelegationsByDelegatorRequest, SuperfluidUndelegationsByDelegatorResponse, SuperfluidDelegationsByValidatorDenomRequest, SuperfluidDelegationsByValidatorDenomResponse, EstimateSuperfluidDelegatedAmountByValidatorDenomRequest, EstimateSuperfluidDelegatedAmountByValidatorDenomResponse, QueryTotalDelegationByDelegatorRequest, QueryTotalDelegationByDelegatorResponse, QueryUnpoolWhitelistRequest, QueryUnpoolWhitelistResponse, UserConcentratedSuperfluidPositionsDelegatedRequest, UserConcentratedSuperfluidPositionsDelegatedResponse, UserConcentratedSuperfluidPositionsUndelegatingRequest, UserConcentratedSuperfluidPositionsUndelegatingResponse } from "./query"; +import { QueryParamsRequest, QueryParamsResponse, AssetTypeRequest, AssetTypeResponse, AllAssetsRequest, AllAssetsResponse, AssetMultiplierRequest, AssetMultiplierResponse, AllIntermediaryAccountsRequest, AllIntermediaryAccountsResponse, ConnectedIntermediaryAccountRequest, ConnectedIntermediaryAccountResponse, QueryTotalDelegationByValidatorForDenomRequest, QueryTotalDelegationByValidatorForDenomResponse, TotalSuperfluidDelegationsRequest, TotalSuperfluidDelegationsResponse, SuperfluidDelegationAmountRequest, SuperfluidDelegationAmountResponse, SuperfluidDelegationsByDelegatorRequest, SuperfluidDelegationsByDelegatorResponse, SuperfluidUndelegationsByDelegatorRequest, SuperfluidUndelegationsByDelegatorResponse, SuperfluidDelegationsByValidatorDenomRequest, SuperfluidDelegationsByValidatorDenomResponse, EstimateSuperfluidDelegatedAmountByValidatorDenomRequest, EstimateSuperfluidDelegatedAmountByValidatorDenomResponse, QueryTotalDelegationByDelegatorRequest, QueryTotalDelegationByDelegatorResponse, QueryUnpoolWhitelistRequest, QueryUnpoolWhitelistResponse, UserConcentratedSuperfluidPositionsDelegatedRequest, UserConcentratedSuperfluidPositionsDelegatedResponse, UserConcentratedSuperfluidPositionsUndelegatingRequest, UserConcentratedSuperfluidPositionsUndelegatingResponse, QueryRestSupplyRequest, QueryRestSupplyResponse } from "./query"; /** Query defines the gRPC querier service. */ export interface Query { /** Params returns the total set of superfluid parameters. */ @@ -31,9 +31,9 @@ export interface Query { * triplet */ superfluidDelegationAmount(request: SuperfluidDelegationAmountRequest): Promise; - /** Returns all the delegated superfluid poistions for a specific delegator. */ + /** Returns all the delegated superfluid positions for a specific delegator. */ superfluidDelegationsByDelegator(request: SuperfluidDelegationsByDelegatorRequest): Promise; - /** Returns all the undelegating superfluid poistions for a specific delegator. */ + /** Returns all the undelegating superfluid positions for a specific delegator. */ superfluidUndelegationsByDelegator(request: SuperfluidUndelegationsByDelegatorRequest): Promise; /** * Returns all the superfluid positions of a specific denom delegated to one @@ -50,8 +50,10 @@ export interface Query { totalDelegationByDelegator(request: QueryTotalDelegationByDelegatorRequest): Promise; /** Returns a list of whitelisted pool ids to unpool. */ unpoolWhitelist(request?: QueryUnpoolWhitelistRequest): Promise; + /** Returns all of a user's full range CL positions that are superfluid staked. */ userConcentratedSuperfluidPositionsDelegated(request: UserConcentratedSuperfluidPositionsDelegatedRequest): Promise; userConcentratedSuperfluidPositionsUndelegating(request: UserConcentratedSuperfluidPositionsUndelegatingRequest): Promise; + restSupply(request: QueryRestSupplyRequest): Promise; } export class QueryClientImpl implements Query { private readonly rpc: Rpc; @@ -74,6 +76,7 @@ export class QueryClientImpl implements Query { this.unpoolWhitelist = this.unpoolWhitelist.bind(this); this.userConcentratedSuperfluidPositionsDelegated = this.userConcentratedSuperfluidPositionsDelegated.bind(this); this.userConcentratedSuperfluidPositionsUndelegating = this.userConcentratedSuperfluidPositionsUndelegating.bind(this); + this.restSupply = this.restSupply.bind(this); } params(request: QueryParamsRequest = {}): Promise { const data = QueryParamsRequest.encode(request).finish(); @@ -162,6 +165,11 @@ export class QueryClientImpl implements Query { const promise = this.rpc.request("osmosis.superfluid.Query", "UserConcentratedSuperfluidPositionsUndelegating", data); return promise.then(data => UserConcentratedSuperfluidPositionsUndelegatingResponse.decode(new BinaryReader(data))); } + restSupply(request: QueryRestSupplyRequest): Promise { + const data = QueryRestSupplyRequest.encode(request).finish(); + const promise = this.rpc.request("osmosis.superfluid.Query", "RestSupply", data); + return promise.then(data => QueryRestSupplyResponse.decode(new BinaryReader(data))); + } } export const createRpcQueryExtension = (base: QueryClient) => { const rpc = createProtobufRpcClient(base); @@ -217,6 +225,9 @@ export const createRpcQueryExtension = (base: QueryClient) => { }, userConcentratedSuperfluidPositionsUndelegating(request: UserConcentratedSuperfluidPositionsUndelegatingRequest): Promise { return queryService.userConcentratedSuperfluidPositionsUndelegating(request); + }, + restSupply(request: QueryRestSupplyRequest): Promise { + return queryService.restSupply(request); } }; }; \ No newline at end of file diff --git a/packages/osmojs/src/codegen/osmosis/superfluid/query.ts b/packages/osmojs/src/codegen/osmosis/superfluid/query.ts index fba385581..61a46939b 100644 --- a/packages/osmojs/src/codegen/osmosis/superfluid/query.ts +++ b/packages/osmojs/src/codegen/osmosis/superfluid/query.ts @@ -1,10 +1,11 @@ import { PageRequest, PageRequestAmino, PageRequestSDKType, PageResponse, PageResponseAmino, PageResponseSDKType } from "../../cosmos/base/query/v1beta1/pagination"; import { Params, ParamsAmino, ParamsSDKType } from "./params"; -import { SuperfluidAssetType, SuperfluidAsset, SuperfluidAssetAmino, SuperfluidAssetSDKType, OsmoEquivalentMultiplierRecord, OsmoEquivalentMultiplierRecordAmino, OsmoEquivalentMultiplierRecordSDKType, SuperfluidDelegationRecord, SuperfluidDelegationRecordAmino, SuperfluidDelegationRecordSDKType, ConcentratedPoolUserPositionRecord, ConcentratedPoolUserPositionRecordAmino, ConcentratedPoolUserPositionRecordSDKType, superfluidAssetTypeFromJSON } from "./superfluid"; +import { SuperfluidAssetType, SuperfluidAsset, SuperfluidAssetAmino, SuperfluidAssetSDKType, OsmoEquivalentMultiplierRecord, OsmoEquivalentMultiplierRecordAmino, OsmoEquivalentMultiplierRecordSDKType, SuperfluidDelegationRecord, SuperfluidDelegationRecordAmino, SuperfluidDelegationRecordSDKType, ConcentratedPoolUserPositionRecord, ConcentratedPoolUserPositionRecordAmino, ConcentratedPoolUserPositionRecordSDKType, superfluidAssetTypeFromJSON, superfluidAssetTypeToJSON } from "./superfluid"; import { Coin, CoinAmino, CoinSDKType } from "../../cosmos/base/v1beta1/coin"; import { SyntheticLock, SyntheticLockAmino, SyntheticLockSDKType } from "../lockup/lock"; import { DelegationResponse, DelegationResponseAmino, DelegationResponseSDKType } from "../../cosmos/staking/v1beta1/staking"; import { BinaryReader, BinaryWriter } from "../../binary"; +import { GlobalDecoderRegistry } from "../../registry"; import { isSet } from "../../helpers"; export interface QueryParamsRequest {} export interface QueryParamsRequestProtoMsg { @@ -44,7 +45,7 @@ export interface AssetTypeRequestProtoMsg { value: Uint8Array; } export interface AssetTypeRequestAmino { - denom: string; + denom?: string; } export interface AssetTypeRequestAminoMsg { type: "osmosis/asset-type-request"; @@ -61,7 +62,7 @@ export interface AssetTypeResponseProtoMsg { value: Uint8Array; } export interface AssetTypeResponseAmino { - asset_type: SuperfluidAssetType; + asset_type?: SuperfluidAssetType; } export interface AssetTypeResponseAminoMsg { type: "osmosis/asset-type-response"; @@ -89,7 +90,7 @@ export interface AllAssetsResponseProtoMsg { value: Uint8Array; } export interface AllAssetsResponseAmino { - assets: SuperfluidAssetAmino[]; + assets?: SuperfluidAssetAmino[]; } export interface AllAssetsResponseAminoMsg { type: "osmosis/all-assets-response"; @@ -106,7 +107,7 @@ export interface AssetMultiplierRequestProtoMsg { value: Uint8Array; } export interface AssetMultiplierRequestAmino { - denom: string; + denom?: string; } export interface AssetMultiplierRequestAminoMsg { type: "osmosis/asset-multiplier-request"; @@ -116,7 +117,7 @@ export interface AssetMultiplierRequestSDKType { denom: string; } export interface AssetMultiplierResponse { - osmoEquivalentMultiplier: OsmoEquivalentMultiplierRecord; + osmoEquivalentMultiplier?: OsmoEquivalentMultiplierRecord; } export interface AssetMultiplierResponseProtoMsg { typeUrl: "/osmosis.superfluid.AssetMultiplierResponse"; @@ -130,7 +131,7 @@ export interface AssetMultiplierResponseAminoMsg { value: AssetMultiplierResponseAmino; } export interface AssetMultiplierResponseSDKType { - osmo_equivalent_multiplier: OsmoEquivalentMultiplierRecordSDKType; + osmo_equivalent_multiplier?: OsmoEquivalentMultiplierRecordSDKType; } export interface SuperfluidIntermediaryAccountInfo { denom: string; @@ -143,10 +144,10 @@ export interface SuperfluidIntermediaryAccountInfoProtoMsg { value: Uint8Array; } export interface SuperfluidIntermediaryAccountInfoAmino { - denom: string; - val_addr: string; - gauge_id: string; - address: string; + denom?: string; + val_addr?: string; + gauge_id?: string; + address?: string; } export interface SuperfluidIntermediaryAccountInfoAminoMsg { type: "osmosis/superfluid-intermediary-account-info"; @@ -159,7 +160,7 @@ export interface SuperfluidIntermediaryAccountInfoSDKType { address: string; } export interface AllIntermediaryAccountsRequest { - pagination: PageRequest; + pagination?: PageRequest; } export interface AllIntermediaryAccountsRequestProtoMsg { typeUrl: "/osmosis.superfluid.AllIntermediaryAccountsRequest"; @@ -173,18 +174,18 @@ export interface AllIntermediaryAccountsRequestAminoMsg { value: AllIntermediaryAccountsRequestAmino; } export interface AllIntermediaryAccountsRequestSDKType { - pagination: PageRequestSDKType; + pagination?: PageRequestSDKType; } export interface AllIntermediaryAccountsResponse { accounts: SuperfluidIntermediaryAccountInfo[]; - pagination: PageResponse; + pagination?: PageResponse; } export interface AllIntermediaryAccountsResponseProtoMsg { typeUrl: "/osmosis.superfluid.AllIntermediaryAccountsResponse"; value: Uint8Array; } export interface AllIntermediaryAccountsResponseAmino { - accounts: SuperfluidIntermediaryAccountInfoAmino[]; + accounts?: SuperfluidIntermediaryAccountInfoAmino[]; pagination?: PageResponseAmino; } export interface AllIntermediaryAccountsResponseAminoMsg { @@ -193,7 +194,7 @@ export interface AllIntermediaryAccountsResponseAminoMsg { } export interface AllIntermediaryAccountsResponseSDKType { accounts: SuperfluidIntermediaryAccountInfoSDKType[]; - pagination: PageResponseSDKType; + pagination?: PageResponseSDKType; } export interface ConnectedIntermediaryAccountRequest { lockId: bigint; @@ -203,7 +204,7 @@ export interface ConnectedIntermediaryAccountRequestProtoMsg { value: Uint8Array; } export interface ConnectedIntermediaryAccountRequestAmino { - lock_id: string; + lock_id?: string; } export interface ConnectedIntermediaryAccountRequestAminoMsg { type: "osmosis/connected-intermediary-account-request"; @@ -213,7 +214,7 @@ export interface ConnectedIntermediaryAccountRequestSDKType { lock_id: bigint; } export interface ConnectedIntermediaryAccountResponse { - account: SuperfluidIntermediaryAccountInfo; + account?: SuperfluidIntermediaryAccountInfo; } export interface ConnectedIntermediaryAccountResponseProtoMsg { typeUrl: "/osmosis.superfluid.ConnectedIntermediaryAccountResponse"; @@ -227,7 +228,7 @@ export interface ConnectedIntermediaryAccountResponseAminoMsg { value: ConnectedIntermediaryAccountResponseAmino; } export interface ConnectedIntermediaryAccountResponseSDKType { - account: SuperfluidIntermediaryAccountInfoSDKType; + account?: SuperfluidIntermediaryAccountInfoSDKType; } export interface QueryTotalDelegationByValidatorForDenomRequest { denom: string; @@ -237,7 +238,7 @@ export interface QueryTotalDelegationByValidatorForDenomRequestProtoMsg { value: Uint8Array; } export interface QueryTotalDelegationByValidatorForDenomRequestAmino { - denom: string; + denom?: string; } export interface QueryTotalDelegationByValidatorForDenomRequestAminoMsg { type: "osmosis/query-total-delegation-by-validator-for-denom-request"; @@ -254,7 +255,7 @@ export interface QueryTotalDelegationByValidatorForDenomResponseProtoMsg { value: Uint8Array; } export interface QueryTotalDelegationByValidatorForDenomResponseAmino { - assets: DelegationsAmino[]; + assets?: DelegationsAmino[]; } export interface QueryTotalDelegationByValidatorForDenomResponseAminoMsg { type: "osmosis/query-total-delegation-by-validator-for-denom-response"; @@ -273,9 +274,9 @@ export interface DelegationsProtoMsg { value: Uint8Array; } export interface DelegationsAmino { - val_addr: string; - amount_sfsd: string; - osmo_equivalent: string; + val_addr?: string; + amount_sfsd?: string; + osmo_equivalent?: string; } export interface DelegationsAminoMsg { type: "osmosis/delegations"; @@ -305,7 +306,7 @@ export interface TotalSuperfluidDelegationsResponseProtoMsg { value: Uint8Array; } export interface TotalSuperfluidDelegationsResponseAmino { - total_delegations: string; + total_delegations?: string; } export interface TotalSuperfluidDelegationsResponseAminoMsg { type: "osmosis/total-superfluid-delegations-response"; @@ -324,9 +325,9 @@ export interface SuperfluidDelegationAmountRequestProtoMsg { value: Uint8Array; } export interface SuperfluidDelegationAmountRequestAmino { - delegator_address: string; - validator_address: string; - denom: string; + delegator_address?: string; + validator_address?: string; + denom?: string; } export interface SuperfluidDelegationAmountRequestAminoMsg { type: "osmosis/superfluid-delegation-amount-request"; @@ -345,7 +346,7 @@ export interface SuperfluidDelegationAmountResponseProtoMsg { value: Uint8Array; } export interface SuperfluidDelegationAmountResponseAmino { - amount: CoinAmino[]; + amount?: CoinAmino[]; } export interface SuperfluidDelegationAmountResponseAminoMsg { type: "osmosis/superfluid-delegation-amount-response"; @@ -362,7 +363,7 @@ export interface SuperfluidDelegationsByDelegatorRequestProtoMsg { value: Uint8Array; } export interface SuperfluidDelegationsByDelegatorRequestAmino { - delegator_address: string; + delegator_address?: string; } export interface SuperfluidDelegationsByDelegatorRequestAminoMsg { type: "osmosis/superfluid-delegations-by-delegator-request"; @@ -381,8 +382,8 @@ export interface SuperfluidDelegationsByDelegatorResponseProtoMsg { value: Uint8Array; } export interface SuperfluidDelegationsByDelegatorResponseAmino { - superfluid_delegation_records: SuperfluidDelegationRecordAmino[]; - total_delegated_coins: CoinAmino[]; + superfluid_delegation_records?: SuperfluidDelegationRecordAmino[]; + total_delegated_coins?: CoinAmino[]; total_equivalent_staked_amount?: CoinAmino; } export interface SuperfluidDelegationsByDelegatorResponseAminoMsg { @@ -403,8 +404,8 @@ export interface SuperfluidUndelegationsByDelegatorRequestProtoMsg { value: Uint8Array; } export interface SuperfluidUndelegationsByDelegatorRequestAmino { - delegator_address: string; - denom: string; + delegator_address?: string; + denom?: string; } export interface SuperfluidUndelegationsByDelegatorRequestAminoMsg { type: "osmosis/superfluid-undelegations-by-delegator-request"; @@ -424,9 +425,9 @@ export interface SuperfluidUndelegationsByDelegatorResponseProtoMsg { value: Uint8Array; } export interface SuperfluidUndelegationsByDelegatorResponseAmino { - superfluid_delegation_records: SuperfluidDelegationRecordAmino[]; - total_undelegated_coins: CoinAmino[]; - synthetic_locks: SyntheticLockAmino[]; + superfluid_delegation_records?: SuperfluidDelegationRecordAmino[]; + total_undelegated_coins?: CoinAmino[]; + synthetic_locks?: SyntheticLockAmino[]; } export interface SuperfluidUndelegationsByDelegatorResponseAminoMsg { type: "osmosis/superfluid-undelegations-by-delegator-response"; @@ -446,8 +447,8 @@ export interface SuperfluidDelegationsByValidatorDenomRequestProtoMsg { value: Uint8Array; } export interface SuperfluidDelegationsByValidatorDenomRequestAmino { - validator_address: string; - denom: string; + validator_address?: string; + denom?: string; } export interface SuperfluidDelegationsByValidatorDenomRequestAminoMsg { type: "osmosis/superfluid-delegations-by-validator-denom-request"; @@ -465,7 +466,7 @@ export interface SuperfluidDelegationsByValidatorDenomResponseProtoMsg { value: Uint8Array; } export interface SuperfluidDelegationsByValidatorDenomResponseAmino { - superfluid_delegation_records: SuperfluidDelegationRecordAmino[]; + superfluid_delegation_records?: SuperfluidDelegationRecordAmino[]; } export interface SuperfluidDelegationsByValidatorDenomResponseAminoMsg { type: "osmosis/superfluid-delegations-by-validator-denom-response"; @@ -483,8 +484,8 @@ export interface EstimateSuperfluidDelegatedAmountByValidatorDenomRequestProtoMs value: Uint8Array; } export interface EstimateSuperfluidDelegatedAmountByValidatorDenomRequestAmino { - validator_address: string; - denom: string; + validator_address?: string; + denom?: string; } export interface EstimateSuperfluidDelegatedAmountByValidatorDenomRequestAminoMsg { type: "osmosis/estimate-superfluid-delegated-amount-by-validator-denom-request"; @@ -502,7 +503,7 @@ export interface EstimateSuperfluidDelegatedAmountByValidatorDenomResponseProtoM value: Uint8Array; } export interface EstimateSuperfluidDelegatedAmountByValidatorDenomResponseAmino { - total_delegated_coins: CoinAmino[]; + total_delegated_coins?: CoinAmino[]; } export interface EstimateSuperfluidDelegatedAmountByValidatorDenomResponseAminoMsg { type: "osmosis/estimate-superfluid-delegated-amount-by-validator-denom-response"; @@ -519,7 +520,7 @@ export interface QueryTotalDelegationByDelegatorRequestProtoMsg { value: Uint8Array; } export interface QueryTotalDelegationByDelegatorRequestAmino { - delegator_address: string; + delegator_address?: string; } export interface QueryTotalDelegationByDelegatorRequestAminoMsg { type: "osmosis/query-total-delegation-by-delegator-request"; @@ -539,9 +540,9 @@ export interface QueryTotalDelegationByDelegatorResponseProtoMsg { value: Uint8Array; } export interface QueryTotalDelegationByDelegatorResponseAmino { - superfluid_delegation_records: SuperfluidDelegationRecordAmino[]; - delegation_response: DelegationResponseAmino[]; - total_delegated_coins: CoinAmino[]; + superfluid_delegation_records?: SuperfluidDelegationRecordAmino[]; + delegation_response?: DelegationResponseAmino[]; + total_delegated_coins?: CoinAmino[]; total_equivalent_staked_amount?: CoinAmino; } export interface QueryTotalDelegationByDelegatorResponseAminoMsg { @@ -573,7 +574,7 @@ export interface QueryUnpoolWhitelistResponseProtoMsg { value: Uint8Array; } export interface QueryUnpoolWhitelistResponseAmino { - pool_ids: string[]; + pool_ids?: string[]; } export interface QueryUnpoolWhitelistResponseAminoMsg { type: "osmosis/query-unpool-whitelist-response"; @@ -590,7 +591,7 @@ export interface UserConcentratedSuperfluidPositionsDelegatedRequestProtoMsg { value: Uint8Array; } export interface UserConcentratedSuperfluidPositionsDelegatedRequestAmino { - delegator_address: string; + delegator_address?: string; } export interface UserConcentratedSuperfluidPositionsDelegatedRequestAminoMsg { type: "osmosis/user-concentrated-superfluid-positions-delegated-request"; @@ -607,7 +608,7 @@ export interface UserConcentratedSuperfluidPositionsDelegatedResponseProtoMsg { value: Uint8Array; } export interface UserConcentratedSuperfluidPositionsDelegatedResponseAmino { - cl_pool_user_position_records: ConcentratedPoolUserPositionRecordAmino[]; + cl_pool_user_position_records?: ConcentratedPoolUserPositionRecordAmino[]; } export interface UserConcentratedSuperfluidPositionsDelegatedResponseAminoMsg { type: "osmosis/user-concentrated-superfluid-positions-delegated-response"; @@ -624,7 +625,7 @@ export interface UserConcentratedSuperfluidPositionsUndelegatingRequestProtoMsg value: Uint8Array; } export interface UserConcentratedSuperfluidPositionsUndelegatingRequestAmino { - delegator_address: string; + delegator_address?: string; } export interface UserConcentratedSuperfluidPositionsUndelegatingRequestAminoMsg { type: "osmosis/user-concentrated-superfluid-positions-undelegating-request"; @@ -641,7 +642,7 @@ export interface UserConcentratedSuperfluidPositionsUndelegatingResponseProtoMsg value: Uint8Array; } export interface UserConcentratedSuperfluidPositionsUndelegatingResponseAmino { - cl_pool_user_position_records: ConcentratedPoolUserPositionRecordAmino[]; + cl_pool_user_position_records?: ConcentratedPoolUserPositionRecordAmino[]; } export interface UserConcentratedSuperfluidPositionsUndelegatingResponseAminoMsg { type: "osmosis/user-concentrated-superfluid-positions-undelegating-response"; @@ -650,11 +651,62 @@ export interface UserConcentratedSuperfluidPositionsUndelegatingResponseAminoMsg export interface UserConcentratedSuperfluidPositionsUndelegatingResponseSDKType { cl_pool_user_position_records: ConcentratedPoolUserPositionRecordSDKType[]; } +/** THIS QUERY IS TEMPORARY */ +export interface QueryRestSupplyRequest { + /** THIS QUERY IS TEMPORARY */ + denom: string; +} +export interface QueryRestSupplyRequestProtoMsg { + typeUrl: "/osmosis.superfluid.QueryRestSupplyRequest"; + value: Uint8Array; +} +/** THIS QUERY IS TEMPORARY */ +export interface QueryRestSupplyRequestAmino { + /** THIS QUERY IS TEMPORARY */ + denom?: string; +} +export interface QueryRestSupplyRequestAminoMsg { + type: "osmosis/query-rest-supply-request"; + value: QueryRestSupplyRequestAmino; +} +/** THIS QUERY IS TEMPORARY */ +export interface QueryRestSupplyRequestSDKType { + denom: string; +} +export interface QueryRestSupplyResponse { + /** amount is the supply of the coin. */ + amount: Coin; +} +export interface QueryRestSupplyResponseProtoMsg { + typeUrl: "/osmosis.superfluid.QueryRestSupplyResponse"; + value: Uint8Array; +} +export interface QueryRestSupplyResponseAmino { + /** amount is the supply of the coin. */ + amount?: CoinAmino; +} +export interface QueryRestSupplyResponseAminoMsg { + type: "osmosis/query-rest-supply-response"; + value: QueryRestSupplyResponseAmino; +} +export interface QueryRestSupplyResponseSDKType { + amount: CoinSDKType; +} function createBaseQueryParamsRequest(): QueryParamsRequest { return {}; } export const QueryParamsRequest = { typeUrl: "/osmosis.superfluid.QueryParamsRequest", + aminoType: "osmosis/query-params-request", + is(o: any): o is QueryParamsRequest { + return o && o.$typeUrl === QueryParamsRequest.typeUrl; + }, + isSDK(o: any): o is QueryParamsRequestSDKType { + return o && o.$typeUrl === QueryParamsRequest.typeUrl; + }, + isAmino(o: any): o is QueryParamsRequestAmino { + return o && o.$typeUrl === QueryParamsRequest.typeUrl; + }, encode(_: QueryParamsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, @@ -672,12 +724,20 @@ export const QueryParamsRequest = { } return message; }, + fromJSON(_: any): QueryParamsRequest { + return {}; + }, + toJSON(_: QueryParamsRequest): unknown { + const obj: any = {}; + return obj; + }, fromPartial(_: Partial): QueryParamsRequest { const message = createBaseQueryParamsRequest(); return message; }, fromAmino(_: QueryParamsRequestAmino): QueryParamsRequest { - return {}; + const message = createBaseQueryParamsRequest(); + return message; }, toAmino(_: QueryParamsRequest): QueryParamsRequestAmino { const obj: any = {}; @@ -705,6 +765,8 @@ export const QueryParamsRequest = { }; } }; +GlobalDecoderRegistry.register(QueryParamsRequest.typeUrl, QueryParamsRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryParamsRequest.aminoType, QueryParamsRequest.typeUrl); function createBaseQueryParamsResponse(): QueryParamsResponse { return { params: Params.fromPartial({}) @@ -712,6 +774,16 @@ function createBaseQueryParamsResponse(): QueryParamsResponse { } export const QueryParamsResponse = { typeUrl: "/osmosis.superfluid.QueryParamsResponse", + aminoType: "osmosis/query-params-response", + is(o: any): o is QueryParamsResponse { + return o && (o.$typeUrl === QueryParamsResponse.typeUrl || Params.is(o.params)); + }, + isSDK(o: any): o is QueryParamsResponseSDKType { + return o && (o.$typeUrl === QueryParamsResponse.typeUrl || Params.isSDK(o.params)); + }, + isAmino(o: any): o is QueryParamsResponseAmino { + return o && (o.$typeUrl === QueryParamsResponse.typeUrl || Params.isAmino(o.params)); + }, encode(message: QueryParamsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.params !== undefined) { Params.encode(message.params, writer.uint32(10).fork()).ldelim(); @@ -735,15 +807,27 @@ export const QueryParamsResponse = { } return message; }, + fromJSON(object: any): QueryParamsResponse { + 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; + }, fromPartial(object: Partial): QueryParamsResponse { const message = createBaseQueryParamsResponse(); message.params = object.params !== undefined && object.params !== null ? Params.fromPartial(object.params) : undefined; return message; }, fromAmino(object: QueryParamsResponseAmino): QueryParamsResponse { - return { - params: object?.params ? Params.fromAmino(object.params) : undefined - }; + const message = createBaseQueryParamsResponse(); + if (object.params !== undefined && object.params !== null) { + message.params = Params.fromAmino(object.params); + } + return message; }, toAmino(message: QueryParamsResponse): QueryParamsResponseAmino { const obj: any = {}; @@ -772,6 +856,8 @@ export const QueryParamsResponse = { }; } }; +GlobalDecoderRegistry.register(QueryParamsResponse.typeUrl, QueryParamsResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryParamsResponse.aminoType, QueryParamsResponse.typeUrl); function createBaseAssetTypeRequest(): AssetTypeRequest { return { denom: "" @@ -779,6 +865,16 @@ function createBaseAssetTypeRequest(): AssetTypeRequest { } export const AssetTypeRequest = { typeUrl: "/osmosis.superfluid.AssetTypeRequest", + aminoType: "osmosis/asset-type-request", + is(o: any): o is AssetTypeRequest { + return o && (o.$typeUrl === AssetTypeRequest.typeUrl || typeof o.denom === "string"); + }, + isSDK(o: any): o is AssetTypeRequestSDKType { + return o && (o.$typeUrl === AssetTypeRequest.typeUrl || typeof o.denom === "string"); + }, + isAmino(o: any): o is AssetTypeRequestAmino { + return o && (o.$typeUrl === AssetTypeRequest.typeUrl || typeof o.denom === "string"); + }, encode(message: AssetTypeRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.denom !== "") { writer.uint32(10).string(message.denom); @@ -802,15 +898,27 @@ export const AssetTypeRequest = { } return message; }, + fromJSON(object: any): AssetTypeRequest { + return { + denom: isSet(object.denom) ? String(object.denom) : "" + }; + }, + toJSON(message: AssetTypeRequest): unknown { + const obj: any = {}; + message.denom !== undefined && (obj.denom = message.denom); + return obj; + }, fromPartial(object: Partial): AssetTypeRequest { const message = createBaseAssetTypeRequest(); message.denom = object.denom ?? ""; return message; }, fromAmino(object: AssetTypeRequestAmino): AssetTypeRequest { - return { - denom: object.denom - }; + const message = createBaseAssetTypeRequest(); + if (object.denom !== undefined && object.denom !== null) { + message.denom = object.denom; + } + return message; }, toAmino(message: AssetTypeRequest): AssetTypeRequestAmino { const obj: any = {}; @@ -839,6 +947,8 @@ export const AssetTypeRequest = { }; } }; +GlobalDecoderRegistry.register(AssetTypeRequest.typeUrl, AssetTypeRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(AssetTypeRequest.aminoType, AssetTypeRequest.typeUrl); function createBaseAssetTypeResponse(): AssetTypeResponse { return { assetType: 0 @@ -846,6 +956,16 @@ function createBaseAssetTypeResponse(): AssetTypeResponse { } export const AssetTypeResponse = { typeUrl: "/osmosis.superfluid.AssetTypeResponse", + aminoType: "osmosis/asset-type-response", + is(o: any): o is AssetTypeResponse { + return o && (o.$typeUrl === AssetTypeResponse.typeUrl || isSet(o.assetType)); + }, + isSDK(o: any): o is AssetTypeResponseSDKType { + return o && (o.$typeUrl === AssetTypeResponse.typeUrl || isSet(o.asset_type)); + }, + isAmino(o: any): o is AssetTypeResponseAmino { + return o && (o.$typeUrl === AssetTypeResponse.typeUrl || isSet(o.asset_type)); + }, encode(message: AssetTypeResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.assetType !== 0) { writer.uint32(8).int32(message.assetType); @@ -869,19 +989,31 @@ export const AssetTypeResponse = { } return message; }, + fromJSON(object: any): AssetTypeResponse { + return { + assetType: isSet(object.assetType) ? superfluidAssetTypeFromJSON(object.assetType) : -1 + }; + }, + toJSON(message: AssetTypeResponse): unknown { + const obj: any = {}; + message.assetType !== undefined && (obj.assetType = superfluidAssetTypeToJSON(message.assetType)); + return obj; + }, fromPartial(object: Partial): AssetTypeResponse { const message = createBaseAssetTypeResponse(); message.assetType = object.assetType ?? 0; return message; }, fromAmino(object: AssetTypeResponseAmino): AssetTypeResponse { - return { - assetType: isSet(object.asset_type) ? superfluidAssetTypeFromJSON(object.asset_type) : -1 - }; + const message = createBaseAssetTypeResponse(); + if (object.asset_type !== undefined && object.asset_type !== null) { + message.assetType = superfluidAssetTypeFromJSON(object.asset_type); + } + return message; }, toAmino(message: AssetTypeResponse): AssetTypeResponseAmino { const obj: any = {}; - obj.asset_type = message.assetType; + obj.asset_type = superfluidAssetTypeToJSON(message.assetType); return obj; }, fromAminoMsg(object: AssetTypeResponseAminoMsg): AssetTypeResponse { @@ -906,11 +1038,23 @@ export const AssetTypeResponse = { }; } }; +GlobalDecoderRegistry.register(AssetTypeResponse.typeUrl, AssetTypeResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(AssetTypeResponse.aminoType, AssetTypeResponse.typeUrl); function createBaseAllAssetsRequest(): AllAssetsRequest { return {}; } export const AllAssetsRequest = { typeUrl: "/osmosis.superfluid.AllAssetsRequest", + aminoType: "osmosis/all-assets-request", + is(o: any): o is AllAssetsRequest { + return o && o.$typeUrl === AllAssetsRequest.typeUrl; + }, + isSDK(o: any): o is AllAssetsRequestSDKType { + return o && o.$typeUrl === AllAssetsRequest.typeUrl; + }, + isAmino(o: any): o is AllAssetsRequestAmino { + return o && o.$typeUrl === AllAssetsRequest.typeUrl; + }, encode(_: AllAssetsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, @@ -928,12 +1072,20 @@ export const AllAssetsRequest = { } return message; }, + fromJSON(_: any): AllAssetsRequest { + return {}; + }, + toJSON(_: AllAssetsRequest): unknown { + const obj: any = {}; + return obj; + }, fromPartial(_: Partial): AllAssetsRequest { const message = createBaseAllAssetsRequest(); return message; }, fromAmino(_: AllAssetsRequestAmino): AllAssetsRequest { - return {}; + const message = createBaseAllAssetsRequest(); + return message; }, toAmino(_: AllAssetsRequest): AllAssetsRequestAmino { const obj: any = {}; @@ -961,6 +1113,8 @@ export const AllAssetsRequest = { }; } }; +GlobalDecoderRegistry.register(AllAssetsRequest.typeUrl, AllAssetsRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(AllAssetsRequest.aminoType, AllAssetsRequest.typeUrl); function createBaseAllAssetsResponse(): AllAssetsResponse { return { assets: [] @@ -968,6 +1122,16 @@ function createBaseAllAssetsResponse(): AllAssetsResponse { } export const AllAssetsResponse = { typeUrl: "/osmosis.superfluid.AllAssetsResponse", + aminoType: "osmosis/all-assets-response", + is(o: any): o is AllAssetsResponse { + return o && (o.$typeUrl === AllAssetsResponse.typeUrl || Array.isArray(o.assets) && (!o.assets.length || SuperfluidAsset.is(o.assets[0]))); + }, + isSDK(o: any): o is AllAssetsResponseSDKType { + return o && (o.$typeUrl === AllAssetsResponse.typeUrl || Array.isArray(o.assets) && (!o.assets.length || SuperfluidAsset.isSDK(o.assets[0]))); + }, + isAmino(o: any): o is AllAssetsResponseAmino { + return o && (o.$typeUrl === AllAssetsResponse.typeUrl || Array.isArray(o.assets) && (!o.assets.length || SuperfluidAsset.isAmino(o.assets[0]))); + }, encode(message: AllAssetsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.assets) { SuperfluidAsset.encode(v!, writer.uint32(10).fork()).ldelim(); @@ -991,15 +1155,29 @@ export const AllAssetsResponse = { } return message; }, + fromJSON(object: any): AllAssetsResponse { + return { + assets: Array.isArray(object?.assets) ? object.assets.map((e: any) => SuperfluidAsset.fromJSON(e)) : [] + }; + }, + toJSON(message: AllAssetsResponse): unknown { + const obj: any = {}; + if (message.assets) { + obj.assets = message.assets.map(e => e ? SuperfluidAsset.toJSON(e) : undefined); + } else { + obj.assets = []; + } + return obj; + }, fromPartial(object: Partial): AllAssetsResponse { const message = createBaseAllAssetsResponse(); message.assets = object.assets?.map(e => SuperfluidAsset.fromPartial(e)) || []; return message; }, fromAmino(object: AllAssetsResponseAmino): AllAssetsResponse { - return { - assets: Array.isArray(object?.assets) ? object.assets.map((e: any) => SuperfluidAsset.fromAmino(e)) : [] - }; + const message = createBaseAllAssetsResponse(); + message.assets = object.assets?.map(e => SuperfluidAsset.fromAmino(e)) || []; + return message; }, toAmino(message: AllAssetsResponse): AllAssetsResponseAmino { const obj: any = {}; @@ -1032,6 +1210,8 @@ export const AllAssetsResponse = { }; } }; +GlobalDecoderRegistry.register(AllAssetsResponse.typeUrl, AllAssetsResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(AllAssetsResponse.aminoType, AllAssetsResponse.typeUrl); function createBaseAssetMultiplierRequest(): AssetMultiplierRequest { return { denom: "" @@ -1039,6 +1219,16 @@ function createBaseAssetMultiplierRequest(): AssetMultiplierRequest { } export const AssetMultiplierRequest = { typeUrl: "/osmosis.superfluid.AssetMultiplierRequest", + aminoType: "osmosis/asset-multiplier-request", + is(o: any): o is AssetMultiplierRequest { + return o && (o.$typeUrl === AssetMultiplierRequest.typeUrl || typeof o.denom === "string"); + }, + isSDK(o: any): o is AssetMultiplierRequestSDKType { + return o && (o.$typeUrl === AssetMultiplierRequest.typeUrl || typeof o.denom === "string"); + }, + isAmino(o: any): o is AssetMultiplierRequestAmino { + return o && (o.$typeUrl === AssetMultiplierRequest.typeUrl || typeof o.denom === "string"); + }, encode(message: AssetMultiplierRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.denom !== "") { writer.uint32(10).string(message.denom); @@ -1062,15 +1252,27 @@ export const AssetMultiplierRequest = { } return message; }, + fromJSON(object: any): AssetMultiplierRequest { + return { + denom: isSet(object.denom) ? String(object.denom) : "" + }; + }, + toJSON(message: AssetMultiplierRequest): unknown { + const obj: any = {}; + message.denom !== undefined && (obj.denom = message.denom); + return obj; + }, fromPartial(object: Partial): AssetMultiplierRequest { const message = createBaseAssetMultiplierRequest(); message.denom = object.denom ?? ""; return message; }, fromAmino(object: AssetMultiplierRequestAmino): AssetMultiplierRequest { - return { - denom: object.denom - }; + const message = createBaseAssetMultiplierRequest(); + if (object.denom !== undefined && object.denom !== null) { + message.denom = object.denom; + } + return message; }, toAmino(message: AssetMultiplierRequest): AssetMultiplierRequestAmino { const obj: any = {}; @@ -1099,13 +1301,25 @@ export const AssetMultiplierRequest = { }; } }; +GlobalDecoderRegistry.register(AssetMultiplierRequest.typeUrl, AssetMultiplierRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(AssetMultiplierRequest.aminoType, AssetMultiplierRequest.typeUrl); function createBaseAssetMultiplierResponse(): AssetMultiplierResponse { return { - osmoEquivalentMultiplier: OsmoEquivalentMultiplierRecord.fromPartial({}) + osmoEquivalentMultiplier: undefined }; } export const AssetMultiplierResponse = { typeUrl: "/osmosis.superfluid.AssetMultiplierResponse", + aminoType: "osmosis/asset-multiplier-response", + is(o: any): o is AssetMultiplierResponse { + return o && o.$typeUrl === AssetMultiplierResponse.typeUrl; + }, + isSDK(o: any): o is AssetMultiplierResponseSDKType { + return o && o.$typeUrl === AssetMultiplierResponse.typeUrl; + }, + isAmino(o: any): o is AssetMultiplierResponseAmino { + return o && o.$typeUrl === AssetMultiplierResponse.typeUrl; + }, encode(message: AssetMultiplierResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.osmoEquivalentMultiplier !== undefined) { OsmoEquivalentMultiplierRecord.encode(message.osmoEquivalentMultiplier, writer.uint32(10).fork()).ldelim(); @@ -1129,15 +1343,27 @@ export const AssetMultiplierResponse = { } return message; }, + fromJSON(object: any): AssetMultiplierResponse { + return { + osmoEquivalentMultiplier: isSet(object.osmoEquivalentMultiplier) ? OsmoEquivalentMultiplierRecord.fromJSON(object.osmoEquivalentMultiplier) : undefined + }; + }, + toJSON(message: AssetMultiplierResponse): unknown { + const obj: any = {}; + message.osmoEquivalentMultiplier !== undefined && (obj.osmoEquivalentMultiplier = message.osmoEquivalentMultiplier ? OsmoEquivalentMultiplierRecord.toJSON(message.osmoEquivalentMultiplier) : undefined); + return obj; + }, fromPartial(object: Partial): AssetMultiplierResponse { const message = createBaseAssetMultiplierResponse(); message.osmoEquivalentMultiplier = object.osmoEquivalentMultiplier !== undefined && object.osmoEquivalentMultiplier !== null ? OsmoEquivalentMultiplierRecord.fromPartial(object.osmoEquivalentMultiplier) : undefined; return message; }, fromAmino(object: AssetMultiplierResponseAmino): AssetMultiplierResponse { - return { - osmoEquivalentMultiplier: object?.osmo_equivalent_multiplier ? OsmoEquivalentMultiplierRecord.fromAmino(object.osmo_equivalent_multiplier) : undefined - }; + const message = createBaseAssetMultiplierResponse(); + if (object.osmo_equivalent_multiplier !== undefined && object.osmo_equivalent_multiplier !== null) { + message.osmoEquivalentMultiplier = OsmoEquivalentMultiplierRecord.fromAmino(object.osmo_equivalent_multiplier); + } + return message; }, toAmino(message: AssetMultiplierResponse): AssetMultiplierResponseAmino { const obj: any = {}; @@ -1166,6 +1392,8 @@ export const AssetMultiplierResponse = { }; } }; +GlobalDecoderRegistry.register(AssetMultiplierResponse.typeUrl, AssetMultiplierResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(AssetMultiplierResponse.aminoType, AssetMultiplierResponse.typeUrl); function createBaseSuperfluidIntermediaryAccountInfo(): SuperfluidIntermediaryAccountInfo { return { denom: "", @@ -1176,6 +1404,16 @@ function createBaseSuperfluidIntermediaryAccountInfo(): SuperfluidIntermediaryAc } export const SuperfluidIntermediaryAccountInfo = { typeUrl: "/osmosis.superfluid.SuperfluidIntermediaryAccountInfo", + aminoType: "osmosis/superfluid-intermediary-account-info", + is(o: any): o is SuperfluidIntermediaryAccountInfo { + return o && (o.$typeUrl === SuperfluidIntermediaryAccountInfo.typeUrl || typeof o.denom === "string" && typeof o.valAddr === "string" && typeof o.gaugeId === "bigint" && typeof o.address === "string"); + }, + isSDK(o: any): o is SuperfluidIntermediaryAccountInfoSDKType { + return o && (o.$typeUrl === SuperfluidIntermediaryAccountInfo.typeUrl || typeof o.denom === "string" && typeof o.val_addr === "string" && typeof o.gauge_id === "bigint" && typeof o.address === "string"); + }, + isAmino(o: any): o is SuperfluidIntermediaryAccountInfoAmino { + return o && (o.$typeUrl === SuperfluidIntermediaryAccountInfo.typeUrl || typeof o.denom === "string" && typeof o.val_addr === "string" && typeof o.gauge_id === "bigint" && typeof o.address === "string"); + }, encode(message: SuperfluidIntermediaryAccountInfo, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.denom !== "") { writer.uint32(10).string(message.denom); @@ -1217,6 +1455,22 @@ export const SuperfluidIntermediaryAccountInfo = { } return message; }, + fromJSON(object: any): SuperfluidIntermediaryAccountInfo { + return { + denom: isSet(object.denom) ? String(object.denom) : "", + valAddr: isSet(object.valAddr) ? String(object.valAddr) : "", + gaugeId: isSet(object.gaugeId) ? BigInt(object.gaugeId.toString()) : BigInt(0), + address: isSet(object.address) ? String(object.address) : "" + }; + }, + toJSON(message: SuperfluidIntermediaryAccountInfo): unknown { + const obj: any = {}; + message.denom !== undefined && (obj.denom = message.denom); + message.valAddr !== undefined && (obj.valAddr = message.valAddr); + message.gaugeId !== undefined && (obj.gaugeId = (message.gaugeId || BigInt(0)).toString()); + message.address !== undefined && (obj.address = message.address); + return obj; + }, fromPartial(object: Partial): SuperfluidIntermediaryAccountInfo { const message = createBaseSuperfluidIntermediaryAccountInfo(); message.denom = object.denom ?? ""; @@ -1226,12 +1480,20 @@ export const SuperfluidIntermediaryAccountInfo = { return message; }, fromAmino(object: SuperfluidIntermediaryAccountInfoAmino): SuperfluidIntermediaryAccountInfo { - return { - denom: object.denom, - valAddr: object.val_addr, - gaugeId: BigInt(object.gauge_id), - address: object.address - }; + const message = createBaseSuperfluidIntermediaryAccountInfo(); + if (object.denom !== undefined && object.denom !== null) { + message.denom = object.denom; + } + if (object.val_addr !== undefined && object.val_addr !== null) { + message.valAddr = object.val_addr; + } + if (object.gauge_id !== undefined && object.gauge_id !== null) { + message.gaugeId = BigInt(object.gauge_id); + } + if (object.address !== undefined && object.address !== null) { + message.address = object.address; + } + return message; }, toAmino(message: SuperfluidIntermediaryAccountInfo): SuperfluidIntermediaryAccountInfoAmino { const obj: any = {}; @@ -1263,13 +1525,25 @@ export const SuperfluidIntermediaryAccountInfo = { }; } }; +GlobalDecoderRegistry.register(SuperfluidIntermediaryAccountInfo.typeUrl, SuperfluidIntermediaryAccountInfo); +GlobalDecoderRegistry.registerAminoProtoMapping(SuperfluidIntermediaryAccountInfo.aminoType, SuperfluidIntermediaryAccountInfo.typeUrl); function createBaseAllIntermediaryAccountsRequest(): AllIntermediaryAccountsRequest { return { - pagination: PageRequest.fromPartial({}) + pagination: undefined }; } export const AllIntermediaryAccountsRequest = { typeUrl: "/osmosis.superfluid.AllIntermediaryAccountsRequest", + aminoType: "osmosis/all-intermediary-accounts-request", + is(o: any): o is AllIntermediaryAccountsRequest { + return o && o.$typeUrl === AllIntermediaryAccountsRequest.typeUrl; + }, + isSDK(o: any): o is AllIntermediaryAccountsRequestSDKType { + return o && o.$typeUrl === AllIntermediaryAccountsRequest.typeUrl; + }, + isAmino(o: any): o is AllIntermediaryAccountsRequestAmino { + return o && o.$typeUrl === AllIntermediaryAccountsRequest.typeUrl; + }, encode(message: AllIntermediaryAccountsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.pagination !== undefined) { PageRequest.encode(message.pagination, writer.uint32(10).fork()).ldelim(); @@ -1293,15 +1567,27 @@ export const AllIntermediaryAccountsRequest = { } return message; }, + fromJSON(object: any): AllIntermediaryAccountsRequest { + return { + pagination: isSet(object.pagination) ? PageRequest.fromJSON(object.pagination) : undefined + }; + }, + toJSON(message: AllIntermediaryAccountsRequest): unknown { + const obj: any = {}; + message.pagination !== undefined && (obj.pagination = message.pagination ? PageRequest.toJSON(message.pagination) : undefined); + return obj; + }, fromPartial(object: Partial): AllIntermediaryAccountsRequest { const message = createBaseAllIntermediaryAccountsRequest(); message.pagination = object.pagination !== undefined && object.pagination !== null ? PageRequest.fromPartial(object.pagination) : undefined; return message; }, fromAmino(object: AllIntermediaryAccountsRequestAmino): AllIntermediaryAccountsRequest { - return { - pagination: object?.pagination ? PageRequest.fromAmino(object.pagination) : undefined - }; + const message = createBaseAllIntermediaryAccountsRequest(); + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromAmino(object.pagination); + } + return message; }, toAmino(message: AllIntermediaryAccountsRequest): AllIntermediaryAccountsRequestAmino { const obj: any = {}; @@ -1330,14 +1616,26 @@ export const AllIntermediaryAccountsRequest = { }; } }; +GlobalDecoderRegistry.register(AllIntermediaryAccountsRequest.typeUrl, AllIntermediaryAccountsRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(AllIntermediaryAccountsRequest.aminoType, AllIntermediaryAccountsRequest.typeUrl); function createBaseAllIntermediaryAccountsResponse(): AllIntermediaryAccountsResponse { return { accounts: [], - pagination: PageResponse.fromPartial({}) + pagination: undefined }; } export const AllIntermediaryAccountsResponse = { typeUrl: "/osmosis.superfluid.AllIntermediaryAccountsResponse", + aminoType: "osmosis/all-intermediary-accounts-response", + is(o: any): o is AllIntermediaryAccountsResponse { + return o && (o.$typeUrl === AllIntermediaryAccountsResponse.typeUrl || Array.isArray(o.accounts) && (!o.accounts.length || SuperfluidIntermediaryAccountInfo.is(o.accounts[0]))); + }, + isSDK(o: any): o is AllIntermediaryAccountsResponseSDKType { + return o && (o.$typeUrl === AllIntermediaryAccountsResponse.typeUrl || Array.isArray(o.accounts) && (!o.accounts.length || SuperfluidIntermediaryAccountInfo.isSDK(o.accounts[0]))); + }, + isAmino(o: any): o is AllIntermediaryAccountsResponseAmino { + return o && (o.$typeUrl === AllIntermediaryAccountsResponse.typeUrl || Array.isArray(o.accounts) && (!o.accounts.length || SuperfluidIntermediaryAccountInfo.isAmino(o.accounts[0]))); + }, encode(message: AllIntermediaryAccountsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.accounts) { SuperfluidIntermediaryAccountInfo.encode(v!, writer.uint32(10).fork()).ldelim(); @@ -1367,6 +1665,22 @@ export const AllIntermediaryAccountsResponse = { } return message; }, + fromJSON(object: any): AllIntermediaryAccountsResponse { + return { + accounts: Array.isArray(object?.accounts) ? object.accounts.map((e: any) => SuperfluidIntermediaryAccountInfo.fromJSON(e)) : [], + pagination: isSet(object.pagination) ? PageResponse.fromJSON(object.pagination) : undefined + }; + }, + toJSON(message: AllIntermediaryAccountsResponse): unknown { + const obj: any = {}; + if (message.accounts) { + obj.accounts = message.accounts.map(e => e ? SuperfluidIntermediaryAccountInfo.toJSON(e) : undefined); + } else { + obj.accounts = []; + } + message.pagination !== undefined && (obj.pagination = message.pagination ? PageResponse.toJSON(message.pagination) : undefined); + return obj; + }, fromPartial(object: Partial): AllIntermediaryAccountsResponse { const message = createBaseAllIntermediaryAccountsResponse(); message.accounts = object.accounts?.map(e => SuperfluidIntermediaryAccountInfo.fromPartial(e)) || []; @@ -1374,10 +1688,12 @@ export const AllIntermediaryAccountsResponse = { return message; }, fromAmino(object: AllIntermediaryAccountsResponseAmino): AllIntermediaryAccountsResponse { - return { - accounts: Array.isArray(object?.accounts) ? object.accounts.map((e: any) => SuperfluidIntermediaryAccountInfo.fromAmino(e)) : [], - pagination: object?.pagination ? PageResponse.fromAmino(object.pagination) : undefined - }; + const message = createBaseAllIntermediaryAccountsResponse(); + message.accounts = object.accounts?.map(e => SuperfluidIntermediaryAccountInfo.fromAmino(e)) || []; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromAmino(object.pagination); + } + return message; }, toAmino(message: AllIntermediaryAccountsResponse): AllIntermediaryAccountsResponseAmino { const obj: any = {}; @@ -1411,6 +1727,8 @@ export const AllIntermediaryAccountsResponse = { }; } }; +GlobalDecoderRegistry.register(AllIntermediaryAccountsResponse.typeUrl, AllIntermediaryAccountsResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(AllIntermediaryAccountsResponse.aminoType, AllIntermediaryAccountsResponse.typeUrl); function createBaseConnectedIntermediaryAccountRequest(): ConnectedIntermediaryAccountRequest { return { lockId: BigInt(0) @@ -1418,6 +1736,16 @@ function createBaseConnectedIntermediaryAccountRequest(): ConnectedIntermediaryA } export const ConnectedIntermediaryAccountRequest = { typeUrl: "/osmosis.superfluid.ConnectedIntermediaryAccountRequest", + aminoType: "osmosis/connected-intermediary-account-request", + is(o: any): o is ConnectedIntermediaryAccountRequest { + return o && (o.$typeUrl === ConnectedIntermediaryAccountRequest.typeUrl || typeof o.lockId === "bigint"); + }, + isSDK(o: any): o is ConnectedIntermediaryAccountRequestSDKType { + return o && (o.$typeUrl === ConnectedIntermediaryAccountRequest.typeUrl || typeof o.lock_id === "bigint"); + }, + isAmino(o: any): o is ConnectedIntermediaryAccountRequestAmino { + return o && (o.$typeUrl === ConnectedIntermediaryAccountRequest.typeUrl || typeof o.lock_id === "bigint"); + }, encode(message: ConnectedIntermediaryAccountRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.lockId !== BigInt(0)) { writer.uint32(8).uint64(message.lockId); @@ -1441,15 +1769,27 @@ export const ConnectedIntermediaryAccountRequest = { } return message; }, + fromJSON(object: any): ConnectedIntermediaryAccountRequest { + return { + lockId: isSet(object.lockId) ? BigInt(object.lockId.toString()) : BigInt(0) + }; + }, + toJSON(message: ConnectedIntermediaryAccountRequest): unknown { + const obj: any = {}; + message.lockId !== undefined && (obj.lockId = (message.lockId || BigInt(0)).toString()); + return obj; + }, fromPartial(object: Partial): ConnectedIntermediaryAccountRequest { const message = createBaseConnectedIntermediaryAccountRequest(); message.lockId = object.lockId !== undefined && object.lockId !== null ? BigInt(object.lockId.toString()) : BigInt(0); return message; }, fromAmino(object: ConnectedIntermediaryAccountRequestAmino): ConnectedIntermediaryAccountRequest { - return { - lockId: BigInt(object.lock_id) - }; + const message = createBaseConnectedIntermediaryAccountRequest(); + if (object.lock_id !== undefined && object.lock_id !== null) { + message.lockId = BigInt(object.lock_id); + } + return message; }, toAmino(message: ConnectedIntermediaryAccountRequest): ConnectedIntermediaryAccountRequestAmino { const obj: any = {}; @@ -1478,13 +1818,25 @@ export const ConnectedIntermediaryAccountRequest = { }; } }; +GlobalDecoderRegistry.register(ConnectedIntermediaryAccountRequest.typeUrl, ConnectedIntermediaryAccountRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(ConnectedIntermediaryAccountRequest.aminoType, ConnectedIntermediaryAccountRequest.typeUrl); function createBaseConnectedIntermediaryAccountResponse(): ConnectedIntermediaryAccountResponse { return { - account: SuperfluidIntermediaryAccountInfo.fromPartial({}) + account: undefined }; } export const ConnectedIntermediaryAccountResponse = { typeUrl: "/osmosis.superfluid.ConnectedIntermediaryAccountResponse", + aminoType: "osmosis/connected-intermediary-account-response", + is(o: any): o is ConnectedIntermediaryAccountResponse { + return o && o.$typeUrl === ConnectedIntermediaryAccountResponse.typeUrl; + }, + isSDK(o: any): o is ConnectedIntermediaryAccountResponseSDKType { + return o && o.$typeUrl === ConnectedIntermediaryAccountResponse.typeUrl; + }, + isAmino(o: any): o is ConnectedIntermediaryAccountResponseAmino { + return o && o.$typeUrl === ConnectedIntermediaryAccountResponse.typeUrl; + }, encode(message: ConnectedIntermediaryAccountResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.account !== undefined) { SuperfluidIntermediaryAccountInfo.encode(message.account, writer.uint32(10).fork()).ldelim(); @@ -1508,15 +1860,27 @@ export const ConnectedIntermediaryAccountResponse = { } return message; }, + fromJSON(object: any): ConnectedIntermediaryAccountResponse { + return { + account: isSet(object.account) ? SuperfluidIntermediaryAccountInfo.fromJSON(object.account) : undefined + }; + }, + toJSON(message: ConnectedIntermediaryAccountResponse): unknown { + const obj: any = {}; + message.account !== undefined && (obj.account = message.account ? SuperfluidIntermediaryAccountInfo.toJSON(message.account) : undefined); + return obj; + }, fromPartial(object: Partial): ConnectedIntermediaryAccountResponse { const message = createBaseConnectedIntermediaryAccountResponse(); message.account = object.account !== undefined && object.account !== null ? SuperfluidIntermediaryAccountInfo.fromPartial(object.account) : undefined; return message; }, fromAmino(object: ConnectedIntermediaryAccountResponseAmino): ConnectedIntermediaryAccountResponse { - return { - account: object?.account ? SuperfluidIntermediaryAccountInfo.fromAmino(object.account) : undefined - }; + const message = createBaseConnectedIntermediaryAccountResponse(); + if (object.account !== undefined && object.account !== null) { + message.account = SuperfluidIntermediaryAccountInfo.fromAmino(object.account); + } + return message; }, toAmino(message: ConnectedIntermediaryAccountResponse): ConnectedIntermediaryAccountResponseAmino { const obj: any = {}; @@ -1545,6 +1909,8 @@ export const ConnectedIntermediaryAccountResponse = { }; } }; +GlobalDecoderRegistry.register(ConnectedIntermediaryAccountResponse.typeUrl, ConnectedIntermediaryAccountResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(ConnectedIntermediaryAccountResponse.aminoType, ConnectedIntermediaryAccountResponse.typeUrl); function createBaseQueryTotalDelegationByValidatorForDenomRequest(): QueryTotalDelegationByValidatorForDenomRequest { return { denom: "" @@ -1552,6 +1918,16 @@ function createBaseQueryTotalDelegationByValidatorForDenomRequest(): QueryTotalD } export const QueryTotalDelegationByValidatorForDenomRequest = { typeUrl: "/osmosis.superfluid.QueryTotalDelegationByValidatorForDenomRequest", + aminoType: "osmosis/query-total-delegation-by-validator-for-denom-request", + is(o: any): o is QueryTotalDelegationByValidatorForDenomRequest { + return o && (o.$typeUrl === QueryTotalDelegationByValidatorForDenomRequest.typeUrl || typeof o.denom === "string"); + }, + isSDK(o: any): o is QueryTotalDelegationByValidatorForDenomRequestSDKType { + return o && (o.$typeUrl === QueryTotalDelegationByValidatorForDenomRequest.typeUrl || typeof o.denom === "string"); + }, + isAmino(o: any): o is QueryTotalDelegationByValidatorForDenomRequestAmino { + return o && (o.$typeUrl === QueryTotalDelegationByValidatorForDenomRequest.typeUrl || typeof o.denom === "string"); + }, encode(message: QueryTotalDelegationByValidatorForDenomRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.denom !== "") { writer.uint32(10).string(message.denom); @@ -1575,15 +1951,27 @@ export const QueryTotalDelegationByValidatorForDenomRequest = { } return message; }, + fromJSON(object: any): QueryTotalDelegationByValidatorForDenomRequest { + return { + denom: isSet(object.denom) ? String(object.denom) : "" + }; + }, + toJSON(message: QueryTotalDelegationByValidatorForDenomRequest): unknown { + const obj: any = {}; + message.denom !== undefined && (obj.denom = message.denom); + return obj; + }, fromPartial(object: Partial): QueryTotalDelegationByValidatorForDenomRequest { const message = createBaseQueryTotalDelegationByValidatorForDenomRequest(); message.denom = object.denom ?? ""; return message; }, fromAmino(object: QueryTotalDelegationByValidatorForDenomRequestAmino): QueryTotalDelegationByValidatorForDenomRequest { - return { - denom: object.denom - }; + const message = createBaseQueryTotalDelegationByValidatorForDenomRequest(); + if (object.denom !== undefined && object.denom !== null) { + message.denom = object.denom; + } + return message; }, toAmino(message: QueryTotalDelegationByValidatorForDenomRequest): QueryTotalDelegationByValidatorForDenomRequestAmino { const obj: any = {}; @@ -1612,6 +2000,8 @@ export const QueryTotalDelegationByValidatorForDenomRequest = { }; } }; +GlobalDecoderRegistry.register(QueryTotalDelegationByValidatorForDenomRequest.typeUrl, QueryTotalDelegationByValidatorForDenomRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryTotalDelegationByValidatorForDenomRequest.aminoType, QueryTotalDelegationByValidatorForDenomRequest.typeUrl); function createBaseQueryTotalDelegationByValidatorForDenomResponse(): QueryTotalDelegationByValidatorForDenomResponse { return { assets: [] @@ -1619,6 +2009,16 @@ function createBaseQueryTotalDelegationByValidatorForDenomResponse(): QueryTotal } export const QueryTotalDelegationByValidatorForDenomResponse = { typeUrl: "/osmosis.superfluid.QueryTotalDelegationByValidatorForDenomResponse", + aminoType: "osmosis/query-total-delegation-by-validator-for-denom-response", + is(o: any): o is QueryTotalDelegationByValidatorForDenomResponse { + return o && (o.$typeUrl === QueryTotalDelegationByValidatorForDenomResponse.typeUrl || Array.isArray(o.assets) && (!o.assets.length || Delegations.is(o.assets[0]))); + }, + isSDK(o: any): o is QueryTotalDelegationByValidatorForDenomResponseSDKType { + return o && (o.$typeUrl === QueryTotalDelegationByValidatorForDenomResponse.typeUrl || Array.isArray(o.assets) && (!o.assets.length || Delegations.isSDK(o.assets[0]))); + }, + isAmino(o: any): o is QueryTotalDelegationByValidatorForDenomResponseAmino { + return o && (o.$typeUrl === QueryTotalDelegationByValidatorForDenomResponse.typeUrl || Array.isArray(o.assets) && (!o.assets.length || Delegations.isAmino(o.assets[0]))); + }, encode(message: QueryTotalDelegationByValidatorForDenomResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.assets) { Delegations.encode(v!, writer.uint32(10).fork()).ldelim(); @@ -1642,15 +2042,29 @@ export const QueryTotalDelegationByValidatorForDenomResponse = { } return message; }, + fromJSON(object: any): QueryTotalDelegationByValidatorForDenomResponse { + return { + assets: Array.isArray(object?.assets) ? object.assets.map((e: any) => Delegations.fromJSON(e)) : [] + }; + }, + toJSON(message: QueryTotalDelegationByValidatorForDenomResponse): unknown { + const obj: any = {}; + if (message.assets) { + obj.assets = message.assets.map(e => e ? Delegations.toJSON(e) : undefined); + } else { + obj.assets = []; + } + return obj; + }, fromPartial(object: Partial): QueryTotalDelegationByValidatorForDenomResponse { const message = createBaseQueryTotalDelegationByValidatorForDenomResponse(); message.assets = object.assets?.map(e => Delegations.fromPartial(e)) || []; return message; }, fromAmino(object: QueryTotalDelegationByValidatorForDenomResponseAmino): QueryTotalDelegationByValidatorForDenomResponse { - return { - assets: Array.isArray(object?.assets) ? object.assets.map((e: any) => Delegations.fromAmino(e)) : [] - }; + const message = createBaseQueryTotalDelegationByValidatorForDenomResponse(); + message.assets = object.assets?.map(e => Delegations.fromAmino(e)) || []; + return message; }, toAmino(message: QueryTotalDelegationByValidatorForDenomResponse): QueryTotalDelegationByValidatorForDenomResponseAmino { const obj: any = {}; @@ -1683,6 +2097,8 @@ export const QueryTotalDelegationByValidatorForDenomResponse = { }; } }; +GlobalDecoderRegistry.register(QueryTotalDelegationByValidatorForDenomResponse.typeUrl, QueryTotalDelegationByValidatorForDenomResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryTotalDelegationByValidatorForDenomResponse.aminoType, QueryTotalDelegationByValidatorForDenomResponse.typeUrl); function createBaseDelegations(): Delegations { return { valAddr: "", @@ -1692,7 +2108,17 @@ function createBaseDelegations(): Delegations { } export const Delegations = { typeUrl: "/osmosis.superfluid.Delegations", - encode(message: Delegations, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + aminoType: "osmosis/delegations", + is(o: any): o is Delegations { + return o && (o.$typeUrl === Delegations.typeUrl || typeof o.valAddr === "string" && typeof o.amountSfsd === "string" && typeof o.osmoEquivalent === "string"); + }, + isSDK(o: any): o is DelegationsSDKType { + return o && (o.$typeUrl === Delegations.typeUrl || typeof o.val_addr === "string" && typeof o.amount_sfsd === "string" && typeof o.osmo_equivalent === "string"); + }, + isAmino(o: any): o is DelegationsAmino { + return o && (o.$typeUrl === Delegations.typeUrl || typeof o.val_addr === "string" && typeof o.amount_sfsd === "string" && typeof o.osmo_equivalent === "string"); + }, + encode(message: Delegations, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.valAddr !== "") { writer.uint32(10).string(message.valAddr); } @@ -1727,6 +2153,20 @@ export const Delegations = { } return message; }, + fromJSON(object: any): Delegations { + return { + valAddr: isSet(object.valAddr) ? String(object.valAddr) : "", + amountSfsd: isSet(object.amountSfsd) ? String(object.amountSfsd) : "", + osmoEquivalent: isSet(object.osmoEquivalent) ? String(object.osmoEquivalent) : "" + }; + }, + toJSON(message: Delegations): unknown { + const obj: any = {}; + message.valAddr !== undefined && (obj.valAddr = message.valAddr); + message.amountSfsd !== undefined && (obj.amountSfsd = message.amountSfsd); + message.osmoEquivalent !== undefined && (obj.osmoEquivalent = message.osmoEquivalent); + return obj; + }, fromPartial(object: Partial): Delegations { const message = createBaseDelegations(); message.valAddr = object.valAddr ?? ""; @@ -1735,11 +2175,17 @@ export const Delegations = { return message; }, fromAmino(object: DelegationsAmino): Delegations { - return { - valAddr: object.val_addr, - amountSfsd: object.amount_sfsd, - osmoEquivalent: object.osmo_equivalent - }; + const message = createBaseDelegations(); + if (object.val_addr !== undefined && object.val_addr !== null) { + message.valAddr = object.val_addr; + } + if (object.amount_sfsd !== undefined && object.amount_sfsd !== null) { + message.amountSfsd = object.amount_sfsd; + } + if (object.osmo_equivalent !== undefined && object.osmo_equivalent !== null) { + message.osmoEquivalent = object.osmo_equivalent; + } + return message; }, toAmino(message: Delegations): DelegationsAmino { const obj: any = {}; @@ -1770,11 +2216,23 @@ export const Delegations = { }; } }; +GlobalDecoderRegistry.register(Delegations.typeUrl, Delegations); +GlobalDecoderRegistry.registerAminoProtoMapping(Delegations.aminoType, Delegations.typeUrl); function createBaseTotalSuperfluidDelegationsRequest(): TotalSuperfluidDelegationsRequest { return {}; } export const TotalSuperfluidDelegationsRequest = { typeUrl: "/osmosis.superfluid.TotalSuperfluidDelegationsRequest", + aminoType: "osmosis/total-superfluid-delegations-request", + is(o: any): o is TotalSuperfluidDelegationsRequest { + return o && o.$typeUrl === TotalSuperfluidDelegationsRequest.typeUrl; + }, + isSDK(o: any): o is TotalSuperfluidDelegationsRequestSDKType { + return o && o.$typeUrl === TotalSuperfluidDelegationsRequest.typeUrl; + }, + isAmino(o: any): o is TotalSuperfluidDelegationsRequestAmino { + return o && o.$typeUrl === TotalSuperfluidDelegationsRequest.typeUrl; + }, encode(_: TotalSuperfluidDelegationsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, @@ -1792,12 +2250,20 @@ export const TotalSuperfluidDelegationsRequest = { } return message; }, + fromJSON(_: any): TotalSuperfluidDelegationsRequest { + return {}; + }, + toJSON(_: TotalSuperfluidDelegationsRequest): unknown { + const obj: any = {}; + return obj; + }, fromPartial(_: Partial): TotalSuperfluidDelegationsRequest { const message = createBaseTotalSuperfluidDelegationsRequest(); return message; }, fromAmino(_: TotalSuperfluidDelegationsRequestAmino): TotalSuperfluidDelegationsRequest { - return {}; + const message = createBaseTotalSuperfluidDelegationsRequest(); + return message; }, toAmino(_: TotalSuperfluidDelegationsRequest): TotalSuperfluidDelegationsRequestAmino { const obj: any = {}; @@ -1825,6 +2291,8 @@ export const TotalSuperfluidDelegationsRequest = { }; } }; +GlobalDecoderRegistry.register(TotalSuperfluidDelegationsRequest.typeUrl, TotalSuperfluidDelegationsRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(TotalSuperfluidDelegationsRequest.aminoType, TotalSuperfluidDelegationsRequest.typeUrl); function createBaseTotalSuperfluidDelegationsResponse(): TotalSuperfluidDelegationsResponse { return { totalDelegations: "" @@ -1832,6 +2300,16 @@ function createBaseTotalSuperfluidDelegationsResponse(): TotalSuperfluidDelegati } export const TotalSuperfluidDelegationsResponse = { typeUrl: "/osmosis.superfluid.TotalSuperfluidDelegationsResponse", + aminoType: "osmosis/total-superfluid-delegations-response", + is(o: any): o is TotalSuperfluidDelegationsResponse { + return o && (o.$typeUrl === TotalSuperfluidDelegationsResponse.typeUrl || typeof o.totalDelegations === "string"); + }, + isSDK(o: any): o is TotalSuperfluidDelegationsResponseSDKType { + return o && (o.$typeUrl === TotalSuperfluidDelegationsResponse.typeUrl || typeof o.total_delegations === "string"); + }, + isAmino(o: any): o is TotalSuperfluidDelegationsResponseAmino { + return o && (o.$typeUrl === TotalSuperfluidDelegationsResponse.typeUrl || typeof o.total_delegations === "string"); + }, encode(message: TotalSuperfluidDelegationsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.totalDelegations !== "") { writer.uint32(10).string(message.totalDelegations); @@ -1855,15 +2333,27 @@ export const TotalSuperfluidDelegationsResponse = { } return message; }, + fromJSON(object: any): TotalSuperfluidDelegationsResponse { + return { + totalDelegations: isSet(object.totalDelegations) ? String(object.totalDelegations) : "" + }; + }, + toJSON(message: TotalSuperfluidDelegationsResponse): unknown { + const obj: any = {}; + message.totalDelegations !== undefined && (obj.totalDelegations = message.totalDelegations); + return obj; + }, fromPartial(object: Partial): TotalSuperfluidDelegationsResponse { const message = createBaseTotalSuperfluidDelegationsResponse(); message.totalDelegations = object.totalDelegations ?? ""; return message; }, fromAmino(object: TotalSuperfluidDelegationsResponseAmino): TotalSuperfluidDelegationsResponse { - return { - totalDelegations: object.total_delegations - }; + const message = createBaseTotalSuperfluidDelegationsResponse(); + if (object.total_delegations !== undefined && object.total_delegations !== null) { + message.totalDelegations = object.total_delegations; + } + return message; }, toAmino(message: TotalSuperfluidDelegationsResponse): TotalSuperfluidDelegationsResponseAmino { const obj: any = {}; @@ -1892,6 +2382,8 @@ export const TotalSuperfluidDelegationsResponse = { }; } }; +GlobalDecoderRegistry.register(TotalSuperfluidDelegationsResponse.typeUrl, TotalSuperfluidDelegationsResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(TotalSuperfluidDelegationsResponse.aminoType, TotalSuperfluidDelegationsResponse.typeUrl); function createBaseSuperfluidDelegationAmountRequest(): SuperfluidDelegationAmountRequest { return { delegatorAddress: "", @@ -1901,6 +2393,16 @@ function createBaseSuperfluidDelegationAmountRequest(): SuperfluidDelegationAmou } export const SuperfluidDelegationAmountRequest = { typeUrl: "/osmosis.superfluid.SuperfluidDelegationAmountRequest", + aminoType: "osmosis/superfluid-delegation-amount-request", + is(o: any): o is SuperfluidDelegationAmountRequest { + return o && (o.$typeUrl === SuperfluidDelegationAmountRequest.typeUrl || typeof o.delegatorAddress === "string" && typeof o.validatorAddress === "string" && typeof o.denom === "string"); + }, + isSDK(o: any): o is SuperfluidDelegationAmountRequestSDKType { + return o && (o.$typeUrl === SuperfluidDelegationAmountRequest.typeUrl || typeof o.delegator_address === "string" && typeof o.validator_address === "string" && typeof o.denom === "string"); + }, + isAmino(o: any): o is SuperfluidDelegationAmountRequestAmino { + return o && (o.$typeUrl === SuperfluidDelegationAmountRequest.typeUrl || typeof o.delegator_address === "string" && typeof o.validator_address === "string" && typeof o.denom === "string"); + }, encode(message: SuperfluidDelegationAmountRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.delegatorAddress !== "") { writer.uint32(10).string(message.delegatorAddress); @@ -1936,6 +2438,20 @@ export const SuperfluidDelegationAmountRequest = { } return message; }, + fromJSON(object: any): SuperfluidDelegationAmountRequest { + return { + delegatorAddress: isSet(object.delegatorAddress) ? String(object.delegatorAddress) : "", + validatorAddress: isSet(object.validatorAddress) ? String(object.validatorAddress) : "", + denom: isSet(object.denom) ? String(object.denom) : "" + }; + }, + toJSON(message: SuperfluidDelegationAmountRequest): unknown { + const obj: any = {}; + message.delegatorAddress !== undefined && (obj.delegatorAddress = message.delegatorAddress); + message.validatorAddress !== undefined && (obj.validatorAddress = message.validatorAddress); + message.denom !== undefined && (obj.denom = message.denom); + return obj; + }, fromPartial(object: Partial): SuperfluidDelegationAmountRequest { const message = createBaseSuperfluidDelegationAmountRequest(); message.delegatorAddress = object.delegatorAddress ?? ""; @@ -1944,11 +2460,17 @@ export const SuperfluidDelegationAmountRequest = { return message; }, fromAmino(object: SuperfluidDelegationAmountRequestAmino): SuperfluidDelegationAmountRequest { - return { - delegatorAddress: object.delegator_address, - validatorAddress: object.validator_address, - denom: object.denom - }; + const message = createBaseSuperfluidDelegationAmountRequest(); + if (object.delegator_address !== undefined && object.delegator_address !== null) { + message.delegatorAddress = object.delegator_address; + } + if (object.validator_address !== undefined && object.validator_address !== null) { + message.validatorAddress = object.validator_address; + } + if (object.denom !== undefined && object.denom !== null) { + message.denom = object.denom; + } + return message; }, toAmino(message: SuperfluidDelegationAmountRequest): SuperfluidDelegationAmountRequestAmino { const obj: any = {}; @@ -1979,6 +2501,8 @@ export const SuperfluidDelegationAmountRequest = { }; } }; +GlobalDecoderRegistry.register(SuperfluidDelegationAmountRequest.typeUrl, SuperfluidDelegationAmountRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(SuperfluidDelegationAmountRequest.aminoType, SuperfluidDelegationAmountRequest.typeUrl); function createBaseSuperfluidDelegationAmountResponse(): SuperfluidDelegationAmountResponse { return { amount: [] @@ -1986,6 +2510,16 @@ function createBaseSuperfluidDelegationAmountResponse(): SuperfluidDelegationAmo } export const SuperfluidDelegationAmountResponse = { typeUrl: "/osmosis.superfluid.SuperfluidDelegationAmountResponse", + aminoType: "osmosis/superfluid-delegation-amount-response", + is(o: any): o is SuperfluidDelegationAmountResponse { + return o && (o.$typeUrl === SuperfluidDelegationAmountResponse.typeUrl || Array.isArray(o.amount) && (!o.amount.length || Coin.is(o.amount[0]))); + }, + isSDK(o: any): o is SuperfluidDelegationAmountResponseSDKType { + return o && (o.$typeUrl === SuperfluidDelegationAmountResponse.typeUrl || Array.isArray(o.amount) && (!o.amount.length || Coin.isSDK(o.amount[0]))); + }, + isAmino(o: any): o is SuperfluidDelegationAmountResponseAmino { + return o && (o.$typeUrl === SuperfluidDelegationAmountResponse.typeUrl || Array.isArray(o.amount) && (!o.amount.length || Coin.isAmino(o.amount[0]))); + }, encode(message: SuperfluidDelegationAmountResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.amount) { Coin.encode(v!, writer.uint32(10).fork()).ldelim(); @@ -2009,15 +2543,29 @@ export const SuperfluidDelegationAmountResponse = { } return message; }, + fromJSON(object: any): SuperfluidDelegationAmountResponse { + return { + amount: Array.isArray(object?.amount) ? object.amount.map((e: any) => Coin.fromJSON(e)) : [] + }; + }, + toJSON(message: SuperfluidDelegationAmountResponse): unknown { + const obj: any = {}; + if (message.amount) { + obj.amount = message.amount.map(e => e ? Coin.toJSON(e) : undefined); + } else { + obj.amount = []; + } + return obj; + }, fromPartial(object: Partial): SuperfluidDelegationAmountResponse { const message = createBaseSuperfluidDelegationAmountResponse(); message.amount = object.amount?.map(e => Coin.fromPartial(e)) || []; return message; }, fromAmino(object: SuperfluidDelegationAmountResponseAmino): SuperfluidDelegationAmountResponse { - return { - amount: Array.isArray(object?.amount) ? object.amount.map((e: any) => Coin.fromAmino(e)) : [] - }; + const message = createBaseSuperfluidDelegationAmountResponse(); + message.amount = object.amount?.map(e => Coin.fromAmino(e)) || []; + return message; }, toAmino(message: SuperfluidDelegationAmountResponse): SuperfluidDelegationAmountResponseAmino { const obj: any = {}; @@ -2050,6 +2598,8 @@ export const SuperfluidDelegationAmountResponse = { }; } }; +GlobalDecoderRegistry.register(SuperfluidDelegationAmountResponse.typeUrl, SuperfluidDelegationAmountResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(SuperfluidDelegationAmountResponse.aminoType, SuperfluidDelegationAmountResponse.typeUrl); function createBaseSuperfluidDelegationsByDelegatorRequest(): SuperfluidDelegationsByDelegatorRequest { return { delegatorAddress: "" @@ -2057,6 +2607,16 @@ function createBaseSuperfluidDelegationsByDelegatorRequest(): SuperfluidDelegati } export const SuperfluidDelegationsByDelegatorRequest = { typeUrl: "/osmosis.superfluid.SuperfluidDelegationsByDelegatorRequest", + aminoType: "osmosis/superfluid-delegations-by-delegator-request", + is(o: any): o is SuperfluidDelegationsByDelegatorRequest { + return o && (o.$typeUrl === SuperfluidDelegationsByDelegatorRequest.typeUrl || typeof o.delegatorAddress === "string"); + }, + isSDK(o: any): o is SuperfluidDelegationsByDelegatorRequestSDKType { + return o && (o.$typeUrl === SuperfluidDelegationsByDelegatorRequest.typeUrl || typeof o.delegator_address === "string"); + }, + isAmino(o: any): o is SuperfluidDelegationsByDelegatorRequestAmino { + return o && (o.$typeUrl === SuperfluidDelegationsByDelegatorRequest.typeUrl || typeof o.delegator_address === "string"); + }, encode(message: SuperfluidDelegationsByDelegatorRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.delegatorAddress !== "") { writer.uint32(10).string(message.delegatorAddress); @@ -2080,15 +2640,27 @@ export const SuperfluidDelegationsByDelegatorRequest = { } return message; }, + fromJSON(object: any): SuperfluidDelegationsByDelegatorRequest { + return { + delegatorAddress: isSet(object.delegatorAddress) ? String(object.delegatorAddress) : "" + }; + }, + toJSON(message: SuperfluidDelegationsByDelegatorRequest): unknown { + const obj: any = {}; + message.delegatorAddress !== undefined && (obj.delegatorAddress = message.delegatorAddress); + return obj; + }, fromPartial(object: Partial): SuperfluidDelegationsByDelegatorRequest { const message = createBaseSuperfluidDelegationsByDelegatorRequest(); message.delegatorAddress = object.delegatorAddress ?? ""; return message; }, fromAmino(object: SuperfluidDelegationsByDelegatorRequestAmino): SuperfluidDelegationsByDelegatorRequest { - return { - delegatorAddress: object.delegator_address - }; + const message = createBaseSuperfluidDelegationsByDelegatorRequest(); + if (object.delegator_address !== undefined && object.delegator_address !== null) { + message.delegatorAddress = object.delegator_address; + } + return message; }, toAmino(message: SuperfluidDelegationsByDelegatorRequest): SuperfluidDelegationsByDelegatorRequestAmino { const obj: any = {}; @@ -2117,15 +2689,27 @@ export const SuperfluidDelegationsByDelegatorRequest = { }; } }; +GlobalDecoderRegistry.register(SuperfluidDelegationsByDelegatorRequest.typeUrl, SuperfluidDelegationsByDelegatorRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(SuperfluidDelegationsByDelegatorRequest.aminoType, SuperfluidDelegationsByDelegatorRequest.typeUrl); function createBaseSuperfluidDelegationsByDelegatorResponse(): SuperfluidDelegationsByDelegatorResponse { return { superfluidDelegationRecords: [], totalDelegatedCoins: [], - totalEquivalentStakedAmount: undefined + totalEquivalentStakedAmount: Coin.fromPartial({}) }; } export const SuperfluidDelegationsByDelegatorResponse = { typeUrl: "/osmosis.superfluid.SuperfluidDelegationsByDelegatorResponse", + aminoType: "osmosis/superfluid-delegations-by-delegator-response", + is(o: any): o is SuperfluidDelegationsByDelegatorResponse { + return o && (o.$typeUrl === SuperfluidDelegationsByDelegatorResponse.typeUrl || Array.isArray(o.superfluidDelegationRecords) && (!o.superfluidDelegationRecords.length || SuperfluidDelegationRecord.is(o.superfluidDelegationRecords[0])) && Array.isArray(o.totalDelegatedCoins) && (!o.totalDelegatedCoins.length || Coin.is(o.totalDelegatedCoins[0])) && Coin.is(o.totalEquivalentStakedAmount)); + }, + isSDK(o: any): o is SuperfluidDelegationsByDelegatorResponseSDKType { + return o && (o.$typeUrl === SuperfluidDelegationsByDelegatorResponse.typeUrl || Array.isArray(o.superfluid_delegation_records) && (!o.superfluid_delegation_records.length || SuperfluidDelegationRecord.isSDK(o.superfluid_delegation_records[0])) && Array.isArray(o.total_delegated_coins) && (!o.total_delegated_coins.length || Coin.isSDK(o.total_delegated_coins[0])) && Coin.isSDK(o.total_equivalent_staked_amount)); + }, + isAmino(o: any): o is SuperfluidDelegationsByDelegatorResponseAmino { + return o && (o.$typeUrl === SuperfluidDelegationsByDelegatorResponse.typeUrl || Array.isArray(o.superfluid_delegation_records) && (!o.superfluid_delegation_records.length || SuperfluidDelegationRecord.isAmino(o.superfluid_delegation_records[0])) && Array.isArray(o.total_delegated_coins) && (!o.total_delegated_coins.length || Coin.isAmino(o.total_delegated_coins[0])) && Coin.isAmino(o.total_equivalent_staked_amount)); + }, encode(message: SuperfluidDelegationsByDelegatorResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.superfluidDelegationRecords) { SuperfluidDelegationRecord.encode(v!, writer.uint32(10).fork()).ldelim(); @@ -2161,6 +2745,28 @@ export const SuperfluidDelegationsByDelegatorResponse = { } return message; }, + fromJSON(object: any): SuperfluidDelegationsByDelegatorResponse { + return { + superfluidDelegationRecords: Array.isArray(object?.superfluidDelegationRecords) ? object.superfluidDelegationRecords.map((e: any) => SuperfluidDelegationRecord.fromJSON(e)) : [], + totalDelegatedCoins: Array.isArray(object?.totalDelegatedCoins) ? object.totalDelegatedCoins.map((e: any) => Coin.fromJSON(e)) : [], + totalEquivalentStakedAmount: isSet(object.totalEquivalentStakedAmount) ? Coin.fromJSON(object.totalEquivalentStakedAmount) : undefined + }; + }, + toJSON(message: SuperfluidDelegationsByDelegatorResponse): unknown { + const obj: any = {}; + if (message.superfluidDelegationRecords) { + obj.superfluidDelegationRecords = message.superfluidDelegationRecords.map(e => e ? SuperfluidDelegationRecord.toJSON(e) : undefined); + } else { + obj.superfluidDelegationRecords = []; + } + if (message.totalDelegatedCoins) { + obj.totalDelegatedCoins = message.totalDelegatedCoins.map(e => e ? Coin.toJSON(e) : undefined); + } else { + obj.totalDelegatedCoins = []; + } + message.totalEquivalentStakedAmount !== undefined && (obj.totalEquivalentStakedAmount = message.totalEquivalentStakedAmount ? Coin.toJSON(message.totalEquivalentStakedAmount) : undefined); + return obj; + }, fromPartial(object: Partial): SuperfluidDelegationsByDelegatorResponse { const message = createBaseSuperfluidDelegationsByDelegatorResponse(); message.superfluidDelegationRecords = object.superfluidDelegationRecords?.map(e => SuperfluidDelegationRecord.fromPartial(e)) || []; @@ -2169,11 +2775,13 @@ export const SuperfluidDelegationsByDelegatorResponse = { return message; }, fromAmino(object: SuperfluidDelegationsByDelegatorResponseAmino): SuperfluidDelegationsByDelegatorResponse { - return { - superfluidDelegationRecords: Array.isArray(object?.superfluid_delegation_records) ? object.superfluid_delegation_records.map((e: any) => SuperfluidDelegationRecord.fromAmino(e)) : [], - totalDelegatedCoins: Array.isArray(object?.total_delegated_coins) ? object.total_delegated_coins.map((e: any) => Coin.fromAmino(e)) : [], - totalEquivalentStakedAmount: object?.total_equivalent_staked_amount ? Coin.fromAmino(object.total_equivalent_staked_amount) : undefined - }; + const message = createBaseSuperfluidDelegationsByDelegatorResponse(); + message.superfluidDelegationRecords = object.superfluid_delegation_records?.map(e => SuperfluidDelegationRecord.fromAmino(e)) || []; + message.totalDelegatedCoins = object.total_delegated_coins?.map(e => Coin.fromAmino(e)) || []; + if (object.total_equivalent_staked_amount !== undefined && object.total_equivalent_staked_amount !== null) { + message.totalEquivalentStakedAmount = Coin.fromAmino(object.total_equivalent_staked_amount); + } + return message; }, toAmino(message: SuperfluidDelegationsByDelegatorResponse): SuperfluidDelegationsByDelegatorResponseAmino { const obj: any = {}; @@ -2212,6 +2820,8 @@ export const SuperfluidDelegationsByDelegatorResponse = { }; } }; +GlobalDecoderRegistry.register(SuperfluidDelegationsByDelegatorResponse.typeUrl, SuperfluidDelegationsByDelegatorResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(SuperfluidDelegationsByDelegatorResponse.aminoType, SuperfluidDelegationsByDelegatorResponse.typeUrl); function createBaseSuperfluidUndelegationsByDelegatorRequest(): SuperfluidUndelegationsByDelegatorRequest { return { delegatorAddress: "", @@ -2220,6 +2830,16 @@ function createBaseSuperfluidUndelegationsByDelegatorRequest(): SuperfluidUndele } export const SuperfluidUndelegationsByDelegatorRequest = { typeUrl: "/osmosis.superfluid.SuperfluidUndelegationsByDelegatorRequest", + aminoType: "osmosis/superfluid-undelegations-by-delegator-request", + is(o: any): o is SuperfluidUndelegationsByDelegatorRequest { + return o && (o.$typeUrl === SuperfluidUndelegationsByDelegatorRequest.typeUrl || typeof o.delegatorAddress === "string" && typeof o.denom === "string"); + }, + isSDK(o: any): o is SuperfluidUndelegationsByDelegatorRequestSDKType { + return o && (o.$typeUrl === SuperfluidUndelegationsByDelegatorRequest.typeUrl || typeof o.delegator_address === "string" && typeof o.denom === "string"); + }, + isAmino(o: any): o is SuperfluidUndelegationsByDelegatorRequestAmino { + return o && (o.$typeUrl === SuperfluidUndelegationsByDelegatorRequest.typeUrl || typeof o.delegator_address === "string" && typeof o.denom === "string"); + }, encode(message: SuperfluidUndelegationsByDelegatorRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.delegatorAddress !== "") { writer.uint32(10).string(message.delegatorAddress); @@ -2249,6 +2869,18 @@ export const SuperfluidUndelegationsByDelegatorRequest = { } return message; }, + fromJSON(object: any): SuperfluidUndelegationsByDelegatorRequest { + return { + delegatorAddress: isSet(object.delegatorAddress) ? String(object.delegatorAddress) : "", + denom: isSet(object.denom) ? String(object.denom) : "" + }; + }, + toJSON(message: SuperfluidUndelegationsByDelegatorRequest): unknown { + const obj: any = {}; + message.delegatorAddress !== undefined && (obj.delegatorAddress = message.delegatorAddress); + message.denom !== undefined && (obj.denom = message.denom); + return obj; + }, fromPartial(object: Partial): SuperfluidUndelegationsByDelegatorRequest { const message = createBaseSuperfluidUndelegationsByDelegatorRequest(); message.delegatorAddress = object.delegatorAddress ?? ""; @@ -2256,10 +2888,14 @@ export const SuperfluidUndelegationsByDelegatorRequest = { return message; }, fromAmino(object: SuperfluidUndelegationsByDelegatorRequestAmino): SuperfluidUndelegationsByDelegatorRequest { - return { - delegatorAddress: object.delegator_address, - denom: object.denom - }; + const message = createBaseSuperfluidUndelegationsByDelegatorRequest(); + if (object.delegator_address !== undefined && object.delegator_address !== null) { + message.delegatorAddress = object.delegator_address; + } + if (object.denom !== undefined && object.denom !== null) { + message.denom = object.denom; + } + return message; }, toAmino(message: SuperfluidUndelegationsByDelegatorRequest): SuperfluidUndelegationsByDelegatorRequestAmino { const obj: any = {}; @@ -2289,6 +2925,8 @@ export const SuperfluidUndelegationsByDelegatorRequest = { }; } }; +GlobalDecoderRegistry.register(SuperfluidUndelegationsByDelegatorRequest.typeUrl, SuperfluidUndelegationsByDelegatorRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(SuperfluidUndelegationsByDelegatorRequest.aminoType, SuperfluidUndelegationsByDelegatorRequest.typeUrl); function createBaseSuperfluidUndelegationsByDelegatorResponse(): SuperfluidUndelegationsByDelegatorResponse { return { superfluidDelegationRecords: [], @@ -2298,6 +2936,16 @@ function createBaseSuperfluidUndelegationsByDelegatorResponse(): SuperfluidUndel } export const SuperfluidUndelegationsByDelegatorResponse = { typeUrl: "/osmosis.superfluid.SuperfluidUndelegationsByDelegatorResponse", + aminoType: "osmosis/superfluid-undelegations-by-delegator-response", + is(o: any): o is SuperfluidUndelegationsByDelegatorResponse { + return o && (o.$typeUrl === SuperfluidUndelegationsByDelegatorResponse.typeUrl || Array.isArray(o.superfluidDelegationRecords) && (!o.superfluidDelegationRecords.length || SuperfluidDelegationRecord.is(o.superfluidDelegationRecords[0])) && Array.isArray(o.totalUndelegatedCoins) && (!o.totalUndelegatedCoins.length || Coin.is(o.totalUndelegatedCoins[0])) && Array.isArray(o.syntheticLocks) && (!o.syntheticLocks.length || SyntheticLock.is(o.syntheticLocks[0]))); + }, + isSDK(o: any): o is SuperfluidUndelegationsByDelegatorResponseSDKType { + return o && (o.$typeUrl === SuperfluidUndelegationsByDelegatorResponse.typeUrl || Array.isArray(o.superfluid_delegation_records) && (!o.superfluid_delegation_records.length || SuperfluidDelegationRecord.isSDK(o.superfluid_delegation_records[0])) && Array.isArray(o.total_undelegated_coins) && (!o.total_undelegated_coins.length || Coin.isSDK(o.total_undelegated_coins[0])) && Array.isArray(o.synthetic_locks) && (!o.synthetic_locks.length || SyntheticLock.isSDK(o.synthetic_locks[0]))); + }, + isAmino(o: any): o is SuperfluidUndelegationsByDelegatorResponseAmino { + return o && (o.$typeUrl === SuperfluidUndelegationsByDelegatorResponse.typeUrl || Array.isArray(o.superfluid_delegation_records) && (!o.superfluid_delegation_records.length || SuperfluidDelegationRecord.isAmino(o.superfluid_delegation_records[0])) && Array.isArray(o.total_undelegated_coins) && (!o.total_undelegated_coins.length || Coin.isAmino(o.total_undelegated_coins[0])) && Array.isArray(o.synthetic_locks) && (!o.synthetic_locks.length || SyntheticLock.isAmino(o.synthetic_locks[0]))); + }, encode(message: SuperfluidUndelegationsByDelegatorResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.superfluidDelegationRecords) { SuperfluidDelegationRecord.encode(v!, writer.uint32(10).fork()).ldelim(); @@ -2333,6 +2981,32 @@ export const SuperfluidUndelegationsByDelegatorResponse = { } return message; }, + fromJSON(object: any): SuperfluidUndelegationsByDelegatorResponse { + return { + superfluidDelegationRecords: Array.isArray(object?.superfluidDelegationRecords) ? object.superfluidDelegationRecords.map((e: any) => SuperfluidDelegationRecord.fromJSON(e)) : [], + totalUndelegatedCoins: Array.isArray(object?.totalUndelegatedCoins) ? object.totalUndelegatedCoins.map((e: any) => Coin.fromJSON(e)) : [], + syntheticLocks: Array.isArray(object?.syntheticLocks) ? object.syntheticLocks.map((e: any) => SyntheticLock.fromJSON(e)) : [] + }; + }, + toJSON(message: SuperfluidUndelegationsByDelegatorResponse): unknown { + const obj: any = {}; + if (message.superfluidDelegationRecords) { + obj.superfluidDelegationRecords = message.superfluidDelegationRecords.map(e => e ? SuperfluidDelegationRecord.toJSON(e) : undefined); + } else { + obj.superfluidDelegationRecords = []; + } + if (message.totalUndelegatedCoins) { + obj.totalUndelegatedCoins = message.totalUndelegatedCoins.map(e => e ? Coin.toJSON(e) : undefined); + } else { + obj.totalUndelegatedCoins = []; + } + if (message.syntheticLocks) { + obj.syntheticLocks = message.syntheticLocks.map(e => e ? SyntheticLock.toJSON(e) : undefined); + } else { + obj.syntheticLocks = []; + } + return obj; + }, fromPartial(object: Partial): SuperfluidUndelegationsByDelegatorResponse { const message = createBaseSuperfluidUndelegationsByDelegatorResponse(); message.superfluidDelegationRecords = object.superfluidDelegationRecords?.map(e => SuperfluidDelegationRecord.fromPartial(e)) || []; @@ -2341,11 +3015,11 @@ export const SuperfluidUndelegationsByDelegatorResponse = { return message; }, fromAmino(object: SuperfluidUndelegationsByDelegatorResponseAmino): SuperfluidUndelegationsByDelegatorResponse { - return { - superfluidDelegationRecords: Array.isArray(object?.superfluid_delegation_records) ? object.superfluid_delegation_records.map((e: any) => SuperfluidDelegationRecord.fromAmino(e)) : [], - totalUndelegatedCoins: Array.isArray(object?.total_undelegated_coins) ? object.total_undelegated_coins.map((e: any) => Coin.fromAmino(e)) : [], - syntheticLocks: Array.isArray(object?.synthetic_locks) ? object.synthetic_locks.map((e: any) => SyntheticLock.fromAmino(e)) : [] - }; + const message = createBaseSuperfluidUndelegationsByDelegatorResponse(); + message.superfluidDelegationRecords = object.superfluid_delegation_records?.map(e => SuperfluidDelegationRecord.fromAmino(e)) || []; + message.totalUndelegatedCoins = object.total_undelegated_coins?.map(e => Coin.fromAmino(e)) || []; + message.syntheticLocks = object.synthetic_locks?.map(e => SyntheticLock.fromAmino(e)) || []; + return message; }, toAmino(message: SuperfluidUndelegationsByDelegatorResponse): SuperfluidUndelegationsByDelegatorResponseAmino { const obj: any = {}; @@ -2388,6 +3062,8 @@ export const SuperfluidUndelegationsByDelegatorResponse = { }; } }; +GlobalDecoderRegistry.register(SuperfluidUndelegationsByDelegatorResponse.typeUrl, SuperfluidUndelegationsByDelegatorResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(SuperfluidUndelegationsByDelegatorResponse.aminoType, SuperfluidUndelegationsByDelegatorResponse.typeUrl); function createBaseSuperfluidDelegationsByValidatorDenomRequest(): SuperfluidDelegationsByValidatorDenomRequest { return { validatorAddress: "", @@ -2396,6 +3072,16 @@ function createBaseSuperfluidDelegationsByValidatorDenomRequest(): SuperfluidDel } export const SuperfluidDelegationsByValidatorDenomRequest = { typeUrl: "/osmosis.superfluid.SuperfluidDelegationsByValidatorDenomRequest", + aminoType: "osmosis/superfluid-delegations-by-validator-denom-request", + is(o: any): o is SuperfluidDelegationsByValidatorDenomRequest { + return o && (o.$typeUrl === SuperfluidDelegationsByValidatorDenomRequest.typeUrl || typeof o.validatorAddress === "string" && typeof o.denom === "string"); + }, + isSDK(o: any): o is SuperfluidDelegationsByValidatorDenomRequestSDKType { + return o && (o.$typeUrl === SuperfluidDelegationsByValidatorDenomRequest.typeUrl || typeof o.validator_address === "string" && typeof o.denom === "string"); + }, + isAmino(o: any): o is SuperfluidDelegationsByValidatorDenomRequestAmino { + return o && (o.$typeUrl === SuperfluidDelegationsByValidatorDenomRequest.typeUrl || typeof o.validator_address === "string" && typeof o.denom === "string"); + }, encode(message: SuperfluidDelegationsByValidatorDenomRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.validatorAddress !== "") { writer.uint32(10).string(message.validatorAddress); @@ -2425,6 +3111,18 @@ export const SuperfluidDelegationsByValidatorDenomRequest = { } return message; }, + fromJSON(object: any): SuperfluidDelegationsByValidatorDenomRequest { + return { + validatorAddress: isSet(object.validatorAddress) ? String(object.validatorAddress) : "", + denom: isSet(object.denom) ? String(object.denom) : "" + }; + }, + toJSON(message: SuperfluidDelegationsByValidatorDenomRequest): unknown { + const obj: any = {}; + message.validatorAddress !== undefined && (obj.validatorAddress = message.validatorAddress); + message.denom !== undefined && (obj.denom = message.denom); + return obj; + }, fromPartial(object: Partial): SuperfluidDelegationsByValidatorDenomRequest { const message = createBaseSuperfluidDelegationsByValidatorDenomRequest(); message.validatorAddress = object.validatorAddress ?? ""; @@ -2432,10 +3130,14 @@ export const SuperfluidDelegationsByValidatorDenomRequest = { return message; }, fromAmino(object: SuperfluidDelegationsByValidatorDenomRequestAmino): SuperfluidDelegationsByValidatorDenomRequest { - return { - validatorAddress: object.validator_address, - denom: object.denom - }; + const message = createBaseSuperfluidDelegationsByValidatorDenomRequest(); + if (object.validator_address !== undefined && object.validator_address !== null) { + message.validatorAddress = object.validator_address; + } + if (object.denom !== undefined && object.denom !== null) { + message.denom = object.denom; + } + return message; }, toAmino(message: SuperfluidDelegationsByValidatorDenomRequest): SuperfluidDelegationsByValidatorDenomRequestAmino { const obj: any = {}; @@ -2465,6 +3167,8 @@ export const SuperfluidDelegationsByValidatorDenomRequest = { }; } }; +GlobalDecoderRegistry.register(SuperfluidDelegationsByValidatorDenomRequest.typeUrl, SuperfluidDelegationsByValidatorDenomRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(SuperfluidDelegationsByValidatorDenomRequest.aminoType, SuperfluidDelegationsByValidatorDenomRequest.typeUrl); function createBaseSuperfluidDelegationsByValidatorDenomResponse(): SuperfluidDelegationsByValidatorDenomResponse { return { superfluidDelegationRecords: [] @@ -2472,6 +3176,16 @@ function createBaseSuperfluidDelegationsByValidatorDenomResponse(): SuperfluidDe } export const SuperfluidDelegationsByValidatorDenomResponse = { typeUrl: "/osmosis.superfluid.SuperfluidDelegationsByValidatorDenomResponse", + aminoType: "osmosis/superfluid-delegations-by-validator-denom-response", + is(o: any): o is SuperfluidDelegationsByValidatorDenomResponse { + return o && (o.$typeUrl === SuperfluidDelegationsByValidatorDenomResponse.typeUrl || Array.isArray(o.superfluidDelegationRecords) && (!o.superfluidDelegationRecords.length || SuperfluidDelegationRecord.is(o.superfluidDelegationRecords[0]))); + }, + isSDK(o: any): o is SuperfluidDelegationsByValidatorDenomResponseSDKType { + return o && (o.$typeUrl === SuperfluidDelegationsByValidatorDenomResponse.typeUrl || Array.isArray(o.superfluid_delegation_records) && (!o.superfluid_delegation_records.length || SuperfluidDelegationRecord.isSDK(o.superfluid_delegation_records[0]))); + }, + isAmino(o: any): o is SuperfluidDelegationsByValidatorDenomResponseAmino { + return o && (o.$typeUrl === SuperfluidDelegationsByValidatorDenomResponse.typeUrl || Array.isArray(o.superfluid_delegation_records) && (!o.superfluid_delegation_records.length || SuperfluidDelegationRecord.isAmino(o.superfluid_delegation_records[0]))); + }, encode(message: SuperfluidDelegationsByValidatorDenomResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.superfluidDelegationRecords) { SuperfluidDelegationRecord.encode(v!, writer.uint32(10).fork()).ldelim(); @@ -2495,15 +3209,29 @@ export const SuperfluidDelegationsByValidatorDenomResponse = { } return message; }, + fromJSON(object: any): SuperfluidDelegationsByValidatorDenomResponse { + return { + superfluidDelegationRecords: Array.isArray(object?.superfluidDelegationRecords) ? object.superfluidDelegationRecords.map((e: any) => SuperfluidDelegationRecord.fromJSON(e)) : [] + }; + }, + toJSON(message: SuperfluidDelegationsByValidatorDenomResponse): unknown { + const obj: any = {}; + if (message.superfluidDelegationRecords) { + obj.superfluidDelegationRecords = message.superfluidDelegationRecords.map(e => e ? SuperfluidDelegationRecord.toJSON(e) : undefined); + } else { + obj.superfluidDelegationRecords = []; + } + return obj; + }, fromPartial(object: Partial): SuperfluidDelegationsByValidatorDenomResponse { const message = createBaseSuperfluidDelegationsByValidatorDenomResponse(); message.superfluidDelegationRecords = object.superfluidDelegationRecords?.map(e => SuperfluidDelegationRecord.fromPartial(e)) || []; return message; }, fromAmino(object: SuperfluidDelegationsByValidatorDenomResponseAmino): SuperfluidDelegationsByValidatorDenomResponse { - return { - superfluidDelegationRecords: Array.isArray(object?.superfluid_delegation_records) ? object.superfluid_delegation_records.map((e: any) => SuperfluidDelegationRecord.fromAmino(e)) : [] - }; + const message = createBaseSuperfluidDelegationsByValidatorDenomResponse(); + message.superfluidDelegationRecords = object.superfluid_delegation_records?.map(e => SuperfluidDelegationRecord.fromAmino(e)) || []; + return message; }, toAmino(message: SuperfluidDelegationsByValidatorDenomResponse): SuperfluidDelegationsByValidatorDenomResponseAmino { const obj: any = {}; @@ -2536,6 +3264,8 @@ export const SuperfluidDelegationsByValidatorDenomResponse = { }; } }; +GlobalDecoderRegistry.register(SuperfluidDelegationsByValidatorDenomResponse.typeUrl, SuperfluidDelegationsByValidatorDenomResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(SuperfluidDelegationsByValidatorDenomResponse.aminoType, SuperfluidDelegationsByValidatorDenomResponse.typeUrl); function createBaseEstimateSuperfluidDelegatedAmountByValidatorDenomRequest(): EstimateSuperfluidDelegatedAmountByValidatorDenomRequest { return { validatorAddress: "", @@ -2544,6 +3274,16 @@ function createBaseEstimateSuperfluidDelegatedAmountByValidatorDenomRequest(): E } export const EstimateSuperfluidDelegatedAmountByValidatorDenomRequest = { typeUrl: "/osmosis.superfluid.EstimateSuperfluidDelegatedAmountByValidatorDenomRequest", + aminoType: "osmosis/estimate-superfluid-delegated-amount-by-validator-denom-request", + is(o: any): o is EstimateSuperfluidDelegatedAmountByValidatorDenomRequest { + return o && (o.$typeUrl === EstimateSuperfluidDelegatedAmountByValidatorDenomRequest.typeUrl || typeof o.validatorAddress === "string" && typeof o.denom === "string"); + }, + isSDK(o: any): o is EstimateSuperfluidDelegatedAmountByValidatorDenomRequestSDKType { + return o && (o.$typeUrl === EstimateSuperfluidDelegatedAmountByValidatorDenomRequest.typeUrl || typeof o.validator_address === "string" && typeof o.denom === "string"); + }, + isAmino(o: any): o is EstimateSuperfluidDelegatedAmountByValidatorDenomRequestAmino { + return o && (o.$typeUrl === EstimateSuperfluidDelegatedAmountByValidatorDenomRequest.typeUrl || typeof o.validator_address === "string" && typeof o.denom === "string"); + }, encode(message: EstimateSuperfluidDelegatedAmountByValidatorDenomRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.validatorAddress !== "") { writer.uint32(10).string(message.validatorAddress); @@ -2573,6 +3313,18 @@ export const EstimateSuperfluidDelegatedAmountByValidatorDenomRequest = { } return message; }, + fromJSON(object: any): EstimateSuperfluidDelegatedAmountByValidatorDenomRequest { + return { + validatorAddress: isSet(object.validatorAddress) ? String(object.validatorAddress) : "", + denom: isSet(object.denom) ? String(object.denom) : "" + }; + }, + toJSON(message: EstimateSuperfluidDelegatedAmountByValidatorDenomRequest): unknown { + const obj: any = {}; + message.validatorAddress !== undefined && (obj.validatorAddress = message.validatorAddress); + message.denom !== undefined && (obj.denom = message.denom); + return obj; + }, fromPartial(object: Partial): EstimateSuperfluidDelegatedAmountByValidatorDenomRequest { const message = createBaseEstimateSuperfluidDelegatedAmountByValidatorDenomRequest(); message.validatorAddress = object.validatorAddress ?? ""; @@ -2580,10 +3332,14 @@ export const EstimateSuperfluidDelegatedAmountByValidatorDenomRequest = { return message; }, fromAmino(object: EstimateSuperfluidDelegatedAmountByValidatorDenomRequestAmino): EstimateSuperfluidDelegatedAmountByValidatorDenomRequest { - return { - validatorAddress: object.validator_address, - denom: object.denom - }; + const message = createBaseEstimateSuperfluidDelegatedAmountByValidatorDenomRequest(); + if (object.validator_address !== undefined && object.validator_address !== null) { + message.validatorAddress = object.validator_address; + } + if (object.denom !== undefined && object.denom !== null) { + message.denom = object.denom; + } + return message; }, toAmino(message: EstimateSuperfluidDelegatedAmountByValidatorDenomRequest): EstimateSuperfluidDelegatedAmountByValidatorDenomRequestAmino { const obj: any = {}; @@ -2613,6 +3369,8 @@ export const EstimateSuperfluidDelegatedAmountByValidatorDenomRequest = { }; } }; +GlobalDecoderRegistry.register(EstimateSuperfluidDelegatedAmountByValidatorDenomRequest.typeUrl, EstimateSuperfluidDelegatedAmountByValidatorDenomRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(EstimateSuperfluidDelegatedAmountByValidatorDenomRequest.aminoType, EstimateSuperfluidDelegatedAmountByValidatorDenomRequest.typeUrl); function createBaseEstimateSuperfluidDelegatedAmountByValidatorDenomResponse(): EstimateSuperfluidDelegatedAmountByValidatorDenomResponse { return { totalDelegatedCoins: [] @@ -2620,6 +3378,16 @@ function createBaseEstimateSuperfluidDelegatedAmountByValidatorDenomResponse(): } export const EstimateSuperfluidDelegatedAmountByValidatorDenomResponse = { typeUrl: "/osmosis.superfluid.EstimateSuperfluidDelegatedAmountByValidatorDenomResponse", + aminoType: "osmosis/estimate-superfluid-delegated-amount-by-validator-denom-response", + is(o: any): o is EstimateSuperfluidDelegatedAmountByValidatorDenomResponse { + return o && (o.$typeUrl === EstimateSuperfluidDelegatedAmountByValidatorDenomResponse.typeUrl || Array.isArray(o.totalDelegatedCoins) && (!o.totalDelegatedCoins.length || Coin.is(o.totalDelegatedCoins[0]))); + }, + isSDK(o: any): o is EstimateSuperfluidDelegatedAmountByValidatorDenomResponseSDKType { + return o && (o.$typeUrl === EstimateSuperfluidDelegatedAmountByValidatorDenomResponse.typeUrl || Array.isArray(o.total_delegated_coins) && (!o.total_delegated_coins.length || Coin.isSDK(o.total_delegated_coins[0]))); + }, + isAmino(o: any): o is EstimateSuperfluidDelegatedAmountByValidatorDenomResponseAmino { + return o && (o.$typeUrl === EstimateSuperfluidDelegatedAmountByValidatorDenomResponse.typeUrl || Array.isArray(o.total_delegated_coins) && (!o.total_delegated_coins.length || Coin.isAmino(o.total_delegated_coins[0]))); + }, encode(message: EstimateSuperfluidDelegatedAmountByValidatorDenomResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.totalDelegatedCoins) { Coin.encode(v!, writer.uint32(10).fork()).ldelim(); @@ -2643,15 +3411,29 @@ export const EstimateSuperfluidDelegatedAmountByValidatorDenomResponse = { } return message; }, + fromJSON(object: any): EstimateSuperfluidDelegatedAmountByValidatorDenomResponse { + return { + totalDelegatedCoins: Array.isArray(object?.totalDelegatedCoins) ? object.totalDelegatedCoins.map((e: any) => Coin.fromJSON(e)) : [] + }; + }, + toJSON(message: EstimateSuperfluidDelegatedAmountByValidatorDenomResponse): unknown { + const obj: any = {}; + if (message.totalDelegatedCoins) { + obj.totalDelegatedCoins = message.totalDelegatedCoins.map(e => e ? Coin.toJSON(e) : undefined); + } else { + obj.totalDelegatedCoins = []; + } + return obj; + }, fromPartial(object: Partial): EstimateSuperfluidDelegatedAmountByValidatorDenomResponse { const message = createBaseEstimateSuperfluidDelegatedAmountByValidatorDenomResponse(); message.totalDelegatedCoins = object.totalDelegatedCoins?.map(e => Coin.fromPartial(e)) || []; return message; }, fromAmino(object: EstimateSuperfluidDelegatedAmountByValidatorDenomResponseAmino): EstimateSuperfluidDelegatedAmountByValidatorDenomResponse { - return { - totalDelegatedCoins: Array.isArray(object?.total_delegated_coins) ? object.total_delegated_coins.map((e: any) => Coin.fromAmino(e)) : [] - }; + const message = createBaseEstimateSuperfluidDelegatedAmountByValidatorDenomResponse(); + message.totalDelegatedCoins = object.total_delegated_coins?.map(e => Coin.fromAmino(e)) || []; + return message; }, toAmino(message: EstimateSuperfluidDelegatedAmountByValidatorDenomResponse): EstimateSuperfluidDelegatedAmountByValidatorDenomResponseAmino { const obj: any = {}; @@ -2684,6 +3466,8 @@ export const EstimateSuperfluidDelegatedAmountByValidatorDenomResponse = { }; } }; +GlobalDecoderRegistry.register(EstimateSuperfluidDelegatedAmountByValidatorDenomResponse.typeUrl, EstimateSuperfluidDelegatedAmountByValidatorDenomResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(EstimateSuperfluidDelegatedAmountByValidatorDenomResponse.aminoType, EstimateSuperfluidDelegatedAmountByValidatorDenomResponse.typeUrl); function createBaseQueryTotalDelegationByDelegatorRequest(): QueryTotalDelegationByDelegatorRequest { return { delegatorAddress: "" @@ -2691,6 +3475,16 @@ function createBaseQueryTotalDelegationByDelegatorRequest(): QueryTotalDelegatio } export const QueryTotalDelegationByDelegatorRequest = { typeUrl: "/osmosis.superfluid.QueryTotalDelegationByDelegatorRequest", + aminoType: "osmosis/query-total-delegation-by-delegator-request", + is(o: any): o is QueryTotalDelegationByDelegatorRequest { + return o && (o.$typeUrl === QueryTotalDelegationByDelegatorRequest.typeUrl || typeof o.delegatorAddress === "string"); + }, + isSDK(o: any): o is QueryTotalDelegationByDelegatorRequestSDKType { + return o && (o.$typeUrl === QueryTotalDelegationByDelegatorRequest.typeUrl || typeof o.delegator_address === "string"); + }, + isAmino(o: any): o is QueryTotalDelegationByDelegatorRequestAmino { + return o && (o.$typeUrl === QueryTotalDelegationByDelegatorRequest.typeUrl || typeof o.delegator_address === "string"); + }, encode(message: QueryTotalDelegationByDelegatorRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.delegatorAddress !== "") { writer.uint32(10).string(message.delegatorAddress); @@ -2714,15 +3508,27 @@ export const QueryTotalDelegationByDelegatorRequest = { } return message; }, + fromJSON(object: any): QueryTotalDelegationByDelegatorRequest { + return { + delegatorAddress: isSet(object.delegatorAddress) ? String(object.delegatorAddress) : "" + }; + }, + toJSON(message: QueryTotalDelegationByDelegatorRequest): unknown { + const obj: any = {}; + message.delegatorAddress !== undefined && (obj.delegatorAddress = message.delegatorAddress); + return obj; + }, fromPartial(object: Partial): QueryTotalDelegationByDelegatorRequest { const message = createBaseQueryTotalDelegationByDelegatorRequest(); message.delegatorAddress = object.delegatorAddress ?? ""; return message; }, fromAmino(object: QueryTotalDelegationByDelegatorRequestAmino): QueryTotalDelegationByDelegatorRequest { - return { - delegatorAddress: object.delegator_address - }; + const message = createBaseQueryTotalDelegationByDelegatorRequest(); + if (object.delegator_address !== undefined && object.delegator_address !== null) { + message.delegatorAddress = object.delegator_address; + } + return message; }, toAmino(message: QueryTotalDelegationByDelegatorRequest): QueryTotalDelegationByDelegatorRequestAmino { const obj: any = {}; @@ -2751,16 +3557,28 @@ export const QueryTotalDelegationByDelegatorRequest = { }; } }; +GlobalDecoderRegistry.register(QueryTotalDelegationByDelegatorRequest.typeUrl, QueryTotalDelegationByDelegatorRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryTotalDelegationByDelegatorRequest.aminoType, QueryTotalDelegationByDelegatorRequest.typeUrl); function createBaseQueryTotalDelegationByDelegatorResponse(): QueryTotalDelegationByDelegatorResponse { return { superfluidDelegationRecords: [], delegationResponse: [], totalDelegatedCoins: [], - totalEquivalentStakedAmount: undefined + totalEquivalentStakedAmount: Coin.fromPartial({}) }; } export const QueryTotalDelegationByDelegatorResponse = { typeUrl: "/osmosis.superfluid.QueryTotalDelegationByDelegatorResponse", + aminoType: "osmosis/query-total-delegation-by-delegator-response", + is(o: any): o is QueryTotalDelegationByDelegatorResponse { + return o && (o.$typeUrl === QueryTotalDelegationByDelegatorResponse.typeUrl || Array.isArray(o.superfluidDelegationRecords) && (!o.superfluidDelegationRecords.length || SuperfluidDelegationRecord.is(o.superfluidDelegationRecords[0])) && Array.isArray(o.delegationResponse) && (!o.delegationResponse.length || DelegationResponse.is(o.delegationResponse[0])) && Array.isArray(o.totalDelegatedCoins) && (!o.totalDelegatedCoins.length || Coin.is(o.totalDelegatedCoins[0])) && Coin.is(o.totalEquivalentStakedAmount)); + }, + isSDK(o: any): o is QueryTotalDelegationByDelegatorResponseSDKType { + return o && (o.$typeUrl === QueryTotalDelegationByDelegatorResponse.typeUrl || Array.isArray(o.superfluid_delegation_records) && (!o.superfluid_delegation_records.length || SuperfluidDelegationRecord.isSDK(o.superfluid_delegation_records[0])) && Array.isArray(o.delegation_response) && (!o.delegation_response.length || DelegationResponse.isSDK(o.delegation_response[0])) && Array.isArray(o.total_delegated_coins) && (!o.total_delegated_coins.length || Coin.isSDK(o.total_delegated_coins[0])) && Coin.isSDK(o.total_equivalent_staked_amount)); + }, + isAmino(o: any): o is QueryTotalDelegationByDelegatorResponseAmino { + return o && (o.$typeUrl === QueryTotalDelegationByDelegatorResponse.typeUrl || Array.isArray(o.superfluid_delegation_records) && (!o.superfluid_delegation_records.length || SuperfluidDelegationRecord.isAmino(o.superfluid_delegation_records[0])) && Array.isArray(o.delegation_response) && (!o.delegation_response.length || DelegationResponse.isAmino(o.delegation_response[0])) && Array.isArray(o.total_delegated_coins) && (!o.total_delegated_coins.length || Coin.isAmino(o.total_delegated_coins[0])) && Coin.isAmino(o.total_equivalent_staked_amount)); + }, encode(message: QueryTotalDelegationByDelegatorResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.superfluidDelegationRecords) { SuperfluidDelegationRecord.encode(v!, writer.uint32(10).fork()).ldelim(); @@ -2802,6 +3620,34 @@ export const QueryTotalDelegationByDelegatorResponse = { } return message; }, + fromJSON(object: any): QueryTotalDelegationByDelegatorResponse { + return { + superfluidDelegationRecords: Array.isArray(object?.superfluidDelegationRecords) ? object.superfluidDelegationRecords.map((e: any) => SuperfluidDelegationRecord.fromJSON(e)) : [], + delegationResponse: Array.isArray(object?.delegationResponse) ? object.delegationResponse.map((e: any) => DelegationResponse.fromJSON(e)) : [], + totalDelegatedCoins: Array.isArray(object?.totalDelegatedCoins) ? object.totalDelegatedCoins.map((e: any) => Coin.fromJSON(e)) : [], + totalEquivalentStakedAmount: isSet(object.totalEquivalentStakedAmount) ? Coin.fromJSON(object.totalEquivalentStakedAmount) : undefined + }; + }, + toJSON(message: QueryTotalDelegationByDelegatorResponse): unknown { + const obj: any = {}; + if (message.superfluidDelegationRecords) { + obj.superfluidDelegationRecords = message.superfluidDelegationRecords.map(e => e ? SuperfluidDelegationRecord.toJSON(e) : undefined); + } else { + obj.superfluidDelegationRecords = []; + } + if (message.delegationResponse) { + obj.delegationResponse = message.delegationResponse.map(e => e ? DelegationResponse.toJSON(e) : undefined); + } else { + obj.delegationResponse = []; + } + if (message.totalDelegatedCoins) { + obj.totalDelegatedCoins = message.totalDelegatedCoins.map(e => e ? Coin.toJSON(e) : undefined); + } else { + obj.totalDelegatedCoins = []; + } + message.totalEquivalentStakedAmount !== undefined && (obj.totalEquivalentStakedAmount = message.totalEquivalentStakedAmount ? Coin.toJSON(message.totalEquivalentStakedAmount) : undefined); + return obj; + }, fromPartial(object: Partial): QueryTotalDelegationByDelegatorResponse { const message = createBaseQueryTotalDelegationByDelegatorResponse(); message.superfluidDelegationRecords = object.superfluidDelegationRecords?.map(e => SuperfluidDelegationRecord.fromPartial(e)) || []; @@ -2811,12 +3657,14 @@ export const QueryTotalDelegationByDelegatorResponse = { return message; }, fromAmino(object: QueryTotalDelegationByDelegatorResponseAmino): QueryTotalDelegationByDelegatorResponse { - return { - superfluidDelegationRecords: Array.isArray(object?.superfluid_delegation_records) ? object.superfluid_delegation_records.map((e: any) => SuperfluidDelegationRecord.fromAmino(e)) : [], - delegationResponse: Array.isArray(object?.delegation_response) ? object.delegation_response.map((e: any) => DelegationResponse.fromAmino(e)) : [], - totalDelegatedCoins: Array.isArray(object?.total_delegated_coins) ? object.total_delegated_coins.map((e: any) => Coin.fromAmino(e)) : [], - totalEquivalentStakedAmount: object?.total_equivalent_staked_amount ? Coin.fromAmino(object.total_equivalent_staked_amount) : undefined - }; + const message = createBaseQueryTotalDelegationByDelegatorResponse(); + message.superfluidDelegationRecords = object.superfluid_delegation_records?.map(e => SuperfluidDelegationRecord.fromAmino(e)) || []; + message.delegationResponse = object.delegation_response?.map(e => DelegationResponse.fromAmino(e)) || []; + message.totalDelegatedCoins = object.total_delegated_coins?.map(e => Coin.fromAmino(e)) || []; + if (object.total_equivalent_staked_amount !== undefined && object.total_equivalent_staked_amount !== null) { + message.totalEquivalentStakedAmount = Coin.fromAmino(object.total_equivalent_staked_amount); + } + return message; }, toAmino(message: QueryTotalDelegationByDelegatorResponse): QueryTotalDelegationByDelegatorResponseAmino { const obj: any = {}; @@ -2860,11 +3708,23 @@ export const QueryTotalDelegationByDelegatorResponse = { }; } }; +GlobalDecoderRegistry.register(QueryTotalDelegationByDelegatorResponse.typeUrl, QueryTotalDelegationByDelegatorResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryTotalDelegationByDelegatorResponse.aminoType, QueryTotalDelegationByDelegatorResponse.typeUrl); function createBaseQueryUnpoolWhitelistRequest(): QueryUnpoolWhitelistRequest { return {}; } export const QueryUnpoolWhitelistRequest = { typeUrl: "/osmosis.superfluid.QueryUnpoolWhitelistRequest", + aminoType: "osmosis/query-unpool-whitelist-request", + is(o: any): o is QueryUnpoolWhitelistRequest { + return o && o.$typeUrl === QueryUnpoolWhitelistRequest.typeUrl; + }, + isSDK(o: any): o is QueryUnpoolWhitelistRequestSDKType { + return o && o.$typeUrl === QueryUnpoolWhitelistRequest.typeUrl; + }, + isAmino(o: any): o is QueryUnpoolWhitelistRequestAmino { + return o && o.$typeUrl === QueryUnpoolWhitelistRequest.typeUrl; + }, encode(_: QueryUnpoolWhitelistRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, @@ -2882,12 +3742,20 @@ export const QueryUnpoolWhitelistRequest = { } return message; }, + fromJSON(_: any): QueryUnpoolWhitelistRequest { + return {}; + }, + toJSON(_: QueryUnpoolWhitelistRequest): unknown { + const obj: any = {}; + return obj; + }, fromPartial(_: Partial): QueryUnpoolWhitelistRequest { const message = createBaseQueryUnpoolWhitelistRequest(); return message; }, fromAmino(_: QueryUnpoolWhitelistRequestAmino): QueryUnpoolWhitelistRequest { - return {}; + const message = createBaseQueryUnpoolWhitelistRequest(); + return message; }, toAmino(_: QueryUnpoolWhitelistRequest): QueryUnpoolWhitelistRequestAmino { const obj: any = {}; @@ -2915,6 +3783,8 @@ export const QueryUnpoolWhitelistRequest = { }; } }; +GlobalDecoderRegistry.register(QueryUnpoolWhitelistRequest.typeUrl, QueryUnpoolWhitelistRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryUnpoolWhitelistRequest.aminoType, QueryUnpoolWhitelistRequest.typeUrl); function createBaseQueryUnpoolWhitelistResponse(): QueryUnpoolWhitelistResponse { return { poolIds: [] @@ -2922,6 +3792,16 @@ function createBaseQueryUnpoolWhitelistResponse(): QueryUnpoolWhitelistResponse } export const QueryUnpoolWhitelistResponse = { typeUrl: "/osmosis.superfluid.QueryUnpoolWhitelistResponse", + aminoType: "osmosis/query-unpool-whitelist-response", + is(o: any): o is QueryUnpoolWhitelistResponse { + return o && (o.$typeUrl === QueryUnpoolWhitelistResponse.typeUrl || Array.isArray(o.poolIds) && (!o.poolIds.length || typeof o.poolIds[0] === "bigint")); + }, + isSDK(o: any): o is QueryUnpoolWhitelistResponseSDKType { + return o && (o.$typeUrl === QueryUnpoolWhitelistResponse.typeUrl || Array.isArray(o.pool_ids) && (!o.pool_ids.length || typeof o.pool_ids[0] === "bigint")); + }, + isAmino(o: any): o is QueryUnpoolWhitelistResponseAmino { + return o && (o.$typeUrl === QueryUnpoolWhitelistResponse.typeUrl || Array.isArray(o.pool_ids) && (!o.pool_ids.length || typeof o.pool_ids[0] === "bigint")); + }, encode(message: QueryUnpoolWhitelistResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { writer.uint32(10).fork(); for (const v of message.poolIds) { @@ -2954,15 +3834,29 @@ export const QueryUnpoolWhitelistResponse = { } return message; }, + fromJSON(object: any): QueryUnpoolWhitelistResponse { + return { + poolIds: Array.isArray(object?.poolIds) ? object.poolIds.map((e: any) => BigInt(e.toString())) : [] + }; + }, + toJSON(message: QueryUnpoolWhitelistResponse): unknown { + const obj: any = {}; + if (message.poolIds) { + obj.poolIds = message.poolIds.map(e => (e || BigInt(0)).toString()); + } else { + obj.poolIds = []; + } + return obj; + }, fromPartial(object: Partial): QueryUnpoolWhitelistResponse { const message = createBaseQueryUnpoolWhitelistResponse(); message.poolIds = object.poolIds?.map(e => BigInt(e.toString())) || []; return message; }, fromAmino(object: QueryUnpoolWhitelistResponseAmino): QueryUnpoolWhitelistResponse { - return { - poolIds: Array.isArray(object?.pool_ids) ? object.pool_ids.map((e: any) => BigInt(e)) : [] - }; + const message = createBaseQueryUnpoolWhitelistResponse(); + message.poolIds = object.pool_ids?.map(e => BigInt(e)) || []; + return message; }, toAmino(message: QueryUnpoolWhitelistResponse): QueryUnpoolWhitelistResponseAmino { const obj: any = {}; @@ -2995,6 +3889,8 @@ export const QueryUnpoolWhitelistResponse = { }; } }; +GlobalDecoderRegistry.register(QueryUnpoolWhitelistResponse.typeUrl, QueryUnpoolWhitelistResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryUnpoolWhitelistResponse.aminoType, QueryUnpoolWhitelistResponse.typeUrl); function createBaseUserConcentratedSuperfluidPositionsDelegatedRequest(): UserConcentratedSuperfluidPositionsDelegatedRequest { return { delegatorAddress: "" @@ -3002,6 +3898,16 @@ function createBaseUserConcentratedSuperfluidPositionsDelegatedRequest(): UserCo } export const UserConcentratedSuperfluidPositionsDelegatedRequest = { typeUrl: "/osmosis.superfluid.UserConcentratedSuperfluidPositionsDelegatedRequest", + aminoType: "osmosis/user-concentrated-superfluid-positions-delegated-request", + is(o: any): o is UserConcentratedSuperfluidPositionsDelegatedRequest { + return o && (o.$typeUrl === UserConcentratedSuperfluidPositionsDelegatedRequest.typeUrl || typeof o.delegatorAddress === "string"); + }, + isSDK(o: any): o is UserConcentratedSuperfluidPositionsDelegatedRequestSDKType { + return o && (o.$typeUrl === UserConcentratedSuperfluidPositionsDelegatedRequest.typeUrl || typeof o.delegator_address === "string"); + }, + isAmino(o: any): o is UserConcentratedSuperfluidPositionsDelegatedRequestAmino { + return o && (o.$typeUrl === UserConcentratedSuperfluidPositionsDelegatedRequest.typeUrl || typeof o.delegator_address === "string"); + }, encode(message: UserConcentratedSuperfluidPositionsDelegatedRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.delegatorAddress !== "") { writer.uint32(10).string(message.delegatorAddress); @@ -3025,15 +3931,27 @@ export const UserConcentratedSuperfluidPositionsDelegatedRequest = { } return message; }, + fromJSON(object: any): UserConcentratedSuperfluidPositionsDelegatedRequest { + return { + delegatorAddress: isSet(object.delegatorAddress) ? String(object.delegatorAddress) : "" + }; + }, + toJSON(message: UserConcentratedSuperfluidPositionsDelegatedRequest): unknown { + const obj: any = {}; + message.delegatorAddress !== undefined && (obj.delegatorAddress = message.delegatorAddress); + return obj; + }, fromPartial(object: Partial): UserConcentratedSuperfluidPositionsDelegatedRequest { const message = createBaseUserConcentratedSuperfluidPositionsDelegatedRequest(); message.delegatorAddress = object.delegatorAddress ?? ""; return message; }, fromAmino(object: UserConcentratedSuperfluidPositionsDelegatedRequestAmino): UserConcentratedSuperfluidPositionsDelegatedRequest { - return { - delegatorAddress: object.delegator_address - }; + const message = createBaseUserConcentratedSuperfluidPositionsDelegatedRequest(); + if (object.delegator_address !== undefined && object.delegator_address !== null) { + message.delegatorAddress = object.delegator_address; + } + return message; }, toAmino(message: UserConcentratedSuperfluidPositionsDelegatedRequest): UserConcentratedSuperfluidPositionsDelegatedRequestAmino { const obj: any = {}; @@ -3062,6 +3980,8 @@ export const UserConcentratedSuperfluidPositionsDelegatedRequest = { }; } }; +GlobalDecoderRegistry.register(UserConcentratedSuperfluidPositionsDelegatedRequest.typeUrl, UserConcentratedSuperfluidPositionsDelegatedRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(UserConcentratedSuperfluidPositionsDelegatedRequest.aminoType, UserConcentratedSuperfluidPositionsDelegatedRequest.typeUrl); function createBaseUserConcentratedSuperfluidPositionsDelegatedResponse(): UserConcentratedSuperfluidPositionsDelegatedResponse { return { clPoolUserPositionRecords: [] @@ -3069,6 +3989,16 @@ function createBaseUserConcentratedSuperfluidPositionsDelegatedResponse(): UserC } export const UserConcentratedSuperfluidPositionsDelegatedResponse = { typeUrl: "/osmosis.superfluid.UserConcentratedSuperfluidPositionsDelegatedResponse", + aminoType: "osmosis/user-concentrated-superfluid-positions-delegated-response", + is(o: any): o is UserConcentratedSuperfluidPositionsDelegatedResponse { + return o && (o.$typeUrl === UserConcentratedSuperfluidPositionsDelegatedResponse.typeUrl || Array.isArray(o.clPoolUserPositionRecords) && (!o.clPoolUserPositionRecords.length || ConcentratedPoolUserPositionRecord.is(o.clPoolUserPositionRecords[0]))); + }, + isSDK(o: any): o is UserConcentratedSuperfluidPositionsDelegatedResponseSDKType { + return o && (o.$typeUrl === UserConcentratedSuperfluidPositionsDelegatedResponse.typeUrl || Array.isArray(o.cl_pool_user_position_records) && (!o.cl_pool_user_position_records.length || ConcentratedPoolUserPositionRecord.isSDK(o.cl_pool_user_position_records[0]))); + }, + isAmino(o: any): o is UserConcentratedSuperfluidPositionsDelegatedResponseAmino { + return o && (o.$typeUrl === UserConcentratedSuperfluidPositionsDelegatedResponse.typeUrl || Array.isArray(o.cl_pool_user_position_records) && (!o.cl_pool_user_position_records.length || ConcentratedPoolUserPositionRecord.isAmino(o.cl_pool_user_position_records[0]))); + }, encode(message: UserConcentratedSuperfluidPositionsDelegatedResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.clPoolUserPositionRecords) { ConcentratedPoolUserPositionRecord.encode(v!, writer.uint32(10).fork()).ldelim(); @@ -3092,15 +4022,29 @@ export const UserConcentratedSuperfluidPositionsDelegatedResponse = { } return message; }, + fromJSON(object: any): UserConcentratedSuperfluidPositionsDelegatedResponse { + return { + clPoolUserPositionRecords: Array.isArray(object?.clPoolUserPositionRecords) ? object.clPoolUserPositionRecords.map((e: any) => ConcentratedPoolUserPositionRecord.fromJSON(e)) : [] + }; + }, + toJSON(message: UserConcentratedSuperfluidPositionsDelegatedResponse): unknown { + const obj: any = {}; + if (message.clPoolUserPositionRecords) { + obj.clPoolUserPositionRecords = message.clPoolUserPositionRecords.map(e => e ? ConcentratedPoolUserPositionRecord.toJSON(e) : undefined); + } else { + obj.clPoolUserPositionRecords = []; + } + return obj; + }, fromPartial(object: Partial): UserConcentratedSuperfluidPositionsDelegatedResponse { const message = createBaseUserConcentratedSuperfluidPositionsDelegatedResponse(); message.clPoolUserPositionRecords = object.clPoolUserPositionRecords?.map(e => ConcentratedPoolUserPositionRecord.fromPartial(e)) || []; return message; }, fromAmino(object: UserConcentratedSuperfluidPositionsDelegatedResponseAmino): UserConcentratedSuperfluidPositionsDelegatedResponse { - return { - clPoolUserPositionRecords: Array.isArray(object?.cl_pool_user_position_records) ? object.cl_pool_user_position_records.map((e: any) => ConcentratedPoolUserPositionRecord.fromAmino(e)) : [] - }; + const message = createBaseUserConcentratedSuperfluidPositionsDelegatedResponse(); + message.clPoolUserPositionRecords = object.cl_pool_user_position_records?.map(e => ConcentratedPoolUserPositionRecord.fromAmino(e)) || []; + return message; }, toAmino(message: UserConcentratedSuperfluidPositionsDelegatedResponse): UserConcentratedSuperfluidPositionsDelegatedResponseAmino { const obj: any = {}; @@ -3133,6 +4077,8 @@ export const UserConcentratedSuperfluidPositionsDelegatedResponse = { }; } }; +GlobalDecoderRegistry.register(UserConcentratedSuperfluidPositionsDelegatedResponse.typeUrl, UserConcentratedSuperfluidPositionsDelegatedResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(UserConcentratedSuperfluidPositionsDelegatedResponse.aminoType, UserConcentratedSuperfluidPositionsDelegatedResponse.typeUrl); function createBaseUserConcentratedSuperfluidPositionsUndelegatingRequest(): UserConcentratedSuperfluidPositionsUndelegatingRequest { return { delegatorAddress: "" @@ -3140,6 +4086,16 @@ function createBaseUserConcentratedSuperfluidPositionsUndelegatingRequest(): Use } export const UserConcentratedSuperfluidPositionsUndelegatingRequest = { typeUrl: "/osmosis.superfluid.UserConcentratedSuperfluidPositionsUndelegatingRequest", + aminoType: "osmosis/user-concentrated-superfluid-positions-undelegating-request", + is(o: any): o is UserConcentratedSuperfluidPositionsUndelegatingRequest { + return o && (o.$typeUrl === UserConcentratedSuperfluidPositionsUndelegatingRequest.typeUrl || typeof o.delegatorAddress === "string"); + }, + isSDK(o: any): o is UserConcentratedSuperfluidPositionsUndelegatingRequestSDKType { + return o && (o.$typeUrl === UserConcentratedSuperfluidPositionsUndelegatingRequest.typeUrl || typeof o.delegator_address === "string"); + }, + isAmino(o: any): o is UserConcentratedSuperfluidPositionsUndelegatingRequestAmino { + return o && (o.$typeUrl === UserConcentratedSuperfluidPositionsUndelegatingRequest.typeUrl || typeof o.delegator_address === "string"); + }, encode(message: UserConcentratedSuperfluidPositionsUndelegatingRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.delegatorAddress !== "") { writer.uint32(10).string(message.delegatorAddress); @@ -3163,15 +4119,27 @@ export const UserConcentratedSuperfluidPositionsUndelegatingRequest = { } return message; }, + fromJSON(object: any): UserConcentratedSuperfluidPositionsUndelegatingRequest { + return { + delegatorAddress: isSet(object.delegatorAddress) ? String(object.delegatorAddress) : "" + }; + }, + toJSON(message: UserConcentratedSuperfluidPositionsUndelegatingRequest): unknown { + const obj: any = {}; + message.delegatorAddress !== undefined && (obj.delegatorAddress = message.delegatorAddress); + return obj; + }, fromPartial(object: Partial): UserConcentratedSuperfluidPositionsUndelegatingRequest { const message = createBaseUserConcentratedSuperfluidPositionsUndelegatingRequest(); message.delegatorAddress = object.delegatorAddress ?? ""; return message; }, fromAmino(object: UserConcentratedSuperfluidPositionsUndelegatingRequestAmino): UserConcentratedSuperfluidPositionsUndelegatingRequest { - return { - delegatorAddress: object.delegator_address - }; + const message = createBaseUserConcentratedSuperfluidPositionsUndelegatingRequest(); + if (object.delegator_address !== undefined && object.delegator_address !== null) { + message.delegatorAddress = object.delegator_address; + } + return message; }, toAmino(message: UserConcentratedSuperfluidPositionsUndelegatingRequest): UserConcentratedSuperfluidPositionsUndelegatingRequestAmino { const obj: any = {}; @@ -3200,6 +4168,8 @@ export const UserConcentratedSuperfluidPositionsUndelegatingRequest = { }; } }; +GlobalDecoderRegistry.register(UserConcentratedSuperfluidPositionsUndelegatingRequest.typeUrl, UserConcentratedSuperfluidPositionsUndelegatingRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(UserConcentratedSuperfluidPositionsUndelegatingRequest.aminoType, UserConcentratedSuperfluidPositionsUndelegatingRequest.typeUrl); function createBaseUserConcentratedSuperfluidPositionsUndelegatingResponse(): UserConcentratedSuperfluidPositionsUndelegatingResponse { return { clPoolUserPositionRecords: [] @@ -3207,6 +4177,16 @@ function createBaseUserConcentratedSuperfluidPositionsUndelegatingResponse(): Us } export const UserConcentratedSuperfluidPositionsUndelegatingResponse = { typeUrl: "/osmosis.superfluid.UserConcentratedSuperfluidPositionsUndelegatingResponse", + aminoType: "osmosis/user-concentrated-superfluid-positions-undelegating-response", + is(o: any): o is UserConcentratedSuperfluidPositionsUndelegatingResponse { + return o && (o.$typeUrl === UserConcentratedSuperfluidPositionsUndelegatingResponse.typeUrl || Array.isArray(o.clPoolUserPositionRecords) && (!o.clPoolUserPositionRecords.length || ConcentratedPoolUserPositionRecord.is(o.clPoolUserPositionRecords[0]))); + }, + isSDK(o: any): o is UserConcentratedSuperfluidPositionsUndelegatingResponseSDKType { + return o && (o.$typeUrl === UserConcentratedSuperfluidPositionsUndelegatingResponse.typeUrl || Array.isArray(o.cl_pool_user_position_records) && (!o.cl_pool_user_position_records.length || ConcentratedPoolUserPositionRecord.isSDK(o.cl_pool_user_position_records[0]))); + }, + isAmino(o: any): o is UserConcentratedSuperfluidPositionsUndelegatingResponseAmino { + return o && (o.$typeUrl === UserConcentratedSuperfluidPositionsUndelegatingResponse.typeUrl || Array.isArray(o.cl_pool_user_position_records) && (!o.cl_pool_user_position_records.length || ConcentratedPoolUserPositionRecord.isAmino(o.cl_pool_user_position_records[0]))); + }, encode(message: UserConcentratedSuperfluidPositionsUndelegatingResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.clPoolUserPositionRecords) { ConcentratedPoolUserPositionRecord.encode(v!, writer.uint32(10).fork()).ldelim(); @@ -3230,15 +4210,29 @@ export const UserConcentratedSuperfluidPositionsUndelegatingResponse = { } return message; }, + fromJSON(object: any): UserConcentratedSuperfluidPositionsUndelegatingResponse { + return { + clPoolUserPositionRecords: Array.isArray(object?.clPoolUserPositionRecords) ? object.clPoolUserPositionRecords.map((e: any) => ConcentratedPoolUserPositionRecord.fromJSON(e)) : [] + }; + }, + toJSON(message: UserConcentratedSuperfluidPositionsUndelegatingResponse): unknown { + const obj: any = {}; + if (message.clPoolUserPositionRecords) { + obj.clPoolUserPositionRecords = message.clPoolUserPositionRecords.map(e => e ? ConcentratedPoolUserPositionRecord.toJSON(e) : undefined); + } else { + obj.clPoolUserPositionRecords = []; + } + return obj; + }, fromPartial(object: Partial): UserConcentratedSuperfluidPositionsUndelegatingResponse { const message = createBaseUserConcentratedSuperfluidPositionsUndelegatingResponse(); message.clPoolUserPositionRecords = object.clPoolUserPositionRecords?.map(e => ConcentratedPoolUserPositionRecord.fromPartial(e)) || []; return message; }, fromAmino(object: UserConcentratedSuperfluidPositionsUndelegatingResponseAmino): UserConcentratedSuperfluidPositionsUndelegatingResponse { - return { - clPoolUserPositionRecords: Array.isArray(object?.cl_pool_user_position_records) ? object.cl_pool_user_position_records.map((e: any) => ConcentratedPoolUserPositionRecord.fromAmino(e)) : [] - }; + const message = createBaseUserConcentratedSuperfluidPositionsUndelegatingResponse(); + message.clPoolUserPositionRecords = object.cl_pool_user_position_records?.map(e => ConcentratedPoolUserPositionRecord.fromAmino(e)) || []; + return message; }, toAmino(message: UserConcentratedSuperfluidPositionsUndelegatingResponse): UserConcentratedSuperfluidPositionsUndelegatingResponseAmino { const obj: any = {}; @@ -3270,4 +4264,188 @@ export const UserConcentratedSuperfluidPositionsUndelegatingResponse = { value: UserConcentratedSuperfluidPositionsUndelegatingResponse.encode(message).finish() }; } -}; \ No newline at end of file +}; +GlobalDecoderRegistry.register(UserConcentratedSuperfluidPositionsUndelegatingResponse.typeUrl, UserConcentratedSuperfluidPositionsUndelegatingResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(UserConcentratedSuperfluidPositionsUndelegatingResponse.aminoType, UserConcentratedSuperfluidPositionsUndelegatingResponse.typeUrl); +function createBaseQueryRestSupplyRequest(): QueryRestSupplyRequest { + return { + denom: "" + }; +} +export const QueryRestSupplyRequest = { + typeUrl: "/osmosis.superfluid.QueryRestSupplyRequest", + aminoType: "osmosis/query-rest-supply-request", + is(o: any): o is QueryRestSupplyRequest { + return o && (o.$typeUrl === QueryRestSupplyRequest.typeUrl || typeof o.denom === "string"); + }, + isSDK(o: any): o is QueryRestSupplyRequestSDKType { + return o && (o.$typeUrl === QueryRestSupplyRequest.typeUrl || typeof o.denom === "string"); + }, + isAmino(o: any): o is QueryRestSupplyRequestAmino { + return o && (o.$typeUrl === QueryRestSupplyRequest.typeUrl || typeof o.denom === "string"); + }, + encode(message: QueryRestSupplyRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.denom !== "") { + writer.uint32(10).string(message.denom); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryRestSupplyRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryRestSupplyRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.denom = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): QueryRestSupplyRequest { + return { + denom: isSet(object.denom) ? String(object.denom) : "" + }; + }, + toJSON(message: QueryRestSupplyRequest): unknown { + const obj: any = {}; + message.denom !== undefined && (obj.denom = message.denom); + return obj; + }, + fromPartial(object: Partial): QueryRestSupplyRequest { + const message = createBaseQueryRestSupplyRequest(); + message.denom = object.denom ?? ""; + return message; + }, + fromAmino(object: QueryRestSupplyRequestAmino): QueryRestSupplyRequest { + const message = createBaseQueryRestSupplyRequest(); + if (object.denom !== undefined && object.denom !== null) { + message.denom = object.denom; + } + return message; + }, + toAmino(message: QueryRestSupplyRequest): QueryRestSupplyRequestAmino { + const obj: any = {}; + obj.denom = message.denom; + return obj; + }, + fromAminoMsg(object: QueryRestSupplyRequestAminoMsg): QueryRestSupplyRequest { + return QueryRestSupplyRequest.fromAmino(object.value); + }, + toAminoMsg(message: QueryRestSupplyRequest): QueryRestSupplyRequestAminoMsg { + return { + type: "osmosis/query-rest-supply-request", + value: QueryRestSupplyRequest.toAmino(message) + }; + }, + fromProtoMsg(message: QueryRestSupplyRequestProtoMsg): QueryRestSupplyRequest { + return QueryRestSupplyRequest.decode(message.value); + }, + toProto(message: QueryRestSupplyRequest): Uint8Array { + return QueryRestSupplyRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryRestSupplyRequest): QueryRestSupplyRequestProtoMsg { + return { + typeUrl: "/osmosis.superfluid.QueryRestSupplyRequest", + value: QueryRestSupplyRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryRestSupplyRequest.typeUrl, QueryRestSupplyRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryRestSupplyRequest.aminoType, QueryRestSupplyRequest.typeUrl); +function createBaseQueryRestSupplyResponse(): QueryRestSupplyResponse { + return { + amount: Coin.fromPartial({}) + }; +} +export const QueryRestSupplyResponse = { + typeUrl: "/osmosis.superfluid.QueryRestSupplyResponse", + aminoType: "osmosis/query-rest-supply-response", + is(o: any): o is QueryRestSupplyResponse { + return o && (o.$typeUrl === QueryRestSupplyResponse.typeUrl || Coin.is(o.amount)); + }, + isSDK(o: any): o is QueryRestSupplyResponseSDKType { + return o && (o.$typeUrl === QueryRestSupplyResponse.typeUrl || Coin.isSDK(o.amount)); + }, + isAmino(o: any): o is QueryRestSupplyResponseAmino { + return o && (o.$typeUrl === QueryRestSupplyResponse.typeUrl || Coin.isAmino(o.amount)); + }, + encode(message: QueryRestSupplyResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.amount !== undefined) { + Coin.encode(message.amount, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryRestSupplyResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryRestSupplyResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.amount = Coin.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): QueryRestSupplyResponse { + return { + amount: isSet(object.amount) ? Coin.fromJSON(object.amount) : undefined + }; + }, + toJSON(message: QueryRestSupplyResponse): unknown { + const obj: any = {}; + message.amount !== undefined && (obj.amount = message.amount ? Coin.toJSON(message.amount) : undefined); + return obj; + }, + fromPartial(object: Partial): QueryRestSupplyResponse { + const message = createBaseQueryRestSupplyResponse(); + message.amount = object.amount !== undefined && object.amount !== null ? Coin.fromPartial(object.amount) : undefined; + return message; + }, + fromAmino(object: QueryRestSupplyResponseAmino): QueryRestSupplyResponse { + const message = createBaseQueryRestSupplyResponse(); + if (object.amount !== undefined && object.amount !== null) { + message.amount = Coin.fromAmino(object.amount); + } + return message; + }, + toAmino(message: QueryRestSupplyResponse): QueryRestSupplyResponseAmino { + const obj: any = {}; + obj.amount = message.amount ? Coin.toAmino(message.amount) : undefined; + return obj; + }, + fromAminoMsg(object: QueryRestSupplyResponseAminoMsg): QueryRestSupplyResponse { + return QueryRestSupplyResponse.fromAmino(object.value); + }, + toAminoMsg(message: QueryRestSupplyResponse): QueryRestSupplyResponseAminoMsg { + return { + type: "osmosis/query-rest-supply-response", + value: QueryRestSupplyResponse.toAmino(message) + }; + }, + fromProtoMsg(message: QueryRestSupplyResponseProtoMsg): QueryRestSupplyResponse { + return QueryRestSupplyResponse.decode(message.value); + }, + toProto(message: QueryRestSupplyResponse): Uint8Array { + return QueryRestSupplyResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryRestSupplyResponse): QueryRestSupplyResponseProtoMsg { + return { + typeUrl: "/osmosis.superfluid.QueryRestSupplyResponse", + value: QueryRestSupplyResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryRestSupplyResponse.typeUrl, QueryRestSupplyResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryRestSupplyResponse.aminoType, QueryRestSupplyResponse.typeUrl); \ No newline at end of file diff --git a/packages/osmojs/src/codegen/osmosis/superfluid/superfluid.ts b/packages/osmojs/src/codegen/osmosis/superfluid/superfluid.ts index 9c7edb5a9..3a6c10fab 100644 --- a/packages/osmojs/src/codegen/osmosis/superfluid/superfluid.ts +++ b/packages/osmojs/src/codegen/osmosis/superfluid/superfluid.ts @@ -1,7 +1,8 @@ import { Coin, CoinAmino, CoinSDKType } from "../../cosmos/base/v1beta1/coin"; import { SyntheticLock, SyntheticLockAmino, SyntheticLockSDKType } from "../lockup/lock"; -import { BinaryReader, BinaryWriter } from "../../binary"; import { isSet } from "../../helpers"; +import { BinaryReader, BinaryWriter } from "../../binary"; +import { GlobalDecoderRegistry } from "../../registry"; import { Decimal } from "@cosmjs/math"; /** * SuperfluidAssetType indicates whether the superfluid asset is @@ -60,12 +61,12 @@ export interface SuperfluidAssetProtoMsg { } /** SuperfluidAsset stores the pair of superfluid asset type and denom pair */ export interface SuperfluidAssetAmino { - denom: string; + denom?: string; /** * AssetType indicates whether the superfluid asset is a native token or an lp * share */ - asset_type: SuperfluidAssetType; + asset_type?: SuperfluidAssetType; } export interface SuperfluidAssetAminoMsg { type: "osmosis/superfluid-asset"; @@ -99,10 +100,10 @@ export interface SuperfluidIntermediaryAccountProtoMsg { */ export interface SuperfluidIntermediaryAccountAmino { /** Denom indicates the denom of the superfluid asset. */ - denom: string; - val_addr: string; + denom?: string; + val_addr?: string; /** perpetual gauge for rewards distribution */ - gauge_id: string; + gauge_id?: string; } export interface SuperfluidIntermediaryAccountAminoMsg { type: "osmosis/superfluid-intermediary-account"; @@ -122,10 +123,10 @@ export interface SuperfluidIntermediaryAccountSDKType { * The Osmo-Equivalent-Multiplier Record for epoch N refers to the osmo worth we * treat an LP share as having, for all of epoch N. Eventually this is intended * to be set as the Time-weighted-average-osmo-backing for the entire duration - * of epoch N-1. (Thereby locking whats in use for epoch N as based on the prior - * epochs rewards) However for now, this is not the TWAP but instead the spot - * price at the boundary. For different types of assets in the future, it could - * change. + * of epoch N-1. (Thereby locking what's in use for epoch N as based on the + * prior epochs rewards) However for now, this is not the TWAP but instead the + * spot price at the boundary. For different types of assets in the future, it + * could change. */ export interface OsmoEquivalentMultiplierRecord { epochNumber: bigint; @@ -141,16 +142,16 @@ export interface OsmoEquivalentMultiplierRecordProtoMsg { * The Osmo-Equivalent-Multiplier Record for epoch N refers to the osmo worth we * treat an LP share as having, for all of epoch N. Eventually this is intended * to be set as the Time-weighted-average-osmo-backing for the entire duration - * of epoch N-1. (Thereby locking whats in use for epoch N as based on the prior - * epochs rewards) However for now, this is not the TWAP but instead the spot - * price at the boundary. For different types of assets in the future, it could - * change. + * of epoch N-1. (Thereby locking what's in use for epoch N as based on the + * prior epochs rewards) However for now, this is not the TWAP but instead the + * spot price at the boundary. For different types of assets in the future, it + * could change. */ export interface OsmoEquivalentMultiplierRecordAmino { - epoch_number: string; + epoch_number?: string; /** superfluid asset denom, can be LP token or native token */ - denom: string; - multiplier: string; + denom?: string; + multiplier?: string; } export interface OsmoEquivalentMultiplierRecordAminoMsg { type: "osmosis/osmo-equivalent-multiplier-record"; @@ -160,10 +161,10 @@ export interface OsmoEquivalentMultiplierRecordAminoMsg { * The Osmo-Equivalent-Multiplier Record for epoch N refers to the osmo worth we * treat an LP share as having, for all of epoch N. Eventually this is intended * to be set as the Time-weighted-average-osmo-backing for the entire duration - * of epoch N-1. (Thereby locking whats in use for epoch N as based on the prior - * epochs rewards) However for now, this is not the TWAP but instead the spot - * price at the boundary. For different types of assets in the future, it could - * change. + * of epoch N-1. (Thereby locking what's in use for epoch N as based on the + * prior epochs rewards) However for now, this is not the TWAP but instead the + * spot price at the boundary. For different types of assets in the future, it + * could change. */ export interface OsmoEquivalentMultiplierRecordSDKType { epoch_number: bigint; @@ -178,7 +179,7 @@ export interface SuperfluidDelegationRecord { delegatorAddress: string; validatorAddress: string; delegationAmount: Coin; - equivalentStakedAmount: Coin; + equivalentStakedAmount?: Coin; } export interface SuperfluidDelegationRecordProtoMsg { typeUrl: "/osmosis.superfluid.SuperfluidDelegationRecord"; @@ -189,8 +190,8 @@ export interface SuperfluidDelegationRecordProtoMsg { * delegations of an account in the state machine in a user friendly form. */ export interface SuperfluidDelegationRecordAmino { - delegator_address: string; - validator_address: string; + delegator_address?: string; + validator_address?: string; delegation_amount?: CoinAmino; equivalent_staked_amount?: CoinAmino; } @@ -206,7 +207,7 @@ export interface SuperfluidDelegationRecordSDKType { delegator_address: string; validator_address: string; delegation_amount: CoinSDKType; - equivalent_staked_amount: CoinSDKType; + equivalent_staked_amount?: CoinSDKType; } /** * LockIdIntermediaryAccountConnection is a struct used to indicate the @@ -227,8 +228,8 @@ export interface LockIdIntermediaryAccountConnectionProtoMsg { * via lp shares. */ export interface LockIdIntermediaryAccountConnectionAmino { - lock_id: string; - intermediary_account: string; + lock_id?: string; + intermediary_account?: string; } export interface LockIdIntermediaryAccountConnectionAminoMsg { type: "osmosis/lock-id-intermediary-account-connection"; @@ -251,7 +252,7 @@ export interface UnpoolWhitelistedPoolsProtoMsg { value: Uint8Array; } export interface UnpoolWhitelistedPoolsAmino { - ids: string[]; + ids?: string[]; } export interface UnpoolWhitelistedPoolsAminoMsg { type: "osmosis/unpool-whitelisted-pools"; @@ -266,16 +267,16 @@ export interface ConcentratedPoolUserPositionRecord { lockId: bigint; syntheticLock: SyntheticLock; delegationAmount: Coin; - equivalentStakedAmount: Coin; + equivalentStakedAmount?: Coin; } export interface ConcentratedPoolUserPositionRecordProtoMsg { typeUrl: "/osmosis.superfluid.ConcentratedPoolUserPositionRecord"; value: Uint8Array; } export interface ConcentratedPoolUserPositionRecordAmino { - validator_address: string; - position_id: string; - lock_id: string; + validator_address?: string; + position_id?: string; + lock_id?: string; synthetic_lock?: SyntheticLockAmino; delegation_amount?: CoinAmino; equivalent_staked_amount?: CoinAmino; @@ -290,7 +291,7 @@ export interface ConcentratedPoolUserPositionRecordSDKType { lock_id: bigint; synthetic_lock: SyntheticLockSDKType; delegation_amount: CoinSDKType; - equivalent_staked_amount: CoinSDKType; + equivalent_staked_amount?: CoinSDKType; } function createBaseSuperfluidAsset(): SuperfluidAsset { return { @@ -300,6 +301,16 @@ function createBaseSuperfluidAsset(): SuperfluidAsset { } export const SuperfluidAsset = { typeUrl: "/osmosis.superfluid.SuperfluidAsset", + aminoType: "osmosis/superfluid-asset", + is(o: any): o is SuperfluidAsset { + return o && (o.$typeUrl === SuperfluidAsset.typeUrl || typeof o.denom === "string" && isSet(o.assetType)); + }, + isSDK(o: any): o is SuperfluidAssetSDKType { + return o && (o.$typeUrl === SuperfluidAsset.typeUrl || typeof o.denom === "string" && isSet(o.asset_type)); + }, + isAmino(o: any): o is SuperfluidAssetAmino { + return o && (o.$typeUrl === SuperfluidAsset.typeUrl || typeof o.denom === "string" && isSet(o.asset_type)); + }, encode(message: SuperfluidAsset, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.denom !== "") { writer.uint32(10).string(message.denom); @@ -329,6 +340,18 @@ export const SuperfluidAsset = { } return message; }, + fromJSON(object: any): SuperfluidAsset { + return { + denom: isSet(object.denom) ? String(object.denom) : "", + assetType: isSet(object.assetType) ? superfluidAssetTypeFromJSON(object.assetType) : -1 + }; + }, + toJSON(message: SuperfluidAsset): unknown { + const obj: any = {}; + message.denom !== undefined && (obj.denom = message.denom); + message.assetType !== undefined && (obj.assetType = superfluidAssetTypeToJSON(message.assetType)); + return obj; + }, fromPartial(object: Partial): SuperfluidAsset { const message = createBaseSuperfluidAsset(); message.denom = object.denom ?? ""; @@ -336,15 +359,19 @@ export const SuperfluidAsset = { return message; }, fromAmino(object: SuperfluidAssetAmino): SuperfluidAsset { - return { - denom: object.denom, - assetType: isSet(object.asset_type) ? superfluidAssetTypeFromJSON(object.asset_type) : -1 - }; + const message = createBaseSuperfluidAsset(); + if (object.denom !== undefined && object.denom !== null) { + message.denom = object.denom; + } + if (object.asset_type !== undefined && object.asset_type !== null) { + message.assetType = superfluidAssetTypeFromJSON(object.asset_type); + } + return message; }, toAmino(message: SuperfluidAsset): SuperfluidAssetAmino { const obj: any = {}; obj.denom = message.denom; - obj.asset_type = message.assetType; + obj.asset_type = superfluidAssetTypeToJSON(message.assetType); return obj; }, fromAminoMsg(object: SuperfluidAssetAminoMsg): SuperfluidAsset { @@ -369,6 +396,8 @@ export const SuperfluidAsset = { }; } }; +GlobalDecoderRegistry.register(SuperfluidAsset.typeUrl, SuperfluidAsset); +GlobalDecoderRegistry.registerAminoProtoMapping(SuperfluidAsset.aminoType, SuperfluidAsset.typeUrl); function createBaseSuperfluidIntermediaryAccount(): SuperfluidIntermediaryAccount { return { denom: "", @@ -378,6 +407,16 @@ function createBaseSuperfluidIntermediaryAccount(): SuperfluidIntermediaryAccoun } export const SuperfluidIntermediaryAccount = { typeUrl: "/osmosis.superfluid.SuperfluidIntermediaryAccount", + aminoType: "osmosis/superfluid-intermediary-account", + is(o: any): o is SuperfluidIntermediaryAccount { + return o && (o.$typeUrl === SuperfluidIntermediaryAccount.typeUrl || typeof o.denom === "string" && typeof o.valAddr === "string" && typeof o.gaugeId === "bigint"); + }, + isSDK(o: any): o is SuperfluidIntermediaryAccountSDKType { + return o && (o.$typeUrl === SuperfluidIntermediaryAccount.typeUrl || typeof o.denom === "string" && typeof o.val_addr === "string" && typeof o.gauge_id === "bigint"); + }, + isAmino(o: any): o is SuperfluidIntermediaryAccountAmino { + return o && (o.$typeUrl === SuperfluidIntermediaryAccount.typeUrl || typeof o.denom === "string" && typeof o.val_addr === "string" && typeof o.gauge_id === "bigint"); + }, encode(message: SuperfluidIntermediaryAccount, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.denom !== "") { writer.uint32(10).string(message.denom); @@ -413,6 +452,20 @@ export const SuperfluidIntermediaryAccount = { } return message; }, + fromJSON(object: any): SuperfluidIntermediaryAccount { + return { + denom: isSet(object.denom) ? String(object.denom) : "", + valAddr: isSet(object.valAddr) ? String(object.valAddr) : "", + gaugeId: isSet(object.gaugeId) ? BigInt(object.gaugeId.toString()) : BigInt(0) + }; + }, + toJSON(message: SuperfluidIntermediaryAccount): unknown { + const obj: any = {}; + message.denom !== undefined && (obj.denom = message.denom); + message.valAddr !== undefined && (obj.valAddr = message.valAddr); + message.gaugeId !== undefined && (obj.gaugeId = (message.gaugeId || BigInt(0)).toString()); + return obj; + }, fromPartial(object: Partial): SuperfluidIntermediaryAccount { const message = createBaseSuperfluidIntermediaryAccount(); message.denom = object.denom ?? ""; @@ -421,11 +474,17 @@ export const SuperfluidIntermediaryAccount = { return message; }, fromAmino(object: SuperfluidIntermediaryAccountAmino): SuperfluidIntermediaryAccount { - return { - denom: object.denom, - valAddr: object.val_addr, - gaugeId: BigInt(object.gauge_id) - }; + const message = createBaseSuperfluidIntermediaryAccount(); + if (object.denom !== undefined && object.denom !== null) { + message.denom = object.denom; + } + if (object.val_addr !== undefined && object.val_addr !== null) { + message.valAddr = object.val_addr; + } + if (object.gauge_id !== undefined && object.gauge_id !== null) { + message.gaugeId = BigInt(object.gauge_id); + } + return message; }, toAmino(message: SuperfluidIntermediaryAccount): SuperfluidIntermediaryAccountAmino { const obj: any = {}; @@ -456,6 +515,8 @@ export const SuperfluidIntermediaryAccount = { }; } }; +GlobalDecoderRegistry.register(SuperfluidIntermediaryAccount.typeUrl, SuperfluidIntermediaryAccount); +GlobalDecoderRegistry.registerAminoProtoMapping(SuperfluidIntermediaryAccount.aminoType, SuperfluidIntermediaryAccount.typeUrl); function createBaseOsmoEquivalentMultiplierRecord(): OsmoEquivalentMultiplierRecord { return { epochNumber: BigInt(0), @@ -465,6 +526,16 @@ function createBaseOsmoEquivalentMultiplierRecord(): OsmoEquivalentMultiplierRec } export const OsmoEquivalentMultiplierRecord = { typeUrl: "/osmosis.superfluid.OsmoEquivalentMultiplierRecord", + aminoType: "osmosis/osmo-equivalent-multiplier-record", + is(o: any): o is OsmoEquivalentMultiplierRecord { + return o && (o.$typeUrl === OsmoEquivalentMultiplierRecord.typeUrl || typeof o.epochNumber === "bigint" && typeof o.denom === "string" && typeof o.multiplier === "string"); + }, + isSDK(o: any): o is OsmoEquivalentMultiplierRecordSDKType { + return o && (o.$typeUrl === OsmoEquivalentMultiplierRecord.typeUrl || typeof o.epoch_number === "bigint" && typeof o.denom === "string" && typeof o.multiplier === "string"); + }, + isAmino(o: any): o is OsmoEquivalentMultiplierRecordAmino { + return o && (o.$typeUrl === OsmoEquivalentMultiplierRecord.typeUrl || typeof o.epoch_number === "bigint" && typeof o.denom === "string" && typeof o.multiplier === "string"); + }, encode(message: OsmoEquivalentMultiplierRecord, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.epochNumber !== BigInt(0)) { writer.uint32(8).int64(message.epochNumber); @@ -500,6 +571,20 @@ export const OsmoEquivalentMultiplierRecord = { } return message; }, + fromJSON(object: any): OsmoEquivalentMultiplierRecord { + return { + epochNumber: isSet(object.epochNumber) ? BigInt(object.epochNumber.toString()) : BigInt(0), + denom: isSet(object.denom) ? String(object.denom) : "", + multiplier: isSet(object.multiplier) ? String(object.multiplier) : "" + }; + }, + toJSON(message: OsmoEquivalentMultiplierRecord): unknown { + const obj: any = {}; + message.epochNumber !== undefined && (obj.epochNumber = (message.epochNumber || BigInt(0)).toString()); + message.denom !== undefined && (obj.denom = message.denom); + message.multiplier !== undefined && (obj.multiplier = message.multiplier); + return obj; + }, fromPartial(object: Partial): OsmoEquivalentMultiplierRecord { const message = createBaseOsmoEquivalentMultiplierRecord(); message.epochNumber = object.epochNumber !== undefined && object.epochNumber !== null ? BigInt(object.epochNumber.toString()) : BigInt(0); @@ -508,11 +593,17 @@ export const OsmoEquivalentMultiplierRecord = { return message; }, fromAmino(object: OsmoEquivalentMultiplierRecordAmino): OsmoEquivalentMultiplierRecord { - return { - epochNumber: BigInt(object.epoch_number), - denom: object.denom, - multiplier: object.multiplier - }; + const message = createBaseOsmoEquivalentMultiplierRecord(); + if (object.epoch_number !== undefined && object.epoch_number !== null) { + message.epochNumber = BigInt(object.epoch_number); + } + if (object.denom !== undefined && object.denom !== null) { + message.denom = object.denom; + } + if (object.multiplier !== undefined && object.multiplier !== null) { + message.multiplier = object.multiplier; + } + return message; }, toAmino(message: OsmoEquivalentMultiplierRecord): OsmoEquivalentMultiplierRecordAmino { const obj: any = {}; @@ -543,16 +634,28 @@ export const OsmoEquivalentMultiplierRecord = { }; } }; +GlobalDecoderRegistry.register(OsmoEquivalentMultiplierRecord.typeUrl, OsmoEquivalentMultiplierRecord); +GlobalDecoderRegistry.registerAminoProtoMapping(OsmoEquivalentMultiplierRecord.aminoType, OsmoEquivalentMultiplierRecord.typeUrl); function createBaseSuperfluidDelegationRecord(): SuperfluidDelegationRecord { return { delegatorAddress: "", validatorAddress: "", - delegationAmount: undefined, + delegationAmount: Coin.fromPartial({}), equivalentStakedAmount: undefined }; } export const SuperfluidDelegationRecord = { typeUrl: "/osmosis.superfluid.SuperfluidDelegationRecord", + aminoType: "osmosis/superfluid-delegation-record", + is(o: any): o is SuperfluidDelegationRecord { + return o && (o.$typeUrl === SuperfluidDelegationRecord.typeUrl || typeof o.delegatorAddress === "string" && typeof o.validatorAddress === "string" && Coin.is(o.delegationAmount)); + }, + isSDK(o: any): o is SuperfluidDelegationRecordSDKType { + return o && (o.$typeUrl === SuperfluidDelegationRecord.typeUrl || typeof o.delegator_address === "string" && typeof o.validator_address === "string" && Coin.isSDK(o.delegation_amount)); + }, + isAmino(o: any): o is SuperfluidDelegationRecordAmino { + return o && (o.$typeUrl === SuperfluidDelegationRecord.typeUrl || typeof o.delegator_address === "string" && typeof o.validator_address === "string" && Coin.isAmino(o.delegation_amount)); + }, encode(message: SuperfluidDelegationRecord, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.delegatorAddress !== "") { writer.uint32(10).string(message.delegatorAddress); @@ -594,6 +697,22 @@ export const SuperfluidDelegationRecord = { } return message; }, + fromJSON(object: any): SuperfluidDelegationRecord { + return { + delegatorAddress: isSet(object.delegatorAddress) ? String(object.delegatorAddress) : "", + validatorAddress: isSet(object.validatorAddress) ? String(object.validatorAddress) : "", + delegationAmount: isSet(object.delegationAmount) ? Coin.fromJSON(object.delegationAmount) : undefined, + equivalentStakedAmount: isSet(object.equivalentStakedAmount) ? Coin.fromJSON(object.equivalentStakedAmount) : undefined + }; + }, + toJSON(message: SuperfluidDelegationRecord): unknown { + const obj: any = {}; + message.delegatorAddress !== undefined && (obj.delegatorAddress = message.delegatorAddress); + message.validatorAddress !== undefined && (obj.validatorAddress = message.validatorAddress); + message.delegationAmount !== undefined && (obj.delegationAmount = message.delegationAmount ? Coin.toJSON(message.delegationAmount) : undefined); + message.equivalentStakedAmount !== undefined && (obj.equivalentStakedAmount = message.equivalentStakedAmount ? Coin.toJSON(message.equivalentStakedAmount) : undefined); + return obj; + }, fromPartial(object: Partial): SuperfluidDelegationRecord { const message = createBaseSuperfluidDelegationRecord(); message.delegatorAddress = object.delegatorAddress ?? ""; @@ -603,12 +722,20 @@ export const SuperfluidDelegationRecord = { return message; }, fromAmino(object: SuperfluidDelegationRecordAmino): SuperfluidDelegationRecord { - return { - delegatorAddress: object.delegator_address, - validatorAddress: object.validator_address, - delegationAmount: object?.delegation_amount ? Coin.fromAmino(object.delegation_amount) : undefined, - equivalentStakedAmount: object?.equivalent_staked_amount ? Coin.fromAmino(object.equivalent_staked_amount) : undefined - }; + const message = createBaseSuperfluidDelegationRecord(); + if (object.delegator_address !== undefined && object.delegator_address !== null) { + message.delegatorAddress = object.delegator_address; + } + if (object.validator_address !== undefined && object.validator_address !== null) { + message.validatorAddress = object.validator_address; + } + if (object.delegation_amount !== undefined && object.delegation_amount !== null) { + message.delegationAmount = Coin.fromAmino(object.delegation_amount); + } + if (object.equivalent_staked_amount !== undefined && object.equivalent_staked_amount !== null) { + message.equivalentStakedAmount = Coin.fromAmino(object.equivalent_staked_amount); + } + return message; }, toAmino(message: SuperfluidDelegationRecord): SuperfluidDelegationRecordAmino { const obj: any = {}; @@ -640,6 +767,8 @@ export const SuperfluidDelegationRecord = { }; } }; +GlobalDecoderRegistry.register(SuperfluidDelegationRecord.typeUrl, SuperfluidDelegationRecord); +GlobalDecoderRegistry.registerAminoProtoMapping(SuperfluidDelegationRecord.aminoType, SuperfluidDelegationRecord.typeUrl); function createBaseLockIdIntermediaryAccountConnection(): LockIdIntermediaryAccountConnection { return { lockId: BigInt(0), @@ -648,6 +777,16 @@ function createBaseLockIdIntermediaryAccountConnection(): LockIdIntermediaryAcco } export const LockIdIntermediaryAccountConnection = { typeUrl: "/osmosis.superfluid.LockIdIntermediaryAccountConnection", + aminoType: "osmosis/lock-id-intermediary-account-connection", + is(o: any): o is LockIdIntermediaryAccountConnection { + return o && (o.$typeUrl === LockIdIntermediaryAccountConnection.typeUrl || typeof o.lockId === "bigint" && typeof o.intermediaryAccount === "string"); + }, + isSDK(o: any): o is LockIdIntermediaryAccountConnectionSDKType { + return o && (o.$typeUrl === LockIdIntermediaryAccountConnection.typeUrl || typeof o.lock_id === "bigint" && typeof o.intermediary_account === "string"); + }, + isAmino(o: any): o is LockIdIntermediaryAccountConnectionAmino { + return o && (o.$typeUrl === LockIdIntermediaryAccountConnection.typeUrl || typeof o.lock_id === "bigint" && typeof o.intermediary_account === "string"); + }, encode(message: LockIdIntermediaryAccountConnection, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.lockId !== BigInt(0)) { writer.uint32(8).uint64(message.lockId); @@ -677,6 +816,18 @@ export const LockIdIntermediaryAccountConnection = { } return message; }, + fromJSON(object: any): LockIdIntermediaryAccountConnection { + return { + lockId: isSet(object.lockId) ? BigInt(object.lockId.toString()) : BigInt(0), + intermediaryAccount: isSet(object.intermediaryAccount) ? String(object.intermediaryAccount) : "" + }; + }, + toJSON(message: LockIdIntermediaryAccountConnection): unknown { + const obj: any = {}; + message.lockId !== undefined && (obj.lockId = (message.lockId || BigInt(0)).toString()); + message.intermediaryAccount !== undefined && (obj.intermediaryAccount = message.intermediaryAccount); + return obj; + }, fromPartial(object: Partial): LockIdIntermediaryAccountConnection { const message = createBaseLockIdIntermediaryAccountConnection(); message.lockId = object.lockId !== undefined && object.lockId !== null ? BigInt(object.lockId.toString()) : BigInt(0); @@ -684,10 +835,14 @@ export const LockIdIntermediaryAccountConnection = { return message; }, fromAmino(object: LockIdIntermediaryAccountConnectionAmino): LockIdIntermediaryAccountConnection { - return { - lockId: BigInt(object.lock_id), - intermediaryAccount: object.intermediary_account - }; + const message = createBaseLockIdIntermediaryAccountConnection(); + if (object.lock_id !== undefined && object.lock_id !== null) { + message.lockId = BigInt(object.lock_id); + } + if (object.intermediary_account !== undefined && object.intermediary_account !== null) { + message.intermediaryAccount = object.intermediary_account; + } + return message; }, toAmino(message: LockIdIntermediaryAccountConnection): LockIdIntermediaryAccountConnectionAmino { const obj: any = {}; @@ -717,6 +872,8 @@ export const LockIdIntermediaryAccountConnection = { }; } }; +GlobalDecoderRegistry.register(LockIdIntermediaryAccountConnection.typeUrl, LockIdIntermediaryAccountConnection); +GlobalDecoderRegistry.registerAminoProtoMapping(LockIdIntermediaryAccountConnection.aminoType, LockIdIntermediaryAccountConnection.typeUrl); function createBaseUnpoolWhitelistedPools(): UnpoolWhitelistedPools { return { ids: [] @@ -724,6 +881,16 @@ function createBaseUnpoolWhitelistedPools(): UnpoolWhitelistedPools { } export const UnpoolWhitelistedPools = { typeUrl: "/osmosis.superfluid.UnpoolWhitelistedPools", + aminoType: "osmosis/unpool-whitelisted-pools", + is(o: any): o is UnpoolWhitelistedPools { + return o && (o.$typeUrl === UnpoolWhitelistedPools.typeUrl || Array.isArray(o.ids) && (!o.ids.length || typeof o.ids[0] === "bigint")); + }, + isSDK(o: any): o is UnpoolWhitelistedPoolsSDKType { + return o && (o.$typeUrl === UnpoolWhitelistedPools.typeUrl || Array.isArray(o.ids) && (!o.ids.length || typeof o.ids[0] === "bigint")); + }, + isAmino(o: any): o is UnpoolWhitelistedPoolsAmino { + return o && (o.$typeUrl === UnpoolWhitelistedPools.typeUrl || Array.isArray(o.ids) && (!o.ids.length || typeof o.ids[0] === "bigint")); + }, encode(message: UnpoolWhitelistedPools, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { writer.uint32(10).fork(); for (const v of message.ids) { @@ -756,15 +923,29 @@ export const UnpoolWhitelistedPools = { } return message; }, + fromJSON(object: any): UnpoolWhitelistedPools { + return { + ids: Array.isArray(object?.ids) ? object.ids.map((e: any) => BigInt(e.toString())) : [] + }; + }, + toJSON(message: UnpoolWhitelistedPools): unknown { + const obj: any = {}; + if (message.ids) { + obj.ids = message.ids.map(e => (e || BigInt(0)).toString()); + } else { + obj.ids = []; + } + return obj; + }, fromPartial(object: Partial): UnpoolWhitelistedPools { const message = createBaseUnpoolWhitelistedPools(); message.ids = object.ids?.map(e => BigInt(e.toString())) || []; return message; }, fromAmino(object: UnpoolWhitelistedPoolsAmino): UnpoolWhitelistedPools { - return { - ids: Array.isArray(object?.ids) ? object.ids.map((e: any) => BigInt(e)) : [] - }; + const message = createBaseUnpoolWhitelistedPools(); + message.ids = object.ids?.map(e => BigInt(e)) || []; + return message; }, toAmino(message: UnpoolWhitelistedPools): UnpoolWhitelistedPoolsAmino { const obj: any = {}; @@ -797,18 +978,30 @@ export const UnpoolWhitelistedPools = { }; } }; +GlobalDecoderRegistry.register(UnpoolWhitelistedPools.typeUrl, UnpoolWhitelistedPools); +GlobalDecoderRegistry.registerAminoProtoMapping(UnpoolWhitelistedPools.aminoType, UnpoolWhitelistedPools.typeUrl); function createBaseConcentratedPoolUserPositionRecord(): ConcentratedPoolUserPositionRecord { return { validatorAddress: "", positionId: BigInt(0), lockId: BigInt(0), syntheticLock: SyntheticLock.fromPartial({}), - delegationAmount: undefined, + delegationAmount: Coin.fromPartial({}), equivalentStakedAmount: undefined }; } export const ConcentratedPoolUserPositionRecord = { typeUrl: "/osmosis.superfluid.ConcentratedPoolUserPositionRecord", + aminoType: "osmosis/concentrated-pool-user-position-record", + is(o: any): o is ConcentratedPoolUserPositionRecord { + return o && (o.$typeUrl === ConcentratedPoolUserPositionRecord.typeUrl || typeof o.validatorAddress === "string" && typeof o.positionId === "bigint" && typeof o.lockId === "bigint" && SyntheticLock.is(o.syntheticLock) && Coin.is(o.delegationAmount)); + }, + isSDK(o: any): o is ConcentratedPoolUserPositionRecordSDKType { + return o && (o.$typeUrl === ConcentratedPoolUserPositionRecord.typeUrl || typeof o.validator_address === "string" && typeof o.position_id === "bigint" && typeof o.lock_id === "bigint" && SyntheticLock.isSDK(o.synthetic_lock) && Coin.isSDK(o.delegation_amount)); + }, + isAmino(o: any): o is ConcentratedPoolUserPositionRecordAmino { + return o && (o.$typeUrl === ConcentratedPoolUserPositionRecord.typeUrl || typeof o.validator_address === "string" && typeof o.position_id === "bigint" && typeof o.lock_id === "bigint" && SyntheticLock.isAmino(o.synthetic_lock) && Coin.isAmino(o.delegation_amount)); + }, encode(message: ConcentratedPoolUserPositionRecord, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.validatorAddress !== "") { writer.uint32(10).string(message.validatorAddress); @@ -862,6 +1055,26 @@ export const ConcentratedPoolUserPositionRecord = { } return message; }, + fromJSON(object: any): ConcentratedPoolUserPositionRecord { + return { + validatorAddress: isSet(object.validatorAddress) ? String(object.validatorAddress) : "", + positionId: isSet(object.positionId) ? BigInt(object.positionId.toString()) : BigInt(0), + lockId: isSet(object.lockId) ? BigInt(object.lockId.toString()) : BigInt(0), + syntheticLock: isSet(object.syntheticLock) ? SyntheticLock.fromJSON(object.syntheticLock) : undefined, + delegationAmount: isSet(object.delegationAmount) ? Coin.fromJSON(object.delegationAmount) : undefined, + equivalentStakedAmount: isSet(object.equivalentStakedAmount) ? Coin.fromJSON(object.equivalentStakedAmount) : undefined + }; + }, + toJSON(message: ConcentratedPoolUserPositionRecord): unknown { + const obj: any = {}; + message.validatorAddress !== undefined && (obj.validatorAddress = message.validatorAddress); + message.positionId !== undefined && (obj.positionId = (message.positionId || BigInt(0)).toString()); + message.lockId !== undefined && (obj.lockId = (message.lockId || BigInt(0)).toString()); + message.syntheticLock !== undefined && (obj.syntheticLock = message.syntheticLock ? SyntheticLock.toJSON(message.syntheticLock) : undefined); + message.delegationAmount !== undefined && (obj.delegationAmount = message.delegationAmount ? Coin.toJSON(message.delegationAmount) : undefined); + message.equivalentStakedAmount !== undefined && (obj.equivalentStakedAmount = message.equivalentStakedAmount ? Coin.toJSON(message.equivalentStakedAmount) : undefined); + return obj; + }, fromPartial(object: Partial): ConcentratedPoolUserPositionRecord { const message = createBaseConcentratedPoolUserPositionRecord(); message.validatorAddress = object.validatorAddress ?? ""; @@ -873,14 +1086,26 @@ export const ConcentratedPoolUserPositionRecord = { return message; }, fromAmino(object: ConcentratedPoolUserPositionRecordAmino): ConcentratedPoolUserPositionRecord { - return { - validatorAddress: object.validator_address, - positionId: BigInt(object.position_id), - lockId: BigInt(object.lock_id), - syntheticLock: object?.synthetic_lock ? SyntheticLock.fromAmino(object.synthetic_lock) : undefined, - delegationAmount: object?.delegation_amount ? Coin.fromAmino(object.delegation_amount) : undefined, - equivalentStakedAmount: object?.equivalent_staked_amount ? Coin.fromAmino(object.equivalent_staked_amount) : undefined - }; + const message = createBaseConcentratedPoolUserPositionRecord(); + if (object.validator_address !== undefined && object.validator_address !== null) { + message.validatorAddress = object.validator_address; + } + if (object.position_id !== undefined && object.position_id !== null) { + message.positionId = BigInt(object.position_id); + } + if (object.lock_id !== undefined && object.lock_id !== null) { + message.lockId = BigInt(object.lock_id); + } + if (object.synthetic_lock !== undefined && object.synthetic_lock !== null) { + message.syntheticLock = SyntheticLock.fromAmino(object.synthetic_lock); + } + if (object.delegation_amount !== undefined && object.delegation_amount !== null) { + message.delegationAmount = Coin.fromAmino(object.delegation_amount); + } + if (object.equivalent_staked_amount !== undefined && object.equivalent_staked_amount !== null) { + message.equivalentStakedAmount = Coin.fromAmino(object.equivalent_staked_amount); + } + return message; }, toAmino(message: ConcentratedPoolUserPositionRecord): ConcentratedPoolUserPositionRecordAmino { const obj: any = {}; @@ -913,4 +1138,6 @@ export const ConcentratedPoolUserPositionRecord = { value: ConcentratedPoolUserPositionRecord.encode(message).finish() }; } -}; \ No newline at end of file +}; +GlobalDecoderRegistry.register(ConcentratedPoolUserPositionRecord.typeUrl, ConcentratedPoolUserPositionRecord); +GlobalDecoderRegistry.registerAminoProtoMapping(ConcentratedPoolUserPositionRecord.aminoType, ConcentratedPoolUserPositionRecord.typeUrl); \ No newline at end of file diff --git a/packages/osmojs/src/codegen/osmosis/superfluid/tx.amino.ts b/packages/osmojs/src/codegen/osmosis/superfluid/tx.amino.ts index 158de5f58..1304dac9e 100644 --- a/packages/osmojs/src/codegen/osmosis/superfluid/tx.amino.ts +++ b/packages/osmojs/src/codegen/osmosis/superfluid/tx.amino.ts @@ -1,5 +1,5 @@ //@ts-nocheck -import { MsgSuperfluidDelegate, MsgSuperfluidUndelegate, MsgSuperfluidUnbondLock, MsgSuperfluidUndelegateAndUnbondLock, MsgLockAndSuperfluidDelegate, MsgCreateFullRangePositionAndSuperfluidDelegate, MsgUnPoolWhitelistedPool, MsgUnlockAndMigrateSharesToFullRangeConcentratedPosition, MsgAddToConcentratedLiquiditySuperfluidPosition } from "./tx"; +import { MsgSuperfluidDelegate, MsgSuperfluidUndelegate, MsgSuperfluidUnbondLock, MsgSuperfluidUndelegateAndUnbondLock, MsgLockAndSuperfluidDelegate, MsgCreateFullRangePositionAndSuperfluidDelegate, MsgUnPoolWhitelistedPool, MsgUnlockAndMigrateSharesToFullRangeConcentratedPosition, MsgAddToConcentratedLiquiditySuperfluidPosition, MsgUnbondConvertAndStake } from "./tx"; export const AminoConverter = { "/osmosis.superfluid.MsgSuperfluidDelegate": { aminoType: "osmosis/superfluid-delegate", @@ -27,7 +27,7 @@ export const AminoConverter = { fromAmino: MsgLockAndSuperfluidDelegate.fromAmino }, "/osmosis.superfluid.MsgCreateFullRangePositionAndSuperfluidDelegate": { - aminoType: "osmosis/create-full-range-position-and-superfluid-delegate", + aminoType: "osmosis/full-range-and-sf-delegate", toAmino: MsgCreateFullRangePositionAndSuperfluidDelegate.toAmino, fromAmino: MsgCreateFullRangePositionAndSuperfluidDelegate.fromAmino }, @@ -37,13 +37,18 @@ export const AminoConverter = { fromAmino: MsgUnPoolWhitelistedPool.fromAmino }, "/osmosis.superfluid.MsgUnlockAndMigrateSharesToFullRangeConcentratedPosition": { - aminoType: "osmosis/unlock-and-migrate-shares-to-full-range-concentrated-position", + aminoType: "osmosis/unlock-and-migrate", toAmino: MsgUnlockAndMigrateSharesToFullRangeConcentratedPosition.toAmino, fromAmino: MsgUnlockAndMigrateSharesToFullRangeConcentratedPosition.fromAmino }, "/osmosis.superfluid.MsgAddToConcentratedLiquiditySuperfluidPosition": { - aminoType: "osmosis/add-to-concentrated-liquidity-superfluid-position", + aminoType: "osmosis/add-to-cl-superfluid-position", toAmino: MsgAddToConcentratedLiquiditySuperfluidPosition.toAmino, fromAmino: MsgAddToConcentratedLiquiditySuperfluidPosition.fromAmino + }, + "/osmosis.superfluid.MsgUnbondConvertAndStake": { + aminoType: "osmosis/unbond-convert-and-stake", + toAmino: MsgUnbondConvertAndStake.toAmino, + fromAmino: MsgUnbondConvertAndStake.fromAmino } }; \ No newline at end of file diff --git a/packages/osmojs/src/codegen/osmosis/superfluid/tx.registry.ts b/packages/osmojs/src/codegen/osmosis/superfluid/tx.registry.ts index fe3b6c01b..fa4004a52 100644 --- a/packages/osmojs/src/codegen/osmosis/superfluid/tx.registry.ts +++ b/packages/osmojs/src/codegen/osmosis/superfluid/tx.registry.ts @@ -1,7 +1,7 @@ //@ts-nocheck import { GeneratedType, Registry } from "@cosmjs/proto-signing"; -import { MsgSuperfluidDelegate, MsgSuperfluidUndelegate, MsgSuperfluidUnbondLock, MsgSuperfluidUndelegateAndUnbondLock, MsgLockAndSuperfluidDelegate, MsgCreateFullRangePositionAndSuperfluidDelegate, MsgUnPoolWhitelistedPool, MsgUnlockAndMigrateSharesToFullRangeConcentratedPosition, MsgAddToConcentratedLiquiditySuperfluidPosition } from "./tx"; -export const registry: ReadonlyArray<[string, GeneratedType]> = [["/osmosis.superfluid.MsgSuperfluidDelegate", MsgSuperfluidDelegate], ["/osmosis.superfluid.MsgSuperfluidUndelegate", MsgSuperfluidUndelegate], ["/osmosis.superfluid.MsgSuperfluidUnbondLock", MsgSuperfluidUnbondLock], ["/osmosis.superfluid.MsgSuperfluidUndelegateAndUnbondLock", MsgSuperfluidUndelegateAndUnbondLock], ["/osmosis.superfluid.MsgLockAndSuperfluidDelegate", MsgLockAndSuperfluidDelegate], ["/osmosis.superfluid.MsgCreateFullRangePositionAndSuperfluidDelegate", MsgCreateFullRangePositionAndSuperfluidDelegate], ["/osmosis.superfluid.MsgUnPoolWhitelistedPool", MsgUnPoolWhitelistedPool], ["/osmosis.superfluid.MsgUnlockAndMigrateSharesToFullRangeConcentratedPosition", MsgUnlockAndMigrateSharesToFullRangeConcentratedPosition], ["/osmosis.superfluid.MsgAddToConcentratedLiquiditySuperfluidPosition", MsgAddToConcentratedLiquiditySuperfluidPosition]]; +import { MsgSuperfluidDelegate, MsgSuperfluidUndelegate, MsgSuperfluidUnbondLock, MsgSuperfluidUndelegateAndUnbondLock, MsgLockAndSuperfluidDelegate, MsgCreateFullRangePositionAndSuperfluidDelegate, MsgUnPoolWhitelistedPool, MsgUnlockAndMigrateSharesToFullRangeConcentratedPosition, MsgAddToConcentratedLiquiditySuperfluidPosition, MsgUnbondConvertAndStake } from "./tx"; +export const registry: ReadonlyArray<[string, GeneratedType]> = [["/osmosis.superfluid.MsgSuperfluidDelegate", MsgSuperfluidDelegate], ["/osmosis.superfluid.MsgSuperfluidUndelegate", MsgSuperfluidUndelegate], ["/osmosis.superfluid.MsgSuperfluidUnbondLock", MsgSuperfluidUnbondLock], ["/osmosis.superfluid.MsgSuperfluidUndelegateAndUnbondLock", MsgSuperfluidUndelegateAndUnbondLock], ["/osmosis.superfluid.MsgLockAndSuperfluidDelegate", MsgLockAndSuperfluidDelegate], ["/osmosis.superfluid.MsgCreateFullRangePositionAndSuperfluidDelegate", MsgCreateFullRangePositionAndSuperfluidDelegate], ["/osmosis.superfluid.MsgUnPoolWhitelistedPool", MsgUnPoolWhitelistedPool], ["/osmosis.superfluid.MsgUnlockAndMigrateSharesToFullRangeConcentratedPosition", MsgUnlockAndMigrateSharesToFullRangeConcentratedPosition], ["/osmosis.superfluid.MsgAddToConcentratedLiquiditySuperfluidPosition", MsgAddToConcentratedLiquiditySuperfluidPosition], ["/osmosis.superfluid.MsgUnbondConvertAndStake", MsgUnbondConvertAndStake]]; export const load = (protoRegistry: Registry) => { registry.forEach(([typeUrl, mod]) => { protoRegistry.register(typeUrl, mod); @@ -62,6 +62,12 @@ export const MessageComposer = { typeUrl: "/osmosis.superfluid.MsgAddToConcentratedLiquiditySuperfluidPosition", value: MsgAddToConcentratedLiquiditySuperfluidPosition.encode(value).finish() }; + }, + unbondConvertAndStake(value: MsgUnbondConvertAndStake) { + return { + typeUrl: "/osmosis.superfluid.MsgUnbondConvertAndStake", + value: MsgUnbondConvertAndStake.encode(value).finish() + }; } }, withTypeUrl: { @@ -118,6 +124,136 @@ export const MessageComposer = { typeUrl: "/osmosis.superfluid.MsgAddToConcentratedLiquiditySuperfluidPosition", value }; + }, + unbondConvertAndStake(value: MsgUnbondConvertAndStake) { + return { + typeUrl: "/osmosis.superfluid.MsgUnbondConvertAndStake", + value + }; + } + }, + toJSON: { + superfluidDelegate(value: MsgSuperfluidDelegate) { + return { + typeUrl: "/osmosis.superfluid.MsgSuperfluidDelegate", + value: MsgSuperfluidDelegate.toJSON(value) + }; + }, + superfluidUndelegate(value: MsgSuperfluidUndelegate) { + return { + typeUrl: "/osmosis.superfluid.MsgSuperfluidUndelegate", + value: MsgSuperfluidUndelegate.toJSON(value) + }; + }, + superfluidUnbondLock(value: MsgSuperfluidUnbondLock) { + return { + typeUrl: "/osmosis.superfluid.MsgSuperfluidUnbondLock", + value: MsgSuperfluidUnbondLock.toJSON(value) + }; + }, + superfluidUndelegateAndUnbondLock(value: MsgSuperfluidUndelegateAndUnbondLock) { + return { + typeUrl: "/osmosis.superfluid.MsgSuperfluidUndelegateAndUnbondLock", + value: MsgSuperfluidUndelegateAndUnbondLock.toJSON(value) + }; + }, + lockAndSuperfluidDelegate(value: MsgLockAndSuperfluidDelegate) { + return { + typeUrl: "/osmosis.superfluid.MsgLockAndSuperfluidDelegate", + value: MsgLockAndSuperfluidDelegate.toJSON(value) + }; + }, + createFullRangePositionAndSuperfluidDelegate(value: MsgCreateFullRangePositionAndSuperfluidDelegate) { + return { + typeUrl: "/osmosis.superfluid.MsgCreateFullRangePositionAndSuperfluidDelegate", + value: MsgCreateFullRangePositionAndSuperfluidDelegate.toJSON(value) + }; + }, + unPoolWhitelistedPool(value: MsgUnPoolWhitelistedPool) { + return { + typeUrl: "/osmosis.superfluid.MsgUnPoolWhitelistedPool", + value: MsgUnPoolWhitelistedPool.toJSON(value) + }; + }, + unlockAndMigrateSharesToFullRangeConcentratedPosition(value: MsgUnlockAndMigrateSharesToFullRangeConcentratedPosition) { + return { + typeUrl: "/osmosis.superfluid.MsgUnlockAndMigrateSharesToFullRangeConcentratedPosition", + value: MsgUnlockAndMigrateSharesToFullRangeConcentratedPosition.toJSON(value) + }; + }, + addToConcentratedLiquiditySuperfluidPosition(value: MsgAddToConcentratedLiquiditySuperfluidPosition) { + return { + typeUrl: "/osmosis.superfluid.MsgAddToConcentratedLiquiditySuperfluidPosition", + value: MsgAddToConcentratedLiquiditySuperfluidPosition.toJSON(value) + }; + }, + unbondConvertAndStake(value: MsgUnbondConvertAndStake) { + return { + typeUrl: "/osmosis.superfluid.MsgUnbondConvertAndStake", + value: MsgUnbondConvertAndStake.toJSON(value) + }; + } + }, + fromJSON: { + superfluidDelegate(value: any) { + return { + typeUrl: "/osmosis.superfluid.MsgSuperfluidDelegate", + value: MsgSuperfluidDelegate.fromJSON(value) + }; + }, + superfluidUndelegate(value: any) { + return { + typeUrl: "/osmosis.superfluid.MsgSuperfluidUndelegate", + value: MsgSuperfluidUndelegate.fromJSON(value) + }; + }, + superfluidUnbondLock(value: any) { + return { + typeUrl: "/osmosis.superfluid.MsgSuperfluidUnbondLock", + value: MsgSuperfluidUnbondLock.fromJSON(value) + }; + }, + superfluidUndelegateAndUnbondLock(value: any) { + return { + typeUrl: "/osmosis.superfluid.MsgSuperfluidUndelegateAndUnbondLock", + value: MsgSuperfluidUndelegateAndUnbondLock.fromJSON(value) + }; + }, + lockAndSuperfluidDelegate(value: any) { + return { + typeUrl: "/osmosis.superfluid.MsgLockAndSuperfluidDelegate", + value: MsgLockAndSuperfluidDelegate.fromJSON(value) + }; + }, + createFullRangePositionAndSuperfluidDelegate(value: any) { + return { + typeUrl: "/osmosis.superfluid.MsgCreateFullRangePositionAndSuperfluidDelegate", + value: MsgCreateFullRangePositionAndSuperfluidDelegate.fromJSON(value) + }; + }, + unPoolWhitelistedPool(value: any) { + return { + typeUrl: "/osmosis.superfluid.MsgUnPoolWhitelistedPool", + value: MsgUnPoolWhitelistedPool.fromJSON(value) + }; + }, + unlockAndMigrateSharesToFullRangeConcentratedPosition(value: any) { + return { + typeUrl: "/osmosis.superfluid.MsgUnlockAndMigrateSharesToFullRangeConcentratedPosition", + value: MsgUnlockAndMigrateSharesToFullRangeConcentratedPosition.fromJSON(value) + }; + }, + addToConcentratedLiquiditySuperfluidPosition(value: any) { + return { + typeUrl: "/osmosis.superfluid.MsgAddToConcentratedLiquiditySuperfluidPosition", + value: MsgAddToConcentratedLiquiditySuperfluidPosition.fromJSON(value) + }; + }, + unbondConvertAndStake(value: any) { + return { + typeUrl: "/osmosis.superfluid.MsgUnbondConvertAndStake", + value: MsgUnbondConvertAndStake.fromJSON(value) + }; } }, fromPartial: { @@ -174,6 +310,12 @@ export const MessageComposer = { typeUrl: "/osmosis.superfluid.MsgAddToConcentratedLiquiditySuperfluidPosition", value: MsgAddToConcentratedLiquiditySuperfluidPosition.fromPartial(value) }; + }, + unbondConvertAndStake(value: MsgUnbondConvertAndStake) { + return { + typeUrl: "/osmosis.superfluid.MsgUnbondConvertAndStake", + value: MsgUnbondConvertAndStake.fromPartial(value) + }; } } }; \ No newline at end of file diff --git a/packages/osmojs/src/codegen/osmosis/superfluid/tx.rpc.msg.ts b/packages/osmojs/src/codegen/osmosis/superfluid/tx.rpc.msg.ts index e4f591bc2..520105c7d 100644 --- a/packages/osmojs/src/codegen/osmosis/superfluid/tx.rpc.msg.ts +++ b/packages/osmojs/src/codegen/osmosis/superfluid/tx.rpc.msg.ts @@ -1,6 +1,6 @@ import { Rpc } from "../../helpers"; import { BinaryReader } from "../../binary"; -import { MsgSuperfluidDelegate, MsgSuperfluidDelegateResponse, MsgSuperfluidUndelegate, MsgSuperfluidUndelegateResponse, MsgSuperfluidUnbondLock, MsgSuperfluidUnbondLockResponse, MsgSuperfluidUndelegateAndUnbondLock, MsgSuperfluidUndelegateAndUnbondLockResponse, MsgLockAndSuperfluidDelegate, MsgLockAndSuperfluidDelegateResponse, MsgCreateFullRangePositionAndSuperfluidDelegate, MsgCreateFullRangePositionAndSuperfluidDelegateResponse, MsgUnPoolWhitelistedPool, MsgUnPoolWhitelistedPoolResponse, MsgUnlockAndMigrateSharesToFullRangeConcentratedPosition, MsgUnlockAndMigrateSharesToFullRangeConcentratedPositionResponse, MsgAddToConcentratedLiquiditySuperfluidPosition, MsgAddToConcentratedLiquiditySuperfluidPositionResponse } from "./tx"; +import { MsgSuperfluidDelegate, MsgSuperfluidDelegateResponse, MsgSuperfluidUndelegate, MsgSuperfluidUndelegateResponse, MsgSuperfluidUnbondLock, MsgSuperfluidUnbondLockResponse, MsgSuperfluidUndelegateAndUnbondLock, MsgSuperfluidUndelegateAndUnbondLockResponse, MsgLockAndSuperfluidDelegate, MsgLockAndSuperfluidDelegateResponse, MsgCreateFullRangePositionAndSuperfluidDelegate, MsgCreateFullRangePositionAndSuperfluidDelegateResponse, MsgUnPoolWhitelistedPool, MsgUnPoolWhitelistedPoolResponse, MsgUnlockAndMigrateSharesToFullRangeConcentratedPosition, MsgUnlockAndMigrateSharesToFullRangeConcentratedPositionResponse, MsgAddToConcentratedLiquiditySuperfluidPosition, MsgAddToConcentratedLiquiditySuperfluidPositionResponse, MsgUnbondConvertAndStake, MsgUnbondConvertAndStakeResponse } from "./tx"; /** Msg defines the Msg service. */ export interface Msg { /** Execute superfluid delegation for a lockup */ @@ -20,6 +20,11 @@ export interface Msg { unPoolWhitelistedPool(request: MsgUnPoolWhitelistedPool): Promise; unlockAndMigrateSharesToFullRangeConcentratedPosition(request: MsgUnlockAndMigrateSharesToFullRangeConcentratedPosition): Promise; addToConcentratedLiquiditySuperfluidPosition(request: MsgAddToConcentratedLiquiditySuperfluidPosition): Promise; + /** + * UnbondConvertAndStake breaks all locks / superfluid staked assets, + * converts them to osmo then stakes the osmo to the designated validator. + */ + unbondConvertAndStake(request: MsgUnbondConvertAndStake): Promise; } export class MsgClientImpl implements Msg { private readonly rpc: Rpc; @@ -34,6 +39,7 @@ export class MsgClientImpl implements Msg { this.unPoolWhitelistedPool = this.unPoolWhitelistedPool.bind(this); this.unlockAndMigrateSharesToFullRangeConcentratedPosition = this.unlockAndMigrateSharesToFullRangeConcentratedPosition.bind(this); this.addToConcentratedLiquiditySuperfluidPosition = this.addToConcentratedLiquiditySuperfluidPosition.bind(this); + this.unbondConvertAndStake = this.unbondConvertAndStake.bind(this); } superfluidDelegate(request: MsgSuperfluidDelegate): Promise { const data = MsgSuperfluidDelegate.encode(request).finish(); @@ -80,4 +86,12 @@ export class MsgClientImpl implements Msg { const promise = this.rpc.request("osmosis.superfluid.Msg", "AddToConcentratedLiquiditySuperfluidPosition", data); return promise.then(data => MsgAddToConcentratedLiquiditySuperfluidPositionResponse.decode(new BinaryReader(data))); } -} \ No newline at end of file + unbondConvertAndStake(request: MsgUnbondConvertAndStake): Promise { + const data = MsgUnbondConvertAndStake.encode(request).finish(); + const promise = this.rpc.request("osmosis.superfluid.Msg", "UnbondConvertAndStake", data); + return promise.then(data => MsgUnbondConvertAndStakeResponse.decode(new BinaryReader(data))); + } +} +export const createClientImpl = (rpc: Rpc) => { + return new MsgClientImpl(rpc); +}; \ No newline at end of file diff --git a/packages/osmojs/src/codegen/osmosis/superfluid/tx.ts b/packages/osmojs/src/codegen/osmosis/superfluid/tx.ts index e1d6ba236..01a3f8d6a 100644 --- a/packages/osmojs/src/codegen/osmosis/superfluid/tx.ts +++ b/packages/osmojs/src/codegen/osmosis/superfluid/tx.ts @@ -1,8 +1,9 @@ import { Coin, CoinAmino, CoinSDKType } from "../../cosmos/base/v1beta1/coin"; import { Timestamp } from "../../google/protobuf/timestamp"; import { BinaryReader, BinaryWriter } from "../../binary"; +import { isSet, toTimestamp, fromTimestamp } from "../../helpers"; +import { GlobalDecoderRegistry } from "../../registry"; import { Decimal } from "@cosmjs/math"; -import { toTimestamp, fromTimestamp } from "../../helpers"; export interface MsgSuperfluidDelegate { sender: string; lockId: bigint; @@ -13,9 +14,9 @@ export interface MsgSuperfluidDelegateProtoMsg { value: Uint8Array; } export interface MsgSuperfluidDelegateAmino { - sender: string; - lock_id: string; - val_addr: string; + sender?: string; + lock_id?: string; + val_addr?: string; } export interface MsgSuperfluidDelegateAminoMsg { type: "osmosis/superfluid-delegate"; @@ -46,8 +47,8 @@ export interface MsgSuperfluidUndelegateProtoMsg { value: Uint8Array; } export interface MsgSuperfluidUndelegateAmino { - sender: string; - lock_id: string; + sender?: string; + lock_id?: string; } export interface MsgSuperfluidUndelegateAminoMsg { type: "osmosis/superfluid-undelegate"; @@ -77,8 +78,8 @@ export interface MsgSuperfluidUnbondLockProtoMsg { value: Uint8Array; } export interface MsgSuperfluidUnbondLockAmino { - sender: string; - lock_id: string; + sender?: string; + lock_id?: string; } export interface MsgSuperfluidUnbondLockAminoMsg { type: "osmosis/superfluid-unbond-lock"; @@ -110,8 +111,8 @@ export interface MsgSuperfluidUndelegateAndUnbondLockProtoMsg { value: Uint8Array; } export interface MsgSuperfluidUndelegateAndUnbondLockAmino { - sender: string; - lock_id: string; + sender?: string; + lock_id?: string; /** Amount of unlocking coin. */ coin?: CoinAmino; } @@ -142,7 +143,7 @@ export interface MsgSuperfluidUndelegateAndUnbondLockResponseAmino { * returns the original lockid if the unlocked amount is equal to the * original lock's amount. */ - lock_id: string; + lock_id?: string; } export interface MsgSuperfluidUndelegateAndUnbondLockResponseAminoMsg { type: "osmosis/superfluid-undelegate-and-unbond-lock-response"; @@ -171,9 +172,9 @@ export interface MsgLockAndSuperfluidDelegateProtoMsg { * specified validator addr. */ export interface MsgLockAndSuperfluidDelegateAmino { - sender: string; - coins: CoinAmino[]; - val_addr: string; + sender?: string; + coins?: CoinAmino[]; + val_addr?: string; } export interface MsgLockAndSuperfluidDelegateAminoMsg { type: "osmosis/lock-and-superfluid-delegate"; @@ -197,7 +198,7 @@ export interface MsgLockAndSuperfluidDelegateResponseProtoMsg { value: Uint8Array; } export interface MsgLockAndSuperfluidDelegateResponseAmino { - ID: string; + ID?: string; } export interface MsgLockAndSuperfluidDelegateResponseAminoMsg { type: "osmosis/lock-and-superfluid-delegate-response"; @@ -225,13 +226,13 @@ export interface MsgCreateFullRangePositionAndSuperfluidDelegateProtoMsg { * in a concentrated liquidity pool, then superfluid delegates. */ export interface MsgCreateFullRangePositionAndSuperfluidDelegateAmino { - sender: string; - coins: CoinAmino[]; - val_addr: string; - pool_id: string; + sender?: string; + coins?: CoinAmino[]; + val_addr?: string; + pool_id?: string; } export interface MsgCreateFullRangePositionAndSuperfluidDelegateAminoMsg { - type: "osmosis/create-full-range-position-and-superfluid-delegate"; + type: "osmosis/full-range-and-sf-delegate"; value: MsgCreateFullRangePositionAndSuperfluidDelegateAmino; } /** @@ -253,8 +254,8 @@ export interface MsgCreateFullRangePositionAndSuperfluidDelegateResponseProtoMsg value: Uint8Array; } export interface MsgCreateFullRangePositionAndSuperfluidDelegateResponseAmino { - lockID: string; - positionID: string; + lockID?: string; + positionID?: string; } export interface MsgCreateFullRangePositionAndSuperfluidDelegateResponseAminoMsg { type: "osmosis/create-full-range-position-and-superfluid-delegate-response"; @@ -293,8 +294,8 @@ export interface MsgUnPoolWhitelistedPoolProtoMsg { * until unbond completion. */ export interface MsgUnPoolWhitelistedPoolAmino { - sender: string; - pool_id: string; + sender?: string; + pool_id?: string; } export interface MsgUnPoolWhitelistedPoolAminoMsg { type: "osmosis/unpool-whitelisted-pool"; @@ -322,7 +323,7 @@ export interface MsgUnPoolWhitelistedPoolResponseProtoMsg { value: Uint8Array; } export interface MsgUnPoolWhitelistedPoolResponseAmino { - exited_lock_ids: string[]; + exited_lock_ids?: string[]; } export interface MsgUnPoolWhitelistedPoolResponseAminoMsg { type: "osmosis/un-pool-whitelisted-pool-response"; @@ -351,14 +352,14 @@ export interface MsgUnlockAndMigrateSharesToFullRangeConcentratedPositionProtoMs * MsgUnlockAndMigrateSharesToFullRangeConcentratedPosition */ export interface MsgUnlockAndMigrateSharesToFullRangeConcentratedPositionAmino { - sender: string; - lock_id: string; + sender?: string; + lock_id?: string; shares_to_migrate?: CoinAmino; /** token_out_mins indicates minimum token to exit Balancer pool with. */ - token_out_mins: CoinAmino[]; + token_out_mins?: CoinAmino[]; } export interface MsgUnlockAndMigrateSharesToFullRangeConcentratedPositionAminoMsg { - type: "osmosis/unlock-and-migrate-shares-to-full-range-concentrated-position"; + type: "osmosis/unlock-and-migrate"; value: MsgUnlockAndMigrateSharesToFullRangeConcentratedPositionAmino; } /** @@ -382,10 +383,10 @@ export interface MsgUnlockAndMigrateSharesToFullRangeConcentratedPositionRespons value: Uint8Array; } export interface MsgUnlockAndMigrateSharesToFullRangeConcentratedPositionResponseAmino { - amount0: string; - amount1: string; - liquidity_created: string; - join_time?: Date; + amount0?: string; + amount1?: string; + liquidity_created?: string; + join_time?: string; } export interface MsgUnlockAndMigrateSharesToFullRangeConcentratedPositionResponseAminoMsg { type: "osmosis/unlock-and-migrate-shares-to-full-range-concentrated-position-response"; @@ -410,13 +411,13 @@ export interface MsgAddToConcentratedLiquiditySuperfluidPositionProtoMsg { } /** ===================== MsgAddToConcentratedLiquiditySuperfluidPosition */ export interface MsgAddToConcentratedLiquiditySuperfluidPositionAmino { - position_id: string; - sender: string; + position_id?: string; + sender?: string; token_desired0?: CoinAmino; token_desired1?: CoinAmino; } export interface MsgAddToConcentratedLiquiditySuperfluidPositionAminoMsg { - type: "osmosis/add-to-concentrated-liquidity-superfluid-position"; + type: "osmosis/add-to-cl-superfluid-position"; value: MsgAddToConcentratedLiquiditySuperfluidPositionAmino; } /** ===================== MsgAddToConcentratedLiquiditySuperfluidPosition */ @@ -443,16 +444,16 @@ export interface MsgAddToConcentratedLiquiditySuperfluidPositionResponseProtoMsg value: Uint8Array; } export interface MsgAddToConcentratedLiquiditySuperfluidPositionResponseAmino { - position_id: string; - amount0: string; - amount1: string; + position_id?: string; + amount0?: string; + amount1?: string; /** * new_liquidity is the final liquidity after the add. * It includes the liquidity that existed before in the position * and the new liquidity that was added to the position. */ - new_liquidity: string; - lock_id: string; + new_liquidity?: string; + lock_id?: string; } export interface MsgAddToConcentratedLiquiditySuperfluidPositionResponseAminoMsg { type: "osmosis/add-to-concentrated-liquidity-superfluid-position-response"; @@ -465,6 +466,85 @@ export interface MsgAddToConcentratedLiquiditySuperfluidPositionResponseSDKType new_liquidity: string; lock_id: bigint; } +/** ===================== MsgUnbondConvertAndStake */ +export interface MsgUnbondConvertAndStake { + /** + * lock ID to convert and stake. + * lock id with 0 should be provided if converting liquid gamm shares to stake + */ + lockId: bigint; + sender: string; + /** + * validator address to delegate to. + * If provided empty string, we use the validators returned from + * valset-preference module. + */ + valAddr: string; + /** min_amt_to_stake indicates the minimum amount to stake after conversion */ + minAmtToStake: string; + /** + * shares_to_convert indicates shares wanted to stake. + * Note that this field is only used for liquid(unlocked) gamm shares. + * For all other cases, this field would be disregarded. + */ + sharesToConvert: Coin; +} +export interface MsgUnbondConvertAndStakeProtoMsg { + typeUrl: "/osmosis.superfluid.MsgUnbondConvertAndStake"; + value: Uint8Array; +} +/** ===================== MsgUnbondConvertAndStake */ +export interface MsgUnbondConvertAndStakeAmino { + /** + * lock ID to convert and stake. + * lock id with 0 should be provided if converting liquid gamm shares to stake + */ + lock_id?: string; + sender?: string; + /** + * validator address to delegate to. + * If provided empty string, we use the validators returned from + * valset-preference module. + */ + val_addr?: string; + /** min_amt_to_stake indicates the minimum amount to stake after conversion */ + min_amt_to_stake?: string; + /** + * shares_to_convert indicates shares wanted to stake. + * Note that this field is only used for liquid(unlocked) gamm shares. + * For all other cases, this field would be disregarded. + */ + shares_to_convert?: CoinAmino; +} +export interface MsgUnbondConvertAndStakeAminoMsg { + type: "osmosis/unbond-convert-and-stake"; + value: MsgUnbondConvertAndStakeAmino; +} +/** ===================== MsgUnbondConvertAndStake */ +export interface MsgUnbondConvertAndStakeSDKType { + lock_id: bigint; + sender: string; + val_addr: string; + min_amt_to_stake: string; + shares_to_convert: CoinSDKType; +} +export interface MsgUnbondConvertAndStakeResponse { + totalAmtStaked: string; +} +export interface MsgUnbondConvertAndStakeResponseProtoMsg { + typeUrl: "/osmosis.superfluid.MsgUnbondConvertAndStakeResponse"; + value: Uint8Array; +} +export interface MsgUnbondConvertAndStakeResponseAmino { + total_amt_staked?: string; +} +export interface MsgUnbondConvertAndStakeResponseAminoMsg { + type: "osmosis/unbond-convert-and-stake-response"; + value: MsgUnbondConvertAndStakeResponseAmino; +} +export interface MsgUnbondConvertAndStakeResponseSDKType { + total_amt_staked: string; +} function createBaseMsgSuperfluidDelegate(): MsgSuperfluidDelegate { return { sender: "", @@ -474,6 +554,16 @@ function createBaseMsgSuperfluidDelegate(): MsgSuperfluidDelegate { } export const MsgSuperfluidDelegate = { typeUrl: "/osmosis.superfluid.MsgSuperfluidDelegate", + aminoType: "osmosis/superfluid-delegate", + is(o: any): o is MsgSuperfluidDelegate { + return o && (o.$typeUrl === MsgSuperfluidDelegate.typeUrl || typeof o.sender === "string" && typeof o.lockId === "bigint" && typeof o.valAddr === "string"); + }, + isSDK(o: any): o is MsgSuperfluidDelegateSDKType { + return o && (o.$typeUrl === MsgSuperfluidDelegate.typeUrl || typeof o.sender === "string" && typeof o.lock_id === "bigint" && typeof o.val_addr === "string"); + }, + isAmino(o: any): o is MsgSuperfluidDelegateAmino { + return o && (o.$typeUrl === MsgSuperfluidDelegate.typeUrl || typeof o.sender === "string" && typeof o.lock_id === "bigint" && typeof o.val_addr === "string"); + }, encode(message: MsgSuperfluidDelegate, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.sender !== "") { writer.uint32(10).string(message.sender); @@ -509,6 +599,20 @@ export const MsgSuperfluidDelegate = { } return message; }, + fromJSON(object: any): MsgSuperfluidDelegate { + return { + sender: isSet(object.sender) ? String(object.sender) : "", + lockId: isSet(object.lockId) ? BigInt(object.lockId.toString()) : BigInt(0), + valAddr: isSet(object.valAddr) ? String(object.valAddr) : "" + }; + }, + toJSON(message: MsgSuperfluidDelegate): unknown { + const obj: any = {}; + message.sender !== undefined && (obj.sender = message.sender); + message.lockId !== undefined && (obj.lockId = (message.lockId || BigInt(0)).toString()); + message.valAddr !== undefined && (obj.valAddr = message.valAddr); + return obj; + }, fromPartial(object: Partial): MsgSuperfluidDelegate { const message = createBaseMsgSuperfluidDelegate(); message.sender = object.sender ?? ""; @@ -517,11 +621,17 @@ export const MsgSuperfluidDelegate = { return message; }, fromAmino(object: MsgSuperfluidDelegateAmino): MsgSuperfluidDelegate { - return { - sender: object.sender, - lockId: BigInt(object.lock_id), - valAddr: object.val_addr - }; + const message = createBaseMsgSuperfluidDelegate(); + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + if (object.lock_id !== undefined && object.lock_id !== null) { + message.lockId = BigInt(object.lock_id); + } + if (object.val_addr !== undefined && object.val_addr !== null) { + message.valAddr = object.val_addr; + } + return message; }, toAmino(message: MsgSuperfluidDelegate): MsgSuperfluidDelegateAmino { const obj: any = {}; @@ -552,11 +662,23 @@ export const MsgSuperfluidDelegate = { }; } }; +GlobalDecoderRegistry.register(MsgSuperfluidDelegate.typeUrl, MsgSuperfluidDelegate); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgSuperfluidDelegate.aminoType, MsgSuperfluidDelegate.typeUrl); function createBaseMsgSuperfluidDelegateResponse(): MsgSuperfluidDelegateResponse { return {}; } export const MsgSuperfluidDelegateResponse = { typeUrl: "/osmosis.superfluid.MsgSuperfluidDelegateResponse", + aminoType: "osmosis/superfluid-delegate-response", + is(o: any): o is MsgSuperfluidDelegateResponse { + return o && o.$typeUrl === MsgSuperfluidDelegateResponse.typeUrl; + }, + isSDK(o: any): o is MsgSuperfluidDelegateResponseSDKType { + return o && o.$typeUrl === MsgSuperfluidDelegateResponse.typeUrl; + }, + isAmino(o: any): o is MsgSuperfluidDelegateResponseAmino { + return o && o.$typeUrl === MsgSuperfluidDelegateResponse.typeUrl; + }, encode(_: MsgSuperfluidDelegateResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, @@ -574,12 +696,20 @@ export const MsgSuperfluidDelegateResponse = { } return message; }, + fromJSON(_: any): MsgSuperfluidDelegateResponse { + return {}; + }, + toJSON(_: MsgSuperfluidDelegateResponse): unknown { + const obj: any = {}; + return obj; + }, fromPartial(_: Partial): MsgSuperfluidDelegateResponse { const message = createBaseMsgSuperfluidDelegateResponse(); return message; }, fromAmino(_: MsgSuperfluidDelegateResponseAmino): MsgSuperfluidDelegateResponse { - return {}; + const message = createBaseMsgSuperfluidDelegateResponse(); + return message; }, toAmino(_: MsgSuperfluidDelegateResponse): MsgSuperfluidDelegateResponseAmino { const obj: any = {}; @@ -607,6 +737,8 @@ export const MsgSuperfluidDelegateResponse = { }; } }; +GlobalDecoderRegistry.register(MsgSuperfluidDelegateResponse.typeUrl, MsgSuperfluidDelegateResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgSuperfluidDelegateResponse.aminoType, MsgSuperfluidDelegateResponse.typeUrl); function createBaseMsgSuperfluidUndelegate(): MsgSuperfluidUndelegate { return { sender: "", @@ -615,6 +747,16 @@ function createBaseMsgSuperfluidUndelegate(): MsgSuperfluidUndelegate { } export const MsgSuperfluidUndelegate = { typeUrl: "/osmosis.superfluid.MsgSuperfluidUndelegate", + aminoType: "osmosis/superfluid-undelegate", + is(o: any): o is MsgSuperfluidUndelegate { + return o && (o.$typeUrl === MsgSuperfluidUndelegate.typeUrl || typeof o.sender === "string" && typeof o.lockId === "bigint"); + }, + isSDK(o: any): o is MsgSuperfluidUndelegateSDKType { + return o && (o.$typeUrl === MsgSuperfluidUndelegate.typeUrl || typeof o.sender === "string" && typeof o.lock_id === "bigint"); + }, + isAmino(o: any): o is MsgSuperfluidUndelegateAmino { + return o && (o.$typeUrl === MsgSuperfluidUndelegate.typeUrl || typeof o.sender === "string" && typeof o.lock_id === "bigint"); + }, encode(message: MsgSuperfluidUndelegate, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.sender !== "") { writer.uint32(10).string(message.sender); @@ -644,6 +786,18 @@ export const MsgSuperfluidUndelegate = { } return message; }, + fromJSON(object: any): MsgSuperfluidUndelegate { + return { + sender: isSet(object.sender) ? String(object.sender) : "", + lockId: isSet(object.lockId) ? BigInt(object.lockId.toString()) : BigInt(0) + }; + }, + toJSON(message: MsgSuperfluidUndelegate): unknown { + const obj: any = {}; + message.sender !== undefined && (obj.sender = message.sender); + message.lockId !== undefined && (obj.lockId = (message.lockId || BigInt(0)).toString()); + return obj; + }, fromPartial(object: Partial): MsgSuperfluidUndelegate { const message = createBaseMsgSuperfluidUndelegate(); message.sender = object.sender ?? ""; @@ -651,10 +805,14 @@ export const MsgSuperfluidUndelegate = { return message; }, fromAmino(object: MsgSuperfluidUndelegateAmino): MsgSuperfluidUndelegate { - return { - sender: object.sender, - lockId: BigInt(object.lock_id) - }; + const message = createBaseMsgSuperfluidUndelegate(); + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + if (object.lock_id !== undefined && object.lock_id !== null) { + message.lockId = BigInt(object.lock_id); + } + return message; }, toAmino(message: MsgSuperfluidUndelegate): MsgSuperfluidUndelegateAmino { const obj: any = {}; @@ -684,11 +842,23 @@ export const MsgSuperfluidUndelegate = { }; } }; +GlobalDecoderRegistry.register(MsgSuperfluidUndelegate.typeUrl, MsgSuperfluidUndelegate); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgSuperfluidUndelegate.aminoType, MsgSuperfluidUndelegate.typeUrl); function createBaseMsgSuperfluidUndelegateResponse(): MsgSuperfluidUndelegateResponse { return {}; } export const MsgSuperfluidUndelegateResponse = { typeUrl: "/osmosis.superfluid.MsgSuperfluidUndelegateResponse", + aminoType: "osmosis/superfluid-undelegate-response", + is(o: any): o is MsgSuperfluidUndelegateResponse { + return o && o.$typeUrl === MsgSuperfluidUndelegateResponse.typeUrl; + }, + isSDK(o: any): o is MsgSuperfluidUndelegateResponseSDKType { + return o && o.$typeUrl === MsgSuperfluidUndelegateResponse.typeUrl; + }, + isAmino(o: any): o is MsgSuperfluidUndelegateResponseAmino { + return o && o.$typeUrl === MsgSuperfluidUndelegateResponse.typeUrl; + }, encode(_: MsgSuperfluidUndelegateResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, @@ -706,12 +876,20 @@ export const MsgSuperfluidUndelegateResponse = { } return message; }, + fromJSON(_: any): MsgSuperfluidUndelegateResponse { + return {}; + }, + toJSON(_: MsgSuperfluidUndelegateResponse): unknown { + const obj: any = {}; + return obj; + }, fromPartial(_: Partial): MsgSuperfluidUndelegateResponse { const message = createBaseMsgSuperfluidUndelegateResponse(); return message; }, fromAmino(_: MsgSuperfluidUndelegateResponseAmino): MsgSuperfluidUndelegateResponse { - return {}; + const message = createBaseMsgSuperfluidUndelegateResponse(); + return message; }, toAmino(_: MsgSuperfluidUndelegateResponse): MsgSuperfluidUndelegateResponseAmino { const obj: any = {}; @@ -739,6 +917,8 @@ export const MsgSuperfluidUndelegateResponse = { }; } }; +GlobalDecoderRegistry.register(MsgSuperfluidUndelegateResponse.typeUrl, MsgSuperfluidUndelegateResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgSuperfluidUndelegateResponse.aminoType, MsgSuperfluidUndelegateResponse.typeUrl); function createBaseMsgSuperfluidUnbondLock(): MsgSuperfluidUnbondLock { return { sender: "", @@ -747,6 +927,16 @@ function createBaseMsgSuperfluidUnbondLock(): MsgSuperfluidUnbondLock { } export const MsgSuperfluidUnbondLock = { typeUrl: "/osmosis.superfluid.MsgSuperfluidUnbondLock", + aminoType: "osmosis/superfluid-unbond-lock", + is(o: any): o is MsgSuperfluidUnbondLock { + return o && (o.$typeUrl === MsgSuperfluidUnbondLock.typeUrl || typeof o.sender === "string" && typeof o.lockId === "bigint"); + }, + isSDK(o: any): o is MsgSuperfluidUnbondLockSDKType { + return o && (o.$typeUrl === MsgSuperfluidUnbondLock.typeUrl || typeof o.sender === "string" && typeof o.lock_id === "bigint"); + }, + isAmino(o: any): o is MsgSuperfluidUnbondLockAmino { + return o && (o.$typeUrl === MsgSuperfluidUnbondLock.typeUrl || typeof o.sender === "string" && typeof o.lock_id === "bigint"); + }, encode(message: MsgSuperfluidUnbondLock, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.sender !== "") { writer.uint32(10).string(message.sender); @@ -776,6 +966,18 @@ export const MsgSuperfluidUnbondLock = { } return message; }, + fromJSON(object: any): MsgSuperfluidUnbondLock { + return { + sender: isSet(object.sender) ? String(object.sender) : "", + lockId: isSet(object.lockId) ? BigInt(object.lockId.toString()) : BigInt(0) + }; + }, + toJSON(message: MsgSuperfluidUnbondLock): unknown { + const obj: any = {}; + message.sender !== undefined && (obj.sender = message.sender); + message.lockId !== undefined && (obj.lockId = (message.lockId || BigInt(0)).toString()); + return obj; + }, fromPartial(object: Partial): MsgSuperfluidUnbondLock { const message = createBaseMsgSuperfluidUnbondLock(); message.sender = object.sender ?? ""; @@ -783,10 +985,14 @@ export const MsgSuperfluidUnbondLock = { return message; }, fromAmino(object: MsgSuperfluidUnbondLockAmino): MsgSuperfluidUnbondLock { - return { - sender: object.sender, - lockId: BigInt(object.lock_id) - }; + const message = createBaseMsgSuperfluidUnbondLock(); + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + if (object.lock_id !== undefined && object.lock_id !== null) { + message.lockId = BigInt(object.lock_id); + } + return message; }, toAmino(message: MsgSuperfluidUnbondLock): MsgSuperfluidUnbondLockAmino { const obj: any = {}; @@ -816,11 +1022,23 @@ export const MsgSuperfluidUnbondLock = { }; } }; +GlobalDecoderRegistry.register(MsgSuperfluidUnbondLock.typeUrl, MsgSuperfluidUnbondLock); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgSuperfluidUnbondLock.aminoType, MsgSuperfluidUnbondLock.typeUrl); function createBaseMsgSuperfluidUnbondLockResponse(): MsgSuperfluidUnbondLockResponse { return {}; } export const MsgSuperfluidUnbondLockResponse = { typeUrl: "/osmosis.superfluid.MsgSuperfluidUnbondLockResponse", + aminoType: "osmosis/superfluid-unbond-lock-response", + is(o: any): o is MsgSuperfluidUnbondLockResponse { + return o && o.$typeUrl === MsgSuperfluidUnbondLockResponse.typeUrl; + }, + isSDK(o: any): o is MsgSuperfluidUnbondLockResponseSDKType { + return o && o.$typeUrl === MsgSuperfluidUnbondLockResponse.typeUrl; + }, + isAmino(o: any): o is MsgSuperfluidUnbondLockResponseAmino { + return o && o.$typeUrl === MsgSuperfluidUnbondLockResponse.typeUrl; + }, encode(_: MsgSuperfluidUnbondLockResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, @@ -838,12 +1056,20 @@ export const MsgSuperfluidUnbondLockResponse = { } return message; }, + fromJSON(_: any): MsgSuperfluidUnbondLockResponse { + return {}; + }, + toJSON(_: MsgSuperfluidUnbondLockResponse): unknown { + const obj: any = {}; + return obj; + }, fromPartial(_: Partial): MsgSuperfluidUnbondLockResponse { const message = createBaseMsgSuperfluidUnbondLockResponse(); return message; }, fromAmino(_: MsgSuperfluidUnbondLockResponseAmino): MsgSuperfluidUnbondLockResponse { - return {}; + const message = createBaseMsgSuperfluidUnbondLockResponse(); + return message; }, toAmino(_: MsgSuperfluidUnbondLockResponse): MsgSuperfluidUnbondLockResponseAmino { const obj: any = {}; @@ -871,15 +1097,27 @@ export const MsgSuperfluidUnbondLockResponse = { }; } }; +GlobalDecoderRegistry.register(MsgSuperfluidUnbondLockResponse.typeUrl, MsgSuperfluidUnbondLockResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgSuperfluidUnbondLockResponse.aminoType, MsgSuperfluidUnbondLockResponse.typeUrl); function createBaseMsgSuperfluidUndelegateAndUnbondLock(): MsgSuperfluidUndelegateAndUnbondLock { return { sender: "", lockId: BigInt(0), - coin: undefined + coin: Coin.fromPartial({}) }; } export const MsgSuperfluidUndelegateAndUnbondLock = { typeUrl: "/osmosis.superfluid.MsgSuperfluidUndelegateAndUnbondLock", + aminoType: "osmosis/superfluid-undelegate-and-unbond-lock", + is(o: any): o is MsgSuperfluidUndelegateAndUnbondLock { + return o && (o.$typeUrl === MsgSuperfluidUndelegateAndUnbondLock.typeUrl || typeof o.sender === "string" && typeof o.lockId === "bigint" && Coin.is(o.coin)); + }, + isSDK(o: any): o is MsgSuperfluidUndelegateAndUnbondLockSDKType { + return o && (o.$typeUrl === MsgSuperfluidUndelegateAndUnbondLock.typeUrl || typeof o.sender === "string" && typeof o.lock_id === "bigint" && Coin.isSDK(o.coin)); + }, + isAmino(o: any): o is MsgSuperfluidUndelegateAndUnbondLockAmino { + return o && (o.$typeUrl === MsgSuperfluidUndelegateAndUnbondLock.typeUrl || typeof o.sender === "string" && typeof o.lock_id === "bigint" && Coin.isAmino(o.coin)); + }, encode(message: MsgSuperfluidUndelegateAndUnbondLock, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.sender !== "") { writer.uint32(10).string(message.sender); @@ -915,6 +1153,20 @@ export const MsgSuperfluidUndelegateAndUnbondLock = { } return message; }, + fromJSON(object: any): MsgSuperfluidUndelegateAndUnbondLock { + return { + sender: isSet(object.sender) ? String(object.sender) : "", + lockId: isSet(object.lockId) ? BigInt(object.lockId.toString()) : BigInt(0), + coin: isSet(object.coin) ? Coin.fromJSON(object.coin) : undefined + }; + }, + toJSON(message: MsgSuperfluidUndelegateAndUnbondLock): unknown { + const obj: any = {}; + message.sender !== undefined && (obj.sender = message.sender); + message.lockId !== undefined && (obj.lockId = (message.lockId || BigInt(0)).toString()); + message.coin !== undefined && (obj.coin = message.coin ? Coin.toJSON(message.coin) : undefined); + return obj; + }, fromPartial(object: Partial): MsgSuperfluidUndelegateAndUnbondLock { const message = createBaseMsgSuperfluidUndelegateAndUnbondLock(); message.sender = object.sender ?? ""; @@ -923,11 +1175,17 @@ export const MsgSuperfluidUndelegateAndUnbondLock = { return message; }, fromAmino(object: MsgSuperfluidUndelegateAndUnbondLockAmino): MsgSuperfluidUndelegateAndUnbondLock { - return { - sender: object.sender, - lockId: BigInt(object.lock_id), - coin: object?.coin ? Coin.fromAmino(object.coin) : undefined - }; + const message = createBaseMsgSuperfluidUndelegateAndUnbondLock(); + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + if (object.lock_id !== undefined && object.lock_id !== null) { + message.lockId = BigInt(object.lock_id); + } + if (object.coin !== undefined && object.coin !== null) { + message.coin = Coin.fromAmino(object.coin); + } + return message; }, toAmino(message: MsgSuperfluidUndelegateAndUnbondLock): MsgSuperfluidUndelegateAndUnbondLockAmino { const obj: any = {}; @@ -958,6 +1216,8 @@ export const MsgSuperfluidUndelegateAndUnbondLock = { }; } }; +GlobalDecoderRegistry.register(MsgSuperfluidUndelegateAndUnbondLock.typeUrl, MsgSuperfluidUndelegateAndUnbondLock); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgSuperfluidUndelegateAndUnbondLock.aminoType, MsgSuperfluidUndelegateAndUnbondLock.typeUrl); function createBaseMsgSuperfluidUndelegateAndUnbondLockResponse(): MsgSuperfluidUndelegateAndUnbondLockResponse { return { lockId: BigInt(0) @@ -965,6 +1225,16 @@ function createBaseMsgSuperfluidUndelegateAndUnbondLockResponse(): MsgSuperfluid } export const MsgSuperfluidUndelegateAndUnbondLockResponse = { typeUrl: "/osmosis.superfluid.MsgSuperfluidUndelegateAndUnbondLockResponse", + aminoType: "osmosis/superfluid-undelegate-and-unbond-lock-response", + is(o: any): o is MsgSuperfluidUndelegateAndUnbondLockResponse { + return o && (o.$typeUrl === MsgSuperfluidUndelegateAndUnbondLockResponse.typeUrl || typeof o.lockId === "bigint"); + }, + isSDK(o: any): o is MsgSuperfluidUndelegateAndUnbondLockResponseSDKType { + return o && (o.$typeUrl === MsgSuperfluidUndelegateAndUnbondLockResponse.typeUrl || typeof o.lock_id === "bigint"); + }, + isAmino(o: any): o is MsgSuperfluidUndelegateAndUnbondLockResponseAmino { + return o && (o.$typeUrl === MsgSuperfluidUndelegateAndUnbondLockResponse.typeUrl || typeof o.lock_id === "bigint"); + }, encode(message: MsgSuperfluidUndelegateAndUnbondLockResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.lockId !== BigInt(0)) { writer.uint32(8).uint64(message.lockId); @@ -988,15 +1258,27 @@ export const MsgSuperfluidUndelegateAndUnbondLockResponse = { } return message; }, + fromJSON(object: any): MsgSuperfluidUndelegateAndUnbondLockResponse { + return { + lockId: isSet(object.lockId) ? BigInt(object.lockId.toString()) : BigInt(0) + }; + }, + toJSON(message: MsgSuperfluidUndelegateAndUnbondLockResponse): unknown { + const obj: any = {}; + message.lockId !== undefined && (obj.lockId = (message.lockId || BigInt(0)).toString()); + return obj; + }, fromPartial(object: Partial): MsgSuperfluidUndelegateAndUnbondLockResponse { const message = createBaseMsgSuperfluidUndelegateAndUnbondLockResponse(); message.lockId = object.lockId !== undefined && object.lockId !== null ? BigInt(object.lockId.toString()) : BigInt(0); return message; }, fromAmino(object: MsgSuperfluidUndelegateAndUnbondLockResponseAmino): MsgSuperfluidUndelegateAndUnbondLockResponse { - return { - lockId: BigInt(object.lock_id) - }; + const message = createBaseMsgSuperfluidUndelegateAndUnbondLockResponse(); + if (object.lock_id !== undefined && object.lock_id !== null) { + message.lockId = BigInt(object.lock_id); + } + return message; }, toAmino(message: MsgSuperfluidUndelegateAndUnbondLockResponse): MsgSuperfluidUndelegateAndUnbondLockResponseAmino { const obj: any = {}; @@ -1025,6 +1307,8 @@ export const MsgSuperfluidUndelegateAndUnbondLockResponse = { }; } }; +GlobalDecoderRegistry.register(MsgSuperfluidUndelegateAndUnbondLockResponse.typeUrl, MsgSuperfluidUndelegateAndUnbondLockResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgSuperfluidUndelegateAndUnbondLockResponse.aminoType, MsgSuperfluidUndelegateAndUnbondLockResponse.typeUrl); function createBaseMsgLockAndSuperfluidDelegate(): MsgLockAndSuperfluidDelegate { return { sender: "", @@ -1034,6 +1318,16 @@ function createBaseMsgLockAndSuperfluidDelegate(): MsgLockAndSuperfluidDelegate } export const MsgLockAndSuperfluidDelegate = { typeUrl: "/osmosis.superfluid.MsgLockAndSuperfluidDelegate", + aminoType: "osmosis/lock-and-superfluid-delegate", + is(o: any): o is MsgLockAndSuperfluidDelegate { + return o && (o.$typeUrl === MsgLockAndSuperfluidDelegate.typeUrl || typeof o.sender === "string" && Array.isArray(o.coins) && (!o.coins.length || Coin.is(o.coins[0])) && typeof o.valAddr === "string"); + }, + isSDK(o: any): o is MsgLockAndSuperfluidDelegateSDKType { + return o && (o.$typeUrl === MsgLockAndSuperfluidDelegate.typeUrl || typeof o.sender === "string" && Array.isArray(o.coins) && (!o.coins.length || Coin.isSDK(o.coins[0])) && typeof o.val_addr === "string"); + }, + isAmino(o: any): o is MsgLockAndSuperfluidDelegateAmino { + return o && (o.$typeUrl === MsgLockAndSuperfluidDelegate.typeUrl || typeof o.sender === "string" && Array.isArray(o.coins) && (!o.coins.length || Coin.isAmino(o.coins[0])) && typeof o.val_addr === "string"); + }, encode(message: MsgLockAndSuperfluidDelegate, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.sender !== "") { writer.uint32(10).string(message.sender); @@ -1069,6 +1363,24 @@ export const MsgLockAndSuperfluidDelegate = { } return message; }, + fromJSON(object: any): MsgLockAndSuperfluidDelegate { + return { + sender: isSet(object.sender) ? String(object.sender) : "", + coins: Array.isArray(object?.coins) ? object.coins.map((e: any) => Coin.fromJSON(e)) : [], + valAddr: isSet(object.valAddr) ? String(object.valAddr) : "" + }; + }, + toJSON(message: MsgLockAndSuperfluidDelegate): unknown { + const obj: any = {}; + message.sender !== undefined && (obj.sender = message.sender); + if (message.coins) { + obj.coins = message.coins.map(e => e ? Coin.toJSON(e) : undefined); + } else { + obj.coins = []; + } + message.valAddr !== undefined && (obj.valAddr = message.valAddr); + return obj; + }, fromPartial(object: Partial): MsgLockAndSuperfluidDelegate { const message = createBaseMsgLockAndSuperfluidDelegate(); message.sender = object.sender ?? ""; @@ -1077,11 +1389,15 @@ export const MsgLockAndSuperfluidDelegate = { return message; }, fromAmino(object: MsgLockAndSuperfluidDelegateAmino): MsgLockAndSuperfluidDelegate { - return { - sender: object.sender, - coins: Array.isArray(object?.coins) ? object.coins.map((e: any) => Coin.fromAmino(e)) : [], - valAddr: object.val_addr - }; + const message = createBaseMsgLockAndSuperfluidDelegate(); + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + message.coins = object.coins?.map(e => Coin.fromAmino(e)) || []; + if (object.val_addr !== undefined && object.val_addr !== null) { + message.valAddr = object.val_addr; + } + return message; }, toAmino(message: MsgLockAndSuperfluidDelegate): MsgLockAndSuperfluidDelegateAmino { const obj: any = {}; @@ -1116,6 +1432,8 @@ export const MsgLockAndSuperfluidDelegate = { }; } }; +GlobalDecoderRegistry.register(MsgLockAndSuperfluidDelegate.typeUrl, MsgLockAndSuperfluidDelegate); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgLockAndSuperfluidDelegate.aminoType, MsgLockAndSuperfluidDelegate.typeUrl); function createBaseMsgLockAndSuperfluidDelegateResponse(): MsgLockAndSuperfluidDelegateResponse { return { ID: BigInt(0) @@ -1123,6 +1441,16 @@ function createBaseMsgLockAndSuperfluidDelegateResponse(): MsgLockAndSuperfluidD } export const MsgLockAndSuperfluidDelegateResponse = { typeUrl: "/osmosis.superfluid.MsgLockAndSuperfluidDelegateResponse", + aminoType: "osmosis/lock-and-superfluid-delegate-response", + is(o: any): o is MsgLockAndSuperfluidDelegateResponse { + return o && (o.$typeUrl === MsgLockAndSuperfluidDelegateResponse.typeUrl || typeof o.ID === "bigint"); + }, + isSDK(o: any): o is MsgLockAndSuperfluidDelegateResponseSDKType { + return o && (o.$typeUrl === MsgLockAndSuperfluidDelegateResponse.typeUrl || typeof o.ID === "bigint"); + }, + isAmino(o: any): o is MsgLockAndSuperfluidDelegateResponseAmino { + return o && (o.$typeUrl === MsgLockAndSuperfluidDelegateResponse.typeUrl || typeof o.ID === "bigint"); + }, encode(message: MsgLockAndSuperfluidDelegateResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.ID !== BigInt(0)) { writer.uint32(8).uint64(message.ID); @@ -1146,15 +1474,27 @@ export const MsgLockAndSuperfluidDelegateResponse = { } return message; }, + fromJSON(object: any): MsgLockAndSuperfluidDelegateResponse { + return { + ID: isSet(object.ID) ? BigInt(object.ID.toString()) : BigInt(0) + }; + }, + toJSON(message: MsgLockAndSuperfluidDelegateResponse): unknown { + const obj: any = {}; + message.ID !== undefined && (obj.ID = (message.ID || BigInt(0)).toString()); + return obj; + }, fromPartial(object: Partial): MsgLockAndSuperfluidDelegateResponse { const message = createBaseMsgLockAndSuperfluidDelegateResponse(); message.ID = object.ID !== undefined && object.ID !== null ? BigInt(object.ID.toString()) : BigInt(0); return message; }, fromAmino(object: MsgLockAndSuperfluidDelegateResponseAmino): MsgLockAndSuperfluidDelegateResponse { - return { - ID: BigInt(object.ID) - }; + const message = createBaseMsgLockAndSuperfluidDelegateResponse(); + if (object.ID !== undefined && object.ID !== null) { + message.ID = BigInt(object.ID); + } + return message; }, toAmino(message: MsgLockAndSuperfluidDelegateResponse): MsgLockAndSuperfluidDelegateResponseAmino { const obj: any = {}; @@ -1183,6 +1523,8 @@ export const MsgLockAndSuperfluidDelegateResponse = { }; } }; +GlobalDecoderRegistry.register(MsgLockAndSuperfluidDelegateResponse.typeUrl, MsgLockAndSuperfluidDelegateResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgLockAndSuperfluidDelegateResponse.aminoType, MsgLockAndSuperfluidDelegateResponse.typeUrl); function createBaseMsgCreateFullRangePositionAndSuperfluidDelegate(): MsgCreateFullRangePositionAndSuperfluidDelegate { return { sender: "", @@ -1193,6 +1535,16 @@ function createBaseMsgCreateFullRangePositionAndSuperfluidDelegate(): MsgCreateF } export const MsgCreateFullRangePositionAndSuperfluidDelegate = { typeUrl: "/osmosis.superfluid.MsgCreateFullRangePositionAndSuperfluidDelegate", + aminoType: "osmosis/full-range-and-sf-delegate", + is(o: any): o is MsgCreateFullRangePositionAndSuperfluidDelegate { + return o && (o.$typeUrl === MsgCreateFullRangePositionAndSuperfluidDelegate.typeUrl || typeof o.sender === "string" && Array.isArray(o.coins) && (!o.coins.length || Coin.is(o.coins[0])) && typeof o.valAddr === "string" && typeof o.poolId === "bigint"); + }, + isSDK(o: any): o is MsgCreateFullRangePositionAndSuperfluidDelegateSDKType { + return o && (o.$typeUrl === MsgCreateFullRangePositionAndSuperfluidDelegate.typeUrl || typeof o.sender === "string" && Array.isArray(o.coins) && (!o.coins.length || Coin.isSDK(o.coins[0])) && typeof o.val_addr === "string" && typeof o.pool_id === "bigint"); + }, + isAmino(o: any): o is MsgCreateFullRangePositionAndSuperfluidDelegateAmino { + return o && (o.$typeUrl === MsgCreateFullRangePositionAndSuperfluidDelegate.typeUrl || typeof o.sender === "string" && Array.isArray(o.coins) && (!o.coins.length || Coin.isAmino(o.coins[0])) && typeof o.val_addr === "string" && typeof o.pool_id === "bigint"); + }, encode(message: MsgCreateFullRangePositionAndSuperfluidDelegate, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.sender !== "") { writer.uint32(10).string(message.sender); @@ -1234,6 +1586,26 @@ export const MsgCreateFullRangePositionAndSuperfluidDelegate = { } return message; }, + fromJSON(object: any): MsgCreateFullRangePositionAndSuperfluidDelegate { + return { + sender: isSet(object.sender) ? String(object.sender) : "", + coins: Array.isArray(object?.coins) ? object.coins.map((e: any) => Coin.fromJSON(e)) : [], + valAddr: isSet(object.valAddr) ? String(object.valAddr) : "", + poolId: isSet(object.poolId) ? BigInt(object.poolId.toString()) : BigInt(0) + }; + }, + toJSON(message: MsgCreateFullRangePositionAndSuperfluidDelegate): unknown { + const obj: any = {}; + message.sender !== undefined && (obj.sender = message.sender); + if (message.coins) { + obj.coins = message.coins.map(e => e ? Coin.toJSON(e) : undefined); + } else { + obj.coins = []; + } + message.valAddr !== undefined && (obj.valAddr = message.valAddr); + message.poolId !== undefined && (obj.poolId = (message.poolId || BigInt(0)).toString()); + return obj; + }, fromPartial(object: Partial): MsgCreateFullRangePositionAndSuperfluidDelegate { const message = createBaseMsgCreateFullRangePositionAndSuperfluidDelegate(); message.sender = object.sender ?? ""; @@ -1243,12 +1615,18 @@ export const MsgCreateFullRangePositionAndSuperfluidDelegate = { return message; }, fromAmino(object: MsgCreateFullRangePositionAndSuperfluidDelegateAmino): MsgCreateFullRangePositionAndSuperfluidDelegate { - return { - sender: object.sender, - coins: Array.isArray(object?.coins) ? object.coins.map((e: any) => Coin.fromAmino(e)) : [], - valAddr: object.val_addr, - poolId: BigInt(object.pool_id) - }; + const message = createBaseMsgCreateFullRangePositionAndSuperfluidDelegate(); + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + message.coins = object.coins?.map(e => Coin.fromAmino(e)) || []; + if (object.val_addr !== undefined && object.val_addr !== null) { + message.valAddr = object.val_addr; + } + if (object.pool_id !== undefined && object.pool_id !== null) { + message.poolId = BigInt(object.pool_id); + } + return message; }, toAmino(message: MsgCreateFullRangePositionAndSuperfluidDelegate): MsgCreateFullRangePositionAndSuperfluidDelegateAmino { const obj: any = {}; @@ -1267,7 +1645,7 @@ export const MsgCreateFullRangePositionAndSuperfluidDelegate = { }, toAminoMsg(message: MsgCreateFullRangePositionAndSuperfluidDelegate): MsgCreateFullRangePositionAndSuperfluidDelegateAminoMsg { return { - type: "osmosis/create-full-range-position-and-superfluid-delegate", + type: "osmosis/full-range-and-sf-delegate", value: MsgCreateFullRangePositionAndSuperfluidDelegate.toAmino(message) }; }, @@ -1284,6 +1662,8 @@ export const MsgCreateFullRangePositionAndSuperfluidDelegate = { }; } }; +GlobalDecoderRegistry.register(MsgCreateFullRangePositionAndSuperfluidDelegate.typeUrl, MsgCreateFullRangePositionAndSuperfluidDelegate); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgCreateFullRangePositionAndSuperfluidDelegate.aminoType, MsgCreateFullRangePositionAndSuperfluidDelegate.typeUrl); function createBaseMsgCreateFullRangePositionAndSuperfluidDelegateResponse(): MsgCreateFullRangePositionAndSuperfluidDelegateResponse { return { lockID: BigInt(0), @@ -1292,6 +1672,16 @@ function createBaseMsgCreateFullRangePositionAndSuperfluidDelegateResponse(): Ms } export const MsgCreateFullRangePositionAndSuperfluidDelegateResponse = { typeUrl: "/osmosis.superfluid.MsgCreateFullRangePositionAndSuperfluidDelegateResponse", + aminoType: "osmosis/create-full-range-position-and-superfluid-delegate-response", + is(o: any): o is MsgCreateFullRangePositionAndSuperfluidDelegateResponse { + return o && (o.$typeUrl === MsgCreateFullRangePositionAndSuperfluidDelegateResponse.typeUrl || typeof o.lockID === "bigint" && typeof o.positionID === "bigint"); + }, + isSDK(o: any): o is MsgCreateFullRangePositionAndSuperfluidDelegateResponseSDKType { + return o && (o.$typeUrl === MsgCreateFullRangePositionAndSuperfluidDelegateResponse.typeUrl || typeof o.lockID === "bigint" && typeof o.positionID === "bigint"); + }, + isAmino(o: any): o is MsgCreateFullRangePositionAndSuperfluidDelegateResponseAmino { + return o && (o.$typeUrl === MsgCreateFullRangePositionAndSuperfluidDelegateResponse.typeUrl || typeof o.lockID === "bigint" && typeof o.positionID === "bigint"); + }, encode(message: MsgCreateFullRangePositionAndSuperfluidDelegateResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.lockID !== BigInt(0)) { writer.uint32(8).uint64(message.lockID); @@ -1321,6 +1711,18 @@ export const MsgCreateFullRangePositionAndSuperfluidDelegateResponse = { } return message; }, + fromJSON(object: any): MsgCreateFullRangePositionAndSuperfluidDelegateResponse { + return { + lockID: isSet(object.lockID) ? BigInt(object.lockID.toString()) : BigInt(0), + positionID: isSet(object.positionID) ? BigInt(object.positionID.toString()) : BigInt(0) + }; + }, + toJSON(message: MsgCreateFullRangePositionAndSuperfluidDelegateResponse): unknown { + const obj: any = {}; + message.lockID !== undefined && (obj.lockID = (message.lockID || BigInt(0)).toString()); + message.positionID !== undefined && (obj.positionID = (message.positionID || BigInt(0)).toString()); + return obj; + }, fromPartial(object: Partial): MsgCreateFullRangePositionAndSuperfluidDelegateResponse { const message = createBaseMsgCreateFullRangePositionAndSuperfluidDelegateResponse(); message.lockID = object.lockID !== undefined && object.lockID !== null ? BigInt(object.lockID.toString()) : BigInt(0); @@ -1328,10 +1730,14 @@ export const MsgCreateFullRangePositionAndSuperfluidDelegateResponse = { return message; }, fromAmino(object: MsgCreateFullRangePositionAndSuperfluidDelegateResponseAmino): MsgCreateFullRangePositionAndSuperfluidDelegateResponse { - return { - lockID: BigInt(object.lockID), - positionID: BigInt(object.positionID) - }; + const message = createBaseMsgCreateFullRangePositionAndSuperfluidDelegateResponse(); + if (object.lockID !== undefined && object.lockID !== null) { + message.lockID = BigInt(object.lockID); + } + if (object.positionID !== undefined && object.positionID !== null) { + message.positionID = BigInt(object.positionID); + } + return message; }, toAmino(message: MsgCreateFullRangePositionAndSuperfluidDelegateResponse): MsgCreateFullRangePositionAndSuperfluidDelegateResponseAmino { const obj: any = {}; @@ -1361,6 +1767,8 @@ export const MsgCreateFullRangePositionAndSuperfluidDelegateResponse = { }; } }; +GlobalDecoderRegistry.register(MsgCreateFullRangePositionAndSuperfluidDelegateResponse.typeUrl, MsgCreateFullRangePositionAndSuperfluidDelegateResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgCreateFullRangePositionAndSuperfluidDelegateResponse.aminoType, MsgCreateFullRangePositionAndSuperfluidDelegateResponse.typeUrl); function createBaseMsgUnPoolWhitelistedPool(): MsgUnPoolWhitelistedPool { return { sender: "", @@ -1369,6 +1777,16 @@ function createBaseMsgUnPoolWhitelistedPool(): MsgUnPoolWhitelistedPool { } export const MsgUnPoolWhitelistedPool = { typeUrl: "/osmosis.superfluid.MsgUnPoolWhitelistedPool", + aminoType: "osmosis/unpool-whitelisted-pool", + is(o: any): o is MsgUnPoolWhitelistedPool { + return o && (o.$typeUrl === MsgUnPoolWhitelistedPool.typeUrl || typeof o.sender === "string" && typeof o.poolId === "bigint"); + }, + isSDK(o: any): o is MsgUnPoolWhitelistedPoolSDKType { + return o && (o.$typeUrl === MsgUnPoolWhitelistedPool.typeUrl || typeof o.sender === "string" && typeof o.pool_id === "bigint"); + }, + isAmino(o: any): o is MsgUnPoolWhitelistedPoolAmino { + return o && (o.$typeUrl === MsgUnPoolWhitelistedPool.typeUrl || typeof o.sender === "string" && typeof o.pool_id === "bigint"); + }, encode(message: MsgUnPoolWhitelistedPool, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.sender !== "") { writer.uint32(10).string(message.sender); @@ -1398,6 +1816,18 @@ export const MsgUnPoolWhitelistedPool = { } return message; }, + fromJSON(object: any): MsgUnPoolWhitelistedPool { + return { + sender: isSet(object.sender) ? String(object.sender) : "", + poolId: isSet(object.poolId) ? BigInt(object.poolId.toString()) : BigInt(0) + }; + }, + toJSON(message: MsgUnPoolWhitelistedPool): unknown { + const obj: any = {}; + message.sender !== undefined && (obj.sender = message.sender); + message.poolId !== undefined && (obj.poolId = (message.poolId || BigInt(0)).toString()); + return obj; + }, fromPartial(object: Partial): MsgUnPoolWhitelistedPool { const message = createBaseMsgUnPoolWhitelistedPool(); message.sender = object.sender ?? ""; @@ -1405,10 +1835,14 @@ export const MsgUnPoolWhitelistedPool = { return message; }, fromAmino(object: MsgUnPoolWhitelistedPoolAmino): MsgUnPoolWhitelistedPool { - return { - sender: object.sender, - poolId: BigInt(object.pool_id) - }; + const message = createBaseMsgUnPoolWhitelistedPool(); + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + if (object.pool_id !== undefined && object.pool_id !== null) { + message.poolId = BigInt(object.pool_id); + } + return message; }, toAmino(message: MsgUnPoolWhitelistedPool): MsgUnPoolWhitelistedPoolAmino { const obj: any = {}; @@ -1438,6 +1872,8 @@ export const MsgUnPoolWhitelistedPool = { }; } }; +GlobalDecoderRegistry.register(MsgUnPoolWhitelistedPool.typeUrl, MsgUnPoolWhitelistedPool); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgUnPoolWhitelistedPool.aminoType, MsgUnPoolWhitelistedPool.typeUrl); function createBaseMsgUnPoolWhitelistedPoolResponse(): MsgUnPoolWhitelistedPoolResponse { return { exitedLockIds: [] @@ -1445,6 +1881,16 @@ function createBaseMsgUnPoolWhitelistedPoolResponse(): MsgUnPoolWhitelistedPoolR } export const MsgUnPoolWhitelistedPoolResponse = { typeUrl: "/osmosis.superfluid.MsgUnPoolWhitelistedPoolResponse", + aminoType: "osmosis/un-pool-whitelisted-pool-response", + is(o: any): o is MsgUnPoolWhitelistedPoolResponse { + return o && (o.$typeUrl === MsgUnPoolWhitelistedPoolResponse.typeUrl || Array.isArray(o.exitedLockIds) && (!o.exitedLockIds.length || typeof o.exitedLockIds[0] === "bigint")); + }, + isSDK(o: any): o is MsgUnPoolWhitelistedPoolResponseSDKType { + return o && (o.$typeUrl === MsgUnPoolWhitelistedPoolResponse.typeUrl || Array.isArray(o.exited_lock_ids) && (!o.exited_lock_ids.length || typeof o.exited_lock_ids[0] === "bigint")); + }, + isAmino(o: any): o is MsgUnPoolWhitelistedPoolResponseAmino { + return o && (o.$typeUrl === MsgUnPoolWhitelistedPoolResponse.typeUrl || Array.isArray(o.exited_lock_ids) && (!o.exited_lock_ids.length || typeof o.exited_lock_ids[0] === "bigint")); + }, encode(message: MsgUnPoolWhitelistedPoolResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { writer.uint32(10).fork(); for (const v of message.exitedLockIds) { @@ -1477,15 +1923,29 @@ export const MsgUnPoolWhitelistedPoolResponse = { } return message; }, + fromJSON(object: any): MsgUnPoolWhitelistedPoolResponse { + return { + exitedLockIds: Array.isArray(object?.exitedLockIds) ? object.exitedLockIds.map((e: any) => BigInt(e.toString())) : [] + }; + }, + toJSON(message: MsgUnPoolWhitelistedPoolResponse): unknown { + const obj: any = {}; + if (message.exitedLockIds) { + obj.exitedLockIds = message.exitedLockIds.map(e => (e || BigInt(0)).toString()); + } else { + obj.exitedLockIds = []; + } + return obj; + }, fromPartial(object: Partial): MsgUnPoolWhitelistedPoolResponse { const message = createBaseMsgUnPoolWhitelistedPoolResponse(); message.exitedLockIds = object.exitedLockIds?.map(e => BigInt(e.toString())) || []; return message; }, fromAmino(object: MsgUnPoolWhitelistedPoolResponseAmino): MsgUnPoolWhitelistedPoolResponse { - return { - exitedLockIds: Array.isArray(object?.exited_lock_ids) ? object.exited_lock_ids.map((e: any) => BigInt(e)) : [] - }; + const message = createBaseMsgUnPoolWhitelistedPoolResponse(); + message.exitedLockIds = object.exited_lock_ids?.map(e => BigInt(e)) || []; + return message; }, toAmino(message: MsgUnPoolWhitelistedPoolResponse): MsgUnPoolWhitelistedPoolResponseAmino { const obj: any = {}; @@ -1518,16 +1978,28 @@ export const MsgUnPoolWhitelistedPoolResponse = { }; } }; +GlobalDecoderRegistry.register(MsgUnPoolWhitelistedPoolResponse.typeUrl, MsgUnPoolWhitelistedPoolResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgUnPoolWhitelistedPoolResponse.aminoType, MsgUnPoolWhitelistedPoolResponse.typeUrl); function createBaseMsgUnlockAndMigrateSharesToFullRangeConcentratedPosition(): MsgUnlockAndMigrateSharesToFullRangeConcentratedPosition { return { sender: "", lockId: BigInt(0), - sharesToMigrate: undefined, + sharesToMigrate: Coin.fromPartial({}), tokenOutMins: [] }; } export const MsgUnlockAndMigrateSharesToFullRangeConcentratedPosition = { typeUrl: "/osmosis.superfluid.MsgUnlockAndMigrateSharesToFullRangeConcentratedPosition", + aminoType: "osmosis/unlock-and-migrate", + is(o: any): o is MsgUnlockAndMigrateSharesToFullRangeConcentratedPosition { + return o && (o.$typeUrl === MsgUnlockAndMigrateSharesToFullRangeConcentratedPosition.typeUrl || typeof o.sender === "string" && typeof o.lockId === "bigint" && Coin.is(o.sharesToMigrate) && Array.isArray(o.tokenOutMins) && (!o.tokenOutMins.length || Coin.is(o.tokenOutMins[0]))); + }, + isSDK(o: any): o is MsgUnlockAndMigrateSharesToFullRangeConcentratedPositionSDKType { + return o && (o.$typeUrl === MsgUnlockAndMigrateSharesToFullRangeConcentratedPosition.typeUrl || typeof o.sender === "string" && typeof o.lock_id === "bigint" && Coin.isSDK(o.shares_to_migrate) && Array.isArray(o.token_out_mins) && (!o.token_out_mins.length || Coin.isSDK(o.token_out_mins[0]))); + }, + isAmino(o: any): o is MsgUnlockAndMigrateSharesToFullRangeConcentratedPositionAmino { + return o && (o.$typeUrl === MsgUnlockAndMigrateSharesToFullRangeConcentratedPosition.typeUrl || typeof o.sender === "string" && typeof o.lock_id === "bigint" && Coin.isAmino(o.shares_to_migrate) && Array.isArray(o.token_out_mins) && (!o.token_out_mins.length || Coin.isAmino(o.token_out_mins[0]))); + }, encode(message: MsgUnlockAndMigrateSharesToFullRangeConcentratedPosition, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.sender !== "") { writer.uint32(10).string(message.sender); @@ -1569,6 +2041,26 @@ export const MsgUnlockAndMigrateSharesToFullRangeConcentratedPosition = { } return message; }, + fromJSON(object: any): MsgUnlockAndMigrateSharesToFullRangeConcentratedPosition { + return { + sender: isSet(object.sender) ? String(object.sender) : "", + lockId: isSet(object.lockId) ? BigInt(object.lockId.toString()) : BigInt(0), + sharesToMigrate: isSet(object.sharesToMigrate) ? Coin.fromJSON(object.sharesToMigrate) : undefined, + tokenOutMins: Array.isArray(object?.tokenOutMins) ? object.tokenOutMins.map((e: any) => Coin.fromJSON(e)) : [] + }; + }, + toJSON(message: MsgUnlockAndMigrateSharesToFullRangeConcentratedPosition): unknown { + const obj: any = {}; + message.sender !== undefined && (obj.sender = message.sender); + message.lockId !== undefined && (obj.lockId = (message.lockId || BigInt(0)).toString()); + message.sharesToMigrate !== undefined && (obj.sharesToMigrate = message.sharesToMigrate ? Coin.toJSON(message.sharesToMigrate) : undefined); + if (message.tokenOutMins) { + obj.tokenOutMins = message.tokenOutMins.map(e => e ? Coin.toJSON(e) : undefined); + } else { + obj.tokenOutMins = []; + } + return obj; + }, fromPartial(object: Partial): MsgUnlockAndMigrateSharesToFullRangeConcentratedPosition { const message = createBaseMsgUnlockAndMigrateSharesToFullRangeConcentratedPosition(); message.sender = object.sender ?? ""; @@ -1578,12 +2070,18 @@ export const MsgUnlockAndMigrateSharesToFullRangeConcentratedPosition = { return message; }, fromAmino(object: MsgUnlockAndMigrateSharesToFullRangeConcentratedPositionAmino): MsgUnlockAndMigrateSharesToFullRangeConcentratedPosition { - return { - sender: object.sender, - lockId: BigInt(object.lock_id), - sharesToMigrate: object?.shares_to_migrate ? Coin.fromAmino(object.shares_to_migrate) : undefined, - tokenOutMins: Array.isArray(object?.token_out_mins) ? object.token_out_mins.map((e: any) => Coin.fromAmino(e)) : [] - }; + const message = createBaseMsgUnlockAndMigrateSharesToFullRangeConcentratedPosition(); + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + if (object.lock_id !== undefined && object.lock_id !== null) { + message.lockId = BigInt(object.lock_id); + } + if (object.shares_to_migrate !== undefined && object.shares_to_migrate !== null) { + message.sharesToMigrate = Coin.fromAmino(object.shares_to_migrate); + } + message.tokenOutMins = object.token_out_mins?.map(e => Coin.fromAmino(e)) || []; + return message; }, toAmino(message: MsgUnlockAndMigrateSharesToFullRangeConcentratedPosition): MsgUnlockAndMigrateSharesToFullRangeConcentratedPositionAmino { const obj: any = {}; @@ -1602,7 +2100,7 @@ export const MsgUnlockAndMigrateSharesToFullRangeConcentratedPosition = { }, toAminoMsg(message: MsgUnlockAndMigrateSharesToFullRangeConcentratedPosition): MsgUnlockAndMigrateSharesToFullRangeConcentratedPositionAminoMsg { return { - type: "osmosis/unlock-and-migrate-shares-to-full-range-concentrated-position", + type: "osmosis/unlock-and-migrate", value: MsgUnlockAndMigrateSharesToFullRangeConcentratedPosition.toAmino(message) }; }, @@ -1619,16 +2117,28 @@ export const MsgUnlockAndMigrateSharesToFullRangeConcentratedPosition = { }; } }; +GlobalDecoderRegistry.register(MsgUnlockAndMigrateSharesToFullRangeConcentratedPosition.typeUrl, MsgUnlockAndMigrateSharesToFullRangeConcentratedPosition); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgUnlockAndMigrateSharesToFullRangeConcentratedPosition.aminoType, MsgUnlockAndMigrateSharesToFullRangeConcentratedPosition.typeUrl); function createBaseMsgUnlockAndMigrateSharesToFullRangeConcentratedPositionResponse(): MsgUnlockAndMigrateSharesToFullRangeConcentratedPositionResponse { return { amount0: "", amount1: "", liquidityCreated: "", - joinTime: undefined + joinTime: new Date() }; } export const MsgUnlockAndMigrateSharesToFullRangeConcentratedPositionResponse = { typeUrl: "/osmosis.superfluid.MsgUnlockAndMigrateSharesToFullRangeConcentratedPositionResponse", + aminoType: "osmosis/unlock-and-migrate-shares-to-full-range-concentrated-position-response", + is(o: any): o is MsgUnlockAndMigrateSharesToFullRangeConcentratedPositionResponse { + return o && (o.$typeUrl === MsgUnlockAndMigrateSharesToFullRangeConcentratedPositionResponse.typeUrl || typeof o.amount0 === "string" && typeof o.amount1 === "string" && typeof o.liquidityCreated === "string" && Timestamp.is(o.joinTime)); + }, + isSDK(o: any): o is MsgUnlockAndMigrateSharesToFullRangeConcentratedPositionResponseSDKType { + return o && (o.$typeUrl === MsgUnlockAndMigrateSharesToFullRangeConcentratedPositionResponse.typeUrl || typeof o.amount0 === "string" && typeof o.amount1 === "string" && typeof o.liquidity_created === "string" && Timestamp.isSDK(o.join_time)); + }, + isAmino(o: any): o is MsgUnlockAndMigrateSharesToFullRangeConcentratedPositionResponseAmino { + return o && (o.$typeUrl === MsgUnlockAndMigrateSharesToFullRangeConcentratedPositionResponse.typeUrl || typeof o.amount0 === "string" && typeof o.amount1 === "string" && typeof o.liquidity_created === "string" && Timestamp.isAmino(o.join_time)); + }, encode(message: MsgUnlockAndMigrateSharesToFullRangeConcentratedPositionResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.amount0 !== "") { writer.uint32(10).string(message.amount0); @@ -1670,6 +2180,22 @@ export const MsgUnlockAndMigrateSharesToFullRangeConcentratedPositionResponse = } return message; }, + fromJSON(object: any): MsgUnlockAndMigrateSharesToFullRangeConcentratedPositionResponse { + return { + amount0: isSet(object.amount0) ? String(object.amount0) : "", + amount1: isSet(object.amount1) ? String(object.amount1) : "", + liquidityCreated: isSet(object.liquidityCreated) ? String(object.liquidityCreated) : "", + joinTime: isSet(object.joinTime) ? new Date(object.joinTime) : undefined + }; + }, + toJSON(message: MsgUnlockAndMigrateSharesToFullRangeConcentratedPositionResponse): unknown { + const obj: any = {}; + message.amount0 !== undefined && (obj.amount0 = message.amount0); + message.amount1 !== undefined && (obj.amount1 = message.amount1); + message.liquidityCreated !== undefined && (obj.liquidityCreated = message.liquidityCreated); + message.joinTime !== undefined && (obj.joinTime = message.joinTime.toISOString()); + return obj; + }, fromPartial(object: Partial): MsgUnlockAndMigrateSharesToFullRangeConcentratedPositionResponse { const message = createBaseMsgUnlockAndMigrateSharesToFullRangeConcentratedPositionResponse(); message.amount0 = object.amount0 ?? ""; @@ -1679,19 +2205,27 @@ export const MsgUnlockAndMigrateSharesToFullRangeConcentratedPositionResponse = return message; }, fromAmino(object: MsgUnlockAndMigrateSharesToFullRangeConcentratedPositionResponseAmino): MsgUnlockAndMigrateSharesToFullRangeConcentratedPositionResponse { - return { - amount0: object.amount0, - amount1: object.amount1, - liquidityCreated: object.liquidity_created, - joinTime: object.join_time - }; + const message = createBaseMsgUnlockAndMigrateSharesToFullRangeConcentratedPositionResponse(); + if (object.amount0 !== undefined && object.amount0 !== null) { + message.amount0 = object.amount0; + } + if (object.amount1 !== undefined && object.amount1 !== null) { + message.amount1 = object.amount1; + } + if (object.liquidity_created !== undefined && object.liquidity_created !== null) { + message.liquidityCreated = object.liquidity_created; + } + if (object.join_time !== undefined && object.join_time !== null) { + message.joinTime = fromTimestamp(Timestamp.fromAmino(object.join_time)); + } + return message; }, toAmino(message: MsgUnlockAndMigrateSharesToFullRangeConcentratedPositionResponse): MsgUnlockAndMigrateSharesToFullRangeConcentratedPositionResponseAmino { const obj: any = {}; obj.amount0 = message.amount0; obj.amount1 = message.amount1; obj.liquidity_created = message.liquidityCreated; - obj.join_time = message.joinTime; + obj.join_time = message.joinTime ? Timestamp.toAmino(toTimestamp(message.joinTime)) : undefined; return obj; }, fromAminoMsg(object: MsgUnlockAndMigrateSharesToFullRangeConcentratedPositionResponseAminoMsg): MsgUnlockAndMigrateSharesToFullRangeConcentratedPositionResponse { @@ -1716,16 +2250,28 @@ export const MsgUnlockAndMigrateSharesToFullRangeConcentratedPositionResponse = }; } }; +GlobalDecoderRegistry.register(MsgUnlockAndMigrateSharesToFullRangeConcentratedPositionResponse.typeUrl, MsgUnlockAndMigrateSharesToFullRangeConcentratedPositionResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgUnlockAndMigrateSharesToFullRangeConcentratedPositionResponse.aminoType, MsgUnlockAndMigrateSharesToFullRangeConcentratedPositionResponse.typeUrl); function createBaseMsgAddToConcentratedLiquiditySuperfluidPosition(): MsgAddToConcentratedLiquiditySuperfluidPosition { return { positionId: BigInt(0), sender: "", - tokenDesired0: undefined, - tokenDesired1: undefined + tokenDesired0: Coin.fromPartial({}), + tokenDesired1: Coin.fromPartial({}) }; } export const MsgAddToConcentratedLiquiditySuperfluidPosition = { typeUrl: "/osmosis.superfluid.MsgAddToConcentratedLiquiditySuperfluidPosition", + aminoType: "osmosis/add-to-cl-superfluid-position", + is(o: any): o is MsgAddToConcentratedLiquiditySuperfluidPosition { + return o && (o.$typeUrl === MsgAddToConcentratedLiquiditySuperfluidPosition.typeUrl || typeof o.positionId === "bigint" && typeof o.sender === "string" && Coin.is(o.tokenDesired0) && Coin.is(o.tokenDesired1)); + }, + isSDK(o: any): o is MsgAddToConcentratedLiquiditySuperfluidPositionSDKType { + return o && (o.$typeUrl === MsgAddToConcentratedLiquiditySuperfluidPosition.typeUrl || typeof o.position_id === "bigint" && typeof o.sender === "string" && Coin.isSDK(o.token_desired0) && Coin.isSDK(o.token_desired1)); + }, + isAmino(o: any): o is MsgAddToConcentratedLiquiditySuperfluidPositionAmino { + return o && (o.$typeUrl === MsgAddToConcentratedLiquiditySuperfluidPosition.typeUrl || typeof o.position_id === "bigint" && typeof o.sender === "string" && Coin.isAmino(o.token_desired0) && Coin.isAmino(o.token_desired1)); + }, encode(message: MsgAddToConcentratedLiquiditySuperfluidPosition, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.positionId !== BigInt(0)) { writer.uint32(8).uint64(message.positionId); @@ -1767,6 +2313,22 @@ export const MsgAddToConcentratedLiquiditySuperfluidPosition = { } return message; }, + fromJSON(object: any): MsgAddToConcentratedLiquiditySuperfluidPosition { + return { + positionId: isSet(object.positionId) ? BigInt(object.positionId.toString()) : BigInt(0), + sender: isSet(object.sender) ? String(object.sender) : "", + tokenDesired0: isSet(object.tokenDesired0) ? Coin.fromJSON(object.tokenDesired0) : undefined, + tokenDesired1: isSet(object.tokenDesired1) ? Coin.fromJSON(object.tokenDesired1) : undefined + }; + }, + toJSON(message: MsgAddToConcentratedLiquiditySuperfluidPosition): unknown { + const obj: any = {}; + message.positionId !== undefined && (obj.positionId = (message.positionId || BigInt(0)).toString()); + message.sender !== undefined && (obj.sender = message.sender); + message.tokenDesired0 !== undefined && (obj.tokenDesired0 = message.tokenDesired0 ? Coin.toJSON(message.tokenDesired0) : undefined); + message.tokenDesired1 !== undefined && (obj.tokenDesired1 = message.tokenDesired1 ? Coin.toJSON(message.tokenDesired1) : undefined); + return obj; + }, fromPartial(object: Partial): MsgAddToConcentratedLiquiditySuperfluidPosition { const message = createBaseMsgAddToConcentratedLiquiditySuperfluidPosition(); message.positionId = object.positionId !== undefined && object.positionId !== null ? BigInt(object.positionId.toString()) : BigInt(0); @@ -1776,12 +2338,20 @@ export const MsgAddToConcentratedLiquiditySuperfluidPosition = { return message; }, fromAmino(object: MsgAddToConcentratedLiquiditySuperfluidPositionAmino): MsgAddToConcentratedLiquiditySuperfluidPosition { - return { - positionId: BigInt(object.position_id), - sender: object.sender, - tokenDesired0: object?.token_desired0 ? Coin.fromAmino(object.token_desired0) : undefined, - tokenDesired1: object?.token_desired1 ? Coin.fromAmino(object.token_desired1) : undefined - }; + const message = createBaseMsgAddToConcentratedLiquiditySuperfluidPosition(); + if (object.position_id !== undefined && object.position_id !== null) { + message.positionId = BigInt(object.position_id); + } + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + if (object.token_desired0 !== undefined && object.token_desired0 !== null) { + message.tokenDesired0 = Coin.fromAmino(object.token_desired0); + } + if (object.token_desired1 !== undefined && object.token_desired1 !== null) { + message.tokenDesired1 = Coin.fromAmino(object.token_desired1); + } + return message; }, toAmino(message: MsgAddToConcentratedLiquiditySuperfluidPosition): MsgAddToConcentratedLiquiditySuperfluidPositionAmino { const obj: any = {}; @@ -1796,7 +2366,7 @@ export const MsgAddToConcentratedLiquiditySuperfluidPosition = { }, toAminoMsg(message: MsgAddToConcentratedLiquiditySuperfluidPosition): MsgAddToConcentratedLiquiditySuperfluidPositionAminoMsg { return { - type: "osmosis/add-to-concentrated-liquidity-superfluid-position", + type: "osmosis/add-to-cl-superfluid-position", value: MsgAddToConcentratedLiquiditySuperfluidPosition.toAmino(message) }; }, @@ -1813,6 +2383,8 @@ export const MsgAddToConcentratedLiquiditySuperfluidPosition = { }; } }; +GlobalDecoderRegistry.register(MsgAddToConcentratedLiquiditySuperfluidPosition.typeUrl, MsgAddToConcentratedLiquiditySuperfluidPosition); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgAddToConcentratedLiquiditySuperfluidPosition.aminoType, MsgAddToConcentratedLiquiditySuperfluidPosition.typeUrl); function createBaseMsgAddToConcentratedLiquiditySuperfluidPositionResponse(): MsgAddToConcentratedLiquiditySuperfluidPositionResponse { return { positionId: BigInt(0), @@ -1824,6 +2396,16 @@ function createBaseMsgAddToConcentratedLiquiditySuperfluidPositionResponse(): Ms } export const MsgAddToConcentratedLiquiditySuperfluidPositionResponse = { typeUrl: "/osmosis.superfluid.MsgAddToConcentratedLiquiditySuperfluidPositionResponse", + aminoType: "osmosis/add-to-concentrated-liquidity-superfluid-position-response", + is(o: any): o is MsgAddToConcentratedLiquiditySuperfluidPositionResponse { + return o && (o.$typeUrl === MsgAddToConcentratedLiquiditySuperfluidPositionResponse.typeUrl || typeof o.positionId === "bigint" && typeof o.amount0 === "string" && typeof o.amount1 === "string" && typeof o.newLiquidity === "string" && typeof o.lockId === "bigint"); + }, + isSDK(o: any): o is MsgAddToConcentratedLiquiditySuperfluidPositionResponseSDKType { + return o && (o.$typeUrl === MsgAddToConcentratedLiquiditySuperfluidPositionResponse.typeUrl || typeof o.position_id === "bigint" && typeof o.amount0 === "string" && typeof o.amount1 === "string" && typeof o.new_liquidity === "string" && typeof o.lock_id === "bigint"); + }, + isAmino(o: any): o is MsgAddToConcentratedLiquiditySuperfluidPositionResponseAmino { + return o && (o.$typeUrl === MsgAddToConcentratedLiquiditySuperfluidPositionResponse.typeUrl || typeof o.position_id === "bigint" && typeof o.amount0 === "string" && typeof o.amount1 === "string" && typeof o.new_liquidity === "string" && typeof o.lock_id === "bigint"); + }, encode(message: MsgAddToConcentratedLiquiditySuperfluidPositionResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.positionId !== BigInt(0)) { writer.uint32(8).uint64(message.positionId); @@ -1871,6 +2453,24 @@ export const MsgAddToConcentratedLiquiditySuperfluidPositionResponse = { } return message; }, + fromJSON(object: any): MsgAddToConcentratedLiquiditySuperfluidPositionResponse { + return { + positionId: isSet(object.positionId) ? BigInt(object.positionId.toString()) : BigInt(0), + amount0: isSet(object.amount0) ? String(object.amount0) : "", + amount1: isSet(object.amount1) ? String(object.amount1) : "", + newLiquidity: isSet(object.newLiquidity) ? String(object.newLiquidity) : "", + lockId: isSet(object.lockId) ? BigInt(object.lockId.toString()) : BigInt(0) + }; + }, + toJSON(message: MsgAddToConcentratedLiquiditySuperfluidPositionResponse): unknown { + const obj: any = {}; + message.positionId !== undefined && (obj.positionId = (message.positionId || BigInt(0)).toString()); + message.amount0 !== undefined && (obj.amount0 = message.amount0); + message.amount1 !== undefined && (obj.amount1 = message.amount1); + message.newLiquidity !== undefined && (obj.newLiquidity = message.newLiquidity); + message.lockId !== undefined && (obj.lockId = (message.lockId || BigInt(0)).toString()); + return obj; + }, fromPartial(object: Partial): MsgAddToConcentratedLiquiditySuperfluidPositionResponse { const message = createBaseMsgAddToConcentratedLiquiditySuperfluidPositionResponse(); message.positionId = object.positionId !== undefined && object.positionId !== null ? BigInt(object.positionId.toString()) : BigInt(0); @@ -1881,13 +2481,23 @@ export const MsgAddToConcentratedLiquiditySuperfluidPositionResponse = { return message; }, fromAmino(object: MsgAddToConcentratedLiquiditySuperfluidPositionResponseAmino): MsgAddToConcentratedLiquiditySuperfluidPositionResponse { - return { - positionId: BigInt(object.position_id), - amount0: object.amount0, - amount1: object.amount1, - newLiquidity: object.new_liquidity, - lockId: BigInt(object.lock_id) - }; + const message = createBaseMsgAddToConcentratedLiquiditySuperfluidPositionResponse(); + if (object.position_id !== undefined && object.position_id !== null) { + message.positionId = BigInt(object.position_id); + } + if (object.amount0 !== undefined && object.amount0 !== null) { + message.amount0 = object.amount0; + } + if (object.amount1 !== undefined && object.amount1 !== null) { + message.amount1 = object.amount1; + } + if (object.new_liquidity !== undefined && object.new_liquidity !== null) { + message.newLiquidity = object.new_liquidity; + } + if (object.lock_id !== undefined && object.lock_id !== null) { + message.lockId = BigInt(object.lock_id); + } + return message; }, toAmino(message: MsgAddToConcentratedLiquiditySuperfluidPositionResponse): MsgAddToConcentratedLiquiditySuperfluidPositionResponseAmino { const obj: any = {}; @@ -1919,4 +2529,244 @@ export const MsgAddToConcentratedLiquiditySuperfluidPositionResponse = { value: MsgAddToConcentratedLiquiditySuperfluidPositionResponse.encode(message).finish() }; } -}; \ No newline at end of file +}; +GlobalDecoderRegistry.register(MsgAddToConcentratedLiquiditySuperfluidPositionResponse.typeUrl, MsgAddToConcentratedLiquiditySuperfluidPositionResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgAddToConcentratedLiquiditySuperfluidPositionResponse.aminoType, MsgAddToConcentratedLiquiditySuperfluidPositionResponse.typeUrl); +function createBaseMsgUnbondConvertAndStake(): MsgUnbondConvertAndStake { + return { + lockId: BigInt(0), + sender: "", + valAddr: "", + minAmtToStake: "", + sharesToConvert: Coin.fromPartial({}) + }; +} +export const MsgUnbondConvertAndStake = { + typeUrl: "/osmosis.superfluid.MsgUnbondConvertAndStake", + aminoType: "osmosis/unbond-convert-and-stake", + is(o: any): o is MsgUnbondConvertAndStake { + return o && (o.$typeUrl === MsgUnbondConvertAndStake.typeUrl || typeof o.lockId === "bigint" && typeof o.sender === "string" && typeof o.valAddr === "string" && typeof o.minAmtToStake === "string" && Coin.is(o.sharesToConvert)); + }, + isSDK(o: any): o is MsgUnbondConvertAndStakeSDKType { + return o && (o.$typeUrl === MsgUnbondConvertAndStake.typeUrl || typeof o.lock_id === "bigint" && typeof o.sender === "string" && typeof o.val_addr === "string" && typeof o.min_amt_to_stake === "string" && Coin.isSDK(o.shares_to_convert)); + }, + isAmino(o: any): o is MsgUnbondConvertAndStakeAmino { + return o && (o.$typeUrl === MsgUnbondConvertAndStake.typeUrl || typeof o.lock_id === "bigint" && typeof o.sender === "string" && typeof o.val_addr === "string" && typeof o.min_amt_to_stake === "string" && Coin.isAmino(o.shares_to_convert)); + }, + encode(message: MsgUnbondConvertAndStake, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.lockId !== BigInt(0)) { + writer.uint32(8).uint64(message.lockId); + } + if (message.sender !== "") { + writer.uint32(18).string(message.sender); + } + if (message.valAddr !== "") { + writer.uint32(26).string(message.valAddr); + } + if (message.minAmtToStake !== "") { + writer.uint32(34).string(message.minAmtToStake); + } + if (message.sharesToConvert !== undefined) { + Coin.encode(message.sharesToConvert, writer.uint32(42).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgUnbondConvertAndStake { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUnbondConvertAndStake(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.lockId = reader.uint64(); + break; + case 2: + message.sender = reader.string(); + break; + case 3: + message.valAddr = reader.string(); + break; + case 4: + message.minAmtToStake = reader.string(); + break; + case 5: + message.sharesToConvert = Coin.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): MsgUnbondConvertAndStake { + return { + lockId: isSet(object.lockId) ? BigInt(object.lockId.toString()) : BigInt(0), + sender: isSet(object.sender) ? String(object.sender) : "", + valAddr: isSet(object.valAddr) ? String(object.valAddr) : "", + minAmtToStake: isSet(object.minAmtToStake) ? String(object.minAmtToStake) : "", + sharesToConvert: isSet(object.sharesToConvert) ? Coin.fromJSON(object.sharesToConvert) : undefined + }; + }, + toJSON(message: MsgUnbondConvertAndStake): unknown { + const obj: any = {}; + message.lockId !== undefined && (obj.lockId = (message.lockId || BigInt(0)).toString()); + message.sender !== undefined && (obj.sender = message.sender); + message.valAddr !== undefined && (obj.valAddr = message.valAddr); + message.minAmtToStake !== undefined && (obj.minAmtToStake = message.minAmtToStake); + message.sharesToConvert !== undefined && (obj.sharesToConvert = message.sharesToConvert ? Coin.toJSON(message.sharesToConvert) : undefined); + return obj; + }, + fromPartial(object: Partial): MsgUnbondConvertAndStake { + const message = createBaseMsgUnbondConvertAndStake(); + message.lockId = object.lockId !== undefined && object.lockId !== null ? BigInt(object.lockId.toString()) : BigInt(0); + message.sender = object.sender ?? ""; + message.valAddr = object.valAddr ?? ""; + message.minAmtToStake = object.minAmtToStake ?? ""; + message.sharesToConvert = object.sharesToConvert !== undefined && object.sharesToConvert !== null ? Coin.fromPartial(object.sharesToConvert) : undefined; + return message; + }, + fromAmino(object: MsgUnbondConvertAndStakeAmino): MsgUnbondConvertAndStake { + const message = createBaseMsgUnbondConvertAndStake(); + if (object.lock_id !== undefined && object.lock_id !== null) { + message.lockId = BigInt(object.lock_id); + } + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + if (object.val_addr !== undefined && object.val_addr !== null) { + message.valAddr = object.val_addr; + } + if (object.min_amt_to_stake !== undefined && object.min_amt_to_stake !== null) { + message.minAmtToStake = object.min_amt_to_stake; + } + if (object.shares_to_convert !== undefined && object.shares_to_convert !== null) { + message.sharesToConvert = Coin.fromAmino(object.shares_to_convert); + } + return message; + }, + toAmino(message: MsgUnbondConvertAndStake): MsgUnbondConvertAndStakeAmino { + const obj: any = {}; + obj.lock_id = message.lockId ? message.lockId.toString() : undefined; + obj.sender = message.sender; + obj.val_addr = message.valAddr; + obj.min_amt_to_stake = message.minAmtToStake; + obj.shares_to_convert = message.sharesToConvert ? Coin.toAmino(message.sharesToConvert) : undefined; + return obj; + }, + fromAminoMsg(object: MsgUnbondConvertAndStakeAminoMsg): MsgUnbondConvertAndStake { + return MsgUnbondConvertAndStake.fromAmino(object.value); + }, + toAminoMsg(message: MsgUnbondConvertAndStake): MsgUnbondConvertAndStakeAminoMsg { + return { + type: "osmosis/unbond-convert-and-stake", + value: MsgUnbondConvertAndStake.toAmino(message) + }; + }, + fromProtoMsg(message: MsgUnbondConvertAndStakeProtoMsg): MsgUnbondConvertAndStake { + return MsgUnbondConvertAndStake.decode(message.value); + }, + toProto(message: MsgUnbondConvertAndStake): Uint8Array { + return MsgUnbondConvertAndStake.encode(message).finish(); + }, + toProtoMsg(message: MsgUnbondConvertAndStake): MsgUnbondConvertAndStakeProtoMsg { + return { + typeUrl: "/osmosis.superfluid.MsgUnbondConvertAndStake", + value: MsgUnbondConvertAndStake.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgUnbondConvertAndStake.typeUrl, MsgUnbondConvertAndStake); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgUnbondConvertAndStake.aminoType, MsgUnbondConvertAndStake.typeUrl); +function createBaseMsgUnbondConvertAndStakeResponse(): MsgUnbondConvertAndStakeResponse { + return { + totalAmtStaked: "" + }; +} +export const MsgUnbondConvertAndStakeResponse = { + typeUrl: "/osmosis.superfluid.MsgUnbondConvertAndStakeResponse", + aminoType: "osmosis/unbond-convert-and-stake-response", + is(o: any): o is MsgUnbondConvertAndStakeResponse { + return o && (o.$typeUrl === MsgUnbondConvertAndStakeResponse.typeUrl || typeof o.totalAmtStaked === "string"); + }, + isSDK(o: any): o is MsgUnbondConvertAndStakeResponseSDKType { + return o && (o.$typeUrl === MsgUnbondConvertAndStakeResponse.typeUrl || typeof o.total_amt_staked === "string"); + }, + isAmino(o: any): o is MsgUnbondConvertAndStakeResponseAmino { + return o && (o.$typeUrl === MsgUnbondConvertAndStakeResponse.typeUrl || typeof o.total_amt_staked === "string"); + }, + encode(message: MsgUnbondConvertAndStakeResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.totalAmtStaked !== "") { + writer.uint32(10).string(message.totalAmtStaked); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgUnbondConvertAndStakeResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUnbondConvertAndStakeResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.totalAmtStaked = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): MsgUnbondConvertAndStakeResponse { + return { + totalAmtStaked: isSet(object.totalAmtStaked) ? String(object.totalAmtStaked) : "" + }; + }, + toJSON(message: MsgUnbondConvertAndStakeResponse): unknown { + const obj: any = {}; + message.totalAmtStaked !== undefined && (obj.totalAmtStaked = message.totalAmtStaked); + return obj; + }, + fromPartial(object: Partial): MsgUnbondConvertAndStakeResponse { + const message = createBaseMsgUnbondConvertAndStakeResponse(); + message.totalAmtStaked = object.totalAmtStaked ?? ""; + return message; + }, + fromAmino(object: MsgUnbondConvertAndStakeResponseAmino): MsgUnbondConvertAndStakeResponse { + const message = createBaseMsgUnbondConvertAndStakeResponse(); + if (object.total_amt_staked !== undefined && object.total_amt_staked !== null) { + message.totalAmtStaked = object.total_amt_staked; + } + return message; + }, + toAmino(message: MsgUnbondConvertAndStakeResponse): MsgUnbondConvertAndStakeResponseAmino { + const obj: any = {}; + obj.total_amt_staked = message.totalAmtStaked; + return obj; + }, + fromAminoMsg(object: MsgUnbondConvertAndStakeResponseAminoMsg): MsgUnbondConvertAndStakeResponse { + return MsgUnbondConvertAndStakeResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgUnbondConvertAndStakeResponse): MsgUnbondConvertAndStakeResponseAminoMsg { + return { + type: "osmosis/unbond-convert-and-stake-response", + value: MsgUnbondConvertAndStakeResponse.toAmino(message) + }; + }, + fromProtoMsg(message: MsgUnbondConvertAndStakeResponseProtoMsg): MsgUnbondConvertAndStakeResponse { + return MsgUnbondConvertAndStakeResponse.decode(message.value); + }, + toProto(message: MsgUnbondConvertAndStakeResponse): Uint8Array { + return MsgUnbondConvertAndStakeResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgUnbondConvertAndStakeResponse): MsgUnbondConvertAndStakeResponseProtoMsg { + return { + typeUrl: "/osmosis.superfluid.MsgUnbondConvertAndStakeResponse", + value: MsgUnbondConvertAndStakeResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgUnbondConvertAndStakeResponse.typeUrl, MsgUnbondConvertAndStakeResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgUnbondConvertAndStakeResponse.aminoType, MsgUnbondConvertAndStakeResponse.typeUrl); \ No newline at end of file diff --git a/packages/osmojs/src/codegen/osmosis/superfluid/v1beta1/gov.ts b/packages/osmojs/src/codegen/osmosis/superfluid/v1beta1/gov.ts index 89ee80a06..c3b85164f 100644 --- a/packages/osmojs/src/codegen/osmosis/superfluid/v1beta1/gov.ts +++ b/packages/osmojs/src/codegen/osmosis/superfluid/v1beta1/gov.ts @@ -1,11 +1,13 @@ import { SuperfluidAsset, SuperfluidAssetAmino, SuperfluidAssetSDKType } from "../superfluid"; import { BinaryReader, BinaryWriter } from "../../../binary"; +import { isSet } from "../../../helpers"; +import { GlobalDecoderRegistry } from "../../../registry"; /** * SetSuperfluidAssetsProposal is a gov Content type to update the superfluid * assets */ export interface SetSuperfluidAssetsProposal { - $typeUrl?: string; + $typeUrl?: "/osmosis.superfluid.v1beta1.SetSuperfluidAssetsProposal"; title: string; description: string; assets: SuperfluidAsset[]; @@ -19,9 +21,9 @@ export interface SetSuperfluidAssetsProposalProtoMsg { * assets */ export interface SetSuperfluidAssetsProposalAmino { - title: string; - description: string; - assets: SuperfluidAssetAmino[]; + title?: string; + description?: string; + assets?: SuperfluidAssetAmino[]; } export interface SetSuperfluidAssetsProposalAminoMsg { type: "osmosis/set-superfluid-assets-proposal"; @@ -32,7 +34,7 @@ export interface SetSuperfluidAssetsProposalAminoMsg { * assets */ export interface SetSuperfluidAssetsProposalSDKType { - $typeUrl?: string; + $typeUrl?: "/osmosis.superfluid.v1beta1.SetSuperfluidAssetsProposal"; title: string; description: string; assets: SuperfluidAssetSDKType[]; @@ -42,7 +44,7 @@ export interface SetSuperfluidAssetsProposalSDKType { * assets by denom */ export interface RemoveSuperfluidAssetsProposal { - $typeUrl?: string; + $typeUrl?: "/osmosis.superfluid.v1beta1.RemoveSuperfluidAssetsProposal"; title: string; description: string; superfluidAssetDenoms: string[]; @@ -56,9 +58,9 @@ export interface RemoveSuperfluidAssetsProposalProtoMsg { * assets by denom */ export interface RemoveSuperfluidAssetsProposalAmino { - title: string; - description: string; - superfluid_asset_denoms: string[]; + title?: string; + description?: string; + superfluid_asset_denoms?: string[]; } export interface RemoveSuperfluidAssetsProposalAminoMsg { type: "osmosis/del-superfluid-assets-proposal"; @@ -69,7 +71,7 @@ export interface RemoveSuperfluidAssetsProposalAminoMsg { * assets by denom */ export interface RemoveSuperfluidAssetsProposalSDKType { - $typeUrl?: string; + $typeUrl?: "/osmosis.superfluid.v1beta1.RemoveSuperfluidAssetsProposal"; title: string; description: string; superfluid_asset_denoms: string[]; @@ -79,7 +81,7 @@ export interface RemoveSuperfluidAssetsProposalSDKType { * allowed list of pool ids. */ export interface UpdateUnpoolWhiteListProposal { - $typeUrl?: string; + $typeUrl?: "/osmosis.superfluid.v1beta1.UpdateUnpoolWhiteListProposal"; title: string; description: string; ids: bigint[]; @@ -94,10 +96,10 @@ export interface UpdateUnpoolWhiteListProposalProtoMsg { * allowed list of pool ids. */ export interface UpdateUnpoolWhiteListProposalAmino { - title: string; - description: string; - ids: string[]; - is_overwrite: boolean; + title?: string; + description?: string; + ids?: string[]; + is_overwrite?: boolean; } export interface UpdateUnpoolWhiteListProposalAminoMsg { type: "osmosis/update-unpool-whitelist"; @@ -108,7 +110,7 @@ export interface UpdateUnpoolWhiteListProposalAminoMsg { * allowed list of pool ids. */ export interface UpdateUnpoolWhiteListProposalSDKType { - $typeUrl?: string; + $typeUrl?: "/osmosis.superfluid.v1beta1.UpdateUnpoolWhiteListProposal"; title: string; description: string; ids: bigint[]; @@ -124,6 +126,16 @@ function createBaseSetSuperfluidAssetsProposal(): SetSuperfluidAssetsProposal { } export const SetSuperfluidAssetsProposal = { typeUrl: "/osmosis.superfluid.v1beta1.SetSuperfluidAssetsProposal", + aminoType: "osmosis/set-superfluid-assets-proposal", + is(o: any): o is SetSuperfluidAssetsProposal { + return o && (o.$typeUrl === SetSuperfluidAssetsProposal.typeUrl || typeof o.title === "string" && typeof o.description === "string" && Array.isArray(o.assets) && (!o.assets.length || SuperfluidAsset.is(o.assets[0]))); + }, + isSDK(o: any): o is SetSuperfluidAssetsProposalSDKType { + return o && (o.$typeUrl === SetSuperfluidAssetsProposal.typeUrl || typeof o.title === "string" && typeof o.description === "string" && Array.isArray(o.assets) && (!o.assets.length || SuperfluidAsset.isSDK(o.assets[0]))); + }, + isAmino(o: any): o is SetSuperfluidAssetsProposalAmino { + return o && (o.$typeUrl === SetSuperfluidAssetsProposal.typeUrl || typeof o.title === "string" && typeof o.description === "string" && Array.isArray(o.assets) && (!o.assets.length || SuperfluidAsset.isAmino(o.assets[0]))); + }, encode(message: SetSuperfluidAssetsProposal, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.title !== "") { writer.uint32(10).string(message.title); @@ -159,6 +171,24 @@ export const SetSuperfluidAssetsProposal = { } return message; }, + fromJSON(object: any): SetSuperfluidAssetsProposal { + return { + title: isSet(object.title) ? String(object.title) : "", + description: isSet(object.description) ? String(object.description) : "", + assets: Array.isArray(object?.assets) ? object.assets.map((e: any) => SuperfluidAsset.fromJSON(e)) : [] + }; + }, + toJSON(message: SetSuperfluidAssetsProposal): unknown { + const obj: any = {}; + message.title !== undefined && (obj.title = message.title); + message.description !== undefined && (obj.description = message.description); + if (message.assets) { + obj.assets = message.assets.map(e => e ? SuperfluidAsset.toJSON(e) : undefined); + } else { + obj.assets = []; + } + return obj; + }, fromPartial(object: Partial): SetSuperfluidAssetsProposal { const message = createBaseSetSuperfluidAssetsProposal(); message.title = object.title ?? ""; @@ -167,11 +197,15 @@ export const SetSuperfluidAssetsProposal = { return message; }, fromAmino(object: SetSuperfluidAssetsProposalAmino): SetSuperfluidAssetsProposal { - return { - title: object.title, - description: object.description, - assets: Array.isArray(object?.assets) ? object.assets.map((e: any) => SuperfluidAsset.fromAmino(e)) : [] - }; + const message = createBaseSetSuperfluidAssetsProposal(); + if (object.title !== undefined && object.title !== null) { + message.title = object.title; + } + if (object.description !== undefined && object.description !== null) { + message.description = object.description; + } + message.assets = object.assets?.map(e => SuperfluidAsset.fromAmino(e)) || []; + return message; }, toAmino(message: SetSuperfluidAssetsProposal): SetSuperfluidAssetsProposalAmino { const obj: any = {}; @@ -206,6 +240,8 @@ export const SetSuperfluidAssetsProposal = { }; } }; +GlobalDecoderRegistry.register(SetSuperfluidAssetsProposal.typeUrl, SetSuperfluidAssetsProposal); +GlobalDecoderRegistry.registerAminoProtoMapping(SetSuperfluidAssetsProposal.aminoType, SetSuperfluidAssetsProposal.typeUrl); function createBaseRemoveSuperfluidAssetsProposal(): RemoveSuperfluidAssetsProposal { return { $typeUrl: "/osmosis.superfluid.v1beta1.RemoveSuperfluidAssetsProposal", @@ -216,6 +252,16 @@ function createBaseRemoveSuperfluidAssetsProposal(): RemoveSuperfluidAssetsPropo } export const RemoveSuperfluidAssetsProposal = { typeUrl: "/osmosis.superfluid.v1beta1.RemoveSuperfluidAssetsProposal", + aminoType: "osmosis/del-superfluid-assets-proposal", + is(o: any): o is RemoveSuperfluidAssetsProposal { + return o && (o.$typeUrl === RemoveSuperfluidAssetsProposal.typeUrl || typeof o.title === "string" && typeof o.description === "string" && Array.isArray(o.superfluidAssetDenoms) && (!o.superfluidAssetDenoms.length || typeof o.superfluidAssetDenoms[0] === "string")); + }, + isSDK(o: any): o is RemoveSuperfluidAssetsProposalSDKType { + return o && (o.$typeUrl === RemoveSuperfluidAssetsProposal.typeUrl || typeof o.title === "string" && typeof o.description === "string" && Array.isArray(o.superfluid_asset_denoms) && (!o.superfluid_asset_denoms.length || typeof o.superfluid_asset_denoms[0] === "string")); + }, + isAmino(o: any): o is RemoveSuperfluidAssetsProposalAmino { + return o && (o.$typeUrl === RemoveSuperfluidAssetsProposal.typeUrl || typeof o.title === "string" && typeof o.description === "string" && Array.isArray(o.superfluid_asset_denoms) && (!o.superfluid_asset_denoms.length || typeof o.superfluid_asset_denoms[0] === "string")); + }, encode(message: RemoveSuperfluidAssetsProposal, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.title !== "") { writer.uint32(10).string(message.title); @@ -251,6 +297,24 @@ export const RemoveSuperfluidAssetsProposal = { } return message; }, + fromJSON(object: any): RemoveSuperfluidAssetsProposal { + return { + title: isSet(object.title) ? String(object.title) : "", + description: isSet(object.description) ? String(object.description) : "", + superfluidAssetDenoms: Array.isArray(object?.superfluidAssetDenoms) ? object.superfluidAssetDenoms.map((e: any) => String(e)) : [] + }; + }, + toJSON(message: RemoveSuperfluidAssetsProposal): unknown { + const obj: any = {}; + message.title !== undefined && (obj.title = message.title); + message.description !== undefined && (obj.description = message.description); + if (message.superfluidAssetDenoms) { + obj.superfluidAssetDenoms = message.superfluidAssetDenoms.map(e => e); + } else { + obj.superfluidAssetDenoms = []; + } + return obj; + }, fromPartial(object: Partial): RemoveSuperfluidAssetsProposal { const message = createBaseRemoveSuperfluidAssetsProposal(); message.title = object.title ?? ""; @@ -259,11 +323,15 @@ export const RemoveSuperfluidAssetsProposal = { return message; }, fromAmino(object: RemoveSuperfluidAssetsProposalAmino): RemoveSuperfluidAssetsProposal { - return { - title: object.title, - description: object.description, - superfluidAssetDenoms: Array.isArray(object?.superfluid_asset_denoms) ? object.superfluid_asset_denoms.map((e: any) => e) : [] - }; + const message = createBaseRemoveSuperfluidAssetsProposal(); + if (object.title !== undefined && object.title !== null) { + message.title = object.title; + } + if (object.description !== undefined && object.description !== null) { + message.description = object.description; + } + message.superfluidAssetDenoms = object.superfluid_asset_denoms?.map(e => e) || []; + return message; }, toAmino(message: RemoveSuperfluidAssetsProposal): RemoveSuperfluidAssetsProposalAmino { const obj: any = {}; @@ -298,6 +366,8 @@ export const RemoveSuperfluidAssetsProposal = { }; } }; +GlobalDecoderRegistry.register(RemoveSuperfluidAssetsProposal.typeUrl, RemoveSuperfluidAssetsProposal); +GlobalDecoderRegistry.registerAminoProtoMapping(RemoveSuperfluidAssetsProposal.aminoType, RemoveSuperfluidAssetsProposal.typeUrl); function createBaseUpdateUnpoolWhiteListProposal(): UpdateUnpoolWhiteListProposal { return { $typeUrl: "/osmosis.superfluid.v1beta1.UpdateUnpoolWhiteListProposal", @@ -309,6 +379,16 @@ function createBaseUpdateUnpoolWhiteListProposal(): UpdateUnpoolWhiteListProposa } export const UpdateUnpoolWhiteListProposal = { typeUrl: "/osmosis.superfluid.v1beta1.UpdateUnpoolWhiteListProposal", + aminoType: "osmosis/update-unpool-whitelist", + is(o: any): o is UpdateUnpoolWhiteListProposal { + return o && (o.$typeUrl === UpdateUnpoolWhiteListProposal.typeUrl || typeof o.title === "string" && typeof o.description === "string" && Array.isArray(o.ids) && (!o.ids.length || typeof o.ids[0] === "bigint") && typeof o.isOverwrite === "boolean"); + }, + isSDK(o: any): o is UpdateUnpoolWhiteListProposalSDKType { + return o && (o.$typeUrl === UpdateUnpoolWhiteListProposal.typeUrl || typeof o.title === "string" && typeof o.description === "string" && Array.isArray(o.ids) && (!o.ids.length || typeof o.ids[0] === "bigint") && typeof o.is_overwrite === "boolean"); + }, + isAmino(o: any): o is UpdateUnpoolWhiteListProposalAmino { + return o && (o.$typeUrl === UpdateUnpoolWhiteListProposal.typeUrl || typeof o.title === "string" && typeof o.description === "string" && Array.isArray(o.ids) && (!o.ids.length || typeof o.ids[0] === "bigint") && typeof o.is_overwrite === "boolean"); + }, encode(message: UpdateUnpoolWhiteListProposal, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.title !== "") { writer.uint32(10).string(message.title); @@ -359,6 +439,26 @@ export const UpdateUnpoolWhiteListProposal = { } return message; }, + fromJSON(object: any): UpdateUnpoolWhiteListProposal { + return { + title: isSet(object.title) ? String(object.title) : "", + description: isSet(object.description) ? String(object.description) : "", + ids: Array.isArray(object?.ids) ? object.ids.map((e: any) => BigInt(e.toString())) : [], + isOverwrite: isSet(object.isOverwrite) ? Boolean(object.isOverwrite) : false + }; + }, + toJSON(message: UpdateUnpoolWhiteListProposal): unknown { + const obj: any = {}; + message.title !== undefined && (obj.title = message.title); + message.description !== undefined && (obj.description = message.description); + if (message.ids) { + obj.ids = message.ids.map(e => (e || BigInt(0)).toString()); + } else { + obj.ids = []; + } + message.isOverwrite !== undefined && (obj.isOverwrite = message.isOverwrite); + return obj; + }, fromPartial(object: Partial): UpdateUnpoolWhiteListProposal { const message = createBaseUpdateUnpoolWhiteListProposal(); message.title = object.title ?? ""; @@ -368,12 +468,18 @@ export const UpdateUnpoolWhiteListProposal = { return message; }, fromAmino(object: UpdateUnpoolWhiteListProposalAmino): UpdateUnpoolWhiteListProposal { - return { - title: object.title, - description: object.description, - ids: Array.isArray(object?.ids) ? object.ids.map((e: any) => BigInt(e)) : [], - isOverwrite: object.is_overwrite - }; + const message = createBaseUpdateUnpoolWhiteListProposal(); + if (object.title !== undefined && object.title !== null) { + message.title = object.title; + } + if (object.description !== undefined && object.description !== null) { + message.description = object.description; + } + message.ids = object.ids?.map(e => BigInt(e)) || []; + if (object.is_overwrite !== undefined && object.is_overwrite !== null) { + message.isOverwrite = object.is_overwrite; + } + return message; }, toAmino(message: UpdateUnpoolWhiteListProposal): UpdateUnpoolWhiteListProposalAmino { const obj: any = {}; @@ -408,4 +514,6 @@ export const UpdateUnpoolWhiteListProposal = { value: UpdateUnpoolWhiteListProposal.encode(message).finish() }; } -}; \ No newline at end of file +}; +GlobalDecoderRegistry.register(UpdateUnpoolWhiteListProposal.typeUrl, UpdateUnpoolWhiteListProposal); +GlobalDecoderRegistry.registerAminoProtoMapping(UpdateUnpoolWhiteListProposal.aminoType, UpdateUnpoolWhiteListProposal.typeUrl); \ No newline at end of file diff --git a/packages/osmojs/src/codegen/osmosis/tokenfactory/v1beta1/authorityMetadata.ts b/packages/osmojs/src/codegen/osmosis/tokenfactory/v1beta1/authorityMetadata.ts index 14b8ac9b5..eca732d93 100644 --- a/packages/osmojs/src/codegen/osmosis/tokenfactory/v1beta1/authorityMetadata.ts +++ b/packages/osmojs/src/codegen/osmosis/tokenfactory/v1beta1/authorityMetadata.ts @@ -1,4 +1,6 @@ import { BinaryReader, BinaryWriter } from "../../../binary"; +import { isSet } from "../../../helpers"; +import { GlobalDecoderRegistry } from "../../../registry"; /** * DenomAuthorityMetadata specifies metadata for addresses that have specific * capabilities over a token factory denom. Right now there is only one Admin @@ -19,7 +21,7 @@ export interface DenomAuthorityMetadataProtoMsg { */ export interface DenomAuthorityMetadataAmino { /** Can be empty for no admin, or a valid osmosis address */ - admin: string; + admin?: string; } export interface DenomAuthorityMetadataAminoMsg { type: "osmosis/tokenfactory/denom-authority-metadata"; @@ -40,6 +42,16 @@ function createBaseDenomAuthorityMetadata(): DenomAuthorityMetadata { } export const DenomAuthorityMetadata = { typeUrl: "/osmosis.tokenfactory.v1beta1.DenomAuthorityMetadata", + aminoType: "osmosis/tokenfactory/denom-authority-metadata", + is(o: any): o is DenomAuthorityMetadata { + return o && (o.$typeUrl === DenomAuthorityMetadata.typeUrl || typeof o.admin === "string"); + }, + isSDK(o: any): o is DenomAuthorityMetadataSDKType { + return o && (o.$typeUrl === DenomAuthorityMetadata.typeUrl || typeof o.admin === "string"); + }, + isAmino(o: any): o is DenomAuthorityMetadataAmino { + return o && (o.$typeUrl === DenomAuthorityMetadata.typeUrl || typeof o.admin === "string"); + }, encode(message: DenomAuthorityMetadata, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.admin !== "") { writer.uint32(10).string(message.admin); @@ -63,15 +75,27 @@ export const DenomAuthorityMetadata = { } return message; }, + fromJSON(object: any): DenomAuthorityMetadata { + return { + admin: isSet(object.admin) ? String(object.admin) : "" + }; + }, + toJSON(message: DenomAuthorityMetadata): unknown { + const obj: any = {}; + message.admin !== undefined && (obj.admin = message.admin); + return obj; + }, fromPartial(object: Partial): DenomAuthorityMetadata { const message = createBaseDenomAuthorityMetadata(); message.admin = object.admin ?? ""; return message; }, fromAmino(object: DenomAuthorityMetadataAmino): DenomAuthorityMetadata { - return { - admin: object.admin - }; + const message = createBaseDenomAuthorityMetadata(); + if (object.admin !== undefined && object.admin !== null) { + message.admin = object.admin; + } + return message; }, toAmino(message: DenomAuthorityMetadata): DenomAuthorityMetadataAmino { const obj: any = {}; @@ -99,4 +123,6 @@ export const DenomAuthorityMetadata = { value: DenomAuthorityMetadata.encode(message).finish() }; } -}; \ No newline at end of file +}; +GlobalDecoderRegistry.register(DenomAuthorityMetadata.typeUrl, DenomAuthorityMetadata); +GlobalDecoderRegistry.registerAminoProtoMapping(DenomAuthorityMetadata.aminoType, DenomAuthorityMetadata.typeUrl); \ No newline at end of file diff --git a/packages/osmojs/src/codegen/osmosis/tokenfactory/v1beta1/genesis.ts b/packages/osmojs/src/codegen/osmosis/tokenfactory/v1beta1/genesis.ts index 3ebcb731a..3fb660888 100644 --- a/packages/osmojs/src/codegen/osmosis/tokenfactory/v1beta1/genesis.ts +++ b/packages/osmojs/src/codegen/osmosis/tokenfactory/v1beta1/genesis.ts @@ -1,9 +1,11 @@ import { Params, ParamsAmino, ParamsSDKType } from "./params"; import { DenomAuthorityMetadata, DenomAuthorityMetadataAmino, DenomAuthorityMetadataSDKType } from "./authorityMetadata"; import { BinaryReader, BinaryWriter } from "../../../binary"; +import { isSet } from "../../../helpers"; +import { GlobalDecoderRegistry } from "../../../registry"; /** GenesisState defines the tokenfactory module's genesis state. */ export interface GenesisState { - /** params defines the paramaters of the module. */ + /** params defines the parameters of the module. */ params: Params; factoryDenoms: GenesisDenom[]; } @@ -13,9 +15,9 @@ export interface GenesisStateProtoMsg { } /** GenesisState defines the tokenfactory module's genesis state. */ export interface GenesisStateAmino { - /** params defines the paramaters of the module. */ + /** params defines the parameters of the module. */ params?: ParamsAmino; - factory_denoms: GenesisDenomAmino[]; + factory_denoms?: GenesisDenomAmino[]; } export interface GenesisStateAminoMsg { type: "osmosis/tokenfactory/genesis-state"; @@ -45,7 +47,7 @@ export interface GenesisDenomProtoMsg { * denom's admin. */ export interface GenesisDenomAmino { - denom: string; + denom?: string; authority_metadata?: DenomAuthorityMetadataAmino; } export interface GenesisDenomAminoMsg { @@ -69,6 +71,16 @@ function createBaseGenesisState(): GenesisState { } export const GenesisState = { typeUrl: "/osmosis.tokenfactory.v1beta1.GenesisState", + aminoType: "osmosis/tokenfactory/genesis-state", + is(o: any): o is GenesisState { + return o && (o.$typeUrl === GenesisState.typeUrl || Params.is(o.params) && Array.isArray(o.factoryDenoms) && (!o.factoryDenoms.length || GenesisDenom.is(o.factoryDenoms[0]))); + }, + isSDK(o: any): o is GenesisStateSDKType { + return o && (o.$typeUrl === GenesisState.typeUrl || Params.isSDK(o.params) && Array.isArray(o.factory_denoms) && (!o.factory_denoms.length || GenesisDenom.isSDK(o.factory_denoms[0]))); + }, + isAmino(o: any): o is GenesisStateAmino { + return o && (o.$typeUrl === GenesisState.typeUrl || Params.isAmino(o.params) && Array.isArray(o.factory_denoms) && (!o.factory_denoms.length || GenesisDenom.isAmino(o.factory_denoms[0]))); + }, encode(message: GenesisState, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.params !== undefined) { Params.encode(message.params, writer.uint32(10).fork()).ldelim(); @@ -98,6 +110,22 @@ export const GenesisState = { } return message; }, + fromJSON(object: any): GenesisState { + return { + params: isSet(object.params) ? Params.fromJSON(object.params) : undefined, + factoryDenoms: Array.isArray(object?.factoryDenoms) ? object.factoryDenoms.map((e: any) => GenesisDenom.fromJSON(e)) : [] + }; + }, + toJSON(message: GenesisState): unknown { + const obj: any = {}; + message.params !== undefined && (obj.params = message.params ? Params.toJSON(message.params) : undefined); + if (message.factoryDenoms) { + obj.factoryDenoms = message.factoryDenoms.map(e => e ? GenesisDenom.toJSON(e) : undefined); + } else { + obj.factoryDenoms = []; + } + return obj; + }, fromPartial(object: Partial): GenesisState { const message = createBaseGenesisState(); message.params = object.params !== undefined && object.params !== null ? Params.fromPartial(object.params) : undefined; @@ -105,10 +133,12 @@ export const GenesisState = { return message; }, fromAmino(object: GenesisStateAmino): GenesisState { - return { - params: object?.params ? Params.fromAmino(object.params) : undefined, - factoryDenoms: Array.isArray(object?.factory_denoms) ? object.factory_denoms.map((e: any) => GenesisDenom.fromAmino(e)) : [] - }; + const message = createBaseGenesisState(); + if (object.params !== undefined && object.params !== null) { + message.params = Params.fromAmino(object.params); + } + message.factoryDenoms = object.factory_denoms?.map(e => GenesisDenom.fromAmino(e)) || []; + return message; }, toAmino(message: GenesisState): GenesisStateAmino { const obj: any = {}; @@ -142,6 +172,8 @@ export const GenesisState = { }; } }; +GlobalDecoderRegistry.register(GenesisState.typeUrl, GenesisState); +GlobalDecoderRegistry.registerAminoProtoMapping(GenesisState.aminoType, GenesisState.typeUrl); function createBaseGenesisDenom(): GenesisDenom { return { denom: "", @@ -150,6 +182,16 @@ function createBaseGenesisDenom(): GenesisDenom { } export const GenesisDenom = { typeUrl: "/osmosis.tokenfactory.v1beta1.GenesisDenom", + aminoType: "osmosis/tokenfactory/genesis-denom", + is(o: any): o is GenesisDenom { + return o && (o.$typeUrl === GenesisDenom.typeUrl || typeof o.denom === "string" && DenomAuthorityMetadata.is(o.authorityMetadata)); + }, + isSDK(o: any): o is GenesisDenomSDKType { + return o && (o.$typeUrl === GenesisDenom.typeUrl || typeof o.denom === "string" && DenomAuthorityMetadata.isSDK(o.authority_metadata)); + }, + isAmino(o: any): o is GenesisDenomAmino { + return o && (o.$typeUrl === GenesisDenom.typeUrl || typeof o.denom === "string" && DenomAuthorityMetadata.isAmino(o.authority_metadata)); + }, encode(message: GenesisDenom, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.denom !== "") { writer.uint32(10).string(message.denom); @@ -179,6 +221,18 @@ export const GenesisDenom = { } return message; }, + fromJSON(object: any): GenesisDenom { + return { + denom: isSet(object.denom) ? String(object.denom) : "", + authorityMetadata: isSet(object.authorityMetadata) ? DenomAuthorityMetadata.fromJSON(object.authorityMetadata) : undefined + }; + }, + toJSON(message: GenesisDenom): unknown { + const obj: any = {}; + message.denom !== undefined && (obj.denom = message.denom); + message.authorityMetadata !== undefined && (obj.authorityMetadata = message.authorityMetadata ? DenomAuthorityMetadata.toJSON(message.authorityMetadata) : undefined); + return obj; + }, fromPartial(object: Partial): GenesisDenom { const message = createBaseGenesisDenom(); message.denom = object.denom ?? ""; @@ -186,10 +240,14 @@ export const GenesisDenom = { return message; }, fromAmino(object: GenesisDenomAmino): GenesisDenom { - return { - denom: object.denom, - authorityMetadata: object?.authority_metadata ? DenomAuthorityMetadata.fromAmino(object.authority_metadata) : undefined - }; + const message = createBaseGenesisDenom(); + if (object.denom !== undefined && object.denom !== null) { + message.denom = object.denom; + } + if (object.authority_metadata !== undefined && object.authority_metadata !== null) { + message.authorityMetadata = DenomAuthorityMetadata.fromAmino(object.authority_metadata); + } + return message; }, toAmino(message: GenesisDenom): GenesisDenomAmino { const obj: any = {}; @@ -218,4 +276,6 @@ export const GenesisDenom = { value: GenesisDenom.encode(message).finish() }; } -}; \ No newline at end of file +}; +GlobalDecoderRegistry.register(GenesisDenom.typeUrl, GenesisDenom); +GlobalDecoderRegistry.registerAminoProtoMapping(GenesisDenom.aminoType, GenesisDenom.typeUrl); \ No newline at end of file diff --git a/packages/osmojs/src/codegen/osmosis/tokenfactory/v1beta1/params.ts b/packages/osmojs/src/codegen/osmosis/tokenfactory/v1beta1/params.ts index ad395087e..4c40ed4a7 100644 --- a/packages/osmojs/src/codegen/osmosis/tokenfactory/v1beta1/params.ts +++ b/packages/osmojs/src/codegen/osmosis/tokenfactory/v1beta1/params.ts @@ -1,5 +1,7 @@ import { Coin, CoinAmino, CoinSDKType } from "../../../cosmos/base/v1beta1/coin"; import { BinaryReader, BinaryWriter } from "../../../binary"; +import { isSet } from "../../../helpers"; +import { GlobalDecoderRegistry } from "../../../registry"; /** Params defines the parameters for the tokenfactory module. */ export interface Params { /** @@ -27,14 +29,14 @@ export interface ParamsAmino { * denom. The fee is drawn from the MsgCreateDenom's sender account, and * transferred to the community pool. */ - denom_creation_fee: CoinAmino[]; + denom_creation_fee?: CoinAmino[]; /** * DenomCreationGasConsume defines the gas cost for creating a new denom. * This is intended as a spam deterrence mechanism. * * See: https://github.com/CosmWasm/token-factory/issues/11 */ - denom_creation_gas_consume: string; + denom_creation_gas_consume?: string; } export interface ParamsAminoMsg { type: "osmosis/tokenfactory/params"; @@ -53,6 +55,16 @@ function createBaseParams(): Params { } export const Params = { typeUrl: "/osmosis.tokenfactory.v1beta1.Params", + aminoType: "osmosis/tokenfactory/params", + is(o: any): o is Params { + return o && (o.$typeUrl === Params.typeUrl || Array.isArray(o.denomCreationFee) && (!o.denomCreationFee.length || Coin.is(o.denomCreationFee[0]))); + }, + isSDK(o: any): o is ParamsSDKType { + return o && (o.$typeUrl === Params.typeUrl || Array.isArray(o.denom_creation_fee) && (!o.denom_creation_fee.length || Coin.isSDK(o.denom_creation_fee[0]))); + }, + isAmino(o: any): o is ParamsAmino { + return o && (o.$typeUrl === Params.typeUrl || Array.isArray(o.denom_creation_fee) && (!o.denom_creation_fee.length || Coin.isAmino(o.denom_creation_fee[0]))); + }, encode(message: Params, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.denomCreationFee) { Coin.encode(v!, writer.uint32(10).fork()).ldelim(); @@ -82,6 +94,24 @@ export const Params = { } return message; }, + fromJSON(object: any): Params { + return { + denomCreationFee: Array.isArray(object?.denomCreationFee) ? object.denomCreationFee.map((e: any) => Coin.fromJSON(e)) : [], + denomCreationGasConsume: isSet(object.denomCreationGasConsume) ? BigInt(object.denomCreationGasConsume.toString()) : undefined + }; + }, + toJSON(message: Params): unknown { + const obj: any = {}; + if (message.denomCreationFee) { + obj.denomCreationFee = message.denomCreationFee.map(e => e ? Coin.toJSON(e) : undefined); + } else { + obj.denomCreationFee = []; + } + if (message.denomCreationGasConsume !== undefined) { + obj.denomCreationGasConsume = message.denomCreationGasConsume.toString(); + } + return obj; + }, fromPartial(object: Partial): Params { const message = createBaseParams(); message.denomCreationFee = object.denomCreationFee?.map(e => Coin.fromPartial(e)) || []; @@ -89,10 +119,12 @@ export const Params = { return message; }, fromAmino(object: ParamsAmino): Params { - return { - denomCreationFee: Array.isArray(object?.denom_creation_fee) ? object.denom_creation_fee.map((e: any) => Coin.fromAmino(e)) : [], - denomCreationGasConsume: object?.denom_creation_gas_consume ? BigInt(object.denom_creation_gas_consume) : undefined - }; + const message = createBaseParams(); + message.denomCreationFee = object.denom_creation_fee?.map(e => Coin.fromAmino(e)) || []; + if (object.denom_creation_gas_consume !== undefined && object.denom_creation_gas_consume !== null) { + message.denomCreationGasConsume = BigInt(object.denom_creation_gas_consume); + } + return message; }, toAmino(message: Params): ParamsAmino { const obj: any = {}; @@ -125,4 +157,6 @@ export const Params = { value: Params.encode(message).finish() }; } -}; \ No newline at end of file +}; +GlobalDecoderRegistry.register(Params.typeUrl, Params); +GlobalDecoderRegistry.registerAminoProtoMapping(Params.aminoType, Params.typeUrl); \ No newline at end of file diff --git a/packages/osmojs/src/codegen/osmosis/tokenfactory/v1beta1/query.lcd.ts b/packages/osmojs/src/codegen/osmosis/tokenfactory/v1beta1/query.lcd.ts index 45d81527e..3b278af95 100644 --- a/packages/osmojs/src/codegen/osmosis/tokenfactory/v1beta1/query.lcd.ts +++ b/packages/osmojs/src/codegen/osmosis/tokenfactory/v1beta1/query.lcd.ts @@ -1,5 +1,5 @@ import { LCDClient } from "@cosmology/lcd"; -import { QueryParamsRequest, QueryParamsResponseSDKType, QueryDenomAuthorityMetadataRequest, QueryDenomAuthorityMetadataResponseSDKType, QueryDenomsFromCreatorRequest, QueryDenomsFromCreatorResponseSDKType } from "./query"; +import { QueryParamsRequest, QueryParamsResponseSDKType, QueryDenomAuthorityMetadataRequest, QueryDenomAuthorityMetadataResponseSDKType, QueryDenomsFromCreatorRequest, QueryDenomsFromCreatorResponseSDKType, QueryBeforeSendHookAddressRequest, QueryBeforeSendHookAddressResponseSDKType } from "./query"; export class LCDQueryClient { req: LCDClient; constructor({ @@ -11,6 +11,7 @@ export class LCDQueryClient { this.params = this.params.bind(this); this.denomAuthorityMetadata = this.denomAuthorityMetadata.bind(this); this.denomsFromCreator = this.denomsFromCreator.bind(this); + this.beforeSendHookAddress = this.beforeSendHookAddress.bind(this); } /* Params defines a gRPC query method that returns the tokenfactory module's parameters. */ @@ -30,4 +31,10 @@ export class LCDQueryClient { const endpoint = `osmosis/tokenfactory/v1beta1/denoms_from_creator/${params.creator}`; return await this.req.get(endpoint); } + /* BeforeSendHookAddress defines a gRPC query method for + getting the address registered for the before send hook. */ + async beforeSendHookAddress(params: QueryBeforeSendHookAddressRequest): Promise { + const endpoint = `osmosis/tokenfactory/v1beta1/denoms/${params.denom}/before_send_hook`; + return await this.req.get(endpoint); + } } \ No newline at end of file diff --git a/packages/osmojs/src/codegen/osmosis/tokenfactory/v1beta1/query.rpc.Query.ts b/packages/osmojs/src/codegen/osmosis/tokenfactory/v1beta1/query.rpc.Query.ts index 26a7ecd0f..2d908dbf7 100644 --- a/packages/osmojs/src/codegen/osmosis/tokenfactory/v1beta1/query.rpc.Query.ts +++ b/packages/osmojs/src/codegen/osmosis/tokenfactory/v1beta1/query.rpc.Query.ts @@ -1,7 +1,7 @@ import { Rpc } from "../../../helpers"; import { BinaryReader } from "../../../binary"; import { QueryClient, createProtobufRpcClient } from "@cosmjs/stargate"; -import { QueryParamsRequest, QueryParamsResponse, QueryDenomAuthorityMetadataRequest, QueryDenomAuthorityMetadataResponse, QueryDenomsFromCreatorRequest, QueryDenomsFromCreatorResponse } from "./query"; +import { QueryParamsRequest, QueryParamsResponse, QueryDenomAuthorityMetadataRequest, QueryDenomAuthorityMetadataResponse, QueryDenomsFromCreatorRequest, QueryDenomsFromCreatorResponse, QueryBeforeSendHookAddressRequest, QueryBeforeSendHookAddressResponse } from "./query"; /** Query defines the gRPC querier service. */ export interface Query { /** @@ -19,6 +19,11 @@ export interface Query { * denominations created by a specific admin/creator. */ denomsFromCreator(request: QueryDenomsFromCreatorRequest): Promise; + /** + * BeforeSendHookAddress defines a gRPC query method for + * getting the address registered for the before send hook. + */ + beforeSendHookAddress(request: QueryBeforeSendHookAddressRequest): Promise; } export class QueryClientImpl implements Query { private readonly rpc: Rpc; @@ -27,6 +32,7 @@ export class QueryClientImpl implements Query { this.params = this.params.bind(this); this.denomAuthorityMetadata = this.denomAuthorityMetadata.bind(this); this.denomsFromCreator = this.denomsFromCreator.bind(this); + this.beforeSendHookAddress = this.beforeSendHookAddress.bind(this); } params(request: QueryParamsRequest = {}): Promise { const data = QueryParamsRequest.encode(request).finish(); @@ -43,6 +49,11 @@ export class QueryClientImpl implements Query { const promise = this.rpc.request("osmosis.tokenfactory.v1beta1.Query", "DenomsFromCreator", data); return promise.then(data => QueryDenomsFromCreatorResponse.decode(new BinaryReader(data))); } + beforeSendHookAddress(request: QueryBeforeSendHookAddressRequest): Promise { + const data = QueryBeforeSendHookAddressRequest.encode(request).finish(); + const promise = this.rpc.request("osmosis.tokenfactory.v1beta1.Query", "BeforeSendHookAddress", data); + return promise.then(data => QueryBeforeSendHookAddressResponse.decode(new BinaryReader(data))); + } } export const createRpcQueryExtension = (base: QueryClient) => { const rpc = createProtobufRpcClient(base); @@ -56,6 +67,9 @@ export const createRpcQueryExtension = (base: QueryClient) => { }, denomsFromCreator(request: QueryDenomsFromCreatorRequest): Promise { return queryService.denomsFromCreator(request); + }, + beforeSendHookAddress(request: QueryBeforeSendHookAddressRequest): Promise { + return queryService.beforeSendHookAddress(request); } }; }; \ No newline at end of file diff --git a/packages/osmojs/src/codegen/osmosis/tokenfactory/v1beta1/query.ts b/packages/osmojs/src/codegen/osmosis/tokenfactory/v1beta1/query.ts index b699f367d..b6f0d720d 100644 --- a/packages/osmojs/src/codegen/osmosis/tokenfactory/v1beta1/query.ts +++ b/packages/osmojs/src/codegen/osmosis/tokenfactory/v1beta1/query.ts @@ -1,6 +1,8 @@ import { Params, ParamsAmino, ParamsSDKType } from "./params"; import { DenomAuthorityMetadata, DenomAuthorityMetadataAmino, DenomAuthorityMetadataSDKType } from "./authorityMetadata"; import { BinaryReader, BinaryWriter } from "../../../binary"; +import { GlobalDecoderRegistry } from "../../../registry"; +import { isSet } from "../../../helpers"; /** QueryParamsRequest is the request type for the Query/Params RPC method. */ export interface QueryParamsRequest {} export interface QueryParamsRequestProtoMsg { @@ -53,7 +55,7 @@ export interface QueryDenomAuthorityMetadataRequestProtoMsg { * DenomAuthorityMetadata gRPC query. */ export interface QueryDenomAuthorityMetadataRequestAmino { - denom: string; + denom?: string; } export interface QueryDenomAuthorityMetadataRequestAminoMsg { type: "osmosis/tokenfactory/query-denom-authority-metadata-request"; @@ -111,7 +113,7 @@ export interface QueryDenomsFromCreatorRequestProtoMsg { * DenomsFromCreator gRPC query. */ export interface QueryDenomsFromCreatorRequestAmino { - creator: string; + creator?: string; } export interface QueryDenomsFromCreatorRequestAminoMsg { type: "osmosis/tokenfactory/query-denoms-from-creator-request"; @@ -140,7 +142,7 @@ export interface QueryDenomsFromCreatorResponseProtoMsg { * DenomsFromCreator gRPC query. */ export interface QueryDenomsFromCreatorResponseAmino { - denoms: string[]; + denoms?: string[]; } export interface QueryDenomsFromCreatorResponseAminoMsg { type: "osmosis/tokenfactory/query-denoms-from-creator-response"; @@ -153,11 +155,67 @@ export interface QueryDenomsFromCreatorResponseAminoMsg { export interface QueryDenomsFromCreatorResponseSDKType { denoms: string[]; } +export interface QueryBeforeSendHookAddressRequest { + denom: string; +} +export interface QueryBeforeSendHookAddressRequestProtoMsg { + typeUrl: "/osmosis.tokenfactory.v1beta1.QueryBeforeSendHookAddressRequest"; + value: Uint8Array; +} +export interface QueryBeforeSendHookAddressRequestAmino { + denom?: string; +} +export interface QueryBeforeSendHookAddressRequestAminoMsg { + type: "osmosis/tokenfactory/query-before-send-hook-address-request"; + value: QueryBeforeSendHookAddressRequestAmino; +} +export interface QueryBeforeSendHookAddressRequestSDKType { + denom: string; +} +/** + * QueryBeforeSendHookAddressResponse defines the response structure for the + * DenomBeforeSendHook gRPC query. + */ +export interface QueryBeforeSendHookAddressResponse { + cosmwasmAddress: string; +} +export interface QueryBeforeSendHookAddressResponseProtoMsg { + typeUrl: "/osmosis.tokenfactory.v1beta1.QueryBeforeSendHookAddressResponse"; + value: Uint8Array; +} +/** + * QueryBeforeSendHookAddressResponse defines the response structure for the + * DenomBeforeSendHook gRPC query. + */ +export interface QueryBeforeSendHookAddressResponseAmino { + cosmwasm_address?: string; +} +export interface QueryBeforeSendHookAddressResponseAminoMsg { + type: "osmosis/tokenfactory/query-before-send-hook-address-response"; + value: QueryBeforeSendHookAddressResponseAmino; +} +/** + * QueryBeforeSendHookAddressResponse defines the response structure for the + * DenomBeforeSendHook gRPC query. + */ +export interface QueryBeforeSendHookAddressResponseSDKType { + cosmwasm_address: string; +} function createBaseQueryParamsRequest(): QueryParamsRequest { return {}; } export const QueryParamsRequest = { typeUrl: "/osmosis.tokenfactory.v1beta1.QueryParamsRequest", + aminoType: "osmosis/tokenfactory/query-params-request", + is(o: any): o is QueryParamsRequest { + return o && o.$typeUrl === QueryParamsRequest.typeUrl; + }, + isSDK(o: any): o is QueryParamsRequestSDKType { + return o && o.$typeUrl === QueryParamsRequest.typeUrl; + }, + isAmino(o: any): o is QueryParamsRequestAmino { + return o && o.$typeUrl === QueryParamsRequest.typeUrl; + }, encode(_: QueryParamsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, @@ -175,12 +233,20 @@ export const QueryParamsRequest = { } return message; }, + fromJSON(_: any): QueryParamsRequest { + return {}; + }, + toJSON(_: QueryParamsRequest): unknown { + const obj: any = {}; + return obj; + }, fromPartial(_: Partial): QueryParamsRequest { const message = createBaseQueryParamsRequest(); return message; }, fromAmino(_: QueryParamsRequestAmino): QueryParamsRequest { - return {}; + const message = createBaseQueryParamsRequest(); + return message; }, toAmino(_: QueryParamsRequest): QueryParamsRequestAmino { const obj: any = {}; @@ -208,6 +274,8 @@ export const QueryParamsRequest = { }; } }; +GlobalDecoderRegistry.register(QueryParamsRequest.typeUrl, QueryParamsRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryParamsRequest.aminoType, QueryParamsRequest.typeUrl); function createBaseQueryParamsResponse(): QueryParamsResponse { return { params: Params.fromPartial({}) @@ -215,6 +283,16 @@ function createBaseQueryParamsResponse(): QueryParamsResponse { } export const QueryParamsResponse = { typeUrl: "/osmosis.tokenfactory.v1beta1.QueryParamsResponse", + aminoType: "osmosis/tokenfactory/query-params-response", + is(o: any): o is QueryParamsResponse { + return o && (o.$typeUrl === QueryParamsResponse.typeUrl || Params.is(o.params)); + }, + isSDK(o: any): o is QueryParamsResponseSDKType { + return o && (o.$typeUrl === QueryParamsResponse.typeUrl || Params.isSDK(o.params)); + }, + isAmino(o: any): o is QueryParamsResponseAmino { + return o && (o.$typeUrl === QueryParamsResponse.typeUrl || Params.isAmino(o.params)); + }, encode(message: QueryParamsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.params !== undefined) { Params.encode(message.params, writer.uint32(10).fork()).ldelim(); @@ -238,15 +316,27 @@ export const QueryParamsResponse = { } return message; }, + fromJSON(object: any): QueryParamsResponse { + 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; + }, fromPartial(object: Partial): QueryParamsResponse { const message = createBaseQueryParamsResponse(); message.params = object.params !== undefined && object.params !== null ? Params.fromPartial(object.params) : undefined; return message; }, fromAmino(object: QueryParamsResponseAmino): QueryParamsResponse { - return { - params: object?.params ? Params.fromAmino(object.params) : undefined - }; + const message = createBaseQueryParamsResponse(); + if (object.params !== undefined && object.params !== null) { + message.params = Params.fromAmino(object.params); + } + return message; }, toAmino(message: QueryParamsResponse): QueryParamsResponseAmino { const obj: any = {}; @@ -275,6 +365,8 @@ export const QueryParamsResponse = { }; } }; +GlobalDecoderRegistry.register(QueryParamsResponse.typeUrl, QueryParamsResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryParamsResponse.aminoType, QueryParamsResponse.typeUrl); function createBaseQueryDenomAuthorityMetadataRequest(): QueryDenomAuthorityMetadataRequest { return { denom: "" @@ -282,6 +374,16 @@ function createBaseQueryDenomAuthorityMetadataRequest(): QueryDenomAuthorityMeta } export const QueryDenomAuthorityMetadataRequest = { typeUrl: "/osmosis.tokenfactory.v1beta1.QueryDenomAuthorityMetadataRequest", + aminoType: "osmosis/tokenfactory/query-denom-authority-metadata-request", + is(o: any): o is QueryDenomAuthorityMetadataRequest { + return o && (o.$typeUrl === QueryDenomAuthorityMetadataRequest.typeUrl || typeof o.denom === "string"); + }, + isSDK(o: any): o is QueryDenomAuthorityMetadataRequestSDKType { + return o && (o.$typeUrl === QueryDenomAuthorityMetadataRequest.typeUrl || typeof o.denom === "string"); + }, + isAmino(o: any): o is QueryDenomAuthorityMetadataRequestAmino { + return o && (o.$typeUrl === QueryDenomAuthorityMetadataRequest.typeUrl || typeof o.denom === "string"); + }, encode(message: QueryDenomAuthorityMetadataRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.denom !== "") { writer.uint32(10).string(message.denom); @@ -305,15 +407,27 @@ export const QueryDenomAuthorityMetadataRequest = { } return message; }, + fromJSON(object: any): QueryDenomAuthorityMetadataRequest { + return { + denom: isSet(object.denom) ? String(object.denom) : "" + }; + }, + toJSON(message: QueryDenomAuthorityMetadataRequest): unknown { + const obj: any = {}; + message.denom !== undefined && (obj.denom = message.denom); + return obj; + }, fromPartial(object: Partial): QueryDenomAuthorityMetadataRequest { const message = createBaseQueryDenomAuthorityMetadataRequest(); message.denom = object.denom ?? ""; return message; }, fromAmino(object: QueryDenomAuthorityMetadataRequestAmino): QueryDenomAuthorityMetadataRequest { - return { - denom: object.denom - }; + const message = createBaseQueryDenomAuthorityMetadataRequest(); + if (object.denom !== undefined && object.denom !== null) { + message.denom = object.denom; + } + return message; }, toAmino(message: QueryDenomAuthorityMetadataRequest): QueryDenomAuthorityMetadataRequestAmino { const obj: any = {}; @@ -342,6 +456,8 @@ export const QueryDenomAuthorityMetadataRequest = { }; } }; +GlobalDecoderRegistry.register(QueryDenomAuthorityMetadataRequest.typeUrl, QueryDenomAuthorityMetadataRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryDenomAuthorityMetadataRequest.aminoType, QueryDenomAuthorityMetadataRequest.typeUrl); function createBaseQueryDenomAuthorityMetadataResponse(): QueryDenomAuthorityMetadataResponse { return { authorityMetadata: DenomAuthorityMetadata.fromPartial({}) @@ -349,6 +465,16 @@ function createBaseQueryDenomAuthorityMetadataResponse(): QueryDenomAuthorityMet } export const QueryDenomAuthorityMetadataResponse = { typeUrl: "/osmosis.tokenfactory.v1beta1.QueryDenomAuthorityMetadataResponse", + aminoType: "osmosis/tokenfactory/query-denom-authority-metadata-response", + is(o: any): o is QueryDenomAuthorityMetadataResponse { + return o && (o.$typeUrl === QueryDenomAuthorityMetadataResponse.typeUrl || DenomAuthorityMetadata.is(o.authorityMetadata)); + }, + isSDK(o: any): o is QueryDenomAuthorityMetadataResponseSDKType { + return o && (o.$typeUrl === QueryDenomAuthorityMetadataResponse.typeUrl || DenomAuthorityMetadata.isSDK(o.authority_metadata)); + }, + isAmino(o: any): o is QueryDenomAuthorityMetadataResponseAmino { + return o && (o.$typeUrl === QueryDenomAuthorityMetadataResponse.typeUrl || DenomAuthorityMetadata.isAmino(o.authority_metadata)); + }, encode(message: QueryDenomAuthorityMetadataResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.authorityMetadata !== undefined) { DenomAuthorityMetadata.encode(message.authorityMetadata, writer.uint32(10).fork()).ldelim(); @@ -372,15 +498,27 @@ export const QueryDenomAuthorityMetadataResponse = { } return message; }, + fromJSON(object: any): QueryDenomAuthorityMetadataResponse { + return { + authorityMetadata: isSet(object.authorityMetadata) ? DenomAuthorityMetadata.fromJSON(object.authorityMetadata) : undefined + }; + }, + toJSON(message: QueryDenomAuthorityMetadataResponse): unknown { + const obj: any = {}; + message.authorityMetadata !== undefined && (obj.authorityMetadata = message.authorityMetadata ? DenomAuthorityMetadata.toJSON(message.authorityMetadata) : undefined); + return obj; + }, fromPartial(object: Partial): QueryDenomAuthorityMetadataResponse { const message = createBaseQueryDenomAuthorityMetadataResponse(); message.authorityMetadata = object.authorityMetadata !== undefined && object.authorityMetadata !== null ? DenomAuthorityMetadata.fromPartial(object.authorityMetadata) : undefined; return message; }, fromAmino(object: QueryDenomAuthorityMetadataResponseAmino): QueryDenomAuthorityMetadataResponse { - return { - authorityMetadata: object?.authority_metadata ? DenomAuthorityMetadata.fromAmino(object.authority_metadata) : undefined - }; + const message = createBaseQueryDenomAuthorityMetadataResponse(); + if (object.authority_metadata !== undefined && object.authority_metadata !== null) { + message.authorityMetadata = DenomAuthorityMetadata.fromAmino(object.authority_metadata); + } + return message; }, toAmino(message: QueryDenomAuthorityMetadataResponse): QueryDenomAuthorityMetadataResponseAmino { const obj: any = {}; @@ -409,6 +547,8 @@ export const QueryDenomAuthorityMetadataResponse = { }; } }; +GlobalDecoderRegistry.register(QueryDenomAuthorityMetadataResponse.typeUrl, QueryDenomAuthorityMetadataResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryDenomAuthorityMetadataResponse.aminoType, QueryDenomAuthorityMetadataResponse.typeUrl); function createBaseQueryDenomsFromCreatorRequest(): QueryDenomsFromCreatorRequest { return { creator: "" @@ -416,6 +556,16 @@ function createBaseQueryDenomsFromCreatorRequest(): QueryDenomsFromCreatorReques } export const QueryDenomsFromCreatorRequest = { typeUrl: "/osmosis.tokenfactory.v1beta1.QueryDenomsFromCreatorRequest", + aminoType: "osmosis/tokenfactory/query-denoms-from-creator-request", + is(o: any): o is QueryDenomsFromCreatorRequest { + return o && (o.$typeUrl === QueryDenomsFromCreatorRequest.typeUrl || typeof o.creator === "string"); + }, + isSDK(o: any): o is QueryDenomsFromCreatorRequestSDKType { + return o && (o.$typeUrl === QueryDenomsFromCreatorRequest.typeUrl || typeof o.creator === "string"); + }, + isAmino(o: any): o is QueryDenomsFromCreatorRequestAmino { + return o && (o.$typeUrl === QueryDenomsFromCreatorRequest.typeUrl || typeof o.creator === "string"); + }, encode(message: QueryDenomsFromCreatorRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.creator !== "") { writer.uint32(10).string(message.creator); @@ -439,15 +589,27 @@ export const QueryDenomsFromCreatorRequest = { } return message; }, + fromJSON(object: any): QueryDenomsFromCreatorRequest { + return { + creator: isSet(object.creator) ? String(object.creator) : "" + }; + }, + toJSON(message: QueryDenomsFromCreatorRequest): unknown { + const obj: any = {}; + message.creator !== undefined && (obj.creator = message.creator); + return obj; + }, fromPartial(object: Partial): QueryDenomsFromCreatorRequest { const message = createBaseQueryDenomsFromCreatorRequest(); message.creator = object.creator ?? ""; return message; }, fromAmino(object: QueryDenomsFromCreatorRequestAmino): QueryDenomsFromCreatorRequest { - return { - creator: object.creator - }; + const message = createBaseQueryDenomsFromCreatorRequest(); + if (object.creator !== undefined && object.creator !== null) { + message.creator = object.creator; + } + return message; }, toAmino(message: QueryDenomsFromCreatorRequest): QueryDenomsFromCreatorRequestAmino { const obj: any = {}; @@ -476,6 +638,8 @@ export const QueryDenomsFromCreatorRequest = { }; } }; +GlobalDecoderRegistry.register(QueryDenomsFromCreatorRequest.typeUrl, QueryDenomsFromCreatorRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryDenomsFromCreatorRequest.aminoType, QueryDenomsFromCreatorRequest.typeUrl); function createBaseQueryDenomsFromCreatorResponse(): QueryDenomsFromCreatorResponse { return { denoms: [] @@ -483,6 +647,16 @@ function createBaseQueryDenomsFromCreatorResponse(): QueryDenomsFromCreatorRespo } export const QueryDenomsFromCreatorResponse = { typeUrl: "/osmosis.tokenfactory.v1beta1.QueryDenomsFromCreatorResponse", + aminoType: "osmosis/tokenfactory/query-denoms-from-creator-response", + is(o: any): o is QueryDenomsFromCreatorResponse { + return o && (o.$typeUrl === QueryDenomsFromCreatorResponse.typeUrl || Array.isArray(o.denoms) && (!o.denoms.length || typeof o.denoms[0] === "string")); + }, + isSDK(o: any): o is QueryDenomsFromCreatorResponseSDKType { + return o && (o.$typeUrl === QueryDenomsFromCreatorResponse.typeUrl || Array.isArray(o.denoms) && (!o.denoms.length || typeof o.denoms[0] === "string")); + }, + isAmino(o: any): o is QueryDenomsFromCreatorResponseAmino { + return o && (o.$typeUrl === QueryDenomsFromCreatorResponse.typeUrl || Array.isArray(o.denoms) && (!o.denoms.length || typeof o.denoms[0] === "string")); + }, encode(message: QueryDenomsFromCreatorResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.denoms) { writer.uint32(10).string(v!); @@ -506,15 +680,29 @@ export const QueryDenomsFromCreatorResponse = { } return message; }, + fromJSON(object: any): QueryDenomsFromCreatorResponse { + return { + denoms: Array.isArray(object?.denoms) ? object.denoms.map((e: any) => String(e)) : [] + }; + }, + toJSON(message: QueryDenomsFromCreatorResponse): unknown { + const obj: any = {}; + if (message.denoms) { + obj.denoms = message.denoms.map(e => e); + } else { + obj.denoms = []; + } + return obj; + }, fromPartial(object: Partial): QueryDenomsFromCreatorResponse { const message = createBaseQueryDenomsFromCreatorResponse(); message.denoms = object.denoms?.map(e => e) || []; return message; }, fromAmino(object: QueryDenomsFromCreatorResponseAmino): QueryDenomsFromCreatorResponse { - return { - denoms: Array.isArray(object?.denoms) ? object.denoms.map((e: any) => e) : [] - }; + const message = createBaseQueryDenomsFromCreatorResponse(); + message.denoms = object.denoms?.map(e => e) || []; + return message; }, toAmino(message: QueryDenomsFromCreatorResponse): QueryDenomsFromCreatorResponseAmino { const obj: any = {}; @@ -546,4 +734,188 @@ export const QueryDenomsFromCreatorResponse = { value: QueryDenomsFromCreatorResponse.encode(message).finish() }; } -}; \ No newline at end of file +}; +GlobalDecoderRegistry.register(QueryDenomsFromCreatorResponse.typeUrl, QueryDenomsFromCreatorResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryDenomsFromCreatorResponse.aminoType, QueryDenomsFromCreatorResponse.typeUrl); +function createBaseQueryBeforeSendHookAddressRequest(): QueryBeforeSendHookAddressRequest { + return { + denom: "" + }; +} +export const QueryBeforeSendHookAddressRequest = { + typeUrl: "/osmosis.tokenfactory.v1beta1.QueryBeforeSendHookAddressRequest", + aminoType: "osmosis/tokenfactory/query-before-send-hook-address-request", + is(o: any): o is QueryBeforeSendHookAddressRequest { + return o && (o.$typeUrl === QueryBeforeSendHookAddressRequest.typeUrl || typeof o.denom === "string"); + }, + isSDK(o: any): o is QueryBeforeSendHookAddressRequestSDKType { + return o && (o.$typeUrl === QueryBeforeSendHookAddressRequest.typeUrl || typeof o.denom === "string"); + }, + isAmino(o: any): o is QueryBeforeSendHookAddressRequestAmino { + return o && (o.$typeUrl === QueryBeforeSendHookAddressRequest.typeUrl || typeof o.denom === "string"); + }, + encode(message: QueryBeforeSendHookAddressRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.denom !== "") { + writer.uint32(10).string(message.denom); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryBeforeSendHookAddressRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryBeforeSendHookAddressRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.denom = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): QueryBeforeSendHookAddressRequest { + return { + denom: isSet(object.denom) ? String(object.denom) : "" + }; + }, + toJSON(message: QueryBeforeSendHookAddressRequest): unknown { + const obj: any = {}; + message.denom !== undefined && (obj.denom = message.denom); + return obj; + }, + fromPartial(object: Partial): QueryBeforeSendHookAddressRequest { + const message = createBaseQueryBeforeSendHookAddressRequest(); + message.denom = object.denom ?? ""; + return message; + }, + fromAmino(object: QueryBeforeSendHookAddressRequestAmino): QueryBeforeSendHookAddressRequest { + const message = createBaseQueryBeforeSendHookAddressRequest(); + if (object.denom !== undefined && object.denom !== null) { + message.denom = object.denom; + } + return message; + }, + toAmino(message: QueryBeforeSendHookAddressRequest): QueryBeforeSendHookAddressRequestAmino { + const obj: any = {}; + obj.denom = message.denom; + return obj; + }, + fromAminoMsg(object: QueryBeforeSendHookAddressRequestAminoMsg): QueryBeforeSendHookAddressRequest { + return QueryBeforeSendHookAddressRequest.fromAmino(object.value); + }, + toAminoMsg(message: QueryBeforeSendHookAddressRequest): QueryBeforeSendHookAddressRequestAminoMsg { + return { + type: "osmosis/tokenfactory/query-before-send-hook-address-request", + value: QueryBeforeSendHookAddressRequest.toAmino(message) + }; + }, + fromProtoMsg(message: QueryBeforeSendHookAddressRequestProtoMsg): QueryBeforeSendHookAddressRequest { + return QueryBeforeSendHookAddressRequest.decode(message.value); + }, + toProto(message: QueryBeforeSendHookAddressRequest): Uint8Array { + return QueryBeforeSendHookAddressRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryBeforeSendHookAddressRequest): QueryBeforeSendHookAddressRequestProtoMsg { + return { + typeUrl: "/osmosis.tokenfactory.v1beta1.QueryBeforeSendHookAddressRequest", + value: QueryBeforeSendHookAddressRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryBeforeSendHookAddressRequest.typeUrl, QueryBeforeSendHookAddressRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryBeforeSendHookAddressRequest.aminoType, QueryBeforeSendHookAddressRequest.typeUrl); +function createBaseQueryBeforeSendHookAddressResponse(): QueryBeforeSendHookAddressResponse { + return { + cosmwasmAddress: "" + }; +} +export const QueryBeforeSendHookAddressResponse = { + typeUrl: "/osmosis.tokenfactory.v1beta1.QueryBeforeSendHookAddressResponse", + aminoType: "osmosis/tokenfactory/query-before-send-hook-address-response", + is(o: any): o is QueryBeforeSendHookAddressResponse { + return o && (o.$typeUrl === QueryBeforeSendHookAddressResponse.typeUrl || typeof o.cosmwasmAddress === "string"); + }, + isSDK(o: any): o is QueryBeforeSendHookAddressResponseSDKType { + return o && (o.$typeUrl === QueryBeforeSendHookAddressResponse.typeUrl || typeof o.cosmwasm_address === "string"); + }, + isAmino(o: any): o is QueryBeforeSendHookAddressResponseAmino { + return o && (o.$typeUrl === QueryBeforeSendHookAddressResponse.typeUrl || typeof o.cosmwasm_address === "string"); + }, + encode(message: QueryBeforeSendHookAddressResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.cosmwasmAddress !== "") { + writer.uint32(10).string(message.cosmwasmAddress); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryBeforeSendHookAddressResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryBeforeSendHookAddressResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.cosmwasmAddress = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): QueryBeforeSendHookAddressResponse { + return { + cosmwasmAddress: isSet(object.cosmwasmAddress) ? String(object.cosmwasmAddress) : "" + }; + }, + toJSON(message: QueryBeforeSendHookAddressResponse): unknown { + const obj: any = {}; + message.cosmwasmAddress !== undefined && (obj.cosmwasmAddress = message.cosmwasmAddress); + return obj; + }, + fromPartial(object: Partial): QueryBeforeSendHookAddressResponse { + const message = createBaseQueryBeforeSendHookAddressResponse(); + message.cosmwasmAddress = object.cosmwasmAddress ?? ""; + return message; + }, + fromAmino(object: QueryBeforeSendHookAddressResponseAmino): QueryBeforeSendHookAddressResponse { + const message = createBaseQueryBeforeSendHookAddressResponse(); + if (object.cosmwasm_address !== undefined && object.cosmwasm_address !== null) { + message.cosmwasmAddress = object.cosmwasm_address; + } + return message; + }, + toAmino(message: QueryBeforeSendHookAddressResponse): QueryBeforeSendHookAddressResponseAmino { + const obj: any = {}; + obj.cosmwasm_address = message.cosmwasmAddress; + return obj; + }, + fromAminoMsg(object: QueryBeforeSendHookAddressResponseAminoMsg): QueryBeforeSendHookAddressResponse { + return QueryBeforeSendHookAddressResponse.fromAmino(object.value); + }, + toAminoMsg(message: QueryBeforeSendHookAddressResponse): QueryBeforeSendHookAddressResponseAminoMsg { + return { + type: "osmosis/tokenfactory/query-before-send-hook-address-response", + value: QueryBeforeSendHookAddressResponse.toAmino(message) + }; + }, + fromProtoMsg(message: QueryBeforeSendHookAddressResponseProtoMsg): QueryBeforeSendHookAddressResponse { + return QueryBeforeSendHookAddressResponse.decode(message.value); + }, + toProto(message: QueryBeforeSendHookAddressResponse): Uint8Array { + return QueryBeforeSendHookAddressResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryBeforeSendHookAddressResponse): QueryBeforeSendHookAddressResponseProtoMsg { + return { + typeUrl: "/osmosis.tokenfactory.v1beta1.QueryBeforeSendHookAddressResponse", + value: QueryBeforeSendHookAddressResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryBeforeSendHookAddressResponse.typeUrl, QueryBeforeSendHookAddressResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryBeforeSendHookAddressResponse.aminoType, QueryBeforeSendHookAddressResponse.typeUrl); \ No newline at end of file diff --git a/packages/osmojs/src/codegen/osmosis/tokenfactory/v1beta1/tx.amino.ts b/packages/osmojs/src/codegen/osmosis/tokenfactory/v1beta1/tx.amino.ts index fba1678c3..e0e58097c 100644 --- a/packages/osmojs/src/codegen/osmosis/tokenfactory/v1beta1/tx.amino.ts +++ b/packages/osmojs/src/codegen/osmosis/tokenfactory/v1beta1/tx.amino.ts @@ -1,5 +1,5 @@ //@ts-nocheck -import { MsgCreateDenom, MsgMint, MsgBurn, MsgChangeAdmin, MsgSetDenomMetadata, MsgForceTransfer } from "./tx"; +import { MsgCreateDenom, MsgMint, MsgBurn, MsgChangeAdmin, MsgSetDenomMetadata, MsgSetBeforeSendHook, MsgForceTransfer } from "./tx"; export const AminoConverter = { "/osmosis.tokenfactory.v1beta1.MsgCreateDenom": { aminoType: "osmosis/tokenfactory/create-denom", @@ -26,6 +26,11 @@ export const AminoConverter = { toAmino: MsgSetDenomMetadata.toAmino, fromAmino: MsgSetDenomMetadata.fromAmino }, + "/osmosis.tokenfactory.v1beta1.MsgSetBeforeSendHook": { + aminoType: "osmosis/tokenfactory/set-bef-send-hook", + toAmino: MsgSetBeforeSendHook.toAmino, + fromAmino: MsgSetBeforeSendHook.fromAmino + }, "/osmosis.tokenfactory.v1beta1.MsgForceTransfer": { aminoType: "osmosis/tokenfactory/force-transfer", toAmino: MsgForceTransfer.toAmino, diff --git a/packages/osmojs/src/codegen/osmosis/tokenfactory/v1beta1/tx.registry.ts b/packages/osmojs/src/codegen/osmosis/tokenfactory/v1beta1/tx.registry.ts index b5338c034..89cc3b750 100644 --- a/packages/osmojs/src/codegen/osmosis/tokenfactory/v1beta1/tx.registry.ts +++ b/packages/osmojs/src/codegen/osmosis/tokenfactory/v1beta1/tx.registry.ts @@ -1,7 +1,7 @@ //@ts-nocheck import { GeneratedType, Registry } from "@cosmjs/proto-signing"; -import { MsgCreateDenom, MsgMint, MsgBurn, MsgChangeAdmin, MsgSetDenomMetadata, MsgForceTransfer } from "./tx"; -export const registry: ReadonlyArray<[string, GeneratedType]> = [["/osmosis.tokenfactory.v1beta1.MsgCreateDenom", MsgCreateDenom], ["/osmosis.tokenfactory.v1beta1.MsgMint", MsgMint], ["/osmosis.tokenfactory.v1beta1.MsgBurn", MsgBurn], ["/osmosis.tokenfactory.v1beta1.MsgChangeAdmin", MsgChangeAdmin], ["/osmosis.tokenfactory.v1beta1.MsgSetDenomMetadata", MsgSetDenomMetadata], ["/osmosis.tokenfactory.v1beta1.MsgForceTransfer", MsgForceTransfer]]; +import { MsgCreateDenom, MsgMint, MsgBurn, MsgChangeAdmin, MsgSetDenomMetadata, MsgSetBeforeSendHook, MsgForceTransfer } from "./tx"; +export const registry: ReadonlyArray<[string, GeneratedType]> = [["/osmosis.tokenfactory.v1beta1.MsgCreateDenom", MsgCreateDenom], ["/osmosis.tokenfactory.v1beta1.MsgMint", MsgMint], ["/osmosis.tokenfactory.v1beta1.MsgBurn", MsgBurn], ["/osmosis.tokenfactory.v1beta1.MsgChangeAdmin", MsgChangeAdmin], ["/osmosis.tokenfactory.v1beta1.MsgSetDenomMetadata", MsgSetDenomMetadata], ["/osmosis.tokenfactory.v1beta1.MsgSetBeforeSendHook", MsgSetBeforeSendHook], ["/osmosis.tokenfactory.v1beta1.MsgForceTransfer", MsgForceTransfer]]; export const load = (protoRegistry: Registry) => { registry.forEach(([typeUrl, mod]) => { protoRegistry.register(typeUrl, mod); @@ -39,6 +39,12 @@ export const MessageComposer = { value: MsgSetDenomMetadata.encode(value).finish() }; }, + setBeforeSendHook(value: MsgSetBeforeSendHook) { + return { + typeUrl: "/osmosis.tokenfactory.v1beta1.MsgSetBeforeSendHook", + value: MsgSetBeforeSendHook.encode(value).finish() + }; + }, forceTransfer(value: MsgForceTransfer) { return { typeUrl: "/osmosis.tokenfactory.v1beta1.MsgForceTransfer", @@ -77,6 +83,12 @@ export const MessageComposer = { value }; }, + setBeforeSendHook(value: MsgSetBeforeSendHook) { + return { + typeUrl: "/osmosis.tokenfactory.v1beta1.MsgSetBeforeSendHook", + value + }; + }, forceTransfer(value: MsgForceTransfer) { return { typeUrl: "/osmosis.tokenfactory.v1beta1.MsgForceTransfer", @@ -84,6 +96,94 @@ export const MessageComposer = { }; } }, + toJSON: { + createDenom(value: MsgCreateDenom) { + return { + typeUrl: "/osmosis.tokenfactory.v1beta1.MsgCreateDenom", + value: MsgCreateDenom.toJSON(value) + }; + }, + mint(value: MsgMint) { + return { + typeUrl: "/osmosis.tokenfactory.v1beta1.MsgMint", + value: MsgMint.toJSON(value) + }; + }, + burn(value: MsgBurn) { + return { + typeUrl: "/osmosis.tokenfactory.v1beta1.MsgBurn", + value: MsgBurn.toJSON(value) + }; + }, + changeAdmin(value: MsgChangeAdmin) { + return { + typeUrl: "/osmosis.tokenfactory.v1beta1.MsgChangeAdmin", + value: MsgChangeAdmin.toJSON(value) + }; + }, + setDenomMetadata(value: MsgSetDenomMetadata) { + return { + typeUrl: "/osmosis.tokenfactory.v1beta1.MsgSetDenomMetadata", + value: MsgSetDenomMetadata.toJSON(value) + }; + }, + setBeforeSendHook(value: MsgSetBeforeSendHook) { + return { + typeUrl: "/osmosis.tokenfactory.v1beta1.MsgSetBeforeSendHook", + value: MsgSetBeforeSendHook.toJSON(value) + }; + }, + forceTransfer(value: MsgForceTransfer) { + return { + typeUrl: "/osmosis.tokenfactory.v1beta1.MsgForceTransfer", + value: MsgForceTransfer.toJSON(value) + }; + } + }, + fromJSON: { + createDenom(value: any) { + return { + typeUrl: "/osmosis.tokenfactory.v1beta1.MsgCreateDenom", + value: MsgCreateDenom.fromJSON(value) + }; + }, + mint(value: any) { + return { + typeUrl: "/osmosis.tokenfactory.v1beta1.MsgMint", + value: MsgMint.fromJSON(value) + }; + }, + burn(value: any) { + return { + typeUrl: "/osmosis.tokenfactory.v1beta1.MsgBurn", + value: MsgBurn.fromJSON(value) + }; + }, + changeAdmin(value: any) { + return { + typeUrl: "/osmosis.tokenfactory.v1beta1.MsgChangeAdmin", + value: MsgChangeAdmin.fromJSON(value) + }; + }, + setDenomMetadata(value: any) { + return { + typeUrl: "/osmosis.tokenfactory.v1beta1.MsgSetDenomMetadata", + value: MsgSetDenomMetadata.fromJSON(value) + }; + }, + setBeforeSendHook(value: any) { + return { + typeUrl: "/osmosis.tokenfactory.v1beta1.MsgSetBeforeSendHook", + value: MsgSetBeforeSendHook.fromJSON(value) + }; + }, + forceTransfer(value: any) { + return { + typeUrl: "/osmosis.tokenfactory.v1beta1.MsgForceTransfer", + value: MsgForceTransfer.fromJSON(value) + }; + } + }, fromPartial: { createDenom(value: MsgCreateDenom) { return { @@ -115,6 +215,12 @@ export const MessageComposer = { value: MsgSetDenomMetadata.fromPartial(value) }; }, + setBeforeSendHook(value: MsgSetBeforeSendHook) { + return { + typeUrl: "/osmosis.tokenfactory.v1beta1.MsgSetBeforeSendHook", + value: MsgSetBeforeSendHook.fromPartial(value) + }; + }, forceTransfer(value: MsgForceTransfer) { return { typeUrl: "/osmosis.tokenfactory.v1beta1.MsgForceTransfer", diff --git a/packages/osmojs/src/codegen/osmosis/tokenfactory/v1beta1/tx.rpc.msg.ts b/packages/osmojs/src/codegen/osmosis/tokenfactory/v1beta1/tx.rpc.msg.ts index 2e3eb27f2..c18c97ad7 100644 --- a/packages/osmojs/src/codegen/osmosis/tokenfactory/v1beta1/tx.rpc.msg.ts +++ b/packages/osmojs/src/codegen/osmosis/tokenfactory/v1beta1/tx.rpc.msg.ts @@ -1,6 +1,6 @@ import { Rpc } from "../../../helpers"; import { BinaryReader } from "../../../binary"; -import { MsgCreateDenom, MsgCreateDenomResponse, MsgMint, MsgMintResponse, MsgBurn, MsgBurnResponse, MsgChangeAdmin, MsgChangeAdminResponse, MsgSetDenomMetadata, MsgSetDenomMetadataResponse, MsgForceTransfer, MsgForceTransferResponse } from "./tx"; +import { MsgCreateDenom, MsgCreateDenomResponse, MsgMint, MsgMintResponse, MsgBurn, MsgBurnResponse, MsgChangeAdmin, MsgChangeAdminResponse, MsgSetDenomMetadata, MsgSetDenomMetadataResponse, MsgSetBeforeSendHook, MsgSetBeforeSendHookResponse, MsgForceTransfer, MsgForceTransferResponse } from "./tx"; /** Msg defines the tokefactory module's gRPC message service. */ export interface Msg { createDenom(request: MsgCreateDenom): Promise; @@ -8,6 +8,7 @@ export interface Msg { burn(request: MsgBurn): Promise; changeAdmin(request: MsgChangeAdmin): Promise; setDenomMetadata(request: MsgSetDenomMetadata): Promise; + setBeforeSendHook(request: MsgSetBeforeSendHook): Promise; forceTransfer(request: MsgForceTransfer): Promise; } export class MsgClientImpl implements Msg { @@ -19,6 +20,7 @@ export class MsgClientImpl implements Msg { this.burn = this.burn.bind(this); this.changeAdmin = this.changeAdmin.bind(this); this.setDenomMetadata = this.setDenomMetadata.bind(this); + this.setBeforeSendHook = this.setBeforeSendHook.bind(this); this.forceTransfer = this.forceTransfer.bind(this); } createDenom(request: MsgCreateDenom): Promise { @@ -46,9 +48,17 @@ export class MsgClientImpl implements Msg { const promise = this.rpc.request("osmosis.tokenfactory.v1beta1.Msg", "SetDenomMetadata", data); return promise.then(data => MsgSetDenomMetadataResponse.decode(new BinaryReader(data))); } + setBeforeSendHook(request: MsgSetBeforeSendHook): Promise { + const data = MsgSetBeforeSendHook.encode(request).finish(); + const promise = this.rpc.request("osmosis.tokenfactory.v1beta1.Msg", "SetBeforeSendHook", data); + return promise.then(data => MsgSetBeforeSendHookResponse.decode(new BinaryReader(data))); + } forceTransfer(request: MsgForceTransfer): Promise { const data = MsgForceTransfer.encode(request).finish(); const promise = this.rpc.request("osmosis.tokenfactory.v1beta1.Msg", "ForceTransfer", data); return promise.then(data => MsgForceTransferResponse.decode(new BinaryReader(data))); } -} \ No newline at end of file +} +export const createClientImpl = (rpc: Rpc) => { + return new MsgClientImpl(rpc); +}; \ No newline at end of file diff --git a/packages/osmojs/src/codegen/osmosis/tokenfactory/v1beta1/tx.ts b/packages/osmojs/src/codegen/osmosis/tokenfactory/v1beta1/tx.ts index 00d5be522..6fc810849 100644 --- a/packages/osmojs/src/codegen/osmosis/tokenfactory/v1beta1/tx.ts +++ b/packages/osmojs/src/codegen/osmosis/tokenfactory/v1beta1/tx.ts @@ -1,6 +1,8 @@ import { Coin, CoinAmino, CoinSDKType } from "../../../cosmos/base/v1beta1/coin"; import { Metadata, MetadataAmino, MetadataSDKType } from "../../../cosmos/bank/v1beta1/bank"; import { BinaryReader, BinaryWriter } from "../../../binary"; +import { isSet } from "../../../helpers"; +import { GlobalDecoderRegistry } from "../../../registry"; /** * MsgCreateDenom defines the message structure for the CreateDenom gRPC service * method. It allows an account to create a new denom. It requires a sender @@ -33,9 +35,9 @@ export interface MsgCreateDenomProtoMsg { * denom does not indicate the current admin. */ export interface MsgCreateDenomAmino { - sender: string; + sender?: string; /** subdenom can be up to 44 "alphanumeric" characters long. */ - subdenom: string; + subdenom?: string; } export interface MsgCreateDenomAminoMsg { type: "osmosis/tokenfactory/create-denom"; @@ -72,7 +74,7 @@ export interface MsgCreateDenomResponseProtoMsg { * It returns the full string of the newly created denom */ export interface MsgCreateDenomResponseAmino { - new_token_denom: string; + new_token_denom?: string; } export interface MsgCreateDenomResponseAminoMsg { type: "osmosis/tokenfactory/create-denom-response"; @@ -87,7 +89,9 @@ export interface MsgCreateDenomResponseSDKType { } /** * MsgMint is the sdk.Msg type for allowing an admin account to mint - * more of a token. For now, we only support minting to the sender account + * more of a token. + * Only the admin of the token factory denom has permission to mint unless + * the denom does not have any admin. */ export interface MsgMint { sender: string; @@ -100,10 +104,12 @@ export interface MsgMintProtoMsg { } /** * MsgMint is the sdk.Msg type for allowing an admin account to mint - * more of a token. For now, we only support minting to the sender account + * more of a token. + * Only the admin of the token factory denom has permission to mint unless + * the denom does not have any admin. */ export interface MsgMintAmino { - sender: string; + sender?: string; amount?: CoinAmino; mintToAddress: string; } @@ -113,7 +119,9 @@ export interface MsgMintAminoMsg { } /** * MsgMint is the sdk.Msg type for allowing an admin account to mint - * more of a token. For now, we only support minting to the sender account + * more of a token. + * Only the admin of the token factory denom has permission to mint unless + * the denom does not have any admin. */ export interface MsgMintSDKType { sender: string; @@ -133,7 +141,9 @@ export interface MsgMintResponseAminoMsg { export interface MsgMintResponseSDKType {} /** * MsgBurn is the sdk.Msg type for allowing an admin account to burn - * a token. For now, we only support burning from the sender account. + * a token. + * Only the admin of the token factory denom has permission to burn unless + * the denom does not have any admin. */ export interface MsgBurn { sender: string; @@ -146,10 +156,12 @@ export interface MsgBurnProtoMsg { } /** * MsgBurn is the sdk.Msg type for allowing an admin account to burn - * a token. For now, we only support burning from the sender account. + * a token. + * Only the admin of the token factory denom has permission to burn unless + * the denom does not have any admin. */ export interface MsgBurnAmino { - sender: string; + sender?: string; amount?: CoinAmino; burnFromAddress: string; } @@ -159,7 +171,9 @@ export interface MsgBurnAminoMsg { } /** * MsgBurn is the sdk.Msg type for allowing an admin account to burn - * a token. For now, we only support burning from the sender account. + * a token. + * Only the admin of the token factory denom has permission to burn unless + * the denom does not have any admin. */ export interface MsgBurnSDKType { sender: string; @@ -195,9 +209,9 @@ export interface MsgChangeAdminProtoMsg { * adminship of a denom to a new account */ export interface MsgChangeAdminAmino { - sender: string; - denom: string; - new_admin: string; + sender?: string; + denom?: string; + new_admin?: string; } export interface MsgChangeAdminAminoMsg { type: "osmosis/tokenfactory/change-admin"; @@ -235,6 +249,64 @@ export interface MsgChangeAdminResponseAminoMsg { * MsgChangeAdmin message. */ export interface MsgChangeAdminResponseSDKType {} +/** + * MsgSetBeforeSendHook is the sdk.Msg type for allowing an admin account to + * assign a CosmWasm contract to call with a BeforeSend hook + */ +export interface MsgSetBeforeSendHook { + sender: string; + denom: string; + cosmwasmAddress: string; +} +export interface MsgSetBeforeSendHookProtoMsg { + typeUrl: "/osmosis.tokenfactory.v1beta1.MsgSetBeforeSendHook"; + value: Uint8Array; +} +/** + * MsgSetBeforeSendHook is the sdk.Msg type for allowing an admin account to + * assign a CosmWasm contract to call with a BeforeSend hook + */ +export interface MsgSetBeforeSendHookAmino { + sender?: string; + denom?: string; + cosmwasm_address: string; +} +export interface MsgSetBeforeSendHookAminoMsg { + type: "osmosis/tokenfactory/set-bef-send-hook"; + value: MsgSetBeforeSendHookAmino; +} +/** + * MsgSetBeforeSendHook is the sdk.Msg type for allowing an admin account to + * assign a CosmWasm contract to call with a BeforeSend hook + */ +export interface MsgSetBeforeSendHookSDKType { + sender: string; + denom: string; + cosmwasm_address: string; +} +/** + * MsgSetBeforeSendHookResponse defines the response structure for an executed + * MsgSetBeforeSendHook message. + */ +export interface MsgSetBeforeSendHookResponse {} +export interface MsgSetBeforeSendHookResponseProtoMsg { + typeUrl: "/osmosis.tokenfactory.v1beta1.MsgSetBeforeSendHookResponse"; + value: Uint8Array; +} +/** + * MsgSetBeforeSendHookResponse defines the response structure for an executed + * MsgSetBeforeSendHook message. + */ +export interface MsgSetBeforeSendHookResponseAmino {} +export interface MsgSetBeforeSendHookResponseAminoMsg { + type: "osmosis/tokenfactory/set-before-send-hook-response"; + value: MsgSetBeforeSendHookResponseAmino; +} +/** + * MsgSetBeforeSendHookResponse defines the response structure for an executed + * MsgSetBeforeSendHook message. + */ +export interface MsgSetBeforeSendHookResponseSDKType {} /** * MsgSetDenomMetadata is the sdk.Msg type for allowing an admin account to set * the denom's bank metadata @@ -252,7 +324,7 @@ export interface MsgSetDenomMetadataProtoMsg { * the denom's bank metadata */ export interface MsgSetDenomMetadataAmino { - sender: string; + sender?: string; metadata?: MetadataAmino; } export interface MsgSetDenomMetadataAminoMsg { @@ -301,10 +373,10 @@ export interface MsgForceTransferProtoMsg { value: Uint8Array; } export interface MsgForceTransferAmino { - sender: string; + sender?: string; amount?: CoinAmino; - transferFromAddress: string; - transferToAddress: string; + transferFromAddress?: string; + transferToAddress?: string; } export interface MsgForceTransferAminoMsg { type: "osmosis/tokenfactory/force-transfer"; @@ -335,6 +407,16 @@ function createBaseMsgCreateDenom(): MsgCreateDenom { } export const MsgCreateDenom = { typeUrl: "/osmosis.tokenfactory.v1beta1.MsgCreateDenom", + aminoType: "osmosis/tokenfactory/create-denom", + is(o: any): o is MsgCreateDenom { + return o && (o.$typeUrl === MsgCreateDenom.typeUrl || typeof o.sender === "string" && typeof o.subdenom === "string"); + }, + isSDK(o: any): o is MsgCreateDenomSDKType { + return o && (o.$typeUrl === MsgCreateDenom.typeUrl || typeof o.sender === "string" && typeof o.subdenom === "string"); + }, + isAmino(o: any): o is MsgCreateDenomAmino { + return o && (o.$typeUrl === MsgCreateDenom.typeUrl || typeof o.sender === "string" && typeof o.subdenom === "string"); + }, encode(message: MsgCreateDenom, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.sender !== "") { writer.uint32(10).string(message.sender); @@ -364,6 +446,18 @@ export const MsgCreateDenom = { } return message; }, + fromJSON(object: any): MsgCreateDenom { + return { + sender: isSet(object.sender) ? String(object.sender) : "", + subdenom: isSet(object.subdenom) ? String(object.subdenom) : "" + }; + }, + toJSON(message: MsgCreateDenom): unknown { + const obj: any = {}; + message.sender !== undefined && (obj.sender = message.sender); + message.subdenom !== undefined && (obj.subdenom = message.subdenom); + return obj; + }, fromPartial(object: Partial): MsgCreateDenom { const message = createBaseMsgCreateDenom(); message.sender = object.sender ?? ""; @@ -371,10 +465,14 @@ export const MsgCreateDenom = { return message; }, fromAmino(object: MsgCreateDenomAmino): MsgCreateDenom { - return { - sender: object.sender, - subdenom: object.subdenom - }; + const message = createBaseMsgCreateDenom(); + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + if (object.subdenom !== undefined && object.subdenom !== null) { + message.subdenom = object.subdenom; + } + return message; }, toAmino(message: MsgCreateDenom): MsgCreateDenomAmino { const obj: any = {}; @@ -404,6 +502,8 @@ export const MsgCreateDenom = { }; } }; +GlobalDecoderRegistry.register(MsgCreateDenom.typeUrl, MsgCreateDenom); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgCreateDenom.aminoType, MsgCreateDenom.typeUrl); function createBaseMsgCreateDenomResponse(): MsgCreateDenomResponse { return { newTokenDenom: "" @@ -411,6 +511,16 @@ function createBaseMsgCreateDenomResponse(): MsgCreateDenomResponse { } export const MsgCreateDenomResponse = { typeUrl: "/osmosis.tokenfactory.v1beta1.MsgCreateDenomResponse", + aminoType: "osmosis/tokenfactory/create-denom-response", + is(o: any): o is MsgCreateDenomResponse { + return o && (o.$typeUrl === MsgCreateDenomResponse.typeUrl || typeof o.newTokenDenom === "string"); + }, + isSDK(o: any): o is MsgCreateDenomResponseSDKType { + return o && (o.$typeUrl === MsgCreateDenomResponse.typeUrl || typeof o.new_token_denom === "string"); + }, + isAmino(o: any): o is MsgCreateDenomResponseAmino { + return o && (o.$typeUrl === MsgCreateDenomResponse.typeUrl || typeof o.new_token_denom === "string"); + }, encode(message: MsgCreateDenomResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.newTokenDenom !== "") { writer.uint32(10).string(message.newTokenDenom); @@ -434,15 +544,27 @@ export const MsgCreateDenomResponse = { } return message; }, + fromJSON(object: any): MsgCreateDenomResponse { + return { + newTokenDenom: isSet(object.newTokenDenom) ? String(object.newTokenDenom) : "" + }; + }, + toJSON(message: MsgCreateDenomResponse): unknown { + const obj: any = {}; + message.newTokenDenom !== undefined && (obj.newTokenDenom = message.newTokenDenom); + return obj; + }, fromPartial(object: Partial): MsgCreateDenomResponse { const message = createBaseMsgCreateDenomResponse(); message.newTokenDenom = object.newTokenDenom ?? ""; return message; }, fromAmino(object: MsgCreateDenomResponseAmino): MsgCreateDenomResponse { - return { - newTokenDenom: object.new_token_denom - }; + const message = createBaseMsgCreateDenomResponse(); + if (object.new_token_denom !== undefined && object.new_token_denom !== null) { + message.newTokenDenom = object.new_token_denom; + } + return message; }, toAmino(message: MsgCreateDenomResponse): MsgCreateDenomResponseAmino { const obj: any = {}; @@ -471,15 +593,27 @@ export const MsgCreateDenomResponse = { }; } }; +GlobalDecoderRegistry.register(MsgCreateDenomResponse.typeUrl, MsgCreateDenomResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgCreateDenomResponse.aminoType, MsgCreateDenomResponse.typeUrl); function createBaseMsgMint(): MsgMint { return { sender: "", - amount: undefined, + amount: Coin.fromPartial({}), mintToAddress: "" }; } export const MsgMint = { typeUrl: "/osmosis.tokenfactory.v1beta1.MsgMint", + aminoType: "osmosis/tokenfactory/mint", + is(o: any): o is MsgMint { + return o && (o.$typeUrl === MsgMint.typeUrl || typeof o.sender === "string" && Coin.is(o.amount) && typeof o.mintToAddress === "string"); + }, + isSDK(o: any): o is MsgMintSDKType { + return o && (o.$typeUrl === MsgMint.typeUrl || typeof o.sender === "string" && Coin.isSDK(o.amount) && typeof o.mintToAddress === "string"); + }, + isAmino(o: any): o is MsgMintAmino { + return o && (o.$typeUrl === MsgMint.typeUrl || typeof o.sender === "string" && Coin.isAmino(o.amount) && typeof o.mintToAddress === "string"); + }, encode(message: MsgMint, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.sender !== "") { writer.uint32(10).string(message.sender); @@ -515,6 +649,20 @@ export const MsgMint = { } return message; }, + fromJSON(object: any): MsgMint { + return { + sender: isSet(object.sender) ? String(object.sender) : "", + amount: isSet(object.amount) ? Coin.fromJSON(object.amount) : undefined, + mintToAddress: isSet(object.mintToAddress) ? String(object.mintToAddress) : "" + }; + }, + toJSON(message: MsgMint): unknown { + const obj: any = {}; + message.sender !== undefined && (obj.sender = message.sender); + message.amount !== undefined && (obj.amount = message.amount ? Coin.toJSON(message.amount) : undefined); + message.mintToAddress !== undefined && (obj.mintToAddress = message.mintToAddress); + return obj; + }, fromPartial(object: Partial): MsgMint { const message = createBaseMsgMint(); message.sender = object.sender ?? ""; @@ -523,17 +671,23 @@ export const MsgMint = { return message; }, fromAmino(object: MsgMintAmino): MsgMint { - return { - sender: object.sender, - amount: object?.amount ? Coin.fromAmino(object.amount) : undefined, - mintToAddress: object.mintToAddress - }; + const message = createBaseMsgMint(); + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + if (object.amount !== undefined && object.amount !== null) { + message.amount = Coin.fromAmino(object.amount); + } + if (object.mintToAddress !== undefined && object.mintToAddress !== null) { + message.mintToAddress = object.mintToAddress; + } + return message; }, toAmino(message: MsgMint): MsgMintAmino { const obj: any = {}; obj.sender = message.sender; obj.amount = message.amount ? Coin.toAmino(message.amount) : undefined; - obj.mintToAddress = message.mintToAddress; + obj.mintToAddress = message.mintToAddress ?? ""; return obj; }, fromAminoMsg(object: MsgMintAminoMsg): MsgMint { @@ -558,11 +712,23 @@ export const MsgMint = { }; } }; +GlobalDecoderRegistry.register(MsgMint.typeUrl, MsgMint); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgMint.aminoType, MsgMint.typeUrl); function createBaseMsgMintResponse(): MsgMintResponse { return {}; } export const MsgMintResponse = { typeUrl: "/osmosis.tokenfactory.v1beta1.MsgMintResponse", + aminoType: "osmosis/tokenfactory/mint-response", + is(o: any): o is MsgMintResponse { + return o && o.$typeUrl === MsgMintResponse.typeUrl; + }, + isSDK(o: any): o is MsgMintResponseSDKType { + return o && o.$typeUrl === MsgMintResponse.typeUrl; + }, + isAmino(o: any): o is MsgMintResponseAmino { + return o && o.$typeUrl === MsgMintResponse.typeUrl; + }, encode(_: MsgMintResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, @@ -580,12 +746,20 @@ export const MsgMintResponse = { } return message; }, + fromJSON(_: any): MsgMintResponse { + return {}; + }, + toJSON(_: MsgMintResponse): unknown { + const obj: any = {}; + return obj; + }, fromPartial(_: Partial): MsgMintResponse { const message = createBaseMsgMintResponse(); return message; }, fromAmino(_: MsgMintResponseAmino): MsgMintResponse { - return {}; + const message = createBaseMsgMintResponse(); + return message; }, toAmino(_: MsgMintResponse): MsgMintResponseAmino { const obj: any = {}; @@ -613,15 +787,27 @@ export const MsgMintResponse = { }; } }; +GlobalDecoderRegistry.register(MsgMintResponse.typeUrl, MsgMintResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgMintResponse.aminoType, MsgMintResponse.typeUrl); function createBaseMsgBurn(): MsgBurn { return { sender: "", - amount: undefined, + amount: Coin.fromPartial({}), burnFromAddress: "" }; } export const MsgBurn = { typeUrl: "/osmosis.tokenfactory.v1beta1.MsgBurn", + aminoType: "osmosis/tokenfactory/burn", + is(o: any): o is MsgBurn { + return o && (o.$typeUrl === MsgBurn.typeUrl || typeof o.sender === "string" && Coin.is(o.amount) && typeof o.burnFromAddress === "string"); + }, + isSDK(o: any): o is MsgBurnSDKType { + return o && (o.$typeUrl === MsgBurn.typeUrl || typeof o.sender === "string" && Coin.isSDK(o.amount) && typeof o.burnFromAddress === "string"); + }, + isAmino(o: any): o is MsgBurnAmino { + return o && (o.$typeUrl === MsgBurn.typeUrl || typeof o.sender === "string" && Coin.isAmino(o.amount) && typeof o.burnFromAddress === "string"); + }, encode(message: MsgBurn, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.sender !== "") { writer.uint32(10).string(message.sender); @@ -657,6 +843,20 @@ export const MsgBurn = { } return message; }, + fromJSON(object: any): MsgBurn { + return { + sender: isSet(object.sender) ? String(object.sender) : "", + amount: isSet(object.amount) ? Coin.fromJSON(object.amount) : undefined, + burnFromAddress: isSet(object.burnFromAddress) ? String(object.burnFromAddress) : "" + }; + }, + toJSON(message: MsgBurn): unknown { + const obj: any = {}; + message.sender !== undefined && (obj.sender = message.sender); + message.amount !== undefined && (obj.amount = message.amount ? Coin.toJSON(message.amount) : undefined); + message.burnFromAddress !== undefined && (obj.burnFromAddress = message.burnFromAddress); + return obj; + }, fromPartial(object: Partial): MsgBurn { const message = createBaseMsgBurn(); message.sender = object.sender ?? ""; @@ -665,17 +865,23 @@ export const MsgBurn = { return message; }, fromAmino(object: MsgBurnAmino): MsgBurn { - return { - sender: object.sender, - amount: object?.amount ? Coin.fromAmino(object.amount) : undefined, - burnFromAddress: object.burnFromAddress - }; + const message = createBaseMsgBurn(); + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + if (object.amount !== undefined && object.amount !== null) { + message.amount = Coin.fromAmino(object.amount); + } + if (object.burnFromAddress !== undefined && object.burnFromAddress !== null) { + message.burnFromAddress = object.burnFromAddress; + } + return message; }, toAmino(message: MsgBurn): MsgBurnAmino { const obj: any = {}; obj.sender = message.sender; obj.amount = message.amount ? Coin.toAmino(message.amount) : undefined; - obj.burnFromAddress = message.burnFromAddress; + obj.burnFromAddress = message.burnFromAddress ?? ""; return obj; }, fromAminoMsg(object: MsgBurnAminoMsg): MsgBurn { @@ -700,11 +906,23 @@ export const MsgBurn = { }; } }; +GlobalDecoderRegistry.register(MsgBurn.typeUrl, MsgBurn); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgBurn.aminoType, MsgBurn.typeUrl); function createBaseMsgBurnResponse(): MsgBurnResponse { return {}; } export const MsgBurnResponse = { typeUrl: "/osmosis.tokenfactory.v1beta1.MsgBurnResponse", + aminoType: "osmosis/tokenfactory/burn-response", + is(o: any): o is MsgBurnResponse { + return o && o.$typeUrl === MsgBurnResponse.typeUrl; + }, + isSDK(o: any): o is MsgBurnResponseSDKType { + return o && o.$typeUrl === MsgBurnResponse.typeUrl; + }, + isAmino(o: any): o is MsgBurnResponseAmino { + return o && o.$typeUrl === MsgBurnResponse.typeUrl; + }, encode(_: MsgBurnResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, @@ -722,12 +940,20 @@ export const MsgBurnResponse = { } return message; }, + fromJSON(_: any): MsgBurnResponse { + return {}; + }, + toJSON(_: MsgBurnResponse): unknown { + const obj: any = {}; + return obj; + }, fromPartial(_: Partial): MsgBurnResponse { const message = createBaseMsgBurnResponse(); return message; }, fromAmino(_: MsgBurnResponseAmino): MsgBurnResponse { - return {}; + const message = createBaseMsgBurnResponse(); + return message; }, toAmino(_: MsgBurnResponse): MsgBurnResponseAmino { const obj: any = {}; @@ -755,6 +981,8 @@ export const MsgBurnResponse = { }; } }; +GlobalDecoderRegistry.register(MsgBurnResponse.typeUrl, MsgBurnResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgBurnResponse.aminoType, MsgBurnResponse.typeUrl); function createBaseMsgChangeAdmin(): MsgChangeAdmin { return { sender: "", @@ -764,6 +992,16 @@ function createBaseMsgChangeAdmin(): MsgChangeAdmin { } export const MsgChangeAdmin = { typeUrl: "/osmosis.tokenfactory.v1beta1.MsgChangeAdmin", + aminoType: "osmosis/tokenfactory/change-admin", + is(o: any): o is MsgChangeAdmin { + return o && (o.$typeUrl === MsgChangeAdmin.typeUrl || typeof o.sender === "string" && typeof o.denom === "string" && typeof o.newAdmin === "string"); + }, + isSDK(o: any): o is MsgChangeAdminSDKType { + return o && (o.$typeUrl === MsgChangeAdmin.typeUrl || typeof o.sender === "string" && typeof o.denom === "string" && typeof o.new_admin === "string"); + }, + isAmino(o: any): o is MsgChangeAdminAmino { + return o && (o.$typeUrl === MsgChangeAdmin.typeUrl || typeof o.sender === "string" && typeof o.denom === "string" && typeof o.new_admin === "string"); + }, encode(message: MsgChangeAdmin, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.sender !== "") { writer.uint32(10).string(message.sender); @@ -799,6 +1037,20 @@ export const MsgChangeAdmin = { } return message; }, + fromJSON(object: any): MsgChangeAdmin { + return { + sender: isSet(object.sender) ? String(object.sender) : "", + denom: isSet(object.denom) ? String(object.denom) : "", + newAdmin: isSet(object.newAdmin) ? String(object.newAdmin) : "" + }; + }, + toJSON(message: MsgChangeAdmin): unknown { + const obj: any = {}; + message.sender !== undefined && (obj.sender = message.sender); + message.denom !== undefined && (obj.denom = message.denom); + message.newAdmin !== undefined && (obj.newAdmin = message.newAdmin); + return obj; + }, fromPartial(object: Partial): MsgChangeAdmin { const message = createBaseMsgChangeAdmin(); message.sender = object.sender ?? ""; @@ -807,11 +1059,17 @@ export const MsgChangeAdmin = { return message; }, fromAmino(object: MsgChangeAdminAmino): MsgChangeAdmin { - return { - sender: object.sender, - denom: object.denom, - newAdmin: object.new_admin - }; + const message = createBaseMsgChangeAdmin(); + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + if (object.denom !== undefined && object.denom !== null) { + message.denom = object.denom; + } + if (object.new_admin !== undefined && object.new_admin !== null) { + message.newAdmin = object.new_admin; + } + return message; }, toAmino(message: MsgChangeAdmin): MsgChangeAdminAmino { const obj: any = {}; @@ -842,11 +1100,23 @@ export const MsgChangeAdmin = { }; } }; +GlobalDecoderRegistry.register(MsgChangeAdmin.typeUrl, MsgChangeAdmin); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgChangeAdmin.aminoType, MsgChangeAdmin.typeUrl); function createBaseMsgChangeAdminResponse(): MsgChangeAdminResponse { return {}; } export const MsgChangeAdminResponse = { typeUrl: "/osmosis.tokenfactory.v1beta1.MsgChangeAdminResponse", + aminoType: "osmosis/tokenfactory/change-admin-response", + is(o: any): o is MsgChangeAdminResponse { + return o && o.$typeUrl === MsgChangeAdminResponse.typeUrl; + }, + isSDK(o: any): o is MsgChangeAdminResponseSDKType { + return o && o.$typeUrl === MsgChangeAdminResponse.typeUrl; + }, + isAmino(o: any): o is MsgChangeAdminResponseAmino { + return o && o.$typeUrl === MsgChangeAdminResponse.typeUrl; + }, encode(_: MsgChangeAdminResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, @@ -864,12 +1134,20 @@ export const MsgChangeAdminResponse = { } return message; }, + fromJSON(_: any): MsgChangeAdminResponse { + return {}; + }, + toJSON(_: MsgChangeAdminResponse): unknown { + const obj: any = {}; + return obj; + }, fromPartial(_: Partial): MsgChangeAdminResponse { const message = createBaseMsgChangeAdminResponse(); return message; }, fromAmino(_: MsgChangeAdminResponseAmino): MsgChangeAdminResponse { - return {}; + const message = createBaseMsgChangeAdminResponse(); + return message; }, toAmino(_: MsgChangeAdminResponse): MsgChangeAdminResponseAmino { const obj: any = {}; @@ -897,6 +1175,202 @@ export const MsgChangeAdminResponse = { }; } }; +GlobalDecoderRegistry.register(MsgChangeAdminResponse.typeUrl, MsgChangeAdminResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgChangeAdminResponse.aminoType, MsgChangeAdminResponse.typeUrl); +function createBaseMsgSetBeforeSendHook(): MsgSetBeforeSendHook { + return { + sender: "", + denom: "", + cosmwasmAddress: "" + }; +} +export const MsgSetBeforeSendHook = { + typeUrl: "/osmosis.tokenfactory.v1beta1.MsgSetBeforeSendHook", + aminoType: "osmosis/tokenfactory/set-bef-send-hook", + is(o: any): o is MsgSetBeforeSendHook { + return o && (o.$typeUrl === MsgSetBeforeSendHook.typeUrl || typeof o.sender === "string" && typeof o.denom === "string" && typeof o.cosmwasmAddress === "string"); + }, + isSDK(o: any): o is MsgSetBeforeSendHookSDKType { + return o && (o.$typeUrl === MsgSetBeforeSendHook.typeUrl || typeof o.sender === "string" && typeof o.denom === "string" && typeof o.cosmwasm_address === "string"); + }, + isAmino(o: any): o is MsgSetBeforeSendHookAmino { + return o && (o.$typeUrl === MsgSetBeforeSendHook.typeUrl || typeof o.sender === "string" && typeof o.denom === "string" && typeof o.cosmwasm_address === "string"); + }, + encode(message: MsgSetBeforeSendHook, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.sender !== "") { + writer.uint32(10).string(message.sender); + } + if (message.denom !== "") { + writer.uint32(18).string(message.denom); + } + if (message.cosmwasmAddress !== "") { + writer.uint32(26).string(message.cosmwasmAddress); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgSetBeforeSendHook { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgSetBeforeSendHook(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.sender = reader.string(); + break; + case 2: + message.denom = reader.string(); + break; + case 3: + message.cosmwasmAddress = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): MsgSetBeforeSendHook { + return { + sender: isSet(object.sender) ? String(object.sender) : "", + denom: isSet(object.denom) ? String(object.denom) : "", + cosmwasmAddress: isSet(object.cosmwasmAddress) ? String(object.cosmwasmAddress) : "" + }; + }, + toJSON(message: MsgSetBeforeSendHook): unknown { + const obj: any = {}; + message.sender !== undefined && (obj.sender = message.sender); + message.denom !== undefined && (obj.denom = message.denom); + message.cosmwasmAddress !== undefined && (obj.cosmwasmAddress = message.cosmwasmAddress); + return obj; + }, + fromPartial(object: Partial): MsgSetBeforeSendHook { + const message = createBaseMsgSetBeforeSendHook(); + message.sender = object.sender ?? ""; + message.denom = object.denom ?? ""; + message.cosmwasmAddress = object.cosmwasmAddress ?? ""; + return message; + }, + fromAmino(object: MsgSetBeforeSendHookAmino): MsgSetBeforeSendHook { + const message = createBaseMsgSetBeforeSendHook(); + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + if (object.denom !== undefined && object.denom !== null) { + message.denom = object.denom; + } + if (object.cosmwasm_address !== undefined && object.cosmwasm_address !== null) { + message.cosmwasmAddress = object.cosmwasm_address; + } + return message; + }, + toAmino(message: MsgSetBeforeSendHook): MsgSetBeforeSendHookAmino { + const obj: any = {}; + obj.sender = message.sender; + obj.denom = message.denom; + obj.cosmwasm_address = message.cosmwasmAddress ?? ""; + return obj; + }, + fromAminoMsg(object: MsgSetBeforeSendHookAminoMsg): MsgSetBeforeSendHook { + return MsgSetBeforeSendHook.fromAmino(object.value); + }, + toAminoMsg(message: MsgSetBeforeSendHook): MsgSetBeforeSendHookAminoMsg { + return { + type: "osmosis/tokenfactory/set-bef-send-hook", + value: MsgSetBeforeSendHook.toAmino(message) + }; + }, + fromProtoMsg(message: MsgSetBeforeSendHookProtoMsg): MsgSetBeforeSendHook { + return MsgSetBeforeSendHook.decode(message.value); + }, + toProto(message: MsgSetBeforeSendHook): Uint8Array { + return MsgSetBeforeSendHook.encode(message).finish(); + }, + toProtoMsg(message: MsgSetBeforeSendHook): MsgSetBeforeSendHookProtoMsg { + return { + typeUrl: "/osmosis.tokenfactory.v1beta1.MsgSetBeforeSendHook", + value: MsgSetBeforeSendHook.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgSetBeforeSendHook.typeUrl, MsgSetBeforeSendHook); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgSetBeforeSendHook.aminoType, MsgSetBeforeSendHook.typeUrl); +function createBaseMsgSetBeforeSendHookResponse(): MsgSetBeforeSendHookResponse { + return {}; +} +export const MsgSetBeforeSendHookResponse = { + typeUrl: "/osmosis.tokenfactory.v1beta1.MsgSetBeforeSendHookResponse", + aminoType: "osmosis/tokenfactory/set-before-send-hook-response", + is(o: any): o is MsgSetBeforeSendHookResponse { + return o && o.$typeUrl === MsgSetBeforeSendHookResponse.typeUrl; + }, + isSDK(o: any): o is MsgSetBeforeSendHookResponseSDKType { + return o && o.$typeUrl === MsgSetBeforeSendHookResponse.typeUrl; + }, + isAmino(o: any): o is MsgSetBeforeSendHookResponseAmino { + return o && o.$typeUrl === MsgSetBeforeSendHookResponse.typeUrl; + }, + encode(_: MsgSetBeforeSendHookResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgSetBeforeSendHookResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgSetBeforeSendHookResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(_: any): MsgSetBeforeSendHookResponse { + return {}; + }, + toJSON(_: MsgSetBeforeSendHookResponse): unknown { + const obj: any = {}; + return obj; + }, + fromPartial(_: Partial): MsgSetBeforeSendHookResponse { + const message = createBaseMsgSetBeforeSendHookResponse(); + return message; + }, + fromAmino(_: MsgSetBeforeSendHookResponseAmino): MsgSetBeforeSendHookResponse { + const message = createBaseMsgSetBeforeSendHookResponse(); + return message; + }, + toAmino(_: MsgSetBeforeSendHookResponse): MsgSetBeforeSendHookResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgSetBeforeSendHookResponseAminoMsg): MsgSetBeforeSendHookResponse { + return MsgSetBeforeSendHookResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgSetBeforeSendHookResponse): MsgSetBeforeSendHookResponseAminoMsg { + return { + type: "osmosis/tokenfactory/set-before-send-hook-response", + value: MsgSetBeforeSendHookResponse.toAmino(message) + }; + }, + fromProtoMsg(message: MsgSetBeforeSendHookResponseProtoMsg): MsgSetBeforeSendHookResponse { + return MsgSetBeforeSendHookResponse.decode(message.value); + }, + toProto(message: MsgSetBeforeSendHookResponse): Uint8Array { + return MsgSetBeforeSendHookResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgSetBeforeSendHookResponse): MsgSetBeforeSendHookResponseProtoMsg { + return { + typeUrl: "/osmosis.tokenfactory.v1beta1.MsgSetBeforeSendHookResponse", + value: MsgSetBeforeSendHookResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgSetBeforeSendHookResponse.typeUrl, MsgSetBeforeSendHookResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgSetBeforeSendHookResponse.aminoType, MsgSetBeforeSendHookResponse.typeUrl); function createBaseMsgSetDenomMetadata(): MsgSetDenomMetadata { return { sender: "", @@ -905,6 +1379,16 @@ function createBaseMsgSetDenomMetadata(): MsgSetDenomMetadata { } export const MsgSetDenomMetadata = { typeUrl: "/osmosis.tokenfactory.v1beta1.MsgSetDenomMetadata", + aminoType: "osmosis/tokenfactory/set-denom-metadata", + is(o: any): o is MsgSetDenomMetadata { + return o && (o.$typeUrl === MsgSetDenomMetadata.typeUrl || typeof o.sender === "string" && Metadata.is(o.metadata)); + }, + isSDK(o: any): o is MsgSetDenomMetadataSDKType { + return o && (o.$typeUrl === MsgSetDenomMetadata.typeUrl || typeof o.sender === "string" && Metadata.isSDK(o.metadata)); + }, + isAmino(o: any): o is MsgSetDenomMetadataAmino { + return o && (o.$typeUrl === MsgSetDenomMetadata.typeUrl || typeof o.sender === "string" && Metadata.isAmino(o.metadata)); + }, encode(message: MsgSetDenomMetadata, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.sender !== "") { writer.uint32(10).string(message.sender); @@ -934,6 +1418,18 @@ export const MsgSetDenomMetadata = { } return message; }, + fromJSON(object: any): MsgSetDenomMetadata { + return { + sender: isSet(object.sender) ? String(object.sender) : "", + metadata: isSet(object.metadata) ? Metadata.fromJSON(object.metadata) : undefined + }; + }, + toJSON(message: MsgSetDenomMetadata): unknown { + const obj: any = {}; + message.sender !== undefined && (obj.sender = message.sender); + message.metadata !== undefined && (obj.metadata = message.metadata ? Metadata.toJSON(message.metadata) : undefined); + return obj; + }, fromPartial(object: Partial): MsgSetDenomMetadata { const message = createBaseMsgSetDenomMetadata(); message.sender = object.sender ?? ""; @@ -941,10 +1437,14 @@ export const MsgSetDenomMetadata = { return message; }, fromAmino(object: MsgSetDenomMetadataAmino): MsgSetDenomMetadata { - return { - sender: object.sender, - metadata: object?.metadata ? Metadata.fromAmino(object.metadata) : undefined - }; + const message = createBaseMsgSetDenomMetadata(); + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + if (object.metadata !== undefined && object.metadata !== null) { + message.metadata = Metadata.fromAmino(object.metadata); + } + return message; }, toAmino(message: MsgSetDenomMetadata): MsgSetDenomMetadataAmino { const obj: any = {}; @@ -974,11 +1474,23 @@ export const MsgSetDenomMetadata = { }; } }; +GlobalDecoderRegistry.register(MsgSetDenomMetadata.typeUrl, MsgSetDenomMetadata); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgSetDenomMetadata.aminoType, MsgSetDenomMetadata.typeUrl); function createBaseMsgSetDenomMetadataResponse(): MsgSetDenomMetadataResponse { return {}; } export const MsgSetDenomMetadataResponse = { typeUrl: "/osmosis.tokenfactory.v1beta1.MsgSetDenomMetadataResponse", + aminoType: "osmosis/tokenfactory/set-denom-metadata-response", + is(o: any): o is MsgSetDenomMetadataResponse { + return o && o.$typeUrl === MsgSetDenomMetadataResponse.typeUrl; + }, + isSDK(o: any): o is MsgSetDenomMetadataResponseSDKType { + return o && o.$typeUrl === MsgSetDenomMetadataResponse.typeUrl; + }, + isAmino(o: any): o is MsgSetDenomMetadataResponseAmino { + return o && o.$typeUrl === MsgSetDenomMetadataResponse.typeUrl; + }, encode(_: MsgSetDenomMetadataResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, @@ -996,12 +1508,20 @@ export const MsgSetDenomMetadataResponse = { } return message; }, + fromJSON(_: any): MsgSetDenomMetadataResponse { + return {}; + }, + toJSON(_: MsgSetDenomMetadataResponse): unknown { + const obj: any = {}; + return obj; + }, fromPartial(_: Partial): MsgSetDenomMetadataResponse { const message = createBaseMsgSetDenomMetadataResponse(); return message; }, fromAmino(_: MsgSetDenomMetadataResponseAmino): MsgSetDenomMetadataResponse { - return {}; + const message = createBaseMsgSetDenomMetadataResponse(); + return message; }, toAmino(_: MsgSetDenomMetadataResponse): MsgSetDenomMetadataResponseAmino { const obj: any = {}; @@ -1029,16 +1549,28 @@ export const MsgSetDenomMetadataResponse = { }; } }; +GlobalDecoderRegistry.register(MsgSetDenomMetadataResponse.typeUrl, MsgSetDenomMetadataResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgSetDenomMetadataResponse.aminoType, MsgSetDenomMetadataResponse.typeUrl); function createBaseMsgForceTransfer(): MsgForceTransfer { return { sender: "", - amount: undefined, + amount: Coin.fromPartial({}), transferFromAddress: "", transferToAddress: "" }; } export const MsgForceTransfer = { typeUrl: "/osmosis.tokenfactory.v1beta1.MsgForceTransfer", + aminoType: "osmosis/tokenfactory/force-transfer", + is(o: any): o is MsgForceTransfer { + return o && (o.$typeUrl === MsgForceTransfer.typeUrl || typeof o.sender === "string" && Coin.is(o.amount) && typeof o.transferFromAddress === "string" && typeof o.transferToAddress === "string"); + }, + isSDK(o: any): o is MsgForceTransferSDKType { + return o && (o.$typeUrl === MsgForceTransfer.typeUrl || typeof o.sender === "string" && Coin.isSDK(o.amount) && typeof o.transferFromAddress === "string" && typeof o.transferToAddress === "string"); + }, + isAmino(o: any): o is MsgForceTransferAmino { + return o && (o.$typeUrl === MsgForceTransfer.typeUrl || typeof o.sender === "string" && Coin.isAmino(o.amount) && typeof o.transferFromAddress === "string" && typeof o.transferToAddress === "string"); + }, encode(message: MsgForceTransfer, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.sender !== "") { writer.uint32(10).string(message.sender); @@ -1080,6 +1612,22 @@ export const MsgForceTransfer = { } return message; }, + fromJSON(object: any): MsgForceTransfer { + return { + sender: isSet(object.sender) ? String(object.sender) : "", + amount: isSet(object.amount) ? Coin.fromJSON(object.amount) : undefined, + transferFromAddress: isSet(object.transferFromAddress) ? String(object.transferFromAddress) : "", + transferToAddress: isSet(object.transferToAddress) ? String(object.transferToAddress) : "" + }; + }, + toJSON(message: MsgForceTransfer): unknown { + const obj: any = {}; + message.sender !== undefined && (obj.sender = message.sender); + message.amount !== undefined && (obj.amount = message.amount ? Coin.toJSON(message.amount) : undefined); + message.transferFromAddress !== undefined && (obj.transferFromAddress = message.transferFromAddress); + message.transferToAddress !== undefined && (obj.transferToAddress = message.transferToAddress); + return obj; + }, fromPartial(object: Partial): MsgForceTransfer { const message = createBaseMsgForceTransfer(); message.sender = object.sender ?? ""; @@ -1089,12 +1637,20 @@ export const MsgForceTransfer = { return message; }, fromAmino(object: MsgForceTransferAmino): MsgForceTransfer { - return { - sender: object.sender, - amount: object?.amount ? Coin.fromAmino(object.amount) : undefined, - transferFromAddress: object.transferFromAddress, - transferToAddress: object.transferToAddress - }; + const message = createBaseMsgForceTransfer(); + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + if (object.amount !== undefined && object.amount !== null) { + message.amount = Coin.fromAmino(object.amount); + } + if (object.transferFromAddress !== undefined && object.transferFromAddress !== null) { + message.transferFromAddress = object.transferFromAddress; + } + if (object.transferToAddress !== undefined && object.transferToAddress !== null) { + message.transferToAddress = object.transferToAddress; + } + return message; }, toAmino(message: MsgForceTransfer): MsgForceTransferAmino { const obj: any = {}; @@ -1126,11 +1682,23 @@ export const MsgForceTransfer = { }; } }; +GlobalDecoderRegistry.register(MsgForceTransfer.typeUrl, MsgForceTransfer); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgForceTransfer.aminoType, MsgForceTransfer.typeUrl); function createBaseMsgForceTransferResponse(): MsgForceTransferResponse { return {}; } export const MsgForceTransferResponse = { typeUrl: "/osmosis.tokenfactory.v1beta1.MsgForceTransferResponse", + aminoType: "osmosis/tokenfactory/force-transfer-response", + is(o: any): o is MsgForceTransferResponse { + return o && o.$typeUrl === MsgForceTransferResponse.typeUrl; + }, + isSDK(o: any): o is MsgForceTransferResponseSDKType { + return o && o.$typeUrl === MsgForceTransferResponse.typeUrl; + }, + isAmino(o: any): o is MsgForceTransferResponseAmino { + return o && o.$typeUrl === MsgForceTransferResponse.typeUrl; + }, encode(_: MsgForceTransferResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, @@ -1148,12 +1716,20 @@ export const MsgForceTransferResponse = { } return message; }, + fromJSON(_: any): MsgForceTransferResponse { + return {}; + }, + toJSON(_: MsgForceTransferResponse): unknown { + const obj: any = {}; + return obj; + }, fromPartial(_: Partial): MsgForceTransferResponse { const message = createBaseMsgForceTransferResponse(); return message; }, fromAmino(_: MsgForceTransferResponseAmino): MsgForceTransferResponse { - return {}; + const message = createBaseMsgForceTransferResponse(); + return message; }, toAmino(_: MsgForceTransferResponse): MsgForceTransferResponseAmino { const obj: any = {}; @@ -1180,4 +1756,6 @@ export const MsgForceTransferResponse = { value: MsgForceTransferResponse.encode(message).finish() }; } -}; \ No newline at end of file +}; +GlobalDecoderRegistry.register(MsgForceTransferResponse.typeUrl, MsgForceTransferResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgForceTransferResponse.aminoType, MsgForceTransferResponse.typeUrl); \ No newline at end of file diff --git a/packages/osmojs/src/codegen/osmosis/twap/v1beta1/genesis.ts b/packages/osmojs/src/codegen/osmosis/twap/v1beta1/genesis.ts index 8110682b1..e52529799 100644 --- a/packages/osmojs/src/codegen/osmosis/twap/v1beta1/genesis.ts +++ b/packages/osmojs/src/codegen/osmosis/twap/v1beta1/genesis.ts @@ -1,6 +1,8 @@ import { Duration, DurationAmino, DurationSDKType } from "../../../google/protobuf/duration"; import { TwapRecord, TwapRecordAmino, TwapRecordSDKType } from "./twap_record"; import { BinaryReader, BinaryWriter } from "../../../binary"; +import { isSet } from "../../../helpers"; +import { GlobalDecoderRegistry } from "../../../registry"; /** Params holds parameters for the twap module */ export interface Params { pruneEpochIdentifier: string; @@ -12,7 +14,7 @@ export interface ParamsProtoMsg { } /** Params holds parameters for the twap module */ export interface ParamsAmino { - prune_epoch_identifier: string; + prune_epoch_identifier?: string; record_history_keep_period?: DurationAmino; } export interface ParamsAminoMsg { @@ -38,7 +40,7 @@ export interface GenesisStateProtoMsg { /** GenesisState defines the twap module's genesis state. */ export interface GenesisStateAmino { /** twaps is the collection of all twap records. */ - twaps: TwapRecordAmino[]; + twaps?: TwapRecordAmino[]; /** params is the container of twap parameters. */ params?: ParamsAmino; } @@ -54,11 +56,21 @@ export interface GenesisStateSDKType { function createBaseParams(): Params { return { pruneEpochIdentifier: "", - recordHistoryKeepPeriod: undefined + recordHistoryKeepPeriod: Duration.fromPartial({}) }; } export const Params = { typeUrl: "/osmosis.twap.v1beta1.Params", + aminoType: "osmosis/twap/params", + is(o: any): o is Params { + return o && (o.$typeUrl === Params.typeUrl || typeof o.pruneEpochIdentifier === "string" && Duration.is(o.recordHistoryKeepPeriod)); + }, + isSDK(o: any): o is ParamsSDKType { + return o && (o.$typeUrl === Params.typeUrl || typeof o.prune_epoch_identifier === "string" && Duration.isSDK(o.record_history_keep_period)); + }, + isAmino(o: any): o is ParamsAmino { + return o && (o.$typeUrl === Params.typeUrl || typeof o.prune_epoch_identifier === "string" && Duration.isAmino(o.record_history_keep_period)); + }, encode(message: Params, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.pruneEpochIdentifier !== "") { writer.uint32(10).string(message.pruneEpochIdentifier); @@ -88,6 +100,18 @@ export const Params = { } return message; }, + fromJSON(object: any): Params { + return { + pruneEpochIdentifier: isSet(object.pruneEpochIdentifier) ? String(object.pruneEpochIdentifier) : "", + recordHistoryKeepPeriod: isSet(object.recordHistoryKeepPeriod) ? Duration.fromJSON(object.recordHistoryKeepPeriod) : undefined + }; + }, + toJSON(message: Params): unknown { + const obj: any = {}; + message.pruneEpochIdentifier !== undefined && (obj.pruneEpochIdentifier = message.pruneEpochIdentifier); + message.recordHistoryKeepPeriod !== undefined && (obj.recordHistoryKeepPeriod = message.recordHistoryKeepPeriod ? Duration.toJSON(message.recordHistoryKeepPeriod) : undefined); + return obj; + }, fromPartial(object: Partial): Params { const message = createBaseParams(); message.pruneEpochIdentifier = object.pruneEpochIdentifier ?? ""; @@ -95,10 +119,14 @@ export const Params = { return message; }, fromAmino(object: ParamsAmino): Params { - return { - pruneEpochIdentifier: object.prune_epoch_identifier, - recordHistoryKeepPeriod: object?.record_history_keep_period ? Duration.fromAmino(object.record_history_keep_period) : undefined - }; + const message = createBaseParams(); + if (object.prune_epoch_identifier !== undefined && object.prune_epoch_identifier !== null) { + message.pruneEpochIdentifier = object.prune_epoch_identifier; + } + if (object.record_history_keep_period !== undefined && object.record_history_keep_period !== null) { + message.recordHistoryKeepPeriod = Duration.fromAmino(object.record_history_keep_period); + } + return message; }, toAmino(message: Params): ParamsAmino { const obj: any = {}; @@ -128,6 +156,8 @@ export const Params = { }; } }; +GlobalDecoderRegistry.register(Params.typeUrl, Params); +GlobalDecoderRegistry.registerAminoProtoMapping(Params.aminoType, Params.typeUrl); function createBaseGenesisState(): GenesisState { return { twaps: [], @@ -136,6 +166,16 @@ function createBaseGenesisState(): GenesisState { } export const GenesisState = { typeUrl: "/osmosis.twap.v1beta1.GenesisState", + aminoType: "osmosis/twap/genesis-state", + is(o: any): o is GenesisState { + return o && (o.$typeUrl === GenesisState.typeUrl || Array.isArray(o.twaps) && (!o.twaps.length || TwapRecord.is(o.twaps[0])) && Params.is(o.params)); + }, + isSDK(o: any): o is GenesisStateSDKType { + return o && (o.$typeUrl === GenesisState.typeUrl || Array.isArray(o.twaps) && (!o.twaps.length || TwapRecord.isSDK(o.twaps[0])) && Params.isSDK(o.params)); + }, + isAmino(o: any): o is GenesisStateAmino { + return o && (o.$typeUrl === GenesisState.typeUrl || Array.isArray(o.twaps) && (!o.twaps.length || TwapRecord.isAmino(o.twaps[0])) && Params.isAmino(o.params)); + }, encode(message: GenesisState, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.twaps) { TwapRecord.encode(v!, writer.uint32(10).fork()).ldelim(); @@ -165,6 +205,22 @@ export const GenesisState = { } return message; }, + fromJSON(object: any): GenesisState { + return { + twaps: Array.isArray(object?.twaps) ? object.twaps.map((e: any) => TwapRecord.fromJSON(e)) : [], + params: isSet(object.params) ? Params.fromJSON(object.params) : undefined + }; + }, + toJSON(message: GenesisState): unknown { + const obj: any = {}; + if (message.twaps) { + obj.twaps = message.twaps.map(e => e ? TwapRecord.toJSON(e) : undefined); + } else { + obj.twaps = []; + } + message.params !== undefined && (obj.params = message.params ? Params.toJSON(message.params) : undefined); + return obj; + }, fromPartial(object: Partial): GenesisState { const message = createBaseGenesisState(); message.twaps = object.twaps?.map(e => TwapRecord.fromPartial(e)) || []; @@ -172,10 +228,12 @@ export const GenesisState = { return message; }, fromAmino(object: GenesisStateAmino): GenesisState { - return { - twaps: Array.isArray(object?.twaps) ? object.twaps.map((e: any) => TwapRecord.fromAmino(e)) : [], - params: object?.params ? Params.fromAmino(object.params) : undefined - }; + const message = createBaseGenesisState(); + message.twaps = object.twaps?.map(e => TwapRecord.fromAmino(e)) || []; + if (object.params !== undefined && object.params !== null) { + message.params = Params.fromAmino(object.params); + } + return message; }, toAmino(message: GenesisState): GenesisStateAmino { const obj: any = {}; @@ -208,4 +266,6 @@ export const GenesisState = { value: GenesisState.encode(message).finish() }; } -}; \ No newline at end of file +}; +GlobalDecoderRegistry.register(GenesisState.typeUrl, GenesisState); +GlobalDecoderRegistry.registerAminoProtoMapping(GenesisState.aminoType, GenesisState.typeUrl); \ No newline at end of file diff --git a/packages/osmojs/src/codegen/osmosis/twap/v1beta1/query.ts b/packages/osmojs/src/codegen/osmosis/twap/v1beta1/query.ts index c41f5ab78..b46d4ef4c 100644 --- a/packages/osmojs/src/codegen/osmosis/twap/v1beta1/query.ts +++ b/packages/osmojs/src/codegen/osmosis/twap/v1beta1/query.ts @@ -1,7 +1,8 @@ import { Timestamp } from "../../../google/protobuf/timestamp"; import { Params, ParamsAmino, ParamsSDKType } from "./genesis"; import { BinaryReader, BinaryWriter } from "../../../binary"; -import { toTimestamp, fromTimestamp } from "../../../helpers"; +import { toTimestamp, fromTimestamp, isSet } from "../../../helpers"; +import { GlobalDecoderRegistry } from "../../../registry"; import { Decimal } from "@cosmjs/math"; export interface ArithmeticTwapRequest { poolId: bigint; @@ -15,11 +16,11 @@ export interface ArithmeticTwapRequestProtoMsg { value: Uint8Array; } export interface ArithmeticTwapRequestAmino { - pool_id: string; - base_asset: string; - quote_asset: string; - start_time?: Date; - end_time?: Date; + pool_id?: string; + base_asset?: string; + quote_asset?: string; + start_time?: string; + end_time?: string; } export interface ArithmeticTwapRequestAminoMsg { type: "osmosis/twap/arithmetic-twap-request"; @@ -40,7 +41,7 @@ export interface ArithmeticTwapResponseProtoMsg { value: Uint8Array; } export interface ArithmeticTwapResponseAmino { - arithmetic_twap: string; + arithmetic_twap?: string; } export interface ArithmeticTwapResponseAminoMsg { type: "osmosis/twap/arithmetic-twap-response"; @@ -60,10 +61,10 @@ export interface ArithmeticTwapToNowRequestProtoMsg { value: Uint8Array; } export interface ArithmeticTwapToNowRequestAmino { - pool_id: string; - base_asset: string; - quote_asset: string; - start_time?: Date; + pool_id?: string; + base_asset?: string; + quote_asset?: string; + start_time?: string; } export interface ArithmeticTwapToNowRequestAminoMsg { type: "osmosis/twap/arithmetic-twap-to-now-request"; @@ -83,7 +84,7 @@ export interface ArithmeticTwapToNowResponseProtoMsg { value: Uint8Array; } export interface ArithmeticTwapToNowResponseAmino { - arithmetic_twap: string; + arithmetic_twap?: string; } export interface ArithmeticTwapToNowResponseAminoMsg { type: "osmosis/twap/arithmetic-twap-to-now-response"; @@ -104,11 +105,11 @@ export interface GeometricTwapRequestProtoMsg { value: Uint8Array; } export interface GeometricTwapRequestAmino { - pool_id: string; - base_asset: string; - quote_asset: string; - start_time?: Date; - end_time?: Date; + pool_id?: string; + base_asset?: string; + quote_asset?: string; + start_time?: string; + end_time?: string; } export interface GeometricTwapRequestAminoMsg { type: "osmosis/twap/geometric-twap-request"; @@ -129,7 +130,7 @@ export interface GeometricTwapResponseProtoMsg { value: Uint8Array; } export interface GeometricTwapResponseAmino { - geometric_twap: string; + geometric_twap?: string; } export interface GeometricTwapResponseAminoMsg { type: "osmosis/twap/geometric-twap-response"; @@ -149,10 +150,10 @@ export interface GeometricTwapToNowRequestProtoMsg { value: Uint8Array; } export interface GeometricTwapToNowRequestAmino { - pool_id: string; - base_asset: string; - quote_asset: string; - start_time?: Date; + pool_id?: string; + base_asset?: string; + quote_asset?: string; + start_time?: string; } export interface GeometricTwapToNowRequestAminoMsg { type: "osmosis/twap/geometric-twap-to-now-request"; @@ -172,7 +173,7 @@ export interface GeometricTwapToNowResponseProtoMsg { value: Uint8Array; } export interface GeometricTwapToNowResponseAmino { - geometric_twap: string; + geometric_twap?: string; } export interface GeometricTwapToNowResponseAminoMsg { type: "osmosis/twap/geometric-twap-to-now-response"; @@ -214,12 +215,22 @@ function createBaseArithmeticTwapRequest(): ArithmeticTwapRequest { poolId: BigInt(0), baseAsset: "", quoteAsset: "", - startTime: undefined, + startTime: new Date(), endTime: undefined }; } export const ArithmeticTwapRequest = { typeUrl: "/osmosis.twap.v1beta1.ArithmeticTwapRequest", + aminoType: "osmosis/twap/arithmetic-twap-request", + is(o: any): o is ArithmeticTwapRequest { + return o && (o.$typeUrl === ArithmeticTwapRequest.typeUrl || typeof o.poolId === "bigint" && typeof o.baseAsset === "string" && typeof o.quoteAsset === "string" && Timestamp.is(o.startTime)); + }, + isSDK(o: any): o is ArithmeticTwapRequestSDKType { + return o && (o.$typeUrl === ArithmeticTwapRequest.typeUrl || typeof o.pool_id === "bigint" && typeof o.base_asset === "string" && typeof o.quote_asset === "string" && Timestamp.isSDK(o.start_time)); + }, + isAmino(o: any): o is ArithmeticTwapRequestAmino { + return o && (o.$typeUrl === ArithmeticTwapRequest.typeUrl || typeof o.pool_id === "bigint" && typeof o.base_asset === "string" && typeof o.quote_asset === "string" && Timestamp.isAmino(o.start_time)); + }, encode(message: ArithmeticTwapRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.poolId !== BigInt(0)) { writer.uint32(8).uint64(message.poolId); @@ -267,6 +278,24 @@ export const ArithmeticTwapRequest = { } return message; }, + fromJSON(object: any): ArithmeticTwapRequest { + return { + poolId: isSet(object.poolId) ? BigInt(object.poolId.toString()) : BigInt(0), + baseAsset: isSet(object.baseAsset) ? String(object.baseAsset) : "", + quoteAsset: isSet(object.quoteAsset) ? String(object.quoteAsset) : "", + startTime: isSet(object.startTime) ? new Date(object.startTime) : undefined, + endTime: isSet(object.endTime) ? new Date(object.endTime) : undefined + }; + }, + toJSON(message: ArithmeticTwapRequest): unknown { + const obj: any = {}; + message.poolId !== undefined && (obj.poolId = (message.poolId || BigInt(0)).toString()); + message.baseAsset !== undefined && (obj.baseAsset = message.baseAsset); + message.quoteAsset !== undefined && (obj.quoteAsset = message.quoteAsset); + message.startTime !== undefined && (obj.startTime = message.startTime.toISOString()); + message.endTime !== undefined && (obj.endTime = message.endTime.toISOString()); + return obj; + }, fromPartial(object: Partial): ArithmeticTwapRequest { const message = createBaseArithmeticTwapRequest(); message.poolId = object.poolId !== undefined && object.poolId !== null ? BigInt(object.poolId.toString()) : BigInt(0); @@ -277,21 +306,31 @@ export const ArithmeticTwapRequest = { return message; }, fromAmino(object: ArithmeticTwapRequestAmino): ArithmeticTwapRequest { - return { - poolId: BigInt(object.pool_id), - baseAsset: object.base_asset, - quoteAsset: object.quote_asset, - startTime: object.start_time, - endTime: object?.end_time - }; + const message = createBaseArithmeticTwapRequest(); + if (object.pool_id !== undefined && object.pool_id !== null) { + message.poolId = BigInt(object.pool_id); + } + if (object.base_asset !== undefined && object.base_asset !== null) { + message.baseAsset = object.base_asset; + } + if (object.quote_asset !== undefined && object.quote_asset !== null) { + message.quoteAsset = object.quote_asset; + } + if (object.start_time !== undefined && object.start_time !== null) { + message.startTime = fromTimestamp(Timestamp.fromAmino(object.start_time)); + } + if (object.end_time !== undefined && object.end_time !== null) { + message.endTime = fromTimestamp(Timestamp.fromAmino(object.end_time)); + } + return message; }, toAmino(message: ArithmeticTwapRequest): ArithmeticTwapRequestAmino { const obj: any = {}; obj.pool_id = message.poolId ? message.poolId.toString() : undefined; obj.base_asset = message.baseAsset; obj.quote_asset = message.quoteAsset; - obj.start_time = message.startTime; - obj.end_time = message.endTime; + obj.start_time = message.startTime ? Timestamp.toAmino(toTimestamp(message.startTime)) : undefined; + obj.end_time = message.endTime ? Timestamp.toAmino(toTimestamp(message.endTime)) : undefined; return obj; }, fromAminoMsg(object: ArithmeticTwapRequestAminoMsg): ArithmeticTwapRequest { @@ -316,6 +355,8 @@ export const ArithmeticTwapRequest = { }; } }; +GlobalDecoderRegistry.register(ArithmeticTwapRequest.typeUrl, ArithmeticTwapRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(ArithmeticTwapRequest.aminoType, ArithmeticTwapRequest.typeUrl); function createBaseArithmeticTwapResponse(): ArithmeticTwapResponse { return { arithmeticTwap: "" @@ -323,6 +364,16 @@ function createBaseArithmeticTwapResponse(): ArithmeticTwapResponse { } export const ArithmeticTwapResponse = { typeUrl: "/osmosis.twap.v1beta1.ArithmeticTwapResponse", + aminoType: "osmosis/twap/arithmetic-twap-response", + is(o: any): o is ArithmeticTwapResponse { + return o && (o.$typeUrl === ArithmeticTwapResponse.typeUrl || typeof o.arithmeticTwap === "string"); + }, + isSDK(o: any): o is ArithmeticTwapResponseSDKType { + return o && (o.$typeUrl === ArithmeticTwapResponse.typeUrl || typeof o.arithmetic_twap === "string"); + }, + isAmino(o: any): o is ArithmeticTwapResponseAmino { + return o && (o.$typeUrl === ArithmeticTwapResponse.typeUrl || typeof o.arithmetic_twap === "string"); + }, encode(message: ArithmeticTwapResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.arithmeticTwap !== "") { writer.uint32(10).string(Decimal.fromUserInput(message.arithmeticTwap, 18).atomics); @@ -346,15 +397,27 @@ export const ArithmeticTwapResponse = { } return message; }, + fromJSON(object: any): ArithmeticTwapResponse { + return { + arithmeticTwap: isSet(object.arithmeticTwap) ? String(object.arithmeticTwap) : "" + }; + }, + toJSON(message: ArithmeticTwapResponse): unknown { + const obj: any = {}; + message.arithmeticTwap !== undefined && (obj.arithmeticTwap = message.arithmeticTwap); + return obj; + }, fromPartial(object: Partial): ArithmeticTwapResponse { const message = createBaseArithmeticTwapResponse(); message.arithmeticTwap = object.arithmeticTwap ?? ""; return message; }, fromAmino(object: ArithmeticTwapResponseAmino): ArithmeticTwapResponse { - return { - arithmeticTwap: object.arithmetic_twap - }; + const message = createBaseArithmeticTwapResponse(); + if (object.arithmetic_twap !== undefined && object.arithmetic_twap !== null) { + message.arithmeticTwap = object.arithmetic_twap; + } + return message; }, toAmino(message: ArithmeticTwapResponse): ArithmeticTwapResponseAmino { const obj: any = {}; @@ -383,16 +446,28 @@ export const ArithmeticTwapResponse = { }; } }; +GlobalDecoderRegistry.register(ArithmeticTwapResponse.typeUrl, ArithmeticTwapResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(ArithmeticTwapResponse.aminoType, ArithmeticTwapResponse.typeUrl); function createBaseArithmeticTwapToNowRequest(): ArithmeticTwapToNowRequest { return { poolId: BigInt(0), baseAsset: "", quoteAsset: "", - startTime: undefined + startTime: new Date() }; } export const ArithmeticTwapToNowRequest = { typeUrl: "/osmosis.twap.v1beta1.ArithmeticTwapToNowRequest", + aminoType: "osmosis/twap/arithmetic-twap-to-now-request", + is(o: any): o is ArithmeticTwapToNowRequest { + return o && (o.$typeUrl === ArithmeticTwapToNowRequest.typeUrl || typeof o.poolId === "bigint" && typeof o.baseAsset === "string" && typeof o.quoteAsset === "string" && Timestamp.is(o.startTime)); + }, + isSDK(o: any): o is ArithmeticTwapToNowRequestSDKType { + return o && (o.$typeUrl === ArithmeticTwapToNowRequest.typeUrl || typeof o.pool_id === "bigint" && typeof o.base_asset === "string" && typeof o.quote_asset === "string" && Timestamp.isSDK(o.start_time)); + }, + isAmino(o: any): o is ArithmeticTwapToNowRequestAmino { + return o && (o.$typeUrl === ArithmeticTwapToNowRequest.typeUrl || typeof o.pool_id === "bigint" && typeof o.base_asset === "string" && typeof o.quote_asset === "string" && Timestamp.isAmino(o.start_time)); + }, encode(message: ArithmeticTwapToNowRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.poolId !== BigInt(0)) { writer.uint32(8).uint64(message.poolId); @@ -434,6 +509,22 @@ export const ArithmeticTwapToNowRequest = { } return message; }, + fromJSON(object: any): ArithmeticTwapToNowRequest { + return { + poolId: isSet(object.poolId) ? BigInt(object.poolId.toString()) : BigInt(0), + baseAsset: isSet(object.baseAsset) ? String(object.baseAsset) : "", + quoteAsset: isSet(object.quoteAsset) ? String(object.quoteAsset) : "", + startTime: isSet(object.startTime) ? new Date(object.startTime) : undefined + }; + }, + toJSON(message: ArithmeticTwapToNowRequest): unknown { + const obj: any = {}; + message.poolId !== undefined && (obj.poolId = (message.poolId || BigInt(0)).toString()); + message.baseAsset !== undefined && (obj.baseAsset = message.baseAsset); + message.quoteAsset !== undefined && (obj.quoteAsset = message.quoteAsset); + message.startTime !== undefined && (obj.startTime = message.startTime.toISOString()); + return obj; + }, fromPartial(object: Partial): ArithmeticTwapToNowRequest { const message = createBaseArithmeticTwapToNowRequest(); message.poolId = object.poolId !== undefined && object.poolId !== null ? BigInt(object.poolId.toString()) : BigInt(0); @@ -443,19 +534,27 @@ export const ArithmeticTwapToNowRequest = { return message; }, fromAmino(object: ArithmeticTwapToNowRequestAmino): ArithmeticTwapToNowRequest { - return { - poolId: BigInt(object.pool_id), - baseAsset: object.base_asset, - quoteAsset: object.quote_asset, - startTime: object.start_time - }; + const message = createBaseArithmeticTwapToNowRequest(); + if (object.pool_id !== undefined && object.pool_id !== null) { + message.poolId = BigInt(object.pool_id); + } + if (object.base_asset !== undefined && object.base_asset !== null) { + message.baseAsset = object.base_asset; + } + if (object.quote_asset !== undefined && object.quote_asset !== null) { + message.quoteAsset = object.quote_asset; + } + if (object.start_time !== undefined && object.start_time !== null) { + message.startTime = fromTimestamp(Timestamp.fromAmino(object.start_time)); + } + return message; }, toAmino(message: ArithmeticTwapToNowRequest): ArithmeticTwapToNowRequestAmino { const obj: any = {}; obj.pool_id = message.poolId ? message.poolId.toString() : undefined; obj.base_asset = message.baseAsset; obj.quote_asset = message.quoteAsset; - obj.start_time = message.startTime; + obj.start_time = message.startTime ? Timestamp.toAmino(toTimestamp(message.startTime)) : undefined; return obj; }, fromAminoMsg(object: ArithmeticTwapToNowRequestAminoMsg): ArithmeticTwapToNowRequest { @@ -480,6 +579,8 @@ export const ArithmeticTwapToNowRequest = { }; } }; +GlobalDecoderRegistry.register(ArithmeticTwapToNowRequest.typeUrl, ArithmeticTwapToNowRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(ArithmeticTwapToNowRequest.aminoType, ArithmeticTwapToNowRequest.typeUrl); function createBaseArithmeticTwapToNowResponse(): ArithmeticTwapToNowResponse { return { arithmeticTwap: "" @@ -487,6 +588,16 @@ function createBaseArithmeticTwapToNowResponse(): ArithmeticTwapToNowResponse { } export const ArithmeticTwapToNowResponse = { typeUrl: "/osmosis.twap.v1beta1.ArithmeticTwapToNowResponse", + aminoType: "osmosis/twap/arithmetic-twap-to-now-response", + is(o: any): o is ArithmeticTwapToNowResponse { + return o && (o.$typeUrl === ArithmeticTwapToNowResponse.typeUrl || typeof o.arithmeticTwap === "string"); + }, + isSDK(o: any): o is ArithmeticTwapToNowResponseSDKType { + return o && (o.$typeUrl === ArithmeticTwapToNowResponse.typeUrl || typeof o.arithmetic_twap === "string"); + }, + isAmino(o: any): o is ArithmeticTwapToNowResponseAmino { + return o && (o.$typeUrl === ArithmeticTwapToNowResponse.typeUrl || typeof o.arithmetic_twap === "string"); + }, encode(message: ArithmeticTwapToNowResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.arithmeticTwap !== "") { writer.uint32(10).string(Decimal.fromUserInput(message.arithmeticTwap, 18).atomics); @@ -510,15 +621,27 @@ export const ArithmeticTwapToNowResponse = { } return message; }, + fromJSON(object: any): ArithmeticTwapToNowResponse { + return { + arithmeticTwap: isSet(object.arithmeticTwap) ? String(object.arithmeticTwap) : "" + }; + }, + toJSON(message: ArithmeticTwapToNowResponse): unknown { + const obj: any = {}; + message.arithmeticTwap !== undefined && (obj.arithmeticTwap = message.arithmeticTwap); + return obj; + }, fromPartial(object: Partial): ArithmeticTwapToNowResponse { const message = createBaseArithmeticTwapToNowResponse(); message.arithmeticTwap = object.arithmeticTwap ?? ""; return message; }, fromAmino(object: ArithmeticTwapToNowResponseAmino): ArithmeticTwapToNowResponse { - return { - arithmeticTwap: object.arithmetic_twap - }; + const message = createBaseArithmeticTwapToNowResponse(); + if (object.arithmetic_twap !== undefined && object.arithmetic_twap !== null) { + message.arithmeticTwap = object.arithmetic_twap; + } + return message; }, toAmino(message: ArithmeticTwapToNowResponse): ArithmeticTwapToNowResponseAmino { const obj: any = {}; @@ -547,17 +670,29 @@ export const ArithmeticTwapToNowResponse = { }; } }; +GlobalDecoderRegistry.register(ArithmeticTwapToNowResponse.typeUrl, ArithmeticTwapToNowResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(ArithmeticTwapToNowResponse.aminoType, ArithmeticTwapToNowResponse.typeUrl); function createBaseGeometricTwapRequest(): GeometricTwapRequest { return { poolId: BigInt(0), baseAsset: "", quoteAsset: "", - startTime: undefined, + startTime: new Date(), endTime: undefined }; } export const GeometricTwapRequest = { typeUrl: "/osmosis.twap.v1beta1.GeometricTwapRequest", + aminoType: "osmosis/twap/geometric-twap-request", + is(o: any): o is GeometricTwapRequest { + return o && (o.$typeUrl === GeometricTwapRequest.typeUrl || typeof o.poolId === "bigint" && typeof o.baseAsset === "string" && typeof o.quoteAsset === "string" && Timestamp.is(o.startTime)); + }, + isSDK(o: any): o is GeometricTwapRequestSDKType { + return o && (o.$typeUrl === GeometricTwapRequest.typeUrl || typeof o.pool_id === "bigint" && typeof o.base_asset === "string" && typeof o.quote_asset === "string" && Timestamp.isSDK(o.start_time)); + }, + isAmino(o: any): o is GeometricTwapRequestAmino { + return o && (o.$typeUrl === GeometricTwapRequest.typeUrl || typeof o.pool_id === "bigint" && typeof o.base_asset === "string" && typeof o.quote_asset === "string" && Timestamp.isAmino(o.start_time)); + }, encode(message: GeometricTwapRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.poolId !== BigInt(0)) { writer.uint32(8).uint64(message.poolId); @@ -605,6 +740,24 @@ export const GeometricTwapRequest = { } return message; }, + fromJSON(object: any): GeometricTwapRequest { + return { + poolId: isSet(object.poolId) ? BigInt(object.poolId.toString()) : BigInt(0), + baseAsset: isSet(object.baseAsset) ? String(object.baseAsset) : "", + quoteAsset: isSet(object.quoteAsset) ? String(object.quoteAsset) : "", + startTime: isSet(object.startTime) ? new Date(object.startTime) : undefined, + endTime: isSet(object.endTime) ? new Date(object.endTime) : undefined + }; + }, + toJSON(message: GeometricTwapRequest): unknown { + const obj: any = {}; + message.poolId !== undefined && (obj.poolId = (message.poolId || BigInt(0)).toString()); + message.baseAsset !== undefined && (obj.baseAsset = message.baseAsset); + message.quoteAsset !== undefined && (obj.quoteAsset = message.quoteAsset); + message.startTime !== undefined && (obj.startTime = message.startTime.toISOString()); + message.endTime !== undefined && (obj.endTime = message.endTime.toISOString()); + return obj; + }, fromPartial(object: Partial): GeometricTwapRequest { const message = createBaseGeometricTwapRequest(); message.poolId = object.poolId !== undefined && object.poolId !== null ? BigInt(object.poolId.toString()) : BigInt(0); @@ -615,21 +768,31 @@ export const GeometricTwapRequest = { return message; }, fromAmino(object: GeometricTwapRequestAmino): GeometricTwapRequest { - return { - poolId: BigInt(object.pool_id), - baseAsset: object.base_asset, - quoteAsset: object.quote_asset, - startTime: object.start_time, - endTime: object?.end_time - }; + const message = createBaseGeometricTwapRequest(); + if (object.pool_id !== undefined && object.pool_id !== null) { + message.poolId = BigInt(object.pool_id); + } + if (object.base_asset !== undefined && object.base_asset !== null) { + message.baseAsset = object.base_asset; + } + if (object.quote_asset !== undefined && object.quote_asset !== null) { + message.quoteAsset = object.quote_asset; + } + if (object.start_time !== undefined && object.start_time !== null) { + message.startTime = fromTimestamp(Timestamp.fromAmino(object.start_time)); + } + if (object.end_time !== undefined && object.end_time !== null) { + message.endTime = fromTimestamp(Timestamp.fromAmino(object.end_time)); + } + return message; }, toAmino(message: GeometricTwapRequest): GeometricTwapRequestAmino { const obj: any = {}; obj.pool_id = message.poolId ? message.poolId.toString() : undefined; obj.base_asset = message.baseAsset; obj.quote_asset = message.quoteAsset; - obj.start_time = message.startTime; - obj.end_time = message.endTime; + obj.start_time = message.startTime ? Timestamp.toAmino(toTimestamp(message.startTime)) : undefined; + obj.end_time = message.endTime ? Timestamp.toAmino(toTimestamp(message.endTime)) : undefined; return obj; }, fromAminoMsg(object: GeometricTwapRequestAminoMsg): GeometricTwapRequest { @@ -654,6 +817,8 @@ export const GeometricTwapRequest = { }; } }; +GlobalDecoderRegistry.register(GeometricTwapRequest.typeUrl, GeometricTwapRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(GeometricTwapRequest.aminoType, GeometricTwapRequest.typeUrl); function createBaseGeometricTwapResponse(): GeometricTwapResponse { return { geometricTwap: "" @@ -661,6 +826,16 @@ function createBaseGeometricTwapResponse(): GeometricTwapResponse { } export const GeometricTwapResponse = { typeUrl: "/osmosis.twap.v1beta1.GeometricTwapResponse", + aminoType: "osmosis/twap/geometric-twap-response", + is(o: any): o is GeometricTwapResponse { + return o && (o.$typeUrl === GeometricTwapResponse.typeUrl || typeof o.geometricTwap === "string"); + }, + isSDK(o: any): o is GeometricTwapResponseSDKType { + return o && (o.$typeUrl === GeometricTwapResponse.typeUrl || typeof o.geometric_twap === "string"); + }, + isAmino(o: any): o is GeometricTwapResponseAmino { + return o && (o.$typeUrl === GeometricTwapResponse.typeUrl || typeof o.geometric_twap === "string"); + }, encode(message: GeometricTwapResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.geometricTwap !== "") { writer.uint32(10).string(Decimal.fromUserInput(message.geometricTwap, 18).atomics); @@ -684,15 +859,27 @@ export const GeometricTwapResponse = { } return message; }, + fromJSON(object: any): GeometricTwapResponse { + return { + geometricTwap: isSet(object.geometricTwap) ? String(object.geometricTwap) : "" + }; + }, + toJSON(message: GeometricTwapResponse): unknown { + const obj: any = {}; + message.geometricTwap !== undefined && (obj.geometricTwap = message.geometricTwap); + return obj; + }, fromPartial(object: Partial): GeometricTwapResponse { const message = createBaseGeometricTwapResponse(); message.geometricTwap = object.geometricTwap ?? ""; return message; }, fromAmino(object: GeometricTwapResponseAmino): GeometricTwapResponse { - return { - geometricTwap: object.geometric_twap - }; + const message = createBaseGeometricTwapResponse(); + if (object.geometric_twap !== undefined && object.geometric_twap !== null) { + message.geometricTwap = object.geometric_twap; + } + return message; }, toAmino(message: GeometricTwapResponse): GeometricTwapResponseAmino { const obj: any = {}; @@ -721,16 +908,28 @@ export const GeometricTwapResponse = { }; } }; +GlobalDecoderRegistry.register(GeometricTwapResponse.typeUrl, GeometricTwapResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(GeometricTwapResponse.aminoType, GeometricTwapResponse.typeUrl); function createBaseGeometricTwapToNowRequest(): GeometricTwapToNowRequest { return { poolId: BigInt(0), baseAsset: "", quoteAsset: "", - startTime: undefined + startTime: new Date() }; } export const GeometricTwapToNowRequest = { typeUrl: "/osmosis.twap.v1beta1.GeometricTwapToNowRequest", + aminoType: "osmosis/twap/geometric-twap-to-now-request", + is(o: any): o is GeometricTwapToNowRequest { + return o && (o.$typeUrl === GeometricTwapToNowRequest.typeUrl || typeof o.poolId === "bigint" && typeof o.baseAsset === "string" && typeof o.quoteAsset === "string" && Timestamp.is(o.startTime)); + }, + isSDK(o: any): o is GeometricTwapToNowRequestSDKType { + return o && (o.$typeUrl === GeometricTwapToNowRequest.typeUrl || typeof o.pool_id === "bigint" && typeof o.base_asset === "string" && typeof o.quote_asset === "string" && Timestamp.isSDK(o.start_time)); + }, + isAmino(o: any): o is GeometricTwapToNowRequestAmino { + return o && (o.$typeUrl === GeometricTwapToNowRequest.typeUrl || typeof o.pool_id === "bigint" && typeof o.base_asset === "string" && typeof o.quote_asset === "string" && Timestamp.isAmino(o.start_time)); + }, encode(message: GeometricTwapToNowRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.poolId !== BigInt(0)) { writer.uint32(8).uint64(message.poolId); @@ -772,6 +971,22 @@ export const GeometricTwapToNowRequest = { } return message; }, + fromJSON(object: any): GeometricTwapToNowRequest { + return { + poolId: isSet(object.poolId) ? BigInt(object.poolId.toString()) : BigInt(0), + baseAsset: isSet(object.baseAsset) ? String(object.baseAsset) : "", + quoteAsset: isSet(object.quoteAsset) ? String(object.quoteAsset) : "", + startTime: isSet(object.startTime) ? new Date(object.startTime) : undefined + }; + }, + toJSON(message: GeometricTwapToNowRequest): unknown { + const obj: any = {}; + message.poolId !== undefined && (obj.poolId = (message.poolId || BigInt(0)).toString()); + message.baseAsset !== undefined && (obj.baseAsset = message.baseAsset); + message.quoteAsset !== undefined && (obj.quoteAsset = message.quoteAsset); + message.startTime !== undefined && (obj.startTime = message.startTime.toISOString()); + return obj; + }, fromPartial(object: Partial): GeometricTwapToNowRequest { const message = createBaseGeometricTwapToNowRequest(); message.poolId = object.poolId !== undefined && object.poolId !== null ? BigInt(object.poolId.toString()) : BigInt(0); @@ -781,19 +996,27 @@ export const GeometricTwapToNowRequest = { return message; }, fromAmino(object: GeometricTwapToNowRequestAmino): GeometricTwapToNowRequest { - return { - poolId: BigInt(object.pool_id), - baseAsset: object.base_asset, - quoteAsset: object.quote_asset, - startTime: object.start_time - }; + const message = createBaseGeometricTwapToNowRequest(); + if (object.pool_id !== undefined && object.pool_id !== null) { + message.poolId = BigInt(object.pool_id); + } + if (object.base_asset !== undefined && object.base_asset !== null) { + message.baseAsset = object.base_asset; + } + if (object.quote_asset !== undefined && object.quote_asset !== null) { + message.quoteAsset = object.quote_asset; + } + if (object.start_time !== undefined && object.start_time !== null) { + message.startTime = fromTimestamp(Timestamp.fromAmino(object.start_time)); + } + return message; }, toAmino(message: GeometricTwapToNowRequest): GeometricTwapToNowRequestAmino { const obj: any = {}; obj.pool_id = message.poolId ? message.poolId.toString() : undefined; obj.base_asset = message.baseAsset; obj.quote_asset = message.quoteAsset; - obj.start_time = message.startTime; + obj.start_time = message.startTime ? Timestamp.toAmino(toTimestamp(message.startTime)) : undefined; return obj; }, fromAminoMsg(object: GeometricTwapToNowRequestAminoMsg): GeometricTwapToNowRequest { @@ -818,6 +1041,8 @@ export const GeometricTwapToNowRequest = { }; } }; +GlobalDecoderRegistry.register(GeometricTwapToNowRequest.typeUrl, GeometricTwapToNowRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(GeometricTwapToNowRequest.aminoType, GeometricTwapToNowRequest.typeUrl); function createBaseGeometricTwapToNowResponse(): GeometricTwapToNowResponse { return { geometricTwap: "" @@ -825,6 +1050,16 @@ function createBaseGeometricTwapToNowResponse(): GeometricTwapToNowResponse { } export const GeometricTwapToNowResponse = { typeUrl: "/osmosis.twap.v1beta1.GeometricTwapToNowResponse", + aminoType: "osmosis/twap/geometric-twap-to-now-response", + is(o: any): o is GeometricTwapToNowResponse { + return o && (o.$typeUrl === GeometricTwapToNowResponse.typeUrl || typeof o.geometricTwap === "string"); + }, + isSDK(o: any): o is GeometricTwapToNowResponseSDKType { + return o && (o.$typeUrl === GeometricTwapToNowResponse.typeUrl || typeof o.geometric_twap === "string"); + }, + isAmino(o: any): o is GeometricTwapToNowResponseAmino { + return o && (o.$typeUrl === GeometricTwapToNowResponse.typeUrl || typeof o.geometric_twap === "string"); + }, encode(message: GeometricTwapToNowResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.geometricTwap !== "") { writer.uint32(10).string(Decimal.fromUserInput(message.geometricTwap, 18).atomics); @@ -848,15 +1083,27 @@ export const GeometricTwapToNowResponse = { } return message; }, + fromJSON(object: any): GeometricTwapToNowResponse { + return { + geometricTwap: isSet(object.geometricTwap) ? String(object.geometricTwap) : "" + }; + }, + toJSON(message: GeometricTwapToNowResponse): unknown { + const obj: any = {}; + message.geometricTwap !== undefined && (obj.geometricTwap = message.geometricTwap); + return obj; + }, fromPartial(object: Partial): GeometricTwapToNowResponse { const message = createBaseGeometricTwapToNowResponse(); message.geometricTwap = object.geometricTwap ?? ""; return message; }, fromAmino(object: GeometricTwapToNowResponseAmino): GeometricTwapToNowResponse { - return { - geometricTwap: object.geometric_twap - }; + const message = createBaseGeometricTwapToNowResponse(); + if (object.geometric_twap !== undefined && object.geometric_twap !== null) { + message.geometricTwap = object.geometric_twap; + } + return message; }, toAmino(message: GeometricTwapToNowResponse): GeometricTwapToNowResponseAmino { const obj: any = {}; @@ -885,11 +1132,23 @@ export const GeometricTwapToNowResponse = { }; } }; +GlobalDecoderRegistry.register(GeometricTwapToNowResponse.typeUrl, GeometricTwapToNowResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(GeometricTwapToNowResponse.aminoType, GeometricTwapToNowResponse.typeUrl); function createBaseParamsRequest(): ParamsRequest { return {}; } export const ParamsRequest = { typeUrl: "/osmosis.twap.v1beta1.ParamsRequest", + aminoType: "osmosis/twap/params-request", + is(o: any): o is ParamsRequest { + return o && o.$typeUrl === ParamsRequest.typeUrl; + }, + isSDK(o: any): o is ParamsRequestSDKType { + return o && o.$typeUrl === ParamsRequest.typeUrl; + }, + isAmino(o: any): o is ParamsRequestAmino { + return o && o.$typeUrl === ParamsRequest.typeUrl; + }, encode(_: ParamsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, @@ -907,12 +1166,20 @@ export const ParamsRequest = { } return message; }, + fromJSON(_: any): ParamsRequest { + return {}; + }, + toJSON(_: ParamsRequest): unknown { + const obj: any = {}; + return obj; + }, fromPartial(_: Partial): ParamsRequest { const message = createBaseParamsRequest(); return message; }, fromAmino(_: ParamsRequestAmino): ParamsRequest { - return {}; + const message = createBaseParamsRequest(); + return message; }, toAmino(_: ParamsRequest): ParamsRequestAmino { const obj: any = {}; @@ -940,6 +1207,8 @@ export const ParamsRequest = { }; } }; +GlobalDecoderRegistry.register(ParamsRequest.typeUrl, ParamsRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(ParamsRequest.aminoType, ParamsRequest.typeUrl); function createBaseParamsResponse(): ParamsResponse { return { params: Params.fromPartial({}) @@ -947,6 +1216,16 @@ function createBaseParamsResponse(): ParamsResponse { } export const ParamsResponse = { typeUrl: "/osmosis.twap.v1beta1.ParamsResponse", + aminoType: "osmosis/twap/params-response", + is(o: any): o is ParamsResponse { + return o && (o.$typeUrl === ParamsResponse.typeUrl || Params.is(o.params)); + }, + isSDK(o: any): o is ParamsResponseSDKType { + return o && (o.$typeUrl === ParamsResponse.typeUrl || Params.isSDK(o.params)); + }, + isAmino(o: any): o is ParamsResponseAmino { + return o && (o.$typeUrl === ParamsResponse.typeUrl || Params.isAmino(o.params)); + }, encode(message: ParamsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.params !== undefined) { Params.encode(message.params, writer.uint32(10).fork()).ldelim(); @@ -970,15 +1249,27 @@ export const ParamsResponse = { } return message; }, + fromJSON(object: any): ParamsResponse { + return { + params: isSet(object.params) ? Params.fromJSON(object.params) : undefined + }; + }, + toJSON(message: ParamsResponse): unknown { + const obj: any = {}; + message.params !== undefined && (obj.params = message.params ? Params.toJSON(message.params) : undefined); + return obj; + }, fromPartial(object: Partial): ParamsResponse { const message = createBaseParamsResponse(); message.params = object.params !== undefined && object.params !== null ? Params.fromPartial(object.params) : undefined; return message; }, fromAmino(object: ParamsResponseAmino): ParamsResponse { - return { - params: object?.params ? Params.fromAmino(object.params) : undefined - }; + const message = createBaseParamsResponse(); + if (object.params !== undefined && object.params !== null) { + message.params = Params.fromAmino(object.params); + } + return message; }, toAmino(message: ParamsResponse): ParamsResponseAmino { const obj: any = {}; @@ -1006,4 +1297,6 @@ export const ParamsResponse = { value: ParamsResponse.encode(message).finish() }; } -}; \ No newline at end of file +}; +GlobalDecoderRegistry.register(ParamsResponse.typeUrl, ParamsResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(ParamsResponse.aminoType, ParamsResponse.typeUrl); \ No newline at end of file diff --git a/packages/osmojs/src/codegen/osmosis/twap/v1beta1/twap_record.ts b/packages/osmojs/src/codegen/osmosis/twap/v1beta1/twap_record.ts index 5f49a13cd..e7aa241c7 100644 --- a/packages/osmojs/src/codegen/osmosis/twap/v1beta1/twap_record.ts +++ b/packages/osmojs/src/codegen/osmosis/twap/v1beta1/twap_record.ts @@ -1,7 +1,8 @@ import { Timestamp } from "../../../google/protobuf/timestamp"; import { BinaryReader, BinaryWriter } from "../../../binary"; -import { toTimestamp, fromTimestamp } from "../../../helpers"; +import { toTimestamp, fromTimestamp, isSet } from "../../../helpers"; import { Decimal } from "@cosmjs/math"; +import { GlobalDecoderRegistry } from "../../../registry"; /** * A TWAP record should be indexed in state by pool_id, (asset pair), timestamp * The asset pair assets should be lexicographically sorted. @@ -34,7 +35,7 @@ export interface TwapRecord { p1ArithmeticTwapAccumulator: string; geometricTwapAccumulator: string; /** - * This field contains the time in which the last spot price error occured. + * This field contains the time in which the last spot price error occurred. * It is used to alert the caller if they are getting a potentially erroneous * TWAP, due to an unforeseen underlying error. */ @@ -54,33 +55,33 @@ export interface TwapRecordProtoMsg { * now. */ export interface TwapRecordAmino { - pool_id: string; + pool_id?: string; /** Lexicographically smaller denom of the pair */ - asset0_denom: string; + asset0_denom?: string; /** Lexicographically larger denom of the pair */ - asset1_denom: string; + asset1_denom?: string; /** height this record corresponds to, for debugging purposes */ - height: string; + height?: string; /** * This field should only exist until we have a global registry in the state * machine, mapping prior block heights within {TIME RANGE} to times. */ - time?: Date; + time?: string; /** * We store the last spot prices in the struct, so that we can interpolate * accumulator values for times between when accumulator records are stored. */ - p0_last_spot_price: string; - p1_last_spot_price: string; - p0_arithmetic_twap_accumulator: string; - p1_arithmetic_twap_accumulator: string; - geometric_twap_accumulator: string; + p0_last_spot_price?: string; + p1_last_spot_price?: string; + p0_arithmetic_twap_accumulator?: string; + p1_arithmetic_twap_accumulator?: string; + geometric_twap_accumulator?: string; /** - * This field contains the time in which the last spot price error occured. + * This field contains the time in which the last spot price error occurred. * It is used to alert the caller if they are getting a potentially erroneous * TWAP, due to an unforeseen underlying error. */ - last_error_time?: Date; + last_error_time?: string; } export interface TwapRecordAminoMsg { type: "osmosis/twap/twap-record"; @@ -114,17 +115,27 @@ function createBaseTwapRecord(): TwapRecord { asset0Denom: "", asset1Denom: "", height: BigInt(0), - time: undefined, + time: new Date(), p0LastSpotPrice: "", p1LastSpotPrice: "", p0ArithmeticTwapAccumulator: "", p1ArithmeticTwapAccumulator: "", geometricTwapAccumulator: "", - lastErrorTime: undefined + lastErrorTime: new Date() }; } export const TwapRecord = { typeUrl: "/osmosis.twap.v1beta1.TwapRecord", + aminoType: "osmosis/twap/twap-record", + is(o: any): o is TwapRecord { + return o && (o.$typeUrl === TwapRecord.typeUrl || typeof o.poolId === "bigint" && typeof o.asset0Denom === "string" && typeof o.asset1Denom === "string" && typeof o.height === "bigint" && Timestamp.is(o.time) && typeof o.p0LastSpotPrice === "string" && typeof o.p1LastSpotPrice === "string" && typeof o.p0ArithmeticTwapAccumulator === "string" && typeof o.p1ArithmeticTwapAccumulator === "string" && typeof o.geometricTwapAccumulator === "string" && Timestamp.is(o.lastErrorTime)); + }, + isSDK(o: any): o is TwapRecordSDKType { + return o && (o.$typeUrl === TwapRecord.typeUrl || typeof o.pool_id === "bigint" && typeof o.asset0_denom === "string" && typeof o.asset1_denom === "string" && typeof o.height === "bigint" && Timestamp.isSDK(o.time) && typeof o.p0_last_spot_price === "string" && typeof o.p1_last_spot_price === "string" && typeof o.p0_arithmetic_twap_accumulator === "string" && typeof o.p1_arithmetic_twap_accumulator === "string" && typeof o.geometric_twap_accumulator === "string" && Timestamp.isSDK(o.last_error_time)); + }, + isAmino(o: any): o is TwapRecordAmino { + return o && (o.$typeUrl === TwapRecord.typeUrl || typeof o.pool_id === "bigint" && typeof o.asset0_denom === "string" && typeof o.asset1_denom === "string" && typeof o.height === "bigint" && Timestamp.isAmino(o.time) && typeof o.p0_last_spot_price === "string" && typeof o.p1_last_spot_price === "string" && typeof o.p0_arithmetic_twap_accumulator === "string" && typeof o.p1_arithmetic_twap_accumulator === "string" && typeof o.geometric_twap_accumulator === "string" && Timestamp.isAmino(o.last_error_time)); + }, encode(message: TwapRecord, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.poolId !== BigInt(0)) { writer.uint32(8).uint64(message.poolId); @@ -208,6 +219,36 @@ export const TwapRecord = { } return message; }, + fromJSON(object: any): TwapRecord { + return { + poolId: isSet(object.poolId) ? BigInt(object.poolId.toString()) : BigInt(0), + asset0Denom: isSet(object.asset0Denom) ? String(object.asset0Denom) : "", + asset1Denom: isSet(object.asset1Denom) ? String(object.asset1Denom) : "", + height: isSet(object.height) ? BigInt(object.height.toString()) : BigInt(0), + time: isSet(object.time) ? new Date(object.time) : undefined, + p0LastSpotPrice: isSet(object.p0LastSpotPrice) ? String(object.p0LastSpotPrice) : "", + p1LastSpotPrice: isSet(object.p1LastSpotPrice) ? String(object.p1LastSpotPrice) : "", + p0ArithmeticTwapAccumulator: isSet(object.p0ArithmeticTwapAccumulator) ? String(object.p0ArithmeticTwapAccumulator) : "", + p1ArithmeticTwapAccumulator: isSet(object.p1ArithmeticTwapAccumulator) ? String(object.p1ArithmeticTwapAccumulator) : "", + geometricTwapAccumulator: isSet(object.geometricTwapAccumulator) ? String(object.geometricTwapAccumulator) : "", + lastErrorTime: isSet(object.lastErrorTime) ? new Date(object.lastErrorTime) : undefined + }; + }, + toJSON(message: TwapRecord): unknown { + const obj: any = {}; + message.poolId !== undefined && (obj.poolId = (message.poolId || BigInt(0)).toString()); + message.asset0Denom !== undefined && (obj.asset0Denom = message.asset0Denom); + message.asset1Denom !== undefined && (obj.asset1Denom = message.asset1Denom); + message.height !== undefined && (obj.height = (message.height || BigInt(0)).toString()); + message.time !== undefined && (obj.time = message.time.toISOString()); + message.p0LastSpotPrice !== undefined && (obj.p0LastSpotPrice = message.p0LastSpotPrice); + message.p1LastSpotPrice !== undefined && (obj.p1LastSpotPrice = message.p1LastSpotPrice); + message.p0ArithmeticTwapAccumulator !== undefined && (obj.p0ArithmeticTwapAccumulator = message.p0ArithmeticTwapAccumulator); + message.p1ArithmeticTwapAccumulator !== undefined && (obj.p1ArithmeticTwapAccumulator = message.p1ArithmeticTwapAccumulator); + message.geometricTwapAccumulator !== undefined && (obj.geometricTwapAccumulator = message.geometricTwapAccumulator); + message.lastErrorTime !== undefined && (obj.lastErrorTime = message.lastErrorTime.toISOString()); + return obj; + }, fromPartial(object: Partial): TwapRecord { const message = createBaseTwapRecord(); message.poolId = object.poolId !== undefined && object.poolId !== null ? BigInt(object.poolId.toString()) : BigInt(0); @@ -224,19 +265,41 @@ export const TwapRecord = { return message; }, fromAmino(object: TwapRecordAmino): TwapRecord { - return { - poolId: BigInt(object.pool_id), - asset0Denom: object.asset0_denom, - asset1Denom: object.asset1_denom, - height: BigInt(object.height), - time: object.time, - p0LastSpotPrice: object.p0_last_spot_price, - p1LastSpotPrice: object.p1_last_spot_price, - p0ArithmeticTwapAccumulator: object.p0_arithmetic_twap_accumulator, - p1ArithmeticTwapAccumulator: object.p1_arithmetic_twap_accumulator, - geometricTwapAccumulator: object.geometric_twap_accumulator, - lastErrorTime: object.last_error_time - }; + const message = createBaseTwapRecord(); + if (object.pool_id !== undefined && object.pool_id !== null) { + message.poolId = BigInt(object.pool_id); + } + if (object.asset0_denom !== undefined && object.asset0_denom !== null) { + message.asset0Denom = object.asset0_denom; + } + if (object.asset1_denom !== undefined && object.asset1_denom !== null) { + message.asset1Denom = object.asset1_denom; + } + if (object.height !== undefined && object.height !== null) { + message.height = BigInt(object.height); + } + if (object.time !== undefined && object.time !== null) { + message.time = fromTimestamp(Timestamp.fromAmino(object.time)); + } + if (object.p0_last_spot_price !== undefined && object.p0_last_spot_price !== null) { + message.p0LastSpotPrice = object.p0_last_spot_price; + } + if (object.p1_last_spot_price !== undefined && object.p1_last_spot_price !== null) { + message.p1LastSpotPrice = object.p1_last_spot_price; + } + if (object.p0_arithmetic_twap_accumulator !== undefined && object.p0_arithmetic_twap_accumulator !== null) { + message.p0ArithmeticTwapAccumulator = object.p0_arithmetic_twap_accumulator; + } + if (object.p1_arithmetic_twap_accumulator !== undefined && object.p1_arithmetic_twap_accumulator !== null) { + message.p1ArithmeticTwapAccumulator = object.p1_arithmetic_twap_accumulator; + } + if (object.geometric_twap_accumulator !== undefined && object.geometric_twap_accumulator !== null) { + message.geometricTwapAccumulator = object.geometric_twap_accumulator; + } + if (object.last_error_time !== undefined && object.last_error_time !== null) { + message.lastErrorTime = fromTimestamp(Timestamp.fromAmino(object.last_error_time)); + } + return message; }, toAmino(message: TwapRecord): TwapRecordAmino { const obj: any = {}; @@ -244,13 +307,13 @@ export const TwapRecord = { obj.asset0_denom = message.asset0Denom; obj.asset1_denom = message.asset1Denom; obj.height = message.height ? message.height.toString() : undefined; - obj.time = message.time; + obj.time = message.time ? Timestamp.toAmino(toTimestamp(message.time)) : undefined; obj.p0_last_spot_price = message.p0LastSpotPrice; obj.p1_last_spot_price = message.p1LastSpotPrice; obj.p0_arithmetic_twap_accumulator = message.p0ArithmeticTwapAccumulator; obj.p1_arithmetic_twap_accumulator = message.p1ArithmeticTwapAccumulator; obj.geometric_twap_accumulator = message.geometricTwapAccumulator; - obj.last_error_time = message.lastErrorTime; + obj.last_error_time = message.lastErrorTime ? Timestamp.toAmino(toTimestamp(message.lastErrorTime)) : undefined; return obj; }, fromAminoMsg(object: TwapRecordAminoMsg): TwapRecord { @@ -274,4 +337,6 @@ export const TwapRecord = { value: TwapRecord.encode(message).finish() }; } -}; \ No newline at end of file +}; +GlobalDecoderRegistry.register(TwapRecord.typeUrl, TwapRecord); +GlobalDecoderRegistry.registerAminoProtoMapping(TwapRecord.aminoType, TwapRecord.typeUrl); \ No newline at end of file diff --git a/packages/osmojs/src/codegen/osmosis/txfees/v1beta1/feetoken.ts b/packages/osmojs/src/codegen/osmosis/txfees/v1beta1/feetoken.ts index 15f488860..234e32a7b 100644 --- a/packages/osmojs/src/codegen/osmosis/txfees/v1beta1/feetoken.ts +++ b/packages/osmojs/src/codegen/osmosis/txfees/v1beta1/feetoken.ts @@ -1,4 +1,6 @@ import { BinaryReader, BinaryWriter } from "../../../binary"; +import { isSet } from "../../../helpers"; +import { GlobalDecoderRegistry } from "../../../registry"; /** * FeeToken is a struct that specifies a coin denom, and pool ID pair. * This marks the token as eligible for use as a tx fee asset in Osmosis. @@ -20,8 +22,8 @@ export interface FeeTokenProtoMsg { * The pool ID must have osmo as one of its assets. */ export interface FeeTokenAmino { - denom: string; - poolID: string; + denom?: string; + poolID?: string; } export interface FeeTokenAminoMsg { type: "osmosis/txfees/fee-token"; @@ -45,6 +47,16 @@ function createBaseFeeToken(): FeeToken { } export const FeeToken = { typeUrl: "/osmosis.txfees.v1beta1.FeeToken", + aminoType: "osmosis/txfees/fee-token", + is(o: any): o is FeeToken { + return o && (o.$typeUrl === FeeToken.typeUrl || typeof o.denom === "string" && typeof o.poolID === "bigint"); + }, + isSDK(o: any): o is FeeTokenSDKType { + return o && (o.$typeUrl === FeeToken.typeUrl || typeof o.denom === "string" && typeof o.poolID === "bigint"); + }, + isAmino(o: any): o is FeeTokenAmino { + return o && (o.$typeUrl === FeeToken.typeUrl || typeof o.denom === "string" && typeof o.poolID === "bigint"); + }, encode(message: FeeToken, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.denom !== "") { writer.uint32(10).string(message.denom); @@ -74,6 +86,18 @@ export const FeeToken = { } return message; }, + fromJSON(object: any): FeeToken { + return { + denom: isSet(object.denom) ? String(object.denom) : "", + poolID: isSet(object.poolID) ? BigInt(object.poolID.toString()) : BigInt(0) + }; + }, + toJSON(message: FeeToken): unknown { + const obj: any = {}; + message.denom !== undefined && (obj.denom = message.denom); + message.poolID !== undefined && (obj.poolID = (message.poolID || BigInt(0)).toString()); + return obj; + }, fromPartial(object: Partial): FeeToken { const message = createBaseFeeToken(); message.denom = object.denom ?? ""; @@ -81,10 +105,14 @@ export const FeeToken = { return message; }, fromAmino(object: FeeTokenAmino): FeeToken { - return { - denom: object.denom, - poolID: BigInt(object.poolID) - }; + const message = createBaseFeeToken(); + if (object.denom !== undefined && object.denom !== null) { + message.denom = object.denom; + } + if (object.poolID !== undefined && object.poolID !== null) { + message.poolID = BigInt(object.poolID); + } + return message; }, toAmino(message: FeeToken): FeeTokenAmino { const obj: any = {}; @@ -113,4 +141,6 @@ export const FeeToken = { value: FeeToken.encode(message).finish() }; } -}; \ No newline at end of file +}; +GlobalDecoderRegistry.register(FeeToken.typeUrl, FeeToken); +GlobalDecoderRegistry.registerAminoProtoMapping(FeeToken.aminoType, FeeToken.typeUrl); \ No newline at end of file diff --git a/packages/osmojs/src/codegen/osmosis/txfees/v1beta1/genesis.ts b/packages/osmojs/src/codegen/osmosis/txfees/v1beta1/genesis.ts index 8e3141e32..11a4a2a25 100644 --- a/packages/osmojs/src/codegen/osmosis/txfees/v1beta1/genesis.ts +++ b/packages/osmojs/src/codegen/osmosis/txfees/v1beta1/genesis.ts @@ -1,5 +1,7 @@ import { FeeToken, FeeTokenAmino, FeeTokenSDKType } from "./feetoken"; import { BinaryReader, BinaryWriter } from "../../../binary"; +import { isSet } from "../../../helpers"; +import { GlobalDecoderRegistry } from "../../../registry"; /** GenesisState defines the txfees module's genesis state. */ export interface GenesisState { basedenom: string; @@ -11,8 +13,8 @@ export interface GenesisStateProtoMsg { } /** GenesisState defines the txfees module's genesis state. */ export interface GenesisStateAmino { - basedenom: string; - feetokens: FeeTokenAmino[]; + basedenom?: string; + feetokens?: FeeTokenAmino[]; } export interface GenesisStateAminoMsg { type: "osmosis/txfees/genesis-state"; @@ -31,6 +33,16 @@ function createBaseGenesisState(): GenesisState { } export const GenesisState = { typeUrl: "/osmosis.txfees.v1beta1.GenesisState", + aminoType: "osmosis/txfees/genesis-state", + is(o: any): o is GenesisState { + return o && (o.$typeUrl === GenesisState.typeUrl || typeof o.basedenom === "string" && Array.isArray(o.feetokens) && (!o.feetokens.length || FeeToken.is(o.feetokens[0]))); + }, + isSDK(o: any): o is GenesisStateSDKType { + return o && (o.$typeUrl === GenesisState.typeUrl || typeof o.basedenom === "string" && Array.isArray(o.feetokens) && (!o.feetokens.length || FeeToken.isSDK(o.feetokens[0]))); + }, + isAmino(o: any): o is GenesisStateAmino { + return o && (o.$typeUrl === GenesisState.typeUrl || typeof o.basedenom === "string" && Array.isArray(o.feetokens) && (!o.feetokens.length || FeeToken.isAmino(o.feetokens[0]))); + }, encode(message: GenesisState, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.basedenom !== "") { writer.uint32(10).string(message.basedenom); @@ -60,6 +72,22 @@ export const GenesisState = { } return message; }, + fromJSON(object: any): GenesisState { + return { + basedenom: isSet(object.basedenom) ? String(object.basedenom) : "", + feetokens: Array.isArray(object?.feetokens) ? object.feetokens.map((e: any) => FeeToken.fromJSON(e)) : [] + }; + }, + toJSON(message: GenesisState): unknown { + const obj: any = {}; + message.basedenom !== undefined && (obj.basedenom = message.basedenom); + if (message.feetokens) { + obj.feetokens = message.feetokens.map(e => e ? FeeToken.toJSON(e) : undefined); + } else { + obj.feetokens = []; + } + return obj; + }, fromPartial(object: Partial): GenesisState { const message = createBaseGenesisState(); message.basedenom = object.basedenom ?? ""; @@ -67,10 +95,12 @@ export const GenesisState = { return message; }, fromAmino(object: GenesisStateAmino): GenesisState { - return { - basedenom: object.basedenom, - feetokens: Array.isArray(object?.feetokens) ? object.feetokens.map((e: any) => FeeToken.fromAmino(e)) : [] - }; + const message = createBaseGenesisState(); + if (object.basedenom !== undefined && object.basedenom !== null) { + message.basedenom = object.basedenom; + } + message.feetokens = object.feetokens?.map(e => FeeToken.fromAmino(e)) || []; + return message; }, toAmino(message: GenesisState): GenesisStateAmino { const obj: any = {}; @@ -103,4 +133,6 @@ export const GenesisState = { value: GenesisState.encode(message).finish() }; } -}; \ No newline at end of file +}; +GlobalDecoderRegistry.register(GenesisState.typeUrl, GenesisState); +GlobalDecoderRegistry.registerAminoProtoMapping(GenesisState.aminoType, GenesisState.typeUrl); \ No newline at end of file diff --git a/packages/osmojs/src/codegen/osmosis/txfees/v1beta1/gov.ts b/packages/osmojs/src/codegen/osmosis/txfees/v1beta1/gov.ts index 615a09480..beb3e1dd0 100644 --- a/packages/osmojs/src/codegen/osmosis/txfees/v1beta1/gov.ts +++ b/packages/osmojs/src/codegen/osmosis/txfees/v1beta1/gov.ts @@ -1,5 +1,7 @@ import { FeeToken, FeeTokenAmino, FeeTokenSDKType } from "./feetoken"; import { BinaryReader, BinaryWriter } from "../../../binary"; +import { isSet } from "../../../helpers"; +import { GlobalDecoderRegistry } from "../../../registry"; /** * UpdateFeeTokenProposal is a gov Content type for adding new whitelisted fee * token(s). It must specify a denom along with gamm pool ID to use as a spot @@ -8,7 +10,7 @@ import { BinaryReader, BinaryWriter } from "../../../binary"; * set to 0, it will remove the denom from the whitelisted set. */ export interface UpdateFeeTokenProposal { - $typeUrl?: string; + $typeUrl?: "/osmosis.txfees.v1beta1.UpdateFeeTokenProposal"; title: string; description: string; feetokens: FeeToken[]; @@ -25,9 +27,9 @@ export interface UpdateFeeTokenProposalProtoMsg { * set to 0, it will remove the denom from the whitelisted set. */ export interface UpdateFeeTokenProposalAmino { - title: string; - description: string; - feetokens: FeeTokenAmino[]; + title?: string; + description?: string; + feetokens?: FeeTokenAmino[]; } export interface UpdateFeeTokenProposalAminoMsg { type: "osmosis/UpdateFeeTokenProposal"; @@ -41,7 +43,7 @@ export interface UpdateFeeTokenProposalAminoMsg { * set to 0, it will remove the denom from the whitelisted set. */ export interface UpdateFeeTokenProposalSDKType { - $typeUrl?: string; + $typeUrl?: "/osmosis.txfees.v1beta1.UpdateFeeTokenProposal"; title: string; description: string; feetokens: FeeTokenSDKType[]; @@ -56,6 +58,16 @@ function createBaseUpdateFeeTokenProposal(): UpdateFeeTokenProposal { } export const UpdateFeeTokenProposal = { typeUrl: "/osmosis.txfees.v1beta1.UpdateFeeTokenProposal", + aminoType: "osmosis/UpdateFeeTokenProposal", + is(o: any): o is UpdateFeeTokenProposal { + return o && (o.$typeUrl === UpdateFeeTokenProposal.typeUrl || typeof o.title === "string" && typeof o.description === "string" && Array.isArray(o.feetokens) && (!o.feetokens.length || FeeToken.is(o.feetokens[0]))); + }, + isSDK(o: any): o is UpdateFeeTokenProposalSDKType { + return o && (o.$typeUrl === UpdateFeeTokenProposal.typeUrl || typeof o.title === "string" && typeof o.description === "string" && Array.isArray(o.feetokens) && (!o.feetokens.length || FeeToken.isSDK(o.feetokens[0]))); + }, + isAmino(o: any): o is UpdateFeeTokenProposalAmino { + return o && (o.$typeUrl === UpdateFeeTokenProposal.typeUrl || typeof o.title === "string" && typeof o.description === "string" && Array.isArray(o.feetokens) && (!o.feetokens.length || FeeToken.isAmino(o.feetokens[0]))); + }, encode(message: UpdateFeeTokenProposal, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.title !== "") { writer.uint32(10).string(message.title); @@ -91,6 +103,24 @@ export const UpdateFeeTokenProposal = { } return message; }, + fromJSON(object: any): UpdateFeeTokenProposal { + return { + title: isSet(object.title) ? String(object.title) : "", + description: isSet(object.description) ? String(object.description) : "", + feetokens: Array.isArray(object?.feetokens) ? object.feetokens.map((e: any) => FeeToken.fromJSON(e)) : [] + }; + }, + toJSON(message: UpdateFeeTokenProposal): unknown { + const obj: any = {}; + message.title !== undefined && (obj.title = message.title); + message.description !== undefined && (obj.description = message.description); + if (message.feetokens) { + obj.feetokens = message.feetokens.map(e => e ? FeeToken.toJSON(e) : undefined); + } else { + obj.feetokens = []; + } + return obj; + }, fromPartial(object: Partial): UpdateFeeTokenProposal { const message = createBaseUpdateFeeTokenProposal(); message.title = object.title ?? ""; @@ -99,11 +129,15 @@ export const UpdateFeeTokenProposal = { return message; }, fromAmino(object: UpdateFeeTokenProposalAmino): UpdateFeeTokenProposal { - return { - title: object.title, - description: object.description, - feetokens: Array.isArray(object?.feetokens) ? object.feetokens.map((e: any) => FeeToken.fromAmino(e)) : [] - }; + const message = createBaseUpdateFeeTokenProposal(); + if (object.title !== undefined && object.title !== null) { + message.title = object.title; + } + if (object.description !== undefined && object.description !== null) { + message.description = object.description; + } + message.feetokens = object.feetokens?.map(e => FeeToken.fromAmino(e)) || []; + return message; }, toAmino(message: UpdateFeeTokenProposal): UpdateFeeTokenProposalAmino { const obj: any = {}; @@ -137,4 +171,6 @@ export const UpdateFeeTokenProposal = { value: UpdateFeeTokenProposal.encode(message).finish() }; } -}; \ No newline at end of file +}; +GlobalDecoderRegistry.register(UpdateFeeTokenProposal.typeUrl, UpdateFeeTokenProposal); +GlobalDecoderRegistry.registerAminoProtoMapping(UpdateFeeTokenProposal.aminoType, UpdateFeeTokenProposal.typeUrl); \ No newline at end of file diff --git a/packages/osmojs/src/codegen/osmosis/txfees/v1beta1/query.lcd.ts b/packages/osmojs/src/codegen/osmosis/txfees/v1beta1/query.lcd.ts index 455dbdd73..7b6db4f38 100644 --- a/packages/osmojs/src/codegen/osmosis/txfees/v1beta1/query.lcd.ts +++ b/packages/osmojs/src/codegen/osmosis/txfees/v1beta1/query.lcd.ts @@ -1,5 +1,5 @@ import { LCDClient } from "@cosmology/lcd"; -import { QueryFeeTokensRequest, QueryFeeTokensResponseSDKType, QueryDenomSpotPriceRequest, QueryDenomSpotPriceResponseSDKType, QueryDenomPoolIdRequest, QueryDenomPoolIdResponseSDKType, QueryBaseDenomRequest, QueryBaseDenomResponseSDKType } from "./query"; +import { QueryFeeTokensRequest, QueryFeeTokensResponseSDKType, QueryDenomSpotPriceRequest, QueryDenomSpotPriceResponseSDKType, QueryDenomPoolIdRequest, QueryDenomPoolIdResponseSDKType, QueryBaseDenomRequest, QueryBaseDenomResponseSDKType, QueryEipBaseFeeRequest, QueryEipBaseFeeResponseSDKType } from "./query"; export class LCDQueryClient { req: LCDClient; constructor({ @@ -12,6 +12,7 @@ export class LCDQueryClient { this.denomSpotPrice = this.denomSpotPrice.bind(this); this.denomPoolId = this.denomPoolId.bind(this); this.baseDenom = this.baseDenom.bind(this); + this.getEipBaseFee = this.getEipBaseFee.bind(this); } /* FeeTokens returns a list of all the whitelisted fee tokens and their corresponding pools. It does not include the BaseDenom, which has its own @@ -41,4 +42,9 @@ export class LCDQueryClient { const endpoint = `osmosis/txfees/v1beta1/base_denom`; return await this.req.get(endpoint); } + /* Returns a list of all base denom tokens and their corresponding pools. */ + async getEipBaseFee(_params: QueryEipBaseFeeRequest = {}): Promise { + const endpoint = `osmosis/txfees/v1beta1/cur_eip_base_fee`; + return await this.req.get(endpoint); + } } \ No newline at end of file diff --git a/packages/osmojs/src/codegen/osmosis/txfees/v1beta1/query.rpc.Query.ts b/packages/osmojs/src/codegen/osmosis/txfees/v1beta1/query.rpc.Query.ts index 75d3a65b1..5caaea9df 100644 --- a/packages/osmojs/src/codegen/osmosis/txfees/v1beta1/query.rpc.Query.ts +++ b/packages/osmojs/src/codegen/osmosis/txfees/v1beta1/query.rpc.Query.ts @@ -1,7 +1,7 @@ import { Rpc } from "../../../helpers"; import { BinaryReader } from "../../../binary"; import { QueryClient, createProtobufRpcClient } from "@cosmjs/stargate"; -import { QueryFeeTokensRequest, QueryFeeTokensResponse, QueryDenomSpotPriceRequest, QueryDenomSpotPriceResponse, QueryDenomPoolIdRequest, QueryDenomPoolIdResponse, QueryBaseDenomRequest, QueryBaseDenomResponse } from "./query"; +import { QueryFeeTokensRequest, QueryFeeTokensResponse, QueryDenomSpotPriceRequest, QueryDenomSpotPriceResponse, QueryDenomPoolIdRequest, QueryDenomPoolIdResponse, QueryBaseDenomRequest, QueryBaseDenomResponse, QueryEipBaseFeeRequest, QueryEipBaseFeeResponse } from "./query"; export interface Query { /** * FeeTokens returns a list of all the whitelisted fee tokens and their @@ -15,6 +15,8 @@ export interface Query { denomPoolId(request: QueryDenomPoolIdRequest): Promise; /** Returns a list of all base denom tokens and their corresponding pools. */ baseDenom(request?: QueryBaseDenomRequest): Promise; + /** Returns a list of all base denom tokens and their corresponding pools. */ + getEipBaseFee(request?: QueryEipBaseFeeRequest): Promise; } export class QueryClientImpl implements Query { private readonly rpc: Rpc; @@ -24,6 +26,7 @@ export class QueryClientImpl implements Query { this.denomSpotPrice = this.denomSpotPrice.bind(this); this.denomPoolId = this.denomPoolId.bind(this); this.baseDenom = this.baseDenom.bind(this); + this.getEipBaseFee = this.getEipBaseFee.bind(this); } feeTokens(request: QueryFeeTokensRequest = {}): Promise { const data = QueryFeeTokensRequest.encode(request).finish(); @@ -45,6 +48,11 @@ export class QueryClientImpl implements Query { const promise = this.rpc.request("osmosis.txfees.v1beta1.Query", "BaseDenom", data); return promise.then(data => QueryBaseDenomResponse.decode(new BinaryReader(data))); } + getEipBaseFee(request: QueryEipBaseFeeRequest = {}): Promise { + const data = QueryEipBaseFeeRequest.encode(request).finish(); + const promise = this.rpc.request("osmosis.txfees.v1beta1.Query", "GetEipBaseFee", data); + return promise.then(data => QueryEipBaseFeeResponse.decode(new BinaryReader(data))); + } } export const createRpcQueryExtension = (base: QueryClient) => { const rpc = createProtobufRpcClient(base); @@ -61,6 +69,9 @@ export const createRpcQueryExtension = (base: QueryClient) => { }, baseDenom(request?: QueryBaseDenomRequest): Promise { return queryService.baseDenom(request); + }, + getEipBaseFee(request?: QueryEipBaseFeeRequest): Promise { + return queryService.getEipBaseFee(request); } }; }; \ No newline at end of file diff --git a/packages/osmojs/src/codegen/osmosis/txfees/v1beta1/query.ts b/packages/osmojs/src/codegen/osmosis/txfees/v1beta1/query.ts index 3139a8ec9..4d6061dc0 100644 --- a/packages/osmojs/src/codegen/osmosis/txfees/v1beta1/query.ts +++ b/packages/osmojs/src/codegen/osmosis/txfees/v1beta1/query.ts @@ -1,5 +1,7 @@ import { FeeToken, FeeTokenAmino, FeeTokenSDKType } from "./feetoken"; import { BinaryReader, BinaryWriter } from "../../../binary"; +import { GlobalDecoderRegistry } from "../../../registry"; +import { isSet } from "../../../helpers"; import { Decimal } from "@cosmjs/math"; export interface QueryFeeTokensRequest {} export interface QueryFeeTokensRequestProtoMsg { @@ -20,7 +22,7 @@ export interface QueryFeeTokensResponseProtoMsg { value: Uint8Array; } export interface QueryFeeTokensResponseAmino { - fee_tokens: FeeTokenAmino[]; + fee_tokens?: FeeTokenAmino[]; } export interface QueryFeeTokensResponseAminoMsg { type: "osmosis/txfees/query-fee-tokens-response"; @@ -45,7 +47,7 @@ export interface QueryDenomSpotPriceRequestProtoMsg { * price for the specified tx fee denom */ export interface QueryDenomSpotPriceRequestAmino { - denom: string; + denom?: string; } export interface QueryDenomSpotPriceRequestAminoMsg { type: "osmosis/txfees/query-denom-spot-price-request"; @@ -75,8 +77,8 @@ export interface QueryDenomSpotPriceResponseProtoMsg { * price for the specified tx fee denom */ export interface QueryDenomSpotPriceResponseAmino { - poolID: string; - spot_price: string; + poolID?: string; + spot_price?: string; } export interface QueryDenomSpotPriceResponseAminoMsg { type: "osmosis/txfees/query-denom-spot-price-response"; @@ -98,7 +100,7 @@ export interface QueryDenomPoolIdRequestProtoMsg { value: Uint8Array; } export interface QueryDenomPoolIdRequestAmino { - denom: string; + denom?: string; } export interface QueryDenomPoolIdRequestAminoMsg { type: "osmosis/txfees/query-denom-pool-id-request"; @@ -115,7 +117,7 @@ export interface QueryDenomPoolIdResponseProtoMsg { value: Uint8Array; } export interface QueryDenomPoolIdResponseAmino { - poolID: string; + poolID?: string; } export interface QueryDenomPoolIdResponseAminoMsg { type: "osmosis/txfees/query-denom-pool-id-response"; @@ -143,7 +145,7 @@ export interface QueryBaseDenomResponseProtoMsg { value: Uint8Array; } export interface QueryBaseDenomResponseAmino { - base_denom: string; + base_denom?: string; } export interface QueryBaseDenomResponseAminoMsg { type: "osmosis/txfees/query-base-denom-response"; @@ -152,11 +154,49 @@ export interface QueryBaseDenomResponseAminoMsg { export interface QueryBaseDenomResponseSDKType { base_denom: string; } +export interface QueryEipBaseFeeRequest {} +export interface QueryEipBaseFeeRequestProtoMsg { + typeUrl: "/osmosis.txfees.v1beta1.QueryEipBaseFeeRequest"; + value: Uint8Array; +} +export interface QueryEipBaseFeeRequestAmino {} +export interface QueryEipBaseFeeRequestAminoMsg { + type: "osmosis/txfees/query-eip-base-fee-request"; + value: QueryEipBaseFeeRequestAmino; +} +export interface QueryEipBaseFeeRequestSDKType {} +export interface QueryEipBaseFeeResponse { + baseFee: string; +} +export interface QueryEipBaseFeeResponseProtoMsg { + typeUrl: "/osmosis.txfees.v1beta1.QueryEipBaseFeeResponse"; + value: Uint8Array; +} +export interface QueryEipBaseFeeResponseAmino { + base_fee?: string; +} +export interface QueryEipBaseFeeResponseAminoMsg { + type: "osmosis/txfees/query-eip-base-fee-response"; + value: QueryEipBaseFeeResponseAmino; +} +export interface QueryEipBaseFeeResponseSDKType { + base_fee: string; +} function createBaseQueryFeeTokensRequest(): QueryFeeTokensRequest { return {}; } export const QueryFeeTokensRequest = { typeUrl: "/osmosis.txfees.v1beta1.QueryFeeTokensRequest", + aminoType: "osmosis/txfees/query-fee-tokens-request", + is(o: any): o is QueryFeeTokensRequest { + return o && o.$typeUrl === QueryFeeTokensRequest.typeUrl; + }, + isSDK(o: any): o is QueryFeeTokensRequestSDKType { + return o && o.$typeUrl === QueryFeeTokensRequest.typeUrl; + }, + isAmino(o: any): o is QueryFeeTokensRequestAmino { + return o && o.$typeUrl === QueryFeeTokensRequest.typeUrl; + }, encode(_: QueryFeeTokensRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, @@ -174,12 +214,20 @@ export const QueryFeeTokensRequest = { } return message; }, + fromJSON(_: any): QueryFeeTokensRequest { + return {}; + }, + toJSON(_: QueryFeeTokensRequest): unknown { + const obj: any = {}; + return obj; + }, fromPartial(_: Partial): QueryFeeTokensRequest { const message = createBaseQueryFeeTokensRequest(); return message; }, fromAmino(_: QueryFeeTokensRequestAmino): QueryFeeTokensRequest { - return {}; + const message = createBaseQueryFeeTokensRequest(); + return message; }, toAmino(_: QueryFeeTokensRequest): QueryFeeTokensRequestAmino { const obj: any = {}; @@ -207,6 +255,8 @@ export const QueryFeeTokensRequest = { }; } }; +GlobalDecoderRegistry.register(QueryFeeTokensRequest.typeUrl, QueryFeeTokensRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryFeeTokensRequest.aminoType, QueryFeeTokensRequest.typeUrl); function createBaseQueryFeeTokensResponse(): QueryFeeTokensResponse { return { feeTokens: [] @@ -214,6 +264,16 @@ function createBaseQueryFeeTokensResponse(): QueryFeeTokensResponse { } export const QueryFeeTokensResponse = { typeUrl: "/osmosis.txfees.v1beta1.QueryFeeTokensResponse", + aminoType: "osmosis/txfees/query-fee-tokens-response", + is(o: any): o is QueryFeeTokensResponse { + return o && (o.$typeUrl === QueryFeeTokensResponse.typeUrl || Array.isArray(o.feeTokens) && (!o.feeTokens.length || FeeToken.is(o.feeTokens[0]))); + }, + isSDK(o: any): o is QueryFeeTokensResponseSDKType { + return o && (o.$typeUrl === QueryFeeTokensResponse.typeUrl || Array.isArray(o.fee_tokens) && (!o.fee_tokens.length || FeeToken.isSDK(o.fee_tokens[0]))); + }, + isAmino(o: any): o is QueryFeeTokensResponseAmino { + return o && (o.$typeUrl === QueryFeeTokensResponse.typeUrl || Array.isArray(o.fee_tokens) && (!o.fee_tokens.length || FeeToken.isAmino(o.fee_tokens[0]))); + }, encode(message: QueryFeeTokensResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.feeTokens) { FeeToken.encode(v!, writer.uint32(10).fork()).ldelim(); @@ -237,15 +297,29 @@ export const QueryFeeTokensResponse = { } return message; }, + fromJSON(object: any): QueryFeeTokensResponse { + return { + feeTokens: Array.isArray(object?.feeTokens) ? object.feeTokens.map((e: any) => FeeToken.fromJSON(e)) : [] + }; + }, + toJSON(message: QueryFeeTokensResponse): unknown { + const obj: any = {}; + if (message.feeTokens) { + obj.feeTokens = message.feeTokens.map(e => e ? FeeToken.toJSON(e) : undefined); + } else { + obj.feeTokens = []; + } + return obj; + }, fromPartial(object: Partial): QueryFeeTokensResponse { const message = createBaseQueryFeeTokensResponse(); message.feeTokens = object.feeTokens?.map(e => FeeToken.fromPartial(e)) || []; return message; }, fromAmino(object: QueryFeeTokensResponseAmino): QueryFeeTokensResponse { - return { - feeTokens: Array.isArray(object?.fee_tokens) ? object.fee_tokens.map((e: any) => FeeToken.fromAmino(e)) : [] - }; + const message = createBaseQueryFeeTokensResponse(); + message.feeTokens = object.fee_tokens?.map(e => FeeToken.fromAmino(e)) || []; + return message; }, toAmino(message: QueryFeeTokensResponse): QueryFeeTokensResponseAmino { const obj: any = {}; @@ -278,6 +352,8 @@ export const QueryFeeTokensResponse = { }; } }; +GlobalDecoderRegistry.register(QueryFeeTokensResponse.typeUrl, QueryFeeTokensResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryFeeTokensResponse.aminoType, QueryFeeTokensResponse.typeUrl); function createBaseQueryDenomSpotPriceRequest(): QueryDenomSpotPriceRequest { return { denom: "" @@ -285,6 +361,16 @@ function createBaseQueryDenomSpotPriceRequest(): QueryDenomSpotPriceRequest { } export const QueryDenomSpotPriceRequest = { typeUrl: "/osmosis.txfees.v1beta1.QueryDenomSpotPriceRequest", + aminoType: "osmosis/txfees/query-denom-spot-price-request", + is(o: any): o is QueryDenomSpotPriceRequest { + return o && (o.$typeUrl === QueryDenomSpotPriceRequest.typeUrl || typeof o.denom === "string"); + }, + isSDK(o: any): o is QueryDenomSpotPriceRequestSDKType { + return o && (o.$typeUrl === QueryDenomSpotPriceRequest.typeUrl || typeof o.denom === "string"); + }, + isAmino(o: any): o is QueryDenomSpotPriceRequestAmino { + return o && (o.$typeUrl === QueryDenomSpotPriceRequest.typeUrl || typeof o.denom === "string"); + }, encode(message: QueryDenomSpotPriceRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.denom !== "") { writer.uint32(10).string(message.denom); @@ -308,15 +394,27 @@ export const QueryDenomSpotPriceRequest = { } return message; }, + fromJSON(object: any): QueryDenomSpotPriceRequest { + return { + denom: isSet(object.denom) ? String(object.denom) : "" + }; + }, + toJSON(message: QueryDenomSpotPriceRequest): unknown { + const obj: any = {}; + message.denom !== undefined && (obj.denom = message.denom); + return obj; + }, fromPartial(object: Partial): QueryDenomSpotPriceRequest { const message = createBaseQueryDenomSpotPriceRequest(); message.denom = object.denom ?? ""; return message; }, fromAmino(object: QueryDenomSpotPriceRequestAmino): QueryDenomSpotPriceRequest { - return { - denom: object.denom - }; + const message = createBaseQueryDenomSpotPriceRequest(); + if (object.denom !== undefined && object.denom !== null) { + message.denom = object.denom; + } + return message; }, toAmino(message: QueryDenomSpotPriceRequest): QueryDenomSpotPriceRequestAmino { const obj: any = {}; @@ -345,6 +443,8 @@ export const QueryDenomSpotPriceRequest = { }; } }; +GlobalDecoderRegistry.register(QueryDenomSpotPriceRequest.typeUrl, QueryDenomSpotPriceRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryDenomSpotPriceRequest.aminoType, QueryDenomSpotPriceRequest.typeUrl); function createBaseQueryDenomSpotPriceResponse(): QueryDenomSpotPriceResponse { return { poolID: BigInt(0), @@ -353,6 +453,16 @@ function createBaseQueryDenomSpotPriceResponse(): QueryDenomSpotPriceResponse { } export const QueryDenomSpotPriceResponse = { typeUrl: "/osmosis.txfees.v1beta1.QueryDenomSpotPriceResponse", + aminoType: "osmosis/txfees/query-denom-spot-price-response", + is(o: any): o is QueryDenomSpotPriceResponse { + return o && (o.$typeUrl === QueryDenomSpotPriceResponse.typeUrl || typeof o.poolID === "bigint" && typeof o.spotPrice === "string"); + }, + isSDK(o: any): o is QueryDenomSpotPriceResponseSDKType { + return o && (o.$typeUrl === QueryDenomSpotPriceResponse.typeUrl || typeof o.poolID === "bigint" && typeof o.spot_price === "string"); + }, + isAmino(o: any): o is QueryDenomSpotPriceResponseAmino { + return o && (o.$typeUrl === QueryDenomSpotPriceResponse.typeUrl || typeof o.poolID === "bigint" && typeof o.spot_price === "string"); + }, encode(message: QueryDenomSpotPriceResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.poolID !== BigInt(0)) { writer.uint32(8).uint64(message.poolID); @@ -382,6 +492,18 @@ export const QueryDenomSpotPriceResponse = { } return message; }, + fromJSON(object: any): QueryDenomSpotPriceResponse { + return { + poolID: isSet(object.poolID) ? BigInt(object.poolID.toString()) : BigInt(0), + spotPrice: isSet(object.spotPrice) ? String(object.spotPrice) : "" + }; + }, + toJSON(message: QueryDenomSpotPriceResponse): unknown { + const obj: any = {}; + message.poolID !== undefined && (obj.poolID = (message.poolID || BigInt(0)).toString()); + message.spotPrice !== undefined && (obj.spotPrice = message.spotPrice); + return obj; + }, fromPartial(object: Partial): QueryDenomSpotPriceResponse { const message = createBaseQueryDenomSpotPriceResponse(); message.poolID = object.poolID !== undefined && object.poolID !== null ? BigInt(object.poolID.toString()) : BigInt(0); @@ -389,10 +511,14 @@ export const QueryDenomSpotPriceResponse = { return message; }, fromAmino(object: QueryDenomSpotPriceResponseAmino): QueryDenomSpotPriceResponse { - return { - poolID: BigInt(object.poolID), - spotPrice: object.spot_price - }; + const message = createBaseQueryDenomSpotPriceResponse(); + if (object.poolID !== undefined && object.poolID !== null) { + message.poolID = BigInt(object.poolID); + } + if (object.spot_price !== undefined && object.spot_price !== null) { + message.spotPrice = object.spot_price; + } + return message; }, toAmino(message: QueryDenomSpotPriceResponse): QueryDenomSpotPriceResponseAmino { const obj: any = {}; @@ -422,6 +548,8 @@ export const QueryDenomSpotPriceResponse = { }; } }; +GlobalDecoderRegistry.register(QueryDenomSpotPriceResponse.typeUrl, QueryDenomSpotPriceResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryDenomSpotPriceResponse.aminoType, QueryDenomSpotPriceResponse.typeUrl); function createBaseQueryDenomPoolIdRequest(): QueryDenomPoolIdRequest { return { denom: "" @@ -429,6 +557,16 @@ function createBaseQueryDenomPoolIdRequest(): QueryDenomPoolIdRequest { } export const QueryDenomPoolIdRequest = { typeUrl: "/osmosis.txfees.v1beta1.QueryDenomPoolIdRequest", + aminoType: "osmosis/txfees/query-denom-pool-id-request", + is(o: any): o is QueryDenomPoolIdRequest { + return o && (o.$typeUrl === QueryDenomPoolIdRequest.typeUrl || typeof o.denom === "string"); + }, + isSDK(o: any): o is QueryDenomPoolIdRequestSDKType { + return o && (o.$typeUrl === QueryDenomPoolIdRequest.typeUrl || typeof o.denom === "string"); + }, + isAmino(o: any): o is QueryDenomPoolIdRequestAmino { + return o && (o.$typeUrl === QueryDenomPoolIdRequest.typeUrl || typeof o.denom === "string"); + }, encode(message: QueryDenomPoolIdRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.denom !== "") { writer.uint32(10).string(message.denom); @@ -452,15 +590,27 @@ export const QueryDenomPoolIdRequest = { } return message; }, + fromJSON(object: any): QueryDenomPoolIdRequest { + return { + denom: isSet(object.denom) ? String(object.denom) : "" + }; + }, + toJSON(message: QueryDenomPoolIdRequest): unknown { + const obj: any = {}; + message.denom !== undefined && (obj.denom = message.denom); + return obj; + }, fromPartial(object: Partial): QueryDenomPoolIdRequest { const message = createBaseQueryDenomPoolIdRequest(); message.denom = object.denom ?? ""; return message; }, fromAmino(object: QueryDenomPoolIdRequestAmino): QueryDenomPoolIdRequest { - return { - denom: object.denom - }; + const message = createBaseQueryDenomPoolIdRequest(); + if (object.denom !== undefined && object.denom !== null) { + message.denom = object.denom; + } + return message; }, toAmino(message: QueryDenomPoolIdRequest): QueryDenomPoolIdRequestAmino { const obj: any = {}; @@ -489,6 +639,8 @@ export const QueryDenomPoolIdRequest = { }; } }; +GlobalDecoderRegistry.register(QueryDenomPoolIdRequest.typeUrl, QueryDenomPoolIdRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryDenomPoolIdRequest.aminoType, QueryDenomPoolIdRequest.typeUrl); function createBaseQueryDenomPoolIdResponse(): QueryDenomPoolIdResponse { return { poolID: BigInt(0) @@ -496,6 +648,16 @@ function createBaseQueryDenomPoolIdResponse(): QueryDenomPoolIdResponse { } export const QueryDenomPoolIdResponse = { typeUrl: "/osmosis.txfees.v1beta1.QueryDenomPoolIdResponse", + aminoType: "osmosis/txfees/query-denom-pool-id-response", + is(o: any): o is QueryDenomPoolIdResponse { + return o && (o.$typeUrl === QueryDenomPoolIdResponse.typeUrl || typeof o.poolID === "bigint"); + }, + isSDK(o: any): o is QueryDenomPoolIdResponseSDKType { + return o && (o.$typeUrl === QueryDenomPoolIdResponse.typeUrl || typeof o.poolID === "bigint"); + }, + isAmino(o: any): o is QueryDenomPoolIdResponseAmino { + return o && (o.$typeUrl === QueryDenomPoolIdResponse.typeUrl || typeof o.poolID === "bigint"); + }, encode(message: QueryDenomPoolIdResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.poolID !== BigInt(0)) { writer.uint32(8).uint64(message.poolID); @@ -519,15 +681,27 @@ export const QueryDenomPoolIdResponse = { } return message; }, + fromJSON(object: any): QueryDenomPoolIdResponse { + return { + poolID: isSet(object.poolID) ? BigInt(object.poolID.toString()) : BigInt(0) + }; + }, + toJSON(message: QueryDenomPoolIdResponse): unknown { + const obj: any = {}; + message.poolID !== undefined && (obj.poolID = (message.poolID || BigInt(0)).toString()); + return obj; + }, fromPartial(object: Partial): QueryDenomPoolIdResponse { const message = createBaseQueryDenomPoolIdResponse(); message.poolID = object.poolID !== undefined && object.poolID !== null ? BigInt(object.poolID.toString()) : BigInt(0); return message; }, fromAmino(object: QueryDenomPoolIdResponseAmino): QueryDenomPoolIdResponse { - return { - poolID: BigInt(object.poolID) - }; + const message = createBaseQueryDenomPoolIdResponse(); + if (object.poolID !== undefined && object.poolID !== null) { + message.poolID = BigInt(object.poolID); + } + return message; }, toAmino(message: QueryDenomPoolIdResponse): QueryDenomPoolIdResponseAmino { const obj: any = {}; @@ -556,11 +730,23 @@ export const QueryDenomPoolIdResponse = { }; } }; +GlobalDecoderRegistry.register(QueryDenomPoolIdResponse.typeUrl, QueryDenomPoolIdResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryDenomPoolIdResponse.aminoType, QueryDenomPoolIdResponse.typeUrl); function createBaseQueryBaseDenomRequest(): QueryBaseDenomRequest { return {}; } export const QueryBaseDenomRequest = { typeUrl: "/osmosis.txfees.v1beta1.QueryBaseDenomRequest", + aminoType: "osmosis/txfees/query-base-denom-request", + is(o: any): o is QueryBaseDenomRequest { + return o && o.$typeUrl === QueryBaseDenomRequest.typeUrl; + }, + isSDK(o: any): o is QueryBaseDenomRequestSDKType { + return o && o.$typeUrl === QueryBaseDenomRequest.typeUrl; + }, + isAmino(o: any): o is QueryBaseDenomRequestAmino { + return o && o.$typeUrl === QueryBaseDenomRequest.typeUrl; + }, encode(_: QueryBaseDenomRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, @@ -578,12 +764,20 @@ export const QueryBaseDenomRequest = { } return message; }, + fromJSON(_: any): QueryBaseDenomRequest { + return {}; + }, + toJSON(_: QueryBaseDenomRequest): unknown { + const obj: any = {}; + return obj; + }, fromPartial(_: Partial): QueryBaseDenomRequest { const message = createBaseQueryBaseDenomRequest(); return message; }, fromAmino(_: QueryBaseDenomRequestAmino): QueryBaseDenomRequest { - return {}; + const message = createBaseQueryBaseDenomRequest(); + return message; }, toAmino(_: QueryBaseDenomRequest): QueryBaseDenomRequestAmino { const obj: any = {}; @@ -611,6 +805,8 @@ export const QueryBaseDenomRequest = { }; } }; +GlobalDecoderRegistry.register(QueryBaseDenomRequest.typeUrl, QueryBaseDenomRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryBaseDenomRequest.aminoType, QueryBaseDenomRequest.typeUrl); function createBaseQueryBaseDenomResponse(): QueryBaseDenomResponse { return { baseDenom: "" @@ -618,6 +814,16 @@ function createBaseQueryBaseDenomResponse(): QueryBaseDenomResponse { } export const QueryBaseDenomResponse = { typeUrl: "/osmosis.txfees.v1beta1.QueryBaseDenomResponse", + aminoType: "osmosis/txfees/query-base-denom-response", + is(o: any): o is QueryBaseDenomResponse { + return o && (o.$typeUrl === QueryBaseDenomResponse.typeUrl || typeof o.baseDenom === "string"); + }, + isSDK(o: any): o is QueryBaseDenomResponseSDKType { + return o && (o.$typeUrl === QueryBaseDenomResponse.typeUrl || typeof o.base_denom === "string"); + }, + isAmino(o: any): o is QueryBaseDenomResponseAmino { + return o && (o.$typeUrl === QueryBaseDenomResponse.typeUrl || typeof o.base_denom === "string"); + }, encode(message: QueryBaseDenomResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.baseDenom !== "") { writer.uint32(10).string(message.baseDenom); @@ -641,15 +847,27 @@ export const QueryBaseDenomResponse = { } return message; }, + fromJSON(object: any): QueryBaseDenomResponse { + return { + baseDenom: isSet(object.baseDenom) ? String(object.baseDenom) : "" + }; + }, + toJSON(message: QueryBaseDenomResponse): unknown { + const obj: any = {}; + message.baseDenom !== undefined && (obj.baseDenom = message.baseDenom); + return obj; + }, fromPartial(object: Partial): QueryBaseDenomResponse { const message = createBaseQueryBaseDenomResponse(); message.baseDenom = object.baseDenom ?? ""; return message; }, fromAmino(object: QueryBaseDenomResponseAmino): QueryBaseDenomResponse { - return { - baseDenom: object.base_denom - }; + const message = createBaseQueryBaseDenomResponse(); + if (object.base_denom !== undefined && object.base_denom !== null) { + message.baseDenom = object.base_denom; + } + return message; }, toAmino(message: QueryBaseDenomResponse): QueryBaseDenomResponseAmino { const obj: any = {}; @@ -677,4 +895,172 @@ export const QueryBaseDenomResponse = { value: QueryBaseDenomResponse.encode(message).finish() }; } -}; \ No newline at end of file +}; +GlobalDecoderRegistry.register(QueryBaseDenomResponse.typeUrl, QueryBaseDenomResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryBaseDenomResponse.aminoType, QueryBaseDenomResponse.typeUrl); +function createBaseQueryEipBaseFeeRequest(): QueryEipBaseFeeRequest { + return {}; +} +export const QueryEipBaseFeeRequest = { + typeUrl: "/osmosis.txfees.v1beta1.QueryEipBaseFeeRequest", + aminoType: "osmosis/txfees/query-eip-base-fee-request", + is(o: any): o is QueryEipBaseFeeRequest { + return o && o.$typeUrl === QueryEipBaseFeeRequest.typeUrl; + }, + isSDK(o: any): o is QueryEipBaseFeeRequestSDKType { + return o && o.$typeUrl === QueryEipBaseFeeRequest.typeUrl; + }, + isAmino(o: any): o is QueryEipBaseFeeRequestAmino { + return o && o.$typeUrl === QueryEipBaseFeeRequest.typeUrl; + }, + encode(_: QueryEipBaseFeeRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryEipBaseFeeRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryEipBaseFeeRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(_: any): QueryEipBaseFeeRequest { + return {}; + }, + toJSON(_: QueryEipBaseFeeRequest): unknown { + const obj: any = {}; + return obj; + }, + fromPartial(_: Partial): QueryEipBaseFeeRequest { + const message = createBaseQueryEipBaseFeeRequest(); + return message; + }, + fromAmino(_: QueryEipBaseFeeRequestAmino): QueryEipBaseFeeRequest { + const message = createBaseQueryEipBaseFeeRequest(); + return message; + }, + toAmino(_: QueryEipBaseFeeRequest): QueryEipBaseFeeRequestAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: QueryEipBaseFeeRequestAminoMsg): QueryEipBaseFeeRequest { + return QueryEipBaseFeeRequest.fromAmino(object.value); + }, + toAminoMsg(message: QueryEipBaseFeeRequest): QueryEipBaseFeeRequestAminoMsg { + return { + type: "osmosis/txfees/query-eip-base-fee-request", + value: QueryEipBaseFeeRequest.toAmino(message) + }; + }, + fromProtoMsg(message: QueryEipBaseFeeRequestProtoMsg): QueryEipBaseFeeRequest { + return QueryEipBaseFeeRequest.decode(message.value); + }, + toProto(message: QueryEipBaseFeeRequest): Uint8Array { + return QueryEipBaseFeeRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryEipBaseFeeRequest): QueryEipBaseFeeRequestProtoMsg { + return { + typeUrl: "/osmosis.txfees.v1beta1.QueryEipBaseFeeRequest", + value: QueryEipBaseFeeRequest.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryEipBaseFeeRequest.typeUrl, QueryEipBaseFeeRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryEipBaseFeeRequest.aminoType, QueryEipBaseFeeRequest.typeUrl); +function createBaseQueryEipBaseFeeResponse(): QueryEipBaseFeeResponse { + return { + baseFee: "" + }; +} +export const QueryEipBaseFeeResponse = { + typeUrl: "/osmosis.txfees.v1beta1.QueryEipBaseFeeResponse", + aminoType: "osmosis/txfees/query-eip-base-fee-response", + is(o: any): o is QueryEipBaseFeeResponse { + return o && (o.$typeUrl === QueryEipBaseFeeResponse.typeUrl || typeof o.baseFee === "string"); + }, + isSDK(o: any): o is QueryEipBaseFeeResponseSDKType { + return o && (o.$typeUrl === QueryEipBaseFeeResponse.typeUrl || typeof o.base_fee === "string"); + }, + isAmino(o: any): o is QueryEipBaseFeeResponseAmino { + return o && (o.$typeUrl === QueryEipBaseFeeResponse.typeUrl || typeof o.base_fee === "string"); + }, + encode(message: QueryEipBaseFeeResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.baseFee !== "") { + writer.uint32(10).string(Decimal.fromUserInput(message.baseFee, 18).atomics); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryEipBaseFeeResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryEipBaseFeeResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.baseFee = Decimal.fromAtomics(reader.string(), 18).toString(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): QueryEipBaseFeeResponse { + return { + baseFee: isSet(object.baseFee) ? String(object.baseFee) : "" + }; + }, + toJSON(message: QueryEipBaseFeeResponse): unknown { + const obj: any = {}; + message.baseFee !== undefined && (obj.baseFee = message.baseFee); + return obj; + }, + fromPartial(object: Partial): QueryEipBaseFeeResponse { + const message = createBaseQueryEipBaseFeeResponse(); + message.baseFee = object.baseFee ?? ""; + return message; + }, + fromAmino(object: QueryEipBaseFeeResponseAmino): QueryEipBaseFeeResponse { + const message = createBaseQueryEipBaseFeeResponse(); + if (object.base_fee !== undefined && object.base_fee !== null) { + message.baseFee = object.base_fee; + } + return message; + }, + toAmino(message: QueryEipBaseFeeResponse): QueryEipBaseFeeResponseAmino { + const obj: any = {}; + obj.base_fee = message.baseFee; + return obj; + }, + fromAminoMsg(object: QueryEipBaseFeeResponseAminoMsg): QueryEipBaseFeeResponse { + return QueryEipBaseFeeResponse.fromAmino(object.value); + }, + toAminoMsg(message: QueryEipBaseFeeResponse): QueryEipBaseFeeResponseAminoMsg { + return { + type: "osmosis/txfees/query-eip-base-fee-response", + value: QueryEipBaseFeeResponse.toAmino(message) + }; + }, + fromProtoMsg(message: QueryEipBaseFeeResponseProtoMsg): QueryEipBaseFeeResponse { + return QueryEipBaseFeeResponse.decode(message.value); + }, + toProto(message: QueryEipBaseFeeResponse): Uint8Array { + return QueryEipBaseFeeResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryEipBaseFeeResponse): QueryEipBaseFeeResponseProtoMsg { + return { + typeUrl: "/osmosis.txfees.v1beta1.QueryEipBaseFeeResponse", + value: QueryEipBaseFeeResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(QueryEipBaseFeeResponse.typeUrl, QueryEipBaseFeeResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(QueryEipBaseFeeResponse.aminoType, QueryEipBaseFeeResponse.typeUrl); \ No newline at end of file diff --git a/packages/osmojs/src/codegen/osmosis/valset-pref/v1beta1/query.lcd.ts b/packages/osmojs/src/codegen/osmosis/valsetpref/v1beta1/query.lcd.ts similarity index 100% rename from packages/osmojs/src/codegen/osmosis/valset-pref/v1beta1/query.lcd.ts rename to packages/osmojs/src/codegen/osmosis/valsetpref/v1beta1/query.lcd.ts diff --git a/packages/osmojs/src/codegen/osmosis/valset-pref/v1beta1/query.rpc.Query.ts b/packages/osmojs/src/codegen/osmosis/valsetpref/v1beta1/query.rpc.Query.ts similarity index 100% rename from packages/osmojs/src/codegen/osmosis/valset-pref/v1beta1/query.rpc.Query.ts rename to packages/osmojs/src/codegen/osmosis/valsetpref/v1beta1/query.rpc.Query.ts diff --git a/packages/osmo-query/src/codegen/osmosis/valset-pref/v1beta1/query.ts b/packages/osmojs/src/codegen/osmosis/valsetpref/v1beta1/query.ts similarity index 69% rename from packages/osmo-query/src/codegen/osmosis/valset-pref/v1beta1/query.ts rename to packages/osmojs/src/codegen/osmosis/valsetpref/v1beta1/query.ts index 15a800ad8..40834c1bf 100644 --- a/packages/osmo-query/src/codegen/osmosis/valset-pref/v1beta1/query.ts +++ b/packages/osmojs/src/codegen/osmosis/valsetpref/v1beta1/query.ts @@ -1,5 +1,7 @@ import { ValidatorPreference, ValidatorPreferenceAmino, ValidatorPreferenceSDKType } from "./state"; import { BinaryReader, BinaryWriter } from "../../../binary"; +import { isSet } from "../../../helpers"; +import { GlobalDecoderRegistry } from "../../../registry"; /** Request type for UserValidatorPreferences. */ export interface UserValidatorPreferencesRequest { /** user account address */ @@ -12,7 +14,7 @@ export interface UserValidatorPreferencesRequestProtoMsg { /** Request type for UserValidatorPreferences. */ export interface UserValidatorPreferencesRequestAmino { /** user account address */ - address: string; + address?: string; } export interface UserValidatorPreferencesRequestAminoMsg { type: "osmosis/valsetpref/user-validator-preferences-request"; @@ -32,7 +34,7 @@ export interface UserValidatorPreferencesResponseProtoMsg { } /** Response type the QueryUserValidatorPreferences query request */ export interface UserValidatorPreferencesResponseAmino { - preferences: ValidatorPreferenceAmino[]; + preferences?: ValidatorPreferenceAmino[]; } export interface UserValidatorPreferencesResponseAminoMsg { type: "osmosis/valsetpref/user-validator-preferences-response"; @@ -49,6 +51,16 @@ function createBaseUserValidatorPreferencesRequest(): UserValidatorPreferencesRe } export const UserValidatorPreferencesRequest = { typeUrl: "/osmosis.valsetpref.v1beta1.UserValidatorPreferencesRequest", + aminoType: "osmosis/valsetpref/user-validator-preferences-request", + is(o: any): o is UserValidatorPreferencesRequest { + return o && (o.$typeUrl === UserValidatorPreferencesRequest.typeUrl || typeof o.address === "string"); + }, + isSDK(o: any): o is UserValidatorPreferencesRequestSDKType { + return o && (o.$typeUrl === UserValidatorPreferencesRequest.typeUrl || typeof o.address === "string"); + }, + isAmino(o: any): o is UserValidatorPreferencesRequestAmino { + return o && (o.$typeUrl === UserValidatorPreferencesRequest.typeUrl || typeof o.address === "string"); + }, encode(message: UserValidatorPreferencesRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.address !== "") { writer.uint32(10).string(message.address); @@ -72,15 +84,27 @@ export const UserValidatorPreferencesRequest = { } return message; }, + fromJSON(object: any): UserValidatorPreferencesRequest { + return { + address: isSet(object.address) ? String(object.address) : "" + }; + }, + toJSON(message: UserValidatorPreferencesRequest): unknown { + const obj: any = {}; + message.address !== undefined && (obj.address = message.address); + return obj; + }, fromPartial(object: Partial): UserValidatorPreferencesRequest { const message = createBaseUserValidatorPreferencesRequest(); message.address = object.address ?? ""; return message; }, fromAmino(object: UserValidatorPreferencesRequestAmino): UserValidatorPreferencesRequest { - return { - address: object.address - }; + const message = createBaseUserValidatorPreferencesRequest(); + if (object.address !== undefined && object.address !== null) { + message.address = object.address; + } + return message; }, toAmino(message: UserValidatorPreferencesRequest): UserValidatorPreferencesRequestAmino { const obj: any = {}; @@ -109,6 +133,8 @@ export const UserValidatorPreferencesRequest = { }; } }; +GlobalDecoderRegistry.register(UserValidatorPreferencesRequest.typeUrl, UserValidatorPreferencesRequest); +GlobalDecoderRegistry.registerAminoProtoMapping(UserValidatorPreferencesRequest.aminoType, UserValidatorPreferencesRequest.typeUrl); function createBaseUserValidatorPreferencesResponse(): UserValidatorPreferencesResponse { return { preferences: [] @@ -116,6 +142,16 @@ function createBaseUserValidatorPreferencesResponse(): UserValidatorPreferencesR } export const UserValidatorPreferencesResponse = { typeUrl: "/osmosis.valsetpref.v1beta1.UserValidatorPreferencesResponse", + aminoType: "osmosis/valsetpref/user-validator-preferences-response", + is(o: any): o is UserValidatorPreferencesResponse { + return o && (o.$typeUrl === UserValidatorPreferencesResponse.typeUrl || Array.isArray(o.preferences) && (!o.preferences.length || ValidatorPreference.is(o.preferences[0]))); + }, + isSDK(o: any): o is UserValidatorPreferencesResponseSDKType { + return o && (o.$typeUrl === UserValidatorPreferencesResponse.typeUrl || Array.isArray(o.preferences) && (!o.preferences.length || ValidatorPreference.isSDK(o.preferences[0]))); + }, + isAmino(o: any): o is UserValidatorPreferencesResponseAmino { + return o && (o.$typeUrl === UserValidatorPreferencesResponse.typeUrl || Array.isArray(o.preferences) && (!o.preferences.length || ValidatorPreference.isAmino(o.preferences[0]))); + }, encode(message: UserValidatorPreferencesResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.preferences) { ValidatorPreference.encode(v!, writer.uint32(10).fork()).ldelim(); @@ -139,15 +175,29 @@ export const UserValidatorPreferencesResponse = { } return message; }, + fromJSON(object: any): UserValidatorPreferencesResponse { + return { + preferences: Array.isArray(object?.preferences) ? object.preferences.map((e: any) => ValidatorPreference.fromJSON(e)) : [] + }; + }, + toJSON(message: UserValidatorPreferencesResponse): unknown { + const obj: any = {}; + if (message.preferences) { + obj.preferences = message.preferences.map(e => e ? ValidatorPreference.toJSON(e) : undefined); + } else { + obj.preferences = []; + } + return obj; + }, fromPartial(object: Partial): UserValidatorPreferencesResponse { const message = createBaseUserValidatorPreferencesResponse(); message.preferences = object.preferences?.map(e => ValidatorPreference.fromPartial(e)) || []; return message; }, fromAmino(object: UserValidatorPreferencesResponseAmino): UserValidatorPreferencesResponse { - return { - preferences: Array.isArray(object?.preferences) ? object.preferences.map((e: any) => ValidatorPreference.fromAmino(e)) : [] - }; + const message = createBaseUserValidatorPreferencesResponse(); + message.preferences = object.preferences?.map(e => ValidatorPreference.fromAmino(e)) || []; + return message; }, toAmino(message: UserValidatorPreferencesResponse): UserValidatorPreferencesResponseAmino { const obj: any = {}; @@ -179,4 +229,6 @@ export const UserValidatorPreferencesResponse = { value: UserValidatorPreferencesResponse.encode(message).finish() }; } -}; \ No newline at end of file +}; +GlobalDecoderRegistry.register(UserValidatorPreferencesResponse.typeUrl, UserValidatorPreferencesResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(UserValidatorPreferencesResponse.aminoType, UserValidatorPreferencesResponse.typeUrl); \ No newline at end of file diff --git a/packages/osmojs/src/codegen/osmosis/valset-pref/v1beta1/state.ts b/packages/osmojs/src/codegen/osmosis/valsetpref/v1beta1/state.ts similarity index 72% rename from packages/osmojs/src/codegen/osmosis/valset-pref/v1beta1/state.ts rename to packages/osmojs/src/codegen/osmosis/valsetpref/v1beta1/state.ts index e993ba247..cbb33f3b5 100644 --- a/packages/osmojs/src/codegen/osmosis/valset-pref/v1beta1/state.ts +++ b/packages/osmojs/src/codegen/osmosis/valsetpref/v1beta1/state.ts @@ -1,5 +1,7 @@ import { BinaryReader, BinaryWriter } from "../../../binary"; import { Decimal } from "@cosmjs/math"; +import { isSet } from "../../../helpers"; +import { GlobalDecoderRegistry } from "../../../registry"; /** * ValidatorPreference defines the message structure for * CreateValidatorSetPreference. It allows a user to set {val_addr, weight} in @@ -32,9 +34,9 @@ export interface ValidatorPreferenceAmino { * val_oper_address holds the validator address the user wants to delegate * funds to. */ - val_oper_address: string; + val_oper_address?: string; /** weight is decimal between 0 and 1, and they all sum to 1. */ - weight: string; + weight?: string; } export interface ValidatorPreferenceAminoMsg { type: "osmosis/valsetpref/validator-preference"; @@ -73,7 +75,7 @@ export interface ValidatorSetPreferencesProtoMsg { */ export interface ValidatorSetPreferencesAmino { /** preference holds {valAddr, weight} for the user who created it. */ - preferences: ValidatorPreferenceAmino[]; + preferences?: ValidatorPreferenceAmino[]; } export interface ValidatorSetPreferencesAminoMsg { type: "osmosis/valsetpref/validator-set-preferences"; @@ -96,6 +98,16 @@ function createBaseValidatorPreference(): ValidatorPreference { } export const ValidatorPreference = { typeUrl: "/osmosis.valsetpref.v1beta1.ValidatorPreference", + aminoType: "osmosis/valsetpref/validator-preference", + is(o: any): o is ValidatorPreference { + return o && (o.$typeUrl === ValidatorPreference.typeUrl || typeof o.valOperAddress === "string" && typeof o.weight === "string"); + }, + isSDK(o: any): o is ValidatorPreferenceSDKType { + return o && (o.$typeUrl === ValidatorPreference.typeUrl || typeof o.val_oper_address === "string" && typeof o.weight === "string"); + }, + isAmino(o: any): o is ValidatorPreferenceAmino { + return o && (o.$typeUrl === ValidatorPreference.typeUrl || typeof o.val_oper_address === "string" && typeof o.weight === "string"); + }, encode(message: ValidatorPreference, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.valOperAddress !== "") { writer.uint32(10).string(message.valOperAddress); @@ -125,6 +137,18 @@ export const ValidatorPreference = { } return message; }, + fromJSON(object: any): ValidatorPreference { + return { + valOperAddress: isSet(object.valOperAddress) ? String(object.valOperAddress) : "", + weight: isSet(object.weight) ? String(object.weight) : "" + }; + }, + toJSON(message: ValidatorPreference): unknown { + const obj: any = {}; + message.valOperAddress !== undefined && (obj.valOperAddress = message.valOperAddress); + message.weight !== undefined && (obj.weight = message.weight); + return obj; + }, fromPartial(object: Partial): ValidatorPreference { const message = createBaseValidatorPreference(); message.valOperAddress = object.valOperAddress ?? ""; @@ -132,10 +156,14 @@ export const ValidatorPreference = { return message; }, fromAmino(object: ValidatorPreferenceAmino): ValidatorPreference { - return { - valOperAddress: object.val_oper_address, - weight: object.weight - }; + const message = createBaseValidatorPreference(); + if (object.val_oper_address !== undefined && object.val_oper_address !== null) { + message.valOperAddress = object.val_oper_address; + } + if (object.weight !== undefined && object.weight !== null) { + message.weight = object.weight; + } + return message; }, toAmino(message: ValidatorPreference): ValidatorPreferenceAmino { const obj: any = {}; @@ -165,6 +193,8 @@ export const ValidatorPreference = { }; } }; +GlobalDecoderRegistry.register(ValidatorPreference.typeUrl, ValidatorPreference); +GlobalDecoderRegistry.registerAminoProtoMapping(ValidatorPreference.aminoType, ValidatorPreference.typeUrl); function createBaseValidatorSetPreferences(): ValidatorSetPreferences { return { preferences: [] @@ -172,6 +202,16 @@ function createBaseValidatorSetPreferences(): ValidatorSetPreferences { } export const ValidatorSetPreferences = { typeUrl: "/osmosis.valsetpref.v1beta1.ValidatorSetPreferences", + aminoType: "osmosis/valsetpref/validator-set-preferences", + is(o: any): o is ValidatorSetPreferences { + return o && (o.$typeUrl === ValidatorSetPreferences.typeUrl || Array.isArray(o.preferences) && (!o.preferences.length || ValidatorPreference.is(o.preferences[0]))); + }, + isSDK(o: any): o is ValidatorSetPreferencesSDKType { + return o && (o.$typeUrl === ValidatorSetPreferences.typeUrl || Array.isArray(o.preferences) && (!o.preferences.length || ValidatorPreference.isSDK(o.preferences[0]))); + }, + isAmino(o: any): o is ValidatorSetPreferencesAmino { + return o && (o.$typeUrl === ValidatorSetPreferences.typeUrl || Array.isArray(o.preferences) && (!o.preferences.length || ValidatorPreference.isAmino(o.preferences[0]))); + }, encode(message: ValidatorSetPreferences, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.preferences) { ValidatorPreference.encode(v!, writer.uint32(18).fork()).ldelim(); @@ -195,15 +235,29 @@ export const ValidatorSetPreferences = { } return message; }, + fromJSON(object: any): ValidatorSetPreferences { + return { + preferences: Array.isArray(object?.preferences) ? object.preferences.map((e: any) => ValidatorPreference.fromJSON(e)) : [] + }; + }, + toJSON(message: ValidatorSetPreferences): unknown { + const obj: any = {}; + if (message.preferences) { + obj.preferences = message.preferences.map(e => e ? ValidatorPreference.toJSON(e) : undefined); + } else { + obj.preferences = []; + } + return obj; + }, fromPartial(object: Partial): ValidatorSetPreferences { const message = createBaseValidatorSetPreferences(); message.preferences = object.preferences?.map(e => ValidatorPreference.fromPartial(e)) || []; return message; }, fromAmino(object: ValidatorSetPreferencesAmino): ValidatorSetPreferences { - return { - preferences: Array.isArray(object?.preferences) ? object.preferences.map((e: any) => ValidatorPreference.fromAmino(e)) : [] - }; + const message = createBaseValidatorSetPreferences(); + message.preferences = object.preferences?.map(e => ValidatorPreference.fromAmino(e)) || []; + return message; }, toAmino(message: ValidatorSetPreferences): ValidatorSetPreferencesAmino { const obj: any = {}; @@ -235,4 +289,6 @@ export const ValidatorSetPreferences = { value: ValidatorSetPreferences.encode(message).finish() }; } -}; \ No newline at end of file +}; +GlobalDecoderRegistry.register(ValidatorSetPreferences.typeUrl, ValidatorSetPreferences); +GlobalDecoderRegistry.registerAminoProtoMapping(ValidatorSetPreferences.aminoType, ValidatorSetPreferences.typeUrl); \ No newline at end of file diff --git a/packages/osmojs/src/codegen/osmosis/valset-pref/v1beta1/tx.amino.ts b/packages/osmojs/src/codegen/osmosis/valsetpref/v1beta1/tx.amino.ts similarity index 62% rename from packages/osmojs/src/codegen/osmosis/valset-pref/v1beta1/tx.amino.ts rename to packages/osmojs/src/codegen/osmosis/valsetpref/v1beta1/tx.amino.ts index e7e7d5ca5..cd5c56ea7 100644 --- a/packages/osmojs/src/codegen/osmosis/valset-pref/v1beta1/tx.amino.ts +++ b/packages/osmojs/src/codegen/osmosis/valsetpref/v1beta1/tx.amino.ts @@ -1,28 +1,33 @@ //@ts-nocheck -import { MsgSetValidatorSetPreference, MsgDelegateToValidatorSet, MsgUndelegateFromValidatorSet, MsgRedelegateValidatorSet, MsgWithdrawDelegationRewards, MsgDelegateBondedTokens } from "./tx"; +import { MsgSetValidatorSetPreference, MsgDelegateToValidatorSet, MsgUndelegateFromValidatorSet, MsgUndelegateFromRebalancedValidatorSet, MsgRedelegateValidatorSet, MsgWithdrawDelegationRewards, MsgDelegateBondedTokens } from "./tx"; export const AminoConverter = { "/osmosis.valsetpref.v1beta1.MsgSetValidatorSetPreference": { - aminoType: "osmosis/valset-pref/MsgSetValidatorSetPreference", + aminoType: "osmosis/MsgSetValidatorSetPreference", toAmino: MsgSetValidatorSetPreference.toAmino, fromAmino: MsgSetValidatorSetPreference.fromAmino }, "/osmosis.valsetpref.v1beta1.MsgDelegateToValidatorSet": { - aminoType: "osmosis/valset-pref/MsgDelegateToValidatorSet", + aminoType: "osmosis/MsgDelegateToValidatorSet", toAmino: MsgDelegateToValidatorSet.toAmino, fromAmino: MsgDelegateToValidatorSet.fromAmino }, "/osmosis.valsetpref.v1beta1.MsgUndelegateFromValidatorSet": { - aminoType: "osmosis/valset-pref/MsgUndelegateFromValidatorSet", + aminoType: "osmosis/MsgUndelegateFromValidatorSet", toAmino: MsgUndelegateFromValidatorSet.toAmino, fromAmino: MsgUndelegateFromValidatorSet.fromAmino }, + "/osmosis.valsetpref.v1beta1.MsgUndelegateFromRebalancedValidatorSet": { + aminoType: "osmosis/MsgUndelegateFromRebalValset", + toAmino: MsgUndelegateFromRebalancedValidatorSet.toAmino, + fromAmino: MsgUndelegateFromRebalancedValidatorSet.fromAmino + }, "/osmosis.valsetpref.v1beta1.MsgRedelegateValidatorSet": { - aminoType: "osmosis/valsetpref/redelegate-validator-set", + aminoType: "osmosis/MsgRedelegateValidatorSet", toAmino: MsgRedelegateValidatorSet.toAmino, fromAmino: MsgRedelegateValidatorSet.fromAmino }, "/osmosis.valsetpref.v1beta1.MsgWithdrawDelegationRewards": { - aminoType: "osmosis/valset-pref/MsgWithdrawDelegationRewards", + aminoType: "osmosis/MsgWithdrawDelegationRewards", toAmino: MsgWithdrawDelegationRewards.toAmino, fromAmino: MsgWithdrawDelegationRewards.fromAmino }, diff --git a/packages/osmojs/src/codegen/osmosis/valset-pref/v1beta1/tx.registry.ts b/packages/osmojs/src/codegen/osmosis/valsetpref/v1beta1/tx.registry.ts similarity index 50% rename from packages/osmojs/src/codegen/osmosis/valset-pref/v1beta1/tx.registry.ts rename to packages/osmojs/src/codegen/osmosis/valsetpref/v1beta1/tx.registry.ts index 6814f6f7d..8852e5f7c 100644 --- a/packages/osmojs/src/codegen/osmosis/valset-pref/v1beta1/tx.registry.ts +++ b/packages/osmojs/src/codegen/osmosis/valsetpref/v1beta1/tx.registry.ts @@ -1,7 +1,7 @@ //@ts-nocheck import { GeneratedType, Registry } from "@cosmjs/proto-signing"; -import { MsgSetValidatorSetPreference, MsgDelegateToValidatorSet, MsgUndelegateFromValidatorSet, MsgRedelegateValidatorSet, MsgWithdrawDelegationRewards, MsgDelegateBondedTokens } from "./tx"; -export const registry: ReadonlyArray<[string, GeneratedType]> = [["/osmosis.valsetpref.v1beta1.MsgSetValidatorSetPreference", MsgSetValidatorSetPreference], ["/osmosis.valsetpref.v1beta1.MsgDelegateToValidatorSet", MsgDelegateToValidatorSet], ["/osmosis.valsetpref.v1beta1.MsgUndelegateFromValidatorSet", MsgUndelegateFromValidatorSet], ["/osmosis.valsetpref.v1beta1.MsgRedelegateValidatorSet", MsgRedelegateValidatorSet], ["/osmosis.valsetpref.v1beta1.MsgWithdrawDelegationRewards", MsgWithdrawDelegationRewards], ["/osmosis.valsetpref.v1beta1.MsgDelegateBondedTokens", MsgDelegateBondedTokens]]; +import { MsgSetValidatorSetPreference, MsgDelegateToValidatorSet, MsgUndelegateFromValidatorSet, MsgUndelegateFromRebalancedValidatorSet, MsgRedelegateValidatorSet, MsgWithdrawDelegationRewards, MsgDelegateBondedTokens } from "./tx"; +export const registry: ReadonlyArray<[string, GeneratedType]> = [["/osmosis.valsetpref.v1beta1.MsgSetValidatorSetPreference", MsgSetValidatorSetPreference], ["/osmosis.valsetpref.v1beta1.MsgDelegateToValidatorSet", MsgDelegateToValidatorSet], ["/osmosis.valsetpref.v1beta1.MsgUndelegateFromValidatorSet", MsgUndelegateFromValidatorSet], ["/osmosis.valsetpref.v1beta1.MsgUndelegateFromRebalancedValidatorSet", MsgUndelegateFromRebalancedValidatorSet], ["/osmosis.valsetpref.v1beta1.MsgRedelegateValidatorSet", MsgRedelegateValidatorSet], ["/osmosis.valsetpref.v1beta1.MsgWithdrawDelegationRewards", MsgWithdrawDelegationRewards], ["/osmosis.valsetpref.v1beta1.MsgDelegateBondedTokens", MsgDelegateBondedTokens]]; export const load = (protoRegistry: Registry) => { registry.forEach(([typeUrl, mod]) => { protoRegistry.register(typeUrl, mod); @@ -27,6 +27,12 @@ export const MessageComposer = { value: MsgUndelegateFromValidatorSet.encode(value).finish() }; }, + undelegateFromRebalancedValidatorSet(value: MsgUndelegateFromRebalancedValidatorSet) { + return { + typeUrl: "/osmosis.valsetpref.v1beta1.MsgUndelegateFromRebalancedValidatorSet", + value: MsgUndelegateFromRebalancedValidatorSet.encode(value).finish() + }; + }, redelegateValidatorSet(value: MsgRedelegateValidatorSet) { return { typeUrl: "/osmosis.valsetpref.v1beta1.MsgRedelegateValidatorSet", @@ -65,6 +71,12 @@ export const MessageComposer = { value }; }, + undelegateFromRebalancedValidatorSet(value: MsgUndelegateFromRebalancedValidatorSet) { + return { + typeUrl: "/osmosis.valsetpref.v1beta1.MsgUndelegateFromRebalancedValidatorSet", + value + }; + }, redelegateValidatorSet(value: MsgRedelegateValidatorSet) { return { typeUrl: "/osmosis.valsetpref.v1beta1.MsgRedelegateValidatorSet", @@ -84,6 +96,94 @@ export const MessageComposer = { }; } }, + toJSON: { + setValidatorSetPreference(value: MsgSetValidatorSetPreference) { + return { + typeUrl: "/osmosis.valsetpref.v1beta1.MsgSetValidatorSetPreference", + value: MsgSetValidatorSetPreference.toJSON(value) + }; + }, + delegateToValidatorSet(value: MsgDelegateToValidatorSet) { + return { + typeUrl: "/osmosis.valsetpref.v1beta1.MsgDelegateToValidatorSet", + value: MsgDelegateToValidatorSet.toJSON(value) + }; + }, + undelegateFromValidatorSet(value: MsgUndelegateFromValidatorSet) { + return { + typeUrl: "/osmosis.valsetpref.v1beta1.MsgUndelegateFromValidatorSet", + value: MsgUndelegateFromValidatorSet.toJSON(value) + }; + }, + undelegateFromRebalancedValidatorSet(value: MsgUndelegateFromRebalancedValidatorSet) { + return { + typeUrl: "/osmosis.valsetpref.v1beta1.MsgUndelegateFromRebalancedValidatorSet", + value: MsgUndelegateFromRebalancedValidatorSet.toJSON(value) + }; + }, + redelegateValidatorSet(value: MsgRedelegateValidatorSet) { + return { + typeUrl: "/osmosis.valsetpref.v1beta1.MsgRedelegateValidatorSet", + value: MsgRedelegateValidatorSet.toJSON(value) + }; + }, + withdrawDelegationRewards(value: MsgWithdrawDelegationRewards) { + return { + typeUrl: "/osmosis.valsetpref.v1beta1.MsgWithdrawDelegationRewards", + value: MsgWithdrawDelegationRewards.toJSON(value) + }; + }, + delegateBondedTokens(value: MsgDelegateBondedTokens) { + return { + typeUrl: "/osmosis.valsetpref.v1beta1.MsgDelegateBondedTokens", + value: MsgDelegateBondedTokens.toJSON(value) + }; + } + }, + fromJSON: { + setValidatorSetPreference(value: any) { + return { + typeUrl: "/osmosis.valsetpref.v1beta1.MsgSetValidatorSetPreference", + value: MsgSetValidatorSetPreference.fromJSON(value) + }; + }, + delegateToValidatorSet(value: any) { + return { + typeUrl: "/osmosis.valsetpref.v1beta1.MsgDelegateToValidatorSet", + value: MsgDelegateToValidatorSet.fromJSON(value) + }; + }, + undelegateFromValidatorSet(value: any) { + return { + typeUrl: "/osmosis.valsetpref.v1beta1.MsgUndelegateFromValidatorSet", + value: MsgUndelegateFromValidatorSet.fromJSON(value) + }; + }, + undelegateFromRebalancedValidatorSet(value: any) { + return { + typeUrl: "/osmosis.valsetpref.v1beta1.MsgUndelegateFromRebalancedValidatorSet", + value: MsgUndelegateFromRebalancedValidatorSet.fromJSON(value) + }; + }, + redelegateValidatorSet(value: any) { + return { + typeUrl: "/osmosis.valsetpref.v1beta1.MsgRedelegateValidatorSet", + value: MsgRedelegateValidatorSet.fromJSON(value) + }; + }, + withdrawDelegationRewards(value: any) { + return { + typeUrl: "/osmosis.valsetpref.v1beta1.MsgWithdrawDelegationRewards", + value: MsgWithdrawDelegationRewards.fromJSON(value) + }; + }, + delegateBondedTokens(value: any) { + return { + typeUrl: "/osmosis.valsetpref.v1beta1.MsgDelegateBondedTokens", + value: MsgDelegateBondedTokens.fromJSON(value) + }; + } + }, fromPartial: { setValidatorSetPreference(value: MsgSetValidatorSetPreference) { return { @@ -103,6 +203,12 @@ export const MessageComposer = { value: MsgUndelegateFromValidatorSet.fromPartial(value) }; }, + undelegateFromRebalancedValidatorSet(value: MsgUndelegateFromRebalancedValidatorSet) { + return { + typeUrl: "/osmosis.valsetpref.v1beta1.MsgUndelegateFromRebalancedValidatorSet", + value: MsgUndelegateFromRebalancedValidatorSet.fromPartial(value) + }; + }, redelegateValidatorSet(value: MsgRedelegateValidatorSet) { return { typeUrl: "/osmosis.valsetpref.v1beta1.MsgRedelegateValidatorSet", diff --git a/packages/osmo-query/src/codegen/osmosis/valset-pref/v1beta1/tx.rpc.msg.ts b/packages/osmojs/src/codegen/osmosis/valsetpref/v1beta1/tx.rpc.msg.ts similarity index 76% rename from packages/osmo-query/src/codegen/osmosis/valset-pref/v1beta1/tx.rpc.msg.ts rename to packages/osmojs/src/codegen/osmosis/valsetpref/v1beta1/tx.rpc.msg.ts index c553d41cb..41fa33828 100644 --- a/packages/osmo-query/src/codegen/osmosis/valset-pref/v1beta1/tx.rpc.msg.ts +++ b/packages/osmojs/src/codegen/osmosis/valsetpref/v1beta1/tx.rpc.msg.ts @@ -1,7 +1,7 @@ import { Rpc } from "../../../helpers"; import { BinaryReader } from "../../../binary"; -import { MsgSetValidatorSetPreference, MsgSetValidatorSetPreferenceResponse, MsgDelegateToValidatorSet, MsgDelegateToValidatorSetResponse, MsgUndelegateFromValidatorSet, MsgUndelegateFromValidatorSetResponse, MsgRedelegateValidatorSet, MsgRedelegateValidatorSetResponse, MsgWithdrawDelegationRewards, MsgWithdrawDelegationRewardsResponse, MsgDelegateBondedTokens, MsgDelegateBondedTokensResponse } from "./tx"; -/** Msg defines the valset-pref modules's gRPC message service. */ +import { MsgSetValidatorSetPreference, MsgSetValidatorSetPreferenceResponse, MsgDelegateToValidatorSet, MsgDelegateToValidatorSetResponse, MsgUndelegateFromValidatorSet, MsgUndelegateFromValidatorSetResponse, MsgUndelegateFromRebalancedValidatorSet, MsgUndelegateFromRebalancedValidatorSetResponse, MsgRedelegateValidatorSet, MsgRedelegateValidatorSetResponse, MsgWithdrawDelegationRewards, MsgWithdrawDelegationRewardsResponse, MsgDelegateBondedTokens, MsgDelegateBondedTokensResponse } from "./tx"; +/** Msg defines the valset-pref module's gRPC message service. */ export interface Msg { /** * SetValidatorSetPreference creates a set of validator preference. @@ -19,6 +19,12 @@ export interface Msg { * the sdk. */ undelegateFromValidatorSet(request: MsgUndelegateFromValidatorSet): Promise; + /** + * UndelegateFromRebalancedValidatorSet undelegates the proivded amount from + * the validator set, but takes into consideration the current delegations + * to the user's validator set to determine the weights assigned to each. + */ + undelegateFromRebalancedValidatorSet(request: MsgUndelegateFromRebalancedValidatorSet): Promise; /** * RedelegateValidatorSet takes the existing validator set and redelegates to * a new set. @@ -42,6 +48,7 @@ export class MsgClientImpl implements Msg { this.setValidatorSetPreference = this.setValidatorSetPreference.bind(this); this.delegateToValidatorSet = this.delegateToValidatorSet.bind(this); this.undelegateFromValidatorSet = this.undelegateFromValidatorSet.bind(this); + this.undelegateFromRebalancedValidatorSet = this.undelegateFromRebalancedValidatorSet.bind(this); this.redelegateValidatorSet = this.redelegateValidatorSet.bind(this); this.withdrawDelegationRewards = this.withdrawDelegationRewards.bind(this); this.delegateBondedTokens = this.delegateBondedTokens.bind(this); @@ -61,6 +68,11 @@ export class MsgClientImpl implements Msg { const promise = this.rpc.request("osmosis.valsetpref.v1beta1.Msg", "UndelegateFromValidatorSet", data); return promise.then(data => MsgUndelegateFromValidatorSetResponse.decode(new BinaryReader(data))); } + undelegateFromRebalancedValidatorSet(request: MsgUndelegateFromRebalancedValidatorSet): Promise { + const data = MsgUndelegateFromRebalancedValidatorSet.encode(request).finish(); + const promise = this.rpc.request("osmosis.valsetpref.v1beta1.Msg", "UndelegateFromRebalancedValidatorSet", data); + return promise.then(data => MsgUndelegateFromRebalancedValidatorSetResponse.decode(new BinaryReader(data))); + } redelegateValidatorSet(request: MsgRedelegateValidatorSet): Promise { const data = MsgRedelegateValidatorSet.encode(request).finish(); const promise = this.rpc.request("osmosis.valsetpref.v1beta1.Msg", "RedelegateValidatorSet", data); @@ -76,4 +88,7 @@ export class MsgClientImpl implements Msg { const promise = this.rpc.request("osmosis.valsetpref.v1beta1.Msg", "DelegateBondedTokens", data); return promise.then(data => MsgDelegateBondedTokensResponse.decode(new BinaryReader(data))); } -} \ No newline at end of file +} +export const createClientImpl = (rpc: Rpc) => { + return new MsgClientImpl(rpc); +}; \ No newline at end of file diff --git a/packages/osmojs/src/codegen/osmosis/valset-pref/v1beta1/tx.ts b/packages/osmojs/src/codegen/osmosis/valsetpref/v1beta1/tx.ts similarity index 59% rename from packages/osmojs/src/codegen/osmosis/valset-pref/v1beta1/tx.ts rename to packages/osmojs/src/codegen/osmosis/valsetpref/v1beta1/tx.ts index e48015585..c459d07bf 100644 --- a/packages/osmojs/src/codegen/osmosis/valset-pref/v1beta1/tx.ts +++ b/packages/osmojs/src/codegen/osmosis/valsetpref/v1beta1/tx.ts @@ -1,6 +1,8 @@ import { ValidatorPreference, ValidatorPreferenceAmino, ValidatorPreferenceSDKType } from "./state"; import { Coin, CoinAmino, CoinSDKType } from "../../../cosmos/base/v1beta1/coin"; import { BinaryReader, BinaryWriter } from "../../../binary"; +import { isSet } from "../../../helpers"; +import { GlobalDecoderRegistry } from "../../../registry"; /** MsgCreateValidatorSetPreference is a list that holds validator-set. */ export interface MsgSetValidatorSetPreference { /** delegator is the user who is trying to create a validator-set. */ @@ -15,12 +17,12 @@ export interface MsgSetValidatorSetPreferenceProtoMsg { /** MsgCreateValidatorSetPreference is a list that holds validator-set. */ export interface MsgSetValidatorSetPreferenceAmino { /** delegator is the user who is trying to create a validator-set. */ - delegator: string; + delegator?: string; /** list of {valAddr, weight} to delegate to */ - preferences: ValidatorPreferenceAmino[]; + preferences?: ValidatorPreferenceAmino[]; } export interface MsgSetValidatorSetPreferenceAminoMsg { - type: "osmosis/valset-pref/MsgSetValidatorSetPreference"; + type: "osmosis/MsgSetValidatorSetPreference"; value: MsgSetValidatorSetPreferenceAmino; } /** MsgCreateValidatorSetPreference is a list that holds validator-set. */ @@ -64,7 +66,7 @@ export interface MsgDelegateToValidatorSetProtoMsg { */ export interface MsgDelegateToValidatorSetAmino { /** delegator is the user who is trying to delegate. */ - delegator: string; + delegator?: string; /** * the amount of tokens the user is trying to delegate. * For ex: delegate 10osmo with validator-set {ValA -> 0.5, ValB -> 0.3, ValC @@ -74,7 +76,7 @@ export interface MsgDelegateToValidatorSetAmino { coin?: CoinAmino; } export interface MsgDelegateToValidatorSetAminoMsg { - type: "osmosis/valset-pref/MsgDelegateToValidatorSet"; + type: "osmosis/MsgDelegateToValidatorSet"; value: MsgDelegateToValidatorSetAmino; } /** @@ -114,7 +116,7 @@ export interface MsgUndelegateFromValidatorSetProtoMsg { } export interface MsgUndelegateFromValidatorSetAmino { /** delegator is the user who is trying to undelegate. */ - delegator: string; + delegator?: string; /** * the amount the user wants to undelegate * For ex: Undelegate 10osmo with validator-set {ValA -> 0.5, ValB -> 0.3, @@ -125,7 +127,7 @@ export interface MsgUndelegateFromValidatorSetAmino { coin?: CoinAmino; } export interface MsgUndelegateFromValidatorSetAminoMsg { - type: "osmosis/valset-pref/MsgUndelegateFromValidatorSet"; + type: "osmosis/MsgUndelegateFromValidatorSet"; value: MsgUndelegateFromValidatorSetAmino; } export interface MsgUndelegateFromValidatorSetSDKType { @@ -143,6 +145,57 @@ export interface MsgUndelegateFromValidatorSetResponseAminoMsg { value: MsgUndelegateFromValidatorSetResponseAmino; } export interface MsgUndelegateFromValidatorSetResponseSDKType {} +export interface MsgUndelegateFromRebalancedValidatorSet { + /** delegator is the user who is trying to undelegate. */ + delegator: string; + /** + * the amount the user wants to undelegate + * For ex: Undelegate 50 osmo with validator-set {ValA -> 0.5, ValB -> 0.5} + * Our undelegate logic would first check the current delegation balance. + * If the user has 90 osmo delegated to ValA and 10 osmo delegated to ValB, + * the rebalanced validator set would be {ValA -> 0.9, ValB -> 0.1} + * So now the 45 osmo would be undelegated from ValA and 5 osmo would be + * undelegated from ValB. + */ + coin: Coin; +} +export interface MsgUndelegateFromRebalancedValidatorSetProtoMsg { + typeUrl: "/osmosis.valsetpref.v1beta1.MsgUndelegateFromRebalancedValidatorSet"; + value: Uint8Array; +} +export interface MsgUndelegateFromRebalancedValidatorSetAmino { + /** delegator is the user who is trying to undelegate. */ + delegator?: string; + /** + * the amount the user wants to undelegate + * For ex: Undelegate 50 osmo with validator-set {ValA -> 0.5, ValB -> 0.5} + * Our undelegate logic would first check the current delegation balance. + * If the user has 90 osmo delegated to ValA and 10 osmo delegated to ValB, + * the rebalanced validator set would be {ValA -> 0.9, ValB -> 0.1} + * So now the 45 osmo would be undelegated from ValA and 5 osmo would be + * undelegated from ValB. + */ + coin?: CoinAmino; +} +export interface MsgUndelegateFromRebalancedValidatorSetAminoMsg { + type: "osmosis/MsgUndelegateFromRebalValset"; + value: MsgUndelegateFromRebalancedValidatorSetAmino; +} +export interface MsgUndelegateFromRebalancedValidatorSetSDKType { + delegator: string; + coin: CoinSDKType; +} +export interface MsgUndelegateFromRebalancedValidatorSetResponse {} +export interface MsgUndelegateFromRebalancedValidatorSetResponseProtoMsg { + typeUrl: "/osmosis.valsetpref.v1beta1.MsgUndelegateFromRebalancedValidatorSetResponse"; + value: Uint8Array; +} +export interface MsgUndelegateFromRebalancedValidatorSetResponseAmino {} +export interface MsgUndelegateFromRebalancedValidatorSetResponseAminoMsg { + type: "osmosis/valsetpref/undelegate-from-rebalanced-validator-set-response"; + value: MsgUndelegateFromRebalancedValidatorSetResponseAmino; +} +export interface MsgUndelegateFromRebalancedValidatorSetResponseSDKType {} export interface MsgRedelegateValidatorSet { /** delegator is the user who is trying to create a validator-set. */ delegator: string; @@ -155,12 +208,12 @@ export interface MsgRedelegateValidatorSetProtoMsg { } export interface MsgRedelegateValidatorSetAmino { /** delegator is the user who is trying to create a validator-set. */ - delegator: string; + delegator?: string; /** list of {valAddr, weight} to delegate to */ - preferences: ValidatorPreferenceAmino[]; + preferences?: ValidatorPreferenceAmino[]; } export interface MsgRedelegateValidatorSetAminoMsg { - type: "osmosis/valsetpref/redelegate-validator-set"; + type: "osmosis/MsgRedelegateValidatorSet"; value: MsgRedelegateValidatorSetAmino; } export interface MsgRedelegateValidatorSetSDKType { @@ -196,10 +249,10 @@ export interface MsgWithdrawDelegationRewardsProtoMsg { */ export interface MsgWithdrawDelegationRewardsAmino { /** delegator is the user who is trying to claim staking rewards. */ - delegator: string; + delegator?: string; } export interface MsgWithdrawDelegationRewardsAminoMsg { - type: "osmosis/valset-pref/MsgWithdrawDelegationRewards"; + type: "osmosis/MsgWithdrawDelegationRewards"; value: MsgWithdrawDelegationRewardsAmino; } /** @@ -242,9 +295,9 @@ export interface MsgDelegateBondedTokensProtoMsg { */ export interface MsgDelegateBondedTokensAmino { /** delegator is the user who is trying to force unbond osmo and delegate. */ - delegator: string; + delegator?: string; /** lockup id of osmo in the pool */ - lockID: string; + lockID?: string; } export interface MsgDelegateBondedTokensAminoMsg { type: "osmosis/valsetpref/delegate-bonded-tokens"; @@ -278,6 +331,16 @@ function createBaseMsgSetValidatorSetPreference(): MsgSetValidatorSetPreference } export const MsgSetValidatorSetPreference = { typeUrl: "/osmosis.valsetpref.v1beta1.MsgSetValidatorSetPreference", + aminoType: "osmosis/MsgSetValidatorSetPreference", + is(o: any): o is MsgSetValidatorSetPreference { + return o && (o.$typeUrl === MsgSetValidatorSetPreference.typeUrl || typeof o.delegator === "string" && Array.isArray(o.preferences) && (!o.preferences.length || ValidatorPreference.is(o.preferences[0]))); + }, + isSDK(o: any): o is MsgSetValidatorSetPreferenceSDKType { + return o && (o.$typeUrl === MsgSetValidatorSetPreference.typeUrl || typeof o.delegator === "string" && Array.isArray(o.preferences) && (!o.preferences.length || ValidatorPreference.isSDK(o.preferences[0]))); + }, + isAmino(o: any): o is MsgSetValidatorSetPreferenceAmino { + return o && (o.$typeUrl === MsgSetValidatorSetPreference.typeUrl || typeof o.delegator === "string" && Array.isArray(o.preferences) && (!o.preferences.length || ValidatorPreference.isAmino(o.preferences[0]))); + }, encode(message: MsgSetValidatorSetPreference, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.delegator !== "") { writer.uint32(10).string(message.delegator); @@ -307,6 +370,22 @@ export const MsgSetValidatorSetPreference = { } return message; }, + fromJSON(object: any): MsgSetValidatorSetPreference { + return { + delegator: isSet(object.delegator) ? String(object.delegator) : "", + preferences: Array.isArray(object?.preferences) ? object.preferences.map((e: any) => ValidatorPreference.fromJSON(e)) : [] + }; + }, + toJSON(message: MsgSetValidatorSetPreference): unknown { + const obj: any = {}; + message.delegator !== undefined && (obj.delegator = message.delegator); + if (message.preferences) { + obj.preferences = message.preferences.map(e => e ? ValidatorPreference.toJSON(e) : undefined); + } else { + obj.preferences = []; + } + return obj; + }, fromPartial(object: Partial): MsgSetValidatorSetPreference { const message = createBaseMsgSetValidatorSetPreference(); message.delegator = object.delegator ?? ""; @@ -314,10 +393,12 @@ export const MsgSetValidatorSetPreference = { return message; }, fromAmino(object: MsgSetValidatorSetPreferenceAmino): MsgSetValidatorSetPreference { - return { - delegator: object.delegator, - preferences: Array.isArray(object?.preferences) ? object.preferences.map((e: any) => ValidatorPreference.fromAmino(e)) : [] - }; + const message = createBaseMsgSetValidatorSetPreference(); + if (object.delegator !== undefined && object.delegator !== null) { + message.delegator = object.delegator; + } + message.preferences = object.preferences?.map(e => ValidatorPreference.fromAmino(e)) || []; + return message; }, toAmino(message: MsgSetValidatorSetPreference): MsgSetValidatorSetPreferenceAmino { const obj: any = {}; @@ -334,7 +415,7 @@ export const MsgSetValidatorSetPreference = { }, toAminoMsg(message: MsgSetValidatorSetPreference): MsgSetValidatorSetPreferenceAminoMsg { return { - type: "osmosis/valset-pref/MsgSetValidatorSetPreference", + type: "osmosis/MsgSetValidatorSetPreference", value: MsgSetValidatorSetPreference.toAmino(message) }; }, @@ -351,11 +432,23 @@ export const MsgSetValidatorSetPreference = { }; } }; +GlobalDecoderRegistry.register(MsgSetValidatorSetPreference.typeUrl, MsgSetValidatorSetPreference); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgSetValidatorSetPreference.aminoType, MsgSetValidatorSetPreference.typeUrl); function createBaseMsgSetValidatorSetPreferenceResponse(): MsgSetValidatorSetPreferenceResponse { return {}; } export const MsgSetValidatorSetPreferenceResponse = { typeUrl: "/osmosis.valsetpref.v1beta1.MsgSetValidatorSetPreferenceResponse", + aminoType: "osmosis/valsetpref/set-validator-set-preference-response", + is(o: any): o is MsgSetValidatorSetPreferenceResponse { + return o && o.$typeUrl === MsgSetValidatorSetPreferenceResponse.typeUrl; + }, + isSDK(o: any): o is MsgSetValidatorSetPreferenceResponseSDKType { + return o && o.$typeUrl === MsgSetValidatorSetPreferenceResponse.typeUrl; + }, + isAmino(o: any): o is MsgSetValidatorSetPreferenceResponseAmino { + return o && o.$typeUrl === MsgSetValidatorSetPreferenceResponse.typeUrl; + }, encode(_: MsgSetValidatorSetPreferenceResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, @@ -373,12 +466,20 @@ export const MsgSetValidatorSetPreferenceResponse = { } return message; }, + fromJSON(_: any): MsgSetValidatorSetPreferenceResponse { + return {}; + }, + toJSON(_: MsgSetValidatorSetPreferenceResponse): unknown { + const obj: any = {}; + return obj; + }, fromPartial(_: Partial): MsgSetValidatorSetPreferenceResponse { const message = createBaseMsgSetValidatorSetPreferenceResponse(); return message; }, fromAmino(_: MsgSetValidatorSetPreferenceResponseAmino): MsgSetValidatorSetPreferenceResponse { - return {}; + const message = createBaseMsgSetValidatorSetPreferenceResponse(); + return message; }, toAmino(_: MsgSetValidatorSetPreferenceResponse): MsgSetValidatorSetPreferenceResponseAmino { const obj: any = {}; @@ -406,14 +507,26 @@ export const MsgSetValidatorSetPreferenceResponse = { }; } }; +GlobalDecoderRegistry.register(MsgSetValidatorSetPreferenceResponse.typeUrl, MsgSetValidatorSetPreferenceResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgSetValidatorSetPreferenceResponse.aminoType, MsgSetValidatorSetPreferenceResponse.typeUrl); function createBaseMsgDelegateToValidatorSet(): MsgDelegateToValidatorSet { return { delegator: "", - coin: undefined + coin: Coin.fromPartial({}) }; } export const MsgDelegateToValidatorSet = { typeUrl: "/osmosis.valsetpref.v1beta1.MsgDelegateToValidatorSet", + aminoType: "osmosis/MsgDelegateToValidatorSet", + is(o: any): o is MsgDelegateToValidatorSet { + return o && (o.$typeUrl === MsgDelegateToValidatorSet.typeUrl || typeof o.delegator === "string" && Coin.is(o.coin)); + }, + isSDK(o: any): o is MsgDelegateToValidatorSetSDKType { + return o && (o.$typeUrl === MsgDelegateToValidatorSet.typeUrl || typeof o.delegator === "string" && Coin.isSDK(o.coin)); + }, + isAmino(o: any): o is MsgDelegateToValidatorSetAmino { + return o && (o.$typeUrl === MsgDelegateToValidatorSet.typeUrl || typeof o.delegator === "string" && Coin.isAmino(o.coin)); + }, encode(message: MsgDelegateToValidatorSet, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.delegator !== "") { writer.uint32(10).string(message.delegator); @@ -443,6 +556,18 @@ export const MsgDelegateToValidatorSet = { } return message; }, + fromJSON(object: any): MsgDelegateToValidatorSet { + return { + delegator: isSet(object.delegator) ? String(object.delegator) : "", + coin: isSet(object.coin) ? Coin.fromJSON(object.coin) : undefined + }; + }, + toJSON(message: MsgDelegateToValidatorSet): unknown { + const obj: any = {}; + message.delegator !== undefined && (obj.delegator = message.delegator); + message.coin !== undefined && (obj.coin = message.coin ? Coin.toJSON(message.coin) : undefined); + return obj; + }, fromPartial(object: Partial): MsgDelegateToValidatorSet { const message = createBaseMsgDelegateToValidatorSet(); message.delegator = object.delegator ?? ""; @@ -450,10 +575,14 @@ export const MsgDelegateToValidatorSet = { return message; }, fromAmino(object: MsgDelegateToValidatorSetAmino): MsgDelegateToValidatorSet { - return { - delegator: object.delegator, - coin: object?.coin ? Coin.fromAmino(object.coin) : undefined - }; + const message = createBaseMsgDelegateToValidatorSet(); + if (object.delegator !== undefined && object.delegator !== null) { + message.delegator = object.delegator; + } + if (object.coin !== undefined && object.coin !== null) { + message.coin = Coin.fromAmino(object.coin); + } + return message; }, toAmino(message: MsgDelegateToValidatorSet): MsgDelegateToValidatorSetAmino { const obj: any = {}; @@ -466,7 +595,7 @@ export const MsgDelegateToValidatorSet = { }, toAminoMsg(message: MsgDelegateToValidatorSet): MsgDelegateToValidatorSetAminoMsg { return { - type: "osmosis/valset-pref/MsgDelegateToValidatorSet", + type: "osmosis/MsgDelegateToValidatorSet", value: MsgDelegateToValidatorSet.toAmino(message) }; }, @@ -483,11 +612,23 @@ export const MsgDelegateToValidatorSet = { }; } }; +GlobalDecoderRegistry.register(MsgDelegateToValidatorSet.typeUrl, MsgDelegateToValidatorSet); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgDelegateToValidatorSet.aminoType, MsgDelegateToValidatorSet.typeUrl); function createBaseMsgDelegateToValidatorSetResponse(): MsgDelegateToValidatorSetResponse { return {}; } export const MsgDelegateToValidatorSetResponse = { typeUrl: "/osmosis.valsetpref.v1beta1.MsgDelegateToValidatorSetResponse", + aminoType: "osmosis/valsetpref/delegate-to-validator-set-response", + is(o: any): o is MsgDelegateToValidatorSetResponse { + return o && o.$typeUrl === MsgDelegateToValidatorSetResponse.typeUrl; + }, + isSDK(o: any): o is MsgDelegateToValidatorSetResponseSDKType { + return o && o.$typeUrl === MsgDelegateToValidatorSetResponse.typeUrl; + }, + isAmino(o: any): o is MsgDelegateToValidatorSetResponseAmino { + return o && o.$typeUrl === MsgDelegateToValidatorSetResponse.typeUrl; + }, encode(_: MsgDelegateToValidatorSetResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, @@ -505,12 +646,20 @@ export const MsgDelegateToValidatorSetResponse = { } return message; }, + fromJSON(_: any): MsgDelegateToValidatorSetResponse { + return {}; + }, + toJSON(_: MsgDelegateToValidatorSetResponse): unknown { + const obj: any = {}; + return obj; + }, fromPartial(_: Partial): MsgDelegateToValidatorSetResponse { const message = createBaseMsgDelegateToValidatorSetResponse(); return message; }, fromAmino(_: MsgDelegateToValidatorSetResponseAmino): MsgDelegateToValidatorSetResponse { - return {}; + const message = createBaseMsgDelegateToValidatorSetResponse(); + return message; }, toAmino(_: MsgDelegateToValidatorSetResponse): MsgDelegateToValidatorSetResponseAmino { const obj: any = {}; @@ -538,14 +687,26 @@ export const MsgDelegateToValidatorSetResponse = { }; } }; +GlobalDecoderRegistry.register(MsgDelegateToValidatorSetResponse.typeUrl, MsgDelegateToValidatorSetResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgDelegateToValidatorSetResponse.aminoType, MsgDelegateToValidatorSetResponse.typeUrl); function createBaseMsgUndelegateFromValidatorSet(): MsgUndelegateFromValidatorSet { return { delegator: "", - coin: undefined + coin: Coin.fromPartial({}) }; } export const MsgUndelegateFromValidatorSet = { typeUrl: "/osmosis.valsetpref.v1beta1.MsgUndelegateFromValidatorSet", + aminoType: "osmosis/MsgUndelegateFromValidatorSet", + is(o: any): o is MsgUndelegateFromValidatorSet { + return o && (o.$typeUrl === MsgUndelegateFromValidatorSet.typeUrl || typeof o.delegator === "string" && Coin.is(o.coin)); + }, + isSDK(o: any): o is MsgUndelegateFromValidatorSetSDKType { + return o && (o.$typeUrl === MsgUndelegateFromValidatorSet.typeUrl || typeof o.delegator === "string" && Coin.isSDK(o.coin)); + }, + isAmino(o: any): o is MsgUndelegateFromValidatorSetAmino { + return o && (o.$typeUrl === MsgUndelegateFromValidatorSet.typeUrl || typeof o.delegator === "string" && Coin.isAmino(o.coin)); + }, encode(message: MsgUndelegateFromValidatorSet, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.delegator !== "") { writer.uint32(10).string(message.delegator); @@ -575,6 +736,18 @@ export const MsgUndelegateFromValidatorSet = { } return message; }, + fromJSON(object: any): MsgUndelegateFromValidatorSet { + return { + delegator: isSet(object.delegator) ? String(object.delegator) : "", + coin: isSet(object.coin) ? Coin.fromJSON(object.coin) : undefined + }; + }, + toJSON(message: MsgUndelegateFromValidatorSet): unknown { + const obj: any = {}; + message.delegator !== undefined && (obj.delegator = message.delegator); + message.coin !== undefined && (obj.coin = message.coin ? Coin.toJSON(message.coin) : undefined); + return obj; + }, fromPartial(object: Partial): MsgUndelegateFromValidatorSet { const message = createBaseMsgUndelegateFromValidatorSet(); message.delegator = object.delegator ?? ""; @@ -582,10 +755,14 @@ export const MsgUndelegateFromValidatorSet = { return message; }, fromAmino(object: MsgUndelegateFromValidatorSetAmino): MsgUndelegateFromValidatorSet { - return { - delegator: object.delegator, - coin: object?.coin ? Coin.fromAmino(object.coin) : undefined - }; + const message = createBaseMsgUndelegateFromValidatorSet(); + if (object.delegator !== undefined && object.delegator !== null) { + message.delegator = object.delegator; + } + if (object.coin !== undefined && object.coin !== null) { + message.coin = Coin.fromAmino(object.coin); + } + return message; }, toAmino(message: MsgUndelegateFromValidatorSet): MsgUndelegateFromValidatorSetAmino { const obj: any = {}; @@ -598,7 +775,7 @@ export const MsgUndelegateFromValidatorSet = { }, toAminoMsg(message: MsgUndelegateFromValidatorSet): MsgUndelegateFromValidatorSetAminoMsg { return { - type: "osmosis/valset-pref/MsgUndelegateFromValidatorSet", + type: "osmosis/MsgUndelegateFromValidatorSet", value: MsgUndelegateFromValidatorSet.toAmino(message) }; }, @@ -615,11 +792,23 @@ export const MsgUndelegateFromValidatorSet = { }; } }; +GlobalDecoderRegistry.register(MsgUndelegateFromValidatorSet.typeUrl, MsgUndelegateFromValidatorSet); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgUndelegateFromValidatorSet.aminoType, MsgUndelegateFromValidatorSet.typeUrl); function createBaseMsgUndelegateFromValidatorSetResponse(): MsgUndelegateFromValidatorSetResponse { return {}; } export const MsgUndelegateFromValidatorSetResponse = { typeUrl: "/osmosis.valsetpref.v1beta1.MsgUndelegateFromValidatorSetResponse", + aminoType: "osmosis/valsetpref/undelegate-from-validator-set-response", + is(o: any): o is MsgUndelegateFromValidatorSetResponse { + return o && o.$typeUrl === MsgUndelegateFromValidatorSetResponse.typeUrl; + }, + isSDK(o: any): o is MsgUndelegateFromValidatorSetResponseSDKType { + return o && o.$typeUrl === MsgUndelegateFromValidatorSetResponse.typeUrl; + }, + isAmino(o: any): o is MsgUndelegateFromValidatorSetResponseAmino { + return o && o.$typeUrl === MsgUndelegateFromValidatorSetResponse.typeUrl; + }, encode(_: MsgUndelegateFromValidatorSetResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, @@ -637,12 +826,20 @@ export const MsgUndelegateFromValidatorSetResponse = { } return message; }, + fromJSON(_: any): MsgUndelegateFromValidatorSetResponse { + return {}; + }, + toJSON(_: MsgUndelegateFromValidatorSetResponse): unknown { + const obj: any = {}; + return obj; + }, fromPartial(_: Partial): MsgUndelegateFromValidatorSetResponse { const message = createBaseMsgUndelegateFromValidatorSetResponse(); return message; }, fromAmino(_: MsgUndelegateFromValidatorSetResponseAmino): MsgUndelegateFromValidatorSetResponse { - return {}; + const message = createBaseMsgUndelegateFromValidatorSetResponse(); + return message; }, toAmino(_: MsgUndelegateFromValidatorSetResponse): MsgUndelegateFromValidatorSetResponseAmino { const obj: any = {}; @@ -670,6 +867,188 @@ export const MsgUndelegateFromValidatorSetResponse = { }; } }; +GlobalDecoderRegistry.register(MsgUndelegateFromValidatorSetResponse.typeUrl, MsgUndelegateFromValidatorSetResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgUndelegateFromValidatorSetResponse.aminoType, MsgUndelegateFromValidatorSetResponse.typeUrl); +function createBaseMsgUndelegateFromRebalancedValidatorSet(): MsgUndelegateFromRebalancedValidatorSet { + return { + delegator: "", + coin: Coin.fromPartial({}) + }; +} +export const MsgUndelegateFromRebalancedValidatorSet = { + typeUrl: "/osmosis.valsetpref.v1beta1.MsgUndelegateFromRebalancedValidatorSet", + aminoType: "osmosis/MsgUndelegateFromRebalValset", + is(o: any): o is MsgUndelegateFromRebalancedValidatorSet { + return o && (o.$typeUrl === MsgUndelegateFromRebalancedValidatorSet.typeUrl || typeof o.delegator === "string" && Coin.is(o.coin)); + }, + isSDK(o: any): o is MsgUndelegateFromRebalancedValidatorSetSDKType { + return o && (o.$typeUrl === MsgUndelegateFromRebalancedValidatorSet.typeUrl || typeof o.delegator === "string" && Coin.isSDK(o.coin)); + }, + isAmino(o: any): o is MsgUndelegateFromRebalancedValidatorSetAmino { + return o && (o.$typeUrl === MsgUndelegateFromRebalancedValidatorSet.typeUrl || typeof o.delegator === "string" && Coin.isAmino(o.coin)); + }, + encode(message: MsgUndelegateFromRebalancedValidatorSet, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.delegator !== "") { + writer.uint32(10).string(message.delegator); + } + if (message.coin !== undefined) { + Coin.encode(message.coin, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgUndelegateFromRebalancedValidatorSet { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUndelegateFromRebalancedValidatorSet(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.delegator = reader.string(); + break; + case 2: + message.coin = Coin.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): MsgUndelegateFromRebalancedValidatorSet { + return { + delegator: isSet(object.delegator) ? String(object.delegator) : "", + coin: isSet(object.coin) ? Coin.fromJSON(object.coin) : undefined + }; + }, + toJSON(message: MsgUndelegateFromRebalancedValidatorSet): unknown { + const obj: any = {}; + message.delegator !== undefined && (obj.delegator = message.delegator); + message.coin !== undefined && (obj.coin = message.coin ? Coin.toJSON(message.coin) : undefined); + return obj; + }, + fromPartial(object: Partial): MsgUndelegateFromRebalancedValidatorSet { + const message = createBaseMsgUndelegateFromRebalancedValidatorSet(); + message.delegator = object.delegator ?? ""; + message.coin = object.coin !== undefined && object.coin !== null ? Coin.fromPartial(object.coin) : undefined; + return message; + }, + fromAmino(object: MsgUndelegateFromRebalancedValidatorSetAmino): MsgUndelegateFromRebalancedValidatorSet { + const message = createBaseMsgUndelegateFromRebalancedValidatorSet(); + if (object.delegator !== undefined && object.delegator !== null) { + message.delegator = object.delegator; + } + if (object.coin !== undefined && object.coin !== null) { + message.coin = Coin.fromAmino(object.coin); + } + return message; + }, + toAmino(message: MsgUndelegateFromRebalancedValidatorSet): MsgUndelegateFromRebalancedValidatorSetAmino { + const obj: any = {}; + obj.delegator = message.delegator; + obj.coin = message.coin ? Coin.toAmino(message.coin) : undefined; + return obj; + }, + fromAminoMsg(object: MsgUndelegateFromRebalancedValidatorSetAminoMsg): MsgUndelegateFromRebalancedValidatorSet { + return MsgUndelegateFromRebalancedValidatorSet.fromAmino(object.value); + }, + toAminoMsg(message: MsgUndelegateFromRebalancedValidatorSet): MsgUndelegateFromRebalancedValidatorSetAminoMsg { + return { + type: "osmosis/MsgUndelegateFromRebalValset", + value: MsgUndelegateFromRebalancedValidatorSet.toAmino(message) + }; + }, + fromProtoMsg(message: MsgUndelegateFromRebalancedValidatorSetProtoMsg): MsgUndelegateFromRebalancedValidatorSet { + return MsgUndelegateFromRebalancedValidatorSet.decode(message.value); + }, + toProto(message: MsgUndelegateFromRebalancedValidatorSet): Uint8Array { + return MsgUndelegateFromRebalancedValidatorSet.encode(message).finish(); + }, + toProtoMsg(message: MsgUndelegateFromRebalancedValidatorSet): MsgUndelegateFromRebalancedValidatorSetProtoMsg { + return { + typeUrl: "/osmosis.valsetpref.v1beta1.MsgUndelegateFromRebalancedValidatorSet", + value: MsgUndelegateFromRebalancedValidatorSet.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgUndelegateFromRebalancedValidatorSet.typeUrl, MsgUndelegateFromRebalancedValidatorSet); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgUndelegateFromRebalancedValidatorSet.aminoType, MsgUndelegateFromRebalancedValidatorSet.typeUrl); +function createBaseMsgUndelegateFromRebalancedValidatorSetResponse(): MsgUndelegateFromRebalancedValidatorSetResponse { + return {}; +} +export const MsgUndelegateFromRebalancedValidatorSetResponse = { + typeUrl: "/osmosis.valsetpref.v1beta1.MsgUndelegateFromRebalancedValidatorSetResponse", + aminoType: "osmosis/valsetpref/undelegate-from-rebalanced-validator-set-response", + is(o: any): o is MsgUndelegateFromRebalancedValidatorSetResponse { + return o && o.$typeUrl === MsgUndelegateFromRebalancedValidatorSetResponse.typeUrl; + }, + isSDK(o: any): o is MsgUndelegateFromRebalancedValidatorSetResponseSDKType { + return o && o.$typeUrl === MsgUndelegateFromRebalancedValidatorSetResponse.typeUrl; + }, + isAmino(o: any): o is MsgUndelegateFromRebalancedValidatorSetResponseAmino { + return o && o.$typeUrl === MsgUndelegateFromRebalancedValidatorSetResponse.typeUrl; + }, + encode(_: MsgUndelegateFromRebalancedValidatorSetResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgUndelegateFromRebalancedValidatorSetResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUndelegateFromRebalancedValidatorSetResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(_: any): MsgUndelegateFromRebalancedValidatorSetResponse { + return {}; + }, + toJSON(_: MsgUndelegateFromRebalancedValidatorSetResponse): unknown { + const obj: any = {}; + return obj; + }, + fromPartial(_: Partial): MsgUndelegateFromRebalancedValidatorSetResponse { + const message = createBaseMsgUndelegateFromRebalancedValidatorSetResponse(); + return message; + }, + fromAmino(_: MsgUndelegateFromRebalancedValidatorSetResponseAmino): MsgUndelegateFromRebalancedValidatorSetResponse { + const message = createBaseMsgUndelegateFromRebalancedValidatorSetResponse(); + return message; + }, + toAmino(_: MsgUndelegateFromRebalancedValidatorSetResponse): MsgUndelegateFromRebalancedValidatorSetResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgUndelegateFromRebalancedValidatorSetResponseAminoMsg): MsgUndelegateFromRebalancedValidatorSetResponse { + return MsgUndelegateFromRebalancedValidatorSetResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgUndelegateFromRebalancedValidatorSetResponse): MsgUndelegateFromRebalancedValidatorSetResponseAminoMsg { + return { + type: "osmosis/valsetpref/undelegate-from-rebalanced-validator-set-response", + value: MsgUndelegateFromRebalancedValidatorSetResponse.toAmino(message) + }; + }, + fromProtoMsg(message: MsgUndelegateFromRebalancedValidatorSetResponseProtoMsg): MsgUndelegateFromRebalancedValidatorSetResponse { + return MsgUndelegateFromRebalancedValidatorSetResponse.decode(message.value); + }, + toProto(message: MsgUndelegateFromRebalancedValidatorSetResponse): Uint8Array { + return MsgUndelegateFromRebalancedValidatorSetResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgUndelegateFromRebalancedValidatorSetResponse): MsgUndelegateFromRebalancedValidatorSetResponseProtoMsg { + return { + typeUrl: "/osmosis.valsetpref.v1beta1.MsgUndelegateFromRebalancedValidatorSetResponse", + value: MsgUndelegateFromRebalancedValidatorSetResponse.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(MsgUndelegateFromRebalancedValidatorSetResponse.typeUrl, MsgUndelegateFromRebalancedValidatorSetResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgUndelegateFromRebalancedValidatorSetResponse.aminoType, MsgUndelegateFromRebalancedValidatorSetResponse.typeUrl); function createBaseMsgRedelegateValidatorSet(): MsgRedelegateValidatorSet { return { delegator: "", @@ -678,6 +1057,16 @@ function createBaseMsgRedelegateValidatorSet(): MsgRedelegateValidatorSet { } export const MsgRedelegateValidatorSet = { typeUrl: "/osmosis.valsetpref.v1beta1.MsgRedelegateValidatorSet", + aminoType: "osmosis/MsgRedelegateValidatorSet", + is(o: any): o is MsgRedelegateValidatorSet { + return o && (o.$typeUrl === MsgRedelegateValidatorSet.typeUrl || typeof o.delegator === "string" && Array.isArray(o.preferences) && (!o.preferences.length || ValidatorPreference.is(o.preferences[0]))); + }, + isSDK(o: any): o is MsgRedelegateValidatorSetSDKType { + return o && (o.$typeUrl === MsgRedelegateValidatorSet.typeUrl || typeof o.delegator === "string" && Array.isArray(o.preferences) && (!o.preferences.length || ValidatorPreference.isSDK(o.preferences[0]))); + }, + isAmino(o: any): o is MsgRedelegateValidatorSetAmino { + return o && (o.$typeUrl === MsgRedelegateValidatorSet.typeUrl || typeof o.delegator === "string" && Array.isArray(o.preferences) && (!o.preferences.length || ValidatorPreference.isAmino(o.preferences[0]))); + }, encode(message: MsgRedelegateValidatorSet, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.delegator !== "") { writer.uint32(10).string(message.delegator); @@ -707,6 +1096,22 @@ export const MsgRedelegateValidatorSet = { } return message; }, + fromJSON(object: any): MsgRedelegateValidatorSet { + return { + delegator: isSet(object.delegator) ? String(object.delegator) : "", + preferences: Array.isArray(object?.preferences) ? object.preferences.map((e: any) => ValidatorPreference.fromJSON(e)) : [] + }; + }, + toJSON(message: MsgRedelegateValidatorSet): unknown { + const obj: any = {}; + message.delegator !== undefined && (obj.delegator = message.delegator); + if (message.preferences) { + obj.preferences = message.preferences.map(e => e ? ValidatorPreference.toJSON(e) : undefined); + } else { + obj.preferences = []; + } + return obj; + }, fromPartial(object: Partial): MsgRedelegateValidatorSet { const message = createBaseMsgRedelegateValidatorSet(); message.delegator = object.delegator ?? ""; @@ -714,10 +1119,12 @@ export const MsgRedelegateValidatorSet = { return message; }, fromAmino(object: MsgRedelegateValidatorSetAmino): MsgRedelegateValidatorSet { - return { - delegator: object.delegator, - preferences: Array.isArray(object?.preferences) ? object.preferences.map((e: any) => ValidatorPreference.fromAmino(e)) : [] - }; + const message = createBaseMsgRedelegateValidatorSet(); + if (object.delegator !== undefined && object.delegator !== null) { + message.delegator = object.delegator; + } + message.preferences = object.preferences?.map(e => ValidatorPreference.fromAmino(e)) || []; + return message; }, toAmino(message: MsgRedelegateValidatorSet): MsgRedelegateValidatorSetAmino { const obj: any = {}; @@ -734,7 +1141,7 @@ export const MsgRedelegateValidatorSet = { }, toAminoMsg(message: MsgRedelegateValidatorSet): MsgRedelegateValidatorSetAminoMsg { return { - type: "osmosis/valsetpref/redelegate-validator-set", + type: "osmosis/MsgRedelegateValidatorSet", value: MsgRedelegateValidatorSet.toAmino(message) }; }, @@ -751,11 +1158,23 @@ export const MsgRedelegateValidatorSet = { }; } }; +GlobalDecoderRegistry.register(MsgRedelegateValidatorSet.typeUrl, MsgRedelegateValidatorSet); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgRedelegateValidatorSet.aminoType, MsgRedelegateValidatorSet.typeUrl); function createBaseMsgRedelegateValidatorSetResponse(): MsgRedelegateValidatorSetResponse { return {}; } export const MsgRedelegateValidatorSetResponse = { typeUrl: "/osmosis.valsetpref.v1beta1.MsgRedelegateValidatorSetResponse", + aminoType: "osmosis/valsetpref/redelegate-validator-set-response", + is(o: any): o is MsgRedelegateValidatorSetResponse { + return o && o.$typeUrl === MsgRedelegateValidatorSetResponse.typeUrl; + }, + isSDK(o: any): o is MsgRedelegateValidatorSetResponseSDKType { + return o && o.$typeUrl === MsgRedelegateValidatorSetResponse.typeUrl; + }, + isAmino(o: any): o is MsgRedelegateValidatorSetResponseAmino { + return o && o.$typeUrl === MsgRedelegateValidatorSetResponse.typeUrl; + }, encode(_: MsgRedelegateValidatorSetResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, @@ -773,12 +1192,20 @@ export const MsgRedelegateValidatorSetResponse = { } return message; }, + fromJSON(_: any): MsgRedelegateValidatorSetResponse { + return {}; + }, + toJSON(_: MsgRedelegateValidatorSetResponse): unknown { + const obj: any = {}; + return obj; + }, fromPartial(_: Partial): MsgRedelegateValidatorSetResponse { const message = createBaseMsgRedelegateValidatorSetResponse(); return message; }, fromAmino(_: MsgRedelegateValidatorSetResponseAmino): MsgRedelegateValidatorSetResponse { - return {}; + const message = createBaseMsgRedelegateValidatorSetResponse(); + return message; }, toAmino(_: MsgRedelegateValidatorSetResponse): MsgRedelegateValidatorSetResponseAmino { const obj: any = {}; @@ -806,6 +1233,8 @@ export const MsgRedelegateValidatorSetResponse = { }; } }; +GlobalDecoderRegistry.register(MsgRedelegateValidatorSetResponse.typeUrl, MsgRedelegateValidatorSetResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgRedelegateValidatorSetResponse.aminoType, MsgRedelegateValidatorSetResponse.typeUrl); function createBaseMsgWithdrawDelegationRewards(): MsgWithdrawDelegationRewards { return { delegator: "" @@ -813,6 +1242,16 @@ function createBaseMsgWithdrawDelegationRewards(): MsgWithdrawDelegationRewards } export const MsgWithdrawDelegationRewards = { typeUrl: "/osmosis.valsetpref.v1beta1.MsgWithdrawDelegationRewards", + aminoType: "osmosis/MsgWithdrawDelegationRewards", + is(o: any): o is MsgWithdrawDelegationRewards { + return o && (o.$typeUrl === MsgWithdrawDelegationRewards.typeUrl || typeof o.delegator === "string"); + }, + isSDK(o: any): o is MsgWithdrawDelegationRewardsSDKType { + return o && (o.$typeUrl === MsgWithdrawDelegationRewards.typeUrl || typeof o.delegator === "string"); + }, + isAmino(o: any): o is MsgWithdrawDelegationRewardsAmino { + return o && (o.$typeUrl === MsgWithdrawDelegationRewards.typeUrl || typeof o.delegator === "string"); + }, encode(message: MsgWithdrawDelegationRewards, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.delegator !== "") { writer.uint32(10).string(message.delegator); @@ -836,15 +1275,27 @@ export const MsgWithdrawDelegationRewards = { } return message; }, + fromJSON(object: any): MsgWithdrawDelegationRewards { + return { + delegator: isSet(object.delegator) ? String(object.delegator) : "" + }; + }, + toJSON(message: MsgWithdrawDelegationRewards): unknown { + const obj: any = {}; + message.delegator !== undefined && (obj.delegator = message.delegator); + return obj; + }, fromPartial(object: Partial): MsgWithdrawDelegationRewards { const message = createBaseMsgWithdrawDelegationRewards(); message.delegator = object.delegator ?? ""; return message; }, fromAmino(object: MsgWithdrawDelegationRewardsAmino): MsgWithdrawDelegationRewards { - return { - delegator: object.delegator - }; + const message = createBaseMsgWithdrawDelegationRewards(); + if (object.delegator !== undefined && object.delegator !== null) { + message.delegator = object.delegator; + } + return message; }, toAmino(message: MsgWithdrawDelegationRewards): MsgWithdrawDelegationRewardsAmino { const obj: any = {}; @@ -856,7 +1307,7 @@ export const MsgWithdrawDelegationRewards = { }, toAminoMsg(message: MsgWithdrawDelegationRewards): MsgWithdrawDelegationRewardsAminoMsg { return { - type: "osmosis/valset-pref/MsgWithdrawDelegationRewards", + type: "osmosis/MsgWithdrawDelegationRewards", value: MsgWithdrawDelegationRewards.toAmino(message) }; }, @@ -873,11 +1324,23 @@ export const MsgWithdrawDelegationRewards = { }; } }; +GlobalDecoderRegistry.register(MsgWithdrawDelegationRewards.typeUrl, MsgWithdrawDelegationRewards); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgWithdrawDelegationRewards.aminoType, MsgWithdrawDelegationRewards.typeUrl); function createBaseMsgWithdrawDelegationRewardsResponse(): MsgWithdrawDelegationRewardsResponse { return {}; } export const MsgWithdrawDelegationRewardsResponse = { typeUrl: "/osmosis.valsetpref.v1beta1.MsgWithdrawDelegationRewardsResponse", + aminoType: "osmosis/valsetpref/withdraw-delegation-rewards-response", + is(o: any): o is MsgWithdrawDelegationRewardsResponse { + return o && o.$typeUrl === MsgWithdrawDelegationRewardsResponse.typeUrl; + }, + isSDK(o: any): o is MsgWithdrawDelegationRewardsResponseSDKType { + return o && o.$typeUrl === MsgWithdrawDelegationRewardsResponse.typeUrl; + }, + isAmino(o: any): o is MsgWithdrawDelegationRewardsResponseAmino { + return o && o.$typeUrl === MsgWithdrawDelegationRewardsResponse.typeUrl; + }, encode(_: MsgWithdrawDelegationRewardsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, @@ -895,12 +1358,20 @@ export const MsgWithdrawDelegationRewardsResponse = { } return message; }, + fromJSON(_: any): MsgWithdrawDelegationRewardsResponse { + return {}; + }, + toJSON(_: MsgWithdrawDelegationRewardsResponse): unknown { + const obj: any = {}; + return obj; + }, fromPartial(_: Partial): MsgWithdrawDelegationRewardsResponse { const message = createBaseMsgWithdrawDelegationRewardsResponse(); return message; }, fromAmino(_: MsgWithdrawDelegationRewardsResponseAmino): MsgWithdrawDelegationRewardsResponse { - return {}; + const message = createBaseMsgWithdrawDelegationRewardsResponse(); + return message; }, toAmino(_: MsgWithdrawDelegationRewardsResponse): MsgWithdrawDelegationRewardsResponseAmino { const obj: any = {}; @@ -928,6 +1399,8 @@ export const MsgWithdrawDelegationRewardsResponse = { }; } }; +GlobalDecoderRegistry.register(MsgWithdrawDelegationRewardsResponse.typeUrl, MsgWithdrawDelegationRewardsResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgWithdrawDelegationRewardsResponse.aminoType, MsgWithdrawDelegationRewardsResponse.typeUrl); function createBaseMsgDelegateBondedTokens(): MsgDelegateBondedTokens { return { delegator: "", @@ -936,6 +1409,16 @@ function createBaseMsgDelegateBondedTokens(): MsgDelegateBondedTokens { } export const MsgDelegateBondedTokens = { typeUrl: "/osmosis.valsetpref.v1beta1.MsgDelegateBondedTokens", + aminoType: "osmosis/valsetpref/delegate-bonded-tokens", + is(o: any): o is MsgDelegateBondedTokens { + return o && (o.$typeUrl === MsgDelegateBondedTokens.typeUrl || typeof o.delegator === "string" && typeof o.lockID === "bigint"); + }, + isSDK(o: any): o is MsgDelegateBondedTokensSDKType { + return o && (o.$typeUrl === MsgDelegateBondedTokens.typeUrl || typeof o.delegator === "string" && typeof o.lockID === "bigint"); + }, + isAmino(o: any): o is MsgDelegateBondedTokensAmino { + return o && (o.$typeUrl === MsgDelegateBondedTokens.typeUrl || typeof o.delegator === "string" && typeof o.lockID === "bigint"); + }, encode(message: MsgDelegateBondedTokens, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.delegator !== "") { writer.uint32(10).string(message.delegator); @@ -965,6 +1448,18 @@ export const MsgDelegateBondedTokens = { } return message; }, + fromJSON(object: any): MsgDelegateBondedTokens { + return { + delegator: isSet(object.delegator) ? String(object.delegator) : "", + lockID: isSet(object.lockID) ? BigInt(object.lockID.toString()) : BigInt(0) + }; + }, + toJSON(message: MsgDelegateBondedTokens): unknown { + const obj: any = {}; + message.delegator !== undefined && (obj.delegator = message.delegator); + message.lockID !== undefined && (obj.lockID = (message.lockID || BigInt(0)).toString()); + return obj; + }, fromPartial(object: Partial): MsgDelegateBondedTokens { const message = createBaseMsgDelegateBondedTokens(); message.delegator = object.delegator ?? ""; @@ -972,10 +1467,14 @@ export const MsgDelegateBondedTokens = { return message; }, fromAmino(object: MsgDelegateBondedTokensAmino): MsgDelegateBondedTokens { - return { - delegator: object.delegator, - lockID: BigInt(object.lockID) - }; + const message = createBaseMsgDelegateBondedTokens(); + if (object.delegator !== undefined && object.delegator !== null) { + message.delegator = object.delegator; + } + if (object.lockID !== undefined && object.lockID !== null) { + message.lockID = BigInt(object.lockID); + } + return message; }, toAmino(message: MsgDelegateBondedTokens): MsgDelegateBondedTokensAmino { const obj: any = {}; @@ -1005,11 +1504,23 @@ export const MsgDelegateBondedTokens = { }; } }; +GlobalDecoderRegistry.register(MsgDelegateBondedTokens.typeUrl, MsgDelegateBondedTokens); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgDelegateBondedTokens.aminoType, MsgDelegateBondedTokens.typeUrl); function createBaseMsgDelegateBondedTokensResponse(): MsgDelegateBondedTokensResponse { return {}; } export const MsgDelegateBondedTokensResponse = { typeUrl: "/osmosis.valsetpref.v1beta1.MsgDelegateBondedTokensResponse", + aminoType: "osmosis/valsetpref/delegate-bonded-tokens-response", + is(o: any): o is MsgDelegateBondedTokensResponse { + return o && o.$typeUrl === MsgDelegateBondedTokensResponse.typeUrl; + }, + isSDK(o: any): o is MsgDelegateBondedTokensResponseSDKType { + return o && o.$typeUrl === MsgDelegateBondedTokensResponse.typeUrl; + }, + isAmino(o: any): o is MsgDelegateBondedTokensResponseAmino { + return o && o.$typeUrl === MsgDelegateBondedTokensResponse.typeUrl; + }, encode(_: MsgDelegateBondedTokensResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, @@ -1027,12 +1538,20 @@ export const MsgDelegateBondedTokensResponse = { } return message; }, + fromJSON(_: any): MsgDelegateBondedTokensResponse { + return {}; + }, + toJSON(_: MsgDelegateBondedTokensResponse): unknown { + const obj: any = {}; + return obj; + }, fromPartial(_: Partial): MsgDelegateBondedTokensResponse { const message = createBaseMsgDelegateBondedTokensResponse(); return message; }, fromAmino(_: MsgDelegateBondedTokensResponseAmino): MsgDelegateBondedTokensResponse { - return {}; + const message = createBaseMsgDelegateBondedTokensResponse(); + return message; }, toAmino(_: MsgDelegateBondedTokensResponse): MsgDelegateBondedTokensResponseAmino { const obj: any = {}; @@ -1059,4 +1578,6 @@ export const MsgDelegateBondedTokensResponse = { value: MsgDelegateBondedTokensResponse.encode(message).finish() }; } -}; \ No newline at end of file +}; +GlobalDecoderRegistry.register(MsgDelegateBondedTokensResponse.typeUrl, MsgDelegateBondedTokensResponse); +GlobalDecoderRegistry.registerAminoProtoMapping(MsgDelegateBondedTokensResponse.aminoType, MsgDelegateBondedTokensResponse.typeUrl); \ No newline at end of file diff --git a/packages/osmojs/src/codegen/registry.ts b/packages/osmojs/src/codegen/registry.ts new file mode 100644 index 000000000..133e41cda --- /dev/null +++ b/packages/osmojs/src/codegen/registry.ts @@ -0,0 +1,219 @@ +//@ts-nocheck +/** +* This file and any referenced files were automatically generated by @cosmology/telescope@1.4.1 +* DO NOT MODIFY BY HAND. Instead, download the latest proto files for your chain +* and run the transpile command or yarn proto command to regenerate this bundle. +*/ + +import { BinaryReader } from "./binary"; +import { Any, AnyAmino } from "./google/protobuf/any"; +import { IProtoType, TelescopeGeneratedCodec } from "./types"; + +export class GlobalDecoderRegistry { + static registry: { + [key: string]: TelescopeGeneratedCodec; + } = {}; + + static aminoProtoMapping: { + [key: string]: string; + } = {}; + + static registerAminoProtoMapping(aminoType: string, typeUrl) { + GlobalDecoderRegistry.aminoProtoMapping[aminoType] = typeUrl; + } + + static register( + key: string, + decoder: TelescopeGeneratedCodec + ) { + GlobalDecoderRegistry.registry[key] = decoder; + } + static getDecoder( + key: string + ): TelescopeGeneratedCodec { + return GlobalDecoderRegistry.registry[key]; + } + static getDecoderByInstance( + obj: unknown + ): TelescopeGeneratedCodec | null { + if (obj === undefined || obj === null) { + return null; + } + const protoType = obj as IProtoType; + + if (protoType.$typeUrl) { + return GlobalDecoderRegistry.getDecoder( + protoType.$typeUrl + ); + } + + for (const key in GlobalDecoderRegistry.registry) { + if ( + Object.prototype.hasOwnProperty.call( + GlobalDecoderRegistry.registry, + key + ) + ) { + const element = GlobalDecoderRegistry.registry[key]; + + if (element.is!(obj)) { + return element; + } + + if (element.isSDK && element.isSDK(obj)) { + return element; + } + + if (element.isAmino && element.isAmino(obj)) { + return element; + } + } + } + + return null; + } + static getDecoderByAminoType( + type: string + ): TelescopeGeneratedCodec | null { + if (type === undefined || type === null) { + return null; + } + + const typeUrl = GlobalDecoderRegistry.aminoProtoMapping[type]; + + if (!typeUrl) { + return null; + } + + return GlobalDecoderRegistry.getDecoder(typeUrl); + } + static wrapAny(obj: unknown): Any { + if(Any.is(obj)){ + return obj; + } + + const decoder = getDecoderByInstance(obj); + + return { + typeUrl: decoder.typeUrl, + value: decoder.encode(obj).finish(), + }; + } + static unwrapAny(input: BinaryReader | Uint8Array | Any) { + let data; + + if (Any.is(input)) { + data = input; + } else { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + + data = Any.decode(reader, reader.uint32()); + } + + const decoder = GlobalDecoderRegistry.getDecoder( + data.typeUrl + ); + + if (!decoder) { + return data; + } + + return decoder.decode(data.value); + } + static fromJSON(object: any): T { + const decoder = getDecoderByInstance(object); + return decoder.fromJSON!(object); + } + static toJSON(message: T): any { + const decoder = getDecoderByInstance(message); + return decoder.toJSON!(message); + } + static fromPartial(object: unknown): T { + const decoder = getDecoderByInstance(object); + return decoder ? decoder.fromPartial(object) : (object as T); + } + static fromSDK(object: SDK): T { + const decoder = getDecoderByInstance(object); + return decoder.fromSDK!(object); + } + static fromSDKJSON(object: any): SDK { + const decoder = getDecoderByInstance(object); + return decoder.fromSDKJSON!(object); + } + static toSDK(object: T): SDK { + const decoder = getDecoderByInstance(object); + return decoder.toSDK!(object); + } + static fromAmino(object: Amino): T { + const decoder = getDecoderByInstance(object); + return decoder.fromAmino!(object); + } + static fromAminoMsg(object: AnyAmino): T { + const decoder = GlobalDecoderRegistry.getDecoderByAminoType< + T, + unknown, + Amino + >(object.type); + + if (!decoder) { + throw new Error(`There's no decoder for the amino type ${object.type}`); + } + + return decoder.fromAminoMsg!(object); + } + static toAmino(object: T): Amino { + let data: any; + let decoder; + if (Any.is(object)) { + data = GlobalDecoderRegistry.unwrapAny(object); + + decoder = GlobalDecoderRegistry.getDecoder(object.typeUrl); + + if (!decoder) { + decoder = Any; + } + } else { + data = object; + decoder = getDecoderByInstance(object); + } + + return decoder.toAmino!(data); + } + static toAminoMsg(object: T): AnyAmino { + let data: any; + let decoder; + if (Any.is(object)) { + data = GlobalDecoderRegistry.unwrapAny(object); + + decoder = GlobalDecoderRegistry.getDecoder(object.typeUrl); + + if (!decoder) { + decoder = Any; + } + } else { + data = object; + decoder = getDecoderByInstance(object); + } + + return decoder.toAminoMsg!(data); + } +} + +function getDecoderByInstance( + obj: unknown +): TelescopeGeneratedCodec { + const decoder = GlobalDecoderRegistry.getDecoderByInstance( + obj + ); + + if (!decoder) { + throw new Error( + `There's no decoder for the instance ${JSON.stringify(obj)}` + ); + } + + return decoder; +} + +GlobalDecoderRegistry.register(Any.typeUrl, Any); diff --git a/packages/osmojs/src/codegen/tendermint/abci/types.ts b/packages/osmojs/src/codegen/tendermint/abci/types.ts index 524e9336f..a91d773c5 100644 --- a/packages/osmojs/src/codegen/tendermint/abci/types.ts +++ b/packages/osmojs/src/codegen/tendermint/abci/types.ts @@ -1,10 +1,11 @@ import { Timestamp } from "../../google/protobuf/timestamp"; +import { ConsensusParams, ConsensusParamsAmino, ConsensusParamsSDKType } from "../types/params"; import { Header, HeaderAmino, HeaderSDKType } from "../types/types"; import { ProofOps, ProofOpsAmino, ProofOpsSDKType } from "../crypto/proof"; -import { EvidenceParams, EvidenceParamsAmino, EvidenceParamsSDKType, ValidatorParams, ValidatorParamsAmino, ValidatorParamsSDKType, VersionParams, VersionParamsAmino, VersionParamsSDKType } from "../types/params"; import { PublicKey, PublicKeyAmino, PublicKeySDKType } from "../crypto/keys"; import { BinaryReader, BinaryWriter } from "../../binary"; -import { toTimestamp, fromTimestamp, isSet } from "../../helpers"; +import { isSet, toTimestamp, fromTimestamp, bytesFromBase64, base64FromBytes } from "../../helpers"; +import { GlobalDecoderRegistry } from "../../registry"; export enum CheckTxType { NEW = 0, RECHECK = 1, @@ -161,40 +162,78 @@ export function responseApplySnapshotChunk_ResultToJSON(object: ResponseApplySna return "UNRECOGNIZED"; } } -export enum EvidenceType { +export enum ResponseProcessProposal_ProposalStatus { + UNKNOWN = 0, + ACCEPT = 1, + REJECT = 2, + UNRECOGNIZED = -1, +} +export const ResponseProcessProposal_ProposalStatusSDKType = ResponseProcessProposal_ProposalStatus; +export const ResponseProcessProposal_ProposalStatusAmino = ResponseProcessProposal_ProposalStatus; +export function responseProcessProposal_ProposalStatusFromJSON(object: any): ResponseProcessProposal_ProposalStatus { + switch (object) { + case 0: + case "UNKNOWN": + return ResponseProcessProposal_ProposalStatus.UNKNOWN; + case 1: + case "ACCEPT": + return ResponseProcessProposal_ProposalStatus.ACCEPT; + case 2: + case "REJECT": + return ResponseProcessProposal_ProposalStatus.REJECT; + case -1: + case "UNRECOGNIZED": + default: + return ResponseProcessProposal_ProposalStatus.UNRECOGNIZED; + } +} +export function responseProcessProposal_ProposalStatusToJSON(object: ResponseProcessProposal_ProposalStatus): string { + switch (object) { + case ResponseProcessProposal_ProposalStatus.UNKNOWN: + return "UNKNOWN"; + case ResponseProcessProposal_ProposalStatus.ACCEPT: + return "ACCEPT"; + case ResponseProcessProposal_ProposalStatus.REJECT: + return "REJECT"; + case ResponseProcessProposal_ProposalStatus.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} +export enum MisbehaviorType { UNKNOWN = 0, DUPLICATE_VOTE = 1, LIGHT_CLIENT_ATTACK = 2, UNRECOGNIZED = -1, } -export const EvidenceTypeSDKType = EvidenceType; -export const EvidenceTypeAmino = EvidenceType; -export function evidenceTypeFromJSON(object: any): EvidenceType { +export const MisbehaviorTypeSDKType = MisbehaviorType; +export const MisbehaviorTypeAmino = MisbehaviorType; +export function misbehaviorTypeFromJSON(object: any): MisbehaviorType { switch (object) { case 0: case "UNKNOWN": - return EvidenceType.UNKNOWN; + return MisbehaviorType.UNKNOWN; case 1: case "DUPLICATE_VOTE": - return EvidenceType.DUPLICATE_VOTE; + return MisbehaviorType.DUPLICATE_VOTE; case 2: case "LIGHT_CLIENT_ATTACK": - return EvidenceType.LIGHT_CLIENT_ATTACK; + return MisbehaviorType.LIGHT_CLIENT_ATTACK; case -1: case "UNRECOGNIZED": default: - return EvidenceType.UNRECOGNIZED; + return MisbehaviorType.UNRECOGNIZED; } } -export function evidenceTypeToJSON(object: EvidenceType): string { +export function misbehaviorTypeToJSON(object: MisbehaviorType): string { switch (object) { - case EvidenceType.UNKNOWN: + case MisbehaviorType.UNKNOWN: return "UNKNOWN"; - case EvidenceType.DUPLICATE_VOTE: + case MisbehaviorType.DUPLICATE_VOTE: return "DUPLICATE_VOTE"; - case EvidenceType.LIGHT_CLIENT_ATTACK: + case MisbehaviorType.LIGHT_CLIENT_ATTACK: return "LIGHT_CLIENT_ATTACK"; - case EvidenceType.UNRECOGNIZED: + case MisbehaviorType.UNRECOGNIZED: default: return "UNRECOGNIZED"; } @@ -203,7 +242,6 @@ export interface Request { echo?: RequestEcho; flush?: RequestFlush; info?: RequestInfo; - setOption?: RequestSetOption; initChain?: RequestInitChain; query?: RequestQuery; beginBlock?: RequestBeginBlock; @@ -215,6 +253,8 @@ export interface Request { offerSnapshot?: RequestOfferSnapshot; loadSnapshotChunk?: RequestLoadSnapshotChunk; applySnapshotChunk?: RequestApplySnapshotChunk; + prepareProposal?: RequestPrepareProposal; + processProposal?: RequestProcessProposal; } export interface RequestProtoMsg { typeUrl: "/tendermint.abci.Request"; @@ -224,7 +264,6 @@ export interface RequestAmino { echo?: RequestEchoAmino; flush?: RequestFlushAmino; info?: RequestInfoAmino; - set_option?: RequestSetOptionAmino; init_chain?: RequestInitChainAmino; query?: RequestQueryAmino; begin_block?: RequestBeginBlockAmino; @@ -236,6 +275,8 @@ export interface RequestAmino { offer_snapshot?: RequestOfferSnapshotAmino; load_snapshot_chunk?: RequestLoadSnapshotChunkAmino; apply_snapshot_chunk?: RequestApplySnapshotChunkAmino; + prepare_proposal?: RequestPrepareProposalAmino; + process_proposal?: RequestProcessProposalAmino; } export interface RequestAminoMsg { type: "/tendermint.abci.Request"; @@ -245,7 +286,6 @@ export interface RequestSDKType { echo?: RequestEchoSDKType; flush?: RequestFlushSDKType; info?: RequestInfoSDKType; - set_option?: RequestSetOptionSDKType; init_chain?: RequestInitChainSDKType; query?: RequestQuerySDKType; begin_block?: RequestBeginBlockSDKType; @@ -257,6 +297,8 @@ export interface RequestSDKType { offer_snapshot?: RequestOfferSnapshotSDKType; load_snapshot_chunk?: RequestLoadSnapshotChunkSDKType; apply_snapshot_chunk?: RequestApplySnapshotChunkSDKType; + prepare_proposal?: RequestPrepareProposalSDKType; + process_proposal?: RequestProcessProposalSDKType; } export interface RequestEcho { message: string; @@ -266,7 +308,7 @@ export interface RequestEchoProtoMsg { value: Uint8Array; } export interface RequestEchoAmino { - message: string; + message?: string; } export interface RequestEchoAminoMsg { type: "/tendermint.abci.RequestEcho"; @@ -290,15 +332,17 @@ export interface RequestInfo { version: string; blockVersion: bigint; p2pVersion: bigint; + abciVersion: string; } export interface RequestInfoProtoMsg { typeUrl: "/tendermint.abci.RequestInfo"; value: Uint8Array; } export interface RequestInfoAmino { - version: string; - block_version: string; - p2p_version: string; + version?: string; + block_version?: string; + p2p_version?: string; + abci_version?: string; } export interface RequestInfoAminoMsg { type: "/tendermint.abci.RequestInfo"; @@ -308,34 +352,12 @@ export interface RequestInfoSDKType { version: string; block_version: bigint; p2p_version: bigint; -} -/** nondeterministic */ -export interface RequestSetOption { - key: string; - value: string; -} -export interface RequestSetOptionProtoMsg { - typeUrl: "/tendermint.abci.RequestSetOption"; - value: Uint8Array; -} -/** nondeterministic */ -export interface RequestSetOptionAmino { - key: string; - value: string; -} -export interface RequestSetOptionAminoMsg { - type: "/tendermint.abci.RequestSetOption"; - value: RequestSetOptionAmino; -} -/** nondeterministic */ -export interface RequestSetOptionSDKType { - key: string; - value: string; + abci_version: string; } export interface RequestInitChain { time: Date; chainId: string; - consensusParams: ConsensusParams; + consensusParams?: ConsensusParams; validators: ValidatorUpdate[]; appStateBytes: Uint8Array; initialHeight: bigint; @@ -345,12 +367,12 @@ export interface RequestInitChainProtoMsg { value: Uint8Array; } export interface RequestInitChainAmino { - time?: Date; - chain_id: string; + time?: string; + chain_id?: string; consensus_params?: ConsensusParamsAmino; - validators: ValidatorUpdateAmino[]; - app_state_bytes: Uint8Array; - initial_height: string; + validators?: ValidatorUpdateAmino[]; + app_state_bytes?: string; + initial_height?: string; } export interface RequestInitChainAminoMsg { type: "/tendermint.abci.RequestInitChain"; @@ -359,7 +381,7 @@ export interface RequestInitChainAminoMsg { export interface RequestInitChainSDKType { time: Date; chain_id: string; - consensus_params: ConsensusParamsSDKType; + consensus_params?: ConsensusParamsSDKType; validators: ValidatorUpdateSDKType[]; app_state_bytes: Uint8Array; initial_height: bigint; @@ -375,10 +397,10 @@ export interface RequestQueryProtoMsg { value: Uint8Array; } export interface RequestQueryAmino { - data: Uint8Array; - path: string; - height: string; - prove: boolean; + data?: string; + path?: string; + height?: string; + prove?: boolean; } export interface RequestQueryAminoMsg { type: "/tendermint.abci.RequestQuery"; @@ -393,18 +415,18 @@ export interface RequestQuerySDKType { export interface RequestBeginBlock { hash: Uint8Array; header: Header; - lastCommitInfo: LastCommitInfo; - byzantineValidators: Evidence[]; + lastCommitInfo: CommitInfo; + byzantineValidators: Misbehavior[]; } export interface RequestBeginBlockProtoMsg { typeUrl: "/tendermint.abci.RequestBeginBlock"; value: Uint8Array; } export interface RequestBeginBlockAmino { - hash: Uint8Array; + hash?: string; header?: HeaderAmino; - last_commit_info?: LastCommitInfoAmino; - byzantine_validators: EvidenceAmino[]; + last_commit_info?: CommitInfoAmino; + byzantine_validators?: MisbehaviorAmino[]; } export interface RequestBeginBlockAminoMsg { type: "/tendermint.abci.RequestBeginBlock"; @@ -413,8 +435,8 @@ export interface RequestBeginBlockAminoMsg { export interface RequestBeginBlockSDKType { hash: Uint8Array; header: HeaderSDKType; - last_commit_info: LastCommitInfoSDKType; - byzantine_validators: EvidenceSDKType[]; + last_commit_info: CommitInfoSDKType; + byzantine_validators: MisbehaviorSDKType[]; } export interface RequestCheckTx { tx: Uint8Array; @@ -425,8 +447,8 @@ export interface RequestCheckTxProtoMsg { value: Uint8Array; } export interface RequestCheckTxAmino { - tx: Uint8Array; - type: CheckTxType; + tx?: string; + type?: CheckTxType; } export interface RequestCheckTxAminoMsg { type: "/tendermint.abci.RequestCheckTx"; @@ -444,7 +466,7 @@ export interface RequestDeliverTxProtoMsg { value: Uint8Array; } export interface RequestDeliverTxAmino { - tx: Uint8Array; + tx?: string; } export interface RequestDeliverTxAminoMsg { type: "/tendermint.abci.RequestDeliverTx"; @@ -461,7 +483,7 @@ export interface RequestEndBlockProtoMsg { value: Uint8Array; } export interface RequestEndBlockAmino { - height: string; + height?: string; } export interface RequestEndBlockAminoMsg { type: "/tendermint.abci.RequestEndBlock"; @@ -498,7 +520,7 @@ export interface RequestListSnapshotsSDKType {} /** 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; } @@ -511,7 +533,7 @@ export interface RequestOfferSnapshotAmino { /** snapshot offered by peers */ snapshot?: SnapshotAmino; /** light client-verified app hash for snapshot height */ - app_hash: Uint8Array; + app_hash?: string; } export interface RequestOfferSnapshotAminoMsg { type: "/tendermint.abci.RequestOfferSnapshot"; @@ -519,7 +541,7 @@ export interface RequestOfferSnapshotAminoMsg { } /** offers a snapshot to the application */ export interface RequestOfferSnapshotSDKType { - snapshot: SnapshotSDKType; + snapshot?: SnapshotSDKType; app_hash: Uint8Array; } /** loads a snapshot chunk */ @@ -534,9 +556,9 @@ export interface RequestLoadSnapshotChunkProtoMsg { } /** loads a snapshot chunk */ export interface RequestLoadSnapshotChunkAmino { - height: string; - format: number; - chunk: number; + height?: string; + format?: number; + chunk?: number; } export interface RequestLoadSnapshotChunkAminoMsg { type: "/tendermint.abci.RequestLoadSnapshotChunk"; @@ -560,9 +582,9 @@ export interface RequestApplySnapshotChunkProtoMsg { } /** Applies a snapshot chunk */ export interface RequestApplySnapshotChunkAmino { - index: number; - chunk: Uint8Array; - sender: string; + index?: number; + chunk?: string; + sender?: string; } export interface RequestApplySnapshotChunkAminoMsg { type: "/tendermint.abci.RequestApplySnapshotChunk"; @@ -574,12 +596,103 @@ export interface RequestApplySnapshotChunkSDKType { chunk: Uint8Array; sender: string; } +export interface RequestPrepareProposal { + /** the modified transactions cannot exceed this size. */ + maxTxBytes: bigint; + /** + * txs is an array of transactions that will be included in a block, + * sent to the app for possible modifications. + */ + txs: Uint8Array[]; + localLastCommit: ExtendedCommitInfo; + misbehavior: Misbehavior[]; + height: bigint; + time: Date; + nextValidatorsHash: Uint8Array; + /** address of the public key of the validator proposing the block. */ + proposerAddress: Uint8Array; +} +export interface RequestPrepareProposalProtoMsg { + typeUrl: "/tendermint.abci.RequestPrepareProposal"; + value: Uint8Array; +} +export interface RequestPrepareProposalAmino { + /** the modified transactions cannot exceed this size. */ + max_tx_bytes?: string; + /** + * txs is an array of transactions that will be included in a block, + * sent to the app for possible modifications. + */ + txs?: string[]; + local_last_commit?: ExtendedCommitInfoAmino; + misbehavior?: MisbehaviorAmino[]; + height?: string; + time?: string; + next_validators_hash?: string; + /** address of the public key of the validator proposing the block. */ + proposer_address?: string; +} +export interface RequestPrepareProposalAminoMsg { + type: "/tendermint.abci.RequestPrepareProposal"; + value: RequestPrepareProposalAmino; +} +export interface RequestPrepareProposalSDKType { + max_tx_bytes: bigint; + txs: Uint8Array[]; + local_last_commit: ExtendedCommitInfoSDKType; + misbehavior: MisbehaviorSDKType[]; + height: bigint; + time: Date; + next_validators_hash: Uint8Array; + proposer_address: Uint8Array; +} +export interface RequestProcessProposal { + txs: Uint8Array[]; + proposedLastCommit: CommitInfo; + misbehavior: Misbehavior[]; + /** hash is the merkle root hash of the fields of the proposed block. */ + hash: Uint8Array; + height: bigint; + time: Date; + nextValidatorsHash: Uint8Array; + /** address of the public key of the original proposer of the block. */ + proposerAddress: Uint8Array; +} +export interface RequestProcessProposalProtoMsg { + typeUrl: "/tendermint.abci.RequestProcessProposal"; + value: Uint8Array; +} +export interface RequestProcessProposalAmino { + txs?: string[]; + proposed_last_commit?: CommitInfoAmino; + misbehavior?: MisbehaviorAmino[]; + /** hash is the merkle root hash of the fields of the proposed block. */ + hash?: string; + height?: string; + time?: string; + next_validators_hash?: string; + /** address of the public key of the original proposer of the block. */ + proposer_address?: string; +} +export interface RequestProcessProposalAminoMsg { + type: "/tendermint.abci.RequestProcessProposal"; + value: RequestProcessProposalAmino; +} +export interface RequestProcessProposalSDKType { + txs: Uint8Array[]; + proposed_last_commit: CommitInfoSDKType; + misbehavior: MisbehaviorSDKType[]; + hash: Uint8Array; + height: bigint; + time: Date; + next_validators_hash: Uint8Array; + proposer_address: Uint8Array; +} export interface Response { exception?: ResponseException; echo?: ResponseEcho; flush?: ResponseFlush; info?: ResponseInfo; - setOption?: ResponseSetOption; initChain?: ResponseInitChain; query?: ResponseQuery; beginBlock?: ResponseBeginBlock; @@ -591,6 +704,8 @@ export interface Response { offerSnapshot?: ResponseOfferSnapshot; loadSnapshotChunk?: ResponseLoadSnapshotChunk; applySnapshotChunk?: ResponseApplySnapshotChunk; + prepareProposal?: ResponsePrepareProposal; + processProposal?: ResponseProcessProposal; } export interface ResponseProtoMsg { typeUrl: "/tendermint.abci.Response"; @@ -601,7 +716,6 @@ export interface ResponseAmino { echo?: ResponseEchoAmino; flush?: ResponseFlushAmino; info?: ResponseInfoAmino; - set_option?: ResponseSetOptionAmino; init_chain?: ResponseInitChainAmino; query?: ResponseQueryAmino; begin_block?: ResponseBeginBlockAmino; @@ -613,6 +727,8 @@ export interface ResponseAmino { offer_snapshot?: ResponseOfferSnapshotAmino; load_snapshot_chunk?: ResponseLoadSnapshotChunkAmino; apply_snapshot_chunk?: ResponseApplySnapshotChunkAmino; + prepare_proposal?: ResponsePrepareProposalAmino; + process_proposal?: ResponseProcessProposalAmino; } export interface ResponseAminoMsg { type: "/tendermint.abci.Response"; @@ -623,7 +739,6 @@ export interface ResponseSDKType { echo?: ResponseEchoSDKType; flush?: ResponseFlushSDKType; info?: ResponseInfoSDKType; - set_option?: ResponseSetOptionSDKType; init_chain?: ResponseInitChainSDKType; query?: ResponseQuerySDKType; begin_block?: ResponseBeginBlockSDKType; @@ -635,6 +750,8 @@ export interface ResponseSDKType { offer_snapshot?: ResponseOfferSnapshotSDKType; load_snapshot_chunk?: ResponseLoadSnapshotChunkSDKType; apply_snapshot_chunk?: ResponseApplySnapshotChunkSDKType; + prepare_proposal?: ResponsePrepareProposalSDKType; + process_proposal?: ResponseProcessProposalSDKType; } /** nondeterministic */ export interface ResponseException { @@ -646,7 +763,7 @@ export interface ResponseExceptionProtoMsg { } /** nondeterministic */ export interface ResponseExceptionAmino { - error: string; + error?: string; } export interface ResponseExceptionAminoMsg { type: "/tendermint.abci.ResponseException"; @@ -664,7 +781,7 @@ export interface ResponseEchoProtoMsg { value: Uint8Array; } export interface ResponseEchoAmino { - message: string; + message?: string; } export interface ResponseEchoAminoMsg { type: "/tendermint.abci.ResponseEcho"; @@ -696,11 +813,11 @@ export interface ResponseInfoProtoMsg { value: Uint8Array; } export interface ResponseInfoAmino { - data: string; - version: string; - app_version: string; - last_block_height: string; - last_block_app_hash: Uint8Array; + data?: string; + version?: string; + app_version?: string; + last_block_height?: string; + last_block_app_hash?: string; } export interface ResponseInfoAminoMsg { type: "/tendermint.abci.ResponseInfo"; @@ -713,36 +830,8 @@ export interface ResponseInfoSDKType { last_block_height: bigint; last_block_app_hash: Uint8Array; } -/** nondeterministic */ -export interface ResponseSetOption { - code: number; - /** bytes data = 2; */ - log: string; - info: string; -} -export interface ResponseSetOptionProtoMsg { - typeUrl: "/tendermint.abci.ResponseSetOption"; - value: Uint8Array; -} -/** nondeterministic */ -export interface ResponseSetOptionAmino { - code: number; - /** bytes data = 2; */ - log: string; - info: string; -} -export interface ResponseSetOptionAminoMsg { - type: "/tendermint.abci.ResponseSetOption"; - value: ResponseSetOptionAmino; -} -/** nondeterministic */ -export interface ResponseSetOptionSDKType { - code: number; - log: string; - info: string; -} export interface ResponseInitChain { - consensusParams: ConsensusParams; + consensusParams?: ConsensusParams; validators: ValidatorUpdate[]; appHash: Uint8Array; } @@ -752,15 +841,15 @@ export interface ResponseInitChainProtoMsg { } export interface ResponseInitChainAmino { consensus_params?: ConsensusParamsAmino; - validators: ValidatorUpdateAmino[]; - app_hash: Uint8Array; + validators?: ValidatorUpdateAmino[]; + app_hash?: string; } export interface ResponseInitChainAminoMsg { type: "/tendermint.abci.ResponseInitChain"; value: ResponseInitChainAmino; } export interface ResponseInitChainSDKType { - consensus_params: ConsensusParamsSDKType; + consensus_params?: ConsensusParamsSDKType; validators: ValidatorUpdateSDKType[]; app_hash: Uint8Array; } @@ -773,7 +862,7 @@ export interface ResponseQuery { index: bigint; key: Uint8Array; value: Uint8Array; - proofOps: ProofOps; + proofOps?: ProofOps; height: bigint; codespace: string; } @@ -782,17 +871,17 @@ export interface ResponseQueryProtoMsg { value: Uint8Array; } export interface ResponseQueryAmino { - code: number; + code?: number; /** bytes data = 2; // use "value" instead. */ - log: string; + log?: string; /** nondeterministic */ - info: string; - index: string; - key: Uint8Array; - value: Uint8Array; + info?: string; + index?: string; + key?: string; + value?: string; proof_ops?: ProofOpsAmino; - height: string; - codespace: string; + height?: string; + codespace?: string; } export interface ResponseQueryAminoMsg { type: "/tendermint.abci.ResponseQuery"; @@ -805,7 +894,7 @@ export interface ResponseQuerySDKType { index: bigint; key: Uint8Array; value: Uint8Array; - proof_ops: ProofOpsSDKType; + proof_ops?: ProofOpsSDKType; height: bigint; codespace: string; } @@ -817,7 +906,7 @@ export interface ResponseBeginBlockProtoMsg { value: Uint8Array; } export interface ResponseBeginBlockAmino { - events: EventAmino[]; + events?: EventAmino[]; } export interface ResponseBeginBlockAminoMsg { type: "/tendermint.abci.ResponseBeginBlock"; @@ -837,22 +926,36 @@ export interface ResponseCheckTx { gasUsed: bigint; events: Event[]; codespace: string; + sender: string; + priority: bigint; + /** + * mempool_error is set by CometBFT. + * ABCI applictions creating a ResponseCheckTX should not set mempool_error. + */ + mempoolError: string; } export interface ResponseCheckTxProtoMsg { typeUrl: "/tendermint.abci.ResponseCheckTx"; value: Uint8Array; } export interface ResponseCheckTxAmino { - code: number; - data: Uint8Array; + code?: number; + data?: string; /** nondeterministic */ - log: string; + log?: string; /** nondeterministic */ - info: string; - gas_wanted: string; - gas_used: string; - events: EventAmino[]; - codespace: string; + info?: string; + gas_wanted?: string; + gas_used?: string; + events?: EventAmino[]; + codespace?: string; + sender?: string; + priority?: string; + /** + * mempool_error is set by CometBFT. + * ABCI applictions creating a ResponseCheckTX should not set mempool_error. + */ + mempool_error?: string; } export interface ResponseCheckTxAminoMsg { type: "/tendermint.abci.ResponseCheckTx"; @@ -867,6 +970,9 @@ export interface ResponseCheckTxSDKType { gas_used: bigint; events: EventSDKType[]; codespace: string; + sender: string; + priority: bigint; + mempool_error: string; } export interface ResponseDeliverTx { code: number; @@ -885,16 +991,16 @@ export interface ResponseDeliverTxProtoMsg { value: Uint8Array; } export interface ResponseDeliverTxAmino { - code: number; - data: Uint8Array; + code?: number; + data?: string; /** nondeterministic */ - log: string; + log?: string; /** nondeterministic */ - info: string; - gas_wanted: string; - gas_used: string; - events: EventAmino[]; - codespace: string; + info?: string; + gas_wanted?: string; + gas_used?: string; + events?: EventAmino[]; + codespace?: string; } export interface ResponseDeliverTxAminoMsg { type: "/tendermint.abci.ResponseDeliverTx"; @@ -912,7 +1018,7 @@ export interface ResponseDeliverTxSDKType { } export interface ResponseEndBlock { validatorUpdates: ValidatorUpdate[]; - consensusParamUpdates: ConsensusParams; + consensusParamUpdates?: ConsensusParams; events: Event[]; } export interface ResponseEndBlockProtoMsg { @@ -920,9 +1026,9 @@ export interface ResponseEndBlockProtoMsg { value: Uint8Array; } export interface ResponseEndBlockAmino { - validator_updates: ValidatorUpdateAmino[]; + validator_updates?: ValidatorUpdateAmino[]; consensus_param_updates?: ConsensusParamsAmino; - events: EventAmino[]; + events?: EventAmino[]; } export interface ResponseEndBlockAminoMsg { type: "/tendermint.abci.ResponseEndBlock"; @@ -930,7 +1036,7 @@ export interface ResponseEndBlockAminoMsg { } export interface ResponseEndBlockSDKType { validator_updates: ValidatorUpdateSDKType[]; - consensus_param_updates: ConsensusParamsSDKType; + consensus_param_updates?: ConsensusParamsSDKType; events: EventSDKType[]; } export interface ResponseCommit { @@ -944,8 +1050,8 @@ export interface ResponseCommitProtoMsg { } export interface ResponseCommitAmino { /** reserve 1 */ - data: Uint8Array; - retain_height: string; + data?: string; + retain_height?: string; } export interface ResponseCommitAminoMsg { type: "/tendermint.abci.ResponseCommit"; @@ -963,7 +1069,7 @@ export interface ResponseListSnapshotsProtoMsg { value: Uint8Array; } export interface ResponseListSnapshotsAmino { - snapshots: SnapshotAmino[]; + snapshots?: SnapshotAmino[]; } export interface ResponseListSnapshotsAminoMsg { type: "/tendermint.abci.ResponseListSnapshots"; @@ -980,7 +1086,7 @@ export interface ResponseOfferSnapshotProtoMsg { value: Uint8Array; } export interface ResponseOfferSnapshotAmino { - result: ResponseOfferSnapshot_Result; + result?: ResponseOfferSnapshot_Result; } export interface ResponseOfferSnapshotAminoMsg { type: "/tendermint.abci.ResponseOfferSnapshot"; @@ -997,7 +1103,7 @@ export interface ResponseLoadSnapshotChunkProtoMsg { value: Uint8Array; } export interface ResponseLoadSnapshotChunkAmino { - chunk: Uint8Array; + chunk?: string; } export interface ResponseLoadSnapshotChunkAminoMsg { type: "/tendermint.abci.ResponseLoadSnapshotChunk"; @@ -1018,11 +1124,11 @@ export interface ResponseApplySnapshotChunkProtoMsg { value: Uint8Array; } export interface ResponseApplySnapshotChunkAmino { - result: ResponseApplySnapshotChunk_Result; + result?: ResponseApplySnapshotChunk_Result; /** Chunks to refetch and reapply */ - refetch_chunks: number[]; + refetch_chunks?: number[]; /** Chunk senders to reject and ban */ - reject_senders: string[]; + reject_senders?: string[]; } export interface ResponseApplySnapshotChunkAminoMsg { type: "/tendermint.abci.ResponseApplySnapshotChunk"; @@ -1033,91 +1139,90 @@ export interface ResponseApplySnapshotChunkSDKType { refetch_chunks: number[]; reject_senders: string[]; } -/** - * ConsensusParams contains all consensus-relevant parameters - * that can be adjusted by the abci app - */ -export interface ConsensusParams { - block: BlockParams; - evidence: EvidenceParams; - validator: ValidatorParams; - version: VersionParams; -} -export interface ConsensusParamsProtoMsg { - typeUrl: "/tendermint.abci.ConsensusParams"; +export interface ResponsePrepareProposal { + txs: Uint8Array[]; +} +export interface ResponsePrepareProposalProtoMsg { + typeUrl: "/tendermint.abci.ResponsePrepareProposal"; value: Uint8Array; } -/** - * ConsensusParams contains all consensus-relevant parameters - * that can be adjusted by the abci app - */ -export interface ConsensusParamsAmino { - block?: BlockParamsAmino; - evidence?: EvidenceParamsAmino; - validator?: ValidatorParamsAmino; - version?: VersionParamsAmino; +export interface ResponsePrepareProposalAmino { + txs?: string[]; } -export interface ConsensusParamsAminoMsg { - type: "/tendermint.abci.ConsensusParams"; - value: ConsensusParamsAmino; +export interface ResponsePrepareProposalAminoMsg { + type: "/tendermint.abci.ResponsePrepareProposal"; + value: ResponsePrepareProposalAmino; } -/** - * ConsensusParams contains all consensus-relevant parameters - * that can be adjusted by the abci app - */ -export interface ConsensusParamsSDKType { - block: BlockParamsSDKType; - evidence: EvidenceParamsSDKType; - validator: ValidatorParamsSDKType; - version: VersionParamsSDKType; -} -/** BlockParams contains limits on the block size. */ -export interface BlockParams { - /** Note: must be greater than 0 */ - maxBytes: bigint; - /** Note: must be greater or equal to -1 */ - maxGas: bigint; -} -export interface BlockParamsProtoMsg { - typeUrl: "/tendermint.abci.BlockParams"; +export interface ResponsePrepareProposalSDKType { + txs: Uint8Array[]; +} +export interface ResponseProcessProposal { + status: ResponseProcessProposal_ProposalStatus; +} +export interface ResponseProcessProposalProtoMsg { + typeUrl: "/tendermint.abci.ResponseProcessProposal"; value: Uint8Array; } -/** BlockParams contains limits on the block size. */ -export interface BlockParamsAmino { - /** Note: must be greater than 0 */ - max_bytes: string; - /** Note: must be greater or equal to -1 */ - max_gas: string; +export interface ResponseProcessProposalAmino { + status?: ResponseProcessProposal_ProposalStatus; } -export interface BlockParamsAminoMsg { - type: "/tendermint.abci.BlockParams"; - value: BlockParamsAmino; +export interface ResponseProcessProposalAminoMsg { + type: "/tendermint.abci.ResponseProcessProposal"; + value: ResponseProcessProposalAmino; } -/** BlockParams contains limits on the block size. */ -export interface BlockParamsSDKType { - max_bytes: bigint; - max_gas: bigint; +export interface ResponseProcessProposalSDKType { + status: ResponseProcessProposal_ProposalStatus; } -export interface LastCommitInfo { +export interface CommitInfo { round: number; votes: VoteInfo[]; } -export interface LastCommitInfoProtoMsg { - typeUrl: "/tendermint.abci.LastCommitInfo"; +export interface CommitInfoProtoMsg { + typeUrl: "/tendermint.abci.CommitInfo"; value: Uint8Array; } -export interface LastCommitInfoAmino { - round: number; - votes: VoteInfoAmino[]; +export interface CommitInfoAmino { + round?: number; + votes?: VoteInfoAmino[]; } -export interface LastCommitInfoAminoMsg { - type: "/tendermint.abci.LastCommitInfo"; - value: LastCommitInfoAmino; +export interface CommitInfoAminoMsg { + type: "/tendermint.abci.CommitInfo"; + value: CommitInfoAmino; } -export interface LastCommitInfoSDKType { +export interface CommitInfoSDKType { round: number; votes: VoteInfoSDKType[]; } +export interface ExtendedCommitInfo { + /** The round at which the block proposer decided in the previous height. */ + round: number; + /** + * List of validators' addresses in the last validator set with their voting + * information, including vote extensions. + */ + votes: ExtendedVoteInfo[]; +} +export interface ExtendedCommitInfoProtoMsg { + typeUrl: "/tendermint.abci.ExtendedCommitInfo"; + value: Uint8Array; +} +export interface ExtendedCommitInfoAmino { + /** The round at which the block proposer decided in the previous height. */ + round?: number; + /** + * List of validators' addresses in the last validator set with their voting + * information, including vote extensions. + */ + votes?: ExtendedVoteInfoAmino[]; +} +export interface ExtendedCommitInfoAminoMsg { + type: "/tendermint.abci.ExtendedCommitInfo"; + value: ExtendedCommitInfoAmino; +} +export interface ExtendedCommitInfoSDKType { + round: number; + votes: ExtendedVoteInfoSDKType[]; +} /** * Event allows application developers to attach additional information to * ResponseBeginBlock, ResponseEndBlock, ResponseCheckTx and ResponseDeliverTx. @@ -1137,8 +1242,8 @@ export interface EventProtoMsg { * Later, transactions may be queried using these events. */ export interface EventAmino { - type: string; - attributes: EventAttributeAmino[]; + type?: string; + attributes?: EventAttributeAmino[]; } export interface EventAminoMsg { type: "/tendermint.abci.Event"; @@ -1155,8 +1260,8 @@ export interface EventSDKType { } /** EventAttribute is a single key-value pair, associated with an event. */ export interface EventAttribute { - key: Uint8Array; - value: Uint8Array; + key: string; + value: string; /** nondeterministic */ index: boolean; } @@ -1166,10 +1271,10 @@ export interface EventAttributeProtoMsg { } /** EventAttribute is a single key-value pair, associated with an event. */ export interface EventAttributeAmino { - key: Uint8Array; - value: Uint8Array; + key?: string; + value?: string; /** nondeterministic */ - index: boolean; + index?: boolean; } export interface EventAttributeAminoMsg { type: "/tendermint.abci.EventAttribute"; @@ -1177,8 +1282,8 @@ export interface EventAttributeAminoMsg { } /** EventAttribute is a single key-value pair, associated with an event. */ export interface EventAttributeSDKType { - key: Uint8Array; - value: Uint8Array; + key: string; + value: string; index: boolean; } /** @@ -1202,9 +1307,9 @@ export interface TxResultProtoMsg { * One usage is indexing transaction results. */ export interface TxResultAmino { - height: string; - index: number; - tx: Uint8Array; + height?: string; + index?: number; + tx?: string; result?: ResponseDeliverTxAmino; } export interface TxResultAminoMsg { @@ -1242,9 +1347,9 @@ export interface ValidatorAmino { * The first 20 bytes of SHA256(public key) * PubKey pub_key = 2 [(gogoproto.nullable)=false]; */ - address: Uint8Array; + address?: string; /** The voting power */ - power: string; + power?: string; } export interface ValidatorAminoMsg { type: "/tendermint.abci.Validator"; @@ -1267,7 +1372,7 @@ export interface ValidatorUpdateProtoMsg { /** ValidatorUpdate */ export interface ValidatorUpdateAmino { pub_key?: PublicKeyAmino; - power: string; + power?: string; } export interface ValidatorUpdateAminoMsg { type: "/tendermint.abci.ValidatorUpdate"; @@ -1290,7 +1395,7 @@ export interface VoteInfoProtoMsg { /** VoteInfo */ export interface VoteInfoAmino { validator?: ValidatorAmino; - signed_last_block: boolean; + signed_last_block?: boolean; } export interface VoteInfoAminoMsg { type: "/tendermint.abci.VoteInfo"; @@ -1301,8 +1406,33 @@ export interface VoteInfoSDKType { validator: ValidatorSDKType; signed_last_block: boolean; } -export interface Evidence { - type: EvidenceType; +export interface ExtendedVoteInfo { + validator: Validator; + signedLastBlock: boolean; + /** Reserved for future use */ + voteExtension: Uint8Array; +} +export interface ExtendedVoteInfoProtoMsg { + typeUrl: "/tendermint.abci.ExtendedVoteInfo"; + value: Uint8Array; +} +export interface ExtendedVoteInfoAmino { + validator?: ValidatorAmino; + signed_last_block?: boolean; + /** Reserved for future use */ + vote_extension?: string; +} +export interface ExtendedVoteInfoAminoMsg { + type: "/tendermint.abci.ExtendedVoteInfo"; + value: ExtendedVoteInfoAmino; +} +export interface ExtendedVoteInfoSDKType { + validator: ValidatorSDKType; + signed_last_block: boolean; + vote_extension: Uint8Array; +} +export interface Misbehavior { + type: MisbehaviorType; /** The offending validator */ validator: Validator; /** The height when the offense occurred */ @@ -1316,31 +1446,31 @@ export interface Evidence { */ totalVotingPower: bigint; } -export interface EvidenceProtoMsg { - typeUrl: "/tendermint.abci.Evidence"; +export interface MisbehaviorProtoMsg { + typeUrl: "/tendermint.abci.Misbehavior"; value: Uint8Array; } -export interface EvidenceAmino { - type: EvidenceType; +export interface MisbehaviorAmino { + type?: MisbehaviorType; /** The offending validator */ validator?: ValidatorAmino; /** The height when the offense occurred */ - height: string; + height?: string; /** The corresponding time where the offense occurred */ - time?: Date; + time?: string; /** * Total voting power of the validator set in case the ABCI application does * not store historical validators. * https://github.com/tendermint/tendermint/issues/4581 */ - total_voting_power: string; + total_voting_power?: string; } -export interface EvidenceAminoMsg { - type: "/tendermint.abci.Evidence"; - value: EvidenceAmino; +export interface MisbehaviorAminoMsg { + type: "/tendermint.abci.Misbehavior"; + value: MisbehaviorAmino; } -export interface EvidenceSDKType { - type: EvidenceType; +export interface MisbehaviorSDKType { + type: MisbehaviorType; validator: ValidatorSDKType; height: bigint; time: Date; @@ -1364,15 +1494,15 @@ export interface SnapshotProtoMsg { } export interface SnapshotAmino { /** The height at which the snapshot was taken */ - height: string; + height?: string; /** 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?: string; /** Arbitrary application metadata */ - metadata: Uint8Array; + metadata?: string; } export interface SnapshotAminoMsg { type: "/tendermint.abci.Snapshot"; @@ -1390,7 +1520,6 @@ function createBaseRequest(): Request { echo: undefined, flush: undefined, info: undefined, - setOption: undefined, initChain: undefined, query: undefined, beginBlock: undefined, @@ -1401,11 +1530,22 @@ function createBaseRequest(): Request { listSnapshots: undefined, offerSnapshot: undefined, loadSnapshotChunk: undefined, - applySnapshotChunk: undefined + applySnapshotChunk: undefined, + prepareProposal: undefined, + processProposal: undefined }; } export const Request = { typeUrl: "/tendermint.abci.Request", + is(o: any): o is Request { + return o && o.$typeUrl === Request.typeUrl; + }, + isSDK(o: any): o is RequestSDKType { + return o && o.$typeUrl === Request.typeUrl; + }, + isAmino(o: any): o is RequestAmino { + return o && o.$typeUrl === Request.typeUrl; + }, encode(message: Request, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.echo !== undefined) { RequestEcho.encode(message.echo, writer.uint32(10).fork()).ldelim(); @@ -1416,9 +1556,6 @@ export const Request = { if (message.info !== undefined) { RequestInfo.encode(message.info, writer.uint32(26).fork()).ldelim(); } - if (message.setOption !== undefined) { - RequestSetOption.encode(message.setOption, writer.uint32(34).fork()).ldelim(); - } if (message.initChain !== undefined) { RequestInitChain.encode(message.initChain, writer.uint32(42).fork()).ldelim(); } @@ -1452,6 +1589,12 @@ export const Request = { if (message.applySnapshotChunk !== undefined) { RequestApplySnapshotChunk.encode(message.applySnapshotChunk, writer.uint32(122).fork()).ldelim(); } + if (message.prepareProposal !== undefined) { + RequestPrepareProposal.encode(message.prepareProposal, writer.uint32(130).fork()).ldelim(); + } + if (message.processProposal !== undefined) { + RequestProcessProposal.encode(message.processProposal, writer.uint32(138).fork()).ldelim(); + } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): Request { @@ -1470,9 +1613,6 @@ export const Request = { case 3: message.info = RequestInfo.decode(reader, reader.uint32()); break; - case 4: - message.setOption = RequestSetOption.decode(reader, reader.uint32()); - break; case 5: message.initChain = RequestInitChain.decode(reader, reader.uint32()); break; @@ -1506,6 +1646,12 @@ export const Request = { case 15: message.applySnapshotChunk = RequestApplySnapshotChunk.decode(reader, reader.uint32()); break; + case 16: + message.prepareProposal = RequestPrepareProposal.decode(reader, reader.uint32()); + break; + case 17: + message.processProposal = RequestProcessProposal.decode(reader, reader.uint32()); + break; default: reader.skipType(tag & 7); break; @@ -1513,12 +1659,51 @@ export const Request = { } return message; }, + fromJSON(object: any): Request { + return { + 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, + 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, + 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, + loadSnapshotChunk: isSet(object.loadSnapshotChunk) ? RequestLoadSnapshotChunk.fromJSON(object.loadSnapshotChunk) : undefined, + applySnapshotChunk: isSet(object.applySnapshotChunk) ? RequestApplySnapshotChunk.fromJSON(object.applySnapshotChunk) : undefined, + prepareProposal: isSet(object.prepareProposal) ? RequestPrepareProposal.fromJSON(object.prepareProposal) : undefined, + processProposal: isSet(object.processProposal) ? RequestProcessProposal.fromJSON(object.processProposal) : 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); + message.initChain !== 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); + message.checkTx !== undefined && (obj.checkTx = message.checkTx ? RequestCheckTx.toJSON(message.checkTx) : undefined); + 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); + 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); + message.prepareProposal !== undefined && (obj.prepareProposal = message.prepareProposal ? RequestPrepareProposal.toJSON(message.prepareProposal) : undefined); + message.processProposal !== undefined && (obj.processProposal = message.processProposal ? RequestProcessProposal.toJSON(message.processProposal) : undefined); + return obj; + }, fromPartial(object: Partial): 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; @@ -1530,33 +1715,67 @@ export const Request = { 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; + message.prepareProposal = object.prepareProposal !== undefined && object.prepareProposal !== null ? RequestPrepareProposal.fromPartial(object.prepareProposal) : undefined; + message.processProposal = object.processProposal !== undefined && object.processProposal !== null ? RequestProcessProposal.fromPartial(object.processProposal) : undefined; return message; }, fromAmino(object: RequestAmino): Request { - return { - echo: object?.echo ? RequestEcho.fromAmino(object.echo) : undefined, - flush: object?.flush ? RequestFlush.fromAmino(object.flush) : undefined, - info: object?.info ? RequestInfo.fromAmino(object.info) : undefined, - setOption: object?.set_option ? RequestSetOption.fromAmino(object.set_option) : undefined, - initChain: object?.init_chain ? RequestInitChain.fromAmino(object.init_chain) : undefined, - query: object?.query ? RequestQuery.fromAmino(object.query) : undefined, - beginBlock: object?.begin_block ? RequestBeginBlock.fromAmino(object.begin_block) : undefined, - checkTx: object?.check_tx ? RequestCheckTx.fromAmino(object.check_tx) : undefined, - deliverTx: object?.deliver_tx ? RequestDeliverTx.fromAmino(object.deliver_tx) : undefined, - endBlock: object?.end_block ? RequestEndBlock.fromAmino(object.end_block) : undefined, - commit: object?.commit ? RequestCommit.fromAmino(object.commit) : undefined, - listSnapshots: object?.list_snapshots ? RequestListSnapshots.fromAmino(object.list_snapshots) : undefined, - offerSnapshot: object?.offer_snapshot ? RequestOfferSnapshot.fromAmino(object.offer_snapshot) : undefined, - loadSnapshotChunk: object?.load_snapshot_chunk ? RequestLoadSnapshotChunk.fromAmino(object.load_snapshot_chunk) : undefined, - applySnapshotChunk: object?.apply_snapshot_chunk ? RequestApplySnapshotChunk.fromAmino(object.apply_snapshot_chunk) : undefined - }; + const message = createBaseRequest(); + if (object.echo !== undefined && object.echo !== null) { + message.echo = RequestEcho.fromAmino(object.echo); + } + if (object.flush !== undefined && object.flush !== null) { + message.flush = RequestFlush.fromAmino(object.flush); + } + if (object.info !== undefined && object.info !== null) { + message.info = RequestInfo.fromAmino(object.info); + } + if (object.init_chain !== undefined && object.init_chain !== null) { + message.initChain = RequestInitChain.fromAmino(object.init_chain); + } + if (object.query !== undefined && object.query !== null) { + message.query = RequestQuery.fromAmino(object.query); + } + if (object.begin_block !== undefined && object.begin_block !== null) { + message.beginBlock = RequestBeginBlock.fromAmino(object.begin_block); + } + if (object.check_tx !== undefined && object.check_tx !== null) { + message.checkTx = RequestCheckTx.fromAmino(object.check_tx); + } + if (object.deliver_tx !== undefined && object.deliver_tx !== null) { + message.deliverTx = RequestDeliverTx.fromAmino(object.deliver_tx); + } + if (object.end_block !== undefined && object.end_block !== null) { + message.endBlock = RequestEndBlock.fromAmino(object.end_block); + } + if (object.commit !== undefined && object.commit !== null) { + message.commit = RequestCommit.fromAmino(object.commit); + } + if (object.list_snapshots !== undefined && object.list_snapshots !== null) { + message.listSnapshots = RequestListSnapshots.fromAmino(object.list_snapshots); + } + if (object.offer_snapshot !== undefined && object.offer_snapshot !== null) { + message.offerSnapshot = RequestOfferSnapshot.fromAmino(object.offer_snapshot); + } + if (object.load_snapshot_chunk !== undefined && object.load_snapshot_chunk !== null) { + message.loadSnapshotChunk = RequestLoadSnapshotChunk.fromAmino(object.load_snapshot_chunk); + } + if (object.apply_snapshot_chunk !== undefined && object.apply_snapshot_chunk !== null) { + message.applySnapshotChunk = RequestApplySnapshotChunk.fromAmino(object.apply_snapshot_chunk); + } + if (object.prepare_proposal !== undefined && object.prepare_proposal !== null) { + message.prepareProposal = RequestPrepareProposal.fromAmino(object.prepare_proposal); + } + if (object.process_proposal !== undefined && object.process_proposal !== null) { + message.processProposal = RequestProcessProposal.fromAmino(object.process_proposal); + } + return message; }, toAmino(message: Request): RequestAmino { const obj: any = {}; obj.echo = message.echo ? RequestEcho.toAmino(message.echo) : undefined; obj.flush = message.flush ? RequestFlush.toAmino(message.flush) : undefined; obj.info = message.info ? RequestInfo.toAmino(message.info) : undefined; - obj.set_option = message.setOption ? RequestSetOption.toAmino(message.setOption) : undefined; obj.init_chain = message.initChain ? RequestInitChain.toAmino(message.initChain) : undefined; obj.query = message.query ? RequestQuery.toAmino(message.query) : undefined; obj.begin_block = message.beginBlock ? RequestBeginBlock.toAmino(message.beginBlock) : undefined; @@ -1568,6 +1787,8 @@ export const Request = { obj.offer_snapshot = message.offerSnapshot ? RequestOfferSnapshot.toAmino(message.offerSnapshot) : undefined; obj.load_snapshot_chunk = message.loadSnapshotChunk ? RequestLoadSnapshotChunk.toAmino(message.loadSnapshotChunk) : undefined; obj.apply_snapshot_chunk = message.applySnapshotChunk ? RequestApplySnapshotChunk.toAmino(message.applySnapshotChunk) : undefined; + obj.prepare_proposal = message.prepareProposal ? RequestPrepareProposal.toAmino(message.prepareProposal) : undefined; + obj.process_proposal = message.processProposal ? RequestProcessProposal.toAmino(message.processProposal) : undefined; return obj; }, fromAminoMsg(object: RequestAminoMsg): Request { @@ -1586,6 +1807,7 @@ export const Request = { }; } }; +GlobalDecoderRegistry.register(Request.typeUrl, Request); function createBaseRequestEcho(): RequestEcho { return { message: "" @@ -1593,6 +1815,15 @@ function createBaseRequestEcho(): RequestEcho { } export const RequestEcho = { typeUrl: "/tendermint.abci.RequestEcho", + is(o: any): o is RequestEcho { + return o && (o.$typeUrl === RequestEcho.typeUrl || typeof o.message === "string"); + }, + isSDK(o: any): o is RequestEchoSDKType { + return o && (o.$typeUrl === RequestEcho.typeUrl || typeof o.message === "string"); + }, + isAmino(o: any): o is RequestEchoAmino { + return o && (o.$typeUrl === RequestEcho.typeUrl || typeof o.message === "string"); + }, encode(message: RequestEcho, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.message !== "") { writer.uint32(10).string(message.message); @@ -1616,15 +1847,27 @@ export const RequestEcho = { } return message; }, + fromJSON(object: any): RequestEcho { + return { + message: isSet(object.message) ? String(object.message) : "" + }; + }, + toJSON(message: RequestEcho): unknown { + const obj: any = {}; + message.message !== undefined && (obj.message = message.message); + return obj; + }, fromPartial(object: Partial): RequestEcho { const message = createBaseRequestEcho(); message.message = object.message ?? ""; return message; }, fromAmino(object: RequestEchoAmino): RequestEcho { - return { - message: object.message - }; + const message = createBaseRequestEcho(); + if (object.message !== undefined && object.message !== null) { + message.message = object.message; + } + return message; }, toAmino(message: RequestEcho): RequestEchoAmino { const obj: any = {}; @@ -1647,11 +1890,21 @@ export const RequestEcho = { }; } }; +GlobalDecoderRegistry.register(RequestEcho.typeUrl, RequestEcho); function createBaseRequestFlush(): RequestFlush { return {}; } export const RequestFlush = { typeUrl: "/tendermint.abci.RequestFlush", + is(o: any): o is RequestFlush { + return o && o.$typeUrl === RequestFlush.typeUrl; + }, + isSDK(o: any): o is RequestFlushSDKType { + return o && o.$typeUrl === RequestFlush.typeUrl; + }, + isAmino(o: any): o is RequestFlushAmino { + return o && o.$typeUrl === RequestFlush.typeUrl; + }, encode(_: RequestFlush, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, @@ -1669,12 +1922,20 @@ export const RequestFlush = { } return message; }, + fromJSON(_: any): RequestFlush { + return {}; + }, + toJSON(_: RequestFlush): unknown { + const obj: any = {}; + return obj; + }, fromPartial(_: Partial): RequestFlush { const message = createBaseRequestFlush(); return message; }, fromAmino(_: RequestFlushAmino): RequestFlush { - return {}; + const message = createBaseRequestFlush(); + return message; }, toAmino(_: RequestFlush): RequestFlushAmino { const obj: any = {}; @@ -1696,15 +1957,26 @@ export const RequestFlush = { }; } }; +GlobalDecoderRegistry.register(RequestFlush.typeUrl, RequestFlush); function createBaseRequestInfo(): RequestInfo { return { version: "", blockVersion: BigInt(0), - p2pVersion: BigInt(0) + p2pVersion: BigInt(0), + abciVersion: "" }; } export const RequestInfo = { typeUrl: "/tendermint.abci.RequestInfo", + is(o: any): o is RequestInfo { + return o && (o.$typeUrl === RequestInfo.typeUrl || typeof o.version === "string" && typeof o.blockVersion === "bigint" && typeof o.p2pVersion === "bigint" && typeof o.abciVersion === "string"); + }, + isSDK(o: any): o is RequestInfoSDKType { + return o && (o.$typeUrl === RequestInfo.typeUrl || typeof o.version === "string" && typeof o.block_version === "bigint" && typeof o.p2p_version === "bigint" && typeof o.abci_version === "string"); + }, + isAmino(o: any): o is RequestInfoAmino { + return o && (o.$typeUrl === RequestInfo.typeUrl || typeof o.version === "string" && typeof o.block_version === "bigint" && typeof o.p2p_version === "bigint" && typeof o.abci_version === "string"); + }, encode(message: RequestInfo, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.version !== "") { writer.uint32(10).string(message.version); @@ -1715,6 +1987,9 @@ export const RequestInfo = { if (message.p2pVersion !== BigInt(0)) { writer.uint32(24).uint64(message.p2pVersion); } + if (message.abciVersion !== "") { + writer.uint32(34).string(message.abciVersion); + } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): RequestInfo { @@ -1733,6 +2008,9 @@ export const RequestInfo = { case 3: message.p2pVersion = reader.uint64(); break; + case 4: + message.abciVersion = reader.string(); + break; default: reader.skipType(tag & 7); break; @@ -1740,25 +2018,52 @@ export const RequestInfo = { } return message; }, + fromJSON(object: any): RequestInfo { + return { + version: isSet(object.version) ? String(object.version) : "", + blockVersion: isSet(object.blockVersion) ? BigInt(object.blockVersion.toString()) : BigInt(0), + p2pVersion: isSet(object.p2pVersion) ? BigInt(object.p2pVersion.toString()) : BigInt(0), + abciVersion: isSet(object.abciVersion) ? String(object.abciVersion) : "" + }; + }, + toJSON(message: RequestInfo): unknown { + const obj: any = {}; + message.version !== undefined && (obj.version = message.version); + message.blockVersion !== undefined && (obj.blockVersion = (message.blockVersion || BigInt(0)).toString()); + message.p2pVersion !== undefined && (obj.p2pVersion = (message.p2pVersion || BigInt(0)).toString()); + message.abciVersion !== undefined && (obj.abciVersion = message.abciVersion); + return obj; + }, fromPartial(object: Partial): RequestInfo { const message = createBaseRequestInfo(); message.version = object.version ?? ""; message.blockVersion = object.blockVersion !== undefined && object.blockVersion !== null ? BigInt(object.blockVersion.toString()) : BigInt(0); message.p2pVersion = object.p2pVersion !== undefined && object.p2pVersion !== null ? BigInt(object.p2pVersion.toString()) : BigInt(0); + message.abciVersion = object.abciVersion ?? ""; return message; }, fromAmino(object: RequestInfoAmino): RequestInfo { - return { - version: object.version, - blockVersion: BigInt(object.block_version), - p2pVersion: BigInt(object.p2p_version) - }; + const message = createBaseRequestInfo(); + if (object.version !== undefined && object.version !== null) { + message.version = object.version; + } + if (object.block_version !== undefined && object.block_version !== null) { + message.blockVersion = BigInt(object.block_version); + } + if (object.p2p_version !== undefined && object.p2p_version !== null) { + message.p2pVersion = BigInt(object.p2p_version); + } + if (object.abci_version !== undefined && object.abci_version !== null) { + message.abciVersion = object.abci_version; + } + return message; }, toAmino(message: RequestInfo): RequestInfoAmino { const obj: any = {}; obj.version = message.version; obj.block_version = message.blockVersion ? message.blockVersion.toString() : undefined; obj.p2p_version = message.p2pVersion ? message.p2pVersion.toString() : undefined; + obj.abci_version = message.abciVersion; return obj; }, fromAminoMsg(object: RequestInfoAminoMsg): RequestInfo { @@ -1777,82 +2082,12 @@ export const RequestInfo = { }; } }; -function createBaseRequestSetOption(): RequestSetOption { - return { - key: "", - value: "" - }; -} -export const RequestSetOption = { - typeUrl: "/tendermint.abci.RequestSetOption", - encode(message: RequestSetOption, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { - if (message.key !== "") { - writer.uint32(10).string(message.key); - } - if (message.value !== "") { - writer.uint32(18).string(message.value); - } - return writer; - }, - decode(input: BinaryReader | Uint8Array, length?: number): RequestSetOption { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseRequestSetOption(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.key = reader.string(); - break; - case 2: - message.value = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - fromPartial(object: Partial): RequestSetOption { - const message = createBaseRequestSetOption(); - message.key = object.key ?? ""; - message.value = object.value ?? ""; - return message; - }, - fromAmino(object: RequestSetOptionAmino): RequestSetOption { - return { - key: object.key, - value: object.value - }; - }, - toAmino(message: RequestSetOption): RequestSetOptionAmino { - const obj: any = {}; - obj.key = message.key; - obj.value = message.value; - return obj; - }, - fromAminoMsg(object: RequestSetOptionAminoMsg): RequestSetOption { - return RequestSetOption.fromAmino(object.value); - }, - fromProtoMsg(message: RequestSetOptionProtoMsg): RequestSetOption { - return RequestSetOption.decode(message.value); - }, - toProto(message: RequestSetOption): Uint8Array { - return RequestSetOption.encode(message).finish(); - }, - toProtoMsg(message: RequestSetOption): RequestSetOptionProtoMsg { - return { - typeUrl: "/tendermint.abci.RequestSetOption", - value: RequestSetOption.encode(message).finish() - }; - } -}; +GlobalDecoderRegistry.register(RequestInfo.typeUrl, RequestInfo); function createBaseRequestInitChain(): RequestInitChain { return { - time: undefined, + time: new Date(), chainId: "", - consensusParams: ConsensusParams.fromPartial({}), + consensusParams: undefined, validators: [], appStateBytes: new Uint8Array(), initialHeight: BigInt(0) @@ -1860,6 +2095,15 @@ function createBaseRequestInitChain(): RequestInitChain { } export const RequestInitChain = { typeUrl: "/tendermint.abci.RequestInitChain", + is(o: any): o is RequestInitChain { + return o && (o.$typeUrl === RequestInitChain.typeUrl || Timestamp.is(o.time) && typeof o.chainId === "string" && Array.isArray(o.validators) && (!o.validators.length || ValidatorUpdate.is(o.validators[0])) && (o.appStateBytes instanceof Uint8Array || typeof o.appStateBytes === "string") && typeof o.initialHeight === "bigint"); + }, + isSDK(o: any): o is RequestInitChainSDKType { + return o && (o.$typeUrl === RequestInitChain.typeUrl || Timestamp.isSDK(o.time) && typeof o.chain_id === "string" && Array.isArray(o.validators) && (!o.validators.length || ValidatorUpdate.isSDK(o.validators[0])) && (o.app_state_bytes instanceof Uint8Array || typeof o.app_state_bytes === "string") && typeof o.initial_height === "bigint"); + }, + isAmino(o: any): o is RequestInitChainAmino { + return o && (o.$typeUrl === RequestInitChain.typeUrl || Timestamp.isAmino(o.time) && typeof o.chain_id === "string" && Array.isArray(o.validators) && (!o.validators.length || ValidatorUpdate.isAmino(o.validators[0])) && (o.app_state_bytes instanceof Uint8Array || typeof o.app_state_bytes === "string") && typeof o.initial_height === "bigint"); + }, encode(message: RequestInitChain, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.time !== undefined) { Timestamp.encode(toTimestamp(message.time), writer.uint32(10).fork()).ldelim(); @@ -1913,6 +2157,30 @@ export const RequestInitChain = { } return message; }, + fromJSON(object: any): RequestInitChain { + return { + time: isSet(object.time) ? new Date(object.time) : undefined, + chainId: isSet(object.chainId) ? String(object.chainId) : "", + 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) ? BigInt(object.initialHeight.toString()) : BigInt(0) + }; + }, + toJSON(message: RequestInitChain): unknown { + 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); + if (message.validators) { + obj.validators = message.validators.map(e => e ? ValidatorUpdate.toJSON(e) : undefined); + } else { + obj.validators = []; + } + message.appStateBytes !== undefined && (obj.appStateBytes = base64FromBytes(message.appStateBytes !== undefined ? message.appStateBytes : new Uint8Array())); + message.initialHeight !== undefined && (obj.initialHeight = (message.initialHeight || BigInt(0)).toString()); + return obj; + }, fromPartial(object: Partial): RequestInitChain { const message = createBaseRequestInitChain(); message.time = object.time ?? undefined; @@ -1924,18 +2192,28 @@ export const RequestInitChain = { return message; }, fromAmino(object: RequestInitChainAmino): RequestInitChain { - return { - time: object.time, - chainId: object.chain_id, - consensusParams: object?.consensus_params ? ConsensusParams.fromAmino(object.consensus_params) : undefined, - validators: Array.isArray(object?.validators) ? object.validators.map((e: any) => ValidatorUpdate.fromAmino(e)) : [], - appStateBytes: object.app_state_bytes, - initialHeight: BigInt(object.initial_height) - }; + const message = createBaseRequestInitChain(); + if (object.time !== undefined && object.time !== null) { + message.time = fromTimestamp(Timestamp.fromAmino(object.time)); + } + if (object.chain_id !== undefined && object.chain_id !== null) { + message.chainId = object.chain_id; + } + if (object.consensus_params !== undefined && object.consensus_params !== null) { + message.consensusParams = ConsensusParams.fromAmino(object.consensus_params); + } + message.validators = object.validators?.map(e => ValidatorUpdate.fromAmino(e)) || []; + if (object.app_state_bytes !== undefined && object.app_state_bytes !== null) { + message.appStateBytes = bytesFromBase64(object.app_state_bytes); + } + if (object.initial_height !== undefined && object.initial_height !== null) { + message.initialHeight = BigInt(object.initial_height); + } + return message; }, toAmino(message: RequestInitChain): RequestInitChainAmino { const obj: any = {}; - obj.time = message.time; + obj.time = message.time ? Timestamp.toAmino(toTimestamp(message.time)) : undefined; obj.chain_id = message.chainId; obj.consensus_params = message.consensusParams ? ConsensusParams.toAmino(message.consensusParams) : undefined; if (message.validators) { @@ -1943,7 +2221,7 @@ export const RequestInitChain = { } else { obj.validators = []; } - obj.app_state_bytes = message.appStateBytes; + obj.app_state_bytes = message.appStateBytes ? base64FromBytes(message.appStateBytes) : undefined; obj.initial_height = message.initialHeight ? message.initialHeight.toString() : undefined; return obj; }, @@ -1963,6 +2241,7 @@ export const RequestInitChain = { }; } }; +GlobalDecoderRegistry.register(RequestInitChain.typeUrl, RequestInitChain); function createBaseRequestQuery(): RequestQuery { return { data: new Uint8Array(), @@ -1973,6 +2252,15 @@ function createBaseRequestQuery(): RequestQuery { } export const RequestQuery = { typeUrl: "/tendermint.abci.RequestQuery", + is(o: any): o is RequestQuery { + return o && (o.$typeUrl === RequestQuery.typeUrl || (o.data instanceof Uint8Array || typeof o.data === "string") && typeof o.path === "string" && typeof o.height === "bigint" && typeof o.prove === "boolean"); + }, + isSDK(o: any): o is RequestQuerySDKType { + return o && (o.$typeUrl === RequestQuery.typeUrl || (o.data instanceof Uint8Array || typeof o.data === "string") && typeof o.path === "string" && typeof o.height === "bigint" && typeof o.prove === "boolean"); + }, + isAmino(o: any): o is RequestQueryAmino { + return o && (o.$typeUrl === RequestQuery.typeUrl || (o.data instanceof Uint8Array || typeof o.data === "string") && typeof o.path === "string" && typeof o.height === "bigint" && typeof o.prove === "boolean"); + }, encode(message: RequestQuery, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.data.length !== 0) { writer.uint32(10).bytes(message.data); @@ -2014,6 +2302,22 @@ export const RequestQuery = { } return message; }, + fromJSON(object: any): RequestQuery { + return { + data: isSet(object.data) ? bytesFromBase64(object.data) : new Uint8Array(), + path: isSet(object.path) ? String(object.path) : "", + height: isSet(object.height) ? BigInt(object.height.toString()) : BigInt(0), + prove: isSet(object.prove) ? Boolean(object.prove) : false + }; + }, + toJSON(message: RequestQuery): unknown { + 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 || BigInt(0)).toString()); + message.prove !== undefined && (obj.prove = message.prove); + return obj; + }, fromPartial(object: Partial): RequestQuery { const message = createBaseRequestQuery(); message.data = object.data ?? new Uint8Array(); @@ -2023,16 +2327,24 @@ export const RequestQuery = { return message; }, fromAmino(object: RequestQueryAmino): RequestQuery { - return { - data: object.data, - path: object.path, - height: BigInt(object.height), - prove: object.prove - }; + const message = createBaseRequestQuery(); + if (object.data !== undefined && object.data !== null) { + message.data = bytesFromBase64(object.data); + } + if (object.path !== undefined && object.path !== null) { + message.path = object.path; + } + if (object.height !== undefined && object.height !== null) { + message.height = BigInt(object.height); + } + if (object.prove !== undefined && object.prove !== null) { + message.prove = object.prove; + } + return message; }, toAmino(message: RequestQuery): RequestQueryAmino { const obj: any = {}; - obj.data = message.data; + obj.data = message.data ? base64FromBytes(message.data) : undefined; obj.path = message.path; obj.height = message.height ? message.height.toString() : undefined; obj.prove = message.prove; @@ -2054,16 +2366,26 @@ export const RequestQuery = { }; } }; +GlobalDecoderRegistry.register(RequestQuery.typeUrl, RequestQuery); function createBaseRequestBeginBlock(): RequestBeginBlock { return { hash: new Uint8Array(), header: Header.fromPartial({}), - lastCommitInfo: LastCommitInfo.fromPartial({}), + lastCommitInfo: CommitInfo.fromPartial({}), byzantineValidators: [] }; } export const RequestBeginBlock = { typeUrl: "/tendermint.abci.RequestBeginBlock", + is(o: any): o is RequestBeginBlock { + return o && (o.$typeUrl === RequestBeginBlock.typeUrl || (o.hash instanceof Uint8Array || typeof o.hash === "string") && Header.is(o.header) && CommitInfo.is(o.lastCommitInfo) && Array.isArray(o.byzantineValidators) && (!o.byzantineValidators.length || Misbehavior.is(o.byzantineValidators[0]))); + }, + isSDK(o: any): o is RequestBeginBlockSDKType { + return o && (o.$typeUrl === RequestBeginBlock.typeUrl || (o.hash instanceof Uint8Array || typeof o.hash === "string") && Header.isSDK(o.header) && CommitInfo.isSDK(o.last_commit_info) && Array.isArray(o.byzantine_validators) && (!o.byzantine_validators.length || Misbehavior.isSDK(o.byzantine_validators[0]))); + }, + isAmino(o: any): o is RequestBeginBlockAmino { + return o && (o.$typeUrl === RequestBeginBlock.typeUrl || (o.hash instanceof Uint8Array || typeof o.hash === "string") && Header.isAmino(o.header) && CommitInfo.isAmino(o.last_commit_info) && Array.isArray(o.byzantine_validators) && (!o.byzantine_validators.length || Misbehavior.isAmino(o.byzantine_validators[0]))); + }, encode(message: RequestBeginBlock, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.hash.length !== 0) { writer.uint32(10).bytes(message.hash); @@ -2072,10 +2394,10 @@ export const RequestBeginBlock = { Header.encode(message.header, writer.uint32(18).fork()).ldelim(); } if (message.lastCommitInfo !== undefined) { - LastCommitInfo.encode(message.lastCommitInfo, writer.uint32(26).fork()).ldelim(); + CommitInfo.encode(message.lastCommitInfo, writer.uint32(26).fork()).ldelim(); } for (const v of message.byzantineValidators) { - Evidence.encode(v!, writer.uint32(34).fork()).ldelim(); + Misbehavior.encode(v!, writer.uint32(34).fork()).ldelim(); } return writer; }, @@ -2093,10 +2415,10 @@ export const RequestBeginBlock = { message.header = Header.decode(reader, reader.uint32()); break; case 3: - message.lastCommitInfo = LastCommitInfo.decode(reader, reader.uint32()); + message.lastCommitInfo = CommitInfo.decode(reader, reader.uint32()); break; case 4: - message.byzantineValidators.push(Evidence.decode(reader, reader.uint32())); + message.byzantineValidators.push(Misbehavior.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -2105,29 +2427,55 @@ export const RequestBeginBlock = { } 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) ? CommitInfo.fromJSON(object.lastCommitInfo) : undefined, + byzantineValidators: Array.isArray(object?.byzantineValidators) ? object.byzantineValidators.map((e: any) => Misbehavior.fromJSON(e)) : [] + }; + }, + toJSON(message: RequestBeginBlock): unknown { + 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); + message.lastCommitInfo !== undefined && (obj.lastCommitInfo = message.lastCommitInfo ? CommitInfo.toJSON(message.lastCommitInfo) : undefined); + if (message.byzantineValidators) { + obj.byzantineValidators = message.byzantineValidators.map(e => e ? Misbehavior.toJSON(e) : undefined); + } else { + obj.byzantineValidators = []; + } + return obj; + }, fromPartial(object: Partial): 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)) || []; + message.lastCommitInfo = object.lastCommitInfo !== undefined && object.lastCommitInfo !== null ? CommitInfo.fromPartial(object.lastCommitInfo) : undefined; + message.byzantineValidators = object.byzantineValidators?.map(e => Misbehavior.fromPartial(e)) || []; return message; }, fromAmino(object: RequestBeginBlockAmino): RequestBeginBlock { - return { - hash: object.hash, - header: object?.header ? Header.fromAmino(object.header) : undefined, - lastCommitInfo: object?.last_commit_info ? LastCommitInfo.fromAmino(object.last_commit_info) : undefined, - byzantineValidators: Array.isArray(object?.byzantine_validators) ? object.byzantine_validators.map((e: any) => Evidence.fromAmino(e)) : [] - }; + const message = createBaseRequestBeginBlock(); + if (object.hash !== undefined && object.hash !== null) { + message.hash = bytesFromBase64(object.hash); + } + if (object.header !== undefined && object.header !== null) { + message.header = Header.fromAmino(object.header); + } + if (object.last_commit_info !== undefined && object.last_commit_info !== null) { + message.lastCommitInfo = CommitInfo.fromAmino(object.last_commit_info); + } + message.byzantineValidators = object.byzantine_validators?.map(e => Misbehavior.fromAmino(e)) || []; + return message; }, toAmino(message: RequestBeginBlock): RequestBeginBlockAmino { const obj: any = {}; - obj.hash = message.hash; + obj.hash = message.hash ? base64FromBytes(message.hash) : undefined; obj.header = message.header ? Header.toAmino(message.header) : undefined; - obj.last_commit_info = message.lastCommitInfo ? LastCommitInfo.toAmino(message.lastCommitInfo) : undefined; + obj.last_commit_info = message.lastCommitInfo ? CommitInfo.toAmino(message.lastCommitInfo) : undefined; if (message.byzantineValidators) { - obj.byzantine_validators = message.byzantineValidators.map(e => e ? Evidence.toAmino(e) : undefined); + obj.byzantine_validators = message.byzantineValidators.map(e => e ? Misbehavior.toAmino(e) : undefined); } else { obj.byzantine_validators = []; } @@ -2149,6 +2497,7 @@ export const RequestBeginBlock = { }; } }; +GlobalDecoderRegistry.register(RequestBeginBlock.typeUrl, RequestBeginBlock); function createBaseRequestCheckTx(): RequestCheckTx { return { tx: new Uint8Array(), @@ -2157,6 +2506,15 @@ function createBaseRequestCheckTx(): RequestCheckTx { } export const RequestCheckTx = { typeUrl: "/tendermint.abci.RequestCheckTx", + is(o: any): o is RequestCheckTx { + return o && (o.$typeUrl === RequestCheckTx.typeUrl || (o.tx instanceof Uint8Array || typeof o.tx === "string") && isSet(o.type)); + }, + isSDK(o: any): o is RequestCheckTxSDKType { + return o && (o.$typeUrl === RequestCheckTx.typeUrl || (o.tx instanceof Uint8Array || typeof o.tx === "string") && isSet(o.type)); + }, + isAmino(o: any): o is RequestCheckTxAmino { + return o && (o.$typeUrl === RequestCheckTx.typeUrl || (o.tx instanceof Uint8Array || typeof o.tx === "string") && isSet(o.type)); + }, encode(message: RequestCheckTx, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.tx.length !== 0) { writer.uint32(10).bytes(message.tx); @@ -2186,6 +2544,18 @@ export const RequestCheckTx = { } return message; }, + fromJSON(object: any): RequestCheckTx { + return { + tx: isSet(object.tx) ? bytesFromBase64(object.tx) : new Uint8Array(), + type: isSet(object.type) ? checkTxTypeFromJSON(object.type) : -1 + }; + }, + 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(object: Partial): RequestCheckTx { const message = createBaseRequestCheckTx(); message.tx = object.tx ?? new Uint8Array(); @@ -2193,15 +2563,19 @@ export const RequestCheckTx = { return message; }, fromAmino(object: RequestCheckTxAmino): RequestCheckTx { - return { - tx: object.tx, - type: isSet(object.type) ? checkTxTypeFromJSON(object.type) : -1 - }; + const message = createBaseRequestCheckTx(); + if (object.tx !== undefined && object.tx !== null) { + message.tx = bytesFromBase64(object.tx); + } + if (object.type !== undefined && object.type !== null) { + message.type = checkTxTypeFromJSON(object.type); + } + return message; }, toAmino(message: RequestCheckTx): RequestCheckTxAmino { const obj: any = {}; - obj.tx = message.tx; - obj.type = message.type; + obj.tx = message.tx ? base64FromBytes(message.tx) : undefined; + obj.type = checkTxTypeToJSON(message.type); return obj; }, fromAminoMsg(object: RequestCheckTxAminoMsg): RequestCheckTx { @@ -2220,6 +2594,7 @@ export const RequestCheckTx = { }; } }; +GlobalDecoderRegistry.register(RequestCheckTx.typeUrl, RequestCheckTx); function createBaseRequestDeliverTx(): RequestDeliverTx { return { tx: new Uint8Array() @@ -2227,6 +2602,15 @@ function createBaseRequestDeliverTx(): RequestDeliverTx { } export const RequestDeliverTx = { typeUrl: "/tendermint.abci.RequestDeliverTx", + is(o: any): o is RequestDeliverTx { + return o && (o.$typeUrl === RequestDeliverTx.typeUrl || o.tx instanceof Uint8Array || typeof o.tx === "string"); + }, + isSDK(o: any): o is RequestDeliverTxSDKType { + return o && (o.$typeUrl === RequestDeliverTx.typeUrl || o.tx instanceof Uint8Array || typeof o.tx === "string"); + }, + isAmino(o: any): o is RequestDeliverTxAmino { + return o && (o.$typeUrl === RequestDeliverTx.typeUrl || o.tx instanceof Uint8Array || typeof o.tx === "string"); + }, encode(message: RequestDeliverTx, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.tx.length !== 0) { writer.uint32(10).bytes(message.tx); @@ -2250,19 +2634,31 @@ export const RequestDeliverTx = { } return message; }, + fromJSON(object: any): RequestDeliverTx { + 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; + }, fromPartial(object: Partial): RequestDeliverTx { const message = createBaseRequestDeliverTx(); message.tx = object.tx ?? new Uint8Array(); return message; }, fromAmino(object: RequestDeliverTxAmino): RequestDeliverTx { - return { - tx: object.tx - }; + const message = createBaseRequestDeliverTx(); + if (object.tx !== undefined && object.tx !== null) { + message.tx = bytesFromBase64(object.tx); + } + return message; }, toAmino(message: RequestDeliverTx): RequestDeliverTxAmino { const obj: any = {}; - obj.tx = message.tx; + obj.tx = message.tx ? base64FromBytes(message.tx) : undefined; return obj; }, fromAminoMsg(object: RequestDeliverTxAminoMsg): RequestDeliverTx { @@ -2281,6 +2677,7 @@ export const RequestDeliverTx = { }; } }; +GlobalDecoderRegistry.register(RequestDeliverTx.typeUrl, RequestDeliverTx); function createBaseRequestEndBlock(): RequestEndBlock { return { height: BigInt(0) @@ -2288,6 +2685,15 @@ function createBaseRequestEndBlock(): RequestEndBlock { } export const RequestEndBlock = { typeUrl: "/tendermint.abci.RequestEndBlock", + is(o: any): o is RequestEndBlock { + return o && (o.$typeUrl === RequestEndBlock.typeUrl || typeof o.height === "bigint"); + }, + isSDK(o: any): o is RequestEndBlockSDKType { + return o && (o.$typeUrl === RequestEndBlock.typeUrl || typeof o.height === "bigint"); + }, + isAmino(o: any): o is RequestEndBlockAmino { + return o && (o.$typeUrl === RequestEndBlock.typeUrl || typeof o.height === "bigint"); + }, encode(message: RequestEndBlock, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.height !== BigInt(0)) { writer.uint32(8).int64(message.height); @@ -2311,15 +2717,27 @@ export const RequestEndBlock = { } return message; }, + fromJSON(object: any): RequestEndBlock { + return { + height: isSet(object.height) ? BigInt(object.height.toString()) : BigInt(0) + }; + }, + toJSON(message: RequestEndBlock): unknown { + const obj: any = {}; + message.height !== undefined && (obj.height = (message.height || BigInt(0)).toString()); + return obj; + }, fromPartial(object: Partial): RequestEndBlock { const message = createBaseRequestEndBlock(); message.height = object.height !== undefined && object.height !== null ? BigInt(object.height.toString()) : BigInt(0); return message; }, fromAmino(object: RequestEndBlockAmino): RequestEndBlock { - return { - height: BigInt(object.height) - }; + const message = createBaseRequestEndBlock(); + if (object.height !== undefined && object.height !== null) { + message.height = BigInt(object.height); + } + return message; }, toAmino(message: RequestEndBlock): RequestEndBlockAmino { const obj: any = {}; @@ -2342,11 +2760,21 @@ export const RequestEndBlock = { }; } }; +GlobalDecoderRegistry.register(RequestEndBlock.typeUrl, RequestEndBlock); function createBaseRequestCommit(): RequestCommit { return {}; } export const RequestCommit = { typeUrl: "/tendermint.abci.RequestCommit", + is(o: any): o is RequestCommit { + return o && o.$typeUrl === RequestCommit.typeUrl; + }, + isSDK(o: any): o is RequestCommitSDKType { + return o && o.$typeUrl === RequestCommit.typeUrl; + }, + isAmino(o: any): o is RequestCommitAmino { + return o && o.$typeUrl === RequestCommit.typeUrl; + }, encode(_: RequestCommit, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, @@ -2364,12 +2792,20 @@ export const RequestCommit = { } return message; }, + fromJSON(_: any): RequestCommit { + return {}; + }, + toJSON(_: RequestCommit): unknown { + const obj: any = {}; + return obj; + }, fromPartial(_: Partial): RequestCommit { const message = createBaseRequestCommit(); return message; }, fromAmino(_: RequestCommitAmino): RequestCommit { - return {}; + const message = createBaseRequestCommit(); + return message; }, toAmino(_: RequestCommit): RequestCommitAmino { const obj: any = {}; @@ -2391,11 +2827,21 @@ export const RequestCommit = { }; } }; +GlobalDecoderRegistry.register(RequestCommit.typeUrl, RequestCommit); function createBaseRequestListSnapshots(): RequestListSnapshots { return {}; } export const RequestListSnapshots = { typeUrl: "/tendermint.abci.RequestListSnapshots", + is(o: any): o is RequestListSnapshots { + return o && o.$typeUrl === RequestListSnapshots.typeUrl; + }, + isSDK(o: any): o is RequestListSnapshotsSDKType { + return o && o.$typeUrl === RequestListSnapshots.typeUrl; + }, + isAmino(o: any): o is RequestListSnapshotsAmino { + return o && o.$typeUrl === RequestListSnapshots.typeUrl; + }, encode(_: RequestListSnapshots, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, @@ -2413,12 +2859,20 @@ export const RequestListSnapshots = { } return message; }, + fromJSON(_: any): RequestListSnapshots { + return {}; + }, + toJSON(_: RequestListSnapshots): unknown { + const obj: any = {}; + return obj; + }, fromPartial(_: Partial): RequestListSnapshots { const message = createBaseRequestListSnapshots(); return message; }, fromAmino(_: RequestListSnapshotsAmino): RequestListSnapshots { - return {}; + const message = createBaseRequestListSnapshots(); + return message; }, toAmino(_: RequestListSnapshots): RequestListSnapshotsAmino { const obj: any = {}; @@ -2440,14 +2894,24 @@ export const RequestListSnapshots = { }; } }; +GlobalDecoderRegistry.register(RequestListSnapshots.typeUrl, RequestListSnapshots); function createBaseRequestOfferSnapshot(): RequestOfferSnapshot { return { - snapshot: Snapshot.fromPartial({}), + snapshot: undefined, appHash: new Uint8Array() }; } export const RequestOfferSnapshot = { typeUrl: "/tendermint.abci.RequestOfferSnapshot", + is(o: any): o is RequestOfferSnapshot { + return o && (o.$typeUrl === RequestOfferSnapshot.typeUrl || o.appHash instanceof Uint8Array || typeof o.appHash === "string"); + }, + isSDK(o: any): o is RequestOfferSnapshotSDKType { + return o && (o.$typeUrl === RequestOfferSnapshot.typeUrl || o.app_hash instanceof Uint8Array || typeof o.app_hash === "string"); + }, + isAmino(o: any): o is RequestOfferSnapshotAmino { + return o && (o.$typeUrl === RequestOfferSnapshot.typeUrl || o.app_hash instanceof Uint8Array || typeof o.app_hash === "string"); + }, encode(message: RequestOfferSnapshot, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.snapshot !== undefined) { Snapshot.encode(message.snapshot, writer.uint32(10).fork()).ldelim(); @@ -2477,6 +2941,18 @@ export const RequestOfferSnapshot = { } 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() + }; + }, + toJSON(message: RequestOfferSnapshot): unknown { + 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(object: Partial): RequestOfferSnapshot { const message = createBaseRequestOfferSnapshot(); message.snapshot = object.snapshot !== undefined && object.snapshot !== null ? Snapshot.fromPartial(object.snapshot) : undefined; @@ -2484,15 +2960,19 @@ export const RequestOfferSnapshot = { return message; }, fromAmino(object: RequestOfferSnapshotAmino): RequestOfferSnapshot { - return { - snapshot: object?.snapshot ? Snapshot.fromAmino(object.snapshot) : undefined, - appHash: object.app_hash - }; + const message = createBaseRequestOfferSnapshot(); + if (object.snapshot !== undefined && object.snapshot !== null) { + message.snapshot = Snapshot.fromAmino(object.snapshot); + } + if (object.app_hash !== undefined && object.app_hash !== null) { + message.appHash = bytesFromBase64(object.app_hash); + } + return message; }, toAmino(message: RequestOfferSnapshot): RequestOfferSnapshotAmino { const obj: any = {}; obj.snapshot = message.snapshot ? Snapshot.toAmino(message.snapshot) : undefined; - obj.app_hash = message.appHash; + obj.app_hash = message.appHash ? base64FromBytes(message.appHash) : undefined; return obj; }, fromAminoMsg(object: RequestOfferSnapshotAminoMsg): RequestOfferSnapshot { @@ -2511,6 +2991,7 @@ export const RequestOfferSnapshot = { }; } }; +GlobalDecoderRegistry.register(RequestOfferSnapshot.typeUrl, RequestOfferSnapshot); function createBaseRequestLoadSnapshotChunk(): RequestLoadSnapshotChunk { return { height: BigInt(0), @@ -2520,6 +3001,15 @@ function createBaseRequestLoadSnapshotChunk(): RequestLoadSnapshotChunk { } export const RequestLoadSnapshotChunk = { typeUrl: "/tendermint.abci.RequestLoadSnapshotChunk", + is(o: any): o is RequestLoadSnapshotChunk { + return o && (o.$typeUrl === RequestLoadSnapshotChunk.typeUrl || typeof o.height === "bigint" && typeof o.format === "number" && typeof o.chunk === "number"); + }, + isSDK(o: any): o is RequestLoadSnapshotChunkSDKType { + return o && (o.$typeUrl === RequestLoadSnapshotChunk.typeUrl || typeof o.height === "bigint" && typeof o.format === "number" && typeof o.chunk === "number"); + }, + isAmino(o: any): o is RequestLoadSnapshotChunkAmino { + return o && (o.$typeUrl === RequestLoadSnapshotChunk.typeUrl || typeof o.height === "bigint" && typeof o.format === "number" && typeof o.chunk === "number"); + }, encode(message: RequestLoadSnapshotChunk, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.height !== BigInt(0)) { writer.uint32(8).uint64(message.height); @@ -2555,6 +3045,20 @@ export const RequestLoadSnapshotChunk = { } return message; }, + fromJSON(object: any): RequestLoadSnapshotChunk { + return { + height: isSet(object.height) ? BigInt(object.height.toString()) : BigInt(0), + 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 || BigInt(0)).toString()); + message.format !== undefined && (obj.format = Math.round(message.format)); + message.chunk !== undefined && (obj.chunk = Math.round(message.chunk)); + return obj; + }, fromPartial(object: Partial): RequestLoadSnapshotChunk { const message = createBaseRequestLoadSnapshotChunk(); message.height = object.height !== undefined && object.height !== null ? BigInt(object.height.toString()) : BigInt(0); @@ -2563,11 +3067,17 @@ export const RequestLoadSnapshotChunk = { return message; }, fromAmino(object: RequestLoadSnapshotChunkAmino): RequestLoadSnapshotChunk { - return { - height: BigInt(object.height), - format: object.format, - chunk: object.chunk - }; + const message = createBaseRequestLoadSnapshotChunk(); + if (object.height !== undefined && object.height !== null) { + message.height = BigInt(object.height); + } + if (object.format !== undefined && object.format !== null) { + message.format = object.format; + } + if (object.chunk !== undefined && object.chunk !== null) { + message.chunk = object.chunk; + } + return message; }, toAmino(message: RequestLoadSnapshotChunk): RequestLoadSnapshotChunkAmino { const obj: any = {}; @@ -2592,6 +3102,7 @@ export const RequestLoadSnapshotChunk = { }; } }; +GlobalDecoderRegistry.register(RequestLoadSnapshotChunk.typeUrl, RequestLoadSnapshotChunk); function createBaseRequestApplySnapshotChunk(): RequestApplySnapshotChunk { return { index: 0, @@ -2601,6 +3112,15 @@ function createBaseRequestApplySnapshotChunk(): RequestApplySnapshotChunk { } export const RequestApplySnapshotChunk = { typeUrl: "/tendermint.abci.RequestApplySnapshotChunk", + is(o: any): o is RequestApplySnapshotChunk { + return o && (o.$typeUrl === RequestApplySnapshotChunk.typeUrl || typeof o.index === "number" && (o.chunk instanceof Uint8Array || typeof o.chunk === "string") && typeof o.sender === "string"); + }, + isSDK(o: any): o is RequestApplySnapshotChunkSDKType { + return o && (o.$typeUrl === RequestApplySnapshotChunk.typeUrl || typeof o.index === "number" && (o.chunk instanceof Uint8Array || typeof o.chunk === "string") && typeof o.sender === "string"); + }, + isAmino(o: any): o is RequestApplySnapshotChunkAmino { + return o && (o.$typeUrl === RequestApplySnapshotChunk.typeUrl || typeof o.index === "number" && (o.chunk instanceof Uint8Array || typeof o.chunk === "string") && typeof o.sender === "string"); + }, encode(message: RequestApplySnapshotChunk, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.index !== 0) { writer.uint32(8).uint32(message.index); @@ -2636,6 +3156,20 @@ export const RequestApplySnapshotChunk = { } return message; }, + fromJSON(object: any): RequestApplySnapshotChunk { + return { + 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)); + message.chunk !== undefined && (obj.chunk = base64FromBytes(message.chunk !== undefined ? message.chunk : new Uint8Array())); + message.sender !== undefined && (obj.sender = message.sender); + return obj; + }, fromPartial(object: Partial): RequestApplySnapshotChunk { const message = createBaseRequestApplySnapshotChunk(); message.index = object.index ?? 0; @@ -2644,16 +3178,22 @@ export const RequestApplySnapshotChunk = { return message; }, fromAmino(object: RequestApplySnapshotChunkAmino): RequestApplySnapshotChunk { - return { - index: object.index, - chunk: object.chunk, - sender: object.sender - }; + const message = createBaseRequestApplySnapshotChunk(); + if (object.index !== undefined && object.index !== null) { + message.index = object.index; + } + if (object.chunk !== undefined && object.chunk !== null) { + message.chunk = bytesFromBase64(object.chunk); + } + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + return message; }, toAmino(message: RequestApplySnapshotChunk): RequestApplySnapshotChunkAmino { const obj: any = {}; obj.index = message.index; - obj.chunk = message.chunk; + obj.chunk = message.chunk ? base64FromBytes(message.chunk) : undefined; obj.sender = message.sender; return obj; }, @@ -2673,31 +3213,428 @@ export const RequestApplySnapshotChunk = { }; } }; -function createBaseResponse(): Response { +GlobalDecoderRegistry.register(RequestApplySnapshotChunk.typeUrl, RequestApplySnapshotChunk); +function createBaseRequestPrepareProposal(): RequestPrepareProposal { return { - exception: undefined, - echo: undefined, - flush: undefined, - info: undefined, - setOption: undefined, - initChain: undefined, - query: undefined, - beginBlock: undefined, - checkTx: undefined, - deliverTx: undefined, - endBlock: undefined, - commit: undefined, - listSnapshots: undefined, - offerSnapshot: undefined, - loadSnapshotChunk: undefined, - applySnapshotChunk: undefined + maxTxBytes: BigInt(0), + txs: [], + localLastCommit: ExtendedCommitInfo.fromPartial({}), + misbehavior: [], + height: BigInt(0), + time: new Date(), + nextValidatorsHash: new Uint8Array(), + proposerAddress: new Uint8Array() }; } -export const Response = { - typeUrl: "/tendermint.abci.Response", - encode(message: Response, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { - if (message.exception !== undefined) { - ResponseException.encode(message.exception, writer.uint32(10).fork()).ldelim(); +export const RequestPrepareProposal = { + typeUrl: "/tendermint.abci.RequestPrepareProposal", + is(o: any): o is RequestPrepareProposal { + return o && (o.$typeUrl === RequestPrepareProposal.typeUrl || typeof o.maxTxBytes === "bigint" && Array.isArray(o.txs) && (!o.txs.length || o.txs[0] instanceof Uint8Array || typeof o.txs[0] === "string") && ExtendedCommitInfo.is(o.localLastCommit) && Array.isArray(o.misbehavior) && (!o.misbehavior.length || Misbehavior.is(o.misbehavior[0])) && typeof o.height === "bigint" && Timestamp.is(o.time) && (o.nextValidatorsHash instanceof Uint8Array || typeof o.nextValidatorsHash === "string") && (o.proposerAddress instanceof Uint8Array || typeof o.proposerAddress === "string")); + }, + isSDK(o: any): o is RequestPrepareProposalSDKType { + return o && (o.$typeUrl === RequestPrepareProposal.typeUrl || typeof o.max_tx_bytes === "bigint" && Array.isArray(o.txs) && (!o.txs.length || o.txs[0] instanceof Uint8Array || typeof o.txs[0] === "string") && ExtendedCommitInfo.isSDK(o.local_last_commit) && Array.isArray(o.misbehavior) && (!o.misbehavior.length || Misbehavior.isSDK(o.misbehavior[0])) && typeof o.height === "bigint" && Timestamp.isSDK(o.time) && (o.next_validators_hash instanceof Uint8Array || typeof o.next_validators_hash === "string") && (o.proposer_address instanceof Uint8Array || typeof o.proposer_address === "string")); + }, + isAmino(o: any): o is RequestPrepareProposalAmino { + return o && (o.$typeUrl === RequestPrepareProposal.typeUrl || typeof o.max_tx_bytes === "bigint" && Array.isArray(o.txs) && (!o.txs.length || o.txs[0] instanceof Uint8Array || typeof o.txs[0] === "string") && ExtendedCommitInfo.isAmino(o.local_last_commit) && Array.isArray(o.misbehavior) && (!o.misbehavior.length || Misbehavior.isAmino(o.misbehavior[0])) && typeof o.height === "bigint" && Timestamp.isAmino(o.time) && (o.next_validators_hash instanceof Uint8Array || typeof o.next_validators_hash === "string") && (o.proposer_address instanceof Uint8Array || typeof o.proposer_address === "string")); + }, + encode(message: RequestPrepareProposal, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.maxTxBytes !== BigInt(0)) { + writer.uint32(8).int64(message.maxTxBytes); + } + for (const v of message.txs) { + writer.uint32(18).bytes(v!); + } + if (message.localLastCommit !== undefined) { + ExtendedCommitInfo.encode(message.localLastCommit, writer.uint32(26).fork()).ldelim(); + } + for (const v of message.misbehavior) { + Misbehavior.encode(v!, writer.uint32(34).fork()).ldelim(); + } + if (message.height !== BigInt(0)) { + writer.uint32(40).int64(message.height); + } + if (message.time !== undefined) { + Timestamp.encode(toTimestamp(message.time), writer.uint32(50).fork()).ldelim(); + } + if (message.nextValidatorsHash.length !== 0) { + writer.uint32(58).bytes(message.nextValidatorsHash); + } + if (message.proposerAddress.length !== 0) { + writer.uint32(66).bytes(message.proposerAddress); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): RequestPrepareProposal { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseRequestPrepareProposal(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.maxTxBytes = reader.int64(); + break; + case 2: + message.txs.push(reader.bytes()); + break; + case 3: + message.localLastCommit = ExtendedCommitInfo.decode(reader, reader.uint32()); + break; + case 4: + message.misbehavior.push(Misbehavior.decode(reader, reader.uint32())); + break; + case 5: + message.height = reader.int64(); + break; + case 6: + message.time = fromTimestamp(Timestamp.decode(reader, reader.uint32())); + break; + case 7: + message.nextValidatorsHash = reader.bytes(); + break; + case 8: + message.proposerAddress = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): RequestPrepareProposal { + return { + maxTxBytes: isSet(object.maxTxBytes) ? BigInt(object.maxTxBytes.toString()) : BigInt(0), + txs: Array.isArray(object?.txs) ? object.txs.map((e: any) => bytesFromBase64(e)) : [], + localLastCommit: isSet(object.localLastCommit) ? ExtendedCommitInfo.fromJSON(object.localLastCommit) : undefined, + misbehavior: Array.isArray(object?.misbehavior) ? object.misbehavior.map((e: any) => Misbehavior.fromJSON(e)) : [], + height: isSet(object.height) ? BigInt(object.height.toString()) : BigInt(0), + time: isSet(object.time) ? new Date(object.time) : undefined, + nextValidatorsHash: isSet(object.nextValidatorsHash) ? bytesFromBase64(object.nextValidatorsHash) : new Uint8Array(), + proposerAddress: isSet(object.proposerAddress) ? bytesFromBase64(object.proposerAddress) : new Uint8Array() + }; + }, + toJSON(message: RequestPrepareProposal): unknown { + const obj: any = {}; + message.maxTxBytes !== undefined && (obj.maxTxBytes = (message.maxTxBytes || BigInt(0)).toString()); + if (message.txs) { + obj.txs = message.txs.map(e => base64FromBytes(e !== undefined ? e : new Uint8Array())); + } else { + obj.txs = []; + } + message.localLastCommit !== undefined && (obj.localLastCommit = message.localLastCommit ? ExtendedCommitInfo.toJSON(message.localLastCommit) : undefined); + if (message.misbehavior) { + obj.misbehavior = message.misbehavior.map(e => e ? Misbehavior.toJSON(e) : undefined); + } else { + obj.misbehavior = []; + } + message.height !== undefined && (obj.height = (message.height || BigInt(0)).toString()); + message.time !== undefined && (obj.time = message.time.toISOString()); + message.nextValidatorsHash !== undefined && (obj.nextValidatorsHash = base64FromBytes(message.nextValidatorsHash !== undefined ? message.nextValidatorsHash : new Uint8Array())); + message.proposerAddress !== undefined && (obj.proposerAddress = base64FromBytes(message.proposerAddress !== undefined ? message.proposerAddress : new Uint8Array())); + return obj; + }, + fromPartial(object: Partial): RequestPrepareProposal { + const message = createBaseRequestPrepareProposal(); + message.maxTxBytes = object.maxTxBytes !== undefined && object.maxTxBytes !== null ? BigInt(object.maxTxBytes.toString()) : BigInt(0); + message.txs = object.txs?.map(e => e) || []; + message.localLastCommit = object.localLastCommit !== undefined && object.localLastCommit !== null ? ExtendedCommitInfo.fromPartial(object.localLastCommit) : undefined; + message.misbehavior = object.misbehavior?.map(e => Misbehavior.fromPartial(e)) || []; + message.height = object.height !== undefined && object.height !== null ? BigInt(object.height.toString()) : BigInt(0); + message.time = object.time ?? undefined; + message.nextValidatorsHash = object.nextValidatorsHash ?? new Uint8Array(); + message.proposerAddress = object.proposerAddress ?? new Uint8Array(); + return message; + }, + fromAmino(object: RequestPrepareProposalAmino): RequestPrepareProposal { + const message = createBaseRequestPrepareProposal(); + if (object.max_tx_bytes !== undefined && object.max_tx_bytes !== null) { + message.maxTxBytes = BigInt(object.max_tx_bytes); + } + message.txs = object.txs?.map(e => bytesFromBase64(e)) || []; + if (object.local_last_commit !== undefined && object.local_last_commit !== null) { + message.localLastCommit = ExtendedCommitInfo.fromAmino(object.local_last_commit); + } + message.misbehavior = object.misbehavior?.map(e => Misbehavior.fromAmino(e)) || []; + if (object.height !== undefined && object.height !== null) { + message.height = BigInt(object.height); + } + if (object.time !== undefined && object.time !== null) { + message.time = fromTimestamp(Timestamp.fromAmino(object.time)); + } + if (object.next_validators_hash !== undefined && object.next_validators_hash !== null) { + message.nextValidatorsHash = bytesFromBase64(object.next_validators_hash); + } + if (object.proposer_address !== undefined && object.proposer_address !== null) { + message.proposerAddress = bytesFromBase64(object.proposer_address); + } + return message; + }, + toAmino(message: RequestPrepareProposal): RequestPrepareProposalAmino { + const obj: any = {}; + obj.max_tx_bytes = message.maxTxBytes ? message.maxTxBytes.toString() : undefined; + if (message.txs) { + obj.txs = message.txs.map(e => base64FromBytes(e)); + } else { + obj.txs = []; + } + obj.local_last_commit = message.localLastCommit ? ExtendedCommitInfo.toAmino(message.localLastCommit) : undefined; + if (message.misbehavior) { + obj.misbehavior = message.misbehavior.map(e => e ? Misbehavior.toAmino(e) : undefined); + } else { + obj.misbehavior = []; + } + obj.height = message.height ? message.height.toString() : undefined; + obj.time = message.time ? Timestamp.toAmino(toTimestamp(message.time)) : undefined; + obj.next_validators_hash = message.nextValidatorsHash ? base64FromBytes(message.nextValidatorsHash) : undefined; + obj.proposer_address = message.proposerAddress ? base64FromBytes(message.proposerAddress) : undefined; + return obj; + }, + fromAminoMsg(object: RequestPrepareProposalAminoMsg): RequestPrepareProposal { + return RequestPrepareProposal.fromAmino(object.value); + }, + fromProtoMsg(message: RequestPrepareProposalProtoMsg): RequestPrepareProposal { + return RequestPrepareProposal.decode(message.value); + }, + toProto(message: RequestPrepareProposal): Uint8Array { + return RequestPrepareProposal.encode(message).finish(); + }, + toProtoMsg(message: RequestPrepareProposal): RequestPrepareProposalProtoMsg { + return { + typeUrl: "/tendermint.abci.RequestPrepareProposal", + value: RequestPrepareProposal.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(RequestPrepareProposal.typeUrl, RequestPrepareProposal); +function createBaseRequestProcessProposal(): RequestProcessProposal { + return { + txs: [], + proposedLastCommit: CommitInfo.fromPartial({}), + misbehavior: [], + hash: new Uint8Array(), + height: BigInt(0), + time: new Date(), + nextValidatorsHash: new Uint8Array(), + proposerAddress: new Uint8Array() + }; +} +export const RequestProcessProposal = { + typeUrl: "/tendermint.abci.RequestProcessProposal", + is(o: any): o is RequestProcessProposal { + return o && (o.$typeUrl === RequestProcessProposal.typeUrl || Array.isArray(o.txs) && (!o.txs.length || o.txs[0] instanceof Uint8Array || typeof o.txs[0] === "string") && CommitInfo.is(o.proposedLastCommit) && Array.isArray(o.misbehavior) && (!o.misbehavior.length || Misbehavior.is(o.misbehavior[0])) && (o.hash instanceof Uint8Array || typeof o.hash === "string") && typeof o.height === "bigint" && Timestamp.is(o.time) && (o.nextValidatorsHash instanceof Uint8Array || typeof o.nextValidatorsHash === "string") && (o.proposerAddress instanceof Uint8Array || typeof o.proposerAddress === "string")); + }, + isSDK(o: any): o is RequestProcessProposalSDKType { + return o && (o.$typeUrl === RequestProcessProposal.typeUrl || Array.isArray(o.txs) && (!o.txs.length || o.txs[0] instanceof Uint8Array || typeof o.txs[0] === "string") && CommitInfo.isSDK(o.proposed_last_commit) && Array.isArray(o.misbehavior) && (!o.misbehavior.length || Misbehavior.isSDK(o.misbehavior[0])) && (o.hash instanceof Uint8Array || typeof o.hash === "string") && typeof o.height === "bigint" && Timestamp.isSDK(o.time) && (o.next_validators_hash instanceof Uint8Array || typeof o.next_validators_hash === "string") && (o.proposer_address instanceof Uint8Array || typeof o.proposer_address === "string")); + }, + isAmino(o: any): o is RequestProcessProposalAmino { + return o && (o.$typeUrl === RequestProcessProposal.typeUrl || Array.isArray(o.txs) && (!o.txs.length || o.txs[0] instanceof Uint8Array || typeof o.txs[0] === "string") && CommitInfo.isAmino(o.proposed_last_commit) && Array.isArray(o.misbehavior) && (!o.misbehavior.length || Misbehavior.isAmino(o.misbehavior[0])) && (o.hash instanceof Uint8Array || typeof o.hash === "string") && typeof o.height === "bigint" && Timestamp.isAmino(o.time) && (o.next_validators_hash instanceof Uint8Array || typeof o.next_validators_hash === "string") && (o.proposer_address instanceof Uint8Array || typeof o.proposer_address === "string")); + }, + encode(message: RequestProcessProposal, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.txs) { + writer.uint32(10).bytes(v!); + } + if (message.proposedLastCommit !== undefined) { + CommitInfo.encode(message.proposedLastCommit, writer.uint32(18).fork()).ldelim(); + } + for (const v of message.misbehavior) { + Misbehavior.encode(v!, writer.uint32(26).fork()).ldelim(); + } + if (message.hash.length !== 0) { + writer.uint32(34).bytes(message.hash); + } + if (message.height !== BigInt(0)) { + writer.uint32(40).int64(message.height); + } + if (message.time !== undefined) { + Timestamp.encode(toTimestamp(message.time), writer.uint32(50).fork()).ldelim(); + } + if (message.nextValidatorsHash.length !== 0) { + writer.uint32(58).bytes(message.nextValidatorsHash); + } + if (message.proposerAddress.length !== 0) { + writer.uint32(66).bytes(message.proposerAddress); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): RequestProcessProposal { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseRequestProcessProposal(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.txs.push(reader.bytes()); + break; + case 2: + message.proposedLastCommit = CommitInfo.decode(reader, reader.uint32()); + break; + case 3: + message.misbehavior.push(Misbehavior.decode(reader, reader.uint32())); + break; + case 4: + message.hash = reader.bytes(); + break; + case 5: + message.height = reader.int64(); + break; + case 6: + message.time = fromTimestamp(Timestamp.decode(reader, reader.uint32())); + break; + case 7: + message.nextValidatorsHash = reader.bytes(); + break; + case 8: + message.proposerAddress = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): RequestProcessProposal { + return { + txs: Array.isArray(object?.txs) ? object.txs.map((e: any) => bytesFromBase64(e)) : [], + proposedLastCommit: isSet(object.proposedLastCommit) ? CommitInfo.fromJSON(object.proposedLastCommit) : undefined, + misbehavior: Array.isArray(object?.misbehavior) ? object.misbehavior.map((e: any) => Misbehavior.fromJSON(e)) : [], + hash: isSet(object.hash) ? bytesFromBase64(object.hash) : new Uint8Array(), + height: isSet(object.height) ? BigInt(object.height.toString()) : BigInt(0), + time: isSet(object.time) ? new Date(object.time) : undefined, + nextValidatorsHash: isSet(object.nextValidatorsHash) ? bytesFromBase64(object.nextValidatorsHash) : new Uint8Array(), + proposerAddress: isSet(object.proposerAddress) ? bytesFromBase64(object.proposerAddress) : new Uint8Array() + }; + }, + toJSON(message: RequestProcessProposal): unknown { + const obj: any = {}; + if (message.txs) { + obj.txs = message.txs.map(e => base64FromBytes(e !== undefined ? e : new Uint8Array())); + } else { + obj.txs = []; + } + message.proposedLastCommit !== undefined && (obj.proposedLastCommit = message.proposedLastCommit ? CommitInfo.toJSON(message.proposedLastCommit) : undefined); + if (message.misbehavior) { + obj.misbehavior = message.misbehavior.map(e => e ? Misbehavior.toJSON(e) : undefined); + } else { + obj.misbehavior = []; + } + message.hash !== undefined && (obj.hash = base64FromBytes(message.hash !== undefined ? message.hash : new Uint8Array())); + message.height !== undefined && (obj.height = (message.height || BigInt(0)).toString()); + message.time !== undefined && (obj.time = message.time.toISOString()); + message.nextValidatorsHash !== undefined && (obj.nextValidatorsHash = base64FromBytes(message.nextValidatorsHash !== undefined ? message.nextValidatorsHash : new Uint8Array())); + message.proposerAddress !== undefined && (obj.proposerAddress = base64FromBytes(message.proposerAddress !== undefined ? message.proposerAddress : new Uint8Array())); + return obj; + }, + fromPartial(object: Partial): RequestProcessProposal { + const message = createBaseRequestProcessProposal(); + message.txs = object.txs?.map(e => e) || []; + message.proposedLastCommit = object.proposedLastCommit !== undefined && object.proposedLastCommit !== null ? CommitInfo.fromPartial(object.proposedLastCommit) : undefined; + message.misbehavior = object.misbehavior?.map(e => Misbehavior.fromPartial(e)) || []; + message.hash = object.hash ?? new Uint8Array(); + message.height = object.height !== undefined && object.height !== null ? BigInt(object.height.toString()) : BigInt(0); + message.time = object.time ?? undefined; + message.nextValidatorsHash = object.nextValidatorsHash ?? new Uint8Array(); + message.proposerAddress = object.proposerAddress ?? new Uint8Array(); + return message; + }, + fromAmino(object: RequestProcessProposalAmino): RequestProcessProposal { + const message = createBaseRequestProcessProposal(); + message.txs = object.txs?.map(e => bytesFromBase64(e)) || []; + if (object.proposed_last_commit !== undefined && object.proposed_last_commit !== null) { + message.proposedLastCommit = CommitInfo.fromAmino(object.proposed_last_commit); + } + message.misbehavior = object.misbehavior?.map(e => Misbehavior.fromAmino(e)) || []; + if (object.hash !== undefined && object.hash !== null) { + message.hash = bytesFromBase64(object.hash); + } + if (object.height !== undefined && object.height !== null) { + message.height = BigInt(object.height); + } + if (object.time !== undefined && object.time !== null) { + message.time = fromTimestamp(Timestamp.fromAmino(object.time)); + } + if (object.next_validators_hash !== undefined && object.next_validators_hash !== null) { + message.nextValidatorsHash = bytesFromBase64(object.next_validators_hash); + } + if (object.proposer_address !== undefined && object.proposer_address !== null) { + message.proposerAddress = bytesFromBase64(object.proposer_address); + } + return message; + }, + toAmino(message: RequestProcessProposal): RequestProcessProposalAmino { + const obj: any = {}; + if (message.txs) { + obj.txs = message.txs.map(e => base64FromBytes(e)); + } else { + obj.txs = []; + } + obj.proposed_last_commit = message.proposedLastCommit ? CommitInfo.toAmino(message.proposedLastCommit) : undefined; + if (message.misbehavior) { + obj.misbehavior = message.misbehavior.map(e => e ? Misbehavior.toAmino(e) : undefined); + } else { + obj.misbehavior = []; + } + obj.hash = message.hash ? base64FromBytes(message.hash) : undefined; + obj.height = message.height ? message.height.toString() : undefined; + obj.time = message.time ? Timestamp.toAmino(toTimestamp(message.time)) : undefined; + obj.next_validators_hash = message.nextValidatorsHash ? base64FromBytes(message.nextValidatorsHash) : undefined; + obj.proposer_address = message.proposerAddress ? base64FromBytes(message.proposerAddress) : undefined; + return obj; + }, + fromAminoMsg(object: RequestProcessProposalAminoMsg): RequestProcessProposal { + return RequestProcessProposal.fromAmino(object.value); + }, + fromProtoMsg(message: RequestProcessProposalProtoMsg): RequestProcessProposal { + return RequestProcessProposal.decode(message.value); + }, + toProto(message: RequestProcessProposal): Uint8Array { + return RequestProcessProposal.encode(message).finish(); + }, + toProtoMsg(message: RequestProcessProposal): RequestProcessProposalProtoMsg { + return { + typeUrl: "/tendermint.abci.RequestProcessProposal", + value: RequestProcessProposal.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(RequestProcessProposal.typeUrl, RequestProcessProposal); +function createBaseResponse(): Response { + return { + exception: undefined, + echo: undefined, + flush: undefined, + info: undefined, + initChain: undefined, + query: undefined, + beginBlock: undefined, + checkTx: undefined, + deliverTx: undefined, + endBlock: undefined, + commit: undefined, + listSnapshots: undefined, + offerSnapshot: undefined, + loadSnapshotChunk: undefined, + applySnapshotChunk: undefined, + prepareProposal: undefined, + processProposal: undefined + }; +} +export const Response = { + typeUrl: "/tendermint.abci.Response", + is(o: any): o is Response { + return o && o.$typeUrl === Response.typeUrl; + }, + isSDK(o: any): o is ResponseSDKType { + return o && o.$typeUrl === Response.typeUrl; + }, + isAmino(o: any): o is ResponseAmino { + return o && o.$typeUrl === Response.typeUrl; + }, + encode(message: Response, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.exception !== undefined) { + ResponseException.encode(message.exception, writer.uint32(10).fork()).ldelim(); } if (message.echo !== undefined) { ResponseEcho.encode(message.echo, writer.uint32(18).fork()).ldelim(); @@ -2708,9 +3645,6 @@ export const Response = { if (message.info !== undefined) { ResponseInfo.encode(message.info, writer.uint32(34).fork()).ldelim(); } - if (message.setOption !== undefined) { - ResponseSetOption.encode(message.setOption, writer.uint32(42).fork()).ldelim(); - } if (message.initChain !== undefined) { ResponseInitChain.encode(message.initChain, writer.uint32(50).fork()).ldelim(); } @@ -2744,6 +3678,12 @@ export const Response = { if (message.applySnapshotChunk !== undefined) { ResponseApplySnapshotChunk.encode(message.applySnapshotChunk, writer.uint32(130).fork()).ldelim(); } + if (message.prepareProposal !== undefined) { + ResponsePrepareProposal.encode(message.prepareProposal, writer.uint32(138).fork()).ldelim(); + } + if (message.processProposal !== undefined) { + ResponseProcessProposal.encode(message.processProposal, writer.uint32(146).fork()).ldelim(); + } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): Response { @@ -2765,9 +3705,6 @@ export const Response = { case 4: message.info = ResponseInfo.decode(reader, reader.uint32()); break; - case 5: - message.setOption = ResponseSetOption.decode(reader, reader.uint32()); - break; case 6: message.initChain = ResponseInitChain.decode(reader, reader.uint32()); break; @@ -2801,6 +3738,12 @@ export const Response = { case 16: message.applySnapshotChunk = ResponseApplySnapshotChunk.decode(reader, reader.uint32()); break; + case 17: + message.prepareProposal = ResponsePrepareProposal.decode(reader, reader.uint32()); + break; + case 18: + message.processProposal = ResponseProcessProposal.decode(reader, reader.uint32()); + break; default: reader.skipType(tag & 7); break; @@ -2808,13 +3751,54 @@ export const Response = { } return message; }, + fromJSON(object: any): Response { + return { + 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, + 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, + 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, + loadSnapshotChunk: isSet(object.loadSnapshotChunk) ? ResponseLoadSnapshotChunk.fromJSON(object.loadSnapshotChunk) : undefined, + applySnapshotChunk: isSet(object.applySnapshotChunk) ? ResponseApplySnapshotChunk.fromJSON(object.applySnapshotChunk) : undefined, + prepareProposal: isSet(object.prepareProposal) ? ResponsePrepareProposal.fromJSON(object.prepareProposal) : undefined, + processProposal: isSet(object.processProposal) ? ResponseProcessProposal.fromJSON(object.processProposal) : undefined + }; + }, + toJSON(message: Response): unknown { + 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); + message.initChain !== 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); + message.checkTx !== undefined && (obj.checkTx = message.checkTx ? ResponseCheckTx.toJSON(message.checkTx) : undefined); + 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); + 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); + message.prepareProposal !== undefined && (obj.prepareProposal = message.prepareProposal ? ResponsePrepareProposal.toJSON(message.prepareProposal) : undefined); + message.processProposal !== undefined && (obj.processProposal = message.processProposal ? ResponseProcessProposal.toJSON(message.processProposal) : undefined); + return obj; + }, fromPartial(object: Partial): 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; @@ -2826,27 +3810,64 @@ export const Response = { 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; + message.prepareProposal = object.prepareProposal !== undefined && object.prepareProposal !== null ? ResponsePrepareProposal.fromPartial(object.prepareProposal) : undefined; + message.processProposal = object.processProposal !== undefined && object.processProposal !== null ? ResponseProcessProposal.fromPartial(object.processProposal) : undefined; return message; }, fromAmino(object: ResponseAmino): Response { - return { - exception: object?.exception ? ResponseException.fromAmino(object.exception) : undefined, - echo: object?.echo ? ResponseEcho.fromAmino(object.echo) : undefined, - flush: object?.flush ? ResponseFlush.fromAmino(object.flush) : undefined, - info: object?.info ? ResponseInfo.fromAmino(object.info) : undefined, - setOption: object?.set_option ? ResponseSetOption.fromAmino(object.set_option) : undefined, - initChain: object?.init_chain ? ResponseInitChain.fromAmino(object.init_chain) : undefined, - query: object?.query ? ResponseQuery.fromAmino(object.query) : undefined, - beginBlock: object?.begin_block ? ResponseBeginBlock.fromAmino(object.begin_block) : undefined, - checkTx: object?.check_tx ? ResponseCheckTx.fromAmino(object.check_tx) : undefined, - deliverTx: object?.deliver_tx ? ResponseDeliverTx.fromAmino(object.deliver_tx) : undefined, - endBlock: object?.end_block ? ResponseEndBlock.fromAmino(object.end_block) : undefined, - commit: object?.commit ? ResponseCommit.fromAmino(object.commit) : undefined, - listSnapshots: object?.list_snapshots ? ResponseListSnapshots.fromAmino(object.list_snapshots) : undefined, - offerSnapshot: object?.offer_snapshot ? ResponseOfferSnapshot.fromAmino(object.offer_snapshot) : undefined, - loadSnapshotChunk: object?.load_snapshot_chunk ? ResponseLoadSnapshotChunk.fromAmino(object.load_snapshot_chunk) : undefined, - applySnapshotChunk: object?.apply_snapshot_chunk ? ResponseApplySnapshotChunk.fromAmino(object.apply_snapshot_chunk) : undefined - }; + const message = createBaseResponse(); + if (object.exception !== undefined && object.exception !== null) { + message.exception = ResponseException.fromAmino(object.exception); + } + if (object.echo !== undefined && object.echo !== null) { + message.echo = ResponseEcho.fromAmino(object.echo); + } + if (object.flush !== undefined && object.flush !== null) { + message.flush = ResponseFlush.fromAmino(object.flush); + } + if (object.info !== undefined && object.info !== null) { + message.info = ResponseInfo.fromAmino(object.info); + } + if (object.init_chain !== undefined && object.init_chain !== null) { + message.initChain = ResponseInitChain.fromAmino(object.init_chain); + } + if (object.query !== undefined && object.query !== null) { + message.query = ResponseQuery.fromAmino(object.query); + } + if (object.begin_block !== undefined && object.begin_block !== null) { + message.beginBlock = ResponseBeginBlock.fromAmino(object.begin_block); + } + if (object.check_tx !== undefined && object.check_tx !== null) { + message.checkTx = ResponseCheckTx.fromAmino(object.check_tx); + } + if (object.deliver_tx !== undefined && object.deliver_tx !== null) { + message.deliverTx = ResponseDeliverTx.fromAmino(object.deliver_tx); + } + if (object.end_block !== undefined && object.end_block !== null) { + message.endBlock = ResponseEndBlock.fromAmino(object.end_block); + } + if (object.commit !== undefined && object.commit !== null) { + message.commit = ResponseCommit.fromAmino(object.commit); + } + if (object.list_snapshots !== undefined && object.list_snapshots !== null) { + message.listSnapshots = ResponseListSnapshots.fromAmino(object.list_snapshots); + } + if (object.offer_snapshot !== undefined && object.offer_snapshot !== null) { + message.offerSnapshot = ResponseOfferSnapshot.fromAmino(object.offer_snapshot); + } + if (object.load_snapshot_chunk !== undefined && object.load_snapshot_chunk !== null) { + message.loadSnapshotChunk = ResponseLoadSnapshotChunk.fromAmino(object.load_snapshot_chunk); + } + if (object.apply_snapshot_chunk !== undefined && object.apply_snapshot_chunk !== null) { + message.applySnapshotChunk = ResponseApplySnapshotChunk.fromAmino(object.apply_snapshot_chunk); + } + if (object.prepare_proposal !== undefined && object.prepare_proposal !== null) { + message.prepareProposal = ResponsePrepareProposal.fromAmino(object.prepare_proposal); + } + if (object.process_proposal !== undefined && object.process_proposal !== null) { + message.processProposal = ResponseProcessProposal.fromAmino(object.process_proposal); + } + return message; }, toAmino(message: Response): ResponseAmino { const obj: any = {}; @@ -2854,7 +3875,6 @@ export const Response = { obj.echo = message.echo ? ResponseEcho.toAmino(message.echo) : undefined; obj.flush = message.flush ? ResponseFlush.toAmino(message.flush) : undefined; obj.info = message.info ? ResponseInfo.toAmino(message.info) : undefined; - obj.set_option = message.setOption ? ResponseSetOption.toAmino(message.setOption) : undefined; obj.init_chain = message.initChain ? ResponseInitChain.toAmino(message.initChain) : undefined; obj.query = message.query ? ResponseQuery.toAmino(message.query) : undefined; obj.begin_block = message.beginBlock ? ResponseBeginBlock.toAmino(message.beginBlock) : undefined; @@ -2866,6 +3886,8 @@ export const Response = { obj.offer_snapshot = message.offerSnapshot ? ResponseOfferSnapshot.toAmino(message.offerSnapshot) : undefined; obj.load_snapshot_chunk = message.loadSnapshotChunk ? ResponseLoadSnapshotChunk.toAmino(message.loadSnapshotChunk) : undefined; obj.apply_snapshot_chunk = message.applySnapshotChunk ? ResponseApplySnapshotChunk.toAmino(message.applySnapshotChunk) : undefined; + obj.prepare_proposal = message.prepareProposal ? ResponsePrepareProposal.toAmino(message.prepareProposal) : undefined; + obj.process_proposal = message.processProposal ? ResponseProcessProposal.toAmino(message.processProposal) : undefined; return obj; }, fromAminoMsg(object: ResponseAminoMsg): Response { @@ -2884,6 +3906,7 @@ export const Response = { }; } }; +GlobalDecoderRegistry.register(Response.typeUrl, Response); function createBaseResponseException(): ResponseException { return { error: "" @@ -2891,6 +3914,15 @@ function createBaseResponseException(): ResponseException { } export const ResponseException = { typeUrl: "/tendermint.abci.ResponseException", + is(o: any): o is ResponseException { + return o && (o.$typeUrl === ResponseException.typeUrl || typeof o.error === "string"); + }, + isSDK(o: any): o is ResponseExceptionSDKType { + return o && (o.$typeUrl === ResponseException.typeUrl || typeof o.error === "string"); + }, + isAmino(o: any): o is ResponseExceptionAmino { + return o && (o.$typeUrl === ResponseException.typeUrl || typeof o.error === "string"); + }, encode(message: ResponseException, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.error !== "") { writer.uint32(10).string(message.error); @@ -2914,15 +3946,27 @@ export const ResponseException = { } return message; }, + fromJSON(object: any): ResponseException { + return { + error: isSet(object.error) ? String(object.error) : "" + }; + }, + toJSON(message: ResponseException): unknown { + const obj: any = {}; + message.error !== undefined && (obj.error = message.error); + return obj; + }, fromPartial(object: Partial): ResponseException { const message = createBaseResponseException(); message.error = object.error ?? ""; return message; }, fromAmino(object: ResponseExceptionAmino): ResponseException { - return { - error: object.error - }; + const message = createBaseResponseException(); + if (object.error !== undefined && object.error !== null) { + message.error = object.error; + } + return message; }, toAmino(message: ResponseException): ResponseExceptionAmino { const obj: any = {}; @@ -2945,6 +3989,7 @@ export const ResponseException = { }; } }; +GlobalDecoderRegistry.register(ResponseException.typeUrl, ResponseException); function createBaseResponseEcho(): ResponseEcho { return { message: "" @@ -2952,6 +3997,15 @@ function createBaseResponseEcho(): ResponseEcho { } export const ResponseEcho = { typeUrl: "/tendermint.abci.ResponseEcho", + is(o: any): o is ResponseEcho { + return o && (o.$typeUrl === ResponseEcho.typeUrl || typeof o.message === "string"); + }, + isSDK(o: any): o is ResponseEchoSDKType { + return o && (o.$typeUrl === ResponseEcho.typeUrl || typeof o.message === "string"); + }, + isAmino(o: any): o is ResponseEchoAmino { + return o && (o.$typeUrl === ResponseEcho.typeUrl || typeof o.message === "string"); + }, encode(message: ResponseEcho, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.message !== "") { writer.uint32(10).string(message.message); @@ -2975,15 +4029,27 @@ export const ResponseEcho = { } return message; }, + fromJSON(object: any): ResponseEcho { + return { + message: isSet(object.message) ? String(object.message) : "" + }; + }, + toJSON(message: ResponseEcho): unknown { + const obj: any = {}; + message.message !== undefined && (obj.message = message.message); + return obj; + }, fromPartial(object: Partial): ResponseEcho { const message = createBaseResponseEcho(); message.message = object.message ?? ""; return message; }, fromAmino(object: ResponseEchoAmino): ResponseEcho { - return { - message: object.message - }; + const message = createBaseResponseEcho(); + if (object.message !== undefined && object.message !== null) { + message.message = object.message; + } + return message; }, toAmino(message: ResponseEcho): ResponseEchoAmino { const obj: any = {}; @@ -3006,11 +4072,21 @@ export const ResponseEcho = { }; } }; +GlobalDecoderRegistry.register(ResponseEcho.typeUrl, ResponseEcho); function createBaseResponseFlush(): ResponseFlush { return {}; } export const ResponseFlush = { typeUrl: "/tendermint.abci.ResponseFlush", + is(o: any): o is ResponseFlush { + return o && o.$typeUrl === ResponseFlush.typeUrl; + }, + isSDK(o: any): o is ResponseFlushSDKType { + return o && o.$typeUrl === ResponseFlush.typeUrl; + }, + isAmino(o: any): o is ResponseFlushAmino { + return o && o.$typeUrl === ResponseFlush.typeUrl; + }, encode(_: ResponseFlush, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, @@ -3028,12 +4104,20 @@ export const ResponseFlush = { } return message; }, + fromJSON(_: any): ResponseFlush { + return {}; + }, + toJSON(_: ResponseFlush): unknown { + const obj: any = {}; + return obj; + }, fromPartial(_: Partial): ResponseFlush { const message = createBaseResponseFlush(); return message; }, fromAmino(_: ResponseFlushAmino): ResponseFlush { - return {}; + const message = createBaseResponseFlush(); + return message; }, toAmino(_: ResponseFlush): ResponseFlushAmino { const obj: any = {}; @@ -3055,6 +4139,7 @@ export const ResponseFlush = { }; } }; +GlobalDecoderRegistry.register(ResponseFlush.typeUrl, ResponseFlush); function createBaseResponseInfo(): ResponseInfo { return { data: "", @@ -3066,6 +4151,15 @@ function createBaseResponseInfo(): ResponseInfo { } export const ResponseInfo = { typeUrl: "/tendermint.abci.ResponseInfo", + is(o: any): o is ResponseInfo { + return o && (o.$typeUrl === ResponseInfo.typeUrl || typeof o.data === "string" && typeof o.version === "string" && typeof o.appVersion === "bigint" && typeof o.lastBlockHeight === "bigint" && (o.lastBlockAppHash instanceof Uint8Array || typeof o.lastBlockAppHash === "string")); + }, + isSDK(o: any): o is ResponseInfoSDKType { + return o && (o.$typeUrl === ResponseInfo.typeUrl || typeof o.data === "string" && typeof o.version === "string" && typeof o.app_version === "bigint" && typeof o.last_block_height === "bigint" && (o.last_block_app_hash instanceof Uint8Array || typeof o.last_block_app_hash === "string")); + }, + isAmino(o: any): o is ResponseInfoAmino { + return o && (o.$typeUrl === ResponseInfo.typeUrl || typeof o.data === "string" && typeof o.version === "string" && typeof o.app_version === "bigint" && typeof o.last_block_height === "bigint" && (o.last_block_app_hash instanceof Uint8Array || typeof o.last_block_app_hash === "string")); + }, encode(message: ResponseInfo, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.data !== "") { writer.uint32(10).string(message.data); @@ -3113,6 +4207,24 @@ export const ResponseInfo = { } 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) ? BigInt(object.appVersion.toString()) : BigInt(0), + lastBlockHeight: isSet(object.lastBlockHeight) ? BigInt(object.lastBlockHeight.toString()) : BigInt(0), + 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 || BigInt(0)).toString()); + message.lastBlockHeight !== undefined && (obj.lastBlockHeight = (message.lastBlockHeight || BigInt(0)).toString()); + message.lastBlockAppHash !== undefined && (obj.lastBlockAppHash = base64FromBytes(message.lastBlockAppHash !== undefined ? message.lastBlockAppHash : new Uint8Array())); + return obj; + }, fromPartial(object: Partial): ResponseInfo { const message = createBaseResponseInfo(); message.data = object.data ?? ""; @@ -3123,13 +4235,23 @@ export const ResponseInfo = { return message; }, fromAmino(object: ResponseInfoAmino): ResponseInfo { - return { - data: object.data, - version: object.version, - appVersion: BigInt(object.app_version), - lastBlockHeight: BigInt(object.last_block_height), - lastBlockAppHash: object.last_block_app_hash - }; + const message = createBaseResponseInfo(); + if (object.data !== undefined && object.data !== null) { + message.data = object.data; + } + if (object.version !== undefined && object.version !== null) { + message.version = object.version; + } + if (object.app_version !== undefined && object.app_version !== null) { + message.appVersion = BigInt(object.app_version); + } + if (object.last_block_height !== undefined && object.last_block_height !== null) { + message.lastBlockHeight = BigInt(object.last_block_height); + } + if (object.last_block_app_hash !== undefined && object.last_block_app_hash !== null) { + message.lastBlockAppHash = bytesFromBase64(object.last_block_app_hash); + } + return message; }, toAmino(message: ResponseInfo): ResponseInfoAmino { const obj: any = {}; @@ -3137,7 +4259,7 @@ export const ResponseInfo = { obj.version = message.version; obj.app_version = message.appVersion ? message.appVersion.toString() : undefined; obj.last_block_height = message.lastBlockHeight ? message.lastBlockHeight.toString() : undefined; - obj.last_block_app_hash = message.lastBlockAppHash; + obj.last_block_app_hash = message.lastBlockAppHash ? base64FromBytes(message.lastBlockAppHash) : undefined; return obj; }, fromAminoMsg(object: ResponseInfoAminoMsg): ResponseInfo { @@ -3156,96 +4278,25 @@ export const ResponseInfo = { }; } }; -function createBaseResponseSetOption(): ResponseSetOption { - return { - code: 0, - log: "", - info: "" - }; -} -export const ResponseSetOption = { - typeUrl: "/tendermint.abci.ResponseSetOption", - encode(message: ResponseSetOption, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { - if (message.code !== 0) { - writer.uint32(8).uint32(message.code); - } - if (message.log !== "") { - writer.uint32(26).string(message.log); - } - if (message.info !== "") { - writer.uint32(34).string(message.info); - } - return writer; - }, - decode(input: BinaryReader | Uint8Array, length?: number): ResponseSetOption { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseResponseSetOption(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.code = reader.uint32(); - break; - case 3: - message.log = reader.string(); - break; - case 4: - message.info = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - fromPartial(object: Partial): ResponseSetOption { - const message = createBaseResponseSetOption(); - message.code = object.code ?? 0; - message.log = object.log ?? ""; - message.info = object.info ?? ""; - return message; - }, - fromAmino(object: ResponseSetOptionAmino): ResponseSetOption { - return { - code: object.code, - log: object.log, - info: object.info - }; - }, - toAmino(message: ResponseSetOption): ResponseSetOptionAmino { - const obj: any = {}; - obj.code = message.code; - obj.log = message.log; - obj.info = message.info; - return obj; - }, - fromAminoMsg(object: ResponseSetOptionAminoMsg): ResponseSetOption { - return ResponseSetOption.fromAmino(object.value); - }, - fromProtoMsg(message: ResponseSetOptionProtoMsg): ResponseSetOption { - return ResponseSetOption.decode(message.value); - }, - toProto(message: ResponseSetOption): Uint8Array { - return ResponseSetOption.encode(message).finish(); - }, - toProtoMsg(message: ResponseSetOption): ResponseSetOptionProtoMsg { - return { - typeUrl: "/tendermint.abci.ResponseSetOption", - value: ResponseSetOption.encode(message).finish() - }; - } -}; +GlobalDecoderRegistry.register(ResponseInfo.typeUrl, ResponseInfo); function createBaseResponseInitChain(): ResponseInitChain { return { - consensusParams: ConsensusParams.fromPartial({}), + consensusParams: undefined, validators: [], appHash: new Uint8Array() }; } export const ResponseInitChain = { typeUrl: "/tendermint.abci.ResponseInitChain", + is(o: any): o is ResponseInitChain { + return o && (o.$typeUrl === ResponseInitChain.typeUrl || Array.isArray(o.validators) && (!o.validators.length || ValidatorUpdate.is(o.validators[0])) && (o.appHash instanceof Uint8Array || typeof o.appHash === "string")); + }, + isSDK(o: any): o is ResponseInitChainSDKType { + return o && (o.$typeUrl === ResponseInitChain.typeUrl || Array.isArray(o.validators) && (!o.validators.length || ValidatorUpdate.isSDK(o.validators[0])) && (o.app_hash instanceof Uint8Array || typeof o.app_hash === "string")); + }, + isAmino(o: any): o is ResponseInitChainAmino { + return o && (o.$typeUrl === ResponseInitChain.typeUrl || Array.isArray(o.validators) && (!o.validators.length || ValidatorUpdate.isAmino(o.validators[0])) && (o.app_hash instanceof Uint8Array || typeof o.app_hash === "string")); + }, encode(message: ResponseInitChain, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.consensusParams !== undefined) { ConsensusParams.encode(message.consensusParams, writer.uint32(10).fork()).ldelim(); @@ -3281,6 +4332,24 @@ export const ResponseInitChain = { } return message; }, + fromJSON(object: any): ResponseInitChain { + return { + 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() + }; + }, + toJSON(message: ResponseInitChain): unknown { + const obj: any = {}; + 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); + } else { + obj.validators = []; + } + message.appHash !== undefined && (obj.appHash = base64FromBytes(message.appHash !== undefined ? message.appHash : new Uint8Array())); + return obj; + }, fromPartial(object: Partial): ResponseInitChain { const message = createBaseResponseInitChain(); message.consensusParams = object.consensusParams !== undefined && object.consensusParams !== null ? ConsensusParams.fromPartial(object.consensusParams) : undefined; @@ -3289,11 +4358,15 @@ export const ResponseInitChain = { return message; }, fromAmino(object: ResponseInitChainAmino): ResponseInitChain { - return { - consensusParams: object?.consensus_params ? ConsensusParams.fromAmino(object.consensus_params) : undefined, - validators: Array.isArray(object?.validators) ? object.validators.map((e: any) => ValidatorUpdate.fromAmino(e)) : [], - appHash: object.app_hash - }; + const message = createBaseResponseInitChain(); + if (object.consensus_params !== undefined && object.consensus_params !== null) { + message.consensusParams = ConsensusParams.fromAmino(object.consensus_params); + } + message.validators = object.validators?.map(e => ValidatorUpdate.fromAmino(e)) || []; + if (object.app_hash !== undefined && object.app_hash !== null) { + message.appHash = bytesFromBase64(object.app_hash); + } + return message; }, toAmino(message: ResponseInitChain): ResponseInitChainAmino { const obj: any = {}; @@ -3303,7 +4376,7 @@ export const ResponseInitChain = { } else { obj.validators = []; } - obj.app_hash = message.appHash; + obj.app_hash = message.appHash ? base64FromBytes(message.appHash) : undefined; return obj; }, fromAminoMsg(object: ResponseInitChainAminoMsg): ResponseInitChain { @@ -3322,6 +4395,7 @@ export const ResponseInitChain = { }; } }; +GlobalDecoderRegistry.register(ResponseInitChain.typeUrl, ResponseInitChain); function createBaseResponseQuery(): ResponseQuery { return { code: 0, @@ -3330,13 +4404,22 @@ function createBaseResponseQuery(): ResponseQuery { index: BigInt(0), key: new Uint8Array(), value: new Uint8Array(), - proofOps: ProofOps.fromPartial({}), + proofOps: undefined, height: BigInt(0), codespace: "" }; } export const ResponseQuery = { typeUrl: "/tendermint.abci.ResponseQuery", + is(o: any): o is ResponseQuery { + return o && (o.$typeUrl === ResponseQuery.typeUrl || typeof o.code === "number" && typeof o.log === "string" && typeof o.info === "string" && typeof o.index === "bigint" && (o.key instanceof Uint8Array || typeof o.key === "string") && (o.value instanceof Uint8Array || typeof o.value === "string") && typeof o.height === "bigint" && typeof o.codespace === "string"); + }, + isSDK(o: any): o is ResponseQuerySDKType { + return o && (o.$typeUrl === ResponseQuery.typeUrl || typeof o.code === "number" && typeof o.log === "string" && typeof o.info === "string" && typeof o.index === "bigint" && (o.key instanceof Uint8Array || typeof o.key === "string") && (o.value instanceof Uint8Array || typeof o.value === "string") && typeof o.height === "bigint" && typeof o.codespace === "string"); + }, + isAmino(o: any): o is ResponseQueryAmino { + return o && (o.$typeUrl === ResponseQuery.typeUrl || typeof o.code === "number" && typeof o.log === "string" && typeof o.info === "string" && typeof o.index === "bigint" && (o.key instanceof Uint8Array || typeof o.key === "string") && (o.value instanceof Uint8Array || typeof o.value === "string") && typeof o.height === "bigint" && typeof o.codespace === "string"); + }, encode(message: ResponseQuery, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.code !== 0) { writer.uint32(8).uint32(message.code); @@ -3408,6 +4491,32 @@ export const ResponseQuery = { } return message; }, + fromJSON(object: any): ResponseQuery { + return { + code: isSet(object.code) ? Number(object.code) : 0, + log: isSet(object.log) ? String(object.log) : "", + info: isSet(object.info) ? String(object.info) : "", + index: isSet(object.index) ? BigInt(object.index.toString()) : BigInt(0), + key: isSet(object.key) ? bytesFromBase64(object.key) : new Uint8Array(), + value: isSet(object.value) ? bytesFromBase64(object.value) : new Uint8Array(), + proofOps: isSet(object.proofOps) ? ProofOps.fromJSON(object.proofOps) : undefined, + height: isSet(object.height) ? BigInt(object.height.toString()) : BigInt(0), + 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 || BigInt(0)).toString()); + message.key !== undefined && (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 || BigInt(0)).toString()); + message.codespace !== undefined && (obj.codespace = message.codespace); + return obj; + }, fromPartial(object: Partial): ResponseQuery { const message = createBaseResponseQuery(); message.code = object.code ?? 0; @@ -3422,17 +4531,35 @@ export const ResponseQuery = { return message; }, fromAmino(object: ResponseQueryAmino): ResponseQuery { - return { - code: object.code, - log: object.log, - info: object.info, - index: BigInt(object.index), - key: object.key, - value: object.value, - proofOps: object?.proof_ops ? ProofOps.fromAmino(object.proof_ops) : undefined, - height: BigInt(object.height), - codespace: object.codespace - }; + const message = createBaseResponseQuery(); + if (object.code !== undefined && object.code !== null) { + message.code = object.code; + } + if (object.log !== undefined && object.log !== null) { + message.log = object.log; + } + if (object.info !== undefined && object.info !== null) { + message.info = object.info; + } + if (object.index !== undefined && object.index !== null) { + message.index = BigInt(object.index); + } + if (object.key !== undefined && object.key !== null) { + message.key = bytesFromBase64(object.key); + } + if (object.value !== undefined && object.value !== null) { + message.value = bytesFromBase64(object.value); + } + if (object.proof_ops !== undefined && object.proof_ops !== null) { + message.proofOps = ProofOps.fromAmino(object.proof_ops); + } + if (object.height !== undefined && object.height !== null) { + message.height = BigInt(object.height); + } + if (object.codespace !== undefined && object.codespace !== null) { + message.codespace = object.codespace; + } + return message; }, toAmino(message: ResponseQuery): ResponseQueryAmino { const obj: any = {}; @@ -3440,8 +4567,8 @@ export const ResponseQuery = { obj.log = message.log; obj.info = message.info; obj.index = message.index ? message.index.toString() : undefined; - obj.key = message.key; - obj.value = message.value; + obj.key = message.key ? base64FromBytes(message.key) : undefined; + obj.value = message.value ? base64FromBytes(message.value) : undefined; obj.proof_ops = message.proofOps ? ProofOps.toAmino(message.proofOps) : undefined; obj.height = message.height ? message.height.toString() : undefined; obj.codespace = message.codespace; @@ -3463,6 +4590,7 @@ export const ResponseQuery = { }; } }; +GlobalDecoderRegistry.register(ResponseQuery.typeUrl, ResponseQuery); function createBaseResponseBeginBlock(): ResponseBeginBlock { return { events: [] @@ -3470,6 +4598,15 @@ function createBaseResponseBeginBlock(): ResponseBeginBlock { } export const ResponseBeginBlock = { typeUrl: "/tendermint.abci.ResponseBeginBlock", + is(o: any): o is ResponseBeginBlock { + return o && (o.$typeUrl === ResponseBeginBlock.typeUrl || Array.isArray(o.events) && (!o.events.length || Event.is(o.events[0]))); + }, + isSDK(o: any): o is ResponseBeginBlockSDKType { + return o && (o.$typeUrl === ResponseBeginBlock.typeUrl || Array.isArray(o.events) && (!o.events.length || Event.isSDK(o.events[0]))); + }, + isAmino(o: any): o is ResponseBeginBlockAmino { + return o && (o.$typeUrl === ResponseBeginBlock.typeUrl || Array.isArray(o.events) && (!o.events.length || Event.isAmino(o.events[0]))); + }, encode(message: ResponseBeginBlock, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.events) { Event.encode(v!, writer.uint32(10).fork()).ldelim(); @@ -3491,7 +4628,21 @@ export const ResponseBeginBlock = { break; } } - return message; + return message; + }, + fromJSON(object: any): ResponseBeginBlock { + return { + events: Array.isArray(object?.events) ? object.events.map((e: any) => Event.fromJSON(e)) : [] + }; + }, + toJSON(message: ResponseBeginBlock): unknown { + const obj: any = {}; + if (message.events) { + obj.events = message.events.map(e => e ? Event.toJSON(e) : undefined); + } else { + obj.events = []; + } + return obj; }, fromPartial(object: Partial): ResponseBeginBlock { const message = createBaseResponseBeginBlock(); @@ -3499,9 +4650,9 @@ export const ResponseBeginBlock = { return message; }, fromAmino(object: ResponseBeginBlockAmino): ResponseBeginBlock { - return { - events: Array.isArray(object?.events) ? object.events.map((e: any) => Event.fromAmino(e)) : [] - }; + const message = createBaseResponseBeginBlock(); + message.events = object.events?.map(e => Event.fromAmino(e)) || []; + return message; }, toAmino(message: ResponseBeginBlock): ResponseBeginBlockAmino { const obj: any = {}; @@ -3528,6 +4679,7 @@ export const ResponseBeginBlock = { }; } }; +GlobalDecoderRegistry.register(ResponseBeginBlock.typeUrl, ResponseBeginBlock); function createBaseResponseCheckTx(): ResponseCheckTx { return { code: 0, @@ -3537,11 +4689,23 @@ function createBaseResponseCheckTx(): ResponseCheckTx { gasWanted: BigInt(0), gasUsed: BigInt(0), events: [], - codespace: "" + codespace: "", + sender: "", + priority: BigInt(0), + mempoolError: "" }; } export const ResponseCheckTx = { typeUrl: "/tendermint.abci.ResponseCheckTx", + is(o: any): o is ResponseCheckTx { + return o && (o.$typeUrl === ResponseCheckTx.typeUrl || typeof o.code === "number" && (o.data instanceof Uint8Array || typeof o.data === "string") && typeof o.log === "string" && typeof o.info === "string" && typeof o.gasWanted === "bigint" && typeof o.gasUsed === "bigint" && Array.isArray(o.events) && (!o.events.length || Event.is(o.events[0])) && typeof o.codespace === "string" && typeof o.sender === "string" && typeof o.priority === "bigint" && typeof o.mempoolError === "string"); + }, + isSDK(o: any): o is ResponseCheckTxSDKType { + return o && (o.$typeUrl === ResponseCheckTx.typeUrl || typeof o.code === "number" && (o.data instanceof Uint8Array || typeof o.data === "string") && typeof o.log === "string" && typeof o.info === "string" && typeof o.gas_wanted === "bigint" && typeof o.gas_used === "bigint" && Array.isArray(o.events) && (!o.events.length || Event.isSDK(o.events[0])) && typeof o.codespace === "string" && typeof o.sender === "string" && typeof o.priority === "bigint" && typeof o.mempool_error === "string"); + }, + isAmino(o: any): o is ResponseCheckTxAmino { + return o && (o.$typeUrl === ResponseCheckTx.typeUrl || typeof o.code === "number" && (o.data instanceof Uint8Array || typeof o.data === "string") && typeof o.log === "string" && typeof o.info === "string" && typeof o.gas_wanted === "bigint" && typeof o.gas_used === "bigint" && Array.isArray(o.events) && (!o.events.length || Event.isAmino(o.events[0])) && typeof o.codespace === "string" && typeof o.sender === "string" && typeof o.priority === "bigint" && typeof o.mempool_error === "string"); + }, encode(message: ResponseCheckTx, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.code !== 0) { writer.uint32(8).uint32(message.code); @@ -3567,6 +4731,15 @@ export const ResponseCheckTx = { if (message.codespace !== "") { writer.uint32(66).string(message.codespace); } + if (message.sender !== "") { + writer.uint32(74).string(message.sender); + } + if (message.priority !== BigInt(0)) { + writer.uint32(80).int64(message.priority); + } + if (message.mempoolError !== "") { + writer.uint32(90).string(message.mempoolError); + } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): ResponseCheckTx { @@ -3600,6 +4773,15 @@ export const ResponseCheckTx = { case 8: message.codespace = reader.string(); break; + case 9: + message.sender = reader.string(); + break; + case 10: + message.priority = reader.int64(); + break; + case 11: + message.mempoolError = reader.string(); + break; default: reader.skipType(tag & 7); break; @@ -3607,6 +4789,40 @@ export const ResponseCheckTx = { } return message; }, + fromJSON(object: any): ResponseCheckTx { + return { + code: isSet(object.code) ? Number(object.code) : 0, + 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) ? BigInt(object.gas_wanted.toString()) : BigInt(0), + gasUsed: isSet(object.gas_used) ? BigInt(object.gas_used.toString()) : BigInt(0), + 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) ? BigInt(object.priority.toString()) : BigInt(0), + mempoolError: isSet(object.mempoolError) ? String(object.mempoolError) : "" + }; + }, + toJSON(message: ResponseCheckTx): unknown { + 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 || BigInt(0)).toString()); + message.gasUsed !== undefined && (obj.gas_used = (message.gasUsed || BigInt(0)).toString()); + if (message.events) { + 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 || BigInt(0)).toString()); + message.mempoolError !== undefined && (obj.mempoolError = message.mempoolError); + return obj; + }, fromPartial(object: Partial): ResponseCheckTx { const message = createBaseResponseCheckTx(); message.code = object.code ?? 0; @@ -3617,24 +4833,50 @@ export const ResponseCheckTx = { message.gasUsed = object.gasUsed !== undefined && object.gasUsed !== null ? BigInt(object.gasUsed.toString()) : BigInt(0); 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 ? BigInt(object.priority.toString()) : BigInt(0); + message.mempoolError = object.mempoolError ?? ""; return message; }, fromAmino(object: ResponseCheckTxAmino): ResponseCheckTx { - return { - code: object.code, - data: object.data, - log: object.log, - info: object.info, - gasWanted: BigInt(object.gas_wanted), - gasUsed: BigInt(object.gas_used), - events: Array.isArray(object?.events) ? object.events.map((e: any) => Event.fromAmino(e)) : [], - codespace: object.codespace - }; + const message = createBaseResponseCheckTx(); + if (object.code !== undefined && object.code !== null) { + message.code = object.code; + } + if (object.data !== undefined && object.data !== null) { + message.data = bytesFromBase64(object.data); + } + if (object.log !== undefined && object.log !== null) { + message.log = object.log; + } + if (object.info !== undefined && object.info !== null) { + message.info = object.info; + } + if (object.gas_wanted !== undefined && object.gas_wanted !== null) { + message.gasWanted = BigInt(object.gas_wanted); + } + if (object.gas_used !== undefined && object.gas_used !== null) { + message.gasUsed = BigInt(object.gas_used); + } + message.events = object.events?.map(e => Event.fromAmino(e)) || []; + if (object.codespace !== undefined && object.codespace !== null) { + message.codespace = object.codespace; + } + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + if (object.priority !== undefined && object.priority !== null) { + message.priority = BigInt(object.priority); + } + if (object.mempool_error !== undefined && object.mempool_error !== null) { + message.mempoolError = object.mempool_error; + } + return message; }, toAmino(message: ResponseCheckTx): ResponseCheckTxAmino { const obj: any = {}; obj.code = message.code; - obj.data = message.data; + obj.data = message.data ? base64FromBytes(message.data) : undefined; obj.log = message.log; obj.info = message.info; obj.gas_wanted = message.gasWanted ? message.gasWanted.toString() : undefined; @@ -3645,6 +4887,9 @@ export const ResponseCheckTx = { obj.events = []; } obj.codespace = message.codespace; + obj.sender = message.sender; + obj.priority = message.priority ? message.priority.toString() : undefined; + obj.mempool_error = message.mempoolError; return obj; }, fromAminoMsg(object: ResponseCheckTxAminoMsg): ResponseCheckTx { @@ -3663,6 +4908,7 @@ export const ResponseCheckTx = { }; } }; +GlobalDecoderRegistry.register(ResponseCheckTx.typeUrl, ResponseCheckTx); function createBaseResponseDeliverTx(): ResponseDeliverTx { return { code: 0, @@ -3677,6 +4923,15 @@ function createBaseResponseDeliverTx(): ResponseDeliverTx { } export const ResponseDeliverTx = { typeUrl: "/tendermint.abci.ResponseDeliverTx", + is(o: any): o is ResponseDeliverTx { + return o && (o.$typeUrl === ResponseDeliverTx.typeUrl || typeof o.code === "number" && (o.data instanceof Uint8Array || typeof o.data === "string") && typeof o.log === "string" && typeof o.info === "string" && typeof o.gasWanted === "bigint" && typeof o.gasUsed === "bigint" && Array.isArray(o.events) && (!o.events.length || Event.is(o.events[0])) && typeof o.codespace === "string"); + }, + isSDK(o: any): o is ResponseDeliverTxSDKType { + return o && (o.$typeUrl === ResponseDeliverTx.typeUrl || typeof o.code === "number" && (o.data instanceof Uint8Array || typeof o.data === "string") && typeof o.log === "string" && typeof o.info === "string" && typeof o.gas_wanted === "bigint" && typeof o.gas_used === "bigint" && Array.isArray(o.events) && (!o.events.length || Event.isSDK(o.events[0])) && typeof o.codespace === "string"); + }, + isAmino(o: any): o is ResponseDeliverTxAmino { + return o && (o.$typeUrl === ResponseDeliverTx.typeUrl || typeof o.code === "number" && (o.data instanceof Uint8Array || typeof o.data === "string") && typeof o.log === "string" && typeof o.info === "string" && typeof o.gas_wanted === "bigint" && typeof o.gas_used === "bigint" && Array.isArray(o.events) && (!o.events.length || Event.isAmino(o.events[0])) && typeof o.codespace === "string"); + }, encode(message: ResponseDeliverTx, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.code !== 0) { writer.uint32(8).uint32(message.code); @@ -3742,6 +4997,34 @@ export const ResponseDeliverTx = { } return message; }, + fromJSON(object: any): ResponseDeliverTx { + return { + code: isSet(object.code) ? Number(object.code) : 0, + 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) ? BigInt(object.gas_wanted.toString()) : BigInt(0), + gasUsed: isSet(object.gas_used) ? BigInt(object.gas_used.toString()) : BigInt(0), + 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)); + 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 || BigInt(0)).toString()); + message.gasUsed !== undefined && (obj.gas_used = (message.gasUsed || BigInt(0)).toString()); + if (message.events) { + obj.events = message.events.map(e => e ? Event.toJSON(e) : undefined); + } else { + obj.events = []; + } + message.codespace !== undefined && (obj.codespace = message.codespace); + return obj; + }, fromPartial(object: Partial): ResponseDeliverTx { const message = createBaseResponseDeliverTx(); message.code = object.code ?? 0; @@ -3755,21 +5038,35 @@ export const ResponseDeliverTx = { return message; }, fromAmino(object: ResponseDeliverTxAmino): ResponseDeliverTx { - return { - code: object.code, - data: object.data, - log: object.log, - info: object.info, - gasWanted: BigInt(object.gas_wanted), - gasUsed: BigInt(object.gas_used), - events: Array.isArray(object?.events) ? object.events.map((e: any) => Event.fromAmino(e)) : [], - codespace: object.codespace - }; + const message = createBaseResponseDeliverTx(); + if (object.code !== undefined && object.code !== null) { + message.code = object.code; + } + if (object.data !== undefined && object.data !== null) { + message.data = bytesFromBase64(object.data); + } + if (object.log !== undefined && object.log !== null) { + message.log = object.log; + } + if (object.info !== undefined && object.info !== null) { + message.info = object.info; + } + if (object.gas_wanted !== undefined && object.gas_wanted !== null) { + message.gasWanted = BigInt(object.gas_wanted); + } + if (object.gas_used !== undefined && object.gas_used !== null) { + message.gasUsed = BigInt(object.gas_used); + } + message.events = object.events?.map(e => Event.fromAmino(e)) || []; + if (object.codespace !== undefined && object.codespace !== null) { + message.codespace = object.codespace; + } + return message; }, toAmino(message: ResponseDeliverTx): ResponseDeliverTxAmino { const obj: any = {}; obj.code = message.code; - obj.data = message.data; + obj.data = message.data ? base64FromBytes(message.data) : undefined; obj.log = message.log; obj.info = message.info; obj.gas_wanted = message.gasWanted ? message.gasWanted.toString() : undefined; @@ -3798,15 +5095,25 @@ export const ResponseDeliverTx = { }; } }; +GlobalDecoderRegistry.register(ResponseDeliverTx.typeUrl, ResponseDeliverTx); function createBaseResponseEndBlock(): ResponseEndBlock { return { validatorUpdates: [], - consensusParamUpdates: ConsensusParams.fromPartial({}), + consensusParamUpdates: undefined, events: [] }; } export const ResponseEndBlock = { typeUrl: "/tendermint.abci.ResponseEndBlock", + is(o: any): o is ResponseEndBlock { + return o && (o.$typeUrl === ResponseEndBlock.typeUrl || Array.isArray(o.validatorUpdates) && (!o.validatorUpdates.length || ValidatorUpdate.is(o.validatorUpdates[0])) && Array.isArray(o.events) && (!o.events.length || Event.is(o.events[0]))); + }, + isSDK(o: any): o is ResponseEndBlockSDKType { + return o && (o.$typeUrl === ResponseEndBlock.typeUrl || Array.isArray(o.validator_updates) && (!o.validator_updates.length || ValidatorUpdate.isSDK(o.validator_updates[0])) && Array.isArray(o.events) && (!o.events.length || Event.isSDK(o.events[0]))); + }, + isAmino(o: any): o is ResponseEndBlockAmino { + return o && (o.$typeUrl === ResponseEndBlock.typeUrl || Array.isArray(o.validator_updates) && (!o.validator_updates.length || ValidatorUpdate.isAmino(o.validator_updates[0])) && Array.isArray(o.events) && (!o.events.length || Event.isAmino(o.events[0]))); + }, encode(message: ResponseEndBlock, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.validatorUpdates) { ValidatorUpdate.encode(v!, writer.uint32(10).fork()).ldelim(); @@ -3842,6 +5149,28 @@ export const ResponseEndBlock = { } return message; }, + fromJSON(object: any): ResponseEndBlock { + return { + validatorUpdates: Array.isArray(object?.validatorUpdates) ? object.validatorUpdates.map((e: any) => ValidatorUpdate.fromJSON(e)) : [], + consensusParamUpdates: isSet(object.consensusParamUpdates) ? ConsensusParams.fromJSON(object.consensusParamUpdates) : undefined, + events: Array.isArray(object?.events) ? object.events.map((e: any) => Event.fromJSON(e)) : [] + }; + }, + toJSON(message: ResponseEndBlock): unknown { + const obj: any = {}; + if (message.validatorUpdates) { + obj.validatorUpdates = message.validatorUpdates.map(e => e ? ValidatorUpdate.toJSON(e) : undefined); + } else { + obj.validatorUpdates = []; + } + 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); + } else { + obj.events = []; + } + return obj; + }, fromPartial(object: Partial): ResponseEndBlock { const message = createBaseResponseEndBlock(); message.validatorUpdates = object.validatorUpdates?.map(e => ValidatorUpdate.fromPartial(e)) || []; @@ -3850,11 +5179,13 @@ export const ResponseEndBlock = { return message; }, fromAmino(object: ResponseEndBlockAmino): ResponseEndBlock { - return { - validatorUpdates: Array.isArray(object?.validator_updates) ? object.validator_updates.map((e: any) => ValidatorUpdate.fromAmino(e)) : [], - consensusParamUpdates: object?.consensus_param_updates ? ConsensusParams.fromAmino(object.consensus_param_updates) : undefined, - events: Array.isArray(object?.events) ? object.events.map((e: any) => Event.fromAmino(e)) : [] - }; + const message = createBaseResponseEndBlock(); + message.validatorUpdates = object.validator_updates?.map(e => ValidatorUpdate.fromAmino(e)) || []; + if (object.consensus_param_updates !== undefined && object.consensus_param_updates !== null) { + message.consensusParamUpdates = ConsensusParams.fromAmino(object.consensus_param_updates); + } + message.events = object.events?.map(e => Event.fromAmino(e)) || []; + return message; }, toAmino(message: ResponseEndBlock): ResponseEndBlockAmino { const obj: any = {}; @@ -3887,6 +5218,7 @@ export const ResponseEndBlock = { }; } }; +GlobalDecoderRegistry.register(ResponseEndBlock.typeUrl, ResponseEndBlock); function createBaseResponseCommit(): ResponseCommit { return { data: new Uint8Array(), @@ -3895,6 +5227,15 @@ function createBaseResponseCommit(): ResponseCommit { } export const ResponseCommit = { typeUrl: "/tendermint.abci.ResponseCommit", + is(o: any): o is ResponseCommit { + return o && (o.$typeUrl === ResponseCommit.typeUrl || (o.data instanceof Uint8Array || typeof o.data === "string") && typeof o.retainHeight === "bigint"); + }, + isSDK(o: any): o is ResponseCommitSDKType { + return o && (o.$typeUrl === ResponseCommit.typeUrl || (o.data instanceof Uint8Array || typeof o.data === "string") && typeof o.retain_height === "bigint"); + }, + isAmino(o: any): o is ResponseCommitAmino { + return o && (o.$typeUrl === ResponseCommit.typeUrl || (o.data instanceof Uint8Array || typeof o.data === "string") && typeof o.retain_height === "bigint"); + }, encode(message: ResponseCommit, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.data.length !== 0) { writer.uint32(18).bytes(message.data); @@ -3924,6 +5265,18 @@ export const ResponseCommit = { } return message; }, + fromJSON(object: any): ResponseCommit { + return { + data: isSet(object.data) ? bytesFromBase64(object.data) : new Uint8Array(), + retainHeight: isSet(object.retainHeight) ? BigInt(object.retainHeight.toString()) : BigInt(0) + }; + }, + toJSON(message: ResponseCommit): unknown { + const obj: any = {}; + message.data !== undefined && (obj.data = base64FromBytes(message.data !== undefined ? message.data : new Uint8Array())); + message.retainHeight !== undefined && (obj.retainHeight = (message.retainHeight || BigInt(0)).toString()); + return obj; + }, fromPartial(object: Partial): ResponseCommit { const message = createBaseResponseCommit(); message.data = object.data ?? new Uint8Array(); @@ -3931,14 +5284,18 @@ export const ResponseCommit = { return message; }, fromAmino(object: ResponseCommitAmino): ResponseCommit { - return { - data: object.data, - retainHeight: BigInt(object.retain_height) - }; + const message = createBaseResponseCommit(); + if (object.data !== undefined && object.data !== null) { + message.data = bytesFromBase64(object.data); + } + if (object.retain_height !== undefined && object.retain_height !== null) { + message.retainHeight = BigInt(object.retain_height); + } + return message; }, toAmino(message: ResponseCommit): ResponseCommitAmino { const obj: any = {}; - obj.data = message.data; + obj.data = message.data ? base64FromBytes(message.data) : undefined; obj.retain_height = message.retainHeight ? message.retainHeight.toString() : undefined; return obj; }, @@ -3958,6 +5315,7 @@ export const ResponseCommit = { }; } }; +GlobalDecoderRegistry.register(ResponseCommit.typeUrl, ResponseCommit); function createBaseResponseListSnapshots(): ResponseListSnapshots { return { snapshots: [] @@ -3965,6 +5323,15 @@ function createBaseResponseListSnapshots(): ResponseListSnapshots { } export const ResponseListSnapshots = { typeUrl: "/tendermint.abci.ResponseListSnapshots", + is(o: any): o is ResponseListSnapshots { + return o && (o.$typeUrl === ResponseListSnapshots.typeUrl || Array.isArray(o.snapshots) && (!o.snapshots.length || Snapshot.is(o.snapshots[0]))); + }, + isSDK(o: any): o is ResponseListSnapshotsSDKType { + return o && (o.$typeUrl === ResponseListSnapshots.typeUrl || Array.isArray(o.snapshots) && (!o.snapshots.length || Snapshot.isSDK(o.snapshots[0]))); + }, + isAmino(o: any): o is ResponseListSnapshotsAmino { + return o && (o.$typeUrl === ResponseListSnapshots.typeUrl || Array.isArray(o.snapshots) && (!o.snapshots.length || Snapshot.isAmino(o.snapshots[0]))); + }, encode(message: ResponseListSnapshots, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.snapshots) { Snapshot.encode(v!, writer.uint32(10).fork()).ldelim(); @@ -3988,15 +5355,29 @@ export const ResponseListSnapshots = { } return message; }, + fromJSON(object: any): ResponseListSnapshots { + return { + snapshots: Array.isArray(object?.snapshots) ? object.snapshots.map((e: any) => Snapshot.fromJSON(e)) : [] + }; + }, + toJSON(message: ResponseListSnapshots): unknown { + const obj: any = {}; + if (message.snapshots) { + obj.snapshots = message.snapshots.map(e => e ? Snapshot.toJSON(e) : undefined); + } else { + obj.snapshots = []; + } + return obj; + }, fromPartial(object: Partial): ResponseListSnapshots { const message = createBaseResponseListSnapshots(); message.snapshots = object.snapshots?.map(e => Snapshot.fromPartial(e)) || []; return message; }, fromAmino(object: ResponseListSnapshotsAmino): ResponseListSnapshots { - return { - snapshots: Array.isArray(object?.snapshots) ? object.snapshots.map((e: any) => Snapshot.fromAmino(e)) : [] - }; + const message = createBaseResponseListSnapshots(); + message.snapshots = object.snapshots?.map(e => Snapshot.fromAmino(e)) || []; + return message; }, toAmino(message: ResponseListSnapshots): ResponseListSnapshotsAmino { const obj: any = {}; @@ -4023,6 +5404,7 @@ export const ResponseListSnapshots = { }; } }; +GlobalDecoderRegistry.register(ResponseListSnapshots.typeUrl, ResponseListSnapshots); function createBaseResponseOfferSnapshot(): ResponseOfferSnapshot { return { result: 0 @@ -4030,6 +5412,15 @@ function createBaseResponseOfferSnapshot(): ResponseOfferSnapshot { } export const ResponseOfferSnapshot = { typeUrl: "/tendermint.abci.ResponseOfferSnapshot", + is(o: any): o is ResponseOfferSnapshot { + return o && (o.$typeUrl === ResponseOfferSnapshot.typeUrl || isSet(o.result)); + }, + isSDK(o: any): o is ResponseOfferSnapshotSDKType { + return o && (o.$typeUrl === ResponseOfferSnapshot.typeUrl || isSet(o.result)); + }, + isAmino(o: any): o is ResponseOfferSnapshotAmino { + return o && (o.$typeUrl === ResponseOfferSnapshot.typeUrl || isSet(o.result)); + }, encode(message: ResponseOfferSnapshot, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.result !== 0) { writer.uint32(8).int32(message.result); @@ -4053,19 +5444,31 @@ export const ResponseOfferSnapshot = { } return message; }, + fromJSON(object: any): ResponseOfferSnapshot { + return { + result: isSet(object.result) ? responseOfferSnapshot_ResultFromJSON(object.result) : -1 + }; + }, + toJSON(message: ResponseOfferSnapshot): unknown { + const obj: any = {}; + message.result !== undefined && (obj.result = responseOfferSnapshot_ResultToJSON(message.result)); + return obj; + }, fromPartial(object: Partial): ResponseOfferSnapshot { const message = createBaseResponseOfferSnapshot(); message.result = object.result ?? 0; return message; }, fromAmino(object: ResponseOfferSnapshotAmino): ResponseOfferSnapshot { - return { - result: isSet(object.result) ? responseOfferSnapshot_ResultFromJSON(object.result) : -1 - }; + const message = createBaseResponseOfferSnapshot(); + if (object.result !== undefined && object.result !== null) { + message.result = responseOfferSnapshot_ResultFromJSON(object.result); + } + return message; }, toAmino(message: ResponseOfferSnapshot): ResponseOfferSnapshotAmino { const obj: any = {}; - obj.result = message.result; + obj.result = responseOfferSnapshot_ResultToJSON(message.result); return obj; }, fromAminoMsg(object: ResponseOfferSnapshotAminoMsg): ResponseOfferSnapshot { @@ -4084,6 +5487,7 @@ export const ResponseOfferSnapshot = { }; } }; +GlobalDecoderRegistry.register(ResponseOfferSnapshot.typeUrl, ResponseOfferSnapshot); function createBaseResponseLoadSnapshotChunk(): ResponseLoadSnapshotChunk { return { chunk: new Uint8Array() @@ -4091,6 +5495,15 @@ function createBaseResponseLoadSnapshotChunk(): ResponseLoadSnapshotChunk { } export const ResponseLoadSnapshotChunk = { typeUrl: "/tendermint.abci.ResponseLoadSnapshotChunk", + is(o: any): o is ResponseLoadSnapshotChunk { + return o && (o.$typeUrl === ResponseLoadSnapshotChunk.typeUrl || o.chunk instanceof Uint8Array || typeof o.chunk === "string"); + }, + isSDK(o: any): o is ResponseLoadSnapshotChunkSDKType { + return o && (o.$typeUrl === ResponseLoadSnapshotChunk.typeUrl || o.chunk instanceof Uint8Array || typeof o.chunk === "string"); + }, + isAmino(o: any): o is ResponseLoadSnapshotChunkAmino { + return o && (o.$typeUrl === ResponseLoadSnapshotChunk.typeUrl || o.chunk instanceof Uint8Array || typeof o.chunk === "string"); + }, encode(message: ResponseLoadSnapshotChunk, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.chunk.length !== 0) { writer.uint32(10).bytes(message.chunk); @@ -4114,19 +5527,31 @@ export const ResponseLoadSnapshotChunk = { } return message; }, + fromJSON(object: any): ResponseLoadSnapshotChunk { + return { + chunk: isSet(object.chunk) ? bytesFromBase64(object.chunk) : new Uint8Array() + }; + }, + toJSON(message: ResponseLoadSnapshotChunk): unknown { + const obj: any = {}; + message.chunk !== undefined && (obj.chunk = base64FromBytes(message.chunk !== undefined ? message.chunk : new Uint8Array())); + return obj; + }, fromPartial(object: Partial): ResponseLoadSnapshotChunk { const message = createBaseResponseLoadSnapshotChunk(); message.chunk = object.chunk ?? new Uint8Array(); return message; }, fromAmino(object: ResponseLoadSnapshotChunkAmino): ResponseLoadSnapshotChunk { - return { - chunk: object.chunk - }; + const message = createBaseResponseLoadSnapshotChunk(); + if (object.chunk !== undefined && object.chunk !== null) { + message.chunk = bytesFromBase64(object.chunk); + } + return message; }, toAmino(message: ResponseLoadSnapshotChunk): ResponseLoadSnapshotChunkAmino { const obj: any = {}; - obj.chunk = message.chunk; + obj.chunk = message.chunk ? base64FromBytes(message.chunk) : undefined; return obj; }, fromAminoMsg(object: ResponseLoadSnapshotChunkAminoMsg): ResponseLoadSnapshotChunk { @@ -4145,6 +5570,7 @@ export const ResponseLoadSnapshotChunk = { }; } }; +GlobalDecoderRegistry.register(ResponseLoadSnapshotChunk.typeUrl, ResponseLoadSnapshotChunk); function createBaseResponseApplySnapshotChunk(): ResponseApplySnapshotChunk { return { result: 0, @@ -4154,6 +5580,15 @@ function createBaseResponseApplySnapshotChunk(): ResponseApplySnapshotChunk { } export const ResponseApplySnapshotChunk = { typeUrl: "/tendermint.abci.ResponseApplySnapshotChunk", + is(o: any): o is ResponseApplySnapshotChunk { + return o && (o.$typeUrl === ResponseApplySnapshotChunk.typeUrl || isSet(o.result) && Array.isArray(o.refetchChunks) && (!o.refetchChunks.length || typeof o.refetchChunks[0] === "number") && Array.isArray(o.rejectSenders) && (!o.rejectSenders.length || typeof o.rejectSenders[0] === "string")); + }, + isSDK(o: any): o is ResponseApplySnapshotChunkSDKType { + return o && (o.$typeUrl === ResponseApplySnapshotChunk.typeUrl || isSet(o.result) && Array.isArray(o.refetch_chunks) && (!o.refetch_chunks.length || typeof o.refetch_chunks[0] === "number") && Array.isArray(o.reject_senders) && (!o.reject_senders.length || typeof o.reject_senders[0] === "string")); + }, + isAmino(o: any): o is ResponseApplySnapshotChunkAmino { + return o && (o.$typeUrl === ResponseApplySnapshotChunk.typeUrl || isSet(o.result) && Array.isArray(o.refetch_chunks) && (!o.refetch_chunks.length || typeof o.refetch_chunks[0] === "number") && Array.isArray(o.reject_senders) && (!o.reject_senders.length || typeof o.reject_senders[0] === "string")); + }, encode(message: ResponseApplySnapshotChunk, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.result !== 0) { writer.uint32(8).int32(message.result); @@ -4198,6 +5633,28 @@ export const ResponseApplySnapshotChunk = { } return message; }, + fromJSON(object: any): ResponseApplySnapshotChunk { + return { + result: isSet(object.result) ? responseApplySnapshotChunk_ResultFromJSON(object.result) : -1, + 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)); + if (message.refetchChunks) { + obj.refetchChunks = message.refetchChunks.map(e => Math.round(e)); + } else { + obj.refetchChunks = []; + } + if (message.rejectSenders) { + obj.rejectSenders = message.rejectSenders.map(e => e); + } else { + obj.rejectSenders = []; + } + return obj; + }, fromPartial(object: Partial): ResponseApplySnapshotChunk { const message = createBaseResponseApplySnapshotChunk(); message.result = object.result ?? 0; @@ -4206,15 +5663,17 @@ export const ResponseApplySnapshotChunk = { return message; }, fromAmino(object: ResponseApplySnapshotChunkAmino): ResponseApplySnapshotChunk { - return { - result: isSet(object.result) ? responseApplySnapshotChunk_ResultFromJSON(object.result) : -1, - refetchChunks: Array.isArray(object?.refetch_chunks) ? object.refetch_chunks.map((e: any) => e) : [], - rejectSenders: Array.isArray(object?.reject_senders) ? object.reject_senders.map((e: any) => e) : [] - }; + const message = createBaseResponseApplySnapshotChunk(); + if (object.result !== undefined && object.result !== null) { + message.result = responseApplySnapshotChunk_ResultFromJSON(object.result); + } + message.refetchChunks = object.refetch_chunks?.map(e => e) || []; + message.rejectSenders = object.reject_senders?.map(e => e) || []; + return message; }, toAmino(message: ResponseApplySnapshotChunk): ResponseApplySnapshotChunkAmino { const obj: any = {}; - obj.result = message.result; + obj.result = responseApplySnapshotChunk_ResultToJSON(message.result); if (message.refetchChunks) { obj.refetch_chunks = message.refetchChunks.map(e => e); } else { @@ -4243,49 +5702,127 @@ export const ResponseApplySnapshotChunk = { }; } }; -function createBaseConsensusParams(): ConsensusParams { +GlobalDecoderRegistry.register(ResponseApplySnapshotChunk.typeUrl, ResponseApplySnapshotChunk); +function createBaseResponsePrepareProposal(): ResponsePrepareProposal { return { - block: BlockParams.fromPartial({}), - evidence: EvidenceParams.fromPartial({}), - validator: ValidatorParams.fromPartial({}), - version: VersionParams.fromPartial({}) + txs: [] }; } -export const ConsensusParams = { - typeUrl: "/tendermint.abci.ConsensusParams", - encode(message: ConsensusParams, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { - if (message.block !== undefined) { - BlockParams.encode(message.block, writer.uint32(10).fork()).ldelim(); +export const ResponsePrepareProposal = { + typeUrl: "/tendermint.abci.ResponsePrepareProposal", + is(o: any): o is ResponsePrepareProposal { + return o && (o.$typeUrl === ResponsePrepareProposal.typeUrl || Array.isArray(o.txs) && (!o.txs.length || o.txs[0] instanceof Uint8Array || typeof o.txs[0] === "string")); + }, + isSDK(o: any): o is ResponsePrepareProposalSDKType { + return o && (o.$typeUrl === ResponsePrepareProposal.typeUrl || Array.isArray(o.txs) && (!o.txs.length || o.txs[0] instanceof Uint8Array || typeof o.txs[0] === "string")); + }, + isAmino(o: any): o is ResponsePrepareProposalAmino { + return o && (o.$typeUrl === ResponsePrepareProposal.typeUrl || Array.isArray(o.txs) && (!o.txs.length || o.txs[0] instanceof Uint8Array || typeof o.txs[0] === "string")); + }, + encode(message: ResponsePrepareProposal, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.txs) { + writer.uint32(10).bytes(v!); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): ResponsePrepareProposal { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseResponsePrepareProposal(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.txs.push(reader.bytes()); + break; + default: + reader.skipType(tag & 7); + break; + } } - if (message.evidence !== undefined) { - EvidenceParams.encode(message.evidence, writer.uint32(18).fork()).ldelim(); + return message; + }, + fromJSON(object: any): ResponsePrepareProposal { + return { + txs: Array.isArray(object?.txs) ? object.txs.map((e: any) => bytesFromBase64(e)) : [] + }; + }, + toJSON(message: ResponsePrepareProposal): unknown { + const obj: any = {}; + if (message.txs) { + obj.txs = message.txs.map(e => base64FromBytes(e !== undefined ? e : new Uint8Array())); + } else { + obj.txs = []; } - if (message.validator !== undefined) { - ValidatorParams.encode(message.validator, writer.uint32(26).fork()).ldelim(); + return obj; + }, + fromPartial(object: Partial): ResponsePrepareProposal { + const message = createBaseResponsePrepareProposal(); + message.txs = object.txs?.map(e => e) || []; + return message; + }, + fromAmino(object: ResponsePrepareProposalAmino): ResponsePrepareProposal { + const message = createBaseResponsePrepareProposal(); + message.txs = object.txs?.map(e => bytesFromBase64(e)) || []; + return message; + }, + toAmino(message: ResponsePrepareProposal): ResponsePrepareProposalAmino { + const obj: any = {}; + if (message.txs) { + obj.txs = message.txs.map(e => base64FromBytes(e)); + } else { + obj.txs = []; } - if (message.version !== undefined) { - VersionParams.encode(message.version, writer.uint32(34).fork()).ldelim(); + return obj; + }, + fromAminoMsg(object: ResponsePrepareProposalAminoMsg): ResponsePrepareProposal { + return ResponsePrepareProposal.fromAmino(object.value); + }, + fromProtoMsg(message: ResponsePrepareProposalProtoMsg): ResponsePrepareProposal { + return ResponsePrepareProposal.decode(message.value); + }, + toProto(message: ResponsePrepareProposal): Uint8Array { + return ResponsePrepareProposal.encode(message).finish(); + }, + toProtoMsg(message: ResponsePrepareProposal): ResponsePrepareProposalProtoMsg { + return { + typeUrl: "/tendermint.abci.ResponsePrepareProposal", + value: ResponsePrepareProposal.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(ResponsePrepareProposal.typeUrl, ResponsePrepareProposal); +function createBaseResponseProcessProposal(): ResponseProcessProposal { + return { + status: 0 + }; +} +export const ResponseProcessProposal = { + typeUrl: "/tendermint.abci.ResponseProcessProposal", + is(o: any): o is ResponseProcessProposal { + return o && (o.$typeUrl === ResponseProcessProposal.typeUrl || isSet(o.status)); + }, + isSDK(o: any): o is ResponseProcessProposalSDKType { + return o && (o.$typeUrl === ResponseProcessProposal.typeUrl || isSet(o.status)); + }, + isAmino(o: any): o is ResponseProcessProposalAmino { + return o && (o.$typeUrl === ResponseProcessProposal.typeUrl || isSet(o.status)); + }, + encode(message: ResponseProcessProposal, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.status !== 0) { + writer.uint32(8).int32(message.status); } return writer; }, - decode(input: BinaryReader | Uint8Array, length?: number): ConsensusParams { + decode(input: BinaryReader | Uint8Array, length?: number): ResponseProcessProposal { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseConsensusParams(); + const message = createBaseResponseProcessProposal(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.block = BlockParams.decode(reader, reader.uint32()); - break; - case 2: - message.evidence = EvidenceParams.decode(reader, reader.uint32()); - break; - case 3: - message.validator = ValidatorParams.decode(reader, reader.uint32()); - break; - case 4: - message.version = VersionParams.decode(reader, reader.uint32()); + message.status = (reader.int32() as any); break; default: reader.skipType(tag & 7); @@ -4294,75 +5831,88 @@ export const ConsensusParams = { } return message; }, - fromPartial(object: Partial): 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; - }, - fromAmino(object: ConsensusParamsAmino): ConsensusParams { + fromJSON(object: any): ResponseProcessProposal { return { - block: object?.block ? BlockParams.fromAmino(object.block) : undefined, - evidence: object?.evidence ? EvidenceParams.fromAmino(object.evidence) : undefined, - validator: object?.validator ? ValidatorParams.fromAmino(object.validator) : undefined, - version: object?.version ? VersionParams.fromAmino(object.version) : undefined + status: isSet(object.status) ? responseProcessProposal_ProposalStatusFromJSON(object.status) : -1 }; }, - toAmino(message: ConsensusParams): ConsensusParamsAmino { + toJSON(message: ResponseProcessProposal): unknown { + const obj: any = {}; + message.status !== undefined && (obj.status = responseProcessProposal_ProposalStatusToJSON(message.status)); + return obj; + }, + fromPartial(object: Partial): ResponseProcessProposal { + const message = createBaseResponseProcessProposal(); + message.status = object.status ?? 0; + return message; + }, + fromAmino(object: ResponseProcessProposalAmino): ResponseProcessProposal { + const message = createBaseResponseProcessProposal(); + if (object.status !== undefined && object.status !== null) { + message.status = responseProcessProposal_ProposalStatusFromJSON(object.status); + } + return message; + }, + toAmino(message: ResponseProcessProposal): ResponseProcessProposalAmino { const obj: any = {}; - obj.block = message.block ? BlockParams.toAmino(message.block) : undefined; - obj.evidence = message.evidence ? EvidenceParams.toAmino(message.evidence) : undefined; - obj.validator = message.validator ? ValidatorParams.toAmino(message.validator) : undefined; - obj.version = message.version ? VersionParams.toAmino(message.version) : undefined; + obj.status = responseProcessProposal_ProposalStatusToJSON(message.status); return obj; }, - fromAminoMsg(object: ConsensusParamsAminoMsg): ConsensusParams { - return ConsensusParams.fromAmino(object.value); + fromAminoMsg(object: ResponseProcessProposalAminoMsg): ResponseProcessProposal { + return ResponseProcessProposal.fromAmino(object.value); }, - fromProtoMsg(message: ConsensusParamsProtoMsg): ConsensusParams { - return ConsensusParams.decode(message.value); + fromProtoMsg(message: ResponseProcessProposalProtoMsg): ResponseProcessProposal { + return ResponseProcessProposal.decode(message.value); }, - toProto(message: ConsensusParams): Uint8Array { - return ConsensusParams.encode(message).finish(); + toProto(message: ResponseProcessProposal): Uint8Array { + return ResponseProcessProposal.encode(message).finish(); }, - toProtoMsg(message: ConsensusParams): ConsensusParamsProtoMsg { + toProtoMsg(message: ResponseProcessProposal): ResponseProcessProposalProtoMsg { return { - typeUrl: "/tendermint.abci.ConsensusParams", - value: ConsensusParams.encode(message).finish() + typeUrl: "/tendermint.abci.ResponseProcessProposal", + value: ResponseProcessProposal.encode(message).finish() }; } }; -function createBaseBlockParams(): BlockParams { +GlobalDecoderRegistry.register(ResponseProcessProposal.typeUrl, ResponseProcessProposal); +function createBaseCommitInfo(): CommitInfo { return { - maxBytes: BigInt(0), - maxGas: BigInt(0) + round: 0, + votes: [] }; } -export const BlockParams = { - typeUrl: "/tendermint.abci.BlockParams", - encode(message: BlockParams, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { - if (message.maxBytes !== BigInt(0)) { - writer.uint32(8).int64(message.maxBytes); +export const CommitInfo = { + typeUrl: "/tendermint.abci.CommitInfo", + is(o: any): o is CommitInfo { + return o && (o.$typeUrl === CommitInfo.typeUrl || typeof o.round === "number" && Array.isArray(o.votes) && (!o.votes.length || VoteInfo.is(o.votes[0]))); + }, + isSDK(o: any): o is CommitInfoSDKType { + return o && (o.$typeUrl === CommitInfo.typeUrl || typeof o.round === "number" && Array.isArray(o.votes) && (!o.votes.length || VoteInfo.isSDK(o.votes[0]))); + }, + isAmino(o: any): o is CommitInfoAmino { + return o && (o.$typeUrl === CommitInfo.typeUrl || typeof o.round === "number" && Array.isArray(o.votes) && (!o.votes.length || VoteInfo.isAmino(o.votes[0]))); + }, + encode(message: CommitInfo, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.round !== 0) { + writer.uint32(8).int32(message.round); } - if (message.maxGas !== BigInt(0)) { - writer.uint32(16).int64(message.maxGas); + for (const v of message.votes) { + VoteInfo.encode(v!, writer.uint32(18).fork()).ldelim(); } return writer; }, - decode(input: BinaryReader | Uint8Array, length?: number): BlockParams { + decode(input: BinaryReader | Uint8Array, length?: number): CommitInfo { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseBlockParams(); + const message = createBaseCommitInfo(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.maxBytes = reader.int64(); + message.round = reader.int32(); break; case 2: - message.maxGas = reader.int64(); + message.votes.push(VoteInfo.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -4371,61 +5921,93 @@ export const BlockParams = { } return message; }, - fromPartial(object: Partial): BlockParams { - const message = createBaseBlockParams(); - message.maxBytes = object.maxBytes !== undefined && object.maxBytes !== null ? BigInt(object.maxBytes.toString()) : BigInt(0); - message.maxGas = object.maxGas !== undefined && object.maxGas !== null ? BigInt(object.maxGas.toString()) : BigInt(0); - return message; - }, - fromAmino(object: BlockParamsAmino): BlockParams { + fromJSON(object: any): CommitInfo { return { - maxBytes: BigInt(object.max_bytes), - maxGas: BigInt(object.max_gas) + round: isSet(object.round) ? Number(object.round) : 0, + votes: Array.isArray(object?.votes) ? object.votes.map((e: any) => VoteInfo.fromJSON(e)) : [] }; }, - toAmino(message: BlockParams): BlockParamsAmino { + toJSON(message: CommitInfo): unknown { + 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); + } else { + obj.votes = []; + } + return obj; + }, + fromPartial(object: Partial): CommitInfo { + const message = createBaseCommitInfo(); + message.round = object.round ?? 0; + message.votes = object.votes?.map(e => VoteInfo.fromPartial(e)) || []; + return message; + }, + fromAmino(object: CommitInfoAmino): CommitInfo { + const message = createBaseCommitInfo(); + if (object.round !== undefined && object.round !== null) { + message.round = object.round; + } + message.votes = object.votes?.map(e => VoteInfo.fromAmino(e)) || []; + return message; + }, + toAmino(message: CommitInfo): CommitInfoAmino { const obj: any = {}; - obj.max_bytes = message.maxBytes ? message.maxBytes.toString() : undefined; - obj.max_gas = message.maxGas ? message.maxGas.toString() : undefined; + obj.round = message.round; + if (message.votes) { + obj.votes = message.votes.map(e => e ? VoteInfo.toAmino(e) : undefined); + } else { + obj.votes = []; + } return obj; }, - fromAminoMsg(object: BlockParamsAminoMsg): BlockParams { - return BlockParams.fromAmino(object.value); + fromAminoMsg(object: CommitInfoAminoMsg): CommitInfo { + return CommitInfo.fromAmino(object.value); }, - fromProtoMsg(message: BlockParamsProtoMsg): BlockParams { - return BlockParams.decode(message.value); + fromProtoMsg(message: CommitInfoProtoMsg): CommitInfo { + return CommitInfo.decode(message.value); }, - toProto(message: BlockParams): Uint8Array { - return BlockParams.encode(message).finish(); + toProto(message: CommitInfo): Uint8Array { + return CommitInfo.encode(message).finish(); }, - toProtoMsg(message: BlockParams): BlockParamsProtoMsg { + toProtoMsg(message: CommitInfo): CommitInfoProtoMsg { return { - typeUrl: "/tendermint.abci.BlockParams", - value: BlockParams.encode(message).finish() + typeUrl: "/tendermint.abci.CommitInfo", + value: CommitInfo.encode(message).finish() }; } }; -function createBaseLastCommitInfo(): LastCommitInfo { +GlobalDecoderRegistry.register(CommitInfo.typeUrl, CommitInfo); +function createBaseExtendedCommitInfo(): ExtendedCommitInfo { return { round: 0, votes: [] }; } -export const LastCommitInfo = { - typeUrl: "/tendermint.abci.LastCommitInfo", - encode(message: LastCommitInfo, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { +export const ExtendedCommitInfo = { + typeUrl: "/tendermint.abci.ExtendedCommitInfo", + is(o: any): o is ExtendedCommitInfo { + return o && (o.$typeUrl === ExtendedCommitInfo.typeUrl || typeof o.round === "number" && Array.isArray(o.votes) && (!o.votes.length || ExtendedVoteInfo.is(o.votes[0]))); + }, + isSDK(o: any): o is ExtendedCommitInfoSDKType { + return o && (o.$typeUrl === ExtendedCommitInfo.typeUrl || typeof o.round === "number" && Array.isArray(o.votes) && (!o.votes.length || ExtendedVoteInfo.isSDK(o.votes[0]))); + }, + isAmino(o: any): o is ExtendedCommitInfoAmino { + return o && (o.$typeUrl === ExtendedCommitInfo.typeUrl || typeof o.round === "number" && Array.isArray(o.votes) && (!o.votes.length || ExtendedVoteInfo.isAmino(o.votes[0]))); + }, + encode(message: ExtendedCommitInfo, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.round !== 0) { writer.uint32(8).int32(message.round); } for (const v of message.votes) { - VoteInfo.encode(v!, writer.uint32(18).fork()).ldelim(); + ExtendedVoteInfo.encode(v!, writer.uint32(18).fork()).ldelim(); } return writer; }, - decode(input: BinaryReader | Uint8Array, length?: number): LastCommitInfo { + decode(input: BinaryReader | Uint8Array, length?: number): ExtendedCommitInfo { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseLastCommitInfo(); + const message = createBaseExtendedCommitInfo(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -4433,7 +6015,7 @@ export const LastCommitInfo = { message.round = reader.int32(); break; case 2: - message.votes.push(VoteInfo.decode(reader, reader.uint32())); + message.votes.push(ExtendedVoteInfo.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -4442,44 +6024,63 @@ export const LastCommitInfo = { } return message; }, - fromPartial(object: Partial): LastCommitInfo { - const message = createBaseLastCommitInfo(); + fromJSON(object: any): ExtendedCommitInfo { + return { + round: isSet(object.round) ? Number(object.round) : 0, + votes: Array.isArray(object?.votes) ? object.votes.map((e: any) => ExtendedVoteInfo.fromJSON(e)) : [] + }; + }, + toJSON(message: ExtendedCommitInfo): unknown { + const obj: any = {}; + message.round !== undefined && (obj.round = Math.round(message.round)); + if (message.votes) { + obj.votes = message.votes.map(e => e ? ExtendedVoteInfo.toJSON(e) : undefined); + } else { + obj.votes = []; + } + return obj; + }, + fromPartial(object: Partial): ExtendedCommitInfo { + const message = createBaseExtendedCommitInfo(); message.round = object.round ?? 0; - message.votes = object.votes?.map(e => VoteInfo.fromPartial(e)) || []; + message.votes = object.votes?.map(e => ExtendedVoteInfo.fromPartial(e)) || []; return message; }, - fromAmino(object: LastCommitInfoAmino): LastCommitInfo { - return { - round: object.round, - votes: Array.isArray(object?.votes) ? object.votes.map((e: any) => VoteInfo.fromAmino(e)) : [] - }; + fromAmino(object: ExtendedCommitInfoAmino): ExtendedCommitInfo { + const message = createBaseExtendedCommitInfo(); + if (object.round !== undefined && object.round !== null) { + message.round = object.round; + } + message.votes = object.votes?.map(e => ExtendedVoteInfo.fromAmino(e)) || []; + return message; }, - toAmino(message: LastCommitInfo): LastCommitInfoAmino { + toAmino(message: ExtendedCommitInfo): ExtendedCommitInfoAmino { const obj: any = {}; obj.round = message.round; if (message.votes) { - obj.votes = message.votes.map(e => e ? VoteInfo.toAmino(e) : undefined); + obj.votes = message.votes.map(e => e ? ExtendedVoteInfo.toAmino(e) : undefined); } else { obj.votes = []; } return obj; }, - fromAminoMsg(object: LastCommitInfoAminoMsg): LastCommitInfo { - return LastCommitInfo.fromAmino(object.value); + fromAminoMsg(object: ExtendedCommitInfoAminoMsg): ExtendedCommitInfo { + return ExtendedCommitInfo.fromAmino(object.value); }, - fromProtoMsg(message: LastCommitInfoProtoMsg): LastCommitInfo { - return LastCommitInfo.decode(message.value); + fromProtoMsg(message: ExtendedCommitInfoProtoMsg): ExtendedCommitInfo { + return ExtendedCommitInfo.decode(message.value); }, - toProto(message: LastCommitInfo): Uint8Array { - return LastCommitInfo.encode(message).finish(); + toProto(message: ExtendedCommitInfo): Uint8Array { + return ExtendedCommitInfo.encode(message).finish(); }, - toProtoMsg(message: LastCommitInfo): LastCommitInfoProtoMsg { + toProtoMsg(message: ExtendedCommitInfo): ExtendedCommitInfoProtoMsg { return { - typeUrl: "/tendermint.abci.LastCommitInfo", - value: LastCommitInfo.encode(message).finish() + typeUrl: "/tendermint.abci.ExtendedCommitInfo", + value: ExtendedCommitInfo.encode(message).finish() }; } }; +GlobalDecoderRegistry.register(ExtendedCommitInfo.typeUrl, ExtendedCommitInfo); function createBaseEvent(): Event { return { type: "", @@ -4488,6 +6089,15 @@ function createBaseEvent(): Event { } export const Event = { typeUrl: "/tendermint.abci.Event", + is(o: any): o is Event { + return o && (o.$typeUrl === Event.typeUrl || typeof o.type === "string" && Array.isArray(o.attributes) && (!o.attributes.length || EventAttribute.is(o.attributes[0]))); + }, + isSDK(o: any): o is EventSDKType { + return o && (o.$typeUrl === Event.typeUrl || typeof o.type === "string" && Array.isArray(o.attributes) && (!o.attributes.length || EventAttribute.isSDK(o.attributes[0]))); + }, + isAmino(o: any): o is EventAmino { + return o && (o.$typeUrl === Event.typeUrl || typeof o.type === "string" && Array.isArray(o.attributes) && (!o.attributes.length || EventAttribute.isAmino(o.attributes[0]))); + }, encode(message: Event, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.type !== "") { writer.uint32(10).string(message.type); @@ -4517,6 +6127,22 @@ export const Event = { } return message; }, + fromJSON(object: any): Event { + return { + type: isSet(object.type) ? String(object.type) : "", + 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); + if (message.attributes) { + obj.attributes = message.attributes.map(e => e ? EventAttribute.toJSON(e) : undefined); + } else { + obj.attributes = []; + } + return obj; + }, fromPartial(object: Partial): Event { const message = createBaseEvent(); message.type = object.type ?? ""; @@ -4524,10 +6150,12 @@ export const Event = { return message; }, fromAmino(object: EventAmino): Event { - return { - type: object.type, - attributes: Array.isArray(object?.attributes) ? object.attributes.map((e: any) => EventAttribute.fromAmino(e)) : [] - }; + const message = createBaseEvent(); + if (object.type !== undefined && object.type !== null) { + message.type = object.type; + } + message.attributes = object.attributes?.map(e => EventAttribute.fromAmino(e)) || []; + return message; }, toAmino(message: Event): EventAmino { const obj: any = {}; @@ -4555,21 +6183,31 @@ export const Event = { }; } }; +GlobalDecoderRegistry.register(Event.typeUrl, Event); function createBaseEventAttribute(): EventAttribute { return { - key: new Uint8Array(), - value: new Uint8Array(), + key: "", + value: "", index: false }; } export const EventAttribute = { typeUrl: "/tendermint.abci.EventAttribute", + is(o: any): o is EventAttribute { + return o && (o.$typeUrl === EventAttribute.typeUrl || typeof o.key === "string" && typeof o.value === "string" && typeof o.index === "boolean"); + }, + isSDK(o: any): o is EventAttributeSDKType { + return o && (o.$typeUrl === EventAttribute.typeUrl || typeof o.key === "string" && typeof o.value === "string" && typeof o.index === "boolean"); + }, + isAmino(o: any): o is EventAttributeAmino { + return o && (o.$typeUrl === EventAttribute.typeUrl || typeof o.key === "string" && typeof o.value === "string" && typeof o.index === "boolean"); + }, encode(message: EventAttribute, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { - if (message.key.length !== 0) { - writer.uint32(10).bytes(message.key); + if (message.key !== "") { + writer.uint32(10).string(message.key); } - if (message.value.length !== 0) { - writer.uint32(18).bytes(message.value); + if (message.value !== "") { + writer.uint32(18).string(message.value); } if (message.index === true) { writer.uint32(24).bool(message.index); @@ -4584,10 +6222,10 @@ export const EventAttribute = { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.key = reader.bytes(); + message.key = reader.string(); break; case 2: - message.value = reader.bytes(); + message.value = reader.string(); break; case 3: message.index = reader.bool(); @@ -4599,19 +6237,39 @@ export const EventAttribute = { } return message; }, + fromJSON(object: any): EventAttribute { + return { + key: isSet(object.key) ? String(object.key) : "", + value: isSet(object.value) ? String(object.value) : "", + index: isSet(object.index) ? Boolean(object.index) : false + }; + }, + toJSON(message: EventAttribute): unknown { + const obj: any = {}; + message.key !== undefined && (obj.key = message.key); + message.value !== undefined && (obj.value = message.value); + message.index !== undefined && (obj.index = message.index); + return obj; + }, fromPartial(object: Partial): EventAttribute { const message = createBaseEventAttribute(); - message.key = object.key ?? new Uint8Array(); - message.value = object.value ?? new Uint8Array(); + message.key = object.key ?? ""; + message.value = object.value ?? ""; message.index = object.index ?? false; return message; }, fromAmino(object: EventAttributeAmino): EventAttribute { - return { - key: object.key, - value: object.value, - index: object.index - }; + const message = createBaseEventAttribute(); + if (object.key !== undefined && object.key !== null) { + message.key = object.key; + } + if (object.value !== undefined && object.value !== null) { + message.value = object.value; + } + if (object.index !== undefined && object.index !== null) { + message.index = object.index; + } + return message; }, toAmino(message: EventAttribute): EventAttributeAmino { const obj: any = {}; @@ -4636,6 +6294,7 @@ export const EventAttribute = { }; } }; +GlobalDecoderRegistry.register(EventAttribute.typeUrl, EventAttribute); function createBaseTxResult(): TxResult { return { height: BigInt(0), @@ -4646,6 +6305,15 @@ function createBaseTxResult(): TxResult { } export const TxResult = { typeUrl: "/tendermint.abci.TxResult", + is(o: any): o is TxResult { + return o && (o.$typeUrl === TxResult.typeUrl || typeof o.height === "bigint" && typeof o.index === "number" && (o.tx instanceof Uint8Array || typeof o.tx === "string") && ResponseDeliverTx.is(o.result)); + }, + isSDK(o: any): o is TxResultSDKType { + return o && (o.$typeUrl === TxResult.typeUrl || typeof o.height === "bigint" && typeof o.index === "number" && (o.tx instanceof Uint8Array || typeof o.tx === "string") && ResponseDeliverTx.isSDK(o.result)); + }, + isAmino(o: any): o is TxResultAmino { + return o && (o.$typeUrl === TxResult.typeUrl || typeof o.height === "bigint" && typeof o.index === "number" && (o.tx instanceof Uint8Array || typeof o.tx === "string") && ResponseDeliverTx.isAmino(o.result)); + }, encode(message: TxResult, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.height !== BigInt(0)) { writer.uint32(8).int64(message.height); @@ -4687,6 +6355,22 @@ export const TxResult = { } return message; }, + fromJSON(object: any): TxResult { + return { + height: isSet(object.height) ? BigInt(object.height.toString()) : BigInt(0), + 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 + }; + }, + toJSON(message: TxResult): unknown { + const obj: any = {}; + message.height !== undefined && (obj.height = (message.height || BigInt(0)).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; + }, fromPartial(object: Partial): TxResult { const message = createBaseTxResult(); message.height = object.height !== undefined && object.height !== null ? BigInt(object.height.toString()) : BigInt(0); @@ -4696,18 +6380,26 @@ export const TxResult = { return message; }, fromAmino(object: TxResultAmino): TxResult { - return { - height: BigInt(object.height), - index: object.index, - tx: object.tx, - result: object?.result ? ResponseDeliverTx.fromAmino(object.result) : undefined - }; + const message = createBaseTxResult(); + if (object.height !== undefined && object.height !== null) { + message.height = BigInt(object.height); + } + if (object.index !== undefined && object.index !== null) { + message.index = object.index; + } + if (object.tx !== undefined && object.tx !== null) { + message.tx = bytesFromBase64(object.tx); + } + if (object.result !== undefined && object.result !== null) { + message.result = ResponseDeliverTx.fromAmino(object.result); + } + return message; }, toAmino(message: TxResult): TxResultAmino { const obj: any = {}; obj.height = message.height ? message.height.toString() : undefined; obj.index = message.index; - obj.tx = message.tx; + obj.tx = message.tx ? base64FromBytes(message.tx) : undefined; obj.result = message.result ? ResponseDeliverTx.toAmino(message.result) : undefined; return obj; }, @@ -4727,6 +6419,7 @@ export const TxResult = { }; } }; +GlobalDecoderRegistry.register(TxResult.typeUrl, TxResult); function createBaseValidator(): Validator { return { address: new Uint8Array(), @@ -4735,6 +6428,15 @@ function createBaseValidator(): Validator { } export const Validator = { typeUrl: "/tendermint.abci.Validator", + is(o: any): o is Validator { + return o && (o.$typeUrl === Validator.typeUrl || (o.address instanceof Uint8Array || typeof o.address === "string") && typeof o.power === "bigint"); + }, + isSDK(o: any): o is ValidatorSDKType { + return o && (o.$typeUrl === Validator.typeUrl || (o.address instanceof Uint8Array || typeof o.address === "string") && typeof o.power === "bigint"); + }, + isAmino(o: any): o is ValidatorAmino { + return o && (o.$typeUrl === Validator.typeUrl || (o.address instanceof Uint8Array || typeof o.address === "string") && typeof o.power === "bigint"); + }, encode(message: Validator, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.address.length !== 0) { writer.uint32(10).bytes(message.address); @@ -4764,6 +6466,18 @@ export const Validator = { } return message; }, + fromJSON(object: any): Validator { + return { + address: isSet(object.address) ? bytesFromBase64(object.address) : new Uint8Array(), + power: isSet(object.power) ? BigInt(object.power.toString()) : BigInt(0) + }; + }, + toJSON(message: Validator): unknown { + const obj: any = {}; + message.address !== undefined && (obj.address = base64FromBytes(message.address !== undefined ? message.address : new Uint8Array())); + message.power !== undefined && (obj.power = (message.power || BigInt(0)).toString()); + return obj; + }, fromPartial(object: Partial): Validator { const message = createBaseValidator(); message.address = object.address ?? new Uint8Array(); @@ -4771,14 +6485,18 @@ export const Validator = { return message; }, fromAmino(object: ValidatorAmino): Validator { - return { - address: object.address, - power: BigInt(object.power) - }; + const message = createBaseValidator(); + if (object.address !== undefined && object.address !== null) { + message.address = bytesFromBase64(object.address); + } + if (object.power !== undefined && object.power !== null) { + message.power = BigInt(object.power); + } + return message; }, toAmino(message: Validator): ValidatorAmino { const obj: any = {}; - obj.address = message.address; + obj.address = message.address ? base64FromBytes(message.address) : undefined; obj.power = message.power ? message.power.toString() : undefined; return obj; }, @@ -4798,6 +6516,7 @@ export const Validator = { }; } }; +GlobalDecoderRegistry.register(Validator.typeUrl, Validator); function createBaseValidatorUpdate(): ValidatorUpdate { return { pubKey: PublicKey.fromPartial({}), @@ -4806,6 +6525,15 @@ function createBaseValidatorUpdate(): ValidatorUpdate { } export const ValidatorUpdate = { typeUrl: "/tendermint.abci.ValidatorUpdate", + is(o: any): o is ValidatorUpdate { + return o && (o.$typeUrl === ValidatorUpdate.typeUrl || PublicKey.is(o.pubKey) && typeof o.power === "bigint"); + }, + isSDK(o: any): o is ValidatorUpdateSDKType { + return o && (o.$typeUrl === ValidatorUpdate.typeUrl || PublicKey.isSDK(o.pub_key) && typeof o.power === "bigint"); + }, + isAmino(o: any): o is ValidatorUpdateAmino { + return o && (o.$typeUrl === ValidatorUpdate.typeUrl || PublicKey.isAmino(o.pub_key) && typeof o.power === "bigint"); + }, encode(message: ValidatorUpdate, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.pubKey !== undefined) { PublicKey.encode(message.pubKey, writer.uint32(10).fork()).ldelim(); @@ -4835,6 +6563,18 @@ export const ValidatorUpdate = { } return message; }, + fromJSON(object: any): ValidatorUpdate { + return { + pubKey: isSet(object.pubKey) ? PublicKey.fromJSON(object.pubKey) : undefined, + power: isSet(object.power) ? BigInt(object.power.toString()) : BigInt(0) + }; + }, + 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 || BigInt(0)).toString()); + return obj; + }, fromPartial(object: Partial): ValidatorUpdate { const message = createBaseValidatorUpdate(); message.pubKey = object.pubKey !== undefined && object.pubKey !== null ? PublicKey.fromPartial(object.pubKey) : undefined; @@ -4842,10 +6582,14 @@ export const ValidatorUpdate = { return message; }, fromAmino(object: ValidatorUpdateAmino): ValidatorUpdate { - return { - pubKey: object?.pub_key ? PublicKey.fromAmino(object.pub_key) : undefined, - power: BigInt(object.power) - }; + const message = createBaseValidatorUpdate(); + if (object.pub_key !== undefined && object.pub_key !== null) { + message.pubKey = PublicKey.fromAmino(object.pub_key); + } + if (object.power !== undefined && object.power !== null) { + message.power = BigInt(object.power); + } + return message; }, toAmino(message: ValidatorUpdate): ValidatorUpdateAmino { const obj: any = {}; @@ -4869,6 +6613,7 @@ export const ValidatorUpdate = { }; } }; +GlobalDecoderRegistry.register(ValidatorUpdate.typeUrl, ValidatorUpdate); function createBaseVoteInfo(): VoteInfo { return { validator: Validator.fromPartial({}), @@ -4877,6 +6622,15 @@ function createBaseVoteInfo(): VoteInfo { } export const VoteInfo = { typeUrl: "/tendermint.abci.VoteInfo", + is(o: any): o is VoteInfo { + return o && (o.$typeUrl === VoteInfo.typeUrl || Validator.is(o.validator) && typeof o.signedLastBlock === "boolean"); + }, + isSDK(o: any): o is VoteInfoSDKType { + return o && (o.$typeUrl === VoteInfo.typeUrl || Validator.isSDK(o.validator) && typeof o.signed_last_block === "boolean"); + }, + isAmino(o: any): o is VoteInfoAmino { + return o && (o.$typeUrl === VoteInfo.typeUrl || Validator.isAmino(o.validator) && typeof o.signed_last_block === "boolean"); + }, encode(message: VoteInfo, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.validator !== undefined) { Validator.encode(message.validator, writer.uint32(10).fork()).ldelim(); @@ -4906,6 +6660,18 @@ export const VoteInfo = { } return message; }, + fromJSON(object: any): VoteInfo { + return { + validator: isSet(object.validator) ? Validator.fromJSON(object.validator) : undefined, + signedLastBlock: isSet(object.signedLastBlock) ? Boolean(object.signedLastBlock) : false + }; + }, + toJSON(message: VoteInfo): unknown { + const obj: any = {}; + message.validator !== undefined && (obj.validator = message.validator ? Validator.toJSON(message.validator) : undefined); + message.signedLastBlock !== undefined && (obj.signedLastBlock = message.signedLastBlock); + return obj; + }, fromPartial(object: Partial): VoteInfo { const message = createBaseVoteInfo(); message.validator = object.validator !== undefined && object.validator !== null ? Validator.fromPartial(object.validator) : undefined; @@ -4913,10 +6679,14 @@ export const VoteInfo = { return message; }, fromAmino(object: VoteInfoAmino): VoteInfo { - return { - validator: object?.validator ? Validator.fromAmino(object.validator) : undefined, - signedLastBlock: object.signed_last_block - }; + const message = createBaseVoteInfo(); + if (object.validator !== undefined && object.validator !== null) { + message.validator = Validator.fromAmino(object.validator); + } + if (object.signed_last_block !== undefined && object.signed_last_block !== null) { + message.signedLastBlock = object.signed_last_block; + } + return message; }, toAmino(message: VoteInfo): VoteInfoAmino { const obj: any = {}; @@ -4940,18 +6710,139 @@ export const VoteInfo = { }; } }; -function createBaseEvidence(): Evidence { +GlobalDecoderRegistry.register(VoteInfo.typeUrl, VoteInfo); +function createBaseExtendedVoteInfo(): ExtendedVoteInfo { + return { + validator: Validator.fromPartial({}), + signedLastBlock: false, + voteExtension: new Uint8Array() + }; +} +export const ExtendedVoteInfo = { + typeUrl: "/tendermint.abci.ExtendedVoteInfo", + is(o: any): o is ExtendedVoteInfo { + return o && (o.$typeUrl === ExtendedVoteInfo.typeUrl || Validator.is(o.validator) && typeof o.signedLastBlock === "boolean" && (o.voteExtension instanceof Uint8Array || typeof o.voteExtension === "string")); + }, + isSDK(o: any): o is ExtendedVoteInfoSDKType { + return o && (o.$typeUrl === ExtendedVoteInfo.typeUrl || Validator.isSDK(o.validator) && typeof o.signed_last_block === "boolean" && (o.vote_extension instanceof Uint8Array || typeof o.vote_extension === "string")); + }, + isAmino(o: any): o is ExtendedVoteInfoAmino { + return o && (o.$typeUrl === ExtendedVoteInfo.typeUrl || Validator.isAmino(o.validator) && typeof o.signed_last_block === "boolean" && (o.vote_extension instanceof Uint8Array || typeof o.vote_extension === "string")); + }, + encode(message: ExtendedVoteInfo, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.validator !== undefined) { + Validator.encode(message.validator, writer.uint32(10).fork()).ldelim(); + } + if (message.signedLastBlock === true) { + writer.uint32(16).bool(message.signedLastBlock); + } + if (message.voteExtension.length !== 0) { + writer.uint32(26).bytes(message.voteExtension); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): ExtendedVoteInfo { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseExtendedVoteInfo(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.validator = Validator.decode(reader, reader.uint32()); + break; + case 2: + message.signedLastBlock = reader.bool(); + break; + case 3: + message.voteExtension = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): ExtendedVoteInfo { + return { + validator: isSet(object.validator) ? Validator.fromJSON(object.validator) : undefined, + signedLastBlock: isSet(object.signedLastBlock) ? Boolean(object.signedLastBlock) : false, + voteExtension: isSet(object.voteExtension) ? bytesFromBase64(object.voteExtension) : new Uint8Array() + }; + }, + toJSON(message: ExtendedVoteInfo): unknown { + const obj: any = {}; + message.validator !== undefined && (obj.validator = message.validator ? Validator.toJSON(message.validator) : undefined); + message.signedLastBlock !== undefined && (obj.signedLastBlock = message.signedLastBlock); + message.voteExtension !== undefined && (obj.voteExtension = base64FromBytes(message.voteExtension !== undefined ? message.voteExtension : new Uint8Array())); + return obj; + }, + fromPartial(object: Partial): ExtendedVoteInfo { + const message = createBaseExtendedVoteInfo(); + message.validator = object.validator !== undefined && object.validator !== null ? Validator.fromPartial(object.validator) : undefined; + message.signedLastBlock = object.signedLastBlock ?? false; + message.voteExtension = object.voteExtension ?? new Uint8Array(); + return message; + }, + fromAmino(object: ExtendedVoteInfoAmino): ExtendedVoteInfo { + const message = createBaseExtendedVoteInfo(); + if (object.validator !== undefined && object.validator !== null) { + message.validator = Validator.fromAmino(object.validator); + } + if (object.signed_last_block !== undefined && object.signed_last_block !== null) { + message.signedLastBlock = object.signed_last_block; + } + if (object.vote_extension !== undefined && object.vote_extension !== null) { + message.voteExtension = bytesFromBase64(object.vote_extension); + } + return message; + }, + toAmino(message: ExtendedVoteInfo): ExtendedVoteInfoAmino { + const obj: any = {}; + obj.validator = message.validator ? Validator.toAmino(message.validator) : undefined; + obj.signed_last_block = message.signedLastBlock; + obj.vote_extension = message.voteExtension ? base64FromBytes(message.voteExtension) : undefined; + return obj; + }, + fromAminoMsg(object: ExtendedVoteInfoAminoMsg): ExtendedVoteInfo { + return ExtendedVoteInfo.fromAmino(object.value); + }, + fromProtoMsg(message: ExtendedVoteInfoProtoMsg): ExtendedVoteInfo { + return ExtendedVoteInfo.decode(message.value); + }, + toProto(message: ExtendedVoteInfo): Uint8Array { + return ExtendedVoteInfo.encode(message).finish(); + }, + toProtoMsg(message: ExtendedVoteInfo): ExtendedVoteInfoProtoMsg { + return { + typeUrl: "/tendermint.abci.ExtendedVoteInfo", + value: ExtendedVoteInfo.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(ExtendedVoteInfo.typeUrl, ExtendedVoteInfo); +function createBaseMisbehavior(): Misbehavior { return { type: 0, validator: Validator.fromPartial({}), height: BigInt(0), - time: undefined, + time: new Date(), totalVotingPower: BigInt(0) }; } -export const Evidence = { - typeUrl: "/tendermint.abci.Evidence", - encode(message: Evidence, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { +export const Misbehavior = { + typeUrl: "/tendermint.abci.Misbehavior", + is(o: any): o is Misbehavior { + return o && (o.$typeUrl === Misbehavior.typeUrl || isSet(o.type) && Validator.is(o.validator) && typeof o.height === "bigint" && Timestamp.is(o.time) && typeof o.totalVotingPower === "bigint"); + }, + isSDK(o: any): o is MisbehaviorSDKType { + return o && (o.$typeUrl === Misbehavior.typeUrl || isSet(o.type) && Validator.isSDK(o.validator) && typeof o.height === "bigint" && Timestamp.isSDK(o.time) && typeof o.total_voting_power === "bigint"); + }, + isAmino(o: any): o is MisbehaviorAmino { + return o && (o.$typeUrl === Misbehavior.typeUrl || isSet(o.type) && Validator.isAmino(o.validator) && typeof o.height === "bigint" && Timestamp.isAmino(o.time) && typeof o.total_voting_power === "bigint"); + }, + encode(message: Misbehavior, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.type !== 0) { writer.uint32(8).int32(message.type); } @@ -4969,10 +6860,10 @@ export const Evidence = { } return writer; }, - decode(input: BinaryReader | Uint8Array, length?: number): Evidence { + decode(input: BinaryReader | Uint8Array, length?: number): Misbehavior { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseEvidence(); + const message = createBaseMisbehavior(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -4998,8 +6889,26 @@ export const Evidence = { } return message; }, - fromPartial(object: Partial): Evidence { - const message = createBaseEvidence(); + fromJSON(object: any): Misbehavior { + return { + type: isSet(object.type) ? misbehaviorTypeFromJSON(object.type) : -1, + validator: isSet(object.validator) ? Validator.fromJSON(object.validator) : undefined, + height: isSet(object.height) ? BigInt(object.height.toString()) : BigInt(0), + time: isSet(object.time) ? new Date(object.time) : undefined, + totalVotingPower: isSet(object.totalVotingPower) ? BigInt(object.totalVotingPower.toString()) : BigInt(0) + }; + }, + toJSON(message: Misbehavior): unknown { + const obj: any = {}; + message.type !== undefined && (obj.type = misbehaviorTypeToJSON(message.type)); + message.validator !== undefined && (obj.validator = message.validator ? Validator.toJSON(message.validator) : undefined); + message.height !== undefined && (obj.height = (message.height || BigInt(0)).toString()); + message.time !== undefined && (obj.time = message.time.toISOString()); + message.totalVotingPower !== undefined && (obj.totalVotingPower = (message.totalVotingPower || BigInt(0)).toString()); + return obj; + }, + fromPartial(object: Partial): Misbehavior { + const message = createBaseMisbehavior(); 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 ? BigInt(object.height.toString()) : BigInt(0); @@ -5007,40 +6916,51 @@ export const Evidence = { message.totalVotingPower = object.totalVotingPower !== undefined && object.totalVotingPower !== null ? BigInt(object.totalVotingPower.toString()) : BigInt(0); return message; }, - fromAmino(object: EvidenceAmino): Evidence { - return { - type: isSet(object.type) ? evidenceTypeFromJSON(object.type) : -1, - validator: object?.validator ? Validator.fromAmino(object.validator) : undefined, - height: BigInt(object.height), - time: object.time, - totalVotingPower: BigInt(object.total_voting_power) - }; + fromAmino(object: MisbehaviorAmino): Misbehavior { + const message = createBaseMisbehavior(); + if (object.type !== undefined && object.type !== null) { + message.type = misbehaviorTypeFromJSON(object.type); + } + if (object.validator !== undefined && object.validator !== null) { + message.validator = Validator.fromAmino(object.validator); + } + if (object.height !== undefined && object.height !== null) { + message.height = BigInt(object.height); + } + if (object.time !== undefined && object.time !== null) { + message.time = fromTimestamp(Timestamp.fromAmino(object.time)); + } + if (object.total_voting_power !== undefined && object.total_voting_power !== null) { + message.totalVotingPower = BigInt(object.total_voting_power); + } + return message; }, - toAmino(message: Evidence): EvidenceAmino { + toAmino(message: Misbehavior): MisbehaviorAmino { const obj: any = {}; - obj.type = message.type; + obj.type = misbehaviorTypeToJSON(message.type); obj.validator = message.validator ? Validator.toAmino(message.validator) : undefined; obj.height = message.height ? message.height.toString() : undefined; - obj.time = message.time; + obj.time = message.time ? Timestamp.toAmino(toTimestamp(message.time)) : undefined; obj.total_voting_power = message.totalVotingPower ? message.totalVotingPower.toString() : undefined; return obj; }, - fromAminoMsg(object: EvidenceAminoMsg): Evidence { - return Evidence.fromAmino(object.value); + fromAminoMsg(object: MisbehaviorAminoMsg): Misbehavior { + return Misbehavior.fromAmino(object.value); }, - fromProtoMsg(message: EvidenceProtoMsg): Evidence { - return Evidence.decode(message.value); + fromProtoMsg(message: MisbehaviorProtoMsg): Misbehavior { + return Misbehavior.decode(message.value); }, - toProto(message: Evidence): Uint8Array { - return Evidence.encode(message).finish(); + toProto(message: Misbehavior): Uint8Array { + return Misbehavior.encode(message).finish(); }, - toProtoMsg(message: Evidence): EvidenceProtoMsg { + toProtoMsg(message: Misbehavior): MisbehaviorProtoMsg { return { - typeUrl: "/tendermint.abci.Evidence", - value: Evidence.encode(message).finish() + typeUrl: "/tendermint.abci.Misbehavior", + value: Misbehavior.encode(message).finish() }; } }; +GlobalDecoderRegistry.register(Misbehavior.typeUrl, Misbehavior); function createBaseSnapshot(): Snapshot { return { height: BigInt(0), @@ -5052,6 +6972,15 @@ function createBaseSnapshot(): Snapshot { } export const Snapshot = { typeUrl: "/tendermint.abci.Snapshot", + is(o: any): o is Snapshot { + return o && (o.$typeUrl === Snapshot.typeUrl || typeof o.height === "bigint" && typeof o.format === "number" && typeof o.chunks === "number" && (o.hash instanceof Uint8Array || typeof o.hash === "string") && (o.metadata instanceof Uint8Array || typeof o.metadata === "string")); + }, + isSDK(o: any): o is SnapshotSDKType { + return o && (o.$typeUrl === Snapshot.typeUrl || typeof o.height === "bigint" && typeof o.format === "number" && typeof o.chunks === "number" && (o.hash instanceof Uint8Array || typeof o.hash === "string") && (o.metadata instanceof Uint8Array || typeof o.metadata === "string")); + }, + isAmino(o: any): o is SnapshotAmino { + return o && (o.$typeUrl === Snapshot.typeUrl || typeof o.height === "bigint" && typeof o.format === "number" && typeof o.chunks === "number" && (o.hash instanceof Uint8Array || typeof o.hash === "string") && (o.metadata instanceof Uint8Array || typeof o.metadata === "string")); + }, encode(message: Snapshot, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.height !== BigInt(0)) { writer.uint32(8).uint64(message.height); @@ -5099,6 +7028,24 @@ export const Snapshot = { } return message; }, + fromJSON(object: any): Snapshot { + return { + height: isSet(object.height) ? BigInt(object.height.toString()) : BigInt(0), + 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() + }; + }, + toJSON(message: Snapshot): unknown { + const obj: any = {}; + message.height !== undefined && (obj.height = (message.height || BigInt(0)).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 = base64FromBytes(message.metadata !== undefined ? message.metadata : new Uint8Array())); + return obj; + }, fromPartial(object: Partial): Snapshot { const message = createBaseSnapshot(); message.height = object.height !== undefined && object.height !== null ? BigInt(object.height.toString()) : BigInt(0); @@ -5109,21 +7056,31 @@ export const Snapshot = { return message; }, fromAmino(object: SnapshotAmino): Snapshot { - return { - height: BigInt(object.height), - format: object.format, - chunks: object.chunks, - hash: object.hash, - metadata: object.metadata - }; + const message = createBaseSnapshot(); + if (object.height !== undefined && object.height !== null) { + message.height = BigInt(object.height); + } + if (object.format !== undefined && object.format !== null) { + message.format = object.format; + } + if (object.chunks !== undefined && object.chunks !== null) { + message.chunks = object.chunks; + } + if (object.hash !== undefined && object.hash !== null) { + message.hash = bytesFromBase64(object.hash); + } + if (object.metadata !== undefined && object.metadata !== null) { + message.metadata = bytesFromBase64(object.metadata); + } + return message; }, toAmino(message: Snapshot): SnapshotAmino { const obj: any = {}; obj.height = message.height ? message.height.toString() : undefined; obj.format = message.format; obj.chunks = message.chunks; - obj.hash = message.hash; - obj.metadata = message.metadata; + obj.hash = message.hash ? base64FromBytes(message.hash) : undefined; + obj.metadata = message.metadata ? base64FromBytes(message.metadata) : undefined; return obj; }, fromAminoMsg(object: SnapshotAminoMsg): Snapshot { @@ -5141,4 +7098,5 @@ export const Snapshot = { value: Snapshot.encode(message).finish() }; } -}; \ No newline at end of file +}; +GlobalDecoderRegistry.register(Snapshot.typeUrl, Snapshot); \ No newline at end of file diff --git a/packages/osmojs/src/codegen/tendermint/bundle.ts b/packages/osmojs/src/codegen/tendermint/bundle.ts index a1405caeb..9c53fd590 100644 --- a/packages/osmojs/src/codegen/tendermint/bundle.ts +++ b/packages/osmojs/src/codegen/tendermint/bundle.ts @@ -1,38 +1,38 @@ -import * as _179 from "./abci/types"; -import * as _180 from "./crypto/keys"; -import * as _181 from "./crypto/proof"; -import * as _182 from "./libs/bits/types"; -import * as _183 from "./p2p/types"; -import * as _184 from "./types/block"; -import * as _185 from "./types/evidence"; -import * as _186 from "./types/params"; -import * as _187 from "./types/types"; -import * as _188 from "./types/validator"; -import * as _189 from "./version/types"; +import * as _75 from "./abci/types"; +import * as _76 from "./crypto/keys"; +import * as _77 from "./crypto/proof"; +import * as _78 from "./libs/bits/types"; +import * as _79 from "./p2p/types"; +import * as _80 from "./types/block"; +import * as _81 from "./types/evidence"; +import * as _82 from "./types/params"; +import * as _83 from "./types/types"; +import * as _84 from "./types/validator"; +import * as _85 from "./version/types"; export namespace tendermint { export const abci = { - ..._179 + ..._75 }; export const crypto = { - ..._180, - ..._181 + ..._76, + ..._77 }; export namespace libs { export const bits = { - ..._182 + ..._78 }; } export const p2p = { - ..._183 + ..._79 }; export const types = { - ..._184, - ..._185, - ..._186, - ..._187, - ..._188 + ..._80, + ..._81, + ..._82, + ..._83, + ..._84 }; export const version = { - ..._189 + ..._85 }; } \ No newline at end of file diff --git a/packages/osmojs/src/codegen/tendermint/crypto/keys.ts b/packages/osmojs/src/codegen/tendermint/crypto/keys.ts index 54a0ef252..68e580915 100644 --- a/packages/osmojs/src/codegen/tendermint/crypto/keys.ts +++ b/packages/osmojs/src/codegen/tendermint/crypto/keys.ts @@ -1,5 +1,7 @@ import { BinaryReader, BinaryWriter } from "../../binary"; -/** PublicKey defines the keys available for use with Tendermint Validators */ +import { isSet, bytesFromBase64, base64FromBytes } from "../../helpers"; +import { GlobalDecoderRegistry } from "../../registry"; +/** PublicKey defines the keys available for use with Validators */ export interface PublicKey { ed25519?: Uint8Array; secp256k1?: Uint8Array; @@ -8,16 +10,16 @@ export interface PublicKeyProtoMsg { typeUrl: "/tendermint.crypto.PublicKey"; value: Uint8Array; } -/** PublicKey defines the keys available for use with Tendermint Validators */ +/** PublicKey defines the keys available for use with Validators */ export interface PublicKeyAmino { - ed25519?: Uint8Array; - secp256k1?: Uint8Array; + ed25519?: string; + secp256k1?: string; } export interface PublicKeyAminoMsg { type: "/tendermint.crypto.PublicKey"; value: PublicKeyAmino; } -/** PublicKey defines the keys available for use with Tendermint Validators */ +/** PublicKey defines the keys available for use with Validators */ export interface PublicKeySDKType { ed25519?: Uint8Array; secp256k1?: Uint8Array; @@ -30,6 +32,15 @@ function createBasePublicKey(): PublicKey { } export const PublicKey = { typeUrl: "/tendermint.crypto.PublicKey", + is(o: any): o is PublicKey { + return o && o.$typeUrl === PublicKey.typeUrl; + }, + isSDK(o: any): o is PublicKeySDKType { + return o && o.$typeUrl === PublicKey.typeUrl; + }, + isAmino(o: any): o is PublicKeyAmino { + return o && o.$typeUrl === PublicKey.typeUrl; + }, encode(message: PublicKey, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.ed25519 !== undefined) { writer.uint32(10).bytes(message.ed25519); @@ -59,6 +70,18 @@ export const PublicKey = { } return message; }, + fromJSON(object: any): PublicKey { + return { + ed25519: isSet(object.ed25519) ? bytesFromBase64(object.ed25519) : undefined, + secp256k1: isSet(object.secp256k1) ? bytesFromBase64(object.secp256k1) : undefined + }; + }, + toJSON(message: PublicKey): unknown { + const obj: any = {}; + message.ed25519 !== undefined && (obj.ed25519 = message.ed25519 !== undefined ? base64FromBytes(message.ed25519) : undefined); + message.secp256k1 !== undefined && (obj.secp256k1 = message.secp256k1 !== undefined ? base64FromBytes(message.secp256k1) : undefined); + return obj; + }, fromPartial(object: Partial): PublicKey { const message = createBasePublicKey(); message.ed25519 = object.ed25519 ?? undefined; @@ -66,15 +89,19 @@ export const PublicKey = { return message; }, fromAmino(object: PublicKeyAmino): PublicKey { - return { - ed25519: object?.ed25519, - secp256k1: object?.secp256k1 - }; + const message = createBasePublicKey(); + if (object.ed25519 !== undefined && object.ed25519 !== null) { + message.ed25519 = bytesFromBase64(object.ed25519); + } + if (object.secp256k1 !== undefined && object.secp256k1 !== null) { + message.secp256k1 = bytesFromBase64(object.secp256k1); + } + return message; }, toAmino(message: PublicKey): PublicKeyAmino { const obj: any = {}; - obj.ed25519 = message.ed25519; - obj.secp256k1 = message.secp256k1; + obj.ed25519 = message.ed25519 ? base64FromBytes(message.ed25519) : undefined; + obj.secp256k1 = message.secp256k1 ? base64FromBytes(message.secp256k1) : undefined; return obj; }, fromAminoMsg(object: PublicKeyAminoMsg): PublicKey { @@ -92,4 +119,5 @@ export const PublicKey = { value: PublicKey.encode(message).finish() }; } -}; \ No newline at end of file +}; +GlobalDecoderRegistry.register(PublicKey.typeUrl, PublicKey); \ No newline at end of file diff --git a/packages/osmojs/src/codegen/tendermint/crypto/proof.ts b/packages/osmojs/src/codegen/tendermint/crypto/proof.ts index baf80ed42..b516ee689 100644 --- a/packages/osmojs/src/codegen/tendermint/crypto/proof.ts +++ b/packages/osmojs/src/codegen/tendermint/crypto/proof.ts @@ -1,4 +1,6 @@ import { BinaryReader, BinaryWriter } from "../../binary"; +import { isSet, bytesFromBase64, base64FromBytes } from "../../helpers"; +import { GlobalDecoderRegistry } from "../../registry"; export interface Proof { total: bigint; index: bigint; @@ -10,10 +12,10 @@ export interface ProofProtoMsg { value: Uint8Array; } export interface ProofAmino { - total: string; - index: string; - leaf_hash: Uint8Array; - aunts: Uint8Array[]; + total?: string; + index?: string; + leaf_hash?: string; + aunts?: string[]; } export interface ProofAminoMsg { type: "/tendermint.crypto.Proof"; @@ -29,7 +31,7 @@ export interface ValueOp { /** Encoded in ProofOp.Key. */ key: Uint8Array; /** To encode in ProofOp.Data */ - proof: Proof; + proof?: Proof; } export interface ValueOpProtoMsg { typeUrl: "/tendermint.crypto.ValueOp"; @@ -37,7 +39,7 @@ export interface ValueOpProtoMsg { } export interface ValueOpAmino { /** Encoded in ProofOp.Key. */ - key: Uint8Array; + key?: string; /** To encode in ProofOp.Data */ proof?: ProofAmino; } @@ -47,7 +49,7 @@ export interface ValueOpAminoMsg { } export interface ValueOpSDKType { key: Uint8Array; - proof: ProofSDKType; + proof?: ProofSDKType; } export interface DominoOp { key: string; @@ -59,9 +61,9 @@ export interface DominoOpProtoMsg { value: Uint8Array; } export interface DominoOpAmino { - key: string; - input: string; - output: string; + key?: string; + input?: string; + output?: string; } export interface DominoOpAminoMsg { type: "/tendermint.crypto.DominoOp"; @@ -92,9 +94,9 @@ export interface ProofOpProtoMsg { * for example neighbouring node hash */ export interface ProofOpAmino { - type: string; - key: Uint8Array; - data: Uint8Array; + type?: string; + key?: string; + data?: string; } export interface ProofOpAminoMsg { type: "/tendermint.crypto.ProofOp"; @@ -120,7 +122,7 @@ export interface ProofOpsProtoMsg { } /** ProofOps is Merkle proof defined by the list of ProofOps */ export interface ProofOpsAmino { - ops: ProofOpAmino[]; + ops?: ProofOpAmino[]; } export interface ProofOpsAminoMsg { type: "/tendermint.crypto.ProofOps"; @@ -140,6 +142,15 @@ function createBaseProof(): Proof { } export const Proof = { typeUrl: "/tendermint.crypto.Proof", + is(o: any): o is Proof { + return o && (o.$typeUrl === Proof.typeUrl || typeof o.total === "bigint" && typeof o.index === "bigint" && (o.leafHash instanceof Uint8Array || typeof o.leafHash === "string") && Array.isArray(o.aunts) && (!o.aunts.length || o.aunts[0] instanceof Uint8Array || typeof o.aunts[0] === "string")); + }, + isSDK(o: any): o is ProofSDKType { + return o && (o.$typeUrl === Proof.typeUrl || typeof o.total === "bigint" && typeof o.index === "bigint" && (o.leaf_hash instanceof Uint8Array || typeof o.leaf_hash === "string") && Array.isArray(o.aunts) && (!o.aunts.length || o.aunts[0] instanceof Uint8Array || typeof o.aunts[0] === "string")); + }, + isAmino(o: any): o is ProofAmino { + return o && (o.$typeUrl === Proof.typeUrl || typeof o.total === "bigint" && typeof o.index === "bigint" && (o.leaf_hash instanceof Uint8Array || typeof o.leaf_hash === "string") && Array.isArray(o.aunts) && (!o.aunts.length || o.aunts[0] instanceof Uint8Array || typeof o.aunts[0] === "string")); + }, encode(message: Proof, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.total !== BigInt(0)) { writer.uint32(8).int64(message.total); @@ -181,6 +192,26 @@ export const Proof = { } return message; }, + fromJSON(object: any): Proof { + return { + total: isSet(object.total) ? BigInt(object.total.toString()) : BigInt(0), + index: isSet(object.index) ? BigInt(object.index.toString()) : BigInt(0), + 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 || BigInt(0)).toString()); + message.index !== undefined && (obj.index = (message.index || BigInt(0)).toString()); + message.leafHash !== undefined && (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())); + } else { + obj.aunts = []; + } + return obj; + }, fromPartial(object: Partial): Proof { const message = createBaseProof(); message.total = object.total !== undefined && object.total !== null ? BigInt(object.total.toString()) : BigInt(0); @@ -190,20 +221,26 @@ export const Proof = { return message; }, fromAmino(object: ProofAmino): Proof { - return { - total: BigInt(object.total), - index: BigInt(object.index), - leafHash: object.leaf_hash, - aunts: Array.isArray(object?.aunts) ? object.aunts.map((e: any) => e) : [] - }; + const message = createBaseProof(); + if (object.total !== undefined && object.total !== null) { + message.total = BigInt(object.total); + } + if (object.index !== undefined && object.index !== null) { + message.index = BigInt(object.index); + } + if (object.leaf_hash !== undefined && object.leaf_hash !== null) { + message.leafHash = bytesFromBase64(object.leaf_hash); + } + message.aunts = object.aunts?.map(e => bytesFromBase64(e)) || []; + return message; }, toAmino(message: Proof): ProofAmino { const obj: any = {}; obj.total = message.total ? message.total.toString() : undefined; obj.index = message.index ? message.index.toString() : undefined; - obj.leaf_hash = message.leafHash; + obj.leaf_hash = message.leafHash ? base64FromBytes(message.leafHash) : undefined; if (message.aunts) { - obj.aunts = message.aunts.map(e => e); + obj.aunts = message.aunts.map(e => base64FromBytes(e)); } else { obj.aunts = []; } @@ -225,14 +262,24 @@ export const Proof = { }; } }; +GlobalDecoderRegistry.register(Proof.typeUrl, Proof); function createBaseValueOp(): ValueOp { return { key: new Uint8Array(), - proof: Proof.fromPartial({}) + proof: undefined }; } export const ValueOp = { typeUrl: "/tendermint.crypto.ValueOp", + is(o: any): o is ValueOp { + return o && (o.$typeUrl === ValueOp.typeUrl || o.key instanceof Uint8Array || typeof o.key === "string"); + }, + isSDK(o: any): o is ValueOpSDKType { + return o && (o.$typeUrl === ValueOp.typeUrl || o.key instanceof Uint8Array || typeof o.key === "string"); + }, + isAmino(o: any): o is ValueOpAmino { + return o && (o.$typeUrl === ValueOp.typeUrl || o.key instanceof Uint8Array || typeof o.key === "string"); + }, encode(message: ValueOp, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.key.length !== 0) { writer.uint32(10).bytes(message.key); @@ -262,6 +309,18 @@ export const ValueOp = { } 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 = {}; + 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; + }, fromPartial(object: Partial): ValueOp { const message = createBaseValueOp(); message.key = object.key ?? new Uint8Array(); @@ -269,14 +328,18 @@ export const ValueOp = { return message; }, fromAmino(object: ValueOpAmino): ValueOp { - return { - key: object.key, - proof: object?.proof ? Proof.fromAmino(object.proof) : undefined - }; + const message = createBaseValueOp(); + if (object.key !== undefined && object.key !== null) { + message.key = bytesFromBase64(object.key); + } + if (object.proof !== undefined && object.proof !== null) { + message.proof = Proof.fromAmino(object.proof); + } + return message; }, toAmino(message: ValueOp): ValueOpAmino { const obj: any = {}; - obj.key = message.key; + obj.key = message.key ? base64FromBytes(message.key) : undefined; obj.proof = message.proof ? Proof.toAmino(message.proof) : undefined; return obj; }, @@ -296,6 +359,7 @@ export const ValueOp = { }; } }; +GlobalDecoderRegistry.register(ValueOp.typeUrl, ValueOp); function createBaseDominoOp(): DominoOp { return { key: "", @@ -305,6 +369,15 @@ function createBaseDominoOp(): DominoOp { } export const DominoOp = { typeUrl: "/tendermint.crypto.DominoOp", + is(o: any): o is DominoOp { + return o && (o.$typeUrl === DominoOp.typeUrl || typeof o.key === "string" && typeof o.input === "string" && typeof o.output === "string"); + }, + isSDK(o: any): o is DominoOpSDKType { + return o && (o.$typeUrl === DominoOp.typeUrl || typeof o.key === "string" && typeof o.input === "string" && typeof o.output === "string"); + }, + isAmino(o: any): o is DominoOpAmino { + return o && (o.$typeUrl === DominoOp.typeUrl || typeof o.key === "string" && typeof o.input === "string" && typeof o.output === "string"); + }, encode(message: DominoOp, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.key !== "") { writer.uint32(10).string(message.key); @@ -340,6 +413,20 @@ export const DominoOp = { } return message; }, + fromJSON(object: any): DominoOp { + return { + 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; + }, fromPartial(object: Partial): DominoOp { const message = createBaseDominoOp(); message.key = object.key ?? ""; @@ -348,11 +435,17 @@ export const DominoOp = { return message; }, fromAmino(object: DominoOpAmino): DominoOp { - return { - key: object.key, - input: object.input, - output: object.output - }; + const message = createBaseDominoOp(); + if (object.key !== undefined && object.key !== null) { + message.key = object.key; + } + if (object.input !== undefined && object.input !== null) { + message.input = object.input; + } + if (object.output !== undefined && object.output !== null) { + message.output = object.output; + } + return message; }, toAmino(message: DominoOp): DominoOpAmino { const obj: any = {}; @@ -377,6 +470,7 @@ export const DominoOp = { }; } }; +GlobalDecoderRegistry.register(DominoOp.typeUrl, DominoOp); function createBaseProofOp(): ProofOp { return { type: "", @@ -386,6 +480,15 @@ function createBaseProofOp(): ProofOp { } export const ProofOp = { typeUrl: "/tendermint.crypto.ProofOp", + is(o: any): o is ProofOp { + return o && (o.$typeUrl === ProofOp.typeUrl || typeof o.type === "string" && (o.key instanceof Uint8Array || typeof o.key === "string") && (o.data instanceof Uint8Array || typeof o.data === "string")); + }, + isSDK(o: any): o is ProofOpSDKType { + return o && (o.$typeUrl === ProofOp.typeUrl || typeof o.type === "string" && (o.key instanceof Uint8Array || typeof o.key === "string") && (o.data instanceof Uint8Array || typeof o.data === "string")); + }, + isAmino(o: any): o is ProofOpAmino { + return o && (o.$typeUrl === ProofOp.typeUrl || typeof o.type === "string" && (o.key instanceof Uint8Array || typeof o.key === "string") && (o.data instanceof Uint8Array || typeof o.data === "string")); + }, encode(message: ProofOp, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.type !== "") { writer.uint32(10).string(message.type); @@ -421,6 +524,20 @@ export const ProofOp = { } return message; }, + fromJSON(object: any): ProofOp { + return { + 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); + message.key !== undefined && (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; + }, fromPartial(object: Partial): ProofOp { const message = createBaseProofOp(); message.type = object.type ?? ""; @@ -429,17 +546,23 @@ export const ProofOp = { return message; }, fromAmino(object: ProofOpAmino): ProofOp { - return { - type: object.type, - key: object.key, - data: object.data - }; + const message = createBaseProofOp(); + if (object.type !== undefined && object.type !== null) { + message.type = object.type; + } + if (object.key !== undefined && object.key !== null) { + message.key = bytesFromBase64(object.key); + } + if (object.data !== undefined && object.data !== null) { + message.data = bytesFromBase64(object.data); + } + return message; }, toAmino(message: ProofOp): ProofOpAmino { const obj: any = {}; obj.type = message.type; - obj.key = message.key; - obj.data = message.data; + obj.key = message.key ? base64FromBytes(message.key) : undefined; + obj.data = message.data ? base64FromBytes(message.data) : undefined; return obj; }, fromAminoMsg(object: ProofOpAminoMsg): ProofOp { @@ -458,6 +581,7 @@ export const ProofOp = { }; } }; +GlobalDecoderRegistry.register(ProofOp.typeUrl, ProofOp); function createBaseProofOps(): ProofOps { return { ops: [] @@ -465,6 +589,15 @@ function createBaseProofOps(): ProofOps { } export const ProofOps = { typeUrl: "/tendermint.crypto.ProofOps", + is(o: any): o is ProofOps { + return o && (o.$typeUrl === ProofOps.typeUrl || Array.isArray(o.ops) && (!o.ops.length || ProofOp.is(o.ops[0]))); + }, + isSDK(o: any): o is ProofOpsSDKType { + return o && (o.$typeUrl === ProofOps.typeUrl || Array.isArray(o.ops) && (!o.ops.length || ProofOp.isSDK(o.ops[0]))); + }, + isAmino(o: any): o is ProofOpsAmino { + return o && (o.$typeUrl === ProofOps.typeUrl || Array.isArray(o.ops) && (!o.ops.length || ProofOp.isAmino(o.ops[0]))); + }, encode(message: ProofOps, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.ops) { ProofOp.encode(v!, writer.uint32(10).fork()).ldelim(); @@ -488,15 +621,29 @@ export const ProofOps = { } return message; }, + fromJSON(object: any): ProofOps { + return { + ops: Array.isArray(object?.ops) ? object.ops.map((e: any) => ProofOp.fromJSON(e)) : [] + }; + }, + toJSON(message: ProofOps): unknown { + const obj: any = {}; + if (message.ops) { + obj.ops = message.ops.map(e => e ? ProofOp.toJSON(e) : undefined); + } else { + obj.ops = []; + } + return obj; + }, fromPartial(object: Partial): ProofOps { const message = createBaseProofOps(); message.ops = object.ops?.map(e => ProofOp.fromPartial(e)) || []; return message; }, fromAmino(object: ProofOpsAmino): ProofOps { - return { - ops: Array.isArray(object?.ops) ? object.ops.map((e: any) => ProofOp.fromAmino(e)) : [] - }; + const message = createBaseProofOps(); + message.ops = object.ops?.map(e => ProofOp.fromAmino(e)) || []; + return message; }, toAmino(message: ProofOps): ProofOpsAmino { const obj: any = {}; @@ -522,4 +669,5 @@ export const ProofOps = { value: ProofOps.encode(message).finish() }; } -}; \ No newline at end of file +}; +GlobalDecoderRegistry.register(ProofOps.typeUrl, ProofOps); \ No newline at end of file diff --git a/packages/osmojs/src/codegen/tendermint/libs/bits/types.ts b/packages/osmojs/src/codegen/tendermint/libs/bits/types.ts index b7a7e607a..4cf72e1fb 100644 --- a/packages/osmojs/src/codegen/tendermint/libs/bits/types.ts +++ b/packages/osmojs/src/codegen/tendermint/libs/bits/types.ts @@ -1,4 +1,6 @@ import { BinaryReader, BinaryWriter } from "../../../binary"; +import { isSet } from "../../../helpers"; +import { GlobalDecoderRegistry } from "../../../registry"; export interface BitArray { bits: bigint; elems: bigint[]; @@ -8,8 +10,8 @@ export interface BitArrayProtoMsg { value: Uint8Array; } export interface BitArrayAmino { - bits: string; - elems: string[]; + bits?: string; + elems?: string[]; } export interface BitArrayAminoMsg { type: "/tendermint.libs.bits.BitArray"; @@ -27,6 +29,15 @@ function createBaseBitArray(): BitArray { } export const BitArray = { typeUrl: "/tendermint.libs.bits.BitArray", + is(o: any): o is BitArray { + return o && (o.$typeUrl === BitArray.typeUrl || typeof o.bits === "bigint" && Array.isArray(o.elems) && (!o.elems.length || typeof o.elems[0] === "bigint")); + }, + isSDK(o: any): o is BitArraySDKType { + return o && (o.$typeUrl === BitArray.typeUrl || typeof o.bits === "bigint" && Array.isArray(o.elems) && (!o.elems.length || typeof o.elems[0] === "bigint")); + }, + isAmino(o: any): o is BitArrayAmino { + return o && (o.$typeUrl === BitArray.typeUrl || typeof o.bits === "bigint" && Array.isArray(o.elems) && (!o.elems.length || typeof o.elems[0] === "bigint")); + }, encode(message: BitArray, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.bits !== BigInt(0)) { writer.uint32(8).int64(message.bits); @@ -65,6 +76,22 @@ export const BitArray = { } return message; }, + fromJSON(object: any): BitArray { + return { + bits: isSet(object.bits) ? BigInt(object.bits.toString()) : BigInt(0), + elems: Array.isArray(object?.elems) ? object.elems.map((e: any) => BigInt(e.toString())) : [] + }; + }, + toJSON(message: BitArray): unknown { + const obj: any = {}; + message.bits !== undefined && (obj.bits = (message.bits || BigInt(0)).toString()); + if (message.elems) { + obj.elems = message.elems.map(e => (e || BigInt(0)).toString()); + } else { + obj.elems = []; + } + return obj; + }, fromPartial(object: Partial): BitArray { const message = createBaseBitArray(); message.bits = object.bits !== undefined && object.bits !== null ? BigInt(object.bits.toString()) : BigInt(0); @@ -72,10 +99,12 @@ export const BitArray = { return message; }, fromAmino(object: BitArrayAmino): BitArray { - return { - bits: BigInt(object.bits), - elems: Array.isArray(object?.elems) ? object.elems.map((e: any) => BigInt(e)) : [] - }; + const message = createBaseBitArray(); + if (object.bits !== undefined && object.bits !== null) { + message.bits = BigInt(object.bits); + } + message.elems = object.elems?.map(e => BigInt(e)) || []; + return message; }, toAmino(message: BitArray): BitArrayAmino { const obj: any = {}; @@ -102,4 +131,5 @@ export const BitArray = { value: BitArray.encode(message).finish() }; } -}; \ No newline at end of file +}; +GlobalDecoderRegistry.register(BitArray.typeUrl, BitArray); \ No newline at end of file diff --git a/packages/osmojs/src/codegen/tendermint/p2p/types.ts b/packages/osmojs/src/codegen/tendermint/p2p/types.ts index c0c2a8c28..b4f41cd9f 100644 --- a/packages/osmojs/src/codegen/tendermint/p2p/types.ts +++ b/packages/osmojs/src/codegen/tendermint/p2p/types.ts @@ -1,6 +1,29 @@ -import { Timestamp } from "../../google/protobuf/timestamp"; import { BinaryReader, BinaryWriter } from "../../binary"; -import { toTimestamp, fromTimestamp } from "../../helpers"; +import { isSet, bytesFromBase64, base64FromBytes } from "../../helpers"; +import { GlobalDecoderRegistry } from "../../registry"; +export interface NetAddress { + id: string; + ip: string; + port: number; +} +export interface NetAddressProtoMsg { + typeUrl: "/tendermint.p2p.NetAddress"; + value: Uint8Array; +} +export interface NetAddressAmino { + id?: string; + ip?: string; + port?: number; +} +export interface NetAddressAminoMsg { + type: "/tendermint.p2p.NetAddress"; + value: NetAddressAmino; +} +export interface NetAddressSDKType { + id: string; + ip: string; + port: number; +} export interface ProtocolVersion { p2p: bigint; block: bigint; @@ -11,9 +34,9 @@ export interface ProtocolVersionProtoMsg { value: Uint8Array; } export interface ProtocolVersionAmino { - p2p: string; - block: string; - app: string; + p2p?: string; + block?: string; + app?: string; } export interface ProtocolVersionAminoMsg { type: "/tendermint.p2p.ProtocolVersion"; @@ -24,113 +47,175 @@ export interface ProtocolVersionSDKType { block: bigint; app: bigint; } -export interface NodeInfo { +export interface DefaultNodeInfo { protocolVersion: ProtocolVersion; - nodeId: string; + defaultNodeId: string; listenAddr: string; network: string; version: string; channels: Uint8Array; moniker: string; - other: NodeInfoOther; + other: DefaultNodeInfoOther; } -export interface NodeInfoProtoMsg { - typeUrl: "/tendermint.p2p.NodeInfo"; +export interface DefaultNodeInfoProtoMsg { + typeUrl: "/tendermint.p2p.DefaultNodeInfo"; value: Uint8Array; } -export interface NodeInfoAmino { +export interface DefaultNodeInfoAmino { protocol_version?: ProtocolVersionAmino; - node_id: string; - listen_addr: string; - network: string; - version: string; - channels: Uint8Array; - moniker: string; - other?: NodeInfoOtherAmino; + default_node_id?: string; + listen_addr?: string; + network?: string; + version?: string; + channels?: string; + moniker?: string; + other?: DefaultNodeInfoOtherAmino; } -export interface NodeInfoAminoMsg { - type: "/tendermint.p2p.NodeInfo"; - value: NodeInfoAmino; +export interface DefaultNodeInfoAminoMsg { + type: "/tendermint.p2p.DefaultNodeInfo"; + value: DefaultNodeInfoAmino; } -export interface NodeInfoSDKType { +export interface DefaultNodeInfoSDKType { protocol_version: ProtocolVersionSDKType; - node_id: string; + default_node_id: string; listen_addr: string; network: string; version: string; channels: Uint8Array; moniker: string; - other: NodeInfoOtherSDKType; + other: DefaultNodeInfoOtherSDKType; } -export interface NodeInfoOther { +export interface DefaultNodeInfoOther { txIndex: string; rpcAddress: string; } -export interface NodeInfoOtherProtoMsg { - typeUrl: "/tendermint.p2p.NodeInfoOther"; +export interface DefaultNodeInfoOtherProtoMsg { + typeUrl: "/tendermint.p2p.DefaultNodeInfoOther"; value: Uint8Array; } -export interface NodeInfoOtherAmino { - tx_index: string; - rpc_address: string; +export interface DefaultNodeInfoOtherAmino { + tx_index?: string; + rpc_address?: string; } -export interface NodeInfoOtherAminoMsg { - type: "/tendermint.p2p.NodeInfoOther"; - value: NodeInfoOtherAmino; +export interface DefaultNodeInfoOtherAminoMsg { + type: "/tendermint.p2p.DefaultNodeInfoOther"; + value: DefaultNodeInfoOtherAmino; } -export interface NodeInfoOtherSDKType { +export interface DefaultNodeInfoOtherSDKType { tx_index: string; rpc_address: string; } -export interface PeerInfo { - id: string; - addressInfo: PeerAddressInfo[]; - lastConnected: Date; -} -export interface PeerInfoProtoMsg { - typeUrl: "/tendermint.p2p.PeerInfo"; - value: Uint8Array; -} -export interface PeerInfoAmino { - id: string; - address_info: PeerAddressInfoAmino[]; - last_connected?: Date; -} -export interface PeerInfoAminoMsg { - type: "/tendermint.p2p.PeerInfo"; - value: PeerInfoAmino; -} -export interface PeerInfoSDKType { - id: string; - address_info: PeerAddressInfoSDKType[]; - last_connected: Date; -} -export interface PeerAddressInfo { - address: string; - lastDialSuccess: Date; - lastDialFailure: Date; - dialFailures: number; -} -export interface PeerAddressInfoProtoMsg { - typeUrl: "/tendermint.p2p.PeerAddressInfo"; - value: Uint8Array; -} -export interface PeerAddressInfoAmino { - address: string; - last_dial_success?: Date; - last_dial_failure?: Date; - dial_failures: number; -} -export interface PeerAddressInfoAminoMsg { - type: "/tendermint.p2p.PeerAddressInfo"; - value: PeerAddressInfoAmino; -} -export interface PeerAddressInfoSDKType { - address: string; - last_dial_success: Date; - last_dial_failure: Date; - dial_failures: number; +function createBaseNetAddress(): NetAddress { + return { + id: "", + ip: "", + port: 0 + }; } +export const NetAddress = { + typeUrl: "/tendermint.p2p.NetAddress", + is(o: any): o is NetAddress { + return o && (o.$typeUrl === NetAddress.typeUrl || typeof o.id === "string" && typeof o.ip === "string" && typeof o.port === "number"); + }, + isSDK(o: any): o is NetAddressSDKType { + return o && (o.$typeUrl === NetAddress.typeUrl || typeof o.id === "string" && typeof o.ip === "string" && typeof o.port === "number"); + }, + isAmino(o: any): o is NetAddressAmino { + return o && (o.$typeUrl === NetAddress.typeUrl || typeof o.id === "string" && typeof o.ip === "string" && typeof o.port === "number"); + }, + encode(message: NetAddress, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.id !== "") { + writer.uint32(10).string(message.id); + } + if (message.ip !== "") { + writer.uint32(18).string(message.ip); + } + if (message.port !== 0) { + writer.uint32(24).uint32(message.port); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): NetAddress { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseNetAddress(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.id = reader.string(); + break; + case 2: + message.ip = reader.string(); + break; + case 3: + message.port = reader.uint32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): NetAddress { + return { + 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; + }, + fromPartial(object: Partial): NetAddress { + const message = createBaseNetAddress(); + message.id = object.id ?? ""; + message.ip = object.ip ?? ""; + message.port = object.port ?? 0; + return message; + }, + fromAmino(object: NetAddressAmino): NetAddress { + const message = createBaseNetAddress(); + if (object.id !== undefined && object.id !== null) { + message.id = object.id; + } + if (object.ip !== undefined && object.ip !== null) { + message.ip = object.ip; + } + if (object.port !== undefined && object.port !== null) { + message.port = object.port; + } + return message; + }, + toAmino(message: NetAddress): NetAddressAmino { + const obj: any = {}; + obj.id = message.id; + obj.ip = message.ip; + obj.port = message.port; + return obj; + }, + fromAminoMsg(object: NetAddressAminoMsg): NetAddress { + return NetAddress.fromAmino(object.value); + }, + fromProtoMsg(message: NetAddressProtoMsg): NetAddress { + return NetAddress.decode(message.value); + }, + toProto(message: NetAddress): Uint8Array { + return NetAddress.encode(message).finish(); + }, + toProtoMsg(message: NetAddress): NetAddressProtoMsg { + return { + typeUrl: "/tendermint.p2p.NetAddress", + value: NetAddress.encode(message).finish() + }; + } +}; +GlobalDecoderRegistry.register(NetAddress.typeUrl, NetAddress); function createBaseProtocolVersion(): ProtocolVersion { return { p2p: BigInt(0), @@ -140,6 +225,15 @@ function createBaseProtocolVersion(): ProtocolVersion { } export const ProtocolVersion = { typeUrl: "/tendermint.p2p.ProtocolVersion", + is(o: any): o is ProtocolVersion { + return o && (o.$typeUrl === ProtocolVersion.typeUrl || typeof o.p2p === "bigint" && typeof o.block === "bigint" && typeof o.app === "bigint"); + }, + isSDK(o: any): o is ProtocolVersionSDKType { + return o && (o.$typeUrl === ProtocolVersion.typeUrl || typeof o.p2p === "bigint" && typeof o.block === "bigint" && typeof o.app === "bigint"); + }, + isAmino(o: any): o is ProtocolVersionAmino { + return o && (o.$typeUrl === ProtocolVersion.typeUrl || typeof o.p2p === "bigint" && typeof o.block === "bigint" && typeof o.app === "bigint"); + }, encode(message: ProtocolVersion, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.p2p !== BigInt(0)) { writer.uint32(8).uint64(message.p2p); @@ -175,6 +269,20 @@ export const ProtocolVersion = { } return message; }, + fromJSON(object: any): ProtocolVersion { + return { + p2p: isSet(object.p2p) ? BigInt(object.p2p.toString()) : BigInt(0), + block: isSet(object.block) ? BigInt(object.block.toString()) : BigInt(0), + app: isSet(object.app) ? BigInt(object.app.toString()) : BigInt(0) + }; + }, + toJSON(message: ProtocolVersion): unknown { + const obj: any = {}; + message.p2p !== undefined && (obj.p2p = (message.p2p || BigInt(0)).toString()); + message.block !== undefined && (obj.block = (message.block || BigInt(0)).toString()); + message.app !== undefined && (obj.app = (message.app || BigInt(0)).toString()); + return obj; + }, fromPartial(object: Partial): ProtocolVersion { const message = createBaseProtocolVersion(); message.p2p = object.p2p !== undefined && object.p2p !== null ? BigInt(object.p2p.toString()) : BigInt(0); @@ -183,11 +291,17 @@ export const ProtocolVersion = { return message; }, fromAmino(object: ProtocolVersionAmino): ProtocolVersion { - return { - p2p: BigInt(object.p2p), - block: BigInt(object.block), - app: BigInt(object.app) - }; + const message = createBaseProtocolVersion(); + if (object.p2p !== undefined && object.p2p !== null) { + message.p2p = BigInt(object.p2p); + } + if (object.block !== undefined && object.block !== null) { + message.block = BigInt(object.block); + } + if (object.app !== undefined && object.app !== null) { + message.app = BigInt(object.app); + } + return message; }, toAmino(message: ProtocolVersion): ProtocolVersionAmino { const obj: any = {}; @@ -212,26 +326,36 @@ export const ProtocolVersion = { }; } }; -function createBaseNodeInfo(): NodeInfo { +GlobalDecoderRegistry.register(ProtocolVersion.typeUrl, ProtocolVersion); +function createBaseDefaultNodeInfo(): DefaultNodeInfo { return { protocolVersion: ProtocolVersion.fromPartial({}), - nodeId: "", + defaultNodeId: "", listenAddr: "", network: "", version: "", channels: new Uint8Array(), moniker: "", - other: NodeInfoOther.fromPartial({}) + other: DefaultNodeInfoOther.fromPartial({}) }; } -export const NodeInfo = { - typeUrl: "/tendermint.p2p.NodeInfo", - encode(message: NodeInfo, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { +export const DefaultNodeInfo = { + typeUrl: "/tendermint.p2p.DefaultNodeInfo", + is(o: any): o is DefaultNodeInfo { + return o && (o.$typeUrl === DefaultNodeInfo.typeUrl || ProtocolVersion.is(o.protocolVersion) && typeof o.defaultNodeId === "string" && typeof o.listenAddr === "string" && typeof o.network === "string" && typeof o.version === "string" && (o.channels instanceof Uint8Array || typeof o.channels === "string") && typeof o.moniker === "string" && DefaultNodeInfoOther.is(o.other)); + }, + isSDK(o: any): o is DefaultNodeInfoSDKType { + return o && (o.$typeUrl === DefaultNodeInfo.typeUrl || ProtocolVersion.isSDK(o.protocol_version) && typeof o.default_node_id === "string" && typeof o.listen_addr === "string" && typeof o.network === "string" && typeof o.version === "string" && (o.channels instanceof Uint8Array || typeof o.channels === "string") && typeof o.moniker === "string" && DefaultNodeInfoOther.isSDK(o.other)); + }, + isAmino(o: any): o is DefaultNodeInfoAmino { + return o && (o.$typeUrl === DefaultNodeInfo.typeUrl || ProtocolVersion.isAmino(o.protocol_version) && typeof o.default_node_id === "string" && typeof o.listen_addr === "string" && typeof o.network === "string" && typeof o.version === "string" && (o.channels instanceof Uint8Array || typeof o.channels === "string") && typeof o.moniker === "string" && DefaultNodeInfoOther.isAmino(o.other)); + }, + encode(message: DefaultNodeInfo, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.protocolVersion !== undefined) { ProtocolVersion.encode(message.protocolVersion, writer.uint32(10).fork()).ldelim(); } - if (message.nodeId !== "") { - writer.uint32(18).string(message.nodeId); + if (message.defaultNodeId !== "") { + writer.uint32(18).string(message.defaultNodeId); } if (message.listenAddr !== "") { writer.uint32(26).string(message.listenAddr); @@ -249,14 +373,14 @@ export const NodeInfo = { writer.uint32(58).string(message.moniker); } if (message.other !== undefined) { - NodeInfoOther.encode(message.other, writer.uint32(66).fork()).ldelim(); + DefaultNodeInfoOther.encode(message.other, writer.uint32(66).fork()).ldelim(); } return writer; }, - decode(input: BinaryReader | Uint8Array, length?: number): NodeInfo { + decode(input: BinaryReader | Uint8Array, length?: number): DefaultNodeInfo { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseNodeInfo(); + const message = createBaseDefaultNodeInfo(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -264,7 +388,7 @@ export const NodeInfo = { message.protocolVersion = ProtocolVersion.decode(reader, reader.uint32()); break; case 2: - message.nodeId = reader.string(); + message.defaultNodeId = reader.string(); break; case 3: message.listenAddr = reader.string(); @@ -282,7 +406,7 @@ export const NodeInfo = { message.moniker = reader.string(); break; case 8: - message.other = NodeInfoOther.decode(reader, reader.uint32()); + message.other = DefaultNodeInfoOther.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -291,67 +415,117 @@ export const NodeInfo = { } return message; }, - fromPartial(object: Partial): NodeInfo { - const message = createBaseNodeInfo(); + fromJSON(object: any): DefaultNodeInfo { + return { + 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(), + moniker: isSet(object.moniker) ? String(object.moniker) : "", + other: isSet(object.other) ? DefaultNodeInfoOther.fromJSON(object.other) : undefined + }; + }, + toJSON(message: DefaultNodeInfo): unknown { + 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); + 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; + }, + fromPartial(object: Partial): DefaultNodeInfo { + const message = createBaseDefaultNodeInfo(); message.protocolVersion = object.protocolVersion !== undefined && object.protocolVersion !== null ? ProtocolVersion.fromPartial(object.protocolVersion) : undefined; - message.nodeId = object.nodeId ?? ""; + 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 ? NodeInfoOther.fromPartial(object.other) : undefined; + message.other = object.other !== undefined && object.other !== null ? DefaultNodeInfoOther.fromPartial(object.other) : undefined; return message; }, - fromAmino(object: NodeInfoAmino): NodeInfo { - return { - protocolVersion: object?.protocol_version ? ProtocolVersion.fromAmino(object.protocol_version) : undefined, - nodeId: object.node_id, - listenAddr: object.listen_addr, - network: object.network, - version: object.version, - channels: object.channels, - moniker: object.moniker, - other: object?.other ? NodeInfoOther.fromAmino(object.other) : undefined - }; + fromAmino(object: DefaultNodeInfoAmino): DefaultNodeInfo { + const message = createBaseDefaultNodeInfo(); + if (object.protocol_version !== undefined && object.protocol_version !== null) { + message.protocolVersion = ProtocolVersion.fromAmino(object.protocol_version); + } + if (object.default_node_id !== undefined && object.default_node_id !== null) { + message.defaultNodeId = object.default_node_id; + } + if (object.listen_addr !== undefined && object.listen_addr !== null) { + message.listenAddr = object.listen_addr; + } + if (object.network !== undefined && object.network !== null) { + message.network = object.network; + } + if (object.version !== undefined && object.version !== null) { + message.version = object.version; + } + if (object.channels !== undefined && object.channels !== null) { + message.channels = bytesFromBase64(object.channels); + } + if (object.moniker !== undefined && object.moniker !== null) { + message.moniker = object.moniker; + } + if (object.other !== undefined && object.other !== null) { + message.other = DefaultNodeInfoOther.fromAmino(object.other); + } + return message; }, - toAmino(message: NodeInfo): NodeInfoAmino { + toAmino(message: DefaultNodeInfo): DefaultNodeInfoAmino { const obj: any = {}; obj.protocol_version = message.protocolVersion ? ProtocolVersion.toAmino(message.protocolVersion) : undefined; - obj.node_id = message.nodeId; + obj.default_node_id = message.defaultNodeId; obj.listen_addr = message.listenAddr; obj.network = message.network; obj.version = message.version; - obj.channels = message.channels; + obj.channels = message.channels ? base64FromBytes(message.channels) : undefined; obj.moniker = message.moniker; - obj.other = message.other ? NodeInfoOther.toAmino(message.other) : undefined; + obj.other = message.other ? DefaultNodeInfoOther.toAmino(message.other) : undefined; return obj; }, - fromAminoMsg(object: NodeInfoAminoMsg): NodeInfo { - return NodeInfo.fromAmino(object.value); + fromAminoMsg(object: DefaultNodeInfoAminoMsg): DefaultNodeInfo { + return DefaultNodeInfo.fromAmino(object.value); }, - fromProtoMsg(message: NodeInfoProtoMsg): NodeInfo { - return NodeInfo.decode(message.value); + fromProtoMsg(message: DefaultNodeInfoProtoMsg): DefaultNodeInfo { + return DefaultNodeInfo.decode(message.value); }, - toProto(message: NodeInfo): Uint8Array { - return NodeInfo.encode(message).finish(); + toProto(message: DefaultNodeInfo): Uint8Array { + return DefaultNodeInfo.encode(message).finish(); }, - toProtoMsg(message: NodeInfo): NodeInfoProtoMsg { + toProtoMsg(message: DefaultNodeInfo): DefaultNodeInfoProtoMsg { return { - typeUrl: "/tendermint.p2p.NodeInfo", - value: NodeInfo.encode(message).finish() + typeUrl: "/tendermint.p2p.DefaultNodeInfo", + value: DefaultNodeInfo.encode(message).finish() }; } }; -function createBaseNodeInfoOther(): NodeInfoOther { +GlobalDecoderRegistry.register(DefaultNodeInfo.typeUrl, DefaultNodeInfo); +function createBaseDefaultNodeInfoOther(): DefaultNodeInfoOther { return { txIndex: "", rpcAddress: "" }; } -export const NodeInfoOther = { - typeUrl: "/tendermint.p2p.NodeInfoOther", - encode(message: NodeInfoOther, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { +export const DefaultNodeInfoOther = { + typeUrl: "/tendermint.p2p.DefaultNodeInfoOther", + is(o: any): o is DefaultNodeInfoOther { + return o && (o.$typeUrl === DefaultNodeInfoOther.typeUrl || typeof o.txIndex === "string" && typeof o.rpcAddress === "string"); + }, + isSDK(o: any): o is DefaultNodeInfoOtherSDKType { + return o && (o.$typeUrl === DefaultNodeInfoOther.typeUrl || typeof o.tx_index === "string" && typeof o.rpc_address === "string"); + }, + isAmino(o: any): o is DefaultNodeInfoOtherAmino { + return o && (o.$typeUrl === DefaultNodeInfoOther.typeUrl || typeof o.tx_index === "string" && typeof o.rpc_address === "string"); + }, + encode(message: DefaultNodeInfoOther, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.txIndex !== "") { writer.uint32(10).string(message.txIndex); } @@ -360,10 +534,10 @@ export const NodeInfoOther = { } return writer; }, - decode(input: BinaryReader | Uint8Array, length?: number): NodeInfoOther { + decode(input: BinaryReader | Uint8Array, length?: number): DefaultNodeInfoOther { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseNodeInfoOther(); + const message = createBaseDefaultNodeInfoOther(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -380,213 +554,54 @@ export const NodeInfoOther = { } return message; }, - fromPartial(object: Partial): NodeInfoOther { - const message = createBaseNodeInfoOther(); - message.txIndex = object.txIndex ?? ""; - message.rpcAddress = object.rpcAddress ?? ""; - return message; - }, - fromAmino(object: NodeInfoOtherAmino): NodeInfoOther { + fromJSON(object: any): DefaultNodeInfoOther { return { - txIndex: object.tx_index, - rpcAddress: object.rpc_address + txIndex: isSet(object.txIndex) ? String(object.txIndex) : "", + rpcAddress: isSet(object.rpcAddress) ? String(object.rpcAddress) : "" }; }, - toAmino(message: NodeInfoOther): NodeInfoOtherAmino { + toJSON(message: DefaultNodeInfoOther): unknown { const obj: any = {}; - obj.tx_index = message.txIndex; - obj.rpc_address = message.rpcAddress; + message.txIndex !== undefined && (obj.txIndex = message.txIndex); + message.rpcAddress !== undefined && (obj.rpcAddress = message.rpcAddress); return obj; }, - fromAminoMsg(object: NodeInfoOtherAminoMsg): NodeInfoOther { - return NodeInfoOther.fromAmino(object.value); - }, - fromProtoMsg(message: NodeInfoOtherProtoMsg): NodeInfoOther { - return NodeInfoOther.decode(message.value); - }, - toProto(message: NodeInfoOther): Uint8Array { - return NodeInfoOther.encode(message).finish(); - }, - toProtoMsg(message: NodeInfoOther): NodeInfoOtherProtoMsg { - return { - typeUrl: "/tendermint.p2p.NodeInfoOther", - value: NodeInfoOther.encode(message).finish() - }; - } -}; -function createBasePeerInfo(): PeerInfo { - return { - id: "", - addressInfo: [], - lastConnected: undefined - }; -} -export const PeerInfo = { - typeUrl: "/tendermint.p2p.PeerInfo", - encode(message: PeerInfo, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { - if (message.id !== "") { - writer.uint32(10).string(message.id); - } - for (const v of message.addressInfo) { - PeerAddressInfo.encode(v!, writer.uint32(18).fork()).ldelim(); - } - if (message.lastConnected !== undefined) { - Timestamp.encode(toTimestamp(message.lastConnected), writer.uint32(26).fork()).ldelim(); - } - return writer; - }, - decode(input: BinaryReader | Uint8Array, length?: number): PeerInfo { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBasePeerInfo(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.id = reader.string(); - break; - case 2: - message.addressInfo.push(PeerAddressInfo.decode(reader, reader.uint32())); - break; - case 3: - message.lastConnected = fromTimestamp(Timestamp.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - fromPartial(object: Partial): PeerInfo { - const message = createBasePeerInfo(); - message.id = object.id ?? ""; - message.addressInfo = object.addressInfo?.map(e => PeerAddressInfo.fromPartial(e)) || []; - message.lastConnected = object.lastConnected ?? undefined; + fromPartial(object: Partial): DefaultNodeInfoOther { + const message = createBaseDefaultNodeInfoOther(); + message.txIndex = object.txIndex ?? ""; + message.rpcAddress = object.rpcAddress ?? ""; return message; }, - fromAmino(object: PeerInfoAmino): PeerInfo { - return { - id: object.id, - addressInfo: Array.isArray(object?.address_info) ? object.address_info.map((e: any) => PeerAddressInfo.fromAmino(e)) : [], - lastConnected: object.last_connected - }; - }, - toAmino(message: PeerInfo): PeerInfoAmino { - const obj: any = {}; - obj.id = message.id; - if (message.addressInfo) { - obj.address_info = message.addressInfo.map(e => e ? PeerAddressInfo.toAmino(e) : undefined); - } else { - obj.address_info = []; - } - obj.last_connected = message.lastConnected; - return obj; - }, - fromAminoMsg(object: PeerInfoAminoMsg): PeerInfo { - return PeerInfo.fromAmino(object.value); - }, - fromProtoMsg(message: PeerInfoProtoMsg): PeerInfo { - return PeerInfo.decode(message.value); - }, - toProto(message: PeerInfo): Uint8Array { - return PeerInfo.encode(message).finish(); - }, - toProtoMsg(message: PeerInfo): PeerInfoProtoMsg { - return { - typeUrl: "/tendermint.p2p.PeerInfo", - value: PeerInfo.encode(message).finish() - }; - } -}; -function createBasePeerAddressInfo(): PeerAddressInfo { - return { - address: "", - lastDialSuccess: undefined, - lastDialFailure: undefined, - dialFailures: 0 - }; -} -export const PeerAddressInfo = { - typeUrl: "/tendermint.p2p.PeerAddressInfo", - encode(message: PeerAddressInfo, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { - if (message.address !== "") { - writer.uint32(10).string(message.address); - } - if (message.lastDialSuccess !== undefined) { - Timestamp.encode(toTimestamp(message.lastDialSuccess), writer.uint32(18).fork()).ldelim(); - } - if (message.lastDialFailure !== undefined) { - Timestamp.encode(toTimestamp(message.lastDialFailure), writer.uint32(26).fork()).ldelim(); - } - if (message.dialFailures !== 0) { - writer.uint32(32).uint32(message.dialFailures); + fromAmino(object: DefaultNodeInfoOtherAmino): DefaultNodeInfoOther { + const message = createBaseDefaultNodeInfoOther(); + if (object.tx_index !== undefined && object.tx_index !== null) { + message.txIndex = object.tx_index; } - return writer; - }, - decode(input: BinaryReader | Uint8Array, length?: number): PeerAddressInfo { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBasePeerAddressInfo(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.address = reader.string(); - break; - case 2: - message.lastDialSuccess = fromTimestamp(Timestamp.decode(reader, reader.uint32())); - break; - case 3: - message.lastDialFailure = fromTimestamp(Timestamp.decode(reader, reader.uint32())); - break; - case 4: - message.dialFailures = reader.uint32(); - break; - default: - reader.skipType(tag & 7); - break; - } + if (object.rpc_address !== undefined && object.rpc_address !== null) { + message.rpcAddress = object.rpc_address; } return message; }, - fromPartial(object: Partial): PeerAddressInfo { - const message = createBasePeerAddressInfo(); - message.address = object.address ?? ""; - message.lastDialSuccess = object.lastDialSuccess ?? undefined; - message.lastDialFailure = object.lastDialFailure ?? undefined; - message.dialFailures = object.dialFailures ?? 0; - return message; - }, - fromAmino(object: PeerAddressInfoAmino): PeerAddressInfo { - return { - address: object.address, - lastDialSuccess: object.last_dial_success, - lastDialFailure: object.last_dial_failure, - dialFailures: object.dial_failures - }; - }, - toAmino(message: PeerAddressInfo): PeerAddressInfoAmino { + toAmino(message: DefaultNodeInfoOther): DefaultNodeInfoOtherAmino { const obj: any = {}; - obj.address = message.address; - obj.last_dial_success = message.lastDialSuccess; - obj.last_dial_failure = message.lastDialFailure; - obj.dial_failures = message.dialFailures; + obj.tx_index = message.txIndex; + obj.rpc_address = message.rpcAddress; return obj; }, - fromAminoMsg(object: PeerAddressInfoAminoMsg): PeerAddressInfo { - return PeerAddressInfo.fromAmino(object.value); + fromAminoMsg(object: DefaultNodeInfoOtherAminoMsg): DefaultNodeInfoOther { + return DefaultNodeInfoOther.fromAmino(object.value); }, - fromProtoMsg(message: PeerAddressInfoProtoMsg): PeerAddressInfo { - return PeerAddressInfo.decode(message.value); + fromProtoMsg(message: DefaultNodeInfoOtherProtoMsg): DefaultNodeInfoOther { + return DefaultNodeInfoOther.decode(message.value); }, - toProto(message: PeerAddressInfo): Uint8Array { - return PeerAddressInfo.encode(message).finish(); + toProto(message: DefaultNodeInfoOther): Uint8Array { + return DefaultNodeInfoOther.encode(message).finish(); }, - toProtoMsg(message: PeerAddressInfo): PeerAddressInfoProtoMsg { + toProtoMsg(message: DefaultNodeInfoOther): DefaultNodeInfoOtherProtoMsg { return { - typeUrl: "/tendermint.p2p.PeerAddressInfo", - value: PeerAddressInfo.encode(message).finish() + typeUrl: "/tendermint.p2p.DefaultNodeInfoOther", + value: DefaultNodeInfoOther.encode(message).finish() }; } -}; \ No newline at end of file +}; +GlobalDecoderRegistry.register(DefaultNodeInfoOther.typeUrl, DefaultNodeInfoOther); \ No newline at end of file diff --git a/packages/osmojs/src/codegen/tendermint/types/block.ts b/packages/osmojs/src/codegen/tendermint/types/block.ts index 737ce34f1..fc30794da 100644 --- a/packages/osmojs/src/codegen/tendermint/types/block.ts +++ b/packages/osmojs/src/codegen/tendermint/types/block.ts @@ -1,11 +1,13 @@ import { Header, HeaderAmino, HeaderSDKType, Data, DataAmino, DataSDKType, Commit, CommitAmino, CommitSDKType } from "./types"; import { EvidenceList, EvidenceListAmino, EvidenceListSDKType } from "./evidence"; import { BinaryReader, BinaryWriter } from "../../binary"; +import { isSet } from "../../helpers"; +import { GlobalDecoderRegistry } from "../../registry"; export interface Block { header: Header; data: Data; evidence: EvidenceList; - lastCommit: Commit; + lastCommit?: Commit; } export interface BlockProtoMsg { typeUrl: "/tendermint.types.Block"; @@ -25,18 +27,27 @@ export interface BlockSDKType { header: HeaderSDKType; data: DataSDKType; evidence: EvidenceListSDKType; - last_commit: CommitSDKType; + last_commit?: CommitSDKType; } function createBaseBlock(): Block { return { header: Header.fromPartial({}), data: Data.fromPartial({}), evidence: EvidenceList.fromPartial({}), - lastCommit: Commit.fromPartial({}) + lastCommit: undefined }; } export const Block = { typeUrl: "/tendermint.types.Block", + is(o: any): o is Block { + return o && (o.$typeUrl === Block.typeUrl || Header.is(o.header) && Data.is(o.data) && EvidenceList.is(o.evidence)); + }, + isSDK(o: any): o is BlockSDKType { + return o && (o.$typeUrl === Block.typeUrl || Header.isSDK(o.header) && Data.isSDK(o.data) && EvidenceList.isSDK(o.evidence)); + }, + isAmino(o: any): o is BlockAmino { + return o && (o.$typeUrl === Block.typeUrl || Header.isAmino(o.header) && Data.isAmino(o.data) && EvidenceList.isAmino(o.evidence)); + }, encode(message: Block, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.header !== undefined) { Header.encode(message.header, writer.uint32(10).fork()).ldelim(); @@ -78,6 +89,22 @@ export const Block = { } 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 + }; + }, + 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); + 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; + }, fromPartial(object: Partial): Block { const message = createBaseBlock(); message.header = object.header !== undefined && object.header !== null ? Header.fromPartial(object.header) : undefined; @@ -87,12 +114,20 @@ export const Block = { return message; }, fromAmino(object: BlockAmino): Block { - return { - header: object?.header ? Header.fromAmino(object.header) : undefined, - data: object?.data ? Data.fromAmino(object.data) : undefined, - evidence: object?.evidence ? EvidenceList.fromAmino(object.evidence) : undefined, - lastCommit: object?.last_commit ? Commit.fromAmino(object.last_commit) : undefined - }; + const message = createBaseBlock(); + if (object.header !== undefined && object.header !== null) { + message.header = Header.fromAmino(object.header); + } + if (object.data !== undefined && object.data !== null) { + message.data = Data.fromAmino(object.data); + } + if (object.evidence !== undefined && object.evidence !== null) { + message.evidence = EvidenceList.fromAmino(object.evidence); + } + if (object.last_commit !== undefined && object.last_commit !== null) { + message.lastCommit = Commit.fromAmino(object.last_commit); + } + return message; }, toAmino(message: Block): BlockAmino { const obj: any = {}; @@ -117,4 +152,5 @@ export const Block = { value: Block.encode(message).finish() }; } -}; \ No newline at end of file +}; +GlobalDecoderRegistry.register(Block.typeUrl, Block); \ No newline at end of file diff --git a/packages/osmojs/src/codegen/tendermint/types/evidence.ts b/packages/osmojs/src/codegen/tendermint/types/evidence.ts index 852789dc1..114fc29b8 100644 --- a/packages/osmojs/src/codegen/tendermint/types/evidence.ts +++ b/packages/osmojs/src/codegen/tendermint/types/evidence.ts @@ -2,7 +2,8 @@ import { Vote, VoteAmino, VoteSDKType, LightBlock, LightBlockAmino, LightBlockSD import { Timestamp } from "../../google/protobuf/timestamp"; import { Validator, ValidatorAmino, ValidatorSDKType } from "./validator"; import { BinaryReader, BinaryWriter } from "../../binary"; -import { toTimestamp, fromTimestamp } from "../../helpers"; +import { isSet, toTimestamp, fromTimestamp } from "../../helpers"; +import { GlobalDecoderRegistry } from "../../registry"; export interface Evidence { duplicateVoteEvidence?: DuplicateVoteEvidence; lightClientAttackEvidence?: LightClientAttackEvidence; @@ -25,8 +26,8 @@ export interface EvidenceSDKType { } /** DuplicateVoteEvidence contains evidence of a validator signed two conflicting votes. */ export interface DuplicateVoteEvidence { - voteA: Vote; - voteB: Vote; + voteA?: Vote; + voteB?: Vote; totalVotingPower: bigint; validatorPower: bigint; timestamp: Date; @@ -39,9 +40,9 @@ export interface DuplicateVoteEvidenceProtoMsg { export interface DuplicateVoteEvidenceAmino { vote_a?: VoteAmino; vote_b?: VoteAmino; - total_voting_power: string; - validator_power: string; - timestamp?: Date; + total_voting_power?: string; + validator_power?: string; + timestamp?: string; } export interface DuplicateVoteEvidenceAminoMsg { type: "/tendermint.types.DuplicateVoteEvidence"; @@ -49,15 +50,15 @@ export interface DuplicateVoteEvidenceAminoMsg { } /** DuplicateVoteEvidence contains evidence of a validator signed two conflicting votes. */ export interface DuplicateVoteEvidenceSDKType { - vote_a: VoteSDKType; - vote_b: VoteSDKType; + vote_a?: VoteSDKType; + vote_b?: VoteSDKType; total_voting_power: bigint; validator_power: bigint; timestamp: Date; } /** LightClientAttackEvidence contains evidence of a set of validators attempting to mislead a light client. */ export interface LightClientAttackEvidence { - conflictingBlock: LightBlock; + conflictingBlock?: LightBlock; commonHeight: bigint; byzantineValidators: Validator[]; totalVotingPower: bigint; @@ -70,10 +71,10 @@ export interface LightClientAttackEvidenceProtoMsg { /** LightClientAttackEvidence contains evidence of a set of validators attempting to mislead a light client. */ export interface LightClientAttackEvidenceAmino { conflicting_block?: LightBlockAmino; - common_height: string; - byzantine_validators: ValidatorAmino[]; - total_voting_power: string; - timestamp?: Date; + common_height?: string; + byzantine_validators?: ValidatorAmino[]; + total_voting_power?: string; + timestamp?: string; } export interface LightClientAttackEvidenceAminoMsg { type: "/tendermint.types.LightClientAttackEvidence"; @@ -81,7 +82,7 @@ export interface LightClientAttackEvidenceAminoMsg { } /** LightClientAttackEvidence contains evidence of a set of validators attempting to mislead a light client. */ export interface LightClientAttackEvidenceSDKType { - conflicting_block: LightBlockSDKType; + conflicting_block?: LightBlockSDKType; common_height: bigint; byzantine_validators: ValidatorSDKType[]; total_voting_power: bigint; @@ -95,7 +96,7 @@ export interface EvidenceListProtoMsg { value: Uint8Array; } export interface EvidenceListAmino { - evidence: EvidenceAmino[]; + evidence?: EvidenceAmino[]; } export interface EvidenceListAminoMsg { type: "/tendermint.types.EvidenceList"; @@ -112,6 +113,15 @@ function createBaseEvidence(): Evidence { } export const Evidence = { typeUrl: "/tendermint.types.Evidence", + is(o: any): o is Evidence { + return o && o.$typeUrl === Evidence.typeUrl; + }, + isSDK(o: any): o is EvidenceSDKType { + return o && o.$typeUrl === Evidence.typeUrl; + }, + isAmino(o: any): o is EvidenceAmino { + return o && o.$typeUrl === Evidence.typeUrl; + }, encode(message: Evidence, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.duplicateVoteEvidence !== undefined) { DuplicateVoteEvidence.encode(message.duplicateVoteEvidence, writer.uint32(10).fork()).ldelim(); @@ -141,6 +151,18 @@ export const Evidence = { } return message; }, + fromJSON(object: any): Evidence { + return { + duplicateVoteEvidence: isSet(object.duplicateVoteEvidence) ? DuplicateVoteEvidence.fromJSON(object.duplicateVoteEvidence) : undefined, + 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); + message.lightClientAttackEvidence !== undefined && (obj.lightClientAttackEvidence = message.lightClientAttackEvidence ? LightClientAttackEvidence.toJSON(message.lightClientAttackEvidence) : undefined); + return obj; + }, fromPartial(object: Partial): Evidence { const message = createBaseEvidence(); message.duplicateVoteEvidence = object.duplicateVoteEvidence !== undefined && object.duplicateVoteEvidence !== null ? DuplicateVoteEvidence.fromPartial(object.duplicateVoteEvidence) : undefined; @@ -148,10 +170,14 @@ export const Evidence = { return message; }, fromAmino(object: EvidenceAmino): Evidence { - return { - duplicateVoteEvidence: object?.duplicate_vote_evidence ? DuplicateVoteEvidence.fromAmino(object.duplicate_vote_evidence) : undefined, - lightClientAttackEvidence: object?.light_client_attack_evidence ? LightClientAttackEvidence.fromAmino(object.light_client_attack_evidence) : undefined - }; + const message = createBaseEvidence(); + if (object.duplicate_vote_evidence !== undefined && object.duplicate_vote_evidence !== null) { + message.duplicateVoteEvidence = DuplicateVoteEvidence.fromAmino(object.duplicate_vote_evidence); + } + if (object.light_client_attack_evidence !== undefined && object.light_client_attack_evidence !== null) { + message.lightClientAttackEvidence = LightClientAttackEvidence.fromAmino(object.light_client_attack_evidence); + } + return message; }, toAmino(message: Evidence): EvidenceAmino { const obj: any = {}; @@ -175,17 +201,27 @@ export const Evidence = { }; } }; +GlobalDecoderRegistry.register(Evidence.typeUrl, Evidence); function createBaseDuplicateVoteEvidence(): DuplicateVoteEvidence { return { - voteA: Vote.fromPartial({}), - voteB: Vote.fromPartial({}), + voteA: undefined, + voteB: undefined, totalVotingPower: BigInt(0), validatorPower: BigInt(0), - timestamp: undefined + timestamp: new Date() }; } export const DuplicateVoteEvidence = { typeUrl: "/tendermint.types.DuplicateVoteEvidence", + is(o: any): o is DuplicateVoteEvidence { + return o && (o.$typeUrl === DuplicateVoteEvidence.typeUrl || typeof o.totalVotingPower === "bigint" && typeof o.validatorPower === "bigint" && Timestamp.is(o.timestamp)); + }, + isSDK(o: any): o is DuplicateVoteEvidenceSDKType { + return o && (o.$typeUrl === DuplicateVoteEvidence.typeUrl || typeof o.total_voting_power === "bigint" && typeof o.validator_power === "bigint" && Timestamp.isSDK(o.timestamp)); + }, + isAmino(o: any): o is DuplicateVoteEvidenceAmino { + return o && (o.$typeUrl === DuplicateVoteEvidence.typeUrl || typeof o.total_voting_power === "bigint" && typeof o.validator_power === "bigint" && Timestamp.isAmino(o.timestamp)); + }, encode(message: DuplicateVoteEvidence, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.voteA !== undefined) { Vote.encode(message.voteA, writer.uint32(10).fork()).ldelim(); @@ -233,6 +269,24 @@ export const DuplicateVoteEvidence = { } 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) ? BigInt(object.totalVotingPower.toString()) : BigInt(0), + validatorPower: isSet(object.validatorPower) ? BigInt(object.validatorPower.toString()) : BigInt(0), + timestamp: isSet(object.timestamp) ? new Date(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); + message.totalVotingPower !== undefined && (obj.totalVotingPower = (message.totalVotingPower || BigInt(0)).toString()); + message.validatorPower !== undefined && (obj.validatorPower = (message.validatorPower || BigInt(0)).toString()); + message.timestamp !== undefined && (obj.timestamp = message.timestamp.toISOString()); + return obj; + }, fromPartial(object: Partial): DuplicateVoteEvidence { const message = createBaseDuplicateVoteEvidence(); message.voteA = object.voteA !== undefined && object.voteA !== null ? Vote.fromPartial(object.voteA) : undefined; @@ -243,13 +297,23 @@ export const DuplicateVoteEvidence = { return message; }, fromAmino(object: DuplicateVoteEvidenceAmino): DuplicateVoteEvidence { - return { - voteA: object?.vote_a ? Vote.fromAmino(object.vote_a) : undefined, - voteB: object?.vote_b ? Vote.fromAmino(object.vote_b) : undefined, - totalVotingPower: BigInt(object.total_voting_power), - validatorPower: BigInt(object.validator_power), - timestamp: object.timestamp - }; + const message = createBaseDuplicateVoteEvidence(); + if (object.vote_a !== undefined && object.vote_a !== null) { + message.voteA = Vote.fromAmino(object.vote_a); + } + if (object.vote_b !== undefined && object.vote_b !== null) { + message.voteB = Vote.fromAmino(object.vote_b); + } + if (object.total_voting_power !== undefined && object.total_voting_power !== null) { + message.totalVotingPower = BigInt(object.total_voting_power); + } + if (object.validator_power !== undefined && object.validator_power !== null) { + message.validatorPower = BigInt(object.validator_power); + } + if (object.timestamp !== undefined && object.timestamp !== null) { + message.timestamp = fromTimestamp(Timestamp.fromAmino(object.timestamp)); + } + return message; }, toAmino(message: DuplicateVoteEvidence): DuplicateVoteEvidenceAmino { const obj: any = {}; @@ -257,7 +321,7 @@ export const DuplicateVoteEvidence = { obj.vote_b = message.voteB ? Vote.toAmino(message.voteB) : undefined; obj.total_voting_power = message.totalVotingPower ? message.totalVotingPower.toString() : undefined; obj.validator_power = message.validatorPower ? message.validatorPower.toString() : undefined; - obj.timestamp = message.timestamp; + obj.timestamp = message.timestamp ? Timestamp.toAmino(toTimestamp(message.timestamp)) : undefined; return obj; }, fromAminoMsg(object: DuplicateVoteEvidenceAminoMsg): DuplicateVoteEvidence { @@ -276,17 +340,27 @@ export const DuplicateVoteEvidence = { }; } }; +GlobalDecoderRegistry.register(DuplicateVoteEvidence.typeUrl, DuplicateVoteEvidence); function createBaseLightClientAttackEvidence(): LightClientAttackEvidence { return { - conflictingBlock: LightBlock.fromPartial({}), + conflictingBlock: undefined, commonHeight: BigInt(0), byzantineValidators: [], totalVotingPower: BigInt(0), - timestamp: undefined + timestamp: new Date() }; } export const LightClientAttackEvidence = { typeUrl: "/tendermint.types.LightClientAttackEvidence", + is(o: any): o is LightClientAttackEvidence { + return o && (o.$typeUrl === LightClientAttackEvidence.typeUrl || typeof o.commonHeight === "bigint" && Array.isArray(o.byzantineValidators) && (!o.byzantineValidators.length || Validator.is(o.byzantineValidators[0])) && typeof o.totalVotingPower === "bigint" && Timestamp.is(o.timestamp)); + }, + isSDK(o: any): o is LightClientAttackEvidenceSDKType { + return o && (o.$typeUrl === LightClientAttackEvidence.typeUrl || typeof o.common_height === "bigint" && Array.isArray(o.byzantine_validators) && (!o.byzantine_validators.length || Validator.isSDK(o.byzantine_validators[0])) && typeof o.total_voting_power === "bigint" && Timestamp.isSDK(o.timestamp)); + }, + isAmino(o: any): o is LightClientAttackEvidenceAmino { + return o && (o.$typeUrl === LightClientAttackEvidence.typeUrl || typeof o.common_height === "bigint" && Array.isArray(o.byzantine_validators) && (!o.byzantine_validators.length || Validator.isAmino(o.byzantine_validators[0])) && typeof o.total_voting_power === "bigint" && Timestamp.isAmino(o.timestamp)); + }, encode(message: LightClientAttackEvidence, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.conflictingBlock !== undefined) { LightBlock.encode(message.conflictingBlock, writer.uint32(10).fork()).ldelim(); @@ -334,6 +408,28 @@ export const LightClientAttackEvidence = { } return message; }, + fromJSON(object: any): LightClientAttackEvidence { + return { + conflictingBlock: isSet(object.conflictingBlock) ? LightBlock.fromJSON(object.conflictingBlock) : undefined, + commonHeight: isSet(object.commonHeight) ? BigInt(object.commonHeight.toString()) : BigInt(0), + byzantineValidators: Array.isArray(object?.byzantineValidators) ? object.byzantineValidators.map((e: any) => Validator.fromJSON(e)) : [], + totalVotingPower: isSet(object.totalVotingPower) ? BigInt(object.totalVotingPower.toString()) : BigInt(0), + timestamp: isSet(object.timestamp) ? new Date(object.timestamp) : undefined + }; + }, + toJSON(message: LightClientAttackEvidence): unknown { + const obj: any = {}; + message.conflictingBlock !== undefined && (obj.conflictingBlock = message.conflictingBlock ? LightBlock.toJSON(message.conflictingBlock) : undefined); + message.commonHeight !== undefined && (obj.commonHeight = (message.commonHeight || BigInt(0)).toString()); + if (message.byzantineValidators) { + obj.byzantineValidators = message.byzantineValidators.map(e => e ? Validator.toJSON(e) : undefined); + } else { + obj.byzantineValidators = []; + } + message.totalVotingPower !== undefined && (obj.totalVotingPower = (message.totalVotingPower || BigInt(0)).toString()); + message.timestamp !== undefined && (obj.timestamp = message.timestamp.toISOString()); + return obj; + }, fromPartial(object: Partial): LightClientAttackEvidence { const message = createBaseLightClientAttackEvidence(); message.conflictingBlock = object.conflictingBlock !== undefined && object.conflictingBlock !== null ? LightBlock.fromPartial(object.conflictingBlock) : undefined; @@ -344,13 +440,21 @@ export const LightClientAttackEvidence = { return message; }, fromAmino(object: LightClientAttackEvidenceAmino): LightClientAttackEvidence { - return { - conflictingBlock: object?.conflicting_block ? LightBlock.fromAmino(object.conflicting_block) : undefined, - commonHeight: BigInt(object.common_height), - byzantineValidators: Array.isArray(object?.byzantine_validators) ? object.byzantine_validators.map((e: any) => Validator.fromAmino(e)) : [], - totalVotingPower: BigInt(object.total_voting_power), - timestamp: object.timestamp - }; + const message = createBaseLightClientAttackEvidence(); + if (object.conflicting_block !== undefined && object.conflicting_block !== null) { + message.conflictingBlock = LightBlock.fromAmino(object.conflicting_block); + } + if (object.common_height !== undefined && object.common_height !== null) { + message.commonHeight = BigInt(object.common_height); + } + message.byzantineValidators = object.byzantine_validators?.map(e => Validator.fromAmino(e)) || []; + if (object.total_voting_power !== undefined && object.total_voting_power !== null) { + message.totalVotingPower = BigInt(object.total_voting_power); + } + if (object.timestamp !== undefined && object.timestamp !== null) { + message.timestamp = fromTimestamp(Timestamp.fromAmino(object.timestamp)); + } + return message; }, toAmino(message: LightClientAttackEvidence): LightClientAttackEvidenceAmino { const obj: any = {}; @@ -362,7 +466,7 @@ export const LightClientAttackEvidence = { obj.byzantine_validators = []; } obj.total_voting_power = message.totalVotingPower ? message.totalVotingPower.toString() : undefined; - obj.timestamp = message.timestamp; + obj.timestamp = message.timestamp ? Timestamp.toAmino(toTimestamp(message.timestamp)) : undefined; return obj; }, fromAminoMsg(object: LightClientAttackEvidenceAminoMsg): LightClientAttackEvidence { @@ -381,6 +485,7 @@ export const LightClientAttackEvidence = { }; } }; +GlobalDecoderRegistry.register(LightClientAttackEvidence.typeUrl, LightClientAttackEvidence); function createBaseEvidenceList(): EvidenceList { return { evidence: [] @@ -388,6 +493,15 @@ function createBaseEvidenceList(): EvidenceList { } export const EvidenceList = { typeUrl: "/tendermint.types.EvidenceList", + is(o: any): o is EvidenceList { + return o && (o.$typeUrl === EvidenceList.typeUrl || Array.isArray(o.evidence) && (!o.evidence.length || Evidence.is(o.evidence[0]))); + }, + isSDK(o: any): o is EvidenceListSDKType { + return o && (o.$typeUrl === EvidenceList.typeUrl || Array.isArray(o.evidence) && (!o.evidence.length || Evidence.isSDK(o.evidence[0]))); + }, + isAmino(o: any): o is EvidenceListAmino { + return o && (o.$typeUrl === EvidenceList.typeUrl || Array.isArray(o.evidence) && (!o.evidence.length || Evidence.isAmino(o.evidence[0]))); + }, encode(message: EvidenceList, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.evidence) { Evidence.encode(v!, writer.uint32(10).fork()).ldelim(); @@ -411,15 +525,29 @@ export const EvidenceList = { } return message; }, + fromJSON(object: any): EvidenceList { + return { + evidence: Array.isArray(object?.evidence) ? object.evidence.map((e: any) => Evidence.fromJSON(e)) : [] + }; + }, + toJSON(message: EvidenceList): unknown { + const obj: any = {}; + if (message.evidence) { + obj.evidence = message.evidence.map(e => e ? Evidence.toJSON(e) : undefined); + } else { + obj.evidence = []; + } + return obj; + }, fromPartial(object: Partial): EvidenceList { const message = createBaseEvidenceList(); message.evidence = object.evidence?.map(e => Evidence.fromPartial(e)) || []; return message; }, fromAmino(object: EvidenceListAmino): EvidenceList { - return { - evidence: Array.isArray(object?.evidence) ? object.evidence.map((e: any) => Evidence.fromAmino(e)) : [] - }; + const message = createBaseEvidenceList(); + message.evidence = object.evidence?.map(e => Evidence.fromAmino(e)) || []; + return message; }, toAmino(message: EvidenceList): EvidenceListAmino { const obj: any = {}; @@ -445,4 +573,5 @@ export const EvidenceList = { value: EvidenceList.encode(message).finish() }; } -}; \ No newline at end of file +}; +GlobalDecoderRegistry.register(EvidenceList.typeUrl, EvidenceList); \ No newline at end of file diff --git a/packages/osmojs/src/codegen/tendermint/types/params.ts b/packages/osmojs/src/codegen/tendermint/types/params.ts index c2db1391b..9f21d018e 100644 --- a/packages/osmojs/src/codegen/tendermint/types/params.ts +++ b/packages/osmojs/src/codegen/tendermint/types/params.ts @@ -1,14 +1,16 @@ import { Duration, DurationAmino, DurationSDKType } from "../../google/protobuf/duration"; import { BinaryReader, BinaryWriter } from "../../binary"; +import { isSet } from "../../helpers"; +import { GlobalDecoderRegistry } from "../../registry"; /** * 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; } export interface ConsensusParamsProtoMsg { typeUrl: "/tendermint.types.ConsensusParams"; @@ -33,10 +35,10 @@ export interface ConsensusParamsAminoMsg { * validity of blocks. */ export interface ConsensusParamsSDKType { - block: BlockParamsSDKType; - evidence: EvidenceParamsSDKType; - validator: ValidatorParamsSDKType; - version: VersionParamsSDKType; + block?: BlockParamsSDKType; + evidence?: EvidenceParamsSDKType; + validator?: ValidatorParamsSDKType; + version?: VersionParamsSDKType; } /** BlockParams contains limits on the block size. */ export interface BlockParams { @@ -50,13 +52,6 @@ export interface BlockParams { * Note: must be greater or equal to -1 */ maxGas: bigint; - /** - * 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: bigint; } export interface BlockParamsProtoMsg { typeUrl: "/tendermint.types.BlockParams"; @@ -68,19 +63,12 @@ export interface BlockParamsAmino { * Max block size, in bytes. * Note: must be greater than 0 */ - max_bytes: string; + max_bytes?: string; /** * Max gas per block. * Note: must be greater or equal to -1 */ - max_gas: string; - /** - * 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. - */ - time_iota_ms: string; + max_gas?: string; } export interface BlockParamsAminoMsg { type: "/tendermint.types.BlockParams"; @@ -90,7 +78,6 @@ export interface BlockParamsAminoMsg { export interface BlockParamsSDKType { max_bytes: bigint; max_gas: bigint; - time_iota_ms: bigint; } /** EvidenceParams determine how we handle evidence of malfeasance. */ export interface EvidenceParams { @@ -128,7 +115,7 @@ export interface EvidenceParamsAmino { * The basic formula for calculating this is: MaxAgeDuration / {average block * time}. */ - max_age_num_blocks: string; + max_age_num_blocks?: string; /** * Max age of evidence, in time. * @@ -142,7 +129,7 @@ export interface EvidenceParamsAmino { * and should fall comfortably under the max block bytes. * Default is 1048576 or 1MB */ - max_bytes: string; + max_bytes?: string; } export interface EvidenceParamsAminoMsg { type: "/tendermint.types.EvidenceParams"; @@ -170,7 +157,7 @@ export interface ValidatorParamsProtoMsg { * NOTE: uses ABCI pubkey naming, not Amino names. */ export interface ValidatorParamsAmino { - pub_key_types: string[]; + pub_key_types?: string[]; } export interface ValidatorParamsAminoMsg { type: "/tendermint.types.ValidatorParams"; @@ -185,7 +172,7 @@ export interface ValidatorParamsSDKType { } /** VersionParams contains the ABCI application version. */ export interface VersionParams { - appVersion: bigint; + app: bigint; } export interface VersionParamsProtoMsg { typeUrl: "/tendermint.types.VersionParams"; @@ -193,7 +180,7 @@ export interface VersionParamsProtoMsg { } /** VersionParams contains the ABCI application version. */ export interface VersionParamsAmino { - app_version: string; + app?: string; } export interface VersionParamsAminoMsg { type: "/tendermint.types.VersionParams"; @@ -201,7 +188,7 @@ export interface VersionParamsAminoMsg { } /** VersionParams contains the ABCI application version. */ export interface VersionParamsSDKType { - app_version: bigint; + app: bigint; } /** * HashedParams is a subset of ConsensusParams. @@ -222,8 +209,8 @@ export interface HashedParamsProtoMsg { * It is hashed into the Header.ConsensusHash. */ export interface HashedParamsAmino { - block_max_bytes: string; - block_max_gas: string; + block_max_bytes?: string; + block_max_gas?: string; } export interface HashedParamsAminoMsg { type: "/tendermint.types.HashedParams"; @@ -240,14 +227,23 @@ export interface HashedParamsSDKType { } function createBaseConsensusParams(): ConsensusParams { return { - block: BlockParams.fromPartial({}), - evidence: EvidenceParams.fromPartial({}), - validator: ValidatorParams.fromPartial({}), - version: VersionParams.fromPartial({}) + block: undefined, + evidence: undefined, + validator: undefined, + version: undefined }; } export const ConsensusParams = { typeUrl: "/tendermint.types.ConsensusParams", + is(o: any): o is ConsensusParams { + return o && o.$typeUrl === ConsensusParams.typeUrl; + }, + isSDK(o: any): o is ConsensusParamsSDKType { + return o && o.$typeUrl === ConsensusParams.typeUrl; + }, + isAmino(o: any): o is ConsensusParamsAmino { + return o && o.$typeUrl === ConsensusParams.typeUrl; + }, encode(message: ConsensusParams, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.block !== undefined) { BlockParams.encode(message.block, writer.uint32(10).fork()).ldelim(); @@ -289,6 +285,22 @@ export const ConsensusParams = { } 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 + }; + }, + toJSON(message: ConsensusParams): unknown { + 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); + 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(object: Partial): ConsensusParams { const message = createBaseConsensusParams(); message.block = object.block !== undefined && object.block !== null ? BlockParams.fromPartial(object.block) : undefined; @@ -298,12 +310,20 @@ export const ConsensusParams = { return message; }, fromAmino(object: ConsensusParamsAmino): ConsensusParams { - return { - block: object?.block ? BlockParams.fromAmino(object.block) : undefined, - evidence: object?.evidence ? EvidenceParams.fromAmino(object.evidence) : undefined, - validator: object?.validator ? ValidatorParams.fromAmino(object.validator) : undefined, - version: object?.version ? VersionParams.fromAmino(object.version) : undefined - }; + const message = createBaseConsensusParams(); + if (object.block !== undefined && object.block !== null) { + message.block = BlockParams.fromAmino(object.block); + } + if (object.evidence !== undefined && object.evidence !== null) { + message.evidence = EvidenceParams.fromAmino(object.evidence); + } + if (object.validator !== undefined && object.validator !== null) { + message.validator = ValidatorParams.fromAmino(object.validator); + } + if (object.version !== undefined && object.version !== null) { + message.version = VersionParams.fromAmino(object.version); + } + return message; }, toAmino(message: ConsensusParams): ConsensusParamsAmino { const obj: any = {}; @@ -329,15 +349,24 @@ export const ConsensusParams = { }; } }; +GlobalDecoderRegistry.register(ConsensusParams.typeUrl, ConsensusParams); function createBaseBlockParams(): BlockParams { return { maxBytes: BigInt(0), - maxGas: BigInt(0), - timeIotaMs: BigInt(0) + maxGas: BigInt(0) }; } export const BlockParams = { typeUrl: "/tendermint.types.BlockParams", + is(o: any): o is BlockParams { + return o && (o.$typeUrl === BlockParams.typeUrl || typeof o.maxBytes === "bigint" && typeof o.maxGas === "bigint"); + }, + isSDK(o: any): o is BlockParamsSDKType { + return o && (o.$typeUrl === BlockParams.typeUrl || typeof o.max_bytes === "bigint" && typeof o.max_gas === "bigint"); + }, + isAmino(o: any): o is BlockParamsAmino { + return o && (o.$typeUrl === BlockParams.typeUrl || typeof o.max_bytes === "bigint" && typeof o.max_gas === "bigint"); + }, encode(message: BlockParams, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.maxBytes !== BigInt(0)) { writer.uint32(8).int64(message.maxBytes); @@ -345,9 +374,6 @@ export const BlockParams = { if (message.maxGas !== BigInt(0)) { writer.uint32(16).int64(message.maxGas); } - if (message.timeIotaMs !== BigInt(0)) { - writer.uint32(24).int64(message.timeIotaMs); - } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): BlockParams { @@ -363,9 +389,6 @@ export const BlockParams = { case 2: message.maxGas = reader.int64(); break; - case 3: - message.timeIotaMs = reader.int64(); - break; default: reader.skipType(tag & 7); break; @@ -373,25 +396,38 @@ export const BlockParams = { } return message; }, + fromJSON(object: any): BlockParams { + return { + maxBytes: isSet(object.maxBytes) ? BigInt(object.maxBytes.toString()) : BigInt(0), + maxGas: isSet(object.maxGas) ? BigInt(object.maxGas.toString()) : BigInt(0) + }; + }, + toJSON(message: BlockParams): unknown { + const obj: any = {}; + message.maxBytes !== undefined && (obj.maxBytes = (message.maxBytes || BigInt(0)).toString()); + message.maxGas !== undefined && (obj.maxGas = (message.maxGas || BigInt(0)).toString()); + return obj; + }, fromPartial(object: Partial): BlockParams { const message = createBaseBlockParams(); message.maxBytes = object.maxBytes !== undefined && object.maxBytes !== null ? BigInt(object.maxBytes.toString()) : BigInt(0); message.maxGas = object.maxGas !== undefined && object.maxGas !== null ? BigInt(object.maxGas.toString()) : BigInt(0); - message.timeIotaMs = object.timeIotaMs !== undefined && object.timeIotaMs !== null ? BigInt(object.timeIotaMs.toString()) : BigInt(0); return message; }, fromAmino(object: BlockParamsAmino): BlockParams { - return { - maxBytes: BigInt(object.max_bytes), - maxGas: BigInt(object.max_gas), - timeIotaMs: BigInt(object.time_iota_ms) - }; + const message = createBaseBlockParams(); + if (object.max_bytes !== undefined && object.max_bytes !== null) { + message.maxBytes = BigInt(object.max_bytes); + } + if (object.max_gas !== undefined && object.max_gas !== null) { + message.maxGas = BigInt(object.max_gas); + } + return message; }, toAmino(message: BlockParams): BlockParamsAmino { const obj: any = {}; obj.max_bytes = message.maxBytes ? message.maxBytes.toString() : undefined; obj.max_gas = message.maxGas ? message.maxGas.toString() : undefined; - obj.time_iota_ms = message.timeIotaMs ? message.timeIotaMs.toString() : undefined; return obj; }, fromAminoMsg(object: BlockParamsAminoMsg): BlockParams { @@ -410,15 +446,25 @@ export const BlockParams = { }; } }; +GlobalDecoderRegistry.register(BlockParams.typeUrl, BlockParams); function createBaseEvidenceParams(): EvidenceParams { return { maxAgeNumBlocks: BigInt(0), - maxAgeDuration: undefined, + maxAgeDuration: Duration.fromPartial({}), maxBytes: BigInt(0) }; } export const EvidenceParams = { typeUrl: "/tendermint.types.EvidenceParams", + is(o: any): o is EvidenceParams { + return o && (o.$typeUrl === EvidenceParams.typeUrl || typeof o.maxAgeNumBlocks === "bigint" && Duration.is(o.maxAgeDuration) && typeof o.maxBytes === "bigint"); + }, + isSDK(o: any): o is EvidenceParamsSDKType { + return o && (o.$typeUrl === EvidenceParams.typeUrl || typeof o.max_age_num_blocks === "bigint" && Duration.isSDK(o.max_age_duration) && typeof o.max_bytes === "bigint"); + }, + isAmino(o: any): o is EvidenceParamsAmino { + return o && (o.$typeUrl === EvidenceParams.typeUrl || typeof o.max_age_num_blocks === "bigint" && Duration.isAmino(o.max_age_duration) && typeof o.max_bytes === "bigint"); + }, encode(message: EvidenceParams, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.maxAgeNumBlocks !== BigInt(0)) { writer.uint32(8).int64(message.maxAgeNumBlocks); @@ -454,6 +500,20 @@ export const EvidenceParams = { } return message; }, + fromJSON(object: any): EvidenceParams { + return { + maxAgeNumBlocks: isSet(object.maxAgeNumBlocks) ? BigInt(object.maxAgeNumBlocks.toString()) : BigInt(0), + maxAgeDuration: isSet(object.maxAgeDuration) ? Duration.fromJSON(object.maxAgeDuration) : undefined, + maxBytes: isSet(object.maxBytes) ? BigInt(object.maxBytes.toString()) : BigInt(0) + }; + }, + toJSON(message: EvidenceParams): unknown { + const obj: any = {}; + message.maxAgeNumBlocks !== undefined && (obj.maxAgeNumBlocks = (message.maxAgeNumBlocks || BigInt(0)).toString()); + message.maxAgeDuration !== undefined && (obj.maxAgeDuration = message.maxAgeDuration ? Duration.toJSON(message.maxAgeDuration) : undefined); + message.maxBytes !== undefined && (obj.maxBytes = (message.maxBytes || BigInt(0)).toString()); + return obj; + }, fromPartial(object: Partial): EvidenceParams { const message = createBaseEvidenceParams(); message.maxAgeNumBlocks = object.maxAgeNumBlocks !== undefined && object.maxAgeNumBlocks !== null ? BigInt(object.maxAgeNumBlocks.toString()) : BigInt(0); @@ -462,11 +522,17 @@ export const EvidenceParams = { return message; }, fromAmino(object: EvidenceParamsAmino): EvidenceParams { - return { - maxAgeNumBlocks: BigInt(object.max_age_num_blocks), - maxAgeDuration: object?.max_age_duration ? Duration.fromAmino(object.max_age_duration) : undefined, - maxBytes: BigInt(object.max_bytes) - }; + const message = createBaseEvidenceParams(); + if (object.max_age_num_blocks !== undefined && object.max_age_num_blocks !== null) { + message.maxAgeNumBlocks = BigInt(object.max_age_num_blocks); + } + if (object.max_age_duration !== undefined && object.max_age_duration !== null) { + message.maxAgeDuration = Duration.fromAmino(object.max_age_duration); + } + if (object.max_bytes !== undefined && object.max_bytes !== null) { + message.maxBytes = BigInt(object.max_bytes); + } + return message; }, toAmino(message: EvidenceParams): EvidenceParamsAmino { const obj: any = {}; @@ -491,6 +557,7 @@ export const EvidenceParams = { }; } }; +GlobalDecoderRegistry.register(EvidenceParams.typeUrl, EvidenceParams); function createBaseValidatorParams(): ValidatorParams { return { pubKeyTypes: [] @@ -498,6 +565,15 @@ function createBaseValidatorParams(): ValidatorParams { } export const ValidatorParams = { typeUrl: "/tendermint.types.ValidatorParams", + is(o: any): o is ValidatorParams { + return o && (o.$typeUrl === ValidatorParams.typeUrl || Array.isArray(o.pubKeyTypes) && (!o.pubKeyTypes.length || typeof o.pubKeyTypes[0] === "string")); + }, + isSDK(o: any): o is ValidatorParamsSDKType { + return o && (o.$typeUrl === ValidatorParams.typeUrl || Array.isArray(o.pub_key_types) && (!o.pub_key_types.length || typeof o.pub_key_types[0] === "string")); + }, + isAmino(o: any): o is ValidatorParamsAmino { + return o && (o.$typeUrl === ValidatorParams.typeUrl || Array.isArray(o.pub_key_types) && (!o.pub_key_types.length || typeof o.pub_key_types[0] === "string")); + }, encode(message: ValidatorParams, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.pubKeyTypes) { writer.uint32(10).string(v!); @@ -521,15 +597,29 @@ export const ValidatorParams = { } return message; }, + fromJSON(object: any): ValidatorParams { + return { + pubKeyTypes: Array.isArray(object?.pubKeyTypes) ? object.pubKeyTypes.map((e: any) => String(e)) : [] + }; + }, + toJSON(message: ValidatorParams): unknown { + const obj: any = {}; + if (message.pubKeyTypes) { + obj.pubKeyTypes = message.pubKeyTypes.map(e => e); + } else { + obj.pubKeyTypes = []; + } + return obj; + }, fromPartial(object: Partial): ValidatorParams { const message = createBaseValidatorParams(); message.pubKeyTypes = object.pubKeyTypes?.map(e => e) || []; return message; }, fromAmino(object: ValidatorParamsAmino): ValidatorParams { - return { - pubKeyTypes: Array.isArray(object?.pub_key_types) ? object.pub_key_types.map((e: any) => e) : [] - }; + const message = createBaseValidatorParams(); + message.pubKeyTypes = object.pub_key_types?.map(e => e) || []; + return message; }, toAmino(message: ValidatorParams): ValidatorParamsAmino { const obj: any = {}; @@ -556,16 +646,26 @@ export const ValidatorParams = { }; } }; +GlobalDecoderRegistry.register(ValidatorParams.typeUrl, ValidatorParams); function createBaseVersionParams(): VersionParams { return { - appVersion: BigInt(0) + app: BigInt(0) }; } export const VersionParams = { typeUrl: "/tendermint.types.VersionParams", + is(o: any): o is VersionParams { + return o && (o.$typeUrl === VersionParams.typeUrl || typeof o.app === "bigint"); + }, + isSDK(o: any): o is VersionParamsSDKType { + return o && (o.$typeUrl === VersionParams.typeUrl || typeof o.app === "bigint"); + }, + isAmino(o: any): o is VersionParamsAmino { + return o && (o.$typeUrl === VersionParams.typeUrl || typeof o.app === "bigint"); + }, encode(message: VersionParams, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { - if (message.appVersion !== BigInt(0)) { - writer.uint32(8).uint64(message.appVersion); + if (message.app !== BigInt(0)) { + writer.uint32(8).uint64(message.app); } return writer; }, @@ -577,7 +677,7 @@ export const VersionParams = { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.appVersion = reader.uint64(); + message.app = reader.uint64(); break; default: reader.skipType(tag & 7); @@ -586,19 +686,31 @@ export const VersionParams = { } return message; }, + fromJSON(object: any): VersionParams { + return { + app: isSet(object.app) ? BigInt(object.app.toString()) : BigInt(0) + }; + }, + toJSON(message: VersionParams): unknown { + const obj: any = {}; + message.app !== undefined && (obj.app = (message.app || BigInt(0)).toString()); + return obj; + }, fromPartial(object: Partial): VersionParams { const message = createBaseVersionParams(); - message.appVersion = object.appVersion !== undefined && object.appVersion !== null ? BigInt(object.appVersion.toString()) : BigInt(0); + message.app = object.app !== undefined && object.app !== null ? BigInt(object.app.toString()) : BigInt(0); return message; }, fromAmino(object: VersionParamsAmino): VersionParams { - return { - appVersion: BigInt(object.app_version) - }; + const message = createBaseVersionParams(); + if (object.app !== undefined && object.app !== null) { + message.app = BigInt(object.app); + } + return message; }, toAmino(message: VersionParams): VersionParamsAmino { const obj: any = {}; - obj.app_version = message.appVersion ? message.appVersion.toString() : undefined; + obj.app = message.app ? message.app.toString() : undefined; return obj; }, fromAminoMsg(object: VersionParamsAminoMsg): VersionParams { @@ -617,6 +729,7 @@ export const VersionParams = { }; } }; +GlobalDecoderRegistry.register(VersionParams.typeUrl, VersionParams); function createBaseHashedParams(): HashedParams { return { blockMaxBytes: BigInt(0), @@ -625,6 +738,15 @@ function createBaseHashedParams(): HashedParams { } export const HashedParams = { typeUrl: "/tendermint.types.HashedParams", + is(o: any): o is HashedParams { + return o && (o.$typeUrl === HashedParams.typeUrl || typeof o.blockMaxBytes === "bigint" && typeof o.blockMaxGas === "bigint"); + }, + isSDK(o: any): o is HashedParamsSDKType { + return o && (o.$typeUrl === HashedParams.typeUrl || typeof o.block_max_bytes === "bigint" && typeof o.block_max_gas === "bigint"); + }, + isAmino(o: any): o is HashedParamsAmino { + return o && (o.$typeUrl === HashedParams.typeUrl || typeof o.block_max_bytes === "bigint" && typeof o.block_max_gas === "bigint"); + }, encode(message: HashedParams, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.blockMaxBytes !== BigInt(0)) { writer.uint32(8).int64(message.blockMaxBytes); @@ -654,6 +776,18 @@ export const HashedParams = { } return message; }, + fromJSON(object: any): HashedParams { + return { + blockMaxBytes: isSet(object.blockMaxBytes) ? BigInt(object.blockMaxBytes.toString()) : BigInt(0), + blockMaxGas: isSet(object.blockMaxGas) ? BigInt(object.blockMaxGas.toString()) : BigInt(0) + }; + }, + toJSON(message: HashedParams): unknown { + const obj: any = {}; + message.blockMaxBytes !== undefined && (obj.blockMaxBytes = (message.blockMaxBytes || BigInt(0)).toString()); + message.blockMaxGas !== undefined && (obj.blockMaxGas = (message.blockMaxGas || BigInt(0)).toString()); + return obj; + }, fromPartial(object: Partial): HashedParams { const message = createBaseHashedParams(); message.blockMaxBytes = object.blockMaxBytes !== undefined && object.blockMaxBytes !== null ? BigInt(object.blockMaxBytes.toString()) : BigInt(0); @@ -661,10 +795,14 @@ export const HashedParams = { return message; }, fromAmino(object: HashedParamsAmino): HashedParams { - return { - blockMaxBytes: BigInt(object.block_max_bytes), - blockMaxGas: BigInt(object.block_max_gas) - }; + const message = createBaseHashedParams(); + if (object.block_max_bytes !== undefined && object.block_max_bytes !== null) { + message.blockMaxBytes = BigInt(object.block_max_bytes); + } + if (object.block_max_gas !== undefined && object.block_max_gas !== null) { + message.blockMaxGas = BigInt(object.block_max_gas); + } + return message; }, toAmino(message: HashedParams): HashedParamsAmino { const obj: any = {}; @@ -687,4 +825,5 @@ export const HashedParams = { value: HashedParams.encode(message).finish() }; } -}; \ No newline at end of file +}; +GlobalDecoderRegistry.register(HashedParams.typeUrl, HashedParams); \ No newline at end of file diff --git a/packages/osmojs/src/codegen/tendermint/types/types.ts b/packages/osmojs/src/codegen/tendermint/types/types.ts index b2d0da7c8..264fc72d8 100644 --- a/packages/osmojs/src/codegen/tendermint/types/types.ts +++ b/packages/osmojs/src/codegen/tendermint/types/types.ts @@ -3,7 +3,8 @@ import { Consensus, ConsensusAmino, ConsensusSDKType } from "../version/types"; import { Timestamp } from "../../google/protobuf/timestamp"; import { ValidatorSet, ValidatorSetAmino, ValidatorSetSDKType } from "./validator"; import { BinaryReader, BinaryWriter } from "../../binary"; -import { toTimestamp, fromTimestamp, isSet } from "../../helpers"; +import { isSet, bytesFromBase64, base64FromBytes, toTimestamp, fromTimestamp } from "../../helpers"; +import { GlobalDecoderRegistry } from "../../registry"; /** BlockIdFlag indicates which BlcokID the signature is for */ export enum BlockIDFlag { BLOCK_ID_FLAG_UNKNOWN = 0, @@ -107,8 +108,8 @@ export interface PartSetHeaderProtoMsg { } /** PartsetHeader */ export interface PartSetHeaderAmino { - total: number; - hash: Uint8Array; + total?: number; + hash?: string; } export interface PartSetHeaderAminoMsg { type: "/tendermint.types.PartSetHeader"; @@ -129,8 +130,8 @@ export interface PartProtoMsg { value: Uint8Array; } export interface PartAmino { - index: number; - bytes: Uint8Array; + index?: number; + bytes?: string; proof?: ProofAmino; } export interface PartAminoMsg { @@ -153,7 +154,7 @@ export interface BlockIDProtoMsg { } /** BlockID */ export interface BlockIDAmino { - hash: Uint8Array; + hash?: string; part_set_header?: PartSetHeaderAmino; } export interface BlockIDAminoMsg { @@ -165,7 +166,7 @@ export interface BlockIDSDKType { hash: Uint8Array; part_set_header: PartSetHeaderSDKType; } -/** Header defines the structure of a Tendermint block header. */ +/** Header defines the structure of a block header. */ export interface Header { /** basic block info */ version: Consensus; @@ -195,37 +196,37 @@ export interface HeaderProtoMsg { typeUrl: "/tendermint.types.Header"; value: Uint8Array; } -/** Header defines the structure of a Tendermint block header. */ +/** Header defines the structure of a block header. */ export interface HeaderAmino { /** basic block info */ version?: ConsensusAmino; - chain_id: string; - height: string; - time?: Date; + chain_id?: string; + height?: string; + time?: string; /** prev block info */ last_block_id?: BlockIDAmino; /** hashes of block data */ - last_commit_hash: Uint8Array; - data_hash: Uint8Array; + last_commit_hash?: string; + data_hash?: string; /** hashes from the app output from the prev block */ - validators_hash: Uint8Array; + validators_hash?: string; /** validators for the next block */ - next_validators_hash: Uint8Array; + next_validators_hash?: string; /** consensus params for current block */ - consensus_hash: Uint8Array; + consensus_hash?: string; /** state after txs from the previous block */ - app_hash: Uint8Array; - last_results_hash: Uint8Array; + app_hash?: string; + last_results_hash?: string; /** consensus info */ - evidence_hash: Uint8Array; + evidence_hash?: string; /** original proposer of the block */ - proposer_address: Uint8Array; + proposer_address?: string; } export interface HeaderAminoMsg { type: "/tendermint.types.Header"; value: HeaderAmino; } -/** Header defines the structure of a Tendermint block header. */ +/** Header defines the structure of a block header. */ export interface HeaderSDKType { version: ConsensusSDKType; chain_id: string; @@ -262,7 +263,7 @@ export interface DataAmino { * 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?: string[]; } export interface DataAminoMsg { type: "/tendermint.types.Data"; @@ -296,15 +297,15 @@ export interface VoteProtoMsg { * consensus. */ export interface VoteAmino { - type: SignedMsgType; - height: string; - round: number; + type?: SignedMsgType; + height?: string; + round?: number; /** zero if vote is nil. */ block_id?: BlockIDAmino; - timestamp?: Date; - validator_address: Uint8Array; - validator_index: number; - signature: Uint8Array; + timestamp?: string; + validator_address?: string; + validator_index?: number; + signature?: string; } export interface VoteAminoMsg { type: "/tendermint.types.Vote"; @@ -337,10 +338,10 @@ export interface CommitProtoMsg { } /** Commit contains the evidence that a block was committed by a set of validators. */ export interface CommitAmino { - height: string; - round: number; + height?: string; + round?: number; block_id?: BlockIDAmino; - signatures: CommitSigAmino[]; + signatures?: CommitSigAmino[]; } export interface CommitAminoMsg { type: "/tendermint.types.Commit"; @@ -366,10 +367,10 @@ export interface CommitSigProtoMsg { } /** CommitSig is a part of the Vote included in a Commit. */ export interface CommitSigAmino { - block_id_flag: BlockIDFlag; - validator_address: Uint8Array; - timestamp?: Date; - signature: Uint8Array; + block_id_flag?: BlockIDFlag; + validator_address?: string; + timestamp?: string; + signature?: string; } export interface CommitSigAminoMsg { type: "/tendermint.types.CommitSig"; @@ -396,13 +397,13 @@ export interface ProposalProtoMsg { value: Uint8Array; } export interface ProposalAmino { - type: SignedMsgType; - height: string; - round: number; - pol_round: number; + type?: SignedMsgType; + height?: string; + round?: number; + pol_round?: number; block_id?: BlockIDAmino; - timestamp?: Date; - signature: Uint8Array; + timestamp?: string; + signature?: string; } export interface ProposalAminoMsg { type: "/tendermint.types.Proposal"; @@ -418,8 +419,8 @@ export interface ProposalSDKType { signature: Uint8Array; } export interface SignedHeader { - header: Header; - commit: Commit; + header?: Header; + commit?: Commit; } export interface SignedHeaderProtoMsg { typeUrl: "/tendermint.types.SignedHeader"; @@ -434,12 +435,12 @@ export interface SignedHeaderAminoMsg { value: SignedHeaderAmino; } export interface SignedHeaderSDKType { - header: HeaderSDKType; - commit: CommitSDKType; + header?: HeaderSDKType; + commit?: CommitSDKType; } export interface LightBlock { - signedHeader: SignedHeader; - validatorSet: ValidatorSet; + signedHeader?: SignedHeader; + validatorSet?: ValidatorSet; } export interface LightBlockProtoMsg { typeUrl: "/tendermint.types.LightBlock"; @@ -454,8 +455,8 @@ export interface LightBlockAminoMsg { value: LightBlockAmino; } export interface LightBlockSDKType { - signed_header: SignedHeaderSDKType; - validator_set: ValidatorSetSDKType; + signed_header?: SignedHeaderSDKType; + validator_set?: ValidatorSetSDKType; } export interface BlockMeta { blockId: BlockID; @@ -469,9 +470,9 @@ export interface BlockMetaProtoMsg { } export interface BlockMetaAmino { block_id?: BlockIDAmino; - block_size: string; + block_size?: string; header?: HeaderAmino; - num_txs: string; + num_txs?: string; } export interface BlockMetaAminoMsg { type: "/tendermint.types.BlockMeta"; @@ -487,7 +488,7 @@ export interface BlockMetaSDKType { export interface TxProof { rootHash: Uint8Array; data: Uint8Array; - proof: Proof; + proof?: Proof; } export interface TxProofProtoMsg { typeUrl: "/tendermint.types.TxProof"; @@ -495,8 +496,8 @@ export interface TxProofProtoMsg { } /** TxProof represents a Merkle proof of the presence of a transaction in the Merkle tree. */ export interface TxProofAmino { - root_hash: Uint8Array; - data: Uint8Array; + root_hash?: string; + data?: string; proof?: ProofAmino; } export interface TxProofAminoMsg { @@ -507,7 +508,7 @@ export interface TxProofAminoMsg { export interface TxProofSDKType { root_hash: Uint8Array; data: Uint8Array; - proof: ProofSDKType; + proof?: ProofSDKType; } function createBasePartSetHeader(): PartSetHeader { return { @@ -517,6 +518,15 @@ function createBasePartSetHeader(): PartSetHeader { } export const PartSetHeader = { typeUrl: "/tendermint.types.PartSetHeader", + is(o: any): o is PartSetHeader { + return o && (o.$typeUrl === PartSetHeader.typeUrl || typeof o.total === "number" && (o.hash instanceof Uint8Array || typeof o.hash === "string")); + }, + isSDK(o: any): o is PartSetHeaderSDKType { + return o && (o.$typeUrl === PartSetHeader.typeUrl || typeof o.total === "number" && (o.hash instanceof Uint8Array || typeof o.hash === "string")); + }, + isAmino(o: any): o is PartSetHeaderAmino { + return o && (o.$typeUrl === PartSetHeader.typeUrl || typeof o.total === "number" && (o.hash instanceof Uint8Array || typeof o.hash === "string")); + }, encode(message: PartSetHeader, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.total !== 0) { writer.uint32(8).uint32(message.total); @@ -546,6 +556,18 @@ export const PartSetHeader = { } 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)); + message.hash !== undefined && (obj.hash = base64FromBytes(message.hash !== undefined ? message.hash : new Uint8Array())); + return obj; + }, fromPartial(object: Partial): PartSetHeader { const message = createBasePartSetHeader(); message.total = object.total ?? 0; @@ -553,15 +575,19 @@ export const PartSetHeader = { return message; }, fromAmino(object: PartSetHeaderAmino): PartSetHeader { - return { - total: object.total, - hash: object.hash - }; + const message = createBasePartSetHeader(); + if (object.total !== undefined && object.total !== null) { + message.total = object.total; + } + if (object.hash !== undefined && object.hash !== null) { + message.hash = bytesFromBase64(object.hash); + } + return message; }, toAmino(message: PartSetHeader): PartSetHeaderAmino { const obj: any = {}; obj.total = message.total; - obj.hash = message.hash; + obj.hash = message.hash ? base64FromBytes(message.hash) : undefined; return obj; }, fromAminoMsg(object: PartSetHeaderAminoMsg): PartSetHeader { @@ -580,6 +606,7 @@ export const PartSetHeader = { }; } }; +GlobalDecoderRegistry.register(PartSetHeader.typeUrl, PartSetHeader); function createBasePart(): Part { return { index: 0, @@ -589,6 +616,15 @@ function createBasePart(): Part { } export const Part = { typeUrl: "/tendermint.types.Part", + is(o: any): o is Part { + return o && (o.$typeUrl === Part.typeUrl || typeof o.index === "number" && (o.bytes instanceof Uint8Array || typeof o.bytes === "string") && Proof.is(o.proof)); + }, + isSDK(o: any): o is PartSDKType { + return o && (o.$typeUrl === Part.typeUrl || typeof o.index === "number" && (o.bytes instanceof Uint8Array || typeof o.bytes === "string") && Proof.isSDK(o.proof)); + }, + isAmino(o: any): o is PartAmino { + return o && (o.$typeUrl === Part.typeUrl || typeof o.index === "number" && (o.bytes instanceof Uint8Array || typeof o.bytes === "string") && Proof.isAmino(o.proof)); + }, encode(message: Part, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.index !== 0) { writer.uint32(8).uint32(message.index); @@ -624,6 +660,20 @@ export const Part = { } return message; }, + fromJSON(object: any): Part { + return { + 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)); + 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; + }, fromPartial(object: Partial): Part { const message = createBasePart(); message.index = object.index ?? 0; @@ -632,16 +682,22 @@ export const Part = { return message; }, fromAmino(object: PartAmino): Part { - return { - index: object.index, - bytes: object.bytes, - proof: object?.proof ? Proof.fromAmino(object.proof) : undefined - }; + const message = createBasePart(); + if (object.index !== undefined && object.index !== null) { + message.index = object.index; + } + if (object.bytes !== undefined && object.bytes !== null) { + message.bytes = bytesFromBase64(object.bytes); + } + if (object.proof !== undefined && object.proof !== null) { + message.proof = Proof.fromAmino(object.proof); + } + return message; }, toAmino(message: Part): PartAmino { const obj: any = {}; obj.index = message.index; - obj.bytes = message.bytes; + obj.bytes = message.bytes ? base64FromBytes(message.bytes) : undefined; obj.proof = message.proof ? Proof.toAmino(message.proof) : undefined; return obj; }, @@ -661,6 +717,7 @@ export const Part = { }; } }; +GlobalDecoderRegistry.register(Part.typeUrl, Part); function createBaseBlockID(): BlockID { return { hash: new Uint8Array(), @@ -669,6 +726,15 @@ function createBaseBlockID(): BlockID { } export const BlockID = { typeUrl: "/tendermint.types.BlockID", + is(o: any): o is BlockID { + return o && (o.$typeUrl === BlockID.typeUrl || (o.hash instanceof Uint8Array || typeof o.hash === "string") && PartSetHeader.is(o.partSetHeader)); + }, + isSDK(o: any): o is BlockIDSDKType { + return o && (o.$typeUrl === BlockID.typeUrl || (o.hash instanceof Uint8Array || typeof o.hash === "string") && PartSetHeader.isSDK(o.part_set_header)); + }, + isAmino(o: any): o is BlockIDAmino { + return o && (o.$typeUrl === BlockID.typeUrl || (o.hash instanceof Uint8Array || typeof o.hash === "string") && PartSetHeader.isAmino(o.part_set_header)); + }, encode(message: BlockID, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.hash.length !== 0) { writer.uint32(10).bytes(message.hash); @@ -698,6 +764,18 @@ export const BlockID = { } 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 + }; + }, + toJSON(message: BlockID): unknown { + const obj: any = {}; + message.hash !== undefined && (obj.hash = base64FromBytes(message.hash !== undefined ? message.hash : new Uint8Array())); + message.partSetHeader !== undefined && (obj.partSetHeader = message.partSetHeader ? PartSetHeader.toJSON(message.partSetHeader) : undefined); + return obj; + }, fromPartial(object: Partial): BlockID { const message = createBaseBlockID(); message.hash = object.hash ?? new Uint8Array(); @@ -705,14 +783,18 @@ export const BlockID = { return message; }, fromAmino(object: BlockIDAmino): BlockID { - return { - hash: object.hash, - partSetHeader: object?.part_set_header ? PartSetHeader.fromAmino(object.part_set_header) : undefined - }; + const message = createBaseBlockID(); + if (object.hash !== undefined && object.hash !== null) { + message.hash = bytesFromBase64(object.hash); + } + if (object.part_set_header !== undefined && object.part_set_header !== null) { + message.partSetHeader = PartSetHeader.fromAmino(object.part_set_header); + } + return message; }, toAmino(message: BlockID): BlockIDAmino { const obj: any = {}; - obj.hash = message.hash; + obj.hash = message.hash ? base64FromBytes(message.hash) : undefined; obj.part_set_header = message.partSetHeader ? PartSetHeader.toAmino(message.partSetHeader) : undefined; return obj; }, @@ -732,12 +814,13 @@ export const BlockID = { }; } }; +GlobalDecoderRegistry.register(BlockID.typeUrl, BlockID); function createBaseHeader(): Header { return { version: Consensus.fromPartial({}), chainId: "", height: BigInt(0), - time: undefined, + time: new Date(), lastBlockId: BlockID.fromPartial({}), lastCommitHash: new Uint8Array(), dataHash: new Uint8Array(), @@ -752,6 +835,15 @@ function createBaseHeader(): Header { } export const Header = { typeUrl: "/tendermint.types.Header", + is(o: any): o is Header { + return o && (o.$typeUrl === Header.typeUrl || Consensus.is(o.version) && typeof o.chainId === "string" && typeof o.height === "bigint" && Timestamp.is(o.time) && BlockID.is(o.lastBlockId) && (o.lastCommitHash instanceof Uint8Array || typeof o.lastCommitHash === "string") && (o.dataHash instanceof Uint8Array || typeof o.dataHash === "string") && (o.validatorsHash instanceof Uint8Array || typeof o.validatorsHash === "string") && (o.nextValidatorsHash instanceof Uint8Array || typeof o.nextValidatorsHash === "string") && (o.consensusHash instanceof Uint8Array || typeof o.consensusHash === "string") && (o.appHash instanceof Uint8Array || typeof o.appHash === "string") && (o.lastResultsHash instanceof Uint8Array || typeof o.lastResultsHash === "string") && (o.evidenceHash instanceof Uint8Array || typeof o.evidenceHash === "string") && (o.proposerAddress instanceof Uint8Array || typeof o.proposerAddress === "string")); + }, + isSDK(o: any): o is HeaderSDKType { + return o && (o.$typeUrl === Header.typeUrl || Consensus.isSDK(o.version) && typeof o.chain_id === "string" && typeof o.height === "bigint" && Timestamp.isSDK(o.time) && BlockID.isSDK(o.last_block_id) && (o.last_commit_hash instanceof Uint8Array || typeof o.last_commit_hash === "string") && (o.data_hash instanceof Uint8Array || typeof o.data_hash === "string") && (o.validators_hash instanceof Uint8Array || typeof o.validators_hash === "string") && (o.next_validators_hash instanceof Uint8Array || typeof o.next_validators_hash === "string") && (o.consensus_hash instanceof Uint8Array || typeof o.consensus_hash === "string") && (o.app_hash instanceof Uint8Array || typeof o.app_hash === "string") && (o.last_results_hash instanceof Uint8Array || typeof o.last_results_hash === "string") && (o.evidence_hash instanceof Uint8Array || typeof o.evidence_hash === "string") && (o.proposer_address instanceof Uint8Array || typeof o.proposer_address === "string")); + }, + isAmino(o: any): o is HeaderAmino { + return o && (o.$typeUrl === Header.typeUrl || Consensus.isAmino(o.version) && typeof o.chain_id === "string" && typeof o.height === "bigint" && Timestamp.isAmino(o.time) && BlockID.isAmino(o.last_block_id) && (o.last_commit_hash instanceof Uint8Array || typeof o.last_commit_hash === "string") && (o.data_hash instanceof Uint8Array || typeof o.data_hash === "string") && (o.validators_hash instanceof Uint8Array || typeof o.validators_hash === "string") && (o.next_validators_hash instanceof Uint8Array || typeof o.next_validators_hash === "string") && (o.consensus_hash instanceof Uint8Array || typeof o.consensus_hash === "string") && (o.app_hash instanceof Uint8Array || typeof o.app_hash === "string") && (o.last_results_hash instanceof Uint8Array || typeof o.last_results_hash === "string") && (o.evidence_hash instanceof Uint8Array || typeof o.evidence_hash === "string") && (o.proposer_address instanceof Uint8Array || typeof o.proposer_address === "string")); + }, encode(message: Header, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.version !== undefined) { Consensus.encode(message.version, writer.uint32(10).fork()).ldelim(); @@ -853,6 +945,42 @@ export const Header = { } return message; }, + fromJSON(object: any): Header { + return { + version: isSet(object.version) ? Consensus.fromJSON(object.version) : undefined, + chainId: isSet(object.chainId) ? String(object.chainId) : "", + height: isSet(object.height) ? BigInt(object.height.toString()) : BigInt(0), + time: isSet(object.time) ? new Date(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(), + 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() + }; + }, + 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 || BigInt(0)).toString()); + message.time !== undefined && (obj.time = message.time.toISOString()); + 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.dataHash !== undefined && (obj.dataHash = base64FromBytes(message.dataHash !== undefined ? message.dataHash : new Uint8Array())); + message.validatorsHash !== undefined && (obj.validatorsHash = base64FromBytes(message.validatorsHash !== undefined ? message.validatorsHash : new Uint8Array())); + message.nextValidatorsHash !== undefined && (obj.nextValidatorsHash = base64FromBytes(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())); + message.lastResultsHash !== undefined && (obj.lastResultsHash = base64FromBytes(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; + }, fromPartial(object: Partial
): Header { const message = createBaseHeader(); message.version = object.version !== undefined && object.version !== null ? Consensus.fromPartial(object.version) : undefined; @@ -872,39 +1000,67 @@ export const Header = { return message; }, fromAmino(object: HeaderAmino): Header { - return { - version: object?.version ? Consensus.fromAmino(object.version) : undefined, - chainId: object.chain_id, - height: BigInt(object.height), - time: object.time, - lastBlockId: object?.last_block_id ? BlockID.fromAmino(object.last_block_id) : undefined, - lastCommitHash: object.last_commit_hash, - dataHash: object.data_hash, - validatorsHash: object.validators_hash, - nextValidatorsHash: object.next_validators_hash, - consensusHash: object.consensus_hash, - appHash: object.app_hash, - lastResultsHash: object.last_results_hash, - evidenceHash: object.evidence_hash, - proposerAddress: object.proposer_address - }; + const message = createBaseHeader(); + if (object.version !== undefined && object.version !== null) { + message.version = Consensus.fromAmino(object.version); + } + if (object.chain_id !== undefined && object.chain_id !== null) { + message.chainId = object.chain_id; + } + if (object.height !== undefined && object.height !== null) { + message.height = BigInt(object.height); + } + if (object.time !== undefined && object.time !== null) { + message.time = fromTimestamp(Timestamp.fromAmino(object.time)); + } + if (object.last_block_id !== undefined && object.last_block_id !== null) { + message.lastBlockId = BlockID.fromAmino(object.last_block_id); + } + if (object.last_commit_hash !== undefined && object.last_commit_hash !== null) { + message.lastCommitHash = bytesFromBase64(object.last_commit_hash); + } + if (object.data_hash !== undefined && object.data_hash !== null) { + message.dataHash = bytesFromBase64(object.data_hash); + } + if (object.validators_hash !== undefined && object.validators_hash !== null) { + message.validatorsHash = bytesFromBase64(object.validators_hash); + } + if (object.next_validators_hash !== undefined && object.next_validators_hash !== null) { + message.nextValidatorsHash = bytesFromBase64(object.next_validators_hash); + } + if (object.consensus_hash !== undefined && object.consensus_hash !== null) { + message.consensusHash = bytesFromBase64(object.consensus_hash); + } + if (object.app_hash !== undefined && object.app_hash !== null) { + message.appHash = bytesFromBase64(object.app_hash); + } + if (object.last_results_hash !== undefined && object.last_results_hash !== null) { + message.lastResultsHash = bytesFromBase64(object.last_results_hash); + } + if (object.evidence_hash !== undefined && object.evidence_hash !== null) { + message.evidenceHash = bytesFromBase64(object.evidence_hash); + } + if (object.proposer_address !== undefined && object.proposer_address !== null) { + message.proposerAddress = bytesFromBase64(object.proposer_address); + } + return message; }, toAmino(message: Header): HeaderAmino { const obj: any = {}; obj.version = message.version ? Consensus.toAmino(message.version) : undefined; obj.chain_id = message.chainId; obj.height = message.height ? message.height.toString() : undefined; - obj.time = message.time; + obj.time = message.time ? Timestamp.toAmino(toTimestamp(message.time)) : undefined; obj.last_block_id = message.lastBlockId ? BlockID.toAmino(message.lastBlockId) : undefined; - obj.last_commit_hash = message.lastCommitHash; - obj.data_hash = message.dataHash; - obj.validators_hash = message.validatorsHash; - obj.next_validators_hash = message.nextValidatorsHash; - obj.consensus_hash = message.consensusHash; - obj.app_hash = message.appHash; - obj.last_results_hash = message.lastResultsHash; - obj.evidence_hash = message.evidenceHash; - obj.proposer_address = message.proposerAddress; + obj.last_commit_hash = message.lastCommitHash ? base64FromBytes(message.lastCommitHash) : undefined; + obj.data_hash = message.dataHash ? base64FromBytes(message.dataHash) : undefined; + obj.validators_hash = message.validatorsHash ? base64FromBytes(message.validatorsHash) : undefined; + obj.next_validators_hash = message.nextValidatorsHash ? base64FromBytes(message.nextValidatorsHash) : undefined; + obj.consensus_hash = message.consensusHash ? base64FromBytes(message.consensusHash) : undefined; + obj.app_hash = message.appHash ? base64FromBytes(message.appHash) : undefined; + obj.last_results_hash = message.lastResultsHash ? base64FromBytes(message.lastResultsHash) : undefined; + obj.evidence_hash = message.evidenceHash ? base64FromBytes(message.evidenceHash) : undefined; + obj.proposer_address = message.proposerAddress ? base64FromBytes(message.proposerAddress) : undefined; return obj; }, fromAminoMsg(object: HeaderAminoMsg): Header { @@ -923,6 +1079,7 @@ export const Header = { }; } }; +GlobalDecoderRegistry.register(Header.typeUrl, Header); function createBaseData(): Data { return { txs: [] @@ -930,6 +1087,15 @@ function createBaseData(): Data { } export const Data = { typeUrl: "/tendermint.types.Data", + is(o: any): o is Data { + return o && (o.$typeUrl === Data.typeUrl || Array.isArray(o.txs) && (!o.txs.length || o.txs[0] instanceof Uint8Array || typeof o.txs[0] === "string")); + }, + isSDK(o: any): o is DataSDKType { + return o && (o.$typeUrl === Data.typeUrl || Array.isArray(o.txs) && (!o.txs.length || o.txs[0] instanceof Uint8Array || typeof o.txs[0] === "string")); + }, + isAmino(o: any): o is DataAmino { + return o && (o.$typeUrl === Data.typeUrl || Array.isArray(o.txs) && (!o.txs.length || o.txs[0] instanceof Uint8Array || typeof o.txs[0] === "string")); + }, encode(message: Data, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.txs) { writer.uint32(10).bytes(v!); @@ -953,20 +1119,34 @@ export const Data = { } return message; }, + fromJSON(object: any): Data { + return { + txs: Array.isArray(object?.txs) ? object.txs.map((e: any) => bytesFromBase64(e)) : [] + }; + }, + toJSON(message: Data): unknown { + const obj: any = {}; + if (message.txs) { + obj.txs = message.txs.map(e => base64FromBytes(e !== undefined ? e : new Uint8Array())); + } else { + obj.txs = []; + } + return obj; + }, fromPartial(object: Partial): Data { const message = createBaseData(); message.txs = object.txs?.map(e => e) || []; return message; }, fromAmino(object: DataAmino): Data { - return { - txs: Array.isArray(object?.txs) ? object.txs.map((e: any) => e) : [] - }; + const message = createBaseData(); + message.txs = object.txs?.map(e => bytesFromBase64(e)) || []; + return message; }, toAmino(message: Data): DataAmino { const obj: any = {}; if (message.txs) { - obj.txs = message.txs.map(e => e); + obj.txs = message.txs.map(e => base64FromBytes(e)); } else { obj.txs = []; } @@ -988,13 +1168,14 @@ export const Data = { }; } }; +GlobalDecoderRegistry.register(Data.typeUrl, Data); function createBaseVote(): Vote { return { type: 0, height: BigInt(0), round: 0, blockId: BlockID.fromPartial({}), - timestamp: undefined, + timestamp: new Date(), validatorAddress: new Uint8Array(), validatorIndex: 0, signature: new Uint8Array() @@ -1002,6 +1183,15 @@ function createBaseVote(): Vote { } export const Vote = { typeUrl: "/tendermint.types.Vote", + is(o: any): o is Vote { + return o && (o.$typeUrl === Vote.typeUrl || isSet(o.type) && typeof o.height === "bigint" && typeof o.round === "number" && BlockID.is(o.blockId) && Timestamp.is(o.timestamp) && (o.validatorAddress instanceof Uint8Array || typeof o.validatorAddress === "string") && typeof o.validatorIndex === "number" && (o.signature instanceof Uint8Array || typeof o.signature === "string")); + }, + isSDK(o: any): o is VoteSDKType { + return o && (o.$typeUrl === Vote.typeUrl || isSet(o.type) && typeof o.height === "bigint" && typeof o.round === "number" && BlockID.isSDK(o.block_id) && Timestamp.isSDK(o.timestamp) && (o.validator_address instanceof Uint8Array || typeof o.validator_address === "string") && typeof o.validator_index === "number" && (o.signature instanceof Uint8Array || typeof o.signature === "string")); + }, + isAmino(o: any): o is VoteAmino { + return o && (o.$typeUrl === Vote.typeUrl || isSet(o.type) && typeof o.height === "bigint" && typeof o.round === "number" && BlockID.isAmino(o.block_id) && Timestamp.isAmino(o.timestamp) && (o.validator_address instanceof Uint8Array || typeof o.validator_address === "string") && typeof o.validator_index === "number" && (o.signature instanceof Uint8Array || typeof o.signature === "string")); + }, encode(message: Vote, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.type !== 0) { writer.uint32(8).int32(message.type); @@ -1067,6 +1257,30 @@ export const Vote = { } return message; }, + fromJSON(object: any): Vote { + return { + type: isSet(object.type) ? signedMsgTypeFromJSON(object.type) : -1, + height: isSet(object.height) ? BigInt(object.height.toString()) : BigInt(0), + round: isSet(object.round) ? Number(object.round) : 0, + blockId: isSet(object.blockId) ? BlockID.fromJSON(object.blockId) : undefined, + timestamp: isSet(object.timestamp) ? new Date(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() + }; + }, + toJSON(message: Vote): unknown { + const obj: any = {}; + message.type !== undefined && (obj.type = signedMsgTypeToJSON(message.type)); + message.height !== undefined && (obj.height = (message.height || BigInt(0)).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.signature !== undefined && (obj.signature = base64FromBytes(message.signature !== undefined ? message.signature : new Uint8Array())); + return obj; + }, fromPartial(object: Partial): Vote { const message = createBaseVote(); message.type = object.type ?? 0; @@ -1080,27 +1294,43 @@ export const Vote = { return message; }, fromAmino(object: VoteAmino): Vote { - return { - type: isSet(object.type) ? signedMsgTypeFromJSON(object.type) : -1, - height: BigInt(object.height), - round: object.round, - blockId: object?.block_id ? BlockID.fromAmino(object.block_id) : undefined, - timestamp: object.timestamp, - validatorAddress: object.validator_address, - validatorIndex: object.validator_index, - signature: object.signature - }; + const message = createBaseVote(); + if (object.type !== undefined && object.type !== null) { + message.type = signedMsgTypeFromJSON(object.type); + } + if (object.height !== undefined && object.height !== null) { + message.height = BigInt(object.height); + } + if (object.round !== undefined && object.round !== null) { + message.round = object.round; + } + if (object.block_id !== undefined && object.block_id !== null) { + message.blockId = BlockID.fromAmino(object.block_id); + } + if (object.timestamp !== undefined && object.timestamp !== null) { + message.timestamp = fromTimestamp(Timestamp.fromAmino(object.timestamp)); + } + if (object.validator_address !== undefined && object.validator_address !== null) { + message.validatorAddress = bytesFromBase64(object.validator_address); + } + if (object.validator_index !== undefined && object.validator_index !== null) { + message.validatorIndex = object.validator_index; + } + if (object.signature !== undefined && object.signature !== null) { + message.signature = bytesFromBase64(object.signature); + } + return message; }, toAmino(message: Vote): VoteAmino { const obj: any = {}; - obj.type = message.type; + obj.type = signedMsgTypeToJSON(message.type); obj.height = message.height ? message.height.toString() : undefined; obj.round = message.round; obj.block_id = message.blockId ? BlockID.toAmino(message.blockId) : undefined; - obj.timestamp = message.timestamp; - obj.validator_address = message.validatorAddress; + obj.timestamp = message.timestamp ? Timestamp.toAmino(toTimestamp(message.timestamp)) : undefined; + obj.validator_address = message.validatorAddress ? base64FromBytes(message.validatorAddress) : undefined; obj.validator_index = message.validatorIndex; - obj.signature = message.signature; + obj.signature = message.signature ? base64FromBytes(message.signature) : undefined; return obj; }, fromAminoMsg(object: VoteAminoMsg): Vote { @@ -1119,6 +1349,7 @@ export const Vote = { }; } }; +GlobalDecoderRegistry.register(Vote.typeUrl, Vote); function createBaseCommit(): Commit { return { height: BigInt(0), @@ -1129,6 +1360,15 @@ function createBaseCommit(): Commit { } export const Commit = { typeUrl: "/tendermint.types.Commit", + is(o: any): o is Commit { + return o && (o.$typeUrl === Commit.typeUrl || typeof o.height === "bigint" && typeof o.round === "number" && BlockID.is(o.blockId) && Array.isArray(o.signatures) && (!o.signatures.length || CommitSig.is(o.signatures[0]))); + }, + isSDK(o: any): o is CommitSDKType { + return o && (o.$typeUrl === Commit.typeUrl || typeof o.height === "bigint" && typeof o.round === "number" && BlockID.isSDK(o.block_id) && Array.isArray(o.signatures) && (!o.signatures.length || CommitSig.isSDK(o.signatures[0]))); + }, + isAmino(o: any): o is CommitAmino { + return o && (o.$typeUrl === Commit.typeUrl || typeof o.height === "bigint" && typeof o.round === "number" && BlockID.isAmino(o.block_id) && Array.isArray(o.signatures) && (!o.signatures.length || CommitSig.isAmino(o.signatures[0]))); + }, encode(message: Commit, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.height !== BigInt(0)) { writer.uint32(8).int64(message.height); @@ -1170,6 +1410,26 @@ export const Commit = { } return message; }, + fromJSON(object: any): Commit { + return { + height: isSet(object.height) ? BigInt(object.height.toString()) : BigInt(0), + 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)) : [] + }; + }, + toJSON(message: Commit): unknown { + const obj: any = {}; + message.height !== undefined && (obj.height = (message.height || BigInt(0)).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); + } else { + obj.signatures = []; + } + return obj; + }, fromPartial(object: Partial): Commit { const message = createBaseCommit(); message.height = object.height !== undefined && object.height !== null ? BigInt(object.height.toString()) : BigInt(0); @@ -1179,12 +1439,18 @@ export const Commit = { return message; }, fromAmino(object: CommitAmino): Commit { - return { - height: BigInt(object.height), - round: object.round, - blockId: object?.block_id ? BlockID.fromAmino(object.block_id) : undefined, - signatures: Array.isArray(object?.signatures) ? object.signatures.map((e: any) => CommitSig.fromAmino(e)) : [] - }; + const message = createBaseCommit(); + if (object.height !== undefined && object.height !== null) { + message.height = BigInt(object.height); + } + if (object.round !== undefined && object.round !== null) { + message.round = object.round; + } + if (object.block_id !== undefined && object.block_id !== null) { + message.blockId = BlockID.fromAmino(object.block_id); + } + message.signatures = object.signatures?.map(e => CommitSig.fromAmino(e)) || []; + return message; }, toAmino(message: Commit): CommitAmino { const obj: any = {}; @@ -1214,16 +1480,26 @@ export const Commit = { }; } }; +GlobalDecoderRegistry.register(Commit.typeUrl, Commit); function createBaseCommitSig(): CommitSig { return { blockIdFlag: 0, validatorAddress: new Uint8Array(), - timestamp: undefined, + timestamp: new Date(), signature: new Uint8Array() }; } export const CommitSig = { typeUrl: "/tendermint.types.CommitSig", + is(o: any): o is CommitSig { + return o && (o.$typeUrl === CommitSig.typeUrl || isSet(o.blockIdFlag) && (o.validatorAddress instanceof Uint8Array || typeof o.validatorAddress === "string") && Timestamp.is(o.timestamp) && (o.signature instanceof Uint8Array || typeof o.signature === "string")); + }, + isSDK(o: any): o is CommitSigSDKType { + return o && (o.$typeUrl === CommitSig.typeUrl || isSet(o.block_id_flag) && (o.validator_address instanceof Uint8Array || typeof o.validator_address === "string") && Timestamp.isSDK(o.timestamp) && (o.signature instanceof Uint8Array || typeof o.signature === "string")); + }, + isAmino(o: any): o is CommitSigAmino { + return o && (o.$typeUrl === CommitSig.typeUrl || isSet(o.block_id_flag) && (o.validator_address instanceof Uint8Array || typeof o.validator_address === "string") && Timestamp.isAmino(o.timestamp) && (o.signature instanceof Uint8Array || typeof o.signature === "string")); + }, encode(message: CommitSig, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.blockIdFlag !== 0) { writer.uint32(8).int32(message.blockIdFlag); @@ -1265,6 +1541,22 @@ export const CommitSig = { } return message; }, + fromJSON(object: any): CommitSig { + return { + blockIdFlag: isSet(object.blockIdFlag) ? blockIDFlagFromJSON(object.blockIdFlag) : -1, + validatorAddress: isSet(object.validatorAddress) ? bytesFromBase64(object.validatorAddress) : new Uint8Array(), + timestamp: isSet(object.timestamp) ? new Date(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)); + message.validatorAddress !== undefined && (obj.validatorAddress = base64FromBytes(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; + }, fromPartial(object: Partial): CommitSig { const message = createBaseCommitSig(); message.blockIdFlag = object.blockIdFlag ?? 0; @@ -1274,19 +1566,27 @@ export const CommitSig = { return message; }, fromAmino(object: CommitSigAmino): CommitSig { - return { - blockIdFlag: isSet(object.block_id_flag) ? blockIDFlagFromJSON(object.block_id_flag) : -1, - validatorAddress: object.validator_address, - timestamp: object.timestamp, - signature: object.signature - }; + const message = createBaseCommitSig(); + if (object.block_id_flag !== undefined && object.block_id_flag !== null) { + message.blockIdFlag = blockIDFlagFromJSON(object.block_id_flag); + } + if (object.validator_address !== undefined && object.validator_address !== null) { + message.validatorAddress = bytesFromBase64(object.validator_address); + } + if (object.timestamp !== undefined && object.timestamp !== null) { + message.timestamp = fromTimestamp(Timestamp.fromAmino(object.timestamp)); + } + if (object.signature !== undefined && object.signature !== null) { + message.signature = bytesFromBase64(object.signature); + } + return message; }, toAmino(message: CommitSig): CommitSigAmino { const obj: any = {}; - obj.block_id_flag = message.blockIdFlag; - obj.validator_address = message.validatorAddress; - obj.timestamp = message.timestamp; - obj.signature = message.signature; + obj.block_id_flag = blockIDFlagToJSON(message.blockIdFlag); + obj.validator_address = message.validatorAddress ? base64FromBytes(message.validatorAddress) : undefined; + obj.timestamp = message.timestamp ? Timestamp.toAmino(toTimestamp(message.timestamp)) : undefined; + obj.signature = message.signature ? base64FromBytes(message.signature) : undefined; return obj; }, fromAminoMsg(object: CommitSigAminoMsg): CommitSig { @@ -1305,6 +1605,7 @@ export const CommitSig = { }; } }; +GlobalDecoderRegistry.register(CommitSig.typeUrl, CommitSig); function createBaseProposal(): Proposal { return { type: 0, @@ -1312,12 +1613,21 @@ function createBaseProposal(): Proposal { round: 0, polRound: 0, blockId: BlockID.fromPartial({}), - timestamp: undefined, + timestamp: new Date(), signature: new Uint8Array() }; } export const Proposal = { typeUrl: "/tendermint.types.Proposal", + is(o: any): o is Proposal { + return o && (o.$typeUrl === Proposal.typeUrl || isSet(o.type) && typeof o.height === "bigint" && typeof o.round === "number" && typeof o.polRound === "number" && BlockID.is(o.blockId) && Timestamp.is(o.timestamp) && (o.signature instanceof Uint8Array || typeof o.signature === "string")); + }, + isSDK(o: any): o is ProposalSDKType { + return o && (o.$typeUrl === Proposal.typeUrl || isSet(o.type) && typeof o.height === "bigint" && typeof o.round === "number" && typeof o.pol_round === "number" && BlockID.isSDK(o.block_id) && Timestamp.isSDK(o.timestamp) && (o.signature instanceof Uint8Array || typeof o.signature === "string")); + }, + isAmino(o: any): o is ProposalAmino { + return o && (o.$typeUrl === Proposal.typeUrl || isSet(o.type) && typeof o.height === "bigint" && typeof o.round === "number" && typeof o.pol_round === "number" && BlockID.isAmino(o.block_id) && Timestamp.isAmino(o.timestamp) && (o.signature instanceof Uint8Array || typeof o.signature === "string")); + }, encode(message: Proposal, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.type !== 0) { writer.uint32(8).int32(message.type); @@ -1377,6 +1687,28 @@ export const Proposal = { } return message; }, + fromJSON(object: any): Proposal { + return { + type: isSet(object.type) ? signedMsgTypeFromJSON(object.type) : -1, + height: isSet(object.height) ? BigInt(object.height.toString()) : BigInt(0), + 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) ? new Date(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 || BigInt(0)).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; + }, fromPartial(object: Partial): Proposal { const message = createBaseProposal(); message.type = object.type ?? 0; @@ -1389,25 +1721,39 @@ export const Proposal = { return message; }, fromAmino(object: ProposalAmino): Proposal { - return { - type: isSet(object.type) ? signedMsgTypeFromJSON(object.type) : -1, - height: BigInt(object.height), - round: object.round, - polRound: object.pol_round, - blockId: object?.block_id ? BlockID.fromAmino(object.block_id) : undefined, - timestamp: object.timestamp, - signature: object.signature - }; + const message = createBaseProposal(); + if (object.type !== undefined && object.type !== null) { + message.type = signedMsgTypeFromJSON(object.type); + } + if (object.height !== undefined && object.height !== null) { + message.height = BigInt(object.height); + } + if (object.round !== undefined && object.round !== null) { + message.round = object.round; + } + if (object.pol_round !== undefined && object.pol_round !== null) { + message.polRound = object.pol_round; + } + if (object.block_id !== undefined && object.block_id !== null) { + message.blockId = BlockID.fromAmino(object.block_id); + } + if (object.timestamp !== undefined && object.timestamp !== null) { + message.timestamp = fromTimestamp(Timestamp.fromAmino(object.timestamp)); + } + if (object.signature !== undefined && object.signature !== null) { + message.signature = bytesFromBase64(object.signature); + } + return message; }, toAmino(message: Proposal): ProposalAmino { const obj: any = {}; - obj.type = message.type; + obj.type = signedMsgTypeToJSON(message.type); obj.height = message.height ? message.height.toString() : undefined; obj.round = message.round; obj.pol_round = message.polRound; obj.block_id = message.blockId ? BlockID.toAmino(message.blockId) : undefined; - obj.timestamp = message.timestamp; - obj.signature = message.signature; + obj.timestamp = message.timestamp ? Timestamp.toAmino(toTimestamp(message.timestamp)) : undefined; + obj.signature = message.signature ? base64FromBytes(message.signature) : undefined; return obj; }, fromAminoMsg(object: ProposalAminoMsg): Proposal { @@ -1426,14 +1772,24 @@ export const Proposal = { }; } }; +GlobalDecoderRegistry.register(Proposal.typeUrl, Proposal); function createBaseSignedHeader(): SignedHeader { return { - header: Header.fromPartial({}), - commit: Commit.fromPartial({}) + header: undefined, + commit: undefined }; } export const SignedHeader = { typeUrl: "/tendermint.types.SignedHeader", + is(o: any): o is SignedHeader { + return o && o.$typeUrl === SignedHeader.typeUrl; + }, + isSDK(o: any): o is SignedHeaderSDKType { + return o && o.$typeUrl === SignedHeader.typeUrl; + }, + isAmino(o: any): o is SignedHeaderAmino { + return o && o.$typeUrl === SignedHeader.typeUrl; + }, encode(message: SignedHeader, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.header !== undefined) { Header.encode(message.header, writer.uint32(10).fork()).ldelim(); @@ -1463,6 +1819,18 @@ export const SignedHeader = { } 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; + }, fromPartial(object: Partial): SignedHeader { const message = createBaseSignedHeader(); message.header = object.header !== undefined && object.header !== null ? Header.fromPartial(object.header) : undefined; @@ -1470,10 +1838,14 @@ export const SignedHeader = { return message; }, fromAmino(object: SignedHeaderAmino): SignedHeader { - return { - header: object?.header ? Header.fromAmino(object.header) : undefined, - commit: object?.commit ? Commit.fromAmino(object.commit) : undefined - }; + const message = createBaseSignedHeader(); + if (object.header !== undefined && object.header !== null) { + message.header = Header.fromAmino(object.header); + } + if (object.commit !== undefined && object.commit !== null) { + message.commit = Commit.fromAmino(object.commit); + } + return message; }, toAmino(message: SignedHeader): SignedHeaderAmino { const obj: any = {}; @@ -1497,14 +1869,24 @@ export const SignedHeader = { }; } }; +GlobalDecoderRegistry.register(SignedHeader.typeUrl, SignedHeader); function createBaseLightBlock(): LightBlock { return { - signedHeader: SignedHeader.fromPartial({}), - validatorSet: ValidatorSet.fromPartial({}) + signedHeader: undefined, + validatorSet: undefined }; } export const LightBlock = { typeUrl: "/tendermint.types.LightBlock", + is(o: any): o is LightBlock { + return o && o.$typeUrl === LightBlock.typeUrl; + }, + isSDK(o: any): o is LightBlockSDKType { + return o && o.$typeUrl === LightBlock.typeUrl; + }, + isAmino(o: any): o is LightBlockAmino { + return o && o.$typeUrl === LightBlock.typeUrl; + }, encode(message: LightBlock, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.signedHeader !== undefined) { SignedHeader.encode(message.signedHeader, writer.uint32(10).fork()).ldelim(); @@ -1534,6 +1916,18 @@ export const LightBlock = { } 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 + }; + }, + toJSON(message: LightBlock): unknown { + const obj: any = {}; + 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; + }, fromPartial(object: Partial): LightBlock { const message = createBaseLightBlock(); message.signedHeader = object.signedHeader !== undefined && object.signedHeader !== null ? SignedHeader.fromPartial(object.signedHeader) : undefined; @@ -1541,10 +1935,14 @@ export const LightBlock = { return message; }, fromAmino(object: LightBlockAmino): LightBlock { - return { - signedHeader: object?.signed_header ? SignedHeader.fromAmino(object.signed_header) : undefined, - validatorSet: object?.validator_set ? ValidatorSet.fromAmino(object.validator_set) : undefined - }; + const message = createBaseLightBlock(); + if (object.signed_header !== undefined && object.signed_header !== null) { + message.signedHeader = SignedHeader.fromAmino(object.signed_header); + } + if (object.validator_set !== undefined && object.validator_set !== null) { + message.validatorSet = ValidatorSet.fromAmino(object.validator_set); + } + return message; }, toAmino(message: LightBlock): LightBlockAmino { const obj: any = {}; @@ -1568,6 +1966,7 @@ export const LightBlock = { }; } }; +GlobalDecoderRegistry.register(LightBlock.typeUrl, LightBlock); function createBaseBlockMeta(): BlockMeta { return { blockId: BlockID.fromPartial({}), @@ -1578,6 +1977,15 @@ function createBaseBlockMeta(): BlockMeta { } export const BlockMeta = { typeUrl: "/tendermint.types.BlockMeta", + is(o: any): o is BlockMeta { + return o && (o.$typeUrl === BlockMeta.typeUrl || BlockID.is(o.blockId) && typeof o.blockSize === "bigint" && Header.is(o.header) && typeof o.numTxs === "bigint"); + }, + isSDK(o: any): o is BlockMetaSDKType { + return o && (o.$typeUrl === BlockMeta.typeUrl || BlockID.isSDK(o.block_id) && typeof o.block_size === "bigint" && Header.isSDK(o.header) && typeof o.num_txs === "bigint"); + }, + isAmino(o: any): o is BlockMetaAmino { + return o && (o.$typeUrl === BlockMeta.typeUrl || BlockID.isAmino(o.block_id) && typeof o.block_size === "bigint" && Header.isAmino(o.header) && typeof o.num_txs === "bigint"); + }, encode(message: BlockMeta, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.blockId !== undefined) { BlockID.encode(message.blockId, writer.uint32(10).fork()).ldelim(); @@ -1619,6 +2027,22 @@ export const BlockMeta = { } return message; }, + fromJSON(object: any): BlockMeta { + return { + blockId: isSet(object.blockId) ? BlockID.fromJSON(object.blockId) : undefined, + blockSize: isSet(object.blockSize) ? BigInt(object.blockSize.toString()) : BigInt(0), + header: isSet(object.header) ? Header.fromJSON(object.header) : undefined, + numTxs: isSet(object.numTxs) ? BigInt(object.numTxs.toString()) : BigInt(0) + }; + }, + 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 || BigInt(0)).toString()); + message.header !== undefined && (obj.header = message.header ? Header.toJSON(message.header) : undefined); + message.numTxs !== undefined && (obj.numTxs = (message.numTxs || BigInt(0)).toString()); + return obj; + }, fromPartial(object: Partial): BlockMeta { const message = createBaseBlockMeta(); message.blockId = object.blockId !== undefined && object.blockId !== null ? BlockID.fromPartial(object.blockId) : undefined; @@ -1628,12 +2052,20 @@ export const BlockMeta = { return message; }, fromAmino(object: BlockMetaAmino): BlockMeta { - return { - blockId: object?.block_id ? BlockID.fromAmino(object.block_id) : undefined, - blockSize: BigInt(object.block_size), - header: object?.header ? Header.fromAmino(object.header) : undefined, - numTxs: BigInt(object.num_txs) - }; + const message = createBaseBlockMeta(); + if (object.block_id !== undefined && object.block_id !== null) { + message.blockId = BlockID.fromAmino(object.block_id); + } + if (object.block_size !== undefined && object.block_size !== null) { + message.blockSize = BigInt(object.block_size); + } + if (object.header !== undefined && object.header !== null) { + message.header = Header.fromAmino(object.header); + } + if (object.num_txs !== undefined && object.num_txs !== null) { + message.numTxs = BigInt(object.num_txs); + } + return message; }, toAmino(message: BlockMeta): BlockMetaAmino { const obj: any = {}; @@ -1659,15 +2091,25 @@ export const BlockMeta = { }; } }; +GlobalDecoderRegistry.register(BlockMeta.typeUrl, BlockMeta); function createBaseTxProof(): TxProof { return { rootHash: new Uint8Array(), data: new Uint8Array(), - proof: Proof.fromPartial({}) + proof: undefined }; } export const TxProof = { typeUrl: "/tendermint.types.TxProof", + is(o: any): o is TxProof { + return o && (o.$typeUrl === TxProof.typeUrl || (o.rootHash instanceof Uint8Array || typeof o.rootHash === "string") && (o.data instanceof Uint8Array || typeof o.data === "string")); + }, + isSDK(o: any): o is TxProofSDKType { + return o && (o.$typeUrl === TxProof.typeUrl || (o.root_hash instanceof Uint8Array || typeof o.root_hash === "string") && (o.data instanceof Uint8Array || typeof o.data === "string")); + }, + isAmino(o: any): o is TxProofAmino { + return o && (o.$typeUrl === TxProof.typeUrl || (o.root_hash instanceof Uint8Array || typeof o.root_hash === "string") && (o.data instanceof Uint8Array || typeof o.data === "string")); + }, encode(message: TxProof, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.rootHash.length !== 0) { writer.uint32(10).bytes(message.rootHash); @@ -1703,6 +2145,20 @@ export const TxProof = { } return message; }, + fromJSON(object: any): TxProof { + return { + 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 = {}; + message.rootHash !== undefined && (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; + }, fromPartial(object: Partial): TxProof { const message = createBaseTxProof(); message.rootHash = object.rootHash ?? new Uint8Array(); @@ -1711,16 +2167,22 @@ export const TxProof = { return message; }, fromAmino(object: TxProofAmino): TxProof { - return { - rootHash: object.root_hash, - data: object.data, - proof: object?.proof ? Proof.fromAmino(object.proof) : undefined - }; + const message = createBaseTxProof(); + if (object.root_hash !== undefined && object.root_hash !== null) { + message.rootHash = bytesFromBase64(object.root_hash); + } + if (object.data !== undefined && object.data !== null) { + message.data = bytesFromBase64(object.data); + } + if (object.proof !== undefined && object.proof !== null) { + message.proof = Proof.fromAmino(object.proof); + } + return message; }, toAmino(message: TxProof): TxProofAmino { const obj: any = {}; - obj.root_hash = message.rootHash; - obj.data = message.data; + obj.root_hash = message.rootHash ? base64FromBytes(message.rootHash) : undefined; + obj.data = message.data ? base64FromBytes(message.data) : undefined; obj.proof = message.proof ? Proof.toAmino(message.proof) : undefined; return obj; }, @@ -1739,4 +2201,5 @@ export const TxProof = { value: TxProof.encode(message).finish() }; } -}; \ No newline at end of file +}; +GlobalDecoderRegistry.register(TxProof.typeUrl, TxProof); \ No newline at end of file diff --git a/packages/osmojs/src/codegen/tendermint/types/validator.ts b/packages/osmojs/src/codegen/tendermint/types/validator.ts index a8440bfee..4e770976c 100644 --- a/packages/osmojs/src/codegen/tendermint/types/validator.ts +++ b/packages/osmojs/src/codegen/tendermint/types/validator.ts @@ -1,8 +1,10 @@ import { PublicKey, PublicKeyAmino, PublicKeySDKType } from "../crypto/keys"; import { BinaryReader, BinaryWriter } from "../../binary"; +import { isSet, bytesFromBase64, base64FromBytes } from "../../helpers"; +import { GlobalDecoderRegistry } from "../../registry"; export interface ValidatorSet { validators: Validator[]; - proposer: Validator; + proposer?: Validator; totalVotingPower: bigint; } export interface ValidatorSetProtoMsg { @@ -10,9 +12,9 @@ export interface ValidatorSetProtoMsg { value: Uint8Array; } export interface ValidatorSetAmino { - validators: ValidatorAmino[]; + validators?: ValidatorAmino[]; proposer?: ValidatorAmino; - total_voting_power: string; + total_voting_power?: string; } export interface ValidatorSetAminoMsg { type: "/tendermint.types.ValidatorSet"; @@ -20,7 +22,7 @@ export interface ValidatorSetAminoMsg { } export interface ValidatorSetSDKType { validators: ValidatorSDKType[]; - proposer: ValidatorSDKType; + proposer?: ValidatorSDKType; total_voting_power: bigint; } export interface Validator { @@ -34,10 +36,10 @@ export interface ValidatorProtoMsg { value: Uint8Array; } export interface ValidatorAmino { - address: Uint8Array; + address?: string; pub_key?: PublicKeyAmino; - voting_power: string; - proposer_priority: string; + voting_power?: string; + proposer_priority?: string; } export interface ValidatorAminoMsg { type: "/tendermint.types.Validator"; @@ -50,7 +52,7 @@ export interface ValidatorSDKType { proposer_priority: bigint; } export interface SimpleValidator { - pubKey: PublicKey; + pubKey?: PublicKey; votingPower: bigint; } export interface SimpleValidatorProtoMsg { @@ -59,25 +61,34 @@ export interface SimpleValidatorProtoMsg { } export interface SimpleValidatorAmino { pub_key?: PublicKeyAmino; - voting_power: string; + voting_power?: string; } export interface SimpleValidatorAminoMsg { type: "/tendermint.types.SimpleValidator"; value: SimpleValidatorAmino; } export interface SimpleValidatorSDKType { - pub_key: PublicKeySDKType; + pub_key?: PublicKeySDKType; voting_power: bigint; } function createBaseValidatorSet(): ValidatorSet { return { validators: [], - proposer: Validator.fromPartial({}), + proposer: undefined, totalVotingPower: BigInt(0) }; } export const ValidatorSet = { typeUrl: "/tendermint.types.ValidatorSet", + is(o: any): o is ValidatorSet { + return o && (o.$typeUrl === ValidatorSet.typeUrl || Array.isArray(o.validators) && (!o.validators.length || Validator.is(o.validators[0])) && typeof o.totalVotingPower === "bigint"); + }, + isSDK(o: any): o is ValidatorSetSDKType { + return o && (o.$typeUrl === ValidatorSet.typeUrl || Array.isArray(o.validators) && (!o.validators.length || Validator.isSDK(o.validators[0])) && typeof o.total_voting_power === "bigint"); + }, + isAmino(o: any): o is ValidatorSetAmino { + return o && (o.$typeUrl === ValidatorSet.typeUrl || Array.isArray(o.validators) && (!o.validators.length || Validator.isAmino(o.validators[0])) && typeof o.total_voting_power === "bigint"); + }, encode(message: ValidatorSet, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.validators) { Validator.encode(v!, writer.uint32(10).fork()).ldelim(); @@ -113,6 +124,24 @@ export const ValidatorSet = { } 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) ? BigInt(object.totalVotingPower.toString()) : BigInt(0) + }; + }, + toJSON(message: ValidatorSet): unknown { + const obj: any = {}; + if (message.validators) { + obj.validators = message.validators.map(e => e ? Validator.toJSON(e) : undefined); + } else { + obj.validators = []; + } + message.proposer !== undefined && (obj.proposer = message.proposer ? Validator.toJSON(message.proposer) : undefined); + message.totalVotingPower !== undefined && (obj.totalVotingPower = (message.totalVotingPower || BigInt(0)).toString()); + return obj; + }, fromPartial(object: Partial): ValidatorSet { const message = createBaseValidatorSet(); message.validators = object.validators?.map(e => Validator.fromPartial(e)) || []; @@ -121,11 +150,15 @@ export const ValidatorSet = { return message; }, fromAmino(object: ValidatorSetAmino): ValidatorSet { - return { - validators: Array.isArray(object?.validators) ? object.validators.map((e: any) => Validator.fromAmino(e)) : [], - proposer: object?.proposer ? Validator.fromAmino(object.proposer) : undefined, - totalVotingPower: BigInt(object.total_voting_power) - }; + const message = createBaseValidatorSet(); + message.validators = object.validators?.map(e => Validator.fromAmino(e)) || []; + if (object.proposer !== undefined && object.proposer !== null) { + message.proposer = Validator.fromAmino(object.proposer); + } + if (object.total_voting_power !== undefined && object.total_voting_power !== null) { + message.totalVotingPower = BigInt(object.total_voting_power); + } + return message; }, toAmino(message: ValidatorSet): ValidatorSetAmino { const obj: any = {}; @@ -154,6 +187,7 @@ export const ValidatorSet = { }; } }; +GlobalDecoderRegistry.register(ValidatorSet.typeUrl, ValidatorSet); function createBaseValidator(): Validator { return { address: new Uint8Array(), @@ -164,6 +198,15 @@ function createBaseValidator(): Validator { } export const Validator = { typeUrl: "/tendermint.types.Validator", + is(o: any): o is Validator { + return o && (o.$typeUrl === Validator.typeUrl || (o.address instanceof Uint8Array || typeof o.address === "string") && PublicKey.is(o.pubKey) && typeof o.votingPower === "bigint" && typeof o.proposerPriority === "bigint"); + }, + isSDK(o: any): o is ValidatorSDKType { + return o && (o.$typeUrl === Validator.typeUrl || (o.address instanceof Uint8Array || typeof o.address === "string") && PublicKey.isSDK(o.pub_key) && typeof o.voting_power === "bigint" && typeof o.proposer_priority === "bigint"); + }, + isAmino(o: any): o is ValidatorAmino { + return o && (o.$typeUrl === Validator.typeUrl || (o.address instanceof Uint8Array || typeof o.address === "string") && PublicKey.isAmino(o.pub_key) && typeof o.voting_power === "bigint" && typeof o.proposer_priority === "bigint"); + }, encode(message: Validator, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.address.length !== 0) { writer.uint32(10).bytes(message.address); @@ -205,6 +248,22 @@ export const Validator = { } return message; }, + fromJSON(object: any): Validator { + return { + address: isSet(object.address) ? bytesFromBase64(object.address) : new Uint8Array(), + pubKey: isSet(object.pubKey) ? PublicKey.fromJSON(object.pubKey) : undefined, + votingPower: isSet(object.votingPower) ? BigInt(object.votingPower.toString()) : BigInt(0), + proposerPriority: isSet(object.proposerPriority) ? BigInt(object.proposerPriority.toString()) : BigInt(0) + }; + }, + toJSON(message: Validator): unknown { + 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 || BigInt(0)).toString()); + message.proposerPriority !== undefined && (obj.proposerPriority = (message.proposerPriority || BigInt(0)).toString()); + return obj; + }, fromPartial(object: Partial): Validator { const message = createBaseValidator(); message.address = object.address ?? new Uint8Array(); @@ -214,16 +273,24 @@ export const Validator = { return message; }, fromAmino(object: ValidatorAmino): Validator { - return { - address: object.address, - pubKey: object?.pub_key ? PublicKey.fromAmino(object.pub_key) : undefined, - votingPower: BigInt(object.voting_power), - proposerPriority: BigInt(object.proposer_priority) - }; + const message = createBaseValidator(); + if (object.address !== undefined && object.address !== null) { + message.address = bytesFromBase64(object.address); + } + if (object.pub_key !== undefined && object.pub_key !== null) { + message.pubKey = PublicKey.fromAmino(object.pub_key); + } + if (object.voting_power !== undefined && object.voting_power !== null) { + message.votingPower = BigInt(object.voting_power); + } + if (object.proposer_priority !== undefined && object.proposer_priority !== null) { + message.proposerPriority = BigInt(object.proposer_priority); + } + return message; }, toAmino(message: Validator): ValidatorAmino { const obj: any = {}; - obj.address = message.address; + obj.address = message.address ? base64FromBytes(message.address) : undefined; obj.pub_key = message.pubKey ? PublicKey.toAmino(message.pubKey) : undefined; obj.voting_power = message.votingPower ? message.votingPower.toString() : undefined; obj.proposer_priority = message.proposerPriority ? message.proposerPriority.toString() : undefined; @@ -245,14 +312,24 @@ export const Validator = { }; } }; +GlobalDecoderRegistry.register(Validator.typeUrl, Validator); function createBaseSimpleValidator(): SimpleValidator { return { - pubKey: PublicKey.fromPartial({}), + pubKey: undefined, votingPower: BigInt(0) }; } export const SimpleValidator = { typeUrl: "/tendermint.types.SimpleValidator", + is(o: any): o is SimpleValidator { + return o && (o.$typeUrl === SimpleValidator.typeUrl || typeof o.votingPower === "bigint"); + }, + isSDK(o: any): o is SimpleValidatorSDKType { + return o && (o.$typeUrl === SimpleValidator.typeUrl || typeof o.voting_power === "bigint"); + }, + isAmino(o: any): o is SimpleValidatorAmino { + return o && (o.$typeUrl === SimpleValidator.typeUrl || typeof o.voting_power === "bigint"); + }, encode(message: SimpleValidator, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.pubKey !== undefined) { PublicKey.encode(message.pubKey, writer.uint32(10).fork()).ldelim(); @@ -282,6 +359,18 @@ export const SimpleValidator = { } return message; }, + fromJSON(object: any): SimpleValidator { + return { + pubKey: isSet(object.pubKey) ? PublicKey.fromJSON(object.pubKey) : undefined, + votingPower: isSet(object.votingPower) ? BigInt(object.votingPower.toString()) : BigInt(0) + }; + }, + 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 || BigInt(0)).toString()); + return obj; + }, fromPartial(object: Partial): SimpleValidator { const message = createBaseSimpleValidator(); message.pubKey = object.pubKey !== undefined && object.pubKey !== null ? PublicKey.fromPartial(object.pubKey) : undefined; @@ -289,10 +378,14 @@ export const SimpleValidator = { return message; }, fromAmino(object: SimpleValidatorAmino): SimpleValidator { - return { - pubKey: object?.pub_key ? PublicKey.fromAmino(object.pub_key) : undefined, - votingPower: BigInt(object.voting_power) - }; + const message = createBaseSimpleValidator(); + if (object.pub_key !== undefined && object.pub_key !== null) { + message.pubKey = PublicKey.fromAmino(object.pub_key); + } + if (object.voting_power !== undefined && object.voting_power !== null) { + message.votingPower = BigInt(object.voting_power); + } + return message; }, toAmino(message: SimpleValidator): SimpleValidatorAmino { const obj: any = {}; @@ -315,4 +408,5 @@ export const SimpleValidator = { value: SimpleValidator.encode(message).finish() }; } -}; \ No newline at end of file +}; +GlobalDecoderRegistry.register(SimpleValidator.typeUrl, SimpleValidator); \ No newline at end of file diff --git a/packages/osmojs/src/codegen/tendermint/version/types.ts b/packages/osmojs/src/codegen/tendermint/version/types.ts index d771dbbb5..4ef09bec1 100644 --- a/packages/osmojs/src/codegen/tendermint/version/types.ts +++ b/packages/osmojs/src/codegen/tendermint/version/types.ts @@ -1,4 +1,6 @@ import { BinaryReader, BinaryWriter } from "../../binary"; +import { isSet } from "../../helpers"; +import { GlobalDecoderRegistry } from "../../registry"; /** * App includes the protocol and software version for the application. * This information is included in ResponseInfo. The App.Protocol can be @@ -18,8 +20,8 @@ export interface AppProtoMsg { * updated in ResponseEndBlock. */ export interface AppAmino { - protocol: string; - software: string; + protocol?: string; + software?: string; } export interface AppAminoMsg { type: "/tendermint.version.App"; @@ -53,8 +55,8 @@ export interface ConsensusProtoMsg { * state transition machine. */ export interface ConsensusAmino { - block: string; - app: string; + block?: string; + app?: string; } export interface ConsensusAminoMsg { type: "/tendermint.version.Consensus"; @@ -77,6 +79,15 @@ function createBaseApp(): App { } export const App = { typeUrl: "/tendermint.version.App", + is(o: any): o is App { + return o && (o.$typeUrl === App.typeUrl || typeof o.protocol === "bigint" && typeof o.software === "string"); + }, + isSDK(o: any): o is AppSDKType { + return o && (o.$typeUrl === App.typeUrl || typeof o.protocol === "bigint" && typeof o.software === "string"); + }, + isAmino(o: any): o is AppAmino { + return o && (o.$typeUrl === App.typeUrl || typeof o.protocol === "bigint" && typeof o.software === "string"); + }, encode(message: App, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.protocol !== BigInt(0)) { writer.uint32(8).uint64(message.protocol); @@ -106,6 +117,18 @@ export const App = { } return message; }, + fromJSON(object: any): App { + return { + protocol: isSet(object.protocol) ? BigInt(object.protocol.toString()) : BigInt(0), + software: isSet(object.software) ? String(object.software) : "" + }; + }, + toJSON(message: App): unknown { + const obj: any = {}; + message.protocol !== undefined && (obj.protocol = (message.protocol || BigInt(0)).toString()); + message.software !== undefined && (obj.software = message.software); + return obj; + }, fromPartial(object: Partial): App { const message = createBaseApp(); message.protocol = object.protocol !== undefined && object.protocol !== null ? BigInt(object.protocol.toString()) : BigInt(0); @@ -113,10 +136,14 @@ export const App = { return message; }, fromAmino(object: AppAmino): App { - return { - protocol: BigInt(object.protocol), - software: object.software - }; + const message = createBaseApp(); + if (object.protocol !== undefined && object.protocol !== null) { + message.protocol = BigInt(object.protocol); + } + if (object.software !== undefined && object.software !== null) { + message.software = object.software; + } + return message; }, toAmino(message: App): AppAmino { const obj: any = {}; @@ -140,6 +167,7 @@ export const App = { }; } }; +GlobalDecoderRegistry.register(App.typeUrl, App); function createBaseConsensus(): Consensus { return { block: BigInt(0), @@ -148,6 +176,15 @@ function createBaseConsensus(): Consensus { } export const Consensus = { typeUrl: "/tendermint.version.Consensus", + is(o: any): o is Consensus { + return o && (o.$typeUrl === Consensus.typeUrl || typeof o.block === "bigint" && typeof o.app === "bigint"); + }, + isSDK(o: any): o is ConsensusSDKType { + return o && (o.$typeUrl === Consensus.typeUrl || typeof o.block === "bigint" && typeof o.app === "bigint"); + }, + isAmino(o: any): o is ConsensusAmino { + return o && (o.$typeUrl === Consensus.typeUrl || typeof o.block === "bigint" && typeof o.app === "bigint"); + }, encode(message: Consensus, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.block !== BigInt(0)) { writer.uint32(8).uint64(message.block); @@ -177,6 +214,18 @@ export const Consensus = { } return message; }, + fromJSON(object: any): Consensus { + return { + block: isSet(object.block) ? BigInt(object.block.toString()) : BigInt(0), + app: isSet(object.app) ? BigInt(object.app.toString()) : BigInt(0) + }; + }, + toJSON(message: Consensus): unknown { + const obj: any = {}; + message.block !== undefined && (obj.block = (message.block || BigInt(0)).toString()); + message.app !== undefined && (obj.app = (message.app || BigInt(0)).toString()); + return obj; + }, fromPartial(object: Partial): Consensus { const message = createBaseConsensus(); message.block = object.block !== undefined && object.block !== null ? BigInt(object.block.toString()) : BigInt(0); @@ -184,10 +233,14 @@ export const Consensus = { return message; }, fromAmino(object: ConsensusAmino): Consensus { - return { - block: BigInt(object.block), - app: BigInt(object.app) - }; + const message = createBaseConsensus(); + if (object.block !== undefined && object.block !== null) { + message.block = BigInt(object.block); + } + if (object.app !== undefined && object.app !== null) { + message.app = BigInt(object.app); + } + return message; }, toAmino(message: Consensus): ConsensusAmino { const obj: any = {}; @@ -210,4 +263,5 @@ export const Consensus = { value: Consensus.encode(message).finish() }; } -}; \ No newline at end of file +}; +GlobalDecoderRegistry.register(Consensus.typeUrl, Consensus); \ No newline at end of file diff --git a/packages/osmojs/src/codegen/types.ts b/packages/osmojs/src/codegen/types.ts new file mode 100644 index 000000000..6840c4ef8 --- /dev/null +++ b/packages/osmojs/src/codegen/types.ts @@ -0,0 +1,154 @@ +/** +* This file and any referenced files were automatically generated by @cosmology/telescope@1.4.1 +* DO NOT MODIFY BY HAND. Instead, download the latest proto files for your chain +* and run the transpile command or yarn proto command to regenerate this bundle. +*/ + +import { IBinaryReader, IBinaryWriter } from "./binary"; +import { Any } from "./google/protobuf/any"; +import { OfflineSigner } from "@cosmjs/proto-signing"; +import { HttpEndpoint } from "@cosmjs/tendermint-rpc"; + +export type ProtoMsg = Omit & { typeUrl: any }; + +export interface IAminoMsg { + type: any; + value: Amino; +} + +export interface IProtoType { + $typeUrl?: any; +} + +/** + * A type generated by Telescope 1.0. + */ +export interface TelescopeGeneratedCodec< + T = unknown, + SDK = unknown, + Amino = unknown +> { + readonly typeUrl: string; + readonly aminoType?: string; + is?(o: unknown): o is T; + isSDK?(o: unknown): o is SDK; + isAmino?(o: unknown): o is Amino; + encode: (message: T, writer?: IBinaryWriter | any) => IBinaryWriter | any; + decode: (input: IBinaryReader | Uint8Array | any, length?: number) => T; + fromPartial: (object: any) => T | any; + fromJSON: (object: any) => T | any; + toJSON: (message: T | any) => any; + fromSDK?: (sdk: SDK) => T; + fromSDKJSON?: (object: any) => SDK; + toSDK?: (message: T) => SDK; + fromAmino?: (amino: Amino) => T; + toAmino?: (message: T) => Amino; + fromAminoMsg?: (aminoMsg: IAminoMsg) => T; + toAminoMsg?: (message: T) => IAminoMsg; + toProto?: (message: T) => Uint8Array; + fromProtoMsg?: (message: ProtoMsg) => T; + toProtoMsg?: (message: T) => Any; +} + +export type TelescopeGeneratedType< + T = unknown, + SDK = unknown, + Amino = unknown +> = TelescopeGeneratedCodec; + +export type GeneratedType = TelescopeGeneratedCodec; + +/** + * Coin defines a token with a denomination and an amount. + * + * NOTE: The amount field is an Int which implements the custom method + * signatures required by gogoproto. + */ +export interface Coin { + denom: string; + amount: string; +} + +export type EncodeObject = Message; + +export interface Message { + typeUrl: string; + value: T; +} + +export interface StdFee { + amount: Coin[]; + gas: string; + /** The granter address that is used for paying with feegrants */ + granter?: string; + /** The fee payer address. The payer must have signed the transaction. */ + payer?: string; +} + +export interface MsgData { + msgType: string; + data: Uint8Array; +} + +export interface Attribute { + key: string; + value: string; +} +export interface Event { + type: string; + attributes: Attribute[]; +} + +/** + * The response after successfully broadcasting a transaction. + * Success or failure refer to the execution result. + */ +export interface DeliverTxResponse { + height: number; + /** The position of the transaction within the block. This is a 0-based index. */ + txIndex: number; + /** Error code. The transaction suceeded if and only if code is 0. */ + code: number; + transactionHash: string; + events: Event[]; + /** + * A string-based log document. + * + * This currently seems to merge attributes of multiple events into one event per type + * (https://github.com/tendermint/tendermint/issues/9595). You might want to use the `events` + * field instead. + */ + rawLog?: string; + /** @deprecated Use `msgResponses` instead. */ + data?: MsgData[]; + /** + * The message responses of the [TxMsgData](https://github.com/cosmos/cosmos-sdk/blob/v0.46.3/proto/cosmos/base/abci/v1beta1/abci.proto#L128-L140) + * as `Any`s. + * This field is an empty list for chains running Cosmos SDK < 0.46. + */ + msgResponses: Array<{ + typeUrl: string; + value: Uint8Array; + }>; + gasUsed: bigint; + gasWanted: bigint; +} + +export interface TxRpc { + request( + service: string, + method: string, + data: Uint8Array + ): Promise; + signAndBroadcast?( + signerAddress: string, + messages: EncodeObject[], + fee: StdFee | "auto" | number, + memo: string + ): Promise; +} + +export interface SigningClientParams { + rpcEndpoint: string | HttpEndpoint; + signer: OfflineSigner; +} diff --git a/packages/osmojs/src/codegen/utf8.ts b/packages/osmojs/src/codegen/utf8.ts index ca050352b..020361f7b 100644 --- a/packages/osmojs/src/codegen/utf8.ts +++ b/packages/osmojs/src/codegen/utf8.ts @@ -1,5 +1,5 @@ /** -* This file and any referenced files were automatically generated by @cosmology/telescope@0.99.12 +* This file and any referenced files were automatically generated by @cosmology/telescope@1.4.1 * DO NOT MODIFY BY HAND. Instead, download the latest proto files for your chain * and run the transpile command or yarn proto command to regenerate this bundle. */ @@ -72,7 +72,7 @@ export function utf8Read( const len = end - start; if (len < 1) return ""; const chunk = []; - let parts = null, + let parts: string[] = [], i = 0, // char offset t; // temporary while (start < end) { diff --git a/packages/osmojs/src/codegen/varint.ts b/packages/osmojs/src/codegen/varint.ts index c8ba965c6..78922d41b 100644 --- a/packages/osmojs/src/codegen/varint.ts +++ b/packages/osmojs/src/codegen/varint.ts @@ -1,5 +1,5 @@ /** -* This file and any referenced files were automatically generated by @cosmology/telescope@0.99.12 +* This file and any referenced files were automatically generated by @cosmology/telescope@1.4.1 * DO NOT MODIFY BY HAND. Instead, download the latest proto files for your chain * and run the transpile command or yarn proto command to regenerate this bundle. */ @@ -454,18 +454,18 @@ export function int64Length(lo: number, hi: number) { ? 1 : 2 : part0 < 2097152 - ? 3 - : 4 + ? 3 + : 4 : part1 < 16384 - ? part1 < 128 - ? 5 - : 6 - : part1 < 2097152 - ? 7 - : 8 + ? part1 < 128 + ? 5 + : 6 + : part1 < 2097152 + ? 7 + : 8 : part2 < 128 - ? 9 - : 10; + ? 9 + : 10; } export function writeFixed32( diff --git a/packages/osmojs/wasmd b/packages/osmojs/wasmd index bc0e81791..19d18265e 160000 --- a/packages/osmojs/wasmd +++ b/packages/osmojs/wasmd @@ -1 +1 @@ -Subproject commit bc0e8179129a82dba4b9205c63e002c71cbb4edd +Subproject commit 19d18265ecd143fb4cfbd0b87d69d25aec458db5 diff --git a/yarn.lock b/yarn.lock index 9ca3afb96..ae85cf538 100644 --- a/yarn.lock +++ b/yarn.lock @@ -31,7 +31,7 @@ "@nicolo-ribaudo/chokidar-2" "2.1.8-no-fsevents.3" chokidar "^3.4.0" -"@babel/code-frame@^7.0.0", "@babel/code-frame@^7.12.13", "@babel/code-frame@^7.18.6", "@babel/code-frame@^7.21.4", "@babel/code-frame@^7.22.13", "@babel/code-frame@^7.22.5", "@babel/code-frame@^7.23.5": +"@babel/code-frame@^7.0.0", "@babel/code-frame@^7.12.13", "@babel/code-frame@^7.18.6", "@babel/code-frame@^7.22.13", "@babel/code-frame@^7.22.5", "@babel/code-frame@^7.23.5": version "7.23.5" resolved "https://registry.npmmirror.com/@babel/code-frame/-/code-frame-7.23.5.tgz#9009b69a8c602293476ad598ff53e4562e15c244" integrity sha512-CgH3s1a96LipHCmSUmYFPwY7MNx8C3avkq7i4Wl3cfa662ldtUe4VM1TPXX70pfmrlWTb6jLqTYrZyT2ZTJBgA== @@ -39,7 +39,7 @@ "@babel/highlight" "^7.23.4" chalk "^2.4.2" -"@babel/compat-data@^7.17.7", "@babel/compat-data@^7.18.8", "@babel/compat-data@^7.20.5", "@babel/compat-data@^7.21.4", "@babel/compat-data@^7.22.6", "@babel/compat-data@^7.22.9", "@babel/compat-data@^7.23.3", "@babel/compat-data@^7.23.5": +"@babel/compat-data@^7.17.7", "@babel/compat-data@^7.18.8", "@babel/compat-data@^7.20.5", "@babel/compat-data@^7.22.6", "@babel/compat-data@^7.22.9", "@babel/compat-data@^7.23.3", "@babel/compat-data@^7.23.5": version "7.23.5" resolved "https://registry.npmmirror.com/@babel/compat-data/-/compat-data-7.23.5.tgz#ffb878728bb6bdcb6f4510aa51b1be9afb8cfd98" integrity sha512-uU27kfDRlhfKl+w1U6vp16IuvSLtjAxdArVXPa9BvLkrr7CYIsxH5adpHObeAGY/41+syctUWOZ140a2Rvkgjw== @@ -65,27 +65,6 @@ json5 "^2.2.1" semver "^6.3.0" -"@babel/core@7.21.4": - version "7.21.4" - resolved "https://registry.npmmirror.com/@babel/core/-/core-7.21.4.tgz#c6dc73242507b8e2a27fd13a9c1814f9fa34a659" - integrity sha512-qt/YV149Jman/6AfmlxJ04LMIu8bMoyl3RB91yTFrxQmgbrSvQMy7cI8Q62FHx1t8wJ8B5fu0UDoLwHAhUo1QA== - dependencies: - "@ampproject/remapping" "^2.2.0" - "@babel/code-frame" "^7.21.4" - "@babel/generator" "^7.21.4" - "@babel/helper-compilation-targets" "^7.21.4" - "@babel/helper-module-transforms" "^7.21.2" - "@babel/helpers" "^7.21.0" - "@babel/parser" "^7.21.4" - "@babel/template" "^7.20.7" - "@babel/traverse" "^7.21.4" - "@babel/types" "^7.21.4" - convert-source-map "^1.7.0" - debug "^4.1.0" - gensync "^1.0.0-beta.2" - json5 "^2.2.2" - semver "^6.3.0" - "@babel/core@7.22.9": version "7.22.9" resolved "https://registry.npmmirror.com/@babel/core/-/core-7.22.9.tgz#bd96492c68822198f33e8a256061da3cf391f58f" @@ -146,16 +125,6 @@ "@jridgewell/gen-mapping" "^0.3.2" jsesc "^2.5.1" -"@babel/generator@7.21.4": - version "7.21.4" - resolved "https://registry.npmmirror.com/@babel/generator/-/generator-7.21.4.tgz#64a94b7448989f421f919d5239ef553b37bb26bc" - integrity sha512-NieM3pVIYW2SwGzKoqfPrQsf4xGs9M9AIG3ThppsSRmO+m7eQhmI6amajKMUeIO37wFfsvnvcxQFx6x6iqxDnA== - dependencies: - "@babel/types" "^7.21.4" - "@jridgewell/gen-mapping" "^0.3.2" - "@jridgewell/trace-mapping" "^0.3.17" - jsesc "^2.5.1" - "@babel/generator@7.22.9": version "7.22.9" resolved "https://registry.npmmirror.com/@babel/generator/-/generator-7.22.9.tgz#572ecfa7a31002fa1de2a9d91621fd895da8493d" @@ -166,7 +135,7 @@ "@jridgewell/trace-mapping" "^0.3.17" jsesc "^2.5.1" -"@babel/generator@^7.18.10", "@babel/generator@^7.21.4", "@babel/generator@^7.22.7", "@babel/generator@^7.22.9", "@babel/generator@^7.23.6", "@babel/generator@^7.7.2": +"@babel/generator@^7.18.10", "@babel/generator@^7.22.7", "@babel/generator@^7.22.9", "@babel/generator@^7.23.6", "@babel/generator@^7.7.2": version "7.23.6" resolved "https://registry.npmmirror.com/@babel/generator/-/generator-7.23.6.tgz#9e1fca4811c77a10580d17d26b57b036133f3c2e" integrity sha512-qrSfCYxYQB5owCmGLbl8XRpX1ytXlpueOb0N0UmQwA073KZxejgQTzAmJezxvpwQD9uGtK2shHdi55QT+MbjIw== @@ -190,7 +159,7 @@ dependencies: "@babel/types" "^7.22.15" -"@babel/helper-compilation-targets@^7.17.7", "@babel/helper-compilation-targets@^7.18.9", "@babel/helper-compilation-targets@^7.20.7", "@babel/helper-compilation-targets@^7.21.4", "@babel/helper-compilation-targets@^7.22.15", "@babel/helper-compilation-targets@^7.22.6", "@babel/helper-compilation-targets@^7.22.9", "@babel/helper-compilation-targets@^7.23.6": +"@babel/helper-compilation-targets@^7.17.7", "@babel/helper-compilation-targets@^7.18.9", "@babel/helper-compilation-targets@^7.20.7", "@babel/helper-compilation-targets@^7.22.15", "@babel/helper-compilation-targets@^7.22.6", "@babel/helper-compilation-targets@^7.22.9", "@babel/helper-compilation-targets@^7.23.6": version "7.23.6" resolved "https://registry.npmmirror.com/@babel/helper-compilation-targets/-/helper-compilation-targets-7.23.6.tgz#4d79069b16cbcf1461289eccfbbd81501ae39991" integrity sha512-9JB548GZoQVmzrFgp8o7KxdgkTGm6xs9DW0o/Pim72UDjzr5ObUQ6ZzYPqA+g9OTS2bBQoctLJrky0RDCAWRgQ== @@ -253,7 +222,7 @@ resolved "https://registry.npmmirror.com/@babel/helper-environment-visitor/-/helper-environment-visitor-7.22.20.tgz#96159db61d34a29dba454c959f5ae4a649ba9167" integrity sha512-zfedSIzFhat/gFhWfHtgWvlec0nqB9YEIVrpuwjruLlXfUSnA8cJB0miHKwqDnQ7d32aKo2xt88/xZptwxbfhA== -"@babel/helper-function-name@^7.18.9", "@babel/helper-function-name@^7.21.0", "@babel/helper-function-name@^7.22.5", "@babel/helper-function-name@^7.23.0": +"@babel/helper-function-name@^7.18.9", "@babel/helper-function-name@^7.22.5", "@babel/helper-function-name@^7.23.0": version "7.23.0" resolved "https://registry.npmmirror.com/@babel/helper-function-name/-/helper-function-name-7.23.0.tgz#1f9a3cdbd5b2698a670c30d2735f9af95ed52759" integrity sha512-OErEqsrxjZTJciZ4Oo+eoZqeW9UIiOcuYKRJA4ZAgV9myA+pOXhhmpfNCKjEH/auVfEYVFJ6y1Tc4r0eIApqiw== @@ -275,14 +244,14 @@ dependencies: "@babel/types" "^7.23.0" -"@babel/helper-module-imports@^7.18.6", "@babel/helper-module-imports@^7.21.4", "@babel/helper-module-imports@^7.22.15", "@babel/helper-module-imports@^7.22.5": +"@babel/helper-module-imports@^7.18.6", "@babel/helper-module-imports@^7.22.15", "@babel/helper-module-imports@^7.22.5": version "7.22.15" resolved "https://registry.npmmirror.com/@babel/helper-module-imports/-/helper-module-imports-7.22.15.tgz#16146307acdc40cc00c3b2c647713076464bdbf0" integrity sha512-0pYVBnDKZO2fnSPCrgM/6WMc7eS20Fbok+0r88fp+YtWVLZrp4CkafFGIp+W0VKw4a22sgebPT99y+FDNMdP4w== dependencies: "@babel/types" "^7.22.15" -"@babel/helper-module-transforms@^7.18.9", "@babel/helper-module-transforms@^7.21.2", "@babel/helper-module-transforms@^7.22.9", "@babel/helper-module-transforms@^7.23.3": +"@babel/helper-module-transforms@^7.18.9", "@babel/helper-module-transforms@^7.22.9", "@babel/helper-module-transforms@^7.23.3": version "7.23.3" resolved "https://registry.npmmirror.com/@babel/helper-module-transforms/-/helper-module-transforms-7.23.3.tgz#d7d12c3c5d30af5b3c0fcab2a6d5217773e2d0f1" integrity sha512-7bBs4ED9OmswdfDzpz4MpWgSrV7FXlc3zIagvLFjS5H+Mk7Snr21vQ6QwrsoCGMfNC4e4LQPdoULEt4ykz0SRQ== @@ -344,17 +313,17 @@ dependencies: "@babel/types" "^7.22.5" -"@babel/helper-string-parser@^7.18.10", "@babel/helper-string-parser@^7.19.4", "@babel/helper-string-parser@^7.22.5", "@babel/helper-string-parser@^7.23.4": +"@babel/helper-string-parser@^7.18.10", "@babel/helper-string-parser@^7.22.5", "@babel/helper-string-parser@^7.23.4": version "7.23.4" resolved "https://registry.npmmirror.com/@babel/helper-string-parser/-/helper-string-parser-7.23.4.tgz#9478c707febcbbe1ddb38a3d91a2e054ae622d83" integrity sha512-803gmbQdqwdf4olxrX4AJyFBV/RTr3rSmOj0rKwesmzlfhYNDEs+/iOcznzpNWlJlIlTJC2QfPFcHB6DlzdVLQ== -"@babel/helper-validator-identifier@^7.18.6", "@babel/helper-validator-identifier@^7.19.1", "@babel/helper-validator-identifier@^7.22.20", "@babel/helper-validator-identifier@^7.22.5": +"@babel/helper-validator-identifier@^7.18.6", "@babel/helper-validator-identifier@^7.22.20", "@babel/helper-validator-identifier@^7.22.5": version "7.22.20" resolved "https://registry.npmmirror.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.22.20.tgz#c4ae002c61d2879e724581d96665583dbc1dc0e0" integrity sha512-Y4OZ+ytlatR8AI+8KZfKuL5urKp7qey08ha31L8b3BwewJAoJamTzyvxPR/5D+KkdJCGPq/+8TukHBlY10FX9A== -"@babel/helper-validator-option@^7.18.6", "@babel/helper-validator-option@^7.21.0", "@babel/helper-validator-option@^7.22.15", "@babel/helper-validator-option@^7.22.5", "@babel/helper-validator-option@^7.23.5": +"@babel/helper-validator-option@^7.18.6", "@babel/helper-validator-option@^7.22.15", "@babel/helper-validator-option@^7.22.5", "@babel/helper-validator-option@^7.23.5": version "7.23.5" resolved "https://registry.npmmirror.com/@babel/helper-validator-option/-/helper-validator-option-7.23.5.tgz#907a3fbd4523426285365d1206c423c4c5520307" integrity sha512-85ttAOMLsr53VgXkTbkx8oA6YTfT4q7/HzXSLEYmjcSTJPMPQtvq1BD79Byep5xMUYbGRzEpDsjUf3dyp54IKw== @@ -368,7 +337,7 @@ "@babel/template" "^7.22.15" "@babel/types" "^7.22.19" -"@babel/helpers@^7.18.9", "@babel/helpers@^7.21.0", "@babel/helpers@^7.22.6", "@babel/helpers@^7.23.7": +"@babel/helpers@^7.18.9", "@babel/helpers@^7.22.6", "@babel/helpers@^7.23.7": version "7.23.7" resolved "https://registry.npmmirror.com/@babel/helpers/-/helpers-7.23.7.tgz#eb543c36f81da2873e47b76ee032343ac83bba60" integrity sha512-6AMnjCoC8wjqBzDHkuqpa7jAKwvMo4dC+lr/TFBz+ucfulO1XMpDnwWPGBNwClOKZ8h6xn5N81W/R5OrcKtCbQ== @@ -403,7 +372,7 @@ resolved "https://registry.npmmirror.com/@babel/parser/-/parser-7.18.11.tgz#68bb07ab3d380affa9a3f96728df07969645d2d9" integrity sha512-9JKn5vN+hDt0Hdqn1PiJ2guflwP+B6Ga8qbDuoF0PzzVhrzsKIJo8yGqVk6CmMHiMei9w1C1Bp9IMJSIK+HPIQ== -"@babel/parser@^7.1.0", "@babel/parser@^7.14.7", "@babel/parser@^7.18.10", "@babel/parser@^7.18.11", "@babel/parser@^7.20.7", "@babel/parser@^7.21.4", "@babel/parser@^7.22.15", "@babel/parser@^7.22.7", "@babel/parser@^7.23.6": +"@babel/parser@^7.1.0", "@babel/parser@^7.14.7", "@babel/parser@^7.18.10", "@babel/parser@^7.18.11", "@babel/parser@^7.20.7", "@babel/parser@^7.22.15", "@babel/parser@^7.22.7", "@babel/parser@^7.23.6": version "7.23.6" resolved "https://registry.npmmirror.com/@babel/parser/-/parser-7.23.6.tgz#ba1c9e512bda72a47e285ae42aff9d2a635a9e3b" integrity sha512-Z2uID7YJ7oNvAI20O9X0bblw7Qqs8Q2hFy0R9tAfnfLkp5MW0UH9eUvnDSnFwKZ0AvgS1ucqR4KzvVHgnke1VQ== @@ -415,7 +384,7 @@ dependencies: "@babel/helper-plugin-utils" "^7.22.5" -"@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining@^7.18.9", "@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining@^7.20.7", "@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining@^7.22.5": +"@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining@^7.18.9", "@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining@^7.22.5": version "7.23.3" resolved "https://registry.npmmirror.com/@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining/-/plugin-bugfix-v8-spread-parameters-in-optional-chaining-7.23.3.tgz#f6652bb16b94f8f9c20c50941e16e9756898dc5d" integrity sha512-WwlxbfMNdVEpQjZmK5mhm7oSwD3dS6eU+Iwsi4Knl9wAletWem7kaRsGOG+8UEbRyqxY4SS5zvtfXwX+jMxUwQ== @@ -424,7 +393,7 @@ "@babel/helper-skip-transparent-expression-wrappers" "^7.22.5" "@babel/plugin-transform-optional-chaining" "^7.23.3" -"@babel/plugin-proposal-async-generator-functions@^7.18.10", "@babel/plugin-proposal-async-generator-functions@^7.20.7": +"@babel/plugin-proposal-async-generator-functions@^7.18.10": version "7.20.7" resolved "https://registry.npmmirror.com/@babel/plugin-proposal-async-generator-functions/-/plugin-proposal-async-generator-functions-7.20.7.tgz#bfb7276d2d573cb67ba379984a2334e262ba5326" integrity sha512-xMbiLsn/8RK7Wq7VeVytytS2L6qE69bXPB10YCmMdDZbKF4okCqY74pI/jJQ/8U0b/F6NrT2+14b8/P9/3AMGA== @@ -442,7 +411,7 @@ "@babel/helper-create-class-features-plugin" "^7.18.6" "@babel/helper-plugin-utils" "^7.18.6" -"@babel/plugin-proposal-class-static-block@^7.18.6", "@babel/plugin-proposal-class-static-block@^7.21.0": +"@babel/plugin-proposal-class-static-block@^7.18.6": version "7.21.0" resolved "https://registry.npmmirror.com/@babel/plugin-proposal-class-static-block/-/plugin-proposal-class-static-block-7.21.0.tgz#77bdd66fb7b605f3a61302d224bdfacf5547977d" integrity sha512-XP5G9MWNUskFuP30IfFSEFB0Z6HzLIUcjYM4bYOPHXl7eiJ9HFv8tWj6TXTN5QODiEhDZAeI4hLok2iHFFV4hw== @@ -491,7 +460,7 @@ "@babel/helper-plugin-utils" "^7.18.6" "@babel/plugin-syntax-json-strings" "^7.8.3" -"@babel/plugin-proposal-logical-assignment-operators@^7.18.9", "@babel/plugin-proposal-logical-assignment-operators@^7.20.7": +"@babel/plugin-proposal-logical-assignment-operators@^7.18.9": version "7.20.7" resolved "https://registry.npmmirror.com/@babel/plugin-proposal-logical-assignment-operators/-/plugin-proposal-logical-assignment-operators-7.20.7.tgz#dfbcaa8f7b4d37b51e8bfb46d94a5aea2bb89d83" integrity sha512-y7C7cZgpMIjWlKE5T7eJwp+tnRYM89HmRvWM5EQuB5BoHEONjmQ8lSNmBUwOyy/GFRsohJED51YBF79hE1djug== @@ -526,7 +495,7 @@ "@babel/plugin-syntax-object-rest-spread" "^7.8.3" "@babel/plugin-transform-parameters" "^7.18.8" -"@babel/plugin-proposal-object-rest-spread@7.20.7", "@babel/plugin-proposal-object-rest-spread@^7.18.9", "@babel/plugin-proposal-object-rest-spread@^7.20.7": +"@babel/plugin-proposal-object-rest-spread@7.20.7", "@babel/plugin-proposal-object-rest-spread@^7.18.9": version "7.20.7" resolved "https://registry.npmmirror.com/@babel/plugin-proposal-object-rest-spread/-/plugin-proposal-object-rest-spread-7.20.7.tgz#aa662940ef425779c75534a5c41e9d936edc390a" integrity sha512-d2S98yCiLxDVmBmE8UjGcfPvNEUbA1U5q5WxaWFUGRzJSVAZqm5W6MbPct0jxnegUZ0niLeNX+IOzEs7wYg9Dg== @@ -545,7 +514,7 @@ "@babel/helper-plugin-utils" "^7.18.6" "@babel/plugin-syntax-optional-catch-binding" "^7.8.3" -"@babel/plugin-proposal-optional-chaining@7.21.0", "@babel/plugin-proposal-optional-chaining@^7.18.9", "@babel/plugin-proposal-optional-chaining@^7.21.0": +"@babel/plugin-proposal-optional-chaining@7.21.0", "@babel/plugin-proposal-optional-chaining@^7.18.9": version "7.21.0" resolved "https://registry.npmmirror.com/@babel/plugin-proposal-optional-chaining/-/plugin-proposal-optional-chaining-7.21.0.tgz#886f5c8978deb7d30f678b2e24346b287234d3ea" integrity sha512-p4zeefM72gpmEe2fkUr/OnOXpWEf8nAgk7ZYVqqfFiyIG7oFfVZcCrU64hWn5xp4tQ9LkV4bTIa5rD0KANpKNA== @@ -567,7 +536,7 @@ resolved "https://registry.npmmirror.com/@babel/plugin-proposal-private-property-in-object/-/plugin-proposal-private-property-in-object-7.21.0-placeholder-for-preset-env.2.tgz#7844f9289546efa9febac2de4cfe358a050bd703" integrity sha512-SOSkfJDddaM7mak6cPEpswyTRnuRltl429hMraQEglW+OkovnCzsiszTmsrlY//qLFjCpQDFRvjdm2wA5pPm9w== -"@babel/plugin-proposal-private-property-in-object@^7.18.6", "@babel/plugin-proposal-private-property-in-object@^7.21.0": +"@babel/plugin-proposal-private-property-in-object@^7.18.6": version "7.21.11" resolved "https://registry.npmmirror.com/@babel/plugin-proposal-private-property-in-object/-/plugin-proposal-private-property-in-object-7.21.11.tgz#69d597086b6760c4126525cfa154f34631ff272c" integrity sha512-0QZ8qP/3RLDVBwBFoWAwCtgcDZJVwA5LUJRZU8x2YFfKNuFq161wK3cuGrALu5yiPu+vzwTAg/sMWVNeWeNyaw== @@ -634,7 +603,7 @@ dependencies: "@babel/helper-plugin-utils" "^7.8.3" -"@babel/plugin-syntax-import-assertions@^7.18.6", "@babel/plugin-syntax-import-assertions@^7.20.0", "@babel/plugin-syntax-import-assertions@^7.22.5": +"@babel/plugin-syntax-import-assertions@^7.18.6", "@babel/plugin-syntax-import-assertions@^7.22.5": version "7.23.3" resolved "https://registry.npmmirror.com/@babel/plugin-syntax-import-assertions/-/plugin-syntax-import-assertions-7.23.3.tgz#9c05a7f592982aff1a2768260ad84bcd3f0c77fc" integrity sha512-lPgDSU+SJLK3xmFDTV2ZRQAiM7UuUjGidwBywFavObCiZc1BeAAcMtHJKUya92hPHO+at63JJPLygilZard8jw== @@ -740,7 +709,7 @@ "@babel/helper-create-regexp-features-plugin" "^7.18.6" "@babel/helper-plugin-utils" "^7.18.6" -"@babel/plugin-transform-arrow-functions@^7.18.6", "@babel/plugin-transform-arrow-functions@^7.20.7", "@babel/plugin-transform-arrow-functions@^7.22.5": +"@babel/plugin-transform-arrow-functions@^7.18.6", "@babel/plugin-transform-arrow-functions@^7.22.5": version "7.23.3" resolved "https://registry.npmmirror.com/@babel/plugin-transform-arrow-functions/-/plugin-transform-arrow-functions-7.23.3.tgz#94c6dcfd731af90f27a79509f9ab7fb2120fc38b" integrity sha512-NzQcQrzaQPkaEwoTm4Mhyl8jI1huEL/WWIEvudjTCMJ9aBZNpsJbMASx7EQECtQQPS/DcnFpo0FIh3LvEO9cxQ== @@ -757,7 +726,7 @@ "@babel/helper-remap-async-to-generator" "^7.22.20" "@babel/plugin-syntax-async-generators" "^7.8.4" -"@babel/plugin-transform-async-to-generator@^7.18.6", "@babel/plugin-transform-async-to-generator@^7.20.7", "@babel/plugin-transform-async-to-generator@^7.22.5": +"@babel/plugin-transform-async-to-generator@^7.18.6", "@babel/plugin-transform-async-to-generator@^7.22.5": version "7.23.3" resolved "https://registry.npmmirror.com/@babel/plugin-transform-async-to-generator/-/plugin-transform-async-to-generator-7.23.3.tgz#d1f513c7a8a506d43f47df2bf25f9254b0b051fa" integrity sha512-A7LFsKi4U4fomjqXJlZg/u0ft/n8/7n7lpffUP/ZULx/DtV9SGlNKZolHH6PE8Xl1ngCc0M11OaeZptXVkfKSw== @@ -773,7 +742,7 @@ dependencies: "@babel/helper-plugin-utils" "^7.22.5" -"@babel/plugin-transform-block-scoping@^7.18.9", "@babel/plugin-transform-block-scoping@^7.21.0", "@babel/plugin-transform-block-scoping@^7.22.5": +"@babel/plugin-transform-block-scoping@^7.18.9", "@babel/plugin-transform-block-scoping@^7.22.5": version "7.23.4" resolved "https://registry.npmmirror.com/@babel/plugin-transform-block-scoping/-/plugin-transform-block-scoping-7.23.4.tgz#b2d38589531c6c80fbe25e6b58e763622d2d3cf5" integrity sha512-0QqbP6B6HOh7/8iNR4CQU2Th/bbRtBp4KS9vcaZd1fZ0wSh5Fyssg0UCIHwxh+ka+pNDREbVLQnHCMHKZfPwfw== @@ -797,7 +766,7 @@ "@babel/helper-plugin-utils" "^7.22.5" "@babel/plugin-syntax-class-static-block" "^7.14.5" -"@babel/plugin-transform-classes@^7.18.9", "@babel/plugin-transform-classes@^7.21.0", "@babel/plugin-transform-classes@^7.22.6": +"@babel/plugin-transform-classes@^7.18.9", "@babel/plugin-transform-classes@^7.22.6": version "7.23.5" resolved "https://registry.npmmirror.com/@babel/plugin-transform-classes/-/plugin-transform-classes-7.23.5.tgz#e7a75f815e0c534cc4c9a39c56636c84fc0d64f2" integrity sha512-jvOTR4nicqYC9yzOHIhXG5emiFEOpappSJAl73SDSEDcybD+Puuze8Tnpb9p9qEyYup24tq891gkaygIFvWDqg== @@ -812,7 +781,7 @@ "@babel/helper-split-export-declaration" "^7.22.6" globals "^11.1.0" -"@babel/plugin-transform-computed-properties@^7.18.9", "@babel/plugin-transform-computed-properties@^7.20.7", "@babel/plugin-transform-computed-properties@^7.22.5": +"@babel/plugin-transform-computed-properties@^7.18.9", "@babel/plugin-transform-computed-properties@^7.22.5": version "7.23.3" resolved "https://registry.npmmirror.com/@babel/plugin-transform-computed-properties/-/plugin-transform-computed-properties-7.23.3.tgz#652e69561fcc9d2b50ba4f7ac7f60dcf65e86474" integrity sha512-dTj83UVTLw/+nbiHqQSFdwO9CbTtwq1DsDqm3CUEtDrZNET5rT5E6bIdTlOftDTDLMYxvxHNEYO4B9SLl8SLZw== @@ -820,7 +789,7 @@ "@babel/helper-plugin-utils" "^7.22.5" "@babel/template" "^7.22.15" -"@babel/plugin-transform-destructuring@^7.18.9", "@babel/plugin-transform-destructuring@^7.21.3", "@babel/plugin-transform-destructuring@^7.22.5": +"@babel/plugin-transform-destructuring@^7.18.9", "@babel/plugin-transform-destructuring@^7.22.5": version "7.23.3" resolved "https://registry.npmmirror.com/@babel/plugin-transform-destructuring/-/plugin-transform-destructuring-7.23.3.tgz#8c9ee68228b12ae3dff986e56ed1ba4f3c446311" integrity sha512-n225npDqjDIr967cMScVKHXJs7rout1q+tt50inyBCPkyZ8KxeI6d+GIbSBTT/w/9WdlWDOej3V9HE5Lgk57gw== @@ -866,7 +835,7 @@ "@babel/helper-plugin-utils" "^7.22.5" "@babel/plugin-syntax-export-namespace-from" "^7.8.3" -"@babel/plugin-transform-for-of@^7.18.8", "@babel/plugin-transform-for-of@^7.21.0", "@babel/plugin-transform-for-of@^7.22.5": +"@babel/plugin-transform-for-of@^7.18.8", "@babel/plugin-transform-for-of@^7.22.5": version "7.23.6" resolved "https://registry.npmmirror.com/@babel/plugin-transform-for-of/-/plugin-transform-for-of-7.23.6.tgz#81c37e24171b37b370ba6aaffa7ac86bcb46f94e" integrity sha512-aYH4ytZ0qSuBbpfhuofbg/e96oQ7U2w1Aw/UQmKT+1l39uEhUPoFS3fHevDc1G0OvewyDudfMKY1OulczHzWIw== @@ -913,7 +882,7 @@ dependencies: "@babel/helper-plugin-utils" "^7.22.5" -"@babel/plugin-transform-modules-amd@^7.18.6", "@babel/plugin-transform-modules-amd@^7.20.11", "@babel/plugin-transform-modules-amd@^7.22.5": +"@babel/plugin-transform-modules-amd@^7.18.6", "@babel/plugin-transform-modules-amd@^7.22.5": version "7.23.3" resolved "https://registry.npmmirror.com/@babel/plugin-transform-modules-amd/-/plugin-transform-modules-amd-7.23.3.tgz#e19b55436a1416829df0a1afc495deedfae17f7d" integrity sha512-vJYQGxeKM4t8hYCKVBlZX/gtIY2I7mRGFNcm85sgXGMTBcoV3QdVtdpbcWEbzbfUIUZKwvgFT82mRvaQIebZzw== @@ -921,7 +890,7 @@ "@babel/helper-module-transforms" "^7.23.3" "@babel/helper-plugin-utils" "^7.22.5" -"@babel/plugin-transform-modules-commonjs@^7.18.6", "@babel/plugin-transform-modules-commonjs@^7.21.2", "@babel/plugin-transform-modules-commonjs@^7.22.5", "@babel/plugin-transform-modules-commonjs@^7.23.3": +"@babel/plugin-transform-modules-commonjs@^7.18.6", "@babel/plugin-transform-modules-commonjs@^7.22.5", "@babel/plugin-transform-modules-commonjs@^7.23.3": version "7.23.3" resolved "https://registry.npmmirror.com/@babel/plugin-transform-modules-commonjs/-/plugin-transform-modules-commonjs-7.23.3.tgz#661ae831b9577e52be57dd8356b734f9700b53b4" integrity sha512-aVS0F65LKsdNOtcz6FRCpE4OgsP2OFnW46qNxNIX9h3wuzaNcSQsJysuMwqSibC98HPrf2vCgtxKNwS0DAlgcA== @@ -930,7 +899,7 @@ "@babel/helper-plugin-utils" "^7.22.5" "@babel/helper-simple-access" "^7.22.5" -"@babel/plugin-transform-modules-systemjs@^7.18.9", "@babel/plugin-transform-modules-systemjs@^7.20.11", "@babel/plugin-transform-modules-systemjs@^7.22.5": +"@babel/plugin-transform-modules-systemjs@^7.18.9", "@babel/plugin-transform-modules-systemjs@^7.22.5": version "7.23.3" resolved "https://registry.npmmirror.com/@babel/plugin-transform-modules-systemjs/-/plugin-transform-modules-systemjs-7.23.3.tgz#fa7e62248931cb15b9404f8052581c302dd9de81" integrity sha512-ZxyKGTkF9xT9YJuKQRo19ewf3pXpopuYQd8cDXqNzc3mUNbOME0RKMoZxviQk74hwzfQsEe66dE92MaZbdHKNQ== @@ -948,7 +917,7 @@ "@babel/helper-module-transforms" "^7.23.3" "@babel/helper-plugin-utils" "^7.22.5" -"@babel/plugin-transform-named-capturing-groups-regex@^7.18.6", "@babel/plugin-transform-named-capturing-groups-regex@^7.20.5", "@babel/plugin-transform-named-capturing-groups-regex@^7.22.5": +"@babel/plugin-transform-named-capturing-groups-regex@^7.18.6", "@babel/plugin-transform-named-capturing-groups-regex@^7.22.5": version "7.22.5" resolved "https://registry.npmmirror.com/@babel/plugin-transform-named-capturing-groups-regex/-/plugin-transform-named-capturing-groups-regex-7.22.5.tgz#67fe18ee8ce02d57c855185e27e3dc959b2e991f" integrity sha512-YgLLKmS3aUBhHaxp5hi1WJTgOUb/NCuDHzGT9z9WTt3YG+CPRhJs6nprbStx6DnWM4dh6gt7SU3sZodbZ08adQ== @@ -1015,7 +984,7 @@ "@babel/helper-skip-transparent-expression-wrappers" "^7.22.5" "@babel/plugin-syntax-optional-chaining" "^7.8.3" -"@babel/plugin-transform-parameters@^7.18.8", "@babel/plugin-transform-parameters@^7.20.7", "@babel/plugin-transform-parameters@^7.21.3", "@babel/plugin-transform-parameters@^7.22.5", "@babel/plugin-transform-parameters@^7.23.3": +"@babel/plugin-transform-parameters@^7.18.8", "@babel/plugin-transform-parameters@^7.20.7", "@babel/plugin-transform-parameters@^7.22.5", "@babel/plugin-transform-parameters@^7.23.3": version "7.23.3" resolved "https://registry.npmmirror.com/@babel/plugin-transform-parameters/-/plugin-transform-parameters-7.23.3.tgz#83ef5d1baf4b1072fa6e54b2b0999a7b2527e2af" integrity sha512-09lMt6UsUb3/34BbECKVbVwrT9bO6lILWln237z7sLaWnMsTi7Yc9fhX5DLpkJzAGfaReXI22wP41SZmnAA3Vw== @@ -1047,7 +1016,7 @@ dependencies: "@babel/helper-plugin-utils" "^7.22.5" -"@babel/plugin-transform-regenerator@^7.18.6", "@babel/plugin-transform-regenerator@^7.20.5", "@babel/plugin-transform-regenerator@^7.22.5": +"@babel/plugin-transform-regenerator@^7.18.6", "@babel/plugin-transform-regenerator@^7.22.5": version "7.23.3" resolved "https://registry.npmmirror.com/@babel/plugin-transform-regenerator/-/plugin-transform-regenerator-7.23.3.tgz#141afd4a2057298602069fce7f2dc5173e6c561c" integrity sha512-KP+75h0KghBMcVpuKisx3XTu9Ncut8Q8TuvGO4IhY+9D5DFEckQefOuIsB/gQ2tG71lCke4NMrtIPS8pOj18BQ== @@ -1074,18 +1043,6 @@ babel-plugin-polyfill-regenerator "^0.4.0" semver "^6.3.0" -"@babel/plugin-transform-runtime@7.21.4": - version "7.21.4" - resolved "https://registry.npmmirror.com/@babel/plugin-transform-runtime/-/plugin-transform-runtime-7.21.4.tgz#2e1da21ca597a7d01fc96b699b21d8d2023191aa" - integrity sha512-1J4dhrw1h1PqnNNpzwxQ2UBymJUF8KuPjAAnlLwZcGhHAIqUigFW7cdK6GHoB64ubY4qXQNYknoUeks4Wz7CUA== - dependencies: - "@babel/helper-module-imports" "^7.21.4" - "@babel/helper-plugin-utils" "^7.20.2" - babel-plugin-polyfill-corejs2 "^0.3.3" - babel-plugin-polyfill-corejs3 "^0.6.0" - babel-plugin-polyfill-regenerator "^0.4.1" - semver "^6.3.0" - "@babel/plugin-transform-runtime@7.22.9": version "7.22.9" resolved "https://registry.npmmirror.com/@babel/plugin-transform-runtime/-/plugin-transform-runtime-7.22.9.tgz#a87b11e170cbbfb018e6a2bf91f5c6e533b9e027" @@ -1105,7 +1062,7 @@ dependencies: "@babel/helper-plugin-utils" "^7.22.5" -"@babel/plugin-transform-spread@^7.18.9", "@babel/plugin-transform-spread@^7.20.7", "@babel/plugin-transform-spread@^7.22.5": +"@babel/plugin-transform-spread@^7.18.9", "@babel/plugin-transform-spread@^7.22.5": version "7.23.3" resolved "https://registry.npmmirror.com/@babel/plugin-transform-spread/-/plugin-transform-spread-7.23.3.tgz#41d17aacb12bde55168403c6f2d6bdca563d362c" integrity sha512-VvfVYlrlBVu+77xVTOAoxQ6mZbnIq5FM0aGBSFEcIh03qHf+zNqA4DC/3XMUozTg7bZV3e3mZQ0i13VB6v5yUg== @@ -1256,87 +1213,6 @@ core-js-compat "^3.22.1" semver "^6.3.0" -"@babel/preset-env@7.21.4": - version "7.21.4" - resolved "https://registry.npmmirror.com/@babel/preset-env/-/preset-env-7.21.4.tgz#a952482e634a8dd8271a3fe5459a16eb10739c58" - integrity sha512-2W57zHs2yDLm6GD5ZpvNn71lZ0B/iypSdIeq25OurDKji6AdzV07qp4s3n1/x5BqtiGaTrPN3nerlSCaC5qNTw== - dependencies: - "@babel/compat-data" "^7.21.4" - "@babel/helper-compilation-targets" "^7.21.4" - "@babel/helper-plugin-utils" "^7.20.2" - "@babel/helper-validator-option" "^7.21.0" - "@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression" "^7.18.6" - "@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining" "^7.20.7" - "@babel/plugin-proposal-async-generator-functions" "^7.20.7" - "@babel/plugin-proposal-class-properties" "^7.18.6" - "@babel/plugin-proposal-class-static-block" "^7.21.0" - "@babel/plugin-proposal-dynamic-import" "^7.18.6" - "@babel/plugin-proposal-export-namespace-from" "^7.18.9" - "@babel/plugin-proposal-json-strings" "^7.18.6" - "@babel/plugin-proposal-logical-assignment-operators" "^7.20.7" - "@babel/plugin-proposal-nullish-coalescing-operator" "^7.18.6" - "@babel/plugin-proposal-numeric-separator" "^7.18.6" - "@babel/plugin-proposal-object-rest-spread" "^7.20.7" - "@babel/plugin-proposal-optional-catch-binding" "^7.18.6" - "@babel/plugin-proposal-optional-chaining" "^7.21.0" - "@babel/plugin-proposal-private-methods" "^7.18.6" - "@babel/plugin-proposal-private-property-in-object" "^7.21.0" - "@babel/plugin-proposal-unicode-property-regex" "^7.18.6" - "@babel/plugin-syntax-async-generators" "^7.8.4" - "@babel/plugin-syntax-class-properties" "^7.12.13" - "@babel/plugin-syntax-class-static-block" "^7.14.5" - "@babel/plugin-syntax-dynamic-import" "^7.8.3" - "@babel/plugin-syntax-export-namespace-from" "^7.8.3" - "@babel/plugin-syntax-import-assertions" "^7.20.0" - "@babel/plugin-syntax-json-strings" "^7.8.3" - "@babel/plugin-syntax-logical-assignment-operators" "^7.10.4" - "@babel/plugin-syntax-nullish-coalescing-operator" "^7.8.3" - "@babel/plugin-syntax-numeric-separator" "^7.10.4" - "@babel/plugin-syntax-object-rest-spread" "^7.8.3" - "@babel/plugin-syntax-optional-catch-binding" "^7.8.3" - "@babel/plugin-syntax-optional-chaining" "^7.8.3" - "@babel/plugin-syntax-private-property-in-object" "^7.14.5" - "@babel/plugin-syntax-top-level-await" "^7.14.5" - "@babel/plugin-transform-arrow-functions" "^7.20.7" - "@babel/plugin-transform-async-to-generator" "^7.20.7" - "@babel/plugin-transform-block-scoped-functions" "^7.18.6" - "@babel/plugin-transform-block-scoping" "^7.21.0" - "@babel/plugin-transform-classes" "^7.21.0" - "@babel/plugin-transform-computed-properties" "^7.20.7" - "@babel/plugin-transform-destructuring" "^7.21.3" - "@babel/plugin-transform-dotall-regex" "^7.18.6" - "@babel/plugin-transform-duplicate-keys" "^7.18.9" - "@babel/plugin-transform-exponentiation-operator" "^7.18.6" - "@babel/plugin-transform-for-of" "^7.21.0" - "@babel/plugin-transform-function-name" "^7.18.9" - "@babel/plugin-transform-literals" "^7.18.9" - "@babel/plugin-transform-member-expression-literals" "^7.18.6" - "@babel/plugin-transform-modules-amd" "^7.20.11" - "@babel/plugin-transform-modules-commonjs" "^7.21.2" - "@babel/plugin-transform-modules-systemjs" "^7.20.11" - "@babel/plugin-transform-modules-umd" "^7.18.6" - "@babel/plugin-transform-named-capturing-groups-regex" "^7.20.5" - "@babel/plugin-transform-new-target" "^7.18.6" - "@babel/plugin-transform-object-super" "^7.18.6" - "@babel/plugin-transform-parameters" "^7.21.3" - "@babel/plugin-transform-property-literals" "^7.18.6" - "@babel/plugin-transform-regenerator" "^7.20.5" - "@babel/plugin-transform-reserved-words" "^7.18.6" - "@babel/plugin-transform-shorthand-properties" "^7.18.6" - "@babel/plugin-transform-spread" "^7.20.7" - "@babel/plugin-transform-sticky-regex" "^7.18.6" - "@babel/plugin-transform-template-literals" "^7.18.9" - "@babel/plugin-transform-typeof-symbol" "^7.18.9" - "@babel/plugin-transform-unicode-escapes" "^7.18.10" - "@babel/plugin-transform-unicode-regex" "^7.18.6" - "@babel/preset-modules" "^0.1.5" - "@babel/types" "^7.21.4" - babel-plugin-polyfill-corejs2 "^0.3.3" - babel-plugin-polyfill-corejs3 "^0.6.0" - babel-plugin-polyfill-regenerator "^0.4.1" - core-js-compat "^3.25.1" - semver "^6.3.0" - "@babel/preset-env@7.22.9": version "7.22.9" resolved "https://registry.npmmirror.com/@babel/preset-env/-/preset-env-7.22.9.tgz#57f17108eb5dfd4c5c25a44c1977eba1df310ac7" @@ -1434,7 +1310,7 @@ "@babel/types" "^7.4.4" esutils "^2.0.2" -"@babel/preset-typescript@^7.18.6", "@babel/preset-typescript@^7.21.4", "@babel/preset-typescript@^7.22.5": +"@babel/preset-typescript@^7.18.6", "@babel/preset-typescript@^7.22.5": version "7.23.3" resolved "https://registry.npmmirror.com/@babel/preset-typescript/-/preset-typescript-7.23.3.tgz#14534b34ed5b6d435aa05f1ae1c5e7adcc01d913" integrity sha512-17oIGVlqz6CchO9RFYn5U6ZpWRZIngayYCtrPRSgANSwC2V1Jb+iP74nVxzzXJte8b8BYxrL1yY96xfhTBrNNQ== @@ -1468,7 +1344,7 @@ dependencies: regenerator-runtime "^0.14.0" -"@babel/template@^7.18.10", "@babel/template@^7.20.7", "@babel/template@^7.22.15", "@babel/template@^7.22.5", "@babel/template@^7.3.3": +"@babel/template@^7.18.10", "@babel/template@^7.22.15", "@babel/template@^7.22.5", "@babel/template@^7.3.3": version "7.22.15" resolved "https://registry.npmmirror.com/@babel/template/-/template-7.22.15.tgz#09576efc3830f0430f4548ef971dde1350ef2f38" integrity sha512-QPErUVm4uyJa60rkI73qneDacvdvzxshT3kksGqlGWYdOTIUOwJ7RDUL8sGqslY1uXWSL6xMFKEXDS3ox2uF0w== @@ -1493,22 +1369,6 @@ debug "^4.1.0" globals "^11.1.0" -"@babel/traverse@7.21.4": - version "7.21.4" - resolved "https://registry.npmmirror.com/@babel/traverse/-/traverse-7.21.4.tgz#a836aca7b116634e97a6ed99976236b3282c9d36" - integrity sha512-eyKrRHKdyZxqDm+fV1iqL9UAHMoIg0nDaGqfIOd8rKH17m5snv7Gn4qgjBoFfLz9APvjFU/ICT00NVCv1Epp8Q== - dependencies: - "@babel/code-frame" "^7.21.4" - "@babel/generator" "^7.21.4" - "@babel/helper-environment-visitor" "^7.18.9" - "@babel/helper-function-name" "^7.21.0" - "@babel/helper-hoist-variables" "^7.18.6" - "@babel/helper-split-export-declaration" "^7.18.6" - "@babel/parser" "^7.21.4" - "@babel/types" "^7.21.4" - debug "^4.1.0" - globals "^11.1.0" - "@babel/traverse@7.22.8": version "7.22.8" resolved "https://registry.npmmirror.com/@babel/traverse/-/traverse-7.22.8.tgz#4d4451d31bc34efeae01eac222b514a77aa4000e" @@ -1525,7 +1385,23 @@ debug "^4.1.0" globals "^11.1.0" -"@babel/traverse@^7.18.10", "@babel/traverse@^7.21.4", "@babel/traverse@^7.22.8", "@babel/traverse@^7.23.7": +"@babel/traverse@7.23.6": + version "7.23.6" + resolved "https://registry.npmjs.org/@babel/traverse/-/traverse-7.23.6.tgz#b53526a2367a0dd6edc423637f3d2d0f2521abc5" + integrity sha512-czastdK1e8YByZqezMPFiZ8ahwVMh/ESl9vPgvgdB9AmFMGP5jfpFax74AQgl5zj4XHzqeYAg2l8PuUeRS1MgQ== + dependencies: + "@babel/code-frame" "^7.23.5" + "@babel/generator" "^7.23.6" + "@babel/helper-environment-visitor" "^7.22.20" + "@babel/helper-function-name" "^7.23.0" + "@babel/helper-hoist-variables" "^7.22.5" + "@babel/helper-split-export-declaration" "^7.22.6" + "@babel/parser" "^7.23.6" + "@babel/types" "^7.23.6" + debug "^4.3.1" + globals "^11.1.0" + +"@babel/traverse@^7.18.10", "@babel/traverse@^7.22.8", "@babel/traverse@^7.23.7": version "7.23.7" resolved "https://registry.npmmirror.com/@babel/traverse/-/traverse-7.23.7.tgz#9a7bf285c928cb99b5ead19c3b1ce5b310c9c305" integrity sha512-tY3mM8rH9jM0YHFGyfC0/xf+SB5eKUu7HPj7/k3fpi9dAlsMc5YbQvDi0Sh2QTPXqMhyaAtzAr807TIyfQrmyg== @@ -1550,15 +1426,6 @@ "@babel/helper-validator-identifier" "^7.18.6" to-fast-properties "^2.0.0" -"@babel/types@7.21.4": - version "7.21.4" - resolved "https://registry.npmmirror.com/@babel/types/-/types-7.21.4.tgz#2d5d6bb7908699b3b416409ffd3b5daa25b030d4" - integrity sha512-rU2oY501qDxE8Pyo7i/Orqma4ziCOrby0/9mvbDUGEfvZjb279Nk9k19e2fiCxHbRRpY2ZyrgW1eq22mvmOIzA== - dependencies: - "@babel/helper-string-parser" "^7.19.4" - "@babel/helper-validator-identifier" "^7.19.1" - to-fast-properties "^2.0.0" - "@babel/types@7.22.5": version "7.22.5" resolved "https://registry.npmmirror.com/@babel/types/-/types-7.22.5.tgz#cd93eeaab025880a3a47ec881f4b096a5b786fbe" @@ -1568,7 +1435,7 @@ "@babel/helper-validator-identifier" "^7.22.5" to-fast-properties "^2.0.0" -"@babel/types@^7.0.0", "@babel/types@^7.18.10", "@babel/types@^7.20.7", "@babel/types@^7.21.4", "@babel/types@^7.22.15", "@babel/types@^7.22.19", "@babel/types@^7.22.5", "@babel/types@^7.23.0", "@babel/types@^7.23.6", "@babel/types@^7.3.3", "@babel/types@^7.4.4": +"@babel/types@7.23.6", "@babel/types@^7.0.0", "@babel/types@^7.18.10", "@babel/types@^7.20.7", "@babel/types@^7.22.15", "@babel/types@^7.22.19", "@babel/types@^7.22.5", "@babel/types@^7.23.0", "@babel/types@^7.23.6", "@babel/types@^7.3.3", "@babel/types@^7.4.4": version "7.23.6" resolved "https://registry.npmmirror.com/@babel/types/-/types-7.23.6.tgz#be33fdb151e1f5a56877d704492c240fc71c7ccd" integrity sha512-+uarb83brBzPKN38NX1MkB6vb6+mwvR6amUulqAE7ccQw1pEl+bCia9TbdG1lsnFP7lZySvUn37CHyXQdfTwzg== @@ -1812,7 +1679,7 @@ "@cosmjs/stream" "^0.29.5" xstream "^11.14.0" -"@cosmjs/json-rpc@^0.32.0", "@cosmjs/json-rpc@^0.32.2": +"@cosmjs/json-rpc@^0.32.2": version "0.32.2" resolved "https://registry.npmmirror.com/@cosmjs/json-rpc/-/json-rpc-0.32.2.tgz#f87fab0d6975ed1d1c7daafcf6f1f81e5e296912" integrity sha512-lan2lOgmz4yVE/HR8eCOSiII/1OudIulk8836koyIDCsPEpt6eKBuctnAD168vABGArKccLAo7Mr2gy9nrKrOQ== @@ -1881,7 +1748,7 @@ ws "^7" xstream "^11.14.0" -"@cosmjs/socket@^0.32.0", "@cosmjs/socket@^0.32.2": +"@cosmjs/socket@^0.32.2": version "0.32.2" resolved "https://registry.npmmirror.com/@cosmjs/socket/-/socket-0.32.2.tgz#a66be3863d03bf2d8df0433af476df010ff10e8c" integrity sha512-Qc8jaw4uSBJm09UwPgkqe3g9TBFx4ZR9HkXpwT6Z9I+6kbLerXPR0Gy3NSJFSUgxIfTpO8O1yqoWAyf0Ay17Mw== @@ -1939,22 +1806,6 @@ dependencies: xstream "^11.14.0" -"@cosmjs/tendermint-rpc@0.32.0": - version "0.32.0" - resolved "https://registry.npmmirror.com/@cosmjs/tendermint-rpc/-/tendermint-rpc-0.32.0.tgz#9acf9030ae20631679dfbaa0611ba618ffe3d192" - integrity sha512-bGH3C0CymIzkROltbqw1iXOEkXJkpjdngJu3hdCdB7bD9xbCWOqB9mT+aLpjNAkzSEAHR4nrWv1JF+3PU2Eggg== - dependencies: - "@cosmjs/crypto" "^0.32.0" - "@cosmjs/encoding" "^0.32.0" - "@cosmjs/json-rpc" "^0.32.0" - "@cosmjs/math" "^0.32.0" - "@cosmjs/socket" "^0.32.0" - "@cosmjs/stream" "^0.32.0" - "@cosmjs/utils" "^0.32.0" - axios "^1.6.0" - readonly-date "^1.0.0" - xstream "^11.14.0" - "@cosmjs/tendermint-rpc@^0.29.2", "@cosmjs/tendermint-rpc@^0.29.4", "@cosmjs/tendermint-rpc@^0.29.5": version "0.29.5" resolved "https://registry.npmmirror.com/@cosmjs/tendermint-rpc/-/tendermint-rpc-0.29.5.tgz#f205c10464212bdf843f91bb2e4a093b618cb5c2" @@ -1997,17 +1848,15 @@ resolved "https://registry.npmmirror.com/@cosmjs/utils/-/utils-0.32.2.tgz#324304aa85bfa6f10561cc17781d824d02130897" integrity sha512-Gg5t+eR7vPJMAmhkFt6CZrzPd0EKpAslWwk5rFVYZpJsM8JG5KT9XQ99hgNM3Ov6ScNoIWbXkpX27F6A9cXR4Q== -"@cosmology/ast@^0.89.0": - version "0.89.0" - resolved "https://registry.npmmirror.com/@cosmology/ast/-/ast-0.89.0.tgz#276a5adad65cfbaf12954575e8f00e5ec5dfdc56" - integrity sha512-9n4HRue86afHWo8TERH/l3Ghj5hJsPXg7nwjQkXnrljKCb3RqfJXaaR9LM383f1lI5K/kYV5rcC2ljuuCTDe1g== +"@cosmology/ast@^1.4.1": + version "1.4.1" + resolved "https://registry.npmjs.org/@cosmology/ast/-/ast-1.4.1.tgz#d895ecc87071a77cb238503c9505770498720d1b" + integrity sha512-isWUqDqie12PhpN5+ow5ut+4d/I7s/X/fDy5hyKkt5apUbo/AjcQL0UFJeF7yyoty2HCyG/b1YJylRwRHi8jgA== dependencies: - "@babel/parser" "^7.21.4" - "@babel/runtime" "^7.21.0" - "@babel/types" "7.21.4" - "@cosmology/proto-parser" "^0.46.0" - "@cosmology/types" "^0.37.0" - "@cosmology/utils" "^0.12.0" + "@babel/parser" "^7.23.6" + "@babel/types" "7.23.6" + "@cosmology/types" "^1.4.0" + "@cosmology/utils" "^1.4.0" case "1.6.3" dotty "0.1.2" @@ -2019,14 +1868,14 @@ "@babel/runtime" "^7.21.0" axios "0.27.2" -"@cosmology/proto-parser@^0.46.0": - version "0.46.0" - resolved "https://registry.npmmirror.com/@cosmology/proto-parser/-/proto-parser-0.46.0.tgz#4b7e9d9dd71cf28bdae71671e15f0148c1be087b" - integrity sha512-MfuOQM9mZd+ZYjJjv/FTVCpj54/YH9GoVpu/WL+OYAE9HZhyCSLHOEu5T5QB2ST1QQwM4862+C+8Dtx/UrqgzA== +"@cosmology/proto-parser@^1.4.0": + version "1.4.0" + resolved "https://registry.npmjs.org/@cosmology/proto-parser/-/proto-parser-1.4.0.tgz#1173e81031158ff715f336935666ae3b1f75d861" + integrity sha512-TVyoUmPnISzXVuegNOYKuvNTwrZwsz/8sGWB6T4/JxKyBOZBn/GuGCnQeMlz+IS0Spr2FExvs//BrjchixvnYQ== dependencies: - "@babel/runtime" "^7.21.0" "@cosmology/protobufjs" "6.11.6" - "@cosmology/types" "^0.37.0" + "@cosmology/types" "^1.4.0" + "@cosmology/utils" "^1.4.0" dotty "0.1.2" glob "8.0.3" minimatch "5.1.0" @@ -2051,27 +1900,19 @@ "@types/node" ">=13.7.0" long "^4.0.0" -"@cosmology/telescope@0.102.0": - version "0.102.0" - resolved "https://registry.npmmirror.com/@cosmology/telescope/-/telescope-0.102.0.tgz#df85956a7405b4bcf568c07e2e6d99b69f979baa" - integrity sha512-V7gKbH0TK6/tom4hl+gR2I12WHafmGqUh7nKNSNDS9GoNNsp4jeoF1LjnQaj3LW6Wjs18kJxKnhrlzfwZMzAuQ== +"@cosmology/telescope@1.4.1": + version "1.4.1" + resolved "https://registry.npmjs.org/@cosmology/telescope/-/telescope-1.4.1.tgz#7b9ce9092982221ab3015ecd1ba4e1bc4aebc490" + integrity sha512-DZpRyag1epExwfqhQndZ7AVn8tnZ7noV5wKpMFHKQT0jXtJNSI4k/G/lCg9rUMQQTgB85YRwunQdOkwJhtj2/A== dependencies: - "@babel/core" "7.21.4" - "@babel/generator" "7.21.4" - "@babel/parser" "^7.21.4" - "@babel/plugin-proposal-class-properties" "7.18.6" - "@babel/plugin-proposal-export-default-from" "7.18.10" - "@babel/plugin-proposal-object-rest-spread" "7.20.7" - "@babel/plugin-transform-runtime" "7.21.4" - "@babel/preset-env" "7.21.4" - "@babel/preset-typescript" "^7.21.4" - "@babel/runtime" "^7.21.0" - "@babel/traverse" "7.21.4" - "@babel/types" "7.21.4" - "@cosmology/ast" "^0.89.0" - "@cosmology/proto-parser" "^0.46.0" - "@cosmology/types" "^0.37.0" - "@cosmology/utils" "^0.12.0" + "@babel/generator" "^7.23.6" + "@babel/parser" "^7.23.6" + "@babel/traverse" "7.23.6" + "@babel/types" "7.23.6" + "@cosmology/ast" "^1.4.1" + "@cosmology/proto-parser" "^1.4.0" + "@cosmology/types" "^1.4.0" + "@cosmology/utils" "^1.4.0" "@cosmwasm/ts-codegen" "0.34.0" "@types/parse-package-name" "0.1.0" case "1.6.3" @@ -2089,21 +1930,20 @@ rimraf "5.0.0" shelljs "0.8.5" -"@cosmology/types@^0.37.0": - version "0.37.0" - resolved "https://registry.npmmirror.com/@cosmology/types/-/types-0.37.0.tgz#5ba8db885c410a0aaef6bb2877018f3fc52969d3" - integrity sha512-2BQ1anhBh9Cs026JqokV6gsURJ38WnOVofccOxzhwa4vLksr/Scxd0gdHmfyyFKtz4GUbtfVsTKzFilGVK//jA== +"@cosmology/types@^1.4.0": + version "1.4.0" + resolved "https://registry.npmjs.org/@cosmology/types/-/types-1.4.0.tgz#fbc46b39f11c2cf0fc110d161d40b6c9e02bc69b" + integrity sha512-DQx63AKl7EX11IFlDUfMX5XmRnz7yqytLXzx3udaQnZln3GpowsAMZEj5f1IoHwfDpOyI5XLPkDAX3dYirjgSQ== dependencies: - "@babel/runtime" "^7.21.0" - "@cosmology/utils" "^0.12.0" case "1.6.3" -"@cosmology/utils@^0.12.0": - version "0.12.0" - resolved "https://registry.npmmirror.com/@cosmology/utils/-/utils-0.12.0.tgz#484ffac7a050284b03aa851ed407d8a057070c1a" - integrity sha512-0B3/4PgIpu4ufbsu6k8lQitW4Pgyy4DCtka+w8DY9FjKucyWGhaLuDXND2d3ftMFsRo8qx1aBDmYS3Kz7ag2Cg== +"@cosmology/utils@^1.4.0": + version "1.4.0" + resolved "https://registry.npmjs.org/@cosmology/utils/-/utils-1.4.0.tgz#246d2a230747675d75a7134b8059ea3e8cc28ced" + integrity sha512-Wh8TSAhJ8u+v4JVK//4T9pTE9bpv6gOyNpwPXS81CV571+sBCUbDyQPLOgovHxy/EqO5NIlC9CNfU5ip54sZ1Q== dependencies: - "@babel/runtime" "^7.21.0" + "@cosmology/types" "^1.4.0" + dotty "0.1.2" "@cosmwasm/ts-codegen@0.34.0": version "0.34.0" @@ -3780,7 +3620,7 @@ babel-plugin-jest-hoist@^29.6.3: "@types/babel__core" "^7.1.14" "@types/babel__traverse" "^7.0.6" -babel-plugin-polyfill-corejs2@^0.3.2, babel-plugin-polyfill-corejs2@^0.3.3: +babel-plugin-polyfill-corejs2@^0.3.2: version "0.3.3" resolved "https://registry.npmmirror.com/babel-plugin-polyfill-corejs2/-/babel-plugin-polyfill-corejs2-0.3.3.tgz#5d1bd3836d0a19e1b84bbf2d9640ccb6f951c122" integrity sha512-8hOdmFYFSZhqg2C/JgLUQ+t52o5nirNwaWM2B9LWteozwIvM14VSwdsCAUET10qT+kmySAlseadmfeeSWFCy+Q== @@ -3806,14 +3646,6 @@ babel-plugin-polyfill-corejs3@^0.5.3: "@babel/helper-define-polyfill-provider" "^0.3.2" core-js-compat "^3.21.0" -babel-plugin-polyfill-corejs3@^0.6.0: - version "0.6.0" - resolved "https://registry.npmmirror.com/babel-plugin-polyfill-corejs3/-/babel-plugin-polyfill-corejs3-0.6.0.tgz#56ad88237137eade485a71b52f72dbed57c6230a" - integrity sha512-+eHqR6OPcBhJOGgsIar7xoAB1GcSwVUA3XjAd7HJNzOXT4wv6/H7KIdA/Nc60cvUlDbKApmqNvD1B1bzOt4nyA== - dependencies: - "@babel/helper-define-polyfill-provider" "^0.3.3" - core-js-compat "^3.25.1" - babel-plugin-polyfill-corejs3@^0.8.2: version "0.8.7" resolved "https://registry.npmmirror.com/babel-plugin-polyfill-corejs3/-/babel-plugin-polyfill-corejs3-0.8.7.tgz#941855aa7fdaac06ed24c730a93450d2b2b76d04" @@ -3822,7 +3654,7 @@ babel-plugin-polyfill-corejs3@^0.8.2: "@babel/helper-define-polyfill-provider" "^0.4.4" core-js-compat "^3.33.1" -babel-plugin-polyfill-regenerator@^0.4.0, babel-plugin-polyfill-regenerator@^0.4.1: +babel-plugin-polyfill-regenerator@^0.4.0: version "0.4.1" resolved "https://registry.npmmirror.com/babel-plugin-polyfill-regenerator/-/babel-plugin-polyfill-regenerator-0.4.1.tgz#390f91c38d90473592ed43351e801a9d3e0fd747" integrity sha512-NtQGmyQDXjQqQ+IzRkBVwEOz9lQ4zxAQZgoAYEtU9dJjnl1Oc98qnN7jcp+bE7O7aYzVpavXE3/VKXNzUbh7aw== @@ -4498,7 +4330,7 @@ convert-source-map@^2.0.0: resolved "https://registry.npmmirror.com/convert-source-map/-/convert-source-map-2.0.0.tgz#4b560f649fc4e918dd0ab75cf4961e8bc882d82a" integrity sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg== -core-js-compat@^3.21.0, core-js-compat@^3.22.1, core-js-compat@^3.25.1, core-js-compat@^3.31.0, core-js-compat@^3.33.1: +core-js-compat@^3.21.0, core-js-compat@^3.22.1, core-js-compat@^3.31.0, core-js-compat@^3.33.1: version "3.35.0" resolved "https://registry.npmmirror.com/core-js-compat/-/core-js-compat-3.35.0.tgz#c149a3d1ab51e743bc1da61e39cb51f461a41873" integrity sha512-5blwFAddknKeNgsjBzilkdQ0+YK8L1PfqPYq40NOYMYFSS38qj+hpTcLLWwpIwA2A5bje/x5jmVn2tzUMg9IVw==